From: support Date: Wed, 6 Apr 2022 14:49:38 +0000 (+0000) Subject: Built motion from commit 286669c0.|2.6.7 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22card-image.png//%22?a=commitdiff_plain;h=6aa992943a8cb85994e6250de4e9a8fa6ad247e2;p=motion2.git Built motion from commit 286669c0.|2.6.7 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 2304ac4..a012c14 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-04-06T14:27:33.892Z", + "time": "2022-04-06T14:41:45.778Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 66ac68c..f7dbaa2 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-06T14:27:33.892Z", + "time": "2022-04-06T14:41:45.778Z", "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 8653e4a..ac613f8 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 _0x38ec=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','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[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x4bfaa3,_0x4c3f7a){var _0x205678=function(_0x549fde){while(--_0x549fde){_0x4bfaa3['push'](_0x4bfaa3['shift']());}};_0x205678(++_0x4c3f7a);}(_0x38ec,0xfa));var _0xc38e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x38ec[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc38e('0x0'));module[_0xc38e('0x1')]={'name':{'type':Sequelize[_0xc38e('0x2')],'get':function(_0x427553){return this[_0xc38e('0x3')](_0xc38e('0x4'));}},'action':{'type':Sequelize[_0xc38e('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc38e('0x6'),_0xc38e('0x7'),'motionbar',_0xc38e('0x8'),_0xc38e('0x9'),_0xc38e('0xa'),_0xc38e('0xb'),_0xc38e('0xc')]],'msg':_0xc38e('0xd')}},'comment':_0xc38e('0xd')},'data1':{'type':Sequelize[_0xc38e('0x5')](0x1000),'comment':_0xc38e('0xe')},'data2':{'type':Sequelize[_0xc38e('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xc38e('0xf')},'data4':{'type':Sequelize[_0xc38e('0x5')](0x1000),'comments':_0xc38e('0x10')},'data5':{'type':Sequelize[_0xc38e('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xc38e('0x5')],'comments':_0xc38e('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xc38e('0x12')}}; \ No newline at end of file +var _0x0c21=['action','integration','jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0c21,0x9e));var _0x10c2=function(_0x10de3d,_0x1371a3){_0x10de3d=_0x10de3d-0x0;var _0x1b7b6d=_0x0c21[_0x10de3d];return _0x1b7b6d;};'use strict';var Sequelize=require(_0x10c2('0x0'));module[_0x10c2('0x1')]={'name':{'type':Sequelize[_0x10c2('0x2')],'get':function(_0x5f22d1){return this[_0x10c2('0x3')](_0x10c2('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x10c2('0x5'),'motionbar',_0x10c2('0x6'),'urlForward',_0x10c2('0x7'),_0x10c2('0x8'),'script']],'msg':_0x10c2('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x10c2('0xa')](0x1000),'comment':_0x10c2('0xb')},'data2':{'type':Sequelize[_0x10c2('0xa')](0x1000),'comment':_0x10c2('0xc')},'data3':{'type':Sequelize[_0x10c2('0xa')](0x1000),'comment':_0x10c2('0xd')},'data4':{'type':Sequelize[_0x10c2('0xa')](0x1000),'comments':_0x10c2('0xe')},'data5':{'type':Sequelize[_0x10c2('0xa')](0x1000),'comments':_0x10c2('0xf')},'data6':{'type':Sequelize[_0x10c2('0xa')],'comments':_0x10c2('0x10')},'data7':{'type':Sequelize[_0x10c2('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 7dbefd8..e9503d2 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 _0xa5ee=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','body','Action','find','catch','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x40e4c3,_0x3a1bb4){var _0x4383af=function(_0x53adfa){while(--_0x53adfa){_0x40e4c3['push'](_0x40e4c3['shift']());}};_0x4383af(++_0x3a1bb4);}(_0xa5ee,0xa8));var _0xea5e=function(_0x3faeac,_0x872ac2){_0x3faeac=_0x3faeac-0x0;var _0x323caf=_0xa5ee[_0x3faeac];return _0x323caf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea5e('0x0'));var zipdir=require(_0xea5e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea5e('0x2'));var moment=require(_0xea5e('0x3'));var BPromise=require(_0xea5e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xea5e('0x5'));var sox=require(_0xea5e('0x6'));var csv=require(_0xea5e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea5e('0x8'));var _=require('lodash');var squel=require(_0xea5e('0x9'));var crypto=require(_0xea5e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xea5e('0xb'));var toCsv=require(_0xea5e('0x7'));var querystring=require(_0xea5e('0xc'));var Papa=require(_0xea5e('0xd'));var Redis=require('ioredis');var authService=require(_0xea5e('0xe'));var qs=require(_0xea5e('0xf'));var as=require(_0xea5e('0x10'));var hardwareService=require(_0xea5e('0x11'));var logger=require(_0xea5e('0x12'))(_0xea5e('0x13'));var utils=require(_0xea5e('0x14'));var config=require(_0xea5e('0x15'));var licenseUtil=require(_0xea5e('0x16'));var db=require(_0xea5e('0x17'))['db'];function respondWithStatusCode(_0x4b4f63,_0x17fba0){_0x17fba0=_0x17fba0||0xcc;return function(_0x17753d){if(_0x17753d){return _0x4b4f63[_0xea5e('0x18')](_0x17fba0);}return _0x4b4f63[_0xea5e('0x19')](_0x17fba0)['end']();};}function respondWithResult(_0x291717,_0x469446){_0x469446=_0x469446||0xc8;return function(_0x2aaddf){if(_0x2aaddf){return _0x291717[_0xea5e('0x19')](_0x469446)[_0xea5e('0x1a')](_0x2aaddf);}};}function respondWithFilteredResult(_0x1ed54a,_0x14e572){return function(_0x3f075c){if(_0x3f075c){var _0x53a8c9=typeof _0x14e572['offset']===_0xea5e('0x1b')&&typeof _0x14e572['limit']===_0xea5e('0x1b');var _0x3d65ed=_0x3f075c['count'];var _0x5533fd=_0x53a8c9?0x0:_0x14e572[_0xea5e('0x1c')];var _0x3c1e52=_0x53a8c9?_0x3f075c[_0xea5e('0x1d')]:_0x14e572[_0xea5e('0x1c')]+_0x14e572[_0xea5e('0x1e')];var _0x4a8e94;if(_0x3c1e52>=_0x3d65ed){_0x3c1e52=_0x3d65ed;_0x4a8e94=0xc8;}else{_0x4a8e94=0xce;}_0x1ed54a[_0xea5e('0x19')](_0x4a8e94);return _0x1ed54a[_0xea5e('0x1f')](_0xea5e('0x20'),_0x5533fd+'-'+_0x3c1e52+'/'+_0x3d65ed)[_0xea5e('0x1a')](_0x3f075c);}return null;};}function patchUpdates(_0x3d8182){return function(_0x45437b){try{jsonpatch[_0xea5e('0x21')](_0x45437b,_0x3d8182,!![]);}catch(_0x349c89){return BPromise[_0xea5e('0x22')](_0x349c89);}return _0x45437b[_0xea5e('0x23')]();};}function saveUpdates(_0x5329f7,_0x1c6497){return function(_0xeffdc8){if(_0xeffdc8){return _0xeffdc8[_0xea5e('0x24')](_0x5329f7)[_0xea5e('0x25')](function(_0x26769a){return _0x26769a;});}return null;};}function removeEntity(_0x4aca12,_0x1b8064){return function(_0x5b0860){if(_0x5b0860){return _0x5b0860[_0xea5e('0x26')]()[_0xea5e('0x25')](function(){_0x4aca12['status'](0xcc)[_0xea5e('0x27')]();});}};}function handleEntityNotFound(_0xfd06e1,_0xa0ec7b){return function(_0xcb4983){if(!_0xcb4983){_0xfd06e1[_0xea5e('0x18')](0x194);}return _0xcb4983;};}function handleError(_0x191cde,_0x288ccf){_0x288ccf=_0x288ccf||0x1f4;return function(_0x40a63b){logger[_0xea5e('0x28')](_0x40a63b[_0xea5e('0x29')]);if(_0x40a63b[_0xea5e('0x2a')]){delete _0x40a63b[_0xea5e('0x2a')];}_0x191cde['status'](_0x288ccf)['send'](_0x40a63b);};}exports[_0xea5e('0x24')]=function(_0x31d1ec,_0x51bd76){if(_0x31d1ec[_0xea5e('0x2b')]['id']){delete _0x31d1ec[_0xea5e('0x2b')]['id'];}return db[_0xea5e('0x2c')][_0xea5e('0x2d')]({'where':{'id':_0x31d1ec['params']['id']}})[_0xea5e('0x25')](handleEntityNotFound(_0x51bd76,null))[_0xea5e('0x25')](saveUpdates(_0x31d1ec[_0xea5e('0x2b')],null))['then'](respondWithResult(_0x51bd76,null))[_0xea5e('0x2e')](handleError(_0x51bd76,null));};exports[_0xea5e('0x26')]=function(_0xb55e3c,_0xc2b3c7){return db[_0xea5e('0x2c')][_0xea5e('0x2d')]({'where':{'id':_0xb55e3c['params']['id']}})[_0xea5e('0x25')](handleEntityNotFound(_0xc2b3c7,null))[_0xea5e('0x25')](removeEntity(_0xc2b3c7,null))[_0xea5e('0x2e')](handleError(_0xc2b3c7,null));}; \ No newline at end of file +var _0xfa32=['mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','name','send','body','Action','find','params','catch','destroy','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa32,0x110));var _0x2fa3=function(_0x573e73,_0x54b67b){_0x573e73=_0x573e73-0x0;var _0x2443c2=_0xfa32[_0x573e73];return _0x2443c2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2fa3('0x0'));var jsonpatch=require(_0x2fa3('0x1'));var rp=require(_0x2fa3('0x2'));var moment=require(_0x2fa3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2fa3('0x4'));var util=require(_0x2fa3('0x5'));var path=require(_0x2fa3('0x6'));var sox=require(_0x2fa3('0x7'));var csv=require('to-csv');var ejs=require(_0x2fa3('0x8'));var fs=require('fs');var fs_extra=require(_0x2fa3('0x9'));var _=require(_0x2fa3('0xa'));var squel=require(_0x2fa3('0xb'));var crypto=require(_0x2fa3('0xc'));var jsforce=require(_0x2fa3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2fa3('0xe'));var querystring=require(_0x2fa3('0xf'));var Papa=require(_0x2fa3('0x10'));var Redis=require(_0x2fa3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2fa3('0x12'));var as=require(_0x2fa3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2fa3('0x14'))(_0x2fa3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2fa3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18cd2d,_0x2440de){_0x2440de=_0x2440de||0xcc;return function(_0x32c2f9){if(_0x32c2f9){return _0x18cd2d[_0x2fa3('0x17')](_0x2440de);}return _0x18cd2d[_0x2fa3('0x18')](_0x2440de)[_0x2fa3('0x19')]();};}function respondWithResult(_0x48a1a6,_0xf7ce54){_0xf7ce54=_0xf7ce54||0xc8;return function(_0x1c5099){if(_0x1c5099){return _0x48a1a6['status'](_0xf7ce54)[_0x2fa3('0x1a')](_0x1c5099);}};}function respondWithFilteredResult(_0xd7bf67,_0x4569d5){return function(_0x5cb03d){if(_0x5cb03d){var _0x4f7831=typeof _0x4569d5[_0x2fa3('0x1b')]==='undefined'&&typeof _0x4569d5['limit']===_0x2fa3('0x1c');var _0x95c20c=_0x5cb03d[_0x2fa3('0x1d')];var _0x146eec=_0x4f7831?0x0:_0x4569d5[_0x2fa3('0x1b')];var _0x480a82=_0x4f7831?_0x5cb03d[_0x2fa3('0x1d')]:_0x4569d5[_0x2fa3('0x1b')]+_0x4569d5[_0x2fa3('0x1e')];var _0x23b07a;if(_0x480a82>=_0x95c20c){_0x480a82=_0x95c20c;_0x23b07a=0xc8;}else{_0x23b07a=0xce;}_0xd7bf67[_0x2fa3('0x18')](_0x23b07a);return _0xd7bf67['set'](_0x2fa3('0x1f'),_0x146eec+'-'+_0x480a82+'/'+_0x95c20c)[_0x2fa3('0x1a')](_0x5cb03d);}return null;};}function patchUpdates(_0x56e14a){return function(_0x2597a0){try{jsonpatch[_0x2fa3('0x20')](_0x2597a0,_0x56e14a,!![]);}catch(_0x18c002){return BPromise[_0x2fa3('0x21')](_0x18c002);}return _0x2597a0[_0x2fa3('0x22')]();};}function saveUpdates(_0x52c368,_0xb1060){return function(_0x3c76f3){if(_0x3c76f3){return _0x3c76f3[_0x2fa3('0x23')](_0x52c368)[_0x2fa3('0x24')](function(_0x17dd70){return _0x17dd70;});}return null;};}function removeEntity(_0x380522,_0x3fede6){return function(_0x30a6e9){if(_0x30a6e9){return _0x30a6e9['destroy']()['then'](function(){_0x380522[_0x2fa3('0x18')](0xcc)[_0x2fa3('0x19')]();});}};}function handleEntityNotFound(_0x4552ff,_0x30971d){return function(_0x44cedf){if(!_0x44cedf){_0x4552ff[_0x2fa3('0x17')](0x194);}return _0x44cedf;};}function handleError(_0x26bf09,_0x54c9be){_0x54c9be=_0x54c9be||0x1f4;return function(_0x4b0ce2){logger[_0x2fa3('0x25')](_0x4b0ce2['stack']);if(_0x4b0ce2[_0x2fa3('0x26')]){delete _0x4b0ce2[_0x2fa3('0x26')];}_0x26bf09[_0x2fa3('0x18')](_0x54c9be)[_0x2fa3('0x27')](_0x4b0ce2);};}exports[_0x2fa3('0x23')]=function(_0x84776a,_0x213276){if(_0x84776a[_0x2fa3('0x28')]['id']){delete _0x84776a[_0x2fa3('0x28')]['id'];}return db[_0x2fa3('0x29')][_0x2fa3('0x2a')]({'where':{'id':_0x84776a[_0x2fa3('0x2b')]['id']}})['then'](handleEntityNotFound(_0x213276,null))[_0x2fa3('0x24')](saveUpdates(_0x84776a[_0x2fa3('0x28')],null))[_0x2fa3('0x24')](respondWithResult(_0x213276,null))[_0x2fa3('0x2c')](handleError(_0x213276,null));};exports[_0x2fa3('0x2d')]=function(_0x405efc,_0x3ce01c){return db[_0x2fa3('0x29')]['find']({'where':{'id':_0x405efc[_0x2fa3('0x2b')]['id']}})[_0x2fa3('0x24')](handleEntityNotFound(_0x3ce01c,null))[_0x2fa3('0x24')](removeEntity(_0x3ce01c,null))[_0x2fa3('0x2c')](handleError(_0x3ce01c,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index ee0db4a..ea9e50c 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 _0x47cb=['exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes'];(function(_0x4d4cd4,_0x18fe19){var _0x5a8132=function(_0x6bed92){while(--_0x6bed92){_0x4d4cd4['push'](_0x4d4cd4['shift']());}};_0x5a8132(++_0x18fe19);}(_0x47cb,0x74));var _0xb47c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x47cb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb47c('0x0'));var util=require(_0xb47c('0x1'));var logger=require(_0xb47c('0x2'))(_0xb47c('0x3'));var moment=require(_0xb47c('0x4'));var BPromise=require(_0xb47c('0x5'));var rp=require(_0xb47c('0x6'));var fs=require('fs');var path=require(_0xb47c('0x7'));var rimraf=require('rimraf');var config=require(_0xb47c('0x8'));var attributes=require(_0xb47c('0x9'));module[_0xb47c('0xa')]=function(_0x10891b,_0x325e36){return _0x10891b[_0xb47c('0xb')](_0xb47c('0xc'),attributes,{'tableName':_0xb47c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf112=['rimraf','./action.attributes','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xf112,0x112));var _0x2f11=function(_0x380016,_0x178dd6){_0x380016=_0x380016-0x0;var _0x5c7ac0=_0xf112[_0x380016];return _0x5c7ac0;};'use strict';var _=require(_0x2f11('0x0'));var util=require('util');var logger=require(_0x2f11('0x1'))(_0x2f11('0x2'));var moment=require(_0x2f11('0x3'));var BPromise=require(_0x2f11('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2f11('0x5'));var config=require('../../config/environment');var attributes=require(_0x2f11('0x6'));module['exports']=function(_0x3a5d18,_0x11f317){return _0x3a5d18['define'](_0x2f11('0x7'),attributes,{'tableName':_0x2f11('0x8'),'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 5b00170..b55a9d0 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 _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(_0x40c60f,_0x2e2b36){var _0x4458db=function(_0x2b1b58){while(--_0x2b1b58){_0x40c60f['push'](_0x40c60f['shift']());}};_0x4458db(++_0x2e2b36);}(_0x8ef6,0xf2));var _0x68ef=function(_0x301b4c,_0xc82115){_0x301b4c=_0x301b4c-0x0;var _0xcc2b51=_0x8ef6[_0x301b4c];return _0xcc2b51;};'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 +var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x33b563,_0x6e878a){var _0x110ee3=function(_0x39e610){while(--_0x39e610){_0x33b563['push'](_0x33b563['shift']());}};_0x110ee3(++_0x6e878a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x567f0e,_0x2be7a0){_0x567f0e=_0x567f0e-0x0;var _0x15aca8=_0x7fbe[_0x567f0e];return _0x15aca8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 258ceb3..3b94511 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 _0xbcd1=['put','isAuthenticated','update','delete','/:id','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x37cc2a,_0x1e6e79){var _0x3a918b=function(_0x5bb8a6){while(--_0x5bb8a6){_0x37cc2a['push'](_0x37cc2a['shift']());}};_0x3a918b(++_0x1e6e79);}(_0xbcd1,0x19c));var _0x1bcd=function(_0x32f91b,_0x460016){_0x32f91b=_0x32f91b-0x0;var _0x3ee8f3=_0xbcd1[_0x32f91b];return _0x3ee8f3;};'use strict';var multer=require(_0x1bcd('0x0'));var util=require(_0x1bcd('0x1'));var path=require(_0x1bcd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1bcd('0x3')]();var fs_extra=require(_0x1bcd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1bcd('0x5'));var config=require(_0x1bcd('0x6'));var controller=require(_0x1bcd('0x7'));router[_0x1bcd('0x8')]('/:id',auth[_0x1bcd('0x9')](),controller[_0x1bcd('0xa')]);router[_0x1bcd('0xb')](_0x1bcd('0xc'),auth[_0x1bcd('0x9')](),controller['destroy']);module[_0x1bcd('0xd')]=router; \ No newline at end of file +var _0x4718=['delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','/:id','isAuthenticated'];(function(_0x718493,_0x485616){var _0x59af54=function(_0x21268d){while(--_0x21268d){_0x718493['push'](_0x718493['shift']());}};_0x59af54(++_0x485616);}(_0x4718,0x146));var _0x8471=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x4718[_0x95942];return _0x6d7f81;};'use strict';var multer=require(_0x8471('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8471('0x1'));var express=require('express');var router=express[_0x8471('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8471('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8471('0x4'));var controller=require('./action.controller');router['put'](_0x8471('0x5'),auth[_0x8471('0x6')](),controller['update']);router[_0x8471('0x7')](_0x8471('0x5'),auth[_0x8471('0x6')](),controller['destroy']);module[_0x8471('0x8')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d20112e..bcaaad5 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x1416a5,_0x17ff94){var _0x5d7cd0=function(_0x59c85d){while(--_0x59c85d){_0x1416a5['push'](_0x1416a5['shift']());}};_0x5d7cd0(++_0x17ff94);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x3b6f99,_0x1454d9){_0x3b6f99=_0x3b6f99-0x0;var _0x5c49aa=_0x3eea[_0x3b6f99];return _0x5c49aa;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file +var _0x207c=['STRING','TEXT','exports'];(function(_0x4cd146,_0x334af3){var _0x25c2a4=function(_0x3d1d2f){while(--_0x3d1d2f){_0x4cd146['push'](_0x4cd146['shift']());}};_0x25c2a4(++_0x334af3);}(_0x207c,0x1e8));var _0xc207=function(_0xc56c46,_0x3fc792){_0xc56c46=_0xc56c46-0x0;var _0x2055d6=_0x207c[_0xc56c46];return _0x2055d6;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 01138a9..6281b7d 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 _0x1293=['index','map','AnalyticCustomReport','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','includeAll','include','findAll','show','params','keys','rawAttributes','length','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','QueryTypes','COUNT(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','IS\x20NOT\x20EMPTY','getFields','keyBy','output','web','fullPath','randomstring','generate','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','toString','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','SELECT','run','runReport','debug','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','dbH','end','offset','limit','undefined','count','status','Content-Range','json','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','sendStatus','stack','name','send'];(function(_0x1f3765,_0x5596ab){var _0x4e4a55=function(_0x3ac3a5){while(--_0x3ac3a5){_0x1f3765['push'](_0x1f3765['shift']());}};_0x4e4a55(++_0x5596ab);}(_0x1293,0x77));var _0x3129=function(_0x4e151e,_0x583efc){_0x4e151e=_0x4e151e-0x0;var _0x3bd266=_0x1293[_0x4e151e];return _0x3bd266;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3129('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3129('0x1'));var moment=require(_0x3129('0x2'));var BPromise=require(_0x3129('0x3'));var Mustache=require(_0x3129('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3129('0x5'));var csv=require(_0x3129('0x6'));var ejs=require(_0x3129('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3129('0x8'));var squel=require(_0x3129('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3129('0xa'));var toCsv=require(_0x3129('0x6'));var querystring=require(_0x3129('0xb'));var Papa=require('papaparse');var Redis=require(_0x3129('0xc'));var authService=require(_0x3129('0xd'));var qs=require(_0x3129('0xe'));var as=require(_0x3129('0xf'));var hardwareService=require(_0x3129('0x10'));var logger=require(_0x3129('0x11'))(_0x3129('0x12'));var utils=require('../../config/utils');var config=require(_0x3129('0x13'));var licenseUtil=require(_0x3129('0x14'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x3129('0x15')];function respondWithStatusCode(_0xa33b1e,_0x443c6a){_0x443c6a=_0x443c6a||0xcc;return function(_0x2eacfc){if(_0x2eacfc){return _0xa33b1e['sendStatus'](_0x443c6a);}return _0xa33b1e['status'](_0x443c6a)[_0x3129('0x16')]();};}function respondWithResult(_0x300a33,_0x22975f){_0x22975f=_0x22975f||0xc8;return function(_0x5ef352){if(_0x5ef352){return _0x300a33['status'](_0x22975f)['json'](_0x5ef352);}};}function respondWithFilteredResult(_0x425d3d,_0x3f60a7){return function(_0x3558c2){if(_0x3558c2){var _0xbcb73e=typeof _0x3f60a7[_0x3129('0x17')]==='undefined'&&typeof _0x3f60a7[_0x3129('0x18')]===_0x3129('0x19');var _0xddfb9e=_0x3558c2[_0x3129('0x1a')];var _0x13c497=_0xbcb73e?0x0:_0x3f60a7[_0x3129('0x17')];var _0x95d039=_0xbcb73e?_0x3558c2[_0x3129('0x1a')]:_0x3f60a7[_0x3129('0x17')]+_0x3f60a7[_0x3129('0x18')];var _0x1a7160;if(_0x95d039>=_0xddfb9e){_0x95d039=_0xddfb9e;_0x1a7160=0xc8;}else{_0x1a7160=0xce;}_0x425d3d[_0x3129('0x1b')](_0x1a7160);return _0x425d3d['set'](_0x3129('0x1c'),_0x13c497+'-'+_0x95d039+'/'+_0xddfb9e)[_0x3129('0x1d')](_0x3558c2);}return null;};}function patchUpdates(_0x5a343c){return function(_0x2706f0){try{jsonpatch[_0x3129('0x1e')](_0x2706f0,_0x5a343c,!![]);}catch(_0x1727da){return BPromise[_0x3129('0x1f')](_0x1727da);}return _0x2706f0[_0x3129('0x20')]();};}function saveUpdates(_0x19ba48,_0x13a968){return function(_0x27ccc6){if(_0x27ccc6){return _0x27ccc6[_0x3129('0x21')](_0x19ba48)['then'](function(_0x1cbbf8){return _0x1cbbf8;});}return null;};}function removeEntity(_0x53bd28,_0x405f7c){return function(_0x47fcb2){if(_0x47fcb2){return _0x47fcb2[_0x3129('0x22')]()[_0x3129('0x23')](function(){var _0x5380c8=_0x47fcb2[_0x3129('0x24')]({'plain':!![]});var _0x470329=_0x3129('0x25');return db[_0x3129('0x26')][_0x3129('0x22')]({'where':{'type':_0x470329,'resourceId':_0x5380c8['id']}})['then'](function(){return _0x47fcb2;});})[_0x3129('0x23')](function(){_0x53bd28['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d0ab2,_0x38034c){return function(_0xa1b9a5){if(!_0xa1b9a5){_0x9d0ab2[_0x3129('0x27')](0x194);}return _0xa1b9a5;};}function handleError(_0x1b6827,_0x5261d2){_0x5261d2=_0x5261d2||0x1f4;return function(_0x57954c){logger['error'](_0x57954c[_0x3129('0x28')]);if(_0x57954c['name']){delete _0x57954c[_0x3129('0x29')];}_0x1b6827[_0x3129('0x1b')](_0x5261d2)[_0x3129('0x2a')](_0x57954c);};}exports[_0x3129('0x2b')]=function(_0x28aa87,_0x448013){var _0x1b02e1={},_0x5c1d89={},_0x575f11={'count':0x0,'rows':[]};var _0x2c5ed6=_[_0x3129('0x2c')](db[_0x3129('0x2d')]['rawAttributes'],function(_0x7719c6){return{'name':_0x7719c6['fieldName'],'type':_0x7719c6[_0x3129('0x2e')][_0x3129('0x2f')]};});_0x5c1d89[_0x3129('0x30')]=_[_0x3129('0x2c')](_0x2c5ed6,'name');_0x5c1d89['query']=_['keys'](_0x28aa87[_0x3129('0x31')]);_0x5c1d89[_0x3129('0x32')]=_[_0x3129('0x33')](_0x5c1d89[_0x3129('0x30')],_0x5c1d89[_0x3129('0x31')]);_0x1b02e1[_0x3129('0x34')]=_['intersection'](_0x5c1d89['model'],qs[_0x3129('0x35')](_0x28aa87[_0x3129('0x31')][_0x3129('0x35')]));_0x1b02e1[_0x3129('0x34')]=_0x1b02e1[_0x3129('0x34')]['length']?_0x1b02e1[_0x3129('0x34')]:_0x5c1d89[_0x3129('0x30')];if(!_0x28aa87[_0x3129('0x31')][_0x3129('0x36')](_0x3129('0x37'))){_0x1b02e1['limit']=qs[_0x3129('0x18')](_0x28aa87[_0x3129('0x31')][_0x3129('0x18')]);_0x1b02e1['offset']=qs[_0x3129('0x17')](_0x28aa87[_0x3129('0x31')][_0x3129('0x17')]);}_0x1b02e1['order']=qs[_0x3129('0x38')](_0x28aa87[_0x3129('0x31')][_0x3129('0x38')]);_0x1b02e1['where']=qs['filters'](_[_0x3129('0x39')](_0x28aa87[_0x3129('0x31')],_0x5c1d89['filters']),_0x2c5ed6);if(_0x28aa87[_0x3129('0x31')]['filter']){_0x1b02e1[_0x3129('0x3a')]=_[_0x3129('0x3b')](_0x1b02e1['where'],{'$or':_[_0x3129('0x2c')](_0x2c5ed6,function(_0x2798ad){if(_0x2798ad['type']!=='VIRTUAL'){var _0x944683={};_0x944683[_0x2798ad['name']]={'$like':'%'+_0x28aa87[_0x3129('0x31')]['filter']+'%'};return _0x944683;}})});}_0x1b02e1=_[_0x3129('0x3b')]({},_0x1b02e1,_0x28aa87['options']);var _0x3a8a32={'where':_0x1b02e1['where']};return db[_0x3129('0x2d')]['count'](_0x3a8a32)[_0x3129('0x23')](function(_0x44687f){_0x575f11['count']=_0x44687f;if(_0x28aa87[_0x3129('0x31')][_0x3129('0x3c')]){_0x1b02e1[_0x3129('0x3d')]=[{'all':!![]}];}return db[_0x3129('0x2d')][_0x3129('0x3e')](_0x1b02e1);})['then'](function(_0x33ec4d){_0x575f11['rows']=_0x33ec4d;return _0x575f11;})[_0x3129('0x23')](respondWithFilteredResult(_0x448013,_0x1b02e1))['catch'](handleError(_0x448013,null));};exports[_0x3129('0x3f')]=function(_0x38be53,_0x162b75){var _0x3fd51e={'raw':![],'where':{'id':_0x38be53[_0x3129('0x40')]['id']}},_0x48e3eb={};_0x48e3eb[_0x3129('0x30')]=_[_0x3129('0x41')](db[_0x3129('0x2d')][_0x3129('0x42')]);_0x48e3eb[_0x3129('0x31')]=_[_0x3129('0x41')](_0x38be53[_0x3129('0x31')]);_0x48e3eb[_0x3129('0x32')]=_[_0x3129('0x33')](_0x48e3eb['model'],_0x48e3eb[_0x3129('0x31')]);_0x3fd51e[_0x3129('0x34')]=_['intersection'](_0x48e3eb[_0x3129('0x30')],qs['fields'](_0x38be53['query'][_0x3129('0x35')]));_0x3fd51e[_0x3129('0x34')]=_0x3fd51e[_0x3129('0x34')][_0x3129('0x43')]?_0x3fd51e['attributes']:_0x48e3eb[_0x3129('0x30')];if(_0x38be53[_0x3129('0x31')][_0x3129('0x3c')]){_0x3fd51e[_0x3129('0x3d')]=[{'all':!![]}];}_0x3fd51e=_['merge']({},_0x3fd51e,_0x38be53[_0x3129('0x44')]);return db[_0x3129('0x2d')][_0x3129('0x45')](_0x3fd51e)['then'](handleEntityNotFound(_0x162b75,null))['then'](respondWithResult(_0x162b75,null))[_0x3129('0x46')](handleError(_0x162b75,null));};exports[_0x3129('0x47')]=function(_0x4ad861,_0xa998f5){return db[_0x3129('0x2d')][_0x3129('0x47')](_0x4ad861['body'],{})[_0x3129('0x23')](function(_0x42752a){var _0x466696=_0x4ad861['user'][_0x3129('0x24')]({'plain':!![]});if(!_0x466696)throw new Error(_0x3129('0x48'));if(_0x466696[_0x3129('0x49')]===_0x3129('0x4a')){var _0x19eb01=_0x42752a[_0x3129('0x24')]({'plain':!![]});var _0x3bcfa9=_0x3129('0x4b');return db[_0x3129('0x4c')][_0x3129('0x45')]({'where':{'name':_0x3bcfa9,'userProfileId':_0x466696['userProfileId']},'raw':!![]})[_0x3129('0x23')](function(_0x25bebf){if(_0x25bebf&&_0x25bebf[_0x3129('0x4d')]===0x0){return db[_0x3129('0x26')]['create']({'name':_0x19eb01['name'],'resourceId':_0x19eb01['id'],'type':_0x3129('0x25'),'sectionId':_0x25bebf['id']},{})[_0x3129('0x23')](function(){return _0x42752a;});}else{return _0x42752a;}})[_0x3129('0x46')](function(_0x24e05b){logger[_0x3129('0x4e')](_0x3129('0x4f'),_0x24e05b);throw _0x24e05b;});}return _0x42752a;})['then'](respondWithResult(_0xa998f5,0xc9))[_0x3129('0x46')](handleError(_0xa998f5,null));};exports[_0x3129('0x21')]=function(_0x203162,_0x1d61c5){if(_0x203162['body']['id']){delete _0x203162['body']['id'];}return db[_0x3129('0x2d')][_0x3129('0x45')]({'where':{'id':_0x203162[_0x3129('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d61c5,null))[_0x3129('0x23')](saveUpdates(_0x203162[_0x3129('0x50')],null))[_0x3129('0x23')](respondWithResult(_0x1d61c5,null))[_0x3129('0x46')](handleError(_0x1d61c5,null));};exports['destroy']=function(_0x55fd47,_0x1f35ff){return db['AnalyticCustomReport'][_0x3129('0x45')]({'where':{'id':_0x55fd47['params']['id']}})[_0x3129('0x23')](handleEntityNotFound(_0x1f35ff,null))[_0x3129('0x23')](removeEntity(_0x1f35ff,null))[_0x3129('0x46')](handleError(_0x1f35ff,null));};exports['preview']=function(_0x5c24f9,_0x3e6f6c){var _0x53e030=0xa;var _0x5bccd1=[_0x3129('0x51'),_0x3129('0x52'),_0x3129('0x53'),_0x3129('0x54')];var _0x436fd5={'SUM':_0x3129('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3129('0x56'),'MAX':_0x3129('0x57'),'MIN':_0x3129('0x58'),'AVG':_0x3129('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3129('0x5a')};var _0x3e8724={'SEC_TO_TIME':_0x3129('0x5b'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x3129('0x5c'),'UNIX_TIMESTAMP':_0x3129('0x5d')};var _0xddff28=function(_0x3729e0){return!_[_0x3129('0x5e')]([_0x3129('0x5f'),_0x3129('0x60'),_0x3129('0x61'),'IS\x20NOT\x20EMPTY'],_0x3729e0);};var _0x40ea04=function(_0x40da9){if(!_0x40da9||!_0x40da9[_0x3129('0x62')][_0x3129('0x43')]){return'';}for(var _0x25a7c8='(',_0x241c76=0x0;_0x241c76<_0x40da9[_0x3129('0x62')][_0x3129('0x43')];_0x241c76+=0x1){_0x241c76>0x0&&(_0x25a7c8+='\x20'+_0x40da9[_0x3129('0x63')]+'\x20');_0x25a7c8+=_0x40da9[_0x3129('0x62')][_0x241c76]['group']?_0x40ea04(_0x40da9['rules'][_0x241c76][_0x3129('0x64')]):_0x40da9['rules'][_0x241c76][_0x3129('0x65')]+'\x20'+_0x40da9[_0x3129('0x62')][_0x241c76][_0x3129('0x66')]+(_0xddff28(_0x40da9[_0x3129('0x62')][_0x241c76][_0x3129('0x66')])?'\x20'+_0x40da9[_0x3129('0x62')][_0x241c76][_0x3129('0x67')]:'');}return _0x25a7c8+')';};var _0x4e721f={'where':{'id':_0x5c24f9['params']['id']}},_0x5e6ac4,_0xa1a415,_0x28f5fa,_0x413ac4,_0x3f4a02;_0x4e721f=_['merge']({},_0x4e721f,_0x5c24f9[_0x3129('0x44')]);return db[_0x3129('0x2d')][_0x3129('0x45')](_0x4e721f)[_0x3129('0x23')](function(_0xc3672c){if(_0xc3672c){_0x5e6ac4=_0xc3672c;return _0xc3672c['getFields']();}return null;})[_0x3129('0x23')](function(_0xcbf9b8){if(_0xcbf9b8){if(!_0xcbf9b8[_0x3129('0x43')]){throw new db[(_0x3129('0x68'))][(_0x3129('0x69'))](_0x3129('0x6a'),0x193);}_0xa1a415=_0xcbf9b8;return db[_0x3129('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x3129('0x23')](function(_0x499fea){if(_0x499fea){_0x28f5fa=_['keyBy'](_0x499fea,'id');var _0x3ca3e9;var _0x46ece0=squel[_0x3129('0x6c')]();_0x46ece0[_0x3129('0x6d')](_0x5e6ac4[_0x3129('0x6e')]);for(var _0xdb1b8=0x0;_0xdb1b8<_0xa1a415[_0x3129('0x43')];_0xdb1b8+=0x1){_0x3ca3e9=_0xa1a415[_0xdb1b8][_0x3129('0x6f')]?_0x28f5fa[_0xa1a415[_0xdb1b8]['MetricId']][_0x3129('0x70')]:_0xa1a415[_0xdb1b8][_0x3129('0x65')];_0x3ca3e9=_0xa1a415[_0xdb1b8][_0x3129('0x71')]?_['replace'](_0x436fd5[_0xa1a415[_0xdb1b8][_0x3129('0x71')]],'%s',_0x3ca3e9):_0x3ca3e9;_0x3ca3e9=_0xa1a415[_0xdb1b8][_0x3129('0x72')]?_[_0x3129('0x73')](_0x3e8724[_0xa1a415[_0xdb1b8][_0x3129('0x72')]],'%s',_0x3ca3e9):_0x3ca3e9;if(_0xa1a415[_0xdb1b8][_0x3129('0x74')]){_0x46ece0[_0x3129('0x64')](_0x3ca3e9);}_0xa1a415[_0xdb1b8][_0x3129('0x75')]&&_0x46ece0[_0x3129('0x76')](_0x3ca3e9,_0xa1a415[_0xdb1b8][_0x3129('0x75')]===_0x3129('0x77')?![]:!![]);_0x46ece0[_0x3129('0x65')](_0x3ca3e9,_0xa1a415[_0xdb1b8][_0x3129('0x78')]||_0x3ca3e9);}if(_0x5e6ac4[_0x3129('0x79')]){_0x5e6ac4[_0x3129('0x79')]=JSON[_0x3129('0x7a')](_0x5e6ac4[_0x3129('0x79')]);for(var _0x14b516=0x0;_0x14b516<_0x5e6ac4[_0x3129('0x79')][_0x3129('0x43')];_0x14b516+=0x1){if(_0x5e6ac4[_0x3129('0x79')][_0x14b516][_0x3129('0x2e')]&&_[_0x3129('0x5e')](_0x5bccd1,_0x5e6ac4[_0x3129('0x79')][_0x14b516]['type'])&&_0x5e6ac4[_0x3129('0x79')][_0x14b516][_0x3129('0x7b')]&&_0x5e6ac4[_0x3129('0x79')][_0x14b516][_0x3129('0x7c')]&&_0x5e6ac4[_0x3129('0x79')][_0x14b516][_0x3129('0x7d')]){_0x46ece0[_0x5e6ac4['joins'][_0x14b516][_0x3129('0x2e')]](_0x5e6ac4['joins'][_0x14b516][_0x3129('0x7c')],null,util[_0x3129('0x72')](_0x3129('0x7e'),_0x5e6ac4[_0x3129('0x6e')],_0x5e6ac4['joins'][_0x14b516][_0x3129('0x7b')],_0x5e6ac4[_0x3129('0x79')][_0x14b516][_0x3129('0x7c')],_0x5e6ac4[_0x3129('0x79')][_0x14b516]['foreignKey']));}}}if(_0x5e6ac4[_0x3129('0x7f')]){_0x5e6ac4[_0x3129('0x7f')]=JSON[_0x3129('0x7a')](_0x5e6ac4[_0x3129('0x7f')]);_0x46ece0[_0x3129('0x3a')](_0x40ea04(_0x5e6ac4[_0x3129('0x7f')][_0x3129('0x64')]));}_0x3f4a02=_0x46ece0[_0x3129('0x80')]();_0x46ece0['limit'](_0x53e030);_0x46ece0[_0x3129('0x17')](0x0);logger['debug'](_0x3129('0x81'),_0x46ece0['toString']());return dbH[_0x3129('0x82')][_0x3129('0x31')](_0x46ece0['toString'](),{'type':dbH[_0x3129('0x82')][_0x3129('0x83')]['SELECT']});}})[_0x3129('0x23')](respondWithResult(_0x3e6f6c,null))[_0x3129('0x46')](handleError(_0x3e6f6c,null));};function runReport(_0x205ec9,_0x4aef35,_0x57f329){var _0x2862a5=_0x4aef35[_0x3129('0x29')];var _0x32b553=0xa;var _0x2092fc=[_0x3129('0x51'),_0x3129('0x52'),_0x3129('0x53'),_0x3129('0x54')];var _0xc1e123={'SUM':_0x3129('0x55'),'COUNT':_0x3129('0x84'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3129('0x57'),'MIN':_0x3129('0x58'),'AVG':_0x3129('0x59'),'GROUP_CONCAT':_0x3129('0x85'),'GROUP_CONCAT ASC':_0x3129('0x86'),'GROUP_CONCAT DESC':_0x3129('0x5a')};var _0x40fa48={'SEC_TO_TIME':_0x3129('0x5b'),'DATE':_0x3129('0x87'),'HOUR':_0x3129('0x88'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3129('0x5d')};var _0x17e8eb=function(_0x22054d){return!_[_0x3129('0x5e')]([_0x3129('0x5f'),_0x3129('0x60'),_0x3129('0x61'),_0x3129('0x89')],_0x22054d);};var _0x2233b4=function(_0x2735cf){if(!_0x2735cf||!_0x2735cf[_0x3129('0x62')][_0x3129('0x43')]){return'';}for(var _0x49731a='(',_0x5ed246=0x0;_0x5ed246<_0x2735cf[_0x3129('0x62')][_0x3129('0x43')];_0x5ed246+=0x1){_0x5ed246>0x0&&(_0x49731a+='\x20'+_0x2735cf[_0x3129('0x63')]+'\x20');_0x49731a+=_0x2735cf[_0x3129('0x62')][_0x5ed246][_0x3129('0x64')]?_0x2233b4(_0x2735cf[_0x3129('0x62')][_0x5ed246]['group']):_0x2735cf[_0x3129('0x62')][_0x5ed246][_0x3129('0x65')]+'\x20'+_0x2735cf[_0x3129('0x62')][_0x5ed246][_0x3129('0x66')]+(_0x17e8eb(_0x2735cf[_0x3129('0x62')][_0x5ed246]['condition'])?'\x20'+_0x2735cf[_0x3129('0x62')][_0x5ed246]['value']:'');}return _0x49731a+')';};var _0x174ce3={'where':{'id':_0x205ec9['id']}},_0x234977,_0x4fb2fc,_0x48fdf7,_0x415bd2,_0x4d9926;_0x174ce3=_[_0x3129('0x3b')]({},_0x174ce3,_0x57f329);return db['AnalyticCustomReport'][_0x3129('0x45')](_0x174ce3)[_0x3129('0x23')](function(_0x516808){if(_0x516808){_0x234977=_0x516808;return _0x516808[_0x3129('0x8a')]();}return null;})[_0x3129('0x23')](function(_0x130f63){if(_0x130f63){if(!_0x130f63[_0x3129('0x43')]){throw new db[(_0x3129('0x68'))][(_0x3129('0x69'))](_0x3129('0x6a'),0x193);}_0x4fb2fc=_0x130f63;return db[_0x3129('0x6b')][_0x3129('0x3e')]({'raw':!![]});}return null;})[_0x3129('0x23')](function(_0x18eacb){if(_0x18eacb){_0x48fdf7=_[_0x3129('0x8b')](_0x18eacb,'id');var _0x34c34b;var _0x273ea0=squel['select']();_0x273ea0[_0x3129('0x6d')](_0x234977[_0x3129('0x6e')]);for(var _0x15c8cc=0x0;_0x15c8cc<_0x4fb2fc['length'];_0x15c8cc+=0x1){_0x34c34b=_0x4fb2fc[_0x15c8cc][_0x3129('0x6f')]?_0x48fdf7[_0x4fb2fc[_0x15c8cc][_0x3129('0x6f')]][_0x3129('0x70')]:_0x4fb2fc[_0x15c8cc][_0x3129('0x65')];_0x34c34b=_0x4fb2fc[_0x15c8cc][_0x3129('0x71')]?_[_0x3129('0x73')](_0xc1e123[_0x4fb2fc[_0x15c8cc]['function']],'%s',_0x34c34b):_0x34c34b;_0x34c34b=_0x4fb2fc[_0x15c8cc][_0x3129('0x72')]?_['replace'](_0x40fa48[_0x4fb2fc[_0x15c8cc]['format']],'%s',_0x34c34b):_0x34c34b;if(_0x4fb2fc[_0x15c8cc][_0x3129('0x74')]){_0x273ea0[_0x3129('0x64')](_0x34c34b);}_0x4fb2fc[_0x15c8cc][_0x3129('0x75')]&&_0x273ea0['order'](_0x34c34b,_0x4fb2fc[_0x15c8cc][_0x3129('0x75')]===_0x3129('0x77')?![]:!![]);_0x273ea0['field'](_0x34c34b,_0x4fb2fc[_0x15c8cc]['alias']||_0x34c34b);}if(_0x234977[_0x3129('0x79')]){_0x234977[_0x3129('0x79')]=JSON[_0x3129('0x7a')](_0x234977['joins']);for(var _0x243632=0x0;_0x243632<_0x234977[_0x3129('0x79')][_0x3129('0x43')];_0x243632+=0x1){if(_0x234977['joins'][_0x243632][_0x3129('0x2e')]&&_[_0x3129('0x5e')](_0x2092fc,_0x234977[_0x3129('0x79')][_0x243632][_0x3129('0x2e')])&&_0x234977[_0x3129('0x79')][_0x243632][_0x3129('0x7b')]&&_0x234977['joins'][_0x243632][_0x3129('0x7c')]&&_0x234977[_0x3129('0x79')][_0x243632][_0x3129('0x7d')]){_0x273ea0[_0x234977[_0x3129('0x79')][_0x243632][_0x3129('0x2e')]](_0x234977[_0x3129('0x79')][_0x243632][_0x3129('0x7c')],null,util['format'](_0x3129('0x7e'),_0x234977[_0x3129('0x6e')],_0x234977[_0x3129('0x79')][_0x243632]['parentKey'],_0x234977[_0x3129('0x79')][_0x243632]['foreignTable'],_0x234977[_0x3129('0x79')][_0x243632][_0x3129('0x7d')]));}}}if(_0x234977[_0x3129('0x7f')]){_0x234977[_0x3129('0x7f')]=JSON['parse'](_0x234977[_0x3129('0x7f')]);_0x273ea0[_0x3129('0x3a')](_0x2233b4(_0x234977[_0x3129('0x7f')]['group']));}_0x4d9926=_0x273ea0[_0x3129('0x80')]();_0x273ea0['limit'](_0x32b553);_0x273ea0[_0x3129('0x17')](0x0);return;}})[_0x3129('0x23')](function(){if(_0x4aef35[_0x3129('0x8c')]===_0x3129('0x8d')){return null;}var _0x2cdfc9=_['merge'](_0x4aef35,{'name':_0x4aef35[_0x3129('0x8e')]||_0x4aef35[_0x3129('0x29')]||_0x234977['name'],'basename':_0x2862a5,'savename':util[_0x3129('0x72')]('%s-%s.%s',_0x4aef35[_0x3129('0x29')]||_0x234977[_0x3129('0x29')],require(_0x3129('0x8f'))[_0x3129('0x90')](0x4),_0x4aef35[_0x3129('0x8c')]||_0x3129('0x91')),'reportId':_0x234977['id'],'reportType':_0x3129('0x92')});return db['AnalyticExtractedReport'][_0x3129('0x47')](_0x2cdfc9,{'raw':!![]});})[_0x3129('0x23')](function(_0x2f62ad){if(_0x234977['table']==='cdr'){_0x4d9926[_0x3129('0x3a')](_0x234977[_0x3129('0x6e')]+_0x3129('0x93'),_0x4aef35['startDate'],_0x4aef35['endDate']);}else{_0x4d9926[_0x3129('0x3a')](_0x234977[_0x3129('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4aef35[_0x3129('0x94')],_0x4aef35[_0x3129('0x95')]);}if(_0x2f62ad){logger[_0x3129('0x96')](_0x3129('0x97'),_0x4d9926[_0x3129('0x98')]());require(_0x3129('0x99'))['fork'](path[_0x3129('0x51')](__dirname,_0x3129('0x9a'),_0x2f62ad[_0x3129('0x8c')]),[_0x2f62ad['id'],_0x4d9926[_0x3129('0x98')](),path[_0x3129('0x51')](__dirname,_0x3129('0x9b'),_0x2f62ad['savename']),_0x2862a5]);return _0x2f62ad;}else{var _0x32f4ad=squel[_0x3129('0x6c')]();_0x32f4ad[_0x3129('0x6d')]('('+_0x4d9926[_0x3129('0x98')]()+')',_0x3129('0x9c'));_0x32f4ad[_0x3129('0x65')](_0x3129('0x9d'),_0x3129('0x1a'));_0x4d9926['limit'](_0x4aef35[_0x3129('0x18')]||_0x32b553);_0x4d9926['offset'](_0x4aef35[_0x3129('0x17')]||0x0);return dbH[_0x3129('0x82')][_0x3129('0x31')](_0x32f4ad['toString'](),{'type':dbH[_0x3129('0x82')][_0x3129('0x83')]['SELECT']})[_0x3129('0x23')](function(_0x17e135){if(!_0x17e135['length']){_0x415bd2=0x0;}else{_0x415bd2=_0x17e135[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x4d9926[_0x3129('0x98')](),{'type':dbH[_0x3129('0x82')][_0x3129('0x83')][_0x3129('0x9e')]});})[_0x3129('0x23')](function(_0x470197){return{'rows':_0x470197||[],'count':_0x415bd2};});}});}exports[_0x3129('0x9f')]=function(_0x29deee,_0x15618b){return runReport(_0x29deee['params'],_0x29deee[_0x3129('0x31')],_0x29deee[_0x3129('0x44')])[_0x3129('0x23')](respondWithResult(_0x15618b,null))['catch'](handleError(_0x15618b,null));};exports[_0x3129('0xa0')]=runReport;exports[_0x3129('0x31')]=function(_0x2479f0,_0x248c51){var _0x2988ac=0xa;var _0xa963ea=[_0x3129('0x51'),_0x3129('0x52'),_0x3129('0x53'),_0x3129('0x54')];var _0x188746={'SUM':_0x3129('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3129('0x56'),'MAX':'MAX(%s)','MIN':_0x3129('0x58'),'AVG':_0x3129('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3129('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1d85c2={'SEC_TO_TIME':_0x3129('0x5b'),'DATE':_0x3129('0x87'),'HOUR':_0x3129('0x88'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x244691=function(_0x1a7634){return!_[_0x3129('0x5e')]([_0x3129('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x3129('0x89')],_0x1a7634);};var _0x3a4a5f=function(_0x201106){if(!_0x201106||!_0x201106[_0x3129('0x62')][_0x3129('0x43')]){return'';}for(var _0x22cbfb='(',_0x503945=0x0;_0x503945<_0x201106['rules']['length'];_0x503945+=0x1){_0x503945>0x0&&(_0x22cbfb+='\x20'+_0x201106[_0x3129('0x63')]+'\x20');_0x22cbfb+=_0x201106[_0x3129('0x62')][_0x503945][_0x3129('0x64')]?_0x3a4a5f(_0x201106[_0x3129('0x62')][_0x503945]['group']):_0x201106[_0x3129('0x62')][_0x503945]['field']+'\x20'+_0x201106[_0x3129('0x62')][_0x503945][_0x3129('0x66')]+(_0x244691(_0x201106['rules'][_0x503945]['condition'])?'\x20'+_0x201106['rules'][_0x503945][_0x3129('0x67')]:'');}return _0x22cbfb+')';};var _0x52306a={'where':{'id':_0x2479f0['params']['id']}},_0x3e9bd,_0x504893,_0x840c7d,_0x15afdc,_0x560503;_0x52306a=_['merge']({},_0x52306a,_0x2479f0[_0x3129('0x44')]);return db[_0x3129('0x2d')]['find'](_0x52306a)[_0x3129('0x23')](function(_0x15fc33){if(_0x15fc33){_0x3e9bd=_0x15fc33;return _0x15fc33[_0x3129('0x8a')]();}return null;})[_0x3129('0x23')](function(_0x96f426){if(_0x96f426){if(!_0x96f426['length']){throw new db[(_0x3129('0x68'))][(_0x3129('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x504893=_0x96f426;return db[_0x3129('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x3129('0x23')](function(_0xf0280b){if(_0xf0280b){_0x840c7d=_['keyBy'](_0xf0280b,'id');var _0x585f29;var _0x1c3e63=squel[_0x3129('0x6c')]();_0x1c3e63[_0x3129('0x6d')](_0x3e9bd[_0x3129('0x6e')]);for(var _0x558f02=0x0;_0x558f02<_0x504893[_0x3129('0x43')];_0x558f02+=0x1){_0x585f29=_0x504893[_0x558f02][_0x3129('0x6f')]?_0x840c7d[_0x504893[_0x558f02][_0x3129('0x6f')]][_0x3129('0x70')]:_0x504893[_0x558f02][_0x3129('0x65')];_0x585f29=_0x504893[_0x558f02][_0x3129('0x71')]?_[_0x3129('0x73')](_0x188746[_0x504893[_0x558f02][_0x3129('0x71')]],'%s',_0x585f29):_0x585f29;_0x585f29=_0x504893[_0x558f02]['format']?_[_0x3129('0x73')](_0x1d85c2[_0x504893[_0x558f02][_0x3129('0x72')]],'%s',_0x585f29):_0x585f29;if(_0x504893[_0x558f02][_0x3129('0x74')]){_0x1c3e63[_0x3129('0x64')](_0x585f29);}_0x504893[_0x558f02]['orderBy']&&_0x1c3e63[_0x3129('0x76')](_0x585f29,_0x504893[_0x558f02][_0x3129('0x75')]===_0x3129('0x77')?![]:!![]);_0x1c3e63[_0x3129('0x65')](_0x585f29,_0x504893[_0x558f02][_0x3129('0x78')]||_0x585f29);}if(_0x3e9bd['joins']){_0x3e9bd[_0x3129('0x79')]=JSON[_0x3129('0x7a')](_0x3e9bd[_0x3129('0x79')]);for(var _0x15d414=0x0;_0x15d414<_0x3e9bd['joins']['length'];_0x15d414+=0x1){if(_0x3e9bd['joins'][_0x15d414]['type']&&_[_0x3129('0x5e')](_0xa963ea,_0x3e9bd[_0x3129('0x79')][_0x15d414][_0x3129('0x2e')])&&_0x3e9bd['joins'][_0x15d414][_0x3129('0x7b')]&&_0x3e9bd[_0x3129('0x79')][_0x15d414][_0x3129('0x7c')]&&_0x3e9bd[_0x3129('0x79')][_0x15d414]['foreignKey']){_0x1c3e63[_0x3e9bd[_0x3129('0x79')][_0x15d414][_0x3129('0x2e')]](_0x3e9bd[_0x3129('0x79')][_0x15d414][_0x3129('0x7c')],null,util[_0x3129('0x72')](_0x3129('0x7e'),_0x3e9bd[_0x3129('0x6e')],_0x3e9bd[_0x3129('0x79')][_0x15d414][_0x3129('0x7b')],_0x3e9bd[_0x3129('0x79')][_0x15d414][_0x3129('0x7c')],_0x3e9bd[_0x3129('0x79')][_0x15d414][_0x3129('0x7d')]));}}}if(_0x3e9bd[_0x3129('0x7f')]){_0x3e9bd[_0x3129('0x7f')]=JSON['parse'](_0x3e9bd['conditions']);_0x1c3e63[_0x3129('0x3a')](_0x3a4a5f(_0x3e9bd[_0x3129('0x7f')][_0x3129('0x64')]));}_0x560503=_0x1c3e63['clone']();_0x1c3e63[_0x3129('0x18')](_0x2988ac);_0x1c3e63[_0x3129('0x17')](0x0);logger[_0x3129('0xa1')](_0x3129('0x81'),_0x1c3e63[_0x3129('0x98')]());return dbH[_0x3129('0x82')][_0x3129('0x31')](_0x1c3e63[_0x3129('0x98')](),{'type':dbH[_0x3129('0x82')][_0x3129('0x83')]['SELECT']});}})['then'](function(){return{'sql':_0x560503[_0x3129('0x98')]()};})[_0x3129('0x23')](respondWithResult(_0x248c51,null))['catch'](handleError(_0x248c51,null));}; \ No newline at end of file +var _0x0d3d=['AnalyticCustomReport','includeAll','findAll','rows','catch','params','keys','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','foreignTable','foreignKey','parentKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20EMPTY','value','keyBy','select','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','randomstring','generate','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','../../components/export/','COUNT(*)','run','runReport','MAX(%s)','DESC','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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/license/util','../../mysqldb','dbH','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options'];(function(_0x470004,_0x5a2d91){var _0x2f32c2=function(_0x4603e7){while(--_0x4603e7){_0x470004['push'](_0x470004['shift']());}};_0x2f32c2(++_0x5a2d91);}(_0x0d3d,0x1ab));var _0xd0d3=function(_0x152ce5,_0x28de83){_0x152ce5=_0x152ce5-0x0;var _0x11903=_0x0d3d[_0x152ce5];return _0x11903;};'use strict';var emlformat=require(_0xd0d3('0x0'));var rimraf=require(_0xd0d3('0x1'));var zipdir=require(_0xd0d3('0x2'));var jsonpatch=require(_0xd0d3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd0d3('0x4'));var Mustache=require(_0xd0d3('0x5'));var util=require(_0xd0d3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd0d3('0x7'));var ejs=require(_0xd0d3('0x8'));var fs=require('fs');var fs_extra=require(_0xd0d3('0x9'));var _=require(_0xd0d3('0xa'));var squel=require('squel');var crypto=require(_0xd0d3('0xb'));var jsforce=require(_0xd0d3('0xc'));var deskjs=require(_0xd0d3('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd0d3('0xe'));var Papa=require(_0xd0d3('0xf'));var Redis=require(_0xd0d3('0x10'));var authService=require(_0xd0d3('0x11'));var qs=require(_0xd0d3('0x12'));var as=require(_0xd0d3('0x13'));var hardwareService=require(_0xd0d3('0x14'));var logger=require(_0xd0d3('0x15'))(_0xd0d3('0x16'));var utils=require(_0xd0d3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd0d3('0x18'));var db=require(_0xd0d3('0x19'))['db'];var dbH=require(_0xd0d3('0x19'))[_0xd0d3('0x1a')];function respondWithStatusCode(_0x388f4b,_0x242379){_0x242379=_0x242379||0xcc;return function(_0x6edc6f){if(_0x6edc6f){return _0x388f4b[_0xd0d3('0x1b')](_0x242379);}return _0x388f4b[_0xd0d3('0x1c')](_0x242379)[_0xd0d3('0x1d')]();};}function respondWithResult(_0x20eebc,_0x1c6b8c){_0x1c6b8c=_0x1c6b8c||0xc8;return function(_0x356ea9){if(_0x356ea9){return _0x20eebc[_0xd0d3('0x1c')](_0x1c6b8c)['json'](_0x356ea9);}};}function respondWithFilteredResult(_0x5e8192,_0x243867){return function(_0x4b7a78){if(_0x4b7a78){var _0x180805=typeof _0x243867['offset']===_0xd0d3('0x1e')&&typeof _0x243867['limit']==='undefined';var _0x187554=_0x4b7a78[_0xd0d3('0x1f')];var _0x369fdd=_0x180805?0x0:_0x243867[_0xd0d3('0x20')];var _0x3cce60=_0x180805?_0x4b7a78[_0xd0d3('0x1f')]:_0x243867['offset']+_0x243867[_0xd0d3('0x21')];var _0x2cedd7;if(_0x3cce60>=_0x187554){_0x3cce60=_0x187554;_0x2cedd7=0xc8;}else{_0x2cedd7=0xce;}_0x5e8192['status'](_0x2cedd7);return _0x5e8192[_0xd0d3('0x22')](_0xd0d3('0x23'),_0x369fdd+'-'+_0x3cce60+'/'+_0x187554)[_0xd0d3('0x24')](_0x4b7a78);}return null;};}function patchUpdates(_0x549105){return function(_0x4e2e33){try{jsonpatch['apply'](_0x4e2e33,_0x549105,!![]);}catch(_0x28aef0){return BPromise[_0xd0d3('0x25')](_0x28aef0);}return _0x4e2e33[_0xd0d3('0x26')]();};}function saveUpdates(_0x25dbad,_0xce09d9){return function(_0x17d1f6){if(_0x17d1f6){return _0x17d1f6[_0xd0d3('0x27')](_0x25dbad)['then'](function(_0x151066){return _0x151066;});}return null;};}function removeEntity(_0x35aa4e,_0x17814b){return function(_0x2f628e){if(_0x2f628e){return _0x2f628e[_0xd0d3('0x28')]()[_0xd0d3('0x29')](function(){var _0x263c1f=_0x2f628e[_0xd0d3('0x2a')]({'plain':!![]});var _0xfd8dd8=_0xd0d3('0x2b');return db[_0xd0d3('0x2c')][_0xd0d3('0x28')]({'where':{'type':_0xfd8dd8,'resourceId':_0x263c1f['id']}})[_0xd0d3('0x29')](function(){return _0x2f628e;});})[_0xd0d3('0x29')](function(){_0x35aa4e['status'](0xcc)[_0xd0d3('0x1d')]();});}};}function handleEntityNotFound(_0xbe17d6,_0x79357e){return function(_0x264f46){if(!_0x264f46){_0xbe17d6['sendStatus'](0x194);}return _0x264f46;};}function handleError(_0x17c264,_0x5ef5e5){_0x5ef5e5=_0x5ef5e5||0x1f4;return function(_0x2bfb9a){logger[_0xd0d3('0x2d')](_0x2bfb9a[_0xd0d3('0x2e')]);if(_0x2bfb9a['name']){delete _0x2bfb9a[_0xd0d3('0x2f')];}_0x17c264['status'](_0x5ef5e5)[_0xd0d3('0x30')](_0x2bfb9a);};}exports[_0xd0d3('0x31')]=function(_0xe3be87,_0x205d5c){var _0x53c869={},_0x13eb1f={},_0x14658={'count':0x0,'rows':[]};var _0xf45b73=_[_0xd0d3('0x32')](db['AnalyticCustomReport'][_0xd0d3('0x33')],function(_0x4c3b6c){return{'name':_0x4c3b6c['fieldName'],'type':_0x4c3b6c[_0xd0d3('0x34')][_0xd0d3('0x35')]};});_0x13eb1f[_0xd0d3('0x36')]=_[_0xd0d3('0x32')](_0xf45b73,_0xd0d3('0x2f'));_0x13eb1f[_0xd0d3('0x37')]=_['keys'](_0xe3be87[_0xd0d3('0x37')]);_0x13eb1f[_0xd0d3('0x38')]=_[_0xd0d3('0x39')](_0x13eb1f[_0xd0d3('0x36')],_0x13eb1f[_0xd0d3('0x37')]);_0x53c869[_0xd0d3('0x3a')]=_[_0xd0d3('0x39')](_0x13eb1f[_0xd0d3('0x36')],qs[_0xd0d3('0x3b')](_0xe3be87[_0xd0d3('0x37')][_0xd0d3('0x3b')]));_0x53c869[_0xd0d3('0x3a')]=_0x53c869[_0xd0d3('0x3a')]['length']?_0x53c869[_0xd0d3('0x3a')]:_0x13eb1f[_0xd0d3('0x36')];if(!_0xe3be87[_0xd0d3('0x37')][_0xd0d3('0x3c')](_0xd0d3('0x3d'))){_0x53c869[_0xd0d3('0x21')]=qs['limit'](_0xe3be87[_0xd0d3('0x37')][_0xd0d3('0x21')]);_0x53c869[_0xd0d3('0x20')]=qs[_0xd0d3('0x20')](_0xe3be87[_0xd0d3('0x37')][_0xd0d3('0x20')]);}_0x53c869[_0xd0d3('0x3e')]=qs[_0xd0d3('0x3f')](_0xe3be87[_0xd0d3('0x37')][_0xd0d3('0x3f')]);_0x53c869[_0xd0d3('0x40')]=qs['filters'](_['pick'](_0xe3be87[_0xd0d3('0x37')],_0x13eb1f['filters']),_0xf45b73);if(_0xe3be87[_0xd0d3('0x37')]['filter']){_0x53c869[_0xd0d3('0x40')]=_['merge'](_0x53c869['where'],{'$or':_[_0xd0d3('0x32')](_0xf45b73,function(_0x5919cb){if(_0x5919cb['type']!=='VIRTUAL'){var _0x3b6376={};_0x3b6376[_0x5919cb[_0xd0d3('0x2f')]]={'$like':'%'+_0xe3be87['query'][_0xd0d3('0x41')]+'%'};return _0x3b6376;}})});}_0x53c869=_[_0xd0d3('0x42')]({},_0x53c869,_0xe3be87[_0xd0d3('0x43')]);var _0x1315e9={'where':_0x53c869[_0xd0d3('0x40')]};return db[_0xd0d3('0x44')][_0xd0d3('0x1f')](_0x1315e9)[_0xd0d3('0x29')](function(_0x261034){_0x14658[_0xd0d3('0x1f')]=_0x261034;if(_0xe3be87[_0xd0d3('0x37')][_0xd0d3('0x45')]){_0x53c869['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xd0d3('0x46')](_0x53c869);})[_0xd0d3('0x29')](function(_0x5f375d){_0x14658[_0xd0d3('0x47')]=_0x5f375d;return _0x14658;})[_0xd0d3('0x29')](respondWithFilteredResult(_0x205d5c,_0x53c869))[_0xd0d3('0x48')](handleError(_0x205d5c,null));};exports['show']=function(_0x18a29d,_0x7d779b){var _0x42a76d={'raw':![],'where':{'id':_0x18a29d[_0xd0d3('0x49')]['id']}},_0xac118f={};_0xac118f[_0xd0d3('0x36')]=_[_0xd0d3('0x4a')](db[_0xd0d3('0x44')]['rawAttributes']);_0xac118f[_0xd0d3('0x37')]=_[_0xd0d3('0x4a')](_0x18a29d[_0xd0d3('0x37')]);_0xac118f[_0xd0d3('0x38')]=_[_0xd0d3('0x39')](_0xac118f[_0xd0d3('0x36')],_0xac118f[_0xd0d3('0x37')]);_0x42a76d[_0xd0d3('0x3a')]=_['intersection'](_0xac118f['model'],qs[_0xd0d3('0x3b')](_0x18a29d[_0xd0d3('0x37')]['fields']));_0x42a76d[_0xd0d3('0x3a')]=_0x42a76d['attributes'][_0xd0d3('0x4b')]?_0x42a76d[_0xd0d3('0x3a')]:_0xac118f['model'];if(_0x18a29d[_0xd0d3('0x37')][_0xd0d3('0x45')]){_0x42a76d[_0xd0d3('0x4c')]=[{'all':!![]}];}_0x42a76d=_['merge']({},_0x42a76d,_0x18a29d['options']);return db[_0xd0d3('0x44')][_0xd0d3('0x4d')](_0x42a76d)['then'](handleEntityNotFound(_0x7d779b,null))[_0xd0d3('0x29')](respondWithResult(_0x7d779b,null))['catch'](handleError(_0x7d779b,null));};exports[_0xd0d3('0x4e')]=function(_0x5642ed,_0x226850){return db[_0xd0d3('0x44')][_0xd0d3('0x4e')](_0x5642ed[_0xd0d3('0x4f')],{})[_0xd0d3('0x29')](function(_0x2ba516){var _0x301bd3=_0x5642ed[_0xd0d3('0x50')][_0xd0d3('0x2a')]({'plain':!![]});if(!_0x301bd3)throw new Error(_0xd0d3('0x51'));if(_0x301bd3[_0xd0d3('0x52')]===_0xd0d3('0x50')){var _0x38fe91=_0x2ba516['get']({'plain':!![]});var _0x5c84dc=_0xd0d3('0x53');return db[_0xd0d3('0x54')][_0xd0d3('0x4d')]({'where':{'name':_0x5c84dc,'userProfileId':_0x301bd3[_0xd0d3('0x55')]},'raw':!![]})[_0xd0d3('0x29')](function(_0x2c24ec){if(_0x2c24ec&&_0x2c24ec[_0xd0d3('0x56')]===0x0){return db[_0xd0d3('0x2c')][_0xd0d3('0x4e')]({'name':_0x38fe91[_0xd0d3('0x2f')],'resourceId':_0x38fe91['id'],'type':'CustomReports','sectionId':_0x2c24ec['id']},{})['then'](function(){return _0x2ba516;});}else{return _0x2ba516;}})['catch'](function(_0x3cc585){logger[_0xd0d3('0x2d')](_0xd0d3('0x57'),_0x3cc585);throw _0x3cc585;});}return _0x2ba516;})['then'](respondWithResult(_0x226850,0xc9))['catch'](handleError(_0x226850,null));};exports['update']=function(_0x1aaf96,_0x2a91dd){if(_0x1aaf96['body']['id']){delete _0x1aaf96[_0xd0d3('0x4f')]['id'];}return db[_0xd0d3('0x44')][_0xd0d3('0x4d')]({'where':{'id':_0x1aaf96[_0xd0d3('0x49')]['id']}})[_0xd0d3('0x29')](handleEntityNotFound(_0x2a91dd,null))[_0xd0d3('0x29')](saveUpdates(_0x1aaf96[_0xd0d3('0x4f')],null))['then'](respondWithResult(_0x2a91dd,null))[_0xd0d3('0x48')](handleError(_0x2a91dd,null));};exports[_0xd0d3('0x28')]=function(_0x25321a,_0x40ba0b){return db[_0xd0d3('0x44')]['find']({'where':{'id':_0x25321a[_0xd0d3('0x49')]['id']}})['then'](handleEntityNotFound(_0x40ba0b,null))[_0xd0d3('0x29')](removeEntity(_0x40ba0b,null))['catch'](handleError(_0x40ba0b,null));};exports[_0xd0d3('0x58')]=function(_0x4ab01c,_0xb50d75){var _0x15fa87=0xa;var _0x19b3d0=[_0xd0d3('0x59'),_0xd0d3('0x5a'),_0xd0d3('0x5b'),_0xd0d3('0x5c')];var _0x36f918={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd0d3('0x5d'),'MAX':'MAX(%s)','MIN':_0xd0d3('0x5e'),'AVG':_0xd0d3('0x5f'),'GROUP_CONCAT':_0xd0d3('0x60'),'GROUP_CONCAT ASC':_0xd0d3('0x61'),'GROUP_CONCAT DESC':_0xd0d3('0x62')};var _0x39bb09={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xd0d3('0x63'),'ROUND':_0xd0d3('0x64'),'UNIX_TIMESTAMP':_0xd0d3('0x65')};var _0x158dc8=function(_0x1c2cae){return!_[_0xd0d3('0x66')]([_0xd0d3('0x67'),_0xd0d3('0x68'),'IS\x20EMPTY',_0xd0d3('0x69')],_0x1c2cae);};var _0x4797ef=function(_0x4ce7fe){if(!_0x4ce7fe||!_0x4ce7fe['rules'][_0xd0d3('0x4b')]){return'';}for(var _0x287208='(',_0x371048=0x0;_0x371048<_0x4ce7fe[_0xd0d3('0x6a')][_0xd0d3('0x4b')];_0x371048+=0x1){_0x371048>0x0&&(_0x287208+='\x20'+_0x4ce7fe[_0xd0d3('0x6b')]+'\x20');_0x287208+=_0x4ce7fe[_0xd0d3('0x6a')][_0x371048][_0xd0d3('0x6c')]?_0x4797ef(_0x4ce7fe[_0xd0d3('0x6a')][_0x371048][_0xd0d3('0x6c')]):_0x4ce7fe['rules'][_0x371048][_0xd0d3('0x6d')]+'\x20'+_0x4ce7fe[_0xd0d3('0x6a')][_0x371048]['condition']+(_0x158dc8(_0x4ce7fe[_0xd0d3('0x6a')][_0x371048][_0xd0d3('0x6e')])?'\x20'+_0x4ce7fe[_0xd0d3('0x6a')][_0x371048]['value']:'');}return _0x287208+')';};var _0x40d41d={'where':{'id':_0x4ab01c[_0xd0d3('0x49')]['id']}},_0x3503d1,_0xb62e2a,_0x55efb9,_0x3c6994,_0x4f4991;_0x40d41d=_[_0xd0d3('0x42')]({},_0x40d41d,_0x4ab01c[_0xd0d3('0x43')]);return db['AnalyticCustomReport'][_0xd0d3('0x4d')](_0x40d41d)[_0xd0d3('0x29')](function(_0x1a89cd){if(_0x1a89cd){_0x3503d1=_0x1a89cd;return _0x1a89cd[_0xd0d3('0x6f')]();}return null;})[_0xd0d3('0x29')](function(_0x3156f6){if(_0x3156f6){if(!_0x3156f6['length']){throw new db[(_0xd0d3('0x70'))][(_0xd0d3('0x71'))](_0xd0d3('0x72'),0x193);}_0xb62e2a=_0x3156f6;return db[_0xd0d3('0x73')][_0xd0d3('0x46')]({'raw':!![]});}return null;})[_0xd0d3('0x29')](function(_0x1735ff){if(_0x1735ff){_0x55efb9=_['keyBy'](_0x1735ff,'id');var _0x14b178;var _0x414bae=squel['select']();_0x414bae[_0xd0d3('0x74')](_0x3503d1[_0xd0d3('0x75')]);for(var _0x2af150=0x0;_0x2af150<_0xb62e2a[_0xd0d3('0x4b')];_0x2af150+=0x1){_0x14b178=_0xb62e2a[_0x2af150][_0xd0d3('0x76')]?_0x55efb9[_0xb62e2a[_0x2af150][_0xd0d3('0x76')]][_0xd0d3('0x77')]:_0xb62e2a[_0x2af150][_0xd0d3('0x6d')];_0x14b178=_0xb62e2a[_0x2af150][_0xd0d3('0x78')]?_[_0xd0d3('0x79')](_0x36f918[_0xb62e2a[_0x2af150][_0xd0d3('0x78')]],'%s',_0x14b178):_0x14b178;_0x14b178=_0xb62e2a[_0x2af150][_0xd0d3('0x7a')]?_[_0xd0d3('0x79')](_0x39bb09[_0xb62e2a[_0x2af150][_0xd0d3('0x7a')]],'%s',_0x14b178):_0x14b178;if(_0xb62e2a[_0x2af150][_0xd0d3('0x7b')]){_0x414bae['group'](_0x14b178);}_0xb62e2a[_0x2af150][_0xd0d3('0x7c')]&&_0x414bae[_0xd0d3('0x3e')](_0x14b178,_0xb62e2a[_0x2af150][_0xd0d3('0x7c')]==='DESC'?![]:!![]);_0x414bae[_0xd0d3('0x6d')](_0x14b178,_0xb62e2a[_0x2af150][_0xd0d3('0x7d')]||_0x14b178);}if(_0x3503d1[_0xd0d3('0x7e')]){_0x3503d1['joins']=JSON['parse'](_0x3503d1['joins']);for(var _0x450d4e=0x0;_0x450d4e<_0x3503d1[_0xd0d3('0x7e')]['length'];_0x450d4e+=0x1){if(_0x3503d1[_0xd0d3('0x7e')][_0x450d4e][_0xd0d3('0x34')]&&_[_0xd0d3('0x66')](_0x19b3d0,_0x3503d1['joins'][_0x450d4e][_0xd0d3('0x34')])&&_0x3503d1[_0xd0d3('0x7e')][_0x450d4e]['parentKey']&&_0x3503d1[_0xd0d3('0x7e')][_0x450d4e][_0xd0d3('0x7f')]&&_0x3503d1[_0xd0d3('0x7e')][_0x450d4e][_0xd0d3('0x80')]){_0x414bae[_0x3503d1[_0xd0d3('0x7e')][_0x450d4e][_0xd0d3('0x34')]](_0x3503d1['joins'][_0x450d4e][_0xd0d3('0x7f')],null,util[_0xd0d3('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3503d1[_0xd0d3('0x75')],_0x3503d1[_0xd0d3('0x7e')][_0x450d4e][_0xd0d3('0x81')],_0x3503d1[_0xd0d3('0x7e')][_0x450d4e][_0xd0d3('0x7f')],_0x3503d1[_0xd0d3('0x7e')][_0x450d4e]['foreignKey']));}}}if(_0x3503d1[_0xd0d3('0x82')]){_0x3503d1[_0xd0d3('0x82')]=JSON[_0xd0d3('0x83')](_0x3503d1[_0xd0d3('0x82')]);_0x414bae[_0xd0d3('0x40')](_0x4797ef(_0x3503d1[_0xd0d3('0x82')]['group']));}_0x4f4991=_0x414bae[_0xd0d3('0x84')]();_0x414bae[_0xd0d3('0x21')](_0x15fa87);_0x414bae[_0xd0d3('0x20')](0x0);logger[_0xd0d3('0x85')](_0xd0d3('0x86'),_0x414bae[_0xd0d3('0x87')]());return dbH['sequelize']['query'](_0x414bae[_0xd0d3('0x87')](),{'type':dbH[_0xd0d3('0x88')][_0xd0d3('0x89')][_0xd0d3('0x8a')]});}})[_0xd0d3('0x29')](respondWithResult(_0xb50d75,null))['catch'](handleError(_0xb50d75,null));};function runReport(_0x41cbbf,_0x45466c,_0x1e9583){var _0x1311b4=_0x45466c[_0xd0d3('0x2f')];var _0x45363f=0xa;var _0xa1ac16=[_0xd0d3('0x59'),_0xd0d3('0x5a'),_0xd0d3('0x5b'),_0xd0d3('0x5c')];var _0x2a6f0c={'SUM':_0xd0d3('0x8b'),'COUNT':_0xd0d3('0x8c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xd0d3('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd0d3('0x60'),'GROUP_CONCAT ASC':_0xd0d3('0x61'),'GROUP_CONCAT DESC':_0xd0d3('0x62')};var _0x14a578={'SEC_TO_TIME':_0xd0d3('0x8d'),'DATE':_0xd0d3('0x8e'),'HOUR':_0xd0d3('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd0d3('0x65')};var _0x27836b=function(_0xc66f50){return!_[_0xd0d3('0x66')]([_0xd0d3('0x67'),_0xd0d3('0x68'),_0xd0d3('0x8f'),_0xd0d3('0x69')],_0xc66f50);};var _0x34b141=function(_0x5043f0){if(!_0x5043f0||!_0x5043f0['rules'][_0xd0d3('0x4b')]){return'';}for(var _0x4e239e='(',_0x517f7c=0x0;_0x517f7c<_0x5043f0[_0xd0d3('0x6a')][_0xd0d3('0x4b')];_0x517f7c+=0x1){_0x517f7c>0x0&&(_0x4e239e+='\x20'+_0x5043f0[_0xd0d3('0x6b')]+'\x20');_0x4e239e+=_0x5043f0['rules'][_0x517f7c]['group']?_0x34b141(_0x5043f0[_0xd0d3('0x6a')][_0x517f7c]['group']):_0x5043f0['rules'][_0x517f7c][_0xd0d3('0x6d')]+'\x20'+_0x5043f0[_0xd0d3('0x6a')][_0x517f7c]['condition']+(_0x27836b(_0x5043f0[_0xd0d3('0x6a')][_0x517f7c][_0xd0d3('0x6e')])?'\x20'+_0x5043f0['rules'][_0x517f7c][_0xd0d3('0x90')]:'');}return _0x4e239e+')';};var _0x2c4c99={'where':{'id':_0x41cbbf['id']}},_0x40df09,_0x5819db,_0x290029,_0x549696,_0x32f2b;_0x2c4c99=_['merge']({},_0x2c4c99,_0x1e9583);return db[_0xd0d3('0x44')][_0xd0d3('0x4d')](_0x2c4c99)[_0xd0d3('0x29')](function(_0x12814c){if(_0x12814c){_0x40df09=_0x12814c;return _0x12814c['getFields']();}return null;})[_0xd0d3('0x29')](function(_0xda82cc){if(_0xda82cc){if(!_0xda82cc[_0xd0d3('0x4b')]){throw new db[(_0xd0d3('0x70'))][(_0xd0d3('0x71'))](_0xd0d3('0x72'),0x193);}_0x5819db=_0xda82cc;return db[_0xd0d3('0x73')][_0xd0d3('0x46')]({'raw':!![]});}return null;})[_0xd0d3('0x29')](function(_0x16442c){if(_0x16442c){_0x290029=_[_0xd0d3('0x91')](_0x16442c,'id');var _0x135902;var _0x29c862=squel[_0xd0d3('0x92')]();_0x29c862['from'](_0x40df09[_0xd0d3('0x75')]);for(var _0x1eee00=0x0;_0x1eee00<_0x5819db[_0xd0d3('0x4b')];_0x1eee00+=0x1){_0x135902=_0x5819db[_0x1eee00]['MetricId']?_0x290029[_0x5819db[_0x1eee00]['MetricId']][_0xd0d3('0x77')]:_0x5819db[_0x1eee00][_0xd0d3('0x6d')];_0x135902=_0x5819db[_0x1eee00]['function']?_[_0xd0d3('0x79')](_0x2a6f0c[_0x5819db[_0x1eee00]['function']],'%s',_0x135902):_0x135902;_0x135902=_0x5819db[_0x1eee00][_0xd0d3('0x7a')]?_[_0xd0d3('0x79')](_0x14a578[_0x5819db[_0x1eee00][_0xd0d3('0x7a')]],'%s',_0x135902):_0x135902;if(_0x5819db[_0x1eee00][_0xd0d3('0x7b')]){_0x29c862[_0xd0d3('0x6c')](_0x135902);}_0x5819db[_0x1eee00][_0xd0d3('0x7c')]&&_0x29c862[_0xd0d3('0x3e')](_0x135902,_0x5819db[_0x1eee00][_0xd0d3('0x7c')]==='DESC'?![]:!![]);_0x29c862[_0xd0d3('0x6d')](_0x135902,_0x5819db[_0x1eee00]['alias']||_0x135902);}if(_0x40df09[_0xd0d3('0x7e')]){_0x40df09['joins']=JSON['parse'](_0x40df09[_0xd0d3('0x7e')]);for(var _0x45f89f=0x0;_0x45f89f<_0x40df09[_0xd0d3('0x7e')][_0xd0d3('0x4b')];_0x45f89f+=0x1){if(_0x40df09[_0xd0d3('0x7e')][_0x45f89f][_0xd0d3('0x34')]&&_[_0xd0d3('0x66')](_0xa1ac16,_0x40df09[_0xd0d3('0x7e')][_0x45f89f][_0xd0d3('0x34')])&&_0x40df09['joins'][_0x45f89f][_0xd0d3('0x81')]&&_0x40df09[_0xd0d3('0x7e')][_0x45f89f]['foreignTable']&&_0x40df09[_0xd0d3('0x7e')][_0x45f89f]['foreignKey']){_0x29c862[_0x40df09['joins'][_0x45f89f][_0xd0d3('0x34')]](_0x40df09['joins'][_0x45f89f]['foreignTable'],null,util[_0xd0d3('0x7a')](_0xd0d3('0x93'),_0x40df09['table'],_0x40df09['joins'][_0x45f89f]['parentKey'],_0x40df09[_0xd0d3('0x7e')][_0x45f89f][_0xd0d3('0x7f')],_0x40df09[_0xd0d3('0x7e')][_0x45f89f][_0xd0d3('0x80')]));}}}if(_0x40df09[_0xd0d3('0x82')]){_0x40df09[_0xd0d3('0x82')]=JSON[_0xd0d3('0x83')](_0x40df09['conditions']);_0x29c862['where'](_0x34b141(_0x40df09['conditions']['group']));}_0x32f2b=_0x29c862['clone']();_0x29c862['limit'](_0x45363f);_0x29c862[_0xd0d3('0x20')](0x0);return;}})[_0xd0d3('0x29')](function(){if(_0x45466c[_0xd0d3('0x94')]==='web'){return null;}var _0x5ca981=_[_0xd0d3('0x42')](_0x45466c,{'name':_0x45466c[_0xd0d3('0x95')]||_0x45466c[_0xd0d3('0x2f')]||_0x40df09[_0xd0d3('0x2f')],'basename':_0x1311b4,'savename':util[_0xd0d3('0x7a')](_0xd0d3('0x96'),_0x45466c[_0xd0d3('0x2f')]||_0x40df09[_0xd0d3('0x2f')],require(_0xd0d3('0x97'))[_0xd0d3('0x98')](0x4),_0x45466c[_0xd0d3('0x94')]||'csv'),'reportId':_0x40df09['id'],'reportType':_0xd0d3('0x99')});return db['AnalyticExtractedReport']['create'](_0x5ca981,{'raw':!![]});})[_0xd0d3('0x29')](function(_0x270379){if(_0x40df09[_0xd0d3('0x75')]==='cdr'){_0x32f2b[_0xd0d3('0x40')](_0x40df09[_0xd0d3('0x75')]+_0xd0d3('0x9a'),_0x45466c[_0xd0d3('0x9b')],_0x45466c[_0xd0d3('0x9c')]);}else{_0x32f2b[_0xd0d3('0x40')](_0x40df09['table']+_0xd0d3('0x9d'),_0x45466c[_0xd0d3('0x9b')],_0x45466c[_0xd0d3('0x9c')]);}if(_0x270379){logger['info'](_0xd0d3('0x9e'),_0x32f2b[_0xd0d3('0x87')]());require('child_process')['fork'](path[_0xd0d3('0x59')](__dirname,_0xd0d3('0x9f'),_0x270379['output']),[_0x270379['id'],_0x32f2b['toString'](),path['join'](__dirname,'../../files/reports',_0x270379['savename']),_0x1311b4]);return _0x270379;}else{var _0x25ecfe=squel[_0xd0d3('0x92')]();_0x25ecfe[_0xd0d3('0x74')]('('+_0x32f2b[_0xd0d3('0x87')]()+')','countTable');_0x25ecfe[_0xd0d3('0x6d')](_0xd0d3('0xa0'),'count');_0x32f2b[_0xd0d3('0x21')](_0x45466c[_0xd0d3('0x21')]||_0x45363f);_0x32f2b[_0xd0d3('0x20')](_0x45466c[_0xd0d3('0x20')]||0x0);return dbH[_0xd0d3('0x88')][_0xd0d3('0x37')](_0x25ecfe[_0xd0d3('0x87')](),{'type':dbH[_0xd0d3('0x88')][_0xd0d3('0x89')][_0xd0d3('0x8a')]})[_0xd0d3('0x29')](function(_0x538ccb){if(!_0x538ccb[_0xd0d3('0x4b')]){_0x549696=0x0;}else{_0x549696=_0x538ccb[0x0][_0xd0d3('0x1f')]||0x0;}return dbH[_0xd0d3('0x88')]['query'](_0x32f2b[_0xd0d3('0x87')](),{'type':dbH[_0xd0d3('0x88')]['QueryTypes'][_0xd0d3('0x8a')]});})[_0xd0d3('0x29')](function(_0x733981){return{'rows':_0x733981||[],'count':_0x549696};});}});}exports[_0xd0d3('0xa1')]=function(_0x53dc6e,_0x387c5b){return runReport(_0x53dc6e[_0xd0d3('0x49')],_0x53dc6e[_0xd0d3('0x37')],_0x53dc6e[_0xd0d3('0x43')])[_0xd0d3('0x29')](respondWithResult(_0x387c5b,null))[_0xd0d3('0x48')](handleError(_0x387c5b,null));};exports[_0xd0d3('0xa2')]=runReport;exports[_0xd0d3('0x37')]=function(_0x32ffb1,_0xf76017){var _0x4d2d5b=0xa;var _0xb20b04=[_0xd0d3('0x59'),'left_join',_0xd0d3('0x5b'),_0xd0d3('0x5c')];var _0x35774a={'SUM':_0xd0d3('0x8b'),'COUNT':_0xd0d3('0x8c'),'COUNT DISTINCT':_0xd0d3('0x5d'),'MAX':_0xd0d3('0xa3'),'MIN':_0xd0d3('0x5e'),'AVG':_0xd0d3('0x5f'),'GROUP_CONCAT':_0xd0d3('0x60'),'GROUP_CONCAT ASC':_0xd0d3('0x61'),'GROUP_CONCAT DESC':_0xd0d3('0x62')};var _0xf2dbcc={'SEC_TO_TIME':_0xd0d3('0x8d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd0d3('0x64'),'UNIX_TIMESTAMP':_0xd0d3('0x65')};var _0x4137d6=function(_0x226fb6){return!_[_0xd0d3('0x66')]([_0xd0d3('0x67'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x226fb6);};var _0x3772b6=function(_0x261aca){if(!_0x261aca||!_0x261aca[_0xd0d3('0x6a')][_0xd0d3('0x4b')]){return'';}for(var _0x48c0c5='(',_0x546a30=0x0;_0x546a30<_0x261aca[_0xd0d3('0x6a')][_0xd0d3('0x4b')];_0x546a30+=0x1){_0x546a30>0x0&&(_0x48c0c5+='\x20'+_0x261aca[_0xd0d3('0x6b')]+'\x20');_0x48c0c5+=_0x261aca[_0xd0d3('0x6a')][_0x546a30]['group']?_0x3772b6(_0x261aca[_0xd0d3('0x6a')][_0x546a30][_0xd0d3('0x6c')]):_0x261aca[_0xd0d3('0x6a')][_0x546a30][_0xd0d3('0x6d')]+'\x20'+_0x261aca['rules'][_0x546a30][_0xd0d3('0x6e')]+(_0x4137d6(_0x261aca['rules'][_0x546a30][_0xd0d3('0x6e')])?'\x20'+_0x261aca[_0xd0d3('0x6a')][_0x546a30][_0xd0d3('0x90')]:'');}return _0x48c0c5+')';};var _0x367ed9={'where':{'id':_0x32ffb1[_0xd0d3('0x49')]['id']}},_0x24a4b7,_0x17dc56,_0x38d256,_0x40be9a,_0x2df404;_0x367ed9=_['merge']({},_0x367ed9,_0x32ffb1['options']);return db[_0xd0d3('0x44')]['find'](_0x367ed9)[_0xd0d3('0x29')](function(_0x15bb5b){if(_0x15bb5b){_0x24a4b7=_0x15bb5b;return _0x15bb5b['getFields']();}return null;})['then'](function(_0x262119){if(_0x262119){if(!_0x262119[_0xd0d3('0x4b')]){throw new db[(_0xd0d3('0x70'))][(_0xd0d3('0x71'))](_0xd0d3('0x72'),0x193);}_0x17dc56=_0x262119;return db[_0xd0d3('0x73')][_0xd0d3('0x46')]({'raw':!![]});}return null;})[_0xd0d3('0x29')](function(_0x55e854){if(_0x55e854){_0x38d256=_['keyBy'](_0x55e854,'id');var _0x53dbc8;var _0x510f9b=squel['select']();_0x510f9b[_0xd0d3('0x74')](_0x24a4b7[_0xd0d3('0x75')]);for(var _0xb96539=0x0;_0xb96539<_0x17dc56[_0xd0d3('0x4b')];_0xb96539+=0x1){_0x53dbc8=_0x17dc56[_0xb96539]['MetricId']?_0x38d256[_0x17dc56[_0xb96539]['MetricId']][_0xd0d3('0x77')]:_0x17dc56[_0xb96539][_0xd0d3('0x6d')];_0x53dbc8=_0x17dc56[_0xb96539][_0xd0d3('0x78')]?_[_0xd0d3('0x79')](_0x35774a[_0x17dc56[_0xb96539]['function']],'%s',_0x53dbc8):_0x53dbc8;_0x53dbc8=_0x17dc56[_0xb96539][_0xd0d3('0x7a')]?_[_0xd0d3('0x79')](_0xf2dbcc[_0x17dc56[_0xb96539]['format']],'%s',_0x53dbc8):_0x53dbc8;if(_0x17dc56[_0xb96539][_0xd0d3('0x7b')]){_0x510f9b['group'](_0x53dbc8);}_0x17dc56[_0xb96539][_0xd0d3('0x7c')]&&_0x510f9b['order'](_0x53dbc8,_0x17dc56[_0xb96539][_0xd0d3('0x7c')]===_0xd0d3('0xa4')?![]:!![]);_0x510f9b[_0xd0d3('0x6d')](_0x53dbc8,_0x17dc56[_0xb96539][_0xd0d3('0x7d')]||_0x53dbc8);}if(_0x24a4b7[_0xd0d3('0x7e')]){_0x24a4b7[_0xd0d3('0x7e')]=JSON['parse'](_0x24a4b7[_0xd0d3('0x7e')]);for(var _0xe013f9=0x0;_0xe013f9<_0x24a4b7[_0xd0d3('0x7e')][_0xd0d3('0x4b')];_0xe013f9+=0x1){if(_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9]['type']&&_[_0xd0d3('0x66')](_0xb20b04,_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9]['type'])&&_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9][_0xd0d3('0x81')]&&_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9][_0xd0d3('0x7f')]&&_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9][_0xd0d3('0x80')]){_0x510f9b[_0x24a4b7['joins'][_0xe013f9][_0xd0d3('0x34')]](_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9][_0xd0d3('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x24a4b7[_0xd0d3('0x75')],_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9]['parentKey'],_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9]['foreignTable'],_0x24a4b7[_0xd0d3('0x7e')][_0xe013f9][_0xd0d3('0x80')]));}}}if(_0x24a4b7[_0xd0d3('0x82')]){_0x24a4b7[_0xd0d3('0x82')]=JSON[_0xd0d3('0x83')](_0x24a4b7[_0xd0d3('0x82')]);_0x510f9b[_0xd0d3('0x40')](_0x3772b6(_0x24a4b7[_0xd0d3('0x82')][_0xd0d3('0x6c')]));}_0x2df404=_0x510f9b[_0xd0d3('0x84')]();_0x510f9b[_0xd0d3('0x21')](_0x4d2d5b);_0x510f9b['offset'](0x0);logger[_0xd0d3('0x85')](_0xd0d3('0x86'),_0x510f9b[_0xd0d3('0x87')]());return dbH['sequelize'][_0xd0d3('0x37')](_0x510f9b[_0xd0d3('0x87')](),{'type':dbH[_0xd0d3('0x88')][_0xd0d3('0x89')][_0xd0d3('0x8a')]});}})[_0xd0d3('0x29')](function(){return{'sql':_0x2df404[_0xd0d3('0x87')]()};})['then'](respondWithResult(_0xf76017,null))[_0xd0d3('0x48')](handleError(_0xf76017,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 7976437..e130ab4 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 _0xb029=['AnalyticCustomReport','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x21c369,_0xd10616){var _0x1bd425=function(_0x3ba7e9){while(--_0x3ba7e9){_0x21c369['push'](_0x21c369['shift']());}};_0x1bd425(++_0xd10616);}(_0xb029,0xab));var _0x9b02=function(_0x3cc81e,_0x3309df){_0x3cc81e=_0x3cc81e-0x0;var _0x3d83ba=_0xb029[_0x3cc81e];return _0x3d83ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9b02('0x0'));var moment=require('moment');var BPromise=require(_0x9b02('0x1'));var rp=require(_0x9b02('0x2'));var fs=require('fs');var path=require(_0x9b02('0x3'));var rimraf=require(_0x9b02('0x4'));var config=require(_0x9b02('0x5'));var attributes=require(_0x9b02('0x6'));module[_0x9b02('0x7')]=function(_0x45db3d,_0x23b2f2){return _0x45db3d[_0x9b02('0x8')](_0x9b02('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2cb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','../../config/logger','api'];(function(_0x34932e,_0x278c52){var _0x56711b=function(_0x1746b5){while(--_0x1746b5){_0x34932e['push'](_0x34932e['shift']());}};_0x56711b(++_0x278c52);}(_0xa2cb,0x8a));var _0xba2c=function(_0x125d6d,_0x52f01a){_0x125d6d=_0x125d6d-0x0;var _0x5c1026=_0xa2cb[_0x125d6d];return _0x5c1026;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba2c('0x0'))(_0xba2c('0x1'));var moment=require(_0xba2c('0x2'));var BPromise=require(_0xba2c('0x3'));var rp=require(_0xba2c('0x4'));var fs=require('fs');var path=require(_0xba2c('0x5'));var rimraf=require(_0xba2c('0x6'));var config=require(_0xba2c('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0xba2c('0x8')]=function(_0x4868fa,_0x60b749){return _0x4868fa[_0xba2c('0x9')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 1185137..e2c86d8 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 _0x1c64=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2c4c48,_0x402353){var _0x5ee161=function(_0xdf7e78){while(--_0xdf7e78){_0x2c4c48['push'](_0x2c4c48['shift']());}};_0x5ee161(++_0x402353);}(_0x1c64,0x13d));var _0x41c6=function(_0x402887,_0xb5813c){_0x402887=_0x402887-0x0;var _0x3fa3cb=_0x1c64[_0x402887];return _0x3fa3cb;};'use strict';var _=require(_0x41c6('0x0'));var util=require(_0x41c6('0x1'));var moment=require(_0x41c6('0x2'));var BPromise=require('bluebird');var rs=require(_0x41c6('0x3'));var fs=require('fs');var Redis=require(_0x41c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x41c6('0x5'));var logger=require(_0x41c6('0x6'))(_0x41c6('0x7'));var config=require(_0x41c6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x41c6('0x9')][_0x41c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x201b28,_0x24f07c,_0x2996c7){return new BPromise(function(_0x8453ba,_0x3d4c5b){return client['request'](_0x201b28,_0x2996c7)['then'](function(_0x4845fe){logger[_0x41c6('0xb')](_0x41c6('0xc'),_0x24f07c,_0x41c6('0xd'));logger[_0x41c6('0xe')](_0x41c6('0xf'),_0x24f07c,_0x41c6('0xd'),JSON[_0x41c6('0x10')](_0x4845fe));if(_0x4845fe[_0x41c6('0x11')]){if(_0x4845fe[_0x41c6('0x11')]['code']===0x1f4){logger['error'](_0x41c6('0xc'),_0x24f07c,_0x4845fe[_0x41c6('0x11')][_0x41c6('0x12')]);return _0x3d4c5b(_0x4845fe[_0x41c6('0x11')][_0x41c6('0x12')]);}logger[_0x41c6('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x24f07c,_0x4845fe[_0x41c6('0x11')][_0x41c6('0x12')]);return _0x8453ba(_0x4845fe[_0x41c6('0x11')][_0x41c6('0x12')]);}else{logger[_0x41c6('0xb')](_0x41c6('0xc'),_0x24f07c,'request\x20sent');_0x8453ba(_0x4845fe[_0x41c6('0x13')][_0x41c6('0x12')]);}})[_0x41c6('0x14')](function(_0x16b9f7){logger[_0x41c6('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x24f07c,_0x16b9f7);_0x3d4c5b(_0x16b9f7);});});} \ No newline at end of file +var _0x85da=['code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x276df8,_0x2b6854){var _0x328a7d=function(_0x481cd0){while(--_0x481cd0){_0x276df8['push'](_0x276df8['shift']());}};_0x328a7d(++_0x2b6854);}(_0x85da,0x1bd));var _0xa85d=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0x85da[_0x2c534a];return _0x3f5c99;};'use strict';var _=require(_0xa85d('0x0'));var util=require(_0xa85d('0x1'));var moment=require(_0xa85d('0x2'));var BPromise=require(_0xa85d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa85d('0x4'))['db'];var utils=require(_0xa85d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa85d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa85d('0x7')][_0xa85d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x998d99,_0x3fab0d,_0x20bff2){return new BPromise(function(_0x112749,_0x59b20c){return client[_0xa85d('0x9')](_0x998d99,_0x20bff2)[_0xa85d('0xa')](function(_0x163144){logger[_0xa85d('0xb')](_0xa85d('0xc'),_0x3fab0d,'request\x20sent');logger[_0xa85d('0xd')](_0xa85d('0xe'),_0x3fab0d,'request\x20sent',JSON[_0xa85d('0xf')](_0x163144));if(_0x163144[_0xa85d('0x10')]){if(_0x163144[_0xa85d('0x10')][_0xa85d('0x11')]===0x1f4){logger[_0xa85d('0x10')](_0xa85d('0xc'),_0x3fab0d,_0x163144[_0xa85d('0x10')][_0xa85d('0x12')]);return _0x59b20c(_0x163144['error'][_0xa85d('0x12')]);}logger[_0xa85d('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3fab0d,_0x163144[_0xa85d('0x10')][_0xa85d('0x12')]);return _0x112749(_0x163144[_0xa85d('0x10')][_0xa85d('0x12')]);}else{logger[_0xa85d('0xb')](_0xa85d('0xc'),_0x3fab0d,'request\x20sent');_0x112749(_0x163144[_0xa85d('0x13')][_0xa85d('0x12')]);}})[_0xa85d('0x14')](function(_0x5db2aa){logger['error'](_0xa85d('0xc'),_0x3fab0d,_0x5db2aa);_0x59b20c(_0x5db2aa);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index d5e72d4..50cbac4 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 _0xaf58=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','preview','run','/:id/query','create','update','delete','destroy','exports','util'];(function(_0x5905cd,_0x36f55e){var _0x43a05d=function(_0x5a5d16){while(--_0x5a5d16){_0x5905cd['push'](_0x5905cd['shift']());}};_0x43a05d(++_0x36f55e);}(_0xaf58,0x155));var _0x8af5=function(_0x3b2944,_0x255615){_0x3b2944=_0x3b2944-0x0;var _0xea505e=_0xaf58[_0x3b2944];return _0xea505e;};'use strict';var multer=require('multer');var util=require(_0x8af5('0x0'));var path=require(_0x8af5('0x1'));var timeout=require(_0x8af5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8af5('0x3'));var auth=require(_0x8af5('0x4'));var interaction=require(_0x8af5('0x5'));var config=require('../../config/environment');var controller=require(_0x8af5('0x6'));router[_0x8af5('0x7')]('/',auth[_0x8af5('0x8')](),controller['index']);router[_0x8af5('0x7')](_0x8af5('0x9'),auth[_0x8af5('0x8')](),controller[_0x8af5('0xa')]);router[_0x8af5('0x7')]('/:id/preview',auth[_0x8af5('0x8')](),controller[_0x8af5('0xb')]);router['get']('/:id/run',auth[_0x8af5('0x8')](),controller[_0x8af5('0xc')]);router['get'](_0x8af5('0xd'),auth[_0x8af5('0x8')](),controller['query']);router['post']('/',auth[_0x8af5('0x8')](),controller[_0x8af5('0xe')]);router['put'](_0x8af5('0x9'),auth[_0x8af5('0x8')](),controller[_0x8af5('0xf')]);router[_0x8af5('0x10')](_0x8af5('0x9'),auth[_0x8af5('0x8')](),controller[_0x8af5('0x11')]);module[_0x8af5('0x12')]=router; \ No newline at end of file +var _0xf593=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id/preview','/:id/run','run','/:id/query','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0xbbdf62,_0x7c834){var _0x4aa7f4=function(_0x4a9695){while(--_0x4a9695){_0xbbdf62['push'](_0xbbdf62['shift']());}};_0x4aa7f4(++_0x7c834);}(_0xf593,0x103));var _0x3f59=function(_0x56524b,_0x25a07b){_0x56524b=_0x56524b-0x0;var _0x2bf4aa=_0xf593[_0x56524b];return _0x2bf4aa;};'use strict';var multer=require(_0x3f59('0x0'));var util=require('util');var path=require(_0x3f59('0x1'));var timeout=require(_0x3f59('0x2'));var express=require(_0x3f59('0x3'));var router=express[_0x3f59('0x4')]();var fs_extra=require(_0x3f59('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3f59('0x6'));var config=require(_0x3f59('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x3f59('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3f59('0x9')](_0x3f59('0xa'),auth[_0x3f59('0x8')](),controller['preview']);router[_0x3f59('0x9')](_0x3f59('0xb'),auth[_0x3f59('0x8')](),controller[_0x3f59('0xc')]);router[_0x3f59('0x9')](_0x3f59('0xd'),auth['isAuthenticated'](),controller['query']);router[_0x3f59('0xe')]('/',auth[_0x3f59('0x8')](),controller[_0x3f59('0xf')]);router[_0x3f59('0x10')](_0x3f59('0x11'),auth[_0x3f59('0x8')](),controller[_0x3f59('0x12')]);router[_0x3f59('0x13')](_0x3f59('0x11'),auth[_0x3f59('0x8')](),controller[_0x3f59('0x14')]);module[_0x3f59('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c891f97..7e0193c 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 _0x71ab=['TEXT','exports','STRING'];(function(_0x48aa52,_0x16ee0d){var _0x413d61=function(_0x361b3e){while(--_0x361b3e){_0x48aa52['push'](_0x48aa52['shift']());}};_0x413d61(++_0x16ee0d);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file +var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x5a067a,_0x245339){var _0x3c2410=function(_0x350259){while(--_0x350259){_0x5a067a['push'](_0x5a067a['shift']());}};_0x3c2410(++_0x245339);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x186397,_0x3a11f0){_0x186397=_0x186397-0x0;var _0x22365e=_0x3f8a[_0x186397];return _0x22365e;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 31c7ce4..b4af018 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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x21b0ef,_0x2bec64){var _0x135500=function(_0x4d155){while(--_0x4d155){_0x21b0ef['push'](_0x21b0ef['shift']());}};_0x135500(++_0x2bec64);}(_0x2675,0x75));var _0x5267=function(_0x5d8778,_0x3c2f0e){_0x5d8778=_0x5d8778-0x0;var _0x133e42=_0x2675[_0x5d8778];return _0x133e42;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file +var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x2f95ba,_0x5b1ccf){var _0x167b87=function(_0x1fd564){while(--_0x1fd564){_0x2f95ba['push'](_0x2f95ba['shift']());}};_0x167b87(++_0x5b1ccf);}(_0x1261,0x144));var _0x1126=function(_0x97c6ea,_0x4cffce){_0x97c6ea=_0x97c6ea-0x0;var _0x2d7f50=_0x1261[_0x97c6ea];return _0x2d7f50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index c1a16fa..d6551c2 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 _0x1c0f=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x148775,_0x27e4d2){var _0x519740=function(_0x31158e){while(--_0x31158e){_0x148775['push'](_0x148775['shift']());}};_0x519740(++_0x27e4d2);}(_0x1c0f,0x1da));var _0xf1c0=function(_0x1b4938,_0x455fa6){_0x1b4938=_0x1b4938-0x0;var _0x161473=_0x1c0f[_0x1b4938];return _0x161473;};'use strict';var _=require(_0xf1c0('0x0'));var util=require(_0xf1c0('0x1'));var logger=require(_0xf1c0('0x2'))('api');var moment=require(_0xf1c0('0x3'));var BPromise=require(_0xf1c0('0x4'));var rp=require(_0xf1c0('0x5'));var fs=require('fs');var path=require(_0xf1c0('0x6'));var rimraf=require(_0xf1c0('0x7'));var config=require(_0xf1c0('0x8'));var attributes=require(_0xf1c0('0x9'));module[_0xf1c0('0xa')]=function(_0x30e3f4,_0xcfbd71){return _0x30e3f4[_0xf1c0('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0xf1c0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0deb=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0deb,0xaf));var _0xb0de=function(_0x3e448a,_0x1f7cab){_0x3e448a=_0x3e448a-0x0;var _0x2e26d9=_0x0deb[_0x3e448a];return _0x2e26d9;};'use strict';var _=require(_0xb0de('0x0'));var util=require(_0xb0de('0x1'));var logger=require(_0xb0de('0x2'))(_0xb0de('0x3'));var moment=require(_0xb0de('0x4'));var BPromise=require(_0xb0de('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0de('0x6'));var rimraf=require(_0xb0de('0x7'));var config=require(_0xb0de('0x8'));var attributes=require(_0xb0de('0x9'));module[_0xb0de('0xa')]=function(_0x563bb9,_0xad5b2d){return _0x563bb9[_0xb0de('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0xb0de('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index cc69f02..2fe57b4 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 _0x07cc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird'];(function(_0x453929,_0x2ab5e4){var _0x56a8a3=function(_0x26960b){while(--_0x26960b){_0x453929['push'](_0x453929['shift']());}};_0x56a8a3(++_0x2ab5e4);}(_0x07cc,0x164));var _0xc07c=function(_0x4d0fc8,_0x108334){_0x4d0fc8=_0x4d0fc8-0x0;var _0x47cb1c=_0x07cc[_0x4d0fc8];return _0x47cb1c;};'use strict';var _=require(_0xc07c('0x0'));var util=require(_0xc07c('0x1'));var moment=require(_0xc07c('0x2'));var BPromise=require(_0xc07c('0x3'));var rs=require(_0xc07c('0x4'));var fs=require('fs');var Redis=require(_0xc07c('0x5'));var db=require(_0xc07c('0x6'))['db'];var utils=require(_0xc07c('0x7'));var logger=require(_0xc07c('0x8'))(_0xc07c('0x9'));var config=require(_0xc07c('0xa'));var jayson=require(_0xc07c('0xb'));var client=jayson[_0xc07c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd50b3e,_0x367560,_0x214981){return new BPromise(function(_0x409d66,_0x42d183){return client[_0xc07c('0xd')](_0xd50b3e,_0x214981)[_0xc07c('0xe')](function(_0x1964a3){logger[_0xc07c('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x367560,_0xc07c('0x10'));logger['debug'](_0xc07c('0x11'),_0x367560,_0xc07c('0x10'),JSON[_0xc07c('0x12')](_0x1964a3));if(_0x1964a3[_0xc07c('0x13')]){if(_0x1964a3[_0xc07c('0x13')]['code']===0x1f4){logger[_0xc07c('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x367560,_0x1964a3[_0xc07c('0x13')][_0xc07c('0x14')]);return _0x42d183(_0x1964a3[_0xc07c('0x13')][_0xc07c('0x14')]);}logger[_0xc07c('0x13')](_0xc07c('0x15'),_0x367560,_0x1964a3[_0xc07c('0x13')][_0xc07c('0x14')]);return _0x409d66(_0x1964a3[_0xc07c('0x13')][_0xc07c('0x14')]);}else{logger[_0xc07c('0xf')](_0xc07c('0x15'),_0x367560,'request\x20sent');_0x409d66(_0x1964a3[_0xc07c('0x16')][_0xc07c('0x14')]);}})[_0xc07c('0x17')](function(_0x5badab){logger[_0xc07c('0x13')](_0xc07c('0x15'),_0x367560,_0x5badab);_0x42d183(_0x5badab);});});} \ No newline at end of file +var _0x4da0=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x402576,_0x3d1a24){var _0x5af2b3=function(_0x5dbd45){while(--_0x5dbd45){_0x402576['push'](_0x402576['shift']());}};_0x5af2b3(++_0x3d1a24);}(_0x4da0,0x17f));var _0x04da=function(_0x18de6d,_0x243e3c){_0x18de6d=_0x18de6d-0x0;var _0x577e24=_0x4da0[_0x18de6d];return _0x577e24;};'use strict';var _=require(_0x04da('0x0'));var util=require('util');var moment=require(_0x04da('0x1'));var BPromise=require(_0x04da('0x2'));var rs=require(_0x04da('0x3'));var fs=require('fs');var Redis=require(_0x04da('0x4'));var db=require(_0x04da('0x5'))['db'];var utils=require(_0x04da('0x6'));var logger=require(_0x04da('0x7'))(_0x04da('0x8'));var config=require(_0x04da('0x9'));var jayson=require(_0x04da('0xa'));var client=jayson['client'][_0x04da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30dd82,_0x1dc81f,_0x4036a4){return new BPromise(function(_0x2c6aae,_0x464475){return client['request'](_0x30dd82,_0x4036a4)['then'](function(_0x13287a){logger['info'](_0x04da('0xc'),_0x1dc81f,_0x04da('0xd'));logger[_0x04da('0xe')](_0x04da('0xf'),_0x1dc81f,_0x04da('0xd'),JSON[_0x04da('0x10')](_0x13287a));if(_0x13287a[_0x04da('0x11')]){if(_0x13287a[_0x04da('0x11')][_0x04da('0x12')]===0x1f4){logger[_0x04da('0x11')](_0x04da('0xc'),_0x1dc81f,_0x13287a['error'][_0x04da('0x13')]);return _0x464475(_0x13287a[_0x04da('0x11')]['message']);}logger[_0x04da('0x11')](_0x04da('0xc'),_0x1dc81f,_0x13287a['error'][_0x04da('0x13')]);return _0x2c6aae(_0x13287a[_0x04da('0x11')]['message']);}else{logger[_0x04da('0x14')](_0x04da('0xc'),_0x1dc81f,_0x04da('0xd'));_0x2c6aae(_0x13287a['result'][_0x04da('0x13')]);}})[_0x04da('0x15')](function(_0xf38e7){logger[_0x04da('0x11')](_0x04da('0xc'),_0x1dc81f,_0xf38e7);_0x464475(_0xf38e7);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 0fdfe5a..730a477 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 _0x3940=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','/:id/query','query','post','create','update','delete','destroy','multer','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3940,0x91));var _0x0394=function(_0x441021,_0x145aab){_0x441021=_0x441021-0x0;var _0x1d9704=_0x3940[_0x441021];return _0x1d9704;};'use strict';var multer=require(_0x0394('0x0'));var util=require(_0x0394('0x1'));var path=require(_0x0394('0x2'));var timeout=require(_0x0394('0x3'));var express=require('express');var router=express[_0x0394('0x4')]();var fs_extra=require(_0x0394('0x5'));var auth=require(_0x0394('0x6'));var interaction=require(_0x0394('0x7'));var config=require('../../config/environment');var controller=require(_0x0394('0x8'));router[_0x0394('0x9')]('/',auth[_0x0394('0xa')](),controller[_0x0394('0xb')]);router['get'](_0x0394('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x0394('0xd'),auth[_0x0394('0xa')](),controller['preview']);router['get']('/:id/run',auth[_0x0394('0xa')](),controller['run']);router[_0x0394('0x9')](_0x0394('0xe'),auth[_0x0394('0xa')](),controller[_0x0394('0xf')]);router[_0x0394('0x10')]('/',auth[_0x0394('0xa')](),controller[_0x0394('0x11')]);router['put'](_0x0394('0xc'),auth['isAuthenticated'](),controller[_0x0394('0x12')]);router[_0x0394('0x13')]('/:id',auth[_0x0394('0xa')](),controller[_0x0394('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4253=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/query','post','create','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0x1f75f6,_0x3654e1){var _0x5c06c1=function(_0x21b3ba){while(--_0x21b3ba){_0x1f75f6['push'](_0x1f75f6['shift']());}};_0x5c06c1(++_0x3654e1);}(_0x4253,0x14c));var _0x3425=function(_0x5e25c8,_0x50b9d9){_0x5e25c8=_0x5e25c8-0x0;var _0x31e800=_0x4253[_0x5e25c8];return _0x31e800;};'use strict';var multer=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var path=require('path');var timeout=require(_0x3425('0x2'));var express=require('express');var router=express[_0x3425('0x3')]();var fs_extra=require(_0x3425('0x4'));var auth=require(_0x3425('0x5'));var interaction=require(_0x3425('0x6'));var config=require(_0x3425('0x7'));var controller=require(_0x3425('0x8'));router[_0x3425('0x9')]('/',auth[_0x3425('0xa')](),controller[_0x3425('0xb')]);router['get'](_0x3425('0xc'),auth[_0x3425('0xa')](),controller[_0x3425('0xd')]);router['get'](_0x3425('0xe'),auth[_0x3425('0xa')](),controller['preview']);router[_0x3425('0x9')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x3425('0x9')](_0x3425('0xf'),auth[_0x3425('0xa')](),controller['query']);router[_0x3425('0x10')]('/',auth[_0x3425('0xa')](),controller[_0x3425('0x11')]);router['put'](_0x3425('0xc'),auth[_0x3425('0xa')](),controller[_0x3425('0x12')]);router[_0x3425('0x13')](_0x3425('0xc'),auth[_0x3425('0xa')](),controller[_0x3425('0x14')]);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 89c87a1..f459f3a 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 _0x734b=['moment','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED','sequelize'];(function(_0x7c2035,_0x13334){var _0x50f5c1=function(_0x20a9b4){while(--_0x20a9b4){_0x7c2035['push'](_0x7c2035['shift']());}};_0x50f5c1(++_0x13334);}(_0x734b,0xfc));var _0xb734=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x734b[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0xb734('0x0'));var moment=require(_0xb734('0x1'));module['exports']={'name':{'type':Sequelize[_0xb734('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xb734('0x3')](_0xb734('0x4'),_0xb734('0x5'),_0xb734('0x6')),'allowNull':![],'defaultValue':_0xb734('0x4')},'savename':{'type':Sequelize[_0xb734('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb734('0x7')]},'endDate':{'type':Sequelize[_0xb734('0x7')]},'status':{'type':Sequelize[_0xb734('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xb734('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xb734('0x8')},'reportId':{'type':Sequelize[_0xb734('0x9')](0xb)[_0xb734('0xa')]},'reportType':{'type':Sequelize[_0xb734('0x2')]}}; \ No newline at end of file +var _0x30d4=['moment','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled','sequelize'];(function(_0x4083af,_0x39a20c){var _0x2b55e0=function(_0x5bd592){while(--_0x5bd592){_0x4083af['push'](_0x4083af['shift']());}};_0x2b55e0(++_0x39a20c);}(_0x30d4,0x1c2));var _0x430d=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x30d4[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0x430d('0x0'));var moment=require(_0x430d('0x1'));module['exports']={'name':{'type':Sequelize[_0x430d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x430d('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x430d('0x3'),_0x430d('0x4'),_0x430d('0x5')),'allowNull':![],'defaultValue':_0x430d('0x3')},'savename':{'type':Sequelize[_0x430d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x430d('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x430d('0x7')},'type':{'type':Sequelize[_0x430d('0x8')](_0x430d('0x9'),_0x430d('0xa')),'allowNull':![],'defaultValue':_0x430d('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x430d('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 3f7a964..886a949 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 _0xc39b=['ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','ExtractedReports','UserProfileResource','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','AnalyticExtractedReport','findAll','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','basename','savename','output','root','server/files/reports'];(function(_0x1c2744,_0x1c0562){var _0x338c56=function(_0x143f1f){while(--_0x143f1f){_0x1c2744['push'](_0x1c2744['shift']());}};_0x338c56(++_0x1c0562);}(_0xc39b,0x119));var _0xbc39=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc39b[_0x346737];return _0x1ade2e;};'use strict';var emlformat=require(_0xbc39('0x0'));var rimraf=require(_0xbc39('0x1'));var zipdir=require(_0xbc39('0x2'));var jsonpatch=require(_0xbc39('0x3'));var rp=require(_0xbc39('0x4'));var moment=require(_0xbc39('0x5'));var BPromise=require(_0xbc39('0x6'));var Mustache=require('mustache');var util=require(_0xbc39('0x7'));var path=require('path');var sox=require(_0xbc39('0x8'));var csv=require(_0xbc39('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(_0xbc39('0xa'));var jsforce=require(_0xbc39('0xb'));var deskjs=require(_0xbc39('0xc'));var toCsv=require(_0xbc39('0x9'));var querystring=require(_0xbc39('0xd'));var Papa=require('papaparse');var Redis=require(_0xbc39('0xe'));var authService=require(_0xbc39('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc39('0x10'));var logger=require(_0xbc39('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xbc39('0x12'));var licenseUtil=require(_0xbc39('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x412cb6,_0x253b28){_0x253b28=_0x253b28||0xcc;return function(_0x50d01d){if(_0x50d01d){return _0x412cb6[_0xbc39('0x14')](_0x253b28);}return _0x412cb6[_0xbc39('0x15')](_0x253b28)[_0xbc39('0x16')]();};}function respondWithResult(_0xf51596,_0x11dfc6){_0x11dfc6=_0x11dfc6||0xc8;return function(_0x57e30c){if(_0x57e30c){return _0xf51596[_0xbc39('0x15')](_0x11dfc6)['json'](_0x57e30c);}};}function respondWithFilteredResult(_0x4fe978,_0x43e3fa){return function(_0x57cefd){if(_0x57cefd){var _0x4b66ed=typeof _0x43e3fa[_0xbc39('0x17')]==='undefined'&&typeof _0x43e3fa[_0xbc39('0x18')]===_0xbc39('0x19');var _0x4dccb1=_0x57cefd[_0xbc39('0x1a')];var _0x4e3fb4=_0x4b66ed?0x0:_0x43e3fa[_0xbc39('0x17')];var _0x27b893=_0x4b66ed?_0x57cefd[_0xbc39('0x1a')]:_0x43e3fa[_0xbc39('0x17')]+_0x43e3fa[_0xbc39('0x18')];var _0x2a6d63;if(_0x27b893>=_0x4dccb1){_0x27b893=_0x4dccb1;_0x2a6d63=0xc8;}else{_0x2a6d63=0xce;}_0x4fe978[_0xbc39('0x15')](_0x2a6d63);return _0x4fe978[_0xbc39('0x1b')](_0xbc39('0x1c'),_0x4e3fb4+'-'+_0x27b893+'/'+_0x4dccb1)['json'](_0x57cefd);}return null;};}function patchUpdates(_0x4bf0c3){return function(_0x1af460){try{jsonpatch[_0xbc39('0x1d')](_0x1af460,_0x4bf0c3,!![]);}catch(_0x27af66){return BPromise[_0xbc39('0x1e')](_0x27af66);}return _0x1af460[_0xbc39('0x1f')]();};}function saveUpdates(_0x3e7076,_0x340f4d){return function(_0x12b077){if(_0x12b077){return _0x12b077['update'](_0x3e7076)['then'](function(_0xc147a7){return _0xc147a7;});}return null;};}function removeEntity(_0x50b81f,_0x416095){return function(_0x312ab8){if(_0x312ab8){return _0x312ab8[_0xbc39('0x20')]()['then'](function(){var _0x237bc0=_0x312ab8[_0xbc39('0x21')]({'plain':!![]});var _0xb0802d=_0xbc39('0x22');return db[_0xbc39('0x23')][_0xbc39('0x20')]({'where':{'type':_0xb0802d,'resourceId':_0x237bc0['id']}})[_0xbc39('0x24')](function(){return _0x312ab8;});})[_0xbc39('0x24')](function(){_0x50b81f[_0xbc39('0x15')](0xcc)[_0xbc39('0x16')]();});}};}function handleEntityNotFound(_0x8e2ace,_0x153577){return function(_0x432a69){if(!_0x432a69){_0x8e2ace['sendStatus'](0x194);}return _0x432a69;};}function handleError(_0x23627f,_0x172545){_0x172545=_0x172545||0x1f4;return function(_0x4b12df){logger[_0xbc39('0x25')](_0x4b12df[_0xbc39('0x26')]);if(_0x4b12df[_0xbc39('0x27')]){delete _0x4b12df[_0xbc39('0x27')];}_0x23627f[_0xbc39('0x15')](_0x172545)[_0xbc39('0x28')](_0x4b12df);};}exports[_0xbc39('0x29')]=function(_0x47ec8e,_0xec66cc){var _0x2c890c={},_0x3e22a4={},_0x50c7c8={'count':0x0,'rows':[]};var _0x422343=_[_0xbc39('0x2a')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x2f738a){return{'name':_0x2f738a[_0xbc39('0x2b')],'type':_0x2f738a[_0xbc39('0x2c')][_0xbc39('0x2d')]};});_0x3e22a4[_0xbc39('0x2e')]=_[_0xbc39('0x2a')](_0x422343,'name');_0x3e22a4[_0xbc39('0x2f')]=_[_0xbc39('0x30')](_0x47ec8e['query']);_0x3e22a4['filters']=_[_0xbc39('0x31')](_0x3e22a4['model'],_0x3e22a4[_0xbc39('0x2f')]);_0x2c890c[_0xbc39('0x32')]=_['intersection'](_0x3e22a4['model'],qs[_0xbc39('0x33')](_0x47ec8e[_0xbc39('0x2f')][_0xbc39('0x33')]));_0x2c890c[_0xbc39('0x32')]=_0x2c890c['attributes'][_0xbc39('0x34')]?_0x2c890c['attributes']:_0x3e22a4[_0xbc39('0x2e')];if(!_0x47ec8e['query'][_0xbc39('0x35')](_0xbc39('0x36'))){_0x2c890c[_0xbc39('0x18')]=qs[_0xbc39('0x18')](_0x47ec8e['query'][_0xbc39('0x18')]);_0x2c890c['offset']=qs[_0xbc39('0x17')](_0x47ec8e[_0xbc39('0x2f')][_0xbc39('0x17')]);}_0x2c890c[_0xbc39('0x37')]=qs[_0xbc39('0x38')](_0x47ec8e['query'][_0xbc39('0x38')]);_0x2c890c[_0xbc39('0x39')]=qs['filters'](_[_0xbc39('0x3a')](_0x47ec8e[_0xbc39('0x2f')],_0x3e22a4[_0xbc39('0x3b')]),_0x422343);if(_0x47ec8e['query'][_0xbc39('0x3c')]){_0x2c890c[_0xbc39('0x39')]=_[_0xbc39('0x3d')](_0x2c890c[_0xbc39('0x39')],{'$or':_[_0xbc39('0x2a')](_0x422343,function(_0x2eea11){if(_0x2eea11[_0xbc39('0x2c')]!==_0xbc39('0x3e')){var _0x1a356a={};_0x1a356a[_0x2eea11[_0xbc39('0x27')]]={'$like':'%'+_0x47ec8e[_0xbc39('0x2f')][_0xbc39('0x3c')]+'%'};return _0x1a356a;}})});}_0x2c890c=_[_0xbc39('0x3d')]({},_0x2c890c,_0x47ec8e[_0xbc39('0x3f')]);var _0x458d35={'where':_0x2c890c[_0xbc39('0x39')]};return db['AnalyticExtractedReport']['count'](_0x458d35)[_0xbc39('0x24')](function(_0x3c8d21){_0x50c7c8[_0xbc39('0x1a')]=_0x3c8d21;if(_0x47ec8e[_0xbc39('0x2f')][_0xbc39('0x40')]){_0x2c890c[_0xbc39('0x41')]=[{'all':!![]}];}return db[_0xbc39('0x42')][_0xbc39('0x43')](_0x2c890c);})[_0xbc39('0x24')](function(_0xbb578b){_0x50c7c8['rows']=_0xbb578b;return _0x50c7c8;})[_0xbc39('0x24')](respondWithFilteredResult(_0xec66cc,_0x2c890c))['catch'](handleError(_0xec66cc,null));};exports[_0xbc39('0x44')]=function(_0x282cf9,_0x3b6195){var _0xde8852={'raw':!![],'where':{'id':_0x282cf9[_0xbc39('0x45')]['id']}},_0x5e6fc9={};_0x5e6fc9[_0xbc39('0x2e')]=_[_0xbc39('0x30')](db[_0xbc39('0x42')]['rawAttributes']);_0x5e6fc9['query']=_['keys'](_0x282cf9[_0xbc39('0x2f')]);_0x5e6fc9[_0xbc39('0x3b')]=_[_0xbc39('0x31')](_0x5e6fc9[_0xbc39('0x2e')],_0x5e6fc9['query']);_0xde8852[_0xbc39('0x32')]=_['intersection'](_0x5e6fc9['model'],qs['fields'](_0x282cf9[_0xbc39('0x2f')][_0xbc39('0x33')]));_0xde8852[_0xbc39('0x32')]=_0xde8852[_0xbc39('0x32')][_0xbc39('0x34')]?_0xde8852[_0xbc39('0x32')]:_0x5e6fc9[_0xbc39('0x2e')];if(_0x282cf9['query'][_0xbc39('0x40')]){_0xde8852[_0xbc39('0x41')]=[{'all':!![]}];}_0xde8852=_[_0xbc39('0x3d')]({},_0xde8852,_0x282cf9[_0xbc39('0x3f')]);return db['AnalyticExtractedReport'][_0xbc39('0x46')](_0xde8852)[_0xbc39('0x24')](handleEntityNotFound(_0x3b6195,null))['then'](respondWithResult(_0x3b6195,null))['catch'](handleError(_0x3b6195,null));};exports['create']=function(_0x136ccf,_0x366ecf){return db[_0xbc39('0x42')][_0xbc39('0x47')](_0x136ccf['body'],{})[_0xbc39('0x24')](function(_0x2c5378){var _0x580a76=_0x136ccf[_0xbc39('0x48')]['get']({'plain':!![]});if(!_0x580a76)throw new Error(_0xbc39('0x49'));if(_0x580a76[_0xbc39('0x4a')]==='user'){var _0x178125=_0x2c5378[_0xbc39('0x21')]({'plain':!![]});var _0x20c92c=_0xbc39('0x22');return db[_0xbc39('0x4b')][_0xbc39('0x46')]({'where':{'name':_0x20c92c,'userProfileId':_0x580a76[_0xbc39('0x4c')]},'raw':!![]})['then'](function(_0x560de7){if(_0x560de7&&_0x560de7['autoAssociation']===0x0){return db[_0xbc39('0x23')][_0xbc39('0x47')]({'name':_0x178125['name'],'resourceId':_0x178125['id'],'type':_0x560de7[_0xbc39('0x27')],'sectionId':_0x560de7['id']},{})[_0xbc39('0x24')](function(){return _0x2c5378;});}else{return _0x2c5378;}})[_0xbc39('0x4d')](function(_0xc8ee94){logger[_0xbc39('0x25')](_0xbc39('0x4e'),_0xc8ee94);throw _0xc8ee94;});}return _0x2c5378;})[_0xbc39('0x24')](respondWithResult(_0x366ecf,0xc9))['catch'](handleError(_0x366ecf,null));};exports[_0xbc39('0x4f')]=function(_0xbec85b,_0x5389e3){if(_0xbec85b[_0xbc39('0x50')]['id']){delete _0xbec85b[_0xbc39('0x50')]['id'];}return db[_0xbc39('0x42')][_0xbc39('0x46')]({'where':{'id':_0xbec85b[_0xbc39('0x45')]['id']}})[_0xbc39('0x24')](handleEntityNotFound(_0x5389e3,null))[_0xbc39('0x24')](saveUpdates(_0xbec85b[_0xbc39('0x50')],null))[_0xbc39('0x24')](respondWithResult(_0x5389e3,null))[_0xbc39('0x4d')](handleError(_0x5389e3,null));};exports[_0xbc39('0x20')]=function(_0x3ceed6,_0x17b320){return db[_0xbc39('0x42')][_0xbc39('0x46')]({'where':{'id':_0x3ceed6[_0xbc39('0x45')]['id']}})['then'](handleEntityNotFound(_0x17b320,null))['then'](removeEntity(_0x17b320,null))[_0xbc39('0x4d')](handleError(_0x17b320,null));};exports[_0xbc39('0x51')]=function(_0x5d9e36,_0x4ea8cf,_0x22a3af){return db[_0xbc39('0x42')]['find']({'where':{'id':_0x5d9e36[_0xbc39('0x45')]['id']},'attributes':[_0xbc39('0x27'),_0xbc39('0x52'),_0xbc39('0x53'),_0xbc39('0x54')],'raw':!![]})[_0xbc39('0x24')](handleEntityNotFound(_0x4ea8cf,null))[_0xbc39('0x24')](function(_0x5706ef){if(_0x5706ef){if(!fs['existsSync'](path['join'](config[_0xbc39('0x55')],_0xbc39('0x56'),_0x5706ef['savename']))){throw new db['Sequelize'][(_0xbc39('0x57'))](_0xbc39('0x58'));}if(_0x5d9e36[_0xbc39('0x2f')][_0xbc39('0x59')]){return _0x4ea8cf[_0xbc39('0x14')](0xc8);}return _0x4ea8cf[_0xbc39('0x51')](path[_0xbc39('0x5a')](config[_0xbc39('0x55')],_0xbc39('0x56'),_0x5706ef[_0xbc39('0x53')]),util['format']('%s.%s',_0x5706ef[_0xbc39('0x52')]||_0x5706ef[_0xbc39('0x27')],_0x5706ef[_0xbc39('0x54')][_0xbc39('0x5b')]()));}})[_0xbc39('0x4d')](handleError(_0x4ea8cf,null));}; \ No newline at end of file +var _0x625f=['index','map','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','save','then','destroy','get','ExtractedReports','sendStatus','error','stack','name'];(function(_0x2e8775,_0x310049){var _0x4cbf35=function(_0x103483){while(--_0x103483){_0x2e8775['push'](_0x2e8775['shift']());}};_0x4cbf35(++_0x310049);}(_0x625f,0x14c));var _0xf625=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0x625f[_0x397f37];return _0x31cae6;};'use strict';var emlformat=require(_0xf625('0x0'));var rimraf=require(_0xf625('0x1'));var zipdir=require(_0xf625('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf625('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf625('0x4'));var path=require(_0xf625('0x5'));var sox=require(_0xf625('0x6'));var csv=require(_0xf625('0x7'));var ejs=require(_0xf625('0x8'));var fs=require('fs');var fs_extra=require(_0xf625('0x9'));var _=require(_0xf625('0xa'));var squel=require(_0xf625('0xb'));var crypto=require(_0xf625('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf625('0xd'));var toCsv=require(_0xf625('0x7'));var querystring=require(_0xf625('0xe'));var Papa=require('papaparse');var Redis=require(_0xf625('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf625('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf625('0x11'))(_0xf625('0x12'));var utils=require('../../config/utils');var config=require(_0xf625('0x13'));var licenseUtil=require(_0xf625('0x14'));var db=require(_0xf625('0x15'))['db'];function respondWithStatusCode(_0x401677,_0x3f4366){_0x3f4366=_0x3f4366||0xcc;return function(_0x61e809){if(_0x61e809){return _0x401677['sendStatus'](_0x3f4366);}return _0x401677['status'](_0x3f4366)[_0xf625('0x16')]();};}function respondWithResult(_0x1a5251,_0x1d5e18){_0x1d5e18=_0x1d5e18||0xc8;return function(_0x303a6d){if(_0x303a6d){return _0x1a5251[_0xf625('0x17')](_0x1d5e18)[_0xf625('0x18')](_0x303a6d);}};}function respondWithFilteredResult(_0x4a1c5d,_0x142699){return function(_0x4e5da4){if(_0x4e5da4){var _0x34b858=typeof _0x142699['offset']===_0xf625('0x19')&&typeof _0x142699[_0xf625('0x1a')]==='undefined';var _0xc68c50=_0x4e5da4[_0xf625('0x1b')];var _0x2b4c66=_0x34b858?0x0:_0x142699[_0xf625('0x1c')];var _0x3f3048=_0x34b858?_0x4e5da4[_0xf625('0x1b')]:_0x142699['offset']+_0x142699[_0xf625('0x1a')];var _0x5d5956;if(_0x3f3048>=_0xc68c50){_0x3f3048=_0xc68c50;_0x5d5956=0xc8;}else{_0x5d5956=0xce;}_0x4a1c5d[_0xf625('0x17')](_0x5d5956);return _0x4a1c5d[_0xf625('0x1d')](_0xf625('0x1e'),_0x2b4c66+'-'+_0x3f3048+'/'+_0xc68c50)[_0xf625('0x18')](_0x4e5da4);}return null;};}function patchUpdates(_0x488d19){return function(_0xff0c4e){try{jsonpatch['apply'](_0xff0c4e,_0x488d19,!![]);}catch(_0x21f1bb){return BPromise['reject'](_0x21f1bb);}return _0xff0c4e[_0xf625('0x1f')]();};}function saveUpdates(_0x4c29d0,_0x2327ba){return function(_0x184a95){if(_0x184a95){return _0x184a95['update'](_0x4c29d0)[_0xf625('0x20')](function(_0x19f02f){return _0x19f02f;});}return null;};}function removeEntity(_0x8e20e2,_0x404fa4){return function(_0x26ec66){if(_0x26ec66){return _0x26ec66[_0xf625('0x21')]()[_0xf625('0x20')](function(){var _0x315b77=_0x26ec66[_0xf625('0x22')]({'plain':!![]});var _0x399989=_0xf625('0x23');return db['UserProfileResource'][_0xf625('0x21')]({'where':{'type':_0x399989,'resourceId':_0x315b77['id']}})['then'](function(){return _0x26ec66;});})[_0xf625('0x20')](function(){_0x8e20e2[_0xf625('0x17')](0xcc)[_0xf625('0x16')]();});}};}function handleEntityNotFound(_0x448e51,_0x3da47c){return function(_0x103afd){if(!_0x103afd){_0x448e51[_0xf625('0x24')](0x194);}return _0x103afd;};}function handleError(_0xad9763,_0x16ed2e){_0x16ed2e=_0x16ed2e||0x1f4;return function(_0x28b009){logger[_0xf625('0x25')](_0x28b009[_0xf625('0x26')]);if(_0x28b009['name']){delete _0x28b009[_0xf625('0x27')];}_0xad9763[_0xf625('0x17')](_0x16ed2e)['send'](_0x28b009);};}exports[_0xf625('0x28')]=function(_0x432998,_0x276b05){var _0x412391={},_0x323d23={},_0x253d55={'count':0x0,'rows':[]};var _0x456cde=_[_0xf625('0x29')](db['AnalyticExtractedReport'][_0xf625('0x2a')],function(_0xad87d8){return{'name':_0xad87d8['fieldName'],'type':_0xad87d8[_0xf625('0x2b')][_0xf625('0x2c')]};});_0x323d23['model']=_['map'](_0x456cde,'name');_0x323d23[_0xf625('0x2d')]=_['keys'](_0x432998['query']);_0x323d23[_0xf625('0x2e')]=_[_0xf625('0x2f')](_0x323d23[_0xf625('0x30')],_0x323d23[_0xf625('0x2d')]);_0x412391['attributes']=_['intersection'](_0x323d23[_0xf625('0x30')],qs[_0xf625('0x31')](_0x432998[_0xf625('0x2d')][_0xf625('0x31')]));_0x412391[_0xf625('0x32')]=_0x412391[_0xf625('0x32')][_0xf625('0x33')]?_0x412391['attributes']:_0x323d23[_0xf625('0x30')];if(!_0x432998[_0xf625('0x2d')][_0xf625('0x34')]('nolimit')){_0x412391['limit']=qs[_0xf625('0x1a')](_0x432998[_0xf625('0x2d')][_0xf625('0x1a')]);_0x412391[_0xf625('0x1c')]=qs[_0xf625('0x1c')](_0x432998[_0xf625('0x2d')][_0xf625('0x1c')]);}_0x412391[_0xf625('0x35')]=qs[_0xf625('0x36')](_0x432998['query'][_0xf625('0x36')]);_0x412391[_0xf625('0x37')]=qs[_0xf625('0x2e')](_[_0xf625('0x38')](_0x432998['query'],_0x323d23[_0xf625('0x2e')]),_0x456cde);if(_0x432998[_0xf625('0x2d')][_0xf625('0x39')]){_0x412391['where']=_[_0xf625('0x3a')](_0x412391[_0xf625('0x37')],{'$or':_['map'](_0x456cde,function(_0x2a574b){if(_0x2a574b['type']!=='VIRTUAL'){var _0x2059ec={};_0x2059ec[_0x2a574b['name']]={'$like':'%'+_0x432998[_0xf625('0x2d')][_0xf625('0x39')]+'%'};return _0x2059ec;}})});}_0x412391=_['merge']({},_0x412391,_0x432998['options']);var _0x3137a8={'where':_0x412391[_0xf625('0x37')]};return db[_0xf625('0x3b')][_0xf625('0x1b')](_0x3137a8)[_0xf625('0x20')](function(_0x255890){_0x253d55[_0xf625('0x1b')]=_0x255890;if(_0x432998[_0xf625('0x2d')][_0xf625('0x3c')]){_0x412391[_0xf625('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xf625('0x3e')](_0x412391);})[_0xf625('0x20')](function(_0x47e514){_0x253d55[_0xf625('0x3f')]=_0x47e514;return _0x253d55;})['then'](respondWithFilteredResult(_0x276b05,_0x412391))[_0xf625('0x40')](handleError(_0x276b05,null));};exports[_0xf625('0x41')]=function(_0x1b3aa1,_0x562050){var _0x3ad334={'raw':!![],'where':{'id':_0x1b3aa1[_0xf625('0x42')]['id']}},_0x424707={};_0x424707['model']=_['keys'](db[_0xf625('0x3b')]['rawAttributes']);_0x424707[_0xf625('0x2d')]=_[_0xf625('0x43')](_0x1b3aa1[_0xf625('0x2d')]);_0x424707['filters']=_[_0xf625('0x2f')](_0x424707[_0xf625('0x30')],_0x424707[_0xf625('0x2d')]);_0x3ad334['attributes']=_['intersection'](_0x424707[_0xf625('0x30')],qs[_0xf625('0x31')](_0x1b3aa1[_0xf625('0x2d')][_0xf625('0x31')]));_0x3ad334[_0xf625('0x32')]=_0x3ad334[_0xf625('0x32')][_0xf625('0x33')]?_0x3ad334[_0xf625('0x32')]:_0x424707[_0xf625('0x30')];if(_0x1b3aa1[_0xf625('0x2d')][_0xf625('0x3c')]){_0x3ad334['include']=[{'all':!![]}];}_0x3ad334=_['merge']({},_0x3ad334,_0x1b3aa1['options']);return db[_0xf625('0x3b')]['find'](_0x3ad334)[_0xf625('0x20')](handleEntityNotFound(_0x562050,null))[_0xf625('0x20')](respondWithResult(_0x562050,null))[_0xf625('0x40')](handleError(_0x562050,null));};exports[_0xf625('0x44')]=function(_0x5e0534,_0x5cc4e5){return db[_0xf625('0x3b')][_0xf625('0x44')](_0x5e0534['body'],{})[_0xf625('0x20')](function(_0x49d187){var _0x525511=_0x5e0534[_0xf625('0x45')]['get']({'plain':!![]});if(!_0x525511)throw new Error(_0xf625('0x46'));if(_0x525511[_0xf625('0x47')]===_0xf625('0x45')){var _0x1b4fce=_0x49d187[_0xf625('0x22')]({'plain':!![]});var _0x1dfbd4=_0xf625('0x23');return db[_0xf625('0x48')]['find']({'where':{'name':_0x1dfbd4,'userProfileId':_0x525511[_0xf625('0x49')]},'raw':!![]})[_0xf625('0x20')](function(_0x5ab18f){if(_0x5ab18f&&_0x5ab18f[_0xf625('0x4a')]===0x0){return db[_0xf625('0x4b')][_0xf625('0x44')]({'name':_0x1b4fce[_0xf625('0x27')],'resourceId':_0x1b4fce['id'],'type':_0x5ab18f[_0xf625('0x27')],'sectionId':_0x5ab18f['id']},{})[_0xf625('0x20')](function(){return _0x49d187;});}else{return _0x49d187;}})[_0xf625('0x40')](function(_0x4c745e){logger[_0xf625('0x25')](_0xf625('0x4c'),_0x4c745e);throw _0x4c745e;});}return _0x49d187;})[_0xf625('0x20')](respondWithResult(_0x5cc4e5,0xc9))[_0xf625('0x40')](handleError(_0x5cc4e5,null));};exports['update']=function(_0x5b6c57,_0xcb5e68){if(_0x5b6c57[_0xf625('0x4d')]['id']){delete _0x5b6c57['body']['id'];}return db['AnalyticExtractedReport'][_0xf625('0x4e')]({'where':{'id':_0x5b6c57['params']['id']}})['then'](handleEntityNotFound(_0xcb5e68,null))['then'](saveUpdates(_0x5b6c57[_0xf625('0x4d')],null))[_0xf625('0x20')](respondWithResult(_0xcb5e68,null))['catch'](handleError(_0xcb5e68,null));};exports[_0xf625('0x21')]=function(_0x5aecf1,_0x4f3b87){return db['AnalyticExtractedReport'][_0xf625('0x4e')]({'where':{'id':_0x5aecf1[_0xf625('0x42')]['id']}})[_0xf625('0x20')](handleEntityNotFound(_0x4f3b87,null))[_0xf625('0x20')](removeEntity(_0x4f3b87,null))[_0xf625('0x40')](handleError(_0x4f3b87,null));};exports[_0xf625('0x4f')]=function(_0x4ddaac,_0x3677d3,_0x3a6f12){return db[_0xf625('0x3b')][_0xf625('0x4e')]({'where':{'id':_0x4ddaac[_0xf625('0x42')]['id']},'attributes':[_0xf625('0x27'),_0xf625('0x50'),'savename',_0xf625('0x51')],'raw':!![]})[_0xf625('0x20')](handleEntityNotFound(_0x3677d3,null))[_0xf625('0x20')](function(_0x512828){if(_0x512828){if(!fs[_0xf625('0x52')](path[_0xf625('0x53')](config[_0xf625('0x54')],_0xf625('0x55'),_0x512828[_0xf625('0x56')]))){throw new db[(_0xf625('0x57'))][(_0xf625('0x58'))](_0xf625('0x59'));}if(_0x4ddaac[_0xf625('0x2d')][_0xf625('0x5a')]){return _0x3677d3[_0xf625('0x24')](0xc8);}return _0x3677d3['download'](path[_0xf625('0x53')](config[_0xf625('0x54')],_0xf625('0x55'),_0x512828[_0xf625('0x56')]),util[_0xf625('0x5b')](_0xf625('0x5c'),_0x512828[_0xf625('0x50')]||_0x512828[_0xf625('0x27')],_0x512828[_0xf625('0x51')]['toLowerCase']()));}})['catch'](handleError(_0x3677d3,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index d88bc2d..ebc88e9 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 _0xf36c=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0xf36c,0xe8));var _0xcf36=function(_0x4f5e0a,_0x4a4263){_0x4f5e0a=_0x4f5e0a-0x0;var _0x48ff22=_0xf36c[_0x4f5e0a];return _0x48ff22;};'use strict';var _=require(_0xcf36('0x0'));var util=require(_0xcf36('0x1'));var logger=require(_0xcf36('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf36('0x3'));var fs=require('fs');var path=require(_0xcf36('0x4'));var rimraf=require(_0xcf36('0x5'));var config=require('../../config/environment');var attributes=require(_0xcf36('0x6'));module[_0xcf36('0x7')]=function(_0x366cfe,_0x46f79c){return _0x366cfe['define'](_0xcf36('0x8'),attributes,{'tableName':_0xcf36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9be3=['./analyticExtractedReport.attributes','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x182fb8,_0x5770b0){var _0x27ed12=function(_0x511fea){while(--_0x511fea){_0x182fb8['push'](_0x182fb8['shift']());}};_0x27ed12(++_0x5770b0);}(_0x9be3,0x12e));var _0x39be=function(_0x96ca91,_0x3acaa3){_0x96ca91=_0x96ca91-0x0;var _0x10cc7a=_0x9be3[_0x96ca91];return _0x10cc7a;};'use strict';var _=require(_0x39be('0x0'));var util=require(_0x39be('0x1'));var logger=require(_0x39be('0x2'))('api');var moment=require(_0x39be('0x3'));var BPromise=require(_0x39be('0x4'));var rp=require(_0x39be('0x5'));var fs=require('fs');var path=require(_0x39be('0x6'));var rimraf=require('rimraf');var config=require(_0x39be('0x7'));var attributes=require(_0x39be('0x8'));module['exports']=function(_0x52ed43,_0x4a1823){return _0x52ed43[_0x39be('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','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 4eec7f2..10d1ee6 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 _0xc8ed=['stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xc8ed,0x1a4));var _0xdc8e=function(_0x5f3a11,_0x5e443d){_0x5f3a11=_0x5f3a11-0x0;var _0x5cdf18=_0xc8ed[_0x5f3a11];return _0x5cdf18;};'use strict';var _=require(_0xdc8e('0x0'));var util=require(_0xdc8e('0x1'));var moment=require(_0xdc8e('0x2'));var BPromise=require(_0xdc8e('0x3'));var rs=require(_0xdc8e('0x4'));var fs=require('fs');var Redis=require(_0xdc8e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc8e('0x6'));var logger=require(_0xdc8e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdc8e('0x8'));var client=jayson[_0xdc8e('0x9')][_0xdc8e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387dff,_0xcd991,_0x41292a){return new BPromise(function(_0x1b9642,_0x108cc4){return client[_0xdc8e('0xb')](_0x387dff,_0x41292a)[_0xdc8e('0xc')](function(_0x2268cf){logger[_0xdc8e('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcd991,_0xdc8e('0xe'));logger[_0xdc8e('0xf')](_0xdc8e('0x10'),_0xcd991,_0xdc8e('0xe'),JSON[_0xdc8e('0x11')](_0x2268cf));if(_0x2268cf[_0xdc8e('0x12')]){if(_0x2268cf[_0xdc8e('0x12')]['code']===0x1f4){logger[_0xdc8e('0x12')](_0xdc8e('0x13'),_0xcd991,_0x2268cf['error']['message']);return _0x108cc4(_0x2268cf[_0xdc8e('0x12')][_0xdc8e('0x14')]);}logger[_0xdc8e('0x12')](_0xdc8e('0x13'),_0xcd991,_0x2268cf['error'][_0xdc8e('0x14')]);return _0x1b9642(_0x2268cf[_0xdc8e('0x12')]['message']);}else{logger[_0xdc8e('0xd')](_0xdc8e('0x13'),_0xcd991,'request\x20sent');_0x1b9642(_0x2268cf[_0xdc8e('0x15')][_0xdc8e('0x14')]);}})[_0xdc8e('0x16')](function(_0x1c136b){logger['error'](_0xdc8e('0x13'),_0xcd991,_0x1c136b);_0x108cc4(_0x1c136b);});});} \ No newline at end of file +var _0xebec=['error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3f7aaf,_0x18fb20){var _0x19aad9=function(_0x19e058){while(--_0x19e058){_0x3f7aaf['push'](_0x3f7aaf['shift']());}};_0x19aad9(++_0x18fb20);}(_0xebec,0xc2));var _0xcebe=function(_0x11df98,_0x55313e){_0x11df98=_0x11df98-0x0;var _0x3d313a=_0xebec[_0x11df98];return _0x3d313a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcebe('0x0'));var BPromise=require('bluebird');var rs=require(_0xcebe('0x1'));var fs=require('fs');var Redis=require(_0xcebe('0x2'));var db=require(_0xcebe('0x3'))['db'];var utils=require(_0xcebe('0x4'));var logger=require('../../config/logger')(_0xcebe('0x5'));var config=require('../../config/environment');var jayson=require(_0xcebe('0x6'));var client=jayson[_0xcebe('0x7')][_0xcebe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a8ef2,_0x48df69,_0xacead){return new BPromise(function(_0x456eb4,_0x526430){return client[_0xcebe('0x9')](_0x1a8ef2,_0xacead)[_0xcebe('0xa')](function(_0x412967){logger[_0xcebe('0xb')](_0xcebe('0xc'),_0x48df69,_0xcebe('0xd'));logger['debug'](_0xcebe('0xe'),_0x48df69,_0xcebe('0xd'),JSON[_0xcebe('0xf')](_0x412967));if(_0x412967[_0xcebe('0x10')]){if(_0x412967['error'][_0xcebe('0x11')]===0x1f4){logger[_0xcebe('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x48df69,_0x412967[_0xcebe('0x10')][_0xcebe('0x12')]);return _0x526430(_0x412967[_0xcebe('0x10')][_0xcebe('0x12')]);}logger[_0xcebe('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x48df69,_0x412967[_0xcebe('0x10')][_0xcebe('0x12')]);return _0x456eb4(_0x412967[_0xcebe('0x10')][_0xcebe('0x12')]);}else{logger['info'](_0xcebe('0xc'),_0x48df69,_0xcebe('0xd'));_0x456eb4(_0x412967[_0xcebe('0x13')][_0xcebe('0x12')]);}})[_0xcebe('0x14')](function(_0xe55051){logger[_0xcebe('0x10')](_0xcebe('0xc'),_0x48df69,_0xe55051);_0x526430(_0xe55051);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 0ac47ca..0ec7d3f 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 _0x7a09=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','download','post','update','exports'];(function(_0x36b5be,_0x25cbb9){var _0x186b09=function(_0x559d03){while(--_0x559d03){_0x36b5be['push'](_0x36b5be['shift']());}};_0x186b09(++_0x25cbb9);}(_0x7a09,0x1d0));var _0x97a0=function(_0x10b434,_0x521745){_0x10b434=_0x10b434-0x0;var _0x31050b=_0x7a09[_0x10b434];return _0x31050b;};'use strict';var multer=require(_0x97a0('0x0'));var util=require(_0x97a0('0x1'));var path=require('path');var timeout=require(_0x97a0('0x2'));var express=require('express');var router=express[_0x97a0('0x3')]();var fs_extra=require(_0x97a0('0x4'));var auth=require(_0x97a0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x97a0('0x6'));var controller=require(_0x97a0('0x7'));router[_0x97a0('0x8')]('/',auth[_0x97a0('0x9')](),controller['index']);router['get'](_0x97a0('0xa'),auth[_0x97a0('0x9')](),controller['show']);router[_0x97a0('0x8')](_0x97a0('0xb'),auth['isAuthenticated'](),controller[_0x97a0('0xc')]);router[_0x97a0('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x97a0('0xa'),auth[_0x97a0('0x9')](),controller[_0x97a0('0xe')]);router['delete'](_0x97a0('0xa'),auth[_0x97a0('0x9')](),controller['destroy']);module[_0x97a0('0xf')]=router; \ No newline at end of file +var _0xe1b2=['isAuthenticated','show','/:id/download','download','post','create','put','/:id','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0xe1b2,0x1a7));var _0x2e1b=function(_0x1f8cf2,_0x160806){_0x1f8cf2=_0x1f8cf2-0x0;var _0x1ac346=_0xe1b2[_0x1f8cf2];return _0x1ac346;};'use strict';var multer=require(_0x2e1b('0x0'));var util=require(_0x2e1b('0x1'));var path=require('path');var timeout=require(_0x2e1b('0x2'));var express=require(_0x2e1b('0x3'));var router=express['Router']();var fs_extra=require(_0x2e1b('0x4'));var auth=require(_0x2e1b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2e1b('0x6'));var controller=require(_0x2e1b('0x7'));router[_0x2e1b('0x8')]('/',auth[_0x2e1b('0x9')](),controller['index']);router[_0x2e1b('0x8')]('/:id',auth[_0x2e1b('0x9')](),controller[_0x2e1b('0xa')]);router['get'](_0x2e1b('0xb'),auth['isAuthenticated'](),controller[_0x2e1b('0xc')]);router[_0x2e1b('0xd')]('/',auth[_0x2e1b('0x9')](),controller[_0x2e1b('0xe')]);router[_0x2e1b('0xf')](_0x2e1b('0x10'),auth[_0x2e1b('0x9')](),controller['update']);router[_0x2e1b('0x11')](_0x2e1b('0x10'),auth[_0x2e1b('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 5234119..b63d170 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 _0xf871=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xf871,0x176));var _0x1f87=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0xf871[_0x1e4a8e];return _0x5408f9;};'use strict';var Sequelize=require(_0x1f87('0x0'));module['exports']={'field':{'type':Sequelize[_0x1f87('0x1')]},'alias':{'type':Sequelize[_0x1f87('0x2')]},'function':{'type':Sequelize[_0x1f87('0x2')]},'format':{'type':Sequelize[_0x1f87('0x2')]},'groupBy':{'type':Sequelize[_0x1f87('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1f87('0x2')]},'custom':{'type':Sequelize[_0x1f87('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x974e=['STRING','BOOLEAN','exports','TEXT'];(function(_0x508805,_0x10c69b){var _0x3ba544=function(_0x2d7a12){while(--_0x2d7a12){_0x508805['push'](_0x508805['shift']());}};_0x3ba544(++_0x10c69b);}(_0x974e,0x166));var _0xe974=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x974e[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0xe974('0x0')]={'field':{'type':Sequelize[_0xe974('0x1')]},'alias':{'type':Sequelize[_0xe974('0x2')]},'function':{'type':Sequelize[_0xe974('0x2')]},'format':{'type':Sequelize[_0xe974('0x2')]},'groupBy':{'type':Sequelize[_0xe974('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe974('0x2')]},'custom':{'type':Sequelize[_0xe974('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 46ffdbd..63b913e 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 _0xb239=['keys','filters','query','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','rawAttributes','length','find','create','body','catch','bulkDestroy','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','destroy','then','stack','name','index','AnalyticFieldReport','fieldName','type','key','model','map'];(function(_0x33e40b,_0x131994){var _0x2a4a39=function(_0xdf8a1d){while(--_0xdf8a1d){_0x33e40b['push'](_0x33e40b['shift']());}};_0x2a4a39(++_0x131994);}(_0xb239,0x16a));var _0x9b23=function(_0x561391,_0x567f8d){_0x561391=_0x561391-0x0;var _0x5da03c=_0xb239[_0x561391];return _0x5da03c;};'use strict';var emlformat=require(_0x9b23('0x0'));var rimraf=require(_0x9b23('0x1'));var zipdir=require(_0x9b23('0x2'));var jsonpatch=require(_0x9b23('0x3'));var rp=require(_0x9b23('0x4'));var moment=require(_0x9b23('0x5'));var BPromise=require(_0x9b23('0x6'));var Mustache=require(_0x9b23('0x7'));var util=require(_0x9b23('0x8'));var path=require(_0x9b23('0x9'));var sox=require(_0x9b23('0xa'));var csv=require(_0x9b23('0xb'));var ejs=require(_0x9b23('0xc'));var fs=require('fs');var fs_extra=require(_0x9b23('0xd'));var _=require(_0x9b23('0xe'));var squel=require(_0x9b23('0xf'));var crypto=require('crypto');var jsforce=require(_0x9b23('0x10'));var deskjs=require(_0x9b23('0x11'));var toCsv=require(_0x9b23('0xb'));var querystring=require(_0x9b23('0x12'));var Papa=require(_0x9b23('0x13'));var Redis=require(_0x9b23('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b23('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x9b23('0x16'));var config=require(_0x9b23('0x17'));var licenseUtil=require(_0x9b23('0x18'));var db=require(_0x9b23('0x19'))['db'];function respondWithStatusCode(_0x983b15,_0x10cc39){_0x10cc39=_0x10cc39||0xcc;return function(_0xc3d256){if(_0xc3d256){return _0x983b15[_0x9b23('0x1a')](_0x10cc39);}return _0x983b15[_0x9b23('0x1b')](_0x10cc39)[_0x9b23('0x1c')]();};}function respondWithResult(_0x186fb2,_0x28a92f){_0x28a92f=_0x28a92f||0xc8;return function(_0x4f96ac){if(_0x4f96ac){return _0x186fb2[_0x9b23('0x1b')](_0x28a92f)[_0x9b23('0x1d')](_0x4f96ac);}};}function respondWithFilteredResult(_0x4122f3,_0x3668ff){return function(_0x70f3a4){if(_0x70f3a4){var _0x126abd=typeof _0x3668ff[_0x9b23('0x1e')]===_0x9b23('0x1f')&&typeof _0x3668ff[_0x9b23('0x20')]===_0x9b23('0x1f');var _0x32c6e4=_0x70f3a4['count'];var _0x1c9a7a=_0x126abd?0x0:_0x3668ff[_0x9b23('0x1e')];var _0x584f88=_0x126abd?_0x70f3a4['count']:_0x3668ff[_0x9b23('0x1e')]+_0x3668ff['limit'];var _0x1296bc;if(_0x584f88>=_0x32c6e4){_0x584f88=_0x32c6e4;_0x1296bc=0xc8;}else{_0x1296bc=0xce;}_0x4122f3[_0x9b23('0x1b')](_0x1296bc);return _0x4122f3[_0x9b23('0x21')](_0x9b23('0x22'),_0x1c9a7a+'-'+_0x584f88+'/'+_0x32c6e4)['json'](_0x70f3a4);}return null;};}function patchUpdates(_0x5d964f){return function(_0x2ac612){try{jsonpatch[_0x9b23('0x23')](_0x2ac612,_0x5d964f,!![]);}catch(_0x584f9b){return BPromise['reject'](_0x584f9b);}return _0x2ac612['save']();};}function saveUpdates(_0x32abb2,_0xe12b69){return function(_0x334902){if(_0x334902){return _0x334902[_0x9b23('0x24')](_0x32abb2)['then'](function(_0xb67afd){return _0xb67afd;});}return null;};}function removeEntity(_0x4b1131,_0x233b1b){return function(_0x497913){if(_0x497913){return _0x497913[_0x9b23('0x25')]()[_0x9b23('0x26')](function(){_0x4b1131[_0x9b23('0x1b')](0xcc)[_0x9b23('0x1c')]();});}};}function handleEntityNotFound(_0x4d514a,_0x3747de){return function(_0x4e08bd){if(!_0x4e08bd){_0x4d514a[_0x9b23('0x1a')](0x194);}return _0x4e08bd;};}function handleError(_0x1ca264,_0x59859b){_0x59859b=_0x59859b||0x1f4;return function(_0x445576){logger['error'](_0x445576[_0x9b23('0x27')]);if(_0x445576[_0x9b23('0x28')]){delete _0x445576[_0x9b23('0x28')];}_0x1ca264[_0x9b23('0x1b')](_0x59859b)['send'](_0x445576);};}exports[_0x9b23('0x29')]=function(_0x3fa455,_0x121aec){var _0x271f0a={},_0x4e0a53={},_0x1a1595={'count':0x0,'rows':[]};var _0x2eada6=_['map'](db[_0x9b23('0x2a')]['rawAttributes'],function(_0xf1558f){return{'name':_0xf1558f[_0x9b23('0x2b')],'type':_0xf1558f[_0x9b23('0x2c')][_0x9b23('0x2d')]};});_0x4e0a53[_0x9b23('0x2e')]=_[_0x9b23('0x2f')](_0x2eada6,_0x9b23('0x28'));_0x4e0a53['query']=_[_0x9b23('0x30')](_0x3fa455['query']);_0x4e0a53[_0x9b23('0x31')]=_['intersection'](_0x4e0a53[_0x9b23('0x2e')],_0x4e0a53[_0x9b23('0x32')]);_0x271f0a[_0x9b23('0x33')]=_[_0x9b23('0x34')](_0x4e0a53[_0x9b23('0x2e')],qs['fields'](_0x3fa455[_0x9b23('0x32')][_0x9b23('0x35')]));_0x271f0a['attributes']=_0x271f0a[_0x9b23('0x33')]['length']?_0x271f0a[_0x9b23('0x33')]:_0x4e0a53['model'];if(!_0x3fa455[_0x9b23('0x32')]['hasOwnProperty'](_0x9b23('0x36'))){_0x271f0a['limit']=qs[_0x9b23('0x20')](_0x3fa455[_0x9b23('0x32')][_0x9b23('0x20')]);_0x271f0a['offset']=qs[_0x9b23('0x1e')](_0x3fa455[_0x9b23('0x32')][_0x9b23('0x1e')]);}_0x271f0a[_0x9b23('0x37')]=qs[_0x9b23('0x38')](_0x3fa455[_0x9b23('0x32')]['sort']);_0x271f0a[_0x9b23('0x39')]=qs[_0x9b23('0x31')](_[_0x9b23('0x3a')](_0x3fa455['query'],_0x4e0a53[_0x9b23('0x31')]),_0x2eada6);if(_0x3fa455[_0x9b23('0x32')][_0x9b23('0x3b')]){_0x271f0a['where']=_[_0x9b23('0x3c')](_0x271f0a[_0x9b23('0x39')],{'$or':_[_0x9b23('0x2f')](_0x2eada6,function(_0x2dfeab){if(_0x2dfeab['type']!==_0x9b23('0x3d')){var _0x4326a4={};_0x4326a4[_0x2dfeab['name']]={'$like':'%'+_0x3fa455['query'][_0x9b23('0x3b')]+'%'};return _0x4326a4;}})});}_0x271f0a=_['merge']({},_0x271f0a,_0x3fa455[_0x9b23('0x3e')]);var _0x4716a1={'where':_0x271f0a[_0x9b23('0x39')]};return db[_0x9b23('0x2a')][_0x9b23('0x3f')](_0x4716a1)['then'](function(_0x5af92d){_0x1a1595[_0x9b23('0x3f')]=_0x5af92d;if(_0x3fa455[_0x9b23('0x32')][_0x9b23('0x40')]){_0x271f0a[_0x9b23('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9b23('0x42')](_0x271f0a);})['then'](function(_0x74d3){_0x1a1595['rows']=_0x74d3;return _0x1a1595;})[_0x9b23('0x26')](respondWithFilteredResult(_0x121aec,_0x271f0a))['catch'](handleError(_0x121aec,null));};exports[_0x9b23('0x43')]=function(_0xd3272d,_0x5b2a51){var _0x3a817e={'raw':![],'where':{'id':_0xd3272d[_0x9b23('0x44')]['id']}},_0x24c58f={};_0x24c58f[_0x9b23('0x2e')]=_[_0x9b23('0x30')](db[_0x9b23('0x2a')][_0x9b23('0x45')]);_0x24c58f[_0x9b23('0x32')]=_[_0x9b23('0x30')](_0xd3272d[_0x9b23('0x32')]);_0x24c58f[_0x9b23('0x31')]=_[_0x9b23('0x34')](_0x24c58f['model'],_0x24c58f[_0x9b23('0x32')]);_0x3a817e[_0x9b23('0x33')]=_['intersection'](_0x24c58f['model'],qs[_0x9b23('0x35')](_0xd3272d[_0x9b23('0x32')]['fields']));_0x3a817e[_0x9b23('0x33')]=_0x3a817e[_0x9b23('0x33')][_0x9b23('0x46')]?_0x3a817e[_0x9b23('0x33')]:_0x24c58f[_0x9b23('0x2e')];if(_0xd3272d['query'][_0x9b23('0x40')]){_0x3a817e[_0x9b23('0x41')]=[{'all':!![]}];}_0x3a817e=_[_0x9b23('0x3c')]({},_0x3a817e,_0xd3272d[_0x9b23('0x3e')]);return db[_0x9b23('0x2a')][_0x9b23('0x47')](_0x3a817e)[_0x9b23('0x26')](handleEntityNotFound(_0x5b2a51,null))[_0x9b23('0x26')](respondWithResult(_0x5b2a51,null))['catch'](handleError(_0x5b2a51,null));};exports[_0x9b23('0x48')]=function(_0x44ab52,_0x48130a){return db[_0x9b23('0x2a')][_0x9b23('0x48')](_0x44ab52[_0x9b23('0x49')],{})[_0x9b23('0x26')](respondWithResult(_0x48130a,0xc9))[_0x9b23('0x4a')](handleError(_0x48130a,null));};exports['bulkCreate']=function(_0x2bd4f5,_0x83b004){return db[_0x9b23('0x2a')]['bulkCreate'](_0x2bd4f5[_0x9b23('0x49')],{'raw':![],'individualHooks':!![]})[_0x9b23('0x26')](respondWithResult(_0x83b004,0xc9))[_0x9b23('0x4a')](handleError(_0x83b004,null));};exports[_0x9b23('0x24')]=function(_0xd9bb7a,_0x4e1d88){if(_0xd9bb7a[_0x9b23('0x49')]['id']){delete _0xd9bb7a[_0x9b23('0x49')]['id'];}return db['AnalyticFieldReport'][_0x9b23('0x47')]({'where':{'id':_0xd9bb7a[_0x9b23('0x44')]['id']}})['then'](handleEntityNotFound(_0x4e1d88,null))[_0x9b23('0x26')](saveUpdates(_0xd9bb7a[_0x9b23('0x49')],null))[_0x9b23('0x26')](respondWithResult(_0x4e1d88,null))[_0x9b23('0x4a')](handleError(_0x4e1d88,null));};exports[_0x9b23('0x25')]=function(_0x3f6ab5,_0x426299){return db[_0x9b23('0x2a')][_0x9b23('0x47')]({'where':{'id':_0x3f6ab5[_0x9b23('0x44')]['id']}})[_0x9b23('0x26')](handleEntityNotFound(_0x426299,null))[_0x9b23('0x26')](removeEntity(_0x426299,null))[_0x9b23('0x4a')](handleError(_0x426299,null));};exports[_0x9b23('0x4b')]=function(_0x2cb882,_0x213214){return db[_0x9b23('0x2a')][_0x9b23('0x25')]({'where':{'id':_0x2cb882[_0x9b23('0x32')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x9b23('0x26')](respondWithResult(_0x213214,0xcc))[_0x9b23('0x4a')](handleError(_0x213214,null));};exports['addFields']=function(_0x183ab9,_0x49e248,_0x3ee39b){return db[_0x9b23('0x4c')][_0x9b23('0x4d')]({'where':{'id':_0x183ab9[_0x9b23('0x44')]['id']}})[_0x9b23('0x26')](handleEntityNotFound(_0x49e248,null))[_0x9b23('0x26')](function(_0x63eeb2){if(_0x63eeb2){return db[_0x9b23('0x4e')][_0x9b23('0x4f')](function(_0x28b83e){return db[_0x9b23('0x2a')][_0x9b23('0x25')]({'where':{'CustomReportId':_0x183ab9['params']['id']},'transaction':_0x28b83e})[_0x9b23('0x26')](function(_0x3ffd72){var _0x33e1ca=_[_0x9b23('0x2f')](_0x183ab9[_0x9b23('0x49')],function(_0x32e666){delete _0x32e666['id'];_0x32e666[_0x9b23('0x50')]=_0x183ab9[_0x9b23('0x44')]['id'];return _0x32e666;});return db['AnalyticFieldReport'][_0x9b23('0x51')](_0x33e1ca,{'transaction':_0x28b83e});});})[_0x9b23('0x26')](function(){return db[_0x9b23('0x2a')]['findAll']({'where':{'CustomReportId':_0x183ab9[_0x9b23('0x44')]['id']}});});}})['then'](respondWithResult(_0x49e248,null))[_0x9b23('0x4a')](handleError(_0x49e248,null));}; \ No newline at end of file +var _0x5e67=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','options','includeAll','include','findAll','then','show','params','keys','intersection','create','body','catch','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0xf0f45b,_0xf3c6c9){var _0x311b94=function(_0x366d31){while(--_0x366d31){_0xf0f45b['push'](_0xf0f45b['shift']());}};_0x311b94(++_0xf3c6c9);}(_0x5e67,0x12f));var _0x75e6=function(_0x11dad5,_0x76351a){_0x11dad5=_0x11dad5-0x0;var _0x13b889=_0x5e67[_0x11dad5];return _0x13b889;};'use strict';var emlformat=require(_0x75e6('0x0'));var rimraf=require(_0x75e6('0x1'));var zipdir=require(_0x75e6('0x2'));var jsonpatch=require(_0x75e6('0x3'));var rp=require(_0x75e6('0x4'));var moment=require(_0x75e6('0x5'));var BPromise=require(_0x75e6('0x6'));var Mustache=require('mustache');var util=require(_0x75e6('0x7'));var path=require(_0x75e6('0x8'));var sox=require(_0x75e6('0x9'));var csv=require(_0x75e6('0xa'));var ejs=require(_0x75e6('0xb'));var fs=require('fs');var fs_extra=require(_0x75e6('0xc'));var _=require(_0x75e6('0xd'));var squel=require(_0x75e6('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x75e6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x75e6('0x10'));var Redis=require('ioredis');var authService=require(_0x75e6('0x11'));var qs=require(_0x75e6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x75e6('0x13'));var logger=require(_0x75e6('0x14'))(_0x75e6('0x15'));var utils=require(_0x75e6('0x16'));var config=require(_0x75e6('0x17'));var licenseUtil=require(_0x75e6('0x18'));var db=require(_0x75e6('0x19'))['db'];function respondWithStatusCode(_0x47cfaa,_0x57e38c){_0x57e38c=_0x57e38c||0xcc;return function(_0x31b5d7){if(_0x31b5d7){return _0x47cfaa[_0x75e6('0x1a')](_0x57e38c);}return _0x47cfaa[_0x75e6('0x1b')](_0x57e38c)[_0x75e6('0x1c')]();};}function respondWithResult(_0x46fd3e,_0x263e46){_0x263e46=_0x263e46||0xc8;return function(_0x5b0323){if(_0x5b0323){return _0x46fd3e[_0x75e6('0x1b')](_0x263e46)[_0x75e6('0x1d')](_0x5b0323);}};}function respondWithFilteredResult(_0x5741db,_0xede664){return function(_0x31f92c){if(_0x31f92c){var _0x460447=typeof _0xede664['offset']===_0x75e6('0x1e')&&typeof _0xede664[_0x75e6('0x1f')]===_0x75e6('0x1e');var _0x338161=_0x31f92c[_0x75e6('0x20')];var _0x3b2916=_0x460447?0x0:_0xede664[_0x75e6('0x21')];var _0x171867=_0x460447?_0x31f92c[_0x75e6('0x20')]:_0xede664['offset']+_0xede664[_0x75e6('0x1f')];var _0x57d35e;if(_0x171867>=_0x338161){_0x171867=_0x338161;_0x57d35e=0xc8;}else{_0x57d35e=0xce;}_0x5741db[_0x75e6('0x1b')](_0x57d35e);return _0x5741db[_0x75e6('0x22')]('Content-Range',_0x3b2916+'-'+_0x171867+'/'+_0x338161)[_0x75e6('0x1d')](_0x31f92c);}return null;};}function patchUpdates(_0x474396){return function(_0x450db0){try{jsonpatch[_0x75e6('0x23')](_0x450db0,_0x474396,!![]);}catch(_0x330c3c){return BPromise[_0x75e6('0x24')](_0x330c3c);}return _0x450db0[_0x75e6('0x25')]();};}function saveUpdates(_0x479f5a,_0x19b4cd){return function(_0x36a014){if(_0x36a014){return _0x36a014[_0x75e6('0x26')](_0x479f5a)['then'](function(_0x3167ae){return _0x3167ae;});}return null;};}function removeEntity(_0x3c48b1,_0x45aad8){return function(_0x50121c){if(_0x50121c){return _0x50121c[_0x75e6('0x27')]()['then'](function(){_0x3c48b1[_0x75e6('0x1b')](0xcc)[_0x75e6('0x1c')]();});}};}function handleEntityNotFound(_0x364de0,_0x1950ec){return function(_0x53828d){if(!_0x53828d){_0x364de0[_0x75e6('0x1a')](0x194);}return _0x53828d;};}function handleError(_0xd72173,_0x54fda0){_0x54fda0=_0x54fda0||0x1f4;return function(_0x3d0461){logger[_0x75e6('0x28')](_0x3d0461[_0x75e6('0x29')]);if(_0x3d0461['name']){delete _0x3d0461[_0x75e6('0x2a')];}_0xd72173[_0x75e6('0x1b')](_0x54fda0)['send'](_0x3d0461);};}exports[_0x75e6('0x2b')]=function(_0x17b0c4,_0x55a34f){var _0x4975c8={},_0x4b2551={},_0x4670fd={'count':0x0,'rows':[]};var _0x4c1e43=_[_0x75e6('0x2c')](db[_0x75e6('0x2d')][_0x75e6('0x2e')],function(_0x1928e7){return{'name':_0x1928e7[_0x75e6('0x2f')],'type':_0x1928e7[_0x75e6('0x30')][_0x75e6('0x31')]};});_0x4b2551[_0x75e6('0x32')]=_[_0x75e6('0x2c')](_0x4c1e43,_0x75e6('0x2a'));_0x4b2551['query']=_['keys'](_0x17b0c4['query']);_0x4b2551[_0x75e6('0x33')]=_['intersection'](_0x4b2551[_0x75e6('0x32')],_0x4b2551[_0x75e6('0x34')]);_0x4975c8[_0x75e6('0x35')]=_['intersection'](_0x4b2551[_0x75e6('0x32')],qs[_0x75e6('0x36')](_0x17b0c4[_0x75e6('0x34')][_0x75e6('0x36')]));_0x4975c8[_0x75e6('0x35')]=_0x4975c8[_0x75e6('0x35')][_0x75e6('0x37')]?_0x4975c8['attributes']:_0x4b2551[_0x75e6('0x32')];if(!_0x17b0c4['query'][_0x75e6('0x38')]('nolimit')){_0x4975c8['limit']=qs['limit'](_0x17b0c4['query'][_0x75e6('0x1f')]);_0x4975c8[_0x75e6('0x21')]=qs[_0x75e6('0x21')](_0x17b0c4[_0x75e6('0x34')][_0x75e6('0x21')]);}_0x4975c8['order']=qs['sort'](_0x17b0c4[_0x75e6('0x34')]['sort']);_0x4975c8[_0x75e6('0x39')]=qs[_0x75e6('0x33')](_[_0x75e6('0x3a')](_0x17b0c4[_0x75e6('0x34')],_0x4b2551['filters']),_0x4c1e43);if(_0x17b0c4['query'][_0x75e6('0x3b')]){_0x4975c8['where']=_[_0x75e6('0x3c')](_0x4975c8['where'],{'$or':_['map'](_0x4c1e43,function(_0x11430b){if(_0x11430b[_0x75e6('0x30')]!=='VIRTUAL'){var _0x2125fb={};_0x2125fb[_0x11430b['name']]={'$like':'%'+_0x17b0c4[_0x75e6('0x34')][_0x75e6('0x3b')]+'%'};return _0x2125fb;}})});}_0x4975c8=_[_0x75e6('0x3c')]({},_0x4975c8,_0x17b0c4[_0x75e6('0x3d')]);var _0x58d4e0={'where':_0x4975c8[_0x75e6('0x39')]};return db[_0x75e6('0x2d')][_0x75e6('0x20')](_0x58d4e0)['then'](function(_0x34acb5){_0x4670fd[_0x75e6('0x20')]=_0x34acb5;if(_0x17b0c4['query'][_0x75e6('0x3e')]){_0x4975c8[_0x75e6('0x3f')]=[{'all':!![]}];}return db[_0x75e6('0x2d')][_0x75e6('0x40')](_0x4975c8);})[_0x75e6('0x41')](function(_0x45604b){_0x4670fd['rows']=_0x45604b;return _0x4670fd;})[_0x75e6('0x41')](respondWithFilteredResult(_0x55a34f,_0x4975c8))['catch'](handleError(_0x55a34f,null));};exports[_0x75e6('0x42')]=function(_0x2044b5,_0x23a4ea){var _0x295750={'raw':![],'where':{'id':_0x2044b5[_0x75e6('0x43')]['id']}},_0x224656={};_0x224656['model']=_[_0x75e6('0x44')](db[_0x75e6('0x2d')]['rawAttributes']);_0x224656[_0x75e6('0x34')]=_[_0x75e6('0x44')](_0x2044b5[_0x75e6('0x34')]);_0x224656[_0x75e6('0x33')]=_[_0x75e6('0x45')](_0x224656[_0x75e6('0x32')],_0x224656['query']);_0x295750[_0x75e6('0x35')]=_[_0x75e6('0x45')](_0x224656[_0x75e6('0x32')],qs[_0x75e6('0x36')](_0x2044b5['query'][_0x75e6('0x36')]));_0x295750['attributes']=_0x295750[_0x75e6('0x35')][_0x75e6('0x37')]?_0x295750[_0x75e6('0x35')]:_0x224656[_0x75e6('0x32')];if(_0x2044b5['query'][_0x75e6('0x3e')]){_0x295750[_0x75e6('0x3f')]=[{'all':!![]}];}_0x295750=_[_0x75e6('0x3c')]({},_0x295750,_0x2044b5[_0x75e6('0x3d')]);return db[_0x75e6('0x2d')]['find'](_0x295750)['then'](handleEntityNotFound(_0x23a4ea,null))[_0x75e6('0x41')](respondWithResult(_0x23a4ea,null))['catch'](handleError(_0x23a4ea,null));};exports[_0x75e6('0x46')]=function(_0x1ee6ae,_0x587626){return db[_0x75e6('0x2d')]['create'](_0x1ee6ae[_0x75e6('0x47')],{})[_0x75e6('0x41')](respondWithResult(_0x587626,0xc9))[_0x75e6('0x48')](handleError(_0x587626,null));};exports[_0x75e6('0x49')]=function(_0x3c0c29,_0x2e4db0){return db['AnalyticFieldReport'][_0x75e6('0x49')](_0x3c0c29[_0x75e6('0x47')],{'raw':![],'individualHooks':!![]})[_0x75e6('0x41')](respondWithResult(_0x2e4db0,0xc9))['catch'](handleError(_0x2e4db0,null));};exports['update']=function(_0x4c280a,_0x5477d0){if(_0x4c280a['body']['id']){delete _0x4c280a[_0x75e6('0x47')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x4c280a[_0x75e6('0x43')]['id']}})[_0x75e6('0x41')](handleEntityNotFound(_0x5477d0,null))[_0x75e6('0x41')](saveUpdates(_0x4c280a[_0x75e6('0x47')],null))['then'](respondWithResult(_0x5477d0,null))[_0x75e6('0x48')](handleError(_0x5477d0,null));};exports[_0x75e6('0x27')]=function(_0x28b1e1,_0x30a8f0){return db[_0x75e6('0x2d')]['find']({'where':{'id':_0x28b1e1[_0x75e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x30a8f0,null))['then'](removeEntity(_0x30a8f0,null))[_0x75e6('0x48')](handleError(_0x30a8f0,null));};exports[_0x75e6('0x4a')]=function(_0x12d3ca,_0x17e7cc){return db[_0x75e6('0x2d')][_0x75e6('0x27')]({'where':{'id':_0x12d3ca[_0x75e6('0x34')][_0x75e6('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x17e7cc,0xcc))['catch'](handleError(_0x17e7cc,null));};exports['addFields']=function(_0x28dee9,_0x1c2d28,_0x2a7de3){return db[_0x75e6('0x4c')][_0x75e6('0x4d')]({'where':{'id':_0x28dee9['params']['id']}})[_0x75e6('0x41')](handleEntityNotFound(_0x1c2d28,null))[_0x75e6('0x41')](function(_0x49084a){if(_0x49084a){return db[_0x75e6('0x4e')][_0x75e6('0x4f')](function(_0x47c92f){return db[_0x75e6('0x2d')]['destroy']({'where':{'CustomReportId':_0x28dee9[_0x75e6('0x43')]['id']},'transaction':_0x47c92f})[_0x75e6('0x41')](function(_0x377859){var _0x1727da=_[_0x75e6('0x2c')](_0x28dee9[_0x75e6('0x47')],function(_0xbcee54){delete _0xbcee54['id'];_0xbcee54[_0x75e6('0x50')]=_0x28dee9['params']['id'];return _0xbcee54;});return db[_0x75e6('0x2d')][_0x75e6('0x49')](_0x1727da,{'transaction':_0x47c92f});});})[_0x75e6('0x41')](function(){return db[_0x75e6('0x2d')][_0x75e6('0x40')]({'where':{'CustomReportId':_0x28dee9[_0x75e6('0x43')]['id']}});});}})[_0x75e6('0x41')](respondWithResult(_0x1c2d28,null))[_0x75e6('0x48')](handleError(_0x1c2d28,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index c82b9c1..f61473e 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 _0x8de0=['api','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x5a40fd,_0x505e29){var _0x2570f7=function(_0xf7afb3){while(--_0xf7afb3){_0x5a40fd['push'](_0x5a40fd['shift']());}};_0x2570f7(++_0x505e29);}(_0x8de0,0x8d));var _0x08de=function(_0x45a2ac,_0xe2f785){_0x45a2ac=_0x45a2ac-0x0;var _0x166152=_0x8de0[_0x45a2ac];return _0x166152;};'use strict';var _=require(_0x08de('0x0'));var util=require(_0x08de('0x1'));var logger=require('../../config/logger')(_0x08de('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x08de('0x3'));var fs=require('fs');var path=require(_0x08de('0x4'));var rimraf=require(_0x08de('0x5'));var config=require(_0x08de('0x6'));var attributes=require(_0x08de('0x7'));module[_0x08de('0x8')]=function(_0x2a8463,_0x90f949){return _0x2a8463['define'](_0x08de('0x9'),attributes,{'tableName':_0x08de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc01a=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x4160c2,_0x517b9b){var _0x473c62=function(_0x46f5fd){while(--_0x46f5fd){_0x4160c2['push'](_0x4160c2['shift']());}};_0x473c62(++_0x517b9b);}(_0xc01a,0x15f));var _0xac01=function(_0x4f0d44,_0x28f760){_0x4f0d44=_0x4f0d44-0x0;var _0x1a7e60=_0xc01a[_0x4f0d44];return _0x1a7e60;};'use strict';var _=require('lodash');var util=require(_0xac01('0x0'));var logger=require(_0xac01('0x1'))(_0xac01('0x2'));var moment=require(_0xac01('0x3'));var BPromise=require(_0xac01('0x4'));var rp=require(_0xac01('0x5'));var fs=require('fs');var path=require(_0xac01('0x6'));var rimraf=require('rimraf');var config=require(_0xac01('0x7'));var attributes=require(_0xac01('0x8'));module[_0xac01('0x9')]=function(_0x14d27c,_0x3af956){return _0x14d27c[_0xac01('0xa')](_0xac01('0xb'),attributes,{'tableName':_0xac01('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 322387d..33af955 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 _0x1c7f=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','http','request'];(function(_0x1f7a68,_0x200f6e){var _0x49f11c=function(_0x4d7afb){while(--_0x4d7afb){_0x1f7a68['push'](_0x1f7a68['shift']());}};_0x49f11c(++_0x200f6e);}(_0x1c7f,0x174));var _0xf1c7=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x1c7f[_0x363ef8];return _0x148822;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf1c7('0x0'));var BPromise=require(_0xf1c7('0x1'));var rs=require(_0xf1c7('0x2'));var fs=require('fs');var Redis=require(_0xf1c7('0x3'));var db=require(_0xf1c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf1c7('0x5'));var client=jayson['client'][_0xf1c7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1dc218,_0x2b1c3e,_0x5f4ff3){return new BPromise(function(_0x5db6dd,_0x501716){return client[_0xf1c7('0x7')](_0x1dc218,_0x5f4ff3)[_0xf1c7('0x8')](function(_0x2ded38){logger[_0xf1c7('0x9')](_0xf1c7('0xa'),_0x2b1c3e,_0xf1c7('0xb'));logger[_0xf1c7('0xc')](_0xf1c7('0xd'),_0x2b1c3e,_0xf1c7('0xb'),JSON[_0xf1c7('0xe')](_0x2ded38));if(_0x2ded38[_0xf1c7('0xf')]){if(_0x2ded38[_0xf1c7('0xf')][_0xf1c7('0x10')]===0x1f4){logger[_0xf1c7('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2b1c3e,_0x2ded38[_0xf1c7('0xf')][_0xf1c7('0x11')]);return _0x501716(_0x2ded38[_0xf1c7('0xf')][_0xf1c7('0x11')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b1c3e,_0x2ded38['error'][_0xf1c7('0x11')]);return _0x5db6dd(_0x2ded38[_0xf1c7('0xf')][_0xf1c7('0x11')]);}else{logger[_0xf1c7('0x9')](_0xf1c7('0xa'),_0x2b1c3e,_0xf1c7('0xb'));_0x5db6dd(_0x2ded38[_0xf1c7('0x12')][_0xf1c7('0x11')]);}})[_0xf1c7('0x13')](function(_0x4fcd97){logger[_0xf1c7('0xf')](_0xf1c7('0xa'),_0x2b1c3e,_0x4fcd97);_0x501716(_0x4fcd97);});});} \ No newline at end of file +var _0x8d9e=['client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x29f014,_0x508522){var _0x316be5=function(_0x1753a5){while(--_0x1753a5){_0x29f014['push'](_0x29f014['shift']());}};_0x316be5(++_0x508522);}(_0x8d9e,0x9d));var _0xe8d9=function(_0x4b0326,_0x396ef8){_0x4b0326=_0x4b0326-0x0;var _0x3e1ea1=_0x8d9e[_0x4b0326];return _0x3e1ea1;};'use strict';var _=require('lodash');var util=require(_0xe8d9('0x0'));var moment=require(_0xe8d9('0x1'));var BPromise=require(_0xe8d9('0x2'));var rs=require(_0xe8d9('0x3'));var fs=require('fs');var Redis=require(_0xe8d9('0x4'));var db=require(_0xe8d9('0x5'))['db'];var utils=require(_0xe8d9('0x6'));var logger=require(_0xe8d9('0x7'))(_0xe8d9('0x8'));var config=require(_0xe8d9('0x9'));var jayson=require(_0xe8d9('0xa'));var client=jayson[_0xe8d9('0xb')][_0xe8d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22e1bc,_0x454e93,_0x519537){return new BPromise(function(_0x5bf2af,_0x413ff0){return client[_0xe8d9('0xd')](_0x22e1bc,_0x519537)[_0xe8d9('0xe')](function(_0x4c55f7){logger['info'](_0xe8d9('0xf'),_0x454e93,_0xe8d9('0x10'));logger[_0xe8d9('0x11')](_0xe8d9('0x12'),_0x454e93,_0xe8d9('0x10'),JSON[_0xe8d9('0x13')](_0x4c55f7));if(_0x4c55f7[_0xe8d9('0x14')]){if(_0x4c55f7[_0xe8d9('0x14')]['code']===0x1f4){logger[_0xe8d9('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x454e93,_0x4c55f7[_0xe8d9('0x14')][_0xe8d9('0x15')]);return _0x413ff0(_0x4c55f7[_0xe8d9('0x14')][_0xe8d9('0x15')]);}logger[_0xe8d9('0x14')](_0xe8d9('0xf'),_0x454e93,_0x4c55f7[_0xe8d9('0x14')][_0xe8d9('0x15')]);return _0x5bf2af(_0x4c55f7[_0xe8d9('0x14')][_0xe8d9('0x15')]);}else{logger[_0xe8d9('0x16')](_0xe8d9('0xf'),_0x454e93,_0xe8d9('0x10'));_0x5bf2af(_0x4c55f7['result'][_0xe8d9('0x15')]);}})[_0xe8d9('0x17')](function(_0x38a3fe){logger[_0xe8d9('0x14')](_0xe8d9('0xf'),_0x454e93,_0x38a3fe);_0x413ff0(_0x38a3fe);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 6592012..fcb0984 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(_0x5d71fc,_0x38d8b7){var _0x237783=function(_0x5243a0){while(--_0x5243a0){_0x5d71fc['push'](_0x5d71fc['shift']());}};_0x237783(++_0x38d8b7);}(_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('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(_0x820ff8,_0x30f0e3){var _0x2678bb=function(_0x18bb6){while(--_0x18bb6){_0x820ff8['push'](_0x820ff8['shift']());}};_0x2678bb(++_0x30f0e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 d18c675..253fb44 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 _0x373d=['name','TEXT','sequelize','STRING'];(function(_0x36bbbb,_0x3f6709){var _0x3ca0eb=function(_0x299763){while(--_0x299763){_0x36bbbb['push'](_0x36bbbb['shift']());}};_0x3ca0eb(++_0x3f6709);}(_0x373d,0x1e2));var _0xd373=function(_0x36ca6e,_0x1bcabc){_0x36ca6e=_0x36ca6e-0x0;var _0x1e774c=_0x373d[_0x36ca6e];return _0x1e774c;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'name':{'type':Sequelize[_0xd373('0x1')],'allowNull':![],'unique':_0xd373('0x2')},'table':{'type':Sequelize[_0xd373('0x1')]},'metric':{'type':Sequelize[_0xd373('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x92d7=['STRING','name','TEXT','sequelize'];(function(_0x5dade2,_0x25cef4){var _0x1dec98=function(_0x52dd61){while(--_0x52dd61){_0x5dade2['push'](_0x5dade2['shift']());}};_0x1dec98(++_0x25cef4);}(_0x92d7,0x17b));var _0x792d=function(_0x3740ae,_0x47f252){_0x3740ae=_0x3740ae-0x0;var _0x2ce74a=_0x92d7[_0x3740ae];return _0x2ce74a;};'use strict';var Sequelize=require(_0x792d('0x0'));module['exports']={'name':{'type':Sequelize[_0x792d('0x1')],'allowNull':![],'unique':_0x792d('0x2')},'table':{'type':Sequelize[_0x792d('0x1')]},'metric':{'type':Sequelize[_0x792d('0x3')]},'description':{'type':Sequelize[_0x792d('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 8aa5b5e..c63a2f4 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 _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','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'];(function(_0x38189c,_0x4e89a5){var _0x133119=function(_0x3871e9){while(--_0x3871e9){_0x38189c['push'](_0x38189c['shift']());}};_0x133119(++_0x4e89a5);}(_0x55ca,0x126));var _0xa55c=function(_0x24c405,_0x56d6fb){_0x24c405=_0x24c405-0x0;var _0x383aef=_0x55ca[_0x24c405];return _0x383aef;};'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(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file +var _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2ce44e,_0x3e5d7c){_0x2ce44e=_0x2ce44e-0x0;var _0x4407f8=_0x1cb9[_0x2ce44e];return _0x4407f8;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index f953a0f..4a21913 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 _0x3e4d=['rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','request-promise','path'];(function(_0x4a746e,_0x3166c0){var _0x451a87=function(_0x28903b){while(--_0x28903b){_0x4a746e['push'](_0x4a746e['shift']());}};_0x451a87(++_0x3166c0);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x16cb73,_0x472970){_0x16cb73=_0x16cb73-0x0;var _0x5060b5=_0x3e4d[_0x16cb73];return _0x5060b5;};'use strict';var _=require(_0xd3e4('0x0'));var util=require('util');var logger=require(_0xd3e4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3e4('0x2'));var fs=require('fs');var path=require(_0xd3e4('0x3'));var rimraf=require(_0xd3e4('0x4'));var config=require('../../config/environment');var attributes=require(_0xd3e4('0x5'));module['exports']=function(_0x4b9a10,_0x7b42fe){return _0x4b9a10[_0xd3e4('0x6')](_0xd3e4('0x7'),attributes,{'tableName':_0xd3e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4279=['moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4279,0x8d));var _0x9427=function(_0x4130c0,_0x3d2f70){_0x4130c0=_0x4130c0-0x0;var _0x910b9a=_0x4279[_0x4130c0];return _0x910b9a;};'use strict';var _=require('lodash');var util=require(_0x9427('0x0'));var logger=require(_0x9427('0x1'))('api');var moment=require(_0x9427('0x2'));var BPromise=require(_0x9427('0x3'));var rp=require(_0x9427('0x4'));var fs=require('fs');var path=require(_0x9427('0x5'));var rimraf=require('rimraf');var config=require(_0x9427('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x9427('0x7')]=function(_0x2a0b3e,_0x5e9d1e){return _0x2a0b3e[_0x9427('0x8')](_0x9427('0x9'),attributes,{'tableName':_0x9427('0xa'),'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 92c8193..6da52fb 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 _0x8b9f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis'];(function(_0x1cf1c6,_0xaf1688){var _0x4ecf79=function(_0x186cca){while(--_0x186cca){_0x1cf1c6['push'](_0x1cf1c6['shift']());}};_0x4ecf79(++_0xaf1688);}(_0x8b9f,0x11a));var _0xf8b9=function(_0x57db4c,_0x8f9084){_0x57db4c=_0x57db4c-0x0;var _0x1758f2=_0x8b9f[_0x57db4c];return _0x1758f2;};'use strict';var _=require('lodash');var util=require(_0xf8b9('0x0'));var moment=require(_0xf8b9('0x1'));var BPromise=require('bluebird');var rs=require(_0xf8b9('0x2'));var fs=require('fs');var Redis=require(_0xf8b9('0x3'));var db=require(_0xf8b9('0x4'))['db'];var utils=require(_0xf8b9('0x5'));var logger=require(_0xf8b9('0x6'))(_0xf8b9('0x7'));var config=require(_0xf8b9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf8b9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e3ae1,_0x1827fd,_0x202a1e){return new BPromise(function(_0xca0310,_0x3d05ee){return client[_0xf8b9('0xa')](_0x1e3ae1,_0x202a1e)[_0xf8b9('0xb')](function(_0x3bba60){logger[_0xf8b9('0xc')](_0xf8b9('0xd'),_0x1827fd,_0xf8b9('0xe'));logger[_0xf8b9('0xf')](_0xf8b9('0x10'),_0x1827fd,_0xf8b9('0xe'),JSON[_0xf8b9('0x11')](_0x3bba60));if(_0x3bba60[_0xf8b9('0x12')]){if(_0x3bba60[_0xf8b9('0x12')][_0xf8b9('0x13')]===0x1f4){logger['error'](_0xf8b9('0xd'),_0x1827fd,_0x3bba60[_0xf8b9('0x12')][_0xf8b9('0x14')]);return _0x3d05ee(_0x3bba60[_0xf8b9('0x12')]['message']);}logger[_0xf8b9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x1827fd,_0x3bba60[_0xf8b9('0x12')][_0xf8b9('0x14')]);return _0xca0310(_0x3bba60['error'][_0xf8b9('0x14')]);}else{logger[_0xf8b9('0xc')](_0xf8b9('0xd'),_0x1827fd,'request\x20sent');_0xca0310(_0x3bba60['result'][_0xf8b9('0x14')]);}})[_0xf8b9('0x15')](function(_0x517cfd){logger[_0xf8b9('0x12')](_0xf8b9('0xd'),_0x1827fd,_0x517cfd);_0x3d05ee(_0x517cfd);});});} \ No newline at end of file +var _0xb685=['jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1aae64,_0x48ca82){var _0x388767=function(_0x4d89ec){while(--_0x4d89ec){_0x1aae64['push'](_0x1aae64['shift']());}};_0x388767(++_0x48ca82);}(_0xb685,0xd7));var _0x5b68=function(_0x527fb7,_0x251b68){_0x527fb7=_0x527fb7-0x0;var _0xbc43e8=_0xb685[_0x527fb7];return _0xbc43e8;};'use strict';var _=require(_0x5b68('0x0'));var util=require(_0x5b68('0x1'));var moment=require(_0x5b68('0x2'));var BPromise=require(_0x5b68('0x3'));var rs=require(_0x5b68('0x4'));var fs=require('fs');var Redis=require(_0x5b68('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b68('0x6'));var logger=require(_0x5b68('0x7'))(_0x5b68('0x8'));var config=require(_0x5b68('0x9'));var jayson=require(_0x5b68('0xa'));var client=jayson[_0x5b68('0xb')][_0x5b68('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c57ba,_0x4de89b,_0x236c08){return new BPromise(function(_0x5fbf41,_0x359c8){return client[_0x5b68('0xd')](_0x4c57ba,_0x236c08)[_0x5b68('0xe')](function(_0x296896){logger['info'](_0x5b68('0xf'),_0x4de89b,_0x5b68('0x10'));logger['debug'](_0x5b68('0x11'),_0x4de89b,'request\x20sent',JSON[_0x5b68('0x12')](_0x296896));if(_0x296896[_0x5b68('0x13')]){if(_0x296896['error'][_0x5b68('0x14')]===0x1f4){logger[_0x5b68('0x13')](_0x5b68('0xf'),_0x4de89b,_0x296896[_0x5b68('0x13')]['message']);return _0x359c8(_0x296896[_0x5b68('0x13')][_0x5b68('0x15')]);}logger[_0x5b68('0x13')](_0x5b68('0xf'),_0x4de89b,_0x296896[_0x5b68('0x13')]['message']);return _0x5fbf41(_0x296896['error'][_0x5b68('0x15')]);}else{logger[_0x5b68('0x16')](_0x5b68('0xf'),_0x4de89b,_0x5b68('0x10'));_0x5fbf41(_0x296896[_0x5b68('0x17')]['message']);}})[_0x5b68('0x18')](function(_0x2c3da9){logger[_0x5b68('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4de89b,_0x2c3da9);_0x359c8(_0x2c3da9);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 8bfe5ec..dfb3551 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 _0x4a80=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4a80,0xbe));var _0x04a8=function(_0x4deb98,_0x29ebdd){_0x4deb98=_0x4deb98-0x0;var _0x2c5f93=_0x4a80[_0x4deb98];return _0x2c5f93;};'use strict';var multer=require(_0x04a8('0x0'));var util=require('util');var path=require(_0x04a8('0x1'));var timeout=require(_0x04a8('0x2'));var express=require('express');var router=express[_0x04a8('0x3')]();var fs_extra=require(_0x04a8('0x4'));var auth=require(_0x04a8('0x5'));var interaction=require(_0x04a8('0x6'));var config=require(_0x04a8('0x7'));var controller=require(_0x04a8('0x8'));router[_0x04a8('0x9')]('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0xb')]);router[_0x04a8('0x9')]('/:id',auth[_0x04a8('0xa')](),controller[_0x04a8('0xc')]);router[_0x04a8('0xd')]('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0xe')]);router[_0x04a8('0xf')](_0x04a8('0x10'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x11')]);router[_0x04a8('0x12')]('/:id',auth[_0x04a8('0xa')](),controller[_0x04a8('0x13')]);module[_0x04a8('0x14')]=router; \ No newline at end of file +var _0x535f=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','delete'];(function(_0x23d204,_0x3416eb){var _0x526746=function(_0x44fefa){while(--_0x44fefa){_0x23d204['push'](_0x23d204['shift']());}};_0x526746(++_0x3416eb);}(_0x535f,0x111));var _0xf535=function(_0x77d39c,_0x296249){_0x77d39c=_0x77d39c-0x0;var _0x1706ec=_0x535f[_0x77d39c];return _0x1706ec;};'use strict';var multer=require('multer');var util=require(_0xf535('0x0'));var path=require(_0xf535('0x1'));var timeout=require('connect-timeout');var express=require(_0xf535('0x2'));var router=express[_0xf535('0x3')]();var fs_extra=require(_0xf535('0x4'));var auth=require(_0xf535('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf535('0x6'));var controller=require(_0xf535('0x7'));router[_0xf535('0x8')]('/',auth[_0xf535('0x9')](),controller[_0xf535('0xa')]);router[_0xf535('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf535('0xb')]);router[_0xf535('0xc')]('/',auth[_0xf535('0x9')](),controller['create']);router[_0xf535('0xd')](_0xf535('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xf535('0xf')](_0xf535('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xf535('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 9dbf18c..e30b23c 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 _0x7d7a=['TEXT','sequelize','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x7d7a,0x1ea));var _0xa7d7=function(_0x311005,_0x3cb529){_0x311005=_0x311005-0x0;var _0xf8e70d=_0x7d7a[_0x311005];return _0xf8e70d;};'use strict';var Sequelize=require(_0xa7d7('0x0'));module[_0xa7d7('0x1')]={'tree':{'type':Sequelize[_0xa7d7('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3fc4=['sequelize','exports','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3fc4,0x1c2));var _0x43fc=function(_0x248098,_0xb8d608){_0x248098=_0x248098-0x0;var _0x2f4274=_0x3fc4[_0x248098];return _0x2f4274;};'use strict';var Sequelize=require(_0x43fc('0x0'));module[_0x43fc('0x1')]={'tree':{'type':Sequelize[_0x43fc('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 75501bf..c16a76a 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 _0x1da8=['find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../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','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','include'];(function(_0x3278f3,_0x235c17){var _0x519768=function(_0x2839be){while(--_0x2839be){_0x3278f3['push'](_0x3278f3['shift']());}};_0x519768(++_0x235c17);}(_0x1da8,0x1d1));var _0x81da=function(_0x4fc192,_0x6aa2f4){_0x4fc192=_0x4fc192-0x0;var _0x3b2fe2=_0x1da8[_0x4fc192];return _0x3b2fe2;};'use strict';var emlformat=require(_0x81da('0x0'));var rimraf=require(_0x81da('0x1'));var zipdir=require(_0x81da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81da('0x3'));var moment=require(_0x81da('0x4'));var BPromise=require(_0x81da('0x5'));var Mustache=require('mustache');var util=require(_0x81da('0x6'));var path=require('path');var sox=require(_0x81da('0x7'));var csv=require(_0x81da('0x8'));var ejs=require(_0x81da('0x9'));var fs=require('fs');var fs_extra=require(_0x81da('0xa'));var _=require(_0x81da('0xb'));var squel=require('squel');var crypto=require(_0x81da('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x81da('0x8'));var querystring=require(_0x81da('0xd'));var Papa=require(_0x81da('0xe'));var Redis=require(_0x81da('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x81da('0x10'));var as=require(_0x81da('0x11'));var hardwareService=require(_0x81da('0x12'));var logger=require('../../config/logger')(_0x81da('0x13'));var utils=require(_0x81da('0x14'));var config=require(_0x81da('0x15'));var licenseUtil=require(_0x81da('0x16'));var db=require(_0x81da('0x17'))['db'];function respondWithStatusCode(_0x26783a,_0x5a843e){_0x5a843e=_0x5a843e||0xcc;return function(_0x37c10e){if(_0x37c10e){return _0x26783a['sendStatus'](_0x5a843e);}return _0x26783a[_0x81da('0x18')](_0x5a843e)[_0x81da('0x19')]();};}function respondWithResult(_0x3fac64,_0x3f46cd){_0x3f46cd=_0x3f46cd||0xc8;return function(_0x366ce4){if(_0x366ce4){return _0x3fac64['status'](_0x3f46cd)[_0x81da('0x1a')](_0x366ce4);}};}function respondWithFilteredResult(_0x56fcca,_0x3584a1){return function(_0x610afc){if(_0x610afc){var _0x105969=typeof _0x3584a1['offset']==='undefined'&&typeof _0x3584a1[_0x81da('0x1b')]===_0x81da('0x1c');var _0x576d6e=_0x610afc[_0x81da('0x1d')];var _0x313f3c=_0x105969?0x0:_0x3584a1[_0x81da('0x1e')];var _0x5139af=_0x105969?_0x610afc[_0x81da('0x1d')]:_0x3584a1[_0x81da('0x1e')]+_0x3584a1[_0x81da('0x1b')];var _0x23f2c9;if(_0x5139af>=_0x576d6e){_0x5139af=_0x576d6e;_0x23f2c9=0xc8;}else{_0x23f2c9=0xce;}_0x56fcca[_0x81da('0x18')](_0x23f2c9);return _0x56fcca[_0x81da('0x1f')](_0x81da('0x20'),_0x313f3c+'-'+_0x5139af+'/'+_0x576d6e)[_0x81da('0x1a')](_0x610afc);}return null;};}function patchUpdates(_0x8b604b){return function(_0x46d0e7){try{jsonpatch[_0x81da('0x21')](_0x46d0e7,_0x8b604b,!![]);}catch(_0x297fc4){return BPromise[_0x81da('0x22')](_0x297fc4);}return _0x46d0e7[_0x81da('0x23')]();};}function saveUpdates(_0x4d22fe,_0x5d2a29){return function(_0x46ade4){if(_0x46ade4){return _0x46ade4[_0x81da('0x24')](_0x4d22fe)[_0x81da('0x25')](function(_0x23a06e){return _0x23a06e;});}return null;};}function removeEntity(_0xcb4010,_0x512f7b){return function(_0x5c6df4){if(_0x5c6df4){return _0x5c6df4[_0x81da('0x26')]()[_0x81da('0x25')](function(){_0xcb4010[_0x81da('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x683aa6,_0x595181){return function(_0x3bb18f){if(!_0x3bb18f){_0x683aa6[_0x81da('0x27')](0x194);}return _0x3bb18f;};}function handleError(_0x192837,_0x3436ac){_0x3436ac=_0x3436ac||0x1f4;return function(_0x7167bf){logger[_0x81da('0x28')](_0x7167bf[_0x81da('0x29')]);if(_0x7167bf[_0x81da('0x2a')]){delete _0x7167bf[_0x81da('0x2a')];}_0x192837['status'](_0x3436ac)[_0x81da('0x2b')](_0x7167bf);};}exports[_0x81da('0x2c')]=function(_0x1928c2,_0x17010b){var _0x161df8={},_0x58cba8={},_0x2b8be2={'count':0x0,'rows':[]};var _0x44384a=_[_0x81da('0x2d')](db[_0x81da('0x2e')][_0x81da('0x2f')],function(_0x1ef45c){return{'name':_0x1ef45c[_0x81da('0x30')],'type':_0x1ef45c[_0x81da('0x31')][_0x81da('0x32')]};});_0x58cba8[_0x81da('0x33')]=_[_0x81da('0x2d')](_0x44384a,_0x81da('0x2a'));_0x58cba8[_0x81da('0x34')]=_[_0x81da('0x35')](_0x1928c2[_0x81da('0x34')]);_0x58cba8[_0x81da('0x36')]=_['intersection'](_0x58cba8['model'],_0x58cba8[_0x81da('0x34')]);_0x161df8['attributes']=_[_0x81da('0x37')](_0x58cba8[_0x81da('0x33')],qs['fields'](_0x1928c2[_0x81da('0x34')][_0x81da('0x38')]));_0x161df8['attributes']=_0x161df8[_0x81da('0x39')][_0x81da('0x3a')]?_0x161df8['attributes']:_0x58cba8[_0x81da('0x33')];if(!_0x1928c2[_0x81da('0x34')]['hasOwnProperty'](_0x81da('0x3b'))){_0x161df8[_0x81da('0x1b')]=qs['limit'](_0x1928c2[_0x81da('0x34')]['limit']);_0x161df8['offset']=qs['offset'](_0x1928c2[_0x81da('0x34')][_0x81da('0x1e')]);}_0x161df8[_0x81da('0x3c')]=qs['sort'](_0x1928c2[_0x81da('0x34')][_0x81da('0x3d')]);_0x161df8[_0x81da('0x3e')]=qs[_0x81da('0x36')](_[_0x81da('0x3f')](_0x1928c2['query'],_0x58cba8[_0x81da('0x36')]),_0x44384a);if(_0x1928c2[_0x81da('0x34')]['filter']){_0x161df8[_0x81da('0x3e')]=_['merge'](_0x161df8[_0x81da('0x3e')],{'$or':_['map'](_0x44384a,function(_0x45f0ac){if(_0x45f0ac[_0x81da('0x31')]!==_0x81da('0x40')){var _0x4e1569={};_0x4e1569[_0x45f0ac['name']]={'$like':'%'+_0x1928c2['query'][_0x81da('0x41')]+'%'};return _0x4e1569;}})});}_0x161df8=_[_0x81da('0x42')]({},_0x161df8,_0x1928c2[_0x81da('0x43')]);var _0x4ecab8={'where':_0x161df8[_0x81da('0x3e')]};return db[_0x81da('0x2e')][_0x81da('0x1d')](_0x4ecab8)[_0x81da('0x25')](function(_0x39ca2e){_0x2b8be2[_0x81da('0x1d')]=_0x39ca2e;if(_0x1928c2['query'][_0x81da('0x44')]){_0x161df8['include']=[{'all':!![]}];}return db[_0x81da('0x2e')]['findAll'](_0x161df8);})[_0x81da('0x25')](function(_0x50ac8d){_0x2b8be2[_0x81da('0x45')]=_0x50ac8d;return _0x2b8be2;})[_0x81da('0x25')](respondWithFilteredResult(_0x17010b,_0x161df8))[_0x81da('0x46')](handleError(_0x17010b,null));};exports[_0x81da('0x47')]=function(_0x343ba6,_0x2b50a0){var _0x10804b={'raw':!![],'where':{'id':_0x343ba6[_0x81da('0x48')]['id']}},_0x21dceb={};_0x21dceb[_0x81da('0x33')]=_[_0x81da('0x35')](db[_0x81da('0x2e')][_0x81da('0x2f')]);_0x21dceb[_0x81da('0x34')]=_[_0x81da('0x35')](_0x343ba6['query']);_0x21dceb[_0x81da('0x36')]=_['intersection'](_0x21dceb[_0x81da('0x33')],_0x21dceb[_0x81da('0x34')]);_0x10804b[_0x81da('0x39')]=_[_0x81da('0x37')](_0x21dceb['model'],qs[_0x81da('0x38')](_0x343ba6[_0x81da('0x34')][_0x81da('0x38')]));_0x10804b[_0x81da('0x39')]=_0x10804b[_0x81da('0x39')][_0x81da('0x3a')]?_0x10804b['attributes']:_0x21dceb[_0x81da('0x33')];if(_0x343ba6[_0x81da('0x34')][_0x81da('0x44')]){_0x10804b[_0x81da('0x49')]=[{'all':!![]}];}_0x10804b=_[_0x81da('0x42')]({},_0x10804b,_0x343ba6[_0x81da('0x43')]);return db[_0x81da('0x2e')][_0x81da('0x4a')](_0x10804b)[_0x81da('0x25')](handleEntityNotFound(_0x2b50a0,null))[_0x81da('0x25')](respondWithResult(_0x2b50a0,null))[_0x81da('0x46')](handleError(_0x2b50a0,null));};exports['create']=function(_0x10c777,_0x3bb073){return db[_0x81da('0x2e')][_0x81da('0x4b')](_0x10c777[_0x81da('0x4c')],{})[_0x81da('0x25')](respondWithResult(_0x3bb073,0xc9))[_0x81da('0x46')](handleError(_0x3bb073,null));};exports[_0x81da('0x24')]=function(_0x54b400,_0x3d361c){if(_0x54b400['body']['id']){delete _0x54b400[_0x81da('0x4c')]['id'];}return db[_0x81da('0x2e')]['find']({'where':{'id':_0x54b400[_0x81da('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d361c,null))[_0x81da('0x25')](saveUpdates(_0x54b400[_0x81da('0x4c')],null))['then'](respondWithResult(_0x3d361c,null))['catch'](handleError(_0x3d361c,null));};exports[_0x81da('0x26')]=function(_0x1cfe09,_0xe25a30){return db[_0x81da('0x2e')]['find']({'where':{'id':_0x1cfe09['params']['id']}})[_0x81da('0x25')](handleEntityNotFound(_0xe25a30,null))[_0x81da('0x25')](removeEntity(_0xe25a30,null))[_0x81da('0x46')](handleError(_0xe25a30,null));}; \ No newline at end of file +var _0x5470=['reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range'];(function(_0x116990,_0x35f867){var _0x47fadb=function(_0x4b6b47){while(--_0x4b6b47){_0x116990['push'](_0x116990['shift']());}};_0x47fadb(++_0x35f867);}(_0x5470,0x1a9));var _0x0547=function(_0xe0aecd,_0xced435){_0xe0aecd=_0xe0aecd-0x0;var _0x1c5fe4=_0x5470[_0xe0aecd];return _0x1c5fe4;};'use strict';var emlformat=require(_0x0547('0x0'));var rimraf=require(_0x0547('0x1'));var zipdir=require(_0x0547('0x2'));var jsonpatch=require(_0x0547('0x3'));var rp=require(_0x0547('0x4'));var moment=require(_0x0547('0x5'));var BPromise=require(_0x0547('0x6'));var Mustache=require('mustache');var util=require(_0x0547('0x7'));var path=require(_0x0547('0x8'));var sox=require(_0x0547('0x9'));var csv=require(_0x0547('0xa'));var ejs=require(_0x0547('0xb'));var fs=require('fs');var fs_extra=require(_0x0547('0xc'));var _=require(_0x0547('0xd'));var squel=require(_0x0547('0xe'));var crypto=require(_0x0547('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0547('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0547('0x11'));var Papa=require(_0x0547('0x12'));var Redis=require(_0x0547('0x13'));var authService=require(_0x0547('0x14'));var qs=require(_0x0547('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0547('0x16'));var logger=require(_0x0547('0x17'))('api');var utils=require(_0x0547('0x18'));var config=require(_0x0547('0x19'));var licenseUtil=require(_0x0547('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558f51,_0x18f9ad){_0x18f9ad=_0x18f9ad||0xcc;return function(_0x120acf){if(_0x120acf){return _0x558f51[_0x0547('0x1b')](_0x18f9ad);}return _0x558f51[_0x0547('0x1c')](_0x18f9ad)[_0x0547('0x1d')]();};}function respondWithResult(_0x165db6,_0x1d0752){_0x1d0752=_0x1d0752||0xc8;return function(_0x8dd371){if(_0x8dd371){return _0x165db6[_0x0547('0x1c')](_0x1d0752)[_0x0547('0x1e')](_0x8dd371);}};}function respondWithFilteredResult(_0x48aebb,_0x245024){return function(_0x2c92a5){if(_0x2c92a5){var _0x38054a=typeof _0x245024['offset']===_0x0547('0x1f')&&typeof _0x245024[_0x0547('0x20')]===_0x0547('0x1f');var _0x3cae5c=_0x2c92a5['count'];var _0x1e42e1=_0x38054a?0x0:_0x245024[_0x0547('0x21')];var _0x3d406d=_0x38054a?_0x2c92a5[_0x0547('0x22')]:_0x245024[_0x0547('0x21')]+_0x245024[_0x0547('0x20')];var _0x55bd47;if(_0x3d406d>=_0x3cae5c){_0x3d406d=_0x3cae5c;_0x55bd47=0xc8;}else{_0x55bd47=0xce;}_0x48aebb['status'](_0x55bd47);return _0x48aebb[_0x0547('0x23')](_0x0547('0x24'),_0x1e42e1+'-'+_0x3d406d+'/'+_0x3cae5c)[_0x0547('0x1e')](_0x2c92a5);}return null;};}function patchUpdates(_0x216c10){return function(_0x47b443){try{jsonpatch['apply'](_0x47b443,_0x216c10,!![]);}catch(_0x43d7c3){return BPromise[_0x0547('0x25')](_0x43d7c3);}return _0x47b443[_0x0547('0x26')]();};}function saveUpdates(_0x1641ee,_0x169542){return function(_0x23eed3){if(_0x23eed3){return _0x23eed3[_0x0547('0x27')](_0x1641ee)[_0x0547('0x28')](function(_0x4eb88c){return _0x4eb88c;});}return null;};}function removeEntity(_0x1394a6,_0x538c49){return function(_0x12bc71){if(_0x12bc71){return _0x12bc71[_0x0547('0x29')]()[_0x0547('0x28')](function(){_0x1394a6[_0x0547('0x1c')](0xcc)[_0x0547('0x1d')]();});}};}function handleEntityNotFound(_0x509f85,_0x28d863){return function(_0x2740ec){if(!_0x2740ec){_0x509f85['sendStatus'](0x194);}return _0x2740ec;};}function handleError(_0x9e4d51,_0x14e4b4){_0x14e4b4=_0x14e4b4||0x1f4;return function(_0x13cefa){logger[_0x0547('0x2a')](_0x13cefa[_0x0547('0x2b')]);if(_0x13cefa[_0x0547('0x2c')]){delete _0x13cefa['name'];}_0x9e4d51['status'](_0x14e4b4)[_0x0547('0x2d')](_0x13cefa);};}exports['index']=function(_0x29f059,_0x2393f5){var _0x4977c3={},_0x3a745a={},_0x4122d8={'count':0x0,'rows':[]};var _0xfd560a=_[_0x0547('0x2e')](db['AnalyticTreeReport'][_0x0547('0x2f')],function(_0x35eabb){return{'name':_0x35eabb[_0x0547('0x30')],'type':_0x35eabb[_0x0547('0x31')][_0x0547('0x32')]};});_0x3a745a[_0x0547('0x33')]=_[_0x0547('0x2e')](_0xfd560a,_0x0547('0x2c'));_0x3a745a[_0x0547('0x34')]=_['keys'](_0x29f059[_0x0547('0x34')]);_0x3a745a['filters']=_[_0x0547('0x35')](_0x3a745a['model'],_0x3a745a['query']);_0x4977c3['attributes']=_[_0x0547('0x35')](_0x3a745a[_0x0547('0x33')],qs[_0x0547('0x36')](_0x29f059[_0x0547('0x34')]['fields']));_0x4977c3[_0x0547('0x37')]=_0x4977c3[_0x0547('0x37')][_0x0547('0x38')]?_0x4977c3['attributes']:_0x3a745a[_0x0547('0x33')];if(!_0x29f059[_0x0547('0x34')][_0x0547('0x39')]('nolimit')){_0x4977c3['limit']=qs[_0x0547('0x20')](_0x29f059[_0x0547('0x34')][_0x0547('0x20')]);_0x4977c3[_0x0547('0x21')]=qs[_0x0547('0x21')](_0x29f059[_0x0547('0x34')][_0x0547('0x21')]);}_0x4977c3[_0x0547('0x3a')]=qs[_0x0547('0x3b')](_0x29f059['query'][_0x0547('0x3b')]);_0x4977c3[_0x0547('0x3c')]=qs[_0x0547('0x3d')](_['pick'](_0x29f059[_0x0547('0x34')],_0x3a745a['filters']),_0xfd560a);if(_0x29f059['query'][_0x0547('0x3e')]){_0x4977c3['where']=_['merge'](_0x4977c3[_0x0547('0x3c')],{'$or':_[_0x0547('0x2e')](_0xfd560a,function(_0x1ea750){if(_0x1ea750[_0x0547('0x31')]!==_0x0547('0x3f')){var _0x413422={};_0x413422[_0x1ea750[_0x0547('0x2c')]]={'$like':'%'+_0x29f059['query'][_0x0547('0x3e')]+'%'};return _0x413422;}})});}_0x4977c3=_[_0x0547('0x40')]({},_0x4977c3,_0x29f059[_0x0547('0x41')]);var _0x3a3718={'where':_0x4977c3['where']};return db[_0x0547('0x42')][_0x0547('0x22')](_0x3a3718)[_0x0547('0x28')](function(_0x45841d){_0x4122d8['count']=_0x45841d;if(_0x29f059['query'][_0x0547('0x43')]){_0x4977c3[_0x0547('0x44')]=[{'all':!![]}];}return db[_0x0547('0x42')][_0x0547('0x45')](_0x4977c3);})[_0x0547('0x28')](function(_0x2e49a1){_0x4122d8[_0x0547('0x46')]=_0x2e49a1;return _0x4122d8;})[_0x0547('0x28')](respondWithFilteredResult(_0x2393f5,_0x4977c3))['catch'](handleError(_0x2393f5,null));};exports[_0x0547('0x47')]=function(_0x566af5,_0x4fc9e6){var _0x5e376e={'raw':!![],'where':{'id':_0x566af5[_0x0547('0x48')]['id']}},_0x3226d9={};_0x3226d9[_0x0547('0x33')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x3226d9[_0x0547('0x34')]=_['keys'](_0x566af5[_0x0547('0x34')]);_0x3226d9[_0x0547('0x3d')]=_[_0x0547('0x35')](_0x3226d9[_0x0547('0x33')],_0x3226d9[_0x0547('0x34')]);_0x5e376e[_0x0547('0x37')]=_[_0x0547('0x35')](_0x3226d9['model'],qs[_0x0547('0x36')](_0x566af5[_0x0547('0x34')][_0x0547('0x36')]));_0x5e376e[_0x0547('0x37')]=_0x5e376e[_0x0547('0x37')]['length']?_0x5e376e[_0x0547('0x37')]:_0x3226d9[_0x0547('0x33')];if(_0x566af5['query']['includeAll']){_0x5e376e[_0x0547('0x44')]=[{'all':!![]}];}_0x5e376e=_['merge']({},_0x5e376e,_0x566af5[_0x0547('0x41')]);return db[_0x0547('0x42')][_0x0547('0x49')](_0x5e376e)['then'](handleEntityNotFound(_0x4fc9e6,null))[_0x0547('0x28')](respondWithResult(_0x4fc9e6,null))[_0x0547('0x4a')](handleError(_0x4fc9e6,null));};exports[_0x0547('0x4b')]=function(_0x3affef,_0x9896f7){return db['AnalyticTreeReport'][_0x0547('0x4b')](_0x3affef[_0x0547('0x4c')],{})[_0x0547('0x28')](respondWithResult(_0x9896f7,0xc9))[_0x0547('0x4a')](handleError(_0x9896f7,null));};exports[_0x0547('0x27')]=function(_0x13c1a0,_0x3a535b){if(_0x13c1a0[_0x0547('0x4c')]['id']){delete _0x13c1a0['body']['id'];}return db[_0x0547('0x42')][_0x0547('0x49')]({'where':{'id':_0x13c1a0[_0x0547('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a535b,null))[_0x0547('0x28')](saveUpdates(_0x13c1a0[_0x0547('0x4c')],null))['then'](respondWithResult(_0x3a535b,null))[_0x0547('0x4a')](handleError(_0x3a535b,null));};exports['destroy']=function(_0x3f4fcf,_0x52693d){return db[_0x0547('0x42')]['find']({'where':{'id':_0x3f4fcf[_0x0547('0x48')]['id']}})['then'](handleEntityNotFound(_0x52693d,null))[_0x0547('0x28')](removeEntity(_0x52693d,null))[_0x0547('0x4a')](handleError(_0x52693d,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index adb1511..e4b8405 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 _0x5211=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x5211,0x110));var _0x1521=function(_0x4a05e7,_0x22f0df){_0x4a05e7=_0x4a05e7-0x0;var _0x126423=_0x5211[_0x4a05e7];return _0x126423;};'use strict';var _=require(_0x1521('0x0'));var util=require(_0x1521('0x1'));var logger=require(_0x1521('0x2'))(_0x1521('0x3'));var moment=require(_0x1521('0x4'));var BPromise=require(_0x1521('0x5'));var rp=require(_0x1521('0x6'));var fs=require('fs');var path=require(_0x1521('0x7'));var rimraf=require(_0x1521('0x8'));var config=require(_0x1521('0x9'));var attributes=require(_0x1521('0xa'));module[_0x1521('0xb')]=function(_0x1da609,_0x4fbb89){return _0x1da609[_0x1521('0xc')](_0x1521('0xd'),attributes,{'tableName':_0x1521('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86ee=['analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport'];(function(_0x37ec73,_0x178205){var _0x5ad0c9=function(_0x73172){while(--_0x73172){_0x37ec73['push'](_0x37ec73['shift']());}};_0x5ad0c9(++_0x178205);}(_0x86ee,0x90));var _0xe86e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x86ee[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xe86e('0x0'));var util=require(_0xe86e('0x1'));var logger=require(_0xe86e('0x2'))(_0xe86e('0x3'));var moment=require(_0xe86e('0x4'));var BPromise=require(_0xe86e('0x5'));var rp=require(_0xe86e('0x6'));var fs=require('fs');var path=require(_0xe86e('0x7'));var rimraf=require(_0xe86e('0x8'));var config=require(_0xe86e('0x9'));var attributes=require(_0xe86e('0xa'));module['exports']=function(_0x368733,_0x2e5b45){return _0x368733['define'](_0xe86e('0xb'),attributes,{'tableName':_0xe86e('0xc'),'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 e09edd2..ba0fb6d 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x39b877,_0x522f3d){var _0x52adf1=function(_0x415c19){while(--_0x415c19){_0x39b877['push'](_0x39b877['shift']());}};_0x52adf1(++_0x522f3d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2bbd23,_0x43c40f){_0x2bbd23=_0x2bbd23-0x0;var _0x4dc031=_0x5f2f[_0x2bbd23];return _0x4dc031;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _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(_0xbfc255,_0x2de80c){var _0x1d1f9c=function(_0x5c909b){while(--_0x5c909b){_0xbfc255['push'](_0xbfc255['shift']());}};_0x1d1f9c(++_0x2de80c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc4aa[_0x46698a];return _0x356db0;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index a5c8c8d..75d0b1b 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 _0x433c=['delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x574d9b,_0x2063da){var _0x31d2a5=function(_0x97ce4c){while(--_0x97ce4c){_0x574d9b['push'](_0x574d9b['shift']());}};_0x31d2a5(++_0x2063da);}(_0x433c,0xe5));var _0xc433=function(_0x2166a3,_0x237c50){_0x2166a3=_0x2166a3-0x0;var _0x260035=_0x433c[_0x2166a3];return _0x260035;};'use strict';var multer=require(_0xc433('0x0'));var util=require('util');var path=require(_0xc433('0x1'));var timeout=require(_0xc433('0x2'));var express=require(_0xc433('0x3'));var router=express[_0xc433('0x4')]();var fs_extra=require(_0xc433('0x5'));var auth=require(_0xc433('0x6'));var interaction=require(_0xc433('0x7'));var config=require('../../config/environment');var controller=require(_0xc433('0x8'));router[_0xc433('0x9')]('/',auth['isAuthenticated'](),controller[_0xc433('0xa')]);router[_0xc433('0x9')](_0xc433('0xb'),auth[_0xc433('0xc')](),controller[_0xc433('0xd')]);router[_0xc433('0xe')]('/',auth[_0xc433('0xc')](),controller[_0xc433('0xf')]);router[_0xc433('0x10')](_0xc433('0xb'),auth[_0xc433('0xc')](),controller[_0xc433('0x11')]);router[_0xc433('0x12')](_0xc433('0xb'),auth[_0xc433('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe5fd=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','post','put'];(function(_0x58a2de,_0x3fa5df){var _0x171d1d=function(_0x258fb5){while(--_0x258fb5){_0x58a2de['push'](_0x58a2de['shift']());}};_0x171d1d(++_0x3fa5df);}(_0xe5fd,0x16a));var _0xde5f=function(_0x2e0a0e,_0x220b59){_0x2e0a0e=_0x2e0a0e-0x0;var _0x5eea4f=_0xe5fd[_0x2e0a0e];return _0x5eea4f;};'use strict';var multer=require(_0xde5f('0x0'));var util=require(_0xde5f('0x1'));var path=require(_0xde5f('0x2'));var timeout=require(_0xde5f('0x3'));var express=require('express');var router=express[_0xde5f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xde5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde5f('0x6'));var controller=require(_0xde5f('0x7'));router[_0xde5f('0x8')]('/',auth[_0xde5f('0x9')](),controller['index']);router[_0xde5f('0x8')]('/:id',auth[_0xde5f('0x9')](),controller['show']);router[_0xde5f('0xa')]('/',auth[_0xde5f('0x9')](),controller['create']);router[_0xde5f('0xb')](_0xde5f('0xc'),auth[_0xde5f('0x9')](),controller[_0xde5f('0xd')]);router[_0xde5f('0xe')](_0xde5f('0xc'),auth['isAuthenticated'](),controller[_0xde5f('0xf')]);module[_0xde5f('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index a78d887..d44c2bd 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 _0x1280=['sequelize','exports','STRING'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0x1280,0xba));var _0x0128=function(_0x30a528,_0x1d04f2){_0x30a528=_0x30a528-0x0;var _0x3e029c=_0x1280[_0x30a528];return _0x3e029c;};'use strict';var Sequelize=require(_0x0128('0x0'));module[_0x0128('0x1')]={'name':{'type':Sequelize[_0x0128('0x2')]},'basename':{'type':Sequelize[_0x0128('0x2')]},'type':{'type':Sequelize[_0x0128('0x2')]}}; \ No newline at end of file +var _0x3c6d=['STRING','sequelize','exports'];(function(_0x39e83a,_0xabd152){var _0x51e58e=function(_0x3db0e4){while(--_0x3db0e4){_0x39e83a['push'](_0x39e83a['shift']());}};_0x51e58e(++_0xabd152);}(_0x3c6d,0x199));var _0xd3c6=function(_0x2b5232,_0x3df9da){_0x2b5232=_0x2b5232-0x0;var _0x629131=_0x3c6d[_0x2b5232];return _0x629131;};'use strict';var Sequelize=require(_0xd3c6('0x0'));module[_0xd3c6('0x1')]={'name':{'type':Sequelize[_0xd3c6('0x2')]},'basename':{'type':Sequelize[_0xd3c6('0x2')]},'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 ba772e8..ec4f74f 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 _0x0de4=['then','error','name','send','map','Attachment','rawAttributes','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','clone','keys','find','get','createdAt','updatedAt','body','omit','destroy','create','file','originalname','basename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update'];(function(_0x203f93,_0x2afda5){var _0x361762=function(_0x124281){while(--_0x124281){_0x203f93['push'](_0x203f93['shift']());}};_0x361762(++_0x2afda5);}(_0x0de4,0x143));var _0x40de=function(_0x2cf488,_0xcde934){_0x2cf488=_0x2cf488-0x0;var _0x398f6d=_0x0de4[_0x2cf488];return _0x398f6d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x40de('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40de('0x1'));var moment=require(_0x40de('0x2'));var BPromise=require(_0x40de('0x3'));var Mustache=require(_0x40de('0x4'));var util=require(_0x40de('0x5'));var path=require('path');var sox=require(_0x40de('0x6'));var csv=require(_0x40de('0x7'));var ejs=require(_0x40de('0x8'));var fs=require('fs');var fs_extra=require(_0x40de('0x9'));var _=require(_0x40de('0xa'));var squel=require(_0x40de('0xb'));var crypto=require(_0x40de('0xc'));var jsforce=require(_0x40de('0xd'));var deskjs=require(_0x40de('0xe'));var toCsv=require('to-csv');var querystring=require(_0x40de('0xf'));var Papa=require(_0x40de('0x10'));var Redis=require(_0x40de('0x11'));var authService=require(_0x40de('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x40de('0x13'));var hardwareService=require(_0x40de('0x14'));var logger=require(_0x40de('0x15'))(_0x40de('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x40de('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cf2d8,_0x56485d){_0x56485d=_0x56485d||0xcc;return function(_0x41f989){if(_0x41f989){return _0x4cf2d8[_0x40de('0x18')](_0x56485d);}return _0x4cf2d8[_0x40de('0x19')](_0x56485d)[_0x40de('0x1a')]();};}function respondWithResult(_0x59ec84,_0x1021cf){_0x1021cf=_0x1021cf||0xc8;return function(_0xa23415){if(_0xa23415){return _0x59ec84[_0x40de('0x19')](_0x1021cf)['json'](_0xa23415);}};}function respondWithFilteredResult(_0x19f214,_0x263af9){return function(_0x2bb26d){if(_0x2bb26d){var _0x2ffbe6=typeof _0x263af9[_0x40de('0x1b')]===_0x40de('0x1c')&&typeof _0x263af9['limit']===_0x40de('0x1c');var _0x3dd259=_0x2bb26d[_0x40de('0x1d')];var _0x2ca4c4=_0x2ffbe6?0x0:_0x263af9[_0x40de('0x1b')];var _0x503d7d=_0x2ffbe6?_0x2bb26d[_0x40de('0x1d')]:_0x263af9[_0x40de('0x1b')]+_0x263af9[_0x40de('0x1e')];var _0x71dc7d;if(_0x503d7d>=_0x3dd259){_0x503d7d=_0x3dd259;_0x71dc7d=0xc8;}else{_0x71dc7d=0xce;}_0x19f214['status'](_0x71dc7d);return _0x19f214[_0x40de('0x1f')]('Content-Range',_0x2ca4c4+'-'+_0x503d7d+'/'+_0x3dd259)[_0x40de('0x20')](_0x2bb26d);}return null;};}function patchUpdates(_0x16f5a1){return function(_0x20a95f){try{jsonpatch[_0x40de('0x21')](_0x20a95f,_0x16f5a1,!![]);}catch(_0x1b551f){return BPromise[_0x40de('0x22')](_0x1b551f);}return _0x20a95f[_0x40de('0x23')]();};}function saveUpdates(_0x4ef2dc,_0x5be995){return function(_0x374d17){if(_0x374d17){return _0x374d17[_0x40de('0x24')](_0x4ef2dc)[_0x40de('0x25')](function(_0x503d85){return _0x503d85;});}return null;};}function removeEntity(_0x3787a2,_0x32286c){return function(_0x55bd74){if(_0x55bd74){return _0x55bd74['destroy']()[_0x40de('0x25')](function(){_0x3787a2[_0x40de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380e04,_0x20cd23){return function(_0x5e38bd){if(!_0x5e38bd){_0x380e04['sendStatus'](0x194);}return _0x5e38bd;};}function handleError(_0xb486eb,_0xf1be72){_0xf1be72=_0xf1be72||0x1f4;return function(_0x32ec16){logger[_0x40de('0x26')](_0x32ec16['stack']);if(_0x32ec16[_0x40de('0x27')]){delete _0x32ec16[_0x40de('0x27')];}_0xb486eb[_0x40de('0x19')](_0xf1be72)[_0x40de('0x28')](_0x32ec16);};}exports['index']=function(_0xcb72d6,_0x4d9565){var _0x4070f1={},_0x1691fa={},_0x5abb1f={'count':0x0,'rows':[]};var _0x45a375=_[_0x40de('0x29')](db[_0x40de('0x2a')][_0x40de('0x2b')],function(_0x1f3209){return{'name':_0x1f3209['fieldName'],'type':_0x1f3209['type'][_0x40de('0x2c')]};});_0x1691fa[_0x40de('0x2d')]=_[_0x40de('0x29')](_0x45a375,_0x40de('0x27'));_0x1691fa[_0x40de('0x2e')]=_['keys'](_0xcb72d6[_0x40de('0x2e')]);_0x1691fa['filters']=_[_0x40de('0x2f')](_0x1691fa['model'],_0x1691fa['query']);_0x4070f1['attributes']=_['intersection'](_0x1691fa[_0x40de('0x2d')],qs[_0x40de('0x30')](_0xcb72d6[_0x40de('0x2e')][_0x40de('0x30')]));_0x4070f1[_0x40de('0x31')]=_0x4070f1['attributes'][_0x40de('0x32')]?_0x4070f1[_0x40de('0x31')]:_0x1691fa[_0x40de('0x2d')];if(!_0xcb72d6['query'][_0x40de('0x33')]('nolimit')){_0x4070f1['limit']=qs['limit'](_0xcb72d6[_0x40de('0x2e')][_0x40de('0x1e')]);_0x4070f1[_0x40de('0x1b')]=qs[_0x40de('0x1b')](_0xcb72d6[_0x40de('0x2e')][_0x40de('0x1b')]);}_0x4070f1[_0x40de('0x34')]=qs[_0x40de('0x35')](_0xcb72d6['query'][_0x40de('0x35')]);_0x4070f1[_0x40de('0x36')]=qs[_0x40de('0x37')](_[_0x40de('0x38')](_0xcb72d6[_0x40de('0x2e')],_0x1691fa[_0x40de('0x37')]),_0x45a375);if(_0xcb72d6[_0x40de('0x2e')][_0x40de('0x39')]){_0x4070f1[_0x40de('0x36')]=_[_0x40de('0x3a')](_0x4070f1[_0x40de('0x36')],{'$or':_[_0x40de('0x29')](_0x45a375,function(_0x291ec0){if(_0x291ec0[_0x40de('0x3b')]!==_0x40de('0x3c')){var _0x44b7de={};_0x44b7de[_0x291ec0['name']]={'$like':'%'+_0xcb72d6[_0x40de('0x2e')]['filter']+'%'};return _0x44b7de;}})});}_0x4070f1=_[_0x40de('0x3a')]({},_0x4070f1,_0xcb72d6['options']);var _0x1c390c={'where':_0x4070f1[_0x40de('0x36')]};return db['Attachment'][_0x40de('0x1d')](_0x1c390c)['then'](function(_0x3d909f){_0x5abb1f[_0x40de('0x1d')]=_0x3d909f;if(_0xcb72d6[_0x40de('0x2e')][_0x40de('0x3d')]){_0x4070f1['include']=[{'all':!![]}];}return db[_0x40de('0x2a')][_0x40de('0x3e')](_0x4070f1);})[_0x40de('0x25')](function(_0x1bd6c9){_0x5abb1f[_0x40de('0x3f')]=_0x1bd6c9;return _0x5abb1f;})[_0x40de('0x25')](respondWithFilteredResult(_0x4d9565,_0x4070f1))[_0x40de('0x40')](handleError(_0x4d9565,null));};exports[_0x40de('0x41')]=function(_0x55462f,_0x231c9e){var _0x9a088e={'raw':!![],'where':{'id':_0x55462f[_0x40de('0x42')]['id']}},_0x10d18b={};_0x10d18b[_0x40de('0x2d')]=_['keys'](db[_0x40de('0x2a')][_0x40de('0x2b')]);_0x10d18b[_0x40de('0x2e')]=_['keys'](_0x55462f[_0x40de('0x2e')]);_0x10d18b['filters']=_['intersection'](_0x10d18b[_0x40de('0x2d')],_0x10d18b[_0x40de('0x2e')]);_0x9a088e['attributes']=_[_0x40de('0x2f')](_0x10d18b[_0x40de('0x2d')],qs[_0x40de('0x30')](_0x55462f['query'][_0x40de('0x30')]));_0x9a088e['attributes']=_0x9a088e[_0x40de('0x31')][_0x40de('0x32')]?_0x9a088e[_0x40de('0x31')]:_0x10d18b[_0x40de('0x2d')];if(_0x55462f['query'][_0x40de('0x3d')]){_0x9a088e[_0x40de('0x43')]=[{'all':!![]}];}_0x9a088e=_[_0x40de('0x3a')]({},_0x9a088e,_0x55462f[_0x40de('0x44')]);return db[_0x40de('0x2a')]['find'](_0x9a088e)['then'](handleEntityNotFound(_0x231c9e,null))['then'](respondWithResult(_0x231c9e,null))['catch'](handleError(_0x231c9e,null));};exports[_0x40de('0x45')]=function(_0x1bf058,_0x461d59){var _0x567de9={'where':{'id':_0x1bf058[_0x40de('0x42')]['id']}},_0x587ff5={};_0x587ff5[_0x40de('0x2d')]=_[_0x40de('0x46')](db[_0x40de('0x2a')][_0x40de('0x2b')]);_0x567de9[_0x40de('0x31')]=_[_0x40de('0x2f')](_0x587ff5[_0x40de('0x2d')],qs[_0x40de('0x30')](_0x1bf058[_0x40de('0x2e')]['fields']));_0x567de9[_0x40de('0x31')]=_0x567de9['attributes']['length']?_0x567de9['attributes']:_0x587ff5[_0x40de('0x2d')];if(_0x1bf058['query'][_0x40de('0x3d')]){_0x567de9[_0x40de('0x43')]=[{'all':!![]}];}_0x567de9=_[_0x40de('0x3a')]({},_0x567de9,_0x1bf058['options']);return db[_0x40de('0x2a')][_0x40de('0x47')](_0x567de9)[_0x40de('0x25')](handleEntityNotFound(_0x461d59,null))['then'](function(_0x558529){if(_0x558529){var _0x2e96e8=_0x558529[_0x40de('0x48')]({'plain':!![]});_0x2e96e8=qs['omit'](_0x2e96e8,['id',_0x40de('0x49'),_0x40de('0x4a')]);_0x1bf058[_0x40de('0x4b')]=_[_0x40de('0x4c')](_0x1bf058['body'],['id',_0x40de('0x49'),_0x40de('0x4a')]);return db[_0x40de('0x2a')]['create'](_[_0x40de('0x3a')](_0x2e96e8,_0x1bf058[_0x40de('0x4b')]),{'include':_0x1bf058[_0x40de('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x40de('0x25')](respondWithResult(_0x461d59,0xc9))[_0x40de('0x40')](handleError(_0x461d59,null));};exports[_0x40de('0x24')]=function(_0x37a5e4,_0x3ce2c4){if(_0x37a5e4['body']['id']){delete _0x37a5e4[_0x40de('0x4b')]['id'];}return db[_0x40de('0x2a')][_0x40de('0x47')]({'where':{'id':_0x37a5e4[_0x40de('0x42')]['id']}})[_0x40de('0x25')](handleEntityNotFound(_0x3ce2c4,null))['then'](saveUpdates(_0x37a5e4[_0x40de('0x4b')],null))[_0x40de('0x25')](respondWithResult(_0x3ce2c4,null))[_0x40de('0x40')](handleError(_0x3ce2c4,null));};exports[_0x40de('0x4d')]=function(_0x2a68e4,_0x2a2fa8){return db[_0x40de('0x2a')][_0x40de('0x47')]({'where':{'id':_0x2a68e4[_0x40de('0x42')]['id']}})[_0x40de('0x25')](handleEntityNotFound(_0x2a2fa8,null))[_0x40de('0x25')](removeEntity(_0x2a2fa8,null))[_0x40de('0x40')](handleError(_0x2a2fa8,null));};exports[_0x40de('0x4e')]=function(_0x3e0abb,_0x495228,_0xe0703){_0x3e0abb[_0x40de('0x4b')]['name']=_0x3e0abb[_0x40de('0x4f')][_0x40de('0x50')];_0x3e0abb[_0x40de('0x4b')][_0x40de('0x51')]=_0x3e0abb[_0x40de('0x4f')]['filename'];_0x3e0abb[_0x40de('0x4b')][_0x40de('0x3b')]=_0x3e0abb[_0x40de('0x4f')][_0x40de('0x52')];return db[_0x40de('0x2a')]['create'](_0x3e0abb[_0x40de('0x4b')])[_0x40de('0x25')](respondWithResult(_0x495228,0xc9))['catch'](handleError(_0x495228,null));};exports['download']=function(_0x5cf1f0,_0x7ba15,_0x513752){return db['Attachment'][_0x40de('0x53')]({'where':{'id':_0x5cf1f0[_0x40de('0x42')]['id']},'raw':!![]})[_0x40de('0x25')](handleEntityNotFound(_0x7ba15,null))[_0x40de('0x25')](function(_0x558bf9){if(_0x558bf9){var _0x589d61=_0x558bf9[_0x40de('0x54')]!==null;var _0x3d0f3a=path[_0x40de('0x55')](config[_0x40de('0x56')],_0x40de('0x57'));if(_0x589d61){_0x3d0f3a=path['join'](_0x3d0f3a,_0x40de('0x58'));}var _0x5e009b=path[_0x40de('0x55')](_0x3d0f3a,_0x558bf9[_0x40de('0x51')]);return _0x7ba15[_0x40de('0x59')](_0x5e009b);}})[_0x40de('0x40')](handleError(_0x7ba15,null));}; \ No newline at end of file +var _0x4f85=['include','options','clone','find','get','omit','createdAt','body','create','file','originalname','mimetype','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','error','name','send','index','map','Attachment','rawAttributes','type','model','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','then','includeAll','findAll','rows','catch','show','params'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x4f85,0x17b));var _0x54f8=function(_0x326773,_0x29d4e3){_0x326773=_0x326773-0x0;var _0x2c7c8f=_0x4f85[_0x326773];return _0x2c7c8f;};'use strict';var emlformat=require(_0x54f8('0x0'));var rimraf=require(_0x54f8('0x1'));var zipdir=require(_0x54f8('0x2'));var jsonpatch=require(_0x54f8('0x3'));var rp=require(_0x54f8('0x4'));var moment=require('moment');var BPromise=require(_0x54f8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x54f8('0x6'));var sox=require(_0x54f8('0x7'));var csv=require(_0x54f8('0x8'));var ejs=require(_0x54f8('0x9'));var fs=require('fs');var fs_extra=require(_0x54f8('0xa'));var _=require(_0x54f8('0xb'));var squel=require(_0x54f8('0xc'));var crypto=require(_0x54f8('0xd'));var jsforce=require(_0x54f8('0xe'));var deskjs=require(_0x54f8('0xf'));var toCsv=require(_0x54f8('0x8'));var querystring=require(_0x54f8('0x10'));var Papa=require('papaparse');var Redis=require(_0x54f8('0x11'));var authService=require(_0x54f8('0x12'));var qs=require(_0x54f8('0x13'));var as=require(_0x54f8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54f8('0x15'))(_0x54f8('0x16'));var utils=require(_0x54f8('0x17'));var config=require(_0x54f8('0x18'));var licenseUtil=require(_0x54f8('0x19'));var db=require(_0x54f8('0x1a'))['db'];function respondWithStatusCode(_0x471bb3,_0x190d19){_0x190d19=_0x190d19||0xcc;return function(_0x2319a5){if(_0x2319a5){return _0x471bb3[_0x54f8('0x1b')](_0x190d19);}return _0x471bb3[_0x54f8('0x1c')](_0x190d19)['end']();};}function respondWithResult(_0x2bb0cb,_0x431cad){_0x431cad=_0x431cad||0xc8;return function(_0x5d9b9a){if(_0x5d9b9a){return _0x2bb0cb[_0x54f8('0x1c')](_0x431cad)['json'](_0x5d9b9a);}};}function respondWithFilteredResult(_0x58a977,_0x285ba5){return function(_0x16b9fe){if(_0x16b9fe){var _0x76a7d=typeof _0x285ba5[_0x54f8('0x1d')]===_0x54f8('0x1e')&&typeof _0x285ba5[_0x54f8('0x1f')]===_0x54f8('0x1e');var _0x2ea9cd=_0x16b9fe[_0x54f8('0x20')];var _0x37ed70=_0x76a7d?0x0:_0x285ba5['offset'];var _0x560e8b=_0x76a7d?_0x16b9fe[_0x54f8('0x20')]:_0x285ba5['offset']+_0x285ba5[_0x54f8('0x1f')];var _0x3f80af;if(_0x560e8b>=_0x2ea9cd){_0x560e8b=_0x2ea9cd;_0x3f80af=0xc8;}else{_0x3f80af=0xce;}_0x58a977[_0x54f8('0x1c')](_0x3f80af);return _0x58a977['set'](_0x54f8('0x21'),_0x37ed70+'-'+_0x560e8b+'/'+_0x2ea9cd)['json'](_0x16b9fe);}return null;};}function patchUpdates(_0x4175d3){return function(_0x100a8c){try{jsonpatch[_0x54f8('0x22')](_0x100a8c,_0x4175d3,!![]);}catch(_0x2a4601){return BPromise[_0x54f8('0x23')](_0x2a4601);}return _0x100a8c[_0x54f8('0x24')]();};}function saveUpdates(_0x340366,_0x13ce0b){return function(_0x314c5c){if(_0x314c5c){return _0x314c5c[_0x54f8('0x25')](_0x340366)['then'](function(_0x570739){return _0x570739;});}return null;};}function removeEntity(_0xece745,_0x7b99c2){return function(_0x737dee){if(_0x737dee){return _0x737dee[_0x54f8('0x26')]()['then'](function(){_0xece745['status'](0xcc)[_0x54f8('0x27')]();});}};}function handleEntityNotFound(_0x2107d4,_0x39dd5d){return function(_0x5ec2e3){if(!_0x5ec2e3){_0x2107d4['sendStatus'](0x194);}return _0x5ec2e3;};}function handleError(_0x3a663c,_0x2b08f2){_0x2b08f2=_0x2b08f2||0x1f4;return function(_0x50f51b){logger[_0x54f8('0x28')](_0x50f51b['stack']);if(_0x50f51b[_0x54f8('0x29')]){delete _0x50f51b[_0x54f8('0x29')];}_0x3a663c[_0x54f8('0x1c')](_0x2b08f2)[_0x54f8('0x2a')](_0x50f51b);};}exports[_0x54f8('0x2b')]=function(_0x500e6c,_0x50bf0c){var _0xf99838={},_0x205162={},_0x5a0545={'count':0x0,'rows':[]};var _0x34cd83=_[_0x54f8('0x2c')](db[_0x54f8('0x2d')][_0x54f8('0x2e')],function(_0x4bd1f7){return{'name':_0x4bd1f7['fieldName'],'type':_0x4bd1f7[_0x54f8('0x2f')]['key']};});_0x205162[_0x54f8('0x30')]=_[_0x54f8('0x2c')](_0x34cd83,_0x54f8('0x29'));_0x205162['query']=_[_0x54f8('0x31')](_0x500e6c['query']);_0x205162[_0x54f8('0x32')]=_['intersection'](_0x205162[_0x54f8('0x30')],_0x205162['query']);_0xf99838[_0x54f8('0x33')]=_[_0x54f8('0x34')](_0x205162[_0x54f8('0x30')],qs[_0x54f8('0x35')](_0x500e6c[_0x54f8('0x36')]['fields']));_0xf99838[_0x54f8('0x33')]=_0xf99838[_0x54f8('0x33')][_0x54f8('0x37')]?_0xf99838['attributes']:_0x205162['model'];if(!_0x500e6c[_0x54f8('0x36')][_0x54f8('0x38')](_0x54f8('0x39'))){_0xf99838[_0x54f8('0x1f')]=qs[_0x54f8('0x1f')](_0x500e6c['query']['limit']);_0xf99838['offset']=qs[_0x54f8('0x1d')](_0x500e6c[_0x54f8('0x36')][_0x54f8('0x1d')]);}_0xf99838[_0x54f8('0x3a')]=qs[_0x54f8('0x3b')](_0x500e6c[_0x54f8('0x36')]['sort']);_0xf99838[_0x54f8('0x3c')]=qs['filters'](_[_0x54f8('0x3d')](_0x500e6c[_0x54f8('0x36')],_0x205162[_0x54f8('0x32')]),_0x34cd83);if(_0x500e6c['query'][_0x54f8('0x3e')]){_0xf99838[_0x54f8('0x3c')]=_[_0x54f8('0x3f')](_0xf99838[_0x54f8('0x3c')],{'$or':_[_0x54f8('0x2c')](_0x34cd83,function(_0x4b8416){if(_0x4b8416[_0x54f8('0x2f')]!=='VIRTUAL'){var _0x1e9dda={};_0x1e9dda[_0x4b8416[_0x54f8('0x29')]]={'$like':'%'+_0x500e6c[_0x54f8('0x36')][_0x54f8('0x3e')]+'%'};return _0x1e9dda;}})});}_0xf99838=_[_0x54f8('0x3f')]({},_0xf99838,_0x500e6c['options']);var _0x48e594={'where':_0xf99838['where']};return db[_0x54f8('0x2d')][_0x54f8('0x20')](_0x48e594)[_0x54f8('0x40')](function(_0x5a1d14){_0x5a0545[_0x54f8('0x20')]=_0x5a1d14;if(_0x500e6c[_0x54f8('0x36')][_0x54f8('0x41')]){_0xf99838['include']=[{'all':!![]}];}return db[_0x54f8('0x2d')][_0x54f8('0x42')](_0xf99838);})[_0x54f8('0x40')](function(_0x1bf7a2){_0x5a0545[_0x54f8('0x43')]=_0x1bf7a2;return _0x5a0545;})[_0x54f8('0x40')](respondWithFilteredResult(_0x50bf0c,_0xf99838))[_0x54f8('0x44')](handleError(_0x50bf0c,null));};exports[_0x54f8('0x45')]=function(_0x1cc787,_0x50118d){var _0x35cb8b={'raw':!![],'where':{'id':_0x1cc787[_0x54f8('0x46')]['id']}},_0x2d1853={};_0x2d1853['model']=_[_0x54f8('0x31')](db['Attachment'][_0x54f8('0x2e')]);_0x2d1853['query']=_['keys'](_0x1cc787['query']);_0x2d1853['filters']=_[_0x54f8('0x34')](_0x2d1853[_0x54f8('0x30')],_0x2d1853[_0x54f8('0x36')]);_0x35cb8b['attributes']=_['intersection'](_0x2d1853[_0x54f8('0x30')],qs[_0x54f8('0x35')](_0x1cc787['query']['fields']));_0x35cb8b[_0x54f8('0x33')]=_0x35cb8b[_0x54f8('0x33')][_0x54f8('0x37')]?_0x35cb8b[_0x54f8('0x33')]:_0x2d1853[_0x54f8('0x30')];if(_0x1cc787['query'][_0x54f8('0x41')]){_0x35cb8b[_0x54f8('0x47')]=[{'all':!![]}];}_0x35cb8b=_['merge']({},_0x35cb8b,_0x1cc787[_0x54f8('0x48')]);return db[_0x54f8('0x2d')]['find'](_0x35cb8b)['then'](handleEntityNotFound(_0x50118d,null))[_0x54f8('0x40')](respondWithResult(_0x50118d,null))[_0x54f8('0x44')](handleError(_0x50118d,null));};exports[_0x54f8('0x49')]=function(_0x155bba,_0x4a66be){var _0x2516f0={'where':{'id':_0x155bba[_0x54f8('0x46')]['id']}},_0x2d0174={};_0x2d0174['model']=_[_0x54f8('0x31')](db[_0x54f8('0x2d')][_0x54f8('0x2e')]);_0x2516f0[_0x54f8('0x33')]=_['intersection'](_0x2d0174[_0x54f8('0x30')],qs[_0x54f8('0x35')](_0x155bba['query']['fields']));_0x2516f0[_0x54f8('0x33')]=_0x2516f0[_0x54f8('0x33')]['length']?_0x2516f0['attributes']:_0x2d0174[_0x54f8('0x30')];if(_0x155bba[_0x54f8('0x36')][_0x54f8('0x41')]){_0x2516f0['include']=[{'all':!![]}];}_0x2516f0=_['merge']({},_0x2516f0,_0x155bba[_0x54f8('0x48')]);return db['Attachment'][_0x54f8('0x4a')](_0x2516f0)[_0x54f8('0x40')](handleEntityNotFound(_0x4a66be,null))[_0x54f8('0x40')](function(_0x4322a3){if(_0x4322a3){var _0x59c693=_0x4322a3[_0x54f8('0x4b')]({'plain':!![]});_0x59c693=qs[_0x54f8('0x4c')](_0x59c693,['id',_0x54f8('0x4d'),'updatedAt']);_0x155bba[_0x54f8('0x4e')]=_[_0x54f8('0x4c')](_0x155bba[_0x54f8('0x4e')],['id',_0x54f8('0x4d'),'updatedAt']);return db[_0x54f8('0x2d')][_0x54f8('0x4f')](_[_0x54f8('0x3f')](_0x59c693,_0x155bba[_0x54f8('0x4e')]),{'include':_0x155bba[_0x54f8('0x36')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x54f8('0x40')](respondWithResult(_0x4a66be,0xc9))[_0x54f8('0x44')](handleError(_0x4a66be,null));};exports[_0x54f8('0x25')]=function(_0x22f008,_0x124656){if(_0x22f008[_0x54f8('0x4e')]['id']){delete _0x22f008[_0x54f8('0x4e')]['id'];}return db[_0x54f8('0x2d')]['find']({'where':{'id':_0x22f008[_0x54f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x124656,null))[_0x54f8('0x40')](saveUpdates(_0x22f008['body'],null))[_0x54f8('0x40')](respondWithResult(_0x124656,null))[_0x54f8('0x44')](handleError(_0x124656,null));};exports['destroy']=function(_0x3ab250,_0x2f121b){return db[_0x54f8('0x2d')]['find']({'where':{'id':_0x3ab250[_0x54f8('0x46')]['id']}})[_0x54f8('0x40')](handleEntityNotFound(_0x2f121b,null))[_0x54f8('0x40')](removeEntity(_0x2f121b,null))[_0x54f8('0x44')](handleError(_0x2f121b,null));};exports[_0x54f8('0x4f')]=function(_0x32cdde,_0x4d48e8,_0x2c815e){_0x32cdde[_0x54f8('0x4e')][_0x54f8('0x29')]=_0x32cdde[_0x54f8('0x50')][_0x54f8('0x51')];_0x32cdde['body']['basename']=_0x32cdde[_0x54f8('0x50')]['filename'];_0x32cdde[_0x54f8('0x4e')][_0x54f8('0x2f')]=_0x32cdde[_0x54f8('0x50')][_0x54f8('0x52')];return db[_0x54f8('0x2d')][_0x54f8('0x4f')](_0x32cdde[_0x54f8('0x4e')])[_0x54f8('0x40')](respondWithResult(_0x4d48e8,0xc9))[_0x54f8('0x44')](handleError(_0x4d48e8,null));};exports['download']=function(_0x591bf5,_0x2769d3,_0x424f8a){return db['Attachment']['findOne']({'where':{'id':_0x591bf5[_0x54f8('0x46')]['id']},'raw':!![]})[_0x54f8('0x40')](handleEntityNotFound(_0x2769d3,null))['then'](function(_0x260c85){if(_0x260c85){var _0x6799c3=_0x260c85[_0x54f8('0x53')]!==null;var _0x231c03=path[_0x54f8('0x54')](config[_0x54f8('0x55')],_0x54f8('0x56'));if(_0x6799c3){_0x231c03=path[_0x54f8('0x54')](_0x231c03,_0x54f8('0x57'));}var _0x21eec9=path[_0x54f8('0x54')](_0x231c03,_0x260c85[_0x54f8('0x58')]);return _0x2769d3[_0x54f8('0x59')](_0x21eec9);}})[_0x54f8('0x44')](handleError(_0x2769d3,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7d6ac36..a79e35d 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 _0x4da8=['api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0x4da8,0x196));var _0x84da=function(_0x2100e1,_0x501e1c){_0x2100e1=_0x2100e1-0x0;var _0x59fb88=_0x4da8[_0x2100e1];return _0x59fb88;};'use strict';var _=require(_0x84da('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x84da('0x1'));var moment=require('moment');var BPromise=require(_0x84da('0x2'));var rp=require(_0x84da('0x3'));var fs=require('fs');var path=require(_0x84da('0x4'));var rimraf=require(_0x84da('0x5'));var config=require(_0x84da('0x6'));var attributes=require(_0x84da('0x7'));module['exports']=function(_0x4bde6,_0x50d17d){return _0x4bde6[_0x84da('0x8')](_0x84da('0x9'),attributes,{'tableName':_0x84da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5226=['rimraf','./attachment.attributes','Attachment','attachments','api','moment','bluebird','request-promise'];(function(_0x442f9f,_0x15b4f1){var _0x75e854=function(_0x3281d0){while(--_0x3281d0){_0x442f9f['push'](_0x442f9f['shift']());}};_0x75e854(++_0x15b4f1);}(_0x5226,0xdc));var _0x6522=function(_0x20c7bd,_0x1e4100){_0x20c7bd=_0x20c7bd-0x0;var _0x444194=_0x5226[_0x20c7bd];return _0x444194;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6522('0x0'));var moment=require(_0x6522('0x1'));var BPromise=require(_0x6522('0x2'));var rp=require(_0x6522('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6522('0x4'));var config=require('../../config/environment');var attributes=require(_0x6522('0x5'));module['exports']=function(_0x146c8b,_0x1a703d){return _0x146c8b['define'](_0x6522('0x6'),attributes,{'tableName':_0x6522('0x7'),'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 bdb3f73..61a4312 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 _0xca66=['body','options','raw','CreateAttachment','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','Attachment','create'];(function(_0x2eaa96,_0x1c0a50){var _0x59030d=function(_0x37d0f6){while(--_0x37d0f6){_0x2eaa96['push'](_0x2eaa96['shift']());}};_0x59030d(++_0x1c0a50);}(_0xca66,0x8b));var _0x6ca6=function(_0x28e50f,_0x5b39de){_0x28e50f=_0x28e50f-0x0;var _0x22b9fd=_0xca66[_0x28e50f];return _0x22b9fd;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ca6('0x1'));var rs=require(_0x6ca6('0x2'));var fs=require('fs');var Redis=require(_0x6ca6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ca6('0x4'));var logger=require('../../config/logger')(_0x6ca6('0x5'));var config=require('../../config/environment');var jayson=require(_0x6ca6('0x6'));var client=jayson[_0x6ca6('0x7')][_0x6ca6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44019c,_0x407e66,_0x27a210){return new BPromise(function(_0x27d280,_0x4f5651){return client[_0x6ca6('0x9')](_0x44019c,_0x27a210)[_0x6ca6('0xa')](function(_0x34b71b){logger[_0x6ca6('0xb')](_0x6ca6('0xc'),_0x407e66,_0x6ca6('0xd'));logger[_0x6ca6('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x407e66,_0x6ca6('0xd'),JSON[_0x6ca6('0xf')](_0x34b71b));if(_0x34b71b[_0x6ca6('0x10')]){if(_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x11')]===0x1f4){logger[_0x6ca6('0x10')]('Attachment,\x20%s,\x20%s',_0x407e66,_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x12')]);return _0x4f5651(_0x34b71b['error'][_0x6ca6('0x12')]);}logger[_0x6ca6('0x10')](_0x6ca6('0xc'),_0x407e66,_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x12')]);return _0x27d280(_0x34b71b[_0x6ca6('0x10')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x407e66,_0x6ca6('0xd'));_0x27d280(_0x34b71b[_0x6ca6('0x13')][_0x6ca6('0x12')]);}})[_0x6ca6('0x14')](function(_0x2c4a5c){logger[_0x6ca6('0x10')](_0x6ca6('0xc'),_0x407e66,_0x2c4a5c);_0x4f5651(_0x2c4a5c);});});}exports['CreateAttachment']=function(_0x2391ce){var _0x10be57=this;return new Promise(function(_0xc97f0,_0x1f21ff){return db[_0x6ca6('0x15')][_0x6ca6('0x16')](_0x2391ce[_0x6ca6('0x17')],{'raw':_0x2391ce[_0x6ca6('0x18')]?_0x2391ce[_0x6ca6('0x18')][_0x6ca6('0x19')]===undefined?!![]:![]:!![]})[_0x6ca6('0xa')](function(_0x4c3be9){logger[_0x6ca6('0xb')](_0x6ca6('0x1a'),_0x2391ce);logger[_0x6ca6('0xe')](_0x6ca6('0x1a'),_0x2391ce,JSON[_0x6ca6('0xf')](_0x4c3be9));_0xc97f0(_0x4c3be9);})[_0x6ca6('0x14')](function(_0x593f15){logger[_0x6ca6('0x10')](_0x6ca6('0x1a'),_0x593f15['message'],_0x2391ce);_0x1f21ff(_0x10be57['error'](0x1f4,_0x593f15[_0x6ca6('0x12')]));});});}; \ No newline at end of file +var _0xb43b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','create','body','options','info','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0xb43b,0xbf));var _0xbb43=function(_0x4e7db0,_0x18d606){_0x4e7db0=_0x4e7db0-0x0;var _0xe8b25=_0xb43b[_0x4e7db0];return _0xe8b25;};'use strict';var _=require(_0xbb43('0x0'));var util=require('util');var moment=require(_0xbb43('0x1'));var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require(_0xbb43('0x5'))['db'];var utils=require(_0xbb43('0x6'));var logger=require(_0xbb43('0x7'))(_0xbb43('0x8'));var config=require(_0xbb43('0x9'));var jayson=require(_0xbb43('0xa'));var client=jayson[_0xbb43('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16fc1c,_0x4a070c,_0x54806a){return new BPromise(function(_0x33f9a8,_0x120d67){return client[_0xbb43('0xc')](_0x16fc1c,_0x54806a)[_0xbb43('0xd')](function(_0x117f4d){logger['info'](_0xbb43('0xe'),_0x4a070c,_0xbb43('0xf'));logger[_0xbb43('0x10')](_0xbb43('0x11'),_0x4a070c,'request\x20sent',JSON[_0xbb43('0x12')](_0x117f4d));if(_0x117f4d[_0xbb43('0x13')]){if(_0x117f4d['error']['code']===0x1f4){logger['error'](_0xbb43('0xe'),_0x4a070c,_0x117f4d['error'][_0xbb43('0x14')]);return _0x120d67(_0x117f4d['error'][_0xbb43('0x14')]);}logger[_0xbb43('0x13')](_0xbb43('0xe'),_0x4a070c,_0x117f4d[_0xbb43('0x13')][_0xbb43('0x14')]);return _0x33f9a8(_0x117f4d['error'][_0xbb43('0x14')]);}else{logger['info'](_0xbb43('0xe'),_0x4a070c,_0xbb43('0xf'));_0x33f9a8(_0x117f4d[_0xbb43('0x15')][_0xbb43('0x14')]);}})[_0xbb43('0x16')](function(_0x126f61){logger[_0xbb43('0x13')](_0xbb43('0xe'),_0x4a070c,_0x126f61);_0x120d67(_0x126f61);});});}exports[_0xbb43('0x17')]=function(_0x4c223b){var _0xe15a1b=this;return new Promise(function(_0x4cb0b2,_0x78df91){return db['Attachment'][_0xbb43('0x18')](_0x4c223b[_0xbb43('0x19')],{'raw':_0x4c223b[_0xbb43('0x1a')]?_0x4c223b[_0xbb43('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xbb43('0xd')](function(_0x6cdc26){logger[_0xbb43('0x1b')](_0xbb43('0x17'),_0x4c223b);logger[_0xbb43('0x10')](_0xbb43('0x17'),_0x4c223b,JSON[_0xbb43('0x12')](_0x6cdc26));_0x4cb0b2(_0x6cdc26);})[_0xbb43('0x16')](function(_0x3409d0){logger[_0xbb43('0x13')](_0xbb43('0x17'),_0x3409d0[_0xbb43('0x14')],_0x4c223b);_0x78df91(_0xe15a1b[_0xbb43('0x13')](0x1f4,_0x3409d0[_0xbb43('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d434b02..0efcb07 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x475483,_0x5bf2f8){var _0x33d1da=function(_0x4cba47){while(--_0x4cba47){_0x475483['push'](_0x475483['shift']());}};_0x33d1da(++_0x5bf2f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x4efd3d,_0x2b9694){_0x4efd3d=_0x4efd3d-0x0;var _0x1293f2=_0xb10b[_0x4efd3d];return _0x1293f2;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 8d15f6f..01ffdb7 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 _0x48ad=['salt','role','disabled','blocked','blockedAt','online','admin','user','agent','name','add','blockDuration','clearBlockUser','getLicense','status','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','passport','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x48ad,0xe5));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0xd48a('0x0'));var LocalStrategy=require('passport-local')[_0xd48a('0x1')];var moment=require(_0xd48a('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xd48a('0x3'));var util=require(_0xd48a('0x4'));var db=require(_0xd48a('0x5'))['db'];var authService=require(_0xd48a('0x6'));var utils=require('../../config/utils');var config=require(_0xd48a('0x7'));var logger=require(_0xd48a('0x8'))('api');function isActiveDirectoryConfigured(_0x337e41){var _0x3ee6fe=![];if(typeof _0x337e41[_0xd48a('0x9')]!==_0xd48a('0xa')){_0x3ee6fe=_0x337e41[_0xd48a('0x9')][_0xd48a('0xb')]&&_0x337e41['activedirectory'][_0xd48a('0xc')]&&_0x337e41[_0xd48a('0x9')][_0xd48a('0xd')];}return _0x3ee6fe;}function adAuthenticate(_0x395885,_0x1b6e36,_0x215741){return new BPromise(function(_0x6a1ae7,_0x48987d){try{var _0x198fd5=new ActiveDirectory(_0x395885);_0x198fd5['authenticate'](_0x1b6e36,_0x215741,function(_0x3bf4eb,_0x1ffe37){if(_0x3bf4eb){logger[_0xd48a('0xe')](_0xd48a('0xf'),_0x1b6e36,util['inspect'](_0x3bf4eb,{'showHidden':![],'depth':null}));_0x48987d(_0xd48a('0x10'));}else if(!_0x1ffe37){logger[_0xd48a('0xe')](_0xd48a('0x11'),_0x1b6e36);_0x48987d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x6a1ae7(_0x1ffe37);}});}catch(_0x55da2e){_0x48987d(_0x55da2e);}});}function ActiveDirectoryAuthenticate(_0x9f8391,_0x171b68,_0x35c317,_0x590333){var _0x5a8893,_0x3a4534;if(!isActiveDirectoryConfigured(config)){logger[_0xd48a('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x171b68);return _0x590333(null,![],{'message':_0xd48a('0x10')});}return db['Setting'][_0xd48a('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xd48a('0x13')](function(_0x3df730){_0x5a8893=_0x3df730;if(!_0x5a8893[_0xd48a('0x14')]){logger[_0xd48a('0xe')](_0xd48a('0x15'),_0x171b68);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x9f8391['findOne']({'attributes':['id','name',_0xd48a('0x16'),_0xd48a('0x17'),_0xd48a('0x18'),_0xd48a('0x19'),_0xd48a('0x1a'),_0xd48a('0x1b'),_0xd48a('0x1c')],'where':{'name':_0x171b68,'role':{'$or':[_0xd48a('0x1d'),_0xd48a('0x1e'),_0xd48a('0x1f')]},'adSsoEnabled':!![]}});})['then'](function(_0x26b136){if(!_0x26b136||_0x26b136&&_0x26b136[_0xd48a('0x20')]!==_0x171b68){throw new Error(_0xd48a('0x10'));}_0x3a4534=_0x26b136;var _0x1564fa=_0x3a4534[_0xd48a('0x20')]+'@'+config[_0xd48a('0x9')]['domain'];return adAuthenticate(config[_0xd48a('0x9')],_0x1564fa,_0x35c317);})[_0xd48a('0x13')](function(_0x411062){if(_0x3a4534['disabled']){throw new Error(_0xd48a('0x10'));}if(_0x5a8893['blockDuration']>0x0){if(_0x3a4534['blocked']){if(moment(_0x3a4534[_0xd48a('0x1b')])[_0xd48a('0x21')](_0x5a8893[_0xd48a('0x22')],'minutes')>moment()){throw new Error(_0xd48a('0x10'));}return utils[_0xd48a('0x23')](_0x3a4534,0x0,![],null)[_0xd48a('0x13')](function(){return utils[_0xd48a('0x24')](_0x3a4534);})[_0xd48a('0x13')](function(){return _0x590333(null,_0x3a4534);});}else{return utils[_0xd48a('0x24')](_0x3a4534)[_0xd48a('0x13')](function(){return _0x590333(null,_0x3a4534);});}}else{return utils['getLicense'](_0x3a4534)['then'](function(){return _0x590333(null,_0x3a4534);});}})['catch'](function(_0x2fa9f7){return _0x590333(null,![],_0x2fa9f7);});}function handleError(_0x12bc16,_0x26d6d5,_0x5509de){return _0x12bc16[_0xd48a('0x25')](_0x26d6d5||0x1f4)['send']({'message':_0x5509de?_0x5509de[_0xd48a('0x26')]||_0x5509de:''});}exports['login']=function(_0x5f0219,_0x32a52b,_0x5b7a91){passport['authenticate'](_0xd48a('0x27'),function(_0x143bd8,_0x25f8d8,_0x2be1e7){var _0x397d7d=_0x143bd8||_0x2be1e7;if(_0x397d7d){return handleError(_0x32a52b,0x191,_0x397d7d);}if(!_0x25f8d8){return handleError(_0x32a52b,0x194,{'message':_0xd48a('0x28')});}else{var _0x2fc3d8={'payload':{'id':_0x25f8d8['id'],'role':_0x25f8d8[_0xd48a('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0xd48a('0x29')](_0x2fc3d8)['then'](function(_0x4e196d){_0x32a52b['json']({'id':_0x25f8d8['id'],'token':_0x4e196d,'statusCall':'','isAlreadyLogged':_0x25f8d8[_0xd48a('0x1c')]});});}})(_0x5f0219,_0x32a52b,_0x5b7a91);};passport['use']('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0xd48a('0x16')},function(_0x166790,_0x88913e,_0x5b5e1c){return ActiveDirectoryAuthenticate(db['User'],_0x166790,_0x88913e,_0x5b5e1c);})); \ No newline at end of file +var _0xe924=['baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','name','password','salt','role','blocked','blockedAt','user','agent','disabled','minutes','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','api','undefined','activedirectory'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0xe924,0xf8));var _0x4e92=function(_0x2016d4,_0x156c10){_0x2016d4=_0x2016d4-0x0;var _0x231d7f=_0xe924[_0x2016d4];return _0x231d7f;};'use strict';var passport=require(_0x4e92('0x0'));var LocalStrategy=require(_0x4e92('0x1'))['Strategy'];var moment=require(_0x4e92('0x2'));var ActiveDirectory=require(_0x4e92('0x3'));var BPromise=require(_0x4e92('0x4'));var util=require(_0x4e92('0x5'));var db=require(_0x4e92('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x4e92('0x7'));function isActiveDirectoryConfigured(_0x361d96){var _0x57c714=![];if(typeof _0x361d96['activedirectory']!==_0x4e92('0x8')){_0x57c714=_0x361d96[_0x4e92('0x9')][_0x4e92('0xa')]&&_0x361d96[_0x4e92('0x9')]['url']&&_0x361d96['activedirectory'][_0x4e92('0xb')];}return _0x57c714;}function adAuthenticate(_0x356172,_0x360128,_0x122204){return new BPromise(function(_0x2f7ee7,_0x5d0761){try{var _0x16f051=new ActiveDirectory(_0x356172);_0x16f051[_0x4e92('0xc')](_0x360128,_0x122204,function(_0x3eeb47,_0x4480d9){if(_0x3eeb47){logger[_0x4e92('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x360128,util['inspect'](_0x3eeb47,{'showHidden':![],'depth':null}));_0x5d0761('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x4480d9){logger[_0x4e92('0xd')](_0x4e92('0xe'),_0x360128);_0x5d0761(_0x4e92('0xf'));}else{_0x2f7ee7(_0x4480d9);}});}catch(_0x241cf8){_0x5d0761(_0x241cf8);}});}function ActiveDirectoryAuthenticate(_0x574e2d,_0x3bd9f1,_0x2f0383,_0x2dcc3f){var _0x19d103,_0x3934eb;if(!isActiveDirectoryConfigured(config)){logger[_0x4e92('0xd')](_0x4e92('0x10'),_0x3bd9f1);return _0x2dcc3f(null,![],{'message':_0x4e92('0xf')});}return db[_0x4e92('0x11')][_0x4e92('0x12')]({'where':{'id':0x1},'attributes':[_0x4e92('0x13'),_0x4e92('0x14')],'raw':!![]})[_0x4e92('0x15')](function(_0x2372ca){_0x19d103=_0x2372ca;if(!_0x19d103['adSsoEnabled']){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x3bd9f1);throw new Error(_0x4e92('0xf'));}return _0x574e2d['findOne']({'attributes':['id',_0x4e92('0x16'),_0x4e92('0x17'),_0x4e92('0x18'),_0x4e92('0x19'),'disabled',_0x4e92('0x1a'),_0x4e92('0x1b'),'online'],'where':{'name':_0x3bd9f1,'role':{'$or':['admin',_0x4e92('0x1c'),_0x4e92('0x1d')]},'adSsoEnabled':!![]}});})['then'](function(_0x32d8c5){if(!_0x32d8c5||_0x32d8c5&&_0x32d8c5['name']!==_0x3bd9f1){throw new Error(_0x4e92('0xf'));}_0x3934eb=_0x32d8c5;var _0x21b839=_0x3934eb[_0x4e92('0x16')]+'@'+config[_0x4e92('0x9')][_0x4e92('0xb')];return adAuthenticate(config['activedirectory'],_0x21b839,_0x2f0383);})[_0x4e92('0x15')](function(_0x472f31){if(_0x3934eb[_0x4e92('0x1e')]){throw new Error(_0x4e92('0xf'));}if(_0x19d103[_0x4e92('0x14')]>0x0){if(_0x3934eb[_0x4e92('0x1a')]){if(moment(_0x3934eb[_0x4e92('0x1b')])['add'](_0x19d103[_0x4e92('0x14')],_0x4e92('0x1f'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x3934eb,0x0,![],null)['then'](function(){return utils[_0x4e92('0x20')](_0x3934eb);})[_0x4e92('0x15')](function(){return _0x2dcc3f(null,_0x3934eb);});}else{return utils['getLicense'](_0x3934eb)[_0x4e92('0x15')](function(){return _0x2dcc3f(null,_0x3934eb);});}}else{return utils[_0x4e92('0x20')](_0x3934eb)[_0x4e92('0x15')](function(){return _0x2dcc3f(null,_0x3934eb);});}})[_0x4e92('0x21')](function(_0xa8cf0a){return _0x2dcc3f(null,![],_0xa8cf0a);});}function handleError(_0x542aef,_0x3b3492,_0x307f96){return _0x542aef['status'](_0x3b3492||0x1f4)[_0x4e92('0x22')]({'message':_0x307f96?_0x307f96[_0x4e92('0x23')]||_0x307f96:''});}exports[_0x4e92('0x24')]=function(_0xcbb36d,_0x2b323e,_0x4edfb2){passport[_0x4e92('0xc')](_0x4e92('0x25'),function(_0x4e61d3,_0x1b550b,_0x4e31b6){var _0x220e4b=_0x4e61d3||_0x4e31b6;if(_0x220e4b){return handleError(_0x2b323e,0x191,_0x220e4b);}if(!_0x1b550b){return handleError(_0x2b323e,0x194,{'message':_0x4e92('0x26')});}else{var _0x55790b={'payload':{'id':_0x1b550b['id'],'role':_0x1b550b['role']},'options':{'expiresIn':0x15180}};return authService[_0x4e92('0x27')](_0x55790b)[_0x4e92('0x15')](function(_0x27f0b3){_0x2b323e[_0x4e92('0x28')]({'id':_0x1b550b['id'],'token':_0x27f0b3,'statusCall':'','isAlreadyLogged':_0x1b550b['online']});});}})(_0xcbb36d,_0x2b323e,_0x4edfb2);};passport[_0x4e92('0x29')](_0x4e92('0x25'),new LocalStrategy({'usernameField':_0x4e92('0x16'),'passwordField':'password'},function(_0x549bff,_0x3bdfa6,_0xcb36f){return ActiveDirectoryAuthenticate(db[_0x4e92('0x2a')],_0x549bff,_0x3bdfa6,_0xcb36f);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index fe93af9..f7ed850 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 _0x1596=['./authActiveDirectory.controller','post','login','exports','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1596,0x90));var _0x6159=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1596[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0x6159('0x0')]();var controller=require(_0x6159('0x1'));router[_0x6159('0x2')]('/',controller[_0x6159('0x3')]);module[_0x6159('0x4')]=router; \ No newline at end of file +var _0x82ee=['express','./authActiveDirectory.controller','post','login','exports'];(function(_0xa1adac,_0x3a915b){var _0x39c920=function(_0x2a000e){while(--_0x2a000e){_0xa1adac['push'](_0xa1adac['shift']());}};_0x39c920(++_0x3a915b);}(_0x82ee,0x159));var _0xe82e=function(_0x292a11,_0x259737){_0x292a11=_0x292a11-0x0;var _0x30937f=_0x82ee[_0x292a11];return _0x30937f;};'use strict';var express=require(_0xe82e('0x0'));var router=express['Router']();var controller=require(_0xe82e('0x1'));router[_0xe82e('0x2')]('/',controller[_0xe82e('0x3')]);module[_0xe82e('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 32494a8..3addbcc 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x7a54,0x106));var _0x47a5=function(_0x9e42dc,_0x219749){_0x9e42dc=_0x9e42dc-0x0;var _0x48766d=_0x7a54[_0x9e42dc];return _0x48766d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x7a54,0x106));var _0x47a5=function(_0x68da62,_0x39acda){_0x68da62=_0x68da62-0x0;var _0x46630e=_0x7a54[_0x68da62];return _0x46630e;};'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 242156b..d291568 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 _0x411b=['login','get','/callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x411b,0x9f));var _0xb411=function(_0xe89d6c,_0x2cc354){_0xe89d6c=_0xe89d6c-0x0;var _0x454132=_0x411b[_0xe89d6c];return _0x454132;};'use strict';var express=require(_0xb411('0x0'));var passport=require(_0xb411('0x1'));var router=express[_0xb411('0x2')]();var controller=require(_0xb411('0x3'));var userController=require(_0xb411('0x4'));var authService=require(_0xb411('0x5'));router['get']('/',controller[_0xb411('0x6')]);router[_0xb411('0x7')](_0xb411('0x8'),controller['callback'],authService[_0xb411('0x9')],userController[_0xb411('0x6')],authService['setTokenCookie']);module[_0xb411('0xa')]=router; \ No newline at end of file +var _0xf620=['passport','Router','./authGoogle.controller','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf620,0x197));var _0x0f62=function(_0x9187a7,_0x54b731){_0x9187a7=_0x9187a7-0x0;var _0x135e9e=_0xf620[_0x9187a7];return _0x135e9e;};'use strict';var express=require(_0x0f62('0x0'));var passport=require(_0x0f62('0x1'));var router=express[_0x0f62('0x2')]();var controller=require(_0x0f62('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x0f62('0x4'));router[_0x0f62('0x5')]('/',controller['login']);router['get'](_0x0f62('0x6'),controller[_0x0f62('0x7')],authService[_0x0f62('0x8')],userController[_0x0f62('0x9')],authService[_0x0f62('0xa')]);module[_0x0f62('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 7e41f2e..0cac7ab 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 _0xca83=['moment','../../components/auth/service','../../config/utils','http','Setting','blockDuration','findOne','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','email','request','error','format','message','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','use','local-login','util','passport-local','Strategy','jayson/promise','lodash'];(function(_0x423bb8,_0x4a9efc){var _0xbd76f5=function(_0x1933e1){while(--_0x1933e1){_0x423bb8['push'](_0x423bb8['shift']());}};_0xbd76f5(++_0x4a9efc);}(_0xca83,0x99));var _0x3ca8=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xca83[_0x56916d];return _0x2b7f1f;};'use strict';var util=require(_0x3ca8('0x0'));var passport=require('passport');var LocalStrategy=require(_0x3ca8('0x1'))[_0x3ca8('0x2')];var jayson=require(_0x3ca8('0x3'));var _=require(_0x3ca8('0x4'));var rs=require('randomstring');var moment=require(_0x3ca8('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x3ca8('0x6'));var utils=require(_0x3ca8('0x7'));var client=jayson['client'][_0x3ca8('0x8')]({'port':0x232b});function localAuthenticate(_0x2a2c0b,_0x5272ae,_0x2f5eae,_0x5aa6b8){var _0x29cca8,_0x20ce05;return db[_0x3ca8('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3ca8('0xa')],'raw':!![]})['then'](function(_0x15550b){_0x29cca8=_0x15550b;return _0x2a2c0b[_0x3ca8('0xb')]({'attributes':['id',_0x3ca8('0xc'),_0x3ca8('0xd'),_0x3ca8('0xe'),_0x3ca8('0xf'),_0x3ca8('0x10'),_0x3ca8('0x11'),'blockedAt',_0x3ca8('0x12')],'where':{'name':_0x5272ae,'role':{'$or':[_0x3ca8('0x13'),_0x3ca8('0x14'),_0x3ca8('0x15')]}}});})[_0x3ca8('0x16')](function(_0x214a00){if(!_0x214a00||_0x214a00&&_0x214a00[_0x3ca8('0xc')]!==_0x5272ae){throw new Error(_0x3ca8('0x17'));}else{_0x20ce05=_0x214a00;return _0x20ce05;}})[_0x3ca8('0x16')](function(){_0x20ce05[_0x3ca8('0x18')](_0x2f5eae,function(_0x4110a6,_0x365b09){var _0x5a7ea2=_0x20ce05[_0x3ca8('0x12')]+0x1;if(_0x4110a6){return _0x5aa6b8(_0x4110a6);}else if(!_0x365b09){if(_0x20ce05[_0x3ca8('0x10')]){return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});}else if(_0x29cca8[_0x3ca8('0x19')]>0x0){if(_0x20ce05[_0x3ca8('0x11')]){if(_0x29cca8[_0x3ca8('0xa')]>0x0){if(moment(_0x20ce05[_0x3ca8('0x1a')])[_0x3ca8('0x1b')](_0x29cca8[_0x3ca8('0xa')],_0x3ca8('0x1c'))>moment()){return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});}else{return utils[_0x3ca8('0x1d')](_0x20ce05,_0x5a7ea2,![],null)[_0x3ca8('0x16')](function(){return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});});}}else{return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});}}else{if(_0x5a7ea2>=_0x29cca8[_0x3ca8('0x19')]){return utils[_0x3ca8('0x1d')](_0x20ce05,0x0,!![],moment())[_0x3ca8('0x16')](function(){return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});});}else{return utils[_0x3ca8('0x1d')](_0x20ce05,_0x5a7ea2,![],null)[_0x3ca8('0x16')](function(){return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});});}}}else{return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});}}else{if(_0x20ce05[_0x3ca8('0x10')]){return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});}else if(_0x29cca8[_0x3ca8('0x19')]>0x0){if(_0x20ce05[_0x3ca8('0x11')]){if(_0x29cca8[_0x3ca8('0xa')]>0x0){if(moment(_0x20ce05[_0x3ca8('0x1a')])[_0x3ca8('0x1b')](_0x29cca8['blockDuration'],_0x3ca8('0x1c'))>moment()){return _0x5aa6b8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3ca8('0x1d')](_0x20ce05,0x0,![],null)[_0x3ca8('0x16')](function(){return utils[_0x3ca8('0x1e')](_0x20ce05);})[_0x3ca8('0x16')](function(){return _0x5aa6b8(null,_0x20ce05);});}}else{return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});}}else{return utils['clearBlockUser'](_0x20ce05,0x0,![],null)[_0x3ca8('0x16')](function(){return utils[_0x3ca8('0x1e')](_0x20ce05);})[_0x3ca8('0x16')](function(){return _0x5aa6b8(null,_0x20ce05);})[_0x3ca8('0x1f')](function(_0x4fcca3){return _0x5aa6b8(null,![],_0x4fcca3);});}}else{if(_0x20ce05[_0x3ca8('0x11')]){return _0x5aa6b8(null,![],{'message':_0x3ca8('0x17')});}else{return utils['getLicense'](_0x20ce05)[_0x3ca8('0x16')](function(){return _0x5aa6b8(null,_0x20ce05);});}}}});})['catch'](function(_0x4377a1){return _0x5aa6b8(null,![],_0x4377a1);});}function sendServiceMail(_0x10632c){return db['MailAccount'][_0x3ca8('0x20')]({'where':{'service':!![]},'attributes':['id',_0x3ca8('0xc'),'email'],'include':[{'model':db[_0x3ca8('0x21')],'as':_0x3ca8('0x22'),'include':[{'model':db[_0x3ca8('0x23')],'as':'CloudProvider'}]}]})['then'](function(_0x56793a){if(!_0x56793a){throw new Error(_0x3ca8('0x24'));}var _0x255823=_0x56793a['getSmtpOptions']();var _0x3f77fc={'account':_0x255823,'message':_[_0x3ca8('0x25')]({'from':util['format'](_0x3ca8('0x26'),_0x56793a['name'],_0x56793a[_0x3ca8('0x27')]||_0x56793a[_0x3ca8('0x22')][_0x3ca8('0x14')])},_0x10632c)};return client[_0x3ca8('0x28')]('SendMail',_0x3f77fc);})['then'](function(_0x424a50){if(_0x424a50[_0x3ca8('0x29')]){throw new Error(util[_0x3ca8('0x2a')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x424a50['error'][_0x3ca8('0x2b')]||JSON['stringify'](_0x424a50[_0x3ca8('0x29')])));}return!![];});}function handleError(_0x4583a7,_0x1fc87b,_0x3a18d0){return _0x4583a7[_0x3ca8('0x2c')](_0x1fc87b||0x1f4)['send']({'message':_0x3a18d0?_0x3a18d0[_0x3ca8('0x2b')]||_0x3a18d0:''});}exports[_0x3ca8('0x2d')]=function(_0x3ae88f,_0x141834,_0x13c447){passport[_0x3ca8('0x18')]('local-login',function(_0xe78211,_0x112573,_0x343fe7){var _0x12f870=_0xe78211||_0x343fe7;if(_0x12f870){return handleError(_0x141834,0x191,_0x12f870);}if(!_0x112573){return handleError(_0x141834,0x194,{'message':_0x3ca8('0x2e')});}else{var _0x322b5c={'payload':{'id':_0x112573['id'],'role':_0x112573[_0x3ca8('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x3ca8('0x2f')](_0x322b5c)[_0x3ca8('0x16')](function(_0x2b7152){_0x141834[_0x3ca8('0x30')]({'id':_0x112573['id'],'token':_0x2b7152,'statusCall':'','isAlreadyLogged':_0x112573[_0x3ca8('0x31')]});});}})(_0x3ae88f,_0x141834,_0x13c447);};exports[_0x3ca8('0x32')]=function(_0x17423f,_0x310d1b){if(!_0x17423f[_0x3ca8('0x33')][_0x3ca8('0x27')]){return handleError(_0x310d1b,0x1f4,{'message':_0x3ca8('0x34')});}var _0x3cf66d=rs['generate']();_0x17423f['body'][_0x3ca8('0x27')]=_0x17423f[_0x3ca8('0x33')][_0x3ca8('0x27')][_0x3ca8('0x35')]()[_0x3ca8('0x36')]();var _0x2113d3;return db['Setting'][_0x3ca8('0xb')]({'where':{'id':0x1},'attributes':[_0x3ca8('0x19'),_0x3ca8('0xa')],'raw':!![]})['then'](function(_0x333afa){_0x2113d3=_0x333afa;return db[_0x3ca8('0x37')][_0x3ca8('0x20')]({'where':{'email':_0x17423f[_0x3ca8('0x33')][_0x3ca8('0x27')]}});})[_0x3ca8('0x16')](function(_0x16d57a){if(!_0x16d57a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x16d57a[_0x3ca8('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x16d57a[_0x3ca8('0x11')]){if(moment(_0x16d57a[_0x3ca8('0x1a')])[_0x3ca8('0x1b')](_0x2113d3[_0x3ca8('0xa')],_0x3ca8('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x16d57a['blocked']=![];_0x16d57a[_0x3ca8('0x1a')]=null;}}_0x16d57a[_0x3ca8('0x38')]=_0x3cf66d;_0x16d57a[_0x3ca8('0x39')]=Date[_0x3ca8('0x3a')]()+0x36ee80;return _0x16d57a[_0x3ca8('0x3b')]();})[_0x3ca8('0x16')](function(){return sendServiceMail({'to':_0x17423f['body'][_0x3ca8('0x27')],'subject':_0x3ca8('0x3c'),'text':_0x3ca8('0x3d')+_0x3ca8('0x3e')+_0x3ca8('0x3f')+_0x17423f[_0x3ca8('0x40')][_0x3ca8('0x41')]+'/reset/'+_0x3cf66d+'\x0a\x0a'+_0x3ca8('0x42')});})[_0x3ca8('0x16')](function(){_0x310d1b['status'](0xc8)['send']({'message':_0x3ca8('0x43')});})[_0x3ca8('0x1f')](function(_0x4b6f66){return handleError(_0x310d1b,0x1f4,_0x4b6f66);});};exports['reset']=function(_0x1f39cc,_0x1dad2f){return db[_0x3ca8('0x37')][_0x3ca8('0x20')]({'where':{'resetPasswordToken':_0x1f39cc[_0x3ca8('0x44')][_0x3ca8('0x45')],'resetPasswordExpires':{'$gt':Date[_0x3ca8('0x3a')]()}}})[_0x3ca8('0x16')](function(_0x57159b){if(!_0x57159b){throw new Error(_0x3ca8('0x46'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x3ca8('0x47'),'passwordHistoryLimit']})[_0x3ca8('0x16')](function(_0x2f57c7){if(_0x2f57c7[_0x3ca8('0x48')])authService[_0x3ca8('0x49')](_0x1f39cc[_0x3ca8('0x33')][_0x3ca8('0xd')]);if(!_0x2f57c7[_0x3ca8('0x47')]||!_0x57159b[_0x3ca8('0x4a')])return _0x57159b;authService[_0x3ca8('0x4b')](_0x1f39cc[_0x3ca8('0x33')][_0x3ca8('0xd')],_0x57159b[_0x3ca8('0x4a')],_0x2f57c7[_0x3ca8('0x4c')]);return _0x57159b;})[_0x3ca8('0x16')](function(){_0x57159b[_0x3ca8('0xd')]=_0x1f39cc['body'][_0x3ca8('0xd')];_0x57159b[_0x3ca8('0x38')]=null;_0x57159b['resetPasswordExpires']=null;return _0x57159b[_0x3ca8('0x3b')]();});})[_0x3ca8('0x16')](function(){_0x1dad2f[_0x3ca8('0x2c')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x5dd00a){return handleError(_0x1dad2f,0x1f4,_0x5dd00a);});};passport[_0x3ca8('0x4d')](_0x3ca8('0x4e'),new LocalStrategy({'usernameField':'name','passwordField':_0x3ca8('0xd')},function(_0x27c42c,_0x54b771,_0x5c7717){return localAuthenticate(db[_0x3ca8('0x37')],_0x27c42c,_0x54b771,_0x5c7717);})); \ No newline at end of file +var _0xef58=['MailAccount','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','message','stringify','status','send','login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','email','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch'];(function(_0xa3400,_0x3a980a){var _0x33dba2=function(_0x5e988b){while(--_0x5e988b){_0xa3400['push'](_0xa3400['shift']());}};_0x33dba2(++_0x3a980a);}(_0xef58,0x17f));var _0x8ef5=function(_0x334444,_0x20403c){_0x334444=_0x334444-0x0;var _0x303741=_0xef58[_0x334444];return _0x303741;};'use strict';var util=require(_0x8ef5('0x0'));var passport=require(_0x8ef5('0x1'));var LocalStrategy=require(_0x8ef5('0x2'))[_0x8ef5('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x8ef5('0x4'));var moment=require(_0x8ef5('0x5'));var db=require(_0x8ef5('0x6'))['db'];var authService=require(_0x8ef5('0x7'));var utils=require('../../config/utils');var client=jayson[_0x8ef5('0x8')][_0x8ef5('0x9')]({'port':0x232b});function localAuthenticate(_0x1e0c4c,_0x191308,_0x2229fd,_0x18f2b8){var _0x25bd15,_0x3d795e;return db['Setting'][_0x8ef5('0xa')]({'where':{'id':0x1},'attributes':[_0x8ef5('0xb'),'blockDuration'],'raw':!![]})[_0x8ef5('0xc')](function(_0x40e90d){_0x25bd15=_0x40e90d;return _0x1e0c4c[_0x8ef5('0xa')]({'attributes':['id',_0x8ef5('0xd'),_0x8ef5('0xe'),_0x8ef5('0xf'),_0x8ef5('0x10'),_0x8ef5('0x11'),_0x8ef5('0x12'),'blockedAt',_0x8ef5('0x13')],'where':{'name':_0x191308,'role':{'$or':[_0x8ef5('0x14'),_0x8ef5('0x15'),_0x8ef5('0x16')]}}});})[_0x8ef5('0xc')](function(_0x1bdd29){if(!_0x1bdd29||_0x1bdd29&&_0x1bdd29[_0x8ef5('0xd')]!==_0x191308){throw new Error(_0x8ef5('0x17'));}else{_0x3d795e=_0x1bdd29;return _0x3d795e;}})[_0x8ef5('0xc')](function(){_0x3d795e[_0x8ef5('0x18')](_0x2229fd,function(_0x2a3525,_0x1feb24){var _0x3bfa9d=_0x3d795e['loginAttempts']+0x1;if(_0x2a3525){return _0x18f2b8(_0x2a3525);}else if(!_0x1feb24){if(_0x3d795e['disabled']){return _0x18f2b8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x25bd15[_0x8ef5('0xb')]>0x0){if(_0x3d795e[_0x8ef5('0x12')]){if(_0x25bd15[_0x8ef5('0x19')]>0x0){if(moment(_0x3d795e[_0x8ef5('0x1a')])[_0x8ef5('0x1b')](_0x25bd15['blockDuration'],_0x8ef5('0x1c'))>moment()){return _0x18f2b8(null,![],{'message':_0x8ef5('0x17')});}else{return utils[_0x8ef5('0x1d')](_0x3d795e,_0x3bfa9d,![],null)[_0x8ef5('0xc')](function(){return _0x18f2b8(null,![],{'message':_0x8ef5('0x17')});});}}else{return _0x18f2b8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3bfa9d>=_0x25bd15[_0x8ef5('0xb')]){return utils[_0x8ef5('0x1d')](_0x3d795e,0x0,!![],moment())['then'](function(){return _0x18f2b8(null,![],{'message':_0x8ef5('0x17')});});}else{return utils[_0x8ef5('0x1d')](_0x3d795e,_0x3bfa9d,![],null)[_0x8ef5('0xc')](function(){return _0x18f2b8(null,![],{'message':_0x8ef5('0x17')});});}}}else{return _0x18f2b8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3d795e[_0x8ef5('0x11')]){return _0x18f2b8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x25bd15[_0x8ef5('0xb')]>0x0){if(_0x3d795e['blocked']){if(_0x25bd15[_0x8ef5('0x19')]>0x0){if(moment(_0x3d795e[_0x8ef5('0x1a')])[_0x8ef5('0x1b')](_0x25bd15['blockDuration'],_0x8ef5('0x1c'))>moment()){return _0x18f2b8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8ef5('0x1d')](_0x3d795e,0x0,![],null)[_0x8ef5('0xc')](function(){return utils[_0x8ef5('0x1e')](_0x3d795e);})[_0x8ef5('0xc')](function(){return _0x18f2b8(null,_0x3d795e);});}}else{return _0x18f2b8(null,![],{'message':_0x8ef5('0x17')});}}else{return utils['clearBlockUser'](_0x3d795e,0x0,![],null)['then'](function(){return utils[_0x8ef5('0x1e')](_0x3d795e);})[_0x8ef5('0xc')](function(){return _0x18f2b8(null,_0x3d795e);})[_0x8ef5('0x1f')](function(_0xc9c53a){return _0x18f2b8(null,![],_0xc9c53a);});}}else{if(_0x3d795e[_0x8ef5('0x12')]){return _0x18f2b8(null,![],{'message':_0x8ef5('0x17')});}else{return utils[_0x8ef5('0x1e')](_0x3d795e)['then'](function(){return _0x18f2b8(null,_0x3d795e);});}}}});})[_0x8ef5('0x1f')](function(_0xd1027d){return _0x18f2b8(null,![],_0xd1027d);});}function sendServiceMail(_0x2ffe7a){return db[_0x8ef5('0x20')][_0x8ef5('0x21')]({'where':{'service':!![]},'attributes':['id',_0x8ef5('0xd'),'email'],'include':[{'model':db[_0x8ef5('0x22')],'as':'Smtp','include':[{'model':db[_0x8ef5('0x23')],'as':'CloudProvider'}]}]})['then'](function(_0x829e03){if(!_0x829e03){throw new Error(_0x8ef5('0x24'));}var _0x3912b5=_0x829e03[_0x8ef5('0x25')]();var _0x59d6b3={'account':_0x3912b5,'message':_[_0x8ef5('0x26')]({'from':util[_0x8ef5('0x27')](_0x8ef5('0x28'),_0x829e03['name'],_0x829e03['email']||_0x829e03[_0x8ef5('0x29')]['user'])},_0x2ffe7a)};return client[_0x8ef5('0x2a')](_0x8ef5('0x2b'),_0x59d6b3);})[_0x8ef5('0xc')](function(_0x3ea180){if(_0x3ea180[_0x8ef5('0x2c')]){throw new Error(util[_0x8ef5('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3ea180[_0x8ef5('0x2c')][_0x8ef5('0x2d')]||JSON[_0x8ef5('0x2e')](_0x3ea180[_0x8ef5('0x2c')])));}return!![];});}function handleError(_0x1eefc4,_0x114f7e,_0x3981ee){return _0x1eefc4[_0x8ef5('0x2f')](_0x114f7e||0x1f4)[_0x8ef5('0x30')]({'message':_0x3981ee?_0x3981ee[_0x8ef5('0x2d')]||_0x3981ee:''});}exports[_0x8ef5('0x31')]=function(_0x4e9d1d,_0x4d3382,_0x38d463){passport['authenticate']('local-login',function(_0x5b6908,_0x5cff15,_0x30e151){var _0x5bab17=_0x5b6908||_0x30e151;if(_0x5bab17){return handleError(_0x4d3382,0x191,_0x5bab17);}if(!_0x5cff15){return handleError(_0x4d3382,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2c767f={'payload':{'id':_0x5cff15['id'],'role':_0x5cff15['role']},'options':{'expiresIn':0x15180}};return authService[_0x8ef5('0x32')](_0x2c767f)[_0x8ef5('0xc')](function(_0x44e9c7){_0x4d3382['json']({'id':_0x5cff15['id'],'token':_0x44e9c7,'statusCall':'','isAlreadyLogged':_0x5cff15[_0x8ef5('0x33')]});});}})(_0x4e9d1d,_0x4d3382,_0x38d463);};exports[_0x8ef5('0x34')]=function(_0x3f78d9,_0x1a1e4c){if(!_0x3f78d9[_0x8ef5('0x35')]['email']){return handleError(_0x1a1e4c,0x1f4,{'message':_0x8ef5('0x36')});}var _0x47b3c8=rs[_0x8ef5('0x37')]();_0x3f78d9['body'][_0x8ef5('0x38')]=_0x3f78d9['body']['email'][_0x8ef5('0x39')]()['toLowerCase']();var _0x5ba9f2;return db[_0x8ef5('0x3a')][_0x8ef5('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x8ef5('0xc')](function(_0x3bc9a9){_0x5ba9f2=_0x3bc9a9;return db[_0x8ef5('0x3b')]['find']({'where':{'email':_0x3f78d9[_0x8ef5('0x35')][_0x8ef5('0x38')]}});})['then'](function(_0x53ec8c){if(!_0x53ec8c){throw new Error(_0x8ef5('0x3c'));}if(_0x53ec8c[_0x8ef5('0x11')]){throw new Error(_0x8ef5('0x3d'));}if(_0x53ec8c['blocked']){if(moment(_0x53ec8c[_0x8ef5('0x1a')])[_0x8ef5('0x1b')](_0x5ba9f2[_0x8ef5('0x19')],_0x8ef5('0x1c'))>moment()){throw new Error(_0x8ef5('0x3e'));}else{_0x53ec8c[_0x8ef5('0x12')]=![];_0x53ec8c['blockedAt']=null;}}_0x53ec8c[_0x8ef5('0x3f')]=_0x47b3c8;_0x53ec8c[_0x8ef5('0x40')]=Date['now']()+0x36ee80;return _0x53ec8c[_0x8ef5('0x41')]();})[_0x8ef5('0xc')](function(){return sendServiceMail({'to':_0x3f78d9[_0x8ef5('0x35')][_0x8ef5('0x38')],'subject':_0x8ef5('0x42'),'text':_0x8ef5('0x43')+_0x8ef5('0x44')+_0x8ef5('0x45')+_0x3f78d9['headers']['host']+_0x8ef5('0x46')+_0x47b3c8+'\x0a\x0a'+_0x8ef5('0x47')});})['then'](function(){_0x1a1e4c[_0x8ef5('0x2f')](0xc8)[_0x8ef5('0x30')]({'message':_0x8ef5('0x48')});})['catch'](function(_0x498735){return handleError(_0x1a1e4c,0x1f4,_0x498735);});};exports[_0x8ef5('0x49')]=function(_0x3ed66e,_0x3e18b6){return db[_0x8ef5('0x3b')]['find']({'where':{'resetPasswordToken':_0x3ed66e[_0x8ef5('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date[_0x8ef5('0x4b')]()}}})[_0x8ef5('0xc')](function(_0x28340c){if(!_0x28340c){throw new Error(_0x8ef5('0x4c'));}return db['Setting'][_0x8ef5('0xa')]({'attributes':['id',_0x8ef5('0x4d'),_0x8ef5('0x4e'),_0x8ef5('0x4f')]})[_0x8ef5('0xc')](function(_0x49163c){if(_0x49163c[_0x8ef5('0x4d')])authService['validatePasswordPattern'](_0x3ed66e['body'][_0x8ef5('0xe')]);if(!_0x49163c['enforcePasswordHistory']||!_0x28340c[_0x8ef5('0x50')])return _0x28340c;authService[_0x8ef5('0x51')](_0x3ed66e[_0x8ef5('0x35')]['password'],_0x28340c['previousPasswords'],_0x49163c[_0x8ef5('0x4f')]);return _0x28340c;})[_0x8ef5('0xc')](function(){_0x28340c[_0x8ef5('0xe')]=_0x3ed66e['body'][_0x8ef5('0xe')];_0x28340c[_0x8ef5('0x3f')]=null;_0x28340c[_0x8ef5('0x40')]=null;return _0x28340c[_0x8ef5('0x41')]();});})['then'](function(){_0x3e18b6[_0x8ef5('0x2f')](0xc8)['send']({'message':_0x8ef5('0x52')});})[_0x8ef5('0x1f')](function(_0x2c8378){return handleError(_0x3e18b6,0x1f4,_0x2c8378);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x8ef5('0xd'),'passwordField':'password'},function(_0x1974c1,_0xc665b4,_0x11c134){return localAuthenticate(db[_0x8ef5('0x3b')],_0x1974c1,_0xc665b4,_0x11c134);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 7e25a80..49180e1 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 _0x0490=['post','login','/forgot','/reset/:token','reset','exports','express'];(function(_0x25f2bb,_0x3cf160){var _0x21a2c3=function(_0x25f43e){while(--_0x25f43e){_0x25f2bb['push'](_0x25f2bb['shift']());}};_0x21a2c3(++_0x3cf160);}(_0x0490,0x1db));var _0x0049=function(_0x4d4c8f,_0x3669c5){_0x4d4c8f=_0x4d4c8f-0x0;var _0x702523=_0x0490[_0x4d4c8f];return _0x702523;};'use strict';var express=require(_0x0049('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x0049('0x1')]('/',controller[_0x0049('0x2')]);router[_0x0049('0x1')](_0x0049('0x3'),controller['forgot']);router[_0x0049('0x1')](_0x0049('0x4'),controller[_0x0049('0x5')]);module[_0x0049('0x6')]=router; \ No newline at end of file +var _0xfdd7=['reset','exports','Router','login','post','/reset/:token'];(function(_0x3eec54,_0x1d342f){var _0x2d3691=function(_0x3e7abb){while(--_0x3e7abb){_0x3eec54['push'](_0x3eec54['shift']());}};_0x2d3691(++_0x1d342f);}(_0xfdd7,0x1e2));var _0x7fdd=function(_0x4bb0e1,_0x56a5d6){_0x4bb0e1=_0x4bb0e1-0x0;var _0x1e254e=_0xfdd7[_0x4bb0e1];return _0x1e254e;};'use strict';var express=require('express');var router=express[_0x7fdd('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x7fdd('0x1')]);router[_0x7fdd('0x2')]('/forgot',controller['forgot']);router['post'](_0x7fdd('0x3'),controller[_0x7fdd('0x4')]);module[_0x7fdd('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c1a79af..b4574f5 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 _0x807c=['sequelize','exports','STRING'];(function(_0x446438,_0x771136){var _0x58cfcc=function(_0x460868){while(--_0x460868){_0x446438['push'](_0x446438['shift']());}};_0x58cfcc(++_0x771136);}(_0x807c,0x186));var _0xc807=function(_0x8760bd,_0x4f3b26){_0x8760bd=_0x8760bd-0x0;var _0x3ef058=_0x807c[_0x8760bd];return _0x3ef058;};'use strict';var Sequelize=require(_0xc807('0x0'));module[_0xc807('0x1')]={'name':{'type':Sequelize[_0xc807('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xc807('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x132d=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x132d,0x195));var _0xd132=function(_0x34ae7d,_0x359c6f){_0x34ae7d=_0x34ae7d-0x0;var _0x5d4f3d=_0x132d[_0x34ae7d];return _0x5d4f3d;};'use strict';var Sequelize=require(_0xd132('0x0'));module[_0xd132('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xd132('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd132('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd132('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index b3fabe0..e434f93 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 _0x8a8d=['reject','save','update','then','destroy','end','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','keys','length','include','options','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','apply'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8a8d,0x1d3));var _0xd8a8=function(_0x874d96,_0xbea28b){_0x874d96=_0x874d96-0x0;var _0x42d821=_0x8a8d[_0x874d96];return _0x42d821;};'use strict';var emlformat=require(_0xd8a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8a8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8a8('0x2'));var moment=require(_0xd8a8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd8a8('0x4'));var util=require(_0xd8a8('0x5'));var path=require(_0xd8a8('0x6'));var sox=require(_0xd8a8('0x7'));var csv=require(_0xd8a8('0x8'));var ejs=require(_0xd8a8('0x9'));var fs=require('fs');var fs_extra=require(_0xd8a8('0xa'));var _=require('lodash');var squel=require(_0xd8a8('0xb'));var crypto=require(_0xd8a8('0xc'));var jsforce=require(_0xd8a8('0xd'));var deskjs=require(_0xd8a8('0xe'));var toCsv=require(_0xd8a8('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8a8('0xf'));var authService=require(_0xd8a8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd8a8('0x11'));var hardwareService=require(_0xd8a8('0x12'));var logger=require(_0xd8a8('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd8a8('0x14'));var licenseUtil=require(_0xd8a8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b2306,_0x98e4e4){_0x98e4e4=_0x98e4e4||0xcc;return function(_0x1a18f3){if(_0x1a18f3){return _0x5b2306[_0xd8a8('0x16')](_0x98e4e4);}return _0x5b2306[_0xd8a8('0x17')](_0x98e4e4)['end']();};}function respondWithResult(_0x29a9ed,_0x3041ef){_0x3041ef=_0x3041ef||0xc8;return function(_0x1a3f1b){if(_0x1a3f1b){return _0x29a9ed[_0xd8a8('0x17')](_0x3041ef)[_0xd8a8('0x18')](_0x1a3f1b);}};}function respondWithFilteredResult(_0x2034b4,_0x4e911b){return function(_0x2ef247){if(_0x2ef247){var _0x5cae3e=typeof _0x4e911b[_0xd8a8('0x19')]==='undefined'&&typeof _0x4e911b[_0xd8a8('0x1a')]===_0xd8a8('0x1b');var _0x4b3c67=_0x2ef247[_0xd8a8('0x1c')];var _0xed58ce=_0x5cae3e?0x0:_0x4e911b[_0xd8a8('0x19')];var _0x217545=_0x5cae3e?_0x2ef247[_0xd8a8('0x1c')]:_0x4e911b['offset']+_0x4e911b[_0xd8a8('0x1a')];var _0x2eae9c;if(_0x217545>=_0x4b3c67){_0x217545=_0x4b3c67;_0x2eae9c=0xc8;}else{_0x2eae9c=0xce;}_0x2034b4[_0xd8a8('0x17')](_0x2eae9c);return _0x2034b4[_0xd8a8('0x1d')]('Content-Range',_0xed58ce+'-'+_0x217545+'/'+_0x4b3c67)[_0xd8a8('0x18')](_0x2ef247);}return null;};}function patchUpdates(_0x282519){return function(_0x5ae03d){try{jsonpatch[_0xd8a8('0x1e')](_0x5ae03d,_0x282519,!![]);}catch(_0x2c9403){return BPromise[_0xd8a8('0x1f')](_0x2c9403);}return _0x5ae03d[_0xd8a8('0x20')]();};}function saveUpdates(_0x4a4f57,_0x5045f0){return function(_0x207f08){if(_0x207f08){return _0x207f08[_0xd8a8('0x21')](_0x4a4f57)[_0xd8a8('0x22')](function(_0x19ebdf){return _0x19ebdf;});}return null;};}function removeEntity(_0x4bea3d,_0x4c5539){return function(_0x23ac91){if(_0x23ac91){return _0x23ac91[_0xd8a8('0x23')]()['then'](function(){_0x4bea3d[_0xd8a8('0x17')](0xcc)[_0xd8a8('0x24')]();});}};}function handleEntityNotFound(_0x4bab6d,_0x2a1865){return function(_0x31cf30){if(!_0x31cf30){_0x4bab6d[_0xd8a8('0x16')](0x194);}return _0x31cf30;};}function handleError(_0x2414d8,_0x48d703){_0x48d703=_0x48d703||0x1f4;return function(_0x976a65){logger[_0xd8a8('0x25')](_0x976a65[_0xd8a8('0x26')]);if(_0x976a65[_0xd8a8('0x27')]){delete _0x976a65[_0xd8a8('0x27')];}_0x2414d8[_0xd8a8('0x17')](_0x48d703)['send'](_0x976a65);};}exports[_0xd8a8('0x28')]=function(_0x563577,_0x2af619){var _0x557f0b={},_0x3696a0={},_0xe5e523={'count':0x0,'rows':[]};var _0x2b65d5=_[_0xd8a8('0x29')](db[_0xd8a8('0x2a')][_0xd8a8('0x2b')],function(_0x255383){return{'name':_0x255383[_0xd8a8('0x2c')],'type':_0x255383[_0xd8a8('0x2d')][_0xd8a8('0x2e')]};});_0x3696a0['model']=_[_0xd8a8('0x29')](_0x2b65d5,'name');_0x3696a0[_0xd8a8('0x2f')]=_['keys'](_0x563577[_0xd8a8('0x2f')]);_0x3696a0[_0xd8a8('0x30')]=_[_0xd8a8('0x31')](_0x3696a0['model'],_0x3696a0[_0xd8a8('0x2f')]);_0x557f0b[_0xd8a8('0x32')]=_[_0xd8a8('0x31')](_0x3696a0[_0xd8a8('0x33')],qs[_0xd8a8('0x34')](_0x563577[_0xd8a8('0x2f')][_0xd8a8('0x34')]));_0x557f0b[_0xd8a8('0x32')]=_0x557f0b[_0xd8a8('0x32')]['length']?_0x557f0b['attributes']:_0x3696a0[_0xd8a8('0x33')];if(!_0x563577[_0xd8a8('0x2f')][_0xd8a8('0x35')](_0xd8a8('0x36'))){_0x557f0b[_0xd8a8('0x1a')]=qs[_0xd8a8('0x1a')](_0x563577['query'][_0xd8a8('0x1a')]);_0x557f0b[_0xd8a8('0x19')]=qs[_0xd8a8('0x19')](_0x563577[_0xd8a8('0x2f')][_0xd8a8('0x19')]);}_0x557f0b[_0xd8a8('0x37')]=qs[_0xd8a8('0x38')](_0x563577['query'][_0xd8a8('0x38')]);_0x557f0b[_0xd8a8('0x39')]=qs['filters'](_[_0xd8a8('0x3a')](_0x563577[_0xd8a8('0x2f')],_0x3696a0[_0xd8a8('0x30')]),_0x2b65d5);if(_0x563577[_0xd8a8('0x2f')][_0xd8a8('0x3b')]){_0x557f0b['where']=_['merge'](_0x557f0b[_0xd8a8('0x39')],{'$or':_[_0xd8a8('0x29')](_0x2b65d5,function(_0x44574f){if(_0x44574f['type']!=='VIRTUAL'){var _0x301f10={};_0x301f10[_0x44574f[_0xd8a8('0x27')]]={'$like':'%'+_0x563577[_0xd8a8('0x2f')][_0xd8a8('0x3b')]+'%'};return _0x301f10;}})});}_0x557f0b=_[_0xd8a8('0x3c')]({},_0x557f0b,_0x563577['options']);var _0x41a48a={'where':_0x557f0b['where']};return db['Automation']['count'](_0x41a48a)['then'](function(_0x57f70b){_0xe5e523['count']=_0x57f70b;if(_0x563577['query'][_0xd8a8('0x3d')]){_0x557f0b['include']=[{'all':!![]}];}return db[_0xd8a8('0x2a')][_0xd8a8('0x3e')](_0x557f0b);})[_0xd8a8('0x22')](function(_0x1466e4){_0xe5e523[_0xd8a8('0x3f')]=_0x1466e4;return _0xe5e523;})[_0xd8a8('0x22')](respondWithFilteredResult(_0x2af619,_0x557f0b))[_0xd8a8('0x40')](handleError(_0x2af619,null));};exports[_0xd8a8('0x41')]=function(_0x2977fa,_0x470ec0){var _0xbfd748={'raw':![],'where':{'id':_0x2977fa[_0xd8a8('0x42')]['id']}},_0x2c34d4={};_0x2c34d4[_0xd8a8('0x33')]=_['keys'](db[_0xd8a8('0x2a')][_0xd8a8('0x2b')]);_0x2c34d4[_0xd8a8('0x2f')]=_[_0xd8a8('0x43')](_0x2977fa[_0xd8a8('0x2f')]);_0x2c34d4['filters']=_[_0xd8a8('0x31')](_0x2c34d4['model'],_0x2c34d4[_0xd8a8('0x2f')]);_0xbfd748[_0xd8a8('0x32')]=_['intersection'](_0x2c34d4['model'],qs['fields'](_0x2977fa['query']['fields']));_0xbfd748[_0xd8a8('0x32')]=_0xbfd748[_0xd8a8('0x32')][_0xd8a8('0x44')]?_0xbfd748[_0xd8a8('0x32')]:_0x2c34d4[_0xd8a8('0x33')];if(_0x2977fa[_0xd8a8('0x2f')][_0xd8a8('0x3d')]){_0xbfd748[_0xd8a8('0x45')]=[{'all':!![]}];}_0xbfd748=_[_0xd8a8('0x3c')]({},_0xbfd748,_0x2977fa[_0xd8a8('0x46')]);return db[_0xd8a8('0x2a')][_0xd8a8('0x47')](_0xbfd748)[_0xd8a8('0x22')](handleEntityNotFound(_0x470ec0,null))[_0xd8a8('0x22')](respondWithResult(_0x470ec0,null))['catch'](handleError(_0x470ec0,null));};exports['create']=function(_0x4e976c,_0x5cd897){return db[_0xd8a8('0x2a')][_0xd8a8('0x48')](_0x4e976c[_0xd8a8('0x49')],{})[_0xd8a8('0x22')](respondWithResult(_0x5cd897,0xc9))[_0xd8a8('0x40')](handleError(_0x5cd897,null));};exports[_0xd8a8('0x21')]=function(_0x2c0549,_0x39c9b8){if(_0x2c0549[_0xd8a8('0x49')]['id']){delete _0x2c0549[_0xd8a8('0x49')]['id'];}return db[_0xd8a8('0x2a')][_0xd8a8('0x47')]({'where':{'id':_0x2c0549[_0xd8a8('0x42')]['id']}})[_0xd8a8('0x22')](handleEntityNotFound(_0x39c9b8,null))['then'](saveUpdates(_0x2c0549[_0xd8a8('0x49')],null))['then'](respondWithResult(_0x39c9b8,null))[_0xd8a8('0x40')](handleError(_0x39c9b8,null));};exports['destroy']=function(_0x6c5e8a,_0x4123c8){return db[_0xd8a8('0x2a')]['find']({'where':{'id':_0x6c5e8a[_0xd8a8('0x42')]['id']}})['then'](handleEntityNotFound(_0x4123c8,null))[_0xd8a8('0x22')](removeEntity(_0x4123c8,null))[_0xd8a8('0x40')](handleError(_0x4123c8,null));};exports[_0xd8a8('0x4a')]=function(_0x39a149,_0x546935,_0x5a530b){return db[_0xd8a8('0x4b')][_0xd8a8('0x47')]({'where':{'id':_0x39a149['params']['id']}})[_0xd8a8('0x22')](handleEntityNotFound(_0x546935,null))[_0xd8a8('0x22')](function(_0x444cfe){if(_0x444cfe){return _0x444cfe[_0xd8a8('0x4a')](_0x39a149[_0xd8a8('0x49')][_0xd8a8('0x4c')],_[_0xd8a8('0x4d')](_0x39a149[_0xd8a8('0x49')],[_0xd8a8('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x546935,null))['catch'](handleError(_0x546935,null));};exports['getConditions']=function(_0x367a6b,_0x3ef6da,_0x18273c){var _0x16546d={};var _0x28b177={};var _0x4f582b;var _0x36aa95;return db[_0xd8a8('0x2a')][_0xd8a8('0x4e')]({'where':{'id':_0x367a6b['params']['id']}})[_0xd8a8('0x22')](handleEntityNotFound(_0x3ef6da,null))['then'](function(_0x5cd59f){if(_0x5cd59f){_0x4f582b=_0x5cd59f;_0x28b177[_0xd8a8('0x33')]=_['keys'](db[_0xd8a8('0x4b')][_0xd8a8('0x2b')]);_0x28b177[_0xd8a8('0x2f')]=_[_0xd8a8('0x43')](_0x367a6b[_0xd8a8('0x2f')]);_0x28b177[_0xd8a8('0x30')]=_[_0xd8a8('0x31')](_0x28b177['model'],_0x28b177[_0xd8a8('0x2f')]);_0x16546d['attributes']=_['intersection'](_0x28b177['model'],qs[_0xd8a8('0x34')](_0x367a6b['query'][_0xd8a8('0x34')]));_0x16546d[_0xd8a8('0x32')]=_0x16546d[_0xd8a8('0x32')][_0xd8a8('0x44')]?_0x16546d['attributes']:_0x28b177['model'];_0x16546d[_0xd8a8('0x37')]=qs[_0xd8a8('0x38')](_0x367a6b[_0xd8a8('0x2f')][_0xd8a8('0x38')]);_0x16546d[_0xd8a8('0x39')]=qs['filters'](_['pick'](_0x367a6b[_0xd8a8('0x2f')],_0x28b177[_0xd8a8('0x30')]));if(_0x367a6b[_0xd8a8('0x2f')][_0xd8a8('0x3b')]){_0x16546d[_0xd8a8('0x39')]=_[_0xd8a8('0x3c')](_0x16546d[_0xd8a8('0x39')],{'$or':_[_0xd8a8('0x29')](_0x16546d[_0xd8a8('0x32')],function(_0x52d547){var _0x5cc2c8={};_0x5cc2c8[_0x52d547]={'$like':'%'+_0x367a6b[_0xd8a8('0x2f')]['filter']+'%'};return _0x5cc2c8;})});}_0x16546d=_['merge']({},_0x16546d,_0x367a6b['options']);return _0x4f582b[_0xd8a8('0x4f')](_0x16546d);}})[_0xd8a8('0x22')](function(_0x473988){if(_0x473988){_0x36aa95=_0x473988['length'];if(!_0x367a6b[_0xd8a8('0x2f')]['hasOwnProperty']('nolimit')){_0x16546d[_0xd8a8('0x1a')]=qs[_0xd8a8('0x1a')](_0x367a6b[_0xd8a8('0x2f')][_0xd8a8('0x1a')]);_0x16546d[_0xd8a8('0x19')]=qs[_0xd8a8('0x19')](_0x367a6b['query'][_0xd8a8('0x19')]);}return _0x4f582b['getConditions'](_0x16546d);}})['then'](function(_0x5d4747){if(_0x5d4747){return _0x5d4747?{'count':_0x36aa95,'rows':_0x5d4747}:null;}})[_0xd8a8('0x22')](respondWithResult(_0x3ef6da,null))['catch'](handleError(_0x3ef6da,null));};exports[_0xd8a8('0x50')]=function(_0x5e79b9,_0xb3f0df,_0x225e7c){return db[_0xd8a8('0x51')][_0xd8a8('0x47')]({'where':{'id':_0x5e79b9['params']['id']}})[_0xd8a8('0x22')](handleEntityNotFound(_0xb3f0df,null))['then'](function(_0x4f000e){if(_0x4f000e){return _0x4f000e[_0xd8a8('0x50')](_0x5e79b9[_0xd8a8('0x49')][_0xd8a8('0x4c')],_[_0xd8a8('0x4d')](_0x5e79b9[_0xd8a8('0x49')],[_0xd8a8('0x4c'),'id'])||{});}})[_0xd8a8('0x22')](respondWithResult(_0xb3f0df,null))[_0xd8a8('0x40')](handleError(_0xb3f0df,null));};exports[_0xd8a8('0x52')]=function(_0xd1e013,_0x45aee4,_0x53626f){var _0x1929b6={};var _0x22ad66={};var _0x3f420d;var _0x3e82fe;return db[_0xd8a8('0x2a')]['findOne']({'where':{'id':_0xd1e013[_0xd8a8('0x42')]['id']}})[_0xd8a8('0x22')](handleEntityNotFound(_0x45aee4,null))[_0xd8a8('0x22')](function(_0x10fabc){if(_0x10fabc){_0x3f420d=_0x10fabc;_0x22ad66[_0xd8a8('0x33')]=_[_0xd8a8('0x43')](db['Action']['rawAttributes']);_0x22ad66[_0xd8a8('0x2f')]=_[_0xd8a8('0x43')](_0xd1e013[_0xd8a8('0x2f')]);_0x22ad66['filters']=_[_0xd8a8('0x31')](_0x22ad66['model'],_0x22ad66[_0xd8a8('0x2f')]);_0x1929b6[_0xd8a8('0x32')]=_['intersection'](_0x22ad66[_0xd8a8('0x33')],qs[_0xd8a8('0x34')](_0xd1e013[_0xd8a8('0x2f')][_0xd8a8('0x34')]));_0x1929b6[_0xd8a8('0x32')]=_0x1929b6[_0xd8a8('0x32')][_0xd8a8('0x44')]?_0x1929b6[_0xd8a8('0x32')]:_0x22ad66[_0xd8a8('0x33')];_0x1929b6['order']=qs[_0xd8a8('0x38')](_0xd1e013[_0xd8a8('0x2f')][_0xd8a8('0x38')]);_0x1929b6[_0xd8a8('0x39')]=qs[_0xd8a8('0x30')](_['pick'](_0xd1e013['query'],_0x22ad66[_0xd8a8('0x30')]));if(_0xd1e013[_0xd8a8('0x2f')][_0xd8a8('0x3b')]){_0x1929b6['where']=_[_0xd8a8('0x3c')](_0x1929b6['where'],{'$or':_['map'](_0x1929b6['attributes'],function(_0x17c2c5){var _0x2819e4={};_0x2819e4[_0x17c2c5]={'$like':'%'+_0xd1e013[_0xd8a8('0x2f')]['filter']+'%'};return _0x2819e4;})});}_0x1929b6=_['merge']({},_0x1929b6,_0xd1e013[_0xd8a8('0x46')]);return _0x3f420d[_0xd8a8('0x52')](_0x1929b6);}})[_0xd8a8('0x22')](function(_0x48d827){if(_0x48d827){_0x3e82fe=_0x48d827[_0xd8a8('0x44')];if(!_0xd1e013[_0xd8a8('0x2f')]['hasOwnProperty'](_0xd8a8('0x36'))){_0x1929b6[_0xd8a8('0x1a')]=qs[_0xd8a8('0x1a')](_0xd1e013[_0xd8a8('0x2f')][_0xd8a8('0x1a')]);_0x1929b6[_0xd8a8('0x19')]=qs[_0xd8a8('0x19')](_0xd1e013[_0xd8a8('0x2f')][_0xd8a8('0x19')]);}return _0x3f420d[_0xd8a8('0x52')](_0x1929b6);}})[_0xd8a8('0x22')](function(_0x296852){if(_0x296852){return _0x296852?{'count':_0x3e82fe,'rows':_0x296852}:null;}})[_0xd8a8('0x22')](respondWithResult(_0x45aee4,null))[_0xd8a8('0x40')](handleError(_0x45aee4,null));}; \ No newline at end of file +var _0x3de2=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','then','error','stack','name','send','map','Automation','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','body','params','destroy','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2ef291,_0x11d6f5){var _0x2c374b=function(_0x50aef6){while(--_0x50aef6){_0x2ef291['push'](_0x2ef291['shift']());}};_0x2c374b(++_0x11d6f5);}(_0x3de2,0x18c));var _0x23de=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x3de2[_0x2d2c16];return _0x53f2fb;};'use strict';var emlformat=require(_0x23de('0x0'));var rimraf=require(_0x23de('0x1'));var zipdir=require(_0x23de('0x2'));var jsonpatch=require(_0x23de('0x3'));var rp=require('request-promise');var moment=require(_0x23de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x23de('0x5'));var util=require('util');var path=require(_0x23de('0x6'));var sox=require(_0x23de('0x7'));var csv=require(_0x23de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23de('0x9'));var _=require(_0x23de('0xa'));var squel=require(_0x23de('0xb'));var crypto=require(_0x23de('0xc'));var jsforce=require(_0x23de('0xd'));var deskjs=require(_0x23de('0xe'));var toCsv=require(_0x23de('0x8'));var querystring=require(_0x23de('0xf'));var Papa=require('papaparse');var Redis=require(_0x23de('0x10'));var authService=require(_0x23de('0x11'));var qs=require(_0x23de('0x12'));var as=require(_0x23de('0x13'));var hardwareService=require(_0x23de('0x14'));var logger=require(_0x23de('0x15'))(_0x23de('0x16'));var utils=require(_0x23de('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x23de('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2abc2f,_0x4d0dae){_0x4d0dae=_0x4d0dae||0xcc;return function(_0x2d43e1){if(_0x2d43e1){return _0x2abc2f[_0x23de('0x19')](_0x4d0dae);}return _0x2abc2f[_0x23de('0x1a')](_0x4d0dae)[_0x23de('0x1b')]();};}function respondWithResult(_0x50457f,_0x560f54){_0x560f54=_0x560f54||0xc8;return function(_0x1b0402){if(_0x1b0402){return _0x50457f[_0x23de('0x1a')](_0x560f54)['json'](_0x1b0402);}};}function respondWithFilteredResult(_0x1d9a43,_0xd3c09c){return function(_0x55a2eb){if(_0x55a2eb){var _0x3b5422=typeof _0xd3c09c[_0x23de('0x1c')]===_0x23de('0x1d')&&typeof _0xd3c09c[_0x23de('0x1e')]==='undefined';var _0x526753=_0x55a2eb[_0x23de('0x1f')];var _0x48a28f=_0x3b5422?0x0:_0xd3c09c[_0x23de('0x1c')];var _0x457157=_0x3b5422?_0x55a2eb[_0x23de('0x1f')]:_0xd3c09c[_0x23de('0x1c')]+_0xd3c09c['limit'];var _0x1340fc;if(_0x457157>=_0x526753){_0x457157=_0x526753;_0x1340fc=0xc8;}else{_0x1340fc=0xce;}_0x1d9a43[_0x23de('0x1a')](_0x1340fc);return _0x1d9a43[_0x23de('0x20')](_0x23de('0x21'),_0x48a28f+'-'+_0x457157+'/'+_0x526753)['json'](_0x55a2eb);}return null;};}function patchUpdates(_0x474c1e){return function(_0x7c783c){try{jsonpatch['apply'](_0x7c783c,_0x474c1e,!![]);}catch(_0x307fa8){return BPromise[_0x23de('0x22')](_0x307fa8);}return _0x7c783c['save']();};}function saveUpdates(_0x2a37fe,_0x546747){return function(_0x49741a){if(_0x49741a){return _0x49741a['update'](_0x2a37fe)[_0x23de('0x23')](function(_0x563a16){return _0x563a16;});}return null;};}function removeEntity(_0x5f35c6,_0xcd3ab5){return function(_0x4ba55b){if(_0x4ba55b){return _0x4ba55b['destroy']()[_0x23de('0x23')](function(){_0x5f35c6[_0x23de('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x282c39,_0x2f2dc9){return function(_0x8f268c){if(!_0x8f268c){_0x282c39[_0x23de('0x19')](0x194);}return _0x8f268c;};}function handleError(_0x311e3c,_0x4c7160){_0x4c7160=_0x4c7160||0x1f4;return function(_0x1ded8c){logger[_0x23de('0x24')](_0x1ded8c[_0x23de('0x25')]);if(_0x1ded8c[_0x23de('0x26')]){delete _0x1ded8c[_0x23de('0x26')];}_0x311e3c[_0x23de('0x1a')](_0x4c7160)[_0x23de('0x27')](_0x1ded8c);};}exports['index']=function(_0x107552,_0x2c8a85){var _0x491180={},_0x6a4488={},_0x48a392={'count':0x0,'rows':[]};var _0x1072e6=_[_0x23de('0x28')](db[_0x23de('0x29')][_0x23de('0x2a')],function(_0x2f50ee){return{'name':_0x2f50ee[_0x23de('0x2b')],'type':_0x2f50ee[_0x23de('0x2c')][_0x23de('0x2d')]};});_0x6a4488['model']=_[_0x23de('0x28')](_0x1072e6,_0x23de('0x26'));_0x6a4488[_0x23de('0x2e')]=_[_0x23de('0x2f')](_0x107552['query']);_0x6a4488[_0x23de('0x30')]=_[_0x23de('0x31')](_0x6a4488[_0x23de('0x32')],_0x6a4488[_0x23de('0x2e')]);_0x491180[_0x23de('0x33')]=_['intersection'](_0x6a4488['model'],qs[_0x23de('0x34')](_0x107552[_0x23de('0x2e')][_0x23de('0x34')]));_0x491180['attributes']=_0x491180[_0x23de('0x33')]['length']?_0x491180[_0x23de('0x33')]:_0x6a4488['model'];if(!_0x107552[_0x23de('0x2e')][_0x23de('0x35')]('nolimit')){_0x491180[_0x23de('0x1e')]=qs[_0x23de('0x1e')](_0x107552['query'][_0x23de('0x1e')]);_0x491180[_0x23de('0x1c')]=qs['offset'](_0x107552['query'][_0x23de('0x1c')]);}_0x491180[_0x23de('0x36')]=qs[_0x23de('0x37')](_0x107552[_0x23de('0x2e')]['sort']);_0x491180['where']=qs[_0x23de('0x30')](_[_0x23de('0x38')](_0x107552[_0x23de('0x2e')],_0x6a4488[_0x23de('0x30')]),_0x1072e6);if(_0x107552[_0x23de('0x2e')][_0x23de('0x39')]){_0x491180[_0x23de('0x3a')]=_[_0x23de('0x3b')](_0x491180[_0x23de('0x3a')],{'$or':_[_0x23de('0x28')](_0x1072e6,function(_0x165ddb){if(_0x165ddb[_0x23de('0x2c')]!==_0x23de('0x3c')){var _0x3b72d7={};_0x3b72d7[_0x165ddb[_0x23de('0x26')]]={'$like':'%'+_0x107552[_0x23de('0x2e')][_0x23de('0x39')]+'%'};return _0x3b72d7;}})});}_0x491180=_['merge']({},_0x491180,_0x107552[_0x23de('0x3d')]);var _0x132982={'where':_0x491180[_0x23de('0x3a')]};return db[_0x23de('0x29')]['count'](_0x132982)[_0x23de('0x23')](function(_0x4fee3b){_0x48a392[_0x23de('0x1f')]=_0x4fee3b;if(_0x107552[_0x23de('0x2e')][_0x23de('0x3e')]){_0x491180[_0x23de('0x3f')]=[{'all':!![]}];}return db[_0x23de('0x29')][_0x23de('0x40')](_0x491180);})[_0x23de('0x23')](function(_0x48e632){_0x48a392[_0x23de('0x41')]=_0x48e632;return _0x48a392;})[_0x23de('0x23')](respondWithFilteredResult(_0x2c8a85,_0x491180))[_0x23de('0x42')](handleError(_0x2c8a85,null));};exports[_0x23de('0x43')]=function(_0x5f2cb4,_0x2fa991){var _0x26b9c5={'raw':![],'where':{'id':_0x5f2cb4['params']['id']}},_0x12240a={};_0x12240a['model']=_[_0x23de('0x2f')](db[_0x23de('0x29')][_0x23de('0x2a')]);_0x12240a[_0x23de('0x2e')]=_[_0x23de('0x2f')](_0x5f2cb4[_0x23de('0x2e')]);_0x12240a[_0x23de('0x30')]=_[_0x23de('0x31')](_0x12240a[_0x23de('0x32')],_0x12240a[_0x23de('0x2e')]);_0x26b9c5[_0x23de('0x33')]=_[_0x23de('0x31')](_0x12240a[_0x23de('0x32')],qs[_0x23de('0x34')](_0x5f2cb4['query'][_0x23de('0x34')]));_0x26b9c5[_0x23de('0x33')]=_0x26b9c5[_0x23de('0x33')][_0x23de('0x44')]?_0x26b9c5[_0x23de('0x33')]:_0x12240a[_0x23de('0x32')];if(_0x5f2cb4['query'][_0x23de('0x3e')]){_0x26b9c5[_0x23de('0x3f')]=[{'all':!![]}];}_0x26b9c5=_['merge']({},_0x26b9c5,_0x5f2cb4[_0x23de('0x3d')]);return db[_0x23de('0x29')][_0x23de('0x45')](_0x26b9c5)[_0x23de('0x23')](handleEntityNotFound(_0x2fa991,null))[_0x23de('0x23')](respondWithResult(_0x2fa991,null))[_0x23de('0x42')](handleError(_0x2fa991,null));};exports['create']=function(_0x26ba96,_0x121f05){return db[_0x23de('0x29')]['create'](_0x26ba96[_0x23de('0x46')],{})[_0x23de('0x23')](respondWithResult(_0x121f05,0xc9))[_0x23de('0x42')](handleError(_0x121f05,null));};exports['update']=function(_0x5842c9,_0x2378a3){if(_0x5842c9[_0x23de('0x46')]['id']){delete _0x5842c9[_0x23de('0x46')]['id'];}return db[_0x23de('0x29')][_0x23de('0x45')]({'where':{'id':_0x5842c9[_0x23de('0x47')]['id']}})[_0x23de('0x23')](handleEntityNotFound(_0x2378a3,null))[_0x23de('0x23')](saveUpdates(_0x5842c9[_0x23de('0x46')],null))[_0x23de('0x23')](respondWithResult(_0x2378a3,null))['catch'](handleError(_0x2378a3,null));};exports[_0x23de('0x48')]=function(_0x16eaf9,_0x2f43fa){return db['Automation']['find']({'where':{'id':_0x16eaf9[_0x23de('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f43fa,null))[_0x23de('0x23')](removeEntity(_0x2f43fa,null))[_0x23de('0x42')](handleError(_0x2f43fa,null));};exports[_0x23de('0x49')]=function(_0x416e6c,_0x5bff71,_0x589d25){return db[_0x23de('0x4a')][_0x23de('0x45')]({'where':{'id':_0x416e6c['params']['id']}})[_0x23de('0x23')](handleEntityNotFound(_0x5bff71,null))[_0x23de('0x23')](function(_0x441323){if(_0x441323){return _0x441323[_0x23de('0x49')](_0x416e6c[_0x23de('0x46')][_0x23de('0x4b')],_[_0x23de('0x4c')](_0x416e6c[_0x23de('0x46')],[_0x23de('0x4b'),'id'])||{});}})[_0x23de('0x23')](respondWithResult(_0x5bff71,null))[_0x23de('0x42')](handleError(_0x5bff71,null));};exports[_0x23de('0x4d')]=function(_0x41fd2c,_0x2213c2,_0x2897ac){var _0x37f2f1={};var _0x18def8={};var _0x470ccd;var _0x16a62f;return db[_0x23de('0x29')][_0x23de('0x4e')]({'where':{'id':_0x41fd2c['params']['id']}})[_0x23de('0x23')](handleEntityNotFound(_0x2213c2,null))[_0x23de('0x23')](function(_0x58f726){if(_0x58f726){_0x470ccd=_0x58f726;_0x18def8[_0x23de('0x32')]=_[_0x23de('0x2f')](db[_0x23de('0x4a')][_0x23de('0x2a')]);_0x18def8[_0x23de('0x2e')]=_['keys'](_0x41fd2c[_0x23de('0x2e')]);_0x18def8['filters']=_['intersection'](_0x18def8[_0x23de('0x32')],_0x18def8[_0x23de('0x2e')]);_0x37f2f1[_0x23de('0x33')]=_[_0x23de('0x31')](_0x18def8[_0x23de('0x32')],qs[_0x23de('0x34')](_0x41fd2c['query'][_0x23de('0x34')]));_0x37f2f1[_0x23de('0x33')]=_0x37f2f1[_0x23de('0x33')][_0x23de('0x44')]?_0x37f2f1[_0x23de('0x33')]:_0x18def8['model'];_0x37f2f1[_0x23de('0x36')]=qs['sort'](_0x41fd2c[_0x23de('0x2e')][_0x23de('0x37')]);_0x37f2f1['where']=qs['filters'](_[_0x23de('0x38')](_0x41fd2c[_0x23de('0x2e')],_0x18def8['filters']));if(_0x41fd2c['query']['filter']){_0x37f2f1[_0x23de('0x3a')]=_[_0x23de('0x3b')](_0x37f2f1[_0x23de('0x3a')],{'$or':_[_0x23de('0x28')](_0x37f2f1[_0x23de('0x33')],function(_0x41b1a9){var _0x5c389c={};_0x5c389c[_0x41b1a9]={'$like':'%'+_0x41fd2c[_0x23de('0x2e')][_0x23de('0x39')]+'%'};return _0x5c389c;})});}_0x37f2f1=_['merge']({},_0x37f2f1,_0x41fd2c[_0x23de('0x3d')]);return _0x470ccd[_0x23de('0x4d')](_0x37f2f1);}})[_0x23de('0x23')](function(_0x46b436){if(_0x46b436){_0x16a62f=_0x46b436[_0x23de('0x44')];if(!_0x41fd2c[_0x23de('0x2e')][_0x23de('0x35')](_0x23de('0x4f'))){_0x37f2f1[_0x23de('0x1e')]=qs['limit'](_0x41fd2c[_0x23de('0x2e')][_0x23de('0x1e')]);_0x37f2f1['offset']=qs[_0x23de('0x1c')](_0x41fd2c[_0x23de('0x2e')][_0x23de('0x1c')]);}return _0x470ccd['getConditions'](_0x37f2f1);}})[_0x23de('0x23')](function(_0x5a6b70){if(_0x5a6b70){return _0x5a6b70?{'count':_0x16a62f,'rows':_0x5a6b70}:null;}})[_0x23de('0x23')](respondWithResult(_0x2213c2,null))[_0x23de('0x42')](handleError(_0x2213c2,null));};exports[_0x23de('0x50')]=function(_0x19d204,_0x6757c3,_0x40c631){return db[_0x23de('0x51')][_0x23de('0x45')]({'where':{'id':_0x19d204['params']['id']}})[_0x23de('0x23')](handleEntityNotFound(_0x6757c3,null))[_0x23de('0x23')](function(_0x6e13b){if(_0x6e13b){return _0x6e13b[_0x23de('0x50')](_0x19d204[_0x23de('0x46')][_0x23de('0x4b')],_[_0x23de('0x4c')](_0x19d204[_0x23de('0x46')],[_0x23de('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x6757c3,null))[_0x23de('0x42')](handleError(_0x6757c3,null));};exports['getActions']=function(_0x7b1a44,_0x525566,_0x3318e9){var _0x71ad39={};var _0x4347e2={};var _0x44baea;var _0x2b6f98;return db[_0x23de('0x29')][_0x23de('0x4e')]({'where':{'id':_0x7b1a44[_0x23de('0x47')]['id']}})[_0x23de('0x23')](handleEntityNotFound(_0x525566,null))[_0x23de('0x23')](function(_0x400c4b){if(_0x400c4b){_0x44baea=_0x400c4b;_0x4347e2[_0x23de('0x32')]=_[_0x23de('0x2f')](db[_0x23de('0x51')][_0x23de('0x2a')]);_0x4347e2[_0x23de('0x2e')]=_['keys'](_0x7b1a44['query']);_0x4347e2[_0x23de('0x30')]=_[_0x23de('0x31')](_0x4347e2[_0x23de('0x32')],_0x4347e2[_0x23de('0x2e')]);_0x71ad39[_0x23de('0x33')]=_[_0x23de('0x31')](_0x4347e2[_0x23de('0x32')],qs[_0x23de('0x34')](_0x7b1a44[_0x23de('0x2e')][_0x23de('0x34')]));_0x71ad39[_0x23de('0x33')]=_0x71ad39[_0x23de('0x33')][_0x23de('0x44')]?_0x71ad39['attributes']:_0x4347e2['model'];_0x71ad39[_0x23de('0x36')]=qs[_0x23de('0x37')](_0x7b1a44[_0x23de('0x2e')]['sort']);_0x71ad39[_0x23de('0x3a')]=qs[_0x23de('0x30')](_[_0x23de('0x38')](_0x7b1a44[_0x23de('0x2e')],_0x4347e2[_0x23de('0x30')]));if(_0x7b1a44['query'][_0x23de('0x39')]){_0x71ad39['where']=_[_0x23de('0x3b')](_0x71ad39['where'],{'$or':_['map'](_0x71ad39[_0x23de('0x33')],function(_0x4ee5e5){var _0xf45362={};_0xf45362[_0x4ee5e5]={'$like':'%'+_0x7b1a44[_0x23de('0x2e')][_0x23de('0x39')]+'%'};return _0xf45362;})});}_0x71ad39=_[_0x23de('0x3b')]({},_0x71ad39,_0x7b1a44[_0x23de('0x3d')]);return _0x44baea[_0x23de('0x52')](_0x71ad39);}})['then'](function(_0x51ef51){if(_0x51ef51){_0x2b6f98=_0x51ef51[_0x23de('0x44')];if(!_0x7b1a44[_0x23de('0x2e')][_0x23de('0x35')]('nolimit')){_0x71ad39[_0x23de('0x1e')]=qs[_0x23de('0x1e')](_0x7b1a44[_0x23de('0x2e')][_0x23de('0x1e')]);_0x71ad39[_0x23de('0x1c')]=qs['offset'](_0x7b1a44[_0x23de('0x2e')]['offset']);}return _0x44baea['getActions'](_0x71ad39);}})[_0x23de('0x23')](function(_0x49e0ba){if(_0x49e0ba){return _0x49e0ba?{'count':_0x2b6f98,'rows':_0x49e0ba}:null;}})[_0x23de('0x23')](respondWithResult(_0x525566,null))[_0x23de('0x42')](handleError(_0x525566,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3f47072..b2862be 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 _0x577a=['api','bluebird','request-promise','path','define','Automation','tools_automations','util','../../config/logger'];(function(_0x5dac84,_0x3114b2){var _0x379fb1=function(_0x5e0bdf){while(--_0x5e0bdf){_0x5dac84['push'](_0x5dac84['shift']());}};_0x379fb1(++_0x3114b2);}(_0x577a,0x14b));var _0xa577=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x577a[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require('lodash');var util=require(_0xa577('0x0'));var logger=require(_0xa577('0x1'))(_0xa577('0x2'));var moment=require('moment');var BPromise=require(_0xa577('0x3'));var rp=require(_0xa577('0x4'));var fs=require('fs');var path=require(_0xa577('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x498475,_0x2511c7){return _0x498475[_0xa577('0x6')](_0xa577('0x7'),attributes,{'tableName':_0xa577('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacd3=['bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util','api','moment'];(function(_0x101417,_0xa218a8){var _0x5ab0e2=function(_0x430924){while(--_0x430924){_0x101417['push'](_0x101417['shift']());}};_0x5ab0e2(++_0xa218a8);}(_0xacd3,0x1f4));var _0x3acd=function(_0x511002,_0x438e6c){_0x511002=_0x511002-0x0;var _0x4d68fb=_0xacd3[_0x511002];return _0x4d68fb;};'use strict';var _=require(_0x3acd('0x0'));var util=require(_0x3acd('0x1'));var logger=require('../../config/logger')(_0x3acd('0x2'));var moment=require(_0x3acd('0x3'));var BPromise=require(_0x3acd('0x4'));var rp=require(_0x3acd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3acd('0x6'));var config=require(_0x3acd('0x7'));var attributes=require(_0x3acd('0x8'));module['exports']=function(_0x78b86f,_0x391aca){return _0x78b86f[_0x3acd('0x9')](_0x3acd('0xa'),attributes,{'tableName':_0x3acd('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 e4ac445..9ca2549 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 _0x94d4=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x472f45,_0x3bc432){var _0x3ad4a8=function(_0x444080){while(--_0x444080){_0x472f45['push'](_0x472f45['shift']());}};_0x3ad4a8(++_0x3bc432);}(_0x94d4,0xa5));var _0x494d=function(_0x4e5a56,_0x12c78c){_0x4e5a56=_0x4e5a56-0x0;var _0x1195e3=_0x94d4[_0x4e5a56];return _0x1195e3;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var moment=require('moment');var BPromise=require(_0x494d('0x2'));var rs=require(_0x494d('0x3'));var fs=require('fs');var Redis=require(_0x494d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x494d('0x5'));var logger=require(_0x494d('0x6'))(_0x494d('0x7'));var config=require(_0x494d('0x8'));var jayson=require(_0x494d('0x9'));var client=jayson[_0x494d('0xa')][_0x494d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c53d7,_0x4f4576,_0x5269db){return new BPromise(function(_0x396280,_0x3f6b68){return client['request'](_0x4c53d7,_0x5269db)['then'](function(_0x456fe8){logger[_0x494d('0xc')]('Automation,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));logger[_0x494d('0xe')](_0x494d('0xf'),_0x4f4576,_0x494d('0xd'),JSON['stringify'](_0x456fe8));if(_0x456fe8[_0x494d('0x10')]){if(_0x456fe8[_0x494d('0x10')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x3f6b68(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x396280(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}else{logger[_0x494d('0xc')]('Automation,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));_0x396280(_0x456fe8[_0x494d('0x13')][_0x494d('0x11')]);}})[_0x494d('0x14')](function(_0x120488){logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x120488);_0x3f6b68(_0x120488);});});} \ No newline at end of file +var _0x23db=['debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x23db,0x141));var _0xb23d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x23db[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xb23d('0x0'));var util=require(_0xb23d('0x1'));var moment=require(_0xb23d('0x2'));var BPromise=require(_0xb23d('0x3'));var rs=require(_0xb23d('0x4'));var fs=require('fs');var Redis=require(_0xb23d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb23d('0x6'))(_0xb23d('0x7'));var config=require('../../config/environment');var jayson=require(_0xb23d('0x8'));var client=jayson[_0xb23d('0x9')][_0xb23d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2056b6,_0x39799c,_0x38bed9){return new BPromise(function(_0x460fa0,_0x466785){return client[_0xb23d('0xb')](_0x2056b6,_0x38bed9)['then'](function(_0x2f91f0){logger[_0xb23d('0xc')](_0xb23d('0xd'),_0x39799c,_0xb23d('0xe'));logger[_0xb23d('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x39799c,'request\x20sent',JSON['stringify'](_0x2f91f0));if(_0x2f91f0[_0xb23d('0x10')]){if(_0x2f91f0['error'][_0xb23d('0x11')]===0x1f4){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x466785(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}logger['error'](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x460fa0(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}else{logger[_0xb23d('0xc')]('Automation,\x20%s,\x20%s',_0x39799c,'request\x20sent');_0x460fa0(_0x2f91f0[_0xb23d('0x13')][_0xb23d('0x12')]);}})[_0xb23d('0x14')](function(_0x9e5eb3){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x9e5eb3);_0x466785(_0x9e5eb3);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index e58cd11..3b8e752 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 _0x6c6f=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','/:id','show','get','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x30cb52,_0x638ecb){_0x30cb52=_0x30cb52-0x0;var _0x445ee0=_0x6c6f[_0x30cb52];return _0x445ee0;};'use strict';var multer=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var path=require(_0xf6c6('0x2'));var timeout=require(_0xf6c6('0x3'));var express=require(_0xf6c6('0x4'));var router=express[_0xf6c6('0x5')]();var fs_extra=require(_0xf6c6('0x6'));var auth=require(_0xf6c6('0x7'));var interaction=require(_0xf6c6('0x8'));var config=require(_0xf6c6('0x9'));var controller=require(_0xf6c6('0xa'));router['get']('/',auth[_0xf6c6('0xb')](),controller['index']);router['get'](_0xf6c6('0xc'),auth['isAuthenticated'](),controller[_0xf6c6('0xd')]);router[_0xf6c6('0xe')](_0xf6c6('0xf'),auth[_0xf6c6('0xb')](),controller[_0xf6c6('0x10')]);router['get'](_0xf6c6('0x11'),auth[_0xf6c6('0xb')](),controller['getActions']);router[_0xf6c6('0x12')]('/',auth[_0xf6c6('0xb')](),controller[_0xf6c6('0x13')]);router['post'](_0xf6c6('0xf'),auth[_0xf6c6('0xb')](),controller[_0xf6c6('0x14')]);router[_0xf6c6('0x12')](_0xf6c6('0x11'),auth[_0xf6c6('0xb')](),controller[_0xf6c6('0x15')]);router[_0xf6c6('0x16')](_0xf6c6('0xc'),auth[_0xf6c6('0xb')](),controller['update']);router[_0xf6c6('0x17')](_0xf6c6('0xc'),auth[_0xf6c6('0xb')](),controller[_0xf6c6('0x18')]);module['exports']=router; \ No newline at end of file +var _0x5343=['addActions','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','post','create','addConditions','/:id/actions'];(function(_0x710404,_0x224d2f){var _0xde02e6=function(_0x1eb552){while(--_0x1eb552){_0x710404['push'](_0x710404['shift']());}};_0xde02e6(++_0x224d2f);}(_0x5343,0x123));var _0x3534=function(_0x1bedf4,_0x35087f){_0x1bedf4=_0x1bedf4-0x0;var _0x339003=_0x5343[_0x1bedf4];return _0x339003;};'use strict';var multer=require(_0x3534('0x0'));var util=require(_0x3534('0x1'));var path=require(_0x3534('0x2'));var timeout=require(_0x3534('0x3'));var express=require('express');var router=express[_0x3534('0x4')]();var fs_extra=require(_0x3534('0x5'));var auth=require(_0x3534('0x6'));var interaction=require(_0x3534('0x7'));var config=require(_0x3534('0x8'));var controller=require(_0x3534('0x9'));router[_0x3534('0xa')]('/',auth[_0x3534('0xb')](),controller[_0x3534('0xc')]);router[_0x3534('0xa')](_0x3534('0xd'),auth[_0x3534('0xb')](),controller[_0x3534('0xe')]);router[_0x3534('0xa')](_0x3534('0xf'),auth[_0x3534('0xb')](),controller[_0x3534('0x10')]);router[_0x3534('0xa')]('/:id/actions',auth[_0x3534('0xb')](),controller['getActions']);router[_0x3534('0x11')]('/',auth['isAuthenticated'](),controller[_0x3534('0x12')]);router[_0x3534('0x11')](_0x3534('0xf'),auth[_0x3534('0xb')](),controller[_0x3534('0x13')]);router[_0x3534('0x11')](_0x3534('0x14'),auth[_0x3534('0xb')](),controller[_0x3534('0x15')]);router['put'](_0x3534('0xd'),auth[_0x3534('0xb')](),controller['update']);router[_0x3534('0x16')](_0x3534('0xd'),auth[_0x3534('0xb')](),controller['destroy']);module[_0x3534('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 76d9fd8..ebbf339 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 _0x8e53=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8e53,0xb6));var _0x38e5=function(_0x356f75,_0x1206c4){_0x356f75=_0x356f75-0x0;var _0x20ffdd=_0x8e53[_0x356f75];return _0x20ffdd;};'use strict';var Sequelize=require(_0x38e5('0x0'));module['exports']={'name':{'type':Sequelize[_0x38e5('0x1')],'unique':_0x38e5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x38e5('0x3')](_0x38e5('0x4')),'allowNull':![],'defaultValue':_0x38e5('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x38e5('0x5')],'defaultValue':0x0,'comment':_0x38e5('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x38e5('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x38e5('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38e5('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x38e5('0x9')](0x3)[_0x38e5('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38e5('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x38e5('0x9')](0x5)[_0x38e5('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38e5('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x38e5('0x9')](0x3)[_0x38e5('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38e5('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x38e5('0x9')](0x5)[_0x38e5('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38e5('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x38e5('0xa')],'defaultValue':0x3,'comment':_0x38e5('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x38e5('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38e5('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x38e5('0x9')](0x3)[_0x38e5('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x38e5('0x11')},'dialTimezone':{'type':Sequelize[_0x38e5('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x38e5('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x38e5('0x3')]('always',_0x38e5('0x12'),_0x38e5('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x38e5('0x5')],'defaultValue':0x0,'comment':_0x38e5('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x38e5('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x38e5('0x9')](0x9)[_0x38e5('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x38e5('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x38e5('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x38e5('0x9')](0x9)[_0x38e5('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x38e5('0x9')](0x9)[_0x38e5('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x38e5('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x38e5('0x9')](0x9)[_0x38e5('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x38e5('0x9')](0x9)[_0x38e5('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x38e5('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x38e5('0x9')](0x5)[_0x38e5('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x38e5('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x38e5('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x38e5('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x38e5('0x3')]('DESC',_0x38e5('0x1a')),'defaultValue':_0x38e5('0x1b')},'dialPrefix':{'type':Sequelize[_0x38e5('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x38e5('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x38e5('0x1c')},'dialCutDigit':{'type':Sequelize[_0x38e5('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x38e5('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x38e5('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38e5('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x38e5('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38e5('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x38e5('0x9')](0x3)[_0x38e5('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x38e5('0x9')](0x5)[_0x38e5('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38e5('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x38e5('0x9')](0x3)[_0x38e5('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38e5('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x38e5('0x9')](0x5)[_0x38e5('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x38e5('0x9')](0x3)[_0x38e5('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38e5('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x38e5('0x9')](0x5)[_0x38e5('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38e5('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x38e5('0x9')](0x3)[_0x38e5('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x38e5('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x38e5('0x9')](0x5)[_0x38e5('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x38e5('0x25')}}; \ No newline at end of file +var _0x22d7=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x5b48f4,_0x3ccf49){var _0x4a71fa=function(_0x356cfd){while(--_0x356cfd){_0x5b48f4['push'](_0x5b48f4['shift']());}};_0x4a71fa(++_0x3ccf49);}(_0x22d7,0x121));var _0x722d=function(_0x5999ba,_0x97b26a){_0x5999ba=_0x5999ba-0x0;var _0x2140b5=_0x22d7[_0x5999ba];return _0x2140b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x722d('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x722d('0x1')](_0x722d('0x2')),'allowNull':![],'defaultValue':_0x722d('0x2')},'description':{'type':Sequelize[_0x722d('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x722d('0x3')},'limitCalls':{'type':Sequelize[_0x722d('0x4')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x722d('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0x722d('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x722d('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x722d('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x722d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x722d('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x722d('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x722d('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x722d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x722d('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x722d('0x6')],'defaultValue':0x3,'comment':_0x722d('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x722d('0x4')](0x5)[_0x722d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x722d('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x722d('0xe')},'dialTimezone':{'type':Sequelize[_0x722d('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x722d('0x0')],'defaultValue':_0x722d('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x722d('0x10'),_0x722d('0x11')),'defaultValue':_0x722d('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x722d('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x722d('0x4')](0x9)[_0x722d('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x722d('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x722d('0x4')](0x9)[_0x722d('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x722d('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x722d('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x722d('0x4')](0x9)[_0x722d('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x722d('0x4')](0x9)[_0x722d('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x722d('0x4')](0x9)[_0x722d('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x722d('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x722d('0x4')](0x9)[_0x722d('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x722d('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x722d('0x4')](0x5)[_0x722d('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x722d('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x722d('0x4')](0x9)[_0x722d('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x722d('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x722d('0x1b'),_0x722d('0x1c')),'defaultValue':_0x722d('0x1b')},'dialPrefix':{'type':Sequelize[_0x722d('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x722d('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x722d('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x722d('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x722d('0x4')](0x5)[_0x722d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x722d('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x722d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x722d('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x722d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x722d('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x722d('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x722d('0x4')](0x5)[_0x722d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x722d('0x4')](0x3)[_0x722d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x722d('0x4')](0x5)[_0x722d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x722d('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 6924a62..1582dc9 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 _0x2746=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','error','send','index','map','Campaign','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','role','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','ids','spread','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','NOW()','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset'];(function(_0x3d9b04,_0x1e851a){var _0x557936=function(_0x3bf3ae){while(--_0x3bf3ae){_0x3d9b04['push'](_0x3d9b04['shift']());}};_0x557936(++_0x1e851a);}(_0x2746,0x19c));var _0x6274=function(_0x237ed0,_0x58f4e9){_0x237ed0=_0x237ed0-0x0;var _0x14fc5c=_0x2746[_0x237ed0];return _0x14fc5c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6274('0x0'));var jsonpatch=require(_0x6274('0x1'));var rp=require(_0x6274('0x2'));var moment=require(_0x6274('0x3'));var BPromise=require(_0x6274('0x4'));var Mustache=require(_0x6274('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6274('0x6'));var csv=require(_0x6274('0x7'));var ejs=require(_0x6274('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6274('0x9'));var squel=require(_0x6274('0xa'));var crypto=require(_0x6274('0xb'));var jsforce=require(_0x6274('0xc'));var deskjs=require(_0x6274('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6274('0xe'));var Papa=require('papaparse');var Redis=require(_0x6274('0xf'));var authService=require(_0x6274('0x10'));var qs=require(_0x6274('0x11'));var as=require(_0x6274('0x12'));var hardwareService=require(_0x6274('0x13'));var logger=require(_0x6274('0x14'))(_0x6274('0x15'));var utils=require(_0x6274('0x16'));var config=require(_0x6274('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59a0a1,_0xd3a0a2){_0xd3a0a2=_0xd3a0a2||0xcc;return function(_0x479fdc){if(_0x479fdc){return _0x59a0a1[_0x6274('0x18')](_0xd3a0a2);}return _0x59a0a1[_0x6274('0x19')](_0xd3a0a2)[_0x6274('0x1a')]();};}function respondWithResult(_0x4f4f9e,_0x58a4e3){_0x58a4e3=_0x58a4e3||0xc8;return function(_0x488b60){if(_0x488b60){return _0x4f4f9e[_0x6274('0x19')](_0x58a4e3)[_0x6274('0x1b')](_0x488b60);}};}function respondWithFilteredResult(_0x4b581a,_0x5e6ff8){return function(_0x425c8b){if(_0x425c8b){var _0x1d0dc4=typeof _0x5e6ff8[_0x6274('0x1c')]===_0x6274('0x1d')&&typeof _0x5e6ff8[_0x6274('0x1e')]==='undefined';var _0x3219d1=_0x425c8b[_0x6274('0x1f')];var _0x40cc32=_0x1d0dc4?0x0:_0x5e6ff8['offset'];var _0x5cdf5e=_0x1d0dc4?_0x425c8b[_0x6274('0x1f')]:_0x5e6ff8['offset']+_0x5e6ff8['limit'];var _0x402b97;if(_0x5cdf5e>=_0x3219d1){_0x5cdf5e=_0x3219d1;_0x402b97=0xc8;}else{_0x402b97=0xce;}_0x4b581a['status'](_0x402b97);return _0x4b581a[_0x6274('0x20')](_0x6274('0x21'),_0x40cc32+'-'+_0x5cdf5e+'/'+_0x3219d1)['json'](_0x425c8b);}return null;};}function patchUpdates(_0x55dab9){return function(_0x3e0248){try{jsonpatch[_0x6274('0x22')](_0x3e0248,_0x55dab9,!![]);}catch(_0xe2b388){return BPromise[_0x6274('0x23')](_0xe2b388);}return _0x3e0248[_0x6274('0x24')]();};}function saveUpdates(_0x221c7a,_0x3b8fb6){return function(_0x12df93){if(_0x12df93){return _0x12df93[_0x6274('0x25')](_0x221c7a)[_0x6274('0x26')](function(_0x1d1a09){return _0x1d1a09;});}return null;};}function removeEntity(_0xc49220,_0x125f14){return function(_0xa0c8bd){if(_0xa0c8bd){return _0xa0c8bd[_0x6274('0x27')]()[_0x6274('0x26')](function(){var _0x2c1978=_0xa0c8bd[_0x6274('0x28')]({'plain':!![]});var _0x5228a1=_0x6274('0x29');return db['UserProfileResource'][_0x6274('0x27')]({'where':{'type':_0x5228a1,'resourceId':_0x2c1978['id']}})['then'](function(){return _0xa0c8bd;});})[_0x6274('0x26')](function(){_0xc49220[_0x6274('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x416fac,_0x5c272f){return function(_0x54b923){if(!_0x54b923){_0x416fac[_0x6274('0x18')](0x194);}return _0x54b923;};}function handleError(_0x375641,_0x39062a){_0x39062a=_0x39062a||0x1f4;return function(_0x490541){logger[_0x6274('0x2a')](_0x490541['stack']);if(_0x490541['name']){delete _0x490541['name'];}_0x375641[_0x6274('0x19')](_0x39062a)[_0x6274('0x2b')](_0x490541);};}exports[_0x6274('0x2c')]=function(_0x123454,_0x3b2598){var _0x3bd82d={},_0x4d0a32={},_0x3c7864={'count':0x0,'rows':[]};var _0x45d24c=_[_0x6274('0x2d')](db[_0x6274('0x2e')][_0x6274('0x2f')],function(_0x232b1f){return{'name':_0x232b1f[_0x6274('0x30')],'type':_0x232b1f['type']['key']};});_0x4d0a32[_0x6274('0x31')]=_[_0x6274('0x2d')](_0x45d24c,_0x6274('0x32'));_0x4d0a32[_0x6274('0x33')]=_[_0x6274('0x34')](_0x123454[_0x6274('0x33')]);_0x4d0a32[_0x6274('0x35')]=_[_0x6274('0x36')](_0x4d0a32[_0x6274('0x31')],_0x4d0a32[_0x6274('0x33')]);_0x3bd82d[_0x6274('0x37')]=_[_0x6274('0x36')](_0x4d0a32['model'],qs[_0x6274('0x38')](_0x123454[_0x6274('0x33')][_0x6274('0x38')]));_0x3bd82d[_0x6274('0x37')]=_0x3bd82d[_0x6274('0x37')][_0x6274('0x39')]?_0x3bd82d['attributes']:_0x4d0a32['model'];if(!_0x123454['query'][_0x6274('0x3a')](_0x6274('0x3b'))){_0x3bd82d[_0x6274('0x1e')]=qs[_0x6274('0x1e')](_0x123454[_0x6274('0x33')][_0x6274('0x1e')]);_0x3bd82d[_0x6274('0x1c')]=qs[_0x6274('0x1c')](_0x123454[_0x6274('0x33')][_0x6274('0x1c')]);}_0x3bd82d[_0x6274('0x3c')]=qs[_0x6274('0x3d')](_0x123454[_0x6274('0x33')][_0x6274('0x3d')]);_0x3bd82d[_0x6274('0x3e')]=qs[_0x6274('0x35')](_[_0x6274('0x3f')](_0x123454[_0x6274('0x33')],_0x4d0a32['filters']),_0x45d24c);if(_0x123454[_0x6274('0x33')][_0x6274('0x40')]){_0x3bd82d[_0x6274('0x3e')]=_[_0x6274('0x41')](_0x3bd82d[_0x6274('0x3e')],{'$or':_[_0x6274('0x2d')](_0x45d24c,function(_0xf55aeb){if(_0xf55aeb[_0x6274('0x42')]!=='VIRTUAL'){var _0x513bd6={};_0x513bd6[_0xf55aeb[_0x6274('0x32')]]={'$like':'%'+_0x123454[_0x6274('0x33')][_0x6274('0x40')]+'%'};return _0x513bd6;}})});}_0x3bd82d=_[_0x6274('0x41')]({},_0x3bd82d,_0x123454[_0x6274('0x43')]);var _0x2e7c5f={'where':_0x3bd82d['where']};return db['Campaign'][_0x6274('0x1f')](_0x2e7c5f)['then'](function(_0x4d3c2a){_0x3c7864['count']=_0x4d3c2a;if(_0x123454[_0x6274('0x33')]['includeAll']){_0x3bd82d[_0x6274('0x44')]=[{'all':!![]}];}return db[_0x6274('0x2e')][_0x6274('0x45')](_0x3bd82d);})[_0x6274('0x26')](function(_0x4da418){_0x3c7864[_0x6274('0x46')]=_0x4da418;return _0x3c7864;})[_0x6274('0x26')](respondWithFilteredResult(_0x3b2598,_0x3bd82d))[_0x6274('0x47')](handleError(_0x3b2598,null));};exports['show']=function(_0x39b56c,_0x5f1fa2){var _0x1f2e1f={'raw':![],'where':{'id':_0x39b56c[_0x6274('0x48')]['id']}},_0x56fc3d={};_0x56fc3d[_0x6274('0x31')]=_[_0x6274('0x34')](db[_0x6274('0x2e')]['rawAttributes']);_0x56fc3d['query']=_['keys'](_0x39b56c[_0x6274('0x33')]);_0x56fc3d[_0x6274('0x35')]=_['intersection'](_0x56fc3d[_0x6274('0x31')],_0x56fc3d[_0x6274('0x33')]);_0x1f2e1f['attributes']=_[_0x6274('0x36')](_0x56fc3d[_0x6274('0x31')],qs[_0x6274('0x38')](_0x39b56c[_0x6274('0x33')]['fields']));_0x1f2e1f[_0x6274('0x37')]=_0x1f2e1f[_0x6274('0x37')][_0x6274('0x39')]?_0x1f2e1f[_0x6274('0x37')]:_0x56fc3d['model'];if(_0x39b56c[_0x6274('0x33')][_0x6274('0x49')]){_0x1f2e1f['include']=[{'all':!![]}];}_0x1f2e1f=_['merge']({},_0x1f2e1f,_0x39b56c[_0x6274('0x43')]);return db[_0x6274('0x2e')][_0x6274('0x4a')](_0x1f2e1f)[_0x6274('0x26')](handleEntityNotFound(_0x5f1fa2,null))[_0x6274('0x26')](respondWithResult(_0x5f1fa2,null))['catch'](handleError(_0x5f1fa2,null));};exports[_0x6274('0x4b')]=function(_0x18dab3,_0x5bb7bd){return db[_0x6274('0x2e')]['create'](_0x18dab3[_0x6274('0x4c')],{})['then'](function(_0x277ec7){var _0xc07326=_0x18dab3['user'][_0x6274('0x28')]({'plain':!![]});if(!_0xc07326)throw new Error(_0x6274('0x4d'));if(_0xc07326['role']==='user'){var _0x4cd287=_0x277ec7[_0x6274('0x28')]({'plain':!![]});var _0x520135='IvrCampaigns';return db[_0x6274('0x4e')][_0x6274('0x4a')]({'where':{'name':_0x520135,'userProfileId':_0xc07326[_0x6274('0x4f')]},'raw':!![]})[_0x6274('0x26')](function(_0x3453aa){if(_0x3453aa&&_0x3453aa[_0x6274('0x50')]===0x0){return db[_0x6274('0x51')][_0x6274('0x4b')]({'name':_0x4cd287[_0x6274('0x32')],'resourceId':_0x4cd287['id'],'type':_0x3453aa[_0x6274('0x32')],'sectionId':_0x3453aa['id']},{})['then'](function(){return _0x277ec7;});}else{return _0x277ec7;}})['catch'](function(_0x2d5fe3){logger[_0x6274('0x2a')](_0x6274('0x52'),_0x2d5fe3);throw _0x2d5fe3;});}return _0x277ec7;})[_0x6274('0x26')](respondWithResult(_0x5bb7bd,0xc9))[_0x6274('0x47')](handleError(_0x5bb7bd,null));};exports[_0x6274('0x53')]=function(_0x12c731,_0x414dbe){var _0x274707={'where':{'id':_0x12c731[_0x6274('0x48')]['id']}},_0x597181={};_0x597181[_0x6274('0x31')]=_[_0x6274('0x34')](db[_0x6274('0x2e')][_0x6274('0x2f')]);_0x274707[_0x6274('0x37')]=_[_0x6274('0x36')](_0x597181[_0x6274('0x31')],qs['fields'](_0x12c731[_0x6274('0x33')]['fields']));_0x274707['attributes']=_0x274707[_0x6274('0x37')][_0x6274('0x39')]?_0x274707[_0x6274('0x37')]:_0x597181[_0x6274('0x31')];if(_0x12c731['query']['includeAll']){_0x274707[_0x6274('0x44')]=[{'all':!![]}];}_0x274707=_[_0x6274('0x41')]({},_0x274707,_0x12c731['options']);return db[_0x6274('0x2e')][_0x6274('0x4a')](_0x274707)[_0x6274('0x26')](handleEntityNotFound(_0x414dbe,null))[_0x6274('0x26')](function(_0xd866a){if(_0xd866a){var _0x5db76f=_0xd866a[_0x6274('0x28')]({'plain':!![]});_0x5db76f=qs[_0x6274('0x54')](_0x5db76f,['id',_0x6274('0x55'),_0x6274('0x56')]);_0x12c731[_0x6274('0x4c')]=_['omit'](_0x12c731['body'],['id',_0x6274('0x55'),_0x6274('0x56')]);return db[_0x6274('0x2e')][_0x6274('0x4b')](_['merge'](_0x5db76f,_0x12c731['body']),{'include':_0x12c731[_0x6274('0x33')][_0x6274('0x49')]?[{'all':!![]}]:undefined})[_0x6274('0x26')](function(_0x2dae61){var _0xf2188d=_0x12c731[_0x6274('0x57')][_0x6274('0x28')]({'plain':!![]});if(!_0xf2188d)throw new Error(_0x6274('0x4d'));if(_0xf2188d[_0x6274('0x58')]===_0x6274('0x57')){var _0x388404=_0x2dae61[_0x6274('0x28')]({'plain':!![]});var _0x4133db=_0x6274('0x29');return db[_0x6274('0x4e')][_0x6274('0x4a')]({'where':{'name':_0x4133db,'userProfileId':_0xf2188d[_0x6274('0x4f')]},'raw':!![]})[_0x6274('0x26')](function(_0x2c380c){if(_0x2c380c&&_0x2c380c[_0x6274('0x50')]===0x0){return db[_0x6274('0x51')][_0x6274('0x4b')]({'name':_0x388404[_0x6274('0x32')],'resourceId':_0x388404['id'],'type':_0x2c380c[_0x6274('0x32')],'sectionId':_0x2c380c['id']},{})[_0x6274('0x26')](function(){return _0x2dae61;});}else{return _0x2dae61;}})[_0x6274('0x47')](function(_0x10e8ad){logger[_0x6274('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10e8ad);throw _0x10e8ad;});}return _0x2dae61;});}})[_0x6274('0x26')](respondWithResult(_0x414dbe,0xc9))[_0x6274('0x47')](handleError(_0x414dbe,null));};exports[_0x6274('0x25')]=function(_0x2bba78,_0x12750c){if(_0x2bba78[_0x6274('0x4c')]['id']){delete _0x2bba78[_0x6274('0x4c')]['id'];}return db[_0x6274('0x2e')][_0x6274('0x4a')]({'where':{'id':_0x2bba78[_0x6274('0x48')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x12750c,null))[_0x6274('0x26')](saveUpdates(_0x2bba78['body'],null))[_0x6274('0x26')](respondWithResult(_0x12750c,null))[_0x6274('0x47')](handleError(_0x12750c,null));};exports[_0x6274('0x27')]=function(_0x44ec97,_0x1ae76c){return db['Campaign']['find']({'where':{'id':_0x44ec97['params']['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x1ae76c,null))[_0x6274('0x26')](removeEntity(_0x1ae76c,null))['catch'](handleError(_0x1ae76c,null));};exports[_0x6274('0x59')]=function(_0x5116d6,_0x5a525b,_0x5aac85){var _0x4b9378={'raw':!![],'where':{}};var _0xdbc965={};var _0x1191af={'count':0x0,'rows':[]};return db[_0x6274('0x2e')][_0x6274('0x5a')]({'where':{'id':_0x5116d6[_0x6274('0x48')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x5a525b,null))[_0x6274('0x26')](function(_0x430ecf){if(_0x430ecf){_0xdbc965['model']=_[_0x6274('0x34')](db[_0x6274('0x5b')][_0x6274('0x2f')]);_0xdbc965[_0x6274('0x33')]=_[_0x6274('0x34')](_0x5116d6[_0x6274('0x33')]);_0xdbc965[_0x6274('0x35')]=_[_0x6274('0x36')](_0xdbc965['model'],_0xdbc965[_0x6274('0x33')]);_0x4b9378['attributes']=_[_0x6274('0x36')](_0xdbc965[_0x6274('0x31')],qs[_0x6274('0x38')](_0x5116d6[_0x6274('0x33')]['fields']));_0x4b9378[_0x6274('0x37')]=_0x4b9378[_0x6274('0x37')]['length']?_0x4b9378['attributes']:_0xdbc965['model'];if(!_0x5116d6[_0x6274('0x33')]['hasOwnProperty'](_0x6274('0x3b'))){_0x4b9378[_0x6274('0x1e')]=qs[_0x6274('0x1e')](_0x5116d6[_0x6274('0x33')]['limit']);_0x4b9378['offset']=qs['offset'](_0x5116d6[_0x6274('0x33')][_0x6274('0x1c')]);}_0x4b9378[_0x6274('0x3c')]=qs['sort'](_0x5116d6[_0x6274('0x33')]['sort']);_0x4b9378[_0x6274('0x3e')]=qs[_0x6274('0x35')](_[_0x6274('0x3f')](_0x5116d6['query'],_0xdbc965[_0x6274('0x35')]));_0x4b9378[_0x6274('0x3e')][_0x6274('0x5c')]=_0x430ecf['id'];if(_0x5116d6[_0x6274('0x33')][_0x6274('0x40')]){_0x4b9378[_0x6274('0x3e')]=_[_0x6274('0x41')](_0x4b9378[_0x6274('0x3e')],{'$or':_['map'](_0x4b9378[_0x6274('0x37')],function(_0x5015aa){var _0x39cc11={};_0x39cc11[_0x5015aa]={'$like':'%'+_0x5116d6['query'][_0x6274('0x40')]+'%'};return _0x39cc11;})});}_0x4b9378=_[_0x6274('0x41')]({},_0x4b9378,_0x5116d6[_0x6274('0x43')]);return db[_0x6274('0x5b')]['count']({'where':_0x4b9378[_0x6274('0x3e')]})['then'](function(_0x3a9efb){_0x1191af[_0x6274('0x1f')]=_0x3a9efb;if(_0x5116d6['query']['includeAll']){_0x4b9378[_0x6274('0x44')]=[{'all':!![]}];}return db[_0x6274('0x5b')][_0x6274('0x45')](_0x4b9378);})[_0x6274('0x26')](function(_0x3d3fe9){_0x1191af[_0x6274('0x46')]=_0x3d3fe9;return _0x1191af;});}})[_0x6274('0x26')](respondWithFilteredResult(_0x5a525b,_0x4b9378))['catch'](handleError(_0x5a525b,null));};exports[_0x6274('0x5d')]=function(_0xa75214,_0x2c959f,_0x4bdf9c){var _0x81cf67={'raw':!![],'where':{}};var _0x2b6f1e={};var _0x2f0f96={'count':0x0,'rows':[]};return db[_0x6274('0x2e')]['findOne']({'where':{'id':_0xa75214[_0x6274('0x48')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x2c959f,null))[_0x6274('0x26')](function(_0x3109f6){if(_0x3109f6){_0x2b6f1e[_0x6274('0x31')]=_[_0x6274('0x34')](db[_0x6274('0x5e')]['rawAttributes']);_0x2b6f1e[_0x6274('0x33')]=_[_0x6274('0x34')](_0xa75214[_0x6274('0x33')]);_0x2b6f1e[_0x6274('0x35')]=_['intersection'](_0x2b6f1e[_0x6274('0x31')],_0x2b6f1e[_0x6274('0x33')]);_0x81cf67['attributes']=_[_0x6274('0x36')](_0x2b6f1e[_0x6274('0x31')],qs['fields'](_0xa75214[_0x6274('0x33')][_0x6274('0x38')]));_0x81cf67[_0x6274('0x37')]=_0x81cf67[_0x6274('0x37')]['length']?_0x81cf67[_0x6274('0x37')]:_0x2b6f1e[_0x6274('0x31')];if(!_0xa75214[_0x6274('0x33')][_0x6274('0x3a')](_0x6274('0x3b'))){_0x81cf67[_0x6274('0x1e')]=qs['limit'](_0xa75214['query'][_0x6274('0x1e')]);_0x81cf67[_0x6274('0x1c')]=qs['offset'](_0xa75214['query'][_0x6274('0x1c')]);}_0x81cf67[_0x6274('0x3c')]=qs[_0x6274('0x3d')](_0xa75214[_0x6274('0x33')][_0x6274('0x3d')]);_0x81cf67[_0x6274('0x3e')]=qs['filters'](_[_0x6274('0x3f')](_0xa75214[_0x6274('0x33')],_0x2b6f1e[_0x6274('0x35')]));_0x81cf67[_0x6274('0x3e')]['CampaignId']=_0x3109f6['id'];if(_0xa75214[_0x6274('0x33')][_0x6274('0x40')]){_0x81cf67['where']=_[_0x6274('0x41')](_0x81cf67['where'],{'$or':_[_0x6274('0x2d')](_0x81cf67[_0x6274('0x37')],function(_0x4db898){var _0x21d4e3={};_0x21d4e3[_0x4db898]={'$like':'%'+_0xa75214[_0x6274('0x33')][_0x6274('0x40')]+'%'};return _0x21d4e3;})});}_0x81cf67=_[_0x6274('0x41')]({},_0x81cf67,_0xa75214[_0x6274('0x43')]);return db[_0x6274('0x5e')][_0x6274('0x1f')]({'where':_0x81cf67[_0x6274('0x3e')]})[_0x6274('0x26')](function(_0x573e01){_0x2f0f96[_0x6274('0x1f')]=_0x573e01;if(_0xa75214['query'][_0x6274('0x49')]){_0x81cf67[_0x6274('0x44')]=[{'all':!![]}];}return db[_0x6274('0x5e')][_0x6274('0x45')](_0x81cf67);})[_0x6274('0x26')](function(_0x2f6ec2){_0x2f0f96['rows']=_0x2f6ec2;return _0x2f0f96;});}})['then'](respondWithFilteredResult(_0x2c959f,_0x81cf67))['catch'](handleError(_0x2c959f,null));};exports[_0x6274('0x5f')]=function(_0x5abfdf,_0x2ed4e0,_0x2b0e1e){var _0x2885e3={'raw':!![],'where':{}};var _0x484dcd={};var _0x182c4b={'count':0x0,'rows':[]};return db[_0x6274('0x2e')]['findOne']({'where':{'id':_0x5abfdf['params']['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x2ed4e0,null))[_0x6274('0x26')](function(_0x5ad69b){if(_0x5ad69b){_0x484dcd[_0x6274('0x31')]=_[_0x6274('0x34')](db[_0x6274('0x60')]['rawAttributes']);_0x484dcd[_0x6274('0x33')]=_[_0x6274('0x34')](_0x5abfdf[_0x6274('0x33')]);_0x484dcd[_0x6274('0x35')]=_['intersection'](_0x484dcd[_0x6274('0x31')],_0x484dcd[_0x6274('0x33')]);_0x2885e3[_0x6274('0x37')]=_[_0x6274('0x36')](_0x484dcd[_0x6274('0x31')],qs['fields'](_0x5abfdf[_0x6274('0x33')][_0x6274('0x38')]));_0x2885e3[_0x6274('0x37')]=_0x2885e3[_0x6274('0x37')][_0x6274('0x39')]?_0x2885e3['attributes']:_0x484dcd[_0x6274('0x31')];if(!_0x5abfdf['query'][_0x6274('0x3a')](_0x6274('0x3b'))){_0x2885e3['limit']=qs[_0x6274('0x1e')](_0x5abfdf[_0x6274('0x33')][_0x6274('0x1e')]);_0x2885e3['offset']=qs['offset'](_0x5abfdf[_0x6274('0x33')][_0x6274('0x1c')]);}_0x2885e3[_0x6274('0x3c')]=qs[_0x6274('0x3d')](_0x5abfdf[_0x6274('0x33')][_0x6274('0x3d')]);_0x2885e3[_0x6274('0x3e')]=qs['filters'](_[_0x6274('0x3f')](_0x5abfdf[_0x6274('0x33')],_0x484dcd['filters']));_0x2885e3[_0x6274('0x3e')]['CampaignId']=_0x5ad69b['id'];if(_0x5abfdf[_0x6274('0x33')]['filter']){_0x2885e3[_0x6274('0x3e')]=_[_0x6274('0x41')](_0x2885e3[_0x6274('0x3e')],{'$or':_[_0x6274('0x2d')](_0x2885e3[_0x6274('0x37')],function(_0x1680c9){var _0x12654d={};_0x12654d[_0x1680c9]={'$like':'%'+_0x5abfdf['query'][_0x6274('0x40')]+'%'};return _0x12654d;})});}_0x2885e3=_[_0x6274('0x41')]({},_0x2885e3,_0x5abfdf[_0x6274('0x43')]);return db[_0x6274('0x60')][_0x6274('0x1f')]({'where':_0x2885e3[_0x6274('0x3e')]})[_0x6274('0x26')](function(_0xe5d88b){_0x182c4b[_0x6274('0x1f')]=_0xe5d88b;if(_0x5abfdf[_0x6274('0x33')][_0x6274('0x49')]){_0x2885e3[_0x6274('0x44')]=[{'all':!![]}];}return db[_0x6274('0x60')][_0x6274('0x45')](_0x2885e3);})[_0x6274('0x26')](function(_0x281d89){_0x182c4b[_0x6274('0x46')]=_0x281d89;return _0x182c4b;});}})[_0x6274('0x26')](respondWithFilteredResult(_0x2ed4e0,_0x2885e3))[_0x6274('0x47')](handleError(_0x2ed4e0,null));};exports[_0x6274('0x61')]=function(_0x3f669b,_0x55f1ad,_0x16d84a){var _0x24f4c6={'raw':!![],'where':{}};var _0x3fcf92={};var _0x30bd87={'count':0x0,'rows':[]};return db[_0x6274('0x2e')][_0x6274('0x5a')]({'where':{'id':_0x3f669b[_0x6274('0x48')]['id']}})['then'](handleEntityNotFound(_0x55f1ad,null))[_0x6274('0x26')](function(_0x359363){if(_0x359363){_0x3fcf92[_0x6274('0x31')]=_[_0x6274('0x34')](db['CmHopperBlack']['rawAttributes']);_0x3fcf92[_0x6274('0x33')]=_[_0x6274('0x34')](_0x3f669b['query']);_0x3fcf92['filters']=_[_0x6274('0x36')](_0x3fcf92['model'],_0x3fcf92['query']);_0x24f4c6['attributes']=_['intersection'](_0x3fcf92['model'],qs['fields'](_0x3f669b['query'][_0x6274('0x38')]));_0x24f4c6[_0x6274('0x37')]=_0x24f4c6[_0x6274('0x37')][_0x6274('0x39')]?_0x24f4c6[_0x6274('0x37')]:_0x3fcf92[_0x6274('0x31')];if(!_0x3f669b[_0x6274('0x33')][_0x6274('0x3a')]('nolimit')){_0x24f4c6[_0x6274('0x1e')]=qs[_0x6274('0x1e')](_0x3f669b[_0x6274('0x33')][_0x6274('0x1e')]);_0x24f4c6['offset']=qs[_0x6274('0x1c')](_0x3f669b[_0x6274('0x33')]['offset']);}_0x24f4c6['order']=qs[_0x6274('0x3d')](_0x3f669b[_0x6274('0x33')][_0x6274('0x3d')]);_0x24f4c6['where']=qs[_0x6274('0x35')](_[_0x6274('0x3f')](_0x3f669b['query'],_0x3fcf92[_0x6274('0x35')]));_0x24f4c6[_0x6274('0x3e')][_0x6274('0x5c')]=_0x359363['id'];if(_0x3f669b[_0x6274('0x33')][_0x6274('0x40')]){_0x24f4c6['where']=_['merge'](_0x24f4c6[_0x6274('0x3e')],{'$or':_[_0x6274('0x2d')](_0x24f4c6['attributes'],function(_0x1406d6){var _0x40185f={};_0x40185f[_0x1406d6]={'$like':'%'+_0x3f669b['query'][_0x6274('0x40')]+'%'};return _0x40185f;})});}_0x24f4c6=_[_0x6274('0x41')]({},_0x24f4c6,_0x3f669b[_0x6274('0x43')]);return db[_0x6274('0x62')][_0x6274('0x1f')]({'where':_0x24f4c6['where']})['then'](function(_0x2e340e){_0x30bd87[_0x6274('0x1f')]=_0x2e340e;if(_0x3f669b['query'][_0x6274('0x49')]){_0x24f4c6[_0x6274('0x44')]=[{'all':!![]}];}return db[_0x6274('0x62')][_0x6274('0x45')](_0x24f4c6);})[_0x6274('0x26')](function(_0x2b709f){_0x30bd87['rows']=_0x2b709f;return _0x30bd87;});}})[_0x6274('0x26')](respondWithFilteredResult(_0x55f1ad,_0x24f4c6))[_0x6274('0x47')](handleError(_0x55f1ad,null));};exports[_0x6274('0x63')]=function(_0x45ed7c,_0x50efc8,_0x1f0987){var _0x18fbee={};var _0x1ecdf1={};var _0x203765;var _0x10ba92;return db[_0x6274('0x2e')][_0x6274('0x5a')]({'where':{'id':_0x45ed7c[_0x6274('0x48')]['id']}})['then'](handleEntityNotFound(_0x50efc8,null))[_0x6274('0x26')](function(_0x3cd2f2){if(_0x3cd2f2){_0x203765=_0x3cd2f2;_0x1ecdf1[_0x6274('0x31')]=_['keys'](db[_0x6274('0x64')]['rawAttributes']);_0x1ecdf1[_0x6274('0x33')]=_[_0x6274('0x34')](_0x45ed7c[_0x6274('0x33')]);_0x1ecdf1[_0x6274('0x35')]=_[_0x6274('0x36')](_0x1ecdf1[_0x6274('0x31')],_0x1ecdf1[_0x6274('0x33')]);_0x18fbee[_0x6274('0x37')]=_[_0x6274('0x36')](_0x1ecdf1[_0x6274('0x31')],qs[_0x6274('0x38')](_0x45ed7c[_0x6274('0x33')][_0x6274('0x38')]));_0x18fbee[_0x6274('0x37')]=_0x18fbee[_0x6274('0x37')][_0x6274('0x39')]?_0x18fbee[_0x6274('0x37')]:_0x1ecdf1[_0x6274('0x31')];_0x18fbee[_0x6274('0x3c')]=qs[_0x6274('0x3d')](_0x45ed7c[_0x6274('0x33')][_0x6274('0x3d')]);_0x18fbee[_0x6274('0x3e')]=qs[_0x6274('0x35')](_['pick'](_0x45ed7c[_0x6274('0x33')],_0x1ecdf1[_0x6274('0x35')]));if(_0x45ed7c[_0x6274('0x33')][_0x6274('0x40')]){_0x18fbee[_0x6274('0x3e')]=_[_0x6274('0x41')](_0x18fbee[_0x6274('0x3e')],{'$or':_[_0x6274('0x2d')](_0x18fbee[_0x6274('0x37')],function(_0x2365de){var _0x2d1c4c={};_0x2d1c4c[_0x2365de]={'$like':'%'+_0x45ed7c[_0x6274('0x33')][_0x6274('0x40')]+'%'};return _0x2d1c4c;})});}_0x18fbee=_['merge']({},_0x18fbee,_0x45ed7c[_0x6274('0x43')]);return _0x203765[_0x6274('0x63')](_0x18fbee);}})['then'](function(_0x6457a1){if(_0x6457a1){_0x10ba92=_0x6457a1[_0x6274('0x39')];if(!_0x45ed7c[_0x6274('0x33')][_0x6274('0x3a')]('nolimit')){_0x18fbee[_0x6274('0x1e')]=qs[_0x6274('0x1e')](_0x45ed7c[_0x6274('0x33')][_0x6274('0x1e')]);_0x18fbee[_0x6274('0x1c')]=qs[_0x6274('0x1c')](_0x45ed7c['query']['offset']);}return _0x203765[_0x6274('0x63')](_0x18fbee);}})[_0x6274('0x26')](function(_0x130415){if(_0x130415){return _0x130415?{'count':_0x10ba92,'rows':_0x130415}:null;}})[_0x6274('0x26')](respondWithResult(_0x50efc8,null))[_0x6274('0x47')](handleError(_0x50efc8,null));};exports['addLists']=function(_0x153b71,_0x246058,_0x5e908d){var _0x49cd05,_0x282426;var _0x3582fb=[];var _0x18e9d4=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x6274('0x2e')][_0x6274('0x4a')]({'where':{'id':_0x153b71[_0x6274('0x48')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x246058,null))[_0x6274('0x26')](function(_0x803de5){if(_0x803de5){_0x282426=_0x803de5;return _0x803de5['addLists'](_0x153b71['body'][_0x6274('0x65')],_[_0x6274('0x54')](_0x153b71['body'],[_0x6274('0x65'),'id'])||{});}return null;})[_0x6274('0x66')](function(_0x1ba600){var _0x572923;var _0x43608e;_0x49cd05=_0x1ba600||[];var _0x2ce26e=[];if(_0x1ba600){for(var _0x542803=0x0;_0x542803<_0x1ba600[_0x6274('0x39')];_0x542803+=0x1){var _0x408831=_0x1ba600[_0x542803]['get']({'plain':!![]});_0x282426[_0x6274('0x67')]=_0x153b71[_0x6274('0x4c')][_0x6274('0x67')]?_0x153b71[_0x6274('0x4c')][_0x6274('0x67')]:_0x282426[_0x6274('0x67')];switch(_0x282426['dialCheckDuplicateType']){case'always':_0x572923=squel[_0x6274('0x68')]()['into'](_0x6274('0x69'))['fromQuery']([_0x6274('0x6a'),_0x6274('0x6b'),_0x6274('0x6c'),_0x6274('0x6d'),_0x6274('0x5c'),'createdAt',_0x6274('0x56')],squel[_0x6274('0x6e')]()['field'](_0x6274('0x6a'),_0x6274('0x6a'))['field']('NOW()',_0x6274('0x6b'))['field']('id',_0x6274('0x6c'))[_0x6274('0x6f')](_0x408831[_0x6274('0x70')][_0x6274('0x71')](),'ListId')[_0x6274('0x6f')](_0x153b71[_0x6274('0x48')]['id'][_0x6274('0x71')](),_0x6274('0x5c'))[_0x6274('0x6f')]('\x27'+_0x18e9d4+'\x27',_0x6274('0x55'))[_0x6274('0x6f')]('\x27'+_0x18e9d4+'\x27',_0x6274('0x56'))[_0x6274('0x72')](_0x6274('0x73'))[_0x6274('0x3e')](_0x6274('0x74'))[_0x6274('0x3e')](_0x6274('0x75'),_0x408831[_0x6274('0x70')][_0x6274('0x71')]())[_0x6274('0x3e')](_0x6274('0x76'))[_0x6274('0x3e')](_0x6274('0x77'),squel[_0x6274('0x6e')]()[_0x6274('0x6f')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')['where'](_0x6274('0x78'),_0x153b71['params']['id'][_0x6274('0x71')]()))[_0x6274('0x3e')](_0x6274('0x77'),squel[_0x6274('0x6e')]()['field'](_0x6274('0x79'))[_0x6274('0x72')](_0x6274('0x69'))['where'](_0x6274('0x78'),_0x153b71[_0x6274('0x48')]['id'][_0x6274('0x71')]())))['toString']();break;case _0x6274('0x7a'):_0x572923=squel['insert']()[_0x6274('0x7b')]('cm_hopper')[_0x6274('0x7c')]([_0x6274('0x6a'),_0x6274('0x6b'),'ContactId',_0x6274('0x6d'),'CampaignId','createdAt','updatedAt'],squel[_0x6274('0x6e')]()['field']('phone',_0x6274('0x6a'))['field'](_0x6274('0x7d'),'scheduledAt')[_0x6274('0x6f')]('id',_0x6274('0x6c'))[_0x6274('0x6f')](_0x408831['CmListId'][_0x6274('0x71')](),_0x6274('0x6d'))[_0x6274('0x6f')](_0x153b71[_0x6274('0x48')]['id'][_0x6274('0x71')](),_0x6274('0x5c'))['field']('\x27'+_0x18e9d4+'\x27',_0x6274('0x55'))[_0x6274('0x6f')]('\x27'+_0x18e9d4+'\x27',_0x6274('0x56'))[_0x6274('0x72')](_0x6274('0x73'))[_0x6274('0x3e')](_0x6274('0x74'))[_0x6274('0x3e')](_0x6274('0x75'),_0x408831[_0x6274('0x70')][_0x6274('0x71')]())[_0x6274('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x6274('0x3e')](_0x6274('0x77'),squel[_0x6274('0x6e')]()[_0x6274('0x6f')](_0x6274('0x79'))[_0x6274('0x72')](_0x6274('0x69'))[_0x6274('0x3e')](_0x6274('0x78'),_0x153b71[_0x6274('0x48')]['id'][_0x6274('0x71')]())))[_0x6274('0x71')]();break;default:_0x572923=squel[_0x6274('0x68')]()[_0x6274('0x7b')](_0x6274('0x69'))[_0x6274('0x7c')]([_0x6274('0x6a'),_0x6274('0x6b'),_0x6274('0x6c'),_0x6274('0x6d'),'CampaignId',_0x6274('0x55'),_0x6274('0x56')],squel[_0x6274('0x6e')]()[_0x6274('0x6f')](_0x6274('0x6a'),_0x6274('0x6a'))[_0x6274('0x6f')](_0x6274('0x7d'),'scheduledAt')['field']('id',_0x6274('0x6c'))[_0x6274('0x6f')](_0x408831[_0x6274('0x70')][_0x6274('0x71')](),_0x6274('0x6d'))[_0x6274('0x6f')](_0x153b71[_0x6274('0x48')]['id']['toString'](),_0x6274('0x5c'))[_0x6274('0x6f')]('\x27'+_0x18e9d4+'\x27',_0x6274('0x55'))[_0x6274('0x6f')]('\x27'+_0x18e9d4+'\x27',_0x6274('0x56'))[_0x6274('0x72')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x6274('0x3e')](_0x6274('0x75'),_0x408831[_0x6274('0x70')][_0x6274('0x71')]())[_0x6274('0x3e')](_0x6274('0x76')))[_0x6274('0x71')]();}_0x43608e=squel[_0x6274('0x68')]()[_0x6274('0x7b')](_0x6274('0x7e'))[_0x6274('0x7c')]([_0x6274('0x7f'),_0x6274('0x6b'),_0x6274('0x6a'),_0x6274('0x80'),_0x6274('0x55'),_0x6274('0x56')],squel['select']()[_0x6274('0x6f')](_0x6274('0x81'),'id')[_0x6274('0x6f')](_0x6274('0x7d'),'scheduledAt')[_0x6274('0x6f')](_0x6274('0x82'),_0x6274('0x6a'))[_0x6274('0x6f')](_0x6274('0x83'),_0x6274('0x80'))[_0x6274('0x6f')]('\x27'+_0x18e9d4+'\x27','createdAt')['field']('\x27'+_0x18e9d4+'\x27',_0x6274('0x56'))['from'](_0x6274('0x84'),'ci')[_0x6274('0x85')](_0x6274('0x69'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x6274('0x86'),_0x408831[_0x6274('0x70')][_0x6274('0x71')]())[_0x6274('0x3e')](_0x6274('0x87'),_0x153b71[_0x6274('0x48')]['id'][_0x6274('0x71')]())[_0x6274('0x3e')](_0x6274('0x88'),_0x18e9d4))[_0x6274('0x71')]();_0x2ce26e[_0x6274('0x89')](db[_0x6274('0x8a')][_0x6274('0x33')](_0x572923));_0x3582fb['push'](db['sequelize'][_0x6274('0x33')](_0x43608e));}return BPromise[_0x6274('0x8b')](_0x2ce26e);}})[_0x6274('0x26')](function(){return BPromise['all'](_0x3582fb);})['then'](function(){return _0x49cd05;})[_0x6274('0x26')](respondWithResult(_0x246058,null))[_0x6274('0x47')](handleError(_0x246058,null));};exports[_0x6274('0x8c')]=function(_0x2b799f,_0x141b22,_0x4d08a6){return db[_0x6274('0x2e')][_0x6274('0x4a')]({'where':{'id':_0x2b799f['params']['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x141b22,null))['then'](function(_0x26fd0b){if(_0x26fd0b){return _0x26fd0b[_0x6274('0x8c')](_0x2b799f[_0x6274('0x33')][_0x6274('0x65')]);}})[_0x6274('0x26')](function(_0x248722){if(_0x248722){return db[_0x6274('0x5b')][_0x6274('0x27')]({'where':{'ListId':_0x2b799f[_0x6274('0x33')][_0x6274('0x65')],'CampaignId':_0x2b799f[_0x6274('0x48')]['id']}})[_0x6274('0x26')](function(){return _0x248722;});}})['then'](respondWithStatusCode(_0x141b22,null))[_0x6274('0x47')](handleError(_0x141b22,null));};exports[_0x6274('0x8d')]=function(_0x5ca291,_0x32505c,_0x3340a0){var _0x445755={};var _0x4a1615={};var _0x510dc5;var _0x251195;return db[_0x6274('0x2e')][_0x6274('0x5a')]({'where':{'id':_0x5ca291[_0x6274('0x48')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x32505c,null))[_0x6274('0x26')](function(_0xda2a80){if(_0xda2a80){_0x510dc5=_0xda2a80;_0x4a1615[_0x6274('0x31')]=_[_0x6274('0x34')](db[_0x6274('0x64')][_0x6274('0x2f')]);_0x4a1615[_0x6274('0x33')]=_[_0x6274('0x34')](_0x5ca291['query']);_0x4a1615[_0x6274('0x35')]=_[_0x6274('0x36')](_0x4a1615[_0x6274('0x31')],_0x4a1615['query']);_0x445755[_0x6274('0x37')]=_[_0x6274('0x36')](_0x4a1615[_0x6274('0x31')],qs['fields'](_0x5ca291[_0x6274('0x33')]['fields']));_0x445755[_0x6274('0x37')]=_0x445755['attributes'][_0x6274('0x39')]?_0x445755[_0x6274('0x37')]:_0x4a1615['model'];_0x445755['order']=qs[_0x6274('0x3d')](_0x5ca291[_0x6274('0x33')][_0x6274('0x3d')]);_0x445755[_0x6274('0x3e')]=qs[_0x6274('0x35')](_[_0x6274('0x3f')](_0x5ca291[_0x6274('0x33')],_0x4a1615[_0x6274('0x35')]));if(_0x5ca291[_0x6274('0x33')][_0x6274('0x40')]){_0x445755[_0x6274('0x3e')]=_[_0x6274('0x41')](_0x445755[_0x6274('0x3e')],{'$or':_[_0x6274('0x2d')](_0x445755[_0x6274('0x37')],function(_0x5dae80){var _0x4266d3={};_0x4266d3[_0x5dae80]={'$like':'%'+_0x5ca291[_0x6274('0x33')][_0x6274('0x40')]+'%'};return _0x4266d3;})});}_0x445755=_['merge']({},_0x445755,_0x5ca291['options']);return _0x510dc5['getBlackLists'](_0x445755);}})[_0x6274('0x26')](function(_0xa05006){if(_0xa05006){_0x251195=_0xa05006['length'];if(!_0x5ca291[_0x6274('0x33')]['hasOwnProperty'](_0x6274('0x3b'))){_0x445755['limit']=qs[_0x6274('0x1e')](_0x5ca291[_0x6274('0x33')]['limit']);_0x445755[_0x6274('0x1c')]=qs[_0x6274('0x1c')](_0x5ca291[_0x6274('0x33')]['offset']);}return _0x510dc5[_0x6274('0x8d')](_0x445755);}})['then'](function(_0xa9b517){if(_0xa9b517){return _0xa9b517?{'count':_0x251195,'rows':_0xa9b517}:null;}})[_0x6274('0x26')](respondWithResult(_0x32505c,null))[_0x6274('0x47')](handleError(_0x32505c,null));};exports[_0x6274('0x8e')]=function(_0x59e028,_0x17b3bb,_0xbee1c5){var _0x1dbf7d,_0x579608;var _0x7395ec=[];var _0x205d04=moment()[_0x6274('0x8f')](_0x6274('0x90'));return db[_0x6274('0x2e')]['find']({'where':{'id':_0x59e028['params']['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x17b3bb,null))[_0x6274('0x26')](function(_0x22f916){if(_0x22f916){_0x579608=_0x22f916;return _0x22f916[_0x6274('0x8e')](_0x59e028[_0x6274('0x4c')][_0x6274('0x65')],_[_0x6274('0x54')](_0x59e028[_0x6274('0x4c')],[_0x6274('0x65'),'id'])||{});}return null;})[_0x6274('0x66')](function(_0x4b65aa){var _0x47727b;var _0x1cb62c;_0x1dbf7d=_0x4b65aa||[];var _0xca13e=[];if(_0x4b65aa){for(var _0x2423ea=0x0;_0x2423ea<_0x4b65aa[_0x6274('0x39')];_0x2423ea+=0x1){var _0x1784a2=_0x4b65aa[_0x2423ea][_0x6274('0x28')]({'plain':!![]});_0x47727b=squel[_0x6274('0x68')]()[_0x6274('0x7b')](_0x6274('0x91'))[_0x6274('0x7c')]([_0x6274('0x6a'),'ContactId',_0x6274('0x6d'),_0x6274('0x5c'),'createdAt','updatedAt'],squel[_0x6274('0x6e')]()[_0x6274('0x6f')]('phone',_0x6274('0x6a'))[_0x6274('0x6f')]('id',_0x6274('0x6c'))[_0x6274('0x6f')](_0x1784a2[_0x6274('0x70')][_0x6274('0x71')](),'ListId')[_0x6274('0x6f')](_0x59e028[_0x6274('0x48')]['id'][_0x6274('0x71')](),_0x6274('0x5c'))[_0x6274('0x6f')]('NOW()','createdAt')[_0x6274('0x6f')]('NOW()',_0x6274('0x56'))[_0x6274('0x72')](_0x6274('0x73'))['where'](_0x6274('0x74'))[_0x6274('0x3e')]('ListId\x20=\x20?',_0x1784a2[_0x6274('0x70')][_0x6274('0x71')]())[_0x6274('0x3e')](_0x6274('0x76')))[_0x6274('0x71')]();_0xca13e[_0x6274('0x89')](db[_0x6274('0x8a')][_0x6274('0x33')](_0x47727b));}return BPromise['all'](_0xca13e);}})[_0x6274('0x26')](function(){return _0x1dbf7d;})[_0x6274('0x26')](respondWithResult(_0x17b3bb,null))[_0x6274('0x47')](handleError(_0x17b3bb,null));};exports[_0x6274('0x92')]=function(_0x25f3a8,_0x14fdf0,_0x148bd8){return db['Campaign'][_0x6274('0x4a')]({'where':{'id':_0x25f3a8[_0x6274('0x48')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x14fdf0,null))['then'](function(_0x8556ad){if(_0x8556ad){return _0x8556ad[_0x6274('0x92')](_0x25f3a8[_0x6274('0x33')][_0x6274('0x65')]);}})[_0x6274('0x26')](function(_0xd4ed56){if(_0xd4ed56){return db['CmHopperBlack'][_0x6274('0x27')]({'where':{'ListId':_0x25f3a8[_0x6274('0x33')][_0x6274('0x65')],'CampaignId':_0x25f3a8[_0x6274('0x48')]['id']}})['then'](function(){return _0xd4ed56;});}})[_0x6274('0x26')](respondWithStatusCode(_0x14fdf0,null))[_0x6274('0x47')](handleError(_0x14fdf0,null));}; \ No newline at end of file +var _0x065e=['bluebird','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','Campaign','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','insert','into','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','spread','cm_hopper_black','removeBlackLists','eml-format','request-promise','moment'];(function(_0x44bbc4,_0x49735d){var _0x394874=function(_0x568f5c){while(--_0x568f5c){_0x44bbc4['push'](_0x44bbc4['shift']());}};_0x394874(++_0x49735d);}(_0x065e,0x1a7));var _0xe065=function(_0x5026d2,_0x170f45){_0x5026d2=_0x5026d2-0x0;var _0xb03eb8=_0x065e[_0x5026d2];return _0xb03eb8;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];function respondWithStatusCode(_0x13b697,_0xf5ab44){_0xf5ab44=_0xf5ab44||0xcc;return function(_0x5bd30f){if(_0x5bd30f){return _0x13b697[_0xe065('0x16')](_0xf5ab44);}return _0x13b697[_0xe065('0x17')](_0xf5ab44)[_0xe065('0x18')]();};}function respondWithResult(_0x2e9480,_0x29297b){_0x29297b=_0x29297b||0xc8;return function(_0x541985){if(_0x541985){return _0x2e9480[_0xe065('0x17')](_0x29297b)[_0xe065('0x19')](_0x541985);}};}function respondWithFilteredResult(_0x15d365,_0xc5ef4f){return function(_0x434e07){if(_0x434e07){var _0x352206=typeof _0xc5ef4f[_0xe065('0x1a')]==='undefined'&&typeof _0xc5ef4f[_0xe065('0x1b')]===_0xe065('0x1c');var _0x54d260=_0x434e07[_0xe065('0x1d')];var _0x1d2f7a=_0x352206?0x0:_0xc5ef4f[_0xe065('0x1a')];var _0x14c97c=_0x352206?_0x434e07[_0xe065('0x1d')]:_0xc5ef4f[_0xe065('0x1a')]+_0xc5ef4f[_0xe065('0x1b')];var _0x5000e1;if(_0x14c97c>=_0x54d260){_0x14c97c=_0x54d260;_0x5000e1=0xc8;}else{_0x5000e1=0xce;}_0x15d365[_0xe065('0x17')](_0x5000e1);return _0x15d365['set'](_0xe065('0x1e'),_0x1d2f7a+'-'+_0x14c97c+'/'+_0x54d260)[_0xe065('0x19')](_0x434e07);}return null;};}function patchUpdates(_0x55f55c){return function(_0x1c6567){try{jsonpatch['apply'](_0x1c6567,_0x55f55c,!![]);}catch(_0xe26e9b){return BPromise[_0xe065('0x1f')](_0xe26e9b);}return _0x1c6567[_0xe065('0x20')]();};}function saveUpdates(_0x110556,_0x3ecd13){return function(_0x105cb2){if(_0x105cb2){return _0x105cb2[_0xe065('0x21')](_0x110556)[_0xe065('0x22')](function(_0x1c5dd9){return _0x1c5dd9;});}return null;};}function removeEntity(_0x5081a3,_0x7208af){return function(_0x43b712){if(_0x43b712){return _0x43b712[_0xe065('0x23')]()[_0xe065('0x22')](function(){var _0x5e8b60=_0x43b712['get']({'plain':!![]});var _0x164965='IvrCampaigns';return db[_0xe065('0x24')][_0xe065('0x23')]({'where':{'type':_0x164965,'resourceId':_0x5e8b60['id']}})[_0xe065('0x22')](function(){return _0x43b712;});})[_0xe065('0x22')](function(){_0x5081a3[_0xe065('0x17')](0xcc)[_0xe065('0x18')]();});}};}function handleEntityNotFound(_0x3b1caf,_0x26a159){return function(_0x52cd9c){if(!_0x52cd9c){_0x3b1caf['sendStatus'](0x194);}return _0x52cd9c;};}function handleError(_0x14de01,_0x10e6ba){_0x10e6ba=_0x10e6ba||0x1f4;return function(_0x23aee9){logger[_0xe065('0x25')](_0x23aee9['stack']);if(_0x23aee9[_0xe065('0x26')]){delete _0x23aee9['name'];}_0x14de01['status'](_0x10e6ba)[_0xe065('0x27')](_0x23aee9);};}exports[_0xe065('0x28')]=function(_0x2aa766,_0x5b8523){var _0x883747={},_0x59b915={},_0x12679d={'count':0x0,'rows':[]};var _0x46db7e=_[_0xe065('0x29')](db[_0xe065('0x2a')]['rawAttributes'],function(_0x3f02b2){return{'name':_0x3f02b2['fieldName'],'type':_0x3f02b2[_0xe065('0x2b')][_0xe065('0x2c')]};});_0x59b915['model']=_[_0xe065('0x29')](_0x46db7e,'name');_0x59b915[_0xe065('0x2d')]=_['keys'](_0x2aa766[_0xe065('0x2d')]);_0x59b915[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],_0x59b915['query']);_0x883747[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x32')]));_0x883747['attributes']=_0x883747[_0xe065('0x31')][_0xe065('0x33')]?_0x883747['attributes']:_0x59b915[_0xe065('0x30')];if(!_0x2aa766[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0x883747[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x2aa766[_0xe065('0x2d')]['limit']);_0x883747[_0xe065('0x1a')]=qs['offset'](_0x2aa766[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x883747[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x37')]);_0x883747['where']=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x2aa766[_0xe065('0x2d')],_0x59b915['filters']),_0x46db7e);if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]){_0x883747[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x883747[_0xe065('0x3a')],{'$or':_['map'](_0x46db7e,function(_0x341740){if(_0x341740[_0xe065('0x2b')]!=='VIRTUAL'){var _0x236e75={};_0x236e75[_0x341740['name']]={'$like':'%'+_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x236e75;}})});}_0x883747=_['merge']({},_0x883747,_0x2aa766[_0xe065('0x3c')]);var _0x20c881={'where':_0x883747['where']};return db[_0xe065('0x2a')][_0xe065('0x1d')](_0x20c881)[_0xe065('0x22')](function(_0x44a3f6){_0x12679d[_0xe065('0x1d')]=_0x44a3f6;if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x3d')]){_0x883747[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x2a')][_0xe065('0x3f')](_0x883747);})[_0xe065('0x22')](function(_0x4364c3){_0x12679d[_0xe065('0x40')]=_0x4364c3;return _0x12679d;})['then'](respondWithFilteredResult(_0x5b8523,_0x883747))['catch'](handleError(_0x5b8523,null));};exports[_0xe065('0x41')]=function(_0x2bf092,_0x5ee4ec){var _0x3ba838={'raw':![],'where':{'id':_0x2bf092[_0xe065('0x42')]['id']}},_0x448044={};_0x448044[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x2a')][_0xe065('0x44')]);_0x448044[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x2bf092['query']);_0x448044[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],_0x448044['query']);_0x3ba838[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2bf092['query'][_0xe065('0x32')]));_0x3ba838[_0xe065('0x31')]=_0x3ba838[_0xe065('0x31')][_0xe065('0x33')]?_0x3ba838[_0xe065('0x31')]:_0x448044[_0xe065('0x30')];if(_0x2bf092[_0xe065('0x2d')]['includeAll']){_0x3ba838[_0xe065('0x3e')]=[{'all':!![]}];}_0x3ba838=_[_0xe065('0x3b')]({},_0x3ba838,_0x2bf092[_0xe065('0x3c')]);return db[_0xe065('0x2a')][_0xe065('0x45')](_0x3ba838)[_0xe065('0x22')](handleEntityNotFound(_0x5ee4ec,null))[_0xe065('0x22')](respondWithResult(_0x5ee4ec,null))['catch'](handleError(_0x5ee4ec,null));};exports[_0xe065('0x46')]=function(_0x5a2360,_0x45fe1f){return db[_0xe065('0x2a')][_0xe065('0x46')](_0x5a2360['body'],{})[_0xe065('0x22')](function(_0x16898c){var _0x3ab70d=_0x5a2360[_0xe065('0x47')][_0xe065('0x48')]({'plain':!![]});if(!_0x3ab70d)throw new Error(_0xe065('0x49'));if(_0x3ab70d[_0xe065('0x4a')]===_0xe065('0x47')){var _0x3095c8=_0x16898c[_0xe065('0x48')]({'plain':!![]});var _0x3f91a2=_0xe065('0x4b');return db[_0xe065('0x4c')]['find']({'where':{'name':_0x3f91a2,'userProfileId':_0x3ab70d['userProfileId']},'raw':!![]})['then'](function(_0x23ba0b){if(_0x23ba0b&&_0x23ba0b['autoAssociation']===0x0){return db[_0xe065('0x24')][_0xe065('0x46')]({'name':_0x3095c8[_0xe065('0x26')],'resourceId':_0x3095c8['id'],'type':_0x23ba0b['name'],'sectionId':_0x23ba0b['id']},{})[_0xe065('0x22')](function(){return _0x16898c;});}else{return _0x16898c;}})[_0xe065('0x4d')](function(_0x5cce78){logger[_0xe065('0x25')](_0xe065('0x4e'),_0x5cce78);throw _0x5cce78;});}return _0x16898c;})[_0xe065('0x22')](respondWithResult(_0x45fe1f,0xc9))[_0xe065('0x4d')](handleError(_0x45fe1f,null));};exports[_0xe065('0x4f')]=function(_0x1ea568,_0xe77af6){var _0x2f0ed5={'where':{'id':_0x1ea568[_0xe065('0x42')]['id']}},_0x43480d={};_0x43480d['model']=_[_0xe065('0x43')](db[_0xe065('0x2a')][_0xe065('0x44')]);_0x2f0ed5[_0xe065('0x31')]=_['intersection'](_0x43480d[_0xe065('0x30')],qs[_0xe065('0x32')](_0x1ea568[_0xe065('0x2d')][_0xe065('0x32')]));_0x2f0ed5['attributes']=_0x2f0ed5[_0xe065('0x31')][_0xe065('0x33')]?_0x2f0ed5[_0xe065('0x31')]:_0x43480d['model'];if(_0x1ea568[_0xe065('0x2d')][_0xe065('0x3d')]){_0x2f0ed5[_0xe065('0x3e')]=[{'all':!![]}];}_0x2f0ed5=_[_0xe065('0x3b')]({},_0x2f0ed5,_0x1ea568[_0xe065('0x3c')]);return db[_0xe065('0x2a')][_0xe065('0x45')](_0x2f0ed5)[_0xe065('0x22')](handleEntityNotFound(_0xe77af6,null))[_0xe065('0x22')](function(_0x5ec6fe){if(_0x5ec6fe){var _0x2accad=_0x5ec6fe['get']({'plain':!![]});_0x2accad=qs[_0xe065('0x50')](_0x2accad,['id',_0xe065('0x51'),_0xe065('0x52')]);_0x1ea568['body']=_['omit'](_0x1ea568['body'],['id',_0xe065('0x51'),_0xe065('0x52')]);return db[_0xe065('0x2a')][_0xe065('0x46')](_[_0xe065('0x3b')](_0x2accad,_0x1ea568[_0xe065('0x53')]),{'include':_0x1ea568[_0xe065('0x2d')][_0xe065('0x3d')]?[{'all':!![]}]:undefined})[_0xe065('0x22')](function(_0x3169fa){var _0x25ec8a=_0x1ea568['user']['get']({'plain':!![]});if(!_0x25ec8a)throw new Error(_0xe065('0x49'));if(_0x25ec8a[_0xe065('0x4a')]==='user'){var _0x276c17=_0x3169fa['get']({'plain':!![]});var _0x4f4dca=_0xe065('0x4b');return db[_0xe065('0x4c')][_0xe065('0x45')]({'where':{'name':_0x4f4dca,'userProfileId':_0x25ec8a[_0xe065('0x54')]},'raw':!![]})[_0xe065('0x22')](function(_0x817baf){if(_0x817baf&&_0x817baf[_0xe065('0x55')]===0x0){return db['UserProfileResource'][_0xe065('0x46')]({'name':_0x276c17[_0xe065('0x26')],'resourceId':_0x276c17['id'],'type':_0x817baf[_0xe065('0x26')],'sectionId':_0x817baf['id']},{})[_0xe065('0x22')](function(){return _0x3169fa;});}else{return _0x3169fa;}})[_0xe065('0x4d')](function(_0x4f35a6){logger[_0xe065('0x25')](_0xe065('0x4e'),_0x4f35a6);throw _0x4f35a6;});}return _0x3169fa;});}})[_0xe065('0x22')](respondWithResult(_0xe77af6,0xc9))[_0xe065('0x4d')](handleError(_0xe77af6,null));};exports[_0xe065('0x21')]=function(_0xfce2e,_0x5af9d5){if(_0xfce2e['body']['id']){delete _0xfce2e['body']['id'];}return db['Campaign']['find']({'where':{'id':_0xfce2e[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x5af9d5,null))[_0xe065('0x22')](saveUpdates(_0xfce2e[_0xe065('0x53')],null))[_0xe065('0x22')](respondWithResult(_0x5af9d5,null))[_0xe065('0x4d')](handleError(_0x5af9d5,null));};exports[_0xe065('0x23')]=function(_0x4084a0,_0x507fd2){return db['Campaign'][_0xe065('0x45')]({'where':{'id':_0x4084a0[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x507fd2,null))['then'](removeEntity(_0x507fd2,null))[_0xe065('0x4d')](handleError(_0x507fd2,null));};exports[_0xe065('0x56')]=function(_0x113a0f,_0x4765a0,_0x136e40){var _0x2c0b2e={'raw':!![],'where':{}};var _0xac5395={};var _0x199ca3={'count':0x0,'rows':[]};return db[_0xe065('0x2a')][_0xe065('0x57')]({'where':{'id':_0x113a0f[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x4765a0,null))[_0xe065('0x22')](function(_0xc0ebe8){if(_0xc0ebe8){_0xac5395[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x58')][_0xe065('0x44')]);_0xac5395['query']=_[_0xe065('0x43')](_0x113a0f[_0xe065('0x2d')]);_0xac5395[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0xac5395[_0xe065('0x30')],_0xac5395[_0xe065('0x2d')]);_0x2c0b2e[_0xe065('0x31')]=_[_0xe065('0x2f')](_0xac5395[_0xe065('0x30')],qs[_0xe065('0x32')](_0x113a0f[_0xe065('0x2d')][_0xe065('0x32')]));_0x2c0b2e[_0xe065('0x31')]=_0x2c0b2e[_0xe065('0x31')][_0xe065('0x33')]?_0x2c0b2e[_0xe065('0x31')]:_0xac5395[_0xe065('0x30')];if(!_0x113a0f['query'][_0xe065('0x34')](_0xe065('0x35'))){_0x2c0b2e[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x113a0f[_0xe065('0x2d')][_0xe065('0x1b')]);_0x2c0b2e[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0x113a0f[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x2c0b2e['order']=qs['sort'](_0x113a0f[_0xe065('0x2d')]['sort']);_0x2c0b2e[_0xe065('0x3a')]=qs['filters'](_[_0xe065('0x38')](_0x113a0f[_0xe065('0x2d')],_0xac5395[_0xe065('0x2e')]));_0x2c0b2e[_0xe065('0x3a')][_0xe065('0x59')]=_0xc0ebe8['id'];if(_0x113a0f[_0xe065('0x2d')][_0xe065('0x39')]){_0x2c0b2e[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x2c0b2e['where'],{'$or':_[_0xe065('0x29')](_0x2c0b2e[_0xe065('0x31')],function(_0x134d0a){var _0x3f8e32={};_0x3f8e32[_0x134d0a]={'$like':'%'+_0x113a0f['query'][_0xe065('0x39')]+'%'};return _0x3f8e32;})});}_0x2c0b2e=_[_0xe065('0x3b')]({},_0x2c0b2e,_0x113a0f[_0xe065('0x3c')]);return db['CmHopper'][_0xe065('0x1d')]({'where':_0x2c0b2e[_0xe065('0x3a')]})[_0xe065('0x22')](function(_0x52f0ac){_0x199ca3[_0xe065('0x1d')]=_0x52f0ac;if(_0x113a0f[_0xe065('0x2d')]['includeAll']){_0x2c0b2e['include']=[{'all':!![]}];}return db[_0xe065('0x58')][_0xe065('0x3f')](_0x2c0b2e);})[_0xe065('0x22')](function(_0x3f3878){_0x199ca3[_0xe065('0x40')]=_0x3f3878;return _0x199ca3;});}})['then'](respondWithFilteredResult(_0x4765a0,_0x2c0b2e))['catch'](handleError(_0x4765a0,null));};exports[_0xe065('0x5a')]=function(_0x1263f7,_0x4bed1d,_0x13e0ed){var _0xb32a44={'raw':!![],'where':{}};var _0x3d9fe8={};var _0x3251df={'count':0x0,'rows':[]};return db[_0xe065('0x2a')][_0xe065('0x57')]({'where':{'id':_0x1263f7[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x4bed1d,null))[_0xe065('0x22')](function(_0x1ec81f){if(_0x1ec81f){_0x3d9fe8['model']=_['keys'](db[_0xe065('0x5b')][_0xe065('0x44')]);_0x3d9fe8[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x1263f7[_0xe065('0x2d')]);_0x3d9fe8['filters']=_[_0xe065('0x2f')](_0x3d9fe8[_0xe065('0x30')],_0x3d9fe8[_0xe065('0x2d')]);_0xb32a44[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x3d9fe8[_0xe065('0x30')],qs[_0xe065('0x32')](_0x1263f7[_0xe065('0x2d')][_0xe065('0x32')]));_0xb32a44[_0xe065('0x31')]=_0xb32a44[_0xe065('0x31')]['length']?_0xb32a44[_0xe065('0x31')]:_0x3d9fe8[_0xe065('0x30')];if(!_0x1263f7[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0xb32a44[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x1263f7[_0xe065('0x2d')][_0xe065('0x1b')]);_0xb32a44[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0x1263f7[_0xe065('0x2d')]['offset']);}_0xb32a44[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x1263f7[_0xe065('0x2d')][_0xe065('0x37')]);_0xb32a44[_0xe065('0x3a')]=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x1263f7[_0xe065('0x2d')],_0x3d9fe8[_0xe065('0x2e')]));_0xb32a44[_0xe065('0x3a')][_0xe065('0x59')]=_0x1ec81f['id'];if(_0x1263f7[_0xe065('0x2d')][_0xe065('0x39')]){_0xb32a44[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0xb32a44[_0xe065('0x3a')],{'$or':_[_0xe065('0x29')](_0xb32a44[_0xe065('0x31')],function(_0x105eaa){var _0x2052fb={};_0x2052fb[_0x105eaa]={'$like':'%'+_0x1263f7[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x2052fb;})});}_0xb32a44=_[_0xe065('0x3b')]({},_0xb32a44,_0x1263f7[_0xe065('0x3c')]);return db[_0xe065('0x5b')][_0xe065('0x1d')]({'where':_0xb32a44[_0xe065('0x3a')]})[_0xe065('0x22')](function(_0x3a53a4){_0x3251df[_0xe065('0x1d')]=_0x3a53a4;if(_0x1263f7[_0xe065('0x2d')][_0xe065('0x3d')]){_0xb32a44[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x5b')][_0xe065('0x3f')](_0xb32a44);})[_0xe065('0x22')](function(_0x23f071){_0x3251df[_0xe065('0x40')]=_0x23f071;return _0x3251df;});}})[_0xe065('0x22')](respondWithFilteredResult(_0x4bed1d,_0xb32a44))[_0xe065('0x4d')](handleError(_0x4bed1d,null));};exports['getHopperFinals']=function(_0x18ecb1,_0x3ebe27,_0x10fcaf){var _0xe199d7={'raw':!![],'where':{}};var _0x40231d={};var _0x34b37c={'count':0x0,'rows':[]};return db[_0xe065('0x2a')][_0xe065('0x57')]({'where':{'id':_0x18ecb1['params']['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x3ebe27,null))['then'](function(_0x43706f){if(_0x43706f){_0x40231d['model']=_[_0xe065('0x43')](db[_0xe065('0x5c')][_0xe065('0x44')]);_0x40231d[_0xe065('0x2d')]=_['keys'](_0x18ecb1['query']);_0x40231d[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x40231d[_0xe065('0x30')],_0x40231d['query']);_0xe199d7[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x40231d[_0xe065('0x30')],qs['fields'](_0x18ecb1['query']['fields']));_0xe199d7['attributes']=_0xe199d7[_0xe065('0x31')][_0xe065('0x33')]?_0xe199d7[_0xe065('0x31')]:_0x40231d[_0xe065('0x30')];if(!_0x18ecb1[_0xe065('0x2d')]['hasOwnProperty'](_0xe065('0x35'))){_0xe199d7[_0xe065('0x1b')]=qs['limit'](_0x18ecb1[_0xe065('0x2d')]['limit']);_0xe199d7[_0xe065('0x1a')]=qs['offset'](_0x18ecb1[_0xe065('0x2d')][_0xe065('0x1a')]);}_0xe199d7[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x18ecb1[_0xe065('0x2d')][_0xe065('0x37')]);_0xe199d7[_0xe065('0x3a')]=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x18ecb1[_0xe065('0x2d')],_0x40231d[_0xe065('0x2e')]));_0xe199d7[_0xe065('0x3a')][_0xe065('0x59')]=_0x43706f['id'];if(_0x18ecb1[_0xe065('0x2d')]['filter']){_0xe199d7['where']=_[_0xe065('0x3b')](_0xe199d7[_0xe065('0x3a')],{'$or':_['map'](_0xe199d7[_0xe065('0x31')],function(_0x1d3d9e){var _0x16e0dc={};_0x16e0dc[_0x1d3d9e]={'$like':'%'+_0x18ecb1[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x16e0dc;})});}_0xe199d7=_[_0xe065('0x3b')]({},_0xe199d7,_0x18ecb1[_0xe065('0x3c')]);return db['CmHopperFinal']['count']({'where':_0xe199d7[_0xe065('0x3a')]})[_0xe065('0x22')](function(_0x343413){_0x34b37c[_0xe065('0x1d')]=_0x343413;if(_0x18ecb1['query'][_0xe065('0x3d')]){_0xe199d7[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x5c')][_0xe065('0x3f')](_0xe199d7);})[_0xe065('0x22')](function(_0x123188){_0x34b37c['rows']=_0x123188;return _0x34b37c;});}})[_0xe065('0x22')](respondWithFilteredResult(_0x3ebe27,_0xe199d7))['catch'](handleError(_0x3ebe27,null));};exports['getHopperBlacks']=function(_0x13e05e,_0x14440a,_0x472acb){var _0x33f868={'raw':!![],'where':{}};var _0x4a55a9={};var _0x39a7f8={'count':0x0,'rows':[]};return db[_0xe065('0x2a')]['findOne']({'where':{'id':_0x13e05e[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x14440a,null))[_0xe065('0x22')](function(_0x29ecc6){if(_0x29ecc6){_0x4a55a9[_0xe065('0x30')]=_['keys'](db[_0xe065('0x5d')]['rawAttributes']);_0x4a55a9[_0xe065('0x2d')]=_['keys'](_0x13e05e[_0xe065('0x2d')]);_0x4a55a9[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x4a55a9['model'],_0x4a55a9['query']);_0x33f868[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x4a55a9['model'],qs[_0xe065('0x32')](_0x13e05e['query'][_0xe065('0x32')]));_0x33f868[_0xe065('0x31')]=_0x33f868['attributes'][_0xe065('0x33')]?_0x33f868[_0xe065('0x31')]:_0x4a55a9[_0xe065('0x30')];if(!_0x13e05e[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0x33f868['limit']=qs['limit'](_0x13e05e[_0xe065('0x2d')][_0xe065('0x1b')]);_0x33f868[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0x13e05e[_0xe065('0x2d')]['offset']);}_0x33f868['order']=qs['sort'](_0x13e05e[_0xe065('0x2d')][_0xe065('0x37')]);_0x33f868['where']=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x13e05e[_0xe065('0x2d')],_0x4a55a9['filters']));_0x33f868[_0xe065('0x3a')]['CampaignId']=_0x29ecc6['id'];if(_0x13e05e['query'][_0xe065('0x39')]){_0x33f868[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x33f868[_0xe065('0x3a')],{'$or':_['map'](_0x33f868[_0xe065('0x31')],function(_0x3a46d3){var _0x550d5b={};_0x550d5b[_0x3a46d3]={'$like':'%'+_0x13e05e[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x550d5b;})});}_0x33f868=_[_0xe065('0x3b')]({},_0x33f868,_0x13e05e['options']);return db[_0xe065('0x5d')]['count']({'where':_0x33f868[_0xe065('0x3a')]})[_0xe065('0x22')](function(_0x4e1098){_0x39a7f8['count']=_0x4e1098;if(_0x13e05e[_0xe065('0x2d')][_0xe065('0x3d')]){_0x33f868[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x5d')][_0xe065('0x3f')](_0x33f868);})[_0xe065('0x22')](function(_0x2b8d04){_0x39a7f8['rows']=_0x2b8d04;return _0x39a7f8;});}})['then'](respondWithFilteredResult(_0x14440a,_0x33f868))['catch'](handleError(_0x14440a,null));};exports[_0xe065('0x5e')]=function(_0xecd5f4,_0x4c6f4e,_0x276c7c){var _0x13693d={};var _0x4cfe13={};var _0x65e3a4;var _0x59003e;return db['Campaign'][_0xe065('0x57')]({'where':{'id':_0xecd5f4[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x4c6f4e,null))['then'](function(_0x2ddc2b){if(_0x2ddc2b){_0x65e3a4=_0x2ddc2b;_0x4cfe13[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x5f')][_0xe065('0x44')]);_0x4cfe13[_0xe065('0x2d')]=_[_0xe065('0x43')](_0xecd5f4[_0xe065('0x2d')]);_0x4cfe13[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x4cfe13['model'],_0x4cfe13[_0xe065('0x2d')]);_0x13693d[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x4cfe13[_0xe065('0x30')],qs[_0xe065('0x32')](_0xecd5f4['query'][_0xe065('0x32')]));_0x13693d[_0xe065('0x31')]=_0x13693d['attributes']['length']?_0x13693d[_0xe065('0x31')]:_0x4cfe13[_0xe065('0x30')];_0x13693d[_0xe065('0x36')]=qs[_0xe065('0x37')](_0xecd5f4['query'][_0xe065('0x37')]);_0x13693d[_0xe065('0x3a')]=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0xecd5f4['query'],_0x4cfe13[_0xe065('0x2e')]));if(_0xecd5f4[_0xe065('0x2d')][_0xe065('0x39')]){_0x13693d[_0xe065('0x3a')]=_['merge'](_0x13693d[_0xe065('0x3a')],{'$or':_['map'](_0x13693d[_0xe065('0x31')],function(_0x57d96b){var _0x199649={};_0x199649[_0x57d96b]={'$like':'%'+_0xecd5f4[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x199649;})});}_0x13693d=_[_0xe065('0x3b')]({},_0x13693d,_0xecd5f4['options']);return _0x65e3a4['getLists'](_0x13693d);}})['then'](function(_0x186bbb){if(_0x186bbb){_0x59003e=_0x186bbb[_0xe065('0x33')];if(!_0xecd5f4[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0x13693d['limit']=qs[_0xe065('0x1b')](_0xecd5f4[_0xe065('0x2d')]['limit']);_0x13693d[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0xecd5f4[_0xe065('0x2d')]['offset']);}return _0x65e3a4[_0xe065('0x5e')](_0x13693d);}})[_0xe065('0x22')](function(_0x5d008e){if(_0x5d008e){return _0x5d008e?{'count':_0x59003e,'rows':_0x5d008e}:null;}})[_0xe065('0x22')](respondWithResult(_0x4c6f4e,null))['catch'](handleError(_0x4c6f4e,null));};exports[_0xe065('0x60')]=function(_0x238259,_0xe43d70,_0x3902df){var _0xb984ac,_0x12ae83;var _0x2079a2=[];var _0x5a096f=moment()['format'](_0xe065('0x61'));return db[_0xe065('0x2a')][_0xe065('0x45')]({'where':{'id':_0x238259['params']['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xe43d70,null))[_0xe065('0x22')](function(_0x151ad1){if(_0x151ad1){_0x12ae83=_0x151ad1;return _0x151ad1['addLists'](_0x238259[_0xe065('0x53')][_0xe065('0x62')],_[_0xe065('0x50')](_0x238259[_0xe065('0x53')],[_0xe065('0x62'),'id'])||{});}return null;})['spread'](function(_0x522167){var _0x395e75;var _0x40da80;_0xb984ac=_0x522167||[];var _0x30d02e=[];if(_0x522167){for(var _0x182d62=0x0;_0x182d62<_0x522167['length'];_0x182d62+=0x1){var _0x1a9af4=_0x522167[_0x182d62][_0xe065('0x48')]({'plain':!![]});_0x12ae83[_0xe065('0x63')]=_0x238259['body']['dialCheckDuplicateType']?_0x238259['body'][_0xe065('0x63')]:_0x12ae83[_0xe065('0x63')];switch(_0x12ae83[_0xe065('0x63')]){case'always':_0x395e75=squel['insert']()['into'](_0xe065('0x64'))[_0xe065('0x65')]([_0xe065('0x66'),_0xe065('0x67'),_0xe065('0x68'),'ListId',_0xe065('0x59'),'createdAt',_0xe065('0x52')],squel[_0xe065('0x69')]()[_0xe065('0x6a')](_0xe065('0x66'),_0xe065('0x66'))[_0xe065('0x6a')](_0xe065('0x6b'),_0xe065('0x67'))[_0xe065('0x6a')]('id',_0xe065('0x68'))[_0xe065('0x6a')](_0x1a9af4[_0xe065('0x6c')][_0xe065('0x6d')](),_0xe065('0x6e'))[_0xe065('0x6a')](_0x238259[_0xe065('0x42')]['id']['toString'](),_0xe065('0x59'))['field']('\x27'+_0x5a096f+'\x27','createdAt')[_0xe065('0x6a')]('\x27'+_0x5a096f+'\x27','updatedAt')[_0xe065('0x6f')](_0xe065('0x70'))[_0xe065('0x3a')](_0xe065('0x71'))['where'](_0xe065('0x72'),_0x1a9af4[_0xe065('0x6c')][_0xe065('0x6d')]())[_0xe065('0x3a')](_0xe065('0x73'))['where'](_0xe065('0x74'),squel[_0xe065('0x69')]()[_0xe065('0x6a')](_0xe065('0x75'))[_0xe065('0x6f')]('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x238259[_0xe065('0x42')]['id'][_0xe065('0x6d')]()))['where'](_0xe065('0x74'),squel[_0xe065('0x69')]()[_0xe065('0x6a')](_0xe065('0x76'))[_0xe065('0x6f')]('cm_hopper')[_0xe065('0x3a')]('CampaignId\x20=\x20?',_0x238259[_0xe065('0x42')]['id']['toString']())))[_0xe065('0x6d')]();break;case'onlyIfOpen':_0x395e75=squel[_0xe065('0x77')]()[_0xe065('0x78')]('cm_hopper')[_0xe065('0x65')](['phone',_0xe065('0x67'),_0xe065('0x68'),_0xe065('0x6e'),'CampaignId',_0xe065('0x51'),_0xe065('0x52')],squel[_0xe065('0x69')]()[_0xe065('0x6a')](_0xe065('0x66'),_0xe065('0x66'))['field'](_0xe065('0x6b'),_0xe065('0x67'))['field']('id',_0xe065('0x68'))[_0xe065('0x6a')](_0x1a9af4[_0xe065('0x6c')][_0xe065('0x6d')](),'ListId')[_0xe065('0x6a')](_0x238259[_0xe065('0x42')]['id'][_0xe065('0x6d')](),_0xe065('0x59'))[_0xe065('0x6a')]('\x27'+_0x5a096f+'\x27',_0xe065('0x51'))['field']('\x27'+_0x5a096f+'\x27',_0xe065('0x52'))[_0xe065('0x6f')](_0xe065('0x70'))[_0xe065('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0xe065('0x72'),_0x1a9af4[_0xe065('0x6c')][_0xe065('0x6d')]())[_0xe065('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xe065('0x3a')](_0xe065('0x74'),squel[_0xe065('0x69')]()[_0xe065('0x6a')](_0xe065('0x76'))[_0xe065('0x6f')]('cm_hopper')[_0xe065('0x3a')](_0xe065('0x79'),_0x238259[_0xe065('0x42')]['id'][_0xe065('0x6d')]())))['toString']();break;default:_0x395e75=squel[_0xe065('0x77')]()[_0xe065('0x78')](_0xe065('0x64'))[_0xe065('0x65')]([_0xe065('0x66'),_0xe065('0x67'),'ContactId',_0xe065('0x6e'),_0xe065('0x59'),_0xe065('0x51'),_0xe065('0x52')],squel[_0xe065('0x69')]()['field'](_0xe065('0x66'),_0xe065('0x66'))['field'](_0xe065('0x6b'),_0xe065('0x67'))[_0xe065('0x6a')]('id',_0xe065('0x68'))[_0xe065('0x6a')](_0x1a9af4[_0xe065('0x6c')]['toString'](),_0xe065('0x6e'))[_0xe065('0x6a')](_0x238259[_0xe065('0x42')]['id'][_0xe065('0x6d')](),_0xe065('0x59'))[_0xe065('0x6a')]('\x27'+_0x5a096f+'\x27','createdAt')[_0xe065('0x6a')]('\x27'+_0x5a096f+'\x27',_0xe065('0x52'))[_0xe065('0x6f')](_0xe065('0x70'))[_0xe065('0x3a')]('deletedAt\x20IS\x20NULL')[_0xe065('0x3a')](_0xe065('0x72'),_0x1a9af4[_0xe065('0x6c')][_0xe065('0x6d')]())[_0xe065('0x3a')](_0xe065('0x73')))[_0xe065('0x6d')]();}_0x40da80=squel[_0xe065('0x77')]()[_0xe065('0x78')](_0xe065('0x7a'))[_0xe065('0x65')]([_0xe065('0x7b'),_0xe065('0x67'),'phone',_0xe065('0x7c'),'createdAt',_0xe065('0x52')],squel[_0xe065('0x69')]()[_0xe065('0x6a')](_0xe065('0x7d'),'id')['field'](_0xe065('0x6b'),'scheduledAt')[_0xe065('0x6a')]('ci.item',_0xe065('0x66'))['field'](_0xe065('0x7e'),_0xe065('0x7c'))['field']('\x27'+_0x5a096f+'\x27',_0xe065('0x51'))['field']('\x27'+_0x5a096f+'\x27','updatedAt')['from'](_0xe065('0x7f'),'ci')['join'](_0xe065('0x64'),'h',_0xe065('0x80'))[_0xe065('0x3a')](_0xe065('0x81'),_0x1a9af4[_0xe065('0x6c')][_0xe065('0x6d')]())['where'](_0xe065('0x82'),_0x238259[_0xe065('0x42')]['id'][_0xe065('0x6d')]())['where'](_0xe065('0x83'),_0x5a096f))[_0xe065('0x6d')]();_0x30d02e[_0xe065('0x84')](db[_0xe065('0x85')][_0xe065('0x2d')](_0x395e75));_0x2079a2[_0xe065('0x84')](db[_0xe065('0x85')][_0xe065('0x2d')](_0x40da80));}return BPromise[_0xe065('0x86')](_0x30d02e);}})['then'](function(){return BPromise[_0xe065('0x86')](_0x2079a2);})['then'](function(){return _0xb984ac;})[_0xe065('0x22')](respondWithResult(_0xe43d70,null))[_0xe065('0x4d')](handleError(_0xe43d70,null));};exports[_0xe065('0x87')]=function(_0x3c3e1f,_0x510487,_0x39648b){return db['Campaign']['find']({'where':{'id':_0x3c3e1f[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x510487,null))[_0xe065('0x22')](function(_0xe64271){if(_0xe64271){return _0xe64271[_0xe065('0x87')](_0x3c3e1f[_0xe065('0x2d')][_0xe065('0x62')]);}})[_0xe065('0x22')](function(_0x34768c){if(_0x34768c){return db[_0xe065('0x58')]['destroy']({'where':{'ListId':_0x3c3e1f['query'][_0xe065('0x62')],'CampaignId':_0x3c3e1f[_0xe065('0x42')]['id']}})[_0xe065('0x22')](function(){return _0x34768c;});}})[_0xe065('0x22')](respondWithStatusCode(_0x510487,null))[_0xe065('0x4d')](handleError(_0x510487,null));};exports[_0xe065('0x88')]=function(_0x5c935d,_0x2296b5,_0x3c83ff){var _0xddef95={};var _0x52f4fd={};var _0x49edb4;var _0x1b8cd0;return db[_0xe065('0x2a')][_0xe065('0x57')]({'where':{'id':_0x5c935d['params']['id']}})['then'](handleEntityNotFound(_0x2296b5,null))[_0xe065('0x22')](function(_0x5c08e7){if(_0x5c08e7){_0x49edb4=_0x5c08e7;_0x52f4fd[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x5f')][_0xe065('0x44')]);_0x52f4fd[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x5c935d[_0xe065('0x2d')]);_0x52f4fd[_0xe065('0x2e')]=_['intersection'](_0x52f4fd[_0xe065('0x30')],_0x52f4fd[_0xe065('0x2d')]);_0xddef95[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x52f4fd[_0xe065('0x30')],qs[_0xe065('0x32')](_0x5c935d['query'][_0xe065('0x32')]));_0xddef95[_0xe065('0x31')]=_0xddef95[_0xe065('0x31')]['length']?_0xddef95[_0xe065('0x31')]:_0x52f4fd[_0xe065('0x30')];_0xddef95['order']=qs[_0xe065('0x37')](_0x5c935d['query']['sort']);_0xddef95[_0xe065('0x3a')]=qs['filters'](_['pick'](_0x5c935d[_0xe065('0x2d')],_0x52f4fd['filters']));if(_0x5c935d[_0xe065('0x2d')][_0xe065('0x39')]){_0xddef95[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0xddef95[_0xe065('0x3a')],{'$or':_[_0xe065('0x29')](_0xddef95[_0xe065('0x31')],function(_0x119191){var _0x1e55e0={};_0x1e55e0[_0x119191]={'$like':'%'+_0x5c935d[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x1e55e0;})});}_0xddef95=_[_0xe065('0x3b')]({},_0xddef95,_0x5c935d['options']);return _0x49edb4[_0xe065('0x88')](_0xddef95);}})[_0xe065('0x22')](function(_0x306d4d){if(_0x306d4d){_0x1b8cd0=_0x306d4d[_0xe065('0x33')];if(!_0x5c935d[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0xddef95[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x5c935d[_0xe065('0x2d')][_0xe065('0x1b')]);_0xddef95[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0x5c935d[_0xe065('0x2d')][_0xe065('0x1a')]);}return _0x49edb4[_0xe065('0x88')](_0xddef95);}})[_0xe065('0x22')](function(_0x5cb2e0){if(_0x5cb2e0){return _0x5cb2e0?{'count':_0x1b8cd0,'rows':_0x5cb2e0}:null;}})[_0xe065('0x22')](respondWithResult(_0x2296b5,null))[_0xe065('0x4d')](handleError(_0x2296b5,null));};exports[_0xe065('0x89')]=function(_0x3fedd8,_0x43c0bc,_0x7478ec){var _0x4b19a4,_0x2e4e3a;var _0x386058=[];var _0x431eb7=moment()[_0xe065('0x8a')](_0xe065('0x61'));return db[_0xe065('0x2a')]['find']({'where':{'id':_0x3fedd8[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x43c0bc,null))['then'](function(_0x163baa){if(_0x163baa){_0x2e4e3a=_0x163baa;return _0x163baa[_0xe065('0x89')](_0x3fedd8[_0xe065('0x53')][_0xe065('0x62')],_['omit'](_0x3fedd8[_0xe065('0x53')],[_0xe065('0x62'),'id'])||{});}return null;})[_0xe065('0x8b')](function(_0xe32541){var _0xa70959;var _0xa0077e;_0x4b19a4=_0xe32541||[];var _0x310652=[];if(_0xe32541){for(var _0x5db0c4=0x0;_0x5db0c4<_0xe32541[_0xe065('0x33')];_0x5db0c4+=0x1){var _0x5458d7=_0xe32541[_0x5db0c4][_0xe065('0x48')]({'plain':!![]});_0xa70959=squel[_0xe065('0x77')]()[_0xe065('0x78')](_0xe065('0x8c'))['fromQuery']([_0xe065('0x66'),_0xe065('0x68'),_0xe065('0x6e'),_0xe065('0x59'),_0xe065('0x51'),_0xe065('0x52')],squel[_0xe065('0x69')]()[_0xe065('0x6a')](_0xe065('0x66'),_0xe065('0x66'))[_0xe065('0x6a')]('id',_0xe065('0x68'))[_0xe065('0x6a')](_0x5458d7[_0xe065('0x6c')][_0xe065('0x6d')](),_0xe065('0x6e'))[_0xe065('0x6a')](_0x3fedd8[_0xe065('0x42')]['id'][_0xe065('0x6d')](),'CampaignId')[_0xe065('0x6a')](_0xe065('0x6b'),_0xe065('0x51'))[_0xe065('0x6a')](_0xe065('0x6b'),_0xe065('0x52'))[_0xe065('0x6f')](_0xe065('0x70'))['where'](_0xe065('0x71'))[_0xe065('0x3a')](_0xe065('0x72'),_0x5458d7[_0xe065('0x6c')][_0xe065('0x6d')]())[_0xe065('0x3a')](_0xe065('0x73')))[_0xe065('0x6d')]();_0x310652[_0xe065('0x84')](db[_0xe065('0x85')]['query'](_0xa70959));}return BPromise[_0xe065('0x86')](_0x310652);}})[_0xe065('0x22')](function(){return _0x4b19a4;})[_0xe065('0x22')](respondWithResult(_0x43c0bc,null))['catch'](handleError(_0x43c0bc,null));};exports[_0xe065('0x8d')]=function(_0x242acc,_0x39a367,_0x44102a){return db[_0xe065('0x2a')][_0xe065('0x45')]({'where':{'id':_0x242acc[_0xe065('0x42')]['id']}})['then'](handleEntityNotFound(_0x39a367,null))[_0xe065('0x22')](function(_0x2b1cfe){if(_0x2b1cfe){return _0x2b1cfe[_0xe065('0x8d')](_0x242acc[_0xe065('0x2d')][_0xe065('0x62')]);}})[_0xe065('0x22')](function(_0x27c86a){if(_0x27c86a){return db[_0xe065('0x5d')][_0xe065('0x23')]({'where':{'ListId':_0x242acc[_0xe065('0x2d')][_0xe065('0x62')],'CampaignId':_0x242acc[_0xe065('0x42')]['id']}})[_0xe065('0x22')](function(){return _0x27c86a;});}})['then'](respondWithStatusCode(_0x39a367,null))[_0xe065('0x4d')](handleError(_0x39a367,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 0955764..1f70123 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x27f9ff,_0x26b9c){var _0x349f72=function(_0xfe811){while(--_0xfe811){_0x27f9ff['push'](_0x27f9ff['shift']());}};_0x349f72(++_0x26b9c);}(_0x7a54,0x106));var _0x47a5=function(_0x382893,_0x3eea1f){_0x382893=_0x382893-0x0;var _0x396877=_0x7a54[_0x382893];return _0x396877;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index d201420..5c7f383 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 _0xc2cc=['model','then','catch','GetCampaign','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Campaign','findAll','options','raw','map','include','attributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc2cc,0x70));var _0xcc2c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc2cc[_0x40a045];return _0x1a687c;};'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['GetCampaign']=function(_0x31849a){var _0x285deb=this;return new Promise(function(_0x440458,_0x2a9f02){return db[_0xcc2c('0x10')][_0xcc2c('0x11')]({'raw':_0x31849a[_0xcc2c('0x12')]?_0x31849a['options'][_0xcc2c('0x13')]===undefined?!![]:![]:!![],'where':_0x31849a[_0xcc2c('0x12')]?_0x31849a['options']['where']||null:null,'attributes':_0x31849a['options']?_0x31849a[_0xcc2c('0x12')]['attributes']||null:null,'limit':_0x31849a[_0xcc2c('0x12')]?_0x31849a[_0xcc2c('0x12')]['limit']||null:null,'include':_0x31849a[_0xcc2c('0x12')]?_0x31849a[_0xcc2c('0x12')]['include']?_[_0xcc2c('0x14')](_0x31849a['options'][_0xcc2c('0x15')],function(_0x5233e3){return{'model':db[_0x5233e3['model']],'as':_0x5233e3['as'],'attributes':_0x5233e3[_0xcc2c('0x16')],'include':_0x5233e3[_0xcc2c('0x15')]?_['map'](_0x5233e3[_0xcc2c('0x15')],function(_0x1d3f8d){return{'model':db[_0x1d3f8d[_0xcc2c('0x17')]],'as':_0x1d3f8d['as'],'attributes':_0x1d3f8d[_0xcc2c('0x16')],'include':_0x1d3f8d[_0xcc2c('0x15')]?_[_0xcc2c('0x14')](_0x1d3f8d['include'],function(_0xaab877){return{'model':db[_0xaab877[_0xcc2c('0x17')]],'as':_0xaab877['as'],'attributes':_0xaab877[_0xcc2c('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcc2c('0x18')](function(_0x430eef){logger['info']('GetCampaign',_0x31849a);logger['debug']('GetCampaign',_0x31849a,JSON[_0xcc2c('0xc')](_0x430eef));_0x440458(_0x430eef);})[_0xcc2c('0x19')](function(_0x406515){logger[_0xcc2c('0xd')](_0xcc2c('0x1a'),_0x406515[_0xcc2c('0xe')],_0x31849a);_0x2a9f02(_0x285deb[_0xcc2c('0xd')](0x1f4,_0x406515[_0xcc2c('0xe')]));});});}; \ No newline at end of file +var _0xcd4e=['../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x9861ff,_0x41fb17){var _0x48852b=function(_0x557001){while(--_0x557001){_0x9861ff['push'](_0x9861ff['shift']());}};_0x48852b(++_0x41fb17);}(_0xcd4e,0x187));var _0xecd4=function(_0x5ae68b,_0x45df8b){_0x5ae68b=_0x5ae68b-0x0;var _0x4d39dd=_0xcd4e[_0x5ae68b];return _0x4d39dd;};'use strict';var _=require(_0xecd4('0x0'));var util=require(_0xecd4('0x1'));var moment=require(_0xecd4('0x2'));var BPromise=require(_0xecd4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecd4('0x4'))['db'];var utils=require(_0xecd4('0x5'));var logger=require('../../config/logger')(_0xecd4('0x6'));var config=require('../../config/environment');var jayson=require(_0xecd4('0x7'));var client=jayson['client'][_0xecd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24fb20,_0xd3a542,_0x4466f1){return new BPromise(function(_0x181253,_0x50c53d){return client[_0xecd4('0x9')](_0x24fb20,_0x4466f1)[_0xecd4('0xa')](function(_0x511c0f){logger[_0xecd4('0xb')]('Campaign,\x20%s,\x20%s',_0xd3a542,_0xecd4('0xc'));logger[_0xecd4('0xd')](_0xecd4('0xe'),_0xd3a542,'request\x20sent',JSON[_0xecd4('0xf')](_0x511c0f));if(_0x511c0f[_0xecd4('0x10')]){if(_0x511c0f['error'][_0xecd4('0x11')]===0x1f4){logger['error'](_0xecd4('0x12'),_0xd3a542,_0x511c0f[_0xecd4('0x10')][_0xecd4('0x13')]);return _0x50c53d(_0x511c0f[_0xecd4('0x10')][_0xecd4('0x13')]);}logger['error'](_0xecd4('0x12'),_0xd3a542,_0x511c0f[_0xecd4('0x10')][_0xecd4('0x13')]);return _0x181253(_0x511c0f[_0xecd4('0x10')][_0xecd4('0x13')]);}else{logger[_0xecd4('0xb')](_0xecd4('0x12'),_0xd3a542,_0xecd4('0xc'));_0x181253(_0x511c0f[_0xecd4('0x14')]['message']);}})[_0xecd4('0x15')](function(_0x10d1e7){logger[_0xecd4('0x10')](_0xecd4('0x12'),_0xd3a542,_0x10d1e7);_0x50c53d(_0x10d1e7);});});}exports[_0xecd4('0x16')]=function(_0x2470ec){var _0x4e11f3=this;return new Promise(function(_0x703bb4,_0x5c95f0){return db[_0xecd4('0x17')][_0xecd4('0x18')]({'raw':_0x2470ec[_0xecd4('0x19')]?_0x2470ec[_0xecd4('0x19')][_0xecd4('0x1a')]===undefined?!![]:![]:!![],'where':_0x2470ec[_0xecd4('0x19')]?_0x2470ec[_0xecd4('0x19')][_0xecd4('0x1b')]||null:null,'attributes':_0x2470ec[_0xecd4('0x19')]?_0x2470ec[_0xecd4('0x19')][_0xecd4('0x1c')]||null:null,'limit':_0x2470ec['options']?_0x2470ec[_0xecd4('0x19')][_0xecd4('0x1d')]||null:null,'include':_0x2470ec[_0xecd4('0x19')]?_0x2470ec['options'][_0xecd4('0x1e')]?_['map'](_0x2470ec['options'][_0xecd4('0x1e')],function(_0x11c791){return{'model':db[_0x11c791[_0xecd4('0x1f')]],'as':_0x11c791['as'],'attributes':_0x11c791[_0xecd4('0x1c')],'include':_0x11c791[_0xecd4('0x1e')]?_[_0xecd4('0x20')](_0x11c791['include'],function(_0x2910e1){return{'model':db[_0x2910e1[_0xecd4('0x1f')]],'as':_0x2910e1['as'],'attributes':_0x2910e1[_0xecd4('0x1c')],'include':_0x2910e1['include']?_[_0xecd4('0x20')](_0x2910e1[_0xecd4('0x1e')],function(_0x3ccb67){return{'model':db[_0x3ccb67['model']],'as':_0x3ccb67['as'],'attributes':_0x3ccb67[_0xecd4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xecd4('0xa')](function(_0x4cf576){logger[_0xecd4('0xb')]('GetCampaign',_0x2470ec);logger[_0xecd4('0xd')](_0xecd4('0x16'),_0x2470ec,JSON[_0xecd4('0xf')](_0x4cf576));_0x703bb4(_0x4cf576);})[_0xecd4('0x15')](function(_0x3b1ef0){logger['error'](_0xecd4('0x16'),_0x3b1ef0[_0xecd4('0x13')],_0x2470ec);_0x5c95f0(_0x4e11f3['error'](0x1f4,_0x3b1ef0[_0xecd4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 7716f6f..56e836a 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 _0x7153=['isAuthenticated','index','show','/:id/hoppers','/:id/hopper_finals','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','put','/:id','update','delete','removeLists','removeBlackLists','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7153,0x136));var _0x3715=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x7153[_0x23e7c1];return _0x1add43;};'use strict';var multer=require('multer');var util=require(_0x3715('0x0'));var path=require(_0x3715('0x1'));var timeout=require(_0x3715('0x2'));var express=require(_0x3715('0x3'));var router=express[_0x3715('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3715('0x5'));var interaction=require(_0x3715('0x6'));var config=require(_0x3715('0x7'));var controller=require('./campaign.controller');router[_0x3715('0x8')]('/',auth[_0x3715('0x9')](),controller[_0x3715('0xa')]);router[_0x3715('0x8')]('/:id',auth[_0x3715('0x9')](),controller[_0x3715('0xb')]);router['get'](_0x3715('0xc'),auth[_0x3715('0x9')](),controller['getHoppers']);router[_0x3715('0x8')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0x3715('0xd'),auth[_0x3715('0x9')](),controller['getHopperFinals']);router[_0x3715('0x8')]('/:id/hopper_black',auth[_0x3715('0x9')](),controller[_0x3715('0xe')]);router[_0x3715('0x8')](_0x3715('0xf'),auth[_0x3715('0x9')](),controller['getLists']);router[_0x3715('0x8')]('/:id/blacklists',auth[_0x3715('0x9')](),controller[_0x3715('0x10')]);router[_0x3715('0x11')]('/',auth[_0x3715('0x9')](),controller[_0x3715('0x12')]);router[_0x3715('0x11')](_0x3715('0x13'),auth[_0x3715('0x9')](),controller[_0x3715('0x14')]);router['post']('/:id/lists',auth[_0x3715('0x9')](),controller[_0x3715('0x15')]);router[_0x3715('0x11')](_0x3715('0x16'),auth[_0x3715('0x9')](),controller['addBlackLists']);router[_0x3715('0x17')](_0x3715('0x18'),auth[_0x3715('0x9')](),controller[_0x3715('0x19')]);router['delete'](_0x3715('0x18'),auth['isAuthenticated'](),controller['destroy']);router[_0x3715('0x1a')]('/:id/lists',auth[_0x3715('0x9')](),controller[_0x3715('0x1b')]);router[_0x3715('0x1a')]('/:id/blacklists',auth[_0x3715('0x9')](),controller[_0x3715('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x6135=['get','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index'];(function(_0x395149,_0x3feea4){var _0x2fe601=function(_0x11d511){while(--_0x11d511){_0x395149['push'](_0x395149['shift']());}};_0x2fe601(++_0x3feea4);}(_0x6135,0x18b));var _0x5613=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0x6135[_0x56fb33];return _0x435ee4;};'use strict';var multer=require(_0x5613('0x0'));var util=require(_0x5613('0x1'));var path=require(_0x5613('0x2'));var timeout=require(_0x5613('0x3'));var express=require(_0x5613('0x4'));var router=express['Router']();var fs_extra=require(_0x5613('0x5'));var auth=require(_0x5613('0x6'));var interaction=require(_0x5613('0x7'));var config=require(_0x5613('0x8'));var controller=require(_0x5613('0x9'));router['get']('/',auth[_0x5613('0xa')](),controller[_0x5613('0xb')]);router[_0x5613('0xc')](_0x5613('0xd'),auth[_0x5613('0xa')](),controller['show']);router[_0x5613('0xc')](_0x5613('0xe'),auth[_0x5613('0xa')](),controller['getHoppers']);router['get'](_0x5613('0xf'),auth['isAuthenticated'](),controller[_0x5613('0x10')]);router[_0x5613('0xc')](_0x5613('0x11'),auth[_0x5613('0xa')](),controller[_0x5613('0x12')]);router['get'](_0x5613('0x13'),auth[_0x5613('0xa')](),controller[_0x5613('0x14')]);router['get'](_0x5613('0x15'),auth[_0x5613('0xa')](),controller[_0x5613('0x16')]);router[_0x5613('0xc')](_0x5613('0x17'),auth[_0x5613('0xa')](),controller[_0x5613('0x18')]);router['post']('/',auth[_0x5613('0xa')](),controller[_0x5613('0x19')]);router[_0x5613('0x1a')](_0x5613('0x1b'),auth[_0x5613('0xa')](),controller[_0x5613('0x1c')]);router[_0x5613('0x1a')](_0x5613('0x15'),auth['isAuthenticated'](),controller[_0x5613('0x1d')]);router[_0x5613('0x1a')](_0x5613('0x17'),auth['isAuthenticated'](),controller[_0x5613('0x1e')]);router[_0x5613('0x1f')](_0x5613('0xd'),auth[_0x5613('0xa')](),controller['update']);router[_0x5613('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x5613('0x21')]);router['delete'](_0x5613('0x15'),auth[_0x5613('0xa')](),controller[_0x5613('0x22')]);router[_0x5613('0x20')](_0x5613('0x17'),auth['isAuthenticated'](),controller[_0x5613('0x23')]);module[_0x5613('0x24')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6efd83e..3287187 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 _0x2ad2=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0xb471c,_0x27b05c){var _0x590467=function(_0x2ac574){while(--_0x2ac574){_0xb471c['push'](_0xb471c['shift']());}};_0x590467(++_0x27b05c);}(_0x2ad2,0x14a));var _0x22ad=function(_0x936f1f,_0x2eaf2f){_0x936f1f=_0x936f1f-0x0;var _0xb36ff7=_0x2ad2[_0x936f1f];return _0xb36ff7;};'use strict';var Sequelize=require(_0x22ad('0x0'));module[_0x22ad('0x1')]={'key':{'type':Sequelize[_0x22ad('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x22ad('0x2')]},'name':{'type':Sequelize[_0x22ad('0x3')],'get':function(){return this[_0x22ad('0x4')](_0x22ad('0x5'));}}}; \ No newline at end of file +var _0x6747=['exports','STRING','VIRTUAL','getDataValue'];(function(_0x69144d,_0x4ab89c){var _0x4cb10e=function(_0x4152ba){while(--_0x4152ba){_0x69144d['push'](_0x69144d['shift']());}};_0x4cb10e(++_0x4ab89c);}(_0x6747,0xec));var _0x7674=function(_0x454db7,_0x19898f){_0x454db7=_0x454db7-0x0;var _0x520d54=_0x6747[_0x454db7];return _0x520d54;};'use strict';var Sequelize=require('sequelize');module[_0x7674('0x0')]={'key':{'type':Sequelize[_0x7674('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7674('0x2')],'get':function(){return this[_0x7674('0x3')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 989ef20..ad699de 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 _0x9390=['status','offset','undefined','limit','count','set','json','apply','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','includeAll','include','findAll','rows','show','params','CannedAnswer','options','catch','update','body','find','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','rimraf','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','end'];(function(_0x264716,_0x19baf0){var _0x2679b8=function(_0x13709c){while(--_0x13709c){_0x264716['push'](_0x264716['shift']());}};_0x2679b8(++_0x19baf0);}(_0x9390,0x133));var _0x0939=function(_0x18803b,_0x105b6c){_0x18803b=_0x18803b-0x0;var _0x454739=_0x9390[_0x18803b];return _0x454739;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0939('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0939('0x1'));var moment=require('moment');var BPromise=require(_0x0939('0x2'));var Mustache=require(_0x0939('0x3'));var util=require(_0x0939('0x4'));var path=require('path');var sox=require(_0x0939('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0939('0x6'));var _=require(_0x0939('0x7'));var squel=require(_0x0939('0x8'));var crypto=require(_0x0939('0x9'));var jsforce=require(_0x0939('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0939('0xb'));var Papa=require(_0x0939('0xc'));var Redis=require(_0x0939('0xd'));var authService=require(_0x0939('0xe'));var qs=require(_0x0939('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0939('0x10'));var utils=require(_0x0939('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0939('0x12'))['db'];function respondWithStatusCode(_0x3f875a,_0x408c0a){_0x408c0a=_0x408c0a||0xcc;return function(_0x203c7c){if(_0x203c7c){return _0x3f875a[_0x0939('0x13')](_0x408c0a);}return _0x3f875a['status'](_0x408c0a)[_0x0939('0x14')]();};}function respondWithResult(_0x5f004a,_0x36f2ee){_0x36f2ee=_0x36f2ee||0xc8;return function(_0x4c9246){if(_0x4c9246){return _0x5f004a[_0x0939('0x15')](_0x36f2ee)['json'](_0x4c9246);}};}function respondWithFilteredResult(_0x18a8df,_0x2fc5a6){return function(_0x4ddce7){if(_0x4ddce7){var _0x261aeb=typeof _0x2fc5a6[_0x0939('0x16')]===_0x0939('0x17')&&typeof _0x2fc5a6[_0x0939('0x18')]===_0x0939('0x17');var _0x29354e=_0x4ddce7['count'];var _0x59ddf7=_0x261aeb?0x0:_0x2fc5a6[_0x0939('0x16')];var _0x39e9c5=_0x261aeb?_0x4ddce7[_0x0939('0x19')]:_0x2fc5a6[_0x0939('0x16')]+_0x2fc5a6[_0x0939('0x18')];var _0x4147d9;if(_0x39e9c5>=_0x29354e){_0x39e9c5=_0x29354e;_0x4147d9=0xc8;}else{_0x4147d9=0xce;}_0x18a8df[_0x0939('0x15')](_0x4147d9);return _0x18a8df[_0x0939('0x1a')]('Content-Range',_0x59ddf7+'-'+_0x39e9c5+'/'+_0x29354e)[_0x0939('0x1b')](_0x4ddce7);}return null;};}function patchUpdates(_0x4aaf45){return function(_0x5e6863){try{jsonpatch[_0x0939('0x1c')](_0x5e6863,_0x4aaf45,!![]);}catch(_0x369111){return BPromise['reject'](_0x369111);}return _0x5e6863['save']();};}function saveUpdates(_0x255fd2,_0x35c61f){return function(_0x41b7d3){if(_0x41b7d3){return _0x41b7d3['update'](_0x255fd2)[_0x0939('0x1d')](function(_0x1be11e){return _0x1be11e;});}return null;};}function removeEntity(_0x3d9edd,_0x58e87a){return function(_0x39c9fc){if(_0x39c9fc){return _0x39c9fc[_0x0939('0x1e')]()[_0x0939('0x1d')](function(){var _0x411fd4=_0x39c9fc[_0x0939('0x1f')]({'plain':!![]});var _0xcd2fe6=_0x0939('0x20');return db[_0x0939('0x21')][_0x0939('0x1e')]({'where':{'type':_0xcd2fe6,'resourceId':_0x411fd4['id']}})['then'](function(){return _0x39c9fc;});})[_0x0939('0x1d')](function(){_0x3d9edd['status'](0xcc)[_0x0939('0x14')]();});}};}function handleEntityNotFound(_0x3e0761,_0x3e4ccc){return function(_0x5705f1){if(!_0x5705f1){_0x3e0761[_0x0939('0x13')](0x194);}return _0x5705f1;};}function handleError(_0x405dcb,_0x49be7b){_0x49be7b=_0x49be7b||0x1f4;return function(_0x269fd5){logger[_0x0939('0x22')](_0x269fd5[_0x0939('0x23')]);if(_0x269fd5[_0x0939('0x24')]){delete _0x269fd5[_0x0939('0x24')];}_0x405dcb[_0x0939('0x15')](_0x49be7b)[_0x0939('0x25')](_0x269fd5);};}exports[_0x0939('0x26')]=function(_0x3baa91,_0x3127ab){var _0x1994e1={},_0xe3eac0={},_0x374dfc={'count':0x0,'rows':[]};var _0x3afddb=_[_0x0939('0x27')](db['CannedAnswer']['rawAttributes'],function(_0x41b5be){return{'name':_0x41b5be[_0x0939('0x28')],'type':_0x41b5be[_0x0939('0x29')]['key']};});_0xe3eac0[_0x0939('0x2a')]=_[_0x0939('0x27')](_0x3afddb,_0x0939('0x24'));_0xe3eac0['query']=_[_0x0939('0x2b')](_0x3baa91[_0x0939('0x2c')]);_0xe3eac0['filters']=_[_0x0939('0x2d')](_0xe3eac0[_0x0939('0x2a')],_0xe3eac0['query']);_0x1994e1[_0x0939('0x2e')]=_['intersection'](_0xe3eac0['model'],qs['fields'](_0x3baa91[_0x0939('0x2c')][_0x0939('0x2f')]));_0x1994e1['attributes']=_0x1994e1[_0x0939('0x2e')][_0x0939('0x30')]?_0x1994e1[_0x0939('0x2e')]:_0xe3eac0[_0x0939('0x2a')];if(!_0x3baa91[_0x0939('0x2c')]['hasOwnProperty'](_0x0939('0x31'))){_0x1994e1[_0x0939('0x18')]=qs['limit'](_0x3baa91[_0x0939('0x2c')][_0x0939('0x18')]);_0x1994e1[_0x0939('0x16')]=qs['offset'](_0x3baa91[_0x0939('0x2c')][_0x0939('0x16')]);}_0x1994e1[_0x0939('0x32')]=qs[_0x0939('0x33')](_0x3baa91['query'][_0x0939('0x33')]);_0x1994e1['where']=qs[_0x0939('0x34')](_['pick'](_0x3baa91[_0x0939('0x2c')],_0xe3eac0[_0x0939('0x34')]),_0x3afddb);if(_0x3baa91[_0x0939('0x2c')][_0x0939('0x35')]){_0x1994e1[_0x0939('0x36')]=_[_0x0939('0x37')](_0x1994e1[_0x0939('0x36')],{'$or':[{'key':{'$like':'%'+_0x3baa91[_0x0939('0x2c')][_0x0939('0x35')]+'%'}},{'value':{'$like':'%'+_0x3baa91[_0x0939('0x2c')][_0x0939('0x35')]+'%'}}]});}_0x1994e1=_['merge']({},_0x1994e1,_0x3baa91['options']);var _0x18a173={'where':_0x1994e1[_0x0939('0x36')]};return db['CannedAnswer'][_0x0939('0x19')](_0x18a173)[_0x0939('0x1d')](function(_0x413368){_0x374dfc['count']=_0x413368;if(_0x3baa91[_0x0939('0x2c')][_0x0939('0x38')]){_0x1994e1[_0x0939('0x39')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0939('0x3a')](_0x1994e1);})[_0x0939('0x1d')](function(_0x436165){_0x374dfc[_0x0939('0x3b')]=_0x436165;return _0x374dfc;})[_0x0939('0x1d')](respondWithFilteredResult(_0x3127ab,_0x1994e1))['catch'](handleError(_0x3127ab,null));};exports[_0x0939('0x3c')]=function(_0x1756bd,_0x2eb35d){var _0x3a077c={'raw':!![],'where':{'id':_0x1756bd[_0x0939('0x3d')]['id']}},_0x4a3bd2={};_0x4a3bd2[_0x0939('0x2a')]=_[_0x0939('0x2b')](db[_0x0939('0x3e')]['rawAttributes']);_0x4a3bd2[_0x0939('0x2c')]=_[_0x0939('0x2b')](_0x1756bd[_0x0939('0x2c')]);_0x4a3bd2[_0x0939('0x34')]=_[_0x0939('0x2d')](_0x4a3bd2[_0x0939('0x2a')],_0x4a3bd2[_0x0939('0x2c')]);_0x3a077c[_0x0939('0x2e')]=_['intersection'](_0x4a3bd2['model'],qs[_0x0939('0x2f')](_0x1756bd['query'][_0x0939('0x2f')]));_0x3a077c[_0x0939('0x2e')]=_0x3a077c[_0x0939('0x2e')]['length']?_0x3a077c[_0x0939('0x2e')]:_0x4a3bd2[_0x0939('0x2a')];if(_0x1756bd[_0x0939('0x2c')][_0x0939('0x38')]){_0x3a077c['include']=[{'all':!![]}];}_0x3a077c=_['merge']({},_0x3a077c,_0x1756bd[_0x0939('0x3f')]);return db[_0x0939('0x3e')]['find'](_0x3a077c)['then'](handleEntityNotFound(_0x2eb35d,null))[_0x0939('0x1d')](respondWithResult(_0x2eb35d,null))[_0x0939('0x40')](handleError(_0x2eb35d,null));};exports[_0x0939('0x41')]=function(_0x84ad5a,_0x4b7476){if(_0x84ad5a['body']['id']){delete _0x84ad5a[_0x0939('0x42')]['id'];}return db['CannedAnswer'][_0x0939('0x43')]({'where':{'id':_0x84ad5a[_0x0939('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4b7476,null))['then'](saveUpdates(_0x84ad5a[_0x0939('0x42')],null))[_0x0939('0x1d')](respondWithResult(_0x4b7476,null))[_0x0939('0x40')](handleError(_0x4b7476,null));};exports[_0x0939('0x1e')]=function(_0x11936f,_0x53e65c){return db[_0x0939('0x3e')][_0x0939('0x43')]({'where':{'id':_0x11936f[_0x0939('0x3d')]['id']}})['then'](handleEntityNotFound(_0x53e65c,null))[_0x0939('0x1d')](removeEntity(_0x53e65c,null))[_0x0939('0x40')](handleError(_0x53e65c,null));};exports['create']=function(_0x51490b,_0x39da39){var _0x15ac9b={'key':_0x51490b[_0x0939('0x42')][_0x0939('0x44')]};if(_0x51490b[_0x0939('0x42')][_0x0939('0x45')]){_0x15ac9b[_0x0939('0x45')]=_0x51490b[_0x0939('0x42')]['MailAccountId'];}else if(_0x51490b['body'][_0x0939('0x46')]){_0x15ac9b['SmsAccountId']=_0x51490b[_0x0939('0x42')]['SmsAccountId'];}else if(_0x51490b['body'][_0x0939('0x47')]){_0x15ac9b[_0x0939('0x47')]=_0x51490b[_0x0939('0x42')][_0x0939('0x47')];}else if(_0x51490b[_0x0939('0x42')][_0x0939('0x48')]){_0x15ac9b[_0x0939('0x48')]=_0x51490b[_0x0939('0x42')][_0x0939('0x48')];}return db[_0x0939('0x3e')][_0x0939('0x43')]({'where':_0x15ac9b})[_0x0939('0x1d')](function(_0x1e8654){if(_0x1e8654){throw new db[(_0x0939('0x49'))][(_0x0939('0x4a'))](_0x0939('0x4b'));}return db[_0x0939('0x3e')][_0x0939('0x4c')](_0x51490b[_0x0939('0x42')]);})[_0x0939('0x1d')](function(_0x49a183){var _0x25a3ab=_0x51490b[_0x0939('0x4d')][_0x0939('0x1f')]({'plain':!![]});if(!_0x25a3ab)throw new Error(_0x0939('0x4e'));if(_0x25a3ab['role']===_0x0939('0x4d')){var _0x18917c=_0x49a183[_0x0939('0x1f')]({'plain':!![]});return db[_0x0939('0x4f')][_0x0939('0x43')]({'where':{'name':_0x0939('0x20'),'userProfileId':_0x25a3ab[_0x0939('0x50')]},'raw':!![]})[_0x0939('0x1d')](function(_0x2ee266){if(_0x2ee266&&_0x2ee266[_0x0939('0x51')]===0x0){return db[_0x0939('0x21')][_0x0939('0x4c')]({'name':_0x18917c[_0x0939('0x24')],'resourceId':_0x18917c['id'],'type':_0x2ee266[_0x0939('0x24')],'sectionId':_0x2ee266['id']},{})['then'](function(){return _0x49a183;});}else{return _0x49a183;}})[_0x0939('0x40')](function(_0x2e2ecd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e2ecd);throw _0x2e2ecd;});}return _0x49a183;})['then'](respondWithResult(_0x39da39,0xc9))['catch'](handleError(_0x39da39,null));}; \ No newline at end of file +var _0xfd20=['update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','map','CannedAnswer','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','count','include','rows','catch','show','params','rawAttributes','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save'];(function(_0x5caaad,_0x4891c9){var _0x655540=function(_0x220537){while(--_0x220537){_0x5caaad['push'](_0x5caaad['shift']());}};_0x655540(++_0x4891c9);}(_0xfd20,0x1f2));var _0x0fd2=function(_0x1f803d,_0x1c966e){_0x1f803d=_0x1f803d-0x0;var _0x549186=_0xfd20[_0x1f803d];return _0x549186;};'use strict';var emlformat=require(_0x0fd2('0x0'));var rimraf=require(_0x0fd2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fd2('0x2'));var rp=require(_0x0fd2('0x3'));var moment=require('moment');var BPromise=require(_0x0fd2('0x4'));var Mustache=require(_0x0fd2('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0fd2('0x6'));var csv=require(_0x0fd2('0x7'));var ejs=require(_0x0fd2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fd2('0x9'));var squel=require('squel');var crypto=require(_0x0fd2('0xa'));var jsforce=require(_0x0fd2('0xb'));var deskjs=require(_0x0fd2('0xc'));var toCsv=require(_0x0fd2('0x7'));var querystring=require(_0x0fd2('0xd'));var Papa=require('papaparse');var Redis=require(_0x0fd2('0xe'));var authService=require(_0x0fd2('0xf'));var qs=require(_0x0fd2('0x10'));var as=require(_0x0fd2('0x11'));var hardwareService=require(_0x0fd2('0x12'));var logger=require(_0x0fd2('0x13'))('api');var utils=require(_0x0fd2('0x14'));var config=require(_0x0fd2('0x15'));var licenseUtil=require(_0x0fd2('0x16'));var db=require(_0x0fd2('0x17'))['db'];function respondWithStatusCode(_0x595616,_0x18e78c){_0x18e78c=_0x18e78c||0xcc;return function(_0x42e6a4){if(_0x42e6a4){return _0x595616[_0x0fd2('0x18')](_0x18e78c);}return _0x595616[_0x0fd2('0x19')](_0x18e78c)[_0x0fd2('0x1a')]();};}function respondWithResult(_0x3c97d4,_0x44d827){_0x44d827=_0x44d827||0xc8;return function(_0x291af1){if(_0x291af1){return _0x3c97d4['status'](_0x44d827)[_0x0fd2('0x1b')](_0x291af1);}};}function respondWithFilteredResult(_0x27d6f7,_0x39cffb){return function(_0x1c4b7c){if(_0x1c4b7c){var _0xd44a32=typeof _0x39cffb[_0x0fd2('0x1c')]===_0x0fd2('0x1d')&&typeof _0x39cffb[_0x0fd2('0x1e')]===_0x0fd2('0x1d');var _0x2d657d=_0x1c4b7c['count'];var _0x4c1c81=_0xd44a32?0x0:_0x39cffb[_0x0fd2('0x1c')];var _0x1bc604=_0xd44a32?_0x1c4b7c['count']:_0x39cffb[_0x0fd2('0x1c')]+_0x39cffb['limit'];var _0x23fb5f;if(_0x1bc604>=_0x2d657d){_0x1bc604=_0x2d657d;_0x23fb5f=0xc8;}else{_0x23fb5f=0xce;}_0x27d6f7[_0x0fd2('0x19')](_0x23fb5f);return _0x27d6f7[_0x0fd2('0x1f')](_0x0fd2('0x20'),_0x4c1c81+'-'+_0x1bc604+'/'+_0x2d657d)[_0x0fd2('0x1b')](_0x1c4b7c);}return null;};}function patchUpdates(_0x42b2a8){return function(_0x1362da){try{jsonpatch[_0x0fd2('0x21')](_0x1362da,_0x42b2a8,!![]);}catch(_0x3a4070){return BPromise[_0x0fd2('0x22')](_0x3a4070);}return _0x1362da[_0x0fd2('0x23')]();};}function saveUpdates(_0x3eb24b,_0x18e77e){return function(_0x139e77){if(_0x139e77){return _0x139e77[_0x0fd2('0x24')](_0x3eb24b)[_0x0fd2('0x25')](function(_0x294c1d){return _0x294c1d;});}return null;};}function removeEntity(_0x228997,_0x31c4d8){return function(_0x481e05){if(_0x481e05){return _0x481e05[_0x0fd2('0x26')]()['then'](function(){var _0x476c63=_0x481e05[_0x0fd2('0x27')]({'plain':!![]});var _0xb864ee=_0x0fd2('0x28');return db[_0x0fd2('0x29')][_0x0fd2('0x26')]({'where':{'type':_0xb864ee,'resourceId':_0x476c63['id']}})[_0x0fd2('0x25')](function(){return _0x481e05;});})[_0x0fd2('0x25')](function(){_0x228997[_0x0fd2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53cf14,_0x51f00e){return function(_0x43307a){if(!_0x43307a){_0x53cf14[_0x0fd2('0x18')](0x194);}return _0x43307a;};}function handleError(_0x2f36f0,_0x182db1){_0x182db1=_0x182db1||0x1f4;return function(_0x44af1c){logger[_0x0fd2('0x2a')](_0x44af1c[_0x0fd2('0x2b')]);if(_0x44af1c[_0x0fd2('0x2c')]){delete _0x44af1c[_0x0fd2('0x2c')];}_0x2f36f0[_0x0fd2('0x19')](_0x182db1)[_0x0fd2('0x2d')](_0x44af1c);};}exports['index']=function(_0x14a8f6,_0xbcc668){var _0x51f349={},_0x580887={},_0x52323e={'count':0x0,'rows':[]};var _0x25ac48=_[_0x0fd2('0x2e')](db[_0x0fd2('0x2f')]['rawAttributes'],function(_0x4b7ee6){return{'name':_0x4b7ee6[_0x0fd2('0x30')],'type':_0x4b7ee6[_0x0fd2('0x31')][_0x0fd2('0x32')]};});_0x580887[_0x0fd2('0x33')]=_[_0x0fd2('0x2e')](_0x25ac48,_0x0fd2('0x2c'));_0x580887['query']=_[_0x0fd2('0x34')](_0x14a8f6[_0x0fd2('0x35')]);_0x580887['filters']=_[_0x0fd2('0x36')](_0x580887['model'],_0x580887['query']);_0x51f349[_0x0fd2('0x37')]=_[_0x0fd2('0x36')](_0x580887[_0x0fd2('0x33')],qs[_0x0fd2('0x38')](_0x14a8f6[_0x0fd2('0x35')]['fields']));_0x51f349[_0x0fd2('0x37')]=_0x51f349[_0x0fd2('0x37')][_0x0fd2('0x39')]?_0x51f349[_0x0fd2('0x37')]:_0x580887[_0x0fd2('0x33')];if(!_0x14a8f6[_0x0fd2('0x35')]['hasOwnProperty'](_0x0fd2('0x3a'))){_0x51f349[_0x0fd2('0x1e')]=qs[_0x0fd2('0x1e')](_0x14a8f6[_0x0fd2('0x35')]['limit']);_0x51f349[_0x0fd2('0x1c')]=qs[_0x0fd2('0x1c')](_0x14a8f6['query'][_0x0fd2('0x1c')]);}_0x51f349[_0x0fd2('0x3b')]=qs[_0x0fd2('0x3c')](_0x14a8f6[_0x0fd2('0x35')][_0x0fd2('0x3c')]);_0x51f349[_0x0fd2('0x3d')]=qs[_0x0fd2('0x3e')](_[_0x0fd2('0x3f')](_0x14a8f6[_0x0fd2('0x35')],_0x580887[_0x0fd2('0x3e')]),_0x25ac48);if(_0x14a8f6[_0x0fd2('0x35')][_0x0fd2('0x40')]){_0x51f349[_0x0fd2('0x3d')]=_[_0x0fd2('0x41')](_0x51f349[_0x0fd2('0x3d')],{'$or':[{'key':{'$like':'%'+_0x14a8f6['query'][_0x0fd2('0x40')]+'%'}},{'value':{'$like':'%'+_0x14a8f6['query']['filter']+'%'}}]});}_0x51f349=_[_0x0fd2('0x41')]({},_0x51f349,_0x14a8f6[_0x0fd2('0x42')]);var _0x58d4c8={'where':_0x51f349[_0x0fd2('0x3d')]};return db['CannedAnswer'][_0x0fd2('0x43')](_0x58d4c8)[_0x0fd2('0x25')](function(_0x1d2e83){_0x52323e[_0x0fd2('0x43')]=_0x1d2e83;if(_0x14a8f6[_0x0fd2('0x35')]['includeAll']){_0x51f349[_0x0fd2('0x44')]=[{'all':!![]}];}return db[_0x0fd2('0x2f')]['findAll'](_0x51f349);})[_0x0fd2('0x25')](function(_0x2c033f){_0x52323e[_0x0fd2('0x45')]=_0x2c033f;return _0x52323e;})['then'](respondWithFilteredResult(_0xbcc668,_0x51f349))[_0x0fd2('0x46')](handleError(_0xbcc668,null));};exports[_0x0fd2('0x47')]=function(_0x37d7e1,_0x2f0008){var _0x1d41c6={'raw':!![],'where':{'id':_0x37d7e1[_0x0fd2('0x48')]['id']}},_0x891d78={};_0x891d78[_0x0fd2('0x33')]=_[_0x0fd2('0x34')](db[_0x0fd2('0x2f')][_0x0fd2('0x49')]);_0x891d78[_0x0fd2('0x35')]=_[_0x0fd2('0x34')](_0x37d7e1[_0x0fd2('0x35')]);_0x891d78[_0x0fd2('0x3e')]=_['intersection'](_0x891d78[_0x0fd2('0x33')],_0x891d78['query']);_0x1d41c6[_0x0fd2('0x37')]=_[_0x0fd2('0x36')](_0x891d78[_0x0fd2('0x33')],qs['fields'](_0x37d7e1[_0x0fd2('0x35')][_0x0fd2('0x38')]));_0x1d41c6[_0x0fd2('0x37')]=_0x1d41c6[_0x0fd2('0x37')]['length']?_0x1d41c6[_0x0fd2('0x37')]:_0x891d78[_0x0fd2('0x33')];if(_0x37d7e1[_0x0fd2('0x35')][_0x0fd2('0x4a')]){_0x1d41c6[_0x0fd2('0x44')]=[{'all':!![]}];}_0x1d41c6=_[_0x0fd2('0x41')]({},_0x1d41c6,_0x37d7e1['options']);return db['CannedAnswer'][_0x0fd2('0x4b')](_0x1d41c6)[_0x0fd2('0x25')](handleEntityNotFound(_0x2f0008,null))[_0x0fd2('0x25')](respondWithResult(_0x2f0008,null))[_0x0fd2('0x46')](handleError(_0x2f0008,null));};exports['update']=function(_0x3313d9,_0x3090bd){if(_0x3313d9[_0x0fd2('0x4c')]['id']){delete _0x3313d9[_0x0fd2('0x4c')]['id'];}return db[_0x0fd2('0x2f')][_0x0fd2('0x4b')]({'where':{'id':_0x3313d9[_0x0fd2('0x48')]['id']}})['then'](handleEntityNotFound(_0x3090bd,null))[_0x0fd2('0x25')](saveUpdates(_0x3313d9[_0x0fd2('0x4c')],null))[_0x0fd2('0x25')](respondWithResult(_0x3090bd,null))[_0x0fd2('0x46')](handleError(_0x3090bd,null));};exports[_0x0fd2('0x26')]=function(_0x53991e,_0x29b10d){return db[_0x0fd2('0x2f')][_0x0fd2('0x4b')]({'where':{'id':_0x53991e[_0x0fd2('0x48')]['id']}})[_0x0fd2('0x25')](handleEntityNotFound(_0x29b10d,null))[_0x0fd2('0x25')](removeEntity(_0x29b10d,null))['catch'](handleError(_0x29b10d,null));};exports[_0x0fd2('0x4d')]=function(_0x3be9d4,_0x8be0b2){var _0xc3747={'key':_0x3be9d4[_0x0fd2('0x4c')][_0x0fd2('0x32')]};if(_0x3be9d4[_0x0fd2('0x4c')]['MailAccountId']){_0xc3747[_0x0fd2('0x4e')]=_0x3be9d4[_0x0fd2('0x4c')][_0x0fd2('0x4e')];}else if(_0x3be9d4[_0x0fd2('0x4c')][_0x0fd2('0x4f')]){_0xc3747[_0x0fd2('0x4f')]=_0x3be9d4['body'][_0x0fd2('0x4f')];}else if(_0x3be9d4[_0x0fd2('0x4c')][_0x0fd2('0x50')]){_0xc3747[_0x0fd2('0x50')]=_0x3be9d4[_0x0fd2('0x4c')]['OpenchannelAccountId'];}else if(_0x3be9d4[_0x0fd2('0x4c')][_0x0fd2('0x51')]){_0xc3747[_0x0fd2('0x51')]=_0x3be9d4[_0x0fd2('0x4c')][_0x0fd2('0x51')];}return db['CannedAnswer'][_0x0fd2('0x4b')]({'where':_0xc3747})[_0x0fd2('0x25')](function(_0x1facb8){if(_0x1facb8){throw new db['Sequelize'][(_0x0fd2('0x52'))](_0x0fd2('0x53'));}return db[_0x0fd2('0x2f')]['create'](_0x3be9d4[_0x0fd2('0x4c')]);})[_0x0fd2('0x25')](function(_0x15a8dc){var _0x54cb10=_0x3be9d4[_0x0fd2('0x54')][_0x0fd2('0x27')]({'plain':!![]});if(!_0x54cb10)throw new Error(_0x0fd2('0x55'));if(_0x54cb10[_0x0fd2('0x56')]===_0x0fd2('0x54')){var _0x10f8a3=_0x15a8dc[_0x0fd2('0x27')]({'plain':!![]});return db[_0x0fd2('0x57')][_0x0fd2('0x4b')]({'where':{'name':_0x0fd2('0x28'),'userProfileId':_0x54cb10['userProfileId']},'raw':!![]})[_0x0fd2('0x25')](function(_0x5c8184){if(_0x5c8184&&_0x5c8184['autoAssociation']===0x0){return db[_0x0fd2('0x29')][_0x0fd2('0x4d')]({'name':_0x10f8a3['name'],'resourceId':_0x10f8a3['id'],'type':_0x5c8184[_0x0fd2('0x2c')],'sectionId':_0x5c8184['id']},{})['then'](function(){return _0x15a8dc;});}else{return _0x15a8dc;}})['catch'](function(_0x3ff43a){logger[_0x0fd2('0x2a')](_0x0fd2('0x58'),_0x3ff43a);throw _0x3ff43a;});}return _0x15a8dc;})[_0x0fd2('0x25')](respondWithResult(_0x8be0b2,0xc9))[_0x0fd2('0x46')](handleError(_0x8be0b2,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 05d5315..42f4344 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 _0x35ea=['api','moment','bluebird','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1b862a,_0x3e03af){var _0x1725fb=function(_0x599ab6){while(--_0x599ab6){_0x1b862a['push'](_0x1b862a['shift']());}};_0x1725fb(++_0x3e03af);}(_0x35ea,0x185));var _0xa35e=function(_0xa25342,_0x24522b){_0xa25342=_0xa25342-0x0;var _0x52be43=_0x35ea[_0xa25342];return _0x52be43;};'use strict';var _=require(_0xa35e('0x0'));var util=require(_0xa35e('0x1'));var logger=require(_0xa35e('0x2'))(_0xa35e('0x3'));var moment=require(_0xa35e('0x4'));var BPromise=require(_0xa35e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa35e('0x6'));var rimraf=require(_0xa35e('0x7'));var config=require('../../config/environment');var attributes=require(_0xa35e('0x8'));module[_0xa35e('0x9')]=function(_0x2ad302,_0x48acae){return _0x2ad302[_0xa35e('0xa')](_0xa35e('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa35e('0xc'),'collate':_0xa35e('0xd')});}; \ No newline at end of file +var _0xa4de=['CannedAnswer','tools_canned_answers','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x105737,_0x38e201){var _0x46045f=function(_0x341cd2){while(--_0x341cd2){_0x105737['push'](_0x105737['shift']());}};_0x46045f(++_0x38e201);}(_0xa4de,0x17d));var _0xea4d=function(_0x1e55a6,_0x22ac86){_0x1e55a6=_0x1e55a6-0x0;var _0xbd2caa=_0xa4de[_0x1e55a6];return _0xbd2caa;};'use strict';var _=require(_0xea4d('0x0'));var util=require('util');var logger=require(_0xea4d('0x1'))(_0xea4d('0x2'));var moment=require(_0xea4d('0x3'));var BPromise=require(_0xea4d('0x4'));var rp=require(_0xea4d('0x5'));var fs=require('fs');var path=require(_0xea4d('0x6'));var rimraf=require(_0xea4d('0x7'));var config=require(_0xea4d('0x8'));var attributes=require(_0xea4d('0x9'));module[_0xea4d('0xa')]=function(_0x5229d9,_0x244120){return _0x5229d9['define'](_0xea4d('0xb'),attributes,{'tableName':_0xea4d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea4d('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 8564753..05e7b5b 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(_0x280589,_0x88a39b){var _0x5da33c=function(_0x809069){while(--_0x809069){_0x280589['push'](_0x280589['shift']());}};_0x5da33c(++_0x88a39b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x3fff35,_0x20d05f){var _0x318e85=function(_0x144d7c){while(--_0x144d7c){_0x3fff35['push'](_0x3fff35['shift']());}};_0x318e85(++_0x20d05f);}(_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 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 7589e7a..42e26e5 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 _0x66ae=['fs-extra','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','get','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x5cea3c,_0x187f89){var _0x40aefe=function(_0xbab518){while(--_0xbab518){_0x5cea3c['push'](_0x5cea3c['shift']());}};_0x40aefe(++_0x187f89);}(_0x66ae,0x83));var _0xe66a=function(_0xdc6ffa,_0x5cb1d6){_0xdc6ffa=_0xdc6ffa-0x0;var _0x248293=_0x66ae[_0xdc6ffa];return _0x248293;};'use strict';var multer=require(_0xe66a('0x0'));var util=require('util');var path=require(_0xe66a('0x1'));var timeout=require(_0xe66a('0x2'));var express=require(_0xe66a('0x3'));var router=express[_0xe66a('0x4')]();var fs_extra=require(_0xe66a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe66a('0x6'));var config=require('../../config/environment');var controller=require(_0xe66a('0x7'));router['get']('/',auth[_0xe66a('0x8')](),controller['index']);router[_0xe66a('0x9')](_0xe66a('0xa'),auth[_0xe66a('0x8')](),controller[_0xe66a('0xb')]);router[_0xe66a('0xc')]('/',auth[_0xe66a('0x8')](),controller[_0xe66a('0xd')]);router['put']('/:id',auth[_0xe66a('0x8')](),controller[_0xe66a('0xe')]);router[_0xe66a('0xf')](_0xe66a('0xa'),auth[_0xe66a('0x8')](),controller['destroy']);module[_0xe66a('0x10')]=router; \ No newline at end of file +var _0x4189=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x4189,0xfd));var _0x9418=function(_0x4b5edd,_0x398aee){_0x4b5edd=_0x4b5edd-0x0;var _0x1b4e30=_0x4189[_0x4b5edd];return _0x1b4e30;};'use strict';var multer=require(_0x9418('0x0'));var util=require('util');var path=require(_0x9418('0x1'));var timeout=require(_0x9418('0x2'));var express=require(_0x9418('0x3'));var router=express['Router']();var fs_extra=require(_0x9418('0x4'));var auth=require(_0x9418('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9418('0x6'));var controller=require(_0x9418('0x7'));router[_0x9418('0x8')]('/',auth[_0x9418('0x9')](),controller[_0x9418('0xa')]);router['get'](_0x9418('0xb'),auth[_0x9418('0x9')](),controller[_0x9418('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9418('0xd')]);router[_0x9418('0xe')](_0x9418('0xb'),auth[_0x9418('0x9')](),controller[_0x9418('0xf')]);router[_0x9418('0x10')](_0x9418('0xb'),auth[_0x9418('0x9')](),controller['destroy']);module[_0x9418('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 43f492f..be5620e 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 _0xde46=['sequelize','DATE','STRING','INTEGER'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xde46,0x174));var _0x6de4=function(_0x4d8368,_0x2abc37){_0x4d8368=_0x4d8368-0x0;var _0x4e809d=_0xde46[_0x4d8368];return _0x4e809d;};'use strict';var Sequelize=require(_0x6de4('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x6de4('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x6de4('0x2')]},'src':{'type':Sequelize[_0x6de4('0x2')]},'dst':{'type':Sequelize[_0x6de4('0x2')]},'dcontext':{'type':Sequelize[_0x6de4('0x2')]},'channel':{'type':Sequelize[_0x6de4('0x2')]},'dstchannel':{'type':Sequelize[_0x6de4('0x2')]},'lastapp':{'type':Sequelize[_0x6de4('0x2')]},'lastdata':{'type':Sequelize[_0x6de4('0x2')]},'duration':{'type':Sequelize[_0x6de4('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6de4('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6de4('0x2')]},'amaflags':{'type':Sequelize[_0x6de4('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6de4('0x2')]},'userfield':{'type':Sequelize[_0x6de4('0x2')]},'uniqueid':{'type':Sequelize[_0x6de4('0x2')]},'linkedid':{'type':Sequelize[_0x6de4('0x2')]},'sequence':{'type':Sequelize[_0x6de4('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6de4('0x2')]},'tag':{'type':Sequelize[_0x6de4('0x2')]}}; \ No newline at end of file +var _0x180f=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x180f,0xf3));var _0xf180=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0x180f[_0x3cf5a3];return _0x39ba2d;};'use strict';var Sequelize=require(_0xf180('0x0'));module[_0xf180('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xf180('0x2')},'clid':{'type':Sequelize[_0xf180('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xf180('0x3')]},'dcontext':{'type':Sequelize[_0xf180('0x3')]},'channel':{'type':Sequelize[_0xf180('0x3')]},'dstchannel':{'type':Sequelize[_0xf180('0x3')]},'lastapp':{'type':Sequelize[_0xf180('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xf180('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf180('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf180('0x3')]},'userfield':{'type':Sequelize[_0xf180('0x3')]},'uniqueid':{'type':Sequelize[_0xf180('0x3')]},'linkedid':{'type':Sequelize[_0xf180('0x3')]},'sequence':{'type':Sequelize[_0xf180('0x3')]},'peeraccount':{'type':Sequelize[_0xf180('0x3')]},'type':{'type':Sequelize[_0xf180('0x3')]},'tag':{'type':Sequelize[_0xf180('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 66e6c2d..b7cfe74 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 _0x5ad3=['destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','Cdr','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then'];(function(_0x27aad9,_0x30cc39){var _0xc1c222=function(_0x454391){while(--_0x454391){_0x27aad9['push'](_0x27aad9['shift']());}};_0xc1c222(++_0x30cc39);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x5cdacf,_0x7c82b1){_0x5cdacf=_0x5cdacf-0x0;var _0xa68a8b=_0x5ad3[_0x5cdacf];return _0xa68a8b;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={},_0x2c82f1={},_0x481803={'count':0x0,'rows':[]};var _0x571ad6=_[_0x35ad('0x29')](db['Cdr'][_0x35ad('0x2a')],function(_0x4ccaea){return{'name':_0x4ccaea['fieldName'],'type':_0x4ccaea['type']['key']};});_0x2c82f1[_0x35ad('0x2b')]=_['map'](_0x571ad6,'name');_0x2c82f1[_0x35ad('0x2c')]=_['keys'](_0x11da54[_0x35ad('0x2c')]);_0x2c82f1['filters']=_[_0x35ad('0x2d')](_0x2c82f1['model'],_0x2c82f1[_0x35ad('0x2c')]);_0x34b8b9['attributes']=_[_0x35ad('0x2d')](_0x2c82f1[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x11da54['query'][_0x35ad('0x2e')]));_0x34b8b9[_0x35ad('0x2f')]=_0x34b8b9[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x34b8b9[_0x35ad('0x2f')]:_0x2c82f1['model'];if(!_0x11da54['query'][_0x35ad('0x31')](_0x35ad('0x32'))){_0x34b8b9[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x11da54['query'][_0x35ad('0x1d')]);_0x34b8b9[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x11da54[_0x35ad('0x2c')][_0x35ad('0x1a')]);}_0x34b8b9[_0x35ad('0x33')]=qs['sort'](_0x11da54['query'][_0x35ad('0x34')]);_0x34b8b9[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_[_0x35ad('0x37')](_0x11da54[_0x35ad('0x2c')],_0x2c82f1[_0x35ad('0x36')]),_0x571ad6);if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x34b8b9[_0x35ad('0x35')]=_['merge'](_0x34b8b9[_0x35ad('0x35')],{'$or':_['map'](_0x571ad6,function(_0x25e63e){if(_0x25e63e[_0x35ad('0x39')]!==_0x35ad('0x3a')){var _0x38d1c9={};_0x38d1c9[_0x25e63e[_0x35ad('0x27')]]={'$like':'%'+_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]+'%'};return _0x38d1c9;}})});}_0x34b8b9=_[_0x35ad('0x3b')]({},_0x34b8b9,_0x11da54[_0x35ad('0x3c')]);var _0x5dd327={'where':_0x34b8b9[_0x35ad('0x35')]};return db[_0x35ad('0x3d')][_0x35ad('0x1c')](_0x5dd327)['then'](function(_0x19d82d){_0x481803[_0x35ad('0x1c')]=_0x19d82d;if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x34b8b9[_0x35ad('0x3f')]=[{'all':!![]}];}return db[_0x35ad('0x3d')][_0x35ad('0x40')](_0x34b8b9);})[_0x35ad('0x23')](function(_0x11de09){_0x481803[_0x35ad('0x41')]=_0x11de09;return _0x481803;})[_0x35ad('0x23')](respondWithFilteredResult(_0x2f8b3,_0x34b8b9))['catch'](handleError(_0x2f8b3,null));};exports[_0x35ad('0x42')]=function(_0x4edc2b,_0x3de722){var _0x3b80c0={'raw':!![],'where':{'id':_0x4edc2b[_0x35ad('0x43')]['id']}},_0x3df623={};_0x3df623[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x3d')][_0x35ad('0x2a')]);_0x3df623[_0x35ad('0x2c')]=_['keys'](_0x4edc2b[_0x35ad('0x2c')]);_0x3df623[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],_0x3df623[_0x35ad('0x2c')]);_0x3b80c0['attributes']=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],qs['fields'](_0x4edc2b['query'][_0x35ad('0x2e')]));_0x3b80c0[_0x35ad('0x2f')]=_0x3b80c0[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x3b80c0['attributes']:_0x3df623[_0x35ad('0x2b')];if(_0x4edc2b[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x3b80c0[_0x35ad('0x3f')]=[{'all':!![]}];}_0x3b80c0=_[_0x35ad('0x3b')]({},_0x3b80c0,_0x4edc2b[_0x35ad('0x3c')]);return db[_0x35ad('0x3d')]['find'](_0x3b80c0)[_0x35ad('0x23')](handleEntityNotFound(_0x3de722,null))[_0x35ad('0x23')](respondWithResult(_0x3de722,null))[_0x35ad('0x45')](handleError(_0x3de722,null));};exports['create']=function(_0x5e3f96,_0x5644c4){return db[_0x35ad('0x3d')][_0x35ad('0x46')](_0x5e3f96[_0x35ad('0x47')],{})[_0x35ad('0x23')](respondWithResult(_0x5644c4,0xc9))['catch'](handleError(_0x5644c4,null));};exports[_0x35ad('0x22')]=function(_0x46c462,_0x3583ca){if(_0x46c462[_0x35ad('0x47')]['id']){delete _0x46c462[_0x35ad('0x47')]['id'];}return db[_0x35ad('0x3d')]['find']({'where':{'id':_0x46c462['params']['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3583ca,null))[_0x35ad('0x23')](saveUpdates(_0x46c462['body'],null))['then'](respondWithResult(_0x3583ca,null))[_0x35ad('0x45')](handleError(_0x3583ca,null));};exports[_0x35ad('0x24')]=function(_0x196ebd,_0x5c7dbd){return db['Cdr'][_0x35ad('0x48')]({'where':{'id':_0x196ebd[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x5c7dbd,null))['then'](removeEntity(_0x5c7dbd,null))[_0x35ad('0x45')](handleError(_0x5c7dbd,null));};exports[_0x35ad('0x49')]=function(_0x34061c,_0x467887){return db[_0x35ad('0x3d')][_0x35ad('0x49')]()['then'](respondWithResult(_0x467887,null))[_0x35ad('0x45')](handleError(_0x467887,null));}; \ No newline at end of file +var _0x425d=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x425d,0x1e0));var _0xd425=function(_0x32bbaa,_0x2bc8f3){_0x32bbaa=_0x32bbaa-0x0;var _0x34077b=_0x425d[_0x32bbaa];return _0x34077b;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c'));_0x24da23[_0xd425('0x36')]=_['keys'](_0x185d7e[_0xd425('0x36')]);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x24da23[_0xd425('0x35')],_0x24da23[_0xd425('0x36')]);_0x37b63c['attributes']=_[_0xd425('0x38')](_0x24da23[_0xd425('0x35')],qs['fields'](_0x185d7e['query']['fields']));_0x37b63c[_0xd425('0x39')]=_0x37b63c[_0xd425('0x39')][_0xd425('0x3a')]?_0x37b63c[_0xd425('0x39')]:_0x24da23['model'];if(!_0x185d7e[_0xd425('0x36')][_0xd425('0x3b')](_0xd425('0x3c'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e[_0xd425('0x36')][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e['query'][_0xd425('0x21')]);}_0x37b63c[_0xd425('0x3d')]=qs[_0xd425('0x3e')](_0x185d7e['query'][_0xd425('0x3e')]);_0x37b63c[_0xd425('0x3f')]=qs[_0xd425('0x37')](_[_0xd425('0x40')](_0x185d7e['query'],_0x24da23[_0xd425('0x37')]),_0x482ba6);if(_0x185d7e[_0xd425('0x36')]['filter']){_0x37b63c['where']=_['merge'](_0x37b63c[_0xd425('0x3f')],{'$or':_[_0xd425('0x2f')](_0x482ba6,function(_0x1f30c1){if(_0x1f30c1['type']!=='VIRTUAL'){var _0x58ebb1={};_0x58ebb1[_0x1f30c1[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x36')][_0xd425('0x41')]+'%'};return _0x58ebb1;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x43')]);var _0x14f3be={'where':_0x37b63c[_0xd425('0x3f')]};return db['Cdr'][_0xd425('0x24')](_0x14f3be)[_0xd425('0x2a')](function(_0x1d82ec){_0x1cac61['count']=_0x1d82ec;if(_0x185d7e[_0xd425('0x36')][_0xd425('0x44')]){_0x37b63c[_0xd425('0x45')]=[{'all':!![]}];}return db['Cdr'][_0xd425('0x46')](_0x37b63c);})[_0xd425('0x2a')](function(_0x1c5ba6){_0x1cac61[_0xd425('0x47')]=_0x1c5ba6;return _0x1cac61;})['then'](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x48')](handleError(_0x2fd17a,null));};exports[_0xd425('0x49')]=function(_0x2b1149,_0x41b25e){var _0x3f24fb={'raw':!![],'where':{'id':_0x2b1149[_0xd425('0x4a')]['id']}},_0x2f6bf7={};_0x2f6bf7['model']=_[_0xd425('0x4b')](db[_0xd425('0x30')]['rawAttributes']);_0x2f6bf7[_0xd425('0x36')]=_['keys'](_0x2b1149['query']);_0x2f6bf7[_0xd425('0x37')]=_['intersection'](_0x2f6bf7[_0xd425('0x35')],_0x2f6bf7['query']);_0x3f24fb[_0xd425('0x39')]=_[_0xd425('0x38')](_0x2f6bf7[_0xd425('0x35')],qs[_0xd425('0x4c')](_0x2b1149[_0xd425('0x36')]['fields']));_0x3f24fb[_0xd425('0x39')]=_0x3f24fb['attributes'][_0xd425('0x3a')]?_0x3f24fb['attributes']:_0x2f6bf7[_0xd425('0x35')];if(_0x2b1149[_0xd425('0x36')][_0xd425('0x44')]){_0x3f24fb[_0xd425('0x45')]=[{'all':!![]}];}_0x3f24fb=_[_0xd425('0x42')]({},_0x3f24fb,_0x2b1149['options']);return db[_0xd425('0x30')][_0xd425('0x4d')](_0x3f24fb)[_0xd425('0x2a')](handleEntityNotFound(_0x41b25e,null))[_0xd425('0x2a')](respondWithResult(_0x41b25e,null))[_0xd425('0x48')](handleError(_0x41b25e,null));};exports['create']=function(_0x440dc5,_0x177704){return db[_0xd425('0x30')][_0xd425('0x4e')](_0x440dc5[_0xd425('0x4f')],{})[_0xd425('0x2a')](respondWithResult(_0x177704,0xc9))['catch'](handleError(_0x177704,null));};exports[_0xd425('0x29')]=function(_0x128cb3,_0x5bfac6){if(_0x128cb3[_0xd425('0x4f')]['id']){delete _0x128cb3[_0xd425('0x4f')]['id'];}return db[_0xd425('0x30')][_0xd425('0x4d')]({'where':{'id':_0x128cb3['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5bfac6,null))[_0xd425('0x2a')](saveUpdates(_0x128cb3[_0xd425('0x4f')],null))[_0xd425('0x2a')](respondWithResult(_0x5bfac6,null))[_0xd425('0x48')](handleError(_0x5bfac6,null));};exports['destroy']=function(_0x4be6fa,_0x381bdb){return db['Cdr'][_0xd425('0x4d')]({'where':{'id':_0x4be6fa[_0xd425('0x4a')]['id']}})['then'](handleEntityNotFound(_0x381bdb,null))[_0xd425('0x2a')](removeEntity(_0x381bdb,null))['catch'](handleError(_0x381bdb,null));};exports['describe']=function(_0x39f588,_0x111905){return db[_0xd425('0x30')][_0xd425('0x50')]()[_0xd425('0x2a')](respondWithResult(_0x111905,null))[_0xd425('0x48')](handleError(_0x111905,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index ddf81e5..675519b 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(_0x4170ad,_0x1f0cbb){var _0x70f4ff=function(_0x788fa){while(--_0x788fa){_0x4170ad['push'](_0x4170ad['shift']());}};_0x70f4ff(++_0x1f0cbb);}(_0x7a54,0x106));var _0x47a5=function(_0x329675,_0x582af0){_0x329675=_0x329675-0x0;var _0x370349=_0x7a54[_0x329675];return _0x370349;};'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x254cca,_0x439446){var _0x4b377e=function(_0x4ed0e5){while(--_0x4ed0e5){_0x254cca['push'](_0x254cca['shift']());}};_0x4b377e(++_0x439446);}(_0x7a54,0x106));var _0x47a5=function(_0x3ce87e,_0x198bbc){_0x3ce87e=_0x3ce87e-0x0;var _0x401800=_0x7a54[_0x3ce87e];return _0x401800;};'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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 5b8db9b..00707a9 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 _0x76ed=['client','request','then','info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../mysqldb','../../config/environment'];(function(_0x2c04d9,_0x59ec65){var _0x5ad09a=function(_0x5e2ce3){while(--_0x5e2ce3){_0x2c04d9['push'](_0x2c04d9['shift']());}};_0x5ad09a(++_0x59ec65);}(_0x76ed,0xb6));var _0xd76e=function(_0x583a5e,_0x55d131){_0x583a5e=_0x583a5e-0x0;var _0x23ef19=_0x76ed[_0x583a5e];return _0x23ef19;};'use strict';var _=require(_0xd76e('0x0'));var util=require(_0xd76e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd76e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd76e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd76e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xd76e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cd30b,_0x4dccc4,_0x5126bc){return new BPromise(function(_0x50c310,_0x4168a6){return client[_0xd76e('0x6')](_0x4cd30b,_0x5126bc)[_0xd76e('0x7')](function(_0x3eb115){logger[_0xd76e('0x8')]('Cdr,\x20%s,\x20%s',_0x4dccc4,_0xd76e('0x9'));logger[_0xd76e('0xa')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4dccc4,'request\x20sent',JSON[_0xd76e('0xb')](_0x3eb115));if(_0x3eb115[_0xd76e('0xc')]){if(_0x3eb115[_0xd76e('0xc')][_0xd76e('0xd')]===0x1f4){logger[_0xd76e('0xc')](_0xd76e('0xe'),_0x4dccc4,_0x3eb115['error'][_0xd76e('0xf')]);return _0x4168a6(_0x3eb115[_0xd76e('0xc')][_0xd76e('0xf')]);}logger[_0xd76e('0xc')]('Cdr,\x20%s,\x20%s',_0x4dccc4,_0x3eb115[_0xd76e('0xc')]['message']);return _0x50c310(_0x3eb115['error'][_0xd76e('0xf')]);}else{logger[_0xd76e('0x8')](_0xd76e('0xe'),_0x4dccc4,_0xd76e('0x9'));_0x50c310(_0x3eb115['result'][_0xd76e('0xf')]);}})[_0xd76e('0x10')](function(_0x4939bc){logger[_0xd76e('0xc')](_0xd76e('0xe'),_0x4dccc4,_0x4939bc);_0x4168a6(_0x4939bc);});});} \ No newline at end of file +var _0x1a95=['catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x498ebf,_0x2b0e84){var _0x229498=function(_0x51066c){while(--_0x51066c){_0x498ebf['push'](_0x498ebf['shift']());}};_0x229498(++_0x2b0e84);}(_0x1a95,0x177));var _0x51a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1a95[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x51a9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x51a9('0x1'));var fs=require('fs');var Redis=require(_0x51a9('0x2'));var db=require(_0x51a9('0x3'))['db'];var utils=require(_0x51a9('0x4'));var logger=require(_0x51a9('0x5'))(_0x51a9('0x6'));var config=require(_0x51a9('0x7'));var jayson=require(_0x51a9('0x8'));var client=jayson[_0x51a9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4568ce,_0x4034bc,_0x148e5f){return new BPromise(function(_0x54f6e8,_0x438b7c){return client[_0x51a9('0xa')](_0x4568ce,_0x148e5f)['then'](function(_0x3c1886){logger[_0x51a9('0xb')](_0x51a9('0xc'),_0x4034bc,_0x51a9('0xd'));logger[_0x51a9('0xe')](_0x51a9('0xf'),_0x4034bc,_0x51a9('0xd'),JSON[_0x51a9('0x10')](_0x3c1886));if(_0x3c1886['error']){if(_0x3c1886[_0x51a9('0x11')][_0x51a9('0x12')]===0x1f4){logger[_0x51a9('0x11')]('Cdr,\x20%s,\x20%s',_0x4034bc,_0x3c1886['error'][_0x51a9('0x13')]);return _0x438b7c(_0x3c1886[_0x51a9('0x11')][_0x51a9('0x13')]);}logger[_0x51a9('0x11')](_0x51a9('0xc'),_0x4034bc,_0x3c1886['error'][_0x51a9('0x13')]);return _0x54f6e8(_0x3c1886[_0x51a9('0x11')][_0x51a9('0x13')]);}else{logger[_0x51a9('0xb')](_0x51a9('0xc'),_0x4034bc,_0x51a9('0xd'));_0x54f6e8(_0x3c1886[_0x51a9('0x14')]['message']);}})[_0x51a9('0x15')](function(_0x211cd1){logger[_0x51a9('0x11')](_0x51a9('0xc'),_0x4034bc,_0x211cd1);_0x438b7c(_0x211cd1);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 53db06c..f238b40 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x253dad,_0x3bfafa){var _0x6c42df=function(_0x32fd1c){while(--_0x32fd1c){_0x253dad['push'](_0x253dad['shift']());}};_0x6c42df(++_0x3bfafa);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 59a82c4..184d1c1 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 _0x20c7=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x20c7,0x18a));var _0x720c=function(_0x4abf9d,_0x2b7758){_0x4abf9d=_0x4abf9d-0x0;var _0x2e5c06=_0x20c7[_0x4abf9d];return _0x2e5c06;};'use strict';var Sequelize=require(_0x720c('0x0'));module[_0x720c('0x1')]={'priority':{'type':Sequelize[_0x720c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x720c('0x3')],'allowNull':![],'defaultValue':_0x720c('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x720c('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x720c('0x5')}}; \ No newline at end of file +var _0x20aa=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x20aa,0xe8));var _0xa20a=function(_0x34a670,_0x5b1c98){_0x34a670=_0x34a670-0x0;var _0xe8ca57=_0x20aa[_0x34a670];return _0xe8ca57;};'use strict';var Sequelize=require('sequelize');module[_0xa20a('0x0')]={'priority':{'type':Sequelize[_0xa20a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa20a('0x2')],'allowNull':![],'defaultValue':_0xa20a('0x3')},'appdata':{'type':Sequelize[_0xa20a('0x4')]()},'description':{'type':Sequelize[_0xa20a('0x2')]},'interval':{'type':Sequelize[_0xa20a('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index a4dcee6..b2b1469 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 _0xb48d=['stack','name','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','catch','body','find','params','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','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error'];(function(_0x367db8,_0xd21da0){var _0x553f0b=function(_0x4acb7c){while(--_0x4acb7c){_0x367db8['push'](_0x367db8['shift']());}};_0x553f0b(++_0xd21da0);}(_0xb48d,0x194));var _0xdb48=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xb48d[_0x4e6ae6];return _0x23c108;};'use strict';var emlformat=require(_0xdb48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb48('0x2'));var moment=require(_0xdb48('0x3'));var BPromise=require(_0xdb48('0x4'));var Mustache=require(_0xdb48('0x5'));var util=require('util');var path=require(_0xdb48('0x6'));var sox=require('sox');var csv=require(_0xdb48('0x7'));var ejs=require(_0xdb48('0x8'));var fs=require('fs');var fs_extra=require(_0xdb48('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb48('0xa'));var jsforce=require(_0xdb48('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdb48('0x7'));var querystring=require(_0xdb48('0xc'));var Papa=require('papaparse');var Redis=require(_0xdb48('0xd'));var authService=require(_0xdb48('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb48('0xf'));var logger=require(_0xdb48('0x10'))(_0xdb48('0x11'));var utils=require('../../config/utils');var config=require(_0xdb48('0x12'));var licenseUtil=require(_0xdb48('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaa4906,_0x3cbfee){_0x3cbfee=_0x3cbfee||0xcc;return function(_0x41e006){if(_0x41e006){return _0xaa4906[_0xdb48('0x14')](_0x3cbfee);}return _0xaa4906[_0xdb48('0x15')](_0x3cbfee)[_0xdb48('0x16')]();};}function respondWithResult(_0x5ebbdd,_0x43df86){_0x43df86=_0x43df86||0xc8;return function(_0x142eaf){if(_0x142eaf){return _0x5ebbdd[_0xdb48('0x15')](_0x43df86)['json'](_0x142eaf);}};}function respondWithFilteredResult(_0x28412d,_0x518dac){return function(_0x453d6b){if(_0x453d6b){var _0x3180d7=typeof _0x518dac[_0xdb48('0x17')]===_0xdb48('0x18')&&typeof _0x518dac[_0xdb48('0x19')]==='undefined';var _0x488997=_0x453d6b[_0xdb48('0x1a')];var _0x38099a=_0x3180d7?0x0:_0x518dac['offset'];var _0x3f98b0=_0x3180d7?_0x453d6b[_0xdb48('0x1a')]:_0x518dac['offset']+_0x518dac['limit'];var _0x1432a9;if(_0x3f98b0>=_0x488997){_0x3f98b0=_0x488997;_0x1432a9=0xc8;}else{_0x1432a9=0xce;}_0x28412d[_0xdb48('0x15')](_0x1432a9);return _0x28412d[_0xdb48('0x1b')]('Content-Range',_0x38099a+'-'+_0x3f98b0+'/'+_0x488997)[_0xdb48('0x1c')](_0x453d6b);}return null;};}function patchUpdates(_0x3d1b69){return function(_0x58604e){try{jsonpatch[_0xdb48('0x1d')](_0x58604e,_0x3d1b69,!![]);}catch(_0x3fb75a){return BPromise[_0xdb48('0x1e')](_0x3fb75a);}return _0x58604e[_0xdb48('0x1f')]();};}function saveUpdates(_0x3921d8,_0x5e63b3){return function(_0x2746c4){if(_0x2746c4){return _0x2746c4[_0xdb48('0x20')](_0x3921d8)[_0xdb48('0x21')](function(_0x5a33a0){return _0x5a33a0;});}return null;};}function removeEntity(_0x5aedc1,_0x52c046){return function(_0x3ad23a){if(_0x3ad23a){return _0x3ad23a[_0xdb48('0x22')]()[_0xdb48('0x21')](function(){_0x5aedc1['status'](0xcc)[_0xdb48('0x16')]();});}};}function handleEntityNotFound(_0x4d29d1,_0x3b3344){return function(_0x3a5bdd){if(!_0x3a5bdd){_0x4d29d1[_0xdb48('0x14')](0x194);}return _0x3a5bdd;};}function handleError(_0x531a2a,_0x483940){_0x483940=_0x483940||0x1f4;return function(_0x139139){logger[_0xdb48('0x23')](_0x139139[_0xdb48('0x24')]);if(_0x139139['name']){delete _0x139139[_0xdb48('0x25')];}_0x531a2a[_0xdb48('0x15')](_0x483940)['send'](_0x139139);};}exports['show']=function(_0x31edb6,_0x2cdfa4){var _0x2adb1e={'raw':!![],'where':{'id':_0x31edb6['params']['id']}},_0x2f55c6={};_0x2f55c6[_0xdb48('0x26')]=_[_0xdb48('0x27')](db[_0xdb48('0x28')]['rawAttributes']);_0x2f55c6[_0xdb48('0x29')]=_[_0xdb48('0x27')](_0x31edb6[_0xdb48('0x29')]);_0x2f55c6[_0xdb48('0x2a')]=_[_0xdb48('0x2b')](_0x2f55c6[_0xdb48('0x26')],_0x2f55c6['query']);_0x2adb1e[_0xdb48('0x2c')]=_[_0xdb48('0x2b')](_0x2f55c6[_0xdb48('0x26')],qs[_0xdb48('0x2d')](_0x31edb6[_0xdb48('0x29')][_0xdb48('0x2d')]));_0x2adb1e['attributes']=_0x2adb1e['attributes'][_0xdb48('0x2e')]?_0x2adb1e[_0xdb48('0x2c')]:_0x2f55c6[_0xdb48('0x26')];if(_0x31edb6[_0xdb48('0x29')][_0xdb48('0x2f')]){_0x2adb1e[_0xdb48('0x30')]=[{'all':!![]}];}_0x2adb1e=_[_0xdb48('0x31')]({},_0x2adb1e,_0x31edb6[_0xdb48('0x32')]);return db[_0xdb48('0x28')]['find'](_0x2adb1e)[_0xdb48('0x21')](handleEntityNotFound(_0x2cdfa4,null))[_0xdb48('0x21')](respondWithResult(_0x2cdfa4,null))[_0xdb48('0x33')](handleError(_0x2cdfa4,null));};exports[_0xdb48('0x20')]=function(_0x4cddf2,_0x4d05d0){if(_0x4cddf2[_0xdb48('0x34')]['id']){delete _0x4cddf2[_0xdb48('0x34')]['id'];}return db[_0xdb48('0x28')][_0xdb48('0x35')]({'where':{'id':_0x4cddf2[_0xdb48('0x36')]['id']}})[_0xdb48('0x21')](handleEntityNotFound(_0x4d05d0,null))[_0xdb48('0x21')](saveUpdates(_0x4cddf2[_0xdb48('0x34')],null))['then'](respondWithResult(_0x4d05d0,null))['catch'](handleError(_0x4d05d0,null));};exports[_0xdb48('0x22')]=function(_0x484cb2,_0x17e3d9){return db[_0xdb48('0x28')][_0xdb48('0x35')]({'where':{'id':_0x484cb2[_0xdb48('0x36')]['id']}})[_0xdb48('0x21')](handleEntityNotFound(_0x17e3d9,null))[_0xdb48('0x21')](removeEntity(_0x17e3d9,null))[_0xdb48('0x33')](handleError(_0x17e3d9,null));}; \ No newline at end of file +var _0x44f8=['attributes','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','show','params','model','ChatApplication','query','keys','intersection','fields'];(function(_0x281be4,_0x324ba8){var _0x43dae0=function(_0x5a63de){while(--_0x5a63de){_0x281be4['push'](_0x281be4['shift']());}};_0x43dae0(++_0x324ba8);}(_0x44f8,0x1de));var _0x844f=function(_0x464937,_0x14ce6c){_0x464937=_0x464937-0x0;var _0x44c889=_0x44f8[_0x464937];return _0x44c889;};'use strict';var emlformat=require(_0x844f('0x0'));var rimraf=require(_0x844f('0x1'));var zipdir=require(_0x844f('0x2'));var jsonpatch=require(_0x844f('0x3'));var rp=require(_0x844f('0x4'));var moment=require(_0x844f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x844f('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x844f('0x7'));var fs=require('fs');var fs_extra=require(_0x844f('0x8'));var _=require(_0x844f('0x9'));var squel=require(_0x844f('0xa'));var crypto=require(_0x844f('0xb'));var jsforce=require(_0x844f('0xc'));var deskjs=require(_0x844f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x844f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x844f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x844f('0x10'));var config=require(_0x844f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x844f('0x12'))['db'];function respondWithStatusCode(_0x110dc2,_0x2320fc){_0x2320fc=_0x2320fc||0xcc;return function(_0x5ea542){if(_0x5ea542){return _0x110dc2['sendStatus'](_0x2320fc);}return _0x110dc2[_0x844f('0x13')](_0x2320fc)['end']();};}function respondWithResult(_0x3137c1,_0x31a0d9){_0x31a0d9=_0x31a0d9||0xc8;return function(_0x449887){if(_0x449887){return _0x3137c1[_0x844f('0x13')](_0x31a0d9)[_0x844f('0x14')](_0x449887);}};}function respondWithFilteredResult(_0x486fa0,_0x5da4ab){return function(_0x1b04a9){if(_0x1b04a9){var _0x149f21=typeof _0x5da4ab[_0x844f('0x15')]===_0x844f('0x16')&&typeof _0x5da4ab['limit']===_0x844f('0x16');var _0x547881=_0x1b04a9['count'];var _0x1f96d0=_0x149f21?0x0:_0x5da4ab[_0x844f('0x15')];var _0x5cc55c=_0x149f21?_0x1b04a9[_0x844f('0x17')]:_0x5da4ab['offset']+_0x5da4ab['limit'];var _0x31431e;if(_0x5cc55c>=_0x547881){_0x5cc55c=_0x547881;_0x31431e=0xc8;}else{_0x31431e=0xce;}_0x486fa0['status'](_0x31431e);return _0x486fa0[_0x844f('0x18')](_0x844f('0x19'),_0x1f96d0+'-'+_0x5cc55c+'/'+_0x547881)[_0x844f('0x14')](_0x1b04a9);}return null;};}function patchUpdates(_0x38e732){return function(_0x3f5060){try{jsonpatch['apply'](_0x3f5060,_0x38e732,!![]);}catch(_0x270be6){return BPromise['reject'](_0x270be6);}return _0x3f5060['save']();};}function saveUpdates(_0x3f83cd,_0x4261b6){return function(_0x1b2037){if(_0x1b2037){return _0x1b2037[_0x844f('0x1a')](_0x3f83cd)[_0x844f('0x1b')](function(_0x523f49){return _0x523f49;});}return null;};}function removeEntity(_0x189523,_0x4bd66d){return function(_0x22c055){if(_0x22c055){return _0x22c055['destroy']()[_0x844f('0x1b')](function(){_0x189523[_0x844f('0x13')](0xcc)[_0x844f('0x1c')]();});}};}function handleEntityNotFound(_0x7dc0c9,_0x46bf96){return function(_0x1e66c0){if(!_0x1e66c0){_0x7dc0c9[_0x844f('0x1d')](0x194);}return _0x1e66c0;};}function handleError(_0x5c9892,_0xba1365){_0xba1365=_0xba1365||0x1f4;return function(_0x16d7ad){logger[_0x844f('0x1e')](_0x16d7ad[_0x844f('0x1f')]);if(_0x16d7ad[_0x844f('0x20')]){delete _0x16d7ad[_0x844f('0x20')];}_0x5c9892['status'](_0xba1365)[_0x844f('0x21')](_0x16d7ad);};}exports[_0x844f('0x22')]=function(_0x3f62f1,_0x4d3abd){var _0x520102={'raw':!![],'where':{'id':_0x3f62f1[_0x844f('0x23')]['id']}},_0x1e243c={};_0x1e243c[_0x844f('0x24')]=_['keys'](db[_0x844f('0x25')]['rawAttributes']);_0x1e243c[_0x844f('0x26')]=_[_0x844f('0x27')](_0x3f62f1['query']);_0x1e243c['filters']=_[_0x844f('0x28')](_0x1e243c[_0x844f('0x24')],_0x1e243c['query']);_0x520102['attributes']=_[_0x844f('0x28')](_0x1e243c[_0x844f('0x24')],qs[_0x844f('0x29')](_0x3f62f1['query'][_0x844f('0x29')]));_0x520102[_0x844f('0x2a')]=_0x520102[_0x844f('0x2a')][_0x844f('0x2b')]?_0x520102['attributes']:_0x1e243c[_0x844f('0x24')];if(_0x3f62f1[_0x844f('0x26')][_0x844f('0x2c')]){_0x520102[_0x844f('0x2d')]=[{'all':!![]}];}_0x520102=_[_0x844f('0x2e')]({},_0x520102,_0x3f62f1[_0x844f('0x2f')]);return db[_0x844f('0x25')][_0x844f('0x30')](_0x520102)['then'](handleEntityNotFound(_0x4d3abd,null))[_0x844f('0x1b')](respondWithResult(_0x4d3abd,null))['catch'](handleError(_0x4d3abd,null));};exports[_0x844f('0x1a')]=function(_0x1e1213,_0x175071){if(_0x1e1213[_0x844f('0x31')]['id']){delete _0x1e1213['body']['id'];}return db[_0x844f('0x25')][_0x844f('0x30')]({'where':{'id':_0x1e1213['params']['id']}})[_0x844f('0x1b')](handleEntityNotFound(_0x175071,null))[_0x844f('0x1b')](saveUpdates(_0x1e1213[_0x844f('0x31')],null))[_0x844f('0x1b')](respondWithResult(_0x175071,null))[_0x844f('0x32')](handleError(_0x175071,null));};exports[_0x844f('0x33')]=function(_0x5900ab,_0x3592d9){return db['ChatApplication']['find']({'where':{'id':_0x5900ab[_0x844f('0x23')]['id']}})['then'](handleEntityNotFound(_0x3592d9,null))[_0x844f('0x1b')](removeEntity(_0x3592d9,null))[_0x844f('0x32')](handleError(_0x3592d9,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index bb8c867..512bf98 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 _0x1978=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x37158c,_0x2e978c){var _0x201e77=function(_0x2aae20){while(--_0x2aae20){_0x37158c['push'](_0x37158c['shift']());}};_0x201e77(++_0x2e978c);}(_0x1978,0x174));var _0x8197=function(_0x44e52d,_0x355690){_0x44e52d=_0x44e52d-0x0;var _0x4fe42a=_0x1978[_0x44e52d];return _0x4fe42a;};'use strict';var _=require('lodash');var util=require(_0x8197('0x0'));var logger=require(_0x8197('0x1'))(_0x8197('0x2'));var moment=require(_0x8197('0x3'));var BPromise=require(_0x8197('0x4'));var rp=require(_0x8197('0x5'));var fs=require('fs');var path=require(_0x8197('0x6'));var rimraf=require(_0x8197('0x7'));var config=require(_0x8197('0x8'));var attributes=require(_0x8197('0x9'));module['exports']=function(_0x215d3c,_0x1556ad){return _0x215d3c[_0x8197('0xa')](_0x8197('0xb'),attributes,{'tableName':_0x8197('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8197('0xd'),'collate':_0x8197('0xe')});}; \ No newline at end of file +var _0x91d9=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x48564d,_0x2c1c8c){var _0x2ad779=function(_0x4490dd){while(--_0x4490dd){_0x48564d['push'](_0x48564d['shift']());}};_0x2ad779(++_0x2c1c8c);}(_0x91d9,0xe0));var _0x991d=function(_0x26de7c,_0x50d74e){_0x26de7c=_0x26de7c-0x0;var _0x29d55b=_0x91d9[_0x26de7c];return _0x29d55b;};'use strict';var _=require('lodash');var util=require(_0x991d('0x0'));var logger=require(_0x991d('0x1'))(_0x991d('0x2'));var moment=require(_0x991d('0x3'));var BPromise=require(_0x991d('0x4'));var rp=require(_0x991d('0x5'));var fs=require('fs');var path=require(_0x991d('0x6'));var rimraf=require('rimraf');var config=require(_0x991d('0x7'));var attributes=require(_0x991d('0x8'));module[_0x991d('0x9')]=function(_0x97de63,_0x5d4715){return _0x97de63[_0x991d('0xa')](_0x991d('0xb'),attributes,{'tableName':_0x991d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x991d('0xd'),'collate':_0x991d('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 0a96b39..d1eba2c 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 _0x3994=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x200604,_0x48466b){var _0x316602=function(_0xd6a712){while(--_0xd6a712){_0x200604['push'](_0x200604['shift']());}};_0x316602(++_0x48466b);}(_0x3994,0x7f));var _0x4399=function(_0x56afd9,_0x573845){_0x56afd9=_0x56afd9-0x0;var _0x443781=_0x3994[_0x56afd9];return _0x443781;};'use strict';var _=require(_0x4399('0x0'));var util=require(_0x4399('0x1'));var moment=require(_0x4399('0x2'));var BPromise=require(_0x4399('0x3'));var rs=require(_0x4399('0x4'));var fs=require('fs');var Redis=require(_0x4399('0x5'));var db=require(_0x4399('0x6'))['db'];var utils=require(_0x4399('0x7'));var logger=require(_0x4399('0x8'))(_0x4399('0x9'));var config=require(_0x4399('0xa'));var jayson=require(_0x4399('0xb'));var client=jayson[_0x4399('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59604f,_0x5d4b4d,_0x551f96){return new BPromise(function(_0x4c35ba,_0x2d9fd5){return client[_0x4399('0xd')](_0x59604f,_0x551f96)[_0x4399('0xe')](function(_0x46dbaf){logger[_0x4399('0xf')](_0x4399('0x10'),_0x5d4b4d,_0x4399('0x11'));logger['debug'](_0x4399('0x12'),_0x5d4b4d,_0x4399('0x11'),JSON[_0x4399('0x13')](_0x46dbaf));if(_0x46dbaf[_0x4399('0x14')]){if(_0x46dbaf[_0x4399('0x14')][_0x4399('0x15')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5d4b4d,_0x46dbaf['error'][_0x4399('0x16')]);return _0x2d9fd5(_0x46dbaf[_0x4399('0x14')][_0x4399('0x16')]);}logger[_0x4399('0x14')](_0x4399('0x10'),_0x5d4b4d,_0x46dbaf[_0x4399('0x14')][_0x4399('0x16')]);return _0x4c35ba(_0x46dbaf[_0x4399('0x14')][_0x4399('0x16')]);}else{logger[_0x4399('0xf')](_0x4399('0x10'),_0x5d4b4d,_0x4399('0x11'));_0x4c35ba(_0x46dbaf[_0x4399('0x17')][_0x4399('0x16')]);}})[_0x4399('0x18')](function(_0x8efe5c){logger[_0x4399('0x14')](_0x4399('0x10'),_0x5d4b4d,_0x8efe5c);_0x2d9fd5(_0x8efe5c);});});} \ No newline at end of file +var _0xbd8e=['stringify','error','message','request\x20sent','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x397bfb,_0x589665){var _0x16c9b9=function(_0x13ce8a){while(--_0x13ce8a){_0x397bfb['push'](_0x397bfb['shift']());}};_0x16c9b9(++_0x589665);}(_0xbd8e,0x122));var _0xebd8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbd8e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xebd8('0x0'));var util=require('util');var moment=require(_0xebd8('0x1'));var BPromise=require(_0xebd8('0x2'));var rs=require(_0xebd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebd8('0x4'))['db'];var utils=require(_0xebd8('0x5'));var logger=require(_0xebd8('0x6'))('rpc');var config=require(_0xebd8('0x7'));var jayson=require(_0xebd8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9893,_0x1c3d27,_0x47b0b6){return new BPromise(function(_0x365dfd,_0x2b8300){return client[_0xebd8('0x9')](_0x1b9893,_0x47b0b6)[_0xebd8('0xa')](function(_0x20d1cc){logger[_0xebd8('0xb')](_0xebd8('0xc'),_0x1c3d27,'request\x20sent');logger['debug'](_0xebd8('0xd'),_0x1c3d27,'request\x20sent',JSON[_0xebd8('0xe')](_0x20d1cc));if(_0x20d1cc[_0xebd8('0xf')]){if(_0x20d1cc[_0xebd8('0xf')]['code']===0x1f4){logger[_0xebd8('0xf')](_0xebd8('0xc'),_0x1c3d27,_0x20d1cc[_0xebd8('0xf')]['message']);return _0x2b8300(_0x20d1cc[_0xebd8('0xf')][_0xebd8('0x10')]);}logger[_0xebd8('0xf')](_0xebd8('0xc'),_0x1c3d27,_0x20d1cc[_0xebd8('0xf')]['message']);return _0x365dfd(_0x20d1cc[_0xebd8('0xf')][_0xebd8('0x10')]);}else{logger[_0xebd8('0xb')](_0xebd8('0xc'),_0x1c3d27,_0xebd8('0x11'));_0x365dfd(_0x20d1cc[_0xebd8('0x12')]['message']);}})['catch'](function(_0x5d13cf){logger[_0xebd8('0xf')](_0xebd8('0xc'),_0x1c3d27,_0x5d13cf);_0x2b8300(_0x5d13cf);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 1d21e90..ccf6535 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 _0xa6f3=['get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./chatApplication.controller'];(function(_0x52dfa9,_0x306d3f){var _0xdfaa57=function(_0x9991c6){while(--_0x9991c6){_0x52dfa9['push'](_0x52dfa9['shift']());}};_0xdfaa57(++_0x306d3f);}(_0xa6f3,0xe9));var _0x3a6f=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0xa6f3[_0x5ac1e5];return _0x1bccc6;};'use strict';var multer=require(_0x3a6f('0x0'));var util=require(_0x3a6f('0x1'));var path=require(_0x3a6f('0x2'));var timeout=require(_0x3a6f('0x3'));var express=require('express');var router=express[_0x3a6f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a6f('0x5'));var controller=require(_0x3a6f('0x6'));router[_0x3a6f('0x7')](_0x3a6f('0x8'),auth[_0x3a6f('0x9')](),controller['show']);router[_0x3a6f('0xa')](_0x3a6f('0x8'),auth[_0x3a6f('0x9')](),controller[_0x3a6f('0xb')]);router[_0x3a6f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x3a6f('0xd')]);module[_0x3a6f('0xe')]=router; \ No newline at end of file +var _0x8dd7=['./chatApplication.controller','show','put','isAuthenticated','update','/:id','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x11dcf0,_0x4eb137){var _0x4f9831=function(_0x2d278e){while(--_0x2d278e){_0x11dcf0['push'](_0x11dcf0['shift']());}};_0x4f9831(++_0x4eb137);}(_0x8dd7,0x16e));var _0x78dd=function(_0x10fad9,_0x310fda){_0x10fad9=_0x10fad9-0x0;var _0x221098=_0x8dd7[_0x10fad9];return _0x221098;};'use strict';var multer=require(_0x78dd('0x0'));var util=require(_0x78dd('0x1'));var path=require(_0x78dd('0x2'));var timeout=require(_0x78dd('0x3'));var express=require(_0x78dd('0x4'));var router=express[_0x78dd('0x5')]();var fs_extra=require(_0x78dd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x78dd('0x7'));var config=require(_0x78dd('0x8'));var controller=require(_0x78dd('0x9'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x78dd('0xa')]);router[_0x78dd('0xb')]('/:id',auth[_0x78dd('0xc')](),controller[_0x78dd('0xd')]);router['delete'](_0x78dd('0xe'),auth[_0x78dd('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 132306c..7c1af41 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 _0x7510=['BOOLEAN','exports','STRING'];(function(_0xcee3bc,_0x48eebc){var _0x231ad3=function(_0x2b224){while(--_0x2b224){_0xcee3bc['push'](_0xcee3bc['shift']());}};_0x231ad3(++_0x48eebc);}(_0x7510,0xa9));var _0x0751=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7510[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0751('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0751('0x1')]},'write':{'type':Sequelize[_0x0751('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x71a1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0x71a1,0x1eb));var _0x171a=function(_0x3652dc,_0x6193ee){_0x3652dc=_0x3652dc-0x0;var _0x4aabe1=_0x71a1[_0x3652dc];return _0x4aabe1;};'use strict';var Sequelize=require(_0x171a('0x0'));module[_0x171a('0x1')]={'name':{'type':Sequelize[_0x171a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x171a('0x2')]},'write':{'type':Sequelize[_0x171a('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 f63f3d3..b074676 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 _0x756b=['rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','options','nolimit','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','end','stack','name','send','index','map','ChatGroup'];(function(_0xf19da5,_0x2c2268){var _0x2eafe4=function(_0x220f25){while(--_0x220f25){_0xf19da5['push'](_0xf19da5['shift']());}};_0x2eafe4(++_0x2c2268);}(_0x756b,0x1a1));var _0xb756=function(_0x293b51,_0x1579d1){_0x293b51=_0x293b51-0x0;var _0x4cebfb=_0x756b[_0x293b51];return _0x4cebfb;};'use strict';var emlformat=require(_0xb756('0x0'));var rimraf=require(_0xb756('0x1'));var zipdir=require(_0xb756('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb756('0x3'));var moment=require(_0xb756('0x4'));var BPromise=require(_0xb756('0x5'));var Mustache=require(_0xb756('0x6'));var util=require(_0xb756('0x7'));var path=require(_0xb756('0x8'));var sox=require('sox');var csv=require(_0xb756('0x9'));var ejs=require(_0xb756('0xa'));var fs=require('fs');var fs_extra=require(_0xb756('0xb'));var _=require(_0xb756('0xc'));var squel=require(_0xb756('0xd'));var crypto=require('crypto');var jsforce=require(_0xb756('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb756('0xf'));var Papa=require(_0xb756('0x10'));var Redis=require(_0xb756('0x11'));var authService=require(_0xb756('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb756('0x13'));var hardwareService=require(_0xb756('0x14'));var logger=require(_0xb756('0x15'))('api');var utils=require(_0xb756('0x16'));var config=require(_0xb756('0x17'));var licenseUtil=require(_0xb756('0x18'));var db=require('../../mysqldb')['db'];config[_0xb756('0x19')]=_['defaults'](config[_0xb756('0x19')],{'host':_0xb756('0x1a'),'port':0x18eb});var socket=require(_0xb756('0x1b'))(new Redis(config['redis']));require(_0xb756('0x1c'))['register'](socket);function respondWithStatusCode(_0xa9d552,_0x218768){_0x218768=_0x218768||0xcc;return function(_0x308064){if(_0x308064){return _0xa9d552[_0xb756('0x1d')](_0x218768);}return _0xa9d552[_0xb756('0x1e')](_0x218768)['end']();};}function respondWithResult(_0x40634e,_0x329549){_0x329549=_0x329549||0xc8;return function(_0x4fe513){if(_0x4fe513){return _0x40634e['status'](_0x329549)[_0xb756('0x1f')](_0x4fe513);}};}function respondWithFilteredResult(_0x138306,_0xa263fe){return function(_0x57666e){if(_0x57666e){var _0x5ac721=typeof _0xa263fe[_0xb756('0x20')]===_0xb756('0x21')&&typeof _0xa263fe[_0xb756('0x22')]===_0xb756('0x21');var _0x187164=_0x57666e[_0xb756('0x23')];var _0xf7a3=_0x5ac721?0x0:_0xa263fe['offset'];var _0x22c9a5=_0x5ac721?_0x57666e[_0xb756('0x23')]:_0xa263fe[_0xb756('0x20')]+_0xa263fe['limit'];var _0x44fc5a;if(_0x22c9a5>=_0x187164){_0x22c9a5=_0x187164;_0x44fc5a=0xc8;}else{_0x44fc5a=0xce;}_0x138306[_0xb756('0x1e')](_0x44fc5a);return _0x138306[_0xb756('0x24')](_0xb756('0x25'),_0xf7a3+'-'+_0x22c9a5+'/'+_0x187164)['json'](_0x57666e);}return null;};}function patchUpdates(_0x3e5df4){return function(_0x4f7d1e){try{jsonpatch['apply'](_0x4f7d1e,_0x3e5df4,!![]);}catch(_0x264188){return BPromise[_0xb756('0x26')](_0x264188);}return _0x4f7d1e['save']();};}function saveUpdates(_0x634422,_0x28bb1c){return function(_0x55978e){if(_0x55978e){return _0x55978e['update'](_0x634422)[_0xb756('0x27')](function(_0x24d7b7){return _0x24d7b7;});}return null;};}function removeEntity(_0x2bfa78,_0x4c3bc2){return function(_0x8ffe68){if(_0x8ffe68){return _0x8ffe68[_0xb756('0x28')]()['then'](function(){_0x2bfa78[_0xb756('0x1e')](0xcc)[_0xb756('0x29')]();});}};}function handleEntityNotFound(_0xd8fde9,_0xc22fc3){return function(_0x2ce96f){if(!_0x2ce96f){_0xd8fde9[_0xb756('0x1d')](0x194);}return _0x2ce96f;};}function handleError(_0x6a5bc6,_0xad1905){_0xad1905=_0xad1905||0x1f4;return function(_0x36998d){logger['error'](_0x36998d[_0xb756('0x2a')]);if(_0x36998d[_0xb756('0x2b')]){delete _0x36998d[_0xb756('0x2b')];}_0x6a5bc6[_0xb756('0x1e')](_0xad1905)[_0xb756('0x2c')](_0x36998d);};}exports[_0xb756('0x2d')]=function(_0x130271,_0x47dff1){var _0x3a37c8={},_0x1b75c8={},_0x395aed={'count':0x0,'rows':[]};var _0x111426=_[_0xb756('0x2e')](db[_0xb756('0x2f')][_0xb756('0x30')],function(_0x2ba25b){return{'name':_0x2ba25b[_0xb756('0x31')],'type':_0x2ba25b['type']['key']};});_0x1b75c8[_0xb756('0x32')]=_[_0xb756('0x2e')](_0x111426,_0xb756('0x2b'));_0x1b75c8[_0xb756('0x33')]=_[_0xb756('0x34')](_0x130271[_0xb756('0x33')]);_0x1b75c8[_0xb756('0x35')]=_['intersection'](_0x1b75c8['model'],_0x1b75c8['query']);_0x3a37c8['attributes']=_[_0xb756('0x36')](_0x1b75c8[_0xb756('0x32')],qs[_0xb756('0x37')](_0x130271[_0xb756('0x33')][_0xb756('0x37')]));_0x3a37c8[_0xb756('0x38')]=_0x3a37c8['attributes'][_0xb756('0x39')]?_0x3a37c8['attributes']:_0x1b75c8['model'];if(!_0x130271[_0xb756('0x33')][_0xb756('0x3a')]('nolimit')){_0x3a37c8[_0xb756('0x22')]=qs[_0xb756('0x22')](_0x130271[_0xb756('0x33')][_0xb756('0x22')]);_0x3a37c8[_0xb756('0x20')]=qs[_0xb756('0x20')](_0x130271['query']['offset']);}_0x3a37c8[_0xb756('0x3b')]=qs['sort'](_0x130271[_0xb756('0x33')][_0xb756('0x3c')]);_0x3a37c8[_0xb756('0x3d')]=qs[_0xb756('0x35')](_[_0xb756('0x3e')](_0x130271[_0xb756('0x33')],_0x1b75c8[_0xb756('0x35')]),_0x111426);if(_0x130271['query'][_0xb756('0x3f')]){_0x3a37c8[_0xb756('0x3d')]=_[_0xb756('0x40')](_0x3a37c8[_0xb756('0x3d')],{'$or':_['map'](_0x111426,function(_0x1b01f8){if(_0x1b01f8[_0xb756('0x41')]!==_0xb756('0x42')){var _0x227423={};_0x227423[_0x1b01f8[_0xb756('0x2b')]]={'$like':'%'+_0x130271[_0xb756('0x33')][_0xb756('0x3f')]+'%'};return _0x227423;}})});}_0x3a37c8=_['merge']({},_0x3a37c8,_0x130271['options']);var _0xf1bf39={'where':_0x3a37c8['where']};return db[_0xb756('0x2f')][_0xb756('0x23')](_0xf1bf39)[_0xb756('0x27')](function(_0x199a64){_0x395aed[_0xb756('0x23')]=_0x199a64;if(_0x130271['query'][_0xb756('0x43')]){_0x3a37c8[_0xb756('0x44')]=[{'all':!![]}];}return db[_0xb756('0x2f')]['findAll'](_0x3a37c8);})[_0xb756('0x27')](function(_0x26555e){_0x395aed[_0xb756('0x45')]=_0x26555e;return _0x395aed;})[_0xb756('0x27')](respondWithFilteredResult(_0x47dff1,_0x3a37c8))[_0xb756('0x46')](handleError(_0x47dff1,null));};exports[_0xb756('0x47')]=function(_0x2df60b,_0xb47dd1){var _0x59f7ec={'raw':!![],'where':{'id':_0x2df60b[_0xb756('0x48')]['id']}},_0x3ae574={};_0x3ae574[_0xb756('0x32')]=_[_0xb756('0x34')](db[_0xb756('0x2f')]['rawAttributes']);_0x3ae574[_0xb756('0x33')]=_[_0xb756('0x34')](_0x2df60b[_0xb756('0x33')]);_0x3ae574[_0xb756('0x35')]=_[_0xb756('0x36')](_0x3ae574[_0xb756('0x32')],_0x3ae574[_0xb756('0x33')]);_0x59f7ec[_0xb756('0x38')]=_['intersection'](_0x3ae574[_0xb756('0x32')],qs[_0xb756('0x37')](_0x2df60b[_0xb756('0x33')][_0xb756('0x37')]));_0x59f7ec[_0xb756('0x38')]=_0x59f7ec['attributes']['length']?_0x59f7ec[_0xb756('0x38')]:_0x3ae574[_0xb756('0x32')];if(_0x2df60b[_0xb756('0x33')]['includeAll']){_0x59f7ec[_0xb756('0x44')]=[{'all':!![]}];}_0x59f7ec=_[_0xb756('0x40')]({},_0x59f7ec,_0x2df60b['options']);return db[_0xb756('0x2f')]['find'](_0x59f7ec)[_0xb756('0x27')](handleEntityNotFound(_0xb47dd1,null))[_0xb756('0x27')](respondWithResult(_0xb47dd1,null))[_0xb756('0x46')](handleError(_0xb47dd1,null));};exports[_0xb756('0x49')]=function(_0x1dd7ef,_0x434ac9){return db['ChatGroup']['create'](_0x1dd7ef['body'],{})[_0xb756('0x27')](respondWithResult(_0x434ac9,0xc9))[_0xb756('0x46')](handleError(_0x434ac9,null));};exports['update']=function(_0x4dc996,_0x19dce3){if(_0x4dc996[_0xb756('0x4a')]['id']){delete _0x4dc996[_0xb756('0x4a')]['id'];}return db[_0xb756('0x2f')][_0xb756('0x4b')]({'where':{'id':_0x4dc996[_0xb756('0x48')]['id']}})['then'](handleEntityNotFound(_0x19dce3,null))[_0xb756('0x27')](saveUpdates(_0x4dc996['body'],null))[_0xb756('0x27')](respondWithResult(_0x19dce3,null))[_0xb756('0x46')](handleError(_0x19dce3,null));};exports[_0xb756('0x28')]=function(_0xe28d36,_0x582061){return db[_0xb756('0x2f')][_0xb756('0x4b')]({'where':{'id':_0xe28d36['params']['id']}})['then'](handleEntityNotFound(_0x582061,null))['then'](removeEntity(_0x582061,null))[_0xb756('0x46')](handleError(_0x582061,null));};exports[_0xb756('0x4c')]=function(_0x5f3579,_0x782234){return db[_0xb756('0x2f')]['describe']()[_0xb756('0x27')](respondWithResult(_0x782234,null))[_0xb756('0x46')](handleError(_0x782234,null));};exports['getUnread']=function(_0x44b7ae,_0x59fad0,_0x44e266){return db[_0xb756('0x4d')][_0xb756('0x23')]({'where':{'ChatGroupId':_0x44b7ae[_0xb756('0x48')]['id'],'ToId':_0x44b7ae[_0xb756('0x4e')]['id'],'read':![]}})[_0xb756('0x27')](function(_0x399a0c){return{'id':_[_0xb756('0x4f')](_0x44b7ae[_0xb756('0x48')]['id']),'count':_0x399a0c};})[_0xb756('0x27')](respondWithResult(_0x59fad0,null))[_0xb756('0x46')](handleError(_0x59fad0,null));};exports[_0xb756('0x50')]=function(_0x4cddd7,_0x269c56,_0x4d9220){return db[_0xb756('0x2f')]['find']({'where':{'id':_0x4cddd7[_0xb756('0x48')]['id']}})['then'](handleEntityNotFound(_0x269c56,null))[_0xb756('0x27')](function(_0x4b202d){if(_0x4b202d){return _0x4b202d[_0xb756('0x50')](_0x4cddd7[_0xb756('0x4a')][_0xb756('0x51')],_[_0xb756('0x52')](_0x4cddd7[_0xb756('0x4a')],[_0xb756('0x51'),'id'])||{});}})['then'](respondWithResult(_0x269c56,null))[_0xb756('0x46')](handleError(_0x269c56,null));};exports[_0xb756('0x53')]=function(_0x49742e,_0x5e987c,_0x3ee036){var _0x2fc756={};var _0x14489c={};var _0x486bb6;var _0x57c8dd;return db[_0xb756('0x2f')]['findOne']({'where':{'id':_0x49742e[_0xb756('0x48')]['id']}})[_0xb756('0x27')](handleEntityNotFound(_0x5e987c,null))['then'](function(_0x204d5c){if(_0x204d5c){_0x486bb6=_0x204d5c;_0x14489c[_0xb756('0x32')]=_[_0xb756('0x34')](db['User'][_0xb756('0x30')]);_0x14489c[_0xb756('0x33')]=_[_0xb756('0x34')](_0x49742e['query']);_0x14489c[_0xb756('0x35')]=_['intersection'](_0x14489c[_0xb756('0x32')],_0x14489c[_0xb756('0x33')]);_0x2fc756['attributes']=_[_0xb756('0x36')](_0x14489c['model'],qs[_0xb756('0x37')](_0x49742e['query'][_0xb756('0x37')]));_0x2fc756[_0xb756('0x38')]=_0x2fc756['attributes'][_0xb756('0x39')]?_0x2fc756[_0xb756('0x38')]:_0x14489c[_0xb756('0x32')];_0x2fc756[_0xb756('0x3b')]=qs[_0xb756('0x3c')](_0x49742e['query'][_0xb756('0x3c')]);_0x2fc756['where']=qs[_0xb756('0x35')](_[_0xb756('0x3e')](_0x49742e[_0xb756('0x33')],_0x14489c[_0xb756('0x35')]));if(_0x49742e['query'][_0xb756('0x3f')]){_0x2fc756[_0xb756('0x3d')]=_[_0xb756('0x40')](_0x2fc756[_0xb756('0x3d')],{'$or':_[_0xb756('0x2e')](_0x2fc756[_0xb756('0x38')],function(_0x36515){var _0x29a065={};_0x29a065[_0x36515]={'$like':'%'+_0x49742e[_0xb756('0x33')][_0xb756('0x3f')]+'%'};return _0x29a065;})});}_0x2fc756=_['merge']({},_0x2fc756,_0x49742e[_0xb756('0x54')]);return _0x486bb6[_0xb756('0x53')](_0x2fc756);}})[_0xb756('0x27')](function(_0x1151f6){if(_0x1151f6){_0x57c8dd=_0x1151f6[_0xb756('0x39')];if(!_0x49742e[_0xb756('0x33')]['hasOwnProperty'](_0xb756('0x55'))){_0x2fc756[_0xb756('0x22')]=qs[_0xb756('0x22')](_0x49742e['query'][_0xb756('0x22')]);_0x2fc756[_0xb756('0x20')]=qs[_0xb756('0x20')](_0x49742e['query'][_0xb756('0x20')]);}return _0x486bb6[_0xb756('0x53')](_0x2fc756);}})[_0xb756('0x27')](function(_0x40687b){if(_0x40687b){return _0x40687b?{'count':_0x57c8dd,'rows':_0x40687b}:null;}})[_0xb756('0x27')](respondWithResult(_0x5e987c,null))[_0xb756('0x46')](handleError(_0x5e987c,null));};exports['removeMembers']=function(_0x1b877e,_0x1c0ccd,_0x1f96cc){return db[_0xb756('0x2f')]['find']({'where':{'id':_0x1b877e[_0xb756('0x48')]['id']}})[_0xb756('0x27')](handleEntityNotFound(_0x1c0ccd,null))[_0xb756('0x27')](function(_0x1c0434){if(_0x1c0434){return _0x1c0434['removeMembers'](_0x1b877e[_0xb756('0x33')][_0xb756('0x51')]);}})[_0xb756('0x27')](respondWithStatusCode(_0x1c0ccd,null))[_0xb756('0x46')](handleError(_0x1c0ccd,null));};exports[_0xb756('0x56')]=function(_0x1b3801,_0x1ea9a7,_0x2602a9){if(_0x1b3801[_0xb756('0x4a')]['id']){delete _0x1b3801[_0xb756('0x4a')]['id'];}return db[_0xb756('0x2f')][_0xb756('0x4b')]({'where':{'id':_0x1b3801['params']['id']}})[_0xb756('0x27')](handleEntityNotFound(_0x1ea9a7,null))[_0xb756('0x27')](function(_0x38f475){if(_0x38f475){_0x1b3801[_0xb756('0x4a')][_0xb756('0x57')]=_0x38f475['id'];return db[_0xb756('0x4d')][_0xb756('0x49')](_0x1b3801['body']);}})[_0xb756('0x27')](respondWithResult(_0x1ea9a7,null))[_0xb756('0x46')](handleError(_0x1ea9a7,null));};exports['getMessages']=function(_0x57c407,_0x2a52a2,_0x4f4d41){var _0x4c299f={};var _0x4e67ad={};var _0x354411;var _0x4afea6;return db[_0xb756('0x2f')]['findOne']({'where':{'id':_0x57c407[_0xb756('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a52a2,null))[_0xb756('0x27')](function(_0xba318a){if(_0xba318a){_0x354411=_0xba318a;_0x4e67ad['model']=_[_0xb756('0x34')](db[_0xb756('0x4d')][_0xb756('0x30')]);_0x4e67ad[_0xb756('0x33')]=_[_0xb756('0x34')](_0x57c407['query']);_0x4e67ad[_0xb756('0x35')]=_[_0xb756('0x36')](_0x4e67ad[_0xb756('0x32')],_0x4e67ad['query']);_0x4c299f[_0xb756('0x38')]=_['intersection'](_0x4e67ad[_0xb756('0x32')],qs[_0xb756('0x37')](_0x57c407[_0xb756('0x33')]['fields']));_0x4c299f['attributes']=_0x4c299f[_0xb756('0x38')][_0xb756('0x39')]?_0x4c299f[_0xb756('0x38')]:_0x4e67ad[_0xb756('0x32')];_0x4c299f['order']=qs['sort'](_0x57c407[_0xb756('0x33')][_0xb756('0x3c')]);_0x4c299f[_0xb756('0x3d')]=qs[_0xb756('0x35')](_[_0xb756('0x3e')](_0x57c407[_0xb756('0x33')],_0x4e67ad['filters']));if(_0x57c407[_0xb756('0x33')][_0xb756('0x3f')]){_0x4c299f[_0xb756('0x3d')]=_[_0xb756('0x40')](_0x4c299f[_0xb756('0x3d')],{'$or':_[_0xb756('0x2e')](_0x4c299f[_0xb756('0x38')],function(_0x49ca2b){var _0xafb7ed={};_0xafb7ed[_0x49ca2b]={'$like':'%'+_0x57c407[_0xb756('0x33')][_0xb756('0x3f')]+'%'};return _0xafb7ed;})});}if(_0x57c407['query'][_0xb756('0x58')]){var _0x22e9b5=_0x57c407[_0xb756('0x33')][_0xb756('0x58')][_0xb756('0x59')](',');var _0x58fe57={};_0x58fe57[_0x22e9b5[0x0]]={'$gte':moment(_0x22e9b5[0x1])[_0xb756('0x5a')](_0xb756('0x5b'))};_0x4c299f[_0xb756('0x3d')]=_[_0xb756('0x40')](_0x4c299f[_0xb756('0x3d')],_0x58fe57);}_0x4c299f=_[_0xb756('0x40')]({},_0x4c299f,_0x57c407[_0xb756('0x54')]);return _0x354411[_0xb756('0x5c')](_0x4c299f);}})[_0xb756('0x27')](function(_0x206883){if(_0x206883){_0x4afea6=_0x206883[_0xb756('0x39')];if(!_0x57c407[_0xb756('0x33')][_0xb756('0x3a')](_0xb756('0x55'))){_0x4c299f[_0xb756('0x22')]=qs['limit'](_0x57c407[_0xb756('0x33')]['limit']);_0x4c299f[_0xb756('0x20')]=qs[_0xb756('0x20')](_0x57c407['query'][_0xb756('0x20')]);}return _0x354411['getMessages'](_0x4c299f);}})['then'](function(_0x2c45ef){if(_0x2c45ef){return _0x2c45ef?{'count':_0x4afea6,'rows':_0x2c45ef}:null;}})[_0xb756('0x27')](respondWithResult(_0x2a52a2,null))[_0xb756('0x46')](handleError(_0x2a52a2,null));}; \ No newline at end of file +var _0x726e=['show','params','rawAttributes','includeAll','include','find','create','body','destroy','describe','getUnread','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','name','send','index','map','ChatGroup','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','findAll','rows','catch'];(function(_0x16c2f4,_0x43f6f0){var _0x5d354a=function(_0x61aa5){while(--_0x61aa5){_0x16c2f4['push'](_0x16c2f4['shift']());}};_0x5d354a(++_0x43f6f0);}(_0x726e,0x133));var _0xe726=function(_0x1d2c7d,_0x907a82){_0x1d2c7d=_0x1d2c7d-0x0;var _0x82a49f=_0x726e[_0x1d2c7d];return _0x82a49f;};'use strict';var emlformat=require(_0xe726('0x0'));var rimraf=require(_0xe726('0x1'));var zipdir=require(_0xe726('0x2'));var jsonpatch=require(_0xe726('0x3'));var rp=require(_0xe726('0x4'));var moment=require('moment');var BPromise=require(_0xe726('0x5'));var Mustache=require(_0xe726('0x6'));var util=require('util');var path=require(_0xe726('0x7'));var sox=require('sox');var csv=require(_0xe726('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe726('0x9'));var _=require('lodash');var squel=require(_0xe726('0xa'));var crypto=require(_0xe726('0xb'));var jsforce=require(_0xe726('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe726('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe726('0xd'));var authService=require(_0xe726('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe726('0xf'));var logger=require(_0xe726('0x10'))(_0xe726('0x11'));var utils=require(_0xe726('0x12'));var config=require(_0xe726('0x13'));var licenseUtil=require(_0xe726('0x14'));var db=require(_0xe726('0x15'))['db'];config[_0xe726('0x16')]=_[_0xe726('0x17')](config[_0xe726('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe726('0x16')]));require(_0xe726('0x18'))[_0xe726('0x19')](socket);function respondWithStatusCode(_0x66e60b,_0x34178d){_0x34178d=_0x34178d||0xcc;return function(_0x38ee1e){if(_0x38ee1e){return _0x66e60b[_0xe726('0x1a')](_0x34178d);}return _0x66e60b[_0xe726('0x1b')](_0x34178d)[_0xe726('0x1c')]();};}function respondWithResult(_0x596b8a,_0x54c2e6){_0x54c2e6=_0x54c2e6||0xc8;return function(_0x6ca53f){if(_0x6ca53f){return _0x596b8a[_0xe726('0x1b')](_0x54c2e6)[_0xe726('0x1d')](_0x6ca53f);}};}function respondWithFilteredResult(_0x3e52a3,_0x3c1bd6){return function(_0x119a78){if(_0x119a78){var _0x43181b=typeof _0x3c1bd6[_0xe726('0x1e')]==='undefined'&&typeof _0x3c1bd6['limit']===_0xe726('0x1f');var _0x1df33a=_0x119a78[_0xe726('0x20')];var _0xb03d82=_0x43181b?0x0:_0x3c1bd6[_0xe726('0x1e')];var _0x289fe0=_0x43181b?_0x119a78['count']:_0x3c1bd6['offset']+_0x3c1bd6[_0xe726('0x21')];var _0x222b21;if(_0x289fe0>=_0x1df33a){_0x289fe0=_0x1df33a;_0x222b21=0xc8;}else{_0x222b21=0xce;}_0x3e52a3[_0xe726('0x1b')](_0x222b21);return _0x3e52a3[_0xe726('0x22')](_0xe726('0x23'),_0xb03d82+'-'+_0x289fe0+'/'+_0x1df33a)[_0xe726('0x1d')](_0x119a78);}return null;};}function patchUpdates(_0x196514){return function(_0x2a29ee){try{jsonpatch[_0xe726('0x24')](_0x2a29ee,_0x196514,!![]);}catch(_0x3f0830){return BPromise['reject'](_0x3f0830);}return _0x2a29ee[_0xe726('0x25')]();};}function saveUpdates(_0x5c1ac6,_0x5162e5){return function(_0x436e8a){if(_0x436e8a){return _0x436e8a[_0xe726('0x26')](_0x5c1ac6)['then'](function(_0x34028f){return _0x34028f;});}return null;};}function removeEntity(_0x50b956,_0x5bec0e){return function(_0x4d06d7){if(_0x4d06d7){return _0x4d06d7['destroy']()[_0xe726('0x27')](function(){_0x50b956[_0xe726('0x1b')](0xcc)[_0xe726('0x1c')]();});}};}function handleEntityNotFound(_0x4da305,_0xc6a111){return function(_0x314393){if(!_0x314393){_0x4da305[_0xe726('0x1a')](0x194);}return _0x314393;};}function handleError(_0x4c1b05,_0xc69e){_0xc69e=_0xc69e||0x1f4;return function(_0x13ba11){logger['error'](_0x13ba11['stack']);if(_0x13ba11[_0xe726('0x28')]){delete _0x13ba11[_0xe726('0x28')];}_0x4c1b05['status'](_0xc69e)[_0xe726('0x29')](_0x13ba11);};}exports[_0xe726('0x2a')]=function(_0x40fbb5,_0x207ca2){var _0x3c4941={},_0x493bee={},_0x26def4={'count':0x0,'rows':[]};var _0x11eb59=_[_0xe726('0x2b')](db[_0xe726('0x2c')]['rawAttributes'],function(_0x16a598){return{'name':_0x16a598[_0xe726('0x2d')],'type':_0x16a598[_0xe726('0x2e')][_0xe726('0x2f')]};});_0x493bee[_0xe726('0x30')]=_[_0xe726('0x2b')](_0x11eb59,_0xe726('0x28'));_0x493bee[_0xe726('0x31')]=_[_0xe726('0x32')](_0x40fbb5[_0xe726('0x31')]);_0x493bee[_0xe726('0x33')]=_['intersection'](_0x493bee[_0xe726('0x30')],_0x493bee['query']);_0x3c4941[_0xe726('0x34')]=_[_0xe726('0x35')](_0x493bee[_0xe726('0x30')],qs[_0xe726('0x36')](_0x40fbb5[_0xe726('0x31')][_0xe726('0x36')]));_0x3c4941[_0xe726('0x34')]=_0x3c4941[_0xe726('0x34')][_0xe726('0x37')]?_0x3c4941[_0xe726('0x34')]:_0x493bee[_0xe726('0x30')];if(!_0x40fbb5['query'][_0xe726('0x38')](_0xe726('0x39'))){_0x3c4941[_0xe726('0x21')]=qs['limit'](_0x40fbb5[_0xe726('0x31')][_0xe726('0x21')]);_0x3c4941[_0xe726('0x1e')]=qs[_0xe726('0x1e')](_0x40fbb5[_0xe726('0x31')][_0xe726('0x1e')]);}_0x3c4941[_0xe726('0x3a')]=qs['sort'](_0x40fbb5[_0xe726('0x31')][_0xe726('0x3b')]);_0x3c4941['where']=qs[_0xe726('0x33')](_[_0xe726('0x3c')](_0x40fbb5[_0xe726('0x31')],_0x493bee[_0xe726('0x33')]),_0x11eb59);if(_0x40fbb5[_0xe726('0x31')]['filter']){_0x3c4941[_0xe726('0x3d')]=_[_0xe726('0x3e')](_0x3c4941[_0xe726('0x3d')],{'$or':_[_0xe726('0x2b')](_0x11eb59,function(_0x756d64){if(_0x756d64[_0xe726('0x2e')]!==_0xe726('0x3f')){var _0x51be8f={};_0x51be8f[_0x756d64[_0xe726('0x28')]]={'$like':'%'+_0x40fbb5[_0xe726('0x31')][_0xe726('0x40')]+'%'};return _0x51be8f;}})});}_0x3c4941=_[_0xe726('0x3e')]({},_0x3c4941,_0x40fbb5[_0xe726('0x41')]);var _0x472d1c={'where':_0x3c4941[_0xe726('0x3d')]};return db['ChatGroup']['count'](_0x472d1c)['then'](function(_0x4c250f){_0x26def4[_0xe726('0x20')]=_0x4c250f;if(_0x40fbb5[_0xe726('0x31')]['includeAll']){_0x3c4941['include']=[{'all':!![]}];}return db[_0xe726('0x2c')][_0xe726('0x42')](_0x3c4941);})[_0xe726('0x27')](function(_0x165c11){_0x26def4[_0xe726('0x43')]=_0x165c11;return _0x26def4;})[_0xe726('0x27')](respondWithFilteredResult(_0x207ca2,_0x3c4941))[_0xe726('0x44')](handleError(_0x207ca2,null));};exports[_0xe726('0x45')]=function(_0x10304d,_0x480273){var _0x30efc7={'raw':!![],'where':{'id':_0x10304d[_0xe726('0x46')]['id']}},_0xc3e32b={};_0xc3e32b[_0xe726('0x30')]=_[_0xe726('0x32')](db[_0xe726('0x2c')][_0xe726('0x47')]);_0xc3e32b[_0xe726('0x31')]=_[_0xe726('0x32')](_0x10304d[_0xe726('0x31')]);_0xc3e32b[_0xe726('0x33')]=_[_0xe726('0x35')](_0xc3e32b[_0xe726('0x30')],_0xc3e32b[_0xe726('0x31')]);_0x30efc7[_0xe726('0x34')]=_['intersection'](_0xc3e32b[_0xe726('0x30')],qs[_0xe726('0x36')](_0x10304d[_0xe726('0x31')][_0xe726('0x36')]));_0x30efc7[_0xe726('0x34')]=_0x30efc7['attributes'][_0xe726('0x37')]?_0x30efc7[_0xe726('0x34')]:_0xc3e32b[_0xe726('0x30')];if(_0x10304d[_0xe726('0x31')][_0xe726('0x48')]){_0x30efc7[_0xe726('0x49')]=[{'all':!![]}];}_0x30efc7=_[_0xe726('0x3e')]({},_0x30efc7,_0x10304d[_0xe726('0x41')]);return db[_0xe726('0x2c')][_0xe726('0x4a')](_0x30efc7)[_0xe726('0x27')](handleEntityNotFound(_0x480273,null))[_0xe726('0x27')](respondWithResult(_0x480273,null))[_0xe726('0x44')](handleError(_0x480273,null));};exports['create']=function(_0x30a9aa,_0x3189b3){return db[_0xe726('0x2c')][_0xe726('0x4b')](_0x30a9aa['body'],{})['then'](respondWithResult(_0x3189b3,0xc9))['catch'](handleError(_0x3189b3,null));};exports['update']=function(_0x1af900,_0x32ad47){if(_0x1af900[_0xe726('0x4c')]['id']){delete _0x1af900[_0xe726('0x4c')]['id'];}return db[_0xe726('0x2c')][_0xe726('0x4a')]({'where':{'id':_0x1af900['params']['id']}})[_0xe726('0x27')](handleEntityNotFound(_0x32ad47,null))[_0xe726('0x27')](saveUpdates(_0x1af900['body'],null))['then'](respondWithResult(_0x32ad47,null))[_0xe726('0x44')](handleError(_0x32ad47,null));};exports[_0xe726('0x4d')]=function(_0x483970,_0x44a8f9){return db[_0xe726('0x2c')][_0xe726('0x4a')]({'where':{'id':_0x483970[_0xe726('0x46')]['id']}})[_0xe726('0x27')](handleEntityNotFound(_0x44a8f9,null))[_0xe726('0x27')](removeEntity(_0x44a8f9,null))[_0xe726('0x44')](handleError(_0x44a8f9,null));};exports[_0xe726('0x4e')]=function(_0x4c5062,_0x164605){return db['ChatGroup'][_0xe726('0x4e')]()[_0xe726('0x27')](respondWithResult(_0x164605,null))[_0xe726('0x44')](handleError(_0x164605,null));};exports[_0xe726('0x4f')]=function(_0x14b661,_0x1d7991,_0x34f972){return db['ChatInternalMessage'][_0xe726('0x20')]({'where':{'ChatGroupId':_0x14b661['params']['id'],'ToId':_0x14b661['user']['id'],'read':![]}})[_0xe726('0x27')](function(_0x7b4414){return{'id':_[_0xe726('0x50')](_0x14b661['params']['id']),'count':_0x7b4414};})[_0xe726('0x27')](respondWithResult(_0x1d7991,null))[_0xe726('0x44')](handleError(_0x1d7991,null));};exports[_0xe726('0x51')]=function(_0x4de6b5,_0x2e4344,_0x5238c4){return db['ChatGroup'][_0xe726('0x4a')]({'where':{'id':_0x4de6b5['params']['id']}})[_0xe726('0x27')](handleEntityNotFound(_0x2e4344,null))['then'](function(_0x5489a1){if(_0x5489a1){return _0x5489a1[_0xe726('0x51')](_0x4de6b5['body'][_0xe726('0x52')],_[_0xe726('0x53')](_0x4de6b5[_0xe726('0x4c')],[_0xe726('0x52'),'id'])||{});}})['then'](respondWithResult(_0x2e4344,null))['catch'](handleError(_0x2e4344,null));};exports[_0xe726('0x54')]=function(_0xab4a6f,_0x4118bb,_0x112cfc){var _0x329784={};var _0x2f9d9c={};var _0x53f123;var _0x56a024;return db[_0xe726('0x2c')][_0xe726('0x55')]({'where':{'id':_0xab4a6f[_0xe726('0x46')]['id']}})['then'](handleEntityNotFound(_0x4118bb,null))[_0xe726('0x27')](function(_0x54a80a){if(_0x54a80a){_0x53f123=_0x54a80a;_0x2f9d9c[_0xe726('0x30')]=_['keys'](db[_0xe726('0x56')][_0xe726('0x47')]);_0x2f9d9c[_0xe726('0x31')]=_[_0xe726('0x32')](_0xab4a6f[_0xe726('0x31')]);_0x2f9d9c[_0xe726('0x33')]=_[_0xe726('0x35')](_0x2f9d9c['model'],_0x2f9d9c[_0xe726('0x31')]);_0x329784[_0xe726('0x34')]=_[_0xe726('0x35')](_0x2f9d9c[_0xe726('0x30')],qs[_0xe726('0x36')](_0xab4a6f[_0xe726('0x31')]['fields']));_0x329784[_0xe726('0x34')]=_0x329784[_0xe726('0x34')][_0xe726('0x37')]?_0x329784[_0xe726('0x34')]:_0x2f9d9c[_0xe726('0x30')];_0x329784[_0xe726('0x3a')]=qs[_0xe726('0x3b')](_0xab4a6f[_0xe726('0x31')][_0xe726('0x3b')]);_0x329784['where']=qs[_0xe726('0x33')](_['pick'](_0xab4a6f[_0xe726('0x31')],_0x2f9d9c['filters']));if(_0xab4a6f[_0xe726('0x31')][_0xe726('0x40')]){_0x329784['where']=_['merge'](_0x329784[_0xe726('0x3d')],{'$or':_[_0xe726('0x2b')](_0x329784[_0xe726('0x34')],function(_0x4eaf0d){var _0x1e6d7b={};_0x1e6d7b[_0x4eaf0d]={'$like':'%'+_0xab4a6f[_0xe726('0x31')][_0xe726('0x40')]+'%'};return _0x1e6d7b;})});}_0x329784=_[_0xe726('0x3e')]({},_0x329784,_0xab4a6f[_0xe726('0x41')]);return _0x53f123[_0xe726('0x54')](_0x329784);}})['then'](function(_0x4ea74c){if(_0x4ea74c){_0x56a024=_0x4ea74c[_0xe726('0x37')];if(!_0xab4a6f['query'][_0xe726('0x38')]('nolimit')){_0x329784[_0xe726('0x21')]=qs[_0xe726('0x21')](_0xab4a6f[_0xe726('0x31')][_0xe726('0x21')]);_0x329784['offset']=qs[_0xe726('0x1e')](_0xab4a6f[_0xe726('0x31')][_0xe726('0x1e')]);}return _0x53f123[_0xe726('0x54')](_0x329784);}})[_0xe726('0x27')](function(_0x54514d){if(_0x54514d){return _0x54514d?{'count':_0x56a024,'rows':_0x54514d}:null;}})[_0xe726('0x27')](respondWithResult(_0x4118bb,null))[_0xe726('0x44')](handleError(_0x4118bb,null));};exports[_0xe726('0x57')]=function(_0xc116b,_0xfe0725,_0x19753f){return db[_0xe726('0x2c')][_0xe726('0x4a')]({'where':{'id':_0xc116b['params']['id']}})[_0xe726('0x27')](handleEntityNotFound(_0xfe0725,null))[_0xe726('0x27')](function(_0x2a4f7e){if(_0x2a4f7e){return _0x2a4f7e[_0xe726('0x57')](_0xc116b[_0xe726('0x31')][_0xe726('0x52')]);}})['then'](respondWithStatusCode(_0xfe0725,null))['catch'](handleError(_0xfe0725,null));};exports['addMessage']=function(_0x1fb478,_0x5329eb,_0x2ae73b){if(_0x1fb478[_0xe726('0x4c')]['id']){delete _0x1fb478[_0xe726('0x4c')]['id'];}return db[_0xe726('0x2c')][_0xe726('0x4a')]({'where':{'id':_0x1fb478['params']['id']}})[_0xe726('0x27')](handleEntityNotFound(_0x5329eb,null))[_0xe726('0x27')](function(_0x2f41fb){if(_0x2f41fb){_0x1fb478[_0xe726('0x4c')]['ChatGroupId']=_0x2f41fb['id'];return db[_0xe726('0x58')][_0xe726('0x4b')](_0x1fb478[_0xe726('0x4c')]);}})[_0xe726('0x27')](respondWithResult(_0x5329eb,null))[_0xe726('0x44')](handleError(_0x5329eb,null));};exports['getMessages']=function(_0x3eca21,_0x5e1b03,_0x15011c){var _0x46efbf={};var _0x59d877={};var _0x4d5ef3;var _0x4ea3aa;return db[_0xe726('0x2c')][_0xe726('0x55')]({'where':{'id':_0x3eca21[_0xe726('0x46')]['id']}})[_0xe726('0x27')](handleEntityNotFound(_0x5e1b03,null))['then'](function(_0x2a69ca){if(_0x2a69ca){_0x4d5ef3=_0x2a69ca;_0x59d877[_0xe726('0x30')]=_[_0xe726('0x32')](db[_0xe726('0x58')][_0xe726('0x47')]);_0x59d877[_0xe726('0x31')]=_['keys'](_0x3eca21[_0xe726('0x31')]);_0x59d877[_0xe726('0x33')]=_[_0xe726('0x35')](_0x59d877[_0xe726('0x30')],_0x59d877[_0xe726('0x31')]);_0x46efbf['attributes']=_[_0xe726('0x35')](_0x59d877['model'],qs[_0xe726('0x36')](_0x3eca21[_0xe726('0x31')][_0xe726('0x36')]));_0x46efbf[_0xe726('0x34')]=_0x46efbf[_0xe726('0x34')]['length']?_0x46efbf[_0xe726('0x34')]:_0x59d877[_0xe726('0x30')];_0x46efbf[_0xe726('0x3a')]=qs['sort'](_0x3eca21[_0xe726('0x31')]['sort']);_0x46efbf['where']=qs['filters'](_[_0xe726('0x3c')](_0x3eca21[_0xe726('0x31')],_0x59d877[_0xe726('0x33')]));if(_0x3eca21[_0xe726('0x31')][_0xe726('0x40')]){_0x46efbf[_0xe726('0x3d')]=_[_0xe726('0x3e')](_0x46efbf[_0xe726('0x3d')],{'$or':_[_0xe726('0x2b')](_0x46efbf[_0xe726('0x34')],function(_0x21109c){var _0x39a78={};_0x39a78[_0x21109c]={'$like':'%'+_0x3eca21[_0xe726('0x31')][_0xe726('0x40')]+'%'};return _0x39a78;})});}if(_0x3eca21['query']['$gte']){var _0x2795b0=_0x3eca21[_0xe726('0x31')][_0xe726('0x59')][_0xe726('0x5a')](',');var _0x4e8c1e={};_0x4e8c1e[_0x2795b0[0x0]]={'$gte':moment(_0x2795b0[0x1])[_0xe726('0x5b')](_0xe726('0x5c'))};_0x46efbf[_0xe726('0x3d')]=_[_0xe726('0x3e')](_0x46efbf['where'],_0x4e8c1e);}_0x46efbf=_[_0xe726('0x3e')]({},_0x46efbf,_0x3eca21[_0xe726('0x41')]);return _0x4d5ef3[_0xe726('0x5d')](_0x46efbf);}})[_0xe726('0x27')](function(_0x722803){if(_0x722803){_0x4ea3aa=_0x722803['length'];if(!_0x3eca21[_0xe726('0x31')][_0xe726('0x38')](_0xe726('0x39'))){_0x46efbf['limit']=qs[_0xe726('0x21')](_0x3eca21[_0xe726('0x31')][_0xe726('0x21')]);_0x46efbf['offset']=qs[_0xe726('0x1e')](_0x3eca21[_0xe726('0x31')][_0xe726('0x1e')]);}return _0x4d5ef3[_0xe726('0x5d')](_0x46efbf);}})['then'](function(_0x55b99a){if(_0x55b99a){return _0x55b99a?{'count':_0x4ea3aa,'rows':_0x55b99a}:null;}})[_0xe726('0x27')](respondWithResult(_0x5e1b03,null))[_0xe726('0x44')](handleError(_0x5e1b03,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 42ef750..62bbbf7 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 _0xd4ad=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0x1e4417,_0x3529d3){var _0x182a23=function(_0x1e6ec7){while(--_0x1e6ec7){_0x1e4417['push'](_0x1e4417['shift']());}};_0x182a23(++_0x3529d3);}(_0xd4ad,0x158));var _0xdd4a=function(_0x4e9755,_0xc1f77c){_0x4e9755=_0x4e9755-0x0;var _0x1498c7=_0xd4ad[_0x4e9755];return _0x1498c7;};'use strict';var EventEmitter=require(_0xdd4a('0x0'));var ChatGroup=require(_0xdd4a('0x1'))['db'][_0xdd4a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xdd4a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdd4a('0x4'),'afterDestroy':_0xdd4a('0x5')};function emitEvent(_0x5911e5){return function(_0x587cf8,_0x13851c,_0x4775aa){ChatGroupEvents['emit'](_0x5911e5+':'+_0x587cf8['id'],_0x587cf8);ChatGroupEvents[_0xdd4a('0x6')](_0x5911e5,_0x587cf8);_0x4775aa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xdd4a('0x7')](e,emitEvent(event));}}module[_0xdd4a('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xc967=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x2d48cb,_0x3f6139){var _0x5c48a3=function(_0x1a1b45){while(--_0x1a1b45){_0x2d48cb['push'](_0x2d48cb['shift']());}};_0x5c48a3(++_0x3f6139);}(_0xc967,0x1b3));var _0x7c96=function(_0x5f0463,_0xddf1be){_0x5f0463=_0x5f0463-0x0;var _0x316668=_0xc967[_0x5f0463];return _0x316668;};'use strict';var EventEmitter=require(_0x7c96('0x0'));var ChatGroup=require(_0x7c96('0x1'))['db'][_0x7c96('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7c96('0x3')](0x0);var events={'afterCreate':_0x7c96('0x4'),'afterUpdate':_0x7c96('0x5'),'afterDestroy':'remove'};function emitEvent(_0x518c8f){return function(_0x42508e,_0x37cb3b,_0x578a5d){ChatGroupEvents[_0x7c96('0x6')](_0x518c8f+':'+_0x42508e['id'],_0x42508e);ChatGroupEvents[_0x7c96('0x6')](_0x518c8f,_0x42508e);_0x578a5d(null);};}for(var e in events){if(events[_0x7c96('0x7')](e)){var event=events[e];ChatGroup[_0x7c96('0x8')](e,emitEvent(event));}}module[_0x7c96('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 4ed367f..93955e6 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 _0xda2a=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','api','bluebird','rimraf'];(function(_0x5ccdbf,_0x2a41ee){var _0x1c9691=function(_0x375d9a){while(--_0x375d9a){_0x5ccdbf['push'](_0x5ccdbf['shift']());}};_0x1c9691(++_0x2a41ee);}(_0xda2a,0x69));var _0xada2=function(_0x2057b9,_0x17c1b2){_0x2057b9=_0x2057b9-0x0;var _0x3bdc39=_0xda2a[_0x2057b9];return _0x3bdc39;};'use strict';var _=require('lodash');var util=require(_0xada2('0x0'));var logger=require(_0xada2('0x1'))(_0xada2('0x2'));var moment=require('moment');var BPromise=require(_0xada2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xada2('0x4'));var config=require(_0xada2('0x5'));var attributes=require(_0xada2('0x6'));module[_0xada2('0x7')]=function(_0x5a1f76,_0x4b22bb){return _0x5a1f76[_0xada2('0x8')](_0xada2('0x9'),attributes,{'tableName':_0xada2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf245=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0xf245,0x176));var _0x5f24=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xf245[_0xb0de07];return _0x4633d8;};'use strict';var _=require(_0x5f24('0x0'));var util=require(_0x5f24('0x1'));var logger=require(_0x5f24('0x2'))(_0x5f24('0x3'));var moment=require(_0x5f24('0x4'));var BPromise=require(_0x5f24('0x5'));var rp=require(_0x5f24('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f24('0x7'));var config=require(_0x5f24('0x8'));var attributes=require(_0x5f24('0x9'));module[_0x5f24('0xa')]=function(_0x2b83f2,_0xb08643){return _0x2b83f2[_0x5f24('0xb')](_0x5f24('0xc'),attributes,{'tableName':_0x5f24('0xd'),'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 98f0780..1adea39 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 _0x535f=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result'];(function(_0x42aef9,_0x421926){var _0xe23e6d=function(_0x4e42bd){while(--_0x4e42bd){_0x42aef9['push'](_0x42aef9['shift']());}};_0xe23e6d(++_0x421926);}(_0x535f,0x160));var _0xf535=function(_0x582ae6,_0x57aa08){_0x582ae6=_0x582ae6-0x0;var _0x303447=_0x535f[_0x582ae6];return _0x303447;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf535('0x0'));var BPromise=require(_0xf535('0x1'));var rs=require(_0xf535('0x2'));var fs=require('fs');var Redis=require(_0xf535('0x3'));var db=require(_0xf535('0x4'))['db'];var utils=require(_0xf535('0x5'));var logger=require(_0xf535('0x6'))(_0xf535('0x7'));var config=require(_0xf535('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf535('0x9')][_0xf535('0xa')]({'port':0x232a});config[_0xf535('0xb')]=_[_0xf535('0xc')](config[_0xf535('0xb')],{'host':_0xf535('0xd'),'port':0x18eb});var socket=require(_0xf535('0xe'))(new Redis(config[_0xf535('0xb')]));require(_0xf535('0xf'))[_0xf535('0x10')](socket);function respondWithRpcPromise(_0x82b02c,_0x297142,_0x7d35fa){return new BPromise(function(_0xdf7b71,_0x255044){return client['request'](_0x82b02c,_0x7d35fa)[_0xf535('0x11')](function(_0x1f9fda){logger[_0xf535('0x12')]('ChatGroup,\x20%s,\x20%s',_0x297142,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x297142,_0xf535('0x13'),JSON[_0xf535('0x14')](_0x1f9fda));if(_0x1f9fda['error']){if(_0x1f9fda[_0xf535('0x15')][_0xf535('0x16')]===0x1f4){logger[_0xf535('0x15')](_0xf535('0x17'),_0x297142,_0x1f9fda[_0xf535('0x15')][_0xf535('0x18')]);return _0x255044(_0x1f9fda['error']['message']);}logger[_0xf535('0x15')](_0xf535('0x17'),_0x297142,_0x1f9fda[_0xf535('0x15')][_0xf535('0x18')]);return _0xdf7b71(_0x1f9fda['error'][_0xf535('0x18')]);}else{logger[_0xf535('0x12')]('ChatGroup,\x20%s,\x20%s',_0x297142,_0xf535('0x13'));_0xdf7b71(_0x1f9fda[_0xf535('0x19')][_0xf535('0x18')]);}})[_0xf535('0x1a')](function(_0x1df29f){logger[_0xf535('0x15')](_0xf535('0x17'),_0x297142,_0x1df29f);_0x255044(_0x1df29f);});});} \ No newline at end of file +var _0xebfb=['error','code','ChatGroup,\x20%s,\x20%s','message','request\x20sent','result','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','stringify'];(function(_0xc8fedd,_0x2ef1d1){var _0x54e490=function(_0xf9b0){while(--_0xf9b0){_0xc8fedd['push'](_0xc8fedd['shift']());}};_0x54e490(++_0x2ef1d1);}(_0xebfb,0x10a));var _0xbebf=function(_0xa1bf55,_0xc0f3f){_0xa1bf55=_0xa1bf55-0x0;var _0x51a788=_0xebfb[_0xa1bf55];return _0x51a788;};'use strict';var _=require('lodash');var util=require(_0xbebf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbebf('0x1'));var fs=require('fs');var Redis=require(_0xbebf('0x2'));var db=require(_0xbebf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbebf('0x4'))(_0xbebf('0x5'));var config=require(_0xbebf('0x6'));var jayson=require(_0xbebf('0x7'));var client=jayson['client'][_0xbebf('0x8')]({'port':0x232a});config['redis']=_[_0xbebf('0x9')](config[_0xbebf('0xa')],{'host':_0xbebf('0xb'),'port':0x18eb});var socket=require(_0xbebf('0xc'))(new Redis(config[_0xbebf('0xa')]));require(_0xbebf('0xd'))[_0xbebf('0xe')](socket);function respondWithRpcPromise(_0x371eff,_0x9ddba0,_0x1120d9){return new BPromise(function(_0x1d5e77,_0x1c6b41){return client[_0xbebf('0xf')](_0x371eff,_0x1120d9)[_0xbebf('0x10')](function(_0x128dc4){logger[_0xbebf('0x11')]('ChatGroup,\x20%s,\x20%s',_0x9ddba0,'request\x20sent');logger[_0xbebf('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x9ddba0,'request\x20sent',JSON[_0xbebf('0x13')](_0x128dc4));if(_0x128dc4[_0xbebf('0x14')]){if(_0x128dc4[_0xbebf('0x14')][_0xbebf('0x15')]===0x1f4){logger['error'](_0xbebf('0x16'),_0x9ddba0,_0x128dc4[_0xbebf('0x14')][_0xbebf('0x17')]);return _0x1c6b41(_0x128dc4[_0xbebf('0x14')]['message']);}logger[_0xbebf('0x14')]('ChatGroup,\x20%s,\x20%s',_0x9ddba0,_0x128dc4[_0xbebf('0x14')][_0xbebf('0x17')]);return _0x1d5e77(_0x128dc4[_0xbebf('0x14')]['message']);}else{logger[_0xbebf('0x11')]('ChatGroup,\x20%s,\x20%s',_0x9ddba0,_0xbebf('0x18'));_0x1d5e77(_0x128dc4[_0xbebf('0x19')][_0xbebf('0x17')]);}})['catch'](function(_0x19c044){logger[_0xbebf('0x14')](_0xbebf('0x16'),_0x9ddba0,_0x19c044);_0x1c6b41(_0x19c044);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 68f1e15..5d1bc54 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 _0x7e8c=['register','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x1f6245,_0x2a3251){var _0x4abdf7=function(_0x447d72){while(--_0x447d72){_0x1f6245['push'](_0x1f6245['shift']());}};_0x4abdf7(++_0x2a3251);}(_0x7e8c,0x12f));var _0xc7e8=function(_0x53661b,_0x13b52){_0x53661b=_0x53661b-0x0;var _0x141bf1=_0x7e8c[_0x53661b];return _0x141bf1;};'use strict';var ChatGroupEvents=require(_0xc7e8('0x0'));var events=[_0xc7e8('0x1'),_0xc7e8('0x2'),_0xc7e8('0x3')];function createListener(_0x3f21e8,_0x521fa3){return function(_0x692d31){_0x521fa3[_0xc7e8('0x4')](_0x3f21e8,_0x692d31);};}function removeListener(_0xd7c9c8,_0x3f0387){return function(){ChatGroupEvents['removeListener'](_0xd7c9c8,_0x3f0387);};}exports[_0xc7e8('0x5')]=function(_0x267083){for(var _0x1e6533=0x0,_0x46f496=events['length'];_0x1e6533<_0x46f496;_0x1e6533++){var _0x245bfe=events[_0x1e6533];var _0x27da62=createListener(_0xc7e8('0x6')+_0x245bfe,_0x267083);ChatGroupEvents['on'](_0x245bfe,_0x27da62);}}; \ No newline at end of file +var _0xbf2a=['remove','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xbf2a,0x1be));var _0xabf2=function(_0x2c4260,_0x19882c){_0x2c4260=_0x2c4260-0x0;var _0x13972e=_0xbf2a[_0x2c4260];return _0x13972e;};'use strict';var ChatGroupEvents=require(_0xabf2('0x0'));var events=[_0xabf2('0x1'),_0xabf2('0x2'),'update'];function createListener(_0x12fefc,_0xe34963){return function(_0x1b9f21){_0xe34963[_0xabf2('0x3')](_0x12fefc,_0x1b9f21);};}function removeListener(_0x573dce,_0xbeef44){return function(){ChatGroupEvents[_0xabf2('0x4')](_0x573dce,_0xbeef44);};}exports[_0xabf2('0x5')]=function(_0x58113b){for(var _0x3c2649=0x0,_0x20739d=events[_0xabf2('0x6')];_0x3c2649<_0x20739d;_0x3c2649++){var _0x7659ee=events[_0x3c2649];var _0x487c15=createListener(_0xabf2('0x7')+_0x7659ee,_0x58113b);ChatGroupEvents['on'](_0x7659ee,_0x487c15);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index a54bc48..96bafe3 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 _0x6f9b=['fs-extra','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','/:id/members','getMessages','post','create','addMembers','/:id/messages','put','delete','exports','multer','util','path','express','Router'];(function(_0x2108c5,_0x5649ee){var _0x2711ff=function(_0x465b26){while(--_0x465b26){_0x2108c5['push'](_0x2108c5['shift']());}};_0x2711ff(++_0x5649ee);}(_0x6f9b,0x16b));var _0xb6f9=function(_0x2a790f,_0x49a9b9){_0x2a790f=_0x2a790f-0x0;var _0x25ee56=_0x6f9b[_0x2a790f];return _0x25ee56;};'use strict';var multer=require(_0xb6f9('0x0'));var util=require(_0xb6f9('0x1'));var path=require(_0xb6f9('0x2'));var timeout=require('connect-timeout');var express=require(_0xb6f9('0x3'));var router=express[_0xb6f9('0x4')]();var fs_extra=require(_0xb6f9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb6f9('0x6'));router[_0xb6f9('0x7')]('/',auth[_0xb6f9('0x8')](),controller[_0xb6f9('0x9')]);router[_0xb6f9('0x7')](_0xb6f9('0xa'),auth['isAuthenticated'](),controller[_0xb6f9('0xb')]);router[_0xb6f9('0x7')]('/:id',auth[_0xb6f9('0x8')](),controller[_0xb6f9('0xc')]);router['get'](_0xb6f9('0xd'),auth[_0xb6f9('0x8')](),controller['getUnread']);router[_0xb6f9('0x7')](_0xb6f9('0xe'),auth[_0xb6f9('0x8')](),controller['getMembers']);router[_0xb6f9('0x7')]('/:id/messages',auth[_0xb6f9('0x8')](),controller[_0xb6f9('0xf')]);router[_0xb6f9('0x10')]('/',auth['isAuthenticated'](),controller[_0xb6f9('0x11')]);router['post'](_0xb6f9('0xe'),auth[_0xb6f9('0x8')](),controller[_0xb6f9('0x12')]);router[_0xb6f9('0x10')](_0xb6f9('0x13'),auth[_0xb6f9('0x8')](),controller['addMessage']);router[_0xb6f9('0x14')]('/:id',auth[_0xb6f9('0x8')](),controller['update']);router[_0xb6f9('0x15')]('/:id',auth[_0xb6f9('0x8')](),controller['destroy']);router[_0xb6f9('0x15')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module[_0xb6f9('0x16')]=router; \ No newline at end of file +var _0x432e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','getUnread','/:id/members','getMembers','/:id/messages','create','addMembers','post','addMessage','put','removeMembers','exports','util'];(function(_0x1f3224,_0x4afeec){var _0x549194=function(_0x44ba15){while(--_0x44ba15){_0x1f3224['push'](_0x1f3224['shift']());}};_0x549194(++_0x4afeec);}(_0x432e,0x14f));var _0xe432=function(_0x4767fb,_0x3842f7){_0x4767fb=_0x4767fb-0x0;var _0x3f9248=_0x432e[_0x4767fb];return _0x3f9248;};'use strict';var multer=require('multer');var util=require(_0xe432('0x0'));var path=require('path');var timeout=require(_0xe432('0x1'));var express=require(_0xe432('0x2'));var router=express[_0xe432('0x3')]();var fs_extra=require(_0xe432('0x4'));var auth=require(_0xe432('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe432('0x6'));var controller=require('./chatGroup.controller');router[_0xe432('0x7')]('/',auth['isAuthenticated'](),controller[_0xe432('0x8')]);router['get'](_0xe432('0x9'),auth['isAuthenticated'](),controller[_0xe432('0xa')]);router[_0xe432('0x7')](_0xe432('0xb'),auth[_0xe432('0xc')](),controller['show']);router[_0xe432('0x7')]('/:id/unread',auth[_0xe432('0xc')](),controller[_0xe432('0xd')]);router[_0xe432('0x7')](_0xe432('0xe'),auth[_0xe432('0xc')](),controller[_0xe432('0xf')]);router[_0xe432('0x7')](_0xe432('0x10'),auth[_0xe432('0xc')](),controller['getMessages']);router['post']('/',auth[_0xe432('0xc')](),controller[_0xe432('0x11')]);router['post']('/:id/members',auth[_0xe432('0xc')](),controller[_0xe432('0x12')]);router[_0xe432('0x13')](_0xe432('0x10'),auth[_0xe432('0xc')](),controller[_0xe432('0x14')]);router[_0xe432('0x15')]('/:id',auth[_0xe432('0xc')](),controller['update']);router['delete'](_0xe432('0xb'),auth[_0xe432('0xc')](),controller['destroy']);router['delete'](_0xe432('0xe'),auth['isAuthenticated'](),controller[_0xe432('0x16')]);module[_0xe432('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 520f212..41b8765 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 _0x867f=['sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x170b30,_0xfbeb58){var _0x49f408=function(_0x40d018){while(--_0x40d018){_0x170b30['push'](_0x170b30['shift']());}};_0x49f408(++_0xfbeb58);}(_0x867f,0xdc));var _0xf867=function(_0x547640,_0x579b2a){_0x547640=_0x547640-0x0;var _0x481c2a=_0x867f[_0x547640];return _0x481c2a;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'closed':{'type':Sequelize[_0xf867('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xf867('0x3')](_0xf867('0x4'),_0xf867('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xf867('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xf867('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf867('0x8')]},'disposition':{'type':Sequelize[_0xf867('0x7')]},'secondDisposition':{'type':Sequelize[_0xf867('0x7')]},'thirdDisposition':{'type':Sequelize[_0xf867('0x7')]},'note':{'type':Sequelize[_0xf867('0x7')]},'browserName':{'type':Sequelize[_0xf867('0x7')]},'browserVersion':{'type':Sequelize[_0xf867('0x7')]},'osName':{'type':Sequelize[_0xf867('0x7')]},'osVersion':{'type':Sequelize[_0xf867('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xf867('0x7')]},'referer':{'type':Sequelize[_0xf867('0x6')]},'customerIp':{'type':Sequelize[_0xf867('0x7')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0xf867('0x8')]},'lastMsgAt':{'type':Sequelize[_0xf867('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf867('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf867('0x7')]},'customerPort':{'type':Sequelize[_0xf867('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xf867('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb248=['INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0xb248,0xc6));var _0x8b24=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xb248[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0x8b24('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8b24('0x2')]},'ratingType':{'type':Sequelize[_0x8b24('0x3')](_0x8b24('0x4'),'thumb'),'defaultValue':_0x8b24('0x4')},'ratingMessage':{'type':Sequelize[_0x8b24('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8b24('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8b24('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8b24('0x6')]},'thirdDisposition':{'type':Sequelize[_0x8b24('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x8b24('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8b24('0x6')]},'osVersion':{'type':Sequelize[_0x8b24('0x6')]},'deviceModel':{'type':Sequelize[_0x8b24('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x8b24('0x6')]},'referer':{'type':Sequelize[_0x8b24('0x5')]},'customerIp':{'type':Sequelize[_0x8b24('0x6')]},'formData':{'type':Sequelize[_0x8b24('0x5')](_0x8b24('0x8'))},'read1stAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x8b24('0x3')]('in',_0x8b24('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8b24('0x6')]},'customerPort':{'type':Sequelize[_0x8b24('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x8b24('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 6a91679..f7e3c76 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 _0x496b=['out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','customer','format','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','secret','MailAccount','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','getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','findAll','rows','getMyMessages','pick','include','includeAgent','push','addTags','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','direction','Account','Owner','mkdirSync','Chat','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','map','createReadStream','read','renderFile','downloadInteraction.ejs','.pdf','err','rimraf','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','client','request','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','set','then','destroy','stack','name','send','render','merge','body','contact','agent','interaction','index','ChatInteraction','rawAttributes','fieldName','type','key','chat','show','params','model','keys','query','filters','attributes','intersection','fields','length','includeAll','options','find','create','update','describe','ChatWebsite','findOne','ChatWebsiteId','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration'];(function(_0xe50179,_0x27eeee){var _0x54ce23=function(_0x5c1020){while(--_0x5c1020){_0xe50179['push'](_0xe50179['shift']());}};_0x54ce23(++_0x27eeee);}(_0x496b,0x73));var _0xb496=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x496b[_0x13ce0c];return _0x4388fb;};'use strict';var rimraf=require(_0xb496('0x0'));var zipdir=require('zip-dir');var rp=require(_0xb496('0x1'));var moment=require(_0xb496('0x2'));var BPromise=require(_0xb496('0x3'));var Mustache=require('mustache');var util=require(_0xb496('0x4'));var path=require(_0xb496('0x5'));var ejs=require(_0xb496('0x6'));var fs=require('fs');var _=require(_0xb496('0x7'));var Redis=require(_0xb496('0x8'));var interaction=require(_0xb496('0x9'));var qs=require(_0xb496('0xa'));var pdf=require('../../components/export/pdf');var logger=require(_0xb496('0xb'))(_0xb496('0xc'));var config=require(_0xb496('0xd'));var db=require(_0xb496('0xe'))['db'];config[_0xb496('0xf')]=_['defaults'](config[_0xb496('0xf')],{'host':_0xb496('0x10'),'port':0x18eb});var socket=require(_0xb496('0x11'))(new Redis(config['redis']));require(_0xb496('0x12'))[_0xb496('0x13')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb496('0x14')]({'port':0x232b});var client9004=jayson[_0xb496('0x15')][_0xb496('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x312d8f,_0x3ddaa8,_0x5b2b87,_0x46c798){return new BPromise(function(_0x45daf2,_0x35d843){var _0x8c6b90=_0x46c798||client;return _0x8c6b90[_0xb496('0x16')](_0x312d8f,_0x5b2b87)['then'](function(_0x169faa){logger[_0xb496('0x17')](_0xb496('0x18'),_0x3ddaa8,_0xb496('0x19'));logger['debug'](_0xb496('0x1a'),_0x3ddaa8,'request\x20sent',JSON['stringify'](_0x169faa));if(_0x169faa[_0xb496('0x1b')]){if(_0x169faa['error'][_0xb496('0x1c')]===0x1f4){logger[_0xb496('0x1b')](_0xb496('0x18'),_0x3ddaa8,_0x169faa[_0xb496('0x1b')][_0xb496('0x1d')]);return _0x35d843(_0x169faa['error']['message']);}logger[_0xb496('0x1b')](_0xb496('0x18'),_0x3ddaa8,_0x169faa['error'][_0xb496('0x1d')]);return _0x45daf2(_0x169faa[_0xb496('0x1b')][_0xb496('0x1d')]);}else{logger[_0xb496('0x17')](_0xb496('0x18'),_0x3ddaa8,'request\x20sent');_0x45daf2(_0x169faa[_0xb496('0x1e')][_0xb496('0x1d')]);}})[_0xb496('0x1f')](function(_0x500e3d){logger[_0xb496('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x3ddaa8,_0x500e3d);_0x35d843(_0x500e3d);});});}function respondWithStatusCode(_0x40c4c6,_0x2a0c5b){_0x2a0c5b=_0x2a0c5b||0xcc;return function(_0x4bf449){if(_0x4bf449){return _0x40c4c6[_0xb496('0x20')](_0x2a0c5b);}return _0x40c4c6[_0xb496('0x21')](_0x2a0c5b)[_0xb496('0x22')]();};}function respondWithResult(_0x4f06d9,_0x52f142){_0x52f142=_0x52f142||0xc8;return function(_0x4f5e1b){if(_0x4f5e1b){return _0x4f06d9[_0xb496('0x21')](_0x52f142)[_0xb496('0x23')](_0x4f5e1b);}};}function respondWithFilteredResult(_0x2b3eec,_0x2a7a43){return function(_0xfcff08){if(_0xfcff08){var _0x4c360b=typeof _0x2a7a43[_0xb496('0x24')]===_0xb496('0x25')&&typeof _0x2a7a43[_0xb496('0x26')]===_0xb496('0x25');var _0x4d9806=_0xfcff08['count'];var _0x2b7bfd=_0x4c360b?0x0:_0x2a7a43[_0xb496('0x24')];var _0x9d0f5b=_0x4c360b?_0xfcff08['count']:_0x2a7a43[_0xb496('0x24')]+_0x2a7a43[_0xb496('0x26')];var _0x411fb4;if(_0x9d0f5b>=_0x4d9806){_0x9d0f5b=_0x4d9806;_0x411fb4=0xc8;}else{_0x411fb4=0xce;}_0x2b3eec[_0xb496('0x21')](_0x411fb4);return _0x2b3eec[_0xb496('0x27')]('Content-Range',_0x2b7bfd+'-'+_0x9d0f5b+'/'+_0x4d9806)[_0xb496('0x23')](_0xfcff08);}return null;};}function saveUpdates(_0x403ca7){return function(_0xd93643){if(_0xd93643){return _0xd93643['update'](_0x403ca7)[_0xb496('0x28')](function(_0x597e35){return _0x597e35;});}return null;};}function removeEntity(_0x1bcb8a){return function(_0xdd8085){if(_0xdd8085){return _0xdd8085[_0xb496('0x29')]()['then'](function(){_0x1bcb8a[_0xb496('0x21')](0xcc)[_0xb496('0x22')]();});}};}function handleEntityNotFound(_0x125c3f){return function(_0x2a8244){if(!_0x2a8244){_0x125c3f['sendStatus'](0x194);}return _0x2a8244;};}function handleError(_0x53a553,_0x77dac9){_0x77dac9=_0x77dac9||0x1f4;return function(_0x2cb0e3){logger[_0xb496('0x1b')](_0x2cb0e3[_0xb496('0x2a')]);if(_0x2cb0e3[_0xb496('0x2b')]){delete _0x2cb0e3['name'];}_0x53a553['status'](_0x77dac9)[_0xb496('0x2c')](_0x2cb0e3);};}function getMustacheRender(_0x4ee8c4,_0x4c9377){return Mustache[_0xb496('0x2d')](_0x4ee8c4,_[_0xb496('0x2e')](_0x4c9377[_0xb496('0x2f')],{'contact':_0x4c9377[_0xb496('0x30')],'message':_0x4c9377['message'],'agent':_0x4c9377[_0xb496('0x31')],'interaction':_0x4c9377[_0xb496('0x32')],'account':_0x4c9377['account']}))||'';}exports[_0xb496('0x33')]=function(_0x5eaa7f,_0x3be30b){var _0x5a19af={};var _0x591064=_['map'](db[_0xb496('0x34')][_0xb496('0x35')],function(_0x120ec5){return{'name':_0x120ec5[_0xb496('0x36')],'type':_0x120ec5[_0xb496('0x37')][_0xb496('0x38')]};});_0x5a19af=qs['getOptions'](_0x591064,_0x5eaa7f);return interaction['findAll'](_0xb496('0x39'),_0x5eaa7f['query'],_0x5eaa7f['user'],_0x5a19af,_0x591064)[_0xb496('0x28')](respondWithFilteredResult(_0x3be30b,_0x5a19af))[_0xb496('0x1f')](handleError(_0x3be30b,null));};exports[_0xb496('0x3a')]=function(_0x169283,_0x28a14c){var _0x346332={'raw':![],'where':{'id':_0x169283[_0xb496('0x3b')]['id']}},_0x274714={};_0x274714[_0xb496('0x3c')]=_[_0xb496('0x3d')](db[_0xb496('0x34')]['rawAttributes']);_0x274714[_0xb496('0x3e')]=_[_0xb496('0x3d')](_0x169283[_0xb496('0x3e')]);_0x274714[_0xb496('0x3f')]=_['intersection'](_0x274714['model'],_0x274714[_0xb496('0x3e')]);_0x346332[_0xb496('0x40')]=_[_0xb496('0x41')](_0x274714[_0xb496('0x3c')],qs['fields'](_0x169283['query'][_0xb496('0x42')]));_0x346332[_0xb496('0x40')]=_0x346332['attributes'][_0xb496('0x43')]?_0x346332[_0xb496('0x40')]:_0x274714[_0xb496('0x3c')];if(_0x169283[_0xb496('0x3e')][_0xb496('0x44')]){_0x346332['include']=[{'all':!![]}];}_0x346332=_[_0xb496('0x2e')]({},_0x346332,_0x169283[_0xb496('0x45')]);return db[_0xb496('0x34')][_0xb496('0x46')](_0x346332)[_0xb496('0x28')](handleEntityNotFound(_0x28a14c,null))[_0xb496('0x28')](respondWithResult(_0x28a14c,null))[_0xb496('0x1f')](handleError(_0x28a14c,null));};exports['create']=function(_0x576a20,_0x36805b){return db['ChatInteraction'][_0xb496('0x47')](_0x576a20[_0xb496('0x2f')],{})[_0xb496('0x28')](respondWithResult(_0x36805b,0xc9))[_0xb496('0x1f')](handleError(_0x36805b,null));};exports[_0xb496('0x48')]=function(_0x3856a7,_0x23e4ec){if(_0x3856a7['body']['id']){delete _0x3856a7[_0xb496('0x2f')]['id'];}return db[_0xb496('0x34')]['find']({'where':{'id':_0x3856a7[_0xb496('0x3b')]['id']}})[_0xb496('0x28')](handleEntityNotFound(_0x23e4ec,null))[_0xb496('0x28')](saveUpdates(_0x3856a7['body'],null))['then'](respondWithResult(_0x23e4ec,null))[_0xb496('0x1f')](handleError(_0x23e4ec,null));};exports['destroy']=function(_0x5e76f2,_0x1fbecb){return db[_0xb496('0x34')]['find']({'where':{'id':_0x5e76f2['params']['id']}})[_0xb496('0x28')](handleEntityNotFound(_0x1fbecb,null))['then'](removeEntity(_0x1fbecb,null))[_0xb496('0x1f')](handleError(_0x1fbecb,null));};exports[_0xb496('0x49')]=function(_0x4a5d1a,_0x3b56b2){return db[_0xb496('0x34')][_0xb496('0x49')]()[_0xb496('0x28')](respondWithResult(_0x3b56b2,null))['catch'](handleError(_0x3b56b2,null));};exports['createVidaooSession']=function(_0x21073d,_0x49e6c8){var _0x27119a=_0x21073d[_0xb496('0x3b')]['id'];var _0x612150;var _0xe55ec0;var _0x486d5f;return db[_0xb496('0x34')]['findOne']({'where':{'id':_0x27119a}})[_0xb496('0x28')](function(_0x8fa863){_0x612150=_0x8fa863;return db[_0xb496('0x4a')][_0xb496('0x4b')]({'where':{'id':_0x8fa863[_0xb496('0x4c')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xb496('0x4d'),_0xb496('0x4e'),_0xb496('0x4f')],'raw':!![]});})[_0xb496('0x28')](function(_0x386562){if(_0x386562&&_0x386562[_0xb496('0x50')]&&_0x386562['vidaooEscalation']){_0xe55ec0=_0x386562;var _0x44be22={'interaction':{'id':_0x27119a},'agent':{'id':_0x21073d[_0xb496('0x51')]['id'],'name':_0x21073d[_0xb496('0x51')][_0xb496('0x2b')],'fullname':_0x21073d['user'][_0xb496('0x52')],'email':_0x21073d[_0xb496('0x51')][_0xb496('0x53')]},'contact':_0x21073d['body']['contact'],'account':_0x21073d[_0xb496('0x2f')][_0xb496('0x54')]};var _0x14a348={'rejectUnauthorized':![],'method':_0xb496('0x55'),'url':_0xb496('0x56'),'headers':{'X-APIKEY':_0x386562[_0xb496('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x21073d[_0xb496('0x51')][_0xb496('0x53')]],'buttons':null,'topic':_0xe55ec0[_0xb496('0x4d')],'note':_[_0xb496('0x57')](_0xe55ec0['vidaooNote'])?null:getMustacheRender(_0xe55ec0[_0xb496('0x4e')],_0x44be22),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xb496('0x57')](_0xe55ec0[_0xb496('0x4f')])){var _0x42d0c9=getMustacheRender(_0xe55ec0['vidaooMetadata'],_0x44be22);var _0x3362ae=JSON[_0xb496('0x58')](_0x42d0c9);_0x14a348['body'][_0xb496('0x59')]=_0x3362ae;}}catch(_0x1500b6){throw new db[(_0xb496('0x5a'))][(_0xb496('0x5b'))](_0xb496('0x5c'));}return rp(_0x14a348);}else{throw new db[(_0xb496('0x5a'))][(_0xb496('0x5b'))](_0xb496('0x5d'));}})[_0xb496('0x28')](function(_0xe070f7){_0x486d5f=_0xe070f7;if(_0x486d5f['id']){var _0x2caebd={'body':_0x486d5f['join_url'],'ChatWebsiteId':_0xe55ec0['id'],'ChatInteractionId':_0x612150['id'],'direction':_0xb496('0x5e'),'UserId':_0x21073d[_0xb496('0x51')]['id']};return db[_0xb496('0x5f')][_0xb496('0x47')](_0x2caebd,{});}else{throw new db[(_0xb496('0x5a'))]['ValidationError'](_0xb496('0x60'));}})[_0xb496('0x28')](function(){return _0x612150[_0xb496('0x61')]({'vidaooSessionId':_0x486d5f['id']});})['then'](respondWithResult(_0x49e6c8,null))[_0xb496('0x1f')](handleError(_0x49e6c8,null));};exports[_0xb496('0x62')]=function(_0x539223,_0x4471de){if(_0x539223[_0xb496('0x2f')]['id']){delete _0x539223['body']['id'];}return db[_0xb496('0x34')][_0xb496('0x46')]({'where':{'id':_0x539223[_0xb496('0x3b')]['id']},'include':[{'model':db['CmContact'],'as':_0xb496('0x63')}]})['then'](handleEntityNotFound(_0x4471de,null))[_0xb496('0x28')](saveUpdates(_0x539223[_0xb496('0x2f')],null))['then'](respondWithResult(_0x4471de,null))['catch'](handleError(_0x4471de,null));};exports['abandon']=function(_0x41d088,_0x2ef38b){if(_0x41d088[_0xb496('0x2f')]['id']){delete _0x41d088['body']['id'];}return db[_0xb496('0x34')][_0xb496('0x46')]({'where':{'id':_0x41d088[_0xb496('0x3b')]['id']}})[_0xb496('0x28')](function(_0x811fbd){if(!_0x811fbd){logger[_0xb496('0x1b')](_0xb496('0x64'),'abandon',0x194,_0xb496('0x65'));_0x2ef38b[_0xb496('0x20')](0x194);}else{if(_0x811fbd[_0xb496('0x66')]){throw new db[(_0xb496('0x5a'))][(_0xb496('0x5b'))](_0xb496('0x67'));}}return _0x811fbd;})['then'](function(_0x41565b){if(_0x41565b){return _0x41565b[_0xb496('0x48')]({'closed':_0x41d088[_0xb496('0x2f')][_0xb496('0x68')],'disposition':_0x41d088[_0xb496('0x2f')]['disposition']})[_0xb496('0x28')](function(_0x4784be){return _0x4784be;});}})['then'](function(){return respondWithRpcPromise(_0xb496('0x69'),'abandon',_0x41d088[_0xb496('0x2f')],client9004);})[_0xb496('0x28')](respondWithResult(_0x2ef38b,null))[_0xb496('0x1f')](handleError(_0x2ef38b,null));};exports['attachmentUpload']=function(_0x57d651,_0x5676f4){_0x57d651['body'][_0xb496('0x2b')]=_0x57d651[_0xb496('0x6a')][_0xb496('0x6b')];_0x57d651[_0xb496('0x2f')]['basename']=_0x57d651[_0xb496('0x6a')][_0xb496('0x6c')];_0x57d651[_0xb496('0x2f')][_0xb496('0x37')]=_0x57d651[_0xb496('0x6a')][_0xb496('0x6d')];return db[_0xb496('0x6e')][_0xb496('0x47')](_0x57d651[_0xb496('0x2f')])[_0xb496('0x28')](respondWithResult(_0x5676f4,0xc9))[_0xb496('0x1f')](handleError(_0x5676f4,null));};exports[_0xb496('0x6f')]=function(_0x2aa5cb,_0x2e217b){return db[_0xb496('0x34')][_0xb496('0x4b')]({'where':{'id':_0x2aa5cb[_0xb496('0x3b')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2e217b,null))[_0xb496('0x28')](function(_0x2aa331){if(_0x2aa331){if(_0x2aa331['closed']){return _0x2e217b['status'](0x193)['json']({'status':0x193,'message':_0xb496('0x70')});}return db[_0xb496('0x6e')][_0xb496('0x4b')]({'where':{'id':_0x2aa5cb[_0xb496('0x3e')][_0xb496('0x71')]},'raw':!![]})[_0xb496('0x28')](handleEntityNotFound(_0x2e217b,null));}})['then'](function(_0x15a11c){if(_0x15a11c){var _0x1435ff=_0x15a11c[_0xb496('0x72')]!==null;var _0x4d1e8a=path[_0xb496('0x73')](config[_0xb496('0x74')],_0xb496('0x75'));if(_0x1435ff){_0x4d1e8a=path['join'](_0x4d1e8a,'offline-chat/');}var _0x18c617=path[_0xb496('0x73')](_0x4d1e8a,_0x15a11c[_0xb496('0x76')]);return _0x2e217b[_0xb496('0x77')](_0x18c617);}})[_0xb496('0x1f')](handleError(_0x2e217b,null));};exports[_0xb496('0x78')]=function(_0xfbcd47,_0x444730){var _0x9d3525=null;var _0x3e568b=null;var _0x1a24f5=null;if(_0xfbcd47[_0xb496('0x2f')]['id']){delete _0xfbcd47[_0xb496('0x2f')]['id'];}if(_0xfbcd47[_0xb496('0x2f')][_0xb496('0x79')]){_0x1a24f5=path['join'](config[_0xb496('0x74')],_0xb496('0x7a'),util['format'](_0xb496('0x7b'),Date[_0xb496('0x7c')]()));_0xfbcd47[_0xb496('0x2f')][_0xb496('0x7d')]=_0x1a24f5;}return db[_0xb496('0x34')]['find']({'where':{'id':_0xfbcd47['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0xb496('0x7e'),'include':[{'model':db[_0xb496('0x7f')],'as':'User'}]}]})[_0xb496('0x28')](handleEntityNotFound(_0x444730,null))[_0xb496('0x28')](saveUpdates(_0xfbcd47[_0xb496('0x2f')],null))[_0xb496('0x28')](function(_0x331485){if(_0x331485){_0x9d3525=_0x331485;return db[_0xb496('0x4a')][_0xb496('0x46')]({'where':{'id':_0x9d3525['ChatWebsiteId']}});}})[_0xb496('0x28')](function(_0x495453){if(_0x495453){_0x3e568b=_0x495453;return db['CmContact'][_0xb496('0x46')]({'where':{'id':_0x9d3525[_0xb496('0x80')]}});}})['then'](function(_0x13e2fb){if(_0x13e2fb){if(_0x1a24f5){var _0x14eae2=null;for(var _0x30dd7a=0x1;_0x30dd7a<_0x9d3525[_0xb496('0x7e')][_0xb496('0x43')];++_0x30dd7a){_0x14eae2=_0x9d3525[_0xb496('0x7e')][_0x30dd7a];var _0xb0bd7=_0x14eae2[_0xb496('0x66')]?util['format'](_0xb496('0x81'),_0x3e568b[_0xb496('0x82')],_0x14eae2[_0xb496('0x66')]):_0xb496('0x83');var _0x53214d=_0xfbcd47[_0xb496('0x2f')][_0xb496('0x84')]||util[_0xb496('0x85')]('%s%d',_0xb496('0x86'),_0x14eae2[_0xb496('0x80')]);switch(_0x3e568b['agentIdentifier']){case _0xb496('0x87'):_0xb0bd7=_0x14eae2[_0xb496('0x66')]?util[_0xb496('0x85')](_0xb496('0x81'),_0x3e568b[_0xb496('0x82')],_0x14eae2[_0xb496('0x66')]):_0xb496('0x83');break;case _0xb496('0x88'):_0xb0bd7=_0x14eae2[_0xb496('0x66')]?_0x14eae2['User'][_0xb496('0x89')]||_0x14eae2[_0xb496('0x7f')][_0xb496('0x52')]:_0xb496('0x83');break;case _0xb496('0x8a'):_0xb0bd7=_0x14eae2[_0xb496('0x66')]?_0x14eae2['User'][_0xb496('0x52')]:_0xb496('0x83');break;default:_0xb0bd7=_0x14eae2[_0xb496('0x66')]?util['format']('%s%d',_0x3e568b[_0xb496('0x82')],_0x14eae2[_0xb496('0x66')]):_0xb496('0x83');}var _0x47c77a=util[_0xb496('0x85')](_0xb496('0x8b'),moment(_0x14eae2[_0xb496('0x8c')])[_0xb496('0x85')]('MM/DD/YYYY\x20HH:mm:ss'),_0x14eae2['direction']==='in'?_0x53214d:_0xb0bd7,_0x14eae2[_0xb496('0x2f')]);if(!_0x14eae2[_0xb496('0x8d')]){fs['appendFileSync'](_0x1a24f5,_0x47c77a);}}return db[_0xb496('0x8e')][_0xb496('0x4b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xb496('0x8f'),'raw':!![],'include':[{'model':db[_0xb496('0x90')],'as':_0xb496('0x90'),'raw':!![]}]}]});}}})[_0xb496('0x28')](function(_0x3d2983){if(!_0x3d2983||!_0x3d2983[_0xb496('0x8f')]||!_0xfbcd47['body'])return _0x9d3525;var _0x2e5e4d=_0x3d2983[_0xb496('0x91')]();return respondWithRpcPromise(_0xb496('0x92'),_0xb496('0x93'),{'account':_0x2e5e4d,'message':{'from':util[_0xb496('0x85')]('\x22%s\x22\x20<%s>',_0x3d2983[_0xb496('0x2b')],_0x3d2983['email']||_0x3d2983[_0xb496('0x8f')][_0xb496('0x51')]),'to':_0xfbcd47[_0xb496('0x2f')][_0xb496('0x79')],'subject':_0xb496('0x94'),'text':util['format'](_0xb496('0x95'),_0xfbcd47[_0xb496('0x2f')][_0xb496('0x79')]),'attachments':[{'path':_0x1a24f5}]}})[_0xb496('0x28')](function(){return _0x9d3525;})[_0xb496('0x1f')](function(_0x18e4dd){logger[_0xb496('0x1b')](_0x18e4dd);});})[_0xb496('0x28')](respondWithStatusCode(_0x444730,0xc8))[_0xb496('0x1f')](handleError(_0x444730,null));};exports['addMessage']=function(_0x3b6305,_0x5c9726){return db[_0xb496('0x5f')][_0xb496('0x46')]({'where':{'id':_0x3b6305[_0xb496('0x3b')]['id']}})[_0xb496('0x28')](handleEntityNotFound(_0x5c9726,null))[_0xb496('0x28')](function(_0x562eb1){if(_0x562eb1){return _0x562eb1[_0xb496('0x96')](_0x3b6305[_0xb496('0x2f')][_0xb496('0x97')],_['omit'](_0x3b6305[_0xb496('0x2f')],['ids','id'])||{});}})[_0xb496('0x28')](respondWithResult(_0x5c9726,null))[_0xb496('0x1f')](handleError(_0x5c9726,null));};exports[_0xb496('0x98')]=function(_0x263f68,_0x43de3c){var _0x179c5a={'raw':![],'where':{}};var _0x3e5af5={};var _0x1307e3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb496('0x4b')]({'where':{'id':_0x263f68[_0xb496('0x3b')]['id']}})[_0xb496('0x28')](handleEntityNotFound(_0x43de3c,null))[_0xb496('0x28')](function(_0x285dbb){if(_0x285dbb){_0x3e5af5[_0xb496('0x3c')]=_['keys'](db[_0xb496('0x5f')][_0xb496('0x35')]);_0x3e5af5[_0xb496('0x3e')]=_[_0xb496('0x3d')](_0x263f68[_0xb496('0x3e')]);_0x3e5af5['filters']=_['intersection'](_0x3e5af5[_0xb496('0x3c')],_0x3e5af5[_0xb496('0x3e')]);_0x179c5a[_0xb496('0x40')]=_[_0xb496('0x41')](_0x3e5af5[_0xb496('0x3c')],qs[_0xb496('0x42')](_0x263f68[_0xb496('0x3e')][_0xb496('0x42')]));_0x179c5a['attributes']=_0x179c5a[_0xb496('0x40')]['length']?_0x179c5a[_0xb496('0x40')]:_0x3e5af5[_0xb496('0x3c')];if(!_0x263f68[_0xb496('0x3e')][_0xb496('0x99')](_0xb496('0x9a'))){_0x179c5a['limit']=qs[_0xb496('0x26')](_0x263f68[_0xb496('0x3e')][_0xb496('0x26')]);_0x179c5a[_0xb496('0x24')]=qs[_0xb496('0x24')](_0x263f68['query'][_0xb496('0x24')]);}_0x179c5a[_0xb496('0x9b')]=qs[_0xb496('0x9c')](_0x263f68[_0xb496('0x3e')][_0xb496('0x9c')]);_0x179c5a[_0xb496('0x9d')]=qs['filters'](_['pick'](_0x263f68[_0xb496('0x3e')],_0x3e5af5[_0xb496('0x3f')]));_0x179c5a['where'][_0xb496('0x9e')]=_0x285dbb['id'];if(_0x263f68[_0xb496('0x3e')][_0xb496('0x9f')]){_0x179c5a[_0xb496('0x9d')]=_[_0xb496('0x2e')](_0x179c5a[_0xb496('0x9d')],{'$or':_['map'](_0x179c5a['attributes'],function(_0x6681b8){var _0x5be0c7={};_0x5be0c7[_0x6681b8]={'$like':'%'+_0x263f68['query'][_0xb496('0x9f')]+'%'};return _0x5be0c7;})});}if(_0x263f68[_0xb496('0x3e')][_0xb496('0xa0')]){var _0x3c4079=_0x263f68[_0xb496('0x3e')][_0xb496('0xa0')][_0xb496('0xa1')](',');var _0x440160={};_0x440160[_0x3c4079[0x0]]={'$gte':moment(_0x3c4079[0x1])[_0xb496('0x85')](_0xb496('0xa2'))};_0x179c5a[_0xb496('0x9d')]=_['merge'](_0x179c5a[_0xb496('0x9d')],_0x440160);}_0x179c5a=_[_0xb496('0x2e')]({},_0x179c5a,_0x263f68[_0xb496('0x45')]);return db[_0xb496('0x5f')]['count']({'where':_0x179c5a[_0xb496('0x9d')]})[_0xb496('0x28')](function(_0x3d40f4){_0x1307e3[_0xb496('0xa3')]=_0x3d40f4;if(_0x263f68[_0xb496('0x3e')][_0xb496('0x44')]){_0x179c5a['include']=[{'all':!![]}];}return db[_0xb496('0x5f')][_0xb496('0xa4')](_0x179c5a);})[_0xb496('0x28')](function(_0x5e398a){_0x1307e3[_0xb496('0xa5')]=_0x5e398a;return _0x1307e3;});}})[_0xb496('0x28')](respondWithFilteredResult(_0x43de3c,_0x179c5a))[_0xb496('0x1f')](handleError(_0x43de3c,null));};exports[_0xb496('0xa6')]=function(_0x5c992d,_0x16c150){var _0x4b0083={'where':{}},_0x5b70f1={},_0x51d08e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb496('0x4b')]({'where':{'id':_0x5c992d[_0xb496('0x3b')]['id']}})[_0xb496('0x28')](handleEntityNotFound(_0x16c150,null))[_0xb496('0x28')](function(_0x202e3f){if(_0x202e3f){_0x5b70f1[_0xb496('0x3c')]=_[_0xb496('0x3d')](db[_0xb496('0x5f')][_0xb496('0x35')]);_0x5b70f1[_0xb496('0x3e')]=_['keys'](_0x5c992d[_0xb496('0x3e')]);_0x5b70f1[_0xb496('0x3f')]=_[_0xb496('0x41')](_0x5b70f1[_0xb496('0x3c')],_0x5b70f1['query']);_0x4b0083[_0xb496('0x40')]=_[_0xb496('0x41')](_0x5b70f1[_0xb496('0x3c')],qs[_0xb496('0x42')](_0x5c992d[_0xb496('0x3e')]['fields']));_0x4b0083[_0xb496('0x40')]=_0x4b0083['attributes']['length']?_0x4b0083['attributes']:_0x5b70f1[_0xb496('0x3c')];if(!_0x5c992d['query'][_0xb496('0x99')]('nolimit')){_0x4b0083[_0xb496('0x26')]=qs['limit'](_0x5c992d[_0xb496('0x3e')][_0xb496('0x26')]);_0x4b0083['offset']=qs[_0xb496('0x24')](_0x5c992d['query'][_0xb496('0x24')]);}_0x4b0083[_0xb496('0x9b')]=qs['sort'](_0x5c992d[_0xb496('0x3e')][_0xb496('0x9c')]);_0x4b0083[_0xb496('0x9d')]=qs[_0xb496('0x3f')](_[_0xb496('0xa7')](_0x5c992d[_0xb496('0x3e')],_0x5b70f1['filters']));_0x4b0083[_0xb496('0x9d')][_0xb496('0x9e')]=_0x202e3f['id'];if(_0x5c992d[_0xb496('0x3e')][_0xb496('0x9f')]){_0x4b0083[_0xb496('0x9d')]=_[_0xb496('0x2e')](_0x4b0083[_0xb496('0x9d')],{'$or':_['map'](_0x4b0083[_0xb496('0x40')],function(_0x594326){var _0xa62510={};_0xa62510[_0x594326]={'$like':'%'+_0x5c992d[_0xb496('0x3e')][_0xb496('0x9f')]+'%'};return _0xa62510;})});}_0x4b0083[_0xb496('0x9d')][_0xb496('0x8d')]=![];if(_0x5c992d[_0xb496('0x3e')]['id']){_0x4b0083[_0xb496('0x9d')]['id']={'$gt':_0x5c992d[_0xb496('0x3e')]['id']};}_0x4b0083=_[_0xb496('0x2e')]({},_0x4b0083,_0x5c992d[_0xb496('0x45')]);return db[_0xb496('0x5f')][_0xb496('0xa3')]({'where':_0x4b0083[_0xb496('0x9d')]})[_0xb496('0x28')](function(_0x552704){_0x51d08e[_0xb496('0xa3')]=_0x552704;_0x4b0083[_0xb496('0xa8')]=[];if(_0x5c992d[_0xb496('0x3e')][_0xb496('0xa9')]){_0x4b0083[_0xb496('0xa8')][_0xb496('0xaa')]({'model':db[_0xb496('0x7f')],'as':_0xb496('0x7f'),'attributes':['id',_0xb496('0x52'),_0xb496('0x89')]});}if(_0x5c992d[_0xb496('0x3e')][_0xb496('0x44')]){_0x4b0083[_0xb496('0xa8')]=[{'all':!![]}];}return db[_0xb496('0x5f')]['findAll'](_0x4b0083);})[_0xb496('0x28')](function(_0x5228c2){_0x51d08e[_0xb496('0xa5')]=_0x5228c2;return _0x51d08e;});}})[_0xb496('0x28')](respondWithFilteredResult(_0x16c150,_0x4b0083))[_0xb496('0x1f')](handleError(_0x16c150,null));};exports[_0xb496('0xab')]=function(_0x1d6ce3,_0x5e76dc){return db['ChatInteraction'][_0xb496('0x46')]({'where':{'id':_0x1d6ce3['params']['id']}})['then'](handleEntityNotFound(_0x5e76dc,null))[_0xb496('0x28')](function(_0x5ba307){if(_0x5ba307){return _0x5ba307[_0xb496('0xac')](_0x1d6ce3[_0xb496('0x2f')][_0xb496('0x97')],_[_0xb496('0xad')](_0x1d6ce3[_0xb496('0x2f')],[_0xb496('0x97'),'id'])||{})[_0xb496('0xae')](function(){return db[_0xb496('0xaf')][_0xb496('0xa4')]({'attributes':['id',_0xb496('0x2b'),_0xb496('0xb0')],'where':{'id':_0x1d6ce3[_0xb496('0x2f')][_0xb496('0x97')]}});})[_0xb496('0x28')](function(_0x4f7b3b){socket[_0xb496('0xb1')](_0xb496('0xb2'),{'id':Number(_0x1d6ce3[_0xb496('0x3b')]['id']),'tags':_0x4f7b3b||[]});return{'id':Number(_0x1d6ce3[_0xb496('0x3b')]['id']),'tags':_0x4f7b3b||[]};});}})[_0xb496('0x28')](respondWithResult(_0x5e76dc,null))['catch'](handleError(_0x5e76dc,null));};exports[_0xb496('0xb3')]=function(_0x48e5fd,_0x3b6fe7){return db[_0xb496('0x34')]['find']({'where':{'id':_0x48e5fd[_0xb496('0x3b')]['id']}})[_0xb496('0x28')](handleEntityNotFound(_0x3b6fe7,null))['then'](function(_0x1aa2aa){if(_0x1aa2aa){return _0x1aa2aa[_0xb496('0xb3')](_0x48e5fd[_0xb496('0x3e')][_0xb496('0x97')]);}})[_0xb496('0x28')](respondWithStatusCode(_0x3b6fe7,null))[_0xb496('0x1f')](handleError(_0x3b6fe7,null));};exports[_0xb496('0x77')]=function(_0x28fb01,_0x5ab8d8){var _0x558077=moment()[_0xb496('0xb4')]()[_0xb496('0xb5')]();var _0x3e5882=path[_0xb496('0x73')](config['root'],_0xb496('0xb6'),_0xb496('0xb7'),'tmp');var _0x538831=path[_0xb496('0x73')](config[_0xb496('0x74')],_0xb496('0xb6'),'files',_0xb496('0xb8'));var _0x4c629b=path['join'](_0x3e5882,_0x558077);var _0xef9757=util[_0xb496('0x85')](_0xb496('0xb9'),_0x28fb01['params']['id'],_0x558077);var _0x484ebf=path[_0xb496('0x73')](_0x3e5882,_0xef9757);var _0x514803=[];_0x514803['push']({'model':db[_0xb496('0x7f')],'as':_0xb496('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x514803[_0xb496('0xaa')]({'model':db[_0xb496('0xba')],'as':'Contact','attributes':['id',_0xb496('0xbb'),_0xb496('0xbc')],'raw':!![]});if(_0x28fb01[_0xb496('0x3e')][_0xb496('0xb8')]){_0x514803[_0xb496('0xaa')]({'model':db[_0xb496('0x6e')],'as':_0xb496('0x6e'),'raw':!![]});}var _0x28f780=[{'model':db['ChatMessage'],'as':_0xb496('0x7e'),'attributes':['id',_0xb496('0x2f'),_0xb496('0x8c'),_0xb496('0xbd'),_0xb496('0x8d'),'read'],'include':_0x514803}];_0x28f780[_0xb496('0xaa')]({'model':db[_0xb496('0x4a')],'as':_0xb496('0xbe'),'attributes':['id','name']});_0x28f780['push']({'model':db['User'],'as':_0xb496('0xbf'),'attributes':['id',_0xb496('0x52')]});return db[_0xb496('0x34')]['find']({'where':{'id':_0x28fb01[_0xb496('0x3b')]['id']},'include':_0x28f780})[_0xb496('0x28')](handleEntityNotFound(_0x5ab8d8,null))['then'](function(_0x4c3eb8){if(_0x4c3eb8){var _0x5738b8=_0x4c3eb8['get']({'plain':!![]});fs[_0xb496('0xc0')](_0x4c629b);var _0xab1592={'channel':_0xb496('0xc1'),'account':_0x5738b8[_0xb496('0xbe')][_0xb496('0x2b')],'agent':_0x5738b8[_0xb496('0xbf')]?_0x5738b8[_0xb496('0xbf')][_0xb496('0x52')]:'N.A.','createdAt':moment(_0x5738b8[_0xb496('0x8c')])[_0xb496('0x85')](_0xb496('0xa2'))['toString'](),'closedAt':_0x5738b8[_0xb496('0x68')]?moment(_0x5738b8[_0xb496('0xc2')])[_0xb496('0x85')](_0xb496('0xa2'))[_0xb496('0xb5')]():'','disposition':_0x5738b8[_0xb496('0xc3')],'chatInfo':{'browser':_0x5738b8[_0xb496('0xc4')],'os':_0x5738b8[_0xb496('0xc5')],'referer':_0x5738b8[_0xb496('0xc6')],'customerIp':_0x5738b8[_0xb496('0xc7')],'customerPort':_0x5738b8[_0xb496('0xc8')]?_0x5738b8[_0xb496('0xc8')]:'N.A.'},'messages':_(_0x5738b8[_0xb496('0x7e')])[_0xb496('0xc9')]()[_0xb496('0x9f')]({'secret':![]})[_0xb496('0xca')](function(_0x18a945){if(_0x18a945[_0xb496('0x6e')]){var _0x30582a=path[_0xb496('0x73')](_0x538831,_0x18a945['Attachment'][_0xb496('0x76')]);if(fs['existsSync'](_0x30582a)){fs[_0xb496('0xcb')](_0x30582a)['pipe'](fs['createWriteStream'](path[_0xb496('0x73')](_0x4c629b,_0x18a945[_0xb496('0x6e')][_0xb496('0x76')])));}}return{'date':moment(_0x18a945[_0xb496('0x8c')])[_0xb496('0x85')](_0xb496('0xa2'))[_0xb496('0xb5')](),'sender':_0x18a945[_0xb496('0xbd')]==='out'?_0x18a945['User']?_0x18a945['User'][_0xb496('0x52')]:_0xb496('0x83'):_0x18a945[_0xb496('0x63')][_0xb496('0xbb')]+(_0x18a945[_0xb496('0x63')][_0xb496('0xbc')]?'\x20'+_0x18a945['Contact'][_0xb496('0xbc')]:''),'body':_0x18a945[_0xb496('0x6e')]?_0x18a945['Attachment'][_0xb496('0x76')]:_0x18a945['body'],'direction':_0x18a945[_0xb496('0xbd')]===_0xb496('0x5e')?'A':'C','secret':_0x18a945[_0xb496('0x8d')],'read':_0x18a945[_0xb496('0xcc')],'attachment':_0x18a945['Attachment']};})['value']()};return ejs[_0xb496('0xcd')](path[_0xb496('0x73')](config[_0xb496('0x74')],_0xb496('0xb6'),'views',_0xb496('0xce')),{'interaction':_0xab1592})[_0xb496('0x28')](function(_0x20b0c7){var _0x3440bb=path[_0xb496('0x73')](_0x4c629b,'transcript-'+_0x5738b8['id']+'-'+_0x558077+_0xb496('0xcf'));var _0x22eaed={'path':_0x3440bb,'channel':_0xb496('0xc1'),'interactionId':_0x5738b8['id']};return pdf['createPdfFromHTML'](_0x20b0c7,_0x22eaed);})[_0xb496('0x28')](function(){return new Promise(function(_0x249f38,_0xc88199){zipdir(_0x4c629b,{'saveTo':_0x484ebf},function(_0x41d308,_0x29e20b){if(_0x41d308)return _0xc88199(_0x41d308);return _0x249f38(_0x29e20b);});})[_0xb496('0x28')](function(){return new BPromise(function(_0x5e1cb6,_0x4e68e1){rimraf(_0x4c629b,function(_0x15119a){if(_0x15119a)_0x4e68e1(_0x15119a);return _0x5e1cb6();});});})[_0xb496('0x28')](function(){return _0x5ab8d8[_0xb496('0x77')](_0x484ebf,_0xef9757,function(_0x3b0dff){if(_0x3b0dff){logger['error'](_0xb496('0xd0'),_0x3b0dff);}else{fs['unlinkSync'](_0x484ebf);}});});});}else{return _0x5ab8d8[_0xb496('0x20')](0xc8);}})[_0xb496('0x1f')](handleError(_0x5ab8d8,null));}; \ No newline at end of file +var _0x5e05=['closedAt','browserName','referer','customerPort','tail','createReadStream','createWriteStream','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','name','send','render','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','key','getOptions','findAll','chat','query','show','params','model','keys','ChatInteraction','filters','intersection','attributes','fields','includeAll','options','find','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsiteId','ContactId','length','%s%d','System','customer','Visitor','agentIdentifier','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','CloudProvider','Smtp','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','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','nolimit','ChatInteractionId','include','push','setTags','spread','Tag','color','emit','chatInteractionTags:save','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','read','Account','get','mkdirSync','Chat','Owner','N.A.','toString'];(function(_0x668119,_0x1f8960){var _0x44719a=function(_0x5d2bc7){while(--_0x5d2bc7){_0x668119['push'](_0x668119['shift']());}};_0x44719a(++_0x1f8960);}(_0x5e05,0x1af));var _0x55e0=function(_0x1a1ab8,_0x53ccf4){_0x1a1ab8=_0x1a1ab8-0x0;var _0x46bbef=_0x5e05[_0x1a1ab8];return _0x46bbef;};'use strict';var rimraf=require(_0x55e0('0x0'));var zipdir=require(_0x55e0('0x1'));var rp=require(_0x55e0('0x2'));var moment=require(_0x55e0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x55e0('0x4'));var path=require(_0x55e0('0x5'));var ejs=require(_0x55e0('0x6'));var fs=require('fs');var _=require(_0x55e0('0x7'));var Redis=require(_0x55e0('0x8'));var interaction=require(_0x55e0('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x55e0('0xa'));var logger=require(_0x55e0('0xb'))(_0x55e0('0xc'));var config=require('../../config/environment');var db=require(_0x55e0('0xd'))['db'];config[_0x55e0('0xe')]=_[_0x55e0('0xf')](config['redis'],{'host':_0x55e0('0x10'),'port':0x18eb});var socket=require(_0x55e0('0x11'))(new Redis(config['redis']));require(_0x55e0('0x12'))[_0x55e0('0x13')](socket);var jayson=require(_0x55e0('0x14'));var client=jayson[_0x55e0('0x15')][_0x55e0('0x16')]({'port':0x232b});var client9004=jayson[_0x55e0('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4536b6,_0x84cf52,_0x1bc38b,_0x28a3cb){return new BPromise(function(_0x190c5c,_0x49deff){var _0x5efab2=_0x28a3cb||client;return _0x5efab2[_0x55e0('0x17')](_0x4536b6,_0x1bc38b)[_0x55e0('0x18')](function(_0x27a865){logger['info'](_0x55e0('0x19'),_0x84cf52,_0x55e0('0x1a'));logger['debug'](_0x55e0('0x1b'),_0x84cf52,_0x55e0('0x1a'),JSON[_0x55e0('0x1c')](_0x27a865));if(_0x27a865[_0x55e0('0x1d')]){if(_0x27a865[_0x55e0('0x1d')][_0x55e0('0x1e')]===0x1f4){logger[_0x55e0('0x1d')](_0x55e0('0x19'),_0x84cf52,_0x27a865[_0x55e0('0x1d')][_0x55e0('0x1f')]);return _0x49deff(_0x27a865[_0x55e0('0x1d')][_0x55e0('0x1f')]);}logger[_0x55e0('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x84cf52,_0x27a865['error'][_0x55e0('0x1f')]);return _0x190c5c(_0x27a865[_0x55e0('0x1d')][_0x55e0('0x1f')]);}else{logger[_0x55e0('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x84cf52,'request\x20sent');_0x190c5c(_0x27a865[_0x55e0('0x21')]['message']);}})[_0x55e0('0x22')](function(_0x3227e7){logger[_0x55e0('0x1d')](_0x55e0('0x19'),_0x84cf52,_0x3227e7);_0x49deff(_0x3227e7);});});}function respondWithStatusCode(_0xc921be,_0x132700){_0x132700=_0x132700||0xcc;return function(_0x1987cf){if(_0x1987cf){return _0xc921be[_0x55e0('0x23')](_0x132700);}return _0xc921be[_0x55e0('0x24')](_0x132700)[_0x55e0('0x25')]();};}function respondWithResult(_0x7051dd,_0x540d6a){_0x540d6a=_0x540d6a||0xc8;return function(_0x549ed7){if(_0x549ed7){return _0x7051dd[_0x55e0('0x24')](_0x540d6a)[_0x55e0('0x26')](_0x549ed7);}};}function respondWithFilteredResult(_0x3d4cdd,_0x336808){return function(_0x316878){if(_0x316878){var _0x2fc6d0=typeof _0x336808[_0x55e0('0x27')]===_0x55e0('0x28')&&typeof _0x336808[_0x55e0('0x29')]===_0x55e0('0x28');var _0x8d7119=_0x316878[_0x55e0('0x2a')];var _0x4cee6f=_0x2fc6d0?0x0:_0x336808[_0x55e0('0x27')];var _0x3937d1=_0x2fc6d0?_0x316878['count']:_0x336808[_0x55e0('0x27')]+_0x336808[_0x55e0('0x29')];var _0x32d0d8;if(_0x3937d1>=_0x8d7119){_0x3937d1=_0x8d7119;_0x32d0d8=0xc8;}else{_0x32d0d8=0xce;}_0x3d4cdd[_0x55e0('0x24')](_0x32d0d8);return _0x3d4cdd[_0x55e0('0x2b')](_0x55e0('0x2c'),_0x4cee6f+'-'+_0x3937d1+'/'+_0x8d7119)[_0x55e0('0x26')](_0x316878);}return null;};}function saveUpdates(_0x514fb1){return function(_0x5c6cc1){if(_0x5c6cc1){return _0x5c6cc1[_0x55e0('0x2d')](_0x514fb1)['then'](function(_0x2c8b07){return _0x2c8b07;});}return null;};}function removeEntity(_0x441188){return function(_0x2752c4){if(_0x2752c4){return _0x2752c4[_0x55e0('0x2e')]()[_0x55e0('0x18')](function(){_0x441188[_0x55e0('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49afea){return function(_0x69717e){if(!_0x69717e){_0x49afea[_0x55e0('0x23')](0x194);}return _0x69717e;};}function handleError(_0x45cab6,_0x1e749c){_0x1e749c=_0x1e749c||0x1f4;return function(_0x49e4ea){logger[_0x55e0('0x1d')](_0x49e4ea['stack']);if(_0x49e4ea[_0x55e0('0x2f')]){delete _0x49e4ea[_0x55e0('0x2f')];}_0x45cab6['status'](_0x1e749c)[_0x55e0('0x30')](_0x49e4ea);};}function getMustacheRender(_0x43c351,_0x566618){return Mustache[_0x55e0('0x31')](_0x43c351,_[_0x55e0('0x32')](_0x566618[_0x55e0('0x33')],{'contact':_0x566618[_0x55e0('0x34')],'message':_0x566618[_0x55e0('0x1f')],'agent':_0x566618[_0x55e0('0x35')],'interaction':_0x566618[_0x55e0('0x36')],'account':_0x566618[_0x55e0('0x37')]}))||'';}exports[_0x55e0('0x38')]=function(_0x33173a,_0x29e435){var _0xcff479={};var _0x26e749=_[_0x55e0('0x39')](db['ChatInteraction'][_0x55e0('0x3a')],function(_0x3ac991){return{'name':_0x3ac991[_0x55e0('0x3b')],'type':_0x3ac991['type'][_0x55e0('0x3c')]};});_0xcff479=qs[_0x55e0('0x3d')](_0x26e749,_0x33173a);return interaction[_0x55e0('0x3e')](_0x55e0('0x3f'),_0x33173a[_0x55e0('0x40')],_0x33173a['user'],_0xcff479,_0x26e749)[_0x55e0('0x18')](respondWithFilteredResult(_0x29e435,_0xcff479))[_0x55e0('0x22')](handleError(_0x29e435,null));};exports[_0x55e0('0x41')]=function(_0x433785,_0x508b91){var _0x1d8041={'raw':![],'where':{'id':_0x433785[_0x55e0('0x42')]['id']}},_0x50aa87={};_0x50aa87[_0x55e0('0x43')]=_[_0x55e0('0x44')](db[_0x55e0('0x45')]['rawAttributes']);_0x50aa87[_0x55e0('0x40')]=_['keys'](_0x433785['query']);_0x50aa87[_0x55e0('0x46')]=_[_0x55e0('0x47')](_0x50aa87[_0x55e0('0x43')],_0x50aa87['query']);_0x1d8041[_0x55e0('0x48')]=_[_0x55e0('0x47')](_0x50aa87[_0x55e0('0x43')],qs[_0x55e0('0x49')](_0x433785[_0x55e0('0x40')][_0x55e0('0x49')]));_0x1d8041['attributes']=_0x1d8041[_0x55e0('0x48')]['length']?_0x1d8041['attributes']:_0x50aa87[_0x55e0('0x43')];if(_0x433785['query'][_0x55e0('0x4a')]){_0x1d8041['include']=[{'all':!![]}];}_0x1d8041=_[_0x55e0('0x32')]({},_0x1d8041,_0x433785[_0x55e0('0x4b')]);return db[_0x55e0('0x45')][_0x55e0('0x4c')](_0x1d8041)[_0x55e0('0x18')](handleEntityNotFound(_0x508b91,null))[_0x55e0('0x18')](respondWithResult(_0x508b91,null))[_0x55e0('0x22')](handleError(_0x508b91,null));};exports['create']=function(_0x3c4804,_0x191a52){return db[_0x55e0('0x45')][_0x55e0('0x4d')](_0x3c4804[_0x55e0('0x33')],{})['then'](respondWithResult(_0x191a52,0xc9))[_0x55e0('0x22')](handleError(_0x191a52,null));};exports[_0x55e0('0x2d')]=function(_0x3ceae4,_0x13f6d4){if(_0x3ceae4[_0x55e0('0x33')]['id']){delete _0x3ceae4[_0x55e0('0x33')]['id'];}return db[_0x55e0('0x45')][_0x55e0('0x4c')]({'where':{'id':_0x3ceae4[_0x55e0('0x42')]['id']}})[_0x55e0('0x18')](handleEntityNotFound(_0x13f6d4,null))['then'](saveUpdates(_0x3ceae4[_0x55e0('0x33')],null))[_0x55e0('0x18')](respondWithResult(_0x13f6d4,null))[_0x55e0('0x22')](handleError(_0x13f6d4,null));};exports[_0x55e0('0x2e')]=function(_0x38eeff,_0x51ab44){return db[_0x55e0('0x45')][_0x55e0('0x4c')]({'where':{'id':_0x38eeff[_0x55e0('0x42')]['id']}})[_0x55e0('0x18')](handleEntityNotFound(_0x51ab44,null))[_0x55e0('0x18')](removeEntity(_0x51ab44,null))[_0x55e0('0x22')](handleError(_0x51ab44,null));};exports['describe']=function(_0x3e7f69,_0x2d50a5){return db[_0x55e0('0x45')][_0x55e0('0x4e')]()[_0x55e0('0x18')](respondWithResult(_0x2d50a5,null))[_0x55e0('0x22')](handleError(_0x2d50a5,null));};exports['createVidaooSession']=function(_0x1b5753,_0x3e9a93){var _0x5da139=_0x1b5753[_0x55e0('0x42')]['id'];var _0x1504e9;var _0x25cc6a;var _0x187744;return db['ChatInteraction']['findOne']({'where':{'id':_0x5da139}})[_0x55e0('0x18')](function(_0x26f37d){_0x1504e9=_0x26f37d;return db[_0x55e0('0x4f')][_0x55e0('0x50')]({'where':{'id':_0x26f37d['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x55e0('0x51'),_0x55e0('0x52'),_0x55e0('0x53'),_0x55e0('0x54')],'raw':!![]});})[_0x55e0('0x18')](function(_0x13340d){if(_0x13340d&&_0x13340d[_0x55e0('0x55')]&&_0x13340d['vidaooEscalation']){_0x25cc6a=_0x13340d;var _0xa0923={'interaction':{'id':_0x5da139},'agent':{'id':_0x1b5753[_0x55e0('0x56')]['id'],'name':_0x1b5753[_0x55e0('0x56')][_0x55e0('0x2f')],'fullname':_0x1b5753['user'][_0x55e0('0x57')],'email':_0x1b5753[_0x55e0('0x56')][_0x55e0('0x58')]},'contact':_0x1b5753[_0x55e0('0x33')][_0x55e0('0x34')],'account':_0x1b5753[_0x55e0('0x33')][_0x55e0('0x37')]};var _0x15532e={'rejectUnauthorized':![],'method':_0x55e0('0x59'),'url':_0x55e0('0x5a'),'headers':{'X-APIKEY':_0x13340d[_0x55e0('0x55')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1b5753[_0x55e0('0x56')][_0x55e0('0x58')]],'buttons':null,'topic':_0x25cc6a[_0x55e0('0x52')],'note':_['isNull'](_0x25cc6a[_0x55e0('0x53')])?null:getMustacheRender(_0x25cc6a['vidaooNote'],_0xa0923),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x55e0('0x5b')](_0x25cc6a['vidaooMetadata'])){var _0xaaacb7=getMustacheRender(_0x25cc6a['vidaooMetadata'],_0xa0923);var _0xa514=JSON[_0x55e0('0x5c')](_0xaaacb7);_0x15532e['body']['metadata']=_0xa514;}}catch(_0x2a7b8e){throw new db[(_0x55e0('0x5d'))][(_0x55e0('0x5e'))](_0x55e0('0x5f'));}return rp(_0x15532e);}else{throw new db[(_0x55e0('0x5d'))][(_0x55e0('0x5e'))](_0x55e0('0x60'));}})[_0x55e0('0x18')](function(_0xcf2456){_0x187744=_0xcf2456;if(_0x187744['id']){var _0x1c1269={'body':_0x187744[_0x55e0('0x61')],'ChatWebsiteId':_0x25cc6a['id'],'ChatInteractionId':_0x1504e9['id'],'direction':_0x55e0('0x62'),'UserId':_0x1b5753[_0x55e0('0x56')]['id']};return db[_0x55e0('0x63')][_0x55e0('0x4d')](_0x1c1269,{});}else{throw new db[(_0x55e0('0x5d'))][(_0x55e0('0x5e'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x55e0('0x18')](function(){return _0x1504e9[_0x55e0('0x64')]({'vidaooSessionId':_0x187744['id']});})[_0x55e0('0x18')](respondWithResult(_0x3e9a93,null))[_0x55e0('0x22')](handleError(_0x3e9a93,null));};exports[_0x55e0('0x65')]=function(_0xa88aac,_0xefb4f9){if(_0xa88aac['body']['id']){delete _0xa88aac[_0x55e0('0x33')]['id'];}return db[_0x55e0('0x45')][_0x55e0('0x4c')]({'where':{'id':_0xa88aac[_0x55e0('0x42')]['id']},'include':[{'model':db[_0x55e0('0x66')],'as':_0x55e0('0x67')}]})[_0x55e0('0x18')](handleEntityNotFound(_0xefb4f9,null))[_0x55e0('0x18')](saveUpdates(_0xa88aac[_0x55e0('0x33')],null))[_0x55e0('0x18')](respondWithResult(_0xefb4f9,null))[_0x55e0('0x22')](handleError(_0xefb4f9,null));};exports['abandon']=function(_0x4efb45,_0x55f4f5){if(_0x4efb45[_0x55e0('0x33')]['id']){delete _0x4efb45['body']['id'];}return db[_0x55e0('0x45')]['find']({'where':{'id':_0x4efb45[_0x55e0('0x42')]['id']}})[_0x55e0('0x18')](function(_0x3f3952){if(!_0x3f3952){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x55e0('0x68'),0x194,_0x55e0('0x69'));_0x55f4f5[_0x55e0('0x23')](0x194);}else{if(_0x3f3952[_0x55e0('0x6a')]){throw new db[(_0x55e0('0x5d'))][(_0x55e0('0x5e'))](_0x55e0('0x6b'));}}return _0x3f3952;})[_0x55e0('0x18')](function(_0x508a15){if(_0x508a15){return _0x508a15[_0x55e0('0x2d')]({'closed':_0x4efb45['body']['closed'],'disposition':_0x4efb45[_0x55e0('0x33')][_0x55e0('0x6c')]})[_0x55e0('0x18')](function(_0x79b77d){return _0x79b77d;});}})[_0x55e0('0x18')](function(){return respondWithRpcPromise(_0x55e0('0x6d'),_0x55e0('0x68'),_0x4efb45[_0x55e0('0x33')],client9004);})[_0x55e0('0x18')](respondWithResult(_0x55f4f5,null))[_0x55e0('0x22')](handleError(_0x55f4f5,null));};exports[_0x55e0('0x6e')]=function(_0x289254,_0x48ed1f){_0x289254[_0x55e0('0x33')][_0x55e0('0x2f')]=_0x289254[_0x55e0('0x6f')]['originalname'];_0x289254[_0x55e0('0x33')][_0x55e0('0x70')]=_0x289254['file'][_0x55e0('0x71')];_0x289254[_0x55e0('0x33')]['type']=_0x289254[_0x55e0('0x6f')][_0x55e0('0x72')];return db[_0x55e0('0x73')]['create'](_0x289254[_0x55e0('0x33')])[_0x55e0('0x18')](respondWithResult(_0x48ed1f,0xc9))[_0x55e0('0x22')](handleError(_0x48ed1f,null));};exports[_0x55e0('0x74')]=function(_0x13914c,_0x248a25){return db[_0x55e0('0x45')]['findOne']({'where':{'id':_0x13914c['params']['id']},'raw':!![]})[_0x55e0('0x18')](handleEntityNotFound(_0x248a25,null))['then'](function(_0x51d353){if(_0x51d353){if(_0x51d353[_0x55e0('0x75')]){return _0x248a25[_0x55e0('0x24')](0x193)[_0x55e0('0x26')]({'status':0x193,'message':_0x55e0('0x76')});}return db['Attachment'][_0x55e0('0x50')]({'where':{'id':_0x13914c[_0x55e0('0x40')][_0x55e0('0x77')]},'raw':!![]})[_0x55e0('0x18')](handleEntityNotFound(_0x248a25,null));}})['then'](function(_0x1f7d9c){if(_0x1f7d9c){var _0x4b645e=_0x1f7d9c[_0x55e0('0x78')]!==null;var _0x6d5f10=path[_0x55e0('0x79')](config[_0x55e0('0x7a')],_0x55e0('0x7b'));if(_0x4b645e){_0x6d5f10=path[_0x55e0('0x79')](_0x6d5f10,_0x55e0('0x7c'));}var _0x11f701=path[_0x55e0('0x79')](_0x6d5f10,_0x1f7d9c[_0x55e0('0x70')]);return _0x248a25[_0x55e0('0x7d')](_0x11f701);}})[_0x55e0('0x22')](handleError(_0x248a25,null));};exports['close']=function(_0x4dabb1,_0xbb51ff){var _0x510ae9=null;var _0xf50579=null;var _0x36fbb5=null;if(_0x4dabb1[_0x55e0('0x33')]['id']){delete _0x4dabb1[_0x55e0('0x33')]['id'];}if(_0x4dabb1[_0x55e0('0x33')]['mailTranscript']){_0x36fbb5=path['join'](config['root'],'server/files/chat/upload/',util[_0x55e0('0x7e')](_0x55e0('0x7f'),Date['now']()));_0x4dabb1['body'][_0x55e0('0x80')]=_0x36fbb5;}return db[_0x55e0('0x45')][_0x55e0('0x4c')]({'where':{'id':_0x4dabb1[_0x55e0('0x42')]['id']},'include':[{'model':db[_0x55e0('0x63')],'as':_0x55e0('0x81'),'include':[{'model':db[_0x55e0('0x82')],'as':_0x55e0('0x82')}]}]})[_0x55e0('0x18')](handleEntityNotFound(_0xbb51ff,null))[_0x55e0('0x18')](saveUpdates(_0x4dabb1['body'],null))[_0x55e0('0x18')](function(_0x6dc4c2){if(_0x6dc4c2){_0x510ae9=_0x6dc4c2;return db['ChatWebsite'][_0x55e0('0x4c')]({'where':{'id':_0x510ae9[_0x55e0('0x83')]}});}})[_0x55e0('0x18')](function(_0x3147e5){if(_0x3147e5){_0xf50579=_0x3147e5;return db[_0x55e0('0x66')]['find']({'where':{'id':_0x510ae9[_0x55e0('0x84')]}});}})[_0x55e0('0x18')](function(_0x49be7d){if(_0x49be7d){if(_0x36fbb5){var _0x2a58fa=null;for(var _0x3f01ca=0x1;_0x3f01ca<_0x510ae9[_0x55e0('0x81')][_0x55e0('0x85')];++_0x3f01ca){_0x2a58fa=_0x510ae9[_0x55e0('0x81')][_0x3f01ca];var _0x2275e1=_0x2a58fa['UserId']?util[_0x55e0('0x7e')](_0x55e0('0x86'),_0xf50579['agentAlias'],_0x2a58fa[_0x55e0('0x6a')]):_0x55e0('0x87');var _0x432df9=_0x4dabb1[_0x55e0('0x33')][_0x55e0('0x88')]||util[_0x55e0('0x7e')](_0x55e0('0x86'),_0x55e0('0x89'),_0x2a58fa[_0x55e0('0x84')]);switch(_0xf50579[_0x55e0('0x8a')]){case'website_alias':_0x2275e1=_0x2a58fa[_0x55e0('0x6a')]?util['format']('%s%d',_0xf50579[_0x55e0('0x8b')],_0x2a58fa[_0x55e0('0x6a')]):'System';break;case _0x55e0('0x8c'):_0x2275e1=_0x2a58fa[_0x55e0('0x6a')]?_0x2a58fa[_0x55e0('0x82')][_0x55e0('0x8d')]||_0x2a58fa[_0x55e0('0x82')][_0x55e0('0x57')]:_0x55e0('0x87');break;case _0x55e0('0x8e'):_0x2275e1=_0x2a58fa[_0x55e0('0x6a')]?_0x2a58fa[_0x55e0('0x82')][_0x55e0('0x57')]:'System';break;default:_0x2275e1=_0x2a58fa[_0x55e0('0x6a')]?util[_0x55e0('0x7e')](_0x55e0('0x86'),_0xf50579[_0x55e0('0x8b')],_0x2a58fa[_0x55e0('0x6a')]):'System';}var _0x4a9422=util['format'](_0x55e0('0x8f'),moment(_0x2a58fa[_0x55e0('0x90')])[_0x55e0('0x7e')](_0x55e0('0x91')),_0x2a58fa[_0x55e0('0x92')]==='in'?_0x432df9:_0x2275e1,_0x2a58fa[_0x55e0('0x33')]);if(!_0x2a58fa[_0x55e0('0x93')]){fs['appendFileSync'](_0x36fbb5,_0x4a9422);}}return db[_0x55e0('0x94')][_0x55e0('0x50')]({'where':{'service':!![]},'include':[{'model':db[_0x55e0('0x95')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x55e0('0x96')],'as':_0x55e0('0x96'),'raw':!![]}]}]});}}})[_0x55e0('0x18')](function(_0x49344d){if(!_0x49344d||!_0x49344d[_0x55e0('0x97')]||!_0x4dabb1[_0x55e0('0x33')])return _0x510ae9;var _0x467fec=_0x49344d[_0x55e0('0x98')]();return respondWithRpcPromise(_0x55e0('0x99'),_0x55e0('0x9a'),{'account':_0x467fec,'message':{'from':util[_0x55e0('0x7e')](_0x55e0('0x9b'),_0x49344d[_0x55e0('0x2f')],_0x49344d[_0x55e0('0x58')]||_0x49344d[_0x55e0('0x97')]['user']),'to':_0x4dabb1[_0x55e0('0x33')]['mailTranscript'],'subject':_0x55e0('0x9c'),'text':util['format'](_0x55e0('0x9d'),_0x4dabb1[_0x55e0('0x33')]['mailTranscript']),'attachments':[{'path':_0x36fbb5}]}})[_0x55e0('0x18')](function(){return _0x510ae9;})[_0x55e0('0x22')](function(_0x4f131d){logger[_0x55e0('0x1d')](_0x4f131d);});})[_0x55e0('0x18')](respondWithStatusCode(_0xbb51ff,0xc8))[_0x55e0('0x22')](handleError(_0xbb51ff,null));};exports[_0x55e0('0x9e')]=function(_0x52f67d,_0x515239){return db[_0x55e0('0x63')]['find']({'where':{'id':_0x52f67d[_0x55e0('0x42')]['id']}})[_0x55e0('0x18')](handleEntityNotFound(_0x515239,null))[_0x55e0('0x18')](function(_0x58d6ac){if(_0x58d6ac){return _0x58d6ac['addMessage'](_0x52f67d[_0x55e0('0x33')][_0x55e0('0x9f')],_[_0x55e0('0xa0')](_0x52f67d[_0x55e0('0x33')],['ids','id'])||{});}})[_0x55e0('0x18')](respondWithResult(_0x515239,null))[_0x55e0('0x22')](handleError(_0x515239,null));};exports[_0x55e0('0xa1')]=function(_0x59cb62,_0x188d1d){var _0x49a7a9={'raw':![],'where':{}};var _0x10405b={};var _0xcbf5b6={'count':0x0,'rows':[]};return db[_0x55e0('0x45')]['findOne']({'where':{'id':_0x59cb62[_0x55e0('0x42')]['id']}})['then'](handleEntityNotFound(_0x188d1d,null))[_0x55e0('0x18')](function(_0x4db48b){if(_0x4db48b){_0x10405b['model']=_[_0x55e0('0x44')](db[_0x55e0('0x63')][_0x55e0('0x3a')]);_0x10405b[_0x55e0('0x40')]=_['keys'](_0x59cb62[_0x55e0('0x40')]);_0x10405b[_0x55e0('0x46')]=_[_0x55e0('0x47')](_0x10405b[_0x55e0('0x43')],_0x10405b[_0x55e0('0x40')]);_0x49a7a9[_0x55e0('0x48')]=_['intersection'](_0x10405b['model'],qs[_0x55e0('0x49')](_0x59cb62['query']['fields']));_0x49a7a9[_0x55e0('0x48')]=_0x49a7a9[_0x55e0('0x48')][_0x55e0('0x85')]?_0x49a7a9[_0x55e0('0x48')]:_0x10405b[_0x55e0('0x43')];if(!_0x59cb62[_0x55e0('0x40')]['hasOwnProperty']('nolimit')){_0x49a7a9['limit']=qs['limit'](_0x59cb62[_0x55e0('0x40')][_0x55e0('0x29')]);_0x49a7a9[_0x55e0('0x27')]=qs[_0x55e0('0x27')](_0x59cb62[_0x55e0('0x40')][_0x55e0('0x27')]);}_0x49a7a9['order']=qs[_0x55e0('0xa2')](_0x59cb62[_0x55e0('0x40')][_0x55e0('0xa2')]);_0x49a7a9[_0x55e0('0xa3')]=qs['filters'](_['pick'](_0x59cb62['query'],_0x10405b['filters']));_0x49a7a9['where']['ChatInteractionId']=_0x4db48b['id'];if(_0x59cb62['query'][_0x55e0('0xa4')]){_0x49a7a9[_0x55e0('0xa3')]=_[_0x55e0('0x32')](_0x49a7a9[_0x55e0('0xa3')],{'$or':_['map'](_0x49a7a9[_0x55e0('0x48')],function(_0x262368){var _0x561218={};_0x561218[_0x262368]={'$like':'%'+_0x59cb62[_0x55e0('0x40')][_0x55e0('0xa4')]+'%'};return _0x561218;})});}if(_0x59cb62[_0x55e0('0x40')][_0x55e0('0xa5')]){var _0x19acab=_0x59cb62[_0x55e0('0x40')][_0x55e0('0xa5')][_0x55e0('0xa6')](',');var _0x829b97={};_0x829b97[_0x19acab[0x0]]={'$gte':moment(_0x19acab[0x1])[_0x55e0('0x7e')](_0x55e0('0xa7'))};_0x49a7a9[_0x55e0('0xa3')]=_[_0x55e0('0x32')](_0x49a7a9[_0x55e0('0xa3')],_0x829b97);}_0x49a7a9=_['merge']({},_0x49a7a9,_0x59cb62[_0x55e0('0x4b')]);return db['ChatMessage'][_0x55e0('0x2a')]({'where':_0x49a7a9[_0x55e0('0xa3')]})[_0x55e0('0x18')](function(_0x548110){_0xcbf5b6[_0x55e0('0x2a')]=_0x548110;if(_0x59cb62[_0x55e0('0x40')]['includeAll']){_0x49a7a9['include']=[{'all':!![]}];}return db[_0x55e0('0x63')][_0x55e0('0x3e')](_0x49a7a9);})[_0x55e0('0x18')](function(_0x5c56cb){_0xcbf5b6[_0x55e0('0xa8')]=_0x5c56cb;return _0xcbf5b6;});}})[_0x55e0('0x18')](respondWithFilteredResult(_0x188d1d,_0x49a7a9))[_0x55e0('0x22')](handleError(_0x188d1d,null));};exports['getMyMessages']=function(_0x1baf86,_0x42dc4a){var _0x269df2={'where':{}},_0x41e8a8={},_0x1a162b={'count':0x0,'rows':[]};return db[_0x55e0('0x45')][_0x55e0('0x50')]({'where':{'id':_0x1baf86['params']['id']}})['then'](handleEntityNotFound(_0x42dc4a,null))[_0x55e0('0x18')](function(_0xbf600){if(_0xbf600){_0x41e8a8[_0x55e0('0x43')]=_[_0x55e0('0x44')](db[_0x55e0('0x63')][_0x55e0('0x3a')]);_0x41e8a8[_0x55e0('0x40')]=_[_0x55e0('0x44')](_0x1baf86['query']);_0x41e8a8[_0x55e0('0x46')]=_['intersection'](_0x41e8a8[_0x55e0('0x43')],_0x41e8a8[_0x55e0('0x40')]);_0x269df2[_0x55e0('0x48')]=_[_0x55e0('0x47')](_0x41e8a8['model'],qs[_0x55e0('0x49')](_0x1baf86['query'][_0x55e0('0x49')]));_0x269df2[_0x55e0('0x48')]=_0x269df2[_0x55e0('0x48')][_0x55e0('0x85')]?_0x269df2[_0x55e0('0x48')]:_0x41e8a8['model'];if(!_0x1baf86['query']['hasOwnProperty'](_0x55e0('0xa9'))){_0x269df2[_0x55e0('0x29')]=qs[_0x55e0('0x29')](_0x1baf86['query']['limit']);_0x269df2[_0x55e0('0x27')]=qs[_0x55e0('0x27')](_0x1baf86['query'][_0x55e0('0x27')]);}_0x269df2['order']=qs[_0x55e0('0xa2')](_0x1baf86[_0x55e0('0x40')][_0x55e0('0xa2')]);_0x269df2[_0x55e0('0xa3')]=qs[_0x55e0('0x46')](_['pick'](_0x1baf86[_0x55e0('0x40')],_0x41e8a8[_0x55e0('0x46')]));_0x269df2['where'][_0x55e0('0xaa')]=_0xbf600['id'];if(_0x1baf86[_0x55e0('0x40')][_0x55e0('0xa4')]){_0x269df2['where']=_[_0x55e0('0x32')](_0x269df2[_0x55e0('0xa3')],{'$or':_[_0x55e0('0x39')](_0x269df2['attributes'],function(_0x1968f5){var _0xe37f07={};_0xe37f07[_0x1968f5]={'$like':'%'+_0x1baf86[_0x55e0('0x40')][_0x55e0('0xa4')]+'%'};return _0xe37f07;})});}_0x269df2[_0x55e0('0xa3')][_0x55e0('0x93')]=![];if(_0x1baf86[_0x55e0('0x40')]['id']){_0x269df2[_0x55e0('0xa3')]['id']={'$gt':_0x1baf86[_0x55e0('0x40')]['id']};}_0x269df2=_[_0x55e0('0x32')]({},_0x269df2,_0x1baf86[_0x55e0('0x4b')]);return db[_0x55e0('0x63')][_0x55e0('0x2a')]({'where':_0x269df2[_0x55e0('0xa3')]})[_0x55e0('0x18')](function(_0x1de346){_0x1a162b['count']=_0x1de346;_0x269df2['include']=[];if(_0x1baf86[_0x55e0('0x40')]['includeAgent']){_0x269df2[_0x55e0('0xab')][_0x55e0('0xac')]({'model':db['User'],'as':_0x55e0('0x82'),'attributes':['id',_0x55e0('0x57'),_0x55e0('0x8d')]});}if(_0x1baf86[_0x55e0('0x40')][_0x55e0('0x4a')]){_0x269df2[_0x55e0('0xab')]=[{'all':!![]}];}return db[_0x55e0('0x63')]['findAll'](_0x269df2);})[_0x55e0('0x18')](function(_0x388965){_0x1a162b[_0x55e0('0xa8')]=_0x388965;return _0x1a162b;});}})[_0x55e0('0x18')](respondWithFilteredResult(_0x42dc4a,_0x269df2))[_0x55e0('0x22')](handleError(_0x42dc4a,null));};exports['addTags']=function(_0x23fb49,_0x34b3b1){return db[_0x55e0('0x45')][_0x55e0('0x4c')]({'where':{'id':_0x23fb49[_0x55e0('0x42')]['id']}})[_0x55e0('0x18')](handleEntityNotFound(_0x34b3b1,null))['then'](function(_0x532f8d){if(_0x532f8d){return _0x532f8d[_0x55e0('0xad')](_0x23fb49[_0x55e0('0x33')][_0x55e0('0x9f')],_[_0x55e0('0xa0')](_0x23fb49[_0x55e0('0x33')],[_0x55e0('0x9f'),'id'])||{})[_0x55e0('0xae')](function(){return db[_0x55e0('0xaf')][_0x55e0('0x3e')]({'attributes':['id','name',_0x55e0('0xb0')],'where':{'id':_0x23fb49[_0x55e0('0x33')]['ids']}});})[_0x55e0('0x18')](function(_0x2f92e6){socket[_0x55e0('0xb1')](_0x55e0('0xb2'),{'id':Number(_0x23fb49['params']['id']),'tags':_0x2f92e6||[]});return{'id':Number(_0x23fb49['params']['id']),'tags':_0x2f92e6||[]};});}})[_0x55e0('0x18')](respondWithResult(_0x34b3b1,null))['catch'](handleError(_0x34b3b1,null));};exports['removeTags']=function(_0x5f23f1,_0x4e1e5c){return db[_0x55e0('0x45')][_0x55e0('0x4c')]({'where':{'id':_0x5f23f1['params']['id']}})[_0x55e0('0x18')](handleEntityNotFound(_0x4e1e5c,null))[_0x55e0('0x18')](function(_0x5b53db){if(_0x5b53db){return _0x5b53db['removeTags'](_0x5f23f1[_0x55e0('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x4e1e5c,null))[_0x55e0('0x22')](handleError(_0x4e1e5c,null));};exports[_0x55e0('0x7d')]=function(_0x597ea0,_0x2d0167){var _0x44fdfb=moment()['unix']()['toString']();var _0x914f58=path['join'](config[_0x55e0('0x7a')],_0x55e0('0xb3'),_0x55e0('0xb4'),_0x55e0('0xb5'));var _0x64ec56=path[_0x55e0('0x79')](config['root'],_0x55e0('0xb3'),'files',_0x55e0('0xb6'));var _0x3f5949=path[_0x55e0('0x79')](_0x914f58,_0x44fdfb);var _0xbf79df=util['format'](_0x55e0('0xb7'),_0x597ea0[_0x55e0('0x42')]['id'],_0x44fdfb);var _0x463bef=path[_0x55e0('0x79')](_0x914f58,_0xbf79df);var _0x1a9954=[];_0x1a9954['push']({'model':db[_0x55e0('0x82')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x1a9954[_0x55e0('0xac')]({'model':db[_0x55e0('0x66')],'as':_0x55e0('0x67'),'attributes':['id','firstName',_0x55e0('0xb8')],'raw':!![]});if(_0x597ea0[_0x55e0('0x40')][_0x55e0('0xb6')]){_0x1a9954[_0x55e0('0xac')]({'model':db[_0x55e0('0x73')],'as':'Attachment','raw':!![]});}var _0x10ef1d=[{'model':db['ChatMessage'],'as':_0x55e0('0x81'),'attributes':['id',_0x55e0('0x33'),_0x55e0('0x90'),_0x55e0('0x92'),_0x55e0('0x93'),_0x55e0('0xb9')],'include':_0x1a9954}];_0x10ef1d[_0x55e0('0xac')]({'model':db[_0x55e0('0x4f')],'as':_0x55e0('0xba'),'attributes':['id','name']});_0x10ef1d[_0x55e0('0xac')]({'model':db[_0x55e0('0x82')],'as':'Owner','attributes':['id','fullname']});return db[_0x55e0('0x45')][_0x55e0('0x4c')]({'where':{'id':_0x597ea0[_0x55e0('0x42')]['id']},'include':_0x10ef1d})[_0x55e0('0x18')](handleEntityNotFound(_0x2d0167,null))[_0x55e0('0x18')](function(_0x5369f7){if(_0x5369f7){var _0x3ccca9=_0x5369f7[_0x55e0('0xbb')]({'plain':!![]});fs[_0x55e0('0xbc')](_0x3f5949);var _0x5ec4ff={'channel':_0x55e0('0xbd'),'account':_0x3ccca9[_0x55e0('0xba')][_0x55e0('0x2f')],'agent':_0x3ccca9[_0x55e0('0xbe')]?_0x3ccca9[_0x55e0('0xbe')][_0x55e0('0x57')]:_0x55e0('0xbf'),'createdAt':moment(_0x3ccca9[_0x55e0('0x90')])[_0x55e0('0x7e')](_0x55e0('0xa7'))[_0x55e0('0xc0')](),'closedAt':_0x3ccca9[_0x55e0('0x75')]?moment(_0x3ccca9[_0x55e0('0xc1')])[_0x55e0('0x7e')](_0x55e0('0xa7'))[_0x55e0('0xc0')]():'','disposition':_0x3ccca9[_0x55e0('0x6c')],'chatInfo':{'browser':_0x3ccca9[_0x55e0('0xc2')],'os':_0x3ccca9['osName'],'referer':_0x3ccca9[_0x55e0('0xc3')],'customerIp':_0x3ccca9['customerIp'],'customerPort':_0x3ccca9['customerPort']?_0x3ccca9[_0x55e0('0xc4')]:_0x55e0('0xbf')},'messages':_(_0x3ccca9['Messages'])[_0x55e0('0xc5')]()[_0x55e0('0xa4')]({'secret':![]})[_0x55e0('0x39')](function(_0x1db4ab){if(_0x1db4ab[_0x55e0('0x73')]){var _0x3c50f0=path[_0x55e0('0x79')](_0x64ec56,_0x1db4ab['Attachment'][_0x55e0('0x70')]);if(fs['existsSync'](_0x3c50f0)){fs[_0x55e0('0xc6')](_0x3c50f0)['pipe'](fs[_0x55e0('0xc7')](path[_0x55e0('0x79')](_0x3f5949,_0x1db4ab[_0x55e0('0x73')][_0x55e0('0x70')])));}}return{'date':moment(_0x1db4ab[_0x55e0('0x90')])[_0x55e0('0x7e')](_0x55e0('0xa7'))[_0x55e0('0xc0')](),'sender':_0x1db4ab[_0x55e0('0x92')]===_0x55e0('0x62')?_0x1db4ab[_0x55e0('0x82')]?_0x1db4ab['User'][_0x55e0('0x57')]:_0x55e0('0x87'):_0x1db4ab['Contact'][_0x55e0('0xc8')]+(_0x1db4ab['Contact'][_0x55e0('0xb8')]?'\x20'+_0x1db4ab[_0x55e0('0x67')][_0x55e0('0xb8')]:''),'body':_0x1db4ab['Attachment']?_0x1db4ab[_0x55e0('0x73')][_0x55e0('0x70')]:_0x1db4ab['body'],'direction':_0x1db4ab[_0x55e0('0x92')]===_0x55e0('0x62')?'A':'C','secret':_0x1db4ab[_0x55e0('0x93')],'read':_0x1db4ab[_0x55e0('0xb9')],'attachment':_0x1db4ab[_0x55e0('0x73')]};})['value']()};return ejs[_0x55e0('0xc9')](path[_0x55e0('0x79')](config['root'],_0x55e0('0xb3'),_0x55e0('0xca'),_0x55e0('0xcb')),{'interaction':_0x5ec4ff})[_0x55e0('0x18')](function(_0x3b22c6){var _0x9dee7e=path[_0x55e0('0x79')](_0x3f5949,_0x55e0('0xcc')+_0x3ccca9['id']+'-'+_0x44fdfb+_0x55e0('0xcd'));var _0x4c7760={'path':_0x9dee7e,'channel':_0x55e0('0xbd'),'interactionId':_0x3ccca9['id']};return pdf[_0x55e0('0xce')](_0x3b22c6,_0x4c7760);})[_0x55e0('0x18')](function(){return new Promise(function(_0x1156b2,_0x2485b7){zipdir(_0x3f5949,{'saveTo':_0x463bef},function(_0x111ec1,_0x42b1a4){if(_0x111ec1)return _0x2485b7(_0x111ec1);return _0x1156b2(_0x42b1a4);});})['then'](function(){return new BPromise(function(_0x64fe5f,_0x41512b){rimraf(_0x3f5949,function(_0x292cea){if(_0x292cea)_0x41512b(_0x292cea);return _0x64fe5f();});});})['then'](function(){return _0x2d0167[_0x55e0('0x7d')](_0x463bef,_0xbf79df,function(_0x56114e){if(_0x56114e){logger[_0x55e0('0x1d')]('err',_0x56114e);}else{fs[_0x55e0('0xcf')](_0x463bef);}});});});}else{return _0x2d0167[_0x55e0('0x23')](0xc8);}})[_0x55e0('0x22')](handleError(_0x2d0167,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 783379b..ea9ab4b 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 _0xfb5e=['setMaxListeners','save','update','remove','then','Users','setDataValue','unreadMessages','length','emit','catch','hook','exports','ChatInteraction','../../mysqldb'];(function(_0x174e6b,_0x124a26){var _0x10ab0e=function(_0x704225){while(--_0x704225){_0x174e6b['push'](_0x174e6b['shift']());}};_0x10ab0e(++_0x124a26);}(_0xfb5e,0xee));var _0xefb5=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xfb5e[_0x373dee];return _0x46798f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xefb5('0x0')];var ChatMessage=require(_0xefb5('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xefb5('0x2')](0x0);var events={'afterCreate':_0xefb5('0x3'),'afterUpdate':_0xefb5('0x4'),'afterDestroy':_0xefb5('0x5')};function emitEvent(_0x1882da){return function(_0x45b77f,_0x4a0c8d,_0x48f02e){_0x45b77f['getUsers']({'attributes':['id'],'raw':!![]})[_0xefb5('0x6')](function(_0x5c0a23){_0x45b77f['setDataValue'](_0xefb5('0x7'),_0x5c0a23['map'](function(_0x10bbbb){return{'id':_0x10bbbb['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x45b77f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4e179e){_0x45b77f[_0xefb5('0x8')](_0xefb5('0x9'),_0x4e179e[_0xefb5('0xa')]);ChatInteractionEvents['emit'](_0x1882da+':'+_0x45b77f['id'],_0x45b77f);ChatInteractionEvents[_0xefb5('0xb')](_0x1882da,_0x45b77f);_0x48f02e(null);})[_0xefb5('0xc')](_0x48f02e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xefb5('0xd')](e,emitEvent(event));}}module[_0xefb5('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0xaa74=['ChatMessage','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction'];(function(_0x52f526,_0x253153){var _0x5c1a09=function(_0x115287){while(--_0x115287){_0x52f526['push'](_0x52f526['shift']());}};_0x5c1a09(++_0x253153);}(_0xaa74,0xfc));var _0x4aa7=function(_0x4a795d,_0x3e5ba9){_0x4a795d=_0x4a795d-0x0;var _0x802826=_0xaa74[_0x4a795d];return _0x802826;};'use strict';var EventEmitter=require(_0x4aa7('0x0'));var ChatInteraction=require(_0x4aa7('0x1'))['db'][_0x4aa7('0x2')];var ChatMessage=require(_0x4aa7('0x1'))['db'][_0x4aa7('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4aa7('0x4'),'afterUpdate':_0x4aa7('0x5'),'afterDestroy':_0x4aa7('0x6')};function emitEvent(_0x3e8fd0){return function(_0x120dbf,_0x293eed,_0x17af41){_0x120dbf['getUsers']({'attributes':['id'],'raw':!![]})[_0x4aa7('0x7')](function(_0x1f8ddb){_0x120dbf[_0x4aa7('0x8')](_0x4aa7('0x9'),_0x1f8ddb['map'](function(_0x459adc){return{'id':_0x459adc['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x120dbf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4aa7('0x7')](function(_0x2a854d){_0x120dbf[_0x4aa7('0x8')](_0x4aa7('0xa'),_0x2a854d[_0x4aa7('0xb')]);ChatInteractionEvents[_0x4aa7('0xc')](_0x3e8fd0+':'+_0x120dbf['id'],_0x120dbf);ChatInteractionEvents['emit'](_0x3e8fd0,_0x120dbf);_0x17af41(null);})['catch'](_0x17af41(null));};}for(var e in events){if(events[_0x4aa7('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x4aa7('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index aa8e3e2..99800eb 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 _0x9f1c=['request-promise','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x211f8f,_0x5e123c){var _0x51b812=function(_0x3c5c81){while(--_0x3c5c81){_0x211f8f['push'](_0x211f8f['shift']());}};_0x51b812(++_0x5e123c);}(_0x9f1c,0x83));var _0xc9f1=function(_0x45927b,_0xd1f41b){_0x45927b=_0x45927b-0x0;var _0x440315=_0x9f1c[_0x45927b];return _0x440315;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc9f1('0x0'))(_0xc9f1('0x1'));var moment=require(_0xc9f1('0x2'));var BPromise=require(_0xc9f1('0x3'));var rp=require(_0xc9f1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9f1('0x5'));var config=require('../../config/environment');var attributes=require(_0xc9f1('0x6'));module[_0xc9f1('0x7')]=function(_0x4b3ad9,_0x2f7dbf){return _0x4b3ad9[_0xc9f1('0x8')](_0xc9f1('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x162de5,_0xe88652,_0x5d05d3){if(_0x162de5['changed'](_0xc9f1('0xa'))){_0x162de5[_0xc9f1('0xb')]=moment()[_0xc9f1('0xc')](_0xc9f1('0xd'));}_0x5d05d3(null,_0x162de5);}},'charset':'utf8mb4','collate':_0xc9f1('0xe')});}; \ No newline at end of file +var _0xcc4a=['chat_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction'];(function(_0x186550,_0x26f3ee){var _0x4b4c70=function(_0x2e255e){while(--_0x2e255e){_0x186550['push'](_0x186550['shift']());}};_0x4b4c70(++_0x26f3ee);}(_0xcc4a,0x1a8));var _0xacc4=function(_0x2e79c1,_0x376223){_0x2e79c1=_0x2e79c1-0x0;var _0x522184=_0xcc4a[_0x2e79c1];return _0x522184;};'use strict';var _=require('lodash');var util=require(_0xacc4('0x0'));var logger=require('../../config/logger')(_0xacc4('0x1'));var moment=require(_0xacc4('0x2'));var BPromise=require('bluebird');var rp=require(_0xacc4('0x3'));var fs=require('fs');var path=require(_0xacc4('0x4'));var rimraf=require(_0xacc4('0x5'));var config=require(_0xacc4('0x6'));var attributes=require(_0xacc4('0x7'));module[_0xacc4('0x8')]=function(_0x11bdf6,_0x2f219c){return _0x11bdf6['define'](_0xacc4('0x9'),attributes,{'tableName':_0xacc4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f66ce,_0x5a46d0,_0x8f5b6d){if(_0x4f66ce['changed'](_0xacc4('0xb'))){_0x4f66ce['closedAt']=moment()['format'](_0xacc4('0xc'));}_0x8f5b6d(null,_0x4f66ce);}},'charset':'utf8mb4','collate':_0xacc4('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e0c1768..c110071 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 _0xc041=['info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','update','body','options','raw','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x388669,_0x439407){var _0x3a7b5c=function(_0x35504a){while(--_0x35504a){_0x388669['push'](_0x388669['shift']());}};_0x3a7b5c(++_0x439407);}(_0xc041,0x13e));var _0x1c04=function(_0x368abc,_0x8bbc6f){_0x368abc=_0x368abc-0x0;var _0x2fd9f0=_0xc041[_0x368abc];return _0x2fd9f0;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var moment=require('moment');var BPromise=require(_0x1c04('0x2'));var rs=require(_0x1c04('0x3'));var fs=require('fs');var Redis=require(_0x1c04('0x4'));var db=require(_0x1c04('0x5'))['db'];var utils=require(_0x1c04('0x6'));var logger=require(_0x1c04('0x7'))(_0x1c04('0x8'));var config=require(_0x1c04('0x9'));var jayson=require(_0x1c04('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x1c04('0xb')]=_[_0x1c04('0xc')](config[_0x1c04('0xb')],{'host':_0x1c04('0xd'),'port':0x18eb});var socket=require(_0x1c04('0xe'))(new Redis(config[_0x1c04('0xb')]));require('./chatInteraction.socket')[_0x1c04('0xf')](socket);function respondWithRpcPromise(_0xb1cda6,_0x5afd49,_0xcb7497){return new BPromise(function(_0x1973a9,_0xce36f9){return client[_0x1c04('0x10')](_0xb1cda6,_0xcb7497)[_0x1c04('0x11')](function(_0x1ac042){logger[_0x1c04('0x12')](_0x1c04('0x13'),_0x5afd49,_0x1c04('0x14'));logger[_0x1c04('0x15')](_0x1c04('0x16'),_0x5afd49,_0x1c04('0x14'),JSON[_0x1c04('0x17')](_0x1ac042));if(_0x1ac042[_0x1c04('0x18')]){if(_0x1ac042[_0x1c04('0x18')]['code']===0x1f4){logger[_0x1c04('0x18')](_0x1c04('0x13'),_0x5afd49,_0x1ac042[_0x1c04('0x18')][_0x1c04('0x19')]);return _0xce36f9(_0x1ac042[_0x1c04('0x18')][_0x1c04('0x19')]);}logger[_0x1c04('0x18')](_0x1c04('0x13'),_0x5afd49,_0x1ac042['error'][_0x1c04('0x19')]);return _0x1973a9(_0x1ac042['error'][_0x1c04('0x19')]);}else{logger[_0x1c04('0x12')](_0x1c04('0x13'),_0x5afd49,_0x1c04('0x14'));_0x1973a9(_0x1ac042[_0x1c04('0x1a')][_0x1c04('0x19')]);}})['catch'](function(_0x134dfe){logger[_0x1c04('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5afd49,_0x134dfe);_0xce36f9(_0x134dfe);});});}exports['UpdateChatInteraction']=function(_0x1c89cd){var _0x3d1e5c=this;return new Promise(function(_0x2e5805,_0xef64ef){return db['ChatInteraction'][_0x1c04('0x1b')](_0x1c89cd[_0x1c04('0x1c')],{'raw':_0x1c89cd[_0x1c04('0x1d')]?_0x1c89cd[_0x1c04('0x1d')][_0x1c04('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c89cd[_0x1c04('0x1d')]?_0x1c89cd[_0x1c04('0x1d')]['where']||null:null,'attributes':_0x1c89cd['options']?_0x1c89cd[_0x1c04('0x1d')][_0x1c04('0x1f')]||null:null,'limit':_0x1c89cd[_0x1c04('0x1d')]?_0x1c89cd[_0x1c04('0x1d')][_0x1c04('0x20')]||null:null})[_0x1c04('0x11')](function(_0x138802){logger[_0x1c04('0x12')](_0x1c04('0x21'),_0x1c89cd);logger[_0x1c04('0x15')](_0x1c04('0x21'),_0x1c89cd,JSON[_0x1c04('0x17')](_0x138802));_0x2e5805(_0x138802);})[_0x1c04('0x22')](function(_0x45ce52){logger[_0x1c04('0x18')](_0x1c04('0x21'),_0x45ce52[_0x1c04('0x19')],_0x1c89cd);_0xef64ef(_0x3d1e5c[_0x1c04('0x18')](0x1f4,_0x45ce52['message']));});});};exports[_0x1c04('0x23')]=function(_0x3e04d5){return new Promise(function(_0x28ee33,_0xd933b){return db['ChatInteraction'][_0x1c04('0x24')]({'where':_0x3e04d5['options']?_0x3e04d5[_0x1c04('0x1d')][_0x1c04('0x25')]||null:null})[_0x1c04('0x11')](function(_0x1bfb34){if(_0x1bfb34){return _0x1bfb34[_0x1c04('0x26')](_0x3e04d5[_0x1c04('0x1c')][_0x1c04('0x27')],_[_0x1c04('0x28')](_0x3e04d5[_0x1c04('0x1c')],[_0x1c04('0x27'),'id'])||{});}})['spread'](function(_0x5da5ea){logger[_0x1c04('0x12')](_0x1c04('0x29'),_0x3e04d5);logger[_0x1c04('0x15')](_0x1c04('0x29'),_0x3e04d5,JSON[_0x1c04('0x17')](_0x5da5ea));_0x28ee33(_0x5da5ea);})[_0x1c04('0x22')](function(_0x3e093e){logger[_0x1c04('0x18')](_0x1c04('0x29'),_0x3e093e['message'],_0x3e04d5);_0xd933b(_this[_0x1c04('0x18')](0x1f4,_0x3e093e['message']));});});}; \ No newline at end of file +var _0x5dc4=['stringify','error','message','catch','raw','options','where','limit','UpdateChatInteraction','ChatInteraction','find','addTags','body','omit','ids','AddTags','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x377426,_0x5a4f92){var _0x4aad06=function(_0x46e498){while(--_0x46e498){_0x377426['push'](_0x377426['shift']());}};_0x4aad06(++_0x5a4f92);}(_0x5dc4,0x1c0));var _0x45dc=function(_0x3b4bb5,_0x20538d){_0x3b4bb5=_0x3b4bb5-0x0;var _0x16336b=_0x5dc4[_0x3b4bb5];return _0x16336b;};'use strict';var _=require('lodash');var util=require(_0x45dc('0x0'));var moment=require(_0x45dc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45dc('0x2'))['db'];var utils=require(_0x45dc('0x3'));var logger=require('../../config/logger')(_0x45dc('0x4'));var config=require(_0x45dc('0x5'));var jayson=require(_0x45dc('0x6'));var client=jayson[_0x45dc('0x7')]['http']({'port':0x232a});config[_0x45dc('0x8')]=_[_0x45dc('0x9')](config[_0x45dc('0x8')],{'host':_0x45dc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45dc('0x8')]));require(_0x45dc('0xb'))[_0x45dc('0xc')](socket);function respondWithRpcPromise(_0x5173ce,_0x501e10,_0x1fbb95){return new BPromise(function(_0x24760a,_0x46c695){return client[_0x45dc('0xd')](_0x5173ce,_0x1fbb95)[_0x45dc('0xe')](function(_0x5b1ae6){logger[_0x45dc('0xf')](_0x45dc('0x10'),_0x501e10,_0x45dc('0x11'));logger[_0x45dc('0x12')](_0x45dc('0x13'),_0x501e10,_0x45dc('0x11'),JSON[_0x45dc('0x14')](_0x5b1ae6));if(_0x5b1ae6[_0x45dc('0x15')]){if(_0x5b1ae6[_0x45dc('0x15')]['code']===0x1f4){logger['error'](_0x45dc('0x10'),_0x501e10,_0x5b1ae6[_0x45dc('0x15')][_0x45dc('0x16')]);return _0x46c695(_0x5b1ae6[_0x45dc('0x15')][_0x45dc('0x16')]);}logger[_0x45dc('0x15')](_0x45dc('0x10'),_0x501e10,_0x5b1ae6[_0x45dc('0x15')][_0x45dc('0x16')]);return _0x24760a(_0x5b1ae6[_0x45dc('0x15')][_0x45dc('0x16')]);}else{logger['info'](_0x45dc('0x10'),_0x501e10,'request\x20sent');_0x24760a(_0x5b1ae6['result']['message']);}})[_0x45dc('0x17')](function(_0x350d4f){logger[_0x45dc('0x15')](_0x45dc('0x10'),_0x501e10,_0x350d4f);_0x46c695(_0x350d4f);});});}exports['UpdateChatInteraction']=function(_0x250f55){var _0x375160=this;return new Promise(function(_0x7026d1,_0x321ef9){return db['ChatInteraction']['update'](_0x250f55['body'],{'raw':_0x250f55['options']?_0x250f55['options'][_0x45dc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x250f55[_0x45dc('0x19')]?_0x250f55[_0x45dc('0x19')][_0x45dc('0x1a')]||null:null,'attributes':_0x250f55[_0x45dc('0x19')]?_0x250f55[_0x45dc('0x19')]['attributes']||null:null,'limit':_0x250f55['options']?_0x250f55[_0x45dc('0x19')][_0x45dc('0x1b')]||null:null})['then'](function(_0x2fbdde){logger[_0x45dc('0xf')](_0x45dc('0x1c'),_0x250f55);logger[_0x45dc('0x12')](_0x45dc('0x1c'),_0x250f55,JSON['stringify'](_0x2fbdde));_0x7026d1(_0x2fbdde);})['catch'](function(_0x396c2b){logger[_0x45dc('0x15')]('UpdateChatInteraction',_0x396c2b['message'],_0x250f55);_0x321ef9(_0x375160[_0x45dc('0x15')](0x1f4,_0x396c2b[_0x45dc('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x2d1b91){return new Promise(function(_0x5b863f,_0x1a1f8d){return db[_0x45dc('0x1d')][_0x45dc('0x1e')]({'where':_0x2d1b91[_0x45dc('0x19')]?_0x2d1b91[_0x45dc('0x19')][_0x45dc('0x1a')]||null:null})[_0x45dc('0xe')](function(_0x37e421){if(_0x37e421){return _0x37e421[_0x45dc('0x1f')](_0x2d1b91[_0x45dc('0x20')]['ids'],_[_0x45dc('0x21')](_0x2d1b91['body'],[_0x45dc('0x22'),'id'])||{});}})['spread'](function(_0x367a66){logger[_0x45dc('0xf')](_0x45dc('0x23'),_0x2d1b91);logger[_0x45dc('0x12')](_0x45dc('0x23'),_0x2d1b91,JSON['stringify'](_0x367a66));_0x5b863f(_0x367a66);})[_0x45dc('0x17')](function(_0x45eaaa){logger[_0x45dc('0x15')](_0x45dc('0x23'),_0x45eaaa['message'],_0x2d1b91);_0x1a1f8d(_this[_0x45dc('0x15')](0x1f4,_0x45eaaa[_0x45dc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f68c783..d34e348 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 _0x649f=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x649f,0x8d));var _0xf649=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x649f[_0x51020b];return _0x371e47;};'use strict';var ChatInteractionEvents=require(_0xf649('0x0'));var events=[_0xf649('0x1'),_0xf649('0x2'),'update'];function createListener(_0x59b774,_0x27b25d){return function(_0x3be4a9){_0x27b25d[_0xf649('0x3')](_0x59b774,_0x3be4a9);};}function removeListener(_0x46ff59,_0x52dd05){return function(){ChatInteractionEvents[_0xf649('0x4')](_0x46ff59,_0x52dd05);};}exports[_0xf649('0x5')]=function(_0x38e80d){for(var _0x5e6358=0x0,_0x1eb0af=events[_0xf649('0x6')];_0x5e6358<_0x1eb0af;_0x5e6358++){var _0x205434=events[_0x5e6358];var _0x1c481c=createListener(_0xf649('0x7')+_0x205434,_0x38e80d);ChatInteractionEvents['on'](_0x205434,_0x1c481c);}}; \ No newline at end of file +var _0xd7ae=['removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x49ebdf,_0x5e486a){var _0x1621a0=function(_0x37da3e){while(--_0x37da3e){_0x49ebdf['push'](_0x49ebdf['shift']());}};_0x1621a0(++_0x5e486a);}(_0xd7ae,0x10b));var _0xed7a=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd7ae[_0x4e676e];return _0x336a3c;};'use strict';var ChatInteractionEvents=require(_0xed7a('0x0'));var events=[_0xed7a('0x1'),_0xed7a('0x2'),'update'];function createListener(_0x34e188,_0x3b7268){return function(_0x4ba728){_0x3b7268['emit'](_0x34e188,_0x4ba728);};}function removeListener(_0x27c73b,_0x428ca0){return function(){ChatInteractionEvents[_0xed7a('0x3')](_0x27c73b,_0x428ca0);};}exports['register']=function(_0x4b7a06){for(var _0x52d5fb=0x0,_0x110a48=events[_0xed7a('0x4')];_0x52d5fb<_0x110a48;_0x52d5fb++){var _0x500895=events[_0x52d5fb];var _0x52a845=createListener(_0xed7a('0x5')+_0x500895,_0x4b7a06);ChatInteractionEvents['on'](_0x500895,_0x52a845);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index b8cbbf1..5e8059e 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 _0xcf4d=['../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','diskStorage','join','root','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','tracked','chatinteraction:addtags','put','/:id','chatinteraction:update','update','customUpdate','abandon','/:id/close','delete','chat','chatinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4f7e0b,_0x12d9ca){var _0x28bd53=function(_0x5abab2){while(--_0x5abab2){_0x4f7e0b['push'](_0x4f7e0b['shift']());}};_0x28bd53(++_0x12d9ca);}(_0xcf4d,0x1b2));var _0xdcf4=function(_0x3973e1,_0x1ed5ae){_0x3973e1=_0x3973e1-0x0;var _0x14a854=_0xcf4d[_0x3973e1];return _0x14a854;};'use strict';var multer=require('multer');var util=require(_0xdcf4('0x0'));var path=require(_0xdcf4('0x1'));var timeout=require(_0xdcf4('0x2'));var express=require(_0xdcf4('0x3'));var router=express[_0xdcf4('0x4')]();var fs_extra=require(_0xdcf4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdcf4('0x6'));var config=require(_0xdcf4('0x7'));var controller=require(_0xdcf4('0x8'));router[_0xdcf4('0x9')]('/',auth[_0xdcf4('0xa')](),controller[_0xdcf4('0xb')]);router[_0xdcf4('0x9')]('/describe',auth[_0xdcf4('0xa')](),controller[_0xdcf4('0xc')]);router['get']('/:id',auth[_0xdcf4('0xd')](),controller[_0xdcf4('0xe')]);router['get']('/:id/attachment_download',auth[_0xdcf4('0xd')](),controller[_0xdcf4('0xf')]);router[_0xdcf4('0x9')]('/:id/messages',auth[_0xdcf4('0xa')](),controller[_0xdcf4('0x10')]);router[_0xdcf4('0x9')](_0xdcf4('0x11'),auth[_0xdcf4('0xd')](),controller[_0xdcf4('0x12')]);router[_0xdcf4('0x9')](_0xdcf4('0x13'),auth[_0xdcf4('0xa')](),controller[_0xdcf4('0x14')]);router['post']('/',auth[_0xdcf4('0xa')](),controller[_0xdcf4('0x15')]);router[_0xdcf4('0x16')]('/:id/vidaoo',auth[_0xdcf4('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xdcf4('0x17')]({'destination':function(_0x3b3039,_0x21800e,_0x48feda){_0x48feda(null,path[_0xdcf4('0x18')](config[_0xdcf4('0x19')],'server/files/attachments/'));},'filename':function(_0x1cf422,_0xf55c02,_0x507737){_0x507737(null,util[_0xdcf4('0x1a')](_0xdcf4('0x1b'),Date['now'](),_0xf55c02[_0xdcf4('0x1c')][_0xdcf4('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdcf4('0x16')](_0xdcf4('0x1e'),upload[_0xdcf4('0x1f')](_0xdcf4('0x20')),controller[_0xdcf4('0x21')]);router[_0xdcf4('0x16')](_0xdcf4('0x22'),auth[_0xdcf4('0xd')](),controller['addMessage']);router[_0xdcf4('0x16')]('/:id/tags',auth[_0xdcf4('0xa')](),interaction[_0xdcf4('0x23')]('chat',_0xdcf4('0x24')),controller['addTags']);router[_0xdcf4('0x25')](_0xdcf4('0x26'),auth[_0xdcf4('0xa')](),interaction[_0xdcf4('0x23')]('chat',_0xdcf4('0x27')),controller[_0xdcf4('0x28')]);router[_0xdcf4('0x25')]('/:id/custom_update',controller[_0xdcf4('0x29')]);router[_0xdcf4('0x25')]('/:id/abandon',auth[_0xdcf4('0xd')](),controller[_0xdcf4('0x2a')]);router['put'](_0xdcf4('0x2b'),controller['close']);router[_0xdcf4('0x2c')](_0xdcf4('0x26'),auth[_0xdcf4('0xa')](),interaction[_0xdcf4('0x23')](_0xdcf4('0x2d'),_0xdcf4('0x2e')),controller[_0xdcf4('0x2f')]);router[_0xdcf4('0x2c')]('/:id/tags',auth[_0xdcf4('0xa')](),controller['removeTags']);module[_0xdcf4('0x30')]=router; \ No newline at end of file +var _0x8a3d=['/:id/attachment_upload','single','file','attachmentUpload','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','/:id/tags','removeTags','exports','path','connect-timeout','Router','../../components/auth/service','./chatInteraction.controller','get','index','/describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','isAuthenticated','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','now','originalname','replace'];(function(_0x294efd,_0x963532){var _0xc79aa2=function(_0x3d3081){while(--_0x3d3081){_0x294efd['push'](_0x294efd['shift']());}};_0xc79aa2(++_0x963532);}(_0x8a3d,0xce));var _0xd8a3=function(_0x3de0d1,_0x13d6b4){_0x3de0d1=_0x3de0d1-0x0;var _0x476802=_0x8a3d[_0x3de0d1];return _0x476802;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd8a3('0x0'));var timeout=require(_0xd8a3('0x1'));var express=require('express');var router=express[_0xd8a3('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd8a3('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8a3('0x4'));router[_0xd8a3('0x5')]('/',auth['isAuthenticated'](),controller[_0xd8a3('0x6')]);router[_0xd8a3('0x5')](_0xd8a3('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0xd8a3('0x5')](_0xd8a3('0x8'),auth['isChatInteractionAuthorized'](),controller[_0xd8a3('0x9')]);router['get'](_0xd8a3('0xa'),auth['isChatInteractionAuthorized'](),controller[_0xd8a3('0xb')]);router[_0xd8a3('0x5')](_0xd8a3('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd8a3('0x5')](_0xd8a3('0xd'),auth[_0xd8a3('0xe')](),controller[_0xd8a3('0xf')]);router[_0xd8a3('0x5')](_0xd8a3('0x10'),auth[_0xd8a3('0x11')](),controller[_0xd8a3('0x12')]);router[_0xd8a3('0x13')]('/',auth['isAuthenticated'](),controller[_0xd8a3('0x14')]);router[_0xd8a3('0x13')](_0xd8a3('0x15'),auth[_0xd8a3('0x11')](),controller[_0xd8a3('0x16')]);var upload=multer({'storage':multer[_0xd8a3('0x17')]({'destination':function(_0x380720,_0x45e889,_0x112464){_0x112464(null,path[_0xd8a3('0x18')](config['root'],_0xd8a3('0x19')));},'filename':function(_0x37f3a1,_0x33a45f,_0x6b2568){_0x6b2568(null,util['format']('%s-%s',Date[_0xd8a3('0x1a')](),_0x33a45f[_0xd8a3('0x1b')][_0xd8a3('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xd8a3('0x1d'),upload[_0xd8a3('0x1e')](_0xd8a3('0x1f')),controller[_0xd8a3('0x20')]);router[_0xd8a3('0x13')](_0xd8a3('0xc'),auth[_0xd8a3('0xe')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xd8a3('0x21')](_0xd8a3('0x22'),_0xd8a3('0x23')),controller['addTags']);router[_0xd8a3('0x24')](_0xd8a3('0x8'),auth[_0xd8a3('0x11')](),interaction['tracked'](_0xd8a3('0x22'),_0xd8a3('0x25')),controller[_0xd8a3('0x26')]);router[_0xd8a3('0x24')](_0xd8a3('0x27'),controller['customUpdate']);router[_0xd8a3('0x24')](_0xd8a3('0x28'),auth[_0xd8a3('0xe')](),controller[_0xd8a3('0x29')]);router['put'](_0xd8a3('0x2a'),controller['close']);router['delete']('/:id',auth[_0xd8a3('0x11')](),interaction[_0xd8a3('0x21')](_0xd8a3('0x22'),_0xd8a3('0x2b')),controller['destroy']);router['delete'](_0xd8a3('0x2c'),auth[_0xd8a3('0x11')](),controller[_0xd8a3('0x2d')]);module[_0xd8a3('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d58b6c4..055d04b 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 _0x7e31=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x7e31,0xb0));var _0x17e3=function(_0x1fc82b,_0x5150a6){_0x1fc82b=_0x1fc82b-0x0;var _0x4c6679=_0x7e31[_0x1fc82b];return _0x4c6679;};'use strict';var Sequelize=require(_0x17e3('0x0'));module[_0x17e3('0x1')]={'body':{'type':Sequelize['TEXT'](_0x17e3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x17e3('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x17e3('0x4')]}}; \ No newline at end of file +var _0xebc1=['TEXT','medium','BOOLEAN','INTEGER'];(function(_0x39e858,_0x58c3c0){var _0x548f64=function(_0x1214aa){while(--_0x1214aa){_0x39e858['push'](_0x39e858['shift']());}};_0x548f64(++_0x58c3c0);}(_0xebc1,0x64));var _0x1ebc=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0xebc1[_0x33593e];return _0x53db1a;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x1ebc('0x0')](_0x1ebc('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x1ebc('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1ebc('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index c2fd26e..4fef8d6 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 _0x52ef=['options','includeAll','include','show','params','create','body','catch','find','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','agent','admin','role','userpic','internal','online','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','all','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','then','error','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x580e5f,_0x4e26de){var _0x21f583=function(_0x446cd8){while(--_0x446cd8){_0x580e5f['push'](_0x580e5f['shift']());}};_0x21f583(++_0x4e26de);}(_0x52ef,0x1ba));var _0xf52e=function(_0x1b88ee,_0x3cddfc){_0x1b88ee=_0x1b88ee-0x0;var _0x31dd88=_0x52ef[_0x1b88ee];return _0x31dd88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf52e('0x0'));var zipdir=require(_0xf52e('0x1'));var jsonpatch=require(_0xf52e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf52e('0x3'));var util=require(_0xf52e('0x4'));var path=require('path');var sox=require(_0xf52e('0x5'));var csv=require(_0xf52e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf52e('0x7'));var _=require(_0xf52e('0x8'));var squel=require(_0xf52e('0x9'));var crypto=require('crypto');var jsforce=require(_0xf52e('0xa'));var deskjs=require(_0xf52e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf52e('0xc'));var Papa=require('papaparse');var Redis=require(_0xf52e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf52e('0xe'));var as=require(_0xf52e('0xf'));var hardwareService=require(_0xf52e('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xf52e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xf52e('0x12'));var db=require('../../mysqldb')['db'];config[_0xf52e('0x13')]=_[_0xf52e('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf52e('0x15'))(new Redis(config[_0xf52e('0x13')]));require(_0xf52e('0x16'))[_0xf52e('0x17')](socket);function respondWithStatusCode(_0x4b3661,_0x1e300c){_0x1e300c=_0x1e300c||0xcc;return function(_0x52a51d){if(_0x52a51d){return _0x4b3661[_0xf52e('0x18')](_0x1e300c);}return _0x4b3661[_0xf52e('0x19')](_0x1e300c)[_0xf52e('0x1a')]();};}function respondWithResult(_0x5f5508,_0x4e70ed){_0x4e70ed=_0x4e70ed||0xc8;return function(_0x4263fa){if(_0x4263fa){return _0x5f5508['status'](_0x4e70ed)[_0xf52e('0x1b')](_0x4263fa);}};}function respondWithFilteredResult(_0x4def05,_0x512f38){return function(_0x3453f3){if(_0x3453f3){var _0x5e2e00=typeof _0x512f38[_0xf52e('0x1c')]===_0xf52e('0x1d')&&typeof _0x512f38['limit']==='undefined';var _0x3b7938=_0x3453f3[_0xf52e('0x1e')];var _0x52fa07=_0x5e2e00?0x0:_0x512f38[_0xf52e('0x1c')];var _0x3626d7=_0x5e2e00?_0x3453f3[_0xf52e('0x1e')]:_0x512f38[_0xf52e('0x1c')]+_0x512f38[_0xf52e('0x1f')];var _0x57bebe;if(_0x3626d7>=_0x3b7938){_0x3626d7=_0x3b7938;_0x57bebe=0xc8;}else{_0x57bebe=0xce;}_0x4def05['status'](_0x57bebe);return _0x4def05[_0xf52e('0x20')](_0xf52e('0x21'),_0x52fa07+'-'+_0x3626d7+'/'+_0x3b7938)['json'](_0x3453f3);}return null;};}function patchUpdates(_0x4d28ba){return function(_0x5767a7){try{jsonpatch[_0xf52e('0x22')](_0x5767a7,_0x4d28ba,!![]);}catch(_0x3aae04){return BPromise[_0xf52e('0x23')](_0x3aae04);}return _0x5767a7['save']();};}function saveUpdates(_0x28ea0d,_0x16b786){return function(_0x2ae72c){if(_0x2ae72c){return _0x2ae72c['update'](_0x28ea0d)['then'](function(_0x1df65d){return _0x1df65d;});}return null;};}function removeEntity(_0x18ddaa,_0x34c6b6){return function(_0x5c5257){if(_0x5c5257){return _0x5c5257[_0xf52e('0x24')]()[_0xf52e('0x25')](function(){_0x18ddaa[_0xf52e('0x19')](0xcc)[_0xf52e('0x1a')]();});}};}function handleEntityNotFound(_0x1dfc71,_0x7878b7){return function(_0x38d522){if(!_0x38d522){_0x1dfc71[_0xf52e('0x18')](0x194);}return _0x38d522;};}function handleError(_0x184586,_0x4e575c){_0x4e575c=_0x4e575c||0x1f4;return function(_0x27d3f9){logger[_0xf52e('0x26')](_0x27d3f9['stack']);if(_0x27d3f9[_0xf52e('0x27')]){delete _0x27d3f9[_0xf52e('0x27')];}_0x184586['status'](_0x4e575c)[_0xf52e('0x28')](_0x27d3f9);};}exports[_0xf52e('0x29')]=function(_0x136fd4,_0x323123){var _0x533f06={},_0x2aed81={},_0xe7592e={'count':0x0,'rows':[]};var _0x1c37b2=_['map'](db[_0xf52e('0x2a')][_0xf52e('0x2b')],function(_0x46f05f){return{'name':_0x46f05f[_0xf52e('0x2c')],'type':_0x46f05f[_0xf52e('0x2d')][_0xf52e('0x2e')]};});_0x2aed81[_0xf52e('0x2f')]=_['map'](_0x1c37b2,_0xf52e('0x27'));_0x2aed81[_0xf52e('0x30')]=_[_0xf52e('0x31')](_0x136fd4[_0xf52e('0x30')]);_0x2aed81[_0xf52e('0x32')]=_[_0xf52e('0x33')](_0x2aed81[_0xf52e('0x2f')],_0x2aed81[_0xf52e('0x30')]);_0x533f06['attributes']=_['intersection'](_0x2aed81[_0xf52e('0x2f')],qs[_0xf52e('0x34')](_0x136fd4[_0xf52e('0x30')][_0xf52e('0x34')]));_0x533f06[_0xf52e('0x35')]=_0x533f06[_0xf52e('0x35')][_0xf52e('0x36')]?_0x533f06[_0xf52e('0x35')]:_0x2aed81['model'];if(!_0x136fd4[_0xf52e('0x30')][_0xf52e('0x37')]('nolimit')){_0x533f06[_0xf52e('0x1f')]=qs[_0xf52e('0x1f')](_0x136fd4[_0xf52e('0x30')][_0xf52e('0x1f')]);_0x533f06[_0xf52e('0x1c')]=qs[_0xf52e('0x1c')](_0x136fd4[_0xf52e('0x30')]['offset']);}_0x533f06[_0xf52e('0x38')]=qs[_0xf52e('0x39')](_0x136fd4['query']['sort']);_0x533f06[_0xf52e('0x3a')]=qs['filters'](_[_0xf52e('0x3b')](_0x136fd4[_0xf52e('0x30')],_0x2aed81['filters']),_0x1c37b2);if(_0x136fd4[_0xf52e('0x30')][_0xf52e('0x3c')]){_0x533f06['where']=_['merge'](_0x533f06[_0xf52e('0x3a')],{'$or':_['map'](_0x1c37b2,function(_0x31eaf5){if(_0x31eaf5['type']!==_0xf52e('0x3d')){var _0x24d9f5={};_0x24d9f5[_0x31eaf5[_0xf52e('0x27')]]={'$like':'%'+_0x136fd4[_0xf52e('0x30')][_0xf52e('0x3c')]+'%'};return _0x24d9f5;}})});}_0x533f06=_[_0xf52e('0x3e')]({},_0x533f06,_0x136fd4[_0xf52e('0x3f')]);var _0x1827ff={'where':_0x533f06[_0xf52e('0x3a')]};return db['ChatInternalMessage'][_0xf52e('0x1e')](_0x1827ff)[_0xf52e('0x25')](function(_0x24315d){_0xe7592e[_0xf52e('0x1e')]=_0x24315d;if(_0x136fd4[_0xf52e('0x30')][_0xf52e('0x40')]){_0x533f06[_0xf52e('0x41')]=[{'all':!![]}];}return db[_0xf52e('0x2a')]['findAll'](_0x533f06);})[_0xf52e('0x25')](function(_0xc27864){_0xe7592e['rows']=_0xc27864;return _0xe7592e;})[_0xf52e('0x25')](respondWithFilteredResult(_0x323123,_0x533f06))['catch'](handleError(_0x323123,null));};exports[_0xf52e('0x42')]=function(_0x598bb2,_0x3ad3e8){var _0x1a72b4={'raw':!![],'where':{'id':_0x598bb2[_0xf52e('0x43')]['id']}},_0x46a471={};_0x46a471[_0xf52e('0x2f')]=_[_0xf52e('0x31')](db[_0xf52e('0x2a')][_0xf52e('0x2b')]);_0x46a471[_0xf52e('0x30')]=_[_0xf52e('0x31')](_0x598bb2[_0xf52e('0x30')]);_0x46a471['filters']=_[_0xf52e('0x33')](_0x46a471[_0xf52e('0x2f')],_0x46a471[_0xf52e('0x30')]);_0x1a72b4[_0xf52e('0x35')]=_[_0xf52e('0x33')](_0x46a471[_0xf52e('0x2f')],qs[_0xf52e('0x34')](_0x598bb2[_0xf52e('0x30')][_0xf52e('0x34')]));_0x1a72b4[_0xf52e('0x35')]=_0x1a72b4[_0xf52e('0x35')]['length']?_0x1a72b4['attributes']:_0x46a471['model'];if(_0x598bb2[_0xf52e('0x30')][_0xf52e('0x40')]){_0x1a72b4[_0xf52e('0x41')]=[{'all':!![]}];}_0x1a72b4=_[_0xf52e('0x3e')]({},_0x1a72b4,_0x598bb2[_0xf52e('0x3f')]);return db['ChatInternalMessage']['find'](_0x1a72b4)['then'](handleEntityNotFound(_0x3ad3e8,null))['then'](respondWithResult(_0x3ad3e8,null))['catch'](handleError(_0x3ad3e8,null));};exports[_0xf52e('0x44')]=function(_0x2f77f3,_0x5b368d){return db[_0xf52e('0x2a')][_0xf52e('0x44')](_0x2f77f3[_0xf52e('0x45')],{})[_0xf52e('0x25')](respondWithResult(_0x5b368d,0xc9))[_0xf52e('0x46')](handleError(_0x5b368d,null));};exports['update']=function(_0xb3d3a0,_0x3dd6d7){if(_0xb3d3a0[_0xf52e('0x45')]['id']){delete _0xb3d3a0[_0xf52e('0x45')]['id'];}return db[_0xf52e('0x2a')][_0xf52e('0x47')]({'where':{'id':_0xb3d3a0[_0xf52e('0x43')]['id']}})[_0xf52e('0x25')](handleEntityNotFound(_0x3dd6d7,null))['then'](saveUpdates(_0xb3d3a0[_0xf52e('0x45')],null))[_0xf52e('0x25')](respondWithResult(_0x3dd6d7,null))[_0xf52e('0x46')](handleError(_0x3dd6d7,null));};exports[_0xf52e('0x24')]=function(_0x2332c8,_0x16c0f7){return db['ChatInternalMessage']['find']({'where':{'id':_0x2332c8['params']['id']}})['then'](handleEntityNotFound(_0x16c0f7,null))['then'](removeEntity(_0x16c0f7,null))[_0xf52e('0x46')](handleError(_0x16c0f7,null));};exports[_0xf52e('0x48')]=function(_0x215703,_0x4c1629){return db[_0xf52e('0x2a')][_0xf52e('0x48')]()['then'](respondWithResult(_0x4c1629,null))[_0xf52e('0x46')](handleError(_0x4c1629,null));};function wrapUser(_0x53f277){return function(_0xfc7a61){var _0x115f43=_0x53f277[_0xf52e('0x49')]({'plain':!![]});_0x115f43['messages']=[];if(_0xfc7a61){_0x115f43[_0xf52e('0x4a')]=_0xfc7a61[_0xf52e('0x4b')];_0x115f43[_0xf52e('0x4c')]=_0xfc7a61;}else{_0x115f43[_0xf52e('0x4a')]=moment(0x0)[_0xf52e('0x4d')](_0xf52e('0x4e'));_0x115f43['lastMessage']={};}return _0x115f43;};}exports[_0xf52e('0x4f')]=function(_0x2b3ecc,_0x5c6650,_0xe6864d){var _0x6d1a3b=[];return db['User'][_0xf52e('0x50')]({'where':{'role':[_0xf52e('0x51'),_0xf52e('0x52'),'user']},'attributes':['id','fullname',_0xf52e('0x27'),_0xf52e('0x53'),_0xf52e('0x54'),_0xf52e('0x55'),_0xf52e('0x56'),'lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0xf52e('0x39')](_0xf52e('0x57')),'include':[{'model':db[_0xf52e('0x58')],'as':_0xf52e('0x59'),'attributes':['id',_0xf52e('0x27'),'type'],'through':{'attributes':[]}}]})[_0xf52e('0x25')](function(_0x4b5776){if(_0x4b5776){var _0x1645a1=_0x2b3ecc[_0xf52e('0x5a')][_0xf52e('0x49')]({'plain':!![]});if(!_0x1645a1)throw new Error(_0xf52e('0x5b'));if(_0x1645a1['role']===_0xf52e('0x5a')){return db[_0xf52e('0x5c')][_0xf52e('0x47')]({'where':{'name':'Agents','userProfileId':_0x1645a1['userProfileId']},'raw':!![]})['then'](function(_0x4bd281){if(_0x4bd281){if(_0x4bd281[_0xf52e('0x5d')]===0x0){return db[_0xf52e('0x5e')][_0xf52e('0x50')]({'where':{'sectionId':_0x4bd281['id']},'raw':!![]})['then'](function(_0x255cf6){var _0x5ba651=[];if(_[_0xf52e('0x5f')](_0x255cf6)){_0x5ba651=_[_0xf52e('0x3c')](_0x4b5776,function(_0x1b2f42){if(_0x1b2f42['role']!==_0xf52e('0x51')){return _0x1b2f42;}});return _0x5ba651;}else{for(var _0x5dfd7f=0x0;_0x5dfd7f<_0x4b5776[_0xf52e('0x36')];_0x5dfd7f++){var _0x5722be=_0x4b5776[_0x5dfd7f];if(_0x5722be['role']===_0xf52e('0x51')){var _0x1f5d9d=_[_0xf52e('0x47')](_0x255cf6,function(_0x589e35){return _0x589e35[_0xf52e('0x60')]===_0x5722be['id'];});if(_0x1f5d9d)_0x5ba651['push'](_0x5722be);}else{_0x5ba651[_0xf52e('0x61')](_0x5722be);}}return _0x5ba651;}});}else{return _0x4b5776;}}else{var _0x22752e=_['filter'](_0x4b5776,function(_0x338dea){if(_0x338dea[_0xf52e('0x53')]!==_0xf52e('0x51')){return _0x338dea;}});return _0x22752e;}});}else{return _0x4b5776;}}})[_0xf52e('0x25')](function(_0x5ea4b5){var _0x5682a0=[];if(_0x5ea4b5){_0x6d1a3b=_0x5ea4b5;for(var _0x5ea6d5=0x0;_0x5ea6d5<_0x5ea4b5[_0xf52e('0x36')];_0x5ea6d5+=0x1){_0x6d1a3b[_0x5ea6d5]['messages']=[];_0x5682a0['push'](db[_0xf52e('0x2a')][_0xf52e('0x47')]({'where':{'FromId':[_0x2b3ecc[_0xf52e('0x5a')]['id'],_0x5ea4b5[_0x5ea6d5]['id']],'ToId':[_0x2b3ecc['user']['id'],_0x5ea4b5[_0x5ea6d5]['id']],'ChatGroupId':null},'attributes':['id',_0xf52e('0x4b'),_0xf52e('0x62'),'ToId',_0xf52e('0x63'),_0xf52e('0x45')],'order':qs[_0xf52e('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf52e('0x25')](wrapUser(_0x5ea4b5[_0x5ea6d5])));}return BPromise[_0xf52e('0x64')](_0x5682a0);}return[];})[_0xf52e('0x25')](function(_0x4d4c0d){return{'rows':_0x4d4c0d,'count':_0x4d4c0d['length']};})[_0xf52e('0x25')](respondWithResult(_0x5c6650,null))['catch'](handleError(_0x5c6650,null));}; \ No newline at end of file +var _0x7d9a=['online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','describe','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic'];(function(_0x512ca3,_0x22bb3f){var _0xd53b61=function(_0x5182ce){while(--_0x5182ce){_0x512ca3['push'](_0x512ca3['shift']());}};_0xd53b61(++_0x22bb3f);}(_0x7d9a,0x1c6));var _0xa7d9=function(_0x3ad0ad,_0x3cc49c){_0x3ad0ad=_0x3ad0ad-0x0;var _0x1b016e=_0x7d9a[_0x3ad0ad];return _0x1b016e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7d9('0x0'));var zipdir=require(_0xa7d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7d9('0x2'));var moment=require(_0xa7d9('0x3'));var BPromise=require(_0xa7d9('0x4'));var Mustache=require(_0xa7d9('0x5'));var util=require(_0xa7d9('0x6'));var path=require('path');var sox=require(_0xa7d9('0x7'));var csv=require(_0xa7d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa7d9('0x9'));var _=require(_0xa7d9('0xa'));var squel=require(_0xa7d9('0xb'));var crypto=require(_0xa7d9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa7d9('0xd'));var toCsv=require(_0xa7d9('0x8'));var querystring=require(_0xa7d9('0xe'));var Papa=require(_0xa7d9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa7d9('0x10'));var as=require(_0xa7d9('0x11'));var hardwareService=require(_0xa7d9('0x12'));var logger=require(_0xa7d9('0x13'))(_0xa7d9('0x14'));var utils=require(_0xa7d9('0x15'));var config=require(_0xa7d9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa7d9('0x17')]=_[_0xa7d9('0x18')](config[_0xa7d9('0x17')],{'host':_0xa7d9('0x19'),'port':0x18eb});var socket=require(_0xa7d9('0x1a'))(new Redis(config[_0xa7d9('0x17')]));require(_0xa7d9('0x1b'))[_0xa7d9('0x1c')](socket);function respondWithStatusCode(_0xbf81f6,_0x54cdea){_0x54cdea=_0x54cdea||0xcc;return function(_0x5f41f2){if(_0x5f41f2){return _0xbf81f6[_0xa7d9('0x1d')](_0x54cdea);}return _0xbf81f6[_0xa7d9('0x1e')](_0x54cdea)[_0xa7d9('0x1f')]();};}function respondWithResult(_0x29f3fd,_0x3794f2){_0x3794f2=_0x3794f2||0xc8;return function(_0x334d7e){if(_0x334d7e){return _0x29f3fd['status'](_0x3794f2)[_0xa7d9('0x20')](_0x334d7e);}};}function respondWithFilteredResult(_0x10fef5,_0xa02ca8){return function(_0x1bd215){if(_0x1bd215){var _0x18faa3=typeof _0xa02ca8[_0xa7d9('0x21')]==='undefined'&&typeof _0xa02ca8[_0xa7d9('0x22')]===_0xa7d9('0x23');var _0x55bb4d=_0x1bd215[_0xa7d9('0x24')];var _0x4e26d8=_0x18faa3?0x0:_0xa02ca8[_0xa7d9('0x21')];var _0x41a4b0=_0x18faa3?_0x1bd215[_0xa7d9('0x24')]:_0xa02ca8[_0xa7d9('0x21')]+_0xa02ca8[_0xa7d9('0x22')];var _0x2ae668;if(_0x41a4b0>=_0x55bb4d){_0x41a4b0=_0x55bb4d;_0x2ae668=0xc8;}else{_0x2ae668=0xce;}_0x10fef5[_0xa7d9('0x1e')](_0x2ae668);return _0x10fef5[_0xa7d9('0x25')](_0xa7d9('0x26'),_0x4e26d8+'-'+_0x41a4b0+'/'+_0x55bb4d)[_0xa7d9('0x20')](_0x1bd215);}return null;};}function patchUpdates(_0x2e182a){return function(_0x2a2107){try{jsonpatch['apply'](_0x2a2107,_0x2e182a,!![]);}catch(_0x5d9d6c){return BPromise[_0xa7d9('0x27')](_0x5d9d6c);}return _0x2a2107[_0xa7d9('0x28')]();};}function saveUpdates(_0x2f34f5,_0x4035c6){return function(_0x4791cb){if(_0x4791cb){return _0x4791cb[_0xa7d9('0x29')](_0x2f34f5)[_0xa7d9('0x2a')](function(_0x49a3cf){return _0x49a3cf;});}return null;};}function removeEntity(_0x1a1827,_0x3f7efe){return function(_0x5e88f6){if(_0x5e88f6){return _0x5e88f6[_0xa7d9('0x2b')]()[_0xa7d9('0x2a')](function(){_0x1a1827[_0xa7d9('0x1e')](0xcc)[_0xa7d9('0x1f')]();});}};}function handleEntityNotFound(_0x5b96de,_0x4f5d2a){return function(_0x267f1c){if(!_0x267f1c){_0x5b96de['sendStatus'](0x194);}return _0x267f1c;};}function handleError(_0xcabd12,_0x563ea8){_0x563ea8=_0x563ea8||0x1f4;return function(_0x4ac1a8){logger['error'](_0x4ac1a8[_0xa7d9('0x2c')]);if(_0x4ac1a8[_0xa7d9('0x2d')]){delete _0x4ac1a8[_0xa7d9('0x2d')];}_0xcabd12[_0xa7d9('0x1e')](_0x563ea8)['send'](_0x4ac1a8);};}exports['index']=function(_0x31bde7,_0x31bf57){var _0x17d101={},_0x3f2c52={},_0x57fc93={'count':0x0,'rows':[]};var _0x41dde7=_['map'](db[_0xa7d9('0x2e')][_0xa7d9('0x2f')],function(_0xdc3c4d){return{'name':_0xdc3c4d[_0xa7d9('0x30')],'type':_0xdc3c4d[_0xa7d9('0x31')][_0xa7d9('0x32')]};});_0x3f2c52[_0xa7d9('0x33')]=_[_0xa7d9('0x34')](_0x41dde7,_0xa7d9('0x2d'));_0x3f2c52[_0xa7d9('0x35')]=_['keys'](_0x31bde7[_0xa7d9('0x35')]);_0x3f2c52[_0xa7d9('0x36')]=_[_0xa7d9('0x37')](_0x3f2c52[_0xa7d9('0x33')],_0x3f2c52[_0xa7d9('0x35')]);_0x17d101[_0xa7d9('0x38')]=_[_0xa7d9('0x37')](_0x3f2c52['model'],qs[_0xa7d9('0x39')](_0x31bde7[_0xa7d9('0x35')][_0xa7d9('0x39')]));_0x17d101['attributes']=_0x17d101[_0xa7d9('0x38')][_0xa7d9('0x3a')]?_0x17d101[_0xa7d9('0x38')]:_0x3f2c52[_0xa7d9('0x33')];if(!_0x31bde7['query'][_0xa7d9('0x3b')]('nolimit')){_0x17d101['limit']=qs['limit'](_0x31bde7[_0xa7d9('0x35')][_0xa7d9('0x22')]);_0x17d101['offset']=qs[_0xa7d9('0x21')](_0x31bde7['query'][_0xa7d9('0x21')]);}_0x17d101[_0xa7d9('0x3c')]=qs['sort'](_0x31bde7[_0xa7d9('0x35')][_0xa7d9('0x3d')]);_0x17d101[_0xa7d9('0x3e')]=qs[_0xa7d9('0x36')](_['pick'](_0x31bde7['query'],_0x3f2c52[_0xa7d9('0x36')]),_0x41dde7);if(_0x31bde7[_0xa7d9('0x35')][_0xa7d9('0x3f')]){_0x17d101[_0xa7d9('0x3e')]=_['merge'](_0x17d101[_0xa7d9('0x3e')],{'$or':_[_0xa7d9('0x34')](_0x41dde7,function(_0x5b9077){if(_0x5b9077['type']!==_0xa7d9('0x40')){var _0x5eb0d7={};_0x5eb0d7[_0x5b9077[_0xa7d9('0x2d')]]={'$like':'%'+_0x31bde7[_0xa7d9('0x35')][_0xa7d9('0x3f')]+'%'};return _0x5eb0d7;}})});}_0x17d101=_['merge']({},_0x17d101,_0x31bde7[_0xa7d9('0x41')]);var _0x3a011e={'where':_0x17d101[_0xa7d9('0x3e')]};return db[_0xa7d9('0x2e')]['count'](_0x3a011e)['then'](function(_0x111578){_0x57fc93[_0xa7d9('0x24')]=_0x111578;if(_0x31bde7[_0xa7d9('0x35')]['includeAll']){_0x17d101[_0xa7d9('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xa7d9('0x43')](_0x17d101);})[_0xa7d9('0x2a')](function(_0x5ae19f){_0x57fc93[_0xa7d9('0x44')]=_0x5ae19f;return _0x57fc93;})[_0xa7d9('0x2a')](respondWithFilteredResult(_0x31bf57,_0x17d101))[_0xa7d9('0x45')](handleError(_0x31bf57,null));};exports[_0xa7d9('0x46')]=function(_0x313445,_0xf6e9dd){var _0x7bea9f={'raw':!![],'where':{'id':_0x313445[_0xa7d9('0x47')]['id']}},_0x2bb9c8={};_0x2bb9c8[_0xa7d9('0x33')]=_[_0xa7d9('0x48')](db['ChatInternalMessage'][_0xa7d9('0x2f')]);_0x2bb9c8['query']=_[_0xa7d9('0x48')](_0x313445[_0xa7d9('0x35')]);_0x2bb9c8[_0xa7d9('0x36')]=_[_0xa7d9('0x37')](_0x2bb9c8[_0xa7d9('0x33')],_0x2bb9c8[_0xa7d9('0x35')]);_0x7bea9f['attributes']=_[_0xa7d9('0x37')](_0x2bb9c8[_0xa7d9('0x33')],qs[_0xa7d9('0x39')](_0x313445[_0xa7d9('0x35')]['fields']));_0x7bea9f[_0xa7d9('0x38')]=_0x7bea9f[_0xa7d9('0x38')][_0xa7d9('0x3a')]?_0x7bea9f[_0xa7d9('0x38')]:_0x2bb9c8[_0xa7d9('0x33')];if(_0x313445[_0xa7d9('0x35')][_0xa7d9('0x49')]){_0x7bea9f['include']=[{'all':!![]}];}_0x7bea9f=_['merge']({},_0x7bea9f,_0x313445[_0xa7d9('0x41')]);return db['ChatInternalMessage']['find'](_0x7bea9f)[_0xa7d9('0x2a')](handleEntityNotFound(_0xf6e9dd,null))[_0xa7d9('0x2a')](respondWithResult(_0xf6e9dd,null))[_0xa7d9('0x45')](handleError(_0xf6e9dd,null));};exports[_0xa7d9('0x4a')]=function(_0x30eaf8,_0x349cb4){return db['ChatInternalMessage'][_0xa7d9('0x4a')](_0x30eaf8[_0xa7d9('0x4b')],{})[_0xa7d9('0x2a')](respondWithResult(_0x349cb4,0xc9))[_0xa7d9('0x45')](handleError(_0x349cb4,null));};exports[_0xa7d9('0x29')]=function(_0x4424b2,_0xbd6b4e){if(_0x4424b2['body']['id']){delete _0x4424b2['body']['id'];}return db[_0xa7d9('0x2e')][_0xa7d9('0x4c')]({'where':{'id':_0x4424b2[_0xa7d9('0x47')]['id']}})[_0xa7d9('0x2a')](handleEntityNotFound(_0xbd6b4e,null))[_0xa7d9('0x2a')](saveUpdates(_0x4424b2[_0xa7d9('0x4b')],null))[_0xa7d9('0x2a')](respondWithResult(_0xbd6b4e,null))['catch'](handleError(_0xbd6b4e,null));};exports[_0xa7d9('0x2b')]=function(_0x30215f,_0xdc1332){return db[_0xa7d9('0x2e')][_0xa7d9('0x4c')]({'where':{'id':_0x30215f['params']['id']}})[_0xa7d9('0x2a')](handleEntityNotFound(_0xdc1332,null))[_0xa7d9('0x2a')](removeEntity(_0xdc1332,null))[_0xa7d9('0x45')](handleError(_0xdc1332,null));};exports['describe']=function(_0x5e25a9,_0x4db3f4){return db[_0xa7d9('0x2e')][_0xa7d9('0x4d')]()[_0xa7d9('0x2a')](respondWithResult(_0x4db3f4,null))[_0xa7d9('0x45')](handleError(_0x4db3f4,null));};function wrapUser(_0x18a823){return function(_0xd2adb0){var _0x1cb799=_0x18a823['get']({'plain':!![]});_0x1cb799[_0xa7d9('0x4e')]=[];if(_0xd2adb0){_0x1cb799[_0xa7d9('0x4f')]=_0xd2adb0[_0xa7d9('0x50')];_0x1cb799['lastMessage']=_0xd2adb0;}else{_0x1cb799[_0xa7d9('0x4f')]=moment(0x0)['format'](_0xa7d9('0x51'));_0x1cb799[_0xa7d9('0x52')]={};}return _0x1cb799;};}exports[_0xa7d9('0x53')]=function(_0x58156e,_0x4162f1,_0x205a27){var _0xa90e89=[];return db[_0xa7d9('0x54')]['findAll']({'where':{'role':[_0xa7d9('0x55'),_0xa7d9('0x56'),_0xa7d9('0x57')]},'attributes':['id',_0xa7d9('0x58'),_0xa7d9('0x2d'),_0xa7d9('0x59'),_0xa7d9('0x5a'),'internal',_0xa7d9('0x5b'),_0xa7d9('0x5c'),'allowmessenger',_0xa7d9('0x5d')],'order':qs['sort'](_0xa7d9('0x5e')),'include':[{'model':db[_0xa7d9('0x5f')],'as':_0xa7d9('0x60'),'attributes':['id',_0xa7d9('0x2d'),_0xa7d9('0x31')],'through':{'attributes':[]}}]})[_0xa7d9('0x2a')](function(_0xc03865){if(_0xc03865){var _0x3044bf=_0x58156e[_0xa7d9('0x57')][_0xa7d9('0x61')]({'plain':!![]});if(!_0x3044bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3044bf[_0xa7d9('0x59')]===_0xa7d9('0x57')){return db[_0xa7d9('0x62')][_0xa7d9('0x4c')]({'where':{'name':_0xa7d9('0x63'),'userProfileId':_0x3044bf[_0xa7d9('0x64')]},'raw':!![]})[_0xa7d9('0x2a')](function(_0x21309b){if(_0x21309b){if(_0x21309b[_0xa7d9('0x65')]===0x0){return db[_0xa7d9('0x66')][_0xa7d9('0x43')]({'where':{'sectionId':_0x21309b['id']},'raw':!![]})[_0xa7d9('0x2a')](function(_0x4b2784){var _0x490637=[];if(_[_0xa7d9('0x67')](_0x4b2784)){_0x490637=_['filter'](_0xc03865,function(_0x2e75fc){if(_0x2e75fc[_0xa7d9('0x59')]!==_0xa7d9('0x55')){return _0x2e75fc;}});return _0x490637;}else{for(var _0x208bbd=0x0;_0x208bbd<_0xc03865[_0xa7d9('0x3a')];_0x208bbd++){var _0x6a6c4c=_0xc03865[_0x208bbd];if(_0x6a6c4c['role']===_0xa7d9('0x55')){var _0x4f90a8=_[_0xa7d9('0x4c')](_0x4b2784,function(_0x36b889){return _0x36b889[_0xa7d9('0x68')]===_0x6a6c4c['id'];});if(_0x4f90a8)_0x490637[_0xa7d9('0x69')](_0x6a6c4c);}else{_0x490637[_0xa7d9('0x69')](_0x6a6c4c);}}return _0x490637;}});}else{return _0xc03865;}}else{var _0x4d9975=_[_0xa7d9('0x3f')](_0xc03865,function(_0x662f2f){if(_0x662f2f[_0xa7d9('0x59')]!=='agent'){return _0x662f2f;}});return _0x4d9975;}});}else{return _0xc03865;}}})[_0xa7d9('0x2a')](function(_0x2efaaa){var _0xfb17a6=[];if(_0x2efaaa){_0xa90e89=_0x2efaaa;for(var _0x4d4ead=0x0;_0x4d4ead<_0x2efaaa[_0xa7d9('0x3a')];_0x4d4ead+=0x1){_0xa90e89[_0x4d4ead][_0xa7d9('0x4e')]=[];_0xfb17a6[_0xa7d9('0x69')](db['ChatInternalMessage'][_0xa7d9('0x4c')]({'where':{'FromId':[_0x58156e[_0xa7d9('0x57')]['id'],_0x2efaaa[_0x4d4ead]['id']],'ToId':[_0x58156e[_0xa7d9('0x57')]['id'],_0x2efaaa[_0x4d4ead]['id']],'ChatGroupId':null},'attributes':['id',_0xa7d9('0x50'),_0xa7d9('0x6a'),'ToId',_0xa7d9('0x6b'),_0xa7d9('0x4b')],'order':qs[_0xa7d9('0x3d')](_0xa7d9('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa7d9('0x2a')](wrapUser(_0x2efaaa[_0x4d4ead])));}return BPromise['all'](_0xfb17a6);}return[];})[_0xa7d9('0x2a')](function(_0x28215f){return{'rows':_0x28215f,'count':_0x28215f[_0xa7d9('0x3a')]};})['then'](respondWithResult(_0x4162f1,null))[_0xa7d9('0x45')](handleError(_0x4162f1,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index dc7af34..7971d47 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 _0x50d5=['hook','events','ChatInternalMessage','update','remove','emit','hasOwnProperty'];(function(_0x2dab92,_0x2ae201){var _0x30d9ba=function(_0x4c441e){while(--_0x4c441e){_0x2dab92['push'](_0x2dab92['shift']());}};_0x30d9ba(++_0x2ae201);}(_0x50d5,0x166));var _0x550d=function(_0x93ad3e,_0x23366f){_0x93ad3e=_0x93ad3e-0x0;var _0x4c822f=_0x50d5[_0x93ad3e];return _0x4c822f;};'use strict';var EventEmitter=require(_0x550d('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x550d('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x550d('0x2'),'afterDestroy':_0x550d('0x3')};function emitEvent(_0x3e5a56){return function(_0x3a8409,_0x17eb90,_0x342ef2){ChatInternalMessageEvents['emit'](_0x3e5a56+':'+_0x3a8409['id'],_0x3a8409);ChatInternalMessageEvents[_0x550d('0x4')](_0x3e5a56,_0x3a8409);_0x342ef2(null);};}for(var e in events){if(events[_0x550d('0x5')](e)){var event=events[e];ChatInternalMessage[_0x550d('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x2ebe=['../../mysqldb','ChatInternalMessage','update','emit','hasOwnProperty','events'];(function(_0x428c93,_0x15cf4b){var _0x5d00f8=function(_0x89d738){while(--_0x89d738){_0x428c93['push'](_0x428c93['shift']());}};_0x5d00f8(++_0x15cf4b);}(_0x2ebe,0x125));var _0xe2eb=function(_0x44ba72,_0x1e933e){_0x44ba72=_0x44ba72-0x0;var _0x5d0b21=_0x2ebe[_0x44ba72];return _0x5d0b21;};'use strict';var EventEmitter=require(_0xe2eb('0x0'));var ChatInternalMessage=require(_0xe2eb('0x1'))['db'][_0xe2eb('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe2eb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x11b44c){return function(_0x1a5a05,_0x94b13f,_0x30851c){ChatInternalMessageEvents[_0xe2eb('0x4')](_0x11b44c+':'+_0x1a5a05['id'],_0x1a5a05);ChatInternalMessageEvents[_0xe2eb('0x4')](_0x11b44c,_0x1a5a05);_0x30851c(null);};}for(var e in events){if(events[_0xe2eb('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index e0df44c..9e718ef 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 _0xc978=['lodash','../../config/logger','api','bluebird','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0xc978,0x13f));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require('util');var logger=require(_0x8c97('0x1'))(_0x8c97('0x2'));var moment=require('moment');var BPromise=require(_0x8c97('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8c97('0x4'));module[_0x8c97('0x5')]=function(_0x598bcc,_0x31a968){return _0x598bcc[_0x8c97('0x6')](_0x8c97('0x7'),attributes,{'tableName':_0x8c97('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c97('0x9'),'collate':_0x8c97('0xa')});}; \ No newline at end of file +var _0xd848=['bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x4cbc90,_0x551c3e){var _0x228d29=function(_0x3e54e3){while(--_0x3e54e3){_0x4cbc90['push'](_0x4cbc90['shift']());}};_0x228d29(++_0x551c3e);}(_0xd848,0x135));var _0x8d84=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0xd848[_0x2bcd1f];return _0x2381ca;};'use strict';var _=require(_0x8d84('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d84('0x1'));var moment=require(_0x8d84('0x2'));var BPromise=require(_0x8d84('0x3'));var rp=require(_0x8d84('0x4'));var fs=require('fs');var path=require(_0x8d84('0x5'));var rimraf=require(_0x8d84('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d84('0x7'));module[_0x8d84('0x8')]=function(_0x327e32,_0x515a1c){return _0x327e32[_0x8d84('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x8d84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8d84('0xb'),'collate':_0x8d84('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a673da6..964c7a2 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 _0x3316=['message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x23e5ce,_0x57584d){var _0x2ce19b=function(_0x318e1f){while(--_0x318e1f){_0x23e5ce['push'](_0x23e5ce['shift']());}};_0x2ce19b(++_0x57584d);}(_0x3316,0x161));var _0x6331=function(_0x514e38,_0x18958d){_0x514e38=_0x514e38-0x0;var _0x57305d=_0x3316[_0x514e38];return _0x57305d;};'use strict';var _=require(_0x6331('0x0'));var util=require('util');var moment=require(_0x6331('0x1'));var BPromise=require('bluebird');var rs=require(_0x6331('0x2'));var fs=require('fs');var Redis=require(_0x6331('0x3'));var db=require(_0x6331('0x4'))['db'];var utils=require(_0x6331('0x5'));var logger=require(_0x6331('0x6'))('rpc');var config=require(_0x6331('0x7'));var jayson=require(_0x6331('0x8'));var client=jayson[_0x6331('0x9')][_0x6331('0xa')]({'port':0x232a});config[_0x6331('0xb')]=_[_0x6331('0xc')](config[_0x6331('0xb')],{'host':_0x6331('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6331('0xb')]));require(_0x6331('0xe'))[_0x6331('0xf')](socket);function respondWithRpcPromise(_0x446524,_0x407303,_0x34065d){return new BPromise(function(_0x15aa07,_0x27a8ef){return client[_0x6331('0x10')](_0x446524,_0x34065d)[_0x6331('0x11')](function(_0x5365b6){logger[_0x6331('0x12')](_0x6331('0x13'),_0x407303,'request\x20sent');logger['debug'](_0x6331('0x14'),_0x407303,_0x6331('0x15'),JSON[_0x6331('0x16')](_0x5365b6));if(_0x5365b6['error']){if(_0x5365b6[_0x6331('0x17')][_0x6331('0x18')]===0x1f4){logger[_0x6331('0x17')](_0x6331('0x13'),_0x407303,_0x5365b6['error'][_0x6331('0x19')]);return _0x27a8ef(_0x5365b6[_0x6331('0x17')][_0x6331('0x19')]);}logger[_0x6331('0x17')](_0x6331('0x13'),_0x407303,_0x5365b6[_0x6331('0x17')][_0x6331('0x19')]);return _0x15aa07(_0x5365b6[_0x6331('0x17')][_0x6331('0x19')]);}else{logger['info'](_0x6331('0x13'),_0x407303,'request\x20sent');_0x15aa07(_0x5365b6[_0x6331('0x1a')][_0x6331('0x19')]);}})['catch'](function(_0x453e20){logger['error'](_0x6331('0x13'),_0x407303,_0x453e20);_0x27a8ef(_0x453e20);});});} \ No newline at end of file +var _0xa176=['../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','code','error','ChatInternalMessage,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa176,0xaa));var _0x6a17=function(_0x48d587,_0x466137){_0x48d587=_0x48d587-0x0;var _0xd55dc4=_0xa176[_0x48d587];return _0xd55dc4;};'use strict';var _=require(_0x6a17('0x0'));var util=require(_0x6a17('0x1'));var moment=require('moment');var BPromise=require(_0x6a17('0x2'));var rs=require(_0x6a17('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a17('0x4'))['db'];var utils=require(_0x6a17('0x5'));var logger=require(_0x6a17('0x6'))(_0x6a17('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a17('0x8'));var client=jayson[_0x6a17('0x9')]['http']({'port':0x232a});config[_0x6a17('0xa')]=_['defaults'](config['redis'],{'host':_0x6a17('0xb'),'port':0x18eb});var socket=require(_0x6a17('0xc'))(new Redis(config[_0x6a17('0xa')]));require(_0x6a17('0xd'))[_0x6a17('0xe')](socket);function respondWithRpcPromise(_0x12756b,_0x329af7,_0x5591b9){return new BPromise(function(_0x533846,_0x3e33da){return client[_0x6a17('0xf')](_0x12756b,_0x5591b9)[_0x6a17('0x10')](function(_0x4ff145){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x329af7,_0x6a17('0x11'));logger['debug'](_0x6a17('0x12'),_0x329af7,_0x6a17('0x11'),JSON['stringify'](_0x4ff145));if(_0x4ff145['error']){if(_0x4ff145['error'][_0x6a17('0x13')]===0x1f4){logger[_0x6a17('0x14')](_0x6a17('0x15'),_0x329af7,_0x4ff145[_0x6a17('0x14')]['message']);return _0x3e33da(_0x4ff145[_0x6a17('0x14')]['message']);}logger[_0x6a17('0x14')](_0x6a17('0x15'),_0x329af7,_0x4ff145[_0x6a17('0x14')][_0x6a17('0x16')]);return _0x533846(_0x4ff145['error'][_0x6a17('0x16')]);}else{logger[_0x6a17('0x17')](_0x6a17('0x15'),_0x329af7,_0x6a17('0x11'));_0x533846(_0x4ff145['result'][_0x6a17('0x16')]);}})[_0x6a17('0x18')](function(_0x5d9500){logger[_0x6a17('0x14')](_0x6a17('0x15'),_0x329af7,_0x5d9500);_0x3e33da(_0x5d9500);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ebad821..1849753 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 _0x31bc=['save','remove','update','emit','removeListener','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x31bc,0x92));var _0xc31b=function(_0x2abab4,_0x3671f9){_0x2abab4=_0x2abab4-0x0;var _0x21ab3d=_0x31bc[_0x2abab4];return _0x21ab3d;};'use strict';var ChatInternalMessageEvents=require(_0xc31b('0x0'));var events=[_0xc31b('0x1'),_0xc31b('0x2'),_0xc31b('0x3')];function createListener(_0x36a1ca,_0x1be77b){return function(_0x1dbe54){_0x1be77b[_0xc31b('0x4')](_0x36a1ca,_0x1dbe54);};}function removeListener(_0x308135,_0x5805c4){return function(){ChatInternalMessageEvents[_0xc31b('0x5')](_0x308135,_0x5805c4);};}exports['register']=function(_0x11edd4){for(var _0x248da3=0x0,_0x502b09=events['length'];_0x248da3<_0x502b09;_0x248da3++){var _0x15e3d2=events[_0x248da3];var _0x33aa23=createListener(_0xc31b('0x6')+_0x15e3d2,_0x11edd4);ChatInternalMessageEvents['on'](_0x15e3d2,_0x33aa23);}}; \ No newline at end of file +var _0xe5fd=['save','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x252805,_0x1d1e8e){var _0x3e74b9=function(_0x16d7a0){while(--_0x16d7a0){_0x252805['push'](_0x252805['shift']());}};_0x3e74b9(++_0x1d1e8e);}(_0xe5fd,0x1e7));var _0xde5f=function(_0x233660,_0xb3d9eb){_0x233660=_0x233660-0x0;var _0x24e2e7=_0xe5fd[_0x233660];return _0x24e2e7;};'use strict';var ChatInternalMessageEvents=require(_0xde5f('0x0'));var events=[_0xde5f('0x1'),'remove',_0xde5f('0x2')];function createListener(_0x232af6,_0x3a0427){return function(_0x4e9310){_0x3a0427[_0xde5f('0x3')](_0x232af6,_0x4e9310);};}function removeListener(_0x453c17,_0x4c014b){return function(){ChatInternalMessageEvents[_0xde5f('0x4')](_0x453c17,_0x4c014b);};}exports[_0xde5f('0x5')]=function(_0x105866){for(var _0x3e08fd=0x0,_0x3d6f73=events[_0xde5f('0x6')];_0x3e08fd<_0x3d6f73;_0x3e08fd++){var _0x513d9b=events[_0x3e08fd];var _0x1531a9=createListener(_0xde5f('0x7')+_0x513d9b,_0x105866);ChatInternalMessageEvents['on'](_0x513d9b,_0x1531a9);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 0ee8b56..6e29bcd 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 _0x9486=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/users','getUsers','/:id','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x20a048,_0x454df3){var _0x1df9b5=function(_0x25f6aa){while(--_0x25f6aa){_0x20a048['push'](_0x20a048['shift']());}};_0x1df9b5(++_0x454df3);}(_0x9486,0x73));var _0x6948=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9486[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x6948('0x0'));var util=require('util');var path=require(_0x6948('0x1'));var timeout=require(_0x6948('0x2'));var express=require(_0x6948('0x3'));var router=express[_0x6948('0x4')]();var fs_extra=require(_0x6948('0x5'));var auth=require(_0x6948('0x6'));var interaction=require(_0x6948('0x7'));var config=require(_0x6948('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x6948('0x9')]('/',auth['isAuthenticated'](),controller[_0x6948('0xa')]);router['get']('/describe',auth[_0x6948('0xb')](),controller['describe']);router[_0x6948('0x9')](_0x6948('0xc'),auth['isAuthenticated'](),controller[_0x6948('0xd')]);router[_0x6948('0x9')](_0x6948('0xe'),auth[_0x6948('0xb')](),controller['show']);router['post']('/',auth[_0x6948('0xb')](),controller[_0x6948('0xf')]);router[_0x6948('0x10')](_0x6948('0xe'),controller['update']);router[_0x6948('0x11')](_0x6948('0xe'),auth[_0x6948('0xb')](),controller[_0x6948('0x12')]);module[_0x6948('0x13')]=router; \ No newline at end of file +var _0xed9c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','/describe','/users','getUsers','get','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed9c,0x1c7));var _0xced9=function(_0xa19953,_0x294568){_0xa19953=_0xa19953-0x0;var _0x4f9a18=_0xed9c[_0xa19953];return _0x4f9a18;};'use strict';var multer=require(_0xced9('0x0'));var util=require('util');var path=require(_0xced9('0x1'));var timeout=require(_0xced9('0x2'));var express=require(_0xced9('0x3'));var router=express[_0xced9('0x4')]();var fs_extra=require(_0xced9('0x5'));var auth=require(_0xced9('0x6'));var interaction=require(_0xced9('0x7'));var config=require(_0xced9('0x8'));var controller=require(_0xced9('0x9'));router['get']('/',auth[_0xced9('0xa')](),controller['index']);router['get'](_0xced9('0xb'),auth[_0xced9('0xa')](),controller['describe']);router['get'](_0xced9('0xc'),auth[_0xced9('0xa')](),controller[_0xced9('0xd')]);router[_0xced9('0xe')]('/:id',auth[_0xced9('0xa')](),controller['show']);router[_0xced9('0xf')]('/',auth[_0xced9('0xa')](),controller[_0xced9('0x10')]);router[_0xced9('0x11')](_0xced9('0x12'),controller[_0xced9('0x13')]);router[_0xced9('0x14')](_0xced9('0x12'),auth[_0xced9('0xa')](),controller[_0xced9('0x15')]);module[_0xced9('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index fea7c08..405e437 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 _0x7275=['out','DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x1b773e,_0x37b69c){var _0x44c4a2=function(_0x2eb17d){while(--_0x2eb17d){_0x1b773e['push'](_0x1b773e['shift']());}};_0x44c4a2(++_0x37b69c);}(_0x7275,0x143));var _0x5727=function(_0x10bd19,_0x5d0490){_0x10bd19=_0x10bd19-0x0;var _0xbe5000=_0x7275[_0x10bd19];return _0xbe5000;};'use strict';var Sequelize=require(_0x5727('0x0'));module[_0x5727('0x1')]={'body':{'type':Sequelize[_0x5727('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5727('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5727('0x4')]('in',_0x5727('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x5727('0x6')]},'providerName':{'type':Sequelize[_0x5727('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf151=['ENUM','out','DATE','TEXT','medium','BOOLEAN'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xf151,0xab));var _0x1f15=function(_0x263d8b,_0x36c3c1){_0x263d8b=_0x263d8b-0x0;var _0x266920=_0xf151[_0x263d8b];return _0x266920;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x1f15('0x0')](_0x1f15('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x1f15('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x1f15('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1f15('0x3')]('in',_0x1f15('0x4')),'defaultValue':_0x1f15('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1f15('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1f15('0x0')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0cdd19f..37543f8 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 _0x5fc0=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','contact','event','rejectmessage','formData','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','create','update','body','describe','chat-interactions','accept','chat','read','readAt','format'];(function(_0x433ef7,_0xa04efb){var _0x19174a=function(_0x1436f5){while(--_0x1436f5){_0x433ef7['push'](_0x433ef7['shift']());}};_0x19174a(++_0xa04efb);}(_0x5fc0,0xa8));var _0x05fc=function(_0x4a140f,_0x5522bc){_0x4a140f=_0x4a140f-0x0;var _0x102680=_0x5fc0[_0x4a140f];return _0x102680;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05fc('0x0'));var zipdir=require(_0x05fc('0x1'));var jsonpatch=require(_0x05fc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x05fc('0x3'));var Mustache=require(_0x05fc('0x4'));var util=require(_0x05fc('0x5'));var path=require(_0x05fc('0x6'));var sox=require(_0x05fc('0x7'));var csv=require(_0x05fc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05fc('0x9'));var squel=require(_0x05fc('0xa'));var crypto=require(_0x05fc('0xb'));var jsforce=require(_0x05fc('0xc'));var deskjs=require(_0x05fc('0xd'));var toCsv=require(_0x05fc('0x8'));var querystring=require(_0x05fc('0xe'));var Papa=require(_0x05fc('0xf'));var Redis=require(_0x05fc('0x10'));var authService=require(_0x05fc('0x11'));var qs=require(_0x05fc('0x12'));var as=require(_0x05fc('0x13'));var hardwareService=require(_0x05fc('0x14'));var logger=require(_0x05fc('0x15'))(_0x05fc('0x16'));var utils=require(_0x05fc('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x05fc('0x18')]=_['defaults'](config[_0x05fc('0x18')],{'host':_0x05fc('0x19'),'port':0x18eb});var socket=require(_0x05fc('0x1a'))(new Redis(config['redis']));require(_0x05fc('0x1b'))[_0x05fc('0x1c')](socket);var jayson=require(_0x05fc('0x1d'));var client=jayson[_0x05fc('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x05fc('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0xad1007,_0xf6472a,_0xcfcbd8,_0x27c6fb){return new BPromise(function(_0x2417ad,_0x270fa4){var _0x4e0258=_0x27c6fb||client;return _0x4e0258[_0x05fc('0x1f')](_0xad1007,_0xcfcbd8)[_0x05fc('0x20')](function(_0xcf059f){logger[_0x05fc('0x21')](_0x05fc('0x22'),_0xf6472a,_0x05fc('0x23'));logger['debug'](_0x05fc('0x24'),_0xf6472a,'request\x20sent',JSON[_0x05fc('0x25')](_0xcf059f));if(_0xcf059f[_0x05fc('0x26')]){if(_0xcf059f[_0x05fc('0x26')][_0x05fc('0x27')]===0x1f4){logger[_0x05fc('0x26')](_0x05fc('0x22'),_0xf6472a,_0xcf059f[_0x05fc('0x26')][_0x05fc('0x28')]);return _0x270fa4(_0xcf059f['error']['message']);}logger['error'](_0x05fc('0x22'),_0xf6472a,_0xcf059f['error']['message']);return _0x2417ad(_0xcf059f['error'][_0x05fc('0x28')]);}else{logger[_0x05fc('0x21')](_0x05fc('0x22'),_0xf6472a,'request\x20sent');_0x2417ad(_0xcf059f[_0x05fc('0x29')][_0x05fc('0x28')]);}})[_0x05fc('0x2a')](function(_0x2a0f83){logger[_0x05fc('0x26')](_0x05fc('0x22'),_0xf6472a,_0x2a0f83);_0x270fa4(_0x2a0f83);});});}function respondWithStatusCode(_0x58b24f,_0x4f2553){_0x4f2553=_0x4f2553||0xcc;return function(_0x595d56){if(_0x595d56){return _0x58b24f['sendStatus'](_0x4f2553);}return _0x58b24f[_0x05fc('0x2b')](_0x4f2553)[_0x05fc('0x2c')]();};}function respondWithResult(_0x3e974b,_0x37d70e){_0x37d70e=_0x37d70e||0xc8;return function(_0x5150d4){if(_0x5150d4){return _0x3e974b[_0x05fc('0x2b')](_0x37d70e)['json'](_0x5150d4);}};}function respondWithFilteredResult(_0x8db9c9,_0x35a132){return function(_0x2fabce){if(_0x2fabce){var _0x22f0cd=typeof _0x35a132[_0x05fc('0x2d')]===_0x05fc('0x2e')&&typeof _0x35a132[_0x05fc('0x2f')]===_0x05fc('0x2e');var _0x490fa8=_0x2fabce['count'];var _0x2c870e=_0x22f0cd?0x0:_0x35a132['offset'];var _0x2bb966=_0x22f0cd?_0x2fabce[_0x05fc('0x30')]:_0x35a132[_0x05fc('0x2d')]+_0x35a132[_0x05fc('0x2f')];var _0x1976fa;if(_0x2bb966>=_0x490fa8){_0x2bb966=_0x490fa8;_0x1976fa=0xc8;}else{_0x1976fa=0xce;}_0x8db9c9[_0x05fc('0x2b')](_0x1976fa);return _0x8db9c9[_0x05fc('0x31')](_0x05fc('0x32'),_0x2c870e+'-'+_0x2bb966+'/'+_0x490fa8)['json'](_0x2fabce);}return null;};}function patchUpdates(_0x2454ef){return function(_0x527ce6){try{jsonpatch[_0x05fc('0x33')](_0x527ce6,_0x2454ef,!![]);}catch(_0xacd51){return BPromise[_0x05fc('0x34')](_0xacd51);}return _0x527ce6['save']();};}function saveUpdates(_0x4586ac,_0x34383b){return function(_0x58ecf0){if(_0x58ecf0){return _0x58ecf0['update'](_0x4586ac)['then'](function(_0x48bbce){return _0x48bbce;});}return null;};}function removeEntity(_0x423054,_0x1872ea){return function(_0x309a15){if(_0x309a15){return _0x309a15[_0x05fc('0x35')]()[_0x05fc('0x20')](function(){_0x423054[_0x05fc('0x2b')](0xcc)[_0x05fc('0x2c')]();});}};}function handleEntityNotFound(_0x17d699,_0x56e123){return function(_0x5b2b96){if(!_0x5b2b96){_0x17d699[_0x05fc('0x36')](0x194);}return _0x5b2b96;};}function handleError(_0x20d482,_0x97ba42){_0x97ba42=_0x97ba42||0x1f4;return function(_0x43ef53){logger[_0x05fc('0x26')](_0x43ef53[_0x05fc('0x37')]);if(_0x43ef53[_0x05fc('0x38')]){delete _0x43ef53[_0x05fc('0x38')];}_0x20d482['status'](_0x97ba42)[_0x05fc('0x39')](_0x43ef53);};}exports[_0x05fc('0x3a')]=function(_0x9e755,_0x1b30db){var _0x254ed7={},_0x5b6d44={},_0x3cc87d={'count':0x0,'rows':[]};var _0x3a5743=_[_0x05fc('0x3b')](db[_0x05fc('0x3c')][_0x05fc('0x3d')],function(_0x4d1012){return{'name':_0x4d1012['fieldName'],'type':_0x4d1012['type'][_0x05fc('0x3e')]};});_0x5b6d44['model']=_[_0x05fc('0x3b')](_0x3a5743,_0x05fc('0x38'));_0x5b6d44[_0x05fc('0x3f')]=_[_0x05fc('0x40')](_0x9e755[_0x05fc('0x3f')]);_0x5b6d44[_0x05fc('0x41')]=_[_0x05fc('0x42')](_0x5b6d44['model'],_0x5b6d44[_0x05fc('0x3f')]);_0x254ed7[_0x05fc('0x43')]=_['intersection'](_0x5b6d44['model'],qs[_0x05fc('0x44')](_0x9e755[_0x05fc('0x3f')][_0x05fc('0x44')]));_0x254ed7[_0x05fc('0x43')]=_0x254ed7['attributes'][_0x05fc('0x45')]?_0x254ed7['attributes']:_0x5b6d44[_0x05fc('0x46')];if(!_0x9e755[_0x05fc('0x3f')][_0x05fc('0x47')](_0x05fc('0x48'))){_0x254ed7[_0x05fc('0x2f')]=qs[_0x05fc('0x2f')](_0x9e755[_0x05fc('0x3f')][_0x05fc('0x2f')]);_0x254ed7[_0x05fc('0x2d')]=qs['offset'](_0x9e755[_0x05fc('0x3f')][_0x05fc('0x2d')]);}_0x254ed7[_0x05fc('0x49')]=qs[_0x05fc('0x4a')](_0x9e755[_0x05fc('0x3f')][_0x05fc('0x4a')]);_0x254ed7[_0x05fc('0x4b')]=qs[_0x05fc('0x41')](_[_0x05fc('0x4c')](_0x9e755[_0x05fc('0x3f')],_0x5b6d44[_0x05fc('0x41')]),_0x3a5743);if(_0x9e755[_0x05fc('0x3f')][_0x05fc('0x4d')]){_0x254ed7['where']=_[_0x05fc('0x4e')](_0x254ed7[_0x05fc('0x4b')],{'$or':_[_0x05fc('0x3b')](_0x3a5743,function(_0x5124b5){if(_0x5124b5[_0x05fc('0x4f')]!==_0x05fc('0x50')){var _0x457dd2={};_0x457dd2[_0x5124b5['name']]={'$like':'%'+_0x9e755[_0x05fc('0x3f')][_0x05fc('0x4d')]+'%'};return _0x457dd2;}})});}_0x254ed7=_['merge']({},_0x254ed7,_0x9e755[_0x05fc('0x51')]);var _0x11ce31={'where':_0x254ed7[_0x05fc('0x4b')]};return db[_0x05fc('0x3c')][_0x05fc('0x30')](_0x11ce31)[_0x05fc('0x20')](function(_0x50ab51){_0x3cc87d[_0x05fc('0x30')]=_0x50ab51;if(_0x9e755['query'][_0x05fc('0x52')]){_0x254ed7[_0x05fc('0x53')]=[{'all':!![]}];}return db[_0x05fc('0x3c')]['findAll'](_0x254ed7);})[_0x05fc('0x20')](function(_0x54747f){_0x3cc87d[_0x05fc('0x54')]=_0x54747f;return _0x3cc87d;})[_0x05fc('0x20')](respondWithFilteredResult(_0x1b30db,_0x254ed7))['catch'](handleError(_0x1b30db,null));};exports[_0x05fc('0x55')]=function(_0x2c0ce7,_0x1be0c2){var _0x8359af={'raw':!![],'where':{'id':_0x2c0ce7[_0x05fc('0x56')]['id']}},_0x44a38d={};_0x44a38d[_0x05fc('0x46')]=_[_0x05fc('0x40')](db[_0x05fc('0x3c')][_0x05fc('0x3d')]);_0x44a38d[_0x05fc('0x3f')]=_[_0x05fc('0x40')](_0x2c0ce7[_0x05fc('0x3f')]);_0x44a38d[_0x05fc('0x41')]=_[_0x05fc('0x42')](_0x44a38d[_0x05fc('0x46')],_0x44a38d[_0x05fc('0x3f')]);_0x8359af['attributes']=_[_0x05fc('0x42')](_0x44a38d[_0x05fc('0x46')],qs['fields'](_0x2c0ce7[_0x05fc('0x3f')]['fields']));_0x8359af[_0x05fc('0x43')]=_0x8359af[_0x05fc('0x43')][_0x05fc('0x45')]?_0x8359af[_0x05fc('0x43')]:_0x44a38d[_0x05fc('0x46')];if(_0x2c0ce7[_0x05fc('0x3f')][_0x05fc('0x52')]){_0x8359af[_0x05fc('0x53')]=[{'all':!![]}];}_0x8359af=_['merge']({},_0x8359af,_0x2c0ce7['options']);return db[_0x05fc('0x3c')][_0x05fc('0x57')](_0x8359af)['then'](handleEntityNotFound(_0x1be0c2,null))[_0x05fc('0x20')](respondWithResult(_0x1be0c2,null))[_0x05fc('0x2a')](handleError(_0x1be0c2,null));};exports[_0x05fc('0x58')]=function(_0x346d11,_0x1a566f){return db[_0x05fc('0x3c')][_0x05fc('0x58')](_0x346d11['body'],{})[_0x05fc('0x20')](respondWithResult(_0x1a566f,0xc9))['catch'](handleError(_0x1a566f,null));};exports[_0x05fc('0x59')]=function(_0x172ad9,_0x340b22){if(_0x172ad9[_0x05fc('0x5a')]['id']){delete _0x172ad9[_0x05fc('0x5a')]['id'];}return db[_0x05fc('0x3c')]['find']({'where':{'id':_0x172ad9['params']['id']}})[_0x05fc('0x20')](handleEntityNotFound(_0x340b22,null))[_0x05fc('0x20')](saveUpdates(_0x172ad9[_0x05fc('0x5a')],null))[_0x05fc('0x20')](respondWithResult(_0x340b22,null))[_0x05fc('0x2a')](handleError(_0x340b22,null));};exports[_0x05fc('0x35')]=function(_0x5bbc0e,_0x51b691){return db[_0x05fc('0x3c')][_0x05fc('0x57')]({'where':{'id':_0x5bbc0e[_0x05fc('0x56')]['id']}})[_0x05fc('0x20')](handleEntityNotFound(_0x51b691,null))['then'](removeEntity(_0x51b691,null))[_0x05fc('0x2a')](handleError(_0x51b691,null));};exports['describe']=function(_0x3c15d1,_0x295328){return db[_0x05fc('0x3c')][_0x05fc('0x5b')]()['then'](respondWithResult(_0x295328,null))['catch'](handleError(_0x295328,null));};var interaction_log=require(_0x05fc('0x15'))(_0x05fc('0x5c'));exports[_0x05fc('0x5d')]=function(_0x7431a5,_0x4f4bf7,_0x2e08f9){var _0x42d65f={'agent':{},'channel':_0x05fc('0x5e')};if(_0x7431a5[_0x05fc('0x5a')]['id']){delete _0x7431a5[_0x05fc('0x5a')]['id'];}_0x7431a5[_0x05fc('0x5a')][_0x05fc('0x5f')]=!![];_0x7431a5[_0x05fc('0x5a')][_0x05fc('0x60')]=moment()[_0x05fc('0x61')](_0x05fc('0x62'));_0x7431a5[_0x05fc('0x5a')][_0x05fc('0x63')]=_0x7431a5['body'][_0x05fc('0x63')]||_0x7431a5[_0x05fc('0x64')]['id'];_0x42d65f[_0x05fc('0x65')]['id']=_0x7431a5[_0x05fc('0x5a')][_0x05fc('0x63')];return db[_0x05fc('0x3c')]['find']({'where':{'id':_0x7431a5[_0x05fc('0x56')]['id'],'UserId':null}})[_0x05fc('0x20')](handleEntityNotFound(_0x4f4bf7,null))[_0x05fc('0x20')](saveUpdates(_0x7431a5['body'],null))[_0x05fc('0x20')](function(_0x572360){if(_0x572360){_0x42d65f['message']=_0x572360[_0x05fc('0x66')]({'plain':!![]});return db[_0x05fc('0x67')][_0x05fc('0x57')]({'where':{'id':_0x572360[_0x05fc('0x68')]}});}return null;})[_0x05fc('0x20')](handleEntityNotFound(_0x4f4bf7,null))['then'](function(_0x3d3621){if(_0x3d3621){return _0x3d3621[_0x05fc('0x59')]({'UserId':_0x7431a5['body'][_0x05fc('0x63')],'read1stAt':_[_0x05fc('0x69')](_0x3d3621[_0x05fc('0x6a')])?moment()[_0x05fc('0x61')](_0x05fc('0x62')):undefined});}return null;})['then'](function(_0x1f4766){if(_0x1f4766){_0x42d65f[_0x05fc('0x6b')]=_0x1f4766[_0x05fc('0x66')]({'plain':!![]});interaction_log[_0x05fc('0x21')](_0x05fc('0x6c'),_0x7431a5[_0x05fc('0x64')]['id'],_0x7431a5['user'][_0x05fc('0x38')],_0x7431a5[_0x05fc('0x64')][_0x05fc('0x6d')],_0x42d65f['interaction']['id'],_0x7431a5['body']?JSON[_0x05fc('0x25')](_0x7431a5[_0x05fc('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x42d65f);}return null;})[_0x05fc('0x20')](function(_0x728d47){var _0x5457cb=_0x05fc('0x6e')+_0x728d47[_0x05fc('0x28')][_0x05fc('0x6f')];return db[_0x05fc('0x70')][_0x05fc('0x3f')](_0x5457cb,{'type':db[_0x05fc('0x71')][_0x05fc('0x72')][_0x05fc('0x73')],'raw':!![]})[_0x05fc('0x20')](function(_0x24c49e){return _0x24c49e;});})[_0x05fc('0x20')](function(_0x1a8165){if(_0x1a8165){_0x42d65f[_0x05fc('0x28')]['contact']=_0x1a8165[0x0];if(!_0x7431a5[_0x05fc('0x5a')]['UserId'])return;return db[_0x05fc('0x74')][_0x05fc('0x57')]({'where':{'id':_0x7431a5['body'][_0x05fc('0x63')],'role':_0x05fc('0x65')},'attributes':['id','name',_0x05fc('0x75'),'email',_0x05fc('0x76')],'raw':!![]});}return null;})[_0x05fc('0x20')](function(_0x2381d4){if(!_0x2381d4)return null;_0x42d65f[_0x05fc('0x28')][_0x05fc('0x65')]=_0x2381d4;return _0x42d65f;})[_0x05fc('0x20')](function(_0xdec83e){if(_0xdec83e){if(_0x7431a5[_0x05fc('0x5a')][_0x05fc('0x77')]){_0x42d65f[_0x05fc('0x28')][_0x05fc('0x78')]=util[_0x05fc('0x61')](_0x05fc('0x79'),_0x7431a5[_0x05fc('0x64')][_0x05fc('0x38')]);_0x42d65f[_0x05fc('0x28')][_0x05fc('0x7a')]=_0x42d65f[_0x05fc('0x7a')];_0x42d65f['message'][_0x05fc('0x7b')]=_0x42d65f[_0x05fc('0x7a')];_0x42d65f[_0x05fc('0x28')]['event']='accept';return respondWithRpcPromise(_0x05fc('0x7c'),'EventManager',{'event':_0x05fc('0x7d'),'message':_[_0x05fc('0x4e')](_0x42d65f[_0x05fc('0x28')],JSON[_0x05fc('0x7e')](_0x42d65f[_0x05fc('0x6b')]['formData']))},client9002)['then'](function(){return _0x42d65f;});}return _0x42d65f;}return null;})[_0x05fc('0x20')](respondWithResult(_0x4f4bf7,null))[_0x05fc('0x2a')](handleError(_0x4f4bf7,null));};var interaction_log=require(_0x05fc('0x15'))('chat-interactions');exports[_0x05fc('0x34')]=function(_0x1404a4,_0x1cbf85,_0x190f47){var _0x52d2c7={'agent':{},'channel':_0x05fc('0x5e')};if(_0x1404a4[_0x05fc('0x5a')]['id']){delete _0x1404a4[_0x05fc('0x5a')]['id'];}_0x1404a4['body']['UserId']=_0x1404a4['body']['UserId']||_0x1404a4[_0x05fc('0x64')]['id'];_0x52d2c7[_0x05fc('0x65')]['id']=_0x1404a4[_0x05fc('0x5a')][_0x05fc('0x63')];return db[_0x05fc('0x3c')][_0x05fc('0x57')]({'where':{'id':_0x1404a4[_0x05fc('0x56')]['id'],'UserId':null}})[_0x05fc('0x20')](handleEntityNotFound(_0x1cbf85,null))[_0x05fc('0x20')](function(_0x330f5c){if(_0x330f5c){_0x52d2c7[_0x05fc('0x28')]=_0x330f5c['get']({'plain':!![]});return db[_0x05fc('0x67')][_0x05fc('0x57')]({'where':{'id':_0x330f5c['ChatInteractionId']}});}return null;})[_0x05fc('0x20')](handleEntityNotFound(_0x1cbf85,null))[_0x05fc('0x20')](function(_0x3d4dc6){if(_0x3d4dc6){_0x52d2c7[_0x05fc('0x6b')]=_0x3d4dc6['get']({'plain':!![]});interaction_log[_0x05fc('0x21')](_0x05fc('0x7f'),_0x1404a4['user']['id'],_0x1404a4['user'][_0x05fc('0x38')],_0x1404a4[_0x05fc('0x64')]['role'],_0x52d2c7[_0x05fc('0x6b')]['id'],_0x1404a4[_0x05fc('0x5a')]?JSON[_0x05fc('0x25')](_0x1404a4[_0x05fc('0x5a')]):_0x05fc('0x80'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x52d2c7);}return null;})[_0x05fc('0x20')](function(_0x2edf3d){var _0x474e3f=_0x05fc('0x6e')+_0x2edf3d[_0x05fc('0x28')][_0x05fc('0x6f')];return db[_0x05fc('0x70')][_0x05fc('0x3f')](_0x474e3f,{'type':db[_0x05fc('0x71')][_0x05fc('0x72')][_0x05fc('0x73')],'raw':!![]})['then'](function(_0x54747e){return _0x54747e;});})[_0x05fc('0x20')](function(_0xd9c2fa){if(_0xd9c2fa){_0x52d2c7[_0x05fc('0x28')][_0x05fc('0x81')]=_0xd9c2fa[0x0];if(!_0x1404a4[_0x05fc('0x5a')]['UserId'])return;return db[_0x05fc('0x74')][_0x05fc('0x57')]({'where':{'id':_0x1404a4[_0x05fc('0x5a')]['UserId'],'role':_0x05fc('0x65')},'attributes':['id','name','fullname','email',_0x05fc('0x76')],'raw':!![]});}return null;})[_0x05fc('0x20')](function(_0x580d11){if(!_0x580d11)return null;_0x52d2c7[_0x05fc('0x28')][_0x05fc('0x65')]=_0x580d11;return _0x52d2c7;})[_0x05fc('0x20')](function(_0x427d74){if(_0x427d74){_0x427d74[_0x05fc('0x28')][_0x05fc('0x78')]=util[_0x05fc('0x61')]('SIP/%s',_0x1404a4['user'][_0x05fc('0x38')]);_0x427d74[_0x05fc('0x28')]['channel']=_0x52d2c7[_0x05fc('0x7a')];_0x427d74[_0x05fc('0x28')][_0x05fc('0x7b')]=_0x52d2c7['channel'];_0x427d74[_0x05fc('0x28')][_0x05fc('0x82')]=_0x05fc('0x34');respondWithRpcPromise('EventManager',_0x05fc('0x7c'),{'event':_0x05fc('0x83'),'message':_[_0x05fc('0x4e')](_0x52d2c7[_0x05fc('0x28')],JSON[_0x05fc('0x7e')](_0x52d2c7['interaction'][_0x05fc('0x84')]))},client9002);return _0x52d2c7;}return null;})[_0x05fc('0x20')](respondWithResult(_0x1cbf85,null))[_0x05fc('0x2a')](handleError(_0x1cbf85,null));}; \ No newline at end of file +var _0x89c4=['get','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','ChatInteraction','ChatInteractionId','RejectMessage','rejectMessage','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','include','find','create','body','params','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x89c4,0x128));var _0x489c=function(_0xc72e5e,_0x385ddf){_0xc72e5e=_0xc72e5e-0x0;var _0x27aef7=_0x89c4[_0xc72e5e];return _0x27aef7;};'use strict';var emlformat=require(_0x489c('0x0'));var rimraf=require(_0x489c('0x1'));var zipdir=require(_0x489c('0x2'));var jsonpatch=require(_0x489c('0x3'));var rp=require(_0x489c('0x4'));var moment=require(_0x489c('0x5'));var BPromise=require(_0x489c('0x6'));var Mustache=require('mustache');var util=require(_0x489c('0x7'));var path=require('path');var sox=require(_0x489c('0x8'));var csv=require(_0x489c('0x9'));var ejs=require(_0x489c('0xa'));var fs=require('fs');var fs_extra=require(_0x489c('0xb'));var _=require(_0x489c('0xc'));var squel=require(_0x489c('0xd'));var crypto=require(_0x489c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x489c('0x9'));var querystring=require(_0x489c('0xf'));var Papa=require(_0x489c('0x10'));var Redis=require(_0x489c('0x11'));var authService=require(_0x489c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x489c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x489c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x489c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x489c('0x16')]=_[_0x489c('0x17')](config[_0x489c('0x16')],{'host':_0x489c('0x18'),'port':0x18eb});var socket=require(_0x489c('0x19'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x489c('0x1a')](socket);var jayson=require(_0x489c('0x1b'));var client=jayson['client'][_0x489c('0x1c')]({'port':0x232c});var client9002=jayson[_0x489c('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x138550,_0x5a3b72,_0x413add,_0x1de386){return new BPromise(function(_0x4d7139,_0x5c6410){var _0x4236d=_0x1de386||client;return _0x4236d[_0x489c('0x1e')](_0x138550,_0x413add)[_0x489c('0x1f')](function(_0x2781e4){logger[_0x489c('0x20')](_0x489c('0x21'),_0x5a3b72,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5a3b72,_0x489c('0x22'),JSON['stringify'](_0x2781e4));if(_0x2781e4[_0x489c('0x23')]){if(_0x2781e4[_0x489c('0x23')]['code']===0x1f4){logger[_0x489c('0x23')](_0x489c('0x21'),_0x5a3b72,_0x2781e4['error']['message']);return _0x5c6410(_0x2781e4['error'][_0x489c('0x24')]);}logger[_0x489c('0x23')](_0x489c('0x21'),_0x5a3b72,_0x2781e4[_0x489c('0x23')][_0x489c('0x24')]);return _0x4d7139(_0x2781e4['error'][_0x489c('0x24')]);}else{logger[_0x489c('0x20')](_0x489c('0x21'),_0x5a3b72,_0x489c('0x22'));_0x4d7139(_0x2781e4[_0x489c('0x25')][_0x489c('0x24')]);}})[_0x489c('0x26')](function(_0x1eb767){logger[_0x489c('0x23')](_0x489c('0x21'),_0x5a3b72,_0x1eb767);_0x5c6410(_0x1eb767);});});}function respondWithStatusCode(_0x52d17c,_0x421e71){_0x421e71=_0x421e71||0xcc;return function(_0x547c87){if(_0x547c87){return _0x52d17c['sendStatus'](_0x421e71);}return _0x52d17c[_0x489c('0x27')](_0x421e71)[_0x489c('0x28')]();};}function respondWithResult(_0x38554a,_0x49d50f){_0x49d50f=_0x49d50f||0xc8;return function(_0x3448bd){if(_0x3448bd){return _0x38554a['status'](_0x49d50f)[_0x489c('0x29')](_0x3448bd);}};}function respondWithFilteredResult(_0x460b89,_0x48fbdc){return function(_0x2b7952){if(_0x2b7952){var _0xaf9b64=typeof _0x48fbdc[_0x489c('0x2a')]===_0x489c('0x2b')&&typeof _0x48fbdc[_0x489c('0x2c')]===_0x489c('0x2b');var _0x1cb18c=_0x2b7952[_0x489c('0x2d')];var _0x9d4bf0=_0xaf9b64?0x0:_0x48fbdc['offset'];var _0x36969d=_0xaf9b64?_0x2b7952['count']:_0x48fbdc['offset']+_0x48fbdc[_0x489c('0x2c')];var _0xf3c705;if(_0x36969d>=_0x1cb18c){_0x36969d=_0x1cb18c;_0xf3c705=0xc8;}else{_0xf3c705=0xce;}_0x460b89['status'](_0xf3c705);return _0x460b89[_0x489c('0x2e')](_0x489c('0x2f'),_0x9d4bf0+'-'+_0x36969d+'/'+_0x1cb18c)[_0x489c('0x29')](_0x2b7952);}return null;};}function patchUpdates(_0x3e1513){return function(_0x430c90){try{jsonpatch[_0x489c('0x30')](_0x430c90,_0x3e1513,!![]);}catch(_0x263ee8){return BPromise[_0x489c('0x31')](_0x263ee8);}return _0x430c90[_0x489c('0x32')]();};}function saveUpdates(_0x4b3c0a,_0x120666){return function(_0x41fea6){if(_0x41fea6){return _0x41fea6['update'](_0x4b3c0a)['then'](function(_0x5d03dc){return _0x5d03dc;});}return null;};}function removeEntity(_0xf85388,_0x17dd6c){return function(_0x7cfc6){if(_0x7cfc6){return _0x7cfc6[_0x489c('0x33')]()[_0x489c('0x1f')](function(){_0xf85388[_0x489c('0x27')](0xcc)[_0x489c('0x28')]();});}};}function handleEntityNotFound(_0x3ef2ca,_0x4b49fc){return function(_0x2a13b6){if(!_0x2a13b6){_0x3ef2ca[_0x489c('0x34')](0x194);}return _0x2a13b6;};}function handleError(_0x569905,_0x1a27c3){_0x1a27c3=_0x1a27c3||0x1f4;return function(_0x20ed52){logger['error'](_0x20ed52[_0x489c('0x35')]);if(_0x20ed52[_0x489c('0x36')]){delete _0x20ed52[_0x489c('0x36')];}_0x569905[_0x489c('0x27')](_0x1a27c3)[_0x489c('0x37')](_0x20ed52);};}exports[_0x489c('0x38')]=function(_0x2c2b2d,_0x1a9ba0){var _0x216d1a={},_0x3a923e={},_0x18da1b={'count':0x0,'rows':[]};var _0x561707=_[_0x489c('0x39')](db[_0x489c('0x3a')][_0x489c('0x3b')],function(_0x2098c5){return{'name':_0x2098c5[_0x489c('0x3c')],'type':_0x2098c5['type'][_0x489c('0x3d')]};});_0x3a923e[_0x489c('0x3e')]=_[_0x489c('0x39')](_0x561707,_0x489c('0x36'));_0x3a923e[_0x489c('0x3f')]=_[_0x489c('0x40')](_0x2c2b2d[_0x489c('0x3f')]);_0x3a923e['filters']=_[_0x489c('0x41')](_0x3a923e['model'],_0x3a923e[_0x489c('0x3f')]);_0x216d1a[_0x489c('0x42')]=_['intersection'](_0x3a923e[_0x489c('0x3e')],qs['fields'](_0x2c2b2d[_0x489c('0x3f')][_0x489c('0x43')]));_0x216d1a[_0x489c('0x42')]=_0x216d1a[_0x489c('0x42')][_0x489c('0x44')]?_0x216d1a[_0x489c('0x42')]:_0x3a923e['model'];if(!_0x2c2b2d[_0x489c('0x3f')][_0x489c('0x45')]('nolimit')){_0x216d1a[_0x489c('0x2c')]=qs[_0x489c('0x2c')](_0x2c2b2d['query'][_0x489c('0x2c')]);_0x216d1a[_0x489c('0x2a')]=qs[_0x489c('0x2a')](_0x2c2b2d[_0x489c('0x3f')][_0x489c('0x2a')]);}_0x216d1a[_0x489c('0x46')]=qs[_0x489c('0x47')](_0x2c2b2d['query'][_0x489c('0x47')]);_0x216d1a[_0x489c('0x48')]=qs[_0x489c('0x49')](_['pick'](_0x2c2b2d[_0x489c('0x3f')],_0x3a923e[_0x489c('0x49')]),_0x561707);if(_0x2c2b2d[_0x489c('0x3f')][_0x489c('0x4a')]){_0x216d1a[_0x489c('0x48')]=_[_0x489c('0x4b')](_0x216d1a[_0x489c('0x48')],{'$or':_[_0x489c('0x39')](_0x561707,function(_0x518168){if(_0x518168[_0x489c('0x4c')]!==_0x489c('0x4d')){var _0x5a0dda={};_0x5a0dda[_0x518168[_0x489c('0x36')]]={'$like':'%'+_0x2c2b2d[_0x489c('0x3f')]['filter']+'%'};return _0x5a0dda;}})});}_0x216d1a=_[_0x489c('0x4b')]({},_0x216d1a,_0x2c2b2d[_0x489c('0x4e')]);var _0x48af27={'where':_0x216d1a[_0x489c('0x48')]};return db[_0x489c('0x3a')][_0x489c('0x2d')](_0x48af27)[_0x489c('0x1f')](function(_0xe2719){_0x18da1b[_0x489c('0x2d')]=_0xe2719;if(_0x2c2b2d['query'][_0x489c('0x4f')]){_0x216d1a['include']=[{'all':!![]}];}return db[_0x489c('0x3a')][_0x489c('0x50')](_0x216d1a);})[_0x489c('0x1f')](function(_0x84f019){_0x18da1b[_0x489c('0x51')]=_0x84f019;return _0x18da1b;})[_0x489c('0x1f')](respondWithFilteredResult(_0x1a9ba0,_0x216d1a))[_0x489c('0x26')](handleError(_0x1a9ba0,null));};exports['show']=function(_0x2a6e30,_0xf48920){var _0x5a13ac={'raw':!![],'where':{'id':_0x2a6e30['params']['id']}},_0x20f3c7={};_0x20f3c7[_0x489c('0x3e')]=_[_0x489c('0x40')](db[_0x489c('0x3a')]['rawAttributes']);_0x20f3c7[_0x489c('0x3f')]=_[_0x489c('0x40')](_0x2a6e30[_0x489c('0x3f')]);_0x20f3c7[_0x489c('0x49')]=_[_0x489c('0x41')](_0x20f3c7[_0x489c('0x3e')],_0x20f3c7['query']);_0x5a13ac[_0x489c('0x42')]=_['intersection'](_0x20f3c7[_0x489c('0x3e')],qs[_0x489c('0x43')](_0x2a6e30['query']['fields']));_0x5a13ac[_0x489c('0x42')]=_0x5a13ac[_0x489c('0x42')][_0x489c('0x44')]?_0x5a13ac[_0x489c('0x42')]:_0x20f3c7[_0x489c('0x3e')];if(_0x2a6e30[_0x489c('0x3f')][_0x489c('0x4f')]){_0x5a13ac[_0x489c('0x52')]=[{'all':!![]}];}_0x5a13ac=_[_0x489c('0x4b')]({},_0x5a13ac,_0x2a6e30[_0x489c('0x4e')]);return db['ChatMessage'][_0x489c('0x53')](_0x5a13ac)[_0x489c('0x1f')](handleEntityNotFound(_0xf48920,null))[_0x489c('0x1f')](respondWithResult(_0xf48920,null))[_0x489c('0x26')](handleError(_0xf48920,null));};exports[_0x489c('0x54')]=function(_0xe43619,_0x280af6){return db[_0x489c('0x3a')][_0x489c('0x54')](_0xe43619['body'],{})[_0x489c('0x1f')](respondWithResult(_0x280af6,0xc9))[_0x489c('0x26')](handleError(_0x280af6,null));};exports['update']=function(_0x1864c8,_0x347c52){if(_0x1864c8['body']['id']){delete _0x1864c8[_0x489c('0x55')]['id'];}return db[_0x489c('0x3a')][_0x489c('0x53')]({'where':{'id':_0x1864c8[_0x489c('0x56')]['id']}})[_0x489c('0x1f')](handleEntityNotFound(_0x347c52,null))[_0x489c('0x1f')](saveUpdates(_0x1864c8[_0x489c('0x55')],null))[_0x489c('0x1f')](respondWithResult(_0x347c52,null))[_0x489c('0x26')](handleError(_0x347c52,null));};exports[_0x489c('0x33')]=function(_0x4e98db,_0x3677a5){return db['ChatMessage'][_0x489c('0x53')]({'where':{'id':_0x4e98db[_0x489c('0x56')]['id']}})[_0x489c('0x1f')](handleEntityNotFound(_0x3677a5,null))[_0x489c('0x1f')](removeEntity(_0x3677a5,null))[_0x489c('0x26')](handleError(_0x3677a5,null));};exports[_0x489c('0x57')]=function(_0xb634a7,_0x1d61e6){return db[_0x489c('0x3a')]['describe']()[_0x489c('0x1f')](respondWithResult(_0x1d61e6,null))[_0x489c('0x26')](handleError(_0x1d61e6,null));};var interaction_log=require(_0x489c('0x14'))(_0x489c('0x58'));exports['accept']=function(_0x22163e,_0x126873,_0xbc543d){var _0x39d39b={'agent':{},'channel':_0x489c('0x59')};if(_0x22163e['body']['id']){delete _0x22163e[_0x489c('0x55')]['id'];}_0x22163e['body']['read']=!![];_0x22163e[_0x489c('0x55')][_0x489c('0x5a')]=moment()[_0x489c('0x5b')](_0x489c('0x5c'));_0x22163e[_0x489c('0x55')][_0x489c('0x5d')]=_0x22163e[_0x489c('0x55')][_0x489c('0x5d')]||_0x22163e['user']['id'];_0x39d39b['agent']['id']=_0x22163e[_0x489c('0x55')][_0x489c('0x5d')];return db['ChatMessage'][_0x489c('0x53')]({'where':{'id':_0x22163e['params']['id'],'UserId':null}})[_0x489c('0x1f')](handleEntityNotFound(_0x126873,null))[_0x489c('0x1f')](saveUpdates(_0x22163e[_0x489c('0x55')],null))['then'](function(_0x22d285){if(_0x22d285){_0x39d39b[_0x489c('0x24')]=_0x22d285[_0x489c('0x5e')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x22d285['ChatInteractionId']}});}return null;})[_0x489c('0x1f')](handleEntityNotFound(_0x126873,null))[_0x489c('0x1f')](function(_0x1eaf38){if(_0x1eaf38){return _0x1eaf38['update']({'UserId':_0x22163e[_0x489c('0x55')][_0x489c('0x5d')],'read1stAt':_[_0x489c('0x5f')](_0x1eaf38[_0x489c('0x60')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x489c('0x1f')](function(_0x517c0d){if(_0x517c0d){_0x39d39b[_0x489c('0x61')]=_0x517c0d['get']({'plain':!![]});interaction_log['info'](_0x489c('0x62'),_0x22163e['user']['id'],_0x22163e[_0x489c('0x63')][_0x489c('0x36')],_0x22163e[_0x489c('0x63')][_0x489c('0x64')],_0x39d39b['interaction']['id'],_0x22163e[_0x489c('0x55')]?JSON[_0x489c('0x65')](_0x22163e[_0x489c('0x55')]):_0x489c('0x66'));return respondWithRpcPromise('AcceptMessage',_0x489c('0x67'),_0x39d39b);}return null;})[_0x489c('0x1f')](function(_0x4c7725){var _0x31d00d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4c7725[_0x489c('0x24')][_0x489c('0x68')];return db[_0x489c('0x69')]['query'](_0x31d00d,{'type':db[_0x489c('0x6a')][_0x489c('0x6b')][_0x489c('0x6c')],'raw':!![]})[_0x489c('0x1f')](function(_0x1dafb0){return _0x1dafb0;});})[_0x489c('0x1f')](function(_0x485644){if(_0x485644){_0x39d39b[_0x489c('0x24')][_0x489c('0x6d')]=_0x485644[0x0];if(!_0x22163e['body'][_0x489c('0x5d')])return;return db[_0x489c('0x6e')]['find']({'where':{'id':_0x22163e[_0x489c('0x55')][_0x489c('0x5d')],'role':'agent'},'attributes':['id',_0x489c('0x36'),_0x489c('0x6f'),_0x489c('0x70'),_0x489c('0x71')],'raw':!![]});}return null;})[_0x489c('0x1f')](function(_0x533455){if(!_0x533455)return null;_0x39d39b[_0x489c('0x24')][_0x489c('0x72')]=_0x533455;return _0x39d39b;})[_0x489c('0x1f')](function(_0x1a7fb4){if(_0x1a7fb4){if(_0x22163e[_0x489c('0x55')]['manual']){_0x39d39b[_0x489c('0x24')][_0x489c('0x73')]=util[_0x489c('0x5b')]('SIP/%s',_0x22163e[_0x489c('0x63')][_0x489c('0x36')]);_0x39d39b[_0x489c('0x24')][_0x489c('0x74')]=_0x39d39b[_0x489c('0x74')];_0x39d39b[_0x489c('0x24')][_0x489c('0x75')]=_0x39d39b[_0x489c('0x74')];_0x39d39b[_0x489c('0x24')][_0x489c('0x76')]=_0x489c('0x77');return respondWithRpcPromise(_0x489c('0x78'),'EventManager',{'event':_0x489c('0x79'),'message':_[_0x489c('0x4b')](_0x39d39b['message'],JSON[_0x489c('0x7a')](_0x39d39b['interaction'][_0x489c('0x7b')]))},client9002)[_0x489c('0x1f')](function(){return _0x39d39b;});}return _0x39d39b;}return null;})[_0x489c('0x1f')](respondWithResult(_0x126873,null))[_0x489c('0x26')](handleError(_0x126873,null));};var interaction_log=require(_0x489c('0x14'))(_0x489c('0x58'));exports[_0x489c('0x31')]=function(_0x56a62e,_0x35070c,_0x3bf711){var _0x4e819f={'agent':{},'channel':'chat'};if(_0x56a62e[_0x489c('0x55')]['id']){delete _0x56a62e[_0x489c('0x55')]['id'];}_0x56a62e[_0x489c('0x55')][_0x489c('0x5d')]=_0x56a62e[_0x489c('0x55')][_0x489c('0x5d')]||_0x56a62e[_0x489c('0x63')]['id'];_0x4e819f[_0x489c('0x72')]['id']=_0x56a62e['body'][_0x489c('0x5d')];return db[_0x489c('0x3a')][_0x489c('0x53')]({'where':{'id':_0x56a62e[_0x489c('0x56')]['id'],'UserId':null}})[_0x489c('0x1f')](handleEntityNotFound(_0x35070c,null))[_0x489c('0x1f')](function(_0x165377){if(_0x165377){_0x4e819f['message']=_0x165377[_0x489c('0x5e')]({'plain':!![]});return db[_0x489c('0x7c')][_0x489c('0x53')]({'where':{'id':_0x165377[_0x489c('0x7d')]}});}return null;})[_0x489c('0x1f')](handleEntityNotFound(_0x35070c,null))[_0x489c('0x1f')](function(_0x22e45f){if(_0x22e45f){_0x4e819f[_0x489c('0x61')]=_0x22e45f['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x56a62e['user']['id'],_0x56a62e[_0x489c('0x63')]['name'],_0x56a62e[_0x489c('0x63')]['role'],_0x4e819f[_0x489c('0x61')]['id'],_0x56a62e[_0x489c('0x55')]?JSON['stringify'](_0x56a62e['body']):_0x489c('0x66'));return respondWithRpcPromise(_0x489c('0x7e'),_0x489c('0x7f'),_0x4e819f);}return null;})['then'](function(_0xf17b42){var _0x189a8e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xf17b42[_0x489c('0x24')][_0x489c('0x68')];return db['sequelize']['query'](_0x189a8e,{'type':db[_0x489c('0x6a')][_0x489c('0x6b')]['SELECT'],'raw':!![]})[_0x489c('0x1f')](function(_0x30ee24){return _0x30ee24;});})[_0x489c('0x1f')](function(_0x3d3ba0){if(_0x3d3ba0){_0x4e819f[_0x489c('0x24')][_0x489c('0x6d')]=_0x3d3ba0[0x0];if(!_0x56a62e['body']['UserId'])return;return db[_0x489c('0x6e')][_0x489c('0x53')]({'where':{'id':_0x56a62e[_0x489c('0x55')][_0x489c('0x5d')],'role':_0x489c('0x72')},'attributes':['id',_0x489c('0x36'),'fullname',_0x489c('0x70'),_0x489c('0x71')],'raw':!![]});}return null;})[_0x489c('0x1f')](function(_0x1936cd){if(!_0x1936cd)return null;_0x4e819f[_0x489c('0x24')][_0x489c('0x72')]=_0x1936cd;return _0x4e819f;})[_0x489c('0x1f')](function(_0x313522){if(_0x313522){_0x313522[_0x489c('0x24')][_0x489c('0x73')]=util['format'](_0x489c('0x80'),_0x56a62e['user'][_0x489c('0x36')]);_0x313522[_0x489c('0x24')]['channel']=_0x4e819f['channel'];_0x313522['message'][_0x489c('0x75')]=_0x4e819f['channel'];_0x313522['message'][_0x489c('0x76')]=_0x489c('0x31');respondWithRpcPromise('EventManager',_0x489c('0x78'),{'event':_0x489c('0x81'),'message':_[_0x489c('0x4b')](_0x4e819f['message'],JSON[_0x489c('0x7a')](_0x4e819f[_0x489c('0x61')][_0x489c('0x7b')]))},client9002);return _0x4e819f;}return null;})[_0x489c('0x1f')](respondWithResult(_0x35070c,null))[_0x489c('0x26')](handleError(_0x35070c,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 79e6835..c992d9d 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 _0x390a=['../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0x390a,0xfc));var _0xa390=function(_0x4355e2,_0x1b7ad3){_0x4355e2=_0x4355e2-0x0;var _0x1993c9=_0x390a[_0x4355e2];return _0x1993c9;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xa390('0x0'))['db'][_0xa390('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa390('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa390('0x3'),'afterDestroy':_0xa390('0x4')};function emitEvent(_0x29ead0){return function(_0x4dbbe9,_0x39406e,_0x190163){ChatMessageEvents[_0xa390('0x5')](_0x29ead0+':'+_0x4dbbe9['id'],_0x4dbbe9);ChatMessageEvents[_0xa390('0x5')](_0x29ead0,_0x4dbbe9);_0x190163(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xa390('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xfaac=['hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit'];(function(_0x331b55,_0x3d7c97){var _0x483e90=function(_0x22a5e5){while(--_0x22a5e5){_0x331b55['push'](_0x331b55['shift']());}};_0x483e90(++_0x3d7c97);}(_0xfaac,0x11a));var _0xcfaa=function(_0xa9c05b,_0x58287c){_0xa9c05b=_0xa9c05b-0x0;var _0xa278c8=_0xfaac[_0xa9c05b];return _0xa278c8;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xcfaa('0x0'))['db'][_0xcfaa('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xcfaa('0x2')](0x0);var events={'afterCreate':_0xcfaa('0x3'),'afterUpdate':_0xcfaa('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d0eb8){return function(_0x44bcac,_0x5235d0,_0x42edb9){ChatMessageEvents[_0xcfaa('0x5')](_0x5d0eb8+':'+_0x44bcac['id'],_0x44bcac);ChatMessageEvents[_0xcfaa('0x5')](_0x5d0eb8,_0x44bcac);_0x42edb9(null);};}for(var e in events){if(events[_0xcfaa('0x6')](e)){var event=events[e];ChatMessage[_0xcfaa('0x7')](e,emitEvent(event));}}module[_0xcfaa('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 75362af..f0757b6 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 _0xc96c=['./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','models','direction','toLowerCase','out','secret','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x78fc7d,_0x4caf91){var _0x134aac=function(_0x475ed0){while(--_0x475ed0){_0x78fc7d['push'](_0x78fc7d['shift']());}};_0x134aac(++_0x4caf91);}(_0xc96c,0x14a));var _0xcc96=function(_0x5104ec,_0x11722d){_0x5104ec=_0x5104ec-0x0;var _0x22b805=_0xc96c[_0x5104ec];return _0x22b805;};'use strict';var _=require('lodash');var util=require(_0xcc96('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xcc96('0x1'));var BPromise=require(_0xcc96('0x2'));var rp=require(_0xcc96('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc96('0x4'));var config=require(_0xcc96('0x5'));var attributes=require(_0xcc96('0x6'));module[_0xcc96('0x7')]=function(_0x32cba9,_0x5e3ce3){return _0x32cba9['define'](_0xcc96('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xcc96('0x9'),'fields':[_0xcc96('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x55726d,_0x2b55ad,_0x2de527){var _0x31ae3f=_0x32cba9[_0xcc96('0xb')];var _0x5351db=_0x55726d['get']({'plain':!![]});if(_0x5351db[_0xcc96('0xc')]['toLowerCase']()==='in'||_0x5351db[_0xcc96('0xc')][_0xcc96('0xd')]()===_0xcc96('0xe')&&!_0x5351db[_0xcc96('0xf')]&&!_['isNil'](_0x5351db[_0xcc96('0x10')])){_0x31ae3f['ChatInteraction'][_0xcc96('0x11')]({'where':{'id':_0x5351db[_0xcc96('0x12')]}})[_0xcc96('0x13')](function(_0x460cdc){if(_0x460cdc){_0x460cdc[_0xcc96('0x14')]({'lastMsgAt':_0x5351db[_0xcc96('0x15')],'lastMsgDirection':_0x5351db[_0xcc96('0xc')][_0xcc96('0xd')]()});}})[_0xcc96('0x16')](function(_0x321ddb){console['error'](_0x321ddb);});}_0x2de527();}},'charset':_0xcc96('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8569=['request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x8fd7be,_0xcd1d8d){var _0xd527d7=function(_0x34a173){while(--_0x34a173){_0x8fd7be['push'](_0x8fd7be['shift']());}};_0xd527d7(++_0xcd1d8d);}(_0x8569,0x14d));var _0x9856=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x8569[_0x3aeb36];return _0xa2ef21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9856('0x0'))(_0x9856('0x1'));var moment=require(_0x9856('0x2'));var BPromise=require('bluebird');var rp=require(_0x9856('0x3'));var fs=require('fs');var path=require(_0x9856('0x4'));var rimraf=require('rimraf');var config=require(_0x9856('0x5'));var attributes=require(_0x9856('0x6'));module[_0x9856('0x7')]=function(_0x291194,_0xaea046){return _0x291194[_0x9856('0x8')](_0x9856('0x9'),attributes,{'tableName':_0x9856('0xa'),'paranoid':![],'indexes':[{'name':_0x9856('0xb'),'fields':[_0x9856('0xc')],'type':_0x9856('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x107df3,_0x13e3c1,_0x36d363){var _0xda8bc8=_0x291194[_0x9856('0xe')];var _0x294d20=_0x107df3[_0x9856('0xf')]({'plain':!![]});if(_0x294d20['direction']['toLowerCase']()==='in'||_0x294d20[_0x9856('0x10')][_0x9856('0x11')]()===_0x9856('0x12')&&!_0x294d20['secret']&&!_[_0x9856('0x13')](_0x294d20[_0x9856('0x14')])){_0xda8bc8[_0x9856('0x15')][_0x9856('0x16')]({'where':{'id':_0x294d20['ChatInteractionId']}})[_0x9856('0x17')](function(_0x5efba3){if(_0x5efba3){_0x5efba3['update']({'lastMsgAt':_0x294d20['createdAt'],'lastMsgDirection':_0x294d20[_0x9856('0x10')]['toLowerCase']()});}})[_0x9856('0x18')](function(_0x23b327){console[_0x9856('0x19')](_0x23b327);});}_0x36d363();}},'charset':_0x9856('0x1a'),'collate':_0x9856('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index c2d1737..ff37a33 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 _0xb44c=['raw','CreateChatMessage','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatMessage','options'];(function(_0xeb84b4,_0x38bfa4){var _0x3b49f9=function(_0x569de3){while(--_0x569de3){_0xeb84b4['push'](_0xeb84b4['shift']());}};_0x3b49f9(++_0x38bfa4);}(_0xb44c,0x1b5));var _0xcb44=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xb44c[_0x2a0738];return _0x159679;};'use strict';var _=require('lodash');var util=require(_0xcb44('0x0'));var moment=require(_0xcb44('0x1'));var BPromise=require(_0xcb44('0x2'));var rs=require(_0xcb44('0x3'));var fs=require('fs');var Redis=require(_0xcb44('0x4'));var db=require(_0xcb44('0x5'))['db'];var utils=require(_0xcb44('0x6'));var logger=require(_0xcb44('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcb44('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xcb44('0x9')]=_[_0xcb44('0xa')](config[_0xcb44('0x9')],{'host':_0xcb44('0xb'),'port':0x18eb});var socket=require(_0xcb44('0xc'))(new Redis(config[_0xcb44('0x9')]));require(_0xcb44('0xd'))[_0xcb44('0xe')](socket);function respondWithRpcPromise(_0x2a06fe,_0xda1591,_0x14ab55){return new BPromise(function(_0x101d04,_0x91af72){return client[_0xcb44('0xf')](_0x2a06fe,_0x14ab55)['then'](function(_0x58c8bd){logger[_0xcb44('0x10')](_0xcb44('0x11'),_0xda1591,_0xcb44('0x12'));logger[_0xcb44('0x13')](_0xcb44('0x14'),_0xda1591,'request\x20sent',JSON['stringify'](_0x58c8bd));if(_0x58c8bd[_0xcb44('0x15')]){if(_0x58c8bd[_0xcb44('0x15')][_0xcb44('0x16')]===0x1f4){logger[_0xcb44('0x15')](_0xcb44('0x11'),_0xda1591,_0x58c8bd['error'][_0xcb44('0x17')]);return _0x91af72(_0x58c8bd['error'][_0xcb44('0x17')]);}logger['error'](_0xcb44('0x11'),_0xda1591,_0x58c8bd[_0xcb44('0x15')]['message']);return _0x101d04(_0x58c8bd[_0xcb44('0x15')]['message']);}else{logger[_0xcb44('0x10')](_0xcb44('0x11'),_0xda1591,_0xcb44('0x12'));_0x101d04(_0x58c8bd[_0xcb44('0x18')][_0xcb44('0x17')]);}})[_0xcb44('0x19')](function(_0x53e642){logger[_0xcb44('0x15')](_0xcb44('0x11'),_0xda1591,_0x53e642);_0x91af72(_0x53e642);});});}exports['CreateChatMessage']=function(_0x5e6c73){var _0x530651=this;return new Promise(function(_0x1e53a5,_0x5eae1f){return db[_0xcb44('0x1a')]['create'](_0x5e6c73['body'],{'raw':_0x5e6c73[_0xcb44('0x1b')]?_0x5e6c73['options'][_0xcb44('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1acaf3){logger['info'](_0xcb44('0x1d'),_0x5e6c73);logger[_0xcb44('0x13')](_0xcb44('0x1d'),_0x5e6c73,JSON[_0xcb44('0x1e')](_0x1acaf3));_0x1e53a5(_0x1acaf3);})[_0xcb44('0x19')](function(_0x92e023){logger[_0xcb44('0x15')](_0xcb44('0x1d'),_0x92e023[_0xcb44('0x17')],_0x5e6c73);_0x5eae1f(_0x530651[_0xcb44('0x15')](0x1f4,_0x92e023[_0xcb44('0x17')]));});});}; \ No newline at end of file +var _0xfcd4=['http','redis','defaults','localhost','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0xb78a54,_0xf178d8){var _0x1b53d5=function(_0x189cd5){while(--_0x189cd5){_0xb78a54['push'](_0xb78a54['shift']());}};_0x1b53d5(++_0xf178d8);}(_0xfcd4,0x1f3));var _0x4fcd=function(_0x113dd1,_0x15aaa1){_0x113dd1=_0x113dd1-0x0;var _0x1605e0=_0xfcd4[_0x113dd1];return _0x1605e0;};'use strict';var _=require(_0x4fcd('0x0'));var util=require(_0x4fcd('0x1'));var moment=require(_0x4fcd('0x2'));var BPromise=require(_0x4fcd('0x3'));var rs=require(_0x4fcd('0x4'));var fs=require('fs');var Redis=require(_0x4fcd('0x5'));var db=require(_0x4fcd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fcd('0x7'))(_0x4fcd('0x8'));var config=require(_0x4fcd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4fcd('0xa')][_0x4fcd('0xb')]({'port':0x232a});config[_0x4fcd('0xc')]=_[_0x4fcd('0xd')](config[_0x4fcd('0xc')],{'host':_0x4fcd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4fcd('0xf'))[_0x4fcd('0x10')](socket);function respondWithRpcPromise(_0x4d4988,_0x5cdce4,_0x22855d){return new BPromise(function(_0x5297d6,_0x4a0d08){return client[_0x4fcd('0x11')](_0x4d4988,_0x22855d)[_0x4fcd('0x12')](function(_0x551b89){logger['info'](_0x4fcd('0x13'),_0x5cdce4,_0x4fcd('0x14'));logger[_0x4fcd('0x15')](_0x4fcd('0x16'),_0x5cdce4,_0x4fcd('0x14'),JSON['stringify'](_0x551b89));if(_0x551b89[_0x4fcd('0x17')]){if(_0x551b89['error'][_0x4fcd('0x18')]===0x1f4){logger['error'](_0x4fcd('0x13'),_0x5cdce4,_0x551b89[_0x4fcd('0x17')]['message']);return _0x4a0d08(_0x551b89['error'][_0x4fcd('0x19')]);}logger[_0x4fcd('0x17')](_0x4fcd('0x13'),_0x5cdce4,_0x551b89[_0x4fcd('0x17')]['message']);return _0x5297d6(_0x551b89[_0x4fcd('0x17')][_0x4fcd('0x19')]);}else{logger['info'](_0x4fcd('0x13'),_0x5cdce4,_0x4fcd('0x14'));_0x5297d6(_0x551b89[_0x4fcd('0x1a')][_0x4fcd('0x19')]);}})[_0x4fcd('0x1b')](function(_0x49e78c){logger[_0x4fcd('0x17')](_0x4fcd('0x13'),_0x5cdce4,_0x49e78c);_0x4a0d08(_0x49e78c);});});}exports[_0x4fcd('0x1c')]=function(_0x2ffe20){var _0x269da9=this;return new Promise(function(_0x395f8b,_0x4ba6be){return db['ChatMessage'][_0x4fcd('0x1d')](_0x2ffe20[_0x4fcd('0x1e')],{'raw':_0x2ffe20[_0x4fcd('0x1f')]?_0x2ffe20['options'][_0x4fcd('0x20')]===undefined?!![]:![]:!![]})[_0x4fcd('0x12')](function(_0x503b49){logger['info']('CreateChatMessage',_0x2ffe20);logger[_0x4fcd('0x15')]('CreateChatMessage',_0x2ffe20,JSON[_0x4fcd('0x21')](_0x503b49));_0x395f8b(_0x503b49);})[_0x4fcd('0x1b')](function(_0x120fd4){logger[_0x4fcd('0x17')](_0x4fcd('0x1c'),_0x120fd4['message'],_0x2ffe20);_0x4ba6be(_0x269da9['error'](0x1f4,_0x120fd4['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 638b53b..ac4097d 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 _0x2975=['update','removeListener','register','length','chatMessage:','save','remove'];(function(_0x1e32f2,_0x3605c2){var _0x1dda0b=function(_0x72fab3){while(--_0x72fab3){_0x1e32f2['push'](_0x1e32f2['shift']());}};_0x1dda0b(++_0x3605c2);}(_0x2975,0x1c5));var _0x5297=function(_0x416906,_0x2fbb3e){_0x416906=_0x416906-0x0;var _0x52bafd=_0x2975[_0x416906];return _0x52bafd;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5297('0x0'),_0x5297('0x1'),_0x5297('0x2')];function createListener(_0x1a511b,_0x115e60){return function(_0x178801){_0x115e60['emit'](_0x1a511b,_0x178801);};}function removeListener(_0x56371f,_0x5e9de3){return function(){ChatMessageEvents[_0x5297('0x3')](_0x56371f,_0x5e9de3);};}exports[_0x5297('0x4')]=function(_0x11a43d){for(var _0x3da9c6=0x0,_0x4d1d2c=events[_0x5297('0x5')];_0x3da9c6<_0x4d1d2c;_0x3da9c6++){var _0x1b72a7=events[_0x3da9c6];var _0x4f12b0=createListener(_0x5297('0x6')+_0x1b72a7,_0x11a43d);ChatMessageEvents['on'](_0x1b72a7,_0x4f12b0);}}; \ No newline at end of file +var _0xe198=['save','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x3b6c5e,_0x78dd1d){var _0x22f78c=function(_0x3fdd6c){while(--_0x3fdd6c){_0x3b6c5e['push'](_0x3b6c5e['shift']());}};_0x22f78c(++_0x78dd1d);}(_0xe198,0x6f));var _0x8e19=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xe198[_0x279d37];return _0x530173;};'use strict';var ChatMessageEvents=require(_0x8e19('0x0'));var events=[_0x8e19('0x1'),'remove','update'];function createListener(_0x18c3af,_0x2b1b2b){return function(_0x2a2529){_0x2b1b2b[_0x8e19('0x2')](_0x18c3af,_0x2a2529);};}function removeListener(_0x32f52f,_0x4e3f58){return function(){ChatMessageEvents[_0x8e19('0x3')](_0x32f52f,_0x4e3f58);};}exports[_0x8e19('0x4')]=function(_0x2fb138){for(var _0x188ce0=0x0,_0x1175d6=events[_0x8e19('0x5')];_0x188ce0<_0x1175d6;_0x188ce0++){var _0x1e61ae=events[_0x188ce0];var _0xfc45e=createListener(_0x8e19('0x6')+_0x1e61ae,_0x2fb138);ChatMessageEvents['on'](_0x1e61ae,_0xfc45e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 59c06ac..c8dd706 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 _0xd782=['update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','chat','chatmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd782,0x191));var _0x2d78=function(_0x3746bd,_0x4b07a7){_0x3746bd=_0x3746bd-0x0;var _0x569b5f=_0xd782[_0x3746bd];return _0x569b5f;};'use strict';var multer=require(_0x2d78('0x0'));var util=require(_0x2d78('0x1'));var path=require(_0x2d78('0x2'));var timeout=require(_0x2d78('0x3'));var express=require(_0x2d78('0x4'));var router=express[_0x2d78('0x5')]();var fs_extra=require(_0x2d78('0x6'));var auth=require(_0x2d78('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2d78('0x8'));var controller=require('./chatMessage.controller');router[_0x2d78('0x9')]('/',auth['isAuthenticated'](),controller[_0x2d78('0xa')]);router['get'](_0x2d78('0xb'),auth[_0x2d78('0xc')](),controller[_0x2d78('0xd')]);router[_0x2d78('0x9')](_0x2d78('0xe'),auth[_0x2d78('0xc')](),controller['show']);router[_0x2d78('0xf')]('/',auth[_0x2d78('0xc')](),interaction['tracked'](_0x2d78('0x10'),_0x2d78('0x11')),controller[_0x2d78('0x12')]);router['put'](_0x2d78('0xe'),controller[_0x2d78('0x13')]);router['put'](_0x2d78('0x14'),auth[_0x2d78('0xc')](),controller[_0x2d78('0x15')]);router[_0x2d78('0x16')](_0x2d78('0x17'),auth[_0x2d78('0xc')](),controller[_0x2d78('0x18')]);router[_0x2d78('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x2d78('0x1a')]);module[_0x2d78('0x1b')]=router; \ No newline at end of file +var _0x4a0e=['put','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','show','post','chat','chatmessage:create','create','update'];(function(_0x13056e,_0x31e36d){var _0x546a9f=function(_0xec1495){while(--_0xec1495){_0x13056e['push'](_0x13056e['shift']());}};_0x546a9f(++_0x31e36d);}(_0x4a0e,0x167));var _0xe4a0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4a0e[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xe4a0('0x0'));var path=require('path');var timeout=require(_0xe4a0('0x1'));var express=require(_0xe4a0('0x2'));var router=express[_0xe4a0('0x3')]();var fs_extra=require(_0xe4a0('0x4'));var auth=require(_0xe4a0('0x5'));var interaction=require(_0xe4a0('0x6'));var config=require(_0xe4a0('0x7'));var controller=require(_0xe4a0('0x8'));router[_0xe4a0('0x9')]('/',auth[_0xe4a0('0xa')](),controller[_0xe4a0('0xb')]);router[_0xe4a0('0x9')](_0xe4a0('0xc'),auth[_0xe4a0('0xa')](),controller['describe']);router[_0xe4a0('0x9')]('/:id',auth[_0xe4a0('0xa')](),controller[_0xe4a0('0xd')]);router[_0xe4a0('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xe4a0('0xf'),_0xe4a0('0x10')),controller[_0xe4a0('0x11')]);router['put']('/:id',controller[_0xe4a0('0x12')]);router[_0xe4a0('0x13')](_0xe4a0('0x14'),auth[_0xe4a0('0xa')](),controller[_0xe4a0('0x15')]);router['put'](_0xe4a0('0x16'),auth['isAuthenticated'](),controller[_0xe4a0('0x17')]);router[_0xe4a0('0x18')](_0xe4a0('0x19'),auth['isAuthenticated'](),controller[_0xe4a0('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 4b6633f..cbb0198 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x330bf8,_0x3f1ce1){var _0x10d2fe=function(_0x3ab8a9){while(--_0x3ab8a9){_0x330bf8['push'](_0x330bf8['shift']());}};_0x10d2fe(++_0x3f1ce1);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b8f84,_0x349ee2){_0x2b8f84=_0x2b8f84-0x0;var _0x2927ca=_0xb10b[_0x2b8f84];return _0x2927ca;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0x1bc990,_0x226c8d){var _0x4c7b06=function(_0x55db7f){while(--_0x55db7f){_0x1bc990['push'](_0x1bc990['shift']());}};_0x4c7b06(++_0x226c8d);}(_0xb10b,0x12a));var _0xbb10=function(_0x248238,_0xe31996){_0x248238=_0x248238-0x0;var _0xb93bc4=_0xb10b[_0x248238];return _0xb93bc4;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 690787e..e2dae24 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3d10c6,_0x44e047){var _0x367532=function(_0x18ec57){while(--_0x18ec57){_0x3d10c6['push'](_0x3d10c6['shift']());}};_0x367532(++_0x44e047);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a54,0x106));var _0x47a5=function(_0x3a1196,_0x607989){_0x3a1196=_0x3a1196-0x0;var _0x133899=_0x7a54[_0x3a1196];return _0x133899;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 0f7d85d..e7cc623 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 _0x47a8=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2a4d83,_0x2f548c){var _0x1f223d=function(_0x513327){while(--_0x513327){_0x2a4d83['push'](_0x2a4d83['shift']());}};_0x1f223d(++_0x2f548c);}(_0x47a8,0x154));var _0x847a=function(_0x2d6891,_0x1a3fd0){_0x2d6891=_0x2d6891-0x0;var _0x49cdfc=_0x47a8[_0x2d6891];return _0x49cdfc;};'use strict';var EventEmitter=require(_0x847a('0x0'));var ChatOfflineMessage=require(_0x847a('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x847a('0x2')](0x0);var events={'afterCreate':_0x847a('0x3'),'afterUpdate':_0x847a('0x4'),'afterDestroy':_0x847a('0x5')};function emitEvent(_0x1db589){return function(_0x1640ce,_0x1ad94f,_0xbd90b7){ChatOfflineMessageEvents['emit'](_0x1db589+':'+_0x1640ce['id'],_0x1640ce);ChatOfflineMessageEvents[_0x847a('0x6')](_0x1db589,_0x1640ce);_0xbd90b7(null);};}for(var e in events){if(events[_0x847a('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x847a('0x8')](e,emitEvent(event));}}module[_0x847a('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x7fcf=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x7fcf,0x128));var _0xf7fc=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7fcf[_0x55f8b4];return _0x2475f9;};'use strict';var EventEmitter=require(_0xf7fc('0x0'));var ChatOfflineMessage=require(_0xf7fc('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xf7fc('0x2')](0x0);var events={'afterCreate':_0xf7fc('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x46a65a){return function(_0xa754e7,_0x5d294a,_0x4b9e05){ChatOfflineMessageEvents[_0xf7fc('0x4')](_0x46a65a+':'+_0xa754e7['id'],_0xa754e7);ChatOfflineMessageEvents[_0xf7fc('0x4')](_0x46a65a,_0xa754e7);_0x4b9e05(null);};}for(var e in events){if(events[_0xf7fc('0x5')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xf7fc('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 4edd6d9..46e8472 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 _0x4f68=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages'];(function(_0xd54e45,_0x57bddb){var _0xe0a1e7=function(_0x2370c9){while(--_0x2370c9){_0xd54e45['push'](_0xd54e45['shift']());}};_0xe0a1e7(++_0x57bddb);}(_0x4f68,0x71));var _0x84f6=function(_0x127081,_0x4d249e){_0x127081=_0x127081-0x0;var _0x5c54cf=_0x4f68[_0x127081];return _0x5c54cf;};'use strict';var attributes=require(_0x84f6('0x0'));module['exports']=function(_0x7ee596){return _0x7ee596['define'](_0x84f6('0x1'),attributes,{'tableName':_0x84f6('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x84f6('0x3')});}; \ No newline at end of file +var _0x793e=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x167ada,_0x49c6f7){var _0x1a81f9=function(_0x1d1c90){while(--_0x1d1c90){_0x167ada['push'](_0x167ada['shift']());}};_0x1a81f9(++_0x49c6f7);}(_0x793e,0xa3));var _0xe793=function(_0xd9ad81,_0x511fdf){_0xd9ad81=_0xd9ad81-0x0;var _0x4ba037=_0x793e[_0xd9ad81];return _0x4ba037;};'use strict';var attributes=require(_0xe793('0x0'));module[_0xe793('0x1')]=function(_0xbea673){return _0xbea673[_0xe793('0x2')](_0xe793('0x3'),attributes,{'tableName':_0xe793('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe793('0x5'),'collate':_0xe793('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 9a2a570..3b4e341 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 _0xd0b1=['request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x3bec86,_0x4484ee){var _0x1fb134=function(_0x9bebba){while(--_0x9bebba){_0x3bec86['push'](_0x3bec86['shift']());}};_0x1fb134(++_0x4484ee);}(_0xd0b1,0x16e));var _0x1d0b=function(_0x1d0cac,_0x36433b){_0x1d0cac=_0x1d0cac-0x0;var _0x54a683=_0xd0b1[_0x1d0cac];return _0x54a683;};'use strict';var _=require(_0x1d0b('0x0'));var util=require(_0x1d0b('0x1'));var moment=require('moment');var BPromise=require(_0x1d0b('0x2'));var rs=require(_0x1d0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d0b('0x4'))['db'];var utils=require(_0x1d0b('0x5'));var logger=require(_0x1d0b('0x6'))(_0x1d0b('0x7'));var config=require(_0x1d0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1d0b('0x9')][_0x1d0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15786b,_0xf6f132,_0x2954b7){return new BPromise(function(_0x357df1,_0x20c9b8){return client['request'](_0x15786b,_0x2954b7)[_0x1d0b('0xb')](function(_0x1d5ceb){logger[_0x1d0b('0xc')](_0x1d0b('0xd'),_0xf6f132,_0x1d0b('0xe'));logger['debug'](_0x1d0b('0xf'),_0xf6f132,_0x1d0b('0xe'),JSON['stringify'](_0x1d5ceb));if(_0x1d5ceb['error']){if(_0x1d5ceb[_0x1d0b('0x10')]['code']===0x1f4){logger[_0x1d0b('0x10')](_0x1d0b('0xd'),_0xf6f132,_0x1d5ceb[_0x1d0b('0x10')][_0x1d0b('0x11')]);return _0x20c9b8(_0x1d5ceb[_0x1d0b('0x10')]['message']);}logger[_0x1d0b('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0xf6f132,_0x1d5ceb[_0x1d0b('0x10')][_0x1d0b('0x11')]);return _0x357df1(_0x1d5ceb[_0x1d0b('0x10')][_0x1d0b('0x11')]);}else{logger[_0x1d0b('0xc')](_0x1d0b('0xd'),_0xf6f132,_0x1d0b('0xe'));_0x357df1(_0x1d5ceb['result'][_0x1d0b('0x11')]);}})[_0x1d0b('0x12')](function(_0x4bd388){logger[_0x1d0b('0x10')](_0x1d0b('0xd'),_0xf6f132,_0x4bd388);_0x20c9b8(_0x4bd388);});});} \ No newline at end of file +var _0xbe48=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xbe48,0x121));var _0x8be4=function(_0x52cb0f,_0x3b3c00){_0x52cb0f=_0x52cb0f-0x0;var _0x439feb=_0xbe48[_0x52cb0f];return _0x439feb;};'use strict';var _=require(_0x8be4('0x0'));var util=require(_0x8be4('0x1'));var moment=require(_0x8be4('0x2'));var BPromise=require(_0x8be4('0x3'));var rs=require(_0x8be4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8be4('0x5'));var logger=require(_0x8be4('0x6'))('rpc');var config=require(_0x8be4('0x7'));var jayson=require(_0x8be4('0x8'));var client=jayson[_0x8be4('0x9')][_0x8be4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe82da6,_0x4211b6,_0x35f862){return new BPromise(function(_0x554300,_0x3f87c6){return client[_0x8be4('0xb')](_0xe82da6,_0x35f862)['then'](function(_0x47ba2e){logger[_0x8be4('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4211b6,'request\x20sent');logger[_0x8be4('0xd')](_0x8be4('0xe'),_0x4211b6,_0x8be4('0xf'),JSON['stringify'](_0x47ba2e));if(_0x47ba2e['error']){if(_0x47ba2e['error'][_0x8be4('0x10')]===0x1f4){logger[_0x8be4('0x11')](_0x8be4('0x12'),_0x4211b6,_0x47ba2e[_0x8be4('0x11')]['message']);return _0x3f87c6(_0x47ba2e['error'][_0x8be4('0x13')]);}logger[_0x8be4('0x11')](_0x8be4('0x12'),_0x4211b6,_0x47ba2e[_0x8be4('0x11')]['message']);return _0x554300(_0x47ba2e[_0x8be4('0x11')]['message']);}else{logger[_0x8be4('0xc')](_0x8be4('0x12'),_0x4211b6,_0x8be4('0xf'));_0x554300(_0x47ba2e[_0x8be4('0x14')][_0x8be4('0x13')]);}})[_0x8be4('0x15')](function(_0x435906){logger[_0x8be4('0x11')](_0x8be4('0x12'),_0x4211b6,_0x435906);_0x3f87c6(_0x435906);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index c749397..992f4cd 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 _0x481f=['express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x2bc5a0,_0x594ddb){var _0x4f25a3=function(_0xdd2802){while(--_0xdd2802){_0x2bc5a0['push'](_0x2bc5a0['shift']());}};_0x4f25a3(++_0x594ddb);}(_0x481f,0x18c));var _0xf481=function(_0x45d51e,_0x22b8dd){_0x45d51e=_0x45d51e-0x0;var _0x50436e=_0x481f[_0x45d51e];return _0x50436e;};'use strict';var multer=require('multer');var util=require(_0xf481('0x0'));var path=require(_0xf481('0x1'));var timeout=require(_0xf481('0x2'));var express=require(_0xf481('0x3'));var router=express[_0xf481('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf481('0x5'));var interaction=require(_0xf481('0x6'));var config=require('../../config/environment');var controller=require(_0xf481('0x7'));router['get']('/',auth[_0xf481('0x8')](),controller[_0xf481('0x9')]);router[_0xf481('0xa')](_0xf481('0xb'),auth[_0xf481('0x8')](),controller[_0xf481('0xc')]);router[_0xf481('0xa')](_0xf481('0xd'),auth[_0xf481('0x8')](),controller['show']);router[_0xf481('0xe')]('/',auth[_0xf481('0x8')](),controller[_0xf481('0xf')]);router[_0xf481('0x10')](_0xf481('0xd'),auth['isAuthenticated'](),controller[_0xf481('0x11')]);router[_0xf481('0x12')]('/:id',auth[_0xf481('0x8')](),controller[_0xf481('0x13')]);module[_0xf481('0x14')]=router; \ No newline at end of file +var _0x76e4=['put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x402282,_0x615de3){var _0x4f65af=function(_0x4a20f7){while(--_0x4a20f7){_0x402282['push'](_0x402282['shift']());}};_0x4f65af(++_0x615de3);}(_0x76e4,0x1a8));var _0x476e=function(_0x17f137,_0x274cca){_0x17f137=_0x17f137-0x0;var _0x1fd315=_0x76e4[_0x17f137];return _0x1fd315;};'use strict';var multer=require(_0x476e('0x0'));var util=require('util');var path=require(_0x476e('0x1'));var timeout=require(_0x476e('0x2'));var express=require(_0x476e('0x3'));var router=express['Router']();var fs_extra=require(_0x476e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x476e('0x5'));var config=require(_0x476e('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x476e('0x7')]('/',auth['isAuthenticated'](),controller[_0x476e('0x8')]);router['get'](_0x476e('0x9'),auth[_0x476e('0xa')](),controller[_0x476e('0xb')]);router['get'](_0x476e('0xc'),auth[_0x476e('0xa')](),controller[_0x476e('0xd')]);router[_0x476e('0xe')]('/',auth[_0x476e('0xa')](),controller[_0x476e('0xf')]);router[_0x476e('0x10')]('/:id',auth[_0x476e('0xa')](),controller[_0x476e('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x476e('0x12')]);module[_0x476e('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index b395618..afca5bd 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 _0x198b=['STRING','INTEGER','sequelize','timeout','mouseOver'];(function(_0x220134,_0x355b4a){var _0x435d02=function(_0x55f633){while(--_0x55f633){_0x220134['push'](_0x220134['shift']());}};_0x435d02(++_0x355b4a);}(_0x198b,0x165));var _0xb198=function(_0x443175,_0x2d016d){_0x443175=_0x443175-0x0;var _0x6871a3=_0x198b[_0x443175];return _0x6871a3;};'use strict';var Sequelize=require(_0xb198('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xb198('0x1')),'defaultValue':_0xb198('0x2')},'selector':{'type':Sequelize[_0xb198('0x3')]},'timeout':{'type':Sequelize[_0xb198('0x4')]}}; \ No newline at end of file +var _0xe754=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0xd073df,_0x3b7852){var _0x246357=function(_0x404eb6){while(--_0x404eb6){_0xd073df['push'](_0xd073df['shift']());}};_0x246357(++_0x3b7852);}(_0xe754,0xaa));var _0x4e75=function(_0x333972,_0x1a60a5){_0x333972=_0x333972-0x0;var _0x1733b9=_0xe754[_0x333972];return _0x1733b9;};'use strict';var Sequelize=require(_0x4e75('0x0'));module[_0x4e75('0x1')]={'name':{'type':Sequelize[_0x4e75('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4e75('0x3')](_0x4e75('0x4'),_0x4e75('0x5')),'defaultValue':_0x4e75('0x4')},'selector':{'type':Sequelize[_0x4e75('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index a39709e..cc70ea2 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 _0x8819=['count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','includeAll','include','options','find','catch','create','body','update','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined'];(function(_0xb9a306,_0x48ebcd){var _0x55c163=function(_0x26a8ee){while(--_0x26a8ee){_0xb9a306['push'](_0xb9a306['shift']());}};_0x55c163(++_0x48ebcd);}(_0x8819,0x94));var _0x9881=function(_0x5c9402,_0x2425a9){_0x5c9402=_0x5c9402-0x0;var _0x375199=_0x8819[_0x5c9402];return _0x375199;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9881('0x0'));var jsonpatch=require(_0x9881('0x1'));var rp=require(_0x9881('0x2'));var moment=require(_0x9881('0x3'));var BPromise=require(_0x9881('0x4'));var Mustache=require('mustache');var util=require(_0x9881('0x5'));var path=require(_0x9881('0x6'));var sox=require(_0x9881('0x7'));var csv=require(_0x9881('0x8'));var ejs=require(_0x9881('0x9'));var fs=require('fs');var fs_extra=require(_0x9881('0xa'));var _=require('lodash');var squel=require(_0x9881('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9881('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9881('0xd'));var Redis=require('ioredis');var authService=require(_0x9881('0xe'));var qs=require(_0x9881('0xf'));var as=require(_0x9881('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9881('0x11'))(_0x9881('0x12'));var utils=require(_0x9881('0x13'));var config=require(_0x9881('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9881('0x15'))['db'];function respondWithStatusCode(_0x26ee3f,_0x5c6d2d){_0x5c6d2d=_0x5c6d2d||0xcc;return function(_0x42850e){if(_0x42850e){return _0x26ee3f['sendStatus'](_0x5c6d2d);}return _0x26ee3f['status'](_0x5c6d2d)['end']();};}function respondWithResult(_0x58f526,_0x12794f){_0x12794f=_0x12794f||0xc8;return function(_0x3178d7){if(_0x3178d7){return _0x58f526[_0x9881('0x16')](_0x12794f)[_0x9881('0x17')](_0x3178d7);}};}function respondWithFilteredResult(_0x39d127,_0x1d57ea){return function(_0x4b9d1b){if(_0x4b9d1b){var _0x411513=typeof _0x1d57ea[_0x9881('0x18')]===_0x9881('0x19')&&typeof _0x1d57ea['limit']==='undefined';var _0x4c92c9=_0x4b9d1b[_0x9881('0x1a')];var _0x4c3493=_0x411513?0x0:_0x1d57ea[_0x9881('0x18')];var _0x5a9848=_0x411513?_0x4b9d1b['count']:_0x1d57ea[_0x9881('0x18')]+_0x1d57ea[_0x9881('0x1b')];var _0x1cbac3;if(_0x5a9848>=_0x4c92c9){_0x5a9848=_0x4c92c9;_0x1cbac3=0xc8;}else{_0x1cbac3=0xce;}_0x39d127[_0x9881('0x16')](_0x1cbac3);return _0x39d127[_0x9881('0x1c')](_0x9881('0x1d'),_0x4c3493+'-'+_0x5a9848+'/'+_0x4c92c9)[_0x9881('0x17')](_0x4b9d1b);}return null;};}function patchUpdates(_0x1243cc){return function(_0x1ee450){try{jsonpatch[_0x9881('0x1e')](_0x1ee450,_0x1243cc,!![]);}catch(_0x32ca84){return BPromise[_0x9881('0x1f')](_0x32ca84);}return _0x1ee450[_0x9881('0x20')]();};}function saveUpdates(_0x300fa6,_0x174b39){return function(_0x58485d){if(_0x58485d){return _0x58485d['update'](_0x300fa6)[_0x9881('0x21')](function(_0x513545){return _0x513545;});}return null;};}function removeEntity(_0x499461,_0x1ba558){return function(_0x30ed15){if(_0x30ed15){return _0x30ed15['destroy']()['then'](function(){_0x499461[_0x9881('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bddc1,_0x161f8d){return function(_0x16eeca){if(!_0x16eeca){_0x2bddc1[_0x9881('0x22')](0x194);}return _0x16eeca;};}function handleError(_0x2c3cd1,_0x14e6f9){_0x14e6f9=_0x14e6f9||0x1f4;return function(_0x2f6b7c){logger[_0x9881('0x23')](_0x2f6b7c[_0x9881('0x24')]);if(_0x2f6b7c[_0x9881('0x25')]){delete _0x2f6b7c[_0x9881('0x25')];}_0x2c3cd1[_0x9881('0x16')](_0x14e6f9)[_0x9881('0x26')](_0x2f6b7c);};}exports['show']=function(_0x31956e,_0x41fe0d){var _0x5c2815={'raw':!![],'where':{'id':_0x31956e[_0x9881('0x27')]['id']}},_0x236979={};_0x236979['model']=_[_0x9881('0x28')](db[_0x9881('0x29')][_0x9881('0x2a')]);_0x236979[_0x9881('0x2b')]=_[_0x9881('0x28')](_0x31956e[_0x9881('0x2b')]);_0x236979[_0x9881('0x2c')]=_[_0x9881('0x2d')](_0x236979['model'],_0x236979[_0x9881('0x2b')]);_0x5c2815[_0x9881('0x2e')]=_[_0x9881('0x2d')](_0x236979[_0x9881('0x2f')],qs[_0x9881('0x30')](_0x31956e[_0x9881('0x2b')]['fields']));_0x5c2815[_0x9881('0x2e')]=_0x5c2815[_0x9881('0x2e')]['length']?_0x5c2815[_0x9881('0x2e')]:_0x236979[_0x9881('0x2f')];if(_0x31956e[_0x9881('0x2b')][_0x9881('0x31')]){_0x5c2815[_0x9881('0x32')]=[{'all':!![]}];}_0x5c2815=_['merge']({},_0x5c2815,_0x31956e[_0x9881('0x33')]);return db[_0x9881('0x29')][_0x9881('0x34')](_0x5c2815)[_0x9881('0x21')](handleEntityNotFound(_0x41fe0d,null))[_0x9881('0x21')](respondWithResult(_0x41fe0d,null))[_0x9881('0x35')](handleError(_0x41fe0d,null));};exports[_0x9881('0x36')]=function(_0x250987,_0x2f6aea){return db[_0x9881('0x29')][_0x9881('0x36')](_0x250987[_0x9881('0x37')],{})[_0x9881('0x21')](respondWithResult(_0x2f6aea,0xc9))[_0x9881('0x35')](handleError(_0x2f6aea,null));};exports[_0x9881('0x38')]=function(_0x32aac8,_0x5d902d){if(_0x32aac8[_0x9881('0x37')]['id']){delete _0x32aac8['body']['id'];}return db[_0x9881('0x29')]['find']({'where':{'id':_0x32aac8[_0x9881('0x27')]['id']}})[_0x9881('0x21')](handleEntityNotFound(_0x5d902d,null))['then'](saveUpdates(_0x32aac8[_0x9881('0x37')],null))['then'](respondWithResult(_0x5d902d,null))[_0x9881('0x35')](handleError(_0x5d902d,null));};exports[_0x9881('0x39')]=function(_0x1cddde,_0x204fc3){return db['ChatProactiveAction'][_0x9881('0x34')]({'where':{'id':_0x1cddde[_0x9881('0x27')]['id']}})[_0x9881('0x21')](handleEntityNotFound(_0x204fc3,null))[_0x9881('0x21')](removeEntity(_0x204fc3,null))[_0x9881('0x35')](handleError(_0x204fc3,null));}; \ No newline at end of file +var _0x39a9=['ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','find','create','body','catch','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','error','stack','name','send','show','model','keys'];(function(_0x305049,_0x513ce4){var _0x408413=function(_0x5e2492){while(--_0x5e2492){_0x305049['push'](_0x305049['shift']());}};_0x408413(++_0x513ce4);}(_0x39a9,0x1d0));var _0x939a=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x39a9[_0x1098db];return _0x14f090;};'use strict';var emlformat=require(_0x939a('0x0'));var rimraf=require(_0x939a('0x1'));var zipdir=require(_0x939a('0x2'));var jsonpatch=require(_0x939a('0x3'));var rp=require(_0x939a('0x4'));var moment=require(_0x939a('0x5'));var BPromise=require(_0x939a('0x6'));var Mustache=require(_0x939a('0x7'));var util=require(_0x939a('0x8'));var path=require(_0x939a('0x9'));var sox=require(_0x939a('0xa'));var csv=require('to-csv');var ejs=require(_0x939a('0xb'));var fs=require('fs');var fs_extra=require(_0x939a('0xc'));var _=require(_0x939a('0xd'));var squel=require(_0x939a('0xe'));var crypto=require(_0x939a('0xf'));var jsforce=require(_0x939a('0x10'));var deskjs=require(_0x939a('0x11'));var toCsv=require(_0x939a('0x12'));var querystring=require('querystring');var Papa=require(_0x939a('0x13'));var Redis=require(_0x939a('0x14'));var authService=require(_0x939a('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x939a('0x16'));var hardwareService=require(_0x939a('0x17'));var logger=require(_0x939a('0x18'))('api');var utils=require(_0x939a('0x19'));var config=require(_0x939a('0x1a'));var licenseUtil=require(_0x939a('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x546115,_0x3538e1){_0x3538e1=_0x3538e1||0xcc;return function(_0x1d4a37){if(_0x1d4a37){return _0x546115[_0x939a('0x1c')](_0x3538e1);}return _0x546115['status'](_0x3538e1)[_0x939a('0x1d')]();};}function respondWithResult(_0x1aed14,_0x3bf117){_0x3bf117=_0x3bf117||0xc8;return function(_0x60598d){if(_0x60598d){return _0x1aed14[_0x939a('0x1e')](_0x3bf117)[_0x939a('0x1f')](_0x60598d);}};}function respondWithFilteredResult(_0x10481a,_0x521346){return function(_0x475466){if(_0x475466){var _0x5cf40e=typeof _0x521346[_0x939a('0x20')]==='undefined'&&typeof _0x521346[_0x939a('0x21')]===_0x939a('0x22');var _0x347f5e=_0x475466[_0x939a('0x23')];var _0x48741c=_0x5cf40e?0x0:_0x521346['offset'];var _0x2a78c1=_0x5cf40e?_0x475466['count']:_0x521346['offset']+_0x521346[_0x939a('0x21')];var _0x7aa3ca;if(_0x2a78c1>=_0x347f5e){_0x2a78c1=_0x347f5e;_0x7aa3ca=0xc8;}else{_0x7aa3ca=0xce;}_0x10481a[_0x939a('0x1e')](_0x7aa3ca);return _0x10481a[_0x939a('0x24')](_0x939a('0x25'),_0x48741c+'-'+_0x2a78c1+'/'+_0x347f5e)['json'](_0x475466);}return null;};}function patchUpdates(_0x203ba4){return function(_0x57cc84){try{jsonpatch[_0x939a('0x26')](_0x57cc84,_0x203ba4,!![]);}catch(_0x540514){return BPromise['reject'](_0x540514);}return _0x57cc84[_0x939a('0x27')]();};}function saveUpdates(_0x2e92dc,_0xe6e025){return function(_0x4f723e){if(_0x4f723e){return _0x4f723e['update'](_0x2e92dc)['then'](function(_0xc99f01){return _0xc99f01;});}return null;};}function removeEntity(_0x4fa5ae,_0x1d8166){return function(_0xb85d24){if(_0xb85d24){return _0xb85d24['destroy']()[_0x939a('0x28')](function(){_0x4fa5ae['status'](0xcc)[_0x939a('0x1d')]();});}};}function handleEntityNotFound(_0x576f3d,_0x3247ab){return function(_0x445c3e){if(!_0x445c3e){_0x576f3d[_0x939a('0x1c')](0x194);}return _0x445c3e;};}function handleError(_0x322226,_0x113ccf){_0x113ccf=_0x113ccf||0x1f4;return function(_0x27cd47){logger[_0x939a('0x29')](_0x27cd47[_0x939a('0x2a')]);if(_0x27cd47[_0x939a('0x2b')]){delete _0x27cd47[_0x939a('0x2b')];}_0x322226[_0x939a('0x1e')](_0x113ccf)[_0x939a('0x2c')](_0x27cd47);};}exports[_0x939a('0x2d')]=function(_0x181ba5,_0x16286a){var _0x5add13={'raw':!![],'where':{'id':_0x181ba5['params']['id']}},_0x428289={};_0x428289[_0x939a('0x2e')]=_[_0x939a('0x2f')](db[_0x939a('0x30')][_0x939a('0x31')]);_0x428289['query']=_['keys'](_0x181ba5[_0x939a('0x32')]);_0x428289[_0x939a('0x33')]=_['intersection'](_0x428289[_0x939a('0x2e')],_0x428289['query']);_0x5add13['attributes']=_[_0x939a('0x34')](_0x428289[_0x939a('0x2e')],qs[_0x939a('0x35')](_0x181ba5['query'][_0x939a('0x35')]));_0x5add13[_0x939a('0x36')]=_0x5add13[_0x939a('0x36')][_0x939a('0x37')]?_0x5add13[_0x939a('0x36')]:_0x428289[_0x939a('0x2e')];if(_0x181ba5[_0x939a('0x32')]['includeAll']){_0x5add13[_0x939a('0x38')]=[{'all':!![]}];}_0x5add13=_[_0x939a('0x39')]({},_0x5add13,_0x181ba5['options']);return db[_0x939a('0x30')][_0x939a('0x3a')](_0x5add13)['then'](handleEntityNotFound(_0x16286a,null))[_0x939a('0x28')](respondWithResult(_0x16286a,null))['catch'](handleError(_0x16286a,null));};exports[_0x939a('0x3b')]=function(_0xada62b,_0x3f1302){return db[_0x939a('0x30')][_0x939a('0x3b')](_0xada62b[_0x939a('0x3c')],{})[_0x939a('0x28')](respondWithResult(_0x3f1302,0xc9))[_0x939a('0x3d')](handleError(_0x3f1302,null));};exports[_0x939a('0x3e')]=function(_0x1fa893,_0x153074){if(_0x1fa893[_0x939a('0x3c')]['id']){delete _0x1fa893[_0x939a('0x3c')]['id'];}return db[_0x939a('0x30')][_0x939a('0x3a')]({'where':{'id':_0x1fa893['params']['id']}})[_0x939a('0x28')](handleEntityNotFound(_0x153074,null))[_0x939a('0x28')](saveUpdates(_0x1fa893['body'],null))[_0x939a('0x28')](respondWithResult(_0x153074,null))[_0x939a('0x3d')](handleError(_0x153074,null));};exports[_0x939a('0x3f')]=function(_0x3457b4,_0x474557){return db[_0x939a('0x30')][_0x939a('0x3a')]({'where':{'id':_0x3457b4['params']['id']}})[_0x939a('0x28')](handleEntityNotFound(_0x474557,null))[_0x939a('0x28')](removeEntity(_0x474557,null))[_0x939a('0x3d')](handleError(_0x474557,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index e2f4cff..4069c30 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 _0x717c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x6d85a6,_0x5091fb){var _0x1f0470=function(_0x184f12){while(--_0x184f12){_0x6d85a6['push'](_0x6d85a6['shift']());}};_0x1f0470(++_0x5091fb);}(_0x717c,0x106));var _0xc717=function(_0x478ddb,_0x274168){_0x478ddb=_0x478ddb-0x0;var _0x3adb3c=_0x717c[_0x478ddb];return _0x3adb3c;};'use strict';var _=require(_0xc717('0x0'));var util=require(_0xc717('0x1'));var logger=require(_0xc717('0x2'))(_0xc717('0x3'));var moment=require(_0xc717('0x4'));var BPromise=require(_0xc717('0x5'));var rp=require(_0xc717('0x6'));var fs=require('fs');var path=require(_0xc717('0x7'));var rimraf=require(_0xc717('0x8'));var config=require(_0xc717('0x9'));var attributes=require(_0xc717('0xa'));module['exports']=function(_0x5e611d,_0x49c1bd){return _0x5e611d[_0xc717('0xb')](_0xc717('0xc'),attributes,{'tableName':_0xc717('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0632=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x0632,0x151));var _0x2063=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x0632[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0x2063('0x0'));var util=require(_0x2063('0x1'));var logger=require(_0x2063('0x2'))(_0x2063('0x3'));var moment=require(_0x2063('0x4'));var BPromise=require(_0x2063('0x5'));var rp=require(_0x2063('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2063('0x7'));var config=require(_0x2063('0x8'));var attributes=require(_0x2063('0x9'));module[_0x2063('0xa')]=function(_0x4096e2,_0x496b09){return _0x4096e2[_0x2063('0xb')](_0x2063('0xc'),attributes,{'tableName':'chat_proactive_actions','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 be28b0f..60f05cc 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 _0x4a7f=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x10e672,_0x4dd042){var _0x2a855e=function(_0x54e260){while(--_0x54e260){_0x10e672['push'](_0x10e672['shift']());}};_0x2a855e(++_0x4dd042);}(_0x4a7f,0x11b));var _0xf4a7=function(_0x4b92ae,_0x2d8607){_0x4b92ae=_0x4b92ae-0x0;var _0x5bab64=_0x4a7f[_0x4b92ae];return _0x5bab64;};'use strict';var _=require(_0xf4a7('0x0'));var util=require(_0xf4a7('0x1'));var moment=require('moment');var BPromise=require(_0xf4a7('0x2'));var rs=require(_0xf4a7('0x3'));var fs=require('fs');var Redis=require(_0xf4a7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4a7('0x5'));var logger=require(_0xf4a7('0x6'))(_0xf4a7('0x7'));var config=require(_0xf4a7('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x154dc3,_0x23b33a,_0xaa0f5b){return new BPromise(function(_0x260daf,_0x52bb2b){return client[_0xf4a7('0x9')](_0x154dc3,_0xaa0f5b)[_0xf4a7('0xa')](function(_0x3b53f2){logger['info'](_0xf4a7('0xb'),_0x23b33a,_0xf4a7('0xc'));logger[_0xf4a7('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x23b33a,_0xf4a7('0xc'),JSON['stringify'](_0x3b53f2));if(_0x3b53f2[_0xf4a7('0xe')]){if(_0x3b53f2[_0xf4a7('0xe')][_0xf4a7('0xf')]===0x1f4){logger['error'](_0xf4a7('0xb'),_0x23b33a,_0x3b53f2[_0xf4a7('0xe')][_0xf4a7('0x10')]);return _0x52bb2b(_0x3b53f2[_0xf4a7('0xe')][_0xf4a7('0x10')]);}logger['error'](_0xf4a7('0xb'),_0x23b33a,_0x3b53f2[_0xf4a7('0xe')][_0xf4a7('0x10')]);return _0x260daf(_0x3b53f2[_0xf4a7('0xe')][_0xf4a7('0x10')]);}else{logger[_0xf4a7('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x23b33a,_0xf4a7('0xc'));_0x260daf(_0x3b53f2['result'][_0xf4a7('0x10')]);}})[_0xf4a7('0x12')](function(_0x46729d){logger[_0xf4a7('0xe')](_0xf4a7('0xb'),_0x23b33a,_0x46729d);_0x52bb2b(_0x46729d);});});} \ No newline at end of file +var _0x4ff0=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xb5fda2,_0x49189f){var _0x153d02=function(_0x1ba0df){while(--_0x1ba0df){_0xb5fda2['push'](_0xb5fda2['shift']());}};_0x153d02(++_0x49189f);}(_0x4ff0,0x8e));var _0x04ff=function(_0x12054c,_0x27f379){_0x12054c=_0x12054c-0x0;var _0x33ede7=_0x4ff0[_0x12054c];return _0x33ede7;};'use strict';var _=require(_0x04ff('0x0'));var util=require('util');var moment=require(_0x04ff('0x1'));var BPromise=require(_0x04ff('0x2'));var rs=require(_0x04ff('0x3'));var fs=require('fs');var Redis=require(_0x04ff('0x4'));var db=require(_0x04ff('0x5'))['db'];var utils=require(_0x04ff('0x6'));var logger=require(_0x04ff('0x7'))(_0x04ff('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x04ff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x387be2,_0x522371,_0x2c0f96){return new BPromise(function(_0x5dc01b,_0xeea2db){return client[_0x04ff('0xa')](_0x387be2,_0x2c0f96)['then'](function(_0x5595d3){logger[_0x04ff('0xb')](_0x04ff('0xc'),_0x522371,_0x04ff('0xd'));logger[_0x04ff('0xe')](_0x04ff('0xf'),_0x522371,_0x04ff('0xd'),JSON[_0x04ff('0x10')](_0x5595d3));if(_0x5595d3['error']){if(_0x5595d3[_0x04ff('0x11')]['code']===0x1f4){logger['error'](_0x04ff('0xc'),_0x522371,_0x5595d3['error']['message']);return _0xeea2db(_0x5595d3[_0x04ff('0x11')][_0x04ff('0x12')]);}logger[_0x04ff('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x522371,_0x5595d3[_0x04ff('0x11')][_0x04ff('0x12')]);return _0x5dc01b(_0x5595d3[_0x04ff('0x11')][_0x04ff('0x12')]);}else{logger['info'](_0x04ff('0xc'),_0x522371,_0x04ff('0xd'));_0x5dc01b(_0x5595d3[_0x04ff('0x13')][_0x04ff('0x12')]);}})['catch'](function(_0x157487){logger[_0x04ff('0x11')](_0x04ff('0xc'),_0x522371,_0x157487);_0xeea2db(_0x157487);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 58f0084..5cfedc0 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 _0x3f8a=['/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x2db5cb,_0x1101e4){var _0x595ee8=function(_0x227710){while(--_0x227710){_0x2db5cb['push'](_0x2db5cb['shift']());}};_0x595ee8(++_0x1101e4);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x3d1360,_0xfe55ce){_0x3d1360=_0x3d1360-0x0;var _0x3346c5=_0x3f8a[_0x3d1360];return _0x3346c5;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x11')]);router['delete'](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('0x13')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0x814b,0x1a2));var _0xb814=function(_0xdcda3,_0x4252fb){_0xdcda3=_0xdcda3-0x0;var _0x2bec82=_0x814b[_0xdcda3];return _0x2bec82;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')](_0xb814('0xb'),auth['isAuthenticated'](),controller[_0xb814('0xc')]);router[_0xb814('0xd')]('/',auth['isAuthenticated'](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 2e86763..e2bade5 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 _0xe343=['roundrobin','sequelize','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x19f3a5,_0x5b94a0){var _0x3984d7=function(_0x3419ae){while(--_0x3419ae){_0x19f3a5['push'](_0x19f3a5['shift']());}};_0x3984d7(++_0x5b94a0);}(_0xe343,0x91));var _0x3e34=function(_0x4dac30,_0x3b1e61){_0x4dac30=_0x4dac30-0x0;var _0x4ae741=_0xe343[_0x4dac30];return _0x4ae741;};'use strict';var Sequelize=require(_0x3e34('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3e34('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e34('0x2')]},'timeout':{'type':Sequelize[_0x3e34('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e34('0x4')](_0x3e34('0x5'),_0x3e34('0x6'),_0x3e34('0x7'))}}; \ No newline at end of file +var _0xebd2=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x299970,_0x25c56e){var _0x1feecb=function(_0x1be5a6){while(--_0x1be5a6){_0x299970['push'](_0x299970['shift']());}};_0x1feecb(++_0x25c56e);}(_0xebd2,0x101));var _0x2ebd=function(_0x1161c6,_0x40b6fa){_0x1161c6=_0x1161c6-0x0;var _0x43ace9=_0xebd2[_0x1161c6];return _0x43ace9;};'use strict';var Sequelize=require(_0x2ebd('0x0'));module['exports']={'name':{'type':Sequelize[_0x2ebd('0x1')],'unique':_0x2ebd('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2ebd('0x1')]},'timeout':{'type':Sequelize[_0x2ebd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2ebd('0x4')](_0x2ebd('0x5'),_0x2ebd('0x6'),_0x2ebd('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 5ad4d94..6d70580 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 _0xbd26=['UserChatQueue','pick','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','User','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','includes','union','value','removeTeams','forEach','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','./chatQueue.socket','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','Content-Range','update','then','get','ChatQueues','destroy','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','params'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0xbd26,0xc6));var _0x6bd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd26[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6bd2('0x0'));var rimraf=require(_0x6bd2('0x1'));var zipdir=require(_0x6bd2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6bd2('0x3'));var BPromise=require(_0x6bd2('0x4'));var Mustache=require(_0x6bd2('0x5'));var util=require(_0x6bd2('0x6'));var path=require(_0x6bd2('0x7'));var sox=require('sox');var csv=require(_0x6bd2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6bd2('0x9'));var _=require(_0x6bd2('0xa'));var squel=require(_0x6bd2('0xb'));var crypto=require(_0x6bd2('0xc'));var jsforce=require(_0x6bd2('0xd'));var deskjs=require(_0x6bd2('0xe'));var toCsv=require(_0x6bd2('0x8'));var querystring=require('querystring');var Papa=require(_0x6bd2('0xf'));var Redis=require(_0x6bd2('0x10'));var authService=require(_0x6bd2('0x11'));var qs=require(_0x6bd2('0x12'));var as=require(_0x6bd2('0x13'));var hardwareService=require(_0x6bd2('0x14'));var logger=require(_0x6bd2('0x15'))(_0x6bd2('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6bd2('0x17'))['db'];config['redis']=_[_0x6bd2('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6bd2('0x19'))[_0x6bd2('0x1a')](socket);var jayson=require(_0x6bd2('0x1b'));var client=jayson[_0x6bd2('0x1c')][_0x6bd2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3be580,_0x10bff8,_0xecb9cb,_0x45b647){return new BPromise(function(_0x180cac,_0x350077){var _0x5b5445=_0x45b647||client;return _0x5b5445[_0x6bd2('0x1e')](_0x3be580,_0xecb9cb)['then'](function(_0x11ff65){logger[_0x6bd2('0x1f')](_0x6bd2('0x20'),_0x10bff8,_0x6bd2('0x21'));logger[_0x6bd2('0x22')](_0x6bd2('0x23'),_0x10bff8,_0x6bd2('0x21'),JSON[_0x6bd2('0x24')](_0x11ff65));if(_0x11ff65['error']){if(_0x11ff65[_0x6bd2('0x25')][_0x6bd2('0x26')]===0x1f4){logger[_0x6bd2('0x25')](_0x6bd2('0x20'),_0x10bff8,_0x11ff65[_0x6bd2('0x25')][_0x6bd2('0x27')]);return _0x350077(_0x11ff65['error']['message']);}logger[_0x6bd2('0x25')]('ChatQueue,\x20%s,\x20%s',_0x10bff8,_0x11ff65[_0x6bd2('0x25')][_0x6bd2('0x27')]);return _0x180cac(_0x11ff65[_0x6bd2('0x25')]['message']);}else{logger['info'](_0x6bd2('0x20'),_0x10bff8,'request\x20sent');_0x180cac(_0x11ff65[_0x6bd2('0x28')][_0x6bd2('0x27')]);}})['catch'](function(_0x3480a5){logger[_0x6bd2('0x25')](_0x6bd2('0x20'),_0x10bff8,_0x3480a5);_0x350077(_0x3480a5);});});}function respondWithStatusCode(_0x69721d,_0x33fb93){_0x33fb93=_0x33fb93||0xcc;return function(_0x3ebe5d){if(_0x3ebe5d){return _0x69721d['sendStatus'](_0x33fb93);}return _0x69721d[_0x6bd2('0x29')](_0x33fb93)[_0x6bd2('0x2a')]();};}function respondWithResult(_0xa3585d,_0x41304b){_0x41304b=_0x41304b||0xc8;return function(_0x3838d2){if(_0x3838d2){return _0xa3585d[_0x6bd2('0x29')](_0x41304b)[_0x6bd2('0x2b')](_0x3838d2);}};}function respondWithFilteredResult(_0x294a9a,_0x3ecf03){return function(_0x2d2267){if(_0x2d2267){var _0x12b00b=typeof _0x3ecf03[_0x6bd2('0x2c')]===_0x6bd2('0x2d')&&typeof _0x3ecf03[_0x6bd2('0x2e')]==='undefined';var _0x2e8272=_0x2d2267[_0x6bd2('0x2f')];var _0x145872=_0x12b00b?0x0:_0x3ecf03[_0x6bd2('0x2c')];var _0x346761=_0x12b00b?_0x2d2267[_0x6bd2('0x2f')]:_0x3ecf03[_0x6bd2('0x2c')]+_0x3ecf03[_0x6bd2('0x2e')];var _0x1af68a;if(_0x346761>=_0x2e8272){_0x346761=_0x2e8272;_0x1af68a=0xc8;}else{_0x1af68a=0xce;}_0x294a9a[_0x6bd2('0x29')](_0x1af68a);return _0x294a9a['set'](_0x6bd2('0x30'),_0x145872+'-'+_0x346761+'/'+_0x2e8272)['json'](_0x2d2267);}return null;};}function patchUpdates(_0x237d23){return function(_0x3b94f6){try{jsonpatch['apply'](_0x3b94f6,_0x237d23,!![]);}catch(_0x3a5041){return BPromise['reject'](_0x3a5041);}return _0x3b94f6['save']();};}function saveUpdates(_0x496fd2,_0x2c902d){return function(_0x5755fe){if(_0x5755fe){return _0x5755fe[_0x6bd2('0x31')](_0x496fd2)[_0x6bd2('0x32')](function(_0x5392d0){return _0x5392d0;});}return null;};}function removeEntity(_0x30e655,_0x5e51eb){return function(_0x56348d){if(_0x56348d){return _0x56348d['destroy']()[_0x6bd2('0x32')](function(){var _0x51cb3a=_0x56348d[_0x6bd2('0x33')]({'plain':!![]});var _0x274aca=_0x6bd2('0x34');return db['UserProfileResource'][_0x6bd2('0x35')]({'where':{'type':_0x274aca,'resourceId':_0x51cb3a['id']}})['then'](function(){return _0x56348d;});})[_0x6bd2('0x32')](function(){_0x30e655[_0x6bd2('0x29')](0xcc)[_0x6bd2('0x2a')]();});}};}function handleEntityNotFound(_0x1e391c,_0x59d4a6){return function(_0xcc38a5){if(!_0xcc38a5){_0x1e391c[_0x6bd2('0x36')](0x194);}return _0xcc38a5;};}function handleError(_0x4bf4ad,_0x24d530){_0x24d530=_0x24d530||0x1f4;return function(_0x26c0a0){logger[_0x6bd2('0x25')](_0x26c0a0[_0x6bd2('0x37')]);if(_0x26c0a0[_0x6bd2('0x38')]){delete _0x26c0a0[_0x6bd2('0x38')];}_0x4bf4ad['status'](_0x24d530)[_0x6bd2('0x39')](_0x26c0a0);};}exports[_0x6bd2('0x3a')]=function(_0x493584,_0x5444d9){var _0x49e58e={},_0x595f7e={},_0x30326d={'count':0x0,'rows':[]};var _0x1129eb=_[_0x6bd2('0x3b')](db[_0x6bd2('0x3c')][_0x6bd2('0x3d')],function(_0x3d9827){return{'name':_0x3d9827[_0x6bd2('0x3e')],'type':_0x3d9827[_0x6bd2('0x3f')]['key']};});_0x595f7e[_0x6bd2('0x40')]=_['map'](_0x1129eb,_0x6bd2('0x38'));_0x595f7e[_0x6bd2('0x41')]=_[_0x6bd2('0x42')](_0x493584[_0x6bd2('0x41')]);_0x595f7e['filters']=_[_0x6bd2('0x43')](_0x595f7e['model'],_0x595f7e[_0x6bd2('0x41')]);_0x49e58e[_0x6bd2('0x44')]=_[_0x6bd2('0x43')](_0x595f7e[_0x6bd2('0x40')],qs['fields'](_0x493584['query'][_0x6bd2('0x45')]));_0x49e58e['attributes']=_0x49e58e['attributes'][_0x6bd2('0x46')]?_0x49e58e['attributes']:_0x595f7e[_0x6bd2('0x40')];if(!_0x493584[_0x6bd2('0x41')][_0x6bd2('0x47')](_0x6bd2('0x48'))){_0x49e58e['limit']=qs['limit'](_0x493584[_0x6bd2('0x41')][_0x6bd2('0x2e')]);_0x49e58e[_0x6bd2('0x2c')]=qs[_0x6bd2('0x2c')](_0x493584[_0x6bd2('0x41')][_0x6bd2('0x2c')]);}_0x49e58e[_0x6bd2('0x49')]=qs[_0x6bd2('0x4a')](_0x493584[_0x6bd2('0x41')][_0x6bd2('0x4a')]);_0x49e58e[_0x6bd2('0x4b')]=qs[_0x6bd2('0x4c')](_['pick'](_0x493584[_0x6bd2('0x41')],_0x595f7e[_0x6bd2('0x4c')]),_0x1129eb);if(_0x493584[_0x6bd2('0x41')]['filter']){_0x49e58e[_0x6bd2('0x4b')]=_[_0x6bd2('0x4d')](_0x49e58e[_0x6bd2('0x4b')],{'$or':_[_0x6bd2('0x3b')](_0x1129eb,function(_0x3cb863){if(_0x3cb863[_0x6bd2('0x3f')]!==_0x6bd2('0x4e')){var _0x5439f5={};_0x5439f5[_0x3cb863[_0x6bd2('0x38')]]={'$like':'%'+_0x493584['query'][_0x6bd2('0x4f')]+'%'};return _0x5439f5;}})});}_0x49e58e=_['merge']({},_0x49e58e,_0x493584['options']);var _0x59f321={'where':_0x49e58e[_0x6bd2('0x4b')]};return db['ChatQueue'][_0x6bd2('0x2f')](_0x59f321)['then'](function(_0x40daa6){_0x30326d[_0x6bd2('0x2f')]=_0x40daa6;if(_0x493584[_0x6bd2('0x41')][_0x6bd2('0x50')]){_0x49e58e[_0x6bd2('0x51')]=[{'all':!![]}];}return db[_0x6bd2('0x3c')][_0x6bd2('0x52')](_0x49e58e);})['then'](function(_0x1a051e){_0x30326d[_0x6bd2('0x53')]=_0x1a051e;return _0x30326d;})[_0x6bd2('0x32')](respondWithFilteredResult(_0x5444d9,_0x49e58e))[_0x6bd2('0x54')](handleError(_0x5444d9,null));};exports[_0x6bd2('0x55')]=function(_0x52d0d0,_0x12048d){var _0x2d0b94={'raw':!![],'where':{'id':_0x52d0d0['params']['id']}},_0x661c2f={};_0x661c2f['model']=_['keys'](db[_0x6bd2('0x3c')][_0x6bd2('0x3d')]);_0x661c2f[_0x6bd2('0x41')]=_['keys'](_0x52d0d0[_0x6bd2('0x41')]);_0x661c2f[_0x6bd2('0x4c')]=_['intersection'](_0x661c2f[_0x6bd2('0x40')],_0x661c2f[_0x6bd2('0x41')]);_0x2d0b94[_0x6bd2('0x44')]=_[_0x6bd2('0x43')](_0x661c2f[_0x6bd2('0x40')],qs[_0x6bd2('0x45')](_0x52d0d0[_0x6bd2('0x41')][_0x6bd2('0x45')]));_0x2d0b94['attributes']=_0x2d0b94[_0x6bd2('0x44')][_0x6bd2('0x46')]?_0x2d0b94[_0x6bd2('0x44')]:_0x661c2f['model'];if(_0x52d0d0[_0x6bd2('0x41')]['includeAll']){_0x2d0b94[_0x6bd2('0x51')]=[{'all':!![]}];}_0x2d0b94=_['merge']({},_0x2d0b94,_0x52d0d0[_0x6bd2('0x56')]);return db[_0x6bd2('0x3c')][_0x6bd2('0x57')](_0x2d0b94)[_0x6bd2('0x32')](handleEntityNotFound(_0x12048d,null))[_0x6bd2('0x32')](respondWithResult(_0x12048d,null))[_0x6bd2('0x54')](handleError(_0x12048d,null));};exports[_0x6bd2('0x58')]=function(_0xed4bde,_0x43d071){return db[_0x6bd2('0x3c')][_0x6bd2('0x58')](_0xed4bde[_0x6bd2('0x59')],{})[_0x6bd2('0x32')](function(_0x43eb64){var _0x289369=_0xed4bde[_0x6bd2('0x5a')][_0x6bd2('0x33')]({'plain':!![]});if(!_0x289369)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x289369[_0x6bd2('0x5b')]==='user'){var _0x109929=_0x43eb64[_0x6bd2('0x33')]({'plain':!![]});var _0x570855='ChatQueues';return db[_0x6bd2('0x5c')][_0x6bd2('0x57')]({'where':{'name':_0x570855,'userProfileId':_0x289369[_0x6bd2('0x5d')]},'raw':!![]})['then'](function(_0x28948a){if(_0x28948a&&_0x28948a[_0x6bd2('0x5e')]===0x0){return db[_0x6bd2('0x5f')]['create']({'name':_0x109929['name'],'resourceId':_0x109929['id'],'type':_0x28948a[_0x6bd2('0x38')],'sectionId':_0x28948a['id']},{})['then'](function(){return _0x43eb64;});}else{return _0x43eb64;}})[_0x6bd2('0x54')](function(_0x462426){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x462426);throw _0x462426;});}return _0x43eb64;})[_0x6bd2('0x32')](respondWithResult(_0x43d071,0xc9))[_0x6bd2('0x54')](handleError(_0x43d071,null));};exports['update']=function(_0x9763f7,_0x5fcf57){if(_0x9763f7['body']['id']){delete _0x9763f7[_0x6bd2('0x59')]['id'];}return db[_0x6bd2('0x3c')][_0x6bd2('0x57')]({'where':{'id':_0x9763f7['params']['id']}})[_0x6bd2('0x32')](handleEntityNotFound(_0x5fcf57,null))[_0x6bd2('0x32')](saveUpdates(_0x9763f7['body'],null))['then'](respondWithResult(_0x5fcf57,null))[_0x6bd2('0x54')](handleError(_0x5fcf57,null));};exports[_0x6bd2('0x35')]=function(_0x5b8ee9,_0x2c36ca){return db[_0x6bd2('0x3c')][_0x6bd2('0x57')]({'where':{'id':_0x5b8ee9['params']['id']}})['then'](handleEntityNotFound(_0x2c36ca,null))[_0x6bd2('0x32')](removeEntity(_0x2c36ca,null))['catch'](handleError(_0x2c36ca,null));};exports[_0x6bd2('0x60')]=function(_0x145d26,_0x35c7d8){return db[_0x6bd2('0x3c')][_0x6bd2('0x60')]()['then'](respondWithResult(_0x35c7d8,null))[_0x6bd2('0x54')](handleError(_0x35c7d8,null));};exports[_0x6bd2('0x61')]=function(_0x1364db,_0x2108c1,_0x35a408){var _0x2b3f52={'raw':!![],'where':{}},_0x4c1825={},_0x45f296;return db[_0x6bd2('0x3c')][_0x6bd2('0x62')]({'where':{'id':_0x1364db[_0x6bd2('0x63')]['id']}})['then'](handleEntityNotFound(_0x2108c1,null))[_0x6bd2('0x32')](function(_0x437bb0){if(_0x437bb0){_0x45f296=_0x437bb0['get']({'plain':!![]});_0x4c1825[_0x6bd2('0x40')]=_[_0x6bd2('0x42')](db[_0x6bd2('0x64')][_0x6bd2('0x3d')]);_0x4c1825[_0x6bd2('0x41')]=_[_0x6bd2('0x42')](_0x1364db[_0x6bd2('0x41')]);_0x4c1825[_0x6bd2('0x4c')]=_[_0x6bd2('0x43')](_0x4c1825[_0x6bd2('0x40')],_0x4c1825[_0x6bd2('0x41')]);_0x2b3f52[_0x6bd2('0x44')]=_[_0x6bd2('0x43')](_0x4c1825['model'],qs['fields'](_0x1364db[_0x6bd2('0x41')][_0x6bd2('0x45')]));_0x2b3f52[_0x6bd2('0x44')]=_0x2b3f52['attributes'][_0x6bd2('0x46')]?_0x2b3f52['attributes']:_0x4c1825[_0x6bd2('0x40')];if(!_0x1364db[_0x6bd2('0x41')][_0x6bd2('0x47')](_0x6bd2('0x48'))){_0x2b3f52[_0x6bd2('0x2e')]=qs['limit'](_0x1364db[_0x6bd2('0x41')][_0x6bd2('0x2e')]);_0x2b3f52[_0x6bd2('0x2c')]=qs[_0x6bd2('0x2c')](_0x1364db[_0x6bd2('0x41')][_0x6bd2('0x2c')]);}_0x2b3f52['order']=qs[_0x6bd2('0x4a')](_0x1364db[_0x6bd2('0x41')][_0x6bd2('0x4a')]);_0x2b3f52[_0x6bd2('0x4b')]=qs[_0x6bd2('0x4c')](_[_0x6bd2('0x65')](_0x1364db[_0x6bd2('0x41')],_0x4c1825[_0x6bd2('0x4c')]));_0x2b3f52[_0x6bd2('0x4b')][_0x6bd2('0x66')]=_0x437bb0['id'];if(_0x1364db['query']['filter']){_0x2b3f52[_0x6bd2('0x4b')]=_[_0x6bd2('0x4d')](_0x2b3f52[_0x6bd2('0x4b')],{'$or':_[_0x6bd2('0x3b')](_0x2b3f52[_0x6bd2('0x44')],function(_0x419206){var _0x5b482d={};_0x5b482d[_0x419206]={'$like':'%'+_0x1364db[_0x6bd2('0x41')][_0x6bd2('0x4f')]+'%'};return _0x5b482d;})});}_0x2b3f52=_['merge']({},_0x2b3f52,_0x1364db[_0x6bd2('0x56')]);return db[_0x6bd2('0x64')]['findAll'](_0x2b3f52);}})[_0x6bd2('0x32')](function(_0x38a880){if(_0x38a880){return db['User'][_0x6bd2('0x67')]({'where':{'id':_['map'](_0x38a880,_0x6bd2('0x68')),'role':_0x6bd2('0x69')},'attributes':['id','name',_0x6bd2('0x6a'),_0x6bd2('0x6b'),_0x6bd2('0x6c')]});}})[_0x6bd2('0x32')](function(_0xa2df7a){if(_0xa2df7a){return{'count':_0xa2df7a[_0x6bd2('0x2f')],'rows':_[_0x6bd2('0x3b')](_0xa2df7a[_0x6bd2('0x53')],function(_0x312f87){return{'membername':_0x312f87['name'],'UserId':_0x312f87['id'],'queue_name':_0x45f296[_0x6bd2('0x38')],'ChatQueueId':_0x45f296['id'],'interface':util[_0x6bd2('0x6d')](_0x6bd2('0x6e'),_0x6bd2('0x6f'),_0x312f87[_0x6bd2('0x38')]),'penalty':0x0,'paused':_0x312f87['chatPause'],'createdAt':_0x312f87[_0x6bd2('0x6c')],'updatedAt':_0x312f87[_0x6bd2('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2108c1,_0x2b3f52))[_0x6bd2('0x54')](handleError(_0x2108c1,null));};exports['getTeams']=function(_0x12ed76,_0x56d981,_0x164445){var _0x82bfd9={};var _0x1655c6={};var _0x5d5dd7;var _0x4b8873;return db[_0x6bd2('0x3c')][_0x6bd2('0x62')]({'where':{'id':_0x12ed76[_0x6bd2('0x63')]['id']}})['then'](handleEntityNotFound(_0x56d981,null))['then'](function(_0x2a1096){if(_0x2a1096){_0x5d5dd7=_0x2a1096;_0x1655c6[_0x6bd2('0x40')]=_[_0x6bd2('0x42')](db[_0x6bd2('0x70')][_0x6bd2('0x3d')]);_0x1655c6[_0x6bd2('0x41')]=_[_0x6bd2('0x42')](_0x12ed76['query']);_0x1655c6[_0x6bd2('0x4c')]=_[_0x6bd2('0x43')](_0x1655c6[_0x6bd2('0x40')],_0x1655c6[_0x6bd2('0x41')]);_0x82bfd9[_0x6bd2('0x44')]=_[_0x6bd2('0x43')](_0x1655c6[_0x6bd2('0x40')],qs['fields'](_0x12ed76[_0x6bd2('0x41')][_0x6bd2('0x45')]));_0x82bfd9['attributes']=_0x82bfd9['attributes'][_0x6bd2('0x46')]?_0x82bfd9[_0x6bd2('0x44')]:_0x1655c6[_0x6bd2('0x40')];_0x82bfd9[_0x6bd2('0x49')]=qs['sort'](_0x12ed76[_0x6bd2('0x41')][_0x6bd2('0x4a')]);_0x82bfd9['where']=qs['filters'](_[_0x6bd2('0x65')](_0x12ed76['query'],_0x1655c6[_0x6bd2('0x4c')]));if(_0x12ed76[_0x6bd2('0x41')][_0x6bd2('0x4f')]){_0x82bfd9['where']=_[_0x6bd2('0x4d')](_0x82bfd9[_0x6bd2('0x4b')],{'$or':_['map'](_0x82bfd9[_0x6bd2('0x44')],function(_0x286e87){var _0x3643c9={};_0x3643c9[_0x286e87]={'$like':'%'+_0x12ed76['query']['filter']+'%'};return _0x3643c9;})});}_0x82bfd9=_[_0x6bd2('0x4d')]({},_0x82bfd9,_0x12ed76[_0x6bd2('0x56')]);return _0x5d5dd7[_0x6bd2('0x71')](_0x82bfd9);}})[_0x6bd2('0x32')](function(_0x3e31c8){if(_0x3e31c8){_0x4b8873=_0x3e31c8['length'];if(!_0x12ed76[_0x6bd2('0x41')]['hasOwnProperty']('nolimit')){_0x82bfd9[_0x6bd2('0x2e')]=qs[_0x6bd2('0x2e')](_0x12ed76[_0x6bd2('0x41')][_0x6bd2('0x2e')]);_0x82bfd9['offset']=qs[_0x6bd2('0x2c')](_0x12ed76[_0x6bd2('0x41')][_0x6bd2('0x2c')]);}return _0x5d5dd7[_0x6bd2('0x71')](_0x82bfd9);}})['then'](function(_0x11477e){if(_0x11477e){return _0x11477e?{'count':_0x4b8873,'rows':_0x11477e}:null;}})[_0x6bd2('0x32')](respondWithResult(_0x56d981,null))[_0x6bd2('0x54')](handleError(_0x56d981,null));};exports[_0x6bd2('0x72')]=function(_0x41d7e9,_0x336a58,_0x73a824){var _0x1827d4=_0x41d7e9['body'][_0x6bd2('0x73')];return db[_0x6bd2('0x70')][_0x6bd2('0x52')]({'where':{'id':_0x1827d4},'attributes':['id'],'include':[{'model':db[_0x6bd2('0x74')],'as':'Agents','attributes':['id','name','online','voicePause','interface'],'raw':!![]}]})[_0x6bd2('0x32')](function(_0xe8d54c){if(_0xe8d54c){var _0x4fcde2=_[_0x6bd2('0x75')](_0xe8d54c,function(_0x45f280){var _0x456e37=_0x45f280[_0x6bd2('0x33')]({'plain':!![]});return _0x456e37[_0x6bd2('0x76')];});return db['ChatQueue'][_0x6bd2('0x57')]({'where':{'id':_0x41d7e9[_0x6bd2('0x63')]['id']}})[_0x6bd2('0x32')](function(_0x25cf81){return db[_0x6bd2('0x77')][_0x6bd2('0x78')](function(_0x3b7be4){return _0x25cf81[_0x6bd2('0x72')](_0x1827d4,{'transaction':_0x3b7be4})[_0x6bd2('0x32')](function(){return BPromise[_0x6bd2('0x79')](_0x4fcde2,function(_0x473a2a){return db[_0x6bd2('0x64')][_0x6bd2('0x7a')]({'where':{'UserId':_0x473a2a['id'],'ChatQueueId':_0x41d7e9['params']['id']},'transaction':_0x3b7be4});});})[_0x6bd2('0x32')](function(){_0x4fcde2['forEach'](function(_0x1c39e5){socket[_0x6bd2('0x7b')](_0x6bd2('0x7c'),{'UserId':_0x1c39e5['id'],'ChatQueueId':_0x25cf81['id']});});});});});}})[_0x6bd2('0x32')](respondWithStatusCode(_0x336a58,null))[_0x6bd2('0x54')](handleError(_0x336a58,null));};exports['removeTeams']=function(_0x1a2a31,_0x3c25ba,_0x33265c){return db[_0x6bd2('0x70')][_0x6bd2('0x52')]({'where':{'id':_0x1a2a31[_0x6bd2('0x41')][_0x6bd2('0x73')]},'attributes':['id'],'include':[{'model':db[_0x6bd2('0x74')],'as':_0x6bd2('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3c25ba,null))[_0x6bd2('0x32')](function(_0x4845a4){var _0x446cae=_['map'](_0x4845a4,'id');var _0x27b4c8=[];var _0x4130f7=[];var _0x5d8ed7=squel[_0x6bd2('0x7d')]();_0x5d8ed7[_0x6bd2('0x7e')](_0x6bd2('0x7f'))[_0x6bd2('0x80')](_0x6bd2('0x81'),'tq')[_0x6bd2('0x82')](_0x6bd2('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6bd2('0x4b')](_0x6bd2('0x84'),_0x1a2a31[_0x6bd2('0x63')]['id']);for(var _0x144009=0x0;_0x144009<_0x4845a4['length'];_0x144009+=0x1){let _0x4c5eeb=_0x4845a4[_0x144009];for(var _0x11d18a=0x0;_0x11d18a<_0x4c5eeb[_0x6bd2('0x76')][_0x6bd2('0x46')];_0x11d18a+=0x1){let _0x5c59bd=_0x4c5eeb['Agents'][_0x11d18a];var _0x4a66d4=_0x5d8ed7[_0x6bd2('0x85')]();_0x4a66d4['where']('ut.UserId\x20=\x20?',_0x5c59bd['id']);_0x4130f7['push'](db[_0x6bd2('0x77')][_0x6bd2('0x41')](_0x4a66d4[_0x6bd2('0x86')](),{'type':db[_0x6bd2('0x77')][_0x6bd2('0x87')][_0x6bd2('0x88')]})['then'](function(_0x5abf65){if(_0x5abf65[_0x6bd2('0x46')]===0x1){return _0x5c59bd['id'];}else{var _0x50a75=_['every'](_[_0x6bd2('0x3b')](_0x5abf65,'TeamId'),function(_0x338bdb){return _[_0x6bd2('0x89')](_0x446cae,_0x338bdb);});if(_0x50a75){return _0x5c59bd['id'];}}}));}}return BPromise['all'](_0x4130f7)[_0x6bd2('0x32')](function(_0x4271f9){_0x27b4c8=_(_0x27b4c8)[_0x6bd2('0x8a')](_0x4271f9)['compact']()[_0x6bd2('0x8b')]();return db['ChatQueue'][_0x6bd2('0x57')]({'where':{'id':_0x1a2a31['params']['id']}})[_0x6bd2('0x32')](function(_0x4ba121){return db['sequelize'][_0x6bd2('0x78')](function(_0x420673){return _0x4ba121[_0x6bd2('0x8c')](_0x1a2a31[_0x6bd2('0x41')][_0x6bd2('0x73')],{'transaction':_0x420673})[_0x6bd2('0x32')](function(){if(!_['isEmpty'](_0x27b4c8)){return _0x4ba121['removeAgents'](_0x27b4c8,{'transaction':_0x420673});}})[_0x6bd2('0x32')](function(){_0x27b4c8[_0x6bd2('0x8d')](function(_0x68fb73){socket[_0x6bd2('0x7b')](_0x6bd2('0x8e'),{'UserId':_0x68fb73,'ChatQueueId':_0x4ba121['id']});});});});});});})[_0x6bd2('0x32')](respondWithStatusCode(_0x3c25ba,null))[_0x6bd2('0x54')](handleError(_0x3c25ba,null));};exports[_0x6bd2('0x8f')]=function(_0x1903c1,_0x310866,_0x26610d){return db['ChatQueue'][_0x6bd2('0x57')]({'where':{'id':_0x1903c1['params']['id']}})[_0x6bd2('0x32')](handleEntityNotFound(_0x310866,null))[_0x6bd2('0x32')](function(_0x32f2d2){if(_0x32f2d2){return _0x32f2d2[_0x6bd2('0x8f')](_0x1903c1[_0x6bd2('0x59')][_0x6bd2('0x73')],_[_0x6bd2('0x90')](_0x1903c1[_0x6bd2('0x59')],[_0x6bd2('0x73'),'id'])||{})[_0x6bd2('0x91')](function(_0x14495f){for(var _0x2d75ad=0x0;_0x2d75ad<_0x1903c1[_0x6bd2('0x59')][_0x6bd2('0x73')][_0x6bd2('0x46')];_0x2d75ad+=0x1){socket[_0x6bd2('0x7b')]('userChatQueue:save',{'UserId':Number(_0x1903c1['body']['ids'][_0x2d75ad]),'ChatQueueId':Number(_0x1903c1[_0x6bd2('0x63')]['id'])});}return _0x14495f;});}})[_0x6bd2('0x32')](respondWithResult(_0x310866,null))[_0x6bd2('0x54')](handleError(_0x310866,null));};exports[_0x6bd2('0x92')]=function(_0x11ff46,_0x354ddf,_0x528fdf){return db['ChatQueue'][_0x6bd2('0x57')]({'where':{'id':_0x11ff46[_0x6bd2('0x63')]['id']}})[_0x6bd2('0x32')](handleEntityNotFound(_0x354ddf,null))[_0x6bd2('0x32')](function(_0x3bf5b2){if(_0x3bf5b2){return _0x3bf5b2[_0x6bd2('0x92')](_0x11ff46[_0x6bd2('0x41')][_0x6bd2('0x73')])[_0x6bd2('0x32')](function(){if(_[_0x6bd2('0x93')](_0x11ff46[_0x6bd2('0x41')][_0x6bd2('0x73')])){for(var _0x50c977=0x0;_0x50c977<_0x11ff46['query'][_0x6bd2('0x73')][_0x6bd2('0x46')];_0x50c977+=0x1){socket[_0x6bd2('0x7b')](_0x6bd2('0x8e'),{'UserId':Number(_0x11ff46['query'][_0x6bd2('0x73')][_0x50c977]),'ChatQueueId':Number(_0x11ff46['params']['id'])});}}else{socket[_0x6bd2('0x7b')](_0x6bd2('0x8e'),{'UserId':Number(_0x11ff46[_0x6bd2('0x41')]['ids']),'ChatQueueId':Number(_0x11ff46[_0x6bd2('0x63')]['id'])});}});}})[_0x6bd2('0x32')](respondWithStatusCode(_0x354ddf,null))[_0x6bd2('0x54')](handleError(_0x354ddf,null));};exports['getAgents']=function(_0x581581,_0x5da3f7,_0x550405){var _0x2be5b2={};var _0x4616eb={};var _0x3d941c;var _0x8391bf;return db[_0x6bd2('0x3c')][_0x6bd2('0x62')]({'where':{'id':_0x581581[_0x6bd2('0x63')]['id']}})[_0x6bd2('0x32')](handleEntityNotFound(_0x5da3f7,null))['then'](function(_0x1a7b5c){if(_0x1a7b5c){_0x3d941c=_0x1a7b5c;_0x4616eb[_0x6bd2('0x40')]=_[_0x6bd2('0x42')](db[_0x6bd2('0x74')][_0x6bd2('0x3d')]);_0x4616eb[_0x6bd2('0x41')]=_[_0x6bd2('0x42')](_0x581581[_0x6bd2('0x41')]);_0x4616eb['filters']=_['intersection'](_0x4616eb['model'],_0x4616eb[_0x6bd2('0x41')]);_0x2be5b2[_0x6bd2('0x44')]=_[_0x6bd2('0x43')](_0x4616eb[_0x6bd2('0x40')],qs[_0x6bd2('0x45')](_0x581581['query']['fields']));_0x2be5b2[_0x6bd2('0x44')]=_0x2be5b2['attributes'][_0x6bd2('0x46')]?_0x2be5b2[_0x6bd2('0x44')]:_0x4616eb[_0x6bd2('0x40')];_0x2be5b2[_0x6bd2('0x49')]=qs[_0x6bd2('0x4a')](_0x581581[_0x6bd2('0x41')][_0x6bd2('0x4a')]);_0x2be5b2[_0x6bd2('0x4b')]=qs[_0x6bd2('0x4c')](_['pick'](_0x581581[_0x6bd2('0x41')],_0x4616eb['filters']));if(_0x581581[_0x6bd2('0x41')][_0x6bd2('0x4f')]){_0x2be5b2[_0x6bd2('0x4b')]=_[_0x6bd2('0x4d')](_0x2be5b2[_0x6bd2('0x4b')],{'$or':_['map'](_0x2be5b2[_0x6bd2('0x44')],function(_0x531748){var _0x1818f1={};_0x1818f1[_0x531748]={'$like':'%'+_0x581581[_0x6bd2('0x41')][_0x6bd2('0x4f')]+'%'};return _0x1818f1;})});}_0x2be5b2=_[_0x6bd2('0x4d')]({},_0x2be5b2,_0x581581['options']);return _0x3d941c[_0x6bd2('0x94')](_0x2be5b2);}})['then'](function(_0x14d7de){if(_0x14d7de){_0x8391bf=_0x14d7de[_0x6bd2('0x46')];if(!_0x581581[_0x6bd2('0x41')]['hasOwnProperty'](_0x6bd2('0x48'))){_0x2be5b2[_0x6bd2('0x2e')]=qs[_0x6bd2('0x2e')](_0x581581['query'][_0x6bd2('0x2e')]);_0x2be5b2['offset']=qs[_0x6bd2('0x2c')](_0x581581[_0x6bd2('0x41')]['offset']);}return _0x3d941c[_0x6bd2('0x94')](_0x2be5b2);}})['then'](function(_0x56fa83){if(_0x56fa83){return _0x56fa83?{'count':_0x8391bf,'rows':_0x56fa83}:null;}})[_0x6bd2('0x32')](respondWithResult(_0x5da3f7,null))[_0x6bd2('0x54')](handleError(_0x5da3f7,null));}; \ No newline at end of file +var _0xe62c=['to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./chatQueue.socket','register','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','ChatQueues','stack','name','send','index','ChatQueue','type','key','model','keys','query','filters','attributes','fields','length','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','intersection','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','UserChatQueue','nolimit','pick','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','hasOwnProperty','addTeams','User','online','flatMap','Agents','transaction','each','findOrCreate','forEach','removeTeams','ids','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x22a1e0,_0x279d8b){var _0x5d0dc7=function(_0x421aff){while(--_0x421aff){_0x22a1e0['push'](_0x22a1e0['shift']());}};_0x5d0dc7(++_0x279d8b);}(_0xe62c,0x11f));var _0xce62=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe62c[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xce62('0x0'));var jsonpatch=require(_0xce62('0x1'));var rp=require(_0xce62('0x2'));var moment=require(_0xce62('0x3'));var BPromise=require(_0xce62('0x4'));var Mustache=require(_0xce62('0x5'));var util=require(_0xce62('0x6'));var path=require(_0xce62('0x7'));var sox=require(_0xce62('0x8'));var csv=require(_0xce62('0x9'));var ejs=require(_0xce62('0xa'));var fs=require('fs');var fs_extra=require(_0xce62('0xb'));var _=require('lodash');var squel=require(_0xce62('0xc'));var crypto=require(_0xce62('0xd'));var jsforce=require(_0xce62('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce62('0x9'));var querystring=require('querystring');var Papa=require(_0xce62('0xf'));var Redis=require(_0xce62('0x10'));var authService=require(_0xce62('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce62('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce62('0x13'))('api');var utils=require(_0xce62('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xce62('0x15'));var db=require(_0xce62('0x16'))['db'];config['redis']=_[_0xce62('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce62('0x18')]));require(_0xce62('0x19'))[_0xce62('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xce62('0x1b')][_0xce62('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1083a0,_0x25bd4e,_0x10f3ef,_0x592b14){return new BPromise(function(_0x4b2071,_0x16ee9f){var _0x4ebe3c=_0x592b14||client;return _0x4ebe3c[_0xce62('0x1d')](_0x1083a0,_0x10f3ef)['then'](function(_0x4d23d0){logger[_0xce62('0x1e')](_0xce62('0x1f'),_0x25bd4e,_0xce62('0x20'));logger[_0xce62('0x21')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x25bd4e,'request\x20sent',JSON[_0xce62('0x22')](_0x4d23d0));if(_0x4d23d0[_0xce62('0x23')]){if(_0x4d23d0[_0xce62('0x23')][_0xce62('0x24')]===0x1f4){logger[_0xce62('0x23')](_0xce62('0x1f'),_0x25bd4e,_0x4d23d0[_0xce62('0x23')][_0xce62('0x25')]);return _0x16ee9f(_0x4d23d0[_0xce62('0x23')][_0xce62('0x25')]);}logger[_0xce62('0x23')](_0xce62('0x1f'),_0x25bd4e,_0x4d23d0['error'][_0xce62('0x25')]);return _0x4b2071(_0x4d23d0[_0xce62('0x23')][_0xce62('0x25')]);}else{logger[_0xce62('0x1e')]('ChatQueue,\x20%s,\x20%s',_0x25bd4e,_0xce62('0x20'));_0x4b2071(_0x4d23d0[_0xce62('0x26')][_0xce62('0x25')]);}})[_0xce62('0x27')](function(_0x5b0743){logger['error'](_0xce62('0x1f'),_0x25bd4e,_0x5b0743);_0x16ee9f(_0x5b0743);});});}function respondWithStatusCode(_0x1bf55f,_0xc614c9){_0xc614c9=_0xc614c9||0xcc;return function(_0x53c07f){if(_0x53c07f){return _0x1bf55f[_0xce62('0x28')](_0xc614c9);}return _0x1bf55f[_0xce62('0x29')](_0xc614c9)[_0xce62('0x2a')]();};}function respondWithResult(_0x4ed526,_0x56a0f0){_0x56a0f0=_0x56a0f0||0xc8;return function(_0x23f5ab){if(_0x23f5ab){return _0x4ed526[_0xce62('0x29')](_0x56a0f0)[_0xce62('0x2b')](_0x23f5ab);}};}function respondWithFilteredResult(_0x57f9f6,_0x4f435e){return function(_0x170ff1){if(_0x170ff1){var _0x1738fb=typeof _0x4f435e[_0xce62('0x2c')]===_0xce62('0x2d')&&typeof _0x4f435e['limit']==='undefined';var _0x40f926=_0x170ff1[_0xce62('0x2e')];var _0x59341b=_0x1738fb?0x0:_0x4f435e[_0xce62('0x2c')];var _0x475353=_0x1738fb?_0x170ff1[_0xce62('0x2e')]:_0x4f435e['offset']+_0x4f435e[_0xce62('0x2f')];var _0x30f73a;if(_0x475353>=_0x40f926){_0x475353=_0x40f926;_0x30f73a=0xc8;}else{_0x30f73a=0xce;}_0x57f9f6['status'](_0x30f73a);return _0x57f9f6[_0xce62('0x30')](_0xce62('0x31'),_0x59341b+'-'+_0x475353+'/'+_0x40f926)[_0xce62('0x2b')](_0x170ff1);}return null;};}function patchUpdates(_0x346567){return function(_0xb78e36){try{jsonpatch[_0xce62('0x32')](_0xb78e36,_0x346567,!![]);}catch(_0x4c7291){return BPromise[_0xce62('0x33')](_0x4c7291);}return _0xb78e36[_0xce62('0x34')]();};}function saveUpdates(_0x24901b,_0x945949){return function(_0xe18252){if(_0xe18252){return _0xe18252[_0xce62('0x35')](_0x24901b)[_0xce62('0x36')](function(_0x21c50d){return _0x21c50d;});}return null;};}function removeEntity(_0x3191fe,_0x3fb4b9){return function(_0x301c30){if(_0x301c30){return _0x301c30[_0xce62('0x37')]()[_0xce62('0x36')](function(){var _0x5592c3=_0x301c30['get']({'plain':!![]});var _0xcf2b9f=_0xce62('0x38');return db['UserProfileResource'][_0xce62('0x37')]({'where':{'type':_0xcf2b9f,'resourceId':_0x5592c3['id']}})[_0xce62('0x36')](function(){return _0x301c30;});})['then'](function(){_0x3191fe[_0xce62('0x29')](0xcc)[_0xce62('0x2a')]();});}};}function handleEntityNotFound(_0x181e04,_0x2caa52){return function(_0x422a09){if(!_0x422a09){_0x181e04[_0xce62('0x28')](0x194);}return _0x422a09;};}function handleError(_0xf74bea,_0x5064f2){_0x5064f2=_0x5064f2||0x1f4;return function(_0x38a6ec){logger['error'](_0x38a6ec[_0xce62('0x39')]);if(_0x38a6ec['name']){delete _0x38a6ec[_0xce62('0x3a')];}_0xf74bea[_0xce62('0x29')](_0x5064f2)[_0xce62('0x3b')](_0x38a6ec);};}exports[_0xce62('0x3c')]=function(_0xc1a47,_0x58642d){var _0x5d37ee={},_0xe786b8={},_0x151be4={'count':0x0,'rows':[]};var _0x5c30bc=_['map'](db[_0xce62('0x3d')]['rawAttributes'],function(_0x2813fe){return{'name':_0x2813fe['fieldName'],'type':_0x2813fe[_0xce62('0x3e')][_0xce62('0x3f')]};});_0xe786b8[_0xce62('0x40')]=_['map'](_0x5c30bc,_0xce62('0x3a'));_0xe786b8['query']=_[_0xce62('0x41')](_0xc1a47[_0xce62('0x42')]);_0xe786b8[_0xce62('0x43')]=_['intersection'](_0xe786b8[_0xce62('0x40')],_0xe786b8['query']);_0x5d37ee[_0xce62('0x44')]=_['intersection'](_0xe786b8['model'],qs[_0xce62('0x45')](_0xc1a47[_0xce62('0x42')][_0xce62('0x45')]));_0x5d37ee['attributes']=_0x5d37ee[_0xce62('0x44')][_0xce62('0x46')]?_0x5d37ee[_0xce62('0x44')]:_0xe786b8['model'];if(!_0xc1a47['query']['hasOwnProperty']('nolimit')){_0x5d37ee[_0xce62('0x2f')]=qs[_0xce62('0x2f')](_0xc1a47[_0xce62('0x42')][_0xce62('0x2f')]);_0x5d37ee[_0xce62('0x2c')]=qs['offset'](_0xc1a47[_0xce62('0x42')]['offset']);}_0x5d37ee[_0xce62('0x47')]=qs[_0xce62('0x48')](_0xc1a47[_0xce62('0x42')][_0xce62('0x48')]);_0x5d37ee[_0xce62('0x49')]=qs[_0xce62('0x43')](_['pick'](_0xc1a47[_0xce62('0x42')],_0xe786b8[_0xce62('0x43')]),_0x5c30bc);if(_0xc1a47[_0xce62('0x42')][_0xce62('0x4a')]){_0x5d37ee[_0xce62('0x49')]=_[_0xce62('0x4b')](_0x5d37ee['where'],{'$or':_[_0xce62('0x4c')](_0x5c30bc,function(_0x45807e){if(_0x45807e[_0xce62('0x3e')]!==_0xce62('0x4d')){var _0xf8fd93={};_0xf8fd93[_0x45807e[_0xce62('0x3a')]]={'$like':'%'+_0xc1a47[_0xce62('0x42')][_0xce62('0x4a')]+'%'};return _0xf8fd93;}})});}_0x5d37ee=_[_0xce62('0x4b')]({},_0x5d37ee,_0xc1a47[_0xce62('0x4e')]);var _0x54225e={'where':_0x5d37ee[_0xce62('0x49')]};return db[_0xce62('0x3d')][_0xce62('0x2e')](_0x54225e)['then'](function(_0x38a563){_0x151be4['count']=_0x38a563;if(_0xc1a47[_0xce62('0x42')][_0xce62('0x4f')]){_0x5d37ee['include']=[{'all':!![]}];}return db[_0xce62('0x3d')][_0xce62('0x50')](_0x5d37ee);})[_0xce62('0x36')](function(_0x529919){_0x151be4[_0xce62('0x51')]=_0x529919;return _0x151be4;})['then'](respondWithFilteredResult(_0x58642d,_0x5d37ee))[_0xce62('0x27')](handleError(_0x58642d,null));};exports[_0xce62('0x52')]=function(_0x46a81d,_0x45a4ed){var _0x12620d={'raw':!![],'where':{'id':_0x46a81d[_0xce62('0x53')]['id']}},_0x61a937={};_0x61a937[_0xce62('0x40')]=_[_0xce62('0x41')](db[_0xce62('0x3d')][_0xce62('0x54')]);_0x61a937[_0xce62('0x42')]=_[_0xce62('0x41')](_0x46a81d['query']);_0x61a937[_0xce62('0x43')]=_[_0xce62('0x55')](_0x61a937[_0xce62('0x40')],_0x61a937[_0xce62('0x42')]);_0x12620d[_0xce62('0x44')]=_['intersection'](_0x61a937['model'],qs['fields'](_0x46a81d[_0xce62('0x42')]['fields']));_0x12620d['attributes']=_0x12620d[_0xce62('0x44')][_0xce62('0x46')]?_0x12620d[_0xce62('0x44')]:_0x61a937[_0xce62('0x40')];if(_0x46a81d[_0xce62('0x42')]['includeAll']){_0x12620d['include']=[{'all':!![]}];}_0x12620d=_[_0xce62('0x4b')]({},_0x12620d,_0x46a81d[_0xce62('0x4e')]);return db[_0xce62('0x3d')][_0xce62('0x56')](_0x12620d)['then'](handleEntityNotFound(_0x45a4ed,null))[_0xce62('0x36')](respondWithResult(_0x45a4ed,null))[_0xce62('0x27')](handleError(_0x45a4ed,null));};exports[_0xce62('0x57')]=function(_0x571aec,_0x26de1f){return db['ChatQueue'][_0xce62('0x57')](_0x571aec[_0xce62('0x58')],{})[_0xce62('0x36')](function(_0x1e3618){var _0x359135=_0x571aec['user'][_0xce62('0x59')]({'plain':!![]});if(!_0x359135)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x359135[_0xce62('0x5a')]===_0xce62('0x5b')){var _0x40bb1e=_0x1e3618[_0xce62('0x59')]({'plain':!![]});var _0x1e7177='ChatQueues';return db[_0xce62('0x5c')]['find']({'where':{'name':_0x1e7177,'userProfileId':_0x359135[_0xce62('0x5d')]},'raw':!![]})['then'](function(_0x8bc3cc){if(_0x8bc3cc&&_0x8bc3cc[_0xce62('0x5e')]===0x0){return db[_0xce62('0x5f')][_0xce62('0x57')]({'name':_0x40bb1e[_0xce62('0x3a')],'resourceId':_0x40bb1e['id'],'type':_0x8bc3cc[_0xce62('0x3a')],'sectionId':_0x8bc3cc['id']},{})[_0xce62('0x36')](function(){return _0x1e3618;});}else{return _0x1e3618;}})[_0xce62('0x27')](function(_0x3a0a90){logger[_0xce62('0x23')](_0xce62('0x60'),_0x3a0a90);throw _0x3a0a90;});}return _0x1e3618;})[_0xce62('0x36')](respondWithResult(_0x26de1f,0xc9))['catch'](handleError(_0x26de1f,null));};exports[_0xce62('0x35')]=function(_0x235a33,_0x176684){if(_0x235a33[_0xce62('0x58')]['id']){delete _0x235a33[_0xce62('0x58')]['id'];}return db[_0xce62('0x3d')][_0xce62('0x56')]({'where':{'id':_0x235a33[_0xce62('0x53')]['id']}})[_0xce62('0x36')](handleEntityNotFound(_0x176684,null))[_0xce62('0x36')](saveUpdates(_0x235a33['body'],null))[_0xce62('0x36')](respondWithResult(_0x176684,null))[_0xce62('0x27')](handleError(_0x176684,null));};exports[_0xce62('0x37')]=function(_0xa323ca,_0x1988bd){return db[_0xce62('0x3d')]['find']({'where':{'id':_0xa323ca[_0xce62('0x53')]['id']}})[_0xce62('0x36')](handleEntityNotFound(_0x1988bd,null))[_0xce62('0x36')](removeEntity(_0x1988bd,null))[_0xce62('0x27')](handleError(_0x1988bd,null));};exports['describe']=function(_0x32d139,_0x2ecf78){return db['ChatQueue']['describe']()[_0xce62('0x36')](respondWithResult(_0x2ecf78,null))['catch'](handleError(_0x2ecf78,null));};exports[_0xce62('0x61')]=function(_0x2477e1,_0x42816b,_0x2c3892){var _0x29159b={'raw':!![],'where':{}},_0x15a5a9={},_0x1b6eb6;return db[_0xce62('0x3d')]['findOne']({'where':{'id':_0x2477e1[_0xce62('0x53')]['id']}})['then'](handleEntityNotFound(_0x42816b,null))[_0xce62('0x36')](function(_0x37ca7e){if(_0x37ca7e){_0x1b6eb6=_0x37ca7e[_0xce62('0x59')]({'plain':!![]});_0x15a5a9[_0xce62('0x40')]=_[_0xce62('0x41')](db[_0xce62('0x62')][_0xce62('0x54')]);_0x15a5a9[_0xce62('0x42')]=_[_0xce62('0x41')](_0x2477e1['query']);_0x15a5a9['filters']=_[_0xce62('0x55')](_0x15a5a9[_0xce62('0x40')],_0x15a5a9[_0xce62('0x42')]);_0x29159b[_0xce62('0x44')]=_[_0xce62('0x55')](_0x15a5a9[_0xce62('0x40')],qs[_0xce62('0x45')](_0x2477e1['query'][_0xce62('0x45')]));_0x29159b['attributes']=_0x29159b['attributes'][_0xce62('0x46')]?_0x29159b['attributes']:_0x15a5a9[_0xce62('0x40')];if(!_0x2477e1[_0xce62('0x42')]['hasOwnProperty'](_0xce62('0x63'))){_0x29159b[_0xce62('0x2f')]=qs[_0xce62('0x2f')](_0x2477e1[_0xce62('0x42')][_0xce62('0x2f')]);_0x29159b[_0xce62('0x2c')]=qs[_0xce62('0x2c')](_0x2477e1[_0xce62('0x42')][_0xce62('0x2c')]);}_0x29159b[_0xce62('0x47')]=qs[_0xce62('0x48')](_0x2477e1[_0xce62('0x42')][_0xce62('0x48')]);_0x29159b[_0xce62('0x49')]=qs[_0xce62('0x43')](_[_0xce62('0x64')](_0x2477e1[_0xce62('0x42')],_0x15a5a9[_0xce62('0x43')]));_0x29159b[_0xce62('0x49')]['ChatQueueId']=_0x37ca7e['id'];if(_0x2477e1[_0xce62('0x42')][_0xce62('0x4a')]){_0x29159b[_0xce62('0x49')]=_[_0xce62('0x4b')](_0x29159b['where'],{'$or':_['map'](_0x29159b['attributes'],function(_0x38463b){var _0xedb6a1={};_0xedb6a1[_0x38463b]={'$like':'%'+_0x2477e1[_0xce62('0x42')][_0xce62('0x4a')]+'%'};return _0xedb6a1;})});}_0x29159b=_[_0xce62('0x4b')]({},_0x29159b,_0x2477e1[_0xce62('0x4e')]);return db[_0xce62('0x62')][_0xce62('0x50')](_0x29159b);}})[_0xce62('0x36')](function(_0x2b71f2){if(_0x2b71f2){return db['User'][_0xce62('0x65')]({'where':{'id':_[_0xce62('0x4c')](_0x2b71f2,_0xce62('0x66')),'role':'agent'},'attributes':['id',_0xce62('0x3a'),_0xce62('0x67'),_0xce62('0x68'),_0xce62('0x69')]});}})[_0xce62('0x36')](function(_0x2d0680){if(_0x2d0680){return{'count':_0x2d0680[_0xce62('0x2e')],'rows':_[_0xce62('0x4c')](_0x2d0680[_0xce62('0x51')],function(_0x4eb706){return{'membername':_0x4eb706['name'],'UserId':_0x4eb706['id'],'queue_name':_0x1b6eb6['name'],'ChatQueueId':_0x1b6eb6['id'],'interface':util[_0xce62('0x6a')](_0xce62('0x6b'),_0xce62('0x6c'),_0x4eb706[_0xce62('0x3a')]),'penalty':0x0,'paused':_0x4eb706['chatPause'],'createdAt':_0x4eb706[_0xce62('0x69')],'updatedAt':_0x4eb706['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xce62('0x36')](respondWithFilteredResult(_0x42816b,_0x29159b))[_0xce62('0x27')](handleError(_0x42816b,null));};exports[_0xce62('0x6d')]=function(_0xcbb567,_0x5c6fec,_0x59167f){var _0x249ea0={};var _0x29db70={};var _0x15d374;var _0x360b3d;return db[_0xce62('0x3d')][_0xce62('0x6e')]({'where':{'id':_0xcbb567[_0xce62('0x53')]['id']}})['then'](handleEntityNotFound(_0x5c6fec,null))[_0xce62('0x36')](function(_0x18db19){if(_0x18db19){_0x15d374=_0x18db19;_0x29db70['model']=_[_0xce62('0x41')](db[_0xce62('0x6f')][_0xce62('0x54')]);_0x29db70[_0xce62('0x42')]=_[_0xce62('0x41')](_0xcbb567[_0xce62('0x42')]);_0x29db70[_0xce62('0x43')]=_[_0xce62('0x55')](_0x29db70[_0xce62('0x40')],_0x29db70[_0xce62('0x42')]);_0x249ea0['attributes']=_[_0xce62('0x55')](_0x29db70[_0xce62('0x40')],qs[_0xce62('0x45')](_0xcbb567['query'][_0xce62('0x45')]));_0x249ea0['attributes']=_0x249ea0['attributes'][_0xce62('0x46')]?_0x249ea0[_0xce62('0x44')]:_0x29db70[_0xce62('0x40')];_0x249ea0['order']=qs['sort'](_0xcbb567[_0xce62('0x42')][_0xce62('0x48')]);_0x249ea0[_0xce62('0x49')]=qs[_0xce62('0x43')](_[_0xce62('0x64')](_0xcbb567[_0xce62('0x42')],_0x29db70[_0xce62('0x43')]));if(_0xcbb567[_0xce62('0x42')][_0xce62('0x4a')]){_0x249ea0[_0xce62('0x49')]=_[_0xce62('0x4b')](_0x249ea0[_0xce62('0x49')],{'$or':_['map'](_0x249ea0[_0xce62('0x44')],function(_0x12dc48){var _0x5b70d6={};_0x5b70d6[_0x12dc48]={'$like':'%'+_0xcbb567[_0xce62('0x42')]['filter']+'%'};return _0x5b70d6;})});}_0x249ea0=_['merge']({},_0x249ea0,_0xcbb567[_0xce62('0x4e')]);return _0x15d374[_0xce62('0x6d')](_0x249ea0);}})['then'](function(_0x4267eb){if(_0x4267eb){_0x360b3d=_0x4267eb[_0xce62('0x46')];if(!_0xcbb567['query'][_0xce62('0x70')](_0xce62('0x63'))){_0x249ea0[_0xce62('0x2f')]=qs[_0xce62('0x2f')](_0xcbb567[_0xce62('0x42')]['limit']);_0x249ea0[_0xce62('0x2c')]=qs[_0xce62('0x2c')](_0xcbb567[_0xce62('0x42')][_0xce62('0x2c')]);}return _0x15d374[_0xce62('0x6d')](_0x249ea0);}})['then'](function(_0x5a0d39){if(_0x5a0d39){return _0x5a0d39?{'count':_0x360b3d,'rows':_0x5a0d39}:null;}})[_0xce62('0x36')](respondWithResult(_0x5c6fec,null))[_0xce62('0x27')](handleError(_0x5c6fec,null));};exports[_0xce62('0x71')]=function(_0x558ed6,_0x44b470,_0x2ad830){var _0xd0f9db=_0x558ed6[_0xce62('0x58')]['ids'];return db[_0xce62('0x6f')][_0xce62('0x50')]({'where':{'id':_0xd0f9db},'attributes':['id'],'include':[{'model':db[_0xce62('0x72')],'as':'Agents','attributes':['id',_0xce62('0x3a'),_0xce62('0x73'),'voicePause','interface'],'raw':!![]}]})[_0xce62('0x36')](function(_0x5e3393){if(_0x5e3393){var _0x3f0759=_[_0xce62('0x74')](_0x5e3393,function(_0xa3a25d){var _0x51c77e=_0xa3a25d[_0xce62('0x59')]({'plain':!![]});return _0x51c77e[_0xce62('0x75')];});return db[_0xce62('0x3d')][_0xce62('0x56')]({'where':{'id':_0x558ed6['params']['id']}})[_0xce62('0x36')](function(_0x36fcca){return db['sequelize'][_0xce62('0x76')](function(_0x2b8d49){return _0x36fcca[_0xce62('0x71')](_0xd0f9db,{'transaction':_0x2b8d49})[_0xce62('0x36')](function(){return BPromise[_0xce62('0x77')](_0x3f0759,function(_0x256679){return db[_0xce62('0x62')][_0xce62('0x78')]({'where':{'UserId':_0x256679['id'],'ChatQueueId':_0x558ed6[_0xce62('0x53')]['id']},'transaction':_0x2b8d49});});})[_0xce62('0x36')](function(){_0x3f0759[_0xce62('0x79')](function(_0x224c04){socket['emit']('userChatQueue:save',{'UserId':_0x224c04['id'],'ChatQueueId':_0x36fcca['id']});});});});});}})[_0xce62('0x36')](respondWithStatusCode(_0x44b470,null))[_0xce62('0x27')](handleError(_0x44b470,null));};exports[_0xce62('0x7a')]=function(_0xde599,_0x397fa5,_0x251637){return db[_0xce62('0x6f')][_0xce62('0x50')]({'where':{'id':_0xde599['query'][_0xce62('0x7b')]},'attributes':['id'],'include':[{'model':db[_0xce62('0x72')],'as':_0xce62('0x75'),'attributes':['id'],'raw':!![]}]})[_0xce62('0x36')](handleEntityNotFound(_0x397fa5,null))[_0xce62('0x36')](function(_0xee9fd8){var _0x5d116f=_['map'](_0xee9fd8,'id');var _0x57b584=[];var _0x2891e9=[];var _0xb6a306=squel['select']();_0xb6a306[_0xce62('0x7c')](_0xce62('0x7d'))[_0xce62('0x7e')]('team_has_chat_queues','tq')[_0xce62('0x7f')]('user_has_teams','ut',_0xce62('0x80'))[_0xce62('0x49')](_0xce62('0x81'),_0xde599[_0xce62('0x53')]['id']);for(var _0x256690=0x0;_0x256690<_0xee9fd8[_0xce62('0x46')];_0x256690+=0x1){let _0x46e05e=_0xee9fd8[_0x256690];for(var _0xfd635d=0x0;_0xfd635d<_0x46e05e[_0xce62('0x75')][_0xce62('0x46')];_0xfd635d+=0x1){let _0x2c5394=_0x46e05e['Agents'][_0xfd635d];var _0x25dc8e=_0xb6a306[_0xce62('0x82')]();_0x25dc8e[_0xce62('0x49')](_0xce62('0x83'),_0x2c5394['id']);_0x2891e9[_0xce62('0x84')](db['sequelize'][_0xce62('0x42')](_0x25dc8e['toString'](),{'type':db['sequelize'][_0xce62('0x85')][_0xce62('0x86')]})[_0xce62('0x36')](function(_0xce6cc0){if(_0xce6cc0[_0xce62('0x46')]===0x1){return _0x2c5394['id'];}else{var _0x19beac=_[_0xce62('0x87')](_['map'](_0xce6cc0,_0xce62('0x88')),function(_0x42f35d){return _['includes'](_0x5d116f,_0x42f35d);});if(_0x19beac){return _0x2c5394['id'];}}}));}}return BPromise[_0xce62('0x89')](_0x2891e9)[_0xce62('0x36')](function(_0x14315a){_0x57b584=_(_0x57b584)[_0xce62('0x8a')](_0x14315a)[_0xce62('0x8b')]()[_0xce62('0x8c')]();return db[_0xce62('0x3d')][_0xce62('0x56')]({'where':{'id':_0xde599[_0xce62('0x53')]['id']}})[_0xce62('0x36')](function(_0x38ee31){return db['sequelize'][_0xce62('0x76')](function(_0x1296ea){return _0x38ee31[_0xce62('0x7a')](_0xde599[_0xce62('0x42')][_0xce62('0x7b')],{'transaction':_0x1296ea})[_0xce62('0x36')](function(){if(!_['isEmpty'](_0x57b584)){return _0x38ee31[_0xce62('0x8d')](_0x57b584,{'transaction':_0x1296ea});}})[_0xce62('0x36')](function(){_0x57b584[_0xce62('0x79')](function(_0x47070f){socket[_0xce62('0x8e')](_0xce62('0x8f'),{'UserId':_0x47070f,'ChatQueueId':_0x38ee31['id']});});});});});});})[_0xce62('0x36')](respondWithStatusCode(_0x397fa5,null))[_0xce62('0x27')](handleError(_0x397fa5,null));};exports[_0xce62('0x90')]=function(_0x387f85,_0x51bf56,_0x2f3c1e){return db[_0xce62('0x3d')][_0xce62('0x56')]({'where':{'id':_0x387f85[_0xce62('0x53')]['id']}})[_0xce62('0x36')](handleEntityNotFound(_0x51bf56,null))[_0xce62('0x36')](function(_0x223b54){if(_0x223b54){return _0x223b54[_0xce62('0x90')](_0x387f85[_0xce62('0x58')][_0xce62('0x7b')],_[_0xce62('0x91')](_0x387f85[_0xce62('0x58')],[_0xce62('0x7b'),'id'])||{})['spread'](function(_0x31b61d){for(var _0x2904c3=0x0;_0x2904c3<_0x387f85['body'][_0xce62('0x7b')]['length'];_0x2904c3+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x387f85['body'][_0xce62('0x7b')][_0x2904c3]),'ChatQueueId':Number(_0x387f85['params']['id'])});}return _0x31b61d;});}})[_0xce62('0x36')](respondWithResult(_0x51bf56,null))[_0xce62('0x27')](handleError(_0x51bf56,null));};exports[_0xce62('0x8d')]=function(_0x4a2952,_0x5949b1,_0x1881d1){return db[_0xce62('0x3d')]['find']({'where':{'id':_0x4a2952[_0xce62('0x53')]['id']}})[_0xce62('0x36')](handleEntityNotFound(_0x5949b1,null))[_0xce62('0x36')](function(_0x3e5e6a){if(_0x3e5e6a){return _0x3e5e6a['removeAgents'](_0x4a2952[_0xce62('0x42')]['ids'])['then'](function(){if(_[_0xce62('0x92')](_0x4a2952[_0xce62('0x42')][_0xce62('0x7b')])){for(var _0x58abaa=0x0;_0x58abaa<_0x4a2952[_0xce62('0x42')][_0xce62('0x7b')][_0xce62('0x46')];_0x58abaa+=0x1){socket['emit'](_0xce62('0x8f'),{'UserId':Number(_0x4a2952['query']['ids'][_0x58abaa]),'ChatQueueId':Number(_0x4a2952[_0xce62('0x53')]['id'])});}}else{socket[_0xce62('0x8e')](_0xce62('0x8f'),{'UserId':Number(_0x4a2952['query'][_0xce62('0x7b')]),'ChatQueueId':Number(_0x4a2952['params']['id'])});}});}})[_0xce62('0x36')](respondWithStatusCode(_0x5949b1,null))[_0xce62('0x27')](handleError(_0x5949b1,null));};exports[_0xce62('0x93')]=function(_0x5b195e,_0x4f1c59,_0x1c6501){var _0x52e72e={};var _0x2c38ee={};var _0x3b8460;var _0x133d20;return db[_0xce62('0x3d')][_0xce62('0x6e')]({'where':{'id':_0x5b195e[_0xce62('0x53')]['id']}})[_0xce62('0x36')](handleEntityNotFound(_0x4f1c59,null))[_0xce62('0x36')](function(_0x2eee3d){if(_0x2eee3d){_0x3b8460=_0x2eee3d;_0x2c38ee[_0xce62('0x40')]=_['keys'](db[_0xce62('0x72')][_0xce62('0x54')]);_0x2c38ee[_0xce62('0x42')]=_[_0xce62('0x41')](_0x5b195e[_0xce62('0x42')]);_0x2c38ee[_0xce62('0x43')]=_[_0xce62('0x55')](_0x2c38ee[_0xce62('0x40')],_0x2c38ee[_0xce62('0x42')]);_0x52e72e[_0xce62('0x44')]=_[_0xce62('0x55')](_0x2c38ee[_0xce62('0x40')],qs[_0xce62('0x45')](_0x5b195e['query'][_0xce62('0x45')]));_0x52e72e[_0xce62('0x44')]=_0x52e72e[_0xce62('0x44')][_0xce62('0x46')]?_0x52e72e['attributes']:_0x2c38ee[_0xce62('0x40')];_0x52e72e['order']=qs[_0xce62('0x48')](_0x5b195e[_0xce62('0x42')][_0xce62('0x48')]);_0x52e72e['where']=qs[_0xce62('0x43')](_[_0xce62('0x64')](_0x5b195e[_0xce62('0x42')],_0x2c38ee[_0xce62('0x43')]));if(_0x5b195e[_0xce62('0x42')][_0xce62('0x4a')]){_0x52e72e['where']=_[_0xce62('0x4b')](_0x52e72e['where'],{'$or':_[_0xce62('0x4c')](_0x52e72e[_0xce62('0x44')],function(_0x5bf00e){var _0x457a8a={};_0x457a8a[_0x5bf00e]={'$like':'%'+_0x5b195e['query'][_0xce62('0x4a')]+'%'};return _0x457a8a;})});}_0x52e72e=_[_0xce62('0x4b')]({},_0x52e72e,_0x5b195e[_0xce62('0x4e')]);return _0x3b8460[_0xce62('0x93')](_0x52e72e);}})[_0xce62('0x36')](function(_0x2094cd){if(_0x2094cd){_0x133d20=_0x2094cd[_0xce62('0x46')];if(!_0x5b195e[_0xce62('0x42')][_0xce62('0x70')]('nolimit')){_0x52e72e[_0xce62('0x2f')]=qs[_0xce62('0x2f')](_0x5b195e['query'][_0xce62('0x2f')]);_0x52e72e[_0xce62('0x2c')]=qs[_0xce62('0x2c')](_0x5b195e['query']['offset']);}return _0x3b8460[_0xce62('0x93')](_0x52e72e);}})[_0xce62('0x36')](function(_0x192ebc){if(_0x192ebc){return _0x192ebc?{'count':_0x133d20,'rows':_0x192ebc}:null;}})['then'](respondWithResult(_0x4f1c59,null))['catch'](handleError(_0x4f1c59,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 02198e2..043384a 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 _0x0f4a=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit'];(function(_0x454c12,_0x45c282){var _0x7bb4dc=function(_0x585c87){while(--_0x585c87){_0x454c12['push'](_0x454c12['shift']());}};_0x7bb4dc(++_0x45c282);}(_0x0f4a,0x185));var _0xa0f4=function(_0x3c33a8,_0x211e5d){_0x3c33a8=_0x3c33a8-0x0;var _0x155ba4=_0x0f4a[_0x3c33a8];return _0x155ba4;};'use strict';var EventEmitter=require(_0xa0f4('0x0'));var ChatQueue=require(_0xa0f4('0x1'))['db'][_0xa0f4('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa0f4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa0f4('0x4'),'afterDestroy':_0xa0f4('0x5')};function emitEvent(_0x36cfe8){return function(_0x12172a,_0x50ecc5,_0x4ecad8){ChatQueueEvents['emit'](_0x36cfe8+':'+_0x12172a['id'],_0x12172a);ChatQueueEvents[_0xa0f4('0x6')](_0x36cfe8,_0x12172a);_0x4ecad8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xa0f4('0x7')](e,emitEvent(event));}}module[_0xa0f4('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xc9c7=['remove','emit','hasOwnProperty','hook','exports','events','ChatQueue','setMaxListeners','save','update'];(function(_0x3ddf77,_0x2265ee){var _0x50d793=function(_0xf8e624){while(--_0xf8e624){_0x3ddf77['push'](_0x3ddf77['shift']());}};_0x50d793(++_0x2265ee);}(_0xc9c7,0x16d));var _0x7c9c=function(_0xa89a90,_0x1cd505){_0xa89a90=_0xa89a90-0x0;var _0x23f66f=_0xc9c7[_0xa89a90];return _0x23f66f;};'use strict';var EventEmitter=require(_0x7c9c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x7c9c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7c9c('0x2')](0x0);var events={'afterCreate':_0x7c9c('0x3'),'afterUpdate':_0x7c9c('0x4'),'afterDestroy':_0x7c9c('0x5')};function emitEvent(_0x3904f1){return function(_0x297b67,_0x5c69b1,_0x165bef){ChatQueueEvents['emit'](_0x3904f1+':'+_0x297b67['id'],_0x297b67);ChatQueueEvents[_0x7c9c('0x6')](_0x3904f1,_0x297b67);_0x165bef(null);};}for(var e in events){if(events[_0x7c9c('0x7')](e)){var event=events[e];ChatQueue[_0x7c9c('0x8')](e,emitEvent(event));}}module[_0x7c9c('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 6a4fb34..8750a5e 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 _0x2fb0=['./chatQueue.attributes','exports','define','chat_queues','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0x2fb0,0x93));var _0x02fb=function(_0x30ae7b,_0x3a718f){_0x30ae7b=_0x30ae7b-0x0;var _0xa9d0cf=_0x2fb0[_0x30ae7b];return _0xa9d0cf;};'use strict';var _=require(_0x02fb('0x0'));var util=require(_0x02fb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x02fb('0x2'));var BPromise=require(_0x02fb('0x3'));var rp=require(_0x02fb('0x4'));var fs=require('fs');var path=require(_0x02fb('0x5'));var rimraf=require(_0x02fb('0x6'));var config=require('../../config/environment');var attributes=require(_0x02fb('0x7'));module[_0x02fb('0x8')]=function(_0x2f3e96,_0x3cc74d){return _0x2f3e96[_0x02fb('0x9')]('ChatQueue',attributes,{'tableName':_0x02fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x819c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash'];(function(_0x31a9d1,_0x283ae9){var _0x127d8e=function(_0x5b7079){while(--_0x5b7079){_0x31a9d1['push'](_0x31a9d1['shift']());}};_0x127d8e(++_0x283ae9);}(_0x819c,0x1a3));var _0xc819=function(_0x503a3a,_0x3693f9){_0x503a3a=_0x503a3a-0x0;var _0x2bff4d=_0x819c[_0x503a3a];return _0x2bff4d;};'use strict';var _=require(_0xc819('0x0'));var util=require('util');var logger=require(_0xc819('0x1'))(_0xc819('0x2'));var moment=require(_0xc819('0x3'));var BPromise=require(_0xc819('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc819('0x5'));var rimraf=require(_0xc819('0x6'));var config=require(_0xc819('0x7'));var attributes=require(_0xc819('0x8'));module[_0xc819('0x9')]=function(_0x4b99cb,_0x305cf6){return _0x4b99cb['define'](_0xc819('0xa'),attributes,{'tableName':_0xc819('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index ae66d06..31dba38 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 _0x04d5=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetChatQueue','findAll','options','raw','attributes','include','map','ShowChatQueue','ChatQueue','find','where','model','lodash','util','bluebird'];(function(_0x512aa7,_0x2be0d9){var _0x952539=function(_0x2d63d4){while(--_0x2d63d4){_0x512aa7['push'](_0x512aa7['shift']());}};_0x952539(++_0x2be0d9);}(_0x04d5,0xe1));var _0x504d=function(_0x32bc71,_0x485e3e){_0x32bc71=_0x32bc71-0x0;var _0x49141c=_0x04d5[_0x32bc71];return _0x49141c;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var moment=require('moment');var BPromise=require(_0x504d('0x2'));var rs=require(_0x504d('0x3'));var fs=require('fs');var Redis=require(_0x504d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x504d('0x5'));var logger=require(_0x504d('0x6'))(_0x504d('0x7'));var config=require(_0x504d('0x8'));var jayson=require(_0x504d('0x9'));var client=jayson['client'][_0x504d('0xa')]({'port':0x232a});config[_0x504d('0xb')]=_[_0x504d('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x504d('0xd'))(new Redis(config[_0x504d('0xb')]));require(_0x504d('0xe'))['register'](socket);function respondWithRpcPromise(_0x155164,_0x3f0070,_0x10a7bd){return new BPromise(function(_0x378754,_0x49eb92){return client[_0x504d('0xf')](_0x155164,_0x10a7bd)[_0x504d('0x10')](function(_0x39a87e){logger[_0x504d('0x11')](_0x504d('0x12'),_0x3f0070,_0x504d('0x13'));logger[_0x504d('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3f0070,'request\x20sent',JSON[_0x504d('0x15')](_0x39a87e));if(_0x39a87e[_0x504d('0x16')]){if(_0x39a87e[_0x504d('0x16')][_0x504d('0x17')]===0x1f4){logger[_0x504d('0x16')](_0x504d('0x12'),_0x3f0070,_0x39a87e['error'][_0x504d('0x18')]);return _0x49eb92(_0x39a87e['error'][_0x504d('0x18')]);}logger[_0x504d('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3f0070,_0x39a87e[_0x504d('0x16')][_0x504d('0x18')]);return _0x378754(_0x39a87e[_0x504d('0x16')][_0x504d('0x18')]);}else{logger[_0x504d('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3f0070,_0x504d('0x13'));_0x378754(_0x39a87e['result'][_0x504d('0x18')]);}})[_0x504d('0x19')](function(_0x11c9b1){logger['error'](_0x504d('0x12'),_0x3f0070,_0x11c9b1);_0x49eb92(_0x11c9b1);});});}exports[_0x504d('0x1a')]=function(_0x19effc){var _0x35170c=this;return new Promise(function(_0x41771e,_0x5c5374){return db['ChatQueue'][_0x504d('0x1b')]({'raw':_0x19effc['options']?_0x19effc[_0x504d('0x1c')][_0x504d('0x1d')]===undefined?!![]:![]:!![],'where':_0x19effc['options']?_0x19effc[_0x504d('0x1c')]['where']||null:null,'attributes':_0x19effc[_0x504d('0x1c')]?_0x19effc[_0x504d('0x1c')][_0x504d('0x1e')]||null:null,'limit':_0x19effc['options']?_0x19effc[_0x504d('0x1c')]['limit']||null:null,'include':_0x19effc['options']?_0x19effc[_0x504d('0x1c')][_0x504d('0x1f')]?_['map'](_0x19effc['options'][_0x504d('0x1f')],function(_0x251284){return{'model':db[_0x251284['model']],'as':_0x251284['as'],'attributes':_0x251284[_0x504d('0x1e')],'include':_0x251284[_0x504d('0x1f')]?_[_0x504d('0x20')](_0x251284[_0x504d('0x1f')],function(_0x358742){return{'model':db[_0x358742['model']],'as':_0x358742['as'],'attributes':_0x358742[_0x504d('0x1e')],'include':_0x358742[_0x504d('0x1f')]?_[_0x504d('0x20')](_0x358742[_0x504d('0x1f')],function(_0x4a43c7){return{'model':db[_0x4a43c7['model']],'as':_0x4a43c7['as'],'attributes':_0x4a43c7[_0x504d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa4751b){logger['info'](_0x504d('0x1a'),_0x19effc);logger[_0x504d('0x14')](_0x504d('0x1a'),_0x19effc,JSON['stringify'](_0xa4751b));_0x41771e(_0xa4751b);})[_0x504d('0x19')](function(_0x4b0575){logger['error'](_0x504d('0x1a'),_0x4b0575[_0x504d('0x18')],_0x19effc);_0x5c5374(_0x35170c[_0x504d('0x16')](0x1f4,_0x4b0575['message']));});});};exports[_0x504d('0x21')]=function(_0x282976){var _0x56fd2e=this;return new Promise(function(_0x5ea0b7,_0x7ecf47){return db[_0x504d('0x22')][_0x504d('0x23')]({'raw':_0x282976['options']?_0x282976[_0x504d('0x1c')][_0x504d('0x1d')]===undefined?!![]:![]:!![],'where':_0x282976[_0x504d('0x1c')]?_0x282976[_0x504d('0x1c')][_0x504d('0x24')]||null:null,'attributes':_0x282976[_0x504d('0x1c')]?_0x282976[_0x504d('0x1c')][_0x504d('0x1e')]||null:null,'include':_0x282976[_0x504d('0x1c')]?_0x282976['options']['include']?_[_0x504d('0x20')](_0x282976['options'][_0x504d('0x1f')],function(_0x3c881e){return{'model':db[_0x3c881e[_0x504d('0x25')]],'as':_0x3c881e['as'],'attributes':_0x3c881e[_0x504d('0x1e')],'include':_0x3c881e[_0x504d('0x1f')]?_[_0x504d('0x20')](_0x3c881e[_0x504d('0x1f')],function(_0x1f41a1){return{'model':db[_0x1f41a1[_0x504d('0x25')]],'as':_0x1f41a1['as'],'attributes':_0x1f41a1[_0x504d('0x1e')],'include':_0x1f41a1[_0x504d('0x1f')]?_['map'](_0x1f41a1[_0x504d('0x1f')],function(_0x55fbdb){return{'model':db[_0x55fbdb['model']],'as':_0x55fbdb['as'],'attributes':_0x55fbdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x504d('0x10')](function(_0x1e3ee3){logger['info'](_0x504d('0x21'),_0x282976);logger['debug'](_0x504d('0x21'),_0x282976,JSON[_0x504d('0x15')](_0x1e3ee3));_0x5ea0b7(_0x1e3ee3);})['catch'](function(_0x48c3b1){logger[_0x504d('0x16')](_0x504d('0x21'),_0x48c3b1['message'],_0x282976);_0x7ecf47(_0x56fd2e['error'](0x1f4,_0x48c3b1[_0x504d('0x18')]));});});}; \ No newline at end of file +var _0xdc64=['find','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetChatQueue','ChatQueue','findAll','raw','where','options','attributes','limit','include','map','model','catch','ShowChatQueue'];(function(_0x57d997,_0x367ce4){var _0x2cb473=function(_0x5ed65f){while(--_0x5ed65f){_0x57d997['push'](_0x57d997['shift']());}};_0x2cb473(++_0x367ce4);}(_0xdc64,0x80));var _0x4dc6=function(_0xe5aed6,_0x94143c){_0xe5aed6=_0xe5aed6-0x0;var _0x2caaed=_0xdc64[_0xe5aed6];return _0x2caaed;};'use strict';var _=require(_0x4dc6('0x0'));var util=require(_0x4dc6('0x1'));var moment=require(_0x4dc6('0x2'));var BPromise=require(_0x4dc6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4dc6('0x4'));var db=require(_0x4dc6('0x5'))['db'];var utils=require(_0x4dc6('0x6'));var logger=require(_0x4dc6('0x7'))(_0x4dc6('0x8'));var config=require(_0x4dc6('0x9'));var jayson=require(_0x4dc6('0xa'));var client=jayson[_0x4dc6('0xb')][_0x4dc6('0xc')]({'port':0x232a});config[_0x4dc6('0xd')]=_[_0x4dc6('0xe')](config[_0x4dc6('0xd')],{'host':_0x4dc6('0xf'),'port':0x18eb});var socket=require(_0x4dc6('0x10'))(new Redis(config[_0x4dc6('0xd')]));require('./chatQueue.socket')[_0x4dc6('0x11')](socket);function respondWithRpcPromise(_0xc0ffc4,_0x21f383,_0x595a00){return new BPromise(function(_0xd6a6f8,_0x10c881){return client['request'](_0xc0ffc4,_0x595a00)[_0x4dc6('0x12')](function(_0x9e19b9){logger['info'](_0x4dc6('0x13'),_0x21f383,_0x4dc6('0x14'));logger['debug'](_0x4dc6('0x15'),_0x21f383,'request\x20sent',JSON[_0x4dc6('0x16')](_0x9e19b9));if(_0x9e19b9[_0x4dc6('0x17')]){if(_0x9e19b9[_0x4dc6('0x17')]['code']===0x1f4){logger[_0x4dc6('0x17')](_0x4dc6('0x13'),_0x21f383,_0x9e19b9[_0x4dc6('0x17')][_0x4dc6('0x18')]);return _0x10c881(_0x9e19b9[_0x4dc6('0x17')]['message']);}logger['error'](_0x4dc6('0x13'),_0x21f383,_0x9e19b9[_0x4dc6('0x17')][_0x4dc6('0x18')]);return _0xd6a6f8(_0x9e19b9[_0x4dc6('0x17')][_0x4dc6('0x18')]);}else{logger[_0x4dc6('0x19')](_0x4dc6('0x13'),_0x21f383,_0x4dc6('0x14'));_0xd6a6f8(_0x9e19b9[_0x4dc6('0x1a')][_0x4dc6('0x18')]);}})['catch'](function(_0x3c0012){logger[_0x4dc6('0x17')]('ChatQueue,\x20%s,\x20%s',_0x21f383,_0x3c0012);_0x10c881(_0x3c0012);});});}exports[_0x4dc6('0x1b')]=function(_0xa5b9b4){var _0x4a69dc=this;return new Promise(function(_0x592a0a,_0x5c1244){return db[_0x4dc6('0x1c')][_0x4dc6('0x1d')]({'raw':_0xa5b9b4['options']?_0xa5b9b4['options'][_0x4dc6('0x1e')]===undefined?!![]:![]:!![],'where':_0xa5b9b4['options']?_0xa5b9b4['options'][_0x4dc6('0x1f')]||null:null,'attributes':_0xa5b9b4[_0x4dc6('0x20')]?_0xa5b9b4[_0x4dc6('0x20')][_0x4dc6('0x21')]||null:null,'limit':_0xa5b9b4[_0x4dc6('0x20')]?_0xa5b9b4['options'][_0x4dc6('0x22')]||null:null,'include':_0xa5b9b4[_0x4dc6('0x20')]?_0xa5b9b4[_0x4dc6('0x20')][_0x4dc6('0x23')]?_[_0x4dc6('0x24')](_0xa5b9b4[_0x4dc6('0x20')][_0x4dc6('0x23')],function(_0x210e4e){return{'model':db[_0x210e4e['model']],'as':_0x210e4e['as'],'attributes':_0x210e4e[_0x4dc6('0x21')],'include':_0x210e4e[_0x4dc6('0x23')]?_[_0x4dc6('0x24')](_0x210e4e[_0x4dc6('0x23')],function(_0x5efbae){return{'model':db[_0x5efbae[_0x4dc6('0x25')]],'as':_0x5efbae['as'],'attributes':_0x5efbae[_0x4dc6('0x21')],'include':_0x5efbae[_0x4dc6('0x23')]?_['map'](_0x5efbae[_0x4dc6('0x23')],function(_0x440f1f){return{'model':db[_0x440f1f['model']],'as':_0x440f1f['as'],'attributes':_0x440f1f[_0x4dc6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4dc6('0x12')](function(_0x8c4901){logger[_0x4dc6('0x19')](_0x4dc6('0x1b'),_0xa5b9b4);logger['debug'](_0x4dc6('0x1b'),_0xa5b9b4,JSON['stringify'](_0x8c4901));_0x592a0a(_0x8c4901);})[_0x4dc6('0x26')](function(_0x14af5c){logger[_0x4dc6('0x17')](_0x4dc6('0x1b'),_0x14af5c[_0x4dc6('0x18')],_0xa5b9b4);_0x5c1244(_0x4a69dc['error'](0x1f4,_0x14af5c['message']));});});};exports[_0x4dc6('0x27')]=function(_0x1b3b2e){var _0x2f920c=this;return new Promise(function(_0x568264,_0x18693a){return db[_0x4dc6('0x1c')][_0x4dc6('0x28')]({'raw':_0x1b3b2e['options']?_0x1b3b2e[_0x4dc6('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x1b3b2e[_0x4dc6('0x20')]?_0x1b3b2e['options'][_0x4dc6('0x1f')]||null:null,'attributes':_0x1b3b2e[_0x4dc6('0x20')]?_0x1b3b2e[_0x4dc6('0x20')][_0x4dc6('0x21')]||null:null,'include':_0x1b3b2e['options']?_0x1b3b2e[_0x4dc6('0x20')][_0x4dc6('0x23')]?_[_0x4dc6('0x24')](_0x1b3b2e['options']['include'],function(_0x1ebfb9){return{'model':db[_0x1ebfb9[_0x4dc6('0x25')]],'as':_0x1ebfb9['as'],'attributes':_0x1ebfb9['attributes'],'include':_0x1ebfb9[_0x4dc6('0x23')]?_[_0x4dc6('0x24')](_0x1ebfb9[_0x4dc6('0x23')],function(_0x352863){return{'model':db[_0x352863[_0x4dc6('0x25')]],'as':_0x352863['as'],'attributes':_0x352863[_0x4dc6('0x21')],'include':_0x352863['include']?_[_0x4dc6('0x24')](_0x352863[_0x4dc6('0x23')],function(_0x2f56b5){return{'model':db[_0x2f56b5[_0x4dc6('0x25')]],'as':_0x2f56b5['as'],'attributes':_0x2f56b5[_0x4dc6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4dc6('0x12')](function(_0x2de75b){logger[_0x4dc6('0x19')](_0x4dc6('0x27'),_0x1b3b2e);logger[_0x4dc6('0x29')](_0x4dc6('0x27'),_0x1b3b2e,JSON[_0x4dc6('0x16')](_0x2de75b));_0x568264(_0x2de75b);})[_0x4dc6('0x26')](function(_0x53d5e1){logger[_0x4dc6('0x17')](_0x4dc6('0x27'),_0x53d5e1[_0x4dc6('0x18')],_0x1b3b2e);_0x18693a(_0x2f920c[_0x4dc6('0x17')](0x1f4,_0x53d5e1['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 5e6da75..1edd8b1 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 _0xc368=['removeListener','register','length','chatQueue:','save','update','emit'];(function(_0x170941,_0x38d105){var _0x50e48d=function(_0x1eb49a){while(--_0x1eb49a){_0x170941['push'](_0x170941['shift']());}};_0x50e48d(++_0x38d105);}(_0xc368,0x7b));var _0x8c36=function(_0x432350,_0x5dcfc0){_0x432350=_0x432350-0x0;var _0x2f5769=_0xc368[_0x432350];return _0x2f5769;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8c36('0x0'),'remove',_0x8c36('0x1')];function createListener(_0x17fa33,_0x20e697){return function(_0x2640c5){_0x20e697[_0x8c36('0x2')](_0x17fa33,_0x2640c5);};}function removeListener(_0x5d3b27,_0x3e9034){return function(){ChatQueueEvents[_0x8c36('0x3')](_0x5d3b27,_0x3e9034);};}exports[_0x8c36('0x4')]=function(_0x1d3660){for(var _0x5ebfc1=0x0,_0x554022=events[_0x8c36('0x5')];_0x5ebfc1<_0x554022;_0x5ebfc1++){var _0x384867=events[_0x5ebfc1];var _0x3e76be=createListener(_0x8c36('0x6')+_0x384867,_0x1d3660);ChatQueueEvents['on'](_0x384867,_0x3e76be);}}; \ No newline at end of file +var _0xfd28=['emit','removeListener','register','chatQueue:','save','remove'];(function(_0x397718,_0xc6a56c){var _0x56daf1=function(_0x34fe96){while(--_0x34fe96){_0x397718['push'](_0x397718['shift']());}};_0x56daf1(++_0xc6a56c);}(_0xfd28,0x148));var _0x8fd2=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xfd28[_0x2a5099];return _0x2802f1;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8fd2('0x0'),_0x8fd2('0x1'),'update'];function createListener(_0x56f4d0,_0x4e5c5e){return function(_0x37baf5){_0x4e5c5e[_0x8fd2('0x2')](_0x56f4d0,_0x37baf5);};}function removeListener(_0x4e2108,_0x4b22ae){return function(){ChatQueueEvents[_0x8fd2('0x3')](_0x4e2108,_0x4b22ae);};}exports[_0x8fd2('0x4')]=function(_0x2ee87e){for(var _0x36178a=0x0,_0x2f0afc=events['length'];_0x36178a<_0x2f0afc;_0x36178a++){var _0x53d938=events[_0x36178a];var _0x10fccf=createListener(_0x8fd2('0x5')+_0x53d938,_0x2ee87e);ChatQueueEvents['on'](_0x53d938,_0x10fccf);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index c4a37ce..5cc7b5c 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4c4220,_0x5e8b5d){var _0x244cab=function(_0x3abee8){while(--_0x3abee8){_0x4c4220['push'](_0x4c4220['shift']());}};_0x244cab(++_0x5e8b5d);}(_0x55ca,0x126));var _0xa55c=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x55ca[_0x2d8d69];return _0x39ae22;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3697c3,_0x1054f5){var _0x343cd1=function(_0x1b1797){while(--_0x1b1797){_0x3697c3['push'](_0x3697c3['shift']());}};_0x343cd1(++_0x1054f5);}(_0xe14b,0x93));var _0xbe14=function(_0x2f519f,_0x2118b2){_0x2f519f=_0x2f519f-0x0;var _0x49bb2a=_0xe14b[_0x2f519f];return _0x49bb2a;};'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 f0c8faa..9dc22a6 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 _0x7709=['sequelize','exports','STRING','DATE'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x7709,0x190));var _0x9770=function(_0x155638,_0x5ccf77){_0x155638=_0x155638-0x0;var _0xe19618=_0x7709[_0x155638];return _0xe19618;};'use strict';var moment=require('moment');var Sequelize=require(_0x9770('0x0'));module[_0x9770('0x1')]={'uniqueid':{'type':Sequelize[_0x9770('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9770('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9770('0x3')]},'exitAt':{'type':Sequelize[_0x9770('0x3')]},'reason':{'type':Sequelize[_0x9770('0x2')]}}; \ No newline at end of file +var _0x5489=['DATE','moment','sequelize','exports','STRING'];(function(_0x2028a4,_0x13efab){var _0x470bd7=function(_0x26123c){while(--_0x26123c){_0x2028a4['push'](_0x2028a4['shift']());}};_0x470bd7(++_0x13efab);}(_0x5489,0x10a));var _0x9548=function(_0x1b14e3,_0x1e8a25){_0x1b14e3=_0x1b14e3-0x0;var _0xe4ac40=_0x5489[_0x1b14e3];return _0xe4ac40;};'use strict';var moment=require(_0x9548('0x0'));var Sequelize=require(_0x9548('0x1'));module[_0x9548('0x2')]={'uniqueid':{'type':Sequelize[_0x9548('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9548('0x3')]},'joinAt':{'type':Sequelize[_0x9548('0x4')]},'leaveAt':{'type':Sequelize[_0x9548('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9548('0x4')]},'reason':{'type':Sequelize[_0x9548('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index c93773d..8f0e56b 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 _0xfa94=['filter','merge','rows','show','params','length','includeAll','include','options','find','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../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','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa94,0xef));var _0x4fa9=function(_0x2f92d8,_0x2ef7f4){_0x2f92d8=_0x2f92d8-0x0;var _0x200ef1=_0xfa94[_0x2f92d8];return _0x200ef1;};'use strict';var emlformat=require(_0x4fa9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4fa9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4fa9('0x2'));var moment=require(_0x4fa9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4fa9('0x4'));var util=require(_0x4fa9('0x5'));var path=require(_0x4fa9('0x6'));var sox=require(_0x4fa9('0x7'));var csv=require(_0x4fa9('0x8'));var ejs=require(_0x4fa9('0x9'));var fs=require('fs');var fs_extra=require(_0x4fa9('0xa'));var _=require('lodash');var squel=require(_0x4fa9('0xb'));var crypto=require(_0x4fa9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4fa9('0x8'));var querystring=require('querystring');var Papa=require(_0x4fa9('0xd'));var Redis=require(_0x4fa9('0xe'));var authService=require(_0x4fa9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4fa9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fa9('0x11'))(_0x4fa9('0x12'));var utils=require('../../config/utils');var config=require(_0x4fa9('0x13'));var licenseUtil=require(_0x4fa9('0x14'));var db=require(_0x4fa9('0x15'))['db'];function respondWithStatusCode(_0x57df6a,_0x85f1e5){_0x85f1e5=_0x85f1e5||0xcc;return function(_0x54d8c5){if(_0x54d8c5){return _0x57df6a[_0x4fa9('0x16')](_0x85f1e5);}return _0x57df6a[_0x4fa9('0x17')](_0x85f1e5)['end']();};}function respondWithResult(_0x47953e,_0x4279c0){_0x4279c0=_0x4279c0||0xc8;return function(_0x43b71d){if(_0x43b71d){return _0x47953e[_0x4fa9('0x17')](_0x4279c0)[_0x4fa9('0x18')](_0x43b71d);}};}function respondWithFilteredResult(_0x36af3a,_0x438850){return function(_0x2c28be){if(_0x2c28be){var _0x328770=typeof _0x438850['offset']===_0x4fa9('0x19')&&typeof _0x438850[_0x4fa9('0x1a')]==='undefined';var _0x56cf7d=_0x2c28be[_0x4fa9('0x1b')];var _0x4f58bd=_0x328770?0x0:_0x438850[_0x4fa9('0x1c')];var _0x416e08=_0x328770?_0x2c28be['count']:_0x438850[_0x4fa9('0x1c')]+_0x438850['limit'];var _0x3f8036;if(_0x416e08>=_0x56cf7d){_0x416e08=_0x56cf7d;_0x3f8036=0xc8;}else{_0x3f8036=0xce;}_0x36af3a[_0x4fa9('0x17')](_0x3f8036);return _0x36af3a[_0x4fa9('0x1d')](_0x4fa9('0x1e'),_0x4f58bd+'-'+_0x416e08+'/'+_0x56cf7d)[_0x4fa9('0x18')](_0x2c28be);}return null;};}function patchUpdates(_0x5e2576){return function(_0x2e5142){try{jsonpatch[_0x4fa9('0x1f')](_0x2e5142,_0x5e2576,!![]);}catch(_0xa43250){return BPromise['reject'](_0xa43250);}return _0x2e5142[_0x4fa9('0x20')]();};}function saveUpdates(_0x1544b1,_0x31333c){return function(_0x475624){if(_0x475624){return _0x475624[_0x4fa9('0x21')](_0x1544b1)[_0x4fa9('0x22')](function(_0x360262){return _0x360262;});}return null;};}function removeEntity(_0x261db9,_0x185806){return function(_0x1189c6){if(_0x1189c6){return _0x1189c6[_0x4fa9('0x23')]()[_0x4fa9('0x22')](function(){_0x261db9[_0x4fa9('0x17')](0xcc)[_0x4fa9('0x24')]();});}};}function handleEntityNotFound(_0x1d00c9,_0x244c95){return function(_0x1bac66){if(!_0x1bac66){_0x1d00c9[_0x4fa9('0x16')](0x194);}return _0x1bac66;};}function handleError(_0x1fe8ba,_0x31a3fb){_0x31a3fb=_0x31a3fb||0x1f4;return function(_0x498a6f){logger[_0x4fa9('0x25')](_0x498a6f[_0x4fa9('0x26')]);if(_0x498a6f[_0x4fa9('0x27')]){delete _0x498a6f[_0x4fa9('0x27')];}_0x1fe8ba[_0x4fa9('0x17')](_0x31a3fb)[_0x4fa9('0x28')](_0x498a6f);};}exports[_0x4fa9('0x29')]=function(_0x5545b9,_0x384d4e){var _0x1185df={},_0x13cf76={},_0x383d27={'count':0x0,'rows':[]};var _0x112673=_[_0x4fa9('0x2a')](db[_0x4fa9('0x2b')][_0x4fa9('0x2c')],function(_0xa9932f){return{'name':_0xa9932f[_0x4fa9('0x2d')],'type':_0xa9932f[_0x4fa9('0x2e')][_0x4fa9('0x2f')]};});_0x13cf76[_0x4fa9('0x30')]=_[_0x4fa9('0x2a')](_0x112673,_0x4fa9('0x27'));_0x13cf76[_0x4fa9('0x31')]=_[_0x4fa9('0x32')](_0x5545b9['query']);_0x13cf76[_0x4fa9('0x33')]=_[_0x4fa9('0x34')](_0x13cf76[_0x4fa9('0x30')],_0x13cf76[_0x4fa9('0x31')]);_0x1185df[_0x4fa9('0x35')]=_[_0x4fa9('0x34')](_0x13cf76['model'],qs[_0x4fa9('0x36')](_0x5545b9[_0x4fa9('0x31')][_0x4fa9('0x36')]));_0x1185df['attributes']=_0x1185df[_0x4fa9('0x35')]['length']?_0x1185df['attributes']:_0x13cf76[_0x4fa9('0x30')];if(!_0x5545b9['query'][_0x4fa9('0x37')](_0x4fa9('0x38'))){_0x1185df[_0x4fa9('0x1a')]=qs[_0x4fa9('0x1a')](_0x5545b9['query'][_0x4fa9('0x1a')]);_0x1185df[_0x4fa9('0x1c')]=qs[_0x4fa9('0x1c')](_0x5545b9['query'][_0x4fa9('0x1c')]);}_0x1185df[_0x4fa9('0x39')]=qs[_0x4fa9('0x3a')](_0x5545b9[_0x4fa9('0x31')][_0x4fa9('0x3a')]);_0x1185df[_0x4fa9('0x3b')]=qs[_0x4fa9('0x33')](_[_0x4fa9('0x3c')](_0x5545b9[_0x4fa9('0x31')],_0x13cf76[_0x4fa9('0x33')]),_0x112673);if(_0x5545b9[_0x4fa9('0x31')][_0x4fa9('0x3d')]){_0x1185df['where']=_[_0x4fa9('0x3e')](_0x1185df['where'],{'$or':_['map'](_0x112673,function(_0x21578d){if(_0x21578d['type']!=='VIRTUAL'){var _0x4b05a6={};_0x4b05a6[_0x21578d[_0x4fa9('0x27')]]={'$like':'%'+_0x5545b9[_0x4fa9('0x31')]['filter']+'%'};return _0x4b05a6;}})});}_0x1185df=_[_0x4fa9('0x3e')]({},_0x1185df,_0x5545b9['options']);var _0x493c4f={'where':_0x1185df[_0x4fa9('0x3b')]};return db[_0x4fa9('0x2b')][_0x4fa9('0x1b')](_0x493c4f)[_0x4fa9('0x22')](function(_0x167112){_0x383d27[_0x4fa9('0x1b')]=_0x167112;if(_0x5545b9[_0x4fa9('0x31')]['includeAll']){_0x1185df['include']=[{'all':!![]}];}return db[_0x4fa9('0x2b')]['findAll'](_0x1185df);})[_0x4fa9('0x22')](function(_0x19fe0f){_0x383d27[_0x4fa9('0x3f')]=_0x19fe0f;return _0x383d27;})[_0x4fa9('0x22')](respondWithFilteredResult(_0x384d4e,_0x1185df))['catch'](handleError(_0x384d4e,null));};exports[_0x4fa9('0x40')]=function(_0x51e105,_0xd28126){var _0x2c39bf={'raw':!![],'where':{'id':_0x51e105[_0x4fa9('0x41')]['id']}},_0x14eb12={};_0x14eb12[_0x4fa9('0x30')]=_[_0x4fa9('0x32')](db[_0x4fa9('0x2b')][_0x4fa9('0x2c')]);_0x14eb12['query']=_[_0x4fa9('0x32')](_0x51e105[_0x4fa9('0x31')]);_0x14eb12[_0x4fa9('0x33')]=_['intersection'](_0x14eb12[_0x4fa9('0x30')],_0x14eb12[_0x4fa9('0x31')]);_0x2c39bf[_0x4fa9('0x35')]=_[_0x4fa9('0x34')](_0x14eb12[_0x4fa9('0x30')],qs[_0x4fa9('0x36')](_0x51e105[_0x4fa9('0x31')][_0x4fa9('0x36')]));_0x2c39bf[_0x4fa9('0x35')]=_0x2c39bf[_0x4fa9('0x35')][_0x4fa9('0x42')]?_0x2c39bf[_0x4fa9('0x35')]:_0x14eb12['model'];if(_0x51e105[_0x4fa9('0x31')][_0x4fa9('0x43')]){_0x2c39bf[_0x4fa9('0x44')]=[{'all':!![]}];}_0x2c39bf=_[_0x4fa9('0x3e')]({},_0x2c39bf,_0x51e105[_0x4fa9('0x45')]);return db[_0x4fa9('0x2b')][_0x4fa9('0x46')](_0x2c39bf)[_0x4fa9('0x22')](handleEntityNotFound(_0xd28126,null))[_0x4fa9('0x22')](respondWithResult(_0xd28126,null))[_0x4fa9('0x47')](handleError(_0xd28126,null));};exports[_0x4fa9('0x48')]=function(_0x5d3b12,_0x5d838c){return db[_0x4fa9('0x2b')]['create'](_0x5d3b12[_0x4fa9('0x49')],{})[_0x4fa9('0x22')](respondWithResult(_0x5d838c,0xc9))[_0x4fa9('0x47')](handleError(_0x5d838c,null));};exports[_0x4fa9('0x21')]=function(_0x306096,_0x12e735){if(_0x306096['body']['id']){delete _0x306096['body']['id'];}return db['ChatQueueReport'][_0x4fa9('0x46')]({'where':{'id':_0x306096['params']['id']}})[_0x4fa9('0x22')](handleEntityNotFound(_0x12e735,null))[_0x4fa9('0x22')](saveUpdates(_0x306096[_0x4fa9('0x49')],null))[_0x4fa9('0x22')](respondWithResult(_0x12e735,null))['catch'](handleError(_0x12e735,null));};exports[_0x4fa9('0x23')]=function(_0x463bd4,_0x5cd8d1){return db[_0x4fa9('0x2b')][_0x4fa9('0x46')]({'where':{'id':_0x463bd4[_0x4fa9('0x41')]['id']}})[_0x4fa9('0x22')](handleEntityNotFound(_0x5cd8d1,null))[_0x4fa9('0x22')](removeEntity(_0x5cd8d1,null))[_0x4fa9('0x47')](handleError(_0x5cd8d1,null));};exports['describe']=function(_0x4b8399,_0x23953b){return db['ChatQueueReport'][_0x4fa9('0x4a')]()[_0x4fa9('0x22')](respondWithResult(_0x23953b,null))[_0x4fa9('0x47')](handleError(_0x23953b,null));}; \ No newline at end of file +var _0xf435=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','fields','length','include','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2538ca,_0xb651c1){var _0x5b4cee=function(_0x1ad646){while(--_0x1ad646){_0x2538ca['push'](_0x2538ca['shift']());}};_0x5b4cee(++_0xb651c1);}(_0xf435,0x174));var _0x5f43=function(_0x2a6ce4,_0x4efcee){_0x2a6ce4=_0x2a6ce4-0x0;var _0x1e112d=_0xf435[_0x2a6ce4];return _0x1e112d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f43('0x0'));var zipdir=require(_0x5f43('0x1'));var jsonpatch=require(_0x5f43('0x2'));var rp=require(_0x5f43('0x3'));var moment=require(_0x5f43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5f43('0x5'));var util=require(_0x5f43('0x6'));var path=require(_0x5f43('0x7'));var sox=require(_0x5f43('0x8'));var csv=require('to-csv');var ejs=require(_0x5f43('0x9'));var fs=require('fs');var fs_extra=require(_0x5f43('0xa'));var _=require(_0x5f43('0xb'));var squel=require('squel');var crypto=require(_0x5f43('0xc'));var jsforce=require(_0x5f43('0xd'));var deskjs=require(_0x5f43('0xe'));var toCsv=require(_0x5f43('0xf'));var querystring=require(_0x5f43('0x10'));var Papa=require(_0x5f43('0x11'));var Redis=require(_0x5f43('0x12'));var authService=require(_0x5f43('0x13'));var qs=require(_0x5f43('0x14'));var as=require(_0x5f43('0x15'));var hardwareService=require(_0x5f43('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x5f43('0x17'));var config=require(_0x5f43('0x18'));var licenseUtil=require(_0x5f43('0x19'));var db=require(_0x5f43('0x1a'))['db'];function respondWithStatusCode(_0x397ed3,_0x56618d){_0x56618d=_0x56618d||0xcc;return function(_0x16d337){if(_0x16d337){return _0x397ed3[_0x5f43('0x1b')](_0x56618d);}return _0x397ed3['status'](_0x56618d)[_0x5f43('0x1c')]();};}function respondWithResult(_0x4f2908,_0x3c7342){_0x3c7342=_0x3c7342||0xc8;return function(_0x599852){if(_0x599852){return _0x4f2908[_0x5f43('0x1d')](_0x3c7342)[_0x5f43('0x1e')](_0x599852);}};}function respondWithFilteredResult(_0x45c005,_0x275060){return function(_0x50cb6a){if(_0x50cb6a){var _0x34de1f=typeof _0x275060[_0x5f43('0x1f')]===_0x5f43('0x20')&&typeof _0x275060['limit']===_0x5f43('0x20');var _0x53f8b3=_0x50cb6a[_0x5f43('0x21')];var _0xfdee97=_0x34de1f?0x0:_0x275060[_0x5f43('0x1f')];var _0x2a5c6c=_0x34de1f?_0x50cb6a['count']:_0x275060[_0x5f43('0x1f')]+_0x275060[_0x5f43('0x22')];var _0x53e640;if(_0x2a5c6c>=_0x53f8b3){_0x2a5c6c=_0x53f8b3;_0x53e640=0xc8;}else{_0x53e640=0xce;}_0x45c005[_0x5f43('0x1d')](_0x53e640);return _0x45c005[_0x5f43('0x23')](_0x5f43('0x24'),_0xfdee97+'-'+_0x2a5c6c+'/'+_0x53f8b3)[_0x5f43('0x1e')](_0x50cb6a);}return null;};}function patchUpdates(_0x750a7d){return function(_0x221c6e){try{jsonpatch['apply'](_0x221c6e,_0x750a7d,!![]);}catch(_0x2b3eea){return BPromise['reject'](_0x2b3eea);}return _0x221c6e[_0x5f43('0x25')]();};}function saveUpdates(_0x4a2d3d,_0x49621e){return function(_0x4d7dc7){if(_0x4d7dc7){return _0x4d7dc7[_0x5f43('0x26')](_0x4a2d3d)[_0x5f43('0x27')](function(_0x8ee422){return _0x8ee422;});}return null;};}function removeEntity(_0x1a8fbe,_0x364e61){return function(_0x1e133f){if(_0x1e133f){return _0x1e133f[_0x5f43('0x28')]()[_0x5f43('0x27')](function(){_0x1a8fbe[_0x5f43('0x1d')](0xcc)[_0x5f43('0x1c')]();});}};}function handleEntityNotFound(_0x569d0d,_0x541cd8){return function(_0x31bd88){if(!_0x31bd88){_0x569d0d[_0x5f43('0x1b')](0x194);}return _0x31bd88;};}function handleError(_0x5c2283,_0x2f2481){_0x2f2481=_0x2f2481||0x1f4;return function(_0x1f79fd){logger[_0x5f43('0x29')](_0x1f79fd[_0x5f43('0x2a')]);if(_0x1f79fd[_0x5f43('0x2b')]){delete _0x1f79fd[_0x5f43('0x2b')];}_0x5c2283[_0x5f43('0x1d')](_0x2f2481)[_0x5f43('0x2c')](_0x1f79fd);};}exports[_0x5f43('0x2d')]=function(_0x2de728,_0xadd507){var _0x531cd4={},_0x292ff6={},_0x3a0240={'count':0x0,'rows':[]};var _0x2d8363=_[_0x5f43('0x2e')](db[_0x5f43('0x2f')][_0x5f43('0x30')],function(_0x43eb59){return{'name':_0x43eb59[_0x5f43('0x31')],'type':_0x43eb59[_0x5f43('0x32')][_0x5f43('0x33')]};});_0x292ff6['model']=_[_0x5f43('0x2e')](_0x2d8363,'name');_0x292ff6[_0x5f43('0x34')]=_[_0x5f43('0x35')](_0x2de728[_0x5f43('0x34')]);_0x292ff6[_0x5f43('0x36')]=_['intersection'](_0x292ff6[_0x5f43('0x37')],_0x292ff6[_0x5f43('0x34')]);_0x531cd4['attributes']=_[_0x5f43('0x38')](_0x292ff6[_0x5f43('0x37')],qs['fields'](_0x2de728['query']['fields']));_0x531cd4[_0x5f43('0x39')]=_0x531cd4[_0x5f43('0x39')]['length']?_0x531cd4[_0x5f43('0x39')]:_0x292ff6[_0x5f43('0x37')];if(!_0x2de728[_0x5f43('0x34')]['hasOwnProperty'](_0x5f43('0x3a'))){_0x531cd4['limit']=qs['limit'](_0x2de728[_0x5f43('0x34')]['limit']);_0x531cd4[_0x5f43('0x1f')]=qs['offset'](_0x2de728[_0x5f43('0x34')][_0x5f43('0x1f')]);}_0x531cd4[_0x5f43('0x3b')]=qs[_0x5f43('0x3c')](_0x2de728[_0x5f43('0x34')][_0x5f43('0x3c')]);_0x531cd4[_0x5f43('0x3d')]=qs[_0x5f43('0x36')](_[_0x5f43('0x3e')](_0x2de728[_0x5f43('0x34')],_0x292ff6['filters']),_0x2d8363);if(_0x2de728[_0x5f43('0x34')][_0x5f43('0x3f')]){_0x531cd4[_0x5f43('0x3d')]=_[_0x5f43('0x40')](_0x531cd4[_0x5f43('0x3d')],{'$or':_[_0x5f43('0x2e')](_0x2d8363,function(_0x4ac5e2){if(_0x4ac5e2[_0x5f43('0x32')]!==_0x5f43('0x41')){var _0x48ce1f={};_0x48ce1f[_0x4ac5e2[_0x5f43('0x2b')]]={'$like':'%'+_0x2de728['query'][_0x5f43('0x3f')]+'%'};return _0x48ce1f;}})});}_0x531cd4=_['merge']({},_0x531cd4,_0x2de728[_0x5f43('0x42')]);var _0x3c42e2={'where':_0x531cd4[_0x5f43('0x3d')]};return db[_0x5f43('0x2f')][_0x5f43('0x21')](_0x3c42e2)[_0x5f43('0x27')](function(_0x34d0df){_0x3a0240['count']=_0x34d0df;if(_0x2de728['query'][_0x5f43('0x43')]){_0x531cd4['include']=[{'all':!![]}];}return db[_0x5f43('0x2f')][_0x5f43('0x44')](_0x531cd4);})[_0x5f43('0x27')](function(_0x2dabe9){_0x3a0240['rows']=_0x2dabe9;return _0x3a0240;})[_0x5f43('0x27')](respondWithFilteredResult(_0xadd507,_0x531cd4))['catch'](handleError(_0xadd507,null));};exports[_0x5f43('0x45')]=function(_0x8eada9,_0x4ddd6b){var _0x1d185d={'raw':!![],'where':{'id':_0x8eada9[_0x5f43('0x46')]['id']}},_0x4e6245={};_0x4e6245[_0x5f43('0x37')]=_['keys'](db[_0x5f43('0x2f')][_0x5f43('0x30')]);_0x4e6245['query']=_[_0x5f43('0x35')](_0x8eada9[_0x5f43('0x34')]);_0x4e6245[_0x5f43('0x36')]=_[_0x5f43('0x38')](_0x4e6245['model'],_0x4e6245[_0x5f43('0x34')]);_0x1d185d[_0x5f43('0x39')]=_['intersection'](_0x4e6245['model'],qs[_0x5f43('0x47')](_0x8eada9['query'][_0x5f43('0x47')]));_0x1d185d[_0x5f43('0x39')]=_0x1d185d['attributes'][_0x5f43('0x48')]?_0x1d185d[_0x5f43('0x39')]:_0x4e6245[_0x5f43('0x37')];if(_0x8eada9[_0x5f43('0x34')][_0x5f43('0x43')]){_0x1d185d[_0x5f43('0x49')]=[{'all':!![]}];}_0x1d185d=_[_0x5f43('0x40')]({},_0x1d185d,_0x8eada9[_0x5f43('0x42')]);return db[_0x5f43('0x2f')][_0x5f43('0x4a')](_0x1d185d)[_0x5f43('0x27')](handleEntityNotFound(_0x4ddd6b,null))[_0x5f43('0x27')](respondWithResult(_0x4ddd6b,null))['catch'](handleError(_0x4ddd6b,null));};exports[_0x5f43('0x4b')]=function(_0x51fb64,_0x5bc422){return db[_0x5f43('0x2f')][_0x5f43('0x4b')](_0x51fb64[_0x5f43('0x4c')],{})[_0x5f43('0x27')](respondWithResult(_0x5bc422,0xc9))[_0x5f43('0x4d')](handleError(_0x5bc422,null));};exports[_0x5f43('0x26')]=function(_0x5614d3,_0x195605){if(_0x5614d3[_0x5f43('0x4c')]['id']){delete _0x5614d3['body']['id'];}return db[_0x5f43('0x2f')][_0x5f43('0x4a')]({'where':{'id':_0x5614d3[_0x5f43('0x46')]['id']}})[_0x5f43('0x27')](handleEntityNotFound(_0x195605,null))['then'](saveUpdates(_0x5614d3[_0x5f43('0x4c')],null))[_0x5f43('0x27')](respondWithResult(_0x195605,null))[_0x5f43('0x4d')](handleError(_0x195605,null));};exports['destroy']=function(_0x572850,_0x5ea85e){return db['ChatQueueReport']['find']({'where':{'id':_0x572850[_0x5f43('0x46')]['id']}})[_0x5f43('0x27')](handleEntityNotFound(_0x5ea85e,null))[_0x5f43('0x27')](removeEntity(_0x5ea85e,null))[_0x5f43('0x4d')](handleError(_0x5ea85e,null));};exports['describe']=function(_0x3025d7,_0x373d03){return db['ChatQueueReport'][_0x5f43('0x4e')]()[_0x5f43('0x27')](respondWithResult(_0x373d03,null))[_0x5f43('0x4d')](handleError(_0x373d03,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index f4b43c5..6d277ab 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5970b2,_0x4404f){var _0x534c6a=function(_0x23ef8c){while(--_0x23ef8c){_0x5970b2['push'](_0x5970b2['shift']());}};_0x534c6a(++_0x4404f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x5eff86,_0x405118){var _0x4474d4=function(_0x3a1391){while(--_0x3a1391){_0x5eff86['push'](_0x5eff86['shift']());}};_0x4474d4(++_0x405118);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b114212..c4333ee 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 _0xaded=['request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','update','body','raw','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x6faba5,_0x3786e6){var _0x391f97=function(_0x4f95f0){while(--_0x4f95f0){_0x6faba5['push'](_0x6faba5['shift']());}};_0x391f97(++_0x3786e6);}(_0xaded,0x7a));var _0xdade=function(_0x158ded,_0x4966d1){_0x158ded=_0x158ded-0x0;var _0x16f908=_0xaded[_0x158ded];return _0x16f908;};'use strict';var _=require(_0xdade('0x0'));var util=require('util');var moment=require(_0xdade('0x1'));var BPromise=require(_0xdade('0x2'));var rs=require(_0xdade('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdade('0x4'))['db'];var utils=require(_0xdade('0x5'));var logger=require('../../config/logger')(_0xdade('0x6'));var config=require(_0xdade('0x7'));var jayson=require(_0xdade('0x8'));var client=jayson[_0xdade('0x9')][_0xdade('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f6d78,_0x5170a5,_0x56aac8){return new BPromise(function(_0x3f5ee7,_0x2b188a){return client[_0xdade('0xb')](_0x4f6d78,_0x56aac8)[_0xdade('0xc')](function(_0x241c07){logger[_0xdade('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x5170a5,_0xdade('0xe'));logger[_0xdade('0xf')](_0xdade('0x10'),_0x5170a5,_0xdade('0xe'),JSON[_0xdade('0x11')](_0x241c07));if(_0x241c07[_0xdade('0x12')]){if(_0x241c07[_0xdade('0x12')][_0xdade('0x13')]===0x1f4){logger[_0xdade('0x12')](_0xdade('0x14'),_0x5170a5,_0x241c07['error']['message']);return _0x2b188a(_0x241c07[_0xdade('0x12')][_0xdade('0x15')]);}logger[_0xdade('0x12')](_0xdade('0x14'),_0x5170a5,_0x241c07[_0xdade('0x12')][_0xdade('0x15')]);return _0x3f5ee7(_0x241c07[_0xdade('0x12')][_0xdade('0x15')]);}else{logger[_0xdade('0xd')](_0xdade('0x14'),_0x5170a5,_0xdade('0xe'));_0x3f5ee7(_0x241c07[_0xdade('0x16')][_0xdade('0x15')]);}})[_0xdade('0x17')](function(_0x5cce56){logger[_0xdade('0x12')](_0xdade('0x14'),_0x5170a5,_0x5cce56);_0x2b188a(_0x5cce56);});});}exports[_0xdade('0x18')]=function(_0x4ec4ac){var _0x35bd84=this;return new Promise(function(_0x1915bc,_0x3554e4){return db[_0xdade('0x19')][_0xdade('0x1a')](_0x4ec4ac['body'],{'raw':_0x4ec4ac[_0xdade('0x1b')]?_0x4ec4ac[_0xdade('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xdade('0xc')](function(_0x1fe464){logger[_0xdade('0xd')](_0xdade('0x18'),_0x4ec4ac);logger[_0xdade('0xf')](_0xdade('0x18'),_0x4ec4ac,JSON[_0xdade('0x11')](_0x1fe464));_0x1915bc(_0x1fe464);})[_0xdade('0x17')](function(_0xe72094){logger[_0xdade('0x12')](_0xdade('0x18'),_0xe72094[_0xdade('0x15')],_0x4ec4ac);_0x3554e4(_0x35bd84['error'](0x1f4,_0xe72094[_0xdade('0x15')]));});});};exports[_0xdade('0x1c')]=function(_0x2ddc00){var _0x5f1d9f=this;return new Promise(function(_0x35d27a,_0x3596ce){return db[_0xdade('0x19')][_0xdade('0x1d')](_0x2ddc00[_0xdade('0x1e')],{'raw':_0x2ddc00['options']?_0x2ddc00[_0xdade('0x1b')][_0xdade('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ddc00[_0xdade('0x1b')]?_0x2ddc00[_0xdade('0x1b')][_0xdade('0x20')]||null:null,'attributes':_0x2ddc00['options']?_0x2ddc00[_0xdade('0x1b')][_0xdade('0x21')]||null:null,'limit':_0x2ddc00['options']?_0x2ddc00[_0xdade('0x1b')]['limit']||null:null})[_0xdade('0xc')](function(_0xec63b1){logger[_0xdade('0xd')](_0xdade('0x1c'),_0x2ddc00);logger['debug'](_0xdade('0x1c'),_0x2ddc00,JSON[_0xdade('0x11')](_0xec63b1));_0x35d27a(_0xec63b1);})['catch'](function(_0x1ab6cc){logger[_0xdade('0x12')](_0xdade('0x1c'),_0x1ab6cc['message'],_0x2ddc00);_0x3596ce(_0x5f1d9f[_0xdade('0x12')](0x1f4,_0x1ab6cc['message']));});});}; \ No newline at end of file +var _0x06c2=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','debug','UpdateChatQueueReport','update','raw','where','attributes'];(function(_0x4fef75,_0x92281d){var _0x25020b=function(_0x4cdea4){while(--_0x4cdea4){_0x4fef75['push'](_0x4fef75['shift']());}};_0x25020b(++_0x92281d);}(_0x06c2,0x70));var _0x206c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x06c2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x206c('0x0'));var util=require(_0x206c('0x1'));var moment=require(_0x206c('0x2'));var BPromise=require(_0x206c('0x3'));var rs=require(_0x206c('0x4'));var fs=require('fs');var Redis=require(_0x206c('0x5'));var db=require(_0x206c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x206c('0x7'))(_0x206c('0x8'));var config=require(_0x206c('0x9'));var jayson=require(_0x206c('0xa'));var client=jayson[_0x206c('0xb')][_0x206c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39b963,_0x259b7a,_0x5be0e6){return new BPromise(function(_0x52f649,_0x6cc725){return client[_0x206c('0xd')](_0x39b963,_0x5be0e6)[_0x206c('0xe')](function(_0x5367f3){logger['info'](_0x206c('0xf'),_0x259b7a,_0x206c('0x10'));logger['debug'](_0x206c('0x11'),_0x259b7a,_0x206c('0x10'),JSON[_0x206c('0x12')](_0x5367f3));if(_0x5367f3[_0x206c('0x13')]){if(_0x5367f3[_0x206c('0x13')][_0x206c('0x14')]===0x1f4){logger['error'](_0x206c('0xf'),_0x259b7a,_0x5367f3[_0x206c('0x13')]['message']);return _0x6cc725(_0x5367f3[_0x206c('0x13')][_0x206c('0x15')]);}logger[_0x206c('0x13')](_0x206c('0xf'),_0x259b7a,_0x5367f3[_0x206c('0x13')][_0x206c('0x15')]);return _0x52f649(_0x5367f3[_0x206c('0x13')]['message']);}else{logger[_0x206c('0x16')](_0x206c('0xf'),_0x259b7a,_0x206c('0x10'));_0x52f649(_0x5367f3[_0x206c('0x17')][_0x206c('0x15')]);}})[_0x206c('0x18')](function(_0x3cd33c){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x259b7a,_0x3cd33c);_0x6cc725(_0x3cd33c);});});}exports[_0x206c('0x19')]=function(_0x2bb90c){var _0x2a6978=this;return new Promise(function(_0x4d20b0,_0x197755){return db[_0x206c('0x1a')][_0x206c('0x1b')](_0x2bb90c[_0x206c('0x1c')],{'raw':_0x2bb90c[_0x206c('0x1d')]?_0x2bb90c[_0x206c('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x206c('0xe')](function(_0x2c4031){logger[_0x206c('0x16')](_0x206c('0x19'),_0x2bb90c);logger[_0x206c('0x1e')](_0x206c('0x19'),_0x2bb90c,JSON['stringify'](_0x2c4031));_0x4d20b0(_0x2c4031);})['catch'](function(_0x4af3cf){logger['error'](_0x206c('0x19'),_0x4af3cf['message'],_0x2bb90c);_0x197755(_0x2a6978[_0x206c('0x13')](0x1f4,_0x4af3cf[_0x206c('0x15')]));});});};exports[_0x206c('0x1f')]=function(_0x316ab6){var _0x5dbb23=this;return new Promise(function(_0x4bd272,_0x451fac){return db[_0x206c('0x1a')][_0x206c('0x20')](_0x316ab6[_0x206c('0x1c')],{'raw':_0x316ab6[_0x206c('0x1d')]?_0x316ab6[_0x206c('0x1d')][_0x206c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316ab6['options']?_0x316ab6[_0x206c('0x1d')][_0x206c('0x22')]||null:null,'attributes':_0x316ab6[_0x206c('0x1d')]?_0x316ab6[_0x206c('0x1d')][_0x206c('0x23')]||null:null,'limit':_0x316ab6[_0x206c('0x1d')]?_0x316ab6[_0x206c('0x1d')][_0x206c('0x24')]||null:null})[_0x206c('0xe')](function(_0xe7de2f){logger[_0x206c('0x16')]('UpdateChatQueueReport',_0x316ab6);logger[_0x206c('0x1e')](_0x206c('0x1f'),_0x316ab6,JSON[_0x206c('0x12')](_0xe7de2f));_0x4bd272(_0xe7de2f);})[_0x206c('0x18')](function(_0x3cecc7){logger[_0x206c('0x13')]('UpdateChatQueueReport',_0x3cecc7[_0x206c('0x15')],_0x316ab6);_0x451fac(_0x5dbb23[_0x206c('0x13')](0x1f4,_0x3cecc7[_0x206c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 8bb8ae8..46d83e4 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 _0x360f=['post','create','put','/:id','delete','destroy','multer','util','path','express','Router','fs-extra','../../config/environment','./chatQueueReport.controller','get','/describe','isAuthenticated','describe','show'];(function(_0x97e44f,_0xf5014d){var _0x383408=function(_0x438a5d){while(--_0x438a5d){_0x97e44f['push'](_0x97e44f['shift']());}};_0x383408(++_0xf5014d);}(_0x360f,0x65));var _0xf360=function(_0x43113e,_0x3a7ba4){_0x43113e=_0x43113e-0x0;var _0x5c158a=_0x360f[_0x43113e];return _0x5c158a;};'use strict';var multer=require(_0xf360('0x0'));var util=require(_0xf360('0x1'));var path=require(_0xf360('0x2'));var timeout=require('connect-timeout');var express=require(_0xf360('0x3'));var router=express[_0xf360('0x4')]();var fs_extra=require(_0xf360('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf360('0x6'));var controller=require(_0xf360('0x7'));router[_0xf360('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf360('0x9'),auth[_0xf360('0xa')](),controller[_0xf360('0xb')]);router['get']('/:id',auth[_0xf360('0xa')](),controller[_0xf360('0xc')]);router[_0xf360('0xd')]('/',auth['isAuthenticated'](),controller[_0xf360('0xe')]);router[_0xf360('0xf')](_0xf360('0x10'),auth[_0xf360('0xa')](),controller['update']);router[_0xf360('0x11')]('/:id',auth[_0xf360('0xa')](),controller[_0xf360('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6caf=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id'];(function(_0x38aafa,_0x6453a7){var _0x31beb2=function(_0x44e025){while(--_0x44e025){_0x38aafa['push'](_0x38aafa['shift']());}};_0x31beb2(++_0x6453a7);}(_0x6caf,0x1b2));var _0xf6ca=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0x6caf[_0x5192de];return _0x4e287e;};'use strict';var multer=require(_0xf6ca('0x0'));var util=require(_0xf6ca('0x1'));var path=require(_0xf6ca('0x2'));var timeout=require(_0xf6ca('0x3'));var express=require('express');var router=express[_0xf6ca('0x4')]();var fs_extra=require(_0xf6ca('0x5'));var auth=require(_0xf6ca('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf6ca('0x7'));router[_0xf6ca('0x8')]('/',auth[_0xf6ca('0x9')](),controller[_0xf6ca('0xa')]);router[_0xf6ca('0x8')](_0xf6ca('0xb'),auth['isAuthenticated'](),controller[_0xf6ca('0xc')]);router['get']('/:id',auth[_0xf6ca('0x9')](),controller[_0xf6ca('0xd')]);router[_0xf6ca('0xe')]('/',auth[_0xf6ca('0x9')](),controller['create']);router['put'](_0xf6ca('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xf6ca('0x10')](_0xf6ca('0xf'),auth[_0xf6ca('0x9')](),controller['destroy']);module[_0xf6ca('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6e08a50..5f62383 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(_0x2badac,_0x4b93fa){var _0x28276c=function(_0x19d5db){while(--_0x19d5db){_0x2badac['push'](_0x2badac['shift']());}};_0x28276c(++_0x4b93fa);}(_0x34e8,0x12c));var _0x834e=function(_0x3dbe45,_0x417d08){_0x3dbe45=_0x3dbe45-0x0;var _0x22be04=_0x34e8[_0x3dbe45];return _0x22be04;};'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(_0x31713c,_0x5025fc){var _0x29d6ba=function(_0x3ed937){while(--_0x3ed937){_0x31713c['push'](_0x31713c['shift']());}};_0x29d6ba(++_0x5025fc);}(_0x00bb,0x1d8));var _0xb00b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x00bb[_0x134c2e];return _0x2825db;};'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 d366854..c556796 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 _0x9ec4=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','destroy','name','send','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','request-promise','mustache','util','path'];(function(_0x2adbf8,_0x4afd45){var _0x4d8466=function(_0x1ea071){while(--_0x1ea071){_0x2adbf8['push'](_0x2adbf8['shift']());}};_0x4d8466(++_0x4afd45);}(_0x9ec4,0x1a4));var _0x49ec=function(_0x410ec8,_0x46c481){_0x410ec8=_0x410ec8-0x0;var _0x50944f=_0x9ec4[_0x410ec8];return _0x50944f;};'use strict';var emlformat=require(_0x49ec('0x0'));var rimraf=require(_0x49ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x49ec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x49ec('0x3'));var util=require(_0x49ec('0x4'));var path=require(_0x49ec('0x5'));var sox=require(_0x49ec('0x6'));var csv=require(_0x49ec('0x7'));var ejs=require(_0x49ec('0x8'));var fs=require('fs');var fs_extra=require(_0x49ec('0x9'));var _=require(_0x49ec('0xa'));var squel=require(_0x49ec('0xb'));var crypto=require('crypto');var jsforce=require(_0x49ec('0xc'));var deskjs=require(_0x49ec('0xd'));var toCsv=require(_0x49ec('0x7'));var querystring=require('querystring');var Papa=require(_0x49ec('0xe'));var Redis=require(_0x49ec('0xf'));var authService=require(_0x49ec('0x10'));var qs=require(_0x49ec('0x11'));var as=require(_0x49ec('0x12'));var hardwareService=require(_0x49ec('0x13'));var logger=require('../../config/logger')(_0x49ec('0x14'));var utils=require(_0x49ec('0x15'));var config=require(_0x49ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcb81f3,_0x5bb255){_0x5bb255=_0x5bb255||0xcc;return function(_0x436d86){if(_0x436d86){return _0xcb81f3[_0x49ec('0x17')](_0x5bb255);}return _0xcb81f3[_0x49ec('0x18')](_0x5bb255)[_0x49ec('0x19')]();};}function respondWithResult(_0x147cd5,_0x35db63){_0x35db63=_0x35db63||0xc8;return function(_0x1ad893){if(_0x1ad893){return _0x147cd5[_0x49ec('0x18')](_0x35db63)[_0x49ec('0x1a')](_0x1ad893);}};}function respondWithFilteredResult(_0xc8e45f,_0x2a386a){return function(_0x75151d){if(_0x75151d){var _0x3726a1=typeof _0x2a386a['offset']===_0x49ec('0x1b')&&typeof _0x2a386a[_0x49ec('0x1c')]===_0x49ec('0x1b');var _0x56ebda=_0x75151d['count'];var _0x276389=_0x3726a1?0x0:_0x2a386a[_0x49ec('0x1d')];var _0xacf874=_0x3726a1?_0x75151d[_0x49ec('0x1e')]:_0x2a386a['offset']+_0x2a386a[_0x49ec('0x1c')];var _0x356d21;if(_0xacf874>=_0x56ebda){_0xacf874=_0x56ebda;_0x356d21=0xc8;}else{_0x356d21=0xce;}_0xc8e45f[_0x49ec('0x18')](_0x356d21);return _0xc8e45f['set'](_0x49ec('0x1f'),_0x276389+'-'+_0xacf874+'/'+_0x56ebda)[_0x49ec('0x1a')](_0x75151d);}return null;};}function patchUpdates(_0x3980df){return function(_0x6e0dc1){try{jsonpatch[_0x49ec('0x20')](_0x6e0dc1,_0x3980df,!![]);}catch(_0x1496a){return BPromise[_0x49ec('0x21')](_0x1496a);}return _0x6e0dc1[_0x49ec('0x22')]();};}function saveUpdates(_0x28158a,_0x2177bf){return function(_0x542e60){if(_0x542e60){return _0x542e60['update'](_0x28158a)[_0x49ec('0x23')](function(_0x2f266d){return _0x2f266d;});}return null;};}function removeEntity(_0x32e185,_0x40cda6){return function(_0x2e0fb9){if(_0x2e0fb9){return _0x2e0fb9[_0x49ec('0x24')]()[_0x49ec('0x23')](function(){_0x32e185[_0x49ec('0x18')](0xcc)[_0x49ec('0x19')]();});}};}function handleEntityNotFound(_0xbc3a78,_0x9b2989){return function(_0xf68614){if(!_0xf68614){_0xbc3a78[_0x49ec('0x17')](0x194);}return _0xf68614;};}function handleError(_0x5c067a,_0x215dc8){_0x215dc8=_0x215dc8||0x1f4;return function(_0x108e9d){logger['error'](_0x108e9d['stack']);if(_0x108e9d['name']){delete _0x108e9d[_0x49ec('0x25')];}_0x5c067a[_0x49ec('0x18')](_0x215dc8)[_0x49ec('0x26')](_0x108e9d);};}exports['index']=function(_0x57af80,_0x49fa36){var _0x454a7c={},_0x5c2cbb={},_0x43eec0={'count':0x0,'rows':[]};var _0xce10ce=_['map'](db[_0x49ec('0x27')][_0x49ec('0x28')],function(_0x4ee199){return{'name':_0x4ee199[_0x49ec('0x29')],'type':_0x4ee199[_0x49ec('0x2a')][_0x49ec('0x2b')]};});_0x5c2cbb[_0x49ec('0x2c')]=_['map'](_0xce10ce,'name');_0x5c2cbb['query']=_[_0x49ec('0x2d')](_0x57af80['query']);_0x5c2cbb[_0x49ec('0x2e')]=_[_0x49ec('0x2f')](_0x5c2cbb[_0x49ec('0x2c')],_0x5c2cbb[_0x49ec('0x30')]);_0x454a7c[_0x49ec('0x31')]=_[_0x49ec('0x2f')](_0x5c2cbb['model'],qs[_0x49ec('0x32')](_0x57af80[_0x49ec('0x30')]['fields']));_0x454a7c['attributes']=_0x454a7c[_0x49ec('0x31')][_0x49ec('0x33')]?_0x454a7c['attributes']:_0x5c2cbb[_0x49ec('0x2c')];if(!_0x57af80[_0x49ec('0x30')][_0x49ec('0x34')](_0x49ec('0x35'))){_0x454a7c[_0x49ec('0x1c')]=qs['limit'](_0x57af80[_0x49ec('0x30')]['limit']);_0x454a7c[_0x49ec('0x1d')]=qs[_0x49ec('0x1d')](_0x57af80[_0x49ec('0x30')][_0x49ec('0x1d')]);}_0x454a7c[_0x49ec('0x36')]=qs[_0x49ec('0x37')](_0x57af80[_0x49ec('0x30')][_0x49ec('0x37')]);_0x454a7c[_0x49ec('0x38')]=qs[_0x49ec('0x2e')](_[_0x49ec('0x39')](_0x57af80[_0x49ec('0x30')],_0x5c2cbb[_0x49ec('0x2e')]),_0xce10ce);if(_0x57af80[_0x49ec('0x30')][_0x49ec('0x3a')]){_0x454a7c[_0x49ec('0x38')]=_['merge'](_0x454a7c[_0x49ec('0x38')],{'$or':_['map'](_0xce10ce,function(_0x4392f5){if(_0x4392f5[_0x49ec('0x2a')]!==_0x49ec('0x3b')){var _0xf8c237={};_0xf8c237[_0x4392f5[_0x49ec('0x25')]]={'$like':'%'+_0x57af80[_0x49ec('0x30')][_0x49ec('0x3a')]+'%'};return _0xf8c237;}})});}_0x454a7c=_[_0x49ec('0x3c')]({},_0x454a7c,_0x57af80[_0x49ec('0x3d')]);var _0x10cb5f={'where':_0x454a7c['where']};return db[_0x49ec('0x27')]['count'](_0x10cb5f)[_0x49ec('0x23')](function(_0x17d294){_0x43eec0['count']=_0x17d294;if(_0x57af80['query'][_0x49ec('0x3e')]){_0x454a7c[_0x49ec('0x3f')]=[{'all':!![]}];}return db[_0x49ec('0x27')][_0x49ec('0x40')](_0x454a7c);})[_0x49ec('0x23')](function(_0x465b9e){_0x43eec0['rows']=_0x465b9e;return _0x43eec0;})['then'](respondWithFilteredResult(_0x49fa36,_0x454a7c))[_0x49ec('0x41')](handleError(_0x49fa36,null));};exports['show']=function(_0x18a96c,_0x5461d6){var _0x58ebf3={'raw':!![],'where':{'id':_0x18a96c[_0x49ec('0x42')]['id']}},_0x58fde6={};_0x58fde6['model']=_[_0x49ec('0x2d')](db['ChatTransferReport'][_0x49ec('0x28')]);_0x58fde6[_0x49ec('0x30')]=_[_0x49ec('0x2d')](_0x18a96c['query']);_0x58fde6[_0x49ec('0x2e')]=_['intersection'](_0x58fde6[_0x49ec('0x2c')],_0x58fde6[_0x49ec('0x30')]);_0x58ebf3[_0x49ec('0x31')]=_[_0x49ec('0x2f')](_0x58fde6['model'],qs[_0x49ec('0x32')](_0x18a96c['query']['fields']));_0x58ebf3[_0x49ec('0x31')]=_0x58ebf3[_0x49ec('0x31')]['length']?_0x58ebf3[_0x49ec('0x31')]:_0x58fde6['model'];if(_0x18a96c[_0x49ec('0x30')][_0x49ec('0x3e')]){_0x58ebf3['include']=[{'all':!![]}];}_0x58ebf3=_[_0x49ec('0x3c')]({},_0x58ebf3,_0x18a96c['options']);return db[_0x49ec('0x27')][_0x49ec('0x43')](_0x58ebf3)[_0x49ec('0x23')](handleEntityNotFound(_0x5461d6,null))[_0x49ec('0x23')](respondWithResult(_0x5461d6,null))['catch'](handleError(_0x5461d6,null));};exports[_0x49ec('0x44')]=function(_0x3fc57f,_0x248956){return db[_0x49ec('0x27')]['create'](_0x3fc57f['body'],{})[_0x49ec('0x23')](respondWithResult(_0x248956,0xc9))[_0x49ec('0x41')](handleError(_0x248956,null));};exports['update']=function(_0x1c5add,_0x41bda8){if(_0x1c5add[_0x49ec('0x45')]['id']){delete _0x1c5add['body']['id'];}return db[_0x49ec('0x27')][_0x49ec('0x43')]({'where':{'id':_0x1c5add[_0x49ec('0x42')]['id']}})[_0x49ec('0x23')](handleEntityNotFound(_0x41bda8,null))[_0x49ec('0x23')](saveUpdates(_0x1c5add[_0x49ec('0x45')],null))[_0x49ec('0x23')](respondWithResult(_0x41bda8,null))[_0x49ec('0x41')](handleError(_0x41bda8,null));};exports[_0x49ec('0x24')]=function(_0x408342,_0x3ceff1){return db['ChatTransferReport'][_0x49ec('0x43')]({'where':{'id':_0x408342[_0x49ec('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ceff1,null))['then'](removeEntity(_0x3ceff1,null))[_0x49ec('0x41')](handleError(_0x3ceff1,null));};exports[_0x49ec('0x46')]=function(_0x4f4b46,_0x141db9){return db[_0x49ec('0x27')]['describe']()['then'](respondWithResult(_0x141db9,null))[_0x49ec('0x41')](handleError(_0x141db9,null));}; \ No newline at end of file +var _0xf265=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','status','error','name','ChatTransferReport'];(function(_0x2dc820,_0x247052){var _0x48a9c7=function(_0x45e37a){while(--_0x45e37a){_0x2dc820['push'](_0x2dc820['shift']());}};_0x48a9c7(++_0x247052);}(_0xf265,0x151));var _0x5f26=function(_0x413410,_0xf7ac22){_0x413410=_0x413410-0x0;var _0x1294e5=_0xf265[_0x413410];return _0x1294e5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f26('0x0'));var rp=require(_0x5f26('0x1'));var moment=require(_0x5f26('0x2'));var BPromise=require(_0x5f26('0x3'));var Mustache=require(_0x5f26('0x4'));var util=require(_0x5f26('0x5'));var path=require(_0x5f26('0x6'));var sox=require('sox');var csv=require(_0x5f26('0x7'));var ejs=require(_0x5f26('0x8'));var fs=require('fs');var fs_extra=require(_0x5f26('0x9'));var _=require(_0x5f26('0xa'));var squel=require(_0x5f26('0xb'));var crypto=require(_0x5f26('0xc'));var jsforce=require(_0x5f26('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5f26('0x7'));var querystring=require(_0x5f26('0xe'));var Papa=require('papaparse');var Redis=require(_0x5f26('0xf'));var authService=require(_0x5f26('0x10'));var qs=require(_0x5f26('0x11'));var as=require(_0x5f26('0x12'));var hardwareService=require(_0x5f26('0x13'));var logger=require(_0x5f26('0x14'))(_0x5f26('0x15'));var utils=require(_0x5f26('0x16'));var config=require(_0x5f26('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f26('0x18'))['db'];function respondWithStatusCode(_0x536697,_0x36b150){_0x36b150=_0x36b150||0xcc;return function(_0x498467){if(_0x498467){return _0x536697[_0x5f26('0x19')](_0x36b150);}return _0x536697['status'](_0x36b150)[_0x5f26('0x1a')]();};}function respondWithResult(_0x7b2225,_0x22c3fd){_0x22c3fd=_0x22c3fd||0xc8;return function(_0x42913d){if(_0x42913d){return _0x7b2225['status'](_0x22c3fd)[_0x5f26('0x1b')](_0x42913d);}};}function respondWithFilteredResult(_0x5bc86f,_0x4375b0){return function(_0x391ac4){if(_0x391ac4){var _0x27c20b=typeof _0x4375b0['offset']===_0x5f26('0x1c')&&typeof _0x4375b0['limit']===_0x5f26('0x1c');var _0x59ff9d=_0x391ac4[_0x5f26('0x1d')];var _0x576a58=_0x27c20b?0x0:_0x4375b0[_0x5f26('0x1e')];var _0x2e0503=_0x27c20b?_0x391ac4[_0x5f26('0x1d')]:_0x4375b0[_0x5f26('0x1e')]+_0x4375b0['limit'];var _0xaed94b;if(_0x2e0503>=_0x59ff9d){_0x2e0503=_0x59ff9d;_0xaed94b=0xc8;}else{_0xaed94b=0xce;}_0x5bc86f['status'](_0xaed94b);return _0x5bc86f[_0x5f26('0x1f')](_0x5f26('0x20'),_0x576a58+'-'+_0x2e0503+'/'+_0x59ff9d)[_0x5f26('0x1b')](_0x391ac4);}return null;};}function patchUpdates(_0x578105){return function(_0x3533b6){try{jsonpatch[_0x5f26('0x21')](_0x3533b6,_0x578105,!![]);}catch(_0x1e723d){return BPromise[_0x5f26('0x22')](_0x1e723d);}return _0x3533b6[_0x5f26('0x23')]();};}function saveUpdates(_0x5aa577,_0x34bcd6){return function(_0x221b00){if(_0x221b00){return _0x221b00[_0x5f26('0x24')](_0x5aa577)[_0x5f26('0x25')](function(_0xe8075f){return _0xe8075f;});}return null;};}function removeEntity(_0x34e3f4,_0x1b1820){return function(_0x1c4ff9){if(_0x1c4ff9){return _0x1c4ff9[_0x5f26('0x26')]()[_0x5f26('0x25')](function(){_0x34e3f4[_0x5f26('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5329a2,_0x445677){return function(_0x155531){if(!_0x155531){_0x5329a2[_0x5f26('0x19')](0x194);}return _0x155531;};}function handleError(_0x169858,_0x1d5a46){_0x1d5a46=_0x1d5a46||0x1f4;return function(_0x4888d3){logger[_0x5f26('0x28')](_0x4888d3['stack']);if(_0x4888d3[_0x5f26('0x29')]){delete _0x4888d3[_0x5f26('0x29')];}_0x169858['status'](_0x1d5a46)['send'](_0x4888d3);};}exports['index']=function(_0x73fb6a,_0x49cfde){var _0x19c785={},_0x4e472d={},_0x362b1b={'count':0x0,'rows':[]};var _0x2eca8c=_['map'](db[_0x5f26('0x2a')][_0x5f26('0x2b')],function(_0x2f36af){return{'name':_0x2f36af[_0x5f26('0x2c')],'type':_0x2f36af[_0x5f26('0x2d')][_0x5f26('0x2e')]};});_0x4e472d[_0x5f26('0x2f')]=_[_0x5f26('0x30')](_0x2eca8c,_0x5f26('0x29'));_0x4e472d[_0x5f26('0x31')]=_[_0x5f26('0x32')](_0x73fb6a['query']);_0x4e472d[_0x5f26('0x33')]=_[_0x5f26('0x34')](_0x4e472d[_0x5f26('0x2f')],_0x4e472d['query']);_0x19c785[_0x5f26('0x35')]=_[_0x5f26('0x34')](_0x4e472d[_0x5f26('0x2f')],qs[_0x5f26('0x36')](_0x73fb6a[_0x5f26('0x31')][_0x5f26('0x36')]));_0x19c785[_0x5f26('0x35')]=_0x19c785[_0x5f26('0x35')]['length']?_0x19c785[_0x5f26('0x35')]:_0x4e472d[_0x5f26('0x2f')];if(!_0x73fb6a[_0x5f26('0x31')][_0x5f26('0x37')](_0x5f26('0x38'))){_0x19c785[_0x5f26('0x39')]=qs[_0x5f26('0x39')](_0x73fb6a['query'][_0x5f26('0x39')]);_0x19c785[_0x5f26('0x1e')]=qs['offset'](_0x73fb6a['query'][_0x5f26('0x1e')]);}_0x19c785[_0x5f26('0x3a')]=qs['sort'](_0x73fb6a[_0x5f26('0x31')][_0x5f26('0x3b')]);_0x19c785[_0x5f26('0x3c')]=qs[_0x5f26('0x33')](_['pick'](_0x73fb6a[_0x5f26('0x31')],_0x4e472d[_0x5f26('0x33')]),_0x2eca8c);if(_0x73fb6a[_0x5f26('0x31')][_0x5f26('0x3d')]){_0x19c785[_0x5f26('0x3c')]=_[_0x5f26('0x3e')](_0x19c785['where'],{'$or':_[_0x5f26('0x30')](_0x2eca8c,function(_0x2d5bd8){if(_0x2d5bd8[_0x5f26('0x2d')]!==_0x5f26('0x3f')){var _0x57325f={};_0x57325f[_0x2d5bd8[_0x5f26('0x29')]]={'$like':'%'+_0x73fb6a[_0x5f26('0x31')][_0x5f26('0x3d')]+'%'};return _0x57325f;}})});}_0x19c785=_[_0x5f26('0x3e')]({},_0x19c785,_0x73fb6a[_0x5f26('0x40')]);var _0x5aab29={'where':_0x19c785[_0x5f26('0x3c')]};return db[_0x5f26('0x2a')]['count'](_0x5aab29)['then'](function(_0x3d7a42){_0x362b1b[_0x5f26('0x1d')]=_0x3d7a42;if(_0x73fb6a[_0x5f26('0x31')][_0x5f26('0x41')]){_0x19c785[_0x5f26('0x42')]=[{'all':!![]}];}return db[_0x5f26('0x2a')][_0x5f26('0x43')](_0x19c785);})['then'](function(_0x46ec33){_0x362b1b['rows']=_0x46ec33;return _0x362b1b;})['then'](respondWithFilteredResult(_0x49cfde,_0x19c785))[_0x5f26('0x44')](handleError(_0x49cfde,null));};exports[_0x5f26('0x45')]=function(_0x5b7ae2,_0x2ca239){var _0x38f979={'raw':!![],'where':{'id':_0x5b7ae2[_0x5f26('0x46')]['id']}},_0x42f07a={};_0x42f07a['model']=_[_0x5f26('0x32')](db[_0x5f26('0x2a')][_0x5f26('0x2b')]);_0x42f07a[_0x5f26('0x31')]=_[_0x5f26('0x32')](_0x5b7ae2[_0x5f26('0x31')]);_0x42f07a[_0x5f26('0x33')]=_['intersection'](_0x42f07a[_0x5f26('0x2f')],_0x42f07a[_0x5f26('0x31')]);_0x38f979[_0x5f26('0x35')]=_[_0x5f26('0x34')](_0x42f07a[_0x5f26('0x2f')],qs[_0x5f26('0x36')](_0x5b7ae2['query'][_0x5f26('0x36')]));_0x38f979[_0x5f26('0x35')]=_0x38f979['attributes'][_0x5f26('0x47')]?_0x38f979[_0x5f26('0x35')]:_0x42f07a[_0x5f26('0x2f')];if(_0x5b7ae2['query']['includeAll']){_0x38f979['include']=[{'all':!![]}];}_0x38f979=_['merge']({},_0x38f979,_0x5b7ae2[_0x5f26('0x40')]);return db[_0x5f26('0x2a')][_0x5f26('0x48')](_0x38f979)[_0x5f26('0x25')](handleEntityNotFound(_0x2ca239,null))[_0x5f26('0x25')](respondWithResult(_0x2ca239,null))['catch'](handleError(_0x2ca239,null));};exports[_0x5f26('0x49')]=function(_0x334c14,_0x4e62ab){return db[_0x5f26('0x2a')]['create'](_0x334c14[_0x5f26('0x4a')],{})[_0x5f26('0x25')](respondWithResult(_0x4e62ab,0xc9))[_0x5f26('0x44')](handleError(_0x4e62ab,null));};exports[_0x5f26('0x24')]=function(_0x5811a3,_0x15bd06){if(_0x5811a3[_0x5f26('0x4a')]['id']){delete _0x5811a3[_0x5f26('0x4a')]['id'];}return db[_0x5f26('0x2a')]['find']({'where':{'id':_0x5811a3['params']['id']}})[_0x5f26('0x25')](handleEntityNotFound(_0x15bd06,null))[_0x5f26('0x25')](saveUpdates(_0x5811a3['body'],null))['then'](respondWithResult(_0x15bd06,null))['catch'](handleError(_0x15bd06,null));};exports[_0x5f26('0x26')]=function(_0x45fe91,_0x3f507f){return db['ChatTransferReport']['find']({'where':{'id':_0x45fe91[_0x5f26('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f507f,null))['then'](removeEntity(_0x3f507f,null))['catch'](handleError(_0x3f507f,null));};exports['describe']=function(_0x5df84c,_0x1304e4){return db[_0x5f26('0x2a')][_0x5f26('0x4b')]()[_0x5f26('0x25')](respondWithResult(_0x1304e4,null))[_0x5f26('0x44')](handleError(_0x1304e4,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 849a1af..1de8529 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 _0x0ebd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatTransferReport','uniqueid','util','../../config/logger','api'];(function(_0x350ec3,_0x1dcb41){var _0x1eef31=function(_0x388869){while(--_0x388869){_0x350ec3['push'](_0x350ec3['shift']());}};_0x1eef31(++_0x1dcb41);}(_0x0ebd,0x1ad));var _0xd0eb=function(_0x25d7c7,_0x2cb5ce){_0x25d7c7=_0x25d7c7-0x0;var _0x4575fb=_0x0ebd[_0x25d7c7];return _0x4575fb;};'use strict';var _=require('lodash');var util=require(_0xd0eb('0x0'));var logger=require(_0xd0eb('0x1'))(_0xd0eb('0x2'));var moment=require(_0xd0eb('0x3'));var BPromise=require(_0xd0eb('0x4'));var rp=require(_0xd0eb('0x5'));var fs=require('fs');var path=require(_0xd0eb('0x6'));var rimraf=require(_0xd0eb('0x7'));var config=require(_0xd0eb('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0xd0eb('0x9')]=function(_0xd30e02,_0x4714ea){return _0xd30e02['define'](_0xd0eb('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xd0eb('0xb'),'fields':[_0xd0eb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf87=['exports','define','ChatTransferReport','uniqueid','lodash','util','api','bluebird','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaf87,0xfe));var _0x7af8=function(_0x1df27c,_0x356d53){_0x1df27c=_0x1df27c-0x0;var _0x257ce0=_0xaf87[_0x1df27c];return _0x257ce0;};'use strict';var _=require(_0x7af8('0x0'));var util=require(_0x7af8('0x1'));var logger=require('../../config/logger')(_0x7af8('0x2'));var moment=require('moment');var BPromise=require(_0x7af8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7af8('0x4'));var config=require(_0x7af8('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0x7af8('0x6')]=function(_0x48cd22,_0x2ef53a){return _0x48cd22[_0x7af8('0x7')](_0x7af8('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x7af8('0x9'),'fields':[_0x7af8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 84b85e3..ba07805 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 _0x3dd2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x1440d9,_0x4a2c7e){var _0x4a0cfb=function(_0x9dc96c){while(--_0x9dc96c){_0x1440d9['push'](_0x1440d9['shift']());}};_0x4a0cfb(++_0x4a2c7e);}(_0x3dd2,0x1b2));var _0x23dd=function(_0x483f40,_0x35b45b){_0x483f40=_0x483f40-0x0;var _0x35df5f=_0x3dd2[_0x483f40];return _0x35df5f;};'use strict';var _=require(_0x23dd('0x0'));var util=require(_0x23dd('0x1'));var moment=require(_0x23dd('0x2'));var BPromise=require(_0x23dd('0x3'));var rs=require(_0x23dd('0x4'));var fs=require('fs');var Redis=require(_0x23dd('0x5'));var db=require(_0x23dd('0x6'))['db'];var utils=require(_0x23dd('0x7'));var logger=require(_0x23dd('0x8'))(_0x23dd('0x9'));var config=require(_0x23dd('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x23dd('0xb')][_0x23dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x545f12,_0xba7320,_0x3b5bd3){return new BPromise(function(_0x12a800,_0x1a45ef){return client['request'](_0x545f12,_0x3b5bd3)['then'](function(_0xb0aa68){logger[_0x23dd('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0xba7320,_0x23dd('0xe'));logger[_0x23dd('0xf')](_0x23dd('0x10'),_0xba7320,_0x23dd('0xe'),JSON[_0x23dd('0x11')](_0xb0aa68));if(_0xb0aa68[_0x23dd('0x12')]){if(_0xb0aa68[_0x23dd('0x12')]['code']===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xba7320,_0xb0aa68['error'][_0x23dd('0x13')]);return _0x1a45ef(_0xb0aa68[_0x23dd('0x12')][_0x23dd('0x13')]);}logger['error'](_0x23dd('0x14'),_0xba7320,_0xb0aa68[_0x23dd('0x12')][_0x23dd('0x13')]);return _0x12a800(_0xb0aa68[_0x23dd('0x12')][_0x23dd('0x13')]);}else{logger[_0x23dd('0xd')](_0x23dd('0x14'),_0xba7320,_0x23dd('0xe'));_0x12a800(_0xb0aa68[_0x23dd('0x15')][_0x23dd('0x13')]);}})[_0x23dd('0x16')](function(_0x53b810){logger[_0x23dd('0x12')](_0x23dd('0x14'),_0xba7320,_0x53b810);_0x1a45ef(_0x53b810);});});} \ No newline at end of file +var _0x9be5=['request\x20sent','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2cdfa7,_0x34eeb6){var _0x23a81a=function(_0xd74d4b){while(--_0xd74d4b){_0x2cdfa7['push'](_0x2cdfa7['shift']());}};_0x23a81a(++_0x34eeb6);}(_0x9be5,0x1c7));var _0x59be=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x9be5[_0x1da04e];return _0xdd8c41;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x59be('0x0'));var rs=require(_0x59be('0x1'));var fs=require('fs');var Redis=require(_0x59be('0x2'));var db=require(_0x59be('0x3'))['db'];var utils=require(_0x59be('0x4'));var logger=require(_0x59be('0x5'))(_0x59be('0x6'));var config=require('../../config/environment');var jayson=require(_0x59be('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x190a0d,_0x1803a2,_0x9b5c5e){return new BPromise(function(_0x340537,_0x2ce3dc){return client['request'](_0x190a0d,_0x9b5c5e)[_0x59be('0x8')](function(_0x5bed4f){logger[_0x59be('0x9')](_0x59be('0xa'),_0x1803a2,'request\x20sent');logger[_0x59be('0xb')](_0x59be('0xc'),_0x1803a2,_0x59be('0xd'),JSON['stringify'](_0x5bed4f));if(_0x5bed4f[_0x59be('0xe')]){if(_0x5bed4f[_0x59be('0xe')]['code']===0x1f4){logger[_0x59be('0xe')](_0x59be('0xa'),_0x1803a2,_0x5bed4f[_0x59be('0xe')]['message']);return _0x2ce3dc(_0x5bed4f[_0x59be('0xe')]['message']);}logger[_0x59be('0xe')](_0x59be('0xa'),_0x1803a2,_0x5bed4f[_0x59be('0xe')][_0x59be('0xf')]);return _0x340537(_0x5bed4f[_0x59be('0xe')]['message']);}else{logger[_0x59be('0x9')](_0x59be('0xa'),_0x1803a2,_0x59be('0xd'));_0x340537(_0x5bed4f[_0x59be('0x10')]['message']);}})[_0x59be('0x11')](function(_0x5414f5){logger[_0x59be('0xe')](_0x59be('0xa'),_0x1803a2,_0x5414f5);_0x2ce3dc(_0x5414f5);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 958416b..5e7ea96 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 _0xa4b8=['update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x25656f,_0x4cf8be){var _0x6e703f=function(_0x334697){while(--_0x334697){_0x25656f['push'](_0x25656f['shift']());}};_0x6e703f(++_0x4cf8be);}(_0xa4b8,0xff));var _0x8a4b=function(_0x4b25ea,_0x52a3b6){_0x4b25ea=_0x4b25ea-0x0;var _0x41e3d4=_0xa4b8[_0x4b25ea];return _0x41e3d4;};'use strict';var multer=require('multer');var util=require(_0x8a4b('0x0'));var path=require(_0x8a4b('0x1'));var timeout=require(_0x8a4b('0x2'));var express=require('express');var router=express[_0x8a4b('0x3')]();var fs_extra=require(_0x8a4b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8a4b('0x5'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x8a4b('0x6')]('/',auth[_0x8a4b('0x7')](),controller[_0x8a4b('0x8')]);router[_0x8a4b('0x6')]('/describe',auth[_0x8a4b('0x7')](),controller[_0x8a4b('0x9')]);router['get']('/:id',auth[_0x8a4b('0x7')](),controller[_0x8a4b('0xa')]);router[_0x8a4b('0xb')]('/',auth['isAuthenticated'](),controller[_0x8a4b('0xc')]);router[_0x8a4b('0xd')](_0x8a4b('0xe'),auth[_0x8a4b('0x7')](),controller[_0x8a4b('0xf')]);router['delete'](_0x8a4b('0xe'),auth['isAuthenticated'](),controller[_0x8a4b('0x10')]);module[_0x8a4b('0x11')]=router; \ No newline at end of file +var _0xe305=['put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0xe305,0x1e6));var _0x5e30=function(_0x58a951,_0x5bb667){_0x58a951=_0x58a951-0x0;var _0x594ba3=_0xe305[_0x58a951];return _0x594ba3;};'use strict';var multer=require(_0x5e30('0x0'));var util=require(_0x5e30('0x1'));var path=require(_0x5e30('0x2'));var timeout=require(_0x5e30('0x3'));var express=require(_0x5e30('0x4'));var router=express[_0x5e30('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5e30('0x6'));var interaction=require(_0x5e30('0x7'));var config=require(_0x5e30('0x8'));var controller=require(_0x5e30('0x9'));router['get']('/',auth[_0x5e30('0xa')](),controller[_0x5e30('0xb')]);router[_0x5e30('0xc')](_0x5e30('0xd'),auth[_0x5e30('0xa')](),controller['describe']);router['get'](_0x5e30('0xe'),auth[_0x5e30('0xa')](),controller[_0x5e30('0xf')]);router[_0x5e30('0x10')]('/',auth[_0x5e30('0xa')](),controller[_0x5e30('0x11')]);router[_0x5e30('0x12')](_0x5e30('0xe'),auth[_0x5e30('0xa')](),controller[_0x5e30('0x13')]);router['delete'](_0x5e30('0xe'),auth[_0x5e30('0xa')](),controller[_0x5e30('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 9bc1588..d785b18 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(_0x18d4c0,_0x437f63){_0x18d4c0=_0x18d4c0-0x0;var _0x26fad0=_0x1be1[_0x18d4c0];return _0x26fad0;};'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 _0xa9e0=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','bottom_right','#fafafa','System'];(function(_0x418ae1,_0x308606){var _0x47bc4f=function(_0x28a3b){while(--_0x28a3b){_0x418ae1['push'](_0x418ae1['shift']());}};_0x47bc4f(++_0x308606);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var rs=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'mapKeyOffline':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'key':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x6')},'customerAlias':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![],'defaultValue':_0x0a9e('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0a9e('0x4')]},'animation':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0a9e('0xb')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0xc')},'start_chat_button':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xd')},'offline_chat_button':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xe')},'header_offline':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0a9e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x13')},'noteTitle':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x14')},'closingMessageButton':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xe')},'skipMessageButton':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x15')},'conditionAgreement':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x0a9e('0x17'),_0x0a9e('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0a9e('0x19'),'variable':null,'config':{'placeholder':_0x0a9e('0x1a'),'type':_0x0a9e('0x1b'),'required':!![]},'props':{'title':_0x0a9e('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x0a9e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0a9e('0x5'),'type':_0x0a9e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0a9e('0x1c')](_0x0a9e('0x1d'))?JSON[_0x0a9e('0x1e')](this[_0x0a9e('0x1c')]('onlineForm')):{};},'set':function(_0x59181e){return this[_0x0a9e('0x1f')](_0x0a9e('0x1d'),JSON[_0x0a9e('0x20')](_0x59181e));}},'offlineForm':{'type':Sequelize[_0x0a9e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0a9e('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0a9e('0x5'),'type':'email'},'variable':null},{'type':_0x0a9e('0x21'),'config':{'placeholder':_0x0a9e('0x22')},'props':{'title':_0x0a9e('0x22'),'helpText':_0x0a9e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x0a9e('0x1c')](_0x0a9e('0x24'))?JSON[_0x0a9e('0x1e')](this[_0x0a9e('0x1c')]('offlineForm')):{};},'set':function(_0x3652a7){return this[_0x0a9e('0x1f')](_0x0a9e('0x24'),JSON[_0x0a9e('0x20')](_0x3652a7));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0a9e('0x25')]();}},'autoclose':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0a9e('0x4')]},'forwardOffline':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0a9e('0x4')]},'waitingTitle':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x28')},'offlineMessageBody':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x15')},'sendUnmanaged':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0a9e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0a9e('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a9e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x2a')},'verticalAlignment':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x0a9e('0x4')]},'customerAvatar':{'type':Sequelize[_0x0a9e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0a9e('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a9e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0a9e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x0a9e('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b814e){if(!_0x2b814e)this[_0x0a9e('0x1f')](_0x0a9e('0x2e'),null);this[_0x0a9e('0x1f')]('mandatoryDisposition',_0x2b814e);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0a9e('0x4')]},'vidaooTopic':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':function(){return _0x0a9e('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x0a9e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0a9e('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index f9bfeac..6fe5e71 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 _0x1205=['merge','type','options','includeAll','include','findAll','rows','show','Pause','rawAttributes','intersection','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','addLogo','addAvatar','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','existsSync','root','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','updatedAt','DESC','ChatApplication','account','applications','Applications','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','version','%s\x20%s','browser','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','update','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','ListId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','basename','transaction','bulkCreate','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','subjectOffline','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','internal','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','push','all','some','remote','x-real-ip','remoteAddress','referer','alignment','verticalAlignment','labelText','textColor','color_button','hideWhenOffline','IntervalId','sequelize','Transaction','READ_COMMITTED','priority','finally','json','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','offset','limit','undefined','count','destroy','ChatWebsites','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','ChatWebsite','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x573150,_0xe5b26){var _0xa72f1d=function(_0x4fb6b2){while(--_0x4fb6b2){_0x573150['push'](_0x573150['shift']());}};_0xa72f1d(++_0xe5b26);}(_0x1205,0xe7));var _0x5120=function(_0x213959,_0x4d0ad4){_0x213959=_0x213959-0x0;var _0xb7478f=_0x1205[_0x213959];return _0xb7478f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x5120('0x0'));var util=require(_0x5120('0x1'));var path=require(_0x5120('0x2'));var ejs=require(_0x5120('0x3'));var fs=require('fs');var fs_extra=require(_0x5120('0x4'));var _=require(_0x5120('0x5'));var querystring=require('querystring');var Redis=require(_0x5120('0x6'));var qs=require(_0x5120('0x7'));var logger=require(_0x5120('0x8'))(_0x5120('0x9'));var config=require(_0x5120('0xa'));var db=require(_0x5120('0xb'))['db'];config[_0x5120('0xc')]=_[_0x5120('0xd')](config['redis'],{'host':_0x5120('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5120('0xc')]));require(_0x5120('0xf'))['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0x5120('0x10'));var client=jayson[_0x5120('0x11')][_0x5120('0x12')]({'port':0x232c});var client9002=jayson['client'][_0x5120('0x12')]({'port':0x232a});var client9003=jayson[_0x5120('0x11')]['http']({'port':0x232b});var client9001=jayson[_0x5120('0x11')][_0x5120('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x558eaa,_0x234df1,_0x34ad66,_0x66b5e4){return new BPromise(function(_0x22ba1,_0x511e0a){var _0x388365=_0x66b5e4||client;return _0x388365[_0x5120('0x13')](_0x558eaa,_0x34ad66)[_0x5120('0x14')](function(_0x365938){logger[_0x5120('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x234df1,'request\x20sent');logger[_0x5120('0x16')](_0x5120('0x17'),_0x234df1,'request\x20sent',JSON['stringify'](_0x365938));if(_0x365938['error']){if(_0x365938[_0x5120('0x18')]['code']===0x1f4){logger['error'](_0x5120('0x19'),_0x234df1,_0x365938[_0x5120('0x18')]['message']);return _0x511e0a(_0x365938[_0x5120('0x18')][_0x5120('0x1a')]);}logger[_0x5120('0x18')](_0x5120('0x19'),_0x234df1,_0x365938[_0x5120('0x18')][_0x5120('0x1a')]);return _0x22ba1(_0x365938[_0x5120('0x18')][_0x5120('0x1a')]);}else{logger['info'](_0x5120('0x19'),_0x234df1,_0x5120('0x1b'));_0x22ba1(_0x365938[_0x5120('0x1c')][_0x5120('0x1a')]);}})[_0x5120('0x1d')](function(_0x34a0e4){logger['error'](_0x5120('0x19'),_0x234df1,_0x34a0e4);_0x511e0a(_0x34a0e4);});});}function respondWithStatusCode(_0x10fdc3,_0x2bcfbe){_0x2bcfbe=_0x2bcfbe||0xcc;return function(_0xf9a73d){if(_0xf9a73d){return _0x10fdc3[_0x5120('0x1e')](_0x2bcfbe);}return _0x10fdc3[_0x5120('0x1f')](_0x2bcfbe)[_0x5120('0x20')]();};}function respondWithResult(_0x121285,_0x1111a9){_0x1111a9=_0x1111a9||0xc8;return function(_0x246da2){if(_0x246da2){return _0x121285[_0x5120('0x1f')](_0x1111a9)['json'](_0x246da2);}};}function respondWithFilteredResult(_0x4e0ce3,_0x103370){return function(_0x20aa5d){if(_0x20aa5d){var _0x3ba4ca=typeof _0x103370[_0x5120('0x21')]==='undefined'&&typeof _0x103370[_0x5120('0x22')]===_0x5120('0x23');var _0x23bc6d=_0x20aa5d[_0x5120('0x24')];var _0x4121f9=_0x3ba4ca?0x0:_0x103370['offset'];var _0x43861c=_0x3ba4ca?_0x20aa5d[_0x5120('0x24')]:_0x103370[_0x5120('0x21')]+_0x103370['limit'];var _0x4d621c;if(_0x43861c>=_0x23bc6d){_0x43861c=_0x23bc6d;_0x4d621c=0xc8;}else{_0x4d621c=0xce;}_0x4e0ce3['status'](_0x4d621c);return _0x4e0ce3['set']('Content-Range',_0x4121f9+'-'+_0x43861c+'/'+_0x23bc6d)['json'](_0x20aa5d);}return null;};}function saveUpdates(_0x610ad5){return function(_0x5928d4){if(_0x5928d4){return _0x5928d4['update'](_0x610ad5)[_0x5120('0x14')](function(_0x2dd467){return _0x2dd467;});}return null;};}function removeEntity(_0x5b0995){return function(_0x3e474c){if(_0x3e474c){return _0x3e474c[_0x5120('0x25')]()[_0x5120('0x14')](function(){var _0x58ab6c=_0x3e474c['get']({'plain':!![]});var _0x2f624c=_0x5120('0x26');return db[_0x5120('0x27')]['destroy']({'where':{'type':_0x2f624c,'resourceId':_0x58ab6c['id']}})[_0x5120('0x14')](function(){return _0x3e474c;});})[_0x5120('0x14')](function(){_0x5b0995[_0x5120('0x1f')](0xcc)[_0x5120('0x20')]();});}};}function handleEntityNotFound(_0x3d4046){return function(_0x43b837){if(!_0x43b837){_0x3d4046['sendStatus'](0x194);}return _0x43b837;};}function handleError(_0x18cd29,_0xa21a0c){_0xa21a0c=_0xa21a0c||0x1f4;return function(_0x31ff00){logger['error'](_0x31ff00[_0x5120('0x28')]);if(_0x31ff00[_0x5120('0x29')]){delete _0x31ff00['name'];}_0x18cd29['status'](_0xa21a0c)['send'](_0x31ff00);};}exports[_0x5120('0x2a')]=function(_0x58bfdf,_0x29c7cc){var _0x45606e={'include':[{'model':db['Pause'],'as':_0x5120('0x2b')}]},_0x386a0a={},_0x21414b={'count':0x0,'rows':[]};var _0x325ae4=_[_0x5120('0x2c')](db[_0x5120('0x2d')]['rawAttributes'],function(_0x1c8946){return{'name':_0x1c8946['fieldName'],'type':_0x1c8946['type'][_0x5120('0x2e')]};});_0x386a0a['model']=_[_0x5120('0x2c')](_0x325ae4,_0x5120('0x29'));_0x386a0a[_0x5120('0x2f')]=_[_0x5120('0x30')](_0x58bfdf['query']);_0x386a0a[_0x5120('0x31')]=_['intersection'](_0x386a0a[_0x5120('0x32')],_0x386a0a[_0x5120('0x2f')]);_0x45606e[_0x5120('0x33')]=_['intersection'](_0x386a0a[_0x5120('0x32')],qs[_0x5120('0x34')](_0x58bfdf['query'][_0x5120('0x34')]));_0x45606e[_0x5120('0x33')]=_0x45606e[_0x5120('0x33')][_0x5120('0x35')]?_0x45606e['attributes']:_0x386a0a['model'];if(!_0x58bfdf[_0x5120('0x2f')][_0x5120('0x36')](_0x5120('0x37'))){_0x45606e[_0x5120('0x22')]=qs[_0x5120('0x22')](_0x58bfdf[_0x5120('0x2f')][_0x5120('0x22')]);_0x45606e[_0x5120('0x21')]=qs[_0x5120('0x21')](_0x58bfdf[_0x5120('0x2f')][_0x5120('0x21')]);}_0x45606e[_0x5120('0x38')]=qs['sort'](_0x58bfdf[_0x5120('0x2f')][_0x5120('0x39')]);_0x45606e[_0x5120('0x3a')]=qs[_0x5120('0x31')](_[_0x5120('0x3b')](_0x58bfdf[_0x5120('0x2f')],_0x386a0a[_0x5120('0x31')]),_0x325ae4);if(_0x58bfdf[_0x5120('0x2f')][_0x5120('0x3c')]){_0x45606e[_0x5120('0x3a')]=_[_0x5120('0x3d')](_0x45606e[_0x5120('0x3a')],{'$or':_[_0x5120('0x2c')](_0x325ae4,function(_0x4c0067){if(_0x4c0067[_0x5120('0x3e')]!=='VIRTUAL'){var _0x475242={};_0x475242[_0x4c0067[_0x5120('0x29')]]={'$like':'%'+_0x58bfdf['query'][_0x5120('0x3c')]+'%'};return _0x475242;}})});}_0x45606e=_[_0x5120('0x3d')]({},_0x45606e,_0x58bfdf[_0x5120('0x3f')]);var _0x54d088={'where':_0x45606e[_0x5120('0x3a')]};return db['ChatWebsite']['count'](_0x54d088)['then'](function(_0x10c879){_0x21414b[_0x5120('0x24')]=_0x10c879;if(_0x58bfdf[_0x5120('0x2f')][_0x5120('0x40')]){_0x45606e[_0x5120('0x41')]=[{'all':!![]}];}return db[_0x5120('0x2d')][_0x5120('0x42')](_0x45606e);})['then'](function(_0xa58845){_0x21414b[_0x5120('0x43')]=_0xa58845;return _0x21414b;})[_0x5120('0x14')](respondWithFilteredResult(_0x29c7cc,_0x45606e))[_0x5120('0x1d')](handleError(_0x29c7cc,null));};exports[_0x5120('0x44')]=function(_0x2d2c20,_0x4bbc8f){var _0x5210fe={'raw':![],'where':{'id':_0x2d2c20['params']['id']},'include':[{'model':db[_0x5120('0x45')],'as':_0x5120('0x2b')}]},_0x987a54={};_0x987a54[_0x5120('0x32')]=_[_0x5120('0x30')](db['ChatWebsite'][_0x5120('0x46')]);_0x987a54[_0x5120('0x2f')]=_[_0x5120('0x30')](_0x2d2c20[_0x5120('0x2f')]);_0x987a54[_0x5120('0x31')]=_[_0x5120('0x47')](_0x987a54[_0x5120('0x32')],_0x987a54[_0x5120('0x2f')]);_0x5210fe[_0x5120('0x33')]=_['intersection'](_0x987a54['model'],qs[_0x5120('0x34')](_0x2d2c20['query'][_0x5120('0x34')]));_0x5210fe[_0x5120('0x33')]=_0x5210fe[_0x5120('0x33')]['length']?_0x5210fe[_0x5120('0x33')]:_0x987a54[_0x5120('0x32')];if(_0x2d2c20[_0x5120('0x2f')][_0x5120('0x40')]){_0x5210fe[_0x5120('0x41')]=[{'all':!![]}];}_0x5210fe=_['merge']({},_0x5210fe,_0x2d2c20[_0x5120('0x3f')]);return db[_0x5120('0x2d')][_0x5120('0x48')](_0x5210fe)[_0x5120('0x14')](handleEntityNotFound(_0x4bbc8f,null))[_0x5120('0x14')](respondWithResult(_0x4bbc8f,null))[_0x5120('0x1d')](handleError(_0x4bbc8f,null));};exports['create']=function(_0x188b3a,_0x19fae9){return db[_0x5120('0x2d')][_0x5120('0x49')](_0x188b3a['body'],{})[_0x5120('0x14')](function(_0x59cb3d){var _0x4a8ec9=_0x188b3a[_0x5120('0x4a')][_0x5120('0x4b')]({'plain':!![]});if(!_0x4a8ec9)throw new Error(_0x5120('0x4c'));if(_0x4a8ec9['role']===_0x5120('0x4a')){var _0x17aa72=_0x59cb3d[_0x5120('0x4b')]({'plain':!![]});var _0x2a9761=_0x5120('0x26');return db[_0x5120('0x4d')][_0x5120('0x48')]({'where':{'name':_0x2a9761,'userProfileId':_0x4a8ec9[_0x5120('0x4e')]},'raw':!![]})[_0x5120('0x14')](function(_0x5f4f0a){if(_0x5f4f0a&&_0x5f4f0a[_0x5120('0x4f')]===0x0){return db[_0x5120('0x27')][_0x5120('0x49')]({'name':_0x17aa72[_0x5120('0x29')],'resourceId':_0x17aa72['id'],'type':_0x5f4f0a[_0x5120('0x29')],'sectionId':_0x5f4f0a['id']},{})['then'](function(){return _0x59cb3d;});}else{return _0x59cb3d;}})['catch'](function(_0x4e5e86){logger[_0x5120('0x18')](_0x5120('0x50'),_0x4e5e86);throw _0x4e5e86;});}return _0x59cb3d;})[_0x5120('0x14')](respondWithResult(_0x19fae9,0xc9))[_0x5120('0x1d')](handleError(_0x19fae9,null));};exports['update']=function(_0x2cd490,_0xf55ee6){if(_0x2cd490[_0x5120('0x51')]['id']){delete _0x2cd490[_0x5120('0x51')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2cd490['params']['id']},'include':[{'model':db[_0x5120('0x45')],'as':_0x5120('0x2b')}]})[_0x5120('0x14')](handleEntityNotFound(_0xf55ee6,null))['then'](saveUpdates(_0x2cd490[_0x5120('0x51')],null))[_0x5120('0x14')](respondWithResult(_0xf55ee6,null))[_0x5120('0x1d')](handleError(_0xf55ee6,null));};exports[_0x5120('0x25')]=function(_0x2d00e6,_0x54bdac){return db['ChatWebsite'][_0x5120('0x48')]({'where':{'id':_0x2d00e6[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x54bdac,null))[_0x5120('0x14')](removeEntity(_0x54bdac,null))['catch'](handleError(_0x54bdac,null));};exports[_0x5120('0x53')]=function(_0x3745c5,_0x34bdad){return db[_0x5120('0x2d')][_0x5120('0x53')]()[_0x5120('0x14')](respondWithResult(_0x34bdad,null))[_0x5120('0x1d')](handleError(_0x34bdad,null));};exports[_0x5120('0x54')]=function(_0x32bb16,_0x174052){if(_0x32bb16[_0x5120('0x51')]['id']){delete _0x32bb16['body']['id'];}return db[_0x5120('0x2d')]['find']({'where':{'id':_0x32bb16['params']['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x174052,null))[_0x5120('0x14')](function(_0x43b933){if(_0x43b933){_0x32bb16['body'][_0x5120('0x55')]=_0x43b933['id'];return db['Disposition']['create'](_0x32bb16[_0x5120('0x51')]);}})['then'](respondWithResult(_0x174052,null))[_0x5120('0x1d')](handleError(_0x174052,null));};exports['getDispositions']=function(_0xb0bfa,_0x44d28a){var _0x1b2445={'raw':![],'where':{}};var _0x4be643={};var _0x4bb68a={'count':0x0,'rows':[]};return db[_0x5120('0x2d')]['findOne']({'where':{'id':_0xb0bfa[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x44d28a,null))['then'](function(_0x3c0a2a){if(_0x3c0a2a){_0x4be643[_0x5120('0x32')]=_[_0x5120('0x30')](db[_0x5120('0x56')][_0x5120('0x46')]);_0x4be643[_0x5120('0x2f')]=_[_0x5120('0x30')](_0xb0bfa[_0x5120('0x2f')]);_0x4be643[_0x5120('0x31')]=_[_0x5120('0x47')](_0x4be643[_0x5120('0x32')],_0x4be643['query']);_0x1b2445[_0x5120('0x33')]=_[_0x5120('0x47')](_0x4be643[_0x5120('0x32')],qs['fields'](_0xb0bfa[_0x5120('0x2f')][_0x5120('0x34')]));_0x1b2445[_0x5120('0x33')]=_0x1b2445[_0x5120('0x33')]['length']?_0x1b2445[_0x5120('0x33')]:_0x4be643[_0x5120('0x32')];if(!_0xb0bfa['query'][_0x5120('0x36')](_0x5120('0x37'))){_0x1b2445[_0x5120('0x22')]=qs[_0x5120('0x22')](_0xb0bfa[_0x5120('0x2f')]['limit']);_0x1b2445[_0x5120('0x21')]=qs['offset'](_0xb0bfa['query']['offset']);}_0x1b2445['order']=qs[_0x5120('0x39')](_0xb0bfa[_0x5120('0x2f')]['sort']);_0x1b2445[_0x5120('0x3a')]=qs['filters'](_[_0x5120('0x3b')](_0xb0bfa[_0x5120('0x2f')],_0x4be643['filters']));_0x1b2445[_0x5120('0x3a')]['ChatWebsiteId']=_0x3c0a2a['id'];if(_0xb0bfa[_0x5120('0x2f')][_0x5120('0x3c')]){_0x1b2445[_0x5120('0x3a')]=_['merge'](_0x1b2445[_0x5120('0x3a')],{'$or':_['map'](_0x1b2445['attributes'],function(_0x31ce20){var _0xfdf86e={};_0xfdf86e[_0x31ce20]={'$like':'%'+_0xb0bfa[_0x5120('0x2f')][_0x5120('0x3c')]+'%'};return _0xfdf86e;})});}_0x1b2445=_[_0x5120('0x3d')]({},_0x1b2445,_0xb0bfa['options']);return db['Disposition']['count']({'where':_0x1b2445[_0x5120('0x3a')]})['then'](function(_0xbbb0a2){_0x4bb68a[_0x5120('0x24')]=_0xbbb0a2;if(_0xb0bfa[_0x5120('0x2f')][_0x5120('0x40')]){_0x1b2445[_0x5120('0x41')]=[{'all':!![]}];}return db[_0x5120('0x56')]['findAll'](_0x1b2445);})[_0x5120('0x14')](function(_0x46b663){_0x4bb68a['rows']=_0x46b663;return _0x4bb68a;});}})['then'](respondWithFilteredResult(_0x44d28a,_0x1b2445))[_0x5120('0x1d')](handleError(_0x44d28a,null));};exports[_0x5120('0x57')]=function(_0x41678c,_0x4efda6){return db[_0x5120('0x2d')][_0x5120('0x48')]({'where':{'id':_0x41678c[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x4efda6,null))[_0x5120('0x14')](function(_0x2b08bc){if(_0x2b08bc){return _0x2b08bc[_0x5120('0x57')](_0x41678c[_0x5120('0x2f')][_0x5120('0x58')]);}})[_0x5120('0x14')](respondWithStatusCode(_0x4efda6,null))[_0x5120('0x1d')](handleError(_0x4efda6,null));};exports[_0x5120('0x59')]=function(_0x216fe9,_0x1aeec0){if(_0x216fe9['body']['id']){delete _0x216fe9[_0x5120('0x51')]['id'];}return db[_0x5120('0x2d')][_0x5120('0x48')]({'where':{'id':_0x216fe9[_0x5120('0x52')]['id']}})['then'](handleEntityNotFound(_0x1aeec0,null))['then'](function(_0x28656c){if(_0x28656c){_0x216fe9[_0x5120('0x51')][_0x5120('0x55')]=_0x28656c['id'];return db[_0x5120('0x5a')][_0x5120('0x49')](_0x216fe9[_0x5120('0x51')]);}})[_0x5120('0x14')](respondWithResult(_0x1aeec0,null))[_0x5120('0x1d')](handleError(_0x1aeec0,null));};exports[_0x5120('0x5b')]=function(_0x1c73d9,_0x3ac32f){var _0x57019d={'raw':![],'where':{}};var _0x433dba={};var _0x5a8c19={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5120('0x5c')]({'where':{'id':_0x1c73d9['params']['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x3ac32f,null))[_0x5120('0x14')](function(_0x2cd651){if(_0x2cd651){_0x433dba['model']=_[_0x5120('0x30')](db[_0x5120('0x5a')]['rawAttributes']);_0x433dba[_0x5120('0x2f')]=_['keys'](_0x1c73d9[_0x5120('0x2f')]);_0x433dba[_0x5120('0x31')]=_[_0x5120('0x47')](_0x433dba[_0x5120('0x32')],_0x433dba[_0x5120('0x2f')]);_0x57019d[_0x5120('0x33')]=_[_0x5120('0x47')](_0x433dba[_0x5120('0x32')],qs[_0x5120('0x34')](_0x1c73d9[_0x5120('0x2f')]['fields']));_0x57019d[_0x5120('0x33')]=_0x57019d['attributes'][_0x5120('0x35')]?_0x57019d['attributes']:_0x433dba[_0x5120('0x32')];if(!_0x1c73d9['query'][_0x5120('0x36')]('nolimit')){_0x57019d[_0x5120('0x22')]=qs['limit'](_0x1c73d9[_0x5120('0x2f')][_0x5120('0x22')]);_0x57019d[_0x5120('0x21')]=qs[_0x5120('0x21')](_0x1c73d9[_0x5120('0x2f')][_0x5120('0x21')]);}_0x57019d['order']=qs[_0x5120('0x39')](_0x1c73d9[_0x5120('0x2f')]['sort']);_0x57019d[_0x5120('0x3a')]=qs['filters'](_[_0x5120('0x3b')](_0x1c73d9[_0x5120('0x2f')],_0x433dba[_0x5120('0x31')]));_0x57019d[_0x5120('0x3a')]['ChatWebsiteId']=_0x2cd651['id'];if(_0x1c73d9[_0x5120('0x2f')]['filter']){_0x57019d['where']=_[_0x5120('0x3d')](_0x57019d[_0x5120('0x3a')],{'$or':_['map'](_0x57019d[_0x5120('0x33')],function(_0x99136c){var _0x4a4bc8={};_0x4a4bc8[_0x99136c]={'$like':'%'+_0x1c73d9[_0x5120('0x2f')][_0x5120('0x3c')]+'%'};return _0x4a4bc8;})});}_0x57019d=_[_0x5120('0x3d')]({},_0x57019d,_0x1c73d9['options']);return db[_0x5120('0x5a')]['count']({'where':_0x57019d[_0x5120('0x3a')]})[_0x5120('0x14')](function(_0x1d5019){_0x5a8c19[_0x5120('0x24')]=_0x1d5019;if(_0x1c73d9['query'][_0x5120('0x40')]){_0x57019d[_0x5120('0x41')]=[{'all':!![]}];}return db[_0x5120('0x5a')][_0x5120('0x42')](_0x57019d);})[_0x5120('0x14')](function(_0x36bae4){_0x5a8c19[_0x5120('0x43')]=_0x36bae4;return _0x5a8c19;});}})[_0x5120('0x14')](respondWithFilteredResult(_0x3ac32f,_0x57019d))[_0x5120('0x1d')](handleError(_0x3ac32f,null));};exports['removeAnswers']=function(_0x434b99,_0x25f171){return db[_0x5120('0x2d')][_0x5120('0x48')]({'where':{'id':_0x434b99['params']['id']}})['then'](handleEntityNotFound(_0x25f171,null))[_0x5120('0x14')](function(_0x31a5d4){if(_0x31a5d4){return _0x31a5d4['removeAnswers'](_0x434b99['query']['ids']);}})['then'](respondWithStatusCode(_0x25f171,null))[_0x5120('0x1d')](handleError(_0x25f171,null));};exports[_0x5120('0x5d')]=function(_0x4cef8b,_0x1e2b23){_0x4cef8b[_0x5120('0x51')]['sitepic']=_0x4cef8b['file']['filename'];return db[_0x5120('0x2d')][_0x5120('0x48')]({'where':{'id':_0x4cef8b[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x1e2b23,null))['then'](saveUpdates(_0x4cef8b[_0x5120('0x51')],null))[_0x5120('0x14')](respondWithResult(_0x1e2b23,null))[_0x5120('0x1d')](handleError(_0x1e2b23,null));};exports[_0x5120('0x5e')]=function(_0x579dab,_0x15027b){_0x579dab['body'][_0x5120('0x5f')]=_0x579dab[_0x5120('0x60')][_0x5120('0x61')];return db['ChatWebsite'][_0x5120('0x48')]({'where':{'id':_0x579dab['params']['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x15027b,null))[_0x5120('0x14')](saveUpdates(_0x579dab[_0x5120('0x51')],null))[_0x5120('0x14')](respondWithResult(_0x15027b,null))['catch'](handleError(_0x15027b,null));};exports[_0x5120('0x62')]=function(_0x2db200,_0x4fd50f){_0x2db200['body'][_0x5120('0x63')]=_0x2db200[_0x5120('0x60')]['filename'];return db[_0x5120('0x2d')][_0x5120('0x48')]({'where':{'id':_0x2db200[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x4fd50f,null))[_0x5120('0x14')](saveUpdates(_0x2db200['body'],null))[_0x5120('0x14')](respondWithResult(_0x4fd50f,null))[_0x5120('0x1d')](handleError(_0x4fd50f,null));};exports[_0x5120('0x64')]=function(_0x388410,_0x2e6195){_0x388410[_0x5120('0x51')][_0x5120('0x65')]=_0x388410[_0x5120('0x60')][_0x5120('0x61')];return db[_0x5120('0x2d')][_0x5120('0x48')]({'where':{'id':_0x388410[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x2e6195,null))[_0x5120('0x14')](saveUpdates(_0x388410[_0x5120('0x51')],null))['then'](respondWithResult(_0x2e6195,null))[_0x5120('0x1d')](handleError(_0x2e6195,null));};exports[_0x5120('0x66')]=function(_0x1d0664,_0x17bcb3){var _0x80e1f8=path[_0x5120('0x67')](config['root'],_0x5120('0x68'));var _0x1e4799={'where':{'id':_0x1d0664[_0x5120('0x52')]['id']},'attributes':['id',_0x5120('0x69')],'raw':!![]};var _0xee8266=![];return require(_0x5120('0x6a'))[_0x5120('0x6b')]()[_0x5120('0x14')](function(_0x4ba51b){if(_0x4ba51b){_0xee8266=_0x4ba51b[_0x5120('0x6c')];}})[_0x5120('0x14')](function(){return db[_0x5120('0x2d')][_0x5120('0x48')](_0x1e4799);})[_0x5120('0x14')](handleEntityNotFound(_0x17bcb3,null))[_0x5120('0x14')](function(_0x4c495a){if(_0x4c495a){if(!_['isNil'](_0x4c495a[_0x5120('0x69')])){if(fs[_0x5120('0x6d')](path[_0x5120('0x67')](config[_0x5120('0x6e')],'server/files/images/logos/',_0x4c495a[_0x5120('0x69')]))&&_0xee8266){_0x80e1f8=path[_0x5120('0x67')](config[_0x5120('0x6e')],'server/files/images/logos/',_0x4c495a[_0x5120('0x69')]);}}return _0x17bcb3[_0x5120('0x6f')](_0x80e1f8);}})[_0x5120('0x1d')](handleError(_0x17bcb3,null));};exports['getAvatar']=function(_0x1147f7,_0x4f94b){var _0x37282d=path[_0x5120('0x67')](config['root'],_0x5120('0x70'));var _0x16490a={'where':{'id':_0x1147f7[_0x5120('0x52')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x5120('0x2d')]['find'](_0x16490a)['then'](handleEntityNotFound(_0x4f94b,null))[_0x5120('0x14')](function(_0x5c0578){if(_0x5c0578){if(!_[_0x5120('0x71')](_0x5c0578[_0x5120('0x5f')])){if(fs[_0x5120('0x6d')](path['join'](config[_0x5120('0x6e')],_0x5120('0x72'),_0x5c0578[_0x5120('0x5f')]))){_0x37282d=path[_0x5120('0x67')](config['root'],_0x5120('0x72'),_0x5c0578[_0x5120('0x5f')]);}}return _0x4f94b[_0x5120('0x6f')](_0x37282d);}})[_0x5120('0x1d')](handleError(_0x4f94b,null));};exports[_0x5120('0x73')]=function(_0x4e2931,_0x41795f){var _0x5f4a9a=path[_0x5120('0x67')](config[_0x5120('0x6e')],_0x5120('0x74'));var _0xc3ff34={'where':{'id':_0x4e2931[_0x5120('0x52')]['id']},'attributes':['id',_0x5120('0x63'),_0x5120('0x75')],'raw':!![]};return db['ChatWebsite']['find'](_0xc3ff34)[_0x5120('0x14')](handleEntityNotFound(_0x41795f,null))[_0x5120('0x14')](function(_0x1c29b3){if(_0x1c29b3){if(!_['isNil'](_0x1c29b3['customerAvatar'])){if(fs[_0x5120('0x6d')](path['join'](config[_0x5120('0x6e')],'server/files/images/avatars/',_0x1c29b3['customerAvatar']))&&_0x1c29b3[_0x5120('0x75')]){_0x5f4a9a=path[_0x5120('0x67')](config[_0x5120('0x6e')],'server/files/images/avatars/',_0x1c29b3[_0x5120('0x63')]);}}return _0x41795f['download'](_0x5f4a9a);}})['catch'](handleError(_0x41795f,null));};exports[_0x5120('0x76')]=function(_0x4b5c2b,_0x1b1cdf){var _0x456d08=path['join'](config[_0x5120('0x6e')],'server/files/images/avatars/system_avatar.png');var _0x2a39cc={'where':{'id':_0x4b5c2b[_0x5120('0x52')]['id']},'attributes':['id',_0x5120('0x65')],'raw':!![]};return db[_0x5120('0x2d')]['find'](_0x2a39cc)['then'](handleEntityNotFound(_0x1b1cdf,null))[_0x5120('0x14')](function(_0x236435){if(_0x236435){if(!_['isNil'](_0x236435['systemAvatar'])){if(fs[_0x5120('0x6d')](path[_0x5120('0x67')](config[_0x5120('0x6e')],_0x5120('0x72'),_0x236435['systemAvatar']))){_0x456d08=path[_0x5120('0x67')](config[_0x5120('0x6e')],'server/files/images/avatars/',_0x236435['systemAvatar']);}}return _0x1b1cdf[_0x5120('0x6f')](_0x456d08);}})[_0x5120('0x1d')](handleError(_0x1b1cdf,null));};exports[_0x5120('0x77')]=function(_0x1e981f,_0x1ced65){var _0x1d0995=require(_0x5120('0x78'));var _0x498159=new _0x1d0995();var _0x3a99cb=_0x498159['setUA'](_0x1e981f[_0x5120('0x79')][_0x5120('0x7a')])[_0x5120('0x7b')]();var _0x2391d2={'body':_0x1e981f[_0x5120('0x51')],'channel':_0x5120('0x7c')};var _0x2c3543=[];var _0x18a5cf=[];var _0x448323={};var _0x20fbdf=![];return db[_0x5120('0x7d')]['describe']()['then'](function(_0x2a98d5){if(!_0x2a98d5){throw new db[(_0x5120('0x7e'))][(_0x5120('0x7f'))](_0x5120('0x80'));}_0x2c3543=_[_0x5120('0x81')](_['keys'](_0x2a98d5),[_0x5120('0x82'),'updatedAt']);_0x18a5cf=_['difference'](_[_0x5120('0x30')](_0x2a98d5),['createdAt','updatedAt','CompanyId','ListId']);if(_0x1e981f['body']['id']){delete _0x1e981f[_0x5120('0x51')]['id'];}if(_['isNil'](_0x1e981f['body']['from'])){throw new db['Sequelize']['ValidationError'](_0x5120('0x83'));}if(_[_0x5120('0x71')](_0x1e981f['body'][_0x5120('0x51')])||_0x1e981f['body'][_0x5120('0x51')]===''){throw new db[(_0x5120('0x7e'))]['ValidationError'](_0x5120('0x84'));}if(_['isNil'](_0x1e981f['body'][_0x5120('0x85')])){throw new db[(_0x5120('0x7e'))][(_0x5120('0x7f'))](_0x5120('0x86')+_0x18a5cf);}if(!_[_0x5120('0x87')](_0x18a5cf,_0x1e981f[_0x5120('0x51')]['mapKey'])){throw new db[(_0x5120('0x7e'))][(_0x5120('0x7f'))](_0x5120('0x88')+_0x18a5cf);}_0x448323[_0x1e981f[_0x5120('0x51')][_0x5120('0x85')]]=_0x1e981f[_0x5120('0x51')][_0x5120('0x89')];})[_0x5120('0x14')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1e981f[_0x5120('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x5120('0x8a'),'include':[{'model':db[_0x5120('0x7d')],'as':_0x5120('0x8b'),'where':_0x448323,'limit':0x1,'order':[[_0x5120('0x8c'),_0x5120('0x8d')]]}]},{'model':db[_0x5120('0x8e')],'as':'Applications'}]});})[_0x5120('0x14')](handleEntityNotFound(_0x1ced65,null))[_0x5120('0x14')](function(_0x307fad){if(_0x307fad&&_0x307fad[_0x5120('0x8a')]){_0x2391d2[_0x5120('0x8f')]=_0x307fad;_0x2391d2[_0x5120('0x90')]=_0x307fad[_0x5120('0x91')];_0x2391d2['list']=_0x307fad[_0x5120('0x8a')];_0x2391d2[_0x5120('0x90')]=_['orderBy'](_0x2391d2[_0x5120('0x90')],['priority'],[_0x5120('0x92')]);if(_0x2391d2['account']['Applications']){delete _0x2391d2[_0x5120('0x8f')]['Applications'];}if(_0x2391d2[_0x5120('0x8f')][_0x5120('0x8a')]&&_0x2391d2['account'][_0x5120('0x8a')][_0x5120('0x8b')][_0x5120('0x35')]){return _0x2391d2[_0x5120('0x8f')][_0x5120('0x8a')][_0x5120('0x8b')][0x0];}var _0x2c62f2=_[_0x5120('0xd')](_0x1e981f[_0x5120('0x51')],{'firstName':_0x1e981f[_0x5120('0x51')][_0x5120('0x89')],'ListId':_0x307fad['ListId']});_0x2c62f2[_0x1e981f[_0x5120('0x51')][_0x5120('0x85')]]=_0x1e981f['body'][_0x5120('0x89')];return db['CmContact'][_0x5120('0x49')](_0x2c62f2,{'fields':_0x2c3543,'raw':!![]});}})['then'](handleEntityNotFound(_0x1ced65,null))[_0x5120('0x14')](function(_0x21434b){_0x2391d2[_0x5120('0x93')]=_0x21434b;var _0x1b4913=_0x1e981f[_0x5120('0x51')][_0x5120('0x94')];if(_0x1e981f[_0x5120('0x79')][_0x5120('0x95')]){_0x1b4913=_0x1e981f[_0x5120('0x79')][_0x5120('0x95')];}else if(_0x1e981f[_0x5120('0x79')][_0x5120('0x96')]){_0x1b4913=_['first'](_0x1e981f[_0x5120('0x79')][_0x5120('0x96')][_0x5120('0x97')](','));}if(_0x21434b){var _0x8b70ca={'ContactId':_0x21434b['id'],'ChatWebsiteId':_0x1e981f['params']['id'],'from':(_0x21434b[_0x5120('0x98')]||'')+'\x20'+(_0x21434b[_0x5120('0x99')]||''),'customerIp':_0x1b4913,'customerPort':_0x1e981f[_0x5120('0x79')][_0x5120('0x9a')]?_0x1e981f['headers'][_0x5120('0x9a')]:null,'referer':_0x1e981f[_0x5120('0x51')]['referer'],'browserName':_0x3a99cb['browser']['name']&&_0x3a99cb['browser'][_0x5120('0x9b')]?util['format'](_0x5120('0x9c'),_0x3a99cb[_0x5120('0x9d')][_0x5120('0x29')],_0x3a99cb['browser'][_0x5120('0x9b')]):'unknown','browserVersion':_0x3a99cb['browser'][_0x5120('0x9b')]||_0x5120('0x9e'),'osName':util[_0x5120('0x9f')](_0x5120('0x9c'),_0x3a99cb['os']['name'],_0x3a99cb['os'][_0x5120('0x9b')]),'osVersion':_0x3a99cb['os'][_0x5120('0x9b')],'deviceModel':_0x3a99cb[_0x5120('0xa0')]['model']&&_0x3a99cb[_0x5120('0xa0')][_0x5120('0xa1')]?util[_0x5120('0x9f')](_0x5120('0xa2'),_0x3a99cb['device'][_0x5120('0x32')],_0x3a99cb['device']['vendor'],_0x3a99cb[_0x5120('0xa0')]['type']):null,'deviceVendor':_0x3a99cb['device'][_0x5120('0xa1')],'deviceType':_0x3a99cb[_0x5120('0xa0')][_0x5120('0x3e')],'formData':JSON[_0x5120('0xa3')](_0x1e981f[_0x5120('0x51')])};var _0x4d19de={'ChatWebsiteId':_0x1e981f[_0x5120('0x52')]['id'],'closed':![]};if(_0x1e981f[_0x5120('0x51')][_0x5120('0xa4')]){_0x4d19de[_0x5120('0xa4')]=_0x1e981f[_0x5120('0x51')]['threadId'];return db[_0x5120('0xa5')][_0x5120('0x48')]({'where':_0x4d19de})[_0x5120('0x14')](function(_0x529643){if(_0x529643){return[_0x529643,![]];}_0x8b70ca['threadId']=_0x1e981f['body'][_0x5120('0xa4')];_0x8b70ca[_0x5120('0xa6')]=_0x1e981f['body'][_0x5120('0xa6')];return db[_0x5120('0xa5')][_0x5120('0x49')](_0x8b70ca)[_0x5120('0x14')](function(_0x32f936){return[_0x32f936,!![]];});});}_0x4d19de[_0x5120('0xa7')]=_0x21434b['id'];if(_0x1e981f[_0x5120('0x51')][_0x5120('0xa8')]&&_0x1e981f['body'][_0x5120('0xa8')]['id']){_0x4d19de['id']=_0x1e981f[_0x5120('0x51')]['interaction']['id'];return db[_0x5120('0xa5')][_0x5120('0x48')]({'where':_0x4d19de})[_0x5120('0x14')](function(_0x1c856d){if(_0x1c856d){return[_0x1c856d,![]];}return db['ChatInteraction']['create'](_0x8b70ca)[_0x5120('0x14')](function(_0x159074){return[_0x159074,!![]];});});}return db[_0x5120('0xa5')]['create'](_0x8b70ca)[_0x5120('0x14')](function(_0x2443b4){return[_0x2443b4,!![]];});}})[_0x5120('0xa9')](function(_0xcfeb52,_0x44adda){if(_0xcfeb52){_0x20fbdf=_0x44adda;if(!_0x44adda){var _0x9be4c7={'from':(_0x2391d2['contact'][_0x5120('0x98')]||'')+'\x20'+(_0x2391d2[_0x5120('0x93')][_0x5120('0x99')]||'')};if(_0x1e981f[_0x5120('0x51')][_0x5120('0xa4')]&&_0x1e981f['body']['messageId']&&_0x1e981f[_0x5120('0x51')][_0x5120('0xa4')]!=_0x1e981f[_0x5120('0x51')][_0x5120('0xaa')]){_0x9be4c7[_0x5120('0xa4')]=_0x1e981f[_0x5120('0x51')]['messageId'];}return _0xcfeb52[_0x5120('0xab')](_0x9be4c7);}else{return _0xcfeb52;}}})['then'](function(_0x177bf){_0x2391d2['interaction']=_0x177bf[_0x5120('0x4b')]({'plain':!![]});_0x2391d2[_0x5120('0xa8')][_0x5120('0xac')]=_0x20fbdf;if(_0x2391d2[_0x5120('0xa8')][_0x5120('0xac')]){if(_0x2391d2[_0x5120('0x8f')][_0x5120('0xad')]){_0x2391d2[_0x5120('0x90')]['push']({'id':0x0,'priority':_0x2391d2[_0x5120('0x90')][_0x5120('0x35')]+0x1,'app':'close','appdata':_0x5120('0xae'),'interval':_0x5120('0xaf')});}}return db[_0x5120('0xb0')][_0x5120('0x49')]({'body':_0x1e981f[_0x5120('0x51')][_0x5120('0x51')],'ChatWebsiteId':_0x1e981f[_0x5120('0x52')]['id'],'ChatInteractionId':_0x177bf['id'],'direction':'in','ContactId':_0x2391d2['contact']['id'],'AttachmentId':_0x1e981f['body'][_0x5120('0xb1')]});})['then'](function(_0x522aea){_0x2391d2[_0x5120('0x1a')]=_0x522aea;if(_0x2391d2[_0x5120('0xa8')][_0x5120('0xb2')]){return db[_0x5120('0xb3')][_0x5120('0x48')]({'attributes':['id',_0x5120('0x29')],'where':{'id':_0x2391d2[_0x5120('0xa8')][_0x5120('0xb2')]}})[_0x5120('0x14')](function(_0x3d066e){if(_0x3d066e){_0x2391d2[_0x5120('0x90')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5120('0xb4'),'appdata':_0x3d066e[_0x5120('0x29')]+','+(_0x2391d2['account'][_0x5120('0xb5')]||0xa),'interval':_0x5120('0xaf')});_0x2391d2['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5120('0xb6'),_0x5120('0xb7'),_0x2391d2);});}return respondWithRpcPromise('Start',_0x5120('0xb7'),_0x2391d2);})['then'](function(_0x8dfdc3){respondWithRpcPromise('EventManager',_0x5120('0xb8'),{'event':_0x5120('0x77'),'message':_0x8dfdc3},client9002);return _0x8dfdc3;})[_0x5120('0x14')](respondWithResult(_0x1ced65,null))[_0x5120('0x1d')](handleError(_0x1ced65,null));};exports[_0x5120('0xb9')]=function(_0x4ff6ae,_0x15e521){var _0x4c0b2e,_0x566e97,_0x225e16;var _0x42771c=[];var _0x22dcae={};var _0x4d31ee=_0x4ff6ae[_0x5120('0xba')]||[];var _0x4bfb1d=[];var _0x5e805d;return db['CmContact'][_0x5120('0x53')]()[_0x5120('0x14')](function(_0xe868e6){if(!_0xe868e6){throw new db['Sequelize'][(_0x5120('0x7f'))](_0x5120('0x80'));}_0x42771c=_[_0x5120('0x81')](_['keys'](_0xe868e6),['createdAt','updatedAt','CompanyId',_0x5120('0xbb')]);if(_0x4ff6ae[_0x5120('0x51')]['id']){delete _0x4ff6ae[_0x5120('0x51')]['id'];}if(_[_0x5120('0x71')](_0x4ff6ae[_0x5120('0x51')][_0x5120('0x89')])){throw _0x15e521['status'](0x1f4)[_0x5120('0xbc')](new db['Sequelize'][(_0x5120('0x7f'))](_0x5120('0x83')));}if(_[_0x5120('0x71')](_0x4ff6ae[_0x5120('0x51')][_0x5120('0x51')])||_0x4ff6ae[_0x5120('0x51')][_0x5120('0x51')]===''){throw _0x15e521[_0x5120('0x1f')](0x1f4)['send'](new db[(_0x5120('0x7e'))][(_0x5120('0x7f'))](_0x5120('0x84')));}if(_[_0x5120('0x71')](_0x4ff6ae[_0x5120('0x51')][_0x5120('0xbd')])){throw _0x15e521[_0x5120('0x1f')](0x1f4)[_0x5120('0xbc')](new db['Sequelize'][(_0x5120('0x7f'))](_0x5120('0xbe')+_0x42771c));}if(!_[_0x5120('0x87')](_0x42771c,_0x4ff6ae[_0x5120('0x51')][_0x5120('0xbd')])){throw _0x15e521[_0x5120('0x1f')](0x1f4)['send'](new db['Sequelize'][(_0x5120('0x7f'))](_0x5120('0xbf')+_0x42771c));}_0x22dcae[_0x4ff6ae[_0x5120('0x51')][_0x5120('0xbd')]]=_0x4ff6ae['body'][_0x5120('0x89')];})[_0x5120('0x14')](function(){return db[_0x5120('0x2d')][_0x5120('0x48')]({'where':{'id':_0x4ff6ae[_0x5120('0x52')]['id']},'include':[{'model':db[_0x5120('0xc0')],'as':_0x5120('0x8a')},{'model':db[_0x5120('0xc1')],'as':_0x5120('0xc1')}]});})[_0x5120('0x14')](handleEntityNotFound(_0x15e521,null))[_0x5120('0x14')](function(_0x1506c5){if(_0x1506c5&&_0x1506c5['List']){_0x566e97=_0x1506c5;var _0x557e54=_[_0x5120('0xd')](_0x4ff6ae[_0x5120('0x51')],{'firstName':_0x4ff6ae[_0x5120('0x51')][_0x5120('0x89')],'phone':_0x4ff6ae['body']['from'],'ListId':_0x1506c5[_0x5120('0xbb')]});_0x557e54[_0x4ff6ae[_0x5120('0x51')][_0x5120('0xbd')]]=_0x4ff6ae[_0x5120('0x51')]['from'];return db['CmContact'][_0x5120('0xc2')]({'where':_0x22dcae,'defaults':_0x557e54});}})[_0x5120('0xa9')](function(_0x1500f4){if(_0x1500f4){_0x225e16=_0x1500f4;var _0x1eebd7=fs[_0x5120('0xc3')](path[_0x5120('0x67')](config[_0x5120('0x6e')],'server/files/templates/chatOfflineMessage.ejs'),_0x5120('0xc4'));var _0x4b3b61=ejs[_0x5120('0xc5')](_0x1eebd7,{'body':_[_0x5120('0xc6')](_0x4ff6ae[_0x5120('0x51')][_0x5120('0x51')]),'bodyTitle':_0x566e97[_0x5120('0xc7')]});return db['ChatOfflineMessage'][_0x5120('0x49')]({'body':_0x4b3b61,'plainBody':htmlToText[_0x5120('0xc8')](_0x4b3b61),'ContactId':_0x1500f4['id'],'ChatWebsiteId':_0x566e97['id']});}})[_0x5120('0x14')](function(_0x1e00fe){_0x5e805d=_0x1e00fe;if(_0x4d31ee['length']){var _0x1c12b3=_0x4d31ee[_0x5120('0x2c')](function(_0x4f8f96){return{'name':_0x4f8f96[_0x5120('0xc9')],'basename':_0x4f8f96[_0x5120('0x61')],'type':_0x4f8f96[_0x5120('0xca')],'ChatOfflineMessageId':_0x1e00fe['id']};});_0x4bfb1d=_0x1c12b3[_0x5120('0x2c')](_0x54486a=>{var _0x31ca34={'filename':_0x54486a[_0x5120('0x29')],'path':path[_0x5120('0x67')](config[_0x5120('0x6e')],_0x5120('0xcb'),'files','attachments','offline-chat',_0x54486a[_0x5120('0xcc')])};return _0x31ca34;});if(!_0x566e97['openNewInteraction']){return db['sequelize'][_0x5120('0xcd')](function(_0x51d2be){return db['Attachment'][_0x5120('0xce')](_0x1c12b3,{'transaction':_0x51d2be});});}}})[_0x5120('0x14')](function(){if(_0x5e805d){_0x4c0b2e=_0x5e805d;return db[_0x5120('0xc1')][_0x5120('0x5c')]({'where':{'service':!![]},'include':[{'model':db[_0x5120('0xcf')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5120('0xd0')],'as':_0x5120('0xd0'),'raw':!![]}]}]});}})[_0x5120('0x14')](function(_0x23d926){if(_0x23d926&&_0x23d926[_0x5120('0xd1')]&&_0x566e97['forwardOffline']&&_0x566e97['forwardOfflineAddress']){var _0x1b4295=_0x23d926[_0x5120('0xd2')]();return respondWithRpcPromise(_0x5120('0xd3'),_0x5120('0xd4'),{'account':_0x1b4295,'message':{'from':util[_0x5120('0x9f')](_0x5120('0xd5'),_0x23d926[_0x5120('0x29')],_0x23d926[_0x5120('0xd6')]||_0x23d926[_0x5120('0xd1')][_0x5120('0x4a')]),'to':_0x566e97[_0x5120('0xd7')],'subject':_0x566e97['offlineMessageSubject'],'html':_0x4c0b2e[_0x5120('0x51')],'attachments':_0x4bfb1d}},client9003)[_0x5120('0x14')](function(){return _0x4c0b2e;})['catch'](function(_0x341bb0){logger[_0x5120('0x18')](_0x341bb0);});}})[_0x5120('0x14')](function(){if(_0x566e97&&_0x566e97['openNewInteraction']&&_0x566e97[_0x5120('0xd8')]){var _0x3bb963=[];if(_0x4d31ee[_0x5120('0x35')]){_0x3bb963=_0x4d31ee[_0x5120('0x2c')](function(_0x9f422a){return{'name':_0x9f422a[_0x5120('0xc9')],'basename':_0x9f422a[_0x5120('0x61')],'type':_0x9f422a['mimetype'],'ChatOfflineMessageId':_0x5e805d['id']};});}var _0x42b789;if(!_['isNil'](_0x566e97[_0x5120('0xd9')])){var _0x58fcb1=_[_0x5120('0x2c')](_0x4ff6ae[_0x5120('0x51')],function(_0x467fe2){return _0x467fe2;});var _0x19aab2=_['toPairsIn'](_0x58fcb1)[0x0];var _0x50239f=_[_0x5120('0xda')](_0x19aab2,function(_0x189cab){return _0x189cab;});_0x42b789=_0x50239f[0x1][_0x566e97[_0x5120('0xd9')]];}var _0x3bd4b4={'from':_0x225e16['email'],'firstName':_0x225e16[_0x5120('0x98')],'lastName':_0x225e16['lastName'],'mapKey':'email','message':{'from':_0x225e16['email'],'to':_0x566e97[_0x5120('0xc1')]['email'],'cc':'','subject':_[_0x5120('0x71')](_0x42b789)?_0x566e97[_0x5120('0xdb')]:_0x42b789,'messageId':'','sentAt':new Date(),'attach':_0x3bb963[_0x5120('0x35')],'attachments':_0x3bb963,'originChannel':_0x5120('0xdc'),'ChatWebsiteId':_0x566e97['id'],'ChatOfflineMessageId':_0x4c0b2e['id'],'originTo':_0x566e97[_0x5120('0xc1')][_0x5120('0xd6')]},'body':_0x4c0b2e[_0x5120('0x51')]};var _0x9c5469={'account':{'id':_0x566e97['MailAccountId']},'body':_0x3bd4b4,'log':_0x5120('0xdd')};return respondWithRpcPromise(_0x5120('0xdd'),_0x5120('0xde'),_0x9c5469,client9001)[_0x5120('0x14')](function(){return _0x4c0b2e;})[_0x5120('0x1d')](function(_0x33eee2){logger['error'](_0x33eee2);});}return;})[_0x5120('0x14')](function(){if(_0x4c0b2e){return _0x4c0b2e;}})[_0x5120('0x14')](respondWithResult(_0x15e521,null))['catch'](function(_0x86297b){logger[_0x5120('0x18')]('catch',_0x86297b);for(var _0x4a87a4 of _0x4d31ee){var _0x4a065d=path[_0x5120('0x67')](config[_0x5120('0x6e')],_0x5120('0xcb'),_0x5120('0xba'),_0x5120('0xdf'),'offline-chat',_0x4a87a4[_0x5120('0x61')]);fs_extra[_0x5120('0xe0')](_0x4a065d)['catch'](function(_0x1b457a){logger[_0x5120('0x18')](_0x5120('0xe1'),_0x4a065d,_0x1b457a);});}});};exports[_0x5120('0xe2')]=function(_0x48109e,_0x4cfa0e){return db[_0x5120('0xa5')]['find']({'where':{'id':_0x48109e['params']['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x4cfa0e,null))['then'](function(_0xb457ea){if(_0xb457ea){return _0xb457ea[_0x5120('0xe2')](_0x48109e['body']['ids'],_[_0x5120('0xe3')](_0x48109e[_0x5120('0x51')],['ids','id'])||{});}})[_0x5120('0x14')](respondWithResult(_0x4cfa0e,null))[_0x5120('0x1d')](handleError(_0x4cfa0e,null));};exports['getInteractions']=function(_0x1ccdf0,_0x54782f){var _0x20e62b={'raw':![],'where':{}};var _0x448de4={};var _0x371ef6={'count':0x0,'rows':[]};return db[_0x5120('0x2d')]['findOne']({'where':{'id':_0x1ccdf0['params']['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x54782f,null))[_0x5120('0x14')](function(_0x3a3aca){if(_0x3a3aca){_0x448de4[_0x5120('0x32')]=_[_0x5120('0x30')](db[_0x5120('0xa5')][_0x5120('0x46')]);_0x448de4[_0x5120('0x2f')]=_['keys'](_0x1ccdf0[_0x5120('0x2f')]);_0x448de4[_0x5120('0x31')]=_[_0x5120('0x47')](_0x448de4[_0x5120('0x32')],_0x448de4[_0x5120('0x2f')]);_0x20e62b[_0x5120('0x33')]=_['intersection'](_0x448de4[_0x5120('0x32')],qs['fields'](_0x1ccdf0['query'][_0x5120('0x34')]));_0x20e62b['attributes']=_0x20e62b[_0x5120('0x33')][_0x5120('0x35')]?_0x20e62b[_0x5120('0x33')]:_0x448de4[_0x5120('0x32')];if(!_0x1ccdf0['query'][_0x5120('0x36')](_0x5120('0x37'))){_0x20e62b[_0x5120('0x22')]=qs[_0x5120('0x22')](_0x1ccdf0[_0x5120('0x2f')][_0x5120('0x22')]);_0x20e62b[_0x5120('0x21')]=qs['offset'](_0x1ccdf0[_0x5120('0x2f')][_0x5120('0x21')]);}_0x20e62b[_0x5120('0x38')]=qs[_0x5120('0x39')](_0x1ccdf0[_0x5120('0x2f')]['sort']);_0x20e62b['where']=qs['filters'](_['pick'](_0x1ccdf0[_0x5120('0x2f')],_0x448de4[_0x5120('0x31')]));_0x20e62b[_0x5120('0x3a')][_0x5120('0x55')]=_0x3a3aca['id'];if(_0x1ccdf0['query'][_0x5120('0x3c')]){_0x20e62b[_0x5120('0x3a')]=_[_0x5120('0x3d')](_0x20e62b[_0x5120('0x3a')],{'$or':_[_0x5120('0x2c')](_0x20e62b[_0x5120('0x33')],function(_0x1e7df4){var _0x1ea29f={};_0x1ea29f[_0x1e7df4]={'$like':'%'+_0x1ccdf0[_0x5120('0x2f')][_0x5120('0x3c')]+'%'};return _0x1ea29f;})});}_0x20e62b=_['merge']({},_0x20e62b,_0x1ccdf0[_0x5120('0x3f')]);return db[_0x5120('0xa5')]['count']({'where':_0x20e62b[_0x5120('0x3a')]})[_0x5120('0x14')](function(_0x14e3e6){_0x371ef6['count']=_0x14e3e6;if(_0x1ccdf0[_0x5120('0x2f')][_0x5120('0x40')]){_0x20e62b[_0x5120('0x41')]=[{'model':db[_0x5120('0x7d')],'as':_0x5120('0xe4'),'required':![]},{'model':db[_0x5120('0xb3')],'as':'Owner','attributes':[_0x5120('0x29'),'fullname',_0x5120('0xe5')],'required':![]},{'model':db['Tag'],'as':_0x5120('0xe6'),'attributes':['id',_0x5120('0x29'),_0x5120('0xe7')],'where':_0x1ccdf0[_0x5120('0x2f')][_0x5120('0xe8')]?{'id':_0x1ccdf0[_0x5120('0x2f')]['tag']}:undefined,'required':_0x1ccdf0[_0x5120('0x2f')]['tag']?!![]:![]}];}return db[_0x5120('0xa5')][_0x5120('0x42')](_0x20e62b);})['then'](function(_0xeb3080){_0x371ef6[_0x5120('0x43')]=_0xeb3080;return _0x371ef6;});}})[_0x5120('0x14')](respondWithFilteredResult(_0x54782f,_0x20e62b))[_0x5120('0x1d')](handleError(_0x54782f,null));};function iftimePromise(_0x480ef6,_0x4f4942){return respondWithRpcPromise(_0x5120('0xe9'),_0x5120('0xea'),{'command':_0x4f4942['timezone']?util[_0x5120('0x9f')](_0x5120('0xeb'),_0x480ef6[_0x5120('0xec')],_0x4f4942['timezone']):util['format'](_0x5120('0xed'),_0x480ef6[_0x5120('0xec')])},client9002)[_0x5120('0x14')](function(_0x37c2e6){var _0x4a00ad=_0x37c2e6&&_0x37c2e6[_0x5120('0xee')](_0x5120('0xef'))>=0x0?!![]:![];logger[_0x5120('0x15')](_0x5120('0xf0'),_0x4f4942['id'],_0x480ef6['id'],_0x480ef6[_0x5120('0xec')],_0x4a00ad?_0x5120('0xf1'):_0x5120('0xf2'),_0x4f4942[_0x5120('0xf3')]?_0x4f4942['timezone']:_0x5120('0xf4'));return _0x4a00ad;})[_0x5120('0x1d')](function(_0x5a7c60){logger[_0x5120('0x18')](_0x5120('0xf0'),_0x4f4942['id'],_0x480ef6['id'],_0x480ef6['interval'],util[_0x5120('0xf5')](_0x5a7c60,{'showHidden':![],'depth':null}),_0x4f4942[_0x5120('0xf3')]?_0x4f4942[_0x5120('0xf3')]:_0x5120('0xf4'));return![];});}exports['getSnippet']=function(_0x411159,_0x373603){var _0x4abd7f=0x0;var _0x40ea67=0x0;var _0x33fa57=![];var _0x458673;var _0x17961e;return db['ChatWebsite'][_0x5120('0x48')]({'where':{'id':_0x411159[_0x5120('0x52')]['id']},'include':[{'model':db[_0x5120('0xf6')],'as':'Interval','include':[{'model':db[_0x5120('0xf6')],'as':'Intervals','attributes':['id',_0x5120('0xec')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x373603,null))[_0x5120('0x14')](function(_0x247e06){if(_0x247e06){_0x458673=_0x247e06;return _0x247e06[_0x5120('0xf7')]({'raw':!![]});}})[_0x5120('0x14')](function(_0x565b22){if(_0x458673){if(_0x565b22){_0x17961e=_0x565b22;}}return require('../../config/license/util')[_0x5120('0x6b')]();})[_0x5120('0x14')](function(_0x52c237){if(_0x52c237){_0x40ea67=_0x52c237[_0x5120('0xf8')];_0x33fa57=_0x52c237[_0x5120('0x6c')];}})['then'](function(){return db[_0x5120('0xa5')][_0x5120('0x24')]({'where':{'closed':![]}});})['then'](function(_0x30b477){_0x4abd7f=_0x30b477;if(_0x40ea67&&_0x30b477>_0x40ea67){return db[_0x5120('0xf9')][_0x5120('0x5c')]({'where':{'id':0x1}})['then'](function(_0x1de1c0){if(_0x1de1c0){_0x1de1c0[_0x5120('0xfa')](_0x5120('0xfb'));}});}})[_0x5120('0x14')](function(){if(_0x458673[_0x5120('0xf6')]&&_0x458673[_0x5120('0xf6')]['Intervals']){var _0xf60abe=[];for(var _0x2d85a5=0x0;_0x2d85a5<_0x458673[_0x5120('0xf6')]['Intervals']['length'];_0x2d85a5++){var _0x14ff0f=_0x458673[_0x5120('0xf6')][_0x5120('0xfc')][_0x2d85a5][_0x5120('0x4b')]({'plain':!![]});_0xf60abe[_0x5120('0xfd')](iftimePromise(_0x14ff0f,_0x458673));}return BPromise[_0x5120('0xfe')](_0xf60abe)[_0x5120('0x14')](function(_0x277737){return _[_0x5120('0xff')](_0x277737);});}else{return!![];}})['then'](function(_0x1c79bc){var _0x573fb1=fs[_0x5120('0xc3')](path[_0x5120('0x67')](config[_0x5120('0x6e')],'server/files/chat/iframe.ejs'),'utf8');var _0x30947d={'remote':_0x458673[_0x5120('0x100')],'query':querystring[_0x5120('0xa3')](_[_0x5120('0x3d')](_0x458673[_0x5120('0x4b')]({'plain':!![]}),{'customerIp':_0x411159[_0x5120('0x79')][_0x5120('0x96')]||_0x411159['headers'][_0x5120('0x101')]||_0x411159['connection'][_0x5120('0x102')]||_0x411159['ip'],'referer':_0x411159[_0x5120('0x79')][_0x5120('0x103')],'openedInteractions':_0x4abd7f,'maxInteractions':_0x40ea67,'virtual':_0x33fa57[_0x5120('0xf8')],'online':_0x1c79bc,'custom':_0x33fa57}))['replace'](/'/g,'\x5c\x27')};_0x373603['send'](ejs[_0x5120('0xc5')](Mustache[_0x5120('0xc5')](_0x573fb1,_0x30947d),{'proactiveActions':_0x17961e,'alignment':_0x458673[_0x5120('0x104')],'verticalAlignment':_0x458673[_0x5120('0x105')],'div_color':_0x458673[_0x5120('0xe7')],'labelText':_0x458673[_0x5120('0x106')],'text_color':_0x458673[_0x5120('0x107')],'text_button_color':_0x458673['textButtonColor'],'button_color':_0x458673[_0x5120('0x108')],'background_color':_0x458673['backgroundColor'],'hideWhenOffline':_0x458673[_0x5120('0x109')],'interval':_0x458673[_0x5120('0x10a')]}));})[_0x5120('0x1d')](handleError(_0x373603,null));};exports['addApplications']=function(_0x508a9f,_0x3f0d37){var _0x2ba348=_0x508a9f[_0x5120('0x52')]['id'];var _0x1e010e=_0x508a9f['body'];var _0x570527=0xc8;var _0x1c4df4=null;return db['sequelize'][_0x5120('0xcd')]({'isolationLevel':db[_0x5120('0x10b')][_0x5120('0x10c')]['ISOLATION_LEVELS'][_0x5120('0x10d')]},function(_0x19e7a1){return db[_0x5120('0x2d')]['findOne']({'where':{'id':_0x2ba348},'transaction':_0x19e7a1})['then'](function(_0x40d387){if(_0x40d387){return db[_0x5120('0x8e')][_0x5120('0x25')]({'where':{'ChatWebsiteId':_0x2ba348},'transaction':_0x19e7a1})[_0x5120('0x14')](function(){var _0x134efe=_['map'](_0x1e010e,function(_0x446199){_0x446199['ChatWebsiteId']=_0x2ba348;return _0x446199;});return db['ChatApplication'][_0x5120('0xce')](_0x134efe,{'transaction':_0x19e7a1});});}else{_0x570527=0x194;_0x1c4df4=[];}});})['then'](function(){if(_0x570527!==0x194){return db[_0x5120('0x8e')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2ba348},'order':_0x5120('0x10e')})['then'](function(_0x2bd012){_0x1c4df4=_0x2bd012;});}})[_0x5120('0x1d')](function(_0xb90b83){_0x570527=0x1f4;logger[_0x5120('0x18')](_0xb90b83[_0x5120('0x28')]);if(_0xb90b83[_0x5120('0x29')]){delete _0xb90b83[_0x5120('0x29')];}_0x1c4df4=_0xb90b83;})[_0x5120('0x10f')](function(){if(_0x1c4df4===null){_0x3f0d37[_0x5120('0x1e')](_0x570527);}else{if(_0x570527===0x1f4){_0x3f0d37[_0x5120('0x1f')](_0x570527)[_0x5120('0xbc')](_0x1c4df4);}else{_0x3f0d37[_0x5120('0x1f')](_0x570527)[_0x5120('0x110')](_0x1c4df4);}}});};exports[_0x5120('0x111')]=function(_0x4803d0,_0x4d3117){var _0x4d0ba1={};var _0x43e33e={};var _0x4b16c7;var _0x395451;return db[_0x5120('0x2d')][_0x5120('0x5c')]({'where':{'id':_0x4803d0[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x4d3117,null))[_0x5120('0x14')](function(_0x14675a){if(_0x14675a){_0x4b16c7=_0x14675a;_0x43e33e[_0x5120('0x32')]=_['keys'](db['ChatApplication'][_0x5120('0x46')]);_0x43e33e[_0x5120('0x2f')]=_['keys'](_0x4803d0[_0x5120('0x2f')]);_0x43e33e[_0x5120('0x31')]=_['intersection'](_0x43e33e[_0x5120('0x32')],_0x43e33e['query']);_0x4d0ba1[_0x5120('0x33')]=_[_0x5120('0x47')](_0x43e33e[_0x5120('0x32')],qs['fields'](_0x4803d0[_0x5120('0x2f')][_0x5120('0x34')]));_0x4d0ba1[_0x5120('0x33')]=_0x4d0ba1[_0x5120('0x33')][_0x5120('0x35')]?_0x4d0ba1['attributes']:_0x43e33e[_0x5120('0x32')];_0x4d0ba1['order']=qs[_0x5120('0x39')](_0x4803d0['query'][_0x5120('0x39')]);_0x4d0ba1[_0x5120('0x3a')]=qs[_0x5120('0x31')](_[_0x5120('0x3b')](_0x4803d0[_0x5120('0x2f')],_0x43e33e[_0x5120('0x31')]));if(_0x4803d0['query']['filter']){_0x4d0ba1[_0x5120('0x3a')]=_[_0x5120('0x3d')](_0x4d0ba1[_0x5120('0x3a')],{'$or':_[_0x5120('0x2c')](_0x4d0ba1[_0x5120('0x33')],function(_0x53f461){var _0x1d622b={};_0x1d622b[_0x53f461]={'$like':'%'+_0x4803d0[_0x5120('0x2f')]['filter']+'%'};return _0x1d622b;})});}_0x4d0ba1=_[_0x5120('0x3d')]({},_0x4d0ba1,_0x4803d0[_0x5120('0x3f')]);return _0x4b16c7[_0x5120('0x111')](_0x4d0ba1);}})['then'](function(_0x327adc){if(_0x327adc){_0x395451=_0x327adc[_0x5120('0x35')];if(!_0x4803d0[_0x5120('0x2f')][_0x5120('0x36')](_0x5120('0x37'))){_0x4d0ba1[_0x5120('0x22')]=qs['limit'](_0x4803d0[_0x5120('0x2f')][_0x5120('0x22')]);_0x4d0ba1[_0x5120('0x21')]=qs[_0x5120('0x21')](_0x4803d0[_0x5120('0x2f')][_0x5120('0x21')]);}return _0x4b16c7[_0x5120('0x111')](_0x4d0ba1);}})[_0x5120('0x14')](function(_0x25188d){if(_0x25188d){return _0x25188d?{'count':_0x395451,'rows':_0x25188d}:null;}})['then'](respondWithResult(_0x4d3117,null))[_0x5120('0x1d')](handleError(_0x4d3117,null));};exports[_0x5120('0x112')]=function(_0x2f62ea,_0x5ad9b4){return db[_0x5120('0x113')]['find']({'where':{'id':_0x2f62ea['params']['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x5ad9b4,null))[_0x5120('0x14')](function(_0x4ff412){if(_0x4ff412){return _0x4ff412['addProactiveActions'](_0x2f62ea[_0x5120('0x51')][_0x5120('0x58')],_['omit'](_0x2f62ea[_0x5120('0x51')],[_0x5120('0x58'),'id'])||{});}})[_0x5120('0x14')](respondWithResult(_0x5ad9b4,null))[_0x5120('0x1d')](handleError(_0x5ad9b4,null));};exports[_0x5120('0xf7')]=function(_0xff4a7c,_0x3de40d){var _0x6c0d78={};var _0xd8293c={};var _0x14a4db;var _0x28ac09;return db[_0x5120('0x2d')]['findOne']({'where':{'id':_0xff4a7c[_0x5120('0x52')]['id']}})['then'](handleEntityNotFound(_0x3de40d,null))[_0x5120('0x14')](function(_0x58eb44){if(_0x58eb44){_0x14a4db=_0x58eb44;_0xd8293c[_0x5120('0x32')]=_[_0x5120('0x30')](db['ChatProactiveAction'][_0x5120('0x46')]);_0xd8293c[_0x5120('0x2f')]=_['keys'](_0xff4a7c[_0x5120('0x2f')]);_0xd8293c[_0x5120('0x31')]=_[_0x5120('0x47')](_0xd8293c[_0x5120('0x32')],_0xd8293c[_0x5120('0x2f')]);_0x6c0d78[_0x5120('0x33')]=_['intersection'](_0xd8293c[_0x5120('0x32')],qs[_0x5120('0x34')](_0xff4a7c[_0x5120('0x2f')][_0x5120('0x34')]));_0x6c0d78[_0x5120('0x33')]=_0x6c0d78[_0x5120('0x33')][_0x5120('0x35')]?_0x6c0d78['attributes']:_0xd8293c[_0x5120('0x32')];_0x6c0d78[_0x5120('0x38')]=qs[_0x5120('0x39')](_0xff4a7c[_0x5120('0x2f')][_0x5120('0x39')]);_0x6c0d78[_0x5120('0x3a')]=qs[_0x5120('0x31')](_['pick'](_0xff4a7c[_0x5120('0x2f')],_0xd8293c[_0x5120('0x31')]));if(_0xff4a7c[_0x5120('0x2f')][_0x5120('0x3c')]){_0x6c0d78[_0x5120('0x3a')]=_['merge'](_0x6c0d78[_0x5120('0x3a')],{'$or':_['map'](_0x6c0d78['attributes'],function(_0x4786dc){var _0x192e47={};_0x192e47[_0x4786dc]={'$like':'%'+_0xff4a7c[_0x5120('0x2f')][_0x5120('0x3c')]+'%'};return _0x192e47;})});}_0x6c0d78=_[_0x5120('0x3d')]({},_0x6c0d78,_0xff4a7c[_0x5120('0x3f')]);return _0x14a4db[_0x5120('0xf7')](_0x6c0d78);}})[_0x5120('0x14')](function(_0x1cba6c){if(_0x1cba6c){_0x28ac09=_0x1cba6c[_0x5120('0x35')];if(!_0xff4a7c[_0x5120('0x2f')]['hasOwnProperty'](_0x5120('0x37'))){_0x6c0d78[_0x5120('0x22')]=qs[_0x5120('0x22')](_0xff4a7c[_0x5120('0x2f')][_0x5120('0x22')]);_0x6c0d78['offset']=qs[_0x5120('0x21')](_0xff4a7c[_0x5120('0x2f')][_0x5120('0x21')]);}return _0x14a4db[_0x5120('0xf7')](_0x6c0d78);}})[_0x5120('0x14')](function(_0x40e58c){if(_0x40e58c){return _0x40e58c?{'count':_0x28ac09,'rows':_0x40e58c}:null;}})[_0x5120('0x14')](respondWithResult(_0x3de40d,null))[_0x5120('0x1d')](handleError(_0x3de40d,null));};exports[_0x5120('0x114')]=function(_0x4b4454,_0x298306){var _0x6a50a6=_0x4b4454[_0x5120('0x2f')][_0x5120('0x115')]===_0x5120('0x116')?_0x5120('0x117'):_0x5120('0x118');return db[_0x5120('0x2d')][_0x5120('0x48')]({'attributes':['id',_0x6a50a6],'where':{'id':_0x4b4454[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x298306,null))[_0x5120('0x14')](function(_0x206fef){if(_0x206fef){var _0xd2770d=_0x206fef[_0x6a50a6];var _0x39f7e4=_0xd2770d&&_0xd2770d[_0x5120('0x119')]?_0xd2770d['items']:[];_0x298306[_0x5120('0xbc')]({'fromKey':_[_0x5120('0x71')](_0xd2770d['fromKey'])?undefined:_0xd2770d[_0x5120('0x11a')],'count':_0x39f7e4[_0x5120('0x35')],'rows':_0x39f7e4});}})['catch'](handleError(_0x298306,null));};exports['getOfflineMessages']=function(_0x589022,_0x39499f){var _0x44c2b0={'raw':![],'where':{}};var _0x17180a={};var _0x355915={'count':0x0,'rows':[]};return db[_0x5120('0x2d')][_0x5120('0x5c')]({'where':{'id':_0x589022[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x39499f,null))[_0x5120('0x14')](function(_0x41bb5b){if(_0x41bb5b){_0x17180a[_0x5120('0x32')]=_['keys'](db[_0x5120('0x11b')][_0x5120('0x46')]);_0x17180a[_0x5120('0x2f')]=_['keys'](_0x589022[_0x5120('0x2f')]);_0x17180a['filters']=_[_0x5120('0x47')](_0x17180a['model'],_0x17180a[_0x5120('0x2f')]);_0x44c2b0[_0x5120('0x33')]=_[_0x5120('0x47')](_0x17180a[_0x5120('0x32')],qs[_0x5120('0x34')](_0x589022['query'][_0x5120('0x34')]));_0x44c2b0[_0x5120('0x33')]=_0x44c2b0[_0x5120('0x33')][_0x5120('0x35')]?_0x44c2b0[_0x5120('0x33')]:_0x17180a[_0x5120('0x32')];if(!_0x589022[_0x5120('0x2f')]['hasOwnProperty'](_0x5120('0x37'))){_0x44c2b0[_0x5120('0x22')]=qs[_0x5120('0x22')](_0x589022[_0x5120('0x2f')][_0x5120('0x22')]);_0x44c2b0[_0x5120('0x21')]=qs[_0x5120('0x21')](_0x589022[_0x5120('0x2f')][_0x5120('0x21')]);}_0x44c2b0[_0x5120('0x38')]=qs[_0x5120('0x39')](_0x589022['query']['sort']);_0x44c2b0[_0x5120('0x3a')]=qs[_0x5120('0x31')](_['pick'](_0x589022[_0x5120('0x2f')],_0x17180a['filters']));_0x44c2b0[_0x5120('0x3a')][_0x5120('0x55')]=_0x41bb5b['id'];if(_0x589022[_0x5120('0x2f')][_0x5120('0x3c')]){_0x44c2b0[_0x5120('0x3a')]=_['merge'](_0x44c2b0[_0x5120('0x3a')],{'$or':_[_0x5120('0x2c')](_0x44c2b0['attributes'],function(_0x11fa9a){var _0x50b2fe={};_0x50b2fe[_0x11fa9a]={'$like':'%'+_0x589022['query'][_0x5120('0x3c')]+'%'};return _0x50b2fe;})});}_0x44c2b0=_[_0x5120('0x3d')]({},_0x44c2b0,_0x589022[_0x5120('0x3f')]);return db[_0x5120('0x11b')][_0x5120('0x24')]({'where':_0x44c2b0[_0x5120('0x3a')]})[_0x5120('0x14')](function(_0x542a0e){_0x355915[_0x5120('0x24')]=_0x542a0e;if(_0x589022['query']['includeAll']){_0x44c2b0[_0x5120('0x41')]=[{'all':!![]}];}else{_0x44c2b0[_0x5120('0x41')]=[{'model':db[_0x5120('0x7d')],'as':_0x5120('0xe4'),'required':![]},{'model':db['Attachment'],'as':_0x5120('0x11c'),'required':![]}];}return db[_0x5120('0x11b')][_0x5120('0x42')](_0x44c2b0);})[_0x5120('0x14')](function(_0x5c503c){_0x355915[_0x5120('0x43')]=_0x5c503c;return _0x355915;});}})[_0x5120('0x14')](respondWithFilteredResult(_0x39499f,_0x44c2b0))[_0x5120('0x1d')](handleError(_0x39499f,null));};exports[_0x5120('0x11d')]=function(_0x5a043f,_0xbe85f3){return db[_0x5120('0x2d')][_0x5120('0x48')]({'where':{'id':_0x5a043f['params']['id']}})[_0x5120('0x14')](handleEntityNotFound(_0xbe85f3,null))[_0x5120('0x14')](function(_0x46373e){if(_0x46373e){return _0x46373e['addAgents'](_0x5a043f[_0x5120('0x51')][_0x5120('0x58')],_[_0x5120('0xe3')](_0x5a043f[_0x5120('0x51')],['ids','id'])||{})['spread'](function(_0x2947ee){for(var _0x5811d1=0x0;_0x5811d1<_0x5a043f[_0x5120('0x51')][_0x5120('0x58')]['length'];_0x5811d1+=0x1){socket[_0x5120('0x11e')](_0x5120('0x11f'),{'UserId':Number(_0x5a043f[_0x5120('0x51')][_0x5120('0x58')][_0x5811d1]),'ChatWebsiteId':Number(_0x5a043f[_0x5120('0x52')]['id'])});}return _0x2947ee;});}})[_0x5120('0x14')](respondWithResult(_0xbe85f3,null))[_0x5120('0x1d')](handleError(_0xbe85f3,null));};exports[_0x5120('0x120')]=function(_0x468476,_0x313f61){return db['ChatWebsite'][_0x5120('0x48')]({'where':{'id':_0x468476['params']['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x313f61,null))[_0x5120('0x14')](function(_0x1276d7){if(_0x1276d7){return _0x1276d7[_0x5120('0x120')](_0x468476[_0x5120('0x2f')][_0x5120('0x58')])[_0x5120('0x14')](function(){if(_[_0x5120('0x121')](_0x468476[_0x5120('0x2f')][_0x5120('0x58')])){for(var _0x141af7=0x0;_0x141af7<_0x468476[_0x5120('0x2f')][_0x5120('0x58')][_0x5120('0x35')];_0x141af7+=0x1){socket['emit'](_0x5120('0x122'),{'UserId':Number(_0x468476['query'][_0x5120('0x58')][_0x141af7]),'ChatWebsiteId':Number(_0x468476[_0x5120('0x52')]['id'])});}}else{socket['emit'](_0x5120('0x122'),{'UserId':Number(_0x468476[_0x5120('0x2f')]['ids']),'ChatWebsiteId':Number(_0x468476['params']['id'])});}});}})[_0x5120('0x14')](respondWithStatusCode(_0x313f61,null))[_0x5120('0x1d')](handleError(_0x313f61,null));};exports[_0x5120('0x123')]=function(_0x21d198,_0x5bf29e){var _0x349496={};var _0x9a7322={};var _0x52706a;var _0x333cd9;return db[_0x5120('0x2d')][_0x5120('0x5c')]({'where':{'id':_0x21d198[_0x5120('0x52')]['id']}})[_0x5120('0x14')](handleEntityNotFound(_0x5bf29e,null))[_0x5120('0x14')](function(_0x1eee74){if(_0x1eee74){_0x52706a=_0x1eee74;_0x9a7322['model']=_[_0x5120('0x30')](db[_0x5120('0xb3')]['rawAttributes']);_0x9a7322[_0x5120('0x2f')]=_[_0x5120('0x30')](_0x21d198[_0x5120('0x2f')]);_0x9a7322[_0x5120('0x31')]=_['intersection'](_0x9a7322[_0x5120('0x32')],_0x9a7322[_0x5120('0x2f')]);_0x349496[_0x5120('0x33')]=_[_0x5120('0x47')](_0x9a7322[_0x5120('0x32')],qs[_0x5120('0x34')](_0x21d198[_0x5120('0x2f')][_0x5120('0x34')]));_0x349496[_0x5120('0x33')]=_0x349496[_0x5120('0x33')][_0x5120('0x35')]?_0x349496['attributes']:_0x9a7322[_0x5120('0x32')];_0x349496[_0x5120('0x38')]=qs['sort'](_0x21d198['query']['sort']);_0x349496['where']=qs[_0x5120('0x31')](_[_0x5120('0x3b')](_0x21d198[_0x5120('0x2f')],_0x9a7322['filters']));if(_0x21d198[_0x5120('0x2f')][_0x5120('0x3c')]){_0x349496[_0x5120('0x3a')]=_['merge'](_0x349496[_0x5120('0x3a')],{'$or':_[_0x5120('0x2c')](_0x349496[_0x5120('0x33')],function(_0x29642e){var _0x3dca4c={};_0x3dca4c[_0x29642e]={'$like':'%'+_0x21d198[_0x5120('0x2f')]['filter']+'%'};return _0x3dca4c;})});}_0x349496=_[_0x5120('0x3d')]({},_0x349496,_0x21d198[_0x5120('0x3f')]);return _0x52706a[_0x5120('0x123')](_0x349496);}})['then'](function(_0x5897b2){if(_0x5897b2){_0x333cd9=_0x5897b2['length'];if(!_0x21d198[_0x5120('0x2f')]['hasOwnProperty']('nolimit')){_0x349496['limit']=qs[_0x5120('0x22')](_0x21d198[_0x5120('0x2f')][_0x5120('0x22')]);_0x349496[_0x5120('0x21')]=qs[_0x5120('0x21')](_0x21d198[_0x5120('0x2f')]['offset']);}return _0x52706a[_0x5120('0x123')](_0x349496);}})['then'](function(_0x54a159){if(_0x54a159){return _0x54a159?{'count':_0x333cd9,'rows':_0x54a159}:null;}})[_0x5120('0x14')](respondWithResult(_0x5bf29e,null))[_0x5120('0x1d')](handleError(_0x5bf29e,null));}; \ No newline at end of file +var _0x9bb1=['readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','files','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','info','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','../../config/license/util','License','increment','chatLicenseExceeded','push','all','server/files/chat/iframe.ejs','remote','connection','remoteAddress','referer','virtual','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','ChatOfflineMessage','Attachment','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','Content-Range','update','destroy','get','ChatWebsites','sendStatus','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','describe','Disposition','getDispositions','findOne','pick','rows','removeDispositions','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','join','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','download','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','account','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','format','version','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','applications','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate'];(function(_0x53a7b8,_0x4f3f47){var _0x104501=function(_0x51f97b){while(--_0x51f97b){_0x53a7b8['push'](_0x53a7b8['shift']());}};_0x104501(++_0x4f3f47);}(_0x9bb1,0x18c));var _0x19bb=function(_0x38a170,_0x35c240){_0x38a170=_0x38a170-0x0;var _0x5057cf=_0x9bb1[_0x38a170];return _0x5057cf;};'use strict';var BPromise=require(_0x19bb('0x0'));var Mustache=require(_0x19bb('0x1'));var util=require('util');var path=require(_0x19bb('0x2'));var ejs=require(_0x19bb('0x3'));var fs=require('fs');var fs_extra=require(_0x19bb('0x4'));var _=require(_0x19bb('0x5'));var querystring=require(_0x19bb('0x6'));var Redis=require('ioredis');var qs=require(_0x19bb('0x7'));var logger=require(_0x19bb('0x8'))(_0x19bb('0x9'));var config=require(_0x19bb('0xa'));var db=require('../../mysqldb')['db'];config[_0x19bb('0xb')]=_[_0x19bb('0xc')](config[_0x19bb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x19bb('0xd'))(new Redis(config[_0x19bb('0xb')]));require('./chatWebsite.socket')[_0x19bb('0xe')](socket);var htmlToText=require(_0x19bb('0xf'));var jayson=require(_0x19bb('0x10'));var client=jayson[_0x19bb('0x11')][_0x19bb('0x12')]({'port':0x232c});var client9002=jayson[_0x19bb('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x19bb('0x11')]['http']({'port':0x232b});var client9001=jayson[_0x19bb('0x11')][_0x19bb('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x14fb24,_0x3cf8d3,_0x13532a,_0x1ec0d0){return new BPromise(function(_0x297263,_0x316881){var _0x441503=_0x1ec0d0||client;return _0x441503[_0x19bb('0x13')](_0x14fb24,_0x13532a)[_0x19bb('0x14')](function(_0x55fb67){logger['info'](_0x19bb('0x15'),_0x3cf8d3,_0x19bb('0x16'));logger[_0x19bb('0x17')](_0x19bb('0x18'),_0x3cf8d3,_0x19bb('0x16'),JSON[_0x19bb('0x19')](_0x55fb67));if(_0x55fb67['error']){if(_0x55fb67[_0x19bb('0x1a')][_0x19bb('0x1b')]===0x1f4){logger[_0x19bb('0x1a')](_0x19bb('0x15'),_0x3cf8d3,_0x55fb67[_0x19bb('0x1a')][_0x19bb('0x1c')]);return _0x316881(_0x55fb67[_0x19bb('0x1a')][_0x19bb('0x1c')]);}logger[_0x19bb('0x1a')](_0x19bb('0x15'),_0x3cf8d3,_0x55fb67[_0x19bb('0x1a')]['message']);return _0x297263(_0x55fb67[_0x19bb('0x1a')]['message']);}else{logger['info'](_0x19bb('0x15'),_0x3cf8d3,_0x19bb('0x16'));_0x297263(_0x55fb67[_0x19bb('0x1d')][_0x19bb('0x1c')]);}})[_0x19bb('0x1e')](function(_0x55327a){logger[_0x19bb('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x3cf8d3,_0x55327a);_0x316881(_0x55327a);});});}function respondWithStatusCode(_0x4d98c0,_0x3bbbc0){_0x3bbbc0=_0x3bbbc0||0xcc;return function(_0x2ae185){if(_0x2ae185){return _0x4d98c0['sendStatus'](_0x3bbbc0);}return _0x4d98c0[_0x19bb('0x1f')](_0x3bbbc0)[_0x19bb('0x20')]();};}function respondWithResult(_0x51eb3d,_0x4bc2e2){_0x4bc2e2=_0x4bc2e2||0xc8;return function(_0x419de3){if(_0x419de3){return _0x51eb3d[_0x19bb('0x1f')](_0x4bc2e2)[_0x19bb('0x21')](_0x419de3);}};}function respondWithFilteredResult(_0x222bcc,_0x3b3929){return function(_0x3c44cc){if(_0x3c44cc){var _0x2463dd=typeof _0x3b3929[_0x19bb('0x22')]===_0x19bb('0x23')&&typeof _0x3b3929[_0x19bb('0x24')]===_0x19bb('0x23');var _0x731243=_0x3c44cc['count'];var _0x593dc5=_0x2463dd?0x0:_0x3b3929[_0x19bb('0x22')];var _0x4616cb=_0x2463dd?_0x3c44cc['count']:_0x3b3929[_0x19bb('0x22')]+_0x3b3929[_0x19bb('0x24')];var _0x2b4c43;if(_0x4616cb>=_0x731243){_0x4616cb=_0x731243;_0x2b4c43=0xc8;}else{_0x2b4c43=0xce;}_0x222bcc[_0x19bb('0x1f')](_0x2b4c43);return _0x222bcc['set'](_0x19bb('0x25'),_0x593dc5+'-'+_0x4616cb+'/'+_0x731243)[_0x19bb('0x21')](_0x3c44cc);}return null;};}function saveUpdates(_0x418ca8){return function(_0x45be02){if(_0x45be02){return _0x45be02[_0x19bb('0x26')](_0x418ca8)[_0x19bb('0x14')](function(_0x54dd43){return _0x54dd43;});}return null;};}function removeEntity(_0x10d789){return function(_0x3d6c23){if(_0x3d6c23){return _0x3d6c23[_0x19bb('0x27')]()[_0x19bb('0x14')](function(){var _0x4f5eba=_0x3d6c23[_0x19bb('0x28')]({'plain':!![]});var _0x3c008d=_0x19bb('0x29');return db['UserProfileResource'][_0x19bb('0x27')]({'where':{'type':_0x3c008d,'resourceId':_0x4f5eba['id']}})['then'](function(){return _0x3d6c23;});})[_0x19bb('0x14')](function(){_0x10d789[_0x19bb('0x1f')](0xcc)[_0x19bb('0x20')]();});}};}function handleEntityNotFound(_0x3fbd0f){return function(_0x47e41b){if(!_0x47e41b){_0x3fbd0f[_0x19bb('0x2a')](0x194);}return _0x47e41b;};}function handleError(_0x44a24f,_0x52efce){_0x52efce=_0x52efce||0x1f4;return function(_0x43f8e0){logger['error'](_0x43f8e0['stack']);if(_0x43f8e0[_0x19bb('0x2b')]){delete _0x43f8e0[_0x19bb('0x2b')];}_0x44a24f[_0x19bb('0x1f')](_0x52efce)[_0x19bb('0x2c')](_0x43f8e0);};}exports['index']=function(_0xa779ac,_0x2cdd97){var _0x2d38f2={'include':[{'model':db[_0x19bb('0x2d')],'as':_0x19bb('0x2e')}]},_0x9cea8b={},_0x26e7e3={'count':0x0,'rows':[]};var _0xe280aa=_[_0x19bb('0x2f')](db[_0x19bb('0x30')][_0x19bb('0x31')],function(_0x148ea1){return{'name':_0x148ea1[_0x19bb('0x32')],'type':_0x148ea1[_0x19bb('0x33')]['key']};});_0x9cea8b['model']=_['map'](_0xe280aa,_0x19bb('0x2b'));_0x9cea8b[_0x19bb('0x34')]=_[_0x19bb('0x35')](_0xa779ac[_0x19bb('0x34')]);_0x9cea8b[_0x19bb('0x36')]=_[_0x19bb('0x37')](_0x9cea8b[_0x19bb('0x38')],_0x9cea8b[_0x19bb('0x34')]);_0x2d38f2[_0x19bb('0x39')]=_[_0x19bb('0x37')](_0x9cea8b['model'],qs['fields'](_0xa779ac[_0x19bb('0x34')][_0x19bb('0x3a')]));_0x2d38f2[_0x19bb('0x39')]=_0x2d38f2['attributes'][_0x19bb('0x3b')]?_0x2d38f2['attributes']:_0x9cea8b[_0x19bb('0x38')];if(!_0xa779ac[_0x19bb('0x34')][_0x19bb('0x3c')](_0x19bb('0x3d'))){_0x2d38f2['limit']=qs[_0x19bb('0x24')](_0xa779ac[_0x19bb('0x34')][_0x19bb('0x24')]);_0x2d38f2[_0x19bb('0x22')]=qs[_0x19bb('0x22')](_0xa779ac[_0x19bb('0x34')][_0x19bb('0x22')]);}_0x2d38f2[_0x19bb('0x3e')]=qs[_0x19bb('0x3f')](_0xa779ac[_0x19bb('0x34')][_0x19bb('0x3f')]);_0x2d38f2['where']=qs[_0x19bb('0x36')](_['pick'](_0xa779ac[_0x19bb('0x34')],_0x9cea8b[_0x19bb('0x36')]),_0xe280aa);if(_0xa779ac[_0x19bb('0x34')][_0x19bb('0x40')]){_0x2d38f2[_0x19bb('0x41')]=_[_0x19bb('0x42')](_0x2d38f2[_0x19bb('0x41')],{'$or':_[_0x19bb('0x2f')](_0xe280aa,function(_0x1cf566){if(_0x1cf566['type']!==_0x19bb('0x43')){var _0x3ce055={};_0x3ce055[_0x1cf566[_0x19bb('0x2b')]]={'$like':'%'+_0xa779ac[_0x19bb('0x34')][_0x19bb('0x40')]+'%'};return _0x3ce055;}})});}_0x2d38f2=_[_0x19bb('0x42')]({},_0x2d38f2,_0xa779ac[_0x19bb('0x44')]);var _0x1114ae={'where':_0x2d38f2[_0x19bb('0x41')]};return db[_0x19bb('0x30')][_0x19bb('0x45')](_0x1114ae)[_0x19bb('0x14')](function(_0x3b9185){_0x26e7e3[_0x19bb('0x45')]=_0x3b9185;if(_0xa779ac[_0x19bb('0x34')][_0x19bb('0x46')]){_0x2d38f2[_0x19bb('0x47')]=[{'all':!![]}];}return db[_0x19bb('0x30')][_0x19bb('0x48')](_0x2d38f2);})[_0x19bb('0x14')](function(_0x52fd8){_0x26e7e3['rows']=_0x52fd8;return _0x26e7e3;})['then'](respondWithFilteredResult(_0x2cdd97,_0x2d38f2))[_0x19bb('0x1e')](handleError(_0x2cdd97,null));};exports[_0x19bb('0x49')]=function(_0x567e14,_0x31a6e0){var _0x1c0f58={'raw':![],'where':{'id':_0x567e14[_0x19bb('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0x19bb('0x2e')}]},_0x7210dc={};_0x7210dc[_0x19bb('0x38')]=_[_0x19bb('0x35')](db[_0x19bb('0x30')][_0x19bb('0x31')]);_0x7210dc[_0x19bb('0x34')]=_[_0x19bb('0x35')](_0x567e14[_0x19bb('0x34')]);_0x7210dc[_0x19bb('0x36')]=_[_0x19bb('0x37')](_0x7210dc[_0x19bb('0x38')],_0x7210dc[_0x19bb('0x34')]);_0x1c0f58[_0x19bb('0x39')]=_[_0x19bb('0x37')](_0x7210dc['model'],qs[_0x19bb('0x3a')](_0x567e14[_0x19bb('0x34')][_0x19bb('0x3a')]));_0x1c0f58[_0x19bb('0x39')]=_0x1c0f58[_0x19bb('0x39')][_0x19bb('0x3b')]?_0x1c0f58[_0x19bb('0x39')]:_0x7210dc[_0x19bb('0x38')];if(_0x567e14[_0x19bb('0x34')][_0x19bb('0x46')]){_0x1c0f58['include']=[{'all':!![]}];}_0x1c0f58=_[_0x19bb('0x42')]({},_0x1c0f58,_0x567e14[_0x19bb('0x44')]);return db['ChatWebsite'][_0x19bb('0x4b')](_0x1c0f58)['then'](handleEntityNotFound(_0x31a6e0,null))[_0x19bb('0x14')](respondWithResult(_0x31a6e0,null))['catch'](handleError(_0x31a6e0,null));};exports['create']=function(_0x3a3e13,_0x2a7d9a){return db[_0x19bb('0x30')][_0x19bb('0x4c')](_0x3a3e13[_0x19bb('0x4d')],{})[_0x19bb('0x14')](function(_0x53b07e){var _0x426fed=_0x3a3e13[_0x19bb('0x4e')]['get']({'plain':!![]});if(!_0x426fed)throw new Error(_0x19bb('0x4f'));if(_0x426fed['role']===_0x19bb('0x4e')){var _0x2f1e75=_0x53b07e[_0x19bb('0x28')]({'plain':!![]});var _0x2d4087=_0x19bb('0x29');return db['UserProfileSection'][_0x19bb('0x4b')]({'where':{'name':_0x2d4087,'userProfileId':_0x426fed['userProfileId']},'raw':!![]})[_0x19bb('0x14')](function(_0x10d4b3){if(_0x10d4b3&&_0x10d4b3['autoAssociation']===0x0){return db[_0x19bb('0x50')][_0x19bb('0x4c')]({'name':_0x2f1e75[_0x19bb('0x2b')],'resourceId':_0x2f1e75['id'],'type':_0x10d4b3[_0x19bb('0x2b')],'sectionId':_0x10d4b3['id']},{})['then'](function(){return _0x53b07e;});}else{return _0x53b07e;}})[_0x19bb('0x1e')](function(_0xe61c07){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe61c07);throw _0xe61c07;});}return _0x53b07e;})[_0x19bb('0x14')](respondWithResult(_0x2a7d9a,0xc9))[_0x19bb('0x1e')](handleError(_0x2a7d9a,null));};exports[_0x19bb('0x26')]=function(_0x1e5b79,_0x2fdfef){if(_0x1e5b79[_0x19bb('0x4d')]['id']){delete _0x1e5b79[_0x19bb('0x4d')]['id'];}return db[_0x19bb('0x30')][_0x19bb('0x4b')]({'where':{'id':_0x1e5b79[_0x19bb('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0x19bb('0x2e')}]})[_0x19bb('0x14')](handleEntityNotFound(_0x2fdfef,null))['then'](saveUpdates(_0x1e5b79[_0x19bb('0x4d')],null))[_0x19bb('0x14')](respondWithResult(_0x2fdfef,null))[_0x19bb('0x1e')](handleError(_0x2fdfef,null));};exports[_0x19bb('0x27')]=function(_0x9e0eda,_0x21739d){return db['ChatWebsite']['find']({'where':{'id':_0x9e0eda[_0x19bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21739d,null))[_0x19bb('0x14')](removeEntity(_0x21739d,null))[_0x19bb('0x1e')](handleError(_0x21739d,null));};exports[_0x19bb('0x51')]=function(_0x2ed250,_0x4dce71){return db['ChatWebsite'][_0x19bb('0x51')]()[_0x19bb('0x14')](respondWithResult(_0x4dce71,null))[_0x19bb('0x1e')](handleError(_0x4dce71,null));};exports['addDisposition']=function(_0x186735,_0x589238){if(_0x186735[_0x19bb('0x4d')]['id']){delete _0x186735[_0x19bb('0x4d')]['id'];}return db['ChatWebsite'][_0x19bb('0x4b')]({'where':{'id':_0x186735[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x589238,null))[_0x19bb('0x14')](function(_0x4ecf98){if(_0x4ecf98){_0x186735[_0x19bb('0x4d')]['ChatWebsiteId']=_0x4ecf98['id'];return db[_0x19bb('0x52')][_0x19bb('0x4c')](_0x186735[_0x19bb('0x4d')]);}})['then'](respondWithResult(_0x589238,null))[_0x19bb('0x1e')](handleError(_0x589238,null));};exports[_0x19bb('0x53')]=function(_0xf55352,_0x1d0ccc){var _0x25059d={'raw':![],'where':{}};var _0x4f8276={};var _0x1525d9={'count':0x0,'rows':[]};return db[_0x19bb('0x30')][_0x19bb('0x54')]({'where':{'id':_0xf55352['params']['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x1d0ccc,null))[_0x19bb('0x14')](function(_0x3a678d){if(_0x3a678d){_0x4f8276[_0x19bb('0x38')]=_[_0x19bb('0x35')](db['Disposition'][_0x19bb('0x31')]);_0x4f8276[_0x19bb('0x34')]=_[_0x19bb('0x35')](_0xf55352['query']);_0x4f8276['filters']=_[_0x19bb('0x37')](_0x4f8276[_0x19bb('0x38')],_0x4f8276[_0x19bb('0x34')]);_0x25059d[_0x19bb('0x39')]=_[_0x19bb('0x37')](_0x4f8276[_0x19bb('0x38')],qs[_0x19bb('0x3a')](_0xf55352[_0x19bb('0x34')][_0x19bb('0x3a')]));_0x25059d[_0x19bb('0x39')]=_0x25059d[_0x19bb('0x39')][_0x19bb('0x3b')]?_0x25059d[_0x19bb('0x39')]:_0x4f8276[_0x19bb('0x38')];if(!_0xf55352['query'][_0x19bb('0x3c')](_0x19bb('0x3d'))){_0x25059d[_0x19bb('0x24')]=qs[_0x19bb('0x24')](_0xf55352['query'][_0x19bb('0x24')]);_0x25059d['offset']=qs[_0x19bb('0x22')](_0xf55352[_0x19bb('0x34')][_0x19bb('0x22')]);}_0x25059d[_0x19bb('0x3e')]=qs[_0x19bb('0x3f')](_0xf55352['query'][_0x19bb('0x3f')]);_0x25059d[_0x19bb('0x41')]=qs[_0x19bb('0x36')](_[_0x19bb('0x55')](_0xf55352[_0x19bb('0x34')],_0x4f8276['filters']));_0x25059d[_0x19bb('0x41')]['ChatWebsiteId']=_0x3a678d['id'];if(_0xf55352['query']['filter']){_0x25059d[_0x19bb('0x41')]=_[_0x19bb('0x42')](_0x25059d[_0x19bb('0x41')],{'$or':_[_0x19bb('0x2f')](_0x25059d[_0x19bb('0x39')],function(_0x3529c6){var _0x5b753a={};_0x5b753a[_0x3529c6]={'$like':'%'+_0xf55352[_0x19bb('0x34')][_0x19bb('0x40')]+'%'};return _0x5b753a;})});}_0x25059d=_[_0x19bb('0x42')]({},_0x25059d,_0xf55352[_0x19bb('0x44')]);return db[_0x19bb('0x52')]['count']({'where':_0x25059d['where']})[_0x19bb('0x14')](function(_0x152a45){_0x1525d9[_0x19bb('0x45')]=_0x152a45;if(_0xf55352[_0x19bb('0x34')][_0x19bb('0x46')]){_0x25059d[_0x19bb('0x47')]=[{'all':!![]}];}return db[_0x19bb('0x52')][_0x19bb('0x48')](_0x25059d);})[_0x19bb('0x14')](function(_0x27c998){_0x1525d9[_0x19bb('0x56')]=_0x27c998;return _0x1525d9;});}})[_0x19bb('0x14')](respondWithFilteredResult(_0x1d0ccc,_0x25059d))[_0x19bb('0x1e')](handleError(_0x1d0ccc,null));};exports[_0x19bb('0x57')]=function(_0x415e51,_0x28f1ca){return db['ChatWebsite']['find']({'where':{'id':_0x415e51[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x28f1ca,null))[_0x19bb('0x14')](function(_0x2f6f70){if(_0x2f6f70){return _0x2f6f70[_0x19bb('0x57')](_0x415e51['query']['ids']);}})[_0x19bb('0x14')](respondWithStatusCode(_0x28f1ca,null))[_0x19bb('0x1e')](handleError(_0x28f1ca,null));};exports[_0x19bb('0x58')]=function(_0x42a632,_0x3410c9){if(_0x42a632['body']['id']){delete _0x42a632[_0x19bb('0x4d')]['id'];}return db[_0x19bb('0x30')][_0x19bb('0x4b')]({'where':{'id':_0x42a632[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x3410c9,null))[_0x19bb('0x14')](function(_0x1698fd){if(_0x1698fd){_0x42a632[_0x19bb('0x4d')][_0x19bb('0x59')]=_0x1698fd['id'];return db[_0x19bb('0x5a')][_0x19bb('0x4c')](_0x42a632['body']);}})[_0x19bb('0x14')](respondWithResult(_0x3410c9,null))[_0x19bb('0x1e')](handleError(_0x3410c9,null));};exports[_0x19bb('0x5b')]=function(_0x26701e,_0xb6de1d){var _0x50249b={'raw':![],'where':{}};var _0x7240a8={};var _0x159f1b={'count':0x0,'rows':[]};return db[_0x19bb('0x30')][_0x19bb('0x54')]({'where':{'id':_0x26701e[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0xb6de1d,null))[_0x19bb('0x14')](function(_0x725bd0){if(_0x725bd0){_0x7240a8[_0x19bb('0x38')]=_[_0x19bb('0x35')](db[_0x19bb('0x5a')][_0x19bb('0x31')]);_0x7240a8['query']=_['keys'](_0x26701e[_0x19bb('0x34')]);_0x7240a8[_0x19bb('0x36')]=_[_0x19bb('0x37')](_0x7240a8[_0x19bb('0x38')],_0x7240a8[_0x19bb('0x34')]);_0x50249b[_0x19bb('0x39')]=_[_0x19bb('0x37')](_0x7240a8[_0x19bb('0x38')],qs[_0x19bb('0x3a')](_0x26701e[_0x19bb('0x34')][_0x19bb('0x3a')]));_0x50249b[_0x19bb('0x39')]=_0x50249b[_0x19bb('0x39')][_0x19bb('0x3b')]?_0x50249b['attributes']:_0x7240a8['model'];if(!_0x26701e[_0x19bb('0x34')][_0x19bb('0x3c')](_0x19bb('0x3d'))){_0x50249b[_0x19bb('0x24')]=qs[_0x19bb('0x24')](_0x26701e[_0x19bb('0x34')]['limit']);_0x50249b[_0x19bb('0x22')]=qs[_0x19bb('0x22')](_0x26701e['query']['offset']);}_0x50249b[_0x19bb('0x3e')]=qs['sort'](_0x26701e['query']['sort']);_0x50249b['where']=qs[_0x19bb('0x36')](_[_0x19bb('0x55')](_0x26701e[_0x19bb('0x34')],_0x7240a8['filters']));_0x50249b[_0x19bb('0x41')][_0x19bb('0x59')]=_0x725bd0['id'];if(_0x26701e[_0x19bb('0x34')][_0x19bb('0x40')]){_0x50249b['where']=_[_0x19bb('0x42')](_0x50249b[_0x19bb('0x41')],{'$or':_[_0x19bb('0x2f')](_0x50249b[_0x19bb('0x39')],function(_0x3f0c3c){var _0x23e341={};_0x23e341[_0x3f0c3c]={'$like':'%'+_0x26701e[_0x19bb('0x34')]['filter']+'%'};return _0x23e341;})});}_0x50249b=_[_0x19bb('0x42')]({},_0x50249b,_0x26701e[_0x19bb('0x44')]);return db[_0x19bb('0x5a')][_0x19bb('0x45')]({'where':_0x50249b[_0x19bb('0x41')]})[_0x19bb('0x14')](function(_0x36670a){_0x159f1b[_0x19bb('0x45')]=_0x36670a;if(_0x26701e['query'][_0x19bb('0x46')]){_0x50249b[_0x19bb('0x47')]=[{'all':!![]}];}return db[_0x19bb('0x5a')][_0x19bb('0x48')](_0x50249b);})['then'](function(_0x5491f2){_0x159f1b[_0x19bb('0x56')]=_0x5491f2;return _0x159f1b;});}})[_0x19bb('0x14')](respondWithFilteredResult(_0xb6de1d,_0x50249b))[_0x19bb('0x1e')](handleError(_0xb6de1d,null));};exports[_0x19bb('0x5c')]=function(_0x5469a9,_0x5bb21e){return db['ChatWebsite'][_0x19bb('0x4b')]({'where':{'id':_0x5469a9[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x5bb21e,null))['then'](function(_0x55304c){if(_0x55304c){return _0x55304c[_0x19bb('0x5c')](_0x5469a9['query'][_0x19bb('0x5d')]);}})[_0x19bb('0x14')](respondWithStatusCode(_0x5bb21e,null))[_0x19bb('0x1e')](handleError(_0x5bb21e,null));};exports[_0x19bb('0x5e')]=function(_0x10b46e,_0x42bbd1){_0x10b46e[_0x19bb('0x4d')][_0x19bb('0x5f')]=_0x10b46e[_0x19bb('0x60')][_0x19bb('0x61')];return db[_0x19bb('0x30')][_0x19bb('0x4b')]({'where':{'id':_0x10b46e['params']['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x42bbd1,null))[_0x19bb('0x14')](saveUpdates(_0x10b46e[_0x19bb('0x4d')],null))[_0x19bb('0x14')](respondWithResult(_0x42bbd1,null))['catch'](handleError(_0x42bbd1,null));};exports['addAvatar']=function(_0x522105,_0x27c686){_0x522105[_0x19bb('0x4d')][_0x19bb('0x62')]=_0x522105[_0x19bb('0x60')]['filename'];return db[_0x19bb('0x30')][_0x19bb('0x4b')]({'where':{'id':_0x522105[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x27c686,null))[_0x19bb('0x14')](saveUpdates(_0x522105['body'],null))[_0x19bb('0x14')](respondWithResult(_0x27c686,null))[_0x19bb('0x1e')](handleError(_0x27c686,null));};exports[_0x19bb('0x63')]=function(_0x53e6ad,_0x4d571f){_0x53e6ad[_0x19bb('0x4d')][_0x19bb('0x64')]=_0x53e6ad['file'][_0x19bb('0x61')];return db[_0x19bb('0x30')]['find']({'where':{'id':_0x53e6ad[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x4d571f,null))['then'](saveUpdates(_0x53e6ad[_0x19bb('0x4d')],null))[_0x19bb('0x14')](respondWithResult(_0x4d571f,null))[_0x19bb('0x1e')](handleError(_0x4d571f,null));};exports['addSystemAvatar']=function(_0xa13d6a,_0x7a8d1b){_0xa13d6a[_0x19bb('0x4d')]['systemAvatar']=_0xa13d6a[_0x19bb('0x60')][_0x19bb('0x61')];return db[_0x19bb('0x30')][_0x19bb('0x4b')]({'where':{'id':_0xa13d6a['params']['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x7a8d1b,null))[_0x19bb('0x14')](saveUpdates(_0xa13d6a[_0x19bb('0x4d')],null))[_0x19bb('0x14')](respondWithResult(_0x7a8d1b,null))[_0x19bb('0x1e')](handleError(_0x7a8d1b,null));};exports[_0x19bb('0x65')]=function(_0x4e0f93,_0x53fd7e){var _0x3d9891=path['join'](config[_0x19bb('0x66')],_0x19bb('0x67'));var _0x511d9c={'where':{'id':_0x4e0f93[_0x19bb('0x4a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x30f670=![];return require('../../config/license/util')[_0x19bb('0x68')]()[_0x19bb('0x14')](function(_0x482fbf){if(_0x482fbf){_0x30f670=_0x482fbf['custom'];}})['then'](function(){return db[_0x19bb('0x30')][_0x19bb('0x4b')](_0x511d9c);})[_0x19bb('0x14')](handleEntityNotFound(_0x53fd7e,null))[_0x19bb('0x14')](function(_0x29216d){if(_0x29216d){if(!_[_0x19bb('0x69')](_0x29216d[_0x19bb('0x5f')])){if(fs[_0x19bb('0x6a')](path[_0x19bb('0x6b')](config[_0x19bb('0x66')],_0x19bb('0x6c'),_0x29216d[_0x19bb('0x5f')]))&&_0x30f670){_0x3d9891=path[_0x19bb('0x6b')](config[_0x19bb('0x66')],_0x19bb('0x6c'),_0x29216d[_0x19bb('0x5f')]);}}return _0x53fd7e['download'](_0x3d9891);}})[_0x19bb('0x1e')](handleError(_0x53fd7e,null));};exports['getAvatar']=function(_0x3c44f7,_0x219861){var _0x208a58=path[_0x19bb('0x6b')](config[_0x19bb('0x66')],_0x19bb('0x6d'));var _0x37909d={'where':{'id':_0x3c44f7[_0x19bb('0x4a')]['id']},'attributes':['id',_0x19bb('0x62')],'raw':!![]};return db[_0x19bb('0x30')]['find'](_0x37909d)[_0x19bb('0x14')](handleEntityNotFound(_0x219861,null))[_0x19bb('0x14')](function(_0x190214){if(_0x190214){if(!_[_0x19bb('0x69')](_0x190214['agentAvatar'])){if(fs['existsSync'](path['join'](config[_0x19bb('0x66')],'server/files/images/avatars/',_0x190214['agentAvatar']))){_0x208a58=path['join'](config[_0x19bb('0x66')],_0x19bb('0x6e'),_0x190214[_0x19bb('0x62')]);}}return _0x219861['download'](_0x208a58);}})[_0x19bb('0x1e')](handleError(_0x219861,null));};exports['getCustomerAvatar']=function(_0x1d77f9,_0x5ed950){var _0x36b09d=path[_0x19bb('0x6b')](config['root'],_0x19bb('0x6f'));var _0x1e24f9={'where':{'id':_0x1d77f9[_0x19bb('0x4a')]['id']},'attributes':['id',_0x19bb('0x64'),_0x19bb('0x70')],'raw':!![]};return db[_0x19bb('0x30')]['find'](_0x1e24f9)[_0x19bb('0x14')](handleEntityNotFound(_0x5ed950,null))[_0x19bb('0x14')](function(_0x12d213){if(_0x12d213){if(!_[_0x19bb('0x69')](_0x12d213[_0x19bb('0x64')])){if(fs['existsSync'](path['join'](config[_0x19bb('0x66')],'server/files/images/avatars/',_0x12d213[_0x19bb('0x64')]))&&_0x12d213[_0x19bb('0x70')]){_0x36b09d=path[_0x19bb('0x6b')](config[_0x19bb('0x66')],'server/files/images/avatars/',_0x12d213[_0x19bb('0x64')]);}}return _0x5ed950['download'](_0x36b09d);}})[_0x19bb('0x1e')](handleError(_0x5ed950,null));};exports['getSystemAvatar']=function(_0x566d96,_0xa401bf){var _0x45dcf7=path[_0x19bb('0x6b')](config[_0x19bb('0x66')],_0x19bb('0x71'));var _0x3840e6={'where':{'id':_0x566d96[_0x19bb('0x4a')]['id']},'attributes':['id',_0x19bb('0x72')],'raw':!![]};return db[_0x19bb('0x30')][_0x19bb('0x4b')](_0x3840e6)[_0x19bb('0x14')](handleEntityNotFound(_0xa401bf,null))[_0x19bb('0x14')](function(_0x365c28){if(_0x365c28){if(!_['isNil'](_0x365c28['systemAvatar'])){if(fs[_0x19bb('0x6a')](path[_0x19bb('0x6b')](config[_0x19bb('0x66')],_0x19bb('0x6e'),_0x365c28[_0x19bb('0x72')]))){_0x45dcf7=path[_0x19bb('0x6b')](config['root'],_0x19bb('0x6e'),_0x365c28[_0x19bb('0x72')]);}}return _0xa401bf[_0x19bb('0x73')](_0x45dcf7);}})[_0x19bb('0x1e')](handleError(_0xa401bf,null));};exports[_0x19bb('0x74')]=function(_0x4678a4,_0x140ee7){var _0x3c244d=require(_0x19bb('0x75'));var _0x3368f9=new _0x3c244d();var _0xf2cc33=_0x3368f9['setUA'](_0x4678a4[_0x19bb('0x76')][_0x19bb('0x77')])[_0x19bb('0x78')]();var _0x10835e={'body':_0x4678a4['body'],'channel':_0x19bb('0x79')};var _0x45ced0=[];var _0x4c3576=[];var _0x5bd147={};var _0x27f399=![];return db[_0x19bb('0x7a')][_0x19bb('0x51')]()[_0x19bb('0x14')](function(_0x4d548e){if(!_0x4d548e){throw new db['Sequelize']['ValidationError'](_0x19bb('0x7b'));}_0x45ced0=_[_0x19bb('0x7c')](_[_0x19bb('0x35')](_0x4d548e),[_0x19bb('0x7d'),_0x19bb('0x7e')]);_0x4c3576=_[_0x19bb('0x7c')](_[_0x19bb('0x35')](_0x4d548e),['createdAt',_0x19bb('0x7e'),_0x19bb('0x7f'),_0x19bb('0x80')]);if(_0x4678a4[_0x19bb('0x4d')]['id']){delete _0x4678a4[_0x19bb('0x4d')]['id'];}if(_[_0x19bb('0x69')](_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x81')])){throw new db[(_0x19bb('0x82'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x19bb('0x69')](_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x4d')])||_0x4678a4['body'][_0x19bb('0x4d')]===''){throw new db['Sequelize'][(_0x19bb('0x83'))](_0x19bb('0x84'));}if(_[_0x19bb('0x69')](_0x4678a4['body'][_0x19bb('0x85')])){throw new db[(_0x19bb('0x82'))][(_0x19bb('0x83'))](_0x19bb('0x86')+_0x4c3576);}if(!_['includes'](_0x4c3576,_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x85')])){throw new db['Sequelize'][(_0x19bb('0x83'))](_0x19bb('0x87')+_0x4c3576);}_0x5bd147[_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x85')]]=_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x81')];})[_0x19bb('0x14')](function(){return db[_0x19bb('0x30')][_0x19bb('0x4b')]({'where':{'id':_0x4678a4[_0x19bb('0x4a')]['id']},'include':[{'model':db['CmList'],'as':_0x19bb('0x88'),'include':[{'model':db[_0x19bb('0x7a')],'as':_0x19bb('0x89'),'where':_0x5bd147,'limit':0x1,'order':[[_0x19bb('0x7e'),_0x19bb('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0x19bb('0x8b')}]});})[_0x19bb('0x14')](handleEntityNotFound(_0x140ee7,null))[_0x19bb('0x14')](function(_0x594838){if(_0x594838&&_0x594838['List']){_0x10835e[_0x19bb('0x8c')]=_0x594838;_0x10835e['applications']=_0x594838[_0x19bb('0x8b')];_0x10835e[_0x19bb('0x8d')]=_0x594838[_0x19bb('0x88')];_0x10835e['applications']=_[_0x19bb('0x8e')](_0x10835e['applications'],[_0x19bb('0x8f')],[_0x19bb('0x90')]);if(_0x10835e[_0x19bb('0x8c')][_0x19bb('0x8b')]){delete _0x10835e[_0x19bb('0x8c')]['Applications'];}if(_0x10835e[_0x19bb('0x8c')]['List']&&_0x10835e[_0x19bb('0x8c')][_0x19bb('0x88')][_0x19bb('0x89')]['length']){return _0x10835e[_0x19bb('0x8c')][_0x19bb('0x88')][_0x19bb('0x89')][0x0];}var _0x50079f=_[_0x19bb('0xc')](_0x4678a4['body'],{'firstName':_0x4678a4['body']['from'],'ListId':_0x594838['ListId']});_0x50079f[_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x85')]]=_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x81')];return db['CmContact'][_0x19bb('0x4c')](_0x50079f,{'fields':_0x45ced0,'raw':!![]});}})['then'](handleEntityNotFound(_0x140ee7,null))[_0x19bb('0x14')](function(_0xfbb3ec){_0x10835e[_0x19bb('0x91')]=_0xfbb3ec;var _0x3cd560=_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x92')];if(_0x4678a4[_0x19bb('0x76')][_0x19bb('0x93')]){_0x3cd560=_0x4678a4[_0x19bb('0x76')][_0x19bb('0x93')];}else if(_0x4678a4[_0x19bb('0x76')][_0x19bb('0x94')]){_0x3cd560=_[_0x19bb('0x95')](_0x4678a4[_0x19bb('0x76')][_0x19bb('0x94')][_0x19bb('0x96')](','));}if(_0xfbb3ec){var _0x5edb74={'ContactId':_0xfbb3ec['id'],'ChatWebsiteId':_0x4678a4[_0x19bb('0x4a')]['id'],'from':(_0xfbb3ec[_0x19bb('0x97')]||'')+'\x20'+(_0xfbb3ec[_0x19bb('0x98')]||''),'customerIp':_0x3cd560,'customerPort':_0x4678a4[_0x19bb('0x76')][_0x19bb('0x99')]?_0x4678a4[_0x19bb('0x76')][_0x19bb('0x99')]:null,'referer':_0x4678a4['body']['referer'],'browserName':_0xf2cc33[_0x19bb('0x9a')][_0x19bb('0x2b')]&&_0xf2cc33[_0x19bb('0x9a')]['version']?util[_0x19bb('0x9b')]('%s\x20%s',_0xf2cc33['browser'][_0x19bb('0x2b')],_0xf2cc33['browser'][_0x19bb('0x9c')]):_0x19bb('0x9d'),'browserVersion':_0xf2cc33[_0x19bb('0x9a')]['version']||_0x19bb('0x9d'),'osName':util['format'](_0x19bb('0x9e'),_0xf2cc33['os'][_0x19bb('0x2b')],_0xf2cc33['os'][_0x19bb('0x9c')]),'osVersion':_0xf2cc33['os'][_0x19bb('0x9c')],'deviceModel':_0xf2cc33['device'][_0x19bb('0x38')]&&_0xf2cc33[_0x19bb('0x9f')][_0x19bb('0xa0')]?util[_0x19bb('0x9b')](_0x19bb('0xa1'),_0xf2cc33['device'][_0x19bb('0x38')],_0xf2cc33['device'][_0x19bb('0xa0')],_0xf2cc33[_0x19bb('0x9f')][_0x19bb('0x33')]):null,'deviceVendor':_0xf2cc33['device'][_0x19bb('0xa0')],'deviceType':_0xf2cc33[_0x19bb('0x9f')]['type'],'formData':JSON[_0x19bb('0x19')](_0x4678a4[_0x19bb('0x4d')])};var _0x2fc3a6={'ChatWebsiteId':_0x4678a4[_0x19bb('0x4a')]['id'],'closed':![]};if(_0x4678a4[_0x19bb('0x4d')]['threadId']){_0x2fc3a6[_0x19bb('0xa2')]=_0x4678a4[_0x19bb('0x4d')][_0x19bb('0xa2')];return db[_0x19bb('0xa3')][_0x19bb('0x4b')]({'where':_0x2fc3a6})[_0x19bb('0x14')](function(_0x3934d7){if(_0x3934d7){return[_0x3934d7,![]];}_0x5edb74['threadId']=_0x4678a4['body']['threadId'];_0x5edb74[_0x19bb('0xa4')]=_0x4678a4[_0x19bb('0x4d')][_0x19bb('0xa4')];return db[_0x19bb('0xa3')][_0x19bb('0x4c')](_0x5edb74)[_0x19bb('0x14')](function(_0x299f01){return[_0x299f01,!![]];});});}_0x2fc3a6[_0x19bb('0xa5')]=_0xfbb3ec['id'];if(_0x4678a4[_0x19bb('0x4d')]['interaction']&&_0x4678a4['body']['interaction']['id']){_0x2fc3a6['id']=_0x4678a4[_0x19bb('0x4d')]['interaction']['id'];return db[_0x19bb('0xa3')][_0x19bb('0x4b')]({'where':_0x2fc3a6})['then'](function(_0x521243){if(_0x521243){return[_0x521243,![]];}return db['ChatInteraction'][_0x19bb('0x4c')](_0x5edb74)[_0x19bb('0x14')](function(_0xfefa2b){return[_0xfefa2b,!![]];});});}return db[_0x19bb('0xa3')][_0x19bb('0x4c')](_0x5edb74)[_0x19bb('0x14')](function(_0x5a2042){return[_0x5a2042,!![]];});}})[_0x19bb('0xa6')](function(_0x258459,_0x41246e){if(_0x258459){_0x27f399=_0x41246e;if(!_0x41246e){var _0x4bac6c={'from':(_0x10835e[_0x19bb('0x91')][_0x19bb('0x97')]||'')+'\x20'+(_0x10835e[_0x19bb('0x91')][_0x19bb('0x98')]||'')};if(_0x4678a4[_0x19bb('0x4d')][_0x19bb('0xa2')]&&_0x4678a4[_0x19bb('0x4d')][_0x19bb('0xa7')]&&_0x4678a4['body']['threadId']!=_0x4678a4[_0x19bb('0x4d')][_0x19bb('0xa7')]){_0x4bac6c[_0x19bb('0xa2')]=_0x4678a4[_0x19bb('0x4d')][_0x19bb('0xa7')];}return _0x258459[_0x19bb('0x26')](_0x4bac6c);}else{return _0x258459;}}})['then'](function(_0x397ed4){_0x10835e[_0x19bb('0xa8')]=_0x397ed4[_0x19bb('0x28')]({'plain':!![]});_0x10835e[_0x19bb('0xa8')][_0x19bb('0xa9')]=_0x27f399;if(_0x10835e['interaction']['created']){if(_0x10835e['account'][_0x19bb('0xaa')]){_0x10835e['applications']['push']({'id':0x0,'priority':_0x10835e[_0x19bb('0xab')]['length']+0x1,'app':'close','appdata':_0x19bb('0xac'),'interval':_0x19bb('0xad')});}}return db['ChatMessage'][_0x19bb('0x4c')]({'body':_0x4678a4[_0x19bb('0x4d')][_0x19bb('0x4d')],'ChatWebsiteId':_0x4678a4[_0x19bb('0x4a')]['id'],'ChatInteractionId':_0x397ed4['id'],'direction':'in','ContactId':_0x10835e[_0x19bb('0x91')]['id'],'AttachmentId':_0x4678a4['body'][_0x19bb('0xae')]});})['then'](function(_0x5e94d5){_0x10835e[_0x19bb('0x1c')]=_0x5e94d5;if(_0x10835e[_0x19bb('0xa8')][_0x19bb('0xaf')]){return db[_0x19bb('0xb0')][_0x19bb('0x4b')]({'attributes':['id',_0x19bb('0x2b')],'where':{'id':_0x10835e['interaction']['UserId']}})[_0x19bb('0x14')](function(_0x4ab129){if(_0x4ab129){_0x10835e[_0x19bb('0xab')][_0x19bb('0xb1')]({'id':0x0,'priority':0x0,'app':_0x19bb('0xb2'),'appdata':_0x4ab129[_0x19bb('0x2b')]+','+(_0x10835e[_0x19bb('0x8c')][_0x19bb('0xb3')]||0xa),'interval':'*,*,*,*'});_0x10835e[_0x19bb('0xb4')]=!![];}return respondWithRpcPromise(_0x19bb('0xb5'),'startRouting',_0x10835e);});}return respondWithRpcPromise(_0x19bb('0xb5'),'startRouting',_0x10835e);})[_0x19bb('0x14')](function(_0x5613bb){respondWithRpcPromise(_0x19bb('0xb6'),_0x19bb('0xb6'),{'event':'notify','message':_0x5613bb},client9002);return _0x5613bb;})[_0x19bb('0x14')](respondWithResult(_0x140ee7,null))[_0x19bb('0x1e')](handleError(_0x140ee7,null));};exports[_0x19bb('0xb7')]=function(_0x4ce49d,_0x4dab69){var _0x3dec8e,_0x27db6b,_0x934e4c;var _0x5686fa=[];var _0x524d67={};var _0x4ec2b0=_0x4ce49d['files']||[];var _0x57e2de=[];var _0x29fa1a;return db[_0x19bb('0x7a')]['describe']()['then'](function(_0x5f4ab2){if(!_0x5f4ab2){throw new db[(_0x19bb('0x82'))]['ValidationError']('no\x20available\x20attributes');}_0x5686fa=_[_0x19bb('0x7c')](_['keys'](_0x5f4ab2),[_0x19bb('0x7d'),_0x19bb('0x7e'),_0x19bb('0x7f'),_0x19bb('0x80')]);if(_0x4ce49d['body']['id']){delete _0x4ce49d[_0x19bb('0x4d')]['id'];}if(_['isNil'](_0x4ce49d[_0x19bb('0x4d')]['from'])){throw _0x4dab69[_0x19bb('0x1f')](0x1f4)[_0x19bb('0x2c')](new db[(_0x19bb('0x82'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x19bb('0x69')](_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0x4d')])||_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0x4d')]===''){throw _0x4dab69[_0x19bb('0x1f')](0x1f4)['send'](new db[(_0x19bb('0x82'))][(_0x19bb('0x83'))](_0x19bb('0x84')));}if(_[_0x19bb('0x69')](_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0xb8')])){throw _0x4dab69[_0x19bb('0x1f')](0x1f4)[_0x19bb('0x2c')](new db[(_0x19bb('0x82'))]['ValidationError'](_0x19bb('0xb9')+_0x5686fa));}if(!_[_0x19bb('0xba')](_0x5686fa,_0x4ce49d[_0x19bb('0x4d')]['mapKeyOffline'])){throw _0x4dab69[_0x19bb('0x1f')](0x1f4)[_0x19bb('0x2c')](new db[(_0x19bb('0x82'))]['ValidationError'](_0x19bb('0xbb')+_0x5686fa));}_0x524d67[_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0xb8')]]=_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0x81')];})[_0x19bb('0x14')](function(){return db[_0x19bb('0x30')][_0x19bb('0x4b')]({'where':{'id':_0x4ce49d['params']['id']},'include':[{'model':db['CmList'],'as':_0x19bb('0x88')},{'model':db[_0x19bb('0xbc')],'as':_0x19bb('0xbc')}]});})[_0x19bb('0x14')](handleEntityNotFound(_0x4dab69,null))[_0x19bb('0x14')](function(_0xc9e9ad){if(_0xc9e9ad&&_0xc9e9ad[_0x19bb('0x88')]){_0x27db6b=_0xc9e9ad;var _0x202344=_[_0x19bb('0xc')](_0x4ce49d[_0x19bb('0x4d')],{'firstName':_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0x81')],'phone':_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0x81')],'ListId':_0xc9e9ad['ListId']});_0x202344[_0x4ce49d[_0x19bb('0x4d')]['mapKeyOffline']]=_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0x81')];return db[_0x19bb('0x7a')][_0x19bb('0xbd')]({'where':_0x524d67,'defaults':_0x202344});}})[_0x19bb('0xa6')](function(_0x3ada59){if(_0x3ada59){_0x934e4c=_0x3ada59;var _0x44eda4=fs[_0x19bb('0xbe')](path[_0x19bb('0x6b')](config[_0x19bb('0x66')],_0x19bb('0xbf')),_0x19bb('0xc0'));var _0x28fc02=ejs[_0x19bb('0xc1')](_0x44eda4,{'body':_[_0x19bb('0xc2')](_0x4ce49d[_0x19bb('0x4d')][_0x19bb('0x4d')]),'bodyTitle':_0x27db6b[_0x19bb('0xc3')]});return db['ChatOfflineMessage']['create']({'body':_0x28fc02,'plainBody':htmlToText[_0x19bb('0xc4')](_0x28fc02),'ContactId':_0x3ada59['id'],'ChatWebsiteId':_0x27db6b['id']});}})[_0x19bb('0x14')](function(_0xea7413){_0x29fa1a=_0xea7413;if(_0x4ec2b0[_0x19bb('0x3b')]){var _0x3e0495=_0x4ec2b0[_0x19bb('0x2f')](function(_0x27f6ab){return{'name':_0x27f6ab[_0x19bb('0xc5')],'basename':_0x27f6ab['filename'],'type':_0x27f6ab[_0x19bb('0xc6')],'ChatOfflineMessageId':_0xea7413['id']};});_0x57e2de=_0x3e0495[_0x19bb('0x2f')](_0xda364c=>{var _0x5d68a0={'filename':_0xda364c[_0x19bb('0x2b')],'path':path[_0x19bb('0x6b')](config['root'],_0x19bb('0xc7'),'files',_0x19bb('0xc8'),_0x19bb('0xc9'),_0xda364c[_0x19bb('0xca')])};return _0x5d68a0;});if(!_0x27db6b['openNewInteraction']){return db[_0x19bb('0xcb')][_0x19bb('0xcc')](function(_0x3b534d){return db['Attachment'][_0x19bb('0xcd')](_0x3e0495,{'transaction':_0x3b534d});});}}})[_0x19bb('0x14')](function(){if(_0x29fa1a){_0x3dec8e=_0x29fa1a;return db[_0x19bb('0xbc')][_0x19bb('0x54')]({'where':{'service':!![]},'include':[{'model':db[_0x19bb('0xce')],'as':_0x19bb('0xcf'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x19bb('0xd0'),'raw':!![]}]}]});}})['then'](function(_0x318937){if(_0x318937&&_0x318937[_0x19bb('0xcf')]&&_0x27db6b[_0x19bb('0xd1')]&&_0x27db6b[_0x19bb('0xd2')]){var _0x10dab6=_0x318937[_0x19bb('0xd3')]();return respondWithRpcPromise('SendMail',_0x19bb('0xd4'),{'account':_0x10dab6,'message':{'from':util[_0x19bb('0x9b')](_0x19bb('0xd5'),_0x318937[_0x19bb('0x2b')],_0x318937[_0x19bb('0xd6')]||_0x318937[_0x19bb('0xcf')][_0x19bb('0x4e')]),'to':_0x27db6b[_0x19bb('0xd2')],'subject':_0x27db6b['offlineMessageSubject'],'html':_0x3dec8e[_0x19bb('0x4d')],'attachments':_0x57e2de}},client9003)[_0x19bb('0x14')](function(){return _0x3dec8e;})[_0x19bb('0x1e')](function(_0x89b1b0){logger['error'](_0x89b1b0);});}})[_0x19bb('0x14')](function(){if(_0x27db6b&&_0x27db6b[_0x19bb('0xd7')]&&_0x27db6b[_0x19bb('0xd8')]){var _0x110c63=[];if(_0x4ec2b0['length']){_0x110c63=_0x4ec2b0[_0x19bb('0x2f')](function(_0x12f3be){return{'name':_0x12f3be[_0x19bb('0xc5')],'basename':_0x12f3be[_0x19bb('0x61')],'type':_0x12f3be[_0x19bb('0xc6')],'ChatOfflineMessageId':_0x29fa1a['id']};});}var _0xbbe85d;if(!_[_0x19bb('0x69')](_0x27db6b['subjectOffline'])){var _0x5f2ec9=_[_0x19bb('0x2f')](_0x4ce49d[_0x19bb('0x4d')],function(_0x33a4b8){return _0x33a4b8;});var _0xeb9458=_[_0x19bb('0xd9')](_0x5f2ec9)[0x0];var _0x241806=_[_0x19bb('0xda')](_0xeb9458,function(_0x50ea5b){return _0x50ea5b;});_0xbbe85d=_0x241806[0x1][_0x27db6b[_0x19bb('0xdb')]];}var _0x2bf065={'from':_0x934e4c['email'],'firstName':_0x934e4c[_0x19bb('0x97')],'lastName':_0x934e4c[_0x19bb('0x98')],'mapKey':_0x19bb('0xd6'),'message':{'from':_0x934e4c[_0x19bb('0xd6')],'to':_0x27db6b[_0x19bb('0xbc')][_0x19bb('0xd6')],'cc':'','subject':_[_0x19bb('0x69')](_0xbbe85d)?_0x27db6b['offlineMessageSubject']:_0xbbe85d,'messageId':'','sentAt':new Date(),'attach':_0x110c63[_0x19bb('0x3b')],'attachments':_0x110c63,'originChannel':_0x19bb('0xdc'),'ChatWebsiteId':_0x27db6b['id'],'ChatOfflineMessageId':_0x3dec8e['id'],'originTo':_0x27db6b['MailAccount'][_0x19bb('0xd6')]},'body':_0x3dec8e[_0x19bb('0x4d')]};var _0x22e8f0={'account':{'id':_0x27db6b[_0x19bb('0xd8')]},'body':_0x2bf065,'log':_0x19bb('0xdd')};return respondWithRpcPromise(_0x19bb('0xdd'),'notifyMail',_0x22e8f0,client9001)['then'](function(){return _0x3dec8e;})[_0x19bb('0x1e')](function(_0x17ae0b){logger['error'](_0x17ae0b);});}return;})['then'](function(){if(_0x3dec8e){return _0x3dec8e;}})[_0x19bb('0x14')](respondWithResult(_0x4dab69,null))[_0x19bb('0x1e')](function(_0x5c06f5){logger['error'](_0x19bb('0x1e'),_0x5c06f5);for(var _0x1b384f of _0x4ec2b0){var _0x26d342=path[_0x19bb('0x6b')](config[_0x19bb('0x66')],_0x19bb('0xc7'),_0x19bb('0xde'),_0x19bb('0xc8'),_0x19bb('0xc9'),_0x1b384f[_0x19bb('0x61')]);fs_extra['remove'](_0x26d342)[_0x19bb('0x1e')](function(_0x40ae19){logger[_0x19bb('0x1a')](_0x19bb('0xdf'),_0x26d342,_0x40ae19);});}});};exports[_0x19bb('0xe0')]=function(_0x53560c,_0x24f954){return db[_0x19bb('0xa3')][_0x19bb('0x4b')]({'where':{'id':_0x53560c[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x24f954,null))[_0x19bb('0x14')](function(_0x36ee6f){if(_0x36ee6f){return _0x36ee6f[_0x19bb('0xe0')](_0x53560c[_0x19bb('0x4d')][_0x19bb('0x5d')],_[_0x19bb('0xe1')](_0x53560c[_0x19bb('0x4d')],['ids','id'])||{});}})[_0x19bb('0x14')](respondWithResult(_0x24f954,null))[_0x19bb('0x1e')](handleError(_0x24f954,null));};exports[_0x19bb('0xe2')]=function(_0x2dc009,_0x3cb79d){var _0x2b2ee4={'raw':![],'where':{}};var _0x3f4224={};var _0x4a0fa3={'count':0x0,'rows':[]};return db[_0x19bb('0x30')][_0x19bb('0x54')]({'where':{'id':_0x2dc009[_0x19bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3cb79d,null))['then'](function(_0x5ea8be){if(_0x5ea8be){_0x3f4224[_0x19bb('0x38')]=_[_0x19bb('0x35')](db['ChatInteraction'][_0x19bb('0x31')]);_0x3f4224['query']=_[_0x19bb('0x35')](_0x2dc009[_0x19bb('0x34')]);_0x3f4224[_0x19bb('0x36')]=_[_0x19bb('0x37')](_0x3f4224[_0x19bb('0x38')],_0x3f4224[_0x19bb('0x34')]);_0x2b2ee4[_0x19bb('0x39')]=_['intersection'](_0x3f4224[_0x19bb('0x38')],qs['fields'](_0x2dc009[_0x19bb('0x34')][_0x19bb('0x3a')]));_0x2b2ee4[_0x19bb('0x39')]=_0x2b2ee4[_0x19bb('0x39')]['length']?_0x2b2ee4[_0x19bb('0x39')]:_0x3f4224[_0x19bb('0x38')];if(!_0x2dc009['query'][_0x19bb('0x3c')](_0x19bb('0x3d'))){_0x2b2ee4[_0x19bb('0x24')]=qs[_0x19bb('0x24')](_0x2dc009[_0x19bb('0x34')][_0x19bb('0x24')]);_0x2b2ee4[_0x19bb('0x22')]=qs[_0x19bb('0x22')](_0x2dc009[_0x19bb('0x34')][_0x19bb('0x22')]);}_0x2b2ee4[_0x19bb('0x3e')]=qs['sort'](_0x2dc009['query'][_0x19bb('0x3f')]);_0x2b2ee4[_0x19bb('0x41')]=qs[_0x19bb('0x36')](_[_0x19bb('0x55')](_0x2dc009[_0x19bb('0x34')],_0x3f4224[_0x19bb('0x36')]));_0x2b2ee4[_0x19bb('0x41')]['ChatWebsiteId']=_0x5ea8be['id'];if(_0x2dc009[_0x19bb('0x34')][_0x19bb('0x40')]){_0x2b2ee4[_0x19bb('0x41')]=_['merge'](_0x2b2ee4[_0x19bb('0x41')],{'$or':_[_0x19bb('0x2f')](_0x2b2ee4[_0x19bb('0x39')],function(_0x310ab1){var _0x2ccd35={};_0x2ccd35[_0x310ab1]={'$like':'%'+_0x2dc009['query'][_0x19bb('0x40')]+'%'};return _0x2ccd35;})});}_0x2b2ee4=_[_0x19bb('0x42')]({},_0x2b2ee4,_0x2dc009['options']);return db['ChatInteraction']['count']({'where':_0x2b2ee4[_0x19bb('0x41')]})['then'](function(_0x352bc6){_0x4a0fa3[_0x19bb('0x45')]=_0x352bc6;if(_0x2dc009[_0x19bb('0x34')][_0x19bb('0x46')]){_0x2b2ee4['include']=[{'model':db['CmContact'],'as':_0x19bb('0xe3'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x19bb('0xe4'),_0x19bb('0xe5')],'required':![]},{'model':db[_0x19bb('0xe6')],'as':_0x19bb('0xe7'),'attributes':['id','name',_0x19bb('0xe8')],'where':_0x2dc009[_0x19bb('0x34')]['tag']?{'id':_0x2dc009[_0x19bb('0x34')][_0x19bb('0xe9')]}:undefined,'required':_0x2dc009[_0x19bb('0x34')][_0x19bb('0xe9')]?!![]:![]}];}return db[_0x19bb('0xa3')]['findAll'](_0x2b2ee4);})['then'](function(_0x14be12){_0x4a0fa3[_0x19bb('0x56')]=_0x14be12;return _0x4a0fa3;});}})['then'](respondWithFilteredResult(_0x3cb79d,_0x2b2ee4))[_0x19bb('0x1e')](handleError(_0x3cb79d,null));};function iftimePromise(_0x1bea6f,_0x46f102){return respondWithRpcPromise(_0x19bb('0xea'),_0x19bb('0xeb'),{'command':_0x46f102[_0x19bb('0xec')]?util[_0x19bb('0x9b')]('iftime\x20%s,%s',_0x1bea6f[_0x19bb('0xed')],_0x46f102['timezone']):util[_0x19bb('0x9b')](_0x19bb('0xee'),_0x1bea6f['interval'])},client9002)['then'](function(_0x14dfef){var _0xfbe2b7=_0x14dfef&&_0x14dfef[_0x19bb('0xef')]('true')>=0x0?!![]:![];logger[_0x19bb('0xf0')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x46f102['id'],_0x1bea6f['id'],_0x1bea6f[_0x19bb('0xed')],_0xfbe2b7?_0x19bb('0xf1'):_0x19bb('0xf2'),_0x46f102[_0x19bb('0xec')]?_0x46f102[_0x19bb('0xec')]:_0x19bb('0xf3'));return _0xfbe2b7;})[_0x19bb('0x1e')](function(_0x2a222d){logger['error'](_0x19bb('0xf4'),_0x46f102['id'],_0x1bea6f['id'],_0x1bea6f['interval'],util['inspect'](_0x2a222d,{'showHidden':![],'depth':null}),_0x46f102[_0x19bb('0xec')]?_0x46f102[_0x19bb('0xec')]:_0x19bb('0xf3'));return![];});}exports[_0x19bb('0xeb')]=function(_0x1cdca0,_0xd4a7df){var _0xf95b2e=0x0;var _0x507553=0x0;var _0x6bf89e=![];var _0x316b9c;var _0x4f4e10;return db[_0x19bb('0x30')]['find']({'where':{'id':_0x1cdca0[_0x19bb('0x4a')]['id']},'include':[{'model':db[_0x19bb('0xf5')],'as':'Interval','include':[{'model':db[_0x19bb('0xf5')],'as':_0x19bb('0xf6'),'attributes':['id',_0x19bb('0xed')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0xd4a7df,null))[_0x19bb('0x14')](function(_0x5ac256){if(_0x5ac256){_0x316b9c=_0x5ac256;return _0x5ac256['getProactiveActions']({'raw':!![]});}})[_0x19bb('0x14')](function(_0x2bd1aa){if(_0x316b9c){if(_0x2bd1aa){_0x4f4e10=_0x2bd1aa;}}return require(_0x19bb('0xf7'))['getLicense']();})[_0x19bb('0x14')](function(_0x2b99eb){if(_0x2b99eb){_0x507553=_0x2b99eb['virtual'];_0x6bf89e=_0x2b99eb['custom'];}})[_0x19bb('0x14')](function(){return db['ChatInteraction'][_0x19bb('0x45')]({'where':{'closed':![]}});})[_0x19bb('0x14')](function(_0x48c910){_0xf95b2e=_0x48c910;if(_0x507553&&_0x48c910>_0x507553){return db[_0x19bb('0xf8')][_0x19bb('0x54')]({'where':{'id':0x1}})[_0x19bb('0x14')](function(_0x5d24b7){if(_0x5d24b7){_0x5d24b7[_0x19bb('0xf9')](_0x19bb('0xfa'));}});}})[_0x19bb('0x14')](function(){if(_0x316b9c[_0x19bb('0xf5')]&&_0x316b9c[_0x19bb('0xf5')][_0x19bb('0xf6')]){var _0x1ac208=[];for(var _0x86a47c=0x0;_0x86a47c<_0x316b9c[_0x19bb('0xf5')][_0x19bb('0xf6')]['length'];_0x86a47c++){var _0x56c65b=_0x316b9c['Interval'][_0x19bb('0xf6')][_0x86a47c]['get']({'plain':!![]});_0x1ac208[_0x19bb('0xfb')](iftimePromise(_0x56c65b,_0x316b9c));}return BPromise[_0x19bb('0xfc')](_0x1ac208)[_0x19bb('0x14')](function(_0x42d1c7){return _['some'](_0x42d1c7);});}else{return!![];}})[_0x19bb('0x14')](function(_0x49b66d){var _0x498c0e=fs['readFileSync'](path[_0x19bb('0x6b')](config[_0x19bb('0x66')],_0x19bb('0xfd')),_0x19bb('0xc0'));var _0xf9486={'remote':_0x316b9c[_0x19bb('0xfe')],'query':querystring['stringify'](_[_0x19bb('0x42')](_0x316b9c[_0x19bb('0x28')]({'plain':!![]}),{'customerIp':_0x1cdca0[_0x19bb('0x76')][_0x19bb('0x94')]||_0x1cdca0[_0x19bb('0x76')]['x-real-ip']||_0x1cdca0[_0x19bb('0xff')][_0x19bb('0x100')]||_0x1cdca0['ip'],'referer':_0x1cdca0[_0x19bb('0x76')][_0x19bb('0x101')],'openedInteractions':_0xf95b2e,'maxInteractions':_0x507553,'virtual':_0x6bf89e[_0x19bb('0x102')],'online':_0x49b66d,'custom':_0x6bf89e}))[_0x19bb('0x103')](/'/g,'\x5c\x27')};_0xd4a7df[_0x19bb('0x2c')](ejs['render'](Mustache[_0x19bb('0xc1')](_0x498c0e,_0xf9486),{'proactiveActions':_0x4f4e10,'alignment':_0x316b9c[_0x19bb('0x104')],'verticalAlignment':_0x316b9c[_0x19bb('0x105')],'div_color':_0x316b9c[_0x19bb('0xe8')],'labelText':_0x316b9c['labelText'],'text_color':_0x316b9c[_0x19bb('0x106')],'text_button_color':_0x316b9c['textButtonColor'],'button_color':_0x316b9c[_0x19bb('0x107')],'background_color':_0x316b9c[_0x19bb('0x108')],'hideWhenOffline':_0x316b9c['hideWhenOffline'],'interval':_0x316b9c[_0x19bb('0x109')]}));})[_0x19bb('0x1e')](handleError(_0xd4a7df,null));};exports[_0x19bb('0x10a')]=function(_0x4c68fa,_0x4fc51c){var _0x4fb887=_0x4c68fa[_0x19bb('0x4a')]['id'];var _0x2ccc5f=_0x4c68fa[_0x19bb('0x4d')];var _0x3acc8a=0xc8;var _0x55844e=null;return db[_0x19bb('0xcb')][_0x19bb('0xcc')]({'isolationLevel':db[_0x19bb('0xcb')][_0x19bb('0x10b')]['ISOLATION_LEVELS'][_0x19bb('0x10c')]},function(_0x540643){return db[_0x19bb('0x30')][_0x19bb('0x54')]({'where':{'id':_0x4fb887},'transaction':_0x540643})[_0x19bb('0x14')](function(_0x10a856){if(_0x10a856){return db[_0x19bb('0x10d')]['destroy']({'where':{'ChatWebsiteId':_0x4fb887},'transaction':_0x540643})[_0x19bb('0x14')](function(){var _0x5a6dbf=_[_0x19bb('0x2f')](_0x2ccc5f,function(_0x1eb074){_0x1eb074['ChatWebsiteId']=_0x4fb887;return _0x1eb074;});return db[_0x19bb('0x10d')][_0x19bb('0xcd')](_0x5a6dbf,{'transaction':_0x540643});});}else{_0x3acc8a=0x194;_0x55844e=[];}});})[_0x19bb('0x14')](function(){if(_0x3acc8a!==0x194){return db[_0x19bb('0x10d')][_0x19bb('0x10e')]({'where':{'ChatWebsiteId':_0x4fb887},'order':_0x19bb('0x8f')})[_0x19bb('0x14')](function(_0x2f1aef){_0x55844e=_0x2f1aef;});}})[_0x19bb('0x1e')](function(_0xbf1d56){_0x3acc8a=0x1f4;logger[_0x19bb('0x1a')](_0xbf1d56[_0x19bb('0x10f')]);if(_0xbf1d56[_0x19bb('0x2b')]){delete _0xbf1d56[_0x19bb('0x2b')];}_0x55844e=_0xbf1d56;})[_0x19bb('0x110')](function(){if(_0x55844e===null){_0x4fc51c[_0x19bb('0x2a')](_0x3acc8a);}else{if(_0x3acc8a===0x1f4){_0x4fc51c[_0x19bb('0x1f')](_0x3acc8a)['send'](_0x55844e);}else{_0x4fc51c[_0x19bb('0x1f')](_0x3acc8a)[_0x19bb('0x21')](_0x55844e);}}});};exports[_0x19bb('0x111')]=function(_0x4352ec,_0x5af697){var _0x35c811={};var _0x300e21={};var _0x1015e0;var _0x321d6e;return db[_0x19bb('0x30')][_0x19bb('0x54')]({'where':{'id':_0x4352ec[_0x19bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5af697,null))[_0x19bb('0x14')](function(_0x450d47){if(_0x450d47){_0x1015e0=_0x450d47;_0x300e21[_0x19bb('0x38')]=_[_0x19bb('0x35')](db[_0x19bb('0x10d')][_0x19bb('0x31')]);_0x300e21['query']=_[_0x19bb('0x35')](_0x4352ec[_0x19bb('0x34')]);_0x300e21[_0x19bb('0x36')]=_[_0x19bb('0x37')](_0x300e21[_0x19bb('0x38')],_0x300e21[_0x19bb('0x34')]);_0x35c811[_0x19bb('0x39')]=_[_0x19bb('0x37')](_0x300e21['model'],qs[_0x19bb('0x3a')](_0x4352ec[_0x19bb('0x34')][_0x19bb('0x3a')]));_0x35c811['attributes']=_0x35c811[_0x19bb('0x39')][_0x19bb('0x3b')]?_0x35c811[_0x19bb('0x39')]:_0x300e21[_0x19bb('0x38')];_0x35c811[_0x19bb('0x3e')]=qs[_0x19bb('0x3f')](_0x4352ec[_0x19bb('0x34')][_0x19bb('0x3f')]);_0x35c811['where']=qs['filters'](_['pick'](_0x4352ec[_0x19bb('0x34')],_0x300e21[_0x19bb('0x36')]));if(_0x4352ec[_0x19bb('0x34')][_0x19bb('0x40')]){_0x35c811[_0x19bb('0x41')]=_['merge'](_0x35c811['where'],{'$or':_[_0x19bb('0x2f')](_0x35c811[_0x19bb('0x39')],function(_0x5bd6e4){var _0x5b4235={};_0x5b4235[_0x5bd6e4]={'$like':'%'+_0x4352ec[_0x19bb('0x34')]['filter']+'%'};return _0x5b4235;})});}_0x35c811=_['merge']({},_0x35c811,_0x4352ec[_0x19bb('0x44')]);return _0x1015e0[_0x19bb('0x111')](_0x35c811);}})[_0x19bb('0x14')](function(_0x3d4890){if(_0x3d4890){_0x321d6e=_0x3d4890[_0x19bb('0x3b')];if(!_0x4352ec[_0x19bb('0x34')][_0x19bb('0x3c')]('nolimit')){_0x35c811[_0x19bb('0x24')]=qs['limit'](_0x4352ec[_0x19bb('0x34')][_0x19bb('0x24')]);_0x35c811[_0x19bb('0x22')]=qs[_0x19bb('0x22')](_0x4352ec[_0x19bb('0x34')]['offset']);}return _0x1015e0[_0x19bb('0x111')](_0x35c811);}})[_0x19bb('0x14')](function(_0x5d6b99){if(_0x5d6b99){return _0x5d6b99?{'count':_0x321d6e,'rows':_0x5d6b99}:null;}})['then'](respondWithResult(_0x5af697,null))[_0x19bb('0x1e')](handleError(_0x5af697,null));};exports[_0x19bb('0x112')]=function(_0x31acbb,_0x4456f8){return db[_0x19bb('0x113')][_0x19bb('0x4b')]({'where':{'id':_0x31acbb[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x4456f8,null))['then'](function(_0x364f9e){if(_0x364f9e){return _0x364f9e[_0x19bb('0x112')](_0x31acbb[_0x19bb('0x4d')]['ids'],_[_0x19bb('0xe1')](_0x31acbb[_0x19bb('0x4d')],['ids','id'])||{});}})[_0x19bb('0x14')](respondWithResult(_0x4456f8,null))['catch'](handleError(_0x4456f8,null));};exports[_0x19bb('0x114')]=function(_0x231845,_0x4254ce){var _0x13ec72={};var _0x2f33b1={};var _0x30123c;var _0xb25b52;return db['ChatWebsite'][_0x19bb('0x54')]({'where':{'id':_0x231845[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x4254ce,null))[_0x19bb('0x14')](function(_0x310ecb){if(_0x310ecb){_0x30123c=_0x310ecb;_0x2f33b1[_0x19bb('0x38')]=_['keys'](db[_0x19bb('0x115')][_0x19bb('0x31')]);_0x2f33b1[_0x19bb('0x34')]=_[_0x19bb('0x35')](_0x231845[_0x19bb('0x34')]);_0x2f33b1[_0x19bb('0x36')]=_[_0x19bb('0x37')](_0x2f33b1[_0x19bb('0x38')],_0x2f33b1['query']);_0x13ec72[_0x19bb('0x39')]=_[_0x19bb('0x37')](_0x2f33b1[_0x19bb('0x38')],qs[_0x19bb('0x3a')](_0x231845[_0x19bb('0x34')]['fields']));_0x13ec72['attributes']=_0x13ec72[_0x19bb('0x39')][_0x19bb('0x3b')]?_0x13ec72[_0x19bb('0x39')]:_0x2f33b1['model'];_0x13ec72['order']=qs[_0x19bb('0x3f')](_0x231845[_0x19bb('0x34')][_0x19bb('0x3f')]);_0x13ec72[_0x19bb('0x41')]=qs[_0x19bb('0x36')](_[_0x19bb('0x55')](_0x231845[_0x19bb('0x34')],_0x2f33b1[_0x19bb('0x36')]));if(_0x231845[_0x19bb('0x34')][_0x19bb('0x40')]){_0x13ec72[_0x19bb('0x41')]=_['merge'](_0x13ec72[_0x19bb('0x41')],{'$or':_[_0x19bb('0x2f')](_0x13ec72['attributes'],function(_0x9fe596){var _0x520475={};_0x520475[_0x9fe596]={'$like':'%'+_0x231845['query'][_0x19bb('0x40')]+'%'};return _0x520475;})});}_0x13ec72=_[_0x19bb('0x42')]({},_0x13ec72,_0x231845[_0x19bb('0x44')]);return _0x30123c['getProactiveActions'](_0x13ec72);}})['then'](function(_0x1ea4c3){if(_0x1ea4c3){_0xb25b52=_0x1ea4c3[_0x19bb('0x3b')];if(!_0x231845[_0x19bb('0x34')]['hasOwnProperty'](_0x19bb('0x3d'))){_0x13ec72[_0x19bb('0x24')]=qs[_0x19bb('0x24')](_0x231845['query'][_0x19bb('0x24')]);_0x13ec72[_0x19bb('0x22')]=qs[_0x19bb('0x22')](_0x231845['query']['offset']);}return _0x30123c[_0x19bb('0x114')](_0x13ec72);}})['then'](function(_0x22da9c){if(_0x22da9c){return _0x22da9c?{'count':_0xb25b52,'rows':_0x22da9c}:null;}})[_0x19bb('0x14')](respondWithResult(_0x4254ce,null))[_0x19bb('0x1e')](handleError(_0x4254ce,null));};exports[_0x19bb('0x116')]=function(_0x410d70,_0x505294){var _0x5591de=_0x410d70[_0x19bb('0x34')][_0x19bb('0x117')]===_0x19bb('0x118')?'offlineForm':_0x19bb('0x119');return db['ChatWebsite'][_0x19bb('0x4b')]({'attributes':['id',_0x5591de],'where':{'id':_0x410d70[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x505294,null))[_0x19bb('0x14')](function(_0x312c35){if(_0x312c35){var _0x16d32f=_0x312c35[_0x5591de];var _0x29de2d=_0x16d32f&&_0x16d32f[_0x19bb('0x11a')]?_0x16d32f[_0x19bb('0x11a')]:[];_0x505294['send']({'fromKey':_[_0x19bb('0x69')](_0x16d32f[_0x19bb('0x11b')])?undefined:_0x16d32f['fromKey'],'count':_0x29de2d[_0x19bb('0x3b')],'rows':_0x29de2d});}})[_0x19bb('0x1e')](handleError(_0x505294,null));};exports['getOfflineMessages']=function(_0x5c6bd5,_0x2bf5f9){var _0x4c9d0c={'raw':![],'where':{}};var _0x1bc8e3={};var _0x1b4945={'count':0x0,'rows':[]};return db[_0x19bb('0x30')]['findOne']({'where':{'id':_0x5c6bd5[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x2bf5f9,null))[_0x19bb('0x14')](function(_0x35d8ae){if(_0x35d8ae){_0x1bc8e3['model']=_[_0x19bb('0x35')](db[_0x19bb('0x11c')][_0x19bb('0x31')]);_0x1bc8e3[_0x19bb('0x34')]=_['keys'](_0x5c6bd5[_0x19bb('0x34')]);_0x1bc8e3['filters']=_[_0x19bb('0x37')](_0x1bc8e3[_0x19bb('0x38')],_0x1bc8e3[_0x19bb('0x34')]);_0x4c9d0c['attributes']=_[_0x19bb('0x37')](_0x1bc8e3[_0x19bb('0x38')],qs[_0x19bb('0x3a')](_0x5c6bd5[_0x19bb('0x34')][_0x19bb('0x3a')]));_0x4c9d0c[_0x19bb('0x39')]=_0x4c9d0c[_0x19bb('0x39')]['length']?_0x4c9d0c[_0x19bb('0x39')]:_0x1bc8e3[_0x19bb('0x38')];if(!_0x5c6bd5[_0x19bb('0x34')]['hasOwnProperty']('nolimit')){_0x4c9d0c[_0x19bb('0x24')]=qs[_0x19bb('0x24')](_0x5c6bd5['query'][_0x19bb('0x24')]);_0x4c9d0c['offset']=qs[_0x19bb('0x22')](_0x5c6bd5[_0x19bb('0x34')][_0x19bb('0x22')]);}_0x4c9d0c[_0x19bb('0x3e')]=qs[_0x19bb('0x3f')](_0x5c6bd5[_0x19bb('0x34')][_0x19bb('0x3f')]);_0x4c9d0c['where']=qs[_0x19bb('0x36')](_['pick'](_0x5c6bd5['query'],_0x1bc8e3[_0x19bb('0x36')]));_0x4c9d0c[_0x19bb('0x41')][_0x19bb('0x59')]=_0x35d8ae['id'];if(_0x5c6bd5[_0x19bb('0x34')][_0x19bb('0x40')]){_0x4c9d0c['where']=_['merge'](_0x4c9d0c[_0x19bb('0x41')],{'$or':_[_0x19bb('0x2f')](_0x4c9d0c[_0x19bb('0x39')],function(_0x43ee98){var _0x19db06={};_0x19db06[_0x43ee98]={'$like':'%'+_0x5c6bd5[_0x19bb('0x34')]['filter']+'%'};return _0x19db06;})});}_0x4c9d0c=_[_0x19bb('0x42')]({},_0x4c9d0c,_0x5c6bd5['options']);return db[_0x19bb('0x11c')][_0x19bb('0x45')]({'where':_0x4c9d0c[_0x19bb('0x41')]})['then'](function(_0x453697){_0x1b4945[_0x19bb('0x45')]=_0x453697;if(_0x5c6bd5[_0x19bb('0x34')]['includeAll']){_0x4c9d0c[_0x19bb('0x47')]=[{'all':!![]}];}else{_0x4c9d0c['include']=[{'model':db['CmContact'],'as':_0x19bb('0xe3'),'required':![]},{'model':db[_0x19bb('0x11d')],'as':_0x19bb('0x11e'),'required':![]}];}return db['ChatOfflineMessage'][_0x19bb('0x48')](_0x4c9d0c);})[_0x19bb('0x14')](function(_0x4e653e){_0x1b4945[_0x19bb('0x56')]=_0x4e653e;return _0x1b4945;});}})['then'](respondWithFilteredResult(_0x2bf5f9,_0x4c9d0c))['catch'](handleError(_0x2bf5f9,null));};exports['addAgents']=function(_0x532816,_0x162806){return db[_0x19bb('0x30')]['find']({'where':{'id':_0x532816[_0x19bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x162806,null))['then'](function(_0x762184){if(_0x762184){return _0x762184[_0x19bb('0x11f')](_0x532816['body'][_0x19bb('0x5d')],_[_0x19bb('0xe1')](_0x532816[_0x19bb('0x4d')],['ids','id'])||{})[_0x19bb('0xa6')](function(_0x5b41bb){for(var _0x592bbf=0x0;_0x592bbf<_0x532816['body'][_0x19bb('0x5d')][_0x19bb('0x3b')];_0x592bbf+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x532816[_0x19bb('0x4d')][_0x19bb('0x5d')][_0x592bbf]),'ChatWebsiteId':Number(_0x532816[_0x19bb('0x4a')]['id'])});}return _0x5b41bb;});}})[_0x19bb('0x14')](respondWithResult(_0x162806,null))[_0x19bb('0x1e')](handleError(_0x162806,null));};exports[_0x19bb('0x120')]=function(_0x3817bb,_0x4153d3){return db[_0x19bb('0x30')][_0x19bb('0x4b')]({'where':{'id':_0x3817bb[_0x19bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4153d3,null))['then'](function(_0x381885){if(_0x381885){return _0x381885[_0x19bb('0x120')](_0x3817bb[_0x19bb('0x34')]['ids'])['then'](function(){if(_[_0x19bb('0x121')](_0x3817bb[_0x19bb('0x34')][_0x19bb('0x5d')])){for(var _0x4dd600=0x0;_0x4dd600<_0x3817bb['query'][_0x19bb('0x5d')][_0x19bb('0x3b')];_0x4dd600+=0x1){socket[_0x19bb('0x122')](_0x19bb('0x123'),{'UserId':Number(_0x3817bb['query'][_0x19bb('0x5d')][_0x4dd600]),'ChatWebsiteId':Number(_0x3817bb[_0x19bb('0x4a')]['id'])});}}else{socket[_0x19bb('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x3817bb[_0x19bb('0x34')][_0x19bb('0x5d')]),'ChatWebsiteId':Number(_0x3817bb[_0x19bb('0x4a')]['id'])});}});}})[_0x19bb('0x14')](respondWithStatusCode(_0x4153d3,null))[_0x19bb('0x1e')](handleError(_0x4153d3,null));};exports[_0x19bb('0x124')]=function(_0x1dada,_0x2a0272){var _0x5ae96c={};var _0x3b5449={};var _0x186bbd;var _0x2c367b;return db[_0x19bb('0x30')]['findOne']({'where':{'id':_0x1dada[_0x19bb('0x4a')]['id']}})[_0x19bb('0x14')](handleEntityNotFound(_0x2a0272,null))[_0x19bb('0x14')](function(_0x2a425e){if(_0x2a425e){_0x186bbd=_0x2a425e;_0x3b5449[_0x19bb('0x38')]=_[_0x19bb('0x35')](db['User'][_0x19bb('0x31')]);_0x3b5449[_0x19bb('0x34')]=_[_0x19bb('0x35')](_0x1dada[_0x19bb('0x34')]);_0x3b5449[_0x19bb('0x36')]=_['intersection'](_0x3b5449[_0x19bb('0x38')],_0x3b5449[_0x19bb('0x34')]);_0x5ae96c[_0x19bb('0x39')]=_[_0x19bb('0x37')](_0x3b5449[_0x19bb('0x38')],qs[_0x19bb('0x3a')](_0x1dada['query'][_0x19bb('0x3a')]));_0x5ae96c[_0x19bb('0x39')]=_0x5ae96c[_0x19bb('0x39')][_0x19bb('0x3b')]?_0x5ae96c[_0x19bb('0x39')]:_0x3b5449[_0x19bb('0x38')];_0x5ae96c[_0x19bb('0x3e')]=qs[_0x19bb('0x3f')](_0x1dada[_0x19bb('0x34')][_0x19bb('0x3f')]);_0x5ae96c[_0x19bb('0x41')]=qs['filters'](_[_0x19bb('0x55')](_0x1dada[_0x19bb('0x34')],_0x3b5449[_0x19bb('0x36')]));if(_0x1dada['query'][_0x19bb('0x40')]){_0x5ae96c['where']=_[_0x19bb('0x42')](_0x5ae96c['where'],{'$or':_['map'](_0x5ae96c[_0x19bb('0x39')],function(_0x31e00f){var _0x1b572e={};_0x1b572e[_0x31e00f]={'$like':'%'+_0x1dada[_0x19bb('0x34')][_0x19bb('0x40')]+'%'};return _0x1b572e;})});}_0x5ae96c=_['merge']({},_0x5ae96c,_0x1dada[_0x19bb('0x44')]);return _0x186bbd[_0x19bb('0x124')](_0x5ae96c);}})[_0x19bb('0x14')](function(_0x27ddb5){if(_0x27ddb5){_0x2c367b=_0x27ddb5[_0x19bb('0x3b')];if(!_0x1dada[_0x19bb('0x34')][_0x19bb('0x3c')](_0x19bb('0x3d'))){_0x5ae96c[_0x19bb('0x24')]=qs[_0x19bb('0x24')](_0x1dada['query'][_0x19bb('0x24')]);_0x5ae96c[_0x19bb('0x22')]=qs[_0x19bb('0x22')](_0x1dada[_0x19bb('0x34')][_0x19bb('0x22')]);}return _0x186bbd[_0x19bb('0x124')](_0x5ae96c);}})[_0x19bb('0x14')](function(_0x449baa){if(_0x449baa){return _0x449baa?{'count':_0x2c367b,'rows':_0x449baa}:null;}})[_0x19bb('0x14')](respondWithResult(_0x2a0272,null))[_0x19bb('0x1e')](handleError(_0x2a0272,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 5f273af..061378b 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 _0xec39=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','hook'];(function(_0x2c4076,_0x2ac9dd){var _0x42535d=function(_0x3701ec){while(--_0x3701ec){_0x2c4076['push'](_0x2c4076['shift']());}};_0x42535d(++_0x2ac9dd);}(_0xec39,0x19f));var _0x9ec3=function(_0x464437,_0x13865f){_0x464437=_0x464437-0x0;var _0x3cb0af=_0xec39[_0x464437];return _0x3cb0af;};'use strict';var EventEmitter=require(_0x9ec3('0x0'));var ChatWebsite=require(_0x9ec3('0x1'))['db'][_0x9ec3('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9ec3('0x3')](0x0);var events={'afterCreate':_0x9ec3('0x4'),'afterUpdate':_0x9ec3('0x5'),'afterDestroy':_0x9ec3('0x6')};function emitEvent(_0x5c0885){return function(_0x1f43fb,_0x1c944d,_0xaff658){ChatWebsiteEvents['emit'](_0x5c0885+':'+_0x1f43fb['id'],_0x1f43fb);ChatWebsiteEvents['emit'](_0x5c0885,_0x1f43fb);_0xaff658(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x9ec3('0x7')](e,emitEvent(event));}}module[_0x9ec3('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xbc17=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x3f2e37,_0x49729a){var _0x1a468e=function(_0x1cc755){while(--_0x1cc755){_0x3f2e37['push'](_0x3f2e37['shift']());}};_0x1a468e(++_0x49729a);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x1031ab,_0x11a0e6){_0x1031ab=_0x1031ab-0x0;var _0x15ba29=_0xbc17[_0x1031ab];return _0x15ba29;};'use strict';var EventEmitter=require(_0x7bc1('0x0'));var ChatWebsite=require(_0x7bc1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7bc1('0x2')](0x0);var events={'afterCreate':_0x7bc1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ff36d){return function(_0x7aa41e,_0x5dfaa8,_0x2cd126){ChatWebsiteEvents['emit'](_0x3ff36d+':'+_0x7aa41e['id'],_0x7aa41e);ChatWebsiteEvents[_0x7bc1('0x4')](_0x3ff36d,_0x7aa41e);_0x2cd126(null);};}for(var e in events){if(events[_0x7bc1('0x5')](e)){var event=events[e];ChatWebsite[_0x7bc1('0x6')](e,emitEvent(event));}}module[_0x7bc1('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 918430f..aabd5ee 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 _0x295f=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x14665e,_0x52b2ff){var _0x570836=function(_0x4bacb8){while(--_0x4bacb8){_0x14665e['push'](_0x14665e['shift']());}};_0x570836(++_0x52b2ff);}(_0x295f,0x75));var _0xf295=function(_0x22e6b7,_0x39266c){_0x22e6b7=_0x22e6b7-0x0;var _0x2723e5=_0x295f[_0x22e6b7];return _0x2723e5;};'use strict';var _=require(_0xf295('0x0'));var util=require(_0xf295('0x1'));var logger=require(_0xf295('0x2'))(_0xf295('0x3'));var moment=require(_0xf295('0x4'));var BPromise=require(_0xf295('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf295('0x6'));var rimraf=require(_0xf295('0x7'));var config=require('../../config/environment');var attributes=require(_0xf295('0x8'));module[_0xf295('0x9')]=function(_0x4921d3,_0x6e5542){return _0x4921d3[_0xf295('0xa')](_0xf295('0xb'),attributes,{'tableName':_0xf295('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb041=['moment','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x3ba76e,_0x1cec09){var _0x4e0914=function(_0x5925a2){while(--_0x5925a2){_0x3ba76e['push'](_0x3ba76e['shift']());}};_0x4e0914(++_0x1cec09);}(_0xb041,0x141));var _0x1b04=function(_0x411870,_0x17d294){_0x411870=_0x411870-0x0;var _0x58f425=_0xb041[_0x411870];return _0x58f425;};'use strict';var _=require(_0x1b04('0x0'));var util=require(_0x1b04('0x1'));var logger=require(_0x1b04('0x2'))(_0x1b04('0x3'));var moment=require(_0x1b04('0x4'));var BPromise=require('bluebird');var rp=require(_0x1b04('0x5'));var fs=require('fs');var path=require(_0x1b04('0x6'));var rimraf=require('rimraf');var config=require(_0x1b04('0x7'));var attributes=require(_0x1b04('0x8'));module[_0x1b04('0x9')]=function(_0x4db2aa,_0x4478fe){return _0x4db2aa[_0x1b04('0xa')](_0x1b04('0xb'),attributes,{'tableName':_0x1b04('0xc'),'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 e91f2a6..78a3e73 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 _0x324c=['message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x47c971,_0x1d9876){var _0x494edf=function(_0x106843){while(--_0x106843){_0x47c971['push'](_0x47c971['shift']());}};_0x494edf(++_0x1d9876);}(_0x324c,0xca));var _0xc324=function(_0x31d304,_0x2981d1){_0x31d304=_0x31d304-0x0;var _0x4bcadd=_0x324c[_0x31d304];return _0x4bcadd;};'use strict';var _=require(_0xc324('0x0'));var util=require(_0xc324('0x1'));var moment=require(_0xc324('0x2'));var BPromise=require('bluebird');var rs=require(_0xc324('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc324('0x4'))['db'];var utils=require(_0xc324('0x5'));var logger=require(_0xc324('0x6'))(_0xc324('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc324('0x8')][_0xc324('0x9')]({'port':0x232a});config[_0xc324('0xa')]=_[_0xc324('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc324('0xa')]));require(_0xc324('0xc'))[_0xc324('0xd')](socket);function respondWithRpcPromise(_0x197838,_0xb6a45a,_0x3a0b3a){return new BPromise(function(_0x192e72,_0x3672c3){return client['request'](_0x197838,_0x3a0b3a)[_0xc324('0xe')](function(_0x34adae){logger[_0xc324('0xf')](_0xc324('0x10'),_0xb6a45a,_0xc324('0x11'));logger[_0xc324('0x12')](_0xc324('0x13'),_0xb6a45a,_0xc324('0x11'),JSON[_0xc324('0x14')](_0x34adae));if(_0x34adae[_0xc324('0x15')]){if(_0x34adae['error'][_0xc324('0x16')]===0x1f4){logger[_0xc324('0x15')](_0xc324('0x10'),_0xb6a45a,_0x34adae['error'][_0xc324('0x17')]);return _0x3672c3(_0x34adae[_0xc324('0x15')][_0xc324('0x17')]);}logger['error'](_0xc324('0x10'),_0xb6a45a,_0x34adae[_0xc324('0x15')][_0xc324('0x17')]);return _0x192e72(_0x34adae['error'][_0xc324('0x17')]);}else{logger['info'](_0xc324('0x10'),_0xb6a45a,_0xc324('0x11'));_0x192e72(_0x34adae[_0xc324('0x18')][_0xc324('0x17')]);}})['catch'](function(_0x3634b6){logger['error'](_0xc324('0x10'),_0xb6a45a,_0x3634b6);_0x3672c3(_0x3634b6);});});} \ No newline at end of file +var _0x2b97=['ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./chatWebsite.socket','register','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b97,0xb8));var _0x72b9=function(_0x469df0,_0x5a806f){_0x469df0=_0x469df0-0x0;var _0x16bcea=_0x2b97[_0x469df0];return _0x16bcea;};'use strict';var _=require(_0x72b9('0x0'));var util=require(_0x72b9('0x1'));var moment=require(_0x72b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x72b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b9('0x4'))['db'];var utils=require(_0x72b9('0x5'));var logger=require(_0x72b9('0x6'))(_0x72b9('0x7'));var config=require(_0x72b9('0x8'));var jayson=require(_0x72b9('0x9'));var client=jayson['client'][_0x72b9('0xa')]({'port':0x232a});config[_0x72b9('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72b9('0xb')]));require(_0x72b9('0xc'))[_0x72b9('0xd')](socket);function respondWithRpcPromise(_0x46ce33,_0x3344fe,_0x508f8e){return new BPromise(function(_0x3b452e,_0x95d957){return client[_0x72b9('0xe')](_0x46ce33,_0x508f8e)[_0x72b9('0xf')](function(_0x34e4ce){logger['info'](_0x72b9('0x10'),_0x3344fe,'request\x20sent');logger[_0x72b9('0x11')](_0x72b9('0x12'),_0x3344fe,_0x72b9('0x13'),JSON[_0x72b9('0x14')](_0x34e4ce));if(_0x34e4ce[_0x72b9('0x15')]){if(_0x34e4ce[_0x72b9('0x15')]['code']===0x1f4){logger[_0x72b9('0x15')](_0x72b9('0x10'),_0x3344fe,_0x34e4ce[_0x72b9('0x15')][_0x72b9('0x16')]);return _0x95d957(_0x34e4ce['error'][_0x72b9('0x16')]);}logger[_0x72b9('0x15')](_0x72b9('0x10'),_0x3344fe,_0x34e4ce[_0x72b9('0x15')][_0x72b9('0x16')]);return _0x3b452e(_0x34e4ce[_0x72b9('0x15')][_0x72b9('0x16')]);}else{logger[_0x72b9('0x17')](_0x72b9('0x10'),_0x3344fe,'request\x20sent');_0x3b452e(_0x34e4ce[_0x72b9('0x18')]['message']);}})['catch'](function(_0x441f6f){logger[_0x72b9('0x15')](_0x72b9('0x10'),_0x3344fe,_0x441f6f);_0x95d957(_0x441f6f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2913889..58a5278 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 _0x8496=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0xfcf0a5,_0x220889){var _0x42edb2=function(_0x1331da){while(--_0x1331da){_0xfcf0a5['push'](_0xfcf0a5['shift']());}};_0x42edb2(++_0x220889);}(_0x8496,0xb9));var _0x6849=function(_0x24fd48,_0x450500){_0x24fd48=_0x24fd48-0x0;var _0x4bd480=_0x8496[_0x24fd48];return _0x4bd480;};'use strict';var ChatWebsiteEvents=require(_0x6849('0x0'));var events=[_0x6849('0x1'),_0x6849('0x2'),_0x6849('0x3')];function createListener(_0x3c7a70,_0x100eda){return function(_0x58dbf0){_0x100eda[_0x6849('0x4')](_0x3c7a70,_0x58dbf0);};}function removeListener(_0x3ed58e,_0x147aa2){return function(){ChatWebsiteEvents[_0x6849('0x5')](_0x3ed58e,_0x147aa2);};}exports[_0x6849('0x6')]=function(_0xcfd57f){for(var _0x5b23f8=0x0,_0x2babec=events[_0x6849('0x7')];_0x5b23f8<_0x2babec;_0x5b23f8++){var _0x26fb3e=events[_0x5b23f8];var _0x49db49=createListener(_0x6849('0x8')+_0x26fb3e,_0xcfd57f);ChatWebsiteEvents['on'](_0x26fb3e,_0x49db49);}}; \ No newline at end of file +var _0x3430=['register','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x362196,_0x28cf45){var _0x4407f5=function(_0x1060c1){while(--_0x1060c1){_0x362196['push'](_0x362196['shift']());}};_0x4407f5(++_0x28cf45);}(_0x3430,0x172));var _0x0343=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3430[_0x3ab51d];return _0x29a04e;};'use strict';var ChatWebsiteEvents=require(_0x0343('0x0'));var events=[_0x0343('0x1'),_0x0343('0x2'),_0x0343('0x3')];function createListener(_0x2c723d,_0x36098f){return function(_0x3920ca){_0x36098f[_0x0343('0x4')](_0x2c723d,_0x3920ca);};}function removeListener(_0x1f8860,_0x41d862){return function(){ChatWebsiteEvents[_0x0343('0x5')](_0x1f8860,_0x41d862);};}exports[_0x0343('0x6')]=function(_0x2476cc){for(var _0x3c2481=0x0,_0x1cfc41=events['length'];_0x3c2481<_0x1cfc41;_0x3c2481++){var _0xdbf604=events[_0x3c2481];var _0x4e8a22=createListener(_0x0343('0x7')+_0xdbf604,_0x2476cc);ChatWebsiteEvents['on'](_0xdbf604,_0x4e8a22);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index e45beeb..1b66ea6 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 _0xcf3b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','format','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','extname','/:id/offline','any','offline','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','/:id/canned_answers','exports','multer','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf3b,0x1df));var _0xbcf3=function(_0x29b9b9,_0x11b3d1){_0x29b9b9=_0x29b9b9-0x0;var _0x2f8cc8=_0xcf3b[_0x29b9b9];return _0x2f8cc8;};'use strict';var multer=require(_0xbcf3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbcf3('0x1'));var express=require(_0xbcf3('0x2'));var router=express[_0xbcf3('0x3')]();var fs_extra=require(_0xbcf3('0x4'));var auth=require(_0xbcf3('0x5'));var interaction=require(_0xbcf3('0x6'));var config=require(_0xbcf3('0x7'));var controller=require('./chatWebsite.controller');router[_0xbcf3('0x8')]('/',auth[_0xbcf3('0x9')](),controller[_0xbcf3('0xa')]);router[_0xbcf3('0x8')](_0xbcf3('0xb'),auth[_0xbcf3('0x9')](),controller[_0xbcf3('0xc')]);router[_0xbcf3('0x8')](_0xbcf3('0xd'),auth[_0xbcf3('0x9')](),controller[_0xbcf3('0xe')]);router[_0xbcf3('0x8')](_0xbcf3('0xf'),auth[_0xbcf3('0x9')](),controller['getDispositions']);router[_0xbcf3('0x8')]('/:id/canned_answers',auth[_0xbcf3('0x9')](),controller['getAnswers']);router[_0xbcf3('0x8')](_0xbcf3('0x10'),controller['getLogo']);router[_0xbcf3('0x8')](_0xbcf3('0x11'),controller[_0xbcf3('0x12')]);router[_0xbcf3('0x8')]('/:id/customer_avatar',controller[_0xbcf3('0x13')]);router[_0xbcf3('0x8')](_0xbcf3('0x14'),controller[_0xbcf3('0x15')]);router['get'](_0xbcf3('0x16'),auth[_0xbcf3('0x9')](),controller[_0xbcf3('0x17')]);router['get'](_0xbcf3('0x18'),controller['getSnippet']);router['get']('/:id/applications',auth[_0xbcf3('0x9')](),controller[_0xbcf3('0x19')]);router[_0xbcf3('0x8')]('/:id/proactive_actions',auth[_0xbcf3('0x9')](),controller[_0xbcf3('0x1a')]);router[_0xbcf3('0x8')](_0xbcf3('0x1b'),controller[_0xbcf3('0x1c')]);router[_0xbcf3('0x8')]('/:id/offline_messages',auth[_0xbcf3('0x9')](),controller[_0xbcf3('0x1d')]);router[_0xbcf3('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xbcf3('0x1e')]);router[_0xbcf3('0x1f')]('/',auth[_0xbcf3('0x9')](),controller['create']);router['post'](_0xbcf3('0xf'),auth['isAuthenticated'](),controller[_0xbcf3('0x20')]);router[_0xbcf3('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xbcf3('0x21')]);var upload=multer({'storage':multer[_0xbcf3('0x22')]({'destination':function(_0x40f65d,_0x443b1b,_0x4f4f1c){_0x4f4f1c(null,path[_0xbcf3('0x23')](config[_0xbcf3('0x24')],_0xbcf3('0x25')));},'filename':function(_0x2acfce,_0x8f732b,_0x5be8a6){_0x5be8a6(null,util['format'](_0xbcf3('0x26'),Date[_0xbcf3('0x27')](),_0x8f732b[_0xbcf3('0x28')]));}})});router[_0xbcf3('0x1f')](_0xbcf3('0x10'),upload[_0xbcf3('0x29')](_0xbcf3('0x2a')),controller[_0xbcf3('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5738c8,_0x5e553c,_0x294e1d){_0x294e1d(null,path[_0xbcf3('0x23')](config[_0xbcf3('0x24')],'server/files/images/avatars/'));},'filename':function(_0xd9ccf,_0x419dc3,_0xab9f1d){_0xab9f1d(null,util[_0xbcf3('0x2c')](_0xbcf3('0x26'),Date[_0xbcf3('0x27')](),_0x419dc3[_0xbcf3('0x28')]));}})});router['post'](_0xbcf3('0x11'),upload[_0xbcf3('0x29')](_0xbcf3('0x2a')),controller[_0xbcf3('0x2d')]);var upload=multer({'storage':multer[_0xbcf3('0x22')]({'destination':function(_0x40f77e,_0x31f22a,_0x39a3ea){_0x39a3ea(null,path['join'](config[_0xbcf3('0x24')],_0xbcf3('0x2e')));},'filename':function(_0x13279a,_0x1bdc5e,_0x33d182){_0x33d182(null,util[_0xbcf3('0x2c')](_0xbcf3('0x26'),Date['now'](),_0x1bdc5e[_0xbcf3('0x28')]));}})});router['post']('/:id/customer_avatar',upload['single'](_0xbcf3('0x2a')),controller[_0xbcf3('0x2f')]);var upload=multer({'storage':multer[_0xbcf3('0x22')]({'destination':function(_0x2242c0,_0x641e7f,_0x37bdcb){_0x37bdcb(null,path[_0xbcf3('0x23')](config[_0xbcf3('0x24')],_0xbcf3('0x2e')));},'filename':function(_0x4c78dd,_0x1edfe1,_0x698126){_0x698126(null,util[_0xbcf3('0x2c')]('%s-%s',Date[_0xbcf3('0x27')](),_0x1edfe1['originalname']));}})});router[_0xbcf3('0x1f')](_0xbcf3('0x14'),upload[_0xbcf3('0x29')]('file'),controller['addSystemAvatar']);router[_0xbcf3('0x1f')](_0xbcf3('0x30'),controller[_0xbcf3('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xbcf3('0x22')]({'destination':function(_0x37d55e,_0x149396,_0x155785){const _0x11c043=path[_0xbcf3('0x23')](config[_0xbcf3('0x24')],_0xbcf3('0x32'),'attachments',_0xbcf3('0x33'));fs_extra[_0xbcf3('0x34')](_0x11c043,function(){_0x155785(null,_0x11c043);});},'filename':function(_0x86d514,_0x191a66,_0x8f7f6){const _0x587562=_0x191a66['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x438539=path[_0xbcf3('0x35')](_0x587562);const _0x31e983=Date['now']()+'-'+_0x587562['replace'](_0x438539,'')+_0x438539;_0x8f7f6(null,_0x31e983);}})});router[_0xbcf3('0x1f')](_0xbcf3('0x36'),offlineUploadMulter[_0xbcf3('0x37')](),controller[_0xbcf3('0x38')]);router[_0xbcf3('0x1f')](_0xbcf3('0x16'),auth[_0xbcf3('0x9')](),controller['addInteraction']);router[_0xbcf3('0x1f')](_0xbcf3('0x39'),auth[_0xbcf3('0x9')](),controller[_0xbcf3('0x3a')]);router['post'](_0xbcf3('0x3b'),auth[_0xbcf3('0x9')](),controller[_0xbcf3('0x3c')]);router[_0xbcf3('0x1f')](_0xbcf3('0x3d'),auth[_0xbcf3('0x9')](),controller[_0xbcf3('0x3e')]);router[_0xbcf3('0x3f')](_0xbcf3('0xd'),auth[_0xbcf3('0x9')](),controller[_0xbcf3('0x40')]);router[_0xbcf3('0x41')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xbcf3('0x41')](_0xbcf3('0xf'),auth['isAuthenticated'](),controller[_0xbcf3('0x42')]);router[_0xbcf3('0x41')](_0xbcf3('0x43'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0xbcf3('0x3d'),auth[_0xbcf3('0x9')](),controller['removeAgents']);module[_0xbcf3('0x44')]=router; \ No newline at end of file +var _0x84c2=['getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','/:id/dispositions','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','format','/:id/customer_avatar','addCustomerAvatar','notify','server/files','attachments','offline-chat','replace','/:id/offline','any','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','get','isAuthenticated','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84c2,0x18c));var _0x284c=function(_0x23d50e,_0x378059){_0x23d50e=_0x23d50e-0x0;var _0x1ce88f=_0x84c2[_0x23d50e];return _0x1ce88f;};'use strict';var multer=require(_0x284c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x284c('0x1'));var express=require(_0x284c('0x2'));var router=express['Router']();var fs_extra=require(_0x284c('0x3'));var auth=require(_0x284c('0x4'));var interaction=require(_0x284c('0x5'));var config=require(_0x284c('0x6'));var controller=require(_0x284c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x284c('0x8')]);router[_0x284c('0x9')]('/describe',auth[_0x284c('0xa')](),controller[_0x284c('0xb')]);router[_0x284c('0x9')]('/:id',auth[_0x284c('0xa')](),controller['show']);router[_0x284c('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x284c('0xc')]);router['get'](_0x284c('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x284c('0x9')](_0x284c('0xe'),controller[_0x284c('0xf')]);router[_0x284c('0x9')](_0x284c('0x10'),controller[_0x284c('0x11')]);router[_0x284c('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x284c('0x9')](_0x284c('0x12'),controller['getSystemAvatar']);router[_0x284c('0x9')](_0x284c('0x13'),auth[_0x284c('0xa')](),controller['getInteractions']);router[_0x284c('0x9')](_0x284c('0x14'),controller[_0x284c('0x15')]);router[_0x284c('0x9')]('/:id/applications',auth[_0x284c('0xa')](),controller[_0x284c('0x16')]);router[_0x284c('0x9')](_0x284c('0x17'),auth[_0x284c('0xa')](),controller[_0x284c('0x18')]);router[_0x284c('0x9')](_0x284c('0x19'),controller[_0x284c('0x1a')]);router[_0x284c('0x9')](_0x284c('0x1b'),auth[_0x284c('0xa')](),controller[_0x284c('0x1c')]);router[_0x284c('0x9')]('/:id/users',auth[_0x284c('0xa')](),controller[_0x284c('0x1d')]);router['post']('/',auth[_0x284c('0xa')](),controller['create']);router[_0x284c('0x1e')](_0x284c('0x1f'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x284c('0x1e')]('/:id/canned_answers',auth[_0x284c('0xa')](),controller[_0x284c('0x20')]);var upload=multer({'storage':multer[_0x284c('0x21')]({'destination':function(_0x58d53d,_0x4e4833,_0x1958c9){_0x1958c9(null,path[_0x284c('0x22')](config[_0x284c('0x23')],_0x284c('0x24')));},'filename':function(_0x95f24e,_0x5acdb5,_0x3c262e){_0x3c262e(null,util['format'](_0x284c('0x25'),Date[_0x284c('0x26')](),_0x5acdb5[_0x284c('0x27')]));}})});router[_0x284c('0x1e')](_0x284c('0xe'),upload[_0x284c('0x28')]('file'),controller[_0x284c('0x29')]);var upload=multer({'storage':multer[_0x284c('0x21')]({'destination':function(_0x4b504b,_0x4f2c60,_0x25094a){_0x25094a(null,path['join'](config[_0x284c('0x23')],_0x284c('0x2a')));},'filename':function(_0x275ec2,_0x28fc35,_0x549396){_0x549396(null,util['format'](_0x284c('0x25'),Date[_0x284c('0x26')](),_0x28fc35[_0x284c('0x27')]));}})});router[_0x284c('0x1e')]('/:id/avatar',upload[_0x284c('0x28')](_0x284c('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0x284c('0x21')]({'destination':function(_0x101711,_0x1d8a92,_0x2f9807){_0x2f9807(null,path[_0x284c('0x22')](config['root'],_0x284c('0x2a')));},'filename':function(_0x363940,_0x1d2809,_0x5c2e25){_0x5c2e25(null,util[_0x284c('0x2c')](_0x284c('0x25'),Date[_0x284c('0x26')](),_0x1d2809['originalname']));}})});router[_0x284c('0x1e')](_0x284c('0x2d'),upload[_0x284c('0x28')](_0x284c('0x2b')),controller[_0x284c('0x2e')]);var upload=multer({'storage':multer[_0x284c('0x21')]({'destination':function(_0x57e1b5,_0x47a012,_0xecf445){_0xecf445(null,path[_0x284c('0x22')](config[_0x284c('0x23')],'server/files/images/avatars/'));},'filename':function(_0x16b76d,_0x50aac,_0x2297d1){_0x2297d1(null,util[_0x284c('0x2c')]('%s-%s',Date[_0x284c('0x26')](),_0x50aac['originalname']));}})});router[_0x284c('0x1e')]('/:id/system_avatar',upload['single'](_0x284c('0x2b')),controller['addSystemAvatar']);router[_0x284c('0x1e')]('/:id/notify',controller[_0x284c('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0x284c('0x21')]({'destination':function(_0x14b1d9,_0x54c634,_0x317b61){const _0x2f08eb=path[_0x284c('0x22')](config[_0x284c('0x23')],_0x284c('0x30'),_0x284c('0x31'),_0x284c('0x32'));fs_extra['ensureDir'](_0x2f08eb,function(){_0x317b61(null,_0x2f08eb);});},'filename':function(_0x442c86,_0x33ecbf,_0x5321ad){const _0x2229cf=_0x33ecbf[_0x284c('0x27')][_0x284c('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x236d5e=path['extname'](_0x2229cf);const _0x46b0c5=Date[_0x284c('0x26')]()+'-'+_0x2229cf[_0x284c('0x33')](_0x236d5e,'')+_0x236d5e;_0x5321ad(null,_0x46b0c5);}})});router['post'](_0x284c('0x34'),offlineUploadMulter[_0x284c('0x35')](),controller['offline']);router[_0x284c('0x1e')](_0x284c('0x13'),auth['isAuthenticated'](),controller[_0x284c('0x36')]);router[_0x284c('0x1e')](_0x284c('0x37'),auth['isAuthenticated'](),controller[_0x284c('0x38')]);router['post'](_0x284c('0x17'),auth['isAuthenticated'](),controller[_0x284c('0x39')]);router[_0x284c('0x1e')](_0x284c('0x3a'),auth[_0x284c('0xa')](),controller['addAgents']);router[_0x284c('0x3b')](_0x284c('0x3c'),auth[_0x284c('0xa')](),controller[_0x284c('0x3d')]);router[_0x284c('0x3e')](_0x284c('0x3c'),auth[_0x284c('0xa')](),controller[_0x284c('0x3f')]);router[_0x284c('0x3e')](_0x284c('0x1f'),auth['isAuthenticated'](),controller[_0x284c('0x40')]);router['delete']('/:id/canned_answers',auth[_0x284c('0xa')](),controller[_0x284c('0x41')]);router['delete'](_0x284c('0x3a'),auth[_0x284c('0xa')](),controller[_0x284c('0x42')]);module[_0x284c('0x43')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 695b320..f955bd7 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 _0x404a=['/client-logs','isAuthenticated','../components/auth/service','../config/environment','Router','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x1e369d,_0x528360){var _0x3bc381=function(_0x410a3b){while(--_0x410a3b){_0x1e369d['push'](_0x1e369d['shift']());}};_0x3bc381(++_0x528360);}(_0x404a,0x84));var _0xa404=function(_0x3437cf,_0x1cc733){_0x3437cf=_0x3437cf-0x0;var _0x2a7227=_0x404a[_0x3437cf];return _0x2a7227;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0xa404('0x0'));var config=require(_0xa404('0x1'));var router=express[_0xa404('0x2')]();var isProduction=config[_0xa404('0x3')]===_0xa404('0x4')||![];function clientSideLogs(_0x282dcb,_0xc3aedd,_0x53d333){var _0x1f3671=_0x282dcb[_0xa404('0x5')]['get']('client-side-logger');if(!_0x1f3671){throw new Error(_0xa404('0x6'));}return beaverLogger[_0xa404('0x7')]({'uri':_0xa404('0x8'),'logger':_0x1f3671,'enableCors':!isProduction})(_0x282dcb,_0xc3aedd,_0x53d333);}router['use'](auth[_0xa404('0x9')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0xa4d6=['app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','env','production'];(function(_0xf1d779,_0x59947d){var _0x2deaee=function(_0x43a0f4){while(--_0x43a0f4){_0xf1d779['push'](_0xf1d779['shift']());}};_0x2deaee(++_0x59947d);}(_0xa4d6,0x10f));var _0x6a4d=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0xa4d6[_0x42ebba];return _0x3fd2af;};var beaverLogger=require(_0x6a4d('0x0'));var express=require('express');var auth=require(_0x6a4d('0x1'));var config=require(_0x6a4d('0x2'));var router=express['Router']();var isProduction=config[_0x6a4d('0x3')]===_0x6a4d('0x4')||![];function clientSideLogs(_0x2096cc,_0x15184a,_0x3dea67){var _0x3c3835=_0x2096cc[_0x6a4d('0x5')]['get'](_0x6a4d('0x6'));if(!_0x3c3835){throw new Error(_0x6a4d('0x7'));}return beaverLogger[_0x6a4d('0x8')]({'uri':_0x6a4d('0x9'),'logger':_0x3c3835,'enableCors':!isProduction})(_0x2096cc,_0x15184a,_0x3dea67);}router['use'](auth[_0x6a4d('0xa')](),clientSideLogs);module[_0x6a4d('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index d6d3971..e7a3236 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 _0x9120=['sequelize','STRING','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x4a6cf8,_0x5534ef){var _0x22205e=function(_0x3f4d0d){while(--_0x3f4d0d){_0x4a6cf8['push'](_0x4a6cf8['shift']());}};_0x22205e(++_0x5534ef);}(_0x9120,0x140));var _0x0912=function(_0x287684,_0x422d38){_0x287684=_0x287684-0x0;var _0x4c7bbb=_0x9120[_0x287684];return _0x4c7bbb;};'use strict';var Sequelize=require(_0x0912('0x0'));module['exports']={'name':{'type':Sequelize[_0x0912('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x0912('0x2'),'Google',_0x0912('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0912('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0x0912('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x0912('0x1')],'comment':_0x0912('0x5')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x0912('0x1')],'comment':_0x0912('0x6')},'data5':{'type':Sequelize['TEXT'],'comment':_0x0912('0x7')},'data6':{'type':Sequelize[_0x0912('0x8')],'comment':_0x0912('0x9')},'data7':{'type':Sequelize[_0x0912('0x8')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x23ed=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x23ed,0x6e));var _0xd23e=function(_0x40c5e0,_0x3b77ad){_0x40c5e0=_0x40c5e0-0x0;var _0x47ee12=_0x23ed[_0x40c5e0];return _0x47ee12;};'use strict';var Sequelize=require(_0xd23e('0x0'));module[_0xd23e('0x1')]={'name':{'type':Sequelize[_0xd23e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd23e('0x3')](_0xd23e('0x4'),_0xd23e('0x5'),_0xd23e('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd23e('0x3')](_0xd23e('0x7'),_0xd23e('0x8'))},'data1':{'type':Sequelize[_0xd23e('0x2')],'comment':_0xd23e('0x9')},'data2':{'type':Sequelize[_0xd23e('0x2')],'comment':_0xd23e('0xa')},'data3':{'type':Sequelize[_0xd23e('0x2')],'comment':_0xd23e('0xb')},'data4':{'type':Sequelize[_0xd23e('0x2')],'comment':_0xd23e('0xc')},'data5':{'type':Sequelize[_0xd23e('0xd')],'comment':_0xd23e('0xe')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd23e('0xf')},'data7':{'type':Sequelize[_0xd23e('0xd')],'comment':_0xd23e('0x10')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a5f52cc..92fff70 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 _0x98d4=['hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','decryptString','data3','catch','show','params','rawAttributes','includeAll','find','service','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','localhost','socket.io-emitter','redis','status','end','json','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','type','key','query','filters','intersection','model','attributes','fields','length'];(function(_0x4a1c2d,_0x29b105){var _0x72c75e=function(_0x2f982f){while(--_0x2f982f){_0x4a1c2d['push'](_0x4a1c2d['shift']());}};_0x72c75e(++_0x29b105);}(_0x98d4,0x1c7));var _0x498d=function(_0x61a588,_0x50b482){_0x61a588=_0x61a588-0x0;var _0x3b4b47=_0x98d4[_0x61a588];return _0x3b4b47;};'use strict';var _=require(_0x498d('0x0'));var Redis=require(_0x498d('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x498d('0x2'))(_0x498d('0x3'));var db=require(_0x498d('0x4'))['db'];var oauth=require(_0x498d('0x5'));config['redis']=_[_0x498d('0x6')](config['redis'],{'host':_0x498d('0x7'),'port':0x18eb});var socket=require(_0x498d('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x498d('0x9')]);function respondWithStatusCode(_0x1ae8c6,_0x35e02b){_0x35e02b=_0x35e02b||0xcc;return function(_0x5e573d){if(_0x5e573d){return _0x1ae8c6['sendStatus'](_0x35e02b);}return _0x1ae8c6[_0x498d('0xa')](_0x35e02b)[_0x498d('0xb')]();};}function respondWithResult(_0x4711f4,_0x3368ff){_0x3368ff=_0x3368ff||0xc8;return function(_0x1c8623){if(_0x1c8623){return _0x4711f4[_0x498d('0xa')](_0x3368ff)[_0x498d('0xc')](_0x1c8623);}};}function respondWithFilteredResult(_0x83bd98,_0xc690b8){return function(_0x388a40){if(_0x388a40){var _0x2181ab=typeof _0xc690b8[_0x498d('0xd')]==='undefined'&&typeof _0xc690b8[_0x498d('0xe')]===_0x498d('0xf');var _0xdf3953=_0x388a40[_0x498d('0x10')];var _0x984590=_0x2181ab?0x0:_0xc690b8['offset'];var _0x2704eb=_0x2181ab?_0x388a40[_0x498d('0x10')]:_0xc690b8[_0x498d('0xd')]+_0xc690b8[_0x498d('0xe')];var _0x383e5b;if(_0x2704eb>=_0xdf3953){_0x2704eb=_0xdf3953;_0x383e5b=0xc8;}else{_0x383e5b=0xce;}_0x83bd98[_0x498d('0xa')](_0x383e5b);return _0x83bd98[_0x498d('0x11')]('Content-Range',_0x984590+'-'+_0x2704eb+'/'+_0xdf3953)['json'](_0x388a40);}return null;};}function saveUpdates(_0x2834a5){return function(_0x257a76){if(_0x257a76){return _0x257a76[_0x498d('0x12')](_0x2834a5)[_0x498d('0x13')](function(_0x2dac2f){return _0x2dac2f;});}return null;};}function removeEntity(_0x4d0989){return function(_0x89623e){if(_0x89623e){return _0x89623e[_0x498d('0x14')]()[_0x498d('0x13')](function(){_0x4d0989[_0x498d('0xa')](0xcc)[_0x498d('0xb')]();});}};}function handleEntityNotFound(_0x262d38){return function(_0xf71b9f){if(!_0xf71b9f){_0x262d38['sendStatus'](0x194);}return _0xf71b9f;};}function handleError(_0x1c8649,_0x71b13b){_0x71b13b=_0x71b13b||0x1f4;return function(_0x1c109f){logger[_0x498d('0x15')](_0x1c109f[_0x498d('0x16')]);if(_0x1c109f[_0x498d('0x17')]){delete _0x1c109f[_0x498d('0x17')];}_0x1c8649[_0x498d('0xa')](_0x71b13b)[_0x498d('0x18')](_0x1c109f);};}function maskClientSecret(_0x4acd06){return _[_0x498d('0x19')](_0x4acd06[_0x498d('0x1a')](0x0,0x3),0x14,'*');}exports[_0x498d('0x1b')]=function(_0x3c1f7e,_0xee9427){var _0x4fad90={},_0x3c3d7c={},_0x565bac={'count':0x0,'rows':[]};var _0x488faa=_[_0x498d('0x1c')](db[_0x498d('0x1d')]['rawAttributes'],function(_0x3f2c77){return{'name':_0x3f2c77[_0x498d('0x1e')],'type':_0x3f2c77[_0x498d('0x1f')][_0x498d('0x20')]};});_0x3c3d7c['model']=_[_0x498d('0x1c')](_0x488faa,'name');_0x3c3d7c['query']=_['keys'](_0x3c1f7e[_0x498d('0x21')]);_0x3c3d7c[_0x498d('0x22')]=_[_0x498d('0x23')](_0x3c3d7c[_0x498d('0x24')],_0x3c3d7c[_0x498d('0x21')]);_0x4fad90[_0x498d('0x25')]=_['intersection'](_0x3c3d7c[_0x498d('0x24')],qs[_0x498d('0x26')](_0x3c1f7e['query']['fields']));_0x4fad90[_0x498d('0x25')]=_0x4fad90[_0x498d('0x25')][_0x498d('0x27')]?_0x4fad90[_0x498d('0x25')]:_0x3c3d7c[_0x498d('0x24')];if(!_0x3c1f7e['query'][_0x498d('0x28')]('nolimit')){_0x4fad90[_0x498d('0xe')]=qs[_0x498d('0xe')](_0x3c1f7e[_0x498d('0x21')][_0x498d('0xe')]);_0x4fad90[_0x498d('0xd')]=qs['offset'](_0x3c1f7e[_0x498d('0x21')][_0x498d('0xd')]);}_0x4fad90[_0x498d('0x29')]=qs['sort'](_0x3c1f7e['query'][_0x498d('0x2a')]);_0x4fad90[_0x498d('0x2b')]=qs['filters'](_[_0x498d('0x2c')](_0x3c1f7e[_0x498d('0x21')],_0x3c3d7c[_0x498d('0x22')]),_0x488faa);if(_0x3c1f7e[_0x498d('0x21')][_0x498d('0x2d')]){_0x4fad90[_0x498d('0x2b')]=_['merge'](_0x4fad90[_0x498d('0x2b')],{'$or':_[_0x498d('0x1c')](_0x488faa,function(_0x489a4a){if(_0x489a4a[_0x498d('0x1f')]!=='VIRTUAL'){var _0x31061d={};_0x31061d[_0x489a4a['name']]={'$like':'%'+_0x3c1f7e[_0x498d('0x21')]['filter']+'%'};return _0x31061d;}})});}_0x4fad90=_[_0x498d('0x2e')]({},_0x4fad90,_0x3c1f7e[_0x498d('0x2f')]);var _0x50c704={'where':_0x4fad90['where']};return db['CloudProvider']['count'](_0x50c704)['then'](function(_0x304ad2){_0x565bac[_0x498d('0x10')]=_0x304ad2;if(_0x3c1f7e[_0x498d('0x21')]['includeAll']){_0x4fad90[_0x498d('0x30')]=[{'all':!![]}];}return db[_0x498d('0x1d')][_0x498d('0x31')](_0x4fad90);})[_0x498d('0x13')](function(_0x3fac92){_0x565bac[_0x498d('0x32')]=_[_0x498d('0x1c')](_0x3fac92,function(_0x300a21){if(_0x300a21['service']==='MicrosoftAzure'){var _0x13dd51=encryptor[_0x498d('0x33')](_0x300a21[_0x498d('0x34')]);_0x300a21[_0x498d('0x34')]=maskClientSecret(_0x13dd51);}return _0x300a21;});return _0x565bac;})[_0x498d('0x13')](respondWithFilteredResult(_0xee9427,_0x4fad90))[_0x498d('0x35')](handleError(_0xee9427,null));};exports[_0x498d('0x36')]=function(_0x2c79c1,_0x5c77ae){var _0x46491c={'raw':!![],'where':{'id':_0x2c79c1[_0x498d('0x37')]['id']}},_0xef943c={};_0xef943c[_0x498d('0x24')]=_['keys'](db[_0x498d('0x1d')][_0x498d('0x38')]);_0xef943c[_0x498d('0x21')]=_['keys'](_0x2c79c1[_0x498d('0x21')]);_0xef943c[_0x498d('0x22')]=_[_0x498d('0x23')](_0xef943c[_0x498d('0x24')],_0xef943c['query']);_0x46491c[_0x498d('0x25')]=_['intersection'](_0xef943c[_0x498d('0x24')],qs[_0x498d('0x26')](_0x2c79c1[_0x498d('0x21')][_0x498d('0x26')]));_0x46491c[_0x498d('0x25')]=_0x46491c['attributes']['length']?_0x46491c[_0x498d('0x25')]:_0xef943c[_0x498d('0x24')];if(_0x2c79c1[_0x498d('0x21')][_0x498d('0x39')]){_0x46491c[_0x498d('0x30')]=[{'all':!![]}];}_0x46491c=_[_0x498d('0x2e')]({},_0x46491c,_0x2c79c1[_0x498d('0x2f')]);return db['CloudProvider'][_0x498d('0x3a')](_0x46491c)[_0x498d('0x13')](handleEntityNotFound(_0x5c77ae,null))[_0x498d('0x13')](function(_0x5a977c){if(_0x5a977c[_0x498d('0x3b')]===_0x498d('0x3c')){var _0x56756c=encryptor['decryptString'](_0x5a977c[_0x498d('0x34')]);_0x5a977c[_0x498d('0x34')]=maskClientSecret(_0x56756c);}return _0x5a977c;})[_0x498d('0x13')](respondWithResult(_0x5c77ae,null))[_0x498d('0x35')](handleError(_0x5c77ae,null));};exports[_0x498d('0x3d')]=function(_0xa90580,_0x192358){if(!_0xa90580[_0x498d('0x3e')]['name'])throw new Error(_0x498d('0x3f'));if(!_0xa90580[_0x498d('0x3e')][_0x498d('0x3b')])throw new Error(_0x498d('0x40'));var _0x9ad724=db[_0x498d('0x1d')][_0x498d('0x38')]['service']['values'];if(!_0x9ad724['includes'](_0xa90580[_0x498d('0x3e')][_0x498d('0x3b')]))throw new Error(_0x498d('0x41')+_0x9ad724[_0x498d('0x42')](',\x20'));if(_0xa90580[_0x498d('0x3e')][_0x498d('0x3b')]===_0x498d('0x3c')&&_0xa90580[_0x498d('0x3e')][_0x498d('0x34')]){_0xa90580[_0x498d('0x3e')][_0x498d('0x34')]=encryptor['encryptString'](_0xa90580['body'][_0x498d('0x34')]);}return db['CloudProvider']['create'](_0xa90580[_0x498d('0x3e')],{})[_0x498d('0x13')](respondWithResult(_0x192358,0xc9))[_0x498d('0x35')](handleError(_0x192358,null));};exports[_0x498d('0x12')]=function(_0x3a6659,_0x14b01c){if(_0x3a6659[_0x498d('0x3e')]['id']){delete _0x3a6659['body']['id'];}return db[_0x498d('0x1d')][_0x498d('0x3a')]({'where':{'id':_0x3a6659['params']['id']}})['then'](handleEntityNotFound(_0x14b01c,null))[_0x498d('0x13')](function(_0x624cf8){if(_0x624cf8['service']==='MicrosoftAzure'&&_0x3a6659[_0x498d('0x3e')]['data3']){_0x3a6659[_0x498d('0x3e')][_0x498d('0x34')]=encryptor[_0x498d('0x43')](_0x3a6659[_0x498d('0x3e')][_0x498d('0x34')]);}return _0x624cf8;})['then'](saveUpdates(_0x3a6659[_0x498d('0x3e')],null))[_0x498d('0x13')](respondWithResult(_0x14b01c,null))[_0x498d('0x35')](handleError(_0x14b01c,null));};exports['destroy']=function(_0x6b89e4,_0x21a5e){return db[_0x498d('0x1d')][_0x498d('0x3a')]({'where':{'id':_0x6b89e4['params']['id']}})[_0x498d('0x13')](handleEntityNotFound(_0x21a5e,null))[_0x498d('0x13')](removeEntity(_0x21a5e,null))[_0x498d('0x35')](handleError(_0x21a5e,null));};exports[_0x498d('0x44')]=function(_0x17877f,_0x4fdd81){return db[_0x498d('0x1d')][_0x498d('0x45')]({'where':{'id':_0x17877f['params']['id']},'raw':!![]})[_0x498d('0x13')](function(_0x1e8b1c){if(!_0x1e8b1c)return _0x4fdd81[_0x498d('0x46')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x1e8b1c,_0x17877f[_0x498d('0x47')]['id'])};})[_0x498d('0x13')](respondWithResult(_0x4fdd81,null))[_0x498d('0x35')](handleError(_0x4fdd81,null));};exports[_0x498d('0x48')]=function(_0x56eeb6,_0x350313){var _0x5cee45=_0x56eeb6[_0x498d('0x3e')];var _0x515323;var _0x45d803;if(_0x5cee45[_0x498d('0x15')])throw _0x5cee45;redis[_0x498d('0x49')](_0x5cee45[_0x498d('0x4a')])[_0x498d('0x13')](function(_0x1c8732){if(!_0x1c8732)throw new Error(_0x498d('0x4b'));_0x515323=JSON['parse'](_0x1c8732);var _0x1dd831=Buffer[_0x498d('0x4c')](_0x5cee45[_0x498d('0x4a')],_0x498d('0x4d'))[_0x498d('0x4e')](_0x498d('0x4f'));_0x45d803=JSON[_0x498d('0x50')](_0x1dd831);if(!oauth[_0x498d('0x51')](_0x5cee45[_0x498d('0x52')],_0x515323[_0x498d('0x53')]))throw new Error(_0x498d('0x54'));redis[_0x498d('0x55')](_0x5cee45[_0x498d('0x4a')]);return oauth[_0x498d('0x56')](_0x5cee45[_0x498d('0x57')],_0x515323);})[_0x498d('0x13')](function(_0x17caa){_0x515323[_0x498d('0x58')]=_0x17caa['access_token'];_0x515323[_0x498d('0x59')]=_0x17caa[_0x498d('0x5a')];return db['CloudProvider'][_0x498d('0x12')]({'data5':_0x515323[_0x498d('0x58')],'data6':_0x515323[_0x498d('0x59')]},{'where':{'id':_0x515323['id']}});})['then'](function(){oauth[_0x498d('0x5b')](_0x515323);socket['emit'](_0x498d('0x5c'),{'id':_0x45d803['id']});return;})[_0x498d('0x13')](respondWithStatusCode(_0x350313,null))[_0x498d('0x35')](function(_0x4d848e){if(_0x45d803){socket[_0x498d('0x5d')](_0x498d('0x5e'),{'id':_0x45d803['id']});}if(!_0x515323){logger[_0x498d('0x15')](_0x498d('0x5f'),_0x4d848e);return _0x350313['status'](0x1f4)[_0x498d('0x18')](_0x4d848e[_0x498d('0x60')]);}logger[_0x498d('0x15')](_0x498d('0x61'),_0x515323['id'],JSON[_0x498d('0x62')](_0x4d848e));});}; \ No newline at end of file +var _0x082b=['data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','offset','undefined','count','limit','set','Content-Range','json','then','destroy','sendStatus','error','stack','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','service','MicrosoftAzure','data3','catch','show','params','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','encryptString','find','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','refresh_token'];(function(_0x591080,_0x117e1e){var _0x666f7e=function(_0x1f5fe5){while(--_0x1f5fe5){_0x591080['push'](_0x591080['shift']());}};_0x666f7e(++_0x117e1e);}(_0x082b,0x6c));var _0xb082=function(_0x43f1b5,_0xcee793){_0x43f1b5=_0x43f1b5-0x0;var _0x3e01a9=_0x082b[_0x43f1b5];return _0x3e01a9;};'use strict';var _=require(_0xb082('0x0'));var Redis=require(_0xb082('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xb082('0x2'));var config=require(_0xb082('0x3'));var logger=require(_0xb082('0x4'))(_0xb082('0x5'));var db=require(_0xb082('0x6'))['db'];var oauth=require(_0xb082('0x7'));config[_0xb082('0x8')]=_[_0xb082('0x9')](config[_0xb082('0x8')],{'host':_0xb082('0xa'),'port':0x18eb});var socket=require(_0xb082('0xb'))(new Redis(config[_0xb082('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x434924,_0xd0d05){_0xd0d05=_0xd0d05||0xcc;return function(_0x51e8ef){if(_0x51e8ef){return _0x434924['sendStatus'](_0xd0d05);}return _0x434924[_0xb082('0xc')](_0xd0d05)[_0xb082('0xd')]();};}function respondWithResult(_0x529968,_0x51fab6){_0x51fab6=_0x51fab6||0xc8;return function(_0x3382a5){if(_0x3382a5){return _0x529968['status'](_0x51fab6)['json'](_0x3382a5);}};}function respondWithFilteredResult(_0xd4934b,_0x210006){return function(_0x37fabd){if(_0x37fabd){var _0x30c135=typeof _0x210006[_0xb082('0xe')]===_0xb082('0xf')&&typeof _0x210006['limit']===_0xb082('0xf');var _0x5d66d7=_0x37fabd[_0xb082('0x10')];var _0x2445c4=_0x30c135?0x0:_0x210006[_0xb082('0xe')];var _0x567bd3=_0x30c135?_0x37fabd[_0xb082('0x10')]:_0x210006[_0xb082('0xe')]+_0x210006[_0xb082('0x11')];var _0x2db9ea;if(_0x567bd3>=_0x5d66d7){_0x567bd3=_0x5d66d7;_0x2db9ea=0xc8;}else{_0x2db9ea=0xce;}_0xd4934b[_0xb082('0xc')](_0x2db9ea);return _0xd4934b[_0xb082('0x12')](_0xb082('0x13'),_0x2445c4+'-'+_0x567bd3+'/'+_0x5d66d7)[_0xb082('0x14')](_0x37fabd);}return null;};}function saveUpdates(_0x11304a){return function(_0x3172f8){if(_0x3172f8){return _0x3172f8['update'](_0x11304a)[_0xb082('0x15')](function(_0x1e6843){return _0x1e6843;});}return null;};}function removeEntity(_0x13ac3a){return function(_0x56eebd){if(_0x56eebd){return _0x56eebd[_0xb082('0x16')]()[_0xb082('0x15')](function(){_0x13ac3a[_0xb082('0xc')](0xcc)[_0xb082('0xd')]();});}};}function handleEntityNotFound(_0x53ee6c){return function(_0x2ba5c1){if(!_0x2ba5c1){_0x53ee6c[_0xb082('0x17')](0x194);}return _0x2ba5c1;};}function handleError(_0x2d5d53,_0x577ef8){_0x577ef8=_0x577ef8||0x1f4;return function(_0xa757fe){logger[_0xb082('0x18')](_0xa757fe[_0xb082('0x19')]);if(_0xa757fe['name']){delete _0xa757fe['name'];}_0x2d5d53[_0xb082('0xc')](_0x577ef8)['send'](_0xa757fe);};}function maskClientSecret(_0x2d501d){return _[_0xb082('0x1a')](_0x2d501d[_0xb082('0x1b')](0x0,0x3),0x14,'*');}exports[_0xb082('0x1c')]=function(_0x571d1f,_0x5ecf54){var _0x5ccb38={},_0x4a232a={},_0x37d0f7={'count':0x0,'rows':[]};var _0x45bd81=_[_0xb082('0x1d')](db[_0xb082('0x1e')][_0xb082('0x1f')],function(_0x4ba3ec){return{'name':_0x4ba3ec[_0xb082('0x20')],'type':_0x4ba3ec['type'][_0xb082('0x21')]};});_0x4a232a[_0xb082('0x22')]=_['map'](_0x45bd81,_0xb082('0x23'));_0x4a232a[_0xb082('0x24')]=_[_0xb082('0x25')](_0x571d1f[_0xb082('0x24')]);_0x4a232a[_0xb082('0x26')]=_[_0xb082('0x27')](_0x4a232a['model'],_0x4a232a[_0xb082('0x24')]);_0x5ccb38['attributes']=_[_0xb082('0x27')](_0x4a232a['model'],qs[_0xb082('0x28')](_0x571d1f[_0xb082('0x24')]['fields']));_0x5ccb38[_0xb082('0x29')]=_0x5ccb38[_0xb082('0x29')][_0xb082('0x2a')]?_0x5ccb38[_0xb082('0x29')]:_0x4a232a['model'];if(!_0x571d1f[_0xb082('0x24')][_0xb082('0x2b')](_0xb082('0x2c'))){_0x5ccb38[_0xb082('0x11')]=qs['limit'](_0x571d1f[_0xb082('0x24')][_0xb082('0x11')]);_0x5ccb38[_0xb082('0xe')]=qs[_0xb082('0xe')](_0x571d1f[_0xb082('0x24')][_0xb082('0xe')]);}_0x5ccb38[_0xb082('0x2d')]=qs['sort'](_0x571d1f['query']['sort']);_0x5ccb38[_0xb082('0x2e')]=qs[_0xb082('0x26')](_[_0xb082('0x2f')](_0x571d1f[_0xb082('0x24')],_0x4a232a[_0xb082('0x26')]),_0x45bd81);if(_0x571d1f[_0xb082('0x24')]['filter']){_0x5ccb38[_0xb082('0x2e')]=_[_0xb082('0x30')](_0x5ccb38[_0xb082('0x2e')],{'$or':_[_0xb082('0x1d')](_0x45bd81,function(_0x1ff6d2){if(_0x1ff6d2[_0xb082('0x31')]!==_0xb082('0x32')){var _0x2095dd={};_0x2095dd[_0x1ff6d2[_0xb082('0x23')]]={'$like':'%'+_0x571d1f[_0xb082('0x24')][_0xb082('0x33')]+'%'};return _0x2095dd;}})});}_0x5ccb38=_[_0xb082('0x30')]({},_0x5ccb38,_0x571d1f[_0xb082('0x34')]);var _0x3d2eb4={'where':_0x5ccb38[_0xb082('0x2e')]};return db['CloudProvider'][_0xb082('0x10')](_0x3d2eb4)[_0xb082('0x15')](function(_0x4cbd85){_0x37d0f7[_0xb082('0x10')]=_0x4cbd85;if(_0x571d1f[_0xb082('0x24')][_0xb082('0x35')]){_0x5ccb38[_0xb082('0x36')]=[{'all':!![]}];}return db[_0xb082('0x1e')][_0xb082('0x37')](_0x5ccb38);})['then'](function(_0x2edfdb){_0x37d0f7['rows']=_[_0xb082('0x1d')](_0x2edfdb,function(_0x75ab02){if(_0x75ab02[_0xb082('0x38')]===_0xb082('0x39')){var _0x43c3a8=encryptor['decryptString'](_0x75ab02['data3']);_0x75ab02[_0xb082('0x3a')]=maskClientSecret(_0x43c3a8);}return _0x75ab02;});return _0x37d0f7;})['then'](respondWithFilteredResult(_0x5ecf54,_0x5ccb38))[_0xb082('0x3b')](handleError(_0x5ecf54,null));};exports[_0xb082('0x3c')]=function(_0x28d2c0,_0x4a42fc){var _0x550824={'raw':!![],'where':{'id':_0x28d2c0[_0xb082('0x3d')]['id']}},_0xe3bf1b={};_0xe3bf1b['model']=_[_0xb082('0x25')](db[_0xb082('0x1e')][_0xb082('0x1f')]);_0xe3bf1b[_0xb082('0x24')]=_['keys'](_0x28d2c0[_0xb082('0x24')]);_0xe3bf1b[_0xb082('0x26')]=_['intersection'](_0xe3bf1b[_0xb082('0x22')],_0xe3bf1b['query']);_0x550824[_0xb082('0x29')]=_['intersection'](_0xe3bf1b[_0xb082('0x22')],qs['fields'](_0x28d2c0[_0xb082('0x24')][_0xb082('0x28')]));_0x550824['attributes']=_0x550824[_0xb082('0x29')][_0xb082('0x2a')]?_0x550824['attributes']:_0xe3bf1b['model'];if(_0x28d2c0['query'][_0xb082('0x35')]){_0x550824['include']=[{'all':!![]}];}_0x550824=_[_0xb082('0x30')]({},_0x550824,_0x28d2c0[_0xb082('0x34')]);return db[_0xb082('0x1e')]['find'](_0x550824)[_0xb082('0x15')](handleEntityNotFound(_0x4a42fc,null))[_0xb082('0x15')](function(_0x251249){if(_0x251249[_0xb082('0x38')]===_0xb082('0x39')){var _0x3934e8=encryptor['decryptString'](_0x251249[_0xb082('0x3a')]);_0x251249[_0xb082('0x3a')]=maskClientSecret(_0x3934e8);}return _0x251249;})[_0xb082('0x15')](respondWithResult(_0x4a42fc,null))[_0xb082('0x3b')](handleError(_0x4a42fc,null));};exports[_0xb082('0x3e')]=function(_0x22eca9,_0x59ff53){if(!_0x22eca9[_0xb082('0x3f')][_0xb082('0x23')])throw new Error(_0xb082('0x40'));if(!_0x22eca9[_0xb082('0x3f')][_0xb082('0x38')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x2fac42=db[_0xb082('0x1e')][_0xb082('0x1f')][_0xb082('0x38')]['values'];if(!_0x2fac42[_0xb082('0x41')](_0x22eca9['body'][_0xb082('0x38')]))throw new Error(_0xb082('0x42')+_0x2fac42[_0xb082('0x43')](',\x20'));if(_0x22eca9[_0xb082('0x3f')][_0xb082('0x38')]===_0xb082('0x39')&&_0x22eca9[_0xb082('0x3f')][_0xb082('0x3a')]){_0x22eca9[_0xb082('0x3f')][_0xb082('0x3a')]=encryptor['encryptString'](_0x22eca9[_0xb082('0x3f')][_0xb082('0x3a')]);}return db[_0xb082('0x1e')]['create'](_0x22eca9[_0xb082('0x3f')],{})['then'](respondWithResult(_0x59ff53,0xc9))[_0xb082('0x3b')](handleError(_0x59ff53,null));};exports[_0xb082('0x44')]=function(_0x227582,_0x377b76){if(_0x227582[_0xb082('0x3f')]['id']){delete _0x227582[_0xb082('0x3f')]['id'];}return db[_0xb082('0x1e')]['find']({'where':{'id':_0x227582[_0xb082('0x3d')]['id']}})['then'](handleEntityNotFound(_0x377b76,null))[_0xb082('0x15')](function(_0x2a2d11){if(_0x2a2d11[_0xb082('0x38')]==='MicrosoftAzure'&&_0x227582['body'][_0xb082('0x3a')]){_0x227582[_0xb082('0x3f')][_0xb082('0x3a')]=encryptor[_0xb082('0x45')](_0x227582[_0xb082('0x3f')][_0xb082('0x3a')]);}return _0x2a2d11;})[_0xb082('0x15')](saveUpdates(_0x227582[_0xb082('0x3f')],null))[_0xb082('0x15')](respondWithResult(_0x377b76,null))['catch'](handleError(_0x377b76,null));};exports['destroy']=function(_0x2f8fbe,_0x1a3a7f){return db['CloudProvider'][_0xb082('0x46')]({'where':{'id':_0x2f8fbe[_0xb082('0x3d')]['id']}})[_0xb082('0x15')](handleEntityNotFound(_0x1a3a7f,null))['then'](removeEntity(_0x1a3a7f,null))[_0xb082('0x3b')](handleError(_0x1a3a7f,null));};exports[_0xb082('0x47')]=function(_0x3ff85d,_0x12c334){return db['CloudProvider']['findOne']({'where':{'id':_0x3ff85d[_0xb082('0x3d')]['id']},'raw':!![]})['then'](function(_0xbec16a){if(!_0xbec16a)return _0x12c334[_0xb082('0x17')](0x194);return{'url':oauth[_0xb082('0x48')](_0xbec16a,_0x3ff85d[_0xb082('0x49')]['id'])};})[_0xb082('0x15')](respondWithResult(_0x12c334,null))[_0xb082('0x3b')](handleError(_0x12c334,null));};exports['oauth2MicrosoftCallback']=function(_0x1c22bf,_0x29cccb){var _0x1a060f=_0x1c22bf[_0xb082('0x3f')];var _0x11dd7c;var _0x45459a;if(_0x1a060f[_0xb082('0x18')])throw _0x1a060f;redis['get'](_0x1a060f[_0xb082('0x4a')])[_0xb082('0x15')](function(_0x59d4a4){if(!_0x59d4a4)throw new Error('Invalid\x20state\x20parameter');_0x11dd7c=JSON[_0xb082('0x4b')](_0x59d4a4);var _0x97e5bb=Buffer[_0xb082('0x4c')](_0x1a060f[_0xb082('0x4a')],_0xb082('0x4d'))[_0xb082('0x4e')](_0xb082('0x4f'));_0x45459a=JSON[_0xb082('0x4b')](_0x97e5bb);if(!oauth[_0xb082('0x50')](_0x1a060f[_0xb082('0x51')],_0x11dd7c[_0xb082('0x52')]))throw new Error(_0xb082('0x53'));redis[_0xb082('0x54')](_0x1a060f[_0xb082('0x4a')]);return oauth[_0xb082('0x55')](_0x1a060f[_0xb082('0x56')],_0x11dd7c);})[_0xb082('0x15')](function(_0x23147b){_0x11dd7c['data5']=_0x23147b['access_token'];_0x11dd7c['data6']=_0x23147b[_0xb082('0x57')];return db[_0xb082('0x1e')][_0xb082('0x44')]({'data5':_0x11dd7c['data5'],'data6':_0x11dd7c[_0xb082('0x58')]},{'where':{'id':_0x11dd7c['id']}});})['then'](function(){oauth[_0xb082('0x59')](_0x11dd7c);socket[_0xb082('0x5a')](_0xb082('0x5b'),{'id':_0x45459a['id']});return;})[_0xb082('0x15')](respondWithStatusCode(_0x29cccb,null))['catch'](function(_0x14e38c){if(_0x45459a){socket[_0xb082('0x5a')](_0xb082('0x5c'),{'id':_0x45459a['id']});}if(!_0x11dd7c){logger[_0xb082('0x18')](_0xb082('0x5d'),_0x14e38c);return _0x29cccb[_0xb082('0xc')](0x1f4)[_0xb082('0x5e')](_0x14e38c[_0xb082('0x5f')]);}logger[_0xb082('0x18')](_0xb082('0x60'),_0x11dd7c['id'],JSON[_0xb082('0x61')](_0x14e38c));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 5d500d9..10b4381 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 _0x7be6=['moment','bluebird','path','rimraf','./cloudProvider.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7be6,0xc5));var _0x67be=function(_0x4eec71,_0x22438f){_0x4eec71=_0x4eec71-0x0;var _0x2962b0=_0x7be6[_0x4eec71];return _0x2962b0;};'use strict';var _=require(_0x67be('0x0'));var util=require(_0x67be('0x1'));var logger=require(_0x67be('0x2'))('api');var moment=require(_0x67be('0x3'));var BPromise=require(_0x67be('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67be('0x5'));var rimraf=require(_0x67be('0x6'));var config=require('../../config/environment');var attributes=require(_0x67be('0x7'));module[_0x67be('0x8')]=function(_0xe3e57b,_0x373094){return _0xe3e57b[_0x67be('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd623=['./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x45235c,_0x49494c){var _0x4395e0=function(_0x28ae25){while(--_0x28ae25){_0x45235c['push'](_0x45235c['shift']());}};_0x4395e0(++_0x49494c);}(_0xd623,0x1bc));var _0x3d62=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd623[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x3d62('0x0'));var util=require(_0x3d62('0x1'));var logger=require(_0x3d62('0x2'))(_0x3d62('0x3'));var moment=require(_0x3d62('0x4'));var BPromise=require('bluebird');var rp=require(_0x3d62('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3d62('0x6'));var attributes=require(_0x3d62('0x7'));module[_0x3d62('0x8')]=function(_0x4b9010,_0x42e9eb){return _0x4b9010[_0x3d62('0x9')](_0x3d62('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 3462007..f668ff7 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 _0x3d88=['intervals','bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','push','data7','/.default','Outlook365','Dynamics365','{TENANT_ID}','data2','stringify','base64','randomBytes','toString','data1','response_type','join','response_mode','form_post','scope','nonce','prompt','login','map','value','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','replace','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4'];(function(_0x36f82a,_0x4ec395){var _0x495067=function(_0x2ede56){while(--_0x2ede56){_0x36f82a['push'](_0x36f82a['shift']());}};_0x495067(++_0x4ec395);}(_0x3d88,0x1d4));var _0x83d8=function(_0x226984,_0x3c3eac){_0x226984=_0x226984-0x0;var _0x4cc0f3=_0x3d88[_0x226984];return _0x4cc0f3;};'use strict';var _=require(_0x83d8('0x0'));var crypto=require(_0x83d8('0x1'));var jwt=require(_0x83d8('0x2'));var moment=require('moment');var Redis=require(_0x83d8('0x3'));var rp=require(_0x83d8('0x4'));var util=require(_0x83d8('0x5'));var encryptor=require(_0x83d8('0x6'));var config=require(_0x83d8('0x7'));var logger=require(_0x83d8('0x8'))(_0x83d8('0x9'));var schedule=require(_0x83d8('0xa'));var db=require(_0x83d8('0xb'))['db'];config[_0x83d8('0xc')]=_['defaults'](config[_0x83d8('0xc')],{'host':_0x83d8('0xd'),'port':0x18eb});var redis=new Redis(config[_0x83d8('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x83d8('0xe'),'email',_0x83d8('0xf'),_0x83d8('0x10'),_0x83d8('0x11'),_0x83d8('0x12')],'Dynamics365':['openid',_0x83d8('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x83d8('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x83d8('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1c491b){var _0x229ebe=_['map'](AZURE_AUTH_SCOPES[_0x1c491b[_0x83d8('0x15')]]);if(_0x1c491b[_0x83d8('0x15')]==='Dynamics365')_0x229ebe[_0x83d8('0x16')](_0x1c491b[_0x83d8('0x17')]+_0x83d8('0x18'));return _0x229ebe['join']('\x20');}function getAccessTokenScope(_0x206bc7){if(_0x206bc7[_0x83d8('0x15')]===_0x83d8('0x19'))return _0x83d8('0x10');if(_0x206bc7[_0x83d8('0x15')]===_0x83d8('0x1a'))return _0x206bc7[_0x83d8('0x17')]+_0x83d8('0x18');}function generateMicrosoftAuthorizationUrl(_0xcb56d3,_0x356d9b){var _0xe8e351=MICROSOFT_AUTH_URL['replace'](_0x83d8('0x1b'),_0xcb56d3[_0x83d8('0x1c')]);var _0x3f4e73=['code','id_token'];var _0x42a7fb=Buffer['from'](JSON[_0x83d8('0x1d')]({'id':_0x356d9b}))['toString'](_0x83d8('0x1e'));var _0x59461d=crypto[_0x83d8('0x1f')](0x10)[_0x83d8('0x20')]('hex');var _0x5ed7c1=getAuthorizationScopes(_0xcb56d3);var _0x4b04de=[{'key':'client_id','value':_0xcb56d3[_0x83d8('0x21')]},{'key':_0x83d8('0x22'),'value':encodeURIComponent(_0x3f4e73[_0x83d8('0x23')]('\x20'))},{'key':'redirect_uri','value':_0xcb56d3['data4']},{'key':_0x83d8('0x24'),'value':_0x83d8('0x25')},{'key':_0x83d8('0x26'),'value':encodeURIComponent(_0x5ed7c1)},{'key':'state','value':_0x42a7fb},{'key':_0x83d8('0x27'),'value':_0x59461d},{'key':_0x83d8('0x28'),'value':_0x83d8('0x29')}];var _0x461ec4=_0xe8e351+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x83d8('0x2a')](_0x4b04de,function(_0x51b7f2){return _0x51b7f2['key']+'='+_0x51b7f2[_0x83d8('0x2b')];})[_0x83d8('0x23')]('&');_0xcb56d3['oauth2Claims']={'issuer':_0xe8e351['replace'](_0x83d8('0x2c'),''),'audience':_0xcb56d3['data1'],'state':_0x42a7fb,'nonce':_0x59461d};redis[_0x83d8('0x2d')](_0x42a7fb,JSON[_0x83d8('0x1d')](_0xcb56d3));return _0x461ec4;}function isValidIdToken(_0x5b67d2,_0x4d6471){try{var _0x303b7d=jwt[_0x83d8('0x2e')](_0x5b67d2,{'complete':!![]});var _0x229981=_0x303b7d[_0x83d8('0x2f')];if(_0x229981[_0x83d8('0x30')]!==_0x4d6471[_0x83d8('0x31')])return![];if(_0x229981[_0x83d8('0x32')]!==_0x4d6471[_0x83d8('0x33')])return![];if(_0x229981[_0x83d8('0x27')]!==_0x4d6471[_0x83d8('0x27')])return![];if(moment()[_0x83d8('0x34')](moment[_0x83d8('0x35')](_0x229981['exp'])))return![];return!![];}catch(_0x5778eb){throw _0x5778eb;}}function refreshOauth2MicrosoftAccessToken(_0x2e3910){return Promise[_0x83d8('0x36')]()[_0x83d8('0x37')](function(){if(_0x2e3910[_0x83d8('0x38')])return _0x2e3910;return db[_0x83d8('0x39')][_0x83d8('0x3a')]({'where':{'id':_0x2e3910['id']},'raw':!![]});})[_0x83d8('0x37')](function(_0x2a6606){var _0x498124={'grant_type':_0x83d8('0x3b'),'refresh_token':_0x2a6606[_0x83d8('0x3c')],'scope':getAccessTokenScope(_0x2a6606),'redirect_uri':_0x2a6606['data4'],'client_id':_0x2a6606[_0x83d8('0x21')],'client_secret':encryptor[_0x83d8('0x3d')](_0x2a6606[_0x83d8('0x38')])};var _0x216305={'method':_0x83d8('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x83d8('0x3f')](_0x83d8('0x1b'),_0x2a6606[_0x83d8('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x498124,'json':!![]};return rp(_0x216305);})['then'](function(_0x2d52d3){_0x2e3910[_0x83d8('0x40')]=_0x2d52d3['access_token'];_0x2e3910[_0x83d8('0x3c')]=_0x2d52d3['refresh_token'];return db[_0x83d8('0x39')][_0x83d8('0x41')]({'data5':_0x2e3910['data5'],'data6':_0x2e3910[_0x83d8('0x3c')]},{'where':{'id':_0x2e3910['id']}});})[_0x83d8('0x37')](function(){return _0x2e3910;})[_0x83d8('0x42')](function(_0x508645){logger[_0x83d8('0x43')](_0x83d8('0x44'),_0x2e3910['id'],_0x508645);});}function getOauth2MicrosoftAccessToken(_0x1cf936,_0x27d87b){var _0x2402d5={'grant_type':_0x83d8('0x45'),'code':_0x1cf936,'scope':getAccessTokenScope(_0x27d87b),'redirect_uri':_0x27d87b[_0x83d8('0x46')],'client_id':_0x27d87b[_0x83d8('0x21')],'client_secret':encryptor[_0x83d8('0x3d')](_0x27d87b[_0x83d8('0x38')])};var _0x985f40={'method':_0x83d8('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x83d8('0x3f')](_0x83d8('0x1b'),_0x27d87b[_0x83d8('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2402d5,'json':!![]};return rp(_0x985f40);}function startRefreshInterval(_0x3298d1){var _0x3220cc=schedule[_0x83d8('0x47')];if(_0x3220cc[_0x3298d1['id']])clearInterval(_0x3220cc[_0x3298d1['id']]);_0x3220cc[_0x3298d1['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x83d8('0x48')](this,{'id':_0x3298d1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x83d8('0x47')]=_0x3220cc;}function startAllRefreshIntervals(){return db[_0x83d8('0x39')][_0x83d8('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x83d8('0x37')](function(_0x160a67){var _0x5d0e95=_0x160a67[_0x83d8('0x2a')](function(_0x2ee152){return refreshOauth2MicrosoftAccessToken(_0x2ee152)[_0x83d8('0x37')](function(_0x33b74c){startRefreshInterval(_0x33b74c);});});return Promise[_0x83d8('0x4a')](_0x5d0e95);})[_0x83d8('0x42')](function(_0x4037dd){var _0x51c7f1=_0x4037dd?util['inspect'](_0x4037dd,{'showHidden':![],'depth':null}):'';logger['error'](_0x83d8('0x4b'),_0x51c7f1);});}module[_0x83d8('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xffc9=['moment','request-promise','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/token','map','type','Dynamics365','push','data7','/.default','{TENANT_ID}','data2','code','from','toString','randomBytes','client_id','data1','response_type','join','redirect_uri','scope','nonce','prompt','login','key','value','replace','oauth2/','stringify','decode','issuer','aud','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','data4','decryptString','POST','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto'];(function(_0x5429e7,_0x491ca5){var _0x5a228d=function(_0x256ff3){while(--_0x256ff3){_0x5429e7['push'](_0x5429e7['shift']());}};_0x5a228d(++_0x491ca5);}(_0xffc9,0x1d3));var _0x9ffc=function(_0x57e78f,_0x3c36d6){_0x57e78f=_0x57e78f-0x0;var _0x22c2d9=_0xffc9[_0x57e78f];return _0x22c2d9;};'use strict';var _=require(_0x9ffc('0x0'));var crypto=require(_0x9ffc('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x9ffc('0x2'));var Redis=require('ioredis');var rp=require(_0x9ffc('0x3'));var util=require('util');var encryptor=require(_0x9ffc('0x4'));var config=require('../../config/environment');var logger=require(_0x9ffc('0x5'))(_0x9ffc('0x6'));var schedule=require(_0x9ffc('0x7'));var db=require('../../mysqldb')['db'];config[_0x9ffc('0x8')]=_['defaults'](config[_0x9ffc('0x8')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x9ffc('0x8')]);var MICROSOFT_AUTH_URL=_0x9ffc('0x9');var AZURE_AUTH_SCOPES={'Outlook365':[_0x9ffc('0xa'),'profile',_0x9ffc('0xb'),'offline_access',_0x9ffc('0xc'),'https://outlook.office.com/POP.AccessAsUser.All',_0x9ffc('0xd')],'Dynamics365':[_0x9ffc('0xa'),_0x9ffc('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x9ffc('0xf');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5214e3){var _0x4c44ef=_[_0x9ffc('0x10')](AZURE_AUTH_SCOPES[_0x5214e3[_0x9ffc('0x11')]]);if(_0x5214e3[_0x9ffc('0x11')]===_0x9ffc('0x12'))_0x4c44ef[_0x9ffc('0x13')](_0x5214e3[_0x9ffc('0x14')]+_0x9ffc('0x15'));return _0x4c44ef['join']('\x20');}function getAccessTokenScope(_0x3ecbb5){if(_0x3ecbb5[_0x9ffc('0x11')]==='Outlook365')return _0x9ffc('0xc');if(_0x3ecbb5[_0x9ffc('0x11')]===_0x9ffc('0x12'))return _0x3ecbb5[_0x9ffc('0x14')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x5b0dbf,_0x4efac4){var _0x429286=MICROSOFT_AUTH_URL['replace'](_0x9ffc('0x16'),_0x5b0dbf[_0x9ffc('0x17')]);var _0x46b429=[_0x9ffc('0x18'),'id_token'];var _0x38f8a4=Buffer[_0x9ffc('0x19')](JSON['stringify']({'id':_0x4efac4}))[_0x9ffc('0x1a')]('base64');var _0x5e6f90=crypto[_0x9ffc('0x1b')](0x10)['toString']('hex');var _0x3e6602=getAuthorizationScopes(_0x5b0dbf);var _0x337563=[{'key':_0x9ffc('0x1c'),'value':_0x5b0dbf[_0x9ffc('0x1d')]},{'key':_0x9ffc('0x1e'),'value':encodeURIComponent(_0x46b429[_0x9ffc('0x1f')]('\x20'))},{'key':_0x9ffc('0x20'),'value':_0x5b0dbf['data4']},{'key':'response_mode','value':'form_post'},{'key':_0x9ffc('0x21'),'value':encodeURIComponent(_0x3e6602)},{'key':'state','value':_0x38f8a4},{'key':_0x9ffc('0x22'),'value':_0x5e6f90},{'key':_0x9ffc('0x23'),'value':_0x9ffc('0x24')}];var _0x54700a=_0x429286+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9ffc('0x10')](_0x337563,function(_0x29a1f0){return _0x29a1f0[_0x9ffc('0x25')]+'='+_0x29a1f0[_0x9ffc('0x26')];})[_0x9ffc('0x1f')]('&');_0x5b0dbf['oauth2Claims']={'issuer':_0x429286[_0x9ffc('0x27')](_0x9ffc('0x28'),''),'audience':_0x5b0dbf[_0x9ffc('0x1d')],'state':_0x38f8a4,'nonce':_0x5e6f90};redis['set'](_0x38f8a4,JSON[_0x9ffc('0x29')](_0x5b0dbf));return _0x54700a;}function isValidIdToken(_0x4b8284,_0x52b456){try{var _0x2fd90d=jwt[_0x9ffc('0x2a')](_0x4b8284,{'complete':!![]});var _0x2d607e=_0x2fd90d['payload'];if(_0x2d607e['iss']!==_0x52b456[_0x9ffc('0x2b')])return![];if(_0x2d607e[_0x9ffc('0x2c')]!==_0x52b456['audience'])return![];if(_0x2d607e['nonce']!==_0x52b456[_0x9ffc('0x22')])return![];if(moment()[_0x9ffc('0x2d')](moment[_0x9ffc('0x2e')](_0x2d607e[_0x9ffc('0x2f')])))return![];return!![];}catch(_0x3f2155){throw _0x3f2155;}}function refreshOauth2MicrosoftAccessToken(_0x4180ef){return Promise['resolve']()[_0x9ffc('0x30')](function(){if(_0x4180ef[_0x9ffc('0x31')])return _0x4180ef;return db[_0x9ffc('0x32')][_0x9ffc('0x33')]({'where':{'id':_0x4180ef['id']},'raw':!![]});})[_0x9ffc('0x30')](function(_0xf53241){var _0x3e4b49={'grant_type':_0x9ffc('0x34'),'refresh_token':_0xf53241[_0x9ffc('0x35')],'scope':getAccessTokenScope(_0xf53241),'redirect_uri':_0xf53241[_0x9ffc('0x36')],'client_id':_0xf53241[_0x9ffc('0x1d')],'client_secret':encryptor[_0x9ffc('0x37')](_0xf53241[_0x9ffc('0x31')])};var _0x7102b2={'method':_0x9ffc('0x38'),'uri':MICROSOFT_AUTH_URL['replace'](_0x9ffc('0x16'),_0xf53241[_0x9ffc('0x17')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3e4b49,'json':!![]};return rp(_0x7102b2);})[_0x9ffc('0x30')](function(_0x5a9a23){_0x4180ef['data5']=_0x5a9a23['access_token'];_0x4180ef['data6']=_0x5a9a23[_0x9ffc('0x34')];return db[_0x9ffc('0x32')][_0x9ffc('0x39')]({'data5':_0x4180ef['data5'],'data6':_0x4180ef[_0x9ffc('0x35')]},{'where':{'id':_0x4180ef['id']}});})[_0x9ffc('0x30')](function(){return _0x4180ef;})[_0x9ffc('0x3a')](function(_0x5d5a95){logger[_0x9ffc('0x3b')](_0x9ffc('0x3c'),_0x4180ef['id'],_0x5d5a95);});}function getOauth2MicrosoftAccessToken(_0x365bdd,_0x59dca1){var _0x320319={'grant_type':_0x9ffc('0x3d'),'code':_0x365bdd,'scope':getAccessTokenScope(_0x59dca1),'redirect_uri':_0x59dca1[_0x9ffc('0x36')],'client_id':_0x59dca1[_0x9ffc('0x1d')],'client_secret':encryptor['decryptString'](_0x59dca1[_0x9ffc('0x31')])};var _0x18587a={'method':_0x9ffc('0x38'),'uri':MICROSOFT_AUTH_URL[_0x9ffc('0x27')]('{TENANT_ID}',_0x59dca1['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x320319,'json':!![]};return rp(_0x18587a);}function startRefreshInterval(_0x5d14a4){var _0xb45ee3=schedule[_0x9ffc('0x3e')];if(_0xb45ee3[_0x5d14a4['id']])clearInterval(_0xb45ee3[_0x5d14a4['id']]);_0xb45ee3[_0x5d14a4['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9ffc('0x3f')](this,{'id':_0x5d14a4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9ffc('0x3e')]=_0xb45ee3;}function startAllRefreshIntervals(){return db[_0x9ffc('0x32')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9ffc('0x30')](function(_0x4c4532){var _0x22fdb0=_0x4c4532[_0x9ffc('0x10')](function(_0x43f05e){return refreshOauth2MicrosoftAccessToken(_0x43f05e)['then'](function(_0xa3fde1){startRefreshInterval(_0xa3fde1);});});return Promise[_0x9ffc('0x40')](_0x22fdb0);})['catch'](function(_0x56173f){var _0x2c04a2=_0x56173f?util[_0x9ffc('0x41')](_0x56173f,{'showHidden':![],'depth':null}):'';logger['error'](_0x9ffc('0x42'),_0x2c04a2);});}module['exports']={'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 bf72b35..b7b2b05 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 _0x96d8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird'];(function(_0x3499f5,_0x483bdc){var _0x3dd3c6=function(_0x7d50ee){while(--_0x7d50ee){_0x3499f5['push'](_0x3499f5['shift']());}};_0x3dd3c6(++_0x483bdc);}(_0x96d8,0x1e2));var _0x896d=function(_0x4ab400,_0x5dae91){_0x4ab400=_0x4ab400-0x0;var _0x5beeff=_0x96d8[_0x4ab400];return _0x5beeff;};'use strict';var _=require(_0x896d('0x0'));var util=require(_0x896d('0x1'));var moment=require(_0x896d('0x2'));var BPromise=require(_0x896d('0x3'));var rs=require(_0x896d('0x4'));var fs=require('fs');var Redis=require(_0x896d('0x5'));var db=require(_0x896d('0x6'))['db'];var utils=require(_0x896d('0x7'));var logger=require(_0x896d('0x8'))(_0x896d('0x9'));var config=require(_0x896d('0xa'));var jayson=require(_0x896d('0xb'));var client=jayson[_0x896d('0xc')][_0x896d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4b6c03,_0x1303a1,_0x11f45a){return new BPromise(function(_0x1edc92,_0x280171){return client[_0x896d('0xe')](_0x4b6c03,_0x11f45a)[_0x896d('0xf')](function(_0x8d7161){logger[_0x896d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1303a1,_0x896d('0x11'));logger[_0x896d('0x12')](_0x896d('0x13'),_0x1303a1,_0x896d('0x11'),JSON[_0x896d('0x14')](_0x8d7161));if(_0x8d7161['error']){if(_0x8d7161[_0x896d('0x15')][_0x896d('0x16')]===0x1f4){logger[_0x896d('0x15')]('CloudProvider,\x20%s,\x20%s',_0x1303a1,_0x8d7161['error']['message']);return _0x280171(_0x8d7161[_0x896d('0x15')]['message']);}logger[_0x896d('0x15')]('CloudProvider,\x20%s,\x20%s',_0x1303a1,_0x8d7161['error'][_0x896d('0x17')]);return _0x1edc92(_0x8d7161[_0x896d('0x15')]['message']);}else{logger[_0x896d('0x10')](_0x896d('0x18'),_0x1303a1,_0x896d('0x11'));_0x1edc92(_0x8d7161[_0x896d('0x19')][_0x896d('0x17')]);}})[_0x896d('0x1a')](function(_0x2adb40){logger[_0x896d('0x15')](_0x896d('0x18'),_0x1303a1,_0x2adb40);_0x280171(_0x2adb40);});});} \ No newline at end of file +var _0xfe39=['../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x4128d9,_0xbd5ac7){var _0x2008bb=function(_0x42f864){while(--_0x42f864){_0x4128d9['push'](_0x4128d9['shift']());}};_0x2008bb(++_0xbd5ac7);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xfe39[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x9fe3('0x0'));var util=require(_0x9fe3('0x1'));var moment=require('moment');var BPromise=require(_0x9fe3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fe3('0x3'))['db'];var utils=require(_0x9fe3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fe3('0x5'));var jayson=require(_0x9fe3('0x6'));var client=jayson[_0x9fe3('0x7')][_0x9fe3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc469b7,_0x4183ce,_0x25868f){return new BPromise(function(_0x5a3bd6,_0x211eb2){return client[_0x9fe3('0x9')](_0xc469b7,_0x25868f)[_0x9fe3('0xa')](function(_0x35c391){logger[_0x9fe3('0xb')](_0x9fe3('0xc'),_0x4183ce,'request\x20sent');logger['debug'](_0x9fe3('0xd'),_0x4183ce,_0x9fe3('0xe'),JSON['stringify'](_0x35c391));if(_0x35c391[_0x9fe3('0xf')]){if(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x10')]===0x1f4){logger[_0x9fe3('0xf')]('CloudProvider,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x211eb2(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x5a3bd6(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}else{logger[_0x9fe3('0xb')]('CloudProvider,\x20%s,\x20%s',_0x4183ce,'request\x20sent');_0x5a3bd6(_0x35c391[_0x9fe3('0x12')][_0x9fe3('0x11')]);}})[_0x9fe3('0x13')](function(_0x2d28d4){logger['error'](_0x9fe3('0xc'),_0x4183ce,_0x2d28d4);_0x211eb2(_0x2d28d4);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 858692f..b01707f 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x38d911,_0x5a0290){var _0x3df38b=function(_0x455e5e){while(--_0x455e5e){_0x38d911['push'](_0x38d911['shift']());}};_0x3df38b(++_0x5a0290);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ce722,_0x549f9b){_0x3ce722=_0x3ce722-0x0;var _0x16bfcb=_0x5f2f[_0x3ce722];return _0x16bfcb;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 7e1e4b3..284d479 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 _0x962c=['exports','STRING'];(function(_0x35a08c,_0x51c89e){var _0x165935=function(_0x811523){while(--_0x811523){_0x35a08c['push'](_0x35a08c['shift']());}};_0x165935(++_0x51c89e);}(_0x962c,0x1a0));var _0xc962=function(_0x49b923,_0x13c9c9){_0x49b923=_0x49b923-0x0;var _0xdf5a28=_0x962c[_0x49b923];return _0xdf5a28;};'use strict';var Sequelize=require('sequelize');module[_0xc962('0x0')]={'name':{'type':Sequelize[_0xc962('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc962('0x1')]},'companyId':{'type':Sequelize[_0xc962('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc962('0x1')]},'fax':{'type':Sequelize[_0xc962('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc962('0x1')]},'postalCode':{'type':Sequelize[_0xc962('0x1')]},'city':{'type':Sequelize[_0xc962('0x1')]},'country':{'type':Sequelize[_0xc962('0x1')]},'email':{'type':Sequelize[_0xc962('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc962('0x1')]},'sStreet':{'type':Sequelize[_0xc962('0x1')]},'sPostalCode':{'type':Sequelize[_0xc962('0x1')]},'sCity':{'type':Sequelize[_0xc962('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc962('0x1')]}}; \ No newline at end of file +var _0xf69b=['STRING','name','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf69b,0x1e8));var _0xbf69=function(_0x1ce889,_0x22b515){_0x1ce889=_0x1ce889-0x0;var _0x34f074=_0xf69b[_0x1ce889];return _0x34f074;};'use strict';var Sequelize=require('sequelize');module[_0xbf69('0x0')]={'name':{'type':Sequelize[_0xbf69('0x1')],'unique':_0xbf69('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbf69('0x1')]},'companyId':{'type':Sequelize[_0xbf69('0x1')]},'website':{'type':Sequelize[_0xbf69('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbf69('0x1')]},'type':{'type':Sequelize[_0xbf69('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbf69('0x1')]},'city':{'type':Sequelize[_0xbf69('0x1')]},'country':{'type':Sequelize[_0xbf69('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbf69('0x1')]},'sStreet':{'type':Sequelize[_0xbf69('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xbf69('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index e65ae4f..8725789 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 _0x6534=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','Companies','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','findOne','CmContact','rawAttributes','hasOwnProperty','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6534,0x1f4));var _0x4653=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6534[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x4653('0x0'));var rimraf=require(_0x4653('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4653('0x2'));var BPromise=require(_0x4653('0x3'));var Mustache=require(_0x4653('0x4'));var util=require(_0x4653('0x5'));var path=require(_0x4653('0x6'));var sox=require(_0x4653('0x7'));var csv=require('to-csv');var ejs=require(_0x4653('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4653('0x9'));var squel=require(_0x4653('0xa'));var crypto=require(_0x4653('0xb'));var jsforce=require(_0x4653('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4653('0xd'));var Papa=require(_0x4653('0xe'));var Redis=require('ioredis');var authService=require(_0x4653('0xf'));var qs=require(_0x4653('0x10'));var as=require(_0x4653('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4653('0x12'));var utils=require(_0x4653('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4653('0x14'));var db=require(_0x4653('0x15'))['db'];function respondWithStatusCode(_0x12268d,_0x308607){_0x308607=_0x308607||0xcc;return function(_0x2f0529){if(_0x2f0529){return _0x12268d[_0x4653('0x16')](_0x308607);}return _0x12268d[_0x4653('0x17')](_0x308607)[_0x4653('0x18')]();};}function respondWithResult(_0x5085ab,_0x2dae73){_0x2dae73=_0x2dae73||0xc8;return function(_0x3d4395){if(_0x3d4395){return _0x5085ab[_0x4653('0x17')](_0x2dae73)['json'](_0x3d4395);}};}function respondWithFilteredResult(_0xbfb318,_0x3412af){return function(_0x48740e){if(_0x48740e){var _0x5d47ad=typeof _0x3412af[_0x4653('0x19')]===_0x4653('0x1a')&&typeof _0x3412af['limit']==='undefined';var _0x52b3c9=_0x48740e[_0x4653('0x1b')];var _0x415784=_0x5d47ad?0x0:_0x3412af['offset'];var _0x462d5a=_0x5d47ad?_0x48740e['count']:_0x3412af[_0x4653('0x19')]+_0x3412af['limit'];var _0x89f6b4;if(_0x462d5a>=_0x52b3c9){_0x462d5a=_0x52b3c9;_0x89f6b4=0xc8;}else{_0x89f6b4=0xce;}_0xbfb318['status'](_0x89f6b4);return _0xbfb318[_0x4653('0x1c')]('Content-Range',_0x415784+'-'+_0x462d5a+'/'+_0x52b3c9)[_0x4653('0x1d')](_0x48740e);}return null;};}function patchUpdates(_0x54c782){return function(_0x5b7fe3){try{jsonpatch[_0x4653('0x1e')](_0x5b7fe3,_0x54c782,!![]);}catch(_0x5abc30){return BPromise[_0x4653('0x1f')](_0x5abc30);}return _0x5b7fe3[_0x4653('0x20')]();};}function saveUpdates(_0x2e56a6,_0x4ead9a){return function(_0x55b972){if(_0x55b972){return _0x55b972[_0x4653('0x21')](_0x2e56a6)[_0x4653('0x22')](function(_0xfe8eb){return _0xfe8eb;});}return null;};}function removeEntity(_0x3deaa8,_0x5b9f2a){return function(_0x1f0faf){if(_0x1f0faf){return _0x1f0faf[_0x4653('0x23')]()[_0x4653('0x22')](function(){var _0x27931a=_0x1f0faf['get']({'plain':!![]});var _0x3591d2=_0x4653('0x24');return db['UserProfileResource'][_0x4653('0x23')]({'where':{'type':_0x3591d2,'resourceId':_0x27931a['id']}})[_0x4653('0x22')](function(){return _0x1f0faf;});})[_0x4653('0x22')](function(){_0x3deaa8[_0x4653('0x17')](0xcc)[_0x4653('0x18')]();});}};}function handleEntityNotFound(_0x488294,_0x2fe1dc){return function(_0x498f95){if(!_0x498f95){_0x488294[_0x4653('0x16')](0x194);}return _0x498f95;};}function handleError(_0xf869e7,_0xa46662){_0xa46662=_0xa46662||0x1f4;return function(_0x174303){logger[_0x4653('0x25')](_0x174303['stack']);if(_0x174303[_0x4653('0x26')]){delete _0x174303[_0x4653('0x26')];}_0xf869e7[_0x4653('0x17')](_0xa46662)[_0x4653('0x27')](_0x174303);};}exports[_0x4653('0x28')]=function(_0x38d497,_0x2c6494){var _0x404528={},_0x1fae3a={},_0x5dcd9f={'count':0x0,'rows':[]};return db[_0x4653('0x29')][_0x4653('0x2a')]()['then'](function(_0x4fbdff){_0x1fae3a[_0x4653('0x2b')]=_[_0x4653('0x2c')](_0x4fbdff);_0x1fae3a['query']=_[_0x4653('0x2c')](_0x38d497[_0x4653('0x2d')]);_0x1fae3a[_0x4653('0x2e')]=_[_0x4653('0x2f')](_0x1fae3a[_0x4653('0x2b')],_0x1fae3a[_0x4653('0x2d')]);_0x404528[_0x4653('0x30')]=_[_0x4653('0x2f')](_0x1fae3a[_0x4653('0x2b')],qs['fields'](_0x38d497[_0x4653('0x2d')][_0x4653('0x31')]));_0x404528[_0x4653('0x30')]=_0x404528['attributes'][_0x4653('0x32')]?_0x404528[_0x4653('0x30')]:_0x1fae3a[_0x4653('0x2b')];if(!_0x38d497['query']['hasOwnProperty'](_0x4653('0x33'))){_0x404528['limit']=qs[_0x4653('0x34')](_0x38d497[_0x4653('0x2d')][_0x4653('0x34')]);_0x404528[_0x4653('0x19')]=qs[_0x4653('0x19')](_0x38d497[_0x4653('0x2d')][_0x4653('0x19')]);}_0x404528[_0x4653('0x35')]=qs[_0x4653('0x36')](_0x38d497[_0x4653('0x2d')][_0x4653('0x36')]);_0x404528[_0x4653('0x37')]=qs[_0x4653('0x2e')](_[_0x4653('0x38')](_0x38d497[_0x4653('0x2d')],_0x1fae3a[_0x4653('0x2e')]),_0x4fbdff);if(_0x38d497[_0x4653('0x2d')][_0x4653('0x39')]){_0x404528[_0x4653('0x37')]=_[_0x4653('0x3a')](_0x404528[_0x4653('0x37')],{'$or':_[_0x4653('0x3b')](_0x404528['attributes'],function(_0xfba4e9){var _0x4633c0={};_0x4633c0[_0xfba4e9]={'$like':'%'+_0x38d497[_0x4653('0x2d')][_0x4653('0x39')]+'%'};return _0x4633c0;})});}_0x404528=_[_0x4653('0x3a')]({},_0x404528,_0x38d497[_0x4653('0x3c')]);var _0x5de91e={'where':_0x404528[_0x4653('0x37')]};return db['CmCompany'][_0x4653('0x1b')](_0x5de91e)[_0x4653('0x22')](function(_0x5e5da){_0x5dcd9f[_0x4653('0x1b')]=_0x5e5da;if(_0x38d497[_0x4653('0x2d')][_0x4653('0x3d')]){_0x404528[_0x4653('0x3e')]=[{'all':!![]}];}return db[_0x4653('0x29')][_0x4653('0x3f')](_0x404528);})[_0x4653('0x22')](function(_0x3145cc){_0x5dcd9f[_0x4653('0x40')]=_0x3145cc;return _0x5dcd9f;})[_0x4653('0x22')](respondWithFilteredResult(_0x2c6494,_0x404528))[_0x4653('0x41')](handleError(_0x2c6494,null));})[_0x4653('0x41')](handleError(_0x2c6494,null));};exports['show']=function(_0x48f957,_0x4c2824){var _0x2b0048={'raw':![],'where':{'id':_0x48f957[_0x4653('0x42')]['id']}},_0xe111d7={};_0xe111d7['model']=_[_0x4653('0x2c')](db['CmCompany']['rawAttributes']);_0xe111d7[_0x4653('0x2d')]=_[_0x4653('0x2c')](_0x48f957[_0x4653('0x2d')]);_0xe111d7['filters']=_[_0x4653('0x2f')](_0xe111d7['model'],_0xe111d7[_0x4653('0x2d')]);_0x2b0048[_0x4653('0x30')]=_[_0x4653('0x2f')](_0xe111d7[_0x4653('0x2b')],qs[_0x4653('0x31')](_0x48f957[_0x4653('0x2d')][_0x4653('0x31')]));_0x2b0048[_0x4653('0x30')]=_0x2b0048[_0x4653('0x30')][_0x4653('0x32')]?_0x2b0048['attributes']:_0xe111d7[_0x4653('0x2b')];if(_0x48f957[_0x4653('0x2d')]['includeAll']){_0x2b0048[_0x4653('0x3e')]=[{'all':!![]}];}_0x2b0048=_[_0x4653('0x3a')]({},_0x2b0048,_0x48f957['options']);return db[_0x4653('0x29')][_0x4653('0x43')](_0x2b0048)[_0x4653('0x22')](handleEntityNotFound(_0x4c2824,null))[_0x4653('0x22')](respondWithResult(_0x4c2824,null))[_0x4653('0x41')](handleError(_0x4c2824,null));};exports['create']=function(_0x22acf8,_0x4006da){return db[_0x4653('0x29')][_0x4653('0x44')](_0x22acf8[_0x4653('0x45')],{})[_0x4653('0x22')](function(_0x4e1459){var _0x2dd15b=_0x22acf8[_0x4653('0x46')][_0x4653('0x47')]({'plain':!![]});if(!_0x2dd15b)throw new Error(_0x4653('0x48'));if(_0x2dd15b[_0x4653('0x49')]===_0x4653('0x46')){var _0x43ea0d=_0x4e1459[_0x4653('0x47')]({'plain':!![]});var _0x8fb784=_0x4653('0x24');return db[_0x4653('0x4a')]['find']({'where':{'name':_0x8fb784,'userProfileId':_0x2dd15b[_0x4653('0x4b')]},'raw':!![]})['then'](function(_0x464bdc){if(_0x464bdc&&_0x464bdc[_0x4653('0x4c')]===0x0){return db[_0x4653('0x4d')][_0x4653('0x44')]({'name':_0x43ea0d['name'],'resourceId':_0x43ea0d['id'],'type':_0x464bdc[_0x4653('0x26')],'sectionId':_0x464bdc['id']},{})[_0x4653('0x22')](function(){return _0x4e1459;});}else{return _0x4e1459;}})[_0x4653('0x41')](function(_0x121dac){logger['error'](_0x4653('0x4e'),_0x121dac);throw _0x121dac;});}return _0x4e1459;})['then'](respondWithResult(_0x4006da,0xc9))['catch'](handleError(_0x4006da,null));};exports[_0x4653('0x21')]=function(_0x2e744a,_0x42c9ce){if(_0x2e744a[_0x4653('0x45')]['id']){delete _0x2e744a[_0x4653('0x45')]['id'];}return db['CmCompany'][_0x4653('0x43')]({'where':{'id':_0x2e744a['params']['id']}})['then'](handleEntityNotFound(_0x42c9ce,null))['then'](saveUpdates(_0x2e744a['body'],null))[_0x4653('0x22')](respondWithResult(_0x42c9ce,null))['catch'](handleError(_0x42c9ce,null));};exports['destroy']=function(_0x429574,_0x273af7){return db[_0x4653('0x29')][_0x4653('0x43')]({'where':{'id':_0x429574['params']['id']}})[_0x4653('0x22')](handleEntityNotFound(_0x273af7,null))[_0x4653('0x22')](removeEntity(_0x273af7,null))['catch'](handleError(_0x273af7,null));};exports['describe']=function(_0x4febd3,_0x13420e){return db[_0x4653('0x29')][_0x4653('0x2a')]()[_0x4653('0x22')](respondWithResult(_0x13420e,null))[_0x4653('0x41')](handleError(_0x13420e,null));};exports[_0x4653('0x4f')]=function(_0x247667,_0x10835f,_0x2a4f0b){return db['CmContact'][_0x4653('0x43')]({'where':{'id':_0x247667[_0x4653('0x42')]['id']}})[_0x4653('0x22')](handleEntityNotFound(_0x10835f,null))[_0x4653('0x22')](function(_0x2f45dd){if(_0x2f45dd){return _0x2f45dd[_0x4653('0x4f')](_0x247667[_0x4653('0x45')][_0x4653('0x50')],_['omit'](_0x247667[_0x4653('0x45')],[_0x4653('0x50'),'id'])||{});}})[_0x4653('0x22')](respondWithResult(_0x10835f,null))[_0x4653('0x41')](handleError(_0x10835f,null));};exports[_0x4653('0x51')]=function(_0x3b74e9,_0x50b74b,_0x2f49e4){var _0x426593={};var _0xf77379={};var _0x477001;var _0x51fd44;return db[_0x4653('0x29')][_0x4653('0x52')]({'where':{'id':_0x3b74e9[_0x4653('0x42')]['id']}})[_0x4653('0x22')](handleEntityNotFound(_0x50b74b,null))[_0x4653('0x22')](function(_0x1fcc04){if(_0x1fcc04){_0x477001=_0x1fcc04;_0xf77379['model']=_[_0x4653('0x2c')](db[_0x4653('0x53')][_0x4653('0x54')]);_0xf77379[_0x4653('0x2d')]=_[_0x4653('0x2c')](_0x3b74e9['query']);_0xf77379[_0x4653('0x2e')]=_[_0x4653('0x2f')](_0xf77379[_0x4653('0x2b')],_0xf77379[_0x4653('0x2d')]);_0x426593[_0x4653('0x30')]=_['intersection'](_0xf77379[_0x4653('0x2b')],qs[_0x4653('0x31')](_0x3b74e9[_0x4653('0x2d')][_0x4653('0x31')]));_0x426593['attributes']=_0x426593['attributes'][_0x4653('0x32')]?_0x426593[_0x4653('0x30')]:_0xf77379[_0x4653('0x2b')];_0x426593[_0x4653('0x35')]=qs[_0x4653('0x36')](_0x3b74e9[_0x4653('0x2d')][_0x4653('0x36')]);_0x426593[_0x4653('0x37')]=qs[_0x4653('0x2e')](_[_0x4653('0x38')](_0x3b74e9[_0x4653('0x2d')],_0xf77379[_0x4653('0x2e')]));if(_0x3b74e9[_0x4653('0x2d')]['filter']){_0x426593['where']=_[_0x4653('0x3a')](_0x426593[_0x4653('0x37')],{'$or':_[_0x4653('0x3b')](_0x426593['attributes'],function(_0x44b2ba){var _0x452345={};_0x452345[_0x44b2ba]={'$like':'%'+_0x3b74e9[_0x4653('0x2d')]['filter']+'%'};return _0x452345;})});}_0x426593=_[_0x4653('0x3a')]({},_0x426593,_0x3b74e9[_0x4653('0x3c')]);return _0x477001['getContacts'](_0x426593);}})[_0x4653('0x22')](function(_0x3ed945){if(_0x3ed945){_0x51fd44=_0x3ed945[_0x4653('0x32')];if(!_0x3b74e9[_0x4653('0x2d')][_0x4653('0x55')]('nolimit')){_0x426593[_0x4653('0x34')]=qs[_0x4653('0x34')](_0x3b74e9[_0x4653('0x2d')]['limit']);_0x426593['offset']=qs['offset'](_0x3b74e9[_0x4653('0x2d')]['offset']);}return _0x477001[_0x4653('0x51')](_0x426593);}})[_0x4653('0x22')](function(_0x3d579d){if(_0x3d579d){return _0x3d579d?{'count':_0x51fd44,'rows':_0x3d579d}:null;}})['then'](respondWithResult(_0x50b74b,null))[_0x4653('0x41')](handleError(_0x50b74b,null));}; \ No newline at end of file +var _0x571d=['params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','findOne','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','json','save','update','then','get','Companies','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','merge','map','filter','options','includeAll','include','findAll','rows','catch','show'];(function(_0x5a092c,_0x18b0ee){var _0x4b74c3=function(_0x236ab4){while(--_0x236ab4){_0x5a092c['push'](_0x5a092c['shift']());}};_0x4b74c3(++_0x18b0ee);}(_0x571d,0xc3));var _0xd571=function(_0x5139e6,_0x476352){_0x5139e6=_0x5139e6-0x0;var _0x5be136=_0x571d[_0x5139e6];return _0x5be136;};'use strict';var emlformat=require(_0xd571('0x0'));var rimraf=require(_0xd571('0x1'));var zipdir=require(_0xd571('0x2'));var jsonpatch=require(_0xd571('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd571('0x4'));var Mustache=require(_0xd571('0x5'));var util=require(_0xd571('0x6'));var path=require(_0xd571('0x7'));var sox=require(_0xd571('0x8'));var csv=require(_0xd571('0x9'));var ejs=require(_0xd571('0xa'));var fs=require('fs');var fs_extra=require(_0xd571('0xb'));var _=require('lodash');var squel=require(_0xd571('0xc'));var crypto=require(_0xd571('0xd'));var jsforce=require(_0xd571('0xe'));var deskjs=require(_0xd571('0xf'));var toCsv=require(_0xd571('0x9'));var querystring=require(_0xd571('0x10'));var Papa=require('papaparse');var Redis=require(_0xd571('0x11'));var authService=require(_0xd571('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd571('0x13'));var hardwareService=require(_0xd571('0x14'));var logger=require(_0xd571('0x15'))(_0xd571('0x16'));var utils=require(_0xd571('0x17'));var config=require(_0xd571('0x18'));var licenseUtil=require(_0xd571('0x19'));var db=require(_0xd571('0x1a'))['db'];function respondWithStatusCode(_0x423b2c,_0x59addc){_0x59addc=_0x59addc||0xcc;return function(_0x38168c){if(_0x38168c){return _0x423b2c['sendStatus'](_0x59addc);}return _0x423b2c[_0xd571('0x1b')](_0x59addc)[_0xd571('0x1c')]();};}function respondWithResult(_0x21614a,_0xf826d1){_0xf826d1=_0xf826d1||0xc8;return function(_0x302a4b){if(_0x302a4b){return _0x21614a[_0xd571('0x1b')](_0xf826d1)['json'](_0x302a4b);}};}function respondWithFilteredResult(_0x3f67e9,_0x1786e5){return function(_0x5599a1){if(_0x5599a1){var _0x3eb9d8=typeof _0x1786e5[_0xd571('0x1d')]===_0xd571('0x1e')&&typeof _0x1786e5['limit']==='undefined';var _0x314c48=_0x5599a1[_0xd571('0x1f')];var _0x46bcc1=_0x3eb9d8?0x0:_0x1786e5[_0xd571('0x1d')];var _0x5c2b02=_0x3eb9d8?_0x5599a1[_0xd571('0x1f')]:_0x1786e5[_0xd571('0x1d')]+_0x1786e5[_0xd571('0x20')];var _0x496f42;if(_0x5c2b02>=_0x314c48){_0x5c2b02=_0x314c48;_0x496f42=0xc8;}else{_0x496f42=0xce;}_0x3f67e9['status'](_0x496f42);return _0x3f67e9['set'](_0xd571('0x21'),_0x46bcc1+'-'+_0x5c2b02+'/'+_0x314c48)[_0xd571('0x22')](_0x5599a1);}return null;};}function patchUpdates(_0x557f26){return function(_0x141ca4){try{jsonpatch['apply'](_0x141ca4,_0x557f26,!![]);}catch(_0x3c07a5){return BPromise['reject'](_0x3c07a5);}return _0x141ca4[_0xd571('0x23')]();};}function saveUpdates(_0x24b866,_0x3eb6a8){return function(_0x23b630){if(_0x23b630){return _0x23b630[_0xd571('0x24')](_0x24b866)[_0xd571('0x25')](function(_0x40cb9e){return _0x40cb9e;});}return null;};}function removeEntity(_0x56ef57,_0x3cd5dc){return function(_0x2750d7){if(_0x2750d7){return _0x2750d7['destroy']()[_0xd571('0x25')](function(){var _0x27305c=_0x2750d7[_0xd571('0x26')]({'plain':!![]});var _0x32b5a8=_0xd571('0x27');return db[_0xd571('0x28')][_0xd571('0x29')]({'where':{'type':_0x32b5a8,'resourceId':_0x27305c['id']}})['then'](function(){return _0x2750d7;});})[_0xd571('0x25')](function(){_0x56ef57[_0xd571('0x1b')](0xcc)[_0xd571('0x1c')]();});}};}function handleEntityNotFound(_0x4a2e64,_0x46ed6f){return function(_0x1fbf41){if(!_0x1fbf41){_0x4a2e64[_0xd571('0x2a')](0x194);}return _0x1fbf41;};}function handleError(_0x2260b5,_0xde809){_0xde809=_0xde809||0x1f4;return function(_0x2c1837){logger[_0xd571('0x2b')](_0x2c1837[_0xd571('0x2c')]);if(_0x2c1837[_0xd571('0x2d')]){delete _0x2c1837[_0xd571('0x2d')];}_0x2260b5[_0xd571('0x1b')](_0xde809)[_0xd571('0x2e')](_0x2c1837);};}exports[_0xd571('0x2f')]=function(_0x505588,_0x2f45ac){var _0x124647={},_0x5c641f={},_0x1937a7={'count':0x0,'rows':[]};return db[_0xd571('0x30')][_0xd571('0x31')]()['then'](function(_0x25a06d){_0x5c641f[_0xd571('0x32')]=_[_0xd571('0x33')](_0x25a06d);_0x5c641f['query']=_[_0xd571('0x33')](_0x505588['query']);_0x5c641f[_0xd571('0x34')]=_[_0xd571('0x35')](_0x5c641f[_0xd571('0x32')],_0x5c641f['query']);_0x124647[_0xd571('0x36')]=_[_0xd571('0x35')](_0x5c641f[_0xd571('0x32')],qs[_0xd571('0x37')](_0x505588[_0xd571('0x38')][_0xd571('0x37')]));_0x124647['attributes']=_0x124647[_0xd571('0x36')][_0xd571('0x39')]?_0x124647[_0xd571('0x36')]:_0x5c641f[_0xd571('0x32')];if(!_0x505588[_0xd571('0x38')]['hasOwnProperty'](_0xd571('0x3a'))){_0x124647[_0xd571('0x20')]=qs['limit'](_0x505588[_0xd571('0x38')][_0xd571('0x20')]);_0x124647['offset']=qs[_0xd571('0x1d')](_0x505588[_0xd571('0x38')][_0xd571('0x1d')]);}_0x124647[_0xd571('0x3b')]=qs[_0xd571('0x3c')](_0x505588['query'][_0xd571('0x3c')]);_0x124647[_0xd571('0x3d')]=qs[_0xd571('0x34')](_['pick'](_0x505588[_0xd571('0x38')],_0x5c641f[_0xd571('0x34')]),_0x25a06d);if(_0x505588[_0xd571('0x38')]['filter']){_0x124647[_0xd571('0x3d')]=_[_0xd571('0x3e')](_0x124647[_0xd571('0x3d')],{'$or':_[_0xd571('0x3f')](_0x124647[_0xd571('0x36')],function(_0x2cde93){var _0x144cda={};_0x144cda[_0x2cde93]={'$like':'%'+_0x505588[_0xd571('0x38')][_0xd571('0x40')]+'%'};return _0x144cda;})});}_0x124647=_[_0xd571('0x3e')]({},_0x124647,_0x505588[_0xd571('0x41')]);var _0x2ea098={'where':_0x124647[_0xd571('0x3d')]};return db['CmCompany'][_0xd571('0x1f')](_0x2ea098)[_0xd571('0x25')](function(_0x15b790){_0x1937a7[_0xd571('0x1f')]=_0x15b790;if(_0x505588['query'][_0xd571('0x42')]){_0x124647[_0xd571('0x43')]=[{'all':!![]}];}return db[_0xd571('0x30')][_0xd571('0x44')](_0x124647);})[_0xd571('0x25')](function(_0x2caee1){_0x1937a7[_0xd571('0x45')]=_0x2caee1;return _0x1937a7;})[_0xd571('0x25')](respondWithFilteredResult(_0x2f45ac,_0x124647))[_0xd571('0x46')](handleError(_0x2f45ac,null));})[_0xd571('0x46')](handleError(_0x2f45ac,null));};exports[_0xd571('0x47')]=function(_0x18b4cb,_0x5510b6){var _0x32bcf4={'raw':![],'where':{'id':_0x18b4cb[_0xd571('0x48')]['id']}},_0x23058d={};_0x23058d[_0xd571('0x32')]=_['keys'](db[_0xd571('0x30')][_0xd571('0x49')]);_0x23058d[_0xd571('0x38')]=_[_0xd571('0x33')](_0x18b4cb[_0xd571('0x38')]);_0x23058d[_0xd571('0x34')]=_[_0xd571('0x35')](_0x23058d[_0xd571('0x32')],_0x23058d[_0xd571('0x38')]);_0x32bcf4[_0xd571('0x36')]=_[_0xd571('0x35')](_0x23058d[_0xd571('0x32')],qs['fields'](_0x18b4cb['query'][_0xd571('0x37')]));_0x32bcf4[_0xd571('0x36')]=_0x32bcf4['attributes']['length']?_0x32bcf4[_0xd571('0x36')]:_0x23058d[_0xd571('0x32')];if(_0x18b4cb[_0xd571('0x38')][_0xd571('0x42')]){_0x32bcf4[_0xd571('0x43')]=[{'all':!![]}];}_0x32bcf4=_[_0xd571('0x3e')]({},_0x32bcf4,_0x18b4cb['options']);return db[_0xd571('0x30')][_0xd571('0x4a')](_0x32bcf4)[_0xd571('0x25')](handleEntityNotFound(_0x5510b6,null))['then'](respondWithResult(_0x5510b6,null))['catch'](handleError(_0x5510b6,null));};exports[_0xd571('0x4b')]=function(_0x1a9b2a,_0x1007a3){return db[_0xd571('0x30')][_0xd571('0x4b')](_0x1a9b2a[_0xd571('0x4c')],{})['then'](function(_0x51872e){var _0x214e22=_0x1a9b2a[_0xd571('0x4d')][_0xd571('0x26')]({'plain':!![]});if(!_0x214e22)throw new Error(_0xd571('0x4e'));if(_0x214e22[_0xd571('0x4f')]==='user'){var _0x5abe1d=_0x51872e[_0xd571('0x26')]({'plain':!![]});var _0x50f99a=_0xd571('0x27');return db[_0xd571('0x50')][_0xd571('0x4a')]({'where':{'name':_0x50f99a,'userProfileId':_0x214e22[_0xd571('0x51')]},'raw':!![]})[_0xd571('0x25')](function(_0x43f566){if(_0x43f566&&_0x43f566[_0xd571('0x52')]===0x0){return db[_0xd571('0x28')][_0xd571('0x4b')]({'name':_0x5abe1d[_0xd571('0x2d')],'resourceId':_0x5abe1d['id'],'type':_0x43f566[_0xd571('0x2d')],'sectionId':_0x43f566['id']},{})['then'](function(){return _0x51872e;});}else{return _0x51872e;}})['catch'](function(_0x1fb714){logger[_0xd571('0x2b')](_0xd571('0x53'),_0x1fb714);throw _0x1fb714;});}return _0x51872e;})[_0xd571('0x25')](respondWithResult(_0x1007a3,0xc9))[_0xd571('0x46')](handleError(_0x1007a3,null));};exports[_0xd571('0x24')]=function(_0x551fae,_0x33beb6){if(_0x551fae[_0xd571('0x4c')]['id']){delete _0x551fae[_0xd571('0x4c')]['id'];}return db[_0xd571('0x30')][_0xd571('0x4a')]({'where':{'id':_0x551fae[_0xd571('0x48')]['id']}})['then'](handleEntityNotFound(_0x33beb6,null))[_0xd571('0x25')](saveUpdates(_0x551fae[_0xd571('0x4c')],null))[_0xd571('0x25')](respondWithResult(_0x33beb6,null))[_0xd571('0x46')](handleError(_0x33beb6,null));};exports[_0xd571('0x29')]=function(_0x2d9122,_0x223d0f){return db['CmCompany'][_0xd571('0x4a')]({'where':{'id':_0x2d9122[_0xd571('0x48')]['id']}})['then'](handleEntityNotFound(_0x223d0f,null))['then'](removeEntity(_0x223d0f,null))[_0xd571('0x46')](handleError(_0x223d0f,null));};exports[_0xd571('0x31')]=function(_0x4e8f66,_0x1435e3){return db[_0xd571('0x30')][_0xd571('0x31')]()['then'](respondWithResult(_0x1435e3,null))[_0xd571('0x46')](handleError(_0x1435e3,null));};exports[_0xd571('0x54')]=function(_0x21470a,_0x5acfc4,_0x134cf5){return db['CmContact'][_0xd571('0x4a')]({'where':{'id':_0x21470a['params']['id']}})['then'](handleEntityNotFound(_0x5acfc4,null))['then'](function(_0x450750){if(_0x450750){return _0x450750['addContacts'](_0x21470a[_0xd571('0x4c')][_0xd571('0x55')],_['omit'](_0x21470a[_0xd571('0x4c')],[_0xd571('0x55'),'id'])||{});}})[_0xd571('0x25')](respondWithResult(_0x5acfc4,null))['catch'](handleError(_0x5acfc4,null));};exports[_0xd571('0x56')]=function(_0x4e19b6,_0x507b44,_0x2abac7){var _0x6e7647={};var _0x2083b1={};var _0x164722;var _0x5cc041;return db[_0xd571('0x30')][_0xd571('0x57')]({'where':{'id':_0x4e19b6[_0xd571('0x48')]['id']}})[_0xd571('0x25')](handleEntityNotFound(_0x507b44,null))[_0xd571('0x25')](function(_0x5a1955){if(_0x5a1955){_0x164722=_0x5a1955;_0x2083b1[_0xd571('0x32')]=_[_0xd571('0x33')](db['CmContact'][_0xd571('0x49')]);_0x2083b1[_0xd571('0x38')]=_[_0xd571('0x33')](_0x4e19b6[_0xd571('0x38')]);_0x2083b1['filters']=_['intersection'](_0x2083b1[_0xd571('0x32')],_0x2083b1[_0xd571('0x38')]);_0x6e7647[_0xd571('0x36')]=_[_0xd571('0x35')](_0x2083b1[_0xd571('0x32')],qs[_0xd571('0x37')](_0x4e19b6['query']['fields']));_0x6e7647['attributes']=_0x6e7647['attributes'][_0xd571('0x39')]?_0x6e7647[_0xd571('0x36')]:_0x2083b1['model'];_0x6e7647[_0xd571('0x3b')]=qs[_0xd571('0x3c')](_0x4e19b6[_0xd571('0x38')][_0xd571('0x3c')]);_0x6e7647[_0xd571('0x3d')]=qs[_0xd571('0x34')](_['pick'](_0x4e19b6[_0xd571('0x38')],_0x2083b1['filters']));if(_0x4e19b6['query'][_0xd571('0x40')]){_0x6e7647[_0xd571('0x3d')]=_['merge'](_0x6e7647[_0xd571('0x3d')],{'$or':_[_0xd571('0x3f')](_0x6e7647['attributes'],function(_0x146c9a){var _0xfb1225={};_0xfb1225[_0x146c9a]={'$like':'%'+_0x4e19b6[_0xd571('0x38')][_0xd571('0x40')]+'%'};return _0xfb1225;})});}_0x6e7647=_['merge']({},_0x6e7647,_0x4e19b6[_0xd571('0x41')]);return _0x164722[_0xd571('0x56')](_0x6e7647);}})['then'](function(_0x80eca1){if(_0x80eca1){_0x5cc041=_0x80eca1['length'];if(!_0x4e19b6[_0xd571('0x38')][_0xd571('0x58')](_0xd571('0x3a'))){_0x6e7647['limit']=qs[_0xd571('0x20')](_0x4e19b6[_0xd571('0x38')][_0xd571('0x20')]);_0x6e7647['offset']=qs['offset'](_0x4e19b6[_0xd571('0x38')][_0xd571('0x1d')]);}return _0x164722[_0xd571('0x56')](_0x6e7647);}})['then'](function(_0x3d30b3){if(_0x3d30b3){return _0x3d30b3?{'count':_0x5cc041,'rows':_0x3d30b3}:null;}})[_0xd571('0x25')](respondWithResult(_0x507b44,null))[_0xd571('0x46')](handleError(_0x507b44,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index b426833..c8fb107 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 _0xef7b=['define','CmCompany','lodash','../../config/logger','moment','request-promise','path','rimraf','./cmCompany.attributes','exports'];(function(_0x44882a,_0x86a2dd){var _0x473230=function(_0x136c6a){while(--_0x136c6a){_0x44882a['push'](_0x44882a['shift']());}};_0x473230(++_0x86a2dd);}(_0xef7b,0xe8));var _0xbef7=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xef7b[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require(_0xbef7('0x0'));var util=require('util');var logger=require(_0xbef7('0x1'))('api');var moment=require(_0xbef7('0x2'));var BPromise=require('bluebird');var rp=require(_0xbef7('0x3'));var fs=require('fs');var path=require(_0xbef7('0x4'));var rimraf=require(_0xbef7('0x5'));var config=require('../../config/environment');var attributes=require(_0xbef7('0x6'));module[_0xbef7('0x7')]=function(_0xf4bab8,_0x34450b){return _0xf4bab8[_0xbef7('0x8')](_0xbef7('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa581=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa581,0x1a1));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1a58('0x0'));var util=require('util');var logger=require(_0x1a58('0x1'))(_0x1a58('0x2'));var moment=require(_0x1a58('0x3'));var BPromise=require(_0x1a58('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a58('0x5'));var config=require(_0x1a58('0x6'));var attributes=require(_0x1a58('0x7'));module['exports']=function(_0x56a0b6,_0x534e8e){return _0x56a0b6[_0x1a58('0x8')](_0x1a58('0x9'),attributes,{'tableName':_0x1a58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index dc30c4b..7187783 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 _0xd5fd=['request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x2304d9,_0x57b715){var _0x4c59a7=function(_0x2fb3e8){while(--_0x2fb3e8){_0x2304d9['push'](_0x2304d9['shift']());}};_0x4c59a7(++_0x57b715);}(_0xd5fd,0x199));var _0xdd5f=function(_0x3041ce,_0x382f98){_0x3041ce=_0x3041ce-0x0;var _0x68a7f9=_0xd5fd[_0x3041ce];return _0x68a7f9;};'use strict';var _=require(_0xdd5f('0x0'));var util=require(_0xdd5f('0x1'));var moment=require('moment');var BPromise=require(_0xdd5f('0x2'));var rs=require(_0xdd5f('0x3'));var fs=require('fs');var Redis=require(_0xdd5f('0x4'));var db=require(_0xdd5f('0x5'))['db'];var utils=require(_0xdd5f('0x6'));var logger=require(_0xdd5f('0x7'))('rpc');var config=require(_0xdd5f('0x8'));var jayson=require(_0xdd5f('0x9'));var client=jayson['client'][_0xdd5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29997c,_0x50adbb,_0x4891d4){return new BPromise(function(_0x17b56e,_0x95b75d){return client[_0xdd5f('0xb')](_0x29997c,_0x4891d4)['then'](function(_0x2f0954){logger['info'](_0xdd5f('0xc'),_0x50adbb,_0xdd5f('0xd'));logger[_0xdd5f('0xe')](_0xdd5f('0xf'),_0x50adbb,_0xdd5f('0xd'),JSON['stringify'](_0x2f0954));if(_0x2f0954[_0xdd5f('0x10')]){if(_0x2f0954[_0xdd5f('0x10')]['code']===0x1f4){logger[_0xdd5f('0x10')]('CmCompany,\x20%s,\x20%s',_0x50adbb,_0x2f0954[_0xdd5f('0x10')][_0xdd5f('0x11')]);return _0x95b75d(_0x2f0954[_0xdd5f('0x10')][_0xdd5f('0x11')]);}logger[_0xdd5f('0x10')](_0xdd5f('0xc'),_0x50adbb,_0x2f0954['error']['message']);return _0x17b56e(_0x2f0954[_0xdd5f('0x10')]['message']);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x50adbb,'request\x20sent');_0x17b56e(_0x2f0954[_0xdd5f('0x12')][_0xdd5f('0x11')]);}})[_0xdd5f('0x13')](function(_0x10b482){logger[_0xdd5f('0x10')](_0xdd5f('0xc'),_0x50adbb,_0x10b482);_0x95b75d(_0x10b482);});});} \ No newline at end of file +var _0xd56f=['rpc','client','http','request','then','request\x20sent','debug','stringify','error','CmCompany,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x171842,_0x4cf352){var _0x5b5c6a=function(_0x3c2605){while(--_0x3c2605){_0x171842['push'](_0x171842['shift']());}};_0x5b5c6a(++_0x4cf352);}(_0xd56f,0xd2));var _0xfd56=function(_0x8bf471,_0x2e9da0){_0x8bf471=_0x8bf471-0x0;var _0x3d93d7=_0xd56f[_0x8bf471];return _0x3d93d7;};'use strict';var _=require(_0xfd56('0x0'));var util=require(_0xfd56('0x1'));var moment=require(_0xfd56('0x2'));var BPromise=require(_0xfd56('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd56('0x5'));var logger=require('../../config/logger')(_0xfd56('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfd56('0x7')][_0xfd56('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x165f57,_0x56d5d7,_0x5d9334){return new BPromise(function(_0x9d0413,_0x21c5be){return client[_0xfd56('0x9')](_0x165f57,_0x5d9334)[_0xfd56('0xa')](function(_0x4b582b){logger['info']('CmCompany,\x20%s,\x20%s',_0x56d5d7,_0xfd56('0xb'));logger[_0xfd56('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x56d5d7,'request\x20sent',JSON[_0xfd56('0xd')](_0x4b582b));if(_0x4b582b[_0xfd56('0xe')]){if(_0x4b582b[_0xfd56('0xe')]['code']===0x1f4){logger[_0xfd56('0xe')](_0xfd56('0xf'),_0x56d5d7,_0x4b582b[_0xfd56('0xe')][_0xfd56('0x10')]);return _0x21c5be(_0x4b582b[_0xfd56('0xe')][_0xfd56('0x10')]);}logger['error'](_0xfd56('0xf'),_0x56d5d7,_0x4b582b[_0xfd56('0xe')][_0xfd56('0x10')]);return _0x9d0413(_0x4b582b[_0xfd56('0xe')][_0xfd56('0x10')]);}else{logger[_0xfd56('0x11')]('CmCompany,\x20%s,\x20%s',_0x56d5d7,_0xfd56('0xb'));_0x9d0413(_0x4b582b['result'][_0xfd56('0x10')]);}})['catch'](function(_0x3ca7f9){logger[_0xfd56('0xe')]('CmCompany,\x20%s,\x20%s',_0x56d5d7,_0x3ca7f9);_0x21c5be(_0x3ca7f9);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 0c3693a..a4bdf9e 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 _0xcad6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put','update','destroy','exports'];(function(_0x30c3ca,_0xf8fe7f){var _0x317aad=function(_0x4ad4bc){while(--_0x4ad4bc){_0x30c3ca['push'](_0x30c3ca['shift']());}};_0x317aad(++_0xf8fe7f);}(_0xcad6,0xf3));var _0x6cad=function(_0x154f15,_0x40b088){_0x154f15=_0x154f15-0x0;var _0x36a98a=_0xcad6[_0x154f15];return _0x36a98a;};'use strict';var multer=require(_0x6cad('0x0'));var util=require(_0x6cad('0x1'));var path=require(_0x6cad('0x2'));var timeout=require(_0x6cad('0x3'));var express=require(_0x6cad('0x4'));var router=express[_0x6cad('0x5')]();var fs_extra=require(_0x6cad('0x6'));var auth=require(_0x6cad('0x7'));var interaction=require(_0x6cad('0x8'));var config=require(_0x6cad('0x9'));var controller=require(_0x6cad('0xa'));router[_0x6cad('0xb')]('/',auth['isAuthenticated'](),controller[_0x6cad('0xc')]);router['get'](_0x6cad('0xd'),auth[_0x6cad('0xe')](),controller[_0x6cad('0xf')]);router[_0x6cad('0xb')](_0x6cad('0x10'),auth[_0x6cad('0xe')](),controller[_0x6cad('0x11')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x6cad('0x12')]);router[_0x6cad('0x13')]('/',auth[_0x6cad('0xe')](),controller[_0x6cad('0x14')]);router['post'](_0x6cad('0x15'),auth[_0x6cad('0xe')](),controller[_0x6cad('0x16')]);router[_0x6cad('0x17')](_0x6cad('0x10'),auth[_0x6cad('0xe')](),controller[_0x6cad('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6cad('0x19')]);module[_0x6cad('0x1a')]=router; \ No newline at end of file +var _0x0924=['put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts'];(function(_0x2f5366,_0x3c674b){var _0xe25b5c=function(_0x5e2965){while(--_0x5e2965){_0x2f5366['push'](_0x2f5366['shift']());}};_0xe25b5c(++_0x3c674b);}(_0x0924,0xdf));var _0x4092=function(_0x49036e,_0x1eed49){_0x49036e=_0x49036e-0x0;var _0xb21daf=_0x0924[_0x49036e];return _0xb21daf;};'use strict';var multer=require(_0x4092('0x0'));var util=require(_0x4092('0x1'));var path=require(_0x4092('0x2'));var timeout=require(_0x4092('0x3'));var express=require('express');var router=express[_0x4092('0x4')]();var fs_extra=require(_0x4092('0x5'));var auth=require(_0x4092('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4092('0x7'));var controller=require('./cmCompany.controller');router[_0x4092('0x8')]('/',auth[_0x4092('0x9')](),controller[_0x4092('0xa')]);router['get'](_0x4092('0xb'),auth[_0x4092('0x9')](),controller[_0x4092('0xc')]);router[_0x4092('0x8')](_0x4092('0xd'),auth[_0x4092('0x9')](),controller[_0x4092('0xe')]);router[_0x4092('0x8')](_0x4092('0xf'),auth['isAuthenticated'](),controller[_0x4092('0x10')]);router[_0x4092('0x11')]('/',auth[_0x4092('0x9')](),controller['create']);router[_0x4092('0x11')](_0x4092('0xf'),auth[_0x4092('0x9')](),controller[_0x4092('0x12')]);router[_0x4092('0x13')](_0x4092('0xd'),auth[_0x4092('0x9')](),controller['update']);router['delete'](_0x4092('0xd'),auth[_0x4092('0x9')](),controller[_0x4092('0x14')]);module[_0x4092('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 644d456..ca7acef 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 _0x8aac=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5e6fc9,_0x5bee97){var _0x5aa4c2=function(_0x3c09e3){while(--_0x3c09e3){_0x5e6fc9['push'](_0x5e6fc9['shift']());}};_0x5aa4c2(++_0x5bee97);}(_0x8aac,0x1ce));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var Sequelize=require(_0xc8aa('0x0'));module[_0xc8aa('0x1')]={'firstName':{'type':Sequelize[_0xc8aa('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc8aa('0x2')]},'street':{'type':Sequelize[_0xc8aa('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc8aa('0x2')]},'country':{'type':Sequelize[_0xc8aa('0x2')]},'dateOfBirth':{'type':Sequelize[_0xc8aa('0x2')]},'description':{'type':Sequelize[_0xc8aa('0x3')]},'phone':{'type':Sequelize[_0xc8aa('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc8aa('0x2')]},'email':{'type':Sequelize[_0xc8aa('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xc8aa('0x2')]},'twitter':{'type':Sequelize[_0xc8aa('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc8aa('0x2')]},'viber':{'type':Sequelize[_0xc8aa('0x2')]},'line':{'type':Sequelize[_0xc8aa('0x2')]},'wechat':{'type':Sequelize[_0xc8aa('0x2')]},'telegram':{'type':Sequelize[_0xc8aa('0x2')]},'UserId':{'type':Sequelize[_0xc8aa('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc8aa('0x4')](0x2)[_0xc8aa('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xc8aa('0x6')]},'dialTimezone':{'type':Sequelize[_0xc8aa('0x2')]},'utcOffset':{'type':Sequelize[_0xc8aa('0x4')]}}; \ No newline at end of file +var _0xd009=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x4c0276,_0x3ed90){var _0x28ac54=function(_0x552fd9){while(--_0x552fd9){_0x4c0276['push'](_0x4c0276['shift']());}};_0x28ac54(++_0x3ed90);}(_0xd009,0x99));var _0x9d00=function(_0x200edb,_0x50772a){_0x200edb=_0x200edb-0x0;var _0x5d6d4d=_0xd009[_0x200edb];return _0x5d6d4d;};'use strict';var _=require(_0x9d00('0x0'));var Sequelize=require(_0x9d00('0x1'));module[_0x9d00('0x2')]={'firstName':{'type':Sequelize[_0x9d00('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9d00('0x3')]},'city':{'type':Sequelize[_0x9d00('0x3')]},'country':{'type':Sequelize[_0x9d00('0x3')]},'dateOfBirth':{'type':Sequelize[_0x9d00('0x3')]},'description':{'type':Sequelize[_0x9d00('0x4')]},'phone':{'type':Sequelize[_0x9d00('0x3')]},'mobile':{'type':Sequelize[_0x9d00('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9d00('0x3')]},'url':{'type':Sequelize[_0x9d00('0x3')]},'facebook':{'type':Sequelize[_0x9d00('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x9d00('0x3')]},'skype':{'type':Sequelize[_0x9d00('0x3')]},'teams':{'type':Sequelize[_0x9d00('0x3')]},'viber':{'type':Sequelize[_0x9d00('0x3')]},'line':{'type':Sequelize[_0x9d00('0x3')]},'wechat':{'type':Sequelize[_0x9d00('0x3')]},'telegram':{'type':Sequelize[_0x9d00('0x3')]},'UserId':{'type':Sequelize[_0x9d00('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x9d00('0x3')]},'priority':{'type':Sequelize[_0x9d00('0x5')](0x2)[_0x9d00('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9d00('0x7')],'defaultValue':Sequelize[_0x9d00('0x8')]},'dialTimezone':{'type':Sequelize[_0x9d00('0x3')]},'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 a4ef880..4523c4d 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index de836f7..0abf6dd 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b53=['hook','exports','events','../../mysqldb','CmContact','setMaxListeners','update','remove','emit'];(function(_0x7a639,_0x16ffbf){var _0x4a4b80=function(_0x6cbf15){while(--_0x6cbf15){_0x7a639['push'](_0x7a639['shift']());}};_0x4a4b80(++_0x16ffbf);}(_0x0b53,0xad));var _0x30b5=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x0b53[_0x4fc9e6];return _0x551d28;};'use strict';var EventEmitter=require(_0x30b5('0x0'));var CmContact=require(_0x30b5('0x1'))['db'][_0x30b5('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x30b5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x30b5('0x4'),'afterDestroy':_0x30b5('0x5')};function emitEvent(_0x1a6004){return function(_0x571b94,_0xa58549,_0x521776){CmContactEvents['emit'](_0x1a6004+':'+_0x571b94['id'],_0x571b94);CmContactEvents[_0x30b5('0x6')](_0x1a6004,_0x571b94);_0x521776(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x30b5('0x7')](e,emitEvent(event));}}module[_0x30b5('0x8')]=CmContactEvents; \ No newline at end of file +var _0xa048=['update','remove','emit','hook','exports','../../mysqldb','CmContact','save'];(function(_0x511d07,_0x278654){var _0x4cbcd0=function(_0x3585b6){while(--_0x3585b6){_0x511d07['push'](_0x511d07['shift']());}};_0x4cbcd0(++_0x278654);}(_0xa048,0x7d));var _0x8a04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa048[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x8a04('0x0'))['db'][_0x8a04('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8a04('0x2'),'afterUpdate':_0x8a04('0x3'),'afterDestroy':_0x8a04('0x4')};function emitEvent(_0x5d9a13){return function(_0x4dd45c,_0x34cb64,_0x458301){CmContactEvents[_0x8a04('0x5')](_0x5d9a13+':'+_0x4dd45c['id'],_0x4dd45c);CmContactEvents[_0x8a04('0x5')](_0x5d9a13,_0x4dd45c);_0x458301(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x8a04('0x6')](e,emitEvent(event));}}module[_0x8a04('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 5774c3a..d631f0c 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe703=['scheduledat','add','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','CmHopper','utcOffset','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','findAll','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','BlackLists','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','all','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment/shared','./cmContact.attributes','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','models','get','error','cmContact','afterCreate','inspect','format','YYYY-MM-DD\x20HH:mm:ss','VoiceQueue','findOne','isNil','timezones','dialTimezone'];(function(_0x510794,_0x120e85){var _0x3bd818=function(_0x34fab5){while(--_0x34fab5){_0x510794['push'](_0x510794['shift']());}};_0x3bd818(++_0x120e85);}(_0xe703,0x1e5));var _0x3e70=function(_0x5ec4eb,_0x2dc478){_0x5ec4eb=_0x5ec4eb-0x0;var _0x1f3253=_0xe703[_0x5ec4eb];return _0x1f3253;};'use strict';var _=require(_0x3e70('0x0'));var util=require(_0x3e70('0x1'));var logger=require(_0x3e70('0x2'))(_0x3e70('0x3'));var moment=require(_0x3e70('0x4'));var BPromise=require(_0x3e70('0x5'));var rp=require(_0x3e70('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require(_0x3e70('0x7'));var attributes=require(_0x3e70('0x8'));module['exports']=function(_0x5888e4,_0x3f5ced){return _0x5888e4[_0x3e70('0x9')](_0x3e70('0xa'),attributes,{'tableName':_0x3e70('0xb'),'paranoid':!![],'indexes':[{'name':_0x3e70('0xc'),'fields':[_0x3e70('0xc')]},{'name':_0x3e70('0xd'),'fields':[_0x3e70('0xe'),_0x3e70('0xf'),_0x3e70('0xc'),_0x3e70('0x10'),_0x3e70('0x11'),_0x3e70('0x12')],'type':_0x3e70('0x13')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x1cf302,_0x5947ac,_0x58ad60){var _0x51dd5e=_0x5888e4[_0x3e70('0x14')];var _0x299fc3=_0x1cf302[_0x3e70('0x15')]({'plain':!![]});function _0x30fed2(){return function(_0x2a49f0){logger[_0x3e70('0x16')](_0x3e70('0x17'),_0x3e70('0x18'),util[_0x3e70('0x19')](_0x2a49f0,{'showHidden':![],'depth':null}));};}function _0x356d2b(_0x28d462,_0x37b3d2){var _0x47600f=_0x37b3d2['scheduledat']?_0x37b3d2['scheduledat']:moment()[_0x3e70('0x1a')](_0x3e70('0x1b'));return new BPromise(function(_0x1cb08f,_0xa663ce){if(_['isNil'](_0x37b3d2['dialTimezone'])){_0x1cb08f({'ret':_0x47600f});}else{_0x51dd5e[_0x3e70('0x1c')][_0x3e70('0x1d')]({'where':{'id':_0x28d462['id']}})['then'](function(_0x23c7e9){if(!_[_0x3e70('0x1e')](_0x23c7e9)){var _0x3677e2=_0x23c7e9['dialTimezone'];if(!_[_0x3e70('0x1e')](_0x3677e2)){var _0x4d7a41=shared[_0x3e70('0x1f')];var _0x3558dd=_0x4d7a41[_0x3677e2];var _0x2122dd=_0x4d7a41[_0x37b3d2[_0x3e70('0x20')]];if(!_[_0x3e70('0x1e')](_0x3558dd)&&!_[_0x3e70('0x1e')](_0x2122dd)){var _0x1f311f=_0x3558dd['utcOffset']-_0x2122dd['utcOffset'];_0x47600f=_0x37b3d2['scheduledat']?_0x37b3d2[_0x3e70('0x21')]:moment();var _0xd834a7=moment(_0x47600f)[_0x3e70('0x22')](_0x1f311f,_0x3e70('0x23'));_0x1cb08f({'ret':_0xd834a7['format'](_0x3e70('0x1b'))});}else _0x1cb08f({'ret':_0x47600f});}else _0x1cb08f({'ret':_0x47600f});}else{_0x1cb08f({'ret':_0x47600f});}});}});return 0xa;}var _0x11f902=function(_0x299bea){return new BPromise(function(_0xdb7672,_0x589fee){_0x356d2b(_0x299bea,_0x299fc3)['then'](function(_0x261dd7){_0x299fc3[_0x3e70('0x21')]=_0x261dd7[_0x3e70('0x24')];_0x51dd5e['CmHopper'][_0x3e70('0x1d')]({'where':{'phone':_0x299fc3[_0x3e70('0xc')],'VoiceQueueId':_0x299bea['id']}})['then'](function(_0x47e029){if(!_[_0x3e70('0x1e')](_0x47e029)){throw new Error(_0x3e70('0x25')+_0x299fc3[_0x3e70('0xc')]+_0x3e70('0x26')+_0x299bea['id']);}return _0x51dd5e['CmHopper'][_0x3e70('0x27')]({'phone':_0x299fc3[_0x3e70('0xc')],'ContactId':_0x299fc3['id'],'ListId':_0x299fc3[_0x3e70('0x28')],'priority':_0x299fc3[_0x3e70('0x29')]?_0x299fc3[_0x3e70('0x29')]:0x2,'scheduledat':_0x299fc3[_0x3e70('0x21')]?_0x299fc3[_0x3e70('0x21')]:moment()[_0x3e70('0x1a')](_0x3e70('0x1b')),'callback':_0x299fc3[_0x3e70('0x2a')]?!![]:![],'callbackuniqueid':_0x299fc3[_0x3e70('0x2a')]?_0x299fc3['callbackUniqueid']:undefined,'callbackat':_0x299fc3[_0x3e70('0x2a')]?moment()[_0x3e70('0x1a')](_0x3e70('0x1b')):undefined,'VoiceQueueId':_0x299bea['id']});})[_0x3e70('0x2b')](function(_0x6125f9){_0x589fee(_0x6125f9);});});});};var _0x3ea460=function(_0xf858bd){return new BPromise(function(_0x5d2ba9,_0x4062de){_0x356d2b(_0xf858bd,_0x299fc3)[_0x3e70('0x2c')](function(_0x208f27){_0x299fc3['scheduledat']=_0x208f27[_0x3e70('0x24')];_0x51dd5e['CmHopper'][_0x3e70('0x1d')]({'where':{'phone':_0x299fc3[_0x3e70('0xc')],'VoiceQueueId':_0xf858bd['id']}})['then'](function(_0x5908dc){if(!_[_0x3e70('0x1e')](_0x5908dc)){throw new Error(_0x3e70('0x25')+_0x299fc3[_0x3e70('0xc')]+_0x3e70('0x2d')+_0xf858bd['id']);}return _0x51dd5e['CmHopperFinal'][_0x3e70('0x1d')]({'where':{'calleridnum':_0x299fc3[_0x3e70('0xc')],'VoiceQueueId':_0xf858bd['id']}});})[_0x3e70('0x2c')](function(_0x5bbaec){if(!_[_0x3e70('0x1e')](_0x5bbaec)){throw new Error(_0x3e70('0x2e')+_0x299fc3[_0x3e70('0xc')]+_0x3e70('0x2f')+_0xf858bd['id']);}return _0x51dd5e[_0x3e70('0x30')][_0x3e70('0x27')]({'phone':_0x299fc3[_0x3e70('0xc')],'ContactId':_0x299fc3['id'],'ListId':_0x299fc3[_0x3e70('0x28')],'priority':_0x299fc3[_0x3e70('0x29')]?_0x299fc3[_0x3e70('0x29')]:0x2,'scheduledat':_0x299fc3[_0x3e70('0x21')]?_0x299fc3['scheduledat']:moment()[_0x3e70('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x299fc3[_0x3e70('0x2a')]?!![]:![],'callbackuniqueid':_0x299fc3[_0x3e70('0x2a')]?_0x299fc3[_0x3e70('0x2a')]:undefined,'callbackat':_0x299fc3[_0x3e70('0x2a')]?moment()[_0x3e70('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0xf858bd['id']});})[_0x3e70('0x2b')](function(_0x4d87a7){_0x4062de(_0x4d87a7);});});});};function _0x2f1ba3(){return function(_0x3b24e8){logger[_0x3e70('0x16')](_0x3e70('0x17'),_0x3e70('0x18'),util['inspect'](_0x3b24e8,{'showHidden':![],'depth':null}));};}function _0xb67259(_0x1ad71b,_0x1ec8c6){var _0x9ca542=_0x1ec8c6[_0x3e70('0x21')]?_0x1ec8c6[_0x3e70('0x21')]:moment()[_0x3e70('0x1a')](_0x3e70('0x1b'));return new BPromise(function(_0x519147,_0x35b185){if(_[_0x3e70('0x1e')](_0x1ec8c6[_0x3e70('0x20')])){_0x519147({'ret':_0x9ca542});}else{_0x51dd5e['Campaign']['findOne']({'where':{'id':_0x1ad71b['id']}})[_0x3e70('0x2c')](function(_0x47d94a){if(!_[_0x3e70('0x1e')](_0x47d94a)){var _0x19f4ef=_0x47d94a['dialTimezone'];if(!_[_0x3e70('0x1e')](_0x19f4ef)){var _0x218c32=shared[_0x3e70('0x1f')];var _0x44a3a1=_0x218c32[_0x19f4ef];var _0x5554e5=_0x218c32[_0x1ec8c6[_0x3e70('0x20')]];if(!_[_0x3e70('0x1e')](_0x44a3a1)&&!_[_0x3e70('0x1e')](_0x5554e5)){var _0x4b595b=_0x44a3a1['utcOffset']-_0x5554e5[_0x3e70('0x31')];_0x9ca542=_0x1ec8c6['scheduledat']?_0x1ec8c6[_0x3e70('0x21')]:moment();var _0x430de3=moment(_0x9ca542)[_0x3e70('0x22')](_0x4b595b,_0x3e70('0x23'));_0x519147({'ret':_0x430de3[_0x3e70('0x1a')](_0x3e70('0x1b'))});}else _0x519147({'ret':_0x9ca542});}else _0x519147({'ret':_0x9ca542});}else{_0x519147({'ret':_0x9ca542});}});}});return 0xa;}var _0x95492d=function(_0x5dd018){return new BPromise(function(_0x5a5478,_0x317ac1){_0xb67259(_0x5dd018,_0x299fc3)['then'](function(_0x1374c7){_0x299fc3[_0x3e70('0x21')]=_0x1374c7[_0x3e70('0x24')];_0x51dd5e[_0x3e70('0x30')][_0x3e70('0x1d')]({'where':{'phone':_0x299fc3[_0x3e70('0xc')],'CampaignId':_0x5dd018['id']}})[_0x3e70('0x2c')](function(_0x25a495){if(!_[_0x3e70('0x1e')](_0x25a495)){throw new Error(_0x3e70('0x25')+_0x299fc3['phone']+_0x3e70('0x32')+_0x5dd018['id']);}return _0x51dd5e[_0x3e70('0x30')]['create']({'phone':_0x299fc3['phone'],'ContactId':_0x299fc3['id'],'ListId':_0x299fc3[_0x3e70('0x28')],'priority':_0x299fc3[_0x3e70('0x29')]?_0x299fc3[_0x3e70('0x29')]:0x2,'scheduledat':_0x299fc3[_0x3e70('0x21')]?_0x299fc3['scheduledat']:moment()[_0x3e70('0x1a')](_0x3e70('0x1b')),'callback':_0x299fc3[_0x3e70('0x2a')]?!![]:![],'callbackuniqueid':_0x299fc3['callbackUniqueid']?_0x299fc3[_0x3e70('0x2a')]:undefined,'callbackat':_0x299fc3[_0x3e70('0x2a')]?moment()[_0x3e70('0x1a')](_0x3e70('0x1b')):undefined,'CampaignId':_0x5dd018['id']});})[_0x3e70('0x2b')](function(_0x139555){_0x317ac1(_0x139555);});});});};var _0x36319d=function(_0x55041f){return new BPromise(function(_0x43adb4,_0x1fe58f){_0xb67259(_0x55041f,_0x299fc3)[_0x3e70('0x2c')](function(_0x47e017){_0x299fc3[_0x3e70('0x21')]=_0x47e017[_0x3e70('0x24')];_0x51dd5e['CmHopper'][_0x3e70('0x1d')]({'where':{'phone':_0x299fc3[_0x3e70('0xc')],'CampaignId':_0x55041f['id']}})[_0x3e70('0x2c')](function(_0x387ccb){if(!_[_0x3e70('0x1e')](_0x387ccb)){throw new Error(_0x3e70('0x25')+_0x299fc3[_0x3e70('0xc')]+_0x3e70('0x33')+_0x55041f['id']);}return _0x51dd5e[_0x3e70('0x34')]['findOne']({'where':{'calleridnum':_0x299fc3[_0x3e70('0xc')],'CampaignId':_0x55041f['id']}});})[_0x3e70('0x2c')](function(_0x5cb04f){if(!_['isNil'](_0x5cb04f)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x299fc3[_0x3e70('0xc')]+_0x3e70('0x35')+_0x55041f['id']);}return _0x51dd5e['CmHopper'][_0x3e70('0x27')]({'phone':_0x299fc3['phone'],'ContactId':_0x299fc3['id'],'ListId':_0x299fc3[_0x3e70('0x28')],'priority':_0x299fc3[_0x3e70('0x29')]?_0x299fc3[_0x3e70('0x29')]:0x2,'scheduledat':_0x299fc3[_0x3e70('0x21')]?_0x299fc3[_0x3e70('0x21')]:moment()[_0x3e70('0x1a')](_0x3e70('0x1b')),'callback':_0x299fc3[_0x3e70('0x2a')]?!![]:![],'callbackuniqueid':_0x299fc3['callbackUniqueid']?_0x299fc3[_0x3e70('0x2a')]:undefined,'callbackat':_0x299fc3[_0x3e70('0x2a')]?moment()[_0x3e70('0x1a')](_0x3e70('0x1b')):undefined,'CampaignId':_0x55041f['id']});})[_0x3e70('0x2b')](function(_0x1953e1){_0x1fe58f(_0x1953e1);});});});};if(_0x299fc3[_0x3e70('0x28')]){_0x51dd5e[_0x3e70('0x1c')]['findAll']({'where':{'type':_0x3e70('0x36')},'attributes':['id',_0x3e70('0x37'),'dialTimezone'],'include':[{'model':_0x51dd5e[_0x3e70('0x38')],'as':_0x3e70('0x39'),'where':{'id':_0x299fc3['ListId']}}]})[_0x3e70('0x2c')](function(_0x240efa){if(_0x240efa){var _0x30162f=[];for(var _0x428c73=0x0,_0x5d6209;_0x428c73<_0x240efa[_0x3e70('0x3a')];_0x428c73+=0x1){_0x5d6209=_0x240efa[_0x428c73][_0x3e70('0x15')]({'plain':!![]});switch(_0x5d6209[_0x3e70('0x37')]){case _0x3e70('0x3b'):_0x3ea460(_0x5d6209)[_0x3e70('0x2b')](_0x30fed2());break;case _0x3e70('0x3c'):_0x11f902(_0x5d6209)['catch'](_0x30fed2());break;default:_0xb67259(_0x5d6209,_0x299fc3)['then'](function(_0x363170){_0x299fc3[_0x3e70('0x21')]=_0x363170['ret'];_0x51dd5e['CmHopper'][_0x3e70('0x27')]({'phone':_0x299fc3[_0x3e70('0xc')],'ContactId':_0x299fc3['id'],'ListId':_0x299fc3[_0x3e70('0x28')],'scheduledat':_0x299fc3['scheduledat']?_0x299fc3['scheduledat']:moment()[_0x3e70('0x1a')](_0x3e70('0x1b')),'priority':_0x299fc3[_0x3e70('0x29')]?_0x299fc3[_0x3e70('0x29')]:0x2,'callback':_0x299fc3[_0x3e70('0x2a')]?!![]:![],'callbackuniqueid':_0x299fc3[_0x3e70('0x2a')]?_0x299fc3[_0x3e70('0x2a')]:undefined,'callbackat':_0x299fc3[_0x3e70('0x2a')]?moment()[_0x3e70('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x5d6209['id']})['catch'](_0x30fed2());});}}}})[_0x3e70('0x2c')](function(){return _0x51dd5e['VoiceQueue'][_0x3e70('0x3d')]({'where':{'type':_0x3e70('0x36')},'attributes':['id'],'include':[{'model':_0x51dd5e[_0x3e70('0x38')],'as':'BlackLists','where':{'id':_0x299fc3[_0x3e70('0x28')]}}]})[_0x3e70('0x2c')](function(_0x4cd132){if(_0x4cd132){var _0x297c69=[];for(var _0xf38e94=0x0,_0x374d53;_0xf38e94<_0x4cd132[_0x3e70('0x3a')];_0xf38e94+=0x1){_0x374d53=_0x4cd132[_0xf38e94][_0x3e70('0x15')]({'plain':!![]});_0x51dd5e[_0x3e70('0x3e')][_0x3e70('0x27')]({'phone':_0x299fc3[_0x3e70('0xc')],'ContactId':_0x299fc3['id'],'ListId':_0x299fc3[_0x3e70('0x28')],'VoiceQueueId':_0x374d53['id']})[_0x3e70('0x2b')](function(_0x1d3656){logger[_0x3e70('0x16')](_0x3e70('0x3f'),_0x3e70('0x18'),_0x1d3656[_0x3e70('0x40')]);});}}});})[_0x3e70('0x2c')](function(){return _0x51dd5e[_0x3e70('0x41')]['findAll']({'attributes':['id',_0x3e70('0x37'),_0x3e70('0x20')],'include':[{'model':_0x51dd5e['CmList'],'as':_0x3e70('0x39'),'where':{'id':_0x299fc3[_0x3e70('0x28')]}}]})[_0x3e70('0x2c')](function(_0x4d5ebe){if(_0x4d5ebe){var _0x4fa92e=[];for(var _0x40aea3=0x0,_0x22f191;_0x40aea3<_0x4d5ebe['length'];_0x40aea3+=0x1){_0x22f191=_0x4d5ebe[_0x40aea3][_0x3e70('0x15')]({'plain':!![]});switch(_0x22f191['dialCheckDuplicateType']){case'always':_0x36319d(_0x22f191)['catch'](_0x2f1ba3());break;case'onlyIfOpen':_0x95492d(_0x22f191)[_0x3e70('0x2b')](_0x2f1ba3());break;default:_0x51dd5e['CmHopper']['create']({'phone':_0x299fc3[_0x3e70('0xc')],'ContactId':_0x299fc3['id'],'ListId':_0x299fc3[_0x3e70('0x28')],'scheduledat':_0x299fc3[_0x3e70('0x21')]?_0x299fc3[_0x3e70('0x21')]:moment()[_0x3e70('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x299fc3[_0x3e70('0x29')]?_0x299fc3[_0x3e70('0x29')]:0x2,'callback':_0x299fc3[_0x3e70('0x2a')]?!![]:![],'callbackuniqueid':_0x299fc3[_0x3e70('0x2a')]?_0x299fc3[_0x3e70('0x2a')]:undefined,'callbackat':_0x299fc3[_0x3e70('0x2a')]?moment()['format'](_0x3e70('0x1b')):undefined,'CampaignId':_0x22f191['id']})[_0x3e70('0x2b')](_0x2f1ba3());}}}});})[_0x3e70('0x2c')](function(){return _0x51dd5e[_0x3e70('0x41')][_0x3e70('0x3d')]({'attributes':['id'],'include':[{'model':_0x51dd5e[_0x3e70('0x38')],'as':_0x3e70('0x42'),'where':{'id':_0x299fc3[_0x3e70('0x28')]}}]})[_0x3e70('0x2c')](function(_0x58ecc7){if(_0x58ecc7){var _0x2e5440=[];for(var _0x10ba17=0x0,_0x2b2854;_0x10ba17<_0x58ecc7[_0x3e70('0x3a')];_0x10ba17+=0x1){_0x2b2854=_0x58ecc7[_0x10ba17][_0x3e70('0x15')]({'plain':!![]});_0x51dd5e[_0x3e70('0x3e')][_0x3e70('0x27')]({'phone':_0x299fc3[_0x3e70('0xc')],'ContactId':_0x299fc3['id'],'ListId':_0x299fc3[_0x3e70('0x28')],'CampaignId':_0x2b2854['id']})[_0x3e70('0x2b')](function(_0x2aa26a){logger[_0x3e70('0x16')]('cmContact,\x20%s,\x20%s',_0x3e70('0x18'),_0x2aa26a[_0x3e70('0x40')]);});}}});})['then'](function(){_0x58ad60();})[_0x3e70('0x2b')](function(_0x2ffc8d){logger[_0x3e70('0x16')]('cmContact,\x20%s,\x20%s',_0x3e70('0x18'),_0x2ffc8d[_0x3e70('0x40')]);_0x58ad60(_0x2ffc8d);});}else{_0x58ad60(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x4349ab,_0xf688fd,_0x2c8299){var _0x44747c=_0x5888e4['models'];var _0x4bd50d=_0x4349ab[_0x3e70('0x15')]({'plain':!![]});return _0x44747c[_0x3e70('0x30')][_0x3e70('0x3d')]({'raw':!![],'where':{'ListId':_0x4bd50d[_0x3e70('0x28')],'ContactId':_0x4bd50d['id']}})['then'](function(_0x4b7957){if(!_[_0x3e70('0x43')](_0x4b7957)){var _0x396b04=[];for(var _0x21bc88=0x0;_0x21bc88<_0x4b7957[_0x3e70('0x3a')];_0x21bc88+=0x1){var _0x9743bd=_0x44747c['CmHopper'][_0x3e70('0x44')]({'where':{'ListId':_0x4b7957[_0x21bc88][_0x3e70('0x28')],'ContactId':_0x4b7957[_0x21bc88][_0x3e70('0x45')],'VoiceQueueId':_0x4b7957[_0x21bc88][_0x3e70('0x46')],'CampaignId':_0x4b7957[_0x21bc88][_0x3e70('0x47')]}});_0x396b04['push'](_0x9743bd);}return BPromise[_0x3e70('0x48')](_0x396b04);}})['then'](function(_0x18e1c6){logger['info']('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x18e1c6,{'showHidden':![],'depth':null}));_0x2c8299();})[_0x3e70('0x2b')](function(_0x4edd94){logger['error'](_0x3e70('0x49'),util[_0x3e70('0x19')](_0x4edd94,{'showHidden':![],'depth':null}));_0x2c8299(_0x4edd94);});}}});}; \ No newline at end of file +var _0x3455=['destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','FULLTEXT','utf8mb4','models','get','error','cmContact','afterCreate','inspect','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','scheduledat','add','minutes','ret','CmHopper','create','ListId','priority','callbackUniqueid','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','cmContact,\x20%s,\x20%s','onlyIfOpen','BlackLists','CmHopperBlack','message','List\x20not\x20found','isEmpty'];(function(_0x4707df,_0x1bcfd9){var _0x26d8cb=function(_0x5de95c){while(--_0x5de95c){_0x4707df['push'](_0x4707df['shift']());}};_0x26d8cb(++_0x1bcfd9);}(_0x3455,0xe6));var _0x5345=function(_0x504f7b,_0x1ac4e0){_0x504f7b=_0x504f7b-0x0;var _0x2b0904=_0x3455[_0x504f7b];return _0x2b0904;};'use strict';var _=require(_0x5345('0x0'));var util=require('util');var logger=require(_0x5345('0x1'))(_0x5345('0x2'));var moment=require(_0x5345('0x3'));var BPromise=require(_0x5345('0x4'));var rp=require(_0x5345('0x5'));var fs=require('fs');var path=require(_0x5345('0x6'));var rimraf=require(_0x5345('0x7'));var config=require(_0x5345('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0x5345('0x9'));module[_0x5345('0xa')]=function(_0x3c9161,_0x4a7eba){return _0x3c9161[_0x5345('0xb')](_0x5345('0xc'),attributes,{'tableName':_0x5345('0xd'),'paranoid':!![],'indexes':[{'name':_0x5345('0xe'),'fields':[_0x5345('0xe')]},{'name':'fti_cm_contacts','fields':[_0x5345('0xf'),_0x5345('0x10'),_0x5345('0xe'),_0x5345('0x11'),'fax','email'],'type':_0x5345('0x12')}],'timestamps':!![],'charset':_0x5345('0x13'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0xbc6c4f,_0x5f4a4a,_0x9af5ec){var _0x2b6e00=_0x3c9161[_0x5345('0x14')];var _0x562954=_0xbc6c4f[_0x5345('0x15')]({'plain':!![]});function _0x50c9fd(){return function(_0x39763b){logger[_0x5345('0x16')](_0x5345('0x17'),_0x5345('0x18'),util[_0x5345('0x19')](_0x39763b,{'showHidden':![],'depth':null}));};}function _0x65e487(_0x545f15,_0x3537c0){var _0x191120=_0x3537c0['scheduledat']?_0x3537c0['scheduledat']:moment()[_0x5345('0x1a')](_0x5345('0x1b'));return new BPromise(function(_0x539404,_0x848686){if(_[_0x5345('0x1c')](_0x3537c0[_0x5345('0x1d')])){_0x539404({'ret':_0x191120});}else{_0x2b6e00[_0x5345('0x1e')][_0x5345('0x1f')]({'where':{'id':_0x545f15['id']}})[_0x5345('0x20')](function(_0x214780){if(!_['isNil'](_0x214780)){var _0x585d12=_0x214780[_0x5345('0x1d')];if(!_[_0x5345('0x1c')](_0x585d12)){var _0x1a8317=shared[_0x5345('0x21')];var _0x3875b5=_0x1a8317[_0x585d12];var _0x4e6c28=_0x1a8317[_0x3537c0[_0x5345('0x1d')]];if(!_['isNil'](_0x3875b5)&&!_[_0x5345('0x1c')](_0x4e6c28)){var _0x156d43=_0x3875b5['utcOffset']-_0x4e6c28[_0x5345('0x22')];_0x191120=_0x3537c0[_0x5345('0x23')]?_0x3537c0['scheduledat']:moment();var _0x4d232f=moment(_0x191120)[_0x5345('0x24')](_0x156d43,_0x5345('0x25'));_0x539404({'ret':_0x4d232f[_0x5345('0x1a')](_0x5345('0x1b'))});}else _0x539404({'ret':_0x191120});}else _0x539404({'ret':_0x191120});}else{_0x539404({'ret':_0x191120});}});}});return 0xa;}var _0x1f2383=function(_0x881445){return new BPromise(function(_0x3697f3,_0x51b642){_0x65e487(_0x881445,_0x562954)[_0x5345('0x20')](function(_0x483680){_0x562954[_0x5345('0x23')]=_0x483680[_0x5345('0x26')];_0x2b6e00['CmHopper'][_0x5345('0x1f')]({'where':{'phone':_0x562954[_0x5345('0xe')],'VoiceQueueId':_0x881445['id']}})[_0x5345('0x20')](function(_0x24f783){if(!_[_0x5345('0x1c')](_0x24f783)){throw new Error('cmContact,\x20afterCreate\x20'+_0x562954['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x881445['id']);}return _0x2b6e00[_0x5345('0x27')][_0x5345('0x28')]({'phone':_0x562954[_0x5345('0xe')],'ContactId':_0x562954['id'],'ListId':_0x562954[_0x5345('0x29')],'priority':_0x562954['priority']?_0x562954[_0x5345('0x2a')]:0x2,'scheduledat':_0x562954[_0x5345('0x23')]?_0x562954['scheduledat']:moment()[_0x5345('0x1a')](_0x5345('0x1b')),'callback':_0x562954[_0x5345('0x2b')]?!![]:![],'callbackuniqueid':_0x562954[_0x5345('0x2b')]?_0x562954['callbackUniqueid']:undefined,'callbackat':_0x562954[_0x5345('0x2b')]?moment()[_0x5345('0x1a')](_0x5345('0x1b')):undefined,'VoiceQueueId':_0x881445['id']});})['catch'](function(_0x3e08f7){_0x51b642(_0x3e08f7);});});});};var _0x23c5ac=function(_0xf7f0a6){return new BPromise(function(_0x150bab,_0x5a8325){_0x65e487(_0xf7f0a6,_0x562954)[_0x5345('0x20')](function(_0x300a2d){_0x562954[_0x5345('0x23')]=_0x300a2d[_0x5345('0x26')];_0x2b6e00[_0x5345('0x27')][_0x5345('0x1f')]({'where':{'phone':_0x562954[_0x5345('0xe')],'VoiceQueueId':_0xf7f0a6['id']}})[_0x5345('0x20')](function(_0x176cc0){if(!_['isNil'](_0x176cc0)){throw new Error(_0x5345('0x2c')+_0x562954['phone']+_0x5345('0x2d')+_0xf7f0a6['id']);}return _0x2b6e00[_0x5345('0x2e')][_0x5345('0x1f')]({'where':{'calleridnum':_0x562954[_0x5345('0xe')],'VoiceQueueId':_0xf7f0a6['id']}});})['then'](function(_0x480c8f){if(!_[_0x5345('0x1c')](_0x480c8f)){throw new Error(_0x5345('0x2f')+_0x562954[_0x5345('0xe')]+_0x5345('0x30')+_0xf7f0a6['id']);}return _0x2b6e00[_0x5345('0x27')][_0x5345('0x28')]({'phone':_0x562954[_0x5345('0xe')],'ContactId':_0x562954['id'],'ListId':_0x562954[_0x5345('0x29')],'priority':_0x562954[_0x5345('0x2a')]?_0x562954[_0x5345('0x2a')]:0x2,'scheduledat':_0x562954[_0x5345('0x23')]?_0x562954[_0x5345('0x23')]:moment()['format'](_0x5345('0x1b')),'callback':_0x562954[_0x5345('0x2b')]?!![]:![],'callbackuniqueid':_0x562954[_0x5345('0x2b')]?_0x562954[_0x5345('0x2b')]:undefined,'callbackat':_0x562954[_0x5345('0x2b')]?moment()[_0x5345('0x1a')](_0x5345('0x1b')):undefined,'VoiceQueueId':_0xf7f0a6['id']});})[_0x5345('0x31')](function(_0x44e4e1){_0x5a8325(_0x44e4e1);});});});};function _0x23070a(){return function(_0x53381e){logger[_0x5345('0x16')]('cmContact',_0x5345('0x18'),util[_0x5345('0x19')](_0x53381e,{'showHidden':![],'depth':null}));};}function _0x571a5b(_0x46f5f4,_0x3db13e){var _0x33674c=_0x3db13e[_0x5345('0x23')]?_0x3db13e['scheduledat']:moment()['format'](_0x5345('0x1b'));return new BPromise(function(_0x835a3a,_0x307eb3){if(_[_0x5345('0x1c')](_0x3db13e[_0x5345('0x1d')])){_0x835a3a({'ret':_0x33674c});}else{_0x2b6e00[_0x5345('0x32')]['findOne']({'where':{'id':_0x46f5f4['id']}})[_0x5345('0x20')](function(_0x45e958){if(!_['isNil'](_0x45e958)){var _0x8881dc=_0x45e958[_0x5345('0x1d')];if(!_[_0x5345('0x1c')](_0x8881dc)){var _0x4ae6af=shared[_0x5345('0x21')];var _0x33212c=_0x4ae6af[_0x8881dc];var _0x2ec55c=_0x4ae6af[_0x3db13e[_0x5345('0x1d')]];if(!_['isNil'](_0x33212c)&&!_['isNil'](_0x2ec55c)){var _0x4a6c41=_0x33212c[_0x5345('0x22')]-_0x2ec55c[_0x5345('0x22')];_0x33674c=_0x3db13e[_0x5345('0x23')]?_0x3db13e[_0x5345('0x23')]:moment();var _0x2adc4e=moment(_0x33674c)['add'](_0x4a6c41,_0x5345('0x25'));_0x835a3a({'ret':_0x2adc4e['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x835a3a({'ret':_0x33674c});}else _0x835a3a({'ret':_0x33674c});}else{_0x835a3a({'ret':_0x33674c});}});}});return 0xa;}var _0x125b05=function(_0x215a9f){return new BPromise(function(_0x4f917d,_0x309763){_0x571a5b(_0x215a9f,_0x562954)[_0x5345('0x20')](function(_0x1a07f0){_0x562954['scheduledat']=_0x1a07f0[_0x5345('0x26')];_0x2b6e00[_0x5345('0x27')]['findOne']({'where':{'phone':_0x562954[_0x5345('0xe')],'CampaignId':_0x215a9f['id']}})[_0x5345('0x20')](function(_0x449331){if(!_[_0x5345('0x1c')](_0x449331)){throw new Error(_0x5345('0x2c')+_0x562954[_0x5345('0xe')]+_0x5345('0x33')+_0x215a9f['id']);}return _0x2b6e00[_0x5345('0x27')]['create']({'phone':_0x562954[_0x5345('0xe')],'ContactId':_0x562954['id'],'ListId':_0x562954['ListId'],'priority':_0x562954[_0x5345('0x2a')]?_0x562954['priority']:0x2,'scheduledat':_0x562954[_0x5345('0x23')]?_0x562954[_0x5345('0x23')]:moment()['format'](_0x5345('0x1b')),'callback':_0x562954[_0x5345('0x2b')]?!![]:![],'callbackuniqueid':_0x562954[_0x5345('0x2b')]?_0x562954[_0x5345('0x2b')]:undefined,'callbackat':_0x562954[_0x5345('0x2b')]?moment()['format'](_0x5345('0x1b')):undefined,'CampaignId':_0x215a9f['id']});})[_0x5345('0x31')](function(_0x1c8692){_0x309763(_0x1c8692);});});});};var _0x711d32=function(_0x34b070){return new BPromise(function(_0x5c383d,_0x36d405){_0x571a5b(_0x34b070,_0x562954)[_0x5345('0x20')](function(_0x49f069){_0x562954[_0x5345('0x23')]=_0x49f069[_0x5345('0x26')];_0x2b6e00[_0x5345('0x27')][_0x5345('0x1f')]({'where':{'phone':_0x562954[_0x5345('0xe')],'CampaignId':_0x34b070['id']}})[_0x5345('0x20')](function(_0x4726e4){if(!_[_0x5345('0x1c')](_0x4726e4)){throw new Error('cmContact,\x20afterCreate\x20'+_0x562954[_0x5345('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x34b070['id']);}return _0x2b6e00['CmHopperFinal'][_0x5345('0x1f')]({'where':{'calleridnum':_0x562954[_0x5345('0xe')],'CampaignId':_0x34b070['id']}});})[_0x5345('0x20')](function(_0x27db0f){if(!_['isNil'](_0x27db0f)){throw new Error(_0x5345('0x2f')+_0x562954['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x34b070['id']);}return _0x2b6e00['CmHopper'][_0x5345('0x28')]({'phone':_0x562954[_0x5345('0xe')],'ContactId':_0x562954['id'],'ListId':_0x562954['ListId'],'priority':_0x562954[_0x5345('0x2a')]?_0x562954['priority']:0x2,'scheduledat':_0x562954[_0x5345('0x23')]?_0x562954[_0x5345('0x23')]:moment()[_0x5345('0x1a')](_0x5345('0x1b')),'callback':_0x562954[_0x5345('0x2b')]?!![]:![],'callbackuniqueid':_0x562954['callbackUniqueid']?_0x562954[_0x5345('0x2b')]:undefined,'callbackat':_0x562954['callbackUniqueid']?moment()[_0x5345('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x34b070['id']});})['catch'](function(_0x4281af){_0x36d405(_0x4281af);});});});};if(_0x562954[_0x5345('0x29')]){_0x2b6e00[_0x5345('0x1e')][_0x5345('0x34')]({'where':{'type':_0x5345('0x35')},'attributes':['id',_0x5345('0x36'),'dialTimezone'],'include':[{'model':_0x2b6e00[_0x5345('0x37')],'as':_0x5345('0x38'),'where':{'id':_0x562954[_0x5345('0x29')]}}]})['then'](function(_0x39b30d){if(_0x39b30d){var _0x3633ec=[];for(var _0x411fd2=0x0,_0x4444c4;_0x411fd2<_0x39b30d[_0x5345('0x39')];_0x411fd2+=0x1){_0x4444c4=_0x39b30d[_0x411fd2][_0x5345('0x15')]({'plain':!![]});switch(_0x4444c4[_0x5345('0x36')]){case _0x5345('0x3a'):_0x23c5ac(_0x4444c4)['catch'](_0x50c9fd());break;case'onlyIfOpen':_0x1f2383(_0x4444c4)[_0x5345('0x31')](_0x50c9fd());break;default:_0x571a5b(_0x4444c4,_0x562954)['then'](function(_0xe6fc74){_0x562954['scheduledat']=_0xe6fc74[_0x5345('0x26')];_0x2b6e00['CmHopper'][_0x5345('0x28')]({'phone':_0x562954[_0x5345('0xe')],'ContactId':_0x562954['id'],'ListId':_0x562954['ListId'],'scheduledat':_0x562954[_0x5345('0x23')]?_0x562954['scheduledat']:moment()[_0x5345('0x1a')](_0x5345('0x1b')),'priority':_0x562954[_0x5345('0x2a')]?_0x562954[_0x5345('0x2a')]:0x2,'callback':_0x562954['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x562954[_0x5345('0x2b')]?_0x562954[_0x5345('0x2b')]:undefined,'callbackat':_0x562954[_0x5345('0x2b')]?moment()[_0x5345('0x1a')](_0x5345('0x1b')):undefined,'VoiceQueueId':_0x4444c4['id']})[_0x5345('0x31')](_0x50c9fd());});}}}})[_0x5345('0x20')](function(){return _0x2b6e00['VoiceQueue'][_0x5345('0x34')]({'where':{'type':_0x5345('0x35')},'attributes':['id'],'include':[{'model':_0x2b6e00[_0x5345('0x37')],'as':'BlackLists','where':{'id':_0x562954[_0x5345('0x29')]}}]})[_0x5345('0x20')](function(_0x1d3f9f){if(_0x1d3f9f){var _0x25fc35=[];for(var _0x378435=0x0,_0x22b746;_0x378435<_0x1d3f9f[_0x5345('0x39')];_0x378435+=0x1){_0x22b746=_0x1d3f9f[_0x378435][_0x5345('0x15')]({'plain':!![]});_0x2b6e00['CmHopperBlack'][_0x5345('0x28')]({'phone':_0x562954[_0x5345('0xe')],'ContactId':_0x562954['id'],'ListId':_0x562954['ListId'],'VoiceQueueId':_0x22b746['id']})[_0x5345('0x31')](function(_0x2f3468){logger[_0x5345('0x16')](_0x5345('0x3b'),'afterCreate',_0x2f3468['message']);});}}});})[_0x5345('0x20')](function(){return _0x2b6e00[_0x5345('0x32')][_0x5345('0x34')]({'attributes':['id','dialCheckDuplicateType',_0x5345('0x1d')],'include':[{'model':_0x2b6e00[_0x5345('0x37')],'as':_0x5345('0x38'),'where':{'id':_0x562954[_0x5345('0x29')]}}]})['then'](function(_0x56e1e3){if(_0x56e1e3){var _0x185f9d=[];for(var _0x44099e=0x0,_0x4f9cf0;_0x44099e<_0x56e1e3['length'];_0x44099e+=0x1){_0x4f9cf0=_0x56e1e3[_0x44099e][_0x5345('0x15')]({'plain':!![]});switch(_0x4f9cf0[_0x5345('0x36')]){case _0x5345('0x3a'):_0x711d32(_0x4f9cf0)['catch'](_0x23070a());break;case _0x5345('0x3c'):_0x125b05(_0x4f9cf0)[_0x5345('0x31')](_0x23070a());break;default:_0x2b6e00['CmHopper'][_0x5345('0x28')]({'phone':_0x562954['phone'],'ContactId':_0x562954['id'],'ListId':_0x562954[_0x5345('0x29')],'scheduledat':_0x562954[_0x5345('0x23')]?_0x562954[_0x5345('0x23')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x562954['priority']?_0x562954['priority']:0x2,'callback':_0x562954['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x562954['callbackUniqueid']?_0x562954[_0x5345('0x2b')]:undefined,'callbackat':_0x562954['callbackUniqueid']?moment()[_0x5345('0x1a')](_0x5345('0x1b')):undefined,'CampaignId':_0x4f9cf0['id']})[_0x5345('0x31')](_0x23070a());}}}});})[_0x5345('0x20')](function(){return _0x2b6e00[_0x5345('0x32')]['findAll']({'attributes':['id'],'include':[{'model':_0x2b6e00[_0x5345('0x37')],'as':_0x5345('0x3d'),'where':{'id':_0x562954[_0x5345('0x29')]}}]})[_0x5345('0x20')](function(_0x5612cc){if(_0x5612cc){var _0x489938=[];for(var _0x3e9e4b=0x0,_0x47c327;_0x3e9e4b<_0x5612cc[_0x5345('0x39')];_0x3e9e4b+=0x1){_0x47c327=_0x5612cc[_0x3e9e4b][_0x5345('0x15')]({'plain':!![]});_0x2b6e00[_0x5345('0x3e')][_0x5345('0x28')]({'phone':_0x562954[_0x5345('0xe')],'ContactId':_0x562954['id'],'ListId':_0x562954[_0x5345('0x29')],'CampaignId':_0x47c327['id']})[_0x5345('0x31')](function(_0x22d847){logger[_0x5345('0x16')](_0x5345('0x3b'),_0x5345('0x18'),_0x22d847[_0x5345('0x3f')]);});}}});})[_0x5345('0x20')](function(){_0x9af5ec();})[_0x5345('0x31')](function(_0x18b6d0){logger[_0x5345('0x16')]('cmContact,\x20%s,\x20%s','afterCreate',_0x18b6d0[_0x5345('0x3f')]);_0x9af5ec(_0x18b6d0);});}else{_0x9af5ec(new Error(_0x5345('0x40')));}},'afterDestroy':function(_0x1d5f01,_0x234346,_0x367474){var _0x368b00=_0x3c9161[_0x5345('0x14')];var _0x1e2645=_0x1d5f01['get']({'plain':!![]});return _0x368b00[_0x5345('0x27')]['findAll']({'raw':!![],'where':{'ListId':_0x1e2645[_0x5345('0x29')],'ContactId':_0x1e2645['id']}})['then'](function(_0x2d542d){if(!_[_0x5345('0x41')](_0x2d542d)){var _0x5795ea=[];for(var _0x1bbc73=0x0;_0x1bbc73<_0x2d542d[_0x5345('0x39')];_0x1bbc73+=0x1){var _0x25ddd9=_0x368b00['CmHopper'][_0x5345('0x42')]({'where':{'ListId':_0x2d542d[_0x1bbc73][_0x5345('0x29')],'ContactId':_0x2d542d[_0x1bbc73][_0x5345('0x43')],'VoiceQueueId':_0x2d542d[_0x1bbc73][_0x5345('0x44')],'CampaignId':_0x2d542d[_0x1bbc73][_0x5345('0x45')]}});_0x5795ea[_0x5345('0x46')](_0x25ddd9);}return BPromise[_0x5345('0x47')](_0x5795ea);}})[_0x5345('0x20')](function(_0xf97389){logger[_0x5345('0x48')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0xf97389,{'showHidden':![],'depth':null}));_0x367474();})[_0x5345('0x31')](function(_0x1a0e30){logger['error'](_0x5345('0x49'),util[_0x5345('0x19')](_0x1a0e30,{'showHidden':![],'depth':null}));_0x367474(_0x1a0e30);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 654962e..168397d 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x2280ef,_0x433a44){var _0x4d69b3=function(_0x7e1760){while(--_0x7e1760){_0x2280ef['push'](_0x2280ef['shift']());}};_0x4d69b3(++_0x433a44);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x23ffd7,_0xba70f2){var _0x266eed=function(_0x42c34a){while(--_0x42c34a){_0x23ffd7['push'](_0x23ffd7['shift']());}};_0x266eed(++_0xba70f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index f340675..e2872a3 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6c1=['exports','INTEGER','STRING','PHONE'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xe6c1,0xd8));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x1e6c('0x0')]={'CmContactId':{'type':Sequelize[_0x1e6c('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x1e6c('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x1e6c('0x3')},'OrderBy':{'type':Sequelize[_0x1e6c('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x1e6c('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x0911=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x586909,_0x4bd30c){var _0x1d112a=function(_0x4adf75){while(--_0x4adf75){_0x586909['push'](_0x586909['shift']());}};_0x1d112a(++_0x4bd30c);}(_0x0911,0x1a9));var _0x1091=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x0911[_0x4d7f3f];return _0x5d67cc;};'use strict';var Sequelize=require(_0x1091('0x0'));module[_0x1091('0x1')]={'CmContactId':{'type':Sequelize[_0x1091('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x1091('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1091('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x1091('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x1091('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 2a877d6..2586b11 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18e1=['bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','CmContactHasItems','UserProfileResource','stack','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x172c71,_0x52dc36){var _0x340c20=function(_0x414113){while(--_0x414113){_0x172c71['push'](_0x172c71['shift']());}};_0x340c20(++_0x52dc36);}(_0x18e1,0x1f2));var _0x118e=function(_0x49b8b9,_0x41fbd8){_0x49b8b9=_0x49b8b9-0x0;var _0x3bb520=_0x18e1[_0x49b8b9];return _0x3bb520;};'use strict';var emlformat=require(_0x118e('0x0'));var rimraf=require(_0x118e('0x1'));var zipdir=require(_0x118e('0x2'));var jsonpatch=require(_0x118e('0x3'));var rp=require(_0x118e('0x4'));var moment=require(_0x118e('0x5'));var BPromise=require(_0x118e('0x6'));var Mustache=require(_0x118e('0x7'));var util=require('util');var path=require(_0x118e('0x8'));var sox=require(_0x118e('0x9'));var csv=require('to-csv');var ejs=require(_0x118e('0xa'));var fs=require('fs');var fs_extra=require(_0x118e('0xb'));var _=require(_0x118e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x118e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x118e('0xe'));var querystring=require(_0x118e('0xf'));var Papa=require(_0x118e('0x10'));var Redis=require(_0x118e('0x11'));var authService=require(_0x118e('0x12'));var qs=require(_0x118e('0x13'));var as=require(_0x118e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x118e('0x15'))('api');var utils=require(_0x118e('0x16'));var config=require(_0x118e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d797f,_0xea64f6){_0xea64f6=_0xea64f6||0xcc;return function(_0x16f6d4){if(_0x16f6d4){return _0x4d797f[_0x118e('0x18')](_0xea64f6);}return _0x4d797f[_0x118e('0x19')](_0xea64f6)[_0x118e('0x1a')]();};}function respondWithResult(_0x1dd94c,_0x3f9a6f){_0x3f9a6f=_0x3f9a6f||0xc8;return function(_0x566933){if(_0x566933){return _0x1dd94c[_0x118e('0x19')](_0x3f9a6f)[_0x118e('0x1b')](_0x566933);}};}function respondWithFilteredResult(_0xbd18bd,_0x17aad7){return function(_0x1ebaaa){if(_0x1ebaaa){var _0x55d7a4=typeof _0x17aad7[_0x118e('0x1c')]===_0x118e('0x1d')&&typeof _0x17aad7['limit']==='undefined';var _0x3f970c=_0x1ebaaa['count'];var _0x2b1a54=_0x55d7a4?0x0:_0x17aad7[_0x118e('0x1c')];var _0x1979cc=_0x55d7a4?_0x1ebaaa[_0x118e('0x1e')]:_0x17aad7['offset']+_0x17aad7['limit'];var _0x8f1ff0;if(_0x1979cc>=_0x3f970c){_0x1979cc=_0x3f970c;_0x8f1ff0=0xc8;}else{_0x8f1ff0=0xce;}_0xbd18bd[_0x118e('0x19')](_0x8f1ff0);return _0xbd18bd['set'](_0x118e('0x1f'),_0x2b1a54+'-'+_0x1979cc+'/'+_0x3f970c)['json'](_0x1ebaaa);}return null;};}function patchUpdates(_0x399341){return function(_0x3bac85){try{jsonpatch[_0x118e('0x20')](_0x3bac85,_0x399341,!![]);}catch(_0x423e38){return BPromise[_0x118e('0x21')](_0x423e38);}return _0x3bac85['save']();};}function saveUpdates(_0x332a6d,_0x568a8f){return function(_0x38c853){if(_0x38c853){return _0x38c853[_0x118e('0x22')](_0x332a6d)[_0x118e('0x23')](function(_0x1c55fb){return _0x1c55fb;});}return null;};}function removeEntity(_0x27a049,_0x17af41){return function(_0x2eba0c){if(_0x2eba0c){return _0x2eba0c[_0x118e('0x24')]()[_0x118e('0x23')](function(){var _0x320ff5=_0x2eba0c['get']({'plain':!![]});var _0x161dd5=_0x118e('0x25');return db[_0x118e('0x26')][_0x118e('0x24')]({'where':{'type':_0x161dd5,'resourceId':_0x320ff5['id']}})[_0x118e('0x23')](function(){return _0x2eba0c;});})['then'](function(){_0x27a049['status'](0xcc)[_0x118e('0x1a')]();});}};}function handleEntityNotFound(_0x35e6f4,_0x38ca63){return function(_0x16ca49){if(!_0x16ca49){_0x35e6f4[_0x118e('0x18')](0x194);}return _0x16ca49;};}function handleError(_0x5079d1,_0x9f0300){_0x9f0300=_0x9f0300||0x1f4;return function(_0x3ca372){logger['error'](_0x3ca372[_0x118e('0x27')]);if(_0x3ca372['name']){delete _0x3ca372[_0x118e('0x28')];}_0x5079d1[_0x118e('0x19')](_0x9f0300)[_0x118e('0x29')](_0x3ca372);};}exports[_0x118e('0x2a')]=function(_0x25a9ec,_0x317b3c){var _0x2b657b={},_0xbf0565={},_0x4dd2ac={'count':0x0,'rows':[]};var _0x2e4cc0=_['map'](db[_0x118e('0x2b')][_0x118e('0x2c')],function(_0x130155){return{'name':_0x130155[_0x118e('0x2d')],'type':_0x130155[_0x118e('0x2e')][_0x118e('0x2f')]};});_0xbf0565['model']=_[_0x118e('0x30')](_0x2e4cc0,_0x118e('0x28'));_0xbf0565[_0x118e('0x31')]=_[_0x118e('0x32')](_0x25a9ec[_0x118e('0x31')]);_0xbf0565[_0x118e('0x33')]=_[_0x118e('0x34')](_0xbf0565[_0x118e('0x35')],_0xbf0565[_0x118e('0x31')]);_0x2b657b[_0x118e('0x36')]=_[_0x118e('0x34')](_0xbf0565['model'],qs[_0x118e('0x37')](_0x25a9ec['query'][_0x118e('0x37')]));_0x2b657b[_0x118e('0x36')]=_0x2b657b['attributes'][_0x118e('0x38')]?_0x2b657b[_0x118e('0x36')]:_0xbf0565[_0x118e('0x35')];if(!_0x25a9ec[_0x118e('0x31')]['hasOwnProperty'](_0x118e('0x39'))){_0x2b657b[_0x118e('0x3a')]=qs[_0x118e('0x3a')](_0x25a9ec['query']['limit']);_0x2b657b[_0x118e('0x1c')]=qs[_0x118e('0x1c')](_0x25a9ec[_0x118e('0x31')][_0x118e('0x1c')]);}_0x2b657b[_0x118e('0x3b')]=qs['sort'](_0x25a9ec[_0x118e('0x31')][_0x118e('0x3c')]);_0x2b657b[_0x118e('0x3d')]=qs[_0x118e('0x33')](_[_0x118e('0x3e')](_0x25a9ec[_0x118e('0x31')],_0xbf0565['filters']),_0x2e4cc0);if(_0x25a9ec[_0x118e('0x31')]['filter']){_0x2b657b[_0x118e('0x3d')]=_[_0x118e('0x3f')](_0x2b657b[_0x118e('0x3d')],{'$or':_['map'](_0x2e4cc0,function(_0x127d5f){if(_0x127d5f[_0x118e('0x2e')]!==_0x118e('0x40')){var _0xbe5268={};_0xbe5268[_0x127d5f[_0x118e('0x28')]]={'$like':'%'+_0x25a9ec[_0x118e('0x31')][_0x118e('0x41')]+'%'};return _0xbe5268;}})});}_0x2b657b=_['merge']({},_0x2b657b,_0x25a9ec[_0x118e('0x42')]);var _0x2200af={'where':_0x2b657b[_0x118e('0x3d')]};return db[_0x118e('0x2b')][_0x118e('0x1e')](_0x2200af)[_0x118e('0x23')](function(_0xb48731){_0x4dd2ac[_0x118e('0x1e')]=_0xb48731;if(_0x25a9ec[_0x118e('0x31')]['includeAll']){_0x2b657b[_0x118e('0x43')]=[{'all':!![]}];}return db[_0x118e('0x2b')][_0x118e('0x44')](_0x2b657b);})[_0x118e('0x23')](function(_0x3f0e30){_0x4dd2ac[_0x118e('0x45')]=_0x3f0e30;return _0x4dd2ac;})[_0x118e('0x23')](respondWithFilteredResult(_0x317b3c,_0x2b657b))[_0x118e('0x46')](handleError(_0x317b3c,null));};exports[_0x118e('0x47')]=function(_0x370a51,_0x5ed2d5){var _0x1cc64d={'raw':!![],'where':{'id':_0x370a51[_0x118e('0x48')]['id']}},_0x2d18f4={};_0x2d18f4[_0x118e('0x35')]=_[_0x118e('0x32')](db[_0x118e('0x2b')][_0x118e('0x2c')]);_0x2d18f4[_0x118e('0x31')]=_[_0x118e('0x32')](_0x370a51['query']);_0x2d18f4[_0x118e('0x33')]=_[_0x118e('0x34')](_0x2d18f4[_0x118e('0x35')],_0x2d18f4[_0x118e('0x31')]);_0x1cc64d['attributes']=_[_0x118e('0x34')](_0x2d18f4['model'],qs['fields'](_0x370a51[_0x118e('0x31')][_0x118e('0x37')]));_0x1cc64d['attributes']=_0x1cc64d[_0x118e('0x36')][_0x118e('0x38')]?_0x1cc64d[_0x118e('0x36')]:_0x2d18f4[_0x118e('0x35')];if(_0x370a51[_0x118e('0x31')][_0x118e('0x49')]){_0x1cc64d[_0x118e('0x43')]=[{'all':!![]}];}_0x1cc64d=_[_0x118e('0x3f')]({},_0x1cc64d,_0x370a51['options']);return db[_0x118e('0x2b')][_0x118e('0x4a')](_0x1cc64d)[_0x118e('0x23')](handleEntityNotFound(_0x5ed2d5,null))['then'](respondWithResult(_0x5ed2d5,null))['catch'](handleError(_0x5ed2d5,null));};exports[_0x118e('0x4b')]=function(_0x37cfdc,_0x37634d){return db['CmContactHasItem'][_0x118e('0x4b')](_0x37cfdc[_0x118e('0x4c')],{})[_0x118e('0x23')](function(_0x530d4e){var _0x2086f2=_0x37cfdc['user'][_0x118e('0x4d')]({'plain':!![]});if(!_0x2086f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2086f2[_0x118e('0x4e')]===_0x118e('0x4f')){var _0x10f4ea=_0x530d4e['get']({'plain':!![]});var _0x4b3b51=_0x118e('0x25');return db[_0x118e('0x50')][_0x118e('0x4a')]({'where':{'name':_0x4b3b51,'userProfileId':_0x2086f2[_0x118e('0x51')]},'raw':!![]})['then'](function(_0x26f930){if(_0x26f930&&_0x26f930[_0x118e('0x52')]===0x0){return db['UserProfileResource'][_0x118e('0x4b')]({'name':_0x10f4ea[_0x118e('0x28')],'resourceId':_0x10f4ea['id'],'type':_0x26f930['name'],'sectionId':_0x26f930['id']},{})[_0x118e('0x23')](function(){return _0x530d4e;});}else{return _0x530d4e;}})[_0x118e('0x46')](function(_0x52db35){logger[_0x118e('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52db35);throw _0x52db35;});}return _0x530d4e;})[_0x118e('0x23')](respondWithResult(_0x37634d,0xc9))[_0x118e('0x46')](handleError(_0x37634d,null));};exports[_0x118e('0x22')]=function(_0x5a9c28,_0x19e58b){if(_0x5a9c28[_0x118e('0x4c')]['id']){delete _0x5a9c28[_0x118e('0x4c')]['id'];}return db['CmContactHasItem'][_0x118e('0x4a')]({'where':{'id':_0x5a9c28[_0x118e('0x48')]['id']}})[_0x118e('0x23')](handleEntityNotFound(_0x19e58b,null))[_0x118e('0x23')](saveUpdates(_0x5a9c28['body'],null))['then'](respondWithResult(_0x19e58b,null))[_0x118e('0x46')](handleError(_0x19e58b,null));};exports[_0x118e('0x24')]=function(_0x4d4640,_0x1efb4d){return db[_0x118e('0x2b')][_0x118e('0x4a')]({'where':{'id':_0x4d4640[_0x118e('0x48')]['id']}})['then'](handleEntityNotFound(_0x1efb4d,null))[_0x118e('0x23')](removeEntity(_0x1efb4d,null))[_0x118e('0x46')](handleError(_0x1efb4d,null));}; \ No newline at end of file +var _0x01ba=['VIRTUAL','merge','options','includeAll','include','CmContactHasItem','findAll','rows','show','params','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x192f8a,_0x5f1e8f){var _0x2b6533=function(_0x21cb93){while(--_0x21cb93){_0x192f8a['push'](_0x192f8a['shift']());}};_0x2b6533(++_0x5f1e8f);}(_0x01ba,0xc9));var _0xa01b=function(_0x297ff9,_0x310365){_0x297ff9=_0x297ff9-0x0;var _0x2a3c65=_0x01ba[_0x297ff9];return _0x2a3c65;};'use strict';var emlformat=require(_0xa01b('0x0'));var rimraf=require(_0xa01b('0x1'));var zipdir=require(_0xa01b('0x2'));var jsonpatch=require(_0xa01b('0x3'));var rp=require(_0xa01b('0x4'));var moment=require(_0xa01b('0x5'));var BPromise=require(_0xa01b('0x6'));var Mustache=require(_0xa01b('0x7'));var util=require(_0xa01b('0x8'));var path=require(_0xa01b('0x9'));var sox=require(_0xa01b('0xa'));var csv=require('to-csv');var ejs=require(_0xa01b('0xb'));var fs=require('fs');var fs_extra=require(_0xa01b('0xc'));var _=require('lodash');var squel=require(_0xa01b('0xd'));var crypto=require(_0xa01b('0xe'));var jsforce=require(_0xa01b('0xf'));var deskjs=require(_0xa01b('0x10'));var toCsv=require(_0xa01b('0x11'));var querystring=require(_0xa01b('0x12'));var Papa=require(_0xa01b('0x13'));var Redis=require(_0xa01b('0x14'));var authService=require(_0xa01b('0x15'));var qs=require(_0xa01b('0x16'));var as=require(_0xa01b('0x17'));var hardwareService=require(_0xa01b('0x18'));var logger=require('../../config/logger')(_0xa01b('0x19'));var utils=require(_0xa01b('0x1a'));var config=require(_0xa01b('0x1b'));var licenseUtil=require(_0xa01b('0x1c'));var db=require(_0xa01b('0x1d'))['db'];function respondWithStatusCode(_0x19ff28,_0x5670b7){_0x5670b7=_0x5670b7||0xcc;return function(_0x1394de){if(_0x1394de){return _0x19ff28[_0xa01b('0x1e')](_0x5670b7);}return _0x19ff28[_0xa01b('0x1f')](_0x5670b7)[_0xa01b('0x20')]();};}function respondWithResult(_0x5aa1ca,_0x235a2f){_0x235a2f=_0x235a2f||0xc8;return function(_0x5ee880){if(_0x5ee880){return _0x5aa1ca[_0xa01b('0x1f')](_0x235a2f)['json'](_0x5ee880);}};}function respondWithFilteredResult(_0x935852,_0x43ee7b){return function(_0x19e58a){if(_0x19e58a){var _0x394108=typeof _0x43ee7b['offset']===_0xa01b('0x21')&&typeof _0x43ee7b[_0xa01b('0x22')]===_0xa01b('0x21');var _0x3de83c=_0x19e58a[_0xa01b('0x23')];var _0x2f4d8c=_0x394108?0x0:_0x43ee7b[_0xa01b('0x24')];var _0x2d8457=_0x394108?_0x19e58a[_0xa01b('0x23')]:_0x43ee7b[_0xa01b('0x24')]+_0x43ee7b[_0xa01b('0x22')];var _0x4d0318;if(_0x2d8457>=_0x3de83c){_0x2d8457=_0x3de83c;_0x4d0318=0xc8;}else{_0x4d0318=0xce;}_0x935852[_0xa01b('0x1f')](_0x4d0318);return _0x935852['set'](_0xa01b('0x25'),_0x2f4d8c+'-'+_0x2d8457+'/'+_0x3de83c)['json'](_0x19e58a);}return null;};}function patchUpdates(_0x30f1a6){return function(_0x114251){try{jsonpatch[_0xa01b('0x26')](_0x114251,_0x30f1a6,!![]);}catch(_0x2a2577){return BPromise[_0xa01b('0x27')](_0x2a2577);}return _0x114251[_0xa01b('0x28')]();};}function saveUpdates(_0x3b3189,_0x46ae0c){return function(_0x3d4797){if(_0x3d4797){return _0x3d4797[_0xa01b('0x29')](_0x3b3189)[_0xa01b('0x2a')](function(_0xd649d5){return _0xd649d5;});}return null;};}function removeEntity(_0x44d13c,_0x465815){return function(_0x32ba02){if(_0x32ba02){return _0x32ba02[_0xa01b('0x2b')]()[_0xa01b('0x2a')](function(){var _0x35bdaa=_0x32ba02[_0xa01b('0x2c')]({'plain':!![]});var _0x50f587='CmContactHasItems';return db['UserProfileResource']['destroy']({'where':{'type':_0x50f587,'resourceId':_0x35bdaa['id']}})[_0xa01b('0x2a')](function(){return _0x32ba02;});})[_0xa01b('0x2a')](function(){_0x44d13c['status'](0xcc)[_0xa01b('0x20')]();});}};}function handleEntityNotFound(_0x4d92b7,_0x24eb4e){return function(_0x8a179e){if(!_0x8a179e){_0x4d92b7[_0xa01b('0x1e')](0x194);}return _0x8a179e;};}function handleError(_0x445e7d,_0x15901c){_0x15901c=_0x15901c||0x1f4;return function(_0x4ab1b5){logger[_0xa01b('0x2d')](_0x4ab1b5[_0xa01b('0x2e')]);if(_0x4ab1b5[_0xa01b('0x2f')]){delete _0x4ab1b5[_0xa01b('0x2f')];}_0x445e7d['status'](_0x15901c)[_0xa01b('0x30')](_0x4ab1b5);};}exports[_0xa01b('0x31')]=function(_0x28f93a,_0xab1bb3){var _0x3ce039={},_0x5600ef={},_0x2b3c7f={'count':0x0,'rows':[]};var _0xd0b523=_[_0xa01b('0x32')](db['CmContactHasItem'][_0xa01b('0x33')],function(_0x41cbc7){return{'name':_0x41cbc7[_0xa01b('0x34')],'type':_0x41cbc7[_0xa01b('0x35')][_0xa01b('0x36')]};});_0x5600ef[_0xa01b('0x37')]=_[_0xa01b('0x32')](_0xd0b523,_0xa01b('0x2f'));_0x5600ef['query']=_[_0xa01b('0x38')](_0x28f93a[_0xa01b('0x39')]);_0x5600ef[_0xa01b('0x3a')]=_[_0xa01b('0x3b')](_0x5600ef[_0xa01b('0x37')],_0x5600ef[_0xa01b('0x39')]);_0x3ce039[_0xa01b('0x3c')]=_[_0xa01b('0x3b')](_0x5600ef[_0xa01b('0x37')],qs['fields'](_0x28f93a[_0xa01b('0x39')]['fields']));_0x3ce039['attributes']=_0x3ce039[_0xa01b('0x3c')][_0xa01b('0x3d')]?_0x3ce039['attributes']:_0x5600ef[_0xa01b('0x37')];if(!_0x28f93a['query'][_0xa01b('0x3e')](_0xa01b('0x3f'))){_0x3ce039['limit']=qs[_0xa01b('0x22')](_0x28f93a[_0xa01b('0x39')][_0xa01b('0x22')]);_0x3ce039[_0xa01b('0x24')]=qs['offset'](_0x28f93a[_0xa01b('0x39')]['offset']);}_0x3ce039[_0xa01b('0x40')]=qs[_0xa01b('0x41')](_0x28f93a[_0xa01b('0x39')][_0xa01b('0x41')]);_0x3ce039['where']=qs[_0xa01b('0x3a')](_[_0xa01b('0x42')](_0x28f93a[_0xa01b('0x39')],_0x5600ef[_0xa01b('0x3a')]),_0xd0b523);if(_0x28f93a[_0xa01b('0x39')][_0xa01b('0x43')]){_0x3ce039[_0xa01b('0x44')]=_['merge'](_0x3ce039['where'],{'$or':_['map'](_0xd0b523,function(_0x187586){if(_0x187586[_0xa01b('0x35')]!==_0xa01b('0x45')){var _0x40e90c={};_0x40e90c[_0x187586['name']]={'$like':'%'+_0x28f93a[_0xa01b('0x39')][_0xa01b('0x43')]+'%'};return _0x40e90c;}})});}_0x3ce039=_[_0xa01b('0x46')]({},_0x3ce039,_0x28f93a[_0xa01b('0x47')]);var _0x3c3f0c={'where':_0x3ce039['where']};return db['CmContactHasItem'][_0xa01b('0x23')](_0x3c3f0c)[_0xa01b('0x2a')](function(_0x4d161a){_0x2b3c7f[_0xa01b('0x23')]=_0x4d161a;if(_0x28f93a[_0xa01b('0x39')][_0xa01b('0x48')]){_0x3ce039[_0xa01b('0x49')]=[{'all':!![]}];}return db[_0xa01b('0x4a')][_0xa01b('0x4b')](_0x3ce039);})[_0xa01b('0x2a')](function(_0xe5f85d){_0x2b3c7f[_0xa01b('0x4c')]=_0xe5f85d;return _0x2b3c7f;})[_0xa01b('0x2a')](respondWithFilteredResult(_0xab1bb3,_0x3ce039))['catch'](handleError(_0xab1bb3,null));};exports[_0xa01b('0x4d')]=function(_0xde3ea5,_0x5368c4){var _0x386554={'raw':!![],'where':{'id':_0xde3ea5[_0xa01b('0x4e')]['id']}},_0x1e32e5={};_0x1e32e5[_0xa01b('0x37')]=_[_0xa01b('0x38')](db['CmContactHasItem'][_0xa01b('0x33')]);_0x1e32e5['query']=_[_0xa01b('0x38')](_0xde3ea5[_0xa01b('0x39')]);_0x1e32e5[_0xa01b('0x3a')]=_[_0xa01b('0x3b')](_0x1e32e5[_0xa01b('0x37')],_0x1e32e5['query']);_0x386554[_0xa01b('0x3c')]=_[_0xa01b('0x3b')](_0x1e32e5[_0xa01b('0x37')],qs['fields'](_0xde3ea5['query'][_0xa01b('0x4f')]));_0x386554['attributes']=_0x386554[_0xa01b('0x3c')]['length']?_0x386554[_0xa01b('0x3c')]:_0x1e32e5[_0xa01b('0x37')];if(_0xde3ea5[_0xa01b('0x39')][_0xa01b('0x48')]){_0x386554['include']=[{'all':!![]}];}_0x386554=_[_0xa01b('0x46')]({},_0x386554,_0xde3ea5[_0xa01b('0x47')]);return db['CmContactHasItem']['find'](_0x386554)[_0xa01b('0x2a')](handleEntityNotFound(_0x5368c4,null))[_0xa01b('0x2a')](respondWithResult(_0x5368c4,null))['catch'](handleError(_0x5368c4,null));};exports[_0xa01b('0x50')]=function(_0x53b9be,_0x1d5940){return db['CmContactHasItem'][_0xa01b('0x50')](_0x53b9be[_0xa01b('0x51')],{})[_0xa01b('0x2a')](function(_0x2ca57e){var _0x515c23=_0x53b9be[_0xa01b('0x52')][_0xa01b('0x2c')]({'plain':!![]});if(!_0x515c23)throw new Error(_0xa01b('0x53'));if(_0x515c23['role']==='user'){var _0x27004c=_0x2ca57e[_0xa01b('0x2c')]({'plain':!![]});var _0x13edd1='CmContactHasItems';return db[_0xa01b('0x54')][_0xa01b('0x55')]({'where':{'name':_0x13edd1,'userProfileId':_0x515c23[_0xa01b('0x56')]},'raw':!![]})[_0xa01b('0x2a')](function(_0x7d8807){if(_0x7d8807&&_0x7d8807[_0xa01b('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x27004c[_0xa01b('0x2f')],'resourceId':_0x27004c['id'],'type':_0x7d8807['name'],'sectionId':_0x7d8807['id']},{})[_0xa01b('0x2a')](function(){return _0x2ca57e;});}else{return _0x2ca57e;}})[_0xa01b('0x58')](function(_0xc2280e){logger[_0xa01b('0x2d')](_0xa01b('0x59'),_0xc2280e);throw _0xc2280e;});}return _0x2ca57e;})['then'](respondWithResult(_0x1d5940,0xc9))[_0xa01b('0x58')](handleError(_0x1d5940,null));};exports[_0xa01b('0x29')]=function(_0x4a922a,_0x69b206){if(_0x4a922a[_0xa01b('0x51')]['id']){delete _0x4a922a[_0xa01b('0x51')]['id'];}return db[_0xa01b('0x4a')][_0xa01b('0x55')]({'where':{'id':_0x4a922a[_0xa01b('0x4e')]['id']}})[_0xa01b('0x2a')](handleEntityNotFound(_0x69b206,null))[_0xa01b('0x2a')](saveUpdates(_0x4a922a[_0xa01b('0x51')],null))[_0xa01b('0x2a')](respondWithResult(_0x69b206,null))[_0xa01b('0x58')](handleError(_0x69b206,null));};exports[_0xa01b('0x2b')]=function(_0x5d6204,_0x3f2dab){return db[_0xa01b('0x4a')][_0xa01b('0x55')]({'where':{'id':_0x5d6204[_0xa01b('0x4e')]['id']}})[_0xa01b('0x2a')](handleEntityNotFound(_0x3f2dab,null))[_0xa01b('0x2a')](removeEntity(_0x3f2dab,null))[_0xa01b('0x58')](handleError(_0x3f2dab,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index deb1153..d88022e 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccc5=['define','CmContactHasItem','cm_contact_has_items','lodash','api','moment','bluebird','request-promise','./cmContactHasItem.attributes','exports'];(function(_0x3813ad,_0x2eff01){var _0x16ed55=function(_0x406204){while(--_0x406204){_0x3813ad['push'](_0x3813ad['shift']());}};_0x16ed55(++_0x2eff01);}(_0xccc5,0x1bb));var _0x5ccc=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xccc5[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x5ccc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5ccc('0x1'));var moment=require(_0x5ccc('0x2'));var BPromise=require(_0x5ccc('0x3'));var rp=require(_0x5ccc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5ccc('0x5'));module[_0x5ccc('0x6')]=function(_0x437b1c,_0x1b5cfa){return _0x437b1c[_0x5ccc('0x7')](_0x5ccc('0x8'),attributes,{'tableName':_0x5ccc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3990=['define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird','path','./cmContactHasItem.attributes','exports'];(function(_0x33a0ee,_0x537150){var _0x4b87b0=function(_0x5d9ebd){while(--_0x5d9ebd){_0x33a0ee['push'](_0x33a0ee['shift']());}};_0x4b87b0(++_0x537150);}(_0x3990,0xc3));var _0x0399=function(_0x345c89,_0x18f00e){_0x345c89=_0x345c89-0x0;var _0x49277f=_0x3990[_0x345c89];return _0x49277f;};'use strict';var _=require(_0x0399('0x0'));var util=require(_0x0399('0x1'));var logger=require(_0x0399('0x2'))(_0x0399('0x3'));var moment=require(_0x0399('0x4'));var BPromise=require(_0x0399('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0399('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0399('0x7'));module[_0x0399('0x8')]=function(_0x5097b3,_0x22eb34){return _0x5097b3[_0x0399('0x9')](_0x0399('0xa'),attributes,{'tableName':_0x0399('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 11198fb..fec2c97 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc714=['info','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x4f576c,_0x21f2ee){var _0x6ddb4f=function(_0x35078c){while(--_0x35078c){_0x4f576c['push'](_0x4f576c['shift']());}};_0x6ddb4f(++_0x21f2ee);}(_0xc714,0x9b));var _0x4c71=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc714[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4c71('0x0'));var util=require(_0x4c71('0x1'));var moment=require('moment');var BPromise=require(_0x4c71('0x2'));var rs=require(_0x4c71('0x3'));var fs=require('fs');var Redis=require(_0x4c71('0x4'));var db=require(_0x4c71('0x5'))['db'];var utils=require(_0x4c71('0x6'));var logger=require(_0x4c71('0x7'))(_0x4c71('0x8'));var config=require(_0x4c71('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4c71('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f3afa,_0x42c836,_0x9fa1ef){return new BPromise(function(_0x4e1804,_0x1b7633){return client[_0x4c71('0xb')](_0x3f3afa,_0x9fa1ef)[_0x4c71('0xc')](function(_0x2b064f){logger[_0x4c71('0xd')](_0x4c71('0xe'),_0x42c836,'request\x20sent');logger[_0x4c71('0xf')](_0x4c71('0x10'),_0x42c836,_0x4c71('0x11'),JSON[_0x4c71('0x12')](_0x2b064f));if(_0x2b064f['error']){if(_0x2b064f[_0x4c71('0x13')][_0x4c71('0x14')]===0x1f4){logger[_0x4c71('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x42c836,_0x2b064f[_0x4c71('0x13')]['message']);return _0x1b7633(_0x2b064f[_0x4c71('0x13')][_0x4c71('0x15')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x42c836,_0x2b064f[_0x4c71('0x13')][_0x4c71('0x15')]);return _0x4e1804(_0x2b064f[_0x4c71('0x13')][_0x4c71('0x15')]);}else{logger[_0x4c71('0xd')](_0x4c71('0xe'),_0x42c836,_0x4c71('0x11'));_0x4e1804(_0x2b064f[_0x4c71('0x16')][_0x4c71('0x15')]);}})[_0x4c71('0x17')](function(_0x593f1f){logger[_0x4c71('0x13')](_0x4c71('0xe'),_0x42c836,_0x593f1f);_0x1b7633(_0x593f1f);});});} \ No newline at end of file +var _0x66c0=['stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x358243,_0x17dc7c){var _0x36c66b=function(_0x66ecf9){while(--_0x66ecf9){_0x358243['push'](_0x358243['shift']());}};_0x36c66b(++_0x17dc7c);}(_0x66c0,0x194));var _0x066c=function(_0x5d5a9c,_0x2459d2){_0x5d5a9c=_0x5d5a9c-0x0;var _0x4516ac=_0x66c0[_0x5d5a9c];return _0x4516ac;};'use strict';var _=require(_0x066c('0x0'));var util=require(_0x066c('0x1'));var moment=require('moment');var BPromise=require(_0x066c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x066c('0x3'));var db=require(_0x066c('0x4'))['db'];var utils=require(_0x066c('0x5'));var logger=require(_0x066c('0x6'))(_0x066c('0x7'));var config=require('../../config/environment');var jayson=require(_0x066c('0x8'));var client=jayson['client'][_0x066c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bb234,_0x390c04,_0x742f71){return new BPromise(function(_0x145d40,_0x14ba12){return client[_0x066c('0xa')](_0x1bb234,_0x742f71)[_0x066c('0xb')](function(_0x494ca1){logger[_0x066c('0xc')](_0x066c('0xd'),_0x390c04,_0x066c('0xe'));logger[_0x066c('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x390c04,'request\x20sent',JSON[_0x066c('0x10')](_0x494ca1));if(_0x494ca1[_0x066c('0x11')]){if(_0x494ca1[_0x066c('0x11')][_0x066c('0x12')]===0x1f4){logger[_0x066c('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x390c04,_0x494ca1[_0x066c('0x11')][_0x066c('0x13')]);return _0x14ba12(_0x494ca1[_0x066c('0x11')][_0x066c('0x13')]);}logger[_0x066c('0x11')](_0x066c('0xd'),_0x390c04,_0x494ca1[_0x066c('0x11')][_0x066c('0x13')]);return _0x145d40(_0x494ca1[_0x066c('0x11')][_0x066c('0x13')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x390c04,_0x066c('0xe'));_0x145d40(_0x494ca1[_0x066c('0x14')][_0x066c('0x13')]);}})['catch'](function(_0x7e2820){logger[_0x066c('0x11')](_0x066c('0xd'),_0x390c04,_0x7e2820);_0x14ba12(_0x7e2820);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 94823b5..939278e 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76a3=['../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x31d803,_0x159de5){var _0x212ba9=function(_0x5058b4){while(--_0x5058b4){_0x31d803['push'](_0x31d803['shift']());}};_0x212ba9(++_0x159de5);}(_0x76a3,0x1bc));var _0x376a=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x76a3[_0x15b399];return _0x199f2d;};'use strict';var multer=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var path=require(_0x376a('0x2'));var timeout=require(_0x376a('0x3'));var express=require(_0x376a('0x4'));var router=express['Router']();var fs_extra=require(_0x376a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x376a('0x6'));var controller=require('./cmContactHasItem.controller');router[_0x376a('0x7')]('/',auth[_0x376a('0x8')](),controller[_0x376a('0x9')]);router['get'](_0x376a('0xa'),auth[_0x376a('0x8')](),controller[_0x376a('0xb')]);router[_0x376a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x376a('0xa'),auth[_0x376a('0x8')](),controller[_0x376a('0xd')]);router[_0x376a('0xe')](_0x376a('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9fbb=['Router','fs-extra','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x23d9df,_0x2307ca){var _0x8c382d=function(_0x4dceab){while(--_0x4dceab){_0x23d9df['push'](_0x23d9df['shift']());}};_0x8c382d(++_0x2307ca);}(_0x9fbb,0x83));var _0xb9fb=function(_0x1b32fa,_0x5772d){_0x1b32fa=_0x1b32fa-0x0;var _0x4c71a9=_0x9fbb[_0x1b32fa];return _0x4c71a9;};'use strict';var multer=require(_0xb9fb('0x0'));var util=require(_0xb9fb('0x1'));var path=require(_0xb9fb('0x2'));var timeout=require(_0xb9fb('0x3'));var express=require(_0xb9fb('0x4'));var router=express[_0xb9fb('0x5')]();var fs_extra=require(_0xb9fb('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb9fb('0x7'));var controller=require(_0xb9fb('0x8'));router['get']('/',auth[_0xb9fb('0x9')](),controller[_0xb9fb('0xa')]);router['get'](_0xb9fb('0xb'),auth[_0xb9fb('0x9')](),controller['show']);router['post']('/',auth[_0xb9fb('0x9')](),controller[_0xb9fb('0xc')]);router[_0xb9fb('0xd')](_0xb9fb('0xb'),auth['isAuthenticated'](),controller[_0xb9fb('0xe')]);router[_0xb9fb('0xf')]('/:id',auth[_0xb9fb('0x9')](),controller[_0xb9fb('0x10')]);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 62c4cc3..40150bc 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 _0xfdd8=['stringify','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','STRING','type','select','parse','values','isArray'];(function(_0x2e5ae1,_0x3003ea){var _0x219fc0=function(_0x4db1a3){while(--_0x4db1a3){_0x2e5ae1['push'](_0x2e5ae1['shift']());}};_0x219fc0(++_0x3003ea);}(_0xfdd8,0xe4));var _0x8fdd=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xfdd8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');var _=require(_0x8fdd('0x0'));module[_0x8fdd('0x1')]={'name':{'type':Sequelize[_0x8fdd('0x2')],'get':function(_0x2630f6){return this[_0x8fdd('0x3')](_0x8fdd('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xa734ed){this[_0x8fdd('0x5')](_0x8fdd('0x4'),_0xa734ed?_0xa734ed:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x8fdd('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0x8fdd('0x7'))===_0x8fdd('0x8')){return JSON[_0x8fdd('0x9')](this[_0x8fdd('0x3')](_0x8fdd('0xa')));}else{return this['getDataValue'](_0x8fdd('0xa'));}},'set':function(_0x5c1682){if(Array[_0x8fdd('0xb')](_0x5c1682)){this[_0x8fdd('0x5')]('values',JSON[_0x8fdd('0xc')](_0x5c1682));}else{this[_0x8fdd('0x5')](_0x8fdd('0xa'),_0x5c1682);}}},'required':{'type':Sequelize[_0x8fdd('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8fdd('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8fdd('0xe')](_0x8fdd('0xf'))}}; \ No newline at end of file +var _0xdf3f=['voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','select','parse','values','isArray','BOOLEAN','ENUM'];(function(_0x28938e,_0x8af0b){var _0x4be10e=function(_0xa60d4){while(--_0xa60d4){_0x28938e['push'](_0x28938e['shift']());}};_0x4be10e(++_0x8af0b);}(_0xdf3f,0x1ee));var _0xfdf3=function(_0x2e819c,_0x3f99a5){_0x2e819c=_0x2e819c-0x0;var _0x24e271=_0xdf3f[_0x2e819c];return _0x24e271;};'use strict';var Sequelize=require(_0xfdf3('0x0'));var _=require(_0xfdf3('0x1'));module[_0xfdf3('0x2')]={'name':{'type':Sequelize[_0xfdf3('0x3')],'get':function(_0x59b127){return this[_0xfdf3('0x4')](_0xfdf3('0x5'));}},'alias':{'type':Sequelize[_0xfdf3('0x6')],'allowNull':![],'set':function(_0x244739){this[_0xfdf3('0x7')](_0xfdf3('0x5'),_0x244739?_0x244739:this['getDataValue'](_0xfdf3('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xfdf3('0x9')),'get':function(){if(this[_0xfdf3('0x4')]('type')===_0xfdf3('0xa')){return JSON[_0xfdf3('0xb')](this[_0xfdf3('0x4')](_0xfdf3('0xc')));}else{return this[_0xfdf3('0x4')](_0xfdf3('0xc'));}},'set':function(_0x18be17){if(Array[_0xfdf3('0xd')](_0x18be17)){this[_0xfdf3('0x7')](_0xfdf3('0xc'),JSON['stringify'](_0x18be17));}else{this['setDataValue']('values',_0x18be17);}}},'required':{'type':Sequelize[_0xfdf3('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xfdf3('0xf')](_0xfdf3('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 04c3c26..0c19ad1 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 _0x0f45=['lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../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','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','differenceBy','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','CmCustomField','findAll','rows','catch','params','body','find','create','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x32f970,_0x1d9774){var _0x225b46=function(_0x5d895b){while(--_0x5d895b){_0x32f970['push'](_0x32f970['shift']());}};_0x225b46(++_0x1d9774);}(_0x0f45,0x1c4));var _0x50f4=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x0f45[_0x5a3cf0];return _0x5a64ee;};'use strict';var emlformat=require(_0x50f4('0x0'));var rimraf=require(_0x50f4('0x1'));var zipdir=require(_0x50f4('0x2'));var jsonpatch=require(_0x50f4('0x3'));var rp=require(_0x50f4('0x4'));var moment=require(_0x50f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x50f4('0x6'));var util=require(_0x50f4('0x7'));var path=require(_0x50f4('0x8'));var sox=require(_0x50f4('0x9'));var csv=require(_0x50f4('0xa'));var ejs=require(_0x50f4('0xb'));var fs=require('fs');var fs_extra=require(_0x50f4('0xc'));var _=require(_0x50f4('0xd'));var squel=require('squel');var crypto=require(_0x50f4('0xe'));var jsforce=require(_0x50f4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x50f4('0xa'));var querystring=require(_0x50f4('0x10'));var Papa=require(_0x50f4('0x11'));var Redis=require(_0x50f4('0x12'));var authService=require(_0x50f4('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50f4('0x14'));var logger=require(_0x50f4('0x15'))(_0x50f4('0x16'));var utils=require('../../config/utils');var config=require(_0x50f4('0x17'));var licenseUtil=require(_0x50f4('0x18'));var db=require(_0x50f4('0x19'))['db'];function respondWithStatusCode(_0x56c726,_0x4de44d){_0x4de44d=_0x4de44d||0xcc;return function(_0x511076){if(_0x511076){return _0x56c726[_0x50f4('0x1a')](_0x4de44d);}return _0x56c726[_0x50f4('0x1b')](_0x4de44d)[_0x50f4('0x1c')]();};}function respondWithResult(_0x4a25a5,_0xc176b2){_0xc176b2=_0xc176b2||0xc8;return function(_0x29d477){if(_0x29d477){return _0x4a25a5[_0x50f4('0x1b')](_0xc176b2)[_0x50f4('0x1d')](_0x29d477);}};}function respondWithFilteredResult(_0x446b9d,_0x54245e){return function(_0x17feae){if(_0x17feae){var _0x1ad902=typeof _0x54245e[_0x50f4('0x1e')]===_0x50f4('0x1f')&&typeof _0x54245e['limit']==='undefined';var _0x2a811c=_0x17feae[_0x50f4('0x20')];var _0x4d8f8b=_0x1ad902?0x0:_0x54245e[_0x50f4('0x1e')];var _0x50706a=_0x1ad902?_0x17feae[_0x50f4('0x20')]:_0x54245e[_0x50f4('0x1e')]+_0x54245e[_0x50f4('0x21')];var _0x285589;if(_0x50706a>=_0x2a811c){_0x50706a=_0x2a811c;_0x285589=0xc8;}else{_0x285589=0xce;}_0x446b9d[_0x50f4('0x1b')](_0x285589);return _0x446b9d[_0x50f4('0x22')](_0x50f4('0x23'),_0x4d8f8b+'-'+_0x50706a+'/'+_0x2a811c)[_0x50f4('0x1d')](_0x17feae);}return null;};}function patchUpdates(_0x19c686){return function(_0x3c8b85){try{jsonpatch[_0x50f4('0x24')](_0x3c8b85,_0x19c686,!![]);}catch(_0x211b54){return BPromise[_0x50f4('0x25')](_0x211b54);}return _0x3c8b85[_0x50f4('0x26')]();};}function saveUpdates(_0x57ca43,_0x118d75){return function(_0x53df90){if(_0x53df90){return _0x53df90[_0x50f4('0x27')](_0x57ca43)[_0x50f4('0x28')](function(_0x5e538a){return _0x5e538a;});}return null;};}function removeEntity(_0x1cb754,_0x460146){return function(_0x3d0197){if(_0x3d0197){return _0x3d0197[_0x50f4('0x29')]()[_0x50f4('0x28')](function(){_0x1cb754[_0x50f4('0x1b')](0xcc)[_0x50f4('0x1c')]();});}};}function handleEntityNotFound(_0x5b3115,_0x51afdd){return function(_0x4f74b5){if(!_0x4f74b5){_0x5b3115['sendStatus'](0x194);}return _0x4f74b5;};}function handleError(_0x13ec39,_0x406732){_0x406732=_0x406732||0x1f4;return function(_0x46925b){logger[_0x50f4('0x2a')](_0x46925b[_0x50f4('0x2b')]);if(_0x46925b[_0x50f4('0x2c')]){delete _0x46925b[_0x50f4('0x2c')];}_0x13ec39[_0x50f4('0x1b')](_0x406732)[_0x50f4('0x2d')](_0x46925b);};}exports[_0x50f4('0x2e')]=function(_0x55c368,_0x1c91a9){var _0x41e7f2={},_0xcd7ca2={},_0x41a0e2={'count':0x0,'rows':[]};var _0x1f71b0=_[_0x50f4('0x2f')](db['CmCustomField'][_0x50f4('0x30')],function(_0x238494){return{'name':_0x238494[_0x50f4('0x31')],'type':_0x238494['type'][_0x50f4('0x32')]};});_0xcd7ca2['model']=_[_0x50f4('0x33')](_[_0x50f4('0x2f')](_0x1f71b0,_0x50f4('0x2c')),[_0x50f4('0x2c')]);_0xcd7ca2['query']=_[_0x50f4('0x34')](_0x55c368[_0x50f4('0x35')]);_0xcd7ca2[_0x50f4('0x36')]=_[_0x50f4('0x37')](_0xcd7ca2[_0x50f4('0x38')],_0xcd7ca2[_0x50f4('0x35')]);_0x41e7f2['attributes']=_[_0x50f4('0x37')](_0xcd7ca2[_0x50f4('0x38')],qs[_0x50f4('0x39')](_0x55c368[_0x50f4('0x35')][_0x50f4('0x39')]));_0x41e7f2[_0x50f4('0x3a')]=_0x41e7f2[_0x50f4('0x3a')][_0x50f4('0x3b')]?_0x41e7f2['attributes']:_0xcd7ca2[_0x50f4('0x38')];if(!_0x55c368[_0x50f4('0x35')][_0x50f4('0x3c')](_0x50f4('0x3d'))){_0x41e7f2[_0x50f4('0x21')]=qs['limit'](_0x55c368[_0x50f4('0x35')][_0x50f4('0x21')]);_0x41e7f2[_0x50f4('0x1e')]=qs['offset'](_0x55c368['query'][_0x50f4('0x1e')]);}_0x41e7f2['order']=qs[_0x50f4('0x3e')](_0x55c368[_0x50f4('0x35')][_0x50f4('0x3e')]);_0x41e7f2[_0x50f4('0x3f')]=qs[_0x50f4('0x36')](_[_0x50f4('0x40')](_0x55c368[_0x50f4('0x35')],_0xcd7ca2[_0x50f4('0x36')]),_0x1f71b0);if(_0x55c368[_0x50f4('0x35')][_0x50f4('0x41')]){_0x41e7f2['where']=_[_0x50f4('0x42')](_0x41e7f2[_0x50f4('0x3f')],{'$or':_[_0x50f4('0x2f')](_0x1f71b0,function(_0x2ab4fe){if(_0x2ab4fe[_0x50f4('0x43')]!=='VIRTUAL'){var _0x1eff6={};_0x1eff6[_0x2ab4fe[_0x50f4('0x2c')]]={'$like':'%'+_0x55c368[_0x50f4('0x35')]['filter']+'%'};return _0x1eff6;}})});}_0x41e7f2=_['merge']({},_0x41e7f2,_0x55c368[_0x50f4('0x44')]);var _0x15d658={'where':_0x41e7f2['where']};return db['CmCustomField'][_0x50f4('0x20')](_0x15d658)[_0x50f4('0x28')](function(_0x24da35){_0x41a0e2[_0x50f4('0x20')]=_0x24da35;if(_0x55c368[_0x50f4('0x35')][_0x50f4('0x45')]){_0x41e7f2[_0x50f4('0x46')]=[{'all':!![]}];}return db[_0x50f4('0x47')][_0x50f4('0x48')](_0x41e7f2);})['then'](function(_0x16bc03){_0x41a0e2[_0x50f4('0x49')]=_0x16bc03;return _0x41a0e2;})[_0x50f4('0x28')](respondWithFilteredResult(_0x1c91a9,_0x41e7f2))[_0x50f4('0x4a')](handleError(_0x1c91a9,null));};exports['show']=function(_0x115f52,_0x4c7330){var _0x5733c3={'raw':!![],'where':{'id':_0x115f52[_0x50f4('0x4b')]['id']}},_0x58e381={};_0x58e381[_0x50f4('0x38')]=_[_0x50f4('0x34')](db[_0x50f4('0x47')]['rawAttributes']);_0x58e381[_0x50f4('0x35')]=_[_0x50f4('0x34')](_0x115f52[_0x50f4('0x35')]);_0x58e381[_0x50f4('0x36')]=_[_0x50f4('0x37')](_0x58e381[_0x50f4('0x38')],_0x58e381[_0x50f4('0x35')]);_0x5733c3['attributes']=_[_0x50f4('0x37')](_0x58e381[_0x50f4('0x38')],qs[_0x50f4('0x39')](_0x115f52[_0x50f4('0x35')][_0x50f4('0x39')]));_0x5733c3[_0x50f4('0x3a')]=_0x5733c3[_0x50f4('0x3a')][_0x50f4('0x3b')]?_0x5733c3['attributes']:_0x58e381[_0x50f4('0x38')];if(_0x115f52[_0x50f4('0x35')][_0x50f4('0x45')]){_0x5733c3[_0x50f4('0x46')]=[{'all':!![]}];}_0x5733c3=_['merge']({},_0x5733c3,_0x115f52[_0x50f4('0x44')]);return db[_0x50f4('0x47')]['find'](_0x5733c3)[_0x50f4('0x28')](handleEntityNotFound(_0x4c7330,null))[_0x50f4('0x28')](respondWithResult(_0x4c7330,null))[_0x50f4('0x4a')](handleError(_0x4c7330,null));};exports[_0x50f4('0x27')]=function(_0x326c67,_0x2c8c09){if(_0x326c67[_0x50f4('0x4c')]['id']){delete _0x326c67[_0x50f4('0x4c')]['id'];}return db['CmCustomField'][_0x50f4('0x4d')]({'where':{'id':_0x326c67[_0x50f4('0x4b')]['id']}})[_0x50f4('0x28')](handleEntityNotFound(_0x2c8c09,null))[_0x50f4('0x28')](saveUpdates(_0x326c67[_0x50f4('0x4c')],null))[_0x50f4('0x28')](respondWithResult(_0x2c8c09,null))[_0x50f4('0x4a')](handleError(_0x2c8c09,null));};exports[_0x50f4('0x29')]=function(_0x1c8b82,_0x5cd22f){return db[_0x50f4('0x47')][_0x50f4('0x4d')]({'where':{'id':_0x1c8b82[_0x50f4('0x4b')]['id']}})[_0x50f4('0x28')](handleEntityNotFound(_0x5cd22f,null))['then'](removeEntity(_0x5cd22f,null))['catch'](handleError(_0x5cd22f,null));};exports[_0x50f4('0x4e')]=function(_0x561359,_0x10057d){var _0x3d5738;return db['sequelize'][_0x50f4('0x4f')](function(_0xbecf61){return db[_0x50f4('0x47')]['create'](_0x561359[_0x50f4('0x4c')],{'transaction':_0xbecf61})[_0x50f4('0x28')](function(_0x4a14e1){_0x3d5738=_0x4a14e1;var _0x448b73={'type':db[_0x50f4('0x50')][_0x50f4('0x51')],'transaction':_0xbecf61};switch(_0x561359[_0x50f4('0x4c')][_0x50f4('0x43')]){case'text':_0x448b73['type']=db[_0x50f4('0x50')][_0x50f4('0x51')];break;case _0x50f4('0x52'):_0x448b73[_0x50f4('0x43')]=db[_0x50f4('0x50')][_0x50f4('0x53')];break;case _0x50f4('0x54'):_0x448b73[_0x50f4('0x43')]=db['Sequelize'][_0x50f4('0x55')];_0x448b73[_0x50f4('0x56')]=![];break;default:}return db[_0x50f4('0x57')][_0x50f4('0x58')][_0x50f4('0x59')](_0x50f4('0x5a'),util[_0x50f4('0x5b')](_0x50f4('0x5c'),_0x3d5738['id']),_0x448b73);})[_0x50f4('0x28')](function(){return _0x3d5738;});})[_0x50f4('0x28')](respondWithResult(_0x10057d,0xc9))['catch'](handleError(_0x10057d,null));}; \ No newline at end of file +var _0xf6e5=['key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','options','CmCustomField','includeAll','findAll','rows','catch','show','params','find','body','sequelize','TEXT','type','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%d','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','ioredis','../../components/auth/service','../../config/license/hardware','api','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName'];(function(_0x16a3a8,_0xb884d8){var _0x293006=function(_0x136326){while(--_0x136326){_0x16a3a8['push'](_0x16a3a8['shift']());}};_0x293006(++_0xb884d8);}(_0xf6e5,0x112));var _0x5f6e=function(_0x3bd9d5,_0x1beb2e){_0x3bd9d5=_0x3bd9d5-0x0;var _0x28a6f4=_0xf6e5[_0x3bd9d5];return _0x28a6f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f6e('0x0'));var zipdir=require(_0x5f6e('0x1'));var jsonpatch=require(_0x5f6e('0x2'));var rp=require(_0x5f6e('0x3'));var moment=require(_0x5f6e('0x4'));var BPromise=require(_0x5f6e('0x5'));var Mustache=require(_0x5f6e('0x6'));var util=require(_0x5f6e('0x7'));var path=require(_0x5f6e('0x8'));var sox=require(_0x5f6e('0x9'));var csv=require(_0x5f6e('0xa'));var ejs=require(_0x5f6e('0xb'));var fs=require('fs');var fs_extra=require(_0x5f6e('0xc'));var _=require(_0x5f6e('0xd'));var squel=require(_0x5f6e('0xe'));var crypto=require(_0x5f6e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5f6e('0x10'));var toCsv=require(_0x5f6e('0xa'));var querystring=require(_0x5f6e('0x11'));var Papa=require('papaparse');var Redis=require(_0x5f6e('0x12'));var authService=require(_0x5f6e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f6e('0x14'));var logger=require('../../config/logger')(_0x5f6e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c255c,_0x2620c5){_0x2620c5=_0x2620c5||0xcc;return function(_0x15cd30){if(_0x15cd30){return _0x5c255c['sendStatus'](_0x2620c5);}return _0x5c255c[_0x5f6e('0x16')](_0x2620c5)[_0x5f6e('0x17')]();};}function respondWithResult(_0x42ec8b,_0x17069d){_0x17069d=_0x17069d||0xc8;return function(_0x5539aa){if(_0x5539aa){return _0x42ec8b[_0x5f6e('0x16')](_0x17069d)[_0x5f6e('0x18')](_0x5539aa);}};}function respondWithFilteredResult(_0x20c3bf,_0x16728d){return function(_0x3e6f7b){if(_0x3e6f7b){var _0x33f64e=typeof _0x16728d[_0x5f6e('0x19')]===_0x5f6e('0x1a')&&typeof _0x16728d[_0x5f6e('0x1b')]===_0x5f6e('0x1a');var _0xd9c41e=_0x3e6f7b[_0x5f6e('0x1c')];var _0x4a386f=_0x33f64e?0x0:_0x16728d[_0x5f6e('0x19')];var _0x138578=_0x33f64e?_0x3e6f7b[_0x5f6e('0x1c')]:_0x16728d[_0x5f6e('0x19')]+_0x16728d[_0x5f6e('0x1b')];var _0x49d6d0;if(_0x138578>=_0xd9c41e){_0x138578=_0xd9c41e;_0x49d6d0=0xc8;}else{_0x49d6d0=0xce;}_0x20c3bf[_0x5f6e('0x16')](_0x49d6d0);return _0x20c3bf[_0x5f6e('0x1d')]('Content-Range',_0x4a386f+'-'+_0x138578+'/'+_0xd9c41e)[_0x5f6e('0x18')](_0x3e6f7b);}return null;};}function patchUpdates(_0x3dea93){return function(_0x24013e){try{jsonpatch[_0x5f6e('0x1e')](_0x24013e,_0x3dea93,!![]);}catch(_0x43d2a4){return BPromise['reject'](_0x43d2a4);}return _0x24013e['save']();};}function saveUpdates(_0x48f468,_0xa51852){return function(_0x15448a){if(_0x15448a){return _0x15448a[_0x5f6e('0x1f')](_0x48f468)[_0x5f6e('0x20')](function(_0x29bad8){return _0x29bad8;});}return null;};}function removeEntity(_0x3eadf2,_0x3cc940){return function(_0x106d3b){if(_0x106d3b){return _0x106d3b[_0x5f6e('0x21')]()['then'](function(){_0x3eadf2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x386931,_0x2bb1e1){return function(_0x1ebef5){if(!_0x1ebef5){_0x386931[_0x5f6e('0x22')](0x194);}return _0x1ebef5;};}function handleError(_0x456ffb,_0x3d2929){_0x3d2929=_0x3d2929||0x1f4;return function(_0x9fc226){logger[_0x5f6e('0x23')](_0x9fc226['stack']);if(_0x9fc226[_0x5f6e('0x24')]){delete _0x9fc226[_0x5f6e('0x24')];}_0x456ffb[_0x5f6e('0x16')](_0x3d2929)[_0x5f6e('0x25')](_0x9fc226);};}exports[_0x5f6e('0x26')]=function(_0x408113,_0x19808d){var _0x4d75a1={},_0x3b167f={},_0x2c6404={'count':0x0,'rows':[]};var _0x1af502=_[_0x5f6e('0x27')](db['CmCustomField'][_0x5f6e('0x28')],function(_0x5bf1aa){return{'name':_0x5bf1aa[_0x5f6e('0x29')],'type':_0x5bf1aa['type'][_0x5f6e('0x2a')]};});_0x3b167f[_0x5f6e('0x2b')]=_[_0x5f6e('0x2c')](_[_0x5f6e('0x27')](_0x1af502,_0x5f6e('0x24')),[_0x5f6e('0x24')]);_0x3b167f[_0x5f6e('0x2d')]=_[_0x5f6e('0x2e')](_0x408113[_0x5f6e('0x2d')]);_0x3b167f['filters']=_[_0x5f6e('0x2f')](_0x3b167f[_0x5f6e('0x2b')],_0x3b167f['query']);_0x4d75a1[_0x5f6e('0x30')]=_[_0x5f6e('0x2f')](_0x3b167f[_0x5f6e('0x2b')],qs['fields'](_0x408113[_0x5f6e('0x2d')][_0x5f6e('0x31')]));_0x4d75a1[_0x5f6e('0x30')]=_0x4d75a1['attributes'][_0x5f6e('0x32')]?_0x4d75a1[_0x5f6e('0x30')]:_0x3b167f[_0x5f6e('0x2b')];if(!_0x408113['query'][_0x5f6e('0x33')]('nolimit')){_0x4d75a1[_0x5f6e('0x1b')]=qs[_0x5f6e('0x1b')](_0x408113['query']['limit']);_0x4d75a1[_0x5f6e('0x19')]=qs['offset'](_0x408113[_0x5f6e('0x2d')][_0x5f6e('0x19')]);}_0x4d75a1[_0x5f6e('0x34')]=qs[_0x5f6e('0x35')](_0x408113[_0x5f6e('0x2d')]['sort']);_0x4d75a1[_0x5f6e('0x36')]=qs[_0x5f6e('0x37')](_['pick'](_0x408113['query'],_0x3b167f['filters']),_0x1af502);if(_0x408113[_0x5f6e('0x2d')]['filter']){_0x4d75a1[_0x5f6e('0x36')]=_['merge'](_0x4d75a1[_0x5f6e('0x36')],{'$or':_[_0x5f6e('0x27')](_0x1af502,function(_0x571ad4){if(_0x571ad4['type']!=='VIRTUAL'){var _0x41dc80={};_0x41dc80[_0x571ad4[_0x5f6e('0x24')]]={'$like':'%'+_0x408113['query']['filter']+'%'};return _0x41dc80;}})});}_0x4d75a1=_[_0x5f6e('0x38')]({},_0x4d75a1,_0x408113[_0x5f6e('0x39')]);var _0x228bb3={'where':_0x4d75a1[_0x5f6e('0x36')]};return db[_0x5f6e('0x3a')]['count'](_0x228bb3)[_0x5f6e('0x20')](function(_0x3fb240){_0x2c6404[_0x5f6e('0x1c')]=_0x3fb240;if(_0x408113[_0x5f6e('0x2d')][_0x5f6e('0x3b')]){_0x4d75a1['include']=[{'all':!![]}];}return db[_0x5f6e('0x3a')][_0x5f6e('0x3c')](_0x4d75a1);})['then'](function(_0x2ed257){_0x2c6404[_0x5f6e('0x3d')]=_0x2ed257;return _0x2c6404;})['then'](respondWithFilteredResult(_0x19808d,_0x4d75a1))[_0x5f6e('0x3e')](handleError(_0x19808d,null));};exports[_0x5f6e('0x3f')]=function(_0x56c3a5,_0x2e104c){var _0x3cbd40={'raw':!![],'where':{'id':_0x56c3a5[_0x5f6e('0x40')]['id']}},_0x4f1c14={};_0x4f1c14[_0x5f6e('0x2b')]=_[_0x5f6e('0x2e')](db[_0x5f6e('0x3a')][_0x5f6e('0x28')]);_0x4f1c14[_0x5f6e('0x2d')]=_['keys'](_0x56c3a5[_0x5f6e('0x2d')]);_0x4f1c14[_0x5f6e('0x37')]=_[_0x5f6e('0x2f')](_0x4f1c14[_0x5f6e('0x2b')],_0x4f1c14['query']);_0x3cbd40[_0x5f6e('0x30')]=_[_0x5f6e('0x2f')](_0x4f1c14['model'],qs[_0x5f6e('0x31')](_0x56c3a5[_0x5f6e('0x2d')][_0x5f6e('0x31')]));_0x3cbd40['attributes']=_0x3cbd40[_0x5f6e('0x30')][_0x5f6e('0x32')]?_0x3cbd40[_0x5f6e('0x30')]:_0x4f1c14[_0x5f6e('0x2b')];if(_0x56c3a5[_0x5f6e('0x2d')]['includeAll']){_0x3cbd40['include']=[{'all':!![]}];}_0x3cbd40=_['merge']({},_0x3cbd40,_0x56c3a5['options']);return db[_0x5f6e('0x3a')][_0x5f6e('0x41')](_0x3cbd40)['then'](handleEntityNotFound(_0x2e104c,null))['then'](respondWithResult(_0x2e104c,null))[_0x5f6e('0x3e')](handleError(_0x2e104c,null));};exports[_0x5f6e('0x1f')]=function(_0x4812b1,_0x384b50){if(_0x4812b1[_0x5f6e('0x42')]['id']){delete _0x4812b1[_0x5f6e('0x42')]['id'];}return db[_0x5f6e('0x3a')][_0x5f6e('0x41')]({'where':{'id':_0x4812b1[_0x5f6e('0x40')]['id']}})[_0x5f6e('0x20')](handleEntityNotFound(_0x384b50,null))[_0x5f6e('0x20')](saveUpdates(_0x4812b1['body'],null))[_0x5f6e('0x20')](respondWithResult(_0x384b50,null))[_0x5f6e('0x3e')](handleError(_0x384b50,null));};exports['destroy']=function(_0x23846f,_0x27679c){return db['CmCustomField'][_0x5f6e('0x41')]({'where':{'id':_0x23846f[_0x5f6e('0x40')]['id']}})['then'](handleEntityNotFound(_0x27679c,null))[_0x5f6e('0x20')](removeEntity(_0x27679c,null))[_0x5f6e('0x3e')](handleError(_0x27679c,null));};exports['create']=function(_0x164fe8,_0x15fa30){var _0x3db853;return db[_0x5f6e('0x43')]['transaction'](function(_0x13a27f){return db[_0x5f6e('0x3a')]['create'](_0x164fe8['body'],{'transaction':_0x13a27f})[_0x5f6e('0x20')](function(_0x1e7841){_0x3db853=_0x1e7841;var _0x5a3090={'type':db['Sequelize'][_0x5f6e('0x44')],'transaction':_0x13a27f};switch(_0x164fe8['body'][_0x5f6e('0x45')]){case _0x5f6e('0x46'):_0x5a3090[_0x5f6e('0x45')]=db['Sequelize'][_0x5f6e('0x44')];break;case'number':_0x5a3090[_0x5f6e('0x45')]=db[_0x5f6e('0x47')][_0x5f6e('0x48')];break;case _0x5f6e('0x49'):_0x5a3090[_0x5f6e('0x45')]=db[_0x5f6e('0x47')][_0x5f6e('0x4a')];_0x5a3090[_0x5f6e('0x4b')]=![];break;default:}return db['sequelize'][_0x5f6e('0x4c')]['addColumn'](_0x5f6e('0x4d'),util['format'](_0x5f6e('0x4e'),_0x3db853['id']),_0x5a3090);})['then'](function(){return _0x3db853;});})[_0x5f6e('0x20')](respondWithResult(_0x15fa30,0xc9))['catch'](handleError(_0x15fa30,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 753ca82..9891d1b 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 _0x95f1=['cm_custom_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField'];(function(_0x2904e4,_0x770b49){var _0x3a67ac=function(_0x6515f){while(--_0x6515f){_0x2904e4['push'](_0x2904e4['shift']());}};_0x3a67ac(++_0x770b49);}(_0x95f1,0x76));var _0x195f=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x95f1[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x195f('0x0'));var util=require('util');var logger=require(_0x195f('0x1'))(_0x195f('0x2'));var moment=require(_0x195f('0x3'));var BPromise=require(_0x195f('0x4'));var rp=require(_0x195f('0x5'));var fs=require('fs');var path=require(_0x195f('0x6'));var rimraf=require(_0x195f('0x7'));var config=require('../../config/environment');var attributes=require(_0x195f('0x8'));module[_0x195f('0x9')]=function(_0x4c7622,_0x41e61e){return _0x4c7622[_0x195f('0xa')](_0x195f('0xb'),attributes,{'tableName':_0x195f('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb15f=['CmCustomField','cm_custom_fields','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x5dfcad,_0x1e84ab){var _0x289a10=function(_0xa3e03d){while(--_0xa3e03d){_0x5dfcad['push'](_0x5dfcad['shift']());}};_0x289a10(++_0x1e84ab);}(_0xb15f,0x1be));var _0xfb15=function(_0x25c62a,_0x5b8a49){_0x25c62a=_0x25c62a-0x0;var _0x1ab3d9=_0xb15f[_0x25c62a];return _0x1ab3d9;};'use strict';var _=require(_0xfb15('0x0'));var util=require('util');var logger=require(_0xfb15('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfb15('0x2'));var rp=require(_0xfb15('0x3'));var fs=require('fs');var path=require(_0xfb15('0x4'));var rimraf=require(_0xfb15('0x5'));var config=require(_0xfb15('0x6'));var attributes=require(_0xfb15('0x7'));module[_0xfb15('0x8')]=function(_0x3812c4,_0x434832){return _0x3812c4[_0xfb15('0x9')](_0xfb15('0xa'),attributes,{'tableName':_0xfb15('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 1f79b34..038c7ea 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 _0x9de4=['stringify','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x9de4,0xcc));var _0x49de=function(_0x22fbef,_0x4e9e4e){_0x22fbef=_0x22fbef-0x0;var _0x2e519b=_0x9de4[_0x22fbef];return _0x2e519b;};'use strict';var _=require('lodash');var util=require(_0x49de('0x0'));var moment=require('moment');var BPromise=require(_0x49de('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49de('0x2'))['db'];var utils=require(_0x49de('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x49de('0x4'));var jayson=require(_0x49de('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x342d99,_0x26b8c8,_0x4898a9){return new BPromise(function(_0x19deff,_0xdcdbca){return client[_0x49de('0x6')](_0x342d99,_0x4898a9)[_0x49de('0x7')](function(_0x147022){logger[_0x49de('0x8')](_0x49de('0x9'),_0x26b8c8,_0x49de('0xa'));logger['debug'](_0x49de('0xb'),_0x26b8c8,_0x49de('0xa'),JSON[_0x49de('0xc')](_0x147022));if(_0x147022[_0x49de('0xd')]){if(_0x147022[_0x49de('0xd')][_0x49de('0xe')]===0x1f4){logger[_0x49de('0xd')](_0x49de('0x9'),_0x26b8c8,_0x147022[_0x49de('0xd')][_0x49de('0xf')]);return _0xdcdbca(_0x147022[_0x49de('0xd')][_0x49de('0xf')]);}logger[_0x49de('0xd')](_0x49de('0x9'),_0x26b8c8,_0x147022[_0x49de('0xd')][_0x49de('0xf')]);return _0x19deff(_0x147022[_0x49de('0xd')][_0x49de('0xf')]);}else{logger[_0x49de('0x8')](_0x49de('0x9'),_0x26b8c8,'request\x20sent');_0x19deff(_0x147022[_0x49de('0x10')][_0x49de('0xf')]);}})[_0x49de('0x11')](function(_0x4db38c){logger[_0x49de('0xd')](_0x49de('0x9'),_0x26b8c8,_0x4db38c);_0xdcdbca(_0x4db38c);});});} \ No newline at end of file +var _0x02d4=['code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x8a83d9,_0x144c95){var _0x24dbfb=function(_0x37aa77){while(--_0x37aa77){_0x8a83d9['push'](_0x8a83d9['shift']());}};_0x24dbfb(++_0x144c95);}(_0x02d4,0x194));var _0x402d=function(_0x58f537,_0x1fe661){_0x58f537=_0x58f537-0x0;var _0x3f1041=_0x02d4[_0x58f537];return _0x3f1041;};'use strict';var _=require('lodash');var util=require(_0x402d('0x0'));var moment=require(_0x402d('0x1'));var BPromise=require(_0x402d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x402d('0x3'));var db=require(_0x402d('0x4'))['db'];var utils=require(_0x402d('0x5'));var logger=require('../../config/logger')(_0x402d('0x6'));var config=require(_0x402d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x402d('0x8')][_0x402d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x569fd4,_0x295062,_0x231437){return new BPromise(function(_0x476657,_0x282691){return client[_0x402d('0xa')](_0x569fd4,_0x231437)[_0x402d('0xb')](function(_0x1fe16f){logger['info'](_0x402d('0xc'),_0x295062,_0x402d('0xd'));logger[_0x402d('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x295062,_0x402d('0xd'),JSON['stringify'](_0x1fe16f));if(_0x1fe16f[_0x402d('0xf')]){if(_0x1fe16f[_0x402d('0xf')][_0x402d('0x10')]===0x1f4){logger[_0x402d('0xf')](_0x402d('0xc'),_0x295062,_0x1fe16f[_0x402d('0xf')][_0x402d('0x11')]);return _0x282691(_0x1fe16f[_0x402d('0xf')][_0x402d('0x11')]);}logger[_0x402d('0xf')](_0x402d('0xc'),_0x295062,_0x1fe16f[_0x402d('0xf')][_0x402d('0x11')]);return _0x476657(_0x1fe16f[_0x402d('0xf')][_0x402d('0x11')]);}else{logger[_0x402d('0x12')](_0x402d('0xc'),_0x295062,_0x402d('0xd'));_0x476657(_0x1fe16f[_0x402d('0x13')]['message']);}})[_0x402d('0x14')](function(_0x4901a5){logger[_0x402d('0xf')](_0x402d('0xc'),_0x295062,_0x4901a5);_0x282691(_0x4901a5);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f3b1ce1..793b036 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 _0x1c9c=['get','index','isAuthenticated','show','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller'];(function(_0x878bbc,_0x548a12){var _0x12cd2a=function(_0x4bb213){while(--_0x4bb213){_0x878bbc['push'](_0x878bbc['shift']());}};_0x12cd2a(++_0x548a12);}(_0x1c9c,0xa7));var _0xc1c9=function(_0x71a70,_0x4e1cdd){_0x71a70=_0x71a70-0x0;var _0x3a2b22=_0x1c9c[_0x71a70];return _0x3a2b22;};'use strict';var multer=require('multer');var util=require(_0xc1c9('0x0'));var path=require(_0xc1c9('0x1'));var timeout=require(_0xc1c9('0x2'));var express=require(_0xc1c9('0x3'));var router=express['Router']();var fs_extra=require(_0xc1c9('0x4'));var auth=require(_0xc1c9('0x5'));var interaction=require(_0xc1c9('0x6'));var config=require(_0xc1c9('0x7'));var controller=require(_0xc1c9('0x8'));router[_0xc1c9('0x9')]('/',auth['isAuthenticated'](),controller[_0xc1c9('0xa')]);router['get']('/:id',auth[_0xc1c9('0xb')](),controller[_0xc1c9('0xc')]);router['post']('/',auth[_0xc1c9('0xb')](),controller['create']);router['put'](_0xc1c9('0xd'),auth[_0xc1c9('0xb')](),controller['update']);router['delete'](_0xc1c9('0xd'),auth[_0xc1c9('0xb')](),controller[_0xc1c9('0xe')]);module[_0xc1c9('0xf')]=router; \ No newline at end of file +var _0xe984=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x2b0af0,_0x48d46a){var _0x219fb6=function(_0x4fd9ea){while(--_0x4fd9ea){_0x2b0af0['push'](_0x2b0af0['shift']());}};_0x219fb6(++_0x48d46a);}(_0xe984,0xe2));var _0x4e98=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0xe984[_0x1c5142];return _0x1268cb;};'use strict';var multer=require('multer');var util=require(_0x4e98('0x0'));var path=require(_0x4e98('0x1'));var timeout=require(_0x4e98('0x2'));var express=require(_0x4e98('0x3'));var router=express[_0x4e98('0x4')]();var fs_extra=require(_0x4e98('0x5'));var auth=require(_0x4e98('0x6'));var interaction=require(_0x4e98('0x7'));var config=require(_0x4e98('0x8'));var controller=require(_0x4e98('0x9'));router['get']('/',auth[_0x4e98('0xa')](),controller[_0x4e98('0xb')]);router[_0x4e98('0xc')](_0x4e98('0xd'),auth['isAuthenticated'](),controller[_0x4e98('0xe')]);router[_0x4e98('0xf')]('/',auth[_0x4e98('0xa')](),controller[_0x4e98('0x10')]);router[_0x4e98('0x11')]('/:id',auth[_0x4e98('0xa')](),controller['update']);router[_0x4e98('0x12')](_0x4e98('0xd'),auth[_0x4e98('0xa')](),controller[_0x4e98('0x13')]);module[_0x4e98('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 3e63bcf..59f4031 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 _0xce84=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports'];(function(_0x4eeb47,_0x1a36ab){var _0x5eea2d=function(_0x24c70d){while(--_0x24c70d){_0x4eeb47['push'](_0x4eeb47['shift']());}};_0x5eea2d(++_0x1a36ab);}(_0xce84,0x166));var _0x4ce8=function(_0x54d5b7,_0x24e73f){_0x54d5b7=_0x54d5b7-0x0;var _0x5ade77=_0xce84[_0x54d5b7];return _0x5ade77;};'use strict';var moment=require(_0x4ce8('0x0'));var Sequelize=require('sequelize');module[_0x4ce8('0x1')]={'phone':{'type':Sequelize[_0x4ce8('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x4ce8('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4ce8('0x4')],'defaultValue':moment()[_0x4ce8('0x5')](_0x4ce8('0x6'))},'countbusyretry':{'type':Sequelize[_0x4ce8('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4ce8('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4ce8('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4ce8('0x4')]},'priority':{'type':Sequelize[_0x4ce8('0x7')](0x2)[_0x4ce8('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4ce8('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4ce8('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x4ce8('0x7')],'unique':_0x4ce8('0x9')},'UserId':{'type':Sequelize[_0x4ce8('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x4ce8('0x7')],'unique':_0x4ce8('0x9')},'CampaignId':{'type':Sequelize[_0x4ce8('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x4ce8('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4ce8('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4ce8('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4ce8('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x4ce8('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4ce8('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x4ce8('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x1da8=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x1da8,0x178));var _0x81da=function(_0x1ce185,_0x3b74da){_0x1ce185=_0x1ce185-0x0;var _0x5a97d7=_0x1da8[_0x1ce185];return _0x5a97d7;};'use strict';var moment=require(_0x81da('0x0'));var Sequelize=require(_0x81da('0x1'));module[_0x81da('0x2')]={'phone':{'type':Sequelize[_0x81da('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x81da('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x81da('0x5')],'defaultValue':moment()[_0x81da('0x6')](_0x81da('0x7'))},'countbusyretry':{'type':Sequelize[_0x81da('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x81da('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x81da('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x81da('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x81da('0x5')]},'priority':{'type':Sequelize[_0x81da('0x8')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x81da('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x81da('0x9')},'ListId':{'type':Sequelize[_0x81da('0x8')],'unique':_0x81da('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x81da('0x8')],'unique':_0x81da('0x9')},'CampaignId':{'type':Sequelize[_0x81da('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x81da('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x81da('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x81da('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x81da('0x5')],'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 d0102ea..4e3ac25 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 _0x4944=['keys','filters','concat','$and','$gt','$gte','$lte','$ne','$eq','$between','$in','$like','$notLike','$iLike','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','dataValues','createdAt','updatedAt','state','statedesc','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','end','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','getPreviewRecall','recallme','LOCK','List','Queue','dialActive','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','update','sendStatus','error','name','CmHopper','rawAttributes','type','key','model','map','query'];(function(_0x4b8cb9,_0x4aef43){var _0x513573=function(_0x2307a4){while(--_0x2307a4){_0x4b8cb9['push'](_0x4b8cb9['shift']());}};_0x513573(++_0x4aef43);}(_0x4944,0x6d));var _0x4494=function(_0x4d2122,_0xee8861){_0x4d2122=_0x4d2122-0x0;var _0x30a26a=_0x4944[_0x4d2122];return _0x30a26a;};'use strict';var moment=require(_0x4494('0x0'));var _=require('lodash');var qs=require(_0x4494('0x1'));var logger=require(_0x4494('0x2'))(_0x4494('0x3'));var shared=require(_0x4494('0x4'));var db=require(_0x4494('0x5'))['db'];function respondWithResult(_0x5074d9,_0x187098){_0x187098=_0x187098||0xc8;return function(_0x5c7492){if(_0x5c7492){return _0x5074d9[_0x4494('0x6')](_0x187098)[_0x4494('0x7')](_0x5c7492);}};}function respondWithFilteredResult(_0x38480d,_0xb94d02){return function(_0x2a4911){if(_0x2a4911){var _0x1a94d6=typeof _0xb94d02[_0x4494('0x8')]===_0x4494('0x9')&&typeof _0xb94d02[_0x4494('0xa')]==='undefined';var _0x1b6476=_0x2a4911[_0x4494('0xb')];var _0x461525=_0x1a94d6?0x0:_0xb94d02[_0x4494('0x8')];var _0x4acf68=_0x1a94d6?_0x2a4911['count']:_0xb94d02[_0x4494('0x8')]+_0xb94d02[_0x4494('0xa')];var _0xec70eb;if(_0x4acf68>=_0x1b6476){_0x4acf68=_0x1b6476;_0xec70eb=0xc8;}else{_0xec70eb=0xce;}_0x38480d['status'](_0xec70eb);return _0x38480d['set'](_0x4494('0xc'),_0x461525+'-'+_0x4acf68+'/'+_0x1b6476)[_0x4494('0x7')](_0x2a4911);}return null;};}function saveUpdates(_0x221a1d,_0x1c9750){return function(_0x40ee8d){if(_0x40ee8d){return _0x40ee8d[_0x4494('0xd')](_0x221a1d)['then'](function(_0x34959d){return _0x34959d;});}return null;};}function handleEntityNotFound(_0x2325f4,_0x45825c){return function(_0x259e03){if(!_0x259e03){_0x2325f4[_0x4494('0xe')](0x194);}return _0x259e03;};}function handleError(_0x8506a0,_0x3847d6){_0x3847d6=_0x3847d6||0x1f4;return function(_0x53fed5){logger[_0x4494('0xf')](_0x53fed5['stack']);if(_0x53fed5['name']){delete _0x53fed5[_0x4494('0x10')];}_0x8506a0[_0x4494('0x6')](_0x3847d6)['send'](_0x53fed5);};}exports['index']=function(_0xcbe5a4,_0x574fbb){var _0x4655ce={},_0x42880b={},_0x507339={'count':0x0,'rows':[]};var _0x22ed31=_['map'](db[_0x4494('0x11')][_0x4494('0x12')],function(_0x5bedb6){return{'name':_0x5bedb6['fieldName'],'type':_0x5bedb6[_0x4494('0x13')][_0x4494('0x14')]};});_0x42880b[_0x4494('0x15')]=_[_0x4494('0x16')](_0x22ed31,_0x4494('0x10'));_0x42880b[_0x4494('0x17')]=_[_0x4494('0x18')](_0xcbe5a4[_0x4494('0x17')]);_0x42880b['filters']=_['intersection'](_0x42880b['model'],_0x42880b['query']);_0x42880b[_0x4494('0x19')]=_[_0x4494('0x1a')](_0x42880b[_0x4494('0x19')],[_0x4494('0x1b'),'$or',_0x4494('0x1c'),_0x4494('0x1d'),'$lt',_0x4494('0x1e'),_0x4494('0x1f'),_0x4494('0x20'),'$not',_0x4494('0x21'),'$notBetween',_0x4494('0x22'),'$notIn',_0x4494('0x23'),_0x4494('0x24'),_0x4494('0x25'),'$notILike',_0x4494('0x23'),_0x4494('0x26'),'$contains',_0x4494('0x27'),_0x4494('0x28')]);_0x4655ce[_0x4494('0x29')]=_['intersection'](_0x42880b[_0x4494('0x15')],qs[_0x4494('0x2a')](_0xcbe5a4[_0x4494('0x17')][_0x4494('0x2a')]));_0x4655ce[_0x4494('0x29')]=_0x4655ce[_0x4494('0x29')][_0x4494('0x2b')]?_0x4655ce[_0x4494('0x29')]:_0x42880b['model'];if(!_0xcbe5a4[_0x4494('0x17')][_0x4494('0x2c')](_0x4494('0x2d'))){_0x4655ce['limit']=qs[_0x4494('0xa')](_0xcbe5a4[_0x4494('0x17')][_0x4494('0xa')]);_0x4655ce[_0x4494('0x8')]=qs[_0x4494('0x8')](_0xcbe5a4[_0x4494('0x17')][_0x4494('0x8')]);}_0x4655ce['order']=qs[_0x4494('0x2e')](_0xcbe5a4[_0x4494('0x17')][_0x4494('0x2e')]);_0x4655ce[_0x4494('0x2f')]=qs[_0x4494('0x19')](_[_0x4494('0x30')](_0xcbe5a4['query'],_0x42880b[_0x4494('0x19')]),_0x22ed31);if(_0xcbe5a4[_0x4494('0x17')][_0x4494('0x31')]){_0x4655ce[_0x4494('0x2f')]=_[_0x4494('0x32')](_0x4655ce['where'],{'$or':_[_0x4494('0x16')](_0x22ed31,function(_0x4dbe69){if(_0x4dbe69['type']!==_0x4494('0x33')){var _0x49a5c6={};_0x49a5c6[_0x4dbe69['name']]={'$like':'%'+_0xcbe5a4['query'][_0x4494('0x31')]+'%'};return _0x49a5c6;}})});}_0x4655ce=_[_0x4494('0x32')]({},_0x4655ce,_0xcbe5a4[_0x4494('0x34')]);var _0x546133={'where':_0x4655ce['where']};return db[_0x4494('0x11')][_0x4494('0xb')](_0x546133)[_0x4494('0x35')](function(_0x166d29){_0x507339[_0x4494('0xb')]=_0x166d29;if(_0xcbe5a4[_0x4494('0x17')][_0x4494('0x36')]){_0x4655ce[_0x4494('0x37')]=[{'all':!![]}];}return db[_0x4494('0x11')][_0x4494('0x38')](_0x4655ce);})[_0x4494('0x35')](function(_0x14542e){_0x507339[_0x4494('0x39')]=_0x14542e;return _0x507339;})['then'](respondWithFilteredResult(_0x574fbb,_0x4655ce))[_0x4494('0x3a')](handleError(_0x574fbb,null));};exports[_0x4494('0x3b')]=function(_0xdb7757,_0x3bfea6){var _0x20b267={'raw':!![],'where':{'id':_0xdb7757[_0x4494('0x3c')]['id']}},_0x3cd671={};_0x3cd671[_0x4494('0x15')]=_[_0x4494('0x18')](db['CmHopper']['rawAttributes']);_0x3cd671[_0x4494('0x17')]=_['keys'](_0xdb7757[_0x4494('0x17')]);_0x3cd671[_0x4494('0x19')]=_[_0x4494('0x3d')](_0x3cd671[_0x4494('0x15')],_0x3cd671[_0x4494('0x17')]);_0x20b267['attributes']=_['intersection'](_0x3cd671[_0x4494('0x15')],qs['fields'](_0xdb7757[_0x4494('0x17')][_0x4494('0x2a')]));_0x20b267[_0x4494('0x29')]=_0x20b267[_0x4494('0x29')][_0x4494('0x2b')]?_0x20b267[_0x4494('0x29')]:_0x3cd671[_0x4494('0x15')];if(_0xdb7757['query'][_0x4494('0x36')]){_0x20b267[_0x4494('0x37')]=[{'all':!![]}];}_0x20b267=_['merge']({},_0x20b267,_0xdb7757[_0x4494('0x34')]);return db[_0x4494('0x11')][_0x4494('0x3e')](_0x20b267)['then'](handleEntityNotFound(_0x3bfea6,null))[_0x4494('0x35')](respondWithResult(_0x3bfea6,null))[_0x4494('0x3a')](handleError(_0x3bfea6,null));};exports[_0x4494('0x3f')]=function(_0x465f5e,_0x543787){return db['CmHopper'][_0x4494('0x3f')](_0x465f5e[_0x4494('0x40')],{})[_0x4494('0x35')](respondWithResult(_0x543787,0xc9))['catch'](handleError(_0x543787,null));};exports['update']=function(_0x3717ae,_0x79e98c){if(_0x3717ae[_0x4494('0x40')]['id']){delete _0x3717ae['body']['id'];}return db[_0x4494('0x11')][_0x4494('0x3e')]({'where':{'id':_0x3717ae['params']['id']}})[_0x4494('0x35')](handleEntityNotFound(_0x79e98c,null))[_0x4494('0x35')](saveUpdates(_0x3717ae[_0x4494('0x40')],null))[_0x4494('0x35')](respondWithResult(_0x79e98c,null))[_0x4494('0x3a')](handleError(_0x79e98c,null));};exports['describe']=function(_0x802d47,_0x3c5475){return db[_0x4494('0x11')][_0x4494('0x41')]()[_0x4494('0x35')](respondWithResult(_0x3c5475,null))[_0x4494('0x3a')](handleError(_0x3c5475,null));};exports[_0x4494('0x42')]=function(_0x904f3,_0x102010){var _0x157e7c;var _0x4a2d84=_0x904f3[_0x4494('0x3c')]['id'];return db['CmHopper'][_0x4494('0x3e')]({'where':{'id':_0x904f3[_0x4494('0x3c')]['id']}})[_0x4494('0x35')](handleEntityNotFound(_0x102010,null))[_0x4494('0x35')](function(_0x473b00){if(_0x473b00){return _0x473b00['destroy']()[_0x4494('0x35')](function(_0x4eb660){return _0x4eb660;});}})['then'](function(_0x584373){_0x157e7c=_0x584373;if(_0x584373){if(_0x584373['VoiceQueueId']||_0x584373['CampaignId']){return db[_0x584373[_0x4494('0x43')]?_0x4494('0x44'):_0x4494('0x45')][_0x4494('0x3e')]({'where':{'id':_0x584373[_0x4494('0x43')]?_0x584373[_0x4494('0x43')]:_0x584373[_0x4494('0x46')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x49e0d2){var _0x3ad850={};if(_0x49e0d2){_[_0x4494('0x32')](_0x3ad850,_['omit'](_0x157e7c[_0x4494('0x47')],[_0x4494('0x48'),_0x4494('0x49'),'id']));_0x3ad850[_0x4494('0x4a')]=0x15;_0x3ad850[_0x4494('0x4b')]='deleted';_0x3ad850[_0x4494('0x4c')]=_0x49e0d2['name'];_0x3ad850['membername']=_0x904f3[_0x4494('0x4d')]['name'];_0x3ad850[_0x4494('0x4e')]=_0x904f3[_0x4494('0x4d')]['id'];_0x3ad850['deleted']=!![];_0x3ad850['deletedat']=moment()[_0x4494('0x4f')](_0x4494('0x50'));_0x3ad850[_0x4494('0x51')]=_0x157e7c['phone'];_0x3ad850[_0x4494('0x52')]=_0x157e7c[_0x4494('0x43')]?_0x4494('0x53'):_0x4494('0x54');return db[_0x4494('0x55')][_0x4494('0x3e')]({'where':{'id':_0x3ad850['ContactId']},'attributes':['firstName',_0x4494('0x56')]})['then'](function(_0x1d84fe){if(!_[_0x4494('0x57')](_0x102010)&&!_[_0x4494('0x57')](_0x1d84fe['firstName'])){_0x3ad850['calleridname']=_0x1d84fe[_0x4494('0x58')];if(!_[_0x4494('0x57')](_0x1d84fe[_0x4494('0x56')])){_0x3ad850[_0x4494('0x59')]+='\x20'+_0x1d84fe[_0x4494('0x56')];}}})[_0x4494('0x5a')](function(){return db[_0x4494('0x5b')]['create'](_0x3ad850);});}})[_0x4494('0x35')](function(_0x17721d){return db['CmHopperAdditionalPhone'][_0x4494('0x42')]({'where':{'CmHopperId':_0x4a2d84}});})[_0x4494('0x35')](function(){return _0x102010[_0x4494('0x6')](0xcc)[_0x4494('0x5c')]();})[_0x4494('0x3a')](handleError(_0x102010,null));};exports[_0x4494('0x5d')]=function(_0x6a9289,_0x43583a){var _0x3a7d93=[];return db['CmContact'][_0x4494('0x41')]()['then'](function(_0x5ed118){_0x3a7d93=_[_0x4494('0x18')](_0x5ed118);return _0x6a9289[_0x4494('0x4d')]['getVoiceQueues']({'where':{'type':_0x4494('0x5e'),'dialActive':!![],'dialMethod':_0x4494('0x5f')},'attributes':['id',_0x4494('0x60'),_0x4494('0x61')],'raw':!![]});})[_0x4494('0x35')](function(_0x4e6f96){if(_0x4e6f96&&_0x4e6f96[_0x4494('0x2b')]){return db[_0x4494('0x62')][_0x4494('0x63')](function(_0x299b8c){var _0x457d76={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4494('0x4f')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x4e6f96,'id')},'$or':[{'UserId':null},{'UserId':_0x6a9289[_0x4494('0x4d')]['id']}]};var _0x3722d0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4e6f96)[_0x4494('0x31')]([_0x4494('0x61'),0x0])[_0x4494('0x16')]('id')[_0x4494('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x6a9289[_0x4494('0x4d')]['id']}]};var _0x15c6c1={'$or':[_0x457d76,_0x3722d0]};var _0xa85960=[];if(_0x6a9289[_0x4494('0x40')]['direction']&&_0x6a9289['body']['direction']===_0x4494('0x65')){if(!_[_0x4494('0x66')](_0x6a9289['body'][_0x4494('0x67')])){_0x15c6c1['id']={'$in':_0x6a9289[_0x4494('0x40')][_0x4494('0x67')]};}_0xa85960=[[_0x4494('0x68'),_0x4494('0x69')],[_0x4494('0x6a'),_0x4e6f96[0x0][_0x4494('0x60')]==='ASC'?_0x4494('0x6b'):_0x4494('0x69')],db[_0x4494('0x62')][_0x4494('0x6c')](_0x4494('0x6d')),['id',_0x4494('0x6b')]];}else{if(!_[_0x4494('0x66')](_0x6a9289[_0x4494('0x40')]['hopperIds'])){_0x15c6c1['id']={'$notIn':_0x6a9289[_0x4494('0x40')]['hopperIds']};}_0xa85960=[['priority',_0x4494('0x6b')],[_0x4494('0x6a'),_0x4e6f96[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x4494('0x6c')](_0x4494('0x6e')),['id','ASC']];}return db[_0x4494('0x11')][_0x4494('0x6f')]({'attributes':['id',_0x4494('0x70'),'phone','recallme'],'where':_0x15c6c1,'order':_0xa85960,'transaction':_0x299b8c,'lock':_0x299b8c['LOCK'][_0x4494('0x71')],'include':[{'model':db[_0x4494('0x55')],'as':_0x4494('0x72'),'attributes':_0x3a7d93,'include':[{'model':db[_0x4494('0x73')],'as':_0x4494('0x74'),'attributes':['id','name']}]},{'model':db[_0x4494('0x75')],'as':'List','attributes':['id','name']},{'model':db[_0x4494('0x44')],'as':'Queue','attributes':['id',_0x4494('0x10'),'dialActive']}]})[_0x4494('0x35')](function(_0x5d580e){if(_0x5d580e){return _0x5d580e['update']({'UserId':_0x6a9289['user']['id']},{'transaction':_0x299b8c});}});});}})['then'](handleEntityNotFound(_0x43583a,null))[_0x4494('0x35')](respondWithResult(_0x43583a,null))[_0x4494('0x3a')](handleError(_0x43583a,null));};exports[_0x4494('0x76')]=function(_0x3a7491,_0x3e7652,_0x19daf1){var _0x6131f6=[];var _0x46ec48=_0x3a7491[_0x4494('0x3c')]['id'];var _0x49dff9=_0x3a7491['user']['id'];return db['CmContact']['describe']()[_0x4494('0x35')](function(_0x38f28c){_0x6131f6=_[_0x4494('0x18')](_0x38f28c);return db['sequelize'][_0x4494('0x63')](function(_0x371baf){const _0x307bb9={'id':_0x46ec48};return db[_0x4494('0x11')][_0x4494('0x6f')]({'attributes':['id','scheduledat',_0x4494('0x77')],'where':_0x307bb9,'transaction':_0x371baf,'lock':_0x371baf[_0x4494('0x78')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x6131f6,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db[_0x4494('0x75')],'as':_0x4494('0x79'),'attributes':['id',_0x4494('0x10')]},{'model':db[_0x4494('0x44')],'as':_0x4494('0x7a'),'attributes':['id',_0x4494('0x10'),_0x4494('0x7b')]}]})['then'](function(_0x2a5a2b){if(_0x2a5a2b){return _0x2a5a2b['update']({'UserId':_0x49dff9},{'transaction':_0x371baf});}});});})[_0x4494('0x35')](handleEntityNotFound(_0x3e7652,null))[_0x4494('0x35')](respondWithResult(_0x3e7652,null))[_0x4494('0x3a')](handleError(_0x3e7652,null));};exports[_0x4494('0x7c')]=function(_0x1f18bf,_0x500858){return _0x1f18bf[_0x4494('0x4d')][_0x4494('0x7d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x4494('0x35')](function(_0xe0e497){if(_0xe0e497&&_0xe0e497[_0x4494('0x2b')]){return db[_0x4494('0x11')][_0x4494('0xb')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4494('0x4f')](_0x4494('0x50'))},'VoiceQueueId':{'$in':_[_0x4494('0x16')](_0xe0e497,'id')},'$or':[{'UserId':null},{'UserId':_0x1f18bf[_0x4494('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x1e9e8c){if(!_['isNil'](_0x1e9e8c)&&_[_0x4494('0x7e')](_0x1e9e8c)){return _0x500858[_0x4494('0x6')](0xc8)[_0x4494('0x7')]({'contacts':_0x1e9e8c});}else{logger['error'](_0x4494('0x7f'),'getOpenContacts',0x194,_0x4494('0x80'));_0x500858[_0x4494('0xe')](0x194);}})[_0x4494('0x3a')](handleError(_0x500858,null));};exports[_0x4494('0x81')]=function(_0x1796d1,_0x45b340){var _0x4875ee=shared[_0x4494('0x82')];var _0x1005e9=[];_['map'](_0x4875ee,function(_0x3a0787){_0x1005e9['push']({'id':_0x3a0787[_0x4494('0x10')],'name':_0x3a0787[_0x4494('0x10')],'utcOffset':_0x3a0787[_0x4494('0x83')]});});return _0x45b340[_0x4494('0x6')](0xc8)['json']({'tz':_0x1005e9});};exports[_0x4494('0x84')]=function(_0x4cc690,_0x360c65){var _0x1aa889=shared[_0x4494('0x82')];var _0xcc90e9={};if(!_[_0x4494('0x57')](_0x1aa889[_0x4cc690['body']['id']]))_0xcc90e9=_0x1aa889[_0x4cc690['body']['id']];return _0x360c65[_0x4494('0x6')](0xc8)[_0x4494('0x7')](_0xcc90e9);}; \ No newline at end of file +var _0x8a28=['set','Content-Range','update','then','error','stack','name','send','index','map','CmHopper','fieldName','model','query','keys','filters','intersection','concat','$or','$gt','$lte','$ne','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','destroy','VoiceQueueId','CampaignId','omit','dataValues','updatedAt','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','ASC','scheduledAt','literal','DESC','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','dialActive','getPreviewRecall','findOne','recallme','Queue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','push','utcOffset','getTimezone','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset'];(function(_0x5bfd2c,_0x470fe3){var _0x5724d1=function(_0x17dca2){while(--_0x17dca2){_0x5bfd2c['push'](_0x5bfd2c['shift']());}};_0x5724d1(++_0x470fe3);}(_0x8a28,0xfd));var _0x88a2=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x8a28[_0x25bea7];return _0x175952;};'use strict';var moment=require(_0x88a2('0x0'));var _=require(_0x88a2('0x1'));var qs=require(_0x88a2('0x2'));var logger=require(_0x88a2('0x3'))(_0x88a2('0x4'));var shared=require(_0x88a2('0x5'));var db=require(_0x88a2('0x6'))['db'];function respondWithResult(_0x3fc89d,_0x5d5b92){_0x5d5b92=_0x5d5b92||0xc8;return function(_0x2f482e){if(_0x2f482e){return _0x3fc89d[_0x88a2('0x7')](_0x5d5b92)[_0x88a2('0x8')](_0x2f482e);}};}function respondWithFilteredResult(_0x438e32,_0x29ce92){return function(_0x5cb591){if(_0x5cb591){var _0x1629ea=typeof _0x29ce92['offset']===_0x88a2('0x9')&&typeof _0x29ce92[_0x88a2('0xa')]===_0x88a2('0x9');var _0xdbb322=_0x5cb591[_0x88a2('0xb')];var _0x2d0fce=_0x1629ea?0x0:_0x29ce92[_0x88a2('0xc')];var _0x306a59=_0x1629ea?_0x5cb591[_0x88a2('0xb')]:_0x29ce92['offset']+_0x29ce92['limit'];var _0x854332;if(_0x306a59>=_0xdbb322){_0x306a59=_0xdbb322;_0x854332=0xc8;}else{_0x854332=0xce;}_0x438e32[_0x88a2('0x7')](_0x854332);return _0x438e32[_0x88a2('0xd')](_0x88a2('0xe'),_0x2d0fce+'-'+_0x306a59+'/'+_0xdbb322)[_0x88a2('0x8')](_0x5cb591);}return null;};}function saveUpdates(_0x4887fc,_0x210a52){return function(_0x1a4056){if(_0x1a4056){return _0x1a4056[_0x88a2('0xf')](_0x4887fc)[_0x88a2('0x10')](function(_0x5093c0){return _0x5093c0;});}return null;};}function handleEntityNotFound(_0x923706,_0x407ef0){return function(_0x3b83ce){if(!_0x3b83ce){_0x923706['sendStatus'](0x194);}return _0x3b83ce;};}function handleError(_0x34f19e,_0x207b12){_0x207b12=_0x207b12||0x1f4;return function(_0x462b7b){logger[_0x88a2('0x11')](_0x462b7b[_0x88a2('0x12')]);if(_0x462b7b[_0x88a2('0x13')]){delete _0x462b7b[_0x88a2('0x13')];}_0x34f19e[_0x88a2('0x7')](_0x207b12)[_0x88a2('0x14')](_0x462b7b);};}exports[_0x88a2('0x15')]=function(_0x235b75,_0x3c030e){var _0x188f6a={},_0x29dc1b={},_0x34d34a={'count':0x0,'rows':[]};var _0x162b5f=_[_0x88a2('0x16')](db[_0x88a2('0x17')]['rawAttributes'],function(_0x190aac){return{'name':_0x190aac[_0x88a2('0x18')],'type':_0x190aac['type']['key']};});_0x29dc1b[_0x88a2('0x19')]=_[_0x88a2('0x16')](_0x162b5f,_0x88a2('0x13'));_0x29dc1b[_0x88a2('0x1a')]=_[_0x88a2('0x1b')](_0x235b75['query']);_0x29dc1b[_0x88a2('0x1c')]=_[_0x88a2('0x1d')](_0x29dc1b[_0x88a2('0x19')],_0x29dc1b[_0x88a2('0x1a')]);_0x29dc1b['filters']=_[_0x88a2('0x1e')](_0x29dc1b['filters'],['$and',_0x88a2('0x1f'),_0x88a2('0x20'),'$gte','$lt',_0x88a2('0x21'),_0x88a2('0x22'),'$eq',_0x88a2('0x23'),_0x88a2('0x24'),_0x88a2('0x25'),_0x88a2('0x26'),'$notIn',_0x88a2('0x27'),'$notLike',_0x88a2('0x28'),_0x88a2('0x29'),_0x88a2('0x27'),'$overlap',_0x88a2('0x2a'),_0x88a2('0x2b'),'$any']);_0x188f6a[_0x88a2('0x2c')]=_[_0x88a2('0x1d')](_0x29dc1b['model'],qs['fields'](_0x235b75[_0x88a2('0x1a')][_0x88a2('0x2d')]));_0x188f6a[_0x88a2('0x2c')]=_0x188f6a[_0x88a2('0x2c')][_0x88a2('0x2e')]?_0x188f6a[_0x88a2('0x2c')]:_0x29dc1b['model'];if(!_0x235b75[_0x88a2('0x1a')][_0x88a2('0x2f')](_0x88a2('0x30'))){_0x188f6a[_0x88a2('0xa')]=qs[_0x88a2('0xa')](_0x235b75[_0x88a2('0x1a')][_0x88a2('0xa')]);_0x188f6a[_0x88a2('0xc')]=qs[_0x88a2('0xc')](_0x235b75[_0x88a2('0x1a')]['offset']);}_0x188f6a['order']=qs[_0x88a2('0x31')](_0x235b75[_0x88a2('0x1a')][_0x88a2('0x31')]);_0x188f6a['where']=qs[_0x88a2('0x1c')](_[_0x88a2('0x32')](_0x235b75['query'],_0x29dc1b[_0x88a2('0x1c')]),_0x162b5f);if(_0x235b75[_0x88a2('0x1a')][_0x88a2('0x33')]){_0x188f6a['where']=_['merge'](_0x188f6a[_0x88a2('0x34')],{'$or':_[_0x88a2('0x16')](_0x162b5f,function(_0x4cb19f){if(_0x4cb19f[_0x88a2('0x35')]!==_0x88a2('0x36')){var _0x327a80={};_0x327a80[_0x4cb19f[_0x88a2('0x13')]]={'$like':'%'+_0x235b75[_0x88a2('0x1a')][_0x88a2('0x33')]+'%'};return _0x327a80;}})});}_0x188f6a=_[_0x88a2('0x37')]({},_0x188f6a,_0x235b75[_0x88a2('0x38')]);var _0x4fdacc={'where':_0x188f6a[_0x88a2('0x34')]};return db[_0x88a2('0x17')]['count'](_0x4fdacc)[_0x88a2('0x10')](function(_0x38cc76){_0x34d34a[_0x88a2('0xb')]=_0x38cc76;if(_0x235b75[_0x88a2('0x1a')][_0x88a2('0x39')]){_0x188f6a[_0x88a2('0x3a')]=[{'all':!![]}];}return db[_0x88a2('0x17')][_0x88a2('0x3b')](_0x188f6a);})[_0x88a2('0x10')](function(_0x1fa0c6){_0x34d34a[_0x88a2('0x3c')]=_0x1fa0c6;return _0x34d34a;})[_0x88a2('0x10')](respondWithFilteredResult(_0x3c030e,_0x188f6a))[_0x88a2('0x3d')](handleError(_0x3c030e,null));};exports[_0x88a2('0x3e')]=function(_0x42b8f7,_0xb21338){var _0x1496d9={'raw':!![],'where':{'id':_0x42b8f7[_0x88a2('0x3f')]['id']}},_0x23cdc2={};_0x23cdc2[_0x88a2('0x19')]=_[_0x88a2('0x1b')](db[_0x88a2('0x17')][_0x88a2('0x40')]);_0x23cdc2[_0x88a2('0x1a')]=_[_0x88a2('0x1b')](_0x42b8f7['query']);_0x23cdc2['filters']=_[_0x88a2('0x1d')](_0x23cdc2[_0x88a2('0x19')],_0x23cdc2['query']);_0x1496d9[_0x88a2('0x2c')]=_[_0x88a2('0x1d')](_0x23cdc2[_0x88a2('0x19')],qs[_0x88a2('0x2d')](_0x42b8f7[_0x88a2('0x1a')][_0x88a2('0x2d')]));_0x1496d9['attributes']=_0x1496d9[_0x88a2('0x2c')][_0x88a2('0x2e')]?_0x1496d9[_0x88a2('0x2c')]:_0x23cdc2['model'];if(_0x42b8f7[_0x88a2('0x1a')][_0x88a2('0x39')]){_0x1496d9[_0x88a2('0x3a')]=[{'all':!![]}];}_0x1496d9=_[_0x88a2('0x37')]({},_0x1496d9,_0x42b8f7['options']);return db[_0x88a2('0x17')][_0x88a2('0x41')](_0x1496d9)[_0x88a2('0x10')](handleEntityNotFound(_0xb21338,null))[_0x88a2('0x10')](respondWithResult(_0xb21338,null))[_0x88a2('0x3d')](handleError(_0xb21338,null));};exports[_0x88a2('0x42')]=function(_0x682411,_0x363475){return db[_0x88a2('0x17')][_0x88a2('0x42')](_0x682411[_0x88a2('0x43')],{})[_0x88a2('0x10')](respondWithResult(_0x363475,0xc9))[_0x88a2('0x3d')](handleError(_0x363475,null));};exports[_0x88a2('0xf')]=function(_0xe8d957,_0x9ef5ac){if(_0xe8d957[_0x88a2('0x43')]['id']){delete _0xe8d957[_0x88a2('0x43')]['id'];}return db[_0x88a2('0x17')][_0x88a2('0x41')]({'where':{'id':_0xe8d957['params']['id']}})[_0x88a2('0x10')](handleEntityNotFound(_0x9ef5ac,null))['then'](saveUpdates(_0xe8d957[_0x88a2('0x43')],null))['then'](respondWithResult(_0x9ef5ac,null))[_0x88a2('0x3d')](handleError(_0x9ef5ac,null));};exports[_0x88a2('0x44')]=function(_0x1c5e6b,_0x37319d){return db[_0x88a2('0x17')][_0x88a2('0x44')]()[_0x88a2('0x10')](respondWithResult(_0x37319d,null))[_0x88a2('0x3d')](handleError(_0x37319d,null));};exports['destroy']=function(_0x1d773c,_0x1cc256){var _0x5b1f66;var _0x341e08=_0x1d773c['params']['id'];return db[_0x88a2('0x17')]['find']({'where':{'id':_0x1d773c[_0x88a2('0x3f')]['id']}})[_0x88a2('0x10')](handleEntityNotFound(_0x1cc256,null))[_0x88a2('0x10')](function(_0x18dae2){if(_0x18dae2){return _0x18dae2[_0x88a2('0x45')]()[_0x88a2('0x10')](function(_0x39bffe){return _0x39bffe;});}})[_0x88a2('0x10')](function(_0x2cf43b){_0x5b1f66=_0x2cf43b;if(_0x2cf43b){if(_0x2cf43b[_0x88a2('0x46')]||_0x2cf43b[_0x88a2('0x47')]){return db[_0x2cf43b[_0x88a2('0x46')]?'VoiceQueue':'Campaign'][_0x88a2('0x41')]({'where':{'id':_0x2cf43b[_0x88a2('0x46')]?_0x2cf43b[_0x88a2('0x46')]:_0x2cf43b[_0x88a2('0x47')]},'attributes':['id',_0x88a2('0x13')],'raw':!![]});}}})['then'](function(_0x2bc03d){var _0x4793ee={};if(_0x2bc03d){_['merge'](_0x4793ee,_[_0x88a2('0x48')](_0x5b1f66[_0x88a2('0x49')],['createdAt',_0x88a2('0x4a'),'id']));_0x4793ee['state']=0x15;_0x4793ee[_0x88a2('0x4b')]=_0x88a2('0x4c');_0x4793ee[_0x88a2('0x4d')]=_0x2bc03d[_0x88a2('0x13')];_0x4793ee[_0x88a2('0x4e')]=_0x1d773c[_0x88a2('0x4f')]['name'];_0x4793ee[_0x88a2('0x50')]=_0x1d773c[_0x88a2('0x4f')]['id'];_0x4793ee[_0x88a2('0x4c')]=!![];_0x4793ee['deletedat']=moment()[_0x88a2('0x51')](_0x88a2('0x52'));_0x4793ee['calleridnum']=_0x5b1f66[_0x88a2('0x53')];_0x4793ee[_0x88a2('0x54')]=_0x5b1f66['VoiceQueueId']?'queue':_0x88a2('0x55');return db[_0x88a2('0x56')]['find']({'where':{'id':_0x4793ee[_0x88a2('0x57')]},'attributes':[_0x88a2('0x58'),_0x88a2('0x59')]})[_0x88a2('0x10')](function(_0xa62fec){if(!_[_0x88a2('0x5a')](_0x1cc256)&&!_[_0x88a2('0x5a')](_0xa62fec['firstName'])){_0x4793ee[_0x88a2('0x5b')]=_0xa62fec[_0x88a2('0x58')];if(!_[_0x88a2('0x5a')](_0xa62fec['lastName'])){_0x4793ee['calleridname']+='\x20'+_0xa62fec['lastName'];}}})[_0x88a2('0x5c')](function(){return db[_0x88a2('0x5d')][_0x88a2('0x42')](_0x4793ee);});}})['then'](function(_0x3aba26){return db[_0x88a2('0x5e')][_0x88a2('0x45')]({'where':{'CmHopperId':_0x341e08}});})[_0x88a2('0x10')](function(){return _0x1cc256[_0x88a2('0x7')](0xcc)[_0x88a2('0x5f')]();})['catch'](handleError(_0x1cc256,null));};exports['getPreview']=function(_0x29371a,_0x5599d1){var _0x4d4411=[];return db[_0x88a2('0x56')][_0x88a2('0x44')]()[_0x88a2('0x10')](function(_0x291f1f){_0x4d4411=_[_0x88a2('0x1b')](_0x291f1f);return _0x29371a['user']['getVoiceQueues']({'where':{'type':_0x88a2('0x60'),'dialActive':!![],'dialMethod':_0x88a2('0x61')},'attributes':['id',_0x88a2('0x62'),_0x88a2('0x63')],'raw':!![]});})[_0x88a2('0x10')](function(_0xb99aaa){if(_0xb99aaa&&_0xb99aaa[_0x88a2('0x2e')]){return db[_0x88a2('0x64')][_0x88a2('0x65')](function(_0x485489){var _0x541172={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x88a2('0x51')](_0x88a2('0x52'))},'VoiceQueueId':{'$in':_['map'](_0xb99aaa,'id')},'$or':[{'UserId':null},{'UserId':_0x29371a['user']['id']}]};var _0x5e538c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xb99aaa)[_0x88a2('0x33')]([_0x88a2('0x63'),0x0])[_0x88a2('0x16')]('id')[_0x88a2('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x29371a['user']['id']}]};var _0x203e60={'$or':[_0x541172,_0x5e538c]};var _0x3b76bf=[];if(_0x29371a[_0x88a2('0x43')][_0x88a2('0x67')]&&_0x29371a[_0x88a2('0x43')][_0x88a2('0x67')]===_0x88a2('0x68')){if(!_['isEmpty'](_0x29371a['body'][_0x88a2('0x69')])){_0x203e60['id']={'$in':_0x29371a['body']['hopperIds']};}_0x3b76bf=[[_0x88a2('0x6a'),_0x88a2('0x6b')],[_0x88a2('0x6c'),_0xb99aaa[0x0][_0x88a2('0x62')]===_0x88a2('0x6b')?'DESC':_0x88a2('0x6b')],db['sequelize'][_0x88a2('0x6d')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x88a2('0x6e')]];}else{if(!_['isEmpty'](_0x29371a[_0x88a2('0x43')][_0x88a2('0x69')])){_0x203e60['id']={'$notIn':_0x29371a[_0x88a2('0x43')][_0x88a2('0x69')]};}_0x3b76bf=[[_0x88a2('0x6a'),_0x88a2('0x6e')],[_0x88a2('0x6c'),_0xb99aaa[0x0][_0x88a2('0x62')]],db[_0x88a2('0x64')][_0x88a2('0x6d')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x88a2('0x6b')]];}return db[_0x88a2('0x17')]['findOne']({'attributes':['id',_0x88a2('0x6f'),'phone','recallme'],'where':_0x203e60,'order':_0x3b76bf,'transaction':_0x485489,'lock':_0x485489[_0x88a2('0x70')][_0x88a2('0x71')],'include':[{'model':db[_0x88a2('0x56')],'as':_0x88a2('0x72'),'attributes':_0x4d4411,'include':[{'model':db[_0x88a2('0x73')],'as':_0x88a2('0x74'),'attributes':['id','name']}]},{'model':db[_0x88a2('0x75')],'as':_0x88a2('0x76'),'attributes':['id',_0x88a2('0x13')]},{'model':db[_0x88a2('0x77')],'as':'Queue','attributes':['id','name',_0x88a2('0x78')]}]})[_0x88a2('0x10')](function(_0x585409){if(_0x585409){return _0x585409[_0x88a2('0xf')]({'UserId':_0x29371a[_0x88a2('0x4f')]['id']},{'transaction':_0x485489});}});});}})[_0x88a2('0x10')](handleEntityNotFound(_0x5599d1,null))[_0x88a2('0x10')](respondWithResult(_0x5599d1,null))['catch'](handleError(_0x5599d1,null));};exports[_0x88a2('0x79')]=function(_0x14c831,_0x1db40c,_0x1350b2){var _0x54b65d=[];var _0x3c8f98=_0x14c831['params']['id'];var _0x149f0e=_0x14c831[_0x88a2('0x4f')]['id'];return db[_0x88a2('0x56')]['describe']()[_0x88a2('0x10')](function(_0x381ea4){_0x54b65d=_['keys'](_0x381ea4);return db[_0x88a2('0x64')][_0x88a2('0x65')](function(_0x1bf412){const _0xf9f243={'id':_0x3c8f98};return db[_0x88a2('0x17')][_0x88a2('0x7a')]({'attributes':['id',_0x88a2('0x6f'),_0x88a2('0x7b')],'where':_0xf9f243,'transaction':_0x1bf412,'lock':_0x1bf412['LOCK'][_0x88a2('0x71')],'include':[{'model':db[_0x88a2('0x56')],'as':_0x88a2('0x72'),'attributes':_0x54b65d,'include':[{'model':db[_0x88a2('0x73')],'as':'Company','attributes':['id',_0x88a2('0x13')]}]},{'model':db[_0x88a2('0x75')],'as':_0x88a2('0x76'),'attributes':['id',_0x88a2('0x13')]},{'model':db[_0x88a2('0x77')],'as':_0x88a2('0x7c'),'attributes':['id',_0x88a2('0x13'),_0x88a2('0x78')]}]})[_0x88a2('0x10')](function(_0xcb1375){if(_0xcb1375){return _0xcb1375['update']({'UserId':_0x149f0e},{'transaction':_0x1bf412});}});});})[_0x88a2('0x10')](handleEntityNotFound(_0x1db40c,null))[_0x88a2('0x10')](respondWithResult(_0x1db40c,null))[_0x88a2('0x3d')](handleError(_0x1db40c,null));};exports[_0x88a2('0x7d')]=function(_0x9d26d1,_0xc3c2f2){return _0x9d26d1[_0x88a2('0x4f')]['getVoiceQueues']({'where':{'type':_0x88a2('0x60'),'dialActive':!![],'dialMethod':_0x88a2('0x61')},'attributes':['id'],'raw':!![]})['then'](function(_0x1f1824){if(_0x1f1824&&_0x1f1824[_0x88a2('0x2e')]){return db['CmHopper'][_0x88a2('0xb')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x88a2('0x51')](_0x88a2('0x52'))},'VoiceQueueId':{'$in':_[_0x88a2('0x16')](_0x1f1824,'id')},'$or':[{'UserId':null},{'UserId':_0x9d26d1[_0x88a2('0x4f')]['id']}]}});}return 0x0;})['then'](function(_0x5abf8c){if(!_['isNil'](_0x5abf8c)&&_[_0x88a2('0x7e')](_0x5abf8c)){return _0xc3c2f2[_0x88a2('0x7')](0xc8)[_0x88a2('0x8')]({'contacts':_0x5abf8c});}else{logger[_0x88a2('0x11')](_0x88a2('0x7f'),_0x88a2('0x7d'),0x194,_0x88a2('0x80'));_0xc3c2f2['sendStatus'](0x194);}})[_0x88a2('0x3d')](handleError(_0xc3c2f2,null));};exports['getTimezones']=function(_0x912355,_0x5abbd9){var _0x1430ef=shared['timezones'];var _0x526b5a=[];_[_0x88a2('0x16')](_0x1430ef,function(_0x4d9afd){_0x526b5a[_0x88a2('0x81')]({'id':_0x4d9afd['name'],'name':_0x4d9afd[_0x88a2('0x13')],'utcOffset':_0x4d9afd[_0x88a2('0x82')]});});return _0x5abbd9[_0x88a2('0x7')](0xc8)['json']({'tz':_0x526b5a});};exports[_0x88a2('0x83')]=function(_0x4612b5,_0x5212aa){var _0x392317=shared[_0x88a2('0x84')];var _0x24c54a={};if(!_[_0x88a2('0x5a')](_0x392317[_0x4612b5['body']['id']]))_0x24c54a=_0x392317[_0x4612b5[_0x88a2('0x43')]['id']];return _0x5212aa[_0x88a2('0x7')](0xc8)['json'](_0x24c54a);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 47a7cbf..1b0c4cf 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 _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x185de4,_0x3b15ff){var _0x3b4596=function(_0x31ab71){while(--_0x31ab71){_0x185de4['push'](_0x185de4['shift']());}};_0x3b4596(++_0x3b15ff);}(_0xafc4,0x69));var _0x4afc=function(_0xee4dbb,_0x375618){_0xee4dbb=_0xee4dbb-0x0;var _0x191642=_0xafc4[_0xee4dbb];return _0x191642;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x4afc('0xa')]},{'name':_0x4afc('0xb'),'fields':[_0x4afc('0xb')]},{'name':_0x4afc('0xc'),'fields':[_0x4afc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x90b1,0x1bb));var _0x190b=function(_0x21964f,_0x242993){_0x21964f=_0x21964f-0x0;var _0x6f2a30=_0x90b1[_0x21964f];return _0x6f2a30;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 1eaa8a3..a200e3e 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 _0x0b0a=['findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','map','include','model','attributes','debug','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','limit','active','DestroyCmHopper','GetContactDialer','CmContact','transaction','order','Contact','keys','User','Agent','name','voicePause','push','includes','all','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','sequelize','COUNT','literal','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','UPDATE','length','GetCmHopperPreview','GetContactByPhone'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b0a,0x1c7));var _0xa0b0=function(_0x141c01,_0x1556f0){_0x141c01=_0x141c01-0x0;var _0x49e963=_0x0b0a[_0x141c01];return _0x49e963;};'use strict';var _=require(_0xa0b0('0x0'));var util=require(_0xa0b0('0x1'));var moment=require(_0xa0b0('0x2'));var BPromise=require(_0xa0b0('0x3'));var db=require(_0xa0b0('0x4'))['db'];var logger=require(_0xa0b0('0x5'))('rpc');var jayson=require(_0xa0b0('0x6'));var client=jayson['client'][_0xa0b0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x27a5d6,_0x19f036,_0x3105c1){return new BPromise(function(_0x21bb42,_0x246b2b){return client[_0xa0b0('0x8')](_0x27a5d6,_0x3105c1)[_0xa0b0('0x9')](function(_0x4bf19e){logger[_0xa0b0('0xa')](_0xa0b0('0xb'),_0x19f036,'request\x20sent');logger['debug'](_0xa0b0('0xc'),_0x19f036,_0xa0b0('0xd'),JSON[_0xa0b0('0xe')](_0x4bf19e));if(_0x4bf19e[_0xa0b0('0xf')]){if(_0x4bf19e[_0xa0b0('0xf')][_0xa0b0('0x10')]===0x1f4){logger[_0xa0b0('0xf')](_0xa0b0('0xb'),_0x19f036,_0x4bf19e[_0xa0b0('0xf')][_0xa0b0('0x11')]);return _0x246b2b(_0x4bf19e[_0xa0b0('0xf')]['message']);}logger[_0xa0b0('0xf')](_0xa0b0('0xb'),_0x19f036,_0x4bf19e[_0xa0b0('0xf')][_0xa0b0('0x11')]);return _0x21bb42(_0x4bf19e[_0xa0b0('0xf')][_0xa0b0('0x11')]);}else{logger[_0xa0b0('0xa')](_0xa0b0('0xb'),_0x19f036,_0xa0b0('0xd'));_0x21bb42(_0x4bf19e['result']['message']);}})[_0xa0b0('0x12')](function(_0x4c2edb){logger[_0xa0b0('0xf')]('CmHopper,\x20%s,\x20%s',_0x19f036,_0x4c2edb);_0x246b2b(_0x4c2edb);});});}exports[_0xa0b0('0x13')]=function(_0x3fb223){var _0x4974a0=this;return new Promise(function(_0x54e326,_0x214292){return db[_0xa0b0('0x14')][_0xa0b0('0x15')]({'raw':_0x3fb223[_0xa0b0('0x16')]?_0x3fb223[_0xa0b0('0x16')][_0xa0b0('0x17')]===undefined?!![]:![]:!![],'where':_0x3fb223[_0xa0b0('0x16')]?_0x3fb223[_0xa0b0('0x16')][_0xa0b0('0x18')]||null:null,'attributes':_0x3fb223[_0xa0b0('0x16')]?_0x3fb223[_0xa0b0('0x16')]['attributes']||null:null,'limit':_0x3fb223[_0xa0b0('0x16')]?_0x3fb223[_0xa0b0('0x16')]['limit']||null:null,'include':_0x3fb223['options']?_0x3fb223[_0xa0b0('0x16')]['include']?_[_0xa0b0('0x19')](_0x3fb223[_0xa0b0('0x16')][_0xa0b0('0x1a')],function(_0x180c5c){return{'model':db[_0x180c5c[_0xa0b0('0x1b')]],'as':_0x180c5c['as'],'attributes':_0x180c5c[_0xa0b0('0x1c')],'include':_0x180c5c[_0xa0b0('0x1a')]?_[_0xa0b0('0x19')](_0x180c5c[_0xa0b0('0x1a')],function(_0x42532c){return{'model':db[_0x42532c[_0xa0b0('0x1b')]],'as':_0x42532c['as'],'attributes':_0x42532c[_0xa0b0('0x1c')],'include':_0x42532c[_0xa0b0('0x1a')]?_[_0xa0b0('0x19')](_0x42532c[_0xa0b0('0x1a')],function(_0x38de9e){return{'model':db[_0x38de9e[_0xa0b0('0x1b')]],'as':_0x38de9e['as'],'attributes':_0x38de9e['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0b0('0x9')](function(_0x30f8cb){logger['info']('GetCmHopper',_0x3fb223);logger[_0xa0b0('0x1d')]('GetCmHopper',_0x3fb223,JSON[_0xa0b0('0xe')](_0x30f8cb));_0x54e326(_0x30f8cb);})[_0xa0b0('0x12')](function(_0x318049){logger[_0xa0b0('0xf')](_0xa0b0('0x13'),_0x318049[_0xa0b0('0x11')],_0x3fb223);_0x214292(_0x4974a0[_0xa0b0('0xf')](0x1f4,_0x318049[_0xa0b0('0x11')]));});});};exports['ShowCmHopper']=function(_0x7c1544){var _0x4f047e=this;return new Promise(function(_0x3732cb,_0x41c945){return db[_0xa0b0('0x14')]['find']({'raw':_0x7c1544['options']?_0x7c1544['options'][_0xa0b0('0x17')]===undefined?!![]:![]:!![],'where':_0x7c1544['options']?_0x7c1544[_0xa0b0('0x16')][_0xa0b0('0x18')]||null:null,'attributes':_0x7c1544[_0xa0b0('0x16')]?_0x7c1544[_0xa0b0('0x16')][_0xa0b0('0x1c')]||null:null,'include':_0x7c1544['options']?_0x7c1544[_0xa0b0('0x16')][_0xa0b0('0x1a')]?_[_0xa0b0('0x19')](_0x7c1544[_0xa0b0('0x16')]['include'],function(_0x26038d){return{'model':db[_0x26038d[_0xa0b0('0x1b')]],'as':_0x26038d['as'],'attributes':_0x26038d[_0xa0b0('0x1c')],'include':_0x26038d[_0xa0b0('0x1a')]?_[_0xa0b0('0x19')](_0x26038d[_0xa0b0('0x1a')],function(_0x33bf0d){return{'model':db[_0x33bf0d[_0xa0b0('0x1b')]],'as':_0x33bf0d['as'],'attributes':_0x33bf0d[_0xa0b0('0x1c')],'include':_0x33bf0d[_0xa0b0('0x1a')]?_[_0xa0b0('0x19')](_0x33bf0d[_0xa0b0('0x1a')],function(_0x2b0889){return{'model':db[_0x2b0889[_0xa0b0('0x1b')]],'as':_0x2b0889['as'],'attributes':_0x2b0889['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0b0('0x9')](function(_0x57f486){logger['info'](_0xa0b0('0x1e'),_0x7c1544);logger['debug'](_0xa0b0('0x1e'),_0x7c1544,JSON['stringify'](_0x57f486));_0x3732cb(_0x57f486);})['catch'](function(_0x6cfcbd){logger[_0xa0b0('0xf')]('ShowCmHopper',_0x6cfcbd[_0xa0b0('0x11')],_0x7c1544);_0x41c945(_0x4f047e[_0xa0b0('0xf')](0x1f4,_0x6cfcbd[_0xa0b0('0x11')]));});});};exports[_0xa0b0('0x1f')]=function(_0x4407ca){var _0x6a7d92=this;return new Promise(function(_0xc870f6,_0x183299){return db[_0xa0b0('0x14')][_0xa0b0('0x20')](_0x4407ca[_0xa0b0('0x21')],{'raw':_0x4407ca[_0xa0b0('0x16')]?_0x4407ca[_0xa0b0('0x16')][_0xa0b0('0x17')]===undefined?!![]:![]:!![]})[_0xa0b0('0x9')](function(_0x214559){logger[_0xa0b0('0xa')]('CreateCmHopper',_0x4407ca);logger[_0xa0b0('0x1d')](_0xa0b0('0x1f'),_0x4407ca,JSON[_0xa0b0('0xe')](_0x214559));_0xc870f6(_0x214559);})[_0xa0b0('0x12')](function(_0x1dfdd7){logger[_0xa0b0('0xf')](_0xa0b0('0x1f'),_0x1dfdd7['message'],_0x4407ca);_0x183299(_0x6a7d92[_0xa0b0('0xf')](0x1f4,_0x1dfdd7['message']));});});};exports[_0xa0b0('0x22')]=function(_0x25f883){var _0x1adc16=this;return new Promise(function(_0x4efef2,_0x31a865){return db[_0xa0b0('0x14')][_0xa0b0('0x23')](_0x25f883[_0xa0b0('0x21')],{'raw':_0x25f883[_0xa0b0('0x16')]?_0x25f883['options'][_0xa0b0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25f883[_0xa0b0('0x16')]?_0x25f883[_0xa0b0('0x16')][_0xa0b0('0x18')]||null:null,'attributes':_0x25f883[_0xa0b0('0x16')]?_0x25f883[_0xa0b0('0x16')][_0xa0b0('0x1c')]||null:null,'limit':_0x25f883['options']?_0x25f883['options'][_0xa0b0('0x24')]||null:null})[_0xa0b0('0x9')](function(_0x4597dd){logger[_0xa0b0('0xa')](_0xa0b0('0x22'),_0x25f883);logger[_0xa0b0('0xa')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x25f883['options'][_0xa0b0('0x18')]),_0x25f883[_0xa0b0('0x21')][_0xa0b0('0x25')]);logger[_0xa0b0('0x1d')]('UpdateCmHopper',_0x25f883,JSON[_0xa0b0('0xe')](_0x4597dd));_0x4efef2(_0x4597dd);})['catch'](function(_0x36a36f){logger[_0xa0b0('0xf')](_0xa0b0('0x22'),_0x36a36f[_0xa0b0('0x11')],_0x25f883);_0x31a865(_0x1adc16[_0xa0b0('0xf')](0x1f4,_0x36a36f[_0xa0b0('0x11')]));});});};exports[_0xa0b0('0x26')]=function(_0x73e616){var _0xc2f51b=this;return new Promise(function(_0x22084f,_0x6eabf0){return db[_0xa0b0('0x14')]['destroy']({'where':_0x73e616[_0xa0b0('0x16')]?_0x73e616['options'][_0xa0b0('0x18')]||null:null})['then'](function(_0x622be1){logger['info'](_0xa0b0('0x26'),_0x73e616);logger['debug'](_0xa0b0('0x26'),_0x73e616,JSON[_0xa0b0('0xe')](_0x622be1));_0x22084f(_0x622be1);})['catch'](function(_0x28cfeb){logger[_0xa0b0('0xf')](_0xa0b0('0x26'),_0x28cfeb[_0xa0b0('0x11')],_0x73e616);_0x6eabf0(_0xc2f51b[_0xa0b0('0xf')](0x1f4,_0x28cfeb[_0xa0b0('0x11')]));});});};exports[_0xa0b0('0x27')]=function(_0x40f833){var _0x51194a=this;return new Promise(function(_0x51f031,_0x39113e){return db[_0xa0b0('0x28')]['describe']()[_0xa0b0('0x9')](function(_0x2d5246){return db['sequelize'][_0xa0b0('0x29')](function(_0x5111d1){return db[_0xa0b0('0x14')][_0xa0b0('0x15')]({'where':_0x40f833[_0xa0b0('0x16')]?_0x40f833[_0xa0b0('0x16')][_0xa0b0('0x18')]||null:null,'attributes':_0x40f833[_0xa0b0('0x16')]?_0x40f833[_0xa0b0('0x16')][_0xa0b0('0x1c')]||null:null,'limit':_0x40f833[_0xa0b0('0x16')]?_0x40f833[_0xa0b0('0x16')][_0xa0b0('0x24')]||null:null,'order':_0x40f833[_0xa0b0('0x16')]?_0x40f833[_0xa0b0('0x16')][_0xa0b0('0x2a')]||null:null,'transaction':_0x5111d1,'lock':_0x5111d1['LOCK']['UPDATE'],'include':[{'model':db[_0xa0b0('0x28')],'as':_0xa0b0('0x2b'),'attributes':_[_0xa0b0('0x2c')](_0x2d5246)},{'model':db[_0xa0b0('0x2d')],'as':_0xa0b0('0x2e'),'attributes':['id',_0xa0b0('0x2f'),_0xa0b0('0x30')]}]})[_0xa0b0('0x9')](function(_0x22fe7b){var _0x4ce7eb=[];var _0x4cf9c0=[];for(var _0x2df3d2=0x0;_0x2df3d2<_0x22fe7b['length'];_0x2df3d2+=0x1){var _0x333a67=_0x22fe7b[_0x2df3d2]['UserId'];if(_0x333a67===null){_0x4ce7eb[_0xa0b0('0x31')](_0x22fe7b[_0x2df3d2]['update'](_0x40f833['body'],{'transaction':_0x5111d1}));}else if(!_0x4cf9c0[_0xa0b0('0x32')](_0x333a67)){_0x4cf9c0[_0xa0b0('0x31')](_0x333a67);_0x4ce7eb[_0xa0b0('0x31')](_0x22fe7b[_0x2df3d2][_0xa0b0('0x23')](_0x40f833[_0xa0b0('0x21')],{'transaction':_0x5111d1}));}}return BPromise[_0xa0b0('0x33')](_0x4ce7eb);});})['then'](function(_0x122dce){logger[_0xa0b0('0xa')]('GetContactDialer',_0x40f833);if(_0x122dce['length']>0x0){logger[_0xa0b0('0xa')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x122dce[0x0][_0xa0b0('0x34')]['id'],_0x122dce[0x0]['dataValues'][_0xa0b0('0x35')],_0x122dce[0x0][_0xa0b0('0x34')][_0xa0b0('0x25')]);}logger[_0xa0b0('0x1d')](_0xa0b0('0x27'),_0x40f833,JSON[_0xa0b0('0xe')](_0x122dce));_0x51f031(_0x122dce);})[_0xa0b0('0x12')](function(_0x770542){logger[_0xa0b0('0xf')](_0xa0b0('0x27'),_0x770542[_0xa0b0('0x11')],_0x40f833);_0x39113e(_0x51194a[_0xa0b0('0xf')](0x1f4,_0x770542[_0xa0b0('0x11')]));});});});};exports[_0xa0b0('0x36')]=function(_0x16358a){var _0x7cfdfc=this;return new Promise(function(_0x5827d7,_0x2cd484){return db['sequelize'][_0xa0b0('0x29')](function(_0x1f2353){return db[_0xa0b0('0x37')]['create'](_0x16358a[_0xa0b0('0x21')],{'raw':_0x16358a['options']?_0x16358a[_0xa0b0('0x16')][_0xa0b0('0x17')]===undefined?!![]:![]:!![],'transaction':_0x1f2353})[_0xa0b0('0x9')](function(){logger[_0xa0b0('0xa')](_0xa0b0('0x38'),JSON[_0xa0b0('0xe')](_0x16358a[_0xa0b0('0x16')][_0xa0b0('0x18')]),_0x16358a['options'][_0xa0b0('0x18')][_0xa0b0('0x25')]);return db[_0xa0b0('0x14')][_0xa0b0('0x39')]({'where':_0x16358a[_0xa0b0('0x16')]?_0x16358a[_0xa0b0('0x16')][_0xa0b0('0x18')]||null:null,'transaction':_0x1f2353});});})[_0xa0b0('0x9')](function(_0x28eb3c){logger['info']('MoveContactManagedDialer',_0x16358a);logger['debug'](_0xa0b0('0x36'),_0x16358a,JSON[_0xa0b0('0xe')](_0x28eb3c));_0x5827d7(_0x28eb3c);})[_0xa0b0('0x12')](function(_0x275f1c){logger[_0xa0b0('0xf')](_0xa0b0('0x36'),_0x275f1c[_0xa0b0('0x11')],_0x16358a);_0x2cd484(_0x7cfdfc[_0xa0b0('0xf')](0x1f4,_0x275f1c[_0xa0b0('0x11')]));});});};exports[_0xa0b0('0x3a')]=function(_0x4c9536){var _0x4c8916=this;return new Promise(function(_0x352702,_0x56e9d4){return db[_0xa0b0('0x14')][_0xa0b0('0x15')]({'raw':_0x4c9536['options']?_0x4c9536[_0xa0b0('0x16')][_0xa0b0('0x17')]===undefined?!![]:![]:!![],'where':_0x4c9536[_0xa0b0('0x16')]?_0x4c9536[_0xa0b0('0x16')][_0xa0b0('0x18')]||null:null,'attributes':[[db[_0xa0b0('0x3b')]['fn'](_0xa0b0('0x3c'),db[_0xa0b0('0x3b')]['fn']('IF',db[_0xa0b0('0x3b')][_0xa0b0('0x3d')]('`scheduledat`\x20>=\x20'+util['format'](_0xa0b0('0x3e'),moment()[_0xa0b0('0x3f')](_0xa0b0('0x40')))+_0xa0b0('0x41')))),_0xa0b0('0x42')]]})[_0xa0b0('0x9')](function(_0x1e0043){logger[_0xa0b0('0xa')](_0xa0b0('0x3a'),_0x4c9536);logger[_0xa0b0('0x1d')](_0xa0b0('0x3a'),_0x4c9536,JSON[_0xa0b0('0xe')](_0x1e0043));_0x352702(_0x1e0043);})[_0xa0b0('0x12')](function(_0x5af540){logger[_0xa0b0('0xf')](_0xa0b0('0x3a'),_0x5af540['message'],_0x4c9536);_0x56e9d4(_0x4c8916[_0xa0b0('0xf')](0x1f4,_0x5af540[_0xa0b0('0x11')]));});});};exports[_0xa0b0('0x43')]=function(_0x51405b){var _0x5e1ceb=this;return new Promise(function(_0x25dbbf,_0xf897be){return db[_0xa0b0('0x28')][_0xa0b0('0x44')]()[_0xa0b0('0x9')](function(_0x1660a4){return db[_0xa0b0('0x3b')][_0xa0b0('0x29')](function(_0x4f24e7){return db[_0xa0b0('0x14')][_0xa0b0('0x15')]({'where':_0x51405b[_0xa0b0('0x16')]?_0x51405b['options'][_0xa0b0('0x18')]||null:null,'attributes':_0x51405b[_0xa0b0('0x16')]?_0x51405b[_0xa0b0('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x51405b[_0xa0b0('0x16')]?_0x51405b[_0xa0b0('0x16')][_0xa0b0('0x2a')]||null:null,'group':db[_0xa0b0('0x14')]['UserId'],'transaction':_0x4f24e7,'lock':_0x4f24e7['LOCK'][_0xa0b0('0x45')],'include':_0x51405b[_0xa0b0('0x16')]?_0x51405b['options'][_0xa0b0('0x1a')]?_['map'](_0x51405b[_0xa0b0('0x16')][_0xa0b0('0x1a')],function(_0x44a2f2){return{'model':db[_0x44a2f2[_0xa0b0('0x1b')]],'as':_0x44a2f2['as'],'attributes':_0x44a2f2[_0xa0b0('0x1c')],'include':_0x44a2f2[_0xa0b0('0x1a')]?_[_0xa0b0('0x19')](_0x44a2f2['include'],function(_0x512d72){return{'model':db[_0x512d72[_0xa0b0('0x1b')]],'as':_0x512d72['as'],'attributes':_0x512d72['attributes'],'include':_0x512d72[_0xa0b0('0x1a')]?_[_0xa0b0('0x19')](_0x512d72[_0xa0b0('0x1a')],function(_0xa1b29a){return{'model':db[_0xa1b29a[_0xa0b0('0x1b')]],'as':_0xa1b29a['as'],'attributes':_0xa1b29a[_0xa0b0('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26754d){var _0x2d430f=[];for(var _0x30a934=0x0;_0x30a934<_0x26754d[_0xa0b0('0x46')];_0x30a934+=0x1){_0x2d430f[_0xa0b0('0x31')](_0x26754d[_0x30a934][_0xa0b0('0x23')](_0x51405b[_0xa0b0('0x21')],{'transaction':_0x4f24e7}));}return BPromise['all'](_0x2d430f);});})[_0xa0b0('0x9')](function(_0x13032c){logger[_0xa0b0('0xa')](_0xa0b0('0x43'),_0x51405b);logger[_0xa0b0('0x1d')]('GetContactRecallMe',_0x51405b,JSON['stringify'](_0x13032c));_0x25dbbf(_0x13032c);})['catch'](function(_0x2f3ab9){logger[_0xa0b0('0xf')](_0xa0b0('0x43'),_0x2f3ab9[_0xa0b0('0x11')],_0x51405b);_0xf897be(_0x5e1ceb['error'](0x1f4,_0x2f3ab9[_0xa0b0('0x11')]));});});});};exports[_0xa0b0('0x47')]=function(_0x43527f){var _0x1b793d=this;return new Promise(function(_0x71074d,_0x487ff8){db[_0xa0b0('0x28')][_0xa0b0('0x44')]()['then'](function(_0x1494b4){return db[_0xa0b0('0x14')]['findAll']({'raw':_0x43527f['options']?_0x43527f[_0xa0b0('0x16')][_0xa0b0('0x17')]===undefined?!![]:![]:!![],'where':_0x43527f['options']?_0x43527f['options'][_0xa0b0('0x18')]||null:null,'attributes':_0x43527f['options']?_0x43527f[_0xa0b0('0x16')]['attributes']||null:null,'limit':_0x43527f['options']?_0x43527f[_0xa0b0('0x16')]['limit']||null:null,'include':_0x43527f['options']?_0x43527f[_0xa0b0('0x16')][_0xa0b0('0x1a')]?_[_0xa0b0('0x19')](_0x43527f['options'][_0xa0b0('0x1a')],function(_0xe8a4d0){return{'model':db[_0xe8a4d0[_0xa0b0('0x1b')]],'as':_0xe8a4d0['as'],'attributes':_0xe8a4d0['as']===_0xa0b0('0x2b')?_[_0xa0b0('0x2c')](_0x1494b4):_0xe8a4d0['attributes'],'include':_0xe8a4d0['include']?_['map'](_0xe8a4d0['include'],function(_0x2a77fb){return{'model':db[_0x2a77fb[_0xa0b0('0x1b')]],'as':_0x2a77fb['as'],'attributes':_0x2a77fb['attributes'],'include':_0x2a77fb['include']?_[_0xa0b0('0x19')](_0x2a77fb['include'],function(_0x476b7d){return{'model':db[_0x476b7d[_0xa0b0('0x1b')]],'as':_0x476b7d['as'],'attributes':_0x476b7d[_0xa0b0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa0b0('0x9')](function(_0x441d9a){logger[_0xa0b0('0xa')](_0xa0b0('0x13'),_0x43527f);logger[_0xa0b0('0x1d')](_0xa0b0('0x13'),_0x43527f,JSON[_0xa0b0('0xe')](_0x441d9a));_0x71074d(_0x441d9a);})[_0xa0b0('0x12')](function(_0x465a6a){logger['error'](_0xa0b0('0x13'),_0x465a6a[_0xa0b0('0x11')],_0x43527f);_0x487ff8(_0x1b793d[_0xa0b0('0xf')](0x1f4,_0x465a6a[_0xa0b0('0x11')]));});});});};exports[_0xa0b0('0x48')]=function(_0x4b4532){var _0x179a80=this;return new Promise(function(_0x5dfcad,_0x2a18ed){return db[_0xa0b0('0x28')][_0xa0b0('0x49')]({'raw':!![],'where':{'phone':_0x4b4532[_0xa0b0('0x16')][_0xa0b0('0x18')][_0xa0b0('0x4a')]},'attributes':['id',_0xa0b0('0x4b')],'order':[['id',_0xa0b0('0x4c')]]})[_0xa0b0('0x9')](function(_0x19d274){logger['info'](_0xa0b0('0x4d'),_0x4b4532);logger[_0xa0b0('0x1d')](_0xa0b0('0x4d'),_0x4b4532,JSON[_0xa0b0('0xe')](_0x19d274));_0x5dfcad(_0x19d274);})[_0xa0b0('0x12')](function(_0x35069f){logger[_0xa0b0('0xf')](_0xa0b0('0x4d'),_0x35069f[_0xa0b0('0x11')],_0x4b4532);_0x2a18ed(_0x179a80[_0xa0b0('0xf')](0x1f4,_0x35069f[_0xa0b0('0x11')]));});});};exports[_0xa0b0('0x4e')]=function(_0x2fab51){var _0x3efdd2=this;return new Promise(function(_0x1c98b9,_0x1b91ea){return db[_0xa0b0('0x3b')][_0xa0b0('0x29')](function(_0x3f8200){return db['CmHopper'][_0xa0b0('0x23')](_0x2fab51[_0xa0b0('0x21')],{'where':{},'transaction':_0x3f8200})[_0xa0b0('0x9')](function(_0x4930f7){logger[_0xa0b0('0xa')]('ResetActiveCalls',_0x2fab51);logger['debug'](_0xa0b0('0x4e'),_0x2fab51,JSON['stringify'](_0x4930f7));_0x1c98b9(_0x4930f7);})[_0xa0b0('0x12')](function(_0x2ba06e){logger['error'](_0xa0b0('0x4e'),_0x2ba06e[_0xa0b0('0x11')],_0x2fab51);_0x1b91ea(_0x3efdd2[_0xa0b0('0xf')](0x1f4,_0x2ba06e['message']));});});});};exports[_0xa0b0('0x4f')]=function(_0x27179d){var _0x55815d=this;var _0x406e3e=_0x27179d[_0xa0b0('0x21')]['where'][_0xa0b0('0x50')];var _0x4bf7e1=_0x27179d[_0xa0b0('0x21')]['where'][_0xa0b0('0x51')];var _0x1f9d1c=_0x27179d['body'][_0xa0b0('0x18')][_0xa0b0('0x52')];return new Promise(function(_0x10eefe,_0x59db62){return db['CmHopper'][_0xa0b0('0x15')]({'where':{'voiceQueueId':{'$in':_0x406e3e},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xa0b0('0x3b')][_0xa0b0('0x3d')](_0xa0b0('0x53')+_0x4bf7e1+_0xa0b0('0x54')),'$gt':db[_0xa0b0('0x3b')][_0xa0b0('0x3d')](_0xa0b0('0x55'))}},'UserId':{'$in':_0x1f9d1c}},'include':[{'model':db[_0xa0b0('0x28')],'as':_0xa0b0('0x2b')},{'model':db[_0xa0b0('0x2d')],'as':_0xa0b0('0x2e'),'attributes':['id',_0xa0b0('0x2f'),_0xa0b0('0x30')]},{'model':db[_0xa0b0('0x56')],'as':_0xa0b0('0x57')}]})['then'](function(_0x28b9db){if(_0x28b9db['length']>0x0){return db['sequelize'][_0xa0b0('0x29')](function(_0x2b1e84){return db[_0xa0b0('0x14')]['update']({'recallmeNotifiedDate':db[_0xa0b0('0x3b')][_0xa0b0('0x3d')]('NOW()')},{'where':{'id':{'$in':_[_0xa0b0('0x19')](_0x28b9db,'id')}},'transaction':_0x2b1e84})[_0xa0b0('0x9')](function(){_0x10eefe(_0x28b9db);})[_0xa0b0('0x12')](function(_0x18d776){logger[_0xa0b0('0xf')](_0xa0b0('0x4f'),_0x18d776[_0xa0b0('0x11')],_0x27179d);_0x59db62(_0x55815d[_0xa0b0('0xf')](0x1f4,_0x18d776[_0xa0b0('0x11')]));});})[_0xa0b0('0x12')](function(_0x2d3b65){logger['error'](_0xa0b0('0x4f'),_0x2d3b65['message'],_0x27179d);_0x59db62(_0x55815d[_0xa0b0('0xf')](0x1f4,_0x2d3b65[_0xa0b0('0x11')]));});}else{_0x10eefe(_0x28b9db);}});});}; \ No newline at end of file +var _0x89ca=['CmContact','describe','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','voicePause','length','UserId','push','includes','all','GetContactDialer','dataValues','ContactId','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','CmList','List','lodash','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopper','findAll','options','raw','attributes','include','map','model','ShowCmHopper','CmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','body','where','limit','active','DestroyCmHopper','destroy'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0x89ca,0xe3));var _0xa89c=function(_0x4573ff,_0x2e040d){_0x4573ff=_0x4573ff-0x0;var _0x55a63b=_0x89ca[_0x4573ff];return _0x55a63b;};'use strict';var _=require(_0xa89c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa89c('0x1'));var db=require(_0xa89c('0x2'))['db'];var logger=require(_0xa89c('0x3'))(_0xa89c('0x4'));var jayson=require(_0xa89c('0x5'));var client=jayson[_0xa89c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eefa4,_0x4ed97b,_0xc2f35){return new BPromise(function(_0x27a131,_0x4f995c){return client[_0xa89c('0x7')](_0x5eefa4,_0xc2f35)[_0xa89c('0x8')](function(_0x3f38ab){logger[_0xa89c('0x9')](_0xa89c('0xa'),_0x4ed97b,_0xa89c('0xb'));logger[_0xa89c('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4ed97b,'request\x20sent',JSON[_0xa89c('0xd')](_0x3f38ab));if(_0x3f38ab[_0xa89c('0xe')]){if(_0x3f38ab[_0xa89c('0xe')][_0xa89c('0xf')]===0x1f4){logger[_0xa89c('0xe')](_0xa89c('0xa'),_0x4ed97b,_0x3f38ab[_0xa89c('0xe')][_0xa89c('0x10')]);return _0x4f995c(_0x3f38ab[_0xa89c('0xe')][_0xa89c('0x10')]);}logger[_0xa89c('0xe')](_0xa89c('0xa'),_0x4ed97b,_0x3f38ab[_0xa89c('0xe')][_0xa89c('0x10')]);return _0x27a131(_0x3f38ab[_0xa89c('0xe')][_0xa89c('0x10')]);}else{logger[_0xa89c('0x9')]('CmHopper,\x20%s,\x20%s',_0x4ed97b,_0xa89c('0xb'));_0x27a131(_0x3f38ab[_0xa89c('0x11')][_0xa89c('0x10')]);}})[_0xa89c('0x12')](function(_0x1c615f){logger[_0xa89c('0xe')](_0xa89c('0xa'),_0x4ed97b,_0x1c615f);_0x4f995c(_0x1c615f);});});}exports[_0xa89c('0x13')]=function(_0x331ff8){var _0x5ebfa5=this;return new Promise(function(_0x1b3040,_0x432e78){return db['CmHopper'][_0xa89c('0x14')]({'raw':_0x331ff8[_0xa89c('0x15')]?_0x331ff8[_0xa89c('0x15')][_0xa89c('0x16')]===undefined?!![]:![]:!![],'where':_0x331ff8['options']?_0x331ff8[_0xa89c('0x15')]['where']||null:null,'attributes':_0x331ff8[_0xa89c('0x15')]?_0x331ff8[_0xa89c('0x15')][_0xa89c('0x17')]||null:null,'limit':_0x331ff8[_0xa89c('0x15')]?_0x331ff8[_0xa89c('0x15')]['limit']||null:null,'include':_0x331ff8[_0xa89c('0x15')]?_0x331ff8[_0xa89c('0x15')][_0xa89c('0x18')]?_['map'](_0x331ff8[_0xa89c('0x15')][_0xa89c('0x18')],function(_0x3d8c47){return{'model':db[_0x3d8c47['model']],'as':_0x3d8c47['as'],'attributes':_0x3d8c47['attributes'],'include':_0x3d8c47[_0xa89c('0x18')]?_[_0xa89c('0x19')](_0x3d8c47[_0xa89c('0x18')],function(_0x411267){return{'model':db[_0x411267[_0xa89c('0x1a')]],'as':_0x411267['as'],'attributes':_0x411267[_0xa89c('0x17')],'include':_0x411267[_0xa89c('0x18')]?_[_0xa89c('0x19')](_0x411267[_0xa89c('0x18')],function(_0x3c6f4c){return{'model':db[_0x3c6f4c['model']],'as':_0x3c6f4c['as'],'attributes':_0x3c6f4c[_0xa89c('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa89c('0x8')](function(_0x29c780){logger[_0xa89c('0x9')](_0xa89c('0x13'),_0x331ff8);logger[_0xa89c('0xc')](_0xa89c('0x13'),_0x331ff8,JSON[_0xa89c('0xd')](_0x29c780));_0x1b3040(_0x29c780);})['catch'](function(_0x49c541){logger['error'](_0xa89c('0x13'),_0x49c541[_0xa89c('0x10')],_0x331ff8);_0x432e78(_0x5ebfa5[_0xa89c('0xe')](0x1f4,_0x49c541[_0xa89c('0x10')]));});});};exports[_0xa89c('0x1b')]=function(_0x1d7011){var _0x177d1c=this;return new Promise(function(_0x390f53,_0x5d00af){return db[_0xa89c('0x1c')][_0xa89c('0x1d')]({'raw':_0x1d7011[_0xa89c('0x15')]?_0x1d7011[_0xa89c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1d7011[_0xa89c('0x15')]?_0x1d7011[_0xa89c('0x15')]['where']||null:null,'attributes':_0x1d7011[_0xa89c('0x15')]?_0x1d7011[_0xa89c('0x15')]['attributes']||null:null,'include':_0x1d7011[_0xa89c('0x15')]?_0x1d7011[_0xa89c('0x15')]['include']?_[_0xa89c('0x19')](_0x1d7011[_0xa89c('0x15')]['include'],function(_0x5bcadb){return{'model':db[_0x5bcadb[_0xa89c('0x1a')]],'as':_0x5bcadb['as'],'attributes':_0x5bcadb[_0xa89c('0x17')],'include':_0x5bcadb[_0xa89c('0x18')]?_['map'](_0x5bcadb[_0xa89c('0x18')],function(_0x255471){return{'model':db[_0x255471[_0xa89c('0x1a')]],'as':_0x255471['as'],'attributes':_0x255471[_0xa89c('0x17')],'include':_0x255471['include']?_[_0xa89c('0x19')](_0x255471[_0xa89c('0x18')],function(_0x47a2bb){return{'model':db[_0x47a2bb['model']],'as':_0x47a2bb['as'],'attributes':_0x47a2bb[_0xa89c('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29f069){logger[_0xa89c('0x9')]('ShowCmHopper',_0x1d7011);logger[_0xa89c('0xc')](_0xa89c('0x1b'),_0x1d7011,JSON[_0xa89c('0xd')](_0x29f069));_0x390f53(_0x29f069);})[_0xa89c('0x12')](function(_0x13a0f6){logger['error'](_0xa89c('0x1b'),_0x13a0f6[_0xa89c('0x10')],_0x1d7011);_0x5d00af(_0x177d1c['error'](0x1f4,_0x13a0f6[_0xa89c('0x10')]));});});};exports[_0xa89c('0x1e')]=function(_0x2dc7a0){var _0x4c9bbc=this;return new Promise(function(_0x13b274,_0x26f0a7){return db[_0xa89c('0x1c')][_0xa89c('0x1f')](_0x2dc7a0['body'],{'raw':_0x2dc7a0['options']?_0x2dc7a0[_0xa89c('0x15')][_0xa89c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1fae8b){logger[_0xa89c('0x9')](_0xa89c('0x1e'),_0x2dc7a0);logger[_0xa89c('0xc')](_0xa89c('0x1e'),_0x2dc7a0,JSON[_0xa89c('0xd')](_0x1fae8b));_0x13b274(_0x1fae8b);})[_0xa89c('0x12')](function(_0xa5a29d){logger[_0xa89c('0xe')](_0xa89c('0x1e'),_0xa5a29d[_0xa89c('0x10')],_0x2dc7a0);_0x26f0a7(_0x4c9bbc['error'](0x1f4,_0xa5a29d[_0xa89c('0x10')]));});});};exports[_0xa89c('0x20')]=function(_0x4a67ff){var _0x223b9e=this;return new Promise(function(_0x3665eb,_0x5a82f8){return db['CmHopper'][_0xa89c('0x21')](_0x4a67ff[_0xa89c('0x22')],{'raw':_0x4a67ff[_0xa89c('0x15')]?_0x4a67ff[_0xa89c('0x15')][_0xa89c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a67ff[_0xa89c('0x15')]?_0x4a67ff[_0xa89c('0x15')][_0xa89c('0x23')]||null:null,'attributes':_0x4a67ff[_0xa89c('0x15')]?_0x4a67ff[_0xa89c('0x15')][_0xa89c('0x17')]||null:null,'limit':_0x4a67ff[_0xa89c('0x15')]?_0x4a67ff[_0xa89c('0x15')][_0xa89c('0x24')]||null:null})[_0xa89c('0x8')](function(_0x1867cc){logger[_0xa89c('0x9')](_0xa89c('0x20'),_0x4a67ff);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xa89c('0xd')](_0x4a67ff['options'][_0xa89c('0x23')]),_0x4a67ff['body'][_0xa89c('0x25')]);logger[_0xa89c('0xc')](_0xa89c('0x20'),_0x4a67ff,JSON[_0xa89c('0xd')](_0x1867cc));_0x3665eb(_0x1867cc);})[_0xa89c('0x12')](function(_0x11eefe){logger[_0xa89c('0xe')](_0xa89c('0x20'),_0x11eefe[_0xa89c('0x10')],_0x4a67ff);_0x5a82f8(_0x223b9e[_0xa89c('0xe')](0x1f4,_0x11eefe[_0xa89c('0x10')]));});});};exports[_0xa89c('0x26')]=function(_0xcbccbc){var _0x4b3655=this;return new Promise(function(_0x1818de,_0x4986be){return db['CmHopper'][_0xa89c('0x27')]({'where':_0xcbccbc['options']?_0xcbccbc[_0xa89c('0x15')][_0xa89c('0x23')]||null:null})[_0xa89c('0x8')](function(_0x2e6caf){logger[_0xa89c('0x9')](_0xa89c('0x26'),_0xcbccbc);logger['debug'](_0xa89c('0x26'),_0xcbccbc,JSON[_0xa89c('0xd')](_0x2e6caf));_0x1818de(_0x2e6caf);})[_0xa89c('0x12')](function(_0x10675f){logger[_0xa89c('0xe')]('DestroyCmHopper',_0x10675f[_0xa89c('0x10')],_0xcbccbc);_0x4986be(_0x4b3655[_0xa89c('0xe')](0x1f4,_0x10675f[_0xa89c('0x10')]));});});};exports['GetContactDialer']=function(_0x3d8fc2){var _0x58dd7a=this;return new Promise(function(_0x4acd77,_0x2ef03c){return db[_0xa89c('0x28')][_0xa89c('0x29')]()[_0xa89c('0x8')](function(_0x1fa5e6){return db['sequelize'][_0xa89c('0x2a')](function(_0x1f688b){return db['CmHopper']['findAll']({'where':_0x3d8fc2['options']?_0x3d8fc2[_0xa89c('0x15')][_0xa89c('0x23')]||null:null,'attributes':_0x3d8fc2['options']?_0x3d8fc2['options']['attributes']||null:null,'limit':_0x3d8fc2['options']?_0x3d8fc2[_0xa89c('0x15')]['limit']||null:null,'order':_0x3d8fc2[_0xa89c('0x15')]?_0x3d8fc2[_0xa89c('0x15')][_0xa89c('0x2b')]||null:null,'transaction':_0x1f688b,'lock':_0x1f688b[_0xa89c('0x2c')][_0xa89c('0x2d')],'include':[{'model':db[_0xa89c('0x28')],'as':_0xa89c('0x2e'),'attributes':_[_0xa89c('0x2f')](_0x1fa5e6)},{'model':db[_0xa89c('0x30')],'as':_0xa89c('0x31'),'attributes':['id','name',_0xa89c('0x32')]}]})[_0xa89c('0x8')](function(_0x5df64c){var _0x1c19a5=[];var _0x31c779=[];for(var _0x18b825=0x0;_0x18b825<_0x5df64c[_0xa89c('0x33')];_0x18b825+=0x1){var _0x5c0779=_0x5df64c[_0x18b825][_0xa89c('0x34')];if(_0x5c0779===null){_0x1c19a5[_0xa89c('0x35')](_0x5df64c[_0x18b825][_0xa89c('0x21')](_0x3d8fc2[_0xa89c('0x22')],{'transaction':_0x1f688b}));}else if(!_0x31c779[_0xa89c('0x36')](_0x5c0779)){_0x31c779[_0xa89c('0x35')](_0x5c0779);_0x1c19a5[_0xa89c('0x35')](_0x5df64c[_0x18b825][_0xa89c('0x21')](_0x3d8fc2[_0xa89c('0x22')],{'transaction':_0x1f688b}));}}return BPromise[_0xa89c('0x37')](_0x1c19a5);});})[_0xa89c('0x8')](function(_0x2d7ea0){logger[_0xa89c('0x9')](_0xa89c('0x38'),_0x3d8fc2);if(_0x2d7ea0[_0xa89c('0x33')]>0x0){logger[_0xa89c('0x9')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x2d7ea0[0x0][_0xa89c('0x39')]['id'],_0x2d7ea0[0x0][_0xa89c('0x39')][_0xa89c('0x3a')],_0x2d7ea0[0x0][_0xa89c('0x39')][_0xa89c('0x25')]);}logger[_0xa89c('0xc')](_0xa89c('0x38'),_0x3d8fc2,JSON[_0xa89c('0xd')](_0x2d7ea0));_0x4acd77(_0x2d7ea0);})[_0xa89c('0x12')](function(_0x54dcf6){logger[_0xa89c('0xe')](_0xa89c('0x38'),_0x54dcf6[_0xa89c('0x10')],_0x3d8fc2);_0x2ef03c(_0x58dd7a[_0xa89c('0xe')](0x1f4,_0x54dcf6[_0xa89c('0x10')]));});});});};exports['MoveContactManagedDialer']=function(_0x199034){var _0x354a60=this;return new Promise(function(_0x16bd61,_0x58a7d6){return db[_0xa89c('0x3b')]['transaction'](function(_0x1225fc){return db[_0xa89c('0x3c')]['create'](_0x199034['body'],{'raw':_0x199034[_0xa89c('0x15')]?_0x199034[_0xa89c('0x15')][_0xa89c('0x16')]===undefined?!![]:![]:!![],'transaction':_0x1225fc})[_0xa89c('0x8')](function(){logger[_0xa89c('0x9')](_0xa89c('0x3d'),JSON[_0xa89c('0xd')](_0x199034['options'][_0xa89c('0x23')]),_0x199034[_0xa89c('0x15')][_0xa89c('0x23')]['active']);return db[_0xa89c('0x1c')][_0xa89c('0x27')]({'where':_0x199034['options']?_0x199034[_0xa89c('0x15')][_0xa89c('0x23')]||null:null,'transaction':_0x1225fc});});})[_0xa89c('0x8')](function(_0x248fb9){logger[_0xa89c('0x9')](_0xa89c('0x3e'),_0x199034);logger[_0xa89c('0xc')](_0xa89c('0x3e'),_0x199034,JSON[_0xa89c('0xd')](_0x248fb9));_0x16bd61(_0x248fb9);})[_0xa89c('0x12')](function(_0x5c8ad0){logger['error'](_0xa89c('0x3e'),_0x5c8ad0['message'],_0x199034);_0x58a7d6(_0x354a60['error'](0x1f4,_0x5c8ad0['message']));});});};exports['CountReScheduled']=function(_0x193c3c){var _0x1b17cb=this;return new Promise(function(_0x225988,_0x3cbc55){return db['CmHopper'][_0xa89c('0x14')]({'raw':_0x193c3c['options']?_0x193c3c[_0xa89c('0x15')][_0xa89c('0x16')]===undefined?!![]:![]:!![],'where':_0x193c3c['options']?_0x193c3c[_0xa89c('0x15')][_0xa89c('0x23')]||null:null,'attributes':[[db[_0xa89c('0x3b')]['fn'](_0xa89c('0x3f'),db[_0xa89c('0x3b')]['fn']('IF',db[_0xa89c('0x3b')][_0xa89c('0x40')](_0xa89c('0x41')+util[_0xa89c('0x42')](_0xa89c('0x43'),moment()[_0xa89c('0x42')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xa89c('0x44')))),_0xa89c('0x45')]]})[_0xa89c('0x8')](function(_0x1826d3){logger['info'](_0xa89c('0x46'),_0x193c3c);logger[_0xa89c('0xc')](_0xa89c('0x46'),_0x193c3c,JSON[_0xa89c('0xd')](_0x1826d3));_0x225988(_0x1826d3);})[_0xa89c('0x12')](function(_0x4de307){logger[_0xa89c('0xe')](_0xa89c('0x46'),_0x4de307[_0xa89c('0x10')],_0x193c3c);_0x3cbc55(_0x1b17cb[_0xa89c('0xe')](0x1f4,_0x4de307['message']));});});};exports[_0xa89c('0x47')]=function(_0x30acf8){var _0x117378=this;return new Promise(function(_0x40ba2d,_0x255feb){return db[_0xa89c('0x28')][_0xa89c('0x29')]()[_0xa89c('0x8')](function(_0x16f151){return db[_0xa89c('0x3b')]['transaction'](function(_0x31f6de){return db[_0xa89c('0x1c')][_0xa89c('0x14')]({'where':_0x30acf8[_0xa89c('0x15')]?_0x30acf8['options'][_0xa89c('0x23')]||null:null,'attributes':_0x30acf8[_0xa89c('0x15')]?_0x30acf8['options'][_0xa89c('0x17')]||null:null,'limit':0x1,'order':_0x30acf8['options']?_0x30acf8[_0xa89c('0x15')][_0xa89c('0x2b')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x31f6de,'lock':_0x31f6de[_0xa89c('0x2c')][_0xa89c('0x2d')],'include':_0x30acf8['options']?_0x30acf8[_0xa89c('0x15')][_0xa89c('0x18')]?_[_0xa89c('0x19')](_0x30acf8[_0xa89c('0x15')][_0xa89c('0x18')],function(_0x5ea194){return{'model':db[_0x5ea194[_0xa89c('0x1a')]],'as':_0x5ea194['as'],'attributes':_0x5ea194['attributes'],'include':_0x5ea194[_0xa89c('0x18')]?_['map'](_0x5ea194[_0xa89c('0x18')],function(_0x1b5336){return{'model':db[_0x1b5336[_0xa89c('0x1a')]],'as':_0x1b5336['as'],'attributes':_0x1b5336[_0xa89c('0x17')],'include':_0x1b5336['include']?_[_0xa89c('0x19')](_0x1b5336[_0xa89c('0x18')],function(_0xf0cc6f){return{'model':db[_0xf0cc6f['model']],'as':_0xf0cc6f['as'],'attributes':_0xf0cc6f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa89c('0x8')](function(_0x3b8abd){var _0x15689b=[];for(var _0x183a8c=0x0;_0x183a8c<_0x3b8abd[_0xa89c('0x33')];_0x183a8c+=0x1){_0x15689b['push'](_0x3b8abd[_0x183a8c][_0xa89c('0x21')](_0x30acf8['body'],{'transaction':_0x31f6de}));}return BPromise['all'](_0x15689b);});})['then'](function(_0x594736){logger[_0xa89c('0x9')](_0xa89c('0x47'),_0x30acf8);logger[_0xa89c('0xc')]('GetContactRecallMe',_0x30acf8,JSON['stringify'](_0x594736));_0x40ba2d(_0x594736);})[_0xa89c('0x12')](function(_0xefc94d){logger[_0xa89c('0xe')](_0xa89c('0x47'),_0xefc94d[_0xa89c('0x10')],_0x30acf8);_0x255feb(_0x117378['error'](0x1f4,_0xefc94d[_0xa89c('0x10')]));});});});};exports[_0xa89c('0x48')]=function(_0x41ac7a){var _0x2020fa=this;return new Promise(function(_0x5b1328,_0x120cf0){db['CmContact']['describe']()['then'](function(_0x262d58){return db[_0xa89c('0x1c')]['findAll']({'raw':_0x41ac7a[_0xa89c('0x15')]?_0x41ac7a[_0xa89c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41ac7a[_0xa89c('0x15')]?_0x41ac7a[_0xa89c('0x15')][_0xa89c('0x23')]||null:null,'attributes':_0x41ac7a[_0xa89c('0x15')]?_0x41ac7a[_0xa89c('0x15')][_0xa89c('0x17')]||null:null,'limit':_0x41ac7a[_0xa89c('0x15')]?_0x41ac7a[_0xa89c('0x15')][_0xa89c('0x24')]||null:null,'include':_0x41ac7a['options']?_0x41ac7a[_0xa89c('0x15')][_0xa89c('0x18')]?_['map'](_0x41ac7a[_0xa89c('0x15')][_0xa89c('0x18')],function(_0x462cab){return{'model':db[_0x462cab['model']],'as':_0x462cab['as'],'attributes':_0x462cab['as']===_0xa89c('0x2e')?_[_0xa89c('0x2f')](_0x262d58):_0x462cab[_0xa89c('0x17')],'include':_0x462cab['include']?_[_0xa89c('0x19')](_0x462cab[_0xa89c('0x18')],function(_0x18e63a){return{'model':db[_0x18e63a[_0xa89c('0x1a')]],'as':_0x18e63a['as'],'attributes':_0x18e63a[_0xa89c('0x17')],'include':_0x18e63a[_0xa89c('0x18')]?_[_0xa89c('0x19')](_0x18e63a[_0xa89c('0x18')],function(_0x440ac5){return{'model':db[_0x440ac5[_0xa89c('0x1a')]],'as':_0x440ac5['as'],'attributes':_0x440ac5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa89c('0x8')](function(_0xdebbfd){logger[_0xa89c('0x9')](_0xa89c('0x13'),_0x41ac7a);logger[_0xa89c('0xc')](_0xa89c('0x13'),_0x41ac7a,JSON['stringify'](_0xdebbfd));_0x5b1328(_0xdebbfd);})[_0xa89c('0x12')](function(_0x331950){logger[_0xa89c('0xe')](_0xa89c('0x13'),_0x331950[_0xa89c('0x10')],_0x41ac7a);_0x120cf0(_0x2020fa[_0xa89c('0xe')](0x1f4,_0x331950['message']));});});});};exports[_0xa89c('0x49')]=function(_0x3c8182){var _0x54556e=this;return new Promise(function(_0x268fd6,_0x453059){return db[_0xa89c('0x28')][_0xa89c('0x4a')]({'raw':!![],'where':{'phone':_0x3c8182[_0xa89c('0x15')][_0xa89c('0x23')][_0xa89c('0x4b')]},'attributes':['id',_0xa89c('0x4c')],'order':[['id',_0xa89c('0x4d')]]})[_0xa89c('0x8')](function(_0x415e7e){logger[_0xa89c('0x9')](_0xa89c('0x4e'),_0x3c8182);logger[_0xa89c('0xc')]('getContactByPhone',_0x3c8182,JSON[_0xa89c('0xd')](_0x415e7e));_0x268fd6(_0x415e7e);})['catch'](function(_0x15ddab){logger[_0xa89c('0xe')]('getContactByPhone',_0x15ddab[_0xa89c('0x10')],_0x3c8182);_0x453059(_0x54556e[_0xa89c('0xe')](0x1f4,_0x15ddab[_0xa89c('0x10')]));});});};exports[_0xa89c('0x4f')]=function(_0x2604ff){var _0x113451=this;return new Promise(function(_0x261201,_0x1a70ac){return db[_0xa89c('0x3b')][_0xa89c('0x2a')](function(_0x32f6cc){return db[_0xa89c('0x1c')]['update'](_0x2604ff[_0xa89c('0x22')],{'where':{},'transaction':_0x32f6cc})[_0xa89c('0x8')](function(_0xed36cb){logger['info']('ResetActiveCalls',_0x2604ff);logger['debug'](_0xa89c('0x4f'),_0x2604ff,JSON['stringify'](_0xed36cb));_0x261201(_0xed36cb);})[_0xa89c('0x12')](function(_0x46d0ff){logger[_0xa89c('0xe')]('ResetActiveCalls',_0x46d0ff['message'],_0x2604ff);_0x1a70ac(_0x113451[_0xa89c('0xe')](0x1f4,_0x46d0ff[_0xa89c('0x10')]));});});});};exports[_0xa89c('0x50')]=function(_0x24babf){var _0x2b480a=this;var _0x26796a=_0x24babf[_0xa89c('0x22')]['where'][_0xa89c('0x51')];var _0x4b3057=_0x24babf[_0xa89c('0x22')][_0xa89c('0x23')]['interval'];var _0x59a760=_0x24babf[_0xa89c('0x22')]['where'][_0xa89c('0x52')];return new Promise(function(_0x3712a4,_0x4bef96){return db[_0xa89c('0x1c')][_0xa89c('0x14')]({'where':{'voiceQueueId':{'$in':_0x26796a},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xa89c('0x3b')][_0xa89c('0x40')](_0xa89c('0x53')+_0x4b3057+_0xa89c('0x54')),'$gt':db[_0xa89c('0x3b')][_0xa89c('0x40')](_0xa89c('0x55'))}},'UserId':{'$in':_0x59a760}},'include':[{'model':db['CmContact'],'as':_0xa89c('0x2e')},{'model':db[_0xa89c('0x30')],'as':_0xa89c('0x31'),'attributes':['id',_0xa89c('0x56'),_0xa89c('0x32')]},{'model':db[_0xa89c('0x57')],'as':_0xa89c('0x58')}]})[_0xa89c('0x8')](function(_0x4c3b47){if(_0x4c3b47[_0xa89c('0x33')]>0x0){return db[_0xa89c('0x3b')][_0xa89c('0x2a')](function(_0x2d6778){return db['CmHopper'][_0xa89c('0x21')]({'recallmeNotifiedDate':db['sequelize'][_0xa89c('0x40')](_0xa89c('0x55'))},{'where':{'id':{'$in':_[_0xa89c('0x19')](_0x4c3b47,'id')}},'transaction':_0x2d6778})[_0xa89c('0x8')](function(){_0x3712a4(_0x4c3b47);})[_0xa89c('0x12')](function(_0x1a9b6f){logger[_0xa89c('0xe')](_0xa89c('0x50'),_0x1a9b6f[_0xa89c('0x10')],_0x24babf);_0x4bef96(_0x2b480a[_0xa89c('0xe')](0x1f4,_0x1a9b6f['message']));});})['catch'](function(_0x4727a4){logger[_0xa89c('0xe')](_0xa89c('0x50'),_0x4727a4[_0xa89c('0x10')],_0x24babf);_0x4bef96(_0x2b480a[_0xa89c('0xe')](0x1f4,_0x4727a4[_0xa89c('0x10')]));});}else{_0x3712a4(_0x4c3b47);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index a7cf746..475f8da 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 _0x967e=['show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','/:id','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/opencontacts','/timezones','getTimezones'];(function(_0x40634d,_0x2b64da){var _0x51f357=function(_0x2f6e34){while(--_0x2f6e34){_0x40634d['push'](_0x40634d['shift']());}};_0x51f357(++_0x2b64da);}(_0x967e,0xdd));var _0xe967=function(_0x14dac0,_0x11522f){_0x14dac0=_0x14dac0-0x0;var _0x420f6e=_0x967e[_0x14dac0];return _0x420f6e;};'use strict';var express=require(_0xe967('0x0'));var router=express[_0xe967('0x1')]();var auth=require(_0xe967('0x2'));var controller=require(_0xe967('0x3'));router[_0xe967('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xe967('0x5')](),controller['describe']);router[_0xe967('0x4')](_0xe967('0x6'),auth[_0xe967('0x5')](),controller['getOpenContacts']);router[_0xe967('0x4')](_0xe967('0x7'),auth['isAuthenticated'](),controller[_0xe967('0x8')]);router['get']('/:id',auth[_0xe967('0x5')](),controller[_0xe967('0x9')]);router[_0xe967('0x4')](_0xe967('0xa'),auth['isAuthenticated'](),controller[_0xe967('0xb')]);router[_0xe967('0xc')]('/',auth[_0xe967('0x5')](),controller[_0xe967('0xd')]);router[_0xe967('0xc')](_0xe967('0xe'),auth[_0xe967('0x5')](),controller[_0xe967('0xf')]);router[_0xe967('0xc')](_0xe967('0x10'),auth[_0xe967('0x5')](),controller['getTimezone']);router[_0xe967('0x11')](_0xe967('0x12'),auth[_0xe967('0x5')](),controller[_0xe967('0x13')]);router[_0xe967('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe967('0x15')]);module[_0xe967('0x16')]=router; \ No newline at end of file +var _0x9440=['get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','post','/preview','getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9440,0x9e));var _0x0944=function(_0x4a9907,_0x24ab69){_0x4a9907=_0x4a9907-0x0;var _0x3c9878=_0x9440[_0x4a9907];return _0x3c9878;};'use strict';var express=require('express');var router=express[_0x0944('0x0')]();var auth=require(_0x0944('0x1'));var controller=require(_0x0944('0x2'));router[_0x0944('0x3')]('/',auth[_0x0944('0x4')](),controller[_0x0944('0x5')]);router['get'](_0x0944('0x6'),auth[_0x0944('0x4')](),controller[_0x0944('0x7')]);router['get'](_0x0944('0x8'),auth[_0x0944('0x4')](),controller[_0x0944('0x9')]);router[_0x0944('0x3')]('/timezones',auth[_0x0944('0x4')](),controller[_0x0944('0xa')]);router['get'](_0x0944('0xb'),auth[_0x0944('0x4')](),controller[_0x0944('0xc')]);router['get']('/:id/previewrecall',auth['isAuthenticated'](),controller['getPreviewRecall']);router[_0x0944('0xd')]('/',auth[_0x0944('0x4')](),controller['create']);router['post'](_0x0944('0xe'),auth['isAuthenticated'](),controller[_0x0944('0xf')]);router[_0x0944('0xd')](_0x0944('0x10'),auth['isAuthenticated'](),controller[_0x0944('0x11')]);router[_0x0944('0x12')](_0x0944('0xb'),auth['isAuthenticated'](),controller[_0x0944('0x13')]);router[_0x0944('0x14')](_0x0944('0xb'),auth[_0x0944('0x4')](),controller[_0x0944('0x15')]);module[_0x0944('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 6509163..dfce520 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9768=['sequelize','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','moment'];(function(_0x4042f9,_0xf0174){var _0x1f7780=function(_0x1efdac){while(--_0x1efdac){_0x4042f9['push'](_0x4042f9['shift']());}};_0x1f7780(++_0xf0174);}(_0x9768,0x77));var _0x8976=function(_0x54f3e8,_0x3ed493){_0x54f3e8=_0x54f3e8-0x0;var _0x267b37=_0x9768[_0x54f3e8];return _0x267b37;};'use strict';var moment=require(_0x8976('0x0'));var Sequelize=require(_0x8976('0x1'));module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x8976('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x8976('0x3')],'defaultValue':moment()['format'](_0x8976('0x4'))},'countbusyretry':{'type':Sequelize[_0x8976('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8976('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8976('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8976('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8976('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x676b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING'];(function(_0x53fe81,_0x540cb2){var _0xd5ff84=function(_0x1fb293){while(--_0x1fb293){_0x53fe81['push'](_0x53fe81['shift']());}};_0xd5ff84(++_0x540cb2);}(_0x676b,0xa3));var _0xb676=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x676b[_0x54edc9];return _0x2ae7a9;};'use strict';var moment=require(_0xb676('0x0'));var Sequelize=require(_0xb676('0x1'));module[_0xb676('0x2')]={'CmHopperId':{'type':Sequelize[_0xb676('0x3')]},'phone':{'type':Sequelize[_0xb676('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xb676('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xb676('0x5')],'defaultValue':moment()[_0xb676('0x6')](_0xb676('0x7'))},'countbusyretry':{'type':Sequelize[_0xb676('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb676('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb676('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb676('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb676('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index b6f6b64..fc4d537 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa580=['status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','get','destroy','end','sendStatus','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa580,0x121));var _0x0a58=function(_0x3e9e8d,_0x50d18c){_0x3e9e8d=_0x3e9e8d-0x0;var _0x1a09a0=_0xa580[_0x3e9e8d];return _0x1a09a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a58('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a58('0x1'));var BPromise=require(_0x0a58('0x2'));var Mustache=require('mustache');var util=require(_0x0a58('0x3'));var path=require(_0x0a58('0x4'));var sox=require(_0x0a58('0x5'));var csv=require(_0x0a58('0x6'));var ejs=require(_0x0a58('0x7'));var fs=require('fs');var fs_extra=require(_0x0a58('0x8'));var _=require('lodash');var squel=require(_0x0a58('0x9'));var crypto=require(_0x0a58('0xa'));var jsforce=require(_0x0a58('0xb'));var deskjs=require(_0x0a58('0xc'));var toCsv=require(_0x0a58('0x6'));var querystring=require(_0x0a58('0xd'));var Papa=require(_0x0a58('0xe'));var Redis=require(_0x0a58('0xf'));var authService=require(_0x0a58('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0a58('0x11'));var hardwareService=require(_0x0a58('0x12'));var logger=require(_0x0a58('0x13'))('api');var utils=require(_0x0a58('0x14'));var config=require(_0x0a58('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a58('0x16'))['db'];function respondWithStatusCode(_0xcde61,_0x3a1db4){_0x3a1db4=_0x3a1db4||0xcc;return function(_0x57a785){if(_0x57a785){return _0xcde61['sendStatus'](_0x3a1db4);}return _0xcde61[_0x0a58('0x17')](_0x3a1db4)['end']();};}function respondWithResult(_0x222df2,_0x346da6){_0x346da6=_0x346da6||0xc8;return function(_0x1cd643){if(_0x1cd643){return _0x222df2[_0x0a58('0x17')](_0x346da6)[_0x0a58('0x18')](_0x1cd643);}};}function respondWithFilteredResult(_0x2f6a9e,_0x2e0898){return function(_0x230250){if(_0x230250){var _0x2c42d7=typeof _0x2e0898[_0x0a58('0x19')]===_0x0a58('0x1a')&&typeof _0x2e0898[_0x0a58('0x1b')]===_0x0a58('0x1a');var _0x58e57d=_0x230250['count'];var _0x2267b9=_0x2c42d7?0x0:_0x2e0898[_0x0a58('0x19')];var _0x7a93ae=_0x2c42d7?_0x230250[_0x0a58('0x1c')]:_0x2e0898['offset']+_0x2e0898[_0x0a58('0x1b')];var _0x20b301;if(_0x7a93ae>=_0x58e57d){_0x7a93ae=_0x58e57d;_0x20b301=0xc8;}else{_0x20b301=0xce;}_0x2f6a9e[_0x0a58('0x17')](_0x20b301);return _0x2f6a9e[_0x0a58('0x1d')](_0x0a58('0x1e'),_0x2267b9+'-'+_0x7a93ae+'/'+_0x58e57d)['json'](_0x230250);}return null;};}function patchUpdates(_0x18ef82){return function(_0x59df7d){try{jsonpatch['apply'](_0x59df7d,_0x18ef82,!![]);}catch(_0x2dfbd2){return BPromise[_0x0a58('0x1f')](_0x2dfbd2);}return _0x59df7d[_0x0a58('0x20')]();};}function saveUpdates(_0x3f8da2,_0x534f63){return function(_0x32259e){if(_0x32259e){return _0x32259e['update'](_0x3f8da2)[_0x0a58('0x21')](function(_0x323085){return _0x323085;});}return null;};}function removeEntity(_0x2ee4af,_0x4ea3bf){return function(_0x2d147d){if(_0x2d147d){return _0x2d147d['destroy']()[_0x0a58('0x21')](function(){var _0x5305c1=_0x2d147d[_0x0a58('0x22')]({'plain':!![]});var _0x48e082='CmHopperAdditionalPhones';return db['UserProfileResource'][_0x0a58('0x23')]({'where':{'type':_0x48e082,'resourceId':_0x5305c1['id']}})['then'](function(){return _0x2d147d;});})[_0x0a58('0x21')](function(){_0x2ee4af[_0x0a58('0x17')](0xcc)[_0x0a58('0x24')]();});}};}function handleEntityNotFound(_0x52c7e5,_0x46a08c){return function(_0x2ab291){if(!_0x2ab291){_0x52c7e5[_0x0a58('0x25')](0x194);}return _0x2ab291;};}function handleError(_0x45fa21,_0x5df835){_0x5df835=_0x5df835||0x1f4;return function(_0x12c788){logger[_0x0a58('0x26')](_0x12c788[_0x0a58('0x27')]);if(_0x12c788[_0x0a58('0x28')]){delete _0x12c788['name'];}_0x45fa21[_0x0a58('0x17')](_0x5df835)[_0x0a58('0x29')](_0x12c788);};}exports[_0x0a58('0x2a')]=function(_0x58a4d9,_0x147d34){var _0x55938b={},_0x868ffc={},_0x55754d={'count':0x0,'rows':[]};var _0x48a56c=_[_0x0a58('0x2b')](db[_0x0a58('0x2c')][_0x0a58('0x2d')],function(_0xaba103){return{'name':_0xaba103['fieldName'],'type':_0xaba103[_0x0a58('0x2e')]['key']};});_0x868ffc[_0x0a58('0x2f')]=_[_0x0a58('0x2b')](_0x48a56c,_0x0a58('0x28'));_0x868ffc[_0x0a58('0x30')]=_['keys'](_0x58a4d9[_0x0a58('0x30')]);_0x868ffc[_0x0a58('0x31')]=_['intersection'](_0x868ffc['model'],_0x868ffc['query']);_0x55938b[_0x0a58('0x32')]=_[_0x0a58('0x33')](_0x868ffc[_0x0a58('0x2f')],qs[_0x0a58('0x34')](_0x58a4d9['query'][_0x0a58('0x34')]));_0x55938b[_0x0a58('0x32')]=_0x55938b[_0x0a58('0x32')][_0x0a58('0x35')]?_0x55938b[_0x0a58('0x32')]:_0x868ffc['model'];if(!_0x58a4d9['query'][_0x0a58('0x36')](_0x0a58('0x37'))){_0x55938b[_0x0a58('0x1b')]=qs[_0x0a58('0x1b')](_0x58a4d9[_0x0a58('0x30')][_0x0a58('0x1b')]);_0x55938b[_0x0a58('0x19')]=qs['offset'](_0x58a4d9[_0x0a58('0x30')][_0x0a58('0x19')]);}_0x55938b['order']=qs['sort'](_0x58a4d9[_0x0a58('0x30')]['sort']);_0x55938b[_0x0a58('0x38')]=qs[_0x0a58('0x31')](_['pick'](_0x58a4d9[_0x0a58('0x30')],_0x868ffc['filters']),_0x48a56c);if(_0x58a4d9['query']['filter']){_0x55938b[_0x0a58('0x38')]=_[_0x0a58('0x39')](_0x55938b[_0x0a58('0x38')],{'$or':_[_0x0a58('0x2b')](_0x48a56c,function(_0x2ed921){if(_0x2ed921['type']!==_0x0a58('0x3a')){var _0x3402ee={};_0x3402ee[_0x2ed921[_0x0a58('0x28')]]={'$like':'%'+_0x58a4d9['query'][_0x0a58('0x3b')]+'%'};return _0x3402ee;}})});}_0x55938b=_['merge']({},_0x55938b,_0x58a4d9['options']);var _0x354b54={'where':_0x55938b['where']};return db[_0x0a58('0x2c')][_0x0a58('0x1c')](_0x354b54)['then'](function(_0x12f1d3){_0x55754d[_0x0a58('0x1c')]=_0x12f1d3;if(_0x58a4d9[_0x0a58('0x30')][_0x0a58('0x3c')]){_0x55938b[_0x0a58('0x3d')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x0a58('0x3e')](_0x55938b);})[_0x0a58('0x21')](function(_0x3b8465){_0x55754d[_0x0a58('0x3f')]=_0x3b8465;return _0x55754d;})['then'](respondWithFilteredResult(_0x147d34,_0x55938b))[_0x0a58('0x40')](handleError(_0x147d34,null));};exports[_0x0a58('0x41')]=function(_0x3c37bc,_0xb9f18e){var _0xd03a33={'raw':!![],'where':{'id':_0x3c37bc[_0x0a58('0x42')]['id']}},_0x489437={};_0x489437['model']=_[_0x0a58('0x43')](db[_0x0a58('0x2c')][_0x0a58('0x2d')]);_0x489437[_0x0a58('0x30')]=_['keys'](_0x3c37bc[_0x0a58('0x30')]);_0x489437[_0x0a58('0x31')]=_[_0x0a58('0x33')](_0x489437[_0x0a58('0x2f')],_0x489437[_0x0a58('0x30')]);_0xd03a33['attributes']=_['intersection'](_0x489437[_0x0a58('0x2f')],qs[_0x0a58('0x34')](_0x3c37bc[_0x0a58('0x30')][_0x0a58('0x34')]));_0xd03a33['attributes']=_0xd03a33[_0x0a58('0x32')][_0x0a58('0x35')]?_0xd03a33[_0x0a58('0x32')]:_0x489437[_0x0a58('0x2f')];if(_0x3c37bc[_0x0a58('0x30')]['includeAll']){_0xd03a33[_0x0a58('0x3d')]=[{'all':!![]}];}_0xd03a33=_['merge']({},_0xd03a33,_0x3c37bc[_0x0a58('0x44')]);return db[_0x0a58('0x2c')][_0x0a58('0x45')](_0xd03a33)[_0x0a58('0x21')](handleEntityNotFound(_0xb9f18e,null))[_0x0a58('0x21')](respondWithResult(_0xb9f18e,null))[_0x0a58('0x40')](handleError(_0xb9f18e,null));};exports[_0x0a58('0x46')]=function(_0x19cd69,_0x417f7f){return db['CmHopperAdditionalPhone'][_0x0a58('0x46')](_0x19cd69[_0x0a58('0x47')],{})[_0x0a58('0x21')](function(_0x19f6cf){var _0x197ed9=_0x19cd69[_0x0a58('0x48')]['get']({'plain':!![]});if(!_0x197ed9)throw new Error(_0x0a58('0x49'));if(_0x197ed9['role']===_0x0a58('0x48')){var _0x5e9f84=_0x19f6cf[_0x0a58('0x22')]({'plain':!![]});var _0x104bc4='CmHopperAdditionalPhones';return db[_0x0a58('0x4a')]['find']({'where':{'name':_0x104bc4,'userProfileId':_0x197ed9[_0x0a58('0x4b')]},'raw':!![]})['then'](function(_0x233c0b){if(_0x233c0b&&_0x233c0b['autoAssociation']===0x0){return db[_0x0a58('0x4c')][_0x0a58('0x46')]({'name':_0x5e9f84['name'],'resourceId':_0x5e9f84['id'],'type':_0x233c0b[_0x0a58('0x28')],'sectionId':_0x233c0b['id']},{})['then'](function(){return _0x19f6cf;});}else{return _0x19f6cf;}})['catch'](function(_0x50f10a){logger['error'](_0x0a58('0x4d'),_0x50f10a);throw _0x50f10a;});}return _0x19f6cf;})['then'](respondWithResult(_0x417f7f,0xc9))['catch'](handleError(_0x417f7f,null));};exports['update']=function(_0x3782cd,_0x2475ab){if(_0x3782cd['body']['id']){delete _0x3782cd['body']['id'];}return db[_0x0a58('0x2c')][_0x0a58('0x45')]({'where':{'id':_0x3782cd[_0x0a58('0x42')]['id']}})['then'](handleEntityNotFound(_0x2475ab,null))[_0x0a58('0x21')](saveUpdates(_0x3782cd[_0x0a58('0x47')],null))['then'](respondWithResult(_0x2475ab,null))['catch'](handleError(_0x2475ab,null));};exports[_0x0a58('0x23')]=function(_0x4b4d09,_0x39226f){return db[_0x0a58('0x2c')][_0x0a58('0x45')]({'where':{'id':_0x4b4d09['params']['id']}})[_0x0a58('0x21')](handleEntityNotFound(_0x39226f,null))[_0x0a58('0x21')](removeEntity(_0x39226f,null))['catch'](handleError(_0x39226f,null));}; \ No newline at end of file +var _0x3c40=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x4a6208,_0x9debb3){var _0x30f71d=function(_0x3f97e0){while(--_0x3f97e0){_0x4a6208['push'](_0x4a6208['shift']());}};_0x30f71d(++_0x9debb3);}(_0x3c40,0x108));var _0x03c4=function(_0x3958fe,_0x3c6605){_0x3958fe=_0x3958fe-0x0;var _0x1f27d6=_0x3c40[_0x3958fe];return _0x1f27d6;};'use strict';var emlformat=require(_0x03c4('0x0'));var rimraf=require(_0x03c4('0x1'));var zipdir=require(_0x03c4('0x2'));var jsonpatch=require(_0x03c4('0x3'));var rp=require(_0x03c4('0x4'));var moment=require(_0x03c4('0x5'));var BPromise=require(_0x03c4('0x6'));var Mustache=require(_0x03c4('0x7'));var util=require(_0x03c4('0x8'));var path=require(_0x03c4('0x9'));var sox=require(_0x03c4('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03c4('0xb'));var _=require('lodash');var squel=require(_0x03c4('0xc'));var crypto=require(_0x03c4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x03c4('0xe'));var querystring=require(_0x03c4('0xf'));var Papa=require(_0x03c4('0x10'));var Redis=require(_0x03c4('0x11'));var authService=require(_0x03c4('0x12'));var qs=require(_0x03c4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03c4('0x14'));var logger=require(_0x03c4('0x15'))(_0x03c4('0x16'));var utils=require(_0x03c4('0x17'));var config=require(_0x03c4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x03c4('0x19'))['db'];function respondWithStatusCode(_0x57b757,_0x550e7a){_0x550e7a=_0x550e7a||0xcc;return function(_0x28ed6b){if(_0x28ed6b){return _0x57b757[_0x03c4('0x1a')](_0x550e7a);}return _0x57b757[_0x03c4('0x1b')](_0x550e7a)[_0x03c4('0x1c')]();};}function respondWithResult(_0x38a40c,_0x176ddf){_0x176ddf=_0x176ddf||0xc8;return function(_0x3bea84){if(_0x3bea84){return _0x38a40c[_0x03c4('0x1b')](_0x176ddf)[_0x03c4('0x1d')](_0x3bea84);}};}function respondWithFilteredResult(_0x3fb2fe,_0x4cd25a){return function(_0x9eeaf4){if(_0x9eeaf4){var _0x5b1c6a=typeof _0x4cd25a[_0x03c4('0x1e')]===_0x03c4('0x1f')&&typeof _0x4cd25a['limit']===_0x03c4('0x1f');var _0xfb9cca=_0x9eeaf4['count'];var _0x2dc35a=_0x5b1c6a?0x0:_0x4cd25a[_0x03c4('0x1e')];var _0x533563=_0x5b1c6a?_0x9eeaf4[_0x03c4('0x20')]:_0x4cd25a[_0x03c4('0x1e')]+_0x4cd25a[_0x03c4('0x21')];var _0x2848e2;if(_0x533563>=_0xfb9cca){_0x533563=_0xfb9cca;_0x2848e2=0xc8;}else{_0x2848e2=0xce;}_0x3fb2fe[_0x03c4('0x1b')](_0x2848e2);return _0x3fb2fe[_0x03c4('0x22')]('Content-Range',_0x2dc35a+'-'+_0x533563+'/'+_0xfb9cca)['json'](_0x9eeaf4);}return null;};}function patchUpdates(_0x4f28a5){return function(_0x2ee4c0){try{jsonpatch[_0x03c4('0x23')](_0x2ee4c0,_0x4f28a5,!![]);}catch(_0x8c20b1){return BPromise[_0x03c4('0x24')](_0x8c20b1);}return _0x2ee4c0[_0x03c4('0x25')]();};}function saveUpdates(_0x130a35,_0x27e47f){return function(_0x2b4012){if(_0x2b4012){return _0x2b4012[_0x03c4('0x26')](_0x130a35)[_0x03c4('0x27')](function(_0x436aff){return _0x436aff;});}return null;};}function removeEntity(_0x5adb2c,_0x15706b){return function(_0x6ec08d){if(_0x6ec08d){return _0x6ec08d[_0x03c4('0x28')]()['then'](function(){var _0xa5fce4=_0x6ec08d[_0x03c4('0x29')]({'plain':!![]});var _0x9e5f48=_0x03c4('0x2a');return db[_0x03c4('0x2b')][_0x03c4('0x28')]({'where':{'type':_0x9e5f48,'resourceId':_0xa5fce4['id']}})[_0x03c4('0x27')](function(){return _0x6ec08d;});})[_0x03c4('0x27')](function(){_0x5adb2c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b996c,_0x49ed78){return function(_0x3eccb9){if(!_0x3eccb9){_0x3b996c['sendStatus'](0x194);}return _0x3eccb9;};}function handleError(_0x5d1e0a,_0x8f64b3){_0x8f64b3=_0x8f64b3||0x1f4;return function(_0x17f3df){logger['error'](_0x17f3df[_0x03c4('0x2c')]);if(_0x17f3df[_0x03c4('0x2d')]){delete _0x17f3df[_0x03c4('0x2d')];}_0x5d1e0a[_0x03c4('0x1b')](_0x8f64b3)[_0x03c4('0x2e')](_0x17f3df);};}exports[_0x03c4('0x2f')]=function(_0xfd51b3,_0x466879){var _0x39e95f={},_0x2d8a34={},_0x5c7213={'count':0x0,'rows':[]};var _0x404747=_[_0x03c4('0x30')](db[_0x03c4('0x31')][_0x03c4('0x32')],function(_0x172966){return{'name':_0x172966[_0x03c4('0x33')],'type':_0x172966[_0x03c4('0x34')][_0x03c4('0x35')]};});_0x2d8a34[_0x03c4('0x36')]=_[_0x03c4('0x30')](_0x404747,_0x03c4('0x2d'));_0x2d8a34['query']=_['keys'](_0xfd51b3['query']);_0x2d8a34[_0x03c4('0x37')]=_[_0x03c4('0x38')](_0x2d8a34['model'],_0x2d8a34[_0x03c4('0x39')]);_0x39e95f[_0x03c4('0x3a')]=_[_0x03c4('0x38')](_0x2d8a34[_0x03c4('0x36')],qs[_0x03c4('0x3b')](_0xfd51b3[_0x03c4('0x39')][_0x03c4('0x3b')]));_0x39e95f['attributes']=_0x39e95f[_0x03c4('0x3a')]['length']?_0x39e95f['attributes']:_0x2d8a34[_0x03c4('0x36')];if(!_0xfd51b3[_0x03c4('0x39')][_0x03c4('0x3c')](_0x03c4('0x3d'))){_0x39e95f[_0x03c4('0x21')]=qs[_0x03c4('0x21')](_0xfd51b3[_0x03c4('0x39')]['limit']);_0x39e95f['offset']=qs[_0x03c4('0x1e')](_0xfd51b3[_0x03c4('0x39')][_0x03c4('0x1e')]);}_0x39e95f[_0x03c4('0x3e')]=qs['sort'](_0xfd51b3[_0x03c4('0x39')][_0x03c4('0x3f')]);_0x39e95f[_0x03c4('0x40')]=qs['filters'](_[_0x03c4('0x41')](_0xfd51b3[_0x03c4('0x39')],_0x2d8a34['filters']),_0x404747);if(_0xfd51b3[_0x03c4('0x39')][_0x03c4('0x42')]){_0x39e95f[_0x03c4('0x40')]=_[_0x03c4('0x43')](_0x39e95f[_0x03c4('0x40')],{'$or':_[_0x03c4('0x30')](_0x404747,function(_0x1a5925){if(_0x1a5925[_0x03c4('0x34')]!=='VIRTUAL'){var _0x56c245={};_0x56c245[_0x1a5925[_0x03c4('0x2d')]]={'$like':'%'+_0xfd51b3[_0x03c4('0x39')]['filter']+'%'};return _0x56c245;}})});}_0x39e95f=_[_0x03c4('0x43')]({},_0x39e95f,_0xfd51b3[_0x03c4('0x44')]);var _0x48935d={'where':_0x39e95f['where']};return db[_0x03c4('0x31')][_0x03c4('0x20')](_0x48935d)[_0x03c4('0x27')](function(_0xcc6df6){_0x5c7213[_0x03c4('0x20')]=_0xcc6df6;if(_0xfd51b3[_0x03c4('0x39')][_0x03c4('0x45')]){_0x39e95f[_0x03c4('0x46')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x03c4('0x47')](_0x39e95f);})['then'](function(_0xc27ae5){_0x5c7213[_0x03c4('0x48')]=_0xc27ae5;return _0x5c7213;})[_0x03c4('0x27')](respondWithFilteredResult(_0x466879,_0x39e95f))['catch'](handleError(_0x466879,null));};exports[_0x03c4('0x49')]=function(_0x3a2fd3,_0x2a912a){var _0x122ef4={'raw':!![],'where':{'id':_0x3a2fd3[_0x03c4('0x4a')]['id']}},_0x41a4c2={};_0x41a4c2['model']=_[_0x03c4('0x4b')](db[_0x03c4('0x31')][_0x03c4('0x32')]);_0x41a4c2[_0x03c4('0x39')]=_[_0x03c4('0x4b')](_0x3a2fd3[_0x03c4('0x39')]);_0x41a4c2[_0x03c4('0x37')]=_[_0x03c4('0x38')](_0x41a4c2[_0x03c4('0x36')],_0x41a4c2[_0x03c4('0x39')]);_0x122ef4['attributes']=_['intersection'](_0x41a4c2[_0x03c4('0x36')],qs[_0x03c4('0x3b')](_0x3a2fd3[_0x03c4('0x39')][_0x03c4('0x3b')]));_0x122ef4[_0x03c4('0x3a')]=_0x122ef4['attributes'][_0x03c4('0x4c')]?_0x122ef4[_0x03c4('0x3a')]:_0x41a4c2[_0x03c4('0x36')];if(_0x3a2fd3[_0x03c4('0x39')][_0x03c4('0x45')]){_0x122ef4['include']=[{'all':!![]}];}_0x122ef4=_[_0x03c4('0x43')]({},_0x122ef4,_0x3a2fd3[_0x03c4('0x44')]);return db[_0x03c4('0x31')][_0x03c4('0x4d')](_0x122ef4)[_0x03c4('0x27')](handleEntityNotFound(_0x2a912a,null))[_0x03c4('0x27')](respondWithResult(_0x2a912a,null))[_0x03c4('0x4e')](handleError(_0x2a912a,null));};exports[_0x03c4('0x4f')]=function(_0x57eff4,_0x21d5e9){return db[_0x03c4('0x31')][_0x03c4('0x4f')](_0x57eff4[_0x03c4('0x50')],{})[_0x03c4('0x27')](function(_0x238f79){var _0x30078c=_0x57eff4[_0x03c4('0x51')][_0x03c4('0x29')]({'plain':!![]});if(!_0x30078c)throw new Error(_0x03c4('0x52'));if(_0x30078c[_0x03c4('0x53')]===_0x03c4('0x51')){var _0x4b8573=_0x238f79[_0x03c4('0x29')]({'plain':!![]});var _0x26b030=_0x03c4('0x2a');return db[_0x03c4('0x54')]['find']({'where':{'name':_0x26b030,'userProfileId':_0x30078c[_0x03c4('0x55')]},'raw':!![]})[_0x03c4('0x27')](function(_0x514273){if(_0x514273&&_0x514273[_0x03c4('0x56')]===0x0){return db[_0x03c4('0x2b')][_0x03c4('0x4f')]({'name':_0x4b8573[_0x03c4('0x2d')],'resourceId':_0x4b8573['id'],'type':_0x514273[_0x03c4('0x2d')],'sectionId':_0x514273['id']},{})['then'](function(){return _0x238f79;});}else{return _0x238f79;}})[_0x03c4('0x4e')](function(_0x2ff6bd){logger[_0x03c4('0x57')](_0x03c4('0x58'),_0x2ff6bd);throw _0x2ff6bd;});}return _0x238f79;})[_0x03c4('0x27')](respondWithResult(_0x21d5e9,0xc9))['catch'](handleError(_0x21d5e9,null));};exports[_0x03c4('0x26')]=function(_0x8320ae,_0x504860){if(_0x8320ae[_0x03c4('0x50')]['id']){delete _0x8320ae[_0x03c4('0x50')]['id'];}return db['CmHopperAdditionalPhone'][_0x03c4('0x4d')]({'where':{'id':_0x8320ae['params']['id']}})['then'](handleEntityNotFound(_0x504860,null))[_0x03c4('0x27')](saveUpdates(_0x8320ae[_0x03c4('0x50')],null))[_0x03c4('0x27')](respondWithResult(_0x504860,null))['catch'](handleError(_0x504860,null));};exports['destroy']=function(_0x2f0eae,_0x2e91f4){return db[_0x03c4('0x31')][_0x03c4('0x4d')]({'where':{'id':_0x2f0eae['params']['id']}})[_0x03c4('0x27')](handleEntityNotFound(_0x2e91f4,null))[_0x03c4('0x27')](removeEntity(_0x2e91f4,null))[_0x03c4('0x4e')](handleError(_0x2e91f4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 9d0be61..858e915 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5342=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','lodash','util','../../config/logger','moment'];(function(_0x153b65,_0x53a3b5){var _0xed12fc=function(_0x49ce5e){while(--_0x49ce5e){_0x153b65['push'](_0x153b65['shift']());}};_0xed12fc(++_0x53a3b5);}(_0x5342,0xb2));var _0x2534=function(_0x451d04,_0x999e7d){_0x451d04=_0x451d04-0x0;var _0x32c6fe=_0x5342[_0x451d04];return _0x32c6fe;};'use strict';var _=require(_0x2534('0x0'));var util=require(_0x2534('0x1'));var logger=require(_0x2534('0x2'))('api');var moment=require(_0x2534('0x3'));var BPromise=require(_0x2534('0x4'));var rp=require(_0x2534('0x5'));var fs=require('fs');var path=require(_0x2534('0x6'));var rimraf=require(_0x2534('0x7'));var config=require(_0x2534('0x8'));var attributes=require(_0x2534('0x9'));module[_0x2534('0xa')]=function(_0x5a424f,_0x4c875d){return _0x5a424f[_0x2534('0xb')](_0x2534('0xc'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa2c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0xaa2c,0x1a3));var _0xcaa2=function(_0x1d7a5f,_0x2dd9a6){_0x1d7a5f=_0x1d7a5f-0x0;var _0x418a13=_0xaa2c[_0x1d7a5f];return _0x418a13;};'use strict';var _=require(_0xcaa2('0x0'));var util=require(_0xcaa2('0x1'));var logger=require(_0xcaa2('0x2'))(_0xcaa2('0x3'));var moment=require(_0xcaa2('0x4'));var BPromise=require(_0xcaa2('0x5'));var rp=require(_0xcaa2('0x6'));var fs=require('fs');var path=require(_0xcaa2('0x7'));var rimraf=require('rimraf');var config=require(_0xcaa2('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x4128d7,_0x2258d6){return _0x4128d7[_0xcaa2('0x9')](_0xcaa2('0xa'),attributes,{'tableName':_0xcaa2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 874f25c..821b034 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde60=['update','field','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VerifyAdditionalPhones','CmHopper','ContactId','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','ASC','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','SwapAdditionalPhones','waitTime','isNil','scheduledat','minutes','add','phone','createdAt','updatedAt','activateAdditionalPhone','IncrementPreviewCounters'];(function(_0x35ce18,_0x5947be){var _0x2cf269=function(_0x233fa8){while(--_0x233fa8){_0x35ce18['push'](_0x35ce18['shift']());}};_0x2cf269(++_0x5947be);}(_0xde60,0x18a));var _0x0de6=function(_0x2ae22a,_0x4fe753){_0x2ae22a=_0x2ae22a-0x0;var _0x286a82=_0xde60[_0x2ae22a];return _0x286a82;};'use strict';var _=require(_0x0de6('0x0'));var util=require(_0x0de6('0x1'));var moment=require(_0x0de6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0de6('0x3'));var db=require(_0x0de6('0x4'))['db'];var utils=require(_0x0de6('0x5'));var logger=require(_0x0de6('0x6'))(_0x0de6('0x7'));var config=require(_0x0de6('0x8'));var jayson=require(_0x0de6('0x9'));var client=jayson[_0x0de6('0xa')][_0x0de6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fe487,_0x5ac422,_0x57e453){return new BPromise(function(_0x21a1a9,_0x376fb5){return client[_0x0de6('0xc')](_0x3fe487,_0x57e453)[_0x0de6('0xd')](function(_0x37af48){logger[_0x0de6('0xe')](_0x0de6('0xf'),_0x5ac422,_0x0de6('0x10'));logger[_0x0de6('0x11')](_0x0de6('0x12'),_0x5ac422,'request\x20sent',JSON[_0x0de6('0x13')](_0x37af48));if(_0x37af48['error']){if(_0x37af48[_0x0de6('0x14')]['code']===0x1f4){logger[_0x0de6('0x14')](_0x0de6('0xf'),_0x5ac422,_0x37af48[_0x0de6('0x14')][_0x0de6('0x15')]);return _0x376fb5(_0x37af48[_0x0de6('0x14')][_0x0de6('0x15')]);}logger[_0x0de6('0x14')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5ac422,_0x37af48['error'][_0x0de6('0x15')]);return _0x21a1a9(_0x37af48[_0x0de6('0x14')][_0x0de6('0x15')]);}else{logger['info'](_0x0de6('0xf'),_0x5ac422,_0x0de6('0x10'));_0x21a1a9(_0x37af48['result'][_0x0de6('0x15')]);}})[_0x0de6('0x16')](function(_0xa03d42){logger[_0x0de6('0x14')](_0x0de6('0xf'),_0x5ac422,_0xa03d42);_0x376fb5(_0xa03d42);});});}exports[_0x0de6('0x17')]=function(_0x1c3811){var _0x476c05=this;return new Promise(function(_0x267595,_0x2dd987){return db[_0x0de6('0x18')]['findOne']({'raw':!![],'where':{'ContactId':_0x1c3811['body'][_0x0de6('0x19')],'ListId':_0x1c3811[_0x0de6('0x1a')][_0x0de6('0x1b')],'VoiceQueueId':_0x1c3811[_0x0de6('0x1a')][_0x0de6('0x1c')]===undefined?null:_0x1c3811['body']['VoiceQueueId'],'CampaignId':_0x1c3811[_0x0de6('0x1a')][_0x0de6('0x1d')]===undefined?null:_0x1c3811[_0x0de6('0x1a')][_0x0de6('0x1d')]}})[_0x0de6('0xd')](function(_0x4e5457){if(_0x4e5457!=null){return db[_0x0de6('0x1e')][_0x0de6('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x4e5457['id'],'OrderBy':{'$gt':_0x4e5457['OrderBy']}},'order':[['OrderBy',_0x0de6('0x20')]]})['then'](function(_0x5cb553){var _0x5816b7=0x0;if(_0x5cb553){if(_0x5cb553['countbusyretry']+_0x5cb553['countcongestionretry']+_0x5cb553['countnoanswerretry']+_0x5cb553[_0x0de6('0x21')]+_0x5cb553[_0x0de6('0x22')]+_0x5cb553[_0x0de6('0x23')]+_0x5cb553[_0x0de6('0x24')]+_0x5cb553['countagentrejectretry']<_0x1c3811['entity'][_0x0de6('0x25')])_0x5816b7=0x1;_0x267595({'additional':_0x5816b7});}else{return db[_0x0de6('0x1e')][_0x0de6('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x4e5457['id']},'order':[[_0x0de6('0x26'),_0x0de6('0x20')]]})['then'](function(_0xfe1ff1){var _0x544dfa=0x0;if(_0xfe1ff1){if(_0xfe1ff1[_0x0de6('0x27')]+_0xfe1ff1[_0x0de6('0x28')]+_0xfe1ff1[_0x0de6('0x29')]+_0xfe1ff1['countnosuchnumberretry']+_0xfe1ff1[_0x0de6('0x22')]+_0xfe1ff1[_0x0de6('0x23')]+_0xfe1ff1[_0x0de6('0x24')]+_0xfe1ff1[_0x0de6('0x2a')]<_0x1c3811['entity'][_0x0de6('0x25')])_0x544dfa=0x1;_0x267595({'additional':_0x544dfa});}else{_0x267595({'additional':0x0});}})['catch'](function(_0x35ba77){logger['error'](_0x0de6('0x17'),_0x35ba77[_0x0de6('0x15')]);_0x2dd987(_0x476c05[_0x0de6('0x14')](0x1f4,_0x35ba77['message']));});}})[_0x0de6('0x16')](function(_0x131046){logger[_0x0de6('0x14')](_0x0de6('0x17'),_0x131046[_0x0de6('0x15')]);_0x2dd987(_0x476c05['error'](0x1f4,_0x131046[_0x0de6('0x15')]));});}else _0x267595({'additional':0x0});});});};exports[_0x0de6('0x2b')]=function(_0x3d5dc7){var _0x1bdc7c=this;return new Promise(function(_0x3960e5,_0x5e6b5c){return db['CmHopper'][_0x0de6('0x1f')]({'raw':!![],'where':{'ContactId':_0x3d5dc7[_0x0de6('0x1a')]['ContactId'],'ListId':_0x3d5dc7[_0x0de6('0x1a')][_0x0de6('0x1b')],'VoiceQueueId':_0x3d5dc7['body']['VoiceQueueId']===undefined?null:_0x3d5dc7[_0x0de6('0x1a')][_0x0de6('0x1c')],'CampaignId':_0x3d5dc7[_0x0de6('0x1a')][_0x0de6('0x1d')]===undefined?null:_0x3d5dc7[_0x0de6('0x1a')][_0x0de6('0x1d')]}})[_0x0de6('0xd')](function(_0x564774){if(_0x564774!=null){return db[_0x0de6('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x564774['id'],'OrderBy':{'$gte':_0x564774[_0x0de6('0x26')]}},'order':[[_0x0de6('0x26'),'ASC']]})['then'](function(_0x4f4edb){if(_0x4f4edb)return activateAdditionalPhone(_0x564774,_0x3d5dc7[_0x0de6('0x1a')],_0x4f4edb,_0x3d5dc7['duration'],_0x3d5dc7['waitTime'])['then'](function(_0x17c6e4){_0x3960e5(_0x17c6e4);});else{return db[_0x0de6('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x564774['id']},'order':[[_0x0de6('0x26'),'ASC']]})[_0x0de6('0xd')](function(_0x1495bd){if(_0x1495bd)return activateAdditionalPhone(_0x564774,_0x3d5dc7[_0x0de6('0x1a')],_0x1495bd,_0x3d5dc7['duration'],_0x3d5dc7[_0x0de6('0x2c')])[_0x0de6('0xd')](function(_0x12b894){_0x3960e5(_0x12b894);});else{_0x3960e5({'id':_0x564774['id'],'phone':''});}})[_0x0de6('0x16')](function(_0x205cfa){logger[_0x0de6('0x14')](_0x0de6('0x17'),_0x205cfa[_0x0de6('0x15')]);_0x5e6b5c(_0x1bdc7c['error'](0x1f4,_0x205cfa[_0x0de6('0x15')]));});}})[_0x0de6('0x16')](function(_0x333ac9){logger[_0x0de6('0x14')]('VerifyAdditionalPhones',_0x333ac9['message']);_0x5e6b5c(_0x1bdc7c[_0x0de6('0x14')](0x1f4,_0x333ac9[_0x0de6('0x15')]));});}else _0x3960e5(0x1);});});};function activateAdditionalPhone(_0x55fe18,_0x1071b7,_0x17e8fc,_0x4229ec,_0x36e5f4){return new Promise(function(_0x4516f1,_0x15d27a){var _0x26d637;if(_[_0x0de6('0x2d')](_0x17e8fc[_0x0de6('0x2e')])){_0x17e8fc['scheduledat']=moment();}if(moment()>moment(_0x17e8fc[_0x0de6('0x2e')])){_0x26d637=moment()['add'](_0x36e5f4||0x3,_0x0de6('0x2f'));}else{if(_0x17e8fc[_0x0de6('0x26')]==0x0){_0x26d637=moment(_0x17e8fc[_0x0de6('0x2e')]);}else{_0x26d637=moment()[_0x0de6('0x30')](_0x36e5f4||0x3,'minutes');}}if(_[_0x0de6('0x2d')](_0x26d637)){_0x26d637=moment()[_0x0de6('0x30')](_0x36e5f4||0x3,_0x0de6('0x2f'));}var _0x3f70c3={'phone':_0x55fe18[_0x0de6('0x31')],'active':0x0,'OrderBy':_[_0x0de6('0x2d')](_0x55fe18[_0x0de6('0x26')])?0x0:_0x55fe18['OrderBy'],'scheduledat':moment()[_0x0de6('0x30')](_0x4229ec||0x1,_0x0de6('0x2f')),'countbusyretry':_0x1071b7[_0x0de6('0x27')],'countcongestionretry':_0x1071b7[_0x0de6('0x28')],'countnoanswerretry':_0x1071b7[_0x0de6('0x29')],'countnosuchnumberretry':_0x1071b7['countnosuchnumberretry'],'countdropretry':_0x1071b7[_0x0de6('0x22')],'countabandonedretry':_0x1071b7[_0x0de6('0x23')],'countmachineretry':_0x1071b7[_0x0de6('0x24')],'countagentrejectretry':_0x1071b7[_0x0de6('0x2a')],'createdAt':_0x1071b7[_0x0de6('0x32')],'updatedAt':_0x1071b7[_0x0de6('0x33')]};var _0xb52597={'CmHopperId':_0x55fe18['id'],'phone':_0x17e8fc['phone'],'active':0x0,'OrderBy':_[_0x0de6('0x2d')](_0x17e8fc['OrderBy'])?0x0:_0x17e8fc['OrderBy'],'scheduledat':_0x26d637,'countbusyretry':_0x17e8fc[_0x0de6('0x27')],'countcongestionretry':_0x17e8fc['countcongestionretry'],'countnoanswerretry':_0x17e8fc[_0x0de6('0x29')],'countnosuchnumberretry':_0x17e8fc[_0x0de6('0x21')],'countdropretry':_0x17e8fc[_0x0de6('0x22')],'countabandonedretry':_0x17e8fc[_0x0de6('0x23')],'countmachineretry':_0x17e8fc[_0x0de6('0x24')],'countagentrejectretry':_0x17e8fc[_0x0de6('0x2a')],'createdAt':_0x17e8fc[_0x0de6('0x32')],'updatedAt':_0x17e8fc[_0x0de6('0x33')]};return db['sequelize']['transaction'](function(_0x27b589){return db['CmHopperAdditionalPhone']['update'](_0x3f70c3,{'where':{'id':_0x17e8fc['id']}},{'transaction':_0x27b589})[_0x0de6('0xd')](function(){return db[_0x0de6('0x18')]['update'](_0xb52597,{'where':{'id':_0x55fe18['id']}},{'transaction':_0x27b589});});})['then'](function(_0x33f94a){_0x4516f1({'id':_0x55fe18['id'],'phone':_0x17e8fc[_0x0de6('0x31')]});})[_0x0de6('0x16')](function(_0x590d51){logger['error'](_0x0de6('0x34'),_0x590d51['message']);_0x15d27a({'error':_0x590d51[_0x0de6('0x15')]});});});}exports[_0x0de6('0x35')]=function(_0x54a804){var _0x8c5463=this;return new Promise(function(_0x27d5a0,_0x2c919b){return db[_0x0de6('0x18')][_0x0de6('0x36')](_0x54a804[_0x0de6('0x1a')][_0x0de6('0x37')],{'where':{'id':_0x54a804[_0x0de6('0x1a')]['id']}})[_0x0de6('0xd')](function(_0x587b67){_0x27d5a0(_0x587b67);})[_0x0de6('0x16')](function(_0x579ce4){logger[_0x0de6('0x14')](_0x0de6('0x35'),_0x579ce4[_0x0de6('0x15')]);_0x2c919b(_0x8c5463[_0x0de6('0x14')](0x1f4,_0x579ce4[_0x0de6('0x15')]));});});}; \ No newline at end of file +var _0xdaa7=['updatedAt','sequelize','activateAdditionalPhone','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','CampaignId','then','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','CmHopperAdditionalPhone','entity','SwapAdditionalPhones','ListId','VoiceQueueId','waitTime','duration','isNil','scheduledat','add','minutes','phone','countbusyretry'];(function(_0x589791,_0x4f65e7){var _0x39f3da=function(_0x2689eb){while(--_0x2689eb){_0x589791['push'](_0x589791['shift']());}};_0x39f3da(++_0x4f65e7);}(_0xdaa7,0x154));var _0x7daa=function(_0x1deb72,_0x3f6338){_0x1deb72=_0x1deb72-0x0;var _0x18bbdf=_0xdaa7[_0x1deb72];return _0x18bbdf;};'use strict';var _=require(_0x7daa('0x0'));var util=require(_0x7daa('0x1'));var moment=require(_0x7daa('0x2'));var BPromise=require(_0x7daa('0x3'));var rs=require(_0x7daa('0x4'));var fs=require('fs');var Redis=require(_0x7daa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7daa('0x6'));var logger=require(_0x7daa('0x7'))(_0x7daa('0x8'));var config=require(_0x7daa('0x9'));var jayson=require(_0x7daa('0xa'));var client=jayson[_0x7daa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd635,_0x36bb24,_0x372551){return new BPromise(function(_0x6f8855,_0x5d32c4){return client['request'](_0x4fd635,_0x372551)['then'](function(_0x39763c){logger[_0x7daa('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x36bb24,_0x7daa('0xd'));logger['debug'](_0x7daa('0xe'),_0x36bb24,_0x7daa('0xd'),JSON[_0x7daa('0xf')](_0x39763c));if(_0x39763c['error']){if(_0x39763c[_0x7daa('0x10')][_0x7daa('0x11')]===0x1f4){logger[_0x7daa('0x10')](_0x7daa('0x12'),_0x36bb24,_0x39763c[_0x7daa('0x10')][_0x7daa('0x13')]);return _0x5d32c4(_0x39763c[_0x7daa('0x10')]['message']);}logger[_0x7daa('0x10')](_0x7daa('0x12'),_0x36bb24,_0x39763c[_0x7daa('0x10')][_0x7daa('0x13')]);return _0x6f8855(_0x39763c[_0x7daa('0x10')][_0x7daa('0x13')]);}else{logger[_0x7daa('0xc')](_0x7daa('0x12'),_0x36bb24,_0x7daa('0xd'));_0x6f8855(_0x39763c[_0x7daa('0x14')][_0x7daa('0x13')]);}})[_0x7daa('0x15')](function(_0x198782){logger['error'](_0x7daa('0x12'),_0x36bb24,_0x198782);_0x5d32c4(_0x198782);});});}exports[_0x7daa('0x16')]=function(_0x46ec05){var _0xa8d049=this;return new Promise(function(_0x65f0cb,_0x3e9b23){return db[_0x7daa('0x17')][_0x7daa('0x18')]({'raw':!![],'where':{'ContactId':_0x46ec05[_0x7daa('0x19')][_0x7daa('0x1a')],'ListId':_0x46ec05[_0x7daa('0x19')]['ListId'],'VoiceQueueId':_0x46ec05['body']['VoiceQueueId']===undefined?null:_0x46ec05[_0x7daa('0x19')]['VoiceQueueId'],'CampaignId':_0x46ec05['body'][_0x7daa('0x1b')]===undefined?null:_0x46ec05[_0x7daa('0x19')][_0x7daa('0x1b')]}})[_0x7daa('0x1c')](function(_0x38d58b){if(_0x38d58b!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x38d58b['id'],'OrderBy':{'$gt':_0x38d58b['OrderBy']}},'order':[[_0x7daa('0x1d'),_0x7daa('0x1e')]]})[_0x7daa('0x1c')](function(_0x3e8edf){var _0x4b3007=0x0;if(_0x3e8edf){if(_0x3e8edf['countbusyretry']+_0x3e8edf[_0x7daa('0x1f')]+_0x3e8edf[_0x7daa('0x20')]+_0x3e8edf[_0x7daa('0x21')]+_0x3e8edf[_0x7daa('0x22')]+_0x3e8edf[_0x7daa('0x23')]+_0x3e8edf[_0x7daa('0x24')]+_0x3e8edf[_0x7daa('0x25')]<_0x46ec05['entity'][_0x7daa('0x26')])_0x4b3007=0x1;_0x65f0cb({'additional':_0x4b3007});}else{return db[_0x7daa('0x27')][_0x7daa('0x18')]({'raw':!![],'where':{'CmHopperId':_0x38d58b['id']},'order':[['OrderBy','ASC']]})['then'](function(_0x315795){var _0x24201c=0x0;if(_0x315795){if(_0x315795['countbusyretry']+_0x315795['countcongestionretry']+_0x315795[_0x7daa('0x20')]+_0x315795[_0x7daa('0x21')]+_0x315795['countdropretry']+_0x315795[_0x7daa('0x23')]+_0x315795[_0x7daa('0x24')]+_0x315795[_0x7daa('0x25')]<_0x46ec05[_0x7daa('0x28')][_0x7daa('0x26')])_0x24201c=0x1;_0x65f0cb({'additional':_0x24201c});}else{_0x65f0cb({'additional':0x0});}})['catch'](function(_0x48496d){logger[_0x7daa('0x10')](_0x7daa('0x16'),_0x48496d['message']);_0x3e9b23(_0xa8d049['error'](0x1f4,_0x48496d['message']));});}})[_0x7daa('0x15')](function(_0x323c55){logger[_0x7daa('0x10')]('VerifyAdditionalPhones',_0x323c55['message']);_0x3e9b23(_0xa8d049[_0x7daa('0x10')](0x1f4,_0x323c55[_0x7daa('0x13')]));});}else _0x65f0cb({'additional':0x0});});});};exports[_0x7daa('0x29')]=function(_0x2b2715){var _0x7dbdfc=this;return new Promise(function(_0x221105,_0x189881){return db['CmHopper'][_0x7daa('0x18')]({'raw':!![],'where':{'ContactId':_0x2b2715['body'][_0x7daa('0x1a')],'ListId':_0x2b2715[_0x7daa('0x19')][_0x7daa('0x2a')],'VoiceQueueId':_0x2b2715['body'][_0x7daa('0x2b')]===undefined?null:_0x2b2715[_0x7daa('0x19')][_0x7daa('0x2b')],'CampaignId':_0x2b2715[_0x7daa('0x19')][_0x7daa('0x1b')]===undefined?null:_0x2b2715[_0x7daa('0x19')][_0x7daa('0x1b')]}})[_0x7daa('0x1c')](function(_0x2bfc4c){if(_0x2bfc4c!=null){return db[_0x7daa('0x27')][_0x7daa('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2bfc4c['id'],'OrderBy':{'$gte':_0x2bfc4c[_0x7daa('0x1d')]}},'order':[[_0x7daa('0x1d'),_0x7daa('0x1e')]]})[_0x7daa('0x1c')](function(_0x34e908){if(_0x34e908)return activateAdditionalPhone(_0x2bfc4c,_0x2b2715[_0x7daa('0x19')],_0x34e908,_0x2b2715['duration'],_0x2b2715[_0x7daa('0x2c')])['then'](function(_0x4e8f47){_0x221105(_0x4e8f47);});else{return db[_0x7daa('0x27')][_0x7daa('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2bfc4c['id']},'order':[[_0x7daa('0x1d'),'ASC']]})[_0x7daa('0x1c')](function(_0x3894e8){if(_0x3894e8)return activateAdditionalPhone(_0x2bfc4c,_0x2b2715['body'],_0x3894e8,_0x2b2715[_0x7daa('0x2d')],_0x2b2715[_0x7daa('0x2c')])['then'](function(_0x1b3364){_0x221105(_0x1b3364);});else{_0x221105({'id':_0x2bfc4c['id'],'phone':''});}})['catch'](function(_0x4b5d1f){logger[_0x7daa('0x10')]('VerifyAdditionalPhones',_0x4b5d1f[_0x7daa('0x13')]);_0x189881(_0x7dbdfc[_0x7daa('0x10')](0x1f4,_0x4b5d1f[_0x7daa('0x13')]));});}})[_0x7daa('0x15')](function(_0x3a8c77){logger[_0x7daa('0x10')](_0x7daa('0x16'),_0x3a8c77[_0x7daa('0x13')]);_0x189881(_0x7dbdfc[_0x7daa('0x10')](0x1f4,_0x3a8c77[_0x7daa('0x13')]));});}else _0x221105(0x1);});});};function activateAdditionalPhone(_0x1516a0,_0x3480eb,_0x2c2714,_0x5048a7,_0x449f32){return new Promise(function(_0x12147a,_0x34c357){var _0x76782a;if(_[_0x7daa('0x2e')](_0x2c2714[_0x7daa('0x2f')])){_0x2c2714[_0x7daa('0x2f')]=moment();}if(moment()>moment(_0x2c2714[_0x7daa('0x2f')])){_0x76782a=moment()[_0x7daa('0x30')](_0x449f32||0x3,_0x7daa('0x31'));}else{if(_0x2c2714[_0x7daa('0x1d')]==0x0){_0x76782a=moment(_0x2c2714[_0x7daa('0x2f')]);}else{_0x76782a=moment()['add'](_0x449f32||0x3,_0x7daa('0x31'));}}if(_[_0x7daa('0x2e')](_0x76782a)){_0x76782a=moment()[_0x7daa('0x30')](_0x449f32||0x3,_0x7daa('0x31'));}var _0x8d1478={'phone':_0x1516a0[_0x7daa('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x1516a0['OrderBy'])?0x0:_0x1516a0[_0x7daa('0x1d')],'scheduledat':moment()[_0x7daa('0x30')](_0x5048a7||0x1,_0x7daa('0x31')),'countbusyretry':_0x3480eb[_0x7daa('0x33')],'countcongestionretry':_0x3480eb[_0x7daa('0x1f')],'countnoanswerretry':_0x3480eb[_0x7daa('0x20')],'countnosuchnumberretry':_0x3480eb[_0x7daa('0x21')],'countdropretry':_0x3480eb['countdropretry'],'countabandonedretry':_0x3480eb[_0x7daa('0x23')],'countmachineretry':_0x3480eb[_0x7daa('0x24')],'countagentrejectretry':_0x3480eb[_0x7daa('0x25')],'createdAt':_0x3480eb['createdAt'],'updatedAt':_0x3480eb[_0x7daa('0x34')]};var _0x14a320={'CmHopperId':_0x1516a0['id'],'phone':_0x2c2714['phone'],'active':0x0,'OrderBy':_['isNil'](_0x2c2714[_0x7daa('0x1d')])?0x0:_0x2c2714['OrderBy'],'scheduledat':_0x76782a,'countbusyretry':_0x2c2714[_0x7daa('0x33')],'countcongestionretry':_0x2c2714[_0x7daa('0x1f')],'countnoanswerretry':_0x2c2714['countnoanswerretry'],'countnosuchnumberretry':_0x2c2714[_0x7daa('0x21')],'countdropretry':_0x2c2714[_0x7daa('0x22')],'countabandonedretry':_0x2c2714[_0x7daa('0x23')],'countmachineretry':_0x2c2714[_0x7daa('0x24')],'countagentrejectretry':_0x2c2714[_0x7daa('0x25')],'createdAt':_0x2c2714['createdAt'],'updatedAt':_0x2c2714[_0x7daa('0x34')]};return db[_0x7daa('0x35')]['transaction'](function(_0x4b710f){return db[_0x7daa('0x27')]['update'](_0x8d1478,{'where':{'id':_0x2c2714['id']}},{'transaction':_0x4b710f})[_0x7daa('0x1c')](function(){return db[_0x7daa('0x17')]['update'](_0x14a320,{'where':{'id':_0x1516a0['id']}},{'transaction':_0x4b710f});});})[_0x7daa('0x1c')](function(_0x54f1ae){_0x12147a({'id':_0x1516a0['id'],'phone':_0x2c2714[_0x7daa('0x32')]});})[_0x7daa('0x15')](function(_0x204db3){logger[_0x7daa('0x10')](_0x7daa('0x36'),_0x204db3[_0x7daa('0x13')]);_0x34c357({'error':_0x204db3[_0x7daa('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x4555a8){var _0x241fb3=this;return new Promise(function(_0x9c6d91,_0x3dbfe2){return db[_0x7daa('0x17')]['update'](_0x4555a8[_0x7daa('0x19')][_0x7daa('0x37')],{'where':{'id':_0x4555a8[_0x7daa('0x19')]['id']}})[_0x7daa('0x1c')](function(_0x5317c2){_0x9c6d91(_0x5317c2);})['catch'](function(_0x43897d){logger['error']('IncrementPreviewCounters',_0x43897d[_0x7daa('0x13')]);_0x3dbfe2(_0x241fb3[_0x7daa('0x10')](0x1f4,_0x43897d[_0x7daa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index bb8aa6a..66fff0f 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ba8=['exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy'];(function(_0x3c414c,_0x399dbb){var _0x4f3062=function(_0x1b71cc){while(--_0x1b71cc){_0x3c414c['push'](_0x3c414c['shift']());}};_0x4f3062(++_0x399dbb);}(_0x7ba8,0x17d));var _0x87ba=function(_0x2328c9,_0xfd6cce){_0x2328c9=_0x2328c9-0x0;var _0x5e02b4=_0x7ba8[_0x2328c9];return _0x5e02b4;};'use strict';var multer=require('multer');var util=require(_0x87ba('0x0'));var path=require(_0x87ba('0x1'));var timeout=require(_0x87ba('0x2'));var express=require(_0x87ba('0x3'));var router=express[_0x87ba('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x87ba('0x5'));var config=require(_0x87ba('0x6'));var controller=require(_0x87ba('0x7'));router[_0x87ba('0x8')]('/',auth[_0x87ba('0x9')](),controller[_0x87ba('0xa')]);router[_0x87ba('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x87ba('0xb')]);router['post']('/',auth[_0x87ba('0x9')](),controller[_0x87ba('0xc')]);router[_0x87ba('0xd')](_0x87ba('0xe'),auth[_0x87ba('0x9')](),controller[_0x87ba('0xf')]);router[_0x87ba('0x10')](_0x87ba('0xe'),auth['isAuthenticated'](),controller[_0x87ba('0x11')]);module[_0x87ba('0x12')]=router; \ No newline at end of file +var _0xe8cd=['show','post','isAuthenticated','create','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','index','/:id'];(function(_0x4de34c,_0xa0ed0c){var _0x2bbc55=function(_0x4d8e25){while(--_0x4d8e25){_0x4de34c['push'](_0x4de34c['shift']());}};_0x2bbc55(++_0xa0ed0c);}(_0xe8cd,0x152));var _0xde8c=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0xe8cd[_0x1e3c02];return _0x4d26d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xde8c('0x0'));var timeout=require(_0xde8c('0x1'));var express=require('express');var router=express[_0xde8c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xde8c('0x3'));var interaction=require(_0xde8c('0x4'));var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xde8c('0x5')]);router['get'](_0xde8c('0x6'),auth['isAuthenticated'](),controller[_0xde8c('0x7')]);router[_0xde8c('0x8')]('/',auth[_0xde8c('0x9')](),controller[_0xde8c('0xa')]);router['put'](_0xde8c('0x6'),auth[_0xde8c('0x9')](),controller[_0xde8c('0xb')]);router[_0xde8c('0xc')]('/:id',auth[_0xde8c('0x9')](),controller[_0xde8c('0xd')]);module[_0xde8c('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 7812534..470639d 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 _0xa7e6=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xa7e6,0x74));var _0x6a7e=function(_0xb4f240,_0x15f734){_0xb4f240=_0xb4f240-0x0;var _0x30682a=_0xa7e6[_0xb4f240];return _0x30682a;};'use strict';var moment=require(_0x6a7e('0x0'));var Sequelize=require(_0x6a7e('0x1'));module[_0x6a7e('0x2')]={'phone':{'type':Sequelize[_0x6a7e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6a7e('0x4')],'unique':_0x6a7e('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6a7e('0x5')},'VoiceQueueId':{'type':Sequelize[_0x6a7e('0x4')],'unique':_0x6a7e('0x5')}}; \ No newline at end of file +var _0xe451=['INTEGER','contactListQueue','exports'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0xe451,0xec));var _0x1e45=function(_0x1c5019,_0x413a46){_0x1c5019=_0x1c5019-0x0;var _0x13d696=_0xe451[_0x1c5019];return _0x13d696;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1e45('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x1e45('0x1')],'unique':_0x1e45('0x2')},'VoiceQueueId':{'type':Sequelize[_0x1e45('0x1')],'unique':_0x1e45('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index d820549..950b3ac 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 _0x8f9f=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../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','Content-Range','apply','reject','save','update','error','stack','name','send','index','CmHopperBlack','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','then','include','findAll','rows','catch','params','includeAll','find','body','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x167144,_0x54bab5){var _0x3b6076=function(_0x1aac0c){while(--_0x1aac0c){_0x167144['push'](_0x167144['shift']());}};_0x3b6076(++_0x54bab5);}(_0x8f9f,0x1be));var _0xf8f9=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8f9f[_0x82129b];return _0x2ae5dc;};'use strict';var emlformat=require(_0xf8f9('0x0'));var rimraf=require(_0xf8f9('0x1'));var zipdir=require(_0xf8f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf8f9('0x3'));var BPromise=require(_0xf8f9('0x4'));var Mustache=require(_0xf8f9('0x5'));var util=require(_0xf8f9('0x6'));var path=require('path');var sox=require(_0xf8f9('0x7'));var csv=require(_0xf8f9('0x8'));var ejs=require(_0xf8f9('0x9'));var fs=require('fs');var fs_extra=require(_0xf8f9('0xa'));var _=require(_0xf8f9('0xb'));var squel=require(_0xf8f9('0xc'));var crypto=require(_0xf8f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8f9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8f9('0xf'));var Papa=require(_0xf8f9('0x10'));var Redis=require(_0xf8f9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf8f9('0x12'));var hardwareService=require(_0xf8f9('0x13'));var logger=require(_0xf8f9('0x14'))(_0xf8f9('0x15'));var utils=require(_0xf8f9('0x16'));var config=require(_0xf8f9('0x17'));var licenseUtil=require(_0xf8f9('0x18'));var db=require(_0xf8f9('0x19'))['db'];function respondWithStatusCode(_0x3027a3,_0x5e0b99){_0x5e0b99=_0x5e0b99||0xcc;return function(_0x331a91){if(_0x331a91){return _0x3027a3[_0xf8f9('0x1a')](_0x5e0b99);}return _0x3027a3['status'](_0x5e0b99)[_0xf8f9('0x1b')]();};}function respondWithResult(_0x5420c8,_0x416c4a){_0x416c4a=_0x416c4a||0xc8;return function(_0x3ccaf4){if(_0x3ccaf4){return _0x5420c8[_0xf8f9('0x1c')](_0x416c4a)[_0xf8f9('0x1d')](_0x3ccaf4);}};}function respondWithFilteredResult(_0x2506b9,_0x563040){return function(_0x4373cb){if(_0x4373cb){var _0x614ccc=typeof _0x563040['offset']===_0xf8f9('0x1e')&&typeof _0x563040[_0xf8f9('0x1f')]===_0xf8f9('0x1e');var _0x42c6da=_0x4373cb[_0xf8f9('0x20')];var _0x84b397=_0x614ccc?0x0:_0x563040[_0xf8f9('0x21')];var _0xa76755=_0x614ccc?_0x4373cb['count']:_0x563040[_0xf8f9('0x21')]+_0x563040[_0xf8f9('0x1f')];var _0x54b3b1;if(_0xa76755>=_0x42c6da){_0xa76755=_0x42c6da;_0x54b3b1=0xc8;}else{_0x54b3b1=0xce;}_0x2506b9[_0xf8f9('0x1c')](_0x54b3b1);return _0x2506b9['set'](_0xf8f9('0x22'),_0x84b397+'-'+_0xa76755+'/'+_0x42c6da)[_0xf8f9('0x1d')](_0x4373cb);}return null;};}function patchUpdates(_0x2cc627){return function(_0x3e2093){try{jsonpatch[_0xf8f9('0x23')](_0x3e2093,_0x2cc627,!![]);}catch(_0x383079){return BPromise[_0xf8f9('0x24')](_0x383079);}return _0x3e2093[_0xf8f9('0x25')]();};}function saveUpdates(_0x1390a9,_0x81cb13){return function(_0x2725da){if(_0x2725da){return _0x2725da[_0xf8f9('0x26')](_0x1390a9)['then'](function(_0x22ff8c){return _0x22ff8c;});}return null;};}function removeEntity(_0x1eeaeb,_0x472eb0){return function(_0x16538e){if(_0x16538e){return _0x16538e['destroy']()['then'](function(){_0x1eeaeb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5798df,_0x34f37b){return function(_0x58dd93){if(!_0x58dd93){_0x5798df[_0xf8f9('0x1a')](0x194);}return _0x58dd93;};}function handleError(_0x1d1dcb,_0x1c0dce){_0x1c0dce=_0x1c0dce||0x1f4;return function(_0x7756eb){logger[_0xf8f9('0x27')](_0x7756eb[_0xf8f9('0x28')]);if(_0x7756eb[_0xf8f9('0x29')]){delete _0x7756eb[_0xf8f9('0x29')];}_0x1d1dcb['status'](_0x1c0dce)[_0xf8f9('0x2a')](_0x7756eb);};}exports[_0xf8f9('0x2b')]=function(_0x4d56bb,_0x2318fe){var _0x145208={},_0x8af9e7={},_0x293381={'count':0x0,'rows':[]};var _0x3d9ff0=_['map'](db[_0xf8f9('0x2c')][_0xf8f9('0x2d')],function(_0x1725af){return{'name':_0x1725af['fieldName'],'type':_0x1725af['type'][_0xf8f9('0x2e')]};});_0x8af9e7[_0xf8f9('0x2f')]=_['map'](_0x3d9ff0,_0xf8f9('0x29'));_0x8af9e7[_0xf8f9('0x30')]=_[_0xf8f9('0x31')](_0x4d56bb['query']);_0x8af9e7['filters']=_[_0xf8f9('0x32')](_0x8af9e7['model'],_0x8af9e7['query']);_0x145208[_0xf8f9('0x33')]=_[_0xf8f9('0x32')](_0x8af9e7[_0xf8f9('0x2f')],qs[_0xf8f9('0x34')](_0x4d56bb[_0xf8f9('0x30')]['fields']));_0x145208['attributes']=_0x145208[_0xf8f9('0x33')][_0xf8f9('0x35')]?_0x145208[_0xf8f9('0x33')]:_0x8af9e7[_0xf8f9('0x2f')];if(!_0x4d56bb[_0xf8f9('0x30')][_0xf8f9('0x36')](_0xf8f9('0x37'))){_0x145208[_0xf8f9('0x1f')]=qs[_0xf8f9('0x1f')](_0x4d56bb[_0xf8f9('0x30')][_0xf8f9('0x1f')]);_0x145208[_0xf8f9('0x21')]=qs['offset'](_0x4d56bb[_0xf8f9('0x30')]['offset']);}_0x145208[_0xf8f9('0x38')]=qs[_0xf8f9('0x39')](_0x4d56bb[_0xf8f9('0x30')][_0xf8f9('0x39')]);_0x145208[_0xf8f9('0x3a')]=qs[_0xf8f9('0x3b')](_[_0xf8f9('0x3c')](_0x4d56bb['query'],_0x8af9e7[_0xf8f9('0x3b')]),_0x3d9ff0);if(_0x4d56bb[_0xf8f9('0x30')][_0xf8f9('0x3d')]){_0x145208['where']=_[_0xf8f9('0x3e')](_0x145208['where'],{'$or':_['map'](_0x3d9ff0,function(_0x317402){if(_0x317402[_0xf8f9('0x3f')]!=='VIRTUAL'){var _0x1e05e8={};_0x1e05e8[_0x317402[_0xf8f9('0x29')]]={'$like':'%'+_0x4d56bb[_0xf8f9('0x30')]['filter']+'%'};return _0x1e05e8;}})});}_0x145208=_[_0xf8f9('0x3e')]({},_0x145208,_0x4d56bb[_0xf8f9('0x40')]);var _0x396b83={'where':_0x145208['where']};return db[_0xf8f9('0x2c')][_0xf8f9('0x20')](_0x396b83)[_0xf8f9('0x41')](function(_0x15b87e){_0x293381[_0xf8f9('0x20')]=_0x15b87e;if(_0x4d56bb['query']['includeAll']){_0x145208[_0xf8f9('0x42')]=[{'all':!![]}];}return db[_0xf8f9('0x2c')][_0xf8f9('0x43')](_0x145208);})[_0xf8f9('0x41')](function(_0x2b67ba){_0x293381[_0xf8f9('0x44')]=_0x2b67ba;return _0x293381;})['then'](respondWithFilteredResult(_0x2318fe,_0x145208))[_0xf8f9('0x45')](handleError(_0x2318fe,null));};exports['show']=function(_0x328345,_0x199231){var _0x175dd1={'raw':!![],'where':{'id':_0x328345[_0xf8f9('0x46')]['id']}},_0x315888={};_0x315888[_0xf8f9('0x2f')]=_[_0xf8f9('0x31')](db[_0xf8f9('0x2c')][_0xf8f9('0x2d')]);_0x315888[_0xf8f9('0x30')]=_[_0xf8f9('0x31')](_0x328345[_0xf8f9('0x30')]);_0x315888[_0xf8f9('0x3b')]=_[_0xf8f9('0x32')](_0x315888[_0xf8f9('0x2f')],_0x315888[_0xf8f9('0x30')]);_0x175dd1[_0xf8f9('0x33')]=_[_0xf8f9('0x32')](_0x315888[_0xf8f9('0x2f')],qs['fields'](_0x328345['query'][_0xf8f9('0x34')]));_0x175dd1['attributes']=_0x175dd1['attributes'][_0xf8f9('0x35')]?_0x175dd1[_0xf8f9('0x33')]:_0x315888['model'];if(_0x328345[_0xf8f9('0x30')][_0xf8f9('0x47')]){_0x175dd1[_0xf8f9('0x42')]=[{'all':!![]}];}_0x175dd1=_[_0xf8f9('0x3e')]({},_0x175dd1,_0x328345['options']);return db[_0xf8f9('0x2c')][_0xf8f9('0x48')](_0x175dd1)['then'](handleEntityNotFound(_0x199231,null))[_0xf8f9('0x41')](respondWithResult(_0x199231,null))[_0xf8f9('0x45')](handleError(_0x199231,null));};exports[_0xf8f9('0x26')]=function(_0x327016,_0x5bcecf){if(_0x327016[_0xf8f9('0x49')]['id']){delete _0x327016[_0xf8f9('0x49')]['id'];}return db[_0xf8f9('0x2c')][_0xf8f9('0x48')]({'where':{'id':_0x327016[_0xf8f9('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bcecf,null))[_0xf8f9('0x41')](saveUpdates(_0x327016[_0xf8f9('0x49')],null))[_0xf8f9('0x41')](respondWithResult(_0x5bcecf,null))[_0xf8f9('0x45')](handleError(_0x5bcecf,null));};exports[_0xf8f9('0x4a')]=function(_0x122a07,_0xd988bb){return db[_0xf8f9('0x2c')][_0xf8f9('0x48')]({'where':{'id':_0x122a07[_0xf8f9('0x46')]['id']}})[_0xf8f9('0x41')](handleEntityNotFound(_0xd988bb,null))[_0xf8f9('0x41')](removeEntity(_0xd988bb,null))[_0xf8f9('0x45')](handleError(_0xd988bb,null));};exports[_0xf8f9('0x4b')]=function(_0x2df8d6,_0x1792ae){return db[_0xf8f9('0x2c')][_0xf8f9('0x4b')]()[_0xf8f9('0x41')](respondWithResult(_0x1792ae,null))['catch'](handleError(_0x1792ae,null));}; \ No newline at end of file +var _0x4dcb=['includeAll','find','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','error','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','fields','length'];(function(_0x38f6e7,_0x26854d){var _0x4d9888=function(_0x430b22){while(--_0x430b22){_0x38f6e7['push'](_0x38f6e7['shift']());}};_0x4d9888(++_0x26854d);}(_0x4dcb,0x186));var _0xb4dc=function(_0x2e0c50,_0x246f18){_0x2e0c50=_0x2e0c50-0x0;var _0x3650f6=_0x4dcb[_0x2e0c50];return _0x3650f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4dc('0x0'));var zipdir=require(_0xb4dc('0x1'));var jsonpatch=require(_0xb4dc('0x2'));var rp=require(_0xb4dc('0x3'));var moment=require(_0xb4dc('0x4'));var BPromise=require(_0xb4dc('0x5'));var Mustache=require(_0xb4dc('0x6'));var util=require(_0xb4dc('0x7'));var path=require(_0xb4dc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb4dc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4dc('0xa'));var squel=require(_0xb4dc('0xb'));var crypto=require(_0xb4dc('0xc'));var jsforce=require(_0xb4dc('0xd'));var deskjs=require(_0xb4dc('0xe'));var toCsv=require(_0xb4dc('0xf'));var querystring=require('querystring');var Papa=require(_0xb4dc('0x10'));var Redis=require(_0xb4dc('0x11'));var authService=require(_0xb4dc('0x12'));var qs=require(_0xb4dc('0x13'));var as=require(_0xb4dc('0x14'));var hardwareService=require(_0xb4dc('0x15'));var logger=require(_0xb4dc('0x16'))(_0xb4dc('0x17'));var utils=require(_0xb4dc('0x18'));var config=require(_0xb4dc('0x19'));var licenseUtil=require(_0xb4dc('0x1a'));var db=require(_0xb4dc('0x1b'))['db'];function respondWithStatusCode(_0x41bc3c,_0x5d5ec0){_0x5d5ec0=_0x5d5ec0||0xcc;return function(_0x17669f){if(_0x17669f){return _0x41bc3c[_0xb4dc('0x1c')](_0x5d5ec0);}return _0x41bc3c[_0xb4dc('0x1d')](_0x5d5ec0)[_0xb4dc('0x1e')]();};}function respondWithResult(_0x242f58,_0x4fbad5){_0x4fbad5=_0x4fbad5||0xc8;return function(_0x5cd1dc){if(_0x5cd1dc){return _0x242f58[_0xb4dc('0x1d')](_0x4fbad5)[_0xb4dc('0x1f')](_0x5cd1dc);}};}function respondWithFilteredResult(_0x2144c4,_0x8dbc17){return function(_0x35e5dd){if(_0x35e5dd){var _0x3db806=typeof _0x8dbc17['offset']==='undefined'&&typeof _0x8dbc17[_0xb4dc('0x20')]===_0xb4dc('0x21');var _0x1f08ac=_0x35e5dd[_0xb4dc('0x22')];var _0x46dc08=_0x3db806?0x0:_0x8dbc17[_0xb4dc('0x23')];var _0x46021d=_0x3db806?_0x35e5dd[_0xb4dc('0x22')]:_0x8dbc17[_0xb4dc('0x23')]+_0x8dbc17[_0xb4dc('0x20')];var _0x2386f5;if(_0x46021d>=_0x1f08ac){_0x46021d=_0x1f08ac;_0x2386f5=0xc8;}else{_0x2386f5=0xce;}_0x2144c4[_0xb4dc('0x1d')](_0x2386f5);return _0x2144c4[_0xb4dc('0x24')](_0xb4dc('0x25'),_0x46dc08+'-'+_0x46021d+'/'+_0x1f08ac)['json'](_0x35e5dd);}return null;};}function patchUpdates(_0x334f9f){return function(_0x58c91f){try{jsonpatch[_0xb4dc('0x26')](_0x58c91f,_0x334f9f,!![]);}catch(_0x13666b){return BPromise['reject'](_0x13666b);}return _0x58c91f[_0xb4dc('0x27')]();};}function saveUpdates(_0x1bd5a4,_0x3e8de8){return function(_0x3be3c6){if(_0x3be3c6){return _0x3be3c6[_0xb4dc('0x28')](_0x1bd5a4)[_0xb4dc('0x29')](function(_0x2d0c90){return _0x2d0c90;});}return null;};}function removeEntity(_0x2b1ee1,_0xa2561d){return function(_0x3f27f5){if(_0x3f27f5){return _0x3f27f5['destroy']()['then'](function(){_0x2b1ee1[_0xb4dc('0x1d')](0xcc)[_0xb4dc('0x1e')]();});}};}function handleEntityNotFound(_0x2ffcd3,_0x32de62){return function(_0x411c16){if(!_0x411c16){_0x2ffcd3[_0xb4dc('0x1c')](0x194);}return _0x411c16;};}function handleError(_0x5838be,_0x1039f2){_0x1039f2=_0x1039f2||0x1f4;return function(_0x5c3c87){logger[_0xb4dc('0x2a')](_0x5c3c87['stack']);if(_0x5c3c87['name']){delete _0x5c3c87['name'];}_0x5838be['status'](_0x1039f2)[_0xb4dc('0x2b')](_0x5c3c87);};}exports['index']=function(_0x1bc552,_0x51d809){var _0x881a06={},_0x15642c={},_0x516038={'count':0x0,'rows':[]};var _0x4f989f=_[_0xb4dc('0x2c')](db[_0xb4dc('0x2d')][_0xb4dc('0x2e')],function(_0x31d0c0){return{'name':_0x31d0c0[_0xb4dc('0x2f')],'type':_0x31d0c0[_0xb4dc('0x30')][_0xb4dc('0x31')]};});_0x15642c[_0xb4dc('0x32')]=_['map'](_0x4f989f,'name');_0x15642c[_0xb4dc('0x33')]=_[_0xb4dc('0x34')](_0x1bc552['query']);_0x15642c[_0xb4dc('0x35')]=_['intersection'](_0x15642c[_0xb4dc('0x32')],_0x15642c[_0xb4dc('0x33')]);_0x881a06[_0xb4dc('0x36')]=_[_0xb4dc('0x37')](_0x15642c['model'],qs['fields'](_0x1bc552[_0xb4dc('0x33')]['fields']));_0x881a06['attributes']=_0x881a06[_0xb4dc('0x36')]['length']?_0x881a06[_0xb4dc('0x36')]:_0x15642c[_0xb4dc('0x32')];if(!_0x1bc552['query']['hasOwnProperty']('nolimit')){_0x881a06['limit']=qs['limit'](_0x1bc552[_0xb4dc('0x33')][_0xb4dc('0x20')]);_0x881a06[_0xb4dc('0x23')]=qs['offset'](_0x1bc552[_0xb4dc('0x33')][_0xb4dc('0x23')]);}_0x881a06[_0xb4dc('0x38')]=qs[_0xb4dc('0x39')](_0x1bc552[_0xb4dc('0x33')]['sort']);_0x881a06[_0xb4dc('0x3a')]=qs[_0xb4dc('0x35')](_[_0xb4dc('0x3b')](_0x1bc552[_0xb4dc('0x33')],_0x15642c[_0xb4dc('0x35')]),_0x4f989f);if(_0x1bc552['query']['filter']){_0x881a06[_0xb4dc('0x3a')]=_[_0xb4dc('0x3c')](_0x881a06[_0xb4dc('0x3a')],{'$or':_['map'](_0x4f989f,function(_0x441820){if(_0x441820[_0xb4dc('0x30')]!==_0xb4dc('0x3d')){var _0x17cf20={};_0x17cf20[_0x441820['name']]={'$like':'%'+_0x1bc552[_0xb4dc('0x33')][_0xb4dc('0x3e')]+'%'};return _0x17cf20;}})});}_0x881a06=_[_0xb4dc('0x3c')]({},_0x881a06,_0x1bc552[_0xb4dc('0x3f')]);var _0x137e49={'where':_0x881a06[_0xb4dc('0x3a')]};return db[_0xb4dc('0x2d')][_0xb4dc('0x22')](_0x137e49)['then'](function(_0x2de2e5){_0x516038[_0xb4dc('0x22')]=_0x2de2e5;if(_0x1bc552['query']['includeAll']){_0x881a06[_0xb4dc('0x40')]=[{'all':!![]}];}return db[_0xb4dc('0x2d')][_0xb4dc('0x41')](_0x881a06);})[_0xb4dc('0x29')](function(_0x2659c2){_0x516038[_0xb4dc('0x42')]=_0x2659c2;return _0x516038;})['then'](respondWithFilteredResult(_0x51d809,_0x881a06))[_0xb4dc('0x43')](handleError(_0x51d809,null));};exports[_0xb4dc('0x44')]=function(_0x312d1a,_0x5ceb25){var _0x384d08={'raw':!![],'where':{'id':_0x312d1a[_0xb4dc('0x45')]['id']}},_0xb3b6ba={};_0xb3b6ba[_0xb4dc('0x32')]=_[_0xb4dc('0x34')](db[_0xb4dc('0x2d')][_0xb4dc('0x2e')]);_0xb3b6ba['query']=_['keys'](_0x312d1a[_0xb4dc('0x33')]);_0xb3b6ba[_0xb4dc('0x35')]=_['intersection'](_0xb3b6ba[_0xb4dc('0x32')],_0xb3b6ba[_0xb4dc('0x33')]);_0x384d08[_0xb4dc('0x36')]=_[_0xb4dc('0x37')](_0xb3b6ba[_0xb4dc('0x32')],qs[_0xb4dc('0x46')](_0x312d1a[_0xb4dc('0x33')]['fields']));_0x384d08['attributes']=_0x384d08[_0xb4dc('0x36')][_0xb4dc('0x47')]?_0x384d08['attributes']:_0xb3b6ba[_0xb4dc('0x32')];if(_0x312d1a[_0xb4dc('0x33')][_0xb4dc('0x48')]){_0x384d08[_0xb4dc('0x40')]=[{'all':!![]}];}_0x384d08=_[_0xb4dc('0x3c')]({},_0x384d08,_0x312d1a[_0xb4dc('0x3f')]);return db['CmHopperBlack'][_0xb4dc('0x49')](_0x384d08)[_0xb4dc('0x29')](handleEntityNotFound(_0x5ceb25,null))['then'](respondWithResult(_0x5ceb25,null))[_0xb4dc('0x43')](handleError(_0x5ceb25,null));};exports[_0xb4dc('0x28')]=function(_0xad18fb,_0x917af6){if(_0xad18fb[_0xb4dc('0x4a')]['id']){delete _0xad18fb[_0xb4dc('0x4a')]['id'];}return db[_0xb4dc('0x2d')][_0xb4dc('0x49')]({'where':{'id':_0xad18fb[_0xb4dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x917af6,null))[_0xb4dc('0x29')](saveUpdates(_0xad18fb[_0xb4dc('0x4a')],null))['then'](respondWithResult(_0x917af6,null))[_0xb4dc('0x43')](handleError(_0x917af6,null));};exports[_0xb4dc('0x4b')]=function(_0xd7c4e6,_0x9fc6c){return db[_0xb4dc('0x2d')][_0xb4dc('0x49')]({'where':{'id':_0xd7c4e6[_0xb4dc('0x45')]['id']}})[_0xb4dc('0x29')](handleEntityNotFound(_0x9fc6c,null))['then'](removeEntity(_0x9fc6c,null))[_0xb4dc('0x43')](handleError(_0x9fc6c,null));};exports['describe']=function(_0x49b988,_0x1da627){return db[_0xb4dc('0x2d')][_0xb4dc('0x4c')]()['then'](respondWithResult(_0x1da627,null))['catch'](handleError(_0x1da627,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 6cadf1a..62d90ab 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 _0x7890=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','../../config/logger','api','moment'];(function(_0x12c4fa,_0x5b04d0){var _0x27f7c7=function(_0x53a763){while(--_0x53a763){_0x12c4fa['push'](_0x12c4fa['shift']());}};_0x27f7c7(++_0x5b04d0);}(_0x7890,0x14d));var _0x0789=function(_0x5d9958,_0x363dc4){_0x5d9958=_0x5d9958-0x0;var _0x33155a=_0x7890[_0x5d9958];return _0x33155a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0789('0x0'))(_0x0789('0x1'));var moment=require(_0x0789('0x2'));var BPromise=require(_0x0789('0x3'));var rp=require(_0x0789('0x4'));var fs=require('fs');var path=require(_0x0789('0x5'));var rimraf=require(_0x0789('0x6'));var config=require(_0x0789('0x7'));var attributes=require(_0x0789('0x8'));module[_0x0789('0x9')]=function(_0x2b17b5,_0xc6514d){return _0x2b17b5[_0x0789('0xa')](_0x0789('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7ae=['request-promise','path','rimraf','../../config/environment','exports','CmHopperBlack','util','../../config/logger','api','moment'];(function(_0x266480,_0x3cf747){var _0x1f51ef=function(_0x3ac45e){while(--_0x3ac45e){_0x266480['push'](_0x266480['shift']());}};_0x1f51ef(++_0x3cf747);}(_0xa7ae,0xce));var _0xea7a=function(_0x311fd4,_0x214af2){_0x311fd4=_0x311fd4-0x0;var _0x4479c5=_0xa7ae[_0x311fd4];return _0x4479c5;};'use strict';var _=require('lodash');var util=require(_0xea7a('0x0'));var logger=require(_0xea7a('0x1'))(_0xea7a('0x2'));var moment=require(_0xea7a('0x3'));var BPromise=require('bluebird');var rp=require(_0xea7a('0x4'));var fs=require('fs');var path=require(_0xea7a('0x5'));var rimraf=require(_0xea7a('0x6'));var config=require(_0xea7a('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0xea7a('0x8')]=function(_0x270aec,_0x10f551){return _0x270aec['define'](_0xea7a('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 35190b1..cc14061 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 _0x4d6b=['catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model','then','UpdateCmHopperBlack','update','body','limit','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','request','info','request\x20sent','debug','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','result'];(function(_0xd145c5,_0x30695c){var _0x5baa31=function(_0xa7122f){while(--_0xa7122f){_0xd145c5['push'](_0xd145c5['shift']());}};_0x5baa31(++_0x30695c);}(_0x4d6b,0xff));var _0xb4d6=function(_0x1781de,_0x5c4b38){_0x1781de=_0x1781de-0x0;var _0x48d7fc=_0x4d6b[_0x1781de];return _0x48d7fc;};'use strict';var _=require(_0xb4d6('0x0'));var util=require(_0xb4d6('0x1'));var moment=require(_0xb4d6('0x2'));var BPromise=require(_0xb4d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4d6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4d6('0x5'));var logger=require(_0xb4d6('0x6'))('rpc');var config=require(_0xb4d6('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x255614,_0x2c6cc0,_0x1c8997){return new BPromise(function(_0x39bf6a,_0x483ae7){return client[_0xb4d6('0x8')](_0x255614,_0x1c8997)['then'](function(_0x19f083){logger[_0xb4d6('0x9')]('CmHopperBlack,\x20%s,\x20%s',_0x2c6cc0,_0xb4d6('0xa'));logger[_0xb4d6('0xb')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2c6cc0,'request\x20sent',JSON[_0xb4d6('0xc')](_0x19f083));if(_0x19f083[_0xb4d6('0xd')]){if(_0x19f083[_0xb4d6('0xd')]['code']===0x1f4){logger[_0xb4d6('0xd')](_0xb4d6('0xe'),_0x2c6cc0,_0x19f083['error'][_0xb4d6('0xf')]);return _0x483ae7(_0x19f083[_0xb4d6('0xd')][_0xb4d6('0xf')]);}logger[_0xb4d6('0xd')](_0xb4d6('0xe'),_0x2c6cc0,_0x19f083[_0xb4d6('0xd')][_0xb4d6('0xf')]);return _0x39bf6a(_0x19f083[_0xb4d6('0xd')][_0xb4d6('0xf')]);}else{logger['info'](_0xb4d6('0xe'),_0x2c6cc0,_0xb4d6('0xa'));_0x39bf6a(_0x19f083[_0xb4d6('0x10')]['message']);}})[_0xb4d6('0x11')](function(_0x49f243){logger[_0xb4d6('0xd')](_0xb4d6('0xe'),_0x2c6cc0,_0x49f243);_0x483ae7(_0x49f243);});});}exports[_0xb4d6('0x12')]=function(_0x2bf10e){var _0x40148d=this;return new Promise(function(_0x43f1ed,_0x3f34a3){return db[_0xb4d6('0x13')][_0xb4d6('0x14')]({'raw':_0x2bf10e['options']?_0x2bf10e[_0xb4d6('0x15')][_0xb4d6('0x16')]===undefined?!![]:![]:!![],'where':_0x2bf10e[_0xb4d6('0x15')]?_0x2bf10e[_0xb4d6('0x15')][_0xb4d6('0x17')]||null:null,'attributes':_0x2bf10e[_0xb4d6('0x15')]?_0x2bf10e[_0xb4d6('0x15')][_0xb4d6('0x18')]||null:null,'limit':_0x2bf10e['options']?_0x2bf10e[_0xb4d6('0x15')]['limit']||null:null,'include':_0x2bf10e[_0xb4d6('0x15')]?_0x2bf10e[_0xb4d6('0x15')][_0xb4d6('0x19')]?_[_0xb4d6('0x1a')](_0x2bf10e[_0xb4d6('0x15')][_0xb4d6('0x19')],function(_0x504c8b){return{'model':db[_0x504c8b[_0xb4d6('0x1b')]],'as':_0x504c8b['as'],'attributes':_0x504c8b['attributes'],'include':_0x504c8b['include']?_['map'](_0x504c8b['include'],function(_0x44176e){return{'model':db[_0x44176e['model']],'as':_0x44176e['as'],'attributes':_0x44176e[_0xb4d6('0x18')],'include':_0x44176e[_0xb4d6('0x19')]?_[_0xb4d6('0x1a')](_0x44176e[_0xb4d6('0x19')],function(_0xe51c0b){return{'model':db[_0xe51c0b['model']],'as':_0xe51c0b['as'],'attributes':_0xe51c0b[_0xb4d6('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb4d6('0x1c')](function(_0x148360){logger[_0xb4d6('0x9')](_0xb4d6('0x12'),_0x2bf10e);logger[_0xb4d6('0xb')](_0xb4d6('0x12'),_0x2bf10e,JSON['stringify'](_0x148360));_0x43f1ed(_0x148360);})[_0xb4d6('0x11')](function(_0x11df59){logger[_0xb4d6('0xd')]('GetCmHopperBlack',_0x11df59[_0xb4d6('0xf')],_0x2bf10e);_0x3f34a3(_0x40148d[_0xb4d6('0xd')](0x1f4,_0x11df59[_0xb4d6('0xf')]));});});};exports[_0xb4d6('0x1d')]=function(_0x18d4bb){var _0x888c11=this;return new Promise(function(_0x35f16e,_0x296ec7){return db[_0xb4d6('0x13')][_0xb4d6('0x1e')](_0x18d4bb[_0xb4d6('0x1f')],{'raw':_0x18d4bb['options']?_0x18d4bb['options'][_0xb4d6('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18d4bb[_0xb4d6('0x15')]?_0x18d4bb[_0xb4d6('0x15')][_0xb4d6('0x17')]||null:null,'attributes':_0x18d4bb[_0xb4d6('0x15')]?_0x18d4bb[_0xb4d6('0x15')][_0xb4d6('0x18')]||null:null,'limit':_0x18d4bb[_0xb4d6('0x15')]?_0x18d4bb[_0xb4d6('0x15')][_0xb4d6('0x20')]||null:null})[_0xb4d6('0x1c')](function(_0x4064da){logger[_0xb4d6('0x9')](_0xb4d6('0x1d'),_0x18d4bb);logger[_0xb4d6('0xb')]('UpdateCmHopperBlack',_0x18d4bb,JSON['stringify'](_0x4064da));_0x35f16e(_0x4064da);})[_0xb4d6('0x11')](function(_0x5b7f4d){logger[_0xb4d6('0xd')]('UpdateCmHopperBlack',_0x5b7f4d[_0xb4d6('0xf')],_0x18d4bb);_0x296ec7(_0x888c11[_0xb4d6('0xd')](0x1f4,_0x5b7f4d['message']));});});};exports[_0xb4d6('0x21')]=function(_0x440a42){var _0x5a7d1b=this;return new Promise(function(_0x4c6469,_0x356da0){return db['CmHopperBlack']['destroy']({'where':_0x440a42['options']?_0x440a42[_0xb4d6('0x15')][_0xb4d6('0x17')]||null:null})['then'](function(_0x294ed9){logger['info']('DestroyCmHopperBlack',_0x440a42);logger[_0xb4d6('0xb')]('DestroyCmHopperBlack',_0x440a42,JSON['stringify'](_0x294ed9));_0x4c6469(_0x294ed9);})[_0xb4d6('0x11')](function(_0x208bc9){logger[_0xb4d6('0xd')](_0xb4d6('0x21'),_0x208bc9[_0xb4d6('0xf')],_0x440a42);_0x356da0(_0x5a7d1b[_0xb4d6('0xd')](0x1f4,_0x208bc9[_0xb4d6('0xf')]));});});}; \ No newline at end of file +var _0x9984=['client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','update','where','destroy','DestroyCmHopperBlack','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x41ba21,_0x1ef86a){var _0x511bd7=function(_0xf96a1c){while(--_0xf96a1c){_0x41ba21['push'](_0x41ba21['shift']());}};_0x511bd7(++_0x1ef86a);}(_0x9984,0x101));var _0x4998=function(_0x3cf8da,_0x30809f){_0x3cf8da=_0x3cf8da-0x0;var _0x57dfd8=_0x9984[_0x3cf8da];return _0x57dfd8;};'use strict';var _=require(_0x4998('0x0'));var util=require(_0x4998('0x1'));var moment=require('moment');var BPromise=require(_0x4998('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4998('0x3'));var db=require(_0x4998('0x4'))['db'];var utils=require(_0x4998('0x5'));var logger=require(_0x4998('0x6'))('rpc');var config=require(_0x4998('0x7'));var jayson=require(_0x4998('0x8'));var client=jayson[_0x4998('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524482,_0x15c529,_0x2340ef){return new BPromise(function(_0x1e6e3c,_0x5df7e8){return client[_0x4998('0xa')](_0x524482,_0x2340ef)[_0x4998('0xb')](function(_0xc36e87){logger[_0x4998('0xc')](_0x4998('0xd'),_0x15c529,_0x4998('0xe'));logger[_0x4998('0xf')](_0x4998('0x10'),_0x15c529,_0x4998('0xe'),JSON['stringify'](_0xc36e87));if(_0xc36e87[_0x4998('0x11')]){if(_0xc36e87['error'][_0x4998('0x12')]===0x1f4){logger[_0x4998('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x15c529,_0xc36e87[_0x4998('0x11')][_0x4998('0x13')]);return _0x5df7e8(_0xc36e87[_0x4998('0x11')][_0x4998('0x13')]);}logger[_0x4998('0x11')](_0x4998('0xd'),_0x15c529,_0xc36e87[_0x4998('0x11')]['message']);return _0x1e6e3c(_0xc36e87[_0x4998('0x11')][_0x4998('0x13')]);}else{logger[_0x4998('0xc')](_0x4998('0xd'),_0x15c529,'request\x20sent');_0x1e6e3c(_0xc36e87[_0x4998('0x14')][_0x4998('0x13')]);}})[_0x4998('0x15')](function(_0x33d614){logger[_0x4998('0x11')](_0x4998('0xd'),_0x15c529,_0x33d614);_0x5df7e8(_0x33d614);});});}exports[_0x4998('0x16')]=function(_0x53e197){var _0x38836e=this;return new Promise(function(_0xd55666,_0x13d13e){return db[_0x4998('0x17')][_0x4998('0x18')]({'raw':_0x53e197[_0x4998('0x19')]?_0x53e197[_0x4998('0x19')][_0x4998('0x1a')]===undefined?!![]:![]:!![],'where':_0x53e197[_0x4998('0x19')]?_0x53e197[_0x4998('0x19')]['where']||null:null,'attributes':_0x53e197[_0x4998('0x19')]?_0x53e197[_0x4998('0x19')][_0x4998('0x1b')]||null:null,'limit':_0x53e197[_0x4998('0x19')]?_0x53e197[_0x4998('0x19')][_0x4998('0x1c')]||null:null,'include':_0x53e197[_0x4998('0x19')]?_0x53e197[_0x4998('0x19')][_0x4998('0x1d')]?_[_0x4998('0x1e')](_0x53e197[_0x4998('0x19')][_0x4998('0x1d')],function(_0x3b7622){return{'model':db[_0x3b7622[_0x4998('0x1f')]],'as':_0x3b7622['as'],'attributes':_0x3b7622[_0x4998('0x1b')],'include':_0x3b7622['include']?_[_0x4998('0x1e')](_0x3b7622[_0x4998('0x1d')],function(_0x241535){return{'model':db[_0x241535[_0x4998('0x1f')]],'as':_0x241535['as'],'attributes':_0x241535[_0x4998('0x1b')],'include':_0x241535['include']?_[_0x4998('0x1e')](_0x241535['include'],function(_0x2f7a77){return{'model':db[_0x2f7a77['model']],'as':_0x2f7a77['as'],'attributes':_0x2f7a77['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1dcfe9){logger[_0x4998('0xc')]('GetCmHopperBlack',_0x53e197);logger[_0x4998('0xf')](_0x4998('0x16'),_0x53e197,JSON[_0x4998('0x20')](_0x1dcfe9));_0xd55666(_0x1dcfe9);})[_0x4998('0x15')](function(_0x11a4b1){logger[_0x4998('0x11')]('GetCmHopperBlack',_0x11a4b1['message'],_0x53e197);_0x13d13e(_0x38836e[_0x4998('0x11')](0x1f4,_0x11a4b1['message']));});});};exports[_0x4998('0x21')]=function(_0x3a7d56){var _0x1f7fd4=this;return new Promise(function(_0x210b3c,_0x17ea8c){return db['CmHopperBlack'][_0x4998('0x22')](_0x3a7d56['body'],{'raw':_0x3a7d56[_0x4998('0x19')]?_0x3a7d56[_0x4998('0x19')][_0x4998('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a7d56[_0x4998('0x19')]?_0x3a7d56['options'][_0x4998('0x23')]||null:null,'attributes':_0x3a7d56[_0x4998('0x19')]?_0x3a7d56[_0x4998('0x19')][_0x4998('0x1b')]||null:null,'limit':_0x3a7d56[_0x4998('0x19')]?_0x3a7d56[_0x4998('0x19')][_0x4998('0x1c')]||null:null})['then'](function(_0x28b27a){logger[_0x4998('0xc')](_0x4998('0x21'),_0x3a7d56);logger['debug'](_0x4998('0x21'),_0x3a7d56,JSON[_0x4998('0x20')](_0x28b27a));_0x210b3c(_0x28b27a);})[_0x4998('0x15')](function(_0x2608a6){logger['error']('UpdateCmHopperBlack',_0x2608a6[_0x4998('0x13')],_0x3a7d56);_0x17ea8c(_0x1f7fd4[_0x4998('0x11')](0x1f4,_0x2608a6['message']));});});};exports['DestroyCmHopperBlack']=function(_0x100280){var _0x2e9daf=this;return new Promise(function(_0x1559d9,_0x5e9cac){return db[_0x4998('0x17')][_0x4998('0x24')]({'where':_0x100280[_0x4998('0x19')]?_0x100280[_0x4998('0x19')][_0x4998('0x23')]||null:null})[_0x4998('0xb')](function(_0x110a49){logger['info']('DestroyCmHopperBlack',_0x100280);logger[_0x4998('0xf')]('DestroyCmHopperBlack',_0x100280,JSON[_0x4998('0x20')](_0x110a49));_0x1559d9(_0x110a49);})[_0x4998('0x15')](function(_0x12d6cd){logger[_0x4998('0x11')](_0x4998('0x25'),_0x12d6cd[_0x4998('0x13')],_0x100280);_0x5e9cac(_0x2e9daf[_0x4998('0x11')](0x1f4,_0x12d6cd[_0x4998('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8012a02..653192b 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 _0x3831=['get','isAuthenticated','describe','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller'];(function(_0x1073ab,_0x467841){var _0x192426=function(_0x6f1731){while(--_0x6f1731){_0x1073ab['push'](_0x1073ab['shift']());}};_0x192426(++_0x467841);}(_0x3831,0x14c));var _0x1383=function(_0x303862,_0x20b5ab){_0x303862=_0x303862-0x0;var _0xe6f228=_0x3831[_0x303862];return _0xe6f228;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/describe',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0xd')](_0x1383('0xb'),auth['isAuthenticated'](),controller[_0x1383('0xe')]);router[_0x1383('0xf')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0424=['isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','./cmHopperBlack.controller','get'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x0424,0x159));var _0x4042=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0x0424[_0x54fbff];return _0x5cf619;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4042('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4042('0x5'));router[_0x4042('0x6')]('/',auth[_0x4042('0x7')](),controller[_0x4042('0x8')]);router[_0x4042('0x6')](_0x4042('0x9'),auth[_0x4042('0x7')](),controller['describe']);router['get'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xb')]);router['put'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xc')]);router[_0x4042('0xd')](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xe')]);module[_0x4042('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 278c507..a3a1a61 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 _0x9a7d=['DATE','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0x36f569,_0x4c2933){var _0x5ba075=function(_0x5c483f){while(--_0x5c483f){_0x36f569['push'](_0x36f569['shift']());}};_0x5ba075(++_0x4c2933);}(_0x9a7d,0xff));var _0xd9a7=function(_0x4f6272,_0x53b79c){_0x4f6272=_0x4f6272-0x0;var _0x1b5ae5=_0x9a7d[_0x4f6272];return _0x1b5ae5;};'use strict';var Sequelize=require(_0xd9a7('0x0'));var moment=require(_0xd9a7('0x1'));module[_0xd9a7('0x2')]={'state':{'type':Sequelize[_0xd9a7('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xd9a7('0x4')]},'scheduledat':{'type':Sequelize[_0xd9a7('0x5')]},'countbusyretry':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xd9a7('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd9a7('0x4')]},'starttime':{'type':Sequelize[_0xd9a7('0x5')]},'responsetime':{'type':Sequelize[_0xd9a7('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xd9a7('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd9a7('0x4')]},'membername':{'type':Sequelize[_0xd9a7('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xd9a7('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd9a7('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x23f3c5){var _0x1ca9c5=this['getDataValue']('endtime');if(_0x1ca9c5&&_0x23f3c5){this[_0xd9a7('0x6')]('followuptime',moment(_0x23f3c5)[_0xd9a7('0x7')](moment(_0x1ca9c5),_0xd9a7('0x8')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xd9a7('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd9a7('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd9a7('0x5')]},'callback':{'type':Sequelize[_0xd9a7('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd9a7('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd9a7('0x5')]},'deleted':{'type':Sequelize[_0xd9a7('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd9a7('0x5')]},'recallme':{'type':Sequelize[_0xd9a7('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd9a7('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6402=['endtime','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x52ff77,_0x51ab49){var _0x280dae=function(_0x451c81){while(--_0x451c81){_0x52ff77['push'](_0x52ff77['shift']());}};_0x280dae(++_0x51ab49);}(_0x6402,0x19d));var _0x2640=function(_0x58c06c,_0x49daad){_0x58c06c=_0x58c06c-0x0;var _0x15de87=_0x6402[_0x58c06c];return _0x15de87;};'use strict';var Sequelize=require(_0x2640('0x0'));var moment=require(_0x2640('0x1'));module[_0x2640('0x2')]={'state':{'type':Sequelize[_0x2640('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x2640('0x4')]},'scheduledat':{'type':Sequelize[_0x2640('0x5')]},'countbusyretry':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2640('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2640('0x4')]},'calleridnum':{'type':Sequelize[_0x2640('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2640('0x5')]},'responsetime':{'type':Sequelize[_0x2640('0x5')]},'answertime':{'type':Sequelize[_0x2640('0x5')]},'droptime':{'type':Sequelize[_0x2640('0x5')]},'endtime':{'type':Sequelize[_0x2640('0x5')]},'ringtime':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2640('0x4')]},'campaign':{'type':Sequelize[_0x2640('0x4')]},'campaigntype':{'type':Sequelize[_0x2640('0x4')]},'membername':{'type':Sequelize[_0x2640('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x2640('0x4')]},'secondDisposition':{'type':Sequelize[_0x2640('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x2640('0x5')],'set':function(_0x1d1e8d){var _0x2ffd53=this[_0x2640('0x6')](_0x2640('0x7'));if(_0x2ffd53&&_0x1d1e8d){this['setDataValue'](_0x2640('0x8'),moment(_0x1d1e8d)[_0x2640('0x9')](moment(_0x2ffd53),_0x2640('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x2640('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2640('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2640('0x5')]},'callback':{'type':Sequelize[_0x2640('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2640('0x5')]},'deleted':{'type':Sequelize[_0x2640('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2640('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2640('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2640('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 51b754d..f436f9b 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 _0x430c=['field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','createdAt','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','from','checkContactHopper','CmHopper','findOne','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','describe','update','uniqueid','body','find','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select'];(function(_0x1f278c,_0x39ad3b){var _0x30feef=function(_0x1fc46d){while(--_0x1fc46d){_0x1f278c['push'](_0x1f278c['shift']());}};_0x30feef(++_0x39ad3b);}(_0x430c,0x1a1));var _0xc430=function(_0x183b97,_0x2d297c){_0x183b97=_0x183b97-0x0;var _0x629cf7=_0x430c[_0x183b97];return _0x629cf7;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['describe']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')]()[_0xc430('0x1e')](respondWithResult(_0x4eafae,null))['catch'](handleError(_0x4eafae,null));};exports[_0xc430('0x45')]=function(_0x2e7052,_0x19e563){if(_0x2e7052['body'][_0xc430('0x46')]){delete _0x2e7052[_0xc430('0x47')][_0xc430('0x46')];}return db[_0xc430('0x25')][_0xc430('0x48')]({'where':{'uniqueid':_0x2e7052[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19e563,null))['then'](saveUpdates(_0x2e7052[_0xc430('0x47')],null))[_0xc430('0x1e')](respondWithResult(_0x19e563,null))[_0xc430('0x40')](handleError(_0x19e563,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x23cb41,_0x4178d7,_0x2d064b){return db[_0xc430('0x25')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x23cb41[_0xc430('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x4e')))),_0xc430('0x4f')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x50')))),_0xc430('0x51')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xc430('0x52')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x53')))),'dropContacts'],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x58')))),'answeringMachine']]})[_0xc430('0x1e')](handleEntityNotFound(_0x4178d7,null))[_0xc430('0x1e')](respondWithResult(_0x4178d7,null))[_0xc430('0x40')](handleError(_0x4178d7,null));};exports[_0xc430('0x59')]=function(_0x147062,_0x45eec6,_0x5d3393){return db[_0xc430('0x25')][_0xc430('0x3e')]({'raw':![],'where':{'CampaignId':_0x147062['params']['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4e')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xc430('0x51')],[db['sequelize']['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x5a')))),'congestionContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc430('0x5b')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x58')))),_0xc430('0x5c')]]})['then'](handleEntityNotFound(_0x45eec6,null))['then'](respondWithResult(_0x45eec6,null))[_0xc430('0x40')](handleError(_0x45eec6,null));};exports[_0xc430('0x5d')]=function(_0x31ae3c,_0x19c080,_0x256290){return db[_0xc430('0x5e')][_0xc430('0x48')]({'where':{'id':_0x31ae3c[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19c080,null))[_0xc430('0x1e')](function(_0x5ca0f2){var _0x6debfb;if(_0x5ca0f2){_0x6debfb=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery'](['phone',_0xc430('0x61'),_0xc430('0x62'),_0xc430('0x63'),_0xc430('0x64'),'createdAt',_0xc430('0x65')],squel[_0xc430('0x66')]()[_0xc430('0x67')]('ANY_VALUE(calleridnum)',_0xc430('0x68'))['field'](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),_0xc430('0x62'))['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x6c'),'VoiceQueueId')['field'](_0xc430('0x69'),'createdAt')['field'](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x6e'),_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())[_0xc430('0x34')]('state\x20=\x20?',_0x31ae3c[_0xc430('0x47')][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()['field'](_0xc430('0x68'))['from']('cm_hopper')[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id']['toString']()))[_0xc430('0x34')](_0xc430('0x71'),squel['select']()[_0xc430('0x67')](_0xc430('0x72'))['from'](_0xc430('0x6d'))[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())['where'](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x6debfb);}return[];})[_0xc430('0x1e')](respondWithResult(_0x19c080,null))[_0xc430('0x40')](handleError(_0x19c080,null));};exports[_0xc430('0x75')]=function(_0x19789f,_0x24b380,_0x4fe467){return db[_0xc430('0x76')][_0xc430('0x48')]({'where':{'id':_0x19789f[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x24b380,null))['then'](function(_0x150a8a){var _0x4edead;if(_0x150a8a){_0x4edead=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery']([_0xc430('0x68'),_0xc430('0x61'),_0xc430('0x62'),'ListId',_0xc430('0x77'),'createdAt','updatedAt'],squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x78'),'phone')[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),'ContactId')['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x79'),_0xc430('0x77'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x7a'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())['where'](_0xc430('0x7c'),_0x19789f['body'][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')](_0xc430('0x7d'))[_0xc430('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')[_0xc430('0x7e')]('cm_hopper')['where'](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id'][_0xc430('0x6f')]()))[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x72'))[_0xc430('0x7e')](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())[_0xc430('0x34')](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x4edead);}return[];})[_0xc430('0x1e')](respondWithResult(_0x24b380,null))['catch'](handleError(_0x24b380,null));};exports[_0xc430('0x7f')]=function(_0x6e48a3,_0x5be78a,_0x3bd6e1){return db[_0xc430('0x80')][_0xc430('0x81')]({'where':{'VoiceQueueId':_0x6e48a3[_0xc430('0x47')]['VoiceQueueId'],'CampaignId':_0x6e48a3[_0xc430('0x47')]['CampaignId'],'ContactId':_0x6e48a3['body'][_0xc430('0x62')]}})[_0xc430('0x1e')](handleEntityNotFound(_0x5be78a,null))[_0xc430('0x1e')](function(_0x207067){if(_0x207067){return _0x207067;}return null;})[_0xc430('0x1e')](respondWithResult(_0x5be78a,null))[_0xc430('0x40')](handleError(_0x5be78a,null));}; \ No newline at end of file +var _0xeda8=['calleridnum','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','params','keys','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','select'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xeda8,0x104));var _0x8eda=function(_0x2c9b27,_0x95ef07){_0x2c9b27=_0x2c9b27-0x0;var _0xddf573=_0xeda8[_0x2c9b27];return _0xddf573;};'use strict';var emlformat=require(_0x8eda('0x0'));var rimraf=require(_0x8eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eda('0x2'));var rp=require(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var Mustache=require(_0x8eda('0x6'));var util=require(_0x8eda('0x7'));var path=require(_0x8eda('0x8'));var sox=require(_0x8eda('0x9'));var csv=require(_0x8eda('0xa'));var ejs=require(_0x8eda('0xb'));var fs=require('fs');var fs_extra=require(_0x8eda('0xc'));var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var licenseUtil=require(_0x8eda('0x16'));var db=require(_0x8eda('0x17'))['db'];function respondWithStatusCode(_0x1ad3df,_0x337573){_0x337573=_0x337573||0xcc;return function(_0x3af00c){if(_0x3af00c){return _0x1ad3df[_0x8eda('0x18')](_0x337573);}return _0x1ad3df[_0x8eda('0x19')](_0x337573)['end']();};}function respondWithResult(_0x500bd4,_0xe04d90){_0xe04d90=_0xe04d90||0xc8;return function(_0x223dcf){if(_0x223dcf){return _0x500bd4['status'](_0xe04d90)[_0x8eda('0x1a')](_0x223dcf);}};}function respondWithFilteredResult(_0x34b1ee,_0x123905){return function(_0x56ff8a){if(_0x56ff8a){var _0x3f2925=typeof _0x123905['offset']===_0x8eda('0x1b')&&typeof _0x123905['limit']===_0x8eda('0x1b');var _0x58023b=_0x56ff8a[_0x8eda('0x1c')];var _0x2a4d2b=_0x3f2925?0x0:_0x123905['offset'];var _0x5e44b7=_0x3f2925?_0x56ff8a[_0x8eda('0x1c')]:_0x123905[_0x8eda('0x1d')]+_0x123905[_0x8eda('0x1e')];var _0x41abfa;if(_0x5e44b7>=_0x58023b){_0x5e44b7=_0x58023b;_0x41abfa=0xc8;}else{_0x41abfa=0xce;}_0x34b1ee[_0x8eda('0x19')](_0x41abfa);return _0x34b1ee[_0x8eda('0x1f')](_0x8eda('0x20'),_0x2a4d2b+'-'+_0x5e44b7+'/'+_0x58023b)[_0x8eda('0x1a')](_0x56ff8a);}return null;};}function patchUpdates(_0x850cce){return function(_0x232786){try{jsonpatch[_0x8eda('0x21')](_0x232786,_0x850cce,!![]);}catch(_0x57f336){return BPromise[_0x8eda('0x22')](_0x57f336);}return _0x232786['save']();};}function saveUpdates(_0x45517e,_0x5183bc){return function(_0x1033d6){if(_0x1033d6){return _0x1033d6[_0x8eda('0x23')](_0x45517e)['then'](function(_0x58e54b){return _0x58e54b;});}return null;};}function removeEntity(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(_0x17cae8){return _0x17cae8['destroy']()[_0x8eda('0x24')](function(){_0x56dba4[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e955,_0xfa57ca){return function(_0x24b1e1){if(!_0x24b1e1){_0x25e955[_0x8eda('0x18')](0x194);}return _0x24b1e1;};}function handleError(_0x2e42e4,_0x5c8488){_0x5c8488=_0x5c8488||0x1f4;return function(_0x41b5a9){logger['error'](_0x41b5a9[_0x8eda('0x25')]);if(_0x41b5a9[_0x8eda('0x26')]){delete _0x41b5a9[_0x8eda('0x26')];}_0x2e42e4['status'](_0x5c8488)[_0x8eda('0x27')](_0x41b5a9);};}exports[_0x8eda('0x28')]=function(_0x1dd12,_0x4cdd2e){var _0x1616ea={},_0x11a999={},_0x5dd315={'count':0x0,'rows':[]};var _0x27d2ce=_[_0x8eda('0x29')](db[_0x8eda('0x2a')][_0x8eda('0x2b')],function(_0x53274e){return{'name':_0x53274e['fieldName'],'type':_0x53274e['type'][_0x8eda('0x2c')]};});_0x11a999[_0x8eda('0x2d')]=_[_0x8eda('0x29')](_0x27d2ce,'name');_0x11a999['query']=_['keys'](_0x1dd12[_0x8eda('0x2e')]);_0x11a999[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x11a999['model'],_0x11a999['query']);_0x1616ea['attributes']=_[_0x8eda('0x30')](_0x11a999[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x31')]));_0x1616ea[_0x8eda('0x32')]=_0x1616ea[_0x8eda('0x32')][_0x8eda('0x33')]?_0x1616ea[_0x8eda('0x32')]:_0x11a999[_0x8eda('0x2d')];if(!_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x34')](_0x8eda('0x35'))){_0x1616ea[_0x8eda('0x1e')]=qs['limit'](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x1e')]);_0x1616ea[_0x8eda('0x1d')]=qs['offset'](_0x1dd12['query'][_0x8eda('0x1d')]);}_0x1616ea[_0x8eda('0x36')]=qs[_0x8eda('0x37')](_0x1dd12[_0x8eda('0x2e')]['sort']);_0x1616ea[_0x8eda('0x38')]=qs[_0x8eda('0x2f')](_[_0x8eda('0x39')](_0x1dd12[_0x8eda('0x2e')],_0x11a999[_0x8eda('0x2f')]),_0x27d2ce);if(_0x1dd12[_0x8eda('0x2e')]['filter']){_0x1616ea[_0x8eda('0x38')]=_[_0x8eda('0x3a')](_0x1616ea[_0x8eda('0x38')],{'$or':_[_0x8eda('0x29')](_0x27d2ce,function(_0x261e12){if(_0x261e12[_0x8eda('0x3b')]!=='VIRTUAL'){var _0x1067eb={};_0x1067eb[_0x261e12[_0x8eda('0x26')]]={'$like':'%'+_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3c')]+'%'};return _0x1067eb;}})});}_0x1616ea=_[_0x8eda('0x3a')]({},_0x1616ea,_0x1dd12['options']);var _0x17ee80={'where':_0x1616ea[_0x8eda('0x38')]};return db[_0x8eda('0x2a')]['count'](_0x17ee80)[_0x8eda('0x24')](function(_0x5d361e){_0x5dd315[_0x8eda('0x1c')]=_0x5d361e;if(_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3d')]){_0x1616ea[_0x8eda('0x3e')]=[{'all':!![]}];}return db[_0x8eda('0x2a')]['findAll'](_0x1616ea);})['then'](function(_0xbf14a1){_0x5dd315[_0x8eda('0x3f')]=_0xbf14a1;return _0x5dd315;})[_0x8eda('0x24')](respondWithFilteredResult(_0x4cdd2e,_0x1616ea))[_0x8eda('0x40')](handleError(_0x4cdd2e,null));};exports[_0x8eda('0x41')]=function(_0x13b3bc,_0x18b043){var _0xcb6164={'raw':!![],'where':{'id':_0x13b3bc[_0x8eda('0x42')]['id']}},_0x184590={};_0x184590[_0x8eda('0x2d')]=_[_0x8eda('0x43')](db[_0x8eda('0x2a')][_0x8eda('0x2b')]);_0x184590[_0x8eda('0x2e')]=_[_0x8eda('0x43')](_0x13b3bc[_0x8eda('0x2e')]);_0x184590[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x184590['model'],_0x184590[_0x8eda('0x2e')]);_0xcb6164[_0x8eda('0x32')]=_['intersection'](_0x184590[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x13b3bc['query'][_0x8eda('0x31')]));_0xcb6164[_0x8eda('0x32')]=_0xcb6164['attributes'][_0x8eda('0x33')]?_0xcb6164[_0x8eda('0x32')]:_0x184590[_0x8eda('0x2d')];if(_0x13b3bc['query'][_0x8eda('0x3d')]){_0xcb6164[_0x8eda('0x3e')]=[{'all':!![]}];}_0xcb6164=_[_0x8eda('0x3a')]({},_0xcb6164,_0x13b3bc[_0x8eda('0x44')]);return db[_0x8eda('0x2a')][_0x8eda('0x45')](_0xcb6164)[_0x8eda('0x24')](handleEntityNotFound(_0x18b043,null))['then'](respondWithResult(_0x18b043,null))[_0x8eda('0x40')](handleError(_0x18b043,null));};exports['describe']=function(_0xcde3e,_0x52b026){return db[_0x8eda('0x2a')]['describe']()[_0x8eda('0x24')](respondWithResult(_0x52b026,null))['catch'](handleError(_0x52b026,null));};exports[_0x8eda('0x23')]=function(_0x3aca19,_0xf445){if(_0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')]){delete _0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')];}return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'uniqueid':_0x3aca19[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0xf445,null))[_0x8eda('0x24')](saveUpdates(_0x3aca19['body'],null))[_0x8eda('0x24')](respondWithResult(_0xf445,null))[_0x8eda('0x40')](handleError(_0xf445,null));};exports[_0x8eda('0x48')]=function(_0x3259de,_0x33ba39,_0x389399){return db[_0x8eda('0x2a')][_0x8eda('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x3259de[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),'noAnswerContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0x8eda('0x4f')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x50')))),'congestionContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x53')))),'abandonedContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x8eda('0x54')],[db['sequelize']['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x55')))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x33ba39,null))['then'](respondWithResult(_0x33ba39,null))[_0x8eda('0x40')](handleError(_0x33ba39,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xdd71ce,_0x4ba827,_0xfb98bf){return db['CmHopperFinal'][_0x8eda('0x49')]({'raw':![],'where':{'CampaignId':_0xdd71ce[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),_0x8eda('0x57')],[db['sequelize']['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x58')))),'busyContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eda('0x59')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')]['literal'](_0x8eda('0x53')))),_0x8eda('0x5a')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x8eda('0x5b')))),_0x8eda('0x54')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x4ba827,null))['then'](respondWithResult(_0x4ba827,null))[_0x8eda('0x40')](handleError(_0x4ba827,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x47f57c,_0x49d1a1,_0x5e66cd){return db[_0x8eda('0x5c')][_0x8eda('0x45')]({'where':{'id':_0x47f57c[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x49d1a1,null))[_0x8eda('0x24')](function(_0xe5d324){var _0x589c2f;if(_0xe5d324){_0x589c2f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')](['phone',_0x8eda('0x61'),_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x64'),_0x8eda('0x65'),_0x8eda('0x66')],squel['select']()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),_0x8eda('0x61'))[_0x8eda('0x67')](_0x8eda('0x6b'),_0x8eda('0x62'))[_0x8eda('0x67')](_0x8eda('0x6c'),_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x6d'),'VoiceQueueId')['field'](_0x8eda('0x6a'),_0x8eda('0x65'))[_0x8eda('0x67')](_0x8eda('0x6a'),'updatedAt')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x70'),_0x47f57c['params']['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x47f57c['body'][_0x8eda('0x73')][_0x8eda('0x71')]())[_0x8eda('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')]('phone')['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c[_0x8eda('0x42')]['id']['toString']()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x76'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c['params']['id']['toString']())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x589c2f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x49d1a1,null))[_0x8eda('0x40')](handleError(_0x49d1a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1bbe8b,_0x437c6f,_0x1006b1){return db['Campaign'][_0x8eda('0x45')]({'where':{'id':_0x1bbe8b[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x437c6f,null))[_0x8eda('0x24')](function(_0x33350e){var _0x3e245f;if(_0x33350e){_0x3e245f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')]([_0x8eda('0x69'),'scheduledAt',_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x79'),_0x8eda('0x65'),_0x8eda('0x66')],squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)',_0x8eda('0x62'))[_0x8eda('0x67')]('ANY_VALUE(ListId)',_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x7a'),'CampaignId')[_0x8eda('0x67')]('NOW()',_0x8eda('0x65'))['field'](_0x8eda('0x6a'),_0x8eda('0x66'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x1bbe8b[_0x8eda('0x46')][_0x8eda('0x73')][_0x8eda('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x69'))['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()['field']('calleridnum')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x3e245f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x437c6f,null))['catch'](handleError(_0x437c6f,null));};exports[_0x8eda('0x7c')]=function(_0x11f734,_0x4cb4e6,_0x5d8512){return db['CmHopper'][_0x8eda('0x7d')]({'where':{'VoiceQueueId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x64')],'CampaignId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x79')],'ContactId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x62')]}})[_0x8eda('0x24')](handleEntityNotFound(_0x4cb4e6,null))[_0x8eda('0x24')](function(_0x1a3993){if(_0x1a3993){return _0x1a3993;}return null;})[_0x8eda('0x24')](respondWithResult(_0x4cb4e6,null))[_0x8eda('0x40')](handleError(_0x4cb4e6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 1c57931..3144ffc 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 _0xf598=['request-promise','path','rimraf','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2fb136,_0x31d182){var _0x170aa0=function(_0x573c82){while(--_0x573c82){_0x2fb136['push'](_0x2fb136['shift']());}};_0x170aa0(++_0x31d182);}(_0xf598,0x90));var _0x8f59=function(_0x7531ff,_0x15f80d){_0x7531ff=_0x7531ff-0x0;var _0x43e3d9=_0xf598[_0x7531ff];return _0x43e3d9;};'use strict';var _=require(_0x8f59('0x0'));var util=require(_0x8f59('0x1'));var logger=require(_0x8f59('0x2'))(_0x8f59('0x3'));var moment=require(_0x8f59('0x4'));var BPromise=require(_0x8f59('0x5'));var rp=require(_0x8f59('0x6'));var fs=require('fs');var path=require(_0x8f59('0x7'));var rimraf=require(_0x8f59('0x8'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x8f59('0x9')]=function(_0x31dbfb,_0x4909d5){return _0x31dbfb[_0x8f59('0xa')](_0x8f59('0xb'),attributes,{'tableName':_0x8f59('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x8f59('0xd')]},{'name':'uniqueid','fields':[_0x8f59('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa167=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','CmHopperFinal','cm_hopper_final','lodash','util'];(function(_0x2b5aaf,_0x3e25f4){var _0x91deff=function(_0x5ccf9d){while(--_0x5ccf9d){_0x2b5aaf['push'](_0x2b5aaf['shift']());}};_0x91deff(++_0x3e25f4);}(_0xa167,0x80));var _0x7a16=function(_0x59b4a7,_0x2eb4da){_0x59b4a7=_0x59b4a7-0x0;var _0x19b9d8=_0xa167[_0x59b4a7];return _0x19b9d8;};'use strict';var _=require(_0x7a16('0x0'));var util=require(_0x7a16('0x1'));var logger=require(_0x7a16('0x2'))(_0x7a16('0x3'));var moment=require(_0x7a16('0x4'));var BPromise=require(_0x7a16('0x5'));var rp=require(_0x7a16('0x6'));var fs=require('fs');var path=require(_0x7a16('0x7'));var rimraf=require(_0x7a16('0x8'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x7a16('0x9')]=function(_0x6d299e,_0x2bad81){return _0x6d299e[_0x7a16('0xa')](_0x7a16('0xb'),attributes,{'tableName':_0x7a16('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 9019eeb..12d5052 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(_0x4fdd86,_0xfa54b1){var _0x4f04b7=function(_0x1e93b7){while(--_0x1e93b7){_0x4fdd86['push'](_0x4fdd86['shift']());}};_0x4f04b7(++_0xfa54b1);}(_0xb10b,0x12a));var _0xbb10=function(_0x20e5c3,_0x41470c){_0x20e5c3=_0x20e5c3-0x0;var _0x401520=_0xb10b[_0x20e5c3];return _0x401520;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4569e6,_0x23ebf3){var _0x2e9e58=function(_0x240c61){while(--_0x240c61){_0x4569e6['push'](_0x4569e6['shift']());}};_0x2e9e58(++_0x23ebf3);}(_0xb10b,0x12a));var _0xbb10=function(_0xd8efb0,_0x2fb48b){_0xd8efb0=_0xd8efb0-0x0;var _0x3d962c=_0xb10b[_0xd8efb0];return _0x3d962c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index ea26a87..5086931 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 _0x7611=['../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','multer','path','express','Router','fs-extra'];(function(_0x2a54d1,_0x37a51a){var _0x320511=function(_0x4de10a){while(--_0x4de10a){_0x2a54d1['push'](_0x2a54d1['shift']());}};_0x320511(++_0x37a51a);}(_0x7611,0xb1));var _0x1761=function(_0x444a8b,_0x526b10){_0x444a8b=_0x444a8b-0x0;var _0x2cebf5=_0x7611[_0x444a8b];return _0x2cebf5;};'use strict';var multer=require(_0x1761('0x0'));var util=require('util');var path=require(_0x1761('0x1'));var timeout=require('connect-timeout');var express=require(_0x1761('0x2'));var router=express[_0x1761('0x3')]();var fs_extra=require(_0x1761('0x4'));var auth=require(_0x1761('0x5'));var interaction=require(_0x1761('0x6'));var config=require('../../config/environment');var controller=require(_0x1761('0x7'));router[_0x1761('0x8')]('/',auth['isAuthenticated'](),controller[_0x1761('0x9')]);router[_0x1761('0x8')](_0x1761('0xa'),auth[_0x1761('0xb')](),controller['describe']);router[_0x1761('0x8')](_0x1761('0xc'),auth['isAuthenticated'](),controller[_0x1761('0xd')]);router[_0x1761('0x8')](_0x1761('0xe'),auth['isAuthenticated'](),controller[_0x1761('0xf')]);router[_0x1761('0x8')](_0x1761('0x10'),auth[_0x1761('0xb')](),controller[_0x1761('0x11')]);router['post'](_0x1761('0x12'),auth[_0x1761('0xb')](),controller[_0x1761('0x13')]);router[_0x1761('0x14')](_0x1761('0x15'),auth[_0x1761('0xb')](),controller[_0x1761('0x16')]);router['post'](_0x1761('0x17'),auth[_0x1761('0xb')](),controller[_0x1761('0x18')]);router['put'](_0x1761('0xc'),auth['isAuthenticated'](),controller['update']);module[_0x1761('0x19')]=router; \ No newline at end of file +var _0xf2bd=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper','put','/:id','update'];(function(_0x3ed8ba,_0x17ed23){var _0x439ebd=function(_0x3adaeb){while(--_0x3adaeb){_0x3ed8ba['push'](_0x3ed8ba['shift']());}};_0x439ebd(++_0x17ed23);}(_0xf2bd,0x135));var _0xdf2b=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf2bd[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0xdf2b('0x0'));var util=require(_0xdf2b('0x1'));var path=require(_0xdf2b('0x2'));var timeout=require(_0xdf2b('0x3'));var express=require(_0xdf2b('0x4'));var router=express[_0xdf2b('0x5')]();var fs_extra=require(_0xdf2b('0x6'));var auth=require(_0xdf2b('0x7'));var interaction=require(_0xdf2b('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0xdf2b('0x9')]('/',auth[_0xdf2b('0xa')](),controller[_0xdf2b('0xb')]);router[_0xdf2b('0x9')]('/describe',auth[_0xdf2b('0xa')](),controller[_0xdf2b('0xc')]);router['get']('/:id',auth[_0xdf2b('0xa')](),controller[_0xdf2b('0xd')]);router['get'](_0xdf2b('0xe'),auth[_0xdf2b('0xa')](),controller[_0xdf2b('0xf')]);router[_0xdf2b('0x9')](_0xdf2b('0x10'),auth[_0xdf2b('0xa')](),controller[_0xdf2b('0x11')]);router['post'](_0xdf2b('0x12'),auth[_0xdf2b('0xa')](),controller[_0xdf2b('0x13')]);router['post'](_0xdf2b('0x14'),auth[_0xdf2b('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xdf2b('0x15')](_0xdf2b('0x16'),auth[_0xdf2b('0xa')](),controller[_0xdf2b('0x17')]);router[_0xdf2b('0x18')](_0xdf2b('0x19'),auth[_0xdf2b('0xa')](),controller[_0xdf2b('0x1a')]);module[_0xdf2b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 6cdc45a..0e0eb1b 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 _0x4fde=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x3f808a,_0x96109){var _0x2f9fba=function(_0x571821){while(--_0x571821){_0x3f808a['push'](_0x3f808a['shift']());}};_0x2f9fba(++_0x96109);}(_0x4fde,0x10a));var _0xe4fd=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0x4fde[_0x7c0074];return _0x13e95b;};'use strict';var Sequelize=require(_0xe4fd('0x0'));module[_0xe4fd('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe4fd('0x2')]},'scheduledat':{'type':Sequelize[_0xe4fd('0x3')]},'countbusyretry':{'type':Sequelize[_0xe4fd('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe4fd('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe4fd('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe4fd('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xe4fd('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe4fd('0x2')]},'starttime':{'type':Sequelize[_0xe4fd('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe4fd('0x3')]},'droptime':{'type':Sequelize[_0xe4fd('0x3')]},'endtime':{'type':Sequelize[_0xe4fd('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe4fd('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe4fd('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe4fd('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xe4fd('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe4fd('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xe4fd('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xe4fd('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xe4fd('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xe4fd('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe4fd('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe4fd('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe4fd('0x2')]}}; \ No newline at end of file +var _0xaefb=['STRING','BOOLEAN','sequelize','INTEGER','DATE'];(function(_0x2206f4,_0x2a0c3f){var _0x4e4459=function(_0x4673d3){while(--_0x4673d3){_0x2206f4['push'](_0x2206f4['shift']());}};_0x4e4459(++_0x2a0c3f);}(_0xaefb,0xca));var _0xbaef=function(_0x4ccde3,_0x38ca57){_0x4ccde3=_0x4ccde3-0x0;var _0x3348ac=_0xaefb[_0x4ccde3];return _0x3348ac;};'use strict';var Sequelize=require(_0xbaef('0x0'));module['exports']={'state':{'type':Sequelize[_0xbaef('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xbaef('0x2')]},'countbusyretry':{'type':Sequelize[_0xbaef('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbaef('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xbaef('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbaef('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xbaef('0x3')]},'originatecalleridname':{'type':Sequelize[_0xbaef('0x3')]},'calleridnum':{'type':Sequelize[_0xbaef('0x3')]},'calleridname':{'type':Sequelize[_0xbaef('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xbaef('0x2')]},'answertime':{'type':Sequelize[_0xbaef('0x2')]},'droptime':{'type':Sequelize[_0xbaef('0x2')]},'endtime':{'type':Sequelize[_0xbaef('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbaef('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbaef('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbaef('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xbaef('0x3')]},'campaigntype':{'type':Sequelize[_0xbaef('0x3')]},'membername':{'type':Sequelize[_0xbaef('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xbaef('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xbaef('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xbaef('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbaef('0x2')]},'recallme':{'type':Sequelize[_0xbaef('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xbaef('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xbaef('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbaef('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xbaef('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8afe9b6..c36051a 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 _0xca82=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','options','includeAll','include','catch','show','params','keys','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xf745d3,_0x2d45a8){var _0x43f070=function(_0x39a3db){while(--_0x39a3db){_0xf745d3['push'](_0xf745d3['shift']());}};_0x43f070(++_0x2d45a8);}(_0xca82,0xca));var _0x2ca8=function(_0x427787,_0xf1abc9){_0x427787=_0x427787-0x0;var _0x4f5f61=_0xca82[_0x427787];return _0x4f5f61;};'use strict';var emlformat=require(_0x2ca8('0x0'));var rimraf=require(_0x2ca8('0x1'));var zipdir=require(_0x2ca8('0x2'));var jsonpatch=require(_0x2ca8('0x3'));var rp=require(_0x2ca8('0x4'));var moment=require(_0x2ca8('0x5'));var BPromise=require(_0x2ca8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2ca8('0x7'));var sox=require(_0x2ca8('0x8'));var csv=require('to-csv');var ejs=require(_0x2ca8('0x9'));var fs=require('fs');var fs_extra=require(_0x2ca8('0xa'));var _=require(_0x2ca8('0xb'));var squel=require(_0x2ca8('0xc'));var crypto=require(_0x2ca8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ca8('0xe'));var querystring=require(_0x2ca8('0xf'));var Papa=require(_0x2ca8('0x10'));var Redis=require(_0x2ca8('0x11'));var authService=require(_0x2ca8('0x12'));var qs=require(_0x2ca8('0x13'));var as=require(_0x2ca8('0x14'));var hardwareService=require(_0x2ca8('0x15'));var logger=require(_0x2ca8('0x16'))('api');var utils=require(_0x2ca8('0x17'));var config=require(_0x2ca8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ca8('0x19'))['db'];function respondWithStatusCode(_0x4ec0a4,_0x44445e){_0x44445e=_0x44445e||0xcc;return function(_0x3c8e63){if(_0x3c8e63){return _0x4ec0a4[_0x2ca8('0x1a')](_0x44445e);}return _0x4ec0a4[_0x2ca8('0x1b')](_0x44445e)['end']();};}function respondWithResult(_0x468e3b,_0x3f44b9){_0x3f44b9=_0x3f44b9||0xc8;return function(_0x109d53){if(_0x109d53){return _0x468e3b[_0x2ca8('0x1b')](_0x3f44b9)[_0x2ca8('0x1c')](_0x109d53);}};}function respondWithFilteredResult(_0x69cbe,_0x1996ad){return function(_0x14fbbc){if(_0x14fbbc){var _0x328ff3=typeof _0x1996ad['offset']===_0x2ca8('0x1d')&&typeof _0x1996ad[_0x2ca8('0x1e')]===_0x2ca8('0x1d');var _0x38bfce=_0x14fbbc[_0x2ca8('0x1f')];var _0x21e4cf=_0x328ff3?0x0:_0x1996ad[_0x2ca8('0x20')];var _0x5c8512=_0x328ff3?_0x14fbbc[_0x2ca8('0x1f')]:_0x1996ad[_0x2ca8('0x20')]+_0x1996ad[_0x2ca8('0x1e')];var _0x2ab8c5;if(_0x5c8512>=_0x38bfce){_0x5c8512=_0x38bfce;_0x2ab8c5=0xc8;}else{_0x2ab8c5=0xce;}_0x69cbe[_0x2ca8('0x1b')](_0x2ab8c5);return _0x69cbe[_0x2ca8('0x21')](_0x2ca8('0x22'),_0x21e4cf+'-'+_0x5c8512+'/'+_0x38bfce)['json'](_0x14fbbc);}return null;};}function patchUpdates(_0x5e179d){return function(_0x154b3a){try{jsonpatch[_0x2ca8('0x23')](_0x154b3a,_0x5e179d,!![]);}catch(_0x646d27){return BPromise[_0x2ca8('0x24')](_0x646d27);}return _0x154b3a['save']();};}function saveUpdates(_0x3d202f,_0x3e6533){return function(_0x51bb67){if(_0x51bb67){return _0x51bb67[_0x2ca8('0x25')](_0x3d202f)[_0x2ca8('0x26')](function(_0x24c146){return _0x24c146;});}return null;};}function removeEntity(_0x3453c3,_0x49931d){return function(_0x509e98){if(_0x509e98){return _0x509e98[_0x2ca8('0x27')]()[_0x2ca8('0x26')](function(){_0x3453c3['status'](0xcc)[_0x2ca8('0x28')]();});}};}function handleEntityNotFound(_0x25307c,_0x891e70){return function(_0x5d177e){if(!_0x5d177e){_0x25307c['sendStatus'](0x194);}return _0x5d177e;};}function handleError(_0x44aa17,_0xdee52b){_0xdee52b=_0xdee52b||0x1f4;return function(_0x47c0ec){logger[_0x2ca8('0x29')](_0x47c0ec[_0x2ca8('0x2a')]);if(_0x47c0ec[_0x2ca8('0x2b')]){delete _0x47c0ec[_0x2ca8('0x2b')];}_0x44aa17['status'](_0xdee52b)[_0x2ca8('0x2c')](_0x47c0ec);};}exports[_0x2ca8('0x2d')]=function(_0x3bd36e,_0x5167cd){var _0x3b1136={},_0xda914e={},_0x2c1e21={'count':0x0,'rows':[]};var _0x57512f=_[_0x2ca8('0x2e')](db[_0x2ca8('0x2f')][_0x2ca8('0x30')],function(_0x558c0e){return{'name':_0x558c0e[_0x2ca8('0x31')],'type':_0x558c0e[_0x2ca8('0x32')][_0x2ca8('0x33')]};});_0xda914e[_0x2ca8('0x34')]=_[_0x2ca8('0x2e')](_0x57512f,_0x2ca8('0x2b'));_0xda914e[_0x2ca8('0x35')]=_['keys'](_0x3bd36e['query']);_0xda914e[_0x2ca8('0x36')]=_['intersection'](_0xda914e[_0x2ca8('0x34')],_0xda914e[_0x2ca8('0x35')]);_0x3b1136[_0x2ca8('0x37')]=_[_0x2ca8('0x38')](_0xda914e['model'],qs[_0x2ca8('0x39')](_0x3bd36e[_0x2ca8('0x35')][_0x2ca8('0x39')]));_0x3b1136['attributes']=_0x3b1136[_0x2ca8('0x37')][_0x2ca8('0x3a')]?_0x3b1136['attributes']:_0xda914e['model'];if(!_0x3bd36e['query']['hasOwnProperty']('nolimit')){_0x3b1136[_0x2ca8('0x1e')]=qs[_0x2ca8('0x1e')](_0x3bd36e[_0x2ca8('0x35')][_0x2ca8('0x1e')]);_0x3b1136['offset']=qs[_0x2ca8('0x20')](_0x3bd36e[_0x2ca8('0x35')][_0x2ca8('0x20')]);}_0x3b1136[_0x2ca8('0x3b')]=qs[_0x2ca8('0x3c')](_0x3bd36e[_0x2ca8('0x35')][_0x2ca8('0x3c')]);_0x3b1136[_0x2ca8('0x3d')]=qs[_0x2ca8('0x36')](_[_0x2ca8('0x3e')](_0x3bd36e[_0x2ca8('0x35')],_0xda914e[_0x2ca8('0x36')]),_0x57512f);if(_0x3bd36e[_0x2ca8('0x35')]['filter']){_0x3b1136[_0x2ca8('0x3d')]=_[_0x2ca8('0x3f')](_0x3b1136['where'],{'$or':_[_0x2ca8('0x2e')](_0x57512f,function(_0x45cecb){if(_0x45cecb[_0x2ca8('0x32')]!=='VIRTUAL'){var _0x40ac7b={};_0x40ac7b[_0x45cecb[_0x2ca8('0x2b')]]={'$like':'%'+_0x3bd36e[_0x2ca8('0x35')]['filter']+'%'};return _0x40ac7b;}})});}_0x3b1136=_[_0x2ca8('0x3f')]({},_0x3b1136,_0x3bd36e[_0x2ca8('0x40')]);var _0x19ef0e={'where':_0x3b1136[_0x2ca8('0x3d')]};return db[_0x2ca8('0x2f')][_0x2ca8('0x1f')](_0x19ef0e)[_0x2ca8('0x26')](function(_0x53bc1b){_0x2c1e21[_0x2ca8('0x1f')]=_0x53bc1b;if(_0x3bd36e['query'][_0x2ca8('0x41')]){_0x3b1136[_0x2ca8('0x42')]=[{'all':!![]}];}return db[_0x2ca8('0x2f')]['findAll'](_0x3b1136);})[_0x2ca8('0x26')](function(_0x508537){_0x2c1e21['rows']=_0x508537;return _0x2c1e21;})[_0x2ca8('0x26')](respondWithFilteredResult(_0x5167cd,_0x3b1136))[_0x2ca8('0x43')](handleError(_0x5167cd,null));};exports[_0x2ca8('0x44')]=function(_0x14bd14,_0x2b739f){var _0xd539e9={'raw':!![],'where':{'id':_0x14bd14[_0x2ca8('0x45')]['id']}},_0x1e8a8a={};_0x1e8a8a[_0x2ca8('0x34')]=_['keys'](db[_0x2ca8('0x2f')]['rawAttributes']);_0x1e8a8a[_0x2ca8('0x35')]=_[_0x2ca8('0x46')](_0x14bd14[_0x2ca8('0x35')]);_0x1e8a8a[_0x2ca8('0x36')]=_[_0x2ca8('0x38')](_0x1e8a8a['model'],_0x1e8a8a[_0x2ca8('0x35')]);_0xd539e9[_0x2ca8('0x37')]=_[_0x2ca8('0x38')](_0x1e8a8a[_0x2ca8('0x34')],qs[_0x2ca8('0x39')](_0x14bd14['query']['fields']));_0xd539e9['attributes']=_0xd539e9[_0x2ca8('0x37')][_0x2ca8('0x3a')]?_0xd539e9[_0x2ca8('0x37')]:_0x1e8a8a[_0x2ca8('0x34')];if(_0x14bd14[_0x2ca8('0x35')]['includeAll']){_0xd539e9[_0x2ca8('0x42')]=[{'all':!![]}];}_0xd539e9=_[_0x2ca8('0x3f')]({},_0xd539e9,_0x14bd14[_0x2ca8('0x40')]);return db[_0x2ca8('0x2f')]['find'](_0xd539e9)[_0x2ca8('0x26')](handleEntityNotFound(_0x2b739f,null))[_0x2ca8('0x26')](respondWithResult(_0x2b739f,null))['catch'](handleError(_0x2b739f,null));};exports['create']=function(_0xb39169,_0x278667){return db[_0x2ca8('0x2f')][_0x2ca8('0x47')](_0xb39169[_0x2ca8('0x48')],{})[_0x2ca8('0x26')](respondWithResult(_0x278667,0xc9))[_0x2ca8('0x43')](handleError(_0x278667,null));};exports[_0x2ca8('0x49')]=function(_0x544425,_0xc373f1){return db[_0x2ca8('0x2f')][_0x2ca8('0x49')]()[_0x2ca8('0x26')](respondWithResult(_0xc373f1,null))[_0x2ca8('0x43')](handleError(_0xc373f1,null));};exports['update']=function(_0x53e772,_0x37f89e){if(_0x53e772[_0x2ca8('0x48')][_0x2ca8('0x4a')]){delete _0x53e772[_0x2ca8('0x48')][_0x2ca8('0x4a')];}return db[_0x2ca8('0x2f')]['find']({'where':{'uniqueid':_0x53e772['params']['id']}})[_0x2ca8('0x26')](handleEntityNotFound(_0x37f89e,null))[_0x2ca8('0x26')](saveUpdates(_0x53e772[_0x2ca8('0x48')],null))['then'](respondWithResult(_0x37f89e,null))[_0x2ca8('0x43')](handleError(_0x37f89e,null));}; \ No newline at end of file +var _0x1445=['merge','VIRTUAL','include','catch','show','includeAll','options','find','create','describe','uniqueid','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter'];(function(_0x13fbd5,_0x3b920f){var _0x207ec8=function(_0x589eaa){while(--_0x589eaa){_0x13fbd5['push'](_0x13fbd5['shift']());}};_0x207ec8(++_0x3b920f);}(_0x1445,0x1c3));var _0x5144=function(_0x1d08bc,_0x57e438){_0x1d08bc=_0x1d08bc-0x0;var _0x249ba3=_0x1445[_0x1d08bc];return _0x249ba3;};'use strict';var emlformat=require(_0x5144('0x0'));var rimraf=require(_0x5144('0x1'));var zipdir=require(_0x5144('0x2'));var jsonpatch=require(_0x5144('0x3'));var rp=require('request-promise');var moment=require(_0x5144('0x4'));var BPromise=require(_0x5144('0x5'));var Mustache=require('mustache');var util=require(_0x5144('0x6'));var path=require(_0x5144('0x7'));var sox=require(_0x5144('0x8'));var csv=require('to-csv');var ejs=require(_0x5144('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5144('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5144('0xb'));var deskjs=require(_0x5144('0xc'));var toCsv=require(_0x5144('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5144('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5144('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5144('0x10'));var logger=require(_0x5144('0x11'))(_0x5144('0x12'));var utils=require(_0x5144('0x13'));var config=require(_0x5144('0x14'));var licenseUtil=require(_0x5144('0x15'));var db=require(_0x5144('0x16'))['db'];function respondWithStatusCode(_0x2ad8b2,_0x32e78b){_0x32e78b=_0x32e78b||0xcc;return function(_0x31639e){if(_0x31639e){return _0x2ad8b2[_0x5144('0x17')](_0x32e78b);}return _0x2ad8b2['status'](_0x32e78b)[_0x5144('0x18')]();};}function respondWithResult(_0x4f19ce,_0x3fd65b){_0x3fd65b=_0x3fd65b||0xc8;return function(_0x1cfbad){if(_0x1cfbad){return _0x4f19ce[_0x5144('0x19')](_0x3fd65b)[_0x5144('0x1a')](_0x1cfbad);}};}function respondWithFilteredResult(_0x55293d,_0x271304){return function(_0x4e4ca7){if(_0x4e4ca7){var _0x3fd93a=typeof _0x271304[_0x5144('0x1b')]===_0x5144('0x1c')&&typeof _0x271304[_0x5144('0x1d')]===_0x5144('0x1c');var _0x2cbac1=_0x4e4ca7[_0x5144('0x1e')];var _0x59fb9e=_0x3fd93a?0x0:_0x271304[_0x5144('0x1b')];var _0x512573=_0x3fd93a?_0x4e4ca7[_0x5144('0x1e')]:_0x271304[_0x5144('0x1b')]+_0x271304[_0x5144('0x1d')];var _0x3af547;if(_0x512573>=_0x2cbac1){_0x512573=_0x2cbac1;_0x3af547=0xc8;}else{_0x3af547=0xce;}_0x55293d[_0x5144('0x19')](_0x3af547);return _0x55293d['set'](_0x5144('0x1f'),_0x59fb9e+'-'+_0x512573+'/'+_0x2cbac1)[_0x5144('0x1a')](_0x4e4ca7);}return null;};}function patchUpdates(_0x2d3a8a){return function(_0x281f21){try{jsonpatch[_0x5144('0x20')](_0x281f21,_0x2d3a8a,!![]);}catch(_0xfaf257){return BPromise['reject'](_0xfaf257);}return _0x281f21[_0x5144('0x21')]();};}function saveUpdates(_0x40ecfb,_0x5c8d44){return function(_0xc01775){if(_0xc01775){return _0xc01775[_0x5144('0x22')](_0x40ecfb)[_0x5144('0x23')](function(_0x8814d5){return _0x8814d5;});}return null;};}function removeEntity(_0xd9c671,_0x1f9ebc){return function(_0x1d63db){if(_0x1d63db){return _0x1d63db['destroy']()[_0x5144('0x23')](function(){_0xd9c671[_0x5144('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9232b8,_0x692e6e){return function(_0x543809){if(!_0x543809){_0x9232b8['sendStatus'](0x194);}return _0x543809;};}function handleError(_0x4727ef,_0x58cc3d){_0x58cc3d=_0x58cc3d||0x1f4;return function(_0x4fbc6a){logger[_0x5144('0x24')](_0x4fbc6a[_0x5144('0x25')]);if(_0x4fbc6a[_0x5144('0x26')]){delete _0x4fbc6a['name'];}_0x4727ef[_0x5144('0x19')](_0x58cc3d)[_0x5144('0x27')](_0x4fbc6a);};}exports[_0x5144('0x28')]=function(_0x4dbd60,_0xd0ef57){var _0x570278={},_0x3f1f61={},_0x4af2ba={'count':0x0,'rows':[]};var _0x3f7f6e=_[_0x5144('0x29')](db[_0x5144('0x2a')][_0x5144('0x2b')],function(_0x4d0b7b){return{'name':_0x4d0b7b[_0x5144('0x2c')],'type':_0x4d0b7b[_0x5144('0x2d')][_0x5144('0x2e')]};});_0x3f1f61[_0x5144('0x2f')]=_[_0x5144('0x29')](_0x3f7f6e,_0x5144('0x26'));_0x3f1f61[_0x5144('0x30')]=_[_0x5144('0x31')](_0x4dbd60[_0x5144('0x30')]);_0x3f1f61[_0x5144('0x32')]=_['intersection'](_0x3f1f61[_0x5144('0x2f')],_0x3f1f61[_0x5144('0x30')]);_0x570278[_0x5144('0x33')]=_[_0x5144('0x34')](_0x3f1f61[_0x5144('0x2f')],qs['fields'](_0x4dbd60[_0x5144('0x30')][_0x5144('0x35')]));_0x570278[_0x5144('0x33')]=_0x570278[_0x5144('0x33')][_0x5144('0x36')]?_0x570278[_0x5144('0x33')]:_0x3f1f61[_0x5144('0x2f')];if(!_0x4dbd60[_0x5144('0x30')]['hasOwnProperty'](_0x5144('0x37'))){_0x570278['limit']=qs[_0x5144('0x1d')](_0x4dbd60[_0x5144('0x30')][_0x5144('0x1d')]);_0x570278['offset']=qs[_0x5144('0x1b')](_0x4dbd60['query'][_0x5144('0x1b')]);}_0x570278['order']=qs['sort'](_0x4dbd60['query'][_0x5144('0x38')]);_0x570278[_0x5144('0x39')]=qs[_0x5144('0x32')](_[_0x5144('0x3a')](_0x4dbd60['query'],_0x3f1f61[_0x5144('0x32')]),_0x3f7f6e);if(_0x4dbd60[_0x5144('0x30')][_0x5144('0x3b')]){_0x570278['where']=_[_0x5144('0x3c')](_0x570278['where'],{'$or':_[_0x5144('0x29')](_0x3f7f6e,function(_0x2b3481){if(_0x2b3481[_0x5144('0x2d')]!==_0x5144('0x3d')){var _0x5d4247={};_0x5d4247[_0x2b3481[_0x5144('0x26')]]={'$like':'%'+_0x4dbd60[_0x5144('0x30')][_0x5144('0x3b')]+'%'};return _0x5d4247;}})});}_0x570278=_[_0x5144('0x3c')]({},_0x570278,_0x4dbd60['options']);var _0x36b313={'where':_0x570278[_0x5144('0x39')]};return db[_0x5144('0x2a')]['count'](_0x36b313)[_0x5144('0x23')](function(_0x351375){_0x4af2ba[_0x5144('0x1e')]=_0x351375;if(_0x4dbd60['query']['includeAll']){_0x570278[_0x5144('0x3e')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x570278);})[_0x5144('0x23')](function(_0x346224){_0x4af2ba['rows']=_0x346224;return _0x4af2ba;})[_0x5144('0x23')](respondWithFilteredResult(_0xd0ef57,_0x570278))[_0x5144('0x3f')](handleError(_0xd0ef57,null));};exports[_0x5144('0x40')]=function(_0x4127f0,_0x495311){var _0x1e6f9d={'raw':!![],'where':{'id':_0x4127f0['params']['id']}},_0x2a0c27={};_0x2a0c27['model']=_[_0x5144('0x31')](db[_0x5144('0x2a')]['rawAttributes']);_0x2a0c27[_0x5144('0x30')]=_[_0x5144('0x31')](_0x4127f0['query']);_0x2a0c27[_0x5144('0x32')]=_[_0x5144('0x34')](_0x2a0c27[_0x5144('0x2f')],_0x2a0c27[_0x5144('0x30')]);_0x1e6f9d[_0x5144('0x33')]=_['intersection'](_0x2a0c27[_0x5144('0x2f')],qs[_0x5144('0x35')](_0x4127f0[_0x5144('0x30')][_0x5144('0x35')]));_0x1e6f9d[_0x5144('0x33')]=_0x1e6f9d[_0x5144('0x33')][_0x5144('0x36')]?_0x1e6f9d['attributes']:_0x2a0c27['model'];if(_0x4127f0[_0x5144('0x30')][_0x5144('0x41')]){_0x1e6f9d[_0x5144('0x3e')]=[{'all':!![]}];}_0x1e6f9d=_[_0x5144('0x3c')]({},_0x1e6f9d,_0x4127f0[_0x5144('0x42')]);return db[_0x5144('0x2a')][_0x5144('0x43')](_0x1e6f9d)[_0x5144('0x23')](handleEntityNotFound(_0x495311,null))['then'](respondWithResult(_0x495311,null))[_0x5144('0x3f')](handleError(_0x495311,null));};exports[_0x5144('0x44')]=function(_0x509d28,_0x2039c8){return db[_0x5144('0x2a')]['create'](_0x509d28['body'],{})['then'](respondWithResult(_0x2039c8,0xc9))[_0x5144('0x3f')](handleError(_0x2039c8,null));};exports['describe']=function(_0x48c7a5,_0x45da3b){return db[_0x5144('0x2a')][_0x5144('0x45')]()[_0x5144('0x23')](respondWithResult(_0x45da3b,null))[_0x5144('0x3f')](handleError(_0x45da3b,null));};exports[_0x5144('0x22')]=function(_0x4d8563,_0x477dbe){if(_0x4d8563['body'][_0x5144('0x46')]){delete _0x4d8563[_0x5144('0x47')][_0x5144('0x46')];}return db[_0x5144('0x2a')]['find']({'where':{'uniqueid':_0x4d8563[_0x5144('0x48')]['id']}})['then'](handleEntityNotFound(_0x477dbe,null))['then'](saveUpdates(_0x4d8563[_0x5144('0x47')],null))['then'](respondWithResult(_0x477dbe,null))[_0x5144('0x3f')](handleError(_0x477dbe,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 812ddd2..d8c0ef4 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 _0x32b6=['cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x3f418b,_0x11dde5){var _0x5299c8=function(_0x557e79){while(--_0x557e79){_0x3f418b['push'](_0x3f418b['shift']());}};_0x5299c8(++_0x11dde5);}(_0x32b6,0x1d1));var _0x632b=function(_0xc5caa7,_0x4a53df){_0xc5caa7=_0xc5caa7-0x0;var _0x8c81fc=_0x32b6[_0xc5caa7];return _0x8c81fc;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var logger=require('../../config/logger')(_0x632b('0x2'));var moment=require(_0x632b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x4'));var rimraf=require(_0x632b('0x5'));var config=require(_0x632b('0x6'));var attributes=require(_0x632b('0x7'));module[_0x632b('0x8')]=function(_0x122768,_0x24ceab){return _0x122768[_0x632b('0x9')](_0x632b('0xa'),attributes,{'tableName':_0x632b('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x632b('0xc')]},{'name':_0x632b('0xd'),'fields':[_0x632b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa25=['rimraf','exports','CmHopperHistory','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f7ace,_0x2befb6){var _0x82d661=function(_0x29a5db){while(--_0x29a5db){_0x2f7ace['push'](_0x2f7ace['shift']());}};_0x82d661(++_0x2befb6);}(_0xfa25,0xd1));var _0x5fa2=function(_0x293fb5,_0x4c38bf){_0x293fb5=_0x293fb5-0x0;var _0x2a82ef=_0xfa25[_0x293fb5];return _0x2a82ef;};'use strict';var _=require('lodash');var util=require(_0x5fa2('0x0'));var logger=require(_0x5fa2('0x1'))(_0x5fa2('0x2'));var moment=require(_0x5fa2('0x3'));var BPromise=require(_0x5fa2('0x4'));var rp=require(_0x5fa2('0x5'));var fs=require('fs');var path=require(_0x5fa2('0x6'));var rimraf=require(_0x5fa2('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x5fa2('0x8')]=function(_0x29efc3,_0x479b86){return _0x29efc3['define'](_0x5fa2('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x5fa2('0xa'),'fields':[_0x5fa2('0xa')]},{'name':_0x5fa2('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 3ca6cf8..42d427a 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 _0xa739=['body','options','then','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','campaign','ivrAnswerCallsDay','GetCampaignHopperHistory','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','CreateCmHopperHistory','CmHopperHistory','create'];(function(_0xe5fd3d,_0x5d70e6){var _0x248abe=function(_0x54924f){while(--_0x54924f){_0xe5fd3d['push'](_0xe5fd3d['shift']());}};_0x248abe(++_0x5d70e6);}(_0xa739,0x1e1));var _0x9a73=function(_0x267a82,_0x19c241){_0x267a82=_0x267a82-0x0;var _0x3246e5=_0xa739[_0x267a82];return _0x3246e5;};'use strict';var _=require('lodash');var util=require(_0x9a73('0x0'));var moment=require('moment');var BPromise=require(_0x9a73('0x1'));var rs=require(_0x9a73('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a73('0x3'))['db'];var utils=require(_0x9a73('0x4'));var logger=require(_0x9a73('0x5'))('rpc');var config=require(_0x9a73('0x6'));var jayson=require(_0x9a73('0x7'));var client=jayson[_0x9a73('0x8')][_0x9a73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4c86,_0xd14d4d,_0x3a6506){return new BPromise(function(_0x125177,_0x57f453){return client[_0x9a73('0xa')](_0x3e4c86,_0x3a6506)['then'](function(_0x1078ab){logger[_0x9a73('0xb')](_0x9a73('0xc'),_0xd14d4d,'request\x20sent');logger[_0x9a73('0xd')](_0x9a73('0xe'),_0xd14d4d,'request\x20sent',JSON[_0x9a73('0xf')](_0x1078ab));if(_0x1078ab[_0x9a73('0x10')]){if(_0x1078ab[_0x9a73('0x10')]['code']===0x1f4){logger[_0x9a73('0x10')](_0x9a73('0xc'),_0xd14d4d,_0x1078ab[_0x9a73('0x10')]['message']);return _0x57f453(_0x1078ab[_0x9a73('0x10')][_0x9a73('0x11')]);}logger['error'](_0x9a73('0xc'),_0xd14d4d,_0x1078ab[_0x9a73('0x10')]['message']);return _0x125177(_0x1078ab[_0x9a73('0x10')]['message']);}else{logger[_0x9a73('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0xd14d4d,_0x9a73('0x12'));_0x125177(_0x1078ab['result'][_0x9a73('0x11')]);}})[_0x9a73('0x13')](function(_0x351a67){logger[_0x9a73('0x10')](_0x9a73('0xc'),_0xd14d4d,_0x351a67);_0x57f453(_0x351a67);});});}exports[_0x9a73('0x14')]=function(_0x2e4703){var _0x50c928=this;return new Promise(function(_0x129f3d,_0x5d6d31){return db[_0x9a73('0x15')][_0x9a73('0x16')](_0x2e4703[_0x9a73('0x17')],{'raw':_0x2e4703[_0x9a73('0x18')]?_0x2e4703[_0x9a73('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9a73('0x19')](function(_0x5f00a9){logger[_0x9a73('0xb')](_0x9a73('0x14'),_0x2e4703);logger[_0x9a73('0xd')](_0x9a73('0x14'),_0x2e4703,JSON[_0x9a73('0xf')](_0x5f00a9));_0x129f3d(_0x5f00a9);})[_0x9a73('0x13')](function(_0x385cea){logger[_0x9a73('0x10')](_0x9a73('0x14'),_0x385cea[_0x9a73('0x11')],_0x2e4703);_0x5d6d31(_0x50c928['error'](0x1f4,_0x385cea[_0x9a73('0x11')]));});});};exports[_0x9a73('0x1a')]=function(_0xa65ae9){var _0x18aef7=this;return new Promise(function(_0x43a305,_0x42b4a7){return db[_0x9a73('0x15')][_0x9a73('0x1b')]({'raw':_0xa65ae9[_0x9a73('0x18')]?_0xa65ae9[_0x9a73('0x18')][_0x9a73('0x1c')]===undefined?!![]:![]:!![],'where':_0xa65ae9[_0x9a73('0x18')]?_0xa65ae9[_0x9a73('0x18')][_0x9a73('0x1d')]||null:null,'attributes':[[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')][_0x9a73('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db['sequelize'][_0x9a73('0x21')](_0x9a73('0x22')))),_0x9a73('0x23')],[db[_0x9a73('0x1e')]['fn']('COUNT',db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db['sequelize'][_0x9a73('0x21')](_0x9a73('0x24')))),_0x9a73('0x25')],[db[_0x9a73('0x1e')]['fn']('AVG',db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x9a73('0x26')],[db['sequelize']['fn'](_0x9a73('0x27'),db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')](_0x9a73('0x28')))),_0x9a73('0x29')]]})[_0x9a73('0x19')](function(_0x536e00){logger[_0x9a73('0xb')]('AvgHandleTime',_0xa65ae9);logger[_0x9a73('0xd')]('AvgHandleTime',_0xa65ae9,JSON[_0x9a73('0xf')](_0x536e00));_0x43a305(_0x536e00);})[_0x9a73('0x13')](function(_0x232216){logger[_0x9a73('0x10')](_0x9a73('0x1a'),_0x232216[_0x9a73('0x11')],_0xa65ae9);_0x42b4a7(_0x18aef7[_0x9a73('0x10')](0x1f4,_0x232216[_0x9a73('0x11')]));});});};exports[_0x9a73('0x2a')]=function(_0x6f74d8){var _0x11242a=this;return new Promise(function(_0x4f732e,_0xf9f180){return db[_0x9a73('0x15')][_0x9a73('0x1b')]({'raw':_0x6f74d8[_0x9a73('0x18')]?_0x6f74d8['options']['raw']===undefined?!![]:![]:!![],'where':_0x6f74d8[_0x9a73('0x18')]?_0x6f74d8['options'][_0x9a73('0x1d')]||null:null,'attributes':[['campaign',_0x9a73('0x2b')],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db['sequelize']['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')](_0x9a73('0x2c')))),_0x9a73('0x2d')],[db['sequelize']['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db['sequelize']['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')](_0x9a73('0x22')))),_0x9a73('0x2e')],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x9a73('0x2f')],[db[_0x9a73('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9a73('0x1e')]['literal'](_0x9a73('0x30')))),'outboundCongestionCallsDay'],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db['sequelize'][_0x9a73('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0x9a73('0x1e')]['fn']('IF',db['sequelize'][_0x9a73('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x9a73('0x31')],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')]['literal'](_0x9a73('0x32')))),'outboundUnknownCallsDay'],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')]['literal'](_0x9a73('0x33')))),_0x9a73('0x34')],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db['sequelize'][_0x9a73('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),_0x9a73('0x35')],[db[_0x9a73('0x1e')]['fn'](_0x9a73('0x1f'),db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')](_0x9a73('0x36')))),_0x9a73('0x37')],[db[_0x9a73('0x1e')]['fn']('COUNT',db[_0x9a73('0x1e')]['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')](_0x9a73('0x38')))),_0x9a73('0x39')],[db[_0x9a73('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9a73('0x1e')][_0x9a73('0x21')](_0x9a73('0x3a')))),_0x9a73('0x37')],[db['sequelize']['fn']('COUNT',db[_0x9a73('0x1e')]['fn']('IF',db['sequelize'][_0x9a73('0x21')](_0x9a73('0x3b')))),'outboundReCallsDay']],'group':[_0x9a73('0x3c')]})[_0x9a73('0x19')](function(_0x3cff91){logger[_0x9a73('0xb')](_0x9a73('0x2a'),_0x6f74d8);logger[_0x9a73('0xd')](_0x9a73('0x2a'),_0x6f74d8,JSON[_0x9a73('0xf')](_0x3cff91));_0x4f732e(_0x3cff91);})[_0x9a73('0x13')](function(_0x1924d0){logger[_0x9a73('0x10')](_0x9a73('0x2a'),_0x1924d0[_0x9a73('0x11')],_0x6f74d8);_0xf9f180(_0x11242a[_0x9a73('0x10')](0x1f4,_0x1924d0[_0x9a73('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x24c068){var _0x37506e=this;return new Promise(function(_0x28ab81,_0x15c317){return db['CmHopperHistory'][_0x9a73('0x1b')]({'raw':_0x24c068[_0x9a73('0x18')]?_0x24c068[_0x9a73('0x18')][_0x9a73('0x1c')]===undefined?!![]:![]:!![],'where':_0x24c068[_0x9a73('0x18')]?_0x24c068[_0x9a73('0x18')][_0x9a73('0x1d')]||null:null,'attributes':[[_0x9a73('0x3c'),_0x9a73('0x2b')],[db['sequelize']['fn'](_0x9a73('0x1f'),db['sequelize'][_0x9a73('0x20')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x9a73('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x9a73('0x21')](_0x9a73('0x22')))),_0x9a73('0x3d')]],'group':['campaign']})[_0x9a73('0x19')](function(_0x11378e){logger[_0x9a73('0xb')](_0x9a73('0x3e'),_0x24c068);logger[_0x9a73('0xd')](_0x9a73('0x3e'),_0x24c068,JSON[_0x9a73('0xf')](_0x11378e));_0x28ab81(_0x11378e);})[_0x9a73('0x13')](function(_0x9c1a87){logger[_0x9a73('0x10')](_0x9a73('0x3e'),_0x9c1a87[_0x9a73('0x11')],_0x24c068);_0x15c317(_0x37506e[_0x9a73('0x10')](0x1f4,_0x9c1a87[_0x9a73('0x11')]));});});}; \ No newline at end of file +var _0x1948=['outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','col','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CmHopperHistory','create','body','options','then','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null'];(function(_0x23292a,_0x1e08ea){var _0x4564f2=function(_0x1ae201){while(--_0x1ae201){_0x23292a['push'](_0x23292a['shift']());}};_0x4564f2(++_0x1e08ea);}(_0x1948,0x145));var _0x8194=function(_0x24a7b3,_0x5dafb3){_0x24a7b3=_0x24a7b3-0x0;var _0x5b6e52=_0x1948[_0x24a7b3];return _0x5b6e52;};'use strict';var _=require(_0x8194('0x0'));var util=require(_0x8194('0x1'));var moment=require(_0x8194('0x2'));var BPromise=require(_0x8194('0x3'));var rs=require(_0x8194('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8194('0x5'))['db'];var utils=require(_0x8194('0x6'));var logger=require(_0x8194('0x7'))(_0x8194('0x8'));var config=require(_0x8194('0x9'));var jayson=require(_0x8194('0xa'));var client=jayson[_0x8194('0xb')][_0x8194('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x521ed0,_0x1e4b32,_0x104856){return new BPromise(function(_0x4f32ce,_0xeeaa84){return client[_0x8194('0xd')](_0x521ed0,_0x104856)['then'](function(_0x4ffc45){logger[_0x8194('0xe')](_0x8194('0xf'),_0x1e4b32,_0x8194('0x10'));logger[_0x8194('0x11')](_0x8194('0x12'),_0x1e4b32,'request\x20sent',JSON[_0x8194('0x13')](_0x4ffc45));if(_0x4ffc45[_0x8194('0x14')]){if(_0x4ffc45[_0x8194('0x14')]['code']===0x1f4){logger[_0x8194('0x14')](_0x8194('0xf'),_0x1e4b32,_0x4ffc45[_0x8194('0x14')][_0x8194('0x15')]);return _0xeeaa84(_0x4ffc45[_0x8194('0x14')][_0x8194('0x15')]);}logger['error'](_0x8194('0xf'),_0x1e4b32,_0x4ffc45[_0x8194('0x14')][_0x8194('0x15')]);return _0x4f32ce(_0x4ffc45[_0x8194('0x14')][_0x8194('0x15')]);}else{logger[_0x8194('0xe')](_0x8194('0xf'),_0x1e4b32,_0x8194('0x10'));_0x4f32ce(_0x4ffc45[_0x8194('0x16')]['message']);}})[_0x8194('0x17')](function(_0x31adc2){logger['error'](_0x8194('0xf'),_0x1e4b32,_0x31adc2);_0xeeaa84(_0x31adc2);});});}exports['CreateCmHopperHistory']=function(_0x55e4c2){var _0x5f2172=this;return new Promise(function(_0x37b048,_0x43a192){return db[_0x8194('0x18')][_0x8194('0x19')](_0x55e4c2[_0x8194('0x1a')],{'raw':_0x55e4c2[_0x8194('0x1b')]?_0x55e4c2['options']['raw']===undefined?!![]:![]:!![]})[_0x8194('0x1c')](function(_0x588cac){logger[_0x8194('0xe')](_0x8194('0x1d'),_0x55e4c2);logger[_0x8194('0x11')]('CreateCmHopperHistory',_0x55e4c2,JSON[_0x8194('0x13')](_0x588cac));_0x37b048(_0x588cac);})[_0x8194('0x17')](function(_0x41641d){logger[_0x8194('0x14')](_0x8194('0x1d'),_0x41641d[_0x8194('0x15')],_0x55e4c2);_0x43a192(_0x5f2172[_0x8194('0x14')](0x1f4,_0x41641d[_0x8194('0x15')]));});});};exports[_0x8194('0x1e')]=function(_0x263093){var _0xbb64b7=this;return new Promise(function(_0x300491,_0x5040e6){return db[_0x8194('0x18')][_0x8194('0x1f')]({'raw':_0x263093[_0x8194('0x1b')]?_0x263093[_0x8194('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x263093[_0x8194('0x1b')]?_0x263093[_0x8194('0x1b')][_0x8194('0x20')]||null:null,'attributes':[[db[_0x8194('0x21')]['fn'](_0x8194('0x22'),db['sequelize']['col']('id')),_0x8194('0x23')],[db[_0x8194('0x21')]['fn'](_0x8194('0x22'),db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x8194('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')]('`state`\x20=\x2010,\x201,\x20null'))),_0x8194('0x25')],[db['sequelize']['fn'](_0x8194('0x22'),db['sequelize']['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x26')))),_0x8194('0x27')],[db[_0x8194('0x21')]['fn']('AVG',db[_0x8194('0x21')]['fn']('IF',db['sequelize'][_0x8194('0x24')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x8194('0x28')],[db[_0x8194('0x21')]['fn'](_0x8194('0x29'),db['sequelize']['fn']('IF',db['sequelize'][_0x8194('0x24')](_0x8194('0x2a')))),_0x8194('0x2b')]]})[_0x8194('0x1c')](function(_0x5c04ff){logger['info']('AvgHandleTime',_0x263093);logger[_0x8194('0x11')](_0x8194('0x1e'),_0x263093,JSON[_0x8194('0x13')](_0x5c04ff));_0x300491(_0x5c04ff);})[_0x8194('0x17')](function(_0x3e0181){logger[_0x8194('0x14')]('AvgHandleTime',_0x3e0181[_0x8194('0x15')],_0x263093);_0x5040e6(_0xbb64b7[_0x8194('0x14')](0x1f4,_0x3e0181[_0x8194('0x15')]));});});};exports[_0x8194('0x2c')]=function(_0x3f2ac3){var _0x1f288c=this;return new Promise(function(_0xa5dedc,_0x44c8e6){return db[_0x8194('0x18')][_0x8194('0x1f')]({'raw':_0x3f2ac3[_0x8194('0x1b')]?_0x3f2ac3[_0x8194('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3f2ac3[_0x8194('0x1b')]?_0x3f2ac3['options']['where']||null:null,'attributes':[[_0x8194('0x2d'),_0x8194('0x2e')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x8194('0x2f')))),_0x8194('0x30')],[db[_0x8194('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8194('0x24')](_0x8194('0x31')))),_0x8194('0x32')],[db[_0x8194('0x21')]['fn']('COUNT',db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x33')))),_0x8194('0x34')],[db['sequelize']['fn'](_0x8194('0x22'),db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x35')))),_0x8194('0x36')],[db[_0x8194('0x21')]['fn']('COUNT',db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x37')))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0x8194('0x22'),db['sequelize']['fn']('IF',db[_0x8194('0x21')]['literal'](_0x8194('0x38')))),'outboundDropCallsDayTimeout'],[db[_0x8194('0x21')]['fn'](_0x8194('0x22'),db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')]['literal'](_0x8194('0x39')))),_0x8194('0x3a')],[db[_0x8194('0x21')]['fn']('COUNT',db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x3b')))),_0x8194('0x3c')],[db['sequelize']['fn'](_0x8194('0x22'),db['sequelize']['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x3d')))),_0x8194('0x3e')],[db[_0x8194('0x21')]['fn'](_0x8194('0x22'),db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x3f')))),_0x8194('0x40')],[db[_0x8194('0x21')]['fn'](_0x8194('0x22'),db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x41')))),_0x8194('0x42')],[db['sequelize']['fn'](_0x8194('0x22'),db[_0x8194('0x21')]['fn']('IF',db['sequelize']['literal'](_0x8194('0x43')))),_0x8194('0x44')],[db[_0x8194('0x21')]['fn'](_0x8194('0x22'),db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x45')))),_0x8194('0x42')],[db[_0x8194('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x8194('0x46')))),_0x8194('0x47')]],'group':[_0x8194('0x2d')]})[_0x8194('0x1c')](function(_0x381091){logger[_0x8194('0xe')](_0x8194('0x2c'),_0x3f2ac3);logger[_0x8194('0x11')](_0x8194('0x2c'),_0x3f2ac3,JSON['stringify'](_0x381091));_0xa5dedc(_0x381091);})['catch'](function(_0x259536){logger[_0x8194('0x14')](_0x8194('0x2c'),_0x259536[_0x8194('0x15')],_0x3f2ac3);_0x44c8e6(_0x1f288c[_0x8194('0x14')](0x1f4,_0x259536[_0x8194('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x40c82c){var _0x10b854=this;return new Promise(function(_0x599a51,_0x1c02cd){return db[_0x8194('0x18')][_0x8194('0x1f')]({'raw':_0x40c82c[_0x8194('0x1b')]?_0x40c82c[_0x8194('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x40c82c[_0x8194('0x1b')]?_0x40c82c[_0x8194('0x1b')][_0x8194('0x20')]||null:null,'attributes':[[_0x8194('0x2d'),_0x8194('0x2e')],[db[_0x8194('0x21')]['fn'](_0x8194('0x22'),db[_0x8194('0x21')][_0x8194('0x48')]('id')),_0x8194('0x49')],[db[_0x8194('0x21')]['fn']('COUNT',db[_0x8194('0x21')]['fn']('IF',db[_0x8194('0x21')][_0x8194('0x24')](_0x8194('0x33')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x8194('0x1c')](function(_0xd53eb4){logger[_0x8194('0xe')](_0x8194('0x4a'),_0x40c82c);logger[_0x8194('0x11')]('GetCampaignHopperHistory',_0x40c82c,JSON[_0x8194('0x13')](_0xd53eb4));_0x599a51(_0xd53eb4);})[_0x8194('0x17')](function(_0x131e23){logger[_0x8194('0x14')](_0x8194('0x4a'),_0x131e23[_0x8194('0x15')],_0x40c82c);_0x1c02cd(_0x10b854[_0x8194('0x14')](0x1f4,_0x131e23[_0x8194('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index bc4d82c..14937a0 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 _0xd7c1=['/:id','update','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','show','post'];(function(_0x511d3a,_0x184267){var _0x469385=function(_0x2d4352){while(--_0x2d4352){_0x511d3a['push'](_0x511d3a['shift']());}};_0x469385(++_0x184267);}(_0xd7c1,0x1ab));var _0x1d7c=function(_0x552c4a,_0x13689d){_0x552c4a=_0x552c4a-0x0;var _0x1f444d=_0xd7c1[_0x552c4a];return _0x1f444d;};'use strict';var multer=require(_0x1d7c('0x0'));var util=require('util');var path=require(_0x1d7c('0x1'));var timeout=require(_0x1d7c('0x2'));var express=require(_0x1d7c('0x3'));var router=express['Router']();var fs_extra=require(_0x1d7c('0x4'));var auth=require(_0x1d7c('0x5'));var interaction=require(_0x1d7c('0x6'));var config=require(_0x1d7c('0x7'));var controller=require(_0x1d7c('0x8'));router[_0x1d7c('0x9')]('/',auth[_0x1d7c('0xa')](),controller['index']);router['get'](_0x1d7c('0xb'),auth[_0x1d7c('0xa')](),controller[_0x1d7c('0xc')]);router['get']('/:id',auth[_0x1d7c('0xa')](),controller[_0x1d7c('0xd')]);router[_0x1d7c('0xe')]('/',auth[_0x1d7c('0xa')](),controller['create']);router['put'](_0x1d7c('0xf'),auth[_0x1d7c('0xa')](),controller[_0x1d7c('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb25c=['create','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x4a6f53,_0x4f91c2){var _0x3a47e4=function(_0x197f7c){while(--_0x197f7c){_0x4a6f53['push'](_0x4a6f53['shift']());}};_0x3a47e4(++_0x4f91c2);}(_0xb25c,0x154));var _0xcb25=function(_0x3bd341,_0x2df87a){_0x3bd341=_0x3bd341-0x0;var _0x2008da=_0xb25c[_0x3bd341];return _0x2008da;};'use strict';var multer=require(_0xcb25('0x0'));var util=require(_0xcb25('0x1'));var path=require(_0xcb25('0x2'));var timeout=require(_0xcb25('0x3'));var express=require('express');var router=express[_0xcb25('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb25('0x5'));var interaction=require(_0xcb25('0x6'));var config=require(_0xcb25('0x7'));var controller=require(_0xcb25('0x8'));router['get']('/',auth[_0xcb25('0x9')](),controller[_0xcb25('0xa')]);router[_0xcb25('0xb')](_0xcb25('0xc'),auth[_0xcb25('0x9')](),controller[_0xcb25('0xd')]);router['get'](_0xcb25('0xe'),auth[_0xcb25('0x9')](),controller[_0xcb25('0xf')]);router[_0xcb25('0x10')]('/',auth['isAuthenticated'](),controller[_0xcb25('0x11')]);router[_0xcb25('0x12')](_0xcb25('0xe'),auth[_0xcb25('0x9')](),controller[_0xcb25('0x13')]);module[_0xcb25('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 558d7e6..2529749 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 _0x87d3=['STRING','name','sequelize','exports'];(function(_0x3ad56a,_0x2a8d59){var _0x407683=function(_0x37d951){while(--_0x37d951){_0x3ad56a['push'](_0x3ad56a['shift']());}};_0x407683(++_0x2a8d59);}(_0x87d3,0x86));var _0x387d=function(_0x16e5b3,_0x30d91d){_0x16e5b3=_0x16e5b3-0x0;var _0x4d6874=_0x87d3[_0x16e5b3];return _0x4d6874;};'use strict';var Sequelize=require(_0x387d('0x0'));module[_0x387d('0x1')]={'name':{'type':Sequelize[_0x387d('0x2')],'unique':_0x387d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x387d('0x2')]},'dialPrefix':{'type':Sequelize[_0x387d('0x2')]}}; \ No newline at end of file +var _0xc03e=['STRING','sequelize','name'];(function(_0x415f52,_0x175fef){var _0x522d5d=function(_0x447529){while(--_0x447529){_0x415f52['push'](_0x415f52['shift']());}};_0x522d5d(++_0x175fef);}(_0xc03e,0x15a));var _0xec03=function(_0x366e51,_0x3a0178){_0x366e51=_0x366e51-0x0;var _0x4e23e3=_0xc03e[_0x366e51];return _0x4e23e3;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xec03('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xec03('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 4593d2f..0c46f7a 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 _0x939d=['CmCustomField','concat','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','select','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','toString','isEmpty','now','format','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','info','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','CmList','rows','catch','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','body','destroy','describe','addDisposition','Disposition','getDispositions','findOne','pick','ListId','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts'];(function(_0x5c6a59,_0x284c5e){var _0x27761a=function(_0x15a75d){while(--_0x15a75d){_0x5c6a59['push'](_0x5c6a59['shift']());}};_0x27761a(++_0x284c5e);}(_0x939d,0x182));var _0xd939=function(_0x39615f,_0x160244){_0x39615f=_0x39615f-0x0;var _0x5c2be5=_0x939d[_0x39615f];return _0x5c2be5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd939('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd939('0x1'));var moment=require(_0xd939('0x2'));var BPromise=require(_0xd939('0x3'));var Mustache=require(_0xd939('0x4'));var util=require(_0xd939('0x5'));var path=require(_0xd939('0x6'));var sox=require(_0xd939('0x7'));var csv=require('to-csv');var ejs=require(_0xd939('0x8'));var fs=require('fs');var fs_extra=require(_0xd939('0x9'));var _=require(_0xd939('0xa'));var squel=require('squel');var crypto=require(_0xd939('0xb'));var jsforce=require(_0xd939('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd939('0xd'));var Papa=require(_0xd939('0xe'));var Redis=require(_0xd939('0xf'));var authService=require(_0xd939('0x10'));var qs=require(_0xd939('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd939('0x12'));var logger=require(_0xd939('0x13'))(_0xd939('0x14'));var utils=require(_0xd939('0x15'));var config=require(_0xd939('0x16'));var licenseUtil=require(_0xd939('0x17'));var db=require(_0xd939('0x18'))['db'];var csv_results;config[_0xd939('0x19')]=_[_0xd939('0x1a')](config['redis'],{'host':_0xd939('0x1b'),'port':0x18eb});var socket=require(_0xd939('0x1c'))(new Redis(config['redis']));require('./cmList.socket')[_0xd939('0x1d')](socket);function respondWithStatusCode(_0x4ec743,_0x56e714){_0x56e714=_0x56e714||0xcc;return function(_0x37c619){if(_0x37c619){return _0x4ec743['sendStatus'](_0x56e714);}return _0x4ec743['status'](_0x56e714)[_0xd939('0x1e')]();};}function respondWithResult(_0x5c1903,_0x55a8bb){_0x55a8bb=_0x55a8bb||0xc8;return function(_0x49af33){if(_0x49af33){return _0x5c1903['status'](_0x55a8bb)['json'](_0x49af33);}};}function respondWithFilteredResult(_0x2e925f,_0x466231){return function(_0x529b68){if(_0x529b68){var _0x5c6e24=typeof _0x466231[_0xd939('0x1f')]===_0xd939('0x20')&&typeof _0x466231[_0xd939('0x21')]==='undefined';var _0x3f1eee=_0x529b68[_0xd939('0x22')];var _0x5f16ef=_0x5c6e24?0x0:_0x466231[_0xd939('0x1f')];var _0x670ec9=_0x5c6e24?_0x529b68[_0xd939('0x22')]:_0x466231[_0xd939('0x1f')]+_0x466231[_0xd939('0x21')];var _0x323a7f;if(_0x670ec9>=_0x3f1eee){_0x670ec9=_0x3f1eee;_0x323a7f=0xc8;}else{_0x323a7f=0xce;}_0x2e925f[_0xd939('0x23')](_0x323a7f);return _0x2e925f[_0xd939('0x24')](_0xd939('0x25'),_0x5f16ef+'-'+_0x670ec9+'/'+_0x3f1eee)[_0xd939('0x26')](_0x529b68);}return null;};}function patchUpdates(_0x34412f){return function(_0x5d5a4c){try{jsonpatch[_0xd939('0x27')](_0x5d5a4c,_0x34412f,!![]);}catch(_0x27dcda){return BPromise[_0xd939('0x28')](_0x27dcda);}return _0x5d5a4c[_0xd939('0x29')]();};}function saveUpdates(_0x753a4f,_0x393563){return function(_0x4cca5c){if(_0x4cca5c){return _0x4cca5c[_0xd939('0x2a')](_0x753a4f)[_0xd939('0x2b')](function(_0x3c5e1b){return _0x3c5e1b;});}return null;};}function removeEntity(_0x282dcb,_0x46ccf5){return function(_0x360f9d){if(_0x360f9d){return _0x360f9d['destroy']()[_0xd939('0x2b')](function(){var _0x2f39ca=_0x360f9d['get']({'plain':!![]});var _0x56afa0=_0xd939('0x2c');return db[_0xd939('0x2d')]['destroy']({'where':{'type':_0x56afa0,'resourceId':_0x2f39ca['id']}})[_0xd939('0x2b')](function(){return _0x360f9d;});})[_0xd939('0x2b')](function(){_0x282dcb[_0xd939('0x23')](0xcc)[_0xd939('0x1e')]();});}};}function handleEntityNotFound(_0x120758,_0x2f0a1e){return function(_0x5e360c){if(!_0x5e360c){_0x120758[_0xd939('0x2e')](0x194);}return _0x5e360c;};}function handleError(_0x4ff916,_0xf2617c){_0xf2617c=_0xf2617c||0x1f4;return function(_0x24fd31){logger[_0xd939('0x2f')](_0x24fd31[_0xd939('0x30')]);if(_0x24fd31[_0xd939('0x31')]){delete _0x24fd31[_0xd939('0x31')];}_0x4ff916[_0xd939('0x23')](_0xf2617c)[_0xd939('0x32')](_0x24fd31);};}exports[_0xd939('0x33')]=function(_0x290796,_0x1ced60){var _0x507d45={},_0x4100f5={},_0x39720e={'count':0x0,'rows':[]};var _0x369fcb=_[_0xd939('0x34')](db['CmList']['rawAttributes'],function(_0x1fd3e4){return{'name':_0x1fd3e4[_0xd939('0x35')],'type':_0x1fd3e4[_0xd939('0x36')][_0xd939('0x37')]};});_0x4100f5[_0xd939('0x38')]=_['map'](_0x369fcb,_0xd939('0x31'));_0x4100f5[_0xd939('0x39')]=_[_0xd939('0x3a')](_0x290796[_0xd939('0x39')]);_0x4100f5[_0xd939('0x3b')]=_['intersection'](_0x4100f5[_0xd939('0x38')],_0x4100f5[_0xd939('0x39')]);_0x507d45['attributes']=_[_0xd939('0x3c')](_0x4100f5[_0xd939('0x38')],qs[_0xd939('0x3d')](_0x290796[_0xd939('0x39')]['fields']));_0x507d45[_0xd939('0x3e')]=_0x507d45[_0xd939('0x3e')][_0xd939('0x3f')]?_0x507d45[_0xd939('0x3e')]:_0x4100f5[_0xd939('0x38')];if(!_0x290796[_0xd939('0x39')][_0xd939('0x40')](_0xd939('0x41'))){_0x507d45[_0xd939('0x21')]=qs[_0xd939('0x21')](_0x290796[_0xd939('0x39')][_0xd939('0x21')]);_0x507d45[_0xd939('0x1f')]=qs['offset'](_0x290796[_0xd939('0x39')][_0xd939('0x1f')]);}_0x507d45[_0xd939('0x42')]=qs['sort'](_0x290796[_0xd939('0x39')][_0xd939('0x43')]);_0x507d45['where']=qs[_0xd939('0x3b')](_['pick'](_0x290796[_0xd939('0x39')],_0x4100f5[_0xd939('0x3b')]),_0x369fcb);if(_0x290796[_0xd939('0x39')][_0xd939('0x44')]){_0x507d45[_0xd939('0x45')]=_[_0xd939('0x46')](_0x507d45[_0xd939('0x45')],{'$or':_[_0xd939('0x34')](_0x369fcb,function(_0x149d1f){if(_0x149d1f[_0xd939('0x36')]!=='VIRTUAL'){var _0x4dd31a={};_0x4dd31a[_0x149d1f[_0xd939('0x31')]]={'$like':'%'+_0x290796[_0xd939('0x39')]['filter']+'%'};return _0x4dd31a;}})});}_0x507d45=_[_0xd939('0x46')]({},_0x507d45,_0x290796[_0xd939('0x47')]);var _0x3c5a20={'where':_0x507d45[_0xd939('0x45')]};return db['CmList'][_0xd939('0x22')](_0x3c5a20)[_0xd939('0x2b')](function(_0x2e8ba4){_0x39720e[_0xd939('0x22')]=_0x2e8ba4;if(_0x290796['query'][_0xd939('0x48')]){_0x507d45[_0xd939('0x49')]=[{'all':!![]}];}return db[_0xd939('0x4a')]['findAll'](_0x507d45);})[_0xd939('0x2b')](function(_0x4dca55){_0x39720e[_0xd939('0x4b')]=_0x4dca55;return _0x39720e;})[_0xd939('0x2b')](respondWithFilteredResult(_0x1ced60,_0x507d45))[_0xd939('0x4c')](handleError(_0x1ced60,null));};exports['show']=function(_0x3b905a,_0x360113){var _0x507dd1={'raw':![],'where':{'id':_0x3b905a[_0xd939('0x4d')]['id']}},_0x1a31b4={};_0x1a31b4[_0xd939('0x38')]=_[_0xd939('0x3a')](db[_0xd939('0x4a')][_0xd939('0x4e')]);_0x1a31b4[_0xd939('0x39')]=_[_0xd939('0x3a')](_0x3b905a[_0xd939('0x39')]);_0x1a31b4[_0xd939('0x3b')]=_[_0xd939('0x3c')](_0x1a31b4[_0xd939('0x38')],_0x1a31b4[_0xd939('0x39')]);_0x507dd1['attributes']=_[_0xd939('0x3c')](_0x1a31b4['model'],qs[_0xd939('0x3d')](_0x3b905a[_0xd939('0x39')][_0xd939('0x3d')]));_0x507dd1[_0xd939('0x3e')]=_0x507dd1['attributes'][_0xd939('0x3f')]?_0x507dd1['attributes']:_0x1a31b4[_0xd939('0x38')];if(_0x3b905a[_0xd939('0x39')][_0xd939('0x48')]){_0x507dd1['include']=[{'all':!![]}];}_0x507dd1=_[_0xd939('0x46')]({},_0x507dd1,_0x3b905a[_0xd939('0x47')]);return db[_0xd939('0x4a')][_0xd939('0x4f')](_0x507dd1)[_0xd939('0x2b')](handleEntityNotFound(_0x360113,null))[_0xd939('0x2b')](respondWithResult(_0x360113,null))['catch'](handleError(_0x360113,null));};exports[_0xd939('0x50')]=function(_0xf004f5,_0x4f1c7c){return db[_0xd939('0x4a')][_0xd939('0x50')](_0xf004f5['body'],{})[_0xd939('0x2b')](function(_0x5df2d1){var _0xdafeb7=_0xf004f5[_0xd939('0x51')]['get']({'plain':!![]});if(!_0xdafeb7)throw new Error(_0xd939('0x52'));if(_0xdafeb7[_0xd939('0x53')]===_0xd939('0x51')){var _0xa05dc=_0x5df2d1[_0xd939('0x54')]({'plain':!![]});var _0x2ff394=_0xd939('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x2ff394,'userProfileId':_0xdafeb7[_0xd939('0x55')]},'raw':!![]})['then'](function(_0x103a9c){if(_0x103a9c&&_0x103a9c[_0xd939('0x56')]===0x0){return db[_0xd939('0x2d')][_0xd939('0x50')]({'name':_0xa05dc[_0xd939('0x31')],'resourceId':_0xa05dc['id'],'type':_0x103a9c[_0xd939('0x31')],'sectionId':_0x103a9c['id']},{})['then'](function(){return _0x5df2d1;});}else{return _0x5df2d1;}})[_0xd939('0x4c')](function(_0x3d3804){logger[_0xd939('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d3804);throw _0x3d3804;});}return _0x5df2d1;})[_0xd939('0x2b')](respondWithResult(_0x4f1c7c,0xc9))['catch'](handleError(_0x4f1c7c,null));};exports[_0xd939('0x2a')]=function(_0x3d2531,_0xd37250){if(_0x3d2531[_0xd939('0x57')]['id']){delete _0x3d2531[_0xd939('0x57')]['id'];}return db['CmList'][_0xd939('0x4f')]({'where':{'id':_0x3d2531[_0xd939('0x4d')]['id']}})[_0xd939('0x2b')](handleEntityNotFound(_0xd37250,null))[_0xd939('0x2b')](saveUpdates(_0x3d2531['body'],null))[_0xd939('0x2b')](respondWithResult(_0xd37250,null))[_0xd939('0x4c')](handleError(_0xd37250,null));};exports[_0xd939('0x58')]=function(_0x48a48a,_0x20a9d1){return db[_0xd939('0x4a')][_0xd939('0x4f')]({'where':{'id':_0x48a48a[_0xd939('0x4d')]['id']}})[_0xd939('0x2b')](handleEntityNotFound(_0x20a9d1,null))[_0xd939('0x2b')](removeEntity(_0x20a9d1,null))[_0xd939('0x4c')](handleError(_0x20a9d1,null));};exports['describe']=function(_0x3bff97,_0x4f64a4){return db[_0xd939('0x4a')][_0xd939('0x59')]()['then'](respondWithResult(_0x4f64a4,null))['catch'](handleError(_0x4f64a4,null));};exports[_0xd939('0x5a')]=function(_0x595383,_0x483298,_0x31fc41){if(_0x595383['body']['id']){delete _0x595383['body']['id'];}return db[_0xd939('0x4a')][_0xd939('0x4f')]({'where':{'id':_0x595383['params']['id']}})[_0xd939('0x2b')](handleEntityNotFound(_0x483298,null))['then'](function(_0x16303e){if(_0x16303e){_0x595383['body']['ListId']=_0x16303e['id'];return db[_0xd939('0x5b')][_0xd939('0x50')](_0x595383['body']);}})[_0xd939('0x2b')](respondWithResult(_0x483298,null))[_0xd939('0x4c')](handleError(_0x483298,null));};exports[_0xd939('0x5c')]=function(_0xeb76a1,_0x634827,_0x42ca73){var _0x48cbfb={'raw':![],'where':{}};var _0xffeec9={};var _0xda3787={'count':0x0,'rows':[]};return db['CmList'][_0xd939('0x5d')]({'where':{'id':_0xeb76a1[_0xd939('0x4d')]['id']}})[_0xd939('0x2b')](handleEntityNotFound(_0x634827,null))[_0xd939('0x2b')](function(_0x5a4f72){if(_0x5a4f72){_0xffeec9[_0xd939('0x38')]=_['keys'](db[_0xd939('0x5b')][_0xd939('0x4e')]);_0xffeec9[_0xd939('0x39')]=_[_0xd939('0x3a')](_0xeb76a1['query']);_0xffeec9[_0xd939('0x3b')]=_[_0xd939('0x3c')](_0xffeec9[_0xd939('0x38')],_0xffeec9['query']);_0x48cbfb[_0xd939('0x3e')]=_[_0xd939('0x3c')](_0xffeec9[_0xd939('0x38')],qs['fields'](_0xeb76a1[_0xd939('0x39')][_0xd939('0x3d')]));_0x48cbfb['attributes']=_0x48cbfb[_0xd939('0x3e')][_0xd939('0x3f')]?_0x48cbfb['attributes']:_0xffeec9[_0xd939('0x38')];if(!_0xeb76a1['query'][_0xd939('0x40')]('nolimit')){_0x48cbfb[_0xd939('0x21')]=qs[_0xd939('0x21')](_0xeb76a1[_0xd939('0x39')][_0xd939('0x21')]);_0x48cbfb['offset']=qs[_0xd939('0x1f')](_0xeb76a1['query'][_0xd939('0x1f')]);}_0x48cbfb['order']=qs[_0xd939('0x43')](_0xeb76a1[_0xd939('0x39')]['sort']);_0x48cbfb[_0xd939('0x45')]=qs[_0xd939('0x3b')](_[_0xd939('0x5e')](_0xeb76a1[_0xd939('0x39')],_0xffeec9['filters']));_0x48cbfb[_0xd939('0x45')][_0xd939('0x5f')]=_0x5a4f72['id'];if(_0xeb76a1[_0xd939('0x39')][_0xd939('0x44')]){_0x48cbfb[_0xd939('0x45')]=_[_0xd939('0x46')](_0x48cbfb['where'],{'$or':_[_0xd939('0x34')](_0x48cbfb[_0xd939('0x3e')],function(_0x5d504){var _0xcdcc5a={};_0xcdcc5a[_0x5d504]={'$like':'%'+_0xeb76a1[_0xd939('0x39')]['filter']+'%'};return _0xcdcc5a;})});}_0x48cbfb=_[_0xd939('0x46')]({},_0x48cbfb,_0xeb76a1[_0xd939('0x47')]);return db['Disposition'][_0xd939('0x22')]({'where':_0x48cbfb[_0xd939('0x45')]})[_0xd939('0x2b')](function(_0x4931fe){_0xda3787[_0xd939('0x22')]=_0x4931fe;if(_0xeb76a1[_0xd939('0x39')][_0xd939('0x48')]){_0x48cbfb[_0xd939('0x49')]=[{'all':!![]}];}return db['Disposition'][_0xd939('0x60')](_0x48cbfb);})[_0xd939('0x2b')](function(_0x3073d7){_0xda3787[_0xd939('0x4b')]=_0x3073d7;return _0xda3787;});}})[_0xd939('0x2b')](respondWithFilteredResult(_0x634827,_0x48cbfb))[_0xd939('0x4c')](handleError(_0x634827,null));};exports[_0xd939('0x61')]=function(_0xa6b4fa,_0x2212ce,_0x225802){return db[_0xd939('0x4a')]['find']({'where':{'id':_0xa6b4fa[_0xd939('0x4d')]['id']}})[_0xd939('0x2b')](handleEntityNotFound(_0x2212ce,null))[_0xd939('0x2b')](function(_0x28731c){if(_0x28731c){return _0x28731c['removeDispositions'](_0xa6b4fa['query'][_0xd939('0x62')]);}})[_0xd939('0x2b')](respondWithStatusCode(_0x2212ce,null))[_0xd939('0x4c')](handleError(_0x2212ce,null));};exports[_0xd939('0x63')]=function(_0xc80bb9,_0xa7f0ac,_0x622d7a){return db['CmList'][_0xd939('0x4f')]({'where':{'id':_0xc80bb9[_0xd939('0x4d')]['id']}})['then'](handleEntityNotFound(_0xa7f0ac,null))[_0xd939('0x2b')](function(_0x18e594){if(_0x18e594){var _0x154bca=[];var _0x13c44b={'success':[],'errors':[]};return db[_0xd939('0x64')][_0xd939('0x59')]()[_0xd939('0x2b')](function(_0x4969fd){if(_0xc80bb9[_0xd939('0x57')][_0xd939('0x65')]&&_[_0xd939('0x66')](_0xc80bb9[_0xd939('0x57')][_0xd939('0x65')])){if(_0xc80bb9['body'][_0xd939('0x65')][_0xd939('0x3f')]){_0xc80bb9[_0xd939('0x57')][_0xd939('0x65')]=_0xc80bb9[_0xd939('0x57')][_0xd939('0x65')][_0xd939('0x67')](';')+';';}else{_0xc80bb9['body'][_0xd939('0x65')]=null;}}else{_0xc80bb9['body'][_0xd939('0x65')]=null;}if(_0xc80bb9[_0xd939('0x57')]&&_[_0xd939('0x66')](_0xc80bb9['body'])){for(var _0x2ce9b6=0x0;_0x2ce9b6<_0xc80bb9[_0xd939('0x57')][_0xd939('0x3f')];_0x2ce9b6+=0x1){_0xc80bb9[_0xd939('0x57')][_0x2ce9b6][_0xd939('0x5f')]=_0xc80bb9[_0xd939('0x4d')]['id'];_0x154bca[_0xd939('0x68')](_0xc80bb9[_0xd939('0x57')][_0x2ce9b6]);}return BPromise[_0xd939('0x69')](_0x154bca,function(_0x3bb5ce){return db[_0xd939('0x64')][_0xd939('0x50')](_[_0xd939('0x6a')](_0x3bb5ce,[_0xd939('0x62'),'id'])||{},{'fields':_[_0xd939('0x3a')](_0x4969fd),'raw':!![]})['then'](function(_0x390c50){_0x13c44b['success'][_0xd939('0x68')](_0x390c50[_0xd939('0x6b')]);})[_0xd939('0x4c')](function(_0x47a99a){_0x13c44b[_0xd939('0x6c')][_0xd939('0x68')]({'data':_0x3bb5ce,'error':_0x47a99a[_0xd939('0x6d')]});});})[_0xd939('0x2b')](function(_0x13be9a){return _0x13c44b;})[_0xd939('0x4c')](function(_0x2e2caa){return _0x2e2caa;});}else{_0xa7f0ac[_0xd939('0x23')](0x190)[_0xd939('0x26')]({'message':_0xd939('0x6e')});}});}})[_0xd939('0x2b')](respondWithResult(_0xa7f0ac,null))[_0xd939('0x4c')](handleError(_0xa7f0ac,null));};exports[_0xd939('0x6f')]=function(_0x1f591a,_0x3710a1,_0x25d388){var _0x4446bf;return db['CmList'][_0xd939('0x4f')]({'where':{'id':_0x1f591a[_0xd939('0x4d')]['id']},'include':[{'model':db[_0xd939('0x70')],'as':'CustomFields'}]})[_0xd939('0x2b')](handleEntityNotFound(_0x3710a1,null))[_0xd939('0x2b')](function(_0x1526dd){if(_0x1526dd){_0x4446bf=_0x1526dd;return db['CmContact'][_0xd939('0x4e')];}})['then'](function(_0x2ea139){if(_0x2ea139){var _0x3d7a9f={};var _0x25bdec={};_0x25bdec[_0xd939('0x38')]=_[_0xd939('0x71')](_[_0xd939('0x3a')](_0x2ea139),_[_0xd939('0x34')](_0x4446bf['CustomFields'],function(_0x12a047){return util['format'](_0xd939('0x72'),_0x12a047['id']);}));_0x25bdec[_0xd939('0x39')]=_[_0xd939('0x3a')](_0x1f591a['query']);_0x25bdec['filters']=_[_0xd939('0x3c')](_0x25bdec[_0xd939('0x38')],_0x25bdec[_0xd939('0x39')]);_0x3d7a9f[_0xd939('0x3e')]=_['intersection'](_0x25bdec[_0xd939('0x38')],qs[_0xd939('0x3d')](_0x1f591a[_0xd939('0x39')]['fields']));_0x3d7a9f['attributes']=_0x3d7a9f[_0xd939('0x3e')][_0xd939('0x3f')]?_0x3d7a9f[_0xd939('0x3e')]:_0x25bdec[_0xd939('0x38')];if(!_0x1f591a[_0xd939('0x39')][_0xd939('0x40')](_0xd939('0x41'))){_0x3d7a9f['limit']=qs['limit'](_0x1f591a['query'][_0xd939('0x21')]);_0x3d7a9f[_0xd939('0x1f')]=qs[_0xd939('0x1f')](_0x1f591a['query'][_0xd939('0x1f')]);}_0x3d7a9f[_0xd939('0x42')]=qs[_0xd939('0x43')](_0x1f591a[_0xd939('0x39')][_0xd939('0x43')]);_0x3d7a9f['where']=qs[_0xd939('0x3b')](_[_0xd939('0x5e')](_0x1f591a['query'],_0x25bdec[_0xd939('0x3b')]));_0x3d7a9f[_0xd939('0x73')]=!![];if(_0x1f591a[_0xd939('0x39')][_0xd939('0x44')]){_0x3d7a9f[_0xd939('0x45')]=_['merge'](_0x3d7a9f[_0xd939('0x45')],{'$or':_[_0xd939('0x34')](_0x3d7a9f[_0xd939('0x3e')],function(_0x1913e8){var _0x36b50a={};_0x36b50a[_0x1913e8]={'$like':'%'+_0x1f591a['query'][_0xd939('0x44')]+'%'};return _0x36b50a;})});}_0x3d7a9f=_[_0xd939('0x46')]({},_0x3d7a9f,_0x1f591a[_0xd939('0x47')]);return _0x4446bf[_0xd939('0x6f')](_0x3d7a9f);}})[_0xd939('0x2b')](respondWithResult(_0x3710a1,null))[_0xd939('0x4c')](handleError(_0x3710a1,null));};exports[_0xd939('0x74')]=function(_0x488bbb,_0x2cc3e9,_0x18ed44){var _0x7ae8ad;var _0x40ede2;var _0x2a941c;var _0x56e5f1=_0x488bbb['params']['id'];csv_results=[];return db[_0xd939('0x75')][_0xd939('0x60')]({'attributes':['id',_0xd939('0x31')],'raw':!![],'order':[_0xd939('0x76')]})['then'](function(_0x2d30f9){_0x7ae8ad=_0x2d30f9;var _0x1939df=_['keys'](db[_0xd939('0x64')][_0xd939('0x4e')]);return db[_0xd939('0x70')]['findAll']({'raw':!![],'attributes':['id','alias']})['then'](function(_0x5437b9){_0x40ede2=_0x5437b9;var _0x581161=squel[_0xd939('0x77')]()[_0xd939('0x3d')](_0x1939df)[_0xd939('0x78')](_0xd939('0x79'),'c')[_0xd939('0x45')]('c.ListId\x20=\x20?',_0x56e5f1)['where'](_0xd939('0x7a'))['distinct']();for(var _0xf7dabf=0x0;_0xf7dabf<_0x40ede2[_0xd939('0x3f')];_0xf7dabf++){_0x581161[_0xd939('0x7b')](_0xd939('0x7c')+_0x40ede2[_0xf7dabf]['id'],_0xd939('0x7d')+_0x40ede2[_0xf7dabf]['alias']);}for(var _0xf7dabf=0x0;_0xf7dabf<_0x7ae8ad[_0xd939('0x3f')];_0xf7dabf++){_0x581161['field'](squel[_0xd939('0x77')]()[_0xd939('0x7b')](_0xd939('0x7e'))[_0xd939('0x78')](_0xd939('0x7f'))['where'](_0xd939('0x80'),_0x7ae8ad[_0xf7dabf]['id'])['where'](_0xd939('0x81')),_0xd939('0x82')+_0x7ae8ad[_0xf7dabf][_0xd939('0x31')]);_0x581161['field'](squel[_0xd939('0x77')]()['field']('description')[_0xd939('0x78')]('cm_contact_has_items')[_0xd939('0x45')](_0xd939('0x80'),_0x7ae8ad[_0xf7dabf]['id'])[_0xd939('0x45')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x7ae8ad[_0xf7dabf][_0xd939('0x31')]);}var _0x3cb34c=[];_0x3cb34c[_0xd939('0x68')](_0x581161[_0xd939('0x83')]());BPromise['each'](_0x3cb34c,handleQuery)['then'](function(_0x429aa0){handleQuery(_0x581161[_0xd939('0x83')]());var _0xe14d3a=csv_results[0x0];if(!_[_0xd939('0x84')](_0xe14d3a)){var _0x4faa19=toCsv(_0xe14d3a);var _0x2d4ed7=Date[_0xd939('0x85')]();fs['writeFileSync'](util[_0xd939('0x86')](_0xd939('0x87'),_0x56e5f1,_0x2d4ed7),_0x4faa19);_0x2cc3e9['setHeader'](_0xd939('0x88'),_0xd939('0x89')+util[_0xd939('0x86')](_0xd939('0x8a'),_0x56e5f1,_0x2d4ed7));_0x2cc3e9['setHeader'](_0xd939('0x8b'),'text/csv');return _0x2cc3e9['download'](util[_0xd939('0x86')](_0xd939('0x87'),_0x56e5f1,_0x2d4ed7));}else{return _0x2cc3e9[_0xd939('0x2e')](0xcc);}});});});};exports[_0xd939('0x8c')]=function(_0x505193,_0xbadc50,_0x17e9a3){var _0x308aa8;delete _0x505193['body']['id'];return db[_0xd939('0x4a')][_0xd939('0x5d')]({'where':{'id':_0x505193[_0xd939('0x4d')]['id']}})[_0xd939('0x2b')](handleEntityNotFound(_0xbadc50,null))[_0xd939('0x2b')](function(_0x49f32a){if(_0x49f32a){return db[_0xd939('0x8d')][_0xd939('0x8e')](function(_0x4d9b01){return db['CmCustomField']['create'](_0x505193[_0xd939('0x57')],{'transaction':_0x4d9b01})[_0xd939('0x2b')](function(_0x2464a6){_0x308aa8=_0x2464a6;return _0x49f32a[_0xd939('0x8f')](_0x2464a6,{'transaction':_0x4d9b01});})[_0xd939('0x2b')](function(){var _0x126c96={'type':db[_0xd939('0x90')][_0xd939('0x91')],'transaction':_0x4d9b01};switch(_0x505193['body'][_0xd939('0x36')]){case _0xd939('0x92'):_0x126c96[_0xd939('0x36')]=db[_0xd939('0x90')][_0xd939('0x91')];break;case _0xd939('0x93'):_0x126c96[_0xd939('0x36')]=db[_0xd939('0x90')][_0xd939('0x94')];break;case _0xd939('0x95'):_0x126c96[_0xd939('0x36')]=db['Sequelize'][_0xd939('0x96')];_0x126c96[_0xd939('0x97')]=![];break;default:}return db[_0xd939('0x8d')][_0xd939('0x98')][_0xd939('0x99')](_0xd939('0x79'),util[_0xd939('0x86')](_0xd939('0x9a'),_0x308aa8['id']),_0x126c96);})['then'](function(){return _0x308aa8;});});}})[_0xd939('0x2b')](respondWithResult(_0xbadc50,null))[_0xd939('0x4c')](handleError(_0xbadc50,null));};exports[_0xd939('0x9b')]=function(_0x2c1c70,_0x1aa5bb,_0x3727bb){var _0x5b1d17={};var _0x4d03cb={};var _0x3a2994;var _0x47d078;return db[_0xd939('0x4a')]['findOne']({'where':{'id':_0x2c1c70[_0xd939('0x4d')]['id']}})[_0xd939('0x2b')](handleEntityNotFound(_0x1aa5bb,null))[_0xd939('0x2b')](function(_0x510ffa){if(_0x510ffa){_0x3a2994=_0x510ffa;_0x4d03cb['model']=_[_0xd939('0x3a')](db[_0xd939('0x70')][_0xd939('0x4e')]);_0x4d03cb['query']=_[_0xd939('0x3a')](_0x2c1c70[_0xd939('0x39')]);_0x4d03cb[_0xd939('0x3b')]=_[_0xd939('0x3c')](_0x4d03cb[_0xd939('0x38')],_0x4d03cb[_0xd939('0x39')]);_0x5b1d17['attributes']=_[_0xd939('0x3c')](_0x4d03cb['model'],qs['fields'](_0x2c1c70[_0xd939('0x39')]['fields']));_0x5b1d17[_0xd939('0x3e')]=_0x5b1d17['attributes'][_0xd939('0x3f')]?_0x5b1d17['attributes']:_0x4d03cb[_0xd939('0x38')];_0x5b1d17[_0xd939('0x42')]=qs[_0xd939('0x43')](_0x2c1c70[_0xd939('0x39')][_0xd939('0x43')]);_0x5b1d17[_0xd939('0x45')]=qs[_0xd939('0x3b')](_[_0xd939('0x5e')](_0x2c1c70[_0xd939('0x39')],_0x4d03cb['filters']));_0x5b1d17[_0xd939('0x45')]=_['merge'](_0x5b1d17[_0xd939('0x45')],{'$or':[{'ListId':_0x510ffa['id']},{'ListId':null}]});if(_0x2c1c70['query'][_0xd939('0x44')]){_0x5b1d17[_0xd939('0x45')]=_[_0xd939('0x46')](_0x5b1d17[_0xd939('0x45')],{'$or':_[_0xd939('0x34')](_0x5b1d17[_0xd939('0x3e')],function(_0x1d0d33){var _0x3f5607={};_0x3f5607[_0x1d0d33]={'$like':'%'+_0x2c1c70[_0xd939('0x39')][_0xd939('0x44')]+'%'};return _0x3f5607;})});}_0x5b1d17=_['merge']({},_0x5b1d17,_0x2c1c70[_0xd939('0x47')]);return db['CmCustomField'][_0xd939('0x9c')](_0x5b1d17);}})[_0xd939('0x2b')](respondWithResult(_0x1aa5bb,null))['catch'](handleError(_0x1aa5bb,null));};exports[_0xd939('0x9d')]=function(_0x47afd0,_0x3a6aad){return db[_0xd939('0x70')][_0xd939('0x9c')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x3a6aad,null))[_0xd939('0x2b')](function(_0x3e5d11){return _0x3e5d11;})[_0xd939('0x2b')](respondWithResult(_0x3a6aad,null))['catch'](handleError(_0x3a6aad,null));};exports[_0xd939('0x9e')]=function(_0x398441,_0x32cb47,_0x824502){return db['CmList'][_0xd939('0x4f')]({'where':{'id':_0x398441[_0xd939('0x4d')]['id']}})['then'](handleEntityNotFound(_0x32cb47,null))[_0xd939('0x2b')](function(_0x2b0bcf){if(_0x2b0bcf){return _0x2b0bcf[_0xd939('0x9e')](_0x398441[_0xd939('0x57')]['ids'],_[_0xd939('0x6a')](_0x398441[_0xd939('0x57')],[_0xd939('0x62'),'id'])||{})[_0xd939('0x9f')](function(_0x106725){for(var _0x1e0465=0x0;_0x1e0465<_0x398441[_0xd939('0x57')][_0xd939('0x62')][_0xd939('0x3f')];_0x1e0465+=0x1){socket['emit'](_0xd939('0xa0'),{'UserId':Number(_0x398441[_0xd939('0x57')][_0xd939('0x62')][_0x1e0465]),'CmListId':Number(_0x398441[_0xd939('0x4d')]['id'])});}return _0x106725;});}})[_0xd939('0x2b')](respondWithResult(_0x32cb47,null))['catch'](handleError(_0x32cb47,null));};exports[_0xd939('0xa1')]=function(_0x2fa44d,_0x32a013,_0x395df3){return db['CmList'][_0xd939('0x4f')]({'where':{'id':_0x2fa44d[_0xd939('0x4d')]['id']}})['then'](handleEntityNotFound(_0x32a013,null))['then'](function(_0x1fe38f){if(_0x1fe38f){return _0x1fe38f[_0xd939('0xa1')](_0x2fa44d[_0xd939('0x39')][_0xd939('0x62')])[_0xd939('0x2b')](function(){if(_[_0xd939('0x66')](_0x2fa44d['query'][_0xd939('0x62')])){for(var _0xa1445a=0x0;_0xa1445a<_0x2fa44d[_0xd939('0x39')][_0xd939('0x62')][_0xd939('0x3f')];_0xa1445a+=0x1){socket[_0xd939('0xa2')](_0xd939('0xa3'),{'UserId':Number(_0x2fa44d[_0xd939('0x39')][_0xd939('0x62')][_0xa1445a]),'CmListId':Number(_0x2fa44d['params']['id'])});}}else{socket[_0xd939('0xa2')](_0xd939('0xa3'),{'UserId':Number(_0x2fa44d[_0xd939('0x39')][_0xd939('0x62')]),'CmListId':Number(_0x2fa44d[_0xd939('0x4d')]['id'])});}});}})[_0xd939('0x2b')](respondWithStatusCode(_0x32a013,null))[_0xd939('0x4c')](handleError(_0x32a013,null));};exports[_0xd939('0xa4')]=function(_0x444a1b,_0x3dea70,_0x588ad5){var _0x2fbabf={};var _0x3111ac={};var _0x55ec4b;var _0x208006;return db['CmList'][_0xd939('0x5d')]({'where':{'id':_0x444a1b['params']['id']}})[_0xd939('0x2b')](handleEntityNotFound(_0x3dea70,null))[_0xd939('0x2b')](function(_0x2c4150){if(_0x2c4150){_0x55ec4b=_0x2c4150;_0x3111ac[_0xd939('0x38')]=_[_0xd939('0x3a')](db['User']['rawAttributes']);_0x3111ac[_0xd939('0x39')]=_['keys'](_0x444a1b[_0xd939('0x39')]);_0x3111ac[_0xd939('0x3b')]=_[_0xd939('0x3c')](_0x3111ac[_0xd939('0x38')],_0x3111ac['query']);_0x2fbabf[_0xd939('0x3e')]=_['intersection'](_0x3111ac['model'],qs[_0xd939('0x3d')](_0x444a1b[_0xd939('0x39')]['fields']));_0x2fbabf[_0xd939('0x3e')]=_0x2fbabf[_0xd939('0x3e')][_0xd939('0x3f')]?_0x2fbabf[_0xd939('0x3e')]:_0x3111ac[_0xd939('0x38')];_0x2fbabf[_0xd939('0x42')]=qs[_0xd939('0x43')](_0x444a1b['query'][_0xd939('0x43')]);_0x2fbabf[_0xd939('0x45')]=qs['filters'](_[_0xd939('0x5e')](_0x444a1b['query'],_0x3111ac[_0xd939('0x3b')]));if(_0x444a1b[_0xd939('0x39')]['filter']){_0x2fbabf[_0xd939('0x45')]=_['merge'](_0x2fbabf[_0xd939('0x45')],{'$or':_['map'](_0x2fbabf['attributes'],function(_0x43b554){var _0x2e7289={};_0x2e7289[_0x43b554]={'$like':'%'+_0x444a1b[_0xd939('0x39')][_0xd939('0x44')]+'%'};return _0x2e7289;})});}_0x2fbabf=_[_0xd939('0x46')]({},_0x2fbabf,_0x444a1b[_0xd939('0x47')]);return _0x55ec4b['getAgents'](_0x2fbabf);}})[_0xd939('0x2b')](function(_0x45a54e){if(_0x45a54e){_0x208006=_0x45a54e[_0xd939('0x3f')];if(!_0x444a1b[_0xd939('0x39')][_0xd939('0x40')](_0xd939('0x41'))){_0x2fbabf['limit']=qs['limit'](_0x444a1b[_0xd939('0x39')]['limit']);_0x2fbabf[_0xd939('0x1f')]=qs[_0xd939('0x1f')](_0x444a1b[_0xd939('0x39')][_0xd939('0x1f')]);}return _0x55ec4b['getAgents'](_0x2fbabf);}})[_0xd939('0x2b')](function(_0x2f3327){if(_0x2f3327){return _0x2f3327?{'count':_0x208006,'rows':_0x2f3327}:null;}})[_0xd939('0x2b')](respondWithResult(_0x3dea70,null))['catch'](handleError(_0x3dea70,null));};function handleQuery(_0x1b0d44){logger[_0xd939('0xa5')](_0x1b0d44);return db[_0xd939('0x8d')]['query'](_0x1b0d44)[_0xd939('0x9f')](function(_0x5b92be){csv_results[_0xd939('0x68')](_0x5b92be);})[_0xd939('0x4c')](function(_0xb83e0b){logger[_0xd939('0x2f')](_0xb83e0b[_0xd939('0x6d')]);});} \ No newline at end of file +var _0xe159=['CustomFields','format','getContactsCsv','ContactItemType','OrderBy','alias','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','select','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','cm_contact_has_items','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','sendStatus','addCustomField','sequelize','addCustomFields','text','Sequelize','TEXT','switch','BOOLEAN','addColumn','cf_%s','getCustomFields','findOne','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','message','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','get','UserProfileResource','destroy','then','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','find','params','describe','addDisposition','ListId','Disposition','hasOwnProperty','pick','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField'];(function(_0xbd39bf,_0x1f5ca3){var _0x3d0e9b=function(_0x14f2e2){while(--_0x14f2e2){_0xbd39bf['push'](_0xbd39bf['shift']());}};_0x3d0e9b(++_0x1f5ca3);}(_0xe159,0x16f));var _0x9e15=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe159[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x9e15('0x0'));var rimraf=require(_0x9e15('0x1'));var zipdir=require(_0x9e15('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e15('0x3'));var Mustache=require(_0x9e15('0x4'));var util=require(_0x9e15('0x5'));var path=require(_0x9e15('0x6'));var sox=require(_0x9e15('0x7'));var csv=require(_0x9e15('0x8'));var ejs=require(_0x9e15('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e15('0xa'));var squel=require(_0x9e15('0xb'));var crypto=require(_0x9e15('0xc'));var jsforce=require(_0x9e15('0xd'));var deskjs=require(_0x9e15('0xe'));var toCsv=require(_0x9e15('0x8'));var querystring=require('querystring');var Papa=require(_0x9e15('0xf'));var Redis=require(_0x9e15('0x10'));var authService=require(_0x9e15('0x11'));var qs=require(_0x9e15('0x12'));var as=require(_0x9e15('0x13'));var hardwareService=require(_0x9e15('0x14'));var logger=require(_0x9e15('0x15'))(_0x9e15('0x16'));var utils=require(_0x9e15('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9e15('0x18'));var db=require(_0x9e15('0x19'))['db'];var csv_results;config['redis']=_[_0x9e15('0x1a')](config[_0x9e15('0x1b')],{'host':_0x9e15('0x1c'),'port':0x18eb});var socket=require(_0x9e15('0x1d'))(new Redis(config['redis']));require(_0x9e15('0x1e'))[_0x9e15('0x1f')](socket);function respondWithStatusCode(_0x3dd737,_0x3db3fc){_0x3db3fc=_0x3db3fc||0xcc;return function(_0x5e99d8){if(_0x5e99d8){return _0x3dd737['sendStatus'](_0x3db3fc);}return _0x3dd737[_0x9e15('0x20')](_0x3db3fc)[_0x9e15('0x21')]();};}function respondWithResult(_0x4b1f0f,_0x771fae){_0x771fae=_0x771fae||0xc8;return function(_0x12f36f){if(_0x12f36f){return _0x4b1f0f['status'](_0x771fae)['json'](_0x12f36f);}};}function respondWithFilteredResult(_0x4ec145,_0x4e35b1){return function(_0x14e253){if(_0x14e253){var _0x340996=typeof _0x4e35b1[_0x9e15('0x22')]===_0x9e15('0x23')&&typeof _0x4e35b1[_0x9e15('0x24')]===_0x9e15('0x23');var _0x56a89e=_0x14e253[_0x9e15('0x25')];var _0x115191=_0x340996?0x0:_0x4e35b1[_0x9e15('0x22')];var _0x43075e=_0x340996?_0x14e253[_0x9e15('0x25')]:_0x4e35b1[_0x9e15('0x22')]+_0x4e35b1[_0x9e15('0x24')];var _0x202ec3;if(_0x43075e>=_0x56a89e){_0x43075e=_0x56a89e;_0x202ec3=0xc8;}else{_0x202ec3=0xce;}_0x4ec145[_0x9e15('0x20')](_0x202ec3);return _0x4ec145[_0x9e15('0x26')](_0x9e15('0x27'),_0x115191+'-'+_0x43075e+'/'+_0x56a89e)[_0x9e15('0x28')](_0x14e253);}return null;};}function patchUpdates(_0xcc9696){return function(_0x5a9635){try{jsonpatch['apply'](_0x5a9635,_0xcc9696,!![]);}catch(_0x272f64){return BPromise[_0x9e15('0x29')](_0x272f64);}return _0x5a9635[_0x9e15('0x2a')]();};}function saveUpdates(_0x196c11,_0x55a56d){return function(_0x45e9f1){if(_0x45e9f1){return _0x45e9f1[_0x9e15('0x2b')](_0x196c11)['then'](function(_0x5b8ee6){return _0x5b8ee6;});}return null;};}function removeEntity(_0x1a06fc,_0x385460){return function(_0x1fb70e){if(_0x1fb70e){return _0x1fb70e['destroy']()['then'](function(){var _0x5f6098=_0x1fb70e[_0x9e15('0x2c')]({'plain':!![]});var _0x59145a='Lists';return db[_0x9e15('0x2d')][_0x9e15('0x2e')]({'where':{'type':_0x59145a,'resourceId':_0x5f6098['id']}})[_0x9e15('0x2f')](function(){return _0x1fb70e;});})[_0x9e15('0x2f')](function(){_0x1a06fc[_0x9e15('0x20')](0xcc)[_0x9e15('0x21')]();});}};}function handleEntityNotFound(_0x4b31bb,_0x135550){return function(_0x2e91a2){if(!_0x2e91a2){_0x4b31bb['sendStatus'](0x194);}return _0x2e91a2;};}function handleError(_0x1f3b93,_0x12fed9){_0x12fed9=_0x12fed9||0x1f4;return function(_0x304e30){logger[_0x9e15('0x30')](_0x304e30[_0x9e15('0x31')]);if(_0x304e30[_0x9e15('0x32')]){delete _0x304e30[_0x9e15('0x32')];}_0x1f3b93[_0x9e15('0x20')](_0x12fed9)[_0x9e15('0x33')](_0x304e30);};}exports[_0x9e15('0x34')]=function(_0x2a85ce,_0x1f2112){var _0x10afc4={},_0x2ff142={},_0x4b267b={'count':0x0,'rows':[]};var _0x430a9a=_[_0x9e15('0x35')](db[_0x9e15('0x36')][_0x9e15('0x37')],function(_0x14e05e){return{'name':_0x14e05e[_0x9e15('0x38')],'type':_0x14e05e['type'][_0x9e15('0x39')]};});_0x2ff142[_0x9e15('0x3a')]=_[_0x9e15('0x35')](_0x430a9a,_0x9e15('0x32'));_0x2ff142['query']=_[_0x9e15('0x3b')](_0x2a85ce['query']);_0x2ff142[_0x9e15('0x3c')]=_[_0x9e15('0x3d')](_0x2ff142[_0x9e15('0x3a')],_0x2ff142[_0x9e15('0x3e')]);_0x10afc4['attributes']=_[_0x9e15('0x3d')](_0x2ff142[_0x9e15('0x3a')],qs[_0x9e15('0x3f')](_0x2a85ce['query']['fields']));_0x10afc4[_0x9e15('0x40')]=_0x10afc4['attributes'][_0x9e15('0x41')]?_0x10afc4[_0x9e15('0x40')]:_0x2ff142[_0x9e15('0x3a')];if(!_0x2a85ce[_0x9e15('0x3e')]['hasOwnProperty'](_0x9e15('0x42'))){_0x10afc4[_0x9e15('0x24')]=qs[_0x9e15('0x24')](_0x2a85ce[_0x9e15('0x3e')][_0x9e15('0x24')]);_0x10afc4[_0x9e15('0x22')]=qs[_0x9e15('0x22')](_0x2a85ce[_0x9e15('0x3e')][_0x9e15('0x22')]);}_0x10afc4[_0x9e15('0x43')]=qs[_0x9e15('0x44')](_0x2a85ce['query']['sort']);_0x10afc4['where']=qs['filters'](_['pick'](_0x2a85ce[_0x9e15('0x3e')],_0x2ff142['filters']),_0x430a9a);if(_0x2a85ce[_0x9e15('0x3e')]['filter']){_0x10afc4[_0x9e15('0x45')]=_[_0x9e15('0x46')](_0x10afc4[_0x9e15('0x45')],{'$or':_[_0x9e15('0x35')](_0x430a9a,function(_0x2b0709){if(_0x2b0709[_0x9e15('0x47')]!==_0x9e15('0x48')){var _0x467c0e={};_0x467c0e[_0x2b0709[_0x9e15('0x32')]]={'$like':'%'+_0x2a85ce[_0x9e15('0x3e')][_0x9e15('0x49')]+'%'};return _0x467c0e;}})});}_0x10afc4=_[_0x9e15('0x46')]({},_0x10afc4,_0x2a85ce[_0x9e15('0x4a')]);var _0x542a51={'where':_0x10afc4[_0x9e15('0x45')]};return db[_0x9e15('0x36')][_0x9e15('0x25')](_0x542a51)[_0x9e15('0x2f')](function(_0x15ec35){_0x4b267b[_0x9e15('0x25')]=_0x15ec35;if(_0x2a85ce[_0x9e15('0x3e')][_0x9e15('0x4b')]){_0x10afc4['include']=[{'all':!![]}];}return db[_0x9e15('0x36')][_0x9e15('0x4c')](_0x10afc4);})[_0x9e15('0x2f')](function(_0x4e6ff3){_0x4b267b['rows']=_0x4e6ff3;return _0x4b267b;})[_0x9e15('0x2f')](respondWithFilteredResult(_0x1f2112,_0x10afc4))[_0x9e15('0x4d')](handleError(_0x1f2112,null));};exports['show']=function(_0x5597a3,_0x1c9e3a){var _0x15ce04={'raw':![],'where':{'id':_0x5597a3['params']['id']}},_0x16a243={};_0x16a243[_0x9e15('0x3a')]=_['keys'](db[_0x9e15('0x36')]['rawAttributes']);_0x16a243[_0x9e15('0x3e')]=_[_0x9e15('0x3b')](_0x5597a3[_0x9e15('0x3e')]);_0x16a243[_0x9e15('0x3c')]=_['intersection'](_0x16a243[_0x9e15('0x3a')],_0x16a243[_0x9e15('0x3e')]);_0x15ce04[_0x9e15('0x40')]=_[_0x9e15('0x3d')](_0x16a243[_0x9e15('0x3a')],qs[_0x9e15('0x3f')](_0x5597a3['query'][_0x9e15('0x3f')]));_0x15ce04['attributes']=_0x15ce04[_0x9e15('0x40')][_0x9e15('0x41')]?_0x15ce04[_0x9e15('0x40')]:_0x16a243['model'];if(_0x5597a3[_0x9e15('0x3e')]['includeAll']){_0x15ce04[_0x9e15('0x4e')]=[{'all':!![]}];}_0x15ce04=_[_0x9e15('0x46')]({},_0x15ce04,_0x5597a3[_0x9e15('0x4a')]);return db[_0x9e15('0x36')]['find'](_0x15ce04)[_0x9e15('0x2f')](handleEntityNotFound(_0x1c9e3a,null))[_0x9e15('0x2f')](respondWithResult(_0x1c9e3a,null))['catch'](handleError(_0x1c9e3a,null));};exports['create']=function(_0x44db4e,_0xbe2cfe){return db[_0x9e15('0x36')][_0x9e15('0x4f')](_0x44db4e[_0x9e15('0x50')],{})[_0x9e15('0x2f')](function(_0x13f28c){var _0x19c638=_0x44db4e[_0x9e15('0x51')][_0x9e15('0x2c')]({'plain':!![]});if(!_0x19c638)throw new Error(_0x9e15('0x52'));if(_0x19c638[_0x9e15('0x53')]===_0x9e15('0x51')){var _0x3c5eb8=_0x13f28c[_0x9e15('0x2c')]({'plain':!![]});var _0x46fb4c=_0x9e15('0x54');return db[_0x9e15('0x55')][_0x9e15('0x56')]({'where':{'name':_0x46fb4c,'userProfileId':_0x19c638['userProfileId']},'raw':!![]})[_0x9e15('0x2f')](function(_0x45ea60){if(_0x45ea60&&_0x45ea60['autoAssociation']===0x0){return db[_0x9e15('0x2d')][_0x9e15('0x4f')]({'name':_0x3c5eb8['name'],'resourceId':_0x3c5eb8['id'],'type':_0x45ea60[_0x9e15('0x32')],'sectionId':_0x45ea60['id']},{})[_0x9e15('0x2f')](function(){return _0x13f28c;});}else{return _0x13f28c;}})[_0x9e15('0x4d')](function(_0x5ba3ec){logger[_0x9e15('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ba3ec);throw _0x5ba3ec;});}return _0x13f28c;})[_0x9e15('0x2f')](respondWithResult(_0xbe2cfe,0xc9))[_0x9e15('0x4d')](handleError(_0xbe2cfe,null));};exports[_0x9e15('0x2b')]=function(_0x2005f4,_0x4340f0){if(_0x2005f4[_0x9e15('0x50')]['id']){delete _0x2005f4[_0x9e15('0x50')]['id'];}return db[_0x9e15('0x36')][_0x9e15('0x56')]({'where':{'id':_0x2005f4['params']['id']}})[_0x9e15('0x2f')](handleEntityNotFound(_0x4340f0,null))['then'](saveUpdates(_0x2005f4[_0x9e15('0x50')],null))[_0x9e15('0x2f')](respondWithResult(_0x4340f0,null))['catch'](handleError(_0x4340f0,null));};exports[_0x9e15('0x2e')]=function(_0x4ec7ef,_0x98c9bc){return db[_0x9e15('0x36')]['find']({'where':{'id':_0x4ec7ef[_0x9e15('0x57')]['id']}})[_0x9e15('0x2f')](handleEntityNotFound(_0x98c9bc,null))[_0x9e15('0x2f')](removeEntity(_0x98c9bc,null))[_0x9e15('0x4d')](handleError(_0x98c9bc,null));};exports[_0x9e15('0x58')]=function(_0x27ee20,_0x4b42a9){return db[_0x9e15('0x36')]['describe']()[_0x9e15('0x2f')](respondWithResult(_0x4b42a9,null))[_0x9e15('0x4d')](handleError(_0x4b42a9,null));};exports[_0x9e15('0x59')]=function(_0xebbb82,_0xe1a054,_0x131208){if(_0xebbb82[_0x9e15('0x50')]['id']){delete _0xebbb82[_0x9e15('0x50')]['id'];}return db[_0x9e15('0x36')][_0x9e15('0x56')]({'where':{'id':_0xebbb82[_0x9e15('0x57')]['id']}})['then'](handleEntityNotFound(_0xe1a054,null))['then'](function(_0x30ffbe){if(_0x30ffbe){_0xebbb82[_0x9e15('0x50')][_0x9e15('0x5a')]=_0x30ffbe['id'];return db[_0x9e15('0x5b')][_0x9e15('0x4f')](_0xebbb82[_0x9e15('0x50')]);}})[_0x9e15('0x2f')](respondWithResult(_0xe1a054,null))[_0x9e15('0x4d')](handleError(_0xe1a054,null));};exports['getDispositions']=function(_0x2e8e86,_0x52624b,_0x37604b){var _0x1b28d4={'raw':![],'where':{}};var _0x551d61={};var _0x54744a={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x2e8e86[_0x9e15('0x57')]['id']}})[_0x9e15('0x2f')](handleEntityNotFound(_0x52624b,null))[_0x9e15('0x2f')](function(_0x25fca5){if(_0x25fca5){_0x551d61['model']=_[_0x9e15('0x3b')](db[_0x9e15('0x5b')]['rawAttributes']);_0x551d61[_0x9e15('0x3e')]=_[_0x9e15('0x3b')](_0x2e8e86['query']);_0x551d61[_0x9e15('0x3c')]=_[_0x9e15('0x3d')](_0x551d61[_0x9e15('0x3a')],_0x551d61[_0x9e15('0x3e')]);_0x1b28d4[_0x9e15('0x40')]=_[_0x9e15('0x3d')](_0x551d61['model'],qs[_0x9e15('0x3f')](_0x2e8e86['query'][_0x9e15('0x3f')]));_0x1b28d4['attributes']=_0x1b28d4[_0x9e15('0x40')][_0x9e15('0x41')]?_0x1b28d4[_0x9e15('0x40')]:_0x551d61[_0x9e15('0x3a')];if(!_0x2e8e86['query'][_0x9e15('0x5c')](_0x9e15('0x42'))){_0x1b28d4[_0x9e15('0x24')]=qs[_0x9e15('0x24')](_0x2e8e86[_0x9e15('0x3e')][_0x9e15('0x24')]);_0x1b28d4[_0x9e15('0x22')]=qs[_0x9e15('0x22')](_0x2e8e86[_0x9e15('0x3e')][_0x9e15('0x22')]);}_0x1b28d4['order']=qs[_0x9e15('0x44')](_0x2e8e86[_0x9e15('0x3e')][_0x9e15('0x44')]);_0x1b28d4[_0x9e15('0x45')]=qs[_0x9e15('0x3c')](_[_0x9e15('0x5d')](_0x2e8e86[_0x9e15('0x3e')],_0x551d61[_0x9e15('0x3c')]));_0x1b28d4[_0x9e15('0x45')][_0x9e15('0x5a')]=_0x25fca5['id'];if(_0x2e8e86[_0x9e15('0x3e')][_0x9e15('0x49')]){_0x1b28d4[_0x9e15('0x45')]=_[_0x9e15('0x46')](_0x1b28d4['where'],{'$or':_['map'](_0x1b28d4[_0x9e15('0x40')],function(_0xe41124){var _0x5a22bd={};_0x5a22bd[_0xe41124]={'$like':'%'+_0x2e8e86[_0x9e15('0x3e')]['filter']+'%'};return _0x5a22bd;})});}_0x1b28d4=_[_0x9e15('0x46')]({},_0x1b28d4,_0x2e8e86[_0x9e15('0x4a')]);return db[_0x9e15('0x5b')][_0x9e15('0x25')]({'where':_0x1b28d4[_0x9e15('0x45')]})['then'](function(_0x203865){_0x54744a[_0x9e15('0x25')]=_0x203865;if(_0x2e8e86['query'][_0x9e15('0x4b')]){_0x1b28d4[_0x9e15('0x4e')]=[{'all':!![]}];}return db[_0x9e15('0x5b')][_0x9e15('0x4c')](_0x1b28d4);})['then'](function(_0x543363){_0x54744a[_0x9e15('0x5e')]=_0x543363;return _0x54744a;});}})[_0x9e15('0x2f')](respondWithFilteredResult(_0x52624b,_0x1b28d4))[_0x9e15('0x4d')](handleError(_0x52624b,null));};exports[_0x9e15('0x5f')]=function(_0x3fc4d3,_0x8eb580,_0x109eaf){return db['CmList']['find']({'where':{'id':_0x3fc4d3[_0x9e15('0x57')]['id']}})[_0x9e15('0x2f')](handleEntityNotFound(_0x8eb580,null))[_0x9e15('0x2f')](function(_0x24a265){if(_0x24a265){return _0x24a265[_0x9e15('0x5f')](_0x3fc4d3[_0x9e15('0x3e')][_0x9e15('0x60')]);}})[_0x9e15('0x2f')](respondWithStatusCode(_0x8eb580,null))[_0x9e15('0x4d')](handleError(_0x8eb580,null));};exports[_0x9e15('0x61')]=function(_0x265f9a,_0x2dd604,_0x18c610){return db['CmList'][_0x9e15('0x56')]({'where':{'id':_0x265f9a[_0x9e15('0x57')]['id']}})[_0x9e15('0x2f')](handleEntityNotFound(_0x2dd604,null))[_0x9e15('0x2f')](function(_0x394aec){if(_0x394aec){var _0x100b7a=[];var _0x17a8e2={'success':[],'errors':[]};return db[_0x9e15('0x62')][_0x9e15('0x58')]()[_0x9e15('0x2f')](function(_0x98896){if(_0x265f9a[_0x9e15('0x50')][_0x9e15('0x63')]&&_[_0x9e15('0x64')](_0x265f9a[_0x9e15('0x50')][_0x9e15('0x63')])){if(_0x265f9a[_0x9e15('0x50')][_0x9e15('0x63')]['length']){_0x265f9a[_0x9e15('0x50')][_0x9e15('0x63')]=_0x265f9a[_0x9e15('0x50')][_0x9e15('0x63')][_0x9e15('0x65')](';')+';';}else{_0x265f9a[_0x9e15('0x50')][_0x9e15('0x63')]=null;}}else{_0x265f9a[_0x9e15('0x50')][_0x9e15('0x63')]=null;}if(_0x265f9a[_0x9e15('0x50')]&&_[_0x9e15('0x64')](_0x265f9a[_0x9e15('0x50')])){for(var _0x50a231=0x0;_0x50a231<_0x265f9a[_0x9e15('0x50')][_0x9e15('0x41')];_0x50a231+=0x1){_0x265f9a[_0x9e15('0x50')][_0x50a231][_0x9e15('0x5a')]=_0x265f9a['params']['id'];_0x100b7a[_0x9e15('0x66')](_0x265f9a[_0x9e15('0x50')][_0x50a231]);}return BPromise[_0x9e15('0x67')](_0x100b7a,function(_0xb31e1a){return db[_0x9e15('0x62')]['create'](_[_0x9e15('0x68')](_0xb31e1a,[_0x9e15('0x60'),'id'])||{},{'fields':_[_0x9e15('0x3b')](_0x98896),'raw':!![]})[_0x9e15('0x2f')](function(_0x347d3d){_0x17a8e2['success'][_0x9e15('0x66')](_0x347d3d[_0x9e15('0x69')]);})['catch'](function(_0x13778d){_0x17a8e2[_0x9e15('0x6a')][_0x9e15('0x66')]({'data':_0xb31e1a,'error':_0x13778d['message']});});})[_0x9e15('0x2f')](function(_0x4334bd){return _0x17a8e2;})[_0x9e15('0x4d')](function(_0x2f7c4d){return _0x2f7c4d;});}else{_0x2dd604['status'](0x190)[_0x9e15('0x28')]({'message':_0x9e15('0x6b')});}});}})[_0x9e15('0x2f')](respondWithResult(_0x2dd604,null))[_0x9e15('0x4d')](handleError(_0x2dd604,null));};exports[_0x9e15('0x6c')]=function(_0x217071,_0x46fabc,_0x3637a1){var _0x5b7bc2;return db[_0x9e15('0x36')][_0x9e15('0x56')]({'where':{'id':_0x217071[_0x9e15('0x57')]['id']},'include':[{'model':db[_0x9e15('0x6d')],'as':_0x9e15('0x6e')}]})['then'](handleEntityNotFound(_0x46fabc,null))[_0x9e15('0x2f')](function(_0x63425){if(_0x63425){_0x5b7bc2=_0x63425;return db[_0x9e15('0x62')]['rawAttributes'];}})[_0x9e15('0x2f')](function(_0x1be467){if(_0x1be467){var _0x243d40={};var _0x4aa3b4={};_0x4aa3b4[_0x9e15('0x3a')]=_['concat'](_[_0x9e15('0x3b')](_0x1be467),_[_0x9e15('0x35')](_0x5b7bc2['CustomFields'],function(_0x120bed){return util[_0x9e15('0x6f')]('cf_%d',_0x120bed['id']);}));_0x4aa3b4[_0x9e15('0x3e')]=_[_0x9e15('0x3b')](_0x217071[_0x9e15('0x3e')]);_0x4aa3b4[_0x9e15('0x3c')]=_[_0x9e15('0x3d')](_0x4aa3b4[_0x9e15('0x3a')],_0x4aa3b4[_0x9e15('0x3e')]);_0x243d40[_0x9e15('0x40')]=_[_0x9e15('0x3d')](_0x4aa3b4[_0x9e15('0x3a')],qs['fields'](_0x217071[_0x9e15('0x3e')][_0x9e15('0x3f')]));_0x243d40[_0x9e15('0x40')]=_0x243d40['attributes'][_0x9e15('0x41')]?_0x243d40[_0x9e15('0x40')]:_0x4aa3b4[_0x9e15('0x3a')];if(!_0x217071[_0x9e15('0x3e')][_0x9e15('0x5c')](_0x9e15('0x42'))){_0x243d40['limit']=qs[_0x9e15('0x24')](_0x217071[_0x9e15('0x3e')][_0x9e15('0x24')]);_0x243d40[_0x9e15('0x22')]=qs[_0x9e15('0x22')](_0x217071[_0x9e15('0x3e')][_0x9e15('0x22')]);}_0x243d40[_0x9e15('0x43')]=qs[_0x9e15('0x44')](_0x217071['query']['sort']);_0x243d40[_0x9e15('0x45')]=qs[_0x9e15('0x3c')](_[_0x9e15('0x5d')](_0x217071[_0x9e15('0x3e')],_0x4aa3b4['filters']));_0x243d40['raw']=!![];if(_0x217071[_0x9e15('0x3e')]['filter']){_0x243d40['where']=_[_0x9e15('0x46')](_0x243d40[_0x9e15('0x45')],{'$or':_[_0x9e15('0x35')](_0x243d40[_0x9e15('0x40')],function(_0x287b7c){var _0x573d02={};_0x573d02[_0x287b7c]={'$like':'%'+_0x217071[_0x9e15('0x3e')][_0x9e15('0x49')]+'%'};return _0x573d02;})});}_0x243d40=_[_0x9e15('0x46')]({},_0x243d40,_0x217071['options']);return _0x5b7bc2[_0x9e15('0x6c')](_0x243d40);}})['then'](respondWithResult(_0x46fabc,null))[_0x9e15('0x4d')](handleError(_0x46fabc,null));};exports[_0x9e15('0x70')]=function(_0x20841a,_0x12ee04,_0x59fa1c){var _0x152adf;var _0x4ce1c3;var _0x184de9;var _0xe4166d=_0x20841a[_0x9e15('0x57')]['id'];csv_results=[];return db[_0x9e15('0x71')][_0x9e15('0x4c')]({'attributes':['id','name'],'raw':!![],'order':[_0x9e15('0x72')]})[_0x9e15('0x2f')](function(_0x5930d6){_0x152adf=_0x5930d6;var _0xb8b1bc=_['keys'](db[_0x9e15('0x62')][_0x9e15('0x37')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0x9e15('0x73')]})[_0x9e15('0x2f')](function(_0x236097){_0x4ce1c3=_0x236097;var _0x57b682=squel['select']()[_0x9e15('0x3f')](_0xb8b1bc)[_0x9e15('0x74')](_0x9e15('0x75'),'c')[_0x9e15('0x45')]('c.ListId\x20=\x20?',_0xe4166d)[_0x9e15('0x45')](_0x9e15('0x76'))['distinct']();for(var _0x1efc30=0x0;_0x1efc30<_0x4ce1c3[_0x9e15('0x41')];_0x1efc30++){_0x57b682[_0x9e15('0x77')](_0x9e15('0x78')+_0x4ce1c3[_0x1efc30]['id'],'customField_'+_0x4ce1c3[_0x1efc30]['alias']);}for(var _0x1efc30=0x0;_0x1efc30<_0x152adf[_0x9e15('0x41')];_0x1efc30++){_0x57b682[_0x9e15('0x77')](squel[_0x9e15('0x79')]()[_0x9e15('0x77')](_0x9e15('0x7a'))[_0x9e15('0x74')]('cm_contact_has_items')[_0x9e15('0x45')](_0x9e15('0x7b'),_0x152adf[_0x1efc30]['id'])['where'](_0x9e15('0x7c')),'additionalPhone_'+_0x152adf[_0x1efc30][_0x9e15('0x32')]);_0x57b682[_0x9e15('0x77')](squel[_0x9e15('0x79')]()[_0x9e15('0x77')]('description')[_0x9e15('0x74')](_0x9e15('0x7d'))[_0x9e15('0x45')](_0x9e15('0x7b'),_0x152adf[_0x1efc30]['id'])[_0x9e15('0x45')](_0x9e15('0x7c')),'description_additionalPhone_'+_0x152adf[_0x1efc30][_0x9e15('0x32')]);}var _0x4e7b6e=[];_0x4e7b6e[_0x9e15('0x66')](_0x57b682['toString']());BPromise[_0x9e15('0x67')](_0x4e7b6e,handleQuery)[_0x9e15('0x2f')](function(_0x1c14f4){handleQuery(_0x57b682[_0x9e15('0x7e')]());var _0x20efe8=csv_results[0x0];if(!_[_0x9e15('0x7f')](_0x20efe8)){var _0x1662be=toCsv(_0x20efe8);var _0x4390f1=Date[_0x9e15('0x80')]();fs[_0x9e15('0x81')](util[_0x9e15('0x6f')](_0x9e15('0x82'),_0xe4166d,_0x4390f1),_0x1662be);_0x12ee04[_0x9e15('0x83')]('Content-disposition',_0x9e15('0x84')+util[_0x9e15('0x6f')](_0x9e15('0x85'),_0xe4166d,_0x4390f1));_0x12ee04[_0x9e15('0x83')]('Content-type',_0x9e15('0x86'));return _0x12ee04[_0x9e15('0x87')](util[_0x9e15('0x6f')](_0x9e15('0x82'),_0xe4166d,_0x4390f1));}else{return _0x12ee04[_0x9e15('0x88')](0xcc);}});});});};exports[_0x9e15('0x89')]=function(_0x18ec08,_0x4714d3,_0x5b97bc){var _0x4df41a;delete _0x18ec08[_0x9e15('0x50')]['id'];return db[_0x9e15('0x36')]['findOne']({'where':{'id':_0x18ec08[_0x9e15('0x57')]['id']}})['then'](handleEntityNotFound(_0x4714d3,null))[_0x9e15('0x2f')](function(_0x283289){if(_0x283289){return db[_0x9e15('0x8a')]['transaction'](function(_0x2ac50b){return db['CmCustomField'][_0x9e15('0x4f')](_0x18ec08[_0x9e15('0x50')],{'transaction':_0x2ac50b})[_0x9e15('0x2f')](function(_0x4627db){_0x4df41a=_0x4627db;return _0x283289[_0x9e15('0x8b')](_0x4627db,{'transaction':_0x2ac50b});})[_0x9e15('0x2f')](function(){var _0x1480c8={'type':db['Sequelize']['TEXT'],'transaction':_0x2ac50b};switch(_0x18ec08[_0x9e15('0x50')][_0x9e15('0x47')]){case _0x9e15('0x8c'):_0x1480c8[_0x9e15('0x47')]=db[_0x9e15('0x8d')][_0x9e15('0x8e')];break;case'number':_0x1480c8['type']=db['Sequelize']['INTEGER'];break;case _0x9e15('0x8f'):_0x1480c8[_0x9e15('0x47')]=db[_0x9e15('0x8d')][_0x9e15('0x90')];_0x1480c8['defaultValue']=![];break;default:}return db[_0x9e15('0x8a')]['queryInterface'][_0x9e15('0x91')](_0x9e15('0x75'),util[_0x9e15('0x6f')](_0x9e15('0x92'),_0x4df41a['id']),_0x1480c8);})['then'](function(){return _0x4df41a;});});}})['then'](respondWithResult(_0x4714d3,null))['catch'](handleError(_0x4714d3,null));};exports[_0x9e15('0x93')]=function(_0x1188ff,_0x3f6af8,_0x40946d){var _0xdbc7eb={};var _0x5c0e6b={};var _0x5078ec;var _0x370aff;return db['CmList'][_0x9e15('0x94')]({'where':{'id':_0x1188ff[_0x9e15('0x57')]['id']}})['then'](handleEntityNotFound(_0x3f6af8,null))[_0x9e15('0x2f')](function(_0x343b71){if(_0x343b71){_0x5078ec=_0x343b71;_0x5c0e6b[_0x9e15('0x3a')]=_[_0x9e15('0x3b')](db[_0x9e15('0x6d')][_0x9e15('0x37')]);_0x5c0e6b[_0x9e15('0x3e')]=_[_0x9e15('0x3b')](_0x1188ff[_0x9e15('0x3e')]);_0x5c0e6b[_0x9e15('0x3c')]=_[_0x9e15('0x3d')](_0x5c0e6b[_0x9e15('0x3a')],_0x5c0e6b[_0x9e15('0x3e')]);_0xdbc7eb[_0x9e15('0x40')]=_['intersection'](_0x5c0e6b[_0x9e15('0x3a')],qs[_0x9e15('0x3f')](_0x1188ff[_0x9e15('0x3e')][_0x9e15('0x3f')]));_0xdbc7eb[_0x9e15('0x40')]=_0xdbc7eb[_0x9e15('0x40')]['length']?_0xdbc7eb[_0x9e15('0x40')]:_0x5c0e6b['model'];_0xdbc7eb[_0x9e15('0x43')]=qs[_0x9e15('0x44')](_0x1188ff[_0x9e15('0x3e')][_0x9e15('0x44')]);_0xdbc7eb[_0x9e15('0x45')]=qs[_0x9e15('0x3c')](_[_0x9e15('0x5d')](_0x1188ff[_0x9e15('0x3e')],_0x5c0e6b[_0x9e15('0x3c')]));_0xdbc7eb[_0x9e15('0x45')]=_[_0x9e15('0x46')](_0xdbc7eb[_0x9e15('0x45')],{'$or':[{'ListId':_0x343b71['id']},{'ListId':null}]});if(_0x1188ff[_0x9e15('0x3e')][_0x9e15('0x49')]){_0xdbc7eb[_0x9e15('0x45')]=_['merge'](_0xdbc7eb[_0x9e15('0x45')],{'$or':_[_0x9e15('0x35')](_0xdbc7eb[_0x9e15('0x40')],function(_0x46a64b){var _0x11ecf5={};_0x11ecf5[_0x46a64b]={'$like':'%'+_0x1188ff[_0x9e15('0x3e')][_0x9e15('0x49')]+'%'};return _0x11ecf5;})});}_0xdbc7eb=_[_0x9e15('0x46')]({},_0xdbc7eb,_0x1188ff[_0x9e15('0x4a')]);return db[_0x9e15('0x6d')]['findAndCountAll'](_0xdbc7eb);}})[_0x9e15('0x2f')](respondWithResult(_0x3f6af8,null))[_0x9e15('0x4d')](handleError(_0x3f6af8,null));};exports['getGlobalCustomFields']=function(_0x1d8353,_0xca3942){return db[_0x9e15('0x6d')][_0x9e15('0x95')]({'where':{'ListId':null}})[_0x9e15('0x2f')](handleEntityNotFound(_0xca3942,null))[_0x9e15('0x2f')](function(_0x7cae2a){return _0x7cae2a;})[_0x9e15('0x2f')](respondWithResult(_0xca3942,null))[_0x9e15('0x4d')](handleError(_0xca3942,null));};exports[_0x9e15('0x96')]=function(_0x10a6f9,_0x2bbce1,_0xf87567){return db[_0x9e15('0x36')]['find']({'where':{'id':_0x10a6f9[_0x9e15('0x57')]['id']}})[_0x9e15('0x2f')](handleEntityNotFound(_0x2bbce1,null))['then'](function(_0x562fd6){if(_0x562fd6){return _0x562fd6[_0x9e15('0x96')](_0x10a6f9['body'][_0x9e15('0x60')],_[_0x9e15('0x68')](_0x10a6f9[_0x9e15('0x50')],['ids','id'])||{})[_0x9e15('0x97')](function(_0x5b1ddd){for(var _0x1ab1a2=0x0;_0x1ab1a2<_0x10a6f9[_0x9e15('0x50')]['ids'][_0x9e15('0x41')];_0x1ab1a2+=0x1){socket[_0x9e15('0x98')](_0x9e15('0x99'),{'UserId':Number(_0x10a6f9['body'][_0x9e15('0x60')][_0x1ab1a2]),'CmListId':Number(_0x10a6f9['params']['id'])});}return _0x5b1ddd;});}})[_0x9e15('0x2f')](respondWithResult(_0x2bbce1,null))[_0x9e15('0x4d')](handleError(_0x2bbce1,null));};exports[_0x9e15('0x9a')]=function(_0x3adfd3,_0x1aaf89,_0x1c12eb){return db[_0x9e15('0x36')]['find']({'where':{'id':_0x3adfd3[_0x9e15('0x57')]['id']}})[_0x9e15('0x2f')](handleEntityNotFound(_0x1aaf89,null))[_0x9e15('0x2f')](function(_0x129dc8){if(_0x129dc8){return _0x129dc8[_0x9e15('0x9a')](_0x3adfd3[_0x9e15('0x3e')]['ids'])[_0x9e15('0x2f')](function(){if(_[_0x9e15('0x64')](_0x3adfd3['query'][_0x9e15('0x60')])){for(var _0x49831e=0x0;_0x49831e<_0x3adfd3[_0x9e15('0x3e')][_0x9e15('0x60')][_0x9e15('0x41')];_0x49831e+=0x1){socket[_0x9e15('0x98')](_0x9e15('0x9b'),{'UserId':Number(_0x3adfd3[_0x9e15('0x3e')][_0x9e15('0x60')][_0x49831e]),'CmListId':Number(_0x3adfd3[_0x9e15('0x57')]['id'])});}}else{socket[_0x9e15('0x98')](_0x9e15('0x9b'),{'UserId':Number(_0x3adfd3['query'][_0x9e15('0x60')]),'CmListId':Number(_0x3adfd3[_0x9e15('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x1aaf89,null))[_0x9e15('0x4d')](handleError(_0x1aaf89,null));};exports[_0x9e15('0x9c')]=function(_0x1f9933,_0xbbf8a5,_0x380012){var _0x404060={};var _0x1ea3be={};var _0x4605ab;var _0x3df759;return db[_0x9e15('0x36')]['findOne']({'where':{'id':_0x1f9933[_0x9e15('0x57')]['id']}})[_0x9e15('0x2f')](handleEntityNotFound(_0xbbf8a5,null))['then'](function(_0x5ef90a){if(_0x5ef90a){_0x4605ab=_0x5ef90a;_0x1ea3be[_0x9e15('0x3a')]=_[_0x9e15('0x3b')](db['User']['rawAttributes']);_0x1ea3be[_0x9e15('0x3e')]=_['keys'](_0x1f9933['query']);_0x1ea3be[_0x9e15('0x3c')]=_[_0x9e15('0x3d')](_0x1ea3be[_0x9e15('0x3a')],_0x1ea3be[_0x9e15('0x3e')]);_0x404060[_0x9e15('0x40')]=_['intersection'](_0x1ea3be[_0x9e15('0x3a')],qs[_0x9e15('0x3f')](_0x1f9933[_0x9e15('0x3e')][_0x9e15('0x3f')]));_0x404060[_0x9e15('0x40')]=_0x404060[_0x9e15('0x40')][_0x9e15('0x41')]?_0x404060[_0x9e15('0x40')]:_0x1ea3be['model'];_0x404060[_0x9e15('0x43')]=qs[_0x9e15('0x44')](_0x1f9933[_0x9e15('0x3e')][_0x9e15('0x44')]);_0x404060[_0x9e15('0x45')]=qs[_0x9e15('0x3c')](_['pick'](_0x1f9933[_0x9e15('0x3e')],_0x1ea3be[_0x9e15('0x3c')]));if(_0x1f9933[_0x9e15('0x3e')]['filter']){_0x404060[_0x9e15('0x45')]=_[_0x9e15('0x46')](_0x404060['where'],{'$or':_[_0x9e15('0x35')](_0x404060[_0x9e15('0x40')],function(_0x1d92ba){var _0x340255={};_0x340255[_0x1d92ba]={'$like':'%'+_0x1f9933[_0x9e15('0x3e')][_0x9e15('0x49')]+'%'};return _0x340255;})});}_0x404060=_['merge']({},_0x404060,_0x1f9933['options']);return _0x4605ab[_0x9e15('0x9c')](_0x404060);}})[_0x9e15('0x2f')](function(_0x33ce97){if(_0x33ce97){_0x3df759=_0x33ce97['length'];if(!_0x1f9933[_0x9e15('0x3e')][_0x9e15('0x5c')]('nolimit')){_0x404060[_0x9e15('0x24')]=qs['limit'](_0x1f9933[_0x9e15('0x3e')][_0x9e15('0x24')]);_0x404060[_0x9e15('0x22')]=qs[_0x9e15('0x22')](_0x1f9933['query'][_0x9e15('0x22')]);}return _0x4605ab['getAgents'](_0x404060);}})[_0x9e15('0x2f')](function(_0x5d87c1){if(_0x5d87c1){return _0x5d87c1?{'count':_0x3df759,'rows':_0x5d87c1}:null;}})[_0x9e15('0x2f')](respondWithResult(_0xbbf8a5,null))[_0x9e15('0x4d')](handleError(_0xbbf8a5,null));};function handleQuery(_0x299c3b){logger[_0x9e15('0x9d')](_0x299c3b);return db[_0x9e15('0x8a')][_0x9e15('0x3e')](_0x299c3b)[_0x9e15('0x97')](function(_0x58239f){csv_results['push'](_0x58239f);})[_0x9e15('0x4d')](function(_0x1e9215){logger['error'](_0x1e9215[_0x9e15('0x9e')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index b8a0a71..f86e7ca 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x12dc03,_0x3accb8){var _0x46bc57=function(_0x4f4118){while(--_0x4f4118){_0x12dc03['push'](_0x12dc03['shift']());}};_0x46bc57(++_0x3accb8);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x301cfe,_0x2f66e6){_0x301cfe=_0x301cfe-0x0;var _0x3cfb64=_0x3e74[_0x301cfe];return _0x3cfb64;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 26e6fd9..80b63c7 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','../../config/logger','api'];(function(_0x2c1ced,_0x400403){var _0x1b13b0=function(_0xa52a8d){while(--_0xa52a8d){_0x2c1ced['push'](_0x2c1ced['shift']());}};_0x1b13b0(++_0x400403);}(_0x1339,0x1ed));var _0x9133=function(_0x201086,_0x42d3c8){_0x201086=_0x201086-0x0;var _0x24fbd1=_0x1339[_0x201086];return _0x24fbd1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./cmList.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x668b=['cm_lists','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./cmList.attributes','define','CmList'];(function(_0x28294a,_0x542642){var _0x3bef7d=function(_0x2229f4){while(--_0x2229f4){_0x28294a['push'](_0x28294a['shift']());}};_0x3bef7d(++_0x542642);}(_0x668b,0x140));var _0xb668=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x668b[_0x3f1710];return _0x528458;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));module['exports']=function(_0x9b99a8,_0x296fa9){return _0x9b99a8[_0xb668('0x8')](_0xb668('0x9'),attributes,{'tableName':_0xb668('0xa'),'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 eef8ed1..cbe4e9a 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 _0x9581=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x4d7df6,_0x3f6139){var _0x4c0d29=function(_0x12ae02){while(--_0x12ae02){_0x4d7df6['push'](_0x4d7df6['shift']());}};_0x4c0d29(++_0x3f6139);}(_0x9581,0xef));var _0x1958=function(_0x25be10,_0x59ecda){_0x25be10=_0x25be10-0x0;var _0x12a4b0=_0x9581[_0x25be10];return _0x12a4b0;};'use strict';var _=require(_0x1958('0x0'));var util=require(_0x1958('0x1'));var moment=require(_0x1958('0x2'));var BPromise=require('bluebird');var rs=require(_0x1958('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1958('0x4'))['db'];var utils=require(_0x1958('0x5'));var logger=require('../../config/logger')(_0x1958('0x6'));var config=require('../../config/environment');var jayson=require(_0x1958('0x7'));var client=jayson[_0x1958('0x8')][_0x1958('0x9')]({'port':0x232a});config['redis']=_[_0x1958('0xa')](config[_0x1958('0xb')],{'host':_0x1958('0xc'),'port':0x18eb});var socket=require(_0x1958('0xd'))(new Redis(config[_0x1958('0xb')]));require(_0x1958('0xe'))[_0x1958('0xf')](socket);function respondWithRpcPromise(_0xfd0093,_0xd98333,_0x4a7f6b){return new BPromise(function(_0x54796c,_0xb854ca){return client[_0x1958('0x10')](_0xfd0093,_0x4a7f6b)[_0x1958('0x11')](function(_0x48a558){logger['info'](_0x1958('0x12'),_0xd98333,_0x1958('0x13'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0xd98333,_0x1958('0x13'),JSON[_0x1958('0x14')](_0x48a558));if(_0x48a558[_0x1958('0x15')]){if(_0x48a558[_0x1958('0x15')][_0x1958('0x16')]===0x1f4){logger[_0x1958('0x15')](_0x1958('0x12'),_0xd98333,_0x48a558[_0x1958('0x15')][_0x1958('0x17')]);return _0xb854ca(_0x48a558[_0x1958('0x15')]['message']);}logger[_0x1958('0x15')]('CmList,\x20%s,\x20%s',_0xd98333,_0x48a558['error'][_0x1958('0x17')]);return _0x54796c(_0x48a558['error'][_0x1958('0x17')]);}else{logger[_0x1958('0x18')](_0x1958('0x12'),_0xd98333,'request\x20sent');_0x54796c(_0x48a558[_0x1958('0x19')][_0x1958('0x17')]);}})[_0x1958('0x1a')](function(_0x4644f4){logger[_0x1958('0x15')](_0x1958('0x12'),_0xd98333,_0x4644f4);_0xb854ca(_0x4644f4);});});} \ No newline at end of file +var _0x5a0b=['stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x2d5cfe,_0x16ac83){var _0x4a9308=function(_0x344dee){while(--_0x344dee){_0x2d5cfe['push'](_0x2d5cfe['shift']());}};_0x4a9308(++_0x16ac83);}(_0x5a0b,0x171));var _0xb5a0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a0b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb5a0('0x0'));var util=require(_0xb5a0('0x1'));var moment=require(_0xb5a0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5a0('0x3'));var db=require(_0xb5a0('0x4'))['db'];var utils=require(_0xb5a0('0x5'));var logger=require(_0xb5a0('0x6'))(_0xb5a0('0x7'));var config=require(_0xb5a0('0x8'));var jayson=require(_0xb5a0('0x9'));var client=jayson['client'][_0xb5a0('0xa')]({'port':0x232a});config['redis']=_[_0xb5a0('0xb')](config[_0xb5a0('0xc')],{'host':_0xb5a0('0xd'),'port':0x18eb});var socket=require(_0xb5a0('0xe'))(new Redis(config['redis']));require('./cmList.socket')[_0xb5a0('0xf')](socket);function respondWithRpcPromise(_0x2700ac,_0x2a3832,_0x3ff8e9){return new BPromise(function(_0x1b0622,_0x47183f){return client[_0xb5a0('0x10')](_0x2700ac,_0x3ff8e9)[_0xb5a0('0x11')](function(_0x433b68){logger[_0xb5a0('0x12')](_0xb5a0('0x13'),_0x2a3832,_0xb5a0('0x14'));logger[_0xb5a0('0x15')](_0xb5a0('0x16'),_0x2a3832,_0xb5a0('0x14'),JSON[_0xb5a0('0x17')](_0x433b68));if(_0x433b68['error']){if(_0x433b68[_0xb5a0('0x18')]['code']===0x1f4){logger[_0xb5a0('0x18')](_0xb5a0('0x13'),_0x2a3832,_0x433b68[_0xb5a0('0x18')][_0xb5a0('0x19')]);return _0x47183f(_0x433b68[_0xb5a0('0x18')][_0xb5a0('0x19')]);}logger['error'](_0xb5a0('0x13'),_0x2a3832,_0x433b68[_0xb5a0('0x18')]['message']);return _0x1b0622(_0x433b68[_0xb5a0('0x18')][_0xb5a0('0x19')]);}else{logger[_0xb5a0('0x12')](_0xb5a0('0x13'),_0x2a3832,_0xb5a0('0x14'));_0x1b0622(_0x433b68[_0xb5a0('0x1a')][_0xb5a0('0x19')]);}})[_0xb5a0('0x1b')](function(_0x5428d7){logger['error'](_0xb5a0('0x13'),_0x2a3832,_0x5428d7);_0x47183f(_0x5428d7);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 06b1f9b..b8b247c 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 _0x7da8=['./cmList.events','save','remove','removeListener','register','cmList:'];(function(_0x40029c,_0x3f1765){var _0x31fd78=function(_0x27d18c){while(--_0x27d18c){_0x40029c['push'](_0x40029c['shift']());}};_0x31fd78(++_0x3f1765);}(_0x7da8,0x150));var _0x87da=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7da8[_0x6131cd];return _0x47e916;};'use strict';var CmListEvents=require(_0x87da('0x0'));var events=[_0x87da('0x1'),_0x87da('0x2'),'update'];function createListener(_0x282fc2,_0x5c36d9){return function(_0x4596ae){_0x5c36d9['emit'](_0x282fc2,_0x4596ae);};}function removeListener(_0x4b3db1,_0x22a5f7){return function(){CmListEvents[_0x87da('0x3')](_0x4b3db1,_0x22a5f7);};}exports[_0x87da('0x4')]=function(_0x65bc61){for(var _0x434709=0x0,_0x4bd391=events['length'];_0x434709<_0x4bd391;_0x434709++){var _0x2384d3=events[_0x434709];var _0x1a2f72=createListener(_0x87da('0x5')+_0x2384d3,_0x65bc61);CmListEvents['on'](_0x2384d3,_0x1a2f72);}}; \ No newline at end of file +var _0xfa85=['removeListener','register','length','cmList:','./cmList.events','update','emit'];(function(_0x222fd0,_0x1de665){var _0x1e7b79=function(_0x5d6d48){while(--_0x5d6d48){_0x222fd0['push'](_0x222fd0['shift']());}};_0x1e7b79(++_0x1de665);}(_0xfa85,0x138));var _0x5fa8=function(_0x1d5072,_0x2e9794){_0x1d5072=_0x1d5072-0x0;var _0x247bb4=_0xfa85[_0x1d5072];return _0x247bb4;};'use strict';var CmListEvents=require(_0x5fa8('0x0'));var events=['save','remove',_0x5fa8('0x1')];function createListener(_0x159ec9,_0x333e3a){return function(_0x28a765){_0x333e3a[_0x5fa8('0x2')](_0x159ec9,_0x28a765);};}function removeListener(_0x47b4fd,_0x5c1edd){return function(){CmListEvents[_0x5fa8('0x3')](_0x47b4fd,_0x5c1edd);};}exports[_0x5fa8('0x4')]=function(_0x1fa030){for(var _0x4ee467=0x0,_0x4d6276=events[_0x5fa8('0x5')];_0x4ee467<_0x4d6276;_0x4ee467++){var _0x3f1e4f=events[_0x4ee467];var _0xaec6bb=createListener(_0x5fa8('0x6')+_0x3f1e4f,_0x1fa030);CmListEvents['on'](_0x3f1e4f,_0xaec6bb);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0a3965e..f8bca96 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 _0x2874=['/:id','/:id/dispositions','getContacts','/:id/contacts/csv','getContactsCsv','getAgents','post','create','/:id/fields','addCustomField','/:id/users','addAgents','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields'];(function(_0x1bfbdb,_0x34ad2b){var _0x7a6811=function(_0x5960f8){while(--_0x5960f8){_0x1bfbdb['push'](_0x1bfbdb['shift']());}};_0x7a6811(++_0x34ad2b);}(_0x2874,0x150));var _0x4287=function(_0x2a5042,_0x307d04){_0x2a5042=_0x2a5042-0x0;var _0x4bc22f=_0x2874[_0x2a5042];return _0x4bc22f;};'use strict';var multer=require(_0x4287('0x0'));var util=require(_0x4287('0x1'));var path=require(_0x4287('0x2'));var timeout=require(_0x4287('0x3'));var express=require(_0x4287('0x4'));var router=express[_0x4287('0x5')]();var fs_extra=require(_0x4287('0x6'));var auth=require(_0x4287('0x7'));var interaction=require(_0x4287('0x8'));var config=require('../../config/environment');var controller=require(_0x4287('0x9'));router[_0x4287('0xa')]('/',auth[_0x4287('0xb')](),controller[_0x4287('0xc')]);router[_0x4287('0xa')](_0x4287('0xd'),auth[_0x4287('0xb')](),controller[_0x4287('0xe')]);router[_0x4287('0xa')](_0x4287('0xf'),auth[_0x4287('0xb')](),controller['getGlobalCustomFields']);router[_0x4287('0xa')](_0x4287('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x4287('0xa')](_0x4287('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x4287('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x4287('0x12')]);router[_0x4287('0xa')](_0x4287('0x13'),auth['isAuthenticated'](),controller[_0x4287('0x14')]);router['get']('/:id/fields',auth[_0x4287('0xb')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x4287('0xb')](),controller[_0x4287('0x15')]);router[_0x4287('0x16')]('/',auth['isAuthenticated'](),controller[_0x4287('0x17')]);router[_0x4287('0x16')]('/:id/dispositions',auth[_0x4287('0xb')](),controller['addDisposition']);router['post']('/:id/contacts',auth[_0x4287('0xb')](),controller['addContacts']);router[_0x4287('0x16')](_0x4287('0x18'),auth['isAuthenticated'](),controller[_0x4287('0x19')]);router[_0x4287('0x16')](_0x4287('0x1a'),auth[_0x4287('0xb')](),controller[_0x4287('0x1b')]);router['put'](_0x4287('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4287('0x10'),auth[_0x4287('0xb')](),controller[_0x4287('0x1c')]);router['delete'](_0x4287('0x11'),auth[_0x4287('0xb')](),controller['removeDispositions']);router[_0x4287('0x1d')]('/:id/users',auth[_0x4287('0xb')](),controller[_0x4287('0x1e')]);module[_0x4287('0x1f')]=router; \ No newline at end of file +var _0x2507=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','/global_fields','getGlobalCustomFields','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts','addAgents','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x2507,0x6f));var _0x7250=function(_0x4643f5,_0x40ebc4){_0x4643f5=_0x4643f5-0x0;var _0x119b65=_0x2507[_0x4643f5];return _0x119b65;};'use strict';var multer=require(_0x7250('0x0'));var util=require(_0x7250('0x1'));var path=require(_0x7250('0x2'));var timeout=require(_0x7250('0x3'));var express=require(_0x7250('0x4'));var router=express[_0x7250('0x5')]();var fs_extra=require(_0x7250('0x6'));var auth=require(_0x7250('0x7'));var interaction=require(_0x7250('0x8'));var config=require(_0x7250('0x9'));var controller=require(_0x7250('0xa'));router[_0x7250('0xb')]('/',auth[_0x7250('0xc')](),controller[_0x7250('0xd')]);router[_0x7250('0xb')](_0x7250('0xe'),auth[_0x7250('0xc')](),controller['describe']);router[_0x7250('0xb')](_0x7250('0xf'),auth[_0x7250('0xc')](),controller[_0x7250('0x10')]);router[_0x7250('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth[_0x7250('0xc')](),controller[_0x7250('0x11')]);router['get'](_0x7250('0x12'),auth[_0x7250('0xc')](),controller[_0x7250('0x13')]);router[_0x7250('0xb')](_0x7250('0x14'),auth[_0x7250('0xc')](),controller[_0x7250('0x15')]);router[_0x7250('0xb')](_0x7250('0x16'),auth[_0x7250('0xc')](),controller[_0x7250('0x17')]);router['get'](_0x7250('0x18'),auth[_0x7250('0xc')](),controller['getAgents']);router[_0x7250('0x19')]('/',auth['isAuthenticated'](),controller[_0x7250('0x1a')]);router['post'](_0x7250('0x1b'),auth[_0x7250('0xc')](),controller[_0x7250('0x1c')]);router[_0x7250('0x19')](_0x7250('0x12'),auth[_0x7250('0xc')](),controller[_0x7250('0x1d')]);router[_0x7250('0x19')](_0x7250('0x16'),auth[_0x7250('0xc')](),controller['addCustomField']);router['post'](_0x7250('0x18'),auth[_0x7250('0xc')](),controller[_0x7250('0x1e')]);router['put'](_0x7250('0x1f'),auth['isAuthenticated'](),controller[_0x7250('0x20')]);router[_0x7250('0x21')](_0x7250('0x1f'),auth['isAuthenticated'](),controller[_0x7250('0x22')]);router[_0x7250('0x21')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7250('0x23')]);router['delete'](_0x7250('0x18'),auth['isAuthenticated'](),controller[_0x7250('0x24')]);module[_0x7250('0x25')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d55307d..df5d514 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 _0xe60a=['STRING','sequelize','exports','getDataValue','field'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0xe60a,0x1a5));var _0xae60=function(_0x8d3446,_0x2cadaf){_0x8d3446=_0x8d3446-0x0;var _0x5650f3=_0xe60a[_0x8d3446];return _0x5650f3;};'use strict';var Sequelize=require(_0xae60('0x0'));module[_0xae60('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f7075){return this[_0xae60('0x2')](_0xae60('0x3'));}},'field':{'type':Sequelize[_0xae60('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xae60('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xae60('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x59a1=['field','STRING','sequelize','VIRTUAL','getDataValue'];(function(_0x10b885,_0x5a084a){var _0x25252a=function(_0x590966){while(--_0x590966){_0x10b885['push'](_0x10b885['shift']());}};_0x25252a(++_0x5a084a);}(_0x59a1,0xf2));var _0x159a=function(_0x19c942,_0xca9e44){_0x19c942=_0x19c942-0x0;var _0x4bf20e=_0x59a1[_0x19c942];return _0x4bf20e;};'use strict';var Sequelize=require(_0x159a('0x0'));module['exports']={'name':{'type':Sequelize[_0x159a('0x1')],'get':function(_0x3ba55f){return this[_0x159a('0x2')](_0x159a('0x3'));}},'field':{'type':Sequelize[_0x159a('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x159a('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x159a('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index c585127..8e1b88c 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(_0x208941,_0x27743a){var _0x491a5d=function(_0xe52ebc){while(--_0xe52ebc){_0x208941['push'](_0x208941['shift']());}};_0x491a5d(++_0x27743a);}(_0x7a54,0x106));var _0x47a5=function(_0x407ebe,_0x2e3737){_0x407ebe=_0x407ebe-0x0;var _0x22bdf7=_0x7a54[_0x407ebe];return _0x22bdf7;};'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(_0x3b4f94,_0x3a6110){var _0x39a640=function(_0x33da0b){while(--_0x33da0b){_0x3b4f94['push'](_0x3b4f94['shift']());}};_0x39a640(++_0x3a6110);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 00b1f88..b96dc8c 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 _0xceb7=['../../config/environment','exports','define','Condition','tools_conditions','lodash','api','moment','bluebird','path'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xceb7,0x1a9));var _0x7ceb=function(_0x3033b9,_0x56adf4){_0x3033b9=_0x3033b9-0x0;var _0x293f8b=_0xceb7[_0x3033b9];return _0x293f8b;};'use strict';var _=require(_0x7ceb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7ceb('0x1'));var moment=require(_0x7ceb('0x2'));var BPromise=require(_0x7ceb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ceb('0x4'));var rimraf=require('rimraf');var config=require(_0x7ceb('0x5'));var attributes=require('./condition.attributes');module[_0x7ceb('0x6')]=function(_0x44e64d,_0x48325b){return _0x44e64d[_0x7ceb('0x7')](_0x7ceb('0x8'),attributes,{'tableName':_0x7ceb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97a6=['api','bluebird','rimraf','../../config/environment','./condition.attributes','Condition','tools_conditions','lodash','../../config/logger'];(function(_0x30fd15,_0x4a9055){var _0x2c9d55=function(_0x50d863){while(--_0x50d863){_0x30fd15['push'](_0x30fd15['shift']());}};_0x2c9d55(++_0x4a9055);}(_0x97a6,0x1c9));var _0x697a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97a6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x697a('0x0'));var util=require('util');var logger=require(_0x697a('0x1'))(_0x697a('0x2'));var moment=require('moment');var BPromise=require(_0x697a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x697a('0x4'));var config=require(_0x697a('0x5'));var attributes=require(_0x697a('0x6'));module['exports']=function(_0x49bf5a,_0x3ababe){return _0x49bf5a['define'](_0x697a('0x7'),attributes,{'tableName':_0x697a('0x8'),'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 8f8c3e0..d6d77fa 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 _0xd710=['then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x40e13e,_0x376d13){var _0x5db39e=function(_0x2dc3f6){while(--_0x2dc3f6){_0x40e13e['push'](_0x40e13e['shift']());}};_0x5db39e(++_0x376d13);}(_0xd710,0xd4));var _0x0d71=function(_0x27e6ce,_0x179ae4){_0x27e6ce=_0x27e6ce-0x0;var _0x310a3f=_0xd710[_0x27e6ce];return _0x310a3f;};'use strict';var _=require(_0x0d71('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0d71('0x1'));var rs=require(_0x0d71('0x2'));var fs=require('fs');var Redis=require(_0x0d71('0x3'));var db=require(_0x0d71('0x4'))['db'];var utils=require(_0x0d71('0x5'));var logger=require(_0x0d71('0x6'))(_0x0d71('0x7'));var config=require(_0x0d71('0x8'));var jayson=require(_0x0d71('0x9'));var client=jayson[_0x0d71('0xa')][_0x0d71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55ddce,_0x59d09e,_0x2e0d85){return new BPromise(function(_0x5d799a,_0x408848){return client[_0x0d71('0xc')](_0x55ddce,_0x2e0d85)[_0x0d71('0xd')](function(_0x12ccfa){logger[_0x0d71('0xe')]('Condition,\x20%s,\x20%s',_0x59d09e,_0x0d71('0xf'));logger[_0x0d71('0x10')](_0x0d71('0x11'),_0x59d09e,'request\x20sent',JSON[_0x0d71('0x12')](_0x12ccfa));if(_0x12ccfa[_0x0d71('0x13')]){if(_0x12ccfa[_0x0d71('0x13')][_0x0d71('0x14')]===0x1f4){logger[_0x0d71('0x13')](_0x0d71('0x15'),_0x59d09e,_0x12ccfa['error'][_0x0d71('0x16')]);return _0x408848(_0x12ccfa[_0x0d71('0x13')][_0x0d71('0x16')]);}logger[_0x0d71('0x13')]('Condition,\x20%s,\x20%s',_0x59d09e,_0x12ccfa[_0x0d71('0x13')][_0x0d71('0x16')]);return _0x5d799a(_0x12ccfa[_0x0d71('0x13')][_0x0d71('0x16')]);}else{logger[_0x0d71('0xe')](_0x0d71('0x15'),_0x59d09e,'request\x20sent');_0x5d799a(_0x12ccfa[_0x0d71('0x17')][_0x0d71('0x16')]);}})[_0x0d71('0x18')](function(_0x3e28d7){logger[_0x0d71('0x13')](_0x0d71('0x15'),_0x59d09e,_0x3e28d7);_0x408848(_0x3e28d7);});});} \ No newline at end of file +var _0xc2b3=['Condition,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x11ab05,_0x547532){var _0x20be84=function(_0x246b18){while(--_0x246b18){_0x11ab05['push'](_0x11ab05['shift']());}};_0x20be84(++_0x547532);}(_0xc2b3,0x17e));var _0x3c2b=function(_0x3d40a1,_0x38b36d){_0x3d40a1=_0x3d40a1-0x0;var _0x68c2ea=_0xc2b3[_0x3d40a1];return _0x68c2ea;};'use strict';var _=require(_0x3c2b('0x0'));var util=require(_0x3c2b('0x1'));var moment=require(_0x3c2b('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c2b('0x3'));var fs=require('fs');var Redis=require(_0x3c2b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c2b('0x5'));var logger=require(_0x3c2b('0x6'))(_0x3c2b('0x7'));var config=require(_0x3c2b('0x8'));var jayson=require(_0x3c2b('0x9'));var client=jayson[_0x3c2b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1c2a,_0x344674,_0x3482a9){return new BPromise(function(_0x16cfa6,_0x41e6bd){return client[_0x3c2b('0xb')](_0x3b1c2a,_0x3482a9)[_0x3c2b('0xc')](function(_0x59aaf9){logger[_0x3c2b('0xd')]('Condition,\x20%s,\x20%s',_0x344674,'request\x20sent');logger['debug'](_0x3c2b('0xe'),_0x344674,_0x3c2b('0xf'),JSON['stringify'](_0x59aaf9));if(_0x59aaf9['error']){if(_0x59aaf9['error']['code']===0x1f4){logger[_0x3c2b('0x10')]('Condition,\x20%s,\x20%s',_0x344674,_0x59aaf9[_0x3c2b('0x10')][_0x3c2b('0x11')]);return _0x41e6bd(_0x59aaf9[_0x3c2b('0x10')][_0x3c2b('0x11')]);}logger[_0x3c2b('0x10')](_0x3c2b('0x12'),_0x344674,_0x59aaf9['error'][_0x3c2b('0x11')]);return _0x16cfa6(_0x59aaf9['error'][_0x3c2b('0x11')]);}else{logger[_0x3c2b('0xd')]('Condition,\x20%s,\x20%s',_0x344674,_0x3c2b('0xf'));_0x16cfa6(_0x59aaf9['result'][_0x3c2b('0x11')]);}})[_0x3c2b('0x13')](function(_0x32bddd){logger['error'](_0x3c2b('0x12'),_0x344674,_0x32bddd);_0x41e6bd(_0x32bddd);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index b562933..d58167a 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 _0x2f80=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','update','isAuthenticated'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x2f80,0x1f2));var _0x02f8=function(_0x489bc1,_0x31584a){_0x489bc1=_0x489bc1-0x0;var _0x46b045=_0x2f80[_0x489bc1];return _0x46b045;};'use strict';var multer=require(_0x02f8('0x0'));var util=require(_0x02f8('0x1'));var path=require(_0x02f8('0x2'));var timeout=require(_0x02f8('0x3'));var express=require(_0x02f8('0x4'));var router=express[_0x02f8('0x5')]();var fs_extra=require(_0x02f8('0x6'));var auth=require(_0x02f8('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x02f8('0x8'));var controller=require(_0x02f8('0x9'));router[_0x02f8('0xa')](_0x02f8('0xb'),auth['isAuthenticated'](),controller[_0x02f8('0xc')]);router['delete']('/:id',auth[_0x02f8('0xd')](),controller[_0x02f8('0xe')]);module[_0x02f8('0xf')]=router; \ No newline at end of file +var _0x567d=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','update','delete','isAuthenticated','destroy','multer','util'];(function(_0x4f9817,_0x245cd0){var _0x5e5f43=function(_0x22f41c){while(--_0x22f41c){_0x4f9817['push'](_0x4f9817['shift']());}};_0x5e5f43(++_0x245cd0);}(_0x567d,0xa3));var _0xd567=function(_0x2d5146,_0x5a64b5){_0x2d5146=_0x2d5146-0x0;var _0x4326ca=_0x567d[_0x2d5146];return _0x4326ca;};'use strict';var multer=require(_0xd567('0x0'));var util=require(_0xd567('0x1'));var path=require(_0xd567('0x2'));var timeout=require('connect-timeout');var express=require(_0xd567('0x3'));var router=express[_0xd567('0x4')]();var fs_extra=require(_0xd567('0x5'));var auth=require(_0xd567('0x6'));var interaction=require(_0xd567('0x7'));var config=require(_0xd567('0x8'));var controller=require(_0xd567('0x9'));router['put'](_0xd567('0xa'),auth['isAuthenticated'](),controller[_0xd567('0xb')]);router[_0xd567('0xc')]('/:id',auth[_0xd567('0xd')](),controller[_0xd567('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index d59656f..431597b 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f15=['exports','INTEGER','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x1f15,0xe6));var _0x51f1=function(_0x60deb6,_0x1e9225){_0x60deb6=_0x60deb6-0x0;var _0x4df963=_0x1f15[_0x60deb6];return _0x4df963;};'use strict';var Sequelize=require(_0x51f1('0x0'));module[_0x51f1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x51f1('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x51d8=['STRING','INTEGER','sequelize','exports'];(function(_0x5e3fbd,_0x521cb2){var _0x172b57=function(_0x326e0d){while(--_0x326e0d){_0x5e3fbd['push'](_0x5e3fbd['shift']());}};_0x172b57(++_0x521cb2);}(_0x51d8,0x6e));var _0x851d=function(_0xbdb51e,_0x1c7769){_0xbdb51e=_0xbdb51e-0x0;var _0x2c0494=_0x51d8[_0xbdb51e];return _0x2c0494;};'use strict';var Sequelize=require(_0x851d('0x0'));module[_0x851d('0x1')]={'name':{'type':Sequelize[_0x851d('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x851d('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x851d('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 6d534be..4a3b099 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcbb=['find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','index','map','ContactItemType','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes'];(function(_0x23bbe8,_0x4d5924){var _0x4b6111=function(_0x4786c3){while(--_0x4786c3){_0x23bbe8['push'](_0x23bbe8['shift']());}};_0x4b6111(++_0x4d5924);}(_0xfcbb,0x10d));var _0xbfcb=function(_0xc7b21e,_0xdf536f){_0xc7b21e=_0xc7b21e-0x0;var _0x6c013=_0xfcbb[_0xc7b21e];return _0x6c013;};'use strict';var emlformat=require(_0xbfcb('0x0'));var rimraf=require(_0xbfcb('0x1'));var zipdir=require(_0xbfcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbfcb('0x3'));var BPromise=require(_0xbfcb('0x4'));var Mustache=require(_0xbfcb('0x5'));var util=require(_0xbfcb('0x6'));var path=require(_0xbfcb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbfcb('0x8'));var fs=require('fs');var fs_extra=require(_0xbfcb('0x9'));var _=require(_0xbfcb('0xa'));var squel=require(_0xbfcb('0xb'));var crypto=require(_0xbfcb('0xc'));var jsforce=require(_0xbfcb('0xd'));var deskjs=require(_0xbfcb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbfcb('0xf'));var Papa=require(_0xbfcb('0x10'));var Redis=require(_0xbfcb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfcb('0x12'));var as=require(_0xbfcb('0x13'));var hardwareService=require(_0xbfcb('0x14'));var logger=require(_0xbfcb('0x15'))(_0xbfcb('0x16'));var utils=require(_0xbfcb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbfcb('0x18'));var db=require(_0xbfcb('0x19'))['db'];function respondWithStatusCode(_0xb2f601,_0x2268da){_0x2268da=_0x2268da||0xcc;return function(_0x4ba4f1){if(_0x4ba4f1){return _0xb2f601[_0xbfcb('0x1a')](_0x2268da);}return _0xb2f601['status'](_0x2268da)[_0xbfcb('0x1b')]();};}function respondWithResult(_0x1c52df,_0x44ad6c){_0x44ad6c=_0x44ad6c||0xc8;return function(_0x1047c4){if(_0x1047c4){return _0x1c52df[_0xbfcb('0x1c')](_0x44ad6c)[_0xbfcb('0x1d')](_0x1047c4);}};}function respondWithFilteredResult(_0x71304e,_0x2d314a){return function(_0x90ed8c){if(_0x90ed8c){var _0x339347=typeof _0x2d314a[_0xbfcb('0x1e')]===_0xbfcb('0x1f')&&typeof _0x2d314a[_0xbfcb('0x20')]===_0xbfcb('0x1f');var _0x318d07=_0x90ed8c[_0xbfcb('0x21')];var _0xba1d6=_0x339347?0x0:_0x2d314a[_0xbfcb('0x1e')];var _0x3404aa=_0x339347?_0x90ed8c[_0xbfcb('0x21')]:_0x2d314a[_0xbfcb('0x1e')]+_0x2d314a[_0xbfcb('0x20')];var _0x53c9e0;if(_0x3404aa>=_0x318d07){_0x3404aa=_0x318d07;_0x53c9e0=0xc8;}else{_0x53c9e0=0xce;}_0x71304e[_0xbfcb('0x1c')](_0x53c9e0);return _0x71304e[_0xbfcb('0x22')]('Content-Range',_0xba1d6+'-'+_0x3404aa+'/'+_0x318d07)[_0xbfcb('0x1d')](_0x90ed8c);}return null;};}function patchUpdates(_0x1a7225){return function(_0x48c3c8){try{jsonpatch['apply'](_0x48c3c8,_0x1a7225,!![]);}catch(_0x4199c5){return BPromise[_0xbfcb('0x23')](_0x4199c5);}return _0x48c3c8[_0xbfcb('0x24')]();};}function saveUpdates(_0x45661a,_0x1c5924){return function(_0x56c158){if(_0x56c158){return _0x56c158[_0xbfcb('0x25')](_0x45661a)[_0xbfcb('0x26')](function(_0x2d9288){return _0x2d9288;});}return null;};}function removeEntity(_0xd4d29,_0x1651e5){return function(_0x19616c){if(_0x19616c){return _0x19616c[_0xbfcb('0x27')]()[_0xbfcb('0x26')](function(){var _0x11f6f7=_0x19616c[_0xbfcb('0x28')]({'plain':!![]});var _0x1ca8c3=_0xbfcb('0x29');return db[_0xbfcb('0x2a')][_0xbfcb('0x27')]({'where':{'type':_0x1ca8c3,'resourceId':_0x11f6f7['id']}})[_0xbfcb('0x26')](function(){return _0x19616c;});})[_0xbfcb('0x26')](function(){_0xd4d29['status'](0xcc)[_0xbfcb('0x1b')]();});}};}function handleEntityNotFound(_0x2881f8,_0x4cf7ca){return function(_0x64a69){if(!_0x64a69){_0x2881f8[_0xbfcb('0x1a')](0x194);}return _0x64a69;};}function handleError(_0x781773,_0xa57d71){_0xa57d71=_0xa57d71||0x1f4;return function(_0xf4b944){logger[_0xbfcb('0x2b')](_0xf4b944[_0xbfcb('0x2c')]);if(_0xf4b944[_0xbfcb('0x2d')]){delete _0xf4b944[_0xbfcb('0x2d')];}_0x781773[_0xbfcb('0x1c')](_0xa57d71)['send'](_0xf4b944);};}exports[_0xbfcb('0x2e')]=function(_0x3aa3cd,_0x43c3c3){var _0x43de3c={},_0x1f45fc={},_0x14f6f5={'count':0x0,'rows':[]};var _0x286fb7=_[_0xbfcb('0x2f')](db[_0xbfcb('0x30')]['rawAttributes'],function(_0x297f72){return{'name':_0x297f72[_0xbfcb('0x31')],'type':_0x297f72[_0xbfcb('0x32')][_0xbfcb('0x33')]};});_0x1f45fc['model']=_['map'](_0x286fb7,_0xbfcb('0x2d'));_0x1f45fc[_0xbfcb('0x34')]=_[_0xbfcb('0x35')](_0x3aa3cd[_0xbfcb('0x34')]);_0x1f45fc[_0xbfcb('0x36')]=_[_0xbfcb('0x37')](_0x1f45fc[_0xbfcb('0x38')],_0x1f45fc['query']);_0x43de3c['attributes']=_['intersection'](_0x1f45fc[_0xbfcb('0x38')],qs['fields'](_0x3aa3cd[_0xbfcb('0x34')][_0xbfcb('0x39')]));_0x43de3c['attributes']=_0x43de3c['attributes'][_0xbfcb('0x3a')]?_0x43de3c[_0xbfcb('0x3b')]:_0x1f45fc[_0xbfcb('0x38')];if(!_0x3aa3cd[_0xbfcb('0x34')]['hasOwnProperty'](_0xbfcb('0x3c'))){_0x43de3c[_0xbfcb('0x20')]=qs['limit'](_0x3aa3cd['query'][_0xbfcb('0x20')]);_0x43de3c['offset']=qs['offset'](_0x3aa3cd[_0xbfcb('0x34')][_0xbfcb('0x1e')]);}_0x43de3c[_0xbfcb('0x3d')]=qs[_0xbfcb('0x3e')](_0x3aa3cd['query'][_0xbfcb('0x3e')]);_0x43de3c[_0xbfcb('0x3f')]=qs[_0xbfcb('0x36')](_[_0xbfcb('0x40')](_0x3aa3cd[_0xbfcb('0x34')],_0x1f45fc[_0xbfcb('0x36')]),_0x286fb7);if(_0x3aa3cd['query'][_0xbfcb('0x41')]){_0x43de3c['where']=_[_0xbfcb('0x42')](_0x43de3c['where'],{'$or':_[_0xbfcb('0x2f')](_0x286fb7,function(_0x2e4406){if(_0x2e4406[_0xbfcb('0x32')]!==_0xbfcb('0x43')){var _0x434fcd={};_0x434fcd[_0x2e4406[_0xbfcb('0x2d')]]={'$like':'%'+_0x3aa3cd[_0xbfcb('0x34')][_0xbfcb('0x41')]+'%'};return _0x434fcd;}})});}_0x43de3c=_[_0xbfcb('0x42')]({},_0x43de3c,_0x3aa3cd[_0xbfcb('0x44')]);var _0x55a95f={'where':_0x43de3c[_0xbfcb('0x3f')]};return db[_0xbfcb('0x30')]['count'](_0x55a95f)[_0xbfcb('0x26')](function(_0x306ea4){_0x14f6f5[_0xbfcb('0x21')]=_0x306ea4;if(_0x3aa3cd[_0xbfcb('0x34')][_0xbfcb('0x45')]){_0x43de3c[_0xbfcb('0x46')]=[{'all':!![]}];}return db['ContactItemType'][_0xbfcb('0x47')](_0x43de3c);})[_0xbfcb('0x26')](function(_0x10ea4f){_0x14f6f5['rows']=_0x10ea4f;return _0x14f6f5;})[_0xbfcb('0x26')](respondWithFilteredResult(_0x43c3c3,_0x43de3c))[_0xbfcb('0x48')](handleError(_0x43c3c3,null));};exports[_0xbfcb('0x49')]=function(_0x542d90,_0x5aa9c9){var _0xd7cb39={'raw':!![],'where':{'id':_0x542d90['params']['id']}},_0x58337d={};_0x58337d[_0xbfcb('0x38')]=_[_0xbfcb('0x35')](db['ContactItemType'][_0xbfcb('0x4a')]);_0x58337d[_0xbfcb('0x34')]=_['keys'](_0x542d90[_0xbfcb('0x34')]);_0x58337d[_0xbfcb('0x36')]=_[_0xbfcb('0x37')](_0x58337d[_0xbfcb('0x38')],_0x58337d[_0xbfcb('0x34')]);_0xd7cb39[_0xbfcb('0x3b')]=_[_0xbfcb('0x37')](_0x58337d[_0xbfcb('0x38')],qs[_0xbfcb('0x39')](_0x542d90[_0xbfcb('0x34')][_0xbfcb('0x39')]));_0xd7cb39[_0xbfcb('0x3b')]=_0xd7cb39['attributes'][_0xbfcb('0x3a')]?_0xd7cb39[_0xbfcb('0x3b')]:_0x58337d[_0xbfcb('0x38')];if(_0x542d90['query'][_0xbfcb('0x45')]){_0xd7cb39['include']=[{'all':!![]}];}_0xd7cb39=_['merge']({},_0xd7cb39,_0x542d90[_0xbfcb('0x44')]);return db[_0xbfcb('0x30')][_0xbfcb('0x4b')](_0xd7cb39)['then'](handleEntityNotFound(_0x5aa9c9,null))[_0xbfcb('0x26')](respondWithResult(_0x5aa9c9,null))['catch'](handleError(_0x5aa9c9,null));};exports['create']=function(_0x33725a,_0x588d32){return db[_0xbfcb('0x30')][_0xbfcb('0x4c')](_0x33725a['body'],{})[_0xbfcb('0x26')](function(_0x5d942f){var _0x8347be=_0x33725a['user'][_0xbfcb('0x28')]({'plain':!![]});if(!_0x8347be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8347be[_0xbfcb('0x4d')]===_0xbfcb('0x4e')){var _0x5efbe1=_0x5d942f[_0xbfcb('0x28')]({'plain':!![]});var _0x547169='ContactItemTypes';return db[_0xbfcb('0x4f')][_0xbfcb('0x4b')]({'where':{'name':_0x547169,'userProfileId':_0x8347be[_0xbfcb('0x50')]},'raw':!![]})['then'](function(_0x495c34){if(_0x495c34&&_0x495c34[_0xbfcb('0x51')]===0x0){return db[_0xbfcb('0x2a')][_0xbfcb('0x4c')]({'name':_0x5efbe1[_0xbfcb('0x2d')],'resourceId':_0x5efbe1['id'],'type':_0x495c34[_0xbfcb('0x2d')],'sectionId':_0x495c34['id']},{})['then'](function(){return _0x5d942f;});}else{return _0x5d942f;}})[_0xbfcb('0x48')](function(_0x37a7e8){logger[_0xbfcb('0x2b')](_0xbfcb('0x52'),_0x37a7e8);throw _0x37a7e8;});}return _0x5d942f;})['then'](respondWithResult(_0x588d32,0xc9))['catch'](handleError(_0x588d32,null));};exports[_0xbfcb('0x25')]=function(_0x50f9f7,_0x9cc2bd){if(_0x50f9f7['body']['id']){delete _0x50f9f7['body']['id'];}return db[_0xbfcb('0x30')]['find']({'where':{'id':_0x50f9f7['params']['id']}})[_0xbfcb('0x26')](handleEntityNotFound(_0x9cc2bd,null))['then'](saveUpdates(_0x50f9f7[_0xbfcb('0x53')],null))['then'](respondWithResult(_0x9cc2bd,null))[_0xbfcb('0x48')](handleError(_0x9cc2bd,null));};exports[_0xbfcb('0x27')]=function(_0x593f4e,_0x35cd27){return db[_0xbfcb('0x30')][_0xbfcb('0x4b')]({'where':{'id':_0x593f4e['params']['id']}})[_0xbfcb('0x26')](handleEntityNotFound(_0x35cd27,null))[_0xbfcb('0x26')](db[_0xbfcb('0x54')][_0xbfcb('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x593f4e[_0xbfcb('0x55')]['id']}}))[_0xbfcb('0x26')](removeEntity(_0x35cd27,null))[_0xbfcb('0x48')](handleError(_0x35cd27,null));}; \ No newline at end of file +var _0x0120=['intersection','attributes','fields','length','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','filters'];(function(_0x41ffc3,_0x2ccac3){var _0x2ee4af=function(_0x260210){while(--_0x260210){_0x41ffc3['push'](_0x41ffc3['shift']());}};_0x2ee4af(++_0x2ccac3);}(_0x0120,0x6f));var _0x0012=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0120[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];function respondWithStatusCode(_0x4d3e7a,_0x6d4a1a){_0x6d4a1a=_0x6d4a1a||0xcc;return function(_0x4f0ee1){if(_0x4f0ee1){return _0x4d3e7a['sendStatus'](_0x6d4a1a);}return _0x4d3e7a['status'](_0x6d4a1a)['end']();};}function respondWithResult(_0x3a7d50,_0x496a2b){_0x496a2b=_0x496a2b||0xc8;return function(_0x3995fd){if(_0x3995fd){return _0x3a7d50[_0x0012('0x1a')](_0x496a2b)['json'](_0x3995fd);}};}function respondWithFilteredResult(_0x24f4ed,_0x1a0c0d){return function(_0x348810){if(_0x348810){var _0x3b8dfc=typeof _0x1a0c0d['offset']==='undefined'&&typeof _0x1a0c0d[_0x0012('0x1b')]===_0x0012('0x1c');var _0x3948bf=_0x348810[_0x0012('0x1d')];var _0x1d0423=_0x3b8dfc?0x0:_0x1a0c0d[_0x0012('0x1e')];var _0x1e78ee=_0x3b8dfc?_0x348810[_0x0012('0x1d')]:_0x1a0c0d['offset']+_0x1a0c0d[_0x0012('0x1b')];var _0x56b0e1;if(_0x1e78ee>=_0x3948bf){_0x1e78ee=_0x3948bf;_0x56b0e1=0xc8;}else{_0x56b0e1=0xce;}_0x24f4ed['status'](_0x56b0e1);return _0x24f4ed[_0x0012('0x1f')](_0x0012('0x20'),_0x1d0423+'-'+_0x1e78ee+'/'+_0x3948bf)[_0x0012('0x21')](_0x348810);}return null;};}function patchUpdates(_0x2c837e){return function(_0x53ac2d){try{jsonpatch['apply'](_0x53ac2d,_0x2c837e,!![]);}catch(_0x460d82){return BPromise[_0x0012('0x22')](_0x460d82);}return _0x53ac2d[_0x0012('0x23')]();};}function saveUpdates(_0x7177bc,_0x190f07){return function(_0x2e6a2c){if(_0x2e6a2c){return _0x2e6a2c[_0x0012('0x24')](_0x7177bc)[_0x0012('0x25')](function(_0x57487e){return _0x57487e;});}return null;};}function removeEntity(_0x24674c,_0x24a280){return function(_0x4cf4bd){if(_0x4cf4bd){return _0x4cf4bd[_0x0012('0x26')]()[_0x0012('0x25')](function(){var _0x340622=_0x4cf4bd[_0x0012('0x27')]({'plain':!![]});var _0x42bcd7='ContactItemTypes';return db[_0x0012('0x28')][_0x0012('0x26')]({'where':{'type':_0x42bcd7,'resourceId':_0x340622['id']}})[_0x0012('0x25')](function(){return _0x4cf4bd;});})[_0x0012('0x25')](function(){_0x24674c[_0x0012('0x1a')](0xcc)[_0x0012('0x29')]();});}};}function handleEntityNotFound(_0x15d48a,_0xf3781e){return function(_0x300e13){if(!_0x300e13){_0x15d48a[_0x0012('0x2a')](0x194);}return _0x300e13;};}function handleError(_0x34efc7,_0x20b78f){_0x20b78f=_0x20b78f||0x1f4;return function(_0x45c3ca){logger[_0x0012('0x2b')](_0x45c3ca[_0x0012('0x2c')]);if(_0x45c3ca[_0x0012('0x2d')]){delete _0x45c3ca[_0x0012('0x2d')];}_0x34efc7[_0x0012('0x1a')](_0x20b78f)[_0x0012('0x2e')](_0x45c3ca);};}exports[_0x0012('0x2f')]=function(_0x1bb14d,_0x4d0998){var _0x283134={},_0x1bb49b={},_0x4c2601={'count':0x0,'rows':[]};var _0x2fa6a2=_[_0x0012('0x30')](db[_0x0012('0x31')][_0x0012('0x32')],function(_0x287b05){return{'name':_0x287b05['fieldName'],'type':_0x287b05[_0x0012('0x33')][_0x0012('0x34')]};});_0x1bb49b[_0x0012('0x35')]=_['map'](_0x2fa6a2,_0x0012('0x2d'));_0x1bb49b[_0x0012('0x36')]=_[_0x0012('0x37')](_0x1bb14d[_0x0012('0x36')]);_0x1bb49b[_0x0012('0x38')]=_[_0x0012('0x39')](_0x1bb49b['model'],_0x1bb49b[_0x0012('0x36')]);_0x283134[_0x0012('0x3a')]=_[_0x0012('0x39')](_0x1bb49b[_0x0012('0x35')],qs['fields'](_0x1bb14d['query'][_0x0012('0x3b')]));_0x283134[_0x0012('0x3a')]=_0x283134[_0x0012('0x3a')][_0x0012('0x3c')]?_0x283134[_0x0012('0x3a')]:_0x1bb49b[_0x0012('0x35')];if(!_0x1bb14d[_0x0012('0x36')]['hasOwnProperty'](_0x0012('0x3d'))){_0x283134[_0x0012('0x1b')]=qs['limit'](_0x1bb14d[_0x0012('0x36')][_0x0012('0x1b')]);_0x283134[_0x0012('0x1e')]=qs[_0x0012('0x1e')](_0x1bb14d[_0x0012('0x36')][_0x0012('0x1e')]);}_0x283134[_0x0012('0x3e')]=qs['sort'](_0x1bb14d[_0x0012('0x36')]['sort']);_0x283134[_0x0012('0x3f')]=qs['filters'](_['pick'](_0x1bb14d[_0x0012('0x36')],_0x1bb49b[_0x0012('0x38')]),_0x2fa6a2);if(_0x1bb14d[_0x0012('0x36')]['filter']){_0x283134[_0x0012('0x3f')]=_[_0x0012('0x40')](_0x283134[_0x0012('0x3f')],{'$or':_[_0x0012('0x30')](_0x2fa6a2,function(_0x3d81ed){if(_0x3d81ed[_0x0012('0x33')]!==_0x0012('0x41')){var _0x11f001={};_0x11f001[_0x3d81ed['name']]={'$like':'%'+_0x1bb14d[_0x0012('0x36')][_0x0012('0x42')]+'%'};return _0x11f001;}})});}_0x283134=_[_0x0012('0x40')]({},_0x283134,_0x1bb14d[_0x0012('0x43')]);var _0x42e01c={'where':_0x283134[_0x0012('0x3f')]};return db[_0x0012('0x31')]['count'](_0x42e01c)['then'](function(_0x1c54de){_0x4c2601['count']=_0x1c54de;if(_0x1bb14d[_0x0012('0x36')][_0x0012('0x44')]){_0x283134[_0x0012('0x45')]=[{'all':!![]}];}return db[_0x0012('0x31')][_0x0012('0x46')](_0x283134);})['then'](function(_0x1bd93a){_0x4c2601[_0x0012('0x47')]=_0x1bd93a;return _0x4c2601;})['then'](respondWithFilteredResult(_0x4d0998,_0x283134))[_0x0012('0x48')](handleError(_0x4d0998,null));};exports[_0x0012('0x49')]=function(_0x422c06,_0x207b61){var _0x5259c2={'raw':!![],'where':{'id':_0x422c06[_0x0012('0x4a')]['id']}},_0x4ba00e={};_0x4ba00e['model']=_[_0x0012('0x37')](db['ContactItemType'][_0x0012('0x32')]);_0x4ba00e[_0x0012('0x36')]=_[_0x0012('0x37')](_0x422c06[_0x0012('0x36')]);_0x4ba00e['filters']=_[_0x0012('0x39')](_0x4ba00e['model'],_0x4ba00e[_0x0012('0x36')]);_0x5259c2[_0x0012('0x3a')]=_[_0x0012('0x39')](_0x4ba00e[_0x0012('0x35')],qs[_0x0012('0x3b')](_0x422c06[_0x0012('0x36')][_0x0012('0x3b')]));_0x5259c2['attributes']=_0x5259c2[_0x0012('0x3a')][_0x0012('0x3c')]?_0x5259c2[_0x0012('0x3a')]:_0x4ba00e[_0x0012('0x35')];if(_0x422c06[_0x0012('0x36')][_0x0012('0x44')]){_0x5259c2['include']=[{'all':!![]}];}_0x5259c2=_['merge']({},_0x5259c2,_0x422c06['options']);return db['ContactItemType'][_0x0012('0x4b')](_0x5259c2)[_0x0012('0x25')](handleEntityNotFound(_0x207b61,null))[_0x0012('0x25')](respondWithResult(_0x207b61,null))[_0x0012('0x48')](handleError(_0x207b61,null));};exports[_0x0012('0x4c')]=function(_0x53d552,_0x44ffaf){return db[_0x0012('0x31')][_0x0012('0x4c')](_0x53d552[_0x0012('0x4d')],{})[_0x0012('0x25')](function(_0x564bc4){var _0x156490=_0x53d552[_0x0012('0x4e')][_0x0012('0x27')]({'plain':!![]});if(!_0x156490)throw new Error(_0x0012('0x4f'));if(_0x156490[_0x0012('0x50')]==='user'){var _0x2389cd=_0x564bc4[_0x0012('0x27')]({'plain':!![]});var _0x46e6d9='ContactItemTypes';return db[_0x0012('0x51')][_0x0012('0x4b')]({'where':{'name':_0x46e6d9,'userProfileId':_0x156490[_0x0012('0x52')]},'raw':!![]})[_0x0012('0x25')](function(_0x27a650){if(_0x27a650&&_0x27a650['autoAssociation']===0x0){return db[_0x0012('0x28')]['create']({'name':_0x2389cd[_0x0012('0x2d')],'resourceId':_0x2389cd['id'],'type':_0x27a650[_0x0012('0x2d')],'sectionId':_0x27a650['id']},{})['then'](function(){return _0x564bc4;});}else{return _0x564bc4;}})[_0x0012('0x48')](function(_0x19cf31){logger[_0x0012('0x2b')](_0x0012('0x53'),_0x19cf31);throw _0x19cf31;});}return _0x564bc4;})[_0x0012('0x25')](respondWithResult(_0x44ffaf,0xc9))[_0x0012('0x48')](handleError(_0x44ffaf,null));};exports['update']=function(_0x14ac2d,_0x1a91eb){if(_0x14ac2d[_0x0012('0x4d')]['id']){delete _0x14ac2d[_0x0012('0x4d')]['id'];}return db['ContactItemType'][_0x0012('0x4b')]({'where':{'id':_0x14ac2d[_0x0012('0x4a')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x1a91eb,null))['then'](saveUpdates(_0x14ac2d[_0x0012('0x4d')],null))[_0x0012('0x25')](respondWithResult(_0x1a91eb,null))[_0x0012('0x48')](handleError(_0x1a91eb,null));};exports[_0x0012('0x26')]=function(_0x1a48d9,_0x53e967){return db[_0x0012('0x31')][_0x0012('0x4b')]({'where':{'id':_0x1a48d9[_0x0012('0x4a')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x53e967,null))[_0x0012('0x25')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1a48d9[_0x0012('0x4a')]['id']}}))[_0x0012('0x25')](removeEntity(_0x53e967,null))[_0x0012('0x48')](handleError(_0x53e967,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 5bb3a30..0369d6b 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42bb=['bluebird','path','rimraf','../../config/environment','define','ContactItemType','tools_contact_item_types','lodash','../../config/logger','moment'];(function(_0x3226e8,_0x5ebfcc){var _0x35ef62=function(_0x4a2f31){while(--_0x4a2f31){_0x3226e8['push'](_0x3226e8['shift']());}};_0x35ef62(++_0x5ebfcc);}(_0x42bb,0x129));var _0xb42b=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x42bb[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0xb42b('0x0'));var util=require('util');var logger=require(_0xb42b('0x1'))('api');var moment=require(_0xb42b('0x2'));var BPromise=require(_0xb42b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb42b('0x4'));var rimraf=require(_0xb42b('0x5'));var config=require(_0xb42b('0x6'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x2b3f30,_0x30cd63){return _0x2b3f30[_0xb42b('0x7')](_0xb42b('0x8'),attributes,{'tableName':_0xb42b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4974=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','tools_contact_item_types'];(function(_0x469149,_0x449071){var _0x341823=function(_0x39f11b){while(--_0x39f11b){_0x469149['push'](_0x469149['shift']());}};_0x341823(++_0x449071);}(_0x4974,0x129));var _0x4497=function(_0x5455e2,_0x4675b4){_0x5455e2=_0x5455e2-0x0;var _0x4c8a44=_0x4974[_0x5455e2];return _0x4c8a44;};'use strict';var _=require('lodash');var util=require(_0x4497('0x0'));var logger=require(_0x4497('0x1'))(_0x4497('0x2'));var moment=require(_0x4497('0x3'));var BPromise=require(_0x4497('0x4'));var rp=require(_0x4497('0x5'));var fs=require('fs');var path=require(_0x4497('0x6'));var rimraf=require(_0x4497('0x7'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0x4497('0x8')]=function(_0x272e51,_0x1b8304){return _0x272e51[_0x4497('0x9')]('ContactItemType',attributes,{'tableName':_0x4497('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 569a340..cd8a907 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50c2=['rpc','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x50c2,0x127));var _0x250c=function(_0x418cbb,_0x351848){_0x418cbb=_0x418cbb-0x0;var _0x202f3b=_0x50c2[_0x418cbb];return _0x202f3b;};'use strict';var _=require('lodash');var util=require(_0x250c('0x0'));var moment=require(_0x250c('0x1'));var BPromise=require(_0x250c('0x2'));var rs=require(_0x250c('0x3'));var fs=require('fs');var Redis=require(_0x250c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x250c('0x5'));var config=require('../../config/environment');var jayson=require(_0x250c('0x6'));var client=jayson[_0x250c('0x7')][_0x250c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x488fb1,_0xc59a11,_0x3e2125){return new BPromise(function(_0xe728ba,_0x5a8ed6){return client[_0x250c('0x9')](_0x488fb1,_0x3e2125)[_0x250c('0xa')](function(_0x21b6d4){logger[_0x250c('0xb')](_0x250c('0xc'),_0xc59a11,_0x250c('0xd'));logger[_0x250c('0xe')](_0x250c('0xf'),_0xc59a11,_0x250c('0xd'),JSON['stringify'](_0x21b6d4));if(_0x21b6d4[_0x250c('0x10')]){if(_0x21b6d4['error']['code']===0x1f4){logger[_0x250c('0x10')](_0x250c('0xc'),_0xc59a11,_0x21b6d4['error']['message']);return _0x5a8ed6(_0x21b6d4[_0x250c('0x10')]['message']);}logger[_0x250c('0x10')](_0x250c('0xc'),_0xc59a11,_0x21b6d4['error'][_0x250c('0x11')]);return _0xe728ba(_0x21b6d4[_0x250c('0x10')][_0x250c('0x11')]);}else{logger[_0x250c('0xb')](_0x250c('0xc'),_0xc59a11,_0x250c('0xd'));_0xe728ba(_0x21b6d4[_0x250c('0x12')][_0x250c('0x11')]);}})[_0x250c('0x13')](function(_0x1502d8){logger[_0x250c('0x10')](_0x250c('0xc'),_0xc59a11,_0x1502d8);_0x5a8ed6(_0x1502d8);});});} \ No newline at end of file +var _0x6a18=['request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x4fee76,_0xc60073){var _0x4335f4=function(_0xbd9fb1){while(--_0xbd9fb1){_0x4fee76['push'](_0x4fee76['shift']());}};_0x4335f4(++_0xc60073);}(_0x6a18,0x1ed));var _0x86a1=function(_0xf79d24,_0x27efe3){_0xf79d24=_0xf79d24-0x0;var _0x162f5c=_0x6a18[_0xf79d24];return _0x162f5c;};'use strict';var _=require('lodash');var util=require(_0x86a1('0x0'));var moment=require(_0x86a1('0x1'));var BPromise=require(_0x86a1('0x2'));var rs=require(_0x86a1('0x3'));var fs=require('fs');var Redis=require(_0x86a1('0x4'));var db=require(_0x86a1('0x5'))['db'];var utils=require(_0x86a1('0x6'));var logger=require(_0x86a1('0x7'))(_0x86a1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x86a1('0x9')][_0x86a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ad6c9,_0x3752b5,_0x280d23){return new BPromise(function(_0x48ebd8,_0x39f0aa){return client[_0x86a1('0xb')](_0x5ad6c9,_0x280d23)[_0x86a1('0xc')](function(_0x501e13){logger[_0x86a1('0xd')](_0x86a1('0xe'),_0x3752b5,_0x86a1('0xf'));logger[_0x86a1('0x10')](_0x86a1('0x11'),_0x3752b5,'request\x20sent',JSON[_0x86a1('0x12')](_0x501e13));if(_0x501e13[_0x86a1('0x13')]){if(_0x501e13[_0x86a1('0x13')][_0x86a1('0x14')]===0x1f4){logger[_0x86a1('0x13')](_0x86a1('0xe'),_0x3752b5,_0x501e13[_0x86a1('0x13')][_0x86a1('0x15')]);return _0x39f0aa(_0x501e13[_0x86a1('0x13')][_0x86a1('0x15')]);}logger[_0x86a1('0x13')](_0x86a1('0xe'),_0x3752b5,_0x501e13[_0x86a1('0x13')][_0x86a1('0x15')]);return _0x48ebd8(_0x501e13[_0x86a1('0x13')]['message']);}else{logger[_0x86a1('0xd')]('ContactItemType,\x20%s,\x20%s',_0x3752b5,'request\x20sent');_0x48ebd8(_0x501e13[_0x86a1('0x16')]['message']);}})[_0x86a1('0x17')](function(_0x21c6a3){logger[_0x86a1('0x13')](_0x86a1('0xe'),_0x3752b5,_0x21c6a3);_0x39f0aa(_0x21c6a3);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 928a9c7..000f263 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdea3=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','show','post','create','/:id','update'];(function(_0x5ba84e,_0x262c3f){var _0x140133=function(_0x34c6dc){while(--_0x34c6dc){_0x5ba84e['push'](_0x5ba84e['shift']());}};_0x140133(++_0x262c3f);}(_0xdea3,0x88));var _0x3dea=function(_0x11fd0b,_0x4d9ed3){_0x11fd0b=_0x11fd0b-0x0;var _0x38c0c2=_0xdea3[_0x11fd0b];return _0x38c0c2;};'use strict';var multer=require(_0x3dea('0x0'));var util=require(_0x3dea('0x1'));var path=require('path');var timeout=require(_0x3dea('0x2'));var express=require(_0x3dea('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3dea('0x4'));var interaction=require(_0x3dea('0x5'));var config=require(_0x3dea('0x6'));var controller=require(_0x3dea('0x7'));router[_0x3dea('0x8')]('/',auth[_0x3dea('0x9')](),controller[_0x3dea('0xa')]);router[_0x3dea('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3dea('0xb')]);router[_0x3dea('0xc')]('/',auth[_0x3dea('0x9')](),controller[_0x3dea('0xd')]);router['put'](_0x3dea('0xe'),auth[_0x3dea('0x9')](),controller[_0x3dea('0xf')]);router[_0x3dea('0x10')]('/:id',auth[_0x3dea('0x9')](),controller[_0x3dea('0x11')]);module[_0x3dea('0x12')]=router; \ No newline at end of file +var _0x2917=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2917,0xb1));var _0x7291=function(_0x203d64,_0x1ec79c){_0x203d64=_0x203d64-0x0;var _0x462ab3=_0x2917[_0x203d64];return _0x462ab3;};'use strict';var multer=require(_0x7291('0x0'));var util=require(_0x7291('0x1'));var path=require(_0x7291('0x2'));var timeout=require(_0x7291('0x3'));var express=require(_0x7291('0x4'));var router=express[_0x7291('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7291('0x6'));var config=require(_0x7291('0x7'));var controller=require('./contactItemType.controller');router[_0x7291('0x8')]('/',auth[_0x7291('0x9')](),controller['index']);router[_0x7291('0x8')](_0x7291('0xa'),auth[_0x7291('0x9')](),controller[_0x7291('0xb')]);router['post']('/',auth[_0x7291('0x9')](),controller[_0x7291('0xc')]);router[_0x7291('0xd')](_0x7291('0xa'),auth['isAuthenticated'](),controller[_0x7291('0xe')]);router[_0x7291('0xf')](_0x7291('0xa'),auth[_0x7291('0x9')](),controller[_0x7291('0x10')]);module[_0x7291('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 5fb99fe..322d0eb 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb7e7[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 3e64f6c..58af25b 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 _0x9710=['attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','web-report','reportType','attrReport','attrRefresh','stringify','addItem','DashboardId','findOne','DashboardItem','getItems','hasOwnProperty','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./dashboard.socket','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','CustomDashboards','UserProfileResource','end','name','send','index','map','Dashboard','fieldName','type','key','model','keys','filters','intersection','query','attributes','length','order','sort','where','pick','filter','merge','include','rows','show','params','rawAttributes','fields','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','options','omit','createdAt','updatedAt','body','update','destroy','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss'];(function(_0x70d5a0,_0x282564){var _0x2d7404=function(_0x33576c){while(--_0x33576c){_0x70d5a0['push'](_0x70d5a0['shift']());}};_0x2d7404(++_0x282564);}(_0x9710,0x9c));var _0x0971=function(_0x30cdf8,_0x314211){_0x30cdf8=_0x30cdf8-0x0;var _0x27a2b7=_0x9710[_0x30cdf8];return _0x27a2b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0971('0x0'));var zipdir=require(_0x0971('0x1'));var jsonpatch=require(_0x0971('0x2'));var rp=require(_0x0971('0x3'));var moment=require(_0x0971('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0971('0x5'));var path=require(_0x0971('0x6'));var sox=require('sox');var csv=require(_0x0971('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0971('0x8'));var _=require(_0x0971('0x9'));var squel=require('squel');var crypto=require(_0x0971('0xa'));var jsforce=require(_0x0971('0xb'));var deskjs=require(_0x0971('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0971('0xd'));var authService=require(_0x0971('0xe'));var qs=require(_0x0971('0xf'));var as=require(_0x0971('0x10'));var hardwareService=require(_0x0971('0x11'));var logger=require(_0x0971('0x12'))(_0x0971('0x13'));var utils=require(_0x0971('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0971('0x15'));var db=require(_0x0971('0x16'))['db'];config['redis']=_[_0x0971('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0971('0x18'))(new Redis(config[_0x0971('0x19')]));require(_0x0971('0x1a'))['register'](socket);function respondWithStatusCode(_0x45b9b6,_0xdb5495){_0xdb5495=_0xdb5495||0xcc;return function(_0x13bf7){if(_0x13bf7){return _0x45b9b6['sendStatus'](_0xdb5495);}return _0x45b9b6['status'](_0xdb5495)['end']();};}function respondWithResult(_0x3b4415,_0x244cc2){_0x244cc2=_0x244cc2||0xc8;return function(_0x2060fa){if(_0x2060fa){return _0x3b4415[_0x0971('0x1b')](_0x244cc2)[_0x0971('0x1c')](_0x2060fa);}};}function respondWithFilteredResult(_0x47254a,_0x2f6f33){return function(_0x2302b9){if(_0x2302b9){var _0x3983a8=typeof _0x2f6f33[_0x0971('0x1d')]===_0x0971('0x1e')&&typeof _0x2f6f33[_0x0971('0x1f')]==='undefined';var _0x1e6b5e=_0x2302b9['count'];var _0x400bf6=_0x3983a8?0x0:_0x2f6f33['offset'];var _0x31f44=_0x3983a8?_0x2302b9[_0x0971('0x20')]:_0x2f6f33[_0x0971('0x1d')]+_0x2f6f33['limit'];var _0x34b028;if(_0x31f44>=_0x1e6b5e){_0x31f44=_0x1e6b5e;_0x34b028=0xc8;}else{_0x34b028=0xce;}_0x47254a[_0x0971('0x1b')](_0x34b028);return _0x47254a[_0x0971('0x21')](_0x0971('0x22'),_0x400bf6+'-'+_0x31f44+'/'+_0x1e6b5e)[_0x0971('0x1c')](_0x2302b9);}return null;};}function patchUpdates(_0x3796d2){return function(_0x351486){try{jsonpatch[_0x0971('0x23')](_0x351486,_0x3796d2,!![]);}catch(_0xc0f202){return BPromise[_0x0971('0x24')](_0xc0f202);}return _0x351486['save']();};}function saveUpdates(_0x515fa4,_0x2529a4){return function(_0x1be027){if(_0x1be027){return _0x1be027['update'](_0x515fa4)[_0x0971('0x25')](function(_0x22fb43){return _0x22fb43;});}return null;};}function removeEntity(_0x15435a,_0xde3e58){return function(_0x562e3f){if(_0x562e3f){return _0x562e3f['destroy']()['then'](function(){var _0x2c4d5e=_0x562e3f[_0x0971('0x26')]({'plain':!![]});var _0x5f06f2=_0x0971('0x27');return db[_0x0971('0x28')]['destroy']({'where':{'type':_0x5f06f2,'resourceId':_0x2c4d5e['id']}})['then'](function(){return _0x562e3f;});})[_0x0971('0x25')](function(){_0x15435a['status'](0xcc)[_0x0971('0x29')]();});}};}function handleEntityNotFound(_0x23e59d,_0x2d3218){return function(_0x25e6c5){if(!_0x25e6c5){_0x23e59d['sendStatus'](0x194);}return _0x25e6c5;};}function handleError(_0x1afd62,_0xec68cf){_0xec68cf=_0xec68cf||0x1f4;return function(_0x1bbb67){logger['error'](_0x1bbb67['stack']);if(_0x1bbb67['name']){delete _0x1bbb67[_0x0971('0x2a')];}_0x1afd62[_0x0971('0x1b')](_0xec68cf)[_0x0971('0x2b')](_0x1bbb67);};}exports[_0x0971('0x2c')]=function(_0x4c00cb,_0x2030d9){var _0x44c851={},_0x248283={},_0x370ae4={'count':0x0,'rows':[]};var _0x842ccb=_[_0x0971('0x2d')](db[_0x0971('0x2e')]['rawAttributes'],function(_0x1dab15){return{'name':_0x1dab15[_0x0971('0x2f')],'type':_0x1dab15[_0x0971('0x30')][_0x0971('0x31')]};});_0x248283[_0x0971('0x32')]=_[_0x0971('0x2d')](_0x842ccb,'name');_0x248283['query']=_[_0x0971('0x33')](_0x4c00cb['query']);_0x248283[_0x0971('0x34')]=_[_0x0971('0x35')](_0x248283[_0x0971('0x32')],_0x248283[_0x0971('0x36')]);_0x44c851['attributes']=_[_0x0971('0x35')](_0x248283[_0x0971('0x32')],qs['fields'](_0x4c00cb[_0x0971('0x36')]['fields']));_0x44c851[_0x0971('0x37')]=_0x44c851[_0x0971('0x37')][_0x0971('0x38')]?_0x44c851[_0x0971('0x37')]:_0x248283[_0x0971('0x32')];if(!_0x4c00cb[_0x0971('0x36')]['hasOwnProperty']('nolimit')){_0x44c851[_0x0971('0x1f')]=qs[_0x0971('0x1f')](_0x4c00cb[_0x0971('0x36')]['limit']);_0x44c851['offset']=qs[_0x0971('0x1d')](_0x4c00cb[_0x0971('0x36')][_0x0971('0x1d')]);}_0x44c851[_0x0971('0x39')]=qs[_0x0971('0x3a')](_0x4c00cb[_0x0971('0x36')][_0x0971('0x3a')]);_0x44c851[_0x0971('0x3b')]=qs[_0x0971('0x34')](_[_0x0971('0x3c')](_0x4c00cb[_0x0971('0x36')],_0x248283[_0x0971('0x34')]),_0x842ccb);if(_0x4c00cb[_0x0971('0x36')][_0x0971('0x3d')]){_0x44c851['where']=_[_0x0971('0x3e')](_0x44c851['where'],{'$or':_['map'](_0x842ccb,function(_0x345e3b){if(_0x345e3b[_0x0971('0x30')]!=='VIRTUAL'){var _0x34bf4b={};_0x34bf4b[_0x345e3b[_0x0971('0x2a')]]={'$like':'%'+_0x4c00cb[_0x0971('0x36')]['filter']+'%'};return _0x34bf4b;}})});}_0x44c851=_[_0x0971('0x3e')]({},_0x44c851,_0x4c00cb['options']);var _0x3ab127={'where':_0x44c851[_0x0971('0x3b')]};return db[_0x0971('0x2e')][_0x0971('0x20')](_0x3ab127)[_0x0971('0x25')](function(_0x365064){_0x370ae4[_0x0971('0x20')]=_0x365064;if(_0x4c00cb[_0x0971('0x36')]['includeAll']){_0x44c851[_0x0971('0x3f')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x44c851);})[_0x0971('0x25')](function(_0x1bbda8){_0x370ae4[_0x0971('0x40')]=_0x1bbda8;return _0x370ae4;})[_0x0971('0x25')](respondWithFilteredResult(_0x2030d9,_0x44c851))['catch'](handleError(_0x2030d9,null));};exports[_0x0971('0x41')]=function(_0x10739f,_0x2af1b5){var _0x1bf090={'raw':![],'where':{'id':_0x10739f[_0x0971('0x42')]['id']}},_0x18c554={};_0x18c554[_0x0971('0x32')]=_[_0x0971('0x33')](db[_0x0971('0x2e')][_0x0971('0x43')]);_0x18c554[_0x0971('0x36')]=_[_0x0971('0x33')](_0x10739f[_0x0971('0x36')]);_0x18c554[_0x0971('0x34')]=_[_0x0971('0x35')](_0x18c554[_0x0971('0x32')],_0x18c554[_0x0971('0x36')]);_0x1bf090[_0x0971('0x37')]=_[_0x0971('0x35')](_0x18c554[_0x0971('0x32')],qs[_0x0971('0x44')](_0x10739f[_0x0971('0x36')][_0x0971('0x44')]));_0x1bf090[_0x0971('0x37')]=_0x1bf090['attributes'][_0x0971('0x38')]?_0x1bf090[_0x0971('0x37')]:_0x18c554[_0x0971('0x32')];if(_0x10739f[_0x0971('0x36')][_0x0971('0x45')]){_0x1bf090[_0x0971('0x3f')]=[{'all':!![]}];}_0x1bf090=_[_0x0971('0x3e')]({},_0x1bf090,_0x10739f['options']);return db[_0x0971('0x2e')][_0x0971('0x46')](_0x1bf090)[_0x0971('0x25')](handleEntityNotFound(_0x2af1b5,null))[_0x0971('0x25')](respondWithResult(_0x2af1b5,null))[_0x0971('0x47')](handleError(_0x2af1b5,null));};exports['create']=function(_0x28262,_0x4ce5cb){return db['Dashboard'][_0x0971('0x48')](_0x28262['body'],{})[_0x0971('0x25')](function(_0x17b878){var _0x138f08=_0x28262[_0x0971('0x49')][_0x0971('0x26')]({'plain':!![]});if(!_0x138f08)throw new Error(_0x0971('0x4a'));if(_0x138f08[_0x0971('0x4b')]===_0x0971('0x49')){var _0x4859c0=_0x17b878[_0x0971('0x26')]({'plain':!![]});var _0x387198=_0x0971('0x27');return db[_0x0971('0x4c')]['find']({'where':{'name':_0x387198,'userProfileId':_0x138f08[_0x0971('0x4d')]},'raw':!![]})['then'](function(_0x9c3409){if(_0x9c3409&&_0x9c3409[_0x0971('0x4e')]===0x0){return db['UserProfileResource'][_0x0971('0x48')]({'name':_0x4859c0[_0x0971('0x2a')],'resourceId':_0x4859c0['id'],'type':_0x9c3409[_0x0971('0x2a')],'sectionId':_0x9c3409['id']},{})['then'](function(){return _0x17b878;});}else{return _0x17b878;}})[_0x0971('0x47')](function(_0x4526d9){logger[_0x0971('0x4f')](_0x0971('0x50'),_0x4526d9);throw _0x4526d9;});}return _0x17b878;})[_0x0971('0x25')](respondWithResult(_0x4ce5cb,0xc9))[_0x0971('0x47')](handleError(_0x4ce5cb,null));};exports['clone']=function(_0x168b4e,_0x3384c0){var _0x515fcb={'where':{'id':_0x168b4e['params']['id']}},_0x5b5b31={};_0x5b5b31[_0x0971('0x32')]=_[_0x0971('0x33')](db['Dashboard'][_0x0971('0x43')]);_0x515fcb[_0x0971('0x37')]=_[_0x0971('0x35')](_0x5b5b31[_0x0971('0x32')],qs[_0x0971('0x44')](_0x168b4e[_0x0971('0x36')]['fields']));_0x515fcb[_0x0971('0x37')]=_0x515fcb[_0x0971('0x37')][_0x0971('0x38')]?_0x515fcb[_0x0971('0x37')]:_0x5b5b31[_0x0971('0x32')];if(_0x168b4e[_0x0971('0x36')][_0x0971('0x45')]){_0x515fcb[_0x0971('0x3f')]=[{'all':!![]}];}_0x515fcb=_[_0x0971('0x3e')]({},_0x515fcb,_0x168b4e[_0x0971('0x51')]);return db[_0x0971('0x2e')]['find'](_0x515fcb)[_0x0971('0x25')](handleEntityNotFound(_0x3384c0,null))['then'](function(_0x2d89e0){if(_0x2d89e0){var _0x4c379e=_0x2d89e0[_0x0971('0x26')]({'plain':!![]});_0x4c379e=qs[_0x0971('0x52')](_0x4c379e,['id',_0x0971('0x53'),_0x0971('0x54')]);_0x168b4e[_0x0971('0x55')]=_[_0x0971('0x52')](_0x168b4e[_0x0971('0x55')],['id',_0x0971('0x53'),'updatedAt']);return db['Dashboard'][_0x0971('0x48')](_['merge'](_0x4c379e,_0x168b4e[_0x0971('0x55')]),{'include':_0x168b4e['query'][_0x0971('0x45')]?[{'all':!![]}]:undefined})[_0x0971('0x25')](function(_0x1666f8){var _0x14a929=_0x168b4e[_0x0971('0x49')][_0x0971('0x26')]({'plain':!![]});if(!_0x14a929)throw new Error(_0x0971('0x4a'));if(_0x14a929[_0x0971('0x4b')]===_0x0971('0x49')){var _0x4ae00b=_0x1666f8['get']({'plain':!![]});var _0x48c207=_0x0971('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x48c207,'userProfileId':_0x14a929[_0x0971('0x4d')]},'raw':!![]})[_0x0971('0x25')](function(_0x5097e4){if(_0x5097e4&&_0x5097e4[_0x0971('0x4e')]===0x0){return db[_0x0971('0x28')]['create']({'name':_0x4ae00b[_0x0971('0x2a')],'resourceId':_0x4ae00b['id'],'type':_0x5097e4[_0x0971('0x2a')],'sectionId':_0x5097e4['id']},{})[_0x0971('0x25')](function(){return _0x1666f8;});}else{return _0x1666f8;}})[_0x0971('0x47')](function(_0x26fd4c){logger[_0x0971('0x4f')](_0x0971('0x50'),_0x26fd4c);throw _0x26fd4c;});}return _0x1666f8;});}})[_0x0971('0x25')](respondWithResult(_0x3384c0,0xc9))[_0x0971('0x47')](handleError(_0x3384c0,null));};exports[_0x0971('0x56')]=function(_0x15a2e9,_0x5d75ed){if(_0x15a2e9[_0x0971('0x55')]['id']){delete _0x15a2e9[_0x0971('0x55')]['id'];}return db[_0x0971('0x2e')][_0x0971('0x46')]({'where':{'id':_0x15a2e9[_0x0971('0x42')]['id']}})[_0x0971('0x25')](handleEntityNotFound(_0x5d75ed,null))[_0x0971('0x25')](saveUpdates(_0x15a2e9['body'],null))[_0x0971('0x25')](respondWithResult(_0x5d75ed,null))['catch'](handleError(_0x5d75ed,null));};exports[_0x0971('0x57')]=function(_0x640540,_0x3f36d9){return db['Dashboard'][_0x0971('0x46')]({'where':{'id':_0x640540[_0x0971('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f36d9,null))[_0x0971('0x25')](removeEntity(_0x3f36d9,null))[_0x0971('0x47')](handleError(_0x3f36d9,null));};function widgetAttributes(_0x565088){try{switch(_0x565088[_0x0971('0x30')]){case'iframe':return[{'name':_0x0971('0x58'),'value':_0x565088[_0x0971('0x58')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x0]?_0x565088[_0x0971('0x59')][0x0][_0x0971('0x5a')]:undefined)||'https://'}];case _0x0971('0x5b'):return[{'name':_0x0971('0x5c'),'value':_0x565088['attrPath']||(_0x565088[_0x0971('0x59')]&&_0x565088['attrs'][0x0]?_0x565088[_0x0971('0x59')][0x0][_0x0971('0x5a')]:undefined)||''}];case _0x0971('0x5d'):return[{'name':_0x0971('0x5e'),'value':_0x565088['attrHourFormat']||(_0x565088['attrs']&&_0x565088[_0x0971('0x59')][0x0]?_0x565088[_0x0971('0x59')][0x0][_0x0971('0x5a')]:undefined)||_0x0971('0x5f')},{'name':_0x0971('0x60'),'value':_0x565088[_0x0971('0x60')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x1]?_0x565088[_0x0971('0x59')][0x1][_0x0971('0x5a')]:undefined)||_0x0971('0x61')},{'name':_0x0971('0x62'),'value':_0x565088[_0x0971('0x62')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x2]?_0x565088['attrs'][0x2]['value']:undefined)||0xc}];case _0x0971('0x63'):return[{'name':_0x0971('0x64'),'value':_0x565088[_0x0971('0x64')]||(_0x565088[_0x0971('0x59')]&&_0x565088['attrs'][0x0]?_0x565088[_0x0971('0x59')][0x0][_0x0971('0x5a')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x565088[_0x0971('0x65')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x1]?_0x565088[_0x0971('0x59')][0x1][_0x0971('0x5a')]:undefined)||[]},{'name':_0x0971('0x62'),'value':_0x565088[_0x0971('0x62')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x2]?_0x565088[_0x0971('0x59')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x565088['attrChannel']||(_0x565088[_0x0971('0x59')]&&_0x565088['attrs'][0x3]?_0x565088[_0x0971('0x59')][0x3][_0x0971('0x5a')]:undefined)||_0x0971('0x66')},{'name':_0x0971('0x67'),'value':_0x565088[_0x0971('0x67')]||(_0x565088['attrs']&&_0x565088[_0x0971('0x59')][0x4]?_0x565088[_0x0971('0x59')][0x4]['value']:undefined)||''},{'name':_0x0971('0x68'),'value':_0x565088[_0x0971('0x68')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x5]?_0x565088[_0x0971('0x59')][0x5][_0x0971('0x5a')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x565088['attrSmsAccounts']||(_0x565088['attrs']&&_0x565088[_0x0971('0x59')][0x6]?_0x565088[_0x0971('0x59')][0x6][_0x0971('0x5a')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x565088['attrOpenchannelAccounts']||(_0x565088['attrs']&&_0x565088[_0x0971('0x59')][0x7]?_0x565088[_0x0971('0x59')][0x7][_0x0971('0x5a')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x565088['attrWhatsappAccounts']||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x8]?_0x565088['attrs'][0x8][_0x0971('0x5a')]:undefined)||''},{'name':_0x0971('0x69'),'value':_0x565088[_0x0971('0x69')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x9]?_0x565088[_0x0971('0x59')][0x9]['value']:undefined)||''}];case'multibar-chart':case _0x0971('0x6a'):return[{'name':_0x0971('0x6b'),'value':_0x565088[_0x0971('0x6b')]||(_0x565088[_0x0971('0x59')]&&_0x565088['attrs'][0x0]?_0x565088[_0x0971('0x59')][0x0]['value']:undefined)||'total'},{'name':_0x0971('0x6c'),'value':_0x565088['attrSerie2']||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x1]?_0x565088[_0x0971('0x59')][0x1]['value']:undefined)||null},{'name':_0x0971('0x6d'),'value':_0x565088['attrSerie3']||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x2]?_0x565088[_0x0971('0x59')][0x2][_0x0971('0x5a')]:undefined)||null},{'name':_0x0971('0x65'),'value':_0x565088[_0x0971('0x65')]||(_0x565088['attrs']&&_0x565088['attrs'][0x3]?_0x565088[_0x0971('0x59')][0x3][_0x0971('0x5a')]:undefined)||[]},{'name':_0x0971('0x6e'),'value':_0x565088['attrChannel']||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x4]?_0x565088['attrs'][0x4][_0x0971('0x5a')]:undefined)||_0x0971('0x66')},{'name':_0x0971('0x67'),'value':_0x565088['attrEmailAccounts']||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x5]?_0x565088[_0x0971('0x59')][0x5][_0x0971('0x5a')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x565088[_0x0971('0x68')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x6]?_0x565088[_0x0971('0x59')][0x6][_0x0971('0x5a')]:undefined)||''},{'name':_0x0971('0x6f'),'value':_0x565088[_0x0971('0x6f')]||(_0x565088[_0x0971('0x59')]&&_0x565088['attrs'][0x7]?_0x565088[_0x0971('0x59')][0x7][_0x0971('0x5a')]:undefined)||''},{'name':_0x0971('0x70'),'value':_0x565088[_0x0971('0x70')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x8]?_0x565088[_0x0971('0x59')][0x8][_0x0971('0x5a')]:undefined)||''},{'name':_0x0971('0x71'),'value':_0x565088['attrWhatsappAccounts']||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x9]?_0x565088[_0x0971('0x59')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x565088[_0x0971('0x69')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0xa]?_0x565088['attrs'][0xa][_0x0971('0x5a')]:undefined)||''}];case _0x0971('0x72'):return[{'name':'attrReport','type':_0x565088[_0x0971('0x73')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x0]?_0x565088[_0x0971('0x59')][0x0][_0x0971('0x30')]:undefined)||null,'value':_0x565088[_0x0971('0x74')]||(_0x565088[_0x0971('0x59')]&&_0x565088['attrs'][0x0]?_0x565088[_0x0971('0x59')][0x0][_0x0971('0x5a')]:undefined)||null},{'name':_0x0971('0x75'),'value':_0x565088[_0x0971('0x75')]||(_0x565088[_0x0971('0x59')]&&_0x565088[_0x0971('0x59')][0x1]?_0x565088[_0x0971('0x59')][0x1][_0x0971('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x3a1bc2){logger[_0x0971('0x4f')]('widgetAttributes:\x20%s',JSON[_0x0971('0x76')](_0x3a1bc2));return[];}}exports[_0x0971('0x77')]=function(_0x39e469,_0x426a4e,_0x46587a){if(_0x39e469[_0x0971('0x55')]['id']){delete _0x39e469[_0x0971('0x55')]['id'];}return db['Dashboard'][_0x0971('0x46')]({'where':{'id':_0x39e469['params']['id']}})[_0x0971('0x25')](handleEntityNotFound(_0x426a4e,null))['then'](function(_0x3b04e0){if(_0x3b04e0){_0x39e469[_0x0971('0x55')][_0x0971('0x78')]=_0x3b04e0['id'];_0x39e469[_0x0971('0x55')][_0x0971('0x59')]=widgetAttributes(_0x39e469[_0x0971('0x55')]);return db['DashboardItem'][_0x0971('0x48')](_0x39e469[_0x0971('0x55')]);}})[_0x0971('0x25')](respondWithResult(_0x426a4e,null))['catch'](handleError(_0x426a4e,null));};exports['getItems']=function(_0x392bf1,_0x392cda,_0x2416d5){var _0x17d1ca={};var _0x4bdbe6={};var _0x3358c6;var _0xbe00ec;return db[_0x0971('0x2e')][_0x0971('0x79')]({'where':{'id':_0x392bf1[_0x0971('0x42')]['id']}})[_0x0971('0x25')](handleEntityNotFound(_0x392cda,null))[_0x0971('0x25')](function(_0x398312){if(_0x398312){_0x3358c6=_0x398312;_0x4bdbe6[_0x0971('0x32')]=_[_0x0971('0x33')](db[_0x0971('0x7a')]['rawAttributes']);_0x4bdbe6[_0x0971('0x36')]=_[_0x0971('0x33')](_0x392bf1[_0x0971('0x36')]);_0x4bdbe6['filters']=_[_0x0971('0x35')](_0x4bdbe6[_0x0971('0x32')],_0x4bdbe6[_0x0971('0x36')]);_0x17d1ca[_0x0971('0x37')]=_[_0x0971('0x35')](_0x4bdbe6[_0x0971('0x32')],qs['fields'](_0x392bf1[_0x0971('0x36')]['fields']));_0x17d1ca[_0x0971('0x37')]=_0x17d1ca[_0x0971('0x37')][_0x0971('0x38')]?_0x17d1ca[_0x0971('0x37')]:_0x4bdbe6[_0x0971('0x32')];_0x17d1ca['order']=qs[_0x0971('0x3a')](_0x392bf1[_0x0971('0x36')][_0x0971('0x3a')]);_0x17d1ca[_0x0971('0x3b')]=qs[_0x0971('0x34')](_[_0x0971('0x3c')](_0x392bf1['query'],_0x4bdbe6['filters']));if(_0x392bf1[_0x0971('0x36')]['filter']){_0x17d1ca[_0x0971('0x3b')]=_['merge'](_0x17d1ca[_0x0971('0x3b')],{'$or':_[_0x0971('0x2d')](_0x17d1ca[_0x0971('0x37')],function(_0x3fe8bd){var _0x5e83c8={};_0x5e83c8[_0x3fe8bd]={'$like':'%'+_0x392bf1['query'][_0x0971('0x3d')]+'%'};return _0x5e83c8;})});}_0x17d1ca=_[_0x0971('0x3e')]({},_0x17d1ca,_0x392bf1[_0x0971('0x51')]);return _0x3358c6[_0x0971('0x7b')](_0x17d1ca);}})[_0x0971('0x25')](function(_0x441d9c){if(_0x441d9c){_0xbe00ec=_0x441d9c[_0x0971('0x38')];if(!_0x392bf1['query'][_0x0971('0x7c')](_0x0971('0x7d'))){_0x17d1ca[_0x0971('0x1f')]=qs[_0x0971('0x1f')](_0x392bf1[_0x0971('0x36')][_0x0971('0x1f')]);_0x17d1ca[_0x0971('0x1d')]=qs[_0x0971('0x1d')](_0x392bf1[_0x0971('0x36')][_0x0971('0x1d')]);}return _0x3358c6[_0x0971('0x7b')](_0x17d1ca);}})[_0x0971('0x25')](function(_0x5a32ce){if(_0x5a32ce){return _0x5a32ce?{'count':_0xbe00ec,'rows':_0x5a32ce}:null;}})[_0x0971('0x25')](respondWithResult(_0x392cda,null))[_0x0971('0x47')](handleError(_0x392cda,null));}; \ No newline at end of file +var _0x467e=['iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','findOne','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','./dashboard.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','Dashboard','includeAll','rows','catch','keys','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','user','CustomDashboards'];(function(_0x155f22,_0x30422c){var _0x569d57=function(_0x1aeed6){while(--_0x1aeed6){_0x155f22['push'](_0x155f22['shift']());}};_0x569d57(++_0x30422c);}(_0x467e,0x9c));var _0xe467=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x467e[_0x3cea78];return _0x33b66b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe467('0x0'));var zipdir=require(_0xe467('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe467('0x2'));var BPromise=require(_0xe467('0x3'));var Mustache=require(_0xe467('0x4'));var util=require(_0xe467('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xe467('0x6'));var ejs=require(_0xe467('0x7'));var fs=require('fs');var fs_extra=require(_0xe467('0x8'));var _=require(_0xe467('0x9'));var squel=require(_0xe467('0xa'));var crypto=require(_0xe467('0xb'));var jsforce=require(_0xe467('0xc'));var deskjs=require(_0xe467('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe467('0xe'));var Papa=require('papaparse');var Redis=require(_0xe467('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe467('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe467('0x11'));var logger=require(_0xe467('0x12'))(_0xe467('0x13'));var utils=require(_0xe467('0x14'));var config=require(_0xe467('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe467('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe467('0x17'))(new Redis(config[_0xe467('0x18')]));require(_0xe467('0x19'))['register'](socket);function respondWithStatusCode(_0xa6b7ae,_0x5403e0){_0x5403e0=_0x5403e0||0xcc;return function(_0x320ec4){if(_0x320ec4){return _0xa6b7ae[_0xe467('0x1a')](_0x5403e0);}return _0xa6b7ae[_0xe467('0x1b')](_0x5403e0)['end']();};}function respondWithResult(_0x2fd53f,_0x54efc2){_0x54efc2=_0x54efc2||0xc8;return function(_0x3fbf23){if(_0x3fbf23){return _0x2fd53f['status'](_0x54efc2)[_0xe467('0x1c')](_0x3fbf23);}};}function respondWithFilteredResult(_0x63e9c,_0x3f7488){return function(_0x28cda8){if(_0x28cda8){var _0x28a836=typeof _0x3f7488[_0xe467('0x1d')]===_0xe467('0x1e')&&typeof _0x3f7488[_0xe467('0x1f')]===_0xe467('0x1e');var _0x447767=_0x28cda8[_0xe467('0x20')];var _0xb93606=_0x28a836?0x0:_0x3f7488[_0xe467('0x1d')];var _0x3014bb=_0x28a836?_0x28cda8[_0xe467('0x20')]:_0x3f7488[_0xe467('0x1d')]+_0x3f7488[_0xe467('0x1f')];var _0x26deba;if(_0x3014bb>=_0x447767){_0x3014bb=_0x447767;_0x26deba=0xc8;}else{_0x26deba=0xce;}_0x63e9c['status'](_0x26deba);return _0x63e9c[_0xe467('0x21')](_0xe467('0x22'),_0xb93606+'-'+_0x3014bb+'/'+_0x447767)['json'](_0x28cda8);}return null;};}function patchUpdates(_0x664fb){return function(_0x544de2){try{jsonpatch[_0xe467('0x23')](_0x544de2,_0x664fb,!![]);}catch(_0x5dcafb){return BPromise[_0xe467('0x24')](_0x5dcafb);}return _0x544de2[_0xe467('0x25')]();};}function saveUpdates(_0x3b0863,_0x198cc4){return function(_0x3b8033){if(_0x3b8033){return _0x3b8033['update'](_0x3b0863)[_0xe467('0x26')](function(_0xd980fd){return _0xd980fd;});}return null;};}function removeEntity(_0x2ac9d8,_0x1ed7f0){return function(_0x114141){if(_0x114141){return _0x114141['destroy']()['then'](function(){var _0x1f8af5=_0x114141[_0xe467('0x27')]({'plain':!![]});var _0x212ad5='CustomDashboards';return db[_0xe467('0x28')][_0xe467('0x29')]({'where':{'type':_0x212ad5,'resourceId':_0x1f8af5['id']}})[_0xe467('0x26')](function(){return _0x114141;});})[_0xe467('0x26')](function(){_0x2ac9d8[_0xe467('0x1b')](0xcc)[_0xe467('0x2a')]();});}};}function handleEntityNotFound(_0x451620,_0x26f188){return function(_0x20e770){if(!_0x20e770){_0x451620[_0xe467('0x1a')](0x194);}return _0x20e770;};}function handleError(_0x493578,_0x2137f0){_0x2137f0=_0x2137f0||0x1f4;return function(_0x319b4f){logger[_0xe467('0x2b')](_0x319b4f[_0xe467('0x2c')]);if(_0x319b4f['name']){delete _0x319b4f[_0xe467('0x2d')];}_0x493578['status'](_0x2137f0)[_0xe467('0x2e')](_0x319b4f);};}exports[_0xe467('0x2f')]=function(_0x10090c,_0x3c548a){var _0x943c4d={},_0x501dd2={},_0xe3f328={'count':0x0,'rows':[]};var _0x39600d=_['map'](db['Dashboard'][_0xe467('0x30')],function(_0x21ef28){return{'name':_0x21ef28['fieldName'],'type':_0x21ef28['type'][_0xe467('0x31')]};});_0x501dd2[_0xe467('0x32')]=_[_0xe467('0x33')](_0x39600d,'name');_0x501dd2[_0xe467('0x34')]=_['keys'](_0x10090c[_0xe467('0x34')]);_0x501dd2[_0xe467('0x35')]=_[_0xe467('0x36')](_0x501dd2[_0xe467('0x32')],_0x501dd2['query']);_0x943c4d[_0xe467('0x37')]=_[_0xe467('0x36')](_0x501dd2[_0xe467('0x32')],qs[_0xe467('0x38')](_0x10090c[_0xe467('0x34')][_0xe467('0x38')]));_0x943c4d[_0xe467('0x37')]=_0x943c4d['attributes'][_0xe467('0x39')]?_0x943c4d[_0xe467('0x37')]:_0x501dd2[_0xe467('0x32')];if(!_0x10090c[_0xe467('0x34')][_0xe467('0x3a')](_0xe467('0x3b'))){_0x943c4d[_0xe467('0x1f')]=qs['limit'](_0x10090c['query'][_0xe467('0x1f')]);_0x943c4d[_0xe467('0x1d')]=qs[_0xe467('0x1d')](_0x10090c[_0xe467('0x34')][_0xe467('0x1d')]);}_0x943c4d[_0xe467('0x3c')]=qs[_0xe467('0x3d')](_0x10090c['query']['sort']);_0x943c4d[_0xe467('0x3e')]=qs[_0xe467('0x35')](_[_0xe467('0x3f')](_0x10090c[_0xe467('0x34')],_0x501dd2[_0xe467('0x35')]),_0x39600d);if(_0x10090c[_0xe467('0x34')][_0xe467('0x40')]){_0x943c4d[_0xe467('0x3e')]=_[_0xe467('0x41')](_0x943c4d[_0xe467('0x3e')],{'$or':_[_0xe467('0x33')](_0x39600d,function(_0x5ee41d){if(_0x5ee41d[_0xe467('0x42')]!==_0xe467('0x43')){var _0x107c7d={};_0x107c7d[_0x5ee41d[_0xe467('0x2d')]]={'$like':'%'+_0x10090c['query'][_0xe467('0x40')]+'%'};return _0x107c7d;}})});}_0x943c4d=_['merge']({},_0x943c4d,_0x10090c['options']);var _0x2de2b0={'where':_0x943c4d[_0xe467('0x3e')]};return db[_0xe467('0x44')]['count'](_0x2de2b0)[_0xe467('0x26')](function(_0x4f338a){_0xe3f328[_0xe467('0x20')]=_0x4f338a;if(_0x10090c[_0xe467('0x34')][_0xe467('0x45')]){_0x943c4d['include']=[{'all':!![]}];}return db[_0xe467('0x44')]['findAll'](_0x943c4d);})['then'](function(_0x4e4604){_0xe3f328[_0xe467('0x46')]=_0x4e4604;return _0xe3f328;})[_0xe467('0x26')](respondWithFilteredResult(_0x3c548a,_0x943c4d))[_0xe467('0x47')](handleError(_0x3c548a,null));};exports['show']=function(_0x5a799a,_0x542fed){var _0x3583bf={'raw':![],'where':{'id':_0x5a799a['params']['id']}},_0x1c57c4={};_0x1c57c4[_0xe467('0x32')]=_[_0xe467('0x48')](db['Dashboard'][_0xe467('0x30')]);_0x1c57c4[_0xe467('0x34')]=_['keys'](_0x5a799a['query']);_0x1c57c4['filters']=_[_0xe467('0x36')](_0x1c57c4[_0xe467('0x32')],_0x1c57c4['query']);_0x3583bf['attributes']=_[_0xe467('0x36')](_0x1c57c4[_0xe467('0x32')],qs[_0xe467('0x38')](_0x5a799a['query'][_0xe467('0x38')]));_0x3583bf['attributes']=_0x3583bf[_0xe467('0x37')]['length']?_0x3583bf[_0xe467('0x37')]:_0x1c57c4[_0xe467('0x32')];if(_0x5a799a[_0xe467('0x34')][_0xe467('0x45')]){_0x3583bf[_0xe467('0x49')]=[{'all':!![]}];}_0x3583bf=_[_0xe467('0x41')]({},_0x3583bf,_0x5a799a[_0xe467('0x4a')]);return db['Dashboard']['find'](_0x3583bf)[_0xe467('0x26')](handleEntityNotFound(_0x542fed,null))[_0xe467('0x26')](respondWithResult(_0x542fed,null))[_0xe467('0x47')](handleError(_0x542fed,null));};exports[_0xe467('0x4b')]=function(_0x39e739,_0x1309a1){return db[_0xe467('0x44')][_0xe467('0x4b')](_0x39e739[_0xe467('0x4c')],{})['then'](function(_0x5d8ce4){var _0x551154=_0x39e739['user'][_0xe467('0x27')]({'plain':!![]});if(!_0x551154)throw new Error(_0xe467('0x4d'));if(_0x551154[_0xe467('0x4e')]==='user'){var _0x52d66f=_0x5d8ce4['get']({'plain':!![]});var _0x4b8fb4='CustomDashboards';return db[_0xe467('0x4f')][_0xe467('0x50')]({'where':{'name':_0x4b8fb4,'userProfileId':_0x551154[_0xe467('0x51')]},'raw':!![]})[_0xe467('0x26')](function(_0x199ba8){if(_0x199ba8&&_0x199ba8[_0xe467('0x52')]===0x0){return db[_0xe467('0x28')][_0xe467('0x4b')]({'name':_0x52d66f[_0xe467('0x2d')],'resourceId':_0x52d66f['id'],'type':_0x199ba8[_0xe467('0x2d')],'sectionId':_0x199ba8['id']},{})['then'](function(){return _0x5d8ce4;});}else{return _0x5d8ce4;}})['catch'](function(_0x4e71cb){logger[_0xe467('0x2b')](_0xe467('0x53'),_0x4e71cb);throw _0x4e71cb;});}return _0x5d8ce4;})[_0xe467('0x26')](respondWithResult(_0x1309a1,0xc9))[_0xe467('0x47')](handleError(_0x1309a1,null));};exports[_0xe467('0x54')]=function(_0x4a7549,_0x10a765){var _0x2ebad8={'where':{'id':_0x4a7549[_0xe467('0x55')]['id']}},_0xe2539f={};_0xe2539f['model']=_[_0xe467('0x48')](db[_0xe467('0x44')]['rawAttributes']);_0x2ebad8['attributes']=_[_0xe467('0x36')](_0xe2539f[_0xe467('0x32')],qs[_0xe467('0x38')](_0x4a7549[_0xe467('0x34')][_0xe467('0x38')]));_0x2ebad8[_0xe467('0x37')]=_0x2ebad8[_0xe467('0x37')][_0xe467('0x39')]?_0x2ebad8['attributes']:_0xe2539f[_0xe467('0x32')];if(_0x4a7549[_0xe467('0x34')]['includeAll']){_0x2ebad8[_0xe467('0x49')]=[{'all':!![]}];}_0x2ebad8=_['merge']({},_0x2ebad8,_0x4a7549['options']);return db[_0xe467('0x44')][_0xe467('0x50')](_0x2ebad8)[_0xe467('0x26')](handleEntityNotFound(_0x10a765,null))['then'](function(_0x7c1292){if(_0x7c1292){var _0x3518a0=_0x7c1292[_0xe467('0x27')]({'plain':!![]});_0x3518a0=qs[_0xe467('0x56')](_0x3518a0,['id','createdAt','updatedAt']);_0x4a7549[_0xe467('0x4c')]=_['omit'](_0x4a7549[_0xe467('0x4c')],['id','createdAt',_0xe467('0x57')]);return db['Dashboard'][_0xe467('0x4b')](_['merge'](_0x3518a0,_0x4a7549[_0xe467('0x4c')]),{'include':_0x4a7549[_0xe467('0x34')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x24d86b){var _0x1fff1f=_0x4a7549['user'][_0xe467('0x27')]({'plain':!![]});if(!_0x1fff1f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fff1f['role']===_0xe467('0x58')){var _0x474f24=_0x24d86b['get']({'plain':!![]});var _0x3ab73a=_0xe467('0x59');return db[_0xe467('0x4f')][_0xe467('0x50')]({'where':{'name':_0x3ab73a,'userProfileId':_0x1fff1f['userProfileId']},'raw':!![]})['then'](function(_0x27928c){if(_0x27928c&&_0x27928c[_0xe467('0x52')]===0x0){return db[_0xe467('0x28')]['create']({'name':_0x474f24[_0xe467('0x2d')],'resourceId':_0x474f24['id'],'type':_0x27928c[_0xe467('0x2d')],'sectionId':_0x27928c['id']},{})[_0xe467('0x26')](function(){return _0x24d86b;});}else{return _0x24d86b;}})[_0xe467('0x47')](function(_0x2b8692){logger['error'](_0xe467('0x53'),_0x2b8692);throw _0x2b8692;});}return _0x24d86b;});}})[_0xe467('0x26')](respondWithResult(_0x10a765,0xc9))[_0xe467('0x47')](handleError(_0x10a765,null));};exports['update']=function(_0x2063cf,_0xd0e888){if(_0x2063cf[_0xe467('0x4c')]['id']){delete _0x2063cf[_0xe467('0x4c')]['id'];}return db[_0xe467('0x44')][_0xe467('0x50')]({'where':{'id':_0x2063cf[_0xe467('0x55')]['id']}})[_0xe467('0x26')](handleEntityNotFound(_0xd0e888,null))['then'](saveUpdates(_0x2063cf[_0xe467('0x4c')],null))[_0xe467('0x26')](respondWithResult(_0xd0e888,null))[_0xe467('0x47')](handleError(_0xd0e888,null));};exports[_0xe467('0x29')]=function(_0xfb2947,_0xea4f7e){return db[_0xe467('0x44')][_0xe467('0x50')]({'where':{'id':_0xfb2947['params']['id']}})[_0xe467('0x26')](handleEntityNotFound(_0xea4f7e,null))[_0xe467('0x26')](removeEntity(_0xea4f7e,null))[_0xe467('0x47')](handleError(_0xea4f7e,null));};function widgetAttributes(_0x65287c){try{switch(_0x65287c[_0xe467('0x42')]){case _0xe467('0x5a'):return[{'name':_0xe467('0x5b'),'value':_0x65287c['attrUrl']||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x0]?_0x65287c[_0xe467('0x5c')][0x0]['value']:undefined)||_0xe467('0x5d')}];case'custom':return[{'name':_0xe467('0x5e'),'value':_0x65287c[_0xe467('0x5e')]||(_0x65287c['attrs']&&_0x65287c[_0xe467('0x5c')][0x0]?_0x65287c[_0xe467('0x5c')][0x0][_0xe467('0x5f')]:undefined)||''}];case _0xe467('0x60'):return[{'name':_0xe467('0x61'),'value':_0x65287c[_0xe467('0x61')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x0]?_0x65287c[_0xe467('0x5c')][0x0]['value']:undefined)||_0xe467('0x62')},{'name':_0xe467('0x63'),'value':_0x65287c[_0xe467('0x63')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x1]?_0x65287c[_0xe467('0x5c')][0x1][_0xe467('0x5f')]:undefined)||_0xe467('0x64')},{'name':_0xe467('0x65'),'value':_0x65287c['attrFontSize']||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x2]?_0x65287c['attrs'][0x2][_0xe467('0x5f')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x65287c['attrMetric']||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x0]?_0x65287c[_0xe467('0x5c')][0x0][_0xe467('0x5f')]:undefined)||'total'},{'name':_0xe467('0x66'),'value':_0x65287c[_0xe467('0x66')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x1]?_0x65287c['attrs'][0x1][_0xe467('0x5f')]:undefined)||[]},{'name':_0xe467('0x65'),'value':_0x65287c['attrFontSize']||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x2]?_0x65287c[_0xe467('0x5c')][0x2][_0xe467('0x5f')]:undefined)||0x14},{'name':_0xe467('0x67'),'value':_0x65287c[_0xe467('0x67')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x3]?_0x65287c['attrs'][0x3][_0xe467('0x5f')]:undefined)||'voice'},{'name':_0xe467('0x68'),'value':_0x65287c[_0xe467('0x68')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x4]?_0x65287c[_0xe467('0x5c')][0x4]['value']:undefined)||''},{'name':_0xe467('0x69'),'value':_0x65287c['attrFaxAccounts']||(_0x65287c['attrs']&&_0x65287c[_0xe467('0x5c')][0x5]?_0x65287c[_0xe467('0x5c')][0x5]['value']:undefined)||''},{'name':_0xe467('0x6a'),'value':_0x65287c[_0xe467('0x6a')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x6]?_0x65287c[_0xe467('0x5c')][0x6][_0xe467('0x5f')]:undefined)||''},{'name':_0xe467('0x6b'),'value':_0x65287c[_0xe467('0x6b')]||(_0x65287c['attrs']&&_0x65287c[_0xe467('0x5c')][0x7]?_0x65287c['attrs'][0x7]['value']:undefined)||''},{'name':_0xe467('0x6c'),'value':_0x65287c['attrWhatsappAccounts']||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x8]?_0x65287c['attrs'][0x8]['value']:undefined)||''},{'name':_0xe467('0x6d'),'value':_0x65287c['attrChatWebsites']||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x9]?_0x65287c['attrs'][0x9][_0xe467('0x5f')]:undefined)||''}];case'multibar-chart':case _0xe467('0x6e'):return[{'name':_0xe467('0x6f'),'value':_0x65287c[_0xe467('0x6f')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x0]?_0x65287c[_0xe467('0x5c')][0x0][_0xe467('0x5f')]:undefined)||'total'},{'name':_0xe467('0x70'),'value':_0x65287c[_0xe467('0x70')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c['attrs'][0x1]?_0x65287c[_0xe467('0x5c')][0x1][_0xe467('0x5f')]:undefined)||null},{'name':_0xe467('0x71'),'value':_0x65287c['attrSerie3']||(_0x65287c['attrs']&&_0x65287c[_0xe467('0x5c')][0x2]?_0x65287c[_0xe467('0x5c')][0x2][_0xe467('0x5f')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x65287c[_0xe467('0x66')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x3]?_0x65287c['attrs'][0x3]['value']:undefined)||[]},{'name':_0xe467('0x67'),'value':_0x65287c[_0xe467('0x67')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x4]?_0x65287c['attrs'][0x4][_0xe467('0x5f')]:undefined)||_0xe467('0x72')},{'name':_0xe467('0x68'),'value':_0x65287c['attrEmailAccounts']||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0x5]?_0x65287c[_0xe467('0x5c')][0x5][_0xe467('0x5f')]:undefined)||''},{'name':_0xe467('0x69'),'value':_0x65287c[_0xe467('0x69')]||(_0x65287c['attrs']&&_0x65287c[_0xe467('0x5c')][0x6]?_0x65287c[_0xe467('0x5c')][0x6][_0xe467('0x5f')]:undefined)||''},{'name':_0xe467('0x6a'),'value':_0x65287c[_0xe467('0x6a')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c['attrs'][0x7]?_0x65287c['attrs'][0x7][_0xe467('0x5f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x65287c[_0xe467('0x6b')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c['attrs'][0x8]?_0x65287c[_0xe467('0x5c')][0x8][_0xe467('0x5f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x65287c['attrWhatsappAccounts']||(_0x65287c[_0xe467('0x5c')]&&_0x65287c['attrs'][0x9]?_0x65287c[_0xe467('0x5c')][0x9][_0xe467('0x5f')]:undefined)||''},{'name':_0xe467('0x6d'),'value':_0x65287c[_0xe467('0x6d')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c[_0xe467('0x5c')][0xa]?_0x65287c[_0xe467('0x5c')][0xa][_0xe467('0x5f')]:undefined)||''}];case'web-report':return[{'name':_0xe467('0x73'),'type':_0x65287c[_0xe467('0x74')]||(_0x65287c['attrs']&&_0x65287c['attrs'][0x0]?_0x65287c['attrs'][0x0][_0xe467('0x42')]:undefined)||null,'value':_0x65287c[_0xe467('0x73')]||(_0x65287c['attrs']&&_0x65287c[_0xe467('0x5c')][0x0]?_0x65287c['attrs'][0x0][_0xe467('0x5f')]:undefined)||null},{'name':_0xe467('0x75'),'value':_0x65287c[_0xe467('0x75')]||(_0x65287c[_0xe467('0x5c')]&&_0x65287c['attrs'][0x1]?_0x65287c[_0xe467('0x5c')][0x1][_0xe467('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x17188a){logger[_0xe467('0x2b')](_0xe467('0x76'),JSON['stringify'](_0x17188a));return[];}}exports[_0xe467('0x77')]=function(_0x401efb,_0x59b26d,_0x2fcdb9){if(_0x401efb[_0xe467('0x4c')]['id']){delete _0x401efb[_0xe467('0x4c')]['id'];}return db[_0xe467('0x44')][_0xe467('0x50')]({'where':{'id':_0x401efb[_0xe467('0x55')]['id']}})[_0xe467('0x26')](handleEntityNotFound(_0x59b26d,null))[_0xe467('0x26')](function(_0xd7f03f){if(_0xd7f03f){_0x401efb[_0xe467('0x4c')]['DashboardId']=_0xd7f03f['id'];_0x401efb[_0xe467('0x4c')][_0xe467('0x5c')]=widgetAttributes(_0x401efb['body']);return db[_0xe467('0x78')][_0xe467('0x4b')](_0x401efb[_0xe467('0x4c')]);}})[_0xe467('0x26')](respondWithResult(_0x59b26d,null))[_0xe467('0x47')](handleError(_0x59b26d,null));};exports[_0xe467('0x79')]=function(_0x1c458e,_0xc176c,_0x824ec8){var _0x33384d={};var _0x5e4705={};var _0x17e5a0;var _0x4b901e;return db[_0xe467('0x44')][_0xe467('0x7a')]({'where':{'id':_0x1c458e[_0xe467('0x55')]['id']}})[_0xe467('0x26')](handleEntityNotFound(_0xc176c,null))[_0xe467('0x26')](function(_0x374226){if(_0x374226){_0x17e5a0=_0x374226;_0x5e4705[_0xe467('0x32')]=_['keys'](db[_0xe467('0x78')][_0xe467('0x30')]);_0x5e4705[_0xe467('0x34')]=_[_0xe467('0x48')](_0x1c458e[_0xe467('0x34')]);_0x5e4705[_0xe467('0x35')]=_[_0xe467('0x36')](_0x5e4705['model'],_0x5e4705[_0xe467('0x34')]);_0x33384d['attributes']=_['intersection'](_0x5e4705['model'],qs['fields'](_0x1c458e[_0xe467('0x34')][_0xe467('0x38')]));_0x33384d[_0xe467('0x37')]=_0x33384d[_0xe467('0x37')][_0xe467('0x39')]?_0x33384d[_0xe467('0x37')]:_0x5e4705[_0xe467('0x32')];_0x33384d[_0xe467('0x3c')]=qs[_0xe467('0x3d')](_0x1c458e[_0xe467('0x34')][_0xe467('0x3d')]);_0x33384d[_0xe467('0x3e')]=qs[_0xe467('0x35')](_[_0xe467('0x3f')](_0x1c458e['query'],_0x5e4705[_0xe467('0x35')]));if(_0x1c458e[_0xe467('0x34')][_0xe467('0x40')]){_0x33384d[_0xe467('0x3e')]=_[_0xe467('0x41')](_0x33384d['where'],{'$or':_['map'](_0x33384d[_0xe467('0x37')],function(_0x7ac53f){var _0x564b52={};_0x564b52[_0x7ac53f]={'$like':'%'+_0x1c458e['query']['filter']+'%'};return _0x564b52;})});}_0x33384d=_[_0xe467('0x41')]({},_0x33384d,_0x1c458e[_0xe467('0x4a')]);return _0x17e5a0[_0xe467('0x79')](_0x33384d);}})['then'](function(_0x60fa99){if(_0x60fa99){_0x4b901e=_0x60fa99[_0xe467('0x39')];if(!_0x1c458e['query'][_0xe467('0x3a')](_0xe467('0x3b'))){_0x33384d[_0xe467('0x1f')]=qs[_0xe467('0x1f')](_0x1c458e[_0xe467('0x34')]['limit']);_0x33384d[_0xe467('0x1d')]=qs[_0xe467('0x1d')](_0x1c458e[_0xe467('0x34')][_0xe467('0x1d')]);}return _0x17e5a0[_0xe467('0x79')](_0x33384d);}})[_0xe467('0x26')](function(_0x1f6807){if(_0x1f6807){return _0x1f6807?{'count':_0x4b901e,'rows':_0x1f6807}:null;}})[_0xe467('0x26')](respondWithResult(_0xc176c,null))[_0xe467('0x47')](handleError(_0xc176c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index de3cb02..f45b534 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 _0xb6d4=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6d4,0x16c));var _0x4b6d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6d4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4b6d('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4b6d('0x1')](0x0);var events={'afterCreate':_0x4b6d('0x2'),'afterUpdate':_0x4b6d('0x3'),'afterDestroy':_0x4b6d('0x4')};function emitEvent(_0x1914a0){return function(_0x598386,_0x4442c2,_0x201dfe){DashboardEvents[_0x4b6d('0x5')](_0x1914a0+':'+_0x598386['id'],_0x598386);DashboardEvents[_0x4b6d('0x5')](_0x1914a0,_0x598386);_0x201dfe(null);};}for(var e in events){if(events[_0x4b6d('0x6')](e)){var event=events[e];Dashboard[_0x4b6d('0x7')](e,emitEvent(event));}}module[_0x4b6d('0x8')]=DashboardEvents; \ No newline at end of file +var _0x957a=['exports','events','../../mysqldb','Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x502ebe,_0x565a5a){var _0x2ef7ae=function(_0x27993d){while(--_0x27993d){_0x502ebe['push'](_0x502ebe['shift']());}};_0x2ef7ae(++_0x565a5a);}(_0x957a,0x137));var _0xa957=function(_0x2c8d02,_0x44804b){_0x2c8d02=_0x2c8d02-0x0;var _0x57cf74=_0x957a[_0x2c8d02];return _0x57cf74;};'use strict';var EventEmitter=require(_0xa957('0x0'));var Dashboard=require(_0xa957('0x1'))['db'][_0xa957('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa957('0x3')](0x0);var events={'afterCreate':_0xa957('0x4'),'afterUpdate':'update','afterDestroy':_0xa957('0x5')};function emitEvent(_0x183683){return function(_0xc8b878,_0x12280e,_0x304537){DashboardEvents[_0xa957('0x6')](_0x183683+':'+_0xc8b878['id'],_0xc8b878);DashboardEvents[_0xa957('0x6')](_0x183683,_0xc8b878);_0x304537(null);};}for(var e in events){if(events[_0xa957('0x7')](e)){var event=events[e];Dashboard[_0xa957('0x8')](e,emitEvent(event));}}module[_0xa957('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 0901437..73aa69a 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 _0x8b09=['dashboards','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard'];(function(_0x2bfc9c,_0x2866d6){var _0x30db44=function(_0x154a14){while(--_0x154a14){_0x2bfc9c['push'](_0x2bfc9c['shift']());}};_0x30db44(++_0x2866d6);}(_0x8b09,0x153));var _0x98b0=function(_0x34e4c4,_0x1b73cb){_0x34e4c4=_0x34e4c4-0x0;var _0x323bea=_0x8b09[_0x34e4c4];return _0x323bea;};'use strict';var _=require(_0x98b0('0x0'));var util=require(_0x98b0('0x1'));var logger=require(_0x98b0('0x2'))(_0x98b0('0x3'));var moment=require(_0x98b0('0x4'));var BPromise=require(_0x98b0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98b0('0x6'));var rimraf=require('rimraf');var config=require(_0x98b0('0x7'));var attributes=require(_0x98b0('0x8'));module[_0x98b0('0x9')]=function(_0x2c83d7,_0x3ca831){return _0x2c83d7[_0x98b0('0xa')](_0x98b0('0xb'),attributes,{'tableName':_0x98b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdc0=['path','rimraf','exports','define','Dashboard','dashboards','lodash','util','api','bluebird'];(function(_0x5a41f2,_0x5d2142){var _0x56503c=function(_0x7b8f0a){while(--_0x7b8f0a){_0x5a41f2['push'](_0x5a41f2['shift']());}};_0x56503c(++_0x5d2142);}(_0xcdc0,0xce));var _0x0cdc=function(_0x3c20e9,_0x575bbc){_0x3c20e9=_0x3c20e9-0x0;var _0x19e15d=_0xcdc0[_0x3c20e9];return _0x19e15d;};'use strict';var _=require(_0x0cdc('0x0'));var util=require(_0x0cdc('0x1'));var logger=require('../../config/logger')(_0x0cdc('0x2'));var moment=require('moment');var BPromise=require(_0x0cdc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cdc('0x4'));var rimraf=require(_0x0cdc('0x5'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x0cdc('0x6')]=function(_0x2a667b,_0x3dc154){return _0x2a667b[_0x0cdc('0x7')](_0x0cdc('0x8'),attributes,{'tableName':_0x0cdc('0x9'),'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 83c532d..fc46911 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 _0x61c5=['util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./dashboard.socket','register','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x61c5,0x12b));var _0x561c=function(_0x271a22,_0xef764b){_0x271a22=_0x271a22-0x0;var _0x26431b=_0x61c5[_0x271a22];return _0x26431b;};'use strict';var _=require(_0x561c('0x0'));var util=require(_0x561c('0x1'));var moment=require('moment');var BPromise=require(_0x561c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x561c('0x3'));var logger=require(_0x561c('0x4'))('rpc');var config=require(_0x561c('0x5'));var jayson=require(_0x561c('0x6'));var client=jayson[_0x561c('0x7')]['http']({'port':0x232a});config['redis']=_[_0x561c('0x8')](config['redis'],{'host':_0x561c('0x9'),'port':0x18eb});var socket=require(_0x561c('0xa'))(new Redis(config[_0x561c('0xb')]));require(_0x561c('0xc'))[_0x561c('0xd')](socket);function respondWithRpcPromise(_0x161c5a,_0x1ac982,_0x3dfcfe){return new BPromise(function(_0x216b42,_0x23ee97){return client['request'](_0x161c5a,_0x3dfcfe)[_0x561c('0xe')](function(_0x7c9322){logger['info'](_0x561c('0xf'),_0x1ac982,_0x561c('0x10'));logger['debug'](_0x561c('0x11'),_0x1ac982,_0x561c('0x10'),JSON[_0x561c('0x12')](_0x7c9322));if(_0x7c9322[_0x561c('0x13')]){if(_0x7c9322[_0x561c('0x13')][_0x561c('0x14')]===0x1f4){logger[_0x561c('0x13')]('Dashboard,\x20%s,\x20%s',_0x1ac982,_0x7c9322['error'][_0x561c('0x15')]);return _0x23ee97(_0x7c9322['error'][_0x561c('0x15')]);}logger[_0x561c('0x13')](_0x561c('0xf'),_0x1ac982,_0x7c9322[_0x561c('0x13')][_0x561c('0x15')]);return _0x216b42(_0x7c9322['error'][_0x561c('0x15')]);}else{logger[_0x561c('0x16')](_0x561c('0xf'),_0x1ac982,_0x561c('0x10'));_0x216b42(_0x7c9322[_0x561c('0x17')][_0x561c('0x15')]);}})[_0x561c('0x18')](function(_0x29ec87){logger[_0x561c('0x13')]('Dashboard,\x20%s,\x20%s',_0x1ac982,_0x29ec87);_0x23ee97(_0x29ec87);});});} \ No newline at end of file +var _0x87b6=['redis','defaults','localhost','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x87b6,0xcc));var _0x687b=function(_0x54483e,_0x207a77){_0x54483e=_0x54483e-0x0;var _0x286d76=_0x87b6[_0x54483e];return _0x286d76;};'use strict';var _=require(_0x687b('0x0'));var util=require(_0x687b('0x1'));var moment=require(_0x687b('0x2'));var BPromise=require('bluebird');var rs=require(_0x687b('0x3'));var fs=require('fs');var Redis=require(_0x687b('0x4'));var db=require(_0x687b('0x5'))['db'];var utils=require(_0x687b('0x6'));var logger=require(_0x687b('0x7'))(_0x687b('0x8'));var config=require(_0x687b('0x9'));var jayson=require(_0x687b('0xa'));var client=jayson['client'][_0x687b('0xb')]({'port':0x232a});config[_0x687b('0xc')]=_[_0x687b('0xd')](config[_0x687b('0xc')],{'host':_0x687b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x3b4d92,_0x3770d0,_0x312b25){return new BPromise(function(_0x2dfb47,_0x2f7359){return client['request'](_0x3b4d92,_0x312b25)[_0x687b('0xf')](function(_0x53a5bc){logger[_0x687b('0x10')](_0x687b('0x11'),_0x3770d0,'request\x20sent');logger[_0x687b('0x12')](_0x687b('0x13'),_0x3770d0,_0x687b('0x14'),JSON[_0x687b('0x15')](_0x53a5bc));if(_0x53a5bc['error']){if(_0x53a5bc[_0x687b('0x16')][_0x687b('0x17')]===0x1f4){logger['error'](_0x687b('0x11'),_0x3770d0,_0x53a5bc[_0x687b('0x16')][_0x687b('0x18')]);return _0x2f7359(_0x53a5bc[_0x687b('0x16')][_0x687b('0x18')]);}logger[_0x687b('0x16')]('Dashboard,\x20%s,\x20%s',_0x3770d0,_0x53a5bc[_0x687b('0x16')][_0x687b('0x18')]);return _0x2dfb47(_0x53a5bc['error']['message']);}else{logger[_0x687b('0x10')]('Dashboard,\x20%s,\x20%s',_0x3770d0,_0x687b('0x14'));_0x2dfb47(_0x53a5bc[_0x687b('0x19')][_0x687b('0x18')]);}})[_0x687b('0x1a')](function(_0x247994){logger[_0x687b('0x16')]('Dashboard,\x20%s,\x20%s',_0x3770d0,_0x247994);_0x2f7359(_0x247994);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index bba6b89..d0faabc 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 _0xcf47=['register','length','dashboard:','./dashboard.events','save','removeListener'];(function(_0x1465c4,_0x2cde93){var _0x137fc6=function(_0x57ce4e){while(--_0x57ce4e){_0x1465c4['push'](_0x1465c4['shift']());}};_0x137fc6(++_0x2cde93);}(_0xcf47,0x189));var _0x7cf4=function(_0x398dda,_0xa77418){_0x398dda=_0x398dda-0x0;var _0x312bbf=_0xcf47[_0x398dda];return _0x312bbf;};'use strict';var DashboardEvents=require(_0x7cf4('0x0'));var events=[_0x7cf4('0x1'),'remove','update'];function createListener(_0x4df5bf,_0x5a6004){return function(_0x271df6){_0x5a6004['emit'](_0x4df5bf,_0x271df6);};}function removeListener(_0x2b4d8d,_0x3c4f80){return function(){DashboardEvents[_0x7cf4('0x2')](_0x2b4d8d,_0x3c4f80);};}exports[_0x7cf4('0x3')]=function(_0x29e080){for(var _0x7d060d=0x0,_0x2980e5=events[_0x7cf4('0x4')];_0x7d060d<_0x2980e5;_0x7d060d++){var _0x2ef033=events[_0x7d060d];var _0x822684=createListener(_0x7cf4('0x5')+_0x2ef033,_0x29e080);DashboardEvents['on'](_0x2ef033,_0x822684);}}; \ No newline at end of file +var _0xe688=['register','length','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x7655ab,_0x18066f){var _0x2b0e88=function(_0x45534c){while(--_0x45534c){_0x7655ab['push'](_0x7655ab['shift']());}};_0x2b0e88(++_0x18066f);}(_0xe688,0x18a));var _0x8e68=function(_0xd685a3,_0x39b3c1){_0xd685a3=_0xd685a3-0x0;var _0x232973=_0xe688[_0xd685a3];return _0x232973;};'use strict';var DashboardEvents=require(_0x8e68('0x0'));var events=[_0x8e68('0x1'),_0x8e68('0x2'),_0x8e68('0x3')];function createListener(_0x6b2b7c,_0x3a5477){return function(_0x4f7464){_0x3a5477[_0x8e68('0x4')](_0x6b2b7c,_0x4f7464);};}function removeListener(_0x4d0d14,_0x1de7bb){return function(){DashboardEvents[_0x8e68('0x5')](_0x4d0d14,_0x1de7bb);};}exports[_0x8e68('0x6')]=function(_0x3323d6){for(var _0x47003e=0x0,_0x36ae87=events[_0x8e68('0x7')];_0x47003e<_0x36ae87;_0x47003e++){var _0x40e123=events[_0x47003e];var _0x5abfe2=createListener('dashboard:'+_0x40e123,_0x3323d6);DashboardEvents['on'](_0x40e123,_0x5abfe2);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 8ece3ce..e8a7365 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 _0xd2ec=['/:id/clone','clone','addItem','put','/:id','update','delete','destroy','exports','path','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/items','post','create'];(function(_0x3b98f6,_0x1ef63e){var _0x39f4b2=function(_0x5cc876){while(--_0x5cc876){_0x3b98f6['push'](_0x3b98f6['shift']());}};_0x39f4b2(++_0x1ef63e);}(_0xd2ec,0xa9));var _0xcd2e=function(_0x4befae,_0x55b079){_0x4befae=_0x4befae-0x0;var _0x76c573=_0xd2ec[_0x4befae];return _0x76c573;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcd2e('0x0'));var timeout=require(_0xcd2e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcd2e('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xcd2e('0x3'));var controller=require('./dashboard.controller');router[_0xcd2e('0x4')]('/',auth[_0xcd2e('0x5')](),controller[_0xcd2e('0x6')]);router[_0xcd2e('0x4')]('/:id',auth[_0xcd2e('0x5')](),controller[_0xcd2e('0x7')]);router[_0xcd2e('0x4')](_0xcd2e('0x8'),auth[_0xcd2e('0x5')](),controller['getItems']);router[_0xcd2e('0x9')]('/',auth['isAuthenticated'](),controller[_0xcd2e('0xa')]);router['post'](_0xcd2e('0xb'),auth['isAuthenticated'](),controller[_0xcd2e('0xc')]);router[_0xcd2e('0x9')](_0xcd2e('0x8'),auth[_0xcd2e('0x5')](),controller[_0xcd2e('0xd')]);router[_0xcd2e('0xe')](_0xcd2e('0xf'),auth[_0xcd2e('0x5')](),controller[_0xcd2e('0x10')]);router[_0xcd2e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xcd2e('0x12')]);module[_0xcd2e('0x13')]=router; \ No newline at end of file +var _0x22be=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','create','/:id/clone','clone','addItem','update'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x22be,0x15c));var _0xe22b=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0x22be[_0x17b0d4];return _0x2d02c7;};'use strict';var multer=require('multer');var util=require(_0xe22b('0x0'));var path=require('path');var timeout=require(_0xe22b('0x1'));var express=require(_0xe22b('0x2'));var router=express[_0xe22b('0x3')]();var fs_extra=require(_0xe22b('0x4'));var auth=require(_0xe22b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe22b('0x6'));var controller=require(_0xe22b('0x7'));router[_0xe22b('0x8')]('/',auth[_0xe22b('0x9')](),controller[_0xe22b('0xa')]);router[_0xe22b('0x8')](_0xe22b('0xb'),auth[_0xe22b('0x9')](),controller[_0xe22b('0xc')]);router[_0xe22b('0x8')](_0xe22b('0xd'),auth[_0xe22b('0x9')](),controller['getItems']);router[_0xe22b('0xe')]('/',auth['isAuthenticated'](),controller[_0xe22b('0xf')]);router[_0xe22b('0xe')](_0xe22b('0x10'),auth[_0xe22b('0x9')](),controller[_0xe22b('0x11')]);router['post'](_0xe22b('0xd'),auth['isAuthenticated'](),controller[_0xe22b('0x12')]);router['put'](_0xe22b('0xb'),auth[_0xe22b('0x9')](),controller[_0xe22b('0x13')]);router[_0xe22b('0x14')](_0xe22b('0xb'),auth['isAuthenticated'](),controller[_0xe22b('0x15')]);module[_0xe22b('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index cb6423e..2d01146 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 _0xeda8=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','#ffffff','sequelize','squel','exports','STRING'];(function(_0x84293f,_0x1b4173){var _0x15a611=function(_0x32f46b){while(--_0x32f46b){_0x84293f['push'](_0x84293f['shift']());}};_0x15a611(++_0x1b4173);}(_0xeda8,0x104));var _0x8eda=function(_0x1e11fa,_0x537790){_0x1e11fa=_0x1e11fa-0x0;var _0x3b9b1e=_0xeda8[_0x1e11fa];return _0x3b9b1e;};'use strict';var Sequelize=require(_0x8eda('0x0'));var squel=require(_0x8eda('0x1'));var _=require('lodash');module[_0x8eda('0x2')]={'title':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eda('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8eda('0x4')](_0x8eda('0x5')),'get':function(){try{return JSON[_0x8eda('0x6')](this[_0x8eda('0x7')](_0x8eda('0x8')));}catch(_0x22dee9){return[];}},'set':function(_0x1f3556){try{this[_0x8eda('0x9')](_0x8eda('0x8'),JSON['stringify'](_0x1f3556));}catch(_0x28b721){this[_0x8eda('0x9')](_0x8eda('0x8'),JSON[_0x8eda('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':_0x8eda('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eda('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x6f47=['#ffffff','squel','lodash','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x45534a,_0x11d6d9){var _0x2f52c5=function(_0x168988){while(--_0x168988){_0x45534a['push'](_0x45534a['shift']());}};_0x2f52c5(++_0x11d6d9);}(_0x6f47,0xc7));var _0x76f4=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x6f47[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));module['exports']={'title':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x76f4('0x3')]('long'),'get':function(){try{return JSON[_0x76f4('0x4')](this[_0x76f4('0x5')](_0x76f4('0x6')));}catch(_0x2523ba){return[];}},'set':function(_0x5754ca){try{this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')](_0x5754ca));}catch(_0x497f99){this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![],'defaultValue':_0x76f4('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x76f4('0x2')]},'titleFontSize':{'type':Sequelize[_0x76f4('0x9')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 30e3ae4..3b06049 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 _0x5f71=['attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrEmailAccounts','attrSmsAccounts','web-report','attrReport','type','attrRefresh','error','widgetAttributes:\x20%s','create','body','update','eml-format','zip-dir','request-promise','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','name','send','show','params','model','DashboardItem','query','filters','intersection','fields','attributes','length','include','options','find','catch','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts'];(function(_0x2a3360,_0x4db163){var _0x36a615=function(_0x3cabf0){while(--_0x3cabf0){_0x2a3360['push'](_0x2a3360['shift']());}};_0x36a615(++_0x4db163);}(_0x5f71,0xc9));var _0x15f7=function(_0x4b646d,_0x1c2a50){_0x4b646d=_0x4b646d-0x0;var _0x4935ee=_0x5f71[_0x4b646d];return _0x4935ee;};'use strict';var emlformat=require(_0x15f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15f7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15f7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15f7('0x3'));var path=require(_0x15f7('0x4'));var sox=require('sox');var csv=require(_0x15f7('0x5'));var ejs=require(_0x15f7('0x6'));var fs=require('fs');var fs_extra=require(_0x15f7('0x7'));var _=require(_0x15f7('0x8'));var squel=require(_0x15f7('0x9'));var crypto=require(_0x15f7('0xa'));var jsforce=require(_0x15f7('0xb'));var deskjs=require(_0x15f7('0xc'));var toCsv=require(_0x15f7('0x5'));var querystring=require(_0x15f7('0xd'));var Papa=require(_0x15f7('0xe'));var Redis=require(_0x15f7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x15f7('0x10'));var hardwareService=require(_0x15f7('0x11'));var logger=require('../../config/logger')(_0x15f7('0x12'));var utils=require(_0x15f7('0x13'));var config=require(_0x15f7('0x14'));var licenseUtil=require(_0x15f7('0x15'));var db=require(_0x15f7('0x16'))['db'];config[_0x15f7('0x17')]=_[_0x15f7('0x18')](config['redis'],{'host':_0x15f7('0x19'),'port':0x18eb});var socket=require(_0x15f7('0x1a'))(new Redis(config[_0x15f7('0x17')]));require('./dashboardItem.socket')[_0x15f7('0x1b')](socket);function respondWithStatusCode(_0x40dcb1,_0x52c1be){_0x52c1be=_0x52c1be||0xcc;return function(_0x24b6f5){if(_0x24b6f5){return _0x40dcb1[_0x15f7('0x1c')](_0x52c1be);}return _0x40dcb1[_0x15f7('0x1d')](_0x52c1be)[_0x15f7('0x1e')]();};}function respondWithResult(_0x345892,_0x2c0e67){_0x2c0e67=_0x2c0e67||0xc8;return function(_0x42928d){if(_0x42928d){return _0x345892['status'](_0x2c0e67)[_0x15f7('0x1f')](_0x42928d);}};}function respondWithFilteredResult(_0x385844,_0x4e61c9){return function(_0x2c78ca){if(_0x2c78ca){var _0x333ff8=typeof _0x4e61c9[_0x15f7('0x20')]===_0x15f7('0x21')&&typeof _0x4e61c9[_0x15f7('0x22')]===_0x15f7('0x21');var _0x3ced97=_0x2c78ca['count'];var _0x299fcf=_0x333ff8?0x0:_0x4e61c9[_0x15f7('0x20')];var _0x1362e1=_0x333ff8?_0x2c78ca[_0x15f7('0x23')]:_0x4e61c9[_0x15f7('0x20')]+_0x4e61c9[_0x15f7('0x22')];var _0x3bf068;if(_0x1362e1>=_0x3ced97){_0x1362e1=_0x3ced97;_0x3bf068=0xc8;}else{_0x3bf068=0xce;}_0x385844['status'](_0x3bf068);return _0x385844['set'](_0x15f7('0x24'),_0x299fcf+'-'+_0x1362e1+'/'+_0x3ced97)[_0x15f7('0x1f')](_0x2c78ca);}return null;};}function patchUpdates(_0x370652){return function(_0x35de93){try{jsonpatch[_0x15f7('0x25')](_0x35de93,_0x370652,!![]);}catch(_0x5cab58){return BPromise[_0x15f7('0x26')](_0x5cab58);}return _0x35de93['save']();};}function saveUpdates(_0x292958,_0xe6ec62){return function(_0x49fc13){if(_0x49fc13){return _0x49fc13['update'](_0x292958)[_0x15f7('0x27')](function(_0x5a1e21){return _0x5a1e21;});}return null;};}function removeEntity(_0x53128c,_0x2928fa){return function(_0x5de827){if(_0x5de827){return _0x5de827[_0x15f7('0x28')]()[_0x15f7('0x27')](function(){_0x53128c[_0x15f7('0x1d')](0xcc)[_0x15f7('0x1e')]();});}};}function handleEntityNotFound(_0x2d4d2d,_0x59b9e2){return function(_0x3adf28){if(!_0x3adf28){_0x2d4d2d[_0x15f7('0x1c')](0x194);}return _0x3adf28;};}function handleError(_0x1b50ed,_0x48f27c){_0x48f27c=_0x48f27c||0x1f4;return function(_0x4dd3d6){logger['error'](_0x4dd3d6['stack']);if(_0x4dd3d6[_0x15f7('0x29')]){delete _0x4dd3d6[_0x15f7('0x29')];}_0x1b50ed[_0x15f7('0x1d')](_0x48f27c)[_0x15f7('0x2a')](_0x4dd3d6);};}exports[_0x15f7('0x2b')]=function(_0x477950,_0x5394b6){var _0x521934={'raw':![],'where':{'id':_0x477950[_0x15f7('0x2c')]['id']}},_0x31bf43={};_0x31bf43[_0x15f7('0x2d')]=_['keys'](db[_0x15f7('0x2e')]['rawAttributes']);_0x31bf43[_0x15f7('0x2f')]=_['keys'](_0x477950[_0x15f7('0x2f')]);_0x31bf43[_0x15f7('0x30')]=_[_0x15f7('0x31')](_0x31bf43[_0x15f7('0x2d')],_0x31bf43['query']);_0x521934['attributes']=_[_0x15f7('0x31')](_0x31bf43[_0x15f7('0x2d')],qs[_0x15f7('0x32')](_0x477950[_0x15f7('0x2f')][_0x15f7('0x32')]));_0x521934[_0x15f7('0x33')]=_0x521934[_0x15f7('0x33')][_0x15f7('0x34')]?_0x521934[_0x15f7('0x33')]:_0x31bf43[_0x15f7('0x2d')];if(_0x477950[_0x15f7('0x2f')]['includeAll']){_0x521934[_0x15f7('0x35')]=[{'all':!![]}];}_0x521934=_['merge']({},_0x521934,_0x477950[_0x15f7('0x36')]);return db[_0x15f7('0x2e')][_0x15f7('0x37')](_0x521934)[_0x15f7('0x27')](handleEntityNotFound(_0x5394b6,null))[_0x15f7('0x27')](respondWithResult(_0x5394b6,null))[_0x15f7('0x38')](handleError(_0x5394b6,null));};exports['destroy']=function(_0x1af447,_0x5a2343){return db[_0x15f7('0x2e')][_0x15f7('0x37')]({'where':{'id':_0x1af447[_0x15f7('0x2c')]['id']}})[_0x15f7('0x27')](handleEntityNotFound(_0x5a2343,null))[_0x15f7('0x27')](removeEntity(_0x5a2343,null))['catch'](handleError(_0x5a2343,null));};function widgetAttributes(_0x2c875e){try{switch(_0x2c875e['type']){case'iframe':return[{'name':_0x15f7('0x39'),'value':_0x2c875e['attrUrl']||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x0]?_0x2c875e[_0x15f7('0x3a')][0x0][_0x15f7('0x3b')]:undefined)||_0x15f7('0x3c')}];case _0x15f7('0x3d'):return[{'name':_0x15f7('0x3e'),'value':_0x2c875e['attrPath']||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e['attrs'][0x0]?_0x2c875e[_0x15f7('0x3a')][0x0][_0x15f7('0x3b')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x2c875e[_0x15f7('0x3f')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x0]?_0x2c875e[_0x15f7('0x3a')][0x0][_0x15f7('0x3b')]:undefined)||_0x15f7('0x40')},{'name':_0x15f7('0x41'),'value':_0x2c875e[_0x15f7('0x41')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x1]?_0x2c875e[_0x15f7('0x3a')][0x1][_0x15f7('0x3b')]:undefined)||'0.00'},{'name':_0x15f7('0x42'),'value':_0x2c875e[_0x15f7('0x42')]||(_0x2c875e['attrs']&&_0x2c875e[_0x15f7('0x3a')][0x2]?_0x2c875e[_0x15f7('0x3a')][0x2]['value']:undefined)||0xc}];case _0x15f7('0x43'):return[{'name':_0x15f7('0x44'),'value':_0x2c875e[_0x15f7('0x44')]||(_0x2c875e['attrs']&&_0x2c875e[_0x15f7('0x3a')][0x0]?_0x2c875e[_0x15f7('0x3a')][0x0][_0x15f7('0x3b')]:undefined)||'total'},{'name':_0x15f7('0x45'),'value':_0x2c875e['attrVoiceQueues']||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x1]?_0x2c875e[_0x15f7('0x3a')][0x1][_0x15f7('0x3b')]:undefined)||[]},{'name':_0x15f7('0x42'),'value':_0x2c875e[_0x15f7('0x42')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x2]?_0x2c875e[_0x15f7('0x3a')][0x2][_0x15f7('0x3b')]:undefined)||0x14},{'name':_0x15f7('0x46'),'value':_0x2c875e[_0x15f7('0x46')]||(_0x2c875e['attrs']&&_0x2c875e[_0x15f7('0x3a')][0x3]?_0x2c875e['attrs'][0x3][_0x15f7('0x3b')]:undefined)||_0x15f7('0x47')},{'name':'attrEmailAccounts','value':_0x2c875e['attrEmailAccounts']||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x4]?_0x2c875e[_0x15f7('0x3a')][0x4]['value']:undefined)||''},{'name':_0x15f7('0x48'),'value':_0x2c875e[_0x15f7('0x48')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x5]?_0x2c875e[_0x15f7('0x3a')][0x5][_0x15f7('0x3b')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x2c875e['attrSmsAccounts']||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e['attrs'][0x6]?_0x2c875e[_0x15f7('0x3a')][0x6][_0x15f7('0x3b')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2c875e[_0x15f7('0x49')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x7]?_0x2c875e[_0x15f7('0x3a')][0x7][_0x15f7('0x3b')]:undefined)||''},{'name':_0x15f7('0x4a'),'value':_0x2c875e[_0x15f7('0x4a')]||(_0x2c875e['attrs']&&_0x2c875e[_0x15f7('0x3a')][0x8]?_0x2c875e[_0x15f7('0x3a')][0x8][_0x15f7('0x3b')]:undefined)||''},{'name':_0x15f7('0x4b'),'value':_0x2c875e[_0x15f7('0x4b')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x9]?_0x2c875e['attrs'][0x9][_0x15f7('0x3b')]:undefined)||''}];case _0x15f7('0x4c'):case'pie-chart':return[{'name':_0x15f7('0x4d'),'value':_0x2c875e[_0x15f7('0x4d')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e['attrs'][0x0]?_0x2c875e[_0x15f7('0x3a')][0x0]['value']:undefined)||_0x15f7('0x4e')},{'name':_0x15f7('0x4f'),'value':_0x2c875e[_0x15f7('0x4f')]||(_0x2c875e['attrs']&&_0x2c875e[_0x15f7('0x3a')][0x1]?_0x2c875e[_0x15f7('0x3a')][0x1][_0x15f7('0x3b')]:undefined)||null},{'name':'attrSerie3','value':_0x2c875e[_0x15f7('0x50')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x2]?_0x2c875e[_0x15f7('0x3a')][0x2][_0x15f7('0x3b')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2c875e[_0x15f7('0x45')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e['attrs'][0x3]?_0x2c875e['attrs'][0x3]['value']:undefined)||[]},{'name':_0x15f7('0x46'),'value':_0x2c875e[_0x15f7('0x46')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e['attrs'][0x4]?_0x2c875e[_0x15f7('0x3a')][0x4][_0x15f7('0x3b')]:undefined)||'voice'},{'name':_0x15f7('0x51'),'value':_0x2c875e[_0x15f7('0x51')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x5]?_0x2c875e['attrs'][0x5][_0x15f7('0x3b')]:undefined)||''},{'name':_0x15f7('0x48'),'value':_0x2c875e[_0x15f7('0x48')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e['attrs'][0x6]?_0x2c875e[_0x15f7('0x3a')][0x6][_0x15f7('0x3b')]:undefined)||''},{'name':_0x15f7('0x52'),'value':_0x2c875e[_0x15f7('0x52')]||(_0x2c875e['attrs']&&_0x2c875e['attrs'][0x7]?_0x2c875e[_0x15f7('0x3a')][0x7][_0x15f7('0x3b')]:undefined)||''},{'name':_0x15f7('0x49'),'value':_0x2c875e['attrOpenchannelAccounts']||(_0x2c875e['attrs']&&_0x2c875e[_0x15f7('0x3a')][0x8]?_0x2c875e[_0x15f7('0x3a')][0x8][_0x15f7('0x3b')]:undefined)||''},{'name':_0x15f7('0x4a'),'value':_0x2c875e[_0x15f7('0x4a')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x9]?_0x2c875e[_0x15f7('0x3a')][0x9][_0x15f7('0x3b')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2c875e['attrChatWebsites']||(_0x2c875e['attrs']&&_0x2c875e[_0x15f7('0x3a')][0xa]?_0x2c875e[_0x15f7('0x3a')][0xa][_0x15f7('0x3b')]:undefined)||''}];case _0x15f7('0x53'):return[{'name':_0x15f7('0x54'),'type':_0x2c875e['reportType']||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x0]?_0x2c875e[_0x15f7('0x3a')][0x0][_0x15f7('0x55')]:undefined)||null,'value':_0x2c875e[_0x15f7('0x54')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x0]?_0x2c875e['attrs'][0x0][_0x15f7('0x3b')]:undefined)||null},{'name':'attrRefresh','value':_0x2c875e[_0x15f7('0x56')]||(_0x2c875e[_0x15f7('0x3a')]&&_0x2c875e[_0x15f7('0x3a')][0x1]?_0x2c875e[_0x15f7('0x3a')][0x1][_0x15f7('0x3b')]:undefined)||0x0}];default:return[];}}catch(_0x1cabc3){logger[_0x15f7('0x57')](_0x15f7('0x58'),JSON['stringify'](_0x1cabc3));return[];}}exports[_0x15f7('0x59')]=function(_0x3e320d,_0x5e0657){if(_0x3e320d[_0x15f7('0x5a')]){_0x3e320d['body'][_0x15f7('0x3a')]=widgetAttributes(_0x3e320d[_0x15f7('0x5a')]);}return db[_0x15f7('0x2e')][_0x15f7('0x59')](_0x3e320d['body'],{})['then'](respondWithResult(_0x5e0657,0xc9))['catch'](handleError(_0x5e0657,null));};exports[_0x15f7('0x5b')]=function(_0x343b44,_0x249087){if(_0x343b44[_0x15f7('0x5a')]['id']){delete _0x343b44[_0x15f7('0x5a')]['id'];}_0x343b44[_0x15f7('0x5a')]['attrs']=widgetAttributes(_0x343b44['body']);return db['DashboardItem'][_0x15f7('0x37')]({'where':{'id':_0x343b44[_0x15f7('0x2c')]['id']}})['then'](handleEntityNotFound(_0x249087,null))[_0x15f7('0x27')](saveUpdates(_0x343b44[_0x15f7('0x5a')],null))[_0x15f7('0x27')](respondWithResult(_0x249087,null))[_0x15f7('0x38')](handleError(_0x249087,null));}; \ No newline at end of file +var _0x647c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','error','stack','name','params','keys','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','include','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x647c,0x1d3));var _0xc647=function(_0x1e6b81,_0x1eb3ec){_0x1e6b81=_0x1e6b81-0x0;var _0x457c87=_0x647c[_0x1e6b81];return _0x457c87;};'use strict';var emlformat=require(_0xc647('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc647('0x1'));var jsonpatch=require(_0xc647('0x2'));var rp=require('request-promise');var moment=require(_0xc647('0x3'));var BPromise=require(_0xc647('0x4'));var Mustache=require(_0xc647('0x5'));var util=require(_0xc647('0x6'));var path=require(_0xc647('0x7'));var sox=require('sox');var csv=require(_0xc647('0x8'));var ejs=require(_0xc647('0x9'));var fs=require('fs');var fs_extra=require(_0xc647('0xa'));var _=require(_0xc647('0xb'));var squel=require(_0xc647('0xc'));var crypto=require(_0xc647('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc647('0x8'));var querystring=require(_0xc647('0xe'));var Papa=require(_0xc647('0xf'));var Redis=require('ioredis');var authService=require(_0xc647('0x10'));var qs=require(_0xc647('0x11'));var as=require(_0xc647('0x12'));var hardwareService=require(_0xc647('0x13'));var logger=require(_0xc647('0x14'))(_0xc647('0x15'));var utils=require(_0xc647('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc647('0x17'));var db=require(_0xc647('0x18'))['db'];config[_0xc647('0x19')]=_[_0xc647('0x1a')](config[_0xc647('0x19')],{'host':_0xc647('0x1b'),'port':0x18eb});var socket=require(_0xc647('0x1c'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xc647('0x1d')](socket);function respondWithStatusCode(_0x4b57f1,_0x98b2b2){_0x98b2b2=_0x98b2b2||0xcc;return function(_0x5e6a2f){if(_0x5e6a2f){return _0x4b57f1[_0xc647('0x1e')](_0x98b2b2);}return _0x4b57f1[_0xc647('0x1f')](_0x98b2b2)[_0xc647('0x20')]();};}function respondWithResult(_0x5a479a,_0x151ed1){_0x151ed1=_0x151ed1||0xc8;return function(_0x79328a){if(_0x79328a){return _0x5a479a['status'](_0x151ed1)[_0xc647('0x21')](_0x79328a);}};}function respondWithFilteredResult(_0x1c1db0,_0x895c9d){return function(_0x407756){if(_0x407756){var _0x182de4=typeof _0x895c9d[_0xc647('0x22')]==='undefined'&&typeof _0x895c9d['limit']===_0xc647('0x23');var _0x2b1f5a=_0x407756[_0xc647('0x24')];var _0xd41203=_0x182de4?0x0:_0x895c9d[_0xc647('0x22')];var _0x1ac3b0=_0x182de4?_0x407756['count']:_0x895c9d[_0xc647('0x22')]+_0x895c9d[_0xc647('0x25')];var _0x13f94d;if(_0x1ac3b0>=_0x2b1f5a){_0x1ac3b0=_0x2b1f5a;_0x13f94d=0xc8;}else{_0x13f94d=0xce;}_0x1c1db0[_0xc647('0x1f')](_0x13f94d);return _0x1c1db0['set'](_0xc647('0x26'),_0xd41203+'-'+_0x1ac3b0+'/'+_0x2b1f5a)[_0xc647('0x21')](_0x407756);}return null;};}function patchUpdates(_0x15efba){return function(_0x52ee84){try{jsonpatch['apply'](_0x52ee84,_0x15efba,!![]);}catch(_0x24dd5c){return BPromise[_0xc647('0x27')](_0x24dd5c);}return _0x52ee84['save']();};}function saveUpdates(_0x560bdf,_0xd9d594){return function(_0x1ffe88){if(_0x1ffe88){return _0x1ffe88[_0xc647('0x28')](_0x560bdf)[_0xc647('0x29')](function(_0x3f2f37){return _0x3f2f37;});}return null;};}function removeEntity(_0x4fb1a3,_0x1a99be){return function(_0xdc93b7){if(_0xdc93b7){return _0xdc93b7[_0xc647('0x2a')]()['then'](function(){_0x4fb1a3[_0xc647('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a6ad,_0x4bfe0b){return function(_0x4c20a6){if(!_0x4c20a6){_0x47a6ad[_0xc647('0x1e')](0x194);}return _0x4c20a6;};}function handleError(_0x3223e5,_0x3d1612){_0x3d1612=_0x3d1612||0x1f4;return function(_0x39119e){logger[_0xc647('0x2b')](_0x39119e[_0xc647('0x2c')]);if(_0x39119e[_0xc647('0x2d')]){delete _0x39119e[_0xc647('0x2d')];}_0x3223e5[_0xc647('0x1f')](_0x3d1612)['send'](_0x39119e);};}exports['show']=function(_0xb96f51,_0x4652e4){var _0x3f20a4={'raw':![],'where':{'id':_0xb96f51[_0xc647('0x2e')]['id']}},_0x2656b7={};_0x2656b7['model']=_[_0xc647('0x2f')](db['DashboardItem'][_0xc647('0x30')]);_0x2656b7[_0xc647('0x31')]=_[_0xc647('0x2f')](_0xb96f51['query']);_0x2656b7[_0xc647('0x32')]=_[_0xc647('0x33')](_0x2656b7[_0xc647('0x34')],_0x2656b7[_0xc647('0x31')]);_0x3f20a4[_0xc647('0x35')]=_[_0xc647('0x33')](_0x2656b7[_0xc647('0x34')],qs[_0xc647('0x36')](_0xb96f51[_0xc647('0x31')][_0xc647('0x36')]));_0x3f20a4[_0xc647('0x35')]=_0x3f20a4[_0xc647('0x35')]['length']?_0x3f20a4[_0xc647('0x35')]:_0x2656b7[_0xc647('0x34')];if(_0xb96f51[_0xc647('0x31')][_0xc647('0x37')]){_0x3f20a4[_0xc647('0x38')]=[{'all':!![]}];}_0x3f20a4=_['merge']({},_0x3f20a4,_0xb96f51['options']);return db[_0xc647('0x39')][_0xc647('0x3a')](_0x3f20a4)[_0xc647('0x29')](handleEntityNotFound(_0x4652e4,null))[_0xc647('0x29')](respondWithResult(_0x4652e4,null))[_0xc647('0x3b')](handleError(_0x4652e4,null));};exports[_0xc647('0x2a')]=function(_0x3393b2,_0xebde0b){return db[_0xc647('0x39')][_0xc647('0x3a')]({'where':{'id':_0x3393b2[_0xc647('0x2e')]['id']}})[_0xc647('0x29')](handleEntityNotFound(_0xebde0b,null))[_0xc647('0x29')](removeEntity(_0xebde0b,null))[_0xc647('0x3b')](handleError(_0xebde0b,null));};function widgetAttributes(_0x54174a){try{switch(_0x54174a[_0xc647('0x3c')]){case _0xc647('0x3d'):return[{'name':_0xc647('0x3e'),'value':_0x54174a[_0xc647('0x3e')]||(_0x54174a['attrs']&&_0x54174a[_0xc647('0x3f')][0x0]?_0x54174a[_0xc647('0x3f')][0x0][_0xc647('0x40')]:undefined)||_0xc647('0x41')}];case'custom':return[{'name':_0xc647('0x42'),'value':_0x54174a['attrPath']||(_0x54174a['attrs']&&_0x54174a[_0xc647('0x3f')][0x0]?_0x54174a[_0xc647('0x3f')][0x0]['value']:undefined)||''}];case _0xc647('0x43'):return[{'name':_0xc647('0x44'),'value':_0x54174a[_0xc647('0x44')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a['attrs'][0x0]?_0x54174a[_0xc647('0x3f')][0x0]['value']:undefined)||_0xc647('0x45')},{'name':_0xc647('0x46'),'value':_0x54174a['attrTimezone']||(_0x54174a['attrs']&&_0x54174a[_0xc647('0x3f')][0x1]?_0x54174a[_0xc647('0x3f')][0x1][_0xc647('0x40')]:undefined)||_0xc647('0x47')},{'name':_0xc647('0x48'),'value':_0x54174a[_0xc647('0x48')]||(_0x54174a['attrs']&&_0x54174a[_0xc647('0x3f')][0x2]?_0x54174a[_0xc647('0x3f')][0x2][_0xc647('0x40')]:undefined)||0xc}];case _0xc647('0x49'):return[{'name':'attrMetric','value':_0x54174a[_0xc647('0x4a')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x0]?_0x54174a[_0xc647('0x3f')][0x0]['value']:undefined)||_0xc647('0x4b')},{'name':'attrVoiceQueues','value':_0x54174a[_0xc647('0x4c')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x1]?_0x54174a['attrs'][0x1][_0xc647('0x40')]:undefined)||[]},{'name':_0xc647('0x48'),'value':_0x54174a[_0xc647('0x48')]||(_0x54174a['attrs']&&_0x54174a[_0xc647('0x3f')][0x2]?_0x54174a[_0xc647('0x3f')][0x2][_0xc647('0x40')]:undefined)||0x14},{'name':_0xc647('0x4d'),'value':_0x54174a[_0xc647('0x4d')]||(_0x54174a['attrs']&&_0x54174a[_0xc647('0x3f')][0x3]?_0x54174a[_0xc647('0x3f')][0x3][_0xc647('0x40')]:undefined)||_0xc647('0x4e')},{'name':'attrEmailAccounts','value':_0x54174a[_0xc647('0x4f')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x4]?_0x54174a[_0xc647('0x3f')][0x4][_0xc647('0x40')]:undefined)||''},{'name':_0xc647('0x50'),'value':_0x54174a[_0xc647('0x50')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x5]?_0x54174a[_0xc647('0x3f')][0x5][_0xc647('0x40')]:undefined)||''},{'name':_0xc647('0x51'),'value':_0x54174a[_0xc647('0x51')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x6]?_0x54174a[_0xc647('0x3f')][0x6][_0xc647('0x40')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x54174a[_0xc647('0x52')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a['attrs'][0x7]?_0x54174a[_0xc647('0x3f')][0x7][_0xc647('0x40')]:undefined)||''},{'name':_0xc647('0x53'),'value':_0x54174a['attrWhatsappAccounts']||(_0x54174a[_0xc647('0x3f')]&&_0x54174a['attrs'][0x8]?_0x54174a['attrs'][0x8][_0xc647('0x40')]:undefined)||''},{'name':_0xc647('0x54'),'value':_0x54174a['attrChatWebsites']||(_0x54174a[_0xc647('0x3f')]&&_0x54174a['attrs'][0x9]?_0x54174a[_0xc647('0x3f')][0x9][_0xc647('0x40')]:undefined)||''}];case _0xc647('0x55'):case _0xc647('0x56'):return[{'name':_0xc647('0x57'),'value':_0x54174a['attrSerie1']||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x0]?_0x54174a[_0xc647('0x3f')][0x0][_0xc647('0x40')]:undefined)||_0xc647('0x4b')},{'name':'attrSerie2','value':_0x54174a[_0xc647('0x58')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x1]?_0x54174a[_0xc647('0x3f')][0x1][_0xc647('0x40')]:undefined)||null},{'name':_0xc647('0x59'),'value':_0x54174a[_0xc647('0x59')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x2]?_0x54174a[_0xc647('0x3f')][0x2]['value']:undefined)||null},{'name':_0xc647('0x4c'),'value':_0x54174a[_0xc647('0x4c')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x3]?_0x54174a['attrs'][0x3][_0xc647('0x40')]:undefined)||[]},{'name':'attrChannel','value':_0x54174a[_0xc647('0x4d')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x4]?_0x54174a[_0xc647('0x3f')][0x4][_0xc647('0x40')]:undefined)||_0xc647('0x4e')},{'name':_0xc647('0x4f'),'value':_0x54174a[_0xc647('0x4f')]||(_0x54174a['attrs']&&_0x54174a[_0xc647('0x3f')][0x5]?_0x54174a[_0xc647('0x3f')][0x5][_0xc647('0x40')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x54174a[_0xc647('0x50')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x6]?_0x54174a[_0xc647('0x3f')][0x6][_0xc647('0x40')]:undefined)||''},{'name':_0xc647('0x51'),'value':_0x54174a[_0xc647('0x51')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x7]?_0x54174a['attrs'][0x7]['value']:undefined)||''},{'name':_0xc647('0x52'),'value':_0x54174a['attrOpenchannelAccounts']||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x8]?_0x54174a[_0xc647('0x3f')][0x8]['value']:undefined)||''},{'name':_0xc647('0x53'),'value':_0x54174a[_0xc647('0x53')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x9]?_0x54174a[_0xc647('0x3f')][0x9][_0xc647('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x54174a['attrChatWebsites']||(_0x54174a[_0xc647('0x3f')]&&_0x54174a['attrs'][0xa]?_0x54174a[_0xc647('0x3f')][0xa][_0xc647('0x40')]:undefined)||''}];case'web-report':return[{'name':_0xc647('0x5a'),'type':_0x54174a[_0xc647('0x5b')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a[_0xc647('0x3f')][0x0]?_0x54174a[_0xc647('0x3f')][0x0][_0xc647('0x3c')]:undefined)||null,'value':_0x54174a[_0xc647('0x5a')]||(_0x54174a['attrs']&&_0x54174a['attrs'][0x0]?_0x54174a[_0xc647('0x3f')][0x0][_0xc647('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x54174a[_0xc647('0x5c')]||(_0x54174a[_0xc647('0x3f')]&&_0x54174a['attrs'][0x1]?_0x54174a[_0xc647('0x3f')][0x1][_0xc647('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x3bdcf4){logger[_0xc647('0x2b')](_0xc647('0x5d'),JSON[_0xc647('0x5e')](_0x3bdcf4));return[];}}exports[_0xc647('0x5f')]=function(_0x20877b,_0x54cefb){if(_0x20877b[_0xc647('0x60')]){_0x20877b[_0xc647('0x60')]['attrs']=widgetAttributes(_0x20877b[_0xc647('0x60')]);}return db['DashboardItem'][_0xc647('0x5f')](_0x20877b['body'],{})[_0xc647('0x29')](respondWithResult(_0x54cefb,0xc9))[_0xc647('0x3b')](handleError(_0x54cefb,null));};exports[_0xc647('0x28')]=function(_0x1585df,_0x3eaa77){if(_0x1585df[_0xc647('0x60')]['id']){delete _0x1585df['body']['id'];}_0x1585df['body'][_0xc647('0x3f')]=widgetAttributes(_0x1585df['body']);return db[_0xc647('0x39')][_0xc647('0x3a')]({'where':{'id':_0x1585df[_0xc647('0x2e')]['id']}})[_0xc647('0x29')](handleEntityNotFound(_0x3eaa77,null))[_0xc647('0x29')](saveUpdates(_0x1585df[_0xc647('0x60')],null))['then'](respondWithResult(_0x3eaa77,null))[_0xc647('0x3b')](handleError(_0x3eaa77,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 084fae1..9f42bbc 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 _0x3f90=['remove','emit','hasOwnProperty','hook','../../mysqldb','DashboardItem','setMaxListeners','save','update'];(function(_0x280ad6,_0x12f2f3){var _0x3db28f=function(_0x468727){while(--_0x468727){_0x280ad6['push'](_0x280ad6['shift']());}};_0x3db28f(++_0x12f2f3);}(_0x3f90,0x175));var _0x03f9=function(_0x86e7ef,_0x2c561e){_0x86e7ef=_0x86e7ef-0x0;var _0x449894=_0x3f90[_0x86e7ef];return _0x449894;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x03f9('0x0'))['db'][_0x03f9('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x03f9('0x2')](0x0);var events={'afterCreate':_0x03f9('0x3'),'afterUpdate':_0x03f9('0x4'),'afterDestroy':_0x03f9('0x5')};function emitEvent(_0x223d3c){return function(_0x230651,_0x1a5fb8,_0x8a9679){DashboardItemEvents[_0x03f9('0x6')](_0x223d3c+':'+_0x230651['id'],_0x230651);DashboardItemEvents[_0x03f9('0x6')](_0x223d3c,_0x230651);_0x8a9679(null);};}for(var e in events){if(events[_0x03f9('0x7')](e)){var event=events[e];DashboardItem[_0x03f9('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xc177=['hasOwnProperty','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit'];(function(_0x59987a,_0x399e11){var _0x460646=function(_0x32c3c0){while(--_0x32c3c0){_0x59987a['push'](_0x59987a['shift']());}};_0x460646(++_0x399e11);}(_0xc177,0x1b2));var _0x7c17=function(_0x1e08fd,_0x3ec8c0){_0x1e08fd=_0x1e08fd-0x0;var _0x14e627=_0xc177[_0x1e08fd];return _0x14e627;};'use strict';var EventEmitter=require(_0x7c17('0x0'));var DashboardItem=require(_0x7c17('0x1'))['db'][_0x7c17('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7c17('0x3')](0x0);var events={'afterCreate':_0x7c17('0x4'),'afterUpdate':'update','afterDestroy':_0x7c17('0x5')};function emitEvent(_0xba2b0e){return function(_0x5357d6,_0x23317d,_0x5a460b){DashboardItemEvents[_0x7c17('0x6')](_0xba2b0e+':'+_0x5357d6['id'],_0x5357d6);DashboardItemEvents[_0x7c17('0x6')](_0xba2b0e,_0x5357d6);_0x5a460b(null);};}for(var e in events){if(events[_0x7c17('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x7c17('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ee2f661..30d861f 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 _0x7793=['util','../../config/logger','moment','path','rimraf','./dashboardItem.attributes','exports','define','dashboard_items'];(function(_0x2c9e50,_0x50fc20){var _0x447e2a=function(_0x272c13){while(--_0x272c13){_0x2c9e50['push'](_0x2c9e50['shift']());}};_0x447e2a(++_0x50fc20);}(_0x7793,0x120));var _0x3779=function(_0x91fefb,_0x569400){_0x91fefb=_0x91fefb-0x0;var _0x3a5482=_0x7793[_0x91fefb];return _0x3a5482;};'use strict';var _=require('lodash');var util=require(_0x3779('0x0'));var logger=require(_0x3779('0x1'))('api');var moment=require(_0x3779('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3779('0x3'));var rimraf=require(_0x3779('0x4'));var config=require('../../config/environment');var attributes=require(_0x3779('0x5'));module[_0x3779('0x6')]=function(_0x59dfb7,_0x25b30d){return _0x59dfb7[_0x3779('0x7')]('DashboardItem',attributes,{'tableName':_0x3779('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75fb=['DashboardItem','dashboard_items','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0xf8672f,_0x21b894){var _0x18ace6=function(_0x23c73d){while(--_0x23c73d){_0xf8672f['push'](_0xf8672f['shift']());}};_0x18ace6(++_0x21b894);}(_0x75fb,0x162));var _0xb75f=function(_0x43c39d,_0x10eeca){_0x43c39d=_0x43c39d-0x0;var _0x26ccea=_0x75fb[_0x43c39d];return _0x26ccea;};'use strict';var _=require('lodash');var util=require(_0xb75f('0x0'));var logger=require(_0xb75f('0x1'))(_0xb75f('0x2'));var moment=require(_0xb75f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb75f('0x4'));var fs=require('fs');var path=require(_0xb75f('0x5'));var rimraf=require(_0xb75f('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xb75f('0x7')]=function(_0x2ff88a,_0x5445ed){return _0x2ff88a[_0xb75f('0x8')](_0xb75f('0x9'),attributes,{'tableName':_0xb75f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 208c8bb..1f66f1a 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 _0x0103=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0103,0x74));var _0x3010=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0x0103[_0x3b0c9d];return _0xcfc8d7;};'use strict';var _=require('lodash');var util=require(_0x3010('0x0'));var moment=require(_0x3010('0x1'));var BPromise=require(_0x3010('0x2'));var rs=require(_0x3010('0x3'));var fs=require('fs');var Redis=require(_0x3010('0x4'));var db=require(_0x3010('0x5'))['db'];var utils=require(_0x3010('0x6'));var logger=require(_0x3010('0x7'))(_0x3010('0x8'));var config=require('../../config/environment');var jayson=require(_0x3010('0x9'));var client=jayson[_0x3010('0xa')][_0x3010('0xb')]({'port':0x232a});config[_0x3010('0xc')]=_[_0x3010('0xd')](config[_0x3010('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3010('0xe'))(new Redis(config[_0x3010('0xc')]));require(_0x3010('0xf'))[_0x3010('0x10')](socket);function respondWithRpcPromise(_0x17c9f2,_0x24f685,_0x230f7e){return new BPromise(function(_0x56e69c,_0x2c7b73){return client[_0x3010('0x11')](_0x17c9f2,_0x230f7e)[_0x3010('0x12')](function(_0x57132b){logger[_0x3010('0x13')](_0x3010('0x14'),_0x24f685,_0x3010('0x15'));logger[_0x3010('0x16')](_0x3010('0x17'),_0x24f685,_0x3010('0x15'),JSON[_0x3010('0x18')](_0x57132b));if(_0x57132b[_0x3010('0x19')]){if(_0x57132b['error'][_0x3010('0x1a')]===0x1f4){logger[_0x3010('0x19')]('DashboardItem,\x20%s,\x20%s',_0x24f685,_0x57132b[_0x3010('0x19')][_0x3010('0x1b')]);return _0x2c7b73(_0x57132b['error'][_0x3010('0x1b')]);}logger[_0x3010('0x19')](_0x3010('0x14'),_0x24f685,_0x57132b[_0x3010('0x19')][_0x3010('0x1b')]);return _0x56e69c(_0x57132b[_0x3010('0x19')][_0x3010('0x1b')]);}else{logger[_0x3010('0x13')]('DashboardItem,\x20%s,\x20%s',_0x24f685,_0x3010('0x15'));_0x56e69c(_0x57132b[_0x3010('0x1c')][_0x3010('0x1b')]);}})[_0x3010('0x1d')](function(_0x1a15c5){logger['error'](_0x3010('0x14'),_0x24f685,_0x1a15c5);_0x2c7b73(_0x1a15c5);});});} \ No newline at end of file +var _0xac5c=['../../config/environment','http','redis','defaults','localhost','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x47dcd4,_0x5e277a){var _0x4177b1=function(_0x377b1e){while(--_0x377b1e){_0x47dcd4['push'](_0x47dcd4['shift']());}};_0x4177b1(++_0x5e277a);}(_0xac5c,0x156));var _0xcac5=function(_0x426ffa,_0x11a5af){_0x426ffa=_0x426ffa-0x0;var _0x490662=_0xac5c[_0x426ffa];return _0x490662;};'use strict';var _=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var moment=require(_0xcac5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcac5('0x3'));var db=require(_0xcac5('0x4'))['db'];var utils=require(_0xcac5('0x5'));var logger=require(_0xcac5('0x6'))(_0xcac5('0x7'));var config=require(_0xcac5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcac5('0x9')]({'port':0x232a});config[_0xcac5('0xa')]=_[_0xcac5('0xb')](config[_0xcac5('0xa')],{'host':_0xcac5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcac5('0xa')]));require(_0xcac5('0xd'))['register'](socket);function respondWithRpcPromise(_0x40b749,_0x354104,_0xb6caf3){return new BPromise(function(_0x5336a6,_0x911c9c){return client[_0xcac5('0xe')](_0x40b749,_0xb6caf3)['then'](function(_0x52a2c3){logger[_0xcac5('0xf')]('DashboardItem,\x20%s,\x20%s',_0x354104,'request\x20sent');logger['debug'](_0xcac5('0x10'),_0x354104,_0xcac5('0x11'),JSON[_0xcac5('0x12')](_0x52a2c3));if(_0x52a2c3[_0xcac5('0x13')]){if(_0x52a2c3[_0xcac5('0x13')][_0xcac5('0x14')]===0x1f4){logger['error'](_0xcac5('0x15'),_0x354104,_0x52a2c3['error'][_0xcac5('0x16')]);return _0x911c9c(_0x52a2c3['error']['message']);}logger[_0xcac5('0x13')](_0xcac5('0x15'),_0x354104,_0x52a2c3[_0xcac5('0x13')][_0xcac5('0x16')]);return _0x5336a6(_0x52a2c3[_0xcac5('0x13')][_0xcac5('0x16')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x354104,'request\x20sent');_0x5336a6(_0x52a2c3[_0xcac5('0x17')][_0xcac5('0x16')]);}})[_0xcac5('0x18')](function(_0x36110c){logger['error'](_0xcac5('0x15'),_0x354104,_0x36110c);_0x911c9c(_0x36110c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 7d4637c..9b81a56 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 _0x1e42=['remove','update','emit','removeListener','dashboardItem:','./dashboardItem.events'];(function(_0x3e5595,_0xbe4275){var _0x3fd3a6=function(_0x43874c){while(--_0x43874c){_0x3e5595['push'](_0x3e5595['shift']());}};_0x3fd3a6(++_0xbe4275);}(_0x1e42,0x1eb));var _0x21e4=function(_0x4a873c,_0x29a35b){_0x4a873c=_0x4a873c-0x0;var _0x4f5762=_0x1e42[_0x4a873c];return _0x4f5762;};'use strict';var DashboardItemEvents=require(_0x21e4('0x0'));var events=['save',_0x21e4('0x1'),_0x21e4('0x2')];function createListener(_0xed8c58,_0x92b882){return function(_0x3aa9cb){_0x92b882[_0x21e4('0x3')](_0xed8c58,_0x3aa9cb);};}function removeListener(_0x147a6c,_0x30f446){return function(){DashboardItemEvents[_0x21e4('0x4')](_0x147a6c,_0x30f446);};}exports['register']=function(_0x5e8397){for(var _0x223ce2=0x0,_0x20e972=events['length'];_0x223ce2<_0x20e972;_0x223ce2++){var _0x2b3d13=events[_0x223ce2];var _0x45142f=createListener(_0x21e4('0x5')+_0x2b3d13,_0x5e8397);DashboardItemEvents['on'](_0x2b3d13,_0x45142f);}}; \ No newline at end of file +var _0xbeb7=['remove','update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x419998,_0x80767a){var _0x3054d8=function(_0x463d0f){while(--_0x463d0f){_0x419998['push'](_0x419998['shift']());}};_0x3054d8(++_0x80767a);}(_0xbeb7,0x1ae));var _0x7beb=function(_0x27a6e7,_0x2dfd11){_0x27a6e7=_0x27a6e7-0x0;var _0x25e724=_0xbeb7[_0x27a6e7];return _0x25e724;};'use strict';var DashboardItemEvents=require(_0x7beb('0x0'));var events=[_0x7beb('0x1'),_0x7beb('0x2'),_0x7beb('0x3')];function createListener(_0xbac875,_0x1b1608){return function(_0x32589e){_0x1b1608[_0x7beb('0x4')](_0xbac875,_0x32589e);};}function removeListener(_0x470a53,_0x5d28db){return function(){DashboardItemEvents[_0x7beb('0x5')](_0x470a53,_0x5d28db);};}exports[_0x7beb('0x6')]=function(_0x1fbfd6){for(var _0xec4d97=0x0,_0x350d2c=events[_0x7beb('0x7')];_0xec4d97<_0x350d2c;_0xec4d97++){var _0x10b26b=events[_0xec4d97];var _0x43095f=createListener(_0x7beb('0x8')+_0x10b26b,_0x1fbfd6);DashboardItemEvents['on'](_0x10b26b,_0x43095f);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index ddc6331..db3bea7 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 _0x1d2f=['fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x5e6d73,_0x6dbce4){var _0x1cd133=function(_0xb2b536){while(--_0xb2b536){_0x5e6d73['push'](_0x5e6d73['shift']());}};_0x1cd133(++_0x6dbce4);}(_0x1d2f,0x96));var _0xf1d2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1d2f[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf1d2('0x0'));var timeout=require(_0xf1d2('0x1'));var express=require(_0xf1d2('0x2'));var router=express['Router']();var fs_extra=require(_0xf1d2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf1d2('0x4'));var config=require(_0xf1d2('0x5'));var controller=require(_0xf1d2('0x6'));router[_0xf1d2('0x7')](_0xf1d2('0x8'),auth['isAuthenticated'](),controller[_0xf1d2('0x9')]);router[_0xf1d2('0xa')]('/',auth[_0xf1d2('0xb')](),controller['create']);router[_0xf1d2('0xc')](_0xf1d2('0x8'),auth['isAuthenticated'](),controller[_0xf1d2('0xd')]);router[_0xf1d2('0xe')](_0xf1d2('0x8'),auth['isAuthenticated'](),controller[_0xf1d2('0xf')]);module[_0xf1d2('0x10')]=router; \ No newline at end of file +var _0xf417=['create','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post'];(function(_0x21bb01,_0x4988f2){var _0x4a8035=function(_0x1a91f9){while(--_0x1a91f9){_0x21bb01['push'](_0x21bb01['shift']());}};_0x4a8035(++_0x4988f2);}(_0xf417,0x70));var _0x7f41=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0xf417[_0x546aaf];return _0x1cbf6d;};'use strict';var multer=require(_0x7f41('0x0'));var util=require(_0x7f41('0x1'));var path=require(_0x7f41('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f41('0x3'));var router=express[_0x7f41('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f41('0x5'));var interaction=require(_0x7f41('0x6'));var config=require(_0x7f41('0x7'));var controller=require(_0x7f41('0x8'));router[_0x7f41('0x9')](_0x7f41('0xa'),auth[_0x7f41('0xb')](),controller[_0x7f41('0xc')]);router[_0x7f41('0xd')]('/',auth['isAuthenticated'](),controller[_0x7f41('0xe')]);router['put'](_0x7f41('0xa'),auth[_0x7f41('0xb')](),controller[_0x7f41('0xf')]);router['delete']('/:id',auth[_0x7f41('0xb')](),controller[_0x7f41('0x10')]);module[_0x7f41('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 6a1f7d7..52b9ced 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 _0x9fbb=['first','sequelize','exports','STRING','second','third'];(function(_0x5ba6cc,_0x580284){var _0x558a40=function(_0x152bd7){while(--_0x152bd7){_0x5ba6cc['push'](_0x5ba6cc['shift']());}};_0x558a40(++_0x580284);}(_0x9fbb,0x15d));var _0xb9fb=function(_0x5f5c8f,_0x7b5224){_0x5f5c8f=_0x5f5c8f-0x0;var _0x14cf29=_0x9fbb[_0x5f5c8f];return _0x14cf29;};'use strict';var Sequelize=require(_0xb9fb('0x0'));module[_0xb9fb('0x1')]={'name':{'type':Sequelize[_0xb9fb('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0xb9fb('0x3'),_0xb9fb('0x4')),'allowNull':![],'defaultValue':_0xb9fb('0x5')},'description':{'type':Sequelize[_0xb9fb('0x2')]}}; \ No newline at end of file +var _0x506c=['first','second','third','sequelize','exports','STRING'];(function(_0x1faa7b,_0x3275f9){var _0x31f321=function(_0x2e5b95){while(--_0x2e5b95){_0x1faa7b['push'](_0x1faa7b['shift']());}};_0x31f321(++_0x3275f9);}(_0x506c,0x159));var _0xc506=function(_0x5c955b,_0x7d0440){_0x5c955b=_0x5c955b-0x0;var _0x168836=_0x506c[_0x5c955b];return _0x168836;};'use strict';var Sequelize=require(_0xc506('0x0'));module[_0xc506('0x1')]={'name':{'type':Sequelize[_0xc506('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xc506('0x3'),_0xc506('0x4'),_0xc506('0x5')),'allowNull':![],'defaultValue':_0xc506('0x3')},'description':{'type':Sequelize[_0xc506('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 05ab244..ec947f3 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 _0x0c48=['../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util'];(function(_0x2dff50,_0x39b03f){var _0x4c4fe8=function(_0x5bf900){while(--_0x5bf900){_0x2dff50['push'](_0x2dff50['shift']());}};_0x4c4fe8(++_0x39b03f);}(_0x0c48,0xed));var _0x80c4=function(_0x20da91,_0x23089f){_0x20da91=_0x20da91-0x0;var _0xa777ed=_0x0c48[_0x20da91];return _0xa777ed;};'use strict';var emlformat=require(_0x80c4('0x0'));var rimraf=require(_0x80c4('0x1'));var zipdir=require(_0x80c4('0x2'));var jsonpatch=require(_0x80c4('0x3'));var rp=require(_0x80c4('0x4'));var moment=require(_0x80c4('0x5'));var BPromise=require(_0x80c4('0x6'));var Mustache=require(_0x80c4('0x7'));var util=require(_0x80c4('0x8'));var path=require(_0x80c4('0x9'));var sox=require(_0x80c4('0xa'));var csv=require(_0x80c4('0xb'));var ejs=require(_0x80c4('0xc'));var fs=require('fs');var fs_extra=require(_0x80c4('0xd'));var _=require(_0x80c4('0xe'));var squel=require(_0x80c4('0xf'));var crypto=require('crypto');var jsforce=require(_0x80c4('0x10'));var deskjs=require(_0x80c4('0x11'));var toCsv=require(_0x80c4('0xb'));var querystring=require(_0x80c4('0x12'));var Papa=require(_0x80c4('0x13'));var Redis=require(_0x80c4('0x14'));var authService=require(_0x80c4('0x15'));var qs=require(_0x80c4('0x16'));var as=require(_0x80c4('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x80c4('0x18'));var utils=require('../../config/utils');var config=require(_0x80c4('0x19'));var licenseUtil=require(_0x80c4('0x1a'));var db=require(_0x80c4('0x1b'))['db'];function respondWithStatusCode(_0x9384f7,_0x1e2b05){_0x1e2b05=_0x1e2b05||0xcc;return function(_0x5c6d7a){if(_0x5c6d7a){return _0x9384f7[_0x80c4('0x1c')](_0x1e2b05);}return _0x9384f7[_0x80c4('0x1d')](_0x1e2b05)[_0x80c4('0x1e')]();};}function respondWithResult(_0xa584c1,_0x5849b0){_0x5849b0=_0x5849b0||0xc8;return function(_0xa92a44){if(_0xa92a44){return _0xa584c1[_0x80c4('0x1d')](_0x5849b0)['json'](_0xa92a44);}};}function respondWithFilteredResult(_0x2ee1dc,_0x3b8768){return function(_0x59139b){if(_0x59139b){var _0x22549c=typeof _0x3b8768[_0x80c4('0x1f')]===_0x80c4('0x20')&&typeof _0x3b8768['limit']===_0x80c4('0x20');var _0x9d8302=_0x59139b[_0x80c4('0x21')];var _0x537f42=_0x22549c?0x0:_0x3b8768[_0x80c4('0x1f')];var _0x5b247a=_0x22549c?_0x59139b[_0x80c4('0x21')]:_0x3b8768[_0x80c4('0x1f')]+_0x3b8768[_0x80c4('0x22')];var _0x5aebc9;if(_0x5b247a>=_0x9d8302){_0x5b247a=_0x9d8302;_0x5aebc9=0xc8;}else{_0x5aebc9=0xce;}_0x2ee1dc['status'](_0x5aebc9);return _0x2ee1dc[_0x80c4('0x23')](_0x80c4('0x24'),_0x537f42+'-'+_0x5b247a+'/'+_0x9d8302)['json'](_0x59139b);}return null;};}function patchUpdates(_0x17e644){return function(_0x3e3a32){try{jsonpatch[_0x80c4('0x25')](_0x3e3a32,_0x17e644,!![]);}catch(_0x2b07a1){return BPromise[_0x80c4('0x26')](_0x2b07a1);}return _0x3e3a32[_0x80c4('0x27')]();};}function saveUpdates(_0x24de51,_0x33849a){return function(_0x540909){if(_0x540909){return _0x540909[_0x80c4('0x28')](_0x24de51)[_0x80c4('0x29')](function(_0x2798db){return _0x2798db;});}return null;};}function removeEntity(_0x349579,_0x2f9108){return function(_0x27f9a0){if(_0x27f9a0){return _0x27f9a0[_0x80c4('0x2a')]()['then'](function(){var _0x1e8bed=_0x27f9a0['get']({'plain':!![]});var _0x3c6b79=_0x80c4('0x2b');return db[_0x80c4('0x2c')][_0x80c4('0x2a')]({'where':{'type':_0x3c6b79,'resourceId':_0x1e8bed['id']}})[_0x80c4('0x29')](function(){return _0x27f9a0;});})[_0x80c4('0x29')](function(){_0x349579[_0x80c4('0x1d')](0xcc)[_0x80c4('0x1e')]();});}};}function handleEntityNotFound(_0x4cb408,_0x76b610){return function(_0x4bc391){if(!_0x4bc391){_0x4cb408[_0x80c4('0x1c')](0x194);}return _0x4bc391;};}function handleError(_0x23a08c,_0x27b9f9){_0x27b9f9=_0x27b9f9||0x1f4;return function(_0x23fe5f){logger[_0x80c4('0x2d')](_0x23fe5f[_0x80c4('0x2e')]);if(_0x23fe5f[_0x80c4('0x2f')]){delete _0x23fe5f['name'];}_0x23a08c['status'](_0x27b9f9)[_0x80c4('0x30')](_0x23fe5f);};}exports['index']=function(_0x9043ae,_0x8e7c48){var _0x8f9f2c={},_0x45f20f={},_0x41f279={'count':0x0,'rows':[]};var _0x44d862=_['map'](db[_0x80c4('0x31')][_0x80c4('0x32')],function(_0x4bcb1a){return{'name':_0x4bcb1a[_0x80c4('0x33')],'type':_0x4bcb1a[_0x80c4('0x34')][_0x80c4('0x35')]};});_0x45f20f[_0x80c4('0x36')]=_[_0x80c4('0x37')](_0x44d862,_0x80c4('0x2f'));_0x45f20f[_0x80c4('0x38')]=_[_0x80c4('0x39')](_0x9043ae[_0x80c4('0x38')]);_0x45f20f[_0x80c4('0x3a')]=_['intersection'](_0x45f20f[_0x80c4('0x36')],_0x45f20f['query']);_0x8f9f2c[_0x80c4('0x3b')]=_[_0x80c4('0x3c')](_0x45f20f[_0x80c4('0x36')],qs['fields'](_0x9043ae['query'][_0x80c4('0x3d')]));_0x8f9f2c['attributes']=_0x8f9f2c[_0x80c4('0x3b')]['length']?_0x8f9f2c[_0x80c4('0x3b')]:_0x45f20f[_0x80c4('0x36')];if(!_0x9043ae[_0x80c4('0x38')][_0x80c4('0x3e')](_0x80c4('0x3f'))){_0x8f9f2c[_0x80c4('0x22')]=qs[_0x80c4('0x22')](_0x9043ae[_0x80c4('0x38')]['limit']);_0x8f9f2c[_0x80c4('0x1f')]=qs[_0x80c4('0x1f')](_0x9043ae[_0x80c4('0x38')][_0x80c4('0x1f')]);}_0x8f9f2c[_0x80c4('0x40')]=qs[_0x80c4('0x41')](_0x9043ae[_0x80c4('0x38')][_0x80c4('0x41')]);_0x8f9f2c[_0x80c4('0x42')]=qs[_0x80c4('0x3a')](_[_0x80c4('0x43')](_0x9043ae[_0x80c4('0x38')],_0x45f20f[_0x80c4('0x3a')]),_0x44d862);if(_0x9043ae['query'][_0x80c4('0x44')]){_0x8f9f2c[_0x80c4('0x42')]=_[_0x80c4('0x45')](_0x8f9f2c[_0x80c4('0x42')],{'$or':_[_0x80c4('0x37')](_0x44d862,function(_0x382b60){if(_0x382b60['type']!=='VIRTUAL'){var _0x142736={};_0x142736[_0x382b60['name']]={'$like':'%'+_0x9043ae['query'][_0x80c4('0x44')]+'%'};return _0x142736;}})});}_0x8f9f2c=_[_0x80c4('0x45')]({},_0x8f9f2c,_0x9043ae[_0x80c4('0x46')]);var _0x187982={'where':_0x8f9f2c[_0x80c4('0x42')]};return db[_0x80c4('0x31')][_0x80c4('0x21')](_0x187982)[_0x80c4('0x29')](function(_0x3697eb){_0x41f279[_0x80c4('0x21')]=_0x3697eb;if(_0x9043ae[_0x80c4('0x38')]['includeAll']){_0x8f9f2c[_0x80c4('0x47')]=[{'all':!![]}];}return db['Disposition'][_0x80c4('0x48')](_0x8f9f2c);})[_0x80c4('0x29')](function(_0x472884){_0x41f279[_0x80c4('0x49')]=_0x472884;return _0x41f279;})[_0x80c4('0x29')](respondWithFilteredResult(_0x8e7c48,_0x8f9f2c))[_0x80c4('0x4a')](handleError(_0x8e7c48,null));};exports[_0x80c4('0x4b')]=function(_0x18268a,_0x502553){var _0x27282d={'raw':!![],'where':{'id':_0x18268a['params']['id']}},_0x4950ee={};_0x4950ee[_0x80c4('0x36')]=_['keys'](db['Disposition'][_0x80c4('0x32')]);_0x4950ee[_0x80c4('0x38')]=_['keys'](_0x18268a[_0x80c4('0x38')]);_0x4950ee[_0x80c4('0x3a')]=_[_0x80c4('0x3c')](_0x4950ee['model'],_0x4950ee[_0x80c4('0x38')]);_0x27282d['attributes']=_[_0x80c4('0x3c')](_0x4950ee[_0x80c4('0x36')],qs['fields'](_0x18268a['query'][_0x80c4('0x3d')]));_0x27282d['attributes']=_0x27282d[_0x80c4('0x3b')]['length']?_0x27282d['attributes']:_0x4950ee['model'];if(_0x18268a['query'][_0x80c4('0x4c')]){_0x27282d['include']=[{'all':!![]}];}_0x27282d=_['merge']({},_0x27282d,_0x18268a[_0x80c4('0x46')]);return db[_0x80c4('0x31')]['find'](_0x27282d)['then'](handleEntityNotFound(_0x502553,null))[_0x80c4('0x29')](respondWithResult(_0x502553,null))[_0x80c4('0x4a')](handleError(_0x502553,null));};exports[_0x80c4('0x4d')]=function(_0x4bb619,_0x590580){return db[_0x80c4('0x31')][_0x80c4('0x4d')](_0x4bb619[_0x80c4('0x4e')],{})[_0x80c4('0x29')](function(_0x37bf30){var _0x2962c0=_0x4bb619[_0x80c4('0x4f')][_0x80c4('0x50')]({'plain':!![]});if(!_0x2962c0)throw new Error(_0x80c4('0x51'));if(_0x2962c0[_0x80c4('0x52')]===_0x80c4('0x4f')){var _0x2dff26=_0x37bf30[_0x80c4('0x50')]({'plain':!![]});var _0x4bc930=_0x80c4('0x2b');return db[_0x80c4('0x53')][_0x80c4('0x54')]({'where':{'name':_0x4bc930,'userProfileId':_0x2962c0[_0x80c4('0x55')]},'raw':!![]})[_0x80c4('0x29')](function(_0x165596){if(_0x165596&&_0x165596[_0x80c4('0x56')]===0x0){return db[_0x80c4('0x2c')][_0x80c4('0x4d')]({'name':_0x2dff26[_0x80c4('0x2f')],'resourceId':_0x2dff26['id'],'type':_0x165596[_0x80c4('0x2f')],'sectionId':_0x165596['id']},{})['then'](function(){return _0x37bf30;});}else{return _0x37bf30;}})['catch'](function(_0x3aaff4){logger[_0x80c4('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3aaff4);throw _0x3aaff4;});}return _0x37bf30;})['then'](respondWithResult(_0x590580,0xc9))[_0x80c4('0x4a')](handleError(_0x590580,null));};exports[_0x80c4('0x28')]=function(_0x646feb,_0x2ccb59){if(_0x646feb[_0x80c4('0x4e')]['id']){delete _0x646feb[_0x80c4('0x4e')]['id'];}return db['Disposition'][_0x80c4('0x54')]({'where':{'id':_0x646feb['params']['id']}})[_0x80c4('0x29')](handleEntityNotFound(_0x2ccb59,null))[_0x80c4('0x29')](saveUpdates(_0x646feb['body'],null))[_0x80c4('0x29')](respondWithResult(_0x2ccb59,null))[_0x80c4('0x4a')](handleError(_0x2ccb59,null));};exports[_0x80c4('0x2a')]=function(_0x2ecc3d,_0x18366f){return db['Disposition'][_0x80c4('0x54')]({'where':{'id':_0x2ecc3d[_0x80c4('0x57')]['id']}})[_0x80c4('0x29')](handleEntityNotFound(_0x18366f,null))[_0x80c4('0x29')](removeEntity(_0x18366f,null))[_0x80c4('0x4a')](handleError(_0x18366f,null));}; \ No newline at end of file +var _0x2db5=['Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','name','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','find','rimraf','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set'];(function(_0x1434cf,_0x5f59bc){var _0x409877=function(_0x4dd3a2){while(--_0x4dd3a2){_0x1434cf['push'](_0x1434cf['shift']());}};_0x409877(++_0x5f59bc);}(_0x2db5,0x168));var _0x52db=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0x2db5[_0x219fa0];return _0xc603fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52db('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x52db('0x1'));var moment=require('moment');var BPromise=require(_0x52db('0x2'));var Mustache=require('mustache');var util=require(_0x52db('0x3'));var path=require('path');var sox=require(_0x52db('0x4'));var csv=require('to-csv');var ejs=require(_0x52db('0x5'));var fs=require('fs');var fs_extra=require(_0x52db('0x6'));var _=require(_0x52db('0x7'));var squel=require(_0x52db('0x8'));var crypto=require(_0x52db('0x9'));var jsforce=require(_0x52db('0xa'));var deskjs=require(_0x52db('0xb'));var toCsv=require(_0x52db('0xc'));var querystring=require(_0x52db('0xd'));var Papa=require('papaparse');var Redis=require(_0x52db('0xe'));var authService=require(_0x52db('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52db('0x10'));var logger=require(_0x52db('0x11'))(_0x52db('0x12'));var utils=require(_0x52db('0x13'));var config=require(_0x52db('0x14'));var licenseUtil=require(_0x52db('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3423fd,_0x2a698b){_0x2a698b=_0x2a698b||0xcc;return function(_0x464621){if(_0x464621){return _0x3423fd[_0x52db('0x16')](_0x2a698b);}return _0x3423fd['status'](_0x2a698b)[_0x52db('0x17')]();};}function respondWithResult(_0x5bae38,_0x561cf7){_0x561cf7=_0x561cf7||0xc8;return function(_0x47b21d){if(_0x47b21d){return _0x5bae38[_0x52db('0x18')](_0x561cf7)[_0x52db('0x19')](_0x47b21d);}};}function respondWithFilteredResult(_0x565e6c,_0x2a9c89){return function(_0x133747){if(_0x133747){var _0x491023=typeof _0x2a9c89[_0x52db('0x1a')]===_0x52db('0x1b')&&typeof _0x2a9c89['limit']==='undefined';var _0x4f280c=_0x133747['count'];var _0x4efee7=_0x491023?0x0:_0x2a9c89[_0x52db('0x1a')];var _0x49c6d8=_0x491023?_0x133747[_0x52db('0x1c')]:_0x2a9c89[_0x52db('0x1a')]+_0x2a9c89['limit'];var _0xf54426;if(_0x49c6d8>=_0x4f280c){_0x49c6d8=_0x4f280c;_0xf54426=0xc8;}else{_0xf54426=0xce;}_0x565e6c['status'](_0xf54426);return _0x565e6c[_0x52db('0x1d')](_0x52db('0x1e'),_0x4efee7+'-'+_0x49c6d8+'/'+_0x4f280c)[_0x52db('0x19')](_0x133747);}return null;};}function patchUpdates(_0xf3bd26){return function(_0x57d4c8){try{jsonpatch[_0x52db('0x1f')](_0x57d4c8,_0xf3bd26,!![]);}catch(_0x326cb7){return BPromise[_0x52db('0x20')](_0x326cb7);}return _0x57d4c8[_0x52db('0x21')]();};}function saveUpdates(_0x53b6b1,_0x31ef34){return function(_0x47034f){if(_0x47034f){return _0x47034f[_0x52db('0x22')](_0x53b6b1)[_0x52db('0x23')](function(_0x446ac0){return _0x446ac0;});}return null;};}function removeEntity(_0xcfdef8,_0x2e967a){return function(_0x44668b){if(_0x44668b){return _0x44668b[_0x52db('0x24')]()[_0x52db('0x23')](function(){var _0x24d395=_0x44668b[_0x52db('0x25')]({'plain':!![]});var _0x57d8c6=_0x52db('0x26');return db[_0x52db('0x27')][_0x52db('0x24')]({'where':{'type':_0x57d8c6,'resourceId':_0x24d395['id']}})[_0x52db('0x23')](function(){return _0x44668b;});})[_0x52db('0x23')](function(){_0xcfdef8['status'](0xcc)[_0x52db('0x17')]();});}};}function handleEntityNotFound(_0x3dac3a,_0x193a03){return function(_0x574d27){if(!_0x574d27){_0x3dac3a['sendStatus'](0x194);}return _0x574d27;};}function handleError(_0x439bc5,_0x52c318){_0x52c318=_0x52c318||0x1f4;return function(_0x13c7c6){logger[_0x52db('0x28')](_0x13c7c6['stack']);if(_0x13c7c6[_0x52db('0x29')]){delete _0x13c7c6[_0x52db('0x29')];}_0x439bc5[_0x52db('0x18')](_0x52c318)['send'](_0x13c7c6);};}exports[_0x52db('0x2a')]=function(_0x96c2c5,_0x50b94c){var _0x347264={},_0x41a006={},_0x33cd9d={'count':0x0,'rows':[]};var _0x3442fe=_[_0x52db('0x2b')](db['Disposition'][_0x52db('0x2c')],function(_0x57f2c7){return{'name':_0x57f2c7['fieldName'],'type':_0x57f2c7[_0x52db('0x2d')]['key']};});_0x41a006['model']=_[_0x52db('0x2b')](_0x3442fe,_0x52db('0x29'));_0x41a006[_0x52db('0x2e')]=_[_0x52db('0x2f')](_0x96c2c5[_0x52db('0x2e')]);_0x41a006[_0x52db('0x30')]=_[_0x52db('0x31')](_0x41a006[_0x52db('0x32')],_0x41a006[_0x52db('0x2e')]);_0x347264[_0x52db('0x33')]=_['intersection'](_0x41a006[_0x52db('0x32')],qs[_0x52db('0x34')](_0x96c2c5[_0x52db('0x2e')]['fields']));_0x347264[_0x52db('0x33')]=_0x347264[_0x52db('0x33')][_0x52db('0x35')]?_0x347264['attributes']:_0x41a006[_0x52db('0x32')];if(!_0x96c2c5['query'][_0x52db('0x36')](_0x52db('0x37'))){_0x347264[_0x52db('0x38')]=qs[_0x52db('0x38')](_0x96c2c5[_0x52db('0x2e')]['limit']);_0x347264[_0x52db('0x1a')]=qs[_0x52db('0x1a')](_0x96c2c5['query'][_0x52db('0x1a')]);}_0x347264[_0x52db('0x39')]=qs[_0x52db('0x3a')](_0x96c2c5[_0x52db('0x2e')]['sort']);_0x347264[_0x52db('0x3b')]=qs['filters'](_[_0x52db('0x3c')](_0x96c2c5[_0x52db('0x2e')],_0x41a006[_0x52db('0x30')]),_0x3442fe);if(_0x96c2c5[_0x52db('0x2e')][_0x52db('0x3d')]){_0x347264['where']=_[_0x52db('0x3e')](_0x347264['where'],{'$or':_[_0x52db('0x2b')](_0x3442fe,function(_0x4828f9){if(_0x4828f9[_0x52db('0x2d')]!==_0x52db('0x3f')){var _0x1928fc={};_0x1928fc[_0x4828f9[_0x52db('0x29')]]={'$like':'%'+_0x96c2c5[_0x52db('0x2e')][_0x52db('0x3d')]+'%'};return _0x1928fc;}})});}_0x347264=_[_0x52db('0x3e')]({},_0x347264,_0x96c2c5[_0x52db('0x40')]);var _0x405de0={'where':_0x347264[_0x52db('0x3b')]};return db[_0x52db('0x41')][_0x52db('0x1c')](_0x405de0)['then'](function(_0x40fe58){_0x33cd9d['count']=_0x40fe58;if(_0x96c2c5[_0x52db('0x2e')][_0x52db('0x42')]){_0x347264[_0x52db('0x43')]=[{'all':!![]}];}return db[_0x52db('0x41')]['findAll'](_0x347264);})[_0x52db('0x23')](function(_0x45d66b){_0x33cd9d[_0x52db('0x44')]=_0x45d66b;return _0x33cd9d;})[_0x52db('0x23')](respondWithFilteredResult(_0x50b94c,_0x347264))['catch'](handleError(_0x50b94c,null));};exports['show']=function(_0x2eff70,_0x13cb59){var _0x100394={'raw':!![],'where':{'id':_0x2eff70[_0x52db('0x45')]['id']}},_0x1f8d64={};_0x1f8d64['model']=_[_0x52db('0x2f')](db[_0x52db('0x41')][_0x52db('0x2c')]);_0x1f8d64[_0x52db('0x2e')]=_[_0x52db('0x2f')](_0x2eff70[_0x52db('0x2e')]);_0x1f8d64[_0x52db('0x30')]=_['intersection'](_0x1f8d64[_0x52db('0x32')],_0x1f8d64['query']);_0x100394[_0x52db('0x33')]=_[_0x52db('0x31')](_0x1f8d64[_0x52db('0x32')],qs[_0x52db('0x34')](_0x2eff70[_0x52db('0x2e')][_0x52db('0x34')]));_0x100394[_0x52db('0x33')]=_0x100394['attributes'][_0x52db('0x35')]?_0x100394[_0x52db('0x33')]:_0x1f8d64['model'];if(_0x2eff70[_0x52db('0x2e')]['includeAll']){_0x100394['include']=[{'all':!![]}];}_0x100394=_[_0x52db('0x3e')]({},_0x100394,_0x2eff70[_0x52db('0x40')]);return db[_0x52db('0x41')]['find'](_0x100394)['then'](handleEntityNotFound(_0x13cb59,null))[_0x52db('0x23')](respondWithResult(_0x13cb59,null))['catch'](handleError(_0x13cb59,null));};exports[_0x52db('0x46')]=function(_0x44efb5,_0x146143){return db[_0x52db('0x41')]['create'](_0x44efb5[_0x52db('0x47')],{})[_0x52db('0x23')](function(_0x52f635){var _0x125623=_0x44efb5[_0x52db('0x48')][_0x52db('0x25')]({'plain':!![]});if(!_0x125623)throw new Error(_0x52db('0x49'));if(_0x125623[_0x52db('0x4a')]===_0x52db('0x48')){var _0x2b5d67=_0x52f635['get']({'plain':!![]});var _0x32aa6b=_0x52db('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x32aa6b,'userProfileId':_0x125623['userProfileId']},'raw':!![]})[_0x52db('0x23')](function(_0x35987b){if(_0x35987b&&_0x35987b['autoAssociation']===0x0){return db[_0x52db('0x27')][_0x52db('0x46')]({'name':_0x2b5d67[_0x52db('0x29')],'resourceId':_0x2b5d67['id'],'type':_0x35987b[_0x52db('0x29')],'sectionId':_0x35987b['id']},{})[_0x52db('0x23')](function(){return _0x52f635;});}else{return _0x52f635;}})['catch'](function(_0x5445fc){logger['error'](_0x52db('0x4b'),_0x5445fc);throw _0x5445fc;});}return _0x52f635;})[_0x52db('0x23')](respondWithResult(_0x146143,0xc9))[_0x52db('0x4c')](handleError(_0x146143,null));};exports[_0x52db('0x22')]=function(_0x551913,_0x50c4ad){if(_0x551913[_0x52db('0x47')]['id']){delete _0x551913[_0x52db('0x47')]['id'];}return db[_0x52db('0x41')][_0x52db('0x4d')]({'where':{'id':_0x551913[_0x52db('0x45')]['id']}})[_0x52db('0x23')](handleEntityNotFound(_0x50c4ad,null))[_0x52db('0x23')](saveUpdates(_0x551913[_0x52db('0x47')],null))['then'](respondWithResult(_0x50c4ad,null))[_0x52db('0x4c')](handleError(_0x50c4ad,null));};exports['destroy']=function(_0x38c2c4,_0x5b5a70){return db[_0x52db('0x41')][_0x52db('0x4d')]({'where':{'id':_0x38c2c4['params']['id']}})[_0x52db('0x23')](handleEntityNotFound(_0x5b5a70,null))['then'](removeEntity(_0x5b5a70,null))[_0x52db('0x4c')](handleError(_0x5b5a70,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index e6d3378..3bad7a9 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 _0x0095=['exports','define','Disposition','tools_dispositions','name_voice','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_whatsapp','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes'];(function(_0x18063f,_0x3efbaf){var _0x116771=function(_0x366444){while(--_0x366444){_0x18063f['push'](_0x18063f['shift']());}};_0x116771(++_0x3efbaf);}(_0x0095,0x157));var _0x5009=function(_0x53c69a,_0x29c68f){_0x53c69a=_0x53c69a-0x0;var _0x467595=_0x0095[_0x53c69a];return _0x467595;};'use strict';var _=require('lodash');var util=require(_0x5009('0x0'));var logger=require('../../config/logger')(_0x5009('0x1'));var moment=require(_0x5009('0x2'));var BPromise=require(_0x5009('0x3'));var rp=require(_0x5009('0x4'));var fs=require('fs');var path=require(_0x5009('0x5'));var rimraf=require(_0x5009('0x6'));var config=require(_0x5009('0x7'));var attributes=require(_0x5009('0x8'));module[_0x5009('0x9')]=function(_0x7f2a8d,_0xb0ec0d){return _0x7f2a8d[_0x5009('0xa')](_0x5009('0xb'),attributes,{'tableName':_0x5009('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5009('0xd'),'fields':[_0x5009('0xe'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0x5009('0xe'),_0x5009('0xf')]},{'unique':!![],'name':_0x5009('0x10'),'fields':['name',_0x5009('0x11')]},{'unique':!![],'name':_0x5009('0x12'),'fields':[_0x5009('0xe'),_0x5009('0x13')]},{'unique':!![],'name':'name_fax','fields':['name',_0x5009('0x14')]},{'unique':!![],'name':'name_openchannel','fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0x5009('0x15'),'fields':[_0x5009('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d45=['tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition'];(function(_0x1d0e2f,_0x45d727){var _0x2adebc=function(_0xf1545a){while(--_0xf1545a){_0x1d0e2f['push'](_0x1d0e2f['shift']());}};_0x2adebc(++_0x45d727);}(_0x4d45,0x7f));var _0x54d4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4d45[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x54d4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x54d4('0x1'));var BPromise=require(_0x54d4('0x2'));var rp=require(_0x54d4('0x3'));var fs=require('fs');var path=require(_0x54d4('0x4'));var rimraf=require(_0x54d4('0x5'));var config=require(_0x54d4('0x6'));var attributes=require(_0x54d4('0x7'));module[_0x54d4('0x8')]=function(_0x14d17e,_0x226bae){return _0x14d17e[_0x54d4('0x9')](_0x54d4('0xa'),attributes,{'tableName':_0x54d4('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x54d4('0xc'),'fields':[_0x54d4('0xd'),_0x54d4('0xe')]},{'unique':!![],'name':_0x54d4('0xf'),'fields':[_0x54d4('0xd'),_0x54d4('0x10')]},{'unique':!![],'name':'name_mail','fields':['name',_0x54d4('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x54d4('0xd'),_0x54d4('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0x54d4('0xd'),_0x54d4('0x13')]},{'unique':!![],'name':_0x54d4('0x14'),'fields':[_0x54d4('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x54d4('0x15'),'fields':[_0x54d4('0xd'),_0x54d4('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 23958f7..90081c8 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(_0x122575,_0x57af2c){var _0x5de760=function(_0x5cefe4){while(--_0x5cefe4){_0x122575['push'](_0x122575['shift']());}};_0x5de760(++_0x57af2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0xf0515,_0x5980d8){var _0x56c200=function(_0x44a7a6){while(--_0x44a7a6){_0xf0515['push'](_0xf0515['shift']());}};_0x56c200(++_0x5980d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 a3ddfcd..7b3b058 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 _0x471a=['/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x471a,0x18d));var _0xa471=function(_0x3f384e,_0x23f615){_0x3f384e=_0x3f384e-0x0;var _0x3fca88=_0x471a[_0x3f384e];return _0x3fca88;};'use strict';var multer=require(_0xa471('0x0'));var util=require(_0xa471('0x1'));var path=require(_0xa471('0x2'));var timeout=require('connect-timeout');var express=require(_0xa471('0x3'));var router=express[_0xa471('0x4')]();var fs_extra=require(_0xa471('0x5'));var auth=require(_0xa471('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xa471('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa471('0x8'),auth[_0xa471('0x9')](),controller[_0xa471('0xa')]);router['post']('/',auth[_0xa471('0x9')](),controller['create']);router['put'](_0xa471('0x8'),auth[_0xa471('0x9')](),controller[_0xa471('0xb')]);router[_0xa471('0xc')]('/:id',auth[_0xa471('0x9')](),controller[_0xa471('0xd')]);module[_0xa471('0xe')]=router; \ No newline at end of file +var _0xd3d5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xd3d5,0xdf));var _0x5d3d=function(_0x32e85b,_0x15c133){_0x32e85b=_0x32e85b-0x0;var _0x30871b=_0xd3d5[_0x32e85b];return _0x30871b;};'use strict';var multer=require(_0x5d3d('0x0'));var util=require(_0x5d3d('0x1'));var path=require(_0x5d3d('0x2'));var timeout=require(_0x5d3d('0x3'));var express=require('express');var router=express[_0x5d3d('0x4')]();var fs_extra=require(_0x5d3d('0x5'));var auth=require(_0x5d3d('0x6'));var interaction=require(_0x5d3d('0x7'));var config=require(_0x5d3d('0x8'));var controller=require('./disposition.controller');router[_0x5d3d('0x9')]('/',auth[_0x5d3d('0xa')](),controller['index']);router[_0x5d3d('0x9')](_0x5d3d('0xb'),auth[_0x5d3d('0xa')](),controller[_0x5d3d('0xc')]);router[_0x5d3d('0xd')]('/',auth[_0x5d3d('0xa')](),controller[_0x5d3d('0xe')]);router['put'](_0x5d3d('0xb'),auth[_0x5d3d('0xa')](),controller[_0x5d3d('0xf')]);router[_0x5d3d('0x10')](_0x5d3d('0xb'),auth[_0x5d3d('0xa')](),controller[_0x5d3d('0x11')]);module[_0x5d3d('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 079a463..54e440d 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 _0x4836=['ENUM','yes','localstationid','2400','7200','12000','14400','4800','9600','v17,v27,v29','INTEGER','IAX','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x1c2aeb,_0x48433c){var _0x783379=function(_0x3e8820){while(--_0x3e8820){_0x1c2aeb['push'](_0x1c2aeb['shift']());}};_0x783379(++_0x48433c);}(_0x4836,0x1e0));var _0x6483=function(_0x33da75,_0x288301){_0x33da75=_0x33da75-0x0;var _0x178762=_0x4836[_0x33da75];return _0x178762;};'use strict';var Sequelize=require(_0x6483('0x0'));module[_0x6483('0x1')]={'name':{'type':Sequelize[_0x6483('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6483('0x2')]},'ecm':{'type':Sequelize[_0x6483('0x3')](_0x6483('0x4'),'no'),'defaultValue':_0x6483('0x4')},'headerinfo':{'type':Sequelize[_0x6483('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x6483('0x2')],'unique':_0x6483('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x6483('0x6'),'4800',_0x6483('0x7'),'9600',_0x6483('0x8'),_0x6483('0x9')),'defaultValue':_0x6483('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0x6483('0x6'),_0x6483('0xa'),_0x6483('0x7'),_0x6483('0xb'),_0x6483('0x8'),_0x6483('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x6483('0x2')],'defaultValue':_0x6483('0xc')},'gateway':{'type':Sequelize[_0x6483('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6483('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6483('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6483('0x3')]('SIP',_0x6483('0xe'),'DADHI',_0x6483('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x6483('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6483('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6483('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6483('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6483('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x6483('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6483('0x12'),'set':function(_0x15697c){if(!_0x15697c)this[_0x6483('0x13')]('mandatoryDispositionPauseId',null);this[_0x6483('0x13')](_0x6483('0x14'),_0x15697c);}}}; \ No newline at end of file +var _0x3f77=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT'];(function(_0x5dc7d4,_0x3a1ccb){var _0x3cfc0e=function(_0x178656){while(--_0x178656){_0x5dc7d4['push'](_0x5dc7d4['shift']());}};_0x3cfc0e(++_0x3a1ccb);}(_0x3f77,0x15e));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x73f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x73f7('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x73f7('0x1')]},'ecm':{'type':Sequelize[_0x73f7('0x2')](_0x73f7('0x3'),'no'),'defaultValue':_0x73f7('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x73f7('0x4')},'localstationid':{'type':Sequelize[_0x73f7('0x1')],'unique':_0x73f7('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x73f7('0x6'),_0x73f7('0x7'),_0x73f7('0x8'),_0x73f7('0x9'),_0x73f7('0xa'),_0x73f7('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x73f7('0x2')]('2400',_0x73f7('0x7'),_0x73f7('0x8'),_0x73f7('0x9'),_0x73f7('0xa'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x73f7('0x1')],'defaultValue':_0x73f7('0xc')},'gateway':{'type':Sequelize[_0x73f7('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x73f7('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x73f7('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x73f7('0x2')](_0x73f7('0xe'),_0x73f7('0xf'),'DADHI',_0x73f7('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x73f7('0x11')],'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[_0x73f7('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x73f7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x73f7('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x73f7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x73f7('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x73f7('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x73f7('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x73f7('0x12')],'defaultValue':![],'comment':_0x73f7('0x14'),'set':function(_0x4b5aca){if(!_0x4b5aca)this[_0x73f7('0x15')](_0x73f7('0x16'),null);this[_0x73f7('0x15')]('mandatoryDisposition',_0x4b5aca);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 80bd866..2e38c72 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 _0x5d49=['Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','autoAssociation','body','find','describe','addDisposition','getDispositions','Disposition','FaxAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','Transaction','FaxApplication','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','transaction','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','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','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x5d49,0x88));var _0x95d4=function(_0x2160cb,_0x291d26){_0x2160cb=_0x2160cb-0x0;var _0x498603=_0x5d49[_0x2160cb];return _0x498603;};'use strict';var emlformat=require(_0x95d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95d4('0x1'));var jsonpatch=require(_0x95d4('0x2'));var rp=require('request-promise');var moment=require(_0x95d4('0x3'));var BPromise=require(_0x95d4('0x4'));var Mustache=require(_0x95d4('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x95d4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95d4('0x7'));var _=require(_0x95d4('0x8'));var squel=require(_0x95d4('0x9'));var crypto=require(_0x95d4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x95d4('0xb'));var toCsv=require(_0x95d4('0x6'));var querystring=require(_0x95d4('0xc'));var Papa=require(_0x95d4('0xd'));var Redis=require('ioredis');var authService=require(_0x95d4('0xe'));var qs=require(_0x95d4('0xf'));var as=require(_0x95d4('0x10'));var hardwareService=require(_0x95d4('0x11'));var logger=require(_0x95d4('0x12'))(_0x95d4('0x13'));var utils=require(_0x95d4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x95d4('0x15'));var db=require(_0x95d4('0x16'))['db'];config[_0x95d4('0x17')]=_[_0x95d4('0x18')](config[_0x95d4('0x17')],{'host':_0x95d4('0x19'),'port':0x18eb});var socket=require(_0x95d4('0x1a'))(new Redis(config[_0x95d4('0x17')]));require(_0x95d4('0x1b'))[_0x95d4('0x1c')](socket);var jayson=require(_0x95d4('0x1d'));var client=jayson['client'][_0x95d4('0x1e')]({'port':0x232c});var client9002=jayson[_0x95d4('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31738c,_0x11762c,_0x3d1e36,_0x5bff58){return new BPromise(function(_0x2bbbcb,_0x84ba){var _0xe51766=_0x5bff58||client;return _0xe51766[_0x95d4('0x20')](_0x31738c,_0x3d1e36)[_0x95d4('0x21')](function(_0x496012){logger['info'](_0x95d4('0x22'),_0x11762c,_0x95d4('0x23'));logger[_0x95d4('0x24')](_0x95d4('0x25'),_0x11762c,_0x95d4('0x23'),JSON[_0x95d4('0x26')](_0x496012));if(_0x496012['error']){if(_0x496012[_0x95d4('0x27')][_0x95d4('0x28')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x11762c,_0x496012[_0x95d4('0x27')][_0x95d4('0x29')]);return _0x84ba(_0x496012[_0x95d4('0x27')][_0x95d4('0x29')]);}logger[_0x95d4('0x27')](_0x95d4('0x22'),_0x11762c,_0x496012[_0x95d4('0x27')][_0x95d4('0x29')]);return _0x2bbbcb(_0x496012[_0x95d4('0x27')][_0x95d4('0x29')]);}else{logger[_0x95d4('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x11762c,'request\x20sent');_0x2bbbcb(_0x496012[_0x95d4('0x2b')][_0x95d4('0x29')]);}})[_0x95d4('0x2c')](function(_0x116dc6){logger[_0x95d4('0x27')](_0x95d4('0x22'),_0x11762c,_0x116dc6);_0x84ba(_0x116dc6);});});}function respondWithStatusCode(_0x32681d,_0x5b9f1f){_0x5b9f1f=_0x5b9f1f||0xcc;return function(_0x274f12){if(_0x274f12){return _0x32681d[_0x95d4('0x2d')](_0x5b9f1f);}return _0x32681d['status'](_0x5b9f1f)[_0x95d4('0x2e')]();};}function respondWithResult(_0x4c7d43,_0x9385c8){_0x9385c8=_0x9385c8||0xc8;return function(_0xbc3146){if(_0xbc3146){return _0x4c7d43[_0x95d4('0x2f')](_0x9385c8)[_0x95d4('0x30')](_0xbc3146);}};}function respondWithFilteredResult(_0x10684f,_0x7fd927){return function(_0x10d0ab){if(_0x10d0ab){var _0x5905cb=typeof _0x7fd927[_0x95d4('0x31')]==='undefined'&&typeof _0x7fd927[_0x95d4('0x32')]==='undefined';var _0xc695a2=_0x10d0ab['count'];var _0x2724a7=_0x5905cb?0x0:_0x7fd927[_0x95d4('0x31')];var _0x7064f9=_0x5905cb?_0x10d0ab['count']:_0x7fd927[_0x95d4('0x31')]+_0x7fd927[_0x95d4('0x32')];var _0x29bd8d;if(_0x7064f9>=_0xc695a2){_0x7064f9=_0xc695a2;_0x29bd8d=0xc8;}else{_0x29bd8d=0xce;}_0x10684f[_0x95d4('0x2f')](_0x29bd8d);return _0x10684f[_0x95d4('0x33')](_0x95d4('0x34'),_0x2724a7+'-'+_0x7064f9+'/'+_0xc695a2)[_0x95d4('0x30')](_0x10d0ab);}return null;};}function patchUpdates(_0x31a3f4){return function(_0x3dfb66){try{jsonpatch[_0x95d4('0x35')](_0x3dfb66,_0x31a3f4,!![]);}catch(_0x5b5a27){return BPromise[_0x95d4('0x36')](_0x5b5a27);}return _0x3dfb66[_0x95d4('0x37')]();};}function saveUpdates(_0x3cbc94,_0x2aadff){return function(_0x28ae61){if(_0x28ae61){return _0x28ae61[_0x95d4('0x38')](_0x3cbc94)[_0x95d4('0x21')](function(_0x255f6c){return _0x255f6c;});}return null;};}function removeEntity(_0x1878e1,_0x5af9a5){return function(_0x74c212){if(_0x74c212){return _0x74c212[_0x95d4('0x39')]()['then'](function(){var _0xf7799a=_0x74c212[_0x95d4('0x3a')]({'plain':!![]});var _0x1d55e8='FaxAccounts';return db[_0x95d4('0x3b')][_0x95d4('0x39')]({'where':{'type':_0x1d55e8,'resourceId':_0xf7799a['id']}})[_0x95d4('0x21')](function(){return _0x74c212;});})['then'](function(){_0x1878e1['status'](0xcc)[_0x95d4('0x2e')]();});}};}function handleEntityNotFound(_0x59a4dc,_0x3e55d5){return function(_0x3f09c0){if(!_0x3f09c0){_0x59a4dc[_0x95d4('0x2d')](0x194);}return _0x3f09c0;};}function handleError(_0x3664d5,_0x5b7256){_0x5b7256=_0x5b7256||0x1f4;return function(_0x5d3ceb){logger[_0x95d4('0x27')](_0x5d3ceb[_0x95d4('0x3c')]);if(_0x5d3ceb['name']){delete _0x5d3ceb[_0x95d4('0x3d')];}_0x3664d5['status'](_0x5b7256)[_0x95d4('0x3e')](_0x5d3ceb);};}exports[_0x95d4('0x3f')]=function(_0x1eed47,_0x3b2e2e){var _0x5bcba8={'include':[{'model':db[_0x95d4('0x40')],'as':_0x95d4('0x41')}]},_0x41e385={},_0x261c74={'count':0x0,'rows':[]};var _0x6ac067=_[_0x95d4('0x42')](db[_0x95d4('0x43')][_0x95d4('0x44')],function(_0x560945){return{'name':_0x560945[_0x95d4('0x45')],'type':_0x560945[_0x95d4('0x46')][_0x95d4('0x47')]};});_0x41e385[_0x95d4('0x48')]=_[_0x95d4('0x42')](_0x6ac067,_0x95d4('0x3d'));_0x41e385[_0x95d4('0x49')]=_[_0x95d4('0x4a')](_0x1eed47[_0x95d4('0x49')]);_0x41e385[_0x95d4('0x4b')]=_[_0x95d4('0x4c')](_0x41e385[_0x95d4('0x48')],_0x41e385[_0x95d4('0x49')]);_0x5bcba8['attributes']=_[_0x95d4('0x4c')](_0x41e385[_0x95d4('0x48')],qs['fields'](_0x1eed47['query'][_0x95d4('0x4d')]));_0x5bcba8[_0x95d4('0x4e')]=_0x5bcba8[_0x95d4('0x4e')]['length']?_0x5bcba8[_0x95d4('0x4e')]:_0x41e385['model'];if(!_0x1eed47['query'][_0x95d4('0x4f')](_0x95d4('0x50'))){_0x5bcba8[_0x95d4('0x32')]=qs['limit'](_0x1eed47['query'][_0x95d4('0x32')]);_0x5bcba8['offset']=qs[_0x95d4('0x31')](_0x1eed47['query'][_0x95d4('0x31')]);}_0x5bcba8[_0x95d4('0x51')]=qs[_0x95d4('0x52')](_0x1eed47[_0x95d4('0x49')][_0x95d4('0x52')]);_0x5bcba8[_0x95d4('0x53')]=qs[_0x95d4('0x4b')](_[_0x95d4('0x54')](_0x1eed47['query'],_0x41e385[_0x95d4('0x4b')]),_0x6ac067);if(_0x1eed47['query'][_0x95d4('0x55')]){_0x5bcba8['where']=_[_0x95d4('0x56')](_0x5bcba8['where'],{'$or':_[_0x95d4('0x42')](_0x6ac067,function(_0xcce02b){if(_0xcce02b[_0x95d4('0x46')]!=='VIRTUAL'){var _0x40b5aa={};_0x40b5aa[_0xcce02b['name']]={'$like':'%'+_0x1eed47[_0x95d4('0x49')][_0x95d4('0x55')]+'%'};return _0x40b5aa;}})});}_0x5bcba8=_[_0x95d4('0x56')]({},_0x5bcba8,_0x1eed47[_0x95d4('0x57')]);var _0x4c831c={'where':_0x5bcba8[_0x95d4('0x53')]};return db['FaxAccount'][_0x95d4('0x58')](_0x4c831c)[_0x95d4('0x21')](function(_0x1b3d74){_0x261c74[_0x95d4('0x58')]=_0x1b3d74;if(_0x1eed47[_0x95d4('0x49')][_0x95d4('0x59')]){_0x5bcba8[_0x95d4('0x5a')]=[{'all':!![]}];}return db[_0x95d4('0x43')]['findAll'](_0x5bcba8);})['then'](function(_0x4524d9){_0x261c74[_0x95d4('0x5b')]=_0x4524d9;return _0x261c74;})[_0x95d4('0x21')](respondWithFilteredResult(_0x3b2e2e,_0x5bcba8))[_0x95d4('0x2c')](handleError(_0x3b2e2e,null));};exports['show']=function(_0x3d9587,_0x4e1e91){var _0x1f2a80={'raw':![],'where':{'id':_0x3d9587[_0x95d4('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x95d4('0x41')}]},_0x51b85f={};_0x51b85f[_0x95d4('0x48')]=_[_0x95d4('0x4a')](db['FaxAccount'][_0x95d4('0x44')]);_0x51b85f[_0x95d4('0x49')]=_[_0x95d4('0x4a')](_0x3d9587[_0x95d4('0x49')]);_0x51b85f['filters']=_['intersection'](_0x51b85f[_0x95d4('0x48')],_0x51b85f[_0x95d4('0x49')]);_0x1f2a80[_0x95d4('0x4e')]=_[_0x95d4('0x4c')](_0x51b85f[_0x95d4('0x48')],qs[_0x95d4('0x4d')](_0x3d9587[_0x95d4('0x49')]['fields']));_0x1f2a80[_0x95d4('0x4e')]=_0x1f2a80[_0x95d4('0x4e')][_0x95d4('0x5d')]?_0x1f2a80['attributes']:_0x51b85f['model'];if(_0x3d9587['query'][_0x95d4('0x59')]){_0x1f2a80[_0x95d4('0x5a')]=[{'all':!![]}];}_0x1f2a80=_[_0x95d4('0x56')]({},_0x1f2a80,_0x3d9587[_0x95d4('0x57')]);return db['FaxAccount']['find'](_0x1f2a80)[_0x95d4('0x21')](handleEntityNotFound(_0x4e1e91,null))[_0x95d4('0x21')](respondWithResult(_0x4e1e91,null))[_0x95d4('0x2c')](handleError(_0x4e1e91,null));};exports[_0x95d4('0x5e')]=function(_0x2a34b7,_0x39d747){return db[_0x95d4('0x43')][_0x95d4('0x5e')](_0x2a34b7['body'],{})[_0x95d4('0x21')](function(_0x3290ae){var _0x17d74f=_0x2a34b7[_0x95d4('0x5f')]['get']({'plain':!![]});if(!_0x17d74f)throw new Error(_0x95d4('0x60'));if(_0x17d74f[_0x95d4('0x61')]===_0x95d4('0x5f')){var _0x4a608b=_0x3290ae[_0x95d4('0x3a')]({'plain':!![]});var _0x5989ec=_0x95d4('0x62');return db['UserProfileSection']['find']({'where':{'name':_0x5989ec,'userProfileId':_0x17d74f['userProfileId']},'raw':!![]})[_0x95d4('0x21')](function(_0x207b27){if(_0x207b27&&_0x207b27[_0x95d4('0x63')]===0x0){return db[_0x95d4('0x3b')]['create']({'name':_0x4a608b[_0x95d4('0x3d')],'resourceId':_0x4a608b['id'],'type':_0x207b27[_0x95d4('0x3d')],'sectionId':_0x207b27['id']},{})[_0x95d4('0x21')](function(){return _0x3290ae;});}else{return _0x3290ae;}})['catch'](function(_0x1e215b){logger[_0x95d4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e215b);throw _0x1e215b;});}return _0x3290ae;})[_0x95d4('0x21')](respondWithResult(_0x39d747,0xc9))[_0x95d4('0x2c')](handleError(_0x39d747,null));};exports['update']=function(_0x506432,_0x499fa1){if(_0x506432[_0x95d4('0x64')]['id']){delete _0x506432[_0x95d4('0x64')]['id'];}return db[_0x95d4('0x43')][_0x95d4('0x65')]({'where':{'id':_0x506432[_0x95d4('0x5c')]['id']},'include':[{'model':db[_0x95d4('0x40')],'as':_0x95d4('0x41')}]})[_0x95d4('0x21')](handleEntityNotFound(_0x499fa1,null))[_0x95d4('0x21')](saveUpdates(_0x506432[_0x95d4('0x64')],null))[_0x95d4('0x21')](respondWithResult(_0x499fa1,null))[_0x95d4('0x2c')](handleError(_0x499fa1,null));};exports['destroy']=function(_0x2e0e45,_0x1c97ae){return db[_0x95d4('0x43')][_0x95d4('0x65')]({'where':{'id':_0x2e0e45[_0x95d4('0x5c')]['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x1c97ae,null))['then'](removeEntity(_0x1c97ae,null))[_0x95d4('0x2c')](handleError(_0x1c97ae,null));};exports['describe']=function(_0x507422,_0x2cc096){return db[_0x95d4('0x43')][_0x95d4('0x66')]()['then'](respondWithResult(_0x2cc096,null))[_0x95d4('0x2c')](handleError(_0x2cc096,null));};exports[_0x95d4('0x67')]=function(_0x129543,_0x569e5d,_0x1b4e3a){if(_0x129543[_0x95d4('0x64')]['id']){delete _0x129543[_0x95d4('0x64')]['id'];}return db['FaxAccount'][_0x95d4('0x65')]({'where':{'id':_0x129543[_0x95d4('0x5c')]['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x569e5d,null))[_0x95d4('0x21')](function(_0x15649f){if(_0x15649f){_0x129543['body']['FaxAccountId']=_0x15649f['id'];return db['Disposition'][_0x95d4('0x5e')](_0x129543[_0x95d4('0x64')]);}})[_0x95d4('0x21')](respondWithResult(_0x569e5d,null))[_0x95d4('0x2c')](handleError(_0x569e5d,null));};exports[_0x95d4('0x68')]=function(_0x3ba20d,_0x415283,_0x4c9390){var _0x5a055e={'raw':![],'where':{}};var _0x11295c={};var _0x560258={'count':0x0,'rows':[]};return db[_0x95d4('0x43')]['findOne']({'where':{'id':_0x3ba20d['params']['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x415283,null))[_0x95d4('0x21')](function(_0x4e6cc5){if(_0x4e6cc5){_0x11295c[_0x95d4('0x48')]=_[_0x95d4('0x4a')](db[_0x95d4('0x69')][_0x95d4('0x44')]);_0x11295c[_0x95d4('0x49')]=_['keys'](_0x3ba20d['query']);_0x11295c[_0x95d4('0x4b')]=_['intersection'](_0x11295c['model'],_0x11295c[_0x95d4('0x49')]);_0x5a055e[_0x95d4('0x4e')]=_[_0x95d4('0x4c')](_0x11295c[_0x95d4('0x48')],qs['fields'](_0x3ba20d[_0x95d4('0x49')][_0x95d4('0x4d')]));_0x5a055e[_0x95d4('0x4e')]=_0x5a055e[_0x95d4('0x4e')][_0x95d4('0x5d')]?_0x5a055e['attributes']:_0x11295c[_0x95d4('0x48')];if(!_0x3ba20d[_0x95d4('0x49')][_0x95d4('0x4f')](_0x95d4('0x50'))){_0x5a055e[_0x95d4('0x32')]=qs['limit'](_0x3ba20d[_0x95d4('0x49')][_0x95d4('0x32')]);_0x5a055e[_0x95d4('0x31')]=qs[_0x95d4('0x31')](_0x3ba20d[_0x95d4('0x49')]['offset']);}_0x5a055e[_0x95d4('0x51')]=qs['sort'](_0x3ba20d[_0x95d4('0x49')]['sort']);_0x5a055e['where']=qs['filters'](_[_0x95d4('0x54')](_0x3ba20d['query'],_0x11295c[_0x95d4('0x4b')]));_0x5a055e[_0x95d4('0x53')][_0x95d4('0x6a')]=_0x4e6cc5['id'];if(_0x3ba20d[_0x95d4('0x49')][_0x95d4('0x55')]){_0x5a055e['where']=_[_0x95d4('0x56')](_0x5a055e[_0x95d4('0x53')],{'$or':_['map'](_0x5a055e[_0x95d4('0x4e')],function(_0x55a2c8){var _0x5792cc={};_0x5792cc[_0x55a2c8]={'$like':'%'+_0x3ba20d[_0x95d4('0x49')][_0x95d4('0x55')]+'%'};return _0x5792cc;})});}_0x5a055e=_[_0x95d4('0x56')]({},_0x5a055e,_0x3ba20d['options']);return db[_0x95d4('0x69')][_0x95d4('0x58')]({'where':_0x5a055e['where']})[_0x95d4('0x21')](function(_0x38727f){_0x560258['count']=_0x38727f;if(_0x3ba20d[_0x95d4('0x49')][_0x95d4('0x59')]){_0x5a055e[_0x95d4('0x5a')]=[{'all':!![]}];}return db[_0x95d4('0x69')][_0x95d4('0x6b')](_0x5a055e);})[_0x95d4('0x21')](function(_0xfc8604){_0x560258[_0x95d4('0x5b')]=_0xfc8604;return _0x560258;});}})[_0x95d4('0x21')](respondWithFilteredResult(_0x415283,_0x5a055e))[_0x95d4('0x2c')](handleError(_0x415283,null));};exports[_0x95d4('0x6c')]=function(_0x48d993,_0x4dd005,_0x2df75f){return db[_0x95d4('0x43')][_0x95d4('0x65')]({'where':{'id':_0x48d993[_0x95d4('0x5c')]['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x4dd005,null))[_0x95d4('0x21')](function(_0x4bee63){if(_0x4bee63){return _0x4bee63[_0x95d4('0x6c')](_0x48d993[_0x95d4('0x49')][_0x95d4('0x6d')]);}})[_0x95d4('0x21')](respondWithStatusCode(_0x4dd005,null))[_0x95d4('0x2c')](handleError(_0x4dd005,null));};exports[_0x95d4('0x6e')]=function(_0x437810,_0x3f078e,_0x587d9b){if(_0x437810[_0x95d4('0x64')]['id']){delete _0x437810[_0x95d4('0x64')]['id'];}return db[_0x95d4('0x43')][_0x95d4('0x65')]({'where':{'id':_0x437810[_0x95d4('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3f078e,null))[_0x95d4('0x21')](function(_0x4222ec){if(_0x4222ec){_0x437810[_0x95d4('0x64')][_0x95d4('0x6a')]=_0x4222ec['id'];return db[_0x95d4('0x6f')]['create'](_0x437810['body']);}})[_0x95d4('0x21')](respondWithResult(_0x3f078e,null))[_0x95d4('0x2c')](handleError(_0x3f078e,null));};exports['getAnswers']=function(_0x489e5f,_0x5f1929,_0x44ba7c){var _0x75615={'raw':![],'where':{}};var _0x163574={};var _0x230b25={'count':0x0,'rows':[]};return db[_0x95d4('0x43')][_0x95d4('0x70')]({'where':{'id':_0x489e5f[_0x95d4('0x5c')]['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x5f1929,null))[_0x95d4('0x21')](function(_0x21be7){if(_0x21be7){_0x163574[_0x95d4('0x48')]=_[_0x95d4('0x4a')](db['CannedAnswer'][_0x95d4('0x44')]);_0x163574[_0x95d4('0x49')]=_['keys'](_0x489e5f[_0x95d4('0x49')]);_0x163574[_0x95d4('0x4b')]=_[_0x95d4('0x4c')](_0x163574['model'],_0x163574[_0x95d4('0x49')]);_0x75615[_0x95d4('0x4e')]=_['intersection'](_0x163574[_0x95d4('0x48')],qs[_0x95d4('0x4d')](_0x489e5f[_0x95d4('0x49')]['fields']));_0x75615[_0x95d4('0x4e')]=_0x75615[_0x95d4('0x4e')][_0x95d4('0x5d')]?_0x75615['attributes']:_0x163574[_0x95d4('0x48')];if(!_0x489e5f['query'][_0x95d4('0x4f')](_0x95d4('0x50'))){_0x75615[_0x95d4('0x32')]=qs[_0x95d4('0x32')](_0x489e5f[_0x95d4('0x49')]['limit']);_0x75615['offset']=qs['offset'](_0x489e5f[_0x95d4('0x49')]['offset']);}_0x75615['order']=qs[_0x95d4('0x52')](_0x489e5f[_0x95d4('0x49')][_0x95d4('0x52')]);_0x75615['where']=qs[_0x95d4('0x4b')](_[_0x95d4('0x54')](_0x489e5f[_0x95d4('0x49')],_0x163574[_0x95d4('0x4b')]));_0x75615[_0x95d4('0x53')][_0x95d4('0x6a')]=_0x21be7['id'];if(_0x489e5f['query'][_0x95d4('0x55')]){_0x75615[_0x95d4('0x53')]=_['merge'](_0x75615[_0x95d4('0x53')],{'$or':_[_0x95d4('0x42')](_0x75615[_0x95d4('0x4e')],function(_0x518856){var _0x394fb2={};_0x394fb2[_0x518856]={'$like':'%'+_0x489e5f[_0x95d4('0x49')][_0x95d4('0x55')]+'%'};return _0x394fb2;})});}_0x75615=_[_0x95d4('0x56')]({},_0x75615,_0x489e5f['options']);return db[_0x95d4('0x6f')][_0x95d4('0x58')]({'where':_0x75615[_0x95d4('0x53')]})[_0x95d4('0x21')](function(_0x23e849){_0x230b25['count']=_0x23e849;if(_0x489e5f[_0x95d4('0x49')][_0x95d4('0x59')]){_0x75615[_0x95d4('0x5a')]=[{'all':!![]}];}return db[_0x95d4('0x6f')][_0x95d4('0x6b')](_0x75615);})[_0x95d4('0x21')](function(_0x1173ad){_0x230b25[_0x95d4('0x5b')]=_0x1173ad;return _0x230b25;});}})[_0x95d4('0x21')](respondWithFilteredResult(_0x5f1929,_0x75615))[_0x95d4('0x2c')](handleError(_0x5f1929,null));};exports[_0x95d4('0x71')]=function(_0x489b94,_0x29936d,_0x5d970e){return db['FaxAccount'][_0x95d4('0x65')]({'where':{'id':_0x489b94['params']['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x29936d,null))[_0x95d4('0x21')](function(_0x4a7f56){if(_0x4a7f56){return _0x4a7f56[_0x95d4('0x71')](_0x489b94[_0x95d4('0x49')][_0x95d4('0x6d')]);}})[_0x95d4('0x21')](respondWithStatusCode(_0x29936d,null))[_0x95d4('0x2c')](handleError(_0x29936d,null));};exports[_0x95d4('0x72')]=function(_0x2561cd,_0x4631da,_0x33d756){return db[_0x95d4('0x73')]['find']({'where':{'id':_0x2561cd['params']['id']}})['then'](handleEntityNotFound(_0x4631da,null))['then'](function(_0x33d0c5){if(_0x33d0c5){return _0x33d0c5[_0x95d4('0x72')](_0x2561cd['body']['ids'],_[_0x95d4('0x74')](_0x2561cd[_0x95d4('0x64')],['ids','id'])||{});}})[_0x95d4('0x21')](respondWithResult(_0x4631da,null))[_0x95d4('0x2c')](handleError(_0x4631da,null));};exports['getInteractions']=function(_0x884e6d,_0x272f4b,_0x566763){var _0x1e19bf={'raw':![],'where':{}};var _0x4ae200={};var _0x50b5d7={'count':0x0,'rows':[]};return db[_0x95d4('0x43')][_0x95d4('0x70')]({'where':{'id':_0x884e6d['params']['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x272f4b,null))[_0x95d4('0x21')](function(_0x4b1063){if(_0x4b1063){_0x4ae200[_0x95d4('0x48')]=_[_0x95d4('0x4a')](db['FaxInteraction'][_0x95d4('0x44')]);_0x4ae200[_0x95d4('0x49')]=_[_0x95d4('0x4a')](_0x884e6d['query']);_0x4ae200[_0x95d4('0x4b')]=_[_0x95d4('0x4c')](_0x4ae200[_0x95d4('0x48')],_0x4ae200[_0x95d4('0x49')]);_0x1e19bf['attributes']=_['intersection'](_0x4ae200['model'],qs[_0x95d4('0x4d')](_0x884e6d[_0x95d4('0x49')][_0x95d4('0x4d')]));_0x1e19bf[_0x95d4('0x4e')]=_0x1e19bf[_0x95d4('0x4e')][_0x95d4('0x5d')]?_0x1e19bf[_0x95d4('0x4e')]:_0x4ae200[_0x95d4('0x48')];if(!_0x884e6d[_0x95d4('0x49')][_0x95d4('0x4f')](_0x95d4('0x50'))){_0x1e19bf[_0x95d4('0x32')]=qs[_0x95d4('0x32')](_0x884e6d[_0x95d4('0x49')][_0x95d4('0x32')]);_0x1e19bf[_0x95d4('0x31')]=qs[_0x95d4('0x31')](_0x884e6d['query'][_0x95d4('0x31')]);}_0x1e19bf[_0x95d4('0x51')]=qs[_0x95d4('0x52')](_0x884e6d[_0x95d4('0x49')][_0x95d4('0x52')]);_0x1e19bf['where']=qs['filters'](_[_0x95d4('0x54')](_0x884e6d[_0x95d4('0x49')],_0x4ae200[_0x95d4('0x4b')]));_0x1e19bf[_0x95d4('0x53')][_0x95d4('0x6a')]=_0x4b1063['id'];if(_0x884e6d[_0x95d4('0x49')]['filter']){_0x1e19bf[_0x95d4('0x53')]=_[_0x95d4('0x56')](_0x1e19bf['where'],{'$or':_[_0x95d4('0x42')](_0x1e19bf['attributes'],function(_0x3db43d){var _0x471791={};_0x471791[_0x3db43d]={'$like':'%'+_0x884e6d[_0x95d4('0x49')][_0x95d4('0x55')]+'%'};return _0x471791;})});}_0x1e19bf=_[_0x95d4('0x56')]({},_0x1e19bf,_0x884e6d[_0x95d4('0x57')]);return db[_0x95d4('0x73')][_0x95d4('0x58')]({'where':_0x1e19bf[_0x95d4('0x53')]})[_0x95d4('0x21')](function(_0x94e84){_0x50b5d7[_0x95d4('0x58')]=_0x94e84;if(_0x884e6d['query'][_0x95d4('0x59')]){_0x1e19bf[_0x95d4('0x5a')]=[{'model':db[_0x95d4('0x75')],'as':'Contact','required':![]},{'model':db[_0x95d4('0x76')],'as':_0x95d4('0x77'),'attributes':[_0x95d4('0x3d'),_0x95d4('0x78'),'internal'],'required':![]},{'model':db[_0x95d4('0x79')],'as':_0x95d4('0x7a'),'attributes':['id',_0x95d4('0x3d'),_0x95d4('0x7b')],'where':_0x884e6d[_0x95d4('0x49')][_0x95d4('0x7c')]?{'id':_0x884e6d['query'][_0x95d4('0x7c')]}:undefined,'required':_0x884e6d['query']['tag']?!![]:![]}];}return db['FaxInteraction'][_0x95d4('0x6b')](_0x1e19bf);})[_0x95d4('0x21')](function(_0x3da525){_0x50b5d7['rows']=_0x3da525;return _0x50b5d7;});}})[_0x95d4('0x21')](respondWithFilteredResult(_0x272f4b,_0x1e19bf))['catch'](handleError(_0x272f4b,null));};exports['addApplications']=function(_0x587906,_0x94a89c){var _0x21818a=_0x587906['params']['id'];var _0xd2a491=_0x587906['body'];var _0x367b37=0xc8;var _0x42002e=null;return db[_0x95d4('0x7d')]['transaction']({'isolationLevel':db['sequelize'][_0x95d4('0x7e')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x55404f){return db[_0x95d4('0x43')][_0x95d4('0x70')]({'where':{'id':_0x21818a},'transaction':_0x55404f})['then'](function(_0x106cfb){if(_0x106cfb){return db[_0x95d4('0x7f')]['destroy']({'where':{'FaxAccountId':_0x21818a},'transaction':_0x55404f})[_0x95d4('0x21')](function(){var _0x165af0=_['map'](_0xd2a491,function(_0x1c4650){_0x1c4650[_0x95d4('0x6a')]=_0x21818a;return _0x1c4650;});return db[_0x95d4('0x7f')]['bulkCreate'](_0x165af0,{'transaction':_0x55404f});});}else{_0x367b37=0x194;_0x42002e=[];}});})[_0x95d4('0x21')](function(){if(_0x367b37!==0x194){return db[_0x95d4('0x7f')][_0x95d4('0x80')]({'where':{'FaxAccountId':_0x21818a},'order':_0x95d4('0x81')})['then'](function(_0x48180e){_0x42002e=_0x48180e;});}})[_0x95d4('0x2c')](function(_0x499e78){_0x367b37=0x1f4;logger['error'](_0x499e78[_0x95d4('0x3c')]);if(_0x499e78[_0x95d4('0x3d')]){delete _0x499e78[_0x95d4('0x3d')];}_0x42002e=_0x499e78;})[_0x95d4('0x82')](function(){if(_0x42002e===null){_0x94a89c[_0x95d4('0x2d')](_0x367b37);}else{if(_0x367b37===0x1f4){_0x94a89c[_0x95d4('0x2f')](_0x367b37)[_0x95d4('0x3e')](_0x42002e);}else{_0x94a89c[_0x95d4('0x2f')](_0x367b37)[_0x95d4('0x30')](_0x42002e);}}});};exports[_0x95d4('0x83')]=function(_0x1d4069,_0x50cc4c,_0x3f738c){var _0x2deb3e={};var _0x43490e={};var _0x5551a3;var _0x103dc0;return db[_0x95d4('0x43')][_0x95d4('0x70')]({'where':{'id':_0x1d4069[_0x95d4('0x5c')]['id']}})['then'](handleEntityNotFound(_0x50cc4c,null))['then'](function(_0x1b4ddd){if(_0x1b4ddd){_0x5551a3=_0x1b4ddd;_0x43490e[_0x95d4('0x48')]=_[_0x95d4('0x4a')](db[_0x95d4('0x7f')][_0x95d4('0x44')]);_0x43490e[_0x95d4('0x49')]=_[_0x95d4('0x4a')](_0x1d4069[_0x95d4('0x49')]);_0x43490e[_0x95d4('0x4b')]=_[_0x95d4('0x4c')](_0x43490e[_0x95d4('0x48')],_0x43490e[_0x95d4('0x49')]);_0x2deb3e['attributes']=_[_0x95d4('0x4c')](_0x43490e[_0x95d4('0x48')],qs[_0x95d4('0x4d')](_0x1d4069[_0x95d4('0x49')][_0x95d4('0x4d')]));_0x2deb3e[_0x95d4('0x4e')]=_0x2deb3e[_0x95d4('0x4e')][_0x95d4('0x5d')]?_0x2deb3e['attributes']:_0x43490e[_0x95d4('0x48')];_0x2deb3e['order']=qs['sort'](_0x1d4069['query']['sort']);_0x2deb3e[_0x95d4('0x53')]=qs[_0x95d4('0x4b')](_['pick'](_0x1d4069[_0x95d4('0x49')],_0x43490e['filters']));if(_0x1d4069['query']['filter']){_0x2deb3e['where']=_[_0x95d4('0x56')](_0x2deb3e['where'],{'$or':_[_0x95d4('0x42')](_0x2deb3e[_0x95d4('0x4e')],function(_0x4082cb){var _0x366524={};_0x366524[_0x4082cb]={'$like':'%'+_0x1d4069['query'][_0x95d4('0x55')]+'%'};return _0x366524;})});}_0x2deb3e=_['merge']({},_0x2deb3e,_0x1d4069[_0x95d4('0x57')]);return _0x5551a3[_0x95d4('0x83')](_0x2deb3e);}})[_0x95d4('0x21')](function(_0x56b954){if(_0x56b954){_0x103dc0=_0x56b954[_0x95d4('0x5d')];if(!_0x1d4069[_0x95d4('0x49')][_0x95d4('0x4f')](_0x95d4('0x50'))){_0x2deb3e['limit']=qs[_0x95d4('0x32')](_0x1d4069[_0x95d4('0x49')][_0x95d4('0x32')]);_0x2deb3e[_0x95d4('0x31')]=qs[_0x95d4('0x31')](_0x1d4069['query']['offset']);}return _0x5551a3[_0x95d4('0x83')](_0x2deb3e);}})['then'](function(_0x1c3f77){if(_0x1c3f77){return _0x1c3f77?{'count':_0x103dc0,'rows':_0x1c3f77}:null;}})['then'](respondWithResult(_0x50cc4c,null))[_0x95d4('0x2c')](handleError(_0x50cc4c,null));};function Extension(_0x37a9a0,_0x801d86,_0x4570aa,_0x1e2661){this[_0x95d4('0x84')]=_0x95d4('0x85');this[_0x95d4('0x86')]=_0x37a9a0['localstationid'];this['app']=_0x1e2661;this[_0x95d4('0x46')]='system';this[_0x95d4('0x87')]=_0x95d4('0x88');this[_0x95d4('0x6a')]=_0x37a9a0['id'];this[_0x95d4('0x81')]=_0x801d86;this['appdata']=_0x4570aa;}function createExtensionsReciveFax(_0x5d9d1e){var _0x1c014e=0x1;var _0x1ad8d9=[];_0x1ad8d9[_0x95d4('0x89')](new Extension(_0x5d9d1e,_0x1c014e,'',_0x95d4('0x8a')));_0x1c014e+=0x1;_0x1ad8d9[_0x95d4('0x89')](new Extension(_0x5d9d1e,_0x1c014e,_0x95d4('0x8b'),_0x95d4('0x8c')));_0x1c014e+=0x1;for(var _0x20ca26 in _0x5d9d1e){if(_0x5d9d1e['hasOwnProperty'](_0x20ca26)&&(_0x20ca26===_0x95d4('0x8d')||_0x20ca26===_0x95d4('0x8e')||_0x20ca26===_0x95d4('0x8f')||_0x20ca26===_0x95d4('0x90')||_0x20ca26===_0x95d4('0x91')||_0x20ca26===_0x95d4('0x92')||_0x20ca26===_0x95d4('0x93')||_0x20ca26===_0x95d4('0x94')||_0x20ca26===_0x95d4('0x95'))){_0x1ad8d9[_0x95d4('0x89')](new Extension(_0x5d9d1e,_0x1c014e,'FAXOPT('+_0x20ca26+')='+_0x5d9d1e[_0x20ca26],_0x95d4('0x8c')));_0x1c014e+=0x1;}}_0x1ad8d9['push'](new Extension(_0x5d9d1e,_0x1c014e,'6',_0x95d4('0x96')));_0x1c014e+=0x1;_0x1ad8d9[_0x95d4('0x89')](new Extension(_0x5d9d1e,_0x1c014e,_0x95d4('0x97'),_0x95d4('0x98')));_0x1c014e=0x0;return _0x1ad8d9;}exports[_0x95d4('0x99')]=function(_0x2b573c,_0x435b0e,_0x3c234e){var _0x149bc1;return db[_0x95d4('0x7d')]['transaction'](function(_0xa965f7){return db['FaxAccount']['create'](_0x2b573c[_0x95d4('0x64')],{'transaction':_0xa965f7})['then'](function(_0x5eae33){_0x149bc1=_0x5eae33[_0x95d4('0x3a')]({'plain':!![]});return db[_0x95d4('0x9a')][_0x95d4('0x9b')](createExtensionsReciveFax(_0x149bc1),{'transaction':_0xa965f7});});})[_0x95d4('0x21')](function(){return _0x149bc1;})[_0x95d4('0x21')](respondWithResult(_0x435b0e,null))[_0x95d4('0x2c')](handleError(_0x435b0e,null));};exports[_0x95d4('0x9c')]=function(_0x127a6c,_0x163f62,_0x4356ee){var _0x379ea4;return db[_0x95d4('0x7d')][_0x95d4('0x9d')](function(_0x2ffcc2){return db[_0x95d4('0x43')][_0x95d4('0x38')](_0x127a6c['body'],{'where':{'id':_0x127a6c[_0x95d4('0x64')]['id']},'transaction':_0x2ffcc2})[_0x95d4('0x21')](function(_0x5d43f6){return db[_0x95d4('0x9a')][_0x95d4('0x39')]({'where':{'FaxAccountId':_0x127a6c[_0x95d4('0x64')]['id']},'transaction':_0x2ffcc2})['then'](function(_0x286b99){return db['VoiceExtension'][_0x95d4('0x9b')](createExtensionsReciveFax(_['omit'](_0x127a6c[_0x95d4('0x64')],[_0x95d4('0x9e'),'key',_0x95d4('0x9f'),_0x95d4('0xa0'),_0x95d4('0xa1'),_0x95d4('0xa2')])),{'transaction':_0x2ffcc2});});});})[_0x95d4('0x21')](function(){return db[_0x95d4('0x43')][_0x95d4('0xa3')](_0x127a6c['body']['id']);})[_0x95d4('0x21')](respondWithResult(_0x163f62,null))[_0x95d4('0x2c')](handleError(_0x163f62,null));};exports[_0x95d4('0xa4')]=function(_0x23056b,_0x4ed131,_0x461758){var _0x3e375f={'raw':!![],'where':{}};var _0xb241c5={};var _0x1b3ffd={'count':0x0,'rows':[]};return db[_0x95d4('0x43')][_0x95d4('0x70')]({'where':{'id':_0x23056b[_0x95d4('0x5c')]['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x4ed131,null))[_0x95d4('0x21')](function(_0x4c1858){if(_0x4c1858){_0xb241c5[_0x95d4('0x48')]=_[_0x95d4('0x4a')](db[_0x95d4('0xa5')][_0x95d4('0x44')]);_0xb241c5[_0x95d4('0x49')]=_[_0x95d4('0x4a')](_0x23056b[_0x95d4('0x49')]);_0xb241c5[_0x95d4('0x4b')]=_[_0x95d4('0x4c')](_0xb241c5['model'],_0xb241c5[_0x95d4('0x49')]);_0x3e375f['attributes']=_[_0x95d4('0x4c')](_0xb241c5[_0x95d4('0x48')],qs[_0x95d4('0x4d')](_0x23056b[_0x95d4('0x49')]['fields']));_0x3e375f[_0x95d4('0x4e')]=_0x3e375f[_0x95d4('0x4e')]['length']?_0x3e375f[_0x95d4('0x4e')]:_0xb241c5['model'];if(!_0x23056b[_0x95d4('0x49')][_0x95d4('0x4f')]('nolimit')){_0x3e375f[_0x95d4('0x32')]=qs[_0x95d4('0x32')](_0x23056b['query'][_0x95d4('0x32')]);_0x3e375f[_0x95d4('0x31')]=qs[_0x95d4('0x31')](_0x23056b['query']['offset']);}_0x3e375f['order']=qs[_0x95d4('0x52')](_0x23056b[_0x95d4('0x49')][_0x95d4('0x52')]);_0x3e375f[_0x95d4('0x53')]=qs[_0x95d4('0x4b')](_[_0x95d4('0x54')](_0x23056b['query'],_0xb241c5[_0x95d4('0x4b')]));_0x3e375f[_0x95d4('0x53')]['FaxAccountId']=_0x4c1858['id'];if(_0x23056b[_0x95d4('0x49')][_0x95d4('0x55')]){_0x3e375f[_0x95d4('0x53')]=_['merge'](_0x3e375f[_0x95d4('0x53')],{'$or':_[_0x95d4('0x42')](_0x3e375f['attributes'],function(_0x300d35){var _0x4d8c74={};_0x4d8c74[_0x300d35]={'$like':'%'+_0x23056b[_0x95d4('0x49')][_0x95d4('0x55')]+'%'};return _0x4d8c74;})});}if(_0x23056b['query'][_0x95d4('0xa6')]){var _0xa0b2=_0x23056b[_0x95d4('0x49')][_0x95d4('0xa6')][_0x95d4('0xa7')](',');var _0x548a21={};_0x548a21[_0xa0b2[0x0]]={'$gte':moment(_0xa0b2[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3e375f[_0x95d4('0x53')]=_['merge'](_0x3e375f[_0x95d4('0x53')],_0x548a21);}_0x3e375f=_[_0x95d4('0x56')]({},_0x3e375f,_0x23056b['options']);return db['FaxMessage'][_0x95d4('0x58')]({'where':_0x3e375f[_0x95d4('0x53')]})[_0x95d4('0x21')](function(_0x4cbdb5){_0x1b3ffd[_0x95d4('0x58')]=_0x4cbdb5;if(_0x23056b[_0x95d4('0x49')]['includeAll']){_0x3e375f[_0x95d4('0x5a')]=[{'all':!![]}];}return db[_0x95d4('0xa5')]['findAll'](_0x3e375f);})[_0x95d4('0x21')](function(_0x6691bd){_0x1b3ffd['rows']=_0x6691bd;return _0x1b3ffd;});}})[_0x95d4('0x21')](respondWithFilteredResult(_0x4ed131,_0x3e375f))[_0x95d4('0x2c')](handleError(_0x4ed131,null));};exports[_0x95d4('0x3e')]=function(_0x3b3615,_0x4c0884,_0x3337fd){var _0x3b37d3,_0xdf2ce={},_0x51c64e;if(_0x3b3615[_0x95d4('0x64')]['to']){_0x51c64e=_0x3b3615[_0x95d4('0x64')]['to'][0x0];}return db[_0x95d4('0x43')][_0x95d4('0x65')]({'where':{'id':_0x3b3615[_0x95d4('0x5c')]['id']},'include':[{'model':db[_0x95d4('0xa8')],'as':_0x95d4('0xa9'),'include':[{'model':db[_0x95d4('0x75')],'as':_0x95d4('0xaa'),'where':{'fax':_0x51c64e},'limit':0x1,'order':[[_0x95d4('0xa0'),_0x95d4('0xab')]]}]}]})[_0x95d4('0x21')](handleEntityNotFound(_0x4c0884,null))['then'](function(_0x33ad2d){_0x3b37d3=_0x33ad2d;if(_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')]&&_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')]['length']){for(var _0x3121bd=0x0;_0x3121bd<_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')]['length'];_0x3121bd+=0x1){_0x3b3615[_0x95d4('0x64')]['attachments'][_0x3121bd]={'filename':_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')][_0x3121bd][_0x95d4('0x3d')],'id':_0x3b3615[_0x95d4('0x64')]['attachments'][_0x3121bd]['id'],'path':path[_0x95d4('0xad')](config[_0x95d4('0xae')],_0x95d4('0xaf'),_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')][_0x3121bd][_0x95d4('0xb0')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0x95d4('0xb1')](_0x3b3615[_0x95d4('0x5c')]['id'])?undefined:_0x3b3615['params']['id'],'path':_[_0x95d4('0xb1')](_0x3b3615[_0x95d4('0x64')]['attachments'][0x0][_0x95d4('0xb2')])?undefined:_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')][0x0]['path'],'fax':_['isNil'](_0x3b3615[_0x95d4('0x64')]['to'][0x0])?undefined:_0x3b3615[_0x95d4('0x64')]['to'][0x0]},client9002);})[_0x95d4('0x21')](function(){if(_0x3b37d3){if(_['isNil'](_0x3b3615['body'][_0x95d4('0xb3')])){_0x3b3615[_0x95d4('0x64')]['from']=util[_0x95d4('0xb4')](_0x95d4('0xb5'),_0x3b37d3['name'],_0x3b37d3[_0x95d4('0xb6')]);}if(_0x3b37d3['List']){if(_0x3b37d3['List'][_0x95d4('0xaa')][_0x95d4('0x5d')]){return _0x3b37d3['List'][_0x95d4('0xaa')][0x0];}else{return db[_0x95d4('0x75')][_0x95d4('0x5e')](_[_0x95d4('0x18')](_0x3b3615[_0x95d4('0x64')],{'firstName':_0x3b3615[_0x95d4('0x64')]['to'][0x0],'phone':_0x3b3615['body']['to'][0x0],'fax':_0x3b3615[_0x95d4('0x64')]['to'][0x0],'ListId':_0x3b37d3[_0x95d4('0xa2')]}));}}else{throw new Error(_0x95d4('0xb7'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x95d4('0x21')](function(_0x29082c){if(_0x29082c){return db['FaxInteraction'][_0x95d4('0x65')]({'where':{'ContactId':_0x29082c['id'],'closed':![],'FaxAccountId':_0x3b37d3['id']}})[_0x95d4('0x21')](function(_0xaeb33e){if(_0xaeb33e){return[_0xaeb33e,![]];}return db[_0x95d4('0x73')][_0x95d4('0x5e')]({'UserId':_0x3b3615[_0x95d4('0x5f')]['id'],'ContactId':_0x29082c['id'],'FaxAccountId':_0x3b37d3['id'],'fax':_0x3b3615[_0x95d4('0x64')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x3b3615[_0x95d4('0x64')],{'read':![],'body':_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')][0x0][_0x95d4('0xb8')],'FaxAccountId':_0x3b37d3['id'],'UserId':_0x3b3615[_0x95d4('0x5f')]['id'],'ContactId':_0x29082c['id'],'AttachmentId':_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x95d4('0xa5')],'as':_0x95d4('0xb9')}]})[_0x95d4('0x21')](function(_0x2d94fa){return[_0x2d94fa,!![]];});});}else{throw new Error(_0x95d4('0xba'));}})[_0x95d4('0xbb')](function(_0x3c1aad,_0x4c17fc){if(_0x4c17fc){return _0x3c1aad;}return db['FaxMessage'][_0x95d4('0x5e')]({'direction':_0x95d4('0xbc'),'read':![],'body':_0x3b3615[_0x95d4('0x64')]['attachments'][0x0]['filename'],'FaxAccountId':_0x3b37d3['id'],'FaxInteractionId':_0x3c1aad['id'],'UserId':_0x3b3615[_0x95d4('0x5f')]['id'],'ContactId':_0x3c1aad[_0x95d4('0xbd')],'AttachmentId':_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')][0x0]['id']})[_0x95d4('0x21')](function(_0x5043fb){_0x3c1aad['dataValues'][_0x95d4('0xb9')]=[];_0x3c1aad['dataValues']['Messages'][_0x95d4('0x89')](_0x5043fb[_0x95d4('0xbe')]);return _0x3c1aad;});})[_0x95d4('0x21')](function(_0x4dfb54){respondWithRpcPromise('SendFax',_0x95d4('0xbf'),{'FaxAccountId':_['isNil'](_0x3b3615[_0x95d4('0x5c')]['id'])?undefined:_0x3b3615['params']['id'],'path':_['isNil'](_0x3b3615['body']['attachments'][0x0][_0x95d4('0xb2')])?undefined:_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')][0x0][_0x95d4('0xb2')],'fax':_['isNil'](_0x3b3615[_0x95d4('0x64')]['to'][0x0])?undefined:_0x3b3615[_0x95d4('0x64')]['to'][0x0],'AttachmentId':_0x3b3615[_0x95d4('0x64')][_0x95d4('0xac')][0x0]['id']},client9002)[_0x95d4('0x21')](function(_0x5ba0e1){logger[_0x95d4('0x2a')](_0x95d4('0xc0'),_0x5ba0e1);})[_0x95d4('0x2c')](function(_0x5888b2){logger[_0x95d4('0x2a')]('SendFaxRpc,\x20%s',_0x5888b2);});return _0x4dfb54;})[_0x95d4('0x21')](respondWithResult(_0x4c0884,null))[_0x95d4('0x2c')](handleError(_0x4c0884,null));};exports['addAgents']=function(_0x1f1ea1,_0x2882bc,_0x13a0ab){return db['FaxAccount']['find']({'where':{'id':_0x1f1ea1[_0x95d4('0x5c')]['id']}})[_0x95d4('0x21')](handleEntityNotFound(_0x2882bc,null))[_0x95d4('0x21')](function(_0x2e9c83){if(_0x2e9c83){return _0x2e9c83[_0x95d4('0xc1')](_0x1f1ea1['body'][_0x95d4('0x6d')],_[_0x95d4('0x74')](_0x1f1ea1[_0x95d4('0x64')],['ids','id'])||{})[_0x95d4('0xbb')](function(_0x452462){for(var _0xe9bac2=0x0;_0xe9bac2<_0x1f1ea1[_0x95d4('0x64')][_0x95d4('0x6d')][_0x95d4('0x5d')];_0xe9bac2+=0x1){socket['emit'](_0x95d4('0xc2'),{'UserId':Number(_0x1f1ea1[_0x95d4('0x64')]['ids'][_0xe9bac2]),'FaxAccountId':Number(_0x1f1ea1[_0x95d4('0x5c')]['id'])});}return _0x452462;});}})[_0x95d4('0x21')](respondWithResult(_0x2882bc,null))[_0x95d4('0x2c')](handleError(_0x2882bc,null));};exports[_0x95d4('0xc3')]=function(_0x24c44a,_0x5276dc,_0x53c160){return db[_0x95d4('0x43')][_0x95d4('0x65')]({'where':{'id':_0x24c44a[_0x95d4('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5276dc,null))[_0x95d4('0x21')](function(_0x177bf0){if(_0x177bf0){return _0x177bf0[_0x95d4('0xc3')](_0x24c44a[_0x95d4('0x49')][_0x95d4('0x6d')])[_0x95d4('0x21')](function(){if(_[_0x95d4('0xc4')](_0x24c44a['query'][_0x95d4('0x6d')])){for(var _0x4b9ee7=0x0;_0x4b9ee7<_0x24c44a[_0x95d4('0x49')][_0x95d4('0x6d')][_0x95d4('0x5d')];_0x4b9ee7+=0x1){socket[_0x95d4('0xc5')](_0x95d4('0xc6'),{'UserId':Number(_0x24c44a[_0x95d4('0x49')][_0x95d4('0x6d')][_0x4b9ee7]),'FaxAccountId':Number(_0x24c44a['params']['id'])});}}else{socket[_0x95d4('0xc5')]('userFaxAccount:remove',{'UserId':Number(_0x24c44a['query'][_0x95d4('0x6d')]),'FaxAccountId':Number(_0x24c44a[_0x95d4('0x5c')]['id'])});}});}})[_0x95d4('0x21')](respondWithStatusCode(_0x5276dc,null))[_0x95d4('0x2c')](handleError(_0x5276dc,null));};exports[_0x95d4('0xc7')]=function(_0x2a1c26,_0x55791a,_0x486f54){var _0x443961={};var _0x17266d={};var _0x240f89;var _0x5cef1f;return db['FaxAccount'][_0x95d4('0x70')]({'where':{'id':_0x2a1c26[_0x95d4('0x5c')]['id']}})['then'](handleEntityNotFound(_0x55791a,null))[_0x95d4('0x21')](function(_0x51b78a){if(_0x51b78a){_0x240f89=_0x51b78a;_0x17266d[_0x95d4('0x48')]=_[_0x95d4('0x4a')](db[_0x95d4('0x76')][_0x95d4('0x44')]);_0x17266d[_0x95d4('0x49')]=_[_0x95d4('0x4a')](_0x2a1c26[_0x95d4('0x49')]);_0x17266d[_0x95d4('0x4b')]=_['intersection'](_0x17266d[_0x95d4('0x48')],_0x17266d['query']);_0x443961['attributes']=_[_0x95d4('0x4c')](_0x17266d['model'],qs[_0x95d4('0x4d')](_0x2a1c26[_0x95d4('0x49')][_0x95d4('0x4d')]));_0x443961[_0x95d4('0x4e')]=_0x443961['attributes'][_0x95d4('0x5d')]?_0x443961[_0x95d4('0x4e')]:_0x17266d['model'];_0x443961[_0x95d4('0x51')]=qs[_0x95d4('0x52')](_0x2a1c26[_0x95d4('0x49')][_0x95d4('0x52')]);_0x443961[_0x95d4('0x53')]=qs[_0x95d4('0x4b')](_[_0x95d4('0x54')](_0x2a1c26['query'],_0x17266d[_0x95d4('0x4b')]));if(_0x2a1c26[_0x95d4('0x49')]['filter']){_0x443961[_0x95d4('0x53')]=_[_0x95d4('0x56')](_0x443961['where'],{'$or':_[_0x95d4('0x42')](_0x443961[_0x95d4('0x4e')],function(_0x2ae7c3){var _0x4d345d={};_0x4d345d[_0x2ae7c3]={'$like':'%'+_0x2a1c26[_0x95d4('0x49')][_0x95d4('0x55')]+'%'};return _0x4d345d;})});}_0x443961=_['merge']({},_0x443961,_0x2a1c26[_0x95d4('0x57')]);return _0x240f89[_0x95d4('0xc7')](_0x443961);}})[_0x95d4('0x21')](function(_0x5adf0f){if(_0x5adf0f){_0x5cef1f=_0x5adf0f[_0x95d4('0x5d')];if(!_0x2a1c26[_0x95d4('0x49')][_0x95d4('0x4f')]('nolimit')){_0x443961[_0x95d4('0x32')]=qs[_0x95d4('0x32')](_0x2a1c26[_0x95d4('0x49')]['limit']);_0x443961['offset']=qs[_0x95d4('0x31')](_0x2a1c26[_0x95d4('0x49')][_0x95d4('0x31')]);}return _0x240f89[_0x95d4('0xc7')](_0x443961);}})[_0x95d4('0x21')](function(_0x4ce1b2){if(_0x4ce1b2){return _0x4ce1b2?{'count':_0x5cef1f,'rows':_0x4ce1b2}:null;}})['then'](respondWithResult(_0x55791a,null))[_0x95d4('0x2c')](handleError(_0x55791a,null));}; \ No newline at end of file +var _0xddfe=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','status','json','offset','undefined','limit','count','apply','reject','update','FaxAccounts','UserProfileResource','destroy','end','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','show','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','options','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','FaxApplication','findAndCountAll','finally','send','getApplications','context','app','system','description','priority','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','minrate','modem','t38timeout','/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','transaction','tech','createdAt','TrunkId','ListId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','attachments','join','root','CheckAfterSend','isNil','from','List\x20not\x20found','user','out','FaxMessage','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf'];(function(_0x5f482d,_0x13f6ca){var _0x28648d=function(_0xbbb2f){while(--_0xbbb2f){_0x5f482d['push'](_0x5f482d['shift']());}};_0x28648d(++_0x13f6ca);}(_0xddfe,0x176));var _0xeddf=function(_0x174185,_0x1c11aa){_0x174185=_0x174185-0x0;var _0x4d6eb7=_0xddfe[_0x174185];return _0x4d6eb7;};'use strict';var emlformat=require(_0xeddf('0x0'));var rimraf=require(_0xeddf('0x1'));var zipdir=require(_0xeddf('0x2'));var jsonpatch=require(_0xeddf('0x3'));var rp=require(_0xeddf('0x4'));var moment=require(_0xeddf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeddf('0x6'));var util=require(_0xeddf('0x7'));var path=require(_0xeddf('0x8'));var sox=require(_0xeddf('0x9'));var csv=require(_0xeddf('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeddf('0xb'));var _=require(_0xeddf('0xc'));var squel=require('squel');var crypto=require(_0xeddf('0xd'));var jsforce=require(_0xeddf('0xe'));var deskjs=require(_0xeddf('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeddf('0x10'));var Papa=require(_0xeddf('0x11'));var Redis=require(_0xeddf('0x12'));var authService=require(_0xeddf('0x13'));var qs=require(_0xeddf('0x14'));var as=require(_0xeddf('0x15'));var hardwareService=require(_0xeddf('0x16'));var logger=require(_0xeddf('0x17'))(_0xeddf('0x18'));var utils=require(_0xeddf('0x19'));var config=require(_0xeddf('0x1a'));var licenseUtil=require(_0xeddf('0x1b'));var db=require(_0xeddf('0x1c'))['db'];config[_0xeddf('0x1d')]=_[_0xeddf('0x1e')](config[_0xeddf('0x1d')],{'host':_0xeddf('0x1f'),'port':0x18eb});var socket=require(_0xeddf('0x20'))(new Redis(config[_0xeddf('0x1d')]));require(_0xeddf('0x21'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xeddf('0x22')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x502c0d,_0x3766a1,_0x26e5ad,_0x5a2507){return new BPromise(function(_0x3999a6,_0x3eecc7){var _0x469efd=_0x5a2507||client;return _0x469efd[_0xeddf('0x23')](_0x502c0d,_0x26e5ad)[_0xeddf('0x24')](function(_0x22db8f){logger[_0xeddf('0x25')](_0xeddf('0x26'),_0x3766a1,_0xeddf('0x27'));logger[_0xeddf('0x28')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3766a1,_0xeddf('0x27'),JSON['stringify'](_0x22db8f));if(_0x22db8f[_0xeddf('0x29')]){if(_0x22db8f['error']['code']===0x1f4){logger[_0xeddf('0x29')]('FaxAccount,\x20%s,\x20%s',_0x3766a1,_0x22db8f['error'][_0xeddf('0x2a')]);return _0x3eecc7(_0x22db8f[_0xeddf('0x29')][_0xeddf('0x2a')]);}logger[_0xeddf('0x29')](_0xeddf('0x26'),_0x3766a1,_0x22db8f[_0xeddf('0x29')]['message']);return _0x3999a6(_0x22db8f['error']['message']);}else{logger[_0xeddf('0x25')](_0xeddf('0x26'),_0x3766a1,_0xeddf('0x27'));_0x3999a6(_0x22db8f['result'][_0xeddf('0x2a')]);}})[_0xeddf('0x2b')](function(_0x118e64){logger['error'](_0xeddf('0x26'),_0x3766a1,_0x118e64);_0x3eecc7(_0x118e64);});});}function respondWithStatusCode(_0x4685b4,_0x328735){_0x328735=_0x328735||0xcc;return function(_0x2b1b25){if(_0x2b1b25){return _0x4685b4['sendStatus'](_0x328735);}return _0x4685b4[_0xeddf('0x2c')](_0x328735)['end']();};}function respondWithResult(_0x48daad,_0x37b0bd){_0x37b0bd=_0x37b0bd||0xc8;return function(_0x40faa3){if(_0x40faa3){return _0x48daad[_0xeddf('0x2c')](_0x37b0bd)[_0xeddf('0x2d')](_0x40faa3);}};}function respondWithFilteredResult(_0x12aa21,_0x626ce2){return function(_0x177ef8){if(_0x177ef8){var _0x3c6ecf=typeof _0x626ce2[_0xeddf('0x2e')]===_0xeddf('0x2f')&&typeof _0x626ce2[_0xeddf('0x30')]==='undefined';var _0x50dbbd=_0x177ef8[_0xeddf('0x31')];var _0x153020=_0x3c6ecf?0x0:_0x626ce2[_0xeddf('0x2e')];var _0x8f1afe=_0x3c6ecf?_0x177ef8[_0xeddf('0x31')]:_0x626ce2[_0xeddf('0x2e')]+_0x626ce2[_0xeddf('0x30')];var _0x56c11a;if(_0x8f1afe>=_0x50dbbd){_0x8f1afe=_0x50dbbd;_0x56c11a=0xc8;}else{_0x56c11a=0xce;}_0x12aa21[_0xeddf('0x2c')](_0x56c11a);return _0x12aa21['set']('Content-Range',_0x153020+'-'+_0x8f1afe+'/'+_0x50dbbd)[_0xeddf('0x2d')](_0x177ef8);}return null;};}function patchUpdates(_0x19f8be){return function(_0x54ea62){try{jsonpatch[_0xeddf('0x32')](_0x54ea62,_0x19f8be,!![]);}catch(_0x20e4b4){return BPromise[_0xeddf('0x33')](_0x20e4b4);}return _0x54ea62['save']();};}function saveUpdates(_0x235ab3,_0xb9e58c){return function(_0x39844d){if(_0x39844d){return _0x39844d[_0xeddf('0x34')](_0x235ab3)['then'](function(_0x4cf574){return _0x4cf574;});}return null;};}function removeEntity(_0x20a075,_0x2feed0){return function(_0x3cac32){if(_0x3cac32){return _0x3cac32['destroy']()['then'](function(){var _0x443a57=_0x3cac32['get']({'plain':!![]});var _0x220ca7=_0xeddf('0x35');return db[_0xeddf('0x36')][_0xeddf('0x37')]({'where':{'type':_0x220ca7,'resourceId':_0x443a57['id']}})['then'](function(){return _0x3cac32;});})['then'](function(){_0x20a075[_0xeddf('0x2c')](0xcc)[_0xeddf('0x38')]();});}};}function handleEntityNotFound(_0x3ca201,_0x2561a0){return function(_0x37c0cb){if(!_0x37c0cb){_0x3ca201[_0xeddf('0x39')](0x194);}return _0x37c0cb;};}function handleError(_0x470a93,_0x22c29d){_0x22c29d=_0x22c29d||0x1f4;return function(_0x5aafac){logger[_0xeddf('0x29')](_0x5aafac[_0xeddf('0x3a')]);if(_0x5aafac[_0xeddf('0x3b')]){delete _0x5aafac[_0xeddf('0x3b')];}_0x470a93[_0xeddf('0x2c')](_0x22c29d)['send'](_0x5aafac);};}exports[_0xeddf('0x3c')]=function(_0x2945cd,_0x10e732){var _0x2b03f0={'include':[{'model':db[_0xeddf('0x3d')],'as':_0xeddf('0x3e')}]},_0x132bed={},_0x2e6713={'count':0x0,'rows':[]};var _0x1581f3=_[_0xeddf('0x3f')](db[_0xeddf('0x40')][_0xeddf('0x41')],function(_0x48ab4d){return{'name':_0x48ab4d[_0xeddf('0x42')],'type':_0x48ab4d[_0xeddf('0x43')]['key']};});_0x132bed['model']=_[_0xeddf('0x3f')](_0x1581f3,_0xeddf('0x3b'));_0x132bed[_0xeddf('0x44')]=_[_0xeddf('0x45')](_0x2945cd[_0xeddf('0x44')]);_0x132bed[_0xeddf('0x46')]=_[_0xeddf('0x47')](_0x132bed[_0xeddf('0x48')],_0x132bed['query']);_0x2b03f0[_0xeddf('0x49')]=_[_0xeddf('0x47')](_0x132bed[_0xeddf('0x48')],qs['fields'](_0x2945cd['query'][_0xeddf('0x4a')]));_0x2b03f0[_0xeddf('0x49')]=_0x2b03f0[_0xeddf('0x49')][_0xeddf('0x4b')]?_0x2b03f0[_0xeddf('0x49')]:_0x132bed[_0xeddf('0x48')];if(!_0x2945cd[_0xeddf('0x44')][_0xeddf('0x4c')](_0xeddf('0x4d'))){_0x2b03f0[_0xeddf('0x30')]=qs[_0xeddf('0x30')](_0x2945cd[_0xeddf('0x44')][_0xeddf('0x30')]);_0x2b03f0[_0xeddf('0x2e')]=qs[_0xeddf('0x2e')](_0x2945cd[_0xeddf('0x44')][_0xeddf('0x2e')]);}_0x2b03f0[_0xeddf('0x4e')]=qs[_0xeddf('0x4f')](_0x2945cd[_0xeddf('0x44')][_0xeddf('0x4f')]);_0x2b03f0[_0xeddf('0x50')]=qs[_0xeddf('0x46')](_[_0xeddf('0x51')](_0x2945cd['query'],_0x132bed[_0xeddf('0x46')]),_0x1581f3);if(_0x2945cd[_0xeddf('0x44')]['filter']){_0x2b03f0['where']=_[_0xeddf('0x52')](_0x2b03f0[_0xeddf('0x50')],{'$or':_['map'](_0x1581f3,function(_0x435ec9){if(_0x435ec9['type']!=='VIRTUAL'){var _0x31d694={};_0x31d694[_0x435ec9[_0xeddf('0x3b')]]={'$like':'%'+_0x2945cd[_0xeddf('0x44')][_0xeddf('0x53')]+'%'};return _0x31d694;}})});}_0x2b03f0=_[_0xeddf('0x52')]({},_0x2b03f0,_0x2945cd['options']);var _0xab27d={'where':_0x2b03f0[_0xeddf('0x50')]};return db[_0xeddf('0x40')][_0xeddf('0x31')](_0xab27d)[_0xeddf('0x24')](function(_0x39927a){_0x2e6713['count']=_0x39927a;if(_0x2945cd['query'][_0xeddf('0x54')]){_0x2b03f0[_0xeddf('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0xeddf('0x56')](_0x2b03f0);})[_0xeddf('0x24')](function(_0x223208){_0x2e6713[_0xeddf('0x57')]=_0x223208;return _0x2e6713;})[_0xeddf('0x24')](respondWithFilteredResult(_0x10e732,_0x2b03f0))[_0xeddf('0x2b')](handleError(_0x10e732,null));};exports[_0xeddf('0x58')]=function(_0x1d9f0e,_0x4fc0b7){var _0x3c4e10={'raw':![],'where':{'id':_0x1d9f0e[_0xeddf('0x59')]['id']},'include':[{'model':db[_0xeddf('0x3d')],'as':_0xeddf('0x3e')}]},_0x356c18={};_0x356c18[_0xeddf('0x48')]=_[_0xeddf('0x45')](db[_0xeddf('0x40')]['rawAttributes']);_0x356c18['query']=_[_0xeddf('0x45')](_0x1d9f0e[_0xeddf('0x44')]);_0x356c18[_0xeddf('0x46')]=_['intersection'](_0x356c18[_0xeddf('0x48')],_0x356c18[_0xeddf('0x44')]);_0x3c4e10['attributes']=_[_0xeddf('0x47')](_0x356c18['model'],qs[_0xeddf('0x4a')](_0x1d9f0e[_0xeddf('0x44')][_0xeddf('0x4a')]));_0x3c4e10['attributes']=_0x3c4e10['attributes']['length']?_0x3c4e10[_0xeddf('0x49')]:_0x356c18[_0xeddf('0x48')];if(_0x1d9f0e[_0xeddf('0x44')]['includeAll']){_0x3c4e10[_0xeddf('0x55')]=[{'all':!![]}];}_0x3c4e10=_[_0xeddf('0x52')]({},_0x3c4e10,_0x1d9f0e['options']);return db['FaxAccount']['find'](_0x3c4e10)[_0xeddf('0x24')](handleEntityNotFound(_0x4fc0b7,null))[_0xeddf('0x24')](respondWithResult(_0x4fc0b7,null))['catch'](handleError(_0x4fc0b7,null));};exports[_0xeddf('0x5a')]=function(_0x137d0a,_0x2fdbcb){return db['FaxAccount']['create'](_0x137d0a[_0xeddf('0x5b')],{})[_0xeddf('0x24')](function(_0x45c20c){var _0xc61b2a=_0x137d0a['user'][_0xeddf('0x5c')]({'plain':!![]});if(!_0xc61b2a)throw new Error(_0xeddf('0x5d'));if(_0xc61b2a[_0xeddf('0x5e')]==='user'){var _0x1e9f49=_0x45c20c[_0xeddf('0x5c')]({'plain':!![]});var _0x2108ba=_0xeddf('0x35');return db[_0xeddf('0x5f')][_0xeddf('0x60')]({'where':{'name':_0x2108ba,'userProfileId':_0xc61b2a[_0xeddf('0x61')]},'raw':!![]})[_0xeddf('0x24')](function(_0x2ffd36){if(_0x2ffd36&&_0x2ffd36[_0xeddf('0x62')]===0x0){return db[_0xeddf('0x36')]['create']({'name':_0x1e9f49[_0xeddf('0x3b')],'resourceId':_0x1e9f49['id'],'type':_0x2ffd36['name'],'sectionId':_0x2ffd36['id']},{})['then'](function(){return _0x45c20c;});}else{return _0x45c20c;}})[_0xeddf('0x2b')](function(_0x5b2a1f){logger['error'](_0xeddf('0x63'),_0x5b2a1f);throw _0x5b2a1f;});}return _0x45c20c;})[_0xeddf('0x24')](respondWithResult(_0x2fdbcb,0xc9))['catch'](handleError(_0x2fdbcb,null));};exports[_0xeddf('0x34')]=function(_0x5db415,_0x2c7268){if(_0x5db415[_0xeddf('0x5b')]['id']){delete _0x5db415[_0xeddf('0x5b')]['id'];}return db['FaxAccount'][_0xeddf('0x60')]({'where':{'id':_0x5db415['params']['id']},'include':[{'model':db[_0xeddf('0x3d')],'as':_0xeddf('0x3e')}]})[_0xeddf('0x24')](handleEntityNotFound(_0x2c7268,null))[_0xeddf('0x24')](saveUpdates(_0x5db415['body'],null))[_0xeddf('0x24')](respondWithResult(_0x2c7268,null))[_0xeddf('0x2b')](handleError(_0x2c7268,null));};exports[_0xeddf('0x37')]=function(_0x50c98a,_0x591a7e){return db[_0xeddf('0x40')]['find']({'where':{'id':_0x50c98a['params']['id']}})[_0xeddf('0x24')](handleEntityNotFound(_0x591a7e,null))[_0xeddf('0x24')](removeEntity(_0x591a7e,null))['catch'](handleError(_0x591a7e,null));};exports[_0xeddf('0x64')]=function(_0x7b6aa3,_0x2c4c4e){return db['FaxAccount']['describe']()[_0xeddf('0x24')](respondWithResult(_0x2c4c4e,null))[_0xeddf('0x2b')](handleError(_0x2c4c4e,null));};exports[_0xeddf('0x65')]=function(_0x58dd98,_0x1c3a29,_0x4d3104){if(_0x58dd98[_0xeddf('0x5b')]['id']){delete _0x58dd98['body']['id'];}return db[_0xeddf('0x40')]['find']({'where':{'id':_0x58dd98[_0xeddf('0x59')]['id']}})[_0xeddf('0x24')](handleEntityNotFound(_0x1c3a29,null))[_0xeddf('0x24')](function(_0x1169b1){if(_0x1169b1){_0x58dd98[_0xeddf('0x5b')][_0xeddf('0x66')]=_0x1169b1['id'];return db[_0xeddf('0x67')][_0xeddf('0x5a')](_0x58dd98[_0xeddf('0x5b')]);}})[_0xeddf('0x24')](respondWithResult(_0x1c3a29,null))[_0xeddf('0x2b')](handleError(_0x1c3a29,null));};exports[_0xeddf('0x68')]=function(_0x1fb753,_0x2eb431,_0x21082e){var _0x3b021e={'raw':![],'where':{}};var _0x5d0daf={};var _0x46ad5e={'count':0x0,'rows':[]};return db[_0xeddf('0x40')][_0xeddf('0x69')]({'where':{'id':_0x1fb753[_0xeddf('0x59')]['id']}})[_0xeddf('0x24')](handleEntityNotFound(_0x2eb431,null))[_0xeddf('0x24')](function(_0x289366){if(_0x289366){_0x5d0daf[_0xeddf('0x48')]=_['keys'](db['Disposition']['rawAttributes']);_0x5d0daf[_0xeddf('0x44')]=_[_0xeddf('0x45')](_0x1fb753[_0xeddf('0x44')]);_0x5d0daf['filters']=_[_0xeddf('0x47')](_0x5d0daf[_0xeddf('0x48')],_0x5d0daf[_0xeddf('0x44')]);_0x3b021e['attributes']=_[_0xeddf('0x47')](_0x5d0daf[_0xeddf('0x48')],qs[_0xeddf('0x4a')](_0x1fb753[_0xeddf('0x44')][_0xeddf('0x4a')]));_0x3b021e[_0xeddf('0x49')]=_0x3b021e['attributes'][_0xeddf('0x4b')]?_0x3b021e[_0xeddf('0x49')]:_0x5d0daf[_0xeddf('0x48')];if(!_0x1fb753[_0xeddf('0x44')][_0xeddf('0x4c')](_0xeddf('0x4d'))){_0x3b021e['limit']=qs[_0xeddf('0x30')](_0x1fb753[_0xeddf('0x44')][_0xeddf('0x30')]);_0x3b021e['offset']=qs['offset'](_0x1fb753[_0xeddf('0x44')]['offset']);}_0x3b021e[_0xeddf('0x4e')]=qs[_0xeddf('0x4f')](_0x1fb753['query'][_0xeddf('0x4f')]);_0x3b021e[_0xeddf('0x50')]=qs[_0xeddf('0x46')](_[_0xeddf('0x51')](_0x1fb753[_0xeddf('0x44')],_0x5d0daf['filters']));_0x3b021e[_0xeddf('0x50')][_0xeddf('0x66')]=_0x289366['id'];if(_0x1fb753[_0xeddf('0x44')][_0xeddf('0x53')]){_0x3b021e[_0xeddf('0x50')]=_[_0xeddf('0x52')](_0x3b021e[_0xeddf('0x50')],{'$or':_[_0xeddf('0x3f')](_0x3b021e[_0xeddf('0x49')],function(_0x56b57c){var _0x33d4b0={};_0x33d4b0[_0x56b57c]={'$like':'%'+_0x1fb753[_0xeddf('0x44')][_0xeddf('0x53')]+'%'};return _0x33d4b0;})});}_0x3b021e=_['merge']({},_0x3b021e,_0x1fb753[_0xeddf('0x6a')]);return db[_0xeddf('0x67')][_0xeddf('0x31')]({'where':_0x3b021e[_0xeddf('0x50')]})[_0xeddf('0x24')](function(_0x1b35db){_0x46ad5e[_0xeddf('0x31')]=_0x1b35db;if(_0x1fb753[_0xeddf('0x44')]['includeAll']){_0x3b021e['include']=[{'all':!![]}];}return db['Disposition'][_0xeddf('0x56')](_0x3b021e);})['then'](function(_0x1288b3){_0x46ad5e['rows']=_0x1288b3;return _0x46ad5e;});}})[_0xeddf('0x24')](respondWithFilteredResult(_0x2eb431,_0x3b021e))['catch'](handleError(_0x2eb431,null));};exports[_0xeddf('0x6b')]=function(_0x1707a0,_0x5dad04,_0x10941f){return db['FaxAccount'][_0xeddf('0x60')]({'where':{'id':_0x1707a0[_0xeddf('0x59')]['id']}})[_0xeddf('0x24')](handleEntityNotFound(_0x5dad04,null))['then'](function(_0x315bfa){if(_0x315bfa){return _0x315bfa[_0xeddf('0x6b')](_0x1707a0[_0xeddf('0x44')][_0xeddf('0x6c')]);}})[_0xeddf('0x24')](respondWithStatusCode(_0x5dad04,null))['catch'](handleError(_0x5dad04,null));};exports['addAnswer']=function(_0x13cadb,_0x5c146c,_0x3a308a){if(_0x13cadb[_0xeddf('0x5b')]['id']){delete _0x13cadb[_0xeddf('0x5b')]['id'];}return db[_0xeddf('0x40')][_0xeddf('0x60')]({'where':{'id':_0x13cadb['params']['id']}})[_0xeddf('0x24')](handleEntityNotFound(_0x5c146c,null))[_0xeddf('0x24')](function(_0x4937f2){if(_0x4937f2){_0x13cadb['body'][_0xeddf('0x66')]=_0x4937f2['id'];return db[_0xeddf('0x6d')][_0xeddf('0x5a')](_0x13cadb['body']);}})[_0xeddf('0x24')](respondWithResult(_0x5c146c,null))[_0xeddf('0x2b')](handleError(_0x5c146c,null));};exports[_0xeddf('0x6e')]=function(_0x194b40,_0x3b58be,_0x5ebab5){var _0x4ef068={'raw':![],'where':{}};var _0x20342b={};var _0x5d3cc2={'count':0x0,'rows':[]};return db[_0xeddf('0x40')][_0xeddf('0x69')]({'where':{'id':_0x194b40['params']['id']}})['then'](handleEntityNotFound(_0x3b58be,null))['then'](function(_0x44b7fa){if(_0x44b7fa){_0x20342b[_0xeddf('0x48')]=_['keys'](db['CannedAnswer'][_0xeddf('0x41')]);_0x20342b[_0xeddf('0x44')]=_[_0xeddf('0x45')](_0x194b40[_0xeddf('0x44')]);_0x20342b[_0xeddf('0x46')]=_[_0xeddf('0x47')](_0x20342b[_0xeddf('0x48')],_0x20342b[_0xeddf('0x44')]);_0x4ef068[_0xeddf('0x49')]=_['intersection'](_0x20342b[_0xeddf('0x48')],qs[_0xeddf('0x4a')](_0x194b40['query']['fields']));_0x4ef068[_0xeddf('0x49')]=_0x4ef068[_0xeddf('0x49')]['length']?_0x4ef068['attributes']:_0x20342b[_0xeddf('0x48')];if(!_0x194b40[_0xeddf('0x44')][_0xeddf('0x4c')](_0xeddf('0x4d'))){_0x4ef068[_0xeddf('0x30')]=qs['limit'](_0x194b40[_0xeddf('0x44')]['limit']);_0x4ef068['offset']=qs['offset'](_0x194b40['query'][_0xeddf('0x2e')]);}_0x4ef068[_0xeddf('0x4e')]=qs[_0xeddf('0x4f')](_0x194b40[_0xeddf('0x44')][_0xeddf('0x4f')]);_0x4ef068[_0xeddf('0x50')]=qs[_0xeddf('0x46')](_['pick'](_0x194b40[_0xeddf('0x44')],_0x20342b['filters']));_0x4ef068['where'][_0xeddf('0x66')]=_0x44b7fa['id'];if(_0x194b40[_0xeddf('0x44')][_0xeddf('0x53')]){_0x4ef068[_0xeddf('0x50')]=_['merge'](_0x4ef068[_0xeddf('0x50')],{'$or':_[_0xeddf('0x3f')](_0x4ef068['attributes'],function(_0x1ed1e3){var _0x25c3c4={};_0x25c3c4[_0x1ed1e3]={'$like':'%'+_0x194b40['query'][_0xeddf('0x53')]+'%'};return _0x25c3c4;})});}_0x4ef068=_['merge']({},_0x4ef068,_0x194b40['options']);return db['CannedAnswer']['count']({'where':_0x4ef068[_0xeddf('0x50')]})['then'](function(_0x240914){_0x5d3cc2[_0xeddf('0x31')]=_0x240914;if(_0x194b40['query'][_0xeddf('0x54')]){_0x4ef068[_0xeddf('0x55')]=[{'all':!![]}];}return db[_0xeddf('0x6d')][_0xeddf('0x56')](_0x4ef068);})[_0xeddf('0x24')](function(_0x126766){_0x5d3cc2[_0xeddf('0x57')]=_0x126766;return _0x5d3cc2;});}})['then'](respondWithFilteredResult(_0x3b58be,_0x4ef068))[_0xeddf('0x2b')](handleError(_0x3b58be,null));};exports[_0xeddf('0x6f')]=function(_0x1f15b8,_0x500351,_0x37db07){return db[_0xeddf('0x40')]['find']({'where':{'id':_0x1f15b8[_0xeddf('0x59')]['id']}})['then'](handleEntityNotFound(_0x500351,null))['then'](function(_0x3f7bba){if(_0x3f7bba){return _0x3f7bba[_0xeddf('0x6f')](_0x1f15b8[_0xeddf('0x44')][_0xeddf('0x6c')]);}})[_0xeddf('0x24')](respondWithStatusCode(_0x500351,null))[_0xeddf('0x2b')](handleError(_0x500351,null));};exports[_0xeddf('0x70')]=function(_0x1a4004,_0x46f5c0,_0x1f94d7){return db['FaxInteraction'][_0xeddf('0x60')]({'where':{'id':_0x1a4004[_0xeddf('0x59')]['id']}})[_0xeddf('0x24')](handleEntityNotFound(_0x46f5c0,null))[_0xeddf('0x24')](function(_0x307df3){if(_0x307df3){return _0x307df3[_0xeddf('0x70')](_0x1a4004['body']['ids'],_[_0xeddf('0x71')](_0x1a4004['body'],[_0xeddf('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x46f5c0,null))[_0xeddf('0x2b')](handleError(_0x46f5c0,null));};exports[_0xeddf('0x72')]=function(_0x416c10,_0x3c6709,_0x56fb17){var _0x1120e8={'raw':![],'where':{}};var _0x86e451={};var _0x59bab6={'count':0x0,'rows':[]};return db[_0xeddf('0x40')][_0xeddf('0x69')]({'where':{'id':_0x416c10[_0xeddf('0x59')]['id']}})['then'](handleEntityNotFound(_0x3c6709,null))['then'](function(_0x32cdd8){if(_0x32cdd8){_0x86e451[_0xeddf('0x48')]=_[_0xeddf('0x45')](db[_0xeddf('0x73')][_0xeddf('0x41')]);_0x86e451[_0xeddf('0x44')]=_[_0xeddf('0x45')](_0x416c10[_0xeddf('0x44')]);_0x86e451[_0xeddf('0x46')]=_[_0xeddf('0x47')](_0x86e451[_0xeddf('0x48')],_0x86e451[_0xeddf('0x44')]);_0x1120e8['attributes']=_[_0xeddf('0x47')](_0x86e451[_0xeddf('0x48')],qs[_0xeddf('0x4a')](_0x416c10[_0xeddf('0x44')][_0xeddf('0x4a')]));_0x1120e8[_0xeddf('0x49')]=_0x1120e8[_0xeddf('0x49')][_0xeddf('0x4b')]?_0x1120e8['attributes']:_0x86e451[_0xeddf('0x48')];if(!_0x416c10['query'][_0xeddf('0x4c')](_0xeddf('0x4d'))){_0x1120e8[_0xeddf('0x30')]=qs['limit'](_0x416c10[_0xeddf('0x44')][_0xeddf('0x30')]);_0x1120e8[_0xeddf('0x2e')]=qs[_0xeddf('0x2e')](_0x416c10['query'][_0xeddf('0x2e')]);}_0x1120e8[_0xeddf('0x4e')]=qs['sort'](_0x416c10[_0xeddf('0x44')]['sort']);_0x1120e8[_0xeddf('0x50')]=qs[_0xeddf('0x46')](_['pick'](_0x416c10['query'],_0x86e451[_0xeddf('0x46')]));_0x1120e8[_0xeddf('0x50')]['FaxAccountId']=_0x32cdd8['id'];if(_0x416c10[_0xeddf('0x44')]['filter']){_0x1120e8[_0xeddf('0x50')]=_[_0xeddf('0x52')](_0x1120e8['where'],{'$or':_[_0xeddf('0x3f')](_0x1120e8[_0xeddf('0x49')],function(_0x1416f3){var _0x5992fc={};_0x5992fc[_0x1416f3]={'$like':'%'+_0x416c10['query'][_0xeddf('0x53')]+'%'};return _0x5992fc;})});}_0x1120e8=_[_0xeddf('0x52')]({},_0x1120e8,_0x416c10[_0xeddf('0x6a')]);return db['FaxInteraction']['count']({'where':_0x1120e8[_0xeddf('0x50')]})[_0xeddf('0x24')](function(_0x5dac4c){_0x59bab6['count']=_0x5dac4c;if(_0x416c10['query']['includeAll']){_0x1120e8[_0xeddf('0x55')]=[{'model':db[_0xeddf('0x74')],'as':'Contact','required':![]},{'model':db[_0xeddf('0x75')],'as':_0xeddf('0x76'),'attributes':[_0xeddf('0x3b'),_0xeddf('0x77'),_0xeddf('0x78')],'required':![]},{'model':db[_0xeddf('0x79')],'as':_0xeddf('0x7a'),'attributes':['id','name',_0xeddf('0x7b')],'where':_0x416c10[_0xeddf('0x44')][_0xeddf('0x7c')]?{'id':_0x416c10[_0xeddf('0x44')][_0xeddf('0x7c')]}:undefined,'required':_0x416c10[_0xeddf('0x44')][_0xeddf('0x7c')]?!![]:![]}];}return db[_0xeddf('0x73')][_0xeddf('0x56')](_0x1120e8);})[_0xeddf('0x24')](function(_0x5d4af0){_0x59bab6[_0xeddf('0x57')]=_0x5d4af0;return _0x59bab6;});}})['then'](respondWithFilteredResult(_0x3c6709,_0x1120e8))[_0xeddf('0x2b')](handleError(_0x3c6709,null));};exports[_0xeddf('0x7d')]=function(_0x29bcfa,_0x4c31d4){var _0x495727=_0x29bcfa['params']['id'];var _0x36ee90=_0x29bcfa[_0xeddf('0x5b')];var _0x5f5252=0xc8;var _0x268016=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xeddf('0x7e')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x304354){return db[_0xeddf('0x40')][_0xeddf('0x69')]({'where':{'id':_0x495727},'transaction':_0x304354})[_0xeddf('0x24')](function(_0x29d8b3){if(_0x29d8b3){return db[_0xeddf('0x7f')]['destroy']({'where':{'FaxAccountId':_0x495727},'transaction':_0x304354})['then'](function(){var _0x590969=_[_0xeddf('0x3f')](_0x36ee90,function(_0x161987){_0x161987[_0xeddf('0x66')]=_0x495727;return _0x161987;});return db['FaxApplication']['bulkCreate'](_0x590969,{'transaction':_0x304354});});}else{_0x5f5252=0x194;_0x268016=[];}});})[_0xeddf('0x24')](function(){if(_0x5f5252!==0x194){return db['FaxApplication'][_0xeddf('0x80')]({'where':{'FaxAccountId':_0x495727},'order':'priority'})[_0xeddf('0x24')](function(_0x6044fb){_0x268016=_0x6044fb;});}})[_0xeddf('0x2b')](function(_0x22a32a){_0x5f5252=0x1f4;logger[_0xeddf('0x29')](_0x22a32a['stack']);if(_0x22a32a[_0xeddf('0x3b')]){delete _0x22a32a[_0xeddf('0x3b')];}_0x268016=_0x22a32a;})[_0xeddf('0x81')](function(){if(_0x268016===null){_0x4c31d4[_0xeddf('0x39')](_0x5f5252);}else{if(_0x5f5252===0x1f4){_0x4c31d4[_0xeddf('0x2c')](_0x5f5252)[_0xeddf('0x82')](_0x268016);}else{_0x4c31d4['status'](_0x5f5252)[_0xeddf('0x2d')](_0x268016);}}});};exports[_0xeddf('0x83')]=function(_0x17aad0,_0x5eca8e,_0x46ce40){var _0x181b24={};var _0x35b8b0={};var _0x12a4e0;var _0x1b50c4;return db[_0xeddf('0x40')][_0xeddf('0x69')]({'where':{'id':_0x17aad0[_0xeddf('0x59')]['id']}})[_0xeddf('0x24')](handleEntityNotFound(_0x5eca8e,null))[_0xeddf('0x24')](function(_0x386525){if(_0x386525){_0x12a4e0=_0x386525;_0x35b8b0[_0xeddf('0x48')]=_[_0xeddf('0x45')](db[_0xeddf('0x7f')][_0xeddf('0x41')]);_0x35b8b0['query']=_['keys'](_0x17aad0[_0xeddf('0x44')]);_0x35b8b0[_0xeddf('0x46')]=_[_0xeddf('0x47')](_0x35b8b0[_0xeddf('0x48')],_0x35b8b0[_0xeddf('0x44')]);_0x181b24['attributes']=_[_0xeddf('0x47')](_0x35b8b0[_0xeddf('0x48')],qs[_0xeddf('0x4a')](_0x17aad0[_0xeddf('0x44')][_0xeddf('0x4a')]));_0x181b24[_0xeddf('0x49')]=_0x181b24['attributes'][_0xeddf('0x4b')]?_0x181b24[_0xeddf('0x49')]:_0x35b8b0[_0xeddf('0x48')];_0x181b24[_0xeddf('0x4e')]=qs[_0xeddf('0x4f')](_0x17aad0[_0xeddf('0x44')][_0xeddf('0x4f')]);_0x181b24[_0xeddf('0x50')]=qs[_0xeddf('0x46')](_[_0xeddf('0x51')](_0x17aad0['query'],_0x35b8b0[_0xeddf('0x46')]));if(_0x17aad0[_0xeddf('0x44')][_0xeddf('0x53')]){_0x181b24[_0xeddf('0x50')]=_[_0xeddf('0x52')](_0x181b24[_0xeddf('0x50')],{'$or':_[_0xeddf('0x3f')](_0x181b24['attributes'],function(_0x5f1fd9){var _0x5ef00c={};_0x5ef00c[_0x5f1fd9]={'$like':'%'+_0x17aad0['query'][_0xeddf('0x53')]+'%'};return _0x5ef00c;})});}_0x181b24=_[_0xeddf('0x52')]({},_0x181b24,_0x17aad0['options']);return _0x12a4e0[_0xeddf('0x83')](_0x181b24);}})[_0xeddf('0x24')](function(_0x2b0b76){if(_0x2b0b76){_0x1b50c4=_0x2b0b76[_0xeddf('0x4b')];if(!_0x17aad0[_0xeddf('0x44')]['hasOwnProperty'](_0xeddf('0x4d'))){_0x181b24[_0xeddf('0x30')]=qs[_0xeddf('0x30')](_0x17aad0[_0xeddf('0x44')]['limit']);_0x181b24['offset']=qs['offset'](_0x17aad0[_0xeddf('0x44')][_0xeddf('0x2e')]);}return _0x12a4e0[_0xeddf('0x83')](_0x181b24);}})[_0xeddf('0x24')](function(_0x585cda){if(_0x585cda){return _0x585cda?{'count':_0x1b50c4,'rows':_0x585cda}:null;}})[_0xeddf('0x24')](respondWithResult(_0x5eca8e,null))[_0xeddf('0x2b')](handleError(_0x5eca8e,null));};function Extension(_0x2c9374,_0x12fe97,_0x9faa05,_0x543437){this[_0xeddf('0x84')]='from-voip-provider';this['exten']=_0x2c9374['localstationid'];this[_0xeddf('0x85')]=_0x543437;this['type']=_0xeddf('0x86');this[_0xeddf('0x87')]='Fax\x20Extension';this[_0xeddf('0x66')]=_0x2c9374['id'];this[_0xeddf('0x88')]=_0x12fe97;this['appdata']=_0x9faa05;}function createExtensionsReciveFax(_0x1bebb1){var _0x573db7=0x1;var _0xfb733=[];_0xfb733[_0xeddf('0x89')](new Extension(_0x1bebb1,_0x573db7,'','Answer'));_0x573db7+=0x1;_0xfb733[_0xeddf('0x89')](new Extension(_0x1bebb1,_0x573db7,_0xeddf('0x8a'),_0xeddf('0x8b')));_0x573db7+=0x1;for(var _0xe241ae in _0x1bebb1){if(_0x1bebb1[_0xeddf('0x4c')](_0xe241ae)&&(_0xe241ae===_0xeddf('0x8c')||_0xe241ae===_0xeddf('0x8d')||_0xe241ae===_0xeddf('0x8e')||_0xe241ae==='faxdetect'||_0xe241ae==='headerinfo'||_0xe241ae==='maxrate'||_0xe241ae===_0xeddf('0x8f')||_0xe241ae===_0xeddf('0x90')||_0xe241ae===_0xeddf('0x91'))){_0xfb733['push'](new Extension(_0x1bebb1,_0x573db7,'FAXOPT('+_0xe241ae+')='+_0x1bebb1[_0xe241ae],_0xeddf('0x8b')));_0x573db7+=0x1;}}_0xfb733[_0xeddf('0x89')](new Extension(_0x1bebb1,_0x573db7,'6','Wait'));_0x573db7+=0x1;_0xfb733[_0xeddf('0x89')](new Extension(_0x1bebb1,_0x573db7,_0xeddf('0x92'),_0xeddf('0x93')));_0x573db7=0x0;return _0xfb733;}exports[_0xeddf('0x94')]=function(_0x58b198,_0x1590a0,_0x4c27fb){var _0x12653d;return db['sequelize']['transaction'](function(_0x75456d){return db[_0xeddf('0x40')]['create'](_0x58b198[_0xeddf('0x5b')],{'transaction':_0x75456d})[_0xeddf('0x24')](function(_0x981446){_0x12653d=_0x981446[_0xeddf('0x5c')]({'plain':!![]});return db[_0xeddf('0x95')][_0xeddf('0x96')](createExtensionsReciveFax(_0x12653d),{'transaction':_0x75456d});});})['then'](function(){return _0x12653d;})[_0xeddf('0x24')](respondWithResult(_0x1590a0,null))['catch'](handleError(_0x1590a0,null));};exports[_0xeddf('0x97')]=function(_0x221b0a,_0x43d5d4,_0xf954e3){var _0x586c96;return db[_0xeddf('0x7e')][_0xeddf('0x98')](function(_0x3cba6b){return db[_0xeddf('0x40')][_0xeddf('0x34')](_0x221b0a[_0xeddf('0x5b')],{'where':{'id':_0x221b0a[_0xeddf('0x5b')]['id']},'transaction':_0x3cba6b})['then'](function(_0x42fc4b){return db[_0xeddf('0x95')][_0xeddf('0x37')]({'where':{'FaxAccountId':_0x221b0a[_0xeddf('0x5b')]['id']},'transaction':_0x3cba6b})[_0xeddf('0x24')](function(_0x3d56b1){return db[_0xeddf('0x95')][_0xeddf('0x96')](createExtensionsReciveFax(_[_0xeddf('0x71')](_0x221b0a[_0xeddf('0x5b')],[_0xeddf('0x99'),'key',_0xeddf('0x9a'),'updatedAt',_0xeddf('0x9b'),_0xeddf('0x9c')])),{'transaction':_0x3cba6b});});});})[_0xeddf('0x24')](function(){return db[_0xeddf('0x40')][_0xeddf('0x9d')](_0x221b0a[_0xeddf('0x5b')]['id']);})[_0xeddf('0x24')](respondWithResult(_0x43d5d4,null))[_0xeddf('0x2b')](handleError(_0x43d5d4,null));};exports['getMessages']=function(_0x46fe74,_0x4135c3,_0x121615){var _0x202b76={'raw':!![],'where':{}};var _0x4532f6={};var _0x3c0a52={'count':0x0,'rows':[]};return db[_0xeddf('0x40')][_0xeddf('0x69')]({'where':{'id':_0x46fe74[_0xeddf('0x59')]['id']}})['then'](handleEntityNotFound(_0x4135c3,null))[_0xeddf('0x24')](function(_0x376c5d){if(_0x376c5d){_0x4532f6[_0xeddf('0x48')]=_[_0xeddf('0x45')](db['FaxMessage']['rawAttributes']);_0x4532f6[_0xeddf('0x44')]=_[_0xeddf('0x45')](_0x46fe74['query']);_0x4532f6[_0xeddf('0x46')]=_[_0xeddf('0x47')](_0x4532f6['model'],_0x4532f6[_0xeddf('0x44')]);_0x202b76[_0xeddf('0x49')]=_[_0xeddf('0x47')](_0x4532f6[_0xeddf('0x48')],qs[_0xeddf('0x4a')](_0x46fe74[_0xeddf('0x44')][_0xeddf('0x4a')]));_0x202b76[_0xeddf('0x49')]=_0x202b76[_0xeddf('0x49')][_0xeddf('0x4b')]?_0x202b76[_0xeddf('0x49')]:_0x4532f6[_0xeddf('0x48')];if(!_0x46fe74[_0xeddf('0x44')]['hasOwnProperty'](_0xeddf('0x4d'))){_0x202b76['limit']=qs['limit'](_0x46fe74['query'][_0xeddf('0x30')]);_0x202b76[_0xeddf('0x2e')]=qs[_0xeddf('0x2e')](_0x46fe74[_0xeddf('0x44')]['offset']);}_0x202b76[_0xeddf('0x4e')]=qs[_0xeddf('0x4f')](_0x46fe74['query'][_0xeddf('0x4f')]);_0x202b76['where']=qs[_0xeddf('0x46')](_[_0xeddf('0x51')](_0x46fe74['query'],_0x4532f6[_0xeddf('0x46')]));_0x202b76[_0xeddf('0x50')][_0xeddf('0x66')]=_0x376c5d['id'];if(_0x46fe74[_0xeddf('0x44')][_0xeddf('0x53')]){_0x202b76[_0xeddf('0x50')]=_[_0xeddf('0x52')](_0x202b76[_0xeddf('0x50')],{'$or':_['map'](_0x202b76[_0xeddf('0x49')],function(_0x5eaf53){var _0xef8e80={};_0xef8e80[_0x5eaf53]={'$like':'%'+_0x46fe74[_0xeddf('0x44')][_0xeddf('0x53')]+'%'};return _0xef8e80;})});}if(_0x46fe74[_0xeddf('0x44')]['$gte']){var _0x510ce6=_0x46fe74[_0xeddf('0x44')][_0xeddf('0x9e')][_0xeddf('0x9f')](',');var _0x7fa3f3={};_0x7fa3f3[_0x510ce6[0x0]]={'$gte':moment(_0x510ce6[0x1])[_0xeddf('0xa0')](_0xeddf('0xa1'))};_0x202b76[_0xeddf('0x50')]=_[_0xeddf('0x52')](_0x202b76[_0xeddf('0x50')],_0x7fa3f3);}_0x202b76=_[_0xeddf('0x52')]({},_0x202b76,_0x46fe74[_0xeddf('0x6a')]);return db['FaxMessage']['count']({'where':_0x202b76[_0xeddf('0x50')]})['then'](function(_0xa65eb5){_0x3c0a52['count']=_0xa65eb5;if(_0x46fe74[_0xeddf('0x44')][_0xeddf('0x54')]){_0x202b76[_0xeddf('0x55')]=[{'all':!![]}];}return db['FaxMessage'][_0xeddf('0x56')](_0x202b76);})[_0xeddf('0x24')](function(_0x1903ce){_0x3c0a52[_0xeddf('0x57')]=_0x1903ce;return _0x3c0a52;});}})[_0xeddf('0x24')](respondWithFilteredResult(_0x4135c3,_0x202b76))['catch'](handleError(_0x4135c3,null));};exports['send']=function(_0x2cd480,_0x11830a,_0x45d3a1){var _0x302386,_0x76a1cb={},_0x363588;if(_0x2cd480[_0xeddf('0x5b')]['to']){_0x363588=_0x2cd480[_0xeddf('0x5b')]['to'][0x0];}return db[_0xeddf('0x40')]['find']({'where':{'id':_0x2cd480[_0xeddf('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xeddf('0xa2'),'include':[{'model':db[_0xeddf('0x74')],'as':_0xeddf('0xa3'),'where':{'fax':_0x363588},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xeddf('0x24')](handleEntityNotFound(_0x11830a,null))[_0xeddf('0x24')](function(_0x1d51dc){_0x302386=_0x1d51dc;if(_0x2cd480[_0xeddf('0x5b')]['attachments']&&_0x2cd480[_0xeddf('0x5b')]['attachments'][_0xeddf('0x4b')]){for(var _0x12cbab=0x0;_0x12cbab<_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][_0xeddf('0x4b')];_0x12cbab+=0x1){_0x2cd480[_0xeddf('0x5b')]['attachments'][_0x12cbab]={'filename':_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][_0x12cbab][_0xeddf('0x3b')],'id':_0x2cd480['body'][_0xeddf('0xa4')][_0x12cbab]['id'],'path':path[_0xeddf('0xa5')](config[_0xeddf('0xa6')],'server/files/attachments',_0x2cd480[_0xeddf('0x5b')]['attachments'][_0x12cbab]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0xeddf('0xa7'),{'FaxAccountId':_['isNil'](_0x2cd480['params']['id'])?undefined:_0x2cd480[_0xeddf('0x59')]['id'],'path':_['isNil'](_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][0x0][_0xeddf('0x8')])?undefined:_0x2cd480[_0xeddf('0x5b')]['attachments'][0x0][_0xeddf('0x8')],'fax':_['isNil'](_0x2cd480['body']['to'][0x0])?undefined:_0x2cd480[_0xeddf('0x5b')]['to'][0x0]},client9002);})[_0xeddf('0x24')](function(){if(_0x302386){if(_[_0xeddf('0xa8')](_0x2cd480[_0xeddf('0x5b')]['from'])){_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa9')]=util[_0xeddf('0xa0')]('\x22%s\x22\x20<%s>',_0x302386['name'],_0x302386['fax']);}if(_0x302386[_0xeddf('0xa2')]){if(_0x302386['List'][_0xeddf('0xa3')][_0xeddf('0x4b')]){return _0x302386[_0xeddf('0xa2')][_0xeddf('0xa3')][0x0];}else{return db[_0xeddf('0x74')][_0xeddf('0x5a')](_[_0xeddf('0x1e')](_0x2cd480[_0xeddf('0x5b')],{'firstName':_0x2cd480[_0xeddf('0x5b')]['to'][0x0],'phone':_0x2cd480[_0xeddf('0x5b')]['to'][0x0],'fax':_0x2cd480[_0xeddf('0x5b')]['to'][0x0],'ListId':_0x302386[_0xeddf('0x9c')]}));}}else{throw new Error(_0xeddf('0xaa'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xeddf('0x24')](function(_0x451dee){if(_0x451dee){return db[_0xeddf('0x73')][_0xeddf('0x60')]({'where':{'ContactId':_0x451dee['id'],'closed':![],'FaxAccountId':_0x302386['id']}})[_0xeddf('0x24')](function(_0x33d1c1){if(_0x33d1c1){return[_0x33d1c1,![]];}return db[_0xeddf('0x73')][_0xeddf('0x5a')]({'UserId':_0x2cd480[_0xeddf('0xab')]['id'],'ContactId':_0x451dee['id'],'FaxAccountId':_0x302386['id'],'fax':_0x2cd480[_0xeddf('0x5b')]['to'][0x0],'firstMsgDirection':_0xeddf('0xac'),'Messages':[_[_0xeddf('0x52')](_0x2cd480[_0xeddf('0x5b')],{'read':![],'body':_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][0x0]['filename'],'FaxAccountId':_0x302386['id'],'UserId':_0x2cd480[_0xeddf('0xab')]['id'],'ContactId':_0x451dee['id'],'AttachmentId':_0x2cd480['body'][_0xeddf('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0xeddf('0xad')],'as':_0xeddf('0xae')}]})['then'](function(_0x5ed638){return[_0x5ed638,!![]];});});}else{throw new Error(_0xeddf('0xaf'));}})[_0xeddf('0xb0')](function(_0xc885b7,_0x60562b){if(_0x60562b){return _0xc885b7;}return db[_0xeddf('0xad')][_0xeddf('0x5a')]({'direction':_0xeddf('0xac'),'read':![],'body':_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][0x0][_0xeddf('0xb1')],'FaxAccountId':_0x302386['id'],'FaxInteractionId':_0xc885b7['id'],'UserId':_0x2cd480[_0xeddf('0xab')]['id'],'ContactId':_0xc885b7[_0xeddf('0xb2')],'AttachmentId':_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][0x0]['id']})[_0xeddf('0x24')](function(_0x1785f2){_0xc885b7[_0xeddf('0xb3')][_0xeddf('0xae')]=[];_0xc885b7['dataValues']['Messages'][_0xeddf('0x89')](_0x1785f2[_0xeddf('0xb3')]);return _0xc885b7;});})[_0xeddf('0x24')](function(_0xde65a3){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xeddf('0xa8')](_0x2cd480[_0xeddf('0x59')]['id'])?undefined:_0x2cd480[_0xeddf('0x59')]['id'],'path':_[_0xeddf('0xa8')](_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][0x0][_0xeddf('0x8')])?undefined:_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][0x0][_0xeddf('0x8')],'fax':_['isNil'](_0x2cd480['body']['to'][0x0])?undefined:_0x2cd480[_0xeddf('0x5b')]['to'][0x0],'AttachmentId':_0x2cd480[_0xeddf('0x5b')][_0xeddf('0xa4')][0x0]['id']},client9002)['then'](function(_0x13edf9){logger[_0xeddf('0x25')](_0xeddf('0xb4'),_0x13edf9);})['catch'](function(_0x4333f8){logger['info'](_0xeddf('0xb4'),_0x4333f8);});return _0xde65a3;})[_0xeddf('0x24')](respondWithResult(_0x11830a,null))[_0xeddf('0x2b')](handleError(_0x11830a,null));};exports[_0xeddf('0xb5')]=function(_0x3c01f4,_0x38634b,_0x2b2dc){return db['FaxAccount'][_0xeddf('0x60')]({'where':{'id':_0x3c01f4[_0xeddf('0x59')]['id']}})[_0xeddf('0x24')](handleEntityNotFound(_0x38634b,null))[_0xeddf('0x24')](function(_0x430ed3){if(_0x430ed3){return _0x430ed3[_0xeddf('0xb5')](_0x3c01f4[_0xeddf('0x5b')][_0xeddf('0x6c')],_['omit'](_0x3c01f4[_0xeddf('0x5b')],[_0xeddf('0x6c'),'id'])||{})[_0xeddf('0xb0')](function(_0x2f4334){for(var _0x99b27f=0x0;_0x99b27f<_0x3c01f4[_0xeddf('0x5b')][_0xeddf('0x6c')][_0xeddf('0x4b')];_0x99b27f+=0x1){socket[_0xeddf('0xb6')](_0xeddf('0xb7'),{'UserId':Number(_0x3c01f4[_0xeddf('0x5b')]['ids'][_0x99b27f]),'FaxAccountId':Number(_0x3c01f4[_0xeddf('0x59')]['id'])});}return _0x2f4334;});}})['then'](respondWithResult(_0x38634b,null))['catch'](handleError(_0x38634b,null));};exports[_0xeddf('0xb8')]=function(_0xc8d8fd,_0x2cd866,_0x59297c){return db[_0xeddf('0x40')]['find']({'where':{'id':_0xc8d8fd['params']['id']}})['then'](handleEntityNotFound(_0x2cd866,null))[_0xeddf('0x24')](function(_0x16183d){if(_0x16183d){return _0x16183d[_0xeddf('0xb8')](_0xc8d8fd[_0xeddf('0x44')]['ids'])[_0xeddf('0x24')](function(){if(_[_0xeddf('0xb9')](_0xc8d8fd[_0xeddf('0x44')][_0xeddf('0x6c')])){for(var _0x11a175=0x0;_0x11a175<_0xc8d8fd[_0xeddf('0x44')][_0xeddf('0x6c')][_0xeddf('0x4b')];_0x11a175+=0x1){socket[_0xeddf('0xb6')](_0xeddf('0xba'),{'UserId':Number(_0xc8d8fd['query'][_0xeddf('0x6c')][_0x11a175]),'FaxAccountId':Number(_0xc8d8fd['params']['id'])});}}else{socket[_0xeddf('0xb6')](_0xeddf('0xba'),{'UserId':Number(_0xc8d8fd[_0xeddf('0x44')][_0xeddf('0x6c')]),'FaxAccountId':Number(_0xc8d8fd[_0xeddf('0x59')]['id'])});}});}})[_0xeddf('0x24')](respondWithStatusCode(_0x2cd866,null))['catch'](handleError(_0x2cd866,null));};exports[_0xeddf('0xbb')]=function(_0x315be4,_0x32f18f,_0x3631f5){var _0x3c312f={};var _0x325c5a={};var _0x160a91;var _0xfe1fdf;return db[_0xeddf('0x40')][_0xeddf('0x69')]({'where':{'id':_0x315be4[_0xeddf('0x59')]['id']}})['then'](handleEntityNotFound(_0x32f18f,null))['then'](function(_0x12c874){if(_0x12c874){_0x160a91=_0x12c874;_0x325c5a[_0xeddf('0x48')]=_[_0xeddf('0x45')](db[_0xeddf('0x75')]['rawAttributes']);_0x325c5a[_0xeddf('0x44')]=_['keys'](_0x315be4['query']);_0x325c5a[_0xeddf('0x46')]=_[_0xeddf('0x47')](_0x325c5a['model'],_0x325c5a['query']);_0x3c312f[_0xeddf('0x49')]=_['intersection'](_0x325c5a[_0xeddf('0x48')],qs[_0xeddf('0x4a')](_0x315be4[_0xeddf('0x44')][_0xeddf('0x4a')]));_0x3c312f[_0xeddf('0x49')]=_0x3c312f[_0xeddf('0x49')][_0xeddf('0x4b')]?_0x3c312f[_0xeddf('0x49')]:_0x325c5a[_0xeddf('0x48')];_0x3c312f['order']=qs['sort'](_0x315be4['query']['sort']);_0x3c312f['where']=qs[_0xeddf('0x46')](_[_0xeddf('0x51')](_0x315be4[_0xeddf('0x44')],_0x325c5a[_0xeddf('0x46')]));if(_0x315be4[_0xeddf('0x44')][_0xeddf('0x53')]){_0x3c312f[_0xeddf('0x50')]=_['merge'](_0x3c312f[_0xeddf('0x50')],{'$or':_[_0xeddf('0x3f')](_0x3c312f[_0xeddf('0x49')],function(_0xaa6374){var _0x4175a0={};_0x4175a0[_0xaa6374]={'$like':'%'+_0x315be4['query'][_0xeddf('0x53')]+'%'};return _0x4175a0;})});}_0x3c312f=_[_0xeddf('0x52')]({},_0x3c312f,_0x315be4[_0xeddf('0x6a')]);return _0x160a91[_0xeddf('0xbb')](_0x3c312f);}})[_0xeddf('0x24')](function(_0x58b880){if(_0x58b880){_0xfe1fdf=_0x58b880['length'];if(!_0x315be4['query'][_0xeddf('0x4c')]('nolimit')){_0x3c312f[_0xeddf('0x30')]=qs[_0xeddf('0x30')](_0x315be4['query']['limit']);_0x3c312f['offset']=qs['offset'](_0x315be4[_0xeddf('0x44')][_0xeddf('0x2e')]);}return _0x160a91['getAgents'](_0x3c312f);}})['then'](function(_0x4b4043){if(_0x4b4043){return _0x4b4043?{'count':_0xfe1fdf,'rows':_0x4b4043}:null;}})[_0xeddf('0x24')](respondWithResult(_0x32f18f,null))[_0xeddf('0x2b')](handleError(_0x32f18f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index c962967..fe8d58e 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 _0x847f=['hook','exports','events','../../mysqldb','setMaxListeners','save','hasOwnProperty'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x847f,0xb8));var _0xf847=function(_0x3ccac1,_0x5cc7ea){_0x3ccac1=_0x3ccac1-0x0;var _0x10b20b=_0x847f[_0x3ccac1];return _0x10b20b;};'use strict';var EventEmitter=require(_0xf847('0x0'));var FaxAccount=require(_0xf847('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf847('0x2')](0x0);var events={'afterCreate':_0xf847('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x50e00b){return function(_0x8d0a9c,_0x4fe7b9,_0x3299b1){FaxAccountEvents['emit'](_0x50e00b+':'+_0x8d0a9c['id'],_0x8d0a9c);FaxAccountEvents['emit'](_0x50e00b,_0x8d0a9c);_0x3299b1(null);};}for(var e in events){if(events[_0xf847('0x4')](e)){var event=events[e];FaxAccount[_0xf847('0x5')](e,emitEvent(event));}}module[_0xf847('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0xf131=['../../mysqldb','setMaxListeners','emit','hasOwnProperty','hook','events'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf131,0x19d));var _0x1f13=function(_0x300c1b,_0x3f049d){_0x300c1b=_0x300c1b-0x0;var _0x1986e9=_0xf131[_0x300c1b];return _0x1986e9;};'use strict';var EventEmitter=require(_0x1f13('0x0'));var FaxAccount=require(_0x1f13('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1f13('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x18a3b2){return function(_0x5dd20e,_0x2f3982,_0x1fe5ba){FaxAccountEvents[_0x1f13('0x3')](_0x18a3b2+':'+_0x5dd20e['id'],_0x5dd20e);FaxAccountEvents['emit'](_0x18a3b2,_0x5dd20e);_0x1fe5ba(null);};}for(var e in events){if(events[_0x1f13('0x4')](e)){var event=events[e];FaxAccount[_0x1f13('0x5')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index acd09ff..251d184 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 _0x4330=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger'];(function(_0x4e4d88,_0x34490c){var _0x51bad9=function(_0x2c2142){while(--_0x2c2142){_0x4e4d88['push'](_0x4e4d88['shift']());}};_0x51bad9(++_0x34490c);}(_0x4330,0xde));var _0x0433=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4330[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0433('0x0'));var util=require(_0x0433('0x1'));var logger=require(_0x0433('0x2'))(_0x0433('0x3'));var moment=require(_0x0433('0x4'));var BPromise=require(_0x0433('0x5'));var rp=require(_0x0433('0x6'));var fs=require('fs');var path=require(_0x0433('0x7'));var rimraf=require(_0x0433('0x8'));var config=require(_0x0433('0x9'));var attributes=require(_0x0433('0xa'));module[_0x0433('0xb')]=function(_0x54f867,_0x10e41d){return _0x54f867[_0x0433('0xc')](_0x0433('0xd'),attributes,{'tableName':_0x0433('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e8e=['rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x29b88d,_0x18a69e){var _0x1df76a=function(_0x20af28){while(--_0x20af28){_0x29b88d['push'](_0x29b88d['shift']());}};_0x1df76a(++_0x18a69e);}(_0x7e8e,0xfd));var _0xe7e8=function(_0x3b3466,_0x228276){_0x3b3466=_0x3b3466-0x0;var _0x16157f=_0x7e8e[_0x3b3466];return _0x16157f;};'use strict';var _=require(_0xe7e8('0x0'));var util=require(_0xe7e8('0x1'));var logger=require(_0xe7e8('0x2'))(_0xe7e8('0x3'));var moment=require('moment');var BPromise=require(_0xe7e8('0x4'));var rp=require(_0xe7e8('0x5'));var fs=require('fs');var path=require(_0xe7e8('0x6'));var rimraf=require(_0xe7e8('0x7'));var config=require(_0xe7e8('0x8'));var attributes=require(_0xe7e8('0x9'));module[_0xe7e8('0xa')]=function(_0x140eb9,_0x289323){return _0x140eb9[_0xe7e8('0xb')](_0xe7e8('0xc'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 1e79b5c..484180d 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 _0x619d=['map','model','then','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','priority','asc','length','ListId','create','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','AttachmentId','interaction','UserId','User','name','agent','Start','startRouting','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x2ae22a,_0x4fe753){var _0x286a82=function(_0x256e58){while(--_0x256e58){_0x2ae22a['push'](_0x2ae22a['shift']());}};_0x286a82(++_0x4fe753);}(_0x619d,0x1a5));var _0xd619=function(_0x3f17f7,_0x5770fa){_0x3f17f7=_0x3f17f7-0x0;var _0xa3eee8=_0x619d[_0x3f17f7];return _0xa3eee8;};'use strict';var _=require('lodash');var util=require(_0xd619('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd619('0x1'));var db=require(_0xd619('0x2'))['db'];var utils=require(_0xd619('0x3'));var logger=require(_0xd619('0x4'))(_0xd619('0x5'));var config=require(_0xd619('0x6'));var jayson=require(_0xd619('0x7'));var client=jayson['client'][_0xd619('0x8')]({'port':0x232c});config[_0xd619('0x9')]=_[_0xd619('0xa')](config[_0xd619('0x9')],{'host':_0xd619('0xb'),'port':0x18eb});var socket=require(_0xd619('0xc'))(new Redis(config[_0xd619('0x9')]));require(_0xd619('0xd'))[_0xd619('0xe')](socket);function respondWithRpcPromise(_0x12ba33,_0x4c2d29,_0xdc14cf){return new BPromise(function(_0x23d37e,_0x2bc7a9){return client[_0xd619('0xf')](_0x12ba33,_0xdc14cf)['then'](function(_0x32ce24){logger[_0xd619('0x10')](_0xd619('0x11'),_0x4c2d29,'request\x20sent');logger[_0xd619('0x12')](_0xd619('0x13'),_0x4c2d29,'request\x20sent',JSON[_0xd619('0x14')](_0x32ce24));if(_0x32ce24[_0xd619('0x15')]){if(_0x32ce24['error'][_0xd619('0x16')]===0x1f4){logger[_0xd619('0x15')]('FaxAccount,\x20%s,\x20%s',_0x4c2d29,_0x32ce24[_0xd619('0x15')][_0xd619('0x17')]);return _0x2bc7a9(_0x32ce24['error']['message']);}logger[_0xd619('0x15')](_0xd619('0x11'),_0x4c2d29,_0x32ce24[_0xd619('0x15')]['message']);return _0x23d37e(_0x32ce24[_0xd619('0x15')][_0xd619('0x17')]);}else{logger[_0xd619('0x10')](_0xd619('0x11'),_0x4c2d29,_0xd619('0x18'));_0x23d37e(_0x32ce24['result'][_0xd619('0x17')]);}})[_0xd619('0x19')](function(_0x30e2ff){logger[_0xd619('0x15')]('FaxAccount,\x20%s,\x20%s',_0x4c2d29,_0x30e2ff);_0x2bc7a9(_0x30e2ff);});});}exports['GetFaxAccount']=function(_0x4a8ac5){var _0x3dd99d=this;return new Promise(function(_0x356d27,_0x53dbef){return db[_0xd619('0x1a')][_0xd619('0x1b')]({'raw':_0x4a8ac5['options']?_0x4a8ac5[_0xd619('0x1c')][_0xd619('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a8ac5[_0xd619('0x1c')]?_0x4a8ac5[_0xd619('0x1c')][_0xd619('0x1e')]||null:null,'attributes':_0x4a8ac5[_0xd619('0x1c')]?_0x4a8ac5[_0xd619('0x1c')][_0xd619('0x1f')]||null:null,'limit':_0x4a8ac5[_0xd619('0x1c')]?_0x4a8ac5[_0xd619('0x1c')][_0xd619('0x20')]||null:null,'include':_0x4a8ac5[_0xd619('0x1c')]?_0x4a8ac5['options'][_0xd619('0x21')]?_[_0xd619('0x22')](_0x4a8ac5[_0xd619('0x1c')][_0xd619('0x21')],function(_0x5a860f){return{'model':db[_0x5a860f[_0xd619('0x23')]],'as':_0x5a860f['as'],'attributes':_0x5a860f[_0xd619('0x1f')],'include':_0x5a860f[_0xd619('0x21')]?_['map'](_0x5a860f[_0xd619('0x21')],function(_0x5c7b59){return{'model':db[_0x5c7b59[_0xd619('0x23')]],'as':_0x5c7b59['as'],'attributes':_0x5c7b59[_0xd619('0x1f')],'include':_0x5c7b59[_0xd619('0x21')]?_['map'](_0x5c7b59[_0xd619('0x21')],function(_0x27ff76){return{'model':db[_0x27ff76[_0xd619('0x23')]],'as':_0x27ff76['as'],'attributes':_0x27ff76[_0xd619('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd619('0x24')](function(_0x141739){logger['info'](_0xd619('0x25'),_0x4a8ac5);logger['debug'](_0xd619('0x25'),_0x4a8ac5,JSON['stringify'](_0x141739));_0x356d27(_0x141739);})[_0xd619('0x19')](function(_0xf4ec25){logger[_0xd619('0x15')](_0xd619('0x25'),_0xf4ec25[_0xd619('0x17')],_0x4a8ac5);_0x53dbef(_0x3dd99d[_0xd619('0x15')](0x1f4,_0xf4ec25[_0xd619('0x17')]));});});};exports[_0xd619('0x26')]=function(_0xe6c16e,_0x44b9c6,_0x90de99){var _0x388f4a=this;return new Promise(function(_0x33078c,_0x18d80d){var _0x36862c={'body':_0xe6c16e['body'],'channel':_0xd619('0x27')};var _0x4d57b=[];var _0x10c738=[];var _0x3ee401={};return db[_0xd619('0x28')][_0xd619('0x29')]()[_0xd619('0x24')](function(_0x354d35){if(!_0x354d35){throw new db[(_0xd619('0x2a'))]['ValidationError'](_0xd619('0x2b'));}_0x4d57b=_[_0xd619('0x2c')](_['keys'](_0x354d35),[_0xd619('0x2d'),_0xd619('0x2e')]);_0x10c738=_['difference'](_['keys'](_0x354d35),['createdAt','updatedAt',_0xd619('0x2f'),'ListId']);if(_0xe6c16e[_0xd619('0x30')]['id']){delete _0xe6c16e['body']['id'];}if(_['isNil'](_0xe6c16e[_0xd619('0x30')][_0xd619('0x31')])){throw new db[(_0xd619('0x2a'))]['ValidationError'](_0xd619('0x32'));}if(_['isNil'](_0xe6c16e[_0xd619('0x30')][_0xd619('0x30')])||_0xe6c16e['body'][_0xd619('0x30')]===''){throw new db['Sequelize']['ValidationError'](_0xd619('0x33'));}if(_[_0xd619('0x34')](_0xe6c16e[_0xd619('0x30')][_0xd619('0x35')])){throw new db[(_0xd619('0x2a'))][(_0xd619('0x36'))](_0xd619('0x37')+_0x10c738);}if(!_[_0xd619('0x38')](_0x10c738,_0xe6c16e['body']['mapKey'])){throw new db[(_0xd619('0x2a'))][(_0xd619('0x36'))](_0xd619('0x39')+_0x10c738);}_0x3ee401[_0xe6c16e['body']['mapKey']]=_0xe6c16e[_0xd619('0x30')][_0xd619('0x31')];})[_0xd619('0x24')](function(){return db[_0xd619('0x1a')][_0xd619('0x3a')]({'where':{'id':_0xe6c16e[_0xd619('0x3b')]['id']},'include':[{'model':db[_0xd619('0x3c')],'as':'List','include':[{'model':db[_0xd619('0x28')],'as':_0xd619('0x3d'),'where':_0x3ee401,'limit':0x1,'order':[[_0xd619('0x2e'),_0xd619('0x3e')]]}]},{'model':db[_0xd619('0x3f')],'as':_0xd619('0x40')}]});})['then'](function(_0x44cb69){if(_0x44cb69&&_0x44cb69[_0xd619('0x41')]){var _0x16871f=_0x44cb69[_0xd619('0x42')]({'plain':!![]});_0x36862c['account']=_0x16871f;_0x36862c[_0xd619('0x43')]=_0x16871f[_0xd619('0x40')];_0x36862c[_0xd619('0x44')]=_0x16871f['List'];_0x36862c[_0xd619('0x43')]=_[_0xd619('0x45')](_0x36862c[_0xd619('0x43')],[_0xd619('0x46')],[_0xd619('0x47')]);if(_0x36862c[_0xd619('0x3b')]['Applications']){delete _0x36862c[_0xd619('0x3b')][_0xd619('0x40')];}if(_0x36862c[_0xd619('0x3b')][_0xd619('0x41')]&&_0x36862c['account'][_0xd619('0x41')]['Contacts'][_0xd619('0x48')]){return _0x36862c[_0xd619('0x3b')]['List'][_0xd619('0x3d')][0x0];}var _0x148514=_[_0xd619('0xa')](_0xe6c16e['body'],{'firstName':_0xe6c16e[_0xd619('0x30')]['from'],'ListId':_0x16871f[_0xd619('0x49')]});_0x148514[_0xe6c16e[_0xd619('0x30')][_0xd619('0x35')]]=_0xe6c16e[_0xd619('0x30')]['from'];return db[_0xd619('0x28')][_0xd619('0x4a')](_0x148514,{'fields':_0x4d57b,'raw':!![]});}})[_0xd619('0x24')](function(_0x52c791){_0x36862c['contact']=_0x52c791;if(_0x52c791){var _0xfd33c9={'ContactId':_0x52c791['id'],'FaxAccountId':_0xe6c16e[_0xd619('0x3b')]['id'],'fax':_0x52c791[_0xd619('0x27')]};return db['FaxInteraction'][_0xd619('0x3a')]({'where':{'ContactId':_0x52c791['id'],'closed':![],'FaxAccountId':_0xe6c16e[_0xd619('0x3b')]['id']}})[_0xd619('0x24')](function(_0x1f7e74){if(_0x1f7e74){return[_0x1f7e74,![]];}return db['FaxInteraction'][_0xd619('0x4a')](_0xfd33c9)[_0xd619('0x24')](function(_0x542786){return[_0x542786,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd619('0x4b')](function(_0x5bde32,_0x2bfa32){var _0x5b8eff=_0x5bde32[_0xd619('0x42')]({'plain':!![]});if(_0x2bfa32){if(_0x36862c[_0xd619('0x3b')][_0xd619('0x4c')]){_0x36862c[_0xd619('0x43')][_0xd619('0x4d')]({'id':0x0,'priority':_0x36862c[_0xd619('0x43')][_0xd619('0x48')]+0x1,'app':_0xd619('0x4e'),'appdata':_0xd619('0x4f'),'interval':_0xd619('0x50')});}_0x5b8eff[_0xd619('0x51')]=!![];}else{_0x5b8eff['created']=![];}_0x36862c['interaction']=_0x5b8eff;return db[_0xd619('0x52')]['create']({'body':_0xe6c16e[_0xd619('0x30')][_0xd619('0x30')],'FaxAccountId':_0xe6c16e['account']['id'],'FaxInteractionId':_0x5bde32['id'],'direction':'in','ContactId':_0x5bde32['ContactId'],'AttachmentId':_0xe6c16e[_0xd619('0x30')][_0xd619('0x53')]});})[_0xd619('0x24')](function(_0x78d936){_0x36862c[_0xd619('0x17')]=_0x78d936;if(_0x36862c[_0xd619('0x54')][_0xd619('0x55')]){return db[_0xd619('0x56')][_0xd619('0x3a')]({'attributes':['id',_0xd619('0x57')],'where':{'id':_0x36862c[_0xd619('0x54')][_0xd619('0x55')]}})[_0xd619('0x24')](function(_0x21f718){if(_0x21f718){_0x36862c[_0xd619('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd619('0x58'),'appdata':_0x21f718[_0xd619('0x57')]+','+(_0x36862c[_0xd619('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0xd619('0x50')});}return respondWithRpcPromise(_0xd619('0x59'),_0xd619('0x5a'),_0x36862c);});}return respondWithRpcPromise(_0xd619('0x59'),_0xd619('0x5a'),_0x36862c);})['then'](function(_0x1ce82a){_0x33078c(_0x1ce82a);})[_0xd619('0x19')](function(_0x352254){_0x18d80d(_0x388f4a[_0xd619('0x15')](0x1f4,_0x352254[_0xd619('0x17')]));});});}; \ No newline at end of file +var _0x5af0=['NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','from','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','then','find','account','List','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','include','map','model','attributes'];(function(_0x59a957,_0x1a7d76){var _0x42b19b=function(_0x12c062){while(--_0x12c062){_0x59a957['push'](_0x59a957['shift']());}};_0x42b19b(++_0x1a7d76);}(_0x5af0,0x94));var _0x05af=function(_0x28e0ff,_0x5bb56c){_0x28e0ff=_0x28e0ff-0x0;var _0x23f7be=_0x5af0[_0x28e0ff];return _0x23f7be;};'use strict';var _=require(_0x05af('0x0'));var util=require(_0x05af('0x1'));var moment=require(_0x05af('0x2'));var BPromise=require(_0x05af('0x3'));var rs=require(_0x05af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05af('0x5'))['db'];var utils=require(_0x05af('0x6'));var logger=require(_0x05af('0x7'))(_0x05af('0x8'));var config=require('../../config/environment');var jayson=require(_0x05af('0x9'));var client=jayson[_0x05af('0xa')]['http']({'port':0x232c});config[_0x05af('0xb')]=_[_0x05af('0xc')](config['redis'],{'host':_0x05af('0xd'),'port':0x18eb});var socket=require(_0x05af('0xe'))(new Redis(config['redis']));require(_0x05af('0xf'))['register'](socket);function respondWithRpcPromise(_0x305304,_0x1e672a,_0x3e11f5){return new BPromise(function(_0x38a214,_0x118df6){return client[_0x05af('0x10')](_0x305304,_0x3e11f5)['then'](function(_0x1b86b7){logger[_0x05af('0x11')](_0x05af('0x12'),_0x1e672a,_0x05af('0x13'));logger[_0x05af('0x14')](_0x05af('0x15'),_0x1e672a,_0x05af('0x13'),JSON[_0x05af('0x16')](_0x1b86b7));if(_0x1b86b7[_0x05af('0x17')]){if(_0x1b86b7[_0x05af('0x17')][_0x05af('0x18')]===0x1f4){logger[_0x05af('0x17')](_0x05af('0x12'),_0x1e672a,_0x1b86b7['error'][_0x05af('0x19')]);return _0x118df6(_0x1b86b7[_0x05af('0x17')][_0x05af('0x19')]);}logger['error'](_0x05af('0x12'),_0x1e672a,_0x1b86b7[_0x05af('0x17')][_0x05af('0x19')]);return _0x38a214(_0x1b86b7['error'][_0x05af('0x19')]);}else{logger['info'](_0x05af('0x12'),_0x1e672a,_0x05af('0x13'));_0x38a214(_0x1b86b7[_0x05af('0x1a')][_0x05af('0x19')]);}})[_0x05af('0x1b')](function(_0x29856f){logger[_0x05af('0x17')](_0x05af('0x12'),_0x1e672a,_0x29856f);_0x118df6(_0x29856f);});});}exports[_0x05af('0x1c')]=function(_0x16b7f7){var _0x3204ce=this;return new Promise(function(_0x579809,_0x37841b){return db[_0x05af('0x1d')][_0x05af('0x1e')]({'raw':_0x16b7f7[_0x05af('0x1f')]?_0x16b7f7['options'][_0x05af('0x20')]===undefined?!![]:![]:!![],'where':_0x16b7f7['options']?_0x16b7f7[_0x05af('0x1f')][_0x05af('0x21')]||null:null,'attributes':_0x16b7f7[_0x05af('0x1f')]?_0x16b7f7[_0x05af('0x1f')]['attributes']||null:null,'limit':_0x16b7f7[_0x05af('0x1f')]?_0x16b7f7[_0x05af('0x1f')]['limit']||null:null,'include':_0x16b7f7[_0x05af('0x1f')]?_0x16b7f7[_0x05af('0x1f')][_0x05af('0x22')]?_[_0x05af('0x23')](_0x16b7f7[_0x05af('0x1f')][_0x05af('0x22')],function(_0x46c075){return{'model':db[_0x46c075[_0x05af('0x24')]],'as':_0x46c075['as'],'attributes':_0x46c075[_0x05af('0x25')],'include':_0x46c075[_0x05af('0x22')]?_[_0x05af('0x23')](_0x46c075[_0x05af('0x22')],function(_0x23bcb8){return{'model':db[_0x23bcb8[_0x05af('0x24')]],'as':_0x23bcb8['as'],'attributes':_0x23bcb8[_0x05af('0x25')],'include':_0x23bcb8[_0x05af('0x22')]?_[_0x05af('0x23')](_0x23bcb8[_0x05af('0x22')],function(_0x9b2101){return{'model':db[_0x9b2101['model']],'as':_0x9b2101['as'],'attributes':_0x9b2101[_0x05af('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49ed86){logger[_0x05af('0x11')](_0x05af('0x1c'),_0x16b7f7);logger[_0x05af('0x14')](_0x05af('0x1c'),_0x16b7f7,JSON['stringify'](_0x49ed86));_0x579809(_0x49ed86);})[_0x05af('0x1b')](function(_0x41a027){logger['error'](_0x05af('0x1c'),_0x41a027['message'],_0x16b7f7);_0x37841b(_0x3204ce[_0x05af('0x17')](0x1f4,_0x41a027[_0x05af('0x19')]));});});};exports[_0x05af('0x26')]=function(_0x5859e6,_0x588852,_0xf31168){var _0x2c454a=this;return new Promise(function(_0x15107a,_0x144ec6){var _0x2a50ce={'body':_0x5859e6['body'],'channel':_0x05af('0x27')};var _0x379806=[];var _0x3223ac=[];var _0x52640e={};return db[_0x05af('0x28')]['describe']()['then'](function(_0x2c256b){if(!_0x2c256b){throw new db[(_0x05af('0x29'))][(_0x05af('0x2a'))](_0x05af('0x2b'));}_0x379806=_[_0x05af('0x2c')](_[_0x05af('0x2d')](_0x2c256b),[_0x05af('0x2e'),_0x05af('0x2f')]);_0x3223ac=_[_0x05af('0x2c')](_[_0x05af('0x2d')](_0x2c256b),[_0x05af('0x2e'),_0x05af('0x2f'),_0x05af('0x30'),_0x05af('0x31')]);if(_0x5859e6[_0x05af('0x32')]['id']){delete _0x5859e6[_0x05af('0x32')]['id'];}if(_['isNil'](_0x5859e6[_0x05af('0x32')][_0x05af('0x33')])){throw new db['Sequelize'][(_0x05af('0x2a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5859e6[_0x05af('0x32')][_0x05af('0x32')])||_0x5859e6[_0x05af('0x32')][_0x05af('0x32')]===''){throw new db[(_0x05af('0x29'))]['ValidationError'](_0x05af('0x34'));}if(_[_0x05af('0x35')](_0x5859e6[_0x05af('0x32')][_0x05af('0x36')])){throw new db['Sequelize'][(_0x05af('0x2a'))](_0x05af('0x37')+_0x3223ac);}if(!_[_0x05af('0x38')](_0x3223ac,_0x5859e6[_0x05af('0x32')]['mapKey'])){throw new db[(_0x05af('0x29'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3223ac);}_0x52640e[_0x5859e6[_0x05af('0x32')]['mapKey']]=_0x5859e6[_0x05af('0x32')][_0x05af('0x33')];})[_0x05af('0x39')](function(){return db['FaxAccount'][_0x05af('0x3a')]({'where':{'id':_0x5859e6[_0x05af('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0x05af('0x3c'),'include':[{'model':db['CmContact'],'as':_0x05af('0x3d'),'where':_0x52640e,'limit':0x1,'order':[['updatedAt',_0x05af('0x3e')]]}]},{'model':db[_0x05af('0x3f')],'as':_0x05af('0x40')}]});})['then'](function(_0x23897d){if(_0x23897d&&_0x23897d[_0x05af('0x3c')]){var _0x83abcf=_0x23897d['get']({'plain':!![]});_0x2a50ce['account']=_0x83abcf;_0x2a50ce[_0x05af('0x41')]=_0x83abcf[_0x05af('0x40')];_0x2a50ce[_0x05af('0x42')]=_0x83abcf[_0x05af('0x3c')];_0x2a50ce['applications']=_[_0x05af('0x43')](_0x2a50ce['applications'],[_0x05af('0x44')],[_0x05af('0x45')]);if(_0x2a50ce[_0x05af('0x3b')]['Applications']){delete _0x2a50ce[_0x05af('0x3b')][_0x05af('0x40')];}if(_0x2a50ce[_0x05af('0x3b')][_0x05af('0x3c')]&&_0x2a50ce[_0x05af('0x3b')][_0x05af('0x3c')][_0x05af('0x3d')][_0x05af('0x46')]){return _0x2a50ce[_0x05af('0x3b')][_0x05af('0x3c')][_0x05af('0x3d')][0x0];}var _0x56efb4=_['defaults'](_0x5859e6[_0x05af('0x32')],{'firstName':_0x5859e6[_0x05af('0x32')][_0x05af('0x33')],'ListId':_0x83abcf[_0x05af('0x31')]});_0x56efb4[_0x5859e6[_0x05af('0x32')][_0x05af('0x36')]]=_0x5859e6[_0x05af('0x32')][_0x05af('0x33')];return db[_0x05af('0x28')][_0x05af('0x47')](_0x56efb4,{'fields':_0x379806,'raw':!![]});}})[_0x05af('0x39')](function(_0x567fbf){_0x2a50ce[_0x05af('0x48')]=_0x567fbf;if(_0x567fbf){var _0x21b5cd={'ContactId':_0x567fbf['id'],'FaxAccountId':_0x5859e6['account']['id'],'fax':_0x567fbf[_0x05af('0x27')]};return db['FaxInteraction'][_0x05af('0x3a')]({'where':{'ContactId':_0x567fbf['id'],'closed':![],'FaxAccountId':_0x5859e6[_0x05af('0x3b')]['id']}})[_0x05af('0x39')](function(_0x18afa7){if(_0x18afa7){return[_0x18afa7,![]];}return db[_0x05af('0x49')][_0x05af('0x47')](_0x21b5cd)[_0x05af('0x39')](function(_0x49192e){return[_0x49192e,!![]];});});}else{throw new Error(_0x05af('0x4a'));}})[_0x05af('0x4b')](function(_0x1f6c5e,_0x23802c){var _0x5e9fb2=_0x1f6c5e[_0x05af('0x4c')]({'plain':!![]});if(_0x23802c){if(_0x2a50ce['account']['autoclose']){_0x2a50ce[_0x05af('0x41')][_0x05af('0x4d')]({'id':0x0,'priority':_0x2a50ce['applications'][_0x05af('0x46')]+0x1,'app':_0x05af('0x4e'),'appdata':_0x05af('0x4f'),'interval':_0x05af('0x50')});}_0x5e9fb2[_0x05af('0x51')]=!![];}else{_0x5e9fb2[_0x05af('0x51')]=![];}_0x2a50ce['interaction']=_0x5e9fb2;return db[_0x05af('0x52')][_0x05af('0x47')]({'body':_0x5859e6[_0x05af('0x32')][_0x05af('0x32')],'FaxAccountId':_0x5859e6[_0x05af('0x3b')]['id'],'FaxInteractionId':_0x1f6c5e['id'],'direction':'in','ContactId':_0x1f6c5e[_0x05af('0x53')],'AttachmentId':_0x5859e6['body']['AttachmentId']});})[_0x05af('0x39')](function(_0x46d1e4){_0x2a50ce[_0x05af('0x19')]=_0x46d1e4;if(_0x2a50ce[_0x05af('0x54')][_0x05af('0x55')]){return db[_0x05af('0x56')]['find']({'attributes':['id',_0x05af('0x57')],'where':{'id':_0x2a50ce['interaction'][_0x05af('0x55')]}})[_0x05af('0x39')](function(_0xc97f12){if(_0xc97f12){_0x2a50ce[_0x05af('0x41')][_0x05af('0x58')]({'id':0x0,'priority':0x0,'app':_0x05af('0x59'),'appdata':_0xc97f12[_0x05af('0x57')]+','+(_0x2a50ce['account'][_0x05af('0x5a')]||0xa),'interval':_0x05af('0x50')});}return respondWithRpcPromise(_0x05af('0x5b'),_0x05af('0x5c'),_0x2a50ce);});}return respondWithRpcPromise(_0x05af('0x5b'),'startRouting',_0x2a50ce);})[_0x05af('0x39')](function(_0xa3d624){_0x15107a(_0xa3d624);})[_0x05af('0x1b')](function(_0x389fab){_0x144ec6(_0x2c454a[_0x05af('0x17')](0x1f4,_0x389fab[_0x05af('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ab6948d..60d2963 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 _0xfed3=['emit','removeListener','length','faxAccount:','save'];(function(_0x2d1e3b,_0x5daddd){var _0x4735cc=function(_0x48e15d){while(--_0x48e15d){_0x2d1e3b['push'](_0x2d1e3b['shift']());}};_0x4735cc(++_0x5daddd);}(_0xfed3,0x1df));var _0x3fed=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0xfed3[_0x4480b9];return _0x3f0f02;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x3fed('0x0'),'remove','update'];function createListener(_0x1cc714,_0x405454){return function(_0x46da9a){_0x405454[_0x3fed('0x1')](_0x1cc714,_0x46da9a);};}function removeListener(_0x27a29a,_0x907c7d){return function(){FaxAccountEvents[_0x3fed('0x2')](_0x27a29a,_0x907c7d);};}exports['register']=function(_0x11a57f){for(var _0x3d62fd=0x0,_0xdbe2d2=events[_0x3fed('0x3')];_0x3d62fd<_0xdbe2d2;_0x3d62fd++){var _0x379ee0=events[_0x3d62fd];var _0x59667d=createListener(_0x3fed('0x4')+_0x379ee0,_0x11a57f);FaxAccountEvents['on'](_0x379ee0,_0x59667d);}}; \ No newline at end of file +var _0x4bec=['update','emit','removeListener','register','length','faxAccount:','save','remove'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x4bec,0x1ae));var _0xc4be=function(_0x904353,_0x325f6c){_0x904353=_0x904353-0x0;var _0x16a14a=_0x4bec[_0x904353];return _0x16a14a;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xc4be('0x0'),_0xc4be('0x1'),_0xc4be('0x2')];function createListener(_0x13d080,_0x350185){return function(_0x349ace){_0x350185[_0xc4be('0x3')](_0x13d080,_0x349ace);};}function removeListener(_0x3e1ace,_0x11bfd9){return function(){FaxAccountEvents[_0xc4be('0x4')](_0x3e1ace,_0x11bfd9);};}exports[_0xc4be('0x5')]=function(_0xc9943f){for(var _0x4624a0=0x0,_0x6101fd=events[_0xc4be('0x6')];_0x4624a0<_0x6101fd;_0x4624a0++){var _0x407828=events[_0x4624a0];var _0x179a43=createListener(_0xc4be('0x7')+_0x407828,_0xc9943f);FaxAccountEvents['on'](_0x407828,_0x179a43);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d5d41ba..25f3b70 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(_0x5c6b09,_0x1737fc){var _0x10ad1f=function(_0x398e8e){while(--_0x398e8e){_0x5c6b09['push'](_0x5c6b09['shift']());}};_0x10ad1f(++_0x1737fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x18b31f,_0x2b16b8){var _0x59f1ec=function(_0xe4c6c8){while(--_0xe4c6c8){_0x18b31f['push'](_0x18b31f['shift']());}};_0x59f1ec(++_0x2b16b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 acf4a89..d564e95 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 _0xa33b=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x416d38,_0x1e028a){var _0x2343db=function(_0x2e9572){while(--_0x2e9572){_0x416d38['push'](_0x416d38['shift']());}};_0x2343db(++_0x1e028a);}(_0xa33b,0x83));var _0xba33=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xa33b[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0xba33('0x0'));module[_0xba33('0x1')]={'priority':{'type':Sequelize[_0xba33('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xba33('0x3')],'allowNull':![],'defaultValue':_0xba33('0x4')},'appdata':{'type':Sequelize[_0xba33('0x5')]()},'description':{'type':Sequelize[_0xba33('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xba33('0x6')}}; \ No newline at end of file +var _0x531a=['STRING','noop','TEXT','exports'];(function(_0x1c6944,_0x116df5){var _0x357393=function(_0x4f42a1){while(--_0x4f42a1){_0x1c6944['push'](_0x1c6944['shift']());}};_0x357393(++_0x116df5);}(_0x531a,0xf3));var _0xa531=function(_0x29a1e9,_0x3049a6){_0x29a1e9=_0x29a1e9-0x0;var _0x3302c2=_0x531a[_0x29a1e9];return _0x3302c2;};'use strict';var Sequelize=require('sequelize');module[_0xa531('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa531('0x1')],'allowNull':![],'defaultValue':_0xa531('0x2')},'appdata':{'type':Sequelize[_0xa531('0x3')]()},'description':{'type':Sequelize[_0xa531('0x1')]},'interval':{'type':Sequelize[_0xa531('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 73f9874..9b36f4d 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 _0x04d1=['Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','map','FaxApplication','rawAttributes','type','key','filters','intersection','query','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','then','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x35b7ba,_0x2df40b){var _0x56e953=function(_0x4a1c2c){while(--_0x4a1c2c){_0x35b7ba['push'](_0x35b7ba['shift']());}};_0x56e953(++_0x2df40b);}(_0x04d1,0x158));var _0x104d=function(_0x3414c7,_0x32395d){_0x3414c7=_0x3414c7-0x0;var _0x4e10ba=_0x04d1[_0x3414c7];return _0x4e10ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x104d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x104d('0x1'));var rp=require('request-promise');var moment=require(_0x104d('0x2'));var BPromise=require(_0x104d('0x3'));var Mustache=require(_0x104d('0x4'));var util=require(_0x104d('0x5'));var path=require(_0x104d('0x6'));var sox=require('sox');var csv=require(_0x104d('0x7'));var ejs=require(_0x104d('0x8'));var fs=require('fs');var fs_extra=require(_0x104d('0x9'));var _=require(_0x104d('0xa'));var squel=require(_0x104d('0xb'));var crypto=require(_0x104d('0xc'));var jsforce=require(_0x104d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x104d('0x7'));var querystring=require(_0x104d('0xe'));var Papa=require(_0x104d('0xf'));var Redis=require(_0x104d('0x10'));var authService=require(_0x104d('0x11'));var qs=require(_0x104d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x104d('0x13'));var logger=require('../../config/logger')(_0x104d('0x14'));var utils=require(_0x104d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x104d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc363d9,_0x308f13){_0x308f13=_0x308f13||0xcc;return function(_0x4cd0db){if(_0x4cd0db){return _0xc363d9[_0x104d('0x17')](_0x308f13);}return _0xc363d9[_0x104d('0x18')](_0x308f13)[_0x104d('0x19')]();};}function respondWithResult(_0x5c373c,_0x2d5749){_0x2d5749=_0x2d5749||0xc8;return function(_0x2b0ddb){if(_0x2b0ddb){return _0x5c373c['status'](_0x2d5749)['json'](_0x2b0ddb);}};}function respondWithFilteredResult(_0x3b0737,_0x3d244b){return function(_0x181d0b){if(_0x181d0b){var _0x1e1755=typeof _0x3d244b[_0x104d('0x1a')]===_0x104d('0x1b')&&typeof _0x3d244b[_0x104d('0x1c')]==='undefined';var _0x372c6f=_0x181d0b[_0x104d('0x1d')];var _0x2067d8=_0x1e1755?0x0:_0x3d244b[_0x104d('0x1a')];var _0x1623e0=_0x1e1755?_0x181d0b[_0x104d('0x1d')]:_0x3d244b[_0x104d('0x1a')]+_0x3d244b[_0x104d('0x1c')];var _0x54b6d4;if(_0x1623e0>=_0x372c6f){_0x1623e0=_0x372c6f;_0x54b6d4=0xc8;}else{_0x54b6d4=0xce;}_0x3b0737[_0x104d('0x18')](_0x54b6d4);return _0x3b0737[_0x104d('0x1e')](_0x104d('0x1f'),_0x2067d8+'-'+_0x1623e0+'/'+_0x372c6f)[_0x104d('0x20')](_0x181d0b);}return null;};}function patchUpdates(_0x316160){return function(_0x3eb199){try{jsonpatch[_0x104d('0x21')](_0x3eb199,_0x316160,!![]);}catch(_0x7a3029){return BPromise[_0x104d('0x22')](_0x7a3029);}return _0x3eb199[_0x104d('0x23')]();};}function saveUpdates(_0x360c72,_0x5cf349){return function(_0x243558){if(_0x243558){return _0x243558[_0x104d('0x24')](_0x360c72)['then'](function(_0x2270cf){return _0x2270cf;});}return null;};}function removeEntity(_0x4793f7,_0x5ba33c){return function(_0x3cd408){if(_0x3cd408){return _0x3cd408[_0x104d('0x25')]()['then'](function(){_0x4793f7[_0x104d('0x18')](0xcc)[_0x104d('0x19')]();});}};}function handleEntityNotFound(_0x1451ac,_0x50398f){return function(_0x4ba410){if(!_0x4ba410){_0x1451ac['sendStatus'](0x194);}return _0x4ba410;};}function handleError(_0x4887e0,_0x56992b){_0x56992b=_0x56992b||0x1f4;return function(_0x26ae39){logger[_0x104d('0x26')](_0x26ae39[_0x104d('0x27')]);if(_0x26ae39[_0x104d('0x28')]){delete _0x26ae39[_0x104d('0x28')];}_0x4887e0[_0x104d('0x18')](_0x56992b)[_0x104d('0x29')](_0x26ae39);};}exports['index']=function(_0x19ed42,_0x4b9aba){var _0x5bd5ac={},_0x3f6c37={},_0x255cce={'count':0x0,'rows':[]};var _0x2b0e99=_[_0x104d('0x2a')](db[_0x104d('0x2b')][_0x104d('0x2c')],function(_0x31f43a){return{'name':_0x31f43a['fieldName'],'type':_0x31f43a[_0x104d('0x2d')][_0x104d('0x2e')]};});_0x3f6c37['model']=_['map'](_0x2b0e99,_0x104d('0x28'));_0x3f6c37['query']=_['keys'](_0x19ed42['query']);_0x3f6c37[_0x104d('0x2f')]=_[_0x104d('0x30')](_0x3f6c37['model'],_0x3f6c37[_0x104d('0x31')]);_0x5bd5ac[_0x104d('0x32')]=_['intersection'](_0x3f6c37['model'],qs[_0x104d('0x33')](_0x19ed42['query'][_0x104d('0x33')]));_0x5bd5ac[_0x104d('0x32')]=_0x5bd5ac['attributes'][_0x104d('0x34')]?_0x5bd5ac[_0x104d('0x32')]:_0x3f6c37[_0x104d('0x35')];if(!_0x19ed42[_0x104d('0x31')][_0x104d('0x36')](_0x104d('0x37'))){_0x5bd5ac[_0x104d('0x1c')]=qs[_0x104d('0x1c')](_0x19ed42['query'][_0x104d('0x1c')]);_0x5bd5ac['offset']=qs['offset'](_0x19ed42[_0x104d('0x31')]['offset']);}_0x5bd5ac[_0x104d('0x38')]=qs[_0x104d('0x39')](_0x19ed42['query'][_0x104d('0x39')]);_0x5bd5ac['where']=qs[_0x104d('0x2f')](_[_0x104d('0x3a')](_0x19ed42[_0x104d('0x31')],_0x3f6c37[_0x104d('0x2f')]),_0x2b0e99);if(_0x19ed42[_0x104d('0x31')][_0x104d('0x3b')]){_0x5bd5ac[_0x104d('0x3c')]=_[_0x104d('0x3d')](_0x5bd5ac[_0x104d('0x3c')],{'$or':_[_0x104d('0x2a')](_0x2b0e99,function(_0x345a7f){if(_0x345a7f[_0x104d('0x2d')]!=='VIRTUAL'){var _0x2a8a90={};_0x2a8a90[_0x345a7f[_0x104d('0x28')]]={'$like':'%'+_0x19ed42[_0x104d('0x31')][_0x104d('0x3b')]+'%'};return _0x2a8a90;}})});}_0x5bd5ac=_['merge']({},_0x5bd5ac,_0x19ed42[_0x104d('0x3e')]);var _0x224ec3={'where':_0x5bd5ac[_0x104d('0x3c')]};return db[_0x104d('0x2b')][_0x104d('0x1d')](_0x224ec3)[_0x104d('0x3f')](function(_0x4ff14b){_0x255cce[_0x104d('0x1d')]=_0x4ff14b;if(_0x19ed42[_0x104d('0x31')][_0x104d('0x40')]){_0x5bd5ac[_0x104d('0x41')]=[{'all':!![]}];}return db[_0x104d('0x2b')][_0x104d('0x42')](_0x5bd5ac);})['then'](function(_0x170565){_0x255cce[_0x104d('0x43')]=_0x170565;return _0x255cce;})['then'](respondWithFilteredResult(_0x4b9aba,_0x5bd5ac))['catch'](handleError(_0x4b9aba,null));};exports[_0x104d('0x44')]=function(_0x6f6c74,_0x5103e0){var _0x717c83={'raw':!![],'where':{'id':_0x6f6c74[_0x104d('0x45')]['id']}},_0x4eadc9={};_0x4eadc9[_0x104d('0x35')]=_[_0x104d('0x46')](db[_0x104d('0x2b')][_0x104d('0x2c')]);_0x4eadc9[_0x104d('0x31')]=_[_0x104d('0x46')](_0x6f6c74[_0x104d('0x31')]);_0x4eadc9[_0x104d('0x2f')]=_[_0x104d('0x30')](_0x4eadc9[_0x104d('0x35')],_0x4eadc9[_0x104d('0x31')]);_0x717c83[_0x104d('0x32')]=_[_0x104d('0x30')](_0x4eadc9['model'],qs[_0x104d('0x33')](_0x6f6c74[_0x104d('0x31')][_0x104d('0x33')]));_0x717c83['attributes']=_0x717c83[_0x104d('0x32')][_0x104d('0x34')]?_0x717c83['attributes']:_0x4eadc9[_0x104d('0x35')];if(_0x6f6c74[_0x104d('0x31')][_0x104d('0x40')]){_0x717c83[_0x104d('0x41')]=[{'all':!![]}];}_0x717c83=_[_0x104d('0x3d')]({},_0x717c83,_0x6f6c74[_0x104d('0x3e')]);return db[_0x104d('0x2b')][_0x104d('0x47')](_0x717c83)[_0x104d('0x3f')](handleEntityNotFound(_0x5103e0,null))[_0x104d('0x3f')](respondWithResult(_0x5103e0,null))['catch'](handleError(_0x5103e0,null));};exports[_0x104d('0x48')]=function(_0x15511a,_0x8ef5ab){return db[_0x104d('0x2b')]['create'](_0x15511a[_0x104d('0x49')],{})[_0x104d('0x3f')](respondWithResult(_0x8ef5ab,0xc9))[_0x104d('0x4a')](handleError(_0x8ef5ab,null));};exports[_0x104d('0x24')]=function(_0x45c0d3,_0x1321e4){if(_0x45c0d3[_0x104d('0x49')]['id']){delete _0x45c0d3[_0x104d('0x49')]['id'];}return db[_0x104d('0x2b')][_0x104d('0x47')]({'where':{'id':_0x45c0d3[_0x104d('0x45')]['id']}})['then'](handleEntityNotFound(_0x1321e4,null))['then'](saveUpdates(_0x45c0d3['body'],null))[_0x104d('0x3f')](respondWithResult(_0x1321e4,null))[_0x104d('0x4a')](handleError(_0x1321e4,null));};exports[_0x104d('0x25')]=function(_0x561982,_0xedc0a3){return db['FaxApplication'][_0x104d('0x47')]({'where':{'id':_0x561982[_0x104d('0x45')]['id']}})['then'](handleEntityNotFound(_0xedc0a3,null))['then'](removeEntity(_0xedc0a3,null))['catch'](handleError(_0xedc0a3,null));}; \ No newline at end of file +var _0x65fe=['status','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','FaxApplication','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count'];(function(_0x53e4fd,_0xe40fa8){var _0x4df112=function(_0x31a4f5){while(--_0x31a4f5){_0x53e4fd['push'](_0x53e4fd['shift']());}};_0x4df112(++_0xe40fa8);}(_0x65fe,0x1b5));var _0xe65f=function(_0xa8005d,_0x57ff35){_0xa8005d=_0xa8005d-0x0;var _0x47da19=_0x65fe[_0xa8005d];return _0x47da19;};'use strict';var emlformat=require(_0xe65f('0x0'));var rimraf=require(_0xe65f('0x1'));var zipdir=require(_0xe65f('0x2'));var jsonpatch=require(_0xe65f('0x3'));var rp=require(_0xe65f('0x4'));var moment=require(_0xe65f('0x5'));var BPromise=require(_0xe65f('0x6'));var Mustache=require(_0xe65f('0x7'));var util=require(_0xe65f('0x8'));var path=require(_0xe65f('0x9'));var sox=require('sox');var csv=require(_0xe65f('0xa'));var ejs=require(_0xe65f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe65f('0xc'));var squel=require(_0xe65f('0xd'));var crypto=require(_0xe65f('0xe'));var jsforce=require(_0xe65f('0xf'));var deskjs=require(_0xe65f('0x10'));var toCsv=require(_0xe65f('0xa'));var querystring=require(_0xe65f('0x11'));var Papa=require('papaparse');var Redis=require(_0xe65f('0x12'));var authService=require(_0xe65f('0x13'));var qs=require(_0xe65f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe65f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xe65f('0x16'));var config=require(_0xe65f('0x17'));var licenseUtil=require(_0xe65f('0x18'));var db=require(_0xe65f('0x19'))['db'];function respondWithStatusCode(_0x2300b7,_0x4318e8){_0x4318e8=_0x4318e8||0xcc;return function(_0x108c7e){if(_0x108c7e){return _0x2300b7[_0xe65f('0x1a')](_0x4318e8);}return _0x2300b7['status'](_0x4318e8)[_0xe65f('0x1b')]();};}function respondWithResult(_0x4e76fd,_0x4c1ee3){_0x4c1ee3=_0x4c1ee3||0xc8;return function(_0x34bcf1){if(_0x34bcf1){return _0x4e76fd['status'](_0x4c1ee3)['json'](_0x34bcf1);}};}function respondWithFilteredResult(_0x3cf269,_0x1a5739){return function(_0xfc59e0){if(_0xfc59e0){var _0xe6b891=typeof _0x1a5739[_0xe65f('0x1c')]===_0xe65f('0x1d')&&typeof _0x1a5739['limit']===_0xe65f('0x1d');var _0x1273a9=_0xfc59e0[_0xe65f('0x1e')];var _0x1927f4=_0xe6b891?0x0:_0x1a5739[_0xe65f('0x1c')];var _0x4eb7b7=_0xe6b891?_0xfc59e0[_0xe65f('0x1e')]:_0x1a5739[_0xe65f('0x1c')]+_0x1a5739['limit'];var _0x58b4a1;if(_0x4eb7b7>=_0x1273a9){_0x4eb7b7=_0x1273a9;_0x58b4a1=0xc8;}else{_0x58b4a1=0xce;}_0x3cf269[_0xe65f('0x1f')](_0x58b4a1);return _0x3cf269[_0xe65f('0x20')](_0xe65f('0x21'),_0x1927f4+'-'+_0x4eb7b7+'/'+_0x1273a9)[_0xe65f('0x22')](_0xfc59e0);}return null;};}function patchUpdates(_0x5021a7){return function(_0xe9fffa){try{jsonpatch[_0xe65f('0x23')](_0xe9fffa,_0x5021a7,!![]);}catch(_0x10894d){return BPromise[_0xe65f('0x24')](_0x10894d);}return _0xe9fffa[_0xe65f('0x25')]();};}function saveUpdates(_0x45d3b4,_0x3f83b8){return function(_0x531dd0){if(_0x531dd0){return _0x531dd0[_0xe65f('0x26')](_0x45d3b4)[_0xe65f('0x27')](function(_0x37d9f5){return _0x37d9f5;});}return null;};}function removeEntity(_0x58b0c1,_0xd3984f){return function(_0xf2a360){if(_0xf2a360){return _0xf2a360[_0xe65f('0x28')]()['then'](function(){_0x58b0c1[_0xe65f('0x1f')](0xcc)[_0xe65f('0x1b')]();});}};}function handleEntityNotFound(_0x5292b5,_0x25eed2){return function(_0x1e42ce){if(!_0x1e42ce){_0x5292b5['sendStatus'](0x194);}return _0x1e42ce;};}function handleError(_0x11ecf0,_0x4aa6b9){_0x4aa6b9=_0x4aa6b9||0x1f4;return function(_0x4b6365){logger['error'](_0x4b6365[_0xe65f('0x29')]);if(_0x4b6365[_0xe65f('0x2a')]){delete _0x4b6365[_0xe65f('0x2a')];}_0x11ecf0['status'](_0x4aa6b9)[_0xe65f('0x2b')](_0x4b6365);};}exports[_0xe65f('0x2c')]=function(_0x26f541,_0x28e2d3){var _0x593d44={},_0x2e8584={},_0x594606={'count':0x0,'rows':[]};var _0x1c5ae5=_[_0xe65f('0x2d')](db['FaxApplication'][_0xe65f('0x2e')],function(_0x176907){return{'name':_0x176907[_0xe65f('0x2f')],'type':_0x176907[_0xe65f('0x30')][_0xe65f('0x31')]};});_0x2e8584[_0xe65f('0x32')]=_[_0xe65f('0x2d')](_0x1c5ae5,_0xe65f('0x2a'));_0x2e8584[_0xe65f('0x33')]=_[_0xe65f('0x34')](_0x26f541[_0xe65f('0x33')]);_0x2e8584['filters']=_[_0xe65f('0x35')](_0x2e8584['model'],_0x2e8584[_0xe65f('0x33')]);_0x593d44['attributes']=_[_0xe65f('0x35')](_0x2e8584[_0xe65f('0x32')],qs[_0xe65f('0x36')](_0x26f541[_0xe65f('0x33')][_0xe65f('0x36')]));_0x593d44[_0xe65f('0x37')]=_0x593d44[_0xe65f('0x37')]['length']?_0x593d44[_0xe65f('0x37')]:_0x2e8584['model'];if(!_0x26f541['query'][_0xe65f('0x38')](_0xe65f('0x39'))){_0x593d44['limit']=qs[_0xe65f('0x3a')](_0x26f541[_0xe65f('0x33')]['limit']);_0x593d44[_0xe65f('0x1c')]=qs['offset'](_0x26f541[_0xe65f('0x33')][_0xe65f('0x1c')]);}_0x593d44[_0xe65f('0x3b')]=qs[_0xe65f('0x3c')](_0x26f541[_0xe65f('0x33')]['sort']);_0x593d44['where']=qs[_0xe65f('0x3d')](_[_0xe65f('0x3e')](_0x26f541[_0xe65f('0x33')],_0x2e8584['filters']),_0x1c5ae5);if(_0x26f541[_0xe65f('0x33')][_0xe65f('0x3f')]){_0x593d44[_0xe65f('0x40')]=_[_0xe65f('0x41')](_0x593d44[_0xe65f('0x40')],{'$or':_[_0xe65f('0x2d')](_0x1c5ae5,function(_0x228468){if(_0x228468[_0xe65f('0x30')]!==_0xe65f('0x42')){var _0x13100c={};_0x13100c[_0x228468[_0xe65f('0x2a')]]={'$like':'%'+_0x26f541[_0xe65f('0x33')][_0xe65f('0x3f')]+'%'};return _0x13100c;}})});}_0x593d44=_[_0xe65f('0x41')]({},_0x593d44,_0x26f541[_0xe65f('0x43')]);var _0x4a79b3={'where':_0x593d44[_0xe65f('0x40')]};return db['FaxApplication'][_0xe65f('0x1e')](_0x4a79b3)[_0xe65f('0x27')](function(_0x1412f6){_0x594606[_0xe65f('0x1e')]=_0x1412f6;if(_0x26f541[_0xe65f('0x33')][_0xe65f('0x44')]){_0x593d44[_0xe65f('0x45')]=[{'all':!![]}];}return db[_0xe65f('0x46')]['findAll'](_0x593d44);})['then'](function(_0x120874){_0x594606[_0xe65f('0x47')]=_0x120874;return _0x594606;})[_0xe65f('0x27')](respondWithFilteredResult(_0x28e2d3,_0x593d44))[_0xe65f('0x48')](handleError(_0x28e2d3,null));};exports[_0xe65f('0x49')]=function(_0x432fab,_0x79be29){var _0x12366b={'raw':!![],'where':{'id':_0x432fab[_0xe65f('0x4a')]['id']}},_0x3b4705={};_0x3b4705['model']=_[_0xe65f('0x34')](db[_0xe65f('0x46')][_0xe65f('0x2e')]);_0x3b4705[_0xe65f('0x33')]=_['keys'](_0x432fab[_0xe65f('0x33')]);_0x3b4705[_0xe65f('0x3d')]=_[_0xe65f('0x35')](_0x3b4705['model'],_0x3b4705[_0xe65f('0x33')]);_0x12366b[_0xe65f('0x37')]=_[_0xe65f('0x35')](_0x3b4705[_0xe65f('0x32')],qs[_0xe65f('0x36')](_0x432fab[_0xe65f('0x33')][_0xe65f('0x36')]));_0x12366b[_0xe65f('0x37')]=_0x12366b[_0xe65f('0x37')]['length']?_0x12366b[_0xe65f('0x37')]:_0x3b4705['model'];if(_0x432fab[_0xe65f('0x33')][_0xe65f('0x44')]){_0x12366b['include']=[{'all':!![]}];}_0x12366b=_[_0xe65f('0x41')]({},_0x12366b,_0x432fab['options']);return db['FaxApplication'][_0xe65f('0x4b')](_0x12366b)[_0xe65f('0x27')](handleEntityNotFound(_0x79be29,null))['then'](respondWithResult(_0x79be29,null))['catch'](handleError(_0x79be29,null));};exports[_0xe65f('0x4c')]=function(_0x2e18e9,_0x5d8bfd){return db[_0xe65f('0x46')][_0xe65f('0x4c')](_0x2e18e9[_0xe65f('0x4d')],{})[_0xe65f('0x27')](respondWithResult(_0x5d8bfd,0xc9))[_0xe65f('0x48')](handleError(_0x5d8bfd,null));};exports[_0xe65f('0x26')]=function(_0x5648aa,_0x773cbc){if(_0x5648aa[_0xe65f('0x4d')]['id']){delete _0x5648aa[_0xe65f('0x4d')]['id'];}return db[_0xe65f('0x46')][_0xe65f('0x4b')]({'where':{'id':_0x5648aa['params']['id']}})[_0xe65f('0x27')](handleEntityNotFound(_0x773cbc,null))[_0xe65f('0x27')](saveUpdates(_0x5648aa[_0xe65f('0x4d')],null))[_0xe65f('0x27')](respondWithResult(_0x773cbc,null))[_0xe65f('0x48')](handleError(_0x773cbc,null));};exports[_0xe65f('0x28')]=function(_0x5cf097,_0x2e7e79){return db[_0xe65f('0x46')]['find']({'where':{'id':_0x5cf097[_0xe65f('0x4a')]['id']}})[_0xe65f('0x27')](handleEntityNotFound(_0x2e7e79,null))[_0xe65f('0x27')](removeEntity(_0x2e7e79,null))[_0xe65f('0x48')](handleError(_0x2e7e79,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index bee132f..aac2266 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 _0xa0e2=['api','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0e2,0x1ae));var _0x2a0e=function(_0x42dbc2,_0x538d22){_0x42dbc2=_0x42dbc2-0x0;var _0x318e4a=_0xa0e2[_0x42dbc2];return _0x318e4a;};'use strict';var _=require('lodash');var util=require(_0x2a0e('0x0'));var logger=require(_0x2a0e('0x1'))(_0x2a0e('0x2'));var moment=require(_0x2a0e('0x3'));var BPromise=require(_0x2a0e('0x4'));var rp=require(_0x2a0e('0x5'));var fs=require('fs');var path=require(_0x2a0e('0x6'));var rimraf=require('rimraf');var config=require(_0x2a0e('0x7'));var attributes=require(_0x2a0e('0x8'));module[_0x2a0e('0x9')]=function(_0x171a6f,_0x17e30a){return _0x171a6f[_0x2a0e('0xa')]('FaxApplication',attributes,{'tableName':_0x2a0e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfc63=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications'];(function(_0x383090,_0x1ed765){var _0x1fd814=function(_0x4877a8){while(--_0x4877a8){_0x383090['push'](_0x383090['shift']());}};_0x1fd814(++_0x1ed765);}(_0xfc63,0x1af));var _0x3fc6=function(_0xd27252,_0x9ad020){_0xd27252=_0xd27252-0x0;var _0x2cfd7c=_0xfc63[_0xd27252];return _0x2cfd7c;};'use strict';var _=require('lodash');var util=require(_0x3fc6('0x0'));var logger=require('../../config/logger')(_0x3fc6('0x1'));var moment=require(_0x3fc6('0x2'));var BPromise=require(_0x3fc6('0x3'));var rp=require(_0x3fc6('0x4'));var fs=require('fs');var path=require(_0x3fc6('0x5'));var rimraf=require('rimraf');var config=require(_0x3fc6('0x6'));var attributes=require(_0x3fc6('0x7'));module[_0x3fc6('0x8')]=function(_0x3db17e,_0xdaf082){return _0x3db17e['define'](_0x3fc6('0x9'),attributes,{'tableName':_0x3fc6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3fc6('0xb'),'collate':_0x3fc6('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index fe598d3..6713560 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 _0x236f=['body','options','raw','attributes','limit','UpdateFaxApplication','debug','stringify','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0x236f,0xb0));var _0xf236=function(_0x3c37c9,_0x2e6c3a){_0x3c37c9=_0x3c37c9-0x0;var _0x51e91d=_0x236f[_0x3c37c9];return _0x51e91d;};'use strict';var _=require(_0xf236('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf236('0x1'));var rs=require(_0xf236('0x2'));var fs=require('fs');var Redis=require(_0xf236('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf236('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf236('0x5'));var jayson=require(_0xf236('0x6'));var client=jayson[_0xf236('0x7')][_0xf236('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x265cc7,_0x3c4747,_0x135527){return new BPromise(function(_0x216d1f,_0x1634de){return client[_0xf236('0x9')](_0x265cc7,_0x135527)[_0xf236('0xa')](function(_0x3a97c5){logger['info'](_0xf236('0xb'),_0x3c4747,'request\x20sent');logger['debug'](_0xf236('0xc'),_0x3c4747,_0xf236('0xd'),JSON['stringify'](_0x3a97c5));if(_0x3a97c5[_0xf236('0xe')]){if(_0x3a97c5[_0xf236('0xe')][_0xf236('0xf')]===0x1f4){logger['error'](_0xf236('0xb'),_0x3c4747,_0x3a97c5['error']['message']);return _0x1634de(_0x3a97c5[_0xf236('0xe')]['message']);}logger[_0xf236('0xe')](_0xf236('0xb'),_0x3c4747,_0x3a97c5[_0xf236('0xe')][_0xf236('0x10')]);return _0x216d1f(_0x3a97c5[_0xf236('0xe')][_0xf236('0x10')]);}else{logger[_0xf236('0x11')](_0xf236('0xb'),_0x3c4747,_0xf236('0xd'));_0x216d1f(_0x3a97c5[_0xf236('0x12')][_0xf236('0x10')]);}})[_0xf236('0x13')](function(_0x53b7be){logger[_0xf236('0xe')]('FaxApplication,\x20%s,\x20%s',_0x3c4747,_0x53b7be);_0x1634de(_0x53b7be);});});}exports['UpdateFaxApplication']=function(_0x5ca65f){var _0x169816=this;return new Promise(function(_0x2933b2,_0x4520ff){return db['FaxApplication']['update'](_0x5ca65f[_0xf236('0x14')],{'raw':_0x5ca65f[_0xf236('0x15')]?_0x5ca65f[_0xf236('0x15')][_0xf236('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ca65f[_0xf236('0x15')]?_0x5ca65f['options']['where']||null:null,'attributes':_0x5ca65f['options']?_0x5ca65f[_0xf236('0x15')][_0xf236('0x17')]||null:null,'limit':_0x5ca65f[_0xf236('0x15')]?_0x5ca65f[_0xf236('0x15')][_0xf236('0x18')]||null:null})[_0xf236('0xa')](function(_0x29fd06){logger[_0xf236('0x11')](_0xf236('0x19'),_0x5ca65f);logger[_0xf236('0x1a')](_0xf236('0x19'),_0x5ca65f,JSON[_0xf236('0x1b')](_0x29fd06));_0x2933b2(_0x29fd06);})['catch'](function(_0x284fa8){logger[_0xf236('0xe')]('UpdateFaxApplication',_0x284fa8['message'],_0x5ca65f);_0x4520ff(_0x169816[_0xf236('0xe')](0x1f4,_0x284fa8['message']));});});}; \ No newline at end of file +var _0x361c=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','UpdateFaxApplication','update','body','options','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s'];(function(_0xbb36a0,_0x1cb1e4){var _0x306db2=function(_0xc63ad3){while(--_0xc63ad3){_0xbb36a0['push'](_0xbb36a0['shift']());}};_0x306db2(++_0x1cb1e4);}(_0x361c,0x1ef));var _0xc361=function(_0x2abdde,_0x2baf86){_0x2abdde=_0x2abdde-0x0;var _0x3f2165=_0x361c[_0x2abdde];return _0x3f2165;};'use strict';var _=require(_0xc361('0x0'));var util=require(_0xc361('0x1'));var moment=require(_0xc361('0x2'));var BPromise=require('bluebird');var rs=require(_0xc361('0x3'));var fs=require('fs');var Redis=require(_0xc361('0x4'));var db=require(_0xc361('0x5'))['db'];var utils=require(_0xc361('0x6'));var logger=require(_0xc361('0x7'))(_0xc361('0x8'));var config=require(_0xc361('0x9'));var jayson=require(_0xc361('0xa'));var client=jayson[_0xc361('0xb')][_0xc361('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x101f18,_0x3b1f2f,_0x221a6){return new BPromise(function(_0xe5f083,_0x53ff73){return client['request'](_0x101f18,_0x221a6)[_0xc361('0xd')](function(_0x54ec6d){logger['info'](_0xc361('0xe'),_0x3b1f2f,'request\x20sent');logger[_0xc361('0xf')](_0xc361('0x10'),_0x3b1f2f,_0xc361('0x11'),JSON[_0xc361('0x12')](_0x54ec6d));if(_0x54ec6d['error']){if(_0x54ec6d[_0xc361('0x13')]['code']===0x1f4){logger[_0xc361('0x13')](_0xc361('0xe'),_0x3b1f2f,_0x54ec6d[_0xc361('0x13')][_0xc361('0x14')]);return _0x53ff73(_0x54ec6d[_0xc361('0x13')]['message']);}logger[_0xc361('0x13')](_0xc361('0xe'),_0x3b1f2f,_0x54ec6d[_0xc361('0x13')][_0xc361('0x14')]);return _0xe5f083(_0x54ec6d[_0xc361('0x13')]['message']);}else{logger[_0xc361('0x15')](_0xc361('0xe'),_0x3b1f2f,_0xc361('0x11'));_0xe5f083(_0x54ec6d['result'][_0xc361('0x14')]);}})[_0xc361('0x16')](function(_0x3c4f60){logger['error'](_0xc361('0xe'),_0x3b1f2f,_0x3c4f60);_0x53ff73(_0x3c4f60);});});}exports[_0xc361('0x17')]=function(_0x30b1cd){var _0x21abdd=this;return new Promise(function(_0x5ee0e6,_0x315946){return db['FaxApplication'][_0xc361('0x18')](_0x30b1cd[_0xc361('0x19')],{'raw':_0x30b1cd[_0xc361('0x1a')]?_0x30b1cd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30b1cd['options']?_0x30b1cd[_0xc361('0x1a')][_0xc361('0x1b')]||null:null,'attributes':_0x30b1cd['options']?_0x30b1cd[_0xc361('0x1a')][_0xc361('0x1c')]||null:null,'limit':_0x30b1cd[_0xc361('0x1a')]?_0x30b1cd[_0xc361('0x1a')][_0xc361('0x1d')]||null:null})['then'](function(_0x36fd43){logger[_0xc361('0x15')](_0xc361('0x17'),_0x30b1cd);logger[_0xc361('0xf')]('UpdateFaxApplication',_0x30b1cd,JSON[_0xc361('0x12')](_0x36fd43));_0x5ee0e6(_0x36fd43);})['catch'](function(_0x6fe9b4){logger[_0xc361('0x13')](_0xc361('0x17'),_0x6fe9b4[_0xc361('0x14')],_0x30b1cd);_0x315946(_0x21abdd[_0xc361('0x13')](0x1f4,_0x6fe9b4[_0xc361('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 98b25b6..84400cc 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 _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xefda,0x96));var _0xaefd=function(_0x3d2ab5,_0x1a3553){_0x3d2ab5=_0x3d2ab5-0x0;var _0x421623=_0xefda[_0x3d2ab5];return _0x421623;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file +var _0x0abf=['isAuthenticated','index','show','post','put','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x0abf,0xe8));var _0xf0ab=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0abf[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0xb')]('/',auth[_0xf0ab('0x8')](),controller['create']);router[_0xf0ab('0xc')](_0xf0ab('0xd'),auth[_0xf0ab('0x8')](),controller['update']);router['delete'](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0xe')]);module[_0xf0ab('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 50efda0..932279f 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 _0x8a3c=['ENUM','out','DATE','STRING'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x8a3c,0x76));var _0xc8a3=function(_0x2a63be,_0x4ad6cf){_0x2a63be=_0x2a63be-0x0;var _0x351bd7=_0x8a3c[_0x2a63be];return _0x351bd7;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc8a3('0x0')]},'disposition':{'type':Sequelize[_0xc8a3('0x1')]},'secondDisposition':{'type':Sequelize[_0xc8a3('0x1')]},'thirdDisposition':{'type':Sequelize[_0xc8a3('0x1')]},'note':{'type':Sequelize[_0xc8a3('0x1')]},'read1stAt':{'type':Sequelize[_0xc8a3('0x0')]},'fax':{'type':Sequelize[_0xc8a3('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xc8a3('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc8a3('0x0')]},'lastMsgDirection':{'type':Sequelize[_0xc8a3('0x2')]('in',_0xc8a3('0x3')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6258=['STRING','ENUM','out','sequelize','DATE'];(function(_0x2c4008,_0x5dbd0a){var _0x315f25=function(_0x2b0fc9){while(--_0x2b0fc9){_0x2c4008['push'](_0x2c4008['shift']());}};_0x315f25(++_0x5dbd0a);}(_0x6258,0x1f2));var _0x8625=function(_0x5251ed,_0x2e6695){_0x5251ed=_0x5251ed-0x0;var _0x4eaea3=_0x6258[_0x5251ed];return _0x4eaea3;};'use strict';var Sequelize=require(_0x8625('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8625('0x1')]},'disposition':{'type':Sequelize[_0x8625('0x2')]},'secondDisposition':{'type':Sequelize[_0x8625('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8625('0x1')]},'fax':{'type':Sequelize[_0x8625('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x8625('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8625('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x8625('0x3')]('in',_0x8625('0x4')),'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 00f23fa..5d0b526 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 _0x9b03=['fields','length','model','includeAll','include','merge','options','find','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','attachments','join','push','Attachment','Messages','createdAt','get','basename','existsSync','createWriteStream','log','err','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','util','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','end','status','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','stack','name','send','index','FaxInteraction','key','getOptions','findAll','fax','query','catch','show','params','keys','rawAttributes','filters','intersection','attributes'];(function(_0x19d1a2,_0x1e6dda){var _0x4abb84=function(_0x183322){while(--_0x183322){_0x19d1a2['push'](_0x19d1a2['shift']());}};_0x4abb84(++_0x1e6dda);}(_0x9b03,0xfd));var _0x39b0=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x9b03[_0x2ec461];return _0x28603d;};'use strict';var rimraf=require(_0x39b0('0x0'));var zipdir=require(_0x39b0('0x1'));var moment=require(_0x39b0('0x2'));var BPromise=require(_0x39b0('0x3'));var util=require(_0x39b0('0x4'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x39b0('0x5'));var qs=require(_0x39b0('0x6'));var logger=require('../../config/logger')('api');var config=require(_0x39b0('0x7'));var db=require(_0x39b0('0x8'))['db'];config[_0x39b0('0x9')]=_[_0x39b0('0xa')](config[_0x39b0('0x9')],{'host':_0x39b0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39b0('0x9')]));require(_0x39b0('0xc'))[_0x39b0('0xd')](socket);function respondWithStatusCode(_0x581c3a,_0x1201ab){_0x1201ab=_0x1201ab||0xcc;return function(_0xe45357){if(_0xe45357){return _0x581c3a['sendStatus'](_0x1201ab);}return _0x581c3a['status'](_0x1201ab)[_0x39b0('0xe')]();};}function respondWithResult(_0x3dc90c,_0x5d0335){_0x5d0335=_0x5d0335||0xc8;return function(_0x60098d){if(_0x60098d){return _0x3dc90c[_0x39b0('0xf')](_0x5d0335)['json'](_0x60098d);}};}function respondWithFilteredResult(_0x4364d3,_0x8ca9d5){return function(_0x40ccaa){if(_0x40ccaa){var _0x2c785c=typeof _0x8ca9d5[_0x39b0('0x10')]==='undefined'&&typeof _0x8ca9d5[_0x39b0('0x11')]===_0x39b0('0x12');var _0x2e5af0=_0x40ccaa[_0x39b0('0x13')];var _0x32b358=_0x2c785c?0x0:_0x8ca9d5['offset'];var _0x274687=_0x2c785c?_0x40ccaa['count']:_0x8ca9d5[_0x39b0('0x10')]+_0x8ca9d5[_0x39b0('0x11')];var _0x53843a;if(_0x274687>=_0x2e5af0){_0x274687=_0x2e5af0;_0x53843a=0xc8;}else{_0x53843a=0xce;}_0x4364d3[_0x39b0('0xf')](_0x53843a);return _0x4364d3[_0x39b0('0x14')](_0x39b0('0x15'),_0x32b358+'-'+_0x274687+'/'+_0x2e5af0)[_0x39b0('0x16')](_0x40ccaa);}return null;};}function saveUpdates(_0x25297b){return function(_0x40dbaf){if(_0x40dbaf){return _0x40dbaf[_0x39b0('0x17')](_0x25297b)[_0x39b0('0x18')](function(_0x7610d8){return _0x7610d8;});}return null;};}function removeEntity(_0x5f2d35){return function(_0x3cbb15){if(_0x3cbb15){return _0x3cbb15[_0x39b0('0x19')]()[_0x39b0('0x18')](function(){_0x5f2d35[_0x39b0('0xf')](0xcc)[_0x39b0('0xe')]();});}};}function handleEntityNotFound(_0x4f62cc){return function(_0x48d902){if(!_0x48d902){_0x4f62cc['sendStatus'](0x194);}return _0x48d902;};}function handleError(_0x2ca9e2,_0x43f1e6){_0x43f1e6=_0x43f1e6||0x1f4;return function(_0x3f0d56){logger['error'](_0x3f0d56[_0x39b0('0x1a')]);if(_0x3f0d56['name']){delete _0x3f0d56[_0x39b0('0x1b')];}_0x2ca9e2[_0x39b0('0xf')](_0x43f1e6)[_0x39b0('0x1c')](_0x3f0d56);};}exports[_0x39b0('0x1d')]=function(_0x2aec83,_0x2bcc40){var _0x3124e1={};var _0x3cb048=_['map'](db[_0x39b0('0x1e')]['rawAttributes'],function(_0x582fe5){return{'name':_0x582fe5['fieldName'],'type':_0x582fe5['type'][_0x39b0('0x1f')]};});_0x3124e1=qs[_0x39b0('0x20')](_0x3cb048,_0x2aec83);return interaction[_0x39b0('0x21')](_0x39b0('0x22'),_0x2aec83[_0x39b0('0x23')],_0x2aec83['user'],_0x3124e1,_0x3cb048)[_0x39b0('0x18')](respondWithFilteredResult(_0x2bcc40,_0x3124e1))[_0x39b0('0x24')](handleError(_0x2bcc40,null));};exports[_0x39b0('0x25')]=function(_0x3778db,_0x531fb1){var _0x3d0b39={'raw':![],'where':{'id':_0x3778db[_0x39b0('0x26')]['id']}},_0x12884e={};_0x12884e['model']=_[_0x39b0('0x27')](db[_0x39b0('0x1e')][_0x39b0('0x28')]);_0x12884e[_0x39b0('0x23')]=_[_0x39b0('0x27')](_0x3778db[_0x39b0('0x23')]);_0x12884e[_0x39b0('0x29')]=_[_0x39b0('0x2a')](_0x12884e['model'],_0x12884e[_0x39b0('0x23')]);_0x3d0b39[_0x39b0('0x2b')]=_[_0x39b0('0x2a')](_0x12884e['model'],qs[_0x39b0('0x2c')](_0x3778db[_0x39b0('0x23')][_0x39b0('0x2c')]));_0x3d0b39[_0x39b0('0x2b')]=_0x3d0b39[_0x39b0('0x2b')][_0x39b0('0x2d')]?_0x3d0b39['attributes']:_0x12884e[_0x39b0('0x2e')];if(_0x3778db[_0x39b0('0x23')][_0x39b0('0x2f')]){_0x3d0b39[_0x39b0('0x30')]=[{'all':!![]}];}_0x3d0b39=_[_0x39b0('0x31')]({},_0x3d0b39,_0x3778db[_0x39b0('0x32')]);return db['FaxInteraction'][_0x39b0('0x33')](_0x3d0b39)['then'](handleEntityNotFound(_0x531fb1,null))[_0x39b0('0x18')](respondWithResult(_0x531fb1,null))['catch'](handleError(_0x531fb1,null));};exports['create']=function(_0x224544,_0x34e52e){return db['FaxInteraction']['create'](_0x224544[_0x39b0('0x34')],{})[_0x39b0('0x18')](respondWithResult(_0x34e52e,0xc9))['catch'](handleError(_0x34e52e,null));};exports[_0x39b0('0x17')]=function(_0x484aba,_0xf0f0e8){if(_0x484aba[_0x39b0('0x34')]['id']){delete _0x484aba[_0x39b0('0x34')]['id'];}return db[_0x39b0('0x1e')][_0x39b0('0x33')]({'where':{'id':_0x484aba['params']['id']}})[_0x39b0('0x18')](handleEntityNotFound(_0xf0f0e8,null))[_0x39b0('0x18')](saveUpdates(_0x484aba[_0x39b0('0x34')],null))[_0x39b0('0x18')](respondWithResult(_0xf0f0e8,null))['catch'](handleError(_0xf0f0e8,null));};exports[_0x39b0('0x19')]=function(_0xfcea29,_0x233462){return db[_0x39b0('0x1e')]['find']({'where':{'id':_0xfcea29[_0x39b0('0x26')]['id']}})[_0x39b0('0x18')](handleEntityNotFound(_0x233462,null))[_0x39b0('0x18')](removeEntity(_0x233462,null))['catch'](handleError(_0x233462,null));};exports[_0x39b0('0x35')]=function(_0x127135,_0x4f2101){return db[_0x39b0('0x1e')][_0x39b0('0x35')]()[_0x39b0('0x18')](respondWithResult(_0x4f2101,null))[_0x39b0('0x24')](handleError(_0x4f2101,null));};exports['addMessage']=function(_0x2c6cd0,_0x19725b){return db[_0x39b0('0x36')]['find']({'where':{'id':_0x2c6cd0[_0x39b0('0x26')]['id']}})['then'](handleEntityNotFound(_0x19725b,null))[_0x39b0('0x18')](function(_0x3daa0f){if(_0x3daa0f){return _0x3daa0f[_0x39b0('0x37')](_0x2c6cd0[_0x39b0('0x34')][_0x39b0('0x38')],_[_0x39b0('0x39')](_0x2c6cd0['body'],['ids','id'])||{});}})[_0x39b0('0x18')](respondWithResult(_0x19725b,null))[_0x39b0('0x24')](handleError(_0x19725b,null));};exports[_0x39b0('0x3a')]=function(_0x5383e0,_0x1330c5){var _0x3c85cb={'raw':![],'where':{}};var _0x3e9b7b={};var _0x3b39f9={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x39b0('0x3b')]({'where':{'id':_0x5383e0['params']['id']}})[_0x39b0('0x18')](handleEntityNotFound(_0x1330c5,null))[_0x39b0('0x18')](function(_0x500890){if(_0x500890){_0x3e9b7b[_0x39b0('0x2e')]=_[_0x39b0('0x27')](db['FaxMessage'][_0x39b0('0x28')]);_0x3e9b7b['query']=_['keys'](_0x5383e0['query']);_0x3e9b7b[_0x39b0('0x29')]=_[_0x39b0('0x2a')](_0x3e9b7b[_0x39b0('0x2e')],_0x3e9b7b['query']);_0x3c85cb[_0x39b0('0x2b')]=_[_0x39b0('0x2a')](_0x3e9b7b[_0x39b0('0x2e')],qs[_0x39b0('0x2c')](_0x5383e0[_0x39b0('0x23')][_0x39b0('0x2c')]));_0x3c85cb[_0x39b0('0x2b')]=_0x3c85cb[_0x39b0('0x2b')][_0x39b0('0x2d')]?_0x3c85cb[_0x39b0('0x2b')]:_0x3e9b7b[_0x39b0('0x2e')];if(!_0x5383e0[_0x39b0('0x23')][_0x39b0('0x3c')](_0x39b0('0x3d'))){_0x3c85cb[_0x39b0('0x11')]=qs[_0x39b0('0x11')](_0x5383e0[_0x39b0('0x23')][_0x39b0('0x11')]);_0x3c85cb[_0x39b0('0x10')]=qs[_0x39b0('0x10')](_0x5383e0['query']['offset']);}_0x3c85cb[_0x39b0('0x3e')]=qs[_0x39b0('0x3f')](_0x5383e0['query']['sort']);_0x3c85cb[_0x39b0('0x40')]=qs[_0x39b0('0x29')](_['pick'](_0x5383e0['query'],_0x3e9b7b[_0x39b0('0x29')]));_0x3c85cb['where']['FaxInteractionId']=_0x500890['id'];if(_0x5383e0[_0x39b0('0x23')][_0x39b0('0x41')]){_0x3c85cb[_0x39b0('0x40')]=_['merge'](_0x3c85cb[_0x39b0('0x40')],{'$or':_[_0x39b0('0x42')](_0x3c85cb['attributes'],function(_0x29118b){var _0x140b4c={};_0x140b4c[_0x29118b]={'$like':'%'+_0x5383e0['query'][_0x39b0('0x41')]+'%'};return _0x140b4c;})});}if(_0x5383e0[_0x39b0('0x23')][_0x39b0('0x43')]){var _0x2e355b=_0x5383e0['query'][_0x39b0('0x43')][_0x39b0('0x44')](',');var _0x2ed2ae={};_0x2ed2ae[_0x2e355b[0x0]]={'$gte':moment(_0x2e355b[0x1])[_0x39b0('0x45')](_0x39b0('0x46'))};_0x3c85cb[_0x39b0('0x40')]=_[_0x39b0('0x31')](_0x3c85cb['where'],_0x2ed2ae);}_0x3c85cb=_['merge']({},_0x3c85cb,_0x5383e0[_0x39b0('0x32')]);return db[_0x39b0('0x36')][_0x39b0('0x13')]({'where':_0x3c85cb['where']})[_0x39b0('0x18')](function(_0x1d2d6c){_0x3b39f9['count']=_0x1d2d6c;if(_0x5383e0[_0x39b0('0x23')][_0x39b0('0x2f')]){_0x3c85cb['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x3c85cb);})[_0x39b0('0x18')](function(_0x48a1d1){_0x3b39f9[_0x39b0('0x47')]=_0x48a1d1;return _0x3b39f9;});}})[_0x39b0('0x18')](respondWithFilteredResult(_0x1330c5,_0x3c85cb))['catch'](handleError(_0x1330c5,null));};exports['addTags']=function(_0x2efae8,_0x5bbc6e){return db[_0x39b0('0x1e')][_0x39b0('0x33')]({'where':{'id':_0x2efae8[_0x39b0('0x26')]['id']}})['then'](handleEntityNotFound(_0x5bbc6e,null))[_0x39b0('0x18')](function(_0x34e82e){if(_0x34e82e){return _0x34e82e[_0x39b0('0x48')](_0x2efae8[_0x39b0('0x34')][_0x39b0('0x38')],_['omit'](_0x2efae8[_0x39b0('0x34')],[_0x39b0('0x38'),'id'])||{})['spread'](function(){return db[_0x39b0('0x49')][_0x39b0('0x21')]({'attributes':['id','name',_0x39b0('0x4a')],'where':{'id':_0x2efae8[_0x39b0('0x34')][_0x39b0('0x38')]}});})['then'](function(_0x2804da){socket[_0x39b0('0x4b')](_0x39b0('0x4c'),{'id':Number(_0x2efae8[_0x39b0('0x26')]['id']),'tags':_0x2804da||[]});return{'id':Number(_0x2efae8[_0x39b0('0x26')]['id']),'tags':_0x2804da||[]};});}})[_0x39b0('0x18')](respondWithResult(_0x5bbc6e,null))[_0x39b0('0x24')](handleError(_0x5bbc6e,null));};exports[_0x39b0('0x4d')]=function(_0x5ea077,_0x2556a3){return db[_0x39b0('0x1e')]['find']({'where':{'id':_0x5ea077[_0x39b0('0x26')]['id']}})[_0x39b0('0x18')](handleEntityNotFound(_0x2556a3,null))[_0x39b0('0x18')](function(_0x5ea41f){if(_0x5ea41f){return _0x5ea41f[_0x39b0('0x4d')](_0x5ea077[_0x39b0('0x23')][_0x39b0('0x38')]);}})[_0x39b0('0x18')](respondWithStatusCode(_0x2556a3,null))[_0x39b0('0x24')](handleError(_0x2556a3,null));};exports[_0x39b0('0x4e')]=function(_0x1c3664,_0x2a5194){var _0x150406=moment()[_0x39b0('0x4f')]()[_0x39b0('0x50')]();var _0x3d4b80=path['join'](config[_0x39b0('0x51')],_0x39b0('0x52'),_0x39b0('0x53'),_0x39b0('0x54'));var _0x1fbda7=path['join'](config[_0x39b0('0x51')],_0x39b0('0x52'),_0x39b0('0x53'),_0x39b0('0x55'));var _0x4bf8ed=path[_0x39b0('0x56')](_0x3d4b80,_0x150406);var _0x58e478=util[_0x39b0('0x45')]('transcript-%d-%s.zip',_0x1c3664[_0x39b0('0x26')]['id'],_0x150406);var _0x1aef08=path[_0x39b0('0x56')](_0x3d4b80,_0x58e478);var _0x5dea2a=[];_0x5dea2a[_0x39b0('0x57')]({'model':db[_0x39b0('0x58')],'as':_0x39b0('0x58'),'raw':!![]});var _0x1e36d7=[{'model':db[_0x39b0('0x36')],'as':_0x39b0('0x59'),'attributes':['id',_0x39b0('0x34'),_0x39b0('0x5a')],'include':_0x5dea2a}];return db[_0x39b0('0x1e')]['find']({'where':{'id':_0x1c3664[_0x39b0('0x26')]['id']},'include':_0x1e36d7})[_0x39b0('0x18')](handleEntityNotFound(_0x2a5194,null))[_0x39b0('0x18')](function(_0x158c9b){if(_0x158c9b&&_0x158c9b[_0x39b0('0x59')]){var _0xf46eeb=_0x158c9b[_0x39b0('0x5b')]({'plain':!![]});fs['mkdirSync'](_0x4bf8ed);for(var _0x236569=0x0;_0x236569<_0xf46eeb[_0x39b0('0x59')][_0x39b0('0x2d')];_0x236569++){var _0x2efe31=_0xf46eeb[_0x39b0('0x59')][_0x236569][_0x39b0('0x58')];if(_0x2efe31){var _0x4e883e=path[_0x39b0('0x56')](_0x1fbda7,_0x2efe31[_0x39b0('0x5c')]);if(fs[_0x39b0('0x5d')](_0x4e883e)){fs['createReadStream'](_0x4e883e)['pipe'](fs[_0x39b0('0x5e')](path['join'](_0x4bf8ed,_0x2efe31[_0x39b0('0x5c')])));}}}return BPromise['resolve']()[_0x39b0('0x18')](function(){return new BPromise(function(_0x4d0d03,_0x148d95){zipdir(_0x4bf8ed,{'saveTo':_0x1aef08},function(_0x71244c,_0x1e4d5e){if(_0x71244c)return _0x148d95(_0x71244c);return _0x4d0d03(_0x1e4d5e);});})[_0x39b0('0x18')](function(){return new BPromise(function(_0x115890,_0x3d5f8b){rimraf(_0x4bf8ed,function(_0x4091be){if(_0x4091be)_0x3d5f8b(_0x4091be);return _0x115890();});});})['then'](function(){return _0x2a5194['download'](_0x1aef08,_0x58e478,function(_0x52aebf){if(_0x52aebf){console[_0x39b0('0x5f')](_0x39b0('0x60'),_0x52aebf);}else{fs[_0x39b0('0x61')](_0x1aef08);}});});});}else{return _0x2a5194[_0x39b0('0x62')](0xc8);}})[_0x39b0('0x24')](handleError(_0x2a5194,null));}; \ No newline at end of file +var _0x3f64=['get','existsSync','createReadStream','pipe','createWriteStream','basename','resolve','log','unlinkSync','zip-dir','bluebird','util','lodash','api','../../config/environment','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','update','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','catch','show','model','keys','FaxInteraction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','destroy','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','format','options','rows','addTags','omit','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','files','root','server','transcript-%d-%s.zip','push','Attachment','Messages','createdAt'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x3f64,0x6b));var _0x43f6=function(_0x217576,_0x2776c3){_0x217576=_0x217576-0x0;var _0x14a062=_0x3f64[_0x217576];return _0x14a062;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x43f6('0x0'));var moment=require('moment');var BPromise=require(_0x43f6('0x1'));var util=require(_0x43f6('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x43f6('0x3'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x43f6('0x4'));var config=require(_0x43f6('0x5'));var db=require(_0x43f6('0x6'))['db'];config[_0x43f6('0x7')]=_[_0x43f6('0x8')](config[_0x43f6('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43f6('0x7')]));require(_0x43f6('0x9'))[_0x43f6('0xa')](socket);function respondWithStatusCode(_0x30ba81,_0x230321){_0x230321=_0x230321||0xcc;return function(_0x31549c){if(_0x31549c){return _0x30ba81[_0x43f6('0xb')](_0x230321);}return _0x30ba81[_0x43f6('0xc')](_0x230321)['end']();};}function respondWithResult(_0x3efd63,_0x4f43c8){_0x4f43c8=_0x4f43c8||0xc8;return function(_0x5ebb26){if(_0x5ebb26){return _0x3efd63[_0x43f6('0xc')](_0x4f43c8)['json'](_0x5ebb26);}};}function respondWithFilteredResult(_0x2e618f,_0x17097d){return function(_0xc158ee){if(_0xc158ee){var _0x212eb2=typeof _0x17097d[_0x43f6('0xd')]===_0x43f6('0xe')&&typeof _0x17097d[_0x43f6('0xf')]===_0x43f6('0xe');var _0x15b355=_0xc158ee['count'];var _0x146e71=_0x212eb2?0x0:_0x17097d[_0x43f6('0xd')];var _0x3ca9f4=_0x212eb2?_0xc158ee[_0x43f6('0x10')]:_0x17097d[_0x43f6('0xd')]+_0x17097d['limit'];var _0x2a8744;if(_0x3ca9f4>=_0x15b355){_0x3ca9f4=_0x15b355;_0x2a8744=0xc8;}else{_0x2a8744=0xce;}_0x2e618f['status'](_0x2a8744);return _0x2e618f['set'](_0x43f6('0x11'),_0x146e71+'-'+_0x3ca9f4+'/'+_0x15b355)[_0x43f6('0x12')](_0xc158ee);}return null;};}function saveUpdates(_0x7fe09a){return function(_0x334a53){if(_0x334a53){return _0x334a53[_0x43f6('0x13')](_0x7fe09a)[_0x43f6('0x14')](function(_0x55cfd9){return _0x55cfd9;});}return null;};}function removeEntity(_0x12ddf1){return function(_0x47e9bf){if(_0x47e9bf){return _0x47e9bf['destroy']()[_0x43f6('0x14')](function(){_0x12ddf1[_0x43f6('0xc')](0xcc)[_0x43f6('0x15')]();});}};}function handleEntityNotFound(_0x9d5f3a){return function(_0x2ec7c6){if(!_0x2ec7c6){_0x9d5f3a[_0x43f6('0xb')](0x194);}return _0x2ec7c6;};}function handleError(_0x44e0ea,_0x2589e2){_0x2589e2=_0x2589e2||0x1f4;return function(_0x25d238){logger['error'](_0x25d238[_0x43f6('0x16')]);if(_0x25d238[_0x43f6('0x17')]){delete _0x25d238[_0x43f6('0x17')];}_0x44e0ea[_0x43f6('0xc')](_0x2589e2)[_0x43f6('0x18')](_0x25d238);};}exports[_0x43f6('0x19')]=function(_0x5d6bb2,_0x31a5f6){var _0x4e3638={};var _0x55405d=_[_0x43f6('0x1a')](db['FaxInteraction'][_0x43f6('0x1b')],function(_0x23797e){return{'name':_0x23797e[_0x43f6('0x1c')],'type':_0x23797e[_0x43f6('0x1d')][_0x43f6('0x1e')]};});_0x4e3638=qs[_0x43f6('0x1f')](_0x55405d,_0x5d6bb2);return interaction[_0x43f6('0x20')]('fax',_0x5d6bb2['query'],_0x5d6bb2['user'],_0x4e3638,_0x55405d)[_0x43f6('0x14')](respondWithFilteredResult(_0x31a5f6,_0x4e3638))[_0x43f6('0x21')](handleError(_0x31a5f6,null));};exports[_0x43f6('0x22')]=function(_0x2c9e5f,_0x41db90){var _0x557fcf={'raw':![],'where':{'id':_0x2c9e5f['params']['id']}},_0x6c8e69={};_0x6c8e69[_0x43f6('0x23')]=_[_0x43f6('0x24')](db[_0x43f6('0x25')][_0x43f6('0x1b')]);_0x6c8e69[_0x43f6('0x26')]=_[_0x43f6('0x24')](_0x2c9e5f[_0x43f6('0x26')]);_0x6c8e69[_0x43f6('0x27')]=_[_0x43f6('0x28')](_0x6c8e69[_0x43f6('0x23')],_0x6c8e69[_0x43f6('0x26')]);_0x557fcf[_0x43f6('0x29')]=_[_0x43f6('0x28')](_0x6c8e69[_0x43f6('0x23')],qs[_0x43f6('0x2a')](_0x2c9e5f[_0x43f6('0x26')]['fields']));_0x557fcf['attributes']=_0x557fcf[_0x43f6('0x29')][_0x43f6('0x2b')]?_0x557fcf[_0x43f6('0x29')]:_0x6c8e69[_0x43f6('0x23')];if(_0x2c9e5f[_0x43f6('0x26')][_0x43f6('0x2c')]){_0x557fcf[_0x43f6('0x2d')]=[{'all':!![]}];}_0x557fcf=_[_0x43f6('0x2e')]({},_0x557fcf,_0x2c9e5f['options']);return db[_0x43f6('0x25')][_0x43f6('0x2f')](_0x557fcf)['then'](handleEntityNotFound(_0x41db90,null))[_0x43f6('0x14')](respondWithResult(_0x41db90,null))[_0x43f6('0x21')](handleError(_0x41db90,null));};exports[_0x43f6('0x30')]=function(_0x968a29,_0xa6d0dd){return db[_0x43f6('0x25')][_0x43f6('0x30')](_0x968a29[_0x43f6('0x31')],{})[_0x43f6('0x14')](respondWithResult(_0xa6d0dd,0xc9))[_0x43f6('0x21')](handleError(_0xa6d0dd,null));};exports[_0x43f6('0x13')]=function(_0x162fae,_0x31b0eb){if(_0x162fae[_0x43f6('0x31')]['id']){delete _0x162fae[_0x43f6('0x31')]['id'];}return db[_0x43f6('0x25')][_0x43f6('0x2f')]({'where':{'id':_0x162fae['params']['id']}})[_0x43f6('0x14')](handleEntityNotFound(_0x31b0eb,null))[_0x43f6('0x14')](saveUpdates(_0x162fae[_0x43f6('0x31')],null))[_0x43f6('0x14')](respondWithResult(_0x31b0eb,null))[_0x43f6('0x21')](handleError(_0x31b0eb,null));};exports[_0x43f6('0x32')]=function(_0x2d6372,_0x56a9d6){return db[_0x43f6('0x25')][_0x43f6('0x2f')]({'where':{'id':_0x2d6372[_0x43f6('0x33')]['id']}})['then'](handleEntityNotFound(_0x56a9d6,null))[_0x43f6('0x14')](removeEntity(_0x56a9d6,null))[_0x43f6('0x21')](handleError(_0x56a9d6,null));};exports[_0x43f6('0x34')]=function(_0x5e6253,_0x3f0fe4){return db['FaxInteraction'][_0x43f6('0x34')]()[_0x43f6('0x14')](respondWithResult(_0x3f0fe4,null))[_0x43f6('0x21')](handleError(_0x3f0fe4,null));};exports[_0x43f6('0x35')]=function(_0x103e6c,_0x4b762f){return db[_0x43f6('0x36')][_0x43f6('0x2f')]({'where':{'id':_0x103e6c[_0x43f6('0x33')]['id']}})[_0x43f6('0x14')](handleEntityNotFound(_0x4b762f,null))[_0x43f6('0x14')](function(_0x2a4b24){if(_0x2a4b24){return _0x2a4b24['addMessage'](_0x103e6c[_0x43f6('0x31')][_0x43f6('0x37')],_['omit'](_0x103e6c['body'],[_0x43f6('0x37'),'id'])||{});}})[_0x43f6('0x14')](respondWithResult(_0x4b762f,null))[_0x43f6('0x21')](handleError(_0x4b762f,null));};exports[_0x43f6('0x38')]=function(_0x271d52,_0x380952){var _0x391a17={'raw':![],'where':{}};var _0x42a55b={};var _0x46ed57={'count':0x0,'rows':[]};return db[_0x43f6('0x25')][_0x43f6('0x39')]({'where':{'id':_0x271d52['params']['id']}})['then'](handleEntityNotFound(_0x380952,null))[_0x43f6('0x14')](function(_0x2d3c9c){if(_0x2d3c9c){_0x42a55b[_0x43f6('0x23')]=_[_0x43f6('0x24')](db['FaxMessage']['rawAttributes']);_0x42a55b['query']=_['keys'](_0x271d52[_0x43f6('0x26')]);_0x42a55b[_0x43f6('0x27')]=_['intersection'](_0x42a55b[_0x43f6('0x23')],_0x42a55b[_0x43f6('0x26')]);_0x391a17[_0x43f6('0x29')]=_[_0x43f6('0x28')](_0x42a55b[_0x43f6('0x23')],qs[_0x43f6('0x2a')](_0x271d52['query'][_0x43f6('0x2a')]));_0x391a17[_0x43f6('0x29')]=_0x391a17[_0x43f6('0x29')][_0x43f6('0x2b')]?_0x391a17['attributes']:_0x42a55b['model'];if(!_0x271d52[_0x43f6('0x26')][_0x43f6('0x3a')](_0x43f6('0x3b'))){_0x391a17[_0x43f6('0xf')]=qs[_0x43f6('0xf')](_0x271d52[_0x43f6('0x26')][_0x43f6('0xf')]);_0x391a17[_0x43f6('0xd')]=qs[_0x43f6('0xd')](_0x271d52['query']['offset']);}_0x391a17[_0x43f6('0x3c')]=qs[_0x43f6('0x3d')](_0x271d52[_0x43f6('0x26')][_0x43f6('0x3d')]);_0x391a17[_0x43f6('0x3e')]=qs[_0x43f6('0x27')](_[_0x43f6('0x3f')](_0x271d52[_0x43f6('0x26')],_0x42a55b[_0x43f6('0x27')]));_0x391a17[_0x43f6('0x3e')][_0x43f6('0x40')]=_0x2d3c9c['id'];if(_0x271d52[_0x43f6('0x26')][_0x43f6('0x41')]){_0x391a17[_0x43f6('0x3e')]=_['merge'](_0x391a17['where'],{'$or':_['map'](_0x391a17['attributes'],function(_0x23c3b5){var _0x18b0b2={};_0x18b0b2[_0x23c3b5]={'$like':'%'+_0x271d52['query'][_0x43f6('0x41')]+'%'};return _0x18b0b2;})});}if(_0x271d52[_0x43f6('0x26')]['$gte']){var _0x269f80=_0x271d52[_0x43f6('0x26')][_0x43f6('0x42')]['split'](',');var _0x817930={};_0x817930[_0x269f80[0x0]]={'$gte':moment(_0x269f80[0x1])[_0x43f6('0x43')]('YYYY-MM-DD\x20HH:mm:ss')};_0x391a17[_0x43f6('0x3e')]=_[_0x43f6('0x2e')](_0x391a17[_0x43f6('0x3e')],_0x817930);}_0x391a17=_[_0x43f6('0x2e')]({},_0x391a17,_0x271d52[_0x43f6('0x44')]);return db[_0x43f6('0x36')][_0x43f6('0x10')]({'where':_0x391a17[_0x43f6('0x3e')]})[_0x43f6('0x14')](function(_0x22a74b){_0x46ed57[_0x43f6('0x10')]=_0x22a74b;if(_0x271d52[_0x43f6('0x26')][_0x43f6('0x2c')]){_0x391a17[_0x43f6('0x2d')]=[{'all':!![]}];}return db[_0x43f6('0x36')]['findAll'](_0x391a17);})[_0x43f6('0x14')](function(_0x4fd738){_0x46ed57[_0x43f6('0x45')]=_0x4fd738;return _0x46ed57;});}})[_0x43f6('0x14')](respondWithFilteredResult(_0x380952,_0x391a17))[_0x43f6('0x21')](handleError(_0x380952,null));};exports[_0x43f6('0x46')]=function(_0x494bff,_0x3b231b){return db['FaxInteraction'][_0x43f6('0x2f')]({'where':{'id':_0x494bff[_0x43f6('0x33')]['id']}})['then'](handleEntityNotFound(_0x3b231b,null))[_0x43f6('0x14')](function(_0x44600c){if(_0x44600c){return _0x44600c['setTags'](_0x494bff[_0x43f6('0x31')][_0x43f6('0x37')],_[_0x43f6('0x47')](_0x494bff[_0x43f6('0x31')],[_0x43f6('0x37'),'id'])||{})['spread'](function(){return db[_0x43f6('0x48')][_0x43f6('0x20')]({'attributes':['id',_0x43f6('0x17'),_0x43f6('0x49')],'where':{'id':_0x494bff['body'][_0x43f6('0x37')]}});})['then'](function(_0x12ff34){socket[_0x43f6('0x4a')](_0x43f6('0x4b'),{'id':Number(_0x494bff[_0x43f6('0x33')]['id']),'tags':_0x12ff34||[]});return{'id':Number(_0x494bff[_0x43f6('0x33')]['id']),'tags':_0x12ff34||[]};});}})[_0x43f6('0x14')](respondWithResult(_0x3b231b,null))[_0x43f6('0x21')](handleError(_0x3b231b,null));};exports[_0x43f6('0x4c')]=function(_0xfac8e4,_0x196106){return db[_0x43f6('0x25')][_0x43f6('0x2f')]({'where':{'id':_0xfac8e4[_0x43f6('0x33')]['id']}})[_0x43f6('0x14')](handleEntityNotFound(_0x196106,null))['then'](function(_0x3be4c0){if(_0x3be4c0){return _0x3be4c0['removeTags'](_0xfac8e4[_0x43f6('0x26')][_0x43f6('0x37')]);}})[_0x43f6('0x14')](respondWithStatusCode(_0x196106,null))[_0x43f6('0x21')](handleError(_0x196106,null));};exports[_0x43f6('0x4d')]=function(_0x42f671,_0x557113){var _0x7a84fa=moment()[_0x43f6('0x4e')]()[_0x43f6('0x4f')]();var _0x16c224=path[_0x43f6('0x50')](config['root'],'server',_0x43f6('0x51'),'tmp');var _0x84b6b3=path[_0x43f6('0x50')](config[_0x43f6('0x52')],_0x43f6('0x53'),'files','attachments');var _0x47c90e=path['join'](_0x16c224,_0x7a84fa);var _0x1b4157=util[_0x43f6('0x43')](_0x43f6('0x54'),_0x42f671[_0x43f6('0x33')]['id'],_0x7a84fa);var _0x213e71=path[_0x43f6('0x50')](_0x16c224,_0x1b4157);var _0x3b9a15=[];_0x3b9a15[_0x43f6('0x55')]({'model':db['Attachment'],'as':_0x43f6('0x56'),'raw':!![]});var _0x224e72=[{'model':db['FaxMessage'],'as':_0x43f6('0x57'),'attributes':['id',_0x43f6('0x31'),_0x43f6('0x58')],'include':_0x3b9a15}];return db[_0x43f6('0x25')][_0x43f6('0x2f')]({'where':{'id':_0x42f671[_0x43f6('0x33')]['id']},'include':_0x224e72})[_0x43f6('0x14')](handleEntityNotFound(_0x557113,null))[_0x43f6('0x14')](function(_0x499595){if(_0x499595&&_0x499595[_0x43f6('0x57')]){var _0x5f3625=_0x499595[_0x43f6('0x59')]({'plain':!![]});fs['mkdirSync'](_0x47c90e);for(var _0x124767=0x0;_0x124767<_0x5f3625['Messages'][_0x43f6('0x2b')];_0x124767++){var _0x2aed0b=_0x5f3625[_0x43f6('0x57')][_0x124767][_0x43f6('0x56')];if(_0x2aed0b){var _0x31d13c=path[_0x43f6('0x50')](_0x84b6b3,_0x2aed0b['basename']);if(fs[_0x43f6('0x5a')](_0x31d13c)){fs[_0x43f6('0x5b')](_0x31d13c)[_0x43f6('0x5c')](fs[_0x43f6('0x5d')](path['join'](_0x47c90e,_0x2aed0b[_0x43f6('0x5e')])));}}}return BPromise[_0x43f6('0x5f')]()[_0x43f6('0x14')](function(){return new BPromise(function(_0x25e5ff,_0x174f2b){zipdir(_0x47c90e,{'saveTo':_0x213e71},function(_0x228913,_0x38cd28){if(_0x228913)return _0x174f2b(_0x228913);return _0x25e5ff(_0x38cd28);});})[_0x43f6('0x14')](function(){return new BPromise(function(_0x54a5f5,_0x55d535){rimraf(_0x47c90e,function(_0x134165){if(_0x134165)_0x55d535(_0x134165);return _0x54a5f5();});});})[_0x43f6('0x14')](function(){return _0x557113[_0x43f6('0x4d')](_0x213e71,_0x1b4157,function(_0x2a80b0){if(_0x2a80b0){console[_0x43f6('0x60')]('err',_0x2a80b0);}else{fs[_0x43f6('0x61')](_0x213e71);}});});});}else{return _0x557113[_0x43f6('0xb')](0xc8);}})['catch'](handleError(_0x557113,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 084e8df..b432998 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 _0x4d69=['unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x4d69,0x149));var _0x94d6=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x4d69[_0x725b8e];return _0x43ac45;};'use strict';var EventEmitter=require(_0x94d6('0x0'));var FaxInteraction=require(_0x94d6('0x1'))['db'][_0x94d6('0x2')];var FaxMessage=require(_0x94d6('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x94d6('0x3')](0x0);var events={'afterCreate':_0x94d6('0x4'),'afterUpdate':_0x94d6('0x5'),'afterDestroy':_0x94d6('0x6')};function emitEvent(_0x2b1af9){return function(_0x2f625f,_0x2654c3,_0x5cfb73){_0x2f625f[_0x94d6('0x7')]({'attributes':['id'],'raw':!![]})[_0x94d6('0x8')](function(_0x40f155){_0x2f625f['setDataValue'](_0x94d6('0x9'),_0x40f155[_0x94d6('0xa')](function(_0x24c6de){return{'id':_0x24c6de['id']};}));return FaxMessage[_0x94d6('0xb')]({'where':{'FaxInteractionId':_0x2f625f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x94d6('0x8')](function(_0x4640f2){_0x2f625f[_0x94d6('0xc')](_0x94d6('0xd'),_0x4640f2[_0x94d6('0xe')]);FaxInteractionEvents['emit'](_0x2b1af9+':'+_0x2f625f['id'],_0x2f625f);FaxInteractionEvents[_0x94d6('0xf')](_0x2b1af9,_0x2f625f);_0x5cfb73(null);})[_0x94d6('0x10')](_0x5cfb73(null));};}for(var e in events){if(events[_0x94d6('0x11')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x94d6('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0x77b6=['FaxMessage','save','update','remove','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction'];(function(_0x26587e,_0x18924f){var _0x525ac2=function(_0x28cca0){while(--_0x28cca0){_0x26587e['push'](_0x26587e['shift']());}};_0x525ac2(++_0x18924f);}(_0x77b6,0x1de));var _0x677b=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x77b6[_0x1da04e];return _0xdd8c41;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x677b('0x0'))['db'][_0x677b('0x1')];var FaxMessage=require(_0x677b('0x0'))['db'][_0x677b('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x677b('0x3'),'afterUpdate':_0x677b('0x4'),'afterDestroy':_0x677b('0x5')};function emitEvent(_0x29b32d){return function(_0x3f851e,_0x30d2cb,_0x4b2246){_0x3f851e['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xc3325){_0x3f851e[_0x677b('0x6')]('Users',_0xc3325['map'](function(_0x47c902){return{'id':_0x47c902['id']};}));return FaxMessage[_0x677b('0x7')]({'where':{'FaxInteractionId':_0x3f851e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x7586ad){_0x3f851e[_0x677b('0x6')](_0x677b('0x8'),_0x7586ad[_0x677b('0x9')]);FaxInteractionEvents[_0x677b('0xa')](_0x29b32d+':'+_0x3f851e['id'],_0x3f851e);FaxInteractionEvents[_0x677b('0xa')](_0x29b32d,_0x3f851e);_0x4b2246(null);})[_0x677b('0xb')](_0x4b2246(null));};}for(var e in events){if(events[_0x677b('0xc')](e)){var event=events[e];FaxInteraction[_0x677b('0xd')](e,emitEvent(event));}}module[_0x677b('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 5d83817..e89a71d 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 _0x2229=['moment','bluebird','path','rimraf','../../config/environment','exports','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0xc4476f,_0x1651ae){var _0x482281=function(_0x5f4a7a){while(--_0x5f4a7a){_0xc4476f['push'](_0xc4476f['shift']());}};_0x482281(++_0x1651ae);}(_0x2229,0xde));var _0x9222=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x2229[_0x115d5b];return _0x6cfc50;};'use strict';var _=require(_0x9222('0x0'));var util=require(_0x9222('0x1'));var logger=require('../../config/logger')(_0x9222('0x2'));var moment=require(_0x9222('0x3'));var BPromise=require(_0x9222('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9222('0x5'));var rimraf=require(_0x9222('0x6'));var config=require(_0x9222('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x9222('0x8')]=function(_0x139e0b,_0x26d596){return _0x139e0b['define'](_0x9222('0x9'),attributes,{'tableName':_0x9222('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x373961,_0x286a56,_0x2ea9b7){if(_0x373961[_0x9222('0xb')](_0x9222('0xc'))){_0x373961['closedAt']=moment()[_0x9222('0xd')](_0x9222('0xe'));}_0x2ea9b7(null,_0x373961);}}});}; \ No newline at end of file +var _0x3e65=['fax_interactions','changed','lodash','../../config/logger','api','moment','request-promise','rimraf','./faxInteraction.attributes','exports','FaxInteraction'];(function(_0x1546c2,_0x22e822){var _0x24583c=function(_0x3906f8){while(--_0x3906f8){_0x1546c2['push'](_0x1546c2['shift']());}};_0x24583c(++_0x22e822);}(_0x3e65,0xde));var _0x53e6=function(_0xd523d5,_0x263893){_0xd523d5=_0xd523d5-0x0;var _0x86d572=_0x3e65[_0xd523d5];return _0x86d572;};'use strict';var _=require(_0x53e6('0x0'));var util=require('util');var logger=require(_0x53e6('0x1'))(_0x53e6('0x2'));var moment=require(_0x53e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x53e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53e6('0x5'));var config=require('../../config/environment');var attributes=require(_0x53e6('0x6'));module[_0x53e6('0x7')]=function(_0x196e32,_0x581777){return _0x196e32['define'](_0x53e6('0x8'),attributes,{'tableName':_0x53e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27160c,_0x5260ff,_0x5d39a8){if(_0x27160c[_0x53e6('0xa')]('closed')){_0x27160c['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5d39a8(null,_0x27160c);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 9ece0cd..a4c9935 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 _0x26f0=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','update','body','options','raw','where','limit','info','UpdateFaxInteraction','debug','find','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1e58b4,_0x20e6da){var _0x3ee996=function(_0x554a05){while(--_0x554a05){_0x1e58b4['push'](_0x1e58b4['shift']());}};_0x3ee996(++_0x20e6da);}(_0x26f0,0x125));var _0x026f=function(_0x53f4b5,_0x715509){_0x53f4b5=_0x53f4b5-0x0;var _0x3e291f=_0x26f0[_0x53f4b5];return _0x3e291f;};'use strict';var _=require(_0x026f('0x0'));var util=require(_0x026f('0x1'));var moment=require(_0x026f('0x2'));var BPromise=require(_0x026f('0x3'));var rs=require(_0x026f('0x4'));var fs=require('fs');var Redis=require(_0x026f('0x5'));var db=require(_0x026f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x026f('0x7'))(_0x026f('0x8'));var config=require(_0x026f('0x9'));var jayson=require(_0x026f('0xa'));var client=jayson[_0x026f('0xb')][_0x026f('0xc')]({'port':0x232a});config[_0x026f('0xd')]=_[_0x026f('0xe')](config['redis'],{'host':_0x026f('0xf'),'port':0x18eb});var socket=require(_0x026f('0x10'))(new Redis(config[_0x026f('0xd')]));require(_0x026f('0x11'))[_0x026f('0x12')](socket);function respondWithRpcPromise(_0x24301b,_0x3bb104,_0x3cac11){return new BPromise(function(_0x426d19,_0x5a8cc0){return client['request'](_0x24301b,_0x3cac11)[_0x026f('0x13')](function(_0x3f2b98){logger['info'](_0x026f('0x14'),_0x3bb104,'request\x20sent');logger['debug'](_0x026f('0x15'),_0x3bb104,_0x026f('0x16'),JSON[_0x026f('0x17')](_0x3f2b98));if(_0x3f2b98[_0x026f('0x18')]){if(_0x3f2b98[_0x026f('0x18')]['code']===0x1f4){logger[_0x026f('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x3bb104,_0x3f2b98['error'][_0x026f('0x19')]);return _0x5a8cc0(_0x3f2b98['error'][_0x026f('0x19')]);}logger['error'](_0x026f('0x14'),_0x3bb104,_0x3f2b98['error'][_0x026f('0x19')]);return _0x426d19(_0x3f2b98[_0x026f('0x18')][_0x026f('0x19')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x3bb104,_0x026f('0x16'));_0x426d19(_0x3f2b98[_0x026f('0x1a')][_0x026f('0x19')]);}})['catch'](function(_0x932f){logger[_0x026f('0x18')](_0x026f('0x14'),_0x3bb104,_0x932f);_0x5a8cc0(_0x932f);});});}exports['UpdateFaxInteraction']=function(_0x11f324){var _0x198650=this;return new Promise(function(_0x51550a,_0x4826aa){return db['FaxInteraction'][_0x026f('0x1b')](_0x11f324[_0x026f('0x1c')],{'raw':_0x11f324[_0x026f('0x1d')]?_0x11f324[_0x026f('0x1d')][_0x026f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11f324[_0x026f('0x1d')]?_0x11f324[_0x026f('0x1d')][_0x026f('0x1f')]||null:null,'attributes':_0x11f324[_0x026f('0x1d')]?_0x11f324[_0x026f('0x1d')]['attributes']||null:null,'limit':_0x11f324[_0x026f('0x1d')]?_0x11f324['options'][_0x026f('0x20')]||null:null})[_0x026f('0x13')](function(_0x532295){logger[_0x026f('0x21')](_0x026f('0x22'),_0x11f324);logger[_0x026f('0x23')](_0x026f('0x22'),_0x11f324,JSON['stringify'](_0x532295));_0x51550a(_0x532295);})['catch'](function(_0x347516){logger['error'](_0x026f('0x22'),_0x347516[_0x026f('0x19')],_0x11f324);_0x4826aa(_0x198650[_0x026f('0x18')](0x1f4,_0x347516[_0x026f('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x32ee29){return new Promise(function(_0x3d6c89,_0x13e8af){return db['FaxInteraction'][_0x026f('0x24')]({'where':_0x32ee29[_0x026f('0x1d')]?_0x32ee29['options'][_0x026f('0x1f')]||null:null})[_0x026f('0x13')](function(_0x45f7d8){if(_0x45f7d8){return _0x45f7d8[_0x026f('0x25')](_0x32ee29[_0x026f('0x1c')][_0x026f('0x26')],_[_0x026f('0x27')](_0x32ee29[_0x026f('0x1c')],[_0x026f('0x26'),'id'])||{});}})[_0x026f('0x28')](function(_0x49998f){logger[_0x026f('0x21')](_0x026f('0x29'),_0x32ee29);logger['debug'](_0x026f('0x29'),_0x32ee29,JSON[_0x026f('0x17')](_0x49998f));_0x3d6c89(_0x49998f);})[_0x026f('0x2a')](function(_0x52d082){logger[_0x026f('0x18')](_0x026f('0x29'),_0x52d082[_0x026f('0x19')],_0x32ee29);_0x13e8af(_this[_0x026f('0x18')](0x1f4,_0x52d082[_0x026f('0x19')]));});});}; \ No newline at end of file +var _0x48c6=['ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./faxInteraction.socket','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','then','AddTagsToFaxInteraction','find','addTags'];(function(_0x3e231b,_0x126ff3){var _0x867a46=function(_0x21ca7a){while(--_0x21ca7a){_0x3e231b['push'](_0x3e231b['shift']());}};_0x867a46(++_0x126ff3);}(_0x48c6,0x194));var _0x648c=function(_0x3a1131,_0x1f4c0e){_0x3a1131=_0x3a1131-0x0;var _0x1bf96e=_0x48c6[_0x3a1131];return _0x1bf96e;};'use strict';var _=require(_0x648c('0x0'));var util=require('util');var moment=require(_0x648c('0x1'));var BPromise=require('bluebird');var rs=require(_0x648c('0x2'));var fs=require('fs');var Redis=require(_0x648c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x648c('0x4'));var logger=require(_0x648c('0x5'))(_0x648c('0x6'));var config=require(_0x648c('0x7'));var jayson=require(_0x648c('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x648c('0x9')]=_[_0x648c('0xa')](config[_0x648c('0x9')],{'host':_0x648c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x648c('0x9')]));require(_0x648c('0xc'))['register'](socket);function respondWithRpcPromise(_0x39ccc4,_0xae8d16,_0x3263a7){return new BPromise(function(_0x24d9e0,_0x5befe6){return client['request'](_0x39ccc4,_0x3263a7)['then'](function(_0x47ffce){logger['info']('FaxInteraction,\x20%s,\x20%s',_0xae8d16,_0x648c('0xd'));logger[_0x648c('0xe')](_0x648c('0xf'),_0xae8d16,_0x648c('0xd'),JSON[_0x648c('0x10')](_0x47ffce));if(_0x47ffce[_0x648c('0x11')]){if(_0x47ffce[_0x648c('0x11')][_0x648c('0x12')]===0x1f4){logger[_0x648c('0x11')](_0x648c('0x13'),_0xae8d16,_0x47ffce[_0x648c('0x11')]['message']);return _0x5befe6(_0x47ffce[_0x648c('0x11')][_0x648c('0x14')]);}logger[_0x648c('0x11')](_0x648c('0x13'),_0xae8d16,_0x47ffce['error'][_0x648c('0x14')]);return _0x24d9e0(_0x47ffce[_0x648c('0x11')][_0x648c('0x14')]);}else{logger[_0x648c('0x15')]('FaxInteraction,\x20%s,\x20%s',_0xae8d16,_0x648c('0xd'));_0x24d9e0(_0x47ffce[_0x648c('0x16')]['message']);}})[_0x648c('0x17')](function(_0x826721){logger['error'](_0x648c('0x13'),_0xae8d16,_0x826721);_0x5befe6(_0x826721);});});}exports[_0x648c('0x18')]=function(_0x11e28b){var _0x2ed67f=this;return new Promise(function(_0x117d40,_0x42c021){return db[_0x648c('0x19')][_0x648c('0x1a')](_0x11e28b[_0x648c('0x1b')],{'raw':_0x11e28b[_0x648c('0x1c')]?_0x11e28b[_0x648c('0x1c')][_0x648c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11e28b['options']?_0x11e28b[_0x648c('0x1c')][_0x648c('0x1e')]||null:null,'attributes':_0x11e28b[_0x648c('0x1c')]?_0x11e28b['options'][_0x648c('0x1f')]||null:null,'limit':_0x11e28b[_0x648c('0x1c')]?_0x11e28b[_0x648c('0x1c')]['limit']||null:null})[_0x648c('0x20')](function(_0x288c81){logger[_0x648c('0x15')](_0x648c('0x18'),_0x11e28b);logger[_0x648c('0xe')](_0x648c('0x18'),_0x11e28b,JSON[_0x648c('0x10')](_0x288c81));_0x117d40(_0x288c81);})[_0x648c('0x17')](function(_0x7e5905){logger['error'](_0x648c('0x18'),_0x7e5905[_0x648c('0x14')],_0x11e28b);_0x42c021(_0x2ed67f['error'](0x1f4,_0x7e5905[_0x648c('0x14')]));});});};exports[_0x648c('0x21')]=function(_0x468d3a){return new Promise(function(_0x48a083,_0x303410){return db[_0x648c('0x19')][_0x648c('0x22')]({'where':_0x468d3a['options']?_0x468d3a[_0x648c('0x1c')][_0x648c('0x1e')]||null:null})[_0x648c('0x20')](function(_0x5134f2){if(_0x5134f2){return _0x5134f2[_0x648c('0x23')](_0x468d3a[_0x648c('0x1b')][_0x648c('0x24')],_[_0x648c('0x25')](_0x468d3a['body'],['ids','id'])||{});}})[_0x648c('0x26')](function(_0x38b2db){logger[_0x648c('0x15')](_0x648c('0x27'),_0x468d3a);logger[_0x648c('0xe')](_0x648c('0x27'),_0x468d3a,JSON['stringify'](_0x38b2db));_0x48a083(_0x38b2db);})[_0x648c('0x17')](function(_0x147f64){logger[_0x648c('0x11')](_0x648c('0x27'),_0x147f64[_0x648c('0x14')],_0x468d3a);_0x303410(_this['error'](0x1f4,_0x147f64[_0x648c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index b34969d..0a69aab 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 _0x0456=['save','emit','removeListener','register','length','faxInteraction:'];(function(_0x4eb7c0,_0x15c4db){var _0x112866=function(_0xd41728){while(--_0xd41728){_0x4eb7c0['push'](_0x4eb7c0['shift']());}};_0x112866(++_0x15c4db);}(_0x0456,0x150));var _0x6045=function(_0x405426,_0x4c86d3){_0x405426=_0x405426-0x0;var _0x107066=_0x0456[_0x405426];return _0x107066;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x6045('0x0'),'remove','update'];function createListener(_0x178b97,_0x4595ca){return function(_0x1347b4){_0x4595ca[_0x6045('0x1')](_0x178b97,_0x1347b4);};}function removeListener(_0x392eea,_0x557d75){return function(){FaxInteractionEvents[_0x6045('0x2')](_0x392eea,_0x557d75);};}exports[_0x6045('0x3')]=function(_0xd4839a){for(var _0x564d1a=0x0,_0x569658=events[_0x6045('0x4')];_0x564d1a<_0x569658;_0x564d1a++){var _0x5412f9=events[_0x564d1a];var _0x114b80=createListener(_0x6045('0x5')+_0x5412f9,_0xd4839a);FaxInteractionEvents['on'](_0x5412f9,_0x114b80);}}; \ No newline at end of file +var _0x470e=['faxInteraction:','./faxInteraction.events','remove','emit','removeListener','register','length'];(function(_0x2122f,_0x41c9d7){var _0x25924c=function(_0x4adc79){while(--_0x4adc79){_0x2122f['push'](_0x2122f['shift']());}};_0x25924c(++_0x41c9d7);}(_0x470e,0xe1));var _0xe470=function(_0x5dafd0,_0x3bcbb6){_0x5dafd0=_0x5dafd0-0x0;var _0x364354=_0x470e[_0x5dafd0];return _0x364354;};'use strict';var FaxInteractionEvents=require(_0xe470('0x0'));var events=['save',_0xe470('0x1'),'update'];function createListener(_0x52d836,_0xa730e9){return function(_0xadec37){_0xa730e9[_0xe470('0x2')](_0x52d836,_0xadec37);};}function removeListener(_0x5f3cd9,_0x4b8985){return function(){FaxInteractionEvents[_0xe470('0x3')](_0x5f3cd9,_0x4b8985);};}exports[_0xe470('0x4')]=function(_0x26e289){for(var _0x2d9e30=0x0,_0x133533=events[_0xe470('0x5')];_0x2d9e30<_0x133533;_0x2d9e30++){var _0x2324d2=events[_0x2d9e30];var _0x2c3c87=createListener(_0xe470('0x6')+_0x2324d2,_0x26e289);FaxInteractionEvents['on'](_0x2324d2,_0x2c3c87);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index c87e825..f6a4e6c 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 _0x055c=['post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','download'];(function(_0x500786,_0x336717){var _0x185e08=function(_0x35525c){while(--_0x35525c){_0x500786['push'](_0x500786['shift']());}};_0x185e08(++_0x336717);}(_0x055c,0x1ee));var _0xc055=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x055c[_0x4a93bb];return _0x208468;};'use strict';var multer=require('multer');var util=require(_0xc055('0x0'));var path=require(_0xc055('0x1'));var timeout=require(_0xc055('0x2'));var express=require(_0xc055('0x3'));var router=express['Router']();var fs_extra=require(_0xc055('0x4'));var auth=require(_0xc055('0x5'));var interaction=require(_0xc055('0x6'));var config=require(_0xc055('0x7'));var controller=require('./faxInteraction.controller');router[_0xc055('0x8')]('/',auth[_0xc055('0x9')](),controller[_0xc055('0xa')]);router['get'](_0xc055('0xb'),auth[_0xc055('0x9')](),controller[_0xc055('0xc')]);router[_0xc055('0x8')](_0xc055('0xd'),auth[_0xc055('0x9')](),controller[_0xc055('0xe')]);router['get']('/:id/messages',auth[_0xc055('0x9')](),controller['getMessages']);router[_0xc055('0x8')]('/:id/download',auth[_0xc055('0x9')](),controller[_0xc055('0xf')]);router[_0xc055('0x10')]('/',auth[_0xc055('0x9')](),controller['create']);router[_0xc055('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0xc055('0x11')]);router[_0xc055('0x10')](_0xc055('0x12'),auth[_0xc055('0x9')](),interaction[_0xc055('0x13')](_0xc055('0x14'),_0xc055('0x15')),controller[_0xc055('0x16')]);router[_0xc055('0x17')](_0xc055('0xd'),auth[_0xc055('0x9')](),interaction[_0xc055('0x13')](_0xc055('0x14'),_0xc055('0x18')),controller[_0xc055('0x19')]);router['delete'](_0xc055('0xd'),auth[_0xc055('0x9')](),interaction[_0xc055('0x13')]('fax',_0xc055('0x1a')),controller[_0xc055('0x1b')]);router['delete'](_0xc055('0x12'),auth[_0xc055('0x9')](),controller[_0xc055('0x1c')]);module[_0xc055('0x1d')]=router; \ No newline at end of file +var _0x772d=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','download','post','/:id/messages','addMessage','/:id/tags','tracked','faxinteraction:addtags','put','fax','faxinteraction:update'];(function(_0x3ecac8,_0x359ced){var _0x25c4e0=function(_0x3eda1c){while(--_0x3eda1c){_0x3ecac8['push'](_0x3ecac8['shift']());}};_0x25c4e0(++_0x359ced);}(_0x772d,0x197));var _0xd772=function(_0x490123,_0x1feade){_0x490123=_0x490123-0x0;var _0x1462c5=_0x772d[_0x490123];return _0x1462c5;};'use strict';var multer=require('multer');var util=require(_0xd772('0x0'));var path=require(_0xd772('0x1'));var timeout=require(_0xd772('0x2'));var express=require(_0xd772('0x3'));var router=express[_0xd772('0x4')]();var fs_extra=require(_0xd772('0x5'));var auth=require(_0xd772('0x6'));var interaction=require(_0xd772('0x7'));var config=require(_0xd772('0x8'));var controller=require(_0xd772('0x9'));router[_0xd772('0xa')]('/',auth[_0xd772('0xb')](),controller[_0xd772('0xc')]);router[_0xd772('0xa')]('/describe',auth[_0xd772('0xb')](),controller[_0xd772('0xd')]);router['get'](_0xd772('0xe'),auth['isAuthenticated'](),controller[_0xd772('0xf')]);router[_0xd772('0xa')]('/:id/messages',auth[_0xd772('0xb')](),controller[_0xd772('0x10')]);router[_0xd772('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xd772('0x11')]);router[_0xd772('0x12')]('/',auth[_0xd772('0xb')](),controller['create']);router[_0xd772('0x12')](_0xd772('0x13'),auth['isAuthenticated'](),controller[_0xd772('0x14')]);router[_0xd772('0x12')](_0xd772('0x15'),auth[_0xd772('0xb')](),interaction[_0xd772('0x16')]('fax',_0xd772('0x17')),controller['addTags']);router[_0xd772('0x18')](_0xd772('0xe'),auth['isAuthenticated'](),interaction[_0xd772('0x16')](_0xd772('0x19'),_0xd772('0x1a')),controller[_0xd772('0x1b')]);router[_0xd772('0x1c')](_0xd772('0xe'),auth[_0xd772('0xb')](),interaction[_0xd772('0x16')](_0xd772('0x19'),'faxinteraction:destroy'),controller[_0xd772('0x1d')]);router['delete'](_0xd772('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0xd772('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index bb847a6..59915e4 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 _0x524a=['exports','TEXT','medium','ENUM','out','sequelize'];(function(_0x2b18c9,_0x49659f){var _0x8b913c=function(_0x3e0954){while(--_0x3e0954){_0x2b18c9['push'](_0x2b18c9['shift']());}};_0x8b913c(++_0x49659f);}(_0x524a,0xf5));var _0xa524=function(_0x1b8f28,_0x17b475){_0x1b8f28=_0x1b8f28-0x0;var _0x1c298a=_0x524a[_0x1b8f28];return _0x1c298a;};'use strict';var Sequelize=require(_0xa524('0x0'));module[_0xa524('0x1')]={'body':{'type':Sequelize[_0xa524('0x2')](_0xa524('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa524('0x4')]('in',_0xa524('0x5')),'defaultValue':_0xa524('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x99e9=['exports','TEXT','medium','BOOLEAN','out'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x99e9,0xb4));var _0x999e=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x99e9[_0x5a5395];return _0x4da43d;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'body':{'type':Sequelize[_0x999e('0x1')](_0x999e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x999e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x999e('0x4')),'defaultValue':_0x999e('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x999e('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 756c5cf..9f093d2 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 _0x5d1a=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','then','stack','name','map','FaxMessage','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','update','body','find','describe','../../config/logger','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT','contact','User','fullname','email','internal','agent','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','QueryTypes','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','server','files','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x52524d,_0x49f8c2){var _0x332e9e=function(_0x57e524){while(--_0x57e524){_0x52524d['push'](_0x52524d['shift']());}};_0x332e9e(++_0x49f8c2);}(_0x5d1a,0x87));var _0xa5d1=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0x5d1a[_0x495e9f];return _0xb249d2;};'use strict';var emlformat=require(_0xa5d1('0x0'));var rimraf=require(_0xa5d1('0x1'));var zipdir=require(_0xa5d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5d1('0x3'));var moment=require(_0xa5d1('0x4'));var BPromise=require(_0xa5d1('0x5'));var Mustache=require(_0xa5d1('0x6'));var util=require(_0xa5d1('0x7'));var path=require(_0xa5d1('0x8'));var sox=require(_0xa5d1('0x9'));var csv=require(_0xa5d1('0xa'));var ejs=require(_0xa5d1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5d1('0xc'));var squel=require(_0xa5d1('0xd'));var crypto=require(_0xa5d1('0xe'));var jsforce=require(_0xa5d1('0xf'));var deskjs=require(_0xa5d1('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa5d1('0x11'));var Redis=require(_0xa5d1('0x12'));var authService=require(_0xa5d1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa5d1('0x14'));var hardwareService=require(_0xa5d1('0x15'));var logger=require('../../config/logger')(_0xa5d1('0x16'));var utils=require(_0xa5d1('0x17'));var config=require(_0xa5d1('0x18'));var licenseUtil=require(_0xa5d1('0x19'));var db=require(_0xa5d1('0x1a'))['db'];config[_0xa5d1('0x1b')]=_['defaults'](config[_0xa5d1('0x1b')],{'host':_0xa5d1('0x1c'),'port':0x18eb});var socket=require(_0xa5d1('0x1d'))(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);var jayson=require(_0xa5d1('0x1e'));var client=jayson[_0xa5d1('0x1f')][_0xa5d1('0x20')]({'port':0x232c});var client9002=jayson[_0xa5d1('0x1f')][_0xa5d1('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x254768,_0x54f014,_0x615415,_0x4e4109){return new BPromise(function(_0x2f762e,_0x46ab63){var _0x299752=_0x4e4109||client;return _0x299752[_0xa5d1('0x21')](_0x254768,_0x615415)['then'](function(_0x11ddf0){logger[_0xa5d1('0x22')](_0xa5d1('0x23'),_0x54f014,_0xa5d1('0x24'));logger[_0xa5d1('0x25')](_0xa5d1('0x26'),_0x54f014,_0xa5d1('0x24'),JSON['stringify'](_0x11ddf0));if(_0x11ddf0[_0xa5d1('0x27')]){if(_0x11ddf0[_0xa5d1('0x27')]['code']===0x1f4){logger['error'](_0xa5d1('0x23'),_0x54f014,_0x11ddf0[_0xa5d1('0x27')][_0xa5d1('0x28')]);return _0x46ab63(_0x11ddf0[_0xa5d1('0x27')][_0xa5d1('0x28')]);}logger[_0xa5d1('0x27')]('FaxMessage,\x20%s,\x20%s',_0x54f014,_0x11ddf0[_0xa5d1('0x27')][_0xa5d1('0x28')]);return _0x2f762e(_0x11ddf0[_0xa5d1('0x27')][_0xa5d1('0x28')]);}else{logger[_0xa5d1('0x22')](_0xa5d1('0x23'),_0x54f014,'request\x20sent');_0x2f762e(_0x11ddf0[_0xa5d1('0x29')][_0xa5d1('0x28')]);}})['catch'](function(_0x1dddc7){logger[_0xa5d1('0x27')](_0xa5d1('0x23'),_0x54f014,_0x1dddc7);_0x46ab63(_0x1dddc7);});});}function respondWithStatusCode(_0x29b763,_0x21aab9){_0x21aab9=_0x21aab9||0xcc;return function(_0x5ba036){if(_0x5ba036){return _0x29b763[_0xa5d1('0x2a')](_0x21aab9);}return _0x29b763['status'](_0x21aab9)['end']();};}function respondWithResult(_0x19cfb0,_0x48374a){_0x48374a=_0x48374a||0xc8;return function(_0x1a94f5){if(_0x1a94f5){return _0x19cfb0[_0xa5d1('0x2b')](_0x48374a)[_0xa5d1('0x2c')](_0x1a94f5);}};}function respondWithFilteredResult(_0x194d05,_0xa01a0c){return function(_0x53ca18){if(_0x53ca18){var _0x41b121=typeof _0xa01a0c['offset']===_0xa5d1('0x2d')&&typeof _0xa01a0c[_0xa5d1('0x2e')]===_0xa5d1('0x2d');var _0x34b927=_0x53ca18[_0xa5d1('0x2f')];var _0x4663d7=_0x41b121?0x0:_0xa01a0c[_0xa5d1('0x30')];var _0x399272=_0x41b121?_0x53ca18['count']:_0xa01a0c[_0xa5d1('0x30')]+_0xa01a0c[_0xa5d1('0x2e')];var _0x309c3c;if(_0x399272>=_0x34b927){_0x399272=_0x34b927;_0x309c3c=0xc8;}else{_0x309c3c=0xce;}_0x194d05[_0xa5d1('0x2b')](_0x309c3c);return _0x194d05['set'](_0xa5d1('0x31'),_0x4663d7+'-'+_0x399272+'/'+_0x34b927)['json'](_0x53ca18);}return null;};}function patchUpdates(_0x42302c){return function(_0x2d7d0e){try{jsonpatch[_0xa5d1('0x32')](_0x2d7d0e,_0x42302c,!![]);}catch(_0x4e2b0f){return BPromise['reject'](_0x4e2b0f);}return _0x2d7d0e[_0xa5d1('0x33')]();};}function saveUpdates(_0x457f47,_0x11a74e){return function(_0x12f4e2){if(_0x12f4e2){return _0x12f4e2['update'](_0x457f47)['then'](function(_0x226d81){return _0x226d81;});}return null;};}function removeEntity(_0x31047a,_0x583430){return function(_0x4963ca){if(_0x4963ca){return _0x4963ca[_0xa5d1('0x34')]()[_0xa5d1('0x35')](function(){_0x31047a[_0xa5d1('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340159,_0x5beb10){return function(_0x37469c){if(!_0x37469c){_0x340159[_0xa5d1('0x2a')](0x194);}return _0x37469c;};}function handleError(_0x36addd,_0x4cd768){_0x4cd768=_0x4cd768||0x1f4;return function(_0x4e32b8){logger[_0xa5d1('0x27')](_0x4e32b8[_0xa5d1('0x36')]);if(_0x4e32b8['name']){delete _0x4e32b8[_0xa5d1('0x37')];}_0x36addd[_0xa5d1('0x2b')](_0x4cd768)['send'](_0x4e32b8);};}exports['index']=function(_0x374cc0,_0xeac68e){var _0x288efc={},_0x2ab84e={},_0x18e58d={'count':0x0,'rows':[]};var _0x728e2d=_[_0xa5d1('0x38')](db[_0xa5d1('0x39')][_0xa5d1('0x3a')],function(_0x4bc018){return{'name':_0x4bc018[_0xa5d1('0x3b')],'type':_0x4bc018['type'][_0xa5d1('0x3c')]};});_0x2ab84e[_0xa5d1('0x3d')]=_['map'](_0x728e2d,_0xa5d1('0x37'));_0x2ab84e[_0xa5d1('0x3e')]=_[_0xa5d1('0x3f')](_0x374cc0[_0xa5d1('0x3e')]);_0x2ab84e['filters']=_['intersection'](_0x2ab84e[_0xa5d1('0x3d')],_0x2ab84e[_0xa5d1('0x3e')]);_0x288efc[_0xa5d1('0x40')]=_[_0xa5d1('0x41')](_0x2ab84e['model'],qs[_0xa5d1('0x42')](_0x374cc0['query'][_0xa5d1('0x42')]));_0x288efc[_0xa5d1('0x40')]=_0x288efc[_0xa5d1('0x40')][_0xa5d1('0x43')]?_0x288efc['attributes']:_0x2ab84e[_0xa5d1('0x3d')];if(!_0x374cc0[_0xa5d1('0x3e')][_0xa5d1('0x44')](_0xa5d1('0x45'))){_0x288efc[_0xa5d1('0x2e')]=qs[_0xa5d1('0x2e')](_0x374cc0[_0xa5d1('0x3e')][_0xa5d1('0x2e')]);_0x288efc[_0xa5d1('0x30')]=qs[_0xa5d1('0x30')](_0x374cc0[_0xa5d1('0x3e')]['offset']);}_0x288efc['order']=qs[_0xa5d1('0x46')](_0x374cc0[_0xa5d1('0x3e')]['sort']);_0x288efc[_0xa5d1('0x47')]=qs[_0xa5d1('0x48')](_[_0xa5d1('0x49')](_0x374cc0[_0xa5d1('0x3e')],_0x2ab84e['filters']),_0x728e2d);if(_0x374cc0['query'][_0xa5d1('0x4a')]){_0x288efc[_0xa5d1('0x47')]=_[_0xa5d1('0x4b')](_0x288efc[_0xa5d1('0x47')],{'$or':_[_0xa5d1('0x38')](_0x728e2d,function(_0x3e02a9){if(_0x3e02a9[_0xa5d1('0x4c')]!=='VIRTUAL'){var _0x5e0a8a={};_0x5e0a8a[_0x3e02a9[_0xa5d1('0x37')]]={'$like':'%'+_0x374cc0[_0xa5d1('0x3e')]['filter']+'%'};return _0x5e0a8a;}})});}_0x288efc=_['merge']({},_0x288efc,_0x374cc0[_0xa5d1('0x4d')]);var _0xa61fa9={'where':_0x288efc[_0xa5d1('0x47')]};return db[_0xa5d1('0x39')][_0xa5d1('0x2f')](_0xa61fa9)[_0xa5d1('0x35')](function(_0x40c42e){_0x18e58d['count']=_0x40c42e;if(_0x374cc0[_0xa5d1('0x3e')][_0xa5d1('0x4e')]){_0x288efc[_0xa5d1('0x4f')]=[{'all':!![]}];}return db[_0xa5d1('0x39')]['findAll'](_0x288efc);})[_0xa5d1('0x35')](function(_0x56da6c){_0x18e58d[_0xa5d1('0x50')]=_0x56da6c;return _0x18e58d;})[_0xa5d1('0x35')](respondWithFilteredResult(_0xeac68e,_0x288efc))[_0xa5d1('0x51')](handleError(_0xeac68e,null));};exports[_0xa5d1('0x52')]=function(_0x3caf54,_0x5a6dd3){var _0x31dded={'raw':!![],'where':{'id':_0x3caf54[_0xa5d1('0x53')]['id']}},_0x39fe27={};_0x39fe27[_0xa5d1('0x3d')]=_[_0xa5d1('0x3f')](db[_0xa5d1('0x39')][_0xa5d1('0x3a')]);_0x39fe27['query']=_[_0xa5d1('0x3f')](_0x3caf54[_0xa5d1('0x3e')]);_0x39fe27[_0xa5d1('0x48')]=_[_0xa5d1('0x41')](_0x39fe27['model'],_0x39fe27['query']);_0x31dded[_0xa5d1('0x40')]=_['intersection'](_0x39fe27[_0xa5d1('0x3d')],qs[_0xa5d1('0x42')](_0x3caf54[_0xa5d1('0x3e')][_0xa5d1('0x42')]));_0x31dded[_0xa5d1('0x40')]=_0x31dded['attributes'][_0xa5d1('0x43')]?_0x31dded[_0xa5d1('0x40')]:_0x39fe27['model'];if(_0x3caf54['query'][_0xa5d1('0x4e')]){_0x31dded[_0xa5d1('0x4f')]=[{'all':!![]}];}_0x31dded=_['merge']({},_0x31dded,_0x3caf54['options']);return db['FaxMessage']['find'](_0x31dded)['then'](handleEntityNotFound(_0x5a6dd3,null))[_0xa5d1('0x35')](respondWithResult(_0x5a6dd3,null))[_0xa5d1('0x51')](handleError(_0x5a6dd3,null));};exports[_0xa5d1('0x54')]=function(_0xa2f255,_0x330ee8){if(_0xa2f255[_0xa5d1('0x55')]['id']){delete _0xa2f255[_0xa5d1('0x55')]['id'];}return db[_0xa5d1('0x39')][_0xa5d1('0x56')]({'where':{'id':_0xa2f255[_0xa5d1('0x53')]['id']}})[_0xa5d1('0x35')](handleEntityNotFound(_0x330ee8,null))[_0xa5d1('0x35')](saveUpdates(_0xa2f255[_0xa5d1('0x55')],null))[_0xa5d1('0x35')](respondWithResult(_0x330ee8,null))[_0xa5d1('0x51')](handleError(_0x330ee8,null));};exports[_0xa5d1('0x34')]=function(_0x2603ca,_0x3eb52c){return db['FaxMessage'][_0xa5d1('0x56')]({'where':{'id':_0x2603ca['params']['id']}})[_0xa5d1('0x35')](handleEntityNotFound(_0x3eb52c,null))[_0xa5d1('0x35')](removeEntity(_0x3eb52c,null))[_0xa5d1('0x51')](handleError(_0x3eb52c,null));};exports['describe']=function(_0x197e64,_0x295837){return db[_0xa5d1('0x39')][_0xa5d1('0x57')]()[_0xa5d1('0x35')](respondWithResult(_0x295837,null))[_0xa5d1('0x51')](handleError(_0x295837,null));};var interaction_log=require(_0xa5d1('0x58'))(_0xa5d1('0x59'));exports[_0xa5d1('0x5a')]=function(_0x1ab94a,_0x299bff,_0x56be08){var _0x376ad3={'agent':{},'channel':'fax'};if(_0x1ab94a[_0xa5d1('0x55')]['id']){delete _0x1ab94a[_0xa5d1('0x55')]['id'];}_0x1ab94a[_0xa5d1('0x55')][_0xa5d1('0x5b')]=!![];_0x1ab94a[_0xa5d1('0x55')][_0xa5d1('0x5c')]=moment()[_0xa5d1('0x5d')](_0xa5d1('0x5e'));_0x1ab94a[_0xa5d1('0x55')]['UserId']=_0x1ab94a['body'][_0xa5d1('0x5f')]||_0x1ab94a['user']['id'];_0x376ad3['agent']['id']=_0x1ab94a[_0xa5d1('0x55')][_0xa5d1('0x5f')];return db[_0xa5d1('0x39')][_0xa5d1('0x56')]({'where':{'id':_0x1ab94a[_0xa5d1('0x53')]['id'],'UserId':null}})[_0xa5d1('0x35')](handleEntityNotFound(_0x299bff,null))[_0xa5d1('0x35')](saveUpdates(_0x1ab94a[_0xa5d1('0x55')],null))[_0xa5d1('0x35')](function(_0x2a1dda){if(_0x2a1dda){_0x376ad3[_0xa5d1('0x28')]=_0x2a1dda['get']({'plain':!![]});return db[_0xa5d1('0x60')][_0xa5d1('0x56')]({'where':{'id':_0x2a1dda[_0xa5d1('0x61')]}});}return null;})[_0xa5d1('0x35')](handleEntityNotFound(_0x299bff,null))[_0xa5d1('0x35')](function(_0x5afee1){if(_0x5afee1){return _0x5afee1[_0xa5d1('0x54')]({'UserId':_0x1ab94a[_0xa5d1('0x55')]['UserId'],'read1stAt':_[_0xa5d1('0x62')](_0x5afee1[_0xa5d1('0x63')])?moment()[_0xa5d1('0x5d')](_0xa5d1('0x5e')):undefined});}return null;})[_0xa5d1('0x35')](function(_0x372b14){if(_0x372b14){_0x376ad3[_0xa5d1('0x64')]=_0x372b14[_0xa5d1('0x65')]({'plain':!![]});interaction_log[_0xa5d1('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ab94a[_0xa5d1('0x66')]['id'],_0x1ab94a[_0xa5d1('0x66')]['name'],_0x1ab94a[_0xa5d1('0x66')][_0xa5d1('0x67')],_0x376ad3[_0xa5d1('0x64')]['id'],_0x1ab94a['body']?JSON[_0xa5d1('0x68')](_0x1ab94a[_0xa5d1('0x55')]):_0xa5d1('0x69'));return respondWithRpcPromise(_0xa5d1('0x6a'),_0xa5d1('0x6b'),_0x376ad3);}return null;})[_0xa5d1('0x35')](function(_0x3cfb9b){var _0x56e83d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3cfb9b[_0xa5d1('0x28')]['ContactId'];return db['sequelize'][_0xa5d1('0x3e')](_0x56e83d,{'type':db['Sequelize']['QueryTypes'][_0xa5d1('0x6c')],'raw':!![]})['then'](function(_0x545f80){return _0x545f80;});})[_0xa5d1('0x35')](function(_0x4e2bd9){if(_0x4e2bd9){_0x376ad3[_0xa5d1('0x28')][_0xa5d1('0x6d')]=_0x4e2bd9[0x0];if(!_0x1ab94a[_0xa5d1('0x55')][_0xa5d1('0x5f')])return;return db[_0xa5d1('0x6e')][_0xa5d1('0x56')]({'where':{'id':_0x1ab94a[_0xa5d1('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0xa5d1('0x37'),_0xa5d1('0x6f'),_0xa5d1('0x70'),_0xa5d1('0x71')],'raw':!![]});}return null;})[_0xa5d1('0x35')](function(_0xf6aab9){if(!_0xf6aab9)return null;_0x376ad3['message'][_0xa5d1('0x72')]=_0xf6aab9;return _0x376ad3;})['then'](function(_0x2be71e){if(_0x2be71e){if(_0x1ab94a['body']['manual']){_0x376ad3[_0xa5d1('0x28')]['interface']=util[_0xa5d1('0x5d')](_0xa5d1('0x73'),_0x1ab94a[_0xa5d1('0x66')]['name']);_0x376ad3[_0xa5d1('0x28')]['channel']=_0x376ad3[_0xa5d1('0x74')];_0x376ad3[_0xa5d1('0x28')][_0xa5d1('0x75')]=_0x376ad3['channel'];_0x376ad3[_0xa5d1('0x28')][_0xa5d1('0x76')]=_0xa5d1('0x5a');return respondWithRpcPromise(_0xa5d1('0x77'),_0xa5d1('0x77'),{'event':_0xa5d1('0x78'),'message':_0x376ad3[_0xa5d1('0x28')]},client9002)[_0xa5d1('0x35')](function(){return _0x376ad3;});}return _0x376ad3;}return null;})[_0xa5d1('0x35')](respondWithResult(_0x299bff,null))['catch'](handleError(_0x299bff,null));};var interaction_log=require(_0xa5d1('0x58'))(_0xa5d1('0x59'));exports[_0xa5d1('0x79')]=function(_0x13f7d4,_0x39afc9,_0x516657){var _0x2d2bda={'agent':{},'channel':_0xa5d1('0x7a')};if(_0x13f7d4[_0xa5d1('0x55')]['id']){delete _0x13f7d4[_0xa5d1('0x55')]['id'];}_0x13f7d4['body'][_0xa5d1('0x5f')]=_0x13f7d4[_0xa5d1('0x55')][_0xa5d1('0x5f')]||_0x13f7d4[_0xa5d1('0x66')]['id'];_0x2d2bda[_0xa5d1('0x72')]['id']=_0x13f7d4[_0xa5d1('0x55')][_0xa5d1('0x5f')];return db[_0xa5d1('0x39')][_0xa5d1('0x56')]({'where':{'id':_0x13f7d4[_0xa5d1('0x53')]['id'],'UserId':null}})[_0xa5d1('0x35')](handleEntityNotFound(_0x39afc9,null))[_0xa5d1('0x35')](function(_0x3704b4){if(_0x3704b4){_0x2d2bda[_0xa5d1('0x28')]=_0x3704b4[_0xa5d1('0x65')]({'plain':!![]});return db[_0xa5d1('0x60')][_0xa5d1('0x56')]({'where':{'id':_0x3704b4['FaxInteractionId']}});}return null;})[_0xa5d1('0x35')](handleEntityNotFound(_0x39afc9,null))[_0xa5d1('0x35')](function(_0x3969dd){if(_0x3969dd){_0x2d2bda['interaction']=_0x3969dd[_0xa5d1('0x65')]({'plain':!![]});interaction_log['info'](_0xa5d1('0x7b'),_0x13f7d4[_0xa5d1('0x66')]['id'],_0x13f7d4['user'][_0xa5d1('0x37')],_0x13f7d4[_0xa5d1('0x66')][_0xa5d1('0x67')],_0x2d2bda[_0xa5d1('0x64')]['id'],_0x13f7d4['body']?JSON[_0xa5d1('0x68')](_0x13f7d4[_0xa5d1('0x55')]):_0xa5d1('0x69'));return respondWithRpcPromise(_0xa5d1('0x7c'),_0xa5d1('0x7d'),_0x2d2bda);}return null;})[_0xa5d1('0x35')](function(_0x3a01d4){var _0x578b63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a01d4['message'][_0xa5d1('0x7e')];return db[_0xa5d1('0x7f')][_0xa5d1('0x3e')](_0x578b63,{'type':db[_0xa5d1('0x80')][_0xa5d1('0x81')]['SELECT'],'raw':!![]})[_0xa5d1('0x35')](function(_0x6bd8be){return _0x6bd8be;});})[_0xa5d1('0x35')](function(_0x574a22){if(_0x574a22){_0x2d2bda[_0xa5d1('0x28')][_0xa5d1('0x6d')]=_0x574a22[0x0];if(!_0x13f7d4['body'][_0xa5d1('0x5f')])return;return db[_0xa5d1('0x6e')][_0xa5d1('0x56')]({'where':{'id':_0x13f7d4[_0xa5d1('0x55')]['UserId'],'role':'agent'},'attributes':['id','name',_0xa5d1('0x6f'),_0xa5d1('0x70'),_0xa5d1('0x71')],'raw':!![]});}return null;})['then'](function(_0x35e301){if(!_0x35e301)return null;_0x2d2bda['message'][_0xa5d1('0x72')]=_0x35e301;return _0x2d2bda;})[_0xa5d1('0x35')](function(_0x560445){if(_0x560445){_0x560445[_0xa5d1('0x28')][_0xa5d1('0x82')]=util['format']('SIP/%s',_0x13f7d4[_0xa5d1('0x66')][_0xa5d1('0x37')]);_0x560445[_0xa5d1('0x28')]['channel']=_0x2d2bda[_0xa5d1('0x74')];_0x560445[_0xa5d1('0x28')][_0xa5d1('0x75')]=_0x2d2bda[_0xa5d1('0x74')];_0x560445[_0xa5d1('0x28')]['event']=_0xa5d1('0x79');respondWithRpcPromise(_0xa5d1('0x77'),_0xa5d1('0x77'),{'event':_0xa5d1('0x83'),'message':_0x560445[_0xa5d1('0x28')]},client9002);return _0x2d2bda;}return null;})[_0xa5d1('0x35')](respondWithResult(_0x39afc9,null))[_0xa5d1('0x51')](handleError(_0x39afc9,null));};exports[_0xa5d1('0x84')]=function(_0x2e7a0e,_0x12a8ef){var _0x2da122;return db[_0xa5d1('0x39')][_0xa5d1('0x84')](_0x2e7a0e[_0xa5d1('0x55')],{})['then'](function(_0x2e166e){_0x2da122=_0x2e166e;return db[_0xa5d1('0x85')][_0xa5d1('0x86')]({'where':{'id':_0x2da122[_0xa5d1('0x7e')]}});})[_0xa5d1('0x35')](function(_0x3f093c){if(_[_0xa5d1('0x62')](_0x3f093c)){return;}else{_0x2da122[_0xa5d1('0x7a')]=_0x3f093c[_0xa5d1('0x7a')];return db[_0xa5d1('0x87')][_0xa5d1('0x86')]({'where':{'id':_0x2da122[_0xa5d1('0x88')]}});}})[_0xa5d1('0x35')](function(_0x3998d6){return respondWithRpcPromise(_0xa5d1('0x89'),_0xa5d1('0x89'),{'FaxAccountId':_[_0xa5d1('0x62')](_0x2e7a0e['body'])?undefined:_0x2e7a0e[_0xa5d1('0x55')][_0xa5d1('0x8a')],'path':_[_0xa5d1('0x62')](_0x3998d6)?undefined:util[_0xa5d1('0x5d')]('/var/opt/motion2/server/files/attachments/%s',_0x3998d6[_0xa5d1('0x8b')]),'fax':_[_0xa5d1('0x62')](_0x2da122[_0xa5d1('0x7a')])?undefined:_0x2da122[_0xa5d1('0x7a')],'AttachmentId':_0x2da122['AttachmentId']},client9002);})[_0xa5d1('0x35')](respondWithResult(_0x12a8ef,0xc9))[_0xa5d1('0x51')](handleError(_0x12a8ef,null));};exports[_0xa5d1('0x8c')]=function(_0x4f2680,_0x2d6180){var _0x193f67=path[_0xa5d1('0x8d')](config[_0xa5d1('0x8e')],_0xa5d1('0x8f'),_0xa5d1('0x90'),'attachments');return db[_0xa5d1('0x39')]['find']({'where':{'id':_0x4f2680[_0xa5d1('0x53')]['id']},'include':[{'model':db[_0xa5d1('0x87')],'as':_0xa5d1('0x87')}]})[_0xa5d1('0x35')](handleEntityNotFound(_0x2d6180,null))[_0xa5d1('0x35')](function(_0x771fd6){if(_0x771fd6){return _0x2d6180[_0xa5d1('0x8c')](path[_0xa5d1('0x8d')](_0x193f67,_0x771fd6['Attachment'][_0xa5d1('0x8b')]));}})[_0xa5d1('0x51')](handleError(_0x2d6180,null));}; \ No newline at end of file +var _0x9d0f=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','end','stack','name','send','index','map','FaxMessage','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','body','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','rejectmessage','create','CmContact','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','root','files','attachments','join','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x9d0f,0x1a4));var _0xf9d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9d0f[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xf9d0('0x0'));var rimraf=require(_0xf9d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf9d0('0x2'));var rp=require(_0xf9d0('0x3'));var moment=require(_0xf9d0('0x4'));var BPromise=require(_0xf9d0('0x5'));var Mustache=require(_0xf9d0('0x6'));var util=require(_0xf9d0('0x7'));var path=require(_0xf9d0('0x8'));var sox=require(_0xf9d0('0x9'));var csv=require(_0xf9d0('0xa'));var ejs=require(_0xf9d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9d0('0xc'));var squel=require(_0xf9d0('0xd'));var crypto=require(_0xf9d0('0xe'));var jsforce=require(_0xf9d0('0xf'));var deskjs=require(_0xf9d0('0x10'));var toCsv=require(_0xf9d0('0xa'));var querystring=require(_0xf9d0('0x11'));var Papa=require(_0xf9d0('0x12'));var Redis=require(_0xf9d0('0x13'));var authService=require(_0xf9d0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf9d0('0x15'));var hardwareService=require(_0xf9d0('0x16'));var logger=require(_0xf9d0('0x17'))(_0xf9d0('0x18'));var utils=require(_0xf9d0('0x19'));var config=require(_0xf9d0('0x1a'));var licenseUtil=require(_0xf9d0('0x1b'));var db=require('../../mysqldb')['db'];config[_0xf9d0('0x1c')]=_['defaults'](config[_0xf9d0('0x1c')],{'host':_0xf9d0('0x1d'),'port':0x18eb});var socket=require(_0xf9d0('0x1e'))(new Redis(config[_0xf9d0('0x1c')]));require('./faxMessage.socket')[_0xf9d0('0x1f')](socket);var jayson=require(_0xf9d0('0x20'));var client=jayson[_0xf9d0('0x21')][_0xf9d0('0x22')]({'port':0x232c});var client9002=jayson[_0xf9d0('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d0826,_0x1e503b,_0x29efa6,_0x5e1476){return new BPromise(function(_0x52365c,_0x3b75b2){var _0x28e98c=_0x5e1476||client;return _0x28e98c[_0xf9d0('0x23')](_0x2d0826,_0x29efa6)[_0xf9d0('0x24')](function(_0x38dfb0){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1e503b,_0xf9d0('0x25'));logger[_0xf9d0('0x26')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x1e503b,_0xf9d0('0x25'),JSON[_0xf9d0('0x27')](_0x38dfb0));if(_0x38dfb0[_0xf9d0('0x28')]){if(_0x38dfb0[_0xf9d0('0x28')][_0xf9d0('0x29')]===0x1f4){logger['error'](_0xf9d0('0x2a'),_0x1e503b,_0x38dfb0[_0xf9d0('0x28')]['message']);return _0x3b75b2(_0x38dfb0['error'][_0xf9d0('0x2b')]);}logger[_0xf9d0('0x28')]('FaxMessage,\x20%s,\x20%s',_0x1e503b,_0x38dfb0[_0xf9d0('0x28')]['message']);return _0x52365c(_0x38dfb0[_0xf9d0('0x28')][_0xf9d0('0x2b')]);}else{logger[_0xf9d0('0x2c')](_0xf9d0('0x2a'),_0x1e503b,_0xf9d0('0x25'));_0x52365c(_0x38dfb0[_0xf9d0('0x2d')][_0xf9d0('0x2b')]);}})[_0xf9d0('0x2e')](function(_0x8fff8){logger[_0xf9d0('0x28')]('FaxMessage,\x20%s,\x20%s',_0x1e503b,_0x8fff8);_0x3b75b2(_0x8fff8);});});}function respondWithStatusCode(_0x4d7ca8,_0x3b51ec){_0x3b51ec=_0x3b51ec||0xcc;return function(_0x2d01d1){if(_0x2d01d1){return _0x4d7ca8[_0xf9d0('0x2f')](_0x3b51ec);}return _0x4d7ca8[_0xf9d0('0x30')](_0x3b51ec)['end']();};}function respondWithResult(_0x404365,_0x2ef8d8){_0x2ef8d8=_0x2ef8d8||0xc8;return function(_0x4200be){if(_0x4200be){return _0x404365[_0xf9d0('0x30')](_0x2ef8d8)[_0xf9d0('0x31')](_0x4200be);}};}function respondWithFilteredResult(_0x4ac77b,_0xaed48){return function(_0x4e3ab0){if(_0x4e3ab0){var _0x365caf=typeof _0xaed48['offset']===_0xf9d0('0x32')&&typeof _0xaed48[_0xf9d0('0x33')]==='undefined';var _0x263fdc=_0x4e3ab0[_0xf9d0('0x34')];var _0x2b5484=_0x365caf?0x0:_0xaed48['offset'];var _0x5a91b7=_0x365caf?_0x4e3ab0['count']:_0xaed48[_0xf9d0('0x35')]+_0xaed48['limit'];var _0x5e353a;if(_0x5a91b7>=_0x263fdc){_0x5a91b7=_0x263fdc;_0x5e353a=0xc8;}else{_0x5e353a=0xce;}_0x4ac77b[_0xf9d0('0x30')](_0x5e353a);return _0x4ac77b[_0xf9d0('0x36')](_0xf9d0('0x37'),_0x2b5484+'-'+_0x5a91b7+'/'+_0x263fdc)[_0xf9d0('0x31')](_0x4e3ab0);}return null;};}function patchUpdates(_0x469a64){return function(_0x21f3b5){try{jsonpatch['apply'](_0x21f3b5,_0x469a64,!![]);}catch(_0x2342f0){return BPromise[_0xf9d0('0x38')](_0x2342f0);}return _0x21f3b5['save']();};}function saveUpdates(_0x199a03,_0x170177){return function(_0x2a3e62){if(_0x2a3e62){return _0x2a3e62[_0xf9d0('0x39')](_0x199a03)[_0xf9d0('0x24')](function(_0x84eee8){return _0x84eee8;});}return null;};}function removeEntity(_0x1abca1,_0x4462b0){return function(_0x54b2d2){if(_0x54b2d2){return _0x54b2d2['destroy']()['then'](function(){_0x1abca1[_0xf9d0('0x30')](0xcc)[_0xf9d0('0x3a')]();});}};}function handleEntityNotFound(_0x227425,_0x1da9a7){return function(_0x1d605d){if(!_0x1d605d){_0x227425[_0xf9d0('0x2f')](0x194);}return _0x1d605d;};}function handleError(_0x5bb719,_0x1aa7ee){_0x1aa7ee=_0x1aa7ee||0x1f4;return function(_0x200f75){logger[_0xf9d0('0x28')](_0x200f75[_0xf9d0('0x3b')]);if(_0x200f75[_0xf9d0('0x3c')]){delete _0x200f75[_0xf9d0('0x3c')];}_0x5bb719['status'](_0x1aa7ee)[_0xf9d0('0x3d')](_0x200f75);};}exports[_0xf9d0('0x3e')]=function(_0x668244,_0x39f8f5){var _0x397372={},_0x5195e6={},_0x139c0e={'count':0x0,'rows':[]};var _0x241a41=_[_0xf9d0('0x3f')](db[_0xf9d0('0x40')][_0xf9d0('0x41')],function(_0x36dbf6){return{'name':_0x36dbf6['fieldName'],'type':_0x36dbf6['type']['key']};});_0x5195e6[_0xf9d0('0x42')]=_[_0xf9d0('0x3f')](_0x241a41,'name');_0x5195e6[_0xf9d0('0x43')]=_[_0xf9d0('0x44')](_0x668244[_0xf9d0('0x43')]);_0x5195e6[_0xf9d0('0x45')]=_[_0xf9d0('0x46')](_0x5195e6[_0xf9d0('0x42')],_0x5195e6[_0xf9d0('0x43')]);_0x397372['attributes']=_[_0xf9d0('0x46')](_0x5195e6[_0xf9d0('0x42')],qs[_0xf9d0('0x47')](_0x668244[_0xf9d0('0x43')][_0xf9d0('0x47')]));_0x397372[_0xf9d0('0x48')]=_0x397372[_0xf9d0('0x48')]['length']?_0x397372['attributes']:_0x5195e6['model'];if(!_0x668244[_0xf9d0('0x43')][_0xf9d0('0x49')]('nolimit')){_0x397372[_0xf9d0('0x33')]=qs[_0xf9d0('0x33')](_0x668244['query'][_0xf9d0('0x33')]);_0x397372['offset']=qs['offset'](_0x668244['query']['offset']);}_0x397372[_0xf9d0('0x4a')]=qs[_0xf9d0('0x4b')](_0x668244[_0xf9d0('0x43')][_0xf9d0('0x4b')]);_0x397372[_0xf9d0('0x4c')]=qs[_0xf9d0('0x45')](_[_0xf9d0('0x4d')](_0x668244[_0xf9d0('0x43')],_0x5195e6[_0xf9d0('0x45')]),_0x241a41);if(_0x668244['query'][_0xf9d0('0x4e')]){_0x397372[_0xf9d0('0x4c')]=_[_0xf9d0('0x4f')](_0x397372[_0xf9d0('0x4c')],{'$or':_[_0xf9d0('0x3f')](_0x241a41,function(_0x255817){if(_0x255817[_0xf9d0('0x50')]!==_0xf9d0('0x51')){var _0x13af60={};_0x13af60[_0x255817[_0xf9d0('0x3c')]]={'$like':'%'+_0x668244[_0xf9d0('0x43')][_0xf9d0('0x4e')]+'%'};return _0x13af60;}})});}_0x397372=_[_0xf9d0('0x4f')]({},_0x397372,_0x668244[_0xf9d0('0x52')]);var _0x17652d={'where':_0x397372['where']};return db[_0xf9d0('0x40')]['count'](_0x17652d)[_0xf9d0('0x24')](function(_0x54c893){_0x139c0e[_0xf9d0('0x34')]=_0x54c893;if(_0x668244['query'][_0xf9d0('0x53')]){_0x397372[_0xf9d0('0x54')]=[{'all':!![]}];}return db[_0xf9d0('0x40')][_0xf9d0('0x55')](_0x397372);})['then'](function(_0x10e6b6){_0x139c0e[_0xf9d0('0x56')]=_0x10e6b6;return _0x139c0e;})[_0xf9d0('0x24')](respondWithFilteredResult(_0x39f8f5,_0x397372))[_0xf9d0('0x2e')](handleError(_0x39f8f5,null));};exports['show']=function(_0xceaf57,_0x21fc8b){var _0x3aa59b={'raw':!![],'where':{'id':_0xceaf57[_0xf9d0('0x57')]['id']}},_0x575500={};_0x575500[_0xf9d0('0x42')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x575500['query']=_[_0xf9d0('0x44')](_0xceaf57[_0xf9d0('0x43')]);_0x575500[_0xf9d0('0x45')]=_[_0xf9d0('0x46')](_0x575500['model'],_0x575500[_0xf9d0('0x43')]);_0x3aa59b['attributes']=_[_0xf9d0('0x46')](_0x575500[_0xf9d0('0x42')],qs[_0xf9d0('0x47')](_0xceaf57[_0xf9d0('0x43')][_0xf9d0('0x47')]));_0x3aa59b[_0xf9d0('0x48')]=_0x3aa59b['attributes'][_0xf9d0('0x58')]?_0x3aa59b[_0xf9d0('0x48')]:_0x575500['model'];if(_0xceaf57['query'][_0xf9d0('0x53')]){_0x3aa59b[_0xf9d0('0x54')]=[{'all':!![]}];}_0x3aa59b=_['merge']({},_0x3aa59b,_0xceaf57[_0xf9d0('0x52')]);return db['FaxMessage'][_0xf9d0('0x59')](_0x3aa59b)['then'](handleEntityNotFound(_0x21fc8b,null))[_0xf9d0('0x24')](respondWithResult(_0x21fc8b,null))['catch'](handleError(_0x21fc8b,null));};exports[_0xf9d0('0x39')]=function(_0x2481d5,_0x22d8bd){if(_0x2481d5[_0xf9d0('0x5a')]['id']){delete _0x2481d5[_0xf9d0('0x5a')]['id'];}return db[_0xf9d0('0x40')][_0xf9d0('0x59')]({'where':{'id':_0x2481d5[_0xf9d0('0x57')]['id']}})[_0xf9d0('0x24')](handleEntityNotFound(_0x22d8bd,null))['then'](saveUpdates(_0x2481d5[_0xf9d0('0x5a')],null))[_0xf9d0('0x24')](respondWithResult(_0x22d8bd,null))[_0xf9d0('0x2e')](handleError(_0x22d8bd,null));};exports['destroy']=function(_0x143f20,_0x21522f){return db[_0xf9d0('0x40')][_0xf9d0('0x59')]({'where':{'id':_0x143f20[_0xf9d0('0x57')]['id']}})[_0xf9d0('0x24')](handleEntityNotFound(_0x21522f,null))['then'](removeEntity(_0x21522f,null))[_0xf9d0('0x2e')](handleError(_0x21522f,null));};exports[_0xf9d0('0x5b')]=function(_0x2f8d11,_0x53f3b0){return db[_0xf9d0('0x40')][_0xf9d0('0x5b')]()['then'](respondWithResult(_0x53f3b0,null))['catch'](handleError(_0x53f3b0,null));};var interaction_log=require('../../config/logger')(_0xf9d0('0x5c'));exports['accept']=function(_0x5cb3b0,_0x209263,_0x3cb6c6){var _0x56522c={'agent':{},'channel':_0xf9d0('0x5d')};if(_0x5cb3b0[_0xf9d0('0x5a')]['id']){delete _0x5cb3b0['body']['id'];}_0x5cb3b0['body'][_0xf9d0('0x5e')]=!![];_0x5cb3b0['body'][_0xf9d0('0x5f')]=moment()[_0xf9d0('0x60')](_0xf9d0('0x61'));_0x5cb3b0['body'][_0xf9d0('0x62')]=_0x5cb3b0[_0xf9d0('0x5a')][_0xf9d0('0x62')]||_0x5cb3b0[_0xf9d0('0x63')]['id'];_0x56522c[_0xf9d0('0x64')]['id']=_0x5cb3b0['body'][_0xf9d0('0x62')];return db[_0xf9d0('0x40')]['find']({'where':{'id':_0x5cb3b0[_0xf9d0('0x57')]['id'],'UserId':null}})[_0xf9d0('0x24')](handleEntityNotFound(_0x209263,null))[_0xf9d0('0x24')](saveUpdates(_0x5cb3b0['body'],null))[_0xf9d0('0x24')](function(_0x15e378){if(_0x15e378){_0x56522c['message']=_0x15e378[_0xf9d0('0x65')]({'plain':!![]});return db[_0xf9d0('0x66')][_0xf9d0('0x59')]({'where':{'id':_0x15e378[_0xf9d0('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x209263,null))[_0xf9d0('0x24')](function(_0x296739){if(_0x296739){return _0x296739['update']({'UserId':_0x5cb3b0['body'][_0xf9d0('0x62')],'read1stAt':_[_0xf9d0('0x68')](_0x296739[_0xf9d0('0x69')])?moment()[_0xf9d0('0x60')](_0xf9d0('0x61')):undefined});}return null;})['then'](function(_0x3ff4f6){if(_0x3ff4f6){_0x56522c[_0xf9d0('0x6a')]=_0x3ff4f6[_0xf9d0('0x65')]({'plain':!![]});interaction_log[_0xf9d0('0x2c')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5cb3b0['user']['id'],_0x5cb3b0['user']['name'],_0x5cb3b0[_0xf9d0('0x63')]['role'],_0x56522c[_0xf9d0('0x6a')]['id'],_0x5cb3b0[_0xf9d0('0x5a')]?JSON[_0xf9d0('0x27')](_0x5cb3b0['body']):_0xf9d0('0x6b'));return respondWithRpcPromise(_0xf9d0('0x6c'),_0xf9d0('0x6d'),_0x56522c);}return null;})[_0xf9d0('0x24')](function(_0x4eb616){var _0xa797fc=_0xf9d0('0x6e')+_0x4eb616[_0xf9d0('0x2b')][_0xf9d0('0x6f')];return db['sequelize'][_0xf9d0('0x43')](_0xa797fc,{'type':db[_0xf9d0('0x70')][_0xf9d0('0x71')][_0xf9d0('0x72')],'raw':!![]})[_0xf9d0('0x24')](function(_0x2d1bb9){return _0x2d1bb9;});})[_0xf9d0('0x24')](function(_0x2112ea){if(_0x2112ea){_0x56522c[_0xf9d0('0x2b')][_0xf9d0('0x73')]=_0x2112ea[0x0];if(!_0x5cb3b0[_0xf9d0('0x5a')]['UserId'])return;return db[_0xf9d0('0x74')][_0xf9d0('0x59')]({'where':{'id':_0x5cb3b0[_0xf9d0('0x5a')][_0xf9d0('0x62')],'role':'agent'},'attributes':['id',_0xf9d0('0x3c'),_0xf9d0('0x75'),_0xf9d0('0x76'),_0xf9d0('0x77')],'raw':!![]});}return null;})[_0xf9d0('0x24')](function(_0x49bef5){if(!_0x49bef5)return null;_0x56522c[_0xf9d0('0x2b')][_0xf9d0('0x64')]=_0x49bef5;return _0x56522c;})['then'](function(_0x590676){if(_0x590676){if(_0x5cb3b0[_0xf9d0('0x5a')][_0xf9d0('0x78')]){_0x56522c['message'][_0xf9d0('0x79')]=util[_0xf9d0('0x60')](_0xf9d0('0x7a'),_0x5cb3b0[_0xf9d0('0x63')]['name']);_0x56522c['message']['channel']=_0x56522c[_0xf9d0('0x7b')];_0x56522c[_0xf9d0('0x2b')][_0xf9d0('0x7c')]=_0x56522c[_0xf9d0('0x7b')];_0x56522c[_0xf9d0('0x2b')][_0xf9d0('0x7d')]=_0xf9d0('0x7e');return respondWithRpcPromise('EventManager',_0xf9d0('0x7f'),{'event':_0xf9d0('0x80'),'message':_0x56522c[_0xf9d0('0x2b')]},client9002)['then'](function(){return _0x56522c;});}return _0x56522c;}return null;})[_0xf9d0('0x24')](respondWithResult(_0x209263,null))[_0xf9d0('0x2e')](handleError(_0x209263,null));};var interaction_log=require(_0xf9d0('0x17'))(_0xf9d0('0x5c'));exports[_0xf9d0('0x38')]=function(_0xdd7255,_0x1656f6,_0x29bb7e){var _0x15a473={'agent':{},'channel':_0xf9d0('0x5d')};if(_0xdd7255[_0xf9d0('0x5a')]['id']){delete _0xdd7255['body']['id'];}_0xdd7255['body'][_0xf9d0('0x62')]=_0xdd7255[_0xf9d0('0x5a')][_0xf9d0('0x62')]||_0xdd7255[_0xf9d0('0x63')]['id'];_0x15a473[_0xf9d0('0x64')]['id']=_0xdd7255['body'][_0xf9d0('0x62')];return db['FaxMessage']['find']({'where':{'id':_0xdd7255[_0xf9d0('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1656f6,null))[_0xf9d0('0x24')](function(_0xdab1a0){if(_0xdab1a0){_0x15a473[_0xf9d0('0x2b')]=_0xdab1a0['get']({'plain':!![]});return db[_0xf9d0('0x66')][_0xf9d0('0x59')]({'where':{'id':_0xdab1a0[_0xf9d0('0x67')]}});}return null;})[_0xf9d0('0x24')](handleEntityNotFound(_0x1656f6,null))[_0xf9d0('0x24')](function(_0x27d96b){if(_0x27d96b){_0x15a473['interaction']=_0x27d96b['get']({'plain':!![]});interaction_log[_0xf9d0('0x2c')](_0xf9d0('0x81'),_0xdd7255['user']['id'],_0xdd7255[_0xf9d0('0x63')][_0xf9d0('0x3c')],_0xdd7255[_0xf9d0('0x63')][_0xf9d0('0x82')],_0x15a473[_0xf9d0('0x6a')]['id'],_0xdd7255['body']?JSON[_0xf9d0('0x27')](_0xdd7255['body']):_0xf9d0('0x6b'));return respondWithRpcPromise(_0xf9d0('0x83'),_0xf9d0('0x84'),_0x15a473);}return null;})[_0xf9d0('0x24')](function(_0x141d39){var _0x15c5c7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x141d39[_0xf9d0('0x2b')][_0xf9d0('0x6f')];return db[_0xf9d0('0x85')][_0xf9d0('0x43')](_0x15c5c7,{'type':db[_0xf9d0('0x70')][_0xf9d0('0x71')][_0xf9d0('0x72')],'raw':!![]})[_0xf9d0('0x24')](function(_0x2a7257){return _0x2a7257;});})[_0xf9d0('0x24')](function(_0x9d109b){if(_0x9d109b){_0x15a473['message'][_0xf9d0('0x73')]=_0x9d109b[0x0];if(!_0xdd7255['body'][_0xf9d0('0x62')])return;return db[_0xf9d0('0x74')][_0xf9d0('0x59')]({'where':{'id':_0xdd7255['body']['UserId'],'role':'agent'},'attributes':['id','name',_0xf9d0('0x75'),_0xf9d0('0x76'),_0xf9d0('0x77')],'raw':!![]});}return null;})['then'](function(_0x2f8c06){if(!_0x2f8c06)return null;_0x15a473[_0xf9d0('0x2b')]['agent']=_0x2f8c06;return _0x15a473;})[_0xf9d0('0x24')](function(_0x151660){if(_0x151660){_0x151660[_0xf9d0('0x2b')]['interface']=util['format'](_0xf9d0('0x7a'),_0xdd7255[_0xf9d0('0x63')]['name']);_0x151660[_0xf9d0('0x2b')][_0xf9d0('0x7b')]=_0x15a473[_0xf9d0('0x7b')];_0x151660[_0xf9d0('0x2b')][_0xf9d0('0x7c')]=_0x15a473[_0xf9d0('0x7b')];_0x151660[_0xf9d0('0x2b')][_0xf9d0('0x7d')]=_0xf9d0('0x38');respondWithRpcPromise(_0xf9d0('0x7f'),_0xf9d0('0x7f'),{'event':_0xf9d0('0x86'),'message':_0x151660[_0xf9d0('0x2b')]},client9002);return _0x15a473;}return null;})['then'](respondWithResult(_0x1656f6,null))['catch'](handleError(_0x1656f6,null));};exports[_0xf9d0('0x87')]=function(_0x31bf3e,_0x3a25a4){var _0x5dd8ea;return db[_0xf9d0('0x40')]['create'](_0x31bf3e[_0xf9d0('0x5a')],{})['then'](function(_0x330a17){_0x5dd8ea=_0x330a17;return db[_0xf9d0('0x88')]['findOne']({'where':{'id':_0x5dd8ea['ContactId']}});})[_0xf9d0('0x24')](function(_0x274488){if(_['isNil'](_0x274488)){return;}else{_0x5dd8ea[_0xf9d0('0x5d')]=_0x274488[_0xf9d0('0x5d')];return db[_0xf9d0('0x89')]['findOne']({'where':{'id':_0x5dd8ea[_0xf9d0('0x8a')]}});}})['then'](function(_0x25aa58){return respondWithRpcPromise(_0xf9d0('0x8b'),'SendFax',{'FaxAccountId':_['isNil'](_0x31bf3e[_0xf9d0('0x5a')])?undefined:_0x31bf3e[_0xf9d0('0x5a')]['FaxAccountId'],'path':_[_0xf9d0('0x68')](_0x25aa58)?undefined:util['format'](_0xf9d0('0x8c'),_0x25aa58[_0xf9d0('0x8d')]),'fax':_[_0xf9d0('0x68')](_0x5dd8ea[_0xf9d0('0x5d')])?undefined:_0x5dd8ea[_0xf9d0('0x5d')],'AttachmentId':_0x5dd8ea[_0xf9d0('0x8a')]},client9002);})[_0xf9d0('0x24')](respondWithResult(_0x3a25a4,0xc9))['catch'](handleError(_0x3a25a4,null));};exports[_0xf9d0('0x8e')]=function(_0x3fab69,_0x598571){var _0xb3dc3b=path['join'](config[_0xf9d0('0x8f')],'server',_0xf9d0('0x90'),_0xf9d0('0x91'));return db[_0xf9d0('0x40')][_0xf9d0('0x59')]({'where':{'id':_0x3fab69['params']['id']},'include':[{'model':db[_0xf9d0('0x89')],'as':_0xf9d0('0x89')}]})[_0xf9d0('0x24')](handleEntityNotFound(_0x598571,null))[_0xf9d0('0x24')](function(_0x262f24){if(_0x262f24){return _0x598571[_0xf9d0('0x8e')](path[_0xf9d0('0x92')](_0xb3dc3b,_0x262f24['Attachment'][_0xf9d0('0x8d')]));}})[_0xf9d0('0x2e')](handleError(_0x598571,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 55edf0a..9024c4c 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 _0xaa37=['../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x56e063,_0x453233){var _0x766fcf=function(_0x59415a){while(--_0x59415a){_0x56e063['push'](_0x56e063['shift']());}};_0x766fcf(++_0x453233);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa37[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x7aa3('0x0'));var FaxMessage=require(_0x7aa3('0x1'))['db'][_0x7aa3('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7aa3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7aa3('0x4'),'afterDestroy':_0x7aa3('0x5')};function emitEvent(_0x27333d){return function(_0x11e64c,_0x334919,_0x2801a2){FaxMessageEvents[_0x7aa3('0x6')](_0x27333d+':'+_0x11e64c['id'],_0x11e64c);FaxMessageEvents['emit'](_0x27333d,_0x11e64c);_0x2801a2(null);};}for(var e in events){if(events[_0x7aa3('0x7')](e)){var event=events[e];FaxMessage[_0x7aa3('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x53ec=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ec,0x192));var _0xc53e=function(_0x506cbe,_0x818678){_0x506cbe=_0x506cbe-0x0;var _0x4fdaa7=_0x53ec[_0x506cbe];return _0x4fdaa7;};'use strict';var EventEmitter=require(_0xc53e('0x0'));var FaxMessage=require(_0xc53e('0x1'))['db'][_0xc53e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc53e('0x3')](0x0);var events={'afterCreate':_0xc53e('0x4'),'afterUpdate':_0xc53e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x266c42){return function(_0x4e954a,_0x2b90f6,_0x38033d){FaxMessageEvents['emit'](_0x266c42+':'+_0x4e954a['id'],_0x4e954a);FaxMessageEvents[_0xc53e('0x6')](_0x266c42,_0x4e954a);_0x38033d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xc53e('0x7')](e,emitEvent(event));}}module[_0xc53e('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b77cf9f..23d0c91 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 _0x8ec5=['toLowerCase','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','lodash','util','../../config/logger','moment','path','exports','define','FaxMessage','body','models','get','direction'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x8ec5,0x112));var _0x58ec=function(_0x3245a4,_0xf0bb20){_0x3245a4=_0x3245a4-0x0;var _0x450932=_0x8ec5[_0x3245a4];return _0x450932;};'use strict';var _=require(_0x58ec('0x0'));var util=require(_0x58ec('0x1'));var logger=require(_0x58ec('0x2'))('api');var moment=require(_0x58ec('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x58ec('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x58ec('0x5')]=function(_0x183227,_0x1ada0a){return _0x183227[_0x58ec('0x6')](_0x58ec('0x7'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x58ec('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x111800,_0x2a16bb,_0x40bba3){var _0x269ade=_0x183227[_0x58ec('0x9')];var _0x2c64e0=_0x111800[_0x58ec('0xa')]({'plain':!![]});if(_0x2c64e0[_0x58ec('0xb')][_0x58ec('0xc')]()==='in'||_0x2c64e0['direction'][_0x58ec('0xc')]()==='out'&&!_0x2c64e0[_0x58ec('0xd')]&&!_[_0x58ec('0xe')](_0x2c64e0[_0x58ec('0xf')])){_0x269ade['FaxInteraction'][_0x58ec('0x10')]({'where':{'id':_0x2c64e0['FaxInteractionId']}})[_0x58ec('0x11')](function(_0xae9a1c){if(_0xae9a1c){_0xae9a1c[_0x58ec('0x12')]({'lastMsgAt':_0x2c64e0[_0x58ec('0x13')],'lastMsgDirection':_0x2c64e0['direction'][_0x58ec('0xc')]()});}})[_0x58ec('0x14')](function(_0x3ace5a){console[_0x58ec('0x15')](_0x3ace5a);});}_0x40bba3();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xeb1a=['FULLTEXT','get','direction','toLowerCase','secret','UserId','FaxInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body'];(function(_0x4456a8,_0x22d298){var _0x1b8141=function(_0x169829){while(--_0x169829){_0x4456a8['push'](_0x4456a8['shift']());}};_0x1b8141(++_0x22d298);}(_0xeb1a,0x7a));var _0xaeb1=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0xeb1a[_0x441f7a];return _0x4821da;};'use strict';var _=require(_0xaeb1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaeb1('0x1'));var moment=require(_0xaeb1('0x2'));var BPromise=require('bluebird');var rp=require(_0xaeb1('0x3'));var fs=require('fs');var path=require(_0xaeb1('0x4'));var rimraf=require('rimraf');var config=require(_0xaeb1('0x5'));var attributes=require(_0xaeb1('0x6'));module[_0xaeb1('0x7')]=function(_0x1fa7c3,_0x5b5503){return _0x1fa7c3[_0xaeb1('0x8')](_0xaeb1('0x9'),attributes,{'tableName':_0xaeb1('0xa'),'paranoid':![],'indexes':[{'name':_0xaeb1('0xb'),'fields':[_0xaeb1('0xc')],'type':_0xaeb1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22140e,_0x2b3644,_0xb0a847){var _0x579e68=_0x1fa7c3['models'];var _0x1fbcdb=_0x22140e[_0xaeb1('0xe')]({'plain':!![]});if(_0x1fbcdb[_0xaeb1('0xf')][_0xaeb1('0x10')]()==='in'||_0x1fbcdb[_0xaeb1('0xf')][_0xaeb1('0x10')]()==='out'&&!_0x1fbcdb[_0xaeb1('0x11')]&&!_['isNil'](_0x1fbcdb[_0xaeb1('0x12')])){_0x579e68[_0xaeb1('0x13')][_0xaeb1('0x14')]({'where':{'id':_0x1fbcdb['FaxInteractionId']}})[_0xaeb1('0x15')](function(_0x44818c){if(_0x44818c){_0x44818c[_0xaeb1('0x16')]({'lastMsgAt':_0x1fbcdb[_0xaeb1('0x17')],'lastMsgDirection':_0x1fbcdb[_0xaeb1('0xf')][_0xaeb1('0x10')]()});}})[_0xaeb1('0x18')](function(_0x5b5ea3){console['error'](_0x5b5ea3);});}_0xb0a847();}},'charset':_0xaeb1('0x19'),'collate':_0xaeb1('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ec52aec..f6ce7f8 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 _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x4d9b4c,_0x242b7e){var _0x1ddb17=function(_0x524964){while(--_0x524964){_0x4d9b4c['push'](_0x4d9b4c['shift']());}};_0x1ddb17(++_0x242b7e);}(_0xac31,0xca));var _0x1ac3=function(_0x5b2582,_0x26be0f){_0x5b2582=_0x5b2582-0x0;var _0x14538e=_0xac31[_0x5b2582];return _0x14538e;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file +var _0x5636=['error','code','message','result','CreateFaxMessage','FaxMessage','body','options','then','UpdateFaxMessage','update','where','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x5636,0x102));var _0x6563=function(_0x50de2b,_0x37c7f5){_0x50de2b=_0x50de2b-0x0;var _0x2d1eea=_0x5636[_0x50de2b];return _0x2d1eea;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});config[_0x6563('0xa')]=_[_0x6563('0xb')](config[_0x6563('0xa')],{'host':_0x6563('0xc'),'port':0x18eb});var socket=require(_0x6563('0xd'))(new Redis(config[_0x6563('0xa')]));require(_0x6563('0xe'))[_0x6563('0xf')](socket);function respondWithRpcPromise(_0x516d1a,_0x51fdc2,_0x2946f3){return new BPromise(function(_0x129fa3,_0x490a56){return client['request'](_0x516d1a,_0x2946f3)['then'](function(_0x1ef002){logger[_0x6563('0x10')](_0x6563('0x11'),_0x51fdc2,_0x6563('0x12'));logger[_0x6563('0x13')](_0x6563('0x14'),_0x51fdc2,_0x6563('0x12'),JSON[_0x6563('0x15')](_0x1ef002));if(_0x1ef002[_0x6563('0x16')]){if(_0x1ef002['error'][_0x6563('0x17')]===0x1f4){logger['error'](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x490a56(_0x1ef002[_0x6563('0x16')]['message']);}logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x129fa3(_0x1ef002['error'][_0x6563('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x51fdc2,'request\x20sent');_0x129fa3(_0x1ef002[_0x6563('0x19')]['message']);}})['catch'](function(_0x27651b){logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x27651b);_0x490a56(_0x27651b);});});}exports[_0x6563('0x1a')]=function(_0xf8b544){var _0x10811d=this;return new Promise(function(_0x37ba3,_0x93a45){return db[_0x6563('0x1b')]['create'](_0xf8b544[_0x6563('0x1c')],{'raw':_0xf8b544[_0x6563('0x1d')]?_0xf8b544[_0x6563('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x6563('0x1e')](function(_0x5c37bb){logger[_0x6563('0x10')](_0x6563('0x1a'),_0xf8b544);logger['debug']('CreateFaxMessage',_0xf8b544,JSON[_0x6563('0x15')](_0x5c37bb));_0x37ba3(_0x5c37bb);})['catch'](function(_0x1097d0){logger[_0x6563('0x16')](_0x6563('0x1a'),_0x1097d0['message'],_0xf8b544);_0x93a45(_0x10811d[_0x6563('0x16')](0x1f4,_0x1097d0['message']));});});};exports[_0x6563('0x1f')]=function(_0x1590e6){var _0x5e5aeb=this;return new Promise(function(_0x365b16,_0x28252d){return db['FaxMessage'][_0x6563('0x20')](_0x1590e6['body'],{'raw':_0x1590e6[_0x6563('0x1d')]?_0x1590e6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1590e6[_0x6563('0x1d')]?_0x1590e6[_0x6563('0x1d')][_0x6563('0x21')]||null:null,'attributes':_0x1590e6[_0x6563('0x1d')]?_0x1590e6[_0x6563('0x1d')]['attributes']||null:null,'limit':_0x1590e6[_0x6563('0x1d')]?_0x1590e6['options']['limit']||null:null})[_0x6563('0x1e')](function(_0x35af37){logger[_0x6563('0x10')](_0x6563('0x1f'),_0x1590e6);logger[_0x6563('0x13')](_0x6563('0x1f'),_0x1590e6,JSON[_0x6563('0x15')](_0x35af37));_0x365b16(_0x35af37);})[_0x6563('0x22')](function(_0x101b24){logger[_0x6563('0x16')]('UpdateFaxMessage',_0x101b24[_0x6563('0x18')],_0x1590e6);_0x28252d(_0x5e5aeb[_0x6563('0x16')](0x1f4,_0x101b24[_0x6563('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 5d7c044..49d8958 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 _0xee91=['./faxMessage.events','remove','update','emit','removeListener','length','faxMessage:'];(function(_0x2e250d,_0x547560){var _0x3b71df=function(_0x6b1e9f){while(--_0x6b1e9f){_0x2e250d['push'](_0x2e250d['shift']());}};_0x3b71df(++_0x547560);}(_0xee91,0xfc));var _0x1ee9=function(_0xcd2dad,_0x12e3db){_0xcd2dad=_0xcd2dad-0x0;var _0x3677bd=_0xee91[_0xcd2dad];return _0x3677bd;};'use strict';var FaxMessageEvents=require(_0x1ee9('0x0'));var events=['save',_0x1ee9('0x1'),_0x1ee9('0x2')];function createListener(_0x1e0430,_0x4959d4){return function(_0x1e5cbd){_0x4959d4[_0x1ee9('0x3')](_0x1e0430,_0x1e5cbd);};}function removeListener(_0x2e56fa,_0x2b8b36){return function(){FaxMessageEvents[_0x1ee9('0x4')](_0x2e56fa,_0x2b8b36);};}exports['register']=function(_0x8bb6d6){for(var _0x138edb=0x0,_0x31f08d=events[_0x1ee9('0x5')];_0x138edb<_0x31f08d;_0x138edb++){var _0x472e42=events[_0x138edb];var _0x1e7bfb=createListener(_0x1ee9('0x6')+_0x472e42,_0x8bb6d6);FaxMessageEvents['on'](_0x472e42,_0x1e7bfb);}}; \ No newline at end of file +var _0x178a=['length','./faxMessage.events','remove','update','removeListener','register'];(function(_0x55e2fe,_0x55782c){var _0x4ac3be=function(_0x7e9a04){while(--_0x7e9a04){_0x55e2fe['push'](_0x55e2fe['shift']());}};_0x4ac3be(++_0x55782c);}(_0x178a,0xc1));var _0xa178=function(_0x47b425,_0x344bd8){_0x47b425=_0x47b425-0x0;var _0x4446c8=_0x178a[_0x47b425];return _0x4446c8;};'use strict';var FaxMessageEvents=require(_0xa178('0x0'));var events=['save',_0xa178('0x1'),_0xa178('0x2')];function createListener(_0x44eacf,_0xe6e3e8){return function(_0x2f1826){_0xe6e3e8['emit'](_0x44eacf,_0x2f1826);};}function removeListener(_0x3977fc,_0x3fde86){return function(){FaxMessageEvents[_0xa178('0x3')](_0x3977fc,_0x3fde86);};}exports[_0xa178('0x4')]=function(_0x5bd443){for(var _0x2d4b2f=0x0,_0x46188f=events[_0xa178('0x5')];_0x2d4b2f<_0x46188f;_0x2d4b2f++){var _0x163282=events[_0x2d4b2f];var _0x156435=createListener('faxMessage:'+_0x163282,_0x5bd443);FaxMessageEvents['on'](_0x163282,_0x156435);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e169249..7db5337 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 _0xb43b=['update','/:id/reject','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated','describe','get','/:id','show','download','post','tracked','fax','create','put'];(function(_0x334b2d,_0x5fb924){var _0x5f2537=function(_0x5eb786){while(--_0x5eb786){_0x334b2d['push'](_0x334b2d['shift']());}};_0x5f2537(++_0x5fb924);}(_0xb43b,0x1b2));var _0xbb43=function(_0x76d91a,_0xb1761e){_0x76d91a=_0x76d91a-0x0;var _0x5b6b95=_0xb43b[_0x76d91a];return _0x5b6b95;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0xd')]('/:id/download',auth[_0xbb43('0xb')](),controller[_0xbb43('0x10')]);router[_0xbb43('0x11')]('/',auth[_0xbb43('0xb')](),interaction[_0xbb43('0x12')](_0xbb43('0x13'),'faxmessage:create'),controller[_0xbb43('0x14')]);router[_0xbb43('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xbb43('0x16')]);router['put']('/:id/accept',auth[_0xbb43('0xb')](),controller['accept']);router[_0xbb43('0x15')](_0xbb43('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf72b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','express'];(function(_0x5e2723,_0xbb2bc9){var _0x5bd6ba=function(_0x28de04){while(--_0x28de04){_0x5e2723['push'](_0x5e2723['shift']());}};_0x5bd6ba(++_0xbb2bc9);}(_0xf72b,0x1d9));var _0xbf72=function(_0x286b06,_0x52df06){_0x286b06=_0x286b06-0x0;var _0x5f5bf7=_0xf72b[_0x286b06];return _0x5f5bf7;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['get'](_0xbf72('0xe'),auth[_0xbf72('0x9')](),controller['download']);router[_0xbf72('0xf')]('/',auth[_0xbf72('0x9')](),interaction[_0xbf72('0x10')](_0xbf72('0x11'),_0xbf72('0x12')),controller[_0xbf72('0x13')]);router[_0xbf72('0x14')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0x15')]);router[_0xbf72('0x14')](_0xbf72('0x16'),auth['isAuthenticated'](),controller[_0xbf72('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xbf72('0x18')]);router[_0xbf72('0x19')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x1a')]);module[_0xbf72('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index f345698..faf2823 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 _0x1c1a=['sequelize','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x390bd8,_0x32e2a7){var _0x41fdd8=function(_0x4d9334){while(--_0x4d9334){_0x390bd8['push'](_0x390bd8['shift']());}};_0x41fdd8(++_0x32e2a7);}(_0x1c1a,0x1f1));var _0xa1c1=function(_0x2b0f4a,_0x38b501){_0x2b0f4a=_0x2b0f4a-0x0;var _0x483605=_0x1c1a[_0x2b0f4a];return _0x483605;};'use strict';var Sequelize=require(_0xa1c1('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1c1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa1c1('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa1c1('0x3')](_0xa1c1('0x4'),_0xa1c1('0x5'),_0xa1c1('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa1c1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0d89=['roundrobin','exports','name','STRING','INTEGER','rrmemory','beepall'];(function(_0x229280,_0x50fa03){var _0x110532=function(_0x453b43){while(--_0x453b43){_0x229280['push'](_0x229280['shift']());}};_0x110532(++_0x50fa03);}(_0x0d89,0x190));var _0x90d8=function(_0x57fd08,_0x413740){_0x57fd08=_0x57fd08-0x0;var _0x26c3b8=_0x0d89[_0x57fd08];return _0x26c3b8;};'use strict';var Sequelize=require('sequelize');module[_0x90d8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x90d8('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x90d8('0x2')]},'timeout':{'type':Sequelize[_0x90d8('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x90d8('0x4'),_0x90d8('0x5'),_0x90d8('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x90d8('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 4a602c5..4568dfa 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 _0x2650=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','FaxQueues','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxQueue','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','pick','User','UserId','agent','faxPause','format','%s/%s','createdAt','updatedAt','Team','getTeams','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x167205,_0x233399){var _0x15d96d=function(_0x4b1c){while(--_0x4b1c){_0x167205['push'](_0x167205['shift']());}};_0x15d96d(++_0x233399);}(_0x2650,0x76));var _0x0265=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x2650[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x0265('0x0'));var rimraf=require(_0x0265('0x1'));var zipdir=require(_0x0265('0x2'));var jsonpatch=require(_0x0265('0x3'));var rp=require(_0x0265('0x4'));var moment=require(_0x0265('0x5'));var BPromise=require(_0x0265('0x6'));var Mustache=require(_0x0265('0x7'));var util=require(_0x0265('0x8'));var path=require(_0x0265('0x9'));var sox=require(_0x0265('0xa'));var csv=require(_0x0265('0xb'));var ejs=require(_0x0265('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0265('0xd'));var squel=require('squel');var crypto=require(_0x0265('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0265('0xb'));var querystring=require(_0x0265('0xf'));var Papa=require(_0x0265('0x10'));var Redis=require('ioredis');var authService=require(_0x0265('0x11'));var qs=require(_0x0265('0x12'));var as=require(_0x0265('0x13'));var hardwareService=require(_0x0265('0x14'));var logger=require(_0x0265('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0265('0x16'));var licenseUtil=require(_0x0265('0x17'));var db=require('../../mysqldb')['db'];config[_0x0265('0x18')]=_[_0x0265('0x19')](config[_0x0265('0x18')],{'host':_0x0265('0x1a'),'port':0x18eb});var socket=require(_0x0265('0x1b'))(new Redis(config[_0x0265('0x18')]));require('./faxQueue.socket')[_0x0265('0x1c')](socket);function respondWithStatusCode(_0x43454f,_0x289ab2){_0x289ab2=_0x289ab2||0xcc;return function(_0x16f80c){if(_0x16f80c){return _0x43454f[_0x0265('0x1d')](_0x289ab2);}return _0x43454f[_0x0265('0x1e')](_0x289ab2)[_0x0265('0x1f')]();};}function respondWithResult(_0x40c7a6,_0x43431f){_0x43431f=_0x43431f||0xc8;return function(_0xfc82c0){if(_0xfc82c0){return _0x40c7a6[_0x0265('0x1e')](_0x43431f)[_0x0265('0x20')](_0xfc82c0);}};}function respondWithFilteredResult(_0x3f3e9a,_0x9f523c){return function(_0x30e506){if(_0x30e506){var _0x522bbe=typeof _0x9f523c['offset']===_0x0265('0x21')&&typeof _0x9f523c['limit']===_0x0265('0x21');var _0x4f76b6=_0x30e506['count'];var _0x51dee1=_0x522bbe?0x0:_0x9f523c['offset'];var _0x13b30f=_0x522bbe?_0x30e506[_0x0265('0x22')]:_0x9f523c[_0x0265('0x23')]+_0x9f523c[_0x0265('0x24')];var _0x47ffc3;if(_0x13b30f>=_0x4f76b6){_0x13b30f=_0x4f76b6;_0x47ffc3=0xc8;}else{_0x47ffc3=0xce;}_0x3f3e9a['status'](_0x47ffc3);return _0x3f3e9a[_0x0265('0x25')](_0x0265('0x26'),_0x51dee1+'-'+_0x13b30f+'/'+_0x4f76b6)[_0x0265('0x20')](_0x30e506);}return null;};}function patchUpdates(_0x1aeb78){return function(_0x1c6297){try{jsonpatch['apply'](_0x1c6297,_0x1aeb78,!![]);}catch(_0x34ddce){return BPromise[_0x0265('0x27')](_0x34ddce);}return _0x1c6297[_0x0265('0x28')]();};}function saveUpdates(_0xdca986,_0x257e6b){return function(_0x2f57e8){if(_0x2f57e8){return _0x2f57e8['update'](_0xdca986)[_0x0265('0x29')](function(_0x28673d){return _0x28673d;});}return null;};}function removeEntity(_0x1b3218,_0x3ef3e7){return function(_0x3c224c){if(_0x3c224c){return _0x3c224c[_0x0265('0x2a')]()['then'](function(){var _0x557f20=_0x3c224c[_0x0265('0x2b')]({'plain':!![]});var _0x37dc1b=_0x0265('0x2c');return db[_0x0265('0x2d')]['destroy']({'where':{'type':_0x37dc1b,'resourceId':_0x557f20['id']}})[_0x0265('0x29')](function(){return _0x3c224c;});})[_0x0265('0x29')](function(){_0x1b3218['status'](0xcc)[_0x0265('0x1f')]();});}};}function handleEntityNotFound(_0x3d24db,_0x1ba5eb){return function(_0x391d59){if(!_0x391d59){_0x3d24db['sendStatus'](0x194);}return _0x391d59;};}function handleError(_0x3cbb84,_0x3c901f){_0x3c901f=_0x3c901f||0x1f4;return function(_0x2b8d79){logger['error'](_0x2b8d79['stack']);if(_0x2b8d79[_0x0265('0x2e')]){delete _0x2b8d79[_0x0265('0x2e')];}_0x3cbb84['status'](_0x3c901f)[_0x0265('0x2f')](_0x2b8d79);};}exports[_0x0265('0x30')]=function(_0x3ed438,_0x390eca){var _0xf2865={},_0x3a7413={},_0x73936a={'count':0x0,'rows':[]};var _0x4e8047=_[_0x0265('0x31')](db['FaxQueue'][_0x0265('0x32')],function(_0x4702b2){return{'name':_0x4702b2[_0x0265('0x33')],'type':_0x4702b2[_0x0265('0x34')][_0x0265('0x35')]};});_0x3a7413[_0x0265('0x36')]=_[_0x0265('0x31')](_0x4e8047,_0x0265('0x2e'));_0x3a7413['query']=_['keys'](_0x3ed438[_0x0265('0x37')]);_0x3a7413[_0x0265('0x38')]=_['intersection'](_0x3a7413[_0x0265('0x36')],_0x3a7413[_0x0265('0x37')]);_0xf2865['attributes']=_[_0x0265('0x39')](_0x3a7413['model'],qs[_0x0265('0x3a')](_0x3ed438[_0x0265('0x37')]['fields']));_0xf2865['attributes']=_0xf2865['attributes']['length']?_0xf2865[_0x0265('0x3b')]:_0x3a7413[_0x0265('0x36')];if(!_0x3ed438['query']['hasOwnProperty'](_0x0265('0x3c'))){_0xf2865[_0x0265('0x24')]=qs[_0x0265('0x24')](_0x3ed438[_0x0265('0x37')][_0x0265('0x24')]);_0xf2865[_0x0265('0x23')]=qs[_0x0265('0x23')](_0x3ed438[_0x0265('0x37')][_0x0265('0x23')]);}_0xf2865[_0x0265('0x3d')]=qs[_0x0265('0x3e')](_0x3ed438[_0x0265('0x37')][_0x0265('0x3e')]);_0xf2865[_0x0265('0x3f')]=qs[_0x0265('0x38')](_['pick'](_0x3ed438[_0x0265('0x37')],_0x3a7413['filters']),_0x4e8047);if(_0x3ed438[_0x0265('0x37')][_0x0265('0x40')]){_0xf2865['where']=_[_0x0265('0x41')](_0xf2865[_0x0265('0x3f')],{'$or':_[_0x0265('0x31')](_0x4e8047,function(_0x3cd0c5){if(_0x3cd0c5[_0x0265('0x34')]!==_0x0265('0x42')){var _0x3b17dd={};_0x3b17dd[_0x3cd0c5[_0x0265('0x2e')]]={'$like':'%'+_0x3ed438[_0x0265('0x37')][_0x0265('0x40')]+'%'};return _0x3b17dd;}})});}_0xf2865=_['merge']({},_0xf2865,_0x3ed438[_0x0265('0x43')]);var _0x16d269={'where':_0xf2865[_0x0265('0x3f')]};return db[_0x0265('0x44')][_0x0265('0x22')](_0x16d269)[_0x0265('0x29')](function(_0x2c4b8d){_0x73936a[_0x0265('0x22')]=_0x2c4b8d;if(_0x3ed438[_0x0265('0x37')][_0x0265('0x45')]){_0xf2865[_0x0265('0x46')]=[{'all':!![]}];}return db[_0x0265('0x44')][_0x0265('0x47')](_0xf2865);})['then'](function(_0x2a2aa5){_0x73936a[_0x0265('0x48')]=_0x2a2aa5;return _0x73936a;})['then'](respondWithFilteredResult(_0x390eca,_0xf2865))['catch'](handleError(_0x390eca,null));};exports[_0x0265('0x49')]=function(_0xd991b8,_0x2f34a3){var _0xb47a65={'raw':!![],'where':{'id':_0xd991b8[_0x0265('0x4a')]['id']}},_0x18cde6={};_0x18cde6[_0x0265('0x36')]=_[_0x0265('0x4b')](db[_0x0265('0x44')]['rawAttributes']);_0x18cde6[_0x0265('0x37')]=_[_0x0265('0x4b')](_0xd991b8[_0x0265('0x37')]);_0x18cde6[_0x0265('0x38')]=_['intersection'](_0x18cde6[_0x0265('0x36')],_0x18cde6[_0x0265('0x37')]);_0xb47a65[_0x0265('0x3b')]=_['intersection'](_0x18cde6[_0x0265('0x36')],qs['fields'](_0xd991b8[_0x0265('0x37')]['fields']));_0xb47a65[_0x0265('0x3b')]=_0xb47a65[_0x0265('0x3b')][_0x0265('0x4c')]?_0xb47a65[_0x0265('0x3b')]:_0x18cde6[_0x0265('0x36')];if(_0xd991b8['query']['includeAll']){_0xb47a65[_0x0265('0x46')]=[{'all':!![]}];}_0xb47a65=_[_0x0265('0x41')]({},_0xb47a65,_0xd991b8[_0x0265('0x43')]);return db[_0x0265('0x44')][_0x0265('0x4d')](_0xb47a65)[_0x0265('0x29')](handleEntityNotFound(_0x2f34a3,null))[_0x0265('0x29')](respondWithResult(_0x2f34a3,null))[_0x0265('0x4e')](handleError(_0x2f34a3,null));};exports[_0x0265('0x4f')]=function(_0x17cfd9,_0x43db8b){return db[_0x0265('0x44')][_0x0265('0x4f')](_0x17cfd9[_0x0265('0x50')],{})[_0x0265('0x29')](function(_0x25d445){var _0x7dcee6=_0x17cfd9[_0x0265('0x51')][_0x0265('0x2b')]({'plain':!![]});if(!_0x7dcee6)throw new Error(_0x0265('0x52'));if(_0x7dcee6[_0x0265('0x53')]===_0x0265('0x51')){var _0x5a4f37=_0x25d445[_0x0265('0x2b')]({'plain':!![]});var _0x1dfe5d=_0x0265('0x2c');return db[_0x0265('0x54')][_0x0265('0x4d')]({'where':{'name':_0x1dfe5d,'userProfileId':_0x7dcee6[_0x0265('0x55')]},'raw':!![]})['then'](function(_0x3dc68f){if(_0x3dc68f&&_0x3dc68f['autoAssociation']===0x0){return db['UserProfileResource'][_0x0265('0x4f')]({'name':_0x5a4f37['name'],'resourceId':_0x5a4f37['id'],'type':_0x3dc68f['name'],'sectionId':_0x3dc68f['id']},{})[_0x0265('0x29')](function(){return _0x25d445;});}else{return _0x25d445;}})[_0x0265('0x4e')](function(_0x3e8e66){logger['error'](_0x0265('0x56'),_0x3e8e66);throw _0x3e8e66;});}return _0x25d445;})[_0x0265('0x29')](respondWithResult(_0x43db8b,0xc9))[_0x0265('0x4e')](handleError(_0x43db8b,null));};exports['update']=function(_0x2e25e2,_0x132e35){if(_0x2e25e2['body']['id']){delete _0x2e25e2[_0x0265('0x50')]['id'];}return db[_0x0265('0x44')]['find']({'where':{'id':_0x2e25e2[_0x0265('0x4a')]['id']}})[_0x0265('0x29')](handleEntityNotFound(_0x132e35,null))[_0x0265('0x29')](saveUpdates(_0x2e25e2[_0x0265('0x50')],null))[_0x0265('0x29')](respondWithResult(_0x132e35,null))[_0x0265('0x4e')](handleError(_0x132e35,null));};exports['destroy']=function(_0x40f581,_0x2cebe9){return db[_0x0265('0x44')][_0x0265('0x4d')]({'where':{'id':_0x40f581[_0x0265('0x4a')]['id']}})[_0x0265('0x29')](handleEntityNotFound(_0x2cebe9,null))[_0x0265('0x29')](removeEntity(_0x2cebe9,null))[_0x0265('0x4e')](handleError(_0x2cebe9,null));};exports[_0x0265('0x57')]=function(_0x4554c,_0x2bc869){return db[_0x0265('0x44')][_0x0265('0x57')]()[_0x0265('0x29')](respondWithResult(_0x2bc869,null))[_0x0265('0x4e')](handleError(_0x2bc869,null));};exports[_0x0265('0x58')]=function(_0x5051ac,_0x2a31b7,_0x498fe3){var _0x179ca3={'raw':!![],'where':{}},_0x4143ba={},_0x12019c;return db['FaxQueue'][_0x0265('0x59')]({'where':{'id':_0x5051ac[_0x0265('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2a31b7,null))[_0x0265('0x29')](function(_0x368c26){if(_0x368c26){_0x12019c=_0x368c26[_0x0265('0x2b')]({'plain':!![]});_0x4143ba['model']=_[_0x0265('0x4b')](db[_0x0265('0x5a')][_0x0265('0x32')]);_0x4143ba[_0x0265('0x37')]=_[_0x0265('0x4b')](_0x5051ac[_0x0265('0x37')]);_0x4143ba['filters']=_['intersection'](_0x4143ba[_0x0265('0x36')],_0x4143ba[_0x0265('0x37')]);_0x179ca3[_0x0265('0x3b')]=_[_0x0265('0x39')](_0x4143ba['model'],qs[_0x0265('0x3a')](_0x5051ac['query'][_0x0265('0x3a')]));_0x179ca3[_0x0265('0x3b')]=_0x179ca3['attributes'][_0x0265('0x4c')]?_0x179ca3[_0x0265('0x3b')]:_0x4143ba[_0x0265('0x36')];if(!_0x5051ac['query'][_0x0265('0x5b')](_0x0265('0x3c'))){_0x179ca3[_0x0265('0x24')]=qs['limit'](_0x5051ac[_0x0265('0x37')]['limit']);_0x179ca3[_0x0265('0x23')]=qs[_0x0265('0x23')](_0x5051ac[_0x0265('0x37')][_0x0265('0x23')]);}_0x179ca3[_0x0265('0x3d')]=qs[_0x0265('0x3e')](_0x5051ac['query'][_0x0265('0x3e')]);_0x179ca3[_0x0265('0x3f')]=qs[_0x0265('0x38')](_[_0x0265('0x5c')](_0x5051ac['query'],_0x4143ba[_0x0265('0x38')]));_0x179ca3['where']['FaxQueueId']=_0x368c26['id'];if(_0x5051ac[_0x0265('0x37')][_0x0265('0x40')]){_0x179ca3[_0x0265('0x3f')]=_['merge'](_0x179ca3[_0x0265('0x3f')],{'$or':_['map'](_0x179ca3[_0x0265('0x3b')],function(_0x139884){var _0x5c57a4={};_0x5c57a4[_0x139884]={'$like':'%'+_0x5051ac[_0x0265('0x37')][_0x0265('0x40')]+'%'};return _0x5c57a4;})});}_0x179ca3=_[_0x0265('0x41')]({},_0x179ca3,_0x5051ac[_0x0265('0x43')]);return db['UserFaxQueue'][_0x0265('0x47')](_0x179ca3);}})[_0x0265('0x29')](function(_0x23c443){if(_0x23c443){return db[_0x0265('0x5d')]['findAndCountAll']({'where':{'id':_[_0x0265('0x31')](_0x23c443,_0x0265('0x5e')),'role':_0x0265('0x5f')},'attributes':['id','name',_0x0265('0x60'),'updatedAt','createdAt']});}})[_0x0265('0x29')](function(_0x40acb0){if(_0x40acb0){return{'count':_0x40acb0[_0x0265('0x22')],'rows':_[_0x0265('0x31')](_0x40acb0['rows'],function(_0x5ae871){return{'membername':_0x5ae871['name'],'UserId':_0x5ae871['id'],'queue_name':_0x12019c[_0x0265('0x2e')],'FaxQueueId':_0x12019c['id'],'interface':util[_0x0265('0x61')](_0x0265('0x62'),'SIP',_0x5ae871[_0x0265('0x2e')]),'penalty':0x0,'paused':_0x5ae871[_0x0265('0x60')],'createdAt':_0x5ae871[_0x0265('0x63')],'updatedAt':_0x5ae871[_0x0265('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0265('0x29')](respondWithFilteredResult(_0x2a31b7,_0x179ca3))[_0x0265('0x4e')](handleError(_0x2a31b7,null));};exports['getTeams']=function(_0x471873,_0x3273f6,_0x2e4165){var _0x480936={};var _0x54df79={};var _0x4900cc;var _0x59a3a5;return db[_0x0265('0x44')]['findOne']({'where':{'id':_0x471873[_0x0265('0x4a')]['id']}})[_0x0265('0x29')](handleEntityNotFound(_0x3273f6,null))['then'](function(_0x1668d2){if(_0x1668d2){_0x4900cc=_0x1668d2;_0x54df79[_0x0265('0x36')]=_[_0x0265('0x4b')](db[_0x0265('0x65')][_0x0265('0x32')]);_0x54df79[_0x0265('0x37')]=_[_0x0265('0x4b')](_0x471873[_0x0265('0x37')]);_0x54df79[_0x0265('0x38')]=_[_0x0265('0x39')](_0x54df79['model'],_0x54df79[_0x0265('0x37')]);_0x480936[_0x0265('0x3b')]=_[_0x0265('0x39')](_0x54df79[_0x0265('0x36')],qs[_0x0265('0x3a')](_0x471873[_0x0265('0x37')][_0x0265('0x3a')]));_0x480936[_0x0265('0x3b')]=_0x480936['attributes'][_0x0265('0x4c')]?_0x480936['attributes']:_0x54df79[_0x0265('0x36')];_0x480936['order']=qs[_0x0265('0x3e')](_0x471873[_0x0265('0x37')][_0x0265('0x3e')]);_0x480936['where']=qs[_0x0265('0x38')](_['pick'](_0x471873[_0x0265('0x37')],_0x54df79['filters']));if(_0x471873[_0x0265('0x37')][_0x0265('0x40')]){_0x480936['where']=_['merge'](_0x480936['where'],{'$or':_[_0x0265('0x31')](_0x480936[_0x0265('0x3b')],function(_0x577cf1){var _0x1d19f9={};_0x1d19f9[_0x577cf1]={'$like':'%'+_0x471873[_0x0265('0x37')][_0x0265('0x40')]+'%'};return _0x1d19f9;})});}_0x480936=_[_0x0265('0x41')]({},_0x480936,_0x471873[_0x0265('0x43')]);return _0x4900cc[_0x0265('0x66')](_0x480936);}})['then'](function(_0x7d2e29){if(_0x7d2e29){_0x59a3a5=_0x7d2e29[_0x0265('0x4c')];if(!_0x471873['query'][_0x0265('0x5b')](_0x0265('0x3c'))){_0x480936['limit']=qs[_0x0265('0x24')](_0x471873[_0x0265('0x37')][_0x0265('0x24')]);_0x480936[_0x0265('0x23')]=qs[_0x0265('0x23')](_0x471873[_0x0265('0x37')][_0x0265('0x23')]);}return _0x4900cc['getTeams'](_0x480936);}})[_0x0265('0x29')](function(_0x51ad89){if(_0x51ad89){return _0x51ad89?{'count':_0x59a3a5,'rows':_0x51ad89}:null;}})[_0x0265('0x29')](respondWithResult(_0x3273f6,null))[_0x0265('0x4e')](handleError(_0x3273f6,null));};exports[_0x0265('0x67')]=function(_0x3e5f52,_0x210f12,_0x2d00a9){var _0x599967=_0x3e5f52[_0x0265('0x50')]['ids'];return db[_0x0265('0x65')][_0x0265('0x47')]({'where':{'id':_0x599967},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0265('0x68'),'attributes':['id',_0x0265('0x2e'),_0x0265('0x69'),'voicePause',_0x0265('0x6a')],'raw':!![]}]})['then'](function(_0x12baf6){if(_0x12baf6){var _0x3cd670=_[_0x0265('0x6b')](_0x12baf6,function(_0x5f1c21){var _0x57e7fd=_0x5f1c21[_0x0265('0x2b')]({'plain':!![]});return _0x57e7fd[_0x0265('0x68')];});return db[_0x0265('0x44')][_0x0265('0x4d')]({'where':{'id':_0x3e5f52['params']['id']}})[_0x0265('0x29')](function(_0x3b7f2e){return db[_0x0265('0x6c')][_0x0265('0x6d')](function(_0x3c584a){return _0x3b7f2e[_0x0265('0x67')](_0x599967,{'transaction':_0x3c584a})['then'](function(){return BPromise[_0x0265('0x6e')](_0x3cd670,function(_0x35132f){return db[_0x0265('0x5a')][_0x0265('0x6f')]({'where':{'UserId':_0x35132f['id'],'FaxQueueId':_0x3e5f52[_0x0265('0x4a')]['id']},'transaction':_0x3c584a});});})[_0x0265('0x29')](function(){_0x3cd670[_0x0265('0x70')](function(_0x2694d4){socket[_0x0265('0x71')](_0x0265('0x72'),{'UserId':_0x2694d4['id'],'FaxQueueId':_0x3b7f2e['id']});});});});});}})[_0x0265('0x29')](respondWithStatusCode(_0x210f12,null))[_0x0265('0x4e')](handleError(_0x210f12,null));};exports[_0x0265('0x73')]=function(_0x3f51af,_0x2c2e14,_0x4db4e2){return db['Team']['findAll']({'where':{'id':_0x3f51af[_0x0265('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0265('0x29')](handleEntityNotFound(_0x2c2e14,null))[_0x0265('0x29')](function(_0x34b1b4){var _0x42eb77=_[_0x0265('0x31')](_0x34b1b4,'id');var _0x32b4e9=[];var _0x1eb22e=[];var _0x4e2295=squel[_0x0265('0x74')]();_0x4e2295['field'](_0x0265('0x75'))[_0x0265('0x76')]('team_has_fax_queues','tq')[_0x0265('0x77')](_0x0265('0x78'),'ut',_0x0265('0x79'))[_0x0265('0x3f')](_0x0265('0x7a'),_0x3f51af[_0x0265('0x4a')]['id']);for(var _0x339dc2=0x0;_0x339dc2<_0x34b1b4[_0x0265('0x4c')];_0x339dc2+=0x1){let _0x1f7e04=_0x34b1b4[_0x339dc2];for(var _0x583941=0x0;_0x583941<_0x1f7e04['Agents']['length'];_0x583941+=0x1){let _0x54eeac=_0x1f7e04[_0x0265('0x68')][_0x583941];var _0x1281c3=_0x4e2295[_0x0265('0x7b')]();_0x1281c3[_0x0265('0x3f')](_0x0265('0x7c'),_0x54eeac['id']);_0x1eb22e[_0x0265('0x7d')](db['sequelize']['query'](_0x1281c3['toString'](),{'type':db[_0x0265('0x6c')][_0x0265('0x7e')]['SELECT']})[_0x0265('0x29')](function(_0x48d93d){if(_0x48d93d['length']===0x1){return _0x54eeac['id'];}else{var _0x1ce527=_['every'](_['map'](_0x48d93d,_0x0265('0x7f')),function(_0x466476){return _[_0x0265('0x80')](_0x42eb77,_0x466476);});if(_0x1ce527){return _0x54eeac['id'];}}}));}}return BPromise[_0x0265('0x81')](_0x1eb22e)['then'](function(_0x616648){_0x32b4e9=_(_0x32b4e9)[_0x0265('0x82')](_0x616648)[_0x0265('0x83')]()['value']();return db[_0x0265('0x44')][_0x0265('0x4d')]({'where':{'id':_0x3f51af[_0x0265('0x4a')]['id']}})[_0x0265('0x29')](function(_0x4a6004){return db[_0x0265('0x6c')][_0x0265('0x6d')](function(_0x11b264){return _0x4a6004['removeTeams'](_0x3f51af[_0x0265('0x37')][_0x0265('0x84')],{'transaction':_0x11b264})['then'](function(){if(!_[_0x0265('0x85')](_0x32b4e9)){return _0x4a6004[_0x0265('0x86')](_0x32b4e9,{'transaction':_0x11b264});}})[_0x0265('0x29')](function(){_0x32b4e9[_0x0265('0x70')](function(_0x417596){socket['emit']('userFaxQueue:remove',{'UserId':_0x417596,'FaxQueueId':_0x4a6004['id']});});});});});});})[_0x0265('0x29')](respondWithStatusCode(_0x2c2e14,null))[_0x0265('0x4e')](handleError(_0x2c2e14,null));};exports[_0x0265('0x87')]=function(_0x3fa4a2,_0x53eae1,_0x35f384){return db['FaxQueue'][_0x0265('0x4d')]({'where':{'id':_0x3fa4a2[_0x0265('0x4a')]['id']}})[_0x0265('0x29')](handleEntityNotFound(_0x53eae1,null))[_0x0265('0x29')](function(_0x40ad9a){if(_0x40ad9a){return _0x40ad9a[_0x0265('0x87')](_0x3fa4a2[_0x0265('0x50')][_0x0265('0x84')],_[_0x0265('0x88')](_0x3fa4a2[_0x0265('0x50')],[_0x0265('0x84'),'id'])||{})[_0x0265('0x89')](function(_0x4703d1){for(var _0x4f1dca=0x0;_0x4f1dca<_0x3fa4a2[_0x0265('0x50')]['ids'][_0x0265('0x4c')];_0x4f1dca+=0x1){socket[_0x0265('0x71')](_0x0265('0x72'),{'UserId':Number(_0x3fa4a2[_0x0265('0x50')][_0x0265('0x84')][_0x4f1dca]),'FaxQueueId':Number(_0x3fa4a2['params']['id'])});}return _0x4703d1;});}})[_0x0265('0x29')](respondWithResult(_0x53eae1,null))[_0x0265('0x4e')](handleError(_0x53eae1,null));};exports[_0x0265('0x86')]=function(_0x5b9800,_0x5e0f75,_0x1baea8){return db[_0x0265('0x44')][_0x0265('0x4d')]({'where':{'id':_0x5b9800[_0x0265('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5e0f75,null))[_0x0265('0x29')](function(_0x53a065){if(_0x53a065){return _0x53a065['removeAgents'](_0x5b9800['query']['ids'])['then'](function(){if(_[_0x0265('0x8a')](_0x5b9800['query'][_0x0265('0x84')])){for(var _0x5dc677=0x0;_0x5dc677<_0x5b9800['query']['ids']['length'];_0x5dc677+=0x1){socket[_0x0265('0x71')]('userFaxQueue:remove',{'UserId':Number(_0x5b9800['query'][_0x0265('0x84')][_0x5dc677]),'FaxQueueId':Number(_0x5b9800[_0x0265('0x4a')]['id'])});}}else{socket[_0x0265('0x71')](_0x0265('0x8b'),{'UserId':Number(_0x5b9800[_0x0265('0x37')][_0x0265('0x84')]),'FaxQueueId':Number(_0x5b9800['params']['id'])});}});}})[_0x0265('0x29')](respondWithStatusCode(_0x5e0f75,null))[_0x0265('0x4e')](handleError(_0x5e0f75,null));};exports[_0x0265('0x8c')]=function(_0x1d9fcb,_0x599c55,_0x18c4ed){var _0x3145a4={};var _0x25f542={};var _0x406305;var _0x46307e;return db[_0x0265('0x44')][_0x0265('0x59')]({'where':{'id':_0x1d9fcb[_0x0265('0x4a')]['id']}})[_0x0265('0x29')](handleEntityNotFound(_0x599c55,null))[_0x0265('0x29')](function(_0x6bb63){if(_0x6bb63){_0x406305=_0x6bb63;_0x25f542[_0x0265('0x36')]=_[_0x0265('0x4b')](db['User'][_0x0265('0x32')]);_0x25f542[_0x0265('0x37')]=_[_0x0265('0x4b')](_0x1d9fcb[_0x0265('0x37')]);_0x25f542[_0x0265('0x38')]=_[_0x0265('0x39')](_0x25f542[_0x0265('0x36')],_0x25f542[_0x0265('0x37')]);_0x3145a4[_0x0265('0x3b')]=_[_0x0265('0x39')](_0x25f542['model'],qs['fields'](_0x1d9fcb['query'][_0x0265('0x3a')]));_0x3145a4[_0x0265('0x3b')]=_0x3145a4[_0x0265('0x3b')][_0x0265('0x4c')]?_0x3145a4[_0x0265('0x3b')]:_0x25f542['model'];_0x3145a4['order']=qs[_0x0265('0x3e')](_0x1d9fcb[_0x0265('0x37')][_0x0265('0x3e')]);_0x3145a4[_0x0265('0x3f')]=qs[_0x0265('0x38')](_['pick'](_0x1d9fcb[_0x0265('0x37')],_0x25f542['filters']));if(_0x1d9fcb[_0x0265('0x37')]['filter']){_0x3145a4[_0x0265('0x3f')]=_[_0x0265('0x41')](_0x3145a4['where'],{'$or':_[_0x0265('0x31')](_0x3145a4[_0x0265('0x3b')],function(_0x522cd9){var _0x1eee1c={};_0x1eee1c[_0x522cd9]={'$like':'%'+_0x1d9fcb['query']['filter']+'%'};return _0x1eee1c;})});}_0x3145a4=_[_0x0265('0x41')]({},_0x3145a4,_0x1d9fcb[_0x0265('0x43')]);return _0x406305[_0x0265('0x8c')](_0x3145a4);}})[_0x0265('0x29')](function(_0x57dcfa){if(_0x57dcfa){_0x46307e=_0x57dcfa[_0x0265('0x4c')];if(!_0x1d9fcb['query'][_0x0265('0x5b')]('nolimit')){_0x3145a4[_0x0265('0x24')]=qs[_0x0265('0x24')](_0x1d9fcb[_0x0265('0x37')][_0x0265('0x24')]);_0x3145a4[_0x0265('0x23')]=qs[_0x0265('0x23')](_0x1d9fcb['query']['offset']);}return _0x406305['getAgents'](_0x3145a4);}})[_0x0265('0x29')](function(_0x525e1f){if(_0x525e1f){return _0x525e1f?{'count':_0x46307e,'rows':_0x525e1f}:null;}})[_0x0265('0x29')](respondWithResult(_0x599c55,null))[_0x0265('0x4e')](handleError(_0x599c55,null));}; \ No newline at end of file +var _0x5dce=['rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','FaxQueueId','User','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','Agents','clone','push','includes','all','union','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue'];(function(_0x1b7dfc,_0x50210c){var _0x134c30=function(_0x471dba){while(--_0x471dba){_0x1b7dfc['push'](_0x1b7dfc['shift']());}};_0x134c30(++_0x50210c);}(_0x5dce,0xe1));var _0xe5dc=function(_0x4cb1c7,_0x4b32e2){_0x4cb1c7=_0x4cb1c7-0x0;var _0x87785a=_0x5dce[_0x4cb1c7];return _0x87785a;};'use strict';var emlformat=require(_0xe5dc('0x0'));var rimraf=require(_0xe5dc('0x1'));var zipdir=require(_0xe5dc('0x2'));var jsonpatch=require(_0xe5dc('0x3'));var rp=require('request-promise');var moment=require(_0xe5dc('0x4'));var BPromise=require(_0xe5dc('0x5'));var Mustache=require(_0xe5dc('0x6'));var util=require(_0xe5dc('0x7'));var path=require('path');var sox=require(_0xe5dc('0x8'));var csv=require(_0xe5dc('0x9'));var ejs=require(_0xe5dc('0xa'));var fs=require('fs');var fs_extra=require(_0xe5dc('0xb'));var _=require(_0xe5dc('0xc'));var squel=require(_0xe5dc('0xd'));var crypto=require(_0xe5dc('0xe'));var jsforce=require(_0xe5dc('0xf'));var deskjs=require(_0xe5dc('0x10'));var toCsv=require(_0xe5dc('0x9'));var querystring=require('querystring');var Papa=require(_0xe5dc('0x11'));var Redis=require(_0xe5dc('0x12'));var authService=require(_0xe5dc('0x13'));var qs=require(_0xe5dc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe5dc('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xe5dc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe5dc('0x17'));var db=require(_0xe5dc('0x18'))['db'];config[_0xe5dc('0x19')]=_['defaults'](config[_0xe5dc('0x19')],{'host':_0xe5dc('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5dc('0x19')]));require('./faxQueue.socket')[_0xe5dc('0x1b')](socket);function respondWithStatusCode(_0x53e6c3,_0x12540d){_0x12540d=_0x12540d||0xcc;return function(_0x53ce39){if(_0x53ce39){return _0x53e6c3[_0xe5dc('0x1c')](_0x12540d);}return _0x53e6c3[_0xe5dc('0x1d')](_0x12540d)[_0xe5dc('0x1e')]();};}function respondWithResult(_0x1c1d44,_0x200953){_0x200953=_0x200953||0xc8;return function(_0xdf1b2){if(_0xdf1b2){return _0x1c1d44[_0xe5dc('0x1d')](_0x200953)[_0xe5dc('0x1f')](_0xdf1b2);}};}function respondWithFilteredResult(_0x429da3,_0x7490d7){return function(_0x160096){if(_0x160096){var _0x2bba61=typeof _0x7490d7[_0xe5dc('0x20')]===_0xe5dc('0x21')&&typeof _0x7490d7[_0xe5dc('0x22')]===_0xe5dc('0x21');var _0x220a2d=_0x160096[_0xe5dc('0x23')];var _0x240db1=_0x2bba61?0x0:_0x7490d7['offset'];var _0x52eb4d=_0x2bba61?_0x160096[_0xe5dc('0x23')]:_0x7490d7[_0xe5dc('0x20')]+_0x7490d7[_0xe5dc('0x22')];var _0x56f7ce;if(_0x52eb4d>=_0x220a2d){_0x52eb4d=_0x220a2d;_0x56f7ce=0xc8;}else{_0x56f7ce=0xce;}_0x429da3[_0xe5dc('0x1d')](_0x56f7ce);return _0x429da3[_0xe5dc('0x24')](_0xe5dc('0x25'),_0x240db1+'-'+_0x52eb4d+'/'+_0x220a2d)[_0xe5dc('0x1f')](_0x160096);}return null;};}function patchUpdates(_0x36ef81){return function(_0x2c265a){try{jsonpatch[_0xe5dc('0x26')](_0x2c265a,_0x36ef81,!![]);}catch(_0x2fcb96){return BPromise[_0xe5dc('0x27')](_0x2fcb96);}return _0x2c265a[_0xe5dc('0x28')]();};}function saveUpdates(_0x56dfeb,_0x1f02e4){return function(_0x5f0d5b){if(_0x5f0d5b){return _0x5f0d5b[_0xe5dc('0x29')](_0x56dfeb)['then'](function(_0x129e97){return _0x129e97;});}return null;};}function removeEntity(_0x30f77b,_0x4e9f61){return function(_0x570fd7){if(_0x570fd7){return _0x570fd7[_0xe5dc('0x2a')]()[_0xe5dc('0x2b')](function(){var _0x21b89c=_0x570fd7[_0xe5dc('0x2c')]({'plain':!![]});var _0x27150d=_0xe5dc('0x2d');return db[_0xe5dc('0x2e')][_0xe5dc('0x2a')]({'where':{'type':_0x27150d,'resourceId':_0x21b89c['id']}})['then'](function(){return _0x570fd7;});})[_0xe5dc('0x2b')](function(){_0x30f77b[_0xe5dc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x311e,_0x508198){return function(_0x1584b0){if(!_0x1584b0){_0x311e[_0xe5dc('0x1c')](0x194);}return _0x1584b0;};}function handleError(_0x3602f5,_0x3c5f39){_0x3c5f39=_0x3c5f39||0x1f4;return function(_0x1179bc){logger[_0xe5dc('0x2f')](_0x1179bc[_0xe5dc('0x30')]);if(_0x1179bc[_0xe5dc('0x31')]){delete _0x1179bc[_0xe5dc('0x31')];}_0x3602f5[_0xe5dc('0x1d')](_0x3c5f39)['send'](_0x1179bc);};}exports[_0xe5dc('0x32')]=function(_0x231090,_0x14e1cd){var _0x51db42={},_0x16b78b={},_0x384afd={'count':0x0,'rows':[]};var _0x5523c7=_[_0xe5dc('0x33')](db[_0xe5dc('0x34')][_0xe5dc('0x35')],function(_0x50dc0b){return{'name':_0x50dc0b[_0xe5dc('0x36')],'type':_0x50dc0b[_0xe5dc('0x37')][_0xe5dc('0x38')]};});_0x16b78b['model']=_['map'](_0x5523c7,_0xe5dc('0x31'));_0x16b78b['query']=_['keys'](_0x231090[_0xe5dc('0x39')]);_0x16b78b[_0xe5dc('0x3a')]=_[_0xe5dc('0x3b')](_0x16b78b[_0xe5dc('0x3c')],_0x16b78b['query']);_0x51db42[_0xe5dc('0x3d')]=_[_0xe5dc('0x3b')](_0x16b78b['model'],qs[_0xe5dc('0x3e')](_0x231090[_0xe5dc('0x39')][_0xe5dc('0x3e')]));_0x51db42[_0xe5dc('0x3d')]=_0x51db42[_0xe5dc('0x3d')][_0xe5dc('0x3f')]?_0x51db42[_0xe5dc('0x3d')]:_0x16b78b[_0xe5dc('0x3c')];if(!_0x231090['query'][_0xe5dc('0x40')](_0xe5dc('0x41'))){_0x51db42[_0xe5dc('0x22')]=qs[_0xe5dc('0x22')](_0x231090['query']['limit']);_0x51db42['offset']=qs[_0xe5dc('0x20')](_0x231090[_0xe5dc('0x39')]['offset']);}_0x51db42[_0xe5dc('0x42')]=qs[_0xe5dc('0x43')](_0x231090['query'][_0xe5dc('0x43')]);_0x51db42[_0xe5dc('0x44')]=qs[_0xe5dc('0x3a')](_[_0xe5dc('0x45')](_0x231090[_0xe5dc('0x39')],_0x16b78b[_0xe5dc('0x3a')]),_0x5523c7);if(_0x231090[_0xe5dc('0x39')][_0xe5dc('0x46')]){_0x51db42[_0xe5dc('0x44')]=_[_0xe5dc('0x47')](_0x51db42[_0xe5dc('0x44')],{'$or':_[_0xe5dc('0x33')](_0x5523c7,function(_0x56346f){if(_0x56346f['type']!=='VIRTUAL'){var _0x24fa64={};_0x24fa64[_0x56346f[_0xe5dc('0x31')]]={'$like':'%'+_0x231090['query'][_0xe5dc('0x46')]+'%'};return _0x24fa64;}})});}_0x51db42=_[_0xe5dc('0x47')]({},_0x51db42,_0x231090[_0xe5dc('0x48')]);var _0x196dac={'where':_0x51db42[_0xe5dc('0x44')]};return db[_0xe5dc('0x34')][_0xe5dc('0x23')](_0x196dac)['then'](function(_0x3a5bfe){_0x384afd[_0xe5dc('0x23')]=_0x3a5bfe;if(_0x231090[_0xe5dc('0x39')][_0xe5dc('0x49')]){_0x51db42[_0xe5dc('0x4a')]=[{'all':!![]}];}return db['FaxQueue'][_0xe5dc('0x4b')](_0x51db42);})['then'](function(_0x13aa21){_0x384afd['rows']=_0x13aa21;return _0x384afd;})['then'](respondWithFilteredResult(_0x14e1cd,_0x51db42))[_0xe5dc('0x4c')](handleError(_0x14e1cd,null));};exports[_0xe5dc('0x4d')]=function(_0x29c807,_0x57dce8){var _0x59d995={'raw':!![],'where':{'id':_0x29c807[_0xe5dc('0x4e')]['id']}},_0x1efad7={};_0x1efad7[_0xe5dc('0x3c')]=_[_0xe5dc('0x4f')](db[_0xe5dc('0x34')][_0xe5dc('0x35')]);_0x1efad7[_0xe5dc('0x39')]=_['keys'](_0x29c807[_0xe5dc('0x39')]);_0x1efad7[_0xe5dc('0x3a')]=_['intersection'](_0x1efad7[_0xe5dc('0x3c')],_0x1efad7['query']);_0x59d995['attributes']=_[_0xe5dc('0x3b')](_0x1efad7['model'],qs[_0xe5dc('0x3e')](_0x29c807[_0xe5dc('0x39')][_0xe5dc('0x3e')]));_0x59d995[_0xe5dc('0x3d')]=_0x59d995[_0xe5dc('0x3d')][_0xe5dc('0x3f')]?_0x59d995['attributes']:_0x1efad7[_0xe5dc('0x3c')];if(_0x29c807[_0xe5dc('0x39')][_0xe5dc('0x49')]){_0x59d995[_0xe5dc('0x4a')]=[{'all':!![]}];}_0x59d995=_['merge']({},_0x59d995,_0x29c807['options']);return db[_0xe5dc('0x34')][_0xe5dc('0x50')](_0x59d995)[_0xe5dc('0x2b')](handleEntityNotFound(_0x57dce8,null))[_0xe5dc('0x2b')](respondWithResult(_0x57dce8,null))[_0xe5dc('0x4c')](handleError(_0x57dce8,null));};exports[_0xe5dc('0x51')]=function(_0x3fd93d,_0x379c3c){return db[_0xe5dc('0x34')][_0xe5dc('0x51')](_0x3fd93d[_0xe5dc('0x52')],{})['then'](function(_0x49dd13){var _0x468e79=_0x3fd93d[_0xe5dc('0x53')][_0xe5dc('0x2c')]({'plain':!![]});if(!_0x468e79)throw new Error(_0xe5dc('0x54'));if(_0x468e79[_0xe5dc('0x55')]==='user'){var _0x3ef2d5=_0x49dd13[_0xe5dc('0x2c')]({'plain':!![]});var _0x5e2a78='FaxQueues';return db[_0xe5dc('0x56')]['find']({'where':{'name':_0x5e2a78,'userProfileId':_0x468e79['userProfileId']},'raw':!![]})[_0xe5dc('0x2b')](function(_0xbd4b34){if(_0xbd4b34&&_0xbd4b34['autoAssociation']===0x0){return db[_0xe5dc('0x2e')][_0xe5dc('0x51')]({'name':_0x3ef2d5[_0xe5dc('0x31')],'resourceId':_0x3ef2d5['id'],'type':_0xbd4b34[_0xe5dc('0x31')],'sectionId':_0xbd4b34['id']},{})[_0xe5dc('0x2b')](function(){return _0x49dd13;});}else{return _0x49dd13;}})[_0xe5dc('0x4c')](function(_0x3a56be){logger[_0xe5dc('0x2f')](_0xe5dc('0x57'),_0x3a56be);throw _0x3a56be;});}return _0x49dd13;})[_0xe5dc('0x2b')](respondWithResult(_0x379c3c,0xc9))[_0xe5dc('0x4c')](handleError(_0x379c3c,null));};exports[_0xe5dc('0x29')]=function(_0x1f1896,_0x281bee){if(_0x1f1896[_0xe5dc('0x52')]['id']){delete _0x1f1896[_0xe5dc('0x52')]['id'];}return db[_0xe5dc('0x34')][_0xe5dc('0x50')]({'where':{'id':_0x1f1896['params']['id']}})[_0xe5dc('0x2b')](handleEntityNotFound(_0x281bee,null))[_0xe5dc('0x2b')](saveUpdates(_0x1f1896[_0xe5dc('0x52')],null))[_0xe5dc('0x2b')](respondWithResult(_0x281bee,null))[_0xe5dc('0x4c')](handleError(_0x281bee,null));};exports[_0xe5dc('0x2a')]=function(_0x37a36e,_0x1110b7){return db[_0xe5dc('0x34')][_0xe5dc('0x50')]({'where':{'id':_0x37a36e[_0xe5dc('0x4e')]['id']}})[_0xe5dc('0x2b')](handleEntityNotFound(_0x1110b7,null))[_0xe5dc('0x2b')](removeEntity(_0x1110b7,null))[_0xe5dc('0x4c')](handleError(_0x1110b7,null));};exports[_0xe5dc('0x58')]=function(_0x3c893e,_0x2e769f){return db['FaxQueue']['describe']()[_0xe5dc('0x2b')](respondWithResult(_0x2e769f,null))[_0xe5dc('0x4c')](handleError(_0x2e769f,null));};exports['getMembers']=function(_0xa042df,_0x5517cb,_0x75c702){var _0xa85a8b={'raw':!![],'where':{}},_0x3d4fa5={},_0x17630a;return db[_0xe5dc('0x34')][_0xe5dc('0x59')]({'where':{'id':_0xa042df[_0xe5dc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5517cb,null))[_0xe5dc('0x2b')](function(_0x3469f1){if(_0x3469f1){_0x17630a=_0x3469f1[_0xe5dc('0x2c')]({'plain':!![]});_0x3d4fa5[_0xe5dc('0x3c')]=_[_0xe5dc('0x4f')](db[_0xe5dc('0x5a')][_0xe5dc('0x35')]);_0x3d4fa5['query']=_[_0xe5dc('0x4f')](_0xa042df[_0xe5dc('0x39')]);_0x3d4fa5['filters']=_[_0xe5dc('0x3b')](_0x3d4fa5[_0xe5dc('0x3c')],_0x3d4fa5['query']);_0xa85a8b[_0xe5dc('0x3d')]=_[_0xe5dc('0x3b')](_0x3d4fa5[_0xe5dc('0x3c')],qs[_0xe5dc('0x3e')](_0xa042df['query']['fields']));_0xa85a8b[_0xe5dc('0x3d')]=_0xa85a8b[_0xe5dc('0x3d')][_0xe5dc('0x3f')]?_0xa85a8b[_0xe5dc('0x3d')]:_0x3d4fa5[_0xe5dc('0x3c')];if(!_0xa042df[_0xe5dc('0x39')]['hasOwnProperty'](_0xe5dc('0x41'))){_0xa85a8b[_0xe5dc('0x22')]=qs[_0xe5dc('0x22')](_0xa042df[_0xe5dc('0x39')][_0xe5dc('0x22')]);_0xa85a8b[_0xe5dc('0x20')]=qs[_0xe5dc('0x20')](_0xa042df[_0xe5dc('0x39')][_0xe5dc('0x20')]);}_0xa85a8b[_0xe5dc('0x42')]=qs[_0xe5dc('0x43')](_0xa042df[_0xe5dc('0x39')]['sort']);_0xa85a8b[_0xe5dc('0x44')]=qs['filters'](_[_0xe5dc('0x45')](_0xa042df[_0xe5dc('0x39')],_0x3d4fa5[_0xe5dc('0x3a')]));_0xa85a8b['where'][_0xe5dc('0x5b')]=_0x3469f1['id'];if(_0xa042df[_0xe5dc('0x39')][_0xe5dc('0x46')]){_0xa85a8b['where']=_[_0xe5dc('0x47')](_0xa85a8b[_0xe5dc('0x44')],{'$or':_['map'](_0xa85a8b[_0xe5dc('0x3d')],function(_0x3e782f){var _0x32d113={};_0x32d113[_0x3e782f]={'$like':'%'+_0xa042df[_0xe5dc('0x39')][_0xe5dc('0x46')]+'%'};return _0x32d113;})});}_0xa85a8b=_['merge']({},_0xa85a8b,_0xa042df[_0xe5dc('0x48')]);return db[_0xe5dc('0x5a')][_0xe5dc('0x4b')](_0xa85a8b);}})['then'](function(_0x295a93){if(_0x295a93){return db[_0xe5dc('0x5c')]['findAndCountAll']({'where':{'id':_[_0xe5dc('0x33')](_0x295a93,'UserId'),'role':_0xe5dc('0x5d')},'attributes':['id',_0xe5dc('0x31'),_0xe5dc('0x5e'),_0xe5dc('0x5f'),_0xe5dc('0x60')]});}})[_0xe5dc('0x2b')](function(_0x1c4ad0){if(_0x1c4ad0){return{'count':_0x1c4ad0[_0xe5dc('0x23')],'rows':_[_0xe5dc('0x33')](_0x1c4ad0[_0xe5dc('0x61')],function(_0xbeddc6){return{'membername':_0xbeddc6[_0xe5dc('0x31')],'UserId':_0xbeddc6['id'],'queue_name':_0x17630a[_0xe5dc('0x31')],'FaxQueueId':_0x17630a['id'],'interface':util[_0xe5dc('0x62')](_0xe5dc('0x63'),_0xe5dc('0x64'),_0xbeddc6[_0xe5dc('0x31')]),'penalty':0x0,'paused':_0xbeddc6[_0xe5dc('0x5e')],'createdAt':_0xbeddc6['createdAt'],'updatedAt':_0xbeddc6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe5dc('0x2b')](respondWithFilteredResult(_0x5517cb,_0xa85a8b))[_0xe5dc('0x4c')](handleError(_0x5517cb,null));};exports[_0xe5dc('0x65')]=function(_0x368b6f,_0x236b45,_0x1961e0){var _0x179712={};var _0x48738c={};var _0x4edaa8;var _0x504d79;return db[_0xe5dc('0x34')][_0xe5dc('0x59')]({'where':{'id':_0x368b6f[_0xe5dc('0x4e')]['id']}})[_0xe5dc('0x2b')](handleEntityNotFound(_0x236b45,null))['then'](function(_0x14867e){if(_0x14867e){_0x4edaa8=_0x14867e;_0x48738c[_0xe5dc('0x3c')]=_[_0xe5dc('0x4f')](db[_0xe5dc('0x66')][_0xe5dc('0x35')]);_0x48738c['query']=_[_0xe5dc('0x4f')](_0x368b6f['query']);_0x48738c[_0xe5dc('0x3a')]=_[_0xe5dc('0x3b')](_0x48738c[_0xe5dc('0x3c')],_0x48738c[_0xe5dc('0x39')]);_0x179712['attributes']=_['intersection'](_0x48738c[_0xe5dc('0x3c')],qs[_0xe5dc('0x3e')](_0x368b6f['query'][_0xe5dc('0x3e')]));_0x179712['attributes']=_0x179712[_0xe5dc('0x3d')]['length']?_0x179712['attributes']:_0x48738c['model'];_0x179712['order']=qs[_0xe5dc('0x43')](_0x368b6f['query']['sort']);_0x179712[_0xe5dc('0x44')]=qs[_0xe5dc('0x3a')](_[_0xe5dc('0x45')](_0x368b6f[_0xe5dc('0x39')],_0x48738c[_0xe5dc('0x3a')]));if(_0x368b6f[_0xe5dc('0x39')][_0xe5dc('0x46')]){_0x179712['where']=_['merge'](_0x179712[_0xe5dc('0x44')],{'$or':_['map'](_0x179712['attributes'],function(_0x39a856){var _0x51f354={};_0x51f354[_0x39a856]={'$like':'%'+_0x368b6f[_0xe5dc('0x39')]['filter']+'%'};return _0x51f354;})});}_0x179712=_[_0xe5dc('0x47')]({},_0x179712,_0x368b6f[_0xe5dc('0x48')]);return _0x4edaa8[_0xe5dc('0x65')](_0x179712);}})[_0xe5dc('0x2b')](function(_0x2d2ba7){if(_0x2d2ba7){_0x504d79=_0x2d2ba7[_0xe5dc('0x3f')];if(!_0x368b6f[_0xe5dc('0x39')]['hasOwnProperty']('nolimit')){_0x179712[_0xe5dc('0x22')]=qs[_0xe5dc('0x22')](_0x368b6f[_0xe5dc('0x39')]['limit']);_0x179712['offset']=qs[_0xe5dc('0x20')](_0x368b6f[_0xe5dc('0x39')][_0xe5dc('0x20')]);}return _0x4edaa8[_0xe5dc('0x65')](_0x179712);}})['then'](function(_0x470965){if(_0x470965){return _0x470965?{'count':_0x504d79,'rows':_0x470965}:null;}})['then'](respondWithResult(_0x236b45,null))[_0xe5dc('0x4c')](handleError(_0x236b45,null));};exports['addTeams']=function(_0x197370,_0x5b9965,_0x509157){var _0x42429e=_0x197370['body']['ids'];return db[_0xe5dc('0x66')][_0xe5dc('0x4b')]({'where':{'id':_0x42429e},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe5dc('0x31'),_0xe5dc('0x67'),_0xe5dc('0x68'),'interface'],'raw':!![]}]})[_0xe5dc('0x2b')](function(_0x279561){if(_0x279561){var _0x3e363e=_[_0xe5dc('0x69')](_0x279561,function(_0x49e44f){var _0x119b7e=_0x49e44f[_0xe5dc('0x2c')]({'plain':!![]});return _0x119b7e['Agents'];});return db[_0xe5dc('0x34')][_0xe5dc('0x50')]({'where':{'id':_0x197370[_0xe5dc('0x4e')]['id']}})[_0xe5dc('0x2b')](function(_0x2290f8){return db[_0xe5dc('0x6a')][_0xe5dc('0x6b')](function(_0x511323){return _0x2290f8[_0xe5dc('0x6c')](_0x42429e,{'transaction':_0x511323})[_0xe5dc('0x2b')](function(){return BPromise[_0xe5dc('0x6d')](_0x3e363e,function(_0x55f516){return db[_0xe5dc('0x5a')][_0xe5dc('0x6e')]({'where':{'UserId':_0x55f516['id'],'FaxQueueId':_0x197370[_0xe5dc('0x4e')]['id']},'transaction':_0x511323});});})[_0xe5dc('0x2b')](function(){_0x3e363e[_0xe5dc('0x6f')](function(_0x3d9911){socket[_0xe5dc('0x70')](_0xe5dc('0x71'),{'UserId':_0x3d9911['id'],'FaxQueueId':_0x2290f8['id']});});});});});}})[_0xe5dc('0x2b')](respondWithStatusCode(_0x5b9965,null))[_0xe5dc('0x4c')](handleError(_0x5b9965,null));};exports[_0xe5dc('0x72')]=function(_0x534bef,_0x382d01,_0x2fb144){return db[_0xe5dc('0x66')]['findAll']({'where':{'id':_0x534bef[_0xe5dc('0x39')][_0xe5dc('0x73')]},'attributes':['id'],'include':[{'model':db[_0xe5dc('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe5dc('0x2b')](handleEntityNotFound(_0x382d01,null))['then'](function(_0x6ac4d0){var _0x2b6f2b=_['map'](_0x6ac4d0,'id');var _0x3e2f00=[];var _0x30377c=[];var _0x18e835=squel[_0xe5dc('0x74')]();_0x18e835[_0xe5dc('0x75')](_0xe5dc('0x76'))[_0xe5dc('0x77')](_0xe5dc('0x78'),'tq')[_0xe5dc('0x79')](_0xe5dc('0x7a'),'ut',_0xe5dc('0x7b'))[_0xe5dc('0x44')](_0xe5dc('0x7c'),_0x534bef['params']['id']);for(var _0x2a53eb=0x0;_0x2a53eb<_0x6ac4d0[_0xe5dc('0x3f')];_0x2a53eb+=0x1){let _0x5b76b0=_0x6ac4d0[_0x2a53eb];for(var _0x2ee4c9=0x0;_0x2ee4c9<_0x5b76b0['Agents'][_0xe5dc('0x3f')];_0x2ee4c9+=0x1){let _0x4dfdb1=_0x5b76b0[_0xe5dc('0x7d')][_0x2ee4c9];var _0x4d33bb=_0x18e835[_0xe5dc('0x7e')]();_0x4d33bb[_0xe5dc('0x44')]('ut.UserId\x20=\x20?',_0x4dfdb1['id']);_0x30377c[_0xe5dc('0x7f')](db[_0xe5dc('0x6a')][_0xe5dc('0x39')](_0x4d33bb['toString'](),{'type':db[_0xe5dc('0x6a')]['QueryTypes']['SELECT']})[_0xe5dc('0x2b')](function(_0x238b68){if(_0x238b68[_0xe5dc('0x3f')]===0x1){return _0x4dfdb1['id'];}else{var _0x3f6091=_['every'](_[_0xe5dc('0x33')](_0x238b68,'TeamId'),function(_0x191a3c){return _[_0xe5dc('0x80')](_0x2b6f2b,_0x191a3c);});if(_0x3f6091){return _0x4dfdb1['id'];}}}));}}return BPromise[_0xe5dc('0x81')](_0x30377c)[_0xe5dc('0x2b')](function(_0x744837){_0x3e2f00=_(_0x3e2f00)[_0xe5dc('0x82')](_0x744837)[_0xe5dc('0x83')]()[_0xe5dc('0x84')]();return db[_0xe5dc('0x34')][_0xe5dc('0x50')]({'where':{'id':_0x534bef[_0xe5dc('0x4e')]['id']}})[_0xe5dc('0x2b')](function(_0x5242ee){return db[_0xe5dc('0x6a')]['transaction'](function(_0xd7ab51){return _0x5242ee[_0xe5dc('0x72')](_0x534bef[_0xe5dc('0x39')][_0xe5dc('0x73')],{'transaction':_0xd7ab51})[_0xe5dc('0x2b')](function(){if(!_['isEmpty'](_0x3e2f00)){return _0x5242ee[_0xe5dc('0x85')](_0x3e2f00,{'transaction':_0xd7ab51});}})[_0xe5dc('0x2b')](function(){_0x3e2f00[_0xe5dc('0x6f')](function(_0x31da7d){socket[_0xe5dc('0x70')](_0xe5dc('0x86'),{'UserId':_0x31da7d,'FaxQueueId':_0x5242ee['id']});});});});});});})[_0xe5dc('0x2b')](respondWithStatusCode(_0x382d01,null))['catch'](handleError(_0x382d01,null));};exports[_0xe5dc('0x87')]=function(_0x262f79,_0x4eea4a,_0x16f1c2){return db[_0xe5dc('0x34')][_0xe5dc('0x50')]({'where':{'id':_0x262f79[_0xe5dc('0x4e')]['id']}})[_0xe5dc('0x2b')](handleEntityNotFound(_0x4eea4a,null))[_0xe5dc('0x2b')](function(_0x2686f7){if(_0x2686f7){return _0x2686f7['addAgents'](_0x262f79[_0xe5dc('0x52')]['ids'],_[_0xe5dc('0x88')](_0x262f79[_0xe5dc('0x52')],[_0xe5dc('0x73'),'id'])||{})[_0xe5dc('0x89')](function(_0x3e5832){for(var _0x36635e=0x0;_0x36635e<_0x262f79[_0xe5dc('0x52')]['ids'][_0xe5dc('0x3f')];_0x36635e+=0x1){socket[_0xe5dc('0x70')](_0xe5dc('0x71'),{'UserId':Number(_0x262f79[_0xe5dc('0x52')][_0xe5dc('0x73')][_0x36635e]),'FaxQueueId':Number(_0x262f79[_0xe5dc('0x4e')]['id'])});}return _0x3e5832;});}})[_0xe5dc('0x2b')](respondWithResult(_0x4eea4a,null))[_0xe5dc('0x4c')](handleError(_0x4eea4a,null));};exports['removeAgents']=function(_0x2c811c,_0x5e3a5d,_0xce77c6){return db[_0xe5dc('0x34')]['find']({'where':{'id':_0x2c811c['params']['id']}})[_0xe5dc('0x2b')](handleEntityNotFound(_0x5e3a5d,null))['then'](function(_0x2e575c){if(_0x2e575c){return _0x2e575c['removeAgents'](_0x2c811c[_0xe5dc('0x39')][_0xe5dc('0x73')])[_0xe5dc('0x2b')](function(){if(_['isArray'](_0x2c811c['query']['ids'])){for(var _0x47233d=0x0;_0x47233d<_0x2c811c[_0xe5dc('0x39')][_0xe5dc('0x73')][_0xe5dc('0x3f')];_0x47233d+=0x1){socket[_0xe5dc('0x70')](_0xe5dc('0x86'),{'UserId':Number(_0x2c811c[_0xe5dc('0x39')][_0xe5dc('0x73')][_0x47233d]),'FaxQueueId':Number(_0x2c811c['params']['id'])});}}else{socket[_0xe5dc('0x70')](_0xe5dc('0x86'),{'UserId':Number(_0x2c811c['query'][_0xe5dc('0x73')]),'FaxQueueId':Number(_0x2c811c[_0xe5dc('0x4e')]['id'])});}});}})[_0xe5dc('0x2b')](respondWithStatusCode(_0x5e3a5d,null))[_0xe5dc('0x4c')](handleError(_0x5e3a5d,null));};exports[_0xe5dc('0x8a')]=function(_0x3d8f15,_0x339f00,_0x2628d8){var _0x3fd627={};var _0x208dfd={};var _0x58e1c9;var _0x36b82a;return db['FaxQueue']['findOne']({'where':{'id':_0x3d8f15[_0xe5dc('0x4e')]['id']}})[_0xe5dc('0x2b')](handleEntityNotFound(_0x339f00,null))[_0xe5dc('0x2b')](function(_0x125939){if(_0x125939){_0x58e1c9=_0x125939;_0x208dfd[_0xe5dc('0x3c')]=_[_0xe5dc('0x4f')](db['User'][_0xe5dc('0x35')]);_0x208dfd['query']=_['keys'](_0x3d8f15['query']);_0x208dfd[_0xe5dc('0x3a')]=_[_0xe5dc('0x3b')](_0x208dfd[_0xe5dc('0x3c')],_0x208dfd[_0xe5dc('0x39')]);_0x3fd627[_0xe5dc('0x3d')]=_[_0xe5dc('0x3b')](_0x208dfd[_0xe5dc('0x3c')],qs[_0xe5dc('0x3e')](_0x3d8f15[_0xe5dc('0x39')][_0xe5dc('0x3e')]));_0x3fd627[_0xe5dc('0x3d')]=_0x3fd627['attributes']['length']?_0x3fd627['attributes']:_0x208dfd[_0xe5dc('0x3c')];_0x3fd627[_0xe5dc('0x42')]=qs[_0xe5dc('0x43')](_0x3d8f15[_0xe5dc('0x39')][_0xe5dc('0x43')]);_0x3fd627[_0xe5dc('0x44')]=qs['filters'](_[_0xe5dc('0x45')](_0x3d8f15[_0xe5dc('0x39')],_0x208dfd[_0xe5dc('0x3a')]));if(_0x3d8f15[_0xe5dc('0x39')][_0xe5dc('0x46')]){_0x3fd627[_0xe5dc('0x44')]=_['merge'](_0x3fd627[_0xe5dc('0x44')],{'$or':_[_0xe5dc('0x33')](_0x3fd627[_0xe5dc('0x3d')],function(_0x2817b3){var _0x456e5e={};_0x456e5e[_0x2817b3]={'$like':'%'+_0x3d8f15[_0xe5dc('0x39')][_0xe5dc('0x46')]+'%'};return _0x456e5e;})});}_0x3fd627=_['merge']({},_0x3fd627,_0x3d8f15[_0xe5dc('0x48')]);return _0x58e1c9[_0xe5dc('0x8a')](_0x3fd627);}})['then'](function(_0x5bd23a){if(_0x5bd23a){_0x36b82a=_0x5bd23a[_0xe5dc('0x3f')];if(!_0x3d8f15[_0xe5dc('0x39')][_0xe5dc('0x40')](_0xe5dc('0x41'))){_0x3fd627[_0xe5dc('0x22')]=qs['limit'](_0x3d8f15[_0xe5dc('0x39')][_0xe5dc('0x22')]);_0x3fd627[_0xe5dc('0x20')]=qs[_0xe5dc('0x20')](_0x3d8f15[_0xe5dc('0x39')][_0xe5dc('0x20')]);}return _0x58e1c9[_0xe5dc('0x8a')](_0x3fd627);}})[_0xe5dc('0x2b')](function(_0xf70215){if(_0xf70215){return _0xf70215?{'count':_0x36b82a,'rows':_0xf70215}:null;}})[_0xe5dc('0x2b')](respondWithResult(_0x339f00,null))[_0xe5dc('0x4c')](handleError(_0x339f00,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 5255d53..77ede53 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 _0x0191=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxQueue'];(function(_0x576f3b,_0xd7414b){var _0x22307b=function(_0x41d847){while(--_0x41d847){_0x576f3b['push'](_0x576f3b['shift']());}};_0x22307b(++_0xd7414b);}(_0x0191,0x14e));var _0x1019=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x0191[_0x1ad926];return _0x1b81dc;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x1019('0x0'))['db'][_0x1019('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1019('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1019('0x3')};function emitEvent(_0x4f1e75){return function(_0x19c261,_0x24296d,_0x1d7c29){FaxQueueEvents[_0x1019('0x4')](_0x4f1e75+':'+_0x19c261['id'],_0x19c261);FaxQueueEvents[_0x1019('0x4')](_0x4f1e75,_0x19c261);_0x1d7c29(null);};}for(var e in events){if(events[_0x1019('0x5')](e)){var event=events[e];FaxQueue[_0x1019('0x6')](e,emitEvent(event));}}module[_0x1019('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x7e81=['hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x43c027,_0x38dab0){var _0xba9a2b=function(_0x1b0bbd){while(--_0x1b0bbd){_0x43c027['push'](_0x43c027['shift']());}};_0xba9a2b(++_0x38dab0);}(_0x7e81,0xe2));var _0x17e8=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x7e81[_0x13ea00];return _0x1f7347;};'use strict';var EventEmitter=require(_0x17e8('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x17e8('0x1')](0x0);var events={'afterCreate':_0x17e8('0x2'),'afterUpdate':_0x17e8('0x3'),'afterDestroy':_0x17e8('0x4')};function emitEvent(_0x5c292a){return function(_0xb0663c,_0x30e0ab,_0x2d00e2){FaxQueueEvents[_0x17e8('0x5')](_0x5c292a+':'+_0xb0663c['id'],_0xb0663c);FaxQueueEvents[_0x17e8('0x5')](_0x5c292a,_0xb0663c);_0x2d00e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x17e8('0x6')](e,emitEvent(event));}}module[_0x17e8('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 5eb475d..09a698d 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 _0xdb13=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xdb13,0x1f4));var _0x3db1=function(_0x5efdb7,_0x4f001a){_0x5efdb7=_0x5efdb7-0x0;var _0x48cf75=_0xdb13[_0x5efdb7];return _0x48cf75;};'use strict';var _=require('lodash');var util=require(_0x3db1('0x0'));var logger=require(_0x3db1('0x1'))(_0x3db1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3db1('0x3'));var fs=require('fs');var path=require(_0x3db1('0x4'));var rimraf=require(_0x3db1('0x5'));var config=require('../../config/environment');var attributes=require(_0x3db1('0x6'));module[_0x3db1('0x7')]=function(_0x18688d,_0x560d3b){return _0x18688d[_0x3db1('0x8')](_0x3db1('0x9'),attributes,{'tableName':_0x3db1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd61b=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','FaxQueue','fax_queues','lodash'];(function(_0x3a5694,_0x3d86b5){var _0x49731f=function(_0x339e18){while(--_0x339e18){_0x3a5694['push'](_0x3a5694['shift']());}};_0x49731f(++_0x3d86b5);}(_0xd61b,0x173));var _0xbd61=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xd61b[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xbd61('0x0'));var util=require(_0xbd61('0x1'));var logger=require(_0xbd61('0x2'))(_0xbd61('0x3'));var moment=require('moment');var BPromise=require(_0xbd61('0x4'));var rp=require(_0xbd61('0x5'));var fs=require('fs');var path=require(_0xbd61('0x6'));var rimraf=require(_0xbd61('0x7'));var config=require('../../config/environment');var attributes=require(_0xbd61('0x8'));module[_0xbd61('0x9')]=function(_0x4cc385,_0x2404aa){return _0x4cc385['define'](_0xbd61('0xa'),attributes,{'tableName':_0xbd61('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 bbf54be..6093d61 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 _0xa96c=['options','raw','where','limit','include','attributes','model','map','then','catch','ShowFaxQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxQueue'];(function(_0x328b0c,_0x254151){var _0x3e37a4=function(_0x43834f){while(--_0x43834f){_0x328b0c['push'](_0x328b0c['shift']());}};_0x3e37a4(++_0x254151);}(_0xa96c,0xac));var _0xca96=function(_0x2540f2,_0x476eed){_0x2540f2=_0x2540f2-0x0;var _0x1396bc=_0xa96c[_0x2540f2];return _0x1396bc;};'use strict';var _=require(_0xca96('0x0'));var util=require(_0xca96('0x1'));var moment=require(_0xca96('0x2'));var BPromise=require(_0xca96('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca96('0x4'));var db=require(_0xca96('0x5'))['db'];var utils=require(_0xca96('0x6'));var logger=require(_0xca96('0x7'))(_0xca96('0x8'));var config=require('../../config/environment');var jayson=require(_0xca96('0x9'));var client=jayson[_0xca96('0xa')][_0xca96('0xb')]({'port':0x232a});config[_0xca96('0xc')]=_[_0xca96('0xd')](config[_0xca96('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xca96('0xe'))(new Redis(config['redis']));require(_0xca96('0xf'))[_0xca96('0x10')](socket);function respondWithRpcPromise(_0x56acd5,_0x7204ef,_0x5d6f9f){return new BPromise(function(_0x3ad780,_0x54edd1){return client[_0xca96('0x11')](_0x56acd5,_0x5d6f9f)['then'](function(_0xa828ed){logger[_0xca96('0x12')](_0xca96('0x13'),_0x7204ef,'request\x20sent');logger[_0xca96('0x14')](_0xca96('0x15'),_0x7204ef,'request\x20sent',JSON[_0xca96('0x16')](_0xa828ed));if(_0xa828ed[_0xca96('0x17')]){if(_0xa828ed['error'][_0xca96('0x18')]===0x1f4){logger[_0xca96('0x17')](_0xca96('0x13'),_0x7204ef,_0xa828ed[_0xca96('0x17')][_0xca96('0x19')]);return _0x54edd1(_0xa828ed[_0xca96('0x17')][_0xca96('0x19')]);}logger[_0xca96('0x17')](_0xca96('0x13'),_0x7204ef,_0xa828ed[_0xca96('0x17')][_0xca96('0x19')]);return _0x3ad780(_0xa828ed[_0xca96('0x17')]['message']);}else{logger['info'](_0xca96('0x13'),_0x7204ef,'request\x20sent');_0x3ad780(_0xa828ed[_0xca96('0x1a')][_0xca96('0x19')]);}})['catch'](function(_0x2d3496){logger[_0xca96('0x17')](_0xca96('0x13'),_0x7204ef,_0x2d3496);_0x54edd1(_0x2d3496);});});}exports[_0xca96('0x1b')]=function(_0x48d36d){var _0x3b5600=this;return new Promise(function(_0x1dcc9b,_0x31c16c){return db['FaxQueue']['findAll']({'raw':_0x48d36d[_0xca96('0x1c')]?_0x48d36d['options'][_0xca96('0x1d')]===undefined?!![]:![]:!![],'where':_0x48d36d[_0xca96('0x1c')]?_0x48d36d[_0xca96('0x1c')][_0xca96('0x1e')]||null:null,'attributes':_0x48d36d[_0xca96('0x1c')]?_0x48d36d['options']['attributes']||null:null,'limit':_0x48d36d[_0xca96('0x1c')]?_0x48d36d['options'][_0xca96('0x1f')]||null:null,'include':_0x48d36d[_0xca96('0x1c')]?_0x48d36d[_0xca96('0x1c')]['include']?_['map'](_0x48d36d['options'][_0xca96('0x20')],function(_0x141c6c){return{'model':db[_0x141c6c['model']],'as':_0x141c6c['as'],'attributes':_0x141c6c[_0xca96('0x21')],'include':_0x141c6c['include']?_['map'](_0x141c6c[_0xca96('0x20')],function(_0x2cbf1f){return{'model':db[_0x2cbf1f[_0xca96('0x22')]],'as':_0x2cbf1f['as'],'attributes':_0x2cbf1f[_0xca96('0x21')],'include':_0x2cbf1f[_0xca96('0x20')]?_[_0xca96('0x23')](_0x2cbf1f['include'],function(_0x683ab9){return{'model':db[_0x683ab9[_0xca96('0x22')]],'as':_0x683ab9['as'],'attributes':_0x683ab9[_0xca96('0x21')]};}):[]};}):[]};}):[]:[]})[_0xca96('0x24')](function(_0x485fd9){logger['info']('GetFaxQueue',_0x48d36d);logger[_0xca96('0x14')](_0xca96('0x1b'),_0x48d36d,JSON['stringify'](_0x485fd9));_0x1dcc9b(_0x485fd9);})[_0xca96('0x25')](function(_0x5c8b92){logger[_0xca96('0x17')](_0xca96('0x1b'),_0x5c8b92['message'],_0x48d36d);_0x31c16c(_0x3b5600[_0xca96('0x17')](0x1f4,_0x5c8b92[_0xca96('0x19')]));});});};exports[_0xca96('0x26')]=function(_0xa9d655){var _0x487f03=this;return new Promise(function(_0x28250a,_0x24ce35){return db['FaxQueue'][_0xca96('0x27')]({'raw':_0xa9d655[_0xca96('0x1c')]?_0xa9d655[_0xca96('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xa9d655[_0xca96('0x1c')]?_0xa9d655[_0xca96('0x1c')][_0xca96('0x1e')]||null:null,'attributes':_0xa9d655[_0xca96('0x1c')]?_0xa9d655[_0xca96('0x1c')][_0xca96('0x21')]||null:null,'include':_0xa9d655[_0xca96('0x1c')]?_0xa9d655[_0xca96('0x1c')][_0xca96('0x20')]?_[_0xca96('0x23')](_0xa9d655[_0xca96('0x1c')]['include'],function(_0x1c5b98){return{'model':db[_0x1c5b98[_0xca96('0x22')]],'as':_0x1c5b98['as'],'attributes':_0x1c5b98[_0xca96('0x21')],'include':_0x1c5b98[_0xca96('0x20')]?_['map'](_0x1c5b98[_0xca96('0x20')],function(_0x5f1e3d){return{'model':db[_0x5f1e3d['model']],'as':_0x5f1e3d['as'],'attributes':_0x5f1e3d[_0xca96('0x21')],'include':_0x5f1e3d['include']?_[_0xca96('0x23')](_0x5f1e3d[_0xca96('0x20')],function(_0x335a5a){return{'model':db[_0x335a5a['model']],'as':_0x335a5a['as'],'attributes':_0x335a5a[_0xca96('0x21')]};}):[]};}):[]};}):[]:[]})[_0xca96('0x24')](function(_0x12f929){logger[_0xca96('0x12')](_0xca96('0x26'),_0xa9d655);logger[_0xca96('0x14')](_0xca96('0x26'),_0xa9d655,JSON[_0xca96('0x16')](_0x12f929));_0x28250a(_0x12f929);})[_0xca96('0x25')](function(_0x426564){logger[_0xca96('0x17')](_0xca96('0x26'),_0x426564[_0xca96('0x19')],_0xa9d655);_0x24ce35(_0x487f03[_0xca96('0x17')](0x1f4,_0x426564[_0xca96('0x19')]));});});}; \ No newline at end of file +var _0x7b31=['map','model','then','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include'];(function(_0x909f09,_0xc32308){var _0x792c65=function(_0x25921e){while(--_0x25921e){_0x909f09['push'](_0x909f09['shift']());}};_0x792c65(++_0xc32308);}(_0x7b31,0x86));var _0x17b3=function(_0x1183fa,_0x24a7f1){_0x1183fa=_0x1183fa-0x0;var _0x113c08=_0x7b31[_0x1183fa];return _0x113c08;};'use strict';var _=require(_0x17b3('0x0'));var util=require(_0x17b3('0x1'));var moment=require(_0x17b3('0x2'));var BPromise=require(_0x17b3('0x3'));var rs=require(_0x17b3('0x4'));var fs=require('fs');var Redis=require(_0x17b3('0x5'));var db=require(_0x17b3('0x6'))['db'];var utils=require(_0x17b3('0x7'));var logger=require(_0x17b3('0x8'))('rpc');var config=require(_0x17b3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x17b3('0xa')][_0x17b3('0xb')]({'port':0x232a});config[_0x17b3('0xc')]=_[_0x17b3('0xd')](config['redis'],{'host':_0x17b3('0xe'),'port':0x18eb});var socket=require(_0x17b3('0xf'))(new Redis(config[_0x17b3('0xc')]));require(_0x17b3('0x10'))[_0x17b3('0x11')](socket);function respondWithRpcPromise(_0x10f85b,_0xb561d4,_0x5a1ed3){return new BPromise(function(_0x700057,_0x8d956){return client[_0x17b3('0x12')](_0x10f85b,_0x5a1ed3)['then'](function(_0x37508f){logger[_0x17b3('0x13')](_0x17b3('0x14'),_0xb561d4,_0x17b3('0x15'));logger[_0x17b3('0x16')](_0x17b3('0x17'),_0xb561d4,_0x17b3('0x15'),JSON[_0x17b3('0x18')](_0x37508f));if(_0x37508f[_0x17b3('0x19')]){if(_0x37508f[_0x17b3('0x19')][_0x17b3('0x1a')]===0x1f4){logger[_0x17b3('0x19')](_0x17b3('0x14'),_0xb561d4,_0x37508f['error'][_0x17b3('0x1b')]);return _0x8d956(_0x37508f[_0x17b3('0x19')][_0x17b3('0x1b')]);}logger[_0x17b3('0x19')](_0x17b3('0x14'),_0xb561d4,_0x37508f['error'][_0x17b3('0x1b')]);return _0x700057(_0x37508f['error'][_0x17b3('0x1b')]);}else{logger[_0x17b3('0x13')](_0x17b3('0x14'),_0xb561d4,_0x17b3('0x15'));_0x700057(_0x37508f[_0x17b3('0x1c')][_0x17b3('0x1b')]);}})[_0x17b3('0x1d')](function(_0x3b021b){logger[_0x17b3('0x19')]('FaxQueue,\x20%s,\x20%s',_0xb561d4,_0x3b021b);_0x8d956(_0x3b021b);});});}exports[_0x17b3('0x1e')]=function(_0x46bc2f){var _0x271170=this;return new Promise(function(_0x3fe5c6,_0x32af9a){return db[_0x17b3('0x1f')][_0x17b3('0x20')]({'raw':_0x46bc2f[_0x17b3('0x21')]?_0x46bc2f[_0x17b3('0x21')][_0x17b3('0x22')]===undefined?!![]:![]:!![],'where':_0x46bc2f[_0x17b3('0x21')]?_0x46bc2f[_0x17b3('0x21')][_0x17b3('0x23')]||null:null,'attributes':_0x46bc2f['options']?_0x46bc2f[_0x17b3('0x21')][_0x17b3('0x24')]||null:null,'limit':_0x46bc2f[_0x17b3('0x21')]?_0x46bc2f['options']['limit']||null:null,'include':_0x46bc2f['options']?_0x46bc2f[_0x17b3('0x21')][_0x17b3('0x25')]?_[_0x17b3('0x26')](_0x46bc2f['options'][_0x17b3('0x25')],function(_0x36f16d){return{'model':db[_0x36f16d['model']],'as':_0x36f16d['as'],'attributes':_0x36f16d[_0x17b3('0x24')],'include':_0x36f16d[_0x17b3('0x25')]?_['map'](_0x36f16d[_0x17b3('0x25')],function(_0xa8b550){return{'model':db[_0xa8b550[_0x17b3('0x27')]],'as':_0xa8b550['as'],'attributes':_0xa8b550[_0x17b3('0x24')],'include':_0xa8b550[_0x17b3('0x25')]?_[_0x17b3('0x26')](_0xa8b550['include'],function(_0x25ce7f){return{'model':db[_0x25ce7f['model']],'as':_0x25ce7f['as'],'attributes':_0x25ce7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x17b3('0x28')](function(_0x3a9c17){logger['info'](_0x17b3('0x1e'),_0x46bc2f);logger[_0x17b3('0x16')](_0x17b3('0x1e'),_0x46bc2f,JSON['stringify'](_0x3a9c17));_0x3fe5c6(_0x3a9c17);})[_0x17b3('0x1d')](function(_0x4c2827){logger['error'](_0x17b3('0x1e'),_0x4c2827[_0x17b3('0x1b')],_0x46bc2f);_0x32af9a(_0x271170[_0x17b3('0x19')](0x1f4,_0x4c2827[_0x17b3('0x1b')]));});});};exports['ShowFaxQueue']=function(_0x1c3bd4){var _0x9c671=this;return new Promise(function(_0x48ac24,_0x1122e7){return db[_0x17b3('0x1f')][_0x17b3('0x29')]({'raw':_0x1c3bd4[_0x17b3('0x21')]?_0x1c3bd4[_0x17b3('0x21')][_0x17b3('0x22')]===undefined?!![]:![]:!![],'where':_0x1c3bd4[_0x17b3('0x21')]?_0x1c3bd4[_0x17b3('0x21')][_0x17b3('0x23')]||null:null,'attributes':_0x1c3bd4['options']?_0x1c3bd4[_0x17b3('0x21')][_0x17b3('0x24')]||null:null,'include':_0x1c3bd4[_0x17b3('0x21')]?_0x1c3bd4[_0x17b3('0x21')][_0x17b3('0x25')]?_[_0x17b3('0x26')](_0x1c3bd4['options'][_0x17b3('0x25')],function(_0x28f7a4){return{'model':db[_0x28f7a4[_0x17b3('0x27')]],'as':_0x28f7a4['as'],'attributes':_0x28f7a4['attributes'],'include':_0x28f7a4[_0x17b3('0x25')]?_[_0x17b3('0x26')](_0x28f7a4['include'],function(_0x348a69){return{'model':db[_0x348a69['model']],'as':_0x348a69['as'],'attributes':_0x348a69[_0x17b3('0x24')],'include':_0x348a69['include']?_['map'](_0x348a69[_0x17b3('0x25')],function(_0x5cf89f){return{'model':db[_0x5cf89f[_0x17b3('0x27')]],'as':_0x5cf89f['as'],'attributes':_0x5cf89f[_0x17b3('0x24')]};}):[]};}):[]};}):[]:[]})[_0x17b3('0x28')](function(_0x3df174){logger[_0x17b3('0x13')](_0x17b3('0x2a'),_0x1c3bd4);logger[_0x17b3('0x16')](_0x17b3('0x2a'),_0x1c3bd4,JSON[_0x17b3('0x18')](_0x3df174));_0x48ac24(_0x3df174);})[_0x17b3('0x1d')](function(_0x341313){logger['error'](_0x17b3('0x2a'),_0x341313[_0x17b3('0x1b')],_0x1c3bd4);_0x1122e7(_0x9c671[_0x17b3('0x19')](0x1f4,_0x341313[_0x17b3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 7ac9ccb..19d620d 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 _0x8627=['update','emit','removeListener','register','length','faxQueue:','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8627,0xd1));var _0x7862=function(_0x207889,_0x36ff57){_0x207889=_0x207889-0x0;var _0x37b3f7=_0x8627[_0x207889];return _0x37b3f7;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x7862('0x0'),_0x7862('0x1')];function createListener(_0x39b332,_0x449178){return function(_0x36c098){_0x449178[_0x7862('0x2')](_0x39b332,_0x36c098);};}function removeListener(_0x52c238,_0x27771a){return function(){FaxQueueEvents[_0x7862('0x3')](_0x52c238,_0x27771a);};}exports[_0x7862('0x4')]=function(_0x53eb1b){for(var _0x1966f9=0x0,_0x5f1bb8=events[_0x7862('0x5')];_0x1966f9<_0x5f1bb8;_0x1966f9++){var _0x2d400d=events[_0x1966f9];var _0x6c1ec5=createListener(_0x7862('0x6')+_0x2d400d,_0x53eb1b);FaxQueueEvents['on'](_0x2d400d,_0x6c1ec5);}}; \ No newline at end of file +var _0xa03b=['removeListener','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x440a24,_0x2002ac){var _0x23cc50=function(_0x473d87){while(--_0x473d87){_0x440a24['push'](_0x440a24['shift']());}};_0x23cc50(++_0x2002ac);}(_0xa03b,0x8c));var _0xba03=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0xa03b[_0x16eb11];return _0x3ae7ef;};'use strict';var FaxQueueEvents=require(_0xba03('0x0'));var events=[_0xba03('0x1'),_0xba03('0x2'),_0xba03('0x3')];function createListener(_0x7ee797,_0x33eed7){return function(_0x4932ba){_0x33eed7['emit'](_0x7ee797,_0x4932ba);};}function removeListener(_0x5255ab,_0x1005c9){return function(){FaxQueueEvents[_0xba03('0x4')](_0x5255ab,_0x1005c9);};}exports['register']=function(_0x23828a){for(var _0x1bc03b=0x0,_0x519414=events['length'];_0x1bc03b<_0x519414;_0x1bc03b++){var _0x23558a=events[_0x1bc03b];var _0x5be65f=createListener(_0xba03('0x5')+_0x23558a,_0x23828a);FaxQueueEvents['on'](_0x23558a,_0x5be65f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2cf51ab..c65eb5c 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 _0x8aad=['removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','get','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','/:id/teams','removeTeams'];(function(_0x4bcfa5,_0x1f7989){var _0x337e7a=function(_0x363a18){while(--_0x363a18){_0x4bcfa5['push'](_0x4bcfa5['shift']());}};_0x337e7a(++_0x1f7989);}(_0x8aad,0x146));var _0xd8aa=function(_0x271b97,_0x48695b){_0x271b97=_0x271b97-0x0;var _0x31366b=_0x8aad[_0x271b97];return _0x31366b;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var fs_extra=require(_0xd8aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8aa('0x5'));var controller=require('./faxQueue.controller');router['get']('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x7')]);router[_0xd8aa('0x8')]('/describe',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x8')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd8aa('0x8')](_0xd8aa('0xb'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0x8')]('/:id/teams',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xd')]);router[_0xd8aa('0x8')](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')]('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x11')]);router[_0xd8aa('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0xd8aa('0x12')]);router[_0xd8aa('0x10')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0x13')]);router[_0xd8aa('0x14')](_0xd8aa('0xa'),auth[_0xd8aa('0x6')](),controller['update']);router[_0xd8aa('0x15')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller[_0xd8aa('0x16')]);router[_0xd8aa('0x15')](_0xd8aa('0x17'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x18')]);router['delete'](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x19')]);module[_0xd8aa('0x1a')]=router; \ No newline at end of file +var _0x7409=['get','index','/describe','describe','/:id','show','/:id/members','isAuthenticated','getTeams','/:id/teams','post','addAgents','put','update','destroy','delete','removeTeams','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0x7409,0x6e));var _0x9740=function(_0x17a0a0,_0x1befaa){_0x17a0a0=_0x17a0a0-0x0;var _0x4da752=_0x7409[_0x17a0a0];return _0x4da752;};'use strict';var multer=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var path=require('path');var timeout=require(_0x9740('0x2'));var express=require(_0x9740('0x3'));var router=express[_0x9740('0x4')]();var fs_extra=require(_0x9740('0x5'));var auth=require(_0x9740('0x6'));var interaction=require(_0x9740('0x7'));var config=require(_0x9740('0x8'));var controller=require(_0x9740('0x9'));router[_0x9740('0xa')]('/',auth['isAuthenticated'](),controller[_0x9740('0xb')]);router[_0x9740('0xa')](_0x9740('0xc'),auth['isAuthenticated'](),controller[_0x9740('0xd')]);router[_0x9740('0xa')](_0x9740('0xe'),auth['isAuthenticated'](),controller[_0x9740('0xf')]);router['get'](_0x9740('0x10'),auth[_0x9740('0x11')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x9740('0x11')](),controller[_0x9740('0x12')]);router[_0x9740('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9740('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0x9740('0x14')]('/:id/users',auth[_0x9740('0x11')](),controller[_0x9740('0x15')]);router[_0x9740('0x16')](_0x9740('0xe'),auth['isAuthenticated'](),controller[_0x9740('0x17')]);router['delete'](_0x9740('0xe'),auth[_0x9740('0x11')](),controller[_0x9740('0x18')]);router[_0x9740('0x19')](_0x9740('0x13'),auth[_0x9740('0x11')](),controller[_0x9740('0x1a')]);router[_0x9740('0x19')](_0x9740('0x1b'),auth['isAuthenticated'](),controller[_0x9740('0x1c')]);module[_0x9740('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 0587365..fa85306 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 _0x6bcd=['DATE','sequelize','exports','STRING'];(function(_0x2a1f45,_0xf356f2){var _0x1d7ac5=function(_0x45e704){while(--_0x45e704){_0x2a1f45['push'](_0x2a1f45['shift']());}};_0x1d7ac5(++_0xf356f2);}(_0x6bcd,0x89));var _0xd6bc=function(_0x5960ce,_0x2e8c7c){_0x5960ce=_0x5960ce-0x0;var _0x26d155=_0x6bcd[_0x5960ce];return _0x26d155;};'use strict';var moment=require('moment');var Sequelize=require(_0xd6bc('0x0'));module[_0xd6bc('0x1')]={'uniqueid':{'type':Sequelize[_0xd6bc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd6bc('0x2')]},'joinAt':{'type':Sequelize[_0xd6bc('0x3')]},'leaveAt':{'type':Sequelize[_0xd6bc('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd6bc('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xab3f=['STRING','DATE','moment','sequelize','exports'];(function(_0x56e80c,_0xd0f2eb){var _0x2ece80=function(_0x222104){while(--_0x222104){_0x56e80c['push'](_0x56e80c['shift']());}};_0x2ece80(++_0xd0f2eb);}(_0xab3f,0x17e));var _0xfab3=function(_0x45d5f0,_0xd3e86c){_0x45d5f0=_0x45d5f0-0x0;var _0x188341=_0xab3f[_0x45d5f0];return _0x188341;};'use strict';var moment=require(_0xfab3('0x0'));var Sequelize=require(_0xfab3('0x1'));module[_0xfab3('0x2')]={'uniqueid':{'type':Sequelize[_0xfab3('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfab3('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfab3('0x4')]},'exitAt':{'type':Sequelize[_0xfab3('0x4')]},'reason':{'type':Sequelize[_0xfab3('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 75cc474..b5a3a5e 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 _0x5d31=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','FaxQueueReport','include','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes'];(function(_0x5c325f,_0x3968b1){var _0x12cb72=function(_0xc34b64){while(--_0xc34b64){_0x5c325f['push'](_0x5c325f['shift']());}};_0x12cb72(++_0x3968b1);}(_0x5d31,0xf7));var _0x15d3=function(_0x5a69b5,_0x167340){_0x5a69b5=_0x5a69b5-0x0;var _0x33a7fe=_0x5d31[_0x5a69b5];return _0x33a7fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15d3('0x0'));var zipdir=require(_0x15d3('0x1'));var jsonpatch=require(_0x15d3('0x2'));var rp=require('request-promise');var moment=require(_0x15d3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15d3('0x4'));var path=require(_0x15d3('0x5'));var sox=require(_0x15d3('0x6'));var csv=require(_0x15d3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15d3('0x8'));var _=require(_0x15d3('0x9'));var squel=require(_0x15d3('0xa'));var crypto=require(_0x15d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15d3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x15d3('0xd'));var Redis=require('ioredis');var authService=require(_0x15d3('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d3('0xf'));var logger=require(_0x15d3('0x10'))(_0x15d3('0x11'));var utils=require(_0x15d3('0x12'));var config=require(_0x15d3('0x13'));var licenseUtil=require(_0x15d3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219867,_0x1397d8){_0x1397d8=_0x1397d8||0xcc;return function(_0x2811b5){if(_0x2811b5){return _0x219867[_0x15d3('0x15')](_0x1397d8);}return _0x219867[_0x15d3('0x16')](_0x1397d8)[_0x15d3('0x17')]();};}function respondWithResult(_0x24eb07,_0x1658cf){_0x1658cf=_0x1658cf||0xc8;return function(_0x44b5a4){if(_0x44b5a4){return _0x24eb07[_0x15d3('0x16')](_0x1658cf)[_0x15d3('0x18')](_0x44b5a4);}};}function respondWithFilteredResult(_0x4af3a7,_0x304a13){return function(_0x17401b){if(_0x17401b){var _0x5bbfef=typeof _0x304a13[_0x15d3('0x19')]===_0x15d3('0x1a')&&typeof _0x304a13[_0x15d3('0x1b')]===_0x15d3('0x1a');var _0x1b7b3f=_0x17401b[_0x15d3('0x1c')];var _0x46f9ce=_0x5bbfef?0x0:_0x304a13[_0x15d3('0x19')];var _0x46e18b=_0x5bbfef?_0x17401b[_0x15d3('0x1c')]:_0x304a13[_0x15d3('0x19')]+_0x304a13['limit'];var _0x41c358;if(_0x46e18b>=_0x1b7b3f){_0x46e18b=_0x1b7b3f;_0x41c358=0xc8;}else{_0x41c358=0xce;}_0x4af3a7[_0x15d3('0x16')](_0x41c358);return _0x4af3a7['set']('Content-Range',_0x46f9ce+'-'+_0x46e18b+'/'+_0x1b7b3f)['json'](_0x17401b);}return null;};}function patchUpdates(_0x4ebc97){return function(_0x39bb05){try{jsonpatch[_0x15d3('0x1d')](_0x39bb05,_0x4ebc97,!![]);}catch(_0x40a327){return BPromise[_0x15d3('0x1e')](_0x40a327);}return _0x39bb05[_0x15d3('0x1f')]();};}function saveUpdates(_0x2fa13c,_0x4da198){return function(_0x49eb89){if(_0x49eb89){return _0x49eb89[_0x15d3('0x20')](_0x2fa13c)[_0x15d3('0x21')](function(_0x444075){return _0x444075;});}return null;};}function removeEntity(_0x72852f,_0x5b06cc){return function(_0x232078){if(_0x232078){return _0x232078[_0x15d3('0x22')]()[_0x15d3('0x21')](function(){_0x72852f[_0x15d3('0x16')](0xcc)[_0x15d3('0x17')]();});}};}function handleEntityNotFound(_0x240cf4,_0x4a499a){return function(_0x514380){if(!_0x514380){_0x240cf4['sendStatus'](0x194);}return _0x514380;};}function handleError(_0x31706f,_0x1cd5bc){_0x1cd5bc=_0x1cd5bc||0x1f4;return function(_0x23e1f8){logger[_0x15d3('0x23')](_0x23e1f8[_0x15d3('0x24')]);if(_0x23e1f8[_0x15d3('0x25')]){delete _0x23e1f8[_0x15d3('0x25')];}_0x31706f[_0x15d3('0x16')](_0x1cd5bc)[_0x15d3('0x26')](_0x23e1f8);};}exports['index']=function(_0x5f445a,_0x164aa1){var _0x4e5840={},_0x6a9c0c={},_0x5a2ccf={'count':0x0,'rows':[]};var _0x314c27=_[_0x15d3('0x27')](db['FaxQueueReport'][_0x15d3('0x28')],function(_0x29a947){return{'name':_0x29a947[_0x15d3('0x29')],'type':_0x29a947[_0x15d3('0x2a')][_0x15d3('0x2b')]};});_0x6a9c0c[_0x15d3('0x2c')]=_[_0x15d3('0x27')](_0x314c27,_0x15d3('0x25'));_0x6a9c0c[_0x15d3('0x2d')]=_[_0x15d3('0x2e')](_0x5f445a['query']);_0x6a9c0c[_0x15d3('0x2f')]=_[_0x15d3('0x30')](_0x6a9c0c[_0x15d3('0x2c')],_0x6a9c0c[_0x15d3('0x2d')]);_0x4e5840[_0x15d3('0x31')]=_[_0x15d3('0x30')](_0x6a9c0c[_0x15d3('0x2c')],qs[_0x15d3('0x32')](_0x5f445a['query'][_0x15d3('0x32')]));_0x4e5840['attributes']=_0x4e5840[_0x15d3('0x31')][_0x15d3('0x33')]?_0x4e5840[_0x15d3('0x31')]:_0x6a9c0c[_0x15d3('0x2c')];if(!_0x5f445a[_0x15d3('0x2d')][_0x15d3('0x34')](_0x15d3('0x35'))){_0x4e5840[_0x15d3('0x1b')]=qs[_0x15d3('0x1b')](_0x5f445a[_0x15d3('0x2d')][_0x15d3('0x1b')]);_0x4e5840[_0x15d3('0x19')]=qs[_0x15d3('0x19')](_0x5f445a[_0x15d3('0x2d')][_0x15d3('0x19')]);}_0x4e5840['order']=qs[_0x15d3('0x36')](_0x5f445a[_0x15d3('0x2d')]['sort']);_0x4e5840[_0x15d3('0x37')]=qs[_0x15d3('0x2f')](_[_0x15d3('0x38')](_0x5f445a['query'],_0x6a9c0c[_0x15d3('0x2f')]),_0x314c27);if(_0x5f445a['query'][_0x15d3('0x39')]){_0x4e5840[_0x15d3('0x37')]=_['merge'](_0x4e5840[_0x15d3('0x37')],{'$or':_[_0x15d3('0x27')](_0x314c27,function(_0x357073){if(_0x357073[_0x15d3('0x2a')]!==_0x15d3('0x3a')){var _0x3d1803={};_0x3d1803[_0x357073['name']]={'$like':'%'+_0x5f445a[_0x15d3('0x2d')]['filter']+'%'};return _0x3d1803;}})});}_0x4e5840=_[_0x15d3('0x3b')]({},_0x4e5840,_0x5f445a[_0x15d3('0x3c')]);var _0x1b24c5={'where':_0x4e5840[_0x15d3('0x37')]};return db[_0x15d3('0x3d')][_0x15d3('0x1c')](_0x1b24c5)[_0x15d3('0x21')](function(_0x19749b){_0x5a2ccf[_0x15d3('0x1c')]=_0x19749b;if(_0x5f445a[_0x15d3('0x2d')]['includeAll']){_0x4e5840[_0x15d3('0x3e')]=[{'all':!![]}];}return db[_0x15d3('0x3d')]['findAll'](_0x4e5840);})['then'](function(_0x108254){_0x5a2ccf[_0x15d3('0x3f')]=_0x108254;return _0x5a2ccf;})[_0x15d3('0x21')](respondWithFilteredResult(_0x164aa1,_0x4e5840))[_0x15d3('0x40')](handleError(_0x164aa1,null));};exports[_0x15d3('0x41')]=function(_0x473dae,_0x1240e5){var _0x442faf={'raw':!![],'where':{'id':_0x473dae[_0x15d3('0x42')]['id']}},_0x25fa1d={};_0x25fa1d['model']=_[_0x15d3('0x2e')](db[_0x15d3('0x3d')]['rawAttributes']);_0x25fa1d[_0x15d3('0x2d')]=_['keys'](_0x473dae['query']);_0x25fa1d[_0x15d3('0x2f')]=_[_0x15d3('0x30')](_0x25fa1d[_0x15d3('0x2c')],_0x25fa1d['query']);_0x442faf[_0x15d3('0x31')]=_['intersection'](_0x25fa1d[_0x15d3('0x2c')],qs[_0x15d3('0x32')](_0x473dae[_0x15d3('0x2d')][_0x15d3('0x32')]));_0x442faf[_0x15d3('0x31')]=_0x442faf['attributes']['length']?_0x442faf['attributes']:_0x25fa1d[_0x15d3('0x2c')];if(_0x473dae['query'][_0x15d3('0x43')]){_0x442faf[_0x15d3('0x3e')]=[{'all':!![]}];}_0x442faf=_[_0x15d3('0x3b')]({},_0x442faf,_0x473dae['options']);return db[_0x15d3('0x3d')][_0x15d3('0x44')](_0x442faf)[_0x15d3('0x21')](handleEntityNotFound(_0x1240e5,null))[_0x15d3('0x21')](respondWithResult(_0x1240e5,null))[_0x15d3('0x40')](handleError(_0x1240e5,null));};exports[_0x15d3('0x45')]=function(_0x62ccb9,_0x46a39a){return db[_0x15d3('0x3d')][_0x15d3('0x45')](_0x62ccb9[_0x15d3('0x46')],{})[_0x15d3('0x21')](respondWithResult(_0x46a39a,0xc9))['catch'](handleError(_0x46a39a,null));};exports['update']=function(_0x264487,_0x446929){if(_0x264487[_0x15d3('0x46')]['id']){delete _0x264487['body']['id'];}return db['FaxQueueReport'][_0x15d3('0x44')]({'where':{'id':_0x264487['params']['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x446929,null))['then'](saveUpdates(_0x264487[_0x15d3('0x46')],null))[_0x15d3('0x21')](respondWithResult(_0x446929,null))['catch'](handleError(_0x446929,null));};exports['destroy']=function(_0x480c9d,_0x5222bf){return db['FaxQueueReport'][_0x15d3('0x44')]({'where':{'id':_0x480c9d[_0x15d3('0x42')]['id']}})['then'](handleEntityNotFound(_0x5222bf,null))[_0x15d3('0x21')](removeEntity(_0x5222bf,null))[_0x15d3('0x40')](handleError(_0x5222bf,null));};exports[_0x15d3('0x47')]=function(_0x51997f,_0x19d713){return db[_0x15d3('0x3d')][_0x15d3('0x47')]()[_0x15d3('0x21')](respondWithResult(_0x19d713,null))[_0x15d3('0x40')](handleError(_0x19d713,null));}; \ No newline at end of file +var _0x7119=['fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','FaxQueueReport','rows','catch','show','params','keys','include','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x1c10b2,_0x4cb573){var _0x453bc5=function(_0x2948c2){while(--_0x2948c2){_0x1c10b2['push'](_0x1c10b2['shift']());}};_0x453bc5(++_0x4cb573);}(_0x7119,0x1c7));var _0x9711=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x7119[_0x5eb22e];return _0x27fed5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9711('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9711('0x1'));var rp=require('request-promise');var moment=require(_0x9711('0x2'));var BPromise=require(_0x9711('0x3'));var Mustache=require(_0x9711('0x4'));var util=require(_0x9711('0x5'));var path=require('path');var sox=require(_0x9711('0x6'));var csv=require(_0x9711('0x7'));var ejs=require(_0x9711('0x8'));var fs=require('fs');var fs_extra=require(_0x9711('0x9'));var _=require(_0x9711('0xa'));var squel=require('squel');var crypto=require(_0x9711('0xb'));var jsforce=require(_0x9711('0xc'));var deskjs=require(_0x9711('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9711('0xe'));var Papa=require('papaparse');var Redis=require(_0x9711('0xf'));var authService=require(_0x9711('0x10'));var qs=require(_0x9711('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9711('0x12'));var logger=require(_0x9711('0x13'))(_0x9711('0x14'));var utils=require(_0x9711('0x15'));var config=require(_0x9711('0x16'));var licenseUtil=require(_0x9711('0x17'));var db=require(_0x9711('0x18'))['db'];function respondWithStatusCode(_0x13525d,_0xdcc5ec){_0xdcc5ec=_0xdcc5ec||0xcc;return function(_0x33249b){if(_0x33249b){return _0x13525d[_0x9711('0x19')](_0xdcc5ec);}return _0x13525d['status'](_0xdcc5ec)['end']();};}function respondWithResult(_0x2c4fc0,_0x38d721){_0x38d721=_0x38d721||0xc8;return function(_0x449c99){if(_0x449c99){return _0x2c4fc0[_0x9711('0x1a')](_0x38d721)[_0x9711('0x1b')](_0x449c99);}};}function respondWithFilteredResult(_0x592a2e,_0x3f8a3d){return function(_0x5324ce){if(_0x5324ce){var _0x376f3c=typeof _0x3f8a3d[_0x9711('0x1c')]===_0x9711('0x1d')&&typeof _0x3f8a3d[_0x9711('0x1e')]===_0x9711('0x1d');var _0x5e5816=_0x5324ce['count'];var _0x2ef16c=_0x376f3c?0x0:_0x3f8a3d[_0x9711('0x1c')];var _0x210f8b=_0x376f3c?_0x5324ce[_0x9711('0x1f')]:_0x3f8a3d[_0x9711('0x1c')]+_0x3f8a3d['limit'];var _0x3690e7;if(_0x210f8b>=_0x5e5816){_0x210f8b=_0x5e5816;_0x3690e7=0xc8;}else{_0x3690e7=0xce;}_0x592a2e[_0x9711('0x1a')](_0x3690e7);return _0x592a2e[_0x9711('0x20')](_0x9711('0x21'),_0x2ef16c+'-'+_0x210f8b+'/'+_0x5e5816)['json'](_0x5324ce);}return null;};}function patchUpdates(_0x5589b5){return function(_0x55b6d7){try{jsonpatch[_0x9711('0x22')](_0x55b6d7,_0x5589b5,!![]);}catch(_0x283703){return BPromise[_0x9711('0x23')](_0x283703);}return _0x55b6d7['save']();};}function saveUpdates(_0x3f3aa2,_0x3f3859){return function(_0x4ac003){if(_0x4ac003){return _0x4ac003[_0x9711('0x24')](_0x3f3aa2)['then'](function(_0x2dbb58){return _0x2dbb58;});}return null;};}function removeEntity(_0x4f363a,_0x3023cf){return function(_0x124eb7){if(_0x124eb7){return _0x124eb7['destroy']()[_0x9711('0x25')](function(){_0x4f363a[_0x9711('0x1a')](0xcc)[_0x9711('0x26')]();});}};}function handleEntityNotFound(_0x2db327,_0x4d2438){return function(_0x50726b){if(!_0x50726b){_0x2db327[_0x9711('0x19')](0x194);}return _0x50726b;};}function handleError(_0x1be579,_0x5e3eda){_0x5e3eda=_0x5e3eda||0x1f4;return function(_0x4d16e5){logger['error'](_0x4d16e5['stack']);if(_0x4d16e5[_0x9711('0x27')]){delete _0x4d16e5[_0x9711('0x27')];}_0x1be579['status'](_0x5e3eda)[_0x9711('0x28')](_0x4d16e5);};}exports['index']=function(_0x3ab10d,_0x38e357){var _0x5eff02={},_0x3fc5bb={},_0x1db611={'count':0x0,'rows':[]};var _0x3c6da4=_[_0x9711('0x29')](db['FaxQueueReport'][_0x9711('0x2a')],function(_0x346b70){return{'name':_0x346b70[_0x9711('0x2b')],'type':_0x346b70['type'][_0x9711('0x2c')]};});_0x3fc5bb[_0x9711('0x2d')]=_[_0x9711('0x29')](_0x3c6da4,_0x9711('0x27'));_0x3fc5bb['query']=_['keys'](_0x3ab10d[_0x9711('0x2e')]);_0x3fc5bb[_0x9711('0x2f')]=_[_0x9711('0x30')](_0x3fc5bb[_0x9711('0x2d')],_0x3fc5bb['query']);_0x5eff02['attributes']=_['intersection'](_0x3fc5bb['model'],qs['fields'](_0x3ab10d[_0x9711('0x2e')][_0x9711('0x31')]));_0x5eff02[_0x9711('0x32')]=_0x5eff02[_0x9711('0x32')][_0x9711('0x33')]?_0x5eff02[_0x9711('0x32')]:_0x3fc5bb[_0x9711('0x2d')];if(!_0x3ab10d[_0x9711('0x2e')][_0x9711('0x34')](_0x9711('0x35'))){_0x5eff02['limit']=qs[_0x9711('0x1e')](_0x3ab10d[_0x9711('0x2e')][_0x9711('0x1e')]);_0x5eff02[_0x9711('0x1c')]=qs[_0x9711('0x1c')](_0x3ab10d[_0x9711('0x2e')][_0x9711('0x1c')]);}_0x5eff02['order']=qs[_0x9711('0x36')](_0x3ab10d[_0x9711('0x2e')][_0x9711('0x36')]);_0x5eff02[_0x9711('0x37')]=qs[_0x9711('0x2f')](_[_0x9711('0x38')](_0x3ab10d[_0x9711('0x2e')],_0x3fc5bb[_0x9711('0x2f')]),_0x3c6da4);if(_0x3ab10d[_0x9711('0x2e')][_0x9711('0x39')]){_0x5eff02[_0x9711('0x37')]=_['merge'](_0x5eff02[_0x9711('0x37')],{'$or':_[_0x9711('0x29')](_0x3c6da4,function(_0x252d73){if(_0x252d73['type']!==_0x9711('0x3a')){var _0x5541d7={};_0x5541d7[_0x252d73[_0x9711('0x27')]]={'$like':'%'+_0x3ab10d[_0x9711('0x2e')]['filter']+'%'};return _0x5541d7;}})});}_0x5eff02=_[_0x9711('0x3b')]({},_0x5eff02,_0x3ab10d[_0x9711('0x3c')]);var _0x208d36={'where':_0x5eff02[_0x9711('0x37')]};return db['FaxQueueReport'][_0x9711('0x1f')](_0x208d36)[_0x9711('0x25')](function(_0xa0e9e4){_0x1db611[_0x9711('0x1f')]=_0xa0e9e4;if(_0x3ab10d['query']['includeAll']){_0x5eff02['include']=[{'all':!![]}];}return db[_0x9711('0x3d')]['findAll'](_0x5eff02);})[_0x9711('0x25')](function(_0x1bb299){_0x1db611[_0x9711('0x3e')]=_0x1bb299;return _0x1db611;})[_0x9711('0x25')](respondWithFilteredResult(_0x38e357,_0x5eff02))[_0x9711('0x3f')](handleError(_0x38e357,null));};exports[_0x9711('0x40')]=function(_0x4a0e2b,_0x242477){var _0x483cb7={'raw':!![],'where':{'id':_0x4a0e2b[_0x9711('0x41')]['id']}},_0x1b93f2={};_0x1b93f2[_0x9711('0x2d')]=_[_0x9711('0x42')](db[_0x9711('0x3d')][_0x9711('0x2a')]);_0x1b93f2['query']=_[_0x9711('0x42')](_0x4a0e2b[_0x9711('0x2e')]);_0x1b93f2['filters']=_['intersection'](_0x1b93f2[_0x9711('0x2d')],_0x1b93f2[_0x9711('0x2e')]);_0x483cb7[_0x9711('0x32')]=_[_0x9711('0x30')](_0x1b93f2[_0x9711('0x2d')],qs[_0x9711('0x31')](_0x4a0e2b[_0x9711('0x2e')][_0x9711('0x31')]));_0x483cb7[_0x9711('0x32')]=_0x483cb7[_0x9711('0x32')][_0x9711('0x33')]?_0x483cb7[_0x9711('0x32')]:_0x1b93f2[_0x9711('0x2d')];if(_0x4a0e2b['query']['includeAll']){_0x483cb7[_0x9711('0x43')]=[{'all':!![]}];}_0x483cb7=_[_0x9711('0x3b')]({},_0x483cb7,_0x4a0e2b[_0x9711('0x3c')]);return db['FaxQueueReport'][_0x9711('0x44')](_0x483cb7)[_0x9711('0x25')](handleEntityNotFound(_0x242477,null))[_0x9711('0x25')](respondWithResult(_0x242477,null))[_0x9711('0x3f')](handleError(_0x242477,null));};exports[_0x9711('0x45')]=function(_0x1cc16e,_0x4c6362){return db[_0x9711('0x3d')]['create'](_0x1cc16e[_0x9711('0x46')],{})[_0x9711('0x25')](respondWithResult(_0x4c6362,0xc9))[_0x9711('0x3f')](handleError(_0x4c6362,null));};exports[_0x9711('0x24')]=function(_0x3c0a49,_0xbd198a){if(_0x3c0a49[_0x9711('0x46')]['id']){delete _0x3c0a49[_0x9711('0x46')]['id'];}return db['FaxQueueReport'][_0x9711('0x44')]({'where':{'id':_0x3c0a49[_0x9711('0x41')]['id']}})[_0x9711('0x25')](handleEntityNotFound(_0xbd198a,null))[_0x9711('0x25')](saveUpdates(_0x3c0a49[_0x9711('0x46')],null))[_0x9711('0x25')](respondWithResult(_0xbd198a,null))[_0x9711('0x3f')](handleError(_0xbd198a,null));};exports['destroy']=function(_0x13c539,_0x3ed8a0){return db[_0x9711('0x3d')][_0x9711('0x44')]({'where':{'id':_0x13c539[_0x9711('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ed8a0,null))[_0x9711('0x25')](removeEntity(_0x3ed8a0,null))[_0x9711('0x3f')](handleError(_0x3ed8a0,null));};exports['describe']=function(_0x327b49,_0x5d0d74){return db[_0x9711('0x3d')][_0x9711('0x47')]()['then'](respondWithResult(_0x5d0d74,null))[_0x9711('0x3f')](handleError(_0x5d0d74,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 5140a9c..9f6d976 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 _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1d36b7,_0xd45c71){var _0x3af6aa=function(_0x2af000){while(--_0x2af000){_0x1d36b7['push'](_0x1d36b7['shift']());}};_0x3af6aa(++_0xd45c71);}(_0x4975,0x86));var _0x5497=function(_0x56c3f8,_0x11b6e6){_0x56c3f8=_0x56c3f8-0x0;var _0x2d5a67=_0x4975[_0x56c3f8];return _0x2d5a67;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x8929a1,_0x25516b){var _0x5102cc=function(_0x2d128e){while(--_0x2d128e){_0x8929a1['push'](_0x8929a1['shift']());}};_0x5102cc(++_0x25516b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x5fc3[_0x4bb2b9];return _0x40e2a2;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 22a0983..986a950 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 _0xb84c=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','catch','UpdateFaxQueueReport','body','where','attributes','limit','debug'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xb84c,0x1f0));var _0xcb84=function(_0x5a8e00,_0x9d3c22){_0x5a8e00=_0x5a8e00-0x0;var _0x41b217=_0xb84c[_0x5a8e00];return _0x41b217;};'use strict';var _=require(_0xcb84('0x0'));var util=require(_0xcb84('0x1'));var moment=require('moment');var BPromise=require(_0xcb84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb84('0x3'))['db'];var utils=require(_0xcb84('0x4'));var logger=require(_0xcb84('0x5'))(_0xcb84('0x6'));var config=require(_0xcb84('0x7'));var jayson=require(_0xcb84('0x8'));var client=jayson[_0xcb84('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5723c6,_0x5b42e1,_0x5b2bcb){return new BPromise(function(_0x541d75,_0x220993){return client[_0xcb84('0xa')](_0x5723c6,_0x5b2bcb)[_0xcb84('0xb')](function(_0x5b8d2e){logger[_0xcb84('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x5b42e1,_0xcb84('0xd'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x5b42e1,_0xcb84('0xd'),JSON[_0xcb84('0xe')](_0x5b8d2e));if(_0x5b8d2e['error']){if(_0x5b8d2e[_0xcb84('0xf')][_0xcb84('0x10')]===0x1f4){logger[_0xcb84('0xf')](_0xcb84('0x11'),_0x5b42e1,_0x5b8d2e['error'][_0xcb84('0x12')]);return _0x220993(_0x5b8d2e[_0xcb84('0xf')]['message']);}logger['error'](_0xcb84('0x11'),_0x5b42e1,_0x5b8d2e[_0xcb84('0xf')][_0xcb84('0x12')]);return _0x541d75(_0x5b8d2e[_0xcb84('0xf')][_0xcb84('0x12')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5b42e1,'request\x20sent');_0x541d75(_0x5b8d2e[_0xcb84('0x13')][_0xcb84('0x12')]);}})['catch'](function(_0x5d37b4){logger[_0xcb84('0xf')](_0xcb84('0x11'),_0x5b42e1,_0x5d37b4);_0x220993(_0x5d37b4);});});}exports[_0xcb84('0x14')]=function(_0x2eaf9a){var _0x5727e1=this;return new Promise(function(_0x5735fc,_0x3cc839){return db[_0xcb84('0x15')][_0xcb84('0x16')](_0x2eaf9a['body'],{'raw':_0x2eaf9a[_0xcb84('0x17')]?_0x2eaf9a[_0xcb84('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x39b91d){logger['info'](_0xcb84('0x14'),_0x2eaf9a);logger['debug']('CreateFaxQueueReport',_0x2eaf9a,JSON['stringify'](_0x39b91d));_0x5735fc(_0x39b91d);})[_0xcb84('0x18')](function(_0x5c3798){logger[_0xcb84('0xf')]('CreateFaxQueueReport',_0x5c3798[_0xcb84('0x12')],_0x2eaf9a);_0x3cc839(_0x5727e1[_0xcb84('0xf')](0x1f4,_0x5c3798['message']));});});};exports[_0xcb84('0x19')]=function(_0x1cac08){var _0x3cfc6b=this;return new Promise(function(_0x329ee0,_0x554664){return db['FaxQueueReport']['update'](_0x1cac08[_0xcb84('0x1a')],{'raw':_0x1cac08[_0xcb84('0x17')]?_0x1cac08[_0xcb84('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cac08['options']?_0x1cac08['options'][_0xcb84('0x1b')]||null:null,'attributes':_0x1cac08['options']?_0x1cac08[_0xcb84('0x17')][_0xcb84('0x1c')]||null:null,'limit':_0x1cac08['options']?_0x1cac08[_0xcb84('0x17')][_0xcb84('0x1d')]||null:null})[_0xcb84('0xb')](function(_0x1fee99){logger[_0xcb84('0xc')]('UpdateFaxQueueReport',_0x1cac08);logger[_0xcb84('0x1e')](_0xcb84('0x19'),_0x1cac08,JSON['stringify'](_0x1fee99));_0x329ee0(_0x1fee99);})[_0xcb84('0x18')](function(_0x2ad75a){logger[_0xcb84('0xf')](_0xcb84('0x19'),_0x2ad75a[_0xcb84('0x12')],_0x1cac08);_0x554664(_0x3cfc6b[_0xcb84('0xf')](0x1f4,_0x2ad75a[_0xcb84('0x12')]));});});}; \ No newline at end of file +var _0xd4cc=['client','http','request','info','request\x20sent','debug','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','create','body','options','raw','then','FaxQueueReport','update','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','../../config/logger','jayson/promise'];(function(_0x498357,_0x21aaac){var _0x4c65c8=function(_0x1bd764){while(--_0x1bd764){_0x498357['push'](_0x498357['shift']());}};_0x4c65c8(++_0x21aaac);}(_0xd4cc,0xd2));var _0xcd4c=function(_0x6a1b35,_0x44d26a){_0x6a1b35=_0x6a1b35-0x0;var _0x4be591=_0xd4cc[_0x6a1b35];return _0x4be591;};'use strict';var _=require(_0xcd4c('0x0'));var util=require(_0xcd4c('0x1'));var moment=require(_0xcd4c('0x2'));var BPromise=require(_0xcd4c('0x3'));var rs=require(_0xcd4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd4c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd4c('0x6'));var client=jayson[_0xcd4c('0x7')][_0xcd4c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cbc9a,_0x1f4e29,_0x3b59ac){return new BPromise(function(_0x393b99,_0xb0ff36){return client[_0xcd4c('0x9')](_0x3cbc9a,_0x3b59ac)['then'](function(_0x2b564d){logger[_0xcd4c('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x1f4e29,_0xcd4c('0xb'));logger[_0xcd4c('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1f4e29,_0xcd4c('0xb'),JSON[_0xcd4c('0xd')](_0x2b564d));if(_0x2b564d['error']){if(_0x2b564d[_0xcd4c('0xe')]['code']===0x1f4){logger['error'](_0xcd4c('0xf'),_0x1f4e29,_0x2b564d[_0xcd4c('0xe')][_0xcd4c('0x10')]);return _0xb0ff36(_0x2b564d['error'][_0xcd4c('0x10')]);}logger[_0xcd4c('0xe')](_0xcd4c('0xf'),_0x1f4e29,_0x2b564d['error'][_0xcd4c('0x10')]);return _0x393b99(_0x2b564d[_0xcd4c('0xe')][_0xcd4c('0x10')]);}else{logger[_0xcd4c('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x1f4e29,'request\x20sent');_0x393b99(_0x2b564d[_0xcd4c('0x11')][_0xcd4c('0x10')]);}})[_0xcd4c('0x12')](function(_0xee86dd){logger['error'](_0xcd4c('0xf'),_0x1f4e29,_0xee86dd);_0xb0ff36(_0xee86dd);});});}exports[_0xcd4c('0x13')]=function(_0x2288df){var _0x1eb306=this;return new Promise(function(_0x11a7c6,_0x530425){return db['FaxQueueReport'][_0xcd4c('0x14')](_0x2288df[_0xcd4c('0x15')],{'raw':_0x2288df[_0xcd4c('0x16')]?_0x2288df[_0xcd4c('0x16')][_0xcd4c('0x17')]===undefined?!![]:![]:!![]})[_0xcd4c('0x18')](function(_0x292850){logger[_0xcd4c('0xa')](_0xcd4c('0x13'),_0x2288df);logger['debug']('CreateFaxQueueReport',_0x2288df,JSON[_0xcd4c('0xd')](_0x292850));_0x11a7c6(_0x292850);})[_0xcd4c('0x12')](function(_0x2f3343){logger['error'](_0xcd4c('0x13'),_0x2f3343[_0xcd4c('0x10')],_0x2288df);_0x530425(_0x1eb306[_0xcd4c('0xe')](0x1f4,_0x2f3343[_0xcd4c('0x10')]));});});};exports['UpdateFaxQueueReport']=function(_0x504e01){var _0x25ed22=this;return new Promise(function(_0x4c7379,_0x55522b){return db[_0xcd4c('0x19')][_0xcd4c('0x1a')](_0x504e01['body'],{'raw':_0x504e01[_0xcd4c('0x16')]?_0x504e01[_0xcd4c('0x16')][_0xcd4c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x504e01[_0xcd4c('0x16')]?_0x504e01[_0xcd4c('0x16')][_0xcd4c('0x1b')]||null:null,'attributes':_0x504e01[_0xcd4c('0x16')]?_0x504e01[_0xcd4c('0x16')][_0xcd4c('0x1c')]||null:null,'limit':_0x504e01['options']?_0x504e01[_0xcd4c('0x16')][_0xcd4c('0x1d')]||null:null})[_0xcd4c('0x18')](function(_0x576259){logger[_0xcd4c('0xa')]('UpdateFaxQueueReport',_0x504e01);logger[_0xcd4c('0xc')](_0xcd4c('0x1e'),_0x504e01,JSON[_0xcd4c('0xd')](_0x576259));_0x4c7379(_0x576259);})['catch'](function(_0xe52db2){logger['error'](_0xcd4c('0x1e'),_0xe52db2[_0xcd4c('0x10')],_0x504e01);_0x55522b(_0x25ed22['error'](0x1f4,_0xe52db2['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e889227..67c2ab5 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 _0x9f3b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','isAuthenticated','/:id','show','post','create','delete','util','connect-timeout','express','Router','fs-extra'];(function(_0x91d46c,_0x2ec5cc){var _0x576889=function(_0x486c5c){while(--_0x486c5c){_0x91d46c['push'](_0x91d46c['shift']());}};_0x576889(++_0x2ec5cc);}(_0x9f3b,0x1b5));var _0xb9f3=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x9f3b[_0x11ce46];return _0x368a1e;};'use strict';var multer=require('multer');var util=require(_0xb9f3('0x0'));var path=require('path');var timeout=require(_0xb9f3('0x1'));var express=require(_0xb9f3('0x2'));var router=express[_0xb9f3('0x3')]();var fs_extra=require(_0xb9f3('0x4'));var auth=require(_0xb9f3('0x5'));var interaction=require(_0xb9f3('0x6'));var config=require(_0xb9f3('0x7'));var controller=require(_0xb9f3('0x8'));router[_0xb9f3('0x9')]('/',auth['isAuthenticated'](),controller[_0xb9f3('0xa')]);router[_0xb9f3('0x9')]('/describe',auth[_0xb9f3('0xb')](),controller['describe']);router[_0xb9f3('0x9')](_0xb9f3('0xc'),auth[_0xb9f3('0xb')](),controller[_0xb9f3('0xd')]);router[_0xb9f3('0xe')]('/',auth[_0xb9f3('0xb')](),controller[_0xb9f3('0xf')]);router['put']('/:id',auth[_0xb9f3('0xb')](),controller['update']);router[_0xb9f3('0x10')](_0xb9f3('0xc'),auth[_0xb9f3('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1129=['update','delete','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x616646,_0x43e459){var _0x186a64=function(_0x2d951a){while(--_0x2d951a){_0x616646['push'](_0x616646['shift']());}};_0x186a64(++_0x43e459);}(_0x1129,0xd4));var _0x9112=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1129[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x9112('0x0'));var util=require(_0x9112('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9112('0x2'));var router=express['Router']();var fs_extra=require(_0x9112('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9112('0x4'));var config=require(_0x9112('0x5'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x9112('0x6')](),controller[_0x9112('0x7')]);router[_0x9112('0x8')](_0x9112('0x9'),auth[_0x9112('0x6')](),controller[_0x9112('0xa')]);router[_0x9112('0x8')](_0x9112('0xb'),auth[_0x9112('0x6')](),controller[_0x9112('0xc')]);router[_0x9112('0xd')]('/',auth['isAuthenticated'](),controller[_0x9112('0xe')]);router[_0x9112('0xf')]('/:id',auth[_0x9112('0x6')](),controller[_0x9112('0x10')]);router[_0x9112('0x11')](_0x9112('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9112('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9275497..c5cfae9 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0xb43b,0x1b2));var _0xbb43=function(_0xd28f4c,_0x13f0df){_0xd28f4c=_0xd28f4c-0x0;var _0x306f8d=_0xb43b[_0xd28f4c];return _0x306f8d;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2f9e55,_0x520cc6){var _0x4fc13b=function(_0x474b79){while(--_0x474b79){_0x2f9e55['push'](_0x2f9e55['shift']());}};_0x4fc13b(++_0x520cc6);}(_0x008c,0x188));var _0xc008=function(_0x1e271f,_0xf14504){_0x1e271f=_0x1e271f-0x0;var _0x2b2ac5=_0x008c[_0x1e271f];return _0x2b2ac5;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 7f12dad..5d04b65 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 _0x6851=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','FaxTransferReport','type','key','model','query','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x15df1e,_0x50d8c4){var _0x6f5df6=function(_0x35ce1d){while(--_0x35ce1d){_0x15df1e['push'](_0x15df1e['shift']());}};_0x6f5df6(++_0x50d8c4);}(_0x6851,0x81));var _0x1685=function(_0xc5b753,_0x10a712){_0xc5b753=_0xc5b753-0x0;var _0x5805bb=_0x6851[_0xc5b753];return _0x5805bb;};'use strict';var emlformat=require(_0x1685('0x0'));var rimraf=require(_0x1685('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1685('0x2'));var moment=require('moment');var BPromise=require(_0x1685('0x3'));var Mustache=require(_0x1685('0x4'));var util=require(_0x1685('0x5'));var path=require('path');var sox=require(_0x1685('0x6'));var csv=require('to-csv');var ejs=require(_0x1685('0x7'));var fs=require('fs');var fs_extra=require(_0x1685('0x8'));var _=require(_0x1685('0x9'));var squel=require('squel');var crypto=require(_0x1685('0xa'));var jsforce=require(_0x1685('0xb'));var deskjs=require(_0x1685('0xc'));var toCsv=require(_0x1685('0xd'));var querystring=require(_0x1685('0xe'));var Papa=require('papaparse');var Redis=require(_0x1685('0xf'));var authService=require(_0x1685('0x10'));var qs=require(_0x1685('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1685('0x12'))(_0x1685('0x13'));var utils=require(_0x1685('0x14'));var config=require(_0x1685('0x15'));var licenseUtil=require(_0x1685('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19318f,_0x24d9c0){_0x24d9c0=_0x24d9c0||0xcc;return function(_0x17ee43){if(_0x17ee43){return _0x19318f[_0x1685('0x17')](_0x24d9c0);}return _0x19318f['status'](_0x24d9c0)[_0x1685('0x18')]();};}function respondWithResult(_0xc63d7b,_0x3449d0){_0x3449d0=_0x3449d0||0xc8;return function(_0x55ff74){if(_0x55ff74){return _0xc63d7b[_0x1685('0x19')](_0x3449d0)['json'](_0x55ff74);}};}function respondWithFilteredResult(_0x339ce0,_0x47d09a){return function(_0x466068){if(_0x466068){var _0x1a7237=typeof _0x47d09a[_0x1685('0x1a')]===_0x1685('0x1b')&&typeof _0x47d09a[_0x1685('0x1c')]==='undefined';var _0x13a90d=_0x466068[_0x1685('0x1d')];var _0xcd9250=_0x1a7237?0x0:_0x47d09a[_0x1685('0x1a')];var _0x48b876=_0x1a7237?_0x466068[_0x1685('0x1d')]:_0x47d09a['offset']+_0x47d09a[_0x1685('0x1c')];var _0x1695a4;if(_0x48b876>=_0x13a90d){_0x48b876=_0x13a90d;_0x1695a4=0xc8;}else{_0x1695a4=0xce;}_0x339ce0[_0x1685('0x19')](_0x1695a4);return _0x339ce0[_0x1685('0x1e')](_0x1685('0x1f'),_0xcd9250+'-'+_0x48b876+'/'+_0x13a90d)[_0x1685('0x20')](_0x466068);}return null;};}function patchUpdates(_0x3788c2){return function(_0xb727b1){try{jsonpatch[_0x1685('0x21')](_0xb727b1,_0x3788c2,!![]);}catch(_0x1c230b){return BPromise[_0x1685('0x22')](_0x1c230b);}return _0xb727b1[_0x1685('0x23')]();};}function saveUpdates(_0x46b8e6,_0x57e7e1){return function(_0x382ad3){if(_0x382ad3){return _0x382ad3[_0x1685('0x24')](_0x46b8e6)[_0x1685('0x25')](function(_0x37f0ae){return _0x37f0ae;});}return null;};}function removeEntity(_0x1a8ff0,_0x1b7be9){return function(_0x41f235){if(_0x41f235){return _0x41f235['destroy']()[_0x1685('0x25')](function(){_0x1a8ff0['status'](0xcc)[_0x1685('0x18')]();});}};}function handleEntityNotFound(_0xc5fb50,_0x15ee23){return function(_0x1302ff){if(!_0x1302ff){_0xc5fb50[_0x1685('0x17')](0x194);}return _0x1302ff;};}function handleError(_0x161a8d,_0x12d0af){_0x12d0af=_0x12d0af||0x1f4;return function(_0x5dc5f0){logger[_0x1685('0x26')](_0x5dc5f0[_0x1685('0x27')]);if(_0x5dc5f0['name']){delete _0x5dc5f0[_0x1685('0x28')];}_0x161a8d[_0x1685('0x19')](_0x12d0af)[_0x1685('0x29')](_0x5dc5f0);};}exports[_0x1685('0x2a')]=function(_0x1c1d3b,_0x4e8e67){var _0x35d017={},_0xda0385={},_0x34b324={'count':0x0,'rows':[]};var _0x28318f=_[_0x1685('0x2b')](db[_0x1685('0x2c')]['rawAttributes'],function(_0x4e358c){return{'name':_0x4e358c['fieldName'],'type':_0x4e358c[_0x1685('0x2d')][_0x1685('0x2e')]};});_0xda0385[_0x1685('0x2f')]=_[_0x1685('0x2b')](_0x28318f,_0x1685('0x28'));_0xda0385[_0x1685('0x30')]=_['keys'](_0x1c1d3b['query']);_0xda0385['filters']=_[_0x1685('0x31')](_0xda0385['model'],_0xda0385['query']);_0x35d017[_0x1685('0x32')]=_[_0x1685('0x31')](_0xda0385[_0x1685('0x2f')],qs['fields'](_0x1c1d3b[_0x1685('0x30')][_0x1685('0x33')]));_0x35d017[_0x1685('0x32')]=_0x35d017[_0x1685('0x32')][_0x1685('0x34')]?_0x35d017[_0x1685('0x32')]:_0xda0385['model'];if(!_0x1c1d3b[_0x1685('0x30')]['hasOwnProperty']('nolimit')){_0x35d017[_0x1685('0x1c')]=qs[_0x1685('0x1c')](_0x1c1d3b['query'][_0x1685('0x1c')]);_0x35d017[_0x1685('0x1a')]=qs[_0x1685('0x1a')](_0x1c1d3b[_0x1685('0x30')][_0x1685('0x1a')]);}_0x35d017[_0x1685('0x35')]=qs[_0x1685('0x36')](_0x1c1d3b[_0x1685('0x30')][_0x1685('0x36')]);_0x35d017[_0x1685('0x37')]=qs['filters'](_[_0x1685('0x38')](_0x1c1d3b['query'],_0xda0385[_0x1685('0x39')]),_0x28318f);if(_0x1c1d3b[_0x1685('0x30')][_0x1685('0x3a')]){_0x35d017[_0x1685('0x37')]=_[_0x1685('0x3b')](_0x35d017[_0x1685('0x37')],{'$or':_[_0x1685('0x2b')](_0x28318f,function(_0x4df0e0){if(_0x4df0e0[_0x1685('0x2d')]!=='VIRTUAL'){var _0x50aa2a={};_0x50aa2a[_0x4df0e0[_0x1685('0x28')]]={'$like':'%'+_0x1c1d3b[_0x1685('0x30')][_0x1685('0x3a')]+'%'};return _0x50aa2a;}})});}_0x35d017=_[_0x1685('0x3b')]({},_0x35d017,_0x1c1d3b[_0x1685('0x3c')]);var _0x484d8c={'where':_0x35d017[_0x1685('0x37')]};return db[_0x1685('0x2c')][_0x1685('0x1d')](_0x484d8c)[_0x1685('0x25')](function(_0x33d6bf){_0x34b324[_0x1685('0x1d')]=_0x33d6bf;if(_0x1c1d3b[_0x1685('0x30')][_0x1685('0x3d')]){_0x35d017[_0x1685('0x3e')]=[{'all':!![]}];}return db[_0x1685('0x2c')]['findAll'](_0x35d017);})['then'](function(_0x5ddb7f){_0x34b324[_0x1685('0x3f')]=_0x5ddb7f;return _0x34b324;})[_0x1685('0x25')](respondWithFilteredResult(_0x4e8e67,_0x35d017))['catch'](handleError(_0x4e8e67,null));};exports[_0x1685('0x40')]=function(_0x4e8250,_0x43014a){var _0x1cd7eb={'raw':!![],'where':{'id':_0x4e8250[_0x1685('0x41')]['id']}},_0x20eccc={};_0x20eccc[_0x1685('0x2f')]=_[_0x1685('0x42')](db[_0x1685('0x2c')]['rawAttributes']);_0x20eccc[_0x1685('0x30')]=_['keys'](_0x4e8250[_0x1685('0x30')]);_0x20eccc[_0x1685('0x39')]=_[_0x1685('0x31')](_0x20eccc[_0x1685('0x2f')],_0x20eccc[_0x1685('0x30')]);_0x1cd7eb[_0x1685('0x32')]=_[_0x1685('0x31')](_0x20eccc[_0x1685('0x2f')],qs[_0x1685('0x33')](_0x4e8250['query']['fields']));_0x1cd7eb['attributes']=_0x1cd7eb['attributes'][_0x1685('0x34')]?_0x1cd7eb[_0x1685('0x32')]:_0x20eccc[_0x1685('0x2f')];if(_0x4e8250[_0x1685('0x30')]['includeAll']){_0x1cd7eb['include']=[{'all':!![]}];}_0x1cd7eb=_[_0x1685('0x3b')]({},_0x1cd7eb,_0x4e8250['options']);return db[_0x1685('0x2c')][_0x1685('0x43')](_0x1cd7eb)['then'](handleEntityNotFound(_0x43014a,null))['then'](respondWithResult(_0x43014a,null))[_0x1685('0x44')](handleError(_0x43014a,null));};exports[_0x1685('0x45')]=function(_0x325ca6,_0x37c997){return db['FaxTransferReport'][_0x1685('0x45')](_0x325ca6[_0x1685('0x46')],{})[_0x1685('0x25')](respondWithResult(_0x37c997,0xc9))['catch'](handleError(_0x37c997,null));};exports[_0x1685('0x24')]=function(_0x42830f,_0x423431){if(_0x42830f[_0x1685('0x46')]['id']){delete _0x42830f[_0x1685('0x46')]['id'];}return db[_0x1685('0x2c')]['find']({'where':{'id':_0x42830f['params']['id']}})[_0x1685('0x25')](handleEntityNotFound(_0x423431,null))[_0x1685('0x25')](saveUpdates(_0x42830f[_0x1685('0x46')],null))['then'](respondWithResult(_0x423431,null))[_0x1685('0x44')](handleError(_0x423431,null));};exports['destroy']=function(_0x1094f4,_0x2f85bf){return db[_0x1685('0x2c')]['find']({'where':{'id':_0x1094f4[_0x1685('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f85bf,null))[_0x1685('0x25')](removeEntity(_0x2f85bf,null))[_0x1685('0x44')](handleError(_0x2f85bf,null));};exports['describe']=function(_0x8f0275,_0x36632e){return db[_0x1685('0x2c')][_0x1685('0x47')]()[_0x1685('0x25')](respondWithResult(_0x36632e,null))[_0x1685('0x44')](handleError(_0x36632e,null));}; \ No newline at end of file +var _0xd7f0=['request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','merge','where','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','rimraf','fast-json-patch'];(function(_0x55a4be,_0x5560c8){var _0x4d3d63=function(_0x1e5845){while(--_0x1e5845){_0x55a4be['push'](_0x55a4be['shift']());}};_0x4d3d63(++_0x5560c8);}(_0xd7f0,0x90));var _0x0d7f=function(_0x3956ab,_0x5ecf4f){_0x3956ab=_0x3956ab-0x0;var _0x1f919e=_0xd7f0[_0x3956ab];return _0x1f919e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d7f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d7f('0x1'));var rp=require(_0x0d7f('0x2'));var moment=require(_0x0d7f('0x3'));var BPromise=require(_0x0d7f('0x4'));var Mustache=require(_0x0d7f('0x5'));var util=require('util');var path=require(_0x0d7f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d7f('0x7'));var fs=require('fs');var fs_extra=require(_0x0d7f('0x8'));var _=require(_0x0d7f('0x9'));var squel=require('squel');var crypto=require(_0x0d7f('0xa'));var jsforce=require(_0x0d7f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d7f('0xc'));var querystring=require(_0x0d7f('0xd'));var Papa=require('papaparse');var Redis=require(_0x0d7f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d7f('0xf'));var logger=require(_0x0d7f('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x0d7f('0x11'));var licenseUtil=require(_0x0d7f('0x12'));var db=require(_0x0d7f('0x13'))['db'];function respondWithStatusCode(_0x5a76b3,_0x5a8ad4){_0x5a8ad4=_0x5a8ad4||0xcc;return function(_0x47d8ca){if(_0x47d8ca){return _0x5a76b3[_0x0d7f('0x14')](_0x5a8ad4);}return _0x5a76b3[_0x0d7f('0x15')](_0x5a8ad4)[_0x0d7f('0x16')]();};}function respondWithResult(_0x1954b7,_0x5c0361){_0x5c0361=_0x5c0361||0xc8;return function(_0x1d0507){if(_0x1d0507){return _0x1954b7[_0x0d7f('0x15')](_0x5c0361)[_0x0d7f('0x17')](_0x1d0507);}};}function respondWithFilteredResult(_0x2b4a33,_0x44e693){return function(_0x2ec82e){if(_0x2ec82e){var _0x2bcd6d=typeof _0x44e693['offset']===_0x0d7f('0x18')&&typeof _0x44e693[_0x0d7f('0x19')]===_0x0d7f('0x18');var _0x192927=_0x2ec82e[_0x0d7f('0x1a')];var _0xf375bc=_0x2bcd6d?0x0:_0x44e693[_0x0d7f('0x1b')];var _0x54912d=_0x2bcd6d?_0x2ec82e[_0x0d7f('0x1a')]:_0x44e693['offset']+_0x44e693[_0x0d7f('0x19')];var _0x4a3560;if(_0x54912d>=_0x192927){_0x54912d=_0x192927;_0x4a3560=0xc8;}else{_0x4a3560=0xce;}_0x2b4a33[_0x0d7f('0x15')](_0x4a3560);return _0x2b4a33[_0x0d7f('0x1c')](_0x0d7f('0x1d'),_0xf375bc+'-'+_0x54912d+'/'+_0x192927)[_0x0d7f('0x17')](_0x2ec82e);}return null;};}function patchUpdates(_0x59e73b){return function(_0x239ee4){try{jsonpatch[_0x0d7f('0x1e')](_0x239ee4,_0x59e73b,!![]);}catch(_0x44ce9c){return BPromise[_0x0d7f('0x1f')](_0x44ce9c);}return _0x239ee4[_0x0d7f('0x20')]();};}function saveUpdates(_0x59a8f9,_0x4f6982){return function(_0x1f5ed0){if(_0x1f5ed0){return _0x1f5ed0[_0x0d7f('0x21')](_0x59a8f9)['then'](function(_0x5de37d){return _0x5de37d;});}return null;};}function removeEntity(_0x483c60,_0x1d92aa){return function(_0x5e08af){if(_0x5e08af){return _0x5e08af['destroy']()[_0x0d7f('0x22')](function(){_0x483c60['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x532fdb,_0x22d84e){return function(_0x4b7418){if(!_0x4b7418){_0x532fdb[_0x0d7f('0x14')](0x194);}return _0x4b7418;};}function handleError(_0xa1ccde,_0x2d6e71){_0x2d6e71=_0x2d6e71||0x1f4;return function(_0x6335c5){logger[_0x0d7f('0x23')](_0x6335c5[_0x0d7f('0x24')]);if(_0x6335c5['name']){delete _0x6335c5['name'];}_0xa1ccde['status'](_0x2d6e71)[_0x0d7f('0x25')](_0x6335c5);};}exports[_0x0d7f('0x26')]=function(_0x58ea82,_0xd9d57d){var _0x4e30b5={},_0x42184a={},_0x25f122={'count':0x0,'rows':[]};var _0x21d143=_[_0x0d7f('0x27')](db[_0x0d7f('0x28')][_0x0d7f('0x29')],function(_0x56191f){return{'name':_0x56191f[_0x0d7f('0x2a')],'type':_0x56191f[_0x0d7f('0x2b')][_0x0d7f('0x2c')]};});_0x42184a[_0x0d7f('0x2d')]=_['map'](_0x21d143,_0x0d7f('0x2e'));_0x42184a[_0x0d7f('0x2f')]=_[_0x0d7f('0x30')](_0x58ea82['query']);_0x42184a[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x42184a[_0x0d7f('0x2d')],_0x42184a[_0x0d7f('0x2f')]);_0x4e30b5[_0x0d7f('0x33')]=_['intersection'](_0x42184a[_0x0d7f('0x2d')],qs[_0x0d7f('0x34')](_0x58ea82[_0x0d7f('0x2f')][_0x0d7f('0x34')]));_0x4e30b5[_0x0d7f('0x33')]=_0x4e30b5[_0x0d7f('0x33')][_0x0d7f('0x35')]?_0x4e30b5[_0x0d7f('0x33')]:_0x42184a['model'];if(!_0x58ea82[_0x0d7f('0x2f')]['hasOwnProperty'](_0x0d7f('0x36'))){_0x4e30b5[_0x0d7f('0x19')]=qs[_0x0d7f('0x19')](_0x58ea82[_0x0d7f('0x2f')]['limit']);_0x4e30b5[_0x0d7f('0x1b')]=qs['offset'](_0x58ea82['query'][_0x0d7f('0x1b')]);}_0x4e30b5['order']=qs[_0x0d7f('0x37')](_0x58ea82[_0x0d7f('0x2f')]['sort']);_0x4e30b5['where']=qs[_0x0d7f('0x31')](_[_0x0d7f('0x38')](_0x58ea82['query'],_0x42184a[_0x0d7f('0x31')]),_0x21d143);if(_0x58ea82[_0x0d7f('0x2f')][_0x0d7f('0x39')]){_0x4e30b5['where']=_[_0x0d7f('0x3a')](_0x4e30b5[_0x0d7f('0x3b')],{'$or':_[_0x0d7f('0x27')](_0x21d143,function(_0x4fa42c){if(_0x4fa42c[_0x0d7f('0x2b')]!=='VIRTUAL'){var _0x440e91={};_0x440e91[_0x4fa42c[_0x0d7f('0x2e')]]={'$like':'%'+_0x58ea82[_0x0d7f('0x2f')]['filter']+'%'};return _0x440e91;}})});}_0x4e30b5=_['merge']({},_0x4e30b5,_0x58ea82[_0x0d7f('0x3c')]);var _0x54fdf3={'where':_0x4e30b5['where']};return db[_0x0d7f('0x28')][_0x0d7f('0x1a')](_0x54fdf3)[_0x0d7f('0x22')](function(_0x551289){_0x25f122['count']=_0x551289;if(_0x58ea82['query']['includeAll']){_0x4e30b5[_0x0d7f('0x3d')]=[{'all':!![]}];}return db[_0x0d7f('0x28')][_0x0d7f('0x3e')](_0x4e30b5);})[_0x0d7f('0x22')](function(_0x38dd88){_0x25f122[_0x0d7f('0x3f')]=_0x38dd88;return _0x25f122;})[_0x0d7f('0x22')](respondWithFilteredResult(_0xd9d57d,_0x4e30b5))[_0x0d7f('0x40')](handleError(_0xd9d57d,null));};exports[_0x0d7f('0x41')]=function(_0x2e5ab0,_0xa4df2f){var _0xc8e428={'raw':!![],'where':{'id':_0x2e5ab0[_0x0d7f('0x42')]['id']}},_0x9d8ca1={};_0x9d8ca1[_0x0d7f('0x2d')]=_[_0x0d7f('0x30')](db[_0x0d7f('0x28')][_0x0d7f('0x29')]);_0x9d8ca1[_0x0d7f('0x2f')]=_[_0x0d7f('0x30')](_0x2e5ab0[_0x0d7f('0x2f')]);_0x9d8ca1[_0x0d7f('0x31')]=_[_0x0d7f('0x32')](_0x9d8ca1[_0x0d7f('0x2d')],_0x9d8ca1[_0x0d7f('0x2f')]);_0xc8e428[_0x0d7f('0x33')]=_['intersection'](_0x9d8ca1[_0x0d7f('0x2d')],qs[_0x0d7f('0x34')](_0x2e5ab0[_0x0d7f('0x2f')]['fields']));_0xc8e428[_0x0d7f('0x33')]=_0xc8e428['attributes'][_0x0d7f('0x35')]?_0xc8e428[_0x0d7f('0x33')]:_0x9d8ca1[_0x0d7f('0x2d')];if(_0x2e5ab0[_0x0d7f('0x2f')][_0x0d7f('0x43')]){_0xc8e428[_0x0d7f('0x3d')]=[{'all':!![]}];}_0xc8e428=_[_0x0d7f('0x3a')]({},_0xc8e428,_0x2e5ab0[_0x0d7f('0x3c')]);return db['FaxTransferReport'][_0x0d7f('0x44')](_0xc8e428)[_0x0d7f('0x22')](handleEntityNotFound(_0xa4df2f,null))['then'](respondWithResult(_0xa4df2f,null))[_0x0d7f('0x40')](handleError(_0xa4df2f,null));};exports[_0x0d7f('0x45')]=function(_0x153885,_0x2c4ca9){return db['FaxTransferReport']['create'](_0x153885[_0x0d7f('0x46')],{})['then'](respondWithResult(_0x2c4ca9,0xc9))[_0x0d7f('0x40')](handleError(_0x2c4ca9,null));};exports['update']=function(_0x157851,_0x1d3cc2){if(_0x157851[_0x0d7f('0x46')]['id']){delete _0x157851[_0x0d7f('0x46')]['id'];}return db[_0x0d7f('0x28')][_0x0d7f('0x44')]({'where':{'id':_0x157851[_0x0d7f('0x42')]['id']}})[_0x0d7f('0x22')](handleEntityNotFound(_0x1d3cc2,null))[_0x0d7f('0x22')](saveUpdates(_0x157851['body'],null))[_0x0d7f('0x22')](respondWithResult(_0x1d3cc2,null))[_0x0d7f('0x40')](handleError(_0x1d3cc2,null));};exports[_0x0d7f('0x47')]=function(_0x4066c3,_0xa80f42){return db['FaxTransferReport'][_0x0d7f('0x44')]({'where':{'id':_0x4066c3[_0x0d7f('0x42')]['id']}})[_0x0d7f('0x22')](handleEntityNotFound(_0xa80f42,null))['then'](removeEntity(_0xa80f42,null))[_0x0d7f('0x40')](handleError(_0xa80f42,null));};exports[_0x0d7f('0x48')]=function(_0x18e9ee,_0x52fb3a){return db[_0x0d7f('0x28')][_0x0d7f('0x48')]()['then'](respondWithResult(_0x52fb3a,null))[_0x0d7f('0x40')](handleError(_0x52fb3a,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 7352c7a..06b2b05 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 _0x98d4=['bluebird','request-promise','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x98d4,0xa3));var _0x498d=function(_0x5f27c0,_0x1af6b5){_0x5f27c0=_0x5f27c0-0x0;var _0x4d5a38=_0x98d4[_0x5f27c0];return _0x4d5a38;};'use strict';var _=require(_0x498d('0x0'));var util=require(_0x498d('0x1'));var logger=require(_0x498d('0x2'))(_0x498d('0x3'));var moment=require(_0x498d('0x4'));var BPromise=require(_0x498d('0x5'));var rp=require(_0x498d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x498d('0x7'));var config=require(_0x498d('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0x498d('0x9')]=function(_0x178e2f,_0x2e7d20){return _0x178e2f[_0x498d('0xa')](_0x498d('0xb'),attributes,{'tableName':_0x498d('0xc'),'paranoid':![],'indexes':[{'name':_0x498d('0xd'),'fields':[_0x498d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9147=['report_fax_transfer','uniqueid','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','define'];(function(_0x450fa8,_0x3fca1f){var _0x3fd9bd=function(_0x29c51b){while(--_0x29c51b){_0x450fa8['push'](_0x450fa8['shift']());}};_0x3fd9bd(++_0x3fca1f);}(_0x9147,0x7b));var _0x7914=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x9147[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x7914('0x0'));var util=require(_0x7914('0x1'));var logger=require('../../config/logger')(_0x7914('0x2'));var moment=require('moment');var BPromise=require(_0x7914('0x3'));var rp=require(_0x7914('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7914('0x5'));var config=require(_0x7914('0x6'));var attributes=require(_0x7914('0x7'));module['exports']=function(_0x34c372,_0x4dd321){return _0x34c372[_0x7914('0x8')]('FaxTransferReport',attributes,{'tableName':_0x7914('0x9'),'paranoid':![],'indexes':[{'name':_0x7914('0xa'),'fields':[_0x7914('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index fb56a85..a1f9a38 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 _0x7048=['request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s'];(function(_0x1064ab,_0x2c16f3){var _0x49679a=function(_0x39577f){while(--_0x39577f){_0x1064ab['push'](_0x1064ab['shift']());}};_0x49679a(++_0x2c16f3);}(_0x7048,0x1bf));var _0x8704=function(_0x30b615,_0x291ae9){_0x30b615=_0x30b615-0x0;var _0xb190a=_0x7048[_0x30b615];return _0xb190a;};'use strict';var _=require(_0x8704('0x0'));var util=require(_0x8704('0x1'));var moment=require(_0x8704('0x2'));var BPromise=require(_0x8704('0x3'));var rs=require(_0x8704('0x4'));var fs=require('fs');var Redis=require(_0x8704('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8704('0x6'))(_0x8704('0x7'));var config=require('../../config/environment');var jayson=require(_0x8704('0x8'));var client=jayson[_0x8704('0x9')][_0x8704('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dded7,_0x2af523,_0x5c33c1){return new BPromise(function(_0x39bb05,_0x459f1c){return client[_0x8704('0xb')](_0x4dded7,_0x5c33c1)['then'](function(_0x249a15){logger['info'](_0x8704('0xc'),_0x2af523,_0x8704('0xd'));logger['debug'](_0x8704('0xe'),_0x2af523,_0x8704('0xd'),JSON['stringify'](_0x249a15));if(_0x249a15['error']){if(_0x249a15[_0x8704('0xf')][_0x8704('0x10')]===0x1f4){logger[_0x8704('0xf')](_0x8704('0xc'),_0x2af523,_0x249a15[_0x8704('0xf')][_0x8704('0x11')]);return _0x459f1c(_0x249a15['error'][_0x8704('0x11')]);}logger[_0x8704('0xf')](_0x8704('0xc'),_0x2af523,_0x249a15[_0x8704('0xf')][_0x8704('0x11')]);return _0x39bb05(_0x249a15['error'][_0x8704('0x11')]);}else{logger[_0x8704('0x12')](_0x8704('0xc'),_0x2af523,_0x8704('0xd'));_0x39bb05(_0x249a15['result'][_0x8704('0x11')]);}})[_0x8704('0x13')](function(_0x49ed0a){logger[_0x8704('0xf')](_0x8704('0xc'),_0x2af523,_0x49ed0a);_0x459f1c(_0x49ed0a);});});} \ No newline at end of file +var _0xcf9c=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x186b45,_0x26cd97){var _0x3a54e4=function(_0x53ac12){while(--_0x53ac12){_0x186b45['push'](_0x186b45['shift']());}};_0x3a54e4(++_0x26cd97);}(_0xcf9c,0xb9));var _0xccf9=function(_0x2f6f54,_0x35db2e){_0x2f6f54=_0x2f6f54-0x0;var _0x1891bd=_0xcf9c[_0x2f6f54];return _0x1891bd;};'use strict';var _=require(_0xccf9('0x0'));var util=require(_0xccf9('0x1'));var moment=require(_0xccf9('0x2'));var BPromise=require(_0xccf9('0x3'));var rs=require(_0xccf9('0x4'));var fs=require('fs');var Redis=require(_0xccf9('0x5'));var db=require(_0xccf9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xccf9('0x7'))(_0xccf9('0x8'));var config=require(_0xccf9('0x9'));var jayson=require(_0xccf9('0xa'));var client=jayson[_0xccf9('0xb')][_0xccf9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x328663,_0x241e08,_0x576974){return new BPromise(function(_0x1a0669,_0x1fd7cb){return client[_0xccf9('0xd')](_0x328663,_0x576974)[_0xccf9('0xe')](function(_0x390c44){logger[_0xccf9('0xf')](_0xccf9('0x10'),_0x241e08,_0xccf9('0x11'));logger['debug'](_0xccf9('0x12'),_0x241e08,_0xccf9('0x11'),JSON['stringify'](_0x390c44));if(_0x390c44[_0xccf9('0x13')]){if(_0x390c44[_0xccf9('0x13')]['code']===0x1f4){logger[_0xccf9('0x13')](_0xccf9('0x10'),_0x241e08,_0x390c44[_0xccf9('0x13')][_0xccf9('0x14')]);return _0x1fd7cb(_0x390c44[_0xccf9('0x13')]['message']);}logger[_0xccf9('0x13')](_0xccf9('0x10'),_0x241e08,_0x390c44['error'][_0xccf9('0x14')]);return _0x1a0669(_0x390c44['error']['message']);}else{logger['info'](_0xccf9('0x10'),_0x241e08,_0xccf9('0x11'));_0x1a0669(_0x390c44[_0xccf9('0x15')]['message']);}})[_0xccf9('0x16')](function(_0x287fe8){logger[_0xccf9('0x13')](_0xccf9('0x10'),_0x241e08,_0x287fe8);_0x1fd7cb(_0x287fe8);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 79fedc0..50f3ddc 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 _0xbd17=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0xbd17,0x133));var _0x7bd1=function(_0x231fed,_0x5c5926){_0x231fed=_0x231fed-0x0;var _0x406388=_0xbd17[_0x231fed];return _0x406388;};'use strict';var multer=require(_0x7bd1('0x0'));var util=require(_0x7bd1('0x1'));var path=require(_0x7bd1('0x2'));var timeout=require(_0x7bd1('0x3'));var express=require(_0x7bd1('0x4'));var router=express[_0x7bd1('0x5')]();var fs_extra=require(_0x7bd1('0x6'));var auth=require(_0x7bd1('0x7'));var interaction=require(_0x7bd1('0x8'));var config=require('../../config/environment');var controller=require(_0x7bd1('0x9'));router[_0x7bd1('0xa')]('/',auth['isAuthenticated'](),controller[_0x7bd1('0xb')]);router[_0x7bd1('0xa')]('/describe',auth[_0x7bd1('0xc')](),controller[_0x7bd1('0xd')]);router[_0x7bd1('0xa')](_0x7bd1('0xe'),auth[_0x7bd1('0xc')](),controller[_0x7bd1('0xf')]);router[_0x7bd1('0x10')]('/',auth[_0x7bd1('0xc')](),controller[_0x7bd1('0x11')]);router[_0x7bd1('0x12')](_0x7bd1('0xe'),auth[_0x7bd1('0xc')](),controller[_0x7bd1('0x13')]);router[_0x7bd1('0x14')](_0x7bd1('0xe'),auth[_0x7bd1('0xc')](),controller['destroy']);module[_0x7bd1('0x15')]=router; \ No newline at end of file +var _0x159c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy'];(function(_0x5a3a03,_0x4f232b){var _0x35366c=function(_0x18944d){while(--_0x18944d){_0x5a3a03['push'](_0x5a3a03['shift']());}};_0x35366c(++_0x4f232b);}(_0x159c,0x144));var _0xc159=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x159c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc159('0x0'));var util=require(_0xc159('0x1'));var path=require(_0xc159('0x2'));var timeout=require(_0xc159('0x3'));var express=require(_0xc159('0x4'));var router=express['Router']();var fs_extra=require(_0xc159('0x5'));var auth=require(_0xc159('0x6'));var interaction=require(_0xc159('0x7'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0xc159('0x8')]('/',auth[_0xc159('0x9')](),controller[_0xc159('0xa')]);router[_0xc159('0x8')]('/describe',auth[_0xc159('0x9')](),controller[_0xc159('0xb')]);router[_0xc159('0x8')](_0xc159('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc159('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc159('0xe')](_0xc159('0xc'),auth[_0xc159('0x9')](),controller[_0xc159('0xf')]);router[_0xc159('0x10')](_0xc159('0xc'),auth['isAuthenticated'](),controller[_0xc159('0x11')]);module[_0xc159('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 55830c8..017dd2f 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 _0x50af=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','./intDeskAccount.controller'];(function(_0x334569,_0x280d47){var _0x550b77=function(_0x2bf14a){while(--_0x2bf14a){_0x334569['push'](_0x334569['shift']());}};_0x550b77(++_0x280d47);}(_0x50af,0x1d5));var _0xf50a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50af[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf50a('0x0'));var util=require(_0xf50a('0x1'));var path=require('path');var timeout=require(_0xf50a('0x2'));var express=require(_0xf50a('0x3'));var router=express['Router']();var fs_extra=require(_0xf50a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf50a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xf50a('0x6')]);router['get'](_0xf50a('0x7'),auth['isAuthenticated'](),controller[_0xf50a('0x8')]);router['get'](_0xf50a('0x9'),auth['isAuthenticated'](),controller[_0xf50a('0xa')]);router['get'](_0xf50a('0xb'),auth[_0xf50a('0xc')](),controller[_0xf50a('0xd')]);router[_0xf50a('0xe')]('/',auth[_0xf50a('0xc')](),controller['create']);router['post'](_0xf50a('0x9'),auth[_0xf50a('0xc')](),controller['addConfiguration']);router[_0xf50a('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf50a('0x10')](_0xf50a('0x7'),auth[_0xf50a('0xc')](),controller[_0xf50a('0x11')]);module[_0xf50a('0x12')]=router; \ No newline at end of file +var _0x9f38=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x223f77,_0x413aab){var _0x234106=function(_0x38bbb1){while(--_0x38bbb1){_0x223f77['push'](_0x223f77['shift']());}};_0x234106(++_0x413aab);}(_0x9f38,0xe7));var _0x89f3=function(_0x448eac,_0x42f049){_0x448eac=_0x448eac-0x0;var _0x1445bf=_0x9f38[_0x448eac];return _0x1445bf;};'use strict';var multer=require(_0x89f3('0x0'));var util=require(_0x89f3('0x1'));var path=require(_0x89f3('0x2'));var timeout=require('connect-timeout');var express=require(_0x89f3('0x3'));var router=express[_0x89f3('0x4')]();var fs_extra=require(_0x89f3('0x5'));var auth=require(_0x89f3('0x6'));var interaction=require(_0x89f3('0x7'));var config=require(_0x89f3('0x8'));var controller=require(_0x89f3('0x9'));router[_0x89f3('0xa')]('/',auth['isAuthenticated'](),controller[_0x89f3('0xb')]);router[_0x89f3('0xa')](_0x89f3('0xc'),auth[_0x89f3('0xd')](),controller[_0x89f3('0xe')]);router['get'](_0x89f3('0xf'),auth[_0x89f3('0xd')](),controller[_0x89f3('0x10')]);router[_0x89f3('0xa')](_0x89f3('0x11'),auth[_0x89f3('0xd')](),controller['getFields']);router[_0x89f3('0x12')]('/',auth['isAuthenticated'](),controller[_0x89f3('0x13')]);router['post'](_0x89f3('0xf'),auth['isAuthenticated'](),controller[_0x89f3('0x14')]);router[_0x89f3('0x15')](_0x89f3('0xc'),auth[_0x89f3('0xd')](),controller[_0x89f3('0x16')]);router[_0x89f3('0x17')](_0x89f3('0xc'),auth[_0x89f3('0xd')](),controller[_0x89f3('0x18')]);module[_0x89f3('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 2b4df4a..c272211 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 _0x9ca4=['sequelize','exports','STRING','ENUM','basic','newTab','integrationTab'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x9ca4,0xe7));var _0x49ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ca4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x49ca('0x0'));module[_0x49ca('0x1')]={'name':{'type':Sequelize[_0x49ca('0x2')]},'description':{'type':Sequelize[_0x49ca('0x2')]},'username':{'type':Sequelize[_0x49ca('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x49ca('0x3')](_0x49ca('0x4')),'defaultValue':_0x49ca('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x49ca('0x2')]},'token':{'type':Sequelize[_0x49ca('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x49ca('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x49ca('0x5')),'defaultValue':_0x49ca('0x6')}}; \ No newline at end of file +var _0x864e=['ENUM','newTab','sequelize','exports','STRING'];(function(_0x363eab,_0x466c43){var _0xe2916=function(_0x254c98){while(--_0x254c98){_0x363eab['push'](_0x363eab['shift']());}};_0xe2916(++_0x466c43);}(_0x864e,0x151));var _0xe864=function(_0x4f072c,_0x1376b5){_0x4f072c=_0x4f072c-0x0;var _0x1aab27=_0x864e[_0x4f072c];return _0x1aab27;};'use strict';var Sequelize=require(_0xe864('0x0'));module[_0xe864('0x1')]={'name':{'type':Sequelize[_0xe864('0x2')]},'description':{'type':Sequelize[_0xe864('0x2')]},'username':{'type':Sequelize[_0xe864('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xe864('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0xe864('0x2')]},'consumerKey':{'type':Sequelize[_0xe864('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe864('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe864('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xe864('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index c65e981..2388289 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 _0xd60c=['username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','%s:%s','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','DeskAccount','includeAll','include','rows','catch','show','params','create','body','find','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType'];(function(_0x1fabe9,_0xf66af4){var _0x1f35c6=function(_0x3b691d){while(--_0x3b691d){_0x1fabe9['push'](_0x1fabe9['shift']());}};_0x1f35c6(++_0xf66af4);}(_0xd60c,0x8f));var _0xcd60=function(_0x5b6911,_0x1a55bf){_0x5b6911=_0x5b6911-0x0;var _0x5c5e0c=_0xd60c[_0x5b6911];return _0x5c5e0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd60('0x1'));var rp=require('request-promise');var moment=require(_0xcd60('0x2'));var BPromise=require(_0xcd60('0x3'));var Mustache=require(_0xcd60('0x4'));var util=require(_0xcd60('0x5'));var path=require(_0xcd60('0x6'));var sox=require(_0xcd60('0x7'));var csv=require('to-csv');var ejs=require(_0xcd60('0x8'));var fs=require('fs');var fs_extra=require(_0xcd60('0x9'));var _=require(_0xcd60('0xa'));var squel=require(_0xcd60('0xb'));var crypto=require(_0xcd60('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcd60('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcd60('0xe'));var Papa=require(_0xcd60('0xf'));var Redis=require('ioredis');var authService=require(_0xcd60('0x10'));var qs=require(_0xcd60('0x11'));var as=require(_0xcd60('0x12'));var hardwareService=require(_0xcd60('0x13'));var logger=require(_0xcd60('0x14'))(_0xcd60('0x15'));var utils=require('../../config/utils');var config=require(_0xcd60('0x16'));var licenseUtil=require(_0xcd60('0x17'));var db=require(_0xcd60('0x18'))['db'];var integrations=require(_0xcd60('0x19'));function respondWithStatusCode(_0x58c311,_0x1297d9){_0x1297d9=_0x1297d9||0xcc;return function(_0x12b0b9){if(_0x12b0b9){return _0x58c311[_0xcd60('0x1a')](_0x1297d9);}return _0x58c311[_0xcd60('0x1b')](_0x1297d9)[_0xcd60('0x1c')]();};}function respondWithResult(_0x4a7c34,_0x1457a4){_0x1457a4=_0x1457a4||0xc8;return function(_0xe78d6e){if(_0xe78d6e){return _0x4a7c34['status'](_0x1457a4)[_0xcd60('0x1d')](_0xe78d6e);}};}function respondWithFilteredResult(_0x901506,_0x4e2acd){return function(_0x2bb270){if(_0x2bb270){var _0x1cf51f=typeof _0x4e2acd[_0xcd60('0x1e')]==='undefined'&&typeof _0x4e2acd[_0xcd60('0x1f')]==='undefined';var _0x1d6f55=_0x2bb270[_0xcd60('0x20')];var _0x4ac9ed=_0x1cf51f?0x0:_0x4e2acd[_0xcd60('0x1e')];var _0x599ac4=_0x1cf51f?_0x2bb270[_0xcd60('0x20')]:_0x4e2acd[_0xcd60('0x1e')]+_0x4e2acd['limit'];var _0x2fbeeb;if(_0x599ac4>=_0x1d6f55){_0x599ac4=_0x1d6f55;_0x2fbeeb=0xc8;}else{_0x2fbeeb=0xce;}_0x901506['status'](_0x2fbeeb);return _0x901506['set'](_0xcd60('0x21'),_0x4ac9ed+'-'+_0x599ac4+'/'+_0x1d6f55)[_0xcd60('0x1d')](_0x2bb270);}return null;};}function patchUpdates(_0xf7dcf5){return function(_0x4671b0){try{jsonpatch[_0xcd60('0x22')](_0x4671b0,_0xf7dcf5,!![]);}catch(_0x5864c4){return BPromise[_0xcd60('0x23')](_0x5864c4);}return _0x4671b0['save']();};}function saveUpdates(_0x18defa,_0x1f33db){return function(_0x358a6e){if(_0x358a6e){return _0x358a6e[_0xcd60('0x24')](_0x18defa)['then'](function(_0x5a5399){return _0x5a5399;});}return null;};}function removeEntity(_0x1d2597,_0x94a24f){return function(_0x3cc3aa){if(_0x3cc3aa){return _0x3cc3aa[_0xcd60('0x25')]()[_0xcd60('0x26')](function(){_0x1d2597[_0xcd60('0x1b')](0xcc)[_0xcd60('0x1c')]();});}};}function handleEntityNotFound(_0x3ea6f1,_0x127c5c){return function(_0x426f52){if(!_0x426f52){_0x3ea6f1['sendStatus'](0x194);}return _0x426f52;};}function handleError(_0x11588c,_0x4697b9){_0x4697b9=_0x4697b9||0x1f4;return function(_0x20c2d2){logger[_0xcd60('0x27')](_0x20c2d2['stack']);if(_0x20c2d2[_0xcd60('0x28')]){delete _0x20c2d2[_0xcd60('0x28')];}_0x11588c[_0xcd60('0x1b')](_0x4697b9)[_0xcd60('0x29')](_0x20c2d2);};}exports[_0xcd60('0x2a')]=function(_0x4871c0,_0x1d30a8){var _0x4931a8={},_0x560f93={},_0x47e2dd={'count':0x0,'rows':[]};var _0x37bce9=_[_0xcd60('0x2b')](db['DeskAccount'][_0xcd60('0x2c')],function(_0x45ab11){return{'name':_0x45ab11[_0xcd60('0x2d')],'type':_0x45ab11[_0xcd60('0x2e')][_0xcd60('0x2f')]};});_0x560f93[_0xcd60('0x30')]=_[_0xcd60('0x2b')](_0x37bce9,_0xcd60('0x28'));_0x560f93[_0xcd60('0x31')]=_[_0xcd60('0x32')](_0x4871c0[_0xcd60('0x31')]);_0x560f93['filters']=_[_0xcd60('0x33')](_0x560f93['model'],_0x560f93[_0xcd60('0x31')]);_0x4931a8[_0xcd60('0x34')]=_[_0xcd60('0x33')](_0x560f93[_0xcd60('0x30')],qs[_0xcd60('0x35')](_0x4871c0['query'][_0xcd60('0x35')]));_0x4931a8['attributes']=_0x4931a8['attributes'][_0xcd60('0x36')]?_0x4931a8[_0xcd60('0x34')]:_0x560f93['model'];if(!_0x4871c0[_0xcd60('0x31')][_0xcd60('0x37')](_0xcd60('0x38'))){_0x4931a8[_0xcd60('0x1f')]=qs[_0xcd60('0x1f')](_0x4871c0['query'][_0xcd60('0x1f')]);_0x4931a8['offset']=qs[_0xcd60('0x1e')](_0x4871c0[_0xcd60('0x31')]['offset']);}_0x4931a8['order']=qs[_0xcd60('0x39')](_0x4871c0['query'][_0xcd60('0x39')]);_0x4931a8[_0xcd60('0x3a')]=qs['filters'](_[_0xcd60('0x3b')](_0x4871c0[_0xcd60('0x31')],_0x560f93[_0xcd60('0x3c')]),_0x37bce9);if(_0x4871c0[_0xcd60('0x31')][_0xcd60('0x3d')]){_0x4931a8[_0xcd60('0x3a')]=_[_0xcd60('0x3e')](_0x4931a8[_0xcd60('0x3a')],{'$or':_['map'](_0x37bce9,function(_0x275f27){if(_0x275f27[_0xcd60('0x2e')]!==_0xcd60('0x3f')){var _0x3a5a03={};_0x3a5a03[_0x275f27[_0xcd60('0x28')]]={'$like':'%'+_0x4871c0[_0xcd60('0x31')]['filter']+'%'};return _0x3a5a03;}})});}_0x4931a8=_['merge']({},_0x4931a8,_0x4871c0[_0xcd60('0x40')]);var _0x1c0b21={'where':_0x4931a8[_0xcd60('0x3a')]};return db[_0xcd60('0x41')]['count'](_0x1c0b21)[_0xcd60('0x26')](function(_0x5e70ea){_0x47e2dd[_0xcd60('0x20')]=_0x5e70ea;if(_0x4871c0[_0xcd60('0x31')][_0xcd60('0x42')]){_0x4931a8[_0xcd60('0x43')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x4931a8);})[_0xcd60('0x26')](function(_0x528ba7){_0x47e2dd[_0xcd60('0x44')]=_0x528ba7;return _0x47e2dd;})[_0xcd60('0x26')](respondWithFilteredResult(_0x1d30a8,_0x4931a8))[_0xcd60('0x45')](handleError(_0x1d30a8,null));};exports[_0xcd60('0x46')]=function(_0x571741,_0x309b90){var _0x3209c5={'raw':![],'where':{'id':_0x571741[_0xcd60('0x47')]['id']}},_0x226d55={};_0x226d55['model']=_[_0xcd60('0x32')](db[_0xcd60('0x41')][_0xcd60('0x2c')]);_0x226d55[_0xcd60('0x31')]=_['keys'](_0x571741[_0xcd60('0x31')]);_0x226d55[_0xcd60('0x3c')]=_[_0xcd60('0x33')](_0x226d55[_0xcd60('0x30')],_0x226d55['query']);_0x3209c5['attributes']=_['intersection'](_0x226d55[_0xcd60('0x30')],qs[_0xcd60('0x35')](_0x571741['query'][_0xcd60('0x35')]));_0x3209c5[_0xcd60('0x34')]=_0x3209c5[_0xcd60('0x34')][_0xcd60('0x36')]?_0x3209c5[_0xcd60('0x34')]:_0x226d55[_0xcd60('0x30')];if(_0x571741['query'][_0xcd60('0x42')]){_0x3209c5[_0xcd60('0x43')]=[{'all':!![]}];}_0x3209c5=_[_0xcd60('0x3e')]({},_0x3209c5,_0x571741[_0xcd60('0x40')]);return db[_0xcd60('0x41')]['find'](_0x3209c5)[_0xcd60('0x26')](handleEntityNotFound(_0x309b90,null))['then'](respondWithResult(_0x309b90,null))['catch'](handleError(_0x309b90,null));};exports[_0xcd60('0x48')]=function(_0x24d7e5,_0x52ce46){return db[_0xcd60('0x41')]['create'](_0x24d7e5[_0xcd60('0x49')],{})[_0xcd60('0x26')](respondWithResult(_0x52ce46,0xc9))['catch'](handleError(_0x52ce46,null));};exports[_0xcd60('0x24')]=function(_0x4b6a0b,_0x13530e){if(_0x4b6a0b['body']['id']){delete _0x4b6a0b[_0xcd60('0x49')]['id'];}return db['DeskAccount'][_0xcd60('0x4a')]({'where':{'id':_0x4b6a0b[_0xcd60('0x47')]['id']}})['then'](handleEntityNotFound(_0x13530e,null))[_0xcd60('0x26')](saveUpdates(_0x4b6a0b[_0xcd60('0x49')],null))[_0xcd60('0x26')](respondWithResult(_0x13530e,null))[_0xcd60('0x45')](handleError(_0x13530e,null));};exports[_0xcd60('0x25')]=function(_0x235ee9,_0x757fd){return db[_0xcd60('0x41')][_0xcd60('0x4a')]({'where':{'id':_0x235ee9['params']['id']}})[_0xcd60('0x26')](handleEntityNotFound(_0x757fd,null))[_0xcd60('0x26')](removeEntity(_0x757fd,null))[_0xcd60('0x45')](handleError(_0x757fd,null));};exports['getConfigurations']=function(_0x119b36,_0x447511,_0x426276){var _0x84fe61={};var _0x4ddeac={};var _0x3af113;var _0x2bb8c3;return db[_0xcd60('0x41')][_0xcd60('0x4b')]({'where':{'id':_0x119b36[_0xcd60('0x47')]['id']}})['then'](handleEntityNotFound(_0x447511,null))[_0xcd60('0x26')](function(_0x579fcc){if(_0x579fcc){_0x3af113=_0x579fcc;_0x4ddeac[_0xcd60('0x30')]=_[_0xcd60('0x32')](db[_0xcd60('0x4c')][_0xcd60('0x2c')]);_0x4ddeac[_0xcd60('0x31')]=_[_0xcd60('0x32')](_0x119b36[_0xcd60('0x31')]);_0x4ddeac['filters']=_['intersection'](_0x4ddeac[_0xcd60('0x30')],_0x4ddeac[_0xcd60('0x31')]);_0x84fe61[_0xcd60('0x34')]=_[_0xcd60('0x33')](_0x4ddeac[_0xcd60('0x30')],qs[_0xcd60('0x35')](_0x119b36[_0xcd60('0x31')][_0xcd60('0x35')]));_0x84fe61[_0xcd60('0x34')]=_0x84fe61[_0xcd60('0x34')][_0xcd60('0x36')]?_0x84fe61['attributes']:_0x4ddeac[_0xcd60('0x30')];_0x84fe61['order']=qs[_0xcd60('0x39')](_0x119b36['query']['sort']);_0x84fe61[_0xcd60('0x3a')]=qs[_0xcd60('0x3c')](_[_0xcd60('0x3b')](_0x119b36['query'],_0x4ddeac['filters']));if(_0x119b36[_0xcd60('0x31')][_0xcd60('0x3d')]){_0x84fe61[_0xcd60('0x3a')]=_[_0xcd60('0x3e')](_0x84fe61[_0xcd60('0x3a')],{'$or':_[_0xcd60('0x2b')](_0x84fe61[_0xcd60('0x34')],function(_0x149bec){var _0x4b459b={};_0x4b459b[_0x149bec]={'$like':'%'+_0x119b36['query'][_0xcd60('0x3d')]+'%'};return _0x4b459b;})});}_0x84fe61=_['merge']({},_0x84fe61,_0x119b36[_0xcd60('0x40')]);return _0x3af113[_0xcd60('0x4d')](_0x84fe61);}})[_0xcd60('0x26')](function(_0x11f57e){if(_0x11f57e){_0x2bb8c3=_0x11f57e[_0xcd60('0x36')];if(!_0x119b36[_0xcd60('0x31')][_0xcd60('0x37')](_0xcd60('0x38'))){_0x84fe61['limit']=qs['limit'](_0x119b36[_0xcd60('0x31')][_0xcd60('0x1f')]);_0x84fe61[_0xcd60('0x1e')]=qs['offset'](_0x119b36['query']['offset']);}return _0x3af113[_0xcd60('0x4d')](_0x84fe61);}})['then'](function(_0x1db8f4){if(_0x1db8f4){return _0x1db8f4?{'count':_0x2bb8c3,'rows':_0x1db8f4}:null;}})[_0xcd60('0x26')](respondWithResult(_0x447511,null))[_0xcd60('0x45')](handleError(_0x447511,null));};exports[_0xcd60('0x4e')]=function(_0xfa1d1f,_0x1e059e,_0x368e75){if(_0xfa1d1f[_0xcd60('0x49')]['id']){delete _0xfa1d1f['body']['id'];}return db[_0xcd60('0x41')][_0xcd60('0x4b')]({'where':{'id':_0xfa1d1f[_0xcd60('0x47')]['id']}})[_0xcd60('0x26')](handleEntityNotFound(_0x1e059e,null))[_0xcd60('0x26')](function(_0x438c21){if(_0x438c21){_0xfa1d1f['body'][_0xcd60('0x4f')]=_0x438c21['id'];_0xfa1d1f[_0xcd60('0x49')][_0xcd60('0x50')]=integrations['getSubjects'](_0xfa1d1f[_0xcd60('0x49')][_0xcd60('0x51')],_0xfa1d1f[_0xcd60('0x49')][_0xcd60('0x2e')]);_0xfa1d1f[_0xcd60('0x49')][_0xcd60('0x52')]=integrations[_0xcd60('0x53')](_0xfa1d1f[_0xcd60('0x49')]['channel'],_0xfa1d1f[_0xcd60('0x49')]['type']);return db[_0xcd60('0x4c')]['create'](_0xfa1d1f[_0xcd60('0x49')],{'include':[{'model':db['DeskField'],'as':_0xcd60('0x50')},{'model':db[_0xcd60('0x54')],'as':'Descriptions'}]});}return null;})[_0xcd60('0x26')](respondWithResult(_0x1e059e,null))[_0xcd60('0x45')](handleError(_0x1e059e,null));};exports[_0xcd60('0x55')]=function(_0x22e1c6,_0x3a3f6f,_0x30bba3){var _0x24a470=[{'name':_0xcd60('0x56'),'label':_0xcd60('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 _0x3687df='';return db['DeskAccount'][_0xcd60('0x4b')]({'where':{'id':_0x22e1c6[_0xcd60('0x47')]['id']},'attributes':['id',_0xcd60('0x57'),_0xcd60('0x58'),_0xcd60('0x59'),_0xcd60('0x5a'),_0xcd60('0x5b'),_0xcd60('0x5c'),_0xcd60('0x5d'),_0xcd60('0x5e')]})[_0xcd60('0x26')](handleEntityNotFound(_0x3a3f6f,null))[_0xcd60('0x26')](function(_0x46748c){if(_0x46748c){_0x3687df=_0x46748c[_0xcd60('0x57')];var _0x4e9765=_0x3687df[_0xcd60('0x5f')](-0x1);if(_0x4e9765==='/'){_0x3687df=_0x3687df[_0xcd60('0x60')](0x0,_0x3687df[_0xcd60('0x61')](_0x4e9765));}var _0x178c20={'method':_0xcd60('0x62'),'uri':util[_0xcd60('0x63')](_0xcd60('0x64'),_0x3687df),'headers':{'Content-Type':_0xcd60('0x65'),'Accept':'application/json'},'json':!![]};if(_0x46748c['authType']==='basic'){_0x178c20[_0xcd60('0x66')][_0xcd60('0x67')]=util[_0xcd60('0x63')]('Basic\x20%s',new Buffer(util['format'](_0xcd60('0x68'),_0x46748c[_0xcd60('0x59')],_0x46748c['password']))['toString'](_0xcd60('0x69')));}return rp(_0x178c20)[_0xcd60('0x26')](function(_0x185a98){return _0x24a470[_0xcd60('0x6a')](_[_0xcd60('0x2b')](_0x185a98[_0xcd60('0x6b')][_0xcd60('0x6c')],function(_0x37bd35){return{'id':_0x37bd35[_0xcd60('0x28')],'name':_0x37bd35[_0xcd60('0x28')],'type':_0x37bd35[_0xcd60('0x2e')],'active':_0x37bd35[_0xcd60('0x6d')],'label':_0x37bd35[_0xcd60('0x6e')],'custom':!![]};}));});}})['then'](function(_0x36aed7){return{'count':_0x36aed7['length'],'rows':_0x36aed7};})[_0xcd60('0x26')](respondWithResult(_0x3a3f6f,null))[_0xcd60('0x45')](function(_0x44a317){var _0x5ad509=_0x22e1c6['query'][_0xcd60('0x6f')]?0x1f4:_0x44a317[_0xcd60('0x70')]||0x1f4;logger[_0xcd60('0x27')](_0xcd60('0x71'),_0xcd60('0x55'),_0x5ad509,JSON[_0xcd60('0x72')](_0x44a317));delete _0x44a317[_0xcd60('0x28')];if(_0x5ad509===0x191){_0x5ad509=0x190;}_0x3a3f6f[_0xcd60('0x1b')](_0x5ad509)[_0xcd60('0x29')](_0x22e1c6[_0xcd60('0x31')][_0xcd60('0x6f')]?{'message':_0xcd60('0x73'),'statusCode':_0x44a317[_0xcd60('0x70')]}:_0x44a317);});}; \ No newline at end of file +var _0x6fc9=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','save','then','end','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','pick','filter','merge','where','options','DeskAccount','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','params','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','token','tokenSecret','slice','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','password','toString','concat','_embedded','entries','active','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','request-promise','moment','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x558433,_0x2d4e46){var _0x48096e=function(_0x562f0c){while(--_0x562f0c){_0x558433['push'](_0x558433['shift']());}};_0x48096e(++_0x2d4e46);}(_0x6fc9,0xc5));var _0x96fc=function(_0x528e6d,_0x350e2d){_0x528e6d=_0x528e6d-0x0;var _0x62adf7=_0x6fc9[_0x528e6d];return _0x62adf7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x96fc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x96fc('0x1'));var moment=require(_0x96fc('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x96fc('0x3'));var csv=require(_0x96fc('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96fc('0x5'));var squel=require(_0x96fc('0x6'));var crypto=require(_0x96fc('0x7'));var jsforce=require(_0x96fc('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96fc('0x9'));var Redis=require(_0x96fc('0xa'));var authService=require(_0x96fc('0xb'));var qs=require(_0x96fc('0xc'));var as=require(_0x96fc('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96fc('0xe'))('api');var utils=require(_0x96fc('0xf'));var config=require(_0x96fc('0x10'));var licenseUtil=require(_0x96fc('0x11'));var db=require(_0x96fc('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3ae63c,_0x4f05fe){_0x4f05fe=_0x4f05fe||0xcc;return function(_0x38d3c6){if(_0x38d3c6){return _0x3ae63c[_0x96fc('0x13')](_0x4f05fe);}return _0x3ae63c[_0x96fc('0x14')](_0x4f05fe)['end']();};}function respondWithResult(_0x4bd341,_0x849698){_0x849698=_0x849698||0xc8;return function(_0x229925){if(_0x229925){return _0x4bd341['status'](_0x849698)['json'](_0x229925);}};}function respondWithFilteredResult(_0x396bab,_0x1bd9cb){return function(_0x53d24a){if(_0x53d24a){var _0x19b7ef=typeof _0x1bd9cb[_0x96fc('0x15')]===_0x96fc('0x16')&&typeof _0x1bd9cb[_0x96fc('0x17')]===_0x96fc('0x16');var _0x2c534e=_0x53d24a['count'];var _0x37ff59=_0x19b7ef?0x0:_0x1bd9cb[_0x96fc('0x15')];var _0x4001c3=_0x19b7ef?_0x53d24a[_0x96fc('0x18')]:_0x1bd9cb['offset']+_0x1bd9cb['limit'];var _0xbba6ea;if(_0x4001c3>=_0x2c534e){_0x4001c3=_0x2c534e;_0xbba6ea=0xc8;}else{_0xbba6ea=0xce;}_0x396bab[_0x96fc('0x14')](_0xbba6ea);return _0x396bab[_0x96fc('0x19')](_0x96fc('0x1a'),_0x37ff59+'-'+_0x4001c3+'/'+_0x2c534e)['json'](_0x53d24a);}return null;};}function patchUpdates(_0x17fba2){return function(_0x20dbd3){try{jsonpatch['apply'](_0x20dbd3,_0x17fba2,!![]);}catch(_0x276ed1){return BPromise[_0x96fc('0x1b')](_0x276ed1);}return _0x20dbd3[_0x96fc('0x1c')]();};}function saveUpdates(_0x1f46f1,_0x5ee3dc){return function(_0x134082){if(_0x134082){return _0x134082['update'](_0x1f46f1)[_0x96fc('0x1d')](function(_0x4f34c5){return _0x4f34c5;});}return null;};}function removeEntity(_0x14465f,_0x297b7e){return function(_0x5c7cf0){if(_0x5c7cf0){return _0x5c7cf0['destroy']()[_0x96fc('0x1d')](function(){_0x14465f[_0x96fc('0x14')](0xcc)[_0x96fc('0x1e')]();});}};}function handleEntityNotFound(_0x5e589b,_0x48f054){return function(_0x1d64b3){if(!_0x1d64b3){_0x5e589b[_0x96fc('0x13')](0x194);}return _0x1d64b3;};}function handleError(_0x1602be,_0x5f2b7d){_0x5f2b7d=_0x5f2b7d||0x1f4;return function(_0x3085c){logger['error'](_0x3085c[_0x96fc('0x1f')]);if(_0x3085c[_0x96fc('0x20')]){delete _0x3085c[_0x96fc('0x20')];}_0x1602be[_0x96fc('0x14')](_0x5f2b7d)[_0x96fc('0x21')](_0x3085c);};}exports[_0x96fc('0x22')]=function(_0x5a5b17,_0x30cc9b){var _0x478452={},_0x33e5a7={},_0x114001={'count':0x0,'rows':[]};var _0x46a725=_[_0x96fc('0x23')](db['DeskAccount']['rawAttributes'],function(_0x48990c){return{'name':_0x48990c[_0x96fc('0x24')],'type':_0x48990c[_0x96fc('0x25')]['key']};});_0x33e5a7['model']=_[_0x96fc('0x23')](_0x46a725,_0x96fc('0x20'));_0x33e5a7[_0x96fc('0x26')]=_[_0x96fc('0x27')](_0x5a5b17[_0x96fc('0x26')]);_0x33e5a7[_0x96fc('0x28')]=_[_0x96fc('0x29')](_0x33e5a7['model'],_0x33e5a7['query']);_0x478452[_0x96fc('0x2a')]=_[_0x96fc('0x29')](_0x33e5a7['model'],qs[_0x96fc('0x2b')](_0x5a5b17['query'][_0x96fc('0x2b')]));_0x478452[_0x96fc('0x2a')]=_0x478452[_0x96fc('0x2a')][_0x96fc('0x2c')]?_0x478452[_0x96fc('0x2a')]:_0x33e5a7[_0x96fc('0x2d')];if(!_0x5a5b17[_0x96fc('0x26')]['hasOwnProperty'](_0x96fc('0x2e'))){_0x478452[_0x96fc('0x17')]=qs[_0x96fc('0x17')](_0x5a5b17[_0x96fc('0x26')][_0x96fc('0x17')]);_0x478452[_0x96fc('0x15')]=qs[_0x96fc('0x15')](_0x5a5b17[_0x96fc('0x26')]['offset']);}_0x478452[_0x96fc('0x2f')]=qs['sort'](_0x5a5b17[_0x96fc('0x26')][_0x96fc('0x30')]);_0x478452['where']=qs[_0x96fc('0x28')](_[_0x96fc('0x31')](_0x5a5b17[_0x96fc('0x26')],_0x33e5a7[_0x96fc('0x28')]),_0x46a725);if(_0x5a5b17[_0x96fc('0x26')][_0x96fc('0x32')]){_0x478452['where']=_[_0x96fc('0x33')](_0x478452[_0x96fc('0x34')],{'$or':_[_0x96fc('0x23')](_0x46a725,function(_0x430914){if(_0x430914[_0x96fc('0x25')]!=='VIRTUAL'){var _0x26fc25={};_0x26fc25[_0x430914[_0x96fc('0x20')]]={'$like':'%'+_0x5a5b17[_0x96fc('0x26')][_0x96fc('0x32')]+'%'};return _0x26fc25;}})});}_0x478452=_[_0x96fc('0x33')]({},_0x478452,_0x5a5b17[_0x96fc('0x35')]);var _0x63930a={'where':_0x478452['where']};return db[_0x96fc('0x36')][_0x96fc('0x18')](_0x63930a)[_0x96fc('0x1d')](function(_0x281e2e){_0x114001[_0x96fc('0x18')]=_0x281e2e;if(_0x5a5b17[_0x96fc('0x26')]['includeAll']){_0x478452[_0x96fc('0x37')]=[{'all':!![]}];}return db[_0x96fc('0x36')][_0x96fc('0x38')](_0x478452);})[_0x96fc('0x1d')](function(_0x487cf9){_0x114001[_0x96fc('0x39')]=_0x487cf9;return _0x114001;})[_0x96fc('0x1d')](respondWithFilteredResult(_0x30cc9b,_0x478452))[_0x96fc('0x3a')](handleError(_0x30cc9b,null));};exports['show']=function(_0xc71b5c,_0x52ffdd){var _0x5757f5={'raw':![],'where':{'id':_0xc71b5c['params']['id']}},_0x37bcff={};_0x37bcff['model']=_[_0x96fc('0x27')](db[_0x96fc('0x36')][_0x96fc('0x3b')]);_0x37bcff[_0x96fc('0x26')]=_[_0x96fc('0x27')](_0xc71b5c[_0x96fc('0x26')]);_0x37bcff[_0x96fc('0x28')]=_[_0x96fc('0x29')](_0x37bcff[_0x96fc('0x2d')],_0x37bcff[_0x96fc('0x26')]);_0x5757f5[_0x96fc('0x2a')]=_[_0x96fc('0x29')](_0x37bcff[_0x96fc('0x2d')],qs[_0x96fc('0x2b')](_0xc71b5c[_0x96fc('0x26')][_0x96fc('0x2b')]));_0x5757f5[_0x96fc('0x2a')]=_0x5757f5[_0x96fc('0x2a')][_0x96fc('0x2c')]?_0x5757f5[_0x96fc('0x2a')]:_0x37bcff[_0x96fc('0x2d')];if(_0xc71b5c[_0x96fc('0x26')][_0x96fc('0x3c')]){_0x5757f5[_0x96fc('0x37')]=[{'all':!![]}];}_0x5757f5=_[_0x96fc('0x33')]({},_0x5757f5,_0xc71b5c[_0x96fc('0x35')]);return db[_0x96fc('0x36')][_0x96fc('0x3d')](_0x5757f5)[_0x96fc('0x1d')](handleEntityNotFound(_0x52ffdd,null))[_0x96fc('0x1d')](respondWithResult(_0x52ffdd,null))['catch'](handleError(_0x52ffdd,null));};exports[_0x96fc('0x3e')]=function(_0x515fdd,_0x3e092b){return db[_0x96fc('0x36')][_0x96fc('0x3e')](_0x515fdd[_0x96fc('0x3f')],{})[_0x96fc('0x1d')](respondWithResult(_0x3e092b,0xc9))[_0x96fc('0x3a')](handleError(_0x3e092b,null));};exports['update']=function(_0x2c5f37,_0x2e3487){if(_0x2c5f37[_0x96fc('0x3f')]['id']){delete _0x2c5f37[_0x96fc('0x3f')]['id'];}return db[_0x96fc('0x36')][_0x96fc('0x3d')]({'where':{'id':_0x2c5f37[_0x96fc('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e3487,null))[_0x96fc('0x1d')](saveUpdates(_0x2c5f37[_0x96fc('0x3f')],null))[_0x96fc('0x1d')](respondWithResult(_0x2e3487,null))[_0x96fc('0x3a')](handleError(_0x2e3487,null));};exports[_0x96fc('0x41')]=function(_0x562ac6,_0x45fee0){return db[_0x96fc('0x36')][_0x96fc('0x3d')]({'where':{'id':_0x562ac6[_0x96fc('0x40')]['id']}})[_0x96fc('0x1d')](handleEntityNotFound(_0x45fee0,null))['then'](removeEntity(_0x45fee0,null))[_0x96fc('0x3a')](handleError(_0x45fee0,null));};exports[_0x96fc('0x42')]=function(_0x479121,_0x322af1,_0x3992ec){var _0x4868ba={};var _0x3f47f6={};var _0x10e397;var _0x491355;return db[_0x96fc('0x36')][_0x96fc('0x43')]({'where':{'id':_0x479121['params']['id']}})['then'](handleEntityNotFound(_0x322af1,null))[_0x96fc('0x1d')](function(_0xdcd6aa){if(_0xdcd6aa){_0x10e397=_0xdcd6aa;_0x3f47f6[_0x96fc('0x2d')]=_[_0x96fc('0x27')](db['DeskConfiguration'][_0x96fc('0x3b')]);_0x3f47f6[_0x96fc('0x26')]=_[_0x96fc('0x27')](_0x479121['query']);_0x3f47f6['filters']=_[_0x96fc('0x29')](_0x3f47f6[_0x96fc('0x2d')],_0x3f47f6[_0x96fc('0x26')]);_0x4868ba[_0x96fc('0x2a')]=_[_0x96fc('0x29')](_0x3f47f6[_0x96fc('0x2d')],qs[_0x96fc('0x2b')](_0x479121[_0x96fc('0x26')][_0x96fc('0x2b')]));_0x4868ba['attributes']=_0x4868ba[_0x96fc('0x2a')][_0x96fc('0x2c')]?_0x4868ba[_0x96fc('0x2a')]:_0x3f47f6[_0x96fc('0x2d')];_0x4868ba['order']=qs['sort'](_0x479121[_0x96fc('0x26')][_0x96fc('0x30')]);_0x4868ba[_0x96fc('0x34')]=qs['filters'](_['pick'](_0x479121[_0x96fc('0x26')],_0x3f47f6[_0x96fc('0x28')]));if(_0x479121['query']['filter']){_0x4868ba[_0x96fc('0x34')]=_[_0x96fc('0x33')](_0x4868ba['where'],{'$or':_[_0x96fc('0x23')](_0x4868ba[_0x96fc('0x2a')],function(_0x5bf86b){var _0x153759={};_0x153759[_0x5bf86b]={'$like':'%'+_0x479121['query'][_0x96fc('0x32')]+'%'};return _0x153759;})});}_0x4868ba=_[_0x96fc('0x33')]({},_0x4868ba,_0x479121[_0x96fc('0x35')]);return _0x10e397[_0x96fc('0x42')](_0x4868ba);}})[_0x96fc('0x1d')](function(_0x26e324){if(_0x26e324){_0x491355=_0x26e324[_0x96fc('0x2c')];if(!_0x479121[_0x96fc('0x26')][_0x96fc('0x44')](_0x96fc('0x2e'))){_0x4868ba[_0x96fc('0x17')]=qs[_0x96fc('0x17')](_0x479121[_0x96fc('0x26')]['limit']);_0x4868ba[_0x96fc('0x15')]=qs[_0x96fc('0x15')](_0x479121[_0x96fc('0x26')][_0x96fc('0x15')]);}return _0x10e397['getConfigurations'](_0x4868ba);}})[_0x96fc('0x1d')](function(_0xc71caa){if(_0xc71caa){return _0xc71caa?{'count':_0x491355,'rows':_0xc71caa}:null;}})[_0x96fc('0x1d')](respondWithResult(_0x322af1,null))[_0x96fc('0x3a')](handleError(_0x322af1,null));};exports[_0x96fc('0x45')]=function(_0x4dda27,_0x41916d,_0x2ef318){if(_0x4dda27[_0x96fc('0x3f')]['id']){delete _0x4dda27[_0x96fc('0x3f')]['id'];}return db[_0x96fc('0x36')][_0x96fc('0x43')]({'where':{'id':_0x4dda27[_0x96fc('0x40')]['id']}})[_0x96fc('0x1d')](handleEntityNotFound(_0x41916d,null))[_0x96fc('0x1d')](function(_0x549e89){if(_0x549e89){_0x4dda27[_0x96fc('0x3f')][_0x96fc('0x46')]=_0x549e89['id'];_0x4dda27[_0x96fc('0x3f')][_0x96fc('0x47')]=integrations[_0x96fc('0x48')](_0x4dda27['body'][_0x96fc('0x49')],_0x4dda27[_0x96fc('0x3f')]['type']);_0x4dda27[_0x96fc('0x3f')][_0x96fc('0x4a')]=integrations[_0x96fc('0x4b')](_0x4dda27[_0x96fc('0x3f')][_0x96fc('0x49')],_0x4dda27['body'][_0x96fc('0x25')]);return db['DeskConfiguration']['create'](_0x4dda27[_0x96fc('0x3f')],{'include':[{'model':db[_0x96fc('0x4c')],'as':_0x96fc('0x47')},{'model':db['DeskField'],'as':_0x96fc('0x4a')}]});}return null;})[_0x96fc('0x1d')](respondWithResult(_0x41916d,null))[_0x96fc('0x3a')](handleError(_0x41916d,null));};exports[_0x96fc('0x4d')]=function(_0x1574b7,_0x451509,_0x4b702e){var _0x1a2093=[{'name':'priority','label':_0x96fc('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 _0x14485c='';return db[_0x96fc('0x36')][_0x96fc('0x43')]({'where':{'id':_0x1574b7['params']['id']},'attributes':['id',_0x96fc('0x4f'),_0x96fc('0x50'),_0x96fc('0x51'),'password',_0x96fc('0x52'),'consumerSecret',_0x96fc('0x53'),_0x96fc('0x54')]})['then'](handleEntityNotFound(_0x451509,null))[_0x96fc('0x1d')](function(_0x46e8c1){if(_0x46e8c1){_0x14485c=_0x46e8c1[_0x96fc('0x4f')];var _0x47cc0e=_0x14485c[_0x96fc('0x55')](-0x1);if(_0x47cc0e==='/'){_0x14485c=_0x14485c['substring'](0x0,_0x14485c['lastIndexOf'](_0x47cc0e));}var _0x2de804={'method':'GET','uri':util[_0x96fc('0x56')](_0x96fc('0x57'),_0x14485c),'headers':{'Content-Type':_0x96fc('0x58'),'Accept':_0x96fc('0x58')},'json':!![]};if(_0x46e8c1['authType']===_0x96fc('0x59')){_0x2de804[_0x96fc('0x5a')]['Authorization']=util[_0x96fc('0x56')](_0x96fc('0x5b'),new Buffer(util[_0x96fc('0x56')](_0x96fc('0x5c'),_0x46e8c1['username'],_0x46e8c1[_0x96fc('0x5d')]))[_0x96fc('0x5e')]('base64'));}return rp(_0x2de804)[_0x96fc('0x1d')](function(_0x254269){return _0x1a2093[_0x96fc('0x5f')](_[_0x96fc('0x23')](_0x254269[_0x96fc('0x60')][_0x96fc('0x61')],function(_0x3277b9){return{'id':_0x3277b9[_0x96fc('0x20')],'name':_0x3277b9[_0x96fc('0x20')],'type':_0x3277b9[_0x96fc('0x25')],'active':_0x3277b9[_0x96fc('0x62')],'label':_0x3277b9['label'],'custom':!![]};}));});}})[_0x96fc('0x1d')](function(_0x595851){return{'count':_0x595851[_0x96fc('0x2c')],'rows':_0x595851};})[_0x96fc('0x1d')](respondWithResult(_0x451509,null))[_0x96fc('0x3a')](function(_0x279ee5){var _0xd92f=_0x1574b7['query'][_0x96fc('0x63')]?0x1f4:_0x279ee5[_0x96fc('0x64')]||0x1f4;logger[_0x96fc('0x65')](_0x96fc('0x66'),'getFields',_0xd92f,JSON[_0x96fc('0x67')](_0x279ee5));delete _0x279ee5[_0x96fc('0x20')];if(_0xd92f===0x191){_0xd92f=0x190;}_0x451509[_0x96fc('0x14')](_0xd92f)[_0x96fc('0x21')](_0x1574b7[_0x96fc('0x26')][_0x96fc('0x63')]?{'message':_0x96fc('0x68'),'statusCode':_0x279ee5[_0x96fc('0x64')]}:_0x279ee5);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 42b84be..98641e8 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 _0xc213=['exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x57b5b1,_0x4613d6){var _0x35a6b1=function(_0x1bc5d2){while(--_0x1bc5d2){_0x57b5b1['push'](_0x57b5b1['shift']());}};_0x35a6b1(++_0x4613d6);}(_0xc213,0x8b));var _0x3c21=function(_0x46bc17,_0x4b47d0){_0x46bc17=_0x46bc17-0x0;var _0x175493=_0xc213[_0x46bc17];return _0x175493;};'use strict';var _=require(_0x3c21('0x0'));var util=require(_0x3c21('0x1'));var logger=require(_0x3c21('0x2'))(_0x3c21('0x3'));var moment=require(_0x3c21('0x4'));var BPromise=require(_0x3c21('0x5'));var rp=require(_0x3c21('0x6'));var fs=require('fs');var path=require(_0x3c21('0x7'));var rimraf=require(_0x3c21('0x8'));var config=require(_0x3c21('0x9'));var attributes=require(_0x3c21('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x3c21('0xb')]=function(_0x37eb9d,_0x51c62e){return _0x37eb9d[_0x3c21('0xc')](_0x3c21('0xd'),attributes,{'tableName':_0x3c21('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc54f=['moment','request-promise','rimraf','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','../../config/logger'];(function(_0x560cc1,_0x9ac574){var _0x484ada=function(_0x17aacf){while(--_0x17aacf){_0x560cc1['push'](_0x560cc1['shift']());}};_0x484ada(++_0x9ac574);}(_0xc54f,0x1c0));var _0xfc54=function(_0x39ec27,_0x3bfa78){_0x39ec27=_0x39ec27-0x0;var _0x349714=_0xc54f[_0x39ec27];return _0x349714;};'use strict';var _=require('lodash');var util=require(_0xfc54('0x0'));var logger=require(_0xfc54('0x1'))('api');var moment=require(_0xfc54('0x2'));var BPromise=require('bluebird');var rp=require(_0xfc54('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc54('0x4'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xfc54('0x5'));module['exports']=function(_0x2d6f22,_0x5f349){return _0x2d6f22[_0xfc54('0x6')](_0xfc54('0x7'),attributes,{'tableName':_0xfc54('0x8'),'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 0864760..2ccf788 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 _0xcdc4=['map','model','GetDeskAccount','ShowDeskAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','DeskAccount','findAll','options','where','attributes','limit','include'];(function(_0xce2ee4,_0x3fe1e1){var _0x3fd000=function(_0x554493){while(--_0x554493){_0xce2ee4['push'](_0xce2ee4['shift']());}};_0x3fd000(++_0x3fe1e1);}(_0xcdc4,0xdd));var _0x4cdc=function(_0x39d1b6,_0x5c506a){_0x39d1b6=_0x39d1b6-0x0;var _0x26ad32=_0xcdc4[_0x39d1b6];return _0x26ad32;};'use strict';var _=require(_0x4cdc('0x0'));var util=require(_0x4cdc('0x1'));var moment=require(_0x4cdc('0x2'));var BPromise=require('bluebird');var rs=require(_0x4cdc('0x3'));var fs=require('fs');var Redis=require(_0x4cdc('0x4'));var db=require(_0x4cdc('0x5'))['db'];var utils=require(_0x4cdc('0x6'));var logger=require('../../config/logger')(_0x4cdc('0x7'));var config=require(_0x4cdc('0x8'));var jayson=require(_0x4cdc('0x9'));var client=jayson[_0x4cdc('0xa')][_0x4cdc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d702a,_0x1e7e9e,_0x4802b5){return new BPromise(function(_0x1f949f,_0x8e6277){return client[_0x4cdc('0xc')](_0x5d702a,_0x4802b5)[_0x4cdc('0xd')](function(_0x17f517){logger[_0x4cdc('0xe')](_0x4cdc('0xf'),_0x1e7e9e,_0x4cdc('0x10'));logger[_0x4cdc('0x11')](_0x4cdc('0x12'),_0x1e7e9e,_0x4cdc('0x10'),JSON[_0x4cdc('0x13')](_0x17f517));if(_0x17f517['error']){if(_0x17f517[_0x4cdc('0x14')]['code']===0x1f4){logger['error'](_0x4cdc('0xf'),_0x1e7e9e,_0x17f517[_0x4cdc('0x14')]['message']);return _0x8e6277(_0x17f517[_0x4cdc('0x14')]['message']);}logger['error'](_0x4cdc('0xf'),_0x1e7e9e,_0x17f517[_0x4cdc('0x14')][_0x4cdc('0x15')]);return _0x1f949f(_0x17f517[_0x4cdc('0x14')][_0x4cdc('0x15')]);}else{logger[_0x4cdc('0xe')](_0x4cdc('0xf'),_0x1e7e9e,_0x4cdc('0x10'));_0x1f949f(_0x17f517[_0x4cdc('0x16')][_0x4cdc('0x15')]);}})[_0x4cdc('0x17')](function(_0x4c7e2b){logger[_0x4cdc('0x14')](_0x4cdc('0xf'),_0x1e7e9e,_0x4c7e2b);_0x8e6277(_0x4c7e2b);});});}exports['GetDeskAccount']=function(_0x3b4921){var _0x388a5d=this;return new Promise(function(_0x4cd7c5,_0x4bf58f){return db[_0x4cdc('0x18')][_0x4cdc('0x19')]({'raw':_0x3b4921[_0x4cdc('0x1a')]?_0x3b4921[_0x4cdc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3b4921['options']?_0x3b4921[_0x4cdc('0x1a')][_0x4cdc('0x1b')]||null:null,'attributes':_0x3b4921[_0x4cdc('0x1a')]?_0x3b4921[_0x4cdc('0x1a')][_0x4cdc('0x1c')]||null:null,'limit':_0x3b4921[_0x4cdc('0x1a')]?_0x3b4921[_0x4cdc('0x1a')][_0x4cdc('0x1d')]||null:null,'include':_0x3b4921[_0x4cdc('0x1a')]?_0x3b4921[_0x4cdc('0x1a')][_0x4cdc('0x1e')]?_[_0x4cdc('0x1f')](_0x3b4921[_0x4cdc('0x1a')][_0x4cdc('0x1e')],function(_0x448d5d){return{'model':db[_0x448d5d[_0x4cdc('0x20')]],'as':_0x448d5d['as'],'attributes':_0x448d5d[_0x4cdc('0x1c')],'include':_0x448d5d[_0x4cdc('0x1e')]?_['map'](_0x448d5d[_0x4cdc('0x1e')],function(_0xbefefb){return{'model':db[_0xbefefb[_0x4cdc('0x20')]],'as':_0xbefefb['as'],'attributes':_0xbefefb[_0x4cdc('0x1c')],'include':_0xbefefb['include']?_[_0x4cdc('0x1f')](_0xbefefb[_0x4cdc('0x1e')],function(_0x2a82ab){return{'model':db[_0x2a82ab[_0x4cdc('0x20')]],'as':_0x2a82ab['as'],'attributes':_0x2a82ab['attributes']};}):[]};}):[]};}):[]:[]})[_0x4cdc('0xd')](function(_0xa926e9){logger['info'](_0x4cdc('0x21'),_0x3b4921);logger[_0x4cdc('0x11')](_0x4cdc('0x21'),_0x3b4921,JSON['stringify'](_0xa926e9));_0x4cd7c5(_0xa926e9);})[_0x4cdc('0x17')](function(_0x458c17){logger[_0x4cdc('0x14')](_0x4cdc('0x21'),_0x458c17['message'],_0x3b4921);_0x4bf58f(_0x388a5d[_0x4cdc('0x14')](0x1f4,_0x458c17[_0x4cdc('0x15')]));});});};exports[_0x4cdc('0x22')]=function(_0x8193aa){var _0x40c395=this;return new Promise(function(_0x42ed5d,_0xdfc12c){return db[_0x4cdc('0x18')]['find']({'raw':_0x8193aa[_0x4cdc('0x1a')]?_0x8193aa[_0x4cdc('0x1a')][_0x4cdc('0x23')]===undefined?!![]:![]:!![],'where':_0x8193aa[_0x4cdc('0x1a')]?_0x8193aa[_0x4cdc('0x1a')][_0x4cdc('0x1b')]||null:null,'attributes':_0x8193aa['options']?_0x8193aa[_0x4cdc('0x1a')][_0x4cdc('0x1c')]||null:null,'include':_0x8193aa[_0x4cdc('0x1a')]?_0x8193aa[_0x4cdc('0x1a')]['include']?_[_0x4cdc('0x1f')](_0x8193aa[_0x4cdc('0x1a')][_0x4cdc('0x1e')],function(_0x2be86d){return{'model':db[_0x2be86d['model']],'as':_0x2be86d['as'],'attributes':_0x2be86d[_0x4cdc('0x1c')],'include':_0x2be86d['include']?_[_0x4cdc('0x1f')](_0x2be86d[_0x4cdc('0x1e')],function(_0x180c1f){return{'model':db[_0x180c1f['model']],'as':_0x180c1f['as'],'attributes':_0x180c1f[_0x4cdc('0x1c')],'include':_0x180c1f[_0x4cdc('0x1e')]?_['map'](_0x180c1f[_0x4cdc('0x1e')],function(_0x42a684){return{'model':db[_0x42a684['model']],'as':_0x42a684['as'],'attributes':_0x42a684[_0x4cdc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4cdc('0xd')](function(_0x39a2e6){logger[_0x4cdc('0xe')](_0x4cdc('0x22'),_0x8193aa);logger['debug'](_0x4cdc('0x22'),_0x8193aa,JSON[_0x4cdc('0x13')](_0x39a2e6));_0x42ed5d(_0x39a2e6);})[_0x4cdc('0x17')](function(_0x12bc7c){logger[_0x4cdc('0x14')]('ShowDeskAccount',_0x12bc7c[_0x4cdc('0x15')],_0x8193aa);_0xdfc12c(_0x40c395[_0x4cdc('0x14')](0x1f4,_0x12bc7c['message']));});});}; \ No newline at end of file +var _0x8bc8=['model','find','ShowDeskAccount','stringify','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetDeskAccount','DeskAccount','options','raw','where','include','map','attributes'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x8bc8,0x1e5));var _0x88bc=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x8bc8[_0x5ca353];return _0x4f2fe5;};'use strict';var _=require(_0x88bc('0x0'));var util=require('util');var moment=require(_0x88bc('0x1'));var BPromise=require(_0x88bc('0x2'));var rs=require(_0x88bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x88bc('0x4'));var logger=require(_0x88bc('0x5'))(_0x88bc('0x6'));var config=require(_0x88bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x88bc('0x8')][_0x88bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a9a56,_0x363857,_0x476f88){return new BPromise(function(_0x330a73,_0x10cc35){return client['request'](_0x1a9a56,_0x476f88)[_0x88bc('0xa')](function(_0x3fc37d){logger[_0x88bc('0xb')](_0x88bc('0xc'),_0x363857,_0x88bc('0xd'));logger[_0x88bc('0xe')](_0x88bc('0xf'),_0x363857,_0x88bc('0xd'),JSON['stringify'](_0x3fc37d));if(_0x3fc37d[_0x88bc('0x10')]){if(_0x3fc37d[_0x88bc('0x10')][_0x88bc('0x11')]===0x1f4){logger['error'](_0x88bc('0xc'),_0x363857,_0x3fc37d[_0x88bc('0x10')]['message']);return _0x10cc35(_0x3fc37d['error'][_0x88bc('0x12')]);}logger[_0x88bc('0x10')](_0x88bc('0xc'),_0x363857,_0x3fc37d[_0x88bc('0x10')][_0x88bc('0x12')]);return _0x330a73(_0x3fc37d[_0x88bc('0x10')][_0x88bc('0x12')]);}else{logger[_0x88bc('0xb')](_0x88bc('0xc'),_0x363857,_0x88bc('0xd'));_0x330a73(_0x3fc37d['result'][_0x88bc('0x12')]);}})['catch'](function(_0x52f2a0){logger[_0x88bc('0x10')](_0x88bc('0xc'),_0x363857,_0x52f2a0);_0x10cc35(_0x52f2a0);});});}exports[_0x88bc('0x13')]=function(_0x4e2781){var _0x49ba54=this;return new Promise(function(_0x178040,_0x3702e6){return db[_0x88bc('0x14')]['findAll']({'raw':_0x4e2781[_0x88bc('0x15')]?_0x4e2781[_0x88bc('0x15')][_0x88bc('0x16')]===undefined?!![]:![]:!![],'where':_0x4e2781[_0x88bc('0x15')]?_0x4e2781[_0x88bc('0x15')][_0x88bc('0x17')]||null:null,'attributes':_0x4e2781[_0x88bc('0x15')]?_0x4e2781[_0x88bc('0x15')]['attributes']||null:null,'limit':_0x4e2781[_0x88bc('0x15')]?_0x4e2781[_0x88bc('0x15')]['limit']||null:null,'include':_0x4e2781[_0x88bc('0x15')]?_0x4e2781[_0x88bc('0x15')][_0x88bc('0x18')]?_[_0x88bc('0x19')](_0x4e2781[_0x88bc('0x15')]['include'],function(_0x1a3da9){return{'model':db[_0x1a3da9['model']],'as':_0x1a3da9['as'],'attributes':_0x1a3da9[_0x88bc('0x1a')],'include':_0x1a3da9[_0x88bc('0x18')]?_[_0x88bc('0x19')](_0x1a3da9[_0x88bc('0x18')],function(_0x398f4a){return{'model':db[_0x398f4a[_0x88bc('0x1b')]],'as':_0x398f4a['as'],'attributes':_0x398f4a[_0x88bc('0x1a')],'include':_0x398f4a[_0x88bc('0x18')]?_[_0x88bc('0x19')](_0x398f4a[_0x88bc('0x18')],function(_0x574d8){return{'model':db[_0x574d8['model']],'as':_0x574d8['as'],'attributes':_0x574d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x88bc('0xa')](function(_0x2afdda){logger[_0x88bc('0xb')]('GetDeskAccount',_0x4e2781);logger[_0x88bc('0xe')](_0x88bc('0x13'),_0x4e2781,JSON['stringify'](_0x2afdda));_0x178040(_0x2afdda);})['catch'](function(_0x47e34b){logger['error'](_0x88bc('0x13'),_0x47e34b[_0x88bc('0x12')],_0x4e2781);_0x3702e6(_0x49ba54[_0x88bc('0x10')](0x1f4,_0x47e34b[_0x88bc('0x12')]));});});};exports['ShowDeskAccount']=function(_0x33280d){var _0x373cc6=this;return new Promise(function(_0x188854,_0x34841d){return db[_0x88bc('0x14')][_0x88bc('0x1c')]({'raw':_0x33280d[_0x88bc('0x15')]?_0x33280d[_0x88bc('0x15')][_0x88bc('0x16')]===undefined?!![]:![]:!![],'where':_0x33280d['options']?_0x33280d['options'][_0x88bc('0x17')]||null:null,'attributes':_0x33280d[_0x88bc('0x15')]?_0x33280d[_0x88bc('0x15')][_0x88bc('0x1a')]||null:null,'include':_0x33280d[_0x88bc('0x15')]?_0x33280d[_0x88bc('0x15')]['include']?_[_0x88bc('0x19')](_0x33280d[_0x88bc('0x15')][_0x88bc('0x18')],function(_0x92feb5){return{'model':db[_0x92feb5[_0x88bc('0x1b')]],'as':_0x92feb5['as'],'attributes':_0x92feb5[_0x88bc('0x1a')],'include':_0x92feb5[_0x88bc('0x18')]?_['map'](_0x92feb5[_0x88bc('0x18')],function(_0x19650c){return{'model':db[_0x19650c[_0x88bc('0x1b')]],'as':_0x19650c['as'],'attributes':_0x19650c[_0x88bc('0x1a')],'include':_0x19650c[_0x88bc('0x18')]?_[_0x88bc('0x19')](_0x19650c['include'],function(_0x70cf49){return{'model':db[_0x70cf49['model']],'as':_0x70cf49['as'],'attributes':_0x70cf49[_0x88bc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b9cf0){logger[_0x88bc('0xb')](_0x88bc('0x1d'),_0x33280d);logger[_0x88bc('0xe')](_0x88bc('0x1d'),_0x33280d,JSON[_0x88bc('0x1e')](_0x5b9cf0));_0x188854(_0x5b9cf0);})[_0x88bc('0x1f')](function(_0x59ff89){logger[_0x88bc('0x10')]('ShowDeskAccount',_0x59ff89[_0x88bc('0x12')],_0x33280d);_0x34841d(_0x373cc6[_0x88bc('0x10')](0x1f4,_0x59ff89['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index c152a3a..10263c5 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0xcdf809,_0x2881f0){var _0x4d4d70=function(_0x277c61){while(--_0x277c61){_0xcdf809['push'](_0xcdf809['shift']());}};_0x4d4d70(++_0x2881f0);}(_0x55ca,0x126));var _0xa55c=function(_0x3f7982,_0x24c737){_0x3f7982=_0x3f7982-0x0;var _0x4e6a0d=_0x55ca[_0x3f7982];return _0x4e6a0d;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0xee1ec9,_0x2f0599){var _0x102a53=function(_0x4e5f7f){while(--_0x4e5f7f){_0xee1ec9['push'](_0xee1ec9['shift']());}};_0x102a53(++_0x2f0599);}(_0x55ca,0x126));var _0xa55c=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x55ca[_0x3c2b2e];return _0x27a338;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 4b356db..5be1b31 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 _0x5acf=['exports','STRING'];(function(_0x4b4484,_0x1bc8cc){var _0x38c914=function(_0x2e1bbb){while(--_0x2e1bbb){_0x4b4484['push'](_0x4b4484['shift']());}};_0x38c914(++_0x1bc8cc);}(_0x5acf,0x80));var _0xf5ac=function(_0x4989fe,_0x201e34){_0x4989fe=_0x4989fe-0x0;var _0x4afd24=_0x5acf[_0x4989fe];return _0x4afd24;};'use strict';var Sequelize=require('sequelize');module[_0xf5ac('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf5ac('0x1')]}}; \ No newline at end of file +var _0x4bb1=['exports','STRING','sequelize'];(function(_0x13cab0,_0x14d825){var _0x38804f=function(_0x1bffaf){while(--_0x1bffaf){_0x13cab0['push'](_0x13cab0['shift']());}};_0x38804f(++_0x14d825);}(_0x4bb1,0x140));var _0x14bb=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x4bb1[_0x1d2bbb];return _0x38082b;};'use strict';var Sequelize=require(_0x14bb('0x0'));module[_0x14bb('0x1')]={'name':{'type':Sequelize[_0x14bb('0x2')]},'description':{'type':Sequelize[_0x14bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2a4952a..b16f7d3 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 _0xe9c2=['getTags','setTags','ids','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','sendStatus','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','create','body','params','destroy','getFields','DeskField','getSubjects','findOne','getDescriptions','Tag'];(function(_0x3a1dc1,_0x3643da){var _0x338096=function(_0x20c467){while(--_0x20c467){_0x3a1dc1['push'](_0x3a1dc1['shift']());}};_0x338096(++_0x3643da);}(_0xe9c2,0x1a7));var _0x2e9c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe9c2[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x2e9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e9c('0x1'));var jsonpatch=require(_0x2e9c('0x2'));var rp=require(_0x2e9c('0x3'));var moment=require(_0x2e9c('0x4'));var BPromise=require(_0x2e9c('0x5'));var Mustache=require(_0x2e9c('0x6'));var util=require(_0x2e9c('0x7'));var path=require(_0x2e9c('0x8'));var sox=require(_0x2e9c('0x9'));var csv=require(_0x2e9c('0xa'));var ejs=require(_0x2e9c('0xb'));var fs=require('fs');var fs_extra=require(_0x2e9c('0xc'));var _=require(_0x2e9c('0xd'));var squel=require(_0x2e9c('0xe'));var crypto=require('crypto');var jsforce=require(_0x2e9c('0xf'));var deskjs=require(_0x2e9c('0x10'));var toCsv=require(_0x2e9c('0xa'));var querystring=require(_0x2e9c('0x11'));var Papa=require(_0x2e9c('0x12'));var Redis=require(_0x2e9c('0x13'));var authService=require(_0x2e9c('0x14'));var qs=require(_0x2e9c('0x15'));var as=require(_0x2e9c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e9c('0x17'))(_0x2e9c('0x18'));var utils=require('../../config/utils');var config=require(_0x2e9c('0x19'));var licenseUtil=require(_0x2e9c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6d6111,_0x418328){_0x418328=_0x418328||0xcc;return function(_0x82a03d){if(_0x82a03d){return _0x6d6111['sendStatus'](_0x418328);}return _0x6d6111[_0x2e9c('0x1b')](_0x418328)[_0x2e9c('0x1c')]();};}function respondWithResult(_0x35f0fa,_0x1289ef){_0x1289ef=_0x1289ef||0xc8;return function(_0x490e4a){if(_0x490e4a){return _0x35f0fa[_0x2e9c('0x1b')](_0x1289ef)[_0x2e9c('0x1d')](_0x490e4a);}};}function respondWithFilteredResult(_0x4edddd,_0x2e4720){return function(_0x11d000){if(_0x11d000){var _0x2c97e2=typeof _0x2e4720['offset']===_0x2e9c('0x1e')&&typeof _0x2e4720[_0x2e9c('0x1f')]===_0x2e9c('0x1e');var _0x4313ce=_0x11d000[_0x2e9c('0x20')];var _0x12c601=_0x2c97e2?0x0:_0x2e4720['offset'];var _0x43db02=_0x2c97e2?_0x11d000[_0x2e9c('0x20')]:_0x2e4720[_0x2e9c('0x21')]+_0x2e4720['limit'];var _0x2652b4;if(_0x43db02>=_0x4313ce){_0x43db02=_0x4313ce;_0x2652b4=0xc8;}else{_0x2652b4=0xce;}_0x4edddd[_0x2e9c('0x1b')](_0x2652b4);return _0x4edddd[_0x2e9c('0x22')](_0x2e9c('0x23'),_0x12c601+'-'+_0x43db02+'/'+_0x4313ce)['json'](_0x11d000);}return null;};}function patchUpdates(_0x1b290f){return function(_0x25395d){try{jsonpatch['apply'](_0x25395d,_0x1b290f,!![]);}catch(_0x5f093e){return BPromise[_0x2e9c('0x24')](_0x5f093e);}return _0x25395d[_0x2e9c('0x25')]();};}function saveUpdates(_0x4dcaac,_0x3d0f24){return function(_0x93b0dc){if(_0x93b0dc){return _0x93b0dc['update'](_0x4dcaac)[_0x2e9c('0x26')](function(_0x4d6ce3){return _0x4d6ce3;});}return null;};}function removeEntity(_0x2c09d1,_0x25bf1f){return function(_0xc9403a){if(_0xc9403a){return _0xc9403a['destroy']()[_0x2e9c('0x26')](function(){_0x2c09d1[_0x2e9c('0x1b')](0xcc)[_0x2e9c('0x1c')]();});}};}function handleEntityNotFound(_0x287a1c,_0x175ec8){return function(_0x36712f){if(!_0x36712f){_0x287a1c[_0x2e9c('0x27')](0x194);}return _0x36712f;};}function handleError(_0x47af2f,_0x557fcb){_0x557fcb=_0x557fcb||0x1f4;return function(_0x5dc9f){logger['error'](_0x5dc9f[_0x2e9c('0x28')]);if(_0x5dc9f[_0x2e9c('0x29')]){delete _0x5dc9f['name'];}_0x47af2f[_0x2e9c('0x1b')](_0x557fcb)['send'](_0x5dc9f);};}exports[_0x2e9c('0x2a')]=function(_0x55bfe7,_0x574346){var _0x1e9455={},_0x56e051={},_0x2ddbc7={'count':0x0,'rows':[]};var _0x4b1173=_[_0x2e9c('0x2b')](db[_0x2e9c('0x2c')][_0x2e9c('0x2d')],function(_0x989866){return{'name':_0x989866[_0x2e9c('0x2e')],'type':_0x989866['type']['key']};});_0x56e051[_0x2e9c('0x2f')]=_[_0x2e9c('0x2b')](_0x4b1173,_0x2e9c('0x29'));_0x56e051[_0x2e9c('0x30')]=_[_0x2e9c('0x31')](_0x55bfe7[_0x2e9c('0x30')]);_0x56e051[_0x2e9c('0x32')]=_[_0x2e9c('0x33')](_0x56e051[_0x2e9c('0x2f')],_0x56e051['query']);_0x1e9455['attributes']=_['intersection'](_0x56e051[_0x2e9c('0x2f')],qs[_0x2e9c('0x34')](_0x55bfe7[_0x2e9c('0x30')][_0x2e9c('0x34')]));_0x1e9455[_0x2e9c('0x35')]=_0x1e9455[_0x2e9c('0x35')]['length']?_0x1e9455[_0x2e9c('0x35')]:_0x56e051[_0x2e9c('0x2f')];if(!_0x55bfe7[_0x2e9c('0x30')][_0x2e9c('0x36')](_0x2e9c('0x37'))){_0x1e9455[_0x2e9c('0x1f')]=qs['limit'](_0x55bfe7['query'][_0x2e9c('0x1f')]);_0x1e9455[_0x2e9c('0x21')]=qs['offset'](_0x55bfe7['query']['offset']);}_0x1e9455[_0x2e9c('0x38')]=qs[_0x2e9c('0x39')](_0x55bfe7[_0x2e9c('0x30')][_0x2e9c('0x39')]);_0x1e9455[_0x2e9c('0x3a')]=qs[_0x2e9c('0x32')](_[_0x2e9c('0x3b')](_0x55bfe7['query'],_0x56e051[_0x2e9c('0x32')]),_0x4b1173);if(_0x55bfe7[_0x2e9c('0x30')][_0x2e9c('0x3c')]){_0x1e9455[_0x2e9c('0x3a')]=_[_0x2e9c('0x3d')](_0x1e9455[_0x2e9c('0x3a')],{'$or':_[_0x2e9c('0x2b')](_0x4b1173,function(_0x4ebee3){if(_0x4ebee3[_0x2e9c('0x3e')]!==_0x2e9c('0x3f')){var _0x5d5569={};_0x5d5569[_0x4ebee3[_0x2e9c('0x29')]]={'$like':'%'+_0x55bfe7[_0x2e9c('0x30')][_0x2e9c('0x3c')]+'%'};return _0x5d5569;}})});}_0x1e9455=_['merge']({},_0x1e9455,_0x55bfe7[_0x2e9c('0x40')]);var _0x47ca2d={'where':_0x1e9455[_0x2e9c('0x3a')]};return db[_0x2e9c('0x2c')][_0x2e9c('0x20')](_0x47ca2d)[_0x2e9c('0x26')](function(_0x379c29){_0x2ddbc7['count']=_0x379c29;if(_0x55bfe7[_0x2e9c('0x30')][_0x2e9c('0x41')]){_0x1e9455['include']=[{'all':!![]}];}return db[_0x2e9c('0x2c')][_0x2e9c('0x42')](_0x1e9455);})[_0x2e9c('0x26')](function(_0x54580b){_0x2ddbc7[_0x2e9c('0x43')]=_0x54580b;return _0x2ddbc7;})['then'](respondWithFilteredResult(_0x574346,_0x1e9455))[_0x2e9c('0x44')](handleError(_0x574346,null));};exports[_0x2e9c('0x45')]=function(_0x49a608,_0x2c0ad2){var _0x14d110={'raw':![],'where':{'id':_0x49a608['params']['id']}},_0x40b0ff={};_0x40b0ff[_0x2e9c('0x2f')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x40b0ff['query']=_[_0x2e9c('0x31')](_0x49a608[_0x2e9c('0x30')]);_0x40b0ff[_0x2e9c('0x32')]=_[_0x2e9c('0x33')](_0x40b0ff[_0x2e9c('0x2f')],_0x40b0ff[_0x2e9c('0x30')]);_0x14d110[_0x2e9c('0x35')]=_['intersection'](_0x40b0ff[_0x2e9c('0x2f')],qs['fields'](_0x49a608[_0x2e9c('0x30')][_0x2e9c('0x34')]));_0x14d110['attributes']=_0x14d110[_0x2e9c('0x35')][_0x2e9c('0x46')]?_0x14d110[_0x2e9c('0x35')]:_0x40b0ff[_0x2e9c('0x2f')];if(_0x49a608['query']['includeAll']){_0x14d110['include']=[{'all':!![]}];}_0x14d110=_[_0x2e9c('0x3d')]({},_0x14d110,_0x49a608[_0x2e9c('0x40')]);return db[_0x2e9c('0x2c')]['find'](_0x14d110)[_0x2e9c('0x26')](handleEntityNotFound(_0x2c0ad2,null))[_0x2e9c('0x26')](respondWithResult(_0x2c0ad2,null))[_0x2e9c('0x44')](handleError(_0x2c0ad2,null));};exports['create']=function(_0x3491c8,_0x18411f){return db[_0x2e9c('0x2c')][_0x2e9c('0x47')](_0x3491c8[_0x2e9c('0x48')],{})[_0x2e9c('0x26')](respondWithResult(_0x18411f,0xc9))[_0x2e9c('0x44')](handleError(_0x18411f,null));};exports['update']=function(_0x4ee707,_0x252248){if(_0x4ee707['body']['id']){delete _0x4ee707['body']['id'];}return db[_0x2e9c('0x2c')]['find']({'where':{'id':_0x4ee707[_0x2e9c('0x49')]['id']}})[_0x2e9c('0x26')](handleEntityNotFound(_0x252248,null))[_0x2e9c('0x26')](saveUpdates(_0x4ee707[_0x2e9c('0x48')],null))[_0x2e9c('0x26')](respondWithResult(_0x252248,null))[_0x2e9c('0x44')](handleError(_0x252248,null));};exports[_0x2e9c('0x4a')]=function(_0x35c226,_0x4a83f0){return db['DeskConfiguration']['find']({'where':{'id':_0x35c226[_0x2e9c('0x49')]['id']}})[_0x2e9c('0x26')](handleEntityNotFound(_0x4a83f0,null))['then'](removeEntity(_0x4a83f0,null))['catch'](handleError(_0x4a83f0,null));};exports[_0x2e9c('0x4b')]=function(_0x4d7ae4,_0x20ffbd,_0x573d25){var _0x22440f={};var _0x2928e7={};var _0x25e67c;var _0x251f02;return db[_0x2e9c('0x2c')]['findOne']({'where':{'id':_0x4d7ae4['params']['id']}})['then'](handleEntityNotFound(_0x20ffbd,null))[_0x2e9c('0x26')](function(_0x22d3f9){if(_0x22d3f9){_0x25e67c=_0x22d3f9;_0x2928e7[_0x2e9c('0x2f')]=_[_0x2e9c('0x31')](db[_0x2e9c('0x4c')][_0x2e9c('0x2d')]);_0x2928e7[_0x2e9c('0x30')]=_[_0x2e9c('0x31')](_0x4d7ae4[_0x2e9c('0x30')]);_0x2928e7[_0x2e9c('0x32')]=_[_0x2e9c('0x33')](_0x2928e7[_0x2e9c('0x2f')],_0x2928e7[_0x2e9c('0x30')]);_0x22440f[_0x2e9c('0x35')]=_[_0x2e9c('0x33')](_0x2928e7['model'],qs[_0x2e9c('0x34')](_0x4d7ae4[_0x2e9c('0x30')]['fields']));_0x22440f['attributes']=_0x22440f[_0x2e9c('0x35')][_0x2e9c('0x46')]?_0x22440f[_0x2e9c('0x35')]:_0x2928e7[_0x2e9c('0x2f')];_0x22440f[_0x2e9c('0x38')]=qs['sort'](_0x4d7ae4['query'][_0x2e9c('0x39')]);_0x22440f[_0x2e9c('0x3a')]=qs['filters'](_[_0x2e9c('0x3b')](_0x4d7ae4[_0x2e9c('0x30')],_0x2928e7['filters']));if(_0x4d7ae4[_0x2e9c('0x30')][_0x2e9c('0x3c')]){_0x22440f[_0x2e9c('0x3a')]=_[_0x2e9c('0x3d')](_0x22440f['where'],{'$or':_[_0x2e9c('0x2b')](_0x22440f['attributes'],function(_0x3bdef8){var _0x3e6e95={};_0x3e6e95[_0x3bdef8]={'$like':'%'+_0x4d7ae4[_0x2e9c('0x30')][_0x2e9c('0x3c')]+'%'};return _0x3e6e95;})});}_0x22440f=_[_0x2e9c('0x3d')]({},_0x22440f,_0x4d7ae4[_0x2e9c('0x40')]);return _0x25e67c[_0x2e9c('0x4b')](_0x22440f);}})[_0x2e9c('0x26')](function(_0x3c2461){if(_0x3c2461){_0x251f02=_0x3c2461[_0x2e9c('0x46')];if(!_0x4d7ae4[_0x2e9c('0x30')]['hasOwnProperty'](_0x2e9c('0x37'))){_0x22440f[_0x2e9c('0x1f')]=qs['limit'](_0x4d7ae4['query'][_0x2e9c('0x1f')]);_0x22440f[_0x2e9c('0x21')]=qs['offset'](_0x4d7ae4[_0x2e9c('0x30')][_0x2e9c('0x21')]);}return _0x25e67c[_0x2e9c('0x4b')](_0x22440f);}})['then'](function(_0x1bbd6b){if(_0x1bbd6b){return _0x1bbd6b?{'count':_0x251f02,'rows':_0x1bbd6b}:null;}})[_0x2e9c('0x26')](respondWithResult(_0x20ffbd,null))[_0x2e9c('0x44')](handleError(_0x20ffbd,null));};exports[_0x2e9c('0x4d')]=function(_0x21e737,_0x54fd0f,_0x310372){var _0x562e16={};var _0x9c3bf5={};var _0x5f4732;var _0x3e29ed;return db[_0x2e9c('0x2c')][_0x2e9c('0x4e')]({'where':{'id':_0x21e737['params']['id']}})[_0x2e9c('0x26')](handleEntityNotFound(_0x54fd0f,null))['then'](function(_0x8ff7bd){if(_0x8ff7bd){_0x5f4732=_0x8ff7bd;_0x9c3bf5[_0x2e9c('0x2f')]=_[_0x2e9c('0x31')](db[_0x2e9c('0x4c')][_0x2e9c('0x2d')]);_0x9c3bf5[_0x2e9c('0x30')]=_[_0x2e9c('0x31')](_0x21e737[_0x2e9c('0x30')]);_0x9c3bf5[_0x2e9c('0x32')]=_['intersection'](_0x9c3bf5[_0x2e9c('0x2f')],_0x9c3bf5[_0x2e9c('0x30')]);_0x562e16['attributes']=_['intersection'](_0x9c3bf5[_0x2e9c('0x2f')],qs[_0x2e9c('0x34')](_0x21e737['query'][_0x2e9c('0x34')]));_0x562e16['attributes']=_0x562e16['attributes']['length']?_0x562e16['attributes']:_0x9c3bf5[_0x2e9c('0x2f')];_0x562e16['order']=qs[_0x2e9c('0x39')](_0x21e737['query'][_0x2e9c('0x39')]);_0x562e16['where']=qs[_0x2e9c('0x32')](_[_0x2e9c('0x3b')](_0x21e737[_0x2e9c('0x30')],_0x9c3bf5[_0x2e9c('0x32')]));if(_0x21e737['query'][_0x2e9c('0x3c')]){_0x562e16[_0x2e9c('0x3a')]=_[_0x2e9c('0x3d')](_0x562e16[_0x2e9c('0x3a')],{'$or':_['map'](_0x562e16['attributes'],function(_0x58edf3){var _0x50b063={};_0x50b063[_0x58edf3]={'$like':'%'+_0x21e737[_0x2e9c('0x30')][_0x2e9c('0x3c')]+'%'};return _0x50b063;})});}_0x562e16=_[_0x2e9c('0x3d')]({},_0x562e16,_0x21e737[_0x2e9c('0x40')]);return _0x5f4732[_0x2e9c('0x4d')](_0x562e16);}})['then'](function(_0x342981){if(_0x342981){_0x3e29ed=_0x342981[_0x2e9c('0x46')];if(!_0x21e737[_0x2e9c('0x30')][_0x2e9c('0x36')](_0x2e9c('0x37'))){_0x562e16[_0x2e9c('0x1f')]=qs[_0x2e9c('0x1f')](_0x21e737[_0x2e9c('0x30')][_0x2e9c('0x1f')]);_0x562e16[_0x2e9c('0x21')]=qs[_0x2e9c('0x21')](_0x21e737[_0x2e9c('0x30')][_0x2e9c('0x21')]);}return _0x5f4732[_0x2e9c('0x4d')](_0x562e16);}})[_0x2e9c('0x26')](function(_0x1b46ed){if(_0x1b46ed){return _0x1b46ed?{'count':_0x3e29ed,'rows':_0x1b46ed}:null;}})['then'](respondWithResult(_0x54fd0f,null))[_0x2e9c('0x44')](handleError(_0x54fd0f,null));};exports[_0x2e9c('0x4f')]=function(_0xd5e041,_0x34178c,_0x116316){var _0x5b5ed5={};var _0x367244={};var _0x33aae8;var _0xed7544;return db['DeskConfiguration'][_0x2e9c('0x4e')]({'where':{'id':_0xd5e041[_0x2e9c('0x49')]['id']}})[_0x2e9c('0x26')](handleEntityNotFound(_0x34178c,null))[_0x2e9c('0x26')](function(_0x2f6ad6){if(_0x2f6ad6){_0x33aae8=_0x2f6ad6;_0x367244[_0x2e9c('0x2f')]=_['keys'](db[_0x2e9c('0x4c')][_0x2e9c('0x2d')]);_0x367244[_0x2e9c('0x30')]=_[_0x2e9c('0x31')](_0xd5e041['query']);_0x367244[_0x2e9c('0x32')]=_['intersection'](_0x367244[_0x2e9c('0x2f')],_0x367244[_0x2e9c('0x30')]);_0x5b5ed5['attributes']=_['intersection'](_0x367244[_0x2e9c('0x2f')],qs[_0x2e9c('0x34')](_0xd5e041[_0x2e9c('0x30')][_0x2e9c('0x34')]));_0x5b5ed5['attributes']=_0x5b5ed5[_0x2e9c('0x35')]['length']?_0x5b5ed5[_0x2e9c('0x35')]:_0x367244[_0x2e9c('0x2f')];_0x5b5ed5[_0x2e9c('0x38')]=qs[_0x2e9c('0x39')](_0xd5e041['query'][_0x2e9c('0x39')]);_0x5b5ed5[_0x2e9c('0x3a')]=qs['filters'](_[_0x2e9c('0x3b')](_0xd5e041[_0x2e9c('0x30')],_0x367244[_0x2e9c('0x32')]));if(_0xd5e041[_0x2e9c('0x30')]['filter']){_0x5b5ed5['where']=_[_0x2e9c('0x3d')](_0x5b5ed5[_0x2e9c('0x3a')],{'$or':_['map'](_0x5b5ed5[_0x2e9c('0x35')],function(_0x1ce5d0){var _0x34e90b={};_0x34e90b[_0x1ce5d0]={'$like':'%'+_0xd5e041[_0x2e9c('0x30')][_0x2e9c('0x3c')]+'%'};return _0x34e90b;})});}_0x5b5ed5=_[_0x2e9c('0x3d')]({},_0x5b5ed5,_0xd5e041['options']);return _0x33aae8[_0x2e9c('0x4f')](_0x5b5ed5);}})[_0x2e9c('0x26')](function(_0x429702){if(_0x429702){_0xed7544=_0x429702['length'];if(!_0xd5e041[_0x2e9c('0x30')][_0x2e9c('0x36')](_0x2e9c('0x37'))){_0x5b5ed5[_0x2e9c('0x1f')]=qs['limit'](_0xd5e041[_0x2e9c('0x30')][_0x2e9c('0x1f')]);_0x5b5ed5[_0x2e9c('0x21')]=qs['offset'](_0xd5e041['query'][_0x2e9c('0x21')]);}return _0x33aae8[_0x2e9c('0x4f')](_0x5b5ed5);}})['then'](function(_0xa1dbbe){if(_0xa1dbbe){return _0xa1dbbe?{'count':_0xed7544,'rows':_0xa1dbbe}:null;}})[_0x2e9c('0x26')](respondWithResult(_0x34178c,null))[_0x2e9c('0x44')](handleError(_0x34178c,null));};exports['getTags']=function(_0x14b478,_0x762563,_0x2b1e47){var _0x1cfad9={};var _0x21dc0f={};var _0x169399;var _0x29246;return db[_0x2e9c('0x2c')][_0x2e9c('0x4e')]({'where':{'id':_0x14b478[_0x2e9c('0x49')]['id']}})[_0x2e9c('0x26')](handleEntityNotFound(_0x762563,null))[_0x2e9c('0x26')](function(_0x29df9c){if(_0x29df9c){_0x169399=_0x29df9c;_0x21dc0f[_0x2e9c('0x2f')]=_[_0x2e9c('0x31')](db[_0x2e9c('0x50')][_0x2e9c('0x2d')]);_0x21dc0f[_0x2e9c('0x30')]=_[_0x2e9c('0x31')](_0x14b478[_0x2e9c('0x30')]);_0x21dc0f[_0x2e9c('0x32')]=_['intersection'](_0x21dc0f[_0x2e9c('0x2f')],_0x21dc0f['query']);_0x1cfad9[_0x2e9c('0x35')]=_[_0x2e9c('0x33')](_0x21dc0f[_0x2e9c('0x2f')],qs['fields'](_0x14b478['query']['fields']));_0x1cfad9[_0x2e9c('0x35')]=_0x1cfad9[_0x2e9c('0x35')][_0x2e9c('0x46')]?_0x1cfad9[_0x2e9c('0x35')]:_0x21dc0f[_0x2e9c('0x2f')];_0x1cfad9['order']=qs[_0x2e9c('0x39')](_0x14b478[_0x2e9c('0x30')][_0x2e9c('0x39')]);_0x1cfad9[_0x2e9c('0x3a')]=qs['filters'](_[_0x2e9c('0x3b')](_0x14b478[_0x2e9c('0x30')],_0x21dc0f[_0x2e9c('0x32')]));if(_0x14b478[_0x2e9c('0x30')][_0x2e9c('0x3c')]){_0x1cfad9[_0x2e9c('0x3a')]=_[_0x2e9c('0x3d')](_0x1cfad9['where'],{'$or':_[_0x2e9c('0x2b')](_0x1cfad9['attributes'],function(_0x5091e7){var _0x1891d0={};_0x1891d0[_0x5091e7]={'$like':'%'+_0x14b478[_0x2e9c('0x30')][_0x2e9c('0x3c')]+'%'};return _0x1891d0;})});}_0x1cfad9=_[_0x2e9c('0x3d')]({},_0x1cfad9,_0x14b478[_0x2e9c('0x40')]);return _0x169399[_0x2e9c('0x51')](_0x1cfad9);}})[_0x2e9c('0x26')](function(_0x4b729d){if(_0x4b729d){_0x29246=_0x4b729d['length'];if(!_0x14b478[_0x2e9c('0x30')]['hasOwnProperty'](_0x2e9c('0x37'))){_0x1cfad9[_0x2e9c('0x1f')]=qs[_0x2e9c('0x1f')](_0x14b478[_0x2e9c('0x30')][_0x2e9c('0x1f')]);_0x1cfad9['offset']=qs[_0x2e9c('0x21')](_0x14b478[_0x2e9c('0x30')][_0x2e9c('0x21')]);}return _0x169399['getTags'](_0x1cfad9);}})['then'](function(_0x5dc6d9){if(_0x5dc6d9){return _0x5dc6d9?{'count':_0x29246,'rows':_0x5dc6d9}:null;}})[_0x2e9c('0x26')](respondWithResult(_0x762563,null))[_0x2e9c('0x44')](handleError(_0x762563,null));};exports[_0x2e9c('0x52')]=function(_0x13b26f,_0x3ed74c,_0x2bb4d6){if(_0x13b26f[_0x2e9c('0x48')]['id']){delete _0x13b26f['body']['id'];}return db['DeskConfiguration'][_0x2e9c('0x4e')]({'where':{'id':_0x13b26f[_0x2e9c('0x49')]['id']}})[_0x2e9c('0x26')](handleEntityNotFound(_0x3ed74c,null))['then'](function(_0x4c9eee){if(_0x4c9eee){return _0x4c9eee[_0x2e9c('0x52')](_0x13b26f[_0x2e9c('0x48')][_0x2e9c('0x53')]||[]);}return null;})['then'](respondWithResult(_0x3ed74c,null))[_0x2e9c('0x44')](handleError(_0x3ed74c,null));}; \ No newline at end of file +var _0xd124=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','then','error','stack','name','send','index','map','DeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','filter','options','include','findAll','rows','params','rawAttributes','find','create','catch','update','body','destroy','findOne','DeskField','order','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xd124,0x143));var _0x4d12=function(_0x47caaa,_0x1b68ee){_0x47caaa=_0x47caaa-0x0;var _0x2b967d=_0xd124[_0x47caaa];return _0x2b967d;};'use strict';var emlformat=require(_0x4d12('0x0'));var rimraf=require(_0x4d12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d12('0x2'));var rp=require(_0x4d12('0x3'));var moment=require(_0x4d12('0x4'));var BPromise=require(_0x4d12('0x5'));var Mustache=require(_0x4d12('0x6'));var util=require('util');var path=require(_0x4d12('0x7'));var sox=require('sox');var csv=require(_0x4d12('0x8'));var ejs=require(_0x4d12('0x9'));var fs=require('fs');var fs_extra=require(_0x4d12('0xa'));var _=require('lodash');var squel=require(_0x4d12('0xb'));var crypto=require(_0x4d12('0xc'));var jsforce=require(_0x4d12('0xd'));var deskjs=require(_0x4d12('0xe'));var toCsv=require(_0x4d12('0x8'));var querystring=require(_0x4d12('0xf'));var Papa=require(_0x4d12('0x10'));var Redis=require(_0x4d12('0x11'));var authService=require(_0x4d12('0x12'));var qs=require(_0x4d12('0x13'));var as=require(_0x4d12('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d12('0x15'))('api');var utils=require(_0x4d12('0x16'));var config=require(_0x4d12('0x17'));var licenseUtil=require(_0x4d12('0x18'));var db=require(_0x4d12('0x19'))['db'];function respondWithStatusCode(_0x223b35,_0x262e07){_0x262e07=_0x262e07||0xcc;return function(_0x170176){if(_0x170176){return _0x223b35[_0x4d12('0x1a')](_0x262e07);}return _0x223b35[_0x4d12('0x1b')](_0x262e07)['end']();};}function respondWithResult(_0x4f00b5,_0x570dfa){_0x570dfa=_0x570dfa||0xc8;return function(_0x4b58b3){if(_0x4b58b3){return _0x4f00b5[_0x4d12('0x1b')](_0x570dfa)[_0x4d12('0x1c')](_0x4b58b3);}};}function respondWithFilteredResult(_0x21a89d,_0x5ad8c4){return function(_0x392436){if(_0x392436){var _0x196ee4=typeof _0x5ad8c4[_0x4d12('0x1d')]==='undefined'&&typeof _0x5ad8c4[_0x4d12('0x1e')]===_0x4d12('0x1f');var _0x7cd80a=_0x392436[_0x4d12('0x20')];var _0x444de1=_0x196ee4?0x0:_0x5ad8c4[_0x4d12('0x1d')];var _0x400457=_0x196ee4?_0x392436[_0x4d12('0x20')]:_0x5ad8c4['offset']+_0x5ad8c4[_0x4d12('0x1e')];var _0xd1cb0c;if(_0x400457>=_0x7cd80a){_0x400457=_0x7cd80a;_0xd1cb0c=0xc8;}else{_0xd1cb0c=0xce;}_0x21a89d[_0x4d12('0x1b')](_0xd1cb0c);return _0x21a89d[_0x4d12('0x21')]('Content-Range',_0x444de1+'-'+_0x400457+'/'+_0x7cd80a)[_0x4d12('0x1c')](_0x392436);}return null;};}function patchUpdates(_0xaa9f52){return function(_0x44a9bd){try{jsonpatch[_0x4d12('0x22')](_0x44a9bd,_0xaa9f52,!![]);}catch(_0x5210f7){return BPromise['reject'](_0x5210f7);}return _0x44a9bd[_0x4d12('0x23')]();};}function saveUpdates(_0x228e84,_0x1659be){return function(_0xd2cecc){if(_0xd2cecc){return _0xd2cecc['update'](_0x228e84)[_0x4d12('0x24')](function(_0x521a81){return _0x521a81;});}return null;};}function removeEntity(_0x174cb3,_0x434e59){return function(_0x55fcfc){if(_0x55fcfc){return _0x55fcfc['destroy']()[_0x4d12('0x24')](function(){_0x174cb3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x318079,_0xbd238b){return function(_0x544394){if(!_0x544394){_0x318079[_0x4d12('0x1a')](0x194);}return _0x544394;};}function handleError(_0x48b48c,_0x4f2bf7){_0x4f2bf7=_0x4f2bf7||0x1f4;return function(_0x40f309){logger[_0x4d12('0x25')](_0x40f309[_0x4d12('0x26')]);if(_0x40f309[_0x4d12('0x27')]){delete _0x40f309['name'];}_0x48b48c[_0x4d12('0x1b')](_0x4f2bf7)[_0x4d12('0x28')](_0x40f309);};}exports[_0x4d12('0x29')]=function(_0x262f40,_0x32dc02){var _0xf16085={},_0x5b547b={},_0x1f4f93={'count':0x0,'rows':[]};var _0x2aed04=_[_0x4d12('0x2a')](db[_0x4d12('0x2b')]['rawAttributes'],function(_0x1799d1){return{'name':_0x1799d1[_0x4d12('0x2c')],'type':_0x1799d1[_0x4d12('0x2d')][_0x4d12('0x2e')]};});_0x5b547b[_0x4d12('0x2f')]=_['map'](_0x2aed04,_0x4d12('0x27'));_0x5b547b[_0x4d12('0x30')]=_[_0x4d12('0x31')](_0x262f40[_0x4d12('0x30')]);_0x5b547b[_0x4d12('0x32')]=_[_0x4d12('0x33')](_0x5b547b[_0x4d12('0x2f')],_0x5b547b['query']);_0xf16085[_0x4d12('0x34')]=_[_0x4d12('0x33')](_0x5b547b[_0x4d12('0x2f')],qs[_0x4d12('0x35')](_0x262f40[_0x4d12('0x30')][_0x4d12('0x35')]));_0xf16085[_0x4d12('0x34')]=_0xf16085['attributes'][_0x4d12('0x36')]?_0xf16085[_0x4d12('0x34')]:_0x5b547b[_0x4d12('0x2f')];if(!_0x262f40[_0x4d12('0x30')]['hasOwnProperty'](_0x4d12('0x37'))){_0xf16085[_0x4d12('0x1e')]=qs[_0x4d12('0x1e')](_0x262f40[_0x4d12('0x30')][_0x4d12('0x1e')]);_0xf16085[_0x4d12('0x1d')]=qs['offset'](_0x262f40['query'][_0x4d12('0x1d')]);}_0xf16085['order']=qs[_0x4d12('0x38')](_0x262f40[_0x4d12('0x30')][_0x4d12('0x38')]);_0xf16085[_0x4d12('0x39')]=qs['filters'](_['pick'](_0x262f40[_0x4d12('0x30')],_0x5b547b[_0x4d12('0x32')]),_0x2aed04);if(_0x262f40['query']['filter']){_0xf16085['where']=_[_0x4d12('0x3a')](_0xf16085[_0x4d12('0x39')],{'$or':_['map'](_0x2aed04,function(_0x32c705){if(_0x32c705[_0x4d12('0x2d')]!=='VIRTUAL'){var _0x5e3759={};_0x5e3759[_0x32c705[_0x4d12('0x27')]]={'$like':'%'+_0x262f40[_0x4d12('0x30')][_0x4d12('0x3b')]+'%'};return _0x5e3759;}})});}_0xf16085=_[_0x4d12('0x3a')]({},_0xf16085,_0x262f40[_0x4d12('0x3c')]);var _0x197f45={'where':_0xf16085['where']};return db[_0x4d12('0x2b')][_0x4d12('0x20')](_0x197f45)[_0x4d12('0x24')](function(_0x341798){_0x1f4f93['count']=_0x341798;if(_0x262f40['query']['includeAll']){_0xf16085[_0x4d12('0x3d')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x4d12('0x3e')](_0xf16085);})[_0x4d12('0x24')](function(_0x3e2a6f){_0x1f4f93[_0x4d12('0x3f')]=_0x3e2a6f;return _0x1f4f93;})[_0x4d12('0x24')](respondWithFilteredResult(_0x32dc02,_0xf16085))['catch'](handleError(_0x32dc02,null));};exports['show']=function(_0x30aba6,_0xbf4ef8){var _0x59061d={'raw':![],'where':{'id':_0x30aba6[_0x4d12('0x40')]['id']}},_0x16f570={};_0x16f570['model']=_[_0x4d12('0x31')](db[_0x4d12('0x2b')][_0x4d12('0x41')]);_0x16f570['query']=_[_0x4d12('0x31')](_0x30aba6[_0x4d12('0x30')]);_0x16f570['filters']=_[_0x4d12('0x33')](_0x16f570[_0x4d12('0x2f')],_0x16f570[_0x4d12('0x30')]);_0x59061d[_0x4d12('0x34')]=_[_0x4d12('0x33')](_0x16f570[_0x4d12('0x2f')],qs[_0x4d12('0x35')](_0x30aba6[_0x4d12('0x30')][_0x4d12('0x35')]));_0x59061d[_0x4d12('0x34')]=_0x59061d[_0x4d12('0x34')][_0x4d12('0x36')]?_0x59061d[_0x4d12('0x34')]:_0x16f570[_0x4d12('0x2f')];if(_0x30aba6['query']['includeAll']){_0x59061d[_0x4d12('0x3d')]=[{'all':!![]}];}_0x59061d=_['merge']({},_0x59061d,_0x30aba6[_0x4d12('0x3c')]);return db[_0x4d12('0x2b')][_0x4d12('0x42')](_0x59061d)['then'](handleEntityNotFound(_0xbf4ef8,null))['then'](respondWithResult(_0xbf4ef8,null))['catch'](handleError(_0xbf4ef8,null));};exports[_0x4d12('0x43')]=function(_0x4ee830,_0x9a713f){return db[_0x4d12('0x2b')][_0x4d12('0x43')](_0x4ee830['body'],{})[_0x4d12('0x24')](respondWithResult(_0x9a713f,0xc9))[_0x4d12('0x44')](handleError(_0x9a713f,null));};exports[_0x4d12('0x45')]=function(_0x39c259,_0xb72397){if(_0x39c259[_0x4d12('0x46')]['id']){delete _0x39c259[_0x4d12('0x46')]['id'];}return db['DeskConfiguration'][_0x4d12('0x42')]({'where':{'id':_0x39c259[_0x4d12('0x40')]['id']}})[_0x4d12('0x24')](handleEntityNotFound(_0xb72397,null))['then'](saveUpdates(_0x39c259[_0x4d12('0x46')],null))[_0x4d12('0x24')](respondWithResult(_0xb72397,null))[_0x4d12('0x44')](handleError(_0xb72397,null));};exports[_0x4d12('0x47')]=function(_0x8cbf15,_0x11dad2){return db[_0x4d12('0x2b')]['find']({'where':{'id':_0x8cbf15[_0x4d12('0x40')]['id']}})[_0x4d12('0x24')](handleEntityNotFound(_0x11dad2,null))['then'](removeEntity(_0x11dad2,null))['catch'](handleError(_0x11dad2,null));};exports['getFields']=function(_0x16c8fc,_0x168ef8,_0x5b27b4){var _0x370b34={};var _0x1ac64f={};var _0x4431db;var _0x3f9247;return db[_0x4d12('0x2b')][_0x4d12('0x48')]({'where':{'id':_0x16c8fc[_0x4d12('0x40')]['id']}})[_0x4d12('0x24')](handleEntityNotFound(_0x168ef8,null))[_0x4d12('0x24')](function(_0xd88a2d){if(_0xd88a2d){_0x4431db=_0xd88a2d;_0x1ac64f[_0x4d12('0x2f')]=_[_0x4d12('0x31')](db[_0x4d12('0x49')]['rawAttributes']);_0x1ac64f[_0x4d12('0x30')]=_[_0x4d12('0x31')](_0x16c8fc[_0x4d12('0x30')]);_0x1ac64f[_0x4d12('0x32')]=_['intersection'](_0x1ac64f['model'],_0x1ac64f[_0x4d12('0x30')]);_0x370b34[_0x4d12('0x34')]=_[_0x4d12('0x33')](_0x1ac64f[_0x4d12('0x2f')],qs[_0x4d12('0x35')](_0x16c8fc[_0x4d12('0x30')][_0x4d12('0x35')]));_0x370b34[_0x4d12('0x34')]=_0x370b34[_0x4d12('0x34')][_0x4d12('0x36')]?_0x370b34[_0x4d12('0x34')]:_0x1ac64f['model'];_0x370b34[_0x4d12('0x4a')]=qs['sort'](_0x16c8fc[_0x4d12('0x30')]['sort']);_0x370b34[_0x4d12('0x39')]=qs[_0x4d12('0x32')](_[_0x4d12('0x4b')](_0x16c8fc[_0x4d12('0x30')],_0x1ac64f[_0x4d12('0x32')]));if(_0x16c8fc[_0x4d12('0x30')][_0x4d12('0x3b')]){_0x370b34[_0x4d12('0x39')]=_[_0x4d12('0x3a')](_0x370b34[_0x4d12('0x39')],{'$or':_['map'](_0x370b34[_0x4d12('0x34')],function(_0x3dfc78){var _0xe8d3c={};_0xe8d3c[_0x3dfc78]={'$like':'%'+_0x16c8fc['query'][_0x4d12('0x3b')]+'%'};return _0xe8d3c;})});}_0x370b34=_[_0x4d12('0x3a')]({},_0x370b34,_0x16c8fc[_0x4d12('0x3c')]);return _0x4431db[_0x4d12('0x4c')](_0x370b34);}})[_0x4d12('0x24')](function(_0x3187c7){if(_0x3187c7){_0x3f9247=_0x3187c7[_0x4d12('0x36')];if(!_0x16c8fc['query'][_0x4d12('0x4d')](_0x4d12('0x37'))){_0x370b34['limit']=qs[_0x4d12('0x1e')](_0x16c8fc[_0x4d12('0x30')][_0x4d12('0x1e')]);_0x370b34[_0x4d12('0x1d')]=qs['offset'](_0x16c8fc[_0x4d12('0x30')][_0x4d12('0x1d')]);}return _0x4431db[_0x4d12('0x4c')](_0x370b34);}})[_0x4d12('0x24')](function(_0x5bd121){if(_0x5bd121){return _0x5bd121?{'count':_0x3f9247,'rows':_0x5bd121}:null;}})[_0x4d12('0x24')](respondWithResult(_0x168ef8,null))[_0x4d12('0x44')](handleError(_0x168ef8,null));};exports[_0x4d12('0x4e')]=function(_0x2d8df8,_0x1222a3,_0x1e8034){var _0x278544={};var _0x1699eb={};var _0x4aa260;var _0x5c765f;return db[_0x4d12('0x2b')]['findOne']({'where':{'id':_0x2d8df8[_0x4d12('0x40')]['id']}})[_0x4d12('0x24')](handleEntityNotFound(_0x1222a3,null))['then'](function(_0x76d414){if(_0x76d414){_0x4aa260=_0x76d414;_0x1699eb[_0x4d12('0x2f')]=_[_0x4d12('0x31')](db[_0x4d12('0x49')]['rawAttributes']);_0x1699eb[_0x4d12('0x30')]=_[_0x4d12('0x31')](_0x2d8df8['query']);_0x1699eb[_0x4d12('0x32')]=_[_0x4d12('0x33')](_0x1699eb[_0x4d12('0x2f')],_0x1699eb[_0x4d12('0x30')]);_0x278544[_0x4d12('0x34')]=_[_0x4d12('0x33')](_0x1699eb[_0x4d12('0x2f')],qs[_0x4d12('0x35')](_0x2d8df8[_0x4d12('0x30')][_0x4d12('0x35')]));_0x278544['attributes']=_0x278544[_0x4d12('0x34')][_0x4d12('0x36')]?_0x278544[_0x4d12('0x34')]:_0x1699eb[_0x4d12('0x2f')];_0x278544['order']=qs[_0x4d12('0x38')](_0x2d8df8[_0x4d12('0x30')][_0x4d12('0x38')]);_0x278544[_0x4d12('0x39')]=qs['filters'](_[_0x4d12('0x4b')](_0x2d8df8['query'],_0x1699eb['filters']));if(_0x2d8df8[_0x4d12('0x30')][_0x4d12('0x3b')]){_0x278544[_0x4d12('0x39')]=_[_0x4d12('0x3a')](_0x278544[_0x4d12('0x39')],{'$or':_[_0x4d12('0x2a')](_0x278544[_0x4d12('0x34')],function(_0x4571){var _0x574afb={};_0x574afb[_0x4571]={'$like':'%'+_0x2d8df8['query'][_0x4d12('0x3b')]+'%'};return _0x574afb;})});}_0x278544=_['merge']({},_0x278544,_0x2d8df8[_0x4d12('0x3c')]);return _0x4aa260[_0x4d12('0x4e')](_0x278544);}})['then'](function(_0x1f8023){if(_0x1f8023){_0x5c765f=_0x1f8023[_0x4d12('0x36')];if(!_0x2d8df8[_0x4d12('0x30')][_0x4d12('0x4d')]('nolimit')){_0x278544[_0x4d12('0x1e')]=qs[_0x4d12('0x1e')](_0x2d8df8[_0x4d12('0x30')][_0x4d12('0x1e')]);_0x278544[_0x4d12('0x1d')]=qs[_0x4d12('0x1d')](_0x2d8df8[_0x4d12('0x30')][_0x4d12('0x1d')]);}return _0x4aa260[_0x4d12('0x4e')](_0x278544);}})[_0x4d12('0x24')](function(_0x4b276f){if(_0x4b276f){return _0x4b276f?{'count':_0x5c765f,'rows':_0x4b276f}:null;}})[_0x4d12('0x24')](respondWithResult(_0x1222a3,null))['catch'](handleError(_0x1222a3,null));};exports[_0x4d12('0x4f')]=function(_0x4a94bd,_0x4cf22c,_0x1a6ce4){var _0x120e07={};var _0x4d2b64={};var _0x1eedad;var _0x22d791;return db[_0x4d12('0x2b')]['findOne']({'where':{'id':_0x4a94bd['params']['id']}})[_0x4d12('0x24')](handleEntityNotFound(_0x4cf22c,null))[_0x4d12('0x24')](function(_0x48d837){if(_0x48d837){_0x1eedad=_0x48d837;_0x4d2b64[_0x4d12('0x2f')]=_['keys'](db[_0x4d12('0x49')][_0x4d12('0x41')]);_0x4d2b64['query']=_['keys'](_0x4a94bd['query']);_0x4d2b64[_0x4d12('0x32')]=_[_0x4d12('0x33')](_0x4d2b64[_0x4d12('0x2f')],_0x4d2b64[_0x4d12('0x30')]);_0x120e07['attributes']=_[_0x4d12('0x33')](_0x4d2b64[_0x4d12('0x2f')],qs[_0x4d12('0x35')](_0x4a94bd['query'][_0x4d12('0x35')]));_0x120e07[_0x4d12('0x34')]=_0x120e07[_0x4d12('0x34')][_0x4d12('0x36')]?_0x120e07[_0x4d12('0x34')]:_0x4d2b64['model'];_0x120e07[_0x4d12('0x4a')]=qs[_0x4d12('0x38')](_0x4a94bd[_0x4d12('0x30')]['sort']);_0x120e07[_0x4d12('0x39')]=qs[_0x4d12('0x32')](_[_0x4d12('0x4b')](_0x4a94bd[_0x4d12('0x30')],_0x4d2b64[_0x4d12('0x32')]));if(_0x4a94bd[_0x4d12('0x30')]['filter']){_0x120e07['where']=_['merge'](_0x120e07[_0x4d12('0x39')],{'$or':_[_0x4d12('0x2a')](_0x120e07['attributes'],function(_0x21807a){var _0x5cedb3={};_0x5cedb3[_0x21807a]={'$like':'%'+_0x4a94bd[_0x4d12('0x30')][_0x4d12('0x3b')]+'%'};return _0x5cedb3;})});}_0x120e07=_[_0x4d12('0x3a')]({},_0x120e07,_0x4a94bd[_0x4d12('0x3c')]);return _0x1eedad[_0x4d12('0x4f')](_0x120e07);}})[_0x4d12('0x24')](function(_0x2d431a){if(_0x2d431a){_0x22d791=_0x2d431a[_0x4d12('0x36')];if(!_0x4a94bd[_0x4d12('0x30')][_0x4d12('0x4d')](_0x4d12('0x37'))){_0x120e07[_0x4d12('0x1e')]=qs[_0x4d12('0x1e')](_0x4a94bd[_0x4d12('0x30')][_0x4d12('0x1e')]);_0x120e07[_0x4d12('0x1d')]=qs[_0x4d12('0x1d')](_0x4a94bd[_0x4d12('0x30')][_0x4d12('0x1d')]);}return _0x1eedad['getDescriptions'](_0x120e07);}})[_0x4d12('0x24')](function(_0x2b64c4){if(_0x2b64c4){return _0x2b64c4?{'count':_0x22d791,'rows':_0x2b64c4}:null;}})[_0x4d12('0x24')](respondWithResult(_0x4cf22c,null))[_0x4d12('0x44')](handleError(_0x4cf22c,null));};exports[_0x4d12('0x50')]=function(_0x3712b7,_0x576f5b,_0x96cda3){var _0x22c82e={};var _0x580477={};var _0x4e2b36;var _0x4c99c9;return db['DeskConfiguration'][_0x4d12('0x48')]({'where':{'id':_0x3712b7[_0x4d12('0x40')]['id']}})['then'](handleEntityNotFound(_0x576f5b,null))['then'](function(_0xd34cea){if(_0xd34cea){_0x4e2b36=_0xd34cea;_0x580477[_0x4d12('0x2f')]=_['keys'](db[_0x4d12('0x51')]['rawAttributes']);_0x580477[_0x4d12('0x30')]=_[_0x4d12('0x31')](_0x3712b7['query']);_0x580477['filters']=_[_0x4d12('0x33')](_0x580477[_0x4d12('0x2f')],_0x580477['query']);_0x22c82e[_0x4d12('0x34')]=_['intersection'](_0x580477[_0x4d12('0x2f')],qs[_0x4d12('0x35')](_0x3712b7[_0x4d12('0x30')][_0x4d12('0x35')]));_0x22c82e[_0x4d12('0x34')]=_0x22c82e[_0x4d12('0x34')][_0x4d12('0x36')]?_0x22c82e[_0x4d12('0x34')]:_0x580477[_0x4d12('0x2f')];_0x22c82e[_0x4d12('0x4a')]=qs[_0x4d12('0x38')](_0x3712b7[_0x4d12('0x30')][_0x4d12('0x38')]);_0x22c82e[_0x4d12('0x39')]=qs[_0x4d12('0x32')](_[_0x4d12('0x4b')](_0x3712b7['query'],_0x580477[_0x4d12('0x32')]));if(_0x3712b7[_0x4d12('0x30')][_0x4d12('0x3b')]){_0x22c82e['where']=_[_0x4d12('0x3a')](_0x22c82e[_0x4d12('0x39')],{'$or':_[_0x4d12('0x2a')](_0x22c82e[_0x4d12('0x34')],function(_0xd7a1c4){var _0x2bb433={};_0x2bb433[_0xd7a1c4]={'$like':'%'+_0x3712b7[_0x4d12('0x30')]['filter']+'%'};return _0x2bb433;})});}_0x22c82e=_[_0x4d12('0x3a')]({},_0x22c82e,_0x3712b7[_0x4d12('0x3c')]);return _0x4e2b36[_0x4d12('0x50')](_0x22c82e);}})[_0x4d12('0x24')](function(_0x259267){if(_0x259267){_0x4c99c9=_0x259267[_0x4d12('0x36')];if(!_0x3712b7[_0x4d12('0x30')][_0x4d12('0x4d')](_0x4d12('0x37'))){_0x22c82e[_0x4d12('0x1e')]=qs[_0x4d12('0x1e')](_0x3712b7[_0x4d12('0x30')][_0x4d12('0x1e')]);_0x22c82e[_0x4d12('0x1d')]=qs[_0x4d12('0x1d')](_0x3712b7[_0x4d12('0x30')]['offset']);}return _0x4e2b36[_0x4d12('0x50')](_0x22c82e);}})[_0x4d12('0x24')](function(_0x1d4a7c){if(_0x1d4a7c){return _0x1d4a7c?{'count':_0x4c99c9,'rows':_0x1d4a7c}:null;}})[_0x4d12('0x24')](respondWithResult(_0x576f5b,null))[_0x4d12('0x44')](handleError(_0x576f5b,null));};exports[_0x4d12('0x52')]=function(_0x4fb504,_0xf6ad2b,_0x207cce){if(_0x4fb504[_0x4d12('0x46')]['id']){delete _0x4fb504[_0x4d12('0x46')]['id'];}return db[_0x4d12('0x2b')][_0x4d12('0x48')]({'where':{'id':_0x4fb504['params']['id']}})[_0x4d12('0x24')](handleEntityNotFound(_0xf6ad2b,null))['then'](function(_0x4b9003){if(_0x4b9003){return _0x4b9003[_0x4d12('0x52')](_0x4fb504[_0x4d12('0x46')]['ids']||[]);}return null;})[_0x4d12('0x24')](respondWithResult(_0xf6ad2b,null))['catch'](handleError(_0xf6ad2b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 42c66dd..f9db788 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 _0x51ef=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x51ef,0x1db));var _0xf51e=function(_0x23a28f,_0x480b0e){_0x23a28f=_0x23a28f-0x0;var _0x4d5c8b=_0x51ef[_0x23a28f];return _0x4d5c8b;};'use strict';var _=require(_0xf51e('0x0'));var util=require(_0xf51e('0x1'));var logger=require(_0xf51e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf51e('0x3'));var rp=require(_0xf51e('0x4'));var fs=require('fs');var path=require(_0xf51e('0x5'));var rimraf=require(_0xf51e('0x6'));var config=require(_0xf51e('0x7'));var attributes=require(_0xf51e('0x8'));module[_0xf51e('0x9')]=function(_0x3ec314,_0x253f22){return _0x3ec314[_0xf51e('0xa')](_0xf51e('0xb'),attributes,{'tableName':_0xf51e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x580c=['../../config/logger','api','bluebird','path','rimraf','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x580c,0x1a0));var _0xc580=function(_0xc8e015,_0x2a319d){_0xc8e015=_0xc8e015-0x0;var _0x2c6929=_0x580c[_0xc8e015];return _0x2c6929;};'use strict';var _=require(_0xc580('0x0'));var util=require(_0xc580('0x1'));var logger=require(_0xc580('0x2'))(_0xc580('0x3'));var moment=require('moment');var BPromise=require(_0xc580('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc580('0x5'));var rimraf=require(_0xc580('0x6'));var config=require('../../config/environment');var attributes=require(_0xc580('0x7'));module[_0xc580('0x8')]=function(_0x40da8c,_0x1389c9){return _0x40da8c[_0xc580('0x9')]('DeskConfiguration',attributes,{'tableName':_0xc580('0xa'),'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 3e00fef..3d6924b 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 _0xeca8=['../../config/environment','jayson/promise','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeca8,0x1f2));var _0x8eca=function(_0x59bede,_0x1bdca0){_0x59bede=_0x59bede-0x0;var _0x151812=_0xeca8[_0x59bede];return _0x151812;};'use strict';var _=require(_0x8eca('0x0'));var util=require(_0x8eca('0x1'));var moment=require(_0x8eca('0x2'));var BPromise=require(_0x8eca('0x3'));var rs=require(_0x8eca('0x4'));var fs=require('fs');var Redis=require(_0x8eca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eca('0x6'));var logger=require('../../config/logger')(_0x8eca('0x7'));var config=require(_0x8eca('0x8'));var jayson=require(_0x8eca('0x9'));var client=jayson['client'][_0x8eca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12c679,_0xe6e3f2,_0x39f40a){return new BPromise(function(_0xedaeca,_0x3b901f){return client['request'](_0x12c679,_0x39f40a)[_0x8eca('0xb')](function(_0x19208c){logger[_0x8eca('0xc')](_0x8eca('0xd'),_0xe6e3f2,_0x8eca('0xe'));logger[_0x8eca('0xf')](_0x8eca('0x10'),_0xe6e3f2,_0x8eca('0xe'),JSON[_0x8eca('0x11')](_0x19208c));if(_0x19208c[_0x8eca('0x12')]){if(_0x19208c['error'][_0x8eca('0x13')]===0x1f4){logger['error'](_0x8eca('0xd'),_0xe6e3f2,_0x19208c[_0x8eca('0x12')]['message']);return _0x3b901f(_0x19208c[_0x8eca('0x12')]['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0xe6e3f2,_0x19208c[_0x8eca('0x12')][_0x8eca('0x14')]);return _0xedaeca(_0x19208c[_0x8eca('0x12')][_0x8eca('0x14')]);}else{logger[_0x8eca('0xc')](_0x8eca('0xd'),_0xe6e3f2,_0x8eca('0xe'));_0xedaeca(_0x19208c['result'][_0x8eca('0x14')]);}})[_0x8eca('0x15')](function(_0x4b8c67){logger[_0x8eca('0x12')](_0x8eca('0xd'),_0xe6e3f2,_0x4b8c67);_0x3b901f(_0x4b8c67);});});} \ No newline at end of file +var _0x2d6d=['stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x2d6d,0x66));var _0xd2d6=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0x2d6d[_0x38fb0d];return _0x30a5d6;};'use strict';var _=require(_0xd2d6('0x0'));var util=require(_0xd2d6('0x1'));var moment=require(_0xd2d6('0x2'));var BPromise=require(_0xd2d6('0x3'));var rs=require(_0xd2d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd2d6('0x5'));var logger=require(_0xd2d6('0x6'))(_0xd2d6('0x7'));var config=require(_0xd2d6('0x8'));var jayson=require(_0xd2d6('0x9'));var client=jayson[_0xd2d6('0xa')][_0xd2d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24207a,_0x261c64,_0x4cef30){return new BPromise(function(_0x13e031,_0x4b93a6){return client[_0xd2d6('0xc')](_0x24207a,_0x4cef30)['then'](function(_0x4dec6e){logger[_0xd2d6('0xd')](_0xd2d6('0xe'),_0x261c64,_0xd2d6('0xf'));logger[_0xd2d6('0x10')](_0xd2d6('0x11'),_0x261c64,_0xd2d6('0xf'),JSON[_0xd2d6('0x12')](_0x4dec6e));if(_0x4dec6e['error']){if(_0x4dec6e['error'][_0xd2d6('0x13')]===0x1f4){logger[_0xd2d6('0x14')](_0xd2d6('0xe'),_0x261c64,_0x4dec6e[_0xd2d6('0x14')][_0xd2d6('0x15')]);return _0x4b93a6(_0x4dec6e[_0xd2d6('0x14')]['message']);}logger[_0xd2d6('0x14')](_0xd2d6('0xe'),_0x261c64,_0x4dec6e[_0xd2d6('0x14')][_0xd2d6('0x15')]);return _0x13e031(_0x4dec6e['error']['message']);}else{logger[_0xd2d6('0xd')](_0xd2d6('0xe'),_0x261c64,_0xd2d6('0xf'));_0x13e031(_0x4dec6e[_0xd2d6('0x16')][_0xd2d6('0x15')]);}})[_0xd2d6('0x17')](function(_0x58e05f){logger[_0xd2d6('0x14')]('DeskConfiguration,\x20%s,\x20%s',_0x261c64,_0x58e05f);_0x4b93a6(_0x58e05f);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2ebd113..40414f5 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 _0xa469=['Router','fs-extra','../../components/auth/service','./intDeskField.controller','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','connect-timeout','express'];(function(_0x36cded,_0x5f5afc){var _0x32deda=function(_0x2e6af5){while(--_0x2e6af5){_0x36cded['push'](_0x36cded['shift']());}};_0x32deda(++_0x5f5afc);}(_0xa469,0x9d));var _0x9a46=function(_0x6317fd,_0x57da55){_0x6317fd=_0x6317fd-0x0;var _0x524b3f=_0xa469[_0x6317fd];return _0x524b3f;};'use strict';var multer=require(_0x9a46('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9a46('0x1'));var express=require(_0x9a46('0x2'));var router=express[_0x9a46('0x3')]();var fs_extra=require(_0x9a46('0x4'));var auth=require(_0x9a46('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9a46('0x6'));router['get']('/',auth[_0x9a46('0x7')](),controller[_0x9a46('0x8')]);router['get'](_0x9a46('0x9'),auth[_0x9a46('0x7')](),controller[_0x9a46('0xa')]);router[_0x9a46('0xb')]('/',auth[_0x9a46('0x7')](),controller[_0x9a46('0xc')]);router['put'](_0x9a46('0x9'),auth[_0x9a46('0x7')](),controller[_0x9a46('0xd')]);router['delete'](_0x9a46('0x9'),auth[_0x9a46('0x7')](),controller[_0x9a46('0xe')]);module[_0x9a46('0xf')]=router; \ No newline at end of file +var _0xafe6=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3e1ccd,_0x3d3880){var _0x3e02ed=function(_0x45edb0){while(--_0x45edb0){_0x3e1ccd['push'](_0x3e1ccd['shift']());}};_0x3e02ed(++_0x3d3880);}(_0xafe6,0xa7));var _0x6afe=function(_0x4a7884,_0x26edf8){_0x4a7884=_0x4a7884-0x0;var _0x3d6da1=_0xafe6[_0x4a7884];return _0x3d6da1;};'use strict';var multer=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var path=require(_0x6afe('0x2'));var timeout=require(_0x6afe('0x3'));var express=require(_0x6afe('0x4'));var router=express['Router']();var fs_extra=require(_0x6afe('0x5'));var auth=require(_0x6afe('0x6'));var interaction=require(_0x6afe('0x7'));var config=require('../../config/environment');var controller=require(_0x6afe('0x8'));router[_0x6afe('0x9')]('/',auth[_0x6afe('0xa')](),controller[_0x6afe('0xb')]);router[_0x6afe('0x9')](_0x6afe('0xc'),auth['isAuthenticated'](),controller[_0x6afe('0xd')]);router[_0x6afe('0xe')]('/',auth[_0x6afe('0xa')](),controller[_0x6afe('0xf')]);router[_0x6afe('0x10')]('/:id',auth[_0x6afe('0xa')](),controller[_0x6afe('0x11')]);router[_0x6afe('0x12')](_0x6afe('0xc'),auth[_0x6afe('0xa')](),controller[_0x6afe('0x13')]);module[_0x6afe('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e93c05a..179fb50 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 _0x83bd=['string','variable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x3ce4db,_0x4d2842){var _0xa541df=function(_0x12ad03){while(--_0x12ad03){_0x3ce4db['push'](_0x3ce4db['shift']());}};_0xa541df(++_0x4d2842);}(_0x83bd,0xa6));var _0xd83b=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x83bd[_0x5534fe];return _0x3d1dc2;};'use strict';var Sequelize=require(_0xd83b('0x0'));module[_0xd83b('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd83b('0x2'),_0xd83b('0x3'),'customVariable',_0xd83b('0x4'),_0xd83b('0x5')),'defaultValue':_0xd83b('0x2')},'content':{'type':Sequelize[_0xd83b('0x6')]},'key':{'type':Sequelize[_0xd83b('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xd83b('0x6')]},'idField':{'type':Sequelize[_0xd83b('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd83b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd83b('0x6')]}}; \ No newline at end of file +var _0x2915=['variable','customVariable','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x57539a,_0x32325a){var _0x243b67=function(_0x4a929f){while(--_0x4a929f){_0x57539a['push'](_0x57539a['shift']());}};_0x243b67(++_0x32325a);}(_0x2915,0x144));var _0x5291=function(_0x5013bd,_0x4d4b8d){_0x5013bd=_0x5013bd-0x0;var _0x5d3e13=_0x2915[_0x5013bd];return _0x5d3e13;};'use strict';var Sequelize=require(_0x5291('0x0'));module[_0x5291('0x1')]={'type':{'type':Sequelize[_0x5291('0x2')](_0x5291('0x3'),_0x5291('0x4'),_0x5291('0x5'),'keyValue',_0x5291('0x6')),'defaultValue':_0x5291('0x3')},'content':{'type':Sequelize[_0x5291('0x7')]},'key':{'type':Sequelize[_0x5291('0x7')]},'keyType':{'type':Sequelize[_0x5291('0x2')]('string','variable',_0x5291('0x5'))},'keyContent':{'type':Sequelize[_0x5291('0x7')]},'idField':{'type':Sequelize[_0x5291('0x7')]},'nameField':{'type':Sequelize[_0x5291('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5291('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index ad88a5d..948a3e6 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 _0x6011=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','update','find','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x255e42,_0x1b8f05){var _0x36151c=function(_0x342cdc){while(--_0x342cdc){_0x255e42['push'](_0x255e42['shift']());}};_0x36151c(++_0x1b8f05);}(_0x6011,0x196));var _0x1601=function(_0x1ff7a1,_0x4b4c5d){_0x1ff7a1=_0x1ff7a1-0x0;var _0x19a883=_0x6011[_0x1ff7a1];return _0x19a883;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1601('0x0'));var BPromise=require(_0x1601('0x1'));var Mustache=require('mustache');var util=require(_0x1601('0x2'));var path=require(_0x1601('0x3'));var sox=require(_0x1601('0x4'));var csv=require(_0x1601('0x5'));var ejs=require(_0x1601('0x6'));var fs=require('fs');var fs_extra=require(_0x1601('0x7'));var _=require(_0x1601('0x8'));var squel=require(_0x1601('0x9'));var crypto=require(_0x1601('0xa'));var jsforce=require(_0x1601('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1601('0x5'));var querystring=require(_0x1601('0xc'));var Papa=require(_0x1601('0xd'));var Redis=require(_0x1601('0xe'));var authService=require(_0x1601('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1601('0x10'))('api');var utils=require(_0x1601('0x11'));var config=require(_0x1601('0x12'));var licenseUtil=require(_0x1601('0x13'));var db=require(_0x1601('0x14'))['db'];function respondWithStatusCode(_0x263bef,_0x322025){_0x322025=_0x322025||0xcc;return function(_0x3ac50b){if(_0x3ac50b){return _0x263bef[_0x1601('0x15')](_0x322025);}return _0x263bef['status'](_0x322025)[_0x1601('0x16')]();};}function respondWithResult(_0x555d4f,_0x4705f0){_0x4705f0=_0x4705f0||0xc8;return function(_0x5d642d){if(_0x5d642d){return _0x555d4f[_0x1601('0x17')](_0x4705f0)[_0x1601('0x18')](_0x5d642d);}};}function respondWithFilteredResult(_0x4bb5c1,_0x1b40be){return function(_0x39873a){if(_0x39873a){var _0x12ddb0=typeof _0x1b40be['offset']==='undefined'&&typeof _0x1b40be[_0x1601('0x19')]===_0x1601('0x1a');var _0x3621e2=_0x39873a[_0x1601('0x1b')];var _0x1d8563=_0x12ddb0?0x0:_0x1b40be[_0x1601('0x1c')];var _0x23b992=_0x12ddb0?_0x39873a[_0x1601('0x1b')]:_0x1b40be[_0x1601('0x1c')]+_0x1b40be['limit'];var _0x4d077e;if(_0x23b992>=_0x3621e2){_0x23b992=_0x3621e2;_0x4d077e=0xc8;}else{_0x4d077e=0xce;}_0x4bb5c1[_0x1601('0x17')](_0x4d077e);return _0x4bb5c1[_0x1601('0x1d')](_0x1601('0x1e'),_0x1d8563+'-'+_0x23b992+'/'+_0x3621e2)['json'](_0x39873a);}return null;};}function patchUpdates(_0x2c3b5d){return function(_0x380157){try{jsonpatch[_0x1601('0x1f')](_0x380157,_0x2c3b5d,!![]);}catch(_0x2e2e0d){return BPromise[_0x1601('0x20')](_0x2e2e0d);}return _0x380157['save']();};}function saveUpdates(_0x1b8314,_0x296023){return function(_0x220313){if(_0x220313){return _0x220313['update'](_0x1b8314)[_0x1601('0x21')](function(_0x330033){return _0x330033;});}return null;};}function removeEntity(_0x4f918b,_0x2b01da){return function(_0xa8e856){if(_0xa8e856){return _0xa8e856['destroy']()['then'](function(){_0x4f918b[_0x1601('0x17')](0xcc)[_0x1601('0x16')]();});}};}function handleEntityNotFound(_0x34d021,_0x4919f2){return function(_0x362f51){if(!_0x362f51){_0x34d021[_0x1601('0x15')](0x194);}return _0x362f51;};}function handleError(_0x23a6a9,_0x250fcc){_0x250fcc=_0x250fcc||0x1f4;return function(_0x296c34){logger['error'](_0x296c34['stack']);if(_0x296c34[_0x1601('0x22')]){delete _0x296c34[_0x1601('0x22')];}_0x23a6a9[_0x1601('0x17')](_0x250fcc)['send'](_0x296c34);};}exports[_0x1601('0x23')]=function(_0x57eb42,_0x2dcbc9){var _0x3c6bc1={},_0x389f0f={},_0x4d4d0b={'count':0x0,'rows':[]};var _0x388530=_[_0x1601('0x24')](db[_0x1601('0x25')][_0x1601('0x26')],function(_0x5cdcfb){return{'name':_0x5cdcfb[_0x1601('0x27')],'type':_0x5cdcfb[_0x1601('0x28')][_0x1601('0x29')]};});_0x389f0f[_0x1601('0x2a')]=_[_0x1601('0x24')](_0x388530,_0x1601('0x22'));_0x389f0f[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x57eb42[_0x1601('0x2b')]);_0x389f0f[_0x1601('0x2d')]=_[_0x1601('0x2e')](_0x389f0f[_0x1601('0x2a')],_0x389f0f[_0x1601('0x2b')]);_0x3c6bc1['attributes']=_[_0x1601('0x2e')](_0x389f0f[_0x1601('0x2a')],qs[_0x1601('0x2f')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x2f')]));_0x3c6bc1['attributes']=_0x3c6bc1[_0x1601('0x30')][_0x1601('0x31')]?_0x3c6bc1['attributes']:_0x389f0f[_0x1601('0x2a')];if(!_0x57eb42['query'][_0x1601('0x32')](_0x1601('0x33'))){_0x3c6bc1['limit']=qs[_0x1601('0x19')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x19')]);_0x3c6bc1[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x1c')]);}_0x3c6bc1['order']=qs[_0x1601('0x34')](_0x57eb42[_0x1601('0x2b')]['sort']);_0x3c6bc1['where']=qs[_0x1601('0x2d')](_[_0x1601('0x35')](_0x57eb42[_0x1601('0x2b')],_0x389f0f[_0x1601('0x2d')]),_0x388530);if(_0x57eb42[_0x1601('0x2b')][_0x1601('0x36')]){_0x3c6bc1[_0x1601('0x37')]=_['merge'](_0x3c6bc1[_0x1601('0x37')],{'$or':_[_0x1601('0x24')](_0x388530,function(_0x482379){if(_0x482379['type']!==_0x1601('0x38')){var _0x52034d={};_0x52034d[_0x482379['name']]={'$like':'%'+_0x57eb42['query'][_0x1601('0x36')]+'%'};return _0x52034d;}})});}_0x3c6bc1=_[_0x1601('0x39')]({},_0x3c6bc1,_0x57eb42[_0x1601('0x3a')]);var _0xb8146e={'where':_0x3c6bc1[_0x1601('0x37')]};return db[_0x1601('0x25')][_0x1601('0x1b')](_0xb8146e)[_0x1601('0x21')](function(_0x388f3b){_0x4d4d0b[_0x1601('0x1b')]=_0x388f3b;if(_0x57eb42[_0x1601('0x2b')][_0x1601('0x3b')]){_0x3c6bc1[_0x1601('0x3c')]=[{'all':!![]}];}return db['DeskField'][_0x1601('0x3d')](_0x3c6bc1);})['then'](function(_0x5acf66){_0x4d4d0b['rows']=_0x5acf66;return _0x4d4d0b;})[_0x1601('0x21')](respondWithFilteredResult(_0x2dcbc9,_0x3c6bc1))[_0x1601('0x3e')](handleError(_0x2dcbc9,null));};exports[_0x1601('0x3f')]=function(_0x5a06dc,_0x581941){var _0x3aef1a={'raw':!![],'where':{'id':_0x5a06dc[_0x1601('0x40')]['id']}},_0x3ce65d={};_0x3ce65d['model']=_[_0x1601('0x2c')](db['DeskField'][_0x1601('0x26')]);_0x3ce65d[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x5a06dc[_0x1601('0x2b')]);_0x3ce65d['filters']=_[_0x1601('0x2e')](_0x3ce65d['model'],_0x3ce65d[_0x1601('0x2b')]);_0x3aef1a[_0x1601('0x30')]=_['intersection'](_0x3ce65d[_0x1601('0x2a')],qs[_0x1601('0x2f')](_0x5a06dc[_0x1601('0x2b')]['fields']));_0x3aef1a[_0x1601('0x30')]=_0x3aef1a['attributes'][_0x1601('0x31')]?_0x3aef1a[_0x1601('0x30')]:_0x3ce65d[_0x1601('0x2a')];if(_0x5a06dc[_0x1601('0x2b')][_0x1601('0x3b')]){_0x3aef1a[_0x1601('0x3c')]=[{'all':!![]}];}_0x3aef1a=_[_0x1601('0x39')]({},_0x3aef1a,_0x5a06dc[_0x1601('0x3a')]);return db[_0x1601('0x25')]['find'](_0x3aef1a)[_0x1601('0x21')](handleEntityNotFound(_0x581941,null))['then'](respondWithResult(_0x581941,null))[_0x1601('0x3e')](handleError(_0x581941,null));};exports[_0x1601('0x41')]=function(_0x4a8039,_0xbaeefc){return db[_0x1601('0x25')]['create'](_0x4a8039[_0x1601('0x42')],{})[_0x1601('0x21')](respondWithResult(_0xbaeefc,0xc9))[_0x1601('0x3e')](handleError(_0xbaeefc,null));};exports[_0x1601('0x43')]=function(_0x30f2bf,_0xf14c98){if(_0x30f2bf[_0x1601('0x42')]['id']){delete _0x30f2bf[_0x1601('0x42')]['id'];}return db[_0x1601('0x25')][_0x1601('0x44')]({'where':{'id':_0x30f2bf['params']['id']}})[_0x1601('0x21')](handleEntityNotFound(_0xf14c98,null))['then'](saveUpdates(_0x30f2bf[_0x1601('0x42')],null))[_0x1601('0x21')](respondWithResult(_0xf14c98,null))[_0x1601('0x3e')](handleError(_0xf14c98,null));};exports['destroy']=function(_0x56b904,_0x26ba09){return db[_0x1601('0x25')]['find']({'where':{'id':_0x56b904['params']['id']}})['then'](handleEntityNotFound(_0x26ba09,null))[_0x1601('0x21')](removeEntity(_0x26ba09,null))['catch'](handleError(_0x26ba09,null));}; \ No newline at end of file +var _0x544f=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','save','update','then','error','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x544f,0x104));var _0xf544=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x544f[_0x45783c];return _0x1161da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf544('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf544('0x1'));var rp=require(_0xf544('0x2'));var moment=require(_0xf544('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf544('0x4'));var util=require(_0xf544('0x5'));var path=require(_0xf544('0x6'));var sox=require('sox');var csv=require(_0xf544('0x7'));var ejs=require(_0xf544('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf544('0x9'));var jsforce=require(_0xf544('0xa'));var deskjs=require(_0xf544('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf544('0xc'));var Papa=require(_0xf544('0xd'));var Redis=require(_0xf544('0xe'));var authService=require(_0xf544('0xf'));var qs=require(_0xf544('0x10'));var as=require(_0xf544('0x11'));var hardwareService=require(_0xf544('0x12'));var logger=require(_0xf544('0x13'))(_0xf544('0x14'));var utils=require(_0xf544('0x15'));var config=require(_0xf544('0x16'));var licenseUtil=require(_0xf544('0x17'));var db=require(_0xf544('0x18'))['db'];function respondWithStatusCode(_0x1b5698,_0x7e7085){_0x7e7085=_0x7e7085||0xcc;return function(_0x2263c3){if(_0x2263c3){return _0x1b5698[_0xf544('0x19')](_0x7e7085);}return _0x1b5698[_0xf544('0x1a')](_0x7e7085)[_0xf544('0x1b')]();};}function respondWithResult(_0x42880b,_0x49ed2c){_0x49ed2c=_0x49ed2c||0xc8;return function(_0x5c87b4){if(_0x5c87b4){return _0x42880b['status'](_0x49ed2c)[_0xf544('0x1c')](_0x5c87b4);}};}function respondWithFilteredResult(_0x5396fe,_0x54048d){return function(_0x27e13d){if(_0x27e13d){var _0x2ad9ae=typeof _0x54048d['offset']===_0xf544('0x1d')&&typeof _0x54048d[_0xf544('0x1e')]===_0xf544('0x1d');var _0x454f9e=_0x27e13d[_0xf544('0x1f')];var _0x2abda3=_0x2ad9ae?0x0:_0x54048d[_0xf544('0x20')];var _0x49c3d8=_0x2ad9ae?_0x27e13d[_0xf544('0x1f')]:_0x54048d[_0xf544('0x20')]+_0x54048d[_0xf544('0x1e')];var _0x48cbb3;if(_0x49c3d8>=_0x454f9e){_0x49c3d8=_0x454f9e;_0x48cbb3=0xc8;}else{_0x48cbb3=0xce;}_0x5396fe[_0xf544('0x1a')](_0x48cbb3);return _0x5396fe['set']('Content-Range',_0x2abda3+'-'+_0x49c3d8+'/'+_0x454f9e)[_0xf544('0x1c')](_0x27e13d);}return null;};}function patchUpdates(_0x4cd4c9){return function(_0x27a3cd){try{jsonpatch['apply'](_0x27a3cd,_0x4cd4c9,!![]);}catch(_0x223707){return BPromise['reject'](_0x223707);}return _0x27a3cd[_0xf544('0x21')]();};}function saveUpdates(_0x5f5d1e,_0x1def98){return function(_0x1f4235){if(_0x1f4235){return _0x1f4235[_0xf544('0x22')](_0x5f5d1e)[_0xf544('0x23')](function(_0x49a558){return _0x49a558;});}return null;};}function removeEntity(_0x244e74,_0x216558){return function(_0x131511){if(_0x131511){return _0x131511['destroy']()['then'](function(){_0x244e74[_0xf544('0x1a')](0xcc)[_0xf544('0x1b')]();});}};}function handleEntityNotFound(_0x5c5148,_0x31ccae){return function(_0x37398a){if(!_0x37398a){_0x5c5148[_0xf544('0x19')](0x194);}return _0x37398a;};}function handleError(_0x34a134,_0x535df7){_0x535df7=_0x535df7||0x1f4;return function(_0x3bf1c3){logger[_0xf544('0x24')](_0x3bf1c3[_0xf544('0x25')]);if(_0x3bf1c3[_0xf544('0x26')]){delete _0x3bf1c3['name'];}_0x34a134[_0xf544('0x1a')](_0x535df7)['send'](_0x3bf1c3);};}exports[_0xf544('0x27')]=function(_0x1375cb,_0x202cf3){var _0x36891b={},_0x472961={},_0x42f54c={'count':0x0,'rows':[]};var _0x4259a4=_[_0xf544('0x28')](db[_0xf544('0x29')][_0xf544('0x2a')],function(_0x626635){return{'name':_0x626635[_0xf544('0x2b')],'type':_0x626635[_0xf544('0x2c')][_0xf544('0x2d')]};});_0x472961['model']=_[_0xf544('0x28')](_0x4259a4,_0xf544('0x26'));_0x472961[_0xf544('0x2e')]=_[_0xf544('0x2f')](_0x1375cb[_0xf544('0x2e')]);_0x472961['filters']=_[_0xf544('0x30')](_0x472961[_0xf544('0x31')],_0x472961[_0xf544('0x2e')]);_0x36891b[_0xf544('0x32')]=_[_0xf544('0x30')](_0x472961[_0xf544('0x31')],qs['fields'](_0x1375cb['query'][_0xf544('0x33')]));_0x36891b['attributes']=_0x36891b[_0xf544('0x32')][_0xf544('0x34')]?_0x36891b[_0xf544('0x32')]:_0x472961[_0xf544('0x31')];if(!_0x1375cb[_0xf544('0x2e')]['hasOwnProperty'](_0xf544('0x35'))){_0x36891b[_0xf544('0x1e')]=qs['limit'](_0x1375cb[_0xf544('0x2e')][_0xf544('0x1e')]);_0x36891b[_0xf544('0x20')]=qs[_0xf544('0x20')](_0x1375cb[_0xf544('0x2e')][_0xf544('0x20')]);}_0x36891b['order']=qs['sort'](_0x1375cb['query'][_0xf544('0x36')]);_0x36891b[_0xf544('0x37')]=qs[_0xf544('0x38')](_['pick'](_0x1375cb['query'],_0x472961[_0xf544('0x38')]),_0x4259a4);if(_0x1375cb[_0xf544('0x2e')][_0xf544('0x39')]){_0x36891b[_0xf544('0x37')]=_['merge'](_0x36891b[_0xf544('0x37')],{'$or':_['map'](_0x4259a4,function(_0x4236e8){if(_0x4236e8[_0xf544('0x2c')]!==_0xf544('0x3a')){var _0x490d21={};_0x490d21[_0x4236e8[_0xf544('0x26')]]={'$like':'%'+_0x1375cb[_0xf544('0x2e')][_0xf544('0x39')]+'%'};return _0x490d21;}})});}_0x36891b=_[_0xf544('0x3b')]({},_0x36891b,_0x1375cb[_0xf544('0x3c')]);var _0x485b9a={'where':_0x36891b[_0xf544('0x37')]};return db['DeskField'][_0xf544('0x1f')](_0x485b9a)[_0xf544('0x23')](function(_0x1f5dcf){_0x42f54c[_0xf544('0x1f')]=_0x1f5dcf;if(_0x1375cb['query'][_0xf544('0x3d')]){_0x36891b[_0xf544('0x3e')]=[{'all':!![]}];}return db[_0xf544('0x29')][_0xf544('0x3f')](_0x36891b);})['then'](function(_0x1455a9){_0x42f54c[_0xf544('0x40')]=_0x1455a9;return _0x42f54c;})['then'](respondWithFilteredResult(_0x202cf3,_0x36891b))['catch'](handleError(_0x202cf3,null));};exports[_0xf544('0x41')]=function(_0x2da781,_0x3dfb48){var _0x87012b={'raw':!![],'where':{'id':_0x2da781[_0xf544('0x42')]['id']}},_0x38ff26={};_0x38ff26[_0xf544('0x31')]=_[_0xf544('0x2f')](db[_0xf544('0x29')]['rawAttributes']);_0x38ff26[_0xf544('0x2e')]=_['keys'](_0x2da781[_0xf544('0x2e')]);_0x38ff26[_0xf544('0x38')]=_[_0xf544('0x30')](_0x38ff26[_0xf544('0x31')],_0x38ff26['query']);_0x87012b[_0xf544('0x32')]=_[_0xf544('0x30')](_0x38ff26[_0xf544('0x31')],qs[_0xf544('0x33')](_0x2da781[_0xf544('0x2e')][_0xf544('0x33')]));_0x87012b[_0xf544('0x32')]=_0x87012b[_0xf544('0x32')][_0xf544('0x34')]?_0x87012b[_0xf544('0x32')]:_0x38ff26[_0xf544('0x31')];if(_0x2da781['query'][_0xf544('0x3d')]){_0x87012b[_0xf544('0x3e')]=[{'all':!![]}];}_0x87012b=_[_0xf544('0x3b')]({},_0x87012b,_0x2da781[_0xf544('0x3c')]);return db[_0xf544('0x29')][_0xf544('0x43')](_0x87012b)['then'](handleEntityNotFound(_0x3dfb48,null))[_0xf544('0x23')](respondWithResult(_0x3dfb48,null))[_0xf544('0x44')](handleError(_0x3dfb48,null));};exports[_0xf544('0x45')]=function(_0x11f065,_0x54e88d){return db[_0xf544('0x29')][_0xf544('0x45')](_0x11f065['body'],{})[_0xf544('0x23')](respondWithResult(_0x54e88d,0xc9))[_0xf544('0x44')](handleError(_0x54e88d,null));};exports[_0xf544('0x22')]=function(_0x1b5250,_0x5bf594){if(_0x1b5250[_0xf544('0x46')]['id']){delete _0x1b5250['body']['id'];}return db[_0xf544('0x29')][_0xf544('0x43')]({'where':{'id':_0x1b5250[_0xf544('0x42')]['id']}})[_0xf544('0x23')](handleEntityNotFound(_0x5bf594,null))['then'](saveUpdates(_0x1b5250[_0xf544('0x46')],null))['then'](respondWithResult(_0x5bf594,null))[_0xf544('0x44')](handleError(_0x5bf594,null));};exports['destroy']=function(_0x10c874,_0x16926b){return db['DeskField'][_0xf544('0x43')]({'where':{'id':_0x10c874[_0xf544('0x42')]['id']}})['then'](handleEntityNotFound(_0x16926b,null))[_0xf544('0x23')](removeEntity(_0x16926b,null))[_0xf544('0x44')](handleError(_0x16926b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4b78266..ade9601 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 _0x5165=['path','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4b7704,_0x20467a){var _0x5bfae9=function(_0x3746a9){while(--_0x3746a9){_0x4b7704['push'](_0x4b7704['shift']());}};_0x5bfae9(++_0x20467a);}(_0x5165,0x10a));var _0x5516=function(_0x3a05ec,_0x243522){_0x3a05ec=_0x3a05ec-0x0;var _0x241c7f=_0x5165[_0x3a05ec];return _0x241c7f;};'use strict';var _=require(_0x5516('0x0'));var util=require('util');var logger=require(_0x5516('0x1'))(_0x5516('0x2'));var moment=require(_0x5516('0x3'));var BPromise=require(_0x5516('0x4'));var rp=require(_0x5516('0x5'));var fs=require('fs');var path=require(_0x5516('0x6'));var rimraf=require(_0x5516('0x7'));var config=require(_0x5516('0x8'));var attributes=require(_0x5516('0x9'));module[_0x5516('0xa')]=function(_0x5ecad2,_0x409da5){return _0x5ecad2['define'](_0x5516('0xb'),attributes,{'tableName':_0x5516('0xc'),'paranoid':![],'indexes':[{'name':_0x5516('0xd'),'fields':[_0x5516('0xe'),_0x5516('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x20de=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','FieldId','lodash','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x20de,0x1ed));var _0xe20d=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x20de[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xe20d('0x0'));var util=require(_0xe20d('0x1'));var logger=require(_0xe20d('0x2'))(_0xe20d('0x3'));var moment=require(_0xe20d('0x4'));var BPromise=require('bluebird');var rp=require(_0xe20d('0x5'));var fs=require('fs');var path=require(_0xe20d('0x6'));var rimraf=require(_0xe20d('0x7'));var config=require(_0xe20d('0x8'));var attributes=require(_0xe20d('0x9'));module[_0xe20d('0xa')]=function(_0xad7615,_0x53c08d){return _0xad7615[_0xe20d('0xb')]('DeskField',attributes,{'tableName':_0xe20d('0xc'),'paranoid':![],'indexes':[{'name':_0xe20d('0xd'),'fields':['idField',_0xe20d('0xe')],'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 61c933a..e9007db 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 _0x51e8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x1944c9,_0x1903c0){var _0x9a7545=function(_0x199b8b){while(--_0x199b8b){_0x1944c9['push'](_0x1944c9['shift']());}};_0x9a7545(++_0x1903c0);}(_0x51e8,0x1a2));var _0x851e=function(_0x345bef,_0x1d8140){_0x345bef=_0x345bef-0x0;var _0x575a2d=_0x51e8[_0x345bef];return _0x575a2d;};'use strict';var _=require(_0x851e('0x0'));var util=require(_0x851e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x851e('0x2'));var fs=require('fs');var Redis=require(_0x851e('0x3'));var db=require(_0x851e('0x4'))['db'];var utils=require(_0x851e('0x5'));var logger=require(_0x851e('0x6'))('rpc');var config=require(_0x851e('0x7'));var jayson=require(_0x851e('0x8'));var client=jayson[_0x851e('0x9')][_0x851e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x509831,_0x51e4ab,_0xad016f){return new BPromise(function(_0x3d616f,_0x4b4639){return client[_0x851e('0xb')](_0x509831,_0xad016f)[_0x851e('0xc')](function(_0x2a1f4c){logger[_0x851e('0xd')](_0x851e('0xe'),_0x51e4ab,_0x851e('0xf'));logger['debug'](_0x851e('0x10'),_0x51e4ab,'request\x20sent',JSON['stringify'](_0x2a1f4c));if(_0x2a1f4c[_0x851e('0x11')]){if(_0x2a1f4c[_0x851e('0x11')][_0x851e('0x12')]===0x1f4){logger[_0x851e('0x11')](_0x851e('0xe'),_0x51e4ab,_0x2a1f4c[_0x851e('0x11')][_0x851e('0x13')]);return _0x4b4639(_0x2a1f4c[_0x851e('0x11')][_0x851e('0x13')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x51e4ab,_0x2a1f4c[_0x851e('0x11')][_0x851e('0x13')]);return _0x3d616f(_0x2a1f4c['error']['message']);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x51e4ab,_0x851e('0xf'));_0x3d616f(_0x2a1f4c['result'][_0x851e('0x13')]);}})[_0x851e('0x14')](function(_0x2a0ae7){logger[_0x851e('0x11')](_0x851e('0xe'),_0x51e4ab,_0x2a0ae7);_0x4b4639(_0x2a0ae7);});});} \ No newline at end of file +var _0xed4e=['request','then','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x56bc4b,_0xa6cfb7){var _0x3cf391=function(_0x5a4100){while(--_0x5a4100){_0x56bc4b['push'](_0x56bc4b['shift']());}};_0x3cf391(++_0xa6cfb7);}(_0xed4e,0x14e));var _0xeed4=function(_0xc938d9,_0x262feb){_0xc938d9=_0xc938d9-0x0;var _0x305be4=_0xed4e[_0xc938d9];return _0x305be4;};'use strict';var _=require(_0xeed4('0x0'));var util=require(_0xeed4('0x1'));var moment=require(_0xeed4('0x2'));var BPromise=require('bluebird');var rs=require(_0xeed4('0x3'));var fs=require('fs');var Redis=require(_0xeed4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeed4('0x5'));var logger=require('../../config/logger')(_0xeed4('0x6'));var config=require(_0xeed4('0x7'));var jayson=require(_0xeed4('0x8'));var client=jayson[_0xeed4('0x9')][_0xeed4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x292b9e,_0x489165,_0x4ab054){return new BPromise(function(_0x43cde7,_0x9dd102){return client[_0xeed4('0xb')](_0x292b9e,_0x4ab054)[_0xeed4('0xc')](function(_0x46fa2f){logger['info'](_0xeed4('0xd'),_0x489165,'request\x20sent');logger[_0xeed4('0xe')](_0xeed4('0xf'),_0x489165,_0xeed4('0x10'),JSON['stringify'](_0x46fa2f));if(_0x46fa2f[_0xeed4('0x11')]){if(_0x46fa2f['error'][_0xeed4('0x12')]===0x1f4){logger[_0xeed4('0x11')](_0xeed4('0xd'),_0x489165,_0x46fa2f[_0xeed4('0x11')][_0xeed4('0x13')]);return _0x9dd102(_0x46fa2f[_0xeed4('0x11')][_0xeed4('0x13')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x489165,_0x46fa2f[_0xeed4('0x11')][_0xeed4('0x13')]);return _0x43cde7(_0x46fa2f['error'][_0xeed4('0x13')]);}else{logger[_0xeed4('0x14')](_0xeed4('0xd'),_0x489165,_0xeed4('0x10'));_0x43cde7(_0x46fa2f[_0xeed4('0x15')][_0xeed4('0x13')]);}})[_0xeed4('0x16')](function(_0x136517){logger[_0xeed4('0x11')]('DeskField,\x20%s,\x20%s',_0x489165,_0x136517);_0x9dd102(_0x136517);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 929ed78..7107313 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 _0x603d=['/:id','show','/:id/configurations','/:id/fields','getFields','post','create','put','update','destroy','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x22efab,_0x5e1a4c){var _0x361bab=function(_0x3a16eb){while(--_0x3a16eb){_0x22efab['push'](_0x22efab['shift']());}};_0x361bab(++_0x5e1a4c);}(_0x603d,0x1f1));var _0xd603=function(_0xfb534f,_0x1ea5e7){_0xfb534f=_0xfb534f-0x0;var _0x3c42eb=_0x603d[_0xfb534f];return _0x3c42eb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd603('0x0'));var timeout=require(_0xd603('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd603('0x2'));var interaction=require(_0xd603('0x3'));var config=require(_0xd603('0x4'));var controller=require('./intDynamics365Account.controller');router[_0xd603('0x5')]('/',auth[_0xd603('0x6')](),controller['index']);router[_0xd603('0x5')](_0xd603('0x7'),auth[_0xd603('0x6')](),controller[_0xd603('0x8')]);router[_0xd603('0x5')](_0xd603('0x9'),auth[_0xd603('0x6')](),controller['getConfigurations']);router[_0xd603('0x5')](_0xd603('0xa'),auth[_0xd603('0x6')](),controller[_0xd603('0xb')]);router[_0xd603('0xc')]('/',auth[_0xd603('0x6')](),controller[_0xd603('0xd')]);router[_0xd603('0xc')]('/:id/configurations',auth[_0xd603('0x6')](),controller['addConfiguration']);router[_0xd603('0xe')]('/:id',auth[_0xd603('0x6')](),controller[_0xd603('0xf')]);router['delete']('/:id',auth[_0xd603('0x6')](),controller[_0xd603('0x10')]);module[_0xd603('0x11')]=router; \ No newline at end of file +var _0x4a41=['show','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id'];(function(_0x34571d,_0x178018){var _0x3578d2=function(_0x1c3733){while(--_0x1c3733){_0x34571d['push'](_0x34571d['shift']());}};_0x3578d2(++_0x178018);}(_0x4a41,0xa9));var _0x14a4=function(_0xc96ce9,_0x39dab2){_0xc96ce9=_0xc96ce9-0x0;var _0x4f8966=_0x4a41[_0xc96ce9];return _0x4f8966;};'use strict';var multer=require(_0x14a4('0x0'));var util=require(_0x14a4('0x1'));var path=require(_0x14a4('0x2'));var timeout=require('connect-timeout');var express=require(_0x14a4('0x3'));var router=express['Router']();var fs_extra=require(_0x14a4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x14a4('0x5'));var config=require(_0x14a4('0x6'));var controller=require(_0x14a4('0x7'));router[_0x14a4('0x8')]('/',auth[_0x14a4('0x9')](),controller['index']);router['get'](_0x14a4('0xa'),auth[_0x14a4('0x9')](),controller[_0x14a4('0xb')]);router[_0x14a4('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x14a4('0xc'),auth[_0x14a4('0x9')](),controller[_0x14a4('0xd')]);router[_0x14a4('0xe')]('/',auth[_0x14a4('0x9')](),controller[_0x14a4('0xf')]);router[_0x14a4('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x14a4('0x10')]);router['put'](_0x14a4('0xa'),auth[_0x14a4('0x9')](),controller[_0x14a4('0x11')]);router[_0x14a4('0x12')](_0x14a4('0xa'),auth[_0x14a4('0x9')](),controller[_0x14a4('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ed1f3ea..bb34690 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 _0xaeab=['BOOLEAN','sequelize','STRING'];(function(_0x5844c6,_0x35eab6){var _0x383ec2=function(_0x124def){while(--_0x124def){_0x5844c6['push'](_0x5844c6['shift']());}};_0x383ec2(++_0x35eab6);}(_0xaeab,0x91));var _0xbaea=function(_0x3d4360,_0x5ca504){_0x3d4360=_0x3d4360-0x0;var _0x2f1095=_0xaeab[_0x3d4360];return _0x2f1095;};'use strict';var Sequelize=require(_0xbaea('0x0'));module['exports']={'name':{'type':Sequelize[_0xbaea('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xbaea('0x1')]},'remoteUri':{'type':Sequelize[_0xbaea('0x1')]},'tenantId':{'type':Sequelize[_0xbaea('0x1')]},'clientId':{'type':Sequelize[_0xbaea('0x1')]},'clientSecret':{'type':Sequelize[_0xbaea('0x1')]},'serverUrl':{'type':Sequelize[_0xbaea('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xbaea('0x1')]},'modernAuthentication':{'type':Sequelize[_0xbaea('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xafca=['STRING','sequelize'];(function(_0x261bda,_0x5acf13){var _0x551dec=function(_0x32956d){while(--_0x32956d){_0x261bda['push'](_0x261bda['shift']());}};_0x551dec(++_0x5acf13);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xaafc('0x0'));module['exports']={'name':{'type':Sequelize[_0xaafc('0x1')]},'username':{'type':Sequelize[_0xaafc('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xaafc('0x1')]},'clientId':{'type':Sequelize[_0xaafc('0x1')]},'clientSecret':{'type':Sequelize[_0xaafc('0x1')]},'serverUrl':{'type':Sequelize[_0xaafc('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xaafc('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 62b14bf..341cb3a 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 _0xb92a=['json','offset','undefined','count','limit','status','set','update','then','destroy','end','sendStatus','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','fields','find','catch','create','body','params','getConfigurations','findOne','length','order','pick','addConfiguration','AccountId','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','slice','lastIndexOf','format','getFields','PhoneCall','description','customerid','subject','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','responseby','responsiblecontactidname','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','https://login.microsoftonline.com/','/oauth2/token','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','MetadataId','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','UserLocalizedLabel','Label','DisplayName','OptionSet','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration'];(function(_0x5831ec,_0x4fbe49){var _0x4877bf=function(_0x35a5ed){while(--_0x35a5ed){_0x5831ec['push'](_0x5831ec['shift']());}};_0x4877bf(++_0x4fbe49);}(_0xb92a,0xb0));var _0xab92=function(_0x45874c,_0x5dadc4){_0x45874c=_0x45874c-0x0;var _0x55dc8a=_0xb92a[_0x45874c];return _0x55dc8a;};'use strict';var rp=require(_0xab92('0x0'));var util=require(_0xab92('0x1'));var _=require(_0xab92('0x2'));var qs=require(_0xab92('0x3'));var logger=require(_0xab92('0x4'))(_0xab92('0x5'));var db=require(_0xab92('0x6'))['db'];var integrations=require(_0xab92('0x7'));function respondWithResult(_0x2fa1bc,_0x5e4eaf){_0x5e4eaf=_0x5e4eaf||0xc8;return function(_0x2c51db){if(_0x2c51db){return _0x2fa1bc['status'](_0x5e4eaf)[_0xab92('0x8')](_0x2c51db);}};}function respondWithFilteredResult(_0x2ddbd8,_0x38f011){return function(_0x54df9c){if(_0x54df9c){var _0x5f39cb=typeof _0x38f011[_0xab92('0x9')]===_0xab92('0xa')&&typeof _0x38f011['limit']===_0xab92('0xa');var _0xe21aa7=_0x54df9c['count'];var _0x471173=_0x5f39cb?0x0:_0x38f011[_0xab92('0x9')];var _0x1c582e=_0x5f39cb?_0x54df9c[_0xab92('0xb')]:_0x38f011[_0xab92('0x9')]+_0x38f011[_0xab92('0xc')];var _0x4dfadf;if(_0x1c582e>=_0xe21aa7){_0x1c582e=_0xe21aa7;_0x4dfadf=0xc8;}else{_0x4dfadf=0xce;}_0x2ddbd8[_0xab92('0xd')](_0x4dfadf);return _0x2ddbd8[_0xab92('0xe')]('Content-Range',_0x471173+'-'+_0x1c582e+'/'+_0xe21aa7)[_0xab92('0x8')](_0x54df9c);}return null;};}function saveUpdates(_0x5ad585){return function(_0x265844){if(_0x265844){return _0x265844[_0xab92('0xf')](_0x5ad585)[_0xab92('0x10')](function(_0x50d46f){return _0x50d46f;});}return null;};}function removeEntity(_0x5793d1){return function(_0x359287){if(_0x359287){return _0x359287[_0xab92('0x11')]()[_0xab92('0x10')](function(){_0x5793d1[_0xab92('0xd')](0xcc)[_0xab92('0x12')]();});}};}function handleEntityNotFound(_0x496d73){return function(_0x41cddf){if(!_0x41cddf){_0x496d73[_0xab92('0x13')](0x194);}return _0x41cddf;};}function handleError(_0xf0c44e,_0x39cac3){_0x39cac3=_0x39cac3||0x1f4;return function(_0xd1d4e9){logger[_0xab92('0x14')](_0xd1d4e9['stack']);if(_0xd1d4e9[_0xab92('0x15')]){delete _0xd1d4e9[_0xab92('0x15')];}_0xf0c44e[_0xab92('0xd')](_0x39cac3)[_0xab92('0x16')](_0xd1d4e9);};}exports[_0xab92('0x17')]=function(_0xc2e8d8,_0x275190){var _0x258397={},_0x4a2d17={},_0x43f249={'count':0x0,'rows':[]};var _0x4f6717=_[_0xab92('0x18')](db[_0xab92('0x19')][_0xab92('0x1a')],function(_0x5a3a7c){return{'name':_0x5a3a7c[_0xab92('0x1b')],'type':_0x5a3a7c[_0xab92('0x1c')][_0xab92('0x1d')]};});_0x4a2d17[_0xab92('0x1e')]=_[_0xab92('0x18')](_0x4f6717,_0xab92('0x15'));_0x4a2d17[_0xab92('0x1f')]=_[_0xab92('0x20')](_0xc2e8d8[_0xab92('0x1f')]);_0x4a2d17['filters']=_[_0xab92('0x21')](_0x4a2d17[_0xab92('0x1e')],_0x4a2d17[_0xab92('0x1f')]);_0x258397[_0xab92('0x22')]=_[_0xab92('0x21')](_0x4a2d17[_0xab92('0x1e')],qs['fields'](_0xc2e8d8[_0xab92('0x1f')]['fields']));_0x258397[_0xab92('0x22')]=_0x258397['attributes']['length']?_0x258397['attributes']:_0x4a2d17[_0xab92('0x1e')];if(!_0xc2e8d8[_0xab92('0x1f')][_0xab92('0x23')](_0xab92('0x24'))){_0x258397[_0xab92('0xc')]=qs[_0xab92('0xc')](_0xc2e8d8[_0xab92('0x1f')][_0xab92('0xc')]);_0x258397['offset']=qs[_0xab92('0x9')](_0xc2e8d8[_0xab92('0x1f')][_0xab92('0x9')]);}_0x258397['order']=qs[_0xab92('0x25')](_0xc2e8d8['query'][_0xab92('0x25')]);_0x258397[_0xab92('0x26')]=qs[_0xab92('0x27')](_['pick'](_0xc2e8d8[_0xab92('0x1f')],_0x4a2d17['filters']),_0x4f6717);if(_0xc2e8d8[_0xab92('0x1f')][_0xab92('0x28')]){_0x258397[_0xab92('0x26')]=_['merge'](_0x258397[_0xab92('0x26')],{'$or':_[_0xab92('0x18')](_0x4f6717,function(_0x153659){if(_0x153659['type']!==_0xab92('0x29')){var _0x51f84c={};_0x51f84c[_0x153659[_0xab92('0x15')]]={'$like':'%'+_0xc2e8d8[_0xab92('0x1f')]['filter']+'%'};return _0x51f84c;}})});}_0x258397=_[_0xab92('0x2a')]({},_0x258397,_0xc2e8d8[_0xab92('0x2b')]);var _0x48f386={'where':_0x258397['where']};return db[_0xab92('0x19')][_0xab92('0xb')](_0x48f386)['then'](function(_0x4aac97){_0x43f249['count']=_0x4aac97;if(_0xc2e8d8['query'][_0xab92('0x2c')]){_0x258397[_0xab92('0x2d')]=[{'all':!![]}];}return db[_0xab92('0x19')][_0xab92('0x2e')](_0x258397);})[_0xab92('0x10')](function(_0x3cfe2f){_0x43f249[_0xab92('0x2f')]=_0x3cfe2f;return _0x43f249;})[_0xab92('0x10')](respondWithFilteredResult(_0x275190,_0x258397))['catch'](handleError(_0x275190,null));};exports[_0xab92('0x30')]=function(_0x20dc97,_0x5c398c){var _0x3014c0={'raw':![],'where':{'id':_0x20dc97['params']['id']}},_0x4b1e35={};_0x4b1e35[_0xab92('0x1e')]=_[_0xab92('0x20')](db[_0xab92('0x19')][_0xab92('0x1a')]);_0x4b1e35[_0xab92('0x1f')]=_['keys'](_0x20dc97['query']);_0x4b1e35[_0xab92('0x27')]=_['intersection'](_0x4b1e35[_0xab92('0x1e')],_0x4b1e35[_0xab92('0x1f')]);_0x3014c0[_0xab92('0x22')]=_['intersection'](_0x4b1e35['model'],qs[_0xab92('0x31')](_0x20dc97[_0xab92('0x1f')][_0xab92('0x31')]));_0x3014c0[_0xab92('0x22')]=_0x3014c0['attributes']['length']?_0x3014c0[_0xab92('0x22')]:_0x4b1e35[_0xab92('0x1e')];if(_0x20dc97[_0xab92('0x1f')][_0xab92('0x2c')]){_0x3014c0[_0xab92('0x2d')]=[{'all':!![]}];}_0x3014c0=_[_0xab92('0x2a')]({},_0x3014c0,_0x20dc97[_0xab92('0x2b')]);return db[_0xab92('0x19')][_0xab92('0x32')](_0x3014c0)['then'](handleEntityNotFound(_0x5c398c,null))[_0xab92('0x10')](respondWithResult(_0x5c398c,null))[_0xab92('0x33')](handleError(_0x5c398c,null));};exports[_0xab92('0x34')]=function(_0x1060ed,_0x3b76bb){return db[_0xab92('0x19')]['create'](_0x1060ed[_0xab92('0x35')],{})[_0xab92('0x10')](respondWithResult(_0x3b76bb,0xc9))[_0xab92('0x33')](handleError(_0x3b76bb,null));};exports['update']=function(_0x1ce7a6,_0x185edf){if(_0x1ce7a6[_0xab92('0x35')]['id']){delete _0x1ce7a6[_0xab92('0x35')]['id'];}return db[_0xab92('0x19')][_0xab92('0x32')]({'where':{'id':_0x1ce7a6['params']['id']}})[_0xab92('0x10')](handleEntityNotFound(_0x185edf,null))['then'](saveUpdates(_0x1ce7a6['body'],null))[_0xab92('0x10')](respondWithResult(_0x185edf,null))['catch'](handleError(_0x185edf,null));};exports['destroy']=function(_0x529048,_0x9db60c){return db[_0xab92('0x19')][_0xab92('0x32')]({'where':{'id':_0x529048[_0xab92('0x36')]['id']}})[_0xab92('0x10')](handleEntityNotFound(_0x9db60c,null))['then'](removeEntity(_0x9db60c,null))[_0xab92('0x33')](handleError(_0x9db60c,null));};exports[_0xab92('0x37')]=function(_0x39534d,_0xc31431){var _0x21b31e={};var _0x3a40ee={};var _0x397fb4;var _0x1f7381;return db[_0xab92('0x19')][_0xab92('0x38')]({'where':{'id':_0x39534d[_0xab92('0x36')]['id']}})[_0xab92('0x10')](handleEntityNotFound(_0xc31431,null))[_0xab92('0x10')](function(_0x1fc3ce){if(_0x1fc3ce){_0x397fb4=_0x1fc3ce;_0x3a40ee['model']=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x3a40ee[_0xab92('0x1f')]=_[_0xab92('0x20')](_0x39534d[_0xab92('0x1f')]);_0x3a40ee[_0xab92('0x27')]=_[_0xab92('0x21')](_0x3a40ee[_0xab92('0x1e')],_0x3a40ee[_0xab92('0x1f')]);_0x21b31e[_0xab92('0x22')]=_['intersection'](_0x3a40ee[_0xab92('0x1e')],qs[_0xab92('0x31')](_0x39534d[_0xab92('0x1f')]['fields']));_0x21b31e[_0xab92('0x22')]=_0x21b31e[_0xab92('0x22')][_0xab92('0x39')]?_0x21b31e[_0xab92('0x22')]:_0x3a40ee['model'];_0x21b31e[_0xab92('0x3a')]=qs[_0xab92('0x25')](_0x39534d[_0xab92('0x1f')][_0xab92('0x25')]);_0x21b31e[_0xab92('0x26')]=qs[_0xab92('0x27')](_[_0xab92('0x3b')](_0x39534d[_0xab92('0x1f')],_0x3a40ee[_0xab92('0x27')]));if(_0x39534d[_0xab92('0x1f')][_0xab92('0x28')]){_0x21b31e[_0xab92('0x26')]=_[_0xab92('0x2a')](_0x21b31e[_0xab92('0x26')],{'$or':_['map'](_0x21b31e['attributes'],function(_0x570589){var _0x5657c6={};_0x5657c6[_0x570589]={'$like':'%'+_0x39534d[_0xab92('0x1f')][_0xab92('0x28')]+'%'};return _0x5657c6;})});}_0x21b31e=_[_0xab92('0x2a')]({},_0x21b31e,_0x39534d[_0xab92('0x2b')]);return _0x397fb4[_0xab92('0x37')](_0x21b31e);}})[_0xab92('0x10')](function(_0x11269f){if(_0x11269f){_0x1f7381=_0x11269f['length'];if(!_0x39534d['query']['hasOwnProperty']('nolimit')){_0x21b31e[_0xab92('0xc')]=qs['limit'](_0x39534d[_0xab92('0x1f')][_0xab92('0xc')]);_0x21b31e[_0xab92('0x9')]=qs[_0xab92('0x9')](_0x39534d[_0xab92('0x1f')][_0xab92('0x9')]);}return _0x397fb4[_0xab92('0x37')](_0x21b31e);}})[_0xab92('0x10')](function(_0x43ab91){if(_0x43ab91){return _0x43ab91?{'count':_0x1f7381,'rows':_0x43ab91}:null;}})[_0xab92('0x10')](respondWithResult(_0xc31431,null))['catch'](handleError(_0xc31431,null));};exports[_0xab92('0x3c')]=function(_0x4953de,_0x2bc5f7){if(_0x4953de[_0xab92('0x35')]['id']){delete _0x4953de['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x4953de['params']['id']}})[_0xab92('0x10')](handleEntityNotFound(_0x2bc5f7,null))['then'](function(_0x279170){if(_0x279170){_0x4953de['body'][_0xab92('0x3d')]=_0x279170['id'];_0x4953de['body']['Subjects']=integrations['getSubjects'](_0x4953de[_0xab92('0x35')][_0xab92('0x3e')],_0x4953de[_0xab92('0x35')][_0xab92('0x1c')]);_0x4953de['body'][_0xab92('0x3f')]=integrations[_0xab92('0x40')](_0x4953de['body'][_0xab92('0x3e')],_0x4953de[_0xab92('0x35')][_0xab92('0x1c')]);return db['Dynamics365Configuration']['create'](_0x4953de[_0xab92('0x35')],{'include':[{'model':db[_0xab92('0x41')],'as':_0xab92('0x42')},{'model':db[_0xab92('0x41')],'as':_0xab92('0x3f')}]});}return null;})[_0xab92('0x10')](respondWithResult(_0x2bc5f7,null))[_0xab92('0x33')](handleError(_0x2bc5f7,null));};function sanitizeRemoteUri(_0x2aa48e){var _0x59e844=_0x2aa48e[_0xab92('0x43')](-0x1);if(_0x59e844==='/')return _0x2aa48e['substring'](0x0,_0x2aa48e[_0xab92('0x44')](_0x59e844));return _0x2aa48e;}function getWebApiUrl(_0x3bfaf0){return util[_0xab92('0x45')]('%s/api/data/v9.0/',_0x3bfaf0);}exports[_0xab92('0x46')]=function(_0x2f2010,_0x399f61){var _0xd952a4=_0x2f2010[_0xab92('0x1f')]['ticketType'];var _0x26b092=_0xd952a4==='incident'?'Incident':_0xab92('0x47');var _0x563144='';var _0x17a11a='';var _0x15b3a9='';var _0x54a330='';var _0x871069='';var _0x3df18a='';var _0x581d62='';var _0x3e06d4='';var _0x54d4b5=['title',_0xab92('0x48'),_0xab92('0x49'),'ownerid','caseorigincode',_0xab92('0x4a'),'phonenumber',_0xab92('0x4b'),_0xab92('0x4c'),'phonecall_activity_parties'];var _0x3be0c6=[_0xab92('0x4d'),'accountidyominame',_0xab92('0x4e'),_0xab92('0x4f'),_0xab92('0x50'),_0xab92('0x51'),_0xab92('0x52'),'contractidname',_0xab92('0x53'),_0xab92('0x54'),_0xab92('0x55'),_0xab92('0x56'),_0xab92('0x57'),_0xab92('0x58'),'createdonbehalfbyyominame','customeridname',_0xab92('0x59'),'customeridyominame',_0xab92('0x5a'),_0xab92('0x5b'),_0xab92('0x5c'),'entityimage_url',_0xab92('0x5d'),_0xab92('0x5e'),_0xab92('0x5f'),'followupby',_0xab92('0x60'),'influencescore',_0xab92('0x61'),_0xab92('0x62'),_0xab92('0x63'),_0xab92('0x64'),'modifiedbyexternalpartyyominame',_0xab92('0x65'),_0xab92('0x66'),'modifiedon',_0xab92('0x67'),'modifiedonbehalfbyyominame',_0xab92('0x68'),'msdyn_iotalertname',_0xab92('0x69'),_0xab92('0x6a'),_0xab92('0x6b'),_0xab92('0x6c'),_0xab92('0x6d'),_0xab92('0x6e'),_0xab92('0x6f'),'primarycontactidname',_0xab92('0x70'),_0xab92('0x71'),_0xab92('0x72'),_0xab92('0x73'),'resolveby','resolvebykpiidname',_0xab92('0x74'),_0xab92('0x75'),'responsiblecontactidyominame','sentimentvalue',_0xab92('0x76'),'slaname',_0xab92('0x77'),_0xab92('0x78'),_0xab92('0x79'),_0xab92('0x7a'),_0xab92('0x7b'),_0xab92('0x7c'),_0xab92('0x7d'),_0xab92('0x7e'),'utcconversiontimezonecode',_0xab92('0x7f')];var _0x1b4c72=_0x54d4b5[_0xab92('0x80')](_0x3be0c6);return db[_0xab92('0x19')][_0xab92('0x38')]({'where':{'id':_0x2f2010[_0xab92('0x36')]['id']},'attributes':['id',_0xab92('0x81'),'password',_0xab92('0x82'),_0xab92('0x83'),_0xab92('0x84'),_0xab92('0x85'),_0xab92('0x86')],'include':[{'model':db[_0xab92('0x87')],'as':_0xab92('0x87'),'attributes':['id',_0xab92('0x88'),_0xab92('0x89')]}]})['then'](handleEntityNotFound(_0x399f61,null))[_0xab92('0x10')](function(_0x156ab2){if(_0x156ab2){if(_0x156ab2['modernAuthentication']){_0x156ab2[_0xab92('0x8a')]=_0x156ab2[_0xab92('0x87')][_0xab92('0x88')];_0x3e06d4=sanitizeRemoteUri(_0x156ab2[_0xab92('0x87')]['data7']);_0x581d62=getWebApiUrl(_0x3e06d4);return _0x156ab2;}_0x3e06d4=sanitizeRemoteUri(_0x156ab2[_0xab92('0x82')]);_0x581d62=getWebApiUrl(_0x3e06d4);var _0x2dedd9={'method':'POST','uri':_0xab92('0x8b')+_0x156ab2[_0xab92('0x83')]+_0xab92('0x8c'),'form':{'client_id':_0x156ab2[_0xab92('0x84')],'resource':_0x3e06d4,'username':_0x156ab2['username'],'password':_0x156ab2[_0xab92('0x8d')],'grant_type':_0xab92('0x8d'),'client_secret':_0x156ab2[_0xab92('0x85')]},'json':!![]};return rp(_0x2dedd9);}})['then'](function(_0x595e9c){_0x3df18a=_0x595e9c[_0xab92('0x8a')];var _0x38ccbe={'method':_0xab92('0x8e'),'uri':encodeURI(_0x581d62+_0xab92('0x8f')+_0x26b092+'\x27'),'headers':{'Authorization':_0xab92('0x90')+_0x3df18a,'If-None-Match':null,'OData-Version':_0xab92('0x91')},'json':!![]};return rp(_0x38ccbe);})['then'](function(_0x4e60bd){var _0x3e0453=_0x4e60bd[_0xab92('0x92')][0x0];var _0x177a5f=_0x3e0453['MetadataId'];var _0x57699c={'method':'GET','uri':_0x581d62+_0xab92('0x93')+_0x177a5f+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xab92('0x90')+_0x3df18a,'If-None-Match':null,'OData-Version':_0xab92('0x91')},'json':!![]};return rp(_0x57699c);})[_0xab92('0x10')](function(_0x37cad8){_0x563144=_0x37cad8;_0x17a11a=_0x563144[_0xab92('0x94')];_0x17a11a=_[_0xab92('0x95')](_0x17a11a,function(_0x3e8b85){return!_0x1b4c72[_0xab92('0x96')](_0x3e8b85[_0xab92('0x97')]);});var _0x4f1f25=[];var _0x2b7441=[];_0x17a11a[_0xab92('0x98')](function(_0x50c2bf){if(_0x50c2bf['@odata.type']){var _0x2a34a5=_0x50c2bf[_0xab92('0x99')][_0xab92('0x9a')](_0x50c2bf[_0xab92('0x99')][_0xab92('0x44')]('.')+0x1);if(_0x2a34a5===_0xab92('0x9b')){_0x4f1f25[_0xab92('0x9c')](getSelectList(_0x581d62,_0xd952a4,_0x2b7441,_0x563144[_0xab92('0x9d')],_0x50c2bf[_0xab92('0x9d')],_0x3df18a));}}});return Promise[_0xab92('0x9e')](_0x4f1f25);})['then'](function(_0x5e085a){_0x15b3a9=_0x5e085a[0x0];var _0x54e0b9=[];var _0x4d6a00=[];_0x17a11a[_0xab92('0x98')](function(_0x259596){if(!_[_0xab92('0x9f')](_0x259596[_0xab92('0x99')])){var _0x16140c=_0x259596[_0xab92('0x99')][_0xab92('0x9a')](_0x259596[_0xab92('0x99')]['lastIndexOf']('.')+0x1);if(_0x16140c==='BooleanAttributeMetadata'){_0x54e0b9[_0xab92('0x9c')](getBooleanList(_0x581d62,_0xd952a4,_0x4d6a00,_0x563144['MetadataId'],_0x259596[_0xab92('0x9d')],_0x3df18a));}}});return Promise[_0xab92('0x9e')](_0x54e0b9);})[_0xab92('0x10')](function(_0x3a6d87){_0x54a330=_0x3a6d87[0x0];var _0x27ba68=[];var _0x5331ab=[];_0x17a11a['forEach'](function(_0x3c3a98){if(_0x3c3a98[_0xab92('0x99')]){var _0x4a29fc=_0x3c3a98[_0xab92('0x99')][_0xab92('0x9a')](_0x3c3a98[_0xab92('0x99')][_0xab92('0x44')]('.')+0x1);if(_0x4a29fc===_0xab92('0xa0')||_0x4a29fc===_0xab92('0xa1')||_0x4a29fc===_0xab92('0xa2')||_0x4a29fc===_0xab92('0xa3')||_0x4a29fc===_0xab92('0xa4')||_0x4a29fc==='DateTimeAttributeMetadata'||_0x4a29fc==='StatusAttributeMetadata'||_0x4a29fc===_0xab92('0xa5')||_0x4a29fc===_0xab92('0xa6')||_0x4a29fc===_0xab92('0xa7')){_0x27ba68[_0xab92('0x9c')](getInputList(_0x581d62,_0xd952a4,_0x4a29fc,_0x5331ab,_0x563144[_0xab92('0x9d')],_0x3c3a98['MetadataId'],_0x3df18a));}}});return Promise[_0xab92('0x9e')](_0x27ba68);})['then'](function(_0x3bee3a){_0x871069=_0x3bee3a[0x0];var _0xd0fef8=_0x15b3a9[_0xab92('0x80')](_0x54a330)[_0xab92('0x80')](_0x871069);var _0x10fe83={'count':_0xd0fef8[_0xab92('0x39')],'rows':_0xd0fef8};return _0x10fe83;})[_0xab92('0x10')](respondWithResult(_0x399f61,null))['catch'](function(_0x5c2698){var _0x48279a=_0x2f2010[_0xab92('0x1f')][_0xab92('0xa8')]?0x1f4:_0x5c2698[_0xab92('0xa9')]||0x1f4;logger[_0xab92('0x14')](_0x5c2698[_0xab92('0xaa')]);delete _0x5c2698['name'];if(_0x48279a===0x191){_0x48279a=0x190;}_0x399f61[_0xab92('0xd')](_0x48279a)[_0xab92('0x16')](_0x2f2010['query'][_0xab92('0xa8')]?{'message':_0xab92('0xab'),'statusCode':_0x5c2698[_0xab92('0xa9')]}:_0x5c2698);});};function getSelectList(_0x4037f2,_0x4566ee,_0x1e8ebc,_0x464234,_0x57cc8d,_0x48e60d){var _0x513b3e={'method':_0xab92('0x8e'),'uri':_0x4037f2+_0xab92('0x93')+_0x464234+_0xab92('0xac')+_0x57cc8d+_0xab92('0xad')+_0xab92('0xae'),'headers':{'Authorization':_0xab92('0x90')+_0x48e60d,'If-None-Match':null,'OData-Version':_0xab92('0x91')},'json':!![]};return rp(_0x513b3e)[_0xab92('0x10')](function(_0x3f4604){var _0x59aaf7=[];var _0x2e5db8=_0x3f4604['OptionSet']['Options'];_0x2e5db8[_0xab92('0x98')](function(_0x71a2f0){_0x59aaf7[_0xab92('0x9c')]({'name':_0x71a2f0['Label'][_0xab92('0xaf')][_0xab92('0xb0')],'value':String(_0x71a2f0['Value'])});});var _0x12443e={'id':_0x4566ee+'_'+_0x3f4604[_0xab92('0x97')],'name':_0x3f4604[_0xab92('0xb1')]['UserLocalizedLabel'][_0xab92('0xb0')],'custom':![],'options':_0x59aaf7};_0x1e8ebc[_0xab92('0x9c')](_0x12443e);return _0x1e8ebc;});}function getBooleanList(_0x508630,_0x372565,_0x5d2db6,_0x1e505f,_0x187b80,_0x373205){var _0x3ca398={'method':_0xab92('0x8e'),'uri':_0x508630+_0xab92('0x93')+_0x1e505f+_0xab92('0xac')+_0x187b80+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xab92('0x90')+_0x373205,'If-None-Match':null,'OData-Version':_0xab92('0x91')},'json':!![]};return rp(_0x3ca398)[_0xab92('0x10')](function(_0x2bc03f){var _0x87bea=[];_0x87bea[_0xab92('0x9c')]({'name':_0x2bc03f[_0xab92('0xb2')][_0xab92('0xb3')][_0xab92('0xb0')]['UserLocalizedLabel']['Label'],'value':_0xab92('0xb4')},{'name':_0x2bc03f[_0xab92('0xb2')][_0xab92('0xb5')][_0xab92('0xb0')]['UserLocalizedLabel'][_0xab92('0xb0')],'value':'false'});var _0x4afebb={'id':_0x372565+'_'+_0x2bc03f[_0xab92('0x97')],'name':_0x2bc03f[_0xab92('0xb1')]['UserLocalizedLabel'][_0xab92('0xb0')],'custom':![],'options':_0x87bea};_0x5d2db6[_0xab92('0x9c')](_0x4afebb);return _0x5d2db6;});}function getInputList(_0x25942c,_0x17b399,_0x1c143c,_0x388482,_0x28877a,_0x72d8ea,_0x22ec85){var _0x44f31d={'method':_0xab92('0x8e'),'uri':_0x25942c+'EntityDefinitions('+_0x28877a+_0xab92('0xac')+_0x72d8ea+_0xab92('0xb6')+_0x1c143c+_0xab92('0xb7'),'headers':{'Authorization':_0xab92('0x90')+_0x22ec85,'If-None-Match':null,'OData-Version':_0xab92('0x91')},'json':!![]};return rp(_0x44f31d)[_0xab92('0x10')](function(_0x586a12){var _0x4ed1a={'id':_0x17b399+'_'+_0x586a12[_0xab92('0x97')],'name':_0x586a12[_0xab92('0xb1')][_0xab92('0xaf')]?_0x586a12[_0xab92('0xb1')][_0xab92('0xaf')][_0xab92('0xb0')]:_0x586a12[_0xab92('0x97')],'custom':![],'options':[]};_0x388482[_0xab92('0x9c')](_0x4ed1a);return _0x388482;});} \ No newline at end of file +var _0xf32e=['createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','username','password','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','https://login.microsoftonline.com/','tenantId','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','EntityDefinitions(','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','BooleanAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','error',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','4.0','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','offset','undefined','limit','count','status','set','Content-Range','json','update','then','destroy','end','sendStatus','stack','name','send','map','Dynamics365Account','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','merge','create','body','find','params','findOne','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname'];(function(_0x4c754e,_0x3134a5){var _0x522ed1=function(_0x515d4c){while(--_0x515d4c){_0x4c754e['push'](_0x4c754e['shift']());}};_0x522ed1(++_0x3134a5);}(_0xf32e,0x110));var _0xef32=function(_0x1ca7c4,_0x1436c8){_0x1ca7c4=_0x1ca7c4-0x0;var _0x5399c7=_0xf32e[_0x1ca7c4];return _0x5399c7;};'use strict';var rp=require(_0xef32('0x0'));var util=require(_0xef32('0x1'));var _=require(_0xef32('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x11b78e,_0x1bfa66){_0x1bfa66=_0x1bfa66||0xc8;return function(_0x4380d2){if(_0x4380d2){return _0x11b78e['status'](_0x1bfa66)['json'](_0x4380d2);}};}function respondWithFilteredResult(_0x57b683,_0x5aef88){return function(_0x2b6f2c){if(_0x2b6f2c){var _0x35ac44=typeof _0x5aef88[_0xef32('0x3')]===_0xef32('0x4')&&typeof _0x5aef88[_0xef32('0x5')]===_0xef32('0x4');var _0x5f208c=_0x2b6f2c['count'];var _0x58b5f3=_0x35ac44?0x0:_0x5aef88['offset'];var _0x4006a6=_0x35ac44?_0x2b6f2c[_0xef32('0x6')]:_0x5aef88['offset']+_0x5aef88[_0xef32('0x5')];var _0x19a0e1;if(_0x4006a6>=_0x5f208c){_0x4006a6=_0x5f208c;_0x19a0e1=0xc8;}else{_0x19a0e1=0xce;}_0x57b683[_0xef32('0x7')](_0x19a0e1);return _0x57b683[_0xef32('0x8')](_0xef32('0x9'),_0x58b5f3+'-'+_0x4006a6+'/'+_0x5f208c)[_0xef32('0xa')](_0x2b6f2c);}return null;};}function saveUpdates(_0x7f1d0c){return function(_0x26748d){if(_0x26748d){return _0x26748d[_0xef32('0xb')](_0x7f1d0c)[_0xef32('0xc')](function(_0x5757f5){return _0x5757f5;});}return null;};}function removeEntity(_0x43e91b){return function(_0x105fa2){if(_0x105fa2){return _0x105fa2[_0xef32('0xd')]()['then'](function(){_0x43e91b[_0xef32('0x7')](0xcc)[_0xef32('0xe')]();});}};}function handleEntityNotFound(_0x4f6409){return function(_0x10b493){if(!_0x10b493){_0x4f6409[_0xef32('0xf')](0x194);}return _0x10b493;};}function handleError(_0x5f2b94,_0x3bb0c0){_0x3bb0c0=_0x3bb0c0||0x1f4;return function(_0x126f7c){logger['error'](_0x126f7c[_0xef32('0x10')]);if(_0x126f7c['name']){delete _0x126f7c[_0xef32('0x11')];}_0x5f2b94['status'](_0x3bb0c0)[_0xef32('0x12')](_0x126f7c);};}exports['index']=function(_0x230930,_0x39b01e){var _0x1679a6={},_0x418ec6={},_0x2c34cb={'count':0x0,'rows':[]};var _0x5773c7=_[_0xef32('0x13')](db[_0xef32('0x14')][_0xef32('0x15')],function(_0x19820c){return{'name':_0x19820c['fieldName'],'type':_0x19820c[_0xef32('0x16')][_0xef32('0x17')]};});_0x418ec6['model']=_[_0xef32('0x13')](_0x5773c7,_0xef32('0x11'));_0x418ec6[_0xef32('0x18')]=_['keys'](_0x230930[_0xef32('0x18')]);_0x418ec6[_0xef32('0x19')]=_['intersection'](_0x418ec6[_0xef32('0x1a')],_0x418ec6[_0xef32('0x18')]);_0x1679a6[_0xef32('0x1b')]=_[_0xef32('0x1c')](_0x418ec6[_0xef32('0x1a')],qs[_0xef32('0x1d')](_0x230930[_0xef32('0x18')][_0xef32('0x1d')]));_0x1679a6[_0xef32('0x1b')]=_0x1679a6['attributes'][_0xef32('0x1e')]?_0x1679a6['attributes']:_0x418ec6[_0xef32('0x1a')];if(!_0x230930[_0xef32('0x18')]['hasOwnProperty'](_0xef32('0x1f'))){_0x1679a6['limit']=qs[_0xef32('0x5')](_0x230930[_0xef32('0x18')][_0xef32('0x5')]);_0x1679a6[_0xef32('0x3')]=qs[_0xef32('0x3')](_0x230930['query'][_0xef32('0x3')]);}_0x1679a6[_0xef32('0x20')]=qs[_0xef32('0x21')](_0x230930[_0xef32('0x18')][_0xef32('0x21')]);_0x1679a6['where']=qs[_0xef32('0x19')](_[_0xef32('0x22')](_0x230930[_0xef32('0x18')],_0x418ec6[_0xef32('0x19')]),_0x5773c7);if(_0x230930[_0xef32('0x18')][_0xef32('0x23')]){_0x1679a6[_0xef32('0x24')]=_['merge'](_0x1679a6['where'],{'$or':_['map'](_0x5773c7,function(_0x16c9d2){if(_0x16c9d2['type']!==_0xef32('0x25')){var _0x58fd61={};_0x58fd61[_0x16c9d2[_0xef32('0x11')]]={'$like':'%'+_0x230930[_0xef32('0x18')]['filter']+'%'};return _0x58fd61;}})});}_0x1679a6=_['merge']({},_0x1679a6,_0x230930[_0xef32('0x26')]);var _0x3bad21={'where':_0x1679a6[_0xef32('0x24')]};return db['Dynamics365Account'][_0xef32('0x6')](_0x3bad21)[_0xef32('0xc')](function(_0x286d15){_0x2c34cb['count']=_0x286d15;if(_0x230930[_0xef32('0x18')][_0xef32('0x27')]){_0x1679a6[_0xef32('0x28')]=[{'all':!![]}];}return db[_0xef32('0x14')][_0xef32('0x29')](_0x1679a6);})[_0xef32('0xc')](function(_0x3f8266){_0x2c34cb['rows']=_0x3f8266;return _0x2c34cb;})[_0xef32('0xc')](respondWithFilteredResult(_0x39b01e,_0x1679a6))[_0xef32('0x2a')](handleError(_0x39b01e,null));};exports[_0xef32('0x2b')]=function(_0x42f432,_0x41de14){var _0x1c4d95={'raw':![],'where':{'id':_0x42f432['params']['id']}},_0x235889={};_0x235889[_0xef32('0x1a')]=_[_0xef32('0x2c')](db[_0xef32('0x14')][_0xef32('0x15')]);_0x235889[_0xef32('0x18')]=_[_0xef32('0x2c')](_0x42f432['query']);_0x235889[_0xef32('0x19')]=_[_0xef32('0x1c')](_0x235889[_0xef32('0x1a')],_0x235889[_0xef32('0x18')]);_0x1c4d95['attributes']=_[_0xef32('0x1c')](_0x235889[_0xef32('0x1a')],qs[_0xef32('0x1d')](_0x42f432[_0xef32('0x18')][_0xef32('0x1d')]));_0x1c4d95[_0xef32('0x1b')]=_0x1c4d95['attributes'][_0xef32('0x1e')]?_0x1c4d95[_0xef32('0x1b')]:_0x235889[_0xef32('0x1a')];if(_0x42f432[_0xef32('0x18')][_0xef32('0x27')]){_0x1c4d95[_0xef32('0x28')]=[{'all':!![]}];}_0x1c4d95=_[_0xef32('0x2d')]({},_0x1c4d95,_0x42f432[_0xef32('0x26')]);return db['Dynamics365Account']['find'](_0x1c4d95)[_0xef32('0xc')](handleEntityNotFound(_0x41de14,null))[_0xef32('0xc')](respondWithResult(_0x41de14,null))['catch'](handleError(_0x41de14,null));};exports[_0xef32('0x2e')]=function(_0x22d9cc,_0x4f6acf){return db['Dynamics365Account'][_0xef32('0x2e')](_0x22d9cc[_0xef32('0x2f')],{})['then'](respondWithResult(_0x4f6acf,0xc9))['catch'](handleError(_0x4f6acf,null));};exports[_0xef32('0xb')]=function(_0x35a9f1,_0x14b4a8){if(_0x35a9f1[_0xef32('0x2f')]['id']){delete _0x35a9f1['body']['id'];}return db[_0xef32('0x14')][_0xef32('0x30')]({'where':{'id':_0x35a9f1['params']['id']}})[_0xef32('0xc')](handleEntityNotFound(_0x14b4a8,null))[_0xef32('0xc')](saveUpdates(_0x35a9f1['body'],null))[_0xef32('0xc')](respondWithResult(_0x14b4a8,null))[_0xef32('0x2a')](handleError(_0x14b4a8,null));};exports['destroy']=function(_0x520480,_0x5cb1d6){return db['Dynamics365Account'][_0xef32('0x30')]({'where':{'id':_0x520480[_0xef32('0x31')]['id']}})[_0xef32('0xc')](handleEntityNotFound(_0x5cb1d6,null))[_0xef32('0xc')](removeEntity(_0x5cb1d6,null))[_0xef32('0x2a')](handleError(_0x5cb1d6,null));};exports['getConfigurations']=function(_0x3d32fa,_0xd6fdfc){var _0x1d1e17={};var _0x3f1703={};var _0xb11be1;var _0x24ed0f;return db[_0xef32('0x14')][_0xef32('0x32')]({'where':{'id':_0x3d32fa[_0xef32('0x31')]['id']}})[_0xef32('0xc')](handleEntityNotFound(_0xd6fdfc,null))[_0xef32('0xc')](function(_0x1bdf00){if(_0x1bdf00){_0xb11be1=_0x1bdf00;_0x3f1703[_0xef32('0x1a')]=_[_0xef32('0x2c')](db['Dynamics365Configuration'][_0xef32('0x15')]);_0x3f1703[_0xef32('0x18')]=_[_0xef32('0x2c')](_0x3d32fa[_0xef32('0x18')]);_0x3f1703['filters']=_['intersection'](_0x3f1703[_0xef32('0x1a')],_0x3f1703[_0xef32('0x18')]);_0x1d1e17[_0xef32('0x1b')]=_[_0xef32('0x1c')](_0x3f1703[_0xef32('0x1a')],qs[_0xef32('0x1d')](_0x3d32fa['query'][_0xef32('0x1d')]));_0x1d1e17[_0xef32('0x1b')]=_0x1d1e17['attributes'][_0xef32('0x1e')]?_0x1d1e17[_0xef32('0x1b')]:_0x3f1703[_0xef32('0x1a')];_0x1d1e17['order']=qs[_0xef32('0x21')](_0x3d32fa['query'][_0xef32('0x21')]);_0x1d1e17[_0xef32('0x24')]=qs[_0xef32('0x19')](_[_0xef32('0x22')](_0x3d32fa['query'],_0x3f1703[_0xef32('0x19')]));if(_0x3d32fa['query']['filter']){_0x1d1e17[_0xef32('0x24')]=_['merge'](_0x1d1e17[_0xef32('0x24')],{'$or':_[_0xef32('0x13')](_0x1d1e17['attributes'],function(_0x4c7cd0){var _0x5af5d8={};_0x5af5d8[_0x4c7cd0]={'$like':'%'+_0x3d32fa[_0xef32('0x18')][_0xef32('0x23')]+'%'};return _0x5af5d8;})});}_0x1d1e17=_[_0xef32('0x2d')]({},_0x1d1e17,_0x3d32fa[_0xef32('0x26')]);return _0xb11be1[_0xef32('0x33')](_0x1d1e17);}})[_0xef32('0xc')](function(_0x2ac950){if(_0x2ac950){_0x24ed0f=_0x2ac950[_0xef32('0x1e')];if(!_0x3d32fa['query'][_0xef32('0x34')](_0xef32('0x1f'))){_0x1d1e17[_0xef32('0x5')]=qs['limit'](_0x3d32fa['query'][_0xef32('0x5')]);_0x1d1e17[_0xef32('0x3')]=qs['offset'](_0x3d32fa['query']['offset']);}return _0xb11be1['getConfigurations'](_0x1d1e17);}})[_0xef32('0xc')](function(_0x574878){if(_0x574878){return _0x574878?{'count':_0x24ed0f,'rows':_0x574878}:null;}})['then'](respondWithResult(_0xd6fdfc,null))['catch'](handleError(_0xd6fdfc,null));};exports['addConfiguration']=function(_0x54f0ef,_0x5e2468){if(_0x54f0ef['body']['id']){delete _0x54f0ef[_0xef32('0x2f')]['id'];}return db[_0xef32('0x14')][_0xef32('0x32')]({'where':{'id':_0x54f0ef[_0xef32('0x31')]['id']}})['then'](handleEntityNotFound(_0x5e2468,null))[_0xef32('0xc')](function(_0xacd6d8){if(_0xacd6d8){_0x54f0ef['body'][_0xef32('0x35')]=_0xacd6d8['id'];_0x54f0ef[_0xef32('0x2f')][_0xef32('0x36')]=integrations[_0xef32('0x37')](_0x54f0ef[_0xef32('0x2f')][_0xef32('0x38')],_0x54f0ef[_0xef32('0x2f')][_0xef32('0x16')]);_0x54f0ef[_0xef32('0x2f')][_0xef32('0x39')]=integrations[_0xef32('0x3a')](_0x54f0ef[_0xef32('0x2f')][_0xef32('0x38')],_0x54f0ef[_0xef32('0x2f')][_0xef32('0x16')]);return db[_0xef32('0x3b')]['create'](_0x54f0ef['body'],{'include':[{'model':db[_0xef32('0x3c')],'as':_0xef32('0x36')},{'model':db['Dynamics365Field'],'as':_0xef32('0x39')}]});}return null;})[_0xef32('0xc')](respondWithResult(_0x5e2468,null))[_0xef32('0x2a')](handleError(_0x5e2468,null));};function sanitizeRemoteUri(_0x18c72f){var _0x59c31d=_0x18c72f[_0xef32('0x3d')](-0x1);if(_0x59c31d==='/')return _0x18c72f[_0xef32('0x3e')](0x0,_0x18c72f[_0xef32('0x3f')](_0x59c31d));return _0x18c72f;}function getWebApiUrl(_0x5cad66){return util[_0xef32('0x40')](_0xef32('0x41'),_0x5cad66);}exports['getFields']=function(_0x2dd702,_0x2eaa0c){var _0x16431c=_0x2dd702['query'][_0xef32('0x42')];var _0x2a65bf=_0x16431c===_0xef32('0x43')?'Incident':'PhoneCall';var _0x4a0e90='';var _0x4f294c='';var _0x4931c3='';var _0x3a08f9='';var _0x2efb80='';var _0x1ac79d='';var _0x14dea5='';var _0x258817='';var _0x11621d=[_0xef32('0x44'),'description',_0xef32('0x45'),_0xef32('0x46'),_0xef32('0x47'),_0xef32('0x48'),_0xef32('0x49'),_0xef32('0x4a'),_0xef32('0x4b'),_0xef32('0x4c')];var _0x47dc01=['accountidname','accountidyominame',_0xef32('0x4d'),'billedserviceunits',_0xef32('0x4e'),_0xef32('0x4f'),_0xef32('0x50'),_0xef32('0x51'),_0xef32('0x52'),_0xef32('0x53'),_0xef32('0x54'),_0xef32('0x55'),_0xef32('0x56'),_0xef32('0x57'),_0xef32('0x58'),_0xef32('0x59'),_0xef32('0x5a'),_0xef32('0x5b'),'emailaddress',_0xef32('0x5c'),_0xef32('0x5d'),_0xef32('0x5e'),'escalatedon','exchangerate',_0xef32('0x5f'),_0xef32('0x60'),_0xef32('0x61'),'influencescore',_0xef32('0x62'),_0xef32('0x63'),_0xef32('0x64'),_0xef32('0x65'),_0xef32('0x66'),_0xef32('0x67'),'modifiedbyyominame',_0xef32('0x68'),_0xef32('0x69'),'modifiedonbehalfbyyominame',_0xef32('0x6a'),'msdyn_iotalertname',_0xef32('0x6b'),_0xef32('0x6c'),_0xef32('0x6d'),'owneridname',_0xef32('0x6e'),'owneridyominame','parentcaseidname',_0xef32('0x6f'),_0xef32('0x70'),_0xef32('0x71'),_0xef32('0x72'),'productserialnumber',_0xef32('0x73'),_0xef32('0x74'),'responseby',_0xef32('0x75'),_0xef32('0x76'),_0xef32('0x77'),'slainvokedidname',_0xef32('0x78'),_0xef32('0x79'),'statecode',_0xef32('0x7a'),_0xef32('0x7b'),_0xef32('0x7c'),_0xef32('0x7d'),_0xef32('0x7e'),_0xef32('0x7f'),'utcconversiontimezonecode',_0xef32('0x80')];var _0x244ca=_0x11621d['concat'](_0x47dc01);return db[_0xef32('0x14')]['findOne']({'where':{'id':_0x2dd702[_0xef32('0x31')]['id']},'attributes':['id',_0xef32('0x81'),_0xef32('0x82'),'remoteUri','tenantId',_0xef32('0x83'),_0xef32('0x84'),_0xef32('0x85')],'include':[{'model':db['CloudProvider'],'as':_0xef32('0x86'),'attributes':['id',_0xef32('0x87'),_0xef32('0x88')]}]})[_0xef32('0xc')](handleEntityNotFound(_0x2eaa0c,null))[_0xef32('0xc')](function(_0x2acd20){if(_0x2acd20){if(_0x2acd20[_0xef32('0x85')]){_0x2acd20['access_token']=_0x2acd20['CloudProvider'][_0xef32('0x87')];_0x258817=sanitizeRemoteUri(_0x2acd20[_0xef32('0x86')][_0xef32('0x88')]);_0x14dea5=getWebApiUrl(_0x258817);return _0x2acd20;}_0x258817=sanitizeRemoteUri(_0x2acd20['remoteUri']);_0x14dea5=getWebApiUrl(_0x258817);var _0x5d279c={'method':'POST','uri':_0xef32('0x89')+_0x2acd20[_0xef32('0x8a')]+_0xef32('0x8b'),'form':{'client_id':_0x2acd20[_0xef32('0x83')],'resource':_0x258817,'username':_0x2acd20['username'],'password':_0x2acd20[_0xef32('0x82')],'grant_type':_0xef32('0x82'),'client_secret':_0x2acd20[_0xef32('0x84')]},'json':!![]};return rp(_0x5d279c);}})[_0xef32('0xc')](function(_0x599d18){_0x1ac79d=_0x599d18['access_token'];var _0x34c33f={'method':_0xef32('0x8c'),'uri':encodeURI(_0x14dea5+_0xef32('0x8d')+_0x2a65bf+'\x27'),'headers':{'Authorization':_0xef32('0x8e')+_0x1ac79d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x34c33f);})[_0xef32('0xc')](function(_0x4aeddb){var _0x2e48a3=_0x4aeddb['value'][0x0];var _0x491ebd=_0x2e48a3['MetadataId'];var _0x5c3594={'method':_0xef32('0x8c'),'uri':_0x14dea5+_0xef32('0x8f')+_0x491ebd+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xef32('0x8e')+_0x1ac79d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5c3594);})[_0xef32('0xc')](function(_0x2cc3ab){_0x4a0e90=_0x2cc3ab;_0x4f294c=_0x4a0e90['Attributes'];_0x4f294c=_[_0xef32('0x90')](_0x4f294c,function(_0x114464){return!_0x244ca['includes'](_0x114464[_0xef32('0x91')]);});var _0x180fc8=[];var _0x536029=[];_0x4f294c[_0xef32('0x92')](function(_0x304ef1){if(_0x304ef1[_0xef32('0x93')]){var _0xa75857=_0x304ef1['@odata.type'][_0xef32('0x3e')](_0x304ef1[_0xef32('0x93')][_0xef32('0x3f')]('.')+0x1);if(_0xa75857===_0xef32('0x94')){_0x180fc8[_0xef32('0x95')](getSelectList(_0x14dea5,_0x16431c,_0x536029,_0x4a0e90[_0xef32('0x96')],_0x304ef1[_0xef32('0x96')],_0x1ac79d));}}});return Promise[_0xef32('0x97')](_0x180fc8);})[_0xef32('0xc')](function(_0x3c80ac){_0x4931c3=_0x3c80ac[0x0];var _0x409c37=[];var _0x4351b2=[];_0x4f294c[_0xef32('0x92')](function(_0x37bcd8){if(!_['isNil'](_0x37bcd8[_0xef32('0x93')])){var _0x353346=_0x37bcd8['@odata.type'][_0xef32('0x3e')](_0x37bcd8[_0xef32('0x93')][_0xef32('0x3f')]('.')+0x1);if(_0x353346===_0xef32('0x98')){_0x409c37['push'](getBooleanList(_0x14dea5,_0x16431c,_0x4351b2,_0x4a0e90[_0xef32('0x96')],_0x37bcd8[_0xef32('0x96')],_0x1ac79d));}}});return Promise[_0xef32('0x97')](_0x409c37);})[_0xef32('0xc')](function(_0x40aa8a){_0x3a08f9=_0x40aa8a[0x0];var _0x1eb4e2=[];var _0x2f688e=[];_0x4f294c['forEach'](function(_0x16f3d0){if(_0x16f3d0[_0xef32('0x93')]){var _0x3a765f=_0x16f3d0[_0xef32('0x93')][_0xef32('0x3e')](_0x16f3d0[_0xef32('0x93')]['lastIndexOf']('.')+0x1);if(_0x3a765f==='StringAttributeMetadata'||_0x3a765f==='DoubleAttributeMetadata'||_0x3a765f===_0xef32('0x99')||_0x3a765f===_0xef32('0x9a')||_0x3a765f==='MemoAttributeMetadata'||_0x3a765f==='DateTimeAttributeMetadata'||_0x3a765f===_0xef32('0x9b')||_0x3a765f===_0xef32('0x9c')||_0x3a765f===_0xef32('0x9d')||_0x3a765f===_0xef32('0x9e')){_0x1eb4e2[_0xef32('0x95')](getInputList(_0x14dea5,_0x16431c,_0x3a765f,_0x2f688e,_0x4a0e90['MetadataId'],_0x16f3d0[_0xef32('0x96')],_0x1ac79d));}}});return Promise[_0xef32('0x97')](_0x1eb4e2);})[_0xef32('0xc')](function(_0x349f63){_0x2efb80=_0x349f63[0x0];var _0x342d16=_0x4931c3[_0xef32('0x9f')](_0x3a08f9)[_0xef32('0x9f')](_0x2efb80);var _0x4d6e77={'count':_0x342d16[_0xef32('0x1e')],'rows':_0x342d16};return _0x4d6e77;})[_0xef32('0xc')](respondWithResult(_0x2eaa0c,null))[_0xef32('0x2a')](function(_0x1e9e5e){var _0x3ea415=_0x2dd702[_0xef32('0x18')][_0xef32('0xa0')]?0x1f4:_0x1e9e5e[_0xef32('0xa1')]||0x1f4;logger[_0xef32('0xa2')](_0x1e9e5e[_0xef32('0x10')]);delete _0x1e9e5e[_0xef32('0x11')];if(_0x3ea415===0x191){_0x3ea415=0x190;}_0x2eaa0c[_0xef32('0x7')](_0x3ea415)[_0xef32('0x12')](_0x2dd702[_0xef32('0x18')][_0xef32('0xa0')]?{'message':'Wrong\x20credentials','statusCode':_0x1e9e5e[_0xef32('0xa1')]}:_0x1e9e5e);});};function getSelectList(_0x344304,_0x2abd7a,_0xce622,_0x25e16a,_0x34b39a,_0x4989ce){var _0x4364d9={'method':_0xef32('0x8c'),'uri':_0x344304+_0xef32('0x8f')+_0x25e16a+_0xef32('0xa3')+_0x34b39a+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xef32('0xa4'),'headers':{'Authorization':_0xef32('0x8e')+_0x4989ce,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4364d9)[_0xef32('0xc')](function(_0x6acf9f){var _0x5817d5=[];var _0xf9c401=_0x6acf9f[_0xef32('0xa5')][_0xef32('0xa6')];_0xf9c401['forEach'](function(_0x11df3b){_0x5817d5['push']({'name':_0x11df3b[_0xef32('0xa7')][_0xef32('0xa8')][_0xef32('0xa7')],'value':String(_0x11df3b[_0xef32('0xa9')])});});var _0x33f984={'id':_0x2abd7a+'_'+_0x6acf9f[_0xef32('0x91')],'name':_0x6acf9f[_0xef32('0xaa')][_0xef32('0xa8')]['Label'],'custom':![],'options':_0x5817d5};_0xce622[_0xef32('0x95')](_0x33f984);return _0xce622;});}function getBooleanList(_0x29ee54,_0x50422f,_0x36004a,_0x48de9b,_0x5979a4,_0x28918b){var _0x5e11c8={'method':'GET','uri':_0x29ee54+'EntityDefinitions('+_0x48de9b+_0xef32('0xa3')+_0x5979a4+_0xef32('0xab'),'headers':{'Authorization':_0xef32('0x8e')+_0x28918b,'If-None-Match':null,'OData-Version':_0xef32('0xac')},'json':!![]};return rp(_0x5e11c8)[_0xef32('0xc')](function(_0x3febc9){var _0x1dfdd9=[];_0x1dfdd9[_0xef32('0x95')]({'name':_0x3febc9[_0xef32('0xa5')][_0xef32('0xad')][_0xef32('0xa7')][_0xef32('0xa8')][_0xef32('0xa7')],'value':_0xef32('0xae')},{'name':_0x3febc9[_0xef32('0xa5')]['FalseOption']['Label'][_0xef32('0xa8')]['Label'],'value':_0xef32('0xaf')});var _0x199547={'id':_0x50422f+'_'+_0x3febc9[_0xef32('0x91')],'name':_0x3febc9[_0xef32('0xaa')][_0xef32('0xa8')][_0xef32('0xa7')],'custom':![],'options':_0x1dfdd9};_0x36004a[_0xef32('0x95')](_0x199547);return _0x36004a;});}function getInputList(_0x21062e,_0x21e294,_0x5dcc99,_0x2d6205,_0x283254,_0x49b618,_0x13b073){var _0x59cee6={'method':_0xef32('0x8c'),'uri':_0x21062e+'EntityDefinitions('+_0x283254+_0xef32('0xa3')+_0x49b618+_0xef32('0xb0')+_0x5dcc99+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xef32('0x8e')+_0x13b073,'If-None-Match':null,'OData-Version':_0xef32('0xac')},'json':!![]};return rp(_0x59cee6)[_0xef32('0xc')](function(_0x3789fb){var _0x4b9ba6={'id':_0x21e294+'_'+_0x3789fb[_0xef32('0x91')],'name':_0x3789fb[_0xef32('0xaa')]['UserLocalizedLabel']?_0x3789fb[_0xef32('0xaa')][_0xef32('0xa8')][_0xef32('0xa7')]:_0x3789fb['LogicalName'],'custom':![],'options':[]};_0x2d6205[_0xef32('0x95')](_0x4b9ba6);return _0x2d6205;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 514f55f..51d5d0a 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x58e5f5,_0x32faca){var _0x531a9d=function(_0x57abe0){while(--_0x57abe0){_0x58e5f5['push'](_0x58e5f5['shift']());}};_0x531a9d(++_0x32faca);}(_0x757a,0xde));var _0xa757=function(_0x23216b,_0x2aace4){_0x23216b=_0x23216b-0x0;var _0x1b6dfc=_0x757a[_0x23216b];return _0x1b6dfc;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x44540b,_0x1f62a2){var _0x2f301f=function(_0x4504ae){while(--_0x4504ae){_0x44540b['push'](_0x44540b['shift']());}};_0x2f301f(++_0x1f62a2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 68158ab..7f8c04d 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 _0x6cff=['raw','attributes','limit','include','map','model','stringify','ShowDynamics365Account','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','GetDynamics365Account','Dynamics365Account','findAll','options'];(function(_0x2cb6b8,_0x34e015){var _0x5712d0=function(_0x44d53e){while(--_0x44d53e){_0x2cb6b8['push'](_0x2cb6b8['shift']());}};_0x5712d0(++_0x34e015);}(_0x6cff,0x6c));var _0xf6cf=function(_0x533381,_0x8a69fa){_0x533381=_0x533381-0x0;var _0x2877ed=_0x6cff[_0x533381];return _0x2877ed;};'use strict';var _=require(_0xf6cf('0x0'));var util=require('util');var moment=require(_0xf6cf('0x1'));var BPromise=require(_0xf6cf('0x2'));var rs=require(_0xf6cf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6cf('0x4'))['db'];var utils=require(_0xf6cf('0x5'));var logger=require(_0xf6cf('0x6'))(_0xf6cf('0x7'));var config=require('../../config/environment');var jayson=require(_0xf6cf('0x8'));var client=jayson[_0xf6cf('0x9')][_0xf6cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c912b,_0x3a99cd,_0x295308){return new BPromise(function(_0x305ede,_0x3a4382){return client['request'](_0x2c912b,_0x295308)[_0xf6cf('0xb')](function(_0x41cf56){logger['info'](_0xf6cf('0xc'),_0x3a99cd,'request\x20sent');logger[_0xf6cf('0xd')](_0xf6cf('0xe'),_0x3a99cd,_0xf6cf('0xf'),JSON['stringify'](_0x41cf56));if(_0x41cf56[_0xf6cf('0x10')]){if(_0x41cf56[_0xf6cf('0x10')]['code']===0x1f4){logger['error'](_0xf6cf('0xc'),_0x3a99cd,_0x41cf56[_0xf6cf('0x10')]['message']);return _0x3a4382(_0x41cf56[_0xf6cf('0x10')][_0xf6cf('0x11')]);}logger['error'](_0xf6cf('0xc'),_0x3a99cd,_0x41cf56[_0xf6cf('0x10')]['message']);return _0x305ede(_0x41cf56[_0xf6cf('0x10')][_0xf6cf('0x11')]);}else{logger[_0xf6cf('0x12')](_0xf6cf('0xc'),_0x3a99cd,_0xf6cf('0xf'));_0x305ede(_0x41cf56['result'][_0xf6cf('0x11')]);}})[_0xf6cf('0x13')](function(_0x93ea75){logger['error'](_0xf6cf('0xc'),_0x3a99cd,_0x93ea75);_0x3a4382(_0x93ea75);});});}exports[_0xf6cf('0x14')]=function(_0x51cf97){var _0x3fd7a3=this;return new Promise(function(_0x4a29c2,_0x389e88){return db[_0xf6cf('0x15')][_0xf6cf('0x16')]({'raw':_0x51cf97[_0xf6cf('0x17')]?_0x51cf97[_0xf6cf('0x17')][_0xf6cf('0x18')]===undefined?!![]:![]:!![],'where':_0x51cf97[_0xf6cf('0x17')]?_0x51cf97[_0xf6cf('0x17')]['where']||null:null,'attributes':_0x51cf97[_0xf6cf('0x17')]?_0x51cf97[_0xf6cf('0x17')][_0xf6cf('0x19')]||null:null,'limit':_0x51cf97[_0xf6cf('0x17')]?_0x51cf97['options'][_0xf6cf('0x1a')]||null:null,'include':_0x51cf97[_0xf6cf('0x17')]?_0x51cf97['options'][_0xf6cf('0x1b')]?_[_0xf6cf('0x1c')](_0x51cf97[_0xf6cf('0x17')][_0xf6cf('0x1b')],function(_0x496c26){return{'model':db[_0x496c26[_0xf6cf('0x1d')]],'as':_0x496c26['as'],'attributes':_0x496c26['attributes'],'include':_0x496c26[_0xf6cf('0x1b')]?_[_0xf6cf('0x1c')](_0x496c26[_0xf6cf('0x1b')],function(_0x58de5e){return{'model':db[_0x58de5e[_0xf6cf('0x1d')]],'as':_0x58de5e['as'],'attributes':_0x58de5e['attributes'],'include':_0x58de5e[_0xf6cf('0x1b')]?_[_0xf6cf('0x1c')](_0x58de5e[_0xf6cf('0x1b')],function(_0x54a6ea){return{'model':db[_0x54a6ea[_0xf6cf('0x1d')]],'as':_0x54a6ea['as'],'attributes':_0x54a6ea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x109726){logger[_0xf6cf('0x12')](_0xf6cf('0x14'),_0x51cf97);logger[_0xf6cf('0xd')]('GetDynamics365Account',_0x51cf97,JSON[_0xf6cf('0x1e')](_0x109726));_0x4a29c2(_0x109726);})['catch'](function(_0x3bd7cc){logger['error'](_0xf6cf('0x14'),_0x3bd7cc[_0xf6cf('0x11')],_0x51cf97);_0x389e88(_0x3fd7a3[_0xf6cf('0x10')](0x1f4,_0x3bd7cc[_0xf6cf('0x11')]));});});};exports[_0xf6cf('0x1f')]=function(_0x175e0d){var _0x55b8c6=this;return new Promise(function(_0x3d109d,_0x302d62){return db['Dynamics365Account'][_0xf6cf('0x20')]({'raw':_0x175e0d[_0xf6cf('0x17')]?_0x175e0d[_0xf6cf('0x17')][_0xf6cf('0x18')]===undefined?!![]:![]:!![],'where':_0x175e0d['options']?_0x175e0d[_0xf6cf('0x17')]['where']||null:null,'attributes':_0x175e0d[_0xf6cf('0x17')]?_0x175e0d[_0xf6cf('0x17')]['attributes']||null:null,'include':_0x175e0d[_0xf6cf('0x17')]?_0x175e0d['options'][_0xf6cf('0x1b')]?_[_0xf6cf('0x1c')](_0x175e0d[_0xf6cf('0x17')]['include'],function(_0x5c4534){return{'model':db[_0x5c4534[_0xf6cf('0x1d')]],'as':_0x5c4534['as'],'attributes':_0x5c4534[_0xf6cf('0x19')],'include':_0x5c4534[_0xf6cf('0x1b')]?_[_0xf6cf('0x1c')](_0x5c4534['include'],function(_0x3ee9f9){return{'model':db[_0x3ee9f9[_0xf6cf('0x1d')]],'as':_0x3ee9f9['as'],'attributes':_0x3ee9f9[_0xf6cf('0x19')],'include':_0x3ee9f9[_0xf6cf('0x1b')]?_[_0xf6cf('0x1c')](_0x3ee9f9[_0xf6cf('0x1b')],function(_0x6268d9){return{'model':db[_0x6268d9[_0xf6cf('0x1d')]],'as':_0x6268d9['as'],'attributes':_0x6268d9[_0xf6cf('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf6cf('0xb')](function(_0x57004f){logger[_0xf6cf('0x12')](_0xf6cf('0x1f'),_0x175e0d);logger['debug'](_0xf6cf('0x1f'),_0x175e0d,JSON[_0xf6cf('0x1e')](_0x57004f));_0x3d109d(_0x57004f);})['catch'](function(_0x3b4426){logger['error'](_0xf6cf('0x1f'),_0x3b4426[_0xf6cf('0x11')],_0x175e0d);_0x302d62(_0x55b8c6[_0xf6cf('0x10')](0x1f4,_0x3b4426[_0xf6cf('0x11')]));});});}; \ No newline at end of file +var _0x948d=['stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','attributes','map','ShowDynamics365Account','find','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x948d,0x1a0));var _0xd948=function(_0x34bfa7,_0x30b4af){_0x34bfa7=_0x34bfa7-0x0;var _0x1ffe3c=_0x948d[_0x34bfa7];return _0x1ffe3c;};'use strict';var _=require(_0xd948('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd948('0x1'));var rs=require(_0xd948('0x2'));var fs=require('fs');var Redis=require(_0xd948('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd948('0x4'));var logger=require(_0xd948('0x5'))('rpc');var config=require(_0xd948('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd948('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3c0b,_0x23f347,_0x2e5347){return new BPromise(function(_0x335de7,_0x2c4add){return client['request'](_0x5f3c0b,_0x2e5347)[_0xd948('0x8')](function(_0x2379e6){logger['info'](_0xd948('0x9'),_0x23f347,_0xd948('0xa'));logger[_0xd948('0xb')](_0xd948('0xc'),_0x23f347,_0xd948('0xa'),JSON[_0xd948('0xd')](_0x2379e6));if(_0x2379e6[_0xd948('0xe')]){if(_0x2379e6[_0xd948('0xe')][_0xd948('0xf')]===0x1f4){logger[_0xd948('0xe')](_0xd948('0x9'),_0x23f347,_0x2379e6[_0xd948('0xe')]['message']);return _0x2c4add(_0x2379e6[_0xd948('0xe')][_0xd948('0x10')]);}logger[_0xd948('0xe')](_0xd948('0x9'),_0x23f347,_0x2379e6[_0xd948('0xe')][_0xd948('0x10')]);return _0x335de7(_0x2379e6[_0xd948('0xe')]['message']);}else{logger[_0xd948('0x11')](_0xd948('0x9'),_0x23f347,_0xd948('0xa'));_0x335de7(_0x2379e6[_0xd948('0x12')][_0xd948('0x10')]);}})[_0xd948('0x13')](function(_0x26606e){logger[_0xd948('0xe')](_0xd948('0x9'),_0x23f347,_0x26606e);_0x2c4add(_0x26606e);});});}exports[_0xd948('0x14')]=function(_0x54ea54){var _0x26da5a=this;return new Promise(function(_0x4b1916,_0x2ba774){return db[_0xd948('0x15')][_0xd948('0x16')]({'raw':_0x54ea54[_0xd948('0x17')]?_0x54ea54[_0xd948('0x17')][_0xd948('0x18')]===undefined?!![]:![]:!![],'where':_0x54ea54['options']?_0x54ea54[_0xd948('0x17')][_0xd948('0x19')]||null:null,'attributes':_0x54ea54[_0xd948('0x17')]?_0x54ea54[_0xd948('0x17')]['attributes']||null:null,'limit':_0x54ea54[_0xd948('0x17')]?_0x54ea54[_0xd948('0x17')][_0xd948('0x1a')]||null:null,'include':_0x54ea54['options']?_0x54ea54[_0xd948('0x17')][_0xd948('0x1b')]?_['map'](_0x54ea54[_0xd948('0x17')][_0xd948('0x1b')],function(_0x13b240){return{'model':db[_0x13b240[_0xd948('0x1c')]],'as':_0x13b240['as'],'attributes':_0x13b240['attributes'],'include':_0x13b240[_0xd948('0x1b')]?_['map'](_0x13b240['include'],function(_0x48996a){return{'model':db[_0x48996a[_0xd948('0x1c')]],'as':_0x48996a['as'],'attributes':_0x48996a[_0xd948('0x1d')],'include':_0x48996a[_0xd948('0x1b')]?_[_0xd948('0x1e')](_0x48996a[_0xd948('0x1b')],function(_0x40732c){return{'model':db[_0x40732c['model']],'as':_0x40732c['as'],'attributes':_0x40732c[_0xd948('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd948('0x8')](function(_0x2107ba){logger[_0xd948('0x11')](_0xd948('0x14'),_0x54ea54);logger[_0xd948('0xb')]('GetDynamics365Account',_0x54ea54,JSON[_0xd948('0xd')](_0x2107ba));_0x4b1916(_0x2107ba);})[_0xd948('0x13')](function(_0x4beb58){logger[_0xd948('0xe')](_0xd948('0x14'),_0x4beb58[_0xd948('0x10')],_0x54ea54);_0x2ba774(_0x26da5a[_0xd948('0xe')](0x1f4,_0x4beb58[_0xd948('0x10')]));});});};exports[_0xd948('0x1f')]=function(_0x4376e3){var _0x328540=this;return new Promise(function(_0x467a8d,_0x289361){return db['Dynamics365Account'][_0xd948('0x20')]({'raw':_0x4376e3[_0xd948('0x17')]?_0x4376e3[_0xd948('0x17')][_0xd948('0x18')]===undefined?!![]:![]:!![],'where':_0x4376e3[_0xd948('0x17')]?_0x4376e3[_0xd948('0x17')][_0xd948('0x19')]||null:null,'attributes':_0x4376e3[_0xd948('0x17')]?_0x4376e3[_0xd948('0x17')][_0xd948('0x1d')]||null:null,'include':_0x4376e3['options']?_0x4376e3[_0xd948('0x17')][_0xd948('0x1b')]?_[_0xd948('0x1e')](_0x4376e3[_0xd948('0x17')][_0xd948('0x1b')],function(_0x4b0585){return{'model':db[_0x4b0585[_0xd948('0x1c')]],'as':_0x4b0585['as'],'attributes':_0x4b0585[_0xd948('0x1d')],'include':_0x4b0585[_0xd948('0x1b')]?_[_0xd948('0x1e')](_0x4b0585['include'],function(_0x4b65c9){return{'model':db[_0x4b65c9['model']],'as':_0x4b65c9['as'],'attributes':_0x4b65c9['attributes'],'include':_0x4b65c9[_0xd948('0x1b')]?_[_0xd948('0x1e')](_0x4b65c9[_0xd948('0x1b')],function(_0x41d92e){return{'model':db[_0x41d92e['model']],'as':_0x41d92e['as'],'attributes':_0x41d92e[_0xd948('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57f90c){logger[_0xd948('0x11')](_0xd948('0x1f'),_0x4376e3);logger[_0xd948('0xb')](_0xd948('0x1f'),_0x4376e3,JSON[_0xd948('0xd')](_0x57f90c));_0x467a8d(_0x57f90c);})[_0xd948('0x13')](function(_0x10e847){logger[_0xd948('0xe')](_0xd948('0x1f'),_0x10e847[_0xd948('0x10')],_0x4376e3);_0x289361(_0x328540[_0xd948('0xe')](0x1f4,_0x10e847[_0xd948('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index b04b6e1..1107dd7 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 _0x76da=['multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','/:id','update','delete','destroy','exports'];(function(_0x16a4ae,_0x2ee424){var _0x221e7e=function(_0x360acb){while(--_0x360acb){_0x16a4ae['push'](_0x16a4ae['shift']());}};_0x221e7e(++_0x2ee424);}(_0x76da,0x111));var _0xa76d=function(_0x1aa38f,_0x5f3923){_0x1aa38f=_0x1aa38f-0x0;var _0xccc7ee=_0x76da[_0x1aa38f];return _0xccc7ee;};'use strict';var multer=require(_0xa76d('0x0'));var util=require('util');var path=require(_0xa76d('0x1'));var timeout=require(_0xa76d('0x2'));var express=require('express');var router=express[_0xa76d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa76d('0x4'));var config=require(_0xa76d('0x5'));var controller=require(_0xa76d('0x6'));router['get']('/',auth[_0xa76d('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa76d('0x8')]);router[_0xa76d('0x9')](_0xa76d('0xa'),auth[_0xa76d('0x7')](),controller[_0xa76d('0xb')]);router[_0xa76d('0x9')](_0xa76d('0xc'),auth[_0xa76d('0x7')](),controller[_0xa76d('0xd')]);router[_0xa76d('0x9')]('/:id/descriptions',auth[_0xa76d('0x7')](),controller[_0xa76d('0xe')]);router[_0xa76d('0xf')]('/',auth[_0xa76d('0x7')](),controller['create']);router['put'](_0xa76d('0x10'),auth['isAuthenticated'](),controller[_0xa76d('0x11')]);router[_0xa76d('0x12')](_0xa76d('0x10'),auth[_0xa76d('0x7')](),controller[_0xa76d('0x13')]);module[_0xa76d('0x14')]=router; \ No newline at end of file +var _0xe499=['/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x13f2ec,_0x407206){var _0x389ca9=function(_0x43d7d6){while(--_0x43d7d6){_0x13f2ec['push'](_0x13f2ec['shift']());}};_0x389ca9(++_0x407206);}(_0xe499,0xfb));var _0x9e49=function(_0x548467,_0x5ef1f2){_0x548467=_0x548467-0x0;var _0x53c1b0=_0xe499[_0x548467];return _0x53c1b0;};'use strict';var multer=require(_0x9e49('0x0'));var util=require(_0x9e49('0x1'));var path=require(_0x9e49('0x2'));var timeout=require(_0x9e49('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9e49('0x4'));var auth=require(_0x9e49('0x5'));var interaction=require(_0x9e49('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x9e49('0x7')]('/',auth[_0x9e49('0x8')](),controller['index']);router[_0x9e49('0x7')](_0x9e49('0x9'),auth[_0x9e49('0x8')](),controller[_0x9e49('0xa')]);router[_0x9e49('0x7')](_0x9e49('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x9e49('0x7')](_0x9e49('0xc'),auth[_0x9e49('0x8')](),controller['getSubjects']);router[_0x9e49('0x7')](_0x9e49('0xd'),auth[_0x9e49('0x8')](),controller[_0x9e49('0xe')]);router['post']('/',auth[_0x9e49('0x8')](),controller[_0x9e49('0xf')]);router[_0x9e49('0x10')](_0x9e49('0x9'),auth['isAuthenticated'](),controller[_0x9e49('0x11')]);router[_0x9e49('0x12')](_0x9e49('0x9'),auth[_0x9e49('0x8')](),controller['destroy']);module[_0x9e49('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 6fbfeff..d0b7a6b 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 _0xfbc0=['contact','BOOLEAN','sequelize','exports','STRING','incident','phonecall','ENUM','nothing'];(function(_0x34be5f,_0x536460){var _0x5d1410=function(_0x128bf8){while(--_0x128bf8){_0x34be5f['push'](_0x34be5f['shift']());}};_0x5d1410(++_0x536460);}(_0xfbc0,0x14f));var _0x0fbc=function(_0x233e28,_0x36e064){_0x233e28=_0x233e28-0x0;var _0x50e055=_0xfbc0[_0x233e28];return _0x50e055;};'use strict';var Sequelize=require(_0x0fbc('0x0'));module[_0x0fbc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0fbc('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x0fbc('0x3'),_0x0fbc('0x4')),'defaultValue':_0x0fbc('0x3')},'moduleCreate':{'type':Sequelize[_0x0fbc('0x5')]('contact',_0x0fbc('0x6')),'defaultValue':_0x0fbc('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x0fbc('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x815b=['BOOLEAN','sequelize','exports','STRING','ENUM','incident','contact','nothing'];(function(_0x1d1c40,_0x3b25ab){var _0xb8daa0=function(_0xf848bd){while(--_0xf848bd){_0x1d1c40['push'](_0x1d1c40['shift']());}};_0xb8daa0(++_0x3b25ab);}(_0x815b,0x149));var _0xb815=function(_0x3e541a,_0x227dd2){_0x3e541a=_0x3e541a-0x0;var _0x318b95=_0x815b[_0x3e541a];return _0x318b95;};'use strict';var Sequelize=require(_0xb815('0x0'));module[_0xb815('0x1')]={'name':{'type':Sequelize[_0xb815('0x2')]},'description':{'type':Sequelize[_0xb815('0x2')]},'ticketType':{'type':Sequelize[_0xb815('0x3')](_0xb815('0x4'),'phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xb815('0x3')](_0xb815('0x5'),_0xb815('0x6')),'defaultValue':_0xb815('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb815('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xb815('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 5346834..6aa55d0 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 _0xbb5a=['includeAll','include','catch','show','rawAttributes','length','find','create','body','params','getFields','findOne','Dynamics365Field','order','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','Dynamics365Configuration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','sort','pick','filter','where','merge','options'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbb5a,0x10a));var _0xabb5=function(_0x4d37a3,_0x943275){_0x4d37a3=_0x4d37a3-0x0;var _0x2df294=_0xbb5a[_0x4d37a3];return _0x2df294;};'use strict';var emlformat=require(_0xabb5('0x0'));var rimraf=require(_0xabb5('0x1'));var zipdir=require(_0xabb5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabb5('0x3'));var moment=require(_0xabb5('0x4'));var BPromise=require(_0xabb5('0x5'));var Mustache=require(_0xabb5('0x6'));var util=require(_0xabb5('0x7'));var path=require(_0xabb5('0x8'));var sox=require(_0xabb5('0x9'));var csv=require(_0xabb5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabb5('0xb'));var _=require(_0xabb5('0xc'));var squel=require(_0xabb5('0xd'));var crypto=require(_0xabb5('0xe'));var jsforce=require(_0xabb5('0xf'));var deskjs=require(_0xabb5('0x10'));var toCsv=require(_0xabb5('0xa'));var querystring=require(_0xabb5('0x11'));var Papa=require(_0xabb5('0x12'));var Redis=require(_0xabb5('0x13'));var authService=require(_0xabb5('0x14'));var qs=require(_0xabb5('0x15'));var as=require(_0xabb5('0x16'));var hardwareService=require(_0xabb5('0x17'));var logger=require(_0xabb5('0x18'))('api');var utils=require(_0xabb5('0x19'));var config=require(_0xabb5('0x1a'));var licenseUtil=require(_0xabb5('0x1b'));var db=require(_0xabb5('0x1c'))['db'];function respondWithStatusCode(_0x37f5b8,_0x48332b){_0x48332b=_0x48332b||0xcc;return function(_0x5eca3d){if(_0x5eca3d){return _0x37f5b8[_0xabb5('0x1d')](_0x48332b);}return _0x37f5b8['status'](_0x48332b)[_0xabb5('0x1e')]();};}function respondWithResult(_0x317818,_0x6b2bb7){_0x6b2bb7=_0x6b2bb7||0xc8;return function(_0x53d748){if(_0x53d748){return _0x317818[_0xabb5('0x1f')](_0x6b2bb7)[_0xabb5('0x20')](_0x53d748);}};}function respondWithFilteredResult(_0x5a7b6e,_0x5b5ac7){return function(_0x16f552){if(_0x16f552){var _0x56d04b=typeof _0x5b5ac7['offset']===_0xabb5('0x21')&&typeof _0x5b5ac7['limit']==='undefined';var _0x49cf75=_0x16f552[_0xabb5('0x22')];var _0x34b7f6=_0x56d04b?0x0:_0x5b5ac7[_0xabb5('0x23')];var _0x57616d=_0x56d04b?_0x16f552[_0xabb5('0x22')]:_0x5b5ac7[_0xabb5('0x23')]+_0x5b5ac7['limit'];var _0x9d55c3;if(_0x57616d>=_0x49cf75){_0x57616d=_0x49cf75;_0x9d55c3=0xc8;}else{_0x9d55c3=0xce;}_0x5a7b6e[_0xabb5('0x1f')](_0x9d55c3);return _0x5a7b6e[_0xabb5('0x24')](_0xabb5('0x25'),_0x34b7f6+'-'+_0x57616d+'/'+_0x49cf75)[_0xabb5('0x20')](_0x16f552);}return null;};}function patchUpdates(_0x70fc9a){return function(_0x8966e){try{jsonpatch[_0xabb5('0x26')](_0x8966e,_0x70fc9a,!![]);}catch(_0x2131d3){return BPromise[_0xabb5('0x27')](_0x2131d3);}return _0x8966e[_0xabb5('0x28')]();};}function saveUpdates(_0x3f8b48,_0x4c13b6){return function(_0x307fe9){if(_0x307fe9){return _0x307fe9[_0xabb5('0x29')](_0x3f8b48)['then'](function(_0x336c44){return _0x336c44;});}return null;};}function removeEntity(_0x5c6a43,_0x276848){return function(_0x12c66c){if(_0x12c66c){return _0x12c66c['destroy']()[_0xabb5('0x2a')](function(){_0x5c6a43[_0xabb5('0x1f')](0xcc)[_0xabb5('0x1e')]();});}};}function handleEntityNotFound(_0x2cef5a,_0x41e261){return function(_0x39ca36){if(!_0x39ca36){_0x2cef5a[_0xabb5('0x1d')](0x194);}return _0x39ca36;};}function handleError(_0x4ce69d,_0x162bac){_0x162bac=_0x162bac||0x1f4;return function(_0x137391){logger['error'](_0x137391[_0xabb5('0x2b')]);if(_0x137391[_0xabb5('0x2c')]){delete _0x137391['name'];}_0x4ce69d[_0xabb5('0x1f')](_0x162bac)['send'](_0x137391);};}exports[_0xabb5('0x2d')]=function(_0xa26342,_0x5422af){var _0x42b9eb={},_0x33b6a0={},_0xb019ae={'count':0x0,'rows':[]};var _0x2e1ff6=_[_0xabb5('0x2e')](db[_0xabb5('0x2f')]['rawAttributes'],function(_0x5184ca){return{'name':_0x5184ca[_0xabb5('0x30')],'type':_0x5184ca[_0xabb5('0x31')][_0xabb5('0x32')]};});_0x33b6a0[_0xabb5('0x33')]=_[_0xabb5('0x2e')](_0x2e1ff6,_0xabb5('0x2c'));_0x33b6a0[_0xabb5('0x34')]=_[_0xabb5('0x35')](_0xa26342[_0xabb5('0x34')]);_0x33b6a0[_0xabb5('0x36')]=_['intersection'](_0x33b6a0[_0xabb5('0x33')],_0x33b6a0[_0xabb5('0x34')]);_0x42b9eb[_0xabb5('0x37')]=_[_0xabb5('0x38')](_0x33b6a0[_0xabb5('0x33')],qs[_0xabb5('0x39')](_0xa26342['query'][_0xabb5('0x39')]));_0x42b9eb[_0xabb5('0x37')]=_0x42b9eb[_0xabb5('0x37')]['length']?_0x42b9eb['attributes']:_0x33b6a0[_0xabb5('0x33')];if(!_0xa26342[_0xabb5('0x34')][_0xabb5('0x3a')]('nolimit')){_0x42b9eb[_0xabb5('0x3b')]=qs[_0xabb5('0x3b')](_0xa26342[_0xabb5('0x34')][_0xabb5('0x3b')]);_0x42b9eb[_0xabb5('0x23')]=qs[_0xabb5('0x23')](_0xa26342[_0xabb5('0x34')][_0xabb5('0x23')]);}_0x42b9eb['order']=qs[_0xabb5('0x3c')](_0xa26342[_0xabb5('0x34')]['sort']);_0x42b9eb['where']=qs[_0xabb5('0x36')](_[_0xabb5('0x3d')](_0xa26342[_0xabb5('0x34')],_0x33b6a0[_0xabb5('0x36')]),_0x2e1ff6);if(_0xa26342[_0xabb5('0x34')][_0xabb5('0x3e')]){_0x42b9eb[_0xabb5('0x3f')]=_['merge'](_0x42b9eb[_0xabb5('0x3f')],{'$or':_[_0xabb5('0x2e')](_0x2e1ff6,function(_0x3e335e){if(_0x3e335e[_0xabb5('0x31')]!=='VIRTUAL'){var _0x43cfea={};_0x43cfea[_0x3e335e[_0xabb5('0x2c')]]={'$like':'%'+_0xa26342[_0xabb5('0x34')][_0xabb5('0x3e')]+'%'};return _0x43cfea;}})});}_0x42b9eb=_[_0xabb5('0x40')]({},_0x42b9eb,_0xa26342[_0xabb5('0x41')]);var _0x4be4a1={'where':_0x42b9eb['where']};return db[_0xabb5('0x2f')][_0xabb5('0x22')](_0x4be4a1)[_0xabb5('0x2a')](function(_0x2137e0){_0xb019ae['count']=_0x2137e0;if(_0xa26342[_0xabb5('0x34')][_0xabb5('0x42')]){_0x42b9eb[_0xabb5('0x43')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x42b9eb);})[_0xabb5('0x2a')](function(_0x3e0dc3){_0xb019ae['rows']=_0x3e0dc3;return _0xb019ae;})[_0xabb5('0x2a')](respondWithFilteredResult(_0x5422af,_0x42b9eb))[_0xabb5('0x44')](handleError(_0x5422af,null));};exports[_0xabb5('0x45')]=function(_0x5d8be7,_0xab584c){var _0x418b25={'raw':![],'where':{'id':_0x5d8be7['params']['id']}},_0x2aed03={};_0x2aed03['model']=_[_0xabb5('0x35')](db[_0xabb5('0x2f')][_0xabb5('0x46')]);_0x2aed03[_0xabb5('0x34')]=_['keys'](_0x5d8be7[_0xabb5('0x34')]);_0x2aed03['filters']=_['intersection'](_0x2aed03[_0xabb5('0x33')],_0x2aed03[_0xabb5('0x34')]);_0x418b25['attributes']=_['intersection'](_0x2aed03[_0xabb5('0x33')],qs['fields'](_0x5d8be7[_0xabb5('0x34')][_0xabb5('0x39')]));_0x418b25['attributes']=_0x418b25[_0xabb5('0x37')][_0xabb5('0x47')]?_0x418b25['attributes']:_0x2aed03[_0xabb5('0x33')];if(_0x5d8be7['query'][_0xabb5('0x42')]){_0x418b25['include']=[{'all':!![]}];}_0x418b25=_[_0xabb5('0x40')]({},_0x418b25,_0x5d8be7['options']);return db['Dynamics365Configuration'][_0xabb5('0x48')](_0x418b25)[_0xabb5('0x2a')](handleEntityNotFound(_0xab584c,null))[_0xabb5('0x2a')](respondWithResult(_0xab584c,null))['catch'](handleError(_0xab584c,null));};exports['create']=function(_0x19d842,_0x513094){return db[_0xabb5('0x2f')][_0xabb5('0x49')](_0x19d842['body'],{})['then'](respondWithResult(_0x513094,0xc9))[_0xabb5('0x44')](handleError(_0x513094,null));};exports[_0xabb5('0x29')]=function(_0xadc0a7,_0xd4f387){if(_0xadc0a7[_0xabb5('0x4a')]['id']){delete _0xadc0a7[_0xabb5('0x4a')]['id'];}return db[_0xabb5('0x2f')][_0xabb5('0x48')]({'where':{'id':_0xadc0a7[_0xabb5('0x4b')]['id']}})['then'](handleEntityNotFound(_0xd4f387,null))['then'](saveUpdates(_0xadc0a7[_0xabb5('0x4a')],null))[_0xabb5('0x2a')](respondWithResult(_0xd4f387,null))[_0xabb5('0x44')](handleError(_0xd4f387,null));};exports['destroy']=function(_0x2a978a,_0x3a3eba){return db['Dynamics365Configuration'][_0xabb5('0x48')]({'where':{'id':_0x2a978a[_0xabb5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a3eba,null))[_0xabb5('0x2a')](removeEntity(_0x3a3eba,null))['catch'](handleError(_0x3a3eba,null));};exports[_0xabb5('0x4c')]=function(_0x10fe8d,_0x47291f,_0x41df94){var _0x2a01ef={};var _0x18f31e={};var _0x364453;var _0x313080;return db['Dynamics365Configuration'][_0xabb5('0x4d')]({'where':{'id':_0x10fe8d['params']['id']}})[_0xabb5('0x2a')](handleEntityNotFound(_0x47291f,null))['then'](function(_0x3a68bd){if(_0x3a68bd){_0x364453=_0x3a68bd;_0x18f31e[_0xabb5('0x33')]=_['keys'](db[_0xabb5('0x4e')][_0xabb5('0x46')]);_0x18f31e[_0xabb5('0x34')]=_[_0xabb5('0x35')](_0x10fe8d[_0xabb5('0x34')]);_0x18f31e['filters']=_[_0xabb5('0x38')](_0x18f31e['model'],_0x18f31e[_0xabb5('0x34')]);_0x2a01ef[_0xabb5('0x37')]=_[_0xabb5('0x38')](_0x18f31e[_0xabb5('0x33')],qs[_0xabb5('0x39')](_0x10fe8d[_0xabb5('0x34')][_0xabb5('0x39')]));_0x2a01ef[_0xabb5('0x37')]=_0x2a01ef[_0xabb5('0x37')][_0xabb5('0x47')]?_0x2a01ef[_0xabb5('0x37')]:_0x18f31e[_0xabb5('0x33')];_0x2a01ef[_0xabb5('0x4f')]=qs[_0xabb5('0x3c')](_0x10fe8d['query'][_0xabb5('0x3c')]);_0x2a01ef[_0xabb5('0x3f')]=qs['filters'](_[_0xabb5('0x3d')](_0x10fe8d[_0xabb5('0x34')],_0x18f31e[_0xabb5('0x36')]));if(_0x10fe8d['query'][_0xabb5('0x3e')]){_0x2a01ef[_0xabb5('0x3f')]=_[_0xabb5('0x40')](_0x2a01ef[_0xabb5('0x3f')],{'$or':_[_0xabb5('0x2e')](_0x2a01ef[_0xabb5('0x37')],function(_0x29dab5){var _0x87a3ea={};_0x87a3ea[_0x29dab5]={'$like':'%'+_0x10fe8d['query'][_0xabb5('0x3e')]+'%'};return _0x87a3ea;})});}_0x2a01ef=_[_0xabb5('0x40')]({},_0x2a01ef,_0x10fe8d['options']);return _0x364453[_0xabb5('0x4c')](_0x2a01ef);}})[_0xabb5('0x2a')](function(_0x14f64f){if(_0x14f64f){_0x313080=_0x14f64f[_0xabb5('0x47')];if(!_0x10fe8d[_0xabb5('0x34')][_0xabb5('0x3a')](_0xabb5('0x50'))){_0x2a01ef['limit']=qs[_0xabb5('0x3b')](_0x10fe8d[_0xabb5('0x34')][_0xabb5('0x3b')]);_0x2a01ef[_0xabb5('0x23')]=qs[_0xabb5('0x23')](_0x10fe8d['query'][_0xabb5('0x23')]);}return _0x364453[_0xabb5('0x4c')](_0x2a01ef);}})[_0xabb5('0x2a')](function(_0x4bf36b){if(_0x4bf36b){return _0x4bf36b?{'count':_0x313080,'rows':_0x4bf36b}:null;}})[_0xabb5('0x2a')](respondWithResult(_0x47291f,null))['catch'](handleError(_0x47291f,null));};exports[_0xabb5('0x51')]=function(_0x30e5d8,_0x5b97e1,_0x3a0df5){var _0x2322f1={};var _0x2fd6cb={};var _0x4d555b;var _0x5d35fc;return db[_0xabb5('0x2f')][_0xabb5('0x4d')]({'where':{'id':_0x30e5d8[_0xabb5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b97e1,null))[_0xabb5('0x2a')](function(_0x5469af){if(_0x5469af){_0x4d555b=_0x5469af;_0x2fd6cb[_0xabb5('0x33')]=_[_0xabb5('0x35')](db['Dynamics365Field']['rawAttributes']);_0x2fd6cb[_0xabb5('0x34')]=_['keys'](_0x30e5d8['query']);_0x2fd6cb[_0xabb5('0x36')]=_[_0xabb5('0x38')](_0x2fd6cb[_0xabb5('0x33')],_0x2fd6cb[_0xabb5('0x34')]);_0x2322f1['attributes']=_[_0xabb5('0x38')](_0x2fd6cb[_0xabb5('0x33')],qs[_0xabb5('0x39')](_0x30e5d8[_0xabb5('0x34')]['fields']));_0x2322f1['attributes']=_0x2322f1['attributes'][_0xabb5('0x47')]?_0x2322f1[_0xabb5('0x37')]:_0x2fd6cb[_0xabb5('0x33')];_0x2322f1[_0xabb5('0x4f')]=qs['sort'](_0x30e5d8[_0xabb5('0x34')][_0xabb5('0x3c')]);_0x2322f1['where']=qs[_0xabb5('0x36')](_['pick'](_0x30e5d8[_0xabb5('0x34')],_0x2fd6cb['filters']));if(_0x30e5d8[_0xabb5('0x34')]['filter']){_0x2322f1[_0xabb5('0x3f')]=_['merge'](_0x2322f1[_0xabb5('0x3f')],{'$or':_[_0xabb5('0x2e')](_0x2322f1[_0xabb5('0x37')],function(_0x127e70){var _0x40c4bd={};_0x40c4bd[_0x127e70]={'$like':'%'+_0x30e5d8[_0xabb5('0x34')]['filter']+'%'};return _0x40c4bd;})});}_0x2322f1=_[_0xabb5('0x40')]({},_0x2322f1,_0x30e5d8['options']);return _0x4d555b[_0xabb5('0x51')](_0x2322f1);}})[_0xabb5('0x2a')](function(_0x4b27e4){if(_0x4b27e4){_0x5d35fc=_0x4b27e4['length'];if(!_0x30e5d8[_0xabb5('0x34')][_0xabb5('0x3a')](_0xabb5('0x50'))){_0x2322f1[_0xabb5('0x3b')]=qs[_0xabb5('0x3b')](_0x30e5d8[_0xabb5('0x34')][_0xabb5('0x3b')]);_0x2322f1[_0xabb5('0x23')]=qs[_0xabb5('0x23')](_0x30e5d8[_0xabb5('0x34')][_0xabb5('0x23')]);}return _0x4d555b['getSubjects'](_0x2322f1);}})[_0xabb5('0x2a')](function(_0x529a2a){if(_0x529a2a){return _0x529a2a?{'count':_0x5d35fc,'rows':_0x529a2a}:null;}})[_0xabb5('0x2a')](respondWithResult(_0x5b97e1,null))[_0xabb5('0x44')](handleError(_0x5b97e1,null));};exports[_0xabb5('0x52')]=function(_0x14c572,_0x29fe77,_0x14a3ce){var _0x10b56e={};var _0x563f81={};var _0x53c3eb;var _0x3dfc06;return db[_0xabb5('0x2f')]['findOne']({'where':{'id':_0x14c572['params']['id']}})[_0xabb5('0x2a')](handleEntityNotFound(_0x29fe77,null))['then'](function(_0x306f71){if(_0x306f71){_0x53c3eb=_0x306f71;_0x563f81[_0xabb5('0x33')]=_['keys'](db[_0xabb5('0x4e')][_0xabb5('0x46')]);_0x563f81['query']=_['keys'](_0x14c572[_0xabb5('0x34')]);_0x563f81[_0xabb5('0x36')]=_[_0xabb5('0x38')](_0x563f81[_0xabb5('0x33')],_0x563f81[_0xabb5('0x34')]);_0x10b56e[_0xabb5('0x37')]=_[_0xabb5('0x38')](_0x563f81['model'],qs[_0xabb5('0x39')](_0x14c572[_0xabb5('0x34')][_0xabb5('0x39')]));_0x10b56e['attributes']=_0x10b56e['attributes'][_0xabb5('0x47')]?_0x10b56e[_0xabb5('0x37')]:_0x563f81[_0xabb5('0x33')];_0x10b56e['order']=qs['sort'](_0x14c572[_0xabb5('0x34')][_0xabb5('0x3c')]);_0x10b56e[_0xabb5('0x3f')]=qs['filters'](_[_0xabb5('0x3d')](_0x14c572[_0xabb5('0x34')],_0x563f81[_0xabb5('0x36')]));if(_0x14c572['query']['filter']){_0x10b56e['where']=_['merge'](_0x10b56e['where'],{'$or':_[_0xabb5('0x2e')](_0x10b56e['attributes'],function(_0x20e57f){var _0x165a27={};_0x165a27[_0x20e57f]={'$like':'%'+_0x14c572[_0xabb5('0x34')][_0xabb5('0x3e')]+'%'};return _0x165a27;})});}_0x10b56e=_[_0xabb5('0x40')]({},_0x10b56e,_0x14c572[_0xabb5('0x41')]);return _0x53c3eb[_0xabb5('0x52')](_0x10b56e);}})['then'](function(_0x4248d9){if(_0x4248d9){_0x3dfc06=_0x4248d9['length'];if(!_0x14c572[_0xabb5('0x34')]['hasOwnProperty'](_0xabb5('0x50'))){_0x10b56e['limit']=qs[_0xabb5('0x3b')](_0x14c572[_0xabb5('0x34')][_0xabb5('0x3b')]);_0x10b56e['offset']=qs['offset'](_0x14c572['query'][_0xabb5('0x23')]);}return _0x53c3eb['getDescriptions'](_0x10b56e);}})[_0xabb5('0x2a')](function(_0x1b8ce9){if(_0x1b8ce9){return _0x1b8ce9?{'count':_0x3dfc06,'rows':_0x1b8ce9}:null;}})['then'](respondWithResult(_0x29fe77,null))[_0xabb5('0x44')](handleError(_0x29fe77,null));}; \ No newline at end of file +var _0x6299=['includeAll','include','rows','catch','show','params','keys','rawAttributes','options','create','body','find','findOne','Dynamics365Field','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','map','Dynamics365Configuration','type','key','model','name','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x6299,0x1da));var _0x9629=function(_0x1ddb46,_0x21436e){_0x1ddb46=_0x1ddb46-0x0;var _0x51b90c=_0x6299[_0x1ddb46];return _0x51b90c;};'use strict';var emlformat=require(_0x9629('0x0'));var rimraf=require(_0x9629('0x1'));var zipdir=require(_0x9629('0x2'));var jsonpatch=require(_0x9629('0x3'));var rp=require('request-promise');var moment=require(_0x9629('0x4'));var BPromise=require(_0x9629('0x5'));var Mustache=require(_0x9629('0x6'));var util=require('util');var path=require(_0x9629('0x7'));var sox=require(_0x9629('0x8'));var csv=require(_0x9629('0x9'));var ejs=require(_0x9629('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9629('0xb'));var squel=require(_0x9629('0xc'));var crypto=require('crypto');var jsforce=require(_0x9629('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9629('0x9'));var querystring=require(_0x9629('0xe'));var Papa=require(_0x9629('0xf'));var Redis=require('ioredis');var authService=require(_0x9629('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9629('0x11'));var logger=require('../../config/logger')(_0x9629('0x12'));var utils=require(_0x9629('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9629('0x14'));var db=require(_0x9629('0x15'))['db'];function respondWithStatusCode(_0x384d0c,_0x5fbb8a){_0x5fbb8a=_0x5fbb8a||0xcc;return function(_0x2b080e){if(_0x2b080e){return _0x384d0c[_0x9629('0x16')](_0x5fbb8a);}return _0x384d0c[_0x9629('0x17')](_0x5fbb8a)[_0x9629('0x18')]();};}function respondWithResult(_0x4c1255,_0x289ace){_0x289ace=_0x289ace||0xc8;return function(_0x484e9b){if(_0x484e9b){return _0x4c1255[_0x9629('0x17')](_0x289ace)[_0x9629('0x19')](_0x484e9b);}};}function respondWithFilteredResult(_0x51882f,_0x13646e){return function(_0x4c1cfa){if(_0x4c1cfa){var _0x389660=typeof _0x13646e[_0x9629('0x1a')]===_0x9629('0x1b')&&typeof _0x13646e[_0x9629('0x1c')]==='undefined';var _0x2d1129=_0x4c1cfa['count'];var _0x835e2c=_0x389660?0x0:_0x13646e[_0x9629('0x1a')];var _0x3dd3b0=_0x389660?_0x4c1cfa[_0x9629('0x1d')]:_0x13646e[_0x9629('0x1a')]+_0x13646e[_0x9629('0x1c')];var _0x52a730;if(_0x3dd3b0>=_0x2d1129){_0x3dd3b0=_0x2d1129;_0x52a730=0xc8;}else{_0x52a730=0xce;}_0x51882f[_0x9629('0x17')](_0x52a730);return _0x51882f[_0x9629('0x1e')](_0x9629('0x1f'),_0x835e2c+'-'+_0x3dd3b0+'/'+_0x2d1129)[_0x9629('0x19')](_0x4c1cfa);}return null;};}function patchUpdates(_0xe5f5bb){return function(_0x1fa083){try{jsonpatch[_0x9629('0x20')](_0x1fa083,_0xe5f5bb,!![]);}catch(_0x2a89ef){return BPromise['reject'](_0x2a89ef);}return _0x1fa083[_0x9629('0x21')]();};}function saveUpdates(_0x56b51d,_0x40b92b){return function(_0x5359b1){if(_0x5359b1){return _0x5359b1[_0x9629('0x22')](_0x56b51d)[_0x9629('0x23')](function(_0xce7be){return _0xce7be;});}return null;};}function removeEntity(_0x4bca74,_0x149434){return function(_0x408850){if(_0x408850){return _0x408850[_0x9629('0x24')]()['then'](function(){_0x4bca74[_0x9629('0x17')](0xcc)[_0x9629('0x18')]();});}};}function handleEntityNotFound(_0x29dad6,_0x1ec4b){return function(_0x21280e){if(!_0x21280e){_0x29dad6[_0x9629('0x16')](0x194);}return _0x21280e;};}function handleError(_0x962d2f,_0xca2c13){_0xca2c13=_0xca2c13||0x1f4;return function(_0x23d98a){logger[_0x9629('0x25')](_0x23d98a['stack']);if(_0x23d98a['name']){delete _0x23d98a['name'];}_0x962d2f[_0x9629('0x17')](_0xca2c13)['send'](_0x23d98a);};}exports['index']=function(_0x542c8d,_0x566a0e){var _0x9b458a={},_0x5546cb={},_0x12dd28={'count':0x0,'rows':[]};var _0x435ba3=_[_0x9629('0x26')](db[_0x9629('0x27')]['rawAttributes'],function(_0x4a9980){return{'name':_0x4a9980['fieldName'],'type':_0x4a9980[_0x9629('0x28')][_0x9629('0x29')]};});_0x5546cb[_0x9629('0x2a')]=_[_0x9629('0x26')](_0x435ba3,_0x9629('0x2b'));_0x5546cb['query']=_['keys'](_0x542c8d['query']);_0x5546cb[_0x9629('0x2c')]=_[_0x9629('0x2d')](_0x5546cb[_0x9629('0x2a')],_0x5546cb[_0x9629('0x2e')]);_0x9b458a[_0x9629('0x2f')]=_[_0x9629('0x2d')](_0x5546cb['model'],qs[_0x9629('0x30')](_0x542c8d[_0x9629('0x2e')][_0x9629('0x30')]));_0x9b458a['attributes']=_0x9b458a[_0x9629('0x2f')][_0x9629('0x31')]?_0x9b458a['attributes']:_0x5546cb[_0x9629('0x2a')];if(!_0x542c8d[_0x9629('0x2e')]['hasOwnProperty'](_0x9629('0x32'))){_0x9b458a[_0x9629('0x1c')]=qs[_0x9629('0x1c')](_0x542c8d['query'][_0x9629('0x1c')]);_0x9b458a[_0x9629('0x1a')]=qs[_0x9629('0x1a')](_0x542c8d[_0x9629('0x2e')]['offset']);}_0x9b458a[_0x9629('0x33')]=qs['sort'](_0x542c8d[_0x9629('0x2e')][_0x9629('0x34')]);_0x9b458a[_0x9629('0x35')]=qs['filters'](_[_0x9629('0x36')](_0x542c8d[_0x9629('0x2e')],_0x5546cb[_0x9629('0x2c')]),_0x435ba3);if(_0x542c8d['query'][_0x9629('0x37')]){_0x9b458a[_0x9629('0x35')]=_[_0x9629('0x38')](_0x9b458a['where'],{'$or':_[_0x9629('0x26')](_0x435ba3,function(_0x3c3ae4){if(_0x3c3ae4[_0x9629('0x28')]!==_0x9629('0x39')){var _0x41b9a5={};_0x41b9a5[_0x3c3ae4[_0x9629('0x2b')]]={'$like':'%'+_0x542c8d[_0x9629('0x2e')][_0x9629('0x37')]+'%'};return _0x41b9a5;}})});}_0x9b458a=_[_0x9629('0x38')]({},_0x9b458a,_0x542c8d['options']);var _0x55885a={'where':_0x9b458a[_0x9629('0x35')]};return db[_0x9629('0x27')][_0x9629('0x1d')](_0x55885a)[_0x9629('0x23')](function(_0x3118a4){_0x12dd28[_0x9629('0x1d')]=_0x3118a4;if(_0x542c8d[_0x9629('0x2e')][_0x9629('0x3a')]){_0x9b458a[_0x9629('0x3b')]=[{'all':!![]}];}return db[_0x9629('0x27')]['findAll'](_0x9b458a);})[_0x9629('0x23')](function(_0x184af2){_0x12dd28[_0x9629('0x3c')]=_0x184af2;return _0x12dd28;})['then'](respondWithFilteredResult(_0x566a0e,_0x9b458a))[_0x9629('0x3d')](handleError(_0x566a0e,null));};exports[_0x9629('0x3e')]=function(_0x389517,_0x3af022){var _0x1a251f={'raw':![],'where':{'id':_0x389517[_0x9629('0x3f')]['id']}},_0x1c76ba={};_0x1c76ba['model']=_[_0x9629('0x40')](db[_0x9629('0x27')][_0x9629('0x41')]);_0x1c76ba['query']=_[_0x9629('0x40')](_0x389517['query']);_0x1c76ba[_0x9629('0x2c')]=_['intersection'](_0x1c76ba[_0x9629('0x2a')],_0x1c76ba[_0x9629('0x2e')]);_0x1a251f[_0x9629('0x2f')]=_[_0x9629('0x2d')](_0x1c76ba[_0x9629('0x2a')],qs[_0x9629('0x30')](_0x389517['query'][_0x9629('0x30')]));_0x1a251f[_0x9629('0x2f')]=_0x1a251f[_0x9629('0x2f')][_0x9629('0x31')]?_0x1a251f[_0x9629('0x2f')]:_0x1c76ba[_0x9629('0x2a')];if(_0x389517[_0x9629('0x2e')][_0x9629('0x3a')]){_0x1a251f['include']=[{'all':!![]}];}_0x1a251f=_[_0x9629('0x38')]({},_0x1a251f,_0x389517[_0x9629('0x42')]);return db[_0x9629('0x27')]['find'](_0x1a251f)[_0x9629('0x23')](handleEntityNotFound(_0x3af022,null))[_0x9629('0x23')](respondWithResult(_0x3af022,null))[_0x9629('0x3d')](handleError(_0x3af022,null));};exports[_0x9629('0x43')]=function(_0x131f3c,_0x4f89c0){return db[_0x9629('0x27')]['create'](_0x131f3c[_0x9629('0x44')],{})['then'](respondWithResult(_0x4f89c0,0xc9))['catch'](handleError(_0x4f89c0,null));};exports[_0x9629('0x22')]=function(_0x51834d,_0x4ce910){if(_0x51834d[_0x9629('0x44')]['id']){delete _0x51834d[_0x9629('0x44')]['id'];}return db[_0x9629('0x27')][_0x9629('0x45')]({'where':{'id':_0x51834d['params']['id']}})[_0x9629('0x23')](handleEntityNotFound(_0x4ce910,null))[_0x9629('0x23')](saveUpdates(_0x51834d[_0x9629('0x44')],null))[_0x9629('0x23')](respondWithResult(_0x4ce910,null))[_0x9629('0x3d')](handleError(_0x4ce910,null));};exports[_0x9629('0x24')]=function(_0x266020,_0x98bdde){return db[_0x9629('0x27')][_0x9629('0x45')]({'where':{'id':_0x266020['params']['id']}})[_0x9629('0x23')](handleEntityNotFound(_0x98bdde,null))[_0x9629('0x23')](removeEntity(_0x98bdde,null))[_0x9629('0x3d')](handleError(_0x98bdde,null));};exports['getFields']=function(_0xa132ec,_0x1ffdb6,_0x512073){var _0x43de23={};var _0x281be1={};var _0x523541;var _0x2129e4;return db[_0x9629('0x27')][_0x9629('0x46')]({'where':{'id':_0xa132ec[_0x9629('0x3f')]['id']}})[_0x9629('0x23')](handleEntityNotFound(_0x1ffdb6,null))[_0x9629('0x23')](function(_0x386e0f){if(_0x386e0f){_0x523541=_0x386e0f;_0x281be1[_0x9629('0x2a')]=_[_0x9629('0x40')](db[_0x9629('0x47')]['rawAttributes']);_0x281be1[_0x9629('0x2e')]=_[_0x9629('0x40')](_0xa132ec[_0x9629('0x2e')]);_0x281be1[_0x9629('0x2c')]=_[_0x9629('0x2d')](_0x281be1['model'],_0x281be1[_0x9629('0x2e')]);_0x43de23[_0x9629('0x2f')]=_[_0x9629('0x2d')](_0x281be1['model'],qs[_0x9629('0x30')](_0xa132ec[_0x9629('0x2e')][_0x9629('0x30')]));_0x43de23['attributes']=_0x43de23[_0x9629('0x2f')][_0x9629('0x31')]?_0x43de23[_0x9629('0x2f')]:_0x281be1['model'];_0x43de23[_0x9629('0x33')]=qs[_0x9629('0x34')](_0xa132ec['query'][_0x9629('0x34')]);_0x43de23[_0x9629('0x35')]=qs[_0x9629('0x2c')](_[_0x9629('0x36')](_0xa132ec[_0x9629('0x2e')],_0x281be1[_0x9629('0x2c')]));if(_0xa132ec[_0x9629('0x2e')][_0x9629('0x37')]){_0x43de23[_0x9629('0x35')]=_[_0x9629('0x38')](_0x43de23[_0x9629('0x35')],{'$or':_['map'](_0x43de23[_0x9629('0x2f')],function(_0x2a0e42){var _0x3ae7ee={};_0x3ae7ee[_0x2a0e42]={'$like':'%'+_0xa132ec[_0x9629('0x2e')][_0x9629('0x37')]+'%'};return _0x3ae7ee;})});}_0x43de23=_[_0x9629('0x38')]({},_0x43de23,_0xa132ec[_0x9629('0x42')]);return _0x523541[_0x9629('0x48')](_0x43de23);}})[_0x9629('0x23')](function(_0x320b2e){if(_0x320b2e){_0x2129e4=_0x320b2e['length'];if(!_0xa132ec[_0x9629('0x2e')][_0x9629('0x49')](_0x9629('0x32'))){_0x43de23['limit']=qs['limit'](_0xa132ec[_0x9629('0x2e')]['limit']);_0x43de23[_0x9629('0x1a')]=qs[_0x9629('0x1a')](_0xa132ec[_0x9629('0x2e')][_0x9629('0x1a')]);}return _0x523541[_0x9629('0x48')](_0x43de23);}})[_0x9629('0x23')](function(_0x5c2e08){if(_0x5c2e08){return _0x5c2e08?{'count':_0x2129e4,'rows':_0x5c2e08}:null;}})[_0x9629('0x23')](respondWithResult(_0x1ffdb6,null))[_0x9629('0x3d')](handleError(_0x1ffdb6,null));};exports[_0x9629('0x4a')]=function(_0x45f603,_0x799125,_0x19170c){var _0x425bb0={};var _0x2b61e9={};var _0x1fa73c;var _0x1b3786;return db[_0x9629('0x27')][_0x9629('0x46')]({'where':{'id':_0x45f603[_0x9629('0x3f')]['id']}})[_0x9629('0x23')](handleEntityNotFound(_0x799125,null))['then'](function(_0x478465){if(_0x478465){_0x1fa73c=_0x478465;_0x2b61e9['model']=_[_0x9629('0x40')](db[_0x9629('0x47')]['rawAttributes']);_0x2b61e9['query']=_['keys'](_0x45f603[_0x9629('0x2e')]);_0x2b61e9['filters']=_[_0x9629('0x2d')](_0x2b61e9['model'],_0x2b61e9[_0x9629('0x2e')]);_0x425bb0[_0x9629('0x2f')]=_[_0x9629('0x2d')](_0x2b61e9[_0x9629('0x2a')],qs[_0x9629('0x30')](_0x45f603[_0x9629('0x2e')][_0x9629('0x30')]));_0x425bb0[_0x9629('0x2f')]=_0x425bb0[_0x9629('0x2f')][_0x9629('0x31')]?_0x425bb0['attributes']:_0x2b61e9[_0x9629('0x2a')];_0x425bb0[_0x9629('0x33')]=qs[_0x9629('0x34')](_0x45f603['query'][_0x9629('0x34')]);_0x425bb0['where']=qs['filters'](_[_0x9629('0x36')](_0x45f603['query'],_0x2b61e9[_0x9629('0x2c')]));if(_0x45f603[_0x9629('0x2e')][_0x9629('0x37')]){_0x425bb0[_0x9629('0x35')]=_['merge'](_0x425bb0['where'],{'$or':_[_0x9629('0x26')](_0x425bb0['attributes'],function(_0x5b4acd){var _0x50da09={};_0x50da09[_0x5b4acd]={'$like':'%'+_0x45f603[_0x9629('0x2e')][_0x9629('0x37')]+'%'};return _0x50da09;})});}_0x425bb0=_[_0x9629('0x38')]({},_0x425bb0,_0x45f603['options']);return _0x1fa73c[_0x9629('0x4a')](_0x425bb0);}})[_0x9629('0x23')](function(_0x1caa71){if(_0x1caa71){_0x1b3786=_0x1caa71[_0x9629('0x31')];if(!_0x45f603['query']['hasOwnProperty'](_0x9629('0x32'))){_0x425bb0[_0x9629('0x1c')]=qs[_0x9629('0x1c')](_0x45f603['query']['limit']);_0x425bb0['offset']=qs[_0x9629('0x1a')](_0x45f603[_0x9629('0x2e')][_0x9629('0x1a')]);}return _0x1fa73c['getSubjects'](_0x425bb0);}})[_0x9629('0x23')](function(_0x20171c){if(_0x20171c){return _0x20171c?{'count':_0x1b3786,'rows':_0x20171c}:null;}})[_0x9629('0x23')](respondWithResult(_0x799125,null))['catch'](handleError(_0x799125,null));};exports[_0x9629('0x4b')]=function(_0x1a1905,_0x30cd7c,_0x5d2705){var _0x2b3a79={};var _0x325d8b={};var _0x1e3466;var _0x176a19;return db[_0x9629('0x27')][_0x9629('0x46')]({'where':{'id':_0x1a1905[_0x9629('0x3f')]['id']}})[_0x9629('0x23')](handleEntityNotFound(_0x30cd7c,null))[_0x9629('0x23')](function(_0xc48249){if(_0xc48249){_0x1e3466=_0xc48249;_0x325d8b[_0x9629('0x2a')]=_[_0x9629('0x40')](db[_0x9629('0x47')]['rawAttributes']);_0x325d8b[_0x9629('0x2e')]=_[_0x9629('0x40')](_0x1a1905[_0x9629('0x2e')]);_0x325d8b[_0x9629('0x2c')]=_[_0x9629('0x2d')](_0x325d8b[_0x9629('0x2a')],_0x325d8b[_0x9629('0x2e')]);_0x2b3a79[_0x9629('0x2f')]=_[_0x9629('0x2d')](_0x325d8b['model'],qs[_0x9629('0x30')](_0x1a1905['query'][_0x9629('0x30')]));_0x2b3a79[_0x9629('0x2f')]=_0x2b3a79[_0x9629('0x2f')][_0x9629('0x31')]?_0x2b3a79[_0x9629('0x2f')]:_0x325d8b[_0x9629('0x2a')];_0x2b3a79['order']=qs[_0x9629('0x34')](_0x1a1905[_0x9629('0x2e')][_0x9629('0x34')]);_0x2b3a79['where']=qs[_0x9629('0x2c')](_[_0x9629('0x36')](_0x1a1905[_0x9629('0x2e')],_0x325d8b['filters']));if(_0x1a1905[_0x9629('0x2e')][_0x9629('0x37')]){_0x2b3a79[_0x9629('0x35')]=_[_0x9629('0x38')](_0x2b3a79[_0x9629('0x35')],{'$or':_[_0x9629('0x26')](_0x2b3a79['attributes'],function(_0x5ed76e){var _0x2a3b5c={};_0x2a3b5c[_0x5ed76e]={'$like':'%'+_0x1a1905[_0x9629('0x2e')][_0x9629('0x37')]+'%'};return _0x2a3b5c;})});}_0x2b3a79=_[_0x9629('0x38')]({},_0x2b3a79,_0x1a1905[_0x9629('0x42')]);return _0x1e3466[_0x9629('0x4b')](_0x2b3a79);}})[_0x9629('0x23')](function(_0x4c8491){if(_0x4c8491){_0x176a19=_0x4c8491[_0x9629('0x31')];if(!_0x1a1905[_0x9629('0x2e')][_0x9629('0x49')](_0x9629('0x32'))){_0x2b3a79[_0x9629('0x1c')]=qs['limit'](_0x1a1905[_0x9629('0x2e')][_0x9629('0x1c')]);_0x2b3a79[_0x9629('0x1a')]=qs[_0x9629('0x1a')](_0x1a1905[_0x9629('0x2e')][_0x9629('0x1a')]);}return _0x1e3466[_0x9629('0x4b')](_0x2b3a79);}})[_0x9629('0x23')](function(_0x4582ca){if(_0x4582ca){return _0x4582ca?{'count':_0x176a19,'rows':_0x4582ca}:null;}})[_0x9629('0x23')](respondWithResult(_0x30cd7c,null))[_0x9629('0x3d')](handleError(_0x30cd7c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index b28525e..91c0829 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 _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x131886,_0x12df34){var _0x915ad6=function(_0x5267bc){while(--_0x5267bc){_0x131886['push'](_0x131886['shift']());}};_0x915ad6(++_0x12df34);}(_0x34e8,0x12c));var _0x834e=function(_0xb5e4e0,_0x108b92){_0xb5e4e0=_0xb5e4e0-0x0;var _0x37c2cf=_0x34e8[_0xb5e4e0];return _0x37c2cf;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x5e7df9,_0x4abf46){var _0x4c1e8d=function(_0x51b4a1){while(--_0x51b4a1){_0x5e7df9['push'](_0x5e7df9['shift']());}};_0x4c1e8d(++_0x4abf46);}(_0x5b02,0xe9));var _0x25b0=function(_0x556c22,_0x4d4364){_0x556c22=_0x556c22-0x0;var _0x53f7e6=_0x5b02[_0x556c22];return _0x53f7e6;};'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 1cc5fd9..5d51e1c 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 _0xf374=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','code','error','Dynamics365Configuration,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','util','bluebird'];(function(_0x1b3330,_0x3ad9a1){var _0x626292=function(_0x17e178){while(--_0x17e178){_0x1b3330['push'](_0x1b3330['shift']());}};_0x626292(++_0x3ad9a1);}(_0xf374,0x141));var _0x4f37=function(_0x587098,_0x428c4e){_0x587098=_0x587098-0x0;var _0x65dcca=_0xf374[_0x587098];return _0x65dcca;};'use strict';var _=require(_0x4f37('0x0'));var util=require(_0x4f37('0x1'));var moment=require('moment');var BPromise=require(_0x4f37('0x2'));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(_0x4f37('0x3'))(_0x4f37('0x4'));var config=require(_0x4f37('0x5'));var jayson=require(_0x4f37('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3594ab,_0x4a6631,_0x499e31){return new BPromise(function(_0xb11d8a,_0x557da4){return client[_0x4f37('0x7')](_0x3594ab,_0x499e31)[_0x4f37('0x8')](function(_0x443ce4){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4a6631,'request\x20sent');logger['debug'](_0x4f37('0x9'),_0x4a6631,'request\x20sent',JSON['stringify'](_0x443ce4));if(_0x443ce4['error']){if(_0x443ce4['error'][_0x4f37('0xa')]===0x1f4){logger[_0x4f37('0xb')](_0x4f37('0xc'),_0x4a6631,_0x443ce4['error'][_0x4f37('0xd')]);return _0x557da4(_0x443ce4[_0x4f37('0xb')][_0x4f37('0xd')]);}logger[_0x4f37('0xb')](_0x4f37('0xc'),_0x4a6631,_0x443ce4[_0x4f37('0xb')]['message']);return _0xb11d8a(_0x443ce4['error'][_0x4f37('0xd')]);}else{logger[_0x4f37('0xe')](_0x4f37('0xc'),_0x4a6631,_0x4f37('0xf'));_0xb11d8a(_0x443ce4[_0x4f37('0x10')][_0x4f37('0xd')]);}})[_0x4f37('0x11')](function(_0x2595d2){logger[_0x4f37('0xb')](_0x4f37('0xc'),_0x4a6631,_0x2595d2);_0x557da4(_0x2595d2);});});} \ No newline at end of file +var _0xcd0f=['message','info','result','catch','lodash','util','moment','ioredis','../../config/environment','jayson/promise','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xc3c34c,_0x7d58c2){var _0x3300e4=function(_0x564389){while(--_0x564389){_0xc3c34c['push'](_0xc3c34c['shift']());}};_0x3300e4(++_0x7d58c2);}(_0xcd0f,0x9c));var _0xfcd0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcd0f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfcd0('0x0'));var util=require(_0xfcd0('0x1'));var moment=require(_0xfcd0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfcd0('0x4'));var jayson=require(_0xfcd0('0x5'));var client=jayson[_0xfcd0('0x6')][_0xfcd0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44bcd5,_0x450499,_0x3016cc){return new BPromise(function(_0x4981c0,_0x5be2f7){return client['request'](_0x44bcd5,_0x3016cc)[_0xfcd0('0x8')](function(_0x22daee){logger['info'](_0xfcd0('0x9'),_0x450499,_0xfcd0('0xa'));logger['debug'](_0xfcd0('0xb'),_0x450499,_0xfcd0('0xa'),JSON[_0xfcd0('0xc')](_0x22daee));if(_0x22daee[_0xfcd0('0xd')]){if(_0x22daee['error'][_0xfcd0('0xe')]===0x1f4){logger[_0xfcd0('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x450499,_0x22daee[_0xfcd0('0xd')][_0xfcd0('0xf')]);return _0x5be2f7(_0x22daee[_0xfcd0('0xd')][_0xfcd0('0xf')]);}logger[_0xfcd0('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x450499,_0x22daee['error'][_0xfcd0('0xf')]);return _0x4981c0(_0x22daee[_0xfcd0('0xd')][_0xfcd0('0xf')]);}else{logger[_0xfcd0('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x450499,'request\x20sent');_0x4981c0(_0x22daee[_0xfcd0('0x11')][_0xfcd0('0xf')]);}})[_0xfcd0('0x12')](function(_0x3b53a7){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x450499,_0x3b53a7);_0x5be2f7(_0x3b53a7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 066c988..a9420e2 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 _0xa15d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xa15d,0x1f3));var _0xda15=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xa15d[_0x15ea09];return _0x3e9c78;};'use strict';var multer=require(_0xda15('0x0'));var util=require(_0xda15('0x1'));var path=require(_0xda15('0x2'));var timeout=require(_0xda15('0x3'));var express=require(_0xda15('0x4'));var router=express[_0xda15('0x5')]();var fs_extra=require(_0xda15('0x6'));var auth=require(_0xda15('0x7'));var interaction=require(_0xda15('0x8'));var config=require(_0xda15('0x9'));var controller=require(_0xda15('0xa'));router[_0xda15('0xb')]('/',auth[_0xda15('0xc')](),controller[_0xda15('0xd')]);router[_0xda15('0xb')](_0xda15('0xe'),auth[_0xda15('0xc')](),controller[_0xda15('0xf')]);router[_0xda15('0x10')]('/',auth[_0xda15('0xc')](),controller[_0xda15('0x11')]);router['put'](_0xda15('0xe'),auth[_0xda15('0xc')](),controller[_0xda15('0x12')]);router[_0xda15('0x13')](_0xda15('0xe'),auth[_0xda15('0xc')](),controller[_0xda15('0x14')]);module[_0xda15('0x15')]=router; \ No newline at end of file +var _0xc52f=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3ff13e,_0x39987a){var _0x53aa75=function(_0x4a70eb){while(--_0x4a70eb){_0x3ff13e['push'](_0x3ff13e['shift']());}};_0x53aa75(++_0x39987a);}(_0xc52f,0x76));var _0xfc52=function(_0x105c86,_0x3bf718){_0x105c86=_0x105c86-0x0;var _0x13b4dd=_0xc52f[_0x105c86];return _0x13b4dd;};'use strict';var multer=require(_0xfc52('0x0'));var util=require(_0xfc52('0x1'));var path=require(_0xfc52('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc52('0x3'));var router=express[_0xfc52('0x4')]();var fs_extra=require(_0xfc52('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfc52('0x6'));var config=require(_0xfc52('0x7'));var controller=require(_0xfc52('0x8'));router[_0xfc52('0x9')]('/',auth[_0xfc52('0xa')](),controller['index']);router[_0xfc52('0x9')](_0xfc52('0xb'),auth[_0xfc52('0xa')](),controller[_0xfc52('0xc')]);router[_0xfc52('0xd')]('/',auth['isAuthenticated'](),controller[_0xfc52('0xe')]);router[_0xfc52('0xf')](_0xfc52('0xb'),auth[_0xfc52('0xa')](),controller[_0xfc52('0x10')]);router[_0xfc52('0x11')](_0xfc52('0xb'),auth['isAuthenticated'](),controller[_0xfc52('0x12')]);module[_0xfc52('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 8521c07..3c8ec63 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 _0xe679=['string','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x30b472,_0x4a4679){var _0x4d5d02=function(_0x1cdd32){while(--_0x1cdd32){_0x30b472['push'](_0x30b472['shift']());}};_0x4d5d02(++_0x4a4679);}(_0xe679,0x1a0));var _0x9e67=function(_0x23301c,_0x3616d8){_0x23301c=_0x23301c-0x0;var _0x336f55=_0xe679[_0x23301c];return _0x336f55;};'use strict';var Sequelize=require(_0x9e67('0x0'));module['exports']={'type':{'type':Sequelize[_0x9e67('0x1')]('string',_0x9e67('0x2'),_0x9e67('0x3'),_0x9e67('0x4'),_0x9e67('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9e67('0x6')]},'keyType':{'type':Sequelize[_0x9e67('0x1')](_0x9e67('0x7'),_0x9e67('0x2'),_0x9e67('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9e67('0x6')]},'nameField':{'type':Sequelize[_0x9e67('0x6')]},'customField':{'type':Sequelize[_0x9e67('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe784=['variable','customVariable','keyValue','STRING','exports','ENUM','string'];(function(_0x416ad,_0x3797e5){var _0x160983=function(_0x1aa782){while(--_0x1aa782){_0x416ad['push'](_0x416ad['shift']());}};_0x160983(++_0x3797e5);}(_0xe784,0x90));var _0x4e78=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xe784[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require('sequelize');module[_0x4e78('0x0')]={'type':{'type':Sequelize[_0x4e78('0x1')](_0x4e78('0x2'),_0x4e78('0x3'),_0x4e78('0x4'),_0x4e78('0x5'),'picklist'),'defaultValue':_0x4e78('0x2')},'content':{'type':Sequelize[_0x4e78('0x6')]},'key':{'type':Sequelize[_0x4e78('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x4e78('0x2'),_0x4e78('0x3'),_0x4e78('0x4'))},'keyContent':{'type':Sequelize[_0x4e78('0x6')]},'idField':{'type':Sequelize[_0x4e78('0x6')]},'nameField':{'type':Sequelize[_0x4e78('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4e78('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 92602a5..088a6e7 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 _0xb4b7=['set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Dynamics365Field','rows','params','includeAll','include','find','catch','create','body','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit'];(function(_0x3e2fe6,_0x334f09){var _0x59d813=function(_0x256f2f){while(--_0x256f2f){_0x3e2fe6['push'](_0x3e2fe6['shift']());}};_0x59d813(++_0x334f09);}(_0xb4b7,0x106));var _0x7b4b=function(_0x54db19,_0x3f7e46){_0x54db19=_0x54db19-0x0;var _0x543df3=_0xb4b7[_0x54db19];return _0x543df3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b4b('0x0'));var rp=require(_0x7b4b('0x1'));var moment=require(_0x7b4b('0x2'));var BPromise=require(_0x7b4b('0x3'));var Mustache=require('mustache');var util=require(_0x7b4b('0x4'));var path=require(_0x7b4b('0x5'));var sox=require(_0x7b4b('0x6'));var csv=require(_0x7b4b('0x7'));var ejs=require(_0x7b4b('0x8'));var fs=require('fs');var fs_extra=require(_0x7b4b('0x9'));var _=require('lodash');var squel=require(_0x7b4b('0xa'));var crypto=require(_0x7b4b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b4b('0xc'));var toCsv=require(_0x7b4b('0x7'));var querystring=require(_0x7b4b('0xd'));var Papa=require(_0x7b4b('0xe'));var Redis=require('ioredis');var authService=require(_0x7b4b('0xf'));var qs=require(_0x7b4b('0x10'));var as=require(_0x7b4b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7b4b('0x12'));var utils=require(_0x7b4b('0x13'));var config=require(_0x7b4b('0x14'));var licenseUtil=require(_0x7b4b('0x15'));var db=require(_0x7b4b('0x16'))['db'];function respondWithStatusCode(_0x4d0445,_0x263ccb){_0x263ccb=_0x263ccb||0xcc;return function(_0x2302f1){if(_0x2302f1){return _0x4d0445[_0x7b4b('0x17')](_0x263ccb);}return _0x4d0445[_0x7b4b('0x18')](_0x263ccb)[_0x7b4b('0x19')]();};}function respondWithResult(_0x522c9c,_0x4ffde1){_0x4ffde1=_0x4ffde1||0xc8;return function(_0x1bf7e7){if(_0x1bf7e7){return _0x522c9c[_0x7b4b('0x18')](_0x4ffde1)['json'](_0x1bf7e7);}};}function respondWithFilteredResult(_0x7708b6,_0x1b9bbf){return function(_0x40a51b){if(_0x40a51b){var _0x7478c4=typeof _0x1b9bbf[_0x7b4b('0x1a')]==='undefined'&&typeof _0x1b9bbf['limit']===_0x7b4b('0x1b');var _0x2174d9=_0x40a51b[_0x7b4b('0x1c')];var _0x7bd4c1=_0x7478c4?0x0:_0x1b9bbf[_0x7b4b('0x1a')];var _0x4a9ac6=_0x7478c4?_0x40a51b[_0x7b4b('0x1c')]:_0x1b9bbf['offset']+_0x1b9bbf[_0x7b4b('0x1d')];var _0x2110e3;if(_0x4a9ac6>=_0x2174d9){_0x4a9ac6=_0x2174d9;_0x2110e3=0xc8;}else{_0x2110e3=0xce;}_0x7708b6[_0x7b4b('0x18')](_0x2110e3);return _0x7708b6[_0x7b4b('0x1e')]('Content-Range',_0x7bd4c1+'-'+_0x4a9ac6+'/'+_0x2174d9)[_0x7b4b('0x1f')](_0x40a51b);}return null;};}function patchUpdates(_0x55f577){return function(_0x365fb2){try{jsonpatch[_0x7b4b('0x20')](_0x365fb2,_0x55f577,!![]);}catch(_0x1663da){return BPromise[_0x7b4b('0x21')](_0x1663da);}return _0x365fb2[_0x7b4b('0x22')]();};}function saveUpdates(_0x8ede2f,_0x13106c){return function(_0x5b8707){if(_0x5b8707){return _0x5b8707[_0x7b4b('0x23')](_0x8ede2f)[_0x7b4b('0x24')](function(_0x39d9d3){return _0x39d9d3;});}return null;};}function removeEntity(_0x34bfe5,_0x26b8af){return function(_0x3cf38f){if(_0x3cf38f){return _0x3cf38f[_0x7b4b('0x25')]()[_0x7b4b('0x24')](function(){_0x34bfe5[_0x7b4b('0x18')](0xcc)[_0x7b4b('0x19')]();});}};}function handleEntityNotFound(_0x2a133f,_0x79de33){return function(_0x24d985){if(!_0x24d985){_0x2a133f[_0x7b4b('0x17')](0x194);}return _0x24d985;};}function handleError(_0x26bcbc,_0x35e0d1){_0x35e0d1=_0x35e0d1||0x1f4;return function(_0x57f23b){logger[_0x7b4b('0x26')](_0x57f23b[_0x7b4b('0x27')]);if(_0x57f23b[_0x7b4b('0x28')]){delete _0x57f23b[_0x7b4b('0x28')];}_0x26bcbc[_0x7b4b('0x18')](_0x35e0d1)[_0x7b4b('0x29')](_0x57f23b);};}exports[_0x7b4b('0x2a')]=function(_0x32c0a4,_0x1e47ef){var _0x2eb6fb={},_0x497dfe={},_0x329874={'count':0x0,'rows':[]};var _0x568e5a=_[_0x7b4b('0x2b')](db['Dynamics365Field'][_0x7b4b('0x2c')],function(_0xa5f79f){return{'name':_0xa5f79f['fieldName'],'type':_0xa5f79f['type'][_0x7b4b('0x2d')]};});_0x497dfe['model']=_[_0x7b4b('0x2b')](_0x568e5a,'name');_0x497dfe[_0x7b4b('0x2e')]=_[_0x7b4b('0x2f')](_0x32c0a4[_0x7b4b('0x2e')]);_0x497dfe[_0x7b4b('0x30')]=_[_0x7b4b('0x31')](_0x497dfe[_0x7b4b('0x32')],_0x497dfe[_0x7b4b('0x2e')]);_0x2eb6fb['attributes']=_[_0x7b4b('0x31')](_0x497dfe[_0x7b4b('0x32')],qs[_0x7b4b('0x33')](_0x32c0a4[_0x7b4b('0x2e')]['fields']));_0x2eb6fb[_0x7b4b('0x34')]=_0x2eb6fb[_0x7b4b('0x34')][_0x7b4b('0x35')]?_0x2eb6fb[_0x7b4b('0x34')]:_0x497dfe['model'];if(!_0x32c0a4[_0x7b4b('0x2e')][_0x7b4b('0x36')]('nolimit')){_0x2eb6fb[_0x7b4b('0x1d')]=qs[_0x7b4b('0x1d')](_0x32c0a4[_0x7b4b('0x2e')][_0x7b4b('0x1d')]);_0x2eb6fb[_0x7b4b('0x1a')]=qs[_0x7b4b('0x1a')](_0x32c0a4[_0x7b4b('0x2e')][_0x7b4b('0x1a')]);}_0x2eb6fb[_0x7b4b('0x37')]=qs[_0x7b4b('0x38')](_0x32c0a4['query'][_0x7b4b('0x38')]);_0x2eb6fb[_0x7b4b('0x39')]=qs[_0x7b4b('0x30')](_[_0x7b4b('0x3a')](_0x32c0a4[_0x7b4b('0x2e')],_0x497dfe[_0x7b4b('0x30')]),_0x568e5a);if(_0x32c0a4['query'][_0x7b4b('0x3b')]){_0x2eb6fb[_0x7b4b('0x39')]=_[_0x7b4b('0x3c')](_0x2eb6fb[_0x7b4b('0x39')],{'$or':_[_0x7b4b('0x2b')](_0x568e5a,function(_0x5d0335){if(_0x5d0335[_0x7b4b('0x3d')]!==_0x7b4b('0x3e')){var _0x5a6449={};_0x5a6449[_0x5d0335['name']]={'$like':'%'+_0x32c0a4[_0x7b4b('0x2e')][_0x7b4b('0x3b')]+'%'};return _0x5a6449;}})});}_0x2eb6fb=_['merge']({},_0x2eb6fb,_0x32c0a4[_0x7b4b('0x3f')]);var _0x1d4343={'where':_0x2eb6fb[_0x7b4b('0x39')]};return db['Dynamics365Field']['count'](_0x1d4343)['then'](function(_0x29c2e0){_0x329874[_0x7b4b('0x1c')]=_0x29c2e0;if(_0x32c0a4[_0x7b4b('0x2e')]['includeAll']){_0x2eb6fb['include']=[{'all':!![]}];}return db[_0x7b4b('0x40')]['findAll'](_0x2eb6fb);})[_0x7b4b('0x24')](function(_0x5a1402){_0x329874[_0x7b4b('0x41')]=_0x5a1402;return _0x329874;})[_0x7b4b('0x24')](respondWithFilteredResult(_0x1e47ef,_0x2eb6fb))['catch'](handleError(_0x1e47ef,null));};exports['show']=function(_0x172461,_0x219a98){var _0x234541={'raw':!![],'where':{'id':_0x172461[_0x7b4b('0x42')]['id']}},_0x4f5b9a={};_0x4f5b9a[_0x7b4b('0x32')]=_[_0x7b4b('0x2f')](db[_0x7b4b('0x40')][_0x7b4b('0x2c')]);_0x4f5b9a['query']=_[_0x7b4b('0x2f')](_0x172461[_0x7b4b('0x2e')]);_0x4f5b9a['filters']=_[_0x7b4b('0x31')](_0x4f5b9a[_0x7b4b('0x32')],_0x4f5b9a[_0x7b4b('0x2e')]);_0x234541[_0x7b4b('0x34')]=_['intersection'](_0x4f5b9a[_0x7b4b('0x32')],qs[_0x7b4b('0x33')](_0x172461[_0x7b4b('0x2e')][_0x7b4b('0x33')]));_0x234541['attributes']=_0x234541[_0x7b4b('0x34')][_0x7b4b('0x35')]?_0x234541['attributes']:_0x4f5b9a['model'];if(_0x172461[_0x7b4b('0x2e')][_0x7b4b('0x43')]){_0x234541[_0x7b4b('0x44')]=[{'all':!![]}];}_0x234541=_[_0x7b4b('0x3c')]({},_0x234541,_0x172461['options']);return db[_0x7b4b('0x40')][_0x7b4b('0x45')](_0x234541)[_0x7b4b('0x24')](handleEntityNotFound(_0x219a98,null))[_0x7b4b('0x24')](respondWithResult(_0x219a98,null))[_0x7b4b('0x46')](handleError(_0x219a98,null));};exports[_0x7b4b('0x47')]=function(_0x2709cb,_0x59e292){return db[_0x7b4b('0x40')][_0x7b4b('0x47')](_0x2709cb[_0x7b4b('0x48')],{})[_0x7b4b('0x24')](respondWithResult(_0x59e292,0xc9))[_0x7b4b('0x46')](handleError(_0x59e292,null));};exports['update']=function(_0x5b9661,_0x2e9f5a){if(_0x5b9661[_0x7b4b('0x48')]['id']){delete _0x5b9661[_0x7b4b('0x48')]['id'];}return db[_0x7b4b('0x40')]['find']({'where':{'id':_0x5b9661[_0x7b4b('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e9f5a,null))[_0x7b4b('0x24')](saveUpdates(_0x5b9661[_0x7b4b('0x48')],null))[_0x7b4b('0x24')](respondWithResult(_0x2e9f5a,null))[_0x7b4b('0x46')](handleError(_0x2e9f5a,null));};exports[_0x7b4b('0x25')]=function(_0x553ca5,_0x2deea6){return db[_0x7b4b('0x40')][_0x7b4b('0x45')]({'where':{'id':_0x553ca5[_0x7b4b('0x42')]['id']}})[_0x7b4b('0x24')](handleEntityNotFound(_0x2deea6,null))[_0x7b4b('0x24')](removeEntity(_0x2deea6,null))['catch'](handleError(_0x2deea6,null));}; \ No newline at end of file +var _0xef14=['order','sort','where','pick','filter','merge','options','Dynamics365Field','includeAll','include','findAll','rows','show','keys','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','json','apply','save','update','then','destroy','error','name','send','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x22c1d5,_0x5d5463){var _0x31d0e7=function(_0x23a6ed){while(--_0x23a6ed){_0x22c1d5['push'](_0x22c1d5['shift']());}};_0x31d0e7(++_0x5d5463);}(_0xef14,0x1b0));var _0x4ef1=function(_0x27835e,_0x1fff38){_0x27835e=_0x27835e-0x0;var _0x2ecc9a=_0xef14[_0x27835e];return _0x2ecc9a;};'use strict';var emlformat=require(_0x4ef1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ef1('0x1'));var jsonpatch=require(_0x4ef1('0x2'));var rp=require(_0x4ef1('0x3'));var moment=require(_0x4ef1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4ef1('0x5'));var sox=require(_0x4ef1('0x6'));var csv=require(_0x4ef1('0x7'));var ejs=require(_0x4ef1('0x8'));var fs=require('fs');var fs_extra=require(_0x4ef1('0x9'));var _=require(_0x4ef1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ef1('0xb'));var deskjs=require(_0x4ef1('0xc'));var toCsv=require(_0x4ef1('0x7'));var querystring=require(_0x4ef1('0xd'));var Papa=require('papaparse');var Redis=require(_0x4ef1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4ef1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ef1('0x10'));var logger=require(_0x4ef1('0x11'))(_0x4ef1('0x12'));var utils=require(_0x4ef1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4ef1('0x14'));var db=require(_0x4ef1('0x15'))['db'];function respondWithStatusCode(_0xa80cd0,_0x5c55c6){_0x5c55c6=_0x5c55c6||0xcc;return function(_0x339fbb){if(_0x339fbb){return _0xa80cd0[_0x4ef1('0x16')](_0x5c55c6);}return _0xa80cd0[_0x4ef1('0x17')](_0x5c55c6)[_0x4ef1('0x18')]();};}function respondWithResult(_0x2660e1,_0x3a9b6a){_0x3a9b6a=_0x3a9b6a||0xc8;return function(_0x61e333){if(_0x61e333){return _0x2660e1['status'](_0x3a9b6a)['json'](_0x61e333);}};}function respondWithFilteredResult(_0x3cf969,_0x4a309d){return function(_0x155eec){if(_0x155eec){var _0x197e80=typeof _0x4a309d['offset']===_0x4ef1('0x19')&&typeof _0x4a309d[_0x4ef1('0x1a')]==='undefined';var _0x1ff46a=_0x155eec['count'];var _0x145dae=_0x197e80?0x0:_0x4a309d[_0x4ef1('0x1b')];var _0x51a0ed=_0x197e80?_0x155eec[_0x4ef1('0x1c')]:_0x4a309d['offset']+_0x4a309d[_0x4ef1('0x1a')];var _0x814a9a;if(_0x51a0ed>=_0x1ff46a){_0x51a0ed=_0x1ff46a;_0x814a9a=0xc8;}else{_0x814a9a=0xce;}_0x3cf969['status'](_0x814a9a);return _0x3cf969['set']('Content-Range',_0x145dae+'-'+_0x51a0ed+'/'+_0x1ff46a)[_0x4ef1('0x1d')](_0x155eec);}return null;};}function patchUpdates(_0x51691e){return function(_0xf47180){try{jsonpatch[_0x4ef1('0x1e')](_0xf47180,_0x51691e,!![]);}catch(_0x269cfe){return BPromise['reject'](_0x269cfe);}return _0xf47180[_0x4ef1('0x1f')]();};}function saveUpdates(_0x5cf8dc,_0x3c5295){return function(_0xe2a256){if(_0xe2a256){return _0xe2a256[_0x4ef1('0x20')](_0x5cf8dc)[_0x4ef1('0x21')](function(_0x24de11){return _0x24de11;});}return null;};}function removeEntity(_0x4f89ee,_0x2537cd){return function(_0x1a3c21){if(_0x1a3c21){return _0x1a3c21[_0x4ef1('0x22')]()[_0x4ef1('0x21')](function(){_0x4f89ee[_0x4ef1('0x17')](0xcc)[_0x4ef1('0x18')]();});}};}function handleEntityNotFound(_0x253355,_0x2b5a67){return function(_0x18dd87){if(!_0x18dd87){_0x253355['sendStatus'](0x194);}return _0x18dd87;};}function handleError(_0x25f710,_0x231bf6){_0x231bf6=_0x231bf6||0x1f4;return function(_0x4b3c20){logger[_0x4ef1('0x23')](_0x4b3c20['stack']);if(_0x4b3c20[_0x4ef1('0x24')]){delete _0x4b3c20[_0x4ef1('0x24')];}_0x25f710[_0x4ef1('0x17')](_0x231bf6)[_0x4ef1('0x25')](_0x4b3c20);};}exports['index']=function(_0x2104a7,_0x153652){var _0x395a0c={},_0x261783={},_0x5f04a7={'count':0x0,'rows':[]};var _0x1f5962=_[_0x4ef1('0x26')](db['Dynamics365Field'][_0x4ef1('0x27')],function(_0x31b3d4){return{'name':_0x31b3d4['fieldName'],'type':_0x31b3d4[_0x4ef1('0x28')][_0x4ef1('0x29')]};});_0x261783['model']=_[_0x4ef1('0x26')](_0x1f5962,_0x4ef1('0x24'));_0x261783[_0x4ef1('0x2a')]=_['keys'](_0x2104a7[_0x4ef1('0x2a')]);_0x261783[_0x4ef1('0x2b')]=_[_0x4ef1('0x2c')](_0x261783[_0x4ef1('0x2d')],_0x261783['query']);_0x395a0c[_0x4ef1('0x2e')]=_[_0x4ef1('0x2c')](_0x261783[_0x4ef1('0x2d')],qs[_0x4ef1('0x2f')](_0x2104a7[_0x4ef1('0x2a')]['fields']));_0x395a0c[_0x4ef1('0x2e')]=_0x395a0c[_0x4ef1('0x2e')][_0x4ef1('0x30')]?_0x395a0c['attributes']:_0x261783['model'];if(!_0x2104a7[_0x4ef1('0x2a')][_0x4ef1('0x31')](_0x4ef1('0x32'))){_0x395a0c[_0x4ef1('0x1a')]=qs[_0x4ef1('0x1a')](_0x2104a7[_0x4ef1('0x2a')][_0x4ef1('0x1a')]);_0x395a0c[_0x4ef1('0x1b')]=qs[_0x4ef1('0x1b')](_0x2104a7['query'][_0x4ef1('0x1b')]);}_0x395a0c[_0x4ef1('0x33')]=qs[_0x4ef1('0x34')](_0x2104a7[_0x4ef1('0x2a')][_0x4ef1('0x34')]);_0x395a0c[_0x4ef1('0x35')]=qs[_0x4ef1('0x2b')](_[_0x4ef1('0x36')](_0x2104a7['query'],_0x261783['filters']),_0x1f5962);if(_0x2104a7[_0x4ef1('0x2a')][_0x4ef1('0x37')]){_0x395a0c[_0x4ef1('0x35')]=_[_0x4ef1('0x38')](_0x395a0c[_0x4ef1('0x35')],{'$or':_[_0x4ef1('0x26')](_0x1f5962,function(_0x44143c){if(_0x44143c['type']!=='VIRTUAL'){var _0x504866={};_0x504866[_0x44143c[_0x4ef1('0x24')]]={'$like':'%'+_0x2104a7[_0x4ef1('0x2a')][_0x4ef1('0x37')]+'%'};return _0x504866;}})});}_0x395a0c=_[_0x4ef1('0x38')]({},_0x395a0c,_0x2104a7[_0x4ef1('0x39')]);var _0x54a452={'where':_0x395a0c[_0x4ef1('0x35')]};return db[_0x4ef1('0x3a')][_0x4ef1('0x1c')](_0x54a452)['then'](function(_0x557d32){_0x5f04a7[_0x4ef1('0x1c')]=_0x557d32;if(_0x2104a7[_0x4ef1('0x2a')][_0x4ef1('0x3b')]){_0x395a0c[_0x4ef1('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x4ef1('0x3d')](_0x395a0c);})['then'](function(_0x247b77){_0x5f04a7[_0x4ef1('0x3e')]=_0x247b77;return _0x5f04a7;})[_0x4ef1('0x21')](respondWithFilteredResult(_0x153652,_0x395a0c))['catch'](handleError(_0x153652,null));};exports[_0x4ef1('0x3f')]=function(_0x4d2776,_0x4c1d54){var _0x26a6c6={'raw':!![],'where':{'id':_0x4d2776['params']['id']}},_0x1b0b11={};_0x1b0b11[_0x4ef1('0x2d')]=_[_0x4ef1('0x40')](db[_0x4ef1('0x3a')][_0x4ef1('0x27')]);_0x1b0b11[_0x4ef1('0x2a')]=_[_0x4ef1('0x40')](_0x4d2776[_0x4ef1('0x2a')]);_0x1b0b11['filters']=_['intersection'](_0x1b0b11[_0x4ef1('0x2d')],_0x1b0b11[_0x4ef1('0x2a')]);_0x26a6c6['attributes']=_['intersection'](_0x1b0b11[_0x4ef1('0x2d')],qs[_0x4ef1('0x2f')](_0x4d2776[_0x4ef1('0x2a')]['fields']));_0x26a6c6[_0x4ef1('0x2e')]=_0x26a6c6[_0x4ef1('0x2e')]['length']?_0x26a6c6[_0x4ef1('0x2e')]:_0x1b0b11[_0x4ef1('0x2d')];if(_0x4d2776['query'][_0x4ef1('0x3b')]){_0x26a6c6['include']=[{'all':!![]}];}_0x26a6c6=_[_0x4ef1('0x38')]({},_0x26a6c6,_0x4d2776['options']);return db['Dynamics365Field'][_0x4ef1('0x41')](_0x26a6c6)[_0x4ef1('0x21')](handleEntityNotFound(_0x4c1d54,null))['then'](respondWithResult(_0x4c1d54,null))['catch'](handleError(_0x4c1d54,null));};exports['create']=function(_0x196e06,_0x274ca2){return db[_0x4ef1('0x3a')][_0x4ef1('0x42')](_0x196e06[_0x4ef1('0x43')],{})[_0x4ef1('0x21')](respondWithResult(_0x274ca2,0xc9))['catch'](handleError(_0x274ca2,null));};exports['update']=function(_0x241207,_0x508151){if(_0x241207[_0x4ef1('0x43')]['id']){delete _0x241207[_0x4ef1('0x43')]['id'];}return db[_0x4ef1('0x3a')][_0x4ef1('0x41')]({'where':{'id':_0x241207['params']['id']}})[_0x4ef1('0x21')](handleEntityNotFound(_0x508151,null))[_0x4ef1('0x21')](saveUpdates(_0x241207[_0x4ef1('0x43')],null))[_0x4ef1('0x21')](respondWithResult(_0x508151,null))[_0x4ef1('0x44')](handleError(_0x508151,null));};exports['destroy']=function(_0x1b388f,_0x1e93a6){return db[_0x4ef1('0x3a')]['find']({'where':{'id':_0x1b388f['params']['id']}})[_0x4ef1('0x21')](handleEntityNotFound(_0x1e93a6,null))['then'](removeEntity(_0x1e93a6,null))['catch'](handleError(_0x1e93a6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 2f87c7c..dba7f93 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 _0x3477=['define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','api','bluebird','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x155bbf,_0x1bca34){var _0x1cb0ac=function(_0x101c7c){while(--_0x101c7c){_0x155bbf['push'](_0x155bbf['shift']());}};_0x1cb0ac(++_0x1bca34);}(_0x3477,0x192));var _0x7347=function(_0x422e0b,_0x547cdd){_0x422e0b=_0x422e0b-0x0;var _0x4b1cb6=_0x3477[_0x422e0b];return _0x4b1cb6;};'use strict';var _=require(_0x7347('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7347('0x1'));var moment=require('moment');var BPromise=require(_0x7347('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7347('0x3'));var attributes=require(_0x7347('0x4'));module[_0x7347('0x5')]=function(_0x2e03a8,_0x520386){return _0x2e03a8[_0x7347('0x6')](_0x7347('0x7'),attributes,{'tableName':_0x7347('0x8'),'paranoid':![],'indexes':[{'name':_0x7347('0x9'),'fields':[_0x7347('0xa'),_0x7347('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5202=['api','moment','request-promise','path','../../config/environment','Dynamics365Field','int_dynamics365_fields','idField','lodash','../../config/logger'];(function(_0x3a215d,_0xe95341){var _0xa17db=function(_0x2fd666){while(--_0x2fd666){_0x3a215d['push'](_0x3a215d['shift']());}};_0xa17db(++_0xe95341);}(_0x5202,0x1e8));var _0x2520=function(_0x8a790e,_0x4d855f){_0x8a790e=_0x8a790e-0x0;var _0xce830b=_0x5202[_0x8a790e];return _0xce830b;};'use strict';var _=require(_0x2520('0x0'));var util=require('util');var logger=require(_0x2520('0x1'))(_0x2520('0x2'));var moment=require(_0x2520('0x3'));var BPromise=require('bluebird');var rp=require(_0x2520('0x4'));var fs=require('fs');var path=require(_0x2520('0x5'));var rimraf=require('rimraf');var config=require(_0x2520('0x6'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x5b1a50,_0x221ced){return _0x5b1a50['define'](_0x2520('0x7'),attributes,{'tableName':_0x2520('0x8'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x2520('0x9'),'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 cbac576..cd04f99 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 _0xe9b1=['Dynamics365Field,\x20%s,\x20%s,\x20%s','code','error','Dynamics365Field,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','request\x20sent'];(function(_0x35524b,_0x205e64){var _0xdb83a1=function(_0x508f67){while(--_0x508f67){_0x35524b['push'](_0x35524b['shift']());}};_0xdb83a1(++_0x205e64);}(_0xe9b1,0x11f));var _0x1e9b=function(_0x1b1948,_0x49f451){_0x1b1948=_0x1b1948-0x0;var _0x3cbd38=_0xe9b1[_0x1b1948];return _0x3cbd38;};'use strict';var _=require(_0x1e9b('0x0'));var util=require(_0x1e9b('0x1'));var moment=require(_0x1e9b('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e9b('0x3'));var fs=require('fs');var Redis=require(_0x1e9b('0x4'));var db=require(_0x1e9b('0x5'))['db'];var utils=require(_0x1e9b('0x6'));var logger=require(_0x1e9b('0x7'))(_0x1e9b('0x8'));var config=require(_0x1e9b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1e9b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b044,_0x540506,_0x5d2619){return new BPromise(function(_0x569c8c,_0x5ab043){return client[_0x1e9b('0xb')](_0x18b044,_0x5d2619)['then'](function(_0x2ad1ed){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x540506,_0x1e9b('0xc'));logger['debug'](_0x1e9b('0xd'),_0x540506,'request\x20sent',JSON['stringify'](_0x2ad1ed));if(_0x2ad1ed['error']){if(_0x2ad1ed['error'][_0x1e9b('0xe')]===0x1f4){logger[_0x1e9b('0xf')](_0x1e9b('0x10'),_0x540506,_0x2ad1ed[_0x1e9b('0xf')][_0x1e9b('0x11')]);return _0x5ab043(_0x2ad1ed[_0x1e9b('0xf')][_0x1e9b('0x11')]);}logger[_0x1e9b('0xf')](_0x1e9b('0x10'),_0x540506,_0x2ad1ed['error']['message']);return _0x569c8c(_0x2ad1ed[_0x1e9b('0xf')][_0x1e9b('0x11')]);}else{logger[_0x1e9b('0x12')](_0x1e9b('0x10'),_0x540506,_0x1e9b('0xc'));_0x569c8c(_0x2ad1ed['result']['message']);}})[_0x1e9b('0x13')](function(_0x13e5f0){logger[_0x1e9b('0xf')](_0x1e9b('0x10'),_0x540506,_0x13e5f0);_0x5ab043(_0x13e5f0);});});} \ No newline at end of file +var _0xc1c5=['jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0xc1c5,0x157));var _0x5c1c=function(_0x1f9309,_0x4c5891){_0x1f9309=_0x1f9309-0x0;var _0x65cb05=_0xc1c5[_0x1f9309];return _0x65cb05;};'use strict';var _=require(_0x5c1c('0x0'));var util=require(_0x5c1c('0x1'));var moment=require(_0x5c1c('0x2'));var BPromise=require(_0x5c1c('0x3'));var rs=require(_0x5c1c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c1c('0x5'))['db'];var utils=require(_0x5c1c('0x6'));var logger=require(_0x5c1c('0x7'))('rpc');var config=require(_0x5c1c('0x8'));var jayson=require(_0x5c1c('0x9'));var client=jayson[_0x5c1c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41fb14,_0x1b235e,_0x667aab){return new BPromise(function(_0x4b3cf3,_0x3c6242){return client[_0x5c1c('0xb')](_0x41fb14,_0x667aab)[_0x5c1c('0xc')](function(_0x1d5f12){logger[_0x5c1c('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x1b235e,_0x5c1c('0xe'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1b235e,'request\x20sent',JSON[_0x5c1c('0xf')](_0x1d5f12));if(_0x1d5f12['error']){if(_0x1d5f12[_0x5c1c('0x10')][_0x5c1c('0x11')]===0x1f4){logger[_0x5c1c('0x10')](_0x5c1c('0x12'),_0x1b235e,_0x1d5f12[_0x5c1c('0x10')]['message']);return _0x3c6242(_0x1d5f12[_0x5c1c('0x10')]['message']);}logger[_0x5c1c('0x10')](_0x5c1c('0x12'),_0x1b235e,_0x1d5f12[_0x5c1c('0x10')][_0x5c1c('0x13')]);return _0x4b3cf3(_0x1d5f12[_0x5c1c('0x10')][_0x5c1c('0x13')]);}else{logger['info'](_0x5c1c('0x12'),_0x1b235e,_0x5c1c('0xe'));_0x4b3cf3(_0x1d5f12[_0x5c1c('0x14')][_0x5c1c('0x13')]);}})[_0x5c1c('0x15')](function(_0x2f3bae){logger['error'](_0x5c1c('0x12'),_0x1b235e,_0x2f3bae);_0x3c6242(_0x2f3bae);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index a206b0b..08212ed 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 _0xad7a=['/:id/fields','post','create','put','update','delete','destroy','connect-timeout','express','Router','../../components/auth/service','./intFreshdeskAccount.controller','isAuthenticated','/:id','show','get','/:id/configurations'];(function(_0x26aa89,_0x5645b1){var _0x487869=function(_0x3627e9){while(--_0x3627e9){_0x26aa89['push'](_0x26aa89['shift']());}};_0x487869(++_0x5645b1);}(_0xad7a,0x106));var _0xaad7=function(_0xc9b183,_0x2c88b6){_0xc9b183=_0xc9b183-0x0;var _0x2044de=_0xad7a[_0xc9b183];return _0x2044de;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xaad7('0x0'));var express=require(_0xaad7('0x1'));var router=express[_0xaad7('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xaad7('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaad7('0x4'));router['get']('/',auth[_0xaad7('0x5')](),controller['index']);router['get'](_0xaad7('0x6'),auth[_0xaad7('0x5')](),controller[_0xaad7('0x7')]);router[_0xaad7('0x8')](_0xaad7('0x9'),auth[_0xaad7('0x5')](),controller['getConfigurations']);router[_0xaad7('0x8')](_0xaad7('0xa'),auth[_0xaad7('0x5')](),controller['getFields']);router[_0xaad7('0xb')]('/',auth[_0xaad7('0x5')](),controller[_0xaad7('0xc')]);router[_0xaad7('0xb')](_0xaad7('0x9'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xaad7('0xd')](_0xaad7('0x6'),auth[_0xaad7('0x5')](),controller[_0xaad7('0xe')]);router[_0xaad7('0xf')](_0xaad7('0x6'),auth[_0xaad7('0x5')](),controller[_0xaad7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x54ad=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x54ad,0x1cb));var _0xd54a=function(_0x1221a9,_0x2da9d2){_0x1221a9=_0x1221a9-0x0;var _0x2f01ed=_0x54ad[_0x1221a9];return _0x2f01ed;};'use strict';var multer=require(_0xd54a('0x0'));var util=require(_0xd54a('0x1'));var path=require(_0xd54a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd54a('0x3')]();var fs_extra=require(_0xd54a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd54a('0x5'));var config=require(_0xd54a('0x6'));var controller=require(_0xd54a('0x7'));router[_0xd54a('0x8')]('/',auth['isAuthenticated'](),controller[_0xd54a('0x9')]);router[_0xd54a('0x8')]('/:id',auth[_0xd54a('0xa')](),controller[_0xd54a('0xb')]);router[_0xd54a('0x8')](_0xd54a('0xc'),auth[_0xd54a('0xa')](),controller[_0xd54a('0xd')]);router['get'](_0xd54a('0xe'),auth[_0xd54a('0xa')](),controller['getFields']);router[_0xd54a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd54a('0xf')]('/:id/configurations',auth[_0xd54a('0xa')](),controller[_0xd54a('0x10')]);router[_0xd54a('0x11')](_0xd54a('0x12'),auth[_0xd54a('0xa')](),controller['update']);router[_0xd54a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd54a('0x14')]);module[_0xd54a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index b3fbe41..9ac4925 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 _0x5430=['STRING','username','remoteUri','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5430,0x10c));var _0x0543=function(_0x4a4393,_0x4115b9){_0x4a4393=_0x4a4393-0x0;var _0xf003cf=_0x5430[_0x4a4393];return _0xf003cf;};'use strict';var Sequelize=require(_0x0543('0x0'));module[_0x0543('0x1')]={'name':{'type':Sequelize[_0x0543('0x2')]},'description':{'type':Sequelize[_0x0543('0x2')]},'username':{'type':Sequelize[_0x0543('0x2')],'unique':_0x0543('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0543('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd7d1=['sequelize','exports','STRING','username','remoteUri'];(function(_0x436295,_0x5a58cc){var _0x5b8c2b=function(_0x163b83){while(--_0x163b83){_0x436295['push'](_0x436295['shift']());}};_0x5b8c2b(++_0x5a58cc);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x17a952,_0xf40273){_0x17a952=_0x17a952-0x0;var _0xdb5c60=_0xd7d1[_0x17a952];return _0xdb5c60;};'use strict';var Sequelize=require(_0x1d7d('0x0'));module[_0x1d7d('0x1')]={'name':{'type':Sequelize[_0x1d7d('0x2')]},'description':{'type':Sequelize[_0x1d7d('0x2')]},'username':{'type':Sequelize[_0x1d7d('0x2')],'unique':_0x1d7d('0x3')},'apiKey':{'type':Sequelize[_0x1d7d('0x2')]},'remoteUri':{'type':Sequelize[_0x1d7d('0x2')],'unique':_0x1d7d('0x4')},'serverUrl':{'type':Sequelize[_0x1d7d('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index b0c32b6..ce7a067 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 _0x3176=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','FreshdeskAccount','includeAll','include','catch','show','params','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','pick','options','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','apiKey','substring','lastIndexOf','GET','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','group','source','ticket_type','company','includes','default','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode'];(function(_0xd8b89f,_0x6312f4){var _0x3c6e90=function(_0x182d8a){while(--_0x182d8a){_0xd8b89f['push'](_0xd8b89f['shift']());}};_0x3c6e90(++_0x6312f4);}(_0x3176,0x1d8));var _0x6317=function(_0x5b4ec8,_0x147171){_0x5b4ec8=_0x5b4ec8-0x0;var _0x539b1a=_0x3176[_0x5b4ec8];return _0x539b1a;};'use strict';var emlformat=require(_0x6317('0x0'));var rimraf=require(_0x6317('0x1'));var zipdir=require(_0x6317('0x2'));var jsonpatch=require(_0x6317('0x3'));var rp=require(_0x6317('0x4'));var moment=require(_0x6317('0x5'));var BPromise=require(_0x6317('0x6'));var Mustache=require(_0x6317('0x7'));var util=require(_0x6317('0x8'));var path=require(_0x6317('0x9'));var sox=require(_0x6317('0xa'));var csv=require(_0x6317('0xb'));var ejs=require(_0x6317('0xc'));var fs=require('fs');var fs_extra=require(_0x6317('0xd'));var _=require(_0x6317('0xe'));var squel=require(_0x6317('0xf'));var crypto=require('crypto');var jsforce=require(_0x6317('0x10'));var deskjs=require(_0x6317('0x11'));var toCsv=require(_0x6317('0xb'));var querystring=require('querystring');var Papa=require(_0x6317('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6317('0x13'));var as=require(_0x6317('0x14'));var hardwareService=require(_0x6317('0x15'));var logger=require(_0x6317('0x16'))(_0x6317('0x17'));var utils=require('../../config/utils');var config=require(_0x6317('0x18'));var licenseUtil=require(_0x6317('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6317('0x1a'));function respondWithStatusCode(_0x3f64fb,_0x4aa69f){_0x4aa69f=_0x4aa69f||0xcc;return function(_0x375498){if(_0x375498){return _0x3f64fb[_0x6317('0x1b')](_0x4aa69f);}return _0x3f64fb['status'](_0x4aa69f)[_0x6317('0x1c')]();};}function respondWithResult(_0x1fba31,_0x32ad4a){_0x32ad4a=_0x32ad4a||0xc8;return function(_0x42f2f8){if(_0x42f2f8){return _0x1fba31[_0x6317('0x1d')](_0x32ad4a)['json'](_0x42f2f8);}};}function respondWithFilteredResult(_0x54e857,_0x560b77){return function(_0x1b42b3){if(_0x1b42b3){var _0x55b86a=typeof _0x560b77['offset']===_0x6317('0x1e')&&typeof _0x560b77['limit']==='undefined';var _0x35caff=_0x1b42b3[_0x6317('0x1f')];var _0x4ad386=_0x55b86a?0x0:_0x560b77[_0x6317('0x20')];var _0x519851=_0x55b86a?_0x1b42b3[_0x6317('0x1f')]:_0x560b77[_0x6317('0x20')]+_0x560b77[_0x6317('0x21')];var _0x3e4332;if(_0x519851>=_0x35caff){_0x519851=_0x35caff;_0x3e4332=0xc8;}else{_0x3e4332=0xce;}_0x54e857['status'](_0x3e4332);return _0x54e857[_0x6317('0x22')](_0x6317('0x23'),_0x4ad386+'-'+_0x519851+'/'+_0x35caff)[_0x6317('0x24')](_0x1b42b3);}return null;};}function patchUpdates(_0x3687d1){return function(_0x18e081){try{jsonpatch[_0x6317('0x25')](_0x18e081,_0x3687d1,!![]);}catch(_0x8ba880){return BPromise[_0x6317('0x26')](_0x8ba880);}return _0x18e081[_0x6317('0x27')]();};}function saveUpdates(_0x1e9b7e,_0x4b8b11){return function(_0x2bb861){if(_0x2bb861){return _0x2bb861['update'](_0x1e9b7e)[_0x6317('0x28')](function(_0x4a2e3e){return _0x4a2e3e;});}return null;};}function removeEntity(_0x2b7669,_0x2a36ee){return function(_0x2ef902){if(_0x2ef902){return _0x2ef902[_0x6317('0x29')]()[_0x6317('0x28')](function(){_0x2b7669['status'](0xcc)[_0x6317('0x1c')]();});}};}function handleEntityNotFound(_0x14b136,_0x4db284){return function(_0x57739a){if(!_0x57739a){_0x14b136[_0x6317('0x1b')](0x194);}return _0x57739a;};}function handleError(_0x2b4416,_0x2ca4e7){_0x2ca4e7=_0x2ca4e7||0x1f4;return function(_0x329543){logger[_0x6317('0x2a')](_0x329543[_0x6317('0x2b')]);if(_0x329543[_0x6317('0x2c')]){delete _0x329543['name'];}_0x2b4416[_0x6317('0x1d')](_0x2ca4e7)[_0x6317('0x2d')](_0x329543);};}exports[_0x6317('0x2e')]=function(_0x5538d8,_0x343e56){var _0x1a3f96={},_0x5b3f8f={},_0x4e1a27={'count':0x0,'rows':[]};var _0x642246=_[_0x6317('0x2f')](db['FreshdeskAccount'][_0x6317('0x30')],function(_0x1fd2ff){return{'name':_0x1fd2ff[_0x6317('0x31')],'type':_0x1fd2ff[_0x6317('0x32')][_0x6317('0x33')]};});_0x5b3f8f[_0x6317('0x34')]=_[_0x6317('0x2f')](_0x642246,_0x6317('0x2c'));_0x5b3f8f[_0x6317('0x35')]=_[_0x6317('0x36')](_0x5538d8[_0x6317('0x35')]);_0x5b3f8f[_0x6317('0x37')]=_['intersection'](_0x5b3f8f[_0x6317('0x34')],_0x5b3f8f['query']);_0x1a3f96[_0x6317('0x38')]=_[_0x6317('0x39')](_0x5b3f8f[_0x6317('0x34')],qs[_0x6317('0x3a')](_0x5538d8[_0x6317('0x35')][_0x6317('0x3a')]));_0x1a3f96[_0x6317('0x38')]=_0x1a3f96[_0x6317('0x38')][_0x6317('0x3b')]?_0x1a3f96[_0x6317('0x38')]:_0x5b3f8f[_0x6317('0x34')];if(!_0x5538d8['query'][_0x6317('0x3c')](_0x6317('0x3d'))){_0x1a3f96[_0x6317('0x21')]=qs[_0x6317('0x21')](_0x5538d8[_0x6317('0x35')][_0x6317('0x21')]);_0x1a3f96[_0x6317('0x20')]=qs[_0x6317('0x20')](_0x5538d8['query'][_0x6317('0x20')]);}_0x1a3f96[_0x6317('0x3e')]=qs['sort'](_0x5538d8[_0x6317('0x35')][_0x6317('0x3f')]);_0x1a3f96[_0x6317('0x40')]=qs[_0x6317('0x37')](_['pick'](_0x5538d8[_0x6317('0x35')],_0x5b3f8f[_0x6317('0x37')]),_0x642246);if(_0x5538d8['query'][_0x6317('0x41')]){_0x1a3f96[_0x6317('0x40')]=_[_0x6317('0x42')](_0x1a3f96[_0x6317('0x40')],{'$or':_[_0x6317('0x2f')](_0x642246,function(_0x2296a3){if(_0x2296a3[_0x6317('0x32')]!=='VIRTUAL'){var _0x5336bd={};_0x5336bd[_0x2296a3[_0x6317('0x2c')]]={'$like':'%'+_0x5538d8[_0x6317('0x35')][_0x6317('0x41')]+'%'};return _0x5336bd;}})});}_0x1a3f96=_[_0x6317('0x42')]({},_0x1a3f96,_0x5538d8['options']);var _0x155669={'where':_0x1a3f96[_0x6317('0x40')]};return db[_0x6317('0x43')][_0x6317('0x1f')](_0x155669)[_0x6317('0x28')](function(_0x4879e6){_0x4e1a27[_0x6317('0x1f')]=_0x4879e6;if(_0x5538d8[_0x6317('0x35')][_0x6317('0x44')]){_0x1a3f96[_0x6317('0x45')]=[{'all':!![]}];}return db[_0x6317('0x43')]['findAll'](_0x1a3f96);})[_0x6317('0x28')](function(_0x9fd484){_0x4e1a27['rows']=_0x9fd484;return _0x4e1a27;})[_0x6317('0x28')](respondWithFilteredResult(_0x343e56,_0x1a3f96))[_0x6317('0x46')](handleError(_0x343e56,null));};exports[_0x6317('0x47')]=function(_0x81bea6,_0x2d3690){var _0x282240={'raw':![],'where':{'id':_0x81bea6[_0x6317('0x48')]['id']}},_0x31a704={};_0x31a704[_0x6317('0x34')]=_[_0x6317('0x36')](db[_0x6317('0x43')]['rawAttributes']);_0x31a704[_0x6317('0x35')]=_['keys'](_0x81bea6[_0x6317('0x35')]);_0x31a704[_0x6317('0x37')]=_[_0x6317('0x39')](_0x31a704[_0x6317('0x34')],_0x31a704[_0x6317('0x35')]);_0x282240[_0x6317('0x38')]=_[_0x6317('0x39')](_0x31a704[_0x6317('0x34')],qs[_0x6317('0x3a')](_0x81bea6[_0x6317('0x35')][_0x6317('0x3a')]));_0x282240[_0x6317('0x38')]=_0x282240[_0x6317('0x38')][_0x6317('0x3b')]?_0x282240[_0x6317('0x38')]:_0x31a704[_0x6317('0x34')];if(_0x81bea6['query'][_0x6317('0x44')]){_0x282240[_0x6317('0x45')]=[{'all':!![]}];}_0x282240=_[_0x6317('0x42')]({},_0x282240,_0x81bea6['options']);return db['FreshdeskAccount'][_0x6317('0x49')](_0x282240)[_0x6317('0x28')](handleEntityNotFound(_0x2d3690,null))['then'](respondWithResult(_0x2d3690,null))[_0x6317('0x46')](handleError(_0x2d3690,null));};exports[_0x6317('0x4a')]=function(_0x6ff69c,_0x4b3efb){return db[_0x6317('0x43')][_0x6317('0x4a')](_0x6ff69c[_0x6317('0x4b')],{})[_0x6317('0x28')](respondWithResult(_0x4b3efb,0xc9))[_0x6317('0x46')](handleError(_0x4b3efb,null));};exports[_0x6317('0x4c')]=function(_0x238e59,_0x3fe735){if(_0x238e59['body']['id']){delete _0x238e59['body']['id'];}return db[_0x6317('0x43')][_0x6317('0x49')]({'where':{'id':_0x238e59['params']['id']}})['then'](handleEntityNotFound(_0x3fe735,null))['then'](saveUpdates(_0x238e59[_0x6317('0x4b')],null))[_0x6317('0x28')](respondWithResult(_0x3fe735,null))[_0x6317('0x46')](handleError(_0x3fe735,null));};exports[_0x6317('0x29')]=function(_0x37b673,_0x1403a4){return db[_0x6317('0x43')][_0x6317('0x49')]({'where':{'id':_0x37b673[_0x6317('0x48')]['id']}})[_0x6317('0x28')](handleEntityNotFound(_0x1403a4,null))[_0x6317('0x28')](removeEntity(_0x1403a4,null))[_0x6317('0x46')](handleError(_0x1403a4,null));};exports[_0x6317('0x4d')]=function(_0x92e80d,_0x27db7b,_0x364700){var _0x3df23d={};var _0x4b2d79={};var _0x34fb93;var _0x55554b;return db[_0x6317('0x43')][_0x6317('0x4e')]({'where':{'id':_0x92e80d['params']['id']}})[_0x6317('0x28')](handleEntityNotFound(_0x27db7b,null))[_0x6317('0x28')](function(_0xdf561f){if(_0xdf561f){_0x34fb93=_0xdf561f;_0x4b2d79[_0x6317('0x34')]=_[_0x6317('0x36')](db[_0x6317('0x4f')]['rawAttributes']);_0x4b2d79['query']=_[_0x6317('0x36')](_0x92e80d[_0x6317('0x35')]);_0x4b2d79[_0x6317('0x37')]=_[_0x6317('0x39')](_0x4b2d79[_0x6317('0x34')],_0x4b2d79[_0x6317('0x35')]);_0x3df23d['attributes']=_['intersection'](_0x4b2d79['model'],qs[_0x6317('0x3a')](_0x92e80d['query'][_0x6317('0x3a')]));_0x3df23d['attributes']=_0x3df23d['attributes'][_0x6317('0x3b')]?_0x3df23d['attributes']:_0x4b2d79[_0x6317('0x34')];_0x3df23d[_0x6317('0x3e')]=qs['sort'](_0x92e80d[_0x6317('0x35')][_0x6317('0x3f')]);_0x3df23d[_0x6317('0x40')]=qs[_0x6317('0x37')](_[_0x6317('0x50')](_0x92e80d[_0x6317('0x35')],_0x4b2d79[_0x6317('0x37')]));if(_0x92e80d[_0x6317('0x35')][_0x6317('0x41')]){_0x3df23d['where']=_['merge'](_0x3df23d[_0x6317('0x40')],{'$or':_['map'](_0x3df23d[_0x6317('0x38')],function(_0x46581b){var _0x17c34c={};_0x17c34c[_0x46581b]={'$like':'%'+_0x92e80d[_0x6317('0x35')][_0x6317('0x41')]+'%'};return _0x17c34c;})});}_0x3df23d=_[_0x6317('0x42')]({},_0x3df23d,_0x92e80d[_0x6317('0x51')]);return _0x34fb93[_0x6317('0x4d')](_0x3df23d);}})[_0x6317('0x28')](function(_0x348265){if(_0x348265){_0x55554b=_0x348265[_0x6317('0x3b')];if(!_0x92e80d[_0x6317('0x35')][_0x6317('0x3c')](_0x6317('0x3d'))){_0x3df23d[_0x6317('0x21')]=qs[_0x6317('0x21')](_0x92e80d[_0x6317('0x35')][_0x6317('0x21')]);_0x3df23d[_0x6317('0x20')]=qs[_0x6317('0x20')](_0x92e80d[_0x6317('0x35')]['offset']);}return _0x34fb93[_0x6317('0x4d')](_0x3df23d);}})[_0x6317('0x28')](function(_0x90ebc){if(_0x90ebc){return _0x90ebc?{'count':_0x55554b,'rows':_0x90ebc}:null;}})[_0x6317('0x28')](respondWithResult(_0x27db7b,null))['catch'](handleError(_0x27db7b,null));};exports['addConfiguration']=function(_0x5f4b35,_0xd9ea92,_0x49df77){if(_0x5f4b35[_0x6317('0x4b')]['id']){delete _0x5f4b35[_0x6317('0x4b')]['id'];}return db['FreshdeskAccount'][_0x6317('0x4e')]({'where':{'id':_0x5f4b35[_0x6317('0x48')]['id']}})[_0x6317('0x28')](handleEntityNotFound(_0xd9ea92,null))[_0x6317('0x28')](function(_0x4c06cb){if(_0x4c06cb){_0x5f4b35[_0x6317('0x4b')][_0x6317('0x52')]=_0x4c06cb['id'];_0x5f4b35[_0x6317('0x4b')][_0x6317('0x53')]=integrations[_0x6317('0x54')](_0x5f4b35[_0x6317('0x4b')][_0x6317('0x55')],_0x5f4b35[_0x6317('0x4b')][_0x6317('0x32')]);_0x5f4b35[_0x6317('0x4b')]['Descriptions']=integrations[_0x6317('0x56')](_0x5f4b35['body'][_0x6317('0x55')],_0x5f4b35[_0x6317('0x4b')][_0x6317('0x32')]);return db[_0x6317('0x4f')][_0x6317('0x4a')](_0x5f4b35[_0x6317('0x4b')],{'include':[{'model':db[_0x6317('0x57')],'as':_0x6317('0x53')},{'model':db[_0x6317('0x57')],'as':_0x6317('0x58')}]});}return null;})[_0x6317('0x28')](respondWithResult(_0xd9ea92,null))[_0x6317('0x46')](handleError(_0xd9ea92,null));};exports[_0x6317('0x59')]=function(_0x52fada,_0x3b85b1,_0x4f0fea){var _0x460e20='';return db[_0x6317('0x43')]['findOne']({'where':{'id':_0x52fada[_0x6317('0x48')]['id']},'attributes':['id','remoteUri',_0x6317('0x5a')]})[_0x6317('0x28')](handleEntityNotFound(_0x3b85b1,null))[_0x6317('0x28')](function(_0x4495de){if(_0x4495de){_0x460e20=_0x4495de['remoteUri'];var _0x4c17c8=_0x460e20['slice'](-0x1);if(_0x4c17c8==='/'){_0x460e20=_0x460e20[_0x6317('0x5b')](0x0,_0x460e20[_0x6317('0x5c')](_0x4c17c8));}return rp({'method':_0x6317('0x5d'),'uri':util['format']('%s/%s',_0x460e20,_0x6317('0x5e')),'headers':{'Authorization':util[_0x6317('0x5f')](_0x6317('0x60'),new Buffer(util[_0x6317('0x5f')](_0x6317('0x61'),_0x4495de['apiKey']))[_0x6317('0x62')]('base64'))},'json':!![]});}})['then'](function(_0x1ea3b0){if(_0x1ea3b0){var _0x3bf3c0=[_0x6317('0x63'),_0x6317('0x64'),_0x6317('0x65'),_0x6317('0x66'),_0x6317('0x1d'),_0x6317('0x67'),_0x6317('0x68'),_0x6317('0x69'),_0x6317('0x6a'),'group',_0x6317('0x6b')];_['remove'](_0x1ea3b0,function(_0x245582){return _0x3bf3c0[_0x6317('0x6c')](_0x245582[_0x6317('0x2c')])||!_0x245582[_0x6317('0x6d')]&&_0x245582[_0x6317('0x32')]!=='custom_text'&&_0x245582[_0x6317('0x32')]!==_0x6317('0x6e');});return{'count':_0x1ea3b0[_0x6317('0x3b')],'rows':_[_0x6317('0x2f')](_0x1ea3b0,function(_0x396df1){return{'id':_0x396df1['name'],'name':_0x396df1[_0x6317('0x6f')],'custom':!_0x396df1[_0x6317('0x6d')],'options':_0x396df1[_0x6317('0x70')]?_[_0x6317('0x2f')](_0x396df1[_0x6317('0x70')],function(_0xf3fa70){return{'name':_[_0x6317('0x71')](_0xf3fa70),'value':_0xf3fa70};}):[]};})};}})['then'](respondWithResult(_0x3b85b1,null))[_0x6317('0x46')](function(_0x255905){var _0x58b01d=_0x52fada[_0x6317('0x35')]['test']?0x1f4:_0x255905['statusCode']||0x1f4;logger[_0x6317('0x2a')](_0x6317('0x72'),'getFields',_0x58b01d,JSON['stringify'](_0x255905));delete _0x255905[_0x6317('0x2c')];if(_0x58b01d===0x191){_0x58b01d=0x190;}_0x3b85b1[_0x6317('0x1d')](_0x58b01d)[_0x6317('0x2d')](_0x52fada[_0x6317('0x35')][_0x6317('0x73')]?{'message':_0x6317('0x74'),'statusCode':_0x255905[_0x6317('0x75')]}:_0x255905);});}; \ No newline at end of file +var _0x6f54=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','map','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','FreshdeskAccount','includeAll','include','rows','catch','show','params','intersection','find','create','body','findOne','FreshdeskConfiguration','rawAttributes','pick','nolimit','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshdeskField','getFields','apiKey','remoteUri','GET','format','%s:X','toString','base64','requester','subject','description','priority','group','source','company','remove','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f54,0xcf));var _0x46f5=function(_0x449f41,_0x2339b8){_0x449f41=_0x449f41-0x0;var _0x4730cb=_0x6f54[_0x449f41];return _0x4730cb;};'use strict';var emlformat=require(_0x46f5('0x0'));var rimraf=require(_0x46f5('0x1'));var zipdir=require(_0x46f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x46f5('0x3'));var BPromise=require(_0x46f5('0x4'));var Mustache=require(_0x46f5('0x5'));var util=require(_0x46f5('0x6'));var path=require('path');var sox=require(_0x46f5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46f5('0x8'));var _=require('lodash');var squel=require(_0x46f5('0x9'));var crypto=require(_0x46f5('0xa'));var jsforce=require(_0x46f5('0xb'));var deskjs=require(_0x46f5('0xc'));var toCsv=require(_0x46f5('0xd'));var querystring=require(_0x46f5('0xe'));var Papa=require(_0x46f5('0xf'));var Redis=require(_0x46f5('0x10'));var authService=require(_0x46f5('0x11'));var qs=require(_0x46f5('0x12'));var as=require(_0x46f5('0x13'));var hardwareService=require(_0x46f5('0x14'));var logger=require(_0x46f5('0x15'))(_0x46f5('0x16'));var utils=require('../../config/utils');var config=require(_0x46f5('0x17'));var licenseUtil=require(_0x46f5('0x18'));var db=require(_0x46f5('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x138e02,_0x9741d5){_0x9741d5=_0x9741d5||0xcc;return function(_0x48783a){if(_0x48783a){return _0x138e02[_0x46f5('0x1a')](_0x9741d5);}return _0x138e02[_0x46f5('0x1b')](_0x9741d5)[_0x46f5('0x1c')]();};}function respondWithResult(_0x1190fc,_0x51a90a){_0x51a90a=_0x51a90a||0xc8;return function(_0x4ca477){if(_0x4ca477){return _0x1190fc[_0x46f5('0x1b')](_0x51a90a)[_0x46f5('0x1d')](_0x4ca477);}};}function respondWithFilteredResult(_0x52674d,_0xd57cc6){return function(_0x3960e6){if(_0x3960e6){var _0x2c4e13=typeof _0xd57cc6[_0x46f5('0x1e')]===_0x46f5('0x1f')&&typeof _0xd57cc6[_0x46f5('0x20')]===_0x46f5('0x1f');var _0x3bdebc=_0x3960e6['count'];var _0x444d51=_0x2c4e13?0x0:_0xd57cc6[_0x46f5('0x1e')];var _0x3c3e48=_0x2c4e13?_0x3960e6[_0x46f5('0x21')]:_0xd57cc6['offset']+_0xd57cc6[_0x46f5('0x20')];var _0x33bb7c;if(_0x3c3e48>=_0x3bdebc){_0x3c3e48=_0x3bdebc;_0x33bb7c=0xc8;}else{_0x33bb7c=0xce;}_0x52674d[_0x46f5('0x1b')](_0x33bb7c);return _0x52674d[_0x46f5('0x22')](_0x46f5('0x23'),_0x444d51+'-'+_0x3c3e48+'/'+_0x3bdebc)[_0x46f5('0x1d')](_0x3960e6);}return null;};}function patchUpdates(_0x58195a){return function(_0x227818){try{jsonpatch[_0x46f5('0x24')](_0x227818,_0x58195a,!![]);}catch(_0xb329aa){return BPromise[_0x46f5('0x25')](_0xb329aa);}return _0x227818['save']();};}function saveUpdates(_0x5d52bf,_0x362033){return function(_0x36e2e4){if(_0x36e2e4){return _0x36e2e4[_0x46f5('0x26')](_0x5d52bf)[_0x46f5('0x27')](function(_0x52e610){return _0x52e610;});}return null;};}function removeEntity(_0x4c6e30,_0x2993f6){return function(_0x4bc3ca){if(_0x4bc3ca){return _0x4bc3ca[_0x46f5('0x28')]()[_0x46f5('0x27')](function(){_0x4c6e30['status'](0xcc)[_0x46f5('0x1c')]();});}};}function handleEntityNotFound(_0x1aa8ff,_0x21374d){return function(_0x20d798){if(!_0x20d798){_0x1aa8ff['sendStatus'](0x194);}return _0x20d798;};}function handleError(_0x5ec5d7,_0x257918){_0x257918=_0x257918||0x1f4;return function(_0x35a136){logger['error'](_0x35a136['stack']);if(_0x35a136[_0x46f5('0x29')]){delete _0x35a136[_0x46f5('0x29')];}_0x5ec5d7[_0x46f5('0x1b')](_0x257918)['send'](_0x35a136);};}exports['index']=function(_0x524c98,_0x9a9a9e){var _0x133a78={},_0x42837f={},_0x54524b={'count':0x0,'rows':[]};var _0x281eec=_[_0x46f5('0x2a')](db['FreshdeskAccount']['rawAttributes'],function(_0x36a4bb){return{'name':_0x36a4bb[_0x46f5('0x2b')],'type':_0x36a4bb[_0x46f5('0x2c')][_0x46f5('0x2d')]};});_0x42837f[_0x46f5('0x2e')]=_['map'](_0x281eec,_0x46f5('0x29'));_0x42837f[_0x46f5('0x2f')]=_[_0x46f5('0x30')](_0x524c98['query']);_0x42837f['filters']=_['intersection'](_0x42837f[_0x46f5('0x2e')],_0x42837f[_0x46f5('0x2f')]);_0x133a78[_0x46f5('0x31')]=_['intersection'](_0x42837f[_0x46f5('0x2e')],qs[_0x46f5('0x32')](_0x524c98['query'][_0x46f5('0x32')]));_0x133a78[_0x46f5('0x31')]=_0x133a78[_0x46f5('0x31')][_0x46f5('0x33')]?_0x133a78['attributes']:_0x42837f[_0x46f5('0x2e')];if(!_0x524c98['query'][_0x46f5('0x34')]('nolimit')){_0x133a78[_0x46f5('0x20')]=qs[_0x46f5('0x20')](_0x524c98[_0x46f5('0x2f')]['limit']);_0x133a78[_0x46f5('0x1e')]=qs[_0x46f5('0x1e')](_0x524c98[_0x46f5('0x2f')][_0x46f5('0x1e')]);}_0x133a78[_0x46f5('0x35')]=qs['sort'](_0x524c98[_0x46f5('0x2f')][_0x46f5('0x36')]);_0x133a78[_0x46f5('0x37')]=qs[_0x46f5('0x38')](_['pick'](_0x524c98[_0x46f5('0x2f')],_0x42837f[_0x46f5('0x38')]),_0x281eec);if(_0x524c98[_0x46f5('0x2f')]['filter']){_0x133a78[_0x46f5('0x37')]=_[_0x46f5('0x39')](_0x133a78[_0x46f5('0x37')],{'$or':_[_0x46f5('0x2a')](_0x281eec,function(_0x1ee878){if(_0x1ee878['type']!==_0x46f5('0x3a')){var _0x2d94b6={};_0x2d94b6[_0x1ee878[_0x46f5('0x29')]]={'$like':'%'+_0x524c98[_0x46f5('0x2f')][_0x46f5('0x3b')]+'%'};return _0x2d94b6;}})});}_0x133a78=_[_0x46f5('0x39')]({},_0x133a78,_0x524c98[_0x46f5('0x3c')]);var _0x9d30ba={'where':_0x133a78['where']};return db[_0x46f5('0x3d')][_0x46f5('0x21')](_0x9d30ba)['then'](function(_0xc9c935){_0x54524b[_0x46f5('0x21')]=_0xc9c935;if(_0x524c98[_0x46f5('0x2f')][_0x46f5('0x3e')]){_0x133a78[_0x46f5('0x3f')]=[{'all':!![]}];}return db[_0x46f5('0x3d')]['findAll'](_0x133a78);})[_0x46f5('0x27')](function(_0x4b3420){_0x54524b[_0x46f5('0x40')]=_0x4b3420;return _0x54524b;})['then'](respondWithFilteredResult(_0x9a9a9e,_0x133a78))[_0x46f5('0x41')](handleError(_0x9a9a9e,null));};exports[_0x46f5('0x42')]=function(_0x1ee125,_0xdc5f8a){var _0x53cb12={'raw':![],'where':{'id':_0x1ee125[_0x46f5('0x43')]['id']}},_0x1c4b6f={};_0x1c4b6f[_0x46f5('0x2e')]=_[_0x46f5('0x30')](db[_0x46f5('0x3d')]['rawAttributes']);_0x1c4b6f[_0x46f5('0x2f')]=_[_0x46f5('0x30')](_0x1ee125[_0x46f5('0x2f')]);_0x1c4b6f['filters']=_['intersection'](_0x1c4b6f['model'],_0x1c4b6f[_0x46f5('0x2f')]);_0x53cb12[_0x46f5('0x31')]=_[_0x46f5('0x44')](_0x1c4b6f[_0x46f5('0x2e')],qs[_0x46f5('0x32')](_0x1ee125[_0x46f5('0x2f')][_0x46f5('0x32')]));_0x53cb12[_0x46f5('0x31')]=_0x53cb12[_0x46f5('0x31')][_0x46f5('0x33')]?_0x53cb12['attributes']:_0x1c4b6f[_0x46f5('0x2e')];if(_0x1ee125['query'][_0x46f5('0x3e')]){_0x53cb12['include']=[{'all':!![]}];}_0x53cb12=_['merge']({},_0x53cb12,_0x1ee125[_0x46f5('0x3c')]);return db[_0x46f5('0x3d')][_0x46f5('0x45')](_0x53cb12)['then'](handleEntityNotFound(_0xdc5f8a,null))[_0x46f5('0x27')](respondWithResult(_0xdc5f8a,null))[_0x46f5('0x41')](handleError(_0xdc5f8a,null));};exports[_0x46f5('0x46')]=function(_0x45e72d,_0x5832ee){return db[_0x46f5('0x3d')][_0x46f5('0x46')](_0x45e72d[_0x46f5('0x47')],{})['then'](respondWithResult(_0x5832ee,0xc9))[_0x46f5('0x41')](handleError(_0x5832ee,null));};exports[_0x46f5('0x26')]=function(_0x276192,_0x27a5c9){if(_0x276192[_0x46f5('0x47')]['id']){delete _0x276192[_0x46f5('0x47')]['id'];}return db[_0x46f5('0x3d')][_0x46f5('0x45')]({'where':{'id':_0x276192[_0x46f5('0x43')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x27a5c9,null))['then'](saveUpdates(_0x276192['body'],null))[_0x46f5('0x27')](respondWithResult(_0x27a5c9,null))['catch'](handleError(_0x27a5c9,null));};exports[_0x46f5('0x28')]=function(_0x41445a,_0x5305e9){return db[_0x46f5('0x3d')][_0x46f5('0x45')]({'where':{'id':_0x41445a[_0x46f5('0x43')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x5305e9,null))[_0x46f5('0x27')](removeEntity(_0x5305e9,null))[_0x46f5('0x41')](handleError(_0x5305e9,null));};exports['getConfigurations']=function(_0x19a8b8,_0x8c66e0,_0x110ac1){var _0x3ed08d={};var _0x1096ce={};var _0x3b3516;var _0x5e26c6;return db['FreshdeskAccount'][_0x46f5('0x48')]({'where':{'id':_0x19a8b8[_0x46f5('0x43')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x8c66e0,null))['then'](function(_0x4e3932){if(_0x4e3932){_0x3b3516=_0x4e3932;_0x1096ce[_0x46f5('0x2e')]=_['keys'](db[_0x46f5('0x49')][_0x46f5('0x4a')]);_0x1096ce[_0x46f5('0x2f')]=_[_0x46f5('0x30')](_0x19a8b8[_0x46f5('0x2f')]);_0x1096ce['filters']=_[_0x46f5('0x44')](_0x1096ce[_0x46f5('0x2e')],_0x1096ce['query']);_0x3ed08d[_0x46f5('0x31')]=_[_0x46f5('0x44')](_0x1096ce[_0x46f5('0x2e')],qs[_0x46f5('0x32')](_0x19a8b8['query'][_0x46f5('0x32')]));_0x3ed08d[_0x46f5('0x31')]=_0x3ed08d[_0x46f5('0x31')][_0x46f5('0x33')]?_0x3ed08d[_0x46f5('0x31')]:_0x1096ce[_0x46f5('0x2e')];_0x3ed08d[_0x46f5('0x35')]=qs['sort'](_0x19a8b8[_0x46f5('0x2f')]['sort']);_0x3ed08d['where']=qs['filters'](_[_0x46f5('0x4b')](_0x19a8b8[_0x46f5('0x2f')],_0x1096ce['filters']));if(_0x19a8b8[_0x46f5('0x2f')]['filter']){_0x3ed08d[_0x46f5('0x37')]=_['merge'](_0x3ed08d[_0x46f5('0x37')],{'$or':_[_0x46f5('0x2a')](_0x3ed08d[_0x46f5('0x31')],function(_0x37cdf5){var _0xef1705={};_0xef1705[_0x37cdf5]={'$like':'%'+_0x19a8b8['query'][_0x46f5('0x3b')]+'%'};return _0xef1705;})});}_0x3ed08d=_['merge']({},_0x3ed08d,_0x19a8b8[_0x46f5('0x3c')]);return _0x3b3516['getConfigurations'](_0x3ed08d);}})['then'](function(_0x1ea05e){if(_0x1ea05e){_0x5e26c6=_0x1ea05e['length'];if(!_0x19a8b8['query'][_0x46f5('0x34')](_0x46f5('0x4c'))){_0x3ed08d['limit']=qs['limit'](_0x19a8b8['query'][_0x46f5('0x20')]);_0x3ed08d[_0x46f5('0x1e')]=qs[_0x46f5('0x1e')](_0x19a8b8[_0x46f5('0x2f')][_0x46f5('0x1e')]);}return _0x3b3516[_0x46f5('0x4d')](_0x3ed08d);}})['then'](function(_0x12964b){if(_0x12964b){return _0x12964b?{'count':_0x5e26c6,'rows':_0x12964b}:null;}})[_0x46f5('0x27')](respondWithResult(_0x8c66e0,null))[_0x46f5('0x41')](handleError(_0x8c66e0,null));};exports[_0x46f5('0x4e')]=function(_0x4aea72,_0x3d06fb,_0x53adf2){if(_0x4aea72[_0x46f5('0x47')]['id']){delete _0x4aea72[_0x46f5('0x47')]['id'];}return db[_0x46f5('0x3d')]['findOne']({'where':{'id':_0x4aea72[_0x46f5('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d06fb,null))['then'](function(_0x1e0bbb){if(_0x1e0bbb){_0x4aea72['body'][_0x46f5('0x4f')]=_0x1e0bbb['id'];_0x4aea72[_0x46f5('0x47')]['Subjects']=integrations[_0x46f5('0x50')](_0x4aea72[_0x46f5('0x47')][_0x46f5('0x51')],_0x4aea72[_0x46f5('0x47')][_0x46f5('0x2c')]);_0x4aea72[_0x46f5('0x47')][_0x46f5('0x52')]=integrations[_0x46f5('0x53')](_0x4aea72[_0x46f5('0x47')][_0x46f5('0x51')],_0x4aea72[_0x46f5('0x47')][_0x46f5('0x2c')]);return db['FreshdeskConfiguration']['create'](_0x4aea72[_0x46f5('0x47')],{'include':[{'model':db['FreshdeskField'],'as':_0x46f5('0x54')},{'model':db[_0x46f5('0x55')],'as':_0x46f5('0x52')}]});}return null;})[_0x46f5('0x27')](respondWithResult(_0x3d06fb,null))['catch'](handleError(_0x3d06fb,null));};exports[_0x46f5('0x56')]=function(_0x3629f7,_0x2b5d5c,_0x2425bb){var _0x16eeea='';return db[_0x46f5('0x3d')]['findOne']({'where':{'id':_0x3629f7['params']['id']},'attributes':['id','remoteUri',_0x46f5('0x57')]})[_0x46f5('0x27')](handleEntityNotFound(_0x2b5d5c,null))[_0x46f5('0x27')](function(_0x37d029){if(_0x37d029){_0x16eeea=_0x37d029[_0x46f5('0x58')];var _0x1c09ec=_0x16eeea['slice'](-0x1);if(_0x1c09ec==='/'){_0x16eeea=_0x16eeea['substring'](0x0,_0x16eeea['lastIndexOf'](_0x1c09ec));}return rp({'method':_0x46f5('0x59'),'uri':util[_0x46f5('0x5a')]('%s/%s',_0x16eeea,'api/v2/ticket_fields'),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x46f5('0x5a')](_0x46f5('0x5b'),_0x37d029[_0x46f5('0x57')]))[_0x46f5('0x5c')](_0x46f5('0x5d')))},'json':!![]});}})[_0x46f5('0x27')](function(_0x3ffc35){if(_0x3ffc35){var _0x2b3c81=[_0x46f5('0x5e'),_0x46f5('0x5f'),'agent',_0x46f5('0x60'),'status',_0x46f5('0x61'),_0x46f5('0x62'),_0x46f5('0x63'),'ticket_type','group',_0x46f5('0x64')];_[_0x46f5('0x65')](_0x3ffc35,function(_0x519efd){return _0x2b3c81['includes'](_0x519efd[_0x46f5('0x29')])||!_0x519efd[_0x46f5('0x66')]&&_0x519efd[_0x46f5('0x2c')]!==_0x46f5('0x67')&&_0x519efd['type']!==_0x46f5('0x68');});return{'count':_0x3ffc35[_0x46f5('0x33')],'rows':_[_0x46f5('0x2a')](_0x3ffc35,function(_0x3c3afd){return{'id':_0x3c3afd[_0x46f5('0x29')],'name':_0x3c3afd[_0x46f5('0x69')],'custom':!_0x3c3afd[_0x46f5('0x66')],'options':_0x3c3afd[_0x46f5('0x6a')]?_[_0x46f5('0x2a')](_0x3c3afd[_0x46f5('0x6a')],function(_0xc9ca14){return{'name':_[_0x46f5('0x6b')](_0xc9ca14),'value':_0xc9ca14};}):[]};})};}})[_0x46f5('0x27')](respondWithResult(_0x2b5d5c,null))[_0x46f5('0x41')](function(_0x2a333c){var _0x310a4c=_0x3629f7[_0x46f5('0x2f')][_0x46f5('0x6c')]?0x1f4:_0x2a333c[_0x46f5('0x6d')]||0x1f4;logger[_0x46f5('0x6e')](_0x46f5('0x6f'),_0x46f5('0x56'),_0x310a4c,JSON[_0x46f5('0x70')](_0x2a333c));delete _0x2a333c[_0x46f5('0x29')];if(_0x310a4c===0x191){_0x310a4c=0x190;}_0x2b5d5c[_0x46f5('0x1b')](_0x310a4c)[_0x46f5('0x71')](_0x3629f7['query'][_0x46f5('0x6c')]?{'message':_0x46f5('0x72'),'statusCode':_0x2a333c[_0x46f5('0x6d')]}:_0x2a333c);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index f3567cd..7935618 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 _0x18c0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x122d9f,_0x2c9e5b){var _0x41a09e=function(_0x3d9564){while(--_0x3d9564){_0x122d9f['push'](_0x122d9f['shift']());}};_0x41a09e(++_0x2c9e5b);}(_0x18c0,0x75));var _0x018c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x18c0[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x018c('0x0'));var util=require(_0x018c('0x1'));var logger=require('../../config/logger')(_0x018c('0x2'));var moment=require(_0x018c('0x3'));var BPromise=require(_0x018c('0x4'));var rp=require(_0x018c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x018c('0x6'));var config=require(_0x018c('0x7'));var attributes=require(_0x018c('0x8'));var integrations=require(_0x018c('0x9'));module['exports']=function(_0xe888e7,_0x435547){return _0xe888e7[_0x018c('0xa')](_0x018c('0xb'),attributes,{'tableName':_0x018c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aa8=['../../config/environment','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api','moment','bluebird','request-promise','path'];(function(_0x5bcddc,_0x288f93){var _0x578229=function(_0x277e20){while(--_0x277e20){_0x5bcddc['push'](_0x5bcddc['shift']());}};_0x578229(++_0x288f93);}(_0x7aa8,0x8a));var _0x87aa=function(_0x185261,_0x1ee9fe){_0x185261=_0x185261-0x0;var _0x20d3e4=_0x7aa8[_0x185261];return _0x20d3e4;};'use strict';var _=require(_0x87aa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x87aa('0x1'));var moment=require(_0x87aa('0x2'));var BPromise=require(_0x87aa('0x3'));var rp=require(_0x87aa('0x4'));var fs=require('fs');var path=require(_0x87aa('0x5'));var rimraf=require('rimraf');var config=require(_0x87aa('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x87aa('0x7'));module[_0x87aa('0x8')]=function(_0x250367,_0x5ce912){return _0x250367[_0x87aa('0x9')](_0x87aa('0xa'),attributes,{'tableName':_0x87aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 1c92d31..ce8f5fb 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 _0xca6a=['map','attributes','catch','find','model','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include'];(function(_0x14e9ff,_0x52a5ea){var _0x4cf3cb=function(_0x46e335){while(--_0x46e335){_0x14e9ff['push'](_0x14e9ff['shift']());}};_0x4cf3cb(++_0x52a5ea);}(_0xca6a,0x17c));var _0xaca6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xca6a[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xaca6('0x0'));var util=require(_0xaca6('0x1'));var moment=require(_0xaca6('0x2'));var BPromise=require(_0xaca6('0x3'));var rs=require(_0xaca6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaca6('0x5'));var logger=require('../../config/logger')(_0xaca6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaca6('0x7')][_0xaca6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c0cb5,_0x17743d,_0x369209){return new BPromise(function(_0x46a10f,_0x21962a){return client['request'](_0x2c0cb5,_0x369209)[_0xaca6('0x9')](function(_0x20059c){logger[_0xaca6('0xa')](_0xaca6('0xb'),_0x17743d,_0xaca6('0xc'));logger[_0xaca6('0xd')](_0xaca6('0xe'),_0x17743d,_0xaca6('0xc'),JSON[_0xaca6('0xf')](_0x20059c));if(_0x20059c[_0xaca6('0x10')]){if(_0x20059c[_0xaca6('0x10')][_0xaca6('0x11')]===0x1f4){logger[_0xaca6('0x10')](_0xaca6('0xb'),_0x17743d,_0x20059c['error'][_0xaca6('0x12')]);return _0x21962a(_0x20059c[_0xaca6('0x10')][_0xaca6('0x12')]);}logger[_0xaca6('0x10')](_0xaca6('0xb'),_0x17743d,_0x20059c[_0xaca6('0x10')]['message']);return _0x46a10f(_0x20059c['error']['message']);}else{logger[_0xaca6('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x17743d,'request\x20sent');_0x46a10f(_0x20059c[_0xaca6('0x13')][_0xaca6('0x12')]);}})['catch'](function(_0x769305){logger[_0xaca6('0x10')](_0xaca6('0xb'),_0x17743d,_0x769305);_0x21962a(_0x769305);});});}exports[_0xaca6('0x14')]=function(_0x35675e){var _0xfb4af3=this;return new Promise(function(_0x35a2cc,_0x5b3671){return db[_0xaca6('0x15')][_0xaca6('0x16')]({'raw':_0x35675e[_0xaca6('0x17')]?_0x35675e[_0xaca6('0x17')][_0xaca6('0x18')]===undefined?!![]:![]:!![],'where':_0x35675e[_0xaca6('0x17')]?_0x35675e[_0xaca6('0x17')][_0xaca6('0x19')]||null:null,'attributes':_0x35675e[_0xaca6('0x17')]?_0x35675e[_0xaca6('0x17')]['attributes']||null:null,'limit':_0x35675e[_0xaca6('0x17')]?_0x35675e[_0xaca6('0x17')][_0xaca6('0x1a')]||null:null,'include':_0x35675e[_0xaca6('0x17')]?_0x35675e[_0xaca6('0x17')][_0xaca6('0x1b')]?_[_0xaca6('0x1c')](_0x35675e[_0xaca6('0x17')][_0xaca6('0x1b')],function(_0x5dd093){return{'model':db[_0x5dd093['model']],'as':_0x5dd093['as'],'attributes':_0x5dd093[_0xaca6('0x1d')],'include':_0x5dd093[_0xaca6('0x1b')]?_[_0xaca6('0x1c')](_0x5dd093[_0xaca6('0x1b')],function(_0x3042d7){return{'model':db[_0x3042d7['model']],'as':_0x3042d7['as'],'attributes':_0x3042d7[_0xaca6('0x1d')],'include':_0x3042d7[_0xaca6('0x1b')]?_[_0xaca6('0x1c')](_0x3042d7[_0xaca6('0x1b')],function(_0x5291c2){return{'model':db[_0x5291c2['model']],'as':_0x5291c2['as'],'attributes':_0x5291c2[_0xaca6('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f8215){logger[_0xaca6('0xa')](_0xaca6('0x14'),_0x35675e);logger[_0xaca6('0xd')](_0xaca6('0x14'),_0x35675e,JSON['stringify'](_0x1f8215));_0x35a2cc(_0x1f8215);})[_0xaca6('0x1e')](function(_0xfc4297){logger['error'](_0xaca6('0x14'),_0xfc4297[_0xaca6('0x12')],_0x35675e);_0x5b3671(_0xfb4af3[_0xaca6('0x10')](0x1f4,_0xfc4297['message']));});});};exports['ShowFreshdeskAccount']=function(_0x5f35fe){var _0x4f2fdb=this;return new Promise(function(_0x286830,_0x3953d2){return db[_0xaca6('0x15')][_0xaca6('0x1f')]({'raw':_0x5f35fe['options']?_0x5f35fe[_0xaca6('0x17')][_0xaca6('0x18')]===undefined?!![]:![]:!![],'where':_0x5f35fe[_0xaca6('0x17')]?_0x5f35fe[_0xaca6('0x17')][_0xaca6('0x19')]||null:null,'attributes':_0x5f35fe['options']?_0x5f35fe[_0xaca6('0x17')][_0xaca6('0x1d')]||null:null,'include':_0x5f35fe[_0xaca6('0x17')]?_0x5f35fe[_0xaca6('0x17')][_0xaca6('0x1b')]?_[_0xaca6('0x1c')](_0x5f35fe[_0xaca6('0x17')][_0xaca6('0x1b')],function(_0x30a52a){return{'model':db[_0x30a52a[_0xaca6('0x20')]],'as':_0x30a52a['as'],'attributes':_0x30a52a['attributes'],'include':_0x30a52a[_0xaca6('0x1b')]?_[_0xaca6('0x1c')](_0x30a52a[_0xaca6('0x1b')],function(_0x4e09ba){return{'model':db[_0x4e09ba[_0xaca6('0x20')]],'as':_0x4e09ba['as'],'attributes':_0x4e09ba['attributes'],'include':_0x4e09ba[_0xaca6('0x1b')]?_['map'](_0x4e09ba[_0xaca6('0x1b')],function(_0x31b6ca){return{'model':db[_0x31b6ca[_0xaca6('0x20')]],'as':_0x31b6ca['as'],'attributes':_0x31b6ca['attributes']};}):[]};}):[]};}):[]:[]})[_0xaca6('0x9')](function(_0x40488f){logger[_0xaca6('0xa')]('ShowFreshdeskAccount',_0x5f35fe);logger[_0xaca6('0xd')]('ShowFreshdeskAccount',_0x5f35fe,JSON[_0xaca6('0xf')](_0x40488f));_0x286830(_0x40488f);})[_0xaca6('0x1e')](function(_0x4c2a30){logger[_0xaca6('0x10')](_0xaca6('0x21'),_0x4c2a30[_0xaca6('0x12')],_0x5f35fe);_0x3953d2(_0x4f2fdb[_0xaca6('0x10')](0x1f4,_0x4c2a30['message']));});});}; \ No newline at end of file +var _0x91a5=['GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','then','catch','ShowFreshdeskAccount','find','raw','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x273542,_0x43fd57){var _0x4655c5=function(_0x1f0771){while(--_0x1f0771){_0x273542['push'](_0x273542['shift']());}};_0x4655c5(++_0x43fd57);}(_0x91a5,0x78));var _0x591a=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0x91a5[_0x435044];return _0x33d4c6;};'use strict';var _=require(_0x591a('0x0'));var util=require('util');var moment=require(_0x591a('0x1'));var BPromise=require(_0x591a('0x2'));var rs=require(_0x591a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x591a('0x4'))(_0x591a('0x5'));var config=require(_0x591a('0x6'));var jayson=require(_0x591a('0x7'));var client=jayson['client'][_0x591a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10dd2e,_0xc97542,_0x149d15){return new BPromise(function(_0x5773d5,_0x25af36){return client[_0x591a('0x9')](_0x10dd2e,_0x149d15)['then'](function(_0x5c43f2){logger[_0x591a('0xa')](_0x591a('0xb'),_0xc97542,_0x591a('0xc'));logger[_0x591a('0xd')](_0x591a('0xe'),_0xc97542,'request\x20sent',JSON[_0x591a('0xf')](_0x5c43f2));if(_0x5c43f2['error']){if(_0x5c43f2['error'][_0x591a('0x10')]===0x1f4){logger[_0x591a('0x11')](_0x591a('0xb'),_0xc97542,_0x5c43f2[_0x591a('0x11')][_0x591a('0x12')]);return _0x25af36(_0x5c43f2['error'][_0x591a('0x12')]);}logger[_0x591a('0x11')](_0x591a('0xb'),_0xc97542,_0x5c43f2[_0x591a('0x11')][_0x591a('0x12')]);return _0x5773d5(_0x5c43f2[_0x591a('0x11')][_0x591a('0x12')]);}else{logger[_0x591a('0xa')](_0x591a('0xb'),_0xc97542,_0x591a('0xc'));_0x5773d5(_0x5c43f2[_0x591a('0x13')]['message']);}})['catch'](function(_0x580f98){logger[_0x591a('0x11')](_0x591a('0xb'),_0xc97542,_0x580f98);_0x25af36(_0x580f98);});});}exports[_0x591a('0x14')]=function(_0x7915a3){var _0x132309=this;return new Promise(function(_0x4b4630,_0x382225){return db[_0x591a('0x15')][_0x591a('0x16')]({'raw':_0x7915a3[_0x591a('0x17')]?_0x7915a3[_0x591a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x7915a3['options']?_0x7915a3[_0x591a('0x17')][_0x591a('0x18')]||null:null,'attributes':_0x7915a3[_0x591a('0x17')]?_0x7915a3[_0x591a('0x17')][_0x591a('0x19')]||null:null,'limit':_0x7915a3['options']?_0x7915a3[_0x591a('0x17')][_0x591a('0x1a')]||null:null,'include':_0x7915a3['options']?_0x7915a3[_0x591a('0x17')][_0x591a('0x1b')]?_[_0x591a('0x1c')](_0x7915a3[_0x591a('0x17')][_0x591a('0x1b')],function(_0x25234d){return{'model':db[_0x25234d[_0x591a('0x1d')]],'as':_0x25234d['as'],'attributes':_0x25234d[_0x591a('0x19')],'include':_0x25234d[_0x591a('0x1b')]?_[_0x591a('0x1c')](_0x25234d[_0x591a('0x1b')],function(_0x42be21){return{'model':db[_0x42be21[_0x591a('0x1d')]],'as':_0x42be21['as'],'attributes':_0x42be21[_0x591a('0x19')],'include':_0x42be21[_0x591a('0x1b')]?_['map'](_0x42be21[_0x591a('0x1b')],function(_0x3f0b5f){return{'model':db[_0x3f0b5f[_0x591a('0x1d')]],'as':_0x3f0b5f['as'],'attributes':_0x3f0b5f[_0x591a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x591a('0x1e')](function(_0x5d3d4f){logger[_0x591a('0xa')](_0x591a('0x14'),_0x7915a3);logger[_0x591a('0xd')](_0x591a('0x14'),_0x7915a3,JSON[_0x591a('0xf')](_0x5d3d4f));_0x4b4630(_0x5d3d4f);})[_0x591a('0x1f')](function(_0x369320){logger[_0x591a('0x11')](_0x591a('0x14'),_0x369320[_0x591a('0x12')],_0x7915a3);_0x382225(_0x132309['error'](0x1f4,_0x369320[_0x591a('0x12')]));});});};exports[_0x591a('0x20')]=function(_0x10e763){var _0x5344f0=this;return new Promise(function(_0x3007fe,_0x4ef160){return db[_0x591a('0x15')][_0x591a('0x21')]({'raw':_0x10e763[_0x591a('0x17')]?_0x10e763['options'][_0x591a('0x22')]===undefined?!![]:![]:!![],'where':_0x10e763[_0x591a('0x17')]?_0x10e763[_0x591a('0x17')][_0x591a('0x18')]||null:null,'attributes':_0x10e763[_0x591a('0x17')]?_0x10e763['options'][_0x591a('0x19')]||null:null,'include':_0x10e763['options']?_0x10e763[_0x591a('0x17')][_0x591a('0x1b')]?_['map'](_0x10e763['options'][_0x591a('0x1b')],function(_0x5092b9){return{'model':db[_0x5092b9[_0x591a('0x1d')]],'as':_0x5092b9['as'],'attributes':_0x5092b9[_0x591a('0x19')],'include':_0x5092b9[_0x591a('0x1b')]?_[_0x591a('0x1c')](_0x5092b9['include'],function(_0x21af30){return{'model':db[_0x21af30['model']],'as':_0x21af30['as'],'attributes':_0x21af30[_0x591a('0x19')],'include':_0x21af30[_0x591a('0x1b')]?_['map'](_0x21af30[_0x591a('0x1b')],function(_0x2e6ed8){return{'model':db[_0x2e6ed8[_0x591a('0x1d')]],'as':_0x2e6ed8['as'],'attributes':_0x2e6ed8[_0x591a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x406ad1){logger['info'](_0x591a('0x20'),_0x10e763);logger[_0x591a('0xd')](_0x591a('0x20'),_0x10e763,JSON[_0x591a('0xf')](_0x406ad1));_0x3007fe(_0x406ad1);})[_0x591a('0x1f')](function(_0x1d1baf){logger[_0x591a('0x11')]('ShowFreshdeskAccount',_0x1d1baf['message'],_0x10e763);_0x4ef160(_0x5344f0[_0x591a('0x11')](0x1f4,_0x1d1baf[_0x591a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d6b4173..0037fd6 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 _0x151b=['getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/tags'];(function(_0x6b7cf8,_0x2f5583){var _0x56332e=function(_0x841956){while(--_0x841956){_0x6b7cf8['push'](_0x6b7cf8['shift']());}};_0x56332e(++_0x2f5583);}(_0x151b,0x1dd));var _0xb151=function(_0x418e49,_0x57a47f){_0x418e49=_0x418e49-0x0;var _0x15e209=_0x151b[_0x418e49];return _0x15e209;};'use strict';var multer=require(_0xb151('0x0'));var util=require(_0xb151('0x1'));var path=require(_0xb151('0x2'));var timeout=require(_0xb151('0x3'));var express=require('express');var router=express[_0xb151('0x4')]();var fs_extra=require(_0xb151('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb151('0x6'));var config=require(_0xb151('0x7'));var controller=require(_0xb151('0x8'));router[_0xb151('0x9')]('/',auth[_0xb151('0xa')](),controller[_0xb151('0xb')]);router[_0xb151('0x9')](_0xb151('0xc'),auth['isAuthenticated'](),controller[_0xb151('0xd')]);router['get'](_0xb151('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xb151('0x9')]('/:id/subjects',auth[_0xb151('0xa')](),controller[_0xb151('0xf')]);router[_0xb151('0x9')]('/:id/descriptions',auth[_0xb151('0xa')](),controller['getDescriptions']);router['get'](_0xb151('0x10'),auth[_0xb151('0xa')](),controller[_0xb151('0x11')]);router[_0xb151('0x12')]('/',auth['isAuthenticated'](),controller[_0xb151('0x13')]);router[_0xb151('0x12')]('/:id/tags',auth['isAuthenticated'](),controller[_0xb151('0x14')]);router[_0xb151('0x15')]('/:id',auth[_0xb151('0xa')](),controller[_0xb151('0x16')]);router[_0xb151('0x17')](_0xb151('0xc'),auth[_0xb151('0xa')](),controller[_0xb151('0x18')]);module[_0xb151('0x19')]=router; \ No newline at end of file +var _0x3be9=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','/:id','update','delete'];(function(_0x5d7e9e,_0x384a1f){var _0x259299=function(_0x5125f1){while(--_0x5125f1){_0x5d7e9e['push'](_0x5d7e9e['shift']());}};_0x259299(++_0x384a1f);}(_0x3be9,0x16e));var _0x93be=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x3be9[_0x49c057];return _0xd8f0e6;};'use strict';var multer=require(_0x93be('0x0'));var util=require(_0x93be('0x1'));var path=require('path');var timeout=require(_0x93be('0x2'));var express=require('express');var router=express[_0x93be('0x3')]();var fs_extra=require(_0x93be('0x4'));var auth=require(_0x93be('0x5'));var interaction=require(_0x93be('0x6'));var config=require(_0x93be('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x93be('0x8')](),controller[_0x93be('0x9')]);router[_0x93be('0xa')]('/:id',auth[_0x93be('0x8')](),controller[_0x93be('0xb')]);router[_0x93be('0xa')](_0x93be('0xc'),auth[_0x93be('0x8')](),controller[_0x93be('0xd')]);router['get'](_0x93be('0xe'),auth[_0x93be('0x8')](),controller[_0x93be('0xf')]);router[_0x93be('0xa')](_0x93be('0x10'),auth[_0x93be('0x8')](),controller[_0x93be('0x11')]);router[_0x93be('0xa')](_0x93be('0x12'),auth['isAuthenticated'](),controller['getTags']);router[_0x93be('0x13')]('/',auth[_0x93be('0x8')](),controller[_0x93be('0x14')]);router[_0x93be('0x13')]('/:id/tags',auth[_0x93be('0x8')](),controller[_0x93be('0x15')]);router[_0x93be('0x16')](_0x93be('0x17'),auth[_0x93be('0x8')](),controller[_0x93be('0x18')]);router[_0x93be('0x19')](_0x93be('0x17'),auth['isAuthenticated'](),controller[_0x93be('0x1a')]);module[_0x93be('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 28480ec..ae3c13e 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 _0x07f3=['sequelize'];(function(_0x3f18cf,_0x1de928){var _0x2e140d=function(_0x4eed56){while(--_0x4eed56){_0x3f18cf['push'](_0x3f18cf['shift']());}};_0x2e140d(++_0x1de928);}(_0x07f3,0x125));var _0x307f=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x07f3[_0x5e709a];return _0x57401a;};'use strict';var Sequelize=require(_0x307f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6233=['exports','STRING'];(function(_0x418fa3,_0x464468){var _0x845083=function(_0x12b8ae){while(--_0x12b8ae){_0x418fa3['push'](_0x418fa3['shift']());}};_0x845083(++_0x464468);}(_0x6233,0x1de));var _0x3623=function(_0x4050ca,_0x3aa295){_0x4050ca=_0x4050ca-0x0;var _0x51b79d=_0x6233[_0x4050ca];return _0x51b79d;};'use strict';var Sequelize=require('sequelize');module[_0x3623('0x0')]={'name':{'type':Sequelize[_0x3623('0x1')]},'description':{'type':Sequelize[_0x3623('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 8cb64fb..d7fb4e7 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 _0x1d4a=['keys','find','catch','create','body','update','params','destroy','findOne','FreshdeskField','order','filter','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','end','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','show'];(function(_0x312abc,_0x17f25c){var _0x314298=function(_0x1d2e48){while(--_0x1d2e48){_0x312abc['push'](_0x312abc['shift']());}};_0x314298(++_0x17f25c);}(_0x1d4a,0x65));var _0xa1d4=function(_0x235703,_0x571b9a){_0x235703=_0x235703-0x0;var _0x940197=_0x1d4a[_0x235703];return _0x940197;};'use strict';var emlformat=require(_0xa1d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1d4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa1d4('0x3'));var path=require(_0xa1d4('0x4'));var sox=require(_0xa1d4('0x5'));var csv=require('to-csv');var ejs=require(_0xa1d4('0x6'));var fs=require('fs');var fs_extra=require(_0xa1d4('0x7'));var _=require(_0xa1d4('0x8'));var squel=require(_0xa1d4('0x9'));var crypto=require(_0xa1d4('0xa'));var jsforce=require(_0xa1d4('0xb'));var deskjs=require(_0xa1d4('0xc'));var toCsv=require(_0xa1d4('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa1d4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1d4('0xf'));var hardwareService=require(_0xa1d4('0x10'));var logger=require('../../config/logger')(_0xa1d4('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1d4('0x12'));var db=require(_0xa1d4('0x13'))['db'];function respondWithStatusCode(_0x3fe5c6,_0xaafba0){_0xaafba0=_0xaafba0||0xcc;return function(_0x81466a){if(_0x81466a){return _0x3fe5c6[_0xa1d4('0x14')](_0xaafba0);}return _0x3fe5c6['status'](_0xaafba0)['end']();};}function respondWithResult(_0x108af0,_0x2dd457){_0x2dd457=_0x2dd457||0xc8;return function(_0x420421){if(_0x420421){return _0x108af0[_0xa1d4('0x15')](_0x2dd457)[_0xa1d4('0x16')](_0x420421);}};}function respondWithFilteredResult(_0x4d28e6,_0x4604b7){return function(_0x2fda7b){if(_0x2fda7b){var _0x439a9b=typeof _0x4604b7['offset']===_0xa1d4('0x17')&&typeof _0x4604b7[_0xa1d4('0x18')]==='undefined';var _0x45dd9e=_0x2fda7b['count'];var _0x6990db=_0x439a9b?0x0:_0x4604b7['offset'];var _0x3603c1=_0x439a9b?_0x2fda7b[_0xa1d4('0x19')]:_0x4604b7[_0xa1d4('0x1a')]+_0x4604b7[_0xa1d4('0x18')];var _0x2a5872;if(_0x3603c1>=_0x45dd9e){_0x3603c1=_0x45dd9e;_0x2a5872=0xc8;}else{_0x2a5872=0xce;}_0x4d28e6['status'](_0x2a5872);return _0x4d28e6[_0xa1d4('0x1b')](_0xa1d4('0x1c'),_0x6990db+'-'+_0x3603c1+'/'+_0x45dd9e)[_0xa1d4('0x16')](_0x2fda7b);}return null;};}function patchUpdates(_0x424d0f){return function(_0x3e98ab){try{jsonpatch[_0xa1d4('0x1d')](_0x3e98ab,_0x424d0f,!![]);}catch(_0x2e1379){return BPromise[_0xa1d4('0x1e')](_0x2e1379);}return _0x3e98ab['save']();};}function saveUpdates(_0x4d8b8a,_0x2a0f54){return function(_0x1f2c1b){if(_0x1f2c1b){return _0x1f2c1b['update'](_0x4d8b8a)['then'](function(_0x350e7){return _0x350e7;});}return null;};}function removeEntity(_0x434328,_0x18d404){return function(_0x34aebc){if(_0x34aebc){return _0x34aebc['destroy']()[_0xa1d4('0x1f')](function(){_0x434328['status'](0xcc)[_0xa1d4('0x20')]();});}};}function handleEntityNotFound(_0x289688,_0x4a511c){return function(_0x1837c8){if(!_0x1837c8){_0x289688[_0xa1d4('0x14')](0x194);}return _0x1837c8;};}function handleError(_0x2609c5,_0x318c6b){_0x318c6b=_0x318c6b||0x1f4;return function(_0x2cd3dd){logger['error'](_0x2cd3dd[_0xa1d4('0x21')]);if(_0x2cd3dd[_0xa1d4('0x22')]){delete _0x2cd3dd['name'];}_0x2609c5[_0xa1d4('0x15')](_0x318c6b)[_0xa1d4('0x23')](_0x2cd3dd);};}exports[_0xa1d4('0x24')]=function(_0x2c6bd2,_0x5eafaf){var _0x42eb93={},_0x4de562={},_0x47c495={'count':0x0,'rows':[]};var _0x3e5284=_[_0xa1d4('0x25')](db[_0xa1d4('0x26')][_0xa1d4('0x27')],function(_0x589035){return{'name':_0x589035[_0xa1d4('0x28')],'type':_0x589035[_0xa1d4('0x29')][_0xa1d4('0x2a')]};});_0x4de562['model']=_['map'](_0x3e5284,_0xa1d4('0x22'));_0x4de562[_0xa1d4('0x2b')]=_['keys'](_0x2c6bd2[_0xa1d4('0x2b')]);_0x4de562[_0xa1d4('0x2c')]=_[_0xa1d4('0x2d')](_0x4de562[_0xa1d4('0x2e')],_0x4de562['query']);_0x42eb93[_0xa1d4('0x2f')]=_[_0xa1d4('0x2d')](_0x4de562[_0xa1d4('0x2e')],qs['fields'](_0x2c6bd2[_0xa1d4('0x2b')][_0xa1d4('0x30')]));_0x42eb93[_0xa1d4('0x2f')]=_0x42eb93[_0xa1d4('0x2f')][_0xa1d4('0x31')]?_0x42eb93[_0xa1d4('0x2f')]:_0x4de562[_0xa1d4('0x2e')];if(!_0x2c6bd2['query'][_0xa1d4('0x32')](_0xa1d4('0x33'))){_0x42eb93[_0xa1d4('0x18')]=qs[_0xa1d4('0x18')](_0x2c6bd2[_0xa1d4('0x2b')][_0xa1d4('0x18')]);_0x42eb93[_0xa1d4('0x1a')]=qs['offset'](_0x2c6bd2[_0xa1d4('0x2b')][_0xa1d4('0x1a')]);}_0x42eb93['order']=qs['sort'](_0x2c6bd2[_0xa1d4('0x2b')][_0xa1d4('0x34')]);_0x42eb93[_0xa1d4('0x35')]=qs[_0xa1d4('0x2c')](_[_0xa1d4('0x36')](_0x2c6bd2[_0xa1d4('0x2b')],_0x4de562[_0xa1d4('0x2c')]),_0x3e5284);if(_0x2c6bd2['query']['filter']){_0x42eb93['where']=_['merge'](_0x42eb93[_0xa1d4('0x35')],{'$or':_['map'](_0x3e5284,function(_0x1daf02){if(_0x1daf02[_0xa1d4('0x29')]!==_0xa1d4('0x37')){var _0x1dd29c={};_0x1dd29c[_0x1daf02['name']]={'$like':'%'+_0x2c6bd2[_0xa1d4('0x2b')]['filter']+'%'};return _0x1dd29c;}})});}_0x42eb93=_[_0xa1d4('0x38')]({},_0x42eb93,_0x2c6bd2[_0xa1d4('0x39')]);var _0x17b63b={'where':_0x42eb93['where']};return db['FreshdeskConfiguration'][_0xa1d4('0x19')](_0x17b63b)[_0xa1d4('0x1f')](function(_0x44ba8b){_0x47c495[_0xa1d4('0x19')]=_0x44ba8b;if(_0x2c6bd2[_0xa1d4('0x2b')][_0xa1d4('0x3a')]){_0x42eb93[_0xa1d4('0x3b')]=[{'all':!![]}];}return db[_0xa1d4('0x26')][_0xa1d4('0x3c')](_0x42eb93);})[_0xa1d4('0x1f')](function(_0x29d8f1){_0x47c495[_0xa1d4('0x3d')]=_0x29d8f1;return _0x47c495;})[_0xa1d4('0x1f')](respondWithFilteredResult(_0x5eafaf,_0x42eb93))['catch'](handleError(_0x5eafaf,null));};exports[_0xa1d4('0x3e')]=function(_0x2a56eb,_0x96274){var _0x23b9d9={'raw':![],'where':{'id':_0x2a56eb['params']['id']}},_0x33e032={};_0x33e032['model']=_[_0xa1d4('0x3f')](db[_0xa1d4('0x26')][_0xa1d4('0x27')]);_0x33e032[_0xa1d4('0x2b')]=_[_0xa1d4('0x3f')](_0x2a56eb[_0xa1d4('0x2b')]);_0x33e032[_0xa1d4('0x2c')]=_[_0xa1d4('0x2d')](_0x33e032[_0xa1d4('0x2e')],_0x33e032[_0xa1d4('0x2b')]);_0x23b9d9['attributes']=_[_0xa1d4('0x2d')](_0x33e032['model'],qs[_0xa1d4('0x30')](_0x2a56eb[_0xa1d4('0x2b')][_0xa1d4('0x30')]));_0x23b9d9[_0xa1d4('0x2f')]=_0x23b9d9[_0xa1d4('0x2f')][_0xa1d4('0x31')]?_0x23b9d9['attributes']:_0x33e032[_0xa1d4('0x2e')];if(_0x2a56eb[_0xa1d4('0x2b')]['includeAll']){_0x23b9d9[_0xa1d4('0x3b')]=[{'all':!![]}];}_0x23b9d9=_['merge']({},_0x23b9d9,_0x2a56eb[_0xa1d4('0x39')]);return db[_0xa1d4('0x26')][_0xa1d4('0x40')](_0x23b9d9)['then'](handleEntityNotFound(_0x96274,null))[_0xa1d4('0x1f')](respondWithResult(_0x96274,null))[_0xa1d4('0x41')](handleError(_0x96274,null));};exports[_0xa1d4('0x42')]=function(_0x11ca66,_0x3b246f){return db[_0xa1d4('0x26')]['create'](_0x11ca66[_0xa1d4('0x43')],{})[_0xa1d4('0x1f')](respondWithResult(_0x3b246f,0xc9))['catch'](handleError(_0x3b246f,null));};exports[_0xa1d4('0x44')]=function(_0x26c381,_0x4f14db){if(_0x26c381[_0xa1d4('0x43')]['id']){delete _0x26c381[_0xa1d4('0x43')]['id'];}return db['FreshdeskConfiguration'][_0xa1d4('0x40')]({'where':{'id':_0x26c381[_0xa1d4('0x45')]['id']}})[_0xa1d4('0x1f')](handleEntityNotFound(_0x4f14db,null))[_0xa1d4('0x1f')](saveUpdates(_0x26c381[_0xa1d4('0x43')],null))[_0xa1d4('0x1f')](respondWithResult(_0x4f14db,null))[_0xa1d4('0x41')](handleError(_0x4f14db,null));};exports[_0xa1d4('0x46')]=function(_0x215568,_0x14aaa1){return db[_0xa1d4('0x26')]['find']({'where':{'id':_0x215568[_0xa1d4('0x45')]['id']}})[_0xa1d4('0x1f')](handleEntityNotFound(_0x14aaa1,null))['then'](removeEntity(_0x14aaa1,null))[_0xa1d4('0x41')](handleError(_0x14aaa1,null));};exports['getFields']=function(_0xdb176c,_0x3ded87,_0x1510ab){var _0xb850e5={};var _0x445aaf={};var _0x8c5615;var _0x23ee1a;return db[_0xa1d4('0x26')][_0xa1d4('0x47')]({'where':{'id':_0xdb176c['params']['id']}})[_0xa1d4('0x1f')](handleEntityNotFound(_0x3ded87,null))[_0xa1d4('0x1f')](function(_0x42282f){if(_0x42282f){_0x8c5615=_0x42282f;_0x445aaf[_0xa1d4('0x2e')]=_[_0xa1d4('0x3f')](db[_0xa1d4('0x48')][_0xa1d4('0x27')]);_0x445aaf[_0xa1d4('0x2b')]=_[_0xa1d4('0x3f')](_0xdb176c[_0xa1d4('0x2b')]);_0x445aaf[_0xa1d4('0x2c')]=_[_0xa1d4('0x2d')](_0x445aaf[_0xa1d4('0x2e')],_0x445aaf['query']);_0xb850e5[_0xa1d4('0x2f')]=_[_0xa1d4('0x2d')](_0x445aaf['model'],qs[_0xa1d4('0x30')](_0xdb176c[_0xa1d4('0x2b')][_0xa1d4('0x30')]));_0xb850e5[_0xa1d4('0x2f')]=_0xb850e5[_0xa1d4('0x2f')][_0xa1d4('0x31')]?_0xb850e5['attributes']:_0x445aaf['model'];_0xb850e5[_0xa1d4('0x49')]=qs[_0xa1d4('0x34')](_0xdb176c[_0xa1d4('0x2b')][_0xa1d4('0x34')]);_0xb850e5[_0xa1d4('0x35')]=qs[_0xa1d4('0x2c')](_['pick'](_0xdb176c[_0xa1d4('0x2b')],_0x445aaf['filters']));if(_0xdb176c[_0xa1d4('0x2b')]['filter']){_0xb850e5['where']=_[_0xa1d4('0x38')](_0xb850e5[_0xa1d4('0x35')],{'$or':_[_0xa1d4('0x25')](_0xb850e5[_0xa1d4('0x2f')],function(_0x17dede){var _0x3b475a={};_0x3b475a[_0x17dede]={'$like':'%'+_0xdb176c[_0xa1d4('0x2b')][_0xa1d4('0x4a')]+'%'};return _0x3b475a;})});}_0xb850e5=_[_0xa1d4('0x38')]({},_0xb850e5,_0xdb176c[_0xa1d4('0x39')]);return _0x8c5615[_0xa1d4('0x4b')](_0xb850e5);}})['then'](function(_0x5808e5){if(_0x5808e5){_0x23ee1a=_0x5808e5['length'];if(!_0xdb176c[_0xa1d4('0x2b')][_0xa1d4('0x32')](_0xa1d4('0x33'))){_0xb850e5['limit']=qs[_0xa1d4('0x18')](_0xdb176c['query'][_0xa1d4('0x18')]);_0xb850e5[_0xa1d4('0x1a')]=qs['offset'](_0xdb176c[_0xa1d4('0x2b')][_0xa1d4('0x1a')]);}return _0x8c5615[_0xa1d4('0x4b')](_0xb850e5);}})['then'](function(_0x3285b7){if(_0x3285b7){return _0x3285b7?{'count':_0x23ee1a,'rows':_0x3285b7}:null;}})['then'](respondWithResult(_0x3ded87,null))[_0xa1d4('0x41')](handleError(_0x3ded87,null));};exports[_0xa1d4('0x4c')]=function(_0x308e86,_0x553213,_0x311bf5){var _0x23dfde={};var _0x33ed7d={};var _0x26ac09;var _0xc3a9cb;return db[_0xa1d4('0x26')][_0xa1d4('0x47')]({'where':{'id':_0x308e86[_0xa1d4('0x45')]['id']}})['then'](handleEntityNotFound(_0x553213,null))[_0xa1d4('0x1f')](function(_0xf795f3){if(_0xf795f3){_0x26ac09=_0xf795f3;_0x33ed7d['model']=_[_0xa1d4('0x3f')](db[_0xa1d4('0x48')][_0xa1d4('0x27')]);_0x33ed7d[_0xa1d4('0x2b')]=_[_0xa1d4('0x3f')](_0x308e86[_0xa1d4('0x2b')]);_0x33ed7d[_0xa1d4('0x2c')]=_['intersection'](_0x33ed7d[_0xa1d4('0x2e')],_0x33ed7d[_0xa1d4('0x2b')]);_0x23dfde[_0xa1d4('0x2f')]=_[_0xa1d4('0x2d')](_0x33ed7d['model'],qs[_0xa1d4('0x30')](_0x308e86[_0xa1d4('0x2b')]['fields']));_0x23dfde[_0xa1d4('0x2f')]=_0x23dfde[_0xa1d4('0x2f')][_0xa1d4('0x31')]?_0x23dfde[_0xa1d4('0x2f')]:_0x33ed7d[_0xa1d4('0x2e')];_0x23dfde['order']=qs[_0xa1d4('0x34')](_0x308e86['query']['sort']);_0x23dfde['where']=qs[_0xa1d4('0x2c')](_['pick'](_0x308e86['query'],_0x33ed7d[_0xa1d4('0x2c')]));if(_0x308e86[_0xa1d4('0x2b')][_0xa1d4('0x4a')]){_0x23dfde[_0xa1d4('0x35')]=_[_0xa1d4('0x38')](_0x23dfde[_0xa1d4('0x35')],{'$or':_[_0xa1d4('0x25')](_0x23dfde['attributes'],function(_0x1dbf19){var _0x5f27f8={};_0x5f27f8[_0x1dbf19]={'$like':'%'+_0x308e86[_0xa1d4('0x2b')][_0xa1d4('0x4a')]+'%'};return _0x5f27f8;})});}_0x23dfde=_[_0xa1d4('0x38')]({},_0x23dfde,_0x308e86[_0xa1d4('0x39')]);return _0x26ac09[_0xa1d4('0x4c')](_0x23dfde);}})[_0xa1d4('0x1f')](function(_0x2f8252){if(_0x2f8252){_0xc3a9cb=_0x2f8252[_0xa1d4('0x31')];if(!_0x308e86[_0xa1d4('0x2b')][_0xa1d4('0x32')](_0xa1d4('0x33'))){_0x23dfde[_0xa1d4('0x18')]=qs['limit'](_0x308e86['query']['limit']);_0x23dfde[_0xa1d4('0x1a')]=qs[_0xa1d4('0x1a')](_0x308e86[_0xa1d4('0x2b')][_0xa1d4('0x1a')]);}return _0x26ac09['getSubjects'](_0x23dfde);}})[_0xa1d4('0x1f')](function(_0x1f513b){if(_0x1f513b){return _0x1f513b?{'count':_0xc3a9cb,'rows':_0x1f513b}:null;}})[_0xa1d4('0x1f')](respondWithResult(_0x553213,null))[_0xa1d4('0x41')](handleError(_0x553213,null));};exports[_0xa1d4('0x4d')]=function(_0x37546c,_0x540242,_0x29f5c5){var _0x23af1b={};var _0x16d091={};var _0x55168f;var _0x37c673;return db[_0xa1d4('0x26')][_0xa1d4('0x47')]({'where':{'id':_0x37546c['params']['id']}})[_0xa1d4('0x1f')](handleEntityNotFound(_0x540242,null))['then'](function(_0x2ac665){if(_0x2ac665){_0x55168f=_0x2ac665;_0x16d091[_0xa1d4('0x2e')]=_[_0xa1d4('0x3f')](db[_0xa1d4('0x48')][_0xa1d4('0x27')]);_0x16d091[_0xa1d4('0x2b')]=_['keys'](_0x37546c[_0xa1d4('0x2b')]);_0x16d091[_0xa1d4('0x2c')]=_[_0xa1d4('0x2d')](_0x16d091['model'],_0x16d091['query']);_0x23af1b[_0xa1d4('0x2f')]=_[_0xa1d4('0x2d')](_0x16d091[_0xa1d4('0x2e')],qs[_0xa1d4('0x30')](_0x37546c[_0xa1d4('0x2b')][_0xa1d4('0x30')]));_0x23af1b[_0xa1d4('0x2f')]=_0x23af1b[_0xa1d4('0x2f')][_0xa1d4('0x31')]?_0x23af1b['attributes']:_0x16d091[_0xa1d4('0x2e')];_0x23af1b[_0xa1d4('0x49')]=qs[_0xa1d4('0x34')](_0x37546c[_0xa1d4('0x2b')][_0xa1d4('0x34')]);_0x23af1b[_0xa1d4('0x35')]=qs[_0xa1d4('0x2c')](_[_0xa1d4('0x36')](_0x37546c['query'],_0x16d091[_0xa1d4('0x2c')]));if(_0x37546c[_0xa1d4('0x2b')][_0xa1d4('0x4a')]){_0x23af1b[_0xa1d4('0x35')]=_[_0xa1d4('0x38')](_0x23af1b['where'],{'$or':_[_0xa1d4('0x25')](_0x23af1b['attributes'],function(_0x4a3037){var _0x2d4bf9={};_0x2d4bf9[_0x4a3037]={'$like':'%'+_0x37546c[_0xa1d4('0x2b')]['filter']+'%'};return _0x2d4bf9;})});}_0x23af1b=_[_0xa1d4('0x38')]({},_0x23af1b,_0x37546c['options']);return _0x55168f['getDescriptions'](_0x23af1b);}})[_0xa1d4('0x1f')](function(_0x2da478){if(_0x2da478){_0x37c673=_0x2da478[_0xa1d4('0x31')];if(!_0x37546c[_0xa1d4('0x2b')]['hasOwnProperty']('nolimit')){_0x23af1b[_0xa1d4('0x18')]=qs['limit'](_0x37546c[_0xa1d4('0x2b')][_0xa1d4('0x18')]);_0x23af1b['offset']=qs[_0xa1d4('0x1a')](_0x37546c[_0xa1d4('0x2b')][_0xa1d4('0x1a')]);}return _0x55168f[_0xa1d4('0x4d')](_0x23af1b);}})[_0xa1d4('0x1f')](function(_0x1a071d){if(_0x1a071d){return _0x1a071d?{'count':_0x37c673,'rows':_0x1a071d}:null;}})[_0xa1d4('0x1f')](respondWithResult(_0x540242,null))[_0xa1d4('0x41')](handleError(_0x540242,null));};exports[_0xa1d4('0x4e')]=function(_0x3d4067,_0x2baf39,_0x300c1e){var _0x4374f6={};var _0x421f38={};var _0x431979;var _0x4accce;return db[_0xa1d4('0x26')][_0xa1d4('0x47')]({'where':{'id':_0x3d4067[_0xa1d4('0x45')]['id']}})['then'](handleEntityNotFound(_0x2baf39,null))[_0xa1d4('0x1f')](function(_0x47f43d){if(_0x47f43d){_0x431979=_0x47f43d;_0x421f38[_0xa1d4('0x2e')]=_['keys'](db[_0xa1d4('0x4f')][_0xa1d4('0x27')]);_0x421f38[_0xa1d4('0x2b')]=_[_0xa1d4('0x3f')](_0x3d4067['query']);_0x421f38[_0xa1d4('0x2c')]=_['intersection'](_0x421f38[_0xa1d4('0x2e')],_0x421f38['query']);_0x4374f6['attributes']=_[_0xa1d4('0x2d')](_0x421f38[_0xa1d4('0x2e')],qs[_0xa1d4('0x30')](_0x3d4067[_0xa1d4('0x2b')][_0xa1d4('0x30')]));_0x4374f6[_0xa1d4('0x2f')]=_0x4374f6[_0xa1d4('0x2f')][_0xa1d4('0x31')]?_0x4374f6[_0xa1d4('0x2f')]:_0x421f38[_0xa1d4('0x2e')];_0x4374f6['order']=qs[_0xa1d4('0x34')](_0x3d4067[_0xa1d4('0x2b')][_0xa1d4('0x34')]);_0x4374f6['where']=qs[_0xa1d4('0x2c')](_[_0xa1d4('0x36')](_0x3d4067[_0xa1d4('0x2b')],_0x421f38['filters']));if(_0x3d4067[_0xa1d4('0x2b')][_0xa1d4('0x4a')]){_0x4374f6[_0xa1d4('0x35')]=_['merge'](_0x4374f6[_0xa1d4('0x35')],{'$or':_[_0xa1d4('0x25')](_0x4374f6[_0xa1d4('0x2f')],function(_0x35bda7){var _0x5bf121={};_0x5bf121[_0x35bda7]={'$like':'%'+_0x3d4067[_0xa1d4('0x2b')]['filter']+'%'};return _0x5bf121;})});}_0x4374f6=_[_0xa1d4('0x38')]({},_0x4374f6,_0x3d4067['options']);return _0x431979[_0xa1d4('0x4e')](_0x4374f6);}})['then'](function(_0x4b5ec7){if(_0x4b5ec7){_0x4accce=_0x4b5ec7['length'];if(!_0x3d4067['query']['hasOwnProperty'](_0xa1d4('0x33'))){_0x4374f6[_0xa1d4('0x18')]=qs['limit'](_0x3d4067[_0xa1d4('0x2b')][_0xa1d4('0x18')]);_0x4374f6[_0xa1d4('0x1a')]=qs[_0xa1d4('0x1a')](_0x3d4067[_0xa1d4('0x2b')]['offset']);}return _0x431979[_0xa1d4('0x4e')](_0x4374f6);}})[_0xa1d4('0x1f')](function(_0x5733ae){if(_0x5733ae){return _0x5733ae?{'count':_0x4accce,'rows':_0x5733ae}:null;}})['then'](respondWithResult(_0x2baf39,null))[_0xa1d4('0x41')](handleError(_0x2baf39,null));};exports[_0xa1d4('0x50')]=function(_0x7b8427,_0x55e58c,_0x292ad3){if(_0x7b8427['body']['id']){delete _0x7b8427['body']['id'];}return db[_0xa1d4('0x26')][_0xa1d4('0x47')]({'where':{'id':_0x7b8427['params']['id']}})[_0xa1d4('0x1f')](handleEntityNotFound(_0x55e58c,null))[_0xa1d4('0x1f')](function(_0x451cc4){if(_0x451cc4){return _0x451cc4[_0xa1d4('0x50')](_0x7b8427[_0xa1d4('0x43')][_0xa1d4('0x51')]||[]);}return null;})[_0xa1d4('0x1f')](respondWithResult(_0x55e58c,null))[_0xa1d4('0x41')](handleError(_0x55e58c,null));}; \ No newline at end of file +var _0x1fc5=['filter','options','FreshdeskConfiguration','include','catch','show','params','rawAttributes','length','find','create','body','findOne','FreshdeskField','getFields','order','getSubjects','getDescriptions','getTags','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','VIRTUAL'];(function(_0xb1b6d9,_0x2fa071){var _0x1bdd80=function(_0xb68b10){while(--_0xb68b10){_0xb1b6d9['push'](_0xb1b6d9['shift']());}};_0x1bdd80(++_0x2fa071);}(_0x1fc5,0x100));var _0x51fc=function(_0x593b46,_0x69fc0b){_0x593b46=_0x593b46-0x0;var _0x3df2a5=_0x1fc5[_0x593b46];return _0x3df2a5;};'use strict';var emlformat=require(_0x51fc('0x0'));var rimraf=require(_0x51fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51fc('0x2'));var rp=require(_0x51fc('0x3'));var moment=require('moment');var BPromise=require(_0x51fc('0x4'));var Mustache=require(_0x51fc('0x5'));var util=require(_0x51fc('0x6'));var path=require('path');var sox=require(_0x51fc('0x7'));var csv=require(_0x51fc('0x8'));var ejs=require(_0x51fc('0x9'));var fs=require('fs');var fs_extra=require(_0x51fc('0xa'));var _=require(_0x51fc('0xb'));var squel=require(_0x51fc('0xc'));var crypto=require(_0x51fc('0xd'));var jsforce=require(_0x51fc('0xe'));var deskjs=require(_0x51fc('0xf'));var toCsv=require(_0x51fc('0x8'));var querystring=require('querystring');var Papa=require(_0x51fc('0x10'));var Redis=require('ioredis');var authService=require(_0x51fc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x51fc('0x12'));var hardwareService=require(_0x51fc('0x13'));var logger=require(_0x51fc('0x14'))(_0x51fc('0x15'));var utils=require('../../config/utils');var config=require(_0x51fc('0x16'));var licenseUtil=require(_0x51fc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x97a744,_0xc16eae){_0xc16eae=_0xc16eae||0xcc;return function(_0x3a3301){if(_0x3a3301){return _0x97a744['sendStatus'](_0xc16eae);}return _0x97a744['status'](_0xc16eae)[_0x51fc('0x18')]();};}function respondWithResult(_0x4dd1c9,_0x207915){_0x207915=_0x207915||0xc8;return function(_0x215a18){if(_0x215a18){return _0x4dd1c9[_0x51fc('0x19')](_0x207915)[_0x51fc('0x1a')](_0x215a18);}};}function respondWithFilteredResult(_0x3173c9,_0x235cad){return function(_0x126223){if(_0x126223){var _0x5126c3=typeof _0x235cad[_0x51fc('0x1b')]===_0x51fc('0x1c')&&typeof _0x235cad['limit']==='undefined';var _0x5602e7=_0x126223[_0x51fc('0x1d')];var _0x28db1e=_0x5126c3?0x0:_0x235cad[_0x51fc('0x1b')];var _0x42d9b8=_0x5126c3?_0x126223[_0x51fc('0x1d')]:_0x235cad[_0x51fc('0x1b')]+_0x235cad[_0x51fc('0x1e')];var _0x29602b;if(_0x42d9b8>=_0x5602e7){_0x42d9b8=_0x5602e7;_0x29602b=0xc8;}else{_0x29602b=0xce;}_0x3173c9[_0x51fc('0x19')](_0x29602b);return _0x3173c9[_0x51fc('0x1f')](_0x51fc('0x20'),_0x28db1e+'-'+_0x42d9b8+'/'+_0x5602e7)[_0x51fc('0x1a')](_0x126223);}return null;};}function patchUpdates(_0x1a416f){return function(_0xc4326c){try{jsonpatch['apply'](_0xc4326c,_0x1a416f,!![]);}catch(_0x8b3d09){return BPromise[_0x51fc('0x21')](_0x8b3d09);}return _0xc4326c['save']();};}function saveUpdates(_0x4d3a51,_0xda7f95){return function(_0x1c3bd5){if(_0x1c3bd5){return _0x1c3bd5[_0x51fc('0x22')](_0x4d3a51)[_0x51fc('0x23')](function(_0x3373d6){return _0x3373d6;});}return null;};}function removeEntity(_0x5b8b48,_0x194b2f){return function(_0x5dada0){if(_0x5dada0){return _0x5dada0[_0x51fc('0x24')]()['then'](function(){_0x5b8b48['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x146028,_0x1df20d){return function(_0x19da85){if(!_0x19da85){_0x146028[_0x51fc('0x25')](0x194);}return _0x19da85;};}function handleError(_0x1027e3,_0xb88698){_0xb88698=_0xb88698||0x1f4;return function(_0x2f2993){logger[_0x51fc('0x26')](_0x2f2993[_0x51fc('0x27')]);if(_0x2f2993['name']){delete _0x2f2993[_0x51fc('0x28')];}_0x1027e3[_0x51fc('0x19')](_0xb88698)[_0x51fc('0x29')](_0x2f2993);};}exports['index']=function(_0x5e221f,_0x24d30b){var _0x28c77d={},_0x151942={},_0x135ef7={'count':0x0,'rows':[]};var _0x15006d=_['map'](db['FreshdeskConfiguration']['rawAttributes'],function(_0x14e550){return{'name':_0x14e550[_0x51fc('0x2a')],'type':_0x14e550[_0x51fc('0x2b')][_0x51fc('0x2c')]};});_0x151942[_0x51fc('0x2d')]=_['map'](_0x15006d,'name');_0x151942['query']=_[_0x51fc('0x2e')](_0x5e221f[_0x51fc('0x2f')]);_0x151942['filters']=_[_0x51fc('0x30')](_0x151942[_0x51fc('0x2d')],_0x151942['query']);_0x28c77d[_0x51fc('0x31')]=_[_0x51fc('0x30')](_0x151942[_0x51fc('0x2d')],qs['fields'](_0x5e221f[_0x51fc('0x2f')][_0x51fc('0x32')]));_0x28c77d[_0x51fc('0x31')]=_0x28c77d['attributes']['length']?_0x28c77d[_0x51fc('0x31')]:_0x151942[_0x51fc('0x2d')];if(!_0x5e221f[_0x51fc('0x2f')][_0x51fc('0x33')](_0x51fc('0x34'))){_0x28c77d['limit']=qs[_0x51fc('0x1e')](_0x5e221f[_0x51fc('0x2f')][_0x51fc('0x1e')]);_0x28c77d[_0x51fc('0x1b')]=qs[_0x51fc('0x1b')](_0x5e221f['query']['offset']);}_0x28c77d['order']=qs['sort'](_0x5e221f['query'][_0x51fc('0x35')]);_0x28c77d[_0x51fc('0x36')]=qs[_0x51fc('0x37')](_[_0x51fc('0x38')](_0x5e221f['query'],_0x151942['filters']),_0x15006d);if(_0x5e221f['query']['filter']){_0x28c77d[_0x51fc('0x36')]=_[_0x51fc('0x39')](_0x28c77d[_0x51fc('0x36')],{'$or':_[_0x51fc('0x3a')](_0x15006d,function(_0x29307f){if(_0x29307f[_0x51fc('0x2b')]!==_0x51fc('0x3b')){var _0x21959c={};_0x21959c[_0x29307f[_0x51fc('0x28')]]={'$like':'%'+_0x5e221f[_0x51fc('0x2f')][_0x51fc('0x3c')]+'%'};return _0x21959c;}})});}_0x28c77d=_[_0x51fc('0x39')]({},_0x28c77d,_0x5e221f[_0x51fc('0x3d')]);var _0x1dd578={'where':_0x28c77d[_0x51fc('0x36')]};return db[_0x51fc('0x3e')][_0x51fc('0x1d')](_0x1dd578)['then'](function(_0x67e325){_0x135ef7['count']=_0x67e325;if(_0x5e221f[_0x51fc('0x2f')]['includeAll']){_0x28c77d[_0x51fc('0x3f')]=[{'all':!![]}];}return db[_0x51fc('0x3e')]['findAll'](_0x28c77d);})[_0x51fc('0x23')](function(_0x2879ac){_0x135ef7['rows']=_0x2879ac;return _0x135ef7;})[_0x51fc('0x23')](respondWithFilteredResult(_0x24d30b,_0x28c77d))[_0x51fc('0x40')](handleError(_0x24d30b,null));};exports[_0x51fc('0x41')]=function(_0xe98d1b,_0xa13361){var _0x4bf8a3={'raw':![],'where':{'id':_0xe98d1b[_0x51fc('0x42')]['id']}},_0x2edf58={};_0x2edf58[_0x51fc('0x2d')]=_[_0x51fc('0x2e')](db[_0x51fc('0x3e')][_0x51fc('0x43')]);_0x2edf58[_0x51fc('0x2f')]=_[_0x51fc('0x2e')](_0xe98d1b['query']);_0x2edf58['filters']=_[_0x51fc('0x30')](_0x2edf58[_0x51fc('0x2d')],_0x2edf58[_0x51fc('0x2f')]);_0x4bf8a3['attributes']=_[_0x51fc('0x30')](_0x2edf58[_0x51fc('0x2d')],qs[_0x51fc('0x32')](_0xe98d1b[_0x51fc('0x2f')][_0x51fc('0x32')]));_0x4bf8a3[_0x51fc('0x31')]=_0x4bf8a3[_0x51fc('0x31')][_0x51fc('0x44')]?_0x4bf8a3[_0x51fc('0x31')]:_0x2edf58['model'];if(_0xe98d1b['query']['includeAll']){_0x4bf8a3['include']=[{'all':!![]}];}_0x4bf8a3=_[_0x51fc('0x39')]({},_0x4bf8a3,_0xe98d1b['options']);return db[_0x51fc('0x3e')][_0x51fc('0x45')](_0x4bf8a3)['then'](handleEntityNotFound(_0xa13361,null))['then'](respondWithResult(_0xa13361,null))['catch'](handleError(_0xa13361,null));};exports['create']=function(_0x4ee15d,_0x1fff44){return db['FreshdeskConfiguration'][_0x51fc('0x46')](_0x4ee15d[_0x51fc('0x47')],{})[_0x51fc('0x23')](respondWithResult(_0x1fff44,0xc9))['catch'](handleError(_0x1fff44,null));};exports[_0x51fc('0x22')]=function(_0x493bd8,_0x5b5b3f){if(_0x493bd8[_0x51fc('0x47')]['id']){delete _0x493bd8[_0x51fc('0x47')]['id'];}return db[_0x51fc('0x3e')][_0x51fc('0x45')]({'where':{'id':_0x493bd8[_0x51fc('0x42')]['id']}})[_0x51fc('0x23')](handleEntityNotFound(_0x5b5b3f,null))['then'](saveUpdates(_0x493bd8[_0x51fc('0x47')],null))[_0x51fc('0x23')](respondWithResult(_0x5b5b3f,null))['catch'](handleError(_0x5b5b3f,null));};exports[_0x51fc('0x24')]=function(_0x59e8a0,_0x42595c){return db[_0x51fc('0x3e')]['find']({'where':{'id':_0x59e8a0['params']['id']}})[_0x51fc('0x23')](handleEntityNotFound(_0x42595c,null))[_0x51fc('0x23')](removeEntity(_0x42595c,null))['catch'](handleError(_0x42595c,null));};exports['getFields']=function(_0x2bb8f5,_0x43a9d3,_0x16fa55){var _0x137f1a={};var _0x2f229a={};var _0x4079cc;var _0x4091fb;return db['FreshdeskConfiguration'][_0x51fc('0x48')]({'where':{'id':_0x2bb8f5[_0x51fc('0x42')]['id']}})[_0x51fc('0x23')](handleEntityNotFound(_0x43a9d3,null))['then'](function(_0x27f28c){if(_0x27f28c){_0x4079cc=_0x27f28c;_0x2f229a[_0x51fc('0x2d')]=_[_0x51fc('0x2e')](db[_0x51fc('0x49')][_0x51fc('0x43')]);_0x2f229a['query']=_['keys'](_0x2bb8f5['query']);_0x2f229a[_0x51fc('0x37')]=_[_0x51fc('0x30')](_0x2f229a[_0x51fc('0x2d')],_0x2f229a[_0x51fc('0x2f')]);_0x137f1a[_0x51fc('0x31')]=_['intersection'](_0x2f229a['model'],qs[_0x51fc('0x32')](_0x2bb8f5[_0x51fc('0x2f')]['fields']));_0x137f1a[_0x51fc('0x31')]=_0x137f1a[_0x51fc('0x31')][_0x51fc('0x44')]?_0x137f1a[_0x51fc('0x31')]:_0x2f229a[_0x51fc('0x2d')];_0x137f1a['order']=qs[_0x51fc('0x35')](_0x2bb8f5[_0x51fc('0x2f')][_0x51fc('0x35')]);_0x137f1a['where']=qs[_0x51fc('0x37')](_[_0x51fc('0x38')](_0x2bb8f5['query'],_0x2f229a[_0x51fc('0x37')]));if(_0x2bb8f5['query'][_0x51fc('0x3c')]){_0x137f1a[_0x51fc('0x36')]=_[_0x51fc('0x39')](_0x137f1a[_0x51fc('0x36')],{'$or':_[_0x51fc('0x3a')](_0x137f1a[_0x51fc('0x31')],function(_0x1927de){var _0x5df512={};_0x5df512[_0x1927de]={'$like':'%'+_0x2bb8f5[_0x51fc('0x2f')][_0x51fc('0x3c')]+'%'};return _0x5df512;})});}_0x137f1a=_[_0x51fc('0x39')]({},_0x137f1a,_0x2bb8f5[_0x51fc('0x3d')]);return _0x4079cc[_0x51fc('0x4a')](_0x137f1a);}})['then'](function(_0x35a815){if(_0x35a815){_0x4091fb=_0x35a815[_0x51fc('0x44')];if(!_0x2bb8f5['query']['hasOwnProperty']('nolimit')){_0x137f1a['limit']=qs['limit'](_0x2bb8f5[_0x51fc('0x2f')]['limit']);_0x137f1a[_0x51fc('0x1b')]=qs[_0x51fc('0x1b')](_0x2bb8f5[_0x51fc('0x2f')][_0x51fc('0x1b')]);}return _0x4079cc[_0x51fc('0x4a')](_0x137f1a);}})[_0x51fc('0x23')](function(_0x25d85f){if(_0x25d85f){return _0x25d85f?{'count':_0x4091fb,'rows':_0x25d85f}:null;}})[_0x51fc('0x23')](respondWithResult(_0x43a9d3,null))[_0x51fc('0x40')](handleError(_0x43a9d3,null));};exports['getSubjects']=function(_0x23f4c5,_0x54d4a7,_0x1e43c3){var _0x5c44c7={};var _0x5b95de={};var _0x3c084f;var _0x48d8e1;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x23f4c5[_0x51fc('0x42')]['id']}})[_0x51fc('0x23')](handleEntityNotFound(_0x54d4a7,null))['then'](function(_0x2024c2){if(_0x2024c2){_0x3c084f=_0x2024c2;_0x5b95de['model']=_[_0x51fc('0x2e')](db[_0x51fc('0x49')][_0x51fc('0x43')]);_0x5b95de[_0x51fc('0x2f')]=_[_0x51fc('0x2e')](_0x23f4c5[_0x51fc('0x2f')]);_0x5b95de[_0x51fc('0x37')]=_[_0x51fc('0x30')](_0x5b95de[_0x51fc('0x2d')],_0x5b95de[_0x51fc('0x2f')]);_0x5c44c7[_0x51fc('0x31')]=_[_0x51fc('0x30')](_0x5b95de[_0x51fc('0x2d')],qs[_0x51fc('0x32')](_0x23f4c5[_0x51fc('0x2f')][_0x51fc('0x32')]));_0x5c44c7[_0x51fc('0x31')]=_0x5c44c7[_0x51fc('0x31')][_0x51fc('0x44')]?_0x5c44c7[_0x51fc('0x31')]:_0x5b95de[_0x51fc('0x2d')];_0x5c44c7[_0x51fc('0x4b')]=qs[_0x51fc('0x35')](_0x23f4c5[_0x51fc('0x2f')][_0x51fc('0x35')]);_0x5c44c7[_0x51fc('0x36')]=qs[_0x51fc('0x37')](_[_0x51fc('0x38')](_0x23f4c5['query'],_0x5b95de[_0x51fc('0x37')]));if(_0x23f4c5[_0x51fc('0x2f')]['filter']){_0x5c44c7[_0x51fc('0x36')]=_[_0x51fc('0x39')](_0x5c44c7[_0x51fc('0x36')],{'$or':_[_0x51fc('0x3a')](_0x5c44c7['attributes'],function(_0x4d89c0){var _0x51404f={};_0x51404f[_0x4d89c0]={'$like':'%'+_0x23f4c5[_0x51fc('0x2f')][_0x51fc('0x3c')]+'%'};return _0x51404f;})});}_0x5c44c7=_['merge']({},_0x5c44c7,_0x23f4c5[_0x51fc('0x3d')]);return _0x3c084f['getSubjects'](_0x5c44c7);}})[_0x51fc('0x23')](function(_0x5e6606){if(_0x5e6606){_0x48d8e1=_0x5e6606[_0x51fc('0x44')];if(!_0x23f4c5['query'][_0x51fc('0x33')]('nolimit')){_0x5c44c7[_0x51fc('0x1e')]=qs['limit'](_0x23f4c5[_0x51fc('0x2f')][_0x51fc('0x1e')]);_0x5c44c7[_0x51fc('0x1b')]=qs[_0x51fc('0x1b')](_0x23f4c5[_0x51fc('0x2f')][_0x51fc('0x1b')]);}return _0x3c084f[_0x51fc('0x4c')](_0x5c44c7);}})[_0x51fc('0x23')](function(_0x2b932e){if(_0x2b932e){return _0x2b932e?{'count':_0x48d8e1,'rows':_0x2b932e}:null;}})[_0x51fc('0x23')](respondWithResult(_0x54d4a7,null))[_0x51fc('0x40')](handleError(_0x54d4a7,null));};exports[_0x51fc('0x4d')]=function(_0x185e4f,_0x17ae23,_0x3a6141){var _0x5708b2={};var _0x18455f={};var _0x60cf38;var _0x544b73;return db[_0x51fc('0x3e')]['findOne']({'where':{'id':_0x185e4f[_0x51fc('0x42')]['id']}})['then'](handleEntityNotFound(_0x17ae23,null))['then'](function(_0x388d92){if(_0x388d92){_0x60cf38=_0x388d92;_0x18455f[_0x51fc('0x2d')]=_[_0x51fc('0x2e')](db[_0x51fc('0x49')][_0x51fc('0x43')]);_0x18455f[_0x51fc('0x2f')]=_[_0x51fc('0x2e')](_0x185e4f[_0x51fc('0x2f')]);_0x18455f[_0x51fc('0x37')]=_['intersection'](_0x18455f[_0x51fc('0x2d')],_0x18455f['query']);_0x5708b2['attributes']=_['intersection'](_0x18455f['model'],qs[_0x51fc('0x32')](_0x185e4f[_0x51fc('0x2f')][_0x51fc('0x32')]));_0x5708b2[_0x51fc('0x31')]=_0x5708b2[_0x51fc('0x31')][_0x51fc('0x44')]?_0x5708b2[_0x51fc('0x31')]:_0x18455f['model'];_0x5708b2['order']=qs[_0x51fc('0x35')](_0x185e4f[_0x51fc('0x2f')][_0x51fc('0x35')]);_0x5708b2[_0x51fc('0x36')]=qs[_0x51fc('0x37')](_[_0x51fc('0x38')](_0x185e4f[_0x51fc('0x2f')],_0x18455f['filters']));if(_0x185e4f[_0x51fc('0x2f')][_0x51fc('0x3c')]){_0x5708b2[_0x51fc('0x36')]=_[_0x51fc('0x39')](_0x5708b2[_0x51fc('0x36')],{'$or':_[_0x51fc('0x3a')](_0x5708b2[_0x51fc('0x31')],function(_0x39ea58){var _0x1f61cf={};_0x1f61cf[_0x39ea58]={'$like':'%'+_0x185e4f[_0x51fc('0x2f')][_0x51fc('0x3c')]+'%'};return _0x1f61cf;})});}_0x5708b2=_['merge']({},_0x5708b2,_0x185e4f['options']);return _0x60cf38[_0x51fc('0x4d')](_0x5708b2);}})['then'](function(_0x4f27da){if(_0x4f27da){_0x544b73=_0x4f27da[_0x51fc('0x44')];if(!_0x185e4f[_0x51fc('0x2f')][_0x51fc('0x33')](_0x51fc('0x34'))){_0x5708b2[_0x51fc('0x1e')]=qs['limit'](_0x185e4f[_0x51fc('0x2f')][_0x51fc('0x1e')]);_0x5708b2[_0x51fc('0x1b')]=qs[_0x51fc('0x1b')](_0x185e4f[_0x51fc('0x2f')][_0x51fc('0x1b')]);}return _0x60cf38[_0x51fc('0x4d')](_0x5708b2);}})[_0x51fc('0x23')](function(_0x1792cf){if(_0x1792cf){return _0x1792cf?{'count':_0x544b73,'rows':_0x1792cf}:null;}})[_0x51fc('0x23')](respondWithResult(_0x17ae23,null))[_0x51fc('0x40')](handleError(_0x17ae23,null));};exports[_0x51fc('0x4e')]=function(_0x10ddf3,_0x277ff2,_0x4fc497){var _0x2493b6={};var _0x3da408={};var _0xa871f8;var _0x341d28;return db[_0x51fc('0x3e')][_0x51fc('0x48')]({'where':{'id':_0x10ddf3[_0x51fc('0x42')]['id']}})[_0x51fc('0x23')](handleEntityNotFound(_0x277ff2,null))[_0x51fc('0x23')](function(_0x576199){if(_0x576199){_0xa871f8=_0x576199;_0x3da408[_0x51fc('0x2d')]=_[_0x51fc('0x2e')](db['Tag'][_0x51fc('0x43')]);_0x3da408['query']=_[_0x51fc('0x2e')](_0x10ddf3['query']);_0x3da408[_0x51fc('0x37')]=_[_0x51fc('0x30')](_0x3da408[_0x51fc('0x2d')],_0x3da408[_0x51fc('0x2f')]);_0x2493b6['attributes']=_[_0x51fc('0x30')](_0x3da408['model'],qs[_0x51fc('0x32')](_0x10ddf3[_0x51fc('0x2f')][_0x51fc('0x32')]));_0x2493b6['attributes']=_0x2493b6[_0x51fc('0x31')][_0x51fc('0x44')]?_0x2493b6[_0x51fc('0x31')]:_0x3da408[_0x51fc('0x2d')];_0x2493b6[_0x51fc('0x4b')]=qs[_0x51fc('0x35')](_0x10ddf3['query']['sort']);_0x2493b6[_0x51fc('0x36')]=qs['filters'](_[_0x51fc('0x38')](_0x10ddf3[_0x51fc('0x2f')],_0x3da408[_0x51fc('0x37')]));if(_0x10ddf3[_0x51fc('0x2f')][_0x51fc('0x3c')]){_0x2493b6[_0x51fc('0x36')]=_[_0x51fc('0x39')](_0x2493b6[_0x51fc('0x36')],{'$or':_[_0x51fc('0x3a')](_0x2493b6[_0x51fc('0x31')],function(_0x81ef34){var _0x447365={};_0x447365[_0x81ef34]={'$like':'%'+_0x10ddf3[_0x51fc('0x2f')][_0x51fc('0x3c')]+'%'};return _0x447365;})});}_0x2493b6=_[_0x51fc('0x39')]({},_0x2493b6,_0x10ddf3[_0x51fc('0x3d')]);return _0xa871f8[_0x51fc('0x4e')](_0x2493b6);}})[_0x51fc('0x23')](function(_0x182c15){if(_0x182c15){_0x341d28=_0x182c15[_0x51fc('0x44')];if(!_0x10ddf3[_0x51fc('0x2f')][_0x51fc('0x33')](_0x51fc('0x34'))){_0x2493b6[_0x51fc('0x1e')]=qs[_0x51fc('0x1e')](_0x10ddf3['query'][_0x51fc('0x1e')]);_0x2493b6[_0x51fc('0x1b')]=qs['offset'](_0x10ddf3[_0x51fc('0x2f')][_0x51fc('0x1b')]);}return _0xa871f8[_0x51fc('0x4e')](_0x2493b6);}})[_0x51fc('0x23')](function(_0x143ee9){if(_0x143ee9){return _0x143ee9?{'count':_0x341d28,'rows':_0x143ee9}:null;}})[_0x51fc('0x23')](respondWithResult(_0x277ff2,null))[_0x51fc('0x40')](handleError(_0x277ff2,null));};exports['setTags']=function(_0x81253c,_0x534755,_0x460ada){if(_0x81253c[_0x51fc('0x47')]['id']){delete _0x81253c[_0x51fc('0x47')]['id'];}return db[_0x51fc('0x3e')]['findOne']({'where':{'id':_0x81253c[_0x51fc('0x42')]['id']}})[_0x51fc('0x23')](handleEntityNotFound(_0x534755,null))['then'](function(_0x49f6fc){if(_0x49f6fc){return _0x49f6fc['setTags'](_0x81253c[_0x51fc('0x47')]['ids']||[]);}return null;})[_0x51fc('0x23')](respondWithResult(_0x534755,null))[_0x51fc('0x40')](handleError(_0x534755,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index d88f28c..72d2504 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 _0x5d95=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x3f48c8,_0x299d53){var _0x4c7512=function(_0x526393){while(--_0x526393){_0x3f48c8['push'](_0x3f48c8['shift']());}};_0x4c7512(++_0x299d53);}(_0x5d95,0x11d));var _0x55d9=function(_0x5a5fe6,_0x38511d){_0x5a5fe6=_0x5a5fe6-0x0;var _0x343454=_0x5d95[_0x5a5fe6];return _0x343454;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var logger=require(_0x55d9('0x2'))(_0x55d9('0x3'));var moment=require('moment');var BPromise=require(_0x55d9('0x4'));var rp=require(_0x55d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x55d9('0x6'));var attributes=require(_0x55d9('0x7'));module['exports']=function(_0x39d608,_0x40be38){return _0x39d608[_0x55d9('0x8')](_0x55d9('0x9'),attributes,{'tableName':_0x55d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed89=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','path','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0xc1f474,_0x5acfe5){var _0x4f93dd=function(_0x88433f){while(--_0x88433f){_0xc1f474['push'](_0xc1f474['shift']());}};_0x4f93dd(++_0x5acfe5);}(_0xed89,0x1e8));var _0x9ed8=function(_0x51e1ac,_0x3004af){_0x51e1ac=_0x51e1ac-0x0;var _0x42b479=_0xed89[_0x51e1ac];return _0x42b479;};'use strict';var _=require(_0x9ed8('0x0'));var util=require(_0x9ed8('0x1'));var logger=require('../../config/logger')(_0x9ed8('0x2'));var moment=require(_0x9ed8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ed8('0x4'));var rimraf=require('rimraf');var config=require(_0x9ed8('0x5'));var attributes=require(_0x9ed8('0x6'));module[_0x9ed8('0x7')]=function(_0x4f23d8,_0x35d348){return _0x4f23d8[_0x9ed8('0x8')](_0x9ed8('0x9'),attributes,{'tableName':_0x9ed8('0xa'),'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 3922075..2263297 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 _0xa38c=['result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x3f55b9,_0x1b573f){var _0x45f8de=function(_0x478db9){while(--_0x478db9){_0x3f55b9['push'](_0x3f55b9['shift']());}};_0x45f8de(++_0x1b573f);}(_0xa38c,0x169));var _0xca38=function(_0x40e8e0,_0x4c3b8a){_0x40e8e0=_0x40e8e0-0x0;var _0x5811cc=_0xa38c[_0x40e8e0];return _0x5811cc;};'use strict';var _=require('lodash');var util=require(_0xca38('0x0'));var moment=require(_0xca38('0x1'));var BPromise=require(_0xca38('0x2'));var rs=require(_0xca38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca38('0x4'))['db'];var utils=require(_0xca38('0x5'));var logger=require(_0xca38('0x6'))(_0xca38('0x7'));var config=require(_0xca38('0x8'));var jayson=require(_0xca38('0x9'));var client=jayson[_0xca38('0xa')][_0xca38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e2b1a,_0xbbfba5,_0x460d9e){return new BPromise(function(_0xcedc0d,_0x3ea506){return client[_0xca38('0xc')](_0x1e2b1a,_0x460d9e)[_0xca38('0xd')](function(_0x5e5a72){logger[_0xca38('0xe')](_0xca38('0xf'),_0xbbfba5,'request\x20sent');logger[_0xca38('0x10')](_0xca38('0x11'),_0xbbfba5,_0xca38('0x12'),JSON[_0xca38('0x13')](_0x5e5a72));if(_0x5e5a72['error']){if(_0x5e5a72['error'][_0xca38('0x14')]===0x1f4){logger[_0xca38('0x15')](_0xca38('0xf'),_0xbbfba5,_0x5e5a72[_0xca38('0x15')][_0xca38('0x16')]);return _0x3ea506(_0x5e5a72['error']['message']);}logger[_0xca38('0x15')](_0xca38('0xf'),_0xbbfba5,_0x5e5a72[_0xca38('0x15')]['message']);return _0xcedc0d(_0x5e5a72['error'][_0xca38('0x16')]);}else{logger[_0xca38('0xe')](_0xca38('0xf'),_0xbbfba5,'request\x20sent');_0xcedc0d(_0x5e5a72[_0xca38('0x17')]['message']);}})['catch'](function(_0x34c044){logger[_0xca38('0x15')](_0xca38('0xf'),_0xbbfba5,_0x34c044);_0x3ea506(_0x34c044);});});} \ No newline at end of file +var _0xf44e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x1d0bbf,_0x430c41){var _0x131561=function(_0x4fe0f0){while(--_0x4fe0f0){_0x1d0bbf['push'](_0x1d0bbf['shift']());}};_0x131561(++_0x430c41);}(_0xf44e,0x11a));var _0xef44=function(_0x36fd42,_0x448d15){_0x36fd42=_0x36fd42-0x0;var _0x578713=_0xf44e[_0x36fd42];return _0x578713;};'use strict';var _=require(_0xef44('0x0'));var util=require(_0xef44('0x1'));var moment=require('moment');var BPromise=require(_0xef44('0x2'));var rs=require(_0xef44('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xef44('0x4'))(_0xef44('0x5'));var config=require(_0xef44('0x6'));var jayson=require(_0xef44('0x7'));var client=jayson[_0xef44('0x8')][_0xef44('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c4515,_0x754743,_0x1973f6){return new BPromise(function(_0x3b0c27,_0x4d4d76){return client[_0xef44('0xa')](_0x1c4515,_0x1973f6)[_0xef44('0xb')](function(_0x287e9f){logger[_0xef44('0xc')](_0xef44('0xd'),_0x754743,_0xef44('0xe'));logger[_0xef44('0xf')](_0xef44('0x10'),_0x754743,_0xef44('0xe'),JSON['stringify'](_0x287e9f));if(_0x287e9f[_0xef44('0x11')]){if(_0x287e9f[_0xef44('0x11')][_0xef44('0x12')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x754743,_0x287e9f[_0xef44('0x11')]['message']);return _0x4d4d76(_0x287e9f['error'][_0xef44('0x13')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x754743,_0x287e9f[_0xef44('0x11')][_0xef44('0x13')]);return _0x3b0c27(_0x287e9f[_0xef44('0x11')][_0xef44('0x13')]);}else{logger[_0xef44('0xc')](_0xef44('0xd'),_0x754743,'request\x20sent');_0x3b0c27(_0x287e9f[_0xef44('0x14')][_0xef44('0x13')]);}})[_0xef44('0x15')](function(_0x42b32d){logger['error'](_0xef44('0xd'),_0x754743,_0x42b32d);_0x4d4d76(_0x42b32d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 9b73fe8..48092a6 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 _0xa9ab=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy','util','path','express'];(function(_0x13834a,_0x4b6d38){var _0x20050c=function(_0x588874){while(--_0x588874){_0x13834a['push'](_0x13834a['shift']());}};_0x20050c(++_0x4b6d38);}(_0xa9ab,0xbb));var _0xba9a=function(_0xfff265,_0x41f693){_0xfff265=_0xfff265-0x0;var _0x55442d=_0xa9ab[_0xfff265];return _0x55442d;};'use strict';var multer=require('multer');var util=require(_0xba9a('0x0'));var path=require(_0xba9a('0x1'));var timeout=require('connect-timeout');var express=require(_0xba9a('0x2'));var router=express[_0xba9a('0x3')]();var fs_extra=require(_0xba9a('0x4'));var auth=require(_0xba9a('0x5'));var interaction=require(_0xba9a('0x6'));var config=require(_0xba9a('0x7'));var controller=require(_0xba9a('0x8'));router[_0xba9a('0x9')]('/',auth['isAuthenticated'](),controller[_0xba9a('0xa')]);router[_0xba9a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba9a('0xb')]);router[_0xba9a('0xc')]('/',auth[_0xba9a('0xd')](),controller[_0xba9a('0xe')]);router[_0xba9a('0xf')](_0xba9a('0x10'),auth[_0xba9a('0xd')](),controller['update']);router[_0xba9a('0x11')]('/:id',auth[_0xba9a('0xd')](),controller[_0xba9a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe738=['fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','put','update','multer','util','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe738,0x1be));var _0x8e73=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe738[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x8e73('0x0'));var util=require(_0x8e73('0x1'));var path=require(_0x8e73('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e73('0x3'));var router=express['Router']();var fs_extra=require(_0x8e73('0x4'));var auth=require(_0x8e73('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e73('0x6'));var controller=require(_0x8e73('0x7'));router[_0x8e73('0x8')]('/',auth['isAuthenticated'](),controller[_0x8e73('0x9')]);router[_0x8e73('0x8')](_0x8e73('0xa'),auth[_0x8e73('0xb')](),controller[_0x8e73('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8e73('0xd')](_0x8e73('0xa'),auth['isAuthenticated'](),controller[_0x8e73('0xe')]);router['delete']('/:id',auth[_0x8e73('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 31b3cee..4771a02 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 _0xf48a=['customVariable','keyValue','STRING','exports','ENUM','string','variable'];(function(_0x1b09d0,_0x1c0a19){var _0x192d12=function(_0x286226){while(--_0x286226){_0x1b09d0['push'](_0x1b09d0['shift']());}};_0x192d12(++_0x1c0a19);}(_0xf48a,0x1e6));var _0xaf48=function(_0x40b898,_0x2fd575){_0x40b898=_0x40b898-0x0;var _0x2ff0bb=_0xf48a[_0x40b898];return _0x2ff0bb;};'use strict';var Sequelize=require('sequelize');module[_0xaf48('0x0')]={'type':{'type':Sequelize[_0xaf48('0x1')](_0xaf48('0x2'),_0xaf48('0x3'),_0xaf48('0x4'),_0xaf48('0x5'),'picklist'),'defaultValue':_0xaf48('0x2')},'content':{'type':Sequelize[_0xaf48('0x6')]},'key':{'type':Sequelize[_0xaf48('0x6')]},'keyType':{'type':Sequelize[_0xaf48('0x1')]('string',_0xaf48('0x3'),_0xaf48('0x4'))},'keyContent':{'type':Sequelize[_0xaf48('0x6')]},'idField':{'type':Sequelize[_0xaf48('0x6')]},'nameField':{'type':Sequelize[_0xaf48('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdc53=['string','variable','customVariable','keyValue','STRING','sequelize','ENUM'];(function(_0x3ca746,_0x27bae0){var _0x4b9c72=function(_0x195735){while(--_0x195735){_0x3ca746['push'](_0x3ca746['shift']());}};_0x4b9c72(++_0x27bae0);}(_0xdc53,0xc9));var _0x3dc5=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xdc53[_0x5416db];return _0x243e35;};'use strict';var Sequelize=require(_0x3dc5('0x0'));module['exports']={'type':{'type':Sequelize[_0x3dc5('0x1')](_0x3dc5('0x2'),_0x3dc5('0x3'),_0x3dc5('0x4'),_0x3dc5('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3dc5('0x6')]},'keyType':{'type':Sequelize[_0x3dc5('0x1')](_0x3dc5('0x2'),_0x3dc5('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3dc5('0x6')]},'idField':{'type':Sequelize[_0x3dc5('0x6')]},'nameField':{'type':Sequelize[_0x3dc5('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3dc5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ca1eba4..159107f 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 _0xdace=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0xdace,0xc5));var _0xedac=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdace[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21c6ae,_0x1b0503){_0x1b0503=_0x1b0503||0xcc;return function(_0x306af5){if(_0x306af5){return _0x21c6ae[_0xedac('0x15')](_0x1b0503);}return _0x21c6ae[_0xedac('0x16')](_0x1b0503)[_0xedac('0x17')]();};}function respondWithResult(_0x28444a,_0x11f0b0){_0x11f0b0=_0x11f0b0||0xc8;return function(_0x593030){if(_0x593030){return _0x28444a[_0xedac('0x16')](_0x11f0b0)[_0xedac('0x18')](_0x593030);}};}function respondWithFilteredResult(_0x2f0c7c,_0x2676c3){return function(_0x15068){if(_0x15068){var _0x590e9b=typeof _0x2676c3[_0xedac('0x19')]==='undefined'&&typeof _0x2676c3[_0xedac('0x1a')]===_0xedac('0x1b');var _0xdad128=_0x15068[_0xedac('0x1c')];var _0x4fb540=_0x590e9b?0x0:_0x2676c3['offset'];var _0x2d02d7=_0x590e9b?_0x15068[_0xedac('0x1c')]:_0x2676c3[_0xedac('0x19')]+_0x2676c3[_0xedac('0x1a')];var _0x5a5438;if(_0x2d02d7>=_0xdad128){_0x2d02d7=_0xdad128;_0x5a5438=0xc8;}else{_0x5a5438=0xce;}_0x2f0c7c['status'](_0x5a5438);return _0x2f0c7c[_0xedac('0x1d')](_0xedac('0x1e'),_0x4fb540+'-'+_0x2d02d7+'/'+_0xdad128)[_0xedac('0x18')](_0x15068);}return null;};}function patchUpdates(_0xcc1605){return function(_0x2f5eee){try{jsonpatch[_0xedac('0x1f')](_0x2f5eee,_0xcc1605,!![]);}catch(_0x160be7){return BPromise[_0xedac('0x20')](_0x160be7);}return _0x2f5eee['save']();};}function saveUpdates(_0x4593e8,_0x510005){return function(_0x29cd40){if(_0x29cd40){return _0x29cd40[_0xedac('0x21')](_0x4593e8)['then'](function(_0x46e09d){return _0x46e09d;});}return null;};}function removeEntity(_0x404b8d,_0x1c87bf){return function(_0x1e5e47){if(_0x1e5e47){return _0x1e5e47[_0xedac('0x22')]()[_0xedac('0x23')](function(){_0x404b8d['status'](0xcc)[_0xedac('0x17')]();});}};}function handleEntityNotFound(_0x87d343,_0x37563f){return function(_0x41ad8d){if(!_0x41ad8d){_0x87d343[_0xedac('0x15')](0x194);}return _0x41ad8d;};}function handleError(_0x453a3c,_0x40ba53){_0x40ba53=_0x40ba53||0x1f4;return function(_0x26c6f7){logger[_0xedac('0x24')](_0x26c6f7[_0xedac('0x25')]);if(_0x26c6f7['name']){delete _0x26c6f7[_0xedac('0x26')];}_0x453a3c[_0xedac('0x16')](_0x40ba53)[_0xedac('0x27')](_0x26c6f7);};}exports['index']=function(_0x313e06,_0x4f81f6){var _0x524514={},_0x3e28bf={},_0x457d81={'count':0x0,'rows':[]};var _0x44ac60=_[_0xedac('0x28')](db['FreshdeskField']['rawAttributes'],function(_0xe813e6){return{'name':_0xe813e6[_0xedac('0x29')],'type':_0xe813e6[_0xedac('0x2a')][_0xedac('0x2b')]};});_0x3e28bf[_0xedac('0x2c')]=_[_0xedac('0x28')](_0x44ac60,_0xedac('0x26'));_0x3e28bf['query']=_[_0xedac('0x2d')](_0x313e06[_0xedac('0x2e')]);_0x3e28bf[_0xedac('0x2f')]=_['intersection'](_0x3e28bf[_0xedac('0x2c')],_0x3e28bf[_0xedac('0x2e')]);_0x524514['attributes']=_[_0xedac('0x30')](_0x3e28bf[_0xedac('0x2c')],qs['fields'](_0x313e06[_0xedac('0x2e')][_0xedac('0x31')]));_0x524514[_0xedac('0x32')]=_0x524514[_0xedac('0x32')][_0xedac('0x33')]?_0x524514[_0xedac('0x32')]:_0x3e28bf[_0xedac('0x2c')];if(!_0x313e06[_0xedac('0x2e')][_0xedac('0x34')](_0xedac('0x35'))){_0x524514['limit']=qs[_0xedac('0x1a')](_0x313e06[_0xedac('0x2e')][_0xedac('0x1a')]);_0x524514[_0xedac('0x19')]=qs[_0xedac('0x19')](_0x313e06[_0xedac('0x2e')][_0xedac('0x19')]);}_0x524514[_0xedac('0x36')]=qs[_0xedac('0x37')](_0x313e06[_0xedac('0x2e')][_0xedac('0x37')]);_0x524514[_0xedac('0x38')]=qs[_0xedac('0x2f')](_[_0xedac('0x39')](_0x313e06[_0xedac('0x2e')],_0x3e28bf['filters']),_0x44ac60);if(_0x313e06[_0xedac('0x2e')][_0xedac('0x3a')]){_0x524514[_0xedac('0x38')]=_[_0xedac('0x3b')](_0x524514['where'],{'$or':_[_0xedac('0x28')](_0x44ac60,function(_0x1cee42){if(_0x1cee42[_0xedac('0x2a')]!=='VIRTUAL'){var _0x159145={};_0x159145[_0x1cee42[_0xedac('0x26')]]={'$like':'%'+_0x313e06[_0xedac('0x2e')]['filter']+'%'};return _0x159145;}})});}_0x524514=_[_0xedac('0x3b')]({},_0x524514,_0x313e06[_0xedac('0x3c')]);var _0x47f7c7={'where':_0x524514[_0xedac('0x38')]};return db[_0xedac('0x3d')]['count'](_0x47f7c7)[_0xedac('0x23')](function(_0x534ad3){_0x457d81[_0xedac('0x1c')]=_0x534ad3;if(_0x313e06[_0xedac('0x2e')][_0xedac('0x3e')]){_0x524514[_0xedac('0x3f')]=[{'all':!![]}];}return db[_0xedac('0x3d')][_0xedac('0x40')](_0x524514);})['then'](function(_0x2370aa){_0x457d81[_0xedac('0x41')]=_0x2370aa;return _0x457d81;})[_0xedac('0x23')](respondWithFilteredResult(_0x4f81f6,_0x524514))[_0xedac('0x42')](handleError(_0x4f81f6,null));};exports[_0xedac('0x43')]=function(_0xa3a919,_0x2e9eef){var _0x6a17a9={'raw':!![],'where':{'id':_0xa3a919[_0xedac('0x44')]['id']}},_0x2dcff4={};_0x2dcff4[_0xedac('0x2c')]=_[_0xedac('0x2d')](db[_0xedac('0x3d')][_0xedac('0x45')]);_0x2dcff4[_0xedac('0x2e')]=_[_0xedac('0x2d')](_0xa3a919['query']);_0x2dcff4[_0xedac('0x2f')]=_[_0xedac('0x30')](_0x2dcff4[_0xedac('0x2c')],_0x2dcff4['query']);_0x6a17a9['attributes']=_['intersection'](_0x2dcff4[_0xedac('0x2c')],qs[_0xedac('0x31')](_0xa3a919['query'][_0xedac('0x31')]));_0x6a17a9['attributes']=_0x6a17a9[_0xedac('0x32')]['length']?_0x6a17a9[_0xedac('0x32')]:_0x2dcff4[_0xedac('0x2c')];if(_0xa3a919[_0xedac('0x2e')][_0xedac('0x3e')]){_0x6a17a9[_0xedac('0x3f')]=[{'all':!![]}];}_0x6a17a9=_['merge']({},_0x6a17a9,_0xa3a919['options']);return db[_0xedac('0x3d')]['find'](_0x6a17a9)[_0xedac('0x23')](handleEntityNotFound(_0x2e9eef,null))[_0xedac('0x23')](respondWithResult(_0x2e9eef,null))[_0xedac('0x42')](handleError(_0x2e9eef,null));};exports['create']=function(_0x29a707,_0x45189f){return db[_0xedac('0x3d')]['create'](_0x29a707[_0xedac('0x46')],{})[_0xedac('0x23')](respondWithResult(_0x45189f,0xc9))[_0xedac('0x42')](handleError(_0x45189f,null));};exports['update']=function(_0x5e6079,_0x2cb3ca){if(_0x5e6079[_0xedac('0x46')]['id']){delete _0x5e6079['body']['id'];}return db['FreshdeskField'][_0xedac('0x47')]({'where':{'id':_0x5e6079[_0xedac('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cb3ca,null))[_0xedac('0x23')](saveUpdates(_0x5e6079['body'],null))[_0xedac('0x23')](respondWithResult(_0x2cb3ca,null))[_0xedac('0x42')](handleError(_0x2cb3ca,null));};exports[_0xedac('0x22')]=function(_0x104842,_0x126bd3){return db[_0xedac('0x3d')]['find']({'where':{'id':_0x104842[_0xedac('0x44')]['id']}})[_0xedac('0x23')](handleEntityNotFound(_0x126bd3,null))['then'](removeEntity(_0x126bd3,null))[_0xedac('0x42')](handleError(_0x126bd3,null));}; \ No newline at end of file +var _0x7d98=['pick','filter','merge','where','include','FreshdeskField','findAll','rows','show','rawAttributes','create','body','catch','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','name','send','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4ddc7e,_0xcb9b8){var _0xfbf0ec=function(_0x32b673){while(--_0x32b673){_0x4ddc7e['push'](_0x4ddc7e['shift']());}};_0xfbf0ec(++_0xcb9b8);}(_0x7d98,0xe7));var _0x87d9=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x7d98[_0x3a7634];return _0x23bbe9;};'use strict';var emlformat=require(_0x87d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87d9('0x1'));var jsonpatch=require(_0x87d9('0x2'));var rp=require(_0x87d9('0x3'));var moment=require(_0x87d9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x87d9('0x5'));var util=require(_0x87d9('0x6'));var path=require('path');var sox=require(_0x87d9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87d9('0x8'));var squel=require(_0x87d9('0x9'));var crypto=require(_0x87d9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x87d9('0xb'));var toCsv=require(_0x87d9('0xc'));var querystring=require(_0x87d9('0xd'));var Papa=require('papaparse');var Redis=require(_0x87d9('0xe'));var authService=require(_0x87d9('0xf'));var qs=require(_0x87d9('0x10'));var as=require(_0x87d9('0x11'));var hardwareService=require(_0x87d9('0x12'));var logger=require(_0x87d9('0x13'))(_0x87d9('0x14'));var utils=require(_0x87d9('0x15'));var config=require(_0x87d9('0x16'));var licenseUtil=require(_0x87d9('0x17'));var db=require(_0x87d9('0x18'))['db'];function respondWithStatusCode(_0x22f32d,_0x38f33e){_0x38f33e=_0x38f33e||0xcc;return function(_0x22758){if(_0x22758){return _0x22f32d[_0x87d9('0x19')](_0x38f33e);}return _0x22f32d[_0x87d9('0x1a')](_0x38f33e)[_0x87d9('0x1b')]();};}function respondWithResult(_0x185401,_0x380836){_0x380836=_0x380836||0xc8;return function(_0x27d61d){if(_0x27d61d){return _0x185401['status'](_0x380836)['json'](_0x27d61d);}};}function respondWithFilteredResult(_0x9e9e53,_0xaa910c){return function(_0x3231e7){if(_0x3231e7){var _0x501d32=typeof _0xaa910c['offset']===_0x87d9('0x1c')&&typeof _0xaa910c[_0x87d9('0x1d')]===_0x87d9('0x1c');var _0x23ae47=_0x3231e7[_0x87d9('0x1e')];var _0xebc1eb=_0x501d32?0x0:_0xaa910c[_0x87d9('0x1f')];var _0x1f33a3=_0x501d32?_0x3231e7[_0x87d9('0x1e')]:_0xaa910c[_0x87d9('0x1f')]+_0xaa910c[_0x87d9('0x1d')];var _0x5d6da1;if(_0x1f33a3>=_0x23ae47){_0x1f33a3=_0x23ae47;_0x5d6da1=0xc8;}else{_0x5d6da1=0xce;}_0x9e9e53[_0x87d9('0x1a')](_0x5d6da1);return _0x9e9e53['set'](_0x87d9('0x20'),_0xebc1eb+'-'+_0x1f33a3+'/'+_0x23ae47)[_0x87d9('0x21')](_0x3231e7);}return null;};}function patchUpdates(_0x334d31){return function(_0x57bef6){try{jsonpatch['apply'](_0x57bef6,_0x334d31,!![]);}catch(_0x545241){return BPromise[_0x87d9('0x22')](_0x545241);}return _0x57bef6[_0x87d9('0x23')]();};}function saveUpdates(_0x28aaaa,_0x6ab839){return function(_0xc82b02){if(_0xc82b02){return _0xc82b02[_0x87d9('0x24')](_0x28aaaa)[_0x87d9('0x25')](function(_0x3b24e7){return _0x3b24e7;});}return null;};}function removeEntity(_0x1c550c,_0x4c0f7a){return function(_0x31e1b2){if(_0x31e1b2){return _0x31e1b2[_0x87d9('0x26')]()[_0x87d9('0x25')](function(){_0x1c550c[_0x87d9('0x1a')](0xcc)[_0x87d9('0x1b')]();});}};}function handleEntityNotFound(_0x340462,_0x3641c8){return function(_0x32b83f){if(!_0x32b83f){_0x340462['sendStatus'](0x194);}return _0x32b83f;};}function handleError(_0x8b1ab7,_0x600404){_0x600404=_0x600404||0x1f4;return function(_0x2f63fa){logger[_0x87d9('0x27')](_0x2f63fa['stack']);if(_0x2f63fa[_0x87d9('0x28')]){delete _0x2f63fa[_0x87d9('0x28')];}_0x8b1ab7[_0x87d9('0x1a')](_0x600404)[_0x87d9('0x29')](_0x2f63fa);};}exports['index']=function(_0x21916a,_0x3c0283){var _0x501c5={},_0x5e1b55={},_0x1d04a9={'count':0x0,'rows':[]};var _0x22a401=_['map'](db['FreshdeskField']['rawAttributes'],function(_0x31122b){return{'name':_0x31122b[_0x87d9('0x2a')],'type':_0x31122b['type'][_0x87d9('0x2b')]};});_0x5e1b55['model']=_[_0x87d9('0x2c')](_0x22a401,'name');_0x5e1b55[_0x87d9('0x2d')]=_[_0x87d9('0x2e')](_0x21916a['query']);_0x5e1b55[_0x87d9('0x2f')]=_['intersection'](_0x5e1b55[_0x87d9('0x30')],_0x5e1b55[_0x87d9('0x2d')]);_0x501c5[_0x87d9('0x31')]=_[_0x87d9('0x32')](_0x5e1b55[_0x87d9('0x30')],qs[_0x87d9('0x33')](_0x21916a['query'][_0x87d9('0x33')]));_0x501c5[_0x87d9('0x31')]=_0x501c5[_0x87d9('0x31')][_0x87d9('0x34')]?_0x501c5[_0x87d9('0x31')]:_0x5e1b55[_0x87d9('0x30')];if(!_0x21916a[_0x87d9('0x2d')][_0x87d9('0x35')](_0x87d9('0x36'))){_0x501c5['limit']=qs[_0x87d9('0x1d')](_0x21916a[_0x87d9('0x2d')][_0x87d9('0x1d')]);_0x501c5[_0x87d9('0x1f')]=qs[_0x87d9('0x1f')](_0x21916a['query'][_0x87d9('0x1f')]);}_0x501c5[_0x87d9('0x37')]=qs[_0x87d9('0x38')](_0x21916a['query'][_0x87d9('0x38')]);_0x501c5['where']=qs[_0x87d9('0x2f')](_[_0x87d9('0x39')](_0x21916a[_0x87d9('0x2d')],_0x5e1b55[_0x87d9('0x2f')]),_0x22a401);if(_0x21916a['query'][_0x87d9('0x3a')]){_0x501c5['where']=_[_0x87d9('0x3b')](_0x501c5[_0x87d9('0x3c')],{'$or':_[_0x87d9('0x2c')](_0x22a401,function(_0x1af8eb){if(_0x1af8eb['type']!=='VIRTUAL'){var _0x2063de={};_0x2063de[_0x1af8eb['name']]={'$like':'%'+_0x21916a[_0x87d9('0x2d')]['filter']+'%'};return _0x2063de;}})});}_0x501c5=_[_0x87d9('0x3b')]({},_0x501c5,_0x21916a['options']);var _0xdf56e8={'where':_0x501c5[_0x87d9('0x3c')]};return db['FreshdeskField'][_0x87d9('0x1e')](_0xdf56e8)['then'](function(_0x4bc1ba){_0x1d04a9['count']=_0x4bc1ba;if(_0x21916a[_0x87d9('0x2d')]['includeAll']){_0x501c5[_0x87d9('0x3d')]=[{'all':!![]}];}return db[_0x87d9('0x3e')][_0x87d9('0x3f')](_0x501c5);})['then'](function(_0x915f05){_0x1d04a9[_0x87d9('0x40')]=_0x915f05;return _0x1d04a9;})[_0x87d9('0x25')](respondWithFilteredResult(_0x3c0283,_0x501c5))['catch'](handleError(_0x3c0283,null));};exports[_0x87d9('0x41')]=function(_0x58ec85,_0x5c2db5){var _0x59338e={'raw':!![],'where':{'id':_0x58ec85['params']['id']}},_0x39e807={};_0x39e807['model']=_[_0x87d9('0x2e')](db[_0x87d9('0x3e')][_0x87d9('0x42')]);_0x39e807[_0x87d9('0x2d')]=_[_0x87d9('0x2e')](_0x58ec85['query']);_0x39e807[_0x87d9('0x2f')]=_[_0x87d9('0x32')](_0x39e807['model'],_0x39e807['query']);_0x59338e[_0x87d9('0x31')]=_[_0x87d9('0x32')](_0x39e807[_0x87d9('0x30')],qs[_0x87d9('0x33')](_0x58ec85[_0x87d9('0x2d')][_0x87d9('0x33')]));_0x59338e[_0x87d9('0x31')]=_0x59338e[_0x87d9('0x31')]['length']?_0x59338e[_0x87d9('0x31')]:_0x39e807[_0x87d9('0x30')];if(_0x58ec85['query']['includeAll']){_0x59338e[_0x87d9('0x3d')]=[{'all':!![]}];}_0x59338e=_[_0x87d9('0x3b')]({},_0x59338e,_0x58ec85['options']);return db[_0x87d9('0x3e')]['find'](_0x59338e)['then'](handleEntityNotFound(_0x5c2db5,null))['then'](respondWithResult(_0x5c2db5,null))['catch'](handleError(_0x5c2db5,null));};exports[_0x87d9('0x43')]=function(_0x101446,_0x533a74){return db[_0x87d9('0x3e')][_0x87d9('0x43')](_0x101446[_0x87d9('0x44')],{})['then'](respondWithResult(_0x533a74,0xc9))[_0x87d9('0x45')](handleError(_0x533a74,null));};exports[_0x87d9('0x24')]=function(_0x2d4766,_0x384273){if(_0x2d4766[_0x87d9('0x44')]['id']){delete _0x2d4766[_0x87d9('0x44')]['id'];}return db['FreshdeskField'][_0x87d9('0x46')]({'where':{'id':_0x2d4766['params']['id']}})['then'](handleEntityNotFound(_0x384273,null))[_0x87d9('0x25')](saveUpdates(_0x2d4766[_0x87d9('0x44')],null))[_0x87d9('0x25')](respondWithResult(_0x384273,null))[_0x87d9('0x45')](handleError(_0x384273,null));};exports[_0x87d9('0x26')]=function(_0x4fdfa9,_0x4558f5){return db[_0x87d9('0x3e')][_0x87d9('0x46')]({'where':{'id':_0x4fdfa9[_0x87d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4558f5,null))[_0x87d9('0x25')](removeEntity(_0x4558f5,null))[_0x87d9('0x45')](handleError(_0x4558f5,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 6e7f302..cb2a8af 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 _0xcd45=['FieldId','lodash','bluebird','path','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xcd45,0x140));var _0x5cd4=function(_0x425d0d,_0x3c0dab){_0x425d0d=_0x425d0d-0x0;var _0x2d1024=_0xcd45[_0x425d0d];return _0x2d1024;};'use strict';var _=require(_0x5cd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5cd4('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cd4('0x2'));var rimraf=require('rimraf');var config=require(_0x5cd4('0x3'));var attributes=require(_0x5cd4('0x4'));module[_0x5cd4('0x5')]=function(_0x23886d,_0x58410b){return _0x23886d[_0x5cd4('0x6')](_0x5cd4('0x7'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x5cd4('0x8'),'fields':[_0x5cd4('0x9'),_0x5cd4('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x76b9=['path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x2fae57,_0x2d807a){var _0x232587=function(_0x134e09){while(--_0x134e09){_0x2fae57['push'](_0x2fae57['shift']());}};_0x232587(++_0x2d807a);}(_0x76b9,0x12f));var _0x976b=function(_0x311df6,_0x4e4e20){_0x311df6=_0x311df6-0x0;var _0xcc88ce=_0x76b9[_0x311df6];return _0xcc88ce;};'use strict';var _=require('lodash');var util=require(_0x976b('0x0'));var logger=require(_0x976b('0x1'))(_0x976b('0x2'));var moment=require(_0x976b('0x3'));var BPromise=require(_0x976b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x976b('0x5'));var rimraf=require(_0x976b('0x6'));var config=require(_0x976b('0x7'));var attributes=require(_0x976b('0x8'));module[_0x976b('0x9')]=function(_0x578501,_0x1ecf07){return _0x578501['define'](_0x976b('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x976b('0xb'),'fields':[_0x976b('0xc'),_0x976b('0xd')],'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 ec7fada..78afcac 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 _0x239b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x239b,0x1a2));var _0xb239=function(_0x2f6270,_0xe5428d){_0x2f6270=_0x2f6270-0x0;var _0x3e55fb=_0x239b[_0x2f6270];return _0x3e55fb;};'use strict';var _=require('lodash');var util=require(_0xb239('0x0'));var moment=require(_0xb239('0x1'));var BPromise=require(_0xb239('0x2'));var rs=require(_0xb239('0x3'));var fs=require('fs');var Redis=require(_0xb239('0x4'));var db=require(_0xb239('0x5'))['db'];var utils=require(_0xb239('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb239('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb239('0x8')][_0xb239('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b6adb,_0x24c2dd,_0xd8ccae){return new BPromise(function(_0x512fad,_0x13a95d){return client[_0xb239('0xa')](_0x3b6adb,_0xd8ccae)[_0xb239('0xb')](function(_0x236ba5){logger[_0xb239('0xc')](_0xb239('0xd'),_0x24c2dd,_0xb239('0xe'));logger[_0xb239('0xf')](_0xb239('0x10'),_0x24c2dd,_0xb239('0xe'),JSON['stringify'](_0x236ba5));if(_0x236ba5[_0xb239('0x11')]){if(_0x236ba5[_0xb239('0x11')][_0xb239('0x12')]===0x1f4){logger[_0xb239('0x11')](_0xb239('0xd'),_0x24c2dd,_0x236ba5[_0xb239('0x11')][_0xb239('0x13')]);return _0x13a95d(_0x236ba5[_0xb239('0x11')][_0xb239('0x13')]);}logger[_0xb239('0x11')](_0xb239('0xd'),_0x24c2dd,_0x236ba5[_0xb239('0x11')][_0xb239('0x13')]);return _0x512fad(_0x236ba5['error'][_0xb239('0x13')]);}else{logger[_0xb239('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x24c2dd,_0xb239('0xe'));_0x512fad(_0x236ba5['result']['message']);}})[_0xb239('0x14')](function(_0x5180b2){logger[_0xb239('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x24c2dd,_0x5180b2);_0x13a95d(_0x5180b2);});});} \ No newline at end of file +var _0xa2d3=['debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x18cb3f,_0x4f89e2){var _0x278e5f=function(_0x553813){while(--_0x553813){_0x18cb3f['push'](_0x18cb3f['shift']());}};_0x278e5f(++_0x4f89e2);}(_0xa2d3,0x192));var _0x3a2d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa2d3[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x3a2d('0x0'));var util=require(_0x3a2d('0x1'));var moment=require('moment');var BPromise=require(_0x3a2d('0x2'));var rs=require(_0x3a2d('0x3'));var fs=require('fs');var Redis=require(_0x3a2d('0x4'));var db=require(_0x3a2d('0x5'))['db'];var utils=require(_0x3a2d('0x6'));var logger=require(_0x3a2d('0x7'))('rpc');var config=require(_0x3a2d('0x8'));var jayson=require(_0x3a2d('0x9'));var client=jayson[_0x3a2d('0xa')][_0x3a2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c3f79,_0x20afd1,_0x2a57b2){return new BPromise(function(_0x515828,_0x44b7a4){return client['request'](_0x4c3f79,_0x2a57b2)[_0x3a2d('0xc')](function(_0x54e188){logger[_0x3a2d('0xd')](_0x3a2d('0xe'),_0x20afd1,_0x3a2d('0xf'));logger[_0x3a2d('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x20afd1,_0x3a2d('0xf'),JSON[_0x3a2d('0x11')](_0x54e188));if(_0x54e188[_0x3a2d('0x12')]){if(_0x54e188[_0x3a2d('0x12')][_0x3a2d('0x13')]===0x1f4){logger[_0x3a2d('0x12')](_0x3a2d('0xe'),_0x20afd1,_0x54e188[_0x3a2d('0x12')]['message']);return _0x44b7a4(_0x54e188[_0x3a2d('0x12')][_0x3a2d('0x14')]);}logger['error'](_0x3a2d('0xe'),_0x20afd1,_0x54e188[_0x3a2d('0x12')][_0x3a2d('0x14')]);return _0x515828(_0x54e188[_0x3a2d('0x12')][_0x3a2d('0x14')]);}else{logger[_0x3a2d('0xd')](_0x3a2d('0xe'),_0x20afd1,_0x3a2d('0xf'));_0x515828(_0x54e188['result'][_0x3a2d('0x14')]);}})[_0x3a2d('0x15')](function(_0x13353a){logger[_0x3a2d('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x20afd1,_0x13353a);_0x44b7a4(_0x13353a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index ca2b2c1..e48a5c9 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 _0xa75b=['post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields'];(function(_0x4994c1,_0x270a86){var _0x287ee2=function(_0x3de8b8){while(--_0x3de8b8){_0x4994c1['push'](_0x4994c1['shift']());}};_0x287ee2(++_0x270a86);}(_0xa75b,0x170));var _0xba75=function(_0x50580d,_0x2f3b0f){_0x50580d=_0x50580d-0x0;var _0xf9eb79=_0xa75b[_0x50580d];return _0xf9eb79;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xba75('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['get'](_0xba75('0xe'),auth[_0xba75('0xa')](),controller[_0xba75('0xf')]);router[_0xba75('0x10')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0x11')]);router[_0xba75('0x10')](_0xba75('0x12'),auth[_0xba75('0xa')](),controller[_0xba75('0x13')]);router[_0xba75('0x14')](_0xba75('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xba75('0x15')]('/:id',auth[_0xba75('0xa')](),controller[_0xba75('0x16')]);module[_0xba75('0x17')]=router; \ No newline at end of file +var _0x0713=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','delete'];(function(_0x2cc809,_0x480a71){var _0x50bcd7=function(_0x566c5){while(--_0x566c5){_0x2cc809['push'](_0x2cc809['shift']());}};_0x50bcd7(++_0x480a71);}(_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['getConfigurations']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x10')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['put']('/:id',auth[_0x3071('0x9')](),controller['update']);router[_0x3071('0x13')](_0x3071('0xb'),auth['isAuthenticated'](),controller[_0x3071('0x14')]);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 701f7a9..9dc5460 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 _0x236c=['remoteUri','sequelize','STRING','username'];(function(_0xb766e5,_0x475cb3){var _0x16621e=function(_0x4d91f0){while(--_0x4d91f0){_0xb766e5['push'](_0xb766e5['shift']());}};_0x16621e(++_0x475cb3);}(_0x236c,0x155));var _0xc236=function(_0xb5a82,_0xfccfd2){_0xb5a82=_0xb5a82-0x0;var _0xc1d20e=_0x236c[_0xb5a82];return _0xc1d20e;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'name':{'type':Sequelize[_0xc236('0x1')]},'description':{'type':Sequelize[_0xc236('0x1')]},'username':{'type':Sequelize[_0xc236('0x1')],'unique':_0xc236('0x2')},'apiKey':{'type':Sequelize[_0xc236('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc236('0x3')},'serverUrl':{'type':Sequelize[_0xc236('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7096=['exports','STRING','username','remoteUri'];(function(_0x1b9d15,_0x865ca0){var _0x341118=function(_0x2c8d4c){while(--_0x2c8d4c){_0x1b9d15['push'](_0x1b9d15['shift']());}};_0x341118(++_0x865ca0);}(_0x7096,0x10c));var _0x6709=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7096[_0x6c993a];return _0x27f547;};'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/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 64ac681..324eab3 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 _0x762c=['Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','apply','then','error','stack','name','index','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','FreshsalesAccount','includeAll','include','findAll','catch','rawAttributes','length','create','update','body','find','params','destroy','findOne','FreshsalesConfiguration','filter','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email'];(function(_0x2f4081,_0x4010e7){var _0x14ef33=function(_0x5f57b7){while(--_0x5f57b7){_0x2f4081['push'](_0x2f4081['shift']());}};_0x14ef33(++_0x4010e7);}(_0x762c,0x19b));var _0xc762=function(_0x2296ee,_0xbe696c){_0x2296ee=_0x2296ee-0x0;var _0x52ac35=_0x762c[_0x2296ee];return _0x52ac35;};'use strict';var emlformat=require(_0xc762('0x0'));var rimraf=require(_0xc762('0x1'));var zipdir=require(_0xc762('0x2'));var jsonpatch=require(_0xc762('0x3'));var rp=require(_0xc762('0x4'));var moment=require(_0xc762('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc762('0x6'));var util=require(_0xc762('0x7'));var path=require(_0xc762('0x8'));var sox=require('sox');var csv=require(_0xc762('0x9'));var ejs=require(_0xc762('0xa'));var fs=require('fs');var fs_extra=require(_0xc762('0xb'));var _=require(_0xc762('0xc'));var squel=require('squel');var crypto=require(_0xc762('0xd'));var jsforce=require(_0xc762('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc762('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc762('0xf'));var authService=require(_0xc762('0x10'));var qs=require(_0xc762('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc762('0x12'));var logger=require(_0xc762('0x13'))('api');var utils=require(_0xc762('0x14'));var config=require(_0xc762('0x15'));var licenseUtil=require(_0xc762('0x16'));var db=require(_0xc762('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1c06f8,_0x31f70b){_0x31f70b=_0x31f70b||0xcc;return function(_0x1fdcc5){if(_0x1fdcc5){return _0x1c06f8['sendStatus'](_0x31f70b);}return _0x1c06f8['status'](_0x31f70b)[_0xc762('0x18')]();};}function respondWithResult(_0x11dd0d,_0x1da3f2){_0x1da3f2=_0x1da3f2||0xc8;return function(_0x382704){if(_0x382704){return _0x11dd0d[_0xc762('0x19')](_0x1da3f2)[_0xc762('0x1a')](_0x382704);}};}function respondWithFilteredResult(_0x1595ec,_0x33d99f){return function(_0x42b006){if(_0x42b006){var _0x40977d=typeof _0x33d99f[_0xc762('0x1b')]===_0xc762('0x1c')&&typeof _0x33d99f['limit']===_0xc762('0x1c');var _0x446eab=_0x42b006[_0xc762('0x1d')];var _0x402308=_0x40977d?0x0:_0x33d99f[_0xc762('0x1b')];var _0x5ddf43=_0x40977d?_0x42b006['count']:_0x33d99f['offset']+_0x33d99f[_0xc762('0x1e')];var _0x4d1d28;if(_0x5ddf43>=_0x446eab){_0x5ddf43=_0x446eab;_0x4d1d28=0xc8;}else{_0x4d1d28=0xce;}_0x1595ec[_0xc762('0x19')](_0x4d1d28);return _0x1595ec['set']('Content-Range',_0x402308+'-'+_0x5ddf43+'/'+_0x446eab)[_0xc762('0x1a')](_0x42b006);}return null;};}function patchUpdates(_0x19d578){return function(_0x16e1f2){try{jsonpatch[_0xc762('0x1f')](_0x16e1f2,_0x19d578,!![]);}catch(_0x12fc04){return BPromise['reject'](_0x12fc04);}return _0x16e1f2['save']();};}function saveUpdates(_0x487405,_0x1a5f75){return function(_0x7526c){if(_0x7526c){return _0x7526c['update'](_0x487405)[_0xc762('0x20')](function(_0x1ef0a7){return _0x1ef0a7;});}return null;};}function removeEntity(_0xb70f27,_0x436ae0){return function(_0x1c6a1a){if(_0x1c6a1a){return _0x1c6a1a['destroy']()[_0xc762('0x20')](function(){_0xb70f27[_0xc762('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2231,_0x5070b8){return function(_0x4c8cba){if(!_0x4c8cba){_0x5c2231['sendStatus'](0x194);}return _0x4c8cba;};}function handleError(_0x4ce695,_0x8e13c1){_0x8e13c1=_0x8e13c1||0x1f4;return function(_0x5a5210){logger[_0xc762('0x21')](_0x5a5210[_0xc762('0x22')]);if(_0x5a5210['name']){delete _0x5a5210[_0xc762('0x23')];}_0x4ce695['status'](_0x8e13c1)['send'](_0x5a5210);};}exports[_0xc762('0x24')]=function(_0x1b9c5f,_0x5c0fd9){var _0x7cbaca={},_0x54d724={},_0x38552a={'count':0x0,'rows':[]};var _0x69c00e=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x4dda4a){return{'name':_0x4dda4a[_0xc762('0x25')],'type':_0x4dda4a['type'][_0xc762('0x26')]};});_0x54d724[_0xc762('0x27')]=_[_0xc762('0x28')](_0x69c00e,'name');_0x54d724['query']=_[_0xc762('0x29')](_0x1b9c5f[_0xc762('0x2a')]);_0x54d724[_0xc762('0x2b')]=_[_0xc762('0x2c')](_0x54d724['model'],_0x54d724[_0xc762('0x2a')]);_0x7cbaca[_0xc762('0x2d')]=_[_0xc762('0x2c')](_0x54d724[_0xc762('0x27')],qs[_0xc762('0x2e')](_0x1b9c5f[_0xc762('0x2a')]['fields']));_0x7cbaca[_0xc762('0x2d')]=_0x7cbaca['attributes']['length']?_0x7cbaca['attributes']:_0x54d724[_0xc762('0x27')];if(!_0x1b9c5f[_0xc762('0x2a')][_0xc762('0x2f')](_0xc762('0x30'))){_0x7cbaca['limit']=qs[_0xc762('0x1e')](_0x1b9c5f[_0xc762('0x2a')][_0xc762('0x1e')]);_0x7cbaca[_0xc762('0x1b')]=qs[_0xc762('0x1b')](_0x1b9c5f['query'][_0xc762('0x1b')]);}_0x7cbaca[_0xc762('0x31')]=qs[_0xc762('0x32')](_0x1b9c5f[_0xc762('0x2a')][_0xc762('0x32')]);_0x7cbaca[_0xc762('0x33')]=qs[_0xc762('0x2b')](_[_0xc762('0x34')](_0x1b9c5f['query'],_0x54d724[_0xc762('0x2b')]),_0x69c00e);if(_0x1b9c5f[_0xc762('0x2a')]['filter']){_0x7cbaca[_0xc762('0x33')]=_[_0xc762('0x35')](_0x7cbaca['where'],{'$or':_[_0xc762('0x28')](_0x69c00e,function(_0x1ce721){if(_0x1ce721[_0xc762('0x36')]!==_0xc762('0x37')){var _0x18f12d={};_0x18f12d[_0x1ce721[_0xc762('0x23')]]={'$like':'%'+_0x1b9c5f[_0xc762('0x2a')]['filter']+'%'};return _0x18f12d;}})});}_0x7cbaca=_[_0xc762('0x35')]({},_0x7cbaca,_0x1b9c5f[_0xc762('0x38')]);var _0x185daf={'where':_0x7cbaca[_0xc762('0x33')]};return db[_0xc762('0x39')]['count'](_0x185daf)[_0xc762('0x20')](function(_0x22a997){_0x38552a[_0xc762('0x1d')]=_0x22a997;if(_0x1b9c5f[_0xc762('0x2a')][_0xc762('0x3a')]){_0x7cbaca[_0xc762('0x3b')]=[{'all':!![]}];}return db[_0xc762('0x39')][_0xc762('0x3c')](_0x7cbaca);})[_0xc762('0x20')](function(_0x3408d4){_0x38552a['rows']=_0x3408d4;return _0x38552a;})[_0xc762('0x20')](respondWithFilteredResult(_0x5c0fd9,_0x7cbaca))[_0xc762('0x3d')](handleError(_0x5c0fd9,null));};exports['show']=function(_0x381ad6,_0x3523a4){var _0x3ae74f={'raw':![],'where':{'id':_0x381ad6['params']['id']}},_0x4b4dc9={};_0x4b4dc9[_0xc762('0x27')]=_['keys'](db[_0xc762('0x39')][_0xc762('0x3e')]);_0x4b4dc9[_0xc762('0x2a')]=_[_0xc762('0x29')](_0x381ad6[_0xc762('0x2a')]);_0x4b4dc9[_0xc762('0x2b')]=_[_0xc762('0x2c')](_0x4b4dc9[_0xc762('0x27')],_0x4b4dc9[_0xc762('0x2a')]);_0x3ae74f['attributes']=_['intersection'](_0x4b4dc9[_0xc762('0x27')],qs['fields'](_0x381ad6[_0xc762('0x2a')][_0xc762('0x2e')]));_0x3ae74f[_0xc762('0x2d')]=_0x3ae74f[_0xc762('0x2d')][_0xc762('0x3f')]?_0x3ae74f[_0xc762('0x2d')]:_0x4b4dc9[_0xc762('0x27')];if(_0x381ad6['query'][_0xc762('0x3a')]){_0x3ae74f[_0xc762('0x3b')]=[{'all':!![]}];}_0x3ae74f=_[_0xc762('0x35')]({},_0x3ae74f,_0x381ad6[_0xc762('0x38')]);return db[_0xc762('0x39')]['find'](_0x3ae74f)[_0xc762('0x20')](handleEntityNotFound(_0x3523a4,null))[_0xc762('0x20')](respondWithResult(_0x3523a4,null))[_0xc762('0x3d')](handleError(_0x3523a4,null));};exports[_0xc762('0x40')]=function(_0x2a08f4,_0x3b9214){return db[_0xc762('0x39')]['create'](_0x2a08f4['body'],{})[_0xc762('0x20')](respondWithResult(_0x3b9214,0xc9))[_0xc762('0x3d')](handleError(_0x3b9214,null));};exports[_0xc762('0x41')]=function(_0x275f8d,_0x4a5254){if(_0x275f8d['body']['id']){delete _0x275f8d[_0xc762('0x42')]['id'];}return db[_0xc762('0x39')][_0xc762('0x43')]({'where':{'id':_0x275f8d[_0xc762('0x44')]['id']}})[_0xc762('0x20')](handleEntityNotFound(_0x4a5254,null))[_0xc762('0x20')](saveUpdates(_0x275f8d['body'],null))[_0xc762('0x20')](respondWithResult(_0x4a5254,null))[_0xc762('0x3d')](handleError(_0x4a5254,null));};exports[_0xc762('0x45')]=function(_0x2d46ef,_0x53aa51){return db['FreshsalesAccount'][_0xc762('0x43')]({'where':{'id':_0x2d46ef[_0xc762('0x44')]['id']}})['then'](handleEntityNotFound(_0x53aa51,null))['then'](removeEntity(_0x53aa51,null))[_0xc762('0x3d')](handleError(_0x53aa51,null));};exports['getConfigurations']=function(_0x2b6f36,_0x80c817,_0x2cd811){var _0x5c1e85={};var _0x2bd1cc={};var _0x16a0a7;var _0x459731;return db[_0xc762('0x39')][_0xc762('0x46')]({'where':{'id':_0x2b6f36[_0xc762('0x44')]['id']}})[_0xc762('0x20')](handleEntityNotFound(_0x80c817,null))['then'](function(_0x3d99c4){if(_0x3d99c4){_0x16a0a7=_0x3d99c4;_0x2bd1cc[_0xc762('0x27')]=_[_0xc762('0x29')](db[_0xc762('0x47')][_0xc762('0x3e')]);_0x2bd1cc[_0xc762('0x2a')]=_[_0xc762('0x29')](_0x2b6f36[_0xc762('0x2a')]);_0x2bd1cc['filters']=_[_0xc762('0x2c')](_0x2bd1cc['model'],_0x2bd1cc['query']);_0x5c1e85[_0xc762('0x2d')]=_[_0xc762('0x2c')](_0x2bd1cc[_0xc762('0x27')],qs[_0xc762('0x2e')](_0x2b6f36['query']['fields']));_0x5c1e85[_0xc762('0x2d')]=_0x5c1e85['attributes'][_0xc762('0x3f')]?_0x5c1e85[_0xc762('0x2d')]:_0x2bd1cc[_0xc762('0x27')];_0x5c1e85[_0xc762('0x31')]=qs[_0xc762('0x32')](_0x2b6f36[_0xc762('0x2a')]['sort']);_0x5c1e85['where']=qs[_0xc762('0x2b')](_[_0xc762('0x34')](_0x2b6f36[_0xc762('0x2a')],_0x2bd1cc[_0xc762('0x2b')]));if(_0x2b6f36[_0xc762('0x2a')][_0xc762('0x48')]){_0x5c1e85[_0xc762('0x33')]=_[_0xc762('0x35')](_0x5c1e85['where'],{'$or':_[_0xc762('0x28')](_0x5c1e85['attributes'],function(_0xacc43){var _0x3cf40a={};_0x3cf40a[_0xacc43]={'$like':'%'+_0x2b6f36['query'][_0xc762('0x48')]+'%'};return _0x3cf40a;})});}_0x5c1e85=_[_0xc762('0x35')]({},_0x5c1e85,_0x2b6f36[_0xc762('0x38')]);return _0x16a0a7[_0xc762('0x49')](_0x5c1e85);}})[_0xc762('0x20')](function(_0x5ac225){if(_0x5ac225){_0x459731=_0x5ac225[_0xc762('0x3f')];if(!_0x2b6f36['query'][_0xc762('0x2f')](_0xc762('0x30'))){_0x5c1e85[_0xc762('0x1e')]=qs['limit'](_0x2b6f36['query'][_0xc762('0x1e')]);_0x5c1e85[_0xc762('0x1b')]=qs['offset'](_0x2b6f36[_0xc762('0x2a')][_0xc762('0x1b')]);}return _0x16a0a7[_0xc762('0x49')](_0x5c1e85);}})['then'](function(_0x20a9ce){if(_0x20a9ce){return _0x20a9ce?{'count':_0x459731,'rows':_0x20a9ce}:null;}})['then'](respondWithResult(_0x80c817,null))[_0xc762('0x3d')](handleError(_0x80c817,null));};exports[_0xc762('0x4a')]=function(_0x3e3843,_0xe1e230,_0x19a555){if(_0x3e3843[_0xc762('0x42')]['id']){delete _0x3e3843['body']['id'];}return db['FreshsalesAccount'][_0xc762('0x46')]({'where':{'id':_0x3e3843['params']['id']}})['then'](handleEntityNotFound(_0xe1e230,null))[_0xc762('0x20')](function(_0x3eebe7){if(_0x3eebe7){_0x3e3843[_0xc762('0x42')][_0xc762('0x4b')]=_0x3eebe7['id'];_0x3e3843['body'][_0xc762('0x4c')]=integrations['getSubjects'](_0x3e3843['body'][_0xc762('0x4d')],_0x3e3843[_0xc762('0x42')][_0xc762('0x36')]);_0x3e3843[_0xc762('0x42')]['Descriptions']=integrations[_0xc762('0x4e')](_0x3e3843['body'][_0xc762('0x4d')],_0x3e3843['body']['type']);return db[_0xc762('0x47')][_0xc762('0x40')](_0x3e3843[_0xc762('0x42')],{'include':[{'model':db[_0xc762('0x4f')],'as':'Subjects'},{'model':db[_0xc762('0x4f')],'as':_0xc762('0x50')}]});}return null;})[_0xc762('0x20')](respondWithResult(_0xe1e230,null))[_0xc762('0x3d')](handleError(_0xe1e230,null));};exports[_0xc762('0x51')]=function(_0x2780e9,_0x50126a,_0x156a37){var _0xc3c74b='';var _0x44a5ae='';return db[_0xc762('0x39')]['findOne']({'where':{'id':_0x2780e9[_0xc762('0x44')]['id']},'attributes':['id',_0xc762('0x52'),_0xc762('0x53'),_0xc762('0x54')]})[_0xc762('0x20')](handleEntityNotFound(_0x50126a,null))['then'](function(_0x196c08){if(_0x196c08){_0x44a5ae=_0x196c08['username'];_0xc3c74b=_0x196c08['remoteUri'];var _0x37f211=_0x196c08[_0xc762('0x53')][_0xc762('0x55')](-0x1);if(_0x37f211==='/'){_0xc3c74b=_0xc3c74b[_0xc762('0x56')](0x0,_0xc3c74b[_0xc762('0x57')](_0x37f211));}return rp({'method':_0xc762('0x58'),'uri':util['format'](_0xc762('0x59'),_0xc3c74b,_0xc762('0x5a')),'headers':{'Authorization':_0xc762('0x5b')+_0x196c08['apiKey']},'json':!![]});}})[_0xc762('0x20')](function(_0x415ba5){if(_0x415ba5){var _0x3c938c=_0x415ba5[_0xc762('0x5c')];var _0x5db0d0=![];var _0x3ef8d9=null;for(_0x3ef8d9=0x0;_0x3ef8d9<_0x3c938c[_0xc762('0x3f')];_0x3ef8d9++){if(_0x3c938c[_0x3ef8d9][_0xc762('0x5d')]===_0x44a5ae){_0x5db0d0=!![];}}if(_0x5db0d0){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc762('0x5e')});}}})[_0xc762('0x20')](respondWithResult(_0x50126a,null))['catch'](function(_0x1f3580){var _0x20debe=_0x2780e9[_0xc762('0x2a')]['test']?0x1f4:_0x1f3580[_0xc762('0x5f')]||0x1f4;logger[_0xc762('0x21')](_0xc762('0x60'),'getFields',_0x20debe,JSON[_0xc762('0x61')](_0x1f3580));delete _0x1f3580[_0xc762('0x23')];if(_0x20debe===0x191){_0x20debe=0x190;}_0x50126a[_0xc762('0x19')](_0x20debe)[_0xc762('0x62')](_0x2780e9[_0xc762('0x2a')][_0xc762('0x63')]?{'message':_0xc762('0x64'),'statusCode':_0x1f3580[_0xc762('0x5f')]}:_0x1f3580);});}; \ No newline at end of file +var _0xc4fa=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','show','find','catch','body','params','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','create','FreshsalesField','getFields','username','remoteUri','slice','substring','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','name','test','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xc4fa,0x118));var _0xac4f=function(_0x28378a,_0x32a231){_0x28378a=_0x28378a-0x0;var _0x35fa9b=_0xc4fa[_0x28378a];return _0x35fa9b;};'use strict';var emlformat=require(_0xac4f('0x0'));var rimraf=require(_0xac4f('0x1'));var zipdir=require(_0xac4f('0x2'));var jsonpatch=require(_0xac4f('0x3'));var rp=require('request-promise');var moment=require(_0xac4f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac4f('0x5'));var util=require(_0xac4f('0x6'));var path=require(_0xac4f('0x7'));var sox=require(_0xac4f('0x8'));var csv=require(_0xac4f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac4f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xac4f('0xb'));var toCsv=require(_0xac4f('0x9'));var querystring=require(_0xac4f('0xc'));var Papa=require('papaparse');var Redis=require(_0xac4f('0xd'));var authService=require(_0xac4f('0xe'));var qs=require(_0xac4f('0xf'));var as=require(_0xac4f('0x10'));var hardwareService=require(_0xac4f('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xac4f('0x12'));var licenseUtil=require(_0xac4f('0x13'));var db=require(_0xac4f('0x14'))['db'];var integrations=require(_0xac4f('0x15'));function respondWithStatusCode(_0x5940b5,_0x35f691){_0x35f691=_0x35f691||0xcc;return function(_0xb8065e){if(_0xb8065e){return _0x5940b5['sendStatus'](_0x35f691);}return _0x5940b5['status'](_0x35f691)['end']();};}function respondWithResult(_0x201579,_0x4676bb){_0x4676bb=_0x4676bb||0xc8;return function(_0x244752){if(_0x244752){return _0x201579[_0xac4f('0x16')](_0x4676bb)[_0xac4f('0x17')](_0x244752);}};}function respondWithFilteredResult(_0x23a5f6,_0x2148f9){return function(_0x4b8fc6){if(_0x4b8fc6){var _0x4c7cb7=typeof _0x2148f9[_0xac4f('0x18')]==='undefined'&&typeof _0x2148f9[_0xac4f('0x19')]==='undefined';var _0x3b5045=_0x4b8fc6['count'];var _0x38d237=_0x4c7cb7?0x0:_0x2148f9[_0xac4f('0x18')];var _0xcf538f=_0x4c7cb7?_0x4b8fc6[_0xac4f('0x1a')]:_0x2148f9[_0xac4f('0x18')]+_0x2148f9['limit'];var _0x2b54a3;if(_0xcf538f>=_0x3b5045){_0xcf538f=_0x3b5045;_0x2b54a3=0xc8;}else{_0x2b54a3=0xce;}_0x23a5f6[_0xac4f('0x16')](_0x2b54a3);return _0x23a5f6[_0xac4f('0x1b')](_0xac4f('0x1c'),_0x38d237+'-'+_0xcf538f+'/'+_0x3b5045)['json'](_0x4b8fc6);}return null;};}function patchUpdates(_0xcbea33){return function(_0x1d013a){try{jsonpatch['apply'](_0x1d013a,_0xcbea33,!![]);}catch(_0x1b8628){return BPromise[_0xac4f('0x1d')](_0x1b8628);}return _0x1d013a[_0xac4f('0x1e')]();};}function saveUpdates(_0x401a30,_0xf8ad36){return function(_0x75d256){if(_0x75d256){return _0x75d256['update'](_0x401a30)[_0xac4f('0x1f')](function(_0x547474){return _0x547474;});}return null;};}function removeEntity(_0x1c0c9c,_0x1716b7){return function(_0x2316ee){if(_0x2316ee){return _0x2316ee[_0xac4f('0x20')]()[_0xac4f('0x1f')](function(){_0x1c0c9c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b876,_0x5ce9cf){return function(_0x187f96){if(!_0x187f96){_0x59b876[_0xac4f('0x21')](0x194);}return _0x187f96;};}function handleError(_0x19e2e8,_0xe2637f){_0xe2637f=_0xe2637f||0x1f4;return function(_0x284cb4){logger[_0xac4f('0x22')](_0x284cb4[_0xac4f('0x23')]);if(_0x284cb4['name']){delete _0x284cb4['name'];}_0x19e2e8[_0xac4f('0x16')](_0xe2637f)[_0xac4f('0x24')](_0x284cb4);};}exports[_0xac4f('0x25')]=function(_0x1bf3e3,_0x4f7fa){var _0x94edf={},_0x3bf7ad={},_0x3655fa={'count':0x0,'rows':[]};var _0x447184=_[_0xac4f('0x26')](db[_0xac4f('0x27')][_0xac4f('0x28')],function(_0x5d1bf6){return{'name':_0x5d1bf6[_0xac4f('0x29')],'type':_0x5d1bf6[_0xac4f('0x2a')][_0xac4f('0x2b')]};});_0x3bf7ad[_0xac4f('0x2c')]=_['map'](_0x447184,'name');_0x3bf7ad[_0xac4f('0x2d')]=_[_0xac4f('0x2e')](_0x1bf3e3[_0xac4f('0x2d')]);_0x3bf7ad[_0xac4f('0x2f')]=_[_0xac4f('0x30')](_0x3bf7ad['model'],_0x3bf7ad[_0xac4f('0x2d')]);_0x94edf[_0xac4f('0x31')]=_[_0xac4f('0x30')](_0x3bf7ad['model'],qs[_0xac4f('0x32')](_0x1bf3e3['query'][_0xac4f('0x32')]));_0x94edf[_0xac4f('0x31')]=_0x94edf[_0xac4f('0x31')][_0xac4f('0x33')]?_0x94edf[_0xac4f('0x31')]:_0x3bf7ad[_0xac4f('0x2c')];if(!_0x1bf3e3['query'][_0xac4f('0x34')](_0xac4f('0x35'))){_0x94edf[_0xac4f('0x19')]=qs[_0xac4f('0x19')](_0x1bf3e3[_0xac4f('0x2d')][_0xac4f('0x19')]);_0x94edf[_0xac4f('0x18')]=qs['offset'](_0x1bf3e3[_0xac4f('0x2d')][_0xac4f('0x18')]);}_0x94edf[_0xac4f('0x36')]=qs[_0xac4f('0x37')](_0x1bf3e3[_0xac4f('0x2d')][_0xac4f('0x37')]);_0x94edf[_0xac4f('0x38')]=qs[_0xac4f('0x2f')](_[_0xac4f('0x39')](_0x1bf3e3[_0xac4f('0x2d')],_0x3bf7ad[_0xac4f('0x2f')]),_0x447184);if(_0x1bf3e3[_0xac4f('0x2d')]['filter']){_0x94edf[_0xac4f('0x38')]=_[_0xac4f('0x3a')](_0x94edf['where'],{'$or':_['map'](_0x447184,function(_0x3e762d){if(_0x3e762d[_0xac4f('0x2a')]!=='VIRTUAL'){var _0x54ca17={};_0x54ca17[_0x3e762d['name']]={'$like':'%'+_0x1bf3e3[_0xac4f('0x2d')][_0xac4f('0x3b')]+'%'};return _0x54ca17;}})});}_0x94edf=_[_0xac4f('0x3a')]({},_0x94edf,_0x1bf3e3[_0xac4f('0x3c')]);var _0x35ac11={'where':_0x94edf[_0xac4f('0x38')]};return db[_0xac4f('0x27')][_0xac4f('0x1a')](_0x35ac11)[_0xac4f('0x1f')](function(_0x32b0a7){_0x3655fa[_0xac4f('0x1a')]=_0x32b0a7;if(_0x1bf3e3[_0xac4f('0x2d')][_0xac4f('0x3d')]){_0x94edf[_0xac4f('0x3e')]=[{'all':!![]}];}return db[_0xac4f('0x27')]['findAll'](_0x94edf);})[_0xac4f('0x1f')](function(_0x5e0237){_0x3655fa[_0xac4f('0x3f')]=_0x5e0237;return _0x3655fa;})['then'](respondWithFilteredResult(_0x4f7fa,_0x94edf))['catch'](handleError(_0x4f7fa,null));};exports[_0xac4f('0x40')]=function(_0x486429,_0x51d2cd){var _0x52fd31={'raw':![],'where':{'id':_0x486429['params']['id']}},_0x5464c9={};_0x5464c9['model']=_[_0xac4f('0x2e')](db[_0xac4f('0x27')][_0xac4f('0x28')]);_0x5464c9[_0xac4f('0x2d')]=_[_0xac4f('0x2e')](_0x486429[_0xac4f('0x2d')]);_0x5464c9[_0xac4f('0x2f')]=_['intersection'](_0x5464c9[_0xac4f('0x2c')],_0x5464c9[_0xac4f('0x2d')]);_0x52fd31['attributes']=_[_0xac4f('0x30')](_0x5464c9['model'],qs[_0xac4f('0x32')](_0x486429[_0xac4f('0x2d')][_0xac4f('0x32')]));_0x52fd31['attributes']=_0x52fd31[_0xac4f('0x31')][_0xac4f('0x33')]?_0x52fd31[_0xac4f('0x31')]:_0x5464c9[_0xac4f('0x2c')];if(_0x486429[_0xac4f('0x2d')][_0xac4f('0x3d')]){_0x52fd31['include']=[{'all':!![]}];}_0x52fd31=_[_0xac4f('0x3a')]({},_0x52fd31,_0x486429[_0xac4f('0x3c')]);return db['FreshsalesAccount'][_0xac4f('0x41')](_0x52fd31)['then'](handleEntityNotFound(_0x51d2cd,null))['then'](respondWithResult(_0x51d2cd,null))[_0xac4f('0x42')](handleError(_0x51d2cd,null));};exports['create']=function(_0x51abca,_0x1ce403){return db['FreshsalesAccount']['create'](_0x51abca[_0xac4f('0x43')],{})['then'](respondWithResult(_0x1ce403,0xc9))[_0xac4f('0x42')](handleError(_0x1ce403,null));};exports['update']=function(_0x2a59af,_0x1a4b71){if(_0x2a59af[_0xac4f('0x43')]['id']){delete _0x2a59af['body']['id'];}return db[_0xac4f('0x27')][_0xac4f('0x41')]({'where':{'id':_0x2a59af['params']['id']}})[_0xac4f('0x1f')](handleEntityNotFound(_0x1a4b71,null))[_0xac4f('0x1f')](saveUpdates(_0x2a59af[_0xac4f('0x43')],null))['then'](respondWithResult(_0x1a4b71,null))['catch'](handleError(_0x1a4b71,null));};exports[_0xac4f('0x20')]=function(_0x3cf84f,_0x479e86){return db[_0xac4f('0x27')][_0xac4f('0x41')]({'where':{'id':_0x3cf84f[_0xac4f('0x44')]['id']}})[_0xac4f('0x1f')](handleEntityNotFound(_0x479e86,null))[_0xac4f('0x1f')](removeEntity(_0x479e86,null))[_0xac4f('0x42')](handleError(_0x479e86,null));};exports['getConfigurations']=function(_0x209d07,_0xe06efe,_0x3d1a12){var _0xa4eb2d={};var _0xadbe11={};var _0x4a1ee2;var _0x2723aa;return db[_0xac4f('0x27')][_0xac4f('0x45')]({'where':{'id':_0x209d07[_0xac4f('0x44')]['id']}})[_0xac4f('0x1f')](handleEntityNotFound(_0xe06efe,null))[_0xac4f('0x1f')](function(_0x5d299d){if(_0x5d299d){_0x4a1ee2=_0x5d299d;_0xadbe11[_0xac4f('0x2c')]=_['keys'](db[_0xac4f('0x46')][_0xac4f('0x28')]);_0xadbe11[_0xac4f('0x2d')]=_[_0xac4f('0x2e')](_0x209d07[_0xac4f('0x2d')]);_0xadbe11[_0xac4f('0x2f')]=_[_0xac4f('0x30')](_0xadbe11[_0xac4f('0x2c')],_0xadbe11[_0xac4f('0x2d')]);_0xa4eb2d[_0xac4f('0x31')]=_[_0xac4f('0x30')](_0xadbe11[_0xac4f('0x2c')],qs[_0xac4f('0x32')](_0x209d07[_0xac4f('0x2d')]['fields']));_0xa4eb2d['attributes']=_0xa4eb2d[_0xac4f('0x31')][_0xac4f('0x33')]?_0xa4eb2d[_0xac4f('0x31')]:_0xadbe11[_0xac4f('0x2c')];_0xa4eb2d[_0xac4f('0x36')]=qs[_0xac4f('0x37')](_0x209d07[_0xac4f('0x2d')]['sort']);_0xa4eb2d[_0xac4f('0x38')]=qs['filters'](_['pick'](_0x209d07['query'],_0xadbe11['filters']));if(_0x209d07[_0xac4f('0x2d')][_0xac4f('0x3b')]){_0xa4eb2d[_0xac4f('0x38')]=_[_0xac4f('0x3a')](_0xa4eb2d[_0xac4f('0x38')],{'$or':_[_0xac4f('0x26')](_0xa4eb2d[_0xac4f('0x31')],function(_0x5dcc36){var _0x4bb23e={};_0x4bb23e[_0x5dcc36]={'$like':'%'+_0x209d07[_0xac4f('0x2d')]['filter']+'%'};return _0x4bb23e;})});}_0xa4eb2d=_[_0xac4f('0x3a')]({},_0xa4eb2d,_0x209d07[_0xac4f('0x3c')]);return _0x4a1ee2[_0xac4f('0x47')](_0xa4eb2d);}})[_0xac4f('0x1f')](function(_0x4772a7){if(_0x4772a7){_0x2723aa=_0x4772a7['length'];if(!_0x209d07[_0xac4f('0x2d')]['hasOwnProperty'](_0xac4f('0x35'))){_0xa4eb2d[_0xac4f('0x19')]=qs[_0xac4f('0x19')](_0x209d07[_0xac4f('0x2d')]['limit']);_0xa4eb2d[_0xac4f('0x18')]=qs[_0xac4f('0x18')](_0x209d07['query'][_0xac4f('0x18')]);}return _0x4a1ee2[_0xac4f('0x47')](_0xa4eb2d);}})[_0xac4f('0x1f')](function(_0x4f142e){if(_0x4f142e){return _0x4f142e?{'count':_0x2723aa,'rows':_0x4f142e}:null;}})['then'](respondWithResult(_0xe06efe,null))[_0xac4f('0x42')](handleError(_0xe06efe,null));};exports[_0xac4f('0x48')]=function(_0x310e81,_0x14ed74,_0x47f18b){if(_0x310e81[_0xac4f('0x43')]['id']){delete _0x310e81[_0xac4f('0x43')]['id'];}return db[_0xac4f('0x27')][_0xac4f('0x45')]({'where':{'id':_0x310e81['params']['id']}})[_0xac4f('0x1f')](handleEntityNotFound(_0x14ed74,null))[_0xac4f('0x1f')](function(_0x5dea6c){if(_0x5dea6c){_0x310e81['body'][_0xac4f('0x49')]=_0x5dea6c['id'];_0x310e81[_0xac4f('0x43')][_0xac4f('0x4a')]=integrations[_0xac4f('0x4b')](_0x310e81['body'][_0xac4f('0x4c')],_0x310e81[_0xac4f('0x43')]['type']);_0x310e81['body']['Descriptions']=integrations[_0xac4f('0x4d')](_0x310e81['body'][_0xac4f('0x4c')],_0x310e81[_0xac4f('0x43')][_0xac4f('0x2a')]);return db[_0xac4f('0x46')][_0xac4f('0x4e')](_0x310e81[_0xac4f('0x43')],{'include':[{'model':db[_0xac4f('0x4f')],'as':_0xac4f('0x4a')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x14ed74,null))[_0xac4f('0x42')](handleError(_0x14ed74,null));};exports[_0xac4f('0x50')]=function(_0x5e44ef,_0xd9cd57,_0x29b585){var _0x4e62df='';var _0x4b3d41='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x5e44ef[_0xac4f('0x44')]['id']},'attributes':['id','username','remoteUri','apiKey']})[_0xac4f('0x1f')](handleEntityNotFound(_0xd9cd57,null))[_0xac4f('0x1f')](function(_0x386eae){if(_0x386eae){_0x4b3d41=_0x386eae[_0xac4f('0x51')];_0x4e62df=_0x386eae[_0xac4f('0x52')];var _0x4dc8b1=_0x386eae['remoteUri'][_0xac4f('0x53')](-0x1);if(_0x4dc8b1==='/'){_0x4e62df=_0x4e62df[_0xac4f('0x54')](0x0,_0x4e62df['lastIndexOf'](_0x4dc8b1));}return rp({'method':'GET','uri':util[_0xac4f('0x55')](_0xac4f('0x56'),_0x4e62df,_0xac4f('0x57')),'headers':{'Authorization':_0xac4f('0x58')+_0x386eae[_0xac4f('0x59')]},'json':!![]});}})['then'](function(_0x5553ed){if(_0x5553ed){var _0xe8fa65=_0x5553ed[_0xac4f('0x5a')];var _0x1f9957=![];var _0x530201=null;for(_0x530201=0x0;_0x530201<_0xe8fa65['length'];_0x530201++){if(_0xe8fa65[_0x530201][_0xac4f('0x5b')]===_0x4b3d41){_0x1f9957=!![];}}if(_0x1f9957){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xac4f('0x1f')](respondWithResult(_0xd9cd57,null))[_0xac4f('0x42')](function(_0xad568f){var _0x490616=_0x5e44ef[_0xac4f('0x2d')]['test']?0x1f4:_0xad568f[_0xac4f('0x5c')]||0x1f4;logger['error'](_0xac4f('0x5d'),_0xac4f('0x50'),_0x490616,JSON[_0xac4f('0x5e')](_0xad568f));delete _0xad568f[_0xac4f('0x5f')];if(_0x490616===0x191){_0x490616=0x190;}_0xd9cd57[_0xac4f('0x16')](_0x490616)[_0xac4f('0x24')](_0x5e44ef[_0xac4f('0x2d')][_0xac4f('0x60')]?{'message':'Wrong\x20credentials','statusCode':_0xad568f[_0xac4f('0x5c')]}:_0xad568f);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 5db3d12..750f0b6 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 _0xa456=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x4ecadb,_0x5f4910){var _0xfff923=function(_0x5c2883){while(--_0x5c2883){_0x4ecadb['push'](_0x4ecadb['shift']());}};_0xfff923(++_0x5f4910);}(_0xa456,0x142));var _0x6a45=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xa456[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));var integrations=require(_0x6a45('0x9'));module[_0x6a45('0xa')]=function(_0x4dfbfa,_0x25cf8d){return _0x4dfbfa[_0x6a45('0xb')](_0x6a45('0xc'),attributes,{'tableName':_0x6a45('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x524e=['define','int_freshsales_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x524cf2,_0x2f126f){var _0x24d82b=function(_0x1c4571){while(--_0x1c4571){_0x524cf2['push'](_0x524cf2['shift']());}};_0x24d82b(++_0x2f126f);}(_0x524e,0x15e));var _0xe524=function(_0x2b31b6,_0x4eea46){_0x2b31b6=_0x2b31b6-0x0;var _0x1edcd0=_0x524e[_0x2b31b6];return _0x1edcd0;};'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'));var integrations=require(_0xe524('0x9'));module['exports']=function(_0xaaeaa9,_0x41e1a3){return _0xaaeaa9[_0xe524('0xa')]('FreshsalesAccount',attributes,{'tableName':_0xe524('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index b15ff80..112a0a9 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','FreshsalesAccount','lodash','util'];(function(_0x5e7391,_0x3babb0){var _0x1f9374=function(_0x5eefe1){while(--_0x5eefe1){_0x5e7391['push'](_0x5e7391['shift']());}};_0x1f9374(++_0x3babb0);}(_0xdb28,0x106));var _0x8db2=function(_0x427994,_0x2ab2ec){_0x427994=_0x427994-0x0;var _0x34c357=_0xdb28[_0x427994];return _0x34c357;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['FreshsalesAccount'][_0x8db2('0x17')]({'raw':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1a')]||null:null,'attributes':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1b')]||null:null,'limit':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1c')]||null:null,'include':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x3fddc2[_0x8db2('0x18')]['include'],function(_0x256202){return{'model':db[_0x256202['model']],'as':_0x256202['as'],'attributes':_0x256202['attributes'],'include':_0x256202['include']?_['map'](_0x256202[_0x8db2('0x1d')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x1f')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x1b')],'include':_0x29b5cd[_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x1f')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x483aee){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')](_0x8db2('0x16'),_0x3fddc2,JSON[_0x8db2('0x10')](_0x483aee));_0x46ce14(_0x483aee);})[_0x8db2('0x15')](function(_0xa54ea3){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0xa54ea3['message'],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0xa54ea3['message']));});});};exports['ShowFreshsalesAccount']=function(_0x302188){var _0x25ed2c=this;return new Promise(function(_0xcc8a66,_0x49b2b3){return db[_0x8db2('0x20')]['find']({'raw':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x302188['options']?_0x302188['options'][_0x8db2('0x1a')]||null:null,'attributes':_0x302188[_0x8db2('0x18')]?_0x302188['options']['attributes']||null:null,'include':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')],function(_0x101711){return{'model':db[_0x101711[_0x8db2('0x1f')]],'as':_0x101711['as'],'attributes':_0x101711[_0x8db2('0x1b')],'include':_0x101711[_0x8db2('0x1d')]?_['map'](_0x101711[_0x8db2('0x1d')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x1b')],'include':_0x304a72[_0x8db2('0x1d')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x26717d){logger[_0x8db2('0x14')]('ShowFreshsalesAccount',_0x302188);logger[_0x8db2('0xf')]('ShowFreshsalesAccount',_0x302188,JSON[_0x8db2('0x10')](_0x26717d));_0xcc8a66(_0x26717d);})[_0x8db2('0x15')](function(_0x2c8bc9){logger[_0x8db2('0x11')]('ShowFreshsalesAccount',_0x2c8bc9['message'],_0x302188);_0x49b2b3(_0x25ed2c[_0x8db2('0x11')](0x1f4,_0x2c8bc9[_0x8db2('0x13')]));});});}; \ No newline at end of file +var _0xafc4=['raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFreshsalesAccount','FreshsalesAccount','options'];(function(_0x41beb0,_0x2298de){var _0x77cc6f=function(_0x2f2cce){while(--_0x2f2cce){_0x41beb0['push'](_0x41beb0['shift']());}};_0x77cc6f(++_0x2298de);}(_0xafc4,0x69));var _0x4afc=function(_0x2367cb,_0xf1d2d7){_0x2367cb=_0x2367cb-0x0;var _0x470d82=_0xafc4[_0x2367cb];return _0x470d82;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}exports[_0x4afc('0x14')]=function(_0x22f809){var _0x3ad418=this;return new Promise(function(_0x16365f,_0x135349){return db[_0x4afc('0x15')]['findAll']({'raw':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x22f809[_0x4afc('0x16')]?_0x22f809['options'][_0x4afc('0x18')]||null:null,'attributes':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x19')]||null:null,'limit':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1a')]||null:null,'include':_0x22f809['options']?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1b')]?_['map'](_0x22f809[_0x4afc('0x16')]['include'],function(_0x1aa676){return{'model':db[_0x1aa676[_0x4afc('0x1c')]],'as':_0x1aa676['as'],'attributes':_0x1aa676[_0x4afc('0x19')],'include':_0x1aa676[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x1aa676[_0x4afc('0x1b')],function(_0x40a0db){return{'model':db[_0x40a0db[_0x4afc('0x1c')]],'as':_0x40a0db['as'],'attributes':_0x40a0db[_0x4afc('0x19')],'include':_0x40a0db[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x40a0db[_0x4afc('0x1b')],function(_0x35f5b3){return{'model':db[_0x35f5b3['model']],'as':_0x35f5b3['as'],'attributes':_0x35f5b3[_0x4afc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4afc('0xa')](function(_0x2d6112){logger['info']('GetFreshsalesAccount',_0x22f809);logger['debug'](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x2d6112));_0x16365f(_0x2d6112);})['catch'](function(_0xd26d2f){logger[_0x4afc('0xf')]('GetFreshsalesAccount',_0xd26d2f['message'],_0x22f809);_0x135349(_0x3ad418['error'](0x1f4,_0xd26d2f[_0x4afc('0x11')]));});});};exports[_0x4afc('0x1e')]=function(_0x17a43d){var _0x46357b=this;return new Promise(function(_0xc1d91,_0x28cd3e){return db['FreshsalesAccount'][_0x4afc('0x1f')]({'raw':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x18')]||null:null,'attributes':_0x17a43d[_0x4afc('0x16')]?_0x17a43d['options'][_0x4afc('0x19')]||null:null,'include':_0x17a43d['options']?_0x17a43d['options'][_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x17a43d[_0x4afc('0x16')][_0x4afc('0x1b')],function(_0x3ec6fa){return{'model':db[_0x3ec6fa[_0x4afc('0x1c')]],'as':_0x3ec6fa['as'],'attributes':_0x3ec6fa['attributes'],'include':_0x3ec6fa[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x3ec6fa[_0x4afc('0x1b')],function(_0x127ac8){return{'model':db[_0x127ac8[_0x4afc('0x1c')]],'as':_0x127ac8['as'],'attributes':_0x127ac8[_0x4afc('0x19')],'include':_0x127ac8['include']?_[_0x4afc('0x1d')](_0x127ac8[_0x4afc('0x1b')],function(_0x91565d){return{'model':db[_0x91565d[_0x4afc('0x1c')]],'as':_0x91565d['as'],'attributes':_0x91565d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c341){logger[_0x4afc('0xb')](_0x4afc('0x1e'),_0x17a43d);logger['debug']('ShowFreshsalesAccount',_0x17a43d,JSON[_0x4afc('0xe')](_0x43c341));_0xc1d91(_0x43c341);})['catch'](function(_0x5947bb){logger[_0x4afc('0xf')](_0x4afc('0x1e'),_0x5947bb[_0x4afc('0x11')],_0x17a43d);_0x28cd3e(_0x46357b[_0x4afc('0xf')](0x1f4,_0x5947bb[_0x4afc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 18fa8a8..8429ce6 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 _0x9233=['get','isAuthenticated','index','/:id','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x196a19,_0x235769){var _0x3e957a=function(_0x5aa496){while(--_0x5aa496){_0x196a19['push'](_0x196a19['shift']());}};_0x3e957a(++_0x235769);}(_0x9233,0x1ae));var _0x3923=function(_0x3eb8a2,_0x212a08){_0x3eb8a2=_0x3eb8a2-0x0;var _0x1ffdca=_0x9233[_0x3eb8a2];return _0x1ffdca;};'use strict';var multer=require('multer');var util=require(_0x3923('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3923('0x1'));var router=express[_0x3923('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3923('0x3'));var interaction=require(_0x3923('0x4'));var config=require(_0x3923('0x5'));var controller=require(_0x3923('0x6'));router[_0x3923('0x7')]('/',auth[_0x3923('0x8')](),controller[_0x3923('0x9')]);router[_0x3923('0x7')](_0x3923('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3923('0x7')]('/:id/subjects',auth[_0x3923('0x8')](),controller[_0x3923('0xb')]);router[_0x3923('0x7')](_0x3923('0xc'),auth[_0x3923('0x8')](),controller[_0x3923('0xd')]);router['get'](_0x3923('0xe'),auth[_0x3923('0x8')](),controller[_0x3923('0xf')]);router[_0x3923('0x10')]('/',auth[_0x3923('0x8')](),controller[_0x3923('0x11')]);router[_0x3923('0x12')](_0x3923('0xa'),auth[_0x3923('0x8')](),controller[_0x3923('0x13')]);router[_0x3923('0x14')](_0x3923('0xa'),auth['isAuthenticated'](),controller[_0x3923('0x15')]);module[_0x3923('0x16')]=router; \ No newline at end of file +var _0xb22a=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb22a,0x1ee));var _0xab22=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xb22a[_0x3b5049];return _0x12454e;};'use strict';var multer=require(_0xab22('0x0'));var util=require(_0xab22('0x1'));var path=require(_0xab22('0x2'));var timeout=require(_0xab22('0x3'));var express=require(_0xab22('0x4'));var router=express[_0xab22('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xab22('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xab22('0x7'));var controller=require(_0xab22('0x8'));router[_0xab22('0x9')]('/',auth[_0xab22('0xa')](),controller['index']);router['get'](_0xab22('0xb'),auth[_0xab22('0xa')](),controller['show']);router[_0xab22('0x9')](_0xab22('0xc'),auth[_0xab22('0xa')](),controller[_0xab22('0xd')]);router[_0xab22('0x9')](_0xab22('0xe'),auth['isAuthenticated'](),controller[_0xab22('0xf')]);router[_0xab22('0x9')]('/:id/fields',auth[_0xab22('0xa')](),controller[_0xab22('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xab22('0x11')]);router['put'](_0xab22('0xb'),auth['isAuthenticated'](),controller[_0xab22('0x12')]);router[_0xab22('0x13')](_0xab22('0xb'),auth[_0xab22('0xa')](),controller[_0xab22('0x14')]);module[_0xab22('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 f5ac0d3..0264a05 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 _0xc43c=['exports','STRING'];(function(_0x130081,_0x17f937){var _0x18f2fb=function(_0x3c1303){while(--_0x3c1303){_0x130081['push'](_0x130081['shift']());}};_0x18f2fb(++_0x17f937);}(_0xc43c,0xfa));var _0xcc43=function(_0x5a57a4,_0x31576b){_0x5a57a4=_0x5a57a4-0x0;var _0x1ae310=_0xc43c[_0x5a57a4];return _0x1ae310;};'use strict';var Sequelize=require('sequelize');module[_0xcc43('0x0')]={'name':{'type':Sequelize[_0xcc43('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c2d=['sequelize','exports','STRING'];(function(_0xd8a3c1,_0x5780bd){var _0x28cad0=function(_0x51850f){while(--_0x51850f){_0xd8a3c1['push'](_0xd8a3c1['shift']());}};_0x28cad0(++_0x5780bd);}(_0x1c2d,0x81));var _0xd1c2=function(_0x11cf69,_0x4c6589){_0x11cf69=_0x11cf69-0x0;var _0x12fa1c=_0x1c2d[_0x11cf69];return _0x12fa1c;};'use strict';var Sequelize=require(_0xd1c2('0x0'));module[_0xd1c2('0x1')]={'name':{'type':Sequelize[_0xd1c2('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 3ff503a..6487ce5 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 _0xe076=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','FreshsalesConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','show','params','keys','length','find','catch','body','getSubjects','findOne','getDescriptions','FreshsalesField','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x54936e,_0x319325){var _0x5cc6a0=function(_0x31a907){while(--_0x31a907){_0x54936e['push'](_0x54936e['shift']());}};_0x5cc6a0(++_0x319325);}(_0xe076,0x1ca));var _0x6e07=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xe076[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e07('0x0'));var zipdir=require(_0x6e07('0x1'));var jsonpatch=require(_0x6e07('0x2'));var rp=require(_0x6e07('0x3'));var moment=require(_0x6e07('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6e07('0x5'));var util=require(_0x6e07('0x6'));var path=require(_0x6e07('0x7'));var sox=require(_0x6e07('0x8'));var csv=require(_0x6e07('0x9'));var ejs=require(_0x6e07('0xa'));var fs=require('fs');var fs_extra=require(_0x6e07('0xb'));var _=require(_0x6e07('0xc'));var squel=require(_0x6e07('0xd'));var crypto=require(_0x6e07('0xe'));var jsforce=require(_0x6e07('0xf'));var deskjs=require(_0x6e07('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6e07('0x11'));var Redis=require(_0x6e07('0x12'));var authService=require(_0x6e07('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6e07('0x14'));var hardwareService=require(_0x6e07('0x15'));var logger=require(_0x6e07('0x16'))(_0x6e07('0x17'));var utils=require(_0x6e07('0x18'));var config=require(_0x6e07('0x19'));var licenseUtil=require(_0x6e07('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b3ef,_0x29bce3){_0x29bce3=_0x29bce3||0xcc;return function(_0x52774a){if(_0x52774a){return _0x52b3ef[_0x6e07('0x1b')](_0x29bce3);}return _0x52b3ef['status'](_0x29bce3)[_0x6e07('0x1c')]();};}function respondWithResult(_0x2a3add,_0x43a548){_0x43a548=_0x43a548||0xc8;return function(_0x2ee73d){if(_0x2ee73d){return _0x2a3add[_0x6e07('0x1d')](_0x43a548)[_0x6e07('0x1e')](_0x2ee73d);}};}function respondWithFilteredResult(_0x2bd11c,_0x234493){return function(_0x373b7c){if(_0x373b7c){var _0x4c35c6=typeof _0x234493[_0x6e07('0x1f')]===_0x6e07('0x20')&&typeof _0x234493['limit']==='undefined';var _0x3b3cd8=_0x373b7c[_0x6e07('0x21')];var _0x177505=_0x4c35c6?0x0:_0x234493[_0x6e07('0x1f')];var _0x4f1a2d=_0x4c35c6?_0x373b7c[_0x6e07('0x21')]:_0x234493[_0x6e07('0x1f')]+_0x234493['limit'];var _0x216bf6;if(_0x4f1a2d>=_0x3b3cd8){_0x4f1a2d=_0x3b3cd8;_0x216bf6=0xc8;}else{_0x216bf6=0xce;}_0x2bd11c[_0x6e07('0x1d')](_0x216bf6);return _0x2bd11c[_0x6e07('0x22')](_0x6e07('0x23'),_0x177505+'-'+_0x4f1a2d+'/'+_0x3b3cd8)[_0x6e07('0x1e')](_0x373b7c);}return null;};}function patchUpdates(_0x3a1147){return function(_0x289636){try{jsonpatch['apply'](_0x289636,_0x3a1147,!![]);}catch(_0x3d32d2){return BPromise[_0x6e07('0x24')](_0x3d32d2);}return _0x289636[_0x6e07('0x25')]();};}function saveUpdates(_0x201daa,_0x4e9666){return function(_0x4db217){if(_0x4db217){return _0x4db217[_0x6e07('0x26')](_0x201daa)[_0x6e07('0x27')](function(_0x173389){return _0x173389;});}return null;};}function removeEntity(_0x3059ad,_0x3879e7){return function(_0x30bdba){if(_0x30bdba){return _0x30bdba[_0x6e07('0x28')]()[_0x6e07('0x27')](function(){_0x3059ad[_0x6e07('0x1d')](0xcc)[_0x6e07('0x1c')]();});}};}function handleEntityNotFound(_0x23ace8,_0x28d11b){return function(_0x39f556){if(!_0x39f556){_0x23ace8[_0x6e07('0x1b')](0x194);}return _0x39f556;};}function handleError(_0x51e97c,_0x2432b5){_0x2432b5=_0x2432b5||0x1f4;return function(_0x292494){logger['error'](_0x292494['stack']);if(_0x292494[_0x6e07('0x29')]){delete _0x292494[_0x6e07('0x29')];}_0x51e97c['status'](_0x2432b5)[_0x6e07('0x2a')](_0x292494);};}exports[_0x6e07('0x2b')]=function(_0x4c66f2,_0x4ed0ee){var _0x1e4771={},_0x42c182={},_0x523bb5={'count':0x0,'rows':[]};var _0x1a825a=_[_0x6e07('0x2c')](db[_0x6e07('0x2d')][_0x6e07('0x2e')],function(_0x39588a){return{'name':_0x39588a['fieldName'],'type':_0x39588a['type'][_0x6e07('0x2f')]};});_0x42c182[_0x6e07('0x30')]=_[_0x6e07('0x2c')](_0x1a825a,_0x6e07('0x29'));_0x42c182[_0x6e07('0x31')]=_['keys'](_0x4c66f2[_0x6e07('0x31')]);_0x42c182[_0x6e07('0x32')]=_[_0x6e07('0x33')](_0x42c182['model'],_0x42c182[_0x6e07('0x31')]);_0x1e4771[_0x6e07('0x34')]=_['intersection'](_0x42c182['model'],qs[_0x6e07('0x35')](_0x4c66f2[_0x6e07('0x31')]['fields']));_0x1e4771[_0x6e07('0x34')]=_0x1e4771[_0x6e07('0x34')]['length']?_0x1e4771['attributes']:_0x42c182['model'];if(!_0x4c66f2[_0x6e07('0x31')][_0x6e07('0x36')](_0x6e07('0x37'))){_0x1e4771[_0x6e07('0x38')]=qs[_0x6e07('0x38')](_0x4c66f2['query']['limit']);_0x1e4771[_0x6e07('0x1f')]=qs[_0x6e07('0x1f')](_0x4c66f2['query'][_0x6e07('0x1f')]);}_0x1e4771[_0x6e07('0x39')]=qs[_0x6e07('0x3a')](_0x4c66f2[_0x6e07('0x31')][_0x6e07('0x3a')]);_0x1e4771['where']=qs[_0x6e07('0x32')](_[_0x6e07('0x3b')](_0x4c66f2['query'],_0x42c182[_0x6e07('0x32')]),_0x1a825a);if(_0x4c66f2[_0x6e07('0x31')][_0x6e07('0x3c')]){_0x1e4771['where']=_[_0x6e07('0x3d')](_0x1e4771[_0x6e07('0x3e')],{'$or':_[_0x6e07('0x2c')](_0x1a825a,function(_0x2718dc){if(_0x2718dc['type']!==_0x6e07('0x3f')){var _0x2852bb={};_0x2852bb[_0x2718dc[_0x6e07('0x29')]]={'$like':'%'+_0x4c66f2['query'][_0x6e07('0x3c')]+'%'};return _0x2852bb;}})});}_0x1e4771=_['merge']({},_0x1e4771,_0x4c66f2[_0x6e07('0x40')]);var _0x5aae7a={'where':_0x1e4771[_0x6e07('0x3e')]};return db[_0x6e07('0x2d')][_0x6e07('0x21')](_0x5aae7a)[_0x6e07('0x27')](function(_0x4c9118){_0x523bb5[_0x6e07('0x21')]=_0x4c9118;if(_0x4c66f2[_0x6e07('0x31')][_0x6e07('0x41')]){_0x1e4771[_0x6e07('0x42')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x1e4771);})[_0x6e07('0x27')](function(_0x19b9be){_0x523bb5['rows']=_0x19b9be;return _0x523bb5;})[_0x6e07('0x27')](respondWithFilteredResult(_0x4ed0ee,_0x1e4771))['catch'](handleError(_0x4ed0ee,null));};exports[_0x6e07('0x43')]=function(_0x1be917,_0x48aac3){var _0x5902c3={'raw':![],'where':{'id':_0x1be917[_0x6e07('0x44')]['id']}},_0x39ac4b={};_0x39ac4b['model']=_[_0x6e07('0x45')](db[_0x6e07('0x2d')][_0x6e07('0x2e')]);_0x39ac4b['query']=_[_0x6e07('0x45')](_0x1be917[_0x6e07('0x31')]);_0x39ac4b[_0x6e07('0x32')]=_[_0x6e07('0x33')](_0x39ac4b[_0x6e07('0x30')],_0x39ac4b[_0x6e07('0x31')]);_0x5902c3[_0x6e07('0x34')]=_[_0x6e07('0x33')](_0x39ac4b['model'],qs[_0x6e07('0x35')](_0x1be917['query'][_0x6e07('0x35')]));_0x5902c3[_0x6e07('0x34')]=_0x5902c3[_0x6e07('0x34')][_0x6e07('0x46')]?_0x5902c3[_0x6e07('0x34')]:_0x39ac4b[_0x6e07('0x30')];if(_0x1be917[_0x6e07('0x31')]['includeAll']){_0x5902c3[_0x6e07('0x42')]=[{'all':!![]}];}_0x5902c3=_['merge']({},_0x5902c3,_0x1be917[_0x6e07('0x40')]);return db[_0x6e07('0x2d')][_0x6e07('0x47')](_0x5902c3)[_0x6e07('0x27')](handleEntityNotFound(_0x48aac3,null))['then'](respondWithResult(_0x48aac3,null))[_0x6e07('0x48')](handleError(_0x48aac3,null));};exports['create']=function(_0xc50e23,_0x190ee7){return db[_0x6e07('0x2d')]['create'](_0xc50e23['body'],{})['then'](respondWithResult(_0x190ee7,0xc9))[_0x6e07('0x48')](handleError(_0x190ee7,null));};exports[_0x6e07('0x26')]=function(_0x44f0af,_0x553cdd){if(_0x44f0af[_0x6e07('0x49')]['id']){delete _0x44f0af['body']['id'];}return db[_0x6e07('0x2d')][_0x6e07('0x47')]({'where':{'id':_0x44f0af['params']['id']}})[_0x6e07('0x27')](handleEntityNotFound(_0x553cdd,null))[_0x6e07('0x27')](saveUpdates(_0x44f0af[_0x6e07('0x49')],null))[_0x6e07('0x27')](respondWithResult(_0x553cdd,null))[_0x6e07('0x48')](handleError(_0x553cdd,null));};exports[_0x6e07('0x28')]=function(_0x1844ff,_0x532a1e){return db[_0x6e07('0x2d')]['find']({'where':{'id':_0x1844ff['params']['id']}})[_0x6e07('0x27')](handleEntityNotFound(_0x532a1e,null))[_0x6e07('0x27')](removeEntity(_0x532a1e,null))[_0x6e07('0x48')](handleError(_0x532a1e,null));};exports[_0x6e07('0x4a')]=function(_0x49581a,_0x4363df,_0x26f2e6){var _0x1b67f9={};var _0x553618={};var _0x21975d;var _0x424180;return db[_0x6e07('0x2d')][_0x6e07('0x4b')]({'where':{'id':_0x49581a['params']['id']}})[_0x6e07('0x27')](handleEntityNotFound(_0x4363df,null))[_0x6e07('0x27')](function(_0x5584ec){if(_0x5584ec){_0x21975d=_0x5584ec;_0x553618[_0x6e07('0x30')]=_[_0x6e07('0x45')](db['FreshsalesField'][_0x6e07('0x2e')]);_0x553618[_0x6e07('0x31')]=_[_0x6e07('0x45')](_0x49581a['query']);_0x553618[_0x6e07('0x32')]=_[_0x6e07('0x33')](_0x553618['model'],_0x553618[_0x6e07('0x31')]);_0x1b67f9[_0x6e07('0x34')]=_[_0x6e07('0x33')](_0x553618[_0x6e07('0x30')],qs[_0x6e07('0x35')](_0x49581a[_0x6e07('0x31')][_0x6e07('0x35')]));_0x1b67f9[_0x6e07('0x34')]=_0x1b67f9[_0x6e07('0x34')]['length']?_0x1b67f9['attributes']:_0x553618[_0x6e07('0x30')];_0x1b67f9[_0x6e07('0x39')]=qs[_0x6e07('0x3a')](_0x49581a['query'][_0x6e07('0x3a')]);_0x1b67f9[_0x6e07('0x3e')]=qs[_0x6e07('0x32')](_[_0x6e07('0x3b')](_0x49581a['query'],_0x553618[_0x6e07('0x32')]));if(_0x49581a[_0x6e07('0x31')][_0x6e07('0x3c')]){_0x1b67f9['where']=_[_0x6e07('0x3d')](_0x1b67f9[_0x6e07('0x3e')],{'$or':_[_0x6e07('0x2c')](_0x1b67f9[_0x6e07('0x34')],function(_0x286e37){var _0x2b8dbe={};_0x2b8dbe[_0x286e37]={'$like':'%'+_0x49581a[_0x6e07('0x31')]['filter']+'%'};return _0x2b8dbe;})});}_0x1b67f9=_[_0x6e07('0x3d')]({},_0x1b67f9,_0x49581a[_0x6e07('0x40')]);return _0x21975d[_0x6e07('0x4a')](_0x1b67f9);}})[_0x6e07('0x27')](function(_0x11a399){if(_0x11a399){_0x424180=_0x11a399[_0x6e07('0x46')];if(!_0x49581a['query'][_0x6e07('0x36')](_0x6e07('0x37'))){_0x1b67f9[_0x6e07('0x38')]=qs[_0x6e07('0x38')](_0x49581a[_0x6e07('0x31')]['limit']);_0x1b67f9[_0x6e07('0x1f')]=qs[_0x6e07('0x1f')](_0x49581a[_0x6e07('0x31')][_0x6e07('0x1f')]);}return _0x21975d['getSubjects'](_0x1b67f9);}})[_0x6e07('0x27')](function(_0x978ba){if(_0x978ba){return _0x978ba?{'count':_0x424180,'rows':_0x978ba}:null;}})[_0x6e07('0x27')](respondWithResult(_0x4363df,null))['catch'](handleError(_0x4363df,null));};exports[_0x6e07('0x4c')]=function(_0x198901,_0x20d8aa,_0x11dffd){var _0x3c467f={};var _0x4a3a39={};var _0x35f364;var _0x479487;return db[_0x6e07('0x2d')][_0x6e07('0x4b')]({'where':{'id':_0x198901[_0x6e07('0x44')]['id']}})[_0x6e07('0x27')](handleEntityNotFound(_0x20d8aa,null))[_0x6e07('0x27')](function(_0x42475b){if(_0x42475b){_0x35f364=_0x42475b;_0x4a3a39['model']=_['keys'](db[_0x6e07('0x4d')][_0x6e07('0x2e')]);_0x4a3a39[_0x6e07('0x31')]=_['keys'](_0x198901['query']);_0x4a3a39[_0x6e07('0x32')]=_[_0x6e07('0x33')](_0x4a3a39[_0x6e07('0x30')],_0x4a3a39[_0x6e07('0x31')]);_0x3c467f['attributes']=_[_0x6e07('0x33')](_0x4a3a39[_0x6e07('0x30')],qs['fields'](_0x198901['query'][_0x6e07('0x35')]));_0x3c467f['attributes']=_0x3c467f[_0x6e07('0x34')][_0x6e07('0x46')]?_0x3c467f[_0x6e07('0x34')]:_0x4a3a39[_0x6e07('0x30')];_0x3c467f['order']=qs[_0x6e07('0x3a')](_0x198901[_0x6e07('0x31')]['sort']);_0x3c467f['where']=qs[_0x6e07('0x32')](_[_0x6e07('0x3b')](_0x198901[_0x6e07('0x31')],_0x4a3a39[_0x6e07('0x32')]));if(_0x198901['query']['filter']){_0x3c467f[_0x6e07('0x3e')]=_[_0x6e07('0x3d')](_0x3c467f[_0x6e07('0x3e')],{'$or':_[_0x6e07('0x2c')](_0x3c467f[_0x6e07('0x34')],function(_0x1d0787){var _0x4626ad={};_0x4626ad[_0x1d0787]={'$like':'%'+_0x198901[_0x6e07('0x31')][_0x6e07('0x3c')]+'%'};return _0x4626ad;})});}_0x3c467f=_[_0x6e07('0x3d')]({},_0x3c467f,_0x198901['options']);return _0x35f364[_0x6e07('0x4c')](_0x3c467f);}})[_0x6e07('0x27')](function(_0x5888c6){if(_0x5888c6){_0x479487=_0x5888c6[_0x6e07('0x46')];if(!_0x198901[_0x6e07('0x31')][_0x6e07('0x36')]('nolimit')){_0x3c467f['limit']=qs['limit'](_0x198901[_0x6e07('0x31')][_0x6e07('0x38')]);_0x3c467f[_0x6e07('0x1f')]=qs[_0x6e07('0x1f')](_0x198901['query'][_0x6e07('0x1f')]);}return _0x35f364[_0x6e07('0x4c')](_0x3c467f);}})[_0x6e07('0x27')](function(_0x3d0068){if(_0x3d0068){return _0x3d0068?{'count':_0x479487,'rows':_0x3d0068}:null;}})[_0x6e07('0x27')](respondWithResult(_0x20d8aa,null))[_0x6e07('0x48')](handleError(_0x20d8aa,null));};exports[_0x6e07('0x4e')]=function(_0x4d7370,_0x54f4c5,_0x48376c){var _0x5407cd={};var _0x19b4be={};var _0x13d4e2;var _0x34c95;return db['FreshsalesConfiguration'][_0x6e07('0x4b')]({'where':{'id':_0x4d7370[_0x6e07('0x44')]['id']}})[_0x6e07('0x27')](handleEntityNotFound(_0x54f4c5,null))['then'](function(_0x338ef0){if(_0x338ef0){_0x13d4e2=_0x338ef0;_0x19b4be[_0x6e07('0x30')]=_[_0x6e07('0x45')](db[_0x6e07('0x4d')][_0x6e07('0x2e')]);_0x19b4be[_0x6e07('0x31')]=_[_0x6e07('0x45')](_0x4d7370[_0x6e07('0x31')]);_0x19b4be[_0x6e07('0x32')]=_[_0x6e07('0x33')](_0x19b4be['model'],_0x19b4be[_0x6e07('0x31')]);_0x5407cd[_0x6e07('0x34')]=_[_0x6e07('0x33')](_0x19b4be[_0x6e07('0x30')],qs['fields'](_0x4d7370[_0x6e07('0x31')][_0x6e07('0x35')]));_0x5407cd[_0x6e07('0x34')]=_0x5407cd[_0x6e07('0x34')][_0x6e07('0x46')]?_0x5407cd[_0x6e07('0x34')]:_0x19b4be['model'];_0x5407cd[_0x6e07('0x39')]=qs[_0x6e07('0x3a')](_0x4d7370['query'][_0x6e07('0x3a')]);_0x5407cd['where']=qs[_0x6e07('0x32')](_[_0x6e07('0x3b')](_0x4d7370['query'],_0x19b4be['filters']));if(_0x4d7370['query'][_0x6e07('0x3c')]){_0x5407cd[_0x6e07('0x3e')]=_[_0x6e07('0x3d')](_0x5407cd['where'],{'$or':_[_0x6e07('0x2c')](_0x5407cd[_0x6e07('0x34')],function(_0x5f5b18){var _0x1e2c06={};_0x1e2c06[_0x5f5b18]={'$like':'%'+_0x4d7370[_0x6e07('0x31')]['filter']+'%'};return _0x1e2c06;})});}_0x5407cd=_[_0x6e07('0x3d')]({},_0x5407cd,_0x4d7370[_0x6e07('0x40')]);return _0x13d4e2['getFields'](_0x5407cd);}})[_0x6e07('0x27')](function(_0x48304e){if(_0x48304e){_0x34c95=_0x48304e[_0x6e07('0x46')];if(!_0x4d7370['query']['hasOwnProperty'](_0x6e07('0x37'))){_0x5407cd['limit']=qs[_0x6e07('0x38')](_0x4d7370[_0x6e07('0x31')][_0x6e07('0x38')]);_0x5407cd[_0x6e07('0x1f')]=qs[_0x6e07('0x1f')](_0x4d7370[_0x6e07('0x31')][_0x6e07('0x1f')]);}return _0x13d4e2['getFields'](_0x5407cd);}})[_0x6e07('0x27')](function(_0x1eb229){if(_0x1eb229){return _0x1eb229?{'count':_0x34c95,'rows':_0x1eb229}:null;}})[_0x6e07('0x27')](respondWithResult(_0x54f4c5,null))[_0x6e07('0x48')](handleError(_0x54f4c5,null));}; \ No newline at end of file +var _0x6909=['undefined','count','Content-Range','apply','update','then','destroy','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','params','includeAll','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit'];(function(_0x55d6bf,_0x27d38d){var _0x379799=function(_0x5495fa){while(--_0x5495fa){_0x55d6bf['push'](_0x55d6bf['shift']());}};_0x379799(++_0x27d38d);}(_0x6909,0x170));var _0x9690=function(_0x3e4bb4,_0x26b8c9){_0x3e4bb4=_0x3e4bb4-0x0;var _0x3551bb=_0x6909[_0x3e4bb4];return _0x3551bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9690('0x0'));var zipdir=require(_0x9690('0x1'));var jsonpatch=require(_0x9690('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9690('0x3'));var Mustache=require(_0x9690('0x4'));var util=require(_0x9690('0x5'));var path=require(_0x9690('0x6'));var sox=require(_0x9690('0x7'));var csv=require('to-csv');var ejs=require(_0x9690('0x8'));var fs=require('fs');var fs_extra=require(_0x9690('0x9'));var _=require(_0x9690('0xa'));var squel=require(_0x9690('0xb'));var crypto=require(_0x9690('0xc'));var jsforce=require(_0x9690('0xd'));var deskjs=require(_0x9690('0xe'));var toCsv=require(_0x9690('0xf'));var querystring=require(_0x9690('0x10'));var Papa=require(_0x9690('0x11'));var Redis=require(_0x9690('0x12'));var authService=require(_0x9690('0x13'));var qs=require(_0x9690('0x14'));var as=require(_0x9690('0x15'));var hardwareService=require(_0x9690('0x16'));var logger=require('../../config/logger')(_0x9690('0x17'));var utils=require(_0x9690('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9690('0x19'))['db'];function respondWithStatusCode(_0x62221,_0x1f131c){_0x1f131c=_0x1f131c||0xcc;return function(_0x34c71c){if(_0x34c71c){return _0x62221[_0x9690('0x1a')](_0x1f131c);}return _0x62221['status'](_0x1f131c)[_0x9690('0x1b')]();};}function respondWithResult(_0x209e5b,_0x440102){_0x440102=_0x440102||0xc8;return function(_0x11edf4){if(_0x11edf4){return _0x209e5b[_0x9690('0x1c')](_0x440102)[_0x9690('0x1d')](_0x11edf4);}};}function respondWithFilteredResult(_0xf03ca2,_0x6e2b6f){return function(_0x3c6dc1){if(_0x3c6dc1){var _0x40fae0=typeof _0x6e2b6f[_0x9690('0x1e')]==='undefined'&&typeof _0x6e2b6f[_0x9690('0x1f')]===_0x9690('0x20');var _0xe2d483=_0x3c6dc1[_0x9690('0x21')];var _0xc75244=_0x40fae0?0x0:_0x6e2b6f[_0x9690('0x1e')];var _0x398b89=_0x40fae0?_0x3c6dc1[_0x9690('0x21')]:_0x6e2b6f[_0x9690('0x1e')]+_0x6e2b6f['limit'];var _0x2e3fe2;if(_0x398b89>=_0xe2d483){_0x398b89=_0xe2d483;_0x2e3fe2=0xc8;}else{_0x2e3fe2=0xce;}_0xf03ca2[_0x9690('0x1c')](_0x2e3fe2);return _0xf03ca2['set'](_0x9690('0x22'),_0xc75244+'-'+_0x398b89+'/'+_0xe2d483)['json'](_0x3c6dc1);}return null;};}function patchUpdates(_0x2617f0){return function(_0x519b31){try{jsonpatch[_0x9690('0x23')](_0x519b31,_0x2617f0,!![]);}catch(_0x5eedf0){return BPromise['reject'](_0x5eedf0);}return _0x519b31['save']();};}function saveUpdates(_0x264d7e,_0x485144){return function(_0x2575d7){if(_0x2575d7){return _0x2575d7[_0x9690('0x24')](_0x264d7e)[_0x9690('0x25')](function(_0x2274af){return _0x2274af;});}return null;};}function removeEntity(_0x244313,_0x45eaeb){return function(_0x37eb86){if(_0x37eb86){return _0x37eb86[_0x9690('0x26')]()[_0x9690('0x25')](function(){_0x244313['status'](0xcc)[_0x9690('0x1b')]();});}};}function handleEntityNotFound(_0xada944,_0x532e49){return function(_0x53f396){if(!_0x53f396){_0xada944[_0x9690('0x1a')](0x194);}return _0x53f396;};}function handleError(_0x33f659,_0x33aa64){_0x33aa64=_0x33aa64||0x1f4;return function(_0x1783f8){logger[_0x9690('0x27')](_0x1783f8[_0x9690('0x28')]);if(_0x1783f8[_0x9690('0x29')]){delete _0x1783f8['name'];}_0x33f659[_0x9690('0x1c')](_0x33aa64)[_0x9690('0x2a')](_0x1783f8);};}exports['index']=function(_0x5a71a8,_0x5fea86){var _0x2ceab9={},_0x10e95d={},_0x503cee={'count':0x0,'rows':[]};var _0x233ee2=_[_0x9690('0x2b')](db[_0x9690('0x2c')][_0x9690('0x2d')],function(_0x5eccb9){return{'name':_0x5eccb9[_0x9690('0x2e')],'type':_0x5eccb9[_0x9690('0x2f')][_0x9690('0x30')]};});_0x10e95d[_0x9690('0x31')]=_[_0x9690('0x2b')](_0x233ee2,_0x9690('0x29'));_0x10e95d[_0x9690('0x32')]=_[_0x9690('0x33')](_0x5a71a8[_0x9690('0x32')]);_0x10e95d['filters']=_[_0x9690('0x34')](_0x10e95d[_0x9690('0x31')],_0x10e95d['query']);_0x2ceab9['attributes']=_['intersection'](_0x10e95d[_0x9690('0x31')],qs[_0x9690('0x35')](_0x5a71a8[_0x9690('0x32')][_0x9690('0x35')]));_0x2ceab9[_0x9690('0x36')]=_0x2ceab9[_0x9690('0x36')][_0x9690('0x37')]?_0x2ceab9['attributes']:_0x10e95d[_0x9690('0x31')];if(!_0x5a71a8[_0x9690('0x32')][_0x9690('0x38')](_0x9690('0x39'))){_0x2ceab9[_0x9690('0x1f')]=qs['limit'](_0x5a71a8[_0x9690('0x32')]['limit']);_0x2ceab9[_0x9690('0x1e')]=qs['offset'](_0x5a71a8[_0x9690('0x32')][_0x9690('0x1e')]);}_0x2ceab9[_0x9690('0x3a')]=qs[_0x9690('0x3b')](_0x5a71a8[_0x9690('0x32')][_0x9690('0x3b')]);_0x2ceab9[_0x9690('0x3c')]=qs['filters'](_[_0x9690('0x3d')](_0x5a71a8['query'],_0x10e95d[_0x9690('0x3e')]),_0x233ee2);if(_0x5a71a8[_0x9690('0x32')][_0x9690('0x3f')]){_0x2ceab9['where']=_[_0x9690('0x40')](_0x2ceab9[_0x9690('0x3c')],{'$or':_['map'](_0x233ee2,function(_0x175a9d){if(_0x175a9d[_0x9690('0x2f')]!==_0x9690('0x41')){var _0x2a7fc8={};_0x2a7fc8[_0x175a9d['name']]={'$like':'%'+_0x5a71a8[_0x9690('0x32')][_0x9690('0x3f')]+'%'};return _0x2a7fc8;}})});}_0x2ceab9=_[_0x9690('0x40')]({},_0x2ceab9,_0x5a71a8[_0x9690('0x42')]);var _0x5e2618={'where':_0x2ceab9[_0x9690('0x3c')]};return db[_0x9690('0x2c')]['count'](_0x5e2618)[_0x9690('0x25')](function(_0x307218){_0x503cee[_0x9690('0x21')]=_0x307218;if(_0x5a71a8[_0x9690('0x32')]['includeAll']){_0x2ceab9['include']=[{'all':!![]}];}return db[_0x9690('0x2c')][_0x9690('0x43')](_0x2ceab9);})[_0x9690('0x25')](function(_0x7e3eaa){_0x503cee[_0x9690('0x44')]=_0x7e3eaa;return _0x503cee;})['then'](respondWithFilteredResult(_0x5fea86,_0x2ceab9))[_0x9690('0x45')](handleError(_0x5fea86,null));};exports['show']=function(_0x1ad18d,_0x232a8c){var _0x3b9b6f={'raw':![],'where':{'id':_0x1ad18d[_0x9690('0x46')]['id']}},_0x17caa3={};_0x17caa3[_0x9690('0x31')]=_[_0x9690('0x33')](db['FreshsalesConfiguration'][_0x9690('0x2d')]);_0x17caa3[_0x9690('0x32')]=_[_0x9690('0x33')](_0x1ad18d[_0x9690('0x32')]);_0x17caa3['filters']=_[_0x9690('0x34')](_0x17caa3[_0x9690('0x31')],_0x17caa3[_0x9690('0x32')]);_0x3b9b6f[_0x9690('0x36')]=_['intersection'](_0x17caa3['model'],qs[_0x9690('0x35')](_0x1ad18d[_0x9690('0x32')]['fields']));_0x3b9b6f[_0x9690('0x36')]=_0x3b9b6f[_0x9690('0x36')][_0x9690('0x37')]?_0x3b9b6f[_0x9690('0x36')]:_0x17caa3[_0x9690('0x31')];if(_0x1ad18d[_0x9690('0x32')][_0x9690('0x47')]){_0x3b9b6f['include']=[{'all':!![]}];}_0x3b9b6f=_[_0x9690('0x40')]({},_0x3b9b6f,_0x1ad18d[_0x9690('0x42')]);return db[_0x9690('0x2c')][_0x9690('0x48')](_0x3b9b6f)['then'](handleEntityNotFound(_0x232a8c,null))[_0x9690('0x25')](respondWithResult(_0x232a8c,null))[_0x9690('0x45')](handleError(_0x232a8c,null));};exports['create']=function(_0x21a385,_0x60b39a){return db['FreshsalesConfiguration'][_0x9690('0x49')](_0x21a385[_0x9690('0x4a')],{})[_0x9690('0x25')](respondWithResult(_0x60b39a,0xc9))[_0x9690('0x45')](handleError(_0x60b39a,null));};exports[_0x9690('0x24')]=function(_0x4570fd,_0x3e93db){if(_0x4570fd[_0x9690('0x4a')]['id']){delete _0x4570fd[_0x9690('0x4a')]['id'];}return db['FreshsalesConfiguration'][_0x9690('0x48')]({'where':{'id':_0x4570fd[_0x9690('0x46')]['id']}})[_0x9690('0x25')](handleEntityNotFound(_0x3e93db,null))['then'](saveUpdates(_0x4570fd[_0x9690('0x4a')],null))[_0x9690('0x25')](respondWithResult(_0x3e93db,null))[_0x9690('0x45')](handleError(_0x3e93db,null));};exports[_0x9690('0x26')]=function(_0x20722a,_0x378533){return db[_0x9690('0x2c')][_0x9690('0x48')]({'where':{'id':_0x20722a[_0x9690('0x46')]['id']}})[_0x9690('0x25')](handleEntityNotFound(_0x378533,null))[_0x9690('0x25')](removeEntity(_0x378533,null))[_0x9690('0x45')](handleError(_0x378533,null));};exports[_0x9690('0x4b')]=function(_0x42b607,_0x3aff27,_0x173064){var _0x532b9b={};var _0x5b50bc={};var _0x308d6e;var _0x26d70e;return db[_0x9690('0x2c')][_0x9690('0x4c')]({'where':{'id':_0x42b607[_0x9690('0x46')]['id']}})[_0x9690('0x25')](handleEntityNotFound(_0x3aff27,null))[_0x9690('0x25')](function(_0x43fcb3){if(_0x43fcb3){_0x308d6e=_0x43fcb3;_0x5b50bc[_0x9690('0x31')]=_[_0x9690('0x33')](db[_0x9690('0x4d')][_0x9690('0x2d')]);_0x5b50bc[_0x9690('0x32')]=_[_0x9690('0x33')](_0x42b607[_0x9690('0x32')]);_0x5b50bc[_0x9690('0x3e')]=_[_0x9690('0x34')](_0x5b50bc[_0x9690('0x31')],_0x5b50bc['query']);_0x532b9b[_0x9690('0x36')]=_[_0x9690('0x34')](_0x5b50bc[_0x9690('0x31')],qs[_0x9690('0x35')](_0x42b607[_0x9690('0x32')][_0x9690('0x35')]));_0x532b9b[_0x9690('0x36')]=_0x532b9b[_0x9690('0x36')]['length']?_0x532b9b[_0x9690('0x36')]:_0x5b50bc['model'];_0x532b9b[_0x9690('0x3a')]=qs[_0x9690('0x3b')](_0x42b607[_0x9690('0x32')][_0x9690('0x3b')]);_0x532b9b[_0x9690('0x3c')]=qs[_0x9690('0x3e')](_[_0x9690('0x3d')](_0x42b607[_0x9690('0x32')],_0x5b50bc[_0x9690('0x3e')]));if(_0x42b607['query'][_0x9690('0x3f')]){_0x532b9b[_0x9690('0x3c')]=_['merge'](_0x532b9b[_0x9690('0x3c')],{'$or':_[_0x9690('0x2b')](_0x532b9b[_0x9690('0x36')],function(_0x5d75c0){var _0x506244={};_0x506244[_0x5d75c0]={'$like':'%'+_0x42b607[_0x9690('0x32')][_0x9690('0x3f')]+'%'};return _0x506244;})});}_0x532b9b=_[_0x9690('0x40')]({},_0x532b9b,_0x42b607[_0x9690('0x42')]);return _0x308d6e[_0x9690('0x4b')](_0x532b9b);}})['then'](function(_0x340969){if(_0x340969){_0x26d70e=_0x340969[_0x9690('0x37')];if(!_0x42b607[_0x9690('0x32')]['hasOwnProperty']('nolimit')){_0x532b9b['limit']=qs[_0x9690('0x1f')](_0x42b607[_0x9690('0x32')][_0x9690('0x1f')]);_0x532b9b['offset']=qs[_0x9690('0x1e')](_0x42b607[_0x9690('0x32')][_0x9690('0x1e')]);}return _0x308d6e[_0x9690('0x4b')](_0x532b9b);}})[_0x9690('0x25')](function(_0x3bf73c){if(_0x3bf73c){return _0x3bf73c?{'count':_0x26d70e,'rows':_0x3bf73c}:null;}})['then'](respondWithResult(_0x3aff27,null))[_0x9690('0x45')](handleError(_0x3aff27,null));};exports[_0x9690('0x4e')]=function(_0x5d4f7b,_0x44a94f,_0x394591){var _0x20adeb={};var _0x5ee75a={};var _0x389127;var _0x3b7a88;return db[_0x9690('0x2c')][_0x9690('0x4c')]({'where':{'id':_0x5d4f7b[_0x9690('0x46')]['id']}})[_0x9690('0x25')](handleEntityNotFound(_0x44a94f,null))[_0x9690('0x25')](function(_0x1d57e5){if(_0x1d57e5){_0x389127=_0x1d57e5;_0x5ee75a[_0x9690('0x31')]=_['keys'](db[_0x9690('0x4d')][_0x9690('0x2d')]);_0x5ee75a[_0x9690('0x32')]=_[_0x9690('0x33')](_0x5d4f7b[_0x9690('0x32')]);_0x5ee75a[_0x9690('0x3e')]=_[_0x9690('0x34')](_0x5ee75a[_0x9690('0x31')],_0x5ee75a[_0x9690('0x32')]);_0x20adeb[_0x9690('0x36')]=_['intersection'](_0x5ee75a[_0x9690('0x31')],qs[_0x9690('0x35')](_0x5d4f7b[_0x9690('0x32')][_0x9690('0x35')]));_0x20adeb[_0x9690('0x36')]=_0x20adeb[_0x9690('0x36')][_0x9690('0x37')]?_0x20adeb[_0x9690('0x36')]:_0x5ee75a['model'];_0x20adeb[_0x9690('0x3a')]=qs[_0x9690('0x3b')](_0x5d4f7b[_0x9690('0x32')][_0x9690('0x3b')]);_0x20adeb[_0x9690('0x3c')]=qs['filters'](_[_0x9690('0x3d')](_0x5d4f7b['query'],_0x5ee75a[_0x9690('0x3e')]));if(_0x5d4f7b['query'][_0x9690('0x3f')]){_0x20adeb[_0x9690('0x3c')]=_['merge'](_0x20adeb[_0x9690('0x3c')],{'$or':_[_0x9690('0x2b')](_0x20adeb['attributes'],function(_0x400a73){var _0x2167b5={};_0x2167b5[_0x400a73]={'$like':'%'+_0x5d4f7b[_0x9690('0x32')][_0x9690('0x3f')]+'%'};return _0x2167b5;})});}_0x20adeb=_[_0x9690('0x40')]({},_0x20adeb,_0x5d4f7b[_0x9690('0x42')]);return _0x389127[_0x9690('0x4e')](_0x20adeb);}})[_0x9690('0x25')](function(_0x5bb76f){if(_0x5bb76f){_0x3b7a88=_0x5bb76f[_0x9690('0x37')];if(!_0x5d4f7b[_0x9690('0x32')][_0x9690('0x38')](_0x9690('0x39'))){_0x20adeb[_0x9690('0x1f')]=qs[_0x9690('0x1f')](_0x5d4f7b[_0x9690('0x32')][_0x9690('0x1f')]);_0x20adeb[_0x9690('0x1e')]=qs[_0x9690('0x1e')](_0x5d4f7b[_0x9690('0x32')][_0x9690('0x1e')]);}return _0x389127['getDescriptions'](_0x20adeb);}})[_0x9690('0x25')](function(_0x53c02e){if(_0x53c02e){return _0x53c02e?{'count':_0x3b7a88,'rows':_0x53c02e}:null;}})[_0x9690('0x25')](respondWithResult(_0x44a94f,null))[_0x9690('0x45')](handleError(_0x44a94f,null));};exports[_0x9690('0x4f')]=function(_0x39e602,_0x5dbbe1,_0x23c468){var _0x5aeeec={};var _0x6be620={};var _0x923e81;var _0x22de3a;return db[_0x9690('0x2c')][_0x9690('0x4c')]({'where':{'id':_0x39e602[_0x9690('0x46')]['id']}})[_0x9690('0x25')](handleEntityNotFound(_0x5dbbe1,null))[_0x9690('0x25')](function(_0x2e7ad9){if(_0x2e7ad9){_0x923e81=_0x2e7ad9;_0x6be620[_0x9690('0x31')]=_[_0x9690('0x33')](db['FreshsalesField'][_0x9690('0x2d')]);_0x6be620[_0x9690('0x32')]=_[_0x9690('0x33')](_0x39e602['query']);_0x6be620[_0x9690('0x3e')]=_[_0x9690('0x34')](_0x6be620[_0x9690('0x31')],_0x6be620[_0x9690('0x32')]);_0x5aeeec[_0x9690('0x36')]=_[_0x9690('0x34')](_0x6be620[_0x9690('0x31')],qs[_0x9690('0x35')](_0x39e602[_0x9690('0x32')][_0x9690('0x35')]));_0x5aeeec[_0x9690('0x36')]=_0x5aeeec['attributes'][_0x9690('0x37')]?_0x5aeeec[_0x9690('0x36')]:_0x6be620[_0x9690('0x31')];_0x5aeeec[_0x9690('0x3a')]=qs['sort'](_0x39e602[_0x9690('0x32')][_0x9690('0x3b')]);_0x5aeeec[_0x9690('0x3c')]=qs[_0x9690('0x3e')](_[_0x9690('0x3d')](_0x39e602['query'],_0x6be620[_0x9690('0x3e')]));if(_0x39e602[_0x9690('0x32')][_0x9690('0x3f')]){_0x5aeeec['where']=_[_0x9690('0x40')](_0x5aeeec[_0x9690('0x3c')],{'$or':_['map'](_0x5aeeec[_0x9690('0x36')],function(_0x16198d){var _0x26b505={};_0x26b505[_0x16198d]={'$like':'%'+_0x39e602[_0x9690('0x32')]['filter']+'%'};return _0x26b505;})});}_0x5aeeec=_[_0x9690('0x40')]({},_0x5aeeec,_0x39e602[_0x9690('0x42')]);return _0x923e81[_0x9690('0x4f')](_0x5aeeec);}})[_0x9690('0x25')](function(_0x1bf893){if(_0x1bf893){_0x22de3a=_0x1bf893[_0x9690('0x37')];if(!_0x39e602[_0x9690('0x32')][_0x9690('0x38')]('nolimit')){_0x5aeeec[_0x9690('0x1f')]=qs[_0x9690('0x1f')](_0x39e602['query'][_0x9690('0x1f')]);_0x5aeeec['offset']=qs[_0x9690('0x1e')](_0x39e602[_0x9690('0x32')][_0x9690('0x1e')]);}return _0x923e81[_0x9690('0x4f')](_0x5aeeec);}})[_0x9690('0x25')](function(_0x29cd4b){if(_0x29cd4b){return _0x29cd4b?{'count':_0x22de3a,'rows':_0x29cd4b}:null;}})[_0x9690('0x25')](respondWithResult(_0x5dbbe1,null))['catch'](handleError(_0x5dbbe1,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index ee9a52b..e8e17d6 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 _0x6e54=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6e54,0x136));var _0x46e5=function(_0x4d7a61,_0x3fb6e6){_0x4d7a61=_0x4d7a61-0x0;var _0x186f73=_0x6e54[_0x4d7a61];return _0x186f73;};'use strict';var _=require(_0x46e5('0x0'));var util=require(_0x46e5('0x1'));var logger=require(_0x46e5('0x2'))(_0x46e5('0x3'));var moment=require(_0x46e5('0x4'));var BPromise=require(_0x46e5('0x5'));var rp=require(_0x46e5('0x6'));var fs=require('fs');var path=require(_0x46e5('0x7'));var rimraf=require('rimraf');var config=require(_0x46e5('0x8'));var attributes=require(_0x46e5('0x9'));module[_0x46e5('0xa')]=function(_0x4e0b2c,_0x400986){return _0x4e0b2c[_0x46e5('0xb')](_0x46e5('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe965=['path','../../config/environment','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','api'];(function(_0x23a63c,_0xd09586){var _0x34d2d8=function(_0x1474de){while(--_0x1474de){_0x23a63c['push'](_0x23a63c['shift']());}};_0x34d2d8(++_0xd09586);}(_0xe965,0xe5));var _0x5e96=function(_0x485fd3,_0x24d482){_0x485fd3=_0x485fd3-0x0;var _0x48d6d9=_0xe965[_0x485fd3];return _0x48d6d9;};'use strict';var _=require('lodash');var util=require(_0x5e96('0x0'));var logger=require(_0x5e96('0x1'))(_0x5e96('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e96('0x3'));var rimraf=require('rimraf');var config=require(_0x5e96('0x4'));var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x37a5cc,_0x4a004f){return _0x37a5cc[_0x5e96('0x5')](_0x5e96('0x6'),attributes,{'tableName':_0x5e96('0x7'),'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 beaa82f..6064834 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 _0x41f3=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x41f3,0x151));var _0x341f=function(_0x21e94f,_0x2ad515){_0x21e94f=_0x21e94f-0x0;var _0x303616=_0x41f3[_0x21e94f];return _0x303616;};'use strict';var _=require(_0x341f('0x0'));var util=require(_0x341f('0x1'));var moment=require(_0x341f('0x2'));var BPromise=require(_0x341f('0x3'));var rs=require(_0x341f('0x4'));var fs=require('fs');var Redis=require(_0x341f('0x5'));var db=require(_0x341f('0x6'))['db'];var utils=require(_0x341f('0x7'));var logger=require(_0x341f('0x8'))(_0x341f('0x9'));var config=require('../../config/environment');var jayson=require(_0x341f('0xa'));var client=jayson[_0x341f('0xb')][_0x341f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e2031,_0xed43f7,_0x1e052b){return new BPromise(function(_0x3773a3,_0x5aabc6){return client[_0x341f('0xd')](_0x5e2031,_0x1e052b)[_0x341f('0xe')](function(_0x263a1e){logger[_0x341f('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xed43f7,_0x341f('0x10'));logger[_0x341f('0x11')](_0x341f('0x12'),_0xed43f7,_0x341f('0x10'),JSON['stringify'](_0x263a1e));if(_0x263a1e[_0x341f('0x13')]){if(_0x263a1e[_0x341f('0x13')]['code']===0x1f4){logger[_0x341f('0x13')](_0x341f('0x14'),_0xed43f7,_0x263a1e[_0x341f('0x13')][_0x341f('0x15')]);return _0x5aabc6(_0x263a1e[_0x341f('0x13')][_0x341f('0x15')]);}logger[_0x341f('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xed43f7,_0x263a1e[_0x341f('0x13')][_0x341f('0x15')]);return _0x3773a3(_0x263a1e[_0x341f('0x13')][_0x341f('0x15')]);}else{logger['info'](_0x341f('0x14'),_0xed43f7,'request\x20sent');_0x3773a3(_0x263a1e[_0x341f('0x16')][_0x341f('0x15')]);}})['catch'](function(_0x3bd3d4){logger['error'](_0x341f('0x14'),_0xed43f7,_0x3bd3d4);_0x5aabc6(_0x3bd3d4);});});} \ No newline at end of file +var _0x38c0=['rpc','../../config/environment','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/logger'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x38c0,0xaf));var _0x038c=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x38c0[_0x342700];return _0x53406f;};'use strict';var _=require(_0x038c('0x0'));var util=require('util');var moment=require(_0x038c('0x1'));var BPromise=require('bluebird');var rs=require(_0x038c('0x2'));var fs=require('fs');var Redis=require(_0x038c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x038c('0x4'))(_0x038c('0x5'));var config=require(_0x038c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x038c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x46eaca,_0x59dfb1,_0x2176be){return new BPromise(function(_0x1e426e,_0x2c591e){return client[_0x038c('0x8')](_0x46eaca,_0x2176be)[_0x038c('0x9')](function(_0x5f476d){logger[_0x038c('0xa')](_0x038c('0xb'),_0x59dfb1,'request\x20sent');logger[_0x038c('0xc')](_0x038c('0xd'),_0x59dfb1,_0x038c('0xe'),JSON['stringify'](_0x5f476d));if(_0x5f476d['error']){if(_0x5f476d[_0x038c('0xf')][_0x038c('0x10')]===0x1f4){logger[_0x038c('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x59dfb1,_0x5f476d['error'][_0x038c('0x11')]);return _0x2c591e(_0x5f476d[_0x038c('0xf')][_0x038c('0x11')]);}logger[_0x038c('0xf')](_0x038c('0xb'),_0x59dfb1,_0x5f476d[_0x038c('0xf')][_0x038c('0x11')]);return _0x1e426e(_0x5f476d[_0x038c('0xf')]['message']);}else{logger[_0x038c('0xa')](_0x038c('0xb'),_0x59dfb1,_0x038c('0xe'));_0x1e426e(_0x5f476d[_0x038c('0x12')]['message']);}})[_0x038c('0x13')](function(_0x3af2dd){logger[_0x038c('0xf')](_0x038c('0xb'),_0x59dfb1,_0x3af2dd);_0x2c591e(_0x3af2dd);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 885a222..31353e8 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 _0x2029=['isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x1f2249,_0x1ba555){var _0x5ac00e=function(_0xb88a16){while(--_0xb88a16){_0x1f2249['push'](_0x1f2249['shift']());}};_0x5ac00e(++_0x1ba555);}(_0x2029,0x171));var _0x9202=function(_0x3d78f1,_0x5c5031){_0x3d78f1=_0x3d78f1-0x0;var _0x577949=_0x2029[_0x3d78f1];return _0x577949;};'use strict';var multer=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var path=require('path');var timeout=require(_0x9202('0x2'));var express=require(_0x9202('0x3'));var router=express[_0x9202('0x4')]();var fs_extra=require(_0x9202('0x5'));var auth=require(_0x9202('0x6'));var interaction=require(_0x9202('0x7'));var config=require(_0x9202('0x8'));var controller=require(_0x9202('0x9'));router[_0x9202('0xa')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0xc')]);router[_0x9202('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9202('0xd')]);router['post']('/',auth[_0x9202('0xb')](),controller[_0x9202('0xe')]);router['put'](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x10')]);router[_0x9202('0x11')](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x12')]);module[_0x9202('0x13')]=router; \ No newline at end of file +var _0x515d=['../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','index','get','/:id','isAuthenticated','show','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x18fc41,_0x3fcb91){var _0x213cd4=function(_0x3f0778){while(--_0x3f0778){_0x18fc41['push'](_0x18fc41['shift']());}};_0x213cd4(++_0x3fcb91);}(_0x515d,0x104));var _0xd515=function(_0x299350,_0x4b3431){_0x299350=_0x299350-0x0;var _0x3fe9d9=_0x515d[_0x299350];return _0x3fe9d9;};'use strict';var multer=require('multer');var util=require(_0xd515('0x0'));var path=require(_0xd515('0x1'));var timeout=require(_0xd515('0x2'));var express=require(_0xd515('0x3'));var router=express[_0xd515('0x4')]();var fs_extra=require(_0xd515('0x5'));var auth=require(_0xd515('0x6'));var interaction=require(_0xd515('0x7'));var config=require('../../config/environment');var controller=require(_0xd515('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd515('0x9')]);router[_0xd515('0xa')](_0xd515('0xb'),auth[_0xd515('0xc')](),controller[_0xd515('0xd')]);router['post']('/',auth[_0xd515('0xc')](),controller[_0xd515('0xe')]);router[_0xd515('0xf')](_0xd515('0xb'),auth[_0xd515('0xc')](),controller[_0xd515('0x10')]);router['delete'](_0xd515('0xb'),auth[_0xd515('0xc')](),controller[_0xd515('0x11')]);module[_0xd515('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index ed2ac35..09e46a0 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 _0xb085=['picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x2d6d5e,_0x214948){var _0x5ea03d=function(_0x3a1be5){while(--_0x3a1be5){_0x2d6d5e['push'](_0x2d6d5e['shift']());}};_0x5ea03d(++_0x214948);}(_0xb085,0xac));var _0x5b08=function(_0x407ad0,_0x2ec890){_0x407ad0=_0x407ad0-0x0;var _0x384e7c=_0xb085[_0x407ad0];return _0x384e7c;};'use strict';var Sequelize=require(_0x5b08('0x0'));module['exports']={'type':{'type':Sequelize[_0x5b08('0x1')]('string',_0x5b08('0x2'),'customVariable','keyValue',_0x5b08('0x3')),'defaultValue':_0x5b08('0x4')},'content':{'type':Sequelize[_0x5b08('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5b08('0x1')](_0x5b08('0x4'),_0x5b08('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x5b08('0x5')]},'idField':{'type':Sequelize[_0x5b08('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5b08('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5b08('0x5')]}}; \ No newline at end of file +var _0x598e=['ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0xaec7d,_0x44dce6){var _0x54a0ce=function(_0x1e0aba){while(--_0x1e0aba){_0xaec7d['push'](_0xaec7d['shift']());}};_0x54a0ce(++_0x44dce6);}(_0x598e,0x11e));var _0xe598=function(_0x1f0c06,_0x1e47b5){_0x1f0c06=_0x1f0c06-0x0;var _0x105746=_0x598e[_0x1f0c06];return _0x105746;};'use strict';var Sequelize=require(_0xe598('0x0'));module[_0xe598('0x1')]={'type':{'type':Sequelize[_0xe598('0x2')](_0xe598('0x3'),'variable','customVariable',_0xe598('0x4'),'picklist'),'defaultValue':_0xe598('0x3')},'content':{'type':Sequelize[_0xe598('0x5')]},'key':{'type':Sequelize[_0xe598('0x5')]},'keyType':{'type':Sequelize[_0xe598('0x2')](_0xe598('0x3'),_0xe598('0x6'),_0xe598('0x7'))},'keyContent':{'type':Sequelize[_0xe598('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe598('0x5')]},'customField':{'type':Sequelize[_0xe598('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe598('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 1b7c50d..763d706 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 _0x038d=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','rawAttributes','keys','find','catch','create','body','params','eml-format','rimraf','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x038d,0x158));var _0xd038=function(_0x1b431a,_0x2293f0){_0x1b431a=_0x1b431a-0x0;var _0x3c56d9=_0x038d[_0x1b431a];return _0x3c56d9;};'use strict';var emlformat=require(_0xd038('0x0'));var rimraf=require(_0xd038('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd038('0x2'));var moment=require('moment');var BPromise=require(_0xd038('0x3'));var Mustache=require('mustache');var util=require(_0xd038('0x4'));var path=require(_0xd038('0x5'));var sox=require('sox');var csv=require(_0xd038('0x6'));var ejs=require(_0xd038('0x7'));var fs=require('fs');var fs_extra=require(_0xd038('0x8'));var _=require(_0xd038('0x9'));var squel=require('squel');var crypto=require(_0xd038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd038('0x6'));var querystring=require(_0xd038('0xb'));var Papa=require('papaparse');var Redis=require(_0xd038('0xc'));var authService=require(_0xd038('0xd'));var qs=require(_0xd038('0xe'));var as=require(_0xd038('0xf'));var hardwareService=require(_0xd038('0x10'));var logger=require('../../config/logger')(_0xd038('0x11'));var utils=require(_0xd038('0x12'));var config=require(_0xd038('0x13'));var licenseUtil=require(_0xd038('0x14'));var db=require(_0xd038('0x15'))['db'];function respondWithStatusCode(_0x4822f1,_0x593b59){_0x593b59=_0x593b59||0xcc;return function(_0xfb24c7){if(_0xfb24c7){return _0x4822f1[_0xd038('0x16')](_0x593b59);}return _0x4822f1[_0xd038('0x17')](_0x593b59)['end']();};}function respondWithResult(_0x4772d3,_0x3939fd){_0x3939fd=_0x3939fd||0xc8;return function(_0x8f24aa){if(_0x8f24aa){return _0x4772d3[_0xd038('0x17')](_0x3939fd)[_0xd038('0x18')](_0x8f24aa);}};}function respondWithFilteredResult(_0x20be9b,_0x26ed56){return function(_0x9d93c1){if(_0x9d93c1){var _0x322dd8=typeof _0x26ed56[_0xd038('0x19')]==='undefined'&&typeof _0x26ed56[_0xd038('0x1a')]==='undefined';var _0x56f93c=_0x9d93c1[_0xd038('0x1b')];var _0x3466fc=_0x322dd8?0x0:_0x26ed56[_0xd038('0x19')];var _0x5e7881=_0x322dd8?_0x9d93c1[_0xd038('0x1b')]:_0x26ed56[_0xd038('0x19')]+_0x26ed56[_0xd038('0x1a')];var _0x3e0878;if(_0x5e7881>=_0x56f93c){_0x5e7881=_0x56f93c;_0x3e0878=0xc8;}else{_0x3e0878=0xce;}_0x20be9b['status'](_0x3e0878);return _0x20be9b['set'](_0xd038('0x1c'),_0x3466fc+'-'+_0x5e7881+'/'+_0x56f93c)['json'](_0x9d93c1);}return null;};}function patchUpdates(_0xbbabb0){return function(_0x3f7c6c){try{jsonpatch[_0xd038('0x1d')](_0x3f7c6c,_0xbbabb0,!![]);}catch(_0x463be0){return BPromise[_0xd038('0x1e')](_0x463be0);}return _0x3f7c6c[_0xd038('0x1f')]();};}function saveUpdates(_0x306568,_0x43a6a8){return function(_0x3a156a){if(_0x3a156a){return _0x3a156a[_0xd038('0x20')](_0x306568)[_0xd038('0x21')](function(_0x375c0b){return _0x375c0b;});}return null;};}function removeEntity(_0x4c09d8,_0x5eed64){return function(_0x50644e){if(_0x50644e){return _0x50644e[_0xd038('0x22')]()[_0xd038('0x21')](function(){_0x4c09d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55f728,_0x487366){return function(_0xeca00f){if(!_0xeca00f){_0x55f728['sendStatus'](0x194);}return _0xeca00f;};}function handleError(_0x45ce18,_0x1fee60){_0x1fee60=_0x1fee60||0x1f4;return function(_0x58bfbf){logger[_0xd038('0x23')](_0x58bfbf[_0xd038('0x24')]);if(_0x58bfbf[_0xd038('0x25')]){delete _0x58bfbf['name'];}_0x45ce18[_0xd038('0x17')](_0x1fee60)[_0xd038('0x26')](_0x58bfbf);};}exports[_0xd038('0x27')]=function(_0x293320,_0x378be4){var _0x1917f4={},_0x43c525={},_0x5b8831={'count':0x0,'rows':[]};var _0x3cb6c3=_[_0xd038('0x28')](db[_0xd038('0x29')]['rawAttributes'],function(_0x5c60c9){return{'name':_0x5c60c9[_0xd038('0x2a')],'type':_0x5c60c9[_0xd038('0x2b')][_0xd038('0x2c')]};});_0x43c525[_0xd038('0x2d')]=_[_0xd038('0x28')](_0x3cb6c3,_0xd038('0x25'));_0x43c525[_0xd038('0x2e')]=_['keys'](_0x293320[_0xd038('0x2e')]);_0x43c525[_0xd038('0x2f')]=_[_0xd038('0x30')](_0x43c525[_0xd038('0x2d')],_0x43c525[_0xd038('0x2e')]);_0x1917f4['attributes']=_[_0xd038('0x30')](_0x43c525[_0xd038('0x2d')],qs[_0xd038('0x31')](_0x293320['query'][_0xd038('0x31')]));_0x1917f4[_0xd038('0x32')]=_0x1917f4[_0xd038('0x32')][_0xd038('0x33')]?_0x1917f4[_0xd038('0x32')]:_0x43c525['model'];if(!_0x293320[_0xd038('0x2e')][_0xd038('0x34')](_0xd038('0x35'))){_0x1917f4['limit']=qs[_0xd038('0x1a')](_0x293320[_0xd038('0x2e')]['limit']);_0x1917f4[_0xd038('0x19')]=qs[_0xd038('0x19')](_0x293320['query']['offset']);}_0x1917f4[_0xd038('0x36')]=qs[_0xd038('0x37')](_0x293320[_0xd038('0x2e')][_0xd038('0x37')]);_0x1917f4[_0xd038('0x38')]=qs[_0xd038('0x2f')](_[_0xd038('0x39')](_0x293320[_0xd038('0x2e')],_0x43c525['filters']),_0x3cb6c3);if(_0x293320[_0xd038('0x2e')][_0xd038('0x3a')]){_0x1917f4[_0xd038('0x38')]=_[_0xd038('0x3b')](_0x1917f4['where'],{'$or':_[_0xd038('0x28')](_0x3cb6c3,function(_0x46d131){if(_0x46d131[_0xd038('0x2b')]!==_0xd038('0x3c')){var _0x322a8f={};_0x322a8f[_0x46d131[_0xd038('0x25')]]={'$like':'%'+_0x293320['query'][_0xd038('0x3a')]+'%'};return _0x322a8f;}})});}_0x1917f4=_['merge']({},_0x1917f4,_0x293320[_0xd038('0x3d')]);var _0x1d8a67={'where':_0x1917f4[_0xd038('0x38')]};return db[_0xd038('0x29')]['count'](_0x1d8a67)[_0xd038('0x21')](function(_0x2e79d4){_0x5b8831[_0xd038('0x1b')]=_0x2e79d4;if(_0x293320['query'][_0xd038('0x3e')]){_0x1917f4[_0xd038('0x3f')]=[{'all':!![]}];}return db[_0xd038('0x29')]['findAll'](_0x1917f4);})[_0xd038('0x21')](function(_0x44fb91){_0x5b8831['rows']=_0x44fb91;return _0x5b8831;})[_0xd038('0x21')](respondWithFilteredResult(_0x378be4,_0x1917f4))['catch'](handleError(_0x378be4,null));};exports[_0xd038('0x40')]=function(_0x3d7bfe,_0x460963){var _0x4fa9b9={'raw':!![],'where':{'id':_0x3d7bfe['params']['id']}},_0x3b53d6={};_0x3b53d6[_0xd038('0x2d')]=_['keys'](db['FreshsalesField'][_0xd038('0x41')]);_0x3b53d6[_0xd038('0x2e')]=_[_0xd038('0x42')](_0x3d7bfe[_0xd038('0x2e')]);_0x3b53d6[_0xd038('0x2f')]=_[_0xd038('0x30')](_0x3b53d6[_0xd038('0x2d')],_0x3b53d6[_0xd038('0x2e')]);_0x4fa9b9[_0xd038('0x32')]=_[_0xd038('0x30')](_0x3b53d6[_0xd038('0x2d')],qs['fields'](_0x3d7bfe[_0xd038('0x2e')][_0xd038('0x31')]));_0x4fa9b9[_0xd038('0x32')]=_0x4fa9b9['attributes'][_0xd038('0x33')]?_0x4fa9b9[_0xd038('0x32')]:_0x3b53d6[_0xd038('0x2d')];if(_0x3d7bfe[_0xd038('0x2e')][_0xd038('0x3e')]){_0x4fa9b9[_0xd038('0x3f')]=[{'all':!![]}];}_0x4fa9b9=_[_0xd038('0x3b')]({},_0x4fa9b9,_0x3d7bfe[_0xd038('0x3d')]);return db['FreshsalesField'][_0xd038('0x43')](_0x4fa9b9)['then'](handleEntityNotFound(_0x460963,null))[_0xd038('0x21')](respondWithResult(_0x460963,null))[_0xd038('0x44')](handleError(_0x460963,null));};exports[_0xd038('0x45')]=function(_0x5aab1e,_0x13473c){return db[_0xd038('0x29')][_0xd038('0x45')](_0x5aab1e[_0xd038('0x46')],{})[_0xd038('0x21')](respondWithResult(_0x13473c,0xc9))[_0xd038('0x44')](handleError(_0x13473c,null));};exports[_0xd038('0x20')]=function(_0x27c506,_0x54f534){if(_0x27c506[_0xd038('0x46')]['id']){delete _0x27c506[_0xd038('0x46')]['id'];}return db[_0xd038('0x29')]['find']({'where':{'id':_0x27c506['params']['id']}})[_0xd038('0x21')](handleEntityNotFound(_0x54f534,null))[_0xd038('0x21')](saveUpdates(_0x27c506['body'],null))['then'](respondWithResult(_0x54f534,null))[_0xd038('0x44')](handleError(_0x54f534,null));};exports[_0xd038('0x22')]=function(_0x40de76,_0x3b4a85){return db[_0xd038('0x29')]['find']({'where':{'id':_0x40de76[_0xd038('0x47')]['id']}})[_0xd038('0x21')](handleEntityNotFound(_0x3b4a85,null))[_0xd038('0x21')](removeEntity(_0x3b4a85,null))[_0xd038('0x44')](handleError(_0x3b4a85,null));}; \ No newline at end of file +var _0x335c=['include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','options','FreshsalesField','count'];(function(_0x4fa868,_0x165b3f){var _0xc810db=function(_0x438e56){while(--_0x438e56){_0x4fa868['push'](_0x4fa868['shift']());}};_0xc810db(++_0x165b3f);}(_0x335c,0x1bb));var _0xc335=function(_0x5bb8cf,_0x49296b){_0x5bb8cf=_0x5bb8cf-0x0;var _0x4f6853=_0x335c[_0x5bb8cf];return _0x4f6853;};'use strict';var emlformat=require(_0xc335('0x0'));var rimraf=require(_0xc335('0x1'));var zipdir=require(_0xc335('0x2'));var jsonpatch=require(_0xc335('0x3'));var rp=require('request-promise');var moment=require(_0xc335('0x4'));var BPromise=require(_0xc335('0x5'));var Mustache=require(_0xc335('0x6'));var util=require(_0xc335('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc335('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc335('0x9'));var _=require('lodash');var squel=require(_0xc335('0xa'));var crypto=require(_0xc335('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc335('0xc'));var toCsv=require(_0xc335('0x8'));var querystring=require(_0xc335('0xd'));var Papa=require(_0xc335('0xe'));var Redis=require('ioredis');var authService=require(_0xc335('0xf'));var qs=require(_0xc335('0x10'));var as=require(_0xc335('0x11'));var hardwareService=require(_0xc335('0x12'));var logger=require(_0xc335('0x13'))('api');var utils=require(_0xc335('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc335('0x15'));var db=require(_0xc335('0x16'))['db'];function respondWithStatusCode(_0x233e7b,_0x5b043c){_0x5b043c=_0x5b043c||0xcc;return function(_0x1f57ad){if(_0x1f57ad){return _0x233e7b[_0xc335('0x17')](_0x5b043c);}return _0x233e7b[_0xc335('0x18')](_0x5b043c)[_0xc335('0x19')]();};}function respondWithResult(_0x4dc6d1,_0x239628){_0x239628=_0x239628||0xc8;return function(_0x430902){if(_0x430902){return _0x4dc6d1[_0xc335('0x18')](_0x239628)[_0xc335('0x1a')](_0x430902);}};}function respondWithFilteredResult(_0x13d767,_0x534334){return function(_0x1c7582){if(_0x1c7582){var _0x5e9207=typeof _0x534334[_0xc335('0x1b')]==='undefined'&&typeof _0x534334[_0xc335('0x1c')]===_0xc335('0x1d');var _0x448090=_0x1c7582['count'];var _0x466dfa=_0x5e9207?0x0:_0x534334[_0xc335('0x1b')];var _0x50f0d3=_0x5e9207?_0x1c7582['count']:_0x534334[_0xc335('0x1b')]+_0x534334[_0xc335('0x1c')];var _0x1fe46f;if(_0x50f0d3>=_0x448090){_0x50f0d3=_0x448090;_0x1fe46f=0xc8;}else{_0x1fe46f=0xce;}_0x13d767[_0xc335('0x18')](_0x1fe46f);return _0x13d767[_0xc335('0x1e')](_0xc335('0x1f'),_0x466dfa+'-'+_0x50f0d3+'/'+_0x448090)['json'](_0x1c7582);}return null;};}function patchUpdates(_0x15fcd7){return function(_0x195c6f){try{jsonpatch[_0xc335('0x20')](_0x195c6f,_0x15fcd7,!![]);}catch(_0x28d927){return BPromise['reject'](_0x28d927);}return _0x195c6f[_0xc335('0x21')]();};}function saveUpdates(_0x48d4da,_0x35eab3){return function(_0x4711e3){if(_0x4711e3){return _0x4711e3['update'](_0x48d4da)[_0xc335('0x22')](function(_0x27f92b){return _0x27f92b;});}return null;};}function removeEntity(_0x34b7b7,_0x7b0c00){return function(_0x1f1f6a){if(_0x1f1f6a){return _0x1f1f6a[_0xc335('0x23')]()[_0xc335('0x22')](function(){_0x34b7b7[_0xc335('0x18')](0xcc)[_0xc335('0x19')]();});}};}function handleEntityNotFound(_0xcaddfc,_0x3519cf){return function(_0x1446e3){if(!_0x1446e3){_0xcaddfc[_0xc335('0x17')](0x194);}return _0x1446e3;};}function handleError(_0x2bab33,_0x3ba5ac){_0x3ba5ac=_0x3ba5ac||0x1f4;return function(_0x5ddf50){logger[_0xc335('0x24')](_0x5ddf50[_0xc335('0x25')]);if(_0x5ddf50[_0xc335('0x26')]){delete _0x5ddf50['name'];}_0x2bab33[_0xc335('0x18')](_0x3ba5ac)[_0xc335('0x27')](_0x5ddf50);};}exports[_0xc335('0x28')]=function(_0x32be84,_0x40ecaa){var _0x10fa83={},_0x3f03ac={},_0x1ff77e={'count':0x0,'rows':[]};var _0x1da6f1=_[_0xc335('0x29')](db['FreshsalesField'][_0xc335('0x2a')],function(_0x441861){return{'name':_0x441861['fieldName'],'type':_0x441861[_0xc335('0x2b')][_0xc335('0x2c')]};});_0x3f03ac[_0xc335('0x2d')]=_[_0xc335('0x29')](_0x1da6f1,_0xc335('0x26'));_0x3f03ac[_0xc335('0x2e')]=_['keys'](_0x32be84[_0xc335('0x2e')]);_0x3f03ac[_0xc335('0x2f')]=_[_0xc335('0x30')](_0x3f03ac[_0xc335('0x2d')],_0x3f03ac[_0xc335('0x2e')]);_0x10fa83[_0xc335('0x31')]=_[_0xc335('0x30')](_0x3f03ac['model'],qs[_0xc335('0x32')](_0x32be84[_0xc335('0x2e')][_0xc335('0x32')]));_0x10fa83[_0xc335('0x31')]=_0x10fa83['attributes'][_0xc335('0x33')]?_0x10fa83['attributes']:_0x3f03ac[_0xc335('0x2d')];if(!_0x32be84[_0xc335('0x2e')]['hasOwnProperty']('nolimit')){_0x10fa83['limit']=qs[_0xc335('0x1c')](_0x32be84[_0xc335('0x2e')][_0xc335('0x1c')]);_0x10fa83['offset']=qs[_0xc335('0x1b')](_0x32be84[_0xc335('0x2e')][_0xc335('0x1b')]);}_0x10fa83[_0xc335('0x34')]=qs[_0xc335('0x35')](_0x32be84['query'][_0xc335('0x35')]);_0x10fa83[_0xc335('0x36')]=qs[_0xc335('0x2f')](_[_0xc335('0x37')](_0x32be84[_0xc335('0x2e')],_0x3f03ac[_0xc335('0x2f')]),_0x1da6f1);if(_0x32be84[_0xc335('0x2e')][_0xc335('0x38')]){_0x10fa83['where']=_['merge'](_0x10fa83[_0xc335('0x36')],{'$or':_[_0xc335('0x29')](_0x1da6f1,function(_0xd5ce90){if(_0xd5ce90[_0xc335('0x2b')]!==_0xc335('0x39')){var _0x24e2b9={};_0x24e2b9[_0xd5ce90[_0xc335('0x26')]]={'$like':'%'+_0x32be84[_0xc335('0x2e')]['filter']+'%'};return _0x24e2b9;}})});}_0x10fa83=_['merge']({},_0x10fa83,_0x32be84[_0xc335('0x3a')]);var _0x1f56bd={'where':_0x10fa83['where']};return db[_0xc335('0x3b')][_0xc335('0x3c')](_0x1f56bd)[_0xc335('0x22')](function(_0x52ea7d){_0x1ff77e[_0xc335('0x3c')]=_0x52ea7d;if(_0x32be84[_0xc335('0x2e')]['includeAll']){_0x10fa83[_0xc335('0x3d')]=[{'all':!![]}];}return db[_0xc335('0x3b')][_0xc335('0x3e')](_0x10fa83);})[_0xc335('0x22')](function(_0x545584){_0x1ff77e[_0xc335('0x3f')]=_0x545584;return _0x1ff77e;})[_0xc335('0x22')](respondWithFilteredResult(_0x40ecaa,_0x10fa83))['catch'](handleError(_0x40ecaa,null));};exports[_0xc335('0x40')]=function(_0x462317,_0x1ef792){var _0x805b30={'raw':!![],'where':{'id':_0x462317['params']['id']}},_0x4f7780={};_0x4f7780[_0xc335('0x2d')]=_[_0xc335('0x41')](db[_0xc335('0x3b')][_0xc335('0x2a')]);_0x4f7780[_0xc335('0x2e')]=_['keys'](_0x462317[_0xc335('0x2e')]);_0x4f7780[_0xc335('0x2f')]=_[_0xc335('0x30')](_0x4f7780[_0xc335('0x2d')],_0x4f7780['query']);_0x805b30[_0xc335('0x31')]=_[_0xc335('0x30')](_0x4f7780['model'],qs[_0xc335('0x32')](_0x462317[_0xc335('0x2e')][_0xc335('0x32')]));_0x805b30[_0xc335('0x31')]=_0x805b30['attributes'][_0xc335('0x33')]?_0x805b30[_0xc335('0x31')]:_0x4f7780[_0xc335('0x2d')];if(_0x462317['query'][_0xc335('0x42')]){_0x805b30[_0xc335('0x3d')]=[{'all':!![]}];}_0x805b30=_['merge']({},_0x805b30,_0x462317[_0xc335('0x3a')]);return db[_0xc335('0x3b')][_0xc335('0x43')](_0x805b30)[_0xc335('0x22')](handleEntityNotFound(_0x1ef792,null))[_0xc335('0x22')](respondWithResult(_0x1ef792,null))[_0xc335('0x44')](handleError(_0x1ef792,null));};exports['create']=function(_0x5c921d,_0x4249ed){return db[_0xc335('0x3b')][_0xc335('0x45')](_0x5c921d['body'],{})[_0xc335('0x22')](respondWithResult(_0x4249ed,0xc9))[_0xc335('0x44')](handleError(_0x4249ed,null));};exports['update']=function(_0x1a909e,_0xe65a92){if(_0x1a909e[_0xc335('0x46')]['id']){delete _0x1a909e['body']['id'];}return db[_0xc335('0x3b')]['find']({'where':{'id':_0x1a909e[_0xc335('0x47')]['id']}})['then'](handleEntityNotFound(_0xe65a92,null))['then'](saveUpdates(_0x1a909e[_0xc335('0x46')],null))[_0xc335('0x22')](respondWithResult(_0xe65a92,null))['catch'](handleError(_0xe65a92,null));};exports['destroy']=function(_0x36e0cf,_0x16f9f0){return db[_0xc335('0x3b')][_0xc335('0x43')]({'where':{'id':_0x36e0cf[_0xc335('0x47')]['id']}})[_0xc335('0x22')](handleEntityNotFound(_0x16f9f0,null))[_0xc335('0x22')](removeEntity(_0x16f9f0,null))[_0xc335('0x44')](handleError(_0x16f9f0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 2060924..0092996 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 _0xe820=['exports','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x57eac3,_0x2e1e30){var _0x4d5418=function(_0x1dd36c){while(--_0x1dd36c){_0x57eac3['push'](_0x57eac3['shift']());}};_0x4d5418(++_0x2e1e30);}(_0xe820,0xd2));var _0x0e82=function(_0x22ede7,_0x4b48fa){_0x22ede7=_0x22ede7-0x0;var _0x2b3c2c=_0xe820[_0x22ede7];return _0x2b3c2c;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var logger=require(_0x0e82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0e82('0x2'));var rp=require(_0x0e82('0x3'));var fs=require('fs');var path=require(_0x0e82('0x4'));var rimraf=require('rimraf');var config=require(_0x0e82('0x5'));var attributes=require('./intFreshsalesField.attributes');module[_0x0e82('0x6')]=function(_0x105e3c,_0x69e27f){return _0x105e3c[_0x0e82('0x7')](_0x0e82('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x0e82('0x9'),'fields':[_0x0e82('0xa'),_0x0e82('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf5b6=['path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','freshsales_unique_index','FieldId','../../config/logger','api','moment','bluebird'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x453ea8,_0x41adfc){_0x453ea8=_0x453ea8-0x0;var _0x592a46=_0xf5b6[_0x453ea8];return _0x592a46;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f5b('0x0'))(_0x6f5b('0x1'));var moment=require(_0x6f5b('0x2'));var BPromise=require(_0x6f5b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f5b('0x4'));var rimraf=require(_0x6f5b('0x5'));var config=require(_0x6f5b('0x6'));var attributes=require(_0x6f5b('0x7'));module['exports']=function(_0x518ebf,_0x4baf5c){return _0x518ebf[_0x6f5b('0x8')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x6f5b('0x9'),'fields':['idField',_0x6f5b('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 8d9c938..ac3089a 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(_0x4e6872,_0x27bf27){var _0x581a8a=function(_0xb27bc){while(--_0xb27bc){_0x4e6872['push'](_0x4e6872['shift']());}};_0x581a8a(++_0x27bf27);}(_0x1623,0xab));var _0x3162=function(_0x3b81b0,_0x3a0670){_0x3b81b0=_0x3b81b0-0x0;var _0x2efa6b=_0x1623[_0x3b81b0];return _0x2efa6b;};'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 _0xeda8=['debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x5e32a8,_0x1180db){var _0x4f0af6=function(_0xdd4eec){while(--_0xdd4eec){_0x5e32a8['push'](_0x5e32a8['shift']());}};_0x4f0af6(++_0x1180db);}(_0xeda8,0x104));var _0x8eda=function(_0x547a54,_0x270e60){_0x547a54=_0x547a54-0x0;var _0x2384d1=_0xeda8[_0x547a54];return _0x2384d1;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 08e257b..215a63f 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(_0x5839d0,_0x5641f2){var _0x5c5815=function(_0xa3827a){while(--_0xa3827a){_0x5839d0['push'](_0x5839d0['shift']());}};_0x5c5815(++_0x5641f2);}(_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('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xbe348a,_0x344bbf){var _0xc0cec9=function(_0x52e952){while(--_0x52e952){_0xbe348a['push'](_0xbe348a['shift']());}};_0xc0cec9(++_0x344bbf);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 2400c46..7cc2c6a 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 _0xa6ce=['integrationTab','newTab','sequelize','STRING','username','ENUM'];(function(_0x4723e7,_0x21ad0c){var _0x408562=function(_0x477b6a){while(--_0x477b6a){_0x4723e7['push'](_0x4723e7['shift']());}};_0x408562(++_0x21ad0c);}(_0xa6ce,0x15e));var _0xea6c=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0xa6ce[_0x53fe97];return _0x5c49a2;};'use strict';var Sequelize=require(_0xea6c('0x0'));module['exports']={'name':{'type':Sequelize[_0xea6c('0x1')]},'description':{'type':Sequelize[_0xea6c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xea6c('0x2')},'remoteUri':{'type':Sequelize[_0xea6c('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xea6c('0x1')]},'securityToken':{'type':Sequelize[_0xea6c('0x1')]},'serverUrl':{'type':Sequelize[_0xea6c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xea6c('0x3')](_0xea6c('0x4'),_0xea6c('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x652a=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0x652a,0x1ae));var _0xa652=function(_0x27ca8c,_0x231aaa){_0x27ca8c=_0x27ca8c-0x0;var _0x4107b7=_0x652a[_0x27ca8c];return _0x4107b7;};'use strict';var Sequelize=require(_0xa652('0x0'));module[_0xa652('0x1')]={'name':{'type':Sequelize[_0xa652('0x2')]},'description':{'type':Sequelize[_0xa652('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xa652('0x2')]},'password':{'type':Sequelize[_0xa652('0x2')]},'clientId':{'type':Sequelize[_0xa652('0x2')]},'clientSecret':{'type':Sequelize[_0xa652('0x2')]},'securityToken':{'type':Sequelize[_0xa652('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa652('0x3')](_0xa652('0x4'),_0xa652('0x5')),'defaultValue':_0xa652('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b057925..8d2ab33 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 _0x491d=['clientSecret','username','Connection','login','password','securityToken','isNil','ticketType','sobject','ActivityDate','IsRecurrence','Subject','Description','string','int','email','textarea','phone','remove','includes','custom','picklistValues','label','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','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','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','SalesforceAccount','catch','params','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','Subjects','getSubjects','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId'];(function(_0x5b8861,_0x5d74a9){var _0x3dab3e=function(_0x3e7798){while(--_0x3e7798){_0x5b8861['push'](_0x5b8861['shift']());}};_0x3dab3e(++_0x5d74a9);}(_0x491d,0x10e));var _0xd491=function(_0x4dbf63,_0xd10956){_0x4dbf63=_0x4dbf63-0x0;var _0x4feb18=_0x491d[_0x4dbf63];return _0x4feb18;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd491('0x0'));var jsonpatch=require(_0xd491('0x1'));var rp=require(_0xd491('0x2'));var moment=require('moment');var BPromise=require(_0xd491('0x3'));var Mustache=require(_0xd491('0x4'));var util=require(_0xd491('0x5'));var path=require(_0xd491('0x6'));var sox=require(_0xd491('0x7'));var csv=require(_0xd491('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd491('0x9'));var squel=require('squel');var crypto=require(_0xd491('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd491('0xb'));var toCsv=require(_0xd491('0x8'));var querystring=require(_0xd491('0xc'));var Papa=require('papaparse');var Redis=require(_0xd491('0xd'));var authService=require(_0xd491('0xe'));var qs=require(_0xd491('0xf'));var as=require(_0xd491('0x10'));var hardwareService=require(_0xd491('0x11'));var logger=require(_0xd491('0x12'))(_0xd491('0x13'));var utils=require('../../config/utils');var config=require(_0xd491('0x14'));var licenseUtil=require(_0xd491('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd491('0x16'));function respondWithStatusCode(_0x1f2542,_0x1cb20d){_0x1cb20d=_0x1cb20d||0xcc;return function(_0x18a1f2){if(_0x18a1f2){return _0x1f2542['sendStatus'](_0x1cb20d);}return _0x1f2542[_0xd491('0x17')](_0x1cb20d)[_0xd491('0x18')]();};}function respondWithResult(_0x3eea43,_0x1c43b8){_0x1c43b8=_0x1c43b8||0xc8;return function(_0x126ae1){if(_0x126ae1){return _0x3eea43[_0xd491('0x17')](_0x1c43b8)[_0xd491('0x19')](_0x126ae1);}};}function respondWithFilteredResult(_0x7529d2,_0x19dbf4){return function(_0x441f52){if(_0x441f52){var _0x1388d1=typeof _0x19dbf4[_0xd491('0x1a')]===_0xd491('0x1b')&&typeof _0x19dbf4[_0xd491('0x1c')]===_0xd491('0x1b');var _0x1faae0=_0x441f52['count'];var _0x47d35d=_0x1388d1?0x0:_0x19dbf4['offset'];var _0x13cc19=_0x1388d1?_0x441f52[_0xd491('0x1d')]:_0x19dbf4[_0xd491('0x1a')]+_0x19dbf4[_0xd491('0x1c')];var _0x1bb174;if(_0x13cc19>=_0x1faae0){_0x13cc19=_0x1faae0;_0x1bb174=0xc8;}else{_0x1bb174=0xce;}_0x7529d2[_0xd491('0x17')](_0x1bb174);return _0x7529d2[_0xd491('0x1e')](_0xd491('0x1f'),_0x47d35d+'-'+_0x13cc19+'/'+_0x1faae0)[_0xd491('0x19')](_0x441f52);}return null;};}function patchUpdates(_0x3b28ce){return function(_0x3e807f){try{jsonpatch['apply'](_0x3e807f,_0x3b28ce,!![]);}catch(_0x59c684){return BPromise[_0xd491('0x20')](_0x59c684);}return _0x3e807f[_0xd491('0x21')]();};}function saveUpdates(_0x17672e,_0x22a9fb){return function(_0x4a4ee4){if(_0x4a4ee4){return _0x4a4ee4['update'](_0x17672e)['then'](function(_0x354631){return _0x354631;});}return null;};}function removeEntity(_0x17e1b7,_0x43fd8e){return function(_0x26e81e){if(_0x26e81e){return _0x26e81e[_0xd491('0x22')]()[_0xd491('0x23')](function(){_0x17e1b7['status'](0xcc)[_0xd491('0x18')]();});}};}function handleEntityNotFound(_0x31985c,_0x5b4c75){return function(_0x2bc91a){if(!_0x2bc91a){_0x31985c[_0xd491('0x24')](0x194);}return _0x2bc91a;};}function handleError(_0x33a5ae,_0x510b96){_0x510b96=_0x510b96||0x1f4;return function(_0x34b338){logger[_0xd491('0x25')](_0x34b338[_0xd491('0x26')]);if(_0x34b338['name']){delete _0x34b338[_0xd491('0x27')];}_0x33a5ae[_0xd491('0x17')](_0x510b96)['send'](_0x34b338);};}exports[_0xd491('0x28')]=function(_0x8ba4da,_0x57f526){var _0x5cc4fe={},_0x3666b5={},_0x3f098e={'count':0x0,'rows':[]};var _0xa4d799=_[_0xd491('0x29')](db['SalesforceAccount'][_0xd491('0x2a')],function(_0x2a20bc){return{'name':_0x2a20bc[_0xd491('0x2b')],'type':_0x2a20bc[_0xd491('0x2c')][_0xd491('0x2d')]};});_0x3666b5[_0xd491('0x2e')]=_[_0xd491('0x29')](_0xa4d799,_0xd491('0x27'));_0x3666b5[_0xd491('0x2f')]=_[_0xd491('0x30')](_0x8ba4da[_0xd491('0x2f')]);_0x3666b5[_0xd491('0x31')]=_['intersection'](_0x3666b5['model'],_0x3666b5[_0xd491('0x2f')]);_0x5cc4fe[_0xd491('0x32')]=_[_0xd491('0x33')](_0x3666b5[_0xd491('0x2e')],qs[_0xd491('0x34')](_0x8ba4da['query'][_0xd491('0x34')]));_0x5cc4fe['attributes']=_0x5cc4fe['attributes'][_0xd491('0x35')]?_0x5cc4fe['attributes']:_0x3666b5[_0xd491('0x2e')];if(!_0x8ba4da[_0xd491('0x2f')]['hasOwnProperty'](_0xd491('0x36'))){_0x5cc4fe['limit']=qs[_0xd491('0x1c')](_0x8ba4da[_0xd491('0x2f')][_0xd491('0x1c')]);_0x5cc4fe['offset']=qs['offset'](_0x8ba4da['query'][_0xd491('0x1a')]);}_0x5cc4fe[_0xd491('0x37')]=qs['sort'](_0x8ba4da['query'][_0xd491('0x38')]);_0x5cc4fe[_0xd491('0x39')]=qs[_0xd491('0x31')](_[_0xd491('0x3a')](_0x8ba4da[_0xd491('0x2f')],_0x3666b5[_0xd491('0x31')]),_0xa4d799);if(_0x8ba4da[_0xd491('0x2f')]['filter']){_0x5cc4fe['where']=_[_0xd491('0x3b')](_0x5cc4fe[_0xd491('0x39')],{'$or':_[_0xd491('0x29')](_0xa4d799,function(_0x4bb69c){if(_0x4bb69c[_0xd491('0x2c')]!=='VIRTUAL'){var _0x2ea8c8={};_0x2ea8c8[_0x4bb69c[_0xd491('0x27')]]={'$like':'%'+_0x8ba4da[_0xd491('0x2f')][_0xd491('0x3c')]+'%'};return _0x2ea8c8;}})});}_0x5cc4fe=_[_0xd491('0x3b')]({},_0x5cc4fe,_0x8ba4da[_0xd491('0x3d')]);var _0x3f35d5={'where':_0x5cc4fe[_0xd491('0x39')]};return db['SalesforceAccount']['count'](_0x3f35d5)[_0xd491('0x23')](function(_0x1594d8){_0x3f098e['count']=_0x1594d8;if(_0x8ba4da['query'][_0xd491('0x3e')]){_0x5cc4fe[_0xd491('0x3f')]=[{'all':!![]}];}return db[_0xd491('0x40')]['findAll'](_0x5cc4fe);})[_0xd491('0x23')](function(_0x15c467){_0x3f098e['rows']=_0x15c467;return _0x3f098e;})['then'](respondWithFilteredResult(_0x57f526,_0x5cc4fe))[_0xd491('0x41')](handleError(_0x57f526,null));};exports['show']=function(_0x546915,_0x57b726){var _0x5b975b={'raw':![],'where':{'id':_0x546915[_0xd491('0x42')]['id']}},_0x192030={};_0x192030[_0xd491('0x2e')]=_['keys'](db[_0xd491('0x40')][_0xd491('0x2a')]);_0x192030[_0xd491('0x2f')]=_[_0xd491('0x30')](_0x546915['query']);_0x192030['filters']=_[_0xd491('0x33')](_0x192030[_0xd491('0x2e')],_0x192030[_0xd491('0x2f')]);_0x5b975b['attributes']=_['intersection'](_0x192030[_0xd491('0x2e')],qs[_0xd491('0x34')](_0x546915[_0xd491('0x2f')][_0xd491('0x34')]));_0x5b975b[_0xd491('0x32')]=_0x5b975b[_0xd491('0x32')][_0xd491('0x35')]?_0x5b975b[_0xd491('0x32')]:_0x192030[_0xd491('0x2e')];if(_0x546915[_0xd491('0x2f')][_0xd491('0x3e')]){_0x5b975b['include']=[{'all':!![]}];}_0x5b975b=_['merge']({},_0x5b975b,_0x546915['options']);return db[_0xd491('0x40')][_0xd491('0x43')](_0x5b975b)[_0xd491('0x23')](handleEntityNotFound(_0x57b726,null))['then'](respondWithResult(_0x57b726,null))[_0xd491('0x41')](handleError(_0x57b726,null));};exports[_0xd491('0x44')]=function(_0x17346e,_0xd27c18){return db[_0xd491('0x40')][_0xd491('0x44')](_0x17346e[_0xd491('0x45')],{})[_0xd491('0x23')](respondWithResult(_0xd27c18,0xc9))[_0xd491('0x41')](handleError(_0xd27c18,null));};exports[_0xd491('0x46')]=function(_0x325a19,_0x46ff96){if(_0x325a19[_0xd491('0x45')]['id']){delete _0x325a19[_0xd491('0x45')]['id'];}return db[_0xd491('0x40')][_0xd491('0x43')]({'where':{'id':_0x325a19[_0xd491('0x42')]['id']}})[_0xd491('0x23')](handleEntityNotFound(_0x46ff96,null))['then'](saveUpdates(_0x325a19[_0xd491('0x45')],null))[_0xd491('0x23')](respondWithResult(_0x46ff96,null))[_0xd491('0x41')](handleError(_0x46ff96,null));};exports['destroy']=function(_0x8037a5,_0x4ed6f5){return db[_0xd491('0x40')]['find']({'where':{'id':_0x8037a5[_0xd491('0x42')]['id']}})[_0xd491('0x23')](handleEntityNotFound(_0x4ed6f5,null))[_0xd491('0x23')](removeEntity(_0x4ed6f5,null))[_0xd491('0x41')](handleError(_0x4ed6f5,null));};exports[_0xd491('0x47')]=function(_0x3c5d0d,_0x46bcef,_0x2820e4){var _0x5359a9={};var _0xf7c5e8={};var _0x48724b;var _0xc14201;return db[_0xd491('0x40')][_0xd491('0x48')]({'where':{'id':_0x3c5d0d[_0xd491('0x42')]['id']}})[_0xd491('0x23')](handleEntityNotFound(_0x46bcef,null))[_0xd491('0x23')](function(_0x5df4db){if(_0x5df4db){_0x48724b=_0x5df4db;_0xf7c5e8[_0xd491('0x2e')]=_[_0xd491('0x30')](db[_0xd491('0x49')][_0xd491('0x2a')]);_0xf7c5e8[_0xd491('0x2f')]=_['keys'](_0x3c5d0d[_0xd491('0x2f')]);_0xf7c5e8[_0xd491('0x31')]=_[_0xd491('0x33')](_0xf7c5e8[_0xd491('0x2e')],_0xf7c5e8[_0xd491('0x2f')]);_0x5359a9['attributes']=_[_0xd491('0x33')](_0xf7c5e8[_0xd491('0x2e')],qs[_0xd491('0x34')](_0x3c5d0d[_0xd491('0x2f')][_0xd491('0x34')]));_0x5359a9[_0xd491('0x32')]=_0x5359a9[_0xd491('0x32')][_0xd491('0x35')]?_0x5359a9[_0xd491('0x32')]:_0xf7c5e8[_0xd491('0x2e')];_0x5359a9['order']=qs[_0xd491('0x38')](_0x3c5d0d[_0xd491('0x2f')][_0xd491('0x38')]);_0x5359a9[_0xd491('0x39')]=qs[_0xd491('0x31')](_[_0xd491('0x3a')](_0x3c5d0d[_0xd491('0x2f')],_0xf7c5e8['filters']));if(_0x3c5d0d[_0xd491('0x2f')][_0xd491('0x3c')]){_0x5359a9[_0xd491('0x39')]=_[_0xd491('0x3b')](_0x5359a9['where'],{'$or':_[_0xd491('0x29')](_0x5359a9[_0xd491('0x32')],function(_0x379b21){var _0x196b44={};_0x196b44[_0x379b21]={'$like':'%'+_0x3c5d0d[_0xd491('0x2f')][_0xd491('0x3c')]+'%'};return _0x196b44;})});}_0x5359a9=_[_0xd491('0x3b')]({},_0x5359a9,_0x3c5d0d[_0xd491('0x3d')]);return _0x48724b[_0xd491('0x47')](_0x5359a9);}})[_0xd491('0x23')](function(_0x303d00){if(_0x303d00){_0xc14201=_0x303d00[_0xd491('0x35')];if(!_0x3c5d0d['query'][_0xd491('0x4a')]('nolimit')){_0x5359a9[_0xd491('0x1c')]=qs[_0xd491('0x1c')](_0x3c5d0d[_0xd491('0x2f')][_0xd491('0x1c')]);_0x5359a9[_0xd491('0x1a')]=qs['offset'](_0x3c5d0d[_0xd491('0x2f')][_0xd491('0x1a')]);}return _0x48724b[_0xd491('0x47')](_0x5359a9);}})[_0xd491('0x23')](function(_0x4b3776){if(_0x4b3776){return _0x4b3776?{'count':_0xc14201,'rows':_0x4b3776}:null;}})[_0xd491('0x23')](respondWithResult(_0x46bcef,null))['catch'](handleError(_0x46bcef,null));};exports['addConfiguration']=function(_0x10b722,_0x5d5f7c,_0x418e4e){if(_0x10b722[_0xd491('0x45')]['id']){delete _0x10b722[_0xd491('0x45')]['id'];}return db['SalesforceAccount'][_0xd491('0x48')]({'where':{'id':_0x10b722[_0xd491('0x42')]['id']}})[_0xd491('0x23')](handleEntityNotFound(_0x5d5f7c,null))[_0xd491('0x23')](function(_0x404c64){if(_0x404c64){_0x10b722[_0xd491('0x45')]['AccountId']=_0x404c64['id'];_0x10b722[_0xd491('0x45')][_0xd491('0x4b')]=integrations[_0xd491('0x4c')](_0x10b722[_0xd491('0x45')]['channel'],_0x10b722['body'][_0xd491('0x2c')]);_0x10b722[_0xd491('0x45')]['Descriptions']=integrations[_0xd491('0x4d')](_0x10b722['body'][_0xd491('0x4e')],_0x10b722['body'][_0xd491('0x2c')]);return db['SalesforceConfiguration'][_0xd491('0x44')](_0x10b722[_0xd491('0x45')],{'include':[{'model':db[_0xd491('0x4f')],'as':'Subjects'},{'model':db[_0xd491('0x4f')],'as':'Descriptions'}]});}return null;})[_0xd491('0x23')](respondWithResult(_0x5d5f7c,null))[_0xd491('0x41')](handleError(_0x5d5f7c,null));};exports[_0xd491('0x50')]=function(_0x3f0f97,_0x38f8d3,_0x13f9d1){var _0x235647;var _0x851202='';var _0x5d130f=_0xd491('0x51');return db[_0xd491('0x40')]['findOne']({'where':{'id':_0x3f0f97['params']['id']},'attributes':['id',_0xd491('0x52'),_0xd491('0x53'),_0xd491('0x54'),_0xd491('0x55'),'password','securityToken']})[_0xd491('0x23')](handleEntityNotFound(_0x38f8d3,null))[_0xd491('0x23')](function(_0x1b9040){if(_0x1b9040){_0x851202=_0x1b9040[_0xd491('0x52')];var _0x2f370e=_0x851202['slice'](-0x1);if(_0x2f370e==='/'){_0x851202=_0x851202['substring'](0x0,_0x851202['lastIndexOf'](_0x2f370e));}_0x235647=new jsforce[(_0xd491('0x56'))]({'oauth2':{'loginUrl':_0x851202,'clientId':_0x1b9040[_0xd491('0x53')],'clientSecret':_0x1b9040[_0xd491('0x54')]}});return _0x235647[_0xd491('0x57')](_0x1b9040['username'],_0x1b9040[_0xd491('0x58')]['concat'](_0x1b9040[_0xd491('0x59')]));}})[_0xd491('0x23')](function(_0x3cfaa3){if(_0x3cfaa3){if(!_[_0xd491('0x5a')](_0x3f0f97[_0xd491('0x2f')][_0xd491('0x5b')])){_0x5d130f=_0x3f0f97['query'][_0xd491('0x5b')];}return _0x235647[_0xd491('0x5c')](_0x5d130f)['describe']();}})[_0xd491('0x23')](function(_0x12e832){var _0x59a9e3=['OwnerId',_0xd491('0x5d'),'IsReminderSet',_0xd491('0x5e'),_0xd491('0x5f'),_0xd491('0x60')];var _0x3a45f1=[_0xd491('0x61'),_0xd491('0x62'),'picklist','boolean',_0xd491('0x63'),_0xd491('0x64'),_0xd491('0x65')];if(_0x12e832){_[_0xd491('0x66')](_0x12e832['fields'],function(_0x36d6ea){return _0x59a9e3[_0xd491('0x67')](_0x36d6ea[_0xd491('0x27')])||!_0x3a45f1[_0xd491('0x67')](_0x36d6ea[_0xd491('0x2c')]);});return{'count':_0x12e832[_0xd491('0x34')][_0xd491('0x35')],'rows':_[_0xd491('0x29')](_0x12e832[_0xd491('0x34')],function(_0x169daa){return{'id':_0x169daa[_0xd491('0x27')],'name':_0x169daa['label'],'custom':_0x169daa[_0xd491('0x68')],'options':_0x169daa[_0xd491('0x69')][_0xd491('0x35')]>0x0?_[_0xd491('0x29')](_0x169daa[_0xd491('0x69')],function(_0x44d792){return{'name':_0x44d792[_0xd491('0x6a')],'value':_0x44d792[_0xd491('0x6b')]};}):_0x169daa['type']==_0xd491('0x6c')?[{'name':_0xd491('0x6d'),'value':_0xd491('0x6e')},{'name':_0xd491('0x6f'),'value':_0xd491('0x70')}]:[]};})};}})['then'](respondWithResult(_0x38f8d3,null))[_0xd491('0x41')](function(_0x4ac464){var _0x49eb30=_0x3f0f97[_0xd491('0x2f')][_0xd491('0x71')]?0x1f4:_0x4ac464[_0xd491('0x72')]||0x1f4;logger[_0xd491('0x25')](_0xd491('0x73'),_0xd491('0x50'),_0x49eb30,JSON[_0xd491('0x74')](_0x4ac464));delete _0x4ac464[_0xd491('0x27')];if(_0x49eb30===0x191){_0x49eb30=0x190;}_0x38f8d3[_0xd491('0x17')](_0x49eb30)['send'](_0x3f0f97['query']['test']?{'message':_0xd491('0x75'),'statusCode':_0x4ac464['statusCode']}:_0x4ac464);});}; \ No newline at end of file +var _0x68bd=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filters','filter','map','type','VIRTUAL','merge','options','include','SalesforceAccount','findAll','rows','catch','includeAll','find','create','body','params','destroy','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','Connection','login','password','concat','isNil','ticketType','describe','OwnerId','IsReminderSet','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','False','false','test','statusCode','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x267f35,_0x577dbc){var _0x4eda1d=function(_0x1b49ec){while(--_0x1b49ec){_0x267f35['push'](_0x267f35['shift']());}};_0x4eda1d(++_0x577dbc);}(_0x68bd,0x72));var _0xd68b=function(_0x3f57db,_0x10e075){_0x3f57db=_0x3f57db-0x0;var _0x8cc430=_0x68bd[_0x3f57db];return _0x8cc430;};'use strict';var emlformat=require(_0xd68b('0x0'));var rimraf=require(_0xd68b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd68b('0x2'));var moment=require(_0xd68b('0x3'));var BPromise=require(_0xd68b('0x4'));var Mustache=require(_0xd68b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd68b('0x6'));var csv=require(_0xd68b('0x7'));var ejs=require(_0xd68b('0x8'));var fs=require('fs');var fs_extra=require(_0xd68b('0x9'));var _=require(_0xd68b('0xa'));var squel=require(_0xd68b('0xb'));var crypto=require(_0xd68b('0xc'));var jsforce=require(_0xd68b('0xd'));var deskjs=require(_0xd68b('0xe'));var toCsv=require(_0xd68b('0x7'));var querystring=require(_0xd68b('0xf'));var Papa=require(_0xd68b('0x10'));var Redis=require(_0xd68b('0x11'));var authService=require(_0xd68b('0x12'));var qs=require(_0xd68b('0x13'));var as=require(_0xd68b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd68b('0x15'))(_0xd68b('0x16'));var utils=require(_0xd68b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd68b('0x18'));var db=require(_0xd68b('0x19'))['db'];var integrations=require(_0xd68b('0x1a'));function respondWithStatusCode(_0x3f2996,_0x21a7b8){_0x21a7b8=_0x21a7b8||0xcc;return function(_0x350919){if(_0x350919){return _0x3f2996[_0xd68b('0x1b')](_0x21a7b8);}return _0x3f2996[_0xd68b('0x1c')](_0x21a7b8)[_0xd68b('0x1d')]();};}function respondWithResult(_0x3bb473,_0xfc28ee){_0xfc28ee=_0xfc28ee||0xc8;return function(_0x1b5221){if(_0x1b5221){return _0x3bb473['status'](_0xfc28ee)[_0xd68b('0x1e')](_0x1b5221);}};}function respondWithFilteredResult(_0x29e691,_0x3677c3){return function(_0x19ce67){if(_0x19ce67){var _0x32e3d2=typeof _0x3677c3['offset']===_0xd68b('0x1f')&&typeof _0x3677c3['limit']===_0xd68b('0x1f');var _0x3985ee=_0x19ce67[_0xd68b('0x20')];var _0x5da817=_0x32e3d2?0x0:_0x3677c3['offset'];var _0x275e38=_0x32e3d2?_0x19ce67[_0xd68b('0x20')]:_0x3677c3['offset']+_0x3677c3['limit'];var _0x48bade;if(_0x275e38>=_0x3985ee){_0x275e38=_0x3985ee;_0x48bade=0xc8;}else{_0x48bade=0xce;}_0x29e691[_0xd68b('0x1c')](_0x48bade);return _0x29e691[_0xd68b('0x21')](_0xd68b('0x22'),_0x5da817+'-'+_0x275e38+'/'+_0x3985ee)[_0xd68b('0x1e')](_0x19ce67);}return null;};}function patchUpdates(_0x5a0a3d){return function(_0x5597fa){try{jsonpatch[_0xd68b('0x23')](_0x5597fa,_0x5a0a3d,!![]);}catch(_0xbe70b6){return BPromise[_0xd68b('0x24')](_0xbe70b6);}return _0x5597fa[_0xd68b('0x25')]();};}function saveUpdates(_0x988a,_0x423c40){return function(_0x36d7d7){if(_0x36d7d7){return _0x36d7d7[_0xd68b('0x26')](_0x988a)[_0xd68b('0x27')](function(_0x2e05ba){return _0x2e05ba;});}return null;};}function removeEntity(_0x2f1f8e,_0x4aa663){return function(_0x38b454){if(_0x38b454){return _0x38b454['destroy']()[_0xd68b('0x27')](function(){_0x2f1f8e[_0xd68b('0x1c')](0xcc)[_0xd68b('0x1d')]();});}};}function handleEntityNotFound(_0x4fad0c,_0x2dadf1){return function(_0x48bbbe){if(!_0x48bbbe){_0x4fad0c[_0xd68b('0x1b')](0x194);}return _0x48bbbe;};}function handleError(_0x45ac54,_0x34ad49){_0x34ad49=_0x34ad49||0x1f4;return function(_0x39a2a0){logger[_0xd68b('0x28')](_0x39a2a0[_0xd68b('0x29')]);if(_0x39a2a0[_0xd68b('0x2a')]){delete _0x39a2a0[_0xd68b('0x2a')];}_0x45ac54['status'](_0x34ad49)[_0xd68b('0x2b')](_0x39a2a0);};}exports[_0xd68b('0x2c')]=function(_0x561636,_0x317ad5){var _0x1b6327={},_0x39996e={},_0xca5762={'count':0x0,'rows':[]};var _0x59fe4e=_['map'](db['SalesforceAccount'][_0xd68b('0x2d')],function(_0x2c96cf){return{'name':_0x2c96cf['fieldName'],'type':_0x2c96cf['type'][_0xd68b('0x2e')]};});_0x39996e[_0xd68b('0x2f')]=_['map'](_0x59fe4e,'name');_0x39996e['query']=_[_0xd68b('0x30')](_0x561636[_0xd68b('0x31')]);_0x39996e['filters']=_['intersection'](_0x39996e[_0xd68b('0x2f')],_0x39996e[_0xd68b('0x31')]);_0x1b6327[_0xd68b('0x32')]=_[_0xd68b('0x33')](_0x39996e[_0xd68b('0x2f')],qs['fields'](_0x561636[_0xd68b('0x31')][_0xd68b('0x34')]));_0x1b6327[_0xd68b('0x32')]=_0x1b6327[_0xd68b('0x32')][_0xd68b('0x35')]?_0x1b6327[_0xd68b('0x32')]:_0x39996e[_0xd68b('0x2f')];if(!_0x561636[_0xd68b('0x31')][_0xd68b('0x36')](_0xd68b('0x37'))){_0x1b6327[_0xd68b('0x38')]=qs[_0xd68b('0x38')](_0x561636[_0xd68b('0x31')][_0xd68b('0x38')]);_0x1b6327[_0xd68b('0x39')]=qs['offset'](_0x561636['query'][_0xd68b('0x39')]);}_0x1b6327[_0xd68b('0x3a')]=qs['sort'](_0x561636[_0xd68b('0x31')][_0xd68b('0x3b')]);_0x1b6327[_0xd68b('0x3c')]=qs['filters'](_[_0xd68b('0x3d')](_0x561636['query'],_0x39996e[_0xd68b('0x3e')]),_0x59fe4e);if(_0x561636[_0xd68b('0x31')][_0xd68b('0x3f')]){_0x1b6327[_0xd68b('0x3c')]=_['merge'](_0x1b6327[_0xd68b('0x3c')],{'$or':_[_0xd68b('0x40')](_0x59fe4e,function(_0x16119d){if(_0x16119d[_0xd68b('0x41')]!==_0xd68b('0x42')){var _0x39ff16={};_0x39ff16[_0x16119d['name']]={'$like':'%'+_0x561636[_0xd68b('0x31')][_0xd68b('0x3f')]+'%'};return _0x39ff16;}})});}_0x1b6327=_[_0xd68b('0x43')]({},_0x1b6327,_0x561636[_0xd68b('0x44')]);var _0x7fee5a={'where':_0x1b6327[_0xd68b('0x3c')]};return db['SalesforceAccount'][_0xd68b('0x20')](_0x7fee5a)[_0xd68b('0x27')](function(_0xeb0ffb){_0xca5762['count']=_0xeb0ffb;if(_0x561636[_0xd68b('0x31')]['includeAll']){_0x1b6327[_0xd68b('0x45')]=[{'all':!![]}];}return db[_0xd68b('0x46')][_0xd68b('0x47')](_0x1b6327);})['then'](function(_0x2b5ea){_0xca5762[_0xd68b('0x48')]=_0x2b5ea;return _0xca5762;})[_0xd68b('0x27')](respondWithFilteredResult(_0x317ad5,_0x1b6327))[_0xd68b('0x49')](handleError(_0x317ad5,null));};exports['show']=function(_0x12182c,_0x2e4e36){var _0x33b9e3={'raw':![],'where':{'id':_0x12182c['params']['id']}},_0x5deac4={};_0x5deac4[_0xd68b('0x2f')]=_[_0xd68b('0x30')](db[_0xd68b('0x46')]['rawAttributes']);_0x5deac4[_0xd68b('0x31')]=_[_0xd68b('0x30')](_0x12182c['query']);_0x5deac4[_0xd68b('0x3e')]=_['intersection'](_0x5deac4[_0xd68b('0x2f')],_0x5deac4['query']);_0x33b9e3[_0xd68b('0x32')]=_['intersection'](_0x5deac4[_0xd68b('0x2f')],qs['fields'](_0x12182c['query'][_0xd68b('0x34')]));_0x33b9e3[_0xd68b('0x32')]=_0x33b9e3[_0xd68b('0x32')]['length']?_0x33b9e3[_0xd68b('0x32')]:_0x5deac4[_0xd68b('0x2f')];if(_0x12182c[_0xd68b('0x31')][_0xd68b('0x4a')]){_0x33b9e3[_0xd68b('0x45')]=[{'all':!![]}];}_0x33b9e3=_[_0xd68b('0x43')]({},_0x33b9e3,_0x12182c[_0xd68b('0x44')]);return db[_0xd68b('0x46')][_0xd68b('0x4b')](_0x33b9e3)[_0xd68b('0x27')](handleEntityNotFound(_0x2e4e36,null))[_0xd68b('0x27')](respondWithResult(_0x2e4e36,null))[_0xd68b('0x49')](handleError(_0x2e4e36,null));};exports[_0xd68b('0x4c')]=function(_0x481d46,_0x2cfb5a){return db[_0xd68b('0x46')][_0xd68b('0x4c')](_0x481d46[_0xd68b('0x4d')],{})[_0xd68b('0x27')](respondWithResult(_0x2cfb5a,0xc9))['catch'](handleError(_0x2cfb5a,null));};exports[_0xd68b('0x26')]=function(_0x534f39,_0x35a736){if(_0x534f39['body']['id']){delete _0x534f39['body']['id'];}return db[_0xd68b('0x46')][_0xd68b('0x4b')]({'where':{'id':_0x534f39[_0xd68b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x35a736,null))['then'](saveUpdates(_0x534f39[_0xd68b('0x4d')],null))[_0xd68b('0x27')](respondWithResult(_0x35a736,null))[_0xd68b('0x49')](handleError(_0x35a736,null));};exports[_0xd68b('0x4f')]=function(_0x4c565f,_0x3cc051){return db[_0xd68b('0x46')][_0xd68b('0x4b')]({'where':{'id':_0x4c565f[_0xd68b('0x4e')]['id']}})[_0xd68b('0x27')](handleEntityNotFound(_0x3cc051,null))[_0xd68b('0x27')](removeEntity(_0x3cc051,null))[_0xd68b('0x49')](handleError(_0x3cc051,null));};exports['getConfigurations']=function(_0x2933df,_0x68a6cc,_0x46ec0e){var _0x3f0b79={};var _0x44a6d1={};var _0x4e30f2;var _0x2d2791;return db[_0xd68b('0x46')][_0xd68b('0x50')]({'where':{'id':_0x2933df['params']['id']}})[_0xd68b('0x27')](handleEntityNotFound(_0x68a6cc,null))[_0xd68b('0x27')](function(_0x19affb){if(_0x19affb){_0x4e30f2=_0x19affb;_0x44a6d1[_0xd68b('0x2f')]=_['keys'](db[_0xd68b('0x51')][_0xd68b('0x2d')]);_0x44a6d1[_0xd68b('0x31')]=_[_0xd68b('0x30')](_0x2933df[_0xd68b('0x31')]);_0x44a6d1['filters']=_['intersection'](_0x44a6d1[_0xd68b('0x2f')],_0x44a6d1[_0xd68b('0x31')]);_0x3f0b79[_0xd68b('0x32')]=_['intersection'](_0x44a6d1[_0xd68b('0x2f')],qs[_0xd68b('0x34')](_0x2933df[_0xd68b('0x31')]['fields']));_0x3f0b79['attributes']=_0x3f0b79[_0xd68b('0x32')][_0xd68b('0x35')]?_0x3f0b79['attributes']:_0x44a6d1[_0xd68b('0x2f')];_0x3f0b79['order']=qs[_0xd68b('0x3b')](_0x2933df['query'][_0xd68b('0x3b')]);_0x3f0b79['where']=qs['filters'](_[_0xd68b('0x3d')](_0x2933df[_0xd68b('0x31')],_0x44a6d1[_0xd68b('0x3e')]));if(_0x2933df[_0xd68b('0x31')][_0xd68b('0x3f')]){_0x3f0b79[_0xd68b('0x3c')]=_[_0xd68b('0x43')](_0x3f0b79[_0xd68b('0x3c')],{'$or':_[_0xd68b('0x40')](_0x3f0b79[_0xd68b('0x32')],function(_0x441f8f){var _0x5b6c1a={};_0x5b6c1a[_0x441f8f]={'$like':'%'+_0x2933df[_0xd68b('0x31')][_0xd68b('0x3f')]+'%'};return _0x5b6c1a;})});}_0x3f0b79=_[_0xd68b('0x43')]({},_0x3f0b79,_0x2933df[_0xd68b('0x44')]);return _0x4e30f2['getConfigurations'](_0x3f0b79);}})['then'](function(_0xea40f0){if(_0xea40f0){_0x2d2791=_0xea40f0[_0xd68b('0x35')];if(!_0x2933df[_0xd68b('0x31')][_0xd68b('0x36')](_0xd68b('0x37'))){_0x3f0b79['limit']=qs[_0xd68b('0x38')](_0x2933df[_0xd68b('0x31')]['limit']);_0x3f0b79['offset']=qs[_0xd68b('0x39')](_0x2933df[_0xd68b('0x31')][_0xd68b('0x39')]);}return _0x4e30f2['getConfigurations'](_0x3f0b79);}})[_0xd68b('0x27')](function(_0x5631d0){if(_0x5631d0){return _0x5631d0?{'count':_0x2d2791,'rows':_0x5631d0}:null;}})['then'](respondWithResult(_0x68a6cc,null))['catch'](handleError(_0x68a6cc,null));};exports[_0xd68b('0x52')]=function(_0x2c25ee,_0x45ba38,_0x6faebf){if(_0x2c25ee[_0xd68b('0x4d')]['id']){delete _0x2c25ee[_0xd68b('0x4d')]['id'];}return db['SalesforceAccount'][_0xd68b('0x50')]({'where':{'id':_0x2c25ee['params']['id']}})[_0xd68b('0x27')](handleEntityNotFound(_0x45ba38,null))[_0xd68b('0x27')](function(_0xac655f){if(_0xac655f){_0x2c25ee[_0xd68b('0x4d')][_0xd68b('0x53')]=_0xac655f['id'];_0x2c25ee[_0xd68b('0x4d')][_0xd68b('0x54')]=integrations[_0xd68b('0x55')](_0x2c25ee[_0xd68b('0x4d')][_0xd68b('0x56')],_0x2c25ee['body']['type']);_0x2c25ee['body'][_0xd68b('0x57')]=integrations[_0xd68b('0x58')](_0x2c25ee['body']['channel'],_0x2c25ee[_0xd68b('0x4d')][_0xd68b('0x41')]);return db[_0xd68b('0x51')][_0xd68b('0x4c')](_0x2c25ee['body'],{'include':[{'model':db[_0xd68b('0x59')],'as':'Subjects'},{'model':db[_0xd68b('0x59')],'as':_0xd68b('0x57')}]});}return null;})[_0xd68b('0x27')](respondWithResult(_0x45ba38,null))[_0xd68b('0x49')](handleError(_0x45ba38,null));};exports['getFields']=function(_0x3ff60c,_0x280d41,_0x616cfe){var _0x2b48e9;var _0x2c0ea='';var _0x3c3864=_0xd68b('0x5a');return db[_0xd68b('0x46')][_0xd68b('0x50')]({'where':{'id':_0x3ff60c[_0xd68b('0x4e')]['id']},'attributes':['id',_0xd68b('0x5b'),_0xd68b('0x5c'),_0xd68b('0x5d'),_0xd68b('0x5e'),'password',_0xd68b('0x5f')]})[_0xd68b('0x27')](handleEntityNotFound(_0x280d41,null))['then'](function(_0x2c96ca){if(_0x2c96ca){_0x2c0ea=_0x2c96ca['remoteUri'];var _0x4ac663=_0x2c0ea[_0xd68b('0x60')](-0x1);if(_0x4ac663==='/'){_0x2c0ea=_0x2c0ea[_0xd68b('0x61')](0x0,_0x2c0ea['lastIndexOf'](_0x4ac663));}_0x2b48e9=new jsforce[(_0xd68b('0x62'))]({'oauth2':{'loginUrl':_0x2c0ea,'clientId':_0x2c96ca[_0xd68b('0x5c')],'clientSecret':_0x2c96ca['clientSecret']}});return _0x2b48e9[_0xd68b('0x63')](_0x2c96ca[_0xd68b('0x5e')],_0x2c96ca[_0xd68b('0x64')][_0xd68b('0x65')](_0x2c96ca[_0xd68b('0x5f')]));}})['then'](function(_0x4b71a4){if(_0x4b71a4){if(!_[_0xd68b('0x66')](_0x3ff60c[_0xd68b('0x31')]['ticketType'])){_0x3c3864=_0x3ff60c['query'][_0xd68b('0x67')];}return _0x2b48e9['sobject'](_0x3c3864)[_0xd68b('0x68')]();}})[_0xd68b('0x27')](function(_0x1a6998){var _0x1c98ad=[_0xd68b('0x69'),'ActivityDate',_0xd68b('0x6a'),'IsRecurrence',_0xd68b('0x6b'),_0xd68b('0x6c')];var _0x46d3da=[_0xd68b('0x6d'),'int',_0xd68b('0x6e'),_0xd68b('0x6f'),_0xd68b('0x70'),_0xd68b('0x71'),_0xd68b('0x72')];if(_0x1a6998){_[_0xd68b('0x73')](_0x1a6998['fields'],function(_0x3b18d7){return _0x1c98ad[_0xd68b('0x74')](_0x3b18d7[_0xd68b('0x2a')])||!_0x46d3da[_0xd68b('0x74')](_0x3b18d7[_0xd68b('0x41')]);});return{'count':_0x1a6998[_0xd68b('0x34')][_0xd68b('0x35')],'rows':_[_0xd68b('0x40')](_0x1a6998['fields'],function(_0x4cba3c){return{'id':_0x4cba3c[_0xd68b('0x2a')],'name':_0x4cba3c[_0xd68b('0x75')],'custom':_0x4cba3c[_0xd68b('0x76')],'options':_0x4cba3c['picklistValues'][_0xd68b('0x35')]>0x0?_[_0xd68b('0x40')](_0x4cba3c[_0xd68b('0x77')],function(_0x133206){return{'name':_0x133206[_0xd68b('0x75')],'value':_0x133206[_0xd68b('0x78')]};}):_0x4cba3c[_0xd68b('0x41')]==_0xd68b('0x6f')?[{'name':'True','value':'true'},{'name':_0xd68b('0x79'),'value':_0xd68b('0x7a')}]:[]};})};}})[_0xd68b('0x27')](respondWithResult(_0x280d41,null))[_0xd68b('0x49')](function(_0x5da8ae){var _0x73c0ef=_0x3ff60c[_0xd68b('0x31')][_0xd68b('0x7b')]?0x1f4:_0x5da8ae[_0xd68b('0x7c')]||0x1f4;logger[_0xd68b('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x73c0ef,JSON['stringify'](_0x5da8ae));delete _0x5da8ae[_0xd68b('0x2a')];if(_0x73c0ef===0x191){_0x73c0ef=0x190;}_0x280d41[_0xd68b('0x1c')](_0x73c0ef)[_0xd68b('0x2b')](_0x3ff60c[_0xd68b('0x31')][_0xd68b('0x7b')]?{'message':_0xd68b('0x7d'),'statusCode':_0x5da8ae[_0xd68b('0x7c')]}:_0x5da8ae);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 5b3fd20..177bdca 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 _0x0bba=['api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger'];(function(_0x3108d9,_0xf08d6){var _0x1455e6=function(_0xfd5906){while(--_0xfd5906){_0x3108d9['push'](_0x3108d9['shift']());}};_0x1455e6(++_0xf08d6);}(_0x0bba,0x143));var _0xa0bb=function(_0x11d8e2,_0x10dea6){_0x11d8e2=_0x11d8e2-0x0;var _0x518a01=_0x0bba[_0x11d8e2];return _0x518a01;};'use strict';var _=require('lodash');var util=require(_0xa0bb('0x0'));var logger=require(_0xa0bb('0x1'))(_0xa0bb('0x2'));var moment=require(_0xa0bb('0x3'));var BPromise=require('bluebird');var rp=require(_0xa0bb('0x4'));var fs=require('fs');var path=require(_0xa0bb('0x5'));var rimraf=require(_0xa0bb('0x6'));var config=require(_0xa0bb('0x7'));var attributes=require(_0xa0bb('0x8'));var integrations=require(_0xa0bb('0x9'));module['exports']=function(_0x3e7459,_0x18461e){return _0x3e7459[_0xa0bb('0xa')](_0xa0bb('0xb'),attributes,{'tableName':_0xa0bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe927=['moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger'];(function(_0x3a91c5,_0x1dfb88){var _0x330796=function(_0x30db05){while(--_0x30db05){_0x3a91c5['push'](_0x3a91c5['shift']());}};_0x330796(++_0x1dfb88);}(_0xe927,0x141));var _0x7e92=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0xe927[_0x566168];return _0x4e1f7a;};'use strict';var _=require(_0x7e92('0x0'));var util=require(_0x7e92('0x1'));var logger=require(_0x7e92('0x2'))('api');var moment=require(_0x7e92('0x3'));var BPromise=require(_0x7e92('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e92('0x5'));var rimraf=require(_0x7e92('0x6'));var config=require(_0x7e92('0x7'));var attributes=require(_0x7e92('0x8'));var integrations=require(_0x7e92('0x9'));module[_0x7e92('0xa')]=function(_0x573663,_0x66929a){return _0x573663[_0x7e92('0xb')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 37ffd4b..9efc8c1 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 _0x7d1e=['stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x7d1e,0x111));var _0xe7d1=function(_0x2d284c,_0x59aa64){_0x2d284c=_0x2d284c-0x0;var _0x4f5756=_0x7d1e[_0x2d284c];return _0x4f5756;};'use strict';var _=require(_0xe7d1('0x0'));var util=require(_0xe7d1('0x1'));var moment=require(_0xe7d1('0x2'));var BPromise=require(_0xe7d1('0x3'));var rs=require(_0xe7d1('0x4'));var fs=require('fs');var Redis=require(_0xe7d1('0x5'));var db=require(_0xe7d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7d1('0x7'))('rpc');var config=require(_0xe7d1('0x8'));var jayson=require(_0xe7d1('0x9'));var client=jayson[_0xe7d1('0xa')][_0xe7d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x357569,_0x2bbaa5,_0x2cadc8){return new BPromise(function(_0x3dabfb,_0x3c2a33){return client['request'](_0x357569,_0x2cadc8)[_0xe7d1('0xc')](function(_0x4b66bf){logger['info'](_0xe7d1('0xd'),_0x2bbaa5,'request\x20sent');logger['debug'](_0xe7d1('0xe'),_0x2bbaa5,'request\x20sent',JSON[_0xe7d1('0xf')](_0x4b66bf));if(_0x4b66bf['error']){if(_0x4b66bf[_0xe7d1('0x10')][_0xe7d1('0x11')]===0x1f4){logger[_0xe7d1('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x2bbaa5,_0x4b66bf[_0xe7d1('0x10')]['message']);return _0x3c2a33(_0x4b66bf['error'][_0xe7d1('0x12')]);}logger[_0xe7d1('0x10')](_0xe7d1('0xd'),_0x2bbaa5,_0x4b66bf[_0xe7d1('0x10')]['message']);return _0x3dabfb(_0x4b66bf[_0xe7d1('0x10')][_0xe7d1('0x12')]);}else{logger[_0xe7d1('0x13')](_0xe7d1('0xd'),_0x2bbaa5,'request\x20sent');_0x3dabfb(_0x4b66bf[_0xe7d1('0x14')]['message']);}})[_0xe7d1('0x15')](function(_0x1a8916){logger[_0xe7d1('0x10')](_0xe7d1('0xd'),_0x2bbaa5,_0x1a8916);_0x3c2a33(_0x1a8916);});});}exports[_0xe7d1('0x16')]=function(_0xa819f3){var _0x3a1f98=this;return new Promise(function(_0x5d859d,_0x30cf55){return db[_0xe7d1('0x17')][_0xe7d1('0x18')]({'raw':_0xa819f3[_0xe7d1('0x19')]?_0xa819f3[_0xe7d1('0x19')][_0xe7d1('0x1a')]===undefined?!![]:![]:!![],'where':_0xa819f3[_0xe7d1('0x19')]?_0xa819f3['options'][_0xe7d1('0x1b')]||null:null,'attributes':_0xa819f3[_0xe7d1('0x19')]?_0xa819f3[_0xe7d1('0x19')][_0xe7d1('0x1c')]||null:null,'limit':_0xa819f3['options']?_0xa819f3[_0xe7d1('0x19')][_0xe7d1('0x1d')]||null:null,'include':_0xa819f3['options']?_0xa819f3['options'][_0xe7d1('0x1e')]?_[_0xe7d1('0x1f')](_0xa819f3['options'][_0xe7d1('0x1e')],function(_0x38de5a){return{'model':db[_0x38de5a['model']],'as':_0x38de5a['as'],'attributes':_0x38de5a['attributes'],'include':_0x38de5a[_0xe7d1('0x1e')]?_[_0xe7d1('0x1f')](_0x38de5a[_0xe7d1('0x1e')],function(_0x13e9e3){return{'model':db[_0x13e9e3[_0xe7d1('0x20')]],'as':_0x13e9e3['as'],'attributes':_0x13e9e3[_0xe7d1('0x1c')],'include':_0x13e9e3['include']?_[_0xe7d1('0x1f')](_0x13e9e3[_0xe7d1('0x1e')],function(_0x39c2dd){return{'model':db[_0x39c2dd[_0xe7d1('0x20')]],'as':_0x39c2dd['as'],'attributes':_0x39c2dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xe7d1('0xc')](function(_0x5d88b6){logger['info']('GetSalesforceAccount',_0xa819f3);logger[_0xe7d1('0x21')](_0xe7d1('0x16'),_0xa819f3,JSON[_0xe7d1('0xf')](_0x5d88b6));_0x5d859d(_0x5d88b6);})[_0xe7d1('0x15')](function(_0x3b33fa){logger[_0xe7d1('0x10')](_0xe7d1('0x16'),_0x3b33fa[_0xe7d1('0x12')],_0xa819f3);_0x30cf55(_0x3a1f98[_0xe7d1('0x10')](0x1f4,_0x3b33fa[_0xe7d1('0x12')]));});});};exports[_0xe7d1('0x22')]=function(_0x1764a4){var _0x52cda1=this;return new Promise(function(_0x589c68,_0x334dcc){return db[_0xe7d1('0x17')][_0xe7d1('0x23')]({'raw':_0x1764a4[_0xe7d1('0x19')]?_0x1764a4[_0xe7d1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1764a4['options']?_0x1764a4[_0xe7d1('0x19')][_0xe7d1('0x1b')]||null:null,'attributes':_0x1764a4[_0xe7d1('0x19')]?_0x1764a4[_0xe7d1('0x19')]['attributes']||null:null,'include':_0x1764a4[_0xe7d1('0x19')]?_0x1764a4['options'][_0xe7d1('0x1e')]?_[_0xe7d1('0x1f')](_0x1764a4[_0xe7d1('0x19')]['include'],function(_0x23fa23){return{'model':db[_0x23fa23[_0xe7d1('0x20')]],'as':_0x23fa23['as'],'attributes':_0x23fa23[_0xe7d1('0x1c')],'include':_0x23fa23[_0xe7d1('0x1e')]?_[_0xe7d1('0x1f')](_0x23fa23[_0xe7d1('0x1e')],function(_0x2e488b){return{'model':db[_0x2e488b['model']],'as':_0x2e488b['as'],'attributes':_0x2e488b[_0xe7d1('0x1c')],'include':_0x2e488b[_0xe7d1('0x1e')]?_[_0xe7d1('0x1f')](_0x2e488b['include'],function(_0xf4cc4e){return{'model':db[_0xf4cc4e['model']],'as':_0xf4cc4e['as'],'attributes':_0xf4cc4e[_0xe7d1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7d1('0xc')](function(_0x57d434){logger[_0xe7d1('0x13')](_0xe7d1('0x22'),_0x1764a4);logger[_0xe7d1('0x21')](_0xe7d1('0x22'),_0x1764a4,JSON[_0xe7d1('0xf')](_0x57d434));_0x589c68(_0x57d434);})[_0xe7d1('0x15')](function(_0x311308){logger['error'](_0xe7d1('0x22'),_0x311308[_0xe7d1('0x12')],_0x1764a4);_0x334dcc(_0x52cda1['error'](0x1f4,_0x311308[_0xe7d1('0x12')]));});});}; \ No newline at end of file +var _0x4f1d=['limit','include','model','map','ShowSalesforceAccount','SalesforceAccount','find','lodash','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','attributes'];(function(_0x516ab8,_0x4e1c3a){var _0xa28058=function(_0x916b2e){while(--_0x916b2e){_0x516ab8['push'](_0x516ab8['shift']());}};_0xa28058(++_0x4e1c3a);}(_0x4f1d,0xf7));var _0xd4f1=function(_0x2e7087,_0x112eec){_0x2e7087=_0x2e7087-0x0;var _0xb5b3a6=_0x4f1d[_0x2e7087];return _0xb5b3a6;};'use strict';var _=require(_0xd4f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4f1('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4f1('0x2'))(_0xd4f1('0x3'));var config=require('../../config/environment');var jayson=require(_0xd4f1('0x4'));var client=jayson[_0xd4f1('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e620f,_0x4d2fc2,_0x1ac770){return new BPromise(function(_0x3ed8bf,_0x270f5e){return client[_0xd4f1('0x6')](_0x1e620f,_0x1ac770)[_0xd4f1('0x7')](function(_0x4ddf3){logger[_0xd4f1('0x8')](_0xd4f1('0x9'),_0x4d2fc2,_0xd4f1('0xa'));logger[_0xd4f1('0xb')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4d2fc2,_0xd4f1('0xa'),JSON[_0xd4f1('0xc')](_0x4ddf3));if(_0x4ddf3[_0xd4f1('0xd')]){if(_0x4ddf3[_0xd4f1('0xd')]['code']===0x1f4){logger['error'](_0xd4f1('0x9'),_0x4d2fc2,_0x4ddf3[_0xd4f1('0xd')]['message']);return _0x270f5e(_0x4ddf3[_0xd4f1('0xd')][_0xd4f1('0xe')]);}logger[_0xd4f1('0xd')](_0xd4f1('0x9'),_0x4d2fc2,_0x4ddf3[_0xd4f1('0xd')][_0xd4f1('0xe')]);return _0x3ed8bf(_0x4ddf3['error'][_0xd4f1('0xe')]);}else{logger[_0xd4f1('0x8')](_0xd4f1('0x9'),_0x4d2fc2,'request\x20sent');_0x3ed8bf(_0x4ddf3[_0xd4f1('0xf')][_0xd4f1('0xe')]);}})[_0xd4f1('0x10')](function(_0x28a59a){logger[_0xd4f1('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x4d2fc2,_0x28a59a);_0x270f5e(_0x28a59a);});});}exports[_0xd4f1('0x11')]=function(_0x8a6fa9){var _0x2e37b8=this;return new Promise(function(_0x3793cb,_0x14fadf){return db['SalesforceAccount'][_0xd4f1('0x12')]({'raw':_0x8a6fa9[_0xd4f1('0x13')]?_0x8a6fa9[_0xd4f1('0x13')][_0xd4f1('0x14')]===undefined?!![]:![]:!![],'where':_0x8a6fa9['options']?_0x8a6fa9[_0xd4f1('0x13')][_0xd4f1('0x15')]||null:null,'attributes':_0x8a6fa9[_0xd4f1('0x13')]?_0x8a6fa9[_0xd4f1('0x13')][_0xd4f1('0x16')]||null:null,'limit':_0x8a6fa9[_0xd4f1('0x13')]?_0x8a6fa9['options'][_0xd4f1('0x17')]||null:null,'include':_0x8a6fa9[_0xd4f1('0x13')]?_0x8a6fa9[_0xd4f1('0x13')][_0xd4f1('0x18')]?_['map'](_0x8a6fa9['options']['include'],function(_0x3b31bd){return{'model':db[_0x3b31bd[_0xd4f1('0x19')]],'as':_0x3b31bd['as'],'attributes':_0x3b31bd['attributes'],'include':_0x3b31bd['include']?_[_0xd4f1('0x1a')](_0x3b31bd[_0xd4f1('0x18')],function(_0x20fa52){return{'model':db[_0x20fa52[_0xd4f1('0x19')]],'as':_0x20fa52['as'],'attributes':_0x20fa52[_0xd4f1('0x16')],'include':_0x20fa52[_0xd4f1('0x18')]?_[_0xd4f1('0x1a')](_0x20fa52[_0xd4f1('0x18')],function(_0x3984de){return{'model':db[_0x3984de[_0xd4f1('0x19')]],'as':_0x3984de['as'],'attributes':_0x3984de[_0xd4f1('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd4f1('0x7')](function(_0x349552){logger[_0xd4f1('0x8')]('GetSalesforceAccount',_0x8a6fa9);logger[_0xd4f1('0xb')](_0xd4f1('0x11'),_0x8a6fa9,JSON[_0xd4f1('0xc')](_0x349552));_0x3793cb(_0x349552);})[_0xd4f1('0x10')](function(_0x59d771){logger[_0xd4f1('0xd')](_0xd4f1('0x11'),_0x59d771['message'],_0x8a6fa9);_0x14fadf(_0x2e37b8[_0xd4f1('0xd')](0x1f4,_0x59d771['message']));});});};exports[_0xd4f1('0x1b')]=function(_0x5f369e){var _0x1e1e80=this;return new Promise(function(_0x184eb4,_0x4e8a32){return db[_0xd4f1('0x1c')][_0xd4f1('0x1d')]({'raw':_0x5f369e[_0xd4f1('0x13')]?_0x5f369e[_0xd4f1('0x13')][_0xd4f1('0x14')]===undefined?!![]:![]:!![],'where':_0x5f369e[_0xd4f1('0x13')]?_0x5f369e[_0xd4f1('0x13')][_0xd4f1('0x15')]||null:null,'attributes':_0x5f369e['options']?_0x5f369e[_0xd4f1('0x13')][_0xd4f1('0x16')]||null:null,'include':_0x5f369e[_0xd4f1('0x13')]?_0x5f369e[_0xd4f1('0x13')][_0xd4f1('0x18')]?_[_0xd4f1('0x1a')](_0x5f369e[_0xd4f1('0x13')]['include'],function(_0x56464c){return{'model':db[_0x56464c[_0xd4f1('0x19')]],'as':_0x56464c['as'],'attributes':_0x56464c[_0xd4f1('0x16')],'include':_0x56464c['include']?_[_0xd4f1('0x1a')](_0x56464c['include'],function(_0x1bfcb8){return{'model':db[_0x1bfcb8[_0xd4f1('0x19')]],'as':_0x1bfcb8['as'],'attributes':_0x1bfcb8[_0xd4f1('0x16')],'include':_0x1bfcb8[_0xd4f1('0x18')]?_[_0xd4f1('0x1a')](_0x1bfcb8[_0xd4f1('0x18')],function(_0x13e9dc){return{'model':db[_0x13e9dc[_0xd4f1('0x19')]],'as':_0x13e9dc['as'],'attributes':_0x13e9dc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cf335){logger[_0xd4f1('0x8')](_0xd4f1('0x1b'),_0x5f369e);logger[_0xd4f1('0xb')](_0xd4f1('0x1b'),_0x5f369e,JSON[_0xd4f1('0xc')](_0x4cf335));_0x184eb4(_0x4cf335);})[_0xd4f1('0x10')](function(_0x1f9767){logger['error'](_0xd4f1('0x1b'),_0x1f9767[_0xd4f1('0xe')],_0x5f369e);_0x4e8a32(_0x1e1e80[_0xd4f1('0xd')](0x1f4,_0x1f9767[_0xd4f1('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f36fe0d..1796a2b 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x281839,_0x6fed41){var _0x254f8b=function(_0x2651e5){while(--_0x2651e5){_0x281839['push'](_0x281839['shift']());}};_0x254f8b(++_0x6fed41);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _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(_0x40e9ab,_0x46a376){var _0x4b6cec=function(_0x46b06d){while(--_0x46b06d){_0x40e9ab['push'](_0x40e9ab['shift']());}};_0x4b6cec(++_0x46a376);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3affbc,_0x1cfae3){_0x3affbc=_0x3affbc-0x0;var _0x3420e4=_0x5f2f[_0x3affbc];return _0x3420e4;};'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 8ac8852..28d94a4 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 _0x5b0d=['STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead','account','nothing','contact','sequelize','exports'];(function(_0x417c2b,_0x597c50){var _0x846a49=function(_0x3c5725){while(--_0x3c5725){_0x417c2b['push'](_0x417c2b['shift']());}};_0x846a49(++_0x597c50);}(_0x5b0d,0x172));var _0xd5b0=function(_0x2f3a72,_0x24fcc2){_0x2f3a72=_0x2f3a72-0x0;var _0x13f974=_0x5b0d[_0x2f3a72];return _0x13f974;};'use strict';var Sequelize=require(_0xd5b0('0x0'));module[_0xd5b0('0x1')]={'name':{'type':Sequelize[_0xd5b0('0x2')]},'description':{'type':Sequelize[_0xd5b0('0x2')]},'ticketType':{'type':Sequelize[_0xd5b0('0x3')](_0xd5b0('0x4'),_0xd5b0('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xd5b0('0x3')](_0xd5b0('0x6'),'contact',_0xd5b0('0x7'),_0xd5b0('0x8'),_0xd5b0('0x9')),'defaultValue':_0xd5b0('0x6')},'moduleCreate':{'type':Sequelize[_0xd5b0('0x3')](_0xd5b0('0xa'),_0xd5b0('0xb'),_0xd5b0('0x7'),'account'),'defaultValue':_0xd5b0('0x7')},'leadId':{'type':Sequelize[_0xd5b0('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xd5b0('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xd5b0('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xd5b0('0x2')]}}; \ No newline at end of file +var _0xa5c2=['nothing','contact','lead','sequelize','STRING','ENUM','Task','Case','contact_lead','account_contact_lead','account'];(function(_0x56b697,_0x2b127c){var _0x883bd5=function(_0x517b3f){while(--_0x517b3f){_0x56b697['push'](_0x56b697['shift']());}};_0x883bd5(++_0x2b127c);}(_0xa5c2,0x1a5));var _0x2a5c=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0xa5c2[_0x372515];return _0xa3bf4e;};'use strict';var Sequelize=require(_0x2a5c('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a5c('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2a5c('0x2')](_0x2a5c('0x3'),_0x2a5c('0x4')),'defaultValue':_0x2a5c('0x3')},'moduleSearch':{'type':Sequelize[_0x2a5c('0x2')](_0x2a5c('0x5'),'contact','lead',_0x2a5c('0x6'),_0x2a5c('0x7')),'defaultValue':_0x2a5c('0x5')},'moduleCreate':{'type':Sequelize[_0x2a5c('0x2')](_0x2a5c('0x8'),_0x2a5c('0x9'),_0x2a5c('0xa'),_0x2a5c('0x7')),'defaultValue':_0x2a5c('0xa')},'leadId':{'type':Sequelize[_0x2a5c('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x2a5c('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x2a5c('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x2a5c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 71f0fc0..4d81ad6 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 _0x5977=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','reject','save','destroy','then','end','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','catch','show','merge','find','create','body','params','getFields','findOne','order','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0x5977,0xe1));var _0x7597=function(_0x2a848a,_0x307cdf){_0x2a848a=_0x2a848a-0x0;var _0x4b2981=_0x5977[_0x2a848a];return _0x4b2981;};'use strict';var emlformat=require(_0x7597('0x0'));var rimraf=require(_0x7597('0x1'));var zipdir=require(_0x7597('0x2'));var jsonpatch=require(_0x7597('0x3'));var rp=require('request-promise');var moment=require(_0x7597('0x4'));var BPromise=require(_0x7597('0x5'));var Mustache=require(_0x7597('0x6'));var util=require('util');var path=require(_0x7597('0x7'));var sox=require(_0x7597('0x8'));var csv=require(_0x7597('0x9'));var ejs=require(_0x7597('0xa'));var fs=require('fs');var fs_extra=require(_0x7597('0xb'));var _=require(_0x7597('0xc'));var squel=require(_0x7597('0xd'));var crypto=require(_0x7597('0xe'));var jsforce=require(_0x7597('0xf'));var deskjs=require(_0x7597('0x10'));var toCsv=require(_0x7597('0x9'));var querystring=require('querystring');var Papa=require(_0x7597('0x11'));var Redis=require(_0x7597('0x12'));var authService=require(_0x7597('0x13'));var qs=require(_0x7597('0x14'));var as=require(_0x7597('0x15'));var hardwareService=require(_0x7597('0x16'));var logger=require(_0x7597('0x17'))(_0x7597('0x18'));var utils=require(_0x7597('0x19'));var config=require(_0x7597('0x1a'));var licenseUtil=require(_0x7597('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x431724,_0x15b072){_0x15b072=_0x15b072||0xcc;return function(_0x2cfc09){if(_0x2cfc09){return _0x431724[_0x7597('0x1c')](_0x15b072);}return _0x431724[_0x7597('0x1d')](_0x15b072)['end']();};}function respondWithResult(_0x291978,_0x4efc9f){_0x4efc9f=_0x4efc9f||0xc8;return function(_0x4c6cc4){if(_0x4c6cc4){return _0x291978[_0x7597('0x1d')](_0x4efc9f)[_0x7597('0x1e')](_0x4c6cc4);}};}function respondWithFilteredResult(_0x387173,_0xea93e0){return function(_0xec7ea9){if(_0xec7ea9){var _0x3ca8da=typeof _0xea93e0[_0x7597('0x1f')]===_0x7597('0x20')&&typeof _0xea93e0['limit']==='undefined';var _0x24be0d=_0xec7ea9['count'];var _0x2286ee=_0x3ca8da?0x0:_0xea93e0[_0x7597('0x1f')];var _0x476c27=_0x3ca8da?_0xec7ea9[_0x7597('0x21')]:_0xea93e0[_0x7597('0x1f')]+_0xea93e0['limit'];var _0x999219;if(_0x476c27>=_0x24be0d){_0x476c27=_0x24be0d;_0x999219=0xc8;}else{_0x999219=0xce;}_0x387173[_0x7597('0x1d')](_0x999219);return _0x387173[_0x7597('0x22')]('Content-Range',_0x2286ee+'-'+_0x476c27+'/'+_0x24be0d)[_0x7597('0x1e')](_0xec7ea9);}return null;};}function patchUpdates(_0x29b24c){return function(_0x433197){try{jsonpatch['apply'](_0x433197,_0x29b24c,!![]);}catch(_0x53d345){return BPromise[_0x7597('0x23')](_0x53d345);}return _0x433197[_0x7597('0x24')]();};}function saveUpdates(_0x518a82,_0x5c6cfb){return function(_0x373e03){if(_0x373e03){return _0x373e03['update'](_0x518a82)['then'](function(_0x5b406c){return _0x5b406c;});}return null;};}function removeEntity(_0x52acc9,_0x1e7597){return function(_0x323857){if(_0x323857){return _0x323857[_0x7597('0x25')]()[_0x7597('0x26')](function(){_0x52acc9[_0x7597('0x1d')](0xcc)[_0x7597('0x27')]();});}};}function handleEntityNotFound(_0x45bf4f,_0x1e4e01){return function(_0x1b938f){if(!_0x1b938f){_0x45bf4f[_0x7597('0x1c')](0x194);}return _0x1b938f;};}function handleError(_0x5c36ef,_0x39ff19){_0x39ff19=_0x39ff19||0x1f4;return function(_0xb00490){logger[_0x7597('0x28')](_0xb00490[_0x7597('0x29')]);if(_0xb00490[_0x7597('0x2a')]){delete _0xb00490[_0x7597('0x2a')];}_0x5c36ef['status'](_0x39ff19)[_0x7597('0x2b')](_0xb00490);};}exports[_0x7597('0x2c')]=function(_0x51f9d4,_0x33edee){var _0x3dc28c={},_0x2ee6cf={},_0x342519={'count':0x0,'rows':[]};var _0x5aec86=_['map'](db[_0x7597('0x2d')][_0x7597('0x2e')],function(_0x2748b0){return{'name':_0x2748b0['fieldName'],'type':_0x2748b0[_0x7597('0x2f')][_0x7597('0x30')]};});_0x2ee6cf['model']=_[_0x7597('0x31')](_0x5aec86,_0x7597('0x2a'));_0x2ee6cf[_0x7597('0x32')]=_[_0x7597('0x33')](_0x51f9d4[_0x7597('0x32')]);_0x2ee6cf[_0x7597('0x34')]=_['intersection'](_0x2ee6cf[_0x7597('0x35')],_0x2ee6cf[_0x7597('0x32')]);_0x3dc28c[_0x7597('0x36')]=_[_0x7597('0x37')](_0x2ee6cf[_0x7597('0x35')],qs[_0x7597('0x38')](_0x51f9d4['query'][_0x7597('0x38')]));_0x3dc28c[_0x7597('0x36')]=_0x3dc28c[_0x7597('0x36')][_0x7597('0x39')]?_0x3dc28c[_0x7597('0x36')]:_0x2ee6cf[_0x7597('0x35')];if(!_0x51f9d4[_0x7597('0x32')][_0x7597('0x3a')](_0x7597('0x3b'))){_0x3dc28c[_0x7597('0x3c')]=qs[_0x7597('0x3c')](_0x51f9d4['query'][_0x7597('0x3c')]);_0x3dc28c[_0x7597('0x1f')]=qs[_0x7597('0x1f')](_0x51f9d4['query'][_0x7597('0x1f')]);}_0x3dc28c['order']=qs[_0x7597('0x3d')](_0x51f9d4[_0x7597('0x32')]['sort']);_0x3dc28c[_0x7597('0x3e')]=qs[_0x7597('0x34')](_[_0x7597('0x3f')](_0x51f9d4[_0x7597('0x32')],_0x2ee6cf['filters']),_0x5aec86);if(_0x51f9d4[_0x7597('0x32')]['filter']){_0x3dc28c[_0x7597('0x3e')]=_['merge'](_0x3dc28c[_0x7597('0x3e')],{'$or':_[_0x7597('0x31')](_0x5aec86,function(_0x2b577e){if(_0x2b577e[_0x7597('0x2f')]!==_0x7597('0x40')){var _0x272b54={};_0x272b54[_0x2b577e[_0x7597('0x2a')]]={'$like':'%'+_0x51f9d4['query'][_0x7597('0x41')]+'%'};return _0x272b54;}})});}_0x3dc28c=_['merge']({},_0x3dc28c,_0x51f9d4[_0x7597('0x42')]);var _0xd4cf9d={'where':_0x3dc28c[_0x7597('0x3e')]};return db[_0x7597('0x2d')][_0x7597('0x21')](_0xd4cf9d)[_0x7597('0x26')](function(_0x27e158){_0x342519[_0x7597('0x21')]=_0x27e158;if(_0x51f9d4[_0x7597('0x32')][_0x7597('0x43')]){_0x3dc28c[_0x7597('0x44')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x3dc28c);})[_0x7597('0x26')](function(_0x42161a){_0x342519[_0x7597('0x45')]=_0x42161a;return _0x342519;})[_0x7597('0x26')](respondWithFilteredResult(_0x33edee,_0x3dc28c))[_0x7597('0x46')](handleError(_0x33edee,null));};exports[_0x7597('0x47')]=function(_0x3389ae,_0x522f21){var _0x1325f9={'raw':![],'where':{'id':_0x3389ae['params']['id']}},_0x2e36e0={};_0x2e36e0['model']=_[_0x7597('0x33')](db[_0x7597('0x2d')][_0x7597('0x2e')]);_0x2e36e0[_0x7597('0x32')]=_['keys'](_0x3389ae['query']);_0x2e36e0['filters']=_[_0x7597('0x37')](_0x2e36e0[_0x7597('0x35')],_0x2e36e0[_0x7597('0x32')]);_0x1325f9[_0x7597('0x36')]=_[_0x7597('0x37')](_0x2e36e0[_0x7597('0x35')],qs['fields'](_0x3389ae[_0x7597('0x32')][_0x7597('0x38')]));_0x1325f9[_0x7597('0x36')]=_0x1325f9[_0x7597('0x36')]['length']?_0x1325f9[_0x7597('0x36')]:_0x2e36e0['model'];if(_0x3389ae[_0x7597('0x32')]['includeAll']){_0x1325f9['include']=[{'all':!![]}];}_0x1325f9=_[_0x7597('0x48')]({},_0x1325f9,_0x3389ae[_0x7597('0x42')]);return db[_0x7597('0x2d')][_0x7597('0x49')](_0x1325f9)['then'](handleEntityNotFound(_0x522f21,null))['then'](respondWithResult(_0x522f21,null))['catch'](handleError(_0x522f21,null));};exports[_0x7597('0x4a')]=function(_0x35fffd,_0x390f2e){return db['SalesforceConfiguration'][_0x7597('0x4a')](_0x35fffd['body'],{})['then'](respondWithResult(_0x390f2e,0xc9))[_0x7597('0x46')](handleError(_0x390f2e,null));};exports['update']=function(_0x4538a0,_0x2f28f3){if(_0x4538a0[_0x7597('0x4b')]['id']){delete _0x4538a0['body']['id'];}return db[_0x7597('0x2d')][_0x7597('0x49')]({'where':{'id':_0x4538a0[_0x7597('0x4c')]['id']}})[_0x7597('0x26')](handleEntityNotFound(_0x2f28f3,null))[_0x7597('0x26')](saveUpdates(_0x4538a0[_0x7597('0x4b')],null))[_0x7597('0x26')](respondWithResult(_0x2f28f3,null))[_0x7597('0x46')](handleError(_0x2f28f3,null));};exports['destroy']=function(_0x4c2c17,_0x3e659a){return db[_0x7597('0x2d')][_0x7597('0x49')]({'where':{'id':_0x4c2c17['params']['id']}})[_0x7597('0x26')](handleEntityNotFound(_0x3e659a,null))[_0x7597('0x26')](removeEntity(_0x3e659a,null))['catch'](handleError(_0x3e659a,null));};exports[_0x7597('0x4d')]=function(_0x4ca270,_0x3be6c9,_0x526f6f){var _0x2331f4={};var _0x298dba={};var _0x326a0c;var _0x34a330;return db[_0x7597('0x2d')][_0x7597('0x4e')]({'where':{'id':_0x4ca270['params']['id']}})[_0x7597('0x26')](handleEntityNotFound(_0x3be6c9,null))[_0x7597('0x26')](function(_0x57c8b2){if(_0x57c8b2){_0x326a0c=_0x57c8b2;_0x298dba[_0x7597('0x35')]=_[_0x7597('0x33')](db['SalesforceField'][_0x7597('0x2e')]);_0x298dba[_0x7597('0x32')]=_[_0x7597('0x33')](_0x4ca270[_0x7597('0x32')]);_0x298dba[_0x7597('0x34')]=_[_0x7597('0x37')](_0x298dba[_0x7597('0x35')],_0x298dba['query']);_0x2331f4['attributes']=_['intersection'](_0x298dba[_0x7597('0x35')],qs['fields'](_0x4ca270['query'][_0x7597('0x38')]));_0x2331f4[_0x7597('0x36')]=_0x2331f4[_0x7597('0x36')][_0x7597('0x39')]?_0x2331f4[_0x7597('0x36')]:_0x298dba[_0x7597('0x35')];_0x2331f4[_0x7597('0x4f')]=qs[_0x7597('0x3d')](_0x4ca270[_0x7597('0x32')][_0x7597('0x3d')]);_0x2331f4['where']=qs[_0x7597('0x34')](_[_0x7597('0x3f')](_0x4ca270[_0x7597('0x32')],_0x298dba[_0x7597('0x34')]));if(_0x4ca270[_0x7597('0x32')][_0x7597('0x41')]){_0x2331f4[_0x7597('0x3e')]=_[_0x7597('0x48')](_0x2331f4[_0x7597('0x3e')],{'$or':_[_0x7597('0x31')](_0x2331f4[_0x7597('0x36')],function(_0x17e0d6){var _0x3e9f85={};_0x3e9f85[_0x17e0d6]={'$like':'%'+_0x4ca270[_0x7597('0x32')][_0x7597('0x41')]+'%'};return _0x3e9f85;})});}_0x2331f4=_[_0x7597('0x48')]({},_0x2331f4,_0x4ca270[_0x7597('0x42')]);return _0x326a0c[_0x7597('0x4d')](_0x2331f4);}})['then'](function(_0x5c3b02){if(_0x5c3b02){_0x34a330=_0x5c3b02[_0x7597('0x39')];if(!_0x4ca270[_0x7597('0x32')]['hasOwnProperty']('nolimit')){_0x2331f4[_0x7597('0x3c')]=qs['limit'](_0x4ca270[_0x7597('0x32')][_0x7597('0x3c')]);_0x2331f4['offset']=qs[_0x7597('0x1f')](_0x4ca270[_0x7597('0x32')][_0x7597('0x1f')]);}return _0x326a0c['getFields'](_0x2331f4);}})['then'](function(_0x401cfb){if(_0x401cfb){return _0x401cfb?{'count':_0x34a330,'rows':_0x401cfb}:null;}})['then'](respondWithResult(_0x3be6c9,null))[_0x7597('0x46')](handleError(_0x3be6c9,null));};exports[_0x7597('0x50')]=function(_0x24d478,_0x5444b2,_0x28a8fe){var _0x5c766c={};var _0x10c4ff={};var _0x3281f3;var _0x1727bd;return db[_0x7597('0x2d')][_0x7597('0x4e')]({'where':{'id':_0x24d478['params']['id']}})[_0x7597('0x26')](handleEntityNotFound(_0x5444b2,null))['then'](function(_0x290c9c){if(_0x290c9c){_0x3281f3=_0x290c9c;_0x10c4ff[_0x7597('0x35')]=_[_0x7597('0x33')](db[_0x7597('0x51')][_0x7597('0x2e')]);_0x10c4ff[_0x7597('0x32')]=_['keys'](_0x24d478[_0x7597('0x32')]);_0x10c4ff[_0x7597('0x34')]=_[_0x7597('0x37')](_0x10c4ff[_0x7597('0x35')],_0x10c4ff[_0x7597('0x32')]);_0x5c766c[_0x7597('0x36')]=_['intersection'](_0x10c4ff[_0x7597('0x35')],qs[_0x7597('0x38')](_0x24d478[_0x7597('0x32')][_0x7597('0x38')]));_0x5c766c[_0x7597('0x36')]=_0x5c766c['attributes'][_0x7597('0x39')]?_0x5c766c[_0x7597('0x36')]:_0x10c4ff['model'];_0x5c766c[_0x7597('0x4f')]=qs[_0x7597('0x3d')](_0x24d478[_0x7597('0x32')]['sort']);_0x5c766c[_0x7597('0x3e')]=qs[_0x7597('0x34')](_['pick'](_0x24d478[_0x7597('0x32')],_0x10c4ff[_0x7597('0x34')]));if(_0x24d478[_0x7597('0x32')][_0x7597('0x41')]){_0x5c766c['where']=_['merge'](_0x5c766c[_0x7597('0x3e')],{'$or':_[_0x7597('0x31')](_0x5c766c[_0x7597('0x36')],function(_0x11b560){var _0x996012={};_0x996012[_0x11b560]={'$like':'%'+_0x24d478[_0x7597('0x32')]['filter']+'%'};return _0x996012;})});}_0x5c766c=_[_0x7597('0x48')]({},_0x5c766c,_0x24d478[_0x7597('0x42')]);return _0x3281f3[_0x7597('0x50')](_0x5c766c);}})[_0x7597('0x26')](function(_0x4e76af){if(_0x4e76af){_0x1727bd=_0x4e76af[_0x7597('0x39')];if(!_0x24d478[_0x7597('0x32')][_0x7597('0x3a')](_0x7597('0x3b'))){_0x5c766c[_0x7597('0x3c')]=qs[_0x7597('0x3c')](_0x24d478[_0x7597('0x32')][_0x7597('0x3c')]);_0x5c766c['offset']=qs[_0x7597('0x1f')](_0x24d478[_0x7597('0x32')]['offset']);}return _0x3281f3[_0x7597('0x50')](_0x5c766c);}})[_0x7597('0x26')](function(_0x2d925f){if(_0x2d925f){return _0x2d925f?{'count':_0x1727bd,'rows':_0x2d925f}:null;}})['then'](respondWithResult(_0x5444b2,null))[_0x7597('0x46')](handleError(_0x5444b2,null));};exports['getDescriptions']=function(_0x177e93,_0xc0211a,_0x2d94ab){var _0x4e96d3={};var _0x1efd64={};var _0x35556d;var _0x9dbd69;return db['SalesforceConfiguration'][_0x7597('0x4e')]({'where':{'id':_0x177e93['params']['id']}})[_0x7597('0x26')](handleEntityNotFound(_0xc0211a,null))['then'](function(_0x582717){if(_0x582717){_0x35556d=_0x582717;_0x1efd64['model']=_[_0x7597('0x33')](db[_0x7597('0x51')][_0x7597('0x2e')]);_0x1efd64[_0x7597('0x32')]=_['keys'](_0x177e93['query']);_0x1efd64[_0x7597('0x34')]=_[_0x7597('0x37')](_0x1efd64['model'],_0x1efd64['query']);_0x4e96d3[_0x7597('0x36')]=_[_0x7597('0x37')](_0x1efd64['model'],qs[_0x7597('0x38')](_0x177e93[_0x7597('0x32')][_0x7597('0x38')]));_0x4e96d3[_0x7597('0x36')]=_0x4e96d3[_0x7597('0x36')][_0x7597('0x39')]?_0x4e96d3['attributes']:_0x1efd64[_0x7597('0x35')];_0x4e96d3[_0x7597('0x4f')]=qs['sort'](_0x177e93[_0x7597('0x32')][_0x7597('0x3d')]);_0x4e96d3[_0x7597('0x3e')]=qs['filters'](_['pick'](_0x177e93[_0x7597('0x32')],_0x1efd64[_0x7597('0x34')]));if(_0x177e93[_0x7597('0x32')][_0x7597('0x41')]){_0x4e96d3[_0x7597('0x3e')]=_[_0x7597('0x48')](_0x4e96d3[_0x7597('0x3e')],{'$or':_[_0x7597('0x31')](_0x4e96d3['attributes'],function(_0x30e864){var _0x433934={};_0x433934[_0x30e864]={'$like':'%'+_0x177e93[_0x7597('0x32')][_0x7597('0x41')]+'%'};return _0x433934;})});}_0x4e96d3=_[_0x7597('0x48')]({},_0x4e96d3,_0x177e93['options']);return _0x35556d[_0x7597('0x52')](_0x4e96d3);}})[_0x7597('0x26')](function(_0x559b72){if(_0x559b72){_0x9dbd69=_0x559b72['length'];if(!_0x177e93[_0x7597('0x32')][_0x7597('0x3a')]('nolimit')){_0x4e96d3['limit']=qs[_0x7597('0x3c')](_0x177e93[_0x7597('0x32')][_0x7597('0x3c')]);_0x4e96d3['offset']=qs[_0x7597('0x1f')](_0x177e93[_0x7597('0x32')][_0x7597('0x1f')]);}return _0x35556d['getDescriptions'](_0x4e96d3);}})[_0x7597('0x26')](function(_0x3fd0c0){if(_0x3fd0c0){return _0x3fd0c0?{'count':_0x9dbd69,'rows':_0x3fd0c0}:null;}})[_0x7597('0x26')](respondWithResult(_0xc0211a,null))[_0x7597('0x46')](handleError(_0xc0211a,null));}; \ No newline at end of file +var _0xab28=['jsforce','to-csv','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','json','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','body','find','getFields','SalesforceField','filter','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','crypto'];(function(_0x583c7f,_0x284ac3){var _0x7a2012=function(_0x5e8106){while(--_0x5e8106){_0x583c7f['push'](_0x583c7f['shift']());}};_0x7a2012(++_0x284ac3);}(_0xab28,0x15d));var _0x8ab2=function(_0x1181f3,_0xf81baa){_0x1181f3=_0x1181f3-0x0;var _0x37abb6=_0xab28[_0x1181f3];return _0x37abb6;};'use strict';var emlformat=require(_0x8ab2('0x0'));var rimraf=require(_0x8ab2('0x1'));var zipdir=require(_0x8ab2('0x2'));var jsonpatch=require(_0x8ab2('0x3'));var rp=require('request-promise');var moment=require(_0x8ab2('0x4'));var BPromise=require(_0x8ab2('0x5'));var Mustache=require(_0x8ab2('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8ab2('0x7'));var csv=require('to-csv');var ejs=require(_0x8ab2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ab2('0x9'));var squel=require('squel');var crypto=require(_0x8ab2('0xa'));var jsforce=require(_0x8ab2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8ab2('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8ab2('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ab2('0xe'));var logger=require(_0x8ab2('0xf'))(_0x8ab2('0x10'));var utils=require('../../config/utils');var config=require(_0x8ab2('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x473c66,_0xed3b5e){_0xed3b5e=_0xed3b5e||0xcc;return function(_0x530938){if(_0x530938){return _0x473c66[_0x8ab2('0x12')](_0xed3b5e);}return _0x473c66[_0x8ab2('0x13')](_0xed3b5e)[_0x8ab2('0x14')]();};}function respondWithResult(_0x2bcf5c,_0x46b70a){_0x46b70a=_0x46b70a||0xc8;return function(_0x3df594){if(_0x3df594){return _0x2bcf5c[_0x8ab2('0x13')](_0x46b70a)['json'](_0x3df594);}};}function respondWithFilteredResult(_0x3ba9c7,_0x592eb8){return function(_0x3694ae){if(_0x3694ae){var _0x13f8c1=typeof _0x592eb8[_0x8ab2('0x15')]===_0x8ab2('0x16')&&typeof _0x592eb8['limit']===_0x8ab2('0x16');var _0x45f3a1=_0x3694ae[_0x8ab2('0x17')];var _0x4a3aef=_0x13f8c1?0x0:_0x592eb8[_0x8ab2('0x15')];var _0x3e9912=_0x13f8c1?_0x3694ae['count']:_0x592eb8[_0x8ab2('0x15')]+_0x592eb8[_0x8ab2('0x18')];var _0x3aba96;if(_0x3e9912>=_0x45f3a1){_0x3e9912=_0x45f3a1;_0x3aba96=0xc8;}else{_0x3aba96=0xce;}_0x3ba9c7['status'](_0x3aba96);return _0x3ba9c7['set']('Content-Range',_0x4a3aef+'-'+_0x3e9912+'/'+_0x45f3a1)[_0x8ab2('0x19')](_0x3694ae);}return null;};}function patchUpdates(_0x5b828c){return function(_0x105c7d){try{jsonpatch['apply'](_0x105c7d,_0x5b828c,!![]);}catch(_0x3b1d28){return BPromise['reject'](_0x3b1d28);}return _0x105c7d[_0x8ab2('0x1a')]();};}function saveUpdates(_0xd9692,_0x3c8936){return function(_0x119b45){if(_0x119b45){return _0x119b45[_0x8ab2('0x1b')](_0xd9692)[_0x8ab2('0x1c')](function(_0x2f7926){return _0x2f7926;});}return null;};}function removeEntity(_0x2941a9,_0x2e76cd){return function(_0x41cf5c){if(_0x41cf5c){return _0x41cf5c[_0x8ab2('0x1d')]()[_0x8ab2('0x1c')](function(){_0x2941a9[_0x8ab2('0x13')](0xcc)[_0x8ab2('0x14')]();});}};}function handleEntityNotFound(_0x1cb287,_0x1194f4){return function(_0x699240){if(!_0x699240){_0x1cb287[_0x8ab2('0x12')](0x194);}return _0x699240;};}function handleError(_0x26eaa7,_0x5cc94c){_0x5cc94c=_0x5cc94c||0x1f4;return function(_0xac0b6e){logger[_0x8ab2('0x1e')](_0xac0b6e[_0x8ab2('0x1f')]);if(_0xac0b6e[_0x8ab2('0x20')]){delete _0xac0b6e[_0x8ab2('0x20')];}_0x26eaa7['status'](_0x5cc94c)[_0x8ab2('0x21')](_0xac0b6e);};}exports[_0x8ab2('0x22')]=function(_0x421a92,_0x4b4385){var _0x11d3b7={},_0x2f0df1={},_0x4e8d87={'count':0x0,'rows':[]};var _0x4448aa=_[_0x8ab2('0x23')](db[_0x8ab2('0x24')][_0x8ab2('0x25')],function(_0x40c4d9){return{'name':_0x40c4d9[_0x8ab2('0x26')],'type':_0x40c4d9[_0x8ab2('0x27')][_0x8ab2('0x28')]};});_0x2f0df1['model']=_['map'](_0x4448aa,_0x8ab2('0x20'));_0x2f0df1[_0x8ab2('0x29')]=_[_0x8ab2('0x2a')](_0x421a92[_0x8ab2('0x29')]);_0x2f0df1[_0x8ab2('0x2b')]=_[_0x8ab2('0x2c')](_0x2f0df1[_0x8ab2('0x2d')],_0x2f0df1[_0x8ab2('0x29')]);_0x11d3b7[_0x8ab2('0x2e')]=_[_0x8ab2('0x2c')](_0x2f0df1['model'],qs['fields'](_0x421a92[_0x8ab2('0x29')][_0x8ab2('0x2f')]));_0x11d3b7['attributes']=_0x11d3b7[_0x8ab2('0x2e')]['length']?_0x11d3b7[_0x8ab2('0x2e')]:_0x2f0df1[_0x8ab2('0x2d')];if(!_0x421a92[_0x8ab2('0x29')][_0x8ab2('0x30')]('nolimit')){_0x11d3b7[_0x8ab2('0x18')]=qs['limit'](_0x421a92[_0x8ab2('0x29')][_0x8ab2('0x18')]);_0x11d3b7[_0x8ab2('0x15')]=qs[_0x8ab2('0x15')](_0x421a92[_0x8ab2('0x29')][_0x8ab2('0x15')]);}_0x11d3b7[_0x8ab2('0x31')]=qs[_0x8ab2('0x32')](_0x421a92[_0x8ab2('0x29')][_0x8ab2('0x32')]);_0x11d3b7[_0x8ab2('0x33')]=qs[_0x8ab2('0x2b')](_[_0x8ab2('0x34')](_0x421a92[_0x8ab2('0x29')],_0x2f0df1[_0x8ab2('0x2b')]),_0x4448aa);if(_0x421a92[_0x8ab2('0x29')]['filter']){_0x11d3b7[_0x8ab2('0x33')]=_[_0x8ab2('0x35')](_0x11d3b7[_0x8ab2('0x33')],{'$or':_[_0x8ab2('0x23')](_0x4448aa,function(_0x447943){if(_0x447943[_0x8ab2('0x27')]!==_0x8ab2('0x36')){var _0x5b7f87={};_0x5b7f87[_0x447943[_0x8ab2('0x20')]]={'$like':'%'+_0x421a92[_0x8ab2('0x29')]['filter']+'%'};return _0x5b7f87;}})});}_0x11d3b7=_[_0x8ab2('0x35')]({},_0x11d3b7,_0x421a92[_0x8ab2('0x37')]);var _0x4651d9={'where':_0x11d3b7[_0x8ab2('0x33')]};return db[_0x8ab2('0x24')][_0x8ab2('0x17')](_0x4651d9)['then'](function(_0x26c8db){_0x4e8d87[_0x8ab2('0x17')]=_0x26c8db;if(_0x421a92[_0x8ab2('0x29')]['includeAll']){_0x11d3b7[_0x8ab2('0x38')]=[{'all':!![]}];}return db[_0x8ab2('0x24')][_0x8ab2('0x39')](_0x11d3b7);})[_0x8ab2('0x1c')](function(_0x1a02a5){_0x4e8d87[_0x8ab2('0x3a')]=_0x1a02a5;return _0x4e8d87;})['then'](respondWithFilteredResult(_0x4b4385,_0x11d3b7))[_0x8ab2('0x3b')](handleError(_0x4b4385,null));};exports[_0x8ab2('0x3c')]=function(_0x2deca6,_0x586aa1){var _0x42491b={'raw':![],'where':{'id':_0x2deca6[_0x8ab2('0x3d')]['id']}},_0x5e6f41={};_0x5e6f41[_0x8ab2('0x2d')]=_[_0x8ab2('0x2a')](db[_0x8ab2('0x24')]['rawAttributes']);_0x5e6f41[_0x8ab2('0x29')]=_[_0x8ab2('0x2a')](_0x2deca6['query']);_0x5e6f41[_0x8ab2('0x2b')]=_[_0x8ab2('0x2c')](_0x5e6f41['model'],_0x5e6f41[_0x8ab2('0x29')]);_0x42491b['attributes']=_[_0x8ab2('0x2c')](_0x5e6f41[_0x8ab2('0x2d')],qs[_0x8ab2('0x2f')](_0x2deca6[_0x8ab2('0x29')][_0x8ab2('0x2f')]));_0x42491b[_0x8ab2('0x2e')]=_0x42491b[_0x8ab2('0x2e')][_0x8ab2('0x3e')]?_0x42491b[_0x8ab2('0x2e')]:_0x5e6f41[_0x8ab2('0x2d')];if(_0x2deca6['query']['includeAll']){_0x42491b[_0x8ab2('0x38')]=[{'all':!![]}];}_0x42491b=_['merge']({},_0x42491b,_0x2deca6[_0x8ab2('0x37')]);return db['SalesforceConfiguration']['find'](_0x42491b)[_0x8ab2('0x1c')](handleEntityNotFound(_0x586aa1,null))['then'](respondWithResult(_0x586aa1,null))[_0x8ab2('0x3b')](handleError(_0x586aa1,null));};exports['create']=function(_0x1d022c,_0x20c329){return db[_0x8ab2('0x24')]['create'](_0x1d022c[_0x8ab2('0x3f')],{})['then'](respondWithResult(_0x20c329,0xc9))['catch'](handleError(_0x20c329,null));};exports[_0x8ab2('0x1b')]=function(_0x261a84,_0x52ae26){if(_0x261a84[_0x8ab2('0x3f')]['id']){delete _0x261a84[_0x8ab2('0x3f')]['id'];}return db[_0x8ab2('0x24')][_0x8ab2('0x40')]({'where':{'id':_0x261a84['params']['id']}})[_0x8ab2('0x1c')](handleEntityNotFound(_0x52ae26,null))[_0x8ab2('0x1c')](saveUpdates(_0x261a84[_0x8ab2('0x3f')],null))[_0x8ab2('0x1c')](respondWithResult(_0x52ae26,null))['catch'](handleError(_0x52ae26,null));};exports['destroy']=function(_0x41b846,_0x5ebc2b){return db[_0x8ab2('0x24')]['find']({'where':{'id':_0x41b846[_0x8ab2('0x3d')]['id']}})[_0x8ab2('0x1c')](handleEntityNotFound(_0x5ebc2b,null))['then'](removeEntity(_0x5ebc2b,null))['catch'](handleError(_0x5ebc2b,null));};exports[_0x8ab2('0x41')]=function(_0x97da5c,_0xf46da8,_0x35b78c){var _0x58f571={};var _0x7cbf91={};var _0x2df1a4;var _0x3b5068;return db[_0x8ab2('0x24')]['findOne']({'where':{'id':_0x97da5c['params']['id']}})['then'](handleEntityNotFound(_0xf46da8,null))[_0x8ab2('0x1c')](function(_0x1e87ad){if(_0x1e87ad){_0x2df1a4=_0x1e87ad;_0x7cbf91[_0x8ab2('0x2d')]=_[_0x8ab2('0x2a')](db[_0x8ab2('0x42')][_0x8ab2('0x25')]);_0x7cbf91[_0x8ab2('0x29')]=_['keys'](_0x97da5c[_0x8ab2('0x29')]);_0x7cbf91['filters']=_[_0x8ab2('0x2c')](_0x7cbf91[_0x8ab2('0x2d')],_0x7cbf91[_0x8ab2('0x29')]);_0x58f571[_0x8ab2('0x2e')]=_[_0x8ab2('0x2c')](_0x7cbf91[_0x8ab2('0x2d')],qs[_0x8ab2('0x2f')](_0x97da5c[_0x8ab2('0x29')]['fields']));_0x58f571[_0x8ab2('0x2e')]=_0x58f571[_0x8ab2('0x2e')][_0x8ab2('0x3e')]?_0x58f571[_0x8ab2('0x2e')]:_0x7cbf91['model'];_0x58f571['order']=qs[_0x8ab2('0x32')](_0x97da5c[_0x8ab2('0x29')][_0x8ab2('0x32')]);_0x58f571[_0x8ab2('0x33')]=qs[_0x8ab2('0x2b')](_[_0x8ab2('0x34')](_0x97da5c['query'],_0x7cbf91[_0x8ab2('0x2b')]));if(_0x97da5c[_0x8ab2('0x29')][_0x8ab2('0x43')]){_0x58f571[_0x8ab2('0x33')]=_[_0x8ab2('0x35')](_0x58f571[_0x8ab2('0x33')],{'$or':_[_0x8ab2('0x23')](_0x58f571[_0x8ab2('0x2e')],function(_0x4a2ceb){var _0x10bd05={};_0x10bd05[_0x4a2ceb]={'$like':'%'+_0x97da5c[_0x8ab2('0x29')][_0x8ab2('0x43')]+'%'};return _0x10bd05;})});}_0x58f571=_[_0x8ab2('0x35')]({},_0x58f571,_0x97da5c[_0x8ab2('0x37')]);return _0x2df1a4[_0x8ab2('0x41')](_0x58f571);}})[_0x8ab2('0x1c')](function(_0x517c37){if(_0x517c37){_0x3b5068=_0x517c37['length'];if(!_0x97da5c[_0x8ab2('0x29')][_0x8ab2('0x30')](_0x8ab2('0x44'))){_0x58f571[_0x8ab2('0x18')]=qs[_0x8ab2('0x18')](_0x97da5c[_0x8ab2('0x29')][_0x8ab2('0x18')]);_0x58f571[_0x8ab2('0x15')]=qs[_0x8ab2('0x15')](_0x97da5c[_0x8ab2('0x29')][_0x8ab2('0x15')]);}return _0x2df1a4[_0x8ab2('0x41')](_0x58f571);}})['then'](function(_0x240b25){if(_0x240b25){return _0x240b25?{'count':_0x3b5068,'rows':_0x240b25}:null;}})[_0x8ab2('0x1c')](respondWithResult(_0xf46da8,null))['catch'](handleError(_0xf46da8,null));};exports[_0x8ab2('0x45')]=function(_0x17a85a,_0x5d19f1,_0x247287){var _0x3f5bfd={};var _0x9ee33b={};var _0x451ec3;var _0x5450eb;return db['SalesforceConfiguration'][_0x8ab2('0x46')]({'where':{'id':_0x17a85a[_0x8ab2('0x3d')]['id']}})[_0x8ab2('0x1c')](handleEntityNotFound(_0x5d19f1,null))[_0x8ab2('0x1c')](function(_0x12a37b){if(_0x12a37b){_0x451ec3=_0x12a37b;_0x9ee33b[_0x8ab2('0x2d')]=_[_0x8ab2('0x2a')](db[_0x8ab2('0x42')][_0x8ab2('0x25')]);_0x9ee33b[_0x8ab2('0x29')]=_['keys'](_0x17a85a['query']);_0x9ee33b[_0x8ab2('0x2b')]=_['intersection'](_0x9ee33b['model'],_0x9ee33b[_0x8ab2('0x29')]);_0x3f5bfd[_0x8ab2('0x2e')]=_['intersection'](_0x9ee33b[_0x8ab2('0x2d')],qs[_0x8ab2('0x2f')](_0x17a85a[_0x8ab2('0x29')][_0x8ab2('0x2f')]));_0x3f5bfd[_0x8ab2('0x2e')]=_0x3f5bfd['attributes'][_0x8ab2('0x3e')]?_0x3f5bfd['attributes']:_0x9ee33b[_0x8ab2('0x2d')];_0x3f5bfd[_0x8ab2('0x31')]=qs['sort'](_0x17a85a[_0x8ab2('0x29')][_0x8ab2('0x32')]);_0x3f5bfd[_0x8ab2('0x33')]=qs[_0x8ab2('0x2b')](_['pick'](_0x17a85a['query'],_0x9ee33b[_0x8ab2('0x2b')]));if(_0x17a85a[_0x8ab2('0x29')][_0x8ab2('0x43')]){_0x3f5bfd[_0x8ab2('0x33')]=_[_0x8ab2('0x35')](_0x3f5bfd[_0x8ab2('0x33')],{'$or':_[_0x8ab2('0x23')](_0x3f5bfd[_0x8ab2('0x2e')],function(_0x59a58a){var _0x5ee594={};_0x5ee594[_0x59a58a]={'$like':'%'+_0x17a85a['query']['filter']+'%'};return _0x5ee594;})});}_0x3f5bfd=_[_0x8ab2('0x35')]({},_0x3f5bfd,_0x17a85a[_0x8ab2('0x37')]);return _0x451ec3[_0x8ab2('0x45')](_0x3f5bfd);}})['then'](function(_0xb88c94){if(_0xb88c94){_0x5450eb=_0xb88c94[_0x8ab2('0x3e')];if(!_0x17a85a[_0x8ab2('0x29')][_0x8ab2('0x30')]('nolimit')){_0x3f5bfd[_0x8ab2('0x18')]=qs[_0x8ab2('0x18')](_0x17a85a[_0x8ab2('0x29')][_0x8ab2('0x18')]);_0x3f5bfd['offset']=qs['offset'](_0x17a85a['query']['offset']);}return _0x451ec3[_0x8ab2('0x45')](_0x3f5bfd);}})['then'](function(_0x51a2f4){if(_0x51a2f4){return _0x51a2f4?{'count':_0x5450eb,'rows':_0x51a2f4}:null;}})[_0x8ab2('0x1c')](respondWithResult(_0x5d19f1,null))[_0x8ab2('0x3b')](handleError(_0x5d19f1,null));};exports[_0x8ab2('0x47')]=function(_0x35a3fa,_0xb6b0ac,_0xf3d10b){var _0x150fb8={};var _0x37c35c={};var _0x2df705;var _0x2198e2;return db[_0x8ab2('0x24')][_0x8ab2('0x46')]({'where':{'id':_0x35a3fa['params']['id']}})['then'](handleEntityNotFound(_0xb6b0ac,null))[_0x8ab2('0x1c')](function(_0x272d0b){if(_0x272d0b){_0x2df705=_0x272d0b;_0x37c35c[_0x8ab2('0x2d')]=_[_0x8ab2('0x2a')](db['SalesforceField']['rawAttributes']);_0x37c35c[_0x8ab2('0x29')]=_['keys'](_0x35a3fa[_0x8ab2('0x29')]);_0x37c35c['filters']=_[_0x8ab2('0x2c')](_0x37c35c[_0x8ab2('0x2d')],_0x37c35c[_0x8ab2('0x29')]);_0x150fb8['attributes']=_[_0x8ab2('0x2c')](_0x37c35c[_0x8ab2('0x2d')],qs[_0x8ab2('0x2f')](_0x35a3fa['query'][_0x8ab2('0x2f')]));_0x150fb8['attributes']=_0x150fb8[_0x8ab2('0x2e')][_0x8ab2('0x3e')]?_0x150fb8[_0x8ab2('0x2e')]:_0x37c35c[_0x8ab2('0x2d')];_0x150fb8[_0x8ab2('0x31')]=qs[_0x8ab2('0x32')](_0x35a3fa[_0x8ab2('0x29')]['sort']);_0x150fb8[_0x8ab2('0x33')]=qs[_0x8ab2('0x2b')](_['pick'](_0x35a3fa[_0x8ab2('0x29')],_0x37c35c[_0x8ab2('0x2b')]));if(_0x35a3fa[_0x8ab2('0x29')][_0x8ab2('0x43')]){_0x150fb8[_0x8ab2('0x33')]=_[_0x8ab2('0x35')](_0x150fb8['where'],{'$or':_[_0x8ab2('0x23')](_0x150fb8['attributes'],function(_0x1ae9c2){var _0x303a05={};_0x303a05[_0x1ae9c2]={'$like':'%'+_0x35a3fa['query'][_0x8ab2('0x43')]+'%'};return _0x303a05;})});}_0x150fb8=_[_0x8ab2('0x35')]({},_0x150fb8,_0x35a3fa[_0x8ab2('0x37')]);return _0x2df705[_0x8ab2('0x47')](_0x150fb8);}})['then'](function(_0x395509){if(_0x395509){_0x2198e2=_0x395509[_0x8ab2('0x3e')];if(!_0x35a3fa[_0x8ab2('0x29')][_0x8ab2('0x30')](_0x8ab2('0x44'))){_0x150fb8[_0x8ab2('0x18')]=qs[_0x8ab2('0x18')](_0x35a3fa[_0x8ab2('0x29')][_0x8ab2('0x18')]);_0x150fb8[_0x8ab2('0x15')]=qs[_0x8ab2('0x15')](_0x35a3fa[_0x8ab2('0x29')][_0x8ab2('0x15')]);}return _0x2df705[_0x8ab2('0x47')](_0x150fb8);}})[_0x8ab2('0x1c')](function(_0x58f6a6){if(_0x58f6a6){return _0x58f6a6?{'count':_0x2198e2,'rows':_0x58f6a6}:null;}})[_0x8ab2('0x1c')](respondWithResult(_0xb6b0ac,null))[_0x8ab2('0x3b')](handleError(_0xb6b0ac,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 0b3e0c1..25aa5bf 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 _0x0a8f=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','int_salesforce_configurations','lodash','../../config/logger','api','moment'];(function(_0x16d82f,_0x43a906){var _0xe9d6f2=function(_0x5da40e){while(--_0x5da40e){_0x16d82f['push'](_0x16d82f['shift']());}};_0xe9d6f2(++_0x43a906);}(_0x0a8f,0xe3));var _0xf0a8=function(_0x3be94b,_0x115c2f){_0x3be94b=_0x3be94b-0x0;var _0x1964ec=_0x0a8f[_0x3be94b];return _0x1964ec;};'use strict';var _=require(_0xf0a8('0x0'));var util=require('util');var logger=require(_0xf0a8('0x1'))(_0xf0a8('0x2'));var moment=require(_0xf0a8('0x3'));var BPromise=require(_0xf0a8('0x4'));var rp=require(_0xf0a8('0x5'));var fs=require('fs');var path=require(_0xf0a8('0x6'));var rimraf=require(_0xf0a8('0x7'));var config=require(_0xf0a8('0x8'));var attributes=require(_0xf0a8('0x9'));module['exports']=function(_0x2e32c9,_0x1ae451){return _0x2e32c9['define']('SalesforceConfiguration',attributes,{'tableName':_0xf0a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0b0=['bluebird','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','../../config/logger','api'];(function(_0x419738,_0x4a5819){var _0x56b714=function(_0x5da35d){while(--_0x5da35d){_0x419738['push'](_0x419738['shift']());}};_0x56b714(++_0x4a5819);}(_0xa0b0,0x14b));var _0x0a0b=function(_0x1a7c53,_0x883523){_0x1a7c53=_0x1a7c53-0x0;var _0x344d87=_0xa0b0[_0x1a7c53];return _0x344d87;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0a0b('0x0'))(_0x0a0b('0x1'));var moment=require('moment');var BPromise=require(_0x0a0b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0a0b('0x3'));var config=require(_0x0a0b('0x4'));var attributes=require(_0x0a0b('0x5'));module[_0x0a0b('0x6')]=function(_0x228afc,_0x338a83){return _0x228afc[_0x0a0b('0x7')]('SalesforceConfiguration',attributes,{'tableName':_0x0a0b('0x8'),'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 80811f1..307457d 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 _0x2828=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x2828,0x1b6));var _0x8282=function(_0x1ec1b8,_0x4e3651){_0x1ec1b8=_0x1ec1b8-0x0;var _0x4d0f2c=_0x2828[_0x1ec1b8];return _0x4d0f2c;};'use strict';var _=require(_0x8282('0x0'));var util=require(_0x8282('0x1'));var moment=require(_0x8282('0x2'));var BPromise=require(_0x8282('0x3'));var rs=require(_0x8282('0x4'));var fs=require('fs');var Redis=require(_0x8282('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8282('0x6'));var logger=require(_0x8282('0x7'))(_0x8282('0x8'));var config=require(_0x8282('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8282('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d7db8,_0x3d08a5,_0x1d5dbc){return new BPromise(function(_0x3fb16f,_0x49b4e2){return client['request'](_0x4d7db8,_0x1d5dbc)[_0x8282('0xb')](function(_0xa0b169){logger[_0x8282('0xc')](_0x8282('0xd'),_0x3d08a5,_0x8282('0xe'));logger[_0x8282('0xf')](_0x8282('0x10'),_0x3d08a5,_0x8282('0xe'),JSON[_0x8282('0x11')](_0xa0b169));if(_0xa0b169[_0x8282('0x12')]){if(_0xa0b169[_0x8282('0x12')]['code']===0x1f4){logger[_0x8282('0x12')](_0x8282('0xd'),_0x3d08a5,_0xa0b169[_0x8282('0x12')][_0x8282('0x13')]);return _0x49b4e2(_0xa0b169[_0x8282('0x12')][_0x8282('0x13')]);}logger['error'](_0x8282('0xd'),_0x3d08a5,_0xa0b169[_0x8282('0x12')]['message']);return _0x3fb16f(_0xa0b169[_0x8282('0x12')]['message']);}else{logger['info'](_0x8282('0xd'),_0x3d08a5,_0x8282('0xe'));_0x3fb16f(_0xa0b169[_0x8282('0x14')][_0x8282('0x13')]);}})['catch'](function(_0x340b0f){logger[_0x8282('0x12')](_0x8282('0xd'),_0x3d08a5,_0x340b0f);_0x49b4e2(_0x340b0f);});});} \ No newline at end of file +var _0xc342=['client','http','request','then','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0xc342,0x146));var _0x2c34=function(_0x232eb7,_0x199b07){_0x232eb7=_0x232eb7-0x0;var _0xd7fb8=_0xc342[_0x232eb7];return _0xd7fb8;};'use strict';var _=require(_0x2c34('0x0'));var util=require(_0x2c34('0x1'));var moment=require(_0x2c34('0x2'));var BPromise=require(_0x2c34('0x3'));var rs=require(_0x2c34('0x4'));var fs=require('fs');var Redis=require(_0x2c34('0x5'));var db=require(_0x2c34('0x6'))['db'];var utils=require(_0x2c34('0x7'));var logger=require(_0x2c34('0x8'))(_0x2c34('0x9'));var config=require(_0x2c34('0xa'));var jayson=require(_0x2c34('0xb'));var client=jayson[_0x2c34('0xc')][_0x2c34('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xfe3508,_0x5415f5,_0x5df615){return new BPromise(function(_0x1520a7,_0x54f99a){return client[_0x2c34('0xe')](_0xfe3508,_0x5df615)[_0x2c34('0xf')](function(_0x534b45){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x5415f5,_0x2c34('0x10'));logger['debug'](_0x2c34('0x11'),_0x5415f5,_0x2c34('0x10'),JSON[_0x2c34('0x12')](_0x534b45));if(_0x534b45['error']){if(_0x534b45[_0x2c34('0x13')][_0x2c34('0x14')]===0x1f4){logger[_0x2c34('0x13')](_0x2c34('0x15'),_0x5415f5,_0x534b45[_0x2c34('0x13')][_0x2c34('0x16')]);return _0x54f99a(_0x534b45[_0x2c34('0x13')][_0x2c34('0x16')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x5415f5,_0x534b45['error'][_0x2c34('0x16')]);return _0x1520a7(_0x534b45[_0x2c34('0x13')]['message']);}else{logger[_0x2c34('0x17')](_0x2c34('0x15'),_0x5415f5,_0x2c34('0x10'));_0x1520a7(_0x534b45[_0x2c34('0x18')][_0x2c34('0x16')]);}})[_0x2c34('0x19')](function(_0x1e7a0f){logger[_0x2c34('0x13')](_0x2c34('0x15'),_0x5415f5,_0x1e7a0f);_0x54f99a(_0x1e7a0f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 3ccbdf2..82dec48 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 _0x3569=['../../components/auth/service','get','isAuthenticated','index','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xceaf07,_0x1ba898){var _0x379aea=function(_0x1b0032){while(--_0x1b0032){_0xceaf07['push'](_0xceaf07['shift']());}};_0x379aea(++_0x1ba898);}(_0x3569,0xba));var _0x9356=function(_0x5e6d65,_0x5db89c){_0x5e6d65=_0x5e6d65-0x0;var _0x5e1f75=_0x3569[_0x5e6d65];return _0x5e1f75;};'use strict';var multer=require(_0x9356('0x0'));var util=require(_0x9356('0x1'));var path=require(_0x9356('0x2'));var timeout=require(_0x9356('0x3'));var express=require(_0x9356('0x4'));var router=express[_0x9356('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9356('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x9356('0x7')]('/',auth[_0x9356('0x8')](),controller[_0x9356('0x9')]);router[_0x9356('0x7')]('/:id',auth[_0x9356('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9356('0xa')]);router[_0x9356('0xb')](_0x9356('0xc'),auth[_0x9356('0x8')](),controller[_0x9356('0xd')]);router['delete'](_0x9356('0xc'),auth[_0x9356('0x8')](),controller[_0x9356('0xe')]);module[_0x9356('0xf')]=router; \ No newline at end of file +var _0x1bfb=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util'];(function(_0x238824,_0xa1751d){var _0x19c4d0=function(_0x5a983c){while(--_0x5a983c){_0x238824['push'](_0x238824['shift']());}};_0x19c4d0(++_0xa1751d);}(_0x1bfb,0x152));var _0xb1bf=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x1bfb[_0x5c1345];return _0x1c070d;};'use strict';var multer=require(_0xb1bf('0x0'));var util=require(_0xb1bf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb1bf('0x2'));var router=express[_0xb1bf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb1bf('0x4'));var interaction=require(_0xb1bf('0x5'));var config=require(_0xb1bf('0x6'));var controller=require(_0xb1bf('0x7'));router['get']('/',auth[_0xb1bf('0x8')](),controller[_0xb1bf('0x9')]);router['get'](_0xb1bf('0xa'),auth[_0xb1bf('0x8')](),controller[_0xb1bf('0xb')]);router[_0xb1bf('0xc')]('/',auth[_0xb1bf('0x8')](),controller['create']);router[_0xb1bf('0xd')](_0xb1bf('0xa'),auth['isAuthenticated'](),controller[_0xb1bf('0xe')]);router[_0xb1bf('0xf')](_0xb1bf('0xa'),auth[_0xb1bf('0x8')](),controller['destroy']);module[_0xb1bf('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 958d61e..8bafdd9 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 _0x07e6=['STRING','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x3d41ce,_0xef34a8){var _0x170f11=function(_0x2bfd9b){while(--_0x2bfd9b){_0x3d41ce['push'](_0x3d41ce['shift']());}};_0x170f11(++_0xef34a8);}(_0x07e6,0x1a1));var _0x607e=function(_0x4935c9,_0x311de8){_0x4935c9=_0x4935c9-0x0;var _0x155eb5=_0x07e6[_0x4935c9];return _0x155eb5;};'use strict';var Sequelize=require(_0x607e('0x0'));module[_0x607e('0x1')]={'type':{'type':Sequelize[_0x607e('0x2')](_0x607e('0x3'),_0x607e('0x4'),_0x607e('0x5'),'keyValue',_0x607e('0x6')),'defaultValue':_0x607e('0x3')},'content':{'type':Sequelize[_0x607e('0x7')]},'key':{'type':Sequelize[_0x607e('0x7')]},'keyType':{'type':Sequelize[_0x607e('0x2')](_0x607e('0x3'),'variable',_0x607e('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x607e('0x7')]},'variableName':{'type':Sequelize[_0x607e('0x7')]}}; \ No newline at end of file +var _0xccc9=['keyValue','picklist','STRING','variable','customVariable','sequelize','exports','ENUM','string'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xccc9,0xb9));var _0x9ccc=function(_0x5d74cb,_0x275c71){_0x5d74cb=_0x5d74cb-0x0;var _0x37da5d=_0xccc9[_0x5d74cb];return _0x37da5d;};'use strict';var Sequelize=require(_0x9ccc('0x0'));module[_0x9ccc('0x1')]={'type':{'type':Sequelize[_0x9ccc('0x2')](_0x9ccc('0x3'),'variable','customVariable',_0x9ccc('0x4'),_0x9ccc('0x5')),'defaultValue':_0x9ccc('0x3')},'content':{'type':Sequelize[_0x9ccc('0x6')]},'key':{'type':Sequelize[_0x9ccc('0x6')]},'keyType':{'type':Sequelize[_0x9ccc('0x2')]('string',_0x9ccc('0x7'),_0x9ccc('0x8'))},'keyContent':{'type':Sequelize[_0x9ccc('0x6')]},'idField':{'type':Sequelize[_0x9ccc('0x6')]},'variableName':{'type':Sequelize[_0x9ccc('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 0fbc641..792356b 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 _0xce98=['filter','type','VIRTUAL','merge','options','SalesforceField','includeAll','include','findAll','rows','catch','params','find','create','body','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/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','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick'];(function(_0xac82c9,_0x5e8331){var _0x459e30=function(_0x58ef89){while(--_0x58ef89){_0xac82c9['push'](_0xac82c9['shift']());}};_0x459e30(++_0x5e8331);}(_0xce98,0x15b));var _0x8ce9=function(_0x5778c7,_0x52acba){_0x5778c7=_0x5778c7-0x0;var _0x5a27d4=_0xce98[_0x5778c7];return _0x5a27d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ce9('0x0'));var zipdir=require(_0x8ce9('0x1'));var jsonpatch=require(_0x8ce9('0x2'));var rp=require(_0x8ce9('0x3'));var moment=require(_0x8ce9('0x4'));var BPromise=require(_0x8ce9('0x5'));var Mustache=require(_0x8ce9('0x6'));var util=require(_0x8ce9('0x7'));var path=require(_0x8ce9('0x8'));var sox=require(_0x8ce9('0x9'));var csv=require(_0x8ce9('0xa'));var ejs=require(_0x8ce9('0xb'));var fs=require('fs');var fs_extra=require(_0x8ce9('0xc'));var _=require('lodash');var squel=require(_0x8ce9('0xd'));var crypto=require(_0x8ce9('0xe'));var jsforce=require(_0x8ce9('0xf'));var deskjs=require(_0x8ce9('0x10'));var toCsv=require(_0x8ce9('0xa'));var querystring=require(_0x8ce9('0x11'));var Papa=require(_0x8ce9('0x12'));var Redis=require(_0x8ce9('0x13'));var authService=require(_0x8ce9('0x14'));var qs=require(_0x8ce9('0x15'));var as=require(_0x8ce9('0x16'));var hardwareService=require(_0x8ce9('0x17'));var logger=require(_0x8ce9('0x18'))(_0x8ce9('0x19'));var utils=require(_0x8ce9('0x1a'));var config=require(_0x8ce9('0x1b'));var licenseUtil=require(_0x8ce9('0x1c'));var db=require(_0x8ce9('0x1d'))['db'];function respondWithStatusCode(_0x3caaff,_0x538cfc){_0x538cfc=_0x538cfc||0xcc;return function(_0xbe503a){if(_0xbe503a){return _0x3caaff[_0x8ce9('0x1e')](_0x538cfc);}return _0x3caaff[_0x8ce9('0x1f')](_0x538cfc)[_0x8ce9('0x20')]();};}function respondWithResult(_0x16c586,_0x2add7b){_0x2add7b=_0x2add7b||0xc8;return function(_0x53eb58){if(_0x53eb58){return _0x16c586[_0x8ce9('0x1f')](_0x2add7b)[_0x8ce9('0x21')](_0x53eb58);}};}function respondWithFilteredResult(_0x51020e,_0x1b2be0){return function(_0x45df80){if(_0x45df80){var _0x5f05b0=typeof _0x1b2be0[_0x8ce9('0x22')]==='undefined'&&typeof _0x1b2be0['limit']===_0x8ce9('0x23');var _0xcf06ee=_0x45df80['count'];var _0x1ca32a=_0x5f05b0?0x0:_0x1b2be0['offset'];var _0x102e08=_0x5f05b0?_0x45df80[_0x8ce9('0x24')]:_0x1b2be0['offset']+_0x1b2be0['limit'];var _0x12188e;if(_0x102e08>=_0xcf06ee){_0x102e08=_0xcf06ee;_0x12188e=0xc8;}else{_0x12188e=0xce;}_0x51020e[_0x8ce9('0x1f')](_0x12188e);return _0x51020e[_0x8ce9('0x25')](_0x8ce9('0x26'),_0x1ca32a+'-'+_0x102e08+'/'+_0xcf06ee)['json'](_0x45df80);}return null;};}function patchUpdates(_0x2f67fc){return function(_0x594fd1){try{jsonpatch['apply'](_0x594fd1,_0x2f67fc,!![]);}catch(_0x56e0e9){return BPromise[_0x8ce9('0x27')](_0x56e0e9);}return _0x594fd1[_0x8ce9('0x28')]();};}function saveUpdates(_0x442cb9,_0x4b259d){return function(_0x1d6acd){if(_0x1d6acd){return _0x1d6acd[_0x8ce9('0x29')](_0x442cb9)[_0x8ce9('0x2a')](function(_0x1336f5){return _0x1336f5;});}return null;};}function removeEntity(_0x4515b5,_0x569e45){return function(_0x1ab9d5){if(_0x1ab9d5){return _0x1ab9d5[_0x8ce9('0x2b')]()[_0x8ce9('0x2a')](function(){_0x4515b5['status'](0xcc)[_0x8ce9('0x20')]();});}};}function handleEntityNotFound(_0x3759f3,_0xa65b19){return function(_0x346376){if(!_0x346376){_0x3759f3[_0x8ce9('0x1e')](0x194);}return _0x346376;};}function handleError(_0x48a23f,_0x33a7d6){_0x33a7d6=_0x33a7d6||0x1f4;return function(_0x3468a5){logger[_0x8ce9('0x2c')](_0x3468a5[_0x8ce9('0x2d')]);if(_0x3468a5[_0x8ce9('0x2e')]){delete _0x3468a5['name'];}_0x48a23f[_0x8ce9('0x1f')](_0x33a7d6)[_0x8ce9('0x2f')](_0x3468a5);};}exports[_0x8ce9('0x30')]=function(_0x5944e8,_0x1192aa){var _0x459e50={},_0x2979de={},_0x370a0a={'count':0x0,'rows':[]};var _0x5e2f9a=_[_0x8ce9('0x31')](db['SalesforceField'][_0x8ce9('0x32')],function(_0x3c291a){return{'name':_0x3c291a[_0x8ce9('0x33')],'type':_0x3c291a['type'][_0x8ce9('0x34')]};});_0x2979de[_0x8ce9('0x35')]=_[_0x8ce9('0x31')](_0x5e2f9a,_0x8ce9('0x2e'));_0x2979de['query']=_[_0x8ce9('0x36')](_0x5944e8[_0x8ce9('0x37')]);_0x2979de[_0x8ce9('0x38')]=_[_0x8ce9('0x39')](_0x2979de[_0x8ce9('0x35')],_0x2979de[_0x8ce9('0x37')]);_0x459e50[_0x8ce9('0x3a')]=_[_0x8ce9('0x39')](_0x2979de[_0x8ce9('0x35')],qs[_0x8ce9('0x3b')](_0x5944e8['query'][_0x8ce9('0x3b')]));_0x459e50[_0x8ce9('0x3a')]=_0x459e50[_0x8ce9('0x3a')][_0x8ce9('0x3c')]?_0x459e50[_0x8ce9('0x3a')]:_0x2979de['model'];if(!_0x5944e8[_0x8ce9('0x37')][_0x8ce9('0x3d')](_0x8ce9('0x3e'))){_0x459e50[_0x8ce9('0x3f')]=qs[_0x8ce9('0x3f')](_0x5944e8[_0x8ce9('0x37')][_0x8ce9('0x3f')]);_0x459e50[_0x8ce9('0x22')]=qs['offset'](_0x5944e8[_0x8ce9('0x37')][_0x8ce9('0x22')]);}_0x459e50[_0x8ce9('0x40')]=qs['sort'](_0x5944e8[_0x8ce9('0x37')][_0x8ce9('0x41')]);_0x459e50[_0x8ce9('0x42')]=qs[_0x8ce9('0x38')](_[_0x8ce9('0x43')](_0x5944e8[_0x8ce9('0x37')],_0x2979de['filters']),_0x5e2f9a);if(_0x5944e8[_0x8ce9('0x37')][_0x8ce9('0x44')]){_0x459e50[_0x8ce9('0x42')]=_['merge'](_0x459e50['where'],{'$or':_[_0x8ce9('0x31')](_0x5e2f9a,function(_0x3a2656){if(_0x3a2656[_0x8ce9('0x45')]!==_0x8ce9('0x46')){var _0x2913ee={};_0x2913ee[_0x3a2656[_0x8ce9('0x2e')]]={'$like':'%'+_0x5944e8[_0x8ce9('0x37')][_0x8ce9('0x44')]+'%'};return _0x2913ee;}})});}_0x459e50=_[_0x8ce9('0x47')]({},_0x459e50,_0x5944e8[_0x8ce9('0x48')]);var _0x262005={'where':_0x459e50[_0x8ce9('0x42')]};return db[_0x8ce9('0x49')]['count'](_0x262005)['then'](function(_0x255a69){_0x370a0a['count']=_0x255a69;if(_0x5944e8[_0x8ce9('0x37')][_0x8ce9('0x4a')]){_0x459e50[_0x8ce9('0x4b')]=[{'all':!![]}];}return db[_0x8ce9('0x49')][_0x8ce9('0x4c')](_0x459e50);})[_0x8ce9('0x2a')](function(_0x2773c2){_0x370a0a[_0x8ce9('0x4d')]=_0x2773c2;return _0x370a0a;})[_0x8ce9('0x2a')](respondWithFilteredResult(_0x1192aa,_0x459e50))[_0x8ce9('0x4e')](handleError(_0x1192aa,null));};exports['show']=function(_0x39d639,_0x55b863){var _0x1c7413={'raw':!![],'where':{'id':_0x39d639[_0x8ce9('0x4f')]['id']}},_0x1b4865={};_0x1b4865[_0x8ce9('0x35')]=_[_0x8ce9('0x36')](db['SalesforceField'][_0x8ce9('0x32')]);_0x1b4865[_0x8ce9('0x37')]=_[_0x8ce9('0x36')](_0x39d639['query']);_0x1b4865[_0x8ce9('0x38')]=_[_0x8ce9('0x39')](_0x1b4865[_0x8ce9('0x35')],_0x1b4865[_0x8ce9('0x37')]);_0x1c7413['attributes']=_[_0x8ce9('0x39')](_0x1b4865[_0x8ce9('0x35')],qs[_0x8ce9('0x3b')](_0x39d639[_0x8ce9('0x37')]['fields']));_0x1c7413['attributes']=_0x1c7413[_0x8ce9('0x3a')]['length']?_0x1c7413['attributes']:_0x1b4865[_0x8ce9('0x35')];if(_0x39d639[_0x8ce9('0x37')][_0x8ce9('0x4a')]){_0x1c7413[_0x8ce9('0x4b')]=[{'all':!![]}];}_0x1c7413=_[_0x8ce9('0x47')]({},_0x1c7413,_0x39d639[_0x8ce9('0x48')]);return db[_0x8ce9('0x49')][_0x8ce9('0x50')](_0x1c7413)[_0x8ce9('0x2a')](handleEntityNotFound(_0x55b863,null))['then'](respondWithResult(_0x55b863,null))[_0x8ce9('0x4e')](handleError(_0x55b863,null));};exports[_0x8ce9('0x51')]=function(_0x365ece,_0x28e91a){return db[_0x8ce9('0x49')]['create'](_0x365ece[_0x8ce9('0x52')],{})[_0x8ce9('0x2a')](respondWithResult(_0x28e91a,0xc9))[_0x8ce9('0x4e')](handleError(_0x28e91a,null));};exports[_0x8ce9('0x29')]=function(_0x1465a6,_0xa55ef){if(_0x1465a6[_0x8ce9('0x52')]['id']){delete _0x1465a6[_0x8ce9('0x52')]['id'];}return db[_0x8ce9('0x49')]['find']({'where':{'id':_0x1465a6[_0x8ce9('0x4f')]['id']}})['then'](handleEntityNotFound(_0xa55ef,null))['then'](saveUpdates(_0x1465a6[_0x8ce9('0x52')],null))[_0x8ce9('0x2a')](respondWithResult(_0xa55ef,null))[_0x8ce9('0x4e')](handleError(_0xa55ef,null));};exports['destroy']=function(_0x1e4ada,_0x208e82){return db['SalesforceField'][_0x8ce9('0x50')]({'where':{'id':_0x1e4ada[_0x8ce9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x208e82,null))[_0x8ce9('0x2a')](removeEntity(_0x208e82,null))[_0x8ce9('0x4e')](handleError(_0x208e82,null));}; \ No newline at end of file +var _0xfe53=['find','create','body','destroy','eml-format','rimraf','moment','bluebird','mustache','path','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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','merge','options','findAll','rows','catch','show','params','includeAll'];(function(_0x131a00,_0x2ed574){var _0x4c053b=function(_0x251fbc){while(--_0x251fbc){_0x131a00['push'](_0x131a00['shift']());}};_0x4c053b(++_0x2ed574);}(_0xfe53,0x1a8));var _0x3fe5=function(_0x5cbace,_0x33943c){_0x5cbace=_0x5cbace-0x0;var _0x6de5b8=_0xfe53[_0x5cbace];return _0x6de5b8;};'use strict';var emlformat=require(_0x3fe5('0x0'));var rimraf=require(_0x3fe5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3fe5('0x2'));var BPromise=require(_0x3fe5('0x3'));var Mustache=require(_0x3fe5('0x4'));var util=require('util');var path=require(_0x3fe5('0x5'));var sox=require(_0x3fe5('0x6'));var csv=require(_0x3fe5('0x7'));var ejs=require(_0x3fe5('0x8'));var fs=require('fs');var fs_extra=require(_0x3fe5('0x9'));var _=require(_0x3fe5('0xa'));var squel=require(_0x3fe5('0xb'));var crypto=require(_0x3fe5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fe5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3fe5('0xe'));var Papa=require('papaparse');var Redis=require(_0x3fe5('0xf'));var authService=require(_0x3fe5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3fe5('0x11'));var logger=require(_0x3fe5('0x12'))(_0x3fe5('0x13'));var utils=require(_0x3fe5('0x14'));var config=require(_0x3fe5('0x15'));var licenseUtil=require(_0x3fe5('0x16'));var db=require(_0x3fe5('0x17'))['db'];function respondWithStatusCode(_0x2ad790,_0x2eaacf){_0x2eaacf=_0x2eaacf||0xcc;return function(_0x35a3ab){if(_0x35a3ab){return _0x2ad790[_0x3fe5('0x18')](_0x2eaacf);}return _0x2ad790[_0x3fe5('0x19')](_0x2eaacf)[_0x3fe5('0x1a')]();};}function respondWithResult(_0x592d36,_0x7a20b7){_0x7a20b7=_0x7a20b7||0xc8;return function(_0xbfb145){if(_0xbfb145){return _0x592d36[_0x3fe5('0x19')](_0x7a20b7)['json'](_0xbfb145);}};}function respondWithFilteredResult(_0x46e36d,_0x358c57){return function(_0x2e5d9e){if(_0x2e5d9e){var _0x4b7bcf=typeof _0x358c57[_0x3fe5('0x1b')]===_0x3fe5('0x1c')&&typeof _0x358c57[_0x3fe5('0x1d')]===_0x3fe5('0x1c');var _0x212f59=_0x2e5d9e[_0x3fe5('0x1e')];var _0x4264d8=_0x4b7bcf?0x0:_0x358c57[_0x3fe5('0x1b')];var _0x545059=_0x4b7bcf?_0x2e5d9e[_0x3fe5('0x1e')]:_0x358c57[_0x3fe5('0x1b')]+_0x358c57[_0x3fe5('0x1d')];var _0x2aef06;if(_0x545059>=_0x212f59){_0x545059=_0x212f59;_0x2aef06=0xc8;}else{_0x2aef06=0xce;}_0x46e36d[_0x3fe5('0x19')](_0x2aef06);return _0x46e36d['set'](_0x3fe5('0x1f'),_0x4264d8+'-'+_0x545059+'/'+_0x212f59)[_0x3fe5('0x20')](_0x2e5d9e);}return null;};}function patchUpdates(_0x5e4d4a){return function(_0x3462de){try{jsonpatch[_0x3fe5('0x21')](_0x3462de,_0x5e4d4a,!![]);}catch(_0x3c8638){return BPromise[_0x3fe5('0x22')](_0x3c8638);}return _0x3462de['save']();};}function saveUpdates(_0x146dd8,_0x50405c){return function(_0x29315d){if(_0x29315d){return _0x29315d[_0x3fe5('0x23')](_0x146dd8)[_0x3fe5('0x24')](function(_0x27a102){return _0x27a102;});}return null;};}function removeEntity(_0x363829,_0x5e1bc5){return function(_0x56e144){if(_0x56e144){return _0x56e144['destroy']()['then'](function(){_0x363829[_0x3fe5('0x19')](0xcc)[_0x3fe5('0x1a')]();});}};}function handleEntityNotFound(_0x4e4e5b,_0x870693){return function(_0x2e9c8f){if(!_0x2e9c8f){_0x4e4e5b[_0x3fe5('0x18')](0x194);}return _0x2e9c8f;};}function handleError(_0x4de969,_0x6f298b){_0x6f298b=_0x6f298b||0x1f4;return function(_0x41511f){logger['error'](_0x41511f[_0x3fe5('0x25')]);if(_0x41511f[_0x3fe5('0x26')]){delete _0x41511f['name'];}_0x4de969[_0x3fe5('0x19')](_0x6f298b)['send'](_0x41511f);};}exports[_0x3fe5('0x27')]=function(_0x576b02,_0x1cb4f4){var _0x5da3b6={},_0x187bc1={},_0x34dbbd={'count':0x0,'rows':[]};var _0x3e64ac=_[_0x3fe5('0x28')](db[_0x3fe5('0x29')][_0x3fe5('0x2a')],function(_0x9a3df6){return{'name':_0x9a3df6[_0x3fe5('0x2b')],'type':_0x9a3df6[_0x3fe5('0x2c')][_0x3fe5('0x2d')]};});_0x187bc1[_0x3fe5('0x2e')]=_[_0x3fe5('0x28')](_0x3e64ac,_0x3fe5('0x26'));_0x187bc1['query']=_[_0x3fe5('0x2f')](_0x576b02['query']);_0x187bc1[_0x3fe5('0x30')]=_[_0x3fe5('0x31')](_0x187bc1[_0x3fe5('0x2e')],_0x187bc1[_0x3fe5('0x32')]);_0x5da3b6[_0x3fe5('0x33')]=_[_0x3fe5('0x31')](_0x187bc1[_0x3fe5('0x2e')],qs[_0x3fe5('0x34')](_0x576b02[_0x3fe5('0x32')][_0x3fe5('0x34')]));_0x5da3b6[_0x3fe5('0x33')]=_0x5da3b6[_0x3fe5('0x33')][_0x3fe5('0x35')]?_0x5da3b6[_0x3fe5('0x33')]:_0x187bc1['model'];if(!_0x576b02[_0x3fe5('0x32')][_0x3fe5('0x36')]('nolimit')){_0x5da3b6[_0x3fe5('0x1d')]=qs[_0x3fe5('0x1d')](_0x576b02[_0x3fe5('0x32')][_0x3fe5('0x1d')]);_0x5da3b6[_0x3fe5('0x1b')]=qs[_0x3fe5('0x1b')](_0x576b02['query'][_0x3fe5('0x1b')]);}_0x5da3b6[_0x3fe5('0x37')]=qs['sort'](_0x576b02[_0x3fe5('0x32')][_0x3fe5('0x38')]);_0x5da3b6[_0x3fe5('0x39')]=qs[_0x3fe5('0x30')](_['pick'](_0x576b02[_0x3fe5('0x32')],_0x187bc1['filters']),_0x3e64ac);if(_0x576b02[_0x3fe5('0x32')]['filter']){_0x5da3b6[_0x3fe5('0x39')]=_[_0x3fe5('0x3a')](_0x5da3b6[_0x3fe5('0x39')],{'$or':_['map'](_0x3e64ac,function(_0x1d1546){if(_0x1d1546['type']!=='VIRTUAL'){var _0x454862={};_0x454862[_0x1d1546['name']]={'$like':'%'+_0x576b02['query']['filter']+'%'};return _0x454862;}})});}_0x5da3b6=_[_0x3fe5('0x3a')]({},_0x5da3b6,_0x576b02[_0x3fe5('0x3b')]);var _0x1da91d={'where':_0x5da3b6[_0x3fe5('0x39')]};return db[_0x3fe5('0x29')]['count'](_0x1da91d)[_0x3fe5('0x24')](function(_0x175d01){_0x34dbbd[_0x3fe5('0x1e')]=_0x175d01;if(_0x576b02['query']['includeAll']){_0x5da3b6['include']=[{'all':!![]}];}return db[_0x3fe5('0x29')][_0x3fe5('0x3c')](_0x5da3b6);})[_0x3fe5('0x24')](function(_0x10a43c){_0x34dbbd[_0x3fe5('0x3d')]=_0x10a43c;return _0x34dbbd;})['then'](respondWithFilteredResult(_0x1cb4f4,_0x5da3b6))[_0x3fe5('0x3e')](handleError(_0x1cb4f4,null));};exports[_0x3fe5('0x3f')]=function(_0x199d81,_0x561549){var _0x1407c1={'raw':!![],'where':{'id':_0x199d81[_0x3fe5('0x40')]['id']}},_0x21d3ca={};_0x21d3ca[_0x3fe5('0x2e')]=_[_0x3fe5('0x2f')](db[_0x3fe5('0x29')][_0x3fe5('0x2a')]);_0x21d3ca['query']=_[_0x3fe5('0x2f')](_0x199d81['query']);_0x21d3ca[_0x3fe5('0x30')]=_['intersection'](_0x21d3ca[_0x3fe5('0x2e')],_0x21d3ca[_0x3fe5('0x32')]);_0x1407c1['attributes']=_[_0x3fe5('0x31')](_0x21d3ca[_0x3fe5('0x2e')],qs[_0x3fe5('0x34')](_0x199d81['query'][_0x3fe5('0x34')]));_0x1407c1['attributes']=_0x1407c1[_0x3fe5('0x33')][_0x3fe5('0x35')]?_0x1407c1[_0x3fe5('0x33')]:_0x21d3ca[_0x3fe5('0x2e')];if(_0x199d81[_0x3fe5('0x32')][_0x3fe5('0x41')]){_0x1407c1['include']=[{'all':!![]}];}_0x1407c1=_['merge']({},_0x1407c1,_0x199d81[_0x3fe5('0x3b')]);return db['SalesforceField'][_0x3fe5('0x42')](_0x1407c1)['then'](handleEntityNotFound(_0x561549,null))[_0x3fe5('0x24')](respondWithResult(_0x561549,null))['catch'](handleError(_0x561549,null));};exports[_0x3fe5('0x43')]=function(_0x24d7e7,_0x4a9887){return db[_0x3fe5('0x29')][_0x3fe5('0x43')](_0x24d7e7[_0x3fe5('0x44')],{})[_0x3fe5('0x24')](respondWithResult(_0x4a9887,0xc9))[_0x3fe5('0x3e')](handleError(_0x4a9887,null));};exports[_0x3fe5('0x23')]=function(_0x32d418,_0x38cc79){if(_0x32d418['body']['id']){delete _0x32d418[_0x3fe5('0x44')]['id'];}return db['SalesforceField'][_0x3fe5('0x42')]({'where':{'id':_0x32d418[_0x3fe5('0x40')]['id']}})[_0x3fe5('0x24')](handleEntityNotFound(_0x38cc79,null))[_0x3fe5('0x24')](saveUpdates(_0x32d418[_0x3fe5('0x44')],null))[_0x3fe5('0x24')](respondWithResult(_0x38cc79,null))[_0x3fe5('0x3e')](handleError(_0x38cc79,null));};exports[_0x3fe5('0x45')]=function(_0x32eccb,_0x2f56bb){return db[_0x3fe5('0x29')][_0x3fe5('0x42')]({'where':{'id':_0x32eccb[_0x3fe5('0x40')]['id']}})[_0x3fe5('0x24')](handleEntityNotFound(_0x2f56bb,null))[_0x3fe5('0x24')](removeEntity(_0x2f56bb,null))['catch'](handleError(_0x2f56bb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 39b5801..7387f1f 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 _0x48c6=['FieldId','lodash','util','api','moment','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index'];(function(_0x378467,_0x45a682){var _0x4665b4=function(_0x33a0aa){while(--_0x33a0aa){_0x378467['push'](_0x378467['shift']());}};_0x4665b4(++_0x45a682);}(_0x48c6,0xde));var _0x648c=function(_0x469889,_0x1e640a){_0x469889=_0x469889-0x0;var _0x3e72c1=_0x48c6[_0x469889];return _0x3e72c1;};'use strict';var _=require(_0x648c('0x0'));var util=require(_0x648c('0x1'));var logger=require('../../config/logger')(_0x648c('0x2'));var moment=require(_0x648c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x648c('0x4'));var rimraf=require(_0x648c('0x5'));var config=require(_0x648c('0x6'));var attributes=require(_0x648c('0x7'));module[_0x648c('0x8')]=function(_0x488027,_0x5e281e){return _0x488027['define'](_0x648c('0x9'),attributes,{'tableName':_0x648c('0xa'),'paranoid':![],'indexes':[{'name':_0x648c('0xb'),'fields':['idField',_0x648c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf39a=['salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xf39a,0x113));var _0xaf39=function(_0x37399f,_0x3d3291){_0x37399f=_0x37399f-0x0;var _0x309ed=_0xf39a[_0x37399f];return _0x309ed;};'use strict';var _=require(_0xaf39('0x0'));var util=require(_0xaf39('0x1'));var logger=require(_0xaf39('0x2'))(_0xaf39('0x3'));var moment=require('moment');var BPromise=require(_0xaf39('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf39('0x5'));var rimraf=require('rimraf');var config=require(_0xaf39('0x6'));var attributes=require(_0xaf39('0x7'));module[_0xaf39('0x8')]=function(_0x308775,_0x59633c){return _0x308775[_0xaf39('0x9')](_0xaf39('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xaf39('0xb'),'fields':['idField',_0xaf39('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index e6f019e..7a0e24a 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 _0x0ab2=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3c4f88,_0x22bad5){var _0x1b8fc2=function(_0x2a1d7a){while(--_0x2a1d7a){_0x3c4f88['push'](_0x3c4f88['shift']());}};_0x1b8fc2(++_0x22bad5);}(_0x0ab2,0x188));var _0x20ab=function(_0x5eb66c,_0x18c1d9){_0x5eb66c=_0x5eb66c-0x0;var _0x7029f5=_0x0ab2[_0x5eb66c];return _0x7029f5;};'use strict';var _=require('lodash');var util=require(_0x20ab('0x0'));var moment=require(_0x20ab('0x1'));var BPromise=require(_0x20ab('0x2'));var rs=require(_0x20ab('0x3'));var fs=require('fs');var Redis=require(_0x20ab('0x4'));var db=require(_0x20ab('0x5'))['db'];var utils=require(_0x20ab('0x6'));var logger=require(_0x20ab('0x7'))('rpc');var config=require(_0x20ab('0x8'));var jayson=require(_0x20ab('0x9'));var client=jayson[_0x20ab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x208d11,_0x1d4be9,_0x295c83){return new BPromise(function(_0x4db30a,_0x5d5067){return client[_0x20ab('0xb')](_0x208d11,_0x295c83)[_0x20ab('0xc')](function(_0x2b176e){logger[_0x20ab('0xd')](_0x20ab('0xe'),_0x1d4be9,_0x20ab('0xf'));logger[_0x20ab('0x10')](_0x20ab('0x11'),_0x1d4be9,_0x20ab('0xf'),JSON[_0x20ab('0x12')](_0x2b176e));if(_0x2b176e[_0x20ab('0x13')]){if(_0x2b176e[_0x20ab('0x13')]['code']===0x1f4){logger[_0x20ab('0x13')](_0x20ab('0xe'),_0x1d4be9,_0x2b176e[_0x20ab('0x13')]['message']);return _0x5d5067(_0x2b176e['error'][_0x20ab('0x14')]);}logger[_0x20ab('0x13')](_0x20ab('0xe'),_0x1d4be9,_0x2b176e['error'][_0x20ab('0x14')]);return _0x4db30a(_0x2b176e[_0x20ab('0x13')][_0x20ab('0x14')]);}else{logger['info'](_0x20ab('0xe'),_0x1d4be9,'request\x20sent');_0x4db30a(_0x2b176e[_0x20ab('0x15')][_0x20ab('0x14')]);}})[_0x20ab('0x16')](function(_0x458a4f){logger[_0x20ab('0x13')](_0x20ab('0xe'),_0x1d4be9,_0x458a4f);_0x5d5067(_0x458a4f);});});} \ No newline at end of file +var _0x8d92=['SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5bbab9,_0x11c409){var _0x23f5e8=function(_0x2a12d6){while(--_0x2a12d6){_0x5bbab9['push'](_0x5bbab9['shift']());}};_0x23f5e8(++_0x11c409);}(_0x8d92,0x1b8));var _0x28d9=function(_0x4911ed,_0x476941){_0x4911ed=_0x4911ed-0x0;var _0x230288=_0x8d92[_0x4911ed];return _0x230288;};'use strict';var _=require(_0x28d9('0x0'));var util=require(_0x28d9('0x1'));var moment=require(_0x28d9('0x2'));var BPromise=require(_0x28d9('0x3'));var rs=require(_0x28d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28d9('0x5'))['db'];var utils=require(_0x28d9('0x6'));var logger=require(_0x28d9('0x7'))(_0x28d9('0x8'));var config=require(_0x28d9('0x9'));var jayson=require(_0x28d9('0xa'));var client=jayson[_0x28d9('0xb')][_0x28d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4260e8,_0x27c5e6,_0x1abdcb){return new BPromise(function(_0x5479ec,_0x4e4fa1){return client[_0x28d9('0xd')](_0x4260e8,_0x1abdcb)[_0x28d9('0xe')](function(_0x40f28a){logger[_0x28d9('0xf')](_0x28d9('0x10'),_0x27c5e6,_0x28d9('0x11'));logger['debug'](_0x28d9('0x12'),_0x27c5e6,_0x28d9('0x11'),JSON[_0x28d9('0x13')](_0x40f28a));if(_0x40f28a[_0x28d9('0x14')]){if(_0x40f28a[_0x28d9('0x14')]['code']===0x1f4){logger[_0x28d9('0x14')](_0x28d9('0x10'),_0x27c5e6,_0x40f28a[_0x28d9('0x14')][_0x28d9('0x15')]);return _0x4e4fa1(_0x40f28a[_0x28d9('0x14')]['message']);}logger[_0x28d9('0x14')](_0x28d9('0x10'),_0x27c5e6,_0x40f28a[_0x28d9('0x14')][_0x28d9('0x15')]);return _0x5479ec(_0x40f28a['error']['message']);}else{logger[_0x28d9('0xf')](_0x28d9('0x10'),_0x27c5e6,_0x28d9('0x11'));_0x5479ec(_0x40f28a[_0x28d9('0x16')][_0x28d9('0x15')]);}})[_0x28d9('0x17')](function(_0x13ce42){logger['error'](_0x28d9('0x10'),_0x27c5e6,_0x13ce42);_0x4e4fa1(_0x13ce42);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 5f5c98d..f9c0616 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 _0xb544=['/:id/fields','getFields','post','put','/:id','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/configurations','getConfigurations'];(function(_0x170b62,_0xd3886d){var _0x47fb1a=function(_0x3753eb){while(--_0x3753eb){_0x170b62['push'](_0x170b62['shift']());}};_0x47fb1a(++_0xd3886d);}(_0xb544,0xd0));var _0x4b54=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb544[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b54('0x0'));var timeout=require(_0x4b54('0x1'));var express=require(_0x4b54('0x2'));var router=express[_0x4b54('0x3')]();var fs_extra=require(_0x4b54('0x4'));var auth=require(_0x4b54('0x5'));var interaction=require(_0x4b54('0x6'));var config=require(_0x4b54('0x7'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4b54('0x8')]('/:id',auth[_0x4b54('0x9')](),controller['show']);router[_0x4b54('0x8')](_0x4b54('0xa'),auth['isAuthenticated'](),controller[_0x4b54('0xb')]);router[_0x4b54('0x8')](_0x4b54('0xc'),auth[_0x4b54('0x9')](),controller[_0x4b54('0xd')]);router[_0x4b54('0xe')]('/',auth[_0x4b54('0x9')](),controller['create']);router[_0x4b54('0xe')](_0x4b54('0xa'),auth[_0x4b54('0x9')](),controller['addConfiguration']);router[_0x4b54('0xf')](_0x4b54('0x10'),auth['isAuthenticated'](),controller[_0x4b54('0x11')]);router[_0x4b54('0x12')]('/:id',auth[_0x4b54('0x9')](),controller[_0x4b54('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4c91=['getFields','post','create','addConfiguration','put','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x1a7e16,_0x536dd4){var _0x26164c=function(_0x4b5f1a){while(--_0x4b5f1a){_0x1a7e16['push'](_0x1a7e16['shift']());}};_0x26164c(++_0x536dd4);}(_0x4c91,0x161));var _0x14c9=function(_0x4e0a93,_0x56974f){_0x4e0a93=_0x4e0a93-0x0;var _0x10964d=_0x4c91[_0x4e0a93];return _0x10964d;};'use strict';var multer=require(_0x14c9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x14c9('0x1'));var express=require(_0x14c9('0x2'));var router=express[_0x14c9('0x3')]();var fs_extra=require(_0x14c9('0x4'));var auth=require(_0x14c9('0x5'));var interaction=require(_0x14c9('0x6'));var config=require('../../config/environment');var controller=require(_0x14c9('0x7'));router[_0x14c9('0x8')]('/',auth[_0x14c9('0x9')](),controller[_0x14c9('0xa')]);router[_0x14c9('0x8')]('/:id',auth[_0x14c9('0x9')](),controller[_0x14c9('0xb')]);router[_0x14c9('0x8')](_0x14c9('0xc'),auth['isAuthenticated'](),controller[_0x14c9('0xd')]);router[_0x14c9('0x8')](_0x14c9('0xe'),auth[_0x14c9('0x9')](),controller[_0x14c9('0xf')]);router[_0x14c9('0x10')]('/',auth[_0x14c9('0x9')](),controller[_0x14c9('0x11')]);router['post']('/:id/configurations',auth[_0x14c9('0x9')](),controller[_0x14c9('0x12')]);router[_0x14c9('0x13')](_0x14c9('0x14'),auth[_0x14c9('0x9')](),controller['update']);router['delete'](_0x14c9('0x14'),auth[_0x14c9('0x9')](),controller[_0x14c9('0x15')]);module[_0x14c9('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 811fa2b..4f3ba95 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 _0x8b8a=['exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b8a,0x1b6));var _0xa8b8=function(_0x42967b,_0x3f503b){_0x42967b=_0x42967b-0x0;var _0x175420=_0x8b8a[_0x42967b];return _0x175420;};'use strict';var Sequelize=require('sequelize');module[_0xa8b8('0x0')]={'name':{'type':Sequelize[_0xa8b8('0x1')]},'description':{'type':Sequelize[_0xa8b8('0x1')]},'username':{'type':Sequelize[_0xa8b8('0x1')],'unique':_0xa8b8('0x2')},'password':{'type':Sequelize[_0xa8b8('0x1')]},'email':{'type':Sequelize[_0xa8b8('0x1')]},'remoteUri':{'type':Sequelize[_0xa8b8('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa8b8('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8192=['sequelize','exports','STRING','username','remoteUri'];(function(_0x57d46a,_0x44346e){var _0x4d0f16=function(_0x4f2fb8){while(--_0x4f2fb8){_0x57d46a['push'](_0x57d46a['shift']());}};_0x4d0f16(++_0x44346e);}(_0x8192,0x1ea));var _0x2819=function(_0x3cd9b9,_0x3a4852){_0x3cd9b9=_0x3cd9b9-0x0;var _0x5b776f=_0x8192[_0x3cd9b9];return _0x5b776f;};'use strict';var Sequelize=require(_0x2819('0x0'));module[_0x2819('0x1')]={'name':{'type':Sequelize[_0x2819('0x2')]},'description':{'type':Sequelize[_0x2819('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2819('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2819('0x2')]},'remoteUri':{'type':Sequelize[_0x2819('0x2')],'unique':_0x2819('0x4')},'serverUrl':{'type':Sequelize[_0x2819('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 4ea9d59..700dd4f 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 _0x62f0=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','rows','catch','params','create','body','find','getConfigurations','ServicenowConfiguration','rawAttributes','length','nolimit','AccountId','getSubjects','Descriptions','channel','ServicenowField','getFields','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','opened_by','user_input','sys_created_on','state','sys_created_by','knowledge','calendar_stc','delivery_plan','impact','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','reopened_by','problem_id','company','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','findOne','username','password','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','ServiceNow\x20error:\x20','statusCode','test','Wrong\x20credentials','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x126977,_0x25df7f){var _0x15e83e=function(_0xcaa3b9){while(--_0xcaa3b9){_0x126977['push'](_0x126977['shift']());}};_0x15e83e(++_0x25df7f);}(_0x62f0,0xa7));var _0x062f=function(_0x397f34,_0x3ac328){_0x397f34=_0x397f34-0x0;var _0x272cda=_0x62f0[_0x397f34];return _0x272cda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x062f('0x0'));var zipdir=require(_0x062f('0x1'));var jsonpatch=require(_0x062f('0x2'));var rp=require(_0x062f('0x3'));var moment=require('moment');var BPromise=require(_0x062f('0x4'));var Mustache=require('mustache');var util=require(_0x062f('0x5'));var path=require(_0x062f('0x6'));var sox=require('sox');var csv=require(_0x062f('0x7'));var ejs=require(_0x062f('0x8'));var fs=require('fs');var fs_extra=require(_0x062f('0x9'));var _=require(_0x062f('0xa'));var squel=require(_0x062f('0xb'));var crypto=require('crypto');var jsforce=require(_0x062f('0xc'));var deskjs=require(_0x062f('0xd'));var toCsv=require(_0x062f('0x7'));var querystring=require(_0x062f('0xe'));var Papa=require(_0x062f('0xf'));var Redis=require(_0x062f('0x10'));var authService=require(_0x062f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x062f('0x12'));var hardwareService=require(_0x062f('0x13'));var logger=require(_0x062f('0x14'))(_0x062f('0x15'));var utils=require(_0x062f('0x16'));var config=require(_0x062f('0x17'));var licenseUtil=require(_0x062f('0x18'));var db=require(_0x062f('0x19'))['db'];var integrations=require(_0x062f('0x1a'));function respondWithStatusCode(_0x21972b,_0x2970b4){_0x2970b4=_0x2970b4||0xcc;return function(_0xcca613){if(_0xcca613){return _0x21972b[_0x062f('0x1b')](_0x2970b4);}return _0x21972b[_0x062f('0x1c')](_0x2970b4)['end']();};}function respondWithResult(_0x1692b6,_0x551181){_0x551181=_0x551181||0xc8;return function(_0x4e84b7){if(_0x4e84b7){return _0x1692b6['status'](_0x551181)[_0x062f('0x1d')](_0x4e84b7);}};}function respondWithFilteredResult(_0x213755,_0x399f02){return function(_0xb09b83){if(_0xb09b83){var _0xc3ae52=typeof _0x399f02['offset']==='undefined'&&typeof _0x399f02[_0x062f('0x1e')]===_0x062f('0x1f');var _0x24a8a7=_0xb09b83[_0x062f('0x20')];var _0x25d95f=_0xc3ae52?0x0:_0x399f02['offset'];var _0x2231d6=_0xc3ae52?_0xb09b83[_0x062f('0x20')]:_0x399f02[_0x062f('0x21')]+_0x399f02[_0x062f('0x1e')];var _0x31e278;if(_0x2231d6>=_0x24a8a7){_0x2231d6=_0x24a8a7;_0x31e278=0xc8;}else{_0x31e278=0xce;}_0x213755[_0x062f('0x1c')](_0x31e278);return _0x213755[_0x062f('0x22')](_0x062f('0x23'),_0x25d95f+'-'+_0x2231d6+'/'+_0x24a8a7)['json'](_0xb09b83);}return null;};}function patchUpdates(_0x4467d1){return function(_0x45b8d0){try{jsonpatch[_0x062f('0x24')](_0x45b8d0,_0x4467d1,!![]);}catch(_0x4705fe){return BPromise[_0x062f('0x25')](_0x4705fe);}return _0x45b8d0[_0x062f('0x26')]();};}function saveUpdates(_0x3613c3,_0x4cd971){return function(_0xcf9ef9){if(_0xcf9ef9){return _0xcf9ef9[_0x062f('0x27')](_0x3613c3)[_0x062f('0x28')](function(_0x181368){return _0x181368;});}return null;};}function removeEntity(_0x216a7c,_0x929c75){return function(_0x2db404){if(_0x2db404){return _0x2db404[_0x062f('0x29')]()['then'](function(){_0x216a7c['status'](0xcc)[_0x062f('0x2a')]();});}};}function handleEntityNotFound(_0x207eda,_0x2bd6be){return function(_0x36da08){if(!_0x36da08){_0x207eda[_0x062f('0x1b')](0x194);}return _0x36da08;};}function handleError(_0x1c471d,_0x578ca5){_0x578ca5=_0x578ca5||0x1f4;return function(_0x5e1010){logger[_0x062f('0x2b')](_0x5e1010[_0x062f('0x2c')]);if(_0x5e1010['name']){delete _0x5e1010[_0x062f('0x2d')];}_0x1c471d[_0x062f('0x1c')](_0x578ca5)['send'](_0x5e1010);};}exports[_0x062f('0x2e')]=function(_0x4448df,_0x4ba127){var _0x443aef={},_0x24c8a4={},_0x21f842={'count':0x0,'rows':[]};var _0x5effe3=_['map'](db['ServicenowAccount']['rawAttributes'],function(_0x5b057a){return{'name':_0x5b057a[_0x062f('0x2f')],'type':_0x5b057a[_0x062f('0x30')][_0x062f('0x31')]};});_0x24c8a4['model']=_[_0x062f('0x32')](_0x5effe3,_0x062f('0x2d'));_0x24c8a4[_0x062f('0x33')]=_[_0x062f('0x34')](_0x4448df['query']);_0x24c8a4[_0x062f('0x35')]=_[_0x062f('0x36')](_0x24c8a4[_0x062f('0x37')],_0x24c8a4[_0x062f('0x33')]);_0x443aef['attributes']=_['intersection'](_0x24c8a4[_0x062f('0x37')],qs[_0x062f('0x38')](_0x4448df[_0x062f('0x33')][_0x062f('0x38')]));_0x443aef[_0x062f('0x39')]=_0x443aef[_0x062f('0x39')]['length']?_0x443aef[_0x062f('0x39')]:_0x24c8a4[_0x062f('0x37')];if(!_0x4448df[_0x062f('0x33')][_0x062f('0x3a')]('nolimit')){_0x443aef[_0x062f('0x1e')]=qs[_0x062f('0x1e')](_0x4448df[_0x062f('0x33')][_0x062f('0x1e')]);_0x443aef['offset']=qs[_0x062f('0x21')](_0x4448df[_0x062f('0x33')][_0x062f('0x21')]);}_0x443aef[_0x062f('0x3b')]=qs[_0x062f('0x3c')](_0x4448df[_0x062f('0x33')][_0x062f('0x3c')]);_0x443aef[_0x062f('0x3d')]=qs[_0x062f('0x35')](_[_0x062f('0x3e')](_0x4448df[_0x062f('0x33')],_0x24c8a4[_0x062f('0x35')]),_0x5effe3);if(_0x4448df[_0x062f('0x33')][_0x062f('0x3f')]){_0x443aef[_0x062f('0x3d')]=_[_0x062f('0x40')](_0x443aef['where'],{'$or':_[_0x062f('0x32')](_0x5effe3,function(_0x6f6ec1){if(_0x6f6ec1[_0x062f('0x30')]!==_0x062f('0x41')){var _0x31c2b5={};_0x31c2b5[_0x6f6ec1['name']]={'$like':'%'+_0x4448df['query'][_0x062f('0x3f')]+'%'};return _0x31c2b5;}})});}_0x443aef=_[_0x062f('0x40')]({},_0x443aef,_0x4448df[_0x062f('0x42')]);var _0x4bd5c1={'where':_0x443aef[_0x062f('0x3d')]};return db[_0x062f('0x43')][_0x062f('0x20')](_0x4bd5c1)[_0x062f('0x28')](function(_0x5bbf22){_0x21f842['count']=_0x5bbf22;if(_0x4448df[_0x062f('0x33')][_0x062f('0x44')]){_0x443aef[_0x062f('0x45')]=[{'all':!![]}];}return db[_0x062f('0x43')][_0x062f('0x46')](_0x443aef);})[_0x062f('0x28')](function(_0x24a396){_0x21f842[_0x062f('0x47')]=_0x24a396;return _0x21f842;})[_0x062f('0x28')](respondWithFilteredResult(_0x4ba127,_0x443aef))[_0x062f('0x48')](handleError(_0x4ba127,null));};exports['show']=function(_0xcce76e,_0x47a948){var _0x221ac5={'raw':![],'where':{'id':_0xcce76e[_0x062f('0x49')]['id']}},_0x399739={};_0x399739[_0x062f('0x37')]=_[_0x062f('0x34')](db[_0x062f('0x43')]['rawAttributes']);_0x399739[_0x062f('0x33')]=_[_0x062f('0x34')](_0xcce76e[_0x062f('0x33')]);_0x399739[_0x062f('0x35')]=_[_0x062f('0x36')](_0x399739[_0x062f('0x37')],_0x399739[_0x062f('0x33')]);_0x221ac5[_0x062f('0x39')]=_[_0x062f('0x36')](_0x399739[_0x062f('0x37')],qs[_0x062f('0x38')](_0xcce76e['query'][_0x062f('0x38')]));_0x221ac5[_0x062f('0x39')]=_0x221ac5[_0x062f('0x39')]['length']?_0x221ac5[_0x062f('0x39')]:_0x399739[_0x062f('0x37')];if(_0xcce76e[_0x062f('0x33')][_0x062f('0x44')]){_0x221ac5['include']=[{'all':!![]}];}_0x221ac5=_[_0x062f('0x40')]({},_0x221ac5,_0xcce76e[_0x062f('0x42')]);return db[_0x062f('0x43')]['find'](_0x221ac5)[_0x062f('0x28')](handleEntityNotFound(_0x47a948,null))[_0x062f('0x28')](respondWithResult(_0x47a948,null))['catch'](handleError(_0x47a948,null));};exports[_0x062f('0x4a')]=function(_0x277ca3,_0x15a5eb){return db[_0x062f('0x43')]['create'](_0x277ca3[_0x062f('0x4b')],{})[_0x062f('0x28')](respondWithResult(_0x15a5eb,0xc9))[_0x062f('0x48')](handleError(_0x15a5eb,null));};exports[_0x062f('0x27')]=function(_0x38ec05,_0x5373de){if(_0x38ec05[_0x062f('0x4b')]['id']){delete _0x38ec05[_0x062f('0x4b')]['id'];}return db[_0x062f('0x43')][_0x062f('0x4c')]({'where':{'id':_0x38ec05[_0x062f('0x49')]['id']}})['then'](handleEntityNotFound(_0x5373de,null))[_0x062f('0x28')](saveUpdates(_0x38ec05[_0x062f('0x4b')],null))[_0x062f('0x28')](respondWithResult(_0x5373de,null))[_0x062f('0x48')](handleError(_0x5373de,null));};exports['destroy']=function(_0x43ded0,_0x5910f2){return db[_0x062f('0x43')][_0x062f('0x4c')]({'where':{'id':_0x43ded0[_0x062f('0x49')]['id']}})[_0x062f('0x28')](handleEntityNotFound(_0x5910f2,null))[_0x062f('0x28')](removeEntity(_0x5910f2,null))[_0x062f('0x48')](handleError(_0x5910f2,null));};exports[_0x062f('0x4d')]=function(_0x41128e,_0x153609,_0x5063bf){var _0x1b9bd2={};var _0x54f600={};var _0x434050;var _0x3a6dcd;return db[_0x062f('0x43')]['findOne']({'where':{'id':_0x41128e['params']['id']}})['then'](handleEntityNotFound(_0x153609,null))[_0x062f('0x28')](function(_0x78d7d5){if(_0x78d7d5){_0x434050=_0x78d7d5;_0x54f600[_0x062f('0x37')]=_[_0x062f('0x34')](db[_0x062f('0x4e')][_0x062f('0x4f')]);_0x54f600['query']=_['keys'](_0x41128e[_0x062f('0x33')]);_0x54f600[_0x062f('0x35')]=_[_0x062f('0x36')](_0x54f600[_0x062f('0x37')],_0x54f600[_0x062f('0x33')]);_0x1b9bd2[_0x062f('0x39')]=_[_0x062f('0x36')](_0x54f600[_0x062f('0x37')],qs[_0x062f('0x38')](_0x41128e[_0x062f('0x33')][_0x062f('0x38')]));_0x1b9bd2['attributes']=_0x1b9bd2[_0x062f('0x39')]['length']?_0x1b9bd2['attributes']:_0x54f600[_0x062f('0x37')];_0x1b9bd2['order']=qs['sort'](_0x41128e[_0x062f('0x33')]['sort']);_0x1b9bd2[_0x062f('0x3d')]=qs[_0x062f('0x35')](_[_0x062f('0x3e')](_0x41128e['query'],_0x54f600[_0x062f('0x35')]));if(_0x41128e['query'][_0x062f('0x3f')]){_0x1b9bd2[_0x062f('0x3d')]=_[_0x062f('0x40')](_0x1b9bd2['where'],{'$or':_[_0x062f('0x32')](_0x1b9bd2[_0x062f('0x39')],function(_0x5c2f87){var _0xe4f3e={};_0xe4f3e[_0x5c2f87]={'$like':'%'+_0x41128e[_0x062f('0x33')][_0x062f('0x3f')]+'%'};return _0xe4f3e;})});}_0x1b9bd2=_[_0x062f('0x40')]({},_0x1b9bd2,_0x41128e[_0x062f('0x42')]);return _0x434050[_0x062f('0x4d')](_0x1b9bd2);}})[_0x062f('0x28')](function(_0x5c8260){if(_0x5c8260){_0x3a6dcd=_0x5c8260[_0x062f('0x50')];if(!_0x41128e[_0x062f('0x33')]['hasOwnProperty'](_0x062f('0x51'))){_0x1b9bd2['limit']=qs['limit'](_0x41128e[_0x062f('0x33')][_0x062f('0x1e')]);_0x1b9bd2[_0x062f('0x21')]=qs[_0x062f('0x21')](_0x41128e[_0x062f('0x33')][_0x062f('0x21')]);}return _0x434050[_0x062f('0x4d')](_0x1b9bd2);}})[_0x062f('0x28')](function(_0xb0d46b){if(_0xb0d46b){return _0xb0d46b?{'count':_0x3a6dcd,'rows':_0xb0d46b}:null;}})[_0x062f('0x28')](respondWithResult(_0x153609,null))[_0x062f('0x48')](handleError(_0x153609,null));};exports['addConfiguration']=function(_0x3281e6,_0x37537b,_0x4d85ab){if(_0x3281e6[_0x062f('0x4b')]['id']){delete _0x3281e6[_0x062f('0x4b')]['id'];}return db[_0x062f('0x43')]['findOne']({'where':{'id':_0x3281e6[_0x062f('0x49')]['id']}})[_0x062f('0x28')](handleEntityNotFound(_0x37537b,null))[_0x062f('0x28')](function(_0x5b5bdd){if(_0x5b5bdd){_0x3281e6[_0x062f('0x4b')][_0x062f('0x52')]=_0x5b5bdd['id'];_0x3281e6[_0x062f('0x4b')]['Subjects']=integrations[_0x062f('0x53')](_0x3281e6[_0x062f('0x4b')]['channel'],_0x3281e6[_0x062f('0x4b')][_0x062f('0x30')]);_0x3281e6[_0x062f('0x4b')][_0x062f('0x54')]=integrations['getDescriptions'](_0x3281e6['body'][_0x062f('0x55')],_0x3281e6[_0x062f('0x4b')][_0x062f('0x30')]);return db[_0x062f('0x4e')][_0x062f('0x4a')](_0x3281e6['body'],{'include':[{'model':db[_0x062f('0x56')],'as':'Subjects'},{'model':db[_0x062f('0x56')],'as':_0x062f('0x54')}]});}return null;})['then'](respondWithResult(_0x37537b,null))[_0x062f('0x48')](handleError(_0x37537b,null));};exports[_0x062f('0x57')]=function(_0x5bc56d,_0x33b886,_0x358cf7){var _0x55da14=['made_sla',_0x062f('0x58'),'knowledge',_0x062f('0x59'),_0x062f('0x5a'),_0x062f('0x5b'),_0x062f('0x5c'),_0x062f('0x5d'),_0x062f('0x5e')];var _0x41aa93=[_0x062f('0x5f'),'made_sla',_0x062f('0x60'),'watch_list',_0x062f('0x61'),_0x062f('0x62'),_0x062f('0x63'),'hold_reason',_0x062f('0x64'),'number','resolved_by','sys_updated_by',_0x062f('0x65'),_0x062f('0x66'),_0x062f('0x67'),'sys_domain',_0x062f('0x68'),_0x062f('0x69'),_0x062f('0x6a'),_0x062f('0x3b'),_0x062f('0x6b'),'closed_at','cmdb_ci',_0x062f('0x6c'),_0x062f('0x6d'),'active',_0x062f('0x6e'),_0x062f('0x6f'),'priority',_0x062f('0x70'),_0x062f('0x71'),_0x062f('0x72'),_0x062f('0x73'),_0x062f('0x74'),_0x062f('0x75'),_0x062f('0x76'),_0x062f('0x77'),_0x062f('0x78'),_0x062f('0x79'),'caller_id',_0x062f('0x7a'),_0x062f('0x59'),_0x062f('0x7b'),_0x062f('0x7c'),'close_code',_0x062f('0x7d'),_0x062f('0x7e'),_0x062f('0x7f'),_0x062f('0x80'),_0x062f('0x81'),'additional_assignee_list',_0x062f('0x82'),_0x062f('0x83'),_0x062f('0x5b'),_0x062f('0x84'),'close_notes',_0x062f('0x85'),_0x062f('0x86'),_0x062f('0x87'),_0x062f('0x88'),'contact_type',_0x062f('0x89'),_0x062f('0x5c'),'urgency',_0x062f('0x8a'),_0x062f('0x8b'),'reassignment_count','activity_due',_0x062f('0x8c'),'severity',_0x062f('0x8d'),'sla_due',_0x062f('0x8e'),_0x062f('0x8f'),_0x062f('0x90'),_0x062f('0x91'),_0x062f('0x92'),_0x062f('0x93'),_0x062f('0x94'),_0x062f('0x95'),_0x062f('0x96'),_0x062f('0x97'),_0x062f('0x5e')];var _0x236019='';var _0x29fb4b='';var _0x5cb4f3=[];var _0x437777='';var _0x7dedcf='';var _0x2edbd5=[];var _0x267ecd='';var _0x2bc81f='';var _0x398848={};var _0x1749b0='';return db[_0x062f('0x43')][_0x062f('0x98')]({'where':{'id':_0x5bc56d['params']['id']},'attributes':['id',_0x062f('0x99'),_0x062f('0x9a'),'email',_0x062f('0x9b'),'serverUrl']})['then'](handleEntityNotFound(_0x33b886,null))[_0x062f('0x28')](function(_0x1d0ea4){if(_0x1d0ea4){_0x1749b0=_0x1d0ea4['remoteUri'];var _0x53d09d=_0x1749b0[_0x062f('0x9c')](-0x1);if(_0x53d09d==='/'){_0x1749b0=_0x1749b0['substring'](0x0,_0x1749b0[_0x062f('0x9d')](_0x53d09d));}_0x2bc81f=util[_0x062f('0x9e')](_0x062f('0x9f'),_0x1749b0);_0x267ecd=util[_0x062f('0x9e')]('%s/api/now/table/',_0x1749b0);_0x398848={'user':_0x1d0ea4['username'],'pass':_0x1d0ea4['password']};var _0x2c3545={'method':_0x062f('0xa0'),'uri':_0x2bc81f+_0x062f('0xa1'),'auth':_0x398848,'json':!![]};return rp(_0x2c3545);}})[_0x062f('0x28')](function(_0xc608c){if(_0xc608c[_0x062f('0xa2')][_0x062f('0x50')]>0x0){_0x236019=_0xc608c[_0x062f('0xa2')];}console[_0x062f('0xa3')](_0x062f('0xa4'),_0x236019);_0x2edbd5=[];_0x29fb4b=Object[_0x062f('0xa5')]([],_0x236019);_[_0x062f('0xa6')](_0x29fb4b,function(_0x494c4c){return!_0x55da14[_0x062f('0xa7')](_0x494c4c[_0x062f('0x2d')]);});_0x29fb4b[_0x062f('0xa8')](function(_0x238c1d){var _0x32031c=createFieldObject(_0x267ecd,_0x398848,_0x238c1d['internalType'],_0x238c1d[_0x062f('0x2d')],_0x238c1d[_0x062f('0xa9')],![]);_0x2edbd5[_0x062f('0xaa')](_0x32031c);});return Promise[_0x062f('0xab')](_0x2edbd5);})[_0x062f('0x28')](function(_0x267cb5){_0x5cb4f3=_0x267cb5;_0x437777=Object[_0x062f('0xa5')]([],_0x236019);console[_0x062f('0xa3')](_0x062f('0xac'),_0x236019);_[_0x062f('0xa6')](_0x437777,function(_0x943c2f){return _0x41aa93[_0x062f('0xa7')](_0x943c2f[_0x062f('0x2d')]);});console['log'](_0x062f('0xad'),_0x437777);_0x2edbd5=[];_0x437777[_0x062f('0xa8')](function(_0x42b216){var _0x2b1f33=createFieldObject(_0x267ecd,_0x398848,_0x42b216[_0x062f('0xae')],_0x42b216[_0x062f('0x2d')],_0x42b216[_0x062f('0xa9')],!![]);_0x2edbd5[_0x062f('0xaa')](_0x2b1f33);});return Promise[_0x062f('0xab')](_0x2edbd5);})[_0x062f('0x28')](function(_0x5d00c5){_0x7dedcf=_0x5d00c5;var _0x5d6d2b=_0x5cb4f3[_0x062f('0xaf')](_0x7dedcf);return{'count':_0x5d6d2b[_0x062f('0x50')],'rows':_0x5d6d2b};})[_0x062f('0x28')](respondWithResult(_0x33b886,null))[_0x062f('0x48')](function(_0x32145c){console[_0x062f('0xa3')](_0x062f('0xb0')+_0x32145c);var _0xdb5d60=_0x5bc56d[_0x062f('0x33')]['test']?0x1f4:_0x32145c[_0x062f('0xb1')]||0x1f4;logger['error'](_0x32145c[_0x062f('0x2c')]);delete _0x32145c[_0x062f('0x2d')];if(_0xdb5d60===0x191){_0xdb5d60=0x190;}_0x33b886['status'](_0xdb5d60)['send'](_0x5bc56d['query'][_0x062f('0xb2')]?{'message':_0x062f('0xb3'),'statusCode':_0x32145c['statusCode']}:_0x32145c);});};function createFieldObject(_0x4253c9,_0x597379,_0x1f6343,_0x130557,_0x449149,_0x5b32fa){return new Promise(function(_0x353719,_0x52c488){var _0x1ea172={'id':_0x130557,'name':_0x449149,'custom':_0x5b32fa};if(_0x1f6343==='boolean'){_0x1ea172[_0x062f('0x42')]=[{'name':'True','value':'true'},{'name':_0x062f('0xb4'),'value':_0x062f('0xb5')}];_0x353719(_0x1ea172);}else{var _0x2770c7={'method':_0x062f('0xa0'),'uri':_0x4253c9+_0x062f('0xb6')+_0x130557,'auth':_0x597379,'json':!![]};return rp(_0x2770c7)[_0x062f('0x28')](function(_0x4b6237){var _0x4052a5=[];if(_0x4b6237['result'][_0x062f('0x50')]>0x0){_0x4b6237['result'][_0x062f('0xa8')](function(_0x5d6ad2){if(_0x5d6ad2[_0x062f('0xb7')]===_0x062f('0xb5')){var _0x2511db={'name':_0x5d6ad2['label'],'value':_0x5d6ad2[_0x062f('0xb8')]};_0x4052a5[_0x062f('0xaa')](_0x2511db);}});}_0x1ea172['options']=_0x4052a5;if(_0x1ea172[_0x062f('0x42')]['length']>0x0){_0x353719(_0x1ea172);}else{if(_0x5b32fa==![]){_0x353719();}else{_0x353719(_0x1ea172);}}});}});} \ No newline at end of file +var _0x2af8=['save','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','rows','show','params','keys','find','catch','create','body','getConfigurations','findOne','ServicenowConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','incident_state','category','parent','caused_by','watch_list','sys_updated_on','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','calendar_stc','closed_at','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','follow_up','parent_incident','sys_id','reopened_by','urgency','company','reassignment_count','assigned_to','severity','comments','sla_due','approval','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','true','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject'];(function(_0x1b7f95,_0x4bdec0){var _0x2b5559=function(_0x4c8446){while(--_0x4c8446){_0x1b7f95['push'](_0x1b7f95['shift']());}};_0x2b5559(++_0x4bdec0);}(_0x2af8,0x92));var _0x82af=function(_0x37ad55,_0x514ece){_0x37ad55=_0x37ad55-0x0;var _0x4b899f=_0x2af8[_0x37ad55];return _0x4b899f;};'use strict';var emlformat=require(_0x82af('0x0'));var rimraf=require(_0x82af('0x1'));var zipdir=require(_0x82af('0x2'));var jsonpatch=require(_0x82af('0x3'));var rp=require('request-promise');var moment=require(_0x82af('0x4'));var BPromise=require(_0x82af('0x5'));var Mustache=require(_0x82af('0x6'));var util=require(_0x82af('0x7'));var path=require('path');var sox=require(_0x82af('0x8'));var csv=require('to-csv');var ejs=require(_0x82af('0x9'));var fs=require('fs');var fs_extra=require(_0x82af('0xa'));var _=require(_0x82af('0xb'));var squel=require(_0x82af('0xc'));var crypto=require(_0x82af('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x82af('0xe'));var toCsv=require('to-csv');var querystring=require(_0x82af('0xf'));var Papa=require(_0x82af('0x10'));var Redis=require(_0x82af('0x11'));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(_0x82af('0x12'))(_0x82af('0x13'));var utils=require(_0x82af('0x14'));var config=require(_0x82af('0x15'));var licenseUtil=require(_0x82af('0x16'));var db=require(_0x82af('0x17'))['db'];var integrations=require(_0x82af('0x18'));function respondWithStatusCode(_0xe8723,_0x3bd424){_0x3bd424=_0x3bd424||0xcc;return function(_0x434968){if(_0x434968){return _0xe8723['sendStatus'](_0x3bd424);}return _0xe8723[_0x82af('0x19')](_0x3bd424)[_0x82af('0x1a')]();};}function respondWithResult(_0x4f177a,_0x1ebb75){_0x1ebb75=_0x1ebb75||0xc8;return function(_0x505077){if(_0x505077){return _0x4f177a['status'](_0x1ebb75)['json'](_0x505077);}};}function respondWithFilteredResult(_0x2df7cd,_0x10ea50){return function(_0x402811){if(_0x402811){var _0x1908e8=typeof _0x10ea50[_0x82af('0x1b')]==='undefined'&&typeof _0x10ea50[_0x82af('0x1c')]===_0x82af('0x1d');var _0x53959d=_0x402811[_0x82af('0x1e')];var _0x31257a=_0x1908e8?0x0:_0x10ea50[_0x82af('0x1b')];var _0x291dcd=_0x1908e8?_0x402811['count']:_0x10ea50[_0x82af('0x1b')]+_0x10ea50[_0x82af('0x1c')];var _0x1a37f5;if(_0x291dcd>=_0x53959d){_0x291dcd=_0x53959d;_0x1a37f5=0xc8;}else{_0x1a37f5=0xce;}_0x2df7cd[_0x82af('0x19')](_0x1a37f5);return _0x2df7cd[_0x82af('0x1f')](_0x82af('0x20'),_0x31257a+'-'+_0x291dcd+'/'+_0x53959d)[_0x82af('0x21')](_0x402811);}return null;};}function patchUpdates(_0xec1f47){return function(_0x401d54){try{jsonpatch[_0x82af('0x22')](_0x401d54,_0xec1f47,!![]);}catch(_0x196070){return BPromise[_0x82af('0x23')](_0x196070);}return _0x401d54[_0x82af('0x24')]();};}function saveUpdates(_0x2bc548,_0x5d7887){return function(_0x5823d){if(_0x5823d){return _0x5823d['update'](_0x2bc548)[_0x82af('0x25')](function(_0x28e2c5){return _0x28e2c5;});}return null;};}function removeEntity(_0x15af4e,_0x10ef03){return function(_0x505582){if(_0x505582){return _0x505582[_0x82af('0x26')]()[_0x82af('0x25')](function(){_0x15af4e[_0x82af('0x19')](0xcc)[_0x82af('0x1a')]();});}};}function handleEntityNotFound(_0x15c95b,_0x4917b4){return function(_0x40257d){if(!_0x40257d){_0x15c95b['sendStatus'](0x194);}return _0x40257d;};}function handleError(_0x23d8d5,_0x51b2c6){_0x51b2c6=_0x51b2c6||0x1f4;return function(_0x2100bf){logger[_0x82af('0x27')](_0x2100bf[_0x82af('0x28')]);if(_0x2100bf[_0x82af('0x29')]){delete _0x2100bf[_0x82af('0x29')];}_0x23d8d5['status'](_0x51b2c6)[_0x82af('0x2a')](_0x2100bf);};}exports['index']=function(_0x28744e,_0x5d60d5){var _0x255d05={},_0x5c5aea={},_0x2a7cf3={'count':0x0,'rows':[]};var _0x5947c1=_['map'](db['ServicenowAccount'][_0x82af('0x2b')],function(_0x33a71c){return{'name':_0x33a71c[_0x82af('0x2c')],'type':_0x33a71c[_0x82af('0x2d')][_0x82af('0x2e')]};});_0x5c5aea[_0x82af('0x2f')]=_[_0x82af('0x30')](_0x5947c1,_0x82af('0x29'));_0x5c5aea[_0x82af('0x31')]=_['keys'](_0x28744e[_0x82af('0x31')]);_0x5c5aea['filters']=_[_0x82af('0x32')](_0x5c5aea[_0x82af('0x2f')],_0x5c5aea[_0x82af('0x31')]);_0x255d05[_0x82af('0x33')]=_[_0x82af('0x32')](_0x5c5aea['model'],qs[_0x82af('0x34')](_0x28744e[_0x82af('0x31')][_0x82af('0x34')]));_0x255d05[_0x82af('0x33')]=_0x255d05[_0x82af('0x33')][_0x82af('0x35')]?_0x255d05[_0x82af('0x33')]:_0x5c5aea['model'];if(!_0x28744e[_0x82af('0x31')][_0x82af('0x36')](_0x82af('0x37'))){_0x255d05[_0x82af('0x1c')]=qs['limit'](_0x28744e[_0x82af('0x31')][_0x82af('0x1c')]);_0x255d05[_0x82af('0x1b')]=qs[_0x82af('0x1b')](_0x28744e[_0x82af('0x31')]['offset']);}_0x255d05[_0x82af('0x38')]=qs[_0x82af('0x39')](_0x28744e[_0x82af('0x31')][_0x82af('0x39')]);_0x255d05[_0x82af('0x3a')]=qs[_0x82af('0x3b')](_[_0x82af('0x3c')](_0x28744e[_0x82af('0x31')],_0x5c5aea[_0x82af('0x3b')]),_0x5947c1);if(_0x28744e['query'][_0x82af('0x3d')]){_0x255d05[_0x82af('0x3a')]=_[_0x82af('0x3e')](_0x255d05[_0x82af('0x3a')],{'$or':_[_0x82af('0x30')](_0x5947c1,function(_0x34f0e0){if(_0x34f0e0['type']!==_0x82af('0x3f')){var _0x5d0933={};_0x5d0933[_0x34f0e0[_0x82af('0x29')]]={'$like':'%'+_0x28744e['query'][_0x82af('0x3d')]+'%'};return _0x5d0933;}})});}_0x255d05=_['merge']({},_0x255d05,_0x28744e[_0x82af('0x40')]);var _0x23b1ce={'where':_0x255d05['where']};return db[_0x82af('0x41')][_0x82af('0x1e')](_0x23b1ce)[_0x82af('0x25')](function(_0x2f3f88){_0x2a7cf3[_0x82af('0x1e')]=_0x2f3f88;if(_0x28744e[_0x82af('0x31')][_0x82af('0x42')]){_0x255d05[_0x82af('0x43')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x255d05);})['then'](function(_0x3937fd){_0x2a7cf3[_0x82af('0x44')]=_0x3937fd;return _0x2a7cf3;})[_0x82af('0x25')](respondWithFilteredResult(_0x5d60d5,_0x255d05))['catch'](handleError(_0x5d60d5,null));};exports[_0x82af('0x45')]=function(_0x353d44,_0x5b6b94){var _0x57fc2e={'raw':![],'where':{'id':_0x353d44[_0x82af('0x46')]['id']}},_0x451a77={};_0x451a77[_0x82af('0x2f')]=_[_0x82af('0x47')](db[_0x82af('0x41')][_0x82af('0x2b')]);_0x451a77['query']=_[_0x82af('0x47')](_0x353d44[_0x82af('0x31')]);_0x451a77[_0x82af('0x3b')]=_[_0x82af('0x32')](_0x451a77[_0x82af('0x2f')],_0x451a77[_0x82af('0x31')]);_0x57fc2e[_0x82af('0x33')]=_['intersection'](_0x451a77['model'],qs[_0x82af('0x34')](_0x353d44[_0x82af('0x31')][_0x82af('0x34')]));_0x57fc2e[_0x82af('0x33')]=_0x57fc2e[_0x82af('0x33')][_0x82af('0x35')]?_0x57fc2e[_0x82af('0x33')]:_0x451a77[_0x82af('0x2f')];if(_0x353d44[_0x82af('0x31')][_0x82af('0x42')]){_0x57fc2e[_0x82af('0x43')]=[{'all':!![]}];}_0x57fc2e=_[_0x82af('0x3e')]({},_0x57fc2e,_0x353d44[_0x82af('0x40')]);return db[_0x82af('0x41')][_0x82af('0x48')](_0x57fc2e)[_0x82af('0x25')](handleEntityNotFound(_0x5b6b94,null))['then'](respondWithResult(_0x5b6b94,null))[_0x82af('0x49')](handleError(_0x5b6b94,null));};exports[_0x82af('0x4a')]=function(_0x4409fe,_0x4489e8){return db[_0x82af('0x41')][_0x82af('0x4a')](_0x4409fe[_0x82af('0x4b')],{})[_0x82af('0x25')](respondWithResult(_0x4489e8,0xc9))[_0x82af('0x49')](handleError(_0x4489e8,null));};exports['update']=function(_0xa2ef05,_0x4868f6){if(_0xa2ef05[_0x82af('0x4b')]['id']){delete _0xa2ef05[_0x82af('0x4b')]['id'];}return db[_0x82af('0x41')][_0x82af('0x48')]({'where':{'id':_0xa2ef05[_0x82af('0x46')]['id']}})[_0x82af('0x25')](handleEntityNotFound(_0x4868f6,null))[_0x82af('0x25')](saveUpdates(_0xa2ef05[_0x82af('0x4b')],null))[_0x82af('0x25')](respondWithResult(_0x4868f6,null))[_0x82af('0x49')](handleError(_0x4868f6,null));};exports[_0x82af('0x26')]=function(_0xe76155,_0x1bbdc7){return db[_0x82af('0x41')][_0x82af('0x48')]({'where':{'id':_0xe76155[_0x82af('0x46')]['id']}})[_0x82af('0x25')](handleEntityNotFound(_0x1bbdc7,null))[_0x82af('0x25')](removeEntity(_0x1bbdc7,null))['catch'](handleError(_0x1bbdc7,null));};exports[_0x82af('0x4c')]=function(_0x4e7905,_0x574e6d,_0x30fb81){var _0x306f51={};var _0x35d6f9={};var _0x344996;var _0x54aa95;return db[_0x82af('0x41')][_0x82af('0x4d')]({'where':{'id':_0x4e7905[_0x82af('0x46')]['id']}})[_0x82af('0x25')](handleEntityNotFound(_0x574e6d,null))['then'](function(_0x112bdd){if(_0x112bdd){_0x344996=_0x112bdd;_0x35d6f9[_0x82af('0x2f')]=_[_0x82af('0x47')](db[_0x82af('0x4e')]['rawAttributes']);_0x35d6f9[_0x82af('0x31')]=_[_0x82af('0x47')](_0x4e7905[_0x82af('0x31')]);_0x35d6f9['filters']=_[_0x82af('0x32')](_0x35d6f9[_0x82af('0x2f')],_0x35d6f9[_0x82af('0x31')]);_0x306f51[_0x82af('0x33')]=_[_0x82af('0x32')](_0x35d6f9[_0x82af('0x2f')],qs[_0x82af('0x34')](_0x4e7905[_0x82af('0x31')][_0x82af('0x34')]));_0x306f51[_0x82af('0x33')]=_0x306f51['attributes'][_0x82af('0x35')]?_0x306f51[_0x82af('0x33')]:_0x35d6f9[_0x82af('0x2f')];_0x306f51[_0x82af('0x38')]=qs[_0x82af('0x39')](_0x4e7905[_0x82af('0x31')][_0x82af('0x39')]);_0x306f51['where']=qs['filters'](_['pick'](_0x4e7905[_0x82af('0x31')],_0x35d6f9[_0x82af('0x3b')]));if(_0x4e7905[_0x82af('0x31')]['filter']){_0x306f51[_0x82af('0x3a')]=_[_0x82af('0x3e')](_0x306f51[_0x82af('0x3a')],{'$or':_[_0x82af('0x30')](_0x306f51[_0x82af('0x33')],function(_0x14f9b6){var _0x55805d={};_0x55805d[_0x14f9b6]={'$like':'%'+_0x4e7905[_0x82af('0x31')][_0x82af('0x3d')]+'%'};return _0x55805d;})});}_0x306f51=_['merge']({},_0x306f51,_0x4e7905[_0x82af('0x40')]);return _0x344996['getConfigurations'](_0x306f51);}})['then'](function(_0x3759c7){if(_0x3759c7){_0x54aa95=_0x3759c7[_0x82af('0x35')];if(!_0x4e7905[_0x82af('0x31')][_0x82af('0x36')](_0x82af('0x37'))){_0x306f51['limit']=qs[_0x82af('0x1c')](_0x4e7905['query'][_0x82af('0x1c')]);_0x306f51[_0x82af('0x1b')]=qs[_0x82af('0x1b')](_0x4e7905[_0x82af('0x31')][_0x82af('0x1b')]);}return _0x344996[_0x82af('0x4c')](_0x306f51);}})[_0x82af('0x25')](function(_0x2d62b8){if(_0x2d62b8){return _0x2d62b8?{'count':_0x54aa95,'rows':_0x2d62b8}:null;}})['then'](respondWithResult(_0x574e6d,null))[_0x82af('0x49')](handleError(_0x574e6d,null));};exports['addConfiguration']=function(_0x447432,_0x132a5d,_0x1aa626){if(_0x447432[_0x82af('0x4b')]['id']){delete _0x447432['body']['id'];}return db[_0x82af('0x41')][_0x82af('0x4d')]({'where':{'id':_0x447432[_0x82af('0x46')]['id']}})['then'](handleEntityNotFound(_0x132a5d,null))[_0x82af('0x25')](function(_0x1bf023){if(_0x1bf023){_0x447432['body'][_0x82af('0x4f')]=_0x1bf023['id'];_0x447432[_0x82af('0x4b')][_0x82af('0x50')]=integrations[_0x82af('0x51')](_0x447432[_0x82af('0x4b')][_0x82af('0x52')],_0x447432[_0x82af('0x4b')][_0x82af('0x2d')]);_0x447432[_0x82af('0x4b')][_0x82af('0x53')]=integrations['getDescriptions'](_0x447432[_0x82af('0x4b')][_0x82af('0x52')],_0x447432[_0x82af('0x4b')][_0x82af('0x2d')]);return db['ServicenowConfiguration'][_0x82af('0x4a')](_0x447432[_0x82af('0x4b')],{'include':[{'model':db[_0x82af('0x54')],'as':_0x82af('0x50')},{'model':db['ServicenowField'],'as':_0x82af('0x53')}]});}return null;})[_0x82af('0x25')](respondWithResult(_0x132a5d,null))[_0x82af('0x49')](handleError(_0x132a5d,null));};exports[_0x82af('0x55')]=function(_0x3ce9ef,_0x34f009,_0x534b19){var _0x3e252b=[_0x82af('0x56'),_0x82af('0x57'),_0x82af('0x58'),'subcategory',_0x82af('0x59'),'notify',_0x82af('0x5a'),'severity',_0x82af('0x5b')];var _0x1233eb=[_0x82af('0x5c'),'made_sla',_0x82af('0x5d'),_0x82af('0x5e'),'upon_reject',_0x82af('0x5f'),'child_incidents',_0x82af('0x57'),_0x82af('0x60'),'number',_0x82af('0x61'),_0x82af('0x62'),_0x82af('0x63'),_0x82af('0x64'),_0x82af('0x65'),'sys_domain',_0x82af('0x66'),'sys_created_by',_0x82af('0x58'),_0x82af('0x38'),_0x82af('0x67'),_0x82af('0x68'),'cmdb_ci',_0x82af('0x69'),_0x82af('0x6a'),_0x82af('0x6b'),'work_notes_list',_0x82af('0x6c'),_0x82af('0x6d'),_0x82af('0x6e'),_0x82af('0x6f'),_0x82af('0x70'),'expected_start',_0x82af('0x71'),'business_duration',_0x82af('0x72'),_0x82af('0x73'),_0x82af('0x74'),_0x82af('0x75'),'caller_id',_0x82af('0x76'),'subcategory',_0x82af('0x77'),_0x82af('0x78'),_0x82af('0x59'),_0x82af('0x79'),'delivery_task',_0x82af('0x7a'),_0x82af('0x7b'),_0x82af('0x7c'),_0x82af('0x7d'),_0x82af('0x7e'),_0x82af('0x7f'),_0x82af('0x80'),_0x82af('0x81'),'close_notes','closed_by',_0x82af('0x82'),_0x82af('0x83'),_0x82af('0x84'),'contact_type',_0x82af('0x85'),'incident_state',_0x82af('0x86'),'problem_id',_0x82af('0x87'),_0x82af('0x88'),'activity_due',_0x82af('0x89'),_0x82af('0x8a'),_0x82af('0x8b'),_0x82af('0x8c'),_0x82af('0x8d'),'comments_and_work_notes',_0x82af('0x8e'),'sys_mod_count',_0x82af('0x8f'),_0x82af('0x90'),_0x82af('0x91'),_0x82af('0x92'),_0x82af('0x93'),_0x82af('0x94'),_0x82af('0x5b')];var _0x43d13c='';var _0x4e4f96='';var _0x4c4ff7=[];var _0x563a99='';var _0x5b1762='';var _0x3a1bfa=[];var _0x27453d='';var _0x38658d='';var _0x429133={};var _0x244d2f='';return db[_0x82af('0x41')][_0x82af('0x4d')]({'where':{'id':_0x3ce9ef[_0x82af('0x46')]['id']},'attributes':['id',_0x82af('0x95'),_0x82af('0x96'),_0x82af('0x97'),_0x82af('0x98'),_0x82af('0x99')]})[_0x82af('0x25')](handleEntityNotFound(_0x34f009,null))['then'](function(_0x31ed76){if(_0x31ed76){_0x244d2f=_0x31ed76[_0x82af('0x98')];var _0x55fb35=_0x244d2f[_0x82af('0x9a')](-0x1);if(_0x55fb35==='/'){_0x244d2f=_0x244d2f['substring'](0x0,_0x244d2f[_0x82af('0x9b')](_0x55fb35));}_0x38658d=util['format']('%s/api/now/doc/table/schema/',_0x244d2f);_0x27453d=util[_0x82af('0x9c')](_0x82af('0x9d'),_0x244d2f);_0x429133={'user':_0x31ed76[_0x82af('0x95')],'pass':_0x31ed76[_0x82af('0x96')]};var _0x56d374={'method':_0x82af('0x9e'),'uri':_0x38658d+_0x82af('0x9f'),'auth':_0x429133,'json':!![]};return rp(_0x56d374);}})[_0x82af('0x25')](function(_0x1b53cd){if(_0x1b53cd[_0x82af('0xa0')][_0x82af('0x35')]>0x0){_0x43d13c=_0x1b53cd[_0x82af('0xa0')];}console[_0x82af('0xa1')]('incident\x20table\x20objects',_0x43d13c);_0x3a1bfa=[];_0x4e4f96=Object[_0x82af('0xa2')]([],_0x43d13c);_[_0x82af('0xa3')](_0x4e4f96,function(_0x18fca5){return!_0x3e252b[_0x82af('0xa4')](_0x18fca5['name']);});_0x4e4f96['forEach'](function(_0x32f587){var _0x54e369=createFieldObject(_0x27453d,_0x429133,_0x32f587[_0x82af('0xa5')],_0x32f587['name'],_0x32f587['label'],![]);_0x3a1bfa[_0x82af('0xa6')](_0x54e369);});return Promise[_0x82af('0xa7')](_0x3a1bfa);})['then'](function(_0x679480){_0x4c4ff7=_0x679480;_0x563a99=Object['assign']([],_0x43d13c);console[_0x82af('0xa1')](_0x82af('0xa8'),_0x43d13c);_[_0x82af('0xa3')](_0x563a99,function(_0x444d39){return _0x1233eb[_0x82af('0xa4')](_0x444d39[_0x82af('0x29')]);});console[_0x82af('0xa1')](_0x82af('0xa9'),_0x563a99);_0x3a1bfa=[];_0x563a99[_0x82af('0xaa')](function(_0x980c2d){var _0x2ceb8f=createFieldObject(_0x27453d,_0x429133,_0x980c2d[_0x82af('0xa5')],_0x980c2d[_0x82af('0x29')],_0x980c2d[_0x82af('0xab')],!![]);_0x3a1bfa[_0x82af('0xa6')](_0x2ceb8f);});return Promise['all'](_0x3a1bfa);})[_0x82af('0x25')](function(_0x2d7dff){_0x5b1762=_0x2d7dff;var _0x4af731=_0x4c4ff7['concat'](_0x5b1762);return{'count':_0x4af731[_0x82af('0x35')],'rows':_0x4af731};})['then'](respondWithResult(_0x34f009,null))['catch'](function(_0x23add5){console[_0x82af('0xa1')](_0x82af('0xac')+_0x23add5);var _0x37c615=_0x3ce9ef['query'][_0x82af('0xad')]?0x1f4:_0x23add5['statusCode']||0x1f4;logger['error'](_0x23add5[_0x82af('0x28')]);delete _0x23add5[_0x82af('0x29')];if(_0x37c615===0x191){_0x37c615=0x190;}_0x34f009['status'](_0x37c615)['send'](_0x3ce9ef[_0x82af('0x31')][_0x82af('0xad')]?{'message':_0x82af('0xae'),'statusCode':_0x23add5[_0x82af('0xaf')]}:_0x23add5);});};function createFieldObject(_0x53a7e3,_0x4c443e,_0x4894bd,_0x3642aa,_0x19af07,_0x608aaa){return new Promise(function(_0xa3ffe2,_0x4e46a4){var _0x4949bb={'id':_0x3642aa,'name':_0x19af07,'custom':_0x608aaa};if(_0x4894bd===_0x82af('0xb0')){_0x4949bb[_0x82af('0x40')]=[{'name':'True','value':_0x82af('0xb1')},{'name':_0x82af('0xb2'),'value':_0x82af('0xb3')}];_0xa3ffe2(_0x4949bb);}else{var _0x467488={'method':_0x82af('0x9e'),'uri':_0x53a7e3+'sys_choice?sysparm_query=name=incident^element='+_0x3642aa,'auth':_0x4c443e,'json':!![]};return rp(_0x467488)[_0x82af('0x25')](function(_0x2944e2){var _0x4f92c3=[];if(_0x2944e2[_0x82af('0xa0')][_0x82af('0x35')]>0x0){_0x2944e2[_0x82af('0xa0')][_0x82af('0xaa')](function(_0x26f4e1){if(_0x26f4e1[_0x82af('0xb4')]===_0x82af('0xb3')){var _0x151a10={'name':_0x26f4e1[_0x82af('0xab')],'value':_0x26f4e1[_0x82af('0xb5')]};_0x4f92c3[_0x82af('0xa6')](_0x151a10);}});}_0x4949bb[_0x82af('0x40')]=_0x4f92c3;if(_0x4949bb[_0x82af('0x40')]['length']>0x0){_0xa3ffe2(_0x4949bb);}else{if(_0x608aaa==![]){_0xa3ffe2();}else{_0xa3ffe2(_0x4949bb);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index af60add..a5dc7d1 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 _0xf2ca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x29e0eb,_0x9acb52){var _0x597d2d=function(_0x596ef9){while(--_0x596ef9){_0x29e0eb['push'](_0x29e0eb['shift']());}};_0x597d2d(++_0x9acb52);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x266ddc,_0x45aa52){_0x266ddc=_0x266ddc-0x0;var _0x39c1d7=_0xf2ca[_0x266ddc];return _0x39c1d7;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xaf2c('0x9'));module[_0xaf2c('0xa')]=function(_0x297740,_0x1f9531){return _0x297740['define'](_0xaf2c('0xb'),attributes,{'tableName':_0xaf2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x5496,0x175));var _0x6549=function(_0x3c481f,_0x465861){_0x3c481f=_0x3c481f-0x0;var _0x334504=_0x5496[_0x3c481f];return _0x334504;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 4e250c9..5fc5c47 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 _0xb332=['ShowServicenowAccount','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','include','map','model','attributes','find'];(function(_0x4fd271,_0x33a070){var _0x4543c7=function(_0x55c1f7){while(--_0x55c1f7){_0x4fd271['push'](_0x4fd271['shift']());}};_0x4543c7(++_0x33a070);}(_0xb332,0xda));var _0x2b33=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0xb332[_0xf168d3];return _0x17fb54;};'use strict';var _=require('lodash');var util=require(_0x2b33('0x0'));var moment=require('moment');var BPromise=require(_0x2b33('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b33('0x2'));var db=require(_0x2b33('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b33('0x4'))(_0x2b33('0x5'));var config=require('../../config/environment');var jayson=require(_0x2b33('0x6'));var client=jayson['client'][_0x2b33('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x215e1b,_0x3edcde,_0x3a52f7){return new BPromise(function(_0x5181dd,_0xcfd2ea){return client[_0x2b33('0x8')](_0x215e1b,_0x3a52f7)[_0x2b33('0x9')](function(_0x2213b3){logger[_0x2b33('0xa')](_0x2b33('0xb'),_0x3edcde,_0x2b33('0xc'));logger[_0x2b33('0xd')](_0x2b33('0xe'),_0x3edcde,_0x2b33('0xc'),JSON[_0x2b33('0xf')](_0x2213b3));if(_0x2213b3[_0x2b33('0x10')]){if(_0x2213b3[_0x2b33('0x10')]['code']===0x1f4){logger[_0x2b33('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x3edcde,_0x2213b3[_0x2b33('0x10')][_0x2b33('0x11')]);return _0xcfd2ea(_0x2213b3['error']['message']);}logger[_0x2b33('0x10')](_0x2b33('0xb'),_0x3edcde,_0x2213b3[_0x2b33('0x10')][_0x2b33('0x11')]);return _0x5181dd(_0x2213b3[_0x2b33('0x10')][_0x2b33('0x11')]);}else{logger[_0x2b33('0xa')](_0x2b33('0xb'),_0x3edcde,_0x2b33('0xc'));_0x5181dd(_0x2213b3['result'][_0x2b33('0x11')]);}})[_0x2b33('0x12')](function(_0x24e10f){logger[_0x2b33('0x10')](_0x2b33('0xb'),_0x3edcde,_0x24e10f);_0xcfd2ea(_0x24e10f);});});}exports[_0x2b33('0x13')]=function(_0x1b8942){var _0x2cb8c5=this;return new Promise(function(_0x489bf0,_0x30fd5b){return db[_0x2b33('0x14')][_0x2b33('0x15')]({'raw':_0x1b8942[_0x2b33('0x16')]?_0x1b8942[_0x2b33('0x16')][_0x2b33('0x17')]===undefined?!![]:![]:!![],'where':_0x1b8942[_0x2b33('0x16')]?_0x1b8942[_0x2b33('0x16')][_0x2b33('0x18')]||null:null,'attributes':_0x1b8942[_0x2b33('0x16')]?_0x1b8942['options']['attributes']||null:null,'limit':_0x1b8942['options']?_0x1b8942[_0x2b33('0x16')]['limit']||null:null,'include':_0x1b8942[_0x2b33('0x16')]?_0x1b8942[_0x2b33('0x16')][_0x2b33('0x19')]?_[_0x2b33('0x1a')](_0x1b8942[_0x2b33('0x16')][_0x2b33('0x19')],function(_0x2c0e64){return{'model':db[_0x2c0e64[_0x2b33('0x1b')]],'as':_0x2c0e64['as'],'attributes':_0x2c0e64[_0x2b33('0x1c')],'include':_0x2c0e64['include']?_['map'](_0x2c0e64[_0x2b33('0x19')],function(_0x561548){return{'model':db[_0x561548[_0x2b33('0x1b')]],'as':_0x561548['as'],'attributes':_0x561548[_0x2b33('0x1c')],'include':_0x561548[_0x2b33('0x19')]?_[_0x2b33('0x1a')](_0x561548[_0x2b33('0x19')],function(_0x25adab){return{'model':db[_0x25adab[_0x2b33('0x1b')]],'as':_0x25adab['as'],'attributes':_0x25adab['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x438ceb){logger['info']('GetServicenowAccount',_0x1b8942);logger[_0x2b33('0xd')]('GetServicenowAccount',_0x1b8942,JSON[_0x2b33('0xf')](_0x438ceb));_0x489bf0(_0x438ceb);})[_0x2b33('0x12')](function(_0x53cd59){logger['error'](_0x2b33('0x13'),_0x53cd59[_0x2b33('0x11')],_0x1b8942);_0x30fd5b(_0x2cb8c5['error'](0x1f4,_0x53cd59[_0x2b33('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x5cd77a){var _0x4eed6c=this;return new Promise(function(_0x4b343a,_0x3ed20f){return db[_0x2b33('0x14')][_0x2b33('0x1d')]({'raw':_0x5cd77a[_0x2b33('0x16')]?_0x5cd77a[_0x2b33('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5cd77a[_0x2b33('0x16')]?_0x5cd77a[_0x2b33('0x16')][_0x2b33('0x18')]||null:null,'attributes':_0x5cd77a[_0x2b33('0x16')]?_0x5cd77a[_0x2b33('0x16')][_0x2b33('0x1c')]||null:null,'include':_0x5cd77a[_0x2b33('0x16')]?_0x5cd77a['options'][_0x2b33('0x19')]?_[_0x2b33('0x1a')](_0x5cd77a[_0x2b33('0x16')]['include'],function(_0x3a18bb){return{'model':db[_0x3a18bb['model']],'as':_0x3a18bb['as'],'attributes':_0x3a18bb[_0x2b33('0x1c')],'include':_0x3a18bb[_0x2b33('0x19')]?_['map'](_0x3a18bb[_0x2b33('0x19')],function(_0x16a671){return{'model':db[_0x16a671[_0x2b33('0x1b')]],'as':_0x16a671['as'],'attributes':_0x16a671['attributes'],'include':_0x16a671[_0x2b33('0x19')]?_[_0x2b33('0x1a')](_0x16a671[_0x2b33('0x19')],function(_0x216dba){return{'model':db[_0x216dba[_0x2b33('0x1b')]],'as':_0x216dba['as'],'attributes':_0x216dba['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b33('0x9')](function(_0x418a72){logger[_0x2b33('0xa')]('ShowServicenowAccount',_0x5cd77a);logger[_0x2b33('0xd')](_0x2b33('0x1e'),_0x5cd77a,JSON[_0x2b33('0xf')](_0x418a72));_0x4b343a(_0x418a72);})['catch'](function(_0x2ee4d4){logger[_0x2b33('0x10')](_0x2b33('0x1e'),_0x2ee4d4[_0x2b33('0x11')],_0x5cd77a);_0x3ed20f(_0x4eed6c[_0x2b33('0x10')](0x1f4,_0x2ee4d4[_0x2b33('0x11')]));});});}; \ No newline at end of file +var _0x32fd=['ServicenowAccount','findAll','options','attributes','limit','include','map','model','debug','stringify','find','raw','where','ShowServicenowAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount'];(function(_0x2a7094,_0x56ed12){var _0x49cd4d=function(_0x1babca){while(--_0x1babca){_0x2a7094['push'](_0x2a7094['shift']());}};_0x49cd4d(++_0x56ed12);}(_0x32fd,0x7d));var _0xd32f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32fd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd32f('0x0'));var util=require('util');var moment=require(_0xd32f('0x1'));var BPromise=require(_0xd32f('0x2'));var rs=require(_0xd32f('0x3'));var fs=require('fs');var Redis=require(_0xd32f('0x4'));var db=require(_0xd32f('0x5'))['db'];var utils=require(_0xd32f('0x6'));var logger=require(_0xd32f('0x7'))(_0xd32f('0x8'));var config=require(_0xd32f('0x9'));var jayson=require(_0xd32f('0xa'));var client=jayson[_0xd32f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15fadf,_0x54ab1b,_0x35dc84){return new BPromise(function(_0xdb3c49,_0x218bb9){return client['request'](_0x15fadf,_0x35dc84)[_0xd32f('0xc')](function(_0x238791){logger[_0xd32f('0xd')](_0xd32f('0xe'),_0x54ab1b,_0xd32f('0xf'));logger['debug'](_0xd32f('0x10'),_0x54ab1b,_0xd32f('0xf'),JSON['stringify'](_0x238791));if(_0x238791[_0xd32f('0x11')]){if(_0x238791['error'][_0xd32f('0x12')]===0x1f4){logger[_0xd32f('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x54ab1b,_0x238791[_0xd32f('0x11')][_0xd32f('0x13')]);return _0x218bb9(_0x238791[_0xd32f('0x11')]['message']);}logger['error'](_0xd32f('0xe'),_0x54ab1b,_0x238791['error'][_0xd32f('0x13')]);return _0xdb3c49(_0x238791['error'][_0xd32f('0x13')]);}else{logger[_0xd32f('0xd')](_0xd32f('0xe'),_0x54ab1b,'request\x20sent');_0xdb3c49(_0x238791[_0xd32f('0x14')][_0xd32f('0x13')]);}})[_0xd32f('0x15')](function(_0x41fe82){logger[_0xd32f('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x54ab1b,_0x41fe82);_0x218bb9(_0x41fe82);});});}exports[_0xd32f('0x16')]=function(_0x7a0371){var _0xa13f76=this;return new Promise(function(_0x592c33,_0x6a8467){return db[_0xd32f('0x17')][_0xd32f('0x18')]({'raw':_0x7a0371[_0xd32f('0x19')]?_0x7a0371[_0xd32f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x7a0371[_0xd32f('0x19')]?_0x7a0371[_0xd32f('0x19')]['where']||null:null,'attributes':_0x7a0371[_0xd32f('0x19')]?_0x7a0371[_0xd32f('0x19')][_0xd32f('0x1a')]||null:null,'limit':_0x7a0371[_0xd32f('0x19')]?_0x7a0371[_0xd32f('0x19')][_0xd32f('0x1b')]||null:null,'include':_0x7a0371['options']?_0x7a0371[_0xd32f('0x19')][_0xd32f('0x1c')]?_[_0xd32f('0x1d')](_0x7a0371[_0xd32f('0x19')][_0xd32f('0x1c')],function(_0x57fd34){return{'model':db[_0x57fd34[_0xd32f('0x1e')]],'as':_0x57fd34['as'],'attributes':_0x57fd34[_0xd32f('0x1a')],'include':_0x57fd34[_0xd32f('0x1c')]?_[_0xd32f('0x1d')](_0x57fd34[_0xd32f('0x1c')],function(_0x59949f){return{'model':db[_0x59949f[_0xd32f('0x1e')]],'as':_0x59949f['as'],'attributes':_0x59949f[_0xd32f('0x1a')],'include':_0x59949f[_0xd32f('0x1c')]?_['map'](_0x59949f[_0xd32f('0x1c')],function(_0x43a321){return{'model':db[_0x43a321['model']],'as':_0x43a321['as'],'attributes':_0x43a321[_0xd32f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd32f('0xc')](function(_0x3e6685){logger[_0xd32f('0xd')](_0xd32f('0x16'),_0x7a0371);logger[_0xd32f('0x1f')](_0xd32f('0x16'),_0x7a0371,JSON[_0xd32f('0x20')](_0x3e6685));_0x592c33(_0x3e6685);})[_0xd32f('0x15')](function(_0x1bba49){logger[_0xd32f('0x11')](_0xd32f('0x16'),_0x1bba49[_0xd32f('0x13')],_0x7a0371);_0x6a8467(_0xa13f76[_0xd32f('0x11')](0x1f4,_0x1bba49[_0xd32f('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x14fb2b){var _0xfed63c=this;return new Promise(function(_0x3b9013,_0x4e22bb){return db['ServicenowAccount'][_0xd32f('0x21')]({'raw':_0x14fb2b[_0xd32f('0x19')]?_0x14fb2b[_0xd32f('0x19')][_0xd32f('0x22')]===undefined?!![]:![]:!![],'where':_0x14fb2b[_0xd32f('0x19')]?_0x14fb2b[_0xd32f('0x19')][_0xd32f('0x23')]||null:null,'attributes':_0x14fb2b[_0xd32f('0x19')]?_0x14fb2b['options']['attributes']||null:null,'include':_0x14fb2b[_0xd32f('0x19')]?_0x14fb2b[_0xd32f('0x19')][_0xd32f('0x1c')]?_['map'](_0x14fb2b[_0xd32f('0x19')][_0xd32f('0x1c')],function(_0x291ae6){return{'model':db[_0x291ae6[_0xd32f('0x1e')]],'as':_0x291ae6['as'],'attributes':_0x291ae6[_0xd32f('0x1a')],'include':_0x291ae6[_0xd32f('0x1c')]?_[_0xd32f('0x1d')](_0x291ae6[_0xd32f('0x1c')],function(_0x4bc5ca){return{'model':db[_0x4bc5ca['model']],'as':_0x4bc5ca['as'],'attributes':_0x4bc5ca[_0xd32f('0x1a')],'include':_0x4bc5ca[_0xd32f('0x1c')]?_[_0xd32f('0x1d')](_0x4bc5ca[_0xd32f('0x1c')],function(_0x3afe5e){return{'model':db[_0x3afe5e[_0xd32f('0x1e')]],'as':_0x3afe5e['as'],'attributes':_0x3afe5e['attributes']};}):[]};}):[]};}):[]:[]})[_0xd32f('0xc')](function(_0x53c662){logger[_0xd32f('0xd')](_0xd32f('0x24'),_0x14fb2b);logger[_0xd32f('0x1f')](_0xd32f('0x24'),_0x14fb2b,JSON[_0xd32f('0x20')](_0x53c662));_0x3b9013(_0x53c662);})['catch'](function(_0x2105fa){logger['error'](_0xd32f('0x24'),_0x2105fa[_0xd32f('0x13')],_0x14fb2b);_0x4e22bb(_0xfed63c[_0xd32f('0x11')](0x1f4,_0x2105fa['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 207fd86..5bc4110 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 _0x2f9f=['update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x246a98,_0xdf59a8){var _0x3b8b79=function(_0x2d0a7b){while(--_0x2d0a7b){_0x246a98['push'](_0x246a98['shift']());}};_0x3b8b79(++_0xdf59a8);}(_0x2f9f,0x17e));var _0xf2f9=function(_0x5db322,_0x3693ad){_0x5db322=_0x5db322-0x0;var _0x92d27=_0x2f9f[_0x5db322];return _0x92d27;};'use strict';var multer=require(_0xf2f9('0x0'));var util=require('util');var path=require(_0xf2f9('0x1'));var timeout=require(_0xf2f9('0x2'));var express=require(_0xf2f9('0x3'));var router=express[_0xf2f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf2f9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0xf2f9('0x6')]('/',auth[_0xf2f9('0x7')](),controller[_0xf2f9('0x8')]);router[_0xf2f9('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xf2f9('0x9'),auth[_0xf2f9('0x7')](),controller[_0xf2f9('0xa')]);router[_0xf2f9('0x6')](_0xf2f9('0xb'),auth[_0xf2f9('0x7')](),controller['getSubjects']);router[_0xf2f9('0x6')](_0xf2f9('0xc'),auth[_0xf2f9('0x7')](),controller[_0xf2f9('0xd')]);router[_0xf2f9('0xe')]('/',auth[_0xf2f9('0x7')](),controller[_0xf2f9('0xf')]);router[_0xf2f9('0x10')](_0xf2f9('0x11'),auth[_0xf2f9('0x7')](),controller[_0xf2f9('0x12')]);router['delete'](_0xf2f9('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xf2f9('0x13')]=router; \ No newline at end of file +var _0x797d=['getDescriptions','post','create','put','update','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','isAuthenticated','get','/:id/fields','getFields','getSubjects','/:id/descriptions'];(function(_0x50a440,_0x17e1a7){var _0x58e126=function(_0x1430ee){while(--_0x1430ee){_0x50a440['push'](_0x50a440['shift']());}};_0x58e126(++_0x17e1a7);}(_0x797d,0xa9));var _0xd797=function(_0x14250b,_0x511de5){_0x14250b=_0x14250b-0x0;var _0x3ca347=_0x797d[_0x14250b];return _0x3ca347;};'use strict';var multer=require(_0xd797('0x0'));var util=require(_0xd797('0x1'));var path=require('path');var timeout=require(_0xd797('0x2'));var express=require(_0xd797('0x3'));var router=express[_0xd797('0x4')]();var fs_extra=require(_0xd797('0x5'));var auth=require(_0xd797('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd797('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd797('0x8')]);router['get']('/:id',auth[_0xd797('0x9')](),controller['show']);router[_0xd797('0xa')](_0xd797('0xb'),auth[_0xd797('0x9')](),controller[_0xd797('0xc')]);router[_0xd797('0xa')]('/:id/subjects',auth[_0xd797('0x9')](),controller[_0xd797('0xd')]);router['get'](_0xd797('0xe'),auth[_0xd797('0x9')](),controller[_0xd797('0xf')]);router[_0xd797('0x10')]('/',auth[_0xd797('0x9')](),controller[_0xd797('0x11')]);router[_0xd797('0x12')]('/:id',auth[_0xd797('0x9')](),controller[_0xd797('0x13')]);router['delete'](_0xd797('0x14'),auth[_0xd797('0x9')](),controller[_0xd797('0x15')]);module[_0xd797('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 5f6ee5c..cb84d40 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 _0x8e48=['STRING','sequelize','exports'];(function(_0x33fad9,_0x2437ec){var _0x3e9f29=function(_0x774c78){while(--_0x774c78){_0x33fad9['push'](_0x33fad9['shift']());}};_0x3e9f29(++_0x2437ec);}(_0x8e48,0xdc));var _0x88e4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8e48[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x88e4('0x0'));module[_0x88e4('0x1')]={'name':{'type':Sequelize[_0x88e4('0x2')]},'description':{'type':Sequelize[_0x88e4('0x2')]}}; \ No newline at end of file +var _0xcb22=['exports','STRING','sequelize'];(function(_0x45725b,_0x38b9bb){var _0x2e7f42=function(_0x4b3b11){while(--_0x4b3b11){_0x45725b['push'](_0x45725b['shift']());}};_0x2e7f42(++_0x38b9bb);}(_0xcb22,0x16d));var _0x2cb2=function(_0x4e619e,_0x1c5748){_0x4e619e=_0x4e619e-0x0;var _0x4974e5=_0xcb22[_0x4e619e];return _0x4974e5;};'use strict';var Sequelize=require(_0x2cb2('0x0'));module[_0x2cb2('0x1')]={'name':{'type':Sequelize[_0x2cb2('0x2')]},'description':{'type':Sequelize[_0x2cb2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 66c2e8f..43cebd0 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 _0xa256=['params','rawAttributes','includeAll','include','options','find','create','body','getFields','ServicenowField','order','filter','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','findAll','rows','catch','show'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xa256,0x1ef));var _0x6a25=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa256[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0x6a25('0x0'));var rimraf=require(_0x6a25('0x1'));var zipdir=require(_0x6a25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6a25('0x3'));var BPromise=require(_0x6a25('0x4'));var Mustache=require('mustache');var util=require(_0x6a25('0x5'));var path=require(_0x6a25('0x6'));var sox=require(_0x6a25('0x7'));var csv=require(_0x6a25('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a25('0x9'));var _=require(_0x6a25('0xa'));var squel=require('squel');var crypto=require(_0x6a25('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6a25('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6a25('0xd'));var Papa=require('papaparse');var Redis=require(_0x6a25('0xe'));var authService=require(_0x6a25('0xf'));var qs=require(_0x6a25('0x10'));var as=require(_0x6a25('0x11'));var hardwareService=require(_0x6a25('0x12'));var logger=require('../../config/logger')(_0x6a25('0x13'));var utils=require(_0x6a25('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6a25('0x15'))['db'];function respondWithStatusCode(_0x435fb8,_0x372136){_0x372136=_0x372136||0xcc;return function(_0x3f7eda){if(_0x3f7eda){return _0x435fb8[_0x6a25('0x16')](_0x372136);}return _0x435fb8['status'](_0x372136)['end']();};}function respondWithResult(_0x1b88e5,_0x238aae){_0x238aae=_0x238aae||0xc8;return function(_0x18b39f){if(_0x18b39f){return _0x1b88e5[_0x6a25('0x17')](_0x238aae)[_0x6a25('0x18')](_0x18b39f);}};}function respondWithFilteredResult(_0x3566d2,_0x149414){return function(_0x16a839){if(_0x16a839){var _0x3ec427=typeof _0x149414[_0x6a25('0x19')]==='undefined'&&typeof _0x149414['limit']===_0x6a25('0x1a');var _0x1d2974=_0x16a839['count'];var _0x39ff5f=_0x3ec427?0x0:_0x149414[_0x6a25('0x19')];var _0x57c445=_0x3ec427?_0x16a839[_0x6a25('0x1b')]:_0x149414[_0x6a25('0x19')]+_0x149414[_0x6a25('0x1c')];var _0x3fae1b;if(_0x57c445>=_0x1d2974){_0x57c445=_0x1d2974;_0x3fae1b=0xc8;}else{_0x3fae1b=0xce;}_0x3566d2['status'](_0x3fae1b);return _0x3566d2[_0x6a25('0x1d')](_0x6a25('0x1e'),_0x39ff5f+'-'+_0x57c445+'/'+_0x1d2974)[_0x6a25('0x18')](_0x16a839);}return null;};}function patchUpdates(_0x2e7773){return function(_0x2ff57a){try{jsonpatch[_0x6a25('0x1f')](_0x2ff57a,_0x2e7773,!![]);}catch(_0x33ad30){return BPromise[_0x6a25('0x20')](_0x33ad30);}return _0x2ff57a[_0x6a25('0x21')]();};}function saveUpdates(_0x5da878,_0x51ca35){return function(_0x22235a){if(_0x22235a){return _0x22235a['update'](_0x5da878)[_0x6a25('0x22')](function(_0x3c486d){return _0x3c486d;});}return null;};}function removeEntity(_0x707c3f,_0x3c99bc){return function(_0x5c071a){if(_0x5c071a){return _0x5c071a[_0x6a25('0x23')]()['then'](function(){_0x707c3f['status'](0xcc)[_0x6a25('0x24')]();});}};}function handleEntityNotFound(_0x81c68b,_0x52e8a1){return function(_0x45ccab){if(!_0x45ccab){_0x81c68b[_0x6a25('0x16')](0x194);}return _0x45ccab;};}function handleError(_0x26ba8d,_0x449643){_0x449643=_0x449643||0x1f4;return function(_0xbf4b09){logger[_0x6a25('0x25')](_0xbf4b09[_0x6a25('0x26')]);if(_0xbf4b09[_0x6a25('0x27')]){delete _0xbf4b09['name'];}_0x26ba8d[_0x6a25('0x17')](_0x449643)[_0x6a25('0x28')](_0xbf4b09);};}exports[_0x6a25('0x29')]=function(_0x3e6e47,_0x3733db){var _0x1e7e10={},_0x21ba5a={},_0x1f995d={'count':0x0,'rows':[]};var _0x560803=_[_0x6a25('0x2a')](db[_0x6a25('0x2b')]['rawAttributes'],function(_0x3bcbd4){return{'name':_0x3bcbd4['fieldName'],'type':_0x3bcbd4[_0x6a25('0x2c')][_0x6a25('0x2d')]};});_0x21ba5a[_0x6a25('0x2e')]=_[_0x6a25('0x2a')](_0x560803,_0x6a25('0x27'));_0x21ba5a[_0x6a25('0x2f')]=_[_0x6a25('0x30')](_0x3e6e47['query']);_0x21ba5a[_0x6a25('0x31')]=_[_0x6a25('0x32')](_0x21ba5a[_0x6a25('0x2e')],_0x21ba5a['query']);_0x1e7e10['attributes']=_[_0x6a25('0x32')](_0x21ba5a['model'],qs[_0x6a25('0x33')](_0x3e6e47[_0x6a25('0x2f')][_0x6a25('0x33')]));_0x1e7e10[_0x6a25('0x34')]=_0x1e7e10[_0x6a25('0x34')][_0x6a25('0x35')]?_0x1e7e10[_0x6a25('0x34')]:_0x21ba5a[_0x6a25('0x2e')];if(!_0x3e6e47[_0x6a25('0x2f')][_0x6a25('0x36')](_0x6a25('0x37'))){_0x1e7e10['limit']=qs[_0x6a25('0x1c')](_0x3e6e47[_0x6a25('0x2f')]['limit']);_0x1e7e10[_0x6a25('0x19')]=qs[_0x6a25('0x19')](_0x3e6e47[_0x6a25('0x2f')][_0x6a25('0x19')]);}_0x1e7e10['order']=qs[_0x6a25('0x38')](_0x3e6e47[_0x6a25('0x2f')][_0x6a25('0x38')]);_0x1e7e10[_0x6a25('0x39')]=qs[_0x6a25('0x31')](_[_0x6a25('0x3a')](_0x3e6e47[_0x6a25('0x2f')],_0x21ba5a[_0x6a25('0x31')]),_0x560803);if(_0x3e6e47[_0x6a25('0x2f')]['filter']){_0x1e7e10[_0x6a25('0x39')]=_[_0x6a25('0x3b')](_0x1e7e10[_0x6a25('0x39')],{'$or':_['map'](_0x560803,function(_0x1dd947){if(_0x1dd947[_0x6a25('0x2c')]!==_0x6a25('0x3c')){var _0x5c0317={};_0x5c0317[_0x1dd947[_0x6a25('0x27')]]={'$like':'%'+_0x3e6e47[_0x6a25('0x2f')]['filter']+'%'};return _0x5c0317;}})});}_0x1e7e10=_[_0x6a25('0x3b')]({},_0x1e7e10,_0x3e6e47['options']);var _0x1c9026={'where':_0x1e7e10[_0x6a25('0x39')]};return db['ServicenowConfiguration'][_0x6a25('0x1b')](_0x1c9026)[_0x6a25('0x22')](function(_0x33afd7){_0x1f995d[_0x6a25('0x1b')]=_0x33afd7;if(_0x3e6e47[_0x6a25('0x2f')]['includeAll']){_0x1e7e10['include']=[{'all':!![]}];}return db[_0x6a25('0x2b')][_0x6a25('0x3d')](_0x1e7e10);})['then'](function(_0x45e5d1){_0x1f995d[_0x6a25('0x3e')]=_0x45e5d1;return _0x1f995d;})['then'](respondWithFilteredResult(_0x3733db,_0x1e7e10))[_0x6a25('0x3f')](handleError(_0x3733db,null));};exports[_0x6a25('0x40')]=function(_0x314c15,_0x5dcec4){var _0x29b150={'raw':![],'where':{'id':_0x314c15[_0x6a25('0x41')]['id']}},_0x292a35={};_0x292a35['model']=_['keys'](db[_0x6a25('0x2b')][_0x6a25('0x42')]);_0x292a35[_0x6a25('0x2f')]=_[_0x6a25('0x30')](_0x314c15['query']);_0x292a35[_0x6a25('0x31')]=_[_0x6a25('0x32')](_0x292a35[_0x6a25('0x2e')],_0x292a35['query']);_0x29b150['attributes']=_[_0x6a25('0x32')](_0x292a35['model'],qs[_0x6a25('0x33')](_0x314c15[_0x6a25('0x2f')][_0x6a25('0x33')]));_0x29b150[_0x6a25('0x34')]=_0x29b150[_0x6a25('0x34')][_0x6a25('0x35')]?_0x29b150['attributes']:_0x292a35[_0x6a25('0x2e')];if(_0x314c15[_0x6a25('0x2f')][_0x6a25('0x43')]){_0x29b150[_0x6a25('0x44')]=[{'all':!![]}];}_0x29b150=_['merge']({},_0x29b150,_0x314c15[_0x6a25('0x45')]);return db[_0x6a25('0x2b')][_0x6a25('0x46')](_0x29b150)[_0x6a25('0x22')](handleEntityNotFound(_0x5dcec4,null))[_0x6a25('0x22')](respondWithResult(_0x5dcec4,null))[_0x6a25('0x3f')](handleError(_0x5dcec4,null));};exports['create']=function(_0x4f8094,_0x54ac5d){return db['ServicenowConfiguration'][_0x6a25('0x47')](_0x4f8094[_0x6a25('0x48')],{})['then'](respondWithResult(_0x54ac5d,0xc9))['catch'](handleError(_0x54ac5d,null));};exports['update']=function(_0x36ec2b,_0x3618c1){if(_0x36ec2b['body']['id']){delete _0x36ec2b[_0x6a25('0x48')]['id'];}return db[_0x6a25('0x2b')][_0x6a25('0x46')]({'where':{'id':_0x36ec2b[_0x6a25('0x41')]['id']}})[_0x6a25('0x22')](handleEntityNotFound(_0x3618c1,null))[_0x6a25('0x22')](saveUpdates(_0x36ec2b[_0x6a25('0x48')],null))['then'](respondWithResult(_0x3618c1,null))['catch'](handleError(_0x3618c1,null));};exports[_0x6a25('0x23')]=function(_0x5cfeaf,_0x49bb38){return db[_0x6a25('0x2b')][_0x6a25('0x46')]({'where':{'id':_0x5cfeaf[_0x6a25('0x41')]['id']}})[_0x6a25('0x22')](handleEntityNotFound(_0x49bb38,null))[_0x6a25('0x22')](removeEntity(_0x49bb38,null))[_0x6a25('0x3f')](handleError(_0x49bb38,null));};exports[_0x6a25('0x49')]=function(_0x40c8b1,_0x380cf0,_0x51ff42){var _0xefe564={};var _0x3f7fbd={};var _0x577f2c;var _0x20693d;return db[_0x6a25('0x2b')]['findOne']({'where':{'id':_0x40c8b1[_0x6a25('0x41')]['id']}})[_0x6a25('0x22')](handleEntityNotFound(_0x380cf0,null))[_0x6a25('0x22')](function(_0x4e225c){if(_0x4e225c){_0x577f2c=_0x4e225c;_0x3f7fbd[_0x6a25('0x2e')]=_[_0x6a25('0x30')](db[_0x6a25('0x4a')][_0x6a25('0x42')]);_0x3f7fbd[_0x6a25('0x2f')]=_[_0x6a25('0x30')](_0x40c8b1[_0x6a25('0x2f')]);_0x3f7fbd[_0x6a25('0x31')]=_['intersection'](_0x3f7fbd[_0x6a25('0x2e')],_0x3f7fbd[_0x6a25('0x2f')]);_0xefe564[_0x6a25('0x34')]=_[_0x6a25('0x32')](_0x3f7fbd[_0x6a25('0x2e')],qs[_0x6a25('0x33')](_0x40c8b1[_0x6a25('0x2f')][_0x6a25('0x33')]));_0xefe564[_0x6a25('0x34')]=_0xefe564[_0x6a25('0x34')][_0x6a25('0x35')]?_0xefe564[_0x6a25('0x34')]:_0x3f7fbd[_0x6a25('0x2e')];_0xefe564[_0x6a25('0x4b')]=qs[_0x6a25('0x38')](_0x40c8b1[_0x6a25('0x2f')][_0x6a25('0x38')]);_0xefe564[_0x6a25('0x39')]=qs[_0x6a25('0x31')](_[_0x6a25('0x3a')](_0x40c8b1['query'],_0x3f7fbd[_0x6a25('0x31')]));if(_0x40c8b1['query'][_0x6a25('0x4c')]){_0xefe564[_0x6a25('0x39')]=_['merge'](_0xefe564[_0x6a25('0x39')],{'$or':_[_0x6a25('0x2a')](_0xefe564[_0x6a25('0x34')],function(_0x487fd8){var _0x15d406={};_0x15d406[_0x487fd8]={'$like':'%'+_0x40c8b1[_0x6a25('0x2f')][_0x6a25('0x4c')]+'%'};return _0x15d406;})});}_0xefe564=_['merge']({},_0xefe564,_0x40c8b1[_0x6a25('0x45')]);return _0x577f2c[_0x6a25('0x49')](_0xefe564);}})[_0x6a25('0x22')](function(_0x36f977){if(_0x36f977){_0x20693d=_0x36f977['length'];if(!_0x40c8b1[_0x6a25('0x2f')]['hasOwnProperty']('nolimit')){_0xefe564['limit']=qs[_0x6a25('0x1c')](_0x40c8b1[_0x6a25('0x2f')][_0x6a25('0x1c')]);_0xefe564[_0x6a25('0x19')]=qs[_0x6a25('0x19')](_0x40c8b1[_0x6a25('0x2f')][_0x6a25('0x19')]);}return _0x577f2c[_0x6a25('0x49')](_0xefe564);}})[_0x6a25('0x22')](function(_0x470dc8){if(_0x470dc8){return _0x470dc8?{'count':_0x20693d,'rows':_0x470dc8}:null;}})[_0x6a25('0x22')](respondWithResult(_0x380cf0,null))[_0x6a25('0x3f')](handleError(_0x380cf0,null));};exports[_0x6a25('0x4d')]=function(_0x34a4bf,_0x53fb62,_0x585ede){var _0x2404f9={};var _0x1f6f14={};var _0x319085;var _0xaf5ad5;return db[_0x6a25('0x2b')][_0x6a25('0x4e')]({'where':{'id':_0x34a4bf['params']['id']}})['then'](handleEntityNotFound(_0x53fb62,null))[_0x6a25('0x22')](function(_0x203b55){if(_0x203b55){_0x319085=_0x203b55;_0x1f6f14[_0x6a25('0x2e')]=_[_0x6a25('0x30')](db[_0x6a25('0x4a')]['rawAttributes']);_0x1f6f14[_0x6a25('0x2f')]=_[_0x6a25('0x30')](_0x34a4bf['query']);_0x1f6f14['filters']=_[_0x6a25('0x32')](_0x1f6f14[_0x6a25('0x2e')],_0x1f6f14[_0x6a25('0x2f')]);_0x2404f9[_0x6a25('0x34')]=_[_0x6a25('0x32')](_0x1f6f14[_0x6a25('0x2e')],qs[_0x6a25('0x33')](_0x34a4bf[_0x6a25('0x2f')]['fields']));_0x2404f9[_0x6a25('0x34')]=_0x2404f9[_0x6a25('0x34')][_0x6a25('0x35')]?_0x2404f9[_0x6a25('0x34')]:_0x1f6f14[_0x6a25('0x2e')];_0x2404f9[_0x6a25('0x4b')]=qs[_0x6a25('0x38')](_0x34a4bf[_0x6a25('0x2f')]['sort']);_0x2404f9['where']=qs[_0x6a25('0x31')](_['pick'](_0x34a4bf[_0x6a25('0x2f')],_0x1f6f14[_0x6a25('0x31')]));if(_0x34a4bf[_0x6a25('0x2f')][_0x6a25('0x4c')]){_0x2404f9[_0x6a25('0x39')]=_[_0x6a25('0x3b')](_0x2404f9['where'],{'$or':_[_0x6a25('0x2a')](_0x2404f9[_0x6a25('0x34')],function(_0x30febd){var _0x59d566={};_0x59d566[_0x30febd]={'$like':'%'+_0x34a4bf[_0x6a25('0x2f')][_0x6a25('0x4c')]+'%'};return _0x59d566;})});}_0x2404f9=_['merge']({},_0x2404f9,_0x34a4bf[_0x6a25('0x45')]);return _0x319085[_0x6a25('0x4d')](_0x2404f9);}})[_0x6a25('0x22')](function(_0x43746b){if(_0x43746b){_0xaf5ad5=_0x43746b['length'];if(!_0x34a4bf[_0x6a25('0x2f')][_0x6a25('0x36')]('nolimit')){_0x2404f9[_0x6a25('0x1c')]=qs[_0x6a25('0x1c')](_0x34a4bf[_0x6a25('0x2f')]['limit']);_0x2404f9['offset']=qs[_0x6a25('0x19')](_0x34a4bf[_0x6a25('0x2f')][_0x6a25('0x19')]);}return _0x319085[_0x6a25('0x4d')](_0x2404f9);}})['then'](function(_0x24f1e7){if(_0x24f1e7){return _0x24f1e7?{'count':_0xaf5ad5,'rows':_0x24f1e7}:null;}})['then'](respondWithResult(_0x53fb62,null))[_0x6a25('0x3f')](handleError(_0x53fb62,null));};exports[_0x6a25('0x4f')]=function(_0x1f8219,_0x4b803e,_0x5f1225){var _0x3f553d={};var _0x318543={};var _0x23a8be;var _0x17c79c;return db[_0x6a25('0x2b')]['findOne']({'where':{'id':_0x1f8219['params']['id']}})[_0x6a25('0x22')](handleEntityNotFound(_0x4b803e,null))[_0x6a25('0x22')](function(_0x29f793){if(_0x29f793){_0x23a8be=_0x29f793;_0x318543[_0x6a25('0x2e')]=_['keys'](db[_0x6a25('0x4a')][_0x6a25('0x42')]);_0x318543[_0x6a25('0x2f')]=_[_0x6a25('0x30')](_0x1f8219[_0x6a25('0x2f')]);_0x318543[_0x6a25('0x31')]=_[_0x6a25('0x32')](_0x318543[_0x6a25('0x2e')],_0x318543['query']);_0x3f553d[_0x6a25('0x34')]=_[_0x6a25('0x32')](_0x318543[_0x6a25('0x2e')],qs[_0x6a25('0x33')](_0x1f8219[_0x6a25('0x2f')][_0x6a25('0x33')]));_0x3f553d[_0x6a25('0x34')]=_0x3f553d['attributes']['length']?_0x3f553d[_0x6a25('0x34')]:_0x318543[_0x6a25('0x2e')];_0x3f553d[_0x6a25('0x4b')]=qs[_0x6a25('0x38')](_0x1f8219[_0x6a25('0x2f')][_0x6a25('0x38')]);_0x3f553d[_0x6a25('0x39')]=qs['filters'](_[_0x6a25('0x3a')](_0x1f8219[_0x6a25('0x2f')],_0x318543[_0x6a25('0x31')]));if(_0x1f8219[_0x6a25('0x2f')][_0x6a25('0x4c')]){_0x3f553d[_0x6a25('0x39')]=_[_0x6a25('0x3b')](_0x3f553d[_0x6a25('0x39')],{'$or':_[_0x6a25('0x2a')](_0x3f553d[_0x6a25('0x34')],function(_0x26f33a){var _0x3974f9={};_0x3974f9[_0x26f33a]={'$like':'%'+_0x1f8219[_0x6a25('0x2f')][_0x6a25('0x4c')]+'%'};return _0x3974f9;})});}_0x3f553d=_[_0x6a25('0x3b')]({},_0x3f553d,_0x1f8219[_0x6a25('0x45')]);return _0x23a8be[_0x6a25('0x4f')](_0x3f553d);}})['then'](function(_0x3dfbec){if(_0x3dfbec){_0x17c79c=_0x3dfbec[_0x6a25('0x35')];if(!_0x1f8219[_0x6a25('0x2f')][_0x6a25('0x36')](_0x6a25('0x37'))){_0x3f553d[_0x6a25('0x1c')]=qs[_0x6a25('0x1c')](_0x1f8219['query'][_0x6a25('0x1c')]);_0x3f553d[_0x6a25('0x19')]=qs[_0x6a25('0x19')](_0x1f8219[_0x6a25('0x2f')][_0x6a25('0x19')]);}return _0x23a8be[_0x6a25('0x4f')](_0x3f553d);}})[_0x6a25('0x22')](function(_0x29f6f2){if(_0x29f6f2){return _0x29f6f2?{'count':_0x17c79c,'rows':_0x29f6f2}:null;}})['then'](respondWithResult(_0x4b803e,null))[_0x6a25('0x3f')](handleError(_0x4b803e,null));}; \ No newline at end of file +var _0x7382=['name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','destroy','getFields','findOne','ServicenowField','hasOwnProperty','nolimit','getSubjects','getDescriptions','rimraf','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','stack'];(function(_0x1ba833,_0x78f8d0){var _0x13c1cc=function(_0x2210c4){while(--_0x2210c4){_0x1ba833['push'](_0x1ba833['shift']());}};_0x13c1cc(++_0x78f8d0);}(_0x7382,0x111));var _0x2738=function(_0xcea6e7,_0xbc5156){_0xcea6e7=_0xcea6e7-0x0;var _0x2f577b=_0x7382[_0xcea6e7];return _0x2f577b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2738('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2738('0x1'));var util=require(_0x2738('0x2'));var path=require(_0x2738('0x3'));var sox=require(_0x2738('0x4'));var csv=require(_0x2738('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2738('0x6'));var _=require(_0x2738('0x7'));var squel=require(_0x2738('0x8'));var crypto=require('crypto');var jsforce=require(_0x2738('0x9'));var deskjs=require(_0x2738('0xa'));var toCsv=require(_0x2738('0x5'));var querystring=require('querystring');var Papa=require(_0x2738('0xb'));var Redis=require(_0x2738('0xc'));var authService=require(_0x2738('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x2738('0xe'));var hardwareService=require(_0x2738('0xf'));var logger=require(_0x2738('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2738('0x11'));var licenseUtil=require(_0x2738('0x12'));var db=require(_0x2738('0x13'))['db'];function respondWithStatusCode(_0x217902,_0x15dcde){_0x15dcde=_0x15dcde||0xcc;return function(_0x39214a){if(_0x39214a){return _0x217902[_0x2738('0x14')](_0x15dcde);}return _0x217902[_0x2738('0x15')](_0x15dcde)[_0x2738('0x16')]();};}function respondWithResult(_0x3ccb48,_0x384fd3){_0x384fd3=_0x384fd3||0xc8;return function(_0x5dfa58){if(_0x5dfa58){return _0x3ccb48[_0x2738('0x15')](_0x384fd3)[_0x2738('0x17')](_0x5dfa58);}};}function respondWithFilteredResult(_0x4fe443,_0x222f9e){return function(_0x4f3c03){if(_0x4f3c03){var _0xba2b73=typeof _0x222f9e['offset']===_0x2738('0x18')&&typeof _0x222f9e['limit']===_0x2738('0x18');var _0x6c3d05=_0x4f3c03[_0x2738('0x19')];var _0x3c6810=_0xba2b73?0x0:_0x222f9e[_0x2738('0x1a')];var _0x1e0f57=_0xba2b73?_0x4f3c03[_0x2738('0x19')]:_0x222f9e[_0x2738('0x1a')]+_0x222f9e['limit'];var _0x4407c1;if(_0x1e0f57>=_0x6c3d05){_0x1e0f57=_0x6c3d05;_0x4407c1=0xc8;}else{_0x4407c1=0xce;}_0x4fe443['status'](_0x4407c1);return _0x4fe443[_0x2738('0x1b')](_0x2738('0x1c'),_0x3c6810+'-'+_0x1e0f57+'/'+_0x6c3d05)['json'](_0x4f3c03);}return null;};}function patchUpdates(_0x5a1d61){return function(_0x1543b0){try{jsonpatch[_0x2738('0x1d')](_0x1543b0,_0x5a1d61,!![]);}catch(_0x234913){return BPromise[_0x2738('0x1e')](_0x234913);}return _0x1543b0[_0x2738('0x1f')]();};}function saveUpdates(_0x2cbd7a,_0x18e1d8){return function(_0x38ad0d){if(_0x38ad0d){return _0x38ad0d[_0x2738('0x20')](_0x2cbd7a)[_0x2738('0x21')](function(_0x2ea043){return _0x2ea043;});}return null;};}function removeEntity(_0x502fcb,_0x347d10){return function(_0x537c5f){if(_0x537c5f){return _0x537c5f['destroy']()[_0x2738('0x21')](function(){_0x502fcb[_0x2738('0x15')](0xcc)[_0x2738('0x16')]();});}};}function handleEntityNotFound(_0x25c6e0,_0x13545f){return function(_0x2ea92a){if(!_0x2ea92a){_0x25c6e0[_0x2738('0x14')](0x194);}return _0x2ea92a;};}function handleError(_0x20b347,_0x4ec0e1){_0x4ec0e1=_0x4ec0e1||0x1f4;return function(_0x24c8b9){logger['error'](_0x24c8b9[_0x2738('0x22')]);if(_0x24c8b9[_0x2738('0x23')]){delete _0x24c8b9['name'];}_0x20b347[_0x2738('0x15')](_0x4ec0e1)[_0x2738('0x24')](_0x24c8b9);};}exports['index']=function(_0x5e7be4,_0x4fad4c){var _0x59b860={},_0x926abd={},_0x36444b={'count':0x0,'rows':[]};var _0xaf2746=_[_0x2738('0x25')](db[_0x2738('0x26')][_0x2738('0x27')],function(_0x53562a){return{'name':_0x53562a[_0x2738('0x28')],'type':_0x53562a[_0x2738('0x29')][_0x2738('0x2a')]};});_0x926abd[_0x2738('0x2b')]=_[_0x2738('0x25')](_0xaf2746,'name');_0x926abd[_0x2738('0x2c')]=_[_0x2738('0x2d')](_0x5e7be4[_0x2738('0x2c')]);_0x926abd[_0x2738('0x2e')]=_[_0x2738('0x2f')](_0x926abd['model'],_0x926abd[_0x2738('0x2c')]);_0x59b860['attributes']=_['intersection'](_0x926abd[_0x2738('0x2b')],qs[_0x2738('0x30')](_0x5e7be4[_0x2738('0x2c')][_0x2738('0x30')]));_0x59b860['attributes']=_0x59b860[_0x2738('0x31')][_0x2738('0x32')]?_0x59b860[_0x2738('0x31')]:_0x926abd[_0x2738('0x2b')];if(!_0x5e7be4[_0x2738('0x2c')]['hasOwnProperty']('nolimit')){_0x59b860[_0x2738('0x33')]=qs['limit'](_0x5e7be4[_0x2738('0x2c')][_0x2738('0x33')]);_0x59b860[_0x2738('0x1a')]=qs[_0x2738('0x1a')](_0x5e7be4[_0x2738('0x2c')][_0x2738('0x1a')]);}_0x59b860[_0x2738('0x34')]=qs[_0x2738('0x35')](_0x5e7be4[_0x2738('0x2c')][_0x2738('0x35')]);_0x59b860[_0x2738('0x36')]=qs[_0x2738('0x2e')](_[_0x2738('0x37')](_0x5e7be4[_0x2738('0x2c')],_0x926abd[_0x2738('0x2e')]),_0xaf2746);if(_0x5e7be4['query'][_0x2738('0x38')]){_0x59b860[_0x2738('0x36')]=_[_0x2738('0x39')](_0x59b860[_0x2738('0x36')],{'$or':_[_0x2738('0x25')](_0xaf2746,function(_0x16b031){if(_0x16b031['type']!==_0x2738('0x3a')){var _0x48bba={};_0x48bba[_0x16b031[_0x2738('0x23')]]={'$like':'%'+_0x5e7be4['query'][_0x2738('0x38')]+'%'};return _0x48bba;}})});}_0x59b860=_[_0x2738('0x39')]({},_0x59b860,_0x5e7be4['options']);var _0x4ff358={'where':_0x59b860[_0x2738('0x36')]};return db['ServicenowConfiguration'][_0x2738('0x19')](_0x4ff358)[_0x2738('0x21')](function(_0x1dc743){_0x36444b[_0x2738('0x19')]=_0x1dc743;if(_0x5e7be4[_0x2738('0x2c')][_0x2738('0x3b')]){_0x59b860[_0x2738('0x3c')]=[{'all':!![]}];}return db[_0x2738('0x26')]['findAll'](_0x59b860);})[_0x2738('0x21')](function(_0x243664){_0x36444b[_0x2738('0x3d')]=_0x243664;return _0x36444b;})[_0x2738('0x21')](respondWithFilteredResult(_0x4fad4c,_0x59b860))[_0x2738('0x3e')](handleError(_0x4fad4c,null));};exports[_0x2738('0x3f')]=function(_0x1c6211,_0x18d283){var _0xf37380={'raw':![],'where':{'id':_0x1c6211[_0x2738('0x40')]['id']}},_0x1ac73e={};_0x1ac73e[_0x2738('0x2b')]=_[_0x2738('0x2d')](db[_0x2738('0x26')][_0x2738('0x27')]);_0x1ac73e[_0x2738('0x2c')]=_[_0x2738('0x2d')](_0x1c6211['query']);_0x1ac73e[_0x2738('0x2e')]=_['intersection'](_0x1ac73e['model'],_0x1ac73e[_0x2738('0x2c')]);_0xf37380[_0x2738('0x31')]=_['intersection'](_0x1ac73e[_0x2738('0x2b')],qs[_0x2738('0x30')](_0x1c6211[_0x2738('0x2c')][_0x2738('0x30')]));_0xf37380[_0x2738('0x31')]=_0xf37380['attributes'][_0x2738('0x32')]?_0xf37380[_0x2738('0x31')]:_0x1ac73e[_0x2738('0x2b')];if(_0x1c6211[_0x2738('0x2c')][_0x2738('0x3b')]){_0xf37380[_0x2738('0x3c')]=[{'all':!![]}];}_0xf37380=_[_0x2738('0x39')]({},_0xf37380,_0x1c6211[_0x2738('0x41')]);return db[_0x2738('0x26')][_0x2738('0x42')](_0xf37380)[_0x2738('0x21')](handleEntityNotFound(_0x18d283,null))[_0x2738('0x21')](respondWithResult(_0x18d283,null))['catch'](handleError(_0x18d283,null));};exports['create']=function(_0x522b22,_0x9fa1dc){return db[_0x2738('0x26')][_0x2738('0x43')](_0x522b22[_0x2738('0x44')],{})[_0x2738('0x21')](respondWithResult(_0x9fa1dc,0xc9))[_0x2738('0x3e')](handleError(_0x9fa1dc,null));};exports[_0x2738('0x20')]=function(_0x43ff7d,_0x5108bd){if(_0x43ff7d[_0x2738('0x44')]['id']){delete _0x43ff7d[_0x2738('0x44')]['id'];}return db[_0x2738('0x26')][_0x2738('0x42')]({'where':{'id':_0x43ff7d['params']['id']}})['then'](handleEntityNotFound(_0x5108bd,null))[_0x2738('0x21')](saveUpdates(_0x43ff7d[_0x2738('0x44')],null))['then'](respondWithResult(_0x5108bd,null))[_0x2738('0x3e')](handleError(_0x5108bd,null));};exports[_0x2738('0x45')]=function(_0x3c5bcc,_0x343471){return db[_0x2738('0x26')][_0x2738('0x42')]({'where':{'id':_0x3c5bcc[_0x2738('0x40')]['id']}})['then'](handleEntityNotFound(_0x343471,null))[_0x2738('0x21')](removeEntity(_0x343471,null))[_0x2738('0x3e')](handleError(_0x343471,null));};exports[_0x2738('0x46')]=function(_0x2d8f30,_0x30b34d,_0x540afc){var _0x6105d2={};var _0x30e4f7={};var _0xa32a86;var _0x31f869;return db[_0x2738('0x26')][_0x2738('0x47')]({'where':{'id':_0x2d8f30[_0x2738('0x40')]['id']}})[_0x2738('0x21')](handleEntityNotFound(_0x30b34d,null))[_0x2738('0x21')](function(_0x22150a){if(_0x22150a){_0xa32a86=_0x22150a;_0x30e4f7[_0x2738('0x2b')]=_[_0x2738('0x2d')](db[_0x2738('0x48')]['rawAttributes']);_0x30e4f7[_0x2738('0x2c')]=_['keys'](_0x2d8f30[_0x2738('0x2c')]);_0x30e4f7[_0x2738('0x2e')]=_['intersection'](_0x30e4f7[_0x2738('0x2b')],_0x30e4f7[_0x2738('0x2c')]);_0x6105d2[_0x2738('0x31')]=_['intersection'](_0x30e4f7[_0x2738('0x2b')],qs[_0x2738('0x30')](_0x2d8f30['query'][_0x2738('0x30')]));_0x6105d2[_0x2738('0x31')]=_0x6105d2[_0x2738('0x31')][_0x2738('0x32')]?_0x6105d2[_0x2738('0x31')]:_0x30e4f7[_0x2738('0x2b')];_0x6105d2['order']=qs[_0x2738('0x35')](_0x2d8f30['query'][_0x2738('0x35')]);_0x6105d2[_0x2738('0x36')]=qs[_0x2738('0x2e')](_[_0x2738('0x37')](_0x2d8f30[_0x2738('0x2c')],_0x30e4f7[_0x2738('0x2e')]));if(_0x2d8f30['query'][_0x2738('0x38')]){_0x6105d2['where']=_['merge'](_0x6105d2[_0x2738('0x36')],{'$or':_[_0x2738('0x25')](_0x6105d2[_0x2738('0x31')],function(_0x2391c1){var _0x45cbb7={};_0x45cbb7[_0x2391c1]={'$like':'%'+_0x2d8f30[_0x2738('0x2c')][_0x2738('0x38')]+'%'};return _0x45cbb7;})});}_0x6105d2=_[_0x2738('0x39')]({},_0x6105d2,_0x2d8f30['options']);return _0xa32a86[_0x2738('0x46')](_0x6105d2);}})[_0x2738('0x21')](function(_0x201b9e){if(_0x201b9e){_0x31f869=_0x201b9e['length'];if(!_0x2d8f30[_0x2738('0x2c')][_0x2738('0x49')](_0x2738('0x4a'))){_0x6105d2['limit']=qs[_0x2738('0x33')](_0x2d8f30['query'][_0x2738('0x33')]);_0x6105d2['offset']=qs['offset'](_0x2d8f30[_0x2738('0x2c')][_0x2738('0x1a')]);}return _0xa32a86[_0x2738('0x46')](_0x6105d2);}})[_0x2738('0x21')](function(_0x1196c6){if(_0x1196c6){return _0x1196c6?{'count':_0x31f869,'rows':_0x1196c6}:null;}})[_0x2738('0x21')](respondWithResult(_0x30b34d,null))[_0x2738('0x3e')](handleError(_0x30b34d,null));};exports[_0x2738('0x4b')]=function(_0x197287,_0x5af7b5,_0xa3ca73){var _0x4ec105={};var _0x313378={};var _0x53b69d;var _0x569af5;return db[_0x2738('0x26')]['findOne']({'where':{'id':_0x197287[_0x2738('0x40')]['id']}})[_0x2738('0x21')](handleEntityNotFound(_0x5af7b5,null))['then'](function(_0x54af46){if(_0x54af46){_0x53b69d=_0x54af46;_0x313378[_0x2738('0x2b')]=_[_0x2738('0x2d')](db[_0x2738('0x48')]['rawAttributes']);_0x313378[_0x2738('0x2c')]=_[_0x2738('0x2d')](_0x197287[_0x2738('0x2c')]);_0x313378['filters']=_['intersection'](_0x313378[_0x2738('0x2b')],_0x313378[_0x2738('0x2c')]);_0x4ec105['attributes']=_[_0x2738('0x2f')](_0x313378['model'],qs[_0x2738('0x30')](_0x197287[_0x2738('0x2c')][_0x2738('0x30')]));_0x4ec105['attributes']=_0x4ec105['attributes'][_0x2738('0x32')]?_0x4ec105[_0x2738('0x31')]:_0x313378[_0x2738('0x2b')];_0x4ec105[_0x2738('0x34')]=qs[_0x2738('0x35')](_0x197287[_0x2738('0x2c')]['sort']);_0x4ec105[_0x2738('0x36')]=qs[_0x2738('0x2e')](_[_0x2738('0x37')](_0x197287[_0x2738('0x2c')],_0x313378[_0x2738('0x2e')]));if(_0x197287[_0x2738('0x2c')][_0x2738('0x38')]){_0x4ec105['where']=_[_0x2738('0x39')](_0x4ec105[_0x2738('0x36')],{'$or':_[_0x2738('0x25')](_0x4ec105[_0x2738('0x31')],function(_0x581180){var _0x5a0ab3={};_0x5a0ab3[_0x581180]={'$like':'%'+_0x197287[_0x2738('0x2c')][_0x2738('0x38')]+'%'};return _0x5a0ab3;})});}_0x4ec105=_[_0x2738('0x39')]({},_0x4ec105,_0x197287[_0x2738('0x41')]);return _0x53b69d['getSubjects'](_0x4ec105);}})[_0x2738('0x21')](function(_0x36bc62){if(_0x36bc62){_0x569af5=_0x36bc62[_0x2738('0x32')];if(!_0x197287['query'][_0x2738('0x49')](_0x2738('0x4a'))){_0x4ec105[_0x2738('0x33')]=qs[_0x2738('0x33')](_0x197287[_0x2738('0x2c')][_0x2738('0x33')]);_0x4ec105[_0x2738('0x1a')]=qs[_0x2738('0x1a')](_0x197287[_0x2738('0x2c')][_0x2738('0x1a')]);}return _0x53b69d[_0x2738('0x4b')](_0x4ec105);}})[_0x2738('0x21')](function(_0x1a6a3d){if(_0x1a6a3d){return _0x1a6a3d?{'count':_0x569af5,'rows':_0x1a6a3d}:null;}})['then'](respondWithResult(_0x5af7b5,null))['catch'](handleError(_0x5af7b5,null));};exports['getDescriptions']=function(_0x5582a5,_0x1cd3a5,_0xf55fd9){var _0x55a066={};var _0x18cec4={};var _0x2e0a3b;var _0x360976;return db['ServicenowConfiguration'][_0x2738('0x47')]({'where':{'id':_0x5582a5[_0x2738('0x40')]['id']}})[_0x2738('0x21')](handleEntityNotFound(_0x1cd3a5,null))[_0x2738('0x21')](function(_0x4af6b4){if(_0x4af6b4){_0x2e0a3b=_0x4af6b4;_0x18cec4[_0x2738('0x2b')]=_['keys'](db[_0x2738('0x48')][_0x2738('0x27')]);_0x18cec4[_0x2738('0x2c')]=_['keys'](_0x5582a5[_0x2738('0x2c')]);_0x18cec4[_0x2738('0x2e')]=_[_0x2738('0x2f')](_0x18cec4[_0x2738('0x2b')],_0x18cec4['query']);_0x55a066[_0x2738('0x31')]=_[_0x2738('0x2f')](_0x18cec4[_0x2738('0x2b')],qs['fields'](_0x5582a5[_0x2738('0x2c')]['fields']));_0x55a066[_0x2738('0x31')]=_0x55a066['attributes'][_0x2738('0x32')]?_0x55a066['attributes']:_0x18cec4[_0x2738('0x2b')];_0x55a066[_0x2738('0x34')]=qs[_0x2738('0x35')](_0x5582a5[_0x2738('0x2c')][_0x2738('0x35')]);_0x55a066[_0x2738('0x36')]=qs[_0x2738('0x2e')](_['pick'](_0x5582a5[_0x2738('0x2c')],_0x18cec4[_0x2738('0x2e')]));if(_0x5582a5['query']['filter']){_0x55a066[_0x2738('0x36')]=_[_0x2738('0x39')](_0x55a066[_0x2738('0x36')],{'$or':_[_0x2738('0x25')](_0x55a066[_0x2738('0x31')],function(_0x5e1112){var _0x30133e={};_0x30133e[_0x5e1112]={'$like':'%'+_0x5582a5[_0x2738('0x2c')]['filter']+'%'};return _0x30133e;})});}_0x55a066=_['merge']({},_0x55a066,_0x5582a5[_0x2738('0x41')]);return _0x2e0a3b[_0x2738('0x4c')](_0x55a066);}})[_0x2738('0x21')](function(_0x3cc1ee){if(_0x3cc1ee){_0x360976=_0x3cc1ee[_0x2738('0x32')];if(!_0x5582a5[_0x2738('0x2c')][_0x2738('0x49')]('nolimit')){_0x55a066[_0x2738('0x33')]=qs[_0x2738('0x33')](_0x5582a5[_0x2738('0x2c')][_0x2738('0x33')]);_0x55a066[_0x2738('0x1a')]=qs[_0x2738('0x1a')](_0x5582a5[_0x2738('0x2c')][_0x2738('0x1a')]);}return _0x2e0a3b[_0x2738('0x4c')](_0x55a066);}})[_0x2738('0x21')](function(_0x317ecf){if(_0x317ecf){return _0x317ecf?{'count':_0x360976,'rows':_0x317ecf}:null;}})[_0x2738('0x21')](respondWithResult(_0x1cd3a5,null))['catch'](handleError(_0x1cd3a5,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 51ac311..d5e8dfc 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 _0x7382=['define','int_servicenow_configurations','util','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0xf167c9,_0x492c62){var _0x3c7a2e=function(_0x2cb7e0){while(--_0x2cb7e0){_0xf167c9['push'](_0xf167c9['shift']());}};_0x3c7a2e(++_0x492c62);}(_0x7382,0x1f2));var _0x2738=function(_0x5be73b,_0x2a05a){_0x5be73b=_0x5be73b-0x0;var _0x16d1f6=_0x7382[_0x5be73b];return _0x16d1f6;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2738('0x1'));var BPromise=require('bluebird');var rp=require(_0x2738('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2738('0x3'));var config=require(_0x2738('0x4'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x2738('0x5')]=function(_0x267a1a,_0x457c61){return _0x267a1a[_0x2738('0x6')]('ServicenowConfiguration',attributes,{'tableName':_0x2738('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d25=['api','moment','bluebird','request-promise','path','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger'];(function(_0x80544e,_0x37a3f3){var _0x4f9b90=function(_0x4f95d6){while(--_0x4f95d6){_0x80544e['push'](_0x80544e['shift']());}};_0x4f9b90(++_0x37a3f3);}(_0x7d25,0x8a));var _0x57d2=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x7d25[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('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 c6118ba..a5aeea2 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 _0x1486=['../../config/utils','../../config/logger','rpc','jayson/promise','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x58facd,_0x11b5d6){var _0x361786=function(_0x3d31be){while(--_0x3d31be){_0x58facd['push'](_0x58facd['shift']());}};_0x361786(++_0x11b5d6);}(_0x1486,0x1b4));var _0x6148=function(_0x4ae257,_0xfffc24){_0x4ae257=_0x4ae257-0x0;var _0x43f778=_0x1486[_0x4ae257];return _0x43f778;};'use strict';var _=require(_0x6148('0x0'));var util=require(_0x6148('0x1'));var moment=require(_0x6148('0x2'));var BPromise=require(_0x6148('0x3'));var rs=require(_0x6148('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6148('0x5'));var logger=require(_0x6148('0x6'))(_0x6148('0x7'));var config=require('../../config/environment');var jayson=require(_0x6148('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x481fb6,_0x41ac0b,_0x522271){return new BPromise(function(_0x11e99b,_0x21a336){return client['request'](_0x481fb6,_0x522271)[_0x6148('0x9')](function(_0x24bed3){logger[_0x6148('0xa')](_0x6148('0xb'),_0x41ac0b,_0x6148('0xc'));logger[_0x6148('0xd')](_0x6148('0xe'),_0x41ac0b,_0x6148('0xc'),JSON[_0x6148('0xf')](_0x24bed3));if(_0x24bed3[_0x6148('0x10')]){if(_0x24bed3['error'][_0x6148('0x11')]===0x1f4){logger[_0x6148('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x41ac0b,_0x24bed3['error'][_0x6148('0x12')]);return _0x21a336(_0x24bed3[_0x6148('0x10')][_0x6148('0x12')]);}logger[_0x6148('0x10')](_0x6148('0xb'),_0x41ac0b,_0x24bed3[_0x6148('0x10')]['message']);return _0x11e99b(_0x24bed3[_0x6148('0x10')][_0x6148('0x12')]);}else{logger[_0x6148('0xa')](_0x6148('0xb'),_0x41ac0b,_0x6148('0xc'));_0x11e99b(_0x24bed3[_0x6148('0x13')][_0x6148('0x12')]);}})[_0x6148('0x14')](function(_0x5838ed){logger['error'](_0x6148('0xb'),_0x41ac0b,_0x5838ed);_0x21a336(_0x5838ed);});});} \ No newline at end of file +var _0x6e12=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x6e12,0xac));var _0x26e1=function(_0x5d6a1d,_0x198f84){_0x5d6a1d=_0x5d6a1d-0x0;var _0x177313=_0x6e12[_0x5d6a1d];return _0x177313;};'use strict';var _=require(_0x26e1('0x0'));var util=require(_0x26e1('0x1'));var moment=require(_0x26e1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26e1('0x3'));var db=require(_0x26e1('0x4'))['db'];var utils=require(_0x26e1('0x5'));var logger=require(_0x26e1('0x6'))(_0x26e1('0x7'));var config=require('../../config/environment');var jayson=require(_0x26e1('0x8'));var client=jayson[_0x26e1('0x9')][_0x26e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37a7cd,_0x5aa0a6,_0x1e2419){return new BPromise(function(_0x2d3f7c,_0xb76811){return client[_0x26e1('0xb')](_0x37a7cd,_0x1e2419)[_0x26e1('0xc')](function(_0x2499e1){logger[_0x26e1('0xd')](_0x26e1('0xe'),_0x5aa0a6,_0x26e1('0xf'));logger[_0x26e1('0x10')](_0x26e1('0x11'),_0x5aa0a6,_0x26e1('0xf'),JSON[_0x26e1('0x12')](_0x2499e1));if(_0x2499e1[_0x26e1('0x13')]){if(_0x2499e1['error'][_0x26e1('0x14')]===0x1f4){logger[_0x26e1('0x13')](_0x26e1('0xe'),_0x5aa0a6,_0x2499e1[_0x26e1('0x13')]['message']);return _0xb76811(_0x2499e1[_0x26e1('0x13')][_0x26e1('0x15')]);}logger[_0x26e1('0x13')](_0x26e1('0xe'),_0x5aa0a6,_0x2499e1[_0x26e1('0x13')][_0x26e1('0x15')]);return _0x2d3f7c(_0x2499e1[_0x26e1('0x13')][_0x26e1('0x15')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x5aa0a6,_0x26e1('0xf'));_0x2d3f7c(_0x2499e1['result'][_0x26e1('0x15')]);}})[_0x26e1('0x16')](function(_0xb54d23){logger[_0x26e1('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5aa0a6,_0xb54d23);_0xb76811(_0xb54d23);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index ed1e966..a880738 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 _0x565a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','util','path'];(function(_0x315293,_0x305859){var _0x2dbda6=function(_0xd87786){while(--_0xd87786){_0x315293['push'](_0x315293['shift']());}};_0x2dbda6(++_0x305859);}(_0x565a,0x154));var _0xa565=function(_0x155571,_0x140f7f){_0x155571=_0x155571-0x0;var _0x1960da=_0x565a[_0x155571];return _0x1960da;};'use strict';var multer=require('multer');var util=require(_0xa565('0x0'));var path=require(_0xa565('0x1'));var timeout=require(_0xa565('0x2'));var express=require('express');var router=express[_0xa565('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa565('0x4'));var interaction=require(_0xa565('0x5'));var config=require(_0xa565('0x6'));var controller=require(_0xa565('0x7'));router[_0xa565('0x8')]('/',auth[_0xa565('0x9')](),controller[_0xa565('0xa')]);router[_0xa565('0x8')](_0xa565('0xb'),auth[_0xa565('0x9')](),controller[_0xa565('0xc')]);router[_0xa565('0xd')]('/',auth[_0xa565('0x9')](),controller[_0xa565('0xe')]);router[_0xa565('0xf')](_0xa565('0xb'),auth[_0xa565('0x9')](),controller[_0xa565('0x10')]);router[_0xa565('0x11')](_0xa565('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf8e5=['fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','util','express','Router'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf8e5,0xb1));var _0x5f8e=function(_0x5b3833,_0x49dd84){_0x5b3833=_0x5b3833-0x0;var _0x81f33e=_0xf8e5[_0x5b3833];return _0x81f33e;};'use strict';var multer=require('multer');var util=require(_0x5f8e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f8e('0x1'));var router=express[_0x5f8e('0x2')]();var fs_extra=require(_0x5f8e('0x3'));var auth=require(_0x5f8e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5f8e('0x5'));var controller=require(_0x5f8e('0x6'));router[_0x5f8e('0x7')]('/',auth[_0x5f8e('0x8')](),controller[_0x5f8e('0x9')]);router[_0x5f8e('0x7')](_0x5f8e('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5f8e('0x8')](),controller[_0x5f8e('0xb')]);router[_0x5f8e('0xc')](_0x5f8e('0xa'),auth[_0x5f8e('0x8')](),controller[_0x5f8e('0xd')]);router['delete']('/:id',auth[_0x5f8e('0x8')](),controller[_0x5f8e('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index fb3303a..a824f94 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 _0x7b05=['string','variable','keyValue','picklist','STRING','customVariable','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b05,0x1de));var _0x57b0=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0x7b05[_0x318410];return _0x2898a3;};'use strict';var Sequelize=require('sequelize');module[_0x57b0('0x0')]={'type':{'type':Sequelize[_0x57b0('0x1')](_0x57b0('0x2'),_0x57b0('0x3'),'customVariable',_0x57b0('0x4'),_0x57b0('0x5')),'defaultValue':_0x57b0('0x2')},'content':{'type':Sequelize[_0x57b0('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x57b0('0x1')]('string',_0x57b0('0x3'),_0x57b0('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x57b0('0x6')]},'nameField':{'type':Sequelize[_0x57b0('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x57b0('0x6')]}}; \ No newline at end of file +var _0x4ed9=['customVariable','keyValue','picklist','STRING','variable','sequelize','exports','ENUM','string'];(function(_0x24487f,_0x9b3ea0){var _0x456456=function(_0x2ba373){while(--_0x2ba373){_0x24487f['push'](_0x24487f['shift']());}};_0x456456(++_0x9b3ea0);}(_0x4ed9,0xb9));var _0x94ed=function(_0x5bb523,_0xb54fa0){_0x5bb523=_0x5bb523-0x0;var _0x1bd086=_0x4ed9[_0x5bb523];return _0x1bd086;};'use strict';var Sequelize=require(_0x94ed('0x0'));module[_0x94ed('0x1')]={'type':{'type':Sequelize[_0x94ed('0x2')](_0x94ed('0x3'),'variable',_0x94ed('0x4'),_0x94ed('0x5'),_0x94ed('0x6')),'defaultValue':_0x94ed('0x3')},'content':{'type':Sequelize[_0x94ed('0x7')]},'key':{'type':Sequelize[_0x94ed('0x7')]},'keyType':{'type':Sequelize[_0x94ed('0x2')](_0x94ed('0x3'),_0x94ed('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x94ed('0x7')]},'idField':{'type':Sequelize[_0x94ed('0x7')]},'nameField':{'type':Sequelize[_0x94ed('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x94ed('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 83fe794..3385ed5 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 _0x75f8=['intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','ServicenowField','findAll','rows','params','keys','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes'];(function(_0x11d6da,_0x4862ec){var _0x5293ef=function(_0x5488e4){while(--_0x5488e4){_0x11d6da['push'](_0x11d6da['shift']());}};_0x5293ef(++_0x4862ec);}(_0x75f8,0x18e));var _0x875f=function(_0x40cb7a,_0x505484){_0x40cb7a=_0x40cb7a-0x0;var _0x246f9c=_0x75f8[_0x40cb7a];return _0x246f9c;};'use strict';var emlformat=require(_0x875f('0x0'));var rimraf=require(_0x875f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x875f('0x2'));var rp=require(_0x875f('0x3'));var moment=require(_0x875f('0x4'));var BPromise=require(_0x875f('0x5'));var Mustache=require(_0x875f('0x6'));var util=require(_0x875f('0x7'));var path=require(_0x875f('0x8'));var sox=require(_0x875f('0x9'));var csv=require(_0x875f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x875f('0xb'));var _=require(_0x875f('0xc'));var squel=require('squel');var crypto=require(_0x875f('0xd'));var jsforce=require(_0x875f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x875f('0xf'));var Papa=require(_0x875f('0x10'));var Redis=require(_0x875f('0x11'));var authService=require(_0x875f('0x12'));var qs=require(_0x875f('0x13'));var as=require(_0x875f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x875f('0x15'))(_0x875f('0x16'));var utils=require(_0x875f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x875f('0x18'));var db=require(_0x875f('0x19'))['db'];function respondWithStatusCode(_0x15558c,_0x317307){_0x317307=_0x317307||0xcc;return function(_0x559c87){if(_0x559c87){return _0x15558c[_0x875f('0x1a')](_0x317307);}return _0x15558c[_0x875f('0x1b')](_0x317307)['end']();};}function respondWithResult(_0x1dad41,_0x56f658){_0x56f658=_0x56f658||0xc8;return function(_0x3e454f){if(_0x3e454f){return _0x1dad41[_0x875f('0x1b')](_0x56f658)[_0x875f('0x1c')](_0x3e454f);}};}function respondWithFilteredResult(_0x29707b,_0x1b6394){return function(_0x37f8e2){if(_0x37f8e2){var _0x3b7062=typeof _0x1b6394['offset']===_0x875f('0x1d')&&typeof _0x1b6394[_0x875f('0x1e')]===_0x875f('0x1d');var _0x4cfd51=_0x37f8e2[_0x875f('0x1f')];var _0x2cb5bc=_0x3b7062?0x0:_0x1b6394[_0x875f('0x20')];var _0x3b9a8a=_0x3b7062?_0x37f8e2[_0x875f('0x1f')]:_0x1b6394['offset']+_0x1b6394[_0x875f('0x1e')];var _0x25be6e;if(_0x3b9a8a>=_0x4cfd51){_0x3b9a8a=_0x4cfd51;_0x25be6e=0xc8;}else{_0x25be6e=0xce;}_0x29707b['status'](_0x25be6e);return _0x29707b[_0x875f('0x21')]('Content-Range',_0x2cb5bc+'-'+_0x3b9a8a+'/'+_0x4cfd51)[_0x875f('0x1c')](_0x37f8e2);}return null;};}function patchUpdates(_0x56e2dc){return function(_0x11d29e){try{jsonpatch[_0x875f('0x22')](_0x11d29e,_0x56e2dc,!![]);}catch(_0x27671c){return BPromise[_0x875f('0x23')](_0x27671c);}return _0x11d29e['save']();};}function saveUpdates(_0x30d209,_0x1c51dc){return function(_0x3b131c){if(_0x3b131c){return _0x3b131c[_0x875f('0x24')](_0x30d209)[_0x875f('0x25')](function(_0x56e32b){return _0x56e32b;});}return null;};}function removeEntity(_0x2913d1,_0xc80ab2){return function(_0x1be375){if(_0x1be375){return _0x1be375[_0x875f('0x26')]()[_0x875f('0x25')](function(){_0x2913d1[_0x875f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a672,_0x5ef890){return function(_0x3d3ddb){if(!_0x3d3ddb){_0x31a672[_0x875f('0x1a')](0x194);}return _0x3d3ddb;};}function handleError(_0xa0d9b2,_0x593ca8){_0x593ca8=_0x593ca8||0x1f4;return function(_0x2ad5f3){logger[_0x875f('0x27')](_0x2ad5f3['stack']);if(_0x2ad5f3['name']){delete _0x2ad5f3['name'];}_0xa0d9b2[_0x875f('0x1b')](_0x593ca8)[_0x875f('0x28')](_0x2ad5f3);};}exports[_0x875f('0x29')]=function(_0x3a36fd,_0x3d4760){var _0x3dec98={},_0x6362db={},_0x5eb752={'count':0x0,'rows':[]};var _0x2799d8=_[_0x875f('0x2a')](db['ServicenowField'][_0x875f('0x2b')],function(_0x30aeb8){return{'name':_0x30aeb8[_0x875f('0x2c')],'type':_0x30aeb8[_0x875f('0x2d')][_0x875f('0x2e')]};});_0x6362db[_0x875f('0x2f')]=_['map'](_0x2799d8,_0x875f('0x30'));_0x6362db['query']=_['keys'](_0x3a36fd[_0x875f('0x31')]);_0x6362db[_0x875f('0x32')]=_['intersection'](_0x6362db[_0x875f('0x2f')],_0x6362db[_0x875f('0x31')]);_0x3dec98[_0x875f('0x33')]=_[_0x875f('0x34')](_0x6362db[_0x875f('0x2f')],qs[_0x875f('0x35')](_0x3a36fd[_0x875f('0x31')][_0x875f('0x35')]));_0x3dec98[_0x875f('0x33')]=_0x3dec98[_0x875f('0x33')]['length']?_0x3dec98[_0x875f('0x33')]:_0x6362db[_0x875f('0x2f')];if(!_0x3a36fd[_0x875f('0x31')][_0x875f('0x36')](_0x875f('0x37'))){_0x3dec98[_0x875f('0x1e')]=qs[_0x875f('0x1e')](_0x3a36fd[_0x875f('0x31')][_0x875f('0x1e')]);_0x3dec98[_0x875f('0x20')]=qs[_0x875f('0x20')](_0x3a36fd[_0x875f('0x31')][_0x875f('0x20')]);}_0x3dec98[_0x875f('0x38')]=qs[_0x875f('0x39')](_0x3a36fd['query']['sort']);_0x3dec98[_0x875f('0x3a')]=qs[_0x875f('0x32')](_[_0x875f('0x3b')](_0x3a36fd[_0x875f('0x31')],_0x6362db[_0x875f('0x32')]),_0x2799d8);if(_0x3a36fd['query']['filter']){_0x3dec98[_0x875f('0x3a')]=_['merge'](_0x3dec98[_0x875f('0x3a')],{'$or':_['map'](_0x2799d8,function(_0x530502){if(_0x530502[_0x875f('0x2d')]!=='VIRTUAL'){var _0x3f832e={};_0x3f832e[_0x530502[_0x875f('0x30')]]={'$like':'%'+_0x3a36fd[_0x875f('0x31')][_0x875f('0x3c')]+'%'};return _0x3f832e;}})});}_0x3dec98=_[_0x875f('0x3d')]({},_0x3dec98,_0x3a36fd[_0x875f('0x3e')]);var _0x2fecab={'where':_0x3dec98['where']};return db['ServicenowField'][_0x875f('0x1f')](_0x2fecab)[_0x875f('0x25')](function(_0x2e5704){_0x5eb752['count']=_0x2e5704;if(_0x3a36fd['query'][_0x875f('0x3f')]){_0x3dec98[_0x875f('0x40')]=[{'all':!![]}];}return db[_0x875f('0x41')][_0x875f('0x42')](_0x3dec98);})[_0x875f('0x25')](function(_0x2af38b){_0x5eb752[_0x875f('0x43')]=_0x2af38b;return _0x5eb752;})['then'](respondWithFilteredResult(_0x3d4760,_0x3dec98))['catch'](handleError(_0x3d4760,null));};exports['show']=function(_0x21c159,_0x57c1d6){var _0x1fb275={'raw':!![],'where':{'id':_0x21c159[_0x875f('0x44')]['id']}},_0xf494d={};_0xf494d[_0x875f('0x2f')]=_[_0x875f('0x45')](db[_0x875f('0x41')]['rawAttributes']);_0xf494d['query']=_[_0x875f('0x45')](_0x21c159[_0x875f('0x31')]);_0xf494d[_0x875f('0x32')]=_[_0x875f('0x34')](_0xf494d[_0x875f('0x2f')],_0xf494d['query']);_0x1fb275[_0x875f('0x33')]=_['intersection'](_0xf494d['model'],qs[_0x875f('0x35')](_0x21c159['query'][_0x875f('0x35')]));_0x1fb275['attributes']=_0x1fb275[_0x875f('0x33')][_0x875f('0x46')]?_0x1fb275['attributes']:_0xf494d[_0x875f('0x2f')];if(_0x21c159[_0x875f('0x31')][_0x875f('0x3f')]){_0x1fb275[_0x875f('0x40')]=[{'all':!![]}];}_0x1fb275=_[_0x875f('0x3d')]({},_0x1fb275,_0x21c159[_0x875f('0x3e')]);return db[_0x875f('0x41')][_0x875f('0x47')](_0x1fb275)['then'](handleEntityNotFound(_0x57c1d6,null))[_0x875f('0x25')](respondWithResult(_0x57c1d6,null))[_0x875f('0x48')](handleError(_0x57c1d6,null));};exports['create']=function(_0xdb2096,_0x502316){return db[_0x875f('0x41')][_0x875f('0x49')](_0xdb2096[_0x875f('0x4a')],{})[_0x875f('0x25')](respondWithResult(_0x502316,0xc9))[_0x875f('0x48')](handleError(_0x502316,null));};exports[_0x875f('0x24')]=function(_0x2326a2,_0x198fd8){if(_0x2326a2[_0x875f('0x4a')]['id']){delete _0x2326a2[_0x875f('0x4a')]['id'];}return db[_0x875f('0x41')][_0x875f('0x47')]({'where':{'id':_0x2326a2[_0x875f('0x44')]['id']}})[_0x875f('0x25')](handleEntityNotFound(_0x198fd8,null))[_0x875f('0x25')](saveUpdates(_0x2326a2[_0x875f('0x4a')],null))[_0x875f('0x25')](respondWithResult(_0x198fd8,null))['catch'](handleError(_0x198fd8,null));};exports[_0x875f('0x26')]=function(_0x1da151,_0x14d238){return db['ServicenowField'][_0x875f('0x47')]({'where':{'id':_0x1da151[_0x875f('0x44')]['id']}})[_0x875f('0x25')](handleEntityNotFound(_0x14d238,null))['then'](removeEntity(_0x14d238,null))[_0x875f('0x48')](handleError(_0x14d238,null));}; \ No newline at end of file +var _0x1266=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','update','then','error','name','index','map','rawAttributes','fieldName','type','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ServicenowField','includeAll','findAll','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x408198,_0x25be02){var _0x27c72a=function(_0xaa5cc8){while(--_0xaa5cc8){_0x408198['push'](_0x408198['shift']());}};_0x27c72a(++_0x25be02);}(_0x1266,0x104));var _0x6126=function(_0x509d17,_0x47e193){_0x509d17=_0x509d17-0x0;var _0x163094=_0x1266[_0x509d17];return _0x163094;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6126('0x0'));var zipdir=require(_0x6126('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6126('0x2'));var moment=require(_0x6126('0x3'));var BPromise=require(_0x6126('0x4'));var Mustache=require(_0x6126('0x5'));var util=require(_0x6126('0x6'));var path=require(_0x6126('0x7'));var sox=require('sox');var csv=require(_0x6126('0x8'));var ejs=require(_0x6126('0x9'));var fs=require('fs');var fs_extra=require(_0x6126('0xa'));var _=require('lodash');var squel=require(_0x6126('0xb'));var crypto=require('crypto');var jsforce=require(_0x6126('0xc'));var deskjs=require(_0x6126('0xd'));var toCsv=require(_0x6126('0x8'));var querystring=require(_0x6126('0xe'));var Papa=require(_0x6126('0xf'));var Redis=require('ioredis');var authService=require(_0x6126('0x10'));var qs=require(_0x6126('0x11'));var as=require(_0x6126('0x12'));var hardwareService=require(_0x6126('0x13'));var logger=require('../../config/logger')(_0x6126('0x14'));var utils=require(_0x6126('0x15'));var config=require(_0x6126('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6126('0x17'))['db'];function respondWithStatusCode(_0x1ba511,_0x41c735){_0x41c735=_0x41c735||0xcc;return function(_0x59e84c){if(_0x59e84c){return _0x1ba511[_0x6126('0x18')](_0x41c735);}return _0x1ba511[_0x6126('0x19')](_0x41c735)[_0x6126('0x1a')]();};}function respondWithResult(_0x43f6d1,_0x189f49){_0x189f49=_0x189f49||0xc8;return function(_0x5362dd){if(_0x5362dd){return _0x43f6d1['status'](_0x189f49)['json'](_0x5362dd);}};}function respondWithFilteredResult(_0x45b4a0,_0x43ae21){return function(_0x216945){if(_0x216945){var _0x43c9d4=typeof _0x43ae21['offset']==='undefined'&&typeof _0x43ae21['limit']==='undefined';var _0x3148fd=_0x216945[_0x6126('0x1b')];var _0x268eb8=_0x43c9d4?0x0:_0x43ae21[_0x6126('0x1c')];var _0x22e969=_0x43c9d4?_0x216945[_0x6126('0x1b')]:_0x43ae21['offset']+_0x43ae21[_0x6126('0x1d')];var _0x555926;if(_0x22e969>=_0x3148fd){_0x22e969=_0x3148fd;_0x555926=0xc8;}else{_0x555926=0xce;}_0x45b4a0[_0x6126('0x19')](_0x555926);return _0x45b4a0['set'](_0x6126('0x1e'),_0x268eb8+'-'+_0x22e969+'/'+_0x3148fd)['json'](_0x216945);}return null;};}function patchUpdates(_0x4ba730){return function(_0x23735f){try{jsonpatch['apply'](_0x23735f,_0x4ba730,!![]);}catch(_0x393cb5){return BPromise['reject'](_0x393cb5);}return _0x23735f['save']();};}function saveUpdates(_0x4b1152,_0x2b9a17){return function(_0x2c9a10){if(_0x2c9a10){return _0x2c9a10[_0x6126('0x1f')](_0x4b1152)[_0x6126('0x20')](function(_0x2282a1){return _0x2282a1;});}return null;};}function removeEntity(_0x4b37b3,_0x3280c1){return function(_0x124864){if(_0x124864){return _0x124864['destroy']()[_0x6126('0x20')](function(){_0x4b37b3['status'](0xcc)[_0x6126('0x1a')]();});}};}function handleEntityNotFound(_0x329fe0,_0x1297ae){return function(_0x4b542f){if(!_0x4b542f){_0x329fe0[_0x6126('0x18')](0x194);}return _0x4b542f;};}function handleError(_0x1cbdb2,_0x29a974){_0x29a974=_0x29a974||0x1f4;return function(_0x377ebb){logger[_0x6126('0x21')](_0x377ebb['stack']);if(_0x377ebb[_0x6126('0x22')]){delete _0x377ebb[_0x6126('0x22')];}_0x1cbdb2[_0x6126('0x19')](_0x29a974)['send'](_0x377ebb);};}exports[_0x6126('0x23')]=function(_0x35a425,_0x46c630){var _0x237151={},_0x49d212={},_0xef349c={'count':0x0,'rows':[]};var _0x56690d=_[_0x6126('0x24')](db['ServicenowField'][_0x6126('0x25')],function(_0x570a98){return{'name':_0x570a98[_0x6126('0x26')],'type':_0x570a98[_0x6126('0x27')][_0x6126('0x28')]};});_0x49d212['model']=_[_0x6126('0x24')](_0x56690d,_0x6126('0x22'));_0x49d212['query']=_['keys'](_0x35a425['query']);_0x49d212[_0x6126('0x29')]=_[_0x6126('0x2a')](_0x49d212[_0x6126('0x2b')],_0x49d212[_0x6126('0x2c')]);_0x237151[_0x6126('0x2d')]=_['intersection'](_0x49d212[_0x6126('0x2b')],qs[_0x6126('0x2e')](_0x35a425[_0x6126('0x2c')]['fields']));_0x237151[_0x6126('0x2d')]=_0x237151[_0x6126('0x2d')][_0x6126('0x2f')]?_0x237151['attributes']:_0x49d212[_0x6126('0x2b')];if(!_0x35a425[_0x6126('0x2c')][_0x6126('0x30')](_0x6126('0x31'))){_0x237151[_0x6126('0x1d')]=qs[_0x6126('0x1d')](_0x35a425[_0x6126('0x2c')][_0x6126('0x1d')]);_0x237151['offset']=qs['offset'](_0x35a425[_0x6126('0x2c')][_0x6126('0x1c')]);}_0x237151[_0x6126('0x32')]=qs['sort'](_0x35a425[_0x6126('0x2c')][_0x6126('0x33')]);_0x237151[_0x6126('0x34')]=qs[_0x6126('0x29')](_[_0x6126('0x35')](_0x35a425[_0x6126('0x2c')],_0x49d212['filters']),_0x56690d);if(_0x35a425[_0x6126('0x2c')][_0x6126('0x36')]){_0x237151[_0x6126('0x34')]=_[_0x6126('0x37')](_0x237151[_0x6126('0x34')],{'$or':_[_0x6126('0x24')](_0x56690d,function(_0x2f5a94){if(_0x2f5a94[_0x6126('0x27')]!==_0x6126('0x38')){var _0x24f92e={};_0x24f92e[_0x2f5a94[_0x6126('0x22')]]={'$like':'%'+_0x35a425[_0x6126('0x2c')][_0x6126('0x36')]+'%'};return _0x24f92e;}})});}_0x237151=_['merge']({},_0x237151,_0x35a425['options']);var _0x3a3943={'where':_0x237151[_0x6126('0x34')]};return db[_0x6126('0x39')][_0x6126('0x1b')](_0x3a3943)[_0x6126('0x20')](function(_0x14f0ab){_0xef349c[_0x6126('0x1b')]=_0x14f0ab;if(_0x35a425[_0x6126('0x2c')][_0x6126('0x3a')]){_0x237151['include']=[{'all':!![]}];}return db[_0x6126('0x39')][_0x6126('0x3b')](_0x237151);})[_0x6126('0x20')](function(_0x1abfe7){_0xef349c[_0x6126('0x3c')]=_0x1abfe7;return _0xef349c;})['then'](respondWithFilteredResult(_0x46c630,_0x237151))[_0x6126('0x3d')](handleError(_0x46c630,null));};exports[_0x6126('0x3e')]=function(_0x218e3f,_0x2baca9){var _0x3d3a52={'raw':!![],'where':{'id':_0x218e3f[_0x6126('0x3f')]['id']}},_0x5a0e74={};_0x5a0e74['model']=_[_0x6126('0x40')](db[_0x6126('0x39')]['rawAttributes']);_0x5a0e74['query']=_[_0x6126('0x40')](_0x218e3f[_0x6126('0x2c')]);_0x5a0e74['filters']=_[_0x6126('0x2a')](_0x5a0e74[_0x6126('0x2b')],_0x5a0e74[_0x6126('0x2c')]);_0x3d3a52[_0x6126('0x2d')]=_[_0x6126('0x2a')](_0x5a0e74[_0x6126('0x2b')],qs['fields'](_0x218e3f[_0x6126('0x2c')][_0x6126('0x2e')]));_0x3d3a52[_0x6126('0x2d')]=_0x3d3a52[_0x6126('0x2d')][_0x6126('0x2f')]?_0x3d3a52[_0x6126('0x2d')]:_0x5a0e74[_0x6126('0x2b')];if(_0x218e3f[_0x6126('0x2c')][_0x6126('0x3a')]){_0x3d3a52['include']=[{'all':!![]}];}_0x3d3a52=_[_0x6126('0x37')]({},_0x3d3a52,_0x218e3f['options']);return db[_0x6126('0x39')][_0x6126('0x41')](_0x3d3a52)[_0x6126('0x20')](handleEntityNotFound(_0x2baca9,null))['then'](respondWithResult(_0x2baca9,null))[_0x6126('0x3d')](handleError(_0x2baca9,null));};exports[_0x6126('0x42')]=function(_0xd90864,_0x4b522a){return db[_0x6126('0x39')][_0x6126('0x42')](_0xd90864[_0x6126('0x43')],{})['then'](respondWithResult(_0x4b522a,0xc9))[_0x6126('0x3d')](handleError(_0x4b522a,null));};exports['update']=function(_0x1b9699,_0x53a22e){if(_0x1b9699[_0x6126('0x43')]['id']){delete _0x1b9699[_0x6126('0x43')]['id'];}return db[_0x6126('0x39')]['find']({'where':{'id':_0x1b9699[_0x6126('0x3f')]['id']}})[_0x6126('0x20')](handleEntityNotFound(_0x53a22e,null))[_0x6126('0x20')](saveUpdates(_0x1b9699[_0x6126('0x43')],null))[_0x6126('0x20')](respondWithResult(_0x53a22e,null))[_0x6126('0x3d')](handleError(_0x53a22e,null));};exports['destroy']=function(_0x303dd3,_0x3d4760){return db[_0x6126('0x39')][_0x6126('0x41')]({'where':{'id':_0x303dd3['params']['id']}})[_0x6126('0x20')](handleEntityNotFound(_0x3d4760,null))[_0x6126('0x20')](removeEntity(_0x3d4760,null))['catch'](handleError(_0x3d4760,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 25f76ac..4c29e8e 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 _0x9409=['FieldId','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x5d56a3,_0x318239){var _0x55cc75=function(_0x367285){while(--_0x367285){_0x5d56a3['push'](_0x5d56a3['shift']());}};_0x55cc75(++_0x318239);}(_0x9409,0xf8));var _0x9940=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0x9409[_0x2525f1];return _0x13c1b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9940('0x0'))('api');var moment=require(_0x9940('0x1'));var BPromise=require(_0x9940('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9940('0x3'));var config=require(_0x9940('0x4'));var attributes=require(_0x9940('0x5'));module[_0x9940('0x6')]=function(_0x3e82fe,_0x76ddbd){return _0x3e82fe[_0x9940('0x7')](_0x9940('0x8'),attributes,{'tableName':_0x9940('0x9'),'paranoid':![],'indexes':[{'name':_0x9940('0xa'),'fields':[_0x9940('0xb'),_0x9940('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d87=['define','ServicenowField','servicenow_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','path','./intServicenowField.attributes','exports'];(function(_0x451e44,_0x2a4226){var _0x58f6ca=function(_0x504c35){while(--_0x504c35){_0x451e44['push'](_0x451e44['shift']());}};_0x58f6ca(++_0x2a4226);}(_0x0d87,0x1d9));var _0x70d8=function(_0x273744,_0x17e52f){_0x273744=_0x273744-0x0;var _0x2e20e9=_0x0d87[_0x273744];return _0x2e20e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x70d8('0x0'))(_0x70d8('0x1'));var moment=require(_0x70d8('0x2'));var BPromise=require(_0x70d8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x70d8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x70d8('0x5'));module[_0x70d8('0x6')]=function(_0x2d0642,_0x132acd){return _0x2d0642[_0x70d8('0x7')](_0x70d8('0x8'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x70d8('0x9'),'fields':[_0x70d8('0xa'),_0x70d8('0xb')],'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 1a37fdd..78f7a6a 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 _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x32978c,_0x1fd267){var _0x2421b2=function(_0x26ba4e){while(--_0x26ba4e){_0x32978c['push'](_0x32978c['shift']());}};_0x2421b2(++_0x1fd267);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xb7e7[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x591e93,_0x2cdfb6){var _0x369ab0=function(_0x1bfa65){while(--_0x1bfa65){_0x591e93['push'](_0x591e93['shift']());}};_0x369ab0(++_0x2cdfb6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x242226,_0x373ff5){_0x242226=_0x242226-0x0;var _0x4f3891=_0xf4eb[_0x242226];return _0x4f3891;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index bcd69dd..88b021b 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2200ab,_0x5b9c92){var _0x21c40c=function(_0x5ca00d){while(--_0x5ca00d){_0x2200ab['push'](_0x2200ab['shift']());}};_0x21c40c(++_0x5b9c92);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x41926e,_0x459084){var _0x366ccb=function(_0x42dce2){while(--_0x42dce2){_0x41926e['push'](_0x41926e['shift']());}};_0x366ccb(++_0x459084);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 42e6318..f6579d3 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(_0x833443,_0x12da5f){var _0x247810=function(_0x146e46){while(--_0x146e46){_0x833443['push'](_0x833443['shift']());}};_0x247810(++_0x12da5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x32501b,_0xccb104){var _0x4ebc10=function(_0x2a6554){while(--_0x2a6554){_0x32501b['push'](_0x32501b['shift']());}};_0x4ebc10(++_0xccb104);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 81154fd..f4bbb46 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 _0x427a=['getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../components/integrations/configuration','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','remove','includes','label','endsWith','value','test'];(function(_0x5a01e7,_0x56c3f7){var _0x3cf168=function(_0x1a34c7){while(--_0x1a34c7){_0x5a01e7['push'](_0x5a01e7['shift']());}};_0x3cf168(++_0x56c3f7);}(_0x427a,0x174));var _0xa427=function(_0x393592,_0x2c2c00){_0x393592=_0x393592-0x0;var _0x2eed2d=_0x427a[_0x393592];return _0x2eed2d;};'use strict';var emlformat=require(_0xa427('0x0'));var rimraf=require(_0xa427('0x1'));var zipdir=require(_0xa427('0x2'));var jsonpatch=require(_0xa427('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa427('0x4'));var Mustache=require('mustache');var util=require(_0xa427('0x5'));var path=require('path');var sox=require(_0xa427('0x6'));var csv=require('to-csv');var ejs=require(_0xa427('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa427('0x8'));var squel=require(_0xa427('0x9'));var crypto=require(_0xa427('0xa'));var jsforce=require(_0xa427('0xb'));var deskjs=require(_0xa427('0xc'));var toCsv=require(_0xa427('0xd'));var querystring=require(_0xa427('0xe'));var Papa=require(_0xa427('0xf'));var Redis=require(_0xa427('0x10'));var authService=require(_0xa427('0x11'));var qs=require(_0xa427('0x12'));var as=require(_0xa427('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa427('0x14'))('api');var utils=require(_0xa427('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa427('0x16'));function respondWithStatusCode(_0x408e87,_0x1fc320){_0x1fc320=_0x1fc320||0xcc;return function(_0x234013){if(_0x234013){return _0x408e87['sendStatus'](_0x1fc320);}return _0x408e87[_0xa427('0x17')](_0x1fc320)[_0xa427('0x18')]();};}function respondWithResult(_0x21dae6,_0x2e401a){_0x2e401a=_0x2e401a||0xc8;return function(_0x2708af){if(_0x2708af){return _0x21dae6[_0xa427('0x17')](_0x2e401a)['json'](_0x2708af);}};}function respondWithFilteredResult(_0x4c775d,_0x376f1b){return function(_0x35891d){if(_0x35891d){var _0x58a80e=typeof _0x376f1b[_0xa427('0x19')]===_0xa427('0x1a')&&typeof _0x376f1b['limit']===_0xa427('0x1a');var _0xa51917=_0x35891d[_0xa427('0x1b')];var _0x5214f1=_0x58a80e?0x0:_0x376f1b['offset'];var _0x2ff0a3=_0x58a80e?_0x35891d[_0xa427('0x1b')]:_0x376f1b[_0xa427('0x19')]+_0x376f1b[_0xa427('0x1c')];var _0x427477;if(_0x2ff0a3>=_0xa51917){_0x2ff0a3=_0xa51917;_0x427477=0xc8;}else{_0x427477=0xce;}_0x4c775d[_0xa427('0x17')](_0x427477);return _0x4c775d[_0xa427('0x1d')]('Content-Range',_0x5214f1+'-'+_0x2ff0a3+'/'+_0xa51917)[_0xa427('0x1e')](_0x35891d);}return null;};}function patchUpdates(_0x3fd17e){return function(_0x27d155){try{jsonpatch[_0xa427('0x1f')](_0x27d155,_0x3fd17e,!![]);}catch(_0xb2e8e1){return BPromise[_0xa427('0x20')](_0xb2e8e1);}return _0x27d155[_0xa427('0x21')]();};}function saveUpdates(_0x30d9b5,_0x292f2e){return function(_0x1e53b5){if(_0x1e53b5){return _0x1e53b5[_0xa427('0x22')](_0x30d9b5)[_0xa427('0x23')](function(_0x23ab08){return _0x23ab08;});}return null;};}function removeEntity(_0x4f154d,_0x4667b3){return function(_0x4fcf34){if(_0x4fcf34){return _0x4fcf34[_0xa427('0x24')]()[_0xa427('0x23')](function(){_0x4f154d[_0xa427('0x17')](0xcc)[_0xa427('0x18')]();});}};}function handleEntityNotFound(_0x1e8db9,_0x52ad){return function(_0x4ab061){if(!_0x4ab061){_0x1e8db9[_0xa427('0x25')](0x194);}return _0x4ab061;};}function handleError(_0xb95a2,_0x35b5a7){_0x35b5a7=_0x35b5a7||0x1f4;return function(_0x1d05d4){logger[_0xa427('0x26')](_0x1d05d4[_0xa427('0x27')]);if(_0x1d05d4[_0xa427('0x28')]){delete _0x1d05d4[_0xa427('0x28')];}_0xb95a2[_0xa427('0x17')](_0x35b5a7)[_0xa427('0x29')](_0x1d05d4);};}exports[_0xa427('0x2a')]=function(_0x3638e3,_0x58b297){var _0x137583={},_0x27d537={},_0x103352={'count':0x0,'rows':[]};var _0x11221a=_[_0xa427('0x2b')](db[_0xa427('0x2c')]['rawAttributes'],function(_0x126404){return{'name':_0x126404[_0xa427('0x2d')],'type':_0x126404[_0xa427('0x2e')][_0xa427('0x2f')]};});_0x27d537[_0xa427('0x30')]=_[_0xa427('0x2b')](_0x11221a,_0xa427('0x28'));_0x27d537[_0xa427('0x31')]=_[_0xa427('0x32')](_0x3638e3['query']);_0x27d537[_0xa427('0x33')]=_[_0xa427('0x34')](_0x27d537[_0xa427('0x30')],_0x27d537[_0xa427('0x31')]);_0x137583[_0xa427('0x35')]=_[_0xa427('0x34')](_0x27d537[_0xa427('0x30')],qs[_0xa427('0x36')](_0x3638e3[_0xa427('0x31')][_0xa427('0x36')]));_0x137583[_0xa427('0x35')]=_0x137583['attributes']['length']?_0x137583['attributes']:_0x27d537['model'];if(!_0x3638e3[_0xa427('0x31')]['hasOwnProperty']('nolimit')){_0x137583['limit']=qs[_0xa427('0x1c')](_0x3638e3[_0xa427('0x31')]['limit']);_0x137583[_0xa427('0x19')]=qs['offset'](_0x3638e3[_0xa427('0x31')]['offset']);}_0x137583[_0xa427('0x37')]=qs[_0xa427('0x38')](_0x3638e3[_0xa427('0x31')][_0xa427('0x38')]);_0x137583['where']=qs['filters'](_[_0xa427('0x39')](_0x3638e3[_0xa427('0x31')],_0x27d537[_0xa427('0x33')]),_0x11221a);if(_0x3638e3[_0xa427('0x31')][_0xa427('0x3a')]){_0x137583[_0xa427('0x3b')]=_[_0xa427('0x3c')](_0x137583[_0xa427('0x3b')],{'$or':_[_0xa427('0x2b')](_0x11221a,function(_0x2039a0){if(_0x2039a0[_0xa427('0x2e')]!==_0xa427('0x3d')){var _0x1fc088={};_0x1fc088[_0x2039a0[_0xa427('0x28')]]={'$like':'%'+_0x3638e3['query'][_0xa427('0x3a')]+'%'};return _0x1fc088;}})});}_0x137583=_['merge']({},_0x137583,_0x3638e3[_0xa427('0x3e')]);var _0x1b387d={'where':_0x137583[_0xa427('0x3b')]};return db[_0xa427('0x2c')]['count'](_0x1b387d)[_0xa427('0x23')](function(_0x1efc0b){_0x103352[_0xa427('0x1b')]=_0x1efc0b;if(_0x3638e3['query'][_0xa427('0x3f')]){_0x137583[_0xa427('0x40')]=[{'all':!![]}];}return db[_0xa427('0x2c')][_0xa427('0x41')](_0x137583);})[_0xa427('0x23')](function(_0x22b3d3){_0x103352[_0xa427('0x42')]=_0x22b3d3;return _0x103352;})[_0xa427('0x23')](respondWithFilteredResult(_0x58b297,_0x137583))[_0xa427('0x43')](handleError(_0x58b297,null));};exports['show']=function(_0x57b50b,_0xdce4ef){var _0x450490={'raw':![],'where':{'id':_0x57b50b[_0xa427('0x44')]['id']}},_0x16332b={};_0x16332b['model']=_[_0xa427('0x32')](db['SugarcrmAccount'][_0xa427('0x45')]);_0x16332b['query']=_[_0xa427('0x32')](_0x57b50b['query']);_0x16332b[_0xa427('0x33')]=_[_0xa427('0x34')](_0x16332b[_0xa427('0x30')],_0x16332b['query']);_0x450490['attributes']=_[_0xa427('0x34')](_0x16332b[_0xa427('0x30')],qs['fields'](_0x57b50b[_0xa427('0x31')]['fields']));_0x450490[_0xa427('0x35')]=_0x450490['attributes'][_0xa427('0x46')]?_0x450490[_0xa427('0x35')]:_0x16332b[_0xa427('0x30')];if(_0x57b50b[_0xa427('0x31')][_0xa427('0x3f')]){_0x450490['include']=[{'all':!![]}];}_0x450490=_[_0xa427('0x3c')]({},_0x450490,_0x57b50b[_0xa427('0x3e')]);return db['SugarcrmAccount'][_0xa427('0x47')](_0x450490)[_0xa427('0x23')](handleEntityNotFound(_0xdce4ef,null))[_0xa427('0x23')](respondWithResult(_0xdce4ef,null))[_0xa427('0x43')](handleError(_0xdce4ef,null));};exports[_0xa427('0x48')]=function(_0x10a2ce,_0xbb569a){return db[_0xa427('0x2c')]['create'](_0x10a2ce[_0xa427('0x49')],{})[_0xa427('0x23')](respondWithResult(_0xbb569a,0xc9))[_0xa427('0x43')](handleError(_0xbb569a,null));};exports[_0xa427('0x22')]=function(_0x1360e2,_0x211d7b){if(_0x1360e2['body']['id']){delete _0x1360e2[_0xa427('0x49')]['id'];}return db['SugarcrmAccount'][_0xa427('0x47')]({'where':{'id':_0x1360e2[_0xa427('0x44')]['id']}})[_0xa427('0x23')](handleEntityNotFound(_0x211d7b,null))['then'](saveUpdates(_0x1360e2[_0xa427('0x49')],null))[_0xa427('0x23')](respondWithResult(_0x211d7b,null))[_0xa427('0x43')](handleError(_0x211d7b,null));};exports[_0xa427('0x24')]=function(_0x33f5a1,_0x4dce3c){return db[_0xa427('0x2c')]['find']({'where':{'id':_0x33f5a1['params']['id']}})[_0xa427('0x23')](handleEntityNotFound(_0x4dce3c,null))[_0xa427('0x23')](removeEntity(_0x4dce3c,null))[_0xa427('0x43')](handleError(_0x4dce3c,null));};exports[_0xa427('0x4a')]=function(_0x1d0d59,_0x1107d6,_0x185ecc){var _0x478f41={};var _0x2f42af={};var _0x3573c7;var _0x3ab1eb;return db[_0xa427('0x2c')][_0xa427('0x4b')]({'where':{'id':_0x1d0d59['params']['id']}})[_0xa427('0x23')](handleEntityNotFound(_0x1107d6,null))[_0xa427('0x23')](function(_0x477b97){if(_0x477b97){_0x3573c7=_0x477b97;_0x2f42af[_0xa427('0x30')]=_[_0xa427('0x32')](db[_0xa427('0x4c')][_0xa427('0x45')]);_0x2f42af['query']=_[_0xa427('0x32')](_0x1d0d59['query']);_0x2f42af[_0xa427('0x33')]=_[_0xa427('0x34')](_0x2f42af[_0xa427('0x30')],_0x2f42af['query']);_0x478f41[_0xa427('0x35')]=_['intersection'](_0x2f42af[_0xa427('0x30')],qs[_0xa427('0x36')](_0x1d0d59[_0xa427('0x31')]['fields']));_0x478f41[_0xa427('0x35')]=_0x478f41[_0xa427('0x35')][_0xa427('0x46')]?_0x478f41[_0xa427('0x35')]:_0x2f42af[_0xa427('0x30')];_0x478f41['order']=qs[_0xa427('0x38')](_0x1d0d59[_0xa427('0x31')]['sort']);_0x478f41['where']=qs[_0xa427('0x33')](_[_0xa427('0x39')](_0x1d0d59['query'],_0x2f42af[_0xa427('0x33')]));if(_0x1d0d59['query'][_0xa427('0x3a')]){_0x478f41[_0xa427('0x3b')]=_[_0xa427('0x3c')](_0x478f41['where'],{'$or':_[_0xa427('0x2b')](_0x478f41[_0xa427('0x35')],function(_0x26514b){var _0x11cb27={};_0x11cb27[_0x26514b]={'$like':'%'+_0x1d0d59[_0xa427('0x31')][_0xa427('0x3a')]+'%'};return _0x11cb27;})});}_0x478f41=_[_0xa427('0x3c')]({},_0x478f41,_0x1d0d59[_0xa427('0x3e')]);return _0x3573c7['getConfigurations'](_0x478f41);}})[_0xa427('0x23')](function(_0x7882a){if(_0x7882a){_0x3ab1eb=_0x7882a['length'];if(!_0x1d0d59[_0xa427('0x31')][_0xa427('0x4d')](_0xa427('0x4e'))){_0x478f41[_0xa427('0x1c')]=qs[_0xa427('0x1c')](_0x1d0d59[_0xa427('0x31')][_0xa427('0x1c')]);_0x478f41['offset']=qs[_0xa427('0x19')](_0x1d0d59[_0xa427('0x31')][_0xa427('0x19')]);}return _0x3573c7['getConfigurations'](_0x478f41);}})[_0xa427('0x23')](function(_0x4bb0a9){if(_0x4bb0a9){return _0x4bb0a9?{'count':_0x3ab1eb,'rows':_0x4bb0a9}:null;}})['then'](respondWithResult(_0x1107d6,null))[_0xa427('0x43')](handleError(_0x1107d6,null));};exports[_0xa427('0x4f')]=function(_0x17c21f,_0x2f7630,_0x1bacfe){if(_0x17c21f[_0xa427('0x49')]['id']){delete _0x17c21f[_0xa427('0x49')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x17c21f['params']['id']}})['then'](handleEntityNotFound(_0x2f7630,null))['then'](function(_0x41a8dc){if(_0x41a8dc){_0x17c21f['body'][_0xa427('0x50')]=_0x41a8dc['id'];_0x17c21f[_0xa427('0x49')][_0xa427('0x51')]=integrations[_0xa427('0x52')](_0x17c21f['body'][_0xa427('0x53')],_0x17c21f['body'][_0xa427('0x2e')]);_0x17c21f[_0xa427('0x49')][_0xa427('0x54')]=integrations[_0xa427('0x55')](_0x17c21f[_0xa427('0x49')][_0xa427('0x53')],_0x17c21f[_0xa427('0x49')][_0xa427('0x2e')]);return db[_0xa427('0x4c')]['create'](_0x17c21f['body'],{'include':[{'model':db[_0xa427('0x56')],'as':_0xa427('0x51')},{'model':db[_0xa427('0x56')],'as':_0xa427('0x54')}]});}return null;})[_0xa427('0x23')](respondWithResult(_0x2f7630,null))[_0xa427('0x43')](handleError(_0x2f7630,null));};exports[_0xa427('0x57')]=function(_0x26a044,_0x28a2f1,_0x16936e){var _0x27cbd0='';var _0x249b6f=['id','name',_0xa427('0x58'),_0xa427('0x59'),_0xa427('0x5a'),_0xa427('0x5b'),_0xa427('0x5c'),_0xa427('0x5d'),_0xa427('0x5e'),'parent_type',_0xa427('0x5f'),'direction'];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x26a044[_0xa427('0x44')]['id']},'attributes':['id',_0xa427('0x60'),_0xa427('0x61'),_0xa427('0x62')]})[_0xa427('0x23')](handleEntityNotFound(_0x28a2f1,null))[_0xa427('0x23')](function(_0x562000){if(_0x562000){_0x27cbd0=_0x562000[_0xa427('0x62')];var _0x260e0a=_0x27cbd0[_0xa427('0x63')](-0x1);if(_0x260e0a==='/'){_0x27cbd0=_0x27cbd0[_0xa427('0x64')](0x0,_0x27cbd0[_0xa427('0x65')](_0x260e0a));}return rp({'method':_0xa427('0x66'),'uri':util[_0xa427('0x67')](_0xa427('0x68'),_0x27cbd0,_0xa427('0x69')),'json':!![],'form':{'method':'login','input_type':_0xa427('0x6a'),'response_type':'JSON','rest_data':JSON[_0xa427('0x6b')]({'user_auth':{'user_name':_0x562000[_0xa427('0x60')],'password':_0x562000[_0xa427('0x61')],'encryption':_0xa427('0x6c')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xa427('0x23')](function(_0x347735){if(_0x347735&&_0x347735['name']!==_0xa427('0x6d')&&_0x347735[_0xa427('0x28')]!==_0xa427('0x6e')){return rp({'method':'POST','uri':util[_0xa427('0x67')]('%s%s',_0x27cbd0,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa427('0x6f'),'input_type':_0xa427('0x6a'),'response_type':_0xa427('0x6a'),'rest_data':JSON[_0xa427('0x6b')]({'session':_0x347735['id'],'module_name':_0xa427('0x70')})}})[_0xa427('0x23')](function(_0x4951f2){if(_0x4951f2){var _0x1bf69c=_[_0xa427('0x71')](_0x4951f2['module_fields']);_[_0xa427('0x72')](_0x1bf69c,function(_0x10e0d0){return _0x249b6f[_0xa427('0x73')](_0x10e0d0['name']);});return{'count':_0x1bf69c[_0xa427('0x46')],'rows':_[_0xa427('0x2b')](_0x1bf69c,function(_0x3011f2){return{'id':_0x3011f2[_0xa427('0x28')],'name':_0x3011f2[_0xa427('0x74')],'custom':_[_0xa427('0x75')](_0x3011f2['name'],'_c')?!![]:![],'options':_0x3011f2[_0xa427('0x3e')]?_[_0xa427('0x2b')](_['values'](_0x3011f2[_0xa427('0x3e')]),function(_0x582246){return{'name':_0x582246[_0xa427('0x76')],'value':_0x582246['name']};}):[]};})};}})[_0xa427('0x23')](respondWithResult(_0x28a2f1,null))['catch'](function(_0x42a47b){var _0x32564c=_0x26a044[_0xa427('0x31')][_0xa427('0x77')]?0x1f4:_0x42a47b['statusCode']||0x1f4;logger[_0xa427('0x26')](_0xa427('0x78'),_0xa427('0x57'),_0x32564c,JSON['stringify'](_0x42a47b));delete _0x42a47b[_0xa427('0x28')];if(_0x32564c===0x191){_0x32564c=0x190;}_0x28a2f1['status'](_0x32564c)[_0xa427('0x29')](_0x26a044[_0xa427('0x31')][_0xa427('0x77')]?{'message':_0xa427('0x79'),'statusCode':_0x42a47b[_0xa427('0x7a')]}:_0x42a47b);});}else{var _0x4ee39b=0x1f4;_0x28a2f1[_0xa427('0x17')](_0x4ee39b)[_0xa427('0x29')]({'message':_0xa427('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x74b1=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','stack','send','index','map','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','options','SugarcrmAccount','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','merge','hasOwnProperty','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_id','username','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','remove','label','endsWith','value','error','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x74b1,0x155));var _0x174b=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x74b1[_0x4914e2];return _0x2dcd07;};'use strict';var emlformat=require(_0x174b('0x0'));var rimraf=require(_0x174b('0x1'));var zipdir=require(_0x174b('0x2'));var jsonpatch=require(_0x174b('0x3'));var rp=require('request-promise');var moment=require(_0x174b('0x4'));var BPromise=require(_0x174b('0x5'));var Mustache=require('mustache');var util=require(_0x174b('0x6'));var path=require(_0x174b('0x7'));var sox=require(_0x174b('0x8'));var csv=require('to-csv');var ejs=require(_0x174b('0x9'));var fs=require('fs');var fs_extra=require(_0x174b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x174b('0xb'));var jsforce=require(_0x174b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x174b('0xd'));var Papa=require(_0x174b('0xe'));var Redis=require(_0x174b('0xf'));var authService=require(_0x174b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x174b('0x11'));var hardwareService=require(_0x174b('0x12'));var logger=require(_0x174b('0x13'))('api');var utils=require(_0x174b('0x14'));var config=require(_0x174b('0x15'));var licenseUtil=require(_0x174b('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x174b('0x17'));function respondWithStatusCode(_0x3d78ba,_0x4b2adf){_0x4b2adf=_0x4b2adf||0xcc;return function(_0x4d6db1){if(_0x4d6db1){return _0x3d78ba[_0x174b('0x18')](_0x4b2adf);}return _0x3d78ba[_0x174b('0x19')](_0x4b2adf)[_0x174b('0x1a')]();};}function respondWithResult(_0x472d2f,_0x4c3fb1){_0x4c3fb1=_0x4c3fb1||0xc8;return function(_0x2d1e5b){if(_0x2d1e5b){return _0x472d2f[_0x174b('0x19')](_0x4c3fb1)[_0x174b('0x1b')](_0x2d1e5b);}};}function respondWithFilteredResult(_0x3c001e,_0x413651){return function(_0x1546cc){if(_0x1546cc){var _0x259aeb=typeof _0x413651['offset']===_0x174b('0x1c')&&typeof _0x413651['limit']===_0x174b('0x1c');var _0x16e07e=_0x1546cc['count'];var _0x3d5c7a=_0x259aeb?0x0:_0x413651[_0x174b('0x1d')];var _0x46ba9e=_0x259aeb?_0x1546cc[_0x174b('0x1e')]:_0x413651[_0x174b('0x1d')]+_0x413651[_0x174b('0x1f')];var _0x53cda5;if(_0x46ba9e>=_0x16e07e){_0x46ba9e=_0x16e07e;_0x53cda5=0xc8;}else{_0x53cda5=0xce;}_0x3c001e['status'](_0x53cda5);return _0x3c001e[_0x174b('0x20')](_0x174b('0x21'),_0x3d5c7a+'-'+_0x46ba9e+'/'+_0x16e07e)[_0x174b('0x1b')](_0x1546cc);}return null;};}function patchUpdates(_0x411b0b){return function(_0x5e4540){try{jsonpatch[_0x174b('0x22')](_0x5e4540,_0x411b0b,!![]);}catch(_0x496d7b){return BPromise[_0x174b('0x23')](_0x496d7b);}return _0x5e4540[_0x174b('0x24')]();};}function saveUpdates(_0x59a931,_0x58450f){return function(_0x5d172f){if(_0x5d172f){return _0x5d172f[_0x174b('0x25')](_0x59a931)[_0x174b('0x26')](function(_0x26c9b2){return _0x26c9b2;});}return null;};}function removeEntity(_0xf100a,_0xe1fb2d){return function(_0x1b91ac){if(_0x1b91ac){return _0x1b91ac['destroy']()[_0x174b('0x26')](function(){_0xf100a[_0x174b('0x19')](0xcc)[_0x174b('0x1a')]();});}};}function handleEntityNotFound(_0x37bb1d,_0x3a7727){return function(_0x25ccf5){if(!_0x25ccf5){_0x37bb1d[_0x174b('0x18')](0x194);}return _0x25ccf5;};}function handleError(_0x50d547,_0xf16850){_0xf16850=_0xf16850||0x1f4;return function(_0x43f3ec){logger['error'](_0x43f3ec[_0x174b('0x27')]);if(_0x43f3ec['name']){delete _0x43f3ec['name'];}_0x50d547['status'](_0xf16850)[_0x174b('0x28')](_0x43f3ec);};}exports[_0x174b('0x29')]=function(_0x409f31,_0x2ed66f){var _0x86bb37={},_0x4aab6e={},_0x19f142={'count':0x0,'rows':[]};var _0x3bbe1f=_[_0x174b('0x2a')](db['SugarcrmAccount']['rawAttributes'],function(_0x56567d){return{'name':_0x56567d[_0x174b('0x2b')],'type':_0x56567d[_0x174b('0x2c')][_0x174b('0x2d')]};});_0x4aab6e[_0x174b('0x2e')]=_[_0x174b('0x2a')](_0x3bbe1f,_0x174b('0x2f'));_0x4aab6e['query']=_[_0x174b('0x30')](_0x409f31[_0x174b('0x31')]);_0x4aab6e[_0x174b('0x32')]=_['intersection'](_0x4aab6e[_0x174b('0x2e')],_0x4aab6e['query']);_0x86bb37['attributes']=_[_0x174b('0x33')](_0x4aab6e[_0x174b('0x2e')],qs[_0x174b('0x34')](_0x409f31['query'][_0x174b('0x34')]));_0x86bb37[_0x174b('0x35')]=_0x86bb37[_0x174b('0x35')][_0x174b('0x36')]?_0x86bb37['attributes']:_0x4aab6e[_0x174b('0x2e')];if(!_0x409f31[_0x174b('0x31')]['hasOwnProperty'](_0x174b('0x37'))){_0x86bb37[_0x174b('0x1f')]=qs[_0x174b('0x1f')](_0x409f31[_0x174b('0x31')][_0x174b('0x1f')]);_0x86bb37[_0x174b('0x1d')]=qs['offset'](_0x409f31[_0x174b('0x31')][_0x174b('0x1d')]);}_0x86bb37[_0x174b('0x38')]=qs[_0x174b('0x39')](_0x409f31[_0x174b('0x31')]['sort']);_0x86bb37[_0x174b('0x3a')]=qs[_0x174b('0x32')](_[_0x174b('0x3b')](_0x409f31[_0x174b('0x31')],_0x4aab6e['filters']),_0x3bbe1f);if(_0x409f31['query']['filter']){_0x86bb37[_0x174b('0x3a')]=_['merge'](_0x86bb37[_0x174b('0x3a')],{'$or':_[_0x174b('0x2a')](_0x3bbe1f,function(_0x159f36){if(_0x159f36['type']!=='VIRTUAL'){var _0x1ab482={};_0x1ab482[_0x159f36[_0x174b('0x2f')]]={'$like':'%'+_0x409f31[_0x174b('0x31')][_0x174b('0x3c')]+'%'};return _0x1ab482;}})});}_0x86bb37=_['merge']({},_0x86bb37,_0x409f31[_0x174b('0x3d')]);var _0xad236e={'where':_0x86bb37[_0x174b('0x3a')]};return db[_0x174b('0x3e')][_0x174b('0x1e')](_0xad236e)['then'](function(_0x51370b){_0x19f142[_0x174b('0x1e')]=_0x51370b;if(_0x409f31[_0x174b('0x31')][_0x174b('0x3f')]){_0x86bb37['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x174b('0x40')](_0x86bb37);})[_0x174b('0x26')](function(_0x100130){_0x19f142[_0x174b('0x41')]=_0x100130;return _0x19f142;})[_0x174b('0x26')](respondWithFilteredResult(_0x2ed66f,_0x86bb37))[_0x174b('0x42')](handleError(_0x2ed66f,null));};exports[_0x174b('0x43')]=function(_0x81157d,_0x3af96a){var _0x397ab7={'raw':![],'where':{'id':_0x81157d[_0x174b('0x44')]['id']}},_0x102663={};_0x102663[_0x174b('0x2e')]=_['keys'](db['SugarcrmAccount'][_0x174b('0x45')]);_0x102663[_0x174b('0x31')]=_[_0x174b('0x30')](_0x81157d[_0x174b('0x31')]);_0x102663[_0x174b('0x32')]=_[_0x174b('0x33')](_0x102663['model'],_0x102663[_0x174b('0x31')]);_0x397ab7[_0x174b('0x35')]=_[_0x174b('0x33')](_0x102663[_0x174b('0x2e')],qs[_0x174b('0x34')](_0x81157d[_0x174b('0x31')][_0x174b('0x34')]));_0x397ab7['attributes']=_0x397ab7[_0x174b('0x35')]['length']?_0x397ab7[_0x174b('0x35')]:_0x102663[_0x174b('0x2e')];if(_0x81157d[_0x174b('0x31')][_0x174b('0x3f')]){_0x397ab7[_0x174b('0x46')]=[{'all':!![]}];}_0x397ab7=_['merge']({},_0x397ab7,_0x81157d['options']);return db[_0x174b('0x3e')][_0x174b('0x47')](_0x397ab7)[_0x174b('0x26')](handleEntityNotFound(_0x3af96a,null))[_0x174b('0x26')](respondWithResult(_0x3af96a,null))[_0x174b('0x42')](handleError(_0x3af96a,null));};exports['create']=function(_0x788265,_0x44cc20){return db[_0x174b('0x3e')][_0x174b('0x48')](_0x788265['body'],{})['then'](respondWithResult(_0x44cc20,0xc9))[_0x174b('0x42')](handleError(_0x44cc20,null));};exports['update']=function(_0x59beb8,_0x55eb5f){if(_0x59beb8[_0x174b('0x49')]['id']){delete _0x59beb8[_0x174b('0x49')]['id'];}return db[_0x174b('0x3e')][_0x174b('0x47')]({'where':{'id':_0x59beb8['params']['id']}})[_0x174b('0x26')](handleEntityNotFound(_0x55eb5f,null))['then'](saveUpdates(_0x59beb8['body'],null))[_0x174b('0x26')](respondWithResult(_0x55eb5f,null))[_0x174b('0x42')](handleError(_0x55eb5f,null));};exports[_0x174b('0x4a')]=function(_0x182568,_0xf67a31){return db['SugarcrmAccount'][_0x174b('0x47')]({'where':{'id':_0x182568[_0x174b('0x44')]['id']}})[_0x174b('0x26')](handleEntityNotFound(_0xf67a31,null))[_0x174b('0x26')](removeEntity(_0xf67a31,null))['catch'](handleError(_0xf67a31,null));};exports[_0x174b('0x4b')]=function(_0x1b649c,_0x1ba24d,_0x5ed9dd){var _0x35e7e7={};var _0x3cfb99={};var _0x13768c;var _0x4950a6;return db['SugarcrmAccount'][_0x174b('0x4c')]({'where':{'id':_0x1b649c['params']['id']}})['then'](handleEntityNotFound(_0x1ba24d,null))[_0x174b('0x26')](function(_0x5efea8){if(_0x5efea8){_0x13768c=_0x5efea8;_0x3cfb99[_0x174b('0x2e')]=_['keys'](db[_0x174b('0x4d')][_0x174b('0x45')]);_0x3cfb99[_0x174b('0x31')]=_[_0x174b('0x30')](_0x1b649c[_0x174b('0x31')]);_0x3cfb99[_0x174b('0x32')]=_[_0x174b('0x33')](_0x3cfb99[_0x174b('0x2e')],_0x3cfb99[_0x174b('0x31')]);_0x35e7e7[_0x174b('0x35')]=_['intersection'](_0x3cfb99[_0x174b('0x2e')],qs[_0x174b('0x34')](_0x1b649c[_0x174b('0x31')]['fields']));_0x35e7e7[_0x174b('0x35')]=_0x35e7e7[_0x174b('0x35')][_0x174b('0x36')]?_0x35e7e7[_0x174b('0x35')]:_0x3cfb99['model'];_0x35e7e7[_0x174b('0x38')]=qs[_0x174b('0x39')](_0x1b649c[_0x174b('0x31')]['sort']);_0x35e7e7[_0x174b('0x3a')]=qs['filters'](_['pick'](_0x1b649c[_0x174b('0x31')],_0x3cfb99['filters']));if(_0x1b649c[_0x174b('0x31')][_0x174b('0x3c')]){_0x35e7e7[_0x174b('0x3a')]=_['merge'](_0x35e7e7[_0x174b('0x3a')],{'$or':_['map'](_0x35e7e7[_0x174b('0x35')],function(_0x434299){var _0xe6161d={};_0xe6161d[_0x434299]={'$like':'%'+_0x1b649c[_0x174b('0x31')][_0x174b('0x3c')]+'%'};return _0xe6161d;})});}_0x35e7e7=_[_0x174b('0x4e')]({},_0x35e7e7,_0x1b649c[_0x174b('0x3d')]);return _0x13768c[_0x174b('0x4b')](_0x35e7e7);}})[_0x174b('0x26')](function(_0x5bc2db){if(_0x5bc2db){_0x4950a6=_0x5bc2db['length'];if(!_0x1b649c[_0x174b('0x31')][_0x174b('0x4f')]('nolimit')){_0x35e7e7['limit']=qs[_0x174b('0x1f')](_0x1b649c[_0x174b('0x31')]['limit']);_0x35e7e7[_0x174b('0x1d')]=qs[_0x174b('0x1d')](_0x1b649c[_0x174b('0x31')][_0x174b('0x1d')]);}return _0x13768c[_0x174b('0x4b')](_0x35e7e7);}})[_0x174b('0x26')](function(_0x59012d){if(_0x59012d){return _0x59012d?{'count':_0x4950a6,'rows':_0x59012d}:null;}})['then'](respondWithResult(_0x1ba24d,null))['catch'](handleError(_0x1ba24d,null));};exports['addConfiguration']=function(_0x2ca475,_0x50913b,_0x20dbda){if(_0x2ca475['body']['id']){delete _0x2ca475[_0x174b('0x49')]['id'];}return db[_0x174b('0x3e')][_0x174b('0x4c')]({'where':{'id':_0x2ca475['params']['id']}})['then'](handleEntityNotFound(_0x50913b,null))[_0x174b('0x26')](function(_0x350235){if(_0x350235){_0x2ca475[_0x174b('0x49')]['AccountId']=_0x350235['id'];_0x2ca475['body'][_0x174b('0x50')]=integrations[_0x174b('0x51')](_0x2ca475[_0x174b('0x49')][_0x174b('0x52')],_0x2ca475[_0x174b('0x49')][_0x174b('0x2c')]);_0x2ca475[_0x174b('0x49')][_0x174b('0x53')]=integrations[_0x174b('0x54')](_0x2ca475[_0x174b('0x49')][_0x174b('0x52')],_0x2ca475[_0x174b('0x49')][_0x174b('0x2c')]);return db[_0x174b('0x4d')]['create'](_0x2ca475[_0x174b('0x49')],{'include':[{'model':db[_0x174b('0x55')],'as':'Subjects'},{'model':db[_0x174b('0x55')],'as':_0x174b('0x53')}]});}return null;})[_0x174b('0x26')](respondWithResult(_0x50913b,null))[_0x174b('0x42')](handleError(_0x50913b,null));};exports[_0x174b('0x56')]=function(_0x5205f9,_0x43c36a,_0xe8e985){var _0x37ea75='';var _0x4a4278=['id',_0x174b('0x2f'),_0x174b('0x57'),_0x174b('0x58'),_0x174b('0x59'),_0x174b('0x5a'),'duration_hours','duration_minutes',_0x174b('0x5b'),'parent_type','parent_name','direction'];return db[_0x174b('0x3e')][_0x174b('0x4c')]({'where':{'id':_0x5205f9[_0x174b('0x44')]['id']},'attributes':['id',_0x174b('0x5c'),'password','remoteUri']})[_0x174b('0x26')](handleEntityNotFound(_0x43c36a,null))['then'](function(_0x1d35d9){if(_0x1d35d9){_0x37ea75=_0x1d35d9[_0x174b('0x5d')];var _0x3c3096=_0x37ea75['slice'](-0x1);if(_0x3c3096==='/'){_0x37ea75=_0x37ea75[_0x174b('0x5e')](0x0,_0x37ea75[_0x174b('0x5f')](_0x3c3096));}return rp({'method':_0x174b('0x60'),'uri':util[_0x174b('0x61')](_0x174b('0x62'),_0x37ea75,_0x174b('0x63')),'json':!![],'form':{'method':_0x174b('0x64'),'input_type':_0x174b('0x65'),'response_type':'JSON','rest_data':JSON[_0x174b('0x66')]({'user_auth':{'user_name':_0x1d35d9[_0x174b('0x5c')],'password':_0x1d35d9[_0x174b('0x67')],'encryption':_0x174b('0x68')},'application':_0x174b('0x69')})}});}})[_0x174b('0x26')](function(_0x262da1){if(_0x262da1&&_0x262da1[_0x174b('0x2f')]!==_0x174b('0x6a')&&_0x262da1[_0x174b('0x2f')]!==_0x174b('0x6b')){return rp({'method':_0x174b('0x60'),'uri':util[_0x174b('0x61')](_0x174b('0x62'),_0x37ea75,_0x174b('0x63')),'json':!![],'form':{'method':_0x174b('0x6c'),'input_type':_0x174b('0x65'),'response_type':_0x174b('0x65'),'rest_data':JSON['stringify']({'session':_0x262da1['id'],'module_name':_0x174b('0x6d')})}})[_0x174b('0x26')](function(_0x25bc23){if(_0x25bc23){var _0x4aaa62=_['values'](_0x25bc23[_0x174b('0x6e')]);_[_0x174b('0x6f')](_0x4aaa62,function(_0x58c7c7){return _0x4a4278['includes'](_0x58c7c7['name']);});return{'count':_0x4aaa62[_0x174b('0x36')],'rows':_[_0x174b('0x2a')](_0x4aaa62,function(_0x4fffaa){return{'id':_0x4fffaa[_0x174b('0x2f')],'name':_0x4fffaa[_0x174b('0x70')],'custom':_[_0x174b('0x71')](_0x4fffaa[_0x174b('0x2f')],'_c')?!![]:![],'options':_0x4fffaa['options']?_[_0x174b('0x2a')](_['values'](_0x4fffaa['options']),function(_0x3487c7){return{'name':_0x3487c7[_0x174b('0x72')],'value':_0x3487c7['name']};}):[]};})};}})[_0x174b('0x26')](respondWithResult(_0x43c36a,null))['catch'](function(_0x1aaf7a){var _0x22fc68=_0x5205f9[_0x174b('0x31')]['test']?0x1f4:_0x1aaf7a['statusCode']||0x1f4;logger[_0x174b('0x73')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x22fc68,JSON[_0x174b('0x66')](_0x1aaf7a));delete _0x1aaf7a[_0x174b('0x2f')];if(_0x22fc68===0x191){_0x22fc68=0x190;}_0x43c36a[_0x174b('0x19')](_0x22fc68)[_0x174b('0x28')](_0x5205f9[_0x174b('0x31')]['test']?{'message':_0x174b('0x74'),'statusCode':_0x1aaf7a[_0x174b('0x75')]}:_0x1aaf7a);});}else{var _0x53e218=0x1f4;_0x43c36a['status'](_0x53e218)[_0x174b('0x28')]({'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 6011240..24fba72 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 _0x6755=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash','util','api','moment'];(function(_0xdbb6cb,_0x3b8fda){var _0x476b50=function(_0x470ebb){while(--_0x470ebb){_0xdbb6cb['push'](_0xdbb6cb['shift']());}};_0x476b50(++_0x3b8fda);}(_0x6755,0x193));var _0x5675=function(_0x5c3041,_0x52423f){_0x5c3041=_0x5c3041-0x0;var _0x512168=_0x6755[_0x5c3041];return _0x512168;};'use strict';var _=require(_0x5675('0x0'));var util=require(_0x5675('0x1'));var logger=require('../../config/logger')(_0x5675('0x2'));var moment=require(_0x5675('0x3'));var BPromise=require('bluebird');var rp=require(_0x5675('0x4'));var fs=require('fs');var path=require(_0x5675('0x5'));var rimraf=require(_0x5675('0x6'));var config=require(_0x5675('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x5675('0x8'));module[_0x5675('0x9')]=function(_0x425a6c,_0x323b58){return _0x425a6c['define']('SugarcrmAccount',attributes,{'tableName':_0x5675('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2899=['int_sugarcrm_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x4998e4,_0x47a4ed){var _0x1bef53=function(_0x458797){while(--_0x458797){_0x4998e4['push'](_0x4998e4['shift']());}};_0x1bef53(++_0x47a4ed);}(_0x2899,0xc4));var _0x9289=function(_0x5aa1cb,_0x448ed2){_0x5aa1cb=_0x5aa1cb-0x0;var _0x50160d=_0x2899[_0x5aa1cb];return _0x50160d;};'use strict';var _=require(_0x9289('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9289('0x1'));var moment=require(_0x9289('0x2'));var BPromise=require(_0x9289('0x3'));var rp=require(_0x9289('0x4'));var fs=require('fs');var path=require(_0x9289('0x5'));var rimraf=require(_0x9289('0x6'));var config=require(_0x9289('0x7'));var attributes=require(_0x9289('0x8'));var integrations=require(_0x9289('0x9'));module[_0x9289('0xa')]=function(_0x20c16b,_0x31322f){return _0x20c16b[_0x9289('0xb')]('SugarcrmAccount',attributes,{'tableName':_0x9289('0xc'),'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 601c0a7..7f5f429 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 _0x0899=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','where','attributes','include','map','model','debug','ShowSugarcrmAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x942de4,_0x4a08d5){var _0x25a6e9=function(_0x53d88a){while(--_0x53d88a){_0x942de4['push'](_0x942de4['shift']());}};_0x25a6e9(++_0x4a08d5);}(_0x0899,0x1b3));var _0x9089=function(_0x544362,_0xc31c04){_0x544362=_0x544362-0x0;var _0x5c12f9=_0x0899[_0x544362];return _0x5c12f9;};'use strict';var _=require(_0x9089('0x0'));var util=require(_0x9089('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9089('0x2'));var fs=require('fs');var Redis=require(_0x9089('0x3'));var db=require(_0x9089('0x4'))['db'];var utils=require(_0x9089('0x5'));var logger=require(_0x9089('0x6'))(_0x9089('0x7'));var config=require(_0x9089('0x8'));var jayson=require(_0x9089('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x366d65,_0x42cf13,_0x8f07ae){return new BPromise(function(_0x5e90cd,_0x41aa69){return client[_0x9089('0xa')](_0x366d65,_0x8f07ae)[_0x9089('0xb')](function(_0x419188){logger[_0x9089('0xc')](_0x9089('0xd'),_0x42cf13,_0x9089('0xe'));logger['debug'](_0x9089('0xf'),_0x42cf13,_0x9089('0xe'),JSON[_0x9089('0x10')](_0x419188));if(_0x419188[_0x9089('0x11')]){if(_0x419188['error']['code']===0x1f4){logger[_0x9089('0x11')](_0x9089('0xd'),_0x42cf13,_0x419188[_0x9089('0x11')]['message']);return _0x41aa69(_0x419188[_0x9089('0x11')]['message']);}logger[_0x9089('0x11')](_0x9089('0xd'),_0x42cf13,_0x419188[_0x9089('0x11')][_0x9089('0x12')]);return _0x5e90cd(_0x419188[_0x9089('0x11')][_0x9089('0x12')]);}else{logger[_0x9089('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x42cf13,_0x9089('0xe'));_0x5e90cd(_0x419188[_0x9089('0x13')]['message']);}})[_0x9089('0x14')](function(_0x3a753f){logger[_0x9089('0x11')](_0x9089('0xd'),_0x42cf13,_0x3a753f);_0x41aa69(_0x3a753f);});});}exports[_0x9089('0x15')]=function(_0x1af891){var _0x34dd69=this;return new Promise(function(_0x277385,_0x5a4e01){return db[_0x9089('0x16')]['findAll']({'raw':_0x1af891[_0x9089('0x17')]?_0x1af891[_0x9089('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1af891[_0x9089('0x17')]?_0x1af891[_0x9089('0x17')][_0x9089('0x18')]||null:null,'attributes':_0x1af891[_0x9089('0x17')]?_0x1af891[_0x9089('0x17')][_0x9089('0x19')]||null:null,'limit':_0x1af891[_0x9089('0x17')]?_0x1af891[_0x9089('0x17')]['limit']||null:null,'include':_0x1af891['options']?_0x1af891[_0x9089('0x17')][_0x9089('0x1a')]?_[_0x9089('0x1b')](_0x1af891[_0x9089('0x17')][_0x9089('0x1a')],function(_0x5ad254){return{'model':db[_0x5ad254[_0x9089('0x1c')]],'as':_0x5ad254['as'],'attributes':_0x5ad254[_0x9089('0x19')],'include':_0x5ad254['include']?_['map'](_0x5ad254[_0x9089('0x1a')],function(_0x1b73f0){return{'model':db[_0x1b73f0[_0x9089('0x1c')]],'as':_0x1b73f0['as'],'attributes':_0x1b73f0[_0x9089('0x19')],'include':_0x1b73f0[_0x9089('0x1a')]?_[_0x9089('0x1b')](_0x1b73f0[_0x9089('0x1a')],function(_0x1ac687){return{'model':db[_0x1ac687[_0x9089('0x1c')]],'as':_0x1ac687['as'],'attributes':_0x1ac687['attributes']};}):[]};}):[]};}):[]:[]})[_0x9089('0xb')](function(_0x58d177){logger[_0x9089('0xc')](_0x9089('0x15'),_0x1af891);logger[_0x9089('0x1d')](_0x9089('0x15'),_0x1af891,JSON[_0x9089('0x10')](_0x58d177));_0x277385(_0x58d177);})['catch'](function(_0x794a24){logger[_0x9089('0x11')](_0x9089('0x15'),_0x794a24[_0x9089('0x12')],_0x1af891);_0x5a4e01(_0x34dd69[_0x9089('0x11')](0x1f4,_0x794a24[_0x9089('0x12')]));});});};exports[_0x9089('0x1e')]=function(_0x519335){var _0x1d6c4c=this;return new Promise(function(_0x279dc9,_0x5c683a){return db['SugarcrmAccount'][_0x9089('0x1f')]({'raw':_0x519335['options']?_0x519335[_0x9089('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x519335['options']?_0x519335[_0x9089('0x17')][_0x9089('0x18')]||null:null,'attributes':_0x519335[_0x9089('0x17')]?_0x519335[_0x9089('0x17')][_0x9089('0x19')]||null:null,'include':_0x519335['options']?_0x519335['options']['include']?_[_0x9089('0x1b')](_0x519335[_0x9089('0x17')][_0x9089('0x1a')],function(_0x2a1689){return{'model':db[_0x2a1689['model']],'as':_0x2a1689['as'],'attributes':_0x2a1689[_0x9089('0x19')],'include':_0x2a1689[_0x9089('0x1a')]?_[_0x9089('0x1b')](_0x2a1689[_0x9089('0x1a')],function(_0x420b09){return{'model':db[_0x420b09[_0x9089('0x1c')]],'as':_0x420b09['as'],'attributes':_0x420b09[_0x9089('0x19')],'include':_0x420b09[_0x9089('0x1a')]?_[_0x9089('0x1b')](_0x420b09['include'],function(_0x168ea2){return{'model':db[_0x168ea2[_0x9089('0x1c')]],'as':_0x168ea2['as'],'attributes':_0x168ea2[_0x9089('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9089('0xb')](function(_0x5195ac){logger[_0x9089('0xc')](_0x9089('0x1e'),_0x519335);logger['debug'](_0x9089('0x1e'),_0x519335,JSON['stringify'](_0x5195ac));_0x279dc9(_0x5195ac);})[_0x9089('0x14')](function(_0x303026){logger[_0x9089('0x11')](_0x9089('0x1e'),_0x303026[_0x9089('0x12')],_0x519335);_0x5c683a(_0x1d6c4c['error'](0x1f4,_0x303026[_0x9089('0x12')]));});});}; \ No newline at end of file +var _0xf700=['where','include','map','model','attributes','stringify','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xf700,0x65));var _0x0f70=function(_0x5a2e87,_0xf95786){_0x5a2e87=_0x5a2e87-0x0;var _0x8ea3b8=_0xf700[_0x5a2e87];return _0x8ea3b8;};'use strict';var _=require(_0x0f70('0x0'));var util=require(_0x0f70('0x1'));var moment=require(_0x0f70('0x2'));var BPromise=require(_0x0f70('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f70('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f70('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0f70('0x6'));var jayson=require(_0x0f70('0x7'));var client=jayson[_0x0f70('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f06af,_0xf6cf59,_0x4ce615){return new BPromise(function(_0x291582,_0x406bbe){return client['request'](_0x3f06af,_0x4ce615)[_0x0f70('0x9')](function(_0x401c1f){logger['info'](_0x0f70('0xa'),_0xf6cf59,_0x0f70('0xb'));logger[_0x0f70('0xc')](_0x0f70('0xd'),_0xf6cf59,_0x0f70('0xb'),JSON['stringify'](_0x401c1f));if(_0x401c1f[_0x0f70('0xe')]){if(_0x401c1f['error']['code']===0x1f4){logger[_0x0f70('0xe')](_0x0f70('0xa'),_0xf6cf59,_0x401c1f[_0x0f70('0xe')][_0x0f70('0xf')]);return _0x406bbe(_0x401c1f[_0x0f70('0xe')]['message']);}logger[_0x0f70('0xe')](_0x0f70('0xa'),_0xf6cf59,_0x401c1f[_0x0f70('0xe')][_0x0f70('0xf')]);return _0x291582(_0x401c1f[_0x0f70('0xe')]['message']);}else{logger[_0x0f70('0x10')](_0x0f70('0xa'),_0xf6cf59,_0x0f70('0xb'));_0x291582(_0x401c1f['result'][_0x0f70('0xf')]);}})[_0x0f70('0x11')](function(_0x4c7551){logger['error'](_0x0f70('0xa'),_0xf6cf59,_0x4c7551);_0x406bbe(_0x4c7551);});});}exports[_0x0f70('0x12')]=function(_0x3f3712){var _0x2b3cf2=this;return new Promise(function(_0x58e7f6,_0x1c6ffa){return db[_0x0f70('0x13')][_0x0f70('0x14')]({'raw':_0x3f3712[_0x0f70('0x15')]?_0x3f3712[_0x0f70('0x15')][_0x0f70('0x16')]===undefined?!![]:![]:!![],'where':_0x3f3712[_0x0f70('0x15')]?_0x3f3712['options'][_0x0f70('0x17')]||null:null,'attributes':_0x3f3712['options']?_0x3f3712[_0x0f70('0x15')]['attributes']||null:null,'limit':_0x3f3712['options']?_0x3f3712[_0x0f70('0x15')]['limit']||null:null,'include':_0x3f3712[_0x0f70('0x15')]?_0x3f3712[_0x0f70('0x15')][_0x0f70('0x18')]?_[_0x0f70('0x19')](_0x3f3712[_0x0f70('0x15')][_0x0f70('0x18')],function(_0x1ca6ac){return{'model':db[_0x1ca6ac[_0x0f70('0x1a')]],'as':_0x1ca6ac['as'],'attributes':_0x1ca6ac[_0x0f70('0x1b')],'include':_0x1ca6ac[_0x0f70('0x18')]?_[_0x0f70('0x19')](_0x1ca6ac[_0x0f70('0x18')],function(_0x2aa1c4){return{'model':db[_0x2aa1c4[_0x0f70('0x1a')]],'as':_0x2aa1c4['as'],'attributes':_0x2aa1c4['attributes'],'include':_0x2aa1c4[_0x0f70('0x18')]?_[_0x0f70('0x19')](_0x2aa1c4[_0x0f70('0x18')],function(_0x188802){return{'model':db[_0x188802[_0x0f70('0x1a')]],'as':_0x188802['as'],'attributes':_0x188802['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f70('0x9')](function(_0x475765){logger[_0x0f70('0x10')](_0x0f70('0x12'),_0x3f3712);logger['debug'](_0x0f70('0x12'),_0x3f3712,JSON[_0x0f70('0x1c')](_0x475765));_0x58e7f6(_0x475765);})[_0x0f70('0x11')](function(_0x3abe2f){logger[_0x0f70('0xe')](_0x0f70('0x12'),_0x3abe2f[_0x0f70('0xf')],_0x3f3712);_0x1c6ffa(_0x2b3cf2[_0x0f70('0xe')](0x1f4,_0x3abe2f[_0x0f70('0xf')]));});});};exports[_0x0f70('0x1d')]=function(_0x92e936){var _0x51f3f1=this;return new Promise(function(_0x322294,_0x386eed){return db[_0x0f70('0x13')][_0x0f70('0x1e')]({'raw':_0x92e936[_0x0f70('0x15')]?_0x92e936[_0x0f70('0x15')][_0x0f70('0x16')]===undefined?!![]:![]:!![],'where':_0x92e936['options']?_0x92e936['options'][_0x0f70('0x17')]||null:null,'attributes':_0x92e936['options']?_0x92e936[_0x0f70('0x15')][_0x0f70('0x1b')]||null:null,'include':_0x92e936[_0x0f70('0x15')]?_0x92e936['options'][_0x0f70('0x18')]?_[_0x0f70('0x19')](_0x92e936[_0x0f70('0x15')][_0x0f70('0x18')],function(_0x453d9f){return{'model':db[_0x453d9f['model']],'as':_0x453d9f['as'],'attributes':_0x453d9f['attributes'],'include':_0x453d9f[_0x0f70('0x18')]?_[_0x0f70('0x19')](_0x453d9f['include'],function(_0x514509){return{'model':db[_0x514509[_0x0f70('0x1a')]],'as':_0x514509['as'],'attributes':_0x514509[_0x0f70('0x1b')],'include':_0x514509[_0x0f70('0x18')]?_[_0x0f70('0x19')](_0x514509[_0x0f70('0x18')],function(_0xae728b){return{'model':db[_0xae728b[_0x0f70('0x1a')]],'as':_0xae728b['as'],'attributes':_0xae728b[_0x0f70('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0f70('0x9')](function(_0x3a3233){logger[_0x0f70('0x10')](_0x0f70('0x1d'),_0x92e936);logger[_0x0f70('0xc')](_0x0f70('0x1d'),_0x92e936,JSON['stringify'](_0x3a3233));_0x322294(_0x3a3233);})[_0x0f70('0x11')](function(_0x3f7d60){logger[_0x0f70('0xe')](_0x0f70('0x1d'),_0x3f7d60['message'],_0x92e936);_0x386eed(_0x51f3f1[_0x0f70('0xe')](0x1f4,_0x3f7d60[_0x0f70('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index e7f2a22..8bf4478 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 _0xdafe=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','put','delete'];(function(_0x3333bb,_0x1df222){var _0x273d39=function(_0x5c411b){while(--_0x5c411b){_0x3333bb['push'](_0x3333bb['shift']());}};_0x273d39(++_0x1df222);}(_0xdafe,0xf2));var _0xedaf=function(_0x45f833,_0x3230e8){_0x45f833=_0x45f833-0x0;var _0x51a075=_0xdafe[_0x45f833];return _0x51a075;};'use strict';var multer=require(_0xedaf('0x0'));var util=require('util');var path=require(_0xedaf('0x1'));var timeout=require('connect-timeout');var express=require(_0xedaf('0x2'));var router=express[_0xedaf('0x3')]();var fs_extra=require(_0xedaf('0x4'));var auth=require(_0xedaf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xedaf('0x6'));var controller=require(_0xedaf('0x7'));router[_0xedaf('0x8')]('/',auth[_0xedaf('0x9')](),controller[_0xedaf('0xa')]);router[_0xedaf('0x8')](_0xedaf('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xedaf('0x8')](_0xedaf('0xc'),auth[_0xedaf('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xedaf('0xd')]);router[_0xedaf('0x8')](_0xedaf('0xe'),auth['isAuthenticated'](),controller[_0xedaf('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xedaf('0x10')]('/:id',auth[_0xedaf('0x9')](),controller['update']);router[_0xedaf('0x11')](_0xedaf('0xb'),auth[_0xedaf('0x9')](),controller[_0xedaf('0x12')]);module[_0xedaf('0x13')]=router; \ No newline at end of file +var _0x51c5=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','post','put','update'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x51c5,0x10b));var _0x551c=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x51c5[_0xef8146];return _0x5a6cb0;};'use strict';var multer=require('multer');var util=require(_0x551c('0x0'));var path=require('path');var timeout=require(_0x551c('0x1'));var express=require(_0x551c('0x2'));var router=express[_0x551c('0x3')]();var fs_extra=require(_0x551c('0x4'));var auth=require(_0x551c('0x5'));var interaction=require(_0x551c('0x6'));var config=require('../../config/environment');var controller=require(_0x551c('0x7'));router[_0x551c('0x8')]('/',auth['isAuthenticated'](),controller[_0x551c('0x9')]);router[_0x551c('0x8')](_0x551c('0xa'),auth[_0x551c('0xb')](),controller[_0x551c('0xc')]);router[_0x551c('0x8')]('/:id/fields',auth[_0x551c('0xb')](),controller['getFields']);router[_0x551c('0x8')](_0x551c('0xd'),auth['isAuthenticated'](),controller[_0x551c('0xe')]);router[_0x551c('0x8')]('/:id/descriptions',auth[_0x551c('0xb')](),controller[_0x551c('0xf')]);router[_0x551c('0x10')]('/',auth[_0x551c('0xb')](),controller['create']);router[_0x551c('0x11')]('/:id',auth[_0x551c('0xb')](),controller[_0x551c('0x12')]);router[_0x551c('0x13')](_0x551c('0xa'),auth[_0x551c('0xb')](),controller[_0x551c('0x14')]);module[_0x551c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 580dbb1..5d885a7 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 _0xdddd=['exports','STRING','sequelize'];(function(_0x43b601,_0x1fd0de){var _0x1384e6=function(_0x3464b3){while(--_0x3464b3){_0x43b601['push'](_0x43b601['shift']());}};_0x1384e6(++_0x1fd0de);}(_0xdddd,0x182));var _0xdddd=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xdddd[_0x4c260a];return _0x17bbdd;};'use strict';var Sequelize=require(_0xdddd('0x0'));module[_0xdddd('0x1')]={'name':{'type':Sequelize[_0xdddd('0x2')]},'description':{'type':Sequelize[_0xdddd('0x2')]}}; \ No newline at end of file +var _0x5d78=['exports','STRING'];(function(_0x491522,_0x1e7c2d){var _0x272b00=function(_0x3c561b){while(--_0x3c561b){_0x491522['push'](_0x491522['shift']());}};_0x272b00(++_0x1e7c2d);}(_0x5d78,0xb0));var _0x85d7=function(_0x33bcdc,_0xf57565){_0x33bcdc=_0x33bcdc-0x0;var _0x460d57=_0x5d78[_0x33bcdc];return _0x460d57;};'use strict';var Sequelize=require('sequelize');module[_0x85d7('0x0')]={'name':{'type':Sequelize[_0x85d7('0x1')]},'description':{'type':Sequelize[_0x85d7('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 874730d..398e27d 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 _0x76d8=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','destroy','then','error','stack','name','send','index','map','SugarcrmConfiguration','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5af81e,_0x3a0d0b){var _0x198f7c=function(_0x39269c){while(--_0x39269c){_0x5af81e['push'](_0x5af81e['shift']());}};_0x198f7c(++_0x3a0d0b);}(_0x76d8,0x8c));var _0x876d=function(_0x65a3fe,_0xaec92e){_0x65a3fe=_0x65a3fe-0x0;var _0xc27db8=_0x76d8[_0x65a3fe];return _0xc27db8;};'use strict';var emlformat=require(_0x876d('0x0'));var rimraf=require(_0x876d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x876d('0x2'));var rp=require(_0x876d('0x3'));var moment=require(_0x876d('0x4'));var BPromise=require(_0x876d('0x5'));var Mustache=require(_0x876d('0x6'));var util=require(_0x876d('0x7'));var path=require('path');var sox=require(_0x876d('0x8'));var csv=require(_0x876d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x876d('0xa'));var crypto=require(_0x876d('0xb'));var jsforce=require(_0x876d('0xc'));var deskjs=require(_0x876d('0xd'));var toCsv=require(_0x876d('0x9'));var querystring=require(_0x876d('0xe'));var Papa=require(_0x876d('0xf'));var Redis=require(_0x876d('0x10'));var authService=require(_0x876d('0x11'));var qs=require(_0x876d('0x12'));var as=require(_0x876d('0x13'));var hardwareService=require(_0x876d('0x14'));var logger=require(_0x876d('0x15'))(_0x876d('0x16'));var utils=require(_0x876d('0x17'));var config=require(_0x876d('0x18'));var licenseUtil=require(_0x876d('0x19'));var db=require(_0x876d('0x1a'))['db'];function respondWithStatusCode(_0x12dda5,_0x2778bd){_0x2778bd=_0x2778bd||0xcc;return function(_0x4b04e7){if(_0x4b04e7){return _0x12dda5[_0x876d('0x1b')](_0x2778bd);}return _0x12dda5[_0x876d('0x1c')](_0x2778bd)[_0x876d('0x1d')]();};}function respondWithResult(_0x4604d5,_0x348755){_0x348755=_0x348755||0xc8;return function(_0x355153){if(_0x355153){return _0x4604d5[_0x876d('0x1c')](_0x348755)[_0x876d('0x1e')](_0x355153);}};}function respondWithFilteredResult(_0x33cdbb,_0x3eea70){return function(_0x261a8e){if(_0x261a8e){var _0x392b35=typeof _0x3eea70['offset']===_0x876d('0x1f')&&typeof _0x3eea70[_0x876d('0x20')]===_0x876d('0x1f');var _0x13ac31=_0x261a8e[_0x876d('0x21')];var _0x2c6be2=_0x392b35?0x0:_0x3eea70[_0x876d('0x22')];var _0x52f392=_0x392b35?_0x261a8e['count']:_0x3eea70[_0x876d('0x22')]+_0x3eea70[_0x876d('0x20')];var _0x3efa19;if(_0x52f392>=_0x13ac31){_0x52f392=_0x13ac31;_0x3efa19=0xc8;}else{_0x3efa19=0xce;}_0x33cdbb[_0x876d('0x1c')](_0x3efa19);return _0x33cdbb[_0x876d('0x23')]('Content-Range',_0x2c6be2+'-'+_0x52f392+'/'+_0x13ac31)[_0x876d('0x1e')](_0x261a8e);}return null;};}function patchUpdates(_0x582cfe){return function(_0x44cfbc){try{jsonpatch['apply'](_0x44cfbc,_0x582cfe,!![]);}catch(_0x21e951){return BPromise[_0x876d('0x24')](_0x21e951);}return _0x44cfbc['save']();};}function saveUpdates(_0x142eea,_0x1a9373){return function(_0x4764c6){if(_0x4764c6){return _0x4764c6[_0x876d('0x25')](_0x142eea)['then'](function(_0x11ff0b){return _0x11ff0b;});}return null;};}function removeEntity(_0x10b00c,_0x45e877){return function(_0x5883b4){if(_0x5883b4){return _0x5883b4[_0x876d('0x26')]()[_0x876d('0x27')](function(){_0x10b00c['status'](0xcc)[_0x876d('0x1d')]();});}};}function handleEntityNotFound(_0x4ee368,_0x31671d){return function(_0x58dd38){if(!_0x58dd38){_0x4ee368[_0x876d('0x1b')](0x194);}return _0x58dd38;};}function handleError(_0x22c727,_0x1d3a11){_0x1d3a11=_0x1d3a11||0x1f4;return function(_0x58ff92){logger[_0x876d('0x28')](_0x58ff92[_0x876d('0x29')]);if(_0x58ff92[_0x876d('0x2a')]){delete _0x58ff92[_0x876d('0x2a')];}_0x22c727['status'](_0x1d3a11)[_0x876d('0x2b')](_0x58ff92);};}exports[_0x876d('0x2c')]=function(_0x1b8bda,_0x5bfbc7){var _0x4da7ae={},_0x25e0e6={},_0x2fda9c={'count':0x0,'rows':[]};var _0x44cf44=_[_0x876d('0x2d')](db[_0x876d('0x2e')]['rawAttributes'],function(_0x2134bb){return{'name':_0x2134bb['fieldName'],'type':_0x2134bb[_0x876d('0x2f')][_0x876d('0x30')]};});_0x25e0e6[_0x876d('0x31')]=_[_0x876d('0x2d')](_0x44cf44,_0x876d('0x2a'));_0x25e0e6[_0x876d('0x32')]=_[_0x876d('0x33')](_0x1b8bda[_0x876d('0x32')]);_0x25e0e6[_0x876d('0x34')]=_[_0x876d('0x35')](_0x25e0e6[_0x876d('0x31')],_0x25e0e6['query']);_0x4da7ae['attributes']=_[_0x876d('0x35')](_0x25e0e6[_0x876d('0x31')],qs['fields'](_0x1b8bda[_0x876d('0x32')][_0x876d('0x36')]));_0x4da7ae[_0x876d('0x37')]=_0x4da7ae[_0x876d('0x37')][_0x876d('0x38')]?_0x4da7ae[_0x876d('0x37')]:_0x25e0e6[_0x876d('0x31')];if(!_0x1b8bda[_0x876d('0x32')][_0x876d('0x39')](_0x876d('0x3a'))){_0x4da7ae[_0x876d('0x20')]=qs[_0x876d('0x20')](_0x1b8bda[_0x876d('0x32')][_0x876d('0x20')]);_0x4da7ae[_0x876d('0x22')]=qs[_0x876d('0x22')](_0x1b8bda[_0x876d('0x32')]['offset']);}_0x4da7ae[_0x876d('0x3b')]=qs[_0x876d('0x3c')](_0x1b8bda[_0x876d('0x32')][_0x876d('0x3c')]);_0x4da7ae[_0x876d('0x3d')]=qs[_0x876d('0x34')](_[_0x876d('0x3e')](_0x1b8bda[_0x876d('0x32')],_0x25e0e6[_0x876d('0x34')]),_0x44cf44);if(_0x1b8bda[_0x876d('0x32')]['filter']){_0x4da7ae['where']=_[_0x876d('0x3f')](_0x4da7ae[_0x876d('0x3d')],{'$or':_[_0x876d('0x2d')](_0x44cf44,function(_0x3a7a96){if(_0x3a7a96['type']!==_0x876d('0x40')){var _0x1d2334={};_0x1d2334[_0x3a7a96[_0x876d('0x2a')]]={'$like':'%'+_0x1b8bda[_0x876d('0x32')][_0x876d('0x41')]+'%'};return _0x1d2334;}})});}_0x4da7ae=_[_0x876d('0x3f')]({},_0x4da7ae,_0x1b8bda[_0x876d('0x42')]);var _0x50700b={'where':_0x4da7ae[_0x876d('0x3d')]};return db[_0x876d('0x2e')][_0x876d('0x21')](_0x50700b)[_0x876d('0x27')](function(_0x558662){_0x2fda9c[_0x876d('0x21')]=_0x558662;if(_0x1b8bda[_0x876d('0x32')][_0x876d('0x43')]){_0x4da7ae['include']=[{'all':!![]}];}return db[_0x876d('0x2e')][_0x876d('0x44')](_0x4da7ae);})[_0x876d('0x27')](function(_0x48887c){_0x2fda9c[_0x876d('0x45')]=_0x48887c;return _0x2fda9c;})[_0x876d('0x27')](respondWithFilteredResult(_0x5bfbc7,_0x4da7ae))[_0x876d('0x46')](handleError(_0x5bfbc7,null));};exports[_0x876d('0x47')]=function(_0x1ee245,_0x51b5b8){var _0x36b0f4={'raw':![],'where':{'id':_0x1ee245[_0x876d('0x48')]['id']}},_0x560d2b={};_0x560d2b[_0x876d('0x31')]=_['keys'](db[_0x876d('0x2e')][_0x876d('0x49')]);_0x560d2b[_0x876d('0x32')]=_['keys'](_0x1ee245[_0x876d('0x32')]);_0x560d2b[_0x876d('0x34')]=_[_0x876d('0x35')](_0x560d2b[_0x876d('0x31')],_0x560d2b[_0x876d('0x32')]);_0x36b0f4[_0x876d('0x37')]=_[_0x876d('0x35')](_0x560d2b[_0x876d('0x31')],qs[_0x876d('0x36')](_0x1ee245[_0x876d('0x32')][_0x876d('0x36')]));_0x36b0f4[_0x876d('0x37')]=_0x36b0f4[_0x876d('0x37')][_0x876d('0x38')]?_0x36b0f4[_0x876d('0x37')]:_0x560d2b['model'];if(_0x1ee245['query'][_0x876d('0x43')]){_0x36b0f4[_0x876d('0x4a')]=[{'all':!![]}];}_0x36b0f4=_[_0x876d('0x3f')]({},_0x36b0f4,_0x1ee245[_0x876d('0x42')]);return db[_0x876d('0x2e')][_0x876d('0x4b')](_0x36b0f4)['then'](handleEntityNotFound(_0x51b5b8,null))[_0x876d('0x27')](respondWithResult(_0x51b5b8,null))[_0x876d('0x46')](handleError(_0x51b5b8,null));};exports[_0x876d('0x4c')]=function(_0x5ef73a,_0x574fe2){return db['SugarcrmConfiguration'][_0x876d('0x4c')](_0x5ef73a[_0x876d('0x4d')],{})[_0x876d('0x27')](respondWithResult(_0x574fe2,0xc9))[_0x876d('0x46')](handleError(_0x574fe2,null));};exports['update']=function(_0xb725cc,_0x31afee){if(_0xb725cc[_0x876d('0x4d')]['id']){delete _0xb725cc['body']['id'];}return db[_0x876d('0x2e')][_0x876d('0x4b')]({'where':{'id':_0xb725cc[_0x876d('0x48')]['id']}})[_0x876d('0x27')](handleEntityNotFound(_0x31afee,null))[_0x876d('0x27')](saveUpdates(_0xb725cc[_0x876d('0x4d')],null))[_0x876d('0x27')](respondWithResult(_0x31afee,null))[_0x876d('0x46')](handleError(_0x31afee,null));};exports[_0x876d('0x26')]=function(_0x2dd1cb,_0x17f922){return db[_0x876d('0x2e')]['find']({'where':{'id':_0x2dd1cb['params']['id']}})['then'](handleEntityNotFound(_0x17f922,null))[_0x876d('0x27')](removeEntity(_0x17f922,null))['catch'](handleError(_0x17f922,null));};exports[_0x876d('0x4e')]=function(_0x598e92,_0x7f267,_0x2ddf58){var _0x30db9f={};var _0x1ecc20={};var _0x30dfdc;var _0x4c55ea;return db[_0x876d('0x2e')][_0x876d('0x4f')]({'where':{'id':_0x598e92['params']['id']}})[_0x876d('0x27')](handleEntityNotFound(_0x7f267,null))[_0x876d('0x27')](function(_0x32ac61){if(_0x32ac61){_0x30dfdc=_0x32ac61;_0x1ecc20[_0x876d('0x31')]=_[_0x876d('0x33')](db[_0x876d('0x50')][_0x876d('0x49')]);_0x1ecc20[_0x876d('0x32')]=_[_0x876d('0x33')](_0x598e92[_0x876d('0x32')]);_0x1ecc20[_0x876d('0x34')]=_['intersection'](_0x1ecc20[_0x876d('0x31')],_0x1ecc20[_0x876d('0x32')]);_0x30db9f[_0x876d('0x37')]=_['intersection'](_0x1ecc20['model'],qs[_0x876d('0x36')](_0x598e92[_0x876d('0x32')][_0x876d('0x36')]));_0x30db9f[_0x876d('0x37')]=_0x30db9f[_0x876d('0x37')]['length']?_0x30db9f[_0x876d('0x37')]:_0x1ecc20[_0x876d('0x31')];_0x30db9f[_0x876d('0x3b')]=qs['sort'](_0x598e92[_0x876d('0x32')]['sort']);_0x30db9f[_0x876d('0x3d')]=qs[_0x876d('0x34')](_[_0x876d('0x3e')](_0x598e92[_0x876d('0x32')],_0x1ecc20[_0x876d('0x34')]));if(_0x598e92[_0x876d('0x32')][_0x876d('0x41')]){_0x30db9f['where']=_[_0x876d('0x3f')](_0x30db9f['where'],{'$or':_[_0x876d('0x2d')](_0x30db9f[_0x876d('0x37')],function(_0x43d7f4){var _0x53b173={};_0x53b173[_0x43d7f4]={'$like':'%'+_0x598e92[_0x876d('0x32')][_0x876d('0x41')]+'%'};return _0x53b173;})});}_0x30db9f=_[_0x876d('0x3f')]({},_0x30db9f,_0x598e92[_0x876d('0x42')]);return _0x30dfdc[_0x876d('0x4e')](_0x30db9f);}})['then'](function(_0x5f16f6){if(_0x5f16f6){_0x4c55ea=_0x5f16f6[_0x876d('0x38')];if(!_0x598e92['query']['hasOwnProperty'](_0x876d('0x3a'))){_0x30db9f[_0x876d('0x20')]=qs[_0x876d('0x20')](_0x598e92[_0x876d('0x32')][_0x876d('0x20')]);_0x30db9f[_0x876d('0x22')]=qs[_0x876d('0x22')](_0x598e92[_0x876d('0x32')][_0x876d('0x22')]);}return _0x30dfdc[_0x876d('0x4e')](_0x30db9f);}})[_0x876d('0x27')](function(_0xa7cfce){if(_0xa7cfce){return _0xa7cfce?{'count':_0x4c55ea,'rows':_0xa7cfce}:null;}})[_0x876d('0x27')](respondWithResult(_0x7f267,null))[_0x876d('0x46')](handleError(_0x7f267,null));};exports[_0x876d('0x51')]=function(_0x2f5533,_0x354df2,_0x54ff5b){var _0x493c22={};var _0x3cc7da={};var _0xecfd22;var _0x4e10cd;return db[_0x876d('0x2e')][_0x876d('0x4f')]({'where':{'id':_0x2f5533[_0x876d('0x48')]['id']}})[_0x876d('0x27')](handleEntityNotFound(_0x354df2,null))[_0x876d('0x27')](function(_0x5495e4){if(_0x5495e4){_0xecfd22=_0x5495e4;_0x3cc7da[_0x876d('0x31')]=_[_0x876d('0x33')](db[_0x876d('0x50')][_0x876d('0x49')]);_0x3cc7da[_0x876d('0x32')]=_[_0x876d('0x33')](_0x2f5533[_0x876d('0x32')]);_0x3cc7da['filters']=_['intersection'](_0x3cc7da[_0x876d('0x31')],_0x3cc7da[_0x876d('0x32')]);_0x493c22['attributes']=_[_0x876d('0x35')](_0x3cc7da[_0x876d('0x31')],qs[_0x876d('0x36')](_0x2f5533['query'][_0x876d('0x36')]));_0x493c22['attributes']=_0x493c22[_0x876d('0x37')][_0x876d('0x38')]?_0x493c22['attributes']:_0x3cc7da[_0x876d('0x31')];_0x493c22[_0x876d('0x3b')]=qs['sort'](_0x2f5533[_0x876d('0x32')][_0x876d('0x3c')]);_0x493c22[_0x876d('0x3d')]=qs[_0x876d('0x34')](_[_0x876d('0x3e')](_0x2f5533[_0x876d('0x32')],_0x3cc7da[_0x876d('0x34')]));if(_0x2f5533[_0x876d('0x32')][_0x876d('0x41')]){_0x493c22['where']=_[_0x876d('0x3f')](_0x493c22['where'],{'$or':_['map'](_0x493c22[_0x876d('0x37')],function(_0x2a6b78){var _0x3f9838={};_0x3f9838[_0x2a6b78]={'$like':'%'+_0x2f5533[_0x876d('0x32')][_0x876d('0x41')]+'%'};return _0x3f9838;})});}_0x493c22=_[_0x876d('0x3f')]({},_0x493c22,_0x2f5533[_0x876d('0x42')]);return _0xecfd22[_0x876d('0x51')](_0x493c22);}})[_0x876d('0x27')](function(_0x4f4615){if(_0x4f4615){_0x4e10cd=_0x4f4615[_0x876d('0x38')];if(!_0x2f5533[_0x876d('0x32')]['hasOwnProperty'](_0x876d('0x3a'))){_0x493c22[_0x876d('0x20')]=qs['limit'](_0x2f5533[_0x876d('0x32')][_0x876d('0x20')]);_0x493c22[_0x876d('0x22')]=qs[_0x876d('0x22')](_0x2f5533[_0x876d('0x32')][_0x876d('0x22')]);}return _0xecfd22['getSubjects'](_0x493c22);}})[_0x876d('0x27')](function(_0x1466da){if(_0x1466da){return _0x1466da?{'count':_0x4e10cd,'rows':_0x1466da}:null;}})[_0x876d('0x27')](respondWithResult(_0x354df2,null))[_0x876d('0x46')](handleError(_0x354df2,null));};exports[_0x876d('0x52')]=function(_0x541748,_0x542d7b,_0x1b5390){var _0x409e17={};var _0x3be47a={};var _0x293f30;var _0x11778a;return db[_0x876d('0x2e')][_0x876d('0x4f')]({'where':{'id':_0x541748[_0x876d('0x48')]['id']}})[_0x876d('0x27')](handleEntityNotFound(_0x542d7b,null))[_0x876d('0x27')](function(_0x2c78c1){if(_0x2c78c1){_0x293f30=_0x2c78c1;_0x3be47a[_0x876d('0x31')]=_[_0x876d('0x33')](db[_0x876d('0x50')][_0x876d('0x49')]);_0x3be47a[_0x876d('0x32')]=_[_0x876d('0x33')](_0x541748[_0x876d('0x32')]);_0x3be47a['filters']=_[_0x876d('0x35')](_0x3be47a[_0x876d('0x31')],_0x3be47a[_0x876d('0x32')]);_0x409e17['attributes']=_[_0x876d('0x35')](_0x3be47a['model'],qs[_0x876d('0x36')](_0x541748[_0x876d('0x32')][_0x876d('0x36')]));_0x409e17[_0x876d('0x37')]=_0x409e17[_0x876d('0x37')]['length']?_0x409e17['attributes']:_0x3be47a[_0x876d('0x31')];_0x409e17[_0x876d('0x3b')]=qs['sort'](_0x541748['query'][_0x876d('0x3c')]);_0x409e17['where']=qs[_0x876d('0x34')](_[_0x876d('0x3e')](_0x541748[_0x876d('0x32')],_0x3be47a[_0x876d('0x34')]));if(_0x541748[_0x876d('0x32')][_0x876d('0x41')]){_0x409e17[_0x876d('0x3d')]=_[_0x876d('0x3f')](_0x409e17[_0x876d('0x3d')],{'$or':_['map'](_0x409e17[_0x876d('0x37')],function(_0x1f370f){var _0x219971={};_0x219971[_0x1f370f]={'$like':'%'+_0x541748['query'][_0x876d('0x41')]+'%'};return _0x219971;})});}_0x409e17=_['merge']({},_0x409e17,_0x541748[_0x876d('0x42')]);return _0x293f30[_0x876d('0x52')](_0x409e17);}})[_0x876d('0x27')](function(_0x4ee991){if(_0x4ee991){_0x11778a=_0x4ee991[_0x876d('0x38')];if(!_0x541748['query'][_0x876d('0x39')](_0x876d('0x3a'))){_0x409e17[_0x876d('0x20')]=qs[_0x876d('0x20')](_0x541748[_0x876d('0x32')][_0x876d('0x20')]);_0x409e17[_0x876d('0x22')]=qs['offset'](_0x541748[_0x876d('0x32')][_0x876d('0x22')]);}return _0x293f30[_0x876d('0x52')](_0x409e17);}})['then'](function(_0x494e53){if(_0x494e53){return _0x494e53?{'count':_0x11778a,'rows':_0x494e53}:null;}})[_0x876d('0x27')](respondWithResult(_0x542d7b,null))['catch'](handleError(_0x542d7b,null));}; \ No newline at end of file +var _0xea29=['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','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','then','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getFields','getSubjects','hasOwnProperty','getDescriptions','findOne','SugarcrmField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x246dea,_0x3535e6){var _0x48ac5b=function(_0x222629){while(--_0x222629){_0x246dea['push'](_0x246dea['shift']());}};_0x48ac5b(++_0x3535e6);}(_0xea29,0x18a));var _0x9ea2=function(_0x115cdc,_0x2533b9){_0x115cdc=_0x115cdc-0x0;var _0x43259f=_0xea29[_0x115cdc];return _0x43259f;};'use strict';var emlformat=require(_0x9ea2('0x0'));var rimraf=require(_0x9ea2('0x1'));var zipdir=require(_0x9ea2('0x2'));var jsonpatch=require(_0x9ea2('0x3'));var rp=require(_0x9ea2('0x4'));var moment=require(_0x9ea2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9ea2('0x6'));var util=require(_0x9ea2('0x7'));var path=require(_0x9ea2('0x8'));var sox=require(_0x9ea2('0x9'));var csv=require(_0x9ea2('0xa'));var ejs=require(_0x9ea2('0xb'));var fs=require('fs');var fs_extra=require(_0x9ea2('0xc'));var _=require(_0x9ea2('0xd'));var squel=require('squel');var crypto=require(_0x9ea2('0xe'));var jsforce=require(_0x9ea2('0xf'));var deskjs=require(_0x9ea2('0x10'));var toCsv=require(_0x9ea2('0xa'));var querystring=require(_0x9ea2('0x11'));var Papa=require(_0x9ea2('0x12'));var Redis=require(_0x9ea2('0x13'));var authService=require(_0x9ea2('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9ea2('0x15'));var hardwareService=require(_0x9ea2('0x16'));var logger=require(_0x9ea2('0x17'))(_0x9ea2('0x18'));var utils=require('../../config/utils');var config=require(_0x9ea2('0x19'));var licenseUtil=require(_0x9ea2('0x1a'));var db=require(_0x9ea2('0x1b'))['db'];function respondWithStatusCode(_0x9b1c11,_0x5d8dc4){_0x5d8dc4=_0x5d8dc4||0xcc;return function(_0x1e1327){if(_0x1e1327){return _0x9b1c11[_0x9ea2('0x1c')](_0x5d8dc4);}return _0x9b1c11[_0x9ea2('0x1d')](_0x5d8dc4)[_0x9ea2('0x1e')]();};}function respondWithResult(_0x913542,_0x350cf9){_0x350cf9=_0x350cf9||0xc8;return function(_0x32ff07){if(_0x32ff07){return _0x913542[_0x9ea2('0x1d')](_0x350cf9)[_0x9ea2('0x1f')](_0x32ff07);}};}function respondWithFilteredResult(_0x5dd807,_0x281e8e){return function(_0xfd76c5){if(_0xfd76c5){var _0x17b067=typeof _0x281e8e['offset']===_0x9ea2('0x20')&&typeof _0x281e8e[_0x9ea2('0x21')]===_0x9ea2('0x20');var _0xdd502e=_0xfd76c5[_0x9ea2('0x22')];var _0x27ceed=_0x17b067?0x0:_0x281e8e[_0x9ea2('0x23')];var _0x177aff=_0x17b067?_0xfd76c5['count']:_0x281e8e['offset']+_0x281e8e['limit'];var _0x3b2846;if(_0x177aff>=_0xdd502e){_0x177aff=_0xdd502e;_0x3b2846=0xc8;}else{_0x3b2846=0xce;}_0x5dd807[_0x9ea2('0x1d')](_0x3b2846);return _0x5dd807[_0x9ea2('0x24')](_0x9ea2('0x25'),_0x27ceed+'-'+_0x177aff+'/'+_0xdd502e)['json'](_0xfd76c5);}return null;};}function patchUpdates(_0x5c0533){return function(_0x18cd58){try{jsonpatch['apply'](_0x18cd58,_0x5c0533,!![]);}catch(_0x8aa87){return BPromise[_0x9ea2('0x26')](_0x8aa87);}return _0x18cd58['save']();};}function saveUpdates(_0x4d6f34,_0x4cdcdc){return function(_0x5f5740){if(_0x5f5740){return _0x5f5740[_0x9ea2('0x27')](_0x4d6f34)['then'](function(_0x5e2a61){return _0x5e2a61;});}return null;};}function removeEntity(_0x4fe2b8,_0x1c74a3){return function(_0x38ca97){if(_0x38ca97){return _0x38ca97[_0x9ea2('0x28')]()[_0x9ea2('0x29')](function(){_0x4fe2b8[_0x9ea2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28c262,_0x5bc243){return function(_0x26492d){if(!_0x26492d){_0x28c262[_0x9ea2('0x1c')](0x194);}return _0x26492d;};}function handleError(_0x30ca43,_0x220fa5){_0x220fa5=_0x220fa5||0x1f4;return function(_0x97cc56){logger[_0x9ea2('0x2a')](_0x97cc56[_0x9ea2('0x2b')]);if(_0x97cc56[_0x9ea2('0x2c')]){delete _0x97cc56[_0x9ea2('0x2c')];}_0x30ca43[_0x9ea2('0x1d')](_0x220fa5)['send'](_0x97cc56);};}exports[_0x9ea2('0x2d')]=function(_0x11a731,_0x769c09){var _0x431860={},_0xa0bb6d={},_0x1b30cd={'count':0x0,'rows':[]};var _0x21dc34=_[_0x9ea2('0x2e')](db[_0x9ea2('0x2f')][_0x9ea2('0x30')],function(_0x2a7e19){return{'name':_0x2a7e19[_0x9ea2('0x31')],'type':_0x2a7e19[_0x9ea2('0x32')]['key']};});_0xa0bb6d[_0x9ea2('0x33')]=_[_0x9ea2('0x2e')](_0x21dc34,_0x9ea2('0x2c'));_0xa0bb6d[_0x9ea2('0x34')]=_[_0x9ea2('0x35')](_0x11a731[_0x9ea2('0x34')]);_0xa0bb6d[_0x9ea2('0x36')]=_[_0x9ea2('0x37')](_0xa0bb6d[_0x9ea2('0x33')],_0xa0bb6d[_0x9ea2('0x34')]);_0x431860[_0x9ea2('0x38')]=_['intersection'](_0xa0bb6d['model'],qs[_0x9ea2('0x39')](_0x11a731[_0x9ea2('0x34')][_0x9ea2('0x39')]));_0x431860[_0x9ea2('0x38')]=_0x431860[_0x9ea2('0x38')][_0x9ea2('0x3a')]?_0x431860[_0x9ea2('0x38')]:_0xa0bb6d[_0x9ea2('0x33')];if(!_0x11a731[_0x9ea2('0x34')]['hasOwnProperty'](_0x9ea2('0x3b'))){_0x431860[_0x9ea2('0x21')]=qs[_0x9ea2('0x21')](_0x11a731[_0x9ea2('0x34')]['limit']);_0x431860[_0x9ea2('0x23')]=qs[_0x9ea2('0x23')](_0x11a731[_0x9ea2('0x34')][_0x9ea2('0x23')]);}_0x431860[_0x9ea2('0x3c')]=qs[_0x9ea2('0x3d')](_0x11a731['query']['sort']);_0x431860[_0x9ea2('0x3e')]=qs[_0x9ea2('0x36')](_[_0x9ea2('0x3f')](_0x11a731['query'],_0xa0bb6d[_0x9ea2('0x36')]),_0x21dc34);if(_0x11a731[_0x9ea2('0x34')][_0x9ea2('0x40')]){_0x431860[_0x9ea2('0x3e')]=_['merge'](_0x431860[_0x9ea2('0x3e')],{'$or':_[_0x9ea2('0x2e')](_0x21dc34,function(_0x3347fc){if(_0x3347fc['type']!=='VIRTUAL'){var _0xb0b817={};_0xb0b817[_0x3347fc[_0x9ea2('0x2c')]]={'$like':'%'+_0x11a731[_0x9ea2('0x34')]['filter']+'%'};return _0xb0b817;}})});}_0x431860=_[_0x9ea2('0x41')]({},_0x431860,_0x11a731[_0x9ea2('0x42')]);var _0x4ab183={'where':_0x431860[_0x9ea2('0x3e')]};return db['SugarcrmConfiguration'][_0x9ea2('0x22')](_0x4ab183)[_0x9ea2('0x29')](function(_0x344b73){_0x1b30cd['count']=_0x344b73;if(_0x11a731[_0x9ea2('0x34')][_0x9ea2('0x43')]){_0x431860[_0x9ea2('0x44')]=[{'all':!![]}];}return db[_0x9ea2('0x2f')]['findAll'](_0x431860);})['then'](function(_0x648357){_0x1b30cd[_0x9ea2('0x45')]=_0x648357;return _0x1b30cd;})['then'](respondWithFilteredResult(_0x769c09,_0x431860))[_0x9ea2('0x46')](handleError(_0x769c09,null));};exports[_0x9ea2('0x47')]=function(_0x40a041,_0x32d6f3){var _0xee61b9={'raw':![],'where':{'id':_0x40a041[_0x9ea2('0x48')]['id']}},_0xad2e5f={};_0xad2e5f[_0x9ea2('0x33')]=_['keys'](db[_0x9ea2('0x2f')]['rawAttributes']);_0xad2e5f['query']=_[_0x9ea2('0x35')](_0x40a041[_0x9ea2('0x34')]);_0xad2e5f[_0x9ea2('0x36')]=_[_0x9ea2('0x37')](_0xad2e5f[_0x9ea2('0x33')],_0xad2e5f[_0x9ea2('0x34')]);_0xee61b9[_0x9ea2('0x38')]=_['intersection'](_0xad2e5f[_0x9ea2('0x33')],qs[_0x9ea2('0x39')](_0x40a041[_0x9ea2('0x34')][_0x9ea2('0x39')]));_0xee61b9[_0x9ea2('0x38')]=_0xee61b9[_0x9ea2('0x38')][_0x9ea2('0x3a')]?_0xee61b9[_0x9ea2('0x38')]:_0xad2e5f[_0x9ea2('0x33')];if(_0x40a041[_0x9ea2('0x34')][_0x9ea2('0x43')]){_0xee61b9[_0x9ea2('0x44')]=[{'all':!![]}];}_0xee61b9=_[_0x9ea2('0x41')]({},_0xee61b9,_0x40a041[_0x9ea2('0x42')]);return db[_0x9ea2('0x2f')][_0x9ea2('0x49')](_0xee61b9)[_0x9ea2('0x29')](handleEntityNotFound(_0x32d6f3,null))['then'](respondWithResult(_0x32d6f3,null))[_0x9ea2('0x46')](handleError(_0x32d6f3,null));};exports[_0x9ea2('0x4a')]=function(_0x204d4e,_0x31a33c){return db[_0x9ea2('0x2f')][_0x9ea2('0x4a')](_0x204d4e[_0x9ea2('0x4b')],{})[_0x9ea2('0x29')](respondWithResult(_0x31a33c,0xc9))[_0x9ea2('0x46')](handleError(_0x31a33c,null));};exports[_0x9ea2('0x27')]=function(_0x26a268,_0x8dd8e4){if(_0x26a268[_0x9ea2('0x4b')]['id']){delete _0x26a268['body']['id'];}return db[_0x9ea2('0x2f')]['find']({'where':{'id':_0x26a268[_0x9ea2('0x48')]['id']}})[_0x9ea2('0x29')](handleEntityNotFound(_0x8dd8e4,null))[_0x9ea2('0x29')](saveUpdates(_0x26a268[_0x9ea2('0x4b')],null))[_0x9ea2('0x29')](respondWithResult(_0x8dd8e4,null))[_0x9ea2('0x46')](handleError(_0x8dd8e4,null));};exports[_0x9ea2('0x28')]=function(_0xb8ae9e,_0x33ec3b){return db[_0x9ea2('0x2f')][_0x9ea2('0x49')]({'where':{'id':_0xb8ae9e[_0x9ea2('0x48')]['id']}})[_0x9ea2('0x29')](handleEntityNotFound(_0x33ec3b,null))[_0x9ea2('0x29')](removeEntity(_0x33ec3b,null))['catch'](handleError(_0x33ec3b,null));};exports[_0x9ea2('0x4c')]=function(_0x47c667,_0x22d4a3,_0x48f367){var _0x5e636c={};var _0x4be2fc={};var _0x4ee0d5;var _0x4f9766;return db[_0x9ea2('0x2f')]['findOne']({'where':{'id':_0x47c667[_0x9ea2('0x48')]['id']}})[_0x9ea2('0x29')](handleEntityNotFound(_0x22d4a3,null))[_0x9ea2('0x29')](function(_0x546a32){if(_0x546a32){_0x4ee0d5=_0x546a32;_0x4be2fc['model']=_['keys'](db['SugarcrmField'][_0x9ea2('0x30')]);_0x4be2fc[_0x9ea2('0x34')]=_[_0x9ea2('0x35')](_0x47c667['query']);_0x4be2fc[_0x9ea2('0x36')]=_[_0x9ea2('0x37')](_0x4be2fc[_0x9ea2('0x33')],_0x4be2fc['query']);_0x5e636c[_0x9ea2('0x38')]=_[_0x9ea2('0x37')](_0x4be2fc[_0x9ea2('0x33')],qs[_0x9ea2('0x39')](_0x47c667['query'][_0x9ea2('0x39')]));_0x5e636c[_0x9ea2('0x38')]=_0x5e636c[_0x9ea2('0x38')][_0x9ea2('0x3a')]?_0x5e636c[_0x9ea2('0x38')]:_0x4be2fc[_0x9ea2('0x33')];_0x5e636c[_0x9ea2('0x3c')]=qs[_0x9ea2('0x3d')](_0x47c667[_0x9ea2('0x34')][_0x9ea2('0x3d')]);_0x5e636c['where']=qs[_0x9ea2('0x36')](_[_0x9ea2('0x3f')](_0x47c667[_0x9ea2('0x34')],_0x4be2fc['filters']));if(_0x47c667[_0x9ea2('0x34')][_0x9ea2('0x40')]){_0x5e636c['where']=_[_0x9ea2('0x41')](_0x5e636c[_0x9ea2('0x3e')],{'$or':_['map'](_0x5e636c[_0x9ea2('0x38')],function(_0x1935ce){var _0x4f1cc3={};_0x4f1cc3[_0x1935ce]={'$like':'%'+_0x47c667[_0x9ea2('0x34')][_0x9ea2('0x40')]+'%'};return _0x4f1cc3;})});}_0x5e636c=_[_0x9ea2('0x41')]({},_0x5e636c,_0x47c667[_0x9ea2('0x42')]);return _0x4ee0d5['getFields'](_0x5e636c);}})[_0x9ea2('0x29')](function(_0x2c19e8){if(_0x2c19e8){_0x4f9766=_0x2c19e8[_0x9ea2('0x3a')];if(!_0x47c667['query']['hasOwnProperty'](_0x9ea2('0x3b'))){_0x5e636c[_0x9ea2('0x21')]=qs[_0x9ea2('0x21')](_0x47c667[_0x9ea2('0x34')][_0x9ea2('0x21')]);_0x5e636c['offset']=qs[_0x9ea2('0x23')](_0x47c667['query'][_0x9ea2('0x23')]);}return _0x4ee0d5[_0x9ea2('0x4c')](_0x5e636c);}})[_0x9ea2('0x29')](function(_0x218376){if(_0x218376){return _0x218376?{'count':_0x4f9766,'rows':_0x218376}:null;}})['then'](respondWithResult(_0x22d4a3,null))['catch'](handleError(_0x22d4a3,null));};exports[_0x9ea2('0x4d')]=function(_0x2be938,_0x1af3d4,_0x421deb){var _0x51b1c0={};var _0x145f5b={};var _0x20eb7e;var _0x57a8c6;return db[_0x9ea2('0x2f')]['findOne']({'where':{'id':_0x2be938['params']['id']}})[_0x9ea2('0x29')](handleEntityNotFound(_0x1af3d4,null))['then'](function(_0x4a1caa){if(_0x4a1caa){_0x20eb7e=_0x4a1caa;_0x145f5b[_0x9ea2('0x33')]=_[_0x9ea2('0x35')](db['SugarcrmField']['rawAttributes']);_0x145f5b[_0x9ea2('0x34')]=_[_0x9ea2('0x35')](_0x2be938[_0x9ea2('0x34')]);_0x145f5b['filters']=_[_0x9ea2('0x37')](_0x145f5b['model'],_0x145f5b[_0x9ea2('0x34')]);_0x51b1c0['attributes']=_[_0x9ea2('0x37')](_0x145f5b[_0x9ea2('0x33')],qs[_0x9ea2('0x39')](_0x2be938[_0x9ea2('0x34')]['fields']));_0x51b1c0['attributes']=_0x51b1c0[_0x9ea2('0x38')][_0x9ea2('0x3a')]?_0x51b1c0['attributes']:_0x145f5b[_0x9ea2('0x33')];_0x51b1c0[_0x9ea2('0x3c')]=qs['sort'](_0x2be938['query'][_0x9ea2('0x3d')]);_0x51b1c0[_0x9ea2('0x3e')]=qs[_0x9ea2('0x36')](_[_0x9ea2('0x3f')](_0x2be938['query'],_0x145f5b[_0x9ea2('0x36')]));if(_0x2be938[_0x9ea2('0x34')][_0x9ea2('0x40')]){_0x51b1c0[_0x9ea2('0x3e')]=_[_0x9ea2('0x41')](_0x51b1c0[_0x9ea2('0x3e')],{'$or':_['map'](_0x51b1c0['attributes'],function(_0x4c8d8a){var _0x59cd88={};_0x59cd88[_0x4c8d8a]={'$like':'%'+_0x2be938['query']['filter']+'%'};return _0x59cd88;})});}_0x51b1c0=_[_0x9ea2('0x41')]({},_0x51b1c0,_0x2be938['options']);return _0x20eb7e['getSubjects'](_0x51b1c0);}})[_0x9ea2('0x29')](function(_0x39e755){if(_0x39e755){_0x57a8c6=_0x39e755[_0x9ea2('0x3a')];if(!_0x2be938[_0x9ea2('0x34')][_0x9ea2('0x4e')](_0x9ea2('0x3b'))){_0x51b1c0['limit']=qs[_0x9ea2('0x21')](_0x2be938[_0x9ea2('0x34')][_0x9ea2('0x21')]);_0x51b1c0[_0x9ea2('0x23')]=qs[_0x9ea2('0x23')](_0x2be938[_0x9ea2('0x34')]['offset']);}return _0x20eb7e[_0x9ea2('0x4d')](_0x51b1c0);}})[_0x9ea2('0x29')](function(_0x5aa5d2){if(_0x5aa5d2){return _0x5aa5d2?{'count':_0x57a8c6,'rows':_0x5aa5d2}:null;}})['then'](respondWithResult(_0x1af3d4,null))['catch'](handleError(_0x1af3d4,null));};exports[_0x9ea2('0x4f')]=function(_0x1da813,_0x304b6c,_0xdf628e){var _0x37fc16={};var _0x33fbb5={};var _0x1cc923;var _0x3ada49;return db[_0x9ea2('0x2f')][_0x9ea2('0x50')]({'where':{'id':_0x1da813[_0x9ea2('0x48')]['id']}})[_0x9ea2('0x29')](handleEntityNotFound(_0x304b6c,null))[_0x9ea2('0x29')](function(_0x3c6c8a){if(_0x3c6c8a){_0x1cc923=_0x3c6c8a;_0x33fbb5[_0x9ea2('0x33')]=_['keys'](db[_0x9ea2('0x51')][_0x9ea2('0x30')]);_0x33fbb5['query']=_['keys'](_0x1da813[_0x9ea2('0x34')]);_0x33fbb5[_0x9ea2('0x36')]=_[_0x9ea2('0x37')](_0x33fbb5['model'],_0x33fbb5[_0x9ea2('0x34')]);_0x37fc16[_0x9ea2('0x38')]=_[_0x9ea2('0x37')](_0x33fbb5['model'],qs[_0x9ea2('0x39')](_0x1da813[_0x9ea2('0x34')][_0x9ea2('0x39')]));_0x37fc16[_0x9ea2('0x38')]=_0x37fc16[_0x9ea2('0x38')][_0x9ea2('0x3a')]?_0x37fc16['attributes']:_0x33fbb5[_0x9ea2('0x33')];_0x37fc16[_0x9ea2('0x3c')]=qs[_0x9ea2('0x3d')](_0x1da813[_0x9ea2('0x34')][_0x9ea2('0x3d')]);_0x37fc16['where']=qs[_0x9ea2('0x36')](_[_0x9ea2('0x3f')](_0x1da813[_0x9ea2('0x34')],_0x33fbb5['filters']));if(_0x1da813[_0x9ea2('0x34')][_0x9ea2('0x40')]){_0x37fc16[_0x9ea2('0x3e')]=_['merge'](_0x37fc16[_0x9ea2('0x3e')],{'$or':_['map'](_0x37fc16[_0x9ea2('0x38')],function(_0x328836){var _0x4585c6={};_0x4585c6[_0x328836]={'$like':'%'+_0x1da813[_0x9ea2('0x34')][_0x9ea2('0x40')]+'%'};return _0x4585c6;})});}_0x37fc16=_[_0x9ea2('0x41')]({},_0x37fc16,_0x1da813[_0x9ea2('0x42')]);return _0x1cc923[_0x9ea2('0x4f')](_0x37fc16);}})[_0x9ea2('0x29')](function(_0x3ef85a){if(_0x3ef85a){_0x3ada49=_0x3ef85a['length'];if(!_0x1da813[_0x9ea2('0x34')][_0x9ea2('0x4e')]('nolimit')){_0x37fc16[_0x9ea2('0x21')]=qs[_0x9ea2('0x21')](_0x1da813[_0x9ea2('0x34')][_0x9ea2('0x21')]);_0x37fc16['offset']=qs['offset'](_0x1da813[_0x9ea2('0x34')][_0x9ea2('0x23')]);}return _0x1cc923['getDescriptions'](_0x37fc16);}})['then'](function(_0x2add47){if(_0x2add47){return _0x2add47?{'count':_0x3ada49,'rows':_0x2add47}:null;}})['then'](respondWithResult(_0x304b6c,null))[_0x9ea2('0x46')](handleError(_0x304b6c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index e4f24f8..edacbd0 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 _0xc10f=['int_sugarcrm_configurations','lodash','util','api','moment','bluebird','path','../../config/environment','define','SugarcrmConfiguration'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc10f,0xa1));var _0xfc10=function(_0xcf25ce,_0xbab315){_0xcf25ce=_0xcf25ce-0x0;var _0x31fb66=_0xc10f[_0xcf25ce];return _0x31fb66;};'use strict';var _=require(_0xfc10('0x0'));var util=require(_0xfc10('0x1'));var logger=require('../../config/logger')(_0xfc10('0x2'));var moment=require(_0xfc10('0x3'));var BPromise=require(_0xfc10('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc10('0x5'));var rimraf=require('rimraf');var config=require(_0xfc10('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x1c5211,_0x3d3315){return _0x1c5211[_0xfc10('0x7')](_0xfc10('0x8'),attributes,{'tableName':_0xfc10('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5d4=['moment','bluebird','request-promise','path','../../config/environment','exports','define','SugarcrmConfiguration','lodash','util'];(function(_0xe4c712,_0x1e26d5){var _0x101962=function(_0x1bfc5a){while(--_0x1bfc5a){_0xe4c712['push'](_0xe4c712['shift']());}};_0x101962(++_0x1e26d5);}(_0xb5d4,0xa8));var _0x4b5d=function(_0x56fa87,_0x11b2fd){_0x56fa87=_0x56fa87-0x0;var _0x3930e3=_0xb5d4[_0x56fa87];return _0x3930e3;};'use strict';var _=require(_0x4b5d('0x0'));var util=require(_0x4b5d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4b5d('0x2'));var BPromise=require(_0x4b5d('0x3'));var rp=require(_0x4b5d('0x4'));var fs=require('fs');var path=require(_0x4b5d('0x5'));var rimraf=require('rimraf');var config=require(_0x4b5d('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x4b5d('0x7')]=function(_0x40a1f2,_0x268fd9){return _0x40a1f2[_0x4b5d('0x8')](_0x4b5d('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 64a3244..985e335 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 _0x209e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','request\x20sent','debug','stringify','code','error','message','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x4ba4f0,_0x24f5d5){var _0x44f544=function(_0x154132){while(--_0x154132){_0x4ba4f0['push'](_0x4ba4f0['shift']());}};_0x44f544(++_0x24f5d5);}(_0x209e,0x1d0));var _0xe209=function(_0x2edfe8,_0x7f92fc){_0x2edfe8=_0x2edfe8-0x0;var _0x4de55a=_0x209e[_0x2edfe8];return _0x4de55a;};'use strict';var _=require(_0xe209('0x0'));var util=require(_0xe209('0x1'));var moment=require(_0xe209('0x2'));var BPromise=require(_0xe209('0x3'));var rs=require(_0xe209('0x4'));var fs=require('fs');var Redis=require(_0xe209('0x5'));var db=require(_0xe209('0x6'))['db'];var utils=require(_0xe209('0x7'));var logger=require(_0xe209('0x8'))('rpc');var config=require(_0xe209('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe209('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x719c5a,_0x4c53dd,_0x178b56){return new BPromise(function(_0x1c269e,_0x1d3bce){return client[_0xe209('0xb')](_0x719c5a,_0x178b56)['then'](function(_0x30d9f0){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c53dd,_0xe209('0xc'));logger[_0xe209('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4c53dd,'request\x20sent',JSON[_0xe209('0xe')](_0x30d9f0));if(_0x30d9f0['error']){if(_0x30d9f0['error'][_0xe209('0xf')]===0x1f4){logger[_0xe209('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c53dd,_0x30d9f0[_0xe209('0x10')][_0xe209('0x11')]);return _0x1d3bce(_0x30d9f0[_0xe209('0x10')]['message']);}logger[_0xe209('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c53dd,_0x30d9f0['error'][_0xe209('0x11')]);return _0x1c269e(_0x30d9f0['error'][_0xe209('0x11')]);}else{logger[_0xe209('0x12')](_0xe209('0x13'),_0x4c53dd,_0xe209('0xc'));_0x1c269e(_0x30d9f0[_0xe209('0x14')][_0xe209('0x11')]);}})[_0xe209('0x15')](function(_0x19d4ea){logger[_0xe209('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c53dd,_0x19d4ea);_0x1d3bce(_0x19d4ea);});});} \ No newline at end of file +var _0xe2d7=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0xe2d7,0x89));var _0x7e2d=function(_0x5953b1,_0x55dd23){_0x5953b1=_0x5953b1-0x0;var _0x4883e0=_0xe2d7[_0x5953b1];return _0x4883e0;};'use strict';var _=require(_0x7e2d('0x0'));var util=require(_0x7e2d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7e2d('0x2'));var fs=require('fs');var Redis=require(_0x7e2d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e2d('0x4'));var logger=require(_0x7e2d('0x5'))('rpc');var config=require(_0x7e2d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7e2d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323fd6,_0x27a19d,_0xef712d){return new BPromise(function(_0x393f18,_0x1e5b99){return client[_0x7e2d('0x8')](_0x323fd6,_0xef712d)[_0x7e2d('0x9')](function(_0x178d63){logger[_0x7e2d('0xa')](_0x7e2d('0xb'),_0x27a19d,_0x7e2d('0xc'));logger[_0x7e2d('0xd')](_0x7e2d('0xe'),_0x27a19d,_0x7e2d('0xc'),JSON[_0x7e2d('0xf')](_0x178d63));if(_0x178d63['error']){if(_0x178d63['error'][_0x7e2d('0x10')]===0x1f4){logger[_0x7e2d('0x11')](_0x7e2d('0xb'),_0x27a19d,_0x178d63['error']['message']);return _0x1e5b99(_0x178d63['error'][_0x7e2d('0x12')]);}logger[_0x7e2d('0x11')](_0x7e2d('0xb'),_0x27a19d,_0x178d63['error'][_0x7e2d('0x12')]);return _0x393f18(_0x178d63['error']['message']);}else{logger[_0x7e2d('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x27a19d,_0x7e2d('0xc'));_0x393f18(_0x178d63[_0x7e2d('0x13')][_0x7e2d('0x12')]);}})[_0x7e2d('0x14')](function(_0x1f6e49){logger['error'](_0x7e2d('0xb'),_0x27a19d,_0x1f6e49);_0x1e5b99(_0x1f6e49);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 258f4cc..b1a8028 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 _0xca6b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','exports','util','path','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xca6b,0x18c));var _0xbca6=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xca6b[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require('multer');var util=require(_0xbca6('0x0'));var path=require(_0xbca6('0x1'));var timeout=require(_0xbca6('0x2'));var express=require(_0xbca6('0x3'));var router=express[_0xbca6('0x4')]();var fs_extra=require(_0xbca6('0x5'));var auth=require(_0xbca6('0x6'));var interaction=require(_0xbca6('0x7'));var config=require('../../config/environment');var controller=require(_0xbca6('0x8'));router[_0xbca6('0x9')]('/',auth[_0xbca6('0xa')](),controller[_0xbca6('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbca6('0xc')]);router[_0xbca6('0xd')]('/',auth[_0xbca6('0xa')](),controller['create']);router[_0xbca6('0xe')](_0xbca6('0xf'),auth['isAuthenticated'](),controller[_0xbca6('0x10')]);router[_0xbca6('0x11')](_0xbca6('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xbca6('0x12')]=router; \ No newline at end of file +var _0x9e7f=['show','post','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id'];(function(_0x39b89c,_0x3c4fe2){var _0x3c2794=function(_0x12a105){while(--_0x12a105){_0x39b89c['push'](_0x39b89c['shift']());}};_0x3c2794(++_0x3c4fe2);}(_0x9e7f,0xa8));var _0xf9e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e7f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf9e7('0x0'));var path=require(_0xf9e7('0x1'));var timeout=require(_0xf9e7('0x2'));var express=require('express');var router=express[_0xf9e7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf9e7('0x4'));var interaction=require(_0xf9e7('0x5'));var config=require(_0xf9e7('0x6'));var controller=require(_0xf9e7('0x7'));router[_0xf9e7('0x8')]('/',auth[_0xf9e7('0x9')](),controller[_0xf9e7('0xa')]);router[_0xf9e7('0x8')](_0xf9e7('0xb'),auth[_0xf9e7('0x9')](),controller[_0xf9e7('0xc')]);router[_0xf9e7('0xd')]('/',auth[_0xf9e7('0x9')](),controller['create']);router[_0xf9e7('0xe')]('/:id',auth[_0xf9e7('0x9')](),controller['update']);router[_0xf9e7('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf9e7('0x10')]);module[_0xf9e7('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 6a3ae02..1c6ef16 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 _0xf659=['BOOLEAN','sequelize','exports','customVariable','keyValue','picklist','STRING','ENUM','string','variable'];(function(_0x108122,_0x56abc4){var _0x2ad479=function(_0x2d05ba){while(--_0x2d05ba){_0x108122['push'](_0x108122['shift']());}};_0x2ad479(++_0x56abc4);}(_0xf659,0xa1));var _0x9f65=function(_0x1bbc82,_0xe5f9e1){_0x1bbc82=_0x1bbc82-0x0;var _0xa4e7d2=_0xf659[_0x1bbc82];return _0xa4e7d2;};'use strict';var Sequelize=require(_0x9f65('0x0'));module[_0x9f65('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x9f65('0x2'),_0x9f65('0x3'),_0x9f65('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9f65('0x5')]},'key':{'type':Sequelize[_0x9f65('0x5')]},'keyType':{'type':Sequelize[_0x9f65('0x6')](_0x9f65('0x7'),_0x9f65('0x8'),_0x9f65('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9f65('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9f65('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9f65('0x5')]}}; \ No newline at end of file +var _0xea2b=['ENUM','BOOLEAN','sequelize','string','customVariable','STRING'];(function(_0x835410,_0x7fe487){var _0x4f4e27=function(_0x517195){while(--_0x517195){_0x835410['push'](_0x835410['shift']());}};_0x4f4e27(++_0x7fe487);}(_0xea2b,0x14c));var _0xbea2=function(_0x24e35e,_0x19d372){_0x24e35e=_0x24e35e-0x0;var _0x482af5=_0xea2b[_0x24e35e];return _0x482af5;};'use strict';var Sequelize=require(_0xbea2('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xbea2('0x1'),'variable',_0xbea2('0x2'),'keyValue','picklist'),'defaultValue':_0xbea2('0x1')},'content':{'type':Sequelize[_0xbea2('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbea2('0x4')](_0xbea2('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xbea2('0x3')]},'idField':{'type':Sequelize[_0xbea2('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbea2('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 417c894..93857c4 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 _0x2f13=['order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','SugarcrmField','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','status','end','limit','undefined','count','offset','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x3c9fcf,_0x4f639f){var _0x26d6a5=function(_0x352d4c){while(--_0x352d4c){_0x3c9fcf['push'](_0x3c9fcf['shift']());}};_0x26d6a5(++_0x4f639f);}(_0x2f13,0xee));var _0x32f1=function(_0x244cef,_0x32c413){_0x244cef=_0x244cef-0x0;var _0x304d32=_0x2f13[_0x244cef];return _0x304d32;};'use strict';var emlformat=require(_0x32f1('0x0'));var rimraf=require(_0x32f1('0x1'));var zipdir=require(_0x32f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32f1('0x3'));var moment=require(_0x32f1('0x4'));var BPromise=require(_0x32f1('0x5'));var Mustache=require(_0x32f1('0x6'));var util=require(_0x32f1('0x7'));var path=require('path');var sox=require(_0x32f1('0x8'));var csv=require(_0x32f1('0x9'));var ejs=require(_0x32f1('0xa'));var fs=require('fs');var fs_extra=require(_0x32f1('0xb'));var _=require(_0x32f1('0xc'));var squel=require(_0x32f1('0xd'));var crypto=require('crypto');var jsforce=require(_0x32f1('0xe'));var deskjs=require(_0x32f1('0xf'));var toCsv=require(_0x32f1('0x9'));var querystring=require(_0x32f1('0x10'));var Papa=require('papaparse');var Redis=require(_0x32f1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x32f1('0x12'));var as=require(_0x32f1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x32f1('0x14'));var utils=require('../../config/utils');var config=require(_0x32f1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b9d85,_0x1279ca){_0x1279ca=_0x1279ca||0xcc;return function(_0x8e3362){if(_0x8e3362){return _0x2b9d85['sendStatus'](_0x1279ca);}return _0x2b9d85[_0x32f1('0x16')](_0x1279ca)[_0x32f1('0x17')]();};}function respondWithResult(_0x35bbee,_0x39f6e1){_0x39f6e1=_0x39f6e1||0xc8;return function(_0x3ac758){if(_0x3ac758){return _0x35bbee[_0x32f1('0x16')](_0x39f6e1)['json'](_0x3ac758);}};}function respondWithFilteredResult(_0x3ece00,_0x30552d){return function(_0x439548){if(_0x439548){var _0x1fa32e=typeof _0x30552d['offset']==='undefined'&&typeof _0x30552d[_0x32f1('0x18')]===_0x32f1('0x19');var _0x10e0aa=_0x439548[_0x32f1('0x1a')];var _0x58bdc2=_0x1fa32e?0x0:_0x30552d[_0x32f1('0x1b')];var _0x44c224=_0x1fa32e?_0x439548[_0x32f1('0x1a')]:_0x30552d[_0x32f1('0x1b')]+_0x30552d[_0x32f1('0x18')];var _0x2b6864;if(_0x44c224>=_0x10e0aa){_0x44c224=_0x10e0aa;_0x2b6864=0xc8;}else{_0x2b6864=0xce;}_0x3ece00['status'](_0x2b6864);return _0x3ece00[_0x32f1('0x1c')]('Content-Range',_0x58bdc2+'-'+_0x44c224+'/'+_0x10e0aa)['json'](_0x439548);}return null;};}function patchUpdates(_0x37841){return function(_0x4ddf57){try{jsonpatch[_0x32f1('0x1d')](_0x4ddf57,_0x37841,!![]);}catch(_0x41a83b){return BPromise[_0x32f1('0x1e')](_0x41a83b);}return _0x4ddf57[_0x32f1('0x1f')]();};}function saveUpdates(_0x3c48dc,_0x10bca5){return function(_0x417aab){if(_0x417aab){return _0x417aab[_0x32f1('0x20')](_0x3c48dc)['then'](function(_0x1f9dae){return _0x1f9dae;});}return null;};}function removeEntity(_0x432097,_0x3218a8){return function(_0x50c89d){if(_0x50c89d){return _0x50c89d[_0x32f1('0x21')]()[_0x32f1('0x22')](function(){_0x432097[_0x32f1('0x16')](0xcc)[_0x32f1('0x17')]();});}};}function handleEntityNotFound(_0x30ef76,_0x1c496c){return function(_0x57eaf4){if(!_0x57eaf4){_0x30ef76[_0x32f1('0x23')](0x194);}return _0x57eaf4;};}function handleError(_0x48c57e,_0x4afbdf){_0x4afbdf=_0x4afbdf||0x1f4;return function(_0x1ad822){logger[_0x32f1('0x24')](_0x1ad822[_0x32f1('0x25')]);if(_0x1ad822[_0x32f1('0x26')]){delete _0x1ad822[_0x32f1('0x26')];}_0x48c57e['status'](_0x4afbdf)[_0x32f1('0x27')](_0x1ad822);};}exports[_0x32f1('0x28')]=function(_0x738a4e,_0x19b5e4){var _0x1dda73={},_0x532f81={},_0x465e90={'count':0x0,'rows':[]};var _0x1fe88e=_[_0x32f1('0x29')](db['SugarcrmField']['rawAttributes'],function(_0x4818ba){return{'name':_0x4818ba[_0x32f1('0x2a')],'type':_0x4818ba[_0x32f1('0x2b')]['key']};});_0x532f81[_0x32f1('0x2c')]=_[_0x32f1('0x29')](_0x1fe88e,_0x32f1('0x26'));_0x532f81[_0x32f1('0x2d')]=_[_0x32f1('0x2e')](_0x738a4e[_0x32f1('0x2d')]);_0x532f81[_0x32f1('0x2f')]=_[_0x32f1('0x30')](_0x532f81[_0x32f1('0x2c')],_0x532f81[_0x32f1('0x2d')]);_0x1dda73['attributes']=_[_0x32f1('0x30')](_0x532f81[_0x32f1('0x2c')],qs[_0x32f1('0x31')](_0x738a4e[_0x32f1('0x2d')]['fields']));_0x1dda73[_0x32f1('0x32')]=_0x1dda73['attributes'][_0x32f1('0x33')]?_0x1dda73[_0x32f1('0x32')]:_0x532f81[_0x32f1('0x2c')];if(!_0x738a4e[_0x32f1('0x2d')][_0x32f1('0x34')](_0x32f1('0x35'))){_0x1dda73[_0x32f1('0x18')]=qs[_0x32f1('0x18')](_0x738a4e[_0x32f1('0x2d')][_0x32f1('0x18')]);_0x1dda73[_0x32f1('0x1b')]=qs['offset'](_0x738a4e['query'][_0x32f1('0x1b')]);}_0x1dda73[_0x32f1('0x36')]=qs[_0x32f1('0x37')](_0x738a4e[_0x32f1('0x2d')][_0x32f1('0x37')]);_0x1dda73[_0x32f1('0x38')]=qs[_0x32f1('0x2f')](_[_0x32f1('0x39')](_0x738a4e[_0x32f1('0x2d')],_0x532f81[_0x32f1('0x2f')]),_0x1fe88e);if(_0x738a4e[_0x32f1('0x2d')]['filter']){_0x1dda73[_0x32f1('0x38')]=_[_0x32f1('0x3a')](_0x1dda73[_0x32f1('0x38')],{'$or':_[_0x32f1('0x29')](_0x1fe88e,function(_0x5470c1){if(_0x5470c1[_0x32f1('0x2b')]!==_0x32f1('0x3b')){var _0x5b4cfb={};_0x5b4cfb[_0x5470c1[_0x32f1('0x26')]]={'$like':'%'+_0x738a4e[_0x32f1('0x2d')][_0x32f1('0x3c')]+'%'};return _0x5b4cfb;}})});}_0x1dda73=_['merge']({},_0x1dda73,_0x738a4e[_0x32f1('0x3d')]);var _0x251677={'where':_0x1dda73[_0x32f1('0x38')]};return db['SugarcrmField'][_0x32f1('0x1a')](_0x251677)[_0x32f1('0x22')](function(_0x2d2c7c){_0x465e90['count']=_0x2d2c7c;if(_0x738a4e['query'][_0x32f1('0x3e')]){_0x1dda73[_0x32f1('0x3f')]=[{'all':!![]}];}return db[_0x32f1('0x40')][_0x32f1('0x41')](_0x1dda73);})[_0x32f1('0x22')](function(_0x2fbba2){_0x465e90[_0x32f1('0x42')]=_0x2fbba2;return _0x465e90;})[_0x32f1('0x22')](respondWithFilteredResult(_0x19b5e4,_0x1dda73))[_0x32f1('0x43')](handleError(_0x19b5e4,null));};exports[_0x32f1('0x44')]=function(_0x573128,_0x1619ca){var _0xcc5fbe={'raw':!![],'where':{'id':_0x573128[_0x32f1('0x45')]['id']}},_0x573877={};_0x573877[_0x32f1('0x2c')]=_[_0x32f1('0x2e')](db[_0x32f1('0x40')]['rawAttributes']);_0x573877[_0x32f1('0x2d')]=_['keys'](_0x573128[_0x32f1('0x2d')]);_0x573877[_0x32f1('0x2f')]=_['intersection'](_0x573877['model'],_0x573877[_0x32f1('0x2d')]);_0xcc5fbe[_0x32f1('0x32')]=_[_0x32f1('0x30')](_0x573877['model'],qs[_0x32f1('0x31')](_0x573128[_0x32f1('0x2d')]['fields']));_0xcc5fbe[_0x32f1('0x32')]=_0xcc5fbe[_0x32f1('0x32')][_0x32f1('0x33')]?_0xcc5fbe[_0x32f1('0x32')]:_0x573877[_0x32f1('0x2c')];if(_0x573128[_0x32f1('0x2d')][_0x32f1('0x3e')]){_0xcc5fbe[_0x32f1('0x3f')]=[{'all':!![]}];}_0xcc5fbe=_[_0x32f1('0x3a')]({},_0xcc5fbe,_0x573128[_0x32f1('0x3d')]);return db[_0x32f1('0x40')][_0x32f1('0x46')](_0xcc5fbe)['then'](handleEntityNotFound(_0x1619ca,null))['then'](respondWithResult(_0x1619ca,null))[_0x32f1('0x43')](handleError(_0x1619ca,null));};exports[_0x32f1('0x47')]=function(_0x28fa47,_0xdd0cb7){return db[_0x32f1('0x40')][_0x32f1('0x47')](_0x28fa47[_0x32f1('0x48')],{})[_0x32f1('0x22')](respondWithResult(_0xdd0cb7,0xc9))[_0x32f1('0x43')](handleError(_0xdd0cb7,null));};exports['update']=function(_0x3e83fa,_0x276b7f){if(_0x3e83fa[_0x32f1('0x48')]['id']){delete _0x3e83fa[_0x32f1('0x48')]['id'];}return db['SugarcrmField'][_0x32f1('0x46')]({'where':{'id':_0x3e83fa[_0x32f1('0x45')]['id']}})[_0x32f1('0x22')](handleEntityNotFound(_0x276b7f,null))[_0x32f1('0x22')](saveUpdates(_0x3e83fa[_0x32f1('0x48')],null))[_0x32f1('0x22')](respondWithResult(_0x276b7f,null))[_0x32f1('0x43')](handleError(_0x276b7f,null));};exports['destroy']=function(_0x4787bf,_0x4cd8db){return db[_0x32f1('0x40')]['find']({'where':{'id':_0x4787bf[_0x32f1('0x45')]['id']}})[_0x32f1('0x22')](handleEntityNotFound(_0x4cd8db,null))[_0x32f1('0x22')](removeEntity(_0x4cd8db,null))['catch'](handleError(_0x4cd8db,null));}; \ No newline at end of file +var _0x3951=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x211f32,_0x4dec64){var _0xc5ecef=function(_0x3ba851){while(--_0x3ba851){_0x211f32['push'](_0x211f32['shift']());}};_0xc5ecef(++_0x4dec64);}(_0x3951,0x64));var _0x1395=function(_0x524587,_0x3c7efd){_0x524587=_0x524587-0x0;var _0x2af738=_0x3951[_0x524587];return _0x2af738;};'use strict';var emlformat=require(_0x1395('0x0'));var rimraf=require(_0x1395('0x1'));var zipdir=require(_0x1395('0x2'));var jsonpatch=require(_0x1395('0x3'));var rp=require('request-promise');var moment=require(_0x1395('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1395('0x5'));var util=require(_0x1395('0x6'));var path=require(_0x1395('0x7'));var sox=require('sox');var csv=require(_0x1395('0x8'));var ejs=require(_0x1395('0x9'));var fs=require('fs');var fs_extra=require(_0x1395('0xa'));var _=require(_0x1395('0xb'));var squel=require(_0x1395('0xc'));var crypto=require(_0x1395('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1395('0xe'));var toCsv=require(_0x1395('0x8'));var querystring=require(_0x1395('0xf'));var Papa=require(_0x1395('0x10'));var Redis=require('ioredis');var authService=require(_0x1395('0x11'));var qs=require(_0x1395('0x12'));var as=require(_0x1395('0x13'));var hardwareService=require(_0x1395('0x14'));var logger=require(_0x1395('0x15'))(_0x1395('0x16'));var utils=require(_0x1395('0x17'));var config=require(_0x1395('0x18'));var licenseUtil=require(_0x1395('0x19'));var db=require(_0x1395('0x1a'))['db'];function respondWithStatusCode(_0x3deec0,_0x2de429){_0x2de429=_0x2de429||0xcc;return function(_0x4f131b){if(_0x4f131b){return _0x3deec0['sendStatus'](_0x2de429);}return _0x3deec0[_0x1395('0x1b')](_0x2de429)[_0x1395('0x1c')]();};}function respondWithResult(_0x17294e,_0x53fdcd){_0x53fdcd=_0x53fdcd||0xc8;return function(_0x2a6473){if(_0x2a6473){return _0x17294e['status'](_0x53fdcd)['json'](_0x2a6473);}};}function respondWithFilteredResult(_0x16c8b1,_0x1dfc4c){return function(_0x296d24){if(_0x296d24){var _0x56b46d=typeof _0x1dfc4c[_0x1395('0x1d')]===_0x1395('0x1e')&&typeof _0x1dfc4c['limit']===_0x1395('0x1e');var _0x874ff3=_0x296d24[_0x1395('0x1f')];var _0xff6337=_0x56b46d?0x0:_0x1dfc4c[_0x1395('0x1d')];var _0x2e67b1=_0x56b46d?_0x296d24[_0x1395('0x1f')]:_0x1dfc4c[_0x1395('0x1d')]+_0x1dfc4c[_0x1395('0x20')];var _0x1bd20c;if(_0x2e67b1>=_0x874ff3){_0x2e67b1=_0x874ff3;_0x1bd20c=0xc8;}else{_0x1bd20c=0xce;}_0x16c8b1['status'](_0x1bd20c);return _0x16c8b1[_0x1395('0x21')]('Content-Range',_0xff6337+'-'+_0x2e67b1+'/'+_0x874ff3)[_0x1395('0x22')](_0x296d24);}return null;};}function patchUpdates(_0xa99e8f){return function(_0x42f82e){try{jsonpatch[_0x1395('0x23')](_0x42f82e,_0xa99e8f,!![]);}catch(_0x2b724a){return BPromise[_0x1395('0x24')](_0x2b724a);}return _0x42f82e['save']();};}function saveUpdates(_0x3a9cf2,_0x5f0749){return function(_0x2c2e67){if(_0x2c2e67){return _0x2c2e67[_0x1395('0x25')](_0x3a9cf2)[_0x1395('0x26')](function(_0x50ba4f){return _0x50ba4f;});}return null;};}function removeEntity(_0x4f3433,_0x4b82a2){return function(_0x304cfb){if(_0x304cfb){return _0x304cfb['destroy']()[_0x1395('0x26')](function(){_0x4f3433[_0x1395('0x1b')](0xcc)[_0x1395('0x1c')]();});}};}function handleEntityNotFound(_0xbb9eea,_0xb72c45){return function(_0x26e60e){if(!_0x26e60e){_0xbb9eea[_0x1395('0x27')](0x194);}return _0x26e60e;};}function handleError(_0x494e36,_0x4fd630){_0x4fd630=_0x4fd630||0x1f4;return function(_0x3331a0){logger[_0x1395('0x28')](_0x3331a0[_0x1395('0x29')]);if(_0x3331a0[_0x1395('0x2a')]){delete _0x3331a0[_0x1395('0x2a')];}_0x494e36[_0x1395('0x1b')](_0x4fd630)[_0x1395('0x2b')](_0x3331a0);};}exports[_0x1395('0x2c')]=function(_0x1291ca,_0x58a908){var _0x49518b={},_0x4e7bf4={},_0x1ce41c={'count':0x0,'rows':[]};var _0xfedd1d=_[_0x1395('0x2d')](db[_0x1395('0x2e')]['rawAttributes'],function(_0x10cdd5){return{'name':_0x10cdd5[_0x1395('0x2f')],'type':_0x10cdd5[_0x1395('0x30')][_0x1395('0x31')]};});_0x4e7bf4[_0x1395('0x32')]=_[_0x1395('0x2d')](_0xfedd1d,_0x1395('0x2a'));_0x4e7bf4[_0x1395('0x33')]=_[_0x1395('0x34')](_0x1291ca['query']);_0x4e7bf4['filters']=_[_0x1395('0x35')](_0x4e7bf4[_0x1395('0x32')],_0x4e7bf4[_0x1395('0x33')]);_0x49518b[_0x1395('0x36')]=_[_0x1395('0x35')](_0x4e7bf4[_0x1395('0x32')],qs[_0x1395('0x37')](_0x1291ca[_0x1395('0x33')][_0x1395('0x37')]));_0x49518b[_0x1395('0x36')]=_0x49518b[_0x1395('0x36')][_0x1395('0x38')]?_0x49518b[_0x1395('0x36')]:_0x4e7bf4[_0x1395('0x32')];if(!_0x1291ca['query'][_0x1395('0x39')](_0x1395('0x3a'))){_0x49518b[_0x1395('0x20')]=qs[_0x1395('0x20')](_0x1291ca['query'][_0x1395('0x20')]);_0x49518b[_0x1395('0x1d')]=qs[_0x1395('0x1d')](_0x1291ca[_0x1395('0x33')][_0x1395('0x1d')]);}_0x49518b[_0x1395('0x3b')]=qs[_0x1395('0x3c')](_0x1291ca[_0x1395('0x33')][_0x1395('0x3c')]);_0x49518b[_0x1395('0x3d')]=qs[_0x1395('0x3e')](_[_0x1395('0x3f')](_0x1291ca[_0x1395('0x33')],_0x4e7bf4[_0x1395('0x3e')]),_0xfedd1d);if(_0x1291ca['query']['filter']){_0x49518b[_0x1395('0x3d')]=_[_0x1395('0x40')](_0x49518b[_0x1395('0x3d')],{'$or':_[_0x1395('0x2d')](_0xfedd1d,function(_0x327d6b){if(_0x327d6b['type']!==_0x1395('0x41')){var _0x458ef5={};_0x458ef5[_0x327d6b[_0x1395('0x2a')]]={'$like':'%'+_0x1291ca[_0x1395('0x33')][_0x1395('0x42')]+'%'};return _0x458ef5;}})});}_0x49518b=_[_0x1395('0x40')]({},_0x49518b,_0x1291ca[_0x1395('0x43')]);var _0x56c9b5={'where':_0x49518b[_0x1395('0x3d')]};return db[_0x1395('0x2e')][_0x1395('0x1f')](_0x56c9b5)['then'](function(_0x5e60ed){_0x1ce41c['count']=_0x5e60ed;if(_0x1291ca[_0x1395('0x33')][_0x1395('0x44')]){_0x49518b[_0x1395('0x45')]=[{'all':!![]}];}return db[_0x1395('0x2e')]['findAll'](_0x49518b);})['then'](function(_0x90a124){_0x1ce41c[_0x1395('0x46')]=_0x90a124;return _0x1ce41c;})[_0x1395('0x26')](respondWithFilteredResult(_0x58a908,_0x49518b))[_0x1395('0x47')](handleError(_0x58a908,null));};exports[_0x1395('0x48')]=function(_0x544155,_0x401e53){var _0x96ff49={'raw':!![],'where':{'id':_0x544155[_0x1395('0x49')]['id']}},_0x1d159e={};_0x1d159e['model']=_[_0x1395('0x34')](db[_0x1395('0x2e')][_0x1395('0x4a')]);_0x1d159e[_0x1395('0x33')]=_[_0x1395('0x34')](_0x544155[_0x1395('0x33')]);_0x1d159e[_0x1395('0x3e')]=_[_0x1395('0x35')](_0x1d159e['model'],_0x1d159e[_0x1395('0x33')]);_0x96ff49[_0x1395('0x36')]=_[_0x1395('0x35')](_0x1d159e[_0x1395('0x32')],qs[_0x1395('0x37')](_0x544155[_0x1395('0x33')][_0x1395('0x37')]));_0x96ff49[_0x1395('0x36')]=_0x96ff49[_0x1395('0x36')]['length']?_0x96ff49['attributes']:_0x1d159e[_0x1395('0x32')];if(_0x544155[_0x1395('0x33')][_0x1395('0x44')]){_0x96ff49[_0x1395('0x45')]=[{'all':!![]}];}_0x96ff49=_[_0x1395('0x40')]({},_0x96ff49,_0x544155[_0x1395('0x43')]);return db[_0x1395('0x2e')]['find'](_0x96ff49)[_0x1395('0x26')](handleEntityNotFound(_0x401e53,null))['then'](respondWithResult(_0x401e53,null))[_0x1395('0x47')](handleError(_0x401e53,null));};exports['create']=function(_0x386cce,_0x491e1f){return db['SugarcrmField']['create'](_0x386cce[_0x1395('0x4b')],{})[_0x1395('0x26')](respondWithResult(_0x491e1f,0xc9))[_0x1395('0x47')](handleError(_0x491e1f,null));};exports[_0x1395('0x25')]=function(_0x2b28f6,_0x119f20){if(_0x2b28f6[_0x1395('0x4b')]['id']){delete _0x2b28f6[_0x1395('0x4b')]['id'];}return db['SugarcrmField'][_0x1395('0x4c')]({'where':{'id':_0x2b28f6['params']['id']}})[_0x1395('0x26')](handleEntityNotFound(_0x119f20,null))[_0x1395('0x26')](saveUpdates(_0x2b28f6[_0x1395('0x4b')],null))['then'](respondWithResult(_0x119f20,null))[_0x1395('0x47')](handleError(_0x119f20,null));};exports[_0x1395('0x4d')]=function(_0x196c57,_0x50c2b0){return db[_0x1395('0x2e')][_0x1395('0x4c')]({'where':{'id':_0x196c57[_0x1395('0x49')]['id']}})[_0x1395('0x26')](handleEntityNotFound(_0x50c2b0,null))[_0x1395('0x26')](removeEntity(_0x50c2b0,null))[_0x1395('0x47')](handleError(_0x50c2b0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 46d61bd..c47c2ba 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 _0xb07d=['request-promise','path','rimraf','exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','util','../../config/logger','api'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xb07d,0x165));var _0xdb07=function(_0x1d950b,_0x51a309){_0x1d950b=_0x1d950b-0x0;var _0x4f9169=_0xb07d[_0x1d950b];return _0x4f9169;};'use strict';var _=require('lodash');var util=require(_0xdb07('0x0'));var logger=require(_0xdb07('0x1'))(_0xdb07('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdb07('0x3'));var fs=require('fs');var path=require(_0xdb07('0x4'));var rimraf=require(_0xdb07('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0xdb07('0x6')]=function(_0x59717c,_0x5468fb){return _0x59717c[_0xdb07('0x7')](_0xdb07('0x8'),attributes,{'tableName':_0xdb07('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xdb07('0xa'),_0xdb07('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf4c9=['int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','SugarcrmField'];(function(_0x426983,_0x5351b8){var _0x58c2f4=function(_0x2a10db){while(--_0x2a10db){_0x426983['push'](_0x426983['shift']());}};_0x58c2f4(++_0x5351b8);}(_0xf4c9,0x92));var _0x9f4c=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xf4c9[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x9f4c('0x0'));var util=require('util');var logger=require(_0x9f4c('0x1'))(_0x9f4c('0x2'));var moment=require(_0x9f4c('0x3'));var BPromise=require(_0x9f4c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f4c('0x5'));var config=require(_0x9f4c('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x9f4c('0x7')]=function(_0x5c2e1b,_0x59ede0){return _0x5c2e1b[_0x9f4c('0x8')](_0x9f4c('0x9'),attributes,{'tableName':_0x9f4c('0xa'),'paranoid':![],'indexes':[{'name':_0x9f4c('0xb'),'fields':[_0x9f4c('0xc'),'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 3537df6..cfa932a 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 _0xae3a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird'];(function(_0x29e17f,_0x400f03){var _0x25da87=function(_0x3331f3){while(--_0x3331f3){_0x29e17f['push'](_0x29e17f['shift']());}};_0x25da87(++_0x400f03);}(_0xae3a,0x18b));var _0xaae3=function(_0x4cbde1,_0x5785ec){_0x4cbde1=_0x4cbde1-0x0;var _0x37d42=_0xae3a[_0x4cbde1];return _0x37d42;};'use strict';var _=require(_0xaae3('0x0'));var util=require(_0xaae3('0x1'));var moment=require(_0xaae3('0x2'));var BPromise=require(_0xaae3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaae3('0x4'));var db=require(_0xaae3('0x5'))['db'];var utils=require(_0xaae3('0x6'));var logger=require(_0xaae3('0x7'))(_0xaae3('0x8'));var config=require(_0xaae3('0x9'));var jayson=require(_0xaae3('0xa'));var client=jayson[_0xaae3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x194eea,_0x3d0362,_0x2dd439){return new BPromise(function(_0x2a6d37,_0x511bd6){return client[_0xaae3('0xc')](_0x194eea,_0x2dd439)['then'](function(_0x9b5772){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x3d0362,_0xaae3('0xd'));logger[_0xaae3('0xe')](_0xaae3('0xf'),_0x3d0362,_0xaae3('0xd'),JSON['stringify'](_0x9b5772));if(_0x9b5772[_0xaae3('0x10')]){if(_0x9b5772[_0xaae3('0x10')][_0xaae3('0x11')]===0x1f4){logger[_0xaae3('0x10')](_0xaae3('0x12'),_0x3d0362,_0x9b5772[_0xaae3('0x10')][_0xaae3('0x13')]);return _0x511bd6(_0x9b5772[_0xaae3('0x10')][_0xaae3('0x13')]);}logger[_0xaae3('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x3d0362,_0x9b5772['error'][_0xaae3('0x13')]);return _0x2a6d37(_0x9b5772[_0xaae3('0x10')][_0xaae3('0x13')]);}else{logger[_0xaae3('0x14')](_0xaae3('0x12'),_0x3d0362,_0xaae3('0xd'));_0x2a6d37(_0x9b5772['result']['message']);}})['catch'](function(_0x57b44a){logger['error'](_0xaae3('0x12'),_0x3d0362,_0x57b44a);_0x511bd6(_0x57b44a);});});} \ No newline at end of file +var _0xe41b=['client','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x177644,_0x9ff3eb){var _0x398135=function(_0x4a9f06){while(--_0x4a9f06){_0x177644['push'](_0x177644['shift']());}};_0x398135(++_0x9ff3eb);}(_0xe41b,0xf4));var _0xbe41=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0xe41b[_0x26d6d9];return _0x1b4875;};'use strict';var _=require('lodash');var util=require(_0xbe41('0x0'));var moment=require(_0xbe41('0x1'));var BPromise=require(_0xbe41('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe41('0x3'))['db'];var utils=require(_0xbe41('0x4'));var logger=require(_0xbe41('0x5'))(_0xbe41('0x6'));var config=require(_0xbe41('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbe41('0x8')][_0xbe41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bfec0,_0x141bb3,_0x505bbd){return new BPromise(function(_0x30e932,_0x4143a9){return client[_0xbe41('0xa')](_0x4bfec0,_0x505bbd)[_0xbe41('0xb')](function(_0x111e67){logger['info'](_0xbe41('0xc'),_0x141bb3,_0xbe41('0xd'));logger[_0xbe41('0xe')](_0xbe41('0xf'),_0x141bb3,_0xbe41('0xd'),JSON[_0xbe41('0x10')](_0x111e67));if(_0x111e67[_0xbe41('0x11')]){if(_0x111e67[_0xbe41('0x11')][_0xbe41('0x12')]===0x1f4){logger[_0xbe41('0x11')](_0xbe41('0xc'),_0x141bb3,_0x111e67['error']['message']);return _0x4143a9(_0x111e67[_0xbe41('0x11')][_0xbe41('0x13')]);}logger[_0xbe41('0x11')](_0xbe41('0xc'),_0x141bb3,_0x111e67[_0xbe41('0x11')][_0xbe41('0x13')]);return _0x30e932(_0x111e67[_0xbe41('0x11')][_0xbe41('0x13')]);}else{logger[_0xbe41('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x141bb3,_0xbe41('0xd'));_0x30e932(_0x111e67['result'][_0xbe41('0x13')]);}})['catch'](function(_0x2fb3a9){logger[_0xbe41('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x141bb3,_0x2fb3a9);_0x4143a9(_0x2fb3a9);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 4d33094..2352607 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 _0x0b8f=['/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x0b8f,0x174));var _0xf0b8=function(_0x4122ba,_0x4d6f24){_0x4122ba=_0x4122ba-0x0;var _0x3d6980=_0x0b8f[_0x4122ba];return _0x3d6980;};'use strict';var multer=require(_0xf0b8('0x0'));var util=require('util');var path=require(_0xf0b8('0x1'));var timeout=require(_0xf0b8('0x2'));var express=require(_0xf0b8('0x3'));var router=express[_0xf0b8('0x4')]();var fs_extra=require(_0xf0b8('0x5'));var auth=require(_0xf0b8('0x6'));var interaction=require(_0xf0b8('0x7'));var config=require(_0xf0b8('0x8'));var controller=require(_0xf0b8('0x9'));router[_0xf0b8('0xa')]('/',auth[_0xf0b8('0xb')](),controller['index']);router[_0xf0b8('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0xf0b8('0xb')](),controller[_0xf0b8('0xc')]);router[_0xf0b8('0xa')]('/:id/fields',auth[_0xf0b8('0xb')](),controller[_0xf0b8('0xd')]);router[_0xf0b8('0xe')]('/',auth['isAuthenticated'](),controller[_0xf0b8('0xf')]);router['post'](_0xf0b8('0x10'),auth[_0xf0b8('0xb')](),controller[_0xf0b8('0x11')]);router[_0xf0b8('0x12')](_0xf0b8('0x13'),auth['isAuthenticated'](),controller[_0xf0b8('0x14')]);router['delete'](_0xf0b8('0x13'),auth[_0xf0b8('0xb')](),controller[_0xf0b8('0x15')]);module[_0xf0b8('0x16')]=router; \ No newline at end of file +var _0xf873=['/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x578732,_0x5ef056){var _0x158884=function(_0x357957){while(--_0x357957){_0x578732['push'](_0x578732['shift']());}};_0x158884(++_0x5ef056);}(_0xf873,0xb2));var _0x3f87=function(_0x5aa9b3,_0x57d393){_0x5aa9b3=_0x5aa9b3-0x0;var _0x450ab3=_0xf873[_0x5aa9b3];return _0x450ab3;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0x9')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller['getConfigurations']);router[_0x3f87('0x9')](_0x3f87('0xf'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);router[_0x3f87('0x11')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x13')]);router[_0x3f87('0x14')](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller['update']);router[_0x3f87('0x15')](_0x3f87('0xc'),auth['isAuthenticated'](),controller[_0x3f87('0x16')]);module[_0x3f87('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f7fe641..7613559 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 _0xde67=['STRING','HelpDesk','sequelize','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xde67,0xd6));var _0x7de6=function(_0x22b70f,_0x4c853f){_0x22b70f=_0x22b70f-0x0;var _0x100985=_0xde67[_0x22b70f];return _0x100985;};'use strict';var Sequelize=require(_0x7de6('0x0'));module[_0x7de6('0x1')]={'name':{'type':Sequelize[_0x7de6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7de6('0x2')]},'username':{'type':Sequelize[_0x7de6('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7de6('0x3')},'remoteUri':{'type':Sequelize[_0x7de6('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x7de6('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5a47=['STRING','HelpDesk','sequelize'];(function(_0x4785cc,_0x210fa1){var _0x568e6c=function(_0x16cf02){while(--_0x16cf02){_0x4785cc['push'](_0x4785cc['shift']());}};_0x568e6c(++_0x210fa1);}(_0x5a47,0x1d3));var _0x75a4=function(_0x23a37c,_0x4399b4){_0x23a37c=_0x23a37c-0x0;var _0x400f6a=_0x5a47[_0x23a37c];return _0x400f6a;};'use strict';var Sequelize=require(_0x75a4('0x0'));module['exports']={'name':{'type':Sequelize[_0x75a4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x75a4('0x1')]},'username':{'type':Sequelize[_0x75a4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x75a4('0x2')},'remoteUri':{'type':Sequelize[_0x75a4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 816ba03..19a5550 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 _0x16b9=['where','merge','VIRTUAL','options','VtigerAccount','findAll','rows','catch','intersection','fields','find','create','body','params','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','AccountId','Descriptions','getDescriptions','channel','VtigerField','Subjects','username','description','remoteUri','serverUrl','accessKey','moduleName','substring','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','reference','remove','includes','editable','startsWith','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','statusCode','getFields','stringify','send','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','nolimit','order','sort','filter'];(function(_0x56bd49,_0x4c54a8){var _0x40d52e=function(_0x607222){while(--_0x607222){_0x56bd49['push'](_0x56bd49['shift']());}};_0x40d52e(++_0x4c54a8);}(_0x16b9,0x182));var _0x916b=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x16b9[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x916b('0x0'));var jsonpatch=require(_0x916b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x916b('0x2'));var Mustache=require(_0x916b('0x3'));var util=require('util');var path=require(_0x916b('0x4'));var sox=require(_0x916b('0x5'));var csv=require(_0x916b('0x6'));var ejs=require(_0x916b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x916b('0x8'));var crypto=require(_0x916b('0x9'));var jsforce=require(_0x916b('0xa'));var deskjs=require(_0x916b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x916b('0xc'));var Redis=require(_0x916b('0xd'));var authService=require(_0x916b('0xe'));var qs=require(_0x916b('0xf'));var as=require(_0x916b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x916b('0x11'));var utils=require(_0x916b('0x12'));var config=require(_0x916b('0x13'));var licenseUtil=require(_0x916b('0x14'));var db=require(_0x916b('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x35f36b,_0x5d849d){_0x5d849d=_0x5d849d||0xcc;return function(_0x1d70bb){if(_0x1d70bb){return _0x35f36b[_0x916b('0x16')](_0x5d849d);}return _0x35f36b['status'](_0x5d849d)[_0x916b('0x17')]();};}function respondWithResult(_0x1358d6,_0xff2e3f){_0xff2e3f=_0xff2e3f||0xc8;return function(_0x3085ea){if(_0x3085ea){return _0x1358d6[_0x916b('0x18')](_0xff2e3f)[_0x916b('0x19')](_0x3085ea);}};}function respondWithFilteredResult(_0x29428c,_0x514b16){return function(_0x11400d){if(_0x11400d){var _0x182fac=typeof _0x514b16[_0x916b('0x1a')]===_0x916b('0x1b')&&typeof _0x514b16[_0x916b('0x1c')]===_0x916b('0x1b');var _0x45d513=_0x11400d['count'];var _0x309b8c=_0x182fac?0x0:_0x514b16[_0x916b('0x1a')];var _0x320311=_0x182fac?_0x11400d[_0x916b('0x1d')]:_0x514b16[_0x916b('0x1a')]+_0x514b16['limit'];var _0x3dc31c;if(_0x320311>=_0x45d513){_0x320311=_0x45d513;_0x3dc31c=0xc8;}else{_0x3dc31c=0xce;}_0x29428c['status'](_0x3dc31c);return _0x29428c['set']('Content-Range',_0x309b8c+'-'+_0x320311+'/'+_0x45d513)[_0x916b('0x19')](_0x11400d);}return null;};}function patchUpdates(_0x510670){return function(_0x3ad6fa){try{jsonpatch[_0x916b('0x1e')](_0x3ad6fa,_0x510670,!![]);}catch(_0x22dc44){return BPromise[_0x916b('0x1f')](_0x22dc44);}return _0x3ad6fa[_0x916b('0x20')]();};}function saveUpdates(_0x222fe8,_0x33254a){return function(_0x1fec60){if(_0x1fec60){return _0x1fec60[_0x916b('0x21')](_0x222fe8)[_0x916b('0x22')](function(_0x115486){return _0x115486;});}return null;};}function removeEntity(_0x2bedba,_0x575b57){return function(_0x3a3000){if(_0x3a3000){return _0x3a3000[_0x916b('0x23')]()['then'](function(){_0x2bedba[_0x916b('0x18')](0xcc)[_0x916b('0x17')]();});}};}function handleEntityNotFound(_0x2e9978,_0x36d71d){return function(_0x3b2d1b){if(!_0x3b2d1b){_0x2e9978[_0x916b('0x16')](0x194);}return _0x3b2d1b;};}function handleError(_0x391c93,_0x3d69d6){_0x3d69d6=_0x3d69d6||0x1f4;return function(_0x3785a5){logger[_0x916b('0x24')](_0x3785a5[_0x916b('0x25')]);if(_0x3785a5['name']){delete _0x3785a5[_0x916b('0x26')];}_0x391c93['status'](_0x3d69d6)['send'](_0x3785a5);};}exports['index']=function(_0x20da84,_0x2cc7ec){var _0x303060={},_0x37ac59={},_0x148e03={'count':0x0,'rows':[]};var _0x39d599=_[_0x916b('0x27')](db['VtigerAccount'][_0x916b('0x28')],function(_0x456e49){return{'name':_0x456e49[_0x916b('0x29')],'type':_0x456e49[_0x916b('0x2a')][_0x916b('0x2b')]};});_0x37ac59[_0x916b('0x2c')]=_[_0x916b('0x27')](_0x39d599,_0x916b('0x26'));_0x37ac59[_0x916b('0x2d')]=_[_0x916b('0x2e')](_0x20da84[_0x916b('0x2d')]);_0x37ac59[_0x916b('0x2f')]=_['intersection'](_0x37ac59[_0x916b('0x2c')],_0x37ac59[_0x916b('0x2d')]);_0x303060[_0x916b('0x30')]=_['intersection'](_0x37ac59[_0x916b('0x2c')],qs['fields'](_0x20da84[_0x916b('0x2d')]['fields']));_0x303060['attributes']=_0x303060[_0x916b('0x30')][_0x916b('0x31')]?_0x303060['attributes']:_0x37ac59[_0x916b('0x2c')];if(!_0x20da84[_0x916b('0x2d')]['hasOwnProperty'](_0x916b('0x32'))){_0x303060[_0x916b('0x1c')]=qs[_0x916b('0x1c')](_0x20da84[_0x916b('0x2d')]['limit']);_0x303060[_0x916b('0x1a')]=qs['offset'](_0x20da84[_0x916b('0x2d')]['offset']);}_0x303060[_0x916b('0x33')]=qs[_0x916b('0x34')](_0x20da84[_0x916b('0x2d')][_0x916b('0x34')]);_0x303060['where']=qs[_0x916b('0x2f')](_['pick'](_0x20da84[_0x916b('0x2d')],_0x37ac59['filters']),_0x39d599);if(_0x20da84['query'][_0x916b('0x35')]){_0x303060[_0x916b('0x36')]=_[_0x916b('0x37')](_0x303060[_0x916b('0x36')],{'$or':_[_0x916b('0x27')](_0x39d599,function(_0x4eec97){if(_0x4eec97[_0x916b('0x2a')]!==_0x916b('0x38')){var _0x396e00={};_0x396e00[_0x4eec97['name']]={'$like':'%'+_0x20da84[_0x916b('0x2d')]['filter']+'%'};return _0x396e00;}})});}_0x303060=_[_0x916b('0x37')]({},_0x303060,_0x20da84[_0x916b('0x39')]);var _0xf1b6d6={'where':_0x303060[_0x916b('0x36')]};return db[_0x916b('0x3a')][_0x916b('0x1d')](_0xf1b6d6)['then'](function(_0x4b6845){_0x148e03['count']=_0x4b6845;if(_0x20da84['query']['includeAll']){_0x303060['include']=[{'all':!![]}];}return db[_0x916b('0x3a')][_0x916b('0x3b')](_0x303060);})['then'](function(_0x47d998){_0x148e03[_0x916b('0x3c')]=_0x47d998;return _0x148e03;})['then'](respondWithFilteredResult(_0x2cc7ec,_0x303060))[_0x916b('0x3d')](handleError(_0x2cc7ec,null));};exports['show']=function(_0x479dfe,_0x22c0c8){var _0x40ac85={'raw':![],'where':{'id':_0x479dfe['params']['id']}},_0x215ecc={};_0x215ecc[_0x916b('0x2c')]=_[_0x916b('0x2e')](db[_0x916b('0x3a')]['rawAttributes']);_0x215ecc[_0x916b('0x2d')]=_[_0x916b('0x2e')](_0x479dfe[_0x916b('0x2d')]);_0x215ecc[_0x916b('0x2f')]=_[_0x916b('0x3e')](_0x215ecc['model'],_0x215ecc[_0x916b('0x2d')]);_0x40ac85[_0x916b('0x30')]=_[_0x916b('0x3e')](_0x215ecc['model'],qs['fields'](_0x479dfe['query'][_0x916b('0x3f')]));_0x40ac85[_0x916b('0x30')]=_0x40ac85[_0x916b('0x30')][_0x916b('0x31')]?_0x40ac85[_0x916b('0x30')]:_0x215ecc[_0x916b('0x2c')];if(_0x479dfe['query']['includeAll']){_0x40ac85['include']=[{'all':!![]}];}_0x40ac85=_[_0x916b('0x37')]({},_0x40ac85,_0x479dfe[_0x916b('0x39')]);return db['VtigerAccount'][_0x916b('0x40')](_0x40ac85)['then'](handleEntityNotFound(_0x22c0c8,null))['then'](respondWithResult(_0x22c0c8,null))[_0x916b('0x3d')](handleError(_0x22c0c8,null));};exports['create']=function(_0x4075ed,_0x2c10da){return db['VtigerAccount'][_0x916b('0x41')](_0x4075ed[_0x916b('0x42')],{})[_0x916b('0x22')](respondWithResult(_0x2c10da,0xc9))[_0x916b('0x3d')](handleError(_0x2c10da,null));};exports[_0x916b('0x21')]=function(_0x1e7da4,_0x1104d9){if(_0x1e7da4[_0x916b('0x42')]['id']){delete _0x1e7da4[_0x916b('0x42')]['id'];}return db[_0x916b('0x3a')][_0x916b('0x40')]({'where':{'id':_0x1e7da4[_0x916b('0x43')]['id']}})[_0x916b('0x22')](handleEntityNotFound(_0x1104d9,null))[_0x916b('0x22')](saveUpdates(_0x1e7da4['body'],null))[_0x916b('0x22')](respondWithResult(_0x1104d9,null))['catch'](handleError(_0x1104d9,null));};exports['destroy']=function(_0x516bf4,_0x4a98f7){return db[_0x916b('0x3a')][_0x916b('0x40')]({'where':{'id':_0x516bf4[_0x916b('0x43')]['id']}})[_0x916b('0x22')](handleEntityNotFound(_0x4a98f7,null))[_0x916b('0x22')](removeEntity(_0x4a98f7,null))[_0x916b('0x3d')](handleError(_0x4a98f7,null));};exports[_0x916b('0x44')]=function(_0x50cf5a,_0x270c16,_0x2d0fb5){var _0x354dca={};var _0x383c03={};var _0x1c120b;var _0x304994;return db[_0x916b('0x3a')][_0x916b('0x45')]({'where':{'id':_0x50cf5a[_0x916b('0x43')]['id']}})['then'](handleEntityNotFound(_0x270c16,null))[_0x916b('0x22')](function(_0x55620d){if(_0x55620d){_0x1c120b=_0x55620d;_0x383c03[_0x916b('0x2c')]=_['keys'](db[_0x916b('0x46')]['rawAttributes']);_0x383c03[_0x916b('0x2d')]=_[_0x916b('0x2e')](_0x50cf5a[_0x916b('0x2d')]);_0x383c03[_0x916b('0x2f')]=_[_0x916b('0x3e')](_0x383c03[_0x916b('0x2c')],_0x383c03['query']);_0x354dca[_0x916b('0x30')]=_[_0x916b('0x3e')](_0x383c03[_0x916b('0x2c')],qs[_0x916b('0x3f')](_0x50cf5a[_0x916b('0x2d')]['fields']));_0x354dca['attributes']=_0x354dca[_0x916b('0x30')][_0x916b('0x31')]?_0x354dca[_0x916b('0x30')]:_0x383c03[_0x916b('0x2c')];_0x354dca[_0x916b('0x33')]=qs[_0x916b('0x34')](_0x50cf5a['query']['sort']);_0x354dca['where']=qs[_0x916b('0x2f')](_['pick'](_0x50cf5a[_0x916b('0x2d')],_0x383c03[_0x916b('0x2f')]));if(_0x50cf5a[_0x916b('0x2d')][_0x916b('0x35')]){_0x354dca[_0x916b('0x36')]=_['merge'](_0x354dca['where'],{'$or':_['map'](_0x354dca[_0x916b('0x30')],function(_0x257f80){var _0x4b48dd={};_0x4b48dd[_0x257f80]={'$like':'%'+_0x50cf5a['query']['filter']+'%'};return _0x4b48dd;})});}_0x354dca=_[_0x916b('0x37')]({},_0x354dca,_0x50cf5a[_0x916b('0x39')]);return _0x1c120b[_0x916b('0x44')](_0x354dca);}})[_0x916b('0x22')](function(_0x248127){if(_0x248127){_0x304994=_0x248127[_0x916b('0x31')];if(!_0x50cf5a['query'][_0x916b('0x47')]('nolimit')){_0x354dca[_0x916b('0x1c')]=qs[_0x916b('0x1c')](_0x50cf5a['query'][_0x916b('0x1c')]);_0x354dca['offset']=qs[_0x916b('0x1a')](_0x50cf5a[_0x916b('0x2d')][_0x916b('0x1a')]);}return _0x1c120b[_0x916b('0x44')](_0x354dca);}})[_0x916b('0x22')](function(_0xaeb466){if(_0xaeb466){return _0xaeb466?{'count':_0x304994,'rows':_0xaeb466}:null;}})[_0x916b('0x22')](respondWithResult(_0x270c16,null))[_0x916b('0x3d')](handleError(_0x270c16,null));};exports[_0x916b('0x48')]=function(_0xd597b5,_0x3a5ae8,_0x478762){if(_0xd597b5[_0x916b('0x42')]['id']){delete _0xd597b5['body']['id'];}return db[_0x916b('0x3a')][_0x916b('0x45')]({'where':{'id':_0xd597b5['params']['id']}})['then'](handleEntityNotFound(_0x3a5ae8,null))['then'](function(_0x16700a){if(_0x16700a){_0xd597b5['body'][_0x916b('0x49')]=_0x16700a['id'];_0xd597b5[_0x916b('0x42')]['Subjects']=integrations['getSubjects'](_0xd597b5[_0x916b('0x42')]['channel'],_0xd597b5[_0x916b('0x42')][_0x916b('0x2a')]);_0xd597b5['body'][_0x916b('0x4a')]=integrations[_0x916b('0x4b')](_0xd597b5[_0x916b('0x42')][_0x916b('0x4c')],_0xd597b5[_0x916b('0x42')][_0x916b('0x2a')]);return db[_0x916b('0x46')]['create'](_0xd597b5['body'],{'include':[{'model':db[_0x916b('0x4d')],'as':_0x916b('0x4e')},{'model':db[_0x916b('0x4d')],'as':_0x916b('0x4a')}]});}return null;})[_0x916b('0x22')](respondWithResult(_0x3a5ae8,null))[_0x916b('0x3d')](handleError(_0x3a5ae8,null));};var md5=require('md5');exports['getFields']=function(_0x4429d7,_0x2dcbd0,_0x163a4c){var _0xa22d1e=null;var _0xe73463=null;var _0x84dcd7=null;var _0x21d29c=null;var _0x36df28='';return db[_0x916b('0x3a')][_0x916b('0x45')]({'where':{'id':_0x4429d7[_0x916b('0x43')]['id']},'attributes':['id',_0x916b('0x26'),_0x916b('0x4f'),_0x916b('0x50'),'moduleName',_0x916b('0x51'),_0x916b('0x52'),_0x916b('0x53')]})[_0x916b('0x22')](handleEntityNotFound(_0x2dcbd0,null))[_0x916b('0x22')](function(_0x479d0e){if(_0x479d0e){_0xa22d1e=_0x479d0e[_0x916b('0x4f')];_0xe73463=_0x479d0e[_0x916b('0x53')];_0x84dcd7=_0x479d0e[_0x916b('0x54')];_0x36df28=_0x479d0e[_0x916b('0x51')];var _0x1bfaee=_0x36df28['slice'](-0x1);if(_0x1bfaee==='/'){_0x36df28=_0x36df28[_0x916b('0x55')](0x0,_0x36df28['lastIndexOf'](_0x1bfaee));}_0x21d29c=util['format'](_0x916b('0x56'),_0x36df28);var _0xee168f={'method':_0x916b('0x57'),'uri':_0x21d29c,'qs':{'operation':_0x916b('0x58'),'username':_0x479d0e[_0x916b('0x4f')]},'json':!![]};return rp(_0xee168f);}})['then'](function(_0x3ecf27){if(_0x3ecf27[_0x916b('0x59')]){var _0x149c58={'method':_0x916b('0x5a'),'uri':_0x21d29c,'form':{'operation':_0x916b('0x5b'),'username':_0xa22d1e,'accessKey':md5(_0x3ecf27[_0x916b('0x5c')][_0x916b('0x5d')]+_0xe73463)},'json':!![]};return rp(_0x149c58);}})[_0x916b('0x22')](function(_0x45e650){if(_0x45e650[_0x916b('0x59')]){var _0x3c12b6={'method':_0x916b('0x57'),'uri':_0x21d29c,'qs':{'operation':_0x916b('0x5e'),'username':_0xa22d1e,'sessionName':_0x45e650['result']['sessionName'],'elementType':_0x84dcd7},'json':!![]};return rp(_0x3c12b6);}})[_0x916b('0x22')](function(_0x451f0a){if(_0x451f0a['success']){var _0x5b49f7=['autogenerated',_0x916b('0x5f'),'owner'];_[_0x916b('0x60')](_0x451f0a['result'][_0x916b('0x3f')],function(_0x3aaa52){return _0x5b49f7[_0x916b('0x61')](_0x3aaa52[_0x916b('0x2a')][_0x916b('0x26')]);});_[_0x916b('0x60')](_0x451f0a['result']['fields'],function(_0x32c3df){return _0x32c3df[_0x916b('0x62')]==='false';});return{'count':_0x451f0a[_0x916b('0x5c')]['fields'][_0x916b('0x31')],'rows':_[_0x916b('0x27')](_0x451f0a['result'][_0x916b('0x3f')],function(_0x528a0e){return{'id':_0x528a0e[_0x916b('0x26')],'name':_0x528a0e['label'],'custom':_[_0x916b('0x63')](_0x528a0e[_0x916b('0x26')],'cf_')?!![]:![],'options':_0x528a0e[_0x916b('0x2a')][_0x916b('0x26')]===_0x916b('0x64')&&_0x528a0e['type'][_0x916b('0x65')][_0x916b('0x31')]>0x0?_[_0x916b('0x27')](_0x528a0e[_0x916b('0x2a')]['picklistValues'],function(_0x2ed267){return{'name':_0x2ed267[_0x916b('0x66')],'value':_0x2ed267['value']};}):[]};})};}})[_0x916b('0x22')](respondWithResult(_0x2dcbd0,null))['catch'](function(_0x14a06f){console[_0x916b('0x67')](_0x916b('0x68')+_0x14a06f);var _0x183881=_0x4429d7[_0x916b('0x2d')][_0x916b('0x69')]?0x1f4:_0x14a06f[_0x916b('0x6a')]||0x1f4;logger[_0x916b('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x916b('0x6b'),_0x183881,JSON[_0x916b('0x6c')](_0x14a06f));delete _0x14a06f[_0x916b('0x26')];if(_0x183881===0x191){_0x183881=0x190;}_0x2dcbd0['status'](_0x183881)[_0x916b('0x6d')](_0x4429d7[_0x916b('0x2d')][_0x916b('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x14a06f[_0x916b('0x6a')]}:_0x14a06f);});}; \ No newline at end of file +var _0x6cb9=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','findOne','VtigerConfiguration','order','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerField','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','editable','false','startsWith','picklist','picklistValues','label','log','vTiger\x20error:\x20','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1ac6ae,_0x5cc9a6){var _0xe73d41=function(_0x548950){while(--_0x548950){_0x1ac6ae['push'](_0x1ac6ae['shift']());}};_0xe73d41(++_0x5cc9a6);}(_0x6cb9,0x163));var _0x96cb=function(_0x12119c,_0x2fd50d){_0x12119c=_0x12119c-0x0;var _0x228d54=_0x6cb9[_0x12119c];return _0x228d54;};'use strict';var emlformat=require(_0x96cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96cb('0x1'));var jsonpatch=require(_0x96cb('0x2'));var rp=require(_0x96cb('0x3'));var moment=require(_0x96cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x96cb('0x5'));var util=require(_0x96cb('0x6'));var path=require(_0x96cb('0x7'));var sox=require(_0x96cb('0x8'));var csv=require(_0x96cb('0x9'));var ejs=require(_0x96cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96cb('0xb'));var squel=require(_0x96cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x96cb('0xd'));var deskjs=require(_0x96cb('0xe'));var toCsv=require(_0x96cb('0x9'));var querystring=require(_0x96cb('0xf'));var Papa=require('papaparse');var Redis=require(_0x96cb('0x10'));var authService=require(_0x96cb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x96cb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96cb('0x13'))('api');var utils=require(_0x96cb('0x14'));var config=require(_0x96cb('0x15'));var licenseUtil=require(_0x96cb('0x16'));var db=require(_0x96cb('0x17'))['db'];var integrations=require(_0x96cb('0x18'));function respondWithStatusCode(_0x5eb0b3,_0x5760e7){_0x5760e7=_0x5760e7||0xcc;return function(_0x1763d1){if(_0x1763d1){return _0x5eb0b3[_0x96cb('0x19')](_0x5760e7);}return _0x5eb0b3[_0x96cb('0x1a')](_0x5760e7)[_0x96cb('0x1b')]();};}function respondWithResult(_0x4b8e1c,_0x3ab380){_0x3ab380=_0x3ab380||0xc8;return function(_0x39ba18){if(_0x39ba18){return _0x4b8e1c[_0x96cb('0x1a')](_0x3ab380)[_0x96cb('0x1c')](_0x39ba18);}};}function respondWithFilteredResult(_0x4e4a7d,_0x3b338c){return function(_0x510235){if(_0x510235){var _0x187d0d=typeof _0x3b338c[_0x96cb('0x1d')]==='undefined'&&typeof _0x3b338c['limit']==='undefined';var _0x1ed123=_0x510235['count'];var _0x4bc7ed=_0x187d0d?0x0:_0x3b338c[_0x96cb('0x1d')];var _0x54cb39=_0x187d0d?_0x510235['count']:_0x3b338c[_0x96cb('0x1d')]+_0x3b338c[_0x96cb('0x1e')];var _0x4ecd71;if(_0x54cb39>=_0x1ed123){_0x54cb39=_0x1ed123;_0x4ecd71=0xc8;}else{_0x4ecd71=0xce;}_0x4e4a7d[_0x96cb('0x1a')](_0x4ecd71);return _0x4e4a7d[_0x96cb('0x1f')](_0x96cb('0x20'),_0x4bc7ed+'-'+_0x54cb39+'/'+_0x1ed123)[_0x96cb('0x1c')](_0x510235);}return null;};}function patchUpdates(_0x25ad14){return function(_0x5eef41){try{jsonpatch[_0x96cb('0x21')](_0x5eef41,_0x25ad14,!![]);}catch(_0x57122b){return BPromise[_0x96cb('0x22')](_0x57122b);}return _0x5eef41[_0x96cb('0x23')]();};}function saveUpdates(_0x36ce4c,_0x3dd3df){return function(_0x3833ca){if(_0x3833ca){return _0x3833ca[_0x96cb('0x24')](_0x36ce4c)[_0x96cb('0x25')](function(_0x2a7176){return _0x2a7176;});}return null;};}function removeEntity(_0x31cdf3,_0x54b50e){return function(_0x43c920){if(_0x43c920){return _0x43c920[_0x96cb('0x26')]()[_0x96cb('0x25')](function(){_0x31cdf3[_0x96cb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b909f,_0x15681e){return function(_0x1f0ee5){if(!_0x1f0ee5){_0x1b909f[_0x96cb('0x19')](0x194);}return _0x1f0ee5;};}function handleError(_0x1f4124,_0x137a6d){_0x137a6d=_0x137a6d||0x1f4;return function(_0x2f890e){logger['error'](_0x2f890e[_0x96cb('0x27')]);if(_0x2f890e[_0x96cb('0x28')]){delete _0x2f890e[_0x96cb('0x28')];}_0x1f4124[_0x96cb('0x1a')](_0x137a6d)[_0x96cb('0x29')](_0x2f890e);};}exports[_0x96cb('0x2a')]=function(_0x2a9422,_0x371099){var _0x5f1f21={},_0x288ddf={},_0x5bbf30={'count':0x0,'rows':[]};var _0x5d9b11=_['map'](db[_0x96cb('0x2b')][_0x96cb('0x2c')],function(_0x2f7f50){return{'name':_0x2f7f50[_0x96cb('0x2d')],'type':_0x2f7f50[_0x96cb('0x2e')][_0x96cb('0x2f')]};});_0x288ddf[_0x96cb('0x30')]=_['map'](_0x5d9b11,_0x96cb('0x28'));_0x288ddf[_0x96cb('0x31')]=_[_0x96cb('0x32')](_0x2a9422[_0x96cb('0x31')]);_0x288ddf[_0x96cb('0x33')]=_[_0x96cb('0x34')](_0x288ddf['model'],_0x288ddf[_0x96cb('0x31')]);_0x5f1f21[_0x96cb('0x35')]=_['intersection'](_0x288ddf[_0x96cb('0x30')],qs[_0x96cb('0x36')](_0x2a9422['query']['fields']));_0x5f1f21[_0x96cb('0x35')]=_0x5f1f21[_0x96cb('0x35')][_0x96cb('0x37')]?_0x5f1f21['attributes']:_0x288ddf[_0x96cb('0x30')];if(!_0x2a9422[_0x96cb('0x31')][_0x96cb('0x38')](_0x96cb('0x39'))){_0x5f1f21[_0x96cb('0x1e')]=qs['limit'](_0x2a9422[_0x96cb('0x31')][_0x96cb('0x1e')]);_0x5f1f21[_0x96cb('0x1d')]=qs[_0x96cb('0x1d')](_0x2a9422[_0x96cb('0x31')]['offset']);}_0x5f1f21['order']=qs[_0x96cb('0x3a')](_0x2a9422[_0x96cb('0x31')][_0x96cb('0x3a')]);_0x5f1f21[_0x96cb('0x3b')]=qs[_0x96cb('0x33')](_[_0x96cb('0x3c')](_0x2a9422[_0x96cb('0x31')],_0x288ddf[_0x96cb('0x33')]),_0x5d9b11);if(_0x2a9422[_0x96cb('0x31')][_0x96cb('0x3d')]){_0x5f1f21[_0x96cb('0x3b')]=_[_0x96cb('0x3e')](_0x5f1f21[_0x96cb('0x3b')],{'$or':_[_0x96cb('0x3f')](_0x5d9b11,function(_0x302efe){if(_0x302efe['type']!==_0x96cb('0x40')){var _0x1e4a51={};_0x1e4a51[_0x302efe[_0x96cb('0x28')]]={'$like':'%'+_0x2a9422[_0x96cb('0x31')]['filter']+'%'};return _0x1e4a51;}})});}_0x5f1f21=_[_0x96cb('0x3e')]({},_0x5f1f21,_0x2a9422[_0x96cb('0x41')]);var _0xd4120c={'where':_0x5f1f21['where']};return db[_0x96cb('0x2b')][_0x96cb('0x42')](_0xd4120c)['then'](function(_0x4a1298){_0x5bbf30[_0x96cb('0x42')]=_0x4a1298;if(_0x2a9422[_0x96cb('0x31')][_0x96cb('0x43')]){_0x5f1f21[_0x96cb('0x44')]=[{'all':!![]}];}return db[_0x96cb('0x2b')][_0x96cb('0x45')](_0x5f1f21);})[_0x96cb('0x25')](function(_0x3c0807){_0x5bbf30[_0x96cb('0x46')]=_0x3c0807;return _0x5bbf30;})['then'](respondWithFilteredResult(_0x371099,_0x5f1f21))['catch'](handleError(_0x371099,null));};exports[_0x96cb('0x47')]=function(_0x23088c,_0x4bb937){var _0x53aec3={'raw':![],'where':{'id':_0x23088c['params']['id']}},_0x44a4ce={};_0x44a4ce[_0x96cb('0x30')]=_[_0x96cb('0x32')](db[_0x96cb('0x2b')][_0x96cb('0x2c')]);_0x44a4ce[_0x96cb('0x31')]=_[_0x96cb('0x32')](_0x23088c[_0x96cb('0x31')]);_0x44a4ce[_0x96cb('0x33')]=_[_0x96cb('0x34')](_0x44a4ce[_0x96cb('0x30')],_0x44a4ce[_0x96cb('0x31')]);_0x53aec3['attributes']=_[_0x96cb('0x34')](_0x44a4ce[_0x96cb('0x30')],qs['fields'](_0x23088c['query'][_0x96cb('0x36')]));_0x53aec3['attributes']=_0x53aec3[_0x96cb('0x35')][_0x96cb('0x37')]?_0x53aec3[_0x96cb('0x35')]:_0x44a4ce['model'];if(_0x23088c['query'][_0x96cb('0x43')]){_0x53aec3['include']=[{'all':!![]}];}_0x53aec3=_['merge']({},_0x53aec3,_0x23088c[_0x96cb('0x41')]);return db[_0x96cb('0x2b')][_0x96cb('0x48')](_0x53aec3)[_0x96cb('0x25')](handleEntityNotFound(_0x4bb937,null))[_0x96cb('0x25')](respondWithResult(_0x4bb937,null))[_0x96cb('0x49')](handleError(_0x4bb937,null));};exports[_0x96cb('0x4a')]=function(_0x2fb339,_0x4af869){return db['VtigerAccount'][_0x96cb('0x4a')](_0x2fb339['body'],{})[_0x96cb('0x25')](respondWithResult(_0x4af869,0xc9))[_0x96cb('0x49')](handleError(_0x4af869,null));};exports[_0x96cb('0x24')]=function(_0x40a191,_0x398791){if(_0x40a191[_0x96cb('0x4b')]['id']){delete _0x40a191['body']['id'];}return db[_0x96cb('0x2b')][_0x96cb('0x48')]({'where':{'id':_0x40a191[_0x96cb('0x4c')]['id']}})[_0x96cb('0x25')](handleEntityNotFound(_0x398791,null))[_0x96cb('0x25')](saveUpdates(_0x40a191[_0x96cb('0x4b')],null))[_0x96cb('0x25')](respondWithResult(_0x398791,null))[_0x96cb('0x49')](handleError(_0x398791,null));};exports[_0x96cb('0x26')]=function(_0x4f701e,_0x55f069){return db[_0x96cb('0x2b')][_0x96cb('0x48')]({'where':{'id':_0x4f701e[_0x96cb('0x4c')]['id']}})[_0x96cb('0x25')](handleEntityNotFound(_0x55f069,null))[_0x96cb('0x25')](removeEntity(_0x55f069,null))['catch'](handleError(_0x55f069,null));};exports['getConfigurations']=function(_0x1dbcd2,_0x49b50c,_0x4c7a59){var _0x43adff={};var _0x9e941e={};var _0x2bc840;var _0x26126c;return db[_0x96cb('0x2b')][_0x96cb('0x4d')]({'where':{'id':_0x1dbcd2['params']['id']}})['then'](handleEntityNotFound(_0x49b50c,null))['then'](function(_0x287540){if(_0x287540){_0x2bc840=_0x287540;_0x9e941e[_0x96cb('0x30')]=_[_0x96cb('0x32')](db[_0x96cb('0x4e')][_0x96cb('0x2c')]);_0x9e941e[_0x96cb('0x31')]=_[_0x96cb('0x32')](_0x1dbcd2[_0x96cb('0x31')]);_0x9e941e[_0x96cb('0x33')]=_[_0x96cb('0x34')](_0x9e941e['model'],_0x9e941e[_0x96cb('0x31')]);_0x43adff['attributes']=_[_0x96cb('0x34')](_0x9e941e[_0x96cb('0x30')],qs[_0x96cb('0x36')](_0x1dbcd2['query'][_0x96cb('0x36')]));_0x43adff[_0x96cb('0x35')]=_0x43adff[_0x96cb('0x35')]['length']?_0x43adff[_0x96cb('0x35')]:_0x9e941e[_0x96cb('0x30')];_0x43adff[_0x96cb('0x4f')]=qs[_0x96cb('0x3a')](_0x1dbcd2[_0x96cb('0x31')][_0x96cb('0x3a')]);_0x43adff['where']=qs[_0x96cb('0x33')](_[_0x96cb('0x3c')](_0x1dbcd2[_0x96cb('0x31')],_0x9e941e[_0x96cb('0x33')]));if(_0x1dbcd2[_0x96cb('0x31')][_0x96cb('0x3d')]){_0x43adff[_0x96cb('0x3b')]=_['merge'](_0x43adff[_0x96cb('0x3b')],{'$or':_['map'](_0x43adff[_0x96cb('0x35')],function(_0x3bf136){var _0x469b5a={};_0x469b5a[_0x3bf136]={'$like':'%'+_0x1dbcd2['query'][_0x96cb('0x3d')]+'%'};return _0x469b5a;})});}_0x43adff=_[_0x96cb('0x3e')]({},_0x43adff,_0x1dbcd2['options']);return _0x2bc840[_0x96cb('0x50')](_0x43adff);}})[_0x96cb('0x25')](function(_0x540305){if(_0x540305){_0x26126c=_0x540305['length'];if(!_0x1dbcd2[_0x96cb('0x31')][_0x96cb('0x38')](_0x96cb('0x39'))){_0x43adff['limit']=qs[_0x96cb('0x1e')](_0x1dbcd2[_0x96cb('0x31')][_0x96cb('0x1e')]);_0x43adff[_0x96cb('0x1d')]=qs[_0x96cb('0x1d')](_0x1dbcd2[_0x96cb('0x31')]['offset']);}return _0x2bc840[_0x96cb('0x50')](_0x43adff);}})[_0x96cb('0x25')](function(_0x47086d){if(_0x47086d){return _0x47086d?{'count':_0x26126c,'rows':_0x47086d}:null;}})[_0x96cb('0x25')](respondWithResult(_0x49b50c,null))[_0x96cb('0x49')](handleError(_0x49b50c,null));};exports['addConfiguration']=function(_0xdba22d,_0x5ab933,_0x17164e){if(_0xdba22d['body']['id']){delete _0xdba22d[_0x96cb('0x4b')]['id'];}return db[_0x96cb('0x2b')][_0x96cb('0x4d')]({'where':{'id':_0xdba22d[_0x96cb('0x4c')]['id']}})[_0x96cb('0x25')](handleEntityNotFound(_0x5ab933,null))[_0x96cb('0x25')](function(_0x4cba40){if(_0x4cba40){_0xdba22d[_0x96cb('0x4b')][_0x96cb('0x51')]=_0x4cba40['id'];_0xdba22d[_0x96cb('0x4b')][_0x96cb('0x52')]=integrations[_0x96cb('0x53')](_0xdba22d[_0x96cb('0x4b')]['channel'],_0xdba22d[_0x96cb('0x4b')]['type']);_0xdba22d[_0x96cb('0x4b')][_0x96cb('0x54')]=integrations['getDescriptions'](_0xdba22d[_0x96cb('0x4b')][_0x96cb('0x55')],_0xdba22d[_0x96cb('0x4b')]['type']);return db[_0x96cb('0x4e')][_0x96cb('0x4a')](_0xdba22d[_0x96cb('0x4b')],{'include':[{'model':db[_0x96cb('0x56')],'as':_0x96cb('0x52')},{'model':db[_0x96cb('0x56')],'as':_0x96cb('0x54')}]});}return null;})['then'](respondWithResult(_0x5ab933,null))[_0x96cb('0x49')](handleError(_0x5ab933,null));};var md5=require('md5');exports[_0x96cb('0x57')]=function(_0xa89d,_0x823786,_0x183f9e){var _0x186df7=null;var _0x103360=null;var _0x5eec31=null;var _0x3f2102=null;var _0x5b6cd1='';return db['VtigerAccount']['findOne']({'where':{'id':_0xa89d[_0x96cb('0x4c')]['id']},'attributes':['id','name',_0x96cb('0x58'),_0x96cb('0x59'),_0x96cb('0x5a'),'remoteUri',_0x96cb('0x5b'),_0x96cb('0x5c')]})[_0x96cb('0x25')](handleEntityNotFound(_0x823786,null))[_0x96cb('0x25')](function(_0x981025){if(_0x981025){_0x186df7=_0x981025[_0x96cb('0x58')];_0x103360=_0x981025[_0x96cb('0x5c')];_0x5eec31=_0x981025['moduleName'];_0x5b6cd1=_0x981025[_0x96cb('0x5d')];var _0x3e0be5=_0x5b6cd1[_0x96cb('0x5e')](-0x1);if(_0x3e0be5==='/'){_0x5b6cd1=_0x5b6cd1[_0x96cb('0x5f')](0x0,_0x5b6cd1['lastIndexOf'](_0x3e0be5));}_0x3f2102=util[_0x96cb('0x60')](_0x96cb('0x61'),_0x5b6cd1);var _0x23e255={'method':_0x96cb('0x62'),'uri':_0x3f2102,'qs':{'operation':_0x96cb('0x63'),'username':_0x981025[_0x96cb('0x58')]},'json':!![]};return rp(_0x23e255);}})[_0x96cb('0x25')](function(_0x3adbb4){if(_0x3adbb4[_0x96cb('0x64')]){var _0x28f9db={'method':_0x96cb('0x65'),'uri':_0x3f2102,'form':{'operation':_0x96cb('0x66'),'username':_0x186df7,'accessKey':md5(_0x3adbb4[_0x96cb('0x67')][_0x96cb('0x68')]+_0x103360)},'json':!![]};return rp(_0x28f9db);}})['then'](function(_0x4e1c6f){if(_0x4e1c6f[_0x96cb('0x64')]){var _0x4258bb={'method':_0x96cb('0x62'),'uri':_0x3f2102,'qs':{'operation':_0x96cb('0x69'),'username':_0x186df7,'sessionName':_0x4e1c6f[_0x96cb('0x67')][_0x96cb('0x6a')],'elementType':_0x5eec31},'json':!![]};return rp(_0x4258bb);}})[_0x96cb('0x25')](function(_0x575ba4){if(_0x575ba4[_0x96cb('0x64')]){var _0x15b086=[_0x96cb('0x6b'),_0x96cb('0x6c'),_0x96cb('0x6d')];_['remove'](_0x575ba4['result'][_0x96cb('0x36')],function(_0x20d7eb){return _0x15b086['includes'](_0x20d7eb[_0x96cb('0x2e')][_0x96cb('0x28')]);});_[_0x96cb('0x6e')](_0x575ba4[_0x96cb('0x67')][_0x96cb('0x36')],function(_0x22e0f8){return _0x22e0f8[_0x96cb('0x6f')]===_0x96cb('0x70');});return{'count':_0x575ba4[_0x96cb('0x67')][_0x96cb('0x36')][_0x96cb('0x37')],'rows':_['map'](_0x575ba4['result'][_0x96cb('0x36')],function(_0x534022){return{'id':_0x534022[_0x96cb('0x28')],'name':_0x534022['label'],'custom':_[_0x96cb('0x71')](_0x534022[_0x96cb('0x28')],'cf_')?!![]:![],'options':_0x534022[_0x96cb('0x2e')]['name']===_0x96cb('0x72')&&_0x534022[_0x96cb('0x2e')]['picklistValues'][_0x96cb('0x37')]>0x0?_['map'](_0x534022[_0x96cb('0x2e')][_0x96cb('0x73')],function(_0x50844a){return{'name':_0x50844a[_0x96cb('0x74')],'value':_0x50844a['value']};}):[]};})};}})[_0x96cb('0x25')](respondWithResult(_0x823786,null))[_0x96cb('0x49')](function(_0x244b0a){console[_0x96cb('0x75')](_0x96cb('0x76')+_0x244b0a);var _0x3ea830=_0xa89d[_0x96cb('0x31')]['test']?0x1f4:_0x244b0a[_0x96cb('0x77')]||0x1f4;logger[_0x96cb('0x78')](_0x96cb('0x79'),_0x96cb('0x57'),_0x3ea830,JSON[_0x96cb('0x7a')](_0x244b0a));delete _0x244b0a['name'];if(_0x3ea830===0x191){_0x3ea830=0x190;}_0x823786[_0x96cb('0x1a')](_0x3ea830)[_0x96cb('0x29')](_0xa89d[_0x96cb('0x31')][_0x96cb('0x7b')]?{'message':_0x96cb('0x7c'),'statusCode':_0x244b0a[_0x96cb('0x77')]}:_0x244b0a);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 9793bf3..30fb6f3 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 _0xd572=['VtigerAccount','int_vtiger_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xd572,0xd4));var _0x2d57=function(_0x221fa6,_0x41696b){_0x221fa6=_0x221fa6-0x0;var _0x486a0d=_0xd572[_0x221fa6];return _0x486a0d;};'use strict';var _=require(_0x2d57('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d57('0x1'));var moment=require(_0x2d57('0x2'));var BPromise=require(_0x2d57('0x3'));var rp=require(_0x2d57('0x4'));var fs=require('fs');var path=require(_0x2d57('0x5'));var rimraf=require(_0x2d57('0x6'));var config=require(_0x2d57('0x7'));var attributes=require(_0x2d57('0x8'));var integrations=require(_0x2d57('0x9'));module[_0x2d57('0xa')]=function(_0x2a524d,_0x13cce4){return _0x2a524d[_0x2d57('0xb')](_0x2d57('0xc'),attributes,{'tableName':_0x2d57('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb273=['request-promise','path','../../config/environment','exports','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x11cd17,_0x489e02){var _0x3343ad=function(_0xfb1588){while(--_0xfb1588){_0x11cd17['push'](_0x11cd17['shift']());}};_0x3343ad(++_0x489e02);}(_0xb273,0x13f));var _0x3b27=function(_0x5a86f5,_0x2b0945){_0x5a86f5=_0x5a86f5-0x0;var _0x418e32=_0xb273[_0x5a86f5];return _0x418e32;};'use strict';var _=require('lodash');var util=require(_0x3b27('0x0'));var logger=require(_0x3b27('0x1'))(_0x3b27('0x2'));var moment=require(_0x3b27('0x3'));var BPromise=require(_0x3b27('0x4'));var rp=require(_0x3b27('0x5'));var fs=require('fs');var path=require(_0x3b27('0x6'));var rimraf=require('rimraf');var config=require(_0x3b27('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3b27('0x8')]=function(_0x5267cf,_0x29e511){return _0x5267cf[_0x3b27('0x9')](_0x3b27('0xa'),attributes,{'tableName':_0x3b27('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 3a195a8..b072ade 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 _0x4024=['attributes','include','map','model','then','debug','ShowVtigerAccount','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','info','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options'];(function(_0x59cbfc,_0x847b60){var _0x7253c9=function(_0x5b8734){while(--_0x5b8734){_0x59cbfc['push'](_0x59cbfc['shift']());}};_0x7253c9(++_0x847b60);}(_0x4024,0x89));var _0x4402=function(_0x3033b9,_0x56adf4){_0x3033b9=_0x3033b9-0x0;var _0x293f8b=_0x4024[_0x3033b9];return _0x293f8b;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168acd,_0x4ed77d,_0x3045ae){return new BPromise(function(_0x5d7ca4,_0x5c0b70){return client[_0x4402('0x9')](_0x168acd,_0x3045ae)['then'](function(_0x4d2882){logger[_0x4402('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4ed77d,_0x4402('0xb'));logger['debug'](_0x4402('0xc'),_0x4ed77d,'request\x20sent',JSON[_0x4402('0xd')](_0x4d2882));if(_0x4d2882[_0x4402('0xe')]){if(_0x4d2882['error'][_0x4402('0xf')]===0x1f4){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882['error'][_0x4402('0x11')]);return _0x5c0b70(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);return _0x5d7ca4(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}else{logger[_0x4402('0xa')](_0x4402('0x10'),_0x4ed77d,_0x4402('0xb'));_0x5d7ca4(_0x4d2882[_0x4402('0x12')][_0x4402('0x11')]);}})[_0x4402('0x13')](function(_0x30c390){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x30c390);_0x5c0b70(_0x30c390);});});}exports[_0x4402('0x14')]=function(_0x231382){var _0x5b127f=this;return new Promise(function(_0x494389,_0x663ab7){return db[_0x4402('0x15')]['findAll']({'raw':_0x231382[_0x4402('0x16')]?_0x231382[_0x4402('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x231382[_0x4402('0x16')]?_0x231382['options']['where']||null:null,'attributes':_0x231382[_0x4402('0x16')]?_0x231382[_0x4402('0x16')][_0x4402('0x17')]||null:null,'limit':_0x231382['options']?_0x231382[_0x4402('0x16')]['limit']||null:null,'include':_0x231382['options']?_0x231382[_0x4402('0x16')][_0x4402('0x18')]?_[_0x4402('0x19')](_0x231382[_0x4402('0x16')][_0x4402('0x18')],function(_0x2e6fee){return{'model':db[_0x2e6fee[_0x4402('0x1a')]],'as':_0x2e6fee['as'],'attributes':_0x2e6fee[_0x4402('0x17')],'include':_0x2e6fee[_0x4402('0x18')]?_['map'](_0x2e6fee[_0x4402('0x18')],function(_0x4e1c04){return{'model':db[_0x4e1c04[_0x4402('0x1a')]],'as':_0x4e1c04['as'],'attributes':_0x4e1c04[_0x4402('0x17')],'include':_0x4e1c04[_0x4402('0x18')]?_[_0x4402('0x19')](_0x4e1c04['include'],function(_0x15c19f){return{'model':db[_0x15c19f['model']],'as':_0x15c19f['as'],'attributes':_0x15c19f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0x1b')](function(_0x395e49){logger[_0x4402('0xa')](_0x4402('0x14'),_0x231382);logger[_0x4402('0x1c')]('GetVtigerAccount',_0x231382,JSON[_0x4402('0xd')](_0x395e49));_0x494389(_0x395e49);})['catch'](function(_0x71da2f){logger[_0x4402('0xe')](_0x4402('0x14'),_0x71da2f['message'],_0x231382);_0x663ab7(_0x5b127f[_0x4402('0xe')](0x1f4,_0x71da2f[_0x4402('0x11')]));});});};exports[_0x4402('0x1d')]=function(_0x3f4bcb){var _0x2526d1=this;return new Promise(function(_0x605702,_0x1189b8){return db[_0x4402('0x15')][_0x4402('0x1e')]({'raw':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb[_0x4402('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb['options'][_0x4402('0x1f')]||null:null,'attributes':_0x3f4bcb['options']?_0x3f4bcb[_0x4402('0x16')][_0x4402('0x17')]||null:null,'include':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb[_0x4402('0x16')][_0x4402('0x18')]?_['map'](_0x3f4bcb[_0x4402('0x16')][_0x4402('0x18')],function(_0x169340){return{'model':db[_0x169340['model']],'as':_0x169340['as'],'attributes':_0x169340[_0x4402('0x17')],'include':_0x169340[_0x4402('0x18')]?_['map'](_0x169340[_0x4402('0x18')],function(_0x437e83){return{'model':db[_0x437e83[_0x4402('0x1a')]],'as':_0x437e83['as'],'attributes':_0x437e83[_0x4402('0x17')],'include':_0x437e83[_0x4402('0x18')]?_[_0x4402('0x19')](_0x437e83[_0x4402('0x18')],function(_0x6e9fb7){return{'model':db[_0x6e9fb7[_0x4402('0x1a')]],'as':_0x6e9fb7['as'],'attributes':_0x6e9fb7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0x1b')](function(_0x28fee8){logger[_0x4402('0xa')]('ShowVtigerAccount',_0x3f4bcb);logger[_0x4402('0x1c')](_0x4402('0x1d'),_0x3f4bcb,JSON['stringify'](_0x28fee8));_0x605702(_0x28fee8);})['catch'](function(_0x2b9d51){logger[_0x4402('0xe')](_0x4402('0x1d'),_0x2b9d51[_0x4402('0x11')],_0x3f4bcb);_0x1189b8(_0x2526d1['error'](0x1f4,_0x2b9d51['message']));});});}; \ No newline at end of file +var _0x4cf8=['info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetVtigerAccount','options','raw','attributes','include','map','model','ShowVtigerAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x269094,_0x4701b3){_0x269094=_0x269094-0x0;var _0x10344f=_0x4cf8[_0x269094];return _0x10344f;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));var BPromise=require(_0x84cf('0x3'));var rs=require(_0x84cf('0x4'));var fs=require('fs');var Redis=require(_0x84cf('0x5'));var db=require(_0x84cf('0x6'))['db'];var utils=require(_0x84cf('0x7'));var logger=require(_0x84cf('0x8'))(_0x84cf('0x9'));var config=require(_0x84cf('0xa'));var jayson=require(_0x84cf('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x455345,_0x56c5cc,_0x15ba85){return new BPromise(function(_0x2c11b0,_0x51b84c){return client[_0x84cf('0xc')](_0x455345,_0x15ba85)[_0x84cf('0xd')](function(_0x489063){logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));logger[_0x84cf('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x56c5cc,_0x84cf('0x10'),JSON[_0x84cf('0x12')](_0x489063));if(_0x489063['error']){if(_0x489063['error'][_0x84cf('0x13')]===0x1f4){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x51b84c(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x2c11b0(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}else{logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));_0x2c11b0(_0x489063[_0x84cf('0x16')][_0x84cf('0x15')]);}})[_0x84cf('0x17')](function(_0x5b8ac8){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x5b8ac8);_0x51b84c(_0x5b8ac8);});});}exports[_0x84cf('0x18')]=function(_0x1abe2d){var _0x1dad1a=this;return new Promise(function(_0x13ba16,_0xe6b5b6){return db['VtigerAccount']['findAll']({'raw':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1a')]===undefined?!![]:![]:!![],'where':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')]['where']||null:null,'attributes':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1b')]||null:null,'limit':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')]['limit']||null:null,'include':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1c')],function(_0x7feb4){return{'model':db[_0x7feb4['model']],'as':_0x7feb4['as'],'attributes':_0x7feb4[_0x84cf('0x1b')],'include':_0x7feb4[_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x7feb4[_0x84cf('0x1c')],function(_0x1d220a){return{'model':db[_0x1d220a[_0x84cf('0x1e')]],'as':_0x1d220a['as'],'attributes':_0x1d220a[_0x84cf('0x1b')],'include':_0x1d220a[_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x1d220a[_0x84cf('0x1c')],function(_0x5179c1){return{'model':db[_0x5179c1[_0x84cf('0x1e')]],'as':_0x5179c1['as'],'attributes':_0x5179c1[_0x84cf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84cf('0xd')](function(_0x41a5db){logger['info'](_0x84cf('0x18'),_0x1abe2d);logger['debug'](_0x84cf('0x18'),_0x1abe2d,JSON[_0x84cf('0x12')](_0x41a5db));_0x13ba16(_0x41a5db);})[_0x84cf('0x17')](function(_0xc15298){logger[_0x84cf('0x14')](_0x84cf('0x18'),_0xc15298[_0x84cf('0x15')],_0x1abe2d);_0xe6b5b6(_0x1dad1a[_0x84cf('0x14')](0x1f4,_0xc15298[_0x84cf('0x15')]));});});};exports[_0x84cf('0x1f')]=function(_0x31dbf5){var _0x308f8f=this;return new Promise(function(_0x18243d,_0x44f16e){return db['VtigerAccount']['find']({'raw':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')][_0x84cf('0x1a')]===undefined?!![]:![]:!![],'where':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')][_0x84cf('0x20')]||null:null,'attributes':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')]['attributes']||null:null,'include':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')]['include']?_[_0x84cf('0x1d')](_0x31dbf5['options'][_0x84cf('0x1c')],function(_0x3ea5b9){return{'model':db[_0x3ea5b9[_0x84cf('0x1e')]],'as':_0x3ea5b9['as'],'attributes':_0x3ea5b9[_0x84cf('0x1b')],'include':_0x3ea5b9[_0x84cf('0x1c')]?_['map'](_0x3ea5b9[_0x84cf('0x1c')],function(_0x48309d){return{'model':db[_0x48309d['model']],'as':_0x48309d['as'],'attributes':_0x48309d[_0x84cf('0x1b')],'include':_0x48309d[_0x84cf('0x1c')]?_['map'](_0x48309d[_0x84cf('0x1c')],function(_0x263372){return{'model':db[_0x263372[_0x84cf('0x1e')]],'as':_0x263372['as'],'attributes':_0x263372[_0x84cf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84cf('0xd')](function(_0x300f94){logger['info'](_0x84cf('0x1f'),_0x31dbf5);logger[_0x84cf('0x11')](_0x84cf('0x1f'),_0x31dbf5,JSON[_0x84cf('0x12')](_0x300f94));_0x18243d(_0x300f94);})[_0x84cf('0x17')](function(_0x2a8992){logger['error'](_0x84cf('0x1f'),_0x2a8992['message'],_0x31dbf5);_0x44f16e(_0x308f8f[_0x84cf('0x14')](0x1f4,_0x2a8992[_0x84cf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 9da944f..1833e45 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 _0x2605=['/:id/fields','getSubjects','/:id/descriptions','create','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x10d2e3,_0x31ddd9){var _0x43332c=function(_0x4b4549){while(--_0x4b4549){_0x10d2e3['push'](_0x10d2e3['shift']());}};_0x43332c(++_0x31ddd9);}(_0x2605,0x142));var _0x5260=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0x2605[_0x57fa7e];return _0x320671;};'use strict';var multer=require(_0x5260('0x0'));var util=require('util');var path=require(_0x5260('0x1'));var timeout=require(_0x5260('0x2'));var express=require(_0x5260('0x3'));var router=express[_0x5260('0x4')]();var fs_extra=require(_0x5260('0x5'));var auth=require(_0x5260('0x6'));var interaction=require(_0x5260('0x7'));var config=require(_0x5260('0x8'));var controller=require('./intVtigerConfiguration.controller');router[_0x5260('0x9')]('/',auth[_0x5260('0xa')](),controller[_0x5260('0xb')]);router[_0x5260('0x9')](_0x5260('0xc'),auth[_0x5260('0xa')](),controller[_0x5260('0xd')]);router[_0x5260('0x9')](_0x5260('0xe'),auth[_0x5260('0xa')](),controller['getFields']);router[_0x5260('0x9')]('/:id/subjects',auth[_0x5260('0xa')](),controller[_0x5260('0xf')]);router[_0x5260('0x9')](_0x5260('0x10'),auth[_0x5260('0xa')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x5260('0x11')]);router[_0x5260('0x12')](_0x5260('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5260('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5260('0x14')]);module['exports']=router; \ No newline at end of file +var _0x0734=['/:id','show','getFields','/:id/subjects','getSubjects','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x524870,_0x31a510){var _0x2b9dbf=function(_0x42c6a1){while(--_0x42c6a1){_0x524870['push'](_0x524870['shift']());}};_0x2b9dbf(++_0x31a510);}(_0x0734,0x185));var _0x4073=function(_0x565866,_0x599242){_0x565866=_0x565866-0x0;var _0x3dae3f=_0x0734[_0x565866];return _0x3dae3f;};'use strict';var multer=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var path=require('path');var timeout=require(_0x4073('0x2'));var express=require(_0x4073('0x3'));var router=express['Router']();var fs_extra=require(_0x4073('0x4'));var auth=require(_0x4073('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4073('0x6'));router[_0x4073('0x7')]('/',auth[_0x4073('0x8')](),controller[_0x4073('0x9')]);router[_0x4073('0x7')](_0x4073('0xa'),auth[_0x4073('0x8')](),controller[_0x4073('0xb')]);router['get']('/:id/fields',auth[_0x4073('0x8')](),controller[_0x4073('0xc')]);router[_0x4073('0x7')](_0x4073('0xd'),auth[_0x4073('0x8')](),controller[_0x4073('0xe')]);router[_0x4073('0x7')]('/:id/descriptions',auth[_0x4073('0x8')](),controller['getDescriptions']);router[_0x4073('0xf')]('/',auth[_0x4073('0x8')](),controller[_0x4073('0x10')]);router[_0x4073('0x11')](_0x4073('0xa'),auth[_0x4073('0x8')](),controller[_0x4073('0x12')]);router[_0x4073('0x13')](_0x4073('0xa'),auth[_0x4073('0x8')](),controller[_0x4073('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index a86c998..70d0e46 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 _0x6ad3=['STRING','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6ad3,0x106));var _0x36ad=function(_0x4e7c1c,_0x56eafd){_0x4e7c1c=_0x4e7c1c-0x0;var _0x47adb2=_0x6ad3[_0x4e7c1c];return _0x47adb2;};'use strict';var Sequelize=require(_0x36ad('0x0'));module[_0x36ad('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x36ad('0x2')]}}; \ No newline at end of file +var _0x0efe=['STRING','sequelize'];(function(_0x204114,_0x498ba1){var _0x5418f6=function(_0x41580a){while(--_0x41580a){_0x204114['push'](_0x204114['shift']());}};_0x5418f6(++_0x498ba1);}(_0x0efe,0x1df));var _0xe0ef=function(_0x5912da,_0x5e996b){_0x5912da=_0x5912da-0x0;var _0x14d4ca=_0x0efe[_0x5912da];return _0x14d4ca;};'use strict';var Sequelize=require(_0xe0ef('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0ef('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e9cae55..6e0eee8 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 _0x9734=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','error','name','index','map','VtigerConfiguration','rawAttributes','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','create','body','catch','findOne','VtigerField','getFields','getSubjects','getDescriptions','order','nolimit','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x9734,0xe0));var _0x4973=function(_0x494795,_0x3345fe){_0x494795=_0x494795-0x0;var _0x22730b=_0x9734[_0x494795];return _0x22730b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4973('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4973('0x1'));var rp=require(_0x4973('0x2'));var moment=require(_0x4973('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4973('0x4'));var util=require(_0x4973('0x5'));var path=require(_0x4973('0x6'));var sox=require(_0x4973('0x7'));var csv=require(_0x4973('0x8'));var ejs=require(_0x4973('0x9'));var fs=require('fs');var fs_extra=require(_0x4973('0xa'));var _=require(_0x4973('0xb'));var squel=require(_0x4973('0xc'));var crypto=require(_0x4973('0xd'));var jsforce=require(_0x4973('0xe'));var deskjs=require(_0x4973('0xf'));var toCsv=require(_0x4973('0x8'));var querystring=require(_0x4973('0x10'));var Papa=require('papaparse');var Redis=require(_0x4973('0x11'));var authService=require(_0x4973('0x12'));var qs=require(_0x4973('0x13'));var as=require(_0x4973('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4973('0x15'))(_0x4973('0x16'));var utils=require(_0x4973('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4973('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4053a1,_0x105ffd){_0x105ffd=_0x105ffd||0xcc;return function(_0x11a717){if(_0x11a717){return _0x4053a1[_0x4973('0x19')](_0x105ffd);}return _0x4053a1[_0x4973('0x1a')](_0x105ffd)[_0x4973('0x1b')]();};}function respondWithResult(_0x54c4ec,_0x448c3b){_0x448c3b=_0x448c3b||0xc8;return function(_0x25a85e){if(_0x25a85e){return _0x54c4ec['status'](_0x448c3b)[_0x4973('0x1c')](_0x25a85e);}};}function respondWithFilteredResult(_0x3a826c,_0x31debc){return function(_0x37be18){if(_0x37be18){var _0x59ff66=typeof _0x31debc['offset']==='undefined'&&typeof _0x31debc[_0x4973('0x1d')]===_0x4973('0x1e');var _0x523b0c=_0x37be18[_0x4973('0x1f')];var _0x35d50c=_0x59ff66?0x0:_0x31debc[_0x4973('0x20')];var _0x37f364=_0x59ff66?_0x37be18[_0x4973('0x1f')]:_0x31debc[_0x4973('0x20')]+_0x31debc[_0x4973('0x1d')];var _0x40a30f;if(_0x37f364>=_0x523b0c){_0x37f364=_0x523b0c;_0x40a30f=0xc8;}else{_0x40a30f=0xce;}_0x3a826c[_0x4973('0x1a')](_0x40a30f);return _0x3a826c[_0x4973('0x21')]('Content-Range',_0x35d50c+'-'+_0x37f364+'/'+_0x523b0c)[_0x4973('0x1c')](_0x37be18);}return null;};}function patchUpdates(_0x445941){return function(_0x2896d9){try{jsonpatch[_0x4973('0x22')](_0x2896d9,_0x445941,!![]);}catch(_0x106405){return BPromise[_0x4973('0x23')](_0x106405);}return _0x2896d9['save']();};}function saveUpdates(_0x253a3d,_0x2e4a8c){return function(_0x50a75c){if(_0x50a75c){return _0x50a75c[_0x4973('0x24')](_0x253a3d)[_0x4973('0x25')](function(_0x206fce){return _0x206fce;});}return null;};}function removeEntity(_0x35b51b,_0x165d85){return function(_0x1e9cc1){if(_0x1e9cc1){return _0x1e9cc1[_0x4973('0x26')]()['then'](function(){_0x35b51b[_0x4973('0x1a')](0xcc)[_0x4973('0x1b')]();});}};}function handleEntityNotFound(_0x551c0f,_0x5ccd73){return function(_0x114d01){if(!_0x114d01){_0x551c0f[_0x4973('0x19')](0x194);}return _0x114d01;};}function handleError(_0x4fa33d,_0x2a5f82){_0x2a5f82=_0x2a5f82||0x1f4;return function(_0x4dee9f){logger[_0x4973('0x27')](_0x4dee9f['stack']);if(_0x4dee9f[_0x4973('0x28')]){delete _0x4dee9f['name'];}_0x4fa33d['status'](_0x2a5f82)['send'](_0x4dee9f);};}exports[_0x4973('0x29')]=function(_0x4b3424,_0x4a40d1){var _0x4835ab={},_0x558f80={},_0x58ace2={'count':0x0,'rows':[]};var _0x5e1606=_[_0x4973('0x2a')](db[_0x4973('0x2b')][_0x4973('0x2c')],function(_0x4bd191){return{'name':_0x4bd191['fieldName'],'type':_0x4bd191['type'][_0x4973('0x2d')]};});_0x558f80[_0x4973('0x2e')]=_[_0x4973('0x2a')](_0x5e1606,_0x4973('0x28'));_0x558f80['query']=_[_0x4973('0x2f')](_0x4b3424[_0x4973('0x30')]);_0x558f80['filters']=_['intersection'](_0x558f80[_0x4973('0x2e')],_0x558f80[_0x4973('0x30')]);_0x4835ab[_0x4973('0x31')]=_[_0x4973('0x32')](_0x558f80[_0x4973('0x2e')],qs[_0x4973('0x33')](_0x4b3424[_0x4973('0x30')][_0x4973('0x33')]));_0x4835ab[_0x4973('0x31')]=_0x4835ab['attributes'][_0x4973('0x34')]?_0x4835ab[_0x4973('0x31')]:_0x558f80['model'];if(!_0x4b3424['query'][_0x4973('0x35')]('nolimit')){_0x4835ab[_0x4973('0x1d')]=qs[_0x4973('0x1d')](_0x4b3424[_0x4973('0x30')][_0x4973('0x1d')]);_0x4835ab['offset']=qs[_0x4973('0x20')](_0x4b3424[_0x4973('0x30')][_0x4973('0x20')]);}_0x4835ab['order']=qs['sort'](_0x4b3424[_0x4973('0x30')][_0x4973('0x36')]);_0x4835ab[_0x4973('0x37')]=qs['filters'](_[_0x4973('0x38')](_0x4b3424[_0x4973('0x30')],_0x558f80[_0x4973('0x39')]),_0x5e1606);if(_0x4b3424['query']['filter']){_0x4835ab[_0x4973('0x37')]=_[_0x4973('0x3a')](_0x4835ab['where'],{'$or':_[_0x4973('0x2a')](_0x5e1606,function(_0x1573a3){if(_0x1573a3[_0x4973('0x3b')]!==_0x4973('0x3c')){var _0x2059a0={};_0x2059a0[_0x1573a3[_0x4973('0x28')]]={'$like':'%'+_0x4b3424[_0x4973('0x30')][_0x4973('0x3d')]+'%'};return _0x2059a0;}})});}_0x4835ab=_[_0x4973('0x3a')]({},_0x4835ab,_0x4b3424[_0x4973('0x3e')]);var _0x58a738={'where':_0x4835ab[_0x4973('0x37')]};return db[_0x4973('0x2b')]['count'](_0x58a738)[_0x4973('0x25')](function(_0x18d315){_0x58ace2[_0x4973('0x1f')]=_0x18d315;if(_0x4b3424[_0x4973('0x30')][_0x4973('0x3f')]){_0x4835ab[_0x4973('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x4973('0x41')](_0x4835ab);})[_0x4973('0x25')](function(_0x5b7a3e){_0x58ace2[_0x4973('0x42')]=_0x5b7a3e;return _0x58ace2;})['then'](respondWithFilteredResult(_0x4a40d1,_0x4835ab))['catch'](handleError(_0x4a40d1,null));};exports[_0x4973('0x43')]=function(_0x23c165,_0x5a75c8){var _0x26527e={'raw':![],'where':{'id':_0x23c165[_0x4973('0x44')]['id']}},_0x1373bb={};_0x1373bb[_0x4973('0x2e')]=_[_0x4973('0x2f')](db[_0x4973('0x2b')][_0x4973('0x2c')]);_0x1373bb['query']=_[_0x4973('0x2f')](_0x23c165[_0x4973('0x30')]);_0x1373bb[_0x4973('0x39')]=_[_0x4973('0x32')](_0x1373bb['model'],_0x1373bb[_0x4973('0x30')]);_0x26527e['attributes']=_[_0x4973('0x32')](_0x1373bb[_0x4973('0x2e')],qs['fields'](_0x23c165['query'][_0x4973('0x33')]));_0x26527e[_0x4973('0x31')]=_0x26527e['attributes']['length']?_0x26527e[_0x4973('0x31')]:_0x1373bb[_0x4973('0x2e')];if(_0x23c165['query'][_0x4973('0x3f')]){_0x26527e[_0x4973('0x40')]=[{'all':!![]}];}_0x26527e=_['merge']({},_0x26527e,_0x23c165[_0x4973('0x3e')]);return db[_0x4973('0x2b')]['find'](_0x26527e)[_0x4973('0x25')](handleEntityNotFound(_0x5a75c8,null))[_0x4973('0x25')](respondWithResult(_0x5a75c8,null))['catch'](handleError(_0x5a75c8,null));};exports[_0x4973('0x45')]=function(_0x37361f,_0x3489a7){return db[_0x4973('0x2b')][_0x4973('0x45')](_0x37361f[_0x4973('0x46')],{})[_0x4973('0x25')](respondWithResult(_0x3489a7,0xc9))[_0x4973('0x47')](handleError(_0x3489a7,null));};exports[_0x4973('0x24')]=function(_0xf5beba,_0x4f4f34){if(_0xf5beba[_0x4973('0x46')]['id']){delete _0xf5beba[_0x4973('0x46')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0xf5beba['params']['id']}})[_0x4973('0x25')](handleEntityNotFound(_0x4f4f34,null))[_0x4973('0x25')](saveUpdates(_0xf5beba[_0x4973('0x46')],null))['then'](respondWithResult(_0x4f4f34,null))['catch'](handleError(_0x4f4f34,null));};exports[_0x4973('0x26')]=function(_0x5259a9,_0x439524){return db[_0x4973('0x2b')]['find']({'where':{'id':_0x5259a9['params']['id']}})['then'](handleEntityNotFound(_0x439524,null))['then'](removeEntity(_0x439524,null))['catch'](handleError(_0x439524,null));};exports['getFields']=function(_0x15e97d,_0x138bca,_0x51f360){var _0x2183b2={};var _0x36d342={};var _0x2a6a50;var _0x780bf5;return db['VtigerConfiguration'][_0x4973('0x48')]({'where':{'id':_0x15e97d[_0x4973('0x44')]['id']}})['then'](handleEntityNotFound(_0x138bca,null))['then'](function(_0x8279c2){if(_0x8279c2){_0x2a6a50=_0x8279c2;_0x36d342[_0x4973('0x2e')]=_[_0x4973('0x2f')](db[_0x4973('0x49')][_0x4973('0x2c')]);_0x36d342['query']=_['keys'](_0x15e97d[_0x4973('0x30')]);_0x36d342[_0x4973('0x39')]=_[_0x4973('0x32')](_0x36d342[_0x4973('0x2e')],_0x36d342[_0x4973('0x30')]);_0x2183b2['attributes']=_[_0x4973('0x32')](_0x36d342[_0x4973('0x2e')],qs[_0x4973('0x33')](_0x15e97d[_0x4973('0x30')][_0x4973('0x33')]));_0x2183b2[_0x4973('0x31')]=_0x2183b2[_0x4973('0x31')][_0x4973('0x34')]?_0x2183b2[_0x4973('0x31')]:_0x36d342[_0x4973('0x2e')];_0x2183b2['order']=qs[_0x4973('0x36')](_0x15e97d[_0x4973('0x30')][_0x4973('0x36')]);_0x2183b2['where']=qs['filters'](_[_0x4973('0x38')](_0x15e97d['query'],_0x36d342[_0x4973('0x39')]));if(_0x15e97d[_0x4973('0x30')]['filter']){_0x2183b2[_0x4973('0x37')]=_[_0x4973('0x3a')](_0x2183b2[_0x4973('0x37')],{'$or':_[_0x4973('0x2a')](_0x2183b2[_0x4973('0x31')],function(_0x260f22){var _0x5a157d={};_0x5a157d[_0x260f22]={'$like':'%'+_0x15e97d[_0x4973('0x30')][_0x4973('0x3d')]+'%'};return _0x5a157d;})});}_0x2183b2=_[_0x4973('0x3a')]({},_0x2183b2,_0x15e97d[_0x4973('0x3e')]);return _0x2a6a50[_0x4973('0x4a')](_0x2183b2);}})[_0x4973('0x25')](function(_0x217057){if(_0x217057){_0x780bf5=_0x217057['length'];if(!_0x15e97d[_0x4973('0x30')][_0x4973('0x35')]('nolimit')){_0x2183b2[_0x4973('0x1d')]=qs[_0x4973('0x1d')](_0x15e97d[_0x4973('0x30')][_0x4973('0x1d')]);_0x2183b2['offset']=qs[_0x4973('0x20')](_0x15e97d[_0x4973('0x30')][_0x4973('0x20')]);}return _0x2a6a50['getFields'](_0x2183b2);}})[_0x4973('0x25')](function(_0x414345){if(_0x414345){return _0x414345?{'count':_0x780bf5,'rows':_0x414345}:null;}})[_0x4973('0x25')](respondWithResult(_0x138bca,null))[_0x4973('0x47')](handleError(_0x138bca,null));};exports[_0x4973('0x4b')]=function(_0x1c5a4c,_0x4ce2fe,_0x202d1d){var _0x5a51f6={};var _0x5f4054={};var _0x5845f8;var _0x516bad;return db[_0x4973('0x2b')]['findOne']({'where':{'id':_0x1c5a4c[_0x4973('0x44')]['id']}})[_0x4973('0x25')](handleEntityNotFound(_0x4ce2fe,null))[_0x4973('0x25')](function(_0x35b4a9){if(_0x35b4a9){_0x5845f8=_0x35b4a9;_0x5f4054[_0x4973('0x2e')]=_[_0x4973('0x2f')](db[_0x4973('0x49')][_0x4973('0x2c')]);_0x5f4054[_0x4973('0x30')]=_['keys'](_0x1c5a4c['query']);_0x5f4054[_0x4973('0x39')]=_[_0x4973('0x32')](_0x5f4054[_0x4973('0x2e')],_0x5f4054['query']);_0x5a51f6['attributes']=_['intersection'](_0x5f4054[_0x4973('0x2e')],qs[_0x4973('0x33')](_0x1c5a4c[_0x4973('0x30')][_0x4973('0x33')]));_0x5a51f6[_0x4973('0x31')]=_0x5a51f6['attributes'][_0x4973('0x34')]?_0x5a51f6['attributes']:_0x5f4054[_0x4973('0x2e')];_0x5a51f6['order']=qs[_0x4973('0x36')](_0x1c5a4c[_0x4973('0x30')][_0x4973('0x36')]);_0x5a51f6['where']=qs[_0x4973('0x39')](_[_0x4973('0x38')](_0x1c5a4c['query'],_0x5f4054[_0x4973('0x39')]));if(_0x1c5a4c['query'][_0x4973('0x3d')]){_0x5a51f6[_0x4973('0x37')]=_[_0x4973('0x3a')](_0x5a51f6[_0x4973('0x37')],{'$or':_[_0x4973('0x2a')](_0x5a51f6[_0x4973('0x31')],function(_0x3be33a){var _0x3fb791={};_0x3fb791[_0x3be33a]={'$like':'%'+_0x1c5a4c['query']['filter']+'%'};return _0x3fb791;})});}_0x5a51f6=_[_0x4973('0x3a')]({},_0x5a51f6,_0x1c5a4c['options']);return _0x5845f8[_0x4973('0x4b')](_0x5a51f6);}})[_0x4973('0x25')](function(_0x6801d){if(_0x6801d){_0x516bad=_0x6801d[_0x4973('0x34')];if(!_0x1c5a4c[_0x4973('0x30')]['hasOwnProperty']('nolimit')){_0x5a51f6[_0x4973('0x1d')]=qs[_0x4973('0x1d')](_0x1c5a4c[_0x4973('0x30')][_0x4973('0x1d')]);_0x5a51f6['offset']=qs['offset'](_0x1c5a4c[_0x4973('0x30')][_0x4973('0x20')]);}return _0x5845f8[_0x4973('0x4b')](_0x5a51f6);}})[_0x4973('0x25')](function(_0x3e46be){if(_0x3e46be){return _0x3e46be?{'count':_0x516bad,'rows':_0x3e46be}:null;}})[_0x4973('0x25')](respondWithResult(_0x4ce2fe,null))[_0x4973('0x47')](handleError(_0x4ce2fe,null));};exports[_0x4973('0x4c')]=function(_0x79e1be,_0x1b4a31,_0x17cf62){var _0x55b44b={};var _0x27f028={};var _0x535df9;var _0x3a55a8;return db[_0x4973('0x2b')][_0x4973('0x48')]({'where':{'id':_0x79e1be[_0x4973('0x44')]['id']}})[_0x4973('0x25')](handleEntityNotFound(_0x1b4a31,null))[_0x4973('0x25')](function(_0x525734){if(_0x525734){_0x535df9=_0x525734;_0x27f028[_0x4973('0x2e')]=_[_0x4973('0x2f')](db[_0x4973('0x49')][_0x4973('0x2c')]);_0x27f028[_0x4973('0x30')]=_[_0x4973('0x2f')](_0x79e1be[_0x4973('0x30')]);_0x27f028['filters']=_[_0x4973('0x32')](_0x27f028[_0x4973('0x2e')],_0x27f028[_0x4973('0x30')]);_0x55b44b[_0x4973('0x31')]=_['intersection'](_0x27f028['model'],qs[_0x4973('0x33')](_0x79e1be[_0x4973('0x30')][_0x4973('0x33')]));_0x55b44b[_0x4973('0x31')]=_0x55b44b[_0x4973('0x31')][_0x4973('0x34')]?_0x55b44b[_0x4973('0x31')]:_0x27f028[_0x4973('0x2e')];_0x55b44b[_0x4973('0x4d')]=qs['sort'](_0x79e1be[_0x4973('0x30')][_0x4973('0x36')]);_0x55b44b[_0x4973('0x37')]=qs[_0x4973('0x39')](_[_0x4973('0x38')](_0x79e1be[_0x4973('0x30')],_0x27f028[_0x4973('0x39')]));if(_0x79e1be[_0x4973('0x30')][_0x4973('0x3d')]){_0x55b44b['where']=_[_0x4973('0x3a')](_0x55b44b[_0x4973('0x37')],{'$or':_[_0x4973('0x2a')](_0x55b44b[_0x4973('0x31')],function(_0x4c2bff){var _0x5e2323={};_0x5e2323[_0x4c2bff]={'$like':'%'+_0x79e1be[_0x4973('0x30')][_0x4973('0x3d')]+'%'};return _0x5e2323;})});}_0x55b44b=_[_0x4973('0x3a')]({},_0x55b44b,_0x79e1be[_0x4973('0x3e')]);return _0x535df9[_0x4973('0x4c')](_0x55b44b);}})[_0x4973('0x25')](function(_0x1e86fa){if(_0x1e86fa){_0x3a55a8=_0x1e86fa['length'];if(!_0x79e1be['query'][_0x4973('0x35')](_0x4973('0x4e'))){_0x55b44b['limit']=qs['limit'](_0x79e1be[_0x4973('0x30')][_0x4973('0x1d')]);_0x55b44b['offset']=qs[_0x4973('0x20')](_0x79e1be['query'][_0x4973('0x20')]);}return _0x535df9[_0x4973('0x4c')](_0x55b44b);}})['then'](function(_0x217323){if(_0x217323){return _0x217323?{'count':_0x3a55a8,'rows':_0x217323}:null;}})['then'](respondWithResult(_0x1b4a31,null))[_0x4973('0x47')](handleError(_0x1b4a31,null));}; \ No newline at end of file +var _0xb484=['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','sendStatus','status','json','offset','limit','count','reject','save','update','destroy','then','end','error','stack','name','send','index','map','VtigerConfiguration','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','findOne','VtigerField','rawAttributes','getFields','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x16d4db,_0x5d3c4e){var _0x1da3ed=function(_0x47820c){while(--_0x47820c){_0x16d4db['push'](_0x16d4db['shift']());}};_0x1da3ed(++_0x5d3c4e);}(_0xb484,0x18b));var _0x4b48=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xb484[_0x307d86];return _0x361745;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4b48('0x0'));var jsonpatch=require(_0x4b48('0x1'));var rp=require(_0x4b48('0x2'));var moment=require('moment');var BPromise=require(_0x4b48('0x3'));var Mustache=require('mustache');var util=require(_0x4b48('0x4'));var path=require(_0x4b48('0x5'));var sox=require(_0x4b48('0x6'));var csv=require(_0x4b48('0x7'));var ejs=require(_0x4b48('0x8'));var fs=require('fs');var fs_extra=require(_0x4b48('0x9'));var _=require(_0x4b48('0xa'));var squel=require('squel');var crypto=require(_0x4b48('0xb'));var jsforce=require(_0x4b48('0xc'));var deskjs=require(_0x4b48('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4b48('0xe'));var Papa=require(_0x4b48('0xf'));var Redis=require(_0x4b48('0x10'));var authService=require(_0x4b48('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4b48('0x12'));var hardwareService=require(_0x4b48('0x13'));var logger=require(_0x4b48('0x14'))(_0x4b48('0x15'));var utils=require(_0x4b48('0x16'));var config=require(_0x4b48('0x17'));var licenseUtil=require(_0x4b48('0x18'));var db=require(_0x4b48('0x19'))['db'];function respondWithStatusCode(_0x1ba77b,_0x796157){_0x796157=_0x796157||0xcc;return function(_0x2f8a2){if(_0x2f8a2){return _0x1ba77b[_0x4b48('0x1a')](_0x796157);}return _0x1ba77b[_0x4b48('0x1b')](_0x796157)['end']();};}function respondWithResult(_0x18060f,_0x504671){_0x504671=_0x504671||0xc8;return function(_0x33b575){if(_0x33b575){return _0x18060f['status'](_0x504671)[_0x4b48('0x1c')](_0x33b575);}};}function respondWithFilteredResult(_0x4c372,_0xe0ad3d){return function(_0x23f3c){if(_0x23f3c){var _0x4468a6=typeof _0xe0ad3d[_0x4b48('0x1d')]==='undefined'&&typeof _0xe0ad3d[_0x4b48('0x1e')]==='undefined';var _0x51a3b7=_0x23f3c[_0x4b48('0x1f')];var _0x5ee319=_0x4468a6?0x0:_0xe0ad3d[_0x4b48('0x1d')];var _0x5c2748=_0x4468a6?_0x23f3c[_0x4b48('0x1f')]:_0xe0ad3d[_0x4b48('0x1d')]+_0xe0ad3d['limit'];var _0x478ab9;if(_0x5c2748>=_0x51a3b7){_0x5c2748=_0x51a3b7;_0x478ab9=0xc8;}else{_0x478ab9=0xce;}_0x4c372[_0x4b48('0x1b')](_0x478ab9);return _0x4c372['set']('Content-Range',_0x5ee319+'-'+_0x5c2748+'/'+_0x51a3b7)[_0x4b48('0x1c')](_0x23f3c);}return null;};}function patchUpdates(_0x30a177){return function(_0x3358da){try{jsonpatch['apply'](_0x3358da,_0x30a177,!![]);}catch(_0x2b05ee){return BPromise[_0x4b48('0x20')](_0x2b05ee);}return _0x3358da[_0x4b48('0x21')]();};}function saveUpdates(_0x5ce31c,_0x597e99){return function(_0x1dcef2){if(_0x1dcef2){return _0x1dcef2[_0x4b48('0x22')](_0x5ce31c)['then'](function(_0x277595){return _0x277595;});}return null;};}function removeEntity(_0x3b5c6f,_0x3ea6a8){return function(_0x3a4e89){if(_0x3a4e89){return _0x3a4e89[_0x4b48('0x23')]()[_0x4b48('0x24')](function(){_0x3b5c6f['status'](0xcc)[_0x4b48('0x25')]();});}};}function handleEntityNotFound(_0x1d0312,_0xb664b5){return function(_0xebdc7c){if(!_0xebdc7c){_0x1d0312[_0x4b48('0x1a')](0x194);}return _0xebdc7c;};}function handleError(_0xdce44b,_0x5c88b9){_0x5c88b9=_0x5c88b9||0x1f4;return function(_0x1d7a33){logger[_0x4b48('0x26')](_0x1d7a33[_0x4b48('0x27')]);if(_0x1d7a33[_0x4b48('0x28')]){delete _0x1d7a33[_0x4b48('0x28')];}_0xdce44b['status'](_0x5c88b9)[_0x4b48('0x29')](_0x1d7a33);};}exports[_0x4b48('0x2a')]=function(_0xa587c0,_0x6e7ca4){var _0x265737={},_0xbed669={},_0x51c911={'count':0x0,'rows':[]};var _0x54c0cd=_[_0x4b48('0x2b')](db[_0x4b48('0x2c')]['rawAttributes'],function(_0x264c6f){return{'name':_0x264c6f[_0x4b48('0x2d')],'type':_0x264c6f[_0x4b48('0x2e')]['key']};});_0xbed669[_0x4b48('0x2f')]=_['map'](_0x54c0cd,_0x4b48('0x28'));_0xbed669[_0x4b48('0x30')]=_[_0x4b48('0x31')](_0xa587c0['query']);_0xbed669[_0x4b48('0x32')]=_[_0x4b48('0x33')](_0xbed669['model'],_0xbed669[_0x4b48('0x30')]);_0x265737['attributes']=_[_0x4b48('0x33')](_0xbed669[_0x4b48('0x2f')],qs[_0x4b48('0x34')](_0xa587c0['query'][_0x4b48('0x34')]));_0x265737[_0x4b48('0x35')]=_0x265737[_0x4b48('0x35')][_0x4b48('0x36')]?_0x265737['attributes']:_0xbed669[_0x4b48('0x2f')];if(!_0xa587c0[_0x4b48('0x30')][_0x4b48('0x37')](_0x4b48('0x38'))){_0x265737[_0x4b48('0x1e')]=qs[_0x4b48('0x1e')](_0xa587c0[_0x4b48('0x30')][_0x4b48('0x1e')]);_0x265737[_0x4b48('0x1d')]=qs['offset'](_0xa587c0[_0x4b48('0x30')][_0x4b48('0x1d')]);}_0x265737[_0x4b48('0x39')]=qs[_0x4b48('0x3a')](_0xa587c0['query']['sort']);_0x265737[_0x4b48('0x3b')]=qs[_0x4b48('0x32')](_[_0x4b48('0x3c')](_0xa587c0[_0x4b48('0x30')],_0xbed669['filters']),_0x54c0cd);if(_0xa587c0['query'][_0x4b48('0x3d')]){_0x265737[_0x4b48('0x3b')]=_[_0x4b48('0x3e')](_0x265737[_0x4b48('0x3b')],{'$or':_[_0x4b48('0x2b')](_0x54c0cd,function(_0x4ce9fb){if(_0x4ce9fb['type']!==_0x4b48('0x3f')){var _0xe6dfa3={};_0xe6dfa3[_0x4ce9fb[_0x4b48('0x28')]]={'$like':'%'+_0xa587c0['query'][_0x4b48('0x3d')]+'%'};return _0xe6dfa3;}})});}_0x265737=_[_0x4b48('0x3e')]({},_0x265737,_0xa587c0['options']);var _0xc79360={'where':_0x265737[_0x4b48('0x3b')]};return db[_0x4b48('0x2c')][_0x4b48('0x1f')](_0xc79360)[_0x4b48('0x24')](function(_0x291430){_0x51c911[_0x4b48('0x1f')]=_0x291430;if(_0xa587c0[_0x4b48('0x30')][_0x4b48('0x40')]){_0x265737['include']=[{'all':!![]}];}return db[_0x4b48('0x2c')]['findAll'](_0x265737);})['then'](function(_0x54b5e0){_0x51c911[_0x4b48('0x41')]=_0x54b5e0;return _0x51c911;})[_0x4b48('0x24')](respondWithFilteredResult(_0x6e7ca4,_0x265737))[_0x4b48('0x42')](handleError(_0x6e7ca4,null));};exports[_0x4b48('0x43')]=function(_0x1cfd76,_0x3f2993){var _0x15fefb={'raw':![],'where':{'id':_0x1cfd76[_0x4b48('0x44')]['id']}},_0x14c44b={};_0x14c44b[_0x4b48('0x2f')]=_[_0x4b48('0x31')](db[_0x4b48('0x2c')]['rawAttributes']);_0x14c44b[_0x4b48('0x30')]=_['keys'](_0x1cfd76['query']);_0x14c44b[_0x4b48('0x32')]=_['intersection'](_0x14c44b['model'],_0x14c44b['query']);_0x15fefb[_0x4b48('0x35')]=_[_0x4b48('0x33')](_0x14c44b[_0x4b48('0x2f')],qs[_0x4b48('0x34')](_0x1cfd76[_0x4b48('0x30')][_0x4b48('0x34')]));_0x15fefb[_0x4b48('0x35')]=_0x15fefb[_0x4b48('0x35')][_0x4b48('0x36')]?_0x15fefb[_0x4b48('0x35')]:_0x14c44b[_0x4b48('0x2f')];if(_0x1cfd76[_0x4b48('0x30')]['includeAll']){_0x15fefb[_0x4b48('0x45')]=[{'all':!![]}];}_0x15fefb=_[_0x4b48('0x3e')]({},_0x15fefb,_0x1cfd76[_0x4b48('0x46')]);return db['VtigerConfiguration'][_0x4b48('0x47')](_0x15fefb)[_0x4b48('0x24')](handleEntityNotFound(_0x3f2993,null))['then'](respondWithResult(_0x3f2993,null))[_0x4b48('0x42')](handleError(_0x3f2993,null));};exports[_0x4b48('0x48')]=function(_0x293e47,_0x1e873c){return db['VtigerConfiguration'][_0x4b48('0x48')](_0x293e47[_0x4b48('0x49')],{})['then'](respondWithResult(_0x1e873c,0xc9))['catch'](handleError(_0x1e873c,null));};exports[_0x4b48('0x22')]=function(_0x3dcc93,_0x11060d){if(_0x3dcc93['body']['id']){delete _0x3dcc93['body']['id'];}return db[_0x4b48('0x2c')]['find']({'where':{'id':_0x3dcc93[_0x4b48('0x44')]['id']}})[_0x4b48('0x24')](handleEntityNotFound(_0x11060d,null))[_0x4b48('0x24')](saveUpdates(_0x3dcc93[_0x4b48('0x49')],null))[_0x4b48('0x24')](respondWithResult(_0x11060d,null))[_0x4b48('0x42')](handleError(_0x11060d,null));};exports[_0x4b48('0x23')]=function(_0x5bf899,_0x1ee014){return db['VtigerConfiguration'][_0x4b48('0x47')]({'where':{'id':_0x5bf899[_0x4b48('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ee014,null))[_0x4b48('0x24')](removeEntity(_0x1ee014,null))[_0x4b48('0x42')](handleError(_0x1ee014,null));};exports['getFields']=function(_0x58d484,_0x17fe60,_0x1ba8fd){var _0x127767={};var _0x59af3d={};var _0x7cdd47;var _0x59f732;return db[_0x4b48('0x2c')][_0x4b48('0x4a')]({'where':{'id':_0x58d484[_0x4b48('0x44')]['id']}})[_0x4b48('0x24')](handleEntityNotFound(_0x17fe60,null))[_0x4b48('0x24')](function(_0x3db1aa){if(_0x3db1aa){_0x7cdd47=_0x3db1aa;_0x59af3d[_0x4b48('0x2f')]=_[_0x4b48('0x31')](db[_0x4b48('0x4b')][_0x4b48('0x4c')]);_0x59af3d['query']=_['keys'](_0x58d484['query']);_0x59af3d[_0x4b48('0x32')]=_[_0x4b48('0x33')](_0x59af3d[_0x4b48('0x2f')],_0x59af3d['query']);_0x127767[_0x4b48('0x35')]=_[_0x4b48('0x33')](_0x59af3d['model'],qs[_0x4b48('0x34')](_0x58d484[_0x4b48('0x30')][_0x4b48('0x34')]));_0x127767['attributes']=_0x127767[_0x4b48('0x35')][_0x4b48('0x36')]?_0x127767[_0x4b48('0x35')]:_0x59af3d[_0x4b48('0x2f')];_0x127767[_0x4b48('0x39')]=qs['sort'](_0x58d484[_0x4b48('0x30')][_0x4b48('0x3a')]);_0x127767[_0x4b48('0x3b')]=qs[_0x4b48('0x32')](_['pick'](_0x58d484[_0x4b48('0x30')],_0x59af3d[_0x4b48('0x32')]));if(_0x58d484[_0x4b48('0x30')][_0x4b48('0x3d')]){_0x127767[_0x4b48('0x3b')]=_['merge'](_0x127767[_0x4b48('0x3b')],{'$or':_[_0x4b48('0x2b')](_0x127767[_0x4b48('0x35')],function(_0x32d589){var _0x254491={};_0x254491[_0x32d589]={'$like':'%'+_0x58d484['query'][_0x4b48('0x3d')]+'%'};return _0x254491;})});}_0x127767=_[_0x4b48('0x3e')]({},_0x127767,_0x58d484[_0x4b48('0x46')]);return _0x7cdd47[_0x4b48('0x4d')](_0x127767);}})[_0x4b48('0x24')](function(_0x112a68){if(_0x112a68){_0x59f732=_0x112a68[_0x4b48('0x36')];if(!_0x58d484[_0x4b48('0x30')]['hasOwnProperty'](_0x4b48('0x38'))){_0x127767['limit']=qs[_0x4b48('0x1e')](_0x58d484[_0x4b48('0x30')][_0x4b48('0x1e')]);_0x127767[_0x4b48('0x1d')]=qs['offset'](_0x58d484[_0x4b48('0x30')][_0x4b48('0x1d')]);}return _0x7cdd47['getFields'](_0x127767);}})[_0x4b48('0x24')](function(_0x222b64){if(_0x222b64){return _0x222b64?{'count':_0x59f732,'rows':_0x222b64}:null;}})[_0x4b48('0x24')](respondWithResult(_0x17fe60,null))[_0x4b48('0x42')](handleError(_0x17fe60,null));};exports[_0x4b48('0x4e')]=function(_0x2bc0d3,_0x1d3a37,_0x3d2400){var _0xf04d42={};var _0x5990de={};var _0x460a71;var _0x52242b;return db[_0x4b48('0x2c')][_0x4b48('0x4a')]({'where':{'id':_0x2bc0d3[_0x4b48('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d3a37,null))['then'](function(_0x497a56){if(_0x497a56){_0x460a71=_0x497a56;_0x5990de[_0x4b48('0x2f')]=_['keys'](db[_0x4b48('0x4b')][_0x4b48('0x4c')]);_0x5990de[_0x4b48('0x30')]=_[_0x4b48('0x31')](_0x2bc0d3[_0x4b48('0x30')]);_0x5990de[_0x4b48('0x32')]=_[_0x4b48('0x33')](_0x5990de[_0x4b48('0x2f')],_0x5990de[_0x4b48('0x30')]);_0xf04d42[_0x4b48('0x35')]=_[_0x4b48('0x33')](_0x5990de[_0x4b48('0x2f')],qs['fields'](_0x2bc0d3[_0x4b48('0x30')][_0x4b48('0x34')]));_0xf04d42[_0x4b48('0x35')]=_0xf04d42['attributes'][_0x4b48('0x36')]?_0xf04d42['attributes']:_0x5990de['model'];_0xf04d42[_0x4b48('0x39')]=qs[_0x4b48('0x3a')](_0x2bc0d3['query'][_0x4b48('0x3a')]);_0xf04d42[_0x4b48('0x3b')]=qs[_0x4b48('0x32')](_['pick'](_0x2bc0d3[_0x4b48('0x30')],_0x5990de[_0x4b48('0x32')]));if(_0x2bc0d3[_0x4b48('0x30')][_0x4b48('0x3d')]){_0xf04d42[_0x4b48('0x3b')]=_[_0x4b48('0x3e')](_0xf04d42['where'],{'$or':_[_0x4b48('0x2b')](_0xf04d42[_0x4b48('0x35')],function(_0x584c45){var _0x1a01a1={};_0x1a01a1[_0x584c45]={'$like':'%'+_0x2bc0d3[_0x4b48('0x30')][_0x4b48('0x3d')]+'%'};return _0x1a01a1;})});}_0xf04d42=_[_0x4b48('0x3e')]({},_0xf04d42,_0x2bc0d3[_0x4b48('0x46')]);return _0x460a71['getSubjects'](_0xf04d42);}})[_0x4b48('0x24')](function(_0xa06c6){if(_0xa06c6){_0x52242b=_0xa06c6[_0x4b48('0x36')];if(!_0x2bc0d3[_0x4b48('0x30')][_0x4b48('0x37')]('nolimit')){_0xf04d42[_0x4b48('0x1e')]=qs[_0x4b48('0x1e')](_0x2bc0d3[_0x4b48('0x30')][_0x4b48('0x1e')]);_0xf04d42[_0x4b48('0x1d')]=qs[_0x4b48('0x1d')](_0x2bc0d3['query'][_0x4b48('0x1d')]);}return _0x460a71[_0x4b48('0x4e')](_0xf04d42);}})[_0x4b48('0x24')](function(_0x320555){if(_0x320555){return _0x320555?{'count':_0x52242b,'rows':_0x320555}:null;}})[_0x4b48('0x24')](respondWithResult(_0x1d3a37,null))[_0x4b48('0x42')](handleError(_0x1d3a37,null));};exports[_0x4b48('0x4f')]=function(_0x5831ec,_0xd56f85,_0x399693){var _0xe95c3d={};var _0x8c3518={};var _0x56864c;var _0x1d2728;return db[_0x4b48('0x2c')][_0x4b48('0x4a')]({'where':{'id':_0x5831ec[_0x4b48('0x44')]['id']}})[_0x4b48('0x24')](handleEntityNotFound(_0xd56f85,null))['then'](function(_0x5c3376){if(_0x5c3376){_0x56864c=_0x5c3376;_0x8c3518[_0x4b48('0x2f')]=_[_0x4b48('0x31')](db['VtigerField'][_0x4b48('0x4c')]);_0x8c3518[_0x4b48('0x30')]=_[_0x4b48('0x31')](_0x5831ec['query']);_0x8c3518[_0x4b48('0x32')]=_[_0x4b48('0x33')](_0x8c3518[_0x4b48('0x2f')],_0x8c3518[_0x4b48('0x30')]);_0xe95c3d[_0x4b48('0x35')]=_['intersection'](_0x8c3518[_0x4b48('0x2f')],qs[_0x4b48('0x34')](_0x5831ec[_0x4b48('0x30')]['fields']));_0xe95c3d[_0x4b48('0x35')]=_0xe95c3d['attributes'][_0x4b48('0x36')]?_0xe95c3d['attributes']:_0x8c3518[_0x4b48('0x2f')];_0xe95c3d[_0x4b48('0x39')]=qs['sort'](_0x5831ec[_0x4b48('0x30')][_0x4b48('0x3a')]);_0xe95c3d[_0x4b48('0x3b')]=qs[_0x4b48('0x32')](_[_0x4b48('0x3c')](_0x5831ec[_0x4b48('0x30')],_0x8c3518['filters']));if(_0x5831ec[_0x4b48('0x30')]['filter']){_0xe95c3d[_0x4b48('0x3b')]=_[_0x4b48('0x3e')](_0xe95c3d['where'],{'$or':_[_0x4b48('0x2b')](_0xe95c3d['attributes'],function(_0x1cae77){var _0x549a52={};_0x549a52[_0x1cae77]={'$like':'%'+_0x5831ec[_0x4b48('0x30')][_0x4b48('0x3d')]+'%'};return _0x549a52;})});}_0xe95c3d=_['merge']({},_0xe95c3d,_0x5831ec[_0x4b48('0x46')]);return _0x56864c[_0x4b48('0x4f')](_0xe95c3d);}})[_0x4b48('0x24')](function(_0x59fc4b){if(_0x59fc4b){_0x1d2728=_0x59fc4b[_0x4b48('0x36')];if(!_0x5831ec[_0x4b48('0x30')][_0x4b48('0x37')](_0x4b48('0x38'))){_0xe95c3d[_0x4b48('0x1e')]=qs[_0x4b48('0x1e')](_0x5831ec[_0x4b48('0x30')][_0x4b48('0x1e')]);_0xe95c3d[_0x4b48('0x1d')]=qs[_0x4b48('0x1d')](_0x5831ec[_0x4b48('0x30')][_0x4b48('0x1d')]);}return _0x56864c[_0x4b48('0x4f')](_0xe95c3d);}})[_0x4b48('0x24')](function(_0x52477d){if(_0x52477d){return _0x52477d?{'count':_0x1d2728,'rows':_0x52477d}:null;}})['then'](respondWithResult(_0xd56f85,null))[_0x4b48('0x42')](handleError(_0xd56f85,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 538a45e..f287471 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 _0x82b7=['int_vtiger_configurations','lodash','util','moment','request-promise','path','rimraf','../../config/environment','exports','define','VtigerConfiguration'];(function(_0x3574a8,_0x1518f6){var _0x39e71b=function(_0x184661){while(--_0x184661){_0x3574a8['push'](_0x3574a8['shift']());}};_0x39e71b(++_0x1518f6);}(_0x82b7,0xd2));var _0x782b=function(_0x1eeec1,_0x5ac663){_0x1eeec1=_0x1eeec1-0x0;var _0x23ba86=_0x82b7[_0x1eeec1];return _0x23ba86;};'use strict';var _=require(_0x782b('0x0'));var util=require(_0x782b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x782b('0x2'));var BPromise=require('bluebird');var rp=require(_0x782b('0x3'));var fs=require('fs');var path=require(_0x782b('0x4'));var rimraf=require(_0x782b('0x5'));var config=require(_0x782b('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x782b('0x7')]=function(_0x288d61,_0x25a028){return _0x288d61[_0x782b('0x8')](_0x782b('0x9'),attributes,{'tableName':_0x782b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4278=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations'];(function(_0x4c782f,_0x5eaaa4){var _0x4b490d=function(_0x339048){while(--_0x339048){_0x4c782f['push'](_0x4c782f['shift']());}};_0x4b490d(++_0x5eaaa4);}(_0x4278,0x197));var _0x8427=function(_0x4e1bee,_0x2b8a0f){_0x4e1bee=_0x4e1bee-0x0;var _0x98fa85=_0x4278[_0x4e1bee];return _0x98fa85;};'use strict';var _=require(_0x8427('0x0'));var util=require(_0x8427('0x1'));var logger=require(_0x8427('0x2'))(_0x8427('0x3'));var moment=require(_0x8427('0x4'));var BPromise=require(_0x8427('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8427('0x6'));var rimraf=require(_0x8427('0x7'));var config=require('../../config/environment');var attributes=require(_0x8427('0x8'));module['exports']=function(_0x3d998d,_0x1f17f8){return _0x3d998d['define'](_0x8427('0x9'),attributes,{'tableName':_0x8427('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index f6e2843..a9ac1a4 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 _0x1f23=['stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x28f775,_0x2f4a03){var _0x154aa1=function(_0x9f89d1){while(--_0x9f89d1){_0x28f775['push'](_0x28f775['shift']());}};_0x154aa1(++_0x2f4a03);}(_0x1f23,0x167));var _0x31f2=function(_0x45932f,_0x2e05f6){_0x45932f=_0x45932f-0x0;var _0x4fbce9=_0x1f23[_0x45932f];return _0x4fbce9;};'use strict';var _=require(_0x31f2('0x0'));var util=require(_0x31f2('0x1'));var moment=require('moment');var BPromise=require(_0x31f2('0x2'));var rs=require(_0x31f2('0x3'));var fs=require('fs');var Redis=require(_0x31f2('0x4'));var db=require(_0x31f2('0x5'))['db'];var utils=require(_0x31f2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x31f2('0x7'));var jayson=require(_0x31f2('0x8'));var client=jayson[_0x31f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5497a4,_0x2ff2aa,_0x357b1d){return new BPromise(function(_0x576224,_0x462746){return client[_0x31f2('0xa')](_0x5497a4,_0x357b1d)[_0x31f2('0xb')](function(_0x410524){logger[_0x31f2('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x2ff2aa,_0x31f2('0xd'));logger['debug'](_0x31f2('0xe'),_0x2ff2aa,_0x31f2('0xd'),JSON[_0x31f2('0xf')](_0x410524));if(_0x410524[_0x31f2('0x10')]){if(_0x410524[_0x31f2('0x10')][_0x31f2('0x11')]===0x1f4){logger[_0x31f2('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x2ff2aa,_0x410524['error']['message']);return _0x462746(_0x410524['error'][_0x31f2('0x12')]);}logger['error'](_0x31f2('0x13'),_0x2ff2aa,_0x410524[_0x31f2('0x10')]['message']);return _0x576224(_0x410524[_0x31f2('0x10')][_0x31f2('0x12')]);}else{logger['info'](_0x31f2('0x13'),_0x2ff2aa,_0x31f2('0xd'));_0x576224(_0x410524[_0x31f2('0x14')][_0x31f2('0x12')]);}})[_0x31f2('0x15')](function(_0x4f7d0a){logger[_0x31f2('0x10')](_0x31f2('0x13'),_0x2ff2aa,_0x4f7d0a);_0x462746(_0x4f7d0a);});});} \ No newline at end of file +var _0x4272=['stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x4272,0x13e));var _0x2427=function(_0x13c1bc,_0x5a7fdd){_0x13c1bc=_0x13c1bc-0x0;var _0x2780d5=_0x4272[_0x13c1bc];return _0x2780d5;};'use strict';var _=require(_0x2427('0x0'));var util=require('util');var moment=require(_0x2427('0x1'));var BPromise=require(_0x2427('0x2'));var rs=require(_0x2427('0x3'));var fs=require('fs');var Redis=require(_0x2427('0x4'));var db=require(_0x2427('0x5'))['db'];var utils=require(_0x2427('0x6'));var logger=require(_0x2427('0x7'))(_0x2427('0x8'));var config=require('../../config/environment');var jayson=require(_0x2427('0x9'));var client=jayson[_0x2427('0xa')][_0x2427('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x757f0,_0x41ca99,_0x4133e4){return new BPromise(function(_0x461877,_0x5a241f){return client['request'](_0x757f0,_0x4133e4)[_0x2427('0xc')](function(_0x4dea95){logger[_0x2427('0xd')](_0x2427('0xe'),_0x41ca99,_0x2427('0xf'));logger[_0x2427('0x10')](_0x2427('0x11'),_0x41ca99,_0x2427('0xf'),JSON[_0x2427('0x12')](_0x4dea95));if(_0x4dea95['error']){if(_0x4dea95['error'][_0x2427('0x13')]===0x1f4){logger['error'](_0x2427('0xe'),_0x41ca99,_0x4dea95[_0x2427('0x14')][_0x2427('0x15')]);return _0x5a241f(_0x4dea95[_0x2427('0x14')][_0x2427('0x15')]);}logger[_0x2427('0x14')](_0x2427('0xe'),_0x41ca99,_0x4dea95['error'][_0x2427('0x15')]);return _0x461877(_0x4dea95[_0x2427('0x14')]['message']);}else{logger[_0x2427('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x41ca99,_0x2427('0xf'));_0x461877(_0x4dea95[_0x2427('0x16')]['message']);}})[_0x2427('0x17')](function(_0x14070f){logger[_0x2427('0x14')](_0x2427('0xe'),_0x41ca99,_0x14070f);_0x5a241f(_0x14070f);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 03c6d9c..673eb50 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 _0xc615=['multer','util','path','Router','fs-extra','../../config/environment','./intVtigerField.controller','isAuthenticated','/:id','show','create','put','delete','exports'];(function(_0xdac0c6,_0x10dd44){var _0x2fe97d=function(_0x5d622d){while(--_0x5d622d){_0xdac0c6['push'](_0xdac0c6['shift']());}};_0x2fe97d(++_0x10dd44);}(_0xc615,0x1ce));var _0x5c61=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0xc615[_0x38ff1e];return _0x3755d4;};'use strict';var multer=require(_0x5c61('0x0'));var util=require(_0x5c61('0x1'));var path=require(_0x5c61('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5c61('0x3')]();var fs_extra=require(_0x5c61('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5c61('0x5'));var controller=require(_0x5c61('0x6'));router['get']('/',auth[_0x5c61('0x7')](),controller['index']);router['get'](_0x5c61('0x8'),auth[_0x5c61('0x7')](),controller[_0x5c61('0x9')]);router['post']('/',auth[_0x5c61('0x7')](),controller[_0x5c61('0xa')]);router[_0x5c61('0xb')](_0x5c61('0x8'),auth[_0x5c61('0x7')](),controller['update']);router[_0x5c61('0xc')]('/:id',auth[_0x5c61('0x7')](),controller['destroy']);module[_0x5c61('0xd')]=router; \ No newline at end of file +var _0x8ce1=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0x8ce1,0x193));var _0x18ce=function(_0x41b9f1,_0x39acf4){_0x41b9f1=_0x41b9f1-0x0;var _0x31943b=_0x8ce1[_0x41b9f1];return _0x31943b;};'use strict';var multer=require('multer');var util=require(_0x18ce('0x0'));var path=require('path');var timeout=require(_0x18ce('0x1'));var express=require(_0x18ce('0x2'));var router=express[_0x18ce('0x3')]();var fs_extra=require(_0x18ce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x18ce('0x5'));var config=require(_0x18ce('0x6'));var controller=require(_0x18ce('0x7'));router['get']('/',auth[_0x18ce('0x8')](),controller[_0x18ce('0x9')]);router[_0x18ce('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0xb')]);router[_0x18ce('0xc')]('/',auth['isAuthenticated'](),controller[_0x18ce('0xd')]);router[_0x18ce('0xe')](_0x18ce('0xf'),auth[_0x18ce('0x8')](),controller[_0x18ce('0x10')]);router[_0x18ce('0x11')](_0x18ce('0xf'),auth['isAuthenticated'](),controller[_0x18ce('0x12')]);module[_0x18ce('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2e019d0..b873777 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 _0xb142=['customVariable','picklist','STRING','ENUM','string','variable'];(function(_0x25860e,_0x50d2a5){var _0x4232ae=function(_0x322923){while(--_0x322923){_0x25860e['push'](_0x25860e['shift']());}};_0x4232ae(++_0x50d2a5);}(_0xb142,0x19b));var _0x2b14=function(_0x18049e,_0x1e2c36){_0x18049e=_0x18049e-0x0;var _0x57ee91=_0xb142[_0x18049e];return _0x57ee91;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2b14('0x0')](_0x2b14('0x1'),_0x2b14('0x2'),_0x2b14('0x3'),'keyValue',_0x2b14('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2b14('0x5')]},'key':{'type':Sequelize[_0x2b14('0x5')]},'keyType':{'type':Sequelize[_0x2b14('0x0')](_0x2b14('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2b14('0x5')]},'idField':{'type':Sequelize[_0x2b14('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b14('0x5')]}}; \ No newline at end of file +var _0xb554=['customVariable','keyValue','STRING','ENUM','BOOLEAN','string'];(function(_0x25838e,_0xa2515c){var _0xe3080f=function(_0x2dfc78){while(--_0x2dfc78){_0x25838e['push'](_0x25838e['shift']());}};_0xe3080f(++_0xa2515c);}(_0xb554,0x197));var _0x4b55=function(_0x1f90af,_0x115a35){_0x1f90af=_0x1f90af-0x0;var _0x392001=_0xb554[_0x1f90af];return _0x392001;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x4b55('0x0'),'variable',_0x4b55('0x1'),_0x4b55('0x2'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x4b55('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4b55('0x4')](_0x4b55('0x0'),'variable',_0x4b55('0x1'))},'keyContent':{'type':Sequelize[_0x4b55('0x3')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4b55('0x3')]},'customField':{'type':Sequelize[_0x4b55('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4b55('0x3')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 36aa872..3c95fbf 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 _0xb39b=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','then','end','error','stack','send','index','map','VtigerField','rawAttributes','fieldName','key','model','name','intersection','query','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','type','VIRTUAL','merge','options','include','findAll','show','params','length','includeAll','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0xab35e1,_0x48b46b){var _0x1dbb70=function(_0x155600){while(--_0x155600){_0xab35e1['push'](_0xab35e1['shift']());}};_0x1dbb70(++_0x48b46b);}(_0xb39b,0x16c));var _0xbb39=function(_0x2201f3,_0x298319){_0x2201f3=_0x2201f3-0x0;var _0xff133=_0xb39b[_0x2201f3];return _0xff133;};'use strict';var emlformat=require(_0xbb39('0x0'));var rimraf=require(_0xbb39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb39('0x2'));var rp=require(_0xbb39('0x3'));var moment=require(_0xbb39('0x4'));var BPromise=require(_0xbb39('0x5'));var Mustache=require(_0xbb39('0x6'));var util=require(_0xbb39('0x7'));var path=require(_0xbb39('0x8'));var sox=require(_0xbb39('0x9'));var csv=require(_0xbb39('0xa'));var ejs=require(_0xbb39('0xb'));var fs=require('fs');var fs_extra=require(_0xbb39('0xc'));var _=require(_0xbb39('0xd'));var squel=require(_0xbb39('0xe'));var crypto=require(_0xbb39('0xf'));var jsforce=require(_0xbb39('0x10'));var deskjs=require(_0xbb39('0x11'));var toCsv=require(_0xbb39('0xa'));var querystring=require(_0xbb39('0x12'));var Papa=require(_0xbb39('0x13'));var Redis=require(_0xbb39('0x14'));var authService=require(_0xbb39('0x15'));var qs=require(_0xbb39('0x16'));var as=require(_0xbb39('0x17'));var hardwareService=require(_0xbb39('0x18'));var logger=require('../../config/logger')(_0xbb39('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbb39('0x1a'))['db'];function respondWithStatusCode(_0x31f88c,_0x3aefff){_0x3aefff=_0x3aefff||0xcc;return function(_0x160e5a){if(_0x160e5a){return _0x31f88c[_0xbb39('0x1b')](_0x3aefff);}return _0x31f88c[_0xbb39('0x1c')](_0x3aefff)['end']();};}function respondWithResult(_0x10d37f,_0x2a2329){_0x2a2329=_0x2a2329||0xc8;return function(_0xc2b2e0){if(_0xc2b2e0){return _0x10d37f['status'](_0x2a2329)[_0xbb39('0x1d')](_0xc2b2e0);}};}function respondWithFilteredResult(_0x58c5fa,_0x2df871){return function(_0x259d7c){if(_0x259d7c){var _0x300535=typeof _0x2df871[_0xbb39('0x1e')]==='undefined'&&typeof _0x2df871[_0xbb39('0x1f')]==='undefined';var _0x5e876e=_0x259d7c[_0xbb39('0x20')];var _0x525929=_0x300535?0x0:_0x2df871['offset'];var _0xb7d5a9=_0x300535?_0x259d7c[_0xbb39('0x20')]:_0x2df871[_0xbb39('0x1e')]+_0x2df871[_0xbb39('0x1f')];var _0x1edb4b;if(_0xb7d5a9>=_0x5e876e){_0xb7d5a9=_0x5e876e;_0x1edb4b=0xc8;}else{_0x1edb4b=0xce;}_0x58c5fa['status'](_0x1edb4b);return _0x58c5fa[_0xbb39('0x21')](_0xbb39('0x22'),_0x525929+'-'+_0xb7d5a9+'/'+_0x5e876e)[_0xbb39('0x1d')](_0x259d7c);}return null;};}function patchUpdates(_0x4b4c70){return function(_0x2b0187){try{jsonpatch[_0xbb39('0x23')](_0x2b0187,_0x4b4c70,!![]);}catch(_0x385c2a){return BPromise['reject'](_0x385c2a);}return _0x2b0187[_0xbb39('0x24')]();};}function saveUpdates(_0x333a84,_0x347098){return function(_0x4086d2){if(_0x4086d2){return _0x4086d2['update'](_0x333a84)[_0xbb39('0x25')](function(_0x554864){return _0x554864;});}return null;};}function removeEntity(_0x31c89e,_0xe302d3){return function(_0x1a23fc){if(_0x1a23fc){return _0x1a23fc['destroy']()[_0xbb39('0x25')](function(){_0x31c89e['status'](0xcc)[_0xbb39('0x26')]();});}};}function handleEntityNotFound(_0x2e5036,_0x5513b7){return function(_0x486f16){if(!_0x486f16){_0x2e5036[_0xbb39('0x1b')](0x194);}return _0x486f16;};}function handleError(_0x2563ea,_0x4cee34){_0x4cee34=_0x4cee34||0x1f4;return function(_0x46dfe0){logger[_0xbb39('0x27')](_0x46dfe0[_0xbb39('0x28')]);if(_0x46dfe0['name']){delete _0x46dfe0['name'];}_0x2563ea[_0xbb39('0x1c')](_0x4cee34)[_0xbb39('0x29')](_0x46dfe0);};}exports[_0xbb39('0x2a')]=function(_0x12a3c1,_0x2a19f2){var _0x2f99ad={},_0x337f58={},_0x4ebd3d={'count':0x0,'rows':[]};var _0x2d8e77=_[_0xbb39('0x2b')](db[_0xbb39('0x2c')][_0xbb39('0x2d')],function(_0x16000f){return{'name':_0x16000f[_0xbb39('0x2e')],'type':_0x16000f['type'][_0xbb39('0x2f')]};});_0x337f58[_0xbb39('0x30')]=_[_0xbb39('0x2b')](_0x2d8e77,_0xbb39('0x31'));_0x337f58['query']=_['keys'](_0x12a3c1['query']);_0x337f58['filters']=_[_0xbb39('0x32')](_0x337f58[_0xbb39('0x30')],_0x337f58[_0xbb39('0x33')]);_0x2f99ad['attributes']=_[_0xbb39('0x32')](_0x337f58[_0xbb39('0x30')],qs['fields'](_0x12a3c1['query'][_0xbb39('0x34')]));_0x2f99ad[_0xbb39('0x35')]=_0x2f99ad['attributes']['length']?_0x2f99ad[_0xbb39('0x35')]:_0x337f58['model'];if(!_0x12a3c1[_0xbb39('0x33')][_0xbb39('0x36')]('nolimit')){_0x2f99ad[_0xbb39('0x1f')]=qs['limit'](_0x12a3c1[_0xbb39('0x33')][_0xbb39('0x1f')]);_0x2f99ad['offset']=qs[_0xbb39('0x1e')](_0x12a3c1['query'][_0xbb39('0x1e')]);}_0x2f99ad[_0xbb39('0x37')]=qs[_0xbb39('0x38')](_0x12a3c1['query'][_0xbb39('0x38')]);_0x2f99ad[_0xbb39('0x39')]=qs[_0xbb39('0x3a')](_['pick'](_0x12a3c1['query'],_0x337f58[_0xbb39('0x3a')]),_0x2d8e77);if(_0x12a3c1['query'][_0xbb39('0x3b')]){_0x2f99ad[_0xbb39('0x39')]=_['merge'](_0x2f99ad[_0xbb39('0x39')],{'$or':_[_0xbb39('0x2b')](_0x2d8e77,function(_0xc90daf){if(_0xc90daf[_0xbb39('0x3c')]!==_0xbb39('0x3d')){var _0x4980f7={};_0x4980f7[_0xc90daf[_0xbb39('0x31')]]={'$like':'%'+_0x12a3c1[_0xbb39('0x33')][_0xbb39('0x3b')]+'%'};return _0x4980f7;}})});}_0x2f99ad=_[_0xbb39('0x3e')]({},_0x2f99ad,_0x12a3c1[_0xbb39('0x3f')]);var _0x9991c7={'where':_0x2f99ad[_0xbb39('0x39')]};return db[_0xbb39('0x2c')][_0xbb39('0x20')](_0x9991c7)[_0xbb39('0x25')](function(_0x13fa06){_0x4ebd3d['count']=_0x13fa06;if(_0x12a3c1[_0xbb39('0x33')]['includeAll']){_0x2f99ad[_0xbb39('0x40')]=[{'all':!![]}];}return db[_0xbb39('0x2c')][_0xbb39('0x41')](_0x2f99ad);})[_0xbb39('0x25')](function(_0x59f460){_0x4ebd3d['rows']=_0x59f460;return _0x4ebd3d;})[_0xbb39('0x25')](respondWithFilteredResult(_0x2a19f2,_0x2f99ad))['catch'](handleError(_0x2a19f2,null));};exports[_0xbb39('0x42')]=function(_0x18cccd,_0x290fa2){var _0x1e99cb={'raw':!![],'where':{'id':_0x18cccd[_0xbb39('0x43')]['id']}},_0x1c74c5={};_0x1c74c5[_0xbb39('0x30')]=_['keys'](db[_0xbb39('0x2c')][_0xbb39('0x2d')]);_0x1c74c5[_0xbb39('0x33')]=_['keys'](_0x18cccd[_0xbb39('0x33')]);_0x1c74c5[_0xbb39('0x3a')]=_[_0xbb39('0x32')](_0x1c74c5['model'],_0x1c74c5[_0xbb39('0x33')]);_0x1e99cb[_0xbb39('0x35')]=_[_0xbb39('0x32')](_0x1c74c5[_0xbb39('0x30')],qs[_0xbb39('0x34')](_0x18cccd[_0xbb39('0x33')][_0xbb39('0x34')]));_0x1e99cb[_0xbb39('0x35')]=_0x1e99cb[_0xbb39('0x35')][_0xbb39('0x44')]?_0x1e99cb[_0xbb39('0x35')]:_0x1c74c5['model'];if(_0x18cccd['query'][_0xbb39('0x45')]){_0x1e99cb[_0xbb39('0x40')]=[{'all':!![]}];}_0x1e99cb=_[_0xbb39('0x3e')]({},_0x1e99cb,_0x18cccd[_0xbb39('0x3f')]);return db[_0xbb39('0x2c')][_0xbb39('0x46')](_0x1e99cb)[_0xbb39('0x25')](handleEntityNotFound(_0x290fa2,null))[_0xbb39('0x25')](respondWithResult(_0x290fa2,null))[_0xbb39('0x47')](handleError(_0x290fa2,null));};exports[_0xbb39('0x48')]=function(_0x4e5262,_0x13a669){return db[_0xbb39('0x2c')][_0xbb39('0x48')](_0x4e5262['body'],{})['then'](respondWithResult(_0x13a669,0xc9))[_0xbb39('0x47')](handleError(_0x13a669,null));};exports['update']=function(_0x59e902,_0x23e45b){if(_0x59e902[_0xbb39('0x49')]['id']){delete _0x59e902[_0xbb39('0x49')]['id'];}return db[_0xbb39('0x2c')][_0xbb39('0x46')]({'where':{'id':_0x59e902['params']['id']}})[_0xbb39('0x25')](handleEntityNotFound(_0x23e45b,null))[_0xbb39('0x25')](saveUpdates(_0x59e902[_0xbb39('0x49')],null))[_0xbb39('0x25')](respondWithResult(_0x23e45b,null))[_0xbb39('0x47')](handleError(_0x23e45b,null));};exports[_0xbb39('0x4a')]=function(_0x2958ce,_0x57a6af){return db[_0xbb39('0x2c')][_0xbb39('0x46')]({'where':{'id':_0x2958ce[_0xbb39('0x43')]['id']}})[_0xbb39('0x25')](handleEntityNotFound(_0x57a6af,null))['then'](removeEntity(_0x57a6af,null))['catch'](handleError(_0x57a6af,null));}; \ No newline at end of file +var _0x3651=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','length','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','include','rows','catch','show','params','intersection','attributes','merge','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x16d369,_0xbbaa52){var _0x53c1ca=function(_0x49908d){while(--_0x49908d){_0x16d369['push'](_0x16d369['shift']());}};_0x53c1ca(++_0xbbaa52);}(_0x3651,0x160));var _0x1365=function(_0x43c0e1,_0x54e50c){_0x43c0e1=_0x43c0e1-0x0;var _0xfea7cc=_0x3651[_0x43c0e1];return _0xfea7cc;};'use strict';var emlformat=require(_0x1365('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1365('0x1'));var jsonpatch=require(_0x1365('0x2'));var rp=require('request-promise');var moment=require(_0x1365('0x3'));var BPromise=require(_0x1365('0x4'));var Mustache=require('mustache');var util=require(_0x1365('0x5'));var path=require('path');var sox=require(_0x1365('0x6'));var csv=require(_0x1365('0x7'));var ejs=require(_0x1365('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1365('0x9'));var squel=require(_0x1365('0xa'));var crypto=require(_0x1365('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1365('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1365('0xd'));var Papa=require(_0x1365('0xe'));var Redis=require(_0x1365('0xf'));var authService=require(_0x1365('0x10'));var qs=require(_0x1365('0x11'));var as=require(_0x1365('0x12'));var hardwareService=require(_0x1365('0x13'));var logger=require(_0x1365('0x14'))(_0x1365('0x15'));var utils=require(_0x1365('0x16'));var config=require(_0x1365('0x17'));var licenseUtil=require(_0x1365('0x18'));var db=require(_0x1365('0x19'))['db'];function respondWithStatusCode(_0x322456,_0x4cac9e){_0x4cac9e=_0x4cac9e||0xcc;return function(_0x2720fd){if(_0x2720fd){return _0x322456[_0x1365('0x1a')](_0x4cac9e);}return _0x322456['status'](_0x4cac9e)[_0x1365('0x1b')]();};}function respondWithResult(_0x3beead,_0x340ecf){_0x340ecf=_0x340ecf||0xc8;return function(_0x325cab){if(_0x325cab){return _0x3beead[_0x1365('0x1c')](_0x340ecf)[_0x1365('0x1d')](_0x325cab);}};}function respondWithFilteredResult(_0x1aa9ee,_0x37074d){return function(_0x793178){if(_0x793178){var _0x5913b9=typeof _0x37074d[_0x1365('0x1e')]===_0x1365('0x1f')&&typeof _0x37074d[_0x1365('0x20')]===_0x1365('0x1f');var _0x31fb41=_0x793178[_0x1365('0x21')];var _0x489385=_0x5913b9?0x0:_0x37074d['offset'];var _0x169c14=_0x5913b9?_0x793178[_0x1365('0x21')]:_0x37074d[_0x1365('0x1e')]+_0x37074d[_0x1365('0x20')];var _0x38d6d4;if(_0x169c14>=_0x31fb41){_0x169c14=_0x31fb41;_0x38d6d4=0xc8;}else{_0x38d6d4=0xce;}_0x1aa9ee[_0x1365('0x1c')](_0x38d6d4);return _0x1aa9ee['set'](_0x1365('0x22'),_0x489385+'-'+_0x169c14+'/'+_0x31fb41)['json'](_0x793178);}return null;};}function patchUpdates(_0x554b44){return function(_0x44408b){try{jsonpatch['apply'](_0x44408b,_0x554b44,!![]);}catch(_0x3bc412){return BPromise['reject'](_0x3bc412);}return _0x44408b['save']();};}function saveUpdates(_0x520990,_0x3ac0b2){return function(_0xa6bdc8){if(_0xa6bdc8){return _0xa6bdc8[_0x1365('0x23')](_0x520990)[_0x1365('0x24')](function(_0x1d2f05){return _0x1d2f05;});}return null;};}function removeEntity(_0x407d80,_0x25b1f5){return function(_0x1177e6){if(_0x1177e6){return _0x1177e6[_0x1365('0x25')]()[_0x1365('0x24')](function(){_0x407d80['status'](0xcc)[_0x1365('0x1b')]();});}};}function handleEntityNotFound(_0x394489,_0x259f43){return function(_0x2c0d43){if(!_0x2c0d43){_0x394489[_0x1365('0x1a')](0x194);}return _0x2c0d43;};}function handleError(_0x2688fd,_0x1a0f90){_0x1a0f90=_0x1a0f90||0x1f4;return function(_0x1c10a6){logger[_0x1365('0x26')](_0x1c10a6[_0x1365('0x27')]);if(_0x1c10a6[_0x1365('0x28')]){delete _0x1c10a6['name'];}_0x2688fd[_0x1365('0x1c')](_0x1a0f90)[_0x1365('0x29')](_0x1c10a6);};}exports[_0x1365('0x2a')]=function(_0x58c063,_0x22ab7d){var _0x44e82f={},_0xe4f5fc={},_0x31310d={'count':0x0,'rows':[]};var _0x411fc=_[_0x1365('0x2b')](db[_0x1365('0x2c')][_0x1365('0x2d')],function(_0x2581d8){return{'name':_0x2581d8[_0x1365('0x2e')],'type':_0x2581d8[_0x1365('0x2f')][_0x1365('0x30')]};});_0xe4f5fc[_0x1365('0x31')]=_[_0x1365('0x2b')](_0x411fc,'name');_0xe4f5fc[_0x1365('0x32')]=_[_0x1365('0x33')](_0x58c063[_0x1365('0x32')]);_0xe4f5fc[_0x1365('0x34')]=_['intersection'](_0xe4f5fc[_0x1365('0x31')],_0xe4f5fc[_0x1365('0x32')]);_0x44e82f['attributes']=_['intersection'](_0xe4f5fc[_0x1365('0x31')],qs[_0x1365('0x35')](_0x58c063['query']['fields']));_0x44e82f['attributes']=_0x44e82f['attributes'][_0x1365('0x36')]?_0x44e82f['attributes']:_0xe4f5fc['model'];if(!_0x58c063[_0x1365('0x32')][_0x1365('0x37')]('nolimit')){_0x44e82f[_0x1365('0x20')]=qs['limit'](_0x58c063['query'][_0x1365('0x20')]);_0x44e82f[_0x1365('0x1e')]=qs[_0x1365('0x1e')](_0x58c063[_0x1365('0x32')][_0x1365('0x1e')]);}_0x44e82f[_0x1365('0x38')]=qs[_0x1365('0x39')](_0x58c063[_0x1365('0x32')]['sort']);_0x44e82f[_0x1365('0x3a')]=qs[_0x1365('0x34')](_[_0x1365('0x3b')](_0x58c063[_0x1365('0x32')],_0xe4f5fc[_0x1365('0x34')]),_0x411fc);if(_0x58c063[_0x1365('0x32')][_0x1365('0x3c')]){_0x44e82f['where']=_['merge'](_0x44e82f[_0x1365('0x3a')],{'$or':_[_0x1365('0x2b')](_0x411fc,function(_0x3111e1){if(_0x3111e1[_0x1365('0x2f')]!=='VIRTUAL'){var _0x4fc5ad={};_0x4fc5ad[_0x3111e1[_0x1365('0x28')]]={'$like':'%'+_0x58c063[_0x1365('0x32')][_0x1365('0x3c')]+'%'};return _0x4fc5ad;}})});}_0x44e82f=_['merge']({},_0x44e82f,_0x58c063[_0x1365('0x3d')]);var _0x2458cc={'where':_0x44e82f['where']};return db[_0x1365('0x2c')][_0x1365('0x21')](_0x2458cc)[_0x1365('0x24')](function(_0x23f067){_0x31310d[_0x1365('0x21')]=_0x23f067;if(_0x58c063['query'][_0x1365('0x3e')]){_0x44e82f[_0x1365('0x3f')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x44e82f);})[_0x1365('0x24')](function(_0x279f88){_0x31310d[_0x1365('0x40')]=_0x279f88;return _0x31310d;})[_0x1365('0x24')](respondWithFilteredResult(_0x22ab7d,_0x44e82f))[_0x1365('0x41')](handleError(_0x22ab7d,null));};exports[_0x1365('0x42')]=function(_0x3b4d85,_0x4acc61){var _0x2e160d={'raw':!![],'where':{'id':_0x3b4d85[_0x1365('0x43')]['id']}},_0x170d37={};_0x170d37[_0x1365('0x31')]=_[_0x1365('0x33')](db[_0x1365('0x2c')][_0x1365('0x2d')]);_0x170d37[_0x1365('0x32')]=_[_0x1365('0x33')](_0x3b4d85[_0x1365('0x32')]);_0x170d37[_0x1365('0x34')]=_[_0x1365('0x44')](_0x170d37[_0x1365('0x31')],_0x170d37[_0x1365('0x32')]);_0x2e160d[_0x1365('0x45')]=_[_0x1365('0x44')](_0x170d37['model'],qs[_0x1365('0x35')](_0x3b4d85[_0x1365('0x32')][_0x1365('0x35')]));_0x2e160d[_0x1365('0x45')]=_0x2e160d[_0x1365('0x45')]['length']?_0x2e160d[_0x1365('0x45')]:_0x170d37[_0x1365('0x31')];if(_0x3b4d85[_0x1365('0x32')][_0x1365('0x3e')]){_0x2e160d['include']=[{'all':!![]}];}_0x2e160d=_[_0x1365('0x46')]({},_0x2e160d,_0x3b4d85[_0x1365('0x3d')]);return db[_0x1365('0x2c')][_0x1365('0x47')](_0x2e160d)['then'](handleEntityNotFound(_0x4acc61,null))[_0x1365('0x24')](respondWithResult(_0x4acc61,null))[_0x1365('0x41')](handleError(_0x4acc61,null));};exports[_0x1365('0x48')]=function(_0x53c598,_0x27f5f2){return db[_0x1365('0x2c')][_0x1365('0x48')](_0x53c598['body'],{})[_0x1365('0x24')](respondWithResult(_0x27f5f2,0xc9))[_0x1365('0x41')](handleError(_0x27f5f2,null));};exports[_0x1365('0x23')]=function(_0x403dbb,_0x3fc6f4){if(_0x403dbb['body']['id']){delete _0x403dbb[_0x1365('0x49')]['id'];}return db[_0x1365('0x2c')][_0x1365('0x47')]({'where':{'id':_0x403dbb[_0x1365('0x43')]['id']}})['then'](handleEntityNotFound(_0x3fc6f4,null))[_0x1365('0x24')](saveUpdates(_0x403dbb[_0x1365('0x49')],null))[_0x1365('0x24')](respondWithResult(_0x3fc6f4,null))[_0x1365('0x41')](handleError(_0x3fc6f4,null));};exports[_0x1365('0x25')]=function(_0x21db35,_0xdfabf5){return db['VtigerField'][_0x1365('0x47')]({'where':{'id':_0x21db35[_0x1365('0x43')]['id']}})[_0x1365('0x24')](handleEntityNotFound(_0xdfabf5,null))[_0x1365('0x24')](removeEntity(_0xdfabf5,null))[_0x1365('0x41')](handleError(_0xdfabf5,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 99fb955..78dc36f 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 _0x4946=['request-promise','path','rimraf','./intVtigerField.attributes','define','VtigerField','vtiger_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0x4946,0x1c9));var _0x6494=function(_0xc3804e,_0x5e5938){_0xc3804e=_0xc3804e-0x0;var _0xd13ff=_0x4946[_0xc3804e];return _0xd13ff;};'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(_0x6494('0x4'));var rp=require(_0x6494('0x5'));var fs=require('fs');var path=require(_0x6494('0x6'));var rimraf=require(_0x6494('0x7'));var config=require('../../config/environment');var attributes=require(_0x6494('0x8'));module['exports']=function(_0x188238,_0x32746d){return _0x188238[_0x6494('0x9')](_0x6494('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x6494('0xb'),'fields':[_0x6494('0xc'),_0x6494('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb0ac=['int_vtiger_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xb0ac,0xe3));var _0xcb0a=function(_0x1db324,_0x1fe863){_0x1db324=_0x1db324-0x0;var _0x5b7237=_0xb0ac[_0x1db324];return _0x5b7237;};'use strict';var _=require('lodash');var util=require(_0xcb0a('0x0'));var logger=require(_0xcb0a('0x1'))(_0xcb0a('0x2'));var moment=require(_0xcb0a('0x3'));var BPromise=require(_0xcb0a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb0a('0x5'));var rimraf=require(_0xcb0a('0x6'));var config=require('../../config/environment');var attributes=require(_0xcb0a('0x7'));module[_0xcb0a('0x8')]=function(_0x179162,_0x3af6fa){return _0x179162[_0xcb0a('0x9')](_0xcb0a('0xa'),attributes,{'tableName':_0xcb0a('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xcb0a('0xc'),_0xcb0a('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 6ba5e7c..a8e4965 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 _0xa19c=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result'];(function(_0xb3d3b7,_0x208f98){var _0x3c4980=function(_0x20ee97){while(--_0x20ee97){_0xb3d3b7['push'](_0xb3d3b7['shift']());}};_0x3c4980(++_0x208f98);}(_0xa19c,0x114));var _0xca19=function(_0x48165a,_0x52099e){_0x48165a=_0x48165a-0x0;var _0x3702bb=_0xa19c[_0x48165a];return _0x3702bb;};'use strict';var _=require(_0xca19('0x0'));var util=require(_0xca19('0x1'));var moment=require('moment');var BPromise=require(_0xca19('0x2'));var rs=require(_0xca19('0x3'));var fs=require('fs');var Redis=require(_0xca19('0x4'));var db=require(_0xca19('0x5'))['db'];var utils=require(_0xca19('0x6'));var logger=require(_0xca19('0x7'))(_0xca19('0x8'));var config=require(_0xca19('0x9'));var jayson=require(_0xca19('0xa'));var client=jayson[_0xca19('0xb')][_0xca19('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37ace4,_0x356d03,_0x272cd0){return new BPromise(function(_0x2bf5fc,_0x4e6066){return client[_0xca19('0xd')](_0x37ace4,_0x272cd0)[_0xca19('0xe')](function(_0x104041){logger[_0xca19('0xf')]('VtigerField,\x20%s,\x20%s',_0x356d03,'request\x20sent');logger[_0xca19('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x356d03,_0xca19('0x11'),JSON[_0xca19('0x12')](_0x104041));if(_0x104041['error']){if(_0x104041[_0xca19('0x13')][_0xca19('0x14')]===0x1f4){logger[_0xca19('0x13')](_0xca19('0x15'),_0x356d03,_0x104041[_0xca19('0x13')][_0xca19('0x16')]);return _0x4e6066(_0x104041[_0xca19('0x13')][_0xca19('0x16')]);}logger[_0xca19('0x13')](_0xca19('0x15'),_0x356d03,_0x104041[_0xca19('0x13')][_0xca19('0x16')]);return _0x2bf5fc(_0x104041[_0xca19('0x13')][_0xca19('0x16')]);}else{logger[_0xca19('0xf')](_0xca19('0x15'),_0x356d03,_0xca19('0x11'));_0x2bf5fc(_0x104041[_0xca19('0x17')][_0xca19('0x16')]);}})[_0xca19('0x18')](function(_0x7820c2){logger[_0xca19('0x13')]('VtigerField,\x20%s,\x20%s',_0x356d03,_0x7820c2);_0x4e6066(_0x7820c2);});});} \ No newline at end of file +var _0xbcd1=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x27c248,_0x384dff){var _0x1b2fc2=function(_0x188255){while(--_0x188255){_0x27c248['push'](_0x27c248['shift']());}};_0x1b2fc2(++_0x384dff);}(_0xbcd1,0x1ed));var _0x1bcd=function(_0x1599aa,_0x2b48b6){_0x1599aa=_0x1599aa-0x0;var _0x2f2cb3=_0xbcd1[_0x1599aa];return _0x2f2cb3;};'use strict';var _=require(_0x1bcd('0x0'));var util=require(_0x1bcd('0x1'));var moment=require(_0x1bcd('0x2'));var BPromise=require(_0x1bcd('0x3'));var rs=require(_0x1bcd('0x4'));var fs=require('fs');var Redis=require(_0x1bcd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1bcd('0x6'));var logger=require(_0x1bcd('0x7'))('rpc');var config=require(_0x1bcd('0x8'));var jayson=require(_0x1bcd('0x9'));var client=jayson['client'][_0x1bcd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e6dc8,_0x36bccd,_0x1495db){return new BPromise(function(_0x429e6c,_0x17c83b){return client[_0x1bcd('0xb')](_0x1e6dc8,_0x1495db)[_0x1bcd('0xc')](function(_0x30c4ec){logger['info'](_0x1bcd('0xd'),_0x36bccd,_0x1bcd('0xe'));logger[_0x1bcd('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x36bccd,'request\x20sent',JSON[_0x1bcd('0x10')](_0x30c4ec));if(_0x30c4ec['error']){if(_0x30c4ec[_0x1bcd('0x11')][_0x1bcd('0x12')]===0x1f4){logger[_0x1bcd('0x11')](_0x1bcd('0xd'),_0x36bccd,_0x30c4ec['error'][_0x1bcd('0x13')]);return _0x17c83b(_0x30c4ec[_0x1bcd('0x11')][_0x1bcd('0x13')]);}logger['error'](_0x1bcd('0xd'),_0x36bccd,_0x30c4ec['error'][_0x1bcd('0x13')]);return _0x429e6c(_0x30c4ec[_0x1bcd('0x11')][_0x1bcd('0x13')]);}else{logger['info'](_0x1bcd('0xd'),_0x36bccd,_0x1bcd('0xe'));_0x429e6c(_0x30c4ec[_0x1bcd('0x14')][_0x1bcd('0x13')]);}})[_0x1bcd('0x15')](function(_0x102e26){logger[_0x1bcd('0x11')](_0x1bcd('0xd'),_0x36bccd,_0x102e26);_0x17c83b(_0x102e26);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 50fb214..5b44849 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 _0xdfdb=['./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','put','destroy','multer','path','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xdfdb,0xa4));var _0xbdfd=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0xdfdb[_0x28fbe3];return _0x45db6a;};'use strict';var multer=require(_0xbdfd('0x0'));var util=require('util');var path=require(_0xbdfd('0x1'));var timeout=require('connect-timeout');var express=require(_0xbdfd('0x2'));var router=express['Router']();var fs_extra=require(_0xbdfd('0x3'));var auth=require(_0xbdfd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbdfd('0x5'));var controller=require(_0xbdfd('0x6'));router[_0xbdfd('0x7')]('/',auth[_0xbdfd('0x8')](),controller['index']);router[_0xbdfd('0x7')](_0xbdfd('0x9'),auth[_0xbdfd('0x8')](),controller[_0xbdfd('0xa')]);router[_0xbdfd('0x7')](_0xbdfd('0xb'),auth[_0xbdfd('0x8')](),controller['getConfigurations']);router[_0xbdfd('0x7')](_0xbdfd('0xc'),auth[_0xbdfd('0x8')](),controller[_0xbdfd('0xd')]);router[_0xbdfd('0xe')]('/',auth[_0xbdfd('0x8')](),controller['create']);router['post'](_0xbdfd('0xb'),auth[_0xbdfd('0x8')](),controller['addConfiguration']);router[_0xbdfd('0xf')]('/:id',auth[_0xbdfd('0x8')](),controller['update']);router['delete'](_0xbdfd('0x9'),auth[_0xbdfd('0x8')](),controller[_0xbdfd('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7ee9=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','connect-timeout','Router','fs-extra'];(function(_0x5c505a,_0x51b4fa){var _0x2d20f2=function(_0x3c98d3){while(--_0x3c98d3){_0x5c505a['push'](_0x5c505a['shift']());}};_0x2d20f2(++_0x51b4fa);}(_0x7ee9,0x115));var _0x97ee=function(_0x45fa67,_0x54f9c8){_0x45fa67=_0x45fa67-0x0;var _0x2eddaf=_0x7ee9[_0x45fa67];return _0x2eddaf;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x97ee('0x0'));var express=require('express');var router=express[_0x97ee('0x1')]();var fs_extra=require(_0x97ee('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x97ee('0x3'));var config=require(_0x97ee('0x4'));var controller=require(_0x97ee('0x5'));router[_0x97ee('0x6')]('/',auth[_0x97ee('0x7')](),controller[_0x97ee('0x8')]);router['get'](_0x97ee('0x9'),auth[_0x97ee('0x7')](),controller[_0x97ee('0xa')]);router[_0x97ee('0x6')](_0x97ee('0xb'),auth[_0x97ee('0x7')](),controller[_0x97ee('0xc')]);router[_0x97ee('0x6')](_0x97ee('0xd'),auth[_0x97ee('0x7')](),controller[_0x97ee('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x97ee('0xf')](_0x97ee('0xb'),auth[_0x97ee('0x7')](),controller['addConfiguration']);router[_0x97ee('0x10')](_0x97ee('0x9'),auth['isAuthenticated'](),controller[_0x97ee('0x11')]);router[_0x97ee('0x12')](_0x97ee('0x9'),auth[_0x97ee('0x7')](),controller[_0x97ee('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index ac0bbdd..e43afe8 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 _0x9b09=['integrationTab','newTab','sequelize','exports','STRING','ENUM','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b09,0x1ad));var _0x99b0=function(_0x230639,_0x20f428){_0x230639=_0x230639-0x0;var _0x5248d7=_0x9b09[_0x230639];return _0x5248d7;};'use strict';var Sequelize=require(_0x99b0('0x0'));module[_0x99b0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x99b0('0x2')]},'username':{'type':Sequelize[_0x99b0('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x99b0('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x99b0('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x99b0('0x3')](_0x99b0('0x4'),'token'),'defaultValue':_0x99b0('0x4')},'serverUrl':{'type':Sequelize[_0x99b0('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x99b0('0x5'),_0x99b0('0x6')),'defaultValue':_0x99b0('0x5')}}; \ No newline at end of file +var _0xc14a=['STRING','remoteUri','password','token','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc14a,0xa9));var _0xac14=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc14a[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xac14('0x0'));module[_0xac14('0x1')]={'name':{'type':Sequelize[_0xac14('0x2')]},'description':{'type':Sequelize[_0xac14('0x2')]},'username':{'type':Sequelize[_0xac14('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xac14('0x2')]},'token':{'type':Sequelize[_0xac14('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xac14('0x3')},'authType':{'type':Sequelize['ENUM'](_0xac14('0x4'),_0xac14('0x5')),'defaultValue':_0xac14('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xac14('0x6')](_0xac14('0x7'),_0xac14('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 57dd82f..5f2dcab 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 _0xbee3=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','reject','save','update','then','error','name','index','map','ZendeskAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','findOne','ZendeskConfiguration','rawAttributes','length','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x52a06a,_0x183d02){var _0x1a8e0f=function(_0x58f6a2){while(--_0x58f6a2){_0x52a06a['push'](_0x52a06a['shift']());}};_0x1a8e0f(++_0x183d02);}(_0xbee3,0xd5));var _0x3bee=function(_0x33cf20,_0x1ca335){_0x33cf20=_0x33cf20-0x0;var _0x500a5b=_0xbee3[_0x33cf20];return _0x500a5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];var integrations=require(_0x3bee('0x17'));function respondWithStatusCode(_0x6950d0,_0x410124){_0x410124=_0x410124||0xcc;return function(_0x459129){if(_0x459129){return _0x6950d0[_0x3bee('0x18')](_0x410124);}return _0x6950d0['status'](_0x410124)[_0x3bee('0x19')]();};}function respondWithResult(_0x33504d,_0x31ac52){_0x31ac52=_0x31ac52||0xc8;return function(_0x237110){if(_0x237110){return _0x33504d[_0x3bee('0x1a')](_0x31ac52)['json'](_0x237110);}};}function respondWithFilteredResult(_0x558436,_0x346767){return function(_0x515397){if(_0x515397){var _0x2cfba7=typeof _0x346767[_0x3bee('0x1b')]==='undefined'&&typeof _0x346767['limit']===_0x3bee('0x1c');var _0x36c5aa=_0x515397[_0x3bee('0x1d')];var _0x631ff8=_0x2cfba7?0x0:_0x346767['offset'];var _0x30a1de=_0x2cfba7?_0x515397[_0x3bee('0x1d')]:_0x346767[_0x3bee('0x1b')]+_0x346767[_0x3bee('0x1e')];var _0x33d812;if(_0x30a1de>=_0x36c5aa){_0x30a1de=_0x36c5aa;_0x33d812=0xc8;}else{_0x33d812=0xce;}_0x558436[_0x3bee('0x1a')](_0x33d812);return _0x558436[_0x3bee('0x1f')]('Content-Range',_0x631ff8+'-'+_0x30a1de+'/'+_0x36c5aa)['json'](_0x515397);}return null;};}function patchUpdates(_0x1afd0f){return function(_0x30bba2){try{jsonpatch['apply'](_0x30bba2,_0x1afd0f,!![]);}catch(_0x471027){return BPromise[_0x3bee('0x20')](_0x471027);}return _0x30bba2[_0x3bee('0x21')]();};}function saveUpdates(_0x179e62,_0x28c248){return function(_0x26e92e){if(_0x26e92e){return _0x26e92e[_0x3bee('0x22')](_0x179e62)['then'](function(_0x8ae4ca){return _0x8ae4ca;});}return null;};}function removeEntity(_0x1ed0c1,_0x1fed5a){return function(_0x3bb884){if(_0x3bb884){return _0x3bb884['destroy']()[_0x3bee('0x23')](function(){_0x1ed0c1[_0x3bee('0x1a')](0xcc)[_0x3bee('0x19')]();});}};}function handleEntityNotFound(_0x4b4cd4,_0x5ed022){return function(_0x13181e){if(!_0x13181e){_0x4b4cd4[_0x3bee('0x18')](0x194);}return _0x13181e;};}function handleError(_0x5341e2,_0x2c0e50){_0x2c0e50=_0x2c0e50||0x1f4;return function(_0x1b4ce0){logger[_0x3bee('0x24')](_0x1b4ce0['stack']);if(_0x1b4ce0[_0x3bee('0x25')]){delete _0x1b4ce0[_0x3bee('0x25')];}_0x5341e2[_0x3bee('0x1a')](_0x2c0e50)['send'](_0x1b4ce0);};}exports[_0x3bee('0x26')]=function(_0xf08fb3,_0x3a3d92){var _0x496abd={},_0x1115ed={},_0x24d523={'count':0x0,'rows':[]};var _0x27ed99=_[_0x3bee('0x27')](db[_0x3bee('0x28')]['rawAttributes'],function(_0x564e45){return{'name':_0x564e45[_0x3bee('0x29')],'type':_0x564e45[_0x3bee('0x2a')][_0x3bee('0x2b')]};});_0x1115ed[_0x3bee('0x2c')]=_['map'](_0x27ed99,'name');_0x1115ed[_0x3bee('0x2d')]=_[_0x3bee('0x2e')](_0xf08fb3['query']);_0x1115ed['filters']=_[_0x3bee('0x2f')](_0x1115ed[_0x3bee('0x2c')],_0x1115ed[_0x3bee('0x2d')]);_0x496abd[_0x3bee('0x30')]=_[_0x3bee('0x2f')](_0x1115ed[_0x3bee('0x2c')],qs[_0x3bee('0x31')](_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x31')]));_0x496abd[_0x3bee('0x30')]=_0x496abd['attributes']['length']?_0x496abd[_0x3bee('0x30')]:_0x1115ed['model'];if(!_0xf08fb3['query'][_0x3bee('0x32')](_0x3bee('0x33'))){_0x496abd[_0x3bee('0x1e')]=qs[_0x3bee('0x1e')](_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x1e')]);_0x496abd[_0x3bee('0x1b')]=qs[_0x3bee('0x1b')](_0xf08fb3['query'][_0x3bee('0x1b')]);}_0x496abd[_0x3bee('0x34')]=qs['sort'](_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x35')]);_0x496abd[_0x3bee('0x36')]=qs[_0x3bee('0x37')](_[_0x3bee('0x38')](_0xf08fb3['query'],_0x1115ed['filters']),_0x27ed99);if(_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x39')]){_0x496abd[_0x3bee('0x36')]=_[_0x3bee('0x3a')](_0x496abd[_0x3bee('0x36')],{'$or':_[_0x3bee('0x27')](_0x27ed99,function(_0x2c6ca3){if(_0x2c6ca3[_0x3bee('0x2a')]!==_0x3bee('0x3b')){var _0x2591f1={};_0x2591f1[_0x2c6ca3[_0x3bee('0x25')]]={'$like':'%'+_0xf08fb3[_0x3bee('0x2d')]['filter']+'%'};return _0x2591f1;}})});}_0x496abd=_[_0x3bee('0x3a')]({},_0x496abd,_0xf08fb3[_0x3bee('0x3c')]);var _0x25158b={'where':_0x496abd[_0x3bee('0x36')]};return db[_0x3bee('0x28')][_0x3bee('0x1d')](_0x25158b)[_0x3bee('0x23')](function(_0x6195a3){_0x24d523[_0x3bee('0x1d')]=_0x6195a3;if(_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x3d')]){_0x496abd[_0x3bee('0x3e')]=[{'all':!![]}];}return db[_0x3bee('0x28')]['findAll'](_0x496abd);})[_0x3bee('0x23')](function(_0x2f30d7){_0x24d523[_0x3bee('0x3f')]=_0x2f30d7;return _0x24d523;})[_0x3bee('0x23')](respondWithFilteredResult(_0x3a3d92,_0x496abd))[_0x3bee('0x40')](handleError(_0x3a3d92,null));};exports[_0x3bee('0x41')]=function(_0x13dd72,_0xd1140d){var _0x5d9e1b={'raw':![],'where':{'id':_0x13dd72[_0x3bee('0x42')]['id']}},_0x10a59d={};_0x10a59d[_0x3bee('0x2c')]=_['keys'](db[_0x3bee('0x28')]['rawAttributes']);_0x10a59d[_0x3bee('0x2d')]=_['keys'](_0x13dd72['query']);_0x10a59d[_0x3bee('0x37')]=_[_0x3bee('0x2f')](_0x10a59d[_0x3bee('0x2c')],_0x10a59d[_0x3bee('0x2d')]);_0x5d9e1b[_0x3bee('0x30')]=_['intersection'](_0x10a59d['model'],qs[_0x3bee('0x31')](_0x13dd72['query'][_0x3bee('0x31')]));_0x5d9e1b['attributes']=_0x5d9e1b[_0x3bee('0x30')]['length']?_0x5d9e1b[_0x3bee('0x30')]:_0x10a59d[_0x3bee('0x2c')];if(_0x13dd72[_0x3bee('0x2d')][_0x3bee('0x3d')]){_0x5d9e1b['include']=[{'all':!![]}];}_0x5d9e1b=_['merge']({},_0x5d9e1b,_0x13dd72[_0x3bee('0x3c')]);return db['ZendeskAccount']['find'](_0x5d9e1b)['then'](handleEntityNotFound(_0xd1140d,null))[_0x3bee('0x23')](respondWithResult(_0xd1140d,null))['catch'](handleError(_0xd1140d,null));};exports[_0x3bee('0x43')]=function(_0x33d615,_0xd87fd2){return db['ZendeskAccount'][_0x3bee('0x43')](_0x33d615['body'],{})[_0x3bee('0x23')](respondWithResult(_0xd87fd2,0xc9))['catch'](handleError(_0xd87fd2,null));};exports[_0x3bee('0x22')]=function(_0x16b096,_0x15a96a){if(_0x16b096['body']['id']){delete _0x16b096[_0x3bee('0x44')]['id'];}return db[_0x3bee('0x28')][_0x3bee('0x45')]({'where':{'id':_0x16b096['params']['id']}})['then'](handleEntityNotFound(_0x15a96a,null))[_0x3bee('0x23')](saveUpdates(_0x16b096[_0x3bee('0x44')],null))[_0x3bee('0x23')](respondWithResult(_0x15a96a,null))[_0x3bee('0x40')](handleError(_0x15a96a,null));};exports[_0x3bee('0x46')]=function(_0x21ab40,_0x4005a3){return db['ZendeskAccount'][_0x3bee('0x45')]({'where':{'id':_0x21ab40[_0x3bee('0x42')]['id']}})['then'](handleEntityNotFound(_0x4005a3,null))['then'](removeEntity(_0x4005a3,null))[_0x3bee('0x40')](handleError(_0x4005a3,null));};exports['getConfigurations']=function(_0x1cb54e,_0x2162ce,_0x1f0f23){var _0x4fb836={};var _0x1a13fd={};var _0x3beac9;var _0x127cb8;return db['ZendeskAccount'][_0x3bee('0x47')]({'where':{'id':_0x1cb54e[_0x3bee('0x42')]['id']}})['then'](handleEntityNotFound(_0x2162ce,null))[_0x3bee('0x23')](function(_0x14940e){if(_0x14940e){_0x3beac9=_0x14940e;_0x1a13fd['model']=_[_0x3bee('0x2e')](db[_0x3bee('0x48')][_0x3bee('0x49')]);_0x1a13fd[_0x3bee('0x2d')]=_[_0x3bee('0x2e')](_0x1cb54e[_0x3bee('0x2d')]);_0x1a13fd[_0x3bee('0x37')]=_[_0x3bee('0x2f')](_0x1a13fd['model'],_0x1a13fd['query']);_0x4fb836[_0x3bee('0x30')]=_['intersection'](_0x1a13fd[_0x3bee('0x2c')],qs[_0x3bee('0x31')](_0x1cb54e[_0x3bee('0x2d')]['fields']));_0x4fb836[_0x3bee('0x30')]=_0x4fb836[_0x3bee('0x30')][_0x3bee('0x4a')]?_0x4fb836['attributes']:_0x1a13fd[_0x3bee('0x2c')];_0x4fb836['order']=qs[_0x3bee('0x35')](_0x1cb54e[_0x3bee('0x2d')][_0x3bee('0x35')]);_0x4fb836['where']=qs[_0x3bee('0x37')](_[_0x3bee('0x38')](_0x1cb54e[_0x3bee('0x2d')],_0x1a13fd['filters']));if(_0x1cb54e['query'][_0x3bee('0x39')]){_0x4fb836[_0x3bee('0x36')]=_[_0x3bee('0x3a')](_0x4fb836['where'],{'$or':_['map'](_0x4fb836[_0x3bee('0x30')],function(_0x572fa6){var _0x5cd620={};_0x5cd620[_0x572fa6]={'$like':'%'+_0x1cb54e[_0x3bee('0x2d')][_0x3bee('0x39')]+'%'};return _0x5cd620;})});}_0x4fb836=_[_0x3bee('0x3a')]({},_0x4fb836,_0x1cb54e['options']);return _0x3beac9['getConfigurations'](_0x4fb836);}})[_0x3bee('0x23')](function(_0x1f4eb9){if(_0x1f4eb9){_0x127cb8=_0x1f4eb9['length'];if(!_0x1cb54e[_0x3bee('0x2d')]['hasOwnProperty'](_0x3bee('0x33'))){_0x4fb836[_0x3bee('0x1e')]=qs[_0x3bee('0x1e')](_0x1cb54e[_0x3bee('0x2d')][_0x3bee('0x1e')]);_0x4fb836[_0x3bee('0x1b')]=qs[_0x3bee('0x1b')](_0x1cb54e[_0x3bee('0x2d')][_0x3bee('0x1b')]);}return _0x3beac9[_0x3bee('0x4b')](_0x4fb836);}})[_0x3bee('0x23')](function(_0x5647c8){if(_0x5647c8){return _0x5647c8?{'count':_0x127cb8,'rows':_0x5647c8}:null;}})['then'](respondWithResult(_0x2162ce,null))['catch'](handleError(_0x2162ce,null));};exports[_0x3bee('0x4c')]=function(_0xb5a685,_0x4acba2,_0x9828ad){if(_0xb5a685['body']['id']){delete _0xb5a685[_0x3bee('0x44')]['id'];}return db[_0x3bee('0x28')]['findOne']({'where':{'id':_0xb5a685['params']['id']}})[_0x3bee('0x23')](handleEntityNotFound(_0x4acba2,null))[_0x3bee('0x23')](function(_0x20be01){if(_0x20be01){_0xb5a685['body'][_0x3bee('0x4d')]=_0x20be01['id'];_0xb5a685[_0x3bee('0x44')][_0x3bee('0x4e')]=integrations['getSubjects'](_0xb5a685[_0x3bee('0x44')][_0x3bee('0x4f')],_0xb5a685[_0x3bee('0x44')][_0x3bee('0x2a')]);_0xb5a685['body']['Descriptions']=integrations[_0x3bee('0x50')](_0xb5a685[_0x3bee('0x44')][_0x3bee('0x4f')],_0xb5a685[_0x3bee('0x44')][_0x3bee('0x2a')]);return db['ZendeskConfiguration'][_0x3bee('0x43')](_0xb5a685['body'],{'include':[{'model':db[_0x3bee('0x51')],'as':_0x3bee('0x4e')},{'model':db[_0x3bee('0x51')],'as':_0x3bee('0x52')}]});}return null;})[_0x3bee('0x23')](respondWithResult(_0x4acba2,null))[_0x3bee('0x40')](handleError(_0x4acba2,null));};exports[_0x3bee('0x53')]=function(_0x4d52f3,_0x25f936,_0x28c16e){var _0x42045d='';return db[_0x3bee('0x28')]['findOne']({'where':{'id':_0x4d52f3[_0x3bee('0x42')]['id']},'attributes':['id',_0x3bee('0x54'),_0x3bee('0x55'),_0x3bee('0x56'),_0x3bee('0x57'),_0x3bee('0x58')]})[_0x3bee('0x23')](handleEntityNotFound(_0x25f936,null))[_0x3bee('0x23')](function(_0x519efb){if(_0x519efb){_0x42045d=_0x519efb[_0x3bee('0x58')];var _0x110575=_0x42045d[_0x3bee('0x59')](-0x1);if(_0x110575==='/'){_0x42045d=_0x42045d['substring'](0x0,_0x42045d[_0x3bee('0x5a')](_0x110575));}var _0x479ee2={'method':_0x3bee('0x5b'),'uri':util[_0x3bee('0x5c')](_0x3bee('0x5d'),_0x42045d,_0x3bee('0x5e')),'json':!![]};switch(_0x519efb[_0x3bee('0x57')]){case _0x3bee('0x55'):_0x479ee2[_0x3bee('0x5f')]={'Authorization':util[_0x3bee('0x5c')](_0x3bee('0x60'),new Buffer(util[_0x3bee('0x5c')](_0x3bee('0x61'),_0x519efb[_0x3bee('0x54')],_0x519efb[_0x3bee('0x55')]))[_0x3bee('0x62')](_0x3bee('0x63')))};break;case _0x3bee('0x56'):_0x479ee2[_0x3bee('0x5f')]={'Authorization':util[_0x3bee('0x5c')](_0x3bee('0x60'),new Buffer(util[_0x3bee('0x5c')](_0x3bee('0x64'),_0x519efb[_0x3bee('0x54')],_0x519efb[_0x3bee('0x56')]))['toString'](_0x3bee('0x63')))};break;default:throw new db[(_0x3bee('0x65'))][(_0x3bee('0x66'))](_0x3bee('0x67'));}return rp(_0x479ee2);}})[_0x3bee('0x23')](function(_0x4be1c8){if(_0x4be1c8){var _0x2d6a3d=[_0x3bee('0x68'),_0x3bee('0x69'),'group',_0x3bee('0x6a')];_[_0x3bee('0x6b')](_0x4be1c8['ticket_fields'],function(_0xbfb4af){return _0x2d6a3d['includes'](_0xbfb4af[_0x3bee('0x2a')]);});return{'count':_0x4be1c8[_0x3bee('0x5e')][_0x3bee('0x4a')],'rows':_['map'](_0x4be1c8['ticket_fields'],function(_0x29a2ea){return{'id':_0x29a2ea['id'],'name':_0x29a2ea[_0x3bee('0x6c')]>0x7?_0x29a2ea[_0x3bee('0x6d')]:_0x29a2ea[_0x3bee('0x2a')],'custom':_0x29a2ea[_0x3bee('0x6c')]>0x7?!![]:![],'options':_0x29a2ea[_0x3bee('0x6e')]?_0x29a2ea[_0x3bee('0x6e')]:_0x29a2ea[_0x3bee('0x6f')]?_0x29a2ea['custom_field_options']:[]};})};}})[_0x3bee('0x23')](respondWithResult(_0x25f936,null))[_0x3bee('0x40')](function(_0x22d336){var _0x470ea8=_0x4d52f3[_0x3bee('0x2d')][_0x3bee('0x70')]?0x1f4:_0x22d336[_0x3bee('0x71')]||0x1f4;logger['error'](_0x3bee('0x72'),_0x3bee('0x53'),_0x470ea8,JSON['stringify'](_0x22d336));delete _0x22d336[_0x3bee('0x25')];if(_0x470ea8===0x191){_0x470ea8=0x190;}_0x25f936[_0x3bee('0x1a')](_0x470ea8)['send'](_0x4d52f3[_0x3bee('0x2d')]['test']?{'message':_0x3bee('0x73'),'statusCode':_0x22d336[_0x3bee('0x71')]}:_0x22d336);});}; \ No newline at end of file +var _0x02ce=['sendStatus','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','include','findAll','rows','catch','show','params','length','merge','find','create','body','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','channel','getDescriptions','Subjects','ZendeskField','Descriptions','username','password','authType','remoteUri','GET','format','%s/%s','ticket_fields','headers','toString','base64','%s/token:%s','token','Sequelize','ValidationError','subject','description','group','assignee','remove','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','offset','limit','undefined','count','set','reject','update','then','destroy'];(function(_0x1af927,_0x55bea3){var _0xb25867=function(_0x16168d){while(--_0x16168d){_0x1af927['push'](_0x1af927['shift']());}};_0xb25867(++_0x55bea3);}(_0x02ce,0x1ac));var _0xe02c=function(_0x22f142,_0xd63f32){_0x22f142=_0x22f142-0x0;var _0x205d14=_0x02ce[_0x22f142];return _0x205d14;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];var integrations=require(_0xe02c('0x1c'));function respondWithStatusCode(_0x32fc45,_0x5d6d13){_0x5d6d13=_0x5d6d13||0xcc;return function(_0x43079c){if(_0x43079c){return _0x32fc45['sendStatus'](_0x5d6d13);}return _0x32fc45['status'](_0x5d6d13)[_0xe02c('0x1d')]();};}function respondWithResult(_0x56405a,_0x221910){_0x221910=_0x221910||0xc8;return function(_0x59614c){if(_0x59614c){return _0x56405a[_0xe02c('0x1e')](_0x221910)['json'](_0x59614c);}};}function respondWithFilteredResult(_0x256311,_0x366893){return function(_0x59f2f6){if(_0x59f2f6){var _0x10a2a6=typeof _0x366893[_0xe02c('0x1f')]==='undefined'&&typeof _0x366893[_0xe02c('0x20')]===_0xe02c('0x21');var _0x5a4583=_0x59f2f6['count'];var _0x3e37bf=_0x10a2a6?0x0:_0x366893['offset'];var _0x1f8f37=_0x10a2a6?_0x59f2f6[_0xe02c('0x22')]:_0x366893[_0xe02c('0x1f')]+_0x366893[_0xe02c('0x20')];var _0x3898dc;if(_0x1f8f37>=_0x5a4583){_0x1f8f37=_0x5a4583;_0x3898dc=0xc8;}else{_0x3898dc=0xce;}_0x256311['status'](_0x3898dc);return _0x256311[_0xe02c('0x23')]('Content-Range',_0x3e37bf+'-'+_0x1f8f37+'/'+_0x5a4583)['json'](_0x59f2f6);}return null;};}function patchUpdates(_0x393621){return function(_0x4514ac){try{jsonpatch['apply'](_0x4514ac,_0x393621,!![]);}catch(_0x3fe8f7){return BPromise[_0xe02c('0x24')](_0x3fe8f7);}return _0x4514ac['save']();};}function saveUpdates(_0x38dce2,_0x45fd82){return function(_0x39b00c){if(_0x39b00c){return _0x39b00c[_0xe02c('0x25')](_0x38dce2)[_0xe02c('0x26')](function(_0x557142){return _0x557142;});}return null;};}function removeEntity(_0x3e80e3,_0xf41d4c){return function(_0xeae877){if(_0xeae877){return _0xeae877[_0xe02c('0x27')]()[_0xe02c('0x26')](function(){_0x3e80e3['status'](0xcc)[_0xe02c('0x1d')]();});}};}function handleEntityNotFound(_0x4411d8,_0x3592ca){return function(_0x14ffba){if(!_0x14ffba){_0x4411d8[_0xe02c('0x28')](0x194);}return _0x14ffba;};}function handleError(_0x303d24,_0x43dc78){_0x43dc78=_0x43dc78||0x1f4;return function(_0x1c14d6){logger['error'](_0x1c14d6[_0xe02c('0x29')]);if(_0x1c14d6[_0xe02c('0x2a')]){delete _0x1c14d6[_0xe02c('0x2a')];}_0x303d24['status'](_0x43dc78)[_0xe02c('0x2b')](_0x1c14d6);};}exports[_0xe02c('0x2c')]=function(_0x445421,_0x287f7e){var _0x1e7eab={},_0x35a309={},_0x22a285={'count':0x0,'rows':[]};var _0x1b8f21=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x5a2da0){return{'name':_0x5a2da0[_0xe02c('0x30')],'type':_0x5a2da0[_0xe02c('0x31')][_0xe02c('0x32')]};});_0x35a309[_0xe02c('0x33')]=_[_0xe02c('0x2d')](_0x1b8f21,_0xe02c('0x2a'));_0x35a309['query']=_[_0xe02c('0x34')](_0x445421[_0xe02c('0x35')]);_0x35a309['filters']=_[_0xe02c('0x36')](_0x35a309[_0xe02c('0x33')],_0x35a309[_0xe02c('0x35')]);_0x1e7eab[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x35a309['model'],qs['fields'](_0x445421[_0xe02c('0x35')][_0xe02c('0x38')]));_0x1e7eab['attributes']=_0x1e7eab[_0xe02c('0x37')]['length']?_0x1e7eab[_0xe02c('0x37')]:_0x35a309[_0xe02c('0x33')];if(!_0x445421[_0xe02c('0x35')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x1e7eab['limit']=qs[_0xe02c('0x20')](_0x445421['query'][_0xe02c('0x20')]);_0x1e7eab[_0xe02c('0x1f')]=qs[_0xe02c('0x1f')](_0x445421[_0xe02c('0x35')][_0xe02c('0x1f')]);}_0x1e7eab[_0xe02c('0x3b')]=qs['sort'](_0x445421[_0xe02c('0x35')][_0xe02c('0x3c')]);_0x1e7eab['where']=qs[_0xe02c('0x3d')](_[_0xe02c('0x3e')](_0x445421['query'],_0x35a309[_0xe02c('0x3d')]),_0x1b8f21);if(_0x445421['query'][_0xe02c('0x3f')]){_0x1e7eab[_0xe02c('0x40')]=_['merge'](_0x1e7eab[_0xe02c('0x40')],{'$or':_[_0xe02c('0x2d')](_0x1b8f21,function(_0x2502c8){if(_0x2502c8[_0xe02c('0x31')]!==_0xe02c('0x41')){var _0x28922a={};_0x28922a[_0x2502c8['name']]={'$like':'%'+_0x445421[_0xe02c('0x35')]['filter']+'%'};return _0x28922a;}})});}_0x1e7eab=_['merge']({},_0x1e7eab,_0x445421[_0xe02c('0x42')]);var _0x1095fb={'where':_0x1e7eab[_0xe02c('0x40')]};return db[_0xe02c('0x2e')]['count'](_0x1095fb)[_0xe02c('0x26')](function(_0x17830e){_0x22a285[_0xe02c('0x22')]=_0x17830e;if(_0x445421['query']['includeAll']){_0x1e7eab[_0xe02c('0x43')]=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x44')](_0x1e7eab);})[_0xe02c('0x26')](function(_0x1b0876){_0x22a285[_0xe02c('0x45')]=_0x1b0876;return _0x22a285;})[_0xe02c('0x26')](respondWithFilteredResult(_0x287f7e,_0x1e7eab))[_0xe02c('0x46')](handleError(_0x287f7e,null));};exports[_0xe02c('0x47')]=function(_0x53d123,_0xc7e935){var _0x5ef4a1={'raw':![],'where':{'id':_0x53d123[_0xe02c('0x48')]['id']}},_0x4d4be5={};_0x4d4be5[_0xe02c('0x33')]=_[_0xe02c('0x34')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x4d4be5[_0xe02c('0x35')]=_[_0xe02c('0x34')](_0x53d123[_0xe02c('0x35')]);_0x4d4be5['filters']=_['intersection'](_0x4d4be5[_0xe02c('0x33')],_0x4d4be5[_0xe02c('0x35')]);_0x5ef4a1[_0xe02c('0x37')]=_['intersection'](_0x4d4be5[_0xe02c('0x33')],qs[_0xe02c('0x38')](_0x53d123[_0xe02c('0x35')][_0xe02c('0x38')]));_0x5ef4a1[_0xe02c('0x37')]=_0x5ef4a1[_0xe02c('0x37')][_0xe02c('0x49')]?_0x5ef4a1[_0xe02c('0x37')]:_0x4d4be5[_0xe02c('0x33')];if(_0x53d123[_0xe02c('0x35')]['includeAll']){_0x5ef4a1[_0xe02c('0x43')]=[{'all':!![]}];}_0x5ef4a1=_[_0xe02c('0x4a')]({},_0x5ef4a1,_0x53d123[_0xe02c('0x42')]);return db[_0xe02c('0x2e')][_0xe02c('0x4b')](_0x5ef4a1)[_0xe02c('0x26')](handleEntityNotFound(_0xc7e935,null))[_0xe02c('0x26')](respondWithResult(_0xc7e935,null))[_0xe02c('0x46')](handleError(_0xc7e935,null));};exports[_0xe02c('0x4c')]=function(_0x1176c9,_0xfed475){return db[_0xe02c('0x2e')][_0xe02c('0x4c')](_0x1176c9['body'],{})[_0xe02c('0x26')](respondWithResult(_0xfed475,0xc9))['catch'](handleError(_0xfed475,null));};exports[_0xe02c('0x25')]=function(_0x324911,_0x45a6df){if(_0x324911[_0xe02c('0x4d')]['id']){delete _0x324911[_0xe02c('0x4d')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x4b')]({'where':{'id':_0x324911[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x45a6df,null))[_0xe02c('0x26')](saveUpdates(_0x324911['body'],null))[_0xe02c('0x26')](respondWithResult(_0x45a6df,null))[_0xe02c('0x46')](handleError(_0x45a6df,null));};exports[_0xe02c('0x27')]=function(_0x536cf7,_0xdab6cb){return db['ZendeskAccount'][_0xe02c('0x4b')]({'where':{'id':_0x536cf7['params']['id']}})['then'](handleEntityNotFound(_0xdab6cb,null))['then'](removeEntity(_0xdab6cb,null))['catch'](handleError(_0xdab6cb,null));};exports['getConfigurations']=function(_0x5740df,_0x107f3f,_0x3ac0a5){var _0x1510aa={};var _0x35fbe2={};var _0x5d963d;var _0x274beb;return db[_0xe02c('0x2e')]['findOne']({'where':{'id':_0x5740df[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x107f3f,null))[_0xe02c('0x26')](function(_0x51f940){if(_0x51f940){_0x5d963d=_0x51f940;_0x35fbe2['model']=_[_0xe02c('0x34')](db[_0xe02c('0x4e')][_0xe02c('0x2f')]);_0x35fbe2['query']=_[_0xe02c('0x34')](_0x5740df['query']);_0x35fbe2['filters']=_[_0xe02c('0x36')](_0x35fbe2[_0xe02c('0x33')],_0x35fbe2['query']);_0x1510aa[_0xe02c('0x37')]=_[_0xe02c('0x36')](_0x35fbe2[_0xe02c('0x33')],qs['fields'](_0x5740df[_0xe02c('0x35')][_0xe02c('0x38')]));_0x1510aa['attributes']=_0x1510aa[_0xe02c('0x37')][_0xe02c('0x49')]?_0x1510aa[_0xe02c('0x37')]:_0x35fbe2[_0xe02c('0x33')];_0x1510aa[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x5740df[_0xe02c('0x35')][_0xe02c('0x3c')]);_0x1510aa[_0xe02c('0x40')]=qs['filters'](_['pick'](_0x5740df['query'],_0x35fbe2[_0xe02c('0x3d')]));if(_0x5740df[_0xe02c('0x35')][_0xe02c('0x3f')]){_0x1510aa['where']=_['merge'](_0x1510aa[_0xe02c('0x40')],{'$or':_[_0xe02c('0x2d')](_0x1510aa[_0xe02c('0x37')],function(_0xb50cfa){var _0xe02798={};_0xe02798[_0xb50cfa]={'$like':'%'+_0x5740df['query'][_0xe02c('0x3f')]+'%'};return _0xe02798;})});}_0x1510aa=_[_0xe02c('0x4a')]({},_0x1510aa,_0x5740df['options']);return _0x5d963d['getConfigurations'](_0x1510aa);}})[_0xe02c('0x26')](function(_0x566204){if(_0x566204){_0x274beb=_0x566204['length'];if(!_0x5740df['query'][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x1510aa[_0xe02c('0x20')]=qs[_0xe02c('0x20')](_0x5740df[_0xe02c('0x35')][_0xe02c('0x20')]);_0x1510aa['offset']=qs[_0xe02c('0x1f')](_0x5740df['query']['offset']);}return _0x5d963d[_0xe02c('0x4f')](_0x1510aa);}})[_0xe02c('0x26')](function(_0x44ba68){if(_0x44ba68){return _0x44ba68?{'count':_0x274beb,'rows':_0x44ba68}:null;}})[_0xe02c('0x26')](respondWithResult(_0x107f3f,null))['catch'](handleError(_0x107f3f,null));};exports[_0xe02c('0x50')]=function(_0x31c287,_0x5d2119,_0xa7133f){if(_0x31c287[_0xe02c('0x4d')]['id']){delete _0x31c287['body']['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x51')]({'where':{'id':_0x31c287[_0xe02c('0x48')]['id']}})[_0xe02c('0x26')](handleEntityNotFound(_0x5d2119,null))[_0xe02c('0x26')](function(_0x3a62a2){if(_0x3a62a2){_0x31c287[_0xe02c('0x4d')]['AccountId']=_0x3a62a2['id'];_0x31c287[_0xe02c('0x4d')]['Subjects']=integrations['getSubjects'](_0x31c287['body'][_0xe02c('0x52')],_0x31c287[_0xe02c('0x4d')][_0xe02c('0x31')]);_0x31c287[_0xe02c('0x4d')]['Descriptions']=integrations[_0xe02c('0x53')](_0x31c287[_0xe02c('0x4d')]['channel'],_0x31c287['body']['type']);return db[_0xe02c('0x4e')][_0xe02c('0x4c')](_0x31c287['body'],{'include':[{'model':db['ZendeskField'],'as':_0xe02c('0x54')},{'model':db[_0xe02c('0x55')],'as':_0xe02c('0x56')}]});}return null;})[_0xe02c('0x26')](respondWithResult(_0x5d2119,null))[_0xe02c('0x46')](handleError(_0x5d2119,null));};exports['getFields']=function(_0x39c7db,_0x12ac9f,_0x3f277b){var _0x2776c0='';return db[_0xe02c('0x2e')][_0xe02c('0x51')]({'where':{'id':_0x39c7db['params']['id']},'attributes':['id',_0xe02c('0x57'),_0xe02c('0x58'),'token',_0xe02c('0x59'),_0xe02c('0x5a')]})[_0xe02c('0x26')](handleEntityNotFound(_0x12ac9f,null))[_0xe02c('0x26')](function(_0x5d2455){if(_0x5d2455){_0x2776c0=_0x5d2455[_0xe02c('0x5a')];var _0x2229ae=_0x2776c0['slice'](-0x1);if(_0x2229ae==='/'){_0x2776c0=_0x2776c0['substring'](0x0,_0x2776c0['lastIndexOf'](_0x2229ae));}var _0x43977c={'method':_0xe02c('0x5b'),'uri':util[_0xe02c('0x5c')](_0xe02c('0x5d'),_0x2776c0,_0xe02c('0x5e')),'json':!![]};switch(_0x5d2455['authType']){case _0xe02c('0x58'):_0x43977c[_0xe02c('0x5f')]={'Authorization':util[_0xe02c('0x5c')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x5d2455[_0xe02c('0x57')],_0x5d2455[_0xe02c('0x58')]))[_0xe02c('0x60')](_0xe02c('0x61')))};break;case'token':_0x43977c[_0xe02c('0x5f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xe02c('0x5c')](_0xe02c('0x62'),_0x5d2455[_0xe02c('0x57')],_0x5d2455[_0xe02c('0x63')]))[_0xe02c('0x60')](_0xe02c('0x61')))};break;default:throw new db[(_0xe02c('0x64'))][(_0xe02c('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x43977c);}})[_0xe02c('0x26')](function(_0x21049f){if(_0x21049f){var _0x2386cf=[_0xe02c('0x66'),_0xe02c('0x67'),_0xe02c('0x68'),_0xe02c('0x69')];_[_0xe02c('0x6a')](_0x21049f[_0xe02c('0x5e')],function(_0x411cd5){return _0x2386cf['includes'](_0x411cd5['type']);});return{'count':_0x21049f[_0xe02c('0x5e')][_0xe02c('0x49')],'rows':_[_0xe02c('0x2d')](_0x21049f[_0xe02c('0x5e')],function(_0x108566){return{'id':_0x108566['id'],'name':_0x108566['position']>0x7?_0x108566[_0xe02c('0x6b')]:_0x108566[_0xe02c('0x31')],'custom':_0x108566[_0xe02c('0x6c')]>0x7?!![]:![],'options':_0x108566[_0xe02c('0x6d')]?_0x108566[_0xe02c('0x6d')]:_0x108566[_0xe02c('0x6e')]?_0x108566[_0xe02c('0x6e')]:[]};})};}})[_0xe02c('0x26')](respondWithResult(_0x12ac9f,null))[_0xe02c('0x46')](function(_0x159f58){var _0x287eca=_0x39c7db[_0xe02c('0x35')]['test']?0x1f4:_0x159f58['statusCode']||0x1f4;logger[_0xe02c('0x6f')](_0xe02c('0x70'),'getFields',_0x287eca,JSON[_0xe02c('0x71')](_0x159f58));delete _0x159f58['name'];if(_0x287eca===0x191){_0x287eca=0x190;}_0x12ac9f[_0xe02c('0x1e')](_0x287eca)['send'](_0x39c7db[_0xe02c('0x35')][_0xe02c('0x72')]?{'message':_0xe02c('0x73'),'statusCode':_0x159f58[_0xe02c('0x74')]}:_0x159f58);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 2522000..3159e72 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 _0x91f7=['moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x91f7,0x1e9));var _0x791f=function(_0xb05193,_0x14ac4a){_0xb05193=_0xb05193-0x0;var _0x52b6fb=_0x91f7[_0xb05193];return _0x52b6fb;};'use strict';var _=require(_0x791f('0x0'));var util=require(_0x791f('0x1'));var logger=require(_0x791f('0x2'))('api');var moment=require(_0x791f('0x3'));var BPromise=require('bluebird');var rp=require(_0x791f('0x4'));var fs=require('fs');var path=require(_0x791f('0x5'));var rimraf=require(_0x791f('0x6'));var config=require(_0x791f('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x791f('0x8'));module[_0x791f('0x9')]=function(_0x28e4ce,_0x30034e){return _0x28e4ce['define'](_0x791f('0xa'),attributes,{'tableName':_0x791f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac79=['./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xac79,0x1cc));var _0x9ac7=function(_0x592cfa,_0x1c1c41){_0x592cfa=_0x592cfa-0x0;var _0x59e891=_0xac79[_0x592cfa];return _0x59e891;};'use strict';var _=require(_0x9ac7('0x0'));var util=require('util');var logger=require(_0x9ac7('0x1'))(_0x9ac7('0x2'));var moment=require(_0x9ac7('0x3'));var BPromise=require(_0x9ac7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ac7('0x5'));var rimraf=require(_0x9ac7('0x6'));var config=require(_0x9ac7('0x7'));var attributes=require(_0x9ac7('0x8'));var integrations=require(_0x9ac7('0x9'));module['exports']=function(_0x20dc28,_0x20ec08){return _0x20dc28[_0x9ac7('0xa')](_0x9ac7('0xb'),attributes,{'tableName':_0x9ac7('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 808d2d7..a51f2a5 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 _0xc991=['ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','request\x20sent','result','GetZendeskAccount','ZendeskAccount','options','where','attributes','include','map','model','then','catch','ShowZendeskAccount','find','raw','stringify','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','debug'];(function(_0x1da196,_0x4b4bc4){var _0x597847=function(_0x1aa142){while(--_0x1aa142){_0x1da196['push'](_0x1da196['shift']());}};_0x597847(++_0x4b4bc4);}(_0xc991,0xfc));var _0x1c99=function(_0x4b0c9c,_0x156e17){_0x4b0c9c=_0x4b0c9c-0x0;var _0x188541=_0xc991[_0x4b0c9c];return _0x188541;};'use strict';var _=require(_0x1c99('0x0'));var util=require(_0x1c99('0x1'));var moment=require('moment');var BPromise=require(_0x1c99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c99('0x3'));var db=require(_0x1c99('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c99('0x5'));var config=require(_0x1c99('0x6'));var jayson=require(_0x1c99('0x7'));var client=jayson['client'][_0x1c99('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x561f40,_0x2d714e,_0x216821){return new BPromise(function(_0x43a2fb,_0x24bab7){return client[_0x1c99('0x9')](_0x561f40,_0x216821)['then'](function(_0x170cbd){logger[_0x1c99('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x2d714e,'request\x20sent');logger[_0x1c99('0xb')](_0x1c99('0xc'),_0x2d714e,'request\x20sent',JSON['stringify'](_0x170cbd));if(_0x170cbd[_0x1c99('0xd')]){if(_0x170cbd[_0x1c99('0xd')][_0x1c99('0xe')]===0x1f4){logger[_0x1c99('0xd')](_0x1c99('0xf'),_0x2d714e,_0x170cbd[_0x1c99('0xd')][_0x1c99('0x10')]);return _0x24bab7(_0x170cbd[_0x1c99('0xd')][_0x1c99('0x10')]);}logger[_0x1c99('0xd')](_0x1c99('0xf'),_0x2d714e,_0x170cbd['error'][_0x1c99('0x10')]);return _0x43a2fb(_0x170cbd['error'][_0x1c99('0x10')]);}else{logger[_0x1c99('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x2d714e,_0x1c99('0x11'));_0x43a2fb(_0x170cbd[_0x1c99('0x12')][_0x1c99('0x10')]);}})['catch'](function(_0x3216a7){logger[_0x1c99('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x2d714e,_0x3216a7);_0x24bab7(_0x3216a7);});});}exports[_0x1c99('0x13')]=function(_0x1ff07f){var _0x505e6d=this;return new Promise(function(_0x223e4b,_0x39a8a6){return db[_0x1c99('0x14')]['findAll']({'raw':_0x1ff07f['options']?_0x1ff07f[_0x1c99('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1ff07f[_0x1c99('0x15')]?_0x1ff07f['options'][_0x1c99('0x16')]||null:null,'attributes':_0x1ff07f[_0x1c99('0x15')]?_0x1ff07f[_0x1c99('0x15')][_0x1c99('0x17')]||null:null,'limit':_0x1ff07f['options']?_0x1ff07f['options']['limit']||null:null,'include':_0x1ff07f[_0x1c99('0x15')]?_0x1ff07f[_0x1c99('0x15')][_0x1c99('0x18')]?_[_0x1c99('0x19')](_0x1ff07f[_0x1c99('0x15')][_0x1c99('0x18')],function(_0x2504a9){return{'model':db[_0x2504a9[_0x1c99('0x1a')]],'as':_0x2504a9['as'],'attributes':_0x2504a9['attributes'],'include':_0x2504a9[_0x1c99('0x18')]?_[_0x1c99('0x19')](_0x2504a9[_0x1c99('0x18')],function(_0x4764b5){return{'model':db[_0x4764b5['model']],'as':_0x4764b5['as'],'attributes':_0x4764b5[_0x1c99('0x17')],'include':_0x4764b5['include']?_[_0x1c99('0x19')](_0x4764b5[_0x1c99('0x18')],function(_0x510f77){return{'model':db[_0x510f77[_0x1c99('0x1a')]],'as':_0x510f77['as'],'attributes':_0x510f77['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c99('0x1b')](function(_0x47ccb5){logger['info'](_0x1c99('0x13'),_0x1ff07f);logger['debug'](_0x1c99('0x13'),_0x1ff07f,JSON['stringify'](_0x47ccb5));_0x223e4b(_0x47ccb5);})[_0x1c99('0x1c')](function(_0x392b5d){logger[_0x1c99('0xd')](_0x1c99('0x13'),_0x392b5d[_0x1c99('0x10')],_0x1ff07f);_0x39a8a6(_0x505e6d[_0x1c99('0xd')](0x1f4,_0x392b5d[_0x1c99('0x10')]));});});};exports[_0x1c99('0x1d')]=function(_0x2b93e4){var _0x51eace=this;return new Promise(function(_0xa479d0,_0x57eb06){return db[_0x1c99('0x14')][_0x1c99('0x1e')]({'raw':_0x2b93e4[_0x1c99('0x15')]?_0x2b93e4[_0x1c99('0x15')][_0x1c99('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b93e4['options']?_0x2b93e4[_0x1c99('0x15')][_0x1c99('0x16')]||null:null,'attributes':_0x2b93e4[_0x1c99('0x15')]?_0x2b93e4[_0x1c99('0x15')][_0x1c99('0x17')]||null:null,'include':_0x2b93e4['options']?_0x2b93e4[_0x1c99('0x15')][_0x1c99('0x18')]?_[_0x1c99('0x19')](_0x2b93e4[_0x1c99('0x15')]['include'],function(_0x5cbd4a){return{'model':db[_0x5cbd4a[_0x1c99('0x1a')]],'as':_0x5cbd4a['as'],'attributes':_0x5cbd4a[_0x1c99('0x17')],'include':_0x5cbd4a[_0x1c99('0x18')]?_[_0x1c99('0x19')](_0x5cbd4a[_0x1c99('0x18')],function(_0x3eb857){return{'model':db[_0x3eb857[_0x1c99('0x1a')]],'as':_0x3eb857['as'],'attributes':_0x3eb857[_0x1c99('0x17')],'include':_0x3eb857[_0x1c99('0x18')]?_['map'](_0x3eb857[_0x1c99('0x18')],function(_0x17a5e7){return{'model':db[_0x17a5e7[_0x1c99('0x1a')]],'as':_0x17a5e7['as'],'attributes':_0x17a5e7[_0x1c99('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1c99('0x1b')](function(_0x14a852){logger['info'](_0x1c99('0x1d'),_0x2b93e4);logger['debug'](_0x1c99('0x1d'),_0x2b93e4,JSON[_0x1c99('0x20')](_0x14a852));_0xa479d0(_0x14a852);})[_0x1c99('0x1c')](function(_0x480eb7){logger['error'](_0x1c99('0x1d'),_0x480eb7[_0x1c99('0x10')],_0x2b93e4);_0x57eb06(_0x51eace[_0x1c99('0xd')](0x1f4,_0x480eb7['message']));});});}; \ No newline at end of file +var _0xf0ce=['catch','ShowZendeskAccount','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','info','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model'];(function(_0x5e068e,_0x28ff2e){var _0x329514=function(_0x1c9815){while(--_0x1c9815){_0x5e068e['push'](_0x5e068e['shift']());}};_0x329514(++_0x28ff2e);}(_0xf0ce,0xb7));var _0xef0c=function(_0x59e0a2,_0x1019e7){_0x59e0a2=_0x59e0a2-0x0;var _0x28229e=_0xf0ce[_0x59e0a2];return _0x28229e;};'use strict';var _=require('lodash');var util=require(_0xef0c('0x0'));var moment=require(_0xef0c('0x1'));var BPromise=require(_0xef0c('0x2'));var rs=require(_0xef0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef0c('0x4'))['db'];var utils=require(_0xef0c('0x5'));var logger=require(_0xef0c('0x6'))(_0xef0c('0x7'));var config=require(_0xef0c('0x8'));var jayson=require(_0xef0c('0x9'));var client=jayson[_0xef0c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x581179,_0x2d5235,_0x5a75e3){return new BPromise(function(_0x4e8b17,_0x4378ba){return client[_0xef0c('0xb')](_0x581179,_0x5a75e3)[_0xef0c('0xc')](function(_0x4b81d5){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x2d5235,_0xef0c('0xd'));logger[_0xef0c('0xe')](_0xef0c('0xf'),_0x2d5235,'request\x20sent',JSON[_0xef0c('0x10')](_0x4b81d5));if(_0x4b81d5['error']){if(_0x4b81d5[_0xef0c('0x11')][_0xef0c('0x12')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x2d5235,_0x4b81d5[_0xef0c('0x11')][_0xef0c('0x13')]);return _0x4378ba(_0x4b81d5[_0xef0c('0x11')][_0xef0c('0x13')]);}logger[_0xef0c('0x11')](_0xef0c('0x14'),_0x2d5235,_0x4b81d5[_0xef0c('0x11')][_0xef0c('0x13')]);return _0x4e8b17(_0x4b81d5['error'][_0xef0c('0x13')]);}else{logger[_0xef0c('0x15')](_0xef0c('0x14'),_0x2d5235,_0xef0c('0xd'));_0x4e8b17(_0x4b81d5[_0xef0c('0x16')][_0xef0c('0x13')]);}})['catch'](function(_0x349dac){logger[_0xef0c('0x11')](_0xef0c('0x14'),_0x2d5235,_0x349dac);_0x4378ba(_0x349dac);});});}exports[_0xef0c('0x17')]=function(_0x1fcefe){var _0x377f34=this;return new Promise(function(_0x4d43db,_0x422420){return db[_0xef0c('0x18')][_0xef0c('0x19')]({'raw':_0x1fcefe[_0xef0c('0x1a')]?_0x1fcefe[_0xef0c('0x1a')][_0xef0c('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fcefe[_0xef0c('0x1a')]?_0x1fcefe[_0xef0c('0x1a')][_0xef0c('0x1c')]||null:null,'attributes':_0x1fcefe[_0xef0c('0x1a')]?_0x1fcefe['options'][_0xef0c('0x1d')]||null:null,'limit':_0x1fcefe['options']?_0x1fcefe[_0xef0c('0x1a')]['limit']||null:null,'include':_0x1fcefe[_0xef0c('0x1a')]?_0x1fcefe[_0xef0c('0x1a')][_0xef0c('0x1e')]?_[_0xef0c('0x1f')](_0x1fcefe[_0xef0c('0x1a')][_0xef0c('0x1e')],function(_0x137eb4){return{'model':db[_0x137eb4[_0xef0c('0x20')]],'as':_0x137eb4['as'],'attributes':_0x137eb4['attributes'],'include':_0x137eb4[_0xef0c('0x1e')]?_[_0xef0c('0x1f')](_0x137eb4[_0xef0c('0x1e')],function(_0xd9db4b){return{'model':db[_0xd9db4b['model']],'as':_0xd9db4b['as'],'attributes':_0xd9db4b[_0xef0c('0x1d')],'include':_0xd9db4b[_0xef0c('0x1e')]?_[_0xef0c('0x1f')](_0xd9db4b[_0xef0c('0x1e')],function(_0x3427fc){return{'model':db[_0x3427fc[_0xef0c('0x20')]],'as':_0x3427fc['as'],'attributes':_0x3427fc[_0xef0c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef0c('0xc')](function(_0x44153c){logger[_0xef0c('0x15')](_0xef0c('0x17'),_0x1fcefe);logger[_0xef0c('0xe')](_0xef0c('0x17'),_0x1fcefe,JSON['stringify'](_0x44153c));_0x4d43db(_0x44153c);})[_0xef0c('0x21')](function(_0x2d2c8b){logger[_0xef0c('0x11')](_0xef0c('0x17'),_0x2d2c8b[_0xef0c('0x13')],_0x1fcefe);_0x422420(_0x377f34[_0xef0c('0x11')](0x1f4,_0x2d2c8b[_0xef0c('0x13')]));});});};exports[_0xef0c('0x22')]=function(_0x11ce8a){var _0x5c31ee=this;return new Promise(function(_0x1e485c,_0x6b0cdb){return db[_0xef0c('0x18')][_0xef0c('0x23')]({'raw':_0x11ce8a[_0xef0c('0x1a')]?_0x11ce8a[_0xef0c('0x1a')][_0xef0c('0x1b')]===undefined?!![]:![]:!![],'where':_0x11ce8a[_0xef0c('0x1a')]?_0x11ce8a['options']['where']||null:null,'attributes':_0x11ce8a[_0xef0c('0x1a')]?_0x11ce8a[_0xef0c('0x1a')][_0xef0c('0x1d')]||null:null,'include':_0x11ce8a['options']?_0x11ce8a['options']['include']?_['map'](_0x11ce8a[_0xef0c('0x1a')][_0xef0c('0x1e')],function(_0x485e06){return{'model':db[_0x485e06[_0xef0c('0x20')]],'as':_0x485e06['as'],'attributes':_0x485e06[_0xef0c('0x1d')],'include':_0x485e06[_0xef0c('0x1e')]?_['map'](_0x485e06[_0xef0c('0x1e')],function(_0x175067){return{'model':db[_0x175067[_0xef0c('0x20')]],'as':_0x175067['as'],'attributes':_0x175067[_0xef0c('0x1d')],'include':_0x175067[_0xef0c('0x1e')]?_['map'](_0x175067[_0xef0c('0x1e')],function(_0x500baa){return{'model':db[_0x500baa[_0xef0c('0x20')]],'as':_0x500baa['as'],'attributes':_0x500baa[_0xef0c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef0c('0xc')](function(_0x57d798){logger[_0xef0c('0x15')](_0xef0c('0x22'),_0x11ce8a);logger[_0xef0c('0xe')]('ShowZendeskAccount',_0x11ce8a,JSON[_0xef0c('0x10')](_0x57d798));_0x1e485c(_0x57d798);})['catch'](function(_0x5ee563){logger[_0xef0c('0x11')](_0xef0c('0x22'),_0x5ee563[_0xef0c('0x13')],_0x11ce8a);_0x6b0cdb(_0x5c31ee[_0xef0c('0x11')](0x1f4,_0x5ee563[_0xef0c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index f0e5026..d9cb598 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 _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3a081b,_0x516437){_0x3a081b=_0x3a081b-0x0;var _0xb166c4=_0xbdb7[_0x3a081b];return _0xb166c4;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file +var _0x7916=['getDescriptions','get','/:id/tags','getTags','post','create','setTags','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x33bd6e,_0x21d0db){var _0xe0d7e8=function(_0x592cbb){while(--_0x592cbb){_0x33bd6e['push'](_0x33bd6e['shift']());}};_0xe0d7e8(++_0x21d0db);}(_0x7916,0x128));var _0x6791=function(_0xf127e4,_0x2b897b){_0xf127e4=_0xf127e4-0x0;var _0x2bdacb=_0x7916[_0xf127e4];return _0x2bdacb;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['get']('/:id/fields',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['get'](_0x6791('0xf'),auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);router[_0x6791('0x11')](_0x6791('0x12'),auth[_0x6791('0x8')](),controller[_0x6791('0x13')]);router[_0x6791('0x14')]('/',auth[_0x6791('0x8')](),controller[_0x6791('0x15')]);router[_0x6791('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6791('0x16')]);router['put'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0x17')]);router[_0x6791('0x18')]('/:id',auth[_0x6791('0x8')](),controller['destroy']);module[_0x6791('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 14252b0..e2ecfca 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 _0xf513=['sequelize','STRING'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xf513,0x1f2));var _0x3f51=function(_0x543ee4,_0x127b27){_0x543ee4=_0x543ee4-0x0;var _0x20c772=_0xf513[_0x543ee4];return _0x20c772;};'use strict';var Sequelize=require(_0x3f51('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f51('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1cd8=['sequelize'];(function(_0xf73390,_0x14c109){var _0x4b212f=function(_0x3e2b63){while(--_0x3e2b63){_0xf73390['push'](_0xf73390['shift']());}};_0x4b212f(++_0x14c109);}(_0x1cd8,0x9a));var _0x81cd=function(_0xd8bdf0,_0x11fd9f){_0xd8bdf0=_0xd8bdf0-0x0;var _0x499268=_0x1cd8[_0xd8bdf0];return _0x499268;};'use strict';var Sequelize=require(_0x81cd('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 8895c25..46333fd 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 _0x1222=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','apply','save','update','then','destroy','end','name','map','ZendeskConfiguration','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','ZendeskField','pick','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','moment','bluebird','util'];(function(_0x36f6e4,_0x4b0186){var _0x13f9b8=function(_0x85eb52){while(--_0x85eb52){_0x36f6e4['push'](_0x36f6e4['shift']());}};_0x13f9b8(++_0x4b0186);}(_0x1222,0x1d4));var _0x2122=function(_0x50924e,_0x275475){_0x50924e=_0x50924e-0x0;var _0x331605=_0x1222[_0x50924e];return _0x331605;};'use strict';var emlformat=require(_0x2122('0x0'));var rimraf=require(_0x2122('0x1'));var zipdir=require(_0x2122('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2122('0x3'));var BPromise=require(_0x2122('0x4'));var Mustache=require('mustache');var util=require(_0x2122('0x5'));var path=require(_0x2122('0x6'));var sox=require(_0x2122('0x7'));var csv=require(_0x2122('0x8'));var ejs=require(_0x2122('0x9'));var fs=require('fs');var fs_extra=require(_0x2122('0xa'));var _=require(_0x2122('0xb'));var squel=require('squel');var crypto=require(_0x2122('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2122('0x8'));var querystring=require('querystring');var Papa=require(_0x2122('0xd'));var Redis=require(_0x2122('0xe'));var authService=require(_0x2122('0xf'));var qs=require(_0x2122('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2122('0x11'));var logger=require(_0x2122('0x12'))(_0x2122('0x13'));var utils=require(_0x2122('0x14'));var config=require(_0x2122('0x15'));var licenseUtil=require(_0x2122('0x16'));var db=require(_0x2122('0x17'))['db'];function respondWithStatusCode(_0x377392,_0xb07e5b){_0xb07e5b=_0xb07e5b||0xcc;return function(_0x2cdef5){if(_0x2cdef5){return _0x377392[_0x2122('0x18')](_0xb07e5b);}return _0x377392['status'](_0xb07e5b)['end']();};}function respondWithResult(_0x4c2318,_0x4febda){_0x4febda=_0x4febda||0xc8;return function(_0x5a618f){if(_0x5a618f){return _0x4c2318['status'](_0x4febda)[_0x2122('0x19')](_0x5a618f);}};}function respondWithFilteredResult(_0x124aab,_0x2fba43){return function(_0x463dbc){if(_0x463dbc){var _0xa81da8=typeof _0x2fba43[_0x2122('0x1a')]===_0x2122('0x1b')&&typeof _0x2fba43[_0x2122('0x1c')]===_0x2122('0x1b');var _0xa5535a=_0x463dbc[_0x2122('0x1d')];var _0xfe037b=_0xa81da8?0x0:_0x2fba43['offset'];var _0x3c4c75=_0xa81da8?_0x463dbc['count']:_0x2fba43[_0x2122('0x1a')]+_0x2fba43[_0x2122('0x1c')];var _0x22605c;if(_0x3c4c75>=_0xa5535a){_0x3c4c75=_0xa5535a;_0x22605c=0xc8;}else{_0x22605c=0xce;}_0x124aab[_0x2122('0x1e')](_0x22605c);return _0x124aab[_0x2122('0x1f')]('Content-Range',_0xfe037b+'-'+_0x3c4c75+'/'+_0xa5535a)['json'](_0x463dbc);}return null;};}function patchUpdates(_0x5ea81d){return function(_0x44d291){try{jsonpatch[_0x2122('0x20')](_0x44d291,_0x5ea81d,!![]);}catch(_0x374e1f){return BPromise['reject'](_0x374e1f);}return _0x44d291[_0x2122('0x21')]();};}function saveUpdates(_0x48e90f,_0x5a28e1){return function(_0xf86f28){if(_0xf86f28){return _0xf86f28[_0x2122('0x22')](_0x48e90f)[_0x2122('0x23')](function(_0x4d6ea0){return _0x4d6ea0;});}return null;};}function removeEntity(_0x383c69,_0x5a9cda){return function(_0x5b4b49){if(_0x5b4b49){return _0x5b4b49[_0x2122('0x24')]()[_0x2122('0x23')](function(){_0x383c69[_0x2122('0x1e')](0xcc)[_0x2122('0x25')]();});}};}function handleEntityNotFound(_0x266154,_0x5b461e){return function(_0x38223d){if(!_0x38223d){_0x266154['sendStatus'](0x194);}return _0x38223d;};}function handleError(_0x57e1ae,_0x5a066b){_0x5a066b=_0x5a066b||0x1f4;return function(_0x5697ab){logger['error'](_0x5697ab['stack']);if(_0x5697ab[_0x2122('0x26')]){delete _0x5697ab[_0x2122('0x26')];}_0x57e1ae[_0x2122('0x1e')](_0x5a066b)['send'](_0x5697ab);};}exports['index']=function(_0x3b6e80,_0xccc72a){var _0x516baf={},_0x9bc013={},_0x3e0572={'count':0x0,'rows':[]};var _0x31e36a=_[_0x2122('0x27')](db[_0x2122('0x28')]['rawAttributes'],function(_0x3d706d){return{'name':_0x3d706d[_0x2122('0x29')],'type':_0x3d706d[_0x2122('0x2a')][_0x2122('0x2b')]};});_0x9bc013[_0x2122('0x2c')]=_['map'](_0x31e36a,_0x2122('0x26'));_0x9bc013['query']=_[_0x2122('0x2d')](_0x3b6e80[_0x2122('0x2e')]);_0x9bc013['filters']=_[_0x2122('0x2f')](_0x9bc013[_0x2122('0x2c')],_0x9bc013[_0x2122('0x2e')]);_0x516baf[_0x2122('0x30')]=_['intersection'](_0x9bc013[_0x2122('0x2c')],qs[_0x2122('0x31')](_0x3b6e80[_0x2122('0x2e')][_0x2122('0x31')]));_0x516baf[_0x2122('0x30')]=_0x516baf[_0x2122('0x30')][_0x2122('0x32')]?_0x516baf[_0x2122('0x30')]:_0x9bc013[_0x2122('0x2c')];if(!_0x3b6e80[_0x2122('0x2e')][_0x2122('0x33')](_0x2122('0x34'))){_0x516baf[_0x2122('0x1c')]=qs[_0x2122('0x1c')](_0x3b6e80[_0x2122('0x2e')]['limit']);_0x516baf['offset']=qs[_0x2122('0x1a')](_0x3b6e80[_0x2122('0x2e')][_0x2122('0x1a')]);}_0x516baf[_0x2122('0x35')]=qs[_0x2122('0x36')](_0x3b6e80['query'][_0x2122('0x36')]);_0x516baf['where']=qs[_0x2122('0x37')](_['pick'](_0x3b6e80['query'],_0x9bc013[_0x2122('0x37')]),_0x31e36a);if(_0x3b6e80[_0x2122('0x2e')][_0x2122('0x38')]){_0x516baf['where']=_['merge'](_0x516baf[_0x2122('0x39')],{'$or':_[_0x2122('0x27')](_0x31e36a,function(_0x1d48f7){if(_0x1d48f7['type']!==_0x2122('0x3a')){var _0x33099a={};_0x33099a[_0x1d48f7['name']]={'$like':'%'+_0x3b6e80[_0x2122('0x2e')][_0x2122('0x38')]+'%'};return _0x33099a;}})});}_0x516baf=_[_0x2122('0x3b')]({},_0x516baf,_0x3b6e80[_0x2122('0x3c')]);var _0x12a287={'where':_0x516baf[_0x2122('0x39')]};return db[_0x2122('0x28')][_0x2122('0x1d')](_0x12a287)[_0x2122('0x23')](function(_0x4d523d){_0x3e0572[_0x2122('0x1d')]=_0x4d523d;if(_0x3b6e80[_0x2122('0x2e')]['includeAll']){_0x516baf['include']=[{'all':!![]}];}return db[_0x2122('0x28')][_0x2122('0x3d')](_0x516baf);})[_0x2122('0x23')](function(_0x18f004){_0x3e0572[_0x2122('0x3e')]=_0x18f004;return _0x3e0572;})['then'](respondWithFilteredResult(_0xccc72a,_0x516baf))[_0x2122('0x3f')](handleError(_0xccc72a,null));};exports['show']=function(_0x388354,_0x340129){var _0x40d472={'raw':![],'where':{'id':_0x388354[_0x2122('0x40')]['id']}},_0x950023={};_0x950023[_0x2122('0x2c')]=_[_0x2122('0x2d')](db[_0x2122('0x28')][_0x2122('0x41')]);_0x950023['query']=_['keys'](_0x388354[_0x2122('0x2e')]);_0x950023[_0x2122('0x37')]=_[_0x2122('0x2f')](_0x950023[_0x2122('0x2c')],_0x950023['query']);_0x40d472[_0x2122('0x30')]=_[_0x2122('0x2f')](_0x950023['model'],qs['fields'](_0x388354['query'][_0x2122('0x31')]));_0x40d472[_0x2122('0x30')]=_0x40d472[_0x2122('0x30')][_0x2122('0x32')]?_0x40d472[_0x2122('0x30')]:_0x950023[_0x2122('0x2c')];if(_0x388354[_0x2122('0x2e')][_0x2122('0x42')]){_0x40d472['include']=[{'all':!![]}];}_0x40d472=_[_0x2122('0x3b')]({},_0x40d472,_0x388354[_0x2122('0x3c')]);return db[_0x2122('0x28')][_0x2122('0x43')](_0x40d472)[_0x2122('0x23')](handleEntityNotFound(_0x340129,null))[_0x2122('0x23')](respondWithResult(_0x340129,null))['catch'](handleError(_0x340129,null));};exports[_0x2122('0x44')]=function(_0x4c1592,_0x14aaaf){return db[_0x2122('0x28')][_0x2122('0x44')](_0x4c1592[_0x2122('0x45')],{})[_0x2122('0x23')](respondWithResult(_0x14aaaf,0xc9))[_0x2122('0x3f')](handleError(_0x14aaaf,null));};exports[_0x2122('0x22')]=function(_0x6b38a6,_0x1382e6){if(_0x6b38a6[_0x2122('0x45')]['id']){delete _0x6b38a6['body']['id'];}return db[_0x2122('0x28')][_0x2122('0x43')]({'where':{'id':_0x6b38a6[_0x2122('0x40')]['id']}})[_0x2122('0x23')](handleEntityNotFound(_0x1382e6,null))[_0x2122('0x23')](saveUpdates(_0x6b38a6[_0x2122('0x45')],null))[_0x2122('0x23')](respondWithResult(_0x1382e6,null))['catch'](handleError(_0x1382e6,null));};exports[_0x2122('0x24')]=function(_0x181223,_0x314236){return db[_0x2122('0x28')][_0x2122('0x43')]({'where':{'id':_0x181223[_0x2122('0x40')]['id']}})[_0x2122('0x23')](handleEntityNotFound(_0x314236,null))[_0x2122('0x23')](removeEntity(_0x314236,null))[_0x2122('0x3f')](handleError(_0x314236,null));};exports['getFields']=function(_0x4267f8,_0x36d94e,_0x1981a7){var _0x3db544={};var _0x26f92a={};var _0x466859;var _0x4fa448;return db[_0x2122('0x28')]['findOne']({'where':{'id':_0x4267f8[_0x2122('0x40')]['id']}})[_0x2122('0x23')](handleEntityNotFound(_0x36d94e,null))[_0x2122('0x23')](function(_0x38e839){if(_0x38e839){_0x466859=_0x38e839;_0x26f92a['model']=_[_0x2122('0x2d')](db[_0x2122('0x46')][_0x2122('0x41')]);_0x26f92a[_0x2122('0x2e')]=_[_0x2122('0x2d')](_0x4267f8['query']);_0x26f92a[_0x2122('0x37')]=_[_0x2122('0x2f')](_0x26f92a[_0x2122('0x2c')],_0x26f92a[_0x2122('0x2e')]);_0x3db544[_0x2122('0x30')]=_[_0x2122('0x2f')](_0x26f92a[_0x2122('0x2c')],qs[_0x2122('0x31')](_0x4267f8['query'][_0x2122('0x31')]));_0x3db544[_0x2122('0x30')]=_0x3db544[_0x2122('0x30')]['length']?_0x3db544['attributes']:_0x26f92a[_0x2122('0x2c')];_0x3db544[_0x2122('0x35')]=qs['sort'](_0x4267f8['query'][_0x2122('0x36')]);_0x3db544[_0x2122('0x39')]=qs[_0x2122('0x37')](_[_0x2122('0x47')](_0x4267f8['query'],_0x26f92a['filters']));if(_0x4267f8[_0x2122('0x2e')][_0x2122('0x38')]){_0x3db544[_0x2122('0x39')]=_[_0x2122('0x3b')](_0x3db544['where'],{'$or':_[_0x2122('0x27')](_0x3db544[_0x2122('0x30')],function(_0x3c8622){var _0x4ecb41={};_0x4ecb41[_0x3c8622]={'$like':'%'+_0x4267f8['query'][_0x2122('0x38')]+'%'};return _0x4ecb41;})});}_0x3db544=_[_0x2122('0x3b')]({},_0x3db544,_0x4267f8[_0x2122('0x3c')]);return _0x466859['getFields'](_0x3db544);}})['then'](function(_0x5751c2){if(_0x5751c2){_0x4fa448=_0x5751c2[_0x2122('0x32')];if(!_0x4267f8[_0x2122('0x2e')]['hasOwnProperty'](_0x2122('0x34'))){_0x3db544[_0x2122('0x1c')]=qs[_0x2122('0x1c')](_0x4267f8['query'][_0x2122('0x1c')]);_0x3db544[_0x2122('0x1a')]=qs['offset'](_0x4267f8[_0x2122('0x2e')][_0x2122('0x1a')]);}return _0x466859['getFields'](_0x3db544);}})[_0x2122('0x23')](function(_0x1640a9){if(_0x1640a9){return _0x1640a9?{'count':_0x4fa448,'rows':_0x1640a9}:null;}})['then'](respondWithResult(_0x36d94e,null))[_0x2122('0x3f')](handleError(_0x36d94e,null));};exports[_0x2122('0x48')]=function(_0x2df02b,_0x17ffc4,_0x3d2de7){var _0x3d46af={};var _0x4c22a7={};var _0x29ac25;var _0x24497e;return db[_0x2122('0x28')]['findOne']({'where':{'id':_0x2df02b[_0x2122('0x40')]['id']}})['then'](handleEntityNotFound(_0x17ffc4,null))['then'](function(_0x4ca88a){if(_0x4ca88a){_0x29ac25=_0x4ca88a;_0x4c22a7['model']=_['keys'](db['ZendeskField'][_0x2122('0x41')]);_0x4c22a7[_0x2122('0x2e')]=_[_0x2122('0x2d')](_0x2df02b[_0x2122('0x2e')]);_0x4c22a7[_0x2122('0x37')]=_[_0x2122('0x2f')](_0x4c22a7['model'],_0x4c22a7[_0x2122('0x2e')]);_0x3d46af['attributes']=_[_0x2122('0x2f')](_0x4c22a7[_0x2122('0x2c')],qs['fields'](_0x2df02b[_0x2122('0x2e')][_0x2122('0x31')]));_0x3d46af[_0x2122('0x30')]=_0x3d46af['attributes']['length']?_0x3d46af[_0x2122('0x30')]:_0x4c22a7['model'];_0x3d46af[_0x2122('0x35')]=qs[_0x2122('0x36')](_0x2df02b[_0x2122('0x2e')][_0x2122('0x36')]);_0x3d46af[_0x2122('0x39')]=qs['filters'](_[_0x2122('0x47')](_0x2df02b[_0x2122('0x2e')],_0x4c22a7[_0x2122('0x37')]));if(_0x2df02b[_0x2122('0x2e')][_0x2122('0x38')]){_0x3d46af[_0x2122('0x39')]=_[_0x2122('0x3b')](_0x3d46af[_0x2122('0x39')],{'$or':_[_0x2122('0x27')](_0x3d46af['attributes'],function(_0x39eb5f){var _0x14751b={};_0x14751b[_0x39eb5f]={'$like':'%'+_0x2df02b['query'][_0x2122('0x38')]+'%'};return _0x14751b;})});}_0x3d46af=_[_0x2122('0x3b')]({},_0x3d46af,_0x2df02b['options']);return _0x29ac25[_0x2122('0x48')](_0x3d46af);}})[_0x2122('0x23')](function(_0x2886cf){if(_0x2886cf){_0x24497e=_0x2886cf['length'];if(!_0x2df02b[_0x2122('0x2e')][_0x2122('0x33')](_0x2122('0x34'))){_0x3d46af[_0x2122('0x1c')]=qs[_0x2122('0x1c')](_0x2df02b['query'][_0x2122('0x1c')]);_0x3d46af[_0x2122('0x1a')]=qs[_0x2122('0x1a')](_0x2df02b[_0x2122('0x2e')]['offset']);}return _0x29ac25[_0x2122('0x48')](_0x3d46af);}})[_0x2122('0x23')](function(_0x2a096c){if(_0x2a096c){return _0x2a096c?{'count':_0x24497e,'rows':_0x2a096c}:null;}})['then'](respondWithResult(_0x17ffc4,null))[_0x2122('0x3f')](handleError(_0x17ffc4,null));};exports[_0x2122('0x49')]=function(_0x1291c5,_0x2c64c9,_0x1f4945){var _0x3fdc56={};var _0x4fea30={};var _0x228840;var _0x56f43d;return db[_0x2122('0x28')][_0x2122('0x4a')]({'where':{'id':_0x1291c5['params']['id']}})[_0x2122('0x23')](handleEntityNotFound(_0x2c64c9,null))[_0x2122('0x23')](function(_0x574622){if(_0x574622){_0x228840=_0x574622;_0x4fea30[_0x2122('0x2c')]=_['keys'](db[_0x2122('0x46')]['rawAttributes']);_0x4fea30[_0x2122('0x2e')]=_[_0x2122('0x2d')](_0x1291c5[_0x2122('0x2e')]);_0x4fea30[_0x2122('0x37')]=_[_0x2122('0x2f')](_0x4fea30['model'],_0x4fea30['query']);_0x3fdc56[_0x2122('0x30')]=_[_0x2122('0x2f')](_0x4fea30[_0x2122('0x2c')],qs[_0x2122('0x31')](_0x1291c5['query'][_0x2122('0x31')]));_0x3fdc56['attributes']=_0x3fdc56[_0x2122('0x30')][_0x2122('0x32')]?_0x3fdc56[_0x2122('0x30')]:_0x4fea30[_0x2122('0x2c')];_0x3fdc56[_0x2122('0x35')]=qs[_0x2122('0x36')](_0x1291c5[_0x2122('0x2e')][_0x2122('0x36')]);_0x3fdc56['where']=qs[_0x2122('0x37')](_[_0x2122('0x47')](_0x1291c5[_0x2122('0x2e')],_0x4fea30['filters']));if(_0x1291c5[_0x2122('0x2e')][_0x2122('0x38')]){_0x3fdc56[_0x2122('0x39')]=_[_0x2122('0x3b')](_0x3fdc56['where'],{'$or':_[_0x2122('0x27')](_0x3fdc56[_0x2122('0x30')],function(_0x401e09){var _0x831318={};_0x831318[_0x401e09]={'$like':'%'+_0x1291c5[_0x2122('0x2e')][_0x2122('0x38')]+'%'};return _0x831318;})});}_0x3fdc56=_[_0x2122('0x3b')]({},_0x3fdc56,_0x1291c5[_0x2122('0x3c')]);return _0x228840['getDescriptions'](_0x3fdc56);}})[_0x2122('0x23')](function(_0x32fc2c){if(_0x32fc2c){_0x56f43d=_0x32fc2c[_0x2122('0x32')];if(!_0x1291c5[_0x2122('0x2e')]['hasOwnProperty']('nolimit')){_0x3fdc56[_0x2122('0x1c')]=qs[_0x2122('0x1c')](_0x1291c5[_0x2122('0x2e')][_0x2122('0x1c')]);_0x3fdc56[_0x2122('0x1a')]=qs[_0x2122('0x1a')](_0x1291c5[_0x2122('0x2e')][_0x2122('0x1a')]);}return _0x228840[_0x2122('0x49')](_0x3fdc56);}})[_0x2122('0x23')](function(_0x44a50b){if(_0x44a50b){return _0x44a50b?{'count':_0x56f43d,'rows':_0x44a50b}:null;}})[_0x2122('0x23')](respondWithResult(_0x2c64c9,null))['catch'](handleError(_0x2c64c9,null));};exports[_0x2122('0x4b')]=function(_0x2b768c,_0x4865bc,_0x37aad1){var _0x342d67={};var _0xed23c4={};var _0x254c90;var _0x305590;return db[_0x2122('0x28')]['findOne']({'where':{'id':_0x2b768c['params']['id']}})[_0x2122('0x23')](handleEntityNotFound(_0x4865bc,null))[_0x2122('0x23')](function(_0x141df7){if(_0x141df7){_0x254c90=_0x141df7;_0xed23c4[_0x2122('0x2c')]=_['keys'](db[_0x2122('0x4c')][_0x2122('0x41')]);_0xed23c4[_0x2122('0x2e')]=_[_0x2122('0x2d')](_0x2b768c[_0x2122('0x2e')]);_0xed23c4[_0x2122('0x37')]=_[_0x2122('0x2f')](_0xed23c4[_0x2122('0x2c')],_0xed23c4['query']);_0x342d67[_0x2122('0x30')]=_['intersection'](_0xed23c4[_0x2122('0x2c')],qs[_0x2122('0x31')](_0x2b768c['query'][_0x2122('0x31')]));_0x342d67[_0x2122('0x30')]=_0x342d67[_0x2122('0x30')]['length']?_0x342d67['attributes']:_0xed23c4[_0x2122('0x2c')];_0x342d67[_0x2122('0x35')]=qs[_0x2122('0x36')](_0x2b768c[_0x2122('0x2e')][_0x2122('0x36')]);_0x342d67[_0x2122('0x39')]=qs[_0x2122('0x37')](_[_0x2122('0x47')](_0x2b768c[_0x2122('0x2e')],_0xed23c4[_0x2122('0x37')]));if(_0x2b768c['query'][_0x2122('0x38')]){_0x342d67[_0x2122('0x39')]=_[_0x2122('0x3b')](_0x342d67[_0x2122('0x39')],{'$or':_[_0x2122('0x27')](_0x342d67[_0x2122('0x30')],function(_0x1e2109){var _0x2e4bc6={};_0x2e4bc6[_0x1e2109]={'$like':'%'+_0x2b768c[_0x2122('0x2e')]['filter']+'%'};return _0x2e4bc6;})});}_0x342d67=_[_0x2122('0x3b')]({},_0x342d67,_0x2b768c[_0x2122('0x3c')]);return _0x254c90[_0x2122('0x4b')](_0x342d67);}})[_0x2122('0x23')](function(_0x1ba5f2){if(_0x1ba5f2){_0x305590=_0x1ba5f2[_0x2122('0x32')];if(!_0x2b768c[_0x2122('0x2e')][_0x2122('0x33')]('nolimit')){_0x342d67[_0x2122('0x1c')]=qs[_0x2122('0x1c')](_0x2b768c[_0x2122('0x2e')][_0x2122('0x1c')]);_0x342d67[_0x2122('0x1a')]=qs[_0x2122('0x1a')](_0x2b768c[_0x2122('0x2e')][_0x2122('0x1a')]);}return _0x254c90[_0x2122('0x4b')](_0x342d67);}})['then'](function(_0x24d572){if(_0x24d572){return _0x24d572?{'count':_0x305590,'rows':_0x24d572}:null;}})[_0x2122('0x23')](respondWithResult(_0x4865bc,null))['catch'](handleError(_0x4865bc,null));};exports[_0x2122('0x4d')]=function(_0x4e2b3e,_0x44dbd5,_0x2d4eb1){if(_0x4e2b3e['body']['id']){delete _0x4e2b3e[_0x2122('0x45')]['id'];}return db[_0x2122('0x28')][_0x2122('0x4a')]({'where':{'id':_0x4e2b3e[_0x2122('0x40')]['id']}})['then'](handleEntityNotFound(_0x44dbd5,null))[_0x2122('0x23')](function(_0x437409){if(_0x437409){return _0x437409[_0x2122('0x4d')](_0x4e2b3e[_0x2122('0x45')][_0x2122('0x4e')]||[]);}return null;})[_0x2122('0x23')](respondWithResult(_0x44dbd5,null))['catch'](handleError(_0x44dbd5,null));}; \ No newline at end of file +var _0x09ba=['length','includeAll','options','find','create','body','getFields','findOne','ZendeskField','filter','getSubjects','nolimit','getDescriptions','pick','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','type','ZendeskConfiguration','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x09ba,0x115));var _0xa09b=function(_0x2a5042,_0x307d04){_0x2a5042=_0x2a5042-0x0;var _0x4bc22f=_0x09ba[_0x2a5042];return _0x4bc22f;};'use strict';var emlformat=require(_0xa09b('0x0'));var rimraf=require(_0xa09b('0x1'));var zipdir=require(_0xa09b('0x2'));var jsonpatch=require(_0xa09b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa09b('0x4'));var Mustache=require(_0xa09b('0x5'));var util=require(_0xa09b('0x6'));var path=require(_0xa09b('0x7'));var sox=require('sox');var csv=require(_0xa09b('0x8'));var ejs=require(_0xa09b('0x9'));var fs=require('fs');var fs_extra=require(_0xa09b('0xa'));var _=require(_0xa09b('0xb'));var squel=require(_0xa09b('0xc'));var crypto=require(_0xa09b('0xd'));var jsforce=require(_0xa09b('0xe'));var deskjs=require(_0xa09b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa09b('0x10'));var Papa=require(_0xa09b('0x11'));var Redis=require(_0xa09b('0x12'));var authService=require(_0xa09b('0x13'));var qs=require(_0xa09b('0x14'));var as=require(_0xa09b('0x15'));var hardwareService=require(_0xa09b('0x16'));var logger=require(_0xa09b('0x17'))(_0xa09b('0x18'));var utils=require('../../config/utils');var config=require(_0xa09b('0x19'));var licenseUtil=require(_0xa09b('0x1a'));var db=require(_0xa09b('0x1b'))['db'];function respondWithStatusCode(_0x24114b,_0x53b515){_0x53b515=_0x53b515||0xcc;return function(_0x5bbb5d){if(_0x5bbb5d){return _0x24114b[_0xa09b('0x1c')](_0x53b515);}return _0x24114b['status'](_0x53b515)[_0xa09b('0x1d')]();};}function respondWithResult(_0x505e82,_0x4a8910){_0x4a8910=_0x4a8910||0xc8;return function(_0x657d3){if(_0x657d3){return _0x505e82[_0xa09b('0x1e')](_0x4a8910)[_0xa09b('0x1f')](_0x657d3);}};}function respondWithFilteredResult(_0x4c0956,_0x24034e){return function(_0x5ea96d){if(_0x5ea96d){var _0x58ce71=typeof _0x24034e[_0xa09b('0x20')]===_0xa09b('0x21')&&typeof _0x24034e[_0xa09b('0x22')]==='undefined';var _0x10398e=_0x5ea96d[_0xa09b('0x23')];var _0x395d01=_0x58ce71?0x0:_0x24034e[_0xa09b('0x20')];var _0x5db44e=_0x58ce71?_0x5ea96d[_0xa09b('0x23')]:_0x24034e[_0xa09b('0x20')]+_0x24034e[_0xa09b('0x22')];var _0x6901f2;if(_0x5db44e>=_0x10398e){_0x5db44e=_0x10398e;_0x6901f2=0xc8;}else{_0x6901f2=0xce;}_0x4c0956[_0xa09b('0x1e')](_0x6901f2);return _0x4c0956[_0xa09b('0x24')](_0xa09b('0x25'),_0x395d01+'-'+_0x5db44e+'/'+_0x10398e)['json'](_0x5ea96d);}return null;};}function patchUpdates(_0x5a2050){return function(_0x10ce24){try{jsonpatch[_0xa09b('0x26')](_0x10ce24,_0x5a2050,!![]);}catch(_0x231a5e){return BPromise['reject'](_0x231a5e);}return _0x10ce24[_0xa09b('0x27')]();};}function saveUpdates(_0x5c493f,_0x90415a){return function(_0x91487b){if(_0x91487b){return _0x91487b[_0xa09b('0x28')](_0x5c493f)['then'](function(_0x3d913a){return _0x3d913a;});}return null;};}function removeEntity(_0x211fa8,_0x2f5d96){return function(_0x1ddd2f){if(_0x1ddd2f){return _0x1ddd2f[_0xa09b('0x29')]()[_0xa09b('0x2a')](function(){_0x211fa8['status'](0xcc)[_0xa09b('0x1d')]();});}};}function handleEntityNotFound(_0x4d710a,_0x2293fb){return function(_0x1dea2f){if(!_0x1dea2f){_0x4d710a[_0xa09b('0x1c')](0x194);}return _0x1dea2f;};}function handleError(_0x2dd8fe,_0x2dcb13){_0x2dcb13=_0x2dcb13||0x1f4;return function(_0x5367c1){logger[_0xa09b('0x2b')](_0x5367c1[_0xa09b('0x2c')]);if(_0x5367c1[_0xa09b('0x2d')]){delete _0x5367c1['name'];}_0x2dd8fe[_0xa09b('0x1e')](_0x2dcb13)[_0xa09b('0x2e')](_0x5367c1);};}exports[_0xa09b('0x2f')]=function(_0x5c9c17,_0x351e44){var _0x3b0aa5={},_0x4e98ba={},_0x22e89d={'count':0x0,'rows':[]};var _0x549364=_[_0xa09b('0x30')](db['ZendeskConfiguration']['rawAttributes'],function(_0x83dce8){return{'name':_0x83dce8[_0xa09b('0x31')],'type':_0x83dce8['type']['key']};});_0x4e98ba[_0xa09b('0x32')]=_['map'](_0x549364,_0xa09b('0x2d'));_0x4e98ba[_0xa09b('0x33')]=_[_0xa09b('0x34')](_0x5c9c17[_0xa09b('0x33')]);_0x4e98ba[_0xa09b('0x35')]=_[_0xa09b('0x36')](_0x4e98ba[_0xa09b('0x32')],_0x4e98ba[_0xa09b('0x33')]);_0x3b0aa5[_0xa09b('0x37')]=_[_0xa09b('0x36')](_0x4e98ba[_0xa09b('0x32')],qs[_0xa09b('0x38')](_0x5c9c17[_0xa09b('0x33')]['fields']));_0x3b0aa5['attributes']=_0x3b0aa5[_0xa09b('0x37')]['length']?_0x3b0aa5[_0xa09b('0x37')]:_0x4e98ba[_0xa09b('0x32')];if(!_0x5c9c17[_0xa09b('0x33')][_0xa09b('0x39')]('nolimit')){_0x3b0aa5[_0xa09b('0x22')]=qs[_0xa09b('0x22')](_0x5c9c17[_0xa09b('0x33')][_0xa09b('0x22')]);_0x3b0aa5[_0xa09b('0x20')]=qs[_0xa09b('0x20')](_0x5c9c17[_0xa09b('0x33')][_0xa09b('0x20')]);}_0x3b0aa5[_0xa09b('0x3a')]=qs[_0xa09b('0x3b')](_0x5c9c17[_0xa09b('0x33')][_0xa09b('0x3b')]);_0x3b0aa5[_0xa09b('0x3c')]=qs[_0xa09b('0x35')](_['pick'](_0x5c9c17['query'],_0x4e98ba['filters']),_0x549364);if(_0x5c9c17[_0xa09b('0x33')]['filter']){_0x3b0aa5[_0xa09b('0x3c')]=_[_0xa09b('0x3d')](_0x3b0aa5['where'],{'$or':_['map'](_0x549364,function(_0x589d96){if(_0x589d96[_0xa09b('0x3e')]!=='VIRTUAL'){var _0xe7cddf={};_0xe7cddf[_0x589d96[_0xa09b('0x2d')]]={'$like':'%'+_0x5c9c17[_0xa09b('0x33')]['filter']+'%'};return _0xe7cddf;}})});}_0x3b0aa5=_[_0xa09b('0x3d')]({},_0x3b0aa5,_0x5c9c17['options']);var _0x844ec4={'where':_0x3b0aa5[_0xa09b('0x3c')]};return db[_0xa09b('0x3f')][_0xa09b('0x23')](_0x844ec4)[_0xa09b('0x2a')](function(_0xcd7ab9){_0x22e89d['count']=_0xcd7ab9;if(_0x5c9c17[_0xa09b('0x33')]['includeAll']){_0x3b0aa5[_0xa09b('0x40')]=[{'all':!![]}];}return db[_0xa09b('0x3f')][_0xa09b('0x41')](_0x3b0aa5);})[_0xa09b('0x2a')](function(_0x37380f){_0x22e89d[_0xa09b('0x42')]=_0x37380f;return _0x22e89d;})[_0xa09b('0x2a')](respondWithFilteredResult(_0x351e44,_0x3b0aa5))[_0xa09b('0x43')](handleError(_0x351e44,null));};exports[_0xa09b('0x44')]=function(_0x333513,_0x4a5383){var _0x3dc498={'raw':![],'where':{'id':_0x333513[_0xa09b('0x45')]['id']}},_0x3b0c25={};_0x3b0c25[_0xa09b('0x32')]=_[_0xa09b('0x34')](db['ZendeskConfiguration'][_0xa09b('0x46')]);_0x3b0c25[_0xa09b('0x33')]=_[_0xa09b('0x34')](_0x333513[_0xa09b('0x33')]);_0x3b0c25['filters']=_[_0xa09b('0x36')](_0x3b0c25[_0xa09b('0x32')],_0x3b0c25[_0xa09b('0x33')]);_0x3dc498[_0xa09b('0x37')]=_['intersection'](_0x3b0c25['model'],qs[_0xa09b('0x38')](_0x333513[_0xa09b('0x33')][_0xa09b('0x38')]));_0x3dc498[_0xa09b('0x37')]=_0x3dc498[_0xa09b('0x37')][_0xa09b('0x47')]?_0x3dc498[_0xa09b('0x37')]:_0x3b0c25['model'];if(_0x333513[_0xa09b('0x33')][_0xa09b('0x48')]){_0x3dc498[_0xa09b('0x40')]=[{'all':!![]}];}_0x3dc498=_['merge']({},_0x3dc498,_0x333513[_0xa09b('0x49')]);return db[_0xa09b('0x3f')][_0xa09b('0x4a')](_0x3dc498)[_0xa09b('0x2a')](handleEntityNotFound(_0x4a5383,null))[_0xa09b('0x2a')](respondWithResult(_0x4a5383,null))[_0xa09b('0x43')](handleError(_0x4a5383,null));};exports[_0xa09b('0x4b')]=function(_0x5e1201,_0x478e5c){return db[_0xa09b('0x3f')][_0xa09b('0x4b')](_0x5e1201[_0xa09b('0x4c')],{})[_0xa09b('0x2a')](respondWithResult(_0x478e5c,0xc9))[_0xa09b('0x43')](handleError(_0x478e5c,null));};exports[_0xa09b('0x28')]=function(_0x5e4d75,_0x1565d4){if(_0x5e4d75[_0xa09b('0x4c')]['id']){delete _0x5e4d75[_0xa09b('0x4c')]['id'];}return db[_0xa09b('0x3f')][_0xa09b('0x4a')]({'where':{'id':_0x5e4d75['params']['id']}})[_0xa09b('0x2a')](handleEntityNotFound(_0x1565d4,null))[_0xa09b('0x2a')](saveUpdates(_0x5e4d75[_0xa09b('0x4c')],null))[_0xa09b('0x2a')](respondWithResult(_0x1565d4,null))[_0xa09b('0x43')](handleError(_0x1565d4,null));};exports[_0xa09b('0x29')]=function(_0x5e24eb,_0x26ba53){return db[_0xa09b('0x3f')][_0xa09b('0x4a')]({'where':{'id':_0x5e24eb[_0xa09b('0x45')]['id']}})['then'](handleEntityNotFound(_0x26ba53,null))[_0xa09b('0x2a')](removeEntity(_0x26ba53,null))['catch'](handleError(_0x26ba53,null));};exports[_0xa09b('0x4d')]=function(_0xd5b132,_0x412045,_0x14f958){var _0xf797cb={};var _0x3f2564={};var _0x2db354;var _0x474d64;return db[_0xa09b('0x3f')][_0xa09b('0x4e')]({'where':{'id':_0xd5b132[_0xa09b('0x45')]['id']}})[_0xa09b('0x2a')](handleEntityNotFound(_0x412045,null))[_0xa09b('0x2a')](function(_0x5d7f79){if(_0x5d7f79){_0x2db354=_0x5d7f79;_0x3f2564[_0xa09b('0x32')]=_[_0xa09b('0x34')](db[_0xa09b('0x4f')][_0xa09b('0x46')]);_0x3f2564['query']=_[_0xa09b('0x34')](_0xd5b132[_0xa09b('0x33')]);_0x3f2564['filters']=_[_0xa09b('0x36')](_0x3f2564['model'],_0x3f2564['query']);_0xf797cb[_0xa09b('0x37')]=_[_0xa09b('0x36')](_0x3f2564[_0xa09b('0x32')],qs['fields'](_0xd5b132[_0xa09b('0x33')][_0xa09b('0x38')]));_0xf797cb['attributes']=_0xf797cb[_0xa09b('0x37')][_0xa09b('0x47')]?_0xf797cb[_0xa09b('0x37')]:_0x3f2564[_0xa09b('0x32')];_0xf797cb['order']=qs[_0xa09b('0x3b')](_0xd5b132[_0xa09b('0x33')][_0xa09b('0x3b')]);_0xf797cb[_0xa09b('0x3c')]=qs['filters'](_['pick'](_0xd5b132['query'],_0x3f2564[_0xa09b('0x35')]));if(_0xd5b132[_0xa09b('0x33')][_0xa09b('0x50')]){_0xf797cb[_0xa09b('0x3c')]=_['merge'](_0xf797cb[_0xa09b('0x3c')],{'$or':_[_0xa09b('0x30')](_0xf797cb['attributes'],function(_0x1e7e4f){var _0x155aac={};_0x155aac[_0x1e7e4f]={'$like':'%'+_0xd5b132[_0xa09b('0x33')][_0xa09b('0x50')]+'%'};return _0x155aac;})});}_0xf797cb=_[_0xa09b('0x3d')]({},_0xf797cb,_0xd5b132[_0xa09b('0x49')]);return _0x2db354[_0xa09b('0x4d')](_0xf797cb);}})[_0xa09b('0x2a')](function(_0x383510){if(_0x383510){_0x474d64=_0x383510[_0xa09b('0x47')];if(!_0xd5b132['query'][_0xa09b('0x39')]('nolimit')){_0xf797cb['limit']=qs[_0xa09b('0x22')](_0xd5b132[_0xa09b('0x33')]['limit']);_0xf797cb[_0xa09b('0x20')]=qs[_0xa09b('0x20')](_0xd5b132['query'][_0xa09b('0x20')]);}return _0x2db354[_0xa09b('0x4d')](_0xf797cb);}})[_0xa09b('0x2a')](function(_0x16a1e0){if(_0x16a1e0){return _0x16a1e0?{'count':_0x474d64,'rows':_0x16a1e0}:null;}})[_0xa09b('0x2a')](respondWithResult(_0x412045,null))[_0xa09b('0x43')](handleError(_0x412045,null));};exports[_0xa09b('0x51')]=function(_0x5c501b,_0x2b3eb8,_0x1307f9){var _0x415cf9={};var _0x2ad445={};var _0x2f7e04;var _0x23f96f;return db[_0xa09b('0x3f')][_0xa09b('0x4e')]({'where':{'id':_0x5c501b[_0xa09b('0x45')]['id']}})[_0xa09b('0x2a')](handleEntityNotFound(_0x2b3eb8,null))[_0xa09b('0x2a')](function(_0x1e8ec8){if(_0x1e8ec8){_0x2f7e04=_0x1e8ec8;_0x2ad445[_0xa09b('0x32')]=_[_0xa09b('0x34')](db[_0xa09b('0x4f')][_0xa09b('0x46')]);_0x2ad445[_0xa09b('0x33')]=_[_0xa09b('0x34')](_0x5c501b[_0xa09b('0x33')]);_0x2ad445['filters']=_[_0xa09b('0x36')](_0x2ad445[_0xa09b('0x32')],_0x2ad445[_0xa09b('0x33')]);_0x415cf9[_0xa09b('0x37')]=_[_0xa09b('0x36')](_0x2ad445[_0xa09b('0x32')],qs[_0xa09b('0x38')](_0x5c501b[_0xa09b('0x33')]['fields']));_0x415cf9[_0xa09b('0x37')]=_0x415cf9[_0xa09b('0x37')][_0xa09b('0x47')]?_0x415cf9['attributes']:_0x2ad445[_0xa09b('0x32')];_0x415cf9[_0xa09b('0x3a')]=qs['sort'](_0x5c501b['query'][_0xa09b('0x3b')]);_0x415cf9['where']=qs[_0xa09b('0x35')](_['pick'](_0x5c501b[_0xa09b('0x33')],_0x2ad445[_0xa09b('0x35')]));if(_0x5c501b[_0xa09b('0x33')][_0xa09b('0x50')]){_0x415cf9[_0xa09b('0x3c')]=_[_0xa09b('0x3d')](_0x415cf9[_0xa09b('0x3c')],{'$or':_['map'](_0x415cf9[_0xa09b('0x37')],function(_0x2baef0){var _0x8724e3={};_0x8724e3[_0x2baef0]={'$like':'%'+_0x5c501b[_0xa09b('0x33')][_0xa09b('0x50')]+'%'};return _0x8724e3;})});}_0x415cf9=_['merge']({},_0x415cf9,_0x5c501b[_0xa09b('0x49')]);return _0x2f7e04[_0xa09b('0x51')](_0x415cf9);}})['then'](function(_0x582f3c){if(_0x582f3c){_0x23f96f=_0x582f3c[_0xa09b('0x47')];if(!_0x5c501b[_0xa09b('0x33')][_0xa09b('0x39')](_0xa09b('0x52'))){_0x415cf9[_0xa09b('0x22')]=qs[_0xa09b('0x22')](_0x5c501b[_0xa09b('0x33')][_0xa09b('0x22')]);_0x415cf9[_0xa09b('0x20')]=qs['offset'](_0x5c501b['query'][_0xa09b('0x20')]);}return _0x2f7e04[_0xa09b('0x51')](_0x415cf9);}})[_0xa09b('0x2a')](function(_0x2d7638){if(_0x2d7638){return _0x2d7638?{'count':_0x23f96f,'rows':_0x2d7638}:null;}})['then'](respondWithResult(_0x2b3eb8,null))[_0xa09b('0x43')](handleError(_0x2b3eb8,null));};exports[_0xa09b('0x53')]=function(_0x29a667,_0x512b72,_0x1d3464){var _0x442030={};var _0x1bc238={};var _0x5ba3ed;var _0x208913;return db[_0xa09b('0x3f')][_0xa09b('0x4e')]({'where':{'id':_0x29a667[_0xa09b('0x45')]['id']}})[_0xa09b('0x2a')](handleEntityNotFound(_0x512b72,null))[_0xa09b('0x2a')](function(_0x35b3ba){if(_0x35b3ba){_0x5ba3ed=_0x35b3ba;_0x1bc238[_0xa09b('0x32')]=_[_0xa09b('0x34')](db[_0xa09b('0x4f')][_0xa09b('0x46')]);_0x1bc238[_0xa09b('0x33')]=_[_0xa09b('0x34')](_0x29a667['query']);_0x1bc238[_0xa09b('0x35')]=_[_0xa09b('0x36')](_0x1bc238['model'],_0x1bc238[_0xa09b('0x33')]);_0x442030[_0xa09b('0x37')]=_['intersection'](_0x1bc238[_0xa09b('0x32')],qs[_0xa09b('0x38')](_0x29a667[_0xa09b('0x33')][_0xa09b('0x38')]));_0x442030[_0xa09b('0x37')]=_0x442030[_0xa09b('0x37')][_0xa09b('0x47')]?_0x442030[_0xa09b('0x37')]:_0x1bc238[_0xa09b('0x32')];_0x442030['order']=qs['sort'](_0x29a667[_0xa09b('0x33')][_0xa09b('0x3b')]);_0x442030[_0xa09b('0x3c')]=qs[_0xa09b('0x35')](_['pick'](_0x29a667[_0xa09b('0x33')],_0x1bc238[_0xa09b('0x35')]));if(_0x29a667['query'][_0xa09b('0x50')]){_0x442030[_0xa09b('0x3c')]=_['merge'](_0x442030['where'],{'$or':_[_0xa09b('0x30')](_0x442030[_0xa09b('0x37')],function(_0x21ad35){var _0x1dca4b={};_0x1dca4b[_0x21ad35]={'$like':'%'+_0x29a667[_0xa09b('0x33')][_0xa09b('0x50')]+'%'};return _0x1dca4b;})});}_0x442030=_[_0xa09b('0x3d')]({},_0x442030,_0x29a667['options']);return _0x5ba3ed[_0xa09b('0x53')](_0x442030);}})['then'](function(_0x3d66fd){if(_0x3d66fd){_0x208913=_0x3d66fd[_0xa09b('0x47')];if(!_0x29a667[_0xa09b('0x33')][_0xa09b('0x39')]('nolimit')){_0x442030[_0xa09b('0x22')]=qs[_0xa09b('0x22')](_0x29a667[_0xa09b('0x33')][_0xa09b('0x22')]);_0x442030[_0xa09b('0x20')]=qs[_0xa09b('0x20')](_0x29a667[_0xa09b('0x33')][_0xa09b('0x20')]);}return _0x5ba3ed[_0xa09b('0x53')](_0x442030);}})['then'](function(_0x369d62){if(_0x369d62){return _0x369d62?{'count':_0x208913,'rows':_0x369d62}:null;}})[_0xa09b('0x2a')](respondWithResult(_0x512b72,null))[_0xa09b('0x43')](handleError(_0x512b72,null));};exports['getTags']=function(_0x286c08,_0x2c8529,_0x3a4504){var _0x3e778b={};var _0x877756={};var _0x221ad3;var _0x3199bf;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x286c08['params']['id']}})[_0xa09b('0x2a')](handleEntityNotFound(_0x2c8529,null))[_0xa09b('0x2a')](function(_0x409a79){if(_0x409a79){_0x221ad3=_0x409a79;_0x877756[_0xa09b('0x32')]=_[_0xa09b('0x34')](db['Tag'][_0xa09b('0x46')]);_0x877756[_0xa09b('0x33')]=_[_0xa09b('0x34')](_0x286c08[_0xa09b('0x33')]);_0x877756[_0xa09b('0x35')]=_[_0xa09b('0x36')](_0x877756[_0xa09b('0x32')],_0x877756['query']);_0x3e778b[_0xa09b('0x37')]=_[_0xa09b('0x36')](_0x877756['model'],qs[_0xa09b('0x38')](_0x286c08[_0xa09b('0x33')][_0xa09b('0x38')]));_0x3e778b[_0xa09b('0x37')]=_0x3e778b[_0xa09b('0x37')][_0xa09b('0x47')]?_0x3e778b[_0xa09b('0x37')]:_0x877756[_0xa09b('0x32')];_0x3e778b[_0xa09b('0x3a')]=qs[_0xa09b('0x3b')](_0x286c08['query']['sort']);_0x3e778b['where']=qs[_0xa09b('0x35')](_[_0xa09b('0x54')](_0x286c08['query'],_0x877756[_0xa09b('0x35')]));if(_0x286c08[_0xa09b('0x33')][_0xa09b('0x50')]){_0x3e778b[_0xa09b('0x3c')]=_[_0xa09b('0x3d')](_0x3e778b[_0xa09b('0x3c')],{'$or':_[_0xa09b('0x30')](_0x3e778b[_0xa09b('0x37')],function(_0x20912b){var _0x336e1a={};_0x336e1a[_0x20912b]={'$like':'%'+_0x286c08['query']['filter']+'%'};return _0x336e1a;})});}_0x3e778b=_[_0xa09b('0x3d')]({},_0x3e778b,_0x286c08['options']);return _0x221ad3[_0xa09b('0x55')](_0x3e778b);}})[_0xa09b('0x2a')](function(_0x463c7e){if(_0x463c7e){_0x3199bf=_0x463c7e['length'];if(!_0x286c08[_0xa09b('0x33')][_0xa09b('0x39')](_0xa09b('0x52'))){_0x3e778b[_0xa09b('0x22')]=qs[_0xa09b('0x22')](_0x286c08[_0xa09b('0x33')]['limit']);_0x3e778b[_0xa09b('0x20')]=qs[_0xa09b('0x20')](_0x286c08[_0xa09b('0x33')][_0xa09b('0x20')]);}return _0x221ad3['getTags'](_0x3e778b);}})[_0xa09b('0x2a')](function(_0x12b12a){if(_0x12b12a){return _0x12b12a?{'count':_0x3199bf,'rows':_0x12b12a}:null;}})['then'](respondWithResult(_0x2c8529,null))[_0xa09b('0x43')](handleError(_0x2c8529,null));};exports[_0xa09b('0x56')]=function(_0x3853e7,_0x4b8ad0,_0x5c4006){if(_0x3853e7[_0xa09b('0x4c')]['id']){delete _0x3853e7[_0xa09b('0x4c')]['id'];}return db['ZendeskConfiguration'][_0xa09b('0x4e')]({'where':{'id':_0x3853e7[_0xa09b('0x45')]['id']}})[_0xa09b('0x2a')](handleEntityNotFound(_0x4b8ad0,null))[_0xa09b('0x2a')](function(_0x222237){if(_0x222237){return _0x222237['setTags'](_0x3853e7['body']['ids']||[]);}return null;})[_0xa09b('0x2a')](respondWithResult(_0x4b8ad0,null))[_0xa09b('0x43')](handleError(_0x4b8ad0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index ddf82dd..d45e55b 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 _0x5423=['request-promise','path','rimraf','../../config/environment','exports','define','ZendeskConfiguration','lodash','util','api','moment'];(function(_0x18f82b,_0x3ea7a0){var _0x5d8128=function(_0x16a009){while(--_0x16a009){_0x18f82b['push'](_0x18f82b['shift']());}};_0x5d8128(++_0x3ea7a0);}(_0x5423,0xe3));var _0x3542=function(_0x12f861,_0x5b518f){_0x12f861=_0x12f861-0x0;var _0x4960d4=_0x5423[_0x12f861];return _0x4960d4;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var fs=require('fs');var path=require(_0x3542('0x5'));var rimraf=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x3542('0x8')]=function(_0x2d2ae9,_0x15ee3b){return _0x2d2ae9[_0x3542('0x9')](_0x3542('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','ZendeskConfiguration','int_zendesk_configurations','lodash','util'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x4fc2,0x111));var _0x24fc=function(_0x41c5c1,_0x519472){_0x41c5c1=_0x41c5c1-0x0;var _0x320097=_0x4fc2[_0x41c5c1];return _0x320097;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'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 2d1b7d0..7db9941 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 _0xd781=['../../config/utils','../../config/logger','rpc','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x131d15,_0x4b592a){var _0x34e888=function(_0x3de207){while(--_0x3de207){_0x131d15['push'](_0x131d15['shift']());}};_0x34e888(++_0x4b592a);}(_0xd781,0x16f));var _0x1d78=function(_0x21fc4f,_0x1dda3b){_0x21fc4f=_0x21fc4f-0x0;var _0x98abf1=_0xd781[_0x21fc4f];return _0x98abf1;};'use strict';var _=require(_0x1d78('0x0'));var util=require(_0x1d78('0x1'));var moment=require(_0x1d78('0x2'));var BPromise=require(_0x1d78('0x3'));var rs=require(_0x1d78('0x4'));var fs=require('fs');var Redis=require(_0x1d78('0x5'));var db=require(_0x1d78('0x6'))['db'];var utils=require(_0x1d78('0x7'));var logger=require(_0x1d78('0x8'))(_0x1d78('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1d78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x244f6d,_0x554106,_0x2a6b0c){return new BPromise(function(_0x2ff63c,_0x6fa497){return client[_0x1d78('0xb')](_0x244f6d,_0x2a6b0c)[_0x1d78('0xc')](function(_0x210392){logger[_0x1d78('0xd')](_0x1d78('0xe'),_0x554106,_0x1d78('0xf'));logger[_0x1d78('0x10')](_0x1d78('0x11'),_0x554106,_0x1d78('0xf'),JSON['stringify'](_0x210392));if(_0x210392[_0x1d78('0x12')]){if(_0x210392[_0x1d78('0x12')][_0x1d78('0x13')]===0x1f4){logger[_0x1d78('0x12')](_0x1d78('0xe'),_0x554106,_0x210392[_0x1d78('0x12')][_0x1d78('0x14')]);return _0x6fa497(_0x210392[_0x1d78('0x12')]['message']);}logger[_0x1d78('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x554106,_0x210392['error'][_0x1d78('0x14')]);return _0x2ff63c(_0x210392[_0x1d78('0x12')][_0x1d78('0x14')]);}else{logger[_0x1d78('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x554106,_0x1d78('0xf'));_0x2ff63c(_0x210392[_0x1d78('0x15')][_0x1d78('0x14')]);}})['catch'](function(_0x3d0181){logger[_0x1d78('0x12')](_0x1d78('0xe'),_0x554106,_0x3d0181);_0x6fa497(_0x3d0181);});});} \ No newline at end of file +var _0x6267=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','ZendeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x59e001,_0x5823d4){var _0x38eee9=function(_0x24d804){while(--_0x24d804){_0x59e001['push'](_0x59e001['shift']());}};_0x38eee9(++_0x5823d4);}(_0x6267,0x178));var _0x7626=function(_0x1773a9,_0x5ea615){_0x1773a9=_0x1773a9-0x0;var _0x24e3d2=_0x6267[_0x1773a9];return _0x24e3d2;};'use strict';var _=require('lodash');var util=require(_0x7626('0x0'));var moment=require(_0x7626('0x1'));var BPromise=require(_0x7626('0x2'));var rs=require(_0x7626('0x3'));var fs=require('fs');var Redis=require(_0x7626('0x4'));var db=require(_0x7626('0x5'))['db'];var utils=require(_0x7626('0x6'));var logger=require('../../config/logger')(_0x7626('0x7'));var config=require('../../config/environment');var jayson=require(_0x7626('0x8'));var client=jayson['client'][_0x7626('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x356c33,_0x45d9c9,_0x293440){return new BPromise(function(_0x4f7a6b,_0x26d81f){return client['request'](_0x356c33,_0x293440)[_0x7626('0xa')](function(_0x3c837c){logger['info'](_0x7626('0xb'),_0x45d9c9,'request\x20sent');logger[_0x7626('0xc')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x45d9c9,_0x7626('0xd'),JSON['stringify'](_0x3c837c));if(_0x3c837c['error']){if(_0x3c837c['error']['code']===0x1f4){logger[_0x7626('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x45d9c9,_0x3c837c[_0x7626('0xe')][_0x7626('0xf')]);return _0x26d81f(_0x3c837c[_0x7626('0xe')][_0x7626('0xf')]);}logger[_0x7626('0xe')](_0x7626('0xb'),_0x45d9c9,_0x3c837c[_0x7626('0xe')]['message']);return _0x4f7a6b(_0x3c837c[_0x7626('0xe')][_0x7626('0xf')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x45d9c9,_0x7626('0xd'));_0x4f7a6b(_0x3c837c[_0x7626('0x10')]['message']);}})['catch'](function(_0x293b30){logger[_0x7626('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x45d9c9,_0x293b30);_0x26d81f(_0x293b30);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index bfca126..f457cbe 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 _0x73c4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x73c4,0x115));var _0x473c=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x73c4[_0x397cfb];return _0x15fed9;};'use strict';var multer=require(_0x473c('0x0'));var util=require(_0x473c('0x1'));var path=require(_0x473c('0x2'));var timeout=require('connect-timeout');var express=require(_0x473c('0x3'));var router=express[_0x473c('0x4')]();var fs_extra=require(_0x473c('0x5'));var auth=require(_0x473c('0x6'));var interaction=require(_0x473c('0x7'));var config=require(_0x473c('0x8'));var controller=require('./intZendeskField.controller');router[_0x473c('0x9')]('/',auth[_0x473c('0xa')](),controller[_0x473c('0xb')]);router[_0x473c('0x9')](_0x473c('0xc'),auth[_0x473c('0xa')](),controller[_0x473c('0xd')]);router[_0x473c('0xe')]('/',auth[_0x473c('0xa')](),controller[_0x473c('0xf')]);router['put'](_0x473c('0xc'),auth['isAuthenticated'](),controller[_0x473c('0x10')]);router[_0x473c('0x11')](_0x473c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x473c('0x12')]=router; \ No newline at end of file +var _0x473e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','delete','multer'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x473e,0xfe));var _0xe473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x473e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe473('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe473('0x1'));var express=require(_0xe473('0x2'));var router=express[_0xe473('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe473('0x4'));var interaction=require(_0xe473('0x5'));var config=require(_0xe473('0x6'));var controller=require('./intZendeskField.controller');router[_0xe473('0x7')]('/',auth[_0xe473('0x8')](),controller['index']);router[_0xe473('0x7')](_0xe473('0x9'),auth[_0xe473('0x8')](),controller[_0xe473('0xa')]);router['post']('/',auth[_0xe473('0x8')](),controller[_0xe473('0xb')]);router[_0xe473('0xc')]('/:id',auth[_0xe473('0x8')](),controller[_0xe473('0xd')]);router[_0xe473('0xe')](_0xe473('0x9'),auth[_0xe473('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 06ad257..b72857b 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 _0x22f0=['sequelize','ENUM','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x22f0,0xaf));var _0x022f=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0x22f0[_0x4db46b];return _0x565be8;};'use strict';var Sequelize=require(_0x022f('0x0'));module['exports']={'type':{'type':Sequelize[_0x022f('0x1')]('string',_0x022f('0x2'),_0x022f('0x3'),_0x022f('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x022f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x022f('0x2'),_0x022f('0x3'))},'keyContent':{'type':Sequelize[_0x022f('0x5')]},'idField':{'type':Sequelize[_0x022f('0x5')]},'nameField':{'type':Sequelize[_0x022f('0x5')]},'customField':{'type':Sequelize[_0x022f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x022f('0x5')]}}; \ No newline at end of file +var _0x287f=['variable','customVariable','keyValue','string','STRING','exports','ENUM'];(function(_0xab3e1c,_0x15dfa0){var _0x548011=function(_0x5357df){while(--_0x5357df){_0xab3e1c['push'](_0xab3e1c['shift']());}};_0x548011(++_0x15dfa0);}(_0x287f,0x10f));var _0xf287=function(_0x23ed8e,_0xeb95ec){_0x23ed8e=_0x23ed8e-0x0;var _0x5a0bad=_0x287f[_0x23ed8e];return _0x5a0bad;};'use strict';var Sequelize=require('sequelize');module[_0xf287('0x0')]={'type':{'type':Sequelize[_0xf287('0x1')]('string',_0xf287('0x2'),_0xf287('0x3'),_0xf287('0x4'),'picklist'),'defaultValue':_0xf287('0x5')},'content':{'type':Sequelize[_0xf287('0x6')]},'key':{'type':Sequelize[_0xf287('0x6')]},'keyType':{'type':Sequelize[_0xf287('0x1')](_0xf287('0x5'),_0xf287('0x2'),_0xf287('0x3'))},'keyContent':{'type':Sequelize[_0xf287('0x6')]},'idField':{'type':Sequelize[_0xf287('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf287('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 3af9a1d..870fec7 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 _0x47e8=['end','error','stack','name','send','index','map','ZendeskField','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','keys','options','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x47e8,0x6e));var _0x847e=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0x47e8[_0x113a6c];return _0x1ac632;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x847e('0x0'));var zipdir=require(_0x847e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x847e('0x2'));var moment=require(_0x847e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x847e('0x4'));var util=require(_0x847e('0x5'));var path=require(_0x847e('0x6'));var sox=require(_0x847e('0x7'));var csv=require(_0x847e('0x8'));var ejs=require(_0x847e('0x9'));var fs=require('fs');var fs_extra=require(_0x847e('0xa'));var _=require(_0x847e('0xb'));var squel=require(_0x847e('0xc'));var crypto=require(_0x847e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x847e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x847e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x847e('0x10'));var hardwareService=require(_0x847e('0x11'));var logger=require(_0x847e('0x12'))(_0x847e('0x13'));var utils=require(_0x847e('0x14'));var config=require(_0x847e('0x15'));var licenseUtil=require(_0x847e('0x16'));var db=require(_0x847e('0x17'))['db'];function respondWithStatusCode(_0x38ac18,_0x2c9a00){_0x2c9a00=_0x2c9a00||0xcc;return function(_0x3f9880){if(_0x3f9880){return _0x38ac18[_0x847e('0x18')](_0x2c9a00);}return _0x38ac18[_0x847e('0x19')](_0x2c9a00)['end']();};}function respondWithResult(_0x15563e,_0x43b05){_0x43b05=_0x43b05||0xc8;return function(_0x43bb5d){if(_0x43bb5d){return _0x15563e['status'](_0x43b05)[_0x847e('0x1a')](_0x43bb5d);}};}function respondWithFilteredResult(_0x45d562,_0x3bc55e){return function(_0x511750){if(_0x511750){var _0xcda990=typeof _0x3bc55e[_0x847e('0x1b')]===_0x847e('0x1c')&&typeof _0x3bc55e['limit']===_0x847e('0x1c');var _0x3eb976=_0x511750[_0x847e('0x1d')];var _0xe1f148=_0xcda990?0x0:_0x3bc55e[_0x847e('0x1b')];var _0x5a1107=_0xcda990?_0x511750[_0x847e('0x1d')]:_0x3bc55e[_0x847e('0x1b')]+_0x3bc55e['limit'];var _0x315230;if(_0x5a1107>=_0x3eb976){_0x5a1107=_0x3eb976;_0x315230=0xc8;}else{_0x315230=0xce;}_0x45d562[_0x847e('0x19')](_0x315230);return _0x45d562[_0x847e('0x1e')](_0x847e('0x1f'),_0xe1f148+'-'+_0x5a1107+'/'+_0x3eb976)[_0x847e('0x1a')](_0x511750);}return null;};}function patchUpdates(_0x272356){return function(_0x157b99){try{jsonpatch['apply'](_0x157b99,_0x272356,!![]);}catch(_0x961341){return BPromise['reject'](_0x961341);}return _0x157b99[_0x847e('0x20')]();};}function saveUpdates(_0x3d252a,_0x58f78b){return function(_0x5826a2){if(_0x5826a2){return _0x5826a2[_0x847e('0x21')](_0x3d252a)[_0x847e('0x22')](function(_0x2db475){return _0x2db475;});}return null;};}function removeEntity(_0x240e05,_0x2a2ec1){return function(_0x5d707e){if(_0x5d707e){return _0x5d707e[_0x847e('0x23')]()[_0x847e('0x22')](function(){_0x240e05['status'](0xcc)[_0x847e('0x24')]();});}};}function handleEntityNotFound(_0x225f3f,_0x3ca452){return function(_0x5abe5a){if(!_0x5abe5a){_0x225f3f[_0x847e('0x18')](0x194);}return _0x5abe5a;};}function handleError(_0x3991e5,_0x1fbf70){_0x1fbf70=_0x1fbf70||0x1f4;return function(_0xd8fd15){logger[_0x847e('0x25')](_0xd8fd15[_0x847e('0x26')]);if(_0xd8fd15[_0x847e('0x27')]){delete _0xd8fd15['name'];}_0x3991e5[_0x847e('0x19')](_0x1fbf70)[_0x847e('0x28')](_0xd8fd15);};}exports[_0x847e('0x29')]=function(_0x3b2fb0,_0x32973a){var _0x55d06a={},_0x4bb4ce={},_0x34dea0={'count':0x0,'rows':[]};var _0x40470c=_[_0x847e('0x2a')](db[_0x847e('0x2b')]['rawAttributes'],function(_0x13d408){return{'name':_0x13d408[_0x847e('0x2c')],'type':_0x13d408['type'][_0x847e('0x2d')]};});_0x4bb4ce[_0x847e('0x2e')]=_[_0x847e('0x2a')](_0x40470c,'name');_0x4bb4ce[_0x847e('0x2f')]=_['keys'](_0x3b2fb0[_0x847e('0x2f')]);_0x4bb4ce[_0x847e('0x30')]=_[_0x847e('0x31')](_0x4bb4ce[_0x847e('0x2e')],_0x4bb4ce[_0x847e('0x2f')]);_0x55d06a[_0x847e('0x32')]=_[_0x847e('0x31')](_0x4bb4ce['model'],qs[_0x847e('0x33')](_0x3b2fb0['query'][_0x847e('0x33')]));_0x55d06a[_0x847e('0x32')]=_0x55d06a[_0x847e('0x32')][_0x847e('0x34')]?_0x55d06a[_0x847e('0x32')]:_0x4bb4ce[_0x847e('0x2e')];if(!_0x3b2fb0[_0x847e('0x2f')][_0x847e('0x35')]('nolimit')){_0x55d06a[_0x847e('0x36')]=qs['limit'](_0x3b2fb0[_0x847e('0x2f')][_0x847e('0x36')]);_0x55d06a['offset']=qs[_0x847e('0x1b')](_0x3b2fb0[_0x847e('0x2f')][_0x847e('0x1b')]);}_0x55d06a[_0x847e('0x37')]=qs['sort'](_0x3b2fb0[_0x847e('0x2f')]['sort']);_0x55d06a[_0x847e('0x38')]=qs[_0x847e('0x30')](_[_0x847e('0x39')](_0x3b2fb0[_0x847e('0x2f')],_0x4bb4ce['filters']),_0x40470c);if(_0x3b2fb0[_0x847e('0x2f')]['filter']){_0x55d06a[_0x847e('0x38')]=_[_0x847e('0x3a')](_0x55d06a[_0x847e('0x38')],{'$or':_[_0x847e('0x2a')](_0x40470c,function(_0x3bb45c){if(_0x3bb45c[_0x847e('0x3b')]!==_0x847e('0x3c')){var _0x40c70f={};_0x40c70f[_0x3bb45c[_0x847e('0x27')]]={'$like':'%'+_0x3b2fb0['query'][_0x847e('0x3d')]+'%'};return _0x40c70f;}})});}_0x55d06a=_[_0x847e('0x3a')]({},_0x55d06a,_0x3b2fb0['options']);var _0x70d1f8={'where':_0x55d06a['where']};return db['ZendeskField'][_0x847e('0x1d')](_0x70d1f8)['then'](function(_0x1d2f36){_0x34dea0[_0x847e('0x1d')]=_0x1d2f36;if(_0x3b2fb0[_0x847e('0x2f')][_0x847e('0x3e')]){_0x55d06a[_0x847e('0x3f')]=[{'all':!![]}];}return db[_0x847e('0x2b')]['findAll'](_0x55d06a);})[_0x847e('0x22')](function(_0x28c4bc){_0x34dea0[_0x847e('0x40')]=_0x28c4bc;return _0x34dea0;})[_0x847e('0x22')](respondWithFilteredResult(_0x32973a,_0x55d06a))[_0x847e('0x41')](handleError(_0x32973a,null));};exports[_0x847e('0x42')]=function(_0x352fc8,_0x55d26f){var _0x110fec={'raw':!![],'where':{'id':_0x352fc8['params']['id']}},_0x5da463={};_0x5da463[_0x847e('0x2e')]=_['keys'](db[_0x847e('0x2b')][_0x847e('0x43')]);_0x5da463[_0x847e('0x2f')]=_[_0x847e('0x44')](_0x352fc8[_0x847e('0x2f')]);_0x5da463[_0x847e('0x30')]=_[_0x847e('0x31')](_0x5da463[_0x847e('0x2e')],_0x5da463[_0x847e('0x2f')]);_0x110fec[_0x847e('0x32')]=_[_0x847e('0x31')](_0x5da463[_0x847e('0x2e')],qs[_0x847e('0x33')](_0x352fc8[_0x847e('0x2f')][_0x847e('0x33')]));_0x110fec[_0x847e('0x32')]=_0x110fec[_0x847e('0x32')]['length']?_0x110fec['attributes']:_0x5da463[_0x847e('0x2e')];if(_0x352fc8[_0x847e('0x2f')][_0x847e('0x3e')]){_0x110fec[_0x847e('0x3f')]=[{'all':!![]}];}_0x110fec=_['merge']({},_0x110fec,_0x352fc8[_0x847e('0x45')]);return db[_0x847e('0x2b')][_0x847e('0x46')](_0x110fec)[_0x847e('0x22')](handleEntityNotFound(_0x55d26f,null))['then'](respondWithResult(_0x55d26f,null))[_0x847e('0x41')](handleError(_0x55d26f,null));};exports['create']=function(_0x4f26ef,_0x368814){return db[_0x847e('0x2b')][_0x847e('0x47')](_0x4f26ef['body'],{})[_0x847e('0x22')](respondWithResult(_0x368814,0xc9))[_0x847e('0x41')](handleError(_0x368814,null));};exports[_0x847e('0x21')]=function(_0x3044dd,_0x47323b){if(_0x3044dd[_0x847e('0x48')]['id']){delete _0x3044dd[_0x847e('0x48')]['id'];}return db[_0x847e('0x2b')][_0x847e('0x46')]({'where':{'id':_0x3044dd['params']['id']}})['then'](handleEntityNotFound(_0x47323b,null))[_0x847e('0x22')](saveUpdates(_0x3044dd[_0x847e('0x48')],null))[_0x847e('0x22')](respondWithResult(_0x47323b,null))[_0x847e('0x41')](handleError(_0x47323b,null));};exports[_0x847e('0x23')]=function(_0x34dc67,_0x4f8d07){return db[_0x847e('0x2b')][_0x847e('0x46')]({'where':{'id':_0x34dc67['params']['id']}})['then'](handleEntityNotFound(_0x4f8d07,null))[_0x847e('0x22')](removeEntity(_0x4f8d07,null))['catch'](handleError(_0x4f8d07,null));}; \ No newline at end of file +var _0x0427=['attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','ZendeskField','rows','catch','show','keys','includeAll','find','create','body','update','params','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'];(function(_0x4334e2,_0x10cc87){var _0x452516=function(_0x46df93){while(--_0x46df93){_0x4334e2['push'](_0x4334e2['shift']());}};_0x452516(++_0x10cc87);}(_0x0427,0x137));var _0x7042=function(_0x388d20,_0x572d33){_0x388d20=_0x388d20-0x0;var _0x11f6c6=_0x0427[_0x388d20];return _0x11f6c6;};'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['ZendeskField']['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['ZendeskField']['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));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index f6a23f6..4c22fb5 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 _0x9514=['idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZendeskField','zendesk_unique_index'];(function(_0x3f9809,_0x14d72d){var _0x1fb162=function(_0x447fa0){while(--_0x447fa0){_0x3f9809['push'](_0x3f9809['shift']());}};_0x1fb162(++_0x14d72d);}(_0x9514,0xb8));var _0x4951=function(_0x550d8c,_0x1ebc1f){_0x550d8c=_0x550d8c-0x0;var _0x2ff952=_0x9514[_0x550d8c];return _0x2ff952;};'use strict';var _=require('lodash');var util=require(_0x4951('0x0'));var logger=require(_0x4951('0x1'))(_0x4951('0x2'));var moment=require('moment');var BPromise=require(_0x4951('0x3'));var rp=require(_0x4951('0x4'));var fs=require('fs');var path=require(_0x4951('0x5'));var rimraf=require(_0x4951('0x6'));var config=require(_0x4951('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x4951('0x8')]=function(_0x48aba8,_0xb7b526){return _0x48aba8[_0x4951('0x9')](_0x4951('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x4951('0xb'),'fields':[_0x4951('0xc'),_0x4951('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7444=['path','rimraf','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','FieldId','util','../../config/logger','api','bluebird'];(function(_0x1f3aec,_0x24c18e){var _0x409f0d=function(_0x52b818){while(--_0x52b818){_0x1f3aec['push'](_0x1f3aec['shift']());}};_0x409f0d(++_0x24c18e);}(_0x7444,0x158));var _0x4744=function(_0x1db9e8,_0x2f7c16){_0x1db9e8=_0x1db9e8-0x0;var _0x46f156=_0x7444[_0x1db9e8];return _0x46f156;};'use strict';var _=require('lodash');var util=require(_0x4744('0x0'));var logger=require(_0x4744('0x1'))(_0x4744('0x2'));var moment=require('moment');var BPromise=require(_0x4744('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4744('0x4'));var rimraf=require(_0x4744('0x5'));var config=require(_0x4744('0x6'));var attributes=require(_0x4744('0x7'));module['exports']=function(_0x178779,_0x2acec3){return _0x178779[_0x4744('0x8')]('ZendeskField',attributes,{'tableName':_0x4744('0x9'),'paranoid':![],'indexes':[{'name':_0x4744('0xa'),'fields':['idField',_0x4744('0xb')],'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 7adbd8a..96ed1b9 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 _0xed69=['../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x287301,_0x100fd0){var _0x5d0d67=function(_0x1f4ba4){while(--_0x1f4ba4){_0x287301['push'](_0x287301['shift']());}};_0x5d0d67(++_0x100fd0);}(_0xed69,0x11f));var _0x9ed6=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0xed69[_0x4bfcbe];return _0x5b65e6;};'use strict';var _=require(_0x9ed6('0x0'));var util=require(_0x9ed6('0x1'));var moment=require(_0x9ed6('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ed6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ed6('0x4'))['db'];var utils=require(_0x9ed6('0x5'));var logger=require(_0x9ed6('0x6'))('rpc');var config=require(_0x9ed6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9ed6('0x8')][_0x9ed6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46e148,_0x4641ff,_0x9a178c){return new BPromise(function(_0x5b9451,_0x397962){return client[_0x9ed6('0xa')](_0x46e148,_0x9a178c)[_0x9ed6('0xb')](function(_0x1342ce){logger[_0x9ed6('0xc')](_0x9ed6('0xd'),_0x4641ff,_0x9ed6('0xe'));logger[_0x9ed6('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4641ff,_0x9ed6('0xe'),JSON[_0x9ed6('0x10')](_0x1342ce));if(_0x1342ce['error']){if(_0x1342ce['error'][_0x9ed6('0x11')]===0x1f4){logger[_0x9ed6('0x12')](_0x9ed6('0xd'),_0x4641ff,_0x1342ce[_0x9ed6('0x12')]['message']);return _0x397962(_0x1342ce[_0x9ed6('0x12')]['message']);}logger[_0x9ed6('0x12')](_0x9ed6('0xd'),_0x4641ff,_0x1342ce[_0x9ed6('0x12')][_0x9ed6('0x13')]);return _0x5b9451(_0x1342ce[_0x9ed6('0x12')]['message']);}else{logger[_0x9ed6('0xc')](_0x9ed6('0xd'),_0x4641ff,_0x9ed6('0xe'));_0x5b9451(_0x1342ce['result'][_0x9ed6('0x13')]);}})[_0x9ed6('0x14')](function(_0x46ad83){logger['error'](_0x9ed6('0xd'),_0x4641ff,_0x46ad83);_0x397962(_0x46ad83);});});} \ No newline at end of file +var _0x6421=['../../config/environment','http','then','info','request\x20sent','debug','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x10ba6f,_0x1ea99b){var _0x387531=function(_0x3d96fe){while(--_0x3d96fe){_0x10ba6f['push'](_0x10ba6f['shift']());}};_0x387531(++_0x1ea99b);}(_0x6421,0xb5));var _0x1642=function(_0x495f2b,_0x3fc425){_0x495f2b=_0x495f2b-0x0;var _0x692e59=_0x6421[_0x495f2b];return _0x692e59;};'use strict';var _=require(_0x1642('0x0'));var util=require(_0x1642('0x1'));var moment=require(_0x1642('0x2'));var BPromise=require(_0x1642('0x3'));var rs=require(_0x1642('0x4'));var fs=require('fs');var Redis=require(_0x1642('0x5'));var db=require(_0x1642('0x6'))['db'];var utils=require(_0x1642('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1642('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1642('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f617c,_0x18a372,_0x3d5a0f){return new BPromise(function(_0x46a421,_0x1431d8){return client['request'](_0x3f617c,_0x3d5a0f)[_0x1642('0xa')](function(_0x3fd208){logger[_0x1642('0xb')]('ZendeskField,\x20%s,\x20%s',_0x18a372,_0x1642('0xc'));logger[_0x1642('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x18a372,_0x1642('0xc'),JSON[_0x1642('0xe')](_0x3fd208));if(_0x3fd208[_0x1642('0xf')]){if(_0x3fd208[_0x1642('0xf')][_0x1642('0x10')]===0x1f4){logger['error'](_0x1642('0x11'),_0x18a372,_0x3fd208[_0x1642('0xf')]['message']);return _0x1431d8(_0x3fd208[_0x1642('0xf')][_0x1642('0x12')]);}logger['error'](_0x1642('0x11'),_0x18a372,_0x3fd208[_0x1642('0xf')][_0x1642('0x12')]);return _0x46a421(_0x3fd208[_0x1642('0xf')][_0x1642('0x12')]);}else{logger[_0x1642('0xb')](_0x1642('0x11'),_0x18a372,_0x1642('0xc'));_0x46a421(_0x3fd208[_0x1642('0x13')][_0x1642('0x12')]);}})[_0x1642('0x14')](function(_0x15c8c5){logger[_0x1642('0xf')]('ZendeskField,\x20%s,\x20%s',_0x18a372,_0x15c8c5);_0x1431d8(_0x15c8c5);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 264e99b..4a384c3 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 _0xbec5=['addConfiguration','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x56887f,_0x924860){var _0x1dfe61=function(_0x20834f){while(--_0x20834f){_0x56887f['push'](_0x56887f['shift']());}};_0x1dfe61(++_0x924860);}(_0xbec5,0x147));var _0x5bec=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xbec5[_0x5a6961];return _0x4af0a6;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require(_0x5bec('0x2'));var timeout=require(_0x5bec('0x3'));var express=require(_0x5bec('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5bec('0x5'));var interaction=require(_0x5bec('0x6'));var config=require(_0x5bec('0x7'));var controller=require('./intZohoAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5bec('0x8')](_0x5bec('0x9'),auth[_0x5bec('0xa')](),controller['show']);router[_0x5bec('0x8')](_0x5bec('0xb'),auth[_0x5bec('0xa')](),controller[_0x5bec('0xc')]);router[_0x5bec('0x8')](_0x5bec('0xd'),auth[_0x5bec('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5bec('0xe')]('/:id/configurations',auth[_0x5bec('0xa')](),controller[_0x5bec('0xf')]);router['put'](_0x5bec('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x5bec('0x10')](_0x5bec('0x9'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);module[_0x5bec('0x12')]=router; \ No newline at end of file +var _0x8303=['../../components/auth/service','../../config/environment','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x3f994d,_0x249d72){var _0x5309b4=function(_0x545307){while(--_0x545307){_0x3f994d['push'](_0x3f994d['shift']());}};_0x5309b4(++_0x249d72);}(_0x8303,0x174));var _0x3830=function(_0x1b8182,_0x522372){_0x1b8182=_0x1b8182-0x0;var _0x2be874=_0x8303[_0x1b8182];return _0x2be874;};'use strict';var multer=require(_0x3830('0x0'));var util=require(_0x3830('0x1'));var path=require('path');var timeout=require(_0x3830('0x2'));var express=require(_0x3830('0x3'));var router=express[_0x3830('0x4')]();var fs_extra=require(_0x3830('0x5'));var auth=require(_0x3830('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3830('0x7'));var controller=require('./intZohoAccount.controller');router[_0x3830('0x8')]('/',auth[_0x3830('0x9')](),controller['index']);router[_0x3830('0x8')]('/:id',auth[_0x3830('0x9')](),controller['show']);router[_0x3830('0x8')](_0x3830('0xa'),auth['isAuthenticated'](),controller[_0x3830('0xb')]);router[_0x3830('0x8')](_0x3830('0xc'),auth[_0x3830('0x9')](),controller[_0x3830('0xd')]);router[_0x3830('0xe')]('/',auth['isAuthenticated'](),controller[_0x3830('0xf')]);router[_0x3830('0xe')](_0x3830('0xa'),auth['isAuthenticated'](),controller[_0x3830('0x10')]);router[_0x3830('0x11')](_0x3830('0x12'),auth[_0x3830('0x9')](),controller['update']);router[_0x3830('0x13')]('/:id',auth[_0x3830('0x9')](),controller[_0x3830('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 32c05c9..dbdd8a1 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 _0xa9e0=['sequelize','exports','STRING'];(function(_0x211f5f,_0xc6daac){var _0x4feb86=function(_0x30c168){while(--_0x30c168){_0x211f5f['push'](_0x211f5f['shift']());}};_0x4feb86(++_0xc6daac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x0a9e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0a9e('0x2')]},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x0a9e('0x2')]},'refreshToken':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0x750a=['exports','STRING'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x750a,0x140));var _0xa750=function(_0xbda2fa,_0x544664){_0xbda2fa=_0xbda2fa-0x0;var _0x3b62b7=_0x750a[_0xbda2fa];return _0x3b62b7;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa750('0x1')]},'zone':{'type':Sequelize[_0xa750('0x1')]},'clientId':{'type':Sequelize[_0xa750('0x1')]},'clientSecret':{'type':Sequelize[_0xa750('0x1')]},'serverUrl':{'type':Sequelize[_0xa750('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa750('0x1')]},'refreshToken':{'type':Sequelize[_0xa750('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 1ca1167..849a54a 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 _0x485b=['com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','ZohoAccount','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','includeAll','rows','catch','params','rawAttributes','options','find','create','body','findOne','pick','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','Subjects','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','host','zone','clientId','serverUrl','zoho.eu'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x485b,0x99));var _0xb485=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x485b[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xb485('0x0'));var rimraf=require(_0xb485('0x1'));var zipdir=require(_0xb485('0x2'));var jsonpatch=require(_0xb485('0x3'));var rp=require('request-promise');var moment=require(_0xb485('0x4'));var BPromise=require(_0xb485('0x5'));var Mustache=require('mustache');var util=require(_0xb485('0x6'));var path=require(_0xb485('0x7'));var sox=require(_0xb485('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb485('0x9'));var _=require(_0xb485('0xa'));var squel=require(_0xb485('0xb'));var crypto=require(_0xb485('0xc'));var jsforce=require(_0xb485('0xd'));var deskjs=require(_0xb485('0xe'));var toCsv=require(_0xb485('0xf'));var querystring=require(_0xb485('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb485('0x11'));var as=require(_0xb485('0x12'));var hardwareService=require(_0xb485('0x13'));var logger=require('../../config/logger')(_0xb485('0x14'));var utils=require(_0xb485('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb485('0x16'))['db'];var integrations=require(_0xb485('0x17'));function respondWithStatusCode(_0x2b99d6,_0x262795){_0x262795=_0x262795||0xcc;return function(_0x11e826){if(_0x11e826){return _0x2b99d6[_0xb485('0x18')](_0x262795);}return _0x2b99d6[_0xb485('0x19')](_0x262795)['end']();};}function respondWithResult(_0x35b333,_0x27af5f){_0x27af5f=_0x27af5f||0xc8;return function(_0x207890){if(_0x207890){return _0x35b333['status'](_0x27af5f)[_0xb485('0x1a')](_0x207890);}};}function respondWithFilteredResult(_0xf316be,_0x13c5a9){return function(_0x10a367){if(_0x10a367){var _0x173800=typeof _0x13c5a9[_0xb485('0x1b')]==='undefined'&&typeof _0x13c5a9[_0xb485('0x1c')]===_0xb485('0x1d');var _0x142c23=_0x10a367[_0xb485('0x1e')];var _0x5690f8=_0x173800?0x0:_0x13c5a9['offset'];var _0x117843=_0x173800?_0x10a367['count']:_0x13c5a9[_0xb485('0x1b')]+_0x13c5a9[_0xb485('0x1c')];var _0x36faa3;if(_0x117843>=_0x142c23){_0x117843=_0x142c23;_0x36faa3=0xc8;}else{_0x36faa3=0xce;}_0xf316be[_0xb485('0x19')](_0x36faa3);return _0xf316be[_0xb485('0x1f')]('Content-Range',_0x5690f8+'-'+_0x117843+'/'+_0x142c23)[_0xb485('0x1a')](_0x10a367);}return null;};}function patchUpdates(_0x35b65f){return function(_0x1a41a9){try{jsonpatch[_0xb485('0x20')](_0x1a41a9,_0x35b65f,!![]);}catch(_0x4861ec){return BPromise[_0xb485('0x21')](_0x4861ec);}return _0x1a41a9[_0xb485('0x22')]();};}function saveUpdates(_0x188b79,_0x462a0b){return function(_0x167070){if(_0x167070){return _0x167070[_0xb485('0x23')](_0x188b79)['then'](function(_0x45411c){return _0x45411c;});}return null;};}function removeEntity(_0x2468c9,_0x3615ee){return function(_0x4e2453){if(_0x4e2453){return _0x4e2453[_0xb485('0x24')]()[_0xb485('0x25')](function(){_0x2468c9[_0xb485('0x19')](0xcc)[_0xb485('0x26')]();});}};}function handleEntityNotFound(_0x2ecb68,_0x136e03){return function(_0xc1946d){if(!_0xc1946d){_0x2ecb68[_0xb485('0x18')](0x194);}return _0xc1946d;};}function handleError(_0x265a04,_0x48cfdc){_0x48cfdc=_0x48cfdc||0x1f4;return function(_0xa5c141){logger[_0xb485('0x27')](_0xa5c141[_0xb485('0x28')]);if(_0xa5c141[_0xb485('0x29')]){delete _0xa5c141['name'];}_0x265a04[_0xb485('0x19')](_0x48cfdc)[_0xb485('0x2a')](_0xa5c141);};}exports[_0xb485('0x2b')]=function(_0x32e5b5,_0x41fc5c){var _0x38adc3={},_0x4dbc57={},_0x397e50={'count':0x0,'rows':[]};var _0x199b99=_[_0xb485('0x2c')](db[_0xb485('0x2d')]['rawAttributes'],function(_0x89e1d){return{'name':_0x89e1d['fieldName'],'type':_0x89e1d[_0xb485('0x2e')]['key']};});_0x4dbc57['model']=_[_0xb485('0x2c')](_0x199b99,'name');_0x4dbc57[_0xb485('0x2f')]=_[_0xb485('0x30')](_0x32e5b5[_0xb485('0x2f')]);_0x4dbc57[_0xb485('0x31')]=_[_0xb485('0x32')](_0x4dbc57[_0xb485('0x33')],_0x4dbc57[_0xb485('0x2f')]);_0x38adc3[_0xb485('0x34')]=_['intersection'](_0x4dbc57[_0xb485('0x33')],qs[_0xb485('0x35')](_0x32e5b5['query']['fields']));_0x38adc3[_0xb485('0x34')]=_0x38adc3[_0xb485('0x34')][_0xb485('0x36')]?_0x38adc3[_0xb485('0x34')]:_0x4dbc57[_0xb485('0x33')];if(!_0x32e5b5[_0xb485('0x2f')][_0xb485('0x37')]('nolimit')){_0x38adc3[_0xb485('0x1c')]=qs[_0xb485('0x1c')](_0x32e5b5[_0xb485('0x2f')][_0xb485('0x1c')]);_0x38adc3[_0xb485('0x1b')]=qs['offset'](_0x32e5b5['query'][_0xb485('0x1b')]);}_0x38adc3[_0xb485('0x38')]=qs['sort'](_0x32e5b5[_0xb485('0x2f')][_0xb485('0x39')]);_0x38adc3['where']=qs[_0xb485('0x31')](_['pick'](_0x32e5b5[_0xb485('0x2f')],_0x4dbc57[_0xb485('0x31')]),_0x199b99);if(_0x32e5b5[_0xb485('0x2f')][_0xb485('0x3a')]){_0x38adc3['where']=_[_0xb485('0x3b')](_0x38adc3[_0xb485('0x3c')],{'$or':_[_0xb485('0x2c')](_0x199b99,function(_0x5bb7a5){if(_0x5bb7a5[_0xb485('0x2e')]!==_0xb485('0x3d')){var _0x37ef7a={};_0x37ef7a[_0x5bb7a5[_0xb485('0x29')]]={'$like':'%'+_0x32e5b5[_0xb485('0x2f')][_0xb485('0x3a')]+'%'};return _0x37ef7a;}})});}_0x38adc3=_[_0xb485('0x3b')]({},_0x38adc3,_0x32e5b5['options']);var _0x261e79={'where':_0x38adc3[_0xb485('0x3c')]};return db[_0xb485('0x2d')][_0xb485('0x1e')](_0x261e79)[_0xb485('0x25')](function(_0x7c18ce){_0x397e50[_0xb485('0x1e')]=_0x7c18ce;if(_0x32e5b5[_0xb485('0x2f')][_0xb485('0x3e')]){_0x38adc3['include']=[{'all':!![]}];}return db[_0xb485('0x2d')]['findAll'](_0x38adc3);})[_0xb485('0x25')](function(_0x2223ae){_0x397e50[_0xb485('0x3f')]=_0x2223ae;return _0x397e50;})['then'](respondWithFilteredResult(_0x41fc5c,_0x38adc3))[_0xb485('0x40')](handleError(_0x41fc5c,null));};exports['show']=function(_0x87f8f5,_0x32d507){var _0x3d66e4={'raw':![],'where':{'id':_0x87f8f5[_0xb485('0x41')]['id']}},_0xf02666={};_0xf02666[_0xb485('0x33')]=_[_0xb485('0x30')](db[_0xb485('0x2d')][_0xb485('0x42')]);_0xf02666[_0xb485('0x2f')]=_[_0xb485('0x30')](_0x87f8f5['query']);_0xf02666['filters']=_[_0xb485('0x32')](_0xf02666[_0xb485('0x33')],_0xf02666[_0xb485('0x2f')]);_0x3d66e4[_0xb485('0x34')]=_[_0xb485('0x32')](_0xf02666['model'],qs[_0xb485('0x35')](_0x87f8f5[_0xb485('0x2f')]['fields']));_0x3d66e4[_0xb485('0x34')]=_0x3d66e4[_0xb485('0x34')][_0xb485('0x36')]?_0x3d66e4['attributes']:_0xf02666[_0xb485('0x33')];if(_0x87f8f5['query'][_0xb485('0x3e')]){_0x3d66e4['include']=[{'all':!![]}];}_0x3d66e4=_[_0xb485('0x3b')]({},_0x3d66e4,_0x87f8f5[_0xb485('0x43')]);return db[_0xb485('0x2d')][_0xb485('0x44')](_0x3d66e4)[_0xb485('0x25')](handleEntityNotFound(_0x32d507,null))[_0xb485('0x25')](respondWithResult(_0x32d507,null))['catch'](handleError(_0x32d507,null));};exports[_0xb485('0x45')]=function(_0x2a7f9f,_0x47043a){return db['ZohoAccount'][_0xb485('0x45')](_0x2a7f9f['body'],{})[_0xb485('0x25')](respondWithResult(_0x47043a,0xc9))[_0xb485('0x40')](handleError(_0x47043a,null));};exports[_0xb485('0x23')]=function(_0x440c9b,_0x5b9a5d){if(_0x440c9b[_0xb485('0x46')]['id']){delete _0x440c9b['body']['id'];}return db[_0xb485('0x2d')]['find']({'where':{'id':_0x440c9b['params']['id']}})[_0xb485('0x25')](handleEntityNotFound(_0x5b9a5d,null))[_0xb485('0x25')](saveUpdates(_0x440c9b[_0xb485('0x46')],null))[_0xb485('0x25')](respondWithResult(_0x5b9a5d,null))[_0xb485('0x40')](handleError(_0x5b9a5d,null));};exports[_0xb485('0x24')]=function(_0x4d3ec4,_0x5bd3ee){return db[_0xb485('0x2d')][_0xb485('0x44')]({'where':{'id':_0x4d3ec4[_0xb485('0x41')]['id']}})[_0xb485('0x25')](handleEntityNotFound(_0x5bd3ee,null))['then'](removeEntity(_0x5bd3ee,null))[_0xb485('0x40')](handleError(_0x5bd3ee,null));};exports['getConfigurations']=function(_0x322ead,_0x33f433,_0x18dcc3){var _0x55d522={};var _0x5eff7f={};var _0x22ee3a;var _0x38d2c6;return db[_0xb485('0x2d')][_0xb485('0x47')]({'where':{'id':_0x322ead['params']['id']}})[_0xb485('0x25')](handleEntityNotFound(_0x33f433,null))['then'](function(_0x58c75b){if(_0x58c75b){_0x22ee3a=_0x58c75b;_0x5eff7f[_0xb485('0x33')]=_[_0xb485('0x30')](db['ZohoConfiguration']['rawAttributes']);_0x5eff7f[_0xb485('0x2f')]=_[_0xb485('0x30')](_0x322ead['query']);_0x5eff7f[_0xb485('0x31')]=_[_0xb485('0x32')](_0x5eff7f[_0xb485('0x33')],_0x5eff7f['query']);_0x55d522[_0xb485('0x34')]=_[_0xb485('0x32')](_0x5eff7f['model'],qs[_0xb485('0x35')](_0x322ead[_0xb485('0x2f')][_0xb485('0x35')]));_0x55d522[_0xb485('0x34')]=_0x55d522[_0xb485('0x34')][_0xb485('0x36')]?_0x55d522['attributes']:_0x5eff7f[_0xb485('0x33')];_0x55d522['order']=qs[_0xb485('0x39')](_0x322ead[_0xb485('0x2f')][_0xb485('0x39')]);_0x55d522[_0xb485('0x3c')]=qs[_0xb485('0x31')](_[_0xb485('0x48')](_0x322ead['query'],_0x5eff7f[_0xb485('0x31')]));if(_0x322ead[_0xb485('0x2f')][_0xb485('0x3a')]){_0x55d522[_0xb485('0x3c')]=_[_0xb485('0x3b')](_0x55d522['where'],{'$or':_['map'](_0x55d522[_0xb485('0x34')],function(_0x156721){var _0x578ae4={};_0x578ae4[_0x156721]={'$like':'%'+_0x322ead[_0xb485('0x2f')][_0xb485('0x3a')]+'%'};return _0x578ae4;})});}_0x55d522=_[_0xb485('0x3b')]({},_0x55d522,_0x322ead['options']);return _0x22ee3a[_0xb485('0x49')](_0x55d522);}})[_0xb485('0x25')](function(_0x5380bf){if(_0x5380bf){_0x38d2c6=_0x5380bf[_0xb485('0x36')];if(!_0x322ead[_0xb485('0x2f')][_0xb485('0x37')]('nolimit')){_0x55d522[_0xb485('0x1c')]=qs[_0xb485('0x1c')](_0x322ead['query'][_0xb485('0x1c')]);_0x55d522['offset']=qs[_0xb485('0x1b')](_0x322ead[_0xb485('0x2f')][_0xb485('0x1b')]);}return _0x22ee3a['getConfigurations'](_0x55d522);}})[_0xb485('0x25')](function(_0x1e716c){if(_0x1e716c){return _0x1e716c?{'count':_0x38d2c6,'rows':_0x1e716c}:null;}})[_0xb485('0x25')](respondWithResult(_0x33f433,null))[_0xb485('0x40')](handleError(_0x33f433,null));};exports[_0xb485('0x4a')]=function(_0x5c8717,_0x49be8e,_0x4b7ced){if(_0x5c8717[_0xb485('0x46')]['id']){delete _0x5c8717['body']['id'];}return db[_0xb485('0x2d')][_0xb485('0x47')]({'where':{'id':_0x5c8717[_0xb485('0x41')]['id']}})[_0xb485('0x25')](handleEntityNotFound(_0x49be8e,null))['then'](function(_0x22c814){if(_0x22c814){_0x5c8717[_0xb485('0x46')][_0xb485('0x4b')]=_0x22c814['id'];_0x5c8717['body']['Subjects']=integrations[_0xb485('0x4c')](_0x5c8717[_0xb485('0x46')][_0xb485('0x4d')],_0x5c8717[_0xb485('0x46')][_0xb485('0x2e')]);_0x5c8717[_0xb485('0x46')][_0xb485('0x4e')]=integrations[_0xb485('0x4f')](_0x5c8717['body']['channel'],_0x5c8717[_0xb485('0x46')]['type']);return db[_0xb485('0x50')][_0xb485('0x45')](_0x5c8717['body'],{'include':[{'model':db[_0xb485('0x51')],'as':_0xb485('0x52')},{'model':db['ZohoField'],'as':_0xb485('0x4e')}]});}return null;})[_0xb485('0x25')](respondWithResult(_0x49be8e,null))[_0xb485('0x40')](handleError(_0x49be8e,null));};function getAccessToken(_0x40cae1){return new Promise(function(_0x15f740,_0x27f6f8){var _0x5c234d;switch(_0x40cae1['zone']){case'US':_0x5c234d='https://accounts.zoho.com';break;case'AU':_0x5c234d='https://accounts.zoho.com.au';break;case'EU':_0x5c234d=_0xb485('0x53');break;case'IN':_0x5c234d=_0xb485('0x54');break;case'CN':_0x5c234d=_0xb485('0x55');break;default:_0x5c234d=_0xb485('0x53');break;}var _0x3988a7={'method':_0xb485('0x56'),'uri':_0x5c234d+_0xb485('0x57'),'qs':{'refresh_token':_0x40cae1[_0xb485('0x58')],'client_id':_0x40cae1['clientId'],'client_secret':_0x40cae1[_0xb485('0x59')],'grant_type':_0xb485('0x5a')},'json':!![]};return rp(_0x3988a7)[_0xb485('0x25')](function(_0x98e99d){if(_0x98e99d[_0xb485('0x5b')]){_0x15f740(_0x98e99d['access_token']);}else{_0x27f6f8('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xb485('0x40')](function(_0x438a95){_0x27f6f8(_0x438a95);});});}exports['getFields']=function(_0x4cb8f6,_0x3812d9,_0x1e3e25){var _0x4dfe32,_0x2abb75,_0x3e1ebe,_0x594fc8,_0x1bc977;return db[_0xb485('0x2d')][_0xb485('0x47')]({'where':{'id':_0x4cb8f6[_0xb485('0x41')]['id']},'attributes':['id',_0xb485('0x5c'),_0xb485('0x5d'),_0xb485('0x5e'),_0xb485('0x59'),_0xb485('0x5f'),'code','refreshToken']})[_0xb485('0x25')](handleEntityNotFound(_0x3812d9,null))[_0xb485('0x25')](function(_0x415f41){_0x1bc977=_0x415f41;_0x4dfe32=_0x1bc977[_0xb485('0x5c')];_0x2abb75=_0x4dfe32===_0xb485('0x60')?'eu':_0xb485('0x61');_0x3e1ebe=_0x1bc977[_0xb485('0x5f')];var _0x4d3a95=_0x3e1ebe['slice'](-0x1);if(_0x4d3a95==='/'||_0x4d3a95==='\x5c'||_0x4d3a95===':'){_0x3e1ebe=_0x3e1ebe[_0xb485('0x62')](0x0,_0x3e1ebe[_0xb485('0x63')](_0x4d3a95));}if(!_0x1bc977[_0xb485('0x58')]){throw new Error(_0xb485('0x64'));}return getAccessToken(_0x1bc977);})[_0xb485('0x25')](function(_0x28ea5d){if(_0x28ea5d){return rp({'method':_0xb485('0x65'),'uri':util['format'](_0xb485('0x66'),_0x2abb75),'qs':{'module':'Calls'},'headers':{'Authorization':_0xb485('0x67')+_0x28ea5d},'json':!![]});}})[_0xb485('0x25')](function(_0x1c9b2c){if(_0x1c9b2c){if(_0x1c9b2c[_0xb485('0x68')]&&_0x1c9b2c[_0xb485('0x68')][_0xb485('0x27')]){throw new Error(_0x1c9b2c[_0xb485('0x68')][_0xb485('0x27')][_0xb485('0x69')]);}var _0x1f8fad=[];var _0x3c1296=[];var _0x7c5265=[_0xb485('0x6a'),_0xb485('0x6b'),_0xb485('0x6c'),_0xb485('0x6d'),_0xb485('0x6e'),'Call_Result',_0xb485('0x6f'),_0xb485('0x70')];_0x3c1296=_['remove'](_0x1c9b2c[_0xb485('0x35')],function(_0x41b280){return _0x7c5265[_0xb485('0x71')](_0x41b280[_0xb485('0x72')]);});for(var _0x2991f1=0x0;_0x2991f1<_0x3c1296['length'];_0x2991f1++){if(_0x3c1296[_0x2991f1][_0xb485('0x73')]===![]){_0x1f8fad[_0xb485('0x74')]({'id':_0x3c1296[_0x2991f1]['id'],'name':_0x3c1296[_0x2991f1][_0xb485('0x75')],'custom':_0x3c1296[_0x2991f1]['custom_field'],'options':_0x3c1296[_0x2991f1][_0xb485('0x76')]===_0xb485('0x77')&&_0x3c1296[_0x2991f1][_0xb485('0x78')][_0xb485('0x36')]>-0x1?_[_0xb485('0x2c')](_0x3c1296[_0x2991f1]['pick_list_values'],function(_0x65a0ee){return{'name':_0x65a0ee,'value':_0x65a0ee};}):[]});}}return{'count':_0x1f8fad[_0xb485('0x36')],'rows':_0x1f8fad};}else{return{'count':0x0,'rows':[]};}})[_0xb485('0x25')](respondWithResult(_0x3812d9,null))[_0xb485('0x40')](function(_0x4d9713){var _0x3c88dd=_0x4cb8f6['query'][_0xb485('0x79')]?0x1f4:_0x4d9713[_0xb485('0x7a')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3c88dd,JSON[_0xb485('0x7b')](_0x4d9713));delete _0x4d9713[_0xb485('0x29')];if(_0x3c88dd===0x191){_0x3c88dd=0x190;}_0x3812d9[_0xb485('0x19')](_0x3c88dd)['send'](_0x4cb8f6[_0xb485('0x2f')]['test']?{'message':_0xb485('0x7c'),'statusCode':_0x4d9713[_0xb485('0x7a')]}:_0x4d9713);});}; \ No newline at end of file +var _0xce26=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','count','set','json','reject','save','update','destroy','then','stack','send','index','map','ZohoAccount','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','find','catch','create','body','findOne','ZohoConfiguration','options','getConfigurations','addConfiguration','Subjects','getSubjects','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','getFields','code','host','zoho.eu','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials'];(function(_0x155adb,_0x2f0ba1){var _0x2ae34f=function(_0x8f83d6){while(--_0x8f83d6){_0x155adb['push'](_0x155adb['shift']());}};_0x2ae34f(++_0x2f0ba1);}(_0xce26,0x102));var _0x6ce2=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xce26[_0x4e93a9];return _0x43013c;};'use strict';var emlformat=require(_0x6ce2('0x0'));var rimraf=require(_0x6ce2('0x1'));var zipdir=require(_0x6ce2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ce2('0x3'));var BPromise=require(_0x6ce2('0x4'));var Mustache=require(_0x6ce2('0x5'));var util=require(_0x6ce2('0x6'));var path=require(_0x6ce2('0x7'));var sox=require(_0x6ce2('0x8'));var csv=require(_0x6ce2('0x9'));var ejs=require(_0x6ce2('0xa'));var fs=require('fs');var fs_extra=require(_0x6ce2('0xb'));var _=require(_0x6ce2('0xc'));var squel=require(_0x6ce2('0xd'));var crypto=require(_0x6ce2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6ce2('0xf'));var toCsv=require(_0x6ce2('0x9'));var querystring=require(_0x6ce2('0x10'));var Papa=require('papaparse');var Redis=require(_0x6ce2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6ce2('0x12'));var as=require(_0x6ce2('0x13'));var hardwareService=require(_0x6ce2('0x14'));var logger=require(_0x6ce2('0x15'))(_0x6ce2('0x16'));var utils=require(_0x6ce2('0x17'));var config=require(_0x6ce2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ce2('0x19'))['db'];var integrations=require(_0x6ce2('0x1a'));function respondWithStatusCode(_0x35add4,_0x2df31c){_0x2df31c=_0x2df31c||0xcc;return function(_0x4764bc){if(_0x4764bc){return _0x35add4[_0x6ce2('0x1b')](_0x2df31c);}return _0x35add4[_0x6ce2('0x1c')](_0x2df31c)[_0x6ce2('0x1d')]();};}function respondWithResult(_0x52bd76,_0x1acd49){_0x1acd49=_0x1acd49||0xc8;return function(_0x493cb1){if(_0x493cb1){return _0x52bd76[_0x6ce2('0x1c')](_0x1acd49)['json'](_0x493cb1);}};}function respondWithFilteredResult(_0x5e8cae,_0x49bb03){return function(_0xc39785){if(_0xc39785){var _0x15f668=typeof _0x49bb03[_0x6ce2('0x1e')]==='undefined'&&typeof _0x49bb03[_0x6ce2('0x1f')]==='undefined';var _0x2e99be=_0xc39785[_0x6ce2('0x20')];var _0x146bd3=_0x15f668?0x0:_0x49bb03[_0x6ce2('0x1e')];var _0x17d24d=_0x15f668?_0xc39785['count']:_0x49bb03[_0x6ce2('0x1e')]+_0x49bb03[_0x6ce2('0x1f')];var _0x17f969;if(_0x17d24d>=_0x2e99be){_0x17d24d=_0x2e99be;_0x17f969=0xc8;}else{_0x17f969=0xce;}_0x5e8cae[_0x6ce2('0x1c')](_0x17f969);return _0x5e8cae[_0x6ce2('0x21')]('Content-Range',_0x146bd3+'-'+_0x17d24d+'/'+_0x2e99be)[_0x6ce2('0x22')](_0xc39785);}return null;};}function patchUpdates(_0x24bb92){return function(_0x1033ad){try{jsonpatch['apply'](_0x1033ad,_0x24bb92,!![]);}catch(_0x228610){return BPromise[_0x6ce2('0x23')](_0x228610);}return _0x1033ad[_0x6ce2('0x24')]();};}function saveUpdates(_0x40d815,_0x25d85b){return function(_0x13da35){if(_0x13da35){return _0x13da35[_0x6ce2('0x25')](_0x40d815)['then'](function(_0x362d1f){return _0x362d1f;});}return null;};}function removeEntity(_0x341106,_0x88452e){return function(_0x47d739){if(_0x47d739){return _0x47d739[_0x6ce2('0x26')]()[_0x6ce2('0x27')](function(){_0x341106['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x549369,_0x168010){return function(_0x3e36b7){if(!_0x3e36b7){_0x549369[_0x6ce2('0x1b')](0x194);}return _0x3e36b7;};}function handleError(_0x4efa97,_0x1eb968){_0x1eb968=_0x1eb968||0x1f4;return function(_0x3d9740){logger['error'](_0x3d9740[_0x6ce2('0x28')]);if(_0x3d9740['name']){delete _0x3d9740['name'];}_0x4efa97[_0x6ce2('0x1c')](_0x1eb968)[_0x6ce2('0x29')](_0x3d9740);};}exports[_0x6ce2('0x2a')]=function(_0x534f67,_0x16ca7c){var _0x596979={},_0x3c72c9={},_0x25dece={'count':0x0,'rows':[]};var _0x44876a=_[_0x6ce2('0x2b')](db[_0x6ce2('0x2c')][_0x6ce2('0x2d')],function(_0x258b4a){return{'name':_0x258b4a[_0x6ce2('0x2e')],'type':_0x258b4a[_0x6ce2('0x2f')]['key']};});_0x3c72c9['model']=_[_0x6ce2('0x2b')](_0x44876a,_0x6ce2('0x30'));_0x3c72c9[_0x6ce2('0x31')]=_[_0x6ce2('0x32')](_0x534f67[_0x6ce2('0x31')]);_0x3c72c9[_0x6ce2('0x33')]=_[_0x6ce2('0x34')](_0x3c72c9[_0x6ce2('0x35')],_0x3c72c9['query']);_0x596979[_0x6ce2('0x36')]=_['intersection'](_0x3c72c9[_0x6ce2('0x35')],qs[_0x6ce2('0x37')](_0x534f67[_0x6ce2('0x31')]['fields']));_0x596979[_0x6ce2('0x36')]=_0x596979['attributes'][_0x6ce2('0x38')]?_0x596979['attributes']:_0x3c72c9[_0x6ce2('0x35')];if(!_0x534f67['query'][_0x6ce2('0x39')](_0x6ce2('0x3a'))){_0x596979['limit']=qs[_0x6ce2('0x1f')](_0x534f67['query'][_0x6ce2('0x1f')]);_0x596979['offset']=qs['offset'](_0x534f67[_0x6ce2('0x31')][_0x6ce2('0x1e')]);}_0x596979['order']=qs[_0x6ce2('0x3b')](_0x534f67['query'][_0x6ce2('0x3b')]);_0x596979[_0x6ce2('0x3c')]=qs['filters'](_[_0x6ce2('0x3d')](_0x534f67[_0x6ce2('0x31')],_0x3c72c9[_0x6ce2('0x33')]),_0x44876a);if(_0x534f67[_0x6ce2('0x31')][_0x6ce2('0x3e')]){_0x596979['where']=_[_0x6ce2('0x3f')](_0x596979[_0x6ce2('0x3c')],{'$or':_[_0x6ce2('0x2b')](_0x44876a,function(_0x5aa2a4){if(_0x5aa2a4[_0x6ce2('0x2f')]!==_0x6ce2('0x40')){var _0xd9daa7={};_0xd9daa7[_0x5aa2a4[_0x6ce2('0x30')]]={'$like':'%'+_0x534f67['query']['filter']+'%'};return _0xd9daa7;}})});}_0x596979=_[_0x6ce2('0x3f')]({},_0x596979,_0x534f67['options']);var _0x5357d1={'where':_0x596979[_0x6ce2('0x3c')]};return db[_0x6ce2('0x2c')][_0x6ce2('0x20')](_0x5357d1)[_0x6ce2('0x27')](function(_0x351eb1){_0x25dece[_0x6ce2('0x20')]=_0x351eb1;if(_0x534f67[_0x6ce2('0x31')][_0x6ce2('0x41')]){_0x596979[_0x6ce2('0x42')]=[{'all':!![]}];}return db[_0x6ce2('0x2c')]['findAll'](_0x596979);})['then'](function(_0x570943){_0x25dece[_0x6ce2('0x43')]=_0x570943;return _0x25dece;})[_0x6ce2('0x27')](respondWithFilteredResult(_0x16ca7c,_0x596979))['catch'](handleError(_0x16ca7c,null));};exports[_0x6ce2('0x44')]=function(_0x452b8a,_0x5228e3){var _0x287cde={'raw':![],'where':{'id':_0x452b8a[_0x6ce2('0x45')]['id']}},_0x3b4f66={};_0x3b4f66['model']=_[_0x6ce2('0x32')](db[_0x6ce2('0x2c')][_0x6ce2('0x2d')]);_0x3b4f66[_0x6ce2('0x31')]=_[_0x6ce2('0x32')](_0x452b8a[_0x6ce2('0x31')]);_0x3b4f66[_0x6ce2('0x33')]=_[_0x6ce2('0x34')](_0x3b4f66[_0x6ce2('0x35')],_0x3b4f66[_0x6ce2('0x31')]);_0x287cde['attributes']=_[_0x6ce2('0x34')](_0x3b4f66[_0x6ce2('0x35')],qs[_0x6ce2('0x37')](_0x452b8a['query'][_0x6ce2('0x37')]));_0x287cde['attributes']=_0x287cde[_0x6ce2('0x36')][_0x6ce2('0x38')]?_0x287cde[_0x6ce2('0x36')]:_0x3b4f66[_0x6ce2('0x35')];if(_0x452b8a[_0x6ce2('0x31')][_0x6ce2('0x41')]){_0x287cde['include']=[{'all':!![]}];}_0x287cde=_[_0x6ce2('0x3f')]({},_0x287cde,_0x452b8a['options']);return db[_0x6ce2('0x2c')][_0x6ce2('0x46')](_0x287cde)[_0x6ce2('0x27')](handleEntityNotFound(_0x5228e3,null))[_0x6ce2('0x27')](respondWithResult(_0x5228e3,null))[_0x6ce2('0x47')](handleError(_0x5228e3,null));};exports[_0x6ce2('0x48')]=function(_0x5559b3,_0x58b7c0){return db[_0x6ce2('0x2c')][_0x6ce2('0x48')](_0x5559b3[_0x6ce2('0x49')],{})[_0x6ce2('0x27')](respondWithResult(_0x58b7c0,0xc9))[_0x6ce2('0x47')](handleError(_0x58b7c0,null));};exports[_0x6ce2('0x25')]=function(_0x3e1f94,_0x38c413){if(_0x3e1f94[_0x6ce2('0x49')]['id']){delete _0x3e1f94[_0x6ce2('0x49')]['id'];}return db['ZohoAccount'][_0x6ce2('0x46')]({'where':{'id':_0x3e1f94['params']['id']}})[_0x6ce2('0x27')](handleEntityNotFound(_0x38c413,null))[_0x6ce2('0x27')](saveUpdates(_0x3e1f94[_0x6ce2('0x49')],null))['then'](respondWithResult(_0x38c413,null))['catch'](handleError(_0x38c413,null));};exports[_0x6ce2('0x26')]=function(_0x2b5d87,_0x1a29e2){return db[_0x6ce2('0x2c')][_0x6ce2('0x46')]({'where':{'id':_0x2b5d87['params']['id']}})[_0x6ce2('0x27')](handleEntityNotFound(_0x1a29e2,null))[_0x6ce2('0x27')](removeEntity(_0x1a29e2,null))[_0x6ce2('0x47')](handleError(_0x1a29e2,null));};exports['getConfigurations']=function(_0x2fe9c9,_0x985d01,_0x596671){var _0x4cd010={};var _0x3ed950={};var _0x574a06;var _0x446753;return db['ZohoAccount'][_0x6ce2('0x4a')]({'where':{'id':_0x2fe9c9[_0x6ce2('0x45')]['id']}})[_0x6ce2('0x27')](handleEntityNotFound(_0x985d01,null))[_0x6ce2('0x27')](function(_0x4b23de){if(_0x4b23de){_0x574a06=_0x4b23de;_0x3ed950[_0x6ce2('0x35')]=_[_0x6ce2('0x32')](db[_0x6ce2('0x4b')][_0x6ce2('0x2d')]);_0x3ed950[_0x6ce2('0x31')]=_[_0x6ce2('0x32')](_0x2fe9c9[_0x6ce2('0x31')]);_0x3ed950['filters']=_[_0x6ce2('0x34')](_0x3ed950[_0x6ce2('0x35')],_0x3ed950['query']);_0x4cd010[_0x6ce2('0x36')]=_[_0x6ce2('0x34')](_0x3ed950['model'],qs[_0x6ce2('0x37')](_0x2fe9c9[_0x6ce2('0x31')][_0x6ce2('0x37')]));_0x4cd010['attributes']=_0x4cd010['attributes'][_0x6ce2('0x38')]?_0x4cd010[_0x6ce2('0x36')]:_0x3ed950[_0x6ce2('0x35')];_0x4cd010['order']=qs['sort'](_0x2fe9c9[_0x6ce2('0x31')][_0x6ce2('0x3b')]);_0x4cd010[_0x6ce2('0x3c')]=qs['filters'](_[_0x6ce2('0x3d')](_0x2fe9c9[_0x6ce2('0x31')],_0x3ed950[_0x6ce2('0x33')]));if(_0x2fe9c9[_0x6ce2('0x31')][_0x6ce2('0x3e')]){_0x4cd010[_0x6ce2('0x3c')]=_['merge'](_0x4cd010['where'],{'$or':_[_0x6ce2('0x2b')](_0x4cd010['attributes'],function(_0x216389){var _0x6fb4eb={};_0x6fb4eb[_0x216389]={'$like':'%'+_0x2fe9c9['query']['filter']+'%'};return _0x6fb4eb;})});}_0x4cd010=_[_0x6ce2('0x3f')]({},_0x4cd010,_0x2fe9c9[_0x6ce2('0x4c')]);return _0x574a06[_0x6ce2('0x4d')](_0x4cd010);}})[_0x6ce2('0x27')](function(_0x51f103){if(_0x51f103){_0x446753=_0x51f103[_0x6ce2('0x38')];if(!_0x2fe9c9[_0x6ce2('0x31')][_0x6ce2('0x39')](_0x6ce2('0x3a'))){_0x4cd010[_0x6ce2('0x1f')]=qs[_0x6ce2('0x1f')](_0x2fe9c9[_0x6ce2('0x31')][_0x6ce2('0x1f')]);_0x4cd010[_0x6ce2('0x1e')]=qs[_0x6ce2('0x1e')](_0x2fe9c9[_0x6ce2('0x31')][_0x6ce2('0x1e')]);}return _0x574a06['getConfigurations'](_0x4cd010);}})[_0x6ce2('0x27')](function(_0x35d276){if(_0x35d276){return _0x35d276?{'count':_0x446753,'rows':_0x35d276}:null;}})[_0x6ce2('0x27')](respondWithResult(_0x985d01,null))[_0x6ce2('0x47')](handleError(_0x985d01,null));};exports[_0x6ce2('0x4e')]=function(_0x2c587d,_0x7b9ea6,_0x65efd1){if(_0x2c587d[_0x6ce2('0x49')]['id']){delete _0x2c587d[_0x6ce2('0x49')]['id'];}return db[_0x6ce2('0x2c')][_0x6ce2('0x4a')]({'where':{'id':_0x2c587d[_0x6ce2('0x45')]['id']}})[_0x6ce2('0x27')](handleEntityNotFound(_0x7b9ea6,null))[_0x6ce2('0x27')](function(_0x1bfc31){if(_0x1bfc31){_0x2c587d[_0x6ce2('0x49')]['AccountId']=_0x1bfc31['id'];_0x2c587d[_0x6ce2('0x49')][_0x6ce2('0x4f')]=integrations[_0x6ce2('0x50')](_0x2c587d[_0x6ce2('0x49')][_0x6ce2('0x51')],_0x2c587d['body'][_0x6ce2('0x2f')]);_0x2c587d[_0x6ce2('0x49')]['Descriptions']=integrations['getDescriptions'](_0x2c587d[_0x6ce2('0x49')][_0x6ce2('0x51')],_0x2c587d[_0x6ce2('0x49')][_0x6ce2('0x2f')]);return db[_0x6ce2('0x4b')]['create'](_0x2c587d[_0x6ce2('0x49')],{'include':[{'model':db[_0x6ce2('0x52')],'as':_0x6ce2('0x4f')},{'model':db[_0x6ce2('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x7b9ea6,null))['catch'](handleError(_0x7b9ea6,null));};function getAccessToken(_0x816f6){return new Promise(function(_0x41f819,_0xf41378){var _0x3170f0;switch(_0x816f6[_0x6ce2('0x53')]){case'US':_0x3170f0=_0x6ce2('0x54');break;case'AU':_0x3170f0='https://accounts.zoho.com.au';break;case'EU':_0x3170f0='https://accounts.zoho.eu';break;case'IN':_0x3170f0=_0x6ce2('0x55');break;case'CN':_0x3170f0='https://accounts.zoho.com.cn';break;default:_0x3170f0='https://accounts.zoho.eu';break;}var _0x1fda7b={'method':_0x6ce2('0x56'),'uri':_0x3170f0+_0x6ce2('0x57'),'qs':{'refresh_token':_0x816f6[_0x6ce2('0x58')],'client_id':_0x816f6[_0x6ce2('0x59')],'client_secret':_0x816f6[_0x6ce2('0x5a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1fda7b)[_0x6ce2('0x27')](function(_0x873e9e){if(_0x873e9e[_0x6ce2('0x5b')]){_0x41f819(_0x873e9e[_0x6ce2('0x5b')]);}else{_0xf41378('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x6ce2('0x47')](function(_0x1f82f7){_0xf41378(_0x1f82f7);});});}exports[_0x6ce2('0x5c')]=function(_0x336ea0,_0x129f80,_0x51e3f2){var _0x551758,_0x39e1bf,_0xc97ef8,_0x19623b,_0xd8f898;return db[_0x6ce2('0x2c')][_0x6ce2('0x4a')]({'where':{'id':_0x336ea0[_0x6ce2('0x45')]['id']},'attributes':['id','host',_0x6ce2('0x53'),_0x6ce2('0x59'),_0x6ce2('0x5a'),'serverUrl',_0x6ce2('0x5d'),'refreshToken']})[_0x6ce2('0x27')](handleEntityNotFound(_0x129f80,null))[_0x6ce2('0x27')](function(_0x588103){_0xd8f898=_0x588103;_0x551758=_0xd8f898[_0x6ce2('0x5e')];_0x39e1bf=_0x551758===_0x6ce2('0x5f')?'eu':_0x6ce2('0x60');_0xc97ef8=_0xd8f898['serverUrl'];var _0x29f888=_0xc97ef8[_0x6ce2('0x61')](-0x1);if(_0x29f888==='/'||_0x29f888==='\x5c'||_0x29f888===':'){_0xc97ef8=_0xc97ef8[_0x6ce2('0x62')](0x0,_0xc97ef8[_0x6ce2('0x63')](_0x29f888));}if(!_0xd8f898[_0x6ce2('0x58')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xd8f898);})[_0x6ce2('0x27')](function(_0x2a129a){if(_0x2a129a){return rp({'method':_0x6ce2('0x64'),'uri':util[_0x6ce2('0x65')](_0x6ce2('0x66'),_0x39e1bf),'qs':{'module':_0x6ce2('0x67')},'headers':{'Authorization':_0x6ce2('0x68')+_0x2a129a},'json':!![]});}})[_0x6ce2('0x27')](function(_0x331000){if(_0x331000){if(_0x331000[_0x6ce2('0x69')]&&_0x331000[_0x6ce2('0x69')]['error']){throw new Error(_0x331000['response'][_0x6ce2('0x6a')][_0x6ce2('0x6b')]);}var _0x17fc66=[];var _0x44d831=[];var _0x2dfbfc=[_0x6ce2('0x6c'),_0x6ce2('0x6d'),_0x6ce2('0x6e'),_0x6ce2('0x6f'),_0x6ce2('0x70'),_0x6ce2('0x71'),_0x6ce2('0x72'),'Call_Type'];_0x44d831=_[_0x6ce2('0x73')](_0x331000[_0x6ce2('0x37')],function(_0x42aefe){return _0x2dfbfc[_0x6ce2('0x74')](_0x42aefe[_0x6ce2('0x75')]);});for(var _0x458a5c=0x0;_0x458a5c<_0x44d831[_0x6ce2('0x38')];_0x458a5c++){if(_0x44d831[_0x458a5c][_0x6ce2('0x76')]===![]){_0x17fc66[_0x6ce2('0x77')]({'id':_0x44d831[_0x458a5c]['id'],'name':_0x44d831[_0x458a5c][_0x6ce2('0x78')],'custom':_0x44d831[_0x458a5c][_0x6ce2('0x79')],'options':_0x44d831[_0x458a5c][_0x6ce2('0x7a')]==='picklist'&&_0x44d831[_0x458a5c][_0x6ce2('0x7b')][_0x6ce2('0x38')]>-0x1?_['map'](_0x44d831[_0x458a5c][_0x6ce2('0x7b')],function(_0x14630a){return{'name':_0x14630a,'value':_0x14630a};}):[]});}}return{'count':_0x17fc66[_0x6ce2('0x38')],'rows':_0x17fc66};}else{return{'count':0x0,'rows':[]};}})[_0x6ce2('0x27')](respondWithResult(_0x129f80,null))[_0x6ce2('0x47')](function(_0x22a3f7){var _0xd5338d=_0x336ea0[_0x6ce2('0x31')][_0x6ce2('0x7c')]?0x1f4:_0x22a3f7[_0x6ce2('0x7d')]||0x1f4;logger[_0x6ce2('0x6a')](_0x6ce2('0x7e'),_0x6ce2('0x5c'),_0xd5338d,JSON[_0x6ce2('0x7f')](_0x22a3f7));delete _0x22a3f7[_0x6ce2('0x30')];if(_0xd5338d===0x191){_0xd5338d=0x190;}_0x129f80[_0x6ce2('0x1c')](_0xd5338d)[_0x6ce2('0x29')](_0x336ea0[_0x6ce2('0x31')][_0x6ce2('0x7c')]?{'message':_0x6ce2('0x80'),'statusCode':_0x22a3f7[_0x6ce2('0x7d')]}:_0x22a3f7);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 39f5b06..2513a84 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 _0x5fa1=['path','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','serverUrl','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','error','inspect','host','https://accounts.zoho.com','POST','then','format','lodash','util','api','bluebird','request-promise'];(function(_0x17f993,_0x139c73){var _0x4784fb=function(_0x11b0cc){while(--_0x11b0cc){_0x17f993['push'](_0x17f993['shift']());}};_0x4784fb(++_0x139c73);}(_0x5fa1,0xd2));var _0x15fa=function(_0x3bec3c,_0x4fbd9b){_0x3bec3c=_0x3bec3c-0x0;var _0x38b63e=_0x5fa1[_0x3bec3c];return _0x38b63e;};'use strict';var _=require(_0x15fa('0x0'));var util=require(_0x15fa('0x1'));var logger=require('../../config/logger')(_0x15fa('0x2'));var moment=require('moment');var BPromise=require(_0x15fa('0x3'));var rp=require(_0x15fa('0x4'));var fs=require('fs');var path=require(_0x15fa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x15fa('0x6'));var integrations=require(_0x15fa('0x7'));module[_0x15fa('0x8')]=function(_0x43870f,_0x5eba46){return _0x43870f[_0x15fa('0x9')](_0x15fa('0xa'),attributes,{'tableName':_0x15fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x557013,_0xa2d547,_0x3a8e1d){if(_0x557013['changed'](_0x15fa('0xc'))||_0x557013['changed']('serverUrl')||_0x557013[_0x15fa('0xd')](_0x15fa('0xe'))||_0x557013[_0x15fa('0xd')](_0x15fa('0xf'))||_0x557013[_0x15fa('0xd')](_0x15fa('0x10'))||_0x557013[_0x15fa('0xd')]('host')){var _0x2293bb,_0x488e1a;_0x2293bb=_0x557013['serverUrl'];var _0x403a32=_0x2293bb[_0x15fa('0x11')](-0x1);if(_0x403a32==='/'||_0x403a32==='\x5c'||_0x403a32===':'){_0x2293bb=_0x2293bb[_0x15fa('0x12')](0x0,_0x2293bb[_0x15fa('0x13')](_0x403a32));}switch(_0x557013['zone']){case'US':_0x488e1a='https://accounts.zoho.com';break;case'AU':_0x488e1a=_0x15fa('0x14');break;case'IN':_0x488e1a=_0x15fa('0x15');break;case'CN':_0x488e1a=_0x15fa('0x16');break;default:_0x488e1a=_0x15fa('0x17');break;}var _0x52ffda={'method':'POST','uri':_0x488e1a+_0x15fa('0x18'),'form':{'grant_type':_0x15fa('0x19'),'client_id':_0x557013[_0x15fa('0xe')],'client_secret':_0x557013['clientSecret'],'redirect_uri':_0x557013[_0x15fa('0x1a')],'code':_0x557013['code']},'headers':{'Content-Type':_0x15fa('0x1b')}};return rp(_0x52ffda)['then'](function(_0x52a8b8){var _0x142a13=JSON[_0x15fa('0x1c')](_0x52a8b8);if(_0x142a13[_0x15fa('0x1d')]){_0x557013[_0x15fa('0x1e')]=_0x142a13['refresh_token'];logger[_0x15fa('0x1f')](util['format'](_0x15fa('0x20'),_0x557013['name'],_0x557013['id']));}else{logger['error'](util['format'](_0x15fa('0x21'),_0x557013[_0x15fa('0x22')],_0x557013['id']),util['inspect'](_0x142a13,{'showHidden':![],'depth':null}));}return _0x3a8e1d(null,_0xa2d547);})[_0x15fa('0x23')](function(_0x1e33eb){logger[_0x15fa('0x24')](util['format'](_0x15fa('0x21'),_0x557013[_0x15fa('0x22')],_0x557013['id']),util[_0x15fa('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x3a8e1d(_0x1e33eb);});}else{return _0x3a8e1d(null,_0xa2d547);}},'beforeUpdate':function(_0x46dd2d,_0x545757,_0x47c965){if(_0x46dd2d[_0x15fa('0xd')](_0x15fa('0xc'))||_0x46dd2d[_0x15fa('0xd')](_0x15fa('0x1a'))||_0x46dd2d['changed']('clientId')||_0x46dd2d[_0x15fa('0xd')]('clientSecret')||_0x46dd2d['changed']('code')||_0x46dd2d[_0x15fa('0xd')](_0x15fa('0x26'))){var _0x4385c8,_0xb5a4c8;_0x4385c8=_0x46dd2d[_0x15fa('0x1a')];var _0x5618ee=_0x4385c8[_0x15fa('0x11')](-0x1);if(_0x5618ee==='/'||_0x5618ee==='\x5c'||_0x5618ee===':'){_0x4385c8=_0x4385c8['substring'](0x0,_0x4385c8['lastIndexOf'](_0x5618ee));}switch(_0x46dd2d['zone']){case'US':_0xb5a4c8=_0x15fa('0x27');break;case'AU':_0xb5a4c8=_0x15fa('0x14');break;case'IN':_0xb5a4c8=_0x15fa('0x15');break;case'CN':_0xb5a4c8=_0x15fa('0x16');break;default:_0xb5a4c8=_0x15fa('0x17');break;}var _0x54aef9={'method':_0x15fa('0x28'),'uri':_0xb5a4c8+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x46dd2d[_0x15fa('0xe')],'client_secret':_0x46dd2d['clientSecret'],'redirect_uri':_0x46dd2d['serverUrl'],'code':_0x46dd2d[_0x15fa('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x54aef9)[_0x15fa('0x29')](function(_0x464473){var _0x399493=JSON[_0x15fa('0x1c')](_0x464473);if(_0x399493[_0x15fa('0x1d')]){_0x46dd2d[_0x15fa('0x1e')]=_0x399493[_0x15fa('0x1d')];logger['info'](util[_0x15fa('0x2a')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x46dd2d[_0x15fa('0x22')],_0x46dd2d['id']));}else{logger[_0x15fa('0x24')](util[_0x15fa('0x2a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x46dd2d[_0x15fa('0x22')],_0x46dd2d['id']),util[_0x15fa('0x25')](_0x399493,{'showHidden':![],'depth':null}));}return _0x47c965(null,_0x545757);})[_0x15fa('0x23')](function(_0x2598bb){logger[_0x15fa('0x24')](util[_0x15fa('0x2a')](_0x15fa('0x21'),_0x46dd2d[_0x15fa('0x22')],_0x46dd2d['id']),util[_0x15fa('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x47c965(_0x2598bb);});}else{return _0x47c965(null,_0x545757);}}}});}; \ No newline at end of file +var _0x8a87=['../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','clientId','code','host','serverUrl','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','slice','substring','POST','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x130728,_0x1381a0){var _0x413c3d=function(_0x5c234f){while(--_0x5c234f){_0x130728['push'](_0x130728['shift']());}};_0x413c3d(++_0x1381a0);}(_0x8a87,0xa5));var _0x78a8=function(_0xd8a959,_0x169203){_0xd8a959=_0xd8a959-0x0;var _0x536e01=_0x8a87[_0xd8a959];return _0x536e01;};'use strict';var _=require(_0x78a8('0x0'));var util=require('util');var logger=require(_0x78a8('0x1'))(_0x78a8('0x2'));var moment=require('moment');var BPromise=require(_0x78a8('0x3'));var rp=require(_0x78a8('0x4'));var fs=require('fs');var path=require(_0x78a8('0x5'));var rimraf=require(_0x78a8('0x6'));var config=require(_0x78a8('0x7'));var attributes=require(_0x78a8('0x8'));var integrations=require(_0x78a8('0x9'));module[_0x78a8('0xa')]=function(_0x1a1650,_0x31591c){return _0x1a1650[_0x78a8('0xb')](_0x78a8('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x30943c,_0x10f390,_0x2df6cd){if(_0x30943c[_0x78a8('0xd')](_0x78a8('0xe'))||_0x30943c[_0x78a8('0xd')]('serverUrl')||_0x30943c['changed'](_0x78a8('0xf'))||_0x30943c[_0x78a8('0xd')]('clientSecret')||_0x30943c[_0x78a8('0xd')](_0x78a8('0x10'))||_0x30943c[_0x78a8('0xd')](_0x78a8('0x11'))){var _0x5cba83,_0x687439;_0x5cba83=_0x30943c[_0x78a8('0x12')];var _0x575f48=_0x5cba83['slice'](-0x1);if(_0x575f48==='/'||_0x575f48==='\x5c'||_0x575f48===':'){_0x5cba83=_0x5cba83['substring'](0x0,_0x5cba83[_0x78a8('0x13')](_0x575f48));}switch(_0x30943c[_0x78a8('0xe')]){case'US':_0x687439=_0x78a8('0x14');break;case'AU':_0x687439=_0x78a8('0x15');break;case'IN':_0x687439=_0x78a8('0x16');break;case'CN':_0x687439=_0x78a8('0x17');break;default:_0x687439=_0x78a8('0x18');break;}var _0x269810={'method':'POST','uri':_0x687439+_0x78a8('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x30943c[_0x78a8('0xf')],'client_secret':_0x30943c[_0x78a8('0x1a')],'redirect_uri':_0x30943c[_0x78a8('0x12')],'code':_0x30943c['code']},'headers':{'Content-Type':_0x78a8('0x1b')}};return rp(_0x269810)[_0x78a8('0x1c')](function(_0x1ab558){var _0x241d94=JSON[_0x78a8('0x1d')](_0x1ab558);if(_0x241d94[_0x78a8('0x1e')]){_0x30943c[_0x78a8('0x1f')]=_0x241d94[_0x78a8('0x1e')];logger[_0x78a8('0x20')](util[_0x78a8('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x30943c['name'],_0x30943c['id']));}else{logger['error'](util[_0x78a8('0x21')](_0x78a8('0x22'),_0x30943c[_0x78a8('0x23')],_0x30943c['id']),util[_0x78a8('0x24')](_0x241d94,{'showHidden':![],'depth':null}));}return _0x2df6cd(null,_0x10f390);})[_0x78a8('0x25')](function(_0x2f1d15){logger[_0x78a8('0x26')](util[_0x78a8('0x21')](_0x78a8('0x22'),_0x30943c[_0x78a8('0x23')],_0x30943c['id']),util[_0x78a8('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x2df6cd(_0x2f1d15);});}else{return _0x2df6cd(null,_0x10f390);}},'beforeUpdate':function(_0x126fe1,_0x53cedb,_0x125ea4){if(_0x126fe1[_0x78a8('0xd')](_0x78a8('0xe'))||_0x126fe1[_0x78a8('0xd')](_0x78a8('0x12'))||_0x126fe1[_0x78a8('0xd')](_0x78a8('0xf'))||_0x126fe1[_0x78a8('0xd')](_0x78a8('0x1a'))||_0x126fe1['changed']('code')||_0x126fe1[_0x78a8('0xd')]('host')){var _0x553d05,_0x248a75;_0x553d05=_0x126fe1[_0x78a8('0x12')];var _0x179d0d=_0x553d05[_0x78a8('0x27')](-0x1);if(_0x179d0d==='/'||_0x179d0d==='\x5c'||_0x179d0d===':'){_0x553d05=_0x553d05[_0x78a8('0x28')](0x0,_0x553d05[_0x78a8('0x13')](_0x179d0d));}switch(_0x126fe1[_0x78a8('0xe')]){case'US':_0x248a75=_0x78a8('0x14');break;case'AU':_0x248a75='https://accounts.zoho.com.au';break;case'IN':_0x248a75=_0x78a8('0x16');break;case'CN':_0x248a75=_0x78a8('0x17');break;default:_0x248a75=_0x78a8('0x18');break;}var _0x514586={'method':_0x78a8('0x29'),'uri':_0x248a75+_0x78a8('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x126fe1[_0x78a8('0xf')],'client_secret':_0x126fe1['clientSecret'],'redirect_uri':_0x126fe1[_0x78a8('0x12')],'code':_0x126fe1[_0x78a8('0x10')]},'headers':{'Content-Type':_0x78a8('0x1b')}};return rp(_0x514586)['then'](function(_0x3929fe){var _0x58ef2b=JSON[_0x78a8('0x1d')](_0x3929fe);if(_0x58ef2b[_0x78a8('0x1e')]){_0x126fe1['refreshToken']=_0x58ef2b['refresh_token'];logger[_0x78a8('0x20')](util['format'](_0x78a8('0x2a'),_0x126fe1['name'],_0x126fe1['id']));}else{logger[_0x78a8('0x26')](util[_0x78a8('0x21')](_0x78a8('0x22'),_0x126fe1['name'],_0x126fe1['id']),util[_0x78a8('0x24')](_0x58ef2b,{'showHidden':![],'depth':null}));}return _0x125ea4(null,_0x53cedb);})[_0x78a8('0x25')](function(_0x1b9543){logger['error'](util[_0x78a8('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x126fe1[_0x78a8('0x23')],_0x126fe1['id']),util[_0x78a8('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x125ea4(_0x1b9543);});}else{return _0x125ea4(null,_0x53cedb);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 1f3e3cb..e00a44d 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 _0xdf5d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','attributes','limit','include','model','map','debug','where','ShowZohoAccount','lodash','util'];(function(_0x537f6f,_0x10b756){var _0x212d3f=function(_0x22f172){while(--_0x22f172){_0x537f6f['push'](_0x537f6f['shift']());}};_0x212d3f(++_0x10b756);}(_0xdf5d,0x126));var _0xddf5=function(_0x11c3dd,_0x63b372){_0x11c3dd=_0x11c3dd-0x0;var _0x118cb2=_0xdf5d[_0x11c3dd];return _0x118cb2;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var moment=require(_0xddf5('0x2'));var BPromise=require(_0xddf5('0x3'));var rs=require(_0xddf5('0x4'));var fs=require('fs');var Redis=require(_0xddf5('0x5'));var db=require(_0xddf5('0x6'))['db'];var utils=require(_0xddf5('0x7'));var logger=require('../../config/logger')(_0xddf5('0x8'));var config=require(_0xddf5('0x9'));var jayson=require(_0xddf5('0xa'));var client=jayson[_0xddf5('0xb')][_0xddf5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x228fd4,_0xf3a209,_0xa029d2){return new BPromise(function(_0x3a1e13,_0x3df89){return client[_0xddf5('0xd')](_0x228fd4,_0xa029d2)[_0xddf5('0xe')](function(_0x36b306){logger[_0xddf5('0xf')](_0xddf5('0x10'),_0xf3a209,_0xddf5('0x11'));logger['debug'](_0xddf5('0x12'),_0xf3a209,_0xddf5('0x11'),JSON[_0xddf5('0x13')](_0x36b306));if(_0x36b306[_0xddf5('0x14')]){if(_0x36b306[_0xddf5('0x14')][_0xddf5('0x15')]===0x1f4){logger[_0xddf5('0x14')](_0xddf5('0x10'),_0xf3a209,_0x36b306['error']['message']);return _0x3df89(_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);}logger[_0xddf5('0x14')](_0xddf5('0x10'),_0xf3a209,_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);return _0x3a1e13(_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);}else{logger['info'](_0xddf5('0x10'),_0xf3a209,_0xddf5('0x11'));_0x3a1e13(_0x36b306[_0xddf5('0x17')][_0xddf5('0x16')]);}})[_0xddf5('0x18')](function(_0x5ef952){logger[_0xddf5('0x14')]('ZohoAccount,\x20%s,\x20%s',_0xf3a209,_0x5ef952);_0x3df89(_0x5ef952);});});}exports[_0xddf5('0x19')]=function(_0x50c1ed){var _0x4b4f9a=this;return new Promise(function(_0x3d61df,_0x44db09){return db[_0xddf5('0x1a')]['findAll']({'raw':_0x50c1ed['options']?_0x50c1ed[_0xddf5('0x1b')][_0xddf5('0x1c')]===undefined?!![]:![]:!![],'where':_0x50c1ed[_0xddf5('0x1b')]?_0x50c1ed[_0xddf5('0x1b')]['where']||null:null,'attributes':_0x50c1ed['options']?_0x50c1ed[_0xddf5('0x1b')][_0xddf5('0x1d')]||null:null,'limit':_0x50c1ed[_0xddf5('0x1b')]?_0x50c1ed['options'][_0xddf5('0x1e')]||null:null,'include':_0x50c1ed[_0xddf5('0x1b')]?_0x50c1ed[_0xddf5('0x1b')][_0xddf5('0x1f')]?_['map'](_0x50c1ed[_0xddf5('0x1b')][_0xddf5('0x1f')],function(_0x496e16){return{'model':db[_0x496e16[_0xddf5('0x20')]],'as':_0x496e16['as'],'attributes':_0x496e16[_0xddf5('0x1d')],'include':_0x496e16[_0xddf5('0x1f')]?_[_0xddf5('0x21')](_0x496e16['include'],function(_0x497382){return{'model':db[_0x497382[_0xddf5('0x20')]],'as':_0x497382['as'],'attributes':_0x497382[_0xddf5('0x1d')],'include':_0x497382[_0xddf5('0x1f')]?_[_0xddf5('0x21')](_0x497382['include'],function(_0x2caa8f){return{'model':db[_0x2caa8f[_0xddf5('0x20')]],'as':_0x2caa8f['as'],'attributes':_0x2caa8f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x984d22){logger[_0xddf5('0xf')](_0xddf5('0x19'),_0x50c1ed);logger[_0xddf5('0x22')](_0xddf5('0x19'),_0x50c1ed,JSON[_0xddf5('0x13')](_0x984d22));_0x3d61df(_0x984d22);})['catch'](function(_0x26f43c){logger[_0xddf5('0x14')]('GetZohoAccount',_0x26f43c[_0xddf5('0x16')],_0x50c1ed);_0x44db09(_0x4b4f9a[_0xddf5('0x14')](0x1f4,_0x26f43c[_0xddf5('0x16')]));});});};exports['ShowZohoAccount']=function(_0x4b352b){var _0x4d1632=this;return new Promise(function(_0xdc764b,_0x25e11e){return db[_0xddf5('0x1a')]['find']({'raw':_0x4b352b[_0xddf5('0x1b')]?_0x4b352b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b352b['options']?_0x4b352b[_0xddf5('0x1b')][_0xddf5('0x23')]||null:null,'attributes':_0x4b352b[_0xddf5('0x1b')]?_0x4b352b[_0xddf5('0x1b')][_0xddf5('0x1d')]||null:null,'include':_0x4b352b['options']?_0x4b352b[_0xddf5('0x1b')]['include']?_[_0xddf5('0x21')](_0x4b352b[_0xddf5('0x1b')]['include'],function(_0xf355f4){return{'model':db[_0xf355f4[_0xddf5('0x20')]],'as':_0xf355f4['as'],'attributes':_0xf355f4[_0xddf5('0x1d')],'include':_0xf355f4[_0xddf5('0x1f')]?_[_0xddf5('0x21')](_0xf355f4['include'],function(_0x873d16){return{'model':db[_0x873d16['model']],'as':_0x873d16['as'],'attributes':_0x873d16[_0xddf5('0x1d')],'include':_0x873d16[_0xddf5('0x1f')]?_['map'](_0x873d16[_0xddf5('0x1f')],function(_0x5bf8f2){return{'model':db[_0x5bf8f2[_0xddf5('0x20')]],'as':_0x5bf8f2['as'],'attributes':_0x5bf8f2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b4cde){logger['info'](_0xddf5('0x24'),_0x4b352b);logger[_0xddf5('0x22')](_0xddf5('0x24'),_0x4b352b,JSON[_0xddf5('0x13')](_0x1b4cde));_0xdc764b(_0x1b4cde);})[_0xddf5('0x18')](function(_0x3ff650){logger[_0xddf5('0x14')](_0xddf5('0x24'),_0x3ff650[_0xddf5('0x16')],_0x4b352b);_0x25e11e(_0x4d1632[_0xddf5('0x14')](0x1f4,_0x3ff650[_0xddf5('0x16')]));});});}; \ No newline at end of file +var _0xf9e5=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZohoAccount','findAll','options','raw','where','attributes','model','map','include','then','ShowZohoAccount','ZohoAccount'];(function(_0x43f359,_0x44e68f){var _0x298579=function(_0x448f3d){while(--_0x448f3d){_0x43f359['push'](_0x43f359['shift']());}};_0x298579(++_0x44e68f);}(_0xf9e5,0x89));var _0x5f9e=function(_0x3f284e,_0x239b7d){_0x3f284e=_0x3f284e-0x0;var _0x55f4ae=_0xf9e5[_0x3f284e];return _0x55f4ae;};'use strict';var _=require(_0x5f9e('0x0'));var util=require(_0x5f9e('0x1'));var moment=require(_0x5f9e('0x2'));var BPromise=require(_0x5f9e('0x3'));var rs=require(_0x5f9e('0x4'));var fs=require('fs');var Redis=require(_0x5f9e('0x5'));var db=require(_0x5f9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f9e('0x7'))(_0x5f9e('0x8'));var config=require('../../config/environment');var jayson=require(_0x5f9e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8bb75c,_0x35fcc8,_0x4ee331){return new BPromise(function(_0x13de1c,_0x3cebf5){return client['request'](_0x8bb75c,_0x4ee331)['then'](function(_0x549a00){logger[_0x5f9e('0xa')](_0x5f9e('0xb'),_0x35fcc8,'request\x20sent');logger[_0x5f9e('0xc')](_0x5f9e('0xd'),_0x35fcc8,_0x5f9e('0xe'),JSON[_0x5f9e('0xf')](_0x549a00));if(_0x549a00[_0x5f9e('0x10')]){if(_0x549a00['error'][_0x5f9e('0x11')]===0x1f4){logger[_0x5f9e('0x10')](_0x5f9e('0xb'),_0x35fcc8,_0x549a00[_0x5f9e('0x10')]['message']);return _0x3cebf5(_0x549a00[_0x5f9e('0x10')][_0x5f9e('0x12')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x35fcc8,_0x549a00[_0x5f9e('0x10')][_0x5f9e('0x12')]);return _0x13de1c(_0x549a00[_0x5f9e('0x10')]['message']);}else{logger[_0x5f9e('0xa')](_0x5f9e('0xb'),_0x35fcc8,_0x5f9e('0xe'));_0x13de1c(_0x549a00[_0x5f9e('0x13')]['message']);}})[_0x5f9e('0x14')](function(_0x293fe2){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x35fcc8,_0x293fe2);_0x3cebf5(_0x293fe2);});});}exports[_0x5f9e('0x15')]=function(_0x5891a2){var _0x5d3588=this;return new Promise(function(_0x1a81c0,_0x816c4c){return db['ZohoAccount'][_0x5f9e('0x16')]({'raw':_0x5891a2['options']?_0x5891a2[_0x5f9e('0x17')][_0x5f9e('0x18')]===undefined?!![]:![]:!![],'where':_0x5891a2['options']?_0x5891a2[_0x5f9e('0x17')][_0x5f9e('0x19')]||null:null,'attributes':_0x5891a2[_0x5f9e('0x17')]?_0x5891a2[_0x5f9e('0x17')][_0x5f9e('0x1a')]||null:null,'limit':_0x5891a2[_0x5f9e('0x17')]?_0x5891a2[_0x5f9e('0x17')]['limit']||null:null,'include':_0x5891a2[_0x5f9e('0x17')]?_0x5891a2[_0x5f9e('0x17')]['include']?_['map'](_0x5891a2[_0x5f9e('0x17')]['include'],function(_0x346732){return{'model':db[_0x346732[_0x5f9e('0x1b')]],'as':_0x346732['as'],'attributes':_0x346732['attributes'],'include':_0x346732['include']?_['map'](_0x346732['include'],function(_0xb667f9){return{'model':db[_0xb667f9[_0x5f9e('0x1b')]],'as':_0xb667f9['as'],'attributes':_0xb667f9['attributes'],'include':_0xb667f9['include']?_[_0x5f9e('0x1c')](_0xb667f9[_0x5f9e('0x1d')],function(_0x31df5c){return{'model':db[_0x31df5c[_0x5f9e('0x1b')]],'as':_0x31df5c['as'],'attributes':_0x31df5c[_0x5f9e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5f9e('0x1e')](function(_0xfde2d4){logger['info'](_0x5f9e('0x15'),_0x5891a2);logger[_0x5f9e('0xc')](_0x5f9e('0x15'),_0x5891a2,JSON[_0x5f9e('0xf')](_0xfde2d4));_0x1a81c0(_0xfde2d4);})[_0x5f9e('0x14')](function(_0x420525){logger['error']('GetZohoAccount',_0x420525[_0x5f9e('0x12')],_0x5891a2);_0x816c4c(_0x5d3588['error'](0x1f4,_0x420525['message']));});});};exports[_0x5f9e('0x1f')]=function(_0x5a7594){var _0x3325ea=this;return new Promise(function(_0x1d51bf,_0x5d35a5){return db[_0x5f9e('0x20')][_0x5f9e('0x21')]({'raw':_0x5a7594[_0x5f9e('0x17')]?_0x5a7594['options'][_0x5f9e('0x18')]===undefined?!![]:![]:!![],'where':_0x5a7594['options']?_0x5a7594[_0x5f9e('0x17')][_0x5f9e('0x19')]||null:null,'attributes':_0x5a7594['options']?_0x5a7594[_0x5f9e('0x17')][_0x5f9e('0x1a')]||null:null,'include':_0x5a7594[_0x5f9e('0x17')]?_0x5a7594[_0x5f9e('0x17')][_0x5f9e('0x1d')]?_[_0x5f9e('0x1c')](_0x5a7594['options'][_0x5f9e('0x1d')],function(_0x3bab2e){return{'model':db[_0x3bab2e[_0x5f9e('0x1b')]],'as':_0x3bab2e['as'],'attributes':_0x3bab2e[_0x5f9e('0x1a')],'include':_0x3bab2e[_0x5f9e('0x1d')]?_['map'](_0x3bab2e[_0x5f9e('0x1d')],function(_0x3de596){return{'model':db[_0x3de596['model']],'as':_0x3de596['as'],'attributes':_0x3de596[_0x5f9e('0x1a')],'include':_0x3de596[_0x5f9e('0x1d')]?_[_0x5f9e('0x1c')](_0x3de596[_0x5f9e('0x1d')],function(_0xf36fe5){return{'model':db[_0xf36fe5[_0x5f9e('0x1b')]],'as':_0xf36fe5['as'],'attributes':_0xf36fe5['attributes']};}):[]};}):[]};}):[]:[]})[_0x5f9e('0x1e')](function(_0x428955){logger['info'](_0x5f9e('0x1f'),_0x5a7594);logger[_0x5f9e('0xc')](_0x5f9e('0x1f'),_0x5a7594,JSON[_0x5f9e('0xf')](_0x428955));_0x1d51bf(_0x428955);})[_0x5f9e('0x14')](function(_0x52c68a){logger[_0x5f9e('0x10')](_0x5f9e('0x1f'),_0x52c68a[_0x5f9e('0x12')],_0x5a7594);_0x5d35a5(_0x3325ea['error'](0x1f4,_0x52c68a[_0x5f9e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 0a5042d..0caab08 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 _0x85eb=['/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x5d0f03,_0x1bd340){var _0x2ed3f9=function(_0xa35707){while(--_0xa35707){_0x5d0f03['push'](_0x5d0f03['shift']());}};_0x2ed3f9(++_0x1bd340);}(_0x85eb,0xa7));var _0xb85e=function(_0x594f81,_0x3ca069){_0x594f81=_0x594f81-0x0;var _0x31ae51=_0x85eb[_0x594f81];return _0x31ae51;};'use strict';var multer=require(_0xb85e('0x0'));var util=require('util');var path=require(_0xb85e('0x1'));var timeout=require(_0xb85e('0x2'));var express=require('express');var router=express[_0xb85e('0x3')]();var fs_extra=require(_0xb85e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb85e('0x5'));var controller=require(_0xb85e('0x6'));router[_0xb85e('0x7')]('/',auth[_0xb85e('0x8')](),controller[_0xb85e('0x9')]);router['get'](_0xb85e('0xa'),auth[_0xb85e('0x8')](),controller[_0xb85e('0xb')]);router[_0xb85e('0x7')]('/:id/fields',auth[_0xb85e('0x8')](),controller[_0xb85e('0xc')]);router[_0xb85e('0x7')](_0xb85e('0xd'),auth[_0xb85e('0x8')](),controller['getSubjects']);router[_0xb85e('0x7')](_0xb85e('0xe'),auth['isAuthenticated'](),controller[_0xb85e('0xf')]);router['post']('/',auth[_0xb85e('0x8')](),controller[_0xb85e('0x10')]);router[_0xb85e('0x11')](_0xb85e('0xa'),auth[_0xb85e('0x8')](),controller[_0xb85e('0x12')]);router[_0xb85e('0x13')](_0xb85e('0xa'),auth[_0xb85e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x63cb=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x48bc41,_0x5fad44){var _0x325a56=function(_0x300a1d){while(--_0x300a1d){_0x48bc41['push'](_0x48bc41['shift']());}};_0x325a56(++_0x5fad44);}(_0x63cb,0x128));var _0xb63c=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x63cb[_0x2f9467];return _0x39894c;};'use strict';var multer=require(_0xb63c('0x0'));var util=require(_0xb63c('0x1'));var path=require(_0xb63c('0x2'));var timeout=require(_0xb63c('0x3'));var express=require(_0xb63c('0x4'));var router=express['Router']();var fs_extra=require(_0xb63c('0x5'));var auth=require(_0xb63c('0x6'));var interaction=require(_0xb63c('0x7'));var config=require(_0xb63c('0x8'));var controller=require(_0xb63c('0x9'));router[_0xb63c('0xa')]('/',auth[_0xb63c('0xb')](),controller[_0xb63c('0xc')]);router[_0xb63c('0xa')]('/:id',auth[_0xb63c('0xb')](),controller['show']);router[_0xb63c('0xa')]('/:id/fields',auth[_0xb63c('0xb')](),controller[_0xb63c('0xd')]);router[_0xb63c('0xa')]('/:id/subjects',auth[_0xb63c('0xb')](),controller[_0xb63c('0xe')]);router[_0xb63c('0xa')](_0xb63c('0xf'),auth[_0xb63c('0xb')](),controller[_0xb63c('0x10')]);router['post']('/',auth[_0xb63c('0xb')](),controller[_0xb63c('0x11')]);router[_0xb63c('0x12')](_0xb63c('0x13'),auth['isAuthenticated'](),controller[_0xb63c('0x14')]);router[_0xb63c('0x15')](_0xb63c('0x13'),auth[_0xb63c('0xb')](),controller['destroy']);module[_0xb63c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index f044180..49b669e 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 _0x677f=['contact_lead','contact','sequelize','exports','STRING','ENUM','lead','nothing'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x677f,0x8a));var _0xf677=function(_0xc9cf6f,_0x25d56c){_0xc9cf6f=_0xc9cf6f-0x0;var _0x5dcfad=_0x677f[_0xc9cf6f];return _0x5dcfad;};'use strict';var Sequelize=require(_0xf677('0x0'));module[_0xf677('0x1')]={'name':{'type':Sequelize[_0xf677('0x2')]},'moduleCreate':{'type':Sequelize[_0xf677('0x3')](_0xf677('0x4'),'contact',_0xf677('0x5')),'defaultValue':_0xf677('0x4')},'moduleSearch':{'type':Sequelize[_0xf677('0x3')](_0xf677('0x6'),_0xf677('0x7'),'lead'),'defaultValue':_0xf677('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x475d=['exports','STRING','ENUM','contact','nothing','contact_lead','lead'];(function(_0x572637,_0x216d95){var _0xb6748=function(_0x3eeb8c){while(--_0x3eeb8c){_0x572637['push'](_0x572637['shift']());}};_0xb6748(++_0x216d95);}(_0x475d,0x188));var _0xd475=function(_0x57db3a,_0x32dc3f){_0x57db3a=_0x57db3a-0x0;var _0x18dc71=_0x475d[_0x57db3a];return _0x18dc71;};'use strict';var Sequelize=require('sequelize');module[_0xd475('0x0')]={'name':{'type':Sequelize[_0xd475('0x1')]},'moduleCreate':{'type':Sequelize[_0xd475('0x2')]('lead',_0xd475('0x3'),_0xd475('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0xd475('0x5'),'contact',_0xd475('0x6')),'defaultValue':_0xd475('0x5')},'description':{'type':Sequelize[_0xd475('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index c75a236..93431c8 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 _0x76e1=['getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','ZohoConfiguration','key','model','keys','query','filters','attributes','intersection','length','nolimit','order','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','destroy','getFields','findOne','sort','hasOwnProperty','getSubjects'];(function(_0x2f3b22,_0x3210a2){var _0x5de4ad=function(_0x5c1d3d){while(--_0x5c1d3d){_0x2f3b22['push'](_0x2f3b22['shift']());}};_0x5de4ad(++_0x3210a2);}(_0x76e1,0x1e7));var _0x176e=function(_0x518091,_0x12d42d){_0x518091=_0x518091-0x0;var _0x2b122=_0x76e1[_0x518091];return _0x2b122;};'use strict';var emlformat=require(_0x176e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x176e('0x1'));var jsonpatch=require(_0x176e('0x2'));var rp=require(_0x176e('0x3'));var moment=require(_0x176e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x176e('0x5'));var path=require(_0x176e('0x6'));var sox=require(_0x176e('0x7'));var csv=require(_0x176e('0x8'));var ejs=require(_0x176e('0x9'));var fs=require('fs');var fs_extra=require(_0x176e('0xa'));var _=require('lodash');var squel=require(_0x176e('0xb'));var crypto=require(_0x176e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x176e('0x8'));var querystring=require(_0x176e('0xd'));var Papa=require(_0x176e('0xe'));var Redis=require('ioredis');var authService=require(_0x176e('0xf'));var qs=require(_0x176e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x176e('0x11'));var logger=require(_0x176e('0x12'))(_0x176e('0x13'));var utils=require(_0x176e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x176e('0x15'));var db=require(_0x176e('0x16'))['db'];function respondWithStatusCode(_0x461187,_0x1c503f){_0x1c503f=_0x1c503f||0xcc;return function(_0x38f749){if(_0x38f749){return _0x461187[_0x176e('0x17')](_0x1c503f);}return _0x461187[_0x176e('0x18')](_0x1c503f)['end']();};}function respondWithResult(_0x3778bc,_0xebf751){_0xebf751=_0xebf751||0xc8;return function(_0x3bf2c2){if(_0x3bf2c2){return _0x3778bc[_0x176e('0x18')](_0xebf751)[_0x176e('0x19')](_0x3bf2c2);}};}function respondWithFilteredResult(_0x50fb4e,_0x21b5df){return function(_0x3fd98c){if(_0x3fd98c){var _0x26acc8=typeof _0x21b5df[_0x176e('0x1a')]===_0x176e('0x1b')&&typeof _0x21b5df[_0x176e('0x1c')]===_0x176e('0x1b');var _0x242eca=_0x3fd98c[_0x176e('0x1d')];var _0x1af956=_0x26acc8?0x0:_0x21b5df[_0x176e('0x1a')];var _0x13d1a4=_0x26acc8?_0x3fd98c['count']:_0x21b5df['offset']+_0x21b5df[_0x176e('0x1c')];var _0x2a714b;if(_0x13d1a4>=_0x242eca){_0x13d1a4=_0x242eca;_0x2a714b=0xc8;}else{_0x2a714b=0xce;}_0x50fb4e['status'](_0x2a714b);return _0x50fb4e[_0x176e('0x1e')](_0x176e('0x1f'),_0x1af956+'-'+_0x13d1a4+'/'+_0x242eca)[_0x176e('0x19')](_0x3fd98c);}return null;};}function patchUpdates(_0x3142d2){return function(_0x4703a6){try{jsonpatch[_0x176e('0x20')](_0x4703a6,_0x3142d2,!![]);}catch(_0x2e53c7){return BPromise[_0x176e('0x21')](_0x2e53c7);}return _0x4703a6[_0x176e('0x22')]();};}function saveUpdates(_0x4ff2a8,_0x9c47d6){return function(_0x31cf24){if(_0x31cf24){return _0x31cf24[_0x176e('0x23')](_0x4ff2a8)[_0x176e('0x24')](function(_0x70e02e){return _0x70e02e;});}return null;};}function removeEntity(_0x226b29,_0x1092b4){return function(_0x29afb8){if(_0x29afb8){return _0x29afb8['destroy']()['then'](function(){_0x226b29[_0x176e('0x18')](0xcc)[_0x176e('0x25')]();});}};}function handleEntityNotFound(_0x212aee,_0x107b47){return function(_0x4c2d01){if(!_0x4c2d01){_0x212aee[_0x176e('0x17')](0x194);}return _0x4c2d01;};}function handleError(_0x34d2ea,_0xd5f14e){_0xd5f14e=_0xd5f14e||0x1f4;return function(_0x11df77){logger[_0x176e('0x26')](_0x11df77[_0x176e('0x27')]);if(_0x11df77[_0x176e('0x28')]){delete _0x11df77[_0x176e('0x28')];}_0x34d2ea[_0x176e('0x18')](_0xd5f14e)[_0x176e('0x29')](_0x11df77);};}exports[_0x176e('0x2a')]=function(_0x366a4e,_0x42a2c3){var _0x58e66f={},_0x229f42={},_0xb0ca7d={'count':0x0,'rows':[]};var _0x413d09=_['map'](db[_0x176e('0x2b')]['rawAttributes'],function(_0x2b1e53){return{'name':_0x2b1e53['fieldName'],'type':_0x2b1e53['type'][_0x176e('0x2c')]};});_0x229f42[_0x176e('0x2d')]=_['map'](_0x413d09,_0x176e('0x28'));_0x229f42['query']=_[_0x176e('0x2e')](_0x366a4e[_0x176e('0x2f')]);_0x229f42[_0x176e('0x30')]=_['intersection'](_0x229f42[_0x176e('0x2d')],_0x229f42['query']);_0x58e66f[_0x176e('0x31')]=_[_0x176e('0x32')](_0x229f42[_0x176e('0x2d')],qs['fields'](_0x366a4e[_0x176e('0x2f')]['fields']));_0x58e66f[_0x176e('0x31')]=_0x58e66f[_0x176e('0x31')][_0x176e('0x33')]?_0x58e66f['attributes']:_0x229f42[_0x176e('0x2d')];if(!_0x366a4e[_0x176e('0x2f')]['hasOwnProperty'](_0x176e('0x34'))){_0x58e66f[_0x176e('0x1c')]=qs[_0x176e('0x1c')](_0x366a4e['query'][_0x176e('0x1c')]);_0x58e66f[_0x176e('0x1a')]=qs['offset'](_0x366a4e['query'][_0x176e('0x1a')]);}_0x58e66f[_0x176e('0x35')]=qs['sort'](_0x366a4e[_0x176e('0x2f')]['sort']);_0x58e66f[_0x176e('0x36')]=qs[_0x176e('0x30')](_[_0x176e('0x37')](_0x366a4e[_0x176e('0x2f')],_0x229f42[_0x176e('0x30')]),_0x413d09);if(_0x366a4e['query'][_0x176e('0x38')]){_0x58e66f[_0x176e('0x36')]=_[_0x176e('0x39')](_0x58e66f['where'],{'$or':_[_0x176e('0x3a')](_0x413d09,function(_0x49e1be){if(_0x49e1be[_0x176e('0x3b')]!==_0x176e('0x3c')){var _0x24df76={};_0x24df76[_0x49e1be['name']]={'$like':'%'+_0x366a4e['query'][_0x176e('0x38')]+'%'};return _0x24df76;}})});}_0x58e66f=_[_0x176e('0x39')]({},_0x58e66f,_0x366a4e[_0x176e('0x3d')]);var _0x457b96={'where':_0x58e66f['where']};return db[_0x176e('0x2b')][_0x176e('0x1d')](_0x457b96)[_0x176e('0x24')](function(_0x36e128){_0xb0ca7d['count']=_0x36e128;if(_0x366a4e[_0x176e('0x2f')][_0x176e('0x3e')]){_0x58e66f[_0x176e('0x3f')]=[{'all':!![]}];}return db[_0x176e('0x2b')][_0x176e('0x40')](_0x58e66f);})[_0x176e('0x24')](function(_0x190504){_0xb0ca7d[_0x176e('0x41')]=_0x190504;return _0xb0ca7d;})[_0x176e('0x24')](respondWithFilteredResult(_0x42a2c3,_0x58e66f))[_0x176e('0x42')](handleError(_0x42a2c3,null));};exports[_0x176e('0x43')]=function(_0x44d3fb,_0xdf6dfe){var _0x3cef97={'raw':![],'where':{'id':_0x44d3fb[_0x176e('0x44')]['id']}},_0x2e5c75={};_0x2e5c75[_0x176e('0x2d')]=_[_0x176e('0x2e')](db[_0x176e('0x2b')][_0x176e('0x45')]);_0x2e5c75[_0x176e('0x2f')]=_[_0x176e('0x2e')](_0x44d3fb['query']);_0x2e5c75[_0x176e('0x30')]=_[_0x176e('0x32')](_0x2e5c75[_0x176e('0x2d')],_0x2e5c75['query']);_0x3cef97[_0x176e('0x31')]=_[_0x176e('0x32')](_0x2e5c75[_0x176e('0x2d')],qs[_0x176e('0x46')](_0x44d3fb[_0x176e('0x2f')][_0x176e('0x46')]));_0x3cef97['attributes']=_0x3cef97[_0x176e('0x31')]['length']?_0x3cef97[_0x176e('0x31')]:_0x2e5c75[_0x176e('0x2d')];if(_0x44d3fb['query'][_0x176e('0x3e')]){_0x3cef97[_0x176e('0x3f')]=[{'all':!![]}];}_0x3cef97=_[_0x176e('0x39')]({},_0x3cef97,_0x44d3fb['options']);return db[_0x176e('0x2b')][_0x176e('0x47')](_0x3cef97)[_0x176e('0x24')](handleEntityNotFound(_0xdf6dfe,null))[_0x176e('0x24')](respondWithResult(_0xdf6dfe,null))['catch'](handleError(_0xdf6dfe,null));};exports['create']=function(_0x72e597,_0x52b5a8){return db[_0x176e('0x2b')][_0x176e('0x48')](_0x72e597[_0x176e('0x49')],{})[_0x176e('0x24')](respondWithResult(_0x52b5a8,0xc9))[_0x176e('0x42')](handleError(_0x52b5a8,null));};exports['update']=function(_0x22af2c,_0x37afcd){if(_0x22af2c[_0x176e('0x49')]['id']){delete _0x22af2c[_0x176e('0x49')]['id'];}return db['ZohoConfiguration'][_0x176e('0x47')]({'where':{'id':_0x22af2c[_0x176e('0x44')]['id']}})[_0x176e('0x24')](handleEntityNotFound(_0x37afcd,null))[_0x176e('0x24')](saveUpdates(_0x22af2c[_0x176e('0x49')],null))[_0x176e('0x24')](respondWithResult(_0x37afcd,null))['catch'](handleError(_0x37afcd,null));};exports[_0x176e('0x4a')]=function(_0x30abaf,_0x48fc4f){return db[_0x176e('0x2b')][_0x176e('0x47')]({'where':{'id':_0x30abaf[_0x176e('0x44')]['id']}})[_0x176e('0x24')](handleEntityNotFound(_0x48fc4f,null))[_0x176e('0x24')](removeEntity(_0x48fc4f,null))['catch'](handleError(_0x48fc4f,null));};exports[_0x176e('0x4b')]=function(_0x362c82,_0x310eba,_0x180cac){var _0x21f855={};var _0x5e8ea4={};var _0x170474;var _0x1c3121;return db[_0x176e('0x2b')][_0x176e('0x4c')]({'where':{'id':_0x362c82['params']['id']}})[_0x176e('0x24')](handleEntityNotFound(_0x310eba,null))[_0x176e('0x24')](function(_0x1f0704){if(_0x1f0704){_0x170474=_0x1f0704;_0x5e8ea4['model']=_[_0x176e('0x2e')](db['ZohoField'][_0x176e('0x45')]);_0x5e8ea4[_0x176e('0x2f')]=_[_0x176e('0x2e')](_0x362c82[_0x176e('0x2f')]);_0x5e8ea4['filters']=_[_0x176e('0x32')](_0x5e8ea4[_0x176e('0x2d')],_0x5e8ea4['query']);_0x21f855[_0x176e('0x31')]=_[_0x176e('0x32')](_0x5e8ea4[_0x176e('0x2d')],qs[_0x176e('0x46')](_0x362c82[_0x176e('0x2f')][_0x176e('0x46')]));_0x21f855['attributes']=_0x21f855[_0x176e('0x31')]['length']?_0x21f855[_0x176e('0x31')]:_0x5e8ea4[_0x176e('0x2d')];_0x21f855[_0x176e('0x35')]=qs[_0x176e('0x4d')](_0x362c82[_0x176e('0x2f')]['sort']);_0x21f855[_0x176e('0x36')]=qs[_0x176e('0x30')](_['pick'](_0x362c82[_0x176e('0x2f')],_0x5e8ea4[_0x176e('0x30')]));if(_0x362c82[_0x176e('0x2f')][_0x176e('0x38')]){_0x21f855[_0x176e('0x36')]=_[_0x176e('0x39')](_0x21f855[_0x176e('0x36')],{'$or':_[_0x176e('0x3a')](_0x21f855[_0x176e('0x31')],function(_0x43f636){var _0x40db2e={};_0x40db2e[_0x43f636]={'$like':'%'+_0x362c82[_0x176e('0x2f')][_0x176e('0x38')]+'%'};return _0x40db2e;})});}_0x21f855=_[_0x176e('0x39')]({},_0x21f855,_0x362c82[_0x176e('0x3d')]);return _0x170474[_0x176e('0x4b')](_0x21f855);}})[_0x176e('0x24')](function(_0x52014a){if(_0x52014a){_0x1c3121=_0x52014a[_0x176e('0x33')];if(!_0x362c82[_0x176e('0x2f')][_0x176e('0x4e')](_0x176e('0x34'))){_0x21f855[_0x176e('0x1c')]=qs[_0x176e('0x1c')](_0x362c82[_0x176e('0x2f')][_0x176e('0x1c')]);_0x21f855[_0x176e('0x1a')]=qs[_0x176e('0x1a')](_0x362c82[_0x176e('0x2f')][_0x176e('0x1a')]);}return _0x170474[_0x176e('0x4b')](_0x21f855);}})[_0x176e('0x24')](function(_0x2b6a37){if(_0x2b6a37){return _0x2b6a37?{'count':_0x1c3121,'rows':_0x2b6a37}:null;}})['then'](respondWithResult(_0x310eba,null))[_0x176e('0x42')](handleError(_0x310eba,null));};exports[_0x176e('0x4f')]=function(_0x1f3017,_0x3a535a,_0x10f872){var _0x4f892e={};var _0x138bdd={};var _0x58014b;var _0x5f2ff2;return db[_0x176e('0x2b')][_0x176e('0x4c')]({'where':{'id':_0x1f3017[_0x176e('0x44')]['id']}})[_0x176e('0x24')](handleEntityNotFound(_0x3a535a,null))['then'](function(_0x3ac30f){if(_0x3ac30f){_0x58014b=_0x3ac30f;_0x138bdd['model']=_[_0x176e('0x2e')](db['ZohoField'][_0x176e('0x45')]);_0x138bdd[_0x176e('0x2f')]=_[_0x176e('0x2e')](_0x1f3017[_0x176e('0x2f')]);_0x138bdd[_0x176e('0x30')]=_[_0x176e('0x32')](_0x138bdd[_0x176e('0x2d')],_0x138bdd['query']);_0x4f892e[_0x176e('0x31')]=_[_0x176e('0x32')](_0x138bdd['model'],qs[_0x176e('0x46')](_0x1f3017[_0x176e('0x2f')][_0x176e('0x46')]));_0x4f892e[_0x176e('0x31')]=_0x4f892e[_0x176e('0x31')][_0x176e('0x33')]?_0x4f892e[_0x176e('0x31')]:_0x138bdd[_0x176e('0x2d')];_0x4f892e[_0x176e('0x35')]=qs['sort'](_0x1f3017['query'][_0x176e('0x4d')]);_0x4f892e[_0x176e('0x36')]=qs['filters'](_[_0x176e('0x37')](_0x1f3017[_0x176e('0x2f')],_0x138bdd[_0x176e('0x30')]));if(_0x1f3017[_0x176e('0x2f')][_0x176e('0x38')]){_0x4f892e[_0x176e('0x36')]=_[_0x176e('0x39')](_0x4f892e[_0x176e('0x36')],{'$or':_['map'](_0x4f892e['attributes'],function(_0x5a722f){var _0x11fbef={};_0x11fbef[_0x5a722f]={'$like':'%'+_0x1f3017[_0x176e('0x2f')][_0x176e('0x38')]+'%'};return _0x11fbef;})});}_0x4f892e=_[_0x176e('0x39')]({},_0x4f892e,_0x1f3017['options']);return _0x58014b[_0x176e('0x4f')](_0x4f892e);}})[_0x176e('0x24')](function(_0x16d8ac){if(_0x16d8ac){_0x5f2ff2=_0x16d8ac[_0x176e('0x33')];if(!_0x1f3017[_0x176e('0x2f')][_0x176e('0x4e')](_0x176e('0x34'))){_0x4f892e[_0x176e('0x1c')]=qs[_0x176e('0x1c')](_0x1f3017[_0x176e('0x2f')][_0x176e('0x1c')]);_0x4f892e[_0x176e('0x1a')]=qs[_0x176e('0x1a')](_0x1f3017[_0x176e('0x2f')]['offset']);}return _0x58014b['getSubjects'](_0x4f892e);}})['then'](function(_0x828a0){if(_0x828a0){return _0x828a0?{'count':_0x5f2ff2,'rows':_0x828a0}:null;}})['then'](respondWithResult(_0x3a535a,null))['catch'](handleError(_0x3a535a,null));};exports[_0x176e('0x50')]=function(_0x5e2835,_0xf68756,_0x15f5dc){var _0x5eb229={};var _0x44dbe1={};var _0x17d6e6;var _0x593494;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x5e2835[_0x176e('0x44')]['id']}})['then'](handleEntityNotFound(_0xf68756,null))['then'](function(_0x3e0207){if(_0x3e0207){_0x17d6e6=_0x3e0207;_0x44dbe1[_0x176e('0x2d')]=_['keys'](db['ZohoField']['rawAttributes']);_0x44dbe1[_0x176e('0x2f')]=_[_0x176e('0x2e')](_0x5e2835[_0x176e('0x2f')]);_0x44dbe1[_0x176e('0x30')]=_[_0x176e('0x32')](_0x44dbe1[_0x176e('0x2d')],_0x44dbe1[_0x176e('0x2f')]);_0x5eb229['attributes']=_[_0x176e('0x32')](_0x44dbe1['model'],qs[_0x176e('0x46')](_0x5e2835[_0x176e('0x2f')][_0x176e('0x46')]));_0x5eb229[_0x176e('0x31')]=_0x5eb229[_0x176e('0x31')]['length']?_0x5eb229[_0x176e('0x31')]:_0x44dbe1['model'];_0x5eb229['order']=qs[_0x176e('0x4d')](_0x5e2835[_0x176e('0x2f')][_0x176e('0x4d')]);_0x5eb229[_0x176e('0x36')]=qs[_0x176e('0x30')](_[_0x176e('0x37')](_0x5e2835[_0x176e('0x2f')],_0x44dbe1[_0x176e('0x30')]));if(_0x5e2835['query']['filter']){_0x5eb229[_0x176e('0x36')]=_[_0x176e('0x39')](_0x5eb229[_0x176e('0x36')],{'$or':_[_0x176e('0x3a')](_0x5eb229[_0x176e('0x31')],function(_0x2c35b5){var _0x1358bc={};_0x1358bc[_0x2c35b5]={'$like':'%'+_0x5e2835[_0x176e('0x2f')][_0x176e('0x38')]+'%'};return _0x1358bc;})});}_0x5eb229=_[_0x176e('0x39')]({},_0x5eb229,_0x5e2835['options']);return _0x17d6e6['getDescriptions'](_0x5eb229);}})['then'](function(_0x2297ae){if(_0x2297ae){_0x593494=_0x2297ae[_0x176e('0x33')];if(!_0x5e2835[_0x176e('0x2f')]['hasOwnProperty'](_0x176e('0x34'))){_0x5eb229[_0x176e('0x1c')]=qs['limit'](_0x5e2835[_0x176e('0x2f')][_0x176e('0x1c')]);_0x5eb229[_0x176e('0x1a')]=qs[_0x176e('0x1a')](_0x5e2835[_0x176e('0x2f')]['offset']);}return _0x17d6e6['getDescriptions'](_0x5eb229);}})[_0x176e('0x24')](function(_0x15787a){if(_0x15787a){return _0x15787a?{'count':_0x593494,'rows':_0x15787a}:null;}})[_0x176e('0x24')](respondWithResult(_0xf68756,null))[_0x176e('0x42')](handleError(_0xf68756,null));}; \ No newline at end of file +var _0xd184=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','update','body','getFields','findOne','order','hasOwnProperty','nolimit','ZohoField','pick','options','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xd184,0x193));var _0x4d18=function(_0x706593,_0x586bf3){_0x706593=_0x706593-0x0;var _0x44f4ea=_0xd184[_0x706593];return _0x44f4ea;};'use strict';var emlformat=require(_0x4d18('0x0'));var rimraf=require(_0x4d18('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d18('0x2'));var rp=require(_0x4d18('0x3'));var moment=require(_0x4d18('0x4'));var BPromise=require(_0x4d18('0x5'));var Mustache=require('mustache');var util=require(_0x4d18('0x6'));var path=require(_0x4d18('0x7'));var sox=require(_0x4d18('0x8'));var csv=require(_0x4d18('0x9'));var ejs=require(_0x4d18('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d18('0xb'));var squel=require(_0x4d18('0xc'));var crypto=require(_0x4d18('0xd'));var jsforce=require(_0x4d18('0xe'));var deskjs=require(_0x4d18('0xf'));var toCsv=require(_0x4d18('0x9'));var querystring=require('querystring');var Papa=require(_0x4d18('0x10'));var Redis=require(_0x4d18('0x11'));var authService=require(_0x4d18('0x12'));var qs=require(_0x4d18('0x13'));var as=require(_0x4d18('0x14'));var hardwareService=require(_0x4d18('0x15'));var logger=require('../../config/logger')(_0x4d18('0x16'));var utils=require(_0x4d18('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4d18('0x18'));var db=require(_0x4d18('0x19'))['db'];function respondWithStatusCode(_0x53f705,_0x47c9aa){_0x47c9aa=_0x47c9aa||0xcc;return function(_0x171ffa){if(_0x171ffa){return _0x53f705[_0x4d18('0x1a')](_0x47c9aa);}return _0x53f705[_0x4d18('0x1b')](_0x47c9aa)[_0x4d18('0x1c')]();};}function respondWithResult(_0x545bc4,_0x41b5d6){_0x41b5d6=_0x41b5d6||0xc8;return function(_0x31cc1f){if(_0x31cc1f){return _0x545bc4['status'](_0x41b5d6)['json'](_0x31cc1f);}};}function respondWithFilteredResult(_0x2f6599,_0xa4e14e){return function(_0x4e22f9){if(_0x4e22f9){var _0x322014=typeof _0xa4e14e[_0x4d18('0x1d')]===_0x4d18('0x1e')&&typeof _0xa4e14e[_0x4d18('0x1f')]===_0x4d18('0x1e');var _0x2ab8b2=_0x4e22f9[_0x4d18('0x20')];var _0x50449c=_0x322014?0x0:_0xa4e14e[_0x4d18('0x1d')];var _0x37664f=_0x322014?_0x4e22f9[_0x4d18('0x20')]:_0xa4e14e[_0x4d18('0x1d')]+_0xa4e14e[_0x4d18('0x1f')];var _0x5ccaff;if(_0x37664f>=_0x2ab8b2){_0x37664f=_0x2ab8b2;_0x5ccaff=0xc8;}else{_0x5ccaff=0xce;}_0x2f6599[_0x4d18('0x1b')](_0x5ccaff);return _0x2f6599['set']('Content-Range',_0x50449c+'-'+_0x37664f+'/'+_0x2ab8b2)[_0x4d18('0x21')](_0x4e22f9);}return null;};}function patchUpdates(_0x1bf072){return function(_0x14852e){try{jsonpatch['apply'](_0x14852e,_0x1bf072,!![]);}catch(_0x45b030){return BPromise[_0x4d18('0x22')](_0x45b030);}return _0x14852e[_0x4d18('0x23')]();};}function saveUpdates(_0x106cb5,_0x43848e){return function(_0x12bd07){if(_0x12bd07){return _0x12bd07['update'](_0x106cb5)[_0x4d18('0x24')](function(_0x1d4bf8){return _0x1d4bf8;});}return null;};}function removeEntity(_0x5751b3,_0x4e5fe0){return function(_0x498c1a){if(_0x498c1a){return _0x498c1a[_0x4d18('0x25')]()[_0x4d18('0x24')](function(){_0x5751b3[_0x4d18('0x1b')](0xcc)[_0x4d18('0x1c')]();});}};}function handleEntityNotFound(_0x53faad,_0x13b16c){return function(_0x37c736){if(!_0x37c736){_0x53faad['sendStatus'](0x194);}return _0x37c736;};}function handleError(_0x1ffeed,_0x169465){_0x169465=_0x169465||0x1f4;return function(_0x378c77){logger[_0x4d18('0x26')](_0x378c77[_0x4d18('0x27')]);if(_0x378c77[_0x4d18('0x28')]){delete _0x378c77['name'];}_0x1ffeed[_0x4d18('0x1b')](_0x169465)[_0x4d18('0x29')](_0x378c77);};}exports[_0x4d18('0x2a')]=function(_0x4bc75c,_0xb65af3){var _0x5f2eee={},_0x4aeb56={},_0xbff71f={'count':0x0,'rows':[]};var _0x5bc189=_[_0x4d18('0x2b')](db[_0x4d18('0x2c')][_0x4d18('0x2d')],function(_0x2fac6c){return{'name':_0x2fac6c[_0x4d18('0x2e')],'type':_0x2fac6c[_0x4d18('0x2f')][_0x4d18('0x30')]};});_0x4aeb56[_0x4d18('0x31')]=_[_0x4d18('0x2b')](_0x5bc189,_0x4d18('0x28'));_0x4aeb56[_0x4d18('0x32')]=_[_0x4d18('0x33')](_0x4bc75c[_0x4d18('0x32')]);_0x4aeb56['filters']=_['intersection'](_0x4aeb56[_0x4d18('0x31')],_0x4aeb56[_0x4d18('0x32')]);_0x5f2eee[_0x4d18('0x34')]=_[_0x4d18('0x35')](_0x4aeb56[_0x4d18('0x31')],qs[_0x4d18('0x36')](_0x4bc75c[_0x4d18('0x32')][_0x4d18('0x36')]));_0x5f2eee[_0x4d18('0x34')]=_0x5f2eee['attributes'][_0x4d18('0x37')]?_0x5f2eee[_0x4d18('0x34')]:_0x4aeb56['model'];if(!_0x4bc75c[_0x4d18('0x32')]['hasOwnProperty']('nolimit')){_0x5f2eee[_0x4d18('0x1f')]=qs['limit'](_0x4bc75c['query'][_0x4d18('0x1f')]);_0x5f2eee[_0x4d18('0x1d')]=qs[_0x4d18('0x1d')](_0x4bc75c['query'][_0x4d18('0x1d')]);}_0x5f2eee['order']=qs[_0x4d18('0x38')](_0x4bc75c[_0x4d18('0x32')][_0x4d18('0x38')]);_0x5f2eee[_0x4d18('0x39')]=qs[_0x4d18('0x3a')](_['pick'](_0x4bc75c[_0x4d18('0x32')],_0x4aeb56[_0x4d18('0x3a')]),_0x5bc189);if(_0x4bc75c[_0x4d18('0x32')][_0x4d18('0x3b')]){_0x5f2eee[_0x4d18('0x39')]=_[_0x4d18('0x3c')](_0x5f2eee[_0x4d18('0x39')],{'$or':_[_0x4d18('0x2b')](_0x5bc189,function(_0x118adc){if(_0x118adc[_0x4d18('0x2f')]!==_0x4d18('0x3d')){var _0x5d206c={};_0x5d206c[_0x118adc['name']]={'$like':'%'+_0x4bc75c[_0x4d18('0x32')][_0x4d18('0x3b')]+'%'};return _0x5d206c;}})});}_0x5f2eee=_[_0x4d18('0x3c')]({},_0x5f2eee,_0x4bc75c['options']);var _0x427868={'where':_0x5f2eee[_0x4d18('0x39')]};return db['ZohoConfiguration']['count'](_0x427868)[_0x4d18('0x24')](function(_0x449293){_0xbff71f[_0x4d18('0x20')]=_0x449293;if(_0x4bc75c['query'][_0x4d18('0x3e')]){_0x5f2eee[_0x4d18('0x3f')]=[{'all':!![]}];}return db[_0x4d18('0x2c')][_0x4d18('0x40')](_0x5f2eee);})[_0x4d18('0x24')](function(_0x31b357){_0xbff71f[_0x4d18('0x41')]=_0x31b357;return _0xbff71f;})[_0x4d18('0x24')](respondWithFilteredResult(_0xb65af3,_0x5f2eee))[_0x4d18('0x42')](handleError(_0xb65af3,null));};exports['show']=function(_0x388b22,_0x27e06d){var _0x5ef107={'raw':![],'where':{'id':_0x388b22[_0x4d18('0x43')]['id']}},_0x5319ac={};_0x5319ac[_0x4d18('0x31')]=_['keys'](db[_0x4d18('0x2c')]['rawAttributes']);_0x5319ac[_0x4d18('0x32')]=_['keys'](_0x388b22['query']);_0x5319ac[_0x4d18('0x3a')]=_[_0x4d18('0x35')](_0x5319ac[_0x4d18('0x31')],_0x5319ac[_0x4d18('0x32')]);_0x5ef107[_0x4d18('0x34')]=_[_0x4d18('0x35')](_0x5319ac[_0x4d18('0x31')],qs[_0x4d18('0x36')](_0x388b22[_0x4d18('0x32')][_0x4d18('0x36')]));_0x5ef107[_0x4d18('0x34')]=_0x5ef107[_0x4d18('0x34')]['length']?_0x5ef107[_0x4d18('0x34')]:_0x5319ac[_0x4d18('0x31')];if(_0x388b22[_0x4d18('0x32')][_0x4d18('0x3e')]){_0x5ef107[_0x4d18('0x3f')]=[{'all':!![]}];}_0x5ef107=_[_0x4d18('0x3c')]({},_0x5ef107,_0x388b22['options']);return db[_0x4d18('0x2c')][_0x4d18('0x44')](_0x5ef107)[_0x4d18('0x24')](handleEntityNotFound(_0x27e06d,null))[_0x4d18('0x24')](respondWithResult(_0x27e06d,null))[_0x4d18('0x42')](handleError(_0x27e06d,null));};exports[_0x4d18('0x45')]=function(_0x533744,_0x30e1d0){return db[_0x4d18('0x2c')][_0x4d18('0x45')](_0x533744['body'],{})['then'](respondWithResult(_0x30e1d0,0xc9))[_0x4d18('0x42')](handleError(_0x30e1d0,null));};exports[_0x4d18('0x46')]=function(_0x4ce289,_0x366caf){if(_0x4ce289['body']['id']){delete _0x4ce289['body']['id'];}return db[_0x4d18('0x2c')]['find']({'where':{'id':_0x4ce289['params']['id']}})[_0x4d18('0x24')](handleEntityNotFound(_0x366caf,null))[_0x4d18('0x24')](saveUpdates(_0x4ce289[_0x4d18('0x47')],null))[_0x4d18('0x24')](respondWithResult(_0x366caf,null))[_0x4d18('0x42')](handleError(_0x366caf,null));};exports[_0x4d18('0x25')]=function(_0x5f0c6e,_0x138119){return db[_0x4d18('0x2c')][_0x4d18('0x44')]({'where':{'id':_0x5f0c6e[_0x4d18('0x43')]['id']}})[_0x4d18('0x24')](handleEntityNotFound(_0x138119,null))[_0x4d18('0x24')](removeEntity(_0x138119,null))[_0x4d18('0x42')](handleError(_0x138119,null));};exports[_0x4d18('0x48')]=function(_0x936b7,_0x20fdfa,_0x171d16){var _0x1b83e5={};var _0x3baa6c={};var _0x1a66ee;var _0x592734;return db[_0x4d18('0x2c')][_0x4d18('0x49')]({'where':{'id':_0x936b7['params']['id']}})['then'](handleEntityNotFound(_0x20fdfa,null))[_0x4d18('0x24')](function(_0x27b3aa){if(_0x27b3aa){_0x1a66ee=_0x27b3aa;_0x3baa6c[_0x4d18('0x31')]=_['keys'](db['ZohoField'][_0x4d18('0x2d')]);_0x3baa6c['query']=_['keys'](_0x936b7['query']);_0x3baa6c[_0x4d18('0x3a')]=_[_0x4d18('0x35')](_0x3baa6c[_0x4d18('0x31')],_0x3baa6c[_0x4d18('0x32')]);_0x1b83e5[_0x4d18('0x34')]=_[_0x4d18('0x35')](_0x3baa6c[_0x4d18('0x31')],qs[_0x4d18('0x36')](_0x936b7[_0x4d18('0x32')]['fields']));_0x1b83e5[_0x4d18('0x34')]=_0x1b83e5[_0x4d18('0x34')][_0x4d18('0x37')]?_0x1b83e5[_0x4d18('0x34')]:_0x3baa6c[_0x4d18('0x31')];_0x1b83e5[_0x4d18('0x4a')]=qs[_0x4d18('0x38')](_0x936b7[_0x4d18('0x32')]['sort']);_0x1b83e5['where']=qs[_0x4d18('0x3a')](_['pick'](_0x936b7[_0x4d18('0x32')],_0x3baa6c[_0x4d18('0x3a')]));if(_0x936b7['query'][_0x4d18('0x3b')]){_0x1b83e5[_0x4d18('0x39')]=_[_0x4d18('0x3c')](_0x1b83e5[_0x4d18('0x39')],{'$or':_[_0x4d18('0x2b')](_0x1b83e5[_0x4d18('0x34')],function(_0xaccd65){var _0x1d8315={};_0x1d8315[_0xaccd65]={'$like':'%'+_0x936b7[_0x4d18('0x32')]['filter']+'%'};return _0x1d8315;})});}_0x1b83e5=_[_0x4d18('0x3c')]({},_0x1b83e5,_0x936b7['options']);return _0x1a66ee['getFields'](_0x1b83e5);}})['then'](function(_0xfc2523){if(_0xfc2523){_0x592734=_0xfc2523[_0x4d18('0x37')];if(!_0x936b7[_0x4d18('0x32')][_0x4d18('0x4b')](_0x4d18('0x4c'))){_0x1b83e5[_0x4d18('0x1f')]=qs[_0x4d18('0x1f')](_0x936b7[_0x4d18('0x32')][_0x4d18('0x1f')]);_0x1b83e5[_0x4d18('0x1d')]=qs['offset'](_0x936b7[_0x4d18('0x32')][_0x4d18('0x1d')]);}return _0x1a66ee[_0x4d18('0x48')](_0x1b83e5);}})[_0x4d18('0x24')](function(_0x41a313){if(_0x41a313){return _0x41a313?{'count':_0x592734,'rows':_0x41a313}:null;}})[_0x4d18('0x24')](respondWithResult(_0x20fdfa,null))[_0x4d18('0x42')](handleError(_0x20fdfa,null));};exports['getSubjects']=function(_0xf74b35,_0x24d83c,_0x41088f){var _0x4722cb={};var _0x387396={};var _0x5b91ad;var _0x3885c5;return db[_0x4d18('0x2c')][_0x4d18('0x49')]({'where':{'id':_0xf74b35[_0x4d18('0x43')]['id']}})[_0x4d18('0x24')](handleEntityNotFound(_0x24d83c,null))[_0x4d18('0x24')](function(_0x47b919){if(_0x47b919){_0x5b91ad=_0x47b919;_0x387396['model']=_[_0x4d18('0x33')](db[_0x4d18('0x4d')][_0x4d18('0x2d')]);_0x387396[_0x4d18('0x32')]=_[_0x4d18('0x33')](_0xf74b35['query']);_0x387396[_0x4d18('0x3a')]=_[_0x4d18('0x35')](_0x387396['model'],_0x387396['query']);_0x4722cb[_0x4d18('0x34')]=_[_0x4d18('0x35')](_0x387396[_0x4d18('0x31')],qs['fields'](_0xf74b35[_0x4d18('0x32')]['fields']));_0x4722cb['attributes']=_0x4722cb[_0x4d18('0x34')]['length']?_0x4722cb['attributes']:_0x387396[_0x4d18('0x31')];_0x4722cb[_0x4d18('0x4a')]=qs[_0x4d18('0x38')](_0xf74b35['query'][_0x4d18('0x38')]);_0x4722cb[_0x4d18('0x39')]=qs['filters'](_[_0x4d18('0x4e')](_0xf74b35[_0x4d18('0x32')],_0x387396['filters']));if(_0xf74b35['query'][_0x4d18('0x3b')]){_0x4722cb[_0x4d18('0x39')]=_[_0x4d18('0x3c')](_0x4722cb['where'],{'$or':_[_0x4d18('0x2b')](_0x4722cb[_0x4d18('0x34')],function(_0x135804){var _0x1e1949={};_0x1e1949[_0x135804]={'$like':'%'+_0xf74b35['query'][_0x4d18('0x3b')]+'%'};return _0x1e1949;})});}_0x4722cb=_[_0x4d18('0x3c')]({},_0x4722cb,_0xf74b35[_0x4d18('0x4f')]);return _0x5b91ad[_0x4d18('0x50')](_0x4722cb);}})['then'](function(_0x109484){if(_0x109484){_0x3885c5=_0x109484[_0x4d18('0x37')];if(!_0xf74b35[_0x4d18('0x32')][_0x4d18('0x4b')](_0x4d18('0x4c'))){_0x4722cb['limit']=qs[_0x4d18('0x1f')](_0xf74b35[_0x4d18('0x32')][_0x4d18('0x1f')]);_0x4722cb[_0x4d18('0x1d')]=qs[_0x4d18('0x1d')](_0xf74b35[_0x4d18('0x32')][_0x4d18('0x1d')]);}return _0x5b91ad['getSubjects'](_0x4722cb);}})[_0x4d18('0x24')](function(_0x205013){if(_0x205013){return _0x205013?{'count':_0x3885c5,'rows':_0x205013}:null;}})['then'](respondWithResult(_0x24d83c,null))[_0x4d18('0x42')](handleError(_0x24d83c,null));};exports[_0x4d18('0x51')]=function(_0x5f2976,_0x46da38,_0x2e4f19){var _0x421330={};var _0x5c1bd2={};var _0x10d5ef;var _0x5a0a50;return db['ZohoConfiguration'][_0x4d18('0x49')]({'where':{'id':_0x5f2976[_0x4d18('0x43')]['id']}})[_0x4d18('0x24')](handleEntityNotFound(_0x46da38,null))[_0x4d18('0x24')](function(_0x2a7934){if(_0x2a7934){_0x10d5ef=_0x2a7934;_0x5c1bd2[_0x4d18('0x31')]=_[_0x4d18('0x33')](db[_0x4d18('0x4d')][_0x4d18('0x2d')]);_0x5c1bd2['query']=_[_0x4d18('0x33')](_0x5f2976[_0x4d18('0x32')]);_0x5c1bd2[_0x4d18('0x3a')]=_['intersection'](_0x5c1bd2[_0x4d18('0x31')],_0x5c1bd2['query']);_0x421330[_0x4d18('0x34')]=_[_0x4d18('0x35')](_0x5c1bd2[_0x4d18('0x31')],qs[_0x4d18('0x36')](_0x5f2976[_0x4d18('0x32')][_0x4d18('0x36')]));_0x421330[_0x4d18('0x34')]=_0x421330[_0x4d18('0x34')][_0x4d18('0x37')]?_0x421330['attributes']:_0x5c1bd2[_0x4d18('0x31')];_0x421330[_0x4d18('0x4a')]=qs[_0x4d18('0x38')](_0x5f2976['query']['sort']);_0x421330[_0x4d18('0x39')]=qs['filters'](_[_0x4d18('0x4e')](_0x5f2976[_0x4d18('0x32')],_0x5c1bd2[_0x4d18('0x3a')]));if(_0x5f2976[_0x4d18('0x32')]['filter']){_0x421330[_0x4d18('0x39')]=_['merge'](_0x421330[_0x4d18('0x39')],{'$or':_[_0x4d18('0x2b')](_0x421330[_0x4d18('0x34')],function(_0x4f1993){var _0x226604={};_0x226604[_0x4f1993]={'$like':'%'+_0x5f2976['query'][_0x4d18('0x3b')]+'%'};return _0x226604;})});}_0x421330=_[_0x4d18('0x3c')]({},_0x421330,_0x5f2976['options']);return _0x10d5ef[_0x4d18('0x51')](_0x421330);}})['then'](function(_0x127204){if(_0x127204){_0x5a0a50=_0x127204['length'];if(!_0x5f2976['query']['hasOwnProperty'](_0x4d18('0x4c'))){_0x421330[_0x4d18('0x1f')]=qs['limit'](_0x5f2976['query'][_0x4d18('0x1f')]);_0x421330[_0x4d18('0x1d')]=qs[_0x4d18('0x1d')](_0x5f2976[_0x4d18('0x32')][_0x4d18('0x1d')]);}return _0x10d5ef[_0x4d18('0x51')](_0x421330);}})['then'](function(_0x58d5c6){if(_0x58d5c6){return _0x58d5c6?{'count':_0x5a0a50,'rows':_0x58d5c6}:null;}})[_0x4d18('0x24')](respondWithResult(_0x46da38,null))[_0x4d18('0x42')](handleError(_0x46da38,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 38bd1ae..c27b5f0 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 _0x03ed=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0x03ed,0xed));var _0xd03e=function(_0x3ad510,_0x106da2){_0x3ad510=_0x3ad510-0x0;var _0x2d9d2a=_0x03ed[_0x3ad510];return _0x2d9d2a;};'use strict';var _=require(_0xd03e('0x0'));var util=require(_0xd03e('0x1'));var logger=require(_0xd03e('0x2'))(_0xd03e('0x3'));var moment=require('moment');var BPromise=require(_0xd03e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd03e('0x5'));var rimraf=require(_0xd03e('0x6'));var config=require(_0xd03e('0x7'));var attributes=require(_0xd03e('0x8'));module['exports']=function(_0x219f58,_0x3f5811){return _0x219f58['define'](_0xd03e('0x9'),attributes,{'tableName':_0xd03e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a1a=['bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','define','int_zoho_configurations','lodash','../../config/logger','api','moment'];(function(_0x5975ff,_0x2bde0b){var _0x4558fe=function(_0x54f9d4){while(--_0x54f9d4){_0x5975ff['push'](_0x5975ff['shift']());}};_0x4558fe(++_0x2bde0b);}(_0x4a1a,0x104));var _0xa4a1=function(_0x125d85,_0x137c24){_0x125d85=_0x125d85-0x0;var _0x11b5b5=_0x4a1a[_0x125d85];return _0x11b5b5;};'use strict';var _=require(_0xa4a1('0x0'));var util=require('util');var logger=require(_0xa4a1('0x1'))(_0xa4a1('0x2'));var moment=require(_0xa4a1('0x3'));var BPromise=require(_0xa4a1('0x4'));var rp=require(_0xa4a1('0x5'));var fs=require('fs');var path=require(_0xa4a1('0x6'));var rimraf=require('rimraf');var config=require(_0xa4a1('0x7'));var attributes=require(_0xa4a1('0x8'));module['exports']=function(_0x345f3c,_0x348102){return _0x345f3c[_0xa4a1('0x9')]('ZohoConfiguration',attributes,{'tableName':_0xa4a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 80b2090..e93f6d1 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 _0xc53d=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x58b983,_0x426a5c){var _0x83da04=function(_0x1c2d4d){while(--_0x1c2d4d){_0x58b983['push'](_0x58b983['shift']());}};_0x83da04(++_0x426a5c);}(_0xc53d,0x89));var _0xdc53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc53d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdc53('0x0'));var util=require('util');var moment=require(_0xdc53('0x1'));var BPromise=require(_0xdc53('0x2'));var rs=require(_0xdc53('0x3'));var fs=require('fs');var Redis=require(_0xdc53('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc53('0x5'));var logger=require(_0xdc53('0x6'))(_0xdc53('0x7'));var config=require(_0xdc53('0x8'));var jayson=require(_0xdc53('0x9'));var client=jayson[_0xdc53('0xa')][_0xdc53('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x274e84,_0x3152bc,_0x2015a3){return new BPromise(function(_0x5e1543,_0x751480){return client[_0xdc53('0xc')](_0x274e84,_0x2015a3)[_0xdc53('0xd')](function(_0x2f68f3){logger[_0xdc53('0xe')](_0xdc53('0xf'),_0x3152bc,_0xdc53('0x10'));logger[_0xdc53('0x11')](_0xdc53('0x12'),_0x3152bc,_0xdc53('0x10'),JSON['stringify'](_0x2f68f3));if(_0x2f68f3[_0xdc53('0x13')]){if(_0x2f68f3[_0xdc53('0x13')]['code']===0x1f4){logger[_0xdc53('0x13')](_0xdc53('0xf'),_0x3152bc,_0x2f68f3['error'][_0xdc53('0x14')]);return _0x751480(_0x2f68f3[_0xdc53('0x13')][_0xdc53('0x14')]);}logger[_0xdc53('0x13')](_0xdc53('0xf'),_0x3152bc,_0x2f68f3[_0xdc53('0x13')][_0xdc53('0x14')]);return _0x5e1543(_0x2f68f3[_0xdc53('0x13')]['message']);}else{logger[_0xdc53('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x3152bc,_0xdc53('0x10'));_0x5e1543(_0x2f68f3[_0xdc53('0x15')][_0xdc53('0x14')]);}})['catch'](function(_0x57bf1b){logger[_0xdc53('0x13')](_0xdc53('0xf'),_0x3152bc,_0x57bf1b);_0x751480(_0x57bf1b);});});} \ No newline at end of file +var _0xe921=['stringify','error','code','message','result','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4e664c,_0x47abb9){var _0x5f3913=function(_0x3a205f){while(--_0x3a205f){_0x4e664c['push'](_0x4e664c['shift']());}};_0x5f3913(++_0x47abb9);}(_0xe921,0x101));var _0x1e92=function(_0x52dd4d,_0x155e10){_0x52dd4d=_0x52dd4d-0x0;var _0x43dd2c=_0xe921[_0x52dd4d];return _0x43dd2c;};'use strict';var _=require(_0x1e92('0x0'));var util=require('util');var moment=require(_0x1e92('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e92('0x2'));var db=require(_0x1e92('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e92('0x4'))(_0x1e92('0x5'));var config=require(_0x1e92('0x6'));var jayson=require(_0x1e92('0x7'));var client=jayson[_0x1e92('0x8')][_0x1e92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x228e5e,_0x2acbff,_0x2d03ee){return new BPromise(function(_0x553945,_0xd24160){return client[_0x1e92('0xa')](_0x228e5e,_0x2d03ee)[_0x1e92('0xb')](function(_0x2820b8){logger[_0x1e92('0xc')](_0x1e92('0xd'),_0x2acbff,_0x1e92('0xe'));logger[_0x1e92('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2acbff,_0x1e92('0xe'),JSON[_0x1e92('0x10')](_0x2820b8));if(_0x2820b8[_0x1e92('0x11')]){if(_0x2820b8[_0x1e92('0x11')][_0x1e92('0x12')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2acbff,_0x2820b8[_0x1e92('0x11')]['message']);return _0xd24160(_0x2820b8[_0x1e92('0x11')][_0x1e92('0x13')]);}logger[_0x1e92('0x11')](_0x1e92('0xd'),_0x2acbff,_0x2820b8[_0x1e92('0x11')]['message']);return _0x553945(_0x2820b8['error'][_0x1e92('0x13')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x2acbff,'request\x20sent');_0x553945(_0x2820b8[_0x1e92('0x14')][_0x1e92('0x13')]);}})['catch'](function(_0x20de38){logger[_0x1e92('0x11')](_0x1e92('0xd'),_0x2acbff,_0x20de38);_0xd24160(_0x20de38);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index c5f119f..1e8460d 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 _0x5e25=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','create','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3a233c,_0x4f3100){var _0x53fa7f=function(_0x2667ac){while(--_0x2667ac){_0x3a233c['push'](_0x3a233c['shift']());}};_0x53fa7f(++_0x4f3100);}(_0x5e25,0x152));var _0x55e2=function(_0x500deb,_0x2b5571){_0x500deb=_0x500deb-0x0;var _0x206c46=_0x5e25[_0x500deb];return _0x206c46;};'use strict';var multer=require(_0x55e2('0x0'));var util=require('util');var path=require(_0x55e2('0x1'));var timeout=require(_0x55e2('0x2'));var express=require(_0x55e2('0x3'));var router=express[_0x55e2('0x4')]();var fs_extra=require(_0x55e2('0x5'));var auth=require(_0x55e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x55e2('0x7'));var controller=require(_0x55e2('0x8'));router[_0x55e2('0x9')]('/',auth[_0x55e2('0xa')](),controller['index']);router['get'](_0x55e2('0xb'),auth[_0x55e2('0xa')](),controller[_0x55e2('0xc')]);router['post']('/',auth[_0x55e2('0xa')](),controller[_0x55e2('0xd')]);router['put'](_0x55e2('0xb'),auth['isAuthenticated'](),controller[_0x55e2('0xe')]);router[_0x55e2('0xf')](_0x55e2('0xb'),auth['isAuthenticated'](),controller[_0x55e2('0x10')]);module[_0x55e2('0x11')]=router; \ No newline at end of file +var _0x83f0=['update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0xa75db,_0x97eeb8){var _0x988497=function(_0x32d0bf){while(--_0x32d0bf){_0xa75db['push'](_0xa75db['shift']());}};_0x988497(++_0x97eeb8);}(_0x83f0,0x1e4));var _0x083f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x83f0[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x083f('0x0'));var util=require(_0x083f('0x1'));var path=require('path');var timeout=require(_0x083f('0x2'));var express=require(_0x083f('0x3'));var router=express['Router']();var fs_extra=require(_0x083f('0x4'));var auth=require(_0x083f('0x5'));var interaction=require(_0x083f('0x6'));var config=require(_0x083f('0x7'));var controller=require(_0x083f('0x8'));router[_0x083f('0x9')]('/',auth[_0x083f('0xa')](),controller[_0x083f('0xb')]);router[_0x083f('0x9')](_0x083f('0xc'),auth[_0x083f('0xa')](),controller[_0x083f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x083f('0xe')]);router[_0x083f('0xf')](_0x083f('0xc'),auth['isAuthenticated'](),controller[_0x083f('0x10')]);router[_0x083f('0x11')](_0x083f('0xc'),auth[_0x083f('0xa')](),controller[_0x083f('0x12')]);module[_0x083f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index db06773..7baef49 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 _0x6b43=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6b43,0x1ea));var _0x36b4=function(_0x4e6bb1,_0xe26bba){_0x4e6bb1=_0x4e6bb1-0x0;var _0x535aa3=_0x6b43[_0x4e6bb1];return _0x535aa3;};'use strict';var Sequelize=require(_0x36b4('0x0'));module[_0x36b4('0x1')]={'type':{'type':Sequelize[_0x36b4('0x2')](_0x36b4('0x3'),_0x36b4('0x4'),_0x36b4('0x5'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x36b4('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x36b4('0x4'),_0x36b4('0x5'))},'keyContent':{'type':Sequelize[_0x36b4('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x36b4('0x6')]},'customField':{'type':Sequelize[_0x36b4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x36b4('0x6')]}}; \ No newline at end of file +var _0x4942=['string','variable','customVariable','keyValue','STRING','BOOLEAN','ENUM'];(function(_0x3ee0bd,_0x1a8a8d){var _0x2cb7ed=function(_0x566ebb){while(--_0x566ebb){_0x3ee0bd['push'](_0x3ee0bd['shift']());}};_0x2cb7ed(++_0x1a8a8d);}(_0x4942,0x1c6));var _0x2494=function(_0x106b40,_0x1d7763){_0x106b40=_0x106b40-0x0;var _0x563a53=_0x4942[_0x106b40];return _0x563a53;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2494('0x0')](_0x2494('0x1'),_0x2494('0x2'),_0x2494('0x3'),_0x2494('0x4'),'picklist'),'defaultValue':_0x2494('0x1')},'content':{'type':Sequelize[_0x2494('0x5')]},'key':{'type':Sequelize[_0x2494('0x5')]},'keyType':{'type':Sequelize[_0x2494('0x0')](_0x2494('0x1'),_0x2494('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2494('0x5')]},'nameField':{'type':Sequelize[_0x2494('0x5')]},'customField':{'type':Sequelize[_0x2494('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2494('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 135f6f6..76fa7f3 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 _0xeb18=['sox','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','ZohoField','findAll','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1bf301,_0x1ae475){var _0x46c700=function(_0x4eb3f3){while(--_0x4eb3f3){_0x1bf301['push'](_0x1bf301['shift']());}};_0x46c700(++_0x1ae475);}(_0xeb18,0xd8));var _0x8eb1=function(_0x4a11a9,_0x292eb6){_0x4a11a9=_0x4a11a9-0x0;var _0x3b2e98=_0xeb18[_0x4a11a9];return _0x3b2e98;};'use strict';var emlformat=require(_0x8eb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8eb1('0x1'));var jsonpatch=require(_0x8eb1('0x2'));var rp=require(_0x8eb1('0x3'));var moment=require(_0x8eb1('0x4'));var BPromise=require(_0x8eb1('0x5'));var Mustache=require(_0x8eb1('0x6'));var util=require(_0x8eb1('0x7'));var path=require(_0x8eb1('0x8'));var sox=require(_0x8eb1('0x9'));var csv=require('to-csv');var ejs=require(_0x8eb1('0xa'));var fs=require('fs');var fs_extra=require(_0x8eb1('0xb'));var _=require(_0x8eb1('0xc'));var squel=require(_0x8eb1('0xd'));var crypto=require(_0x8eb1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8eb1('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eb1('0x10'));var qs=require(_0x8eb1('0x11'));var as=require(_0x8eb1('0x12'));var hardwareService=require(_0x8eb1('0x13'));var logger=require('../../config/logger')(_0x8eb1('0x14'));var utils=require(_0x8eb1('0x15'));var config=require(_0x8eb1('0x16'));var licenseUtil=require(_0x8eb1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24953e,_0x75b4dc){_0x75b4dc=_0x75b4dc||0xcc;return function(_0x1c08e9){if(_0x1c08e9){return _0x24953e[_0x8eb1('0x18')](_0x75b4dc);}return _0x24953e['status'](_0x75b4dc)['end']();};}function respondWithResult(_0x4af56d,_0x1cb315){_0x1cb315=_0x1cb315||0xc8;return function(_0x3f9142){if(_0x3f9142){return _0x4af56d[_0x8eb1('0x19')](_0x1cb315)[_0x8eb1('0x1a')](_0x3f9142);}};}function respondWithFilteredResult(_0x40dc96,_0x282ef4){return function(_0xf3a7a4){if(_0xf3a7a4){var _0x55adc7=typeof _0x282ef4[_0x8eb1('0x1b')]===_0x8eb1('0x1c')&&typeof _0x282ef4['limit']===_0x8eb1('0x1c');var _0x36cc11=_0xf3a7a4[_0x8eb1('0x1d')];var _0x40e1f0=_0x55adc7?0x0:_0x282ef4[_0x8eb1('0x1b')];var _0x3915dd=_0x55adc7?_0xf3a7a4[_0x8eb1('0x1d')]:_0x282ef4[_0x8eb1('0x1b')]+_0x282ef4[_0x8eb1('0x1e')];var _0x1cfea7;if(_0x3915dd>=_0x36cc11){_0x3915dd=_0x36cc11;_0x1cfea7=0xc8;}else{_0x1cfea7=0xce;}_0x40dc96[_0x8eb1('0x19')](_0x1cfea7);return _0x40dc96['set'](_0x8eb1('0x1f'),_0x40e1f0+'-'+_0x3915dd+'/'+_0x36cc11)['json'](_0xf3a7a4);}return null;};}function patchUpdates(_0x21f2a5){return function(_0x4d2df5){try{jsonpatch[_0x8eb1('0x20')](_0x4d2df5,_0x21f2a5,!![]);}catch(_0x52fe01){return BPromise[_0x8eb1('0x21')](_0x52fe01);}return _0x4d2df5[_0x8eb1('0x22')]();};}function saveUpdates(_0x882323,_0x11483a){return function(_0x523567){if(_0x523567){return _0x523567[_0x8eb1('0x23')](_0x882323)[_0x8eb1('0x24')](function(_0x58fcbe){return _0x58fcbe;});}return null;};}function removeEntity(_0x474ee8,_0x282243){return function(_0x577d0a){if(_0x577d0a){return _0x577d0a[_0x8eb1('0x25')]()[_0x8eb1('0x24')](function(){_0x474ee8['status'](0xcc)[_0x8eb1('0x26')]();});}};}function handleEntityNotFound(_0x525d43,_0x46eb4e){return function(_0x27fec8){if(!_0x27fec8){_0x525d43['sendStatus'](0x194);}return _0x27fec8;};}function handleError(_0x5890d5,_0x2aa78c){_0x2aa78c=_0x2aa78c||0x1f4;return function(_0x20d093){logger[_0x8eb1('0x27')](_0x20d093[_0x8eb1('0x28')]);if(_0x20d093[_0x8eb1('0x29')]){delete _0x20d093[_0x8eb1('0x29')];}_0x5890d5[_0x8eb1('0x19')](_0x2aa78c)['send'](_0x20d093);};}exports['index']=function(_0xef661a,_0x10d038){var _0x427f11={},_0x2bf3e3={},_0xc8625={'count':0x0,'rows':[]};var _0x36236f=_[_0x8eb1('0x2a')](db['ZohoField'][_0x8eb1('0x2b')],function(_0x35c070){return{'name':_0x35c070[_0x8eb1('0x2c')],'type':_0x35c070[_0x8eb1('0x2d')][_0x8eb1('0x2e')]};});_0x2bf3e3[_0x8eb1('0x2f')]=_['map'](_0x36236f,_0x8eb1('0x29'));_0x2bf3e3[_0x8eb1('0x30')]=_['keys'](_0xef661a[_0x8eb1('0x30')]);_0x2bf3e3['filters']=_['intersection'](_0x2bf3e3[_0x8eb1('0x2f')],_0x2bf3e3[_0x8eb1('0x30')]);_0x427f11[_0x8eb1('0x31')]=_[_0x8eb1('0x32')](_0x2bf3e3['model'],qs[_0x8eb1('0x33')](_0xef661a[_0x8eb1('0x30')][_0x8eb1('0x33')]));_0x427f11[_0x8eb1('0x31')]=_0x427f11['attributes'][_0x8eb1('0x34')]?_0x427f11[_0x8eb1('0x31')]:_0x2bf3e3['model'];if(!_0xef661a[_0x8eb1('0x30')]['hasOwnProperty'](_0x8eb1('0x35'))){_0x427f11['limit']=qs[_0x8eb1('0x1e')](_0xef661a[_0x8eb1('0x30')][_0x8eb1('0x1e')]);_0x427f11['offset']=qs[_0x8eb1('0x1b')](_0xef661a[_0x8eb1('0x30')][_0x8eb1('0x1b')]);}_0x427f11[_0x8eb1('0x36')]=qs[_0x8eb1('0x37')](_0xef661a[_0x8eb1('0x30')][_0x8eb1('0x37')]);_0x427f11[_0x8eb1('0x38')]=qs[_0x8eb1('0x39')](_[_0x8eb1('0x3a')](_0xef661a[_0x8eb1('0x30')],_0x2bf3e3[_0x8eb1('0x39')]),_0x36236f);if(_0xef661a[_0x8eb1('0x30')][_0x8eb1('0x3b')]){_0x427f11[_0x8eb1('0x38')]=_[_0x8eb1('0x3c')](_0x427f11['where'],{'$or':_[_0x8eb1('0x2a')](_0x36236f,function(_0xc4eddf){if(_0xc4eddf[_0x8eb1('0x2d')]!==_0x8eb1('0x3d')){var _0x54de75={};_0x54de75[_0xc4eddf[_0x8eb1('0x29')]]={'$like':'%'+_0xef661a[_0x8eb1('0x30')][_0x8eb1('0x3b')]+'%'};return _0x54de75;}})});}_0x427f11=_['merge']({},_0x427f11,_0xef661a[_0x8eb1('0x3e')]);var _0x595ea7={'where':_0x427f11[_0x8eb1('0x38')]};return db['ZohoField']['count'](_0x595ea7)[_0x8eb1('0x24')](function(_0x4dc5cd){_0xc8625[_0x8eb1('0x1d')]=_0x4dc5cd;if(_0xef661a['query'][_0x8eb1('0x3f')]){_0x427f11[_0x8eb1('0x40')]=[{'all':!![]}];}return db[_0x8eb1('0x41')][_0x8eb1('0x42')](_0x427f11);})[_0x8eb1('0x24')](function(_0x19db12){_0xc8625[_0x8eb1('0x43')]=_0x19db12;return _0xc8625;})[_0x8eb1('0x24')](respondWithFilteredResult(_0x10d038,_0x427f11))[_0x8eb1('0x44')](handleError(_0x10d038,null));};exports[_0x8eb1('0x45')]=function(_0x4a6a0f,_0x468a18){var _0x5a0a52={'raw':!![],'where':{'id':_0x4a6a0f[_0x8eb1('0x46')]['id']}},_0x5af070={};_0x5af070[_0x8eb1('0x2f')]=_[_0x8eb1('0x47')](db[_0x8eb1('0x41')][_0x8eb1('0x2b')]);_0x5af070['query']=_[_0x8eb1('0x47')](_0x4a6a0f[_0x8eb1('0x30')]);_0x5af070[_0x8eb1('0x39')]=_[_0x8eb1('0x32')](_0x5af070[_0x8eb1('0x2f')],_0x5af070['query']);_0x5a0a52[_0x8eb1('0x31')]=_[_0x8eb1('0x32')](_0x5af070[_0x8eb1('0x2f')],qs[_0x8eb1('0x33')](_0x4a6a0f[_0x8eb1('0x30')]['fields']));_0x5a0a52[_0x8eb1('0x31')]=_0x5a0a52[_0x8eb1('0x31')][_0x8eb1('0x34')]?_0x5a0a52[_0x8eb1('0x31')]:_0x5af070[_0x8eb1('0x2f')];if(_0x4a6a0f['query']['includeAll']){_0x5a0a52[_0x8eb1('0x40')]=[{'all':!![]}];}_0x5a0a52=_[_0x8eb1('0x3c')]({},_0x5a0a52,_0x4a6a0f[_0x8eb1('0x3e')]);return db[_0x8eb1('0x41')][_0x8eb1('0x48')](_0x5a0a52)[_0x8eb1('0x24')](handleEntityNotFound(_0x468a18,null))[_0x8eb1('0x24')](respondWithResult(_0x468a18,null))[_0x8eb1('0x44')](handleError(_0x468a18,null));};exports[_0x8eb1('0x49')]=function(_0x2ae5ba,_0x164e08){return db['ZohoField'][_0x8eb1('0x49')](_0x2ae5ba[_0x8eb1('0x4a')],{})[_0x8eb1('0x24')](respondWithResult(_0x164e08,0xc9))['catch'](handleError(_0x164e08,null));};exports[_0x8eb1('0x23')]=function(_0x2f6cba,_0x2e8872){if(_0x2f6cba[_0x8eb1('0x4a')]['id']){delete _0x2f6cba[_0x8eb1('0x4a')]['id'];}return db[_0x8eb1('0x41')]['find']({'where':{'id':_0x2f6cba[_0x8eb1('0x46')]['id']}})[_0x8eb1('0x24')](handleEntityNotFound(_0x2e8872,null))[_0x8eb1('0x24')](saveUpdates(_0x2f6cba[_0x8eb1('0x4a')],null))['then'](respondWithResult(_0x2e8872,null))[_0x8eb1('0x44')](handleError(_0x2e8872,null));};exports[_0x8eb1('0x25')]=function(_0x55236c,_0xa15e4e){return db[_0x8eb1('0x41')][_0x8eb1('0x48')]({'where':{'id':_0x55236c[_0x8eb1('0x46')]['id']}})[_0x8eb1('0x24')](handleEntityNotFound(_0xa15e4e,null))[_0x8eb1('0x24')](removeEntity(_0xa15e4e,null))[_0x8eb1('0x44')](handleError(_0xa15e4e,null));}; \ No newline at end of file +var _0x21de=['key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','ZohoField','rawAttributes','type'];(function(_0x30c435,_0x419dbf){var _0x1f8ff4=function(_0x446ed0){while(--_0x446ed0){_0x30c435['push'](_0x30c435['shift']());}};_0x1f8ff4(++_0x419dbf);}(_0x21de,0x68));var _0xe21d=function(_0x3bf1e0,_0x1580be){_0x3bf1e0=_0x3bf1e0-0x0;var _0x5a9ded=_0x21de[_0x3bf1e0];return _0x5a9ded;};'use strict';var emlformat=require(_0xe21d('0x0'));var rimraf=require(_0xe21d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe21d('0x2'));var rp=require(_0xe21d('0x3'));var moment=require(_0xe21d('0x4'));var BPromise=require(_0xe21d('0x5'));var Mustache=require(_0xe21d('0x6'));var util=require(_0xe21d('0x7'));var path=require(_0xe21d('0x8'));var sox=require(_0xe21d('0x9'));var csv=require(_0xe21d('0xa'));var ejs=require(_0xe21d('0xb'));var fs=require('fs');var fs_extra=require(_0xe21d('0xc'));var _=require(_0xe21d('0xd'));var squel=require('squel');var crypto=require(_0xe21d('0xe'));var jsforce=require(_0xe21d('0xf'));var deskjs=require(_0xe21d('0x10'));var toCsv=require(_0xe21d('0xa'));var querystring=require(_0xe21d('0x11'));var Papa=require(_0xe21d('0x12'));var Redis=require(_0xe21d('0x13'));var authService=require(_0xe21d('0x14'));var qs=require(_0xe21d('0x15'));var as=require(_0xe21d('0x16'));var hardwareService=require(_0xe21d('0x17'));var logger=require('../../config/logger')(_0xe21d('0x18'));var utils=require('../../config/utils');var config=require(_0xe21d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe21d('0x1a'))['db'];function respondWithStatusCode(_0x371ba2,_0x3a49c2){_0x3a49c2=_0x3a49c2||0xcc;return function(_0x2b9c6b){if(_0x2b9c6b){return _0x371ba2[_0xe21d('0x1b')](_0x3a49c2);}return _0x371ba2[_0xe21d('0x1c')](_0x3a49c2)['end']();};}function respondWithResult(_0x4ef10c,_0x52c779){_0x52c779=_0x52c779||0xc8;return function(_0x1b28e3){if(_0x1b28e3){return _0x4ef10c['status'](_0x52c779)[_0xe21d('0x1d')](_0x1b28e3);}};}function respondWithFilteredResult(_0x333e00,_0x4c0d35){return function(_0x303299){if(_0x303299){var _0x153e13=typeof _0x4c0d35['offset']===_0xe21d('0x1e')&&typeof _0x4c0d35[_0xe21d('0x1f')]==='undefined';var _0x3d09ef=_0x303299[_0xe21d('0x20')];var _0x3d470b=_0x153e13?0x0:_0x4c0d35[_0xe21d('0x21')];var _0xf4c4e4=_0x153e13?_0x303299[_0xe21d('0x20')]:_0x4c0d35[_0xe21d('0x21')]+_0x4c0d35[_0xe21d('0x1f')];var _0x3ed583;if(_0xf4c4e4>=_0x3d09ef){_0xf4c4e4=_0x3d09ef;_0x3ed583=0xc8;}else{_0x3ed583=0xce;}_0x333e00[_0xe21d('0x1c')](_0x3ed583);return _0x333e00[_0xe21d('0x22')](_0xe21d('0x23'),_0x3d470b+'-'+_0xf4c4e4+'/'+_0x3d09ef)[_0xe21d('0x1d')](_0x303299);}return null;};}function patchUpdates(_0x3a8ee7){return function(_0x4e12c8){try{jsonpatch[_0xe21d('0x24')](_0x4e12c8,_0x3a8ee7,!![]);}catch(_0x29e4dc){return BPromise[_0xe21d('0x25')](_0x29e4dc);}return _0x4e12c8['save']();};}function saveUpdates(_0x25022a,_0x49ad51){return function(_0xc5cb0f){if(_0xc5cb0f){return _0xc5cb0f['update'](_0x25022a)[_0xe21d('0x26')](function(_0x24c8a2){return _0x24c8a2;});}return null;};}function removeEntity(_0x2fc80b,_0x3a13b7){return function(_0x9c7a08){if(_0x9c7a08){return _0x9c7a08[_0xe21d('0x27')]()[_0xe21d('0x26')](function(){_0x2fc80b[_0xe21d('0x1c')](0xcc)[_0xe21d('0x28')]();});}};}function handleEntityNotFound(_0x209691,_0x8b8a29){return function(_0x26524e){if(!_0x26524e){_0x209691[_0xe21d('0x1b')](0x194);}return _0x26524e;};}function handleError(_0x411598,_0x28c26a){_0x28c26a=_0x28c26a||0x1f4;return function(_0x22f414){logger[_0xe21d('0x29')](_0x22f414[_0xe21d('0x2a')]);if(_0x22f414[_0xe21d('0x2b')]){delete _0x22f414[_0xe21d('0x2b')];}_0x411598[_0xe21d('0x1c')](_0x28c26a)[_0xe21d('0x2c')](_0x22f414);};}exports[_0xe21d('0x2d')]=function(_0x40e994,_0x234cb2){var _0x13e147={},_0x4d0e44={},_0x11ceef={'count':0x0,'rows':[]};var _0x4c19a9=_[_0xe21d('0x2e')](db[_0xe21d('0x2f')][_0xe21d('0x30')],function(_0x2c8b57){return{'name':_0x2c8b57['fieldName'],'type':_0x2c8b57[_0xe21d('0x31')][_0xe21d('0x32')]};});_0x4d0e44['model']=_['map'](_0x4c19a9,'name');_0x4d0e44[_0xe21d('0x33')]=_[_0xe21d('0x34')](_0x40e994[_0xe21d('0x33')]);_0x4d0e44['filters']=_[_0xe21d('0x35')](_0x4d0e44['model'],_0x4d0e44[_0xe21d('0x33')]);_0x13e147[_0xe21d('0x36')]=_[_0xe21d('0x35')](_0x4d0e44[_0xe21d('0x37')],qs[_0xe21d('0x38')](_0x40e994[_0xe21d('0x33')][_0xe21d('0x38')]));_0x13e147[_0xe21d('0x36')]=_0x13e147[_0xe21d('0x36')][_0xe21d('0x39')]?_0x13e147[_0xe21d('0x36')]:_0x4d0e44[_0xe21d('0x37')];if(!_0x40e994[_0xe21d('0x33')][_0xe21d('0x3a')](_0xe21d('0x3b'))){_0x13e147['limit']=qs[_0xe21d('0x1f')](_0x40e994[_0xe21d('0x33')][_0xe21d('0x1f')]);_0x13e147[_0xe21d('0x21')]=qs[_0xe21d('0x21')](_0x40e994[_0xe21d('0x33')][_0xe21d('0x21')]);}_0x13e147[_0xe21d('0x3c')]=qs['sort'](_0x40e994[_0xe21d('0x33')]['sort']);_0x13e147[_0xe21d('0x3d')]=qs['filters'](_[_0xe21d('0x3e')](_0x40e994[_0xe21d('0x33')],_0x4d0e44[_0xe21d('0x3f')]),_0x4c19a9);if(_0x40e994[_0xe21d('0x33')][_0xe21d('0x40')]){_0x13e147[_0xe21d('0x3d')]=_[_0xe21d('0x41')](_0x13e147[_0xe21d('0x3d')],{'$or':_['map'](_0x4c19a9,function(_0x2272f1){if(_0x2272f1['type']!==_0xe21d('0x42')){var _0x29c5cf={};_0x29c5cf[_0x2272f1[_0xe21d('0x2b')]]={'$like':'%'+_0x40e994[_0xe21d('0x33')][_0xe21d('0x40')]+'%'};return _0x29c5cf;}})});}_0x13e147=_['merge']({},_0x13e147,_0x40e994[_0xe21d('0x43')]);var _0x286593={'where':_0x13e147['where']};return db['ZohoField'][_0xe21d('0x20')](_0x286593)['then'](function(_0x43e391){_0x11ceef['count']=_0x43e391;if(_0x40e994[_0xe21d('0x33')]['includeAll']){_0x13e147[_0xe21d('0x44')]=[{'all':!![]}];}return db['ZohoField'][_0xe21d('0x45')](_0x13e147);})[_0xe21d('0x26')](function(_0xdee2e4){_0x11ceef[_0xe21d('0x46')]=_0xdee2e4;return _0x11ceef;})[_0xe21d('0x26')](respondWithFilteredResult(_0x234cb2,_0x13e147))[_0xe21d('0x47')](handleError(_0x234cb2,null));};exports[_0xe21d('0x48')]=function(_0x15837b,_0x48bcca){var _0x1e5de0={'raw':!![],'where':{'id':_0x15837b[_0xe21d('0x49')]['id']}},_0x124c67={};_0x124c67[_0xe21d('0x37')]=_['keys'](db['ZohoField'][_0xe21d('0x30')]);_0x124c67[_0xe21d('0x33')]=_[_0xe21d('0x34')](_0x15837b[_0xe21d('0x33')]);_0x124c67['filters']=_[_0xe21d('0x35')](_0x124c67[_0xe21d('0x37')],_0x124c67[_0xe21d('0x33')]);_0x1e5de0[_0xe21d('0x36')]=_[_0xe21d('0x35')](_0x124c67[_0xe21d('0x37')],qs['fields'](_0x15837b[_0xe21d('0x33')]['fields']));_0x1e5de0[_0xe21d('0x36')]=_0x1e5de0[_0xe21d('0x36')][_0xe21d('0x39')]?_0x1e5de0[_0xe21d('0x36')]:_0x124c67['model'];if(_0x15837b[_0xe21d('0x33')]['includeAll']){_0x1e5de0[_0xe21d('0x44')]=[{'all':!![]}];}_0x1e5de0=_[_0xe21d('0x41')]({},_0x1e5de0,_0x15837b[_0xe21d('0x43')]);return db[_0xe21d('0x2f')][_0xe21d('0x4a')](_0x1e5de0)[_0xe21d('0x26')](handleEntityNotFound(_0x48bcca,null))[_0xe21d('0x26')](respondWithResult(_0x48bcca,null))['catch'](handleError(_0x48bcca,null));};exports[_0xe21d('0x4b')]=function(_0x2f133d,_0x3f1c80){return db['ZohoField'][_0xe21d('0x4b')](_0x2f133d[_0xe21d('0x4c')],{})[_0xe21d('0x26')](respondWithResult(_0x3f1c80,0xc9))[_0xe21d('0x47')](handleError(_0x3f1c80,null));};exports['update']=function(_0x16905d,_0x231099){if(_0x16905d[_0xe21d('0x4c')]['id']){delete _0x16905d[_0xe21d('0x4c')]['id'];}return db[_0xe21d('0x2f')][_0xe21d('0x4a')]({'where':{'id':_0x16905d[_0xe21d('0x49')]['id']}})[_0xe21d('0x26')](handleEntityNotFound(_0x231099,null))['then'](saveUpdates(_0x16905d[_0xe21d('0x4c')],null))[_0xe21d('0x26')](respondWithResult(_0x231099,null))[_0xe21d('0x47')](handleError(_0x231099,null));};exports[_0xe21d('0x27')]=function(_0x125bc6,_0x4148e0){return db[_0xe21d('0x2f')][_0xe21d('0x4a')]({'where':{'id':_0x125bc6['params']['id']}})['then'](handleEntityNotFound(_0x4148e0,null))[_0xe21d('0x26')](removeEntity(_0x4148e0,null))['catch'](handleError(_0x4148e0,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8f97c46..c24a900 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 _0x7b84=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x561737,_0x5902e4){var _0x2bbf6f=function(_0x282fb8){while(--_0x282fb8){_0x561737['push'](_0x561737['shift']());}};_0x2bbf6f(++_0x5902e4);}(_0x7b84,0x17c));var _0x47b8=function(_0x5019ad,_0x5002aa){_0x5019ad=_0x5019ad-0x0;var _0xd76908=_0x7b84[_0x5019ad];return _0xd76908;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var logger=require(_0x47b8('0x2'))(_0x47b8('0x3'));var moment=require(_0x47b8('0x4'));var BPromise=require(_0x47b8('0x5'));var rp=require(_0x47b8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var attributes=require(_0x47b8('0x9'));module[_0x47b8('0xa')]=function(_0x2e6853,_0xafe88a){return _0x2e6853['define'](_0x47b8('0xb'),attributes,{'tableName':_0x47b8('0xc'),'paranoid':![],'indexes':[{'name':_0x47b8('0xd'),'fields':[_0x47b8('0xe'),_0x47b8('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7046=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','ZohoField','idField'];(function(_0x281636,_0x569642){var _0x7274c8=function(_0x48b50c){while(--_0x48b50c){_0x281636['push'](_0x281636['shift']());}};_0x7274c8(++_0x569642);}(_0x7046,0x144));var _0x6704=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7046[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x6704('0xb'),'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 c5741f0..3cb56a8 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 _0xfb85=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0xfb85,0x1ea));var _0x5fb8=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xfb85[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x5fb8('0x0'));var util=require(_0x5fb8('0x1'));var moment=require(_0x5fb8('0x2'));var BPromise=require(_0x5fb8('0x3'));var rs=require(_0x5fb8('0x4'));var fs=require('fs');var Redis=require(_0x5fb8('0x5'));var db=require(_0x5fb8('0x6'))['db'];var utils=require(_0x5fb8('0x7'));var logger=require(_0x5fb8('0x8'))(_0x5fb8('0x9'));var config=require(_0x5fb8('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5fb8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x577ce2,_0x480f3b,_0x5c2ea3){return new BPromise(function(_0x3583f9,_0x28db8c){return client['request'](_0x577ce2,_0x5c2ea3)[_0x5fb8('0xc')](function(_0x16ea15){logger[_0x5fb8('0xd')]('ZohoField,\x20%s,\x20%s',_0x480f3b,_0x5fb8('0xe'));logger[_0x5fb8('0xf')](_0x5fb8('0x10'),_0x480f3b,_0x5fb8('0xe'),JSON[_0x5fb8('0x11')](_0x16ea15));if(_0x16ea15['error']){if(_0x16ea15[_0x5fb8('0x12')]['code']===0x1f4){logger[_0x5fb8('0x12')](_0x5fb8('0x13'),_0x480f3b,_0x16ea15[_0x5fb8('0x12')][_0x5fb8('0x14')]);return _0x28db8c(_0x16ea15['error'][_0x5fb8('0x14')]);}logger[_0x5fb8('0x12')](_0x5fb8('0x13'),_0x480f3b,_0x16ea15[_0x5fb8('0x12')][_0x5fb8('0x14')]);return _0x3583f9(_0x16ea15[_0x5fb8('0x12')][_0x5fb8('0x14')]);}else{logger[_0x5fb8('0xd')](_0x5fb8('0x13'),_0x480f3b,_0x5fb8('0xe'));_0x3583f9(_0x16ea15['result']['message']);}})[_0x5fb8('0x15')](function(_0x19399b){logger['error'](_0x5fb8('0x13'),_0x480f3b,_0x19399b);_0x28db8c(_0x19399b);});});} \ No newline at end of file +var _0xeb57=['../../config/environment','jayson/promise','client','http','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x33ea28,_0x28848e){var _0x58f859=function(_0x5cebac){while(--_0x5cebac){_0x33ea28['push'](_0x33ea28['shift']());}};_0x58f859(++_0x28848e);}(_0xeb57,0x18f));var _0x7eb5=function(_0x3d1c73,_0x493643){_0x3d1c73=_0x3d1c73-0x0;var _0x159db3=_0xeb57[_0x3d1c73];return _0x159db3;};'use strict';var _=require(_0x7eb5('0x0'));var util=require(_0x7eb5('0x1'));var moment=require(_0x7eb5('0x2'));var BPromise=require(_0x7eb5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7eb5('0x4'));var db=require(_0x7eb5('0x5'))['db'];var utils=require(_0x7eb5('0x6'));var logger=require(_0x7eb5('0x7'))(_0x7eb5('0x8'));var config=require(_0x7eb5('0x9'));var jayson=require(_0x7eb5('0xa'));var client=jayson[_0x7eb5('0xb')][_0x7eb5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x389f4d,_0x3be9b9,_0x248257){return new BPromise(function(_0x5d6177,_0x4dca70){return client['request'](_0x389f4d,_0x248257)[_0x7eb5('0xd')](function(_0x16bfa7){logger['info'](_0x7eb5('0xe'),_0x3be9b9,_0x7eb5('0xf'));logger[_0x7eb5('0x10')](_0x7eb5('0x11'),_0x3be9b9,_0x7eb5('0xf'),JSON[_0x7eb5('0x12')](_0x16bfa7));if(_0x16bfa7[_0x7eb5('0x13')]){if(_0x16bfa7[_0x7eb5('0x13')][_0x7eb5('0x14')]===0x1f4){logger[_0x7eb5('0x13')](_0x7eb5('0xe'),_0x3be9b9,_0x16bfa7[_0x7eb5('0x13')][_0x7eb5('0x15')]);return _0x4dca70(_0x16bfa7[_0x7eb5('0x13')][_0x7eb5('0x15')]);}logger['error'](_0x7eb5('0xe'),_0x3be9b9,_0x16bfa7[_0x7eb5('0x13')]['message']);return _0x5d6177(_0x16bfa7[_0x7eb5('0x13')]['message']);}else{logger['info'](_0x7eb5('0xe'),_0x3be9b9,_0x7eb5('0xf'));_0x5d6177(_0x16bfa7[_0x7eb5('0x16')]['message']);}})[_0x7eb5('0x17')](function(_0x10e51d){logger['error']('ZohoField,\x20%s,\x20%s',_0x3be9b9,_0x10e51d);_0x4dca70(_0x10e51d);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 84dc39c..a3fd63d 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x47faab,_0x2f0254){var _0x392a8b=function(_0xdbe4f5){while(--_0xdbe4f5){_0x47faab['push'](_0x47faab['shift']());}};_0x392a8b(++_0x2f0254);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x499b07,_0x55455a){var _0x3ddfdd=function(_0x19f5d0){while(--_0x19f5d0){_0x499b07['push'](_0x499b07['shift']());}};_0x3ddfdd(++_0x55455a);}(_0x70e0,0x17b));var _0x070e=function(_0x259c32,_0x580e46){_0x259c32=_0x259c32-0x0;var _0x5c1fbb=_0x70e0[_0x259c32];return _0x5c1fbb;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 9533267..5d77e73 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 _0x9071=['BOOLEAN','state','sequelize','STRING','unique_name_and_version'];(function(_0x567943,_0x4991f4){var _0x5cfd0e=function(_0x26f78c){while(--_0x26f78c){_0x567943['push'](_0x567943['shift']());}};_0x5cfd0e(++_0x4991f4);}(_0x9071,0x6b));var _0x1907=function(_0x3986a5,_0x13354f){_0x3986a5=_0x3986a5-0x0;var _0x43c135=_0x9071[_0x3986a5];return _0x43c135;};'use strict';var Sequelize=require(_0x1907('0x0'));module['exports']={'name':{'type':Sequelize[_0x1907('0x1')],'allowNull':![],'unique':_0x1907('0x2')},'version':{'type':Sequelize[_0x1907('0x1')],'allowNull':![],'unique':_0x1907('0x2')},'main':{'type':Sequelize[_0x1907('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x1907('0x1')]},'path':{'type':Sequelize[_0x1907('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x1907('0x3')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x1907('0x1')]},'state':{'type':Sequelize[_0x1907('0x1')],'unique':_0x1907('0x4')},'description':{'type':Sequelize[_0x1907('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1907('0x1')]},'link':{'type':Sequelize[_0x1907('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x43e4=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x29badc,_0x28449e){var _0x4abebb=function(_0x5e9b13){while(--_0x5e9b13){_0x29badc['push'](_0x29badc['shift']());}};_0x4abebb(++_0x28449e);}(_0x43e4,0x1cf));var _0x443e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x43e4[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0x443e('0x0'));module[_0x443e('0x1')]={'name':{'type':Sequelize[_0x443e('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x443e('0x2')],'allowNull':![],'unique':_0x443e('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x443e('0x4')},'filename':{'type':Sequelize[_0x443e('0x2')]},'path':{'type':Sequelize[_0x443e('0x2')]},'type':{'type':Sequelize[_0x443e('0x2')]},'size':{'type':Sequelize[_0x443e('0x5')]},'active':{'type':Sequelize[_0x443e('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x443e('0x2')]},'logo':{'type':Sequelize[_0x443e('0x2')]},'state':{'type':Sequelize[_0x443e('0x2')],'unique':_0x443e('0x7')},'description':{'type':Sequelize[_0x443e('0x2')]},'title':{'type':Sequelize[_0x443e('0x2')]},'remoteUri':{'type':Sequelize[_0x443e('0x2')]},'link':{'type':Sequelize[_0x443e('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 d195947..65f5514 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 _0x1a85=['includeAll','find','create','body','params','destroy','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','Integration','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'];(function(_0x5ebe5f,_0x38b557){var _0x4b1e13=function(_0x2a89e3){while(--_0x2a89e3){_0x5ebe5f['push'](_0x5ebe5f['shift']());}};_0x4b1e13(++_0x38b557);}(_0x1a85,0x178));var _0x51a8=function(_0x320c90,_0x515e0a){_0x320c90=_0x320c90-0x0;var _0x4b8824=_0x1a85[_0x320c90];return _0x4b8824;};'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['Integration'][_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));}; \ No newline at end of file +var _0xd943=['mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../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','index','Integration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x50a40f,_0x348dd1){var _0x256146=function(_0x5d0cb3){while(--_0x5d0cb3){_0x50a40f['push'](_0x50a40f['shift']());}};_0x256146(++_0x348dd1);}(_0xd943,0x15d));var _0x3d94=function(_0x3dd117,_0x42b05a){_0x3dd117=_0x3dd117-0x0;var _0x25590c=_0xd943[_0x3dd117];return _0x25590c;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 5689d92..d1abf17 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 _0xf58a=['./integration.attributes','exports','define','integrations','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x448f50,_0x5587ba){var _0x2af4c3=function(_0x5f2616){while(--_0x5f2616){_0x448f50['push'](_0x448f50['shift']());}};_0x2af4c3(++_0x5587ba);}(_0xf58a,0x159));var _0xaf58=function(_0xad55e2,_0x4ed37e){_0xad55e2=_0xad55e2-0x0;var _0x1973ce=_0xf58a[_0xad55e2];return _0x1973ce;};'use strict';var _=require(_0xaf58('0x0'));var util=require('util');var logger=require(_0xaf58('0x1'))(_0xaf58('0x2'));var moment=require('moment');var BPromise=require(_0xaf58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf58('0x4'));var rimraf=require(_0xaf58('0x5'));var config=require(_0xaf58('0x6'));var attributes=require(_0xaf58('0x7'));module[_0xaf58('0x8')]=function(_0x5750e3,_0x4b6b13){return _0x5750e3[_0xaf58('0x9')]('Integration',attributes,{'tableName':_0xaf58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc2c=['api','request-promise','rimraf','../../config/environment','./integration.attributes','define','Integration','util','../../config/logger'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0xcc2c,0x103));var _0xccc2=function(_0x28014e,_0x57bcdd){_0x28014e=_0x28014e-0x0;var _0x1f3664=_0xcc2c[_0x28014e];return _0x1f3664;};'use strict';var _=require('lodash');var util=require(_0xccc2('0x0'));var logger=require(_0xccc2('0x1'))(_0xccc2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xccc2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccc2('0x4'));var config=require(_0xccc2('0x5'));var attributes=require(_0xccc2('0x6'));module['exports']=function(_0x5a2c76,_0x4e6e15){return _0x5a2c76[_0xccc2('0x7')](_0xccc2('0x8'),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 e3b08ea..161b519 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 _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x488358,_0x211c55){var _0x18a9aa=function(_0x5defa7){while(--_0x5defa7){_0x488358['push'](_0x488358['shift']());}};_0x18a9aa(++_0x211c55);}(_0x7880,0x1f4));var _0x0788=function(_0x2d5dcf,_0xf71498){_0x2d5dcf=_0x2d5dcf-0x0;var _0x42a3e8=_0x7880[_0x2d5dcf];return _0x42a3e8;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file +var _0xdd4f=['lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x937a53,_0x214230){var _0x5cdf18=function(_0x3029cb){while(--_0x3029cb){_0x937a53['push'](_0x937a53['shift']());}};_0x5cdf18(++_0x214230);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2c6ae7,_0x56a025){_0x2c6ae7=_0x2c6ae7-0x0;var _0x46265e=_0xdd4f[_0x2c6ae7];return _0x46265e;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 94fc992..c3ed2d7 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 _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x0295,0x1f0));var _0x5029=function(_0x1e6737,_0x3a00b9){_0x1e6737=_0x1e6737-0x0;var _0x13209b=_0x0295[_0x1e6737];return _0x13209b;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file +var _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 851a175..e5be81e 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 _0x02d3=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x02d3,0xe6));var _0x302d=function(_0x638638,_0x34585e){_0x638638=_0x638638-0x0;var _0x3651ee=_0x02d3[_0x638638];return _0x3651ee;};'use strict';var Sequelize=require(_0x302d('0x0'));module[_0x302d('0x1')]={'integration':{'type':Sequelize[_0x302d('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x302d('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x302d('0x3')]},'contacts':{'type':Sequelize[_0x302d('0x2')]},'uniqueid':{'type':Sequelize[_0x302d('0x2')]},'calleridnum':{'type':Sequelize[_0x302d('0x2')]},'calleridname':{'type':Sequelize[_0x302d('0x2')]},'queue':{'type':Sequelize[_0x302d('0x2')]},'interface':{'type':Sequelize[_0x302d('0x2')]},'membername':{'type':Sequelize[_0x302d('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x302d('0x4')]},'holdtime':{'type':Sequelize[_0x302d('0x3')]},'agentcomplete':{'type':Sequelize[_0x302d('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x302d('0x4')]},'talktime':{'type':Sequelize[_0x302d('0x3')]},'agentacw':{'type':Sequelize[_0x302d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x302d('0x3')]},'reason':{'type':Sequelize[_0x302d('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x302d('0x4')]},'agentdump':{'type':Sequelize[_0x302d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x302d('0x4')]},'lastevent':{'type':Sequelize[_0x302d('0x2')]},'channel':{'type':Sequelize[_0x302d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x302d('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x302d('0x2')]},'language':{'type':Sequelize[_0x302d('0x2')]},'accountcode':{'type':Sequelize[_0x302d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x302d('0x2')]},'priority':{'type':Sequelize[_0x302d('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x302d('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x302d('0x2')]},'destlanguage':{'type':Sequelize[_0x302d('0x2')]},'destaccountcode':{'type':Sequelize[_0x302d('0x2')]},'destcontext':{'type':Sequelize[_0x302d('0x2')]},'destexten':{'type':Sequelize[_0x302d('0x2')]},'destpriority':{'type':Sequelize[_0x302d('0x2')]},'destuniqueid':{'type':Sequelize[_0x302d('0x2')]},'messageId':{'type':Sequelize[_0x302d('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x302d('0x2')]},'from':{'type':Sequelize[_0x302d('0x2')]},'to':{'type':Sequelize[_0x302d('0x2')]},'cc':{'type':Sequelize[_0x302d('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x302d('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x302d('0x7'),_0x302d('0x8'),_0x302d('0x9'),_0x302d('0xa'))},'url':{'type':Sequelize[_0x302d('0x2')]},'app':{'type':Sequelize[_0x302d('0x2')]},'appdata':{'type':Sequelize[_0x302d('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4201=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x5adc07,_0x58feec){var _0x232940=function(_0x44429b){while(--_0x44429b){_0x5adc07['push'](_0x5adc07['shift']());}};_0x232940(++_0x58feec);}(_0x4201,0x102));var _0x1420=function(_0x9ea933,_0x565d76){_0x9ea933=_0x9ea933-0x0;var _0x4fdcd0=_0x4201[_0x9ea933];return _0x4fdcd0;};'use strict';var Sequelize=require(_0x1420('0x0'));module[_0x1420('0x1')]={'integration':{'type':Sequelize[_0x1420('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x1420('0x2')]},'ticketId':{'type':Sequelize[_0x1420('0x2')]},'integrationId':{'type':Sequelize[_0x1420('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1420('0x2')]},'calleridname':{'type':Sequelize[_0x1420('0x2')]},'queue':{'type':Sequelize[_0x1420('0x2')]},'interface':{'type':Sequelize[_0x1420('0x2')]},'membername':{'type':Sequelize[_0x1420('0x2')]},'agentcalledAt':{'type':Sequelize[_0x1420('0x4')]},'agentconnectAt':{'type':Sequelize[_0x1420('0x4')]},'holdtime':{'type':Sequelize[_0x1420('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1420('0x4')]},'talktime':{'type':Sequelize[_0x1420('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x1420('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x1420('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1420('0x4')]},'agentdump':{'type':Sequelize[_0x1420('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1420('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x1420('0x3')]},'channelstatedesc':{'type':Sequelize[_0x1420('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x1420('0x2')]},'language':{'type':Sequelize[_0x1420('0x2')]},'accountcode':{'type':Sequelize[_0x1420('0x2')]},'context':{'type':Sequelize[_0x1420('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1420('0x2')]},'destchannel':{'type':Sequelize[_0x1420('0x2')]},'destchannelstate':{'type':Sequelize[_0x1420('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x1420('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1420('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x1420('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1420('0x2')]},'destlanguage':{'type':Sequelize[_0x1420('0x2')]},'destaccountcode':{'type':Sequelize[_0x1420('0x2')]},'destcontext':{'type':Sequelize[_0x1420('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x1420('0x2')]},'destuniqueid':{'type':Sequelize[_0x1420('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x1420('0x2')]},'subject':{'type':Sequelize[_0x1420('0x2')]},'from':{'type':Sequelize[_0x1420('0x2')]},'to':{'type':Sequelize[_0x1420('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x1420('0x6')]},'html':{'type':Sequelize[_0x1420('0x6')]},'text':{'type':Sequelize[_0x1420('0x6')]},'status':{'type':Sequelize[_0x1420('0x7')](_0x1420('0x8'),_0x1420('0x9'),_0x1420('0xa'),_0x1420('0xb'))},'url':{'type':Sequelize[_0x1420('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x1420('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 99daa9a..d765c9f 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 _0x281d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x96bf96,_0x4434bb){var _0x273859=function(_0x87c55d){while(--_0x87c55d){_0x96bf96['push'](_0x96bf96['shift']());}};_0x273859(++_0x4434bb);}(_0x281d,0x87));var _0xd281=function(_0x338fe4,_0x20f78e){_0x338fe4=_0x338fe4-0x0;var _0x4ab615=_0x281d[_0x338fe4];return _0x4ab615;};'use strict';var emlformat=require(_0xd281('0x0'));var rimraf=require(_0xd281('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd281('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd281('0x3'));var util=require('util');var path=require('path');var sox=require(_0xd281('0x4'));var csv=require(_0xd281('0x5'));var ejs=require(_0xd281('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd281('0x7'));var squel=require('squel');var crypto=require(_0xd281('0x8'));var jsforce=require(_0xd281('0x9'));var deskjs=require(_0xd281('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd281('0xb'));var Papa=require(_0xd281('0xc'));var Redis=require(_0xd281('0xd'));var authService=require(_0xd281('0xe'));var qs=require(_0xd281('0xf'));var as=require(_0xd281('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd281('0x11'))(_0xd281('0x12'));var utils=require(_0xd281('0x13'));var config=require(_0xd281('0x14'));var licenseUtil=require(_0xd281('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dda20,_0x44fdeb){_0x44fdeb=_0x44fdeb||0xcc;return function(_0x310354){if(_0x310354){return _0x3dda20[_0xd281('0x16')](_0x44fdeb);}return _0x3dda20[_0xd281('0x17')](_0x44fdeb)[_0xd281('0x18')]();};}function respondWithResult(_0x188804,_0x216576){_0x216576=_0x216576||0xc8;return function(_0x3fc694){if(_0x3fc694){return _0x188804[_0xd281('0x17')](_0x216576)[_0xd281('0x19')](_0x3fc694);}};}function respondWithFilteredResult(_0x33cf18,_0xdd0cac){return function(_0x2b5a0f){if(_0x2b5a0f){var _0x477bfc=typeof _0xdd0cac[_0xd281('0x1a')]==='undefined'&&typeof _0xdd0cac[_0xd281('0x1b')]===_0xd281('0x1c');var _0x300173=_0x2b5a0f['count'];var _0x479d99=_0x477bfc?0x0:_0xdd0cac[_0xd281('0x1a')];var _0x134762=_0x477bfc?_0x2b5a0f[_0xd281('0x1d')]:_0xdd0cac[_0xd281('0x1a')]+_0xdd0cac[_0xd281('0x1b')];var _0x36e67b;if(_0x134762>=_0x300173){_0x134762=_0x300173;_0x36e67b=0xc8;}else{_0x36e67b=0xce;}_0x33cf18[_0xd281('0x17')](_0x36e67b);return _0x33cf18['set'](_0xd281('0x1e'),_0x479d99+'-'+_0x134762+'/'+_0x300173)[_0xd281('0x19')](_0x2b5a0f);}return null;};}function patchUpdates(_0x51d9e9){return function(_0x16b75c){try{jsonpatch[_0xd281('0x1f')](_0x16b75c,_0x51d9e9,!![]);}catch(_0x448e0e){return BPromise[_0xd281('0x20')](_0x448e0e);}return _0x16b75c[_0xd281('0x21')]();};}function saveUpdates(_0x46ac0e,_0x133235){return function(_0xde1a31){if(_0xde1a31){return _0xde1a31[_0xd281('0x22')](_0x46ac0e)[_0xd281('0x23')](function(_0x180434){return _0x180434;});}return null;};}function removeEntity(_0x1f023f,_0x1ff471){return function(_0x374704){if(_0x374704){return _0x374704[_0xd281('0x24')]()[_0xd281('0x23')](function(){_0x1f023f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d8b61,_0x165304){return function(_0x5ac1d9){if(!_0x5ac1d9){_0x4d8b61[_0xd281('0x16')](0x194);}return _0x5ac1d9;};}function handleError(_0x1ed43f,_0x3ef554){_0x3ef554=_0x3ef554||0x1f4;return function(_0x39f9a0){logger[_0xd281('0x25')](_0x39f9a0[_0xd281('0x26')]);if(_0x39f9a0[_0xd281('0x27')]){delete _0x39f9a0[_0xd281('0x27')];}_0x1ed43f[_0xd281('0x17')](_0x3ef554)[_0xd281('0x28')](_0x39f9a0);};}exports[_0xd281('0x29')]=function(_0x2b6f4d,_0x1a2495){var _0x59df6b={},_0x1cc98e={},_0xfd2f8b={'count':0x0,'rows':[]};var _0x48059a=_[_0xd281('0x2a')](db[_0xd281('0x2b')][_0xd281('0x2c')],function(_0x286133){return{'name':_0x286133[_0xd281('0x2d')],'type':_0x286133[_0xd281('0x2e')][_0xd281('0x2f')]};});_0x1cc98e['model']=_[_0xd281('0x2a')](_0x48059a,'name');_0x1cc98e['query']=_[_0xd281('0x30')](_0x2b6f4d[_0xd281('0x31')]);_0x1cc98e[_0xd281('0x32')]=_[_0xd281('0x33')](_0x1cc98e['model'],_0x1cc98e[_0xd281('0x31')]);_0x59df6b[_0xd281('0x34')]=_['intersection'](_0x1cc98e['model'],qs[_0xd281('0x35')](_0x2b6f4d[_0xd281('0x31')]['fields']));_0x59df6b['attributes']=_0x59df6b[_0xd281('0x34')][_0xd281('0x36')]?_0x59df6b[_0xd281('0x34')]:_0x1cc98e[_0xd281('0x37')];if(!_0x2b6f4d[_0xd281('0x31')][_0xd281('0x38')]('nolimit')){_0x59df6b[_0xd281('0x1b')]=qs[_0xd281('0x1b')](_0x2b6f4d[_0xd281('0x31')][_0xd281('0x1b')]);_0x59df6b[_0xd281('0x1a')]=qs[_0xd281('0x1a')](_0x2b6f4d[_0xd281('0x31')][_0xd281('0x1a')]);}_0x59df6b[_0xd281('0x39')]=qs[_0xd281('0x3a')](_0x2b6f4d['query'][_0xd281('0x3a')]);_0x59df6b[_0xd281('0x3b')]=qs[_0xd281('0x32')](_['pick'](_0x2b6f4d[_0xd281('0x31')],_0x1cc98e[_0xd281('0x32')]),_0x48059a);if(_0x2b6f4d[_0xd281('0x31')][_0xd281('0x3c')]){_0x59df6b[_0xd281('0x3b')]=_[_0xd281('0x3d')](_0x59df6b[_0xd281('0x3b')],{'$or':_[_0xd281('0x2a')](_0x48059a,function(_0x3df97a){if(_0x3df97a[_0xd281('0x2e')]!==_0xd281('0x3e')){var _0x406d19={};_0x406d19[_0x3df97a[_0xd281('0x27')]]={'$like':'%'+_0x2b6f4d[_0xd281('0x31')][_0xd281('0x3c')]+'%'};return _0x406d19;}})});}_0x59df6b=_[_0xd281('0x3d')]({},_0x59df6b,_0x2b6f4d[_0xd281('0x3f')]);var _0x52271f={'where':_0x59df6b['where']};return db['IntegrationReport'][_0xd281('0x1d')](_0x52271f)[_0xd281('0x23')](function(_0x19cb74){_0xfd2f8b['count']=_0x19cb74;if(_0x2b6f4d[_0xd281('0x31')]['includeAll']){_0x59df6b[_0xd281('0x40')]=[{'all':!![]}];}return db[_0xd281('0x2b')][_0xd281('0x41')](_0x59df6b);})[_0xd281('0x23')](function(_0x6772c){_0xfd2f8b[_0xd281('0x42')]=_0x6772c;return _0xfd2f8b;})[_0xd281('0x23')](respondWithFilteredResult(_0x1a2495,_0x59df6b))[_0xd281('0x43')](handleError(_0x1a2495,null));};exports[_0xd281('0x44')]=function(_0x32857d,_0x21ea16){var _0x17facd={'raw':![],'where':{'id':_0x32857d[_0xd281('0x45')]['id']}},_0x45a196={};_0x45a196[_0xd281('0x37')]=_[_0xd281('0x30')](db[_0xd281('0x2b')]['rawAttributes']);_0x45a196['query']=_[_0xd281('0x30')](_0x32857d[_0xd281('0x31')]);_0x45a196['filters']=_[_0xd281('0x33')](_0x45a196[_0xd281('0x37')],_0x45a196['query']);_0x17facd[_0xd281('0x34')]=_[_0xd281('0x33')](_0x45a196['model'],qs[_0xd281('0x35')](_0x32857d['query'][_0xd281('0x35')]));_0x17facd[_0xd281('0x34')]=_0x17facd[_0xd281('0x34')][_0xd281('0x36')]?_0x17facd[_0xd281('0x34')]:_0x45a196['model'];if(_0x32857d[_0xd281('0x31')]['includeAll']){_0x17facd[_0xd281('0x40')]=[{'all':!![]}];}_0x17facd=_[_0xd281('0x3d')]({},_0x17facd,_0x32857d['options']);return db[_0xd281('0x2b')][_0xd281('0x46')](_0x17facd)[_0xd281('0x23')](handleEntityNotFound(_0x21ea16,null))[_0xd281('0x23')](respondWithResult(_0x21ea16,null))[_0xd281('0x43')](handleError(_0x21ea16,null));};exports[_0xd281('0x47')]=function(_0x1798ec,_0x3e2a97){return db[_0xd281('0x2b')][_0xd281('0x47')](_0x1798ec['body'],{})[_0xd281('0x23')](respondWithResult(_0x3e2a97,0xc9))[_0xd281('0x43')](handleError(_0x3e2a97,null));};exports[_0xd281('0x22')]=function(_0x1259d8,_0x2b76db){if(_0x1259d8[_0xd281('0x48')]['id']){delete _0x1259d8['body']['id'];}return db[_0xd281('0x2b')][_0xd281('0x46')]({'where':{'id':_0x1259d8[_0xd281('0x45')]['id']}})[_0xd281('0x23')](handleEntityNotFound(_0x2b76db,null))['then'](saveUpdates(_0x1259d8[_0xd281('0x48')],null))[_0xd281('0x23')](respondWithResult(_0x2b76db,null))[_0xd281('0x43')](handleError(_0x2b76db,null));};exports['destroy']=function(_0x4be83a,_0x58a215){return db[_0xd281('0x2b')][_0xd281('0x46')]({'where':{'id':_0x4be83a[_0xd281('0x45')]['id']}})[_0xd281('0x23')](handleEntityNotFound(_0x58a215,null))[_0xd281('0x23')](removeEntity(_0x58a215,null))[_0xd281('0x43')](handleError(_0x58a215,null));};exports[_0xd281('0x49')]=function(_0xc3b9a3,_0x59b314){return db[_0xd281('0x2b')][_0xd281('0x49')]()[_0xd281('0x23')](respondWithResult(_0x59b314,null))['catch'](handleError(_0x59b314,null));}; \ No newline at end of file +var _0x8886=['model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type'];(function(_0x3eb396,_0x50cf4a){var _0x12c8ab=function(_0x4e689a){while(--_0x4e689a){_0x3eb396['push'](_0x3eb396['shift']());}};_0x12c8ab(++_0x50cf4a);}(_0x8886,0x1f0));var _0x6888=function(_0x120186,_0x1b7064){_0x120186=_0x120186-0x0;var _0x4b66fa=_0x8886[_0x120186];return _0x4b66fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6888('0x0'));var zipdir=require(_0x6888('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6888('0x2'));var moment=require(_0x6888('0x3'));var BPromise=require(_0x6888('0x4'));var Mustache=require(_0x6888('0x5'));var util=require(_0x6888('0x6'));var path=require(_0x6888('0x7'));var sox=require(_0x6888('0x8'));var csv=require('to-csv');var ejs=require(_0x6888('0x9'));var fs=require('fs');var fs_extra=require(_0x6888('0xa'));var _=require(_0x6888('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6888('0xc'));var toCsv=require(_0x6888('0xd'));var querystring=require(_0x6888('0xe'));var Papa=require(_0x6888('0xf'));var Redis=require(_0x6888('0x10'));var authService=require(_0x6888('0x11'));var qs=require(_0x6888('0x12'));var as=require(_0x6888('0x13'));var hardwareService=require(_0x6888('0x14'));var logger=require('../../config/logger')(_0x6888('0x15'));var utils=require(_0x6888('0x16'));var config=require(_0x6888('0x17'));var licenseUtil=require(_0x6888('0x18'));var db=require(_0x6888('0x19'))['db'];function respondWithStatusCode(_0x49a56e,_0x797ce5){_0x797ce5=_0x797ce5||0xcc;return function(_0x24611e){if(_0x24611e){return _0x49a56e['sendStatus'](_0x797ce5);}return _0x49a56e['status'](_0x797ce5)[_0x6888('0x1a')]();};}function respondWithResult(_0x104a7e,_0x5ba4fe){_0x5ba4fe=_0x5ba4fe||0xc8;return function(_0x1970b3){if(_0x1970b3){return _0x104a7e[_0x6888('0x1b')](_0x5ba4fe)[_0x6888('0x1c')](_0x1970b3);}};}function respondWithFilteredResult(_0x3dbc61,_0x37c27e){return function(_0x35f737){if(_0x35f737){var _0x4d1f3c=typeof _0x37c27e[_0x6888('0x1d')]===_0x6888('0x1e')&&typeof _0x37c27e[_0x6888('0x1f')]===_0x6888('0x1e');var _0x39b5cb=_0x35f737[_0x6888('0x20')];var _0xdd81f5=_0x4d1f3c?0x0:_0x37c27e[_0x6888('0x1d')];var _0x12b5be=_0x4d1f3c?_0x35f737['count']:_0x37c27e[_0x6888('0x1d')]+_0x37c27e[_0x6888('0x1f')];var _0x261412;if(_0x12b5be>=_0x39b5cb){_0x12b5be=_0x39b5cb;_0x261412=0xc8;}else{_0x261412=0xce;}_0x3dbc61['status'](_0x261412);return _0x3dbc61[_0x6888('0x21')](_0x6888('0x22'),_0xdd81f5+'-'+_0x12b5be+'/'+_0x39b5cb)['json'](_0x35f737);}return null;};}function patchUpdates(_0x149b03){return function(_0x1e4cc7){try{jsonpatch[_0x6888('0x23')](_0x1e4cc7,_0x149b03,!![]);}catch(_0x5294bf){return BPromise['reject'](_0x5294bf);}return _0x1e4cc7[_0x6888('0x24')]();};}function saveUpdates(_0x2bcf79,_0x1408cc){return function(_0x4270ae){if(_0x4270ae){return _0x4270ae[_0x6888('0x25')](_0x2bcf79)[_0x6888('0x26')](function(_0x44f66e){return _0x44f66e;});}return null;};}function removeEntity(_0x4f7e51,_0x3d190d){return function(_0x4ca7c1){if(_0x4ca7c1){return _0x4ca7c1[_0x6888('0x27')]()[_0x6888('0x26')](function(){_0x4f7e51[_0x6888('0x1b')](0xcc)[_0x6888('0x1a')]();});}};}function handleEntityNotFound(_0x58671f,_0x22a56b){return function(_0x4f2b2){if(!_0x4f2b2){_0x58671f[_0x6888('0x28')](0x194);}return _0x4f2b2;};}function handleError(_0x260bdd,_0x502939){_0x502939=_0x502939||0x1f4;return function(_0x3533f3){logger[_0x6888('0x29')](_0x3533f3[_0x6888('0x2a')]);if(_0x3533f3[_0x6888('0x2b')]){delete _0x3533f3[_0x6888('0x2b')];}_0x260bdd[_0x6888('0x1b')](_0x502939)[_0x6888('0x2c')](_0x3533f3);};}exports['index']=function(_0x52595a,_0xeac4b8){var _0x73544c={},_0x2fb841={},_0xa138c3={'count':0x0,'rows':[]};var _0x16dc8d=_[_0x6888('0x2d')](db[_0x6888('0x2e')][_0x6888('0x2f')],function(_0x729175){return{'name':_0x729175[_0x6888('0x30')],'type':_0x729175[_0x6888('0x31')]['key']};});_0x2fb841[_0x6888('0x32')]=_['map'](_0x16dc8d,_0x6888('0x2b'));_0x2fb841[_0x6888('0x33')]=_[_0x6888('0x34')](_0x52595a['query']);_0x2fb841[_0x6888('0x35')]=_[_0x6888('0x36')](_0x2fb841[_0x6888('0x32')],_0x2fb841[_0x6888('0x33')]);_0x73544c[_0x6888('0x37')]=_[_0x6888('0x36')](_0x2fb841[_0x6888('0x32')],qs['fields'](_0x52595a[_0x6888('0x33')][_0x6888('0x38')]));_0x73544c[_0x6888('0x37')]=_0x73544c[_0x6888('0x37')]['length']?_0x73544c['attributes']:_0x2fb841[_0x6888('0x32')];if(!_0x52595a[_0x6888('0x33')][_0x6888('0x39')]('nolimit')){_0x73544c[_0x6888('0x1f')]=qs[_0x6888('0x1f')](_0x52595a[_0x6888('0x33')][_0x6888('0x1f')]);_0x73544c[_0x6888('0x1d')]=qs[_0x6888('0x1d')](_0x52595a[_0x6888('0x33')][_0x6888('0x1d')]);}_0x73544c[_0x6888('0x3a')]=qs[_0x6888('0x3b')](_0x52595a[_0x6888('0x33')]['sort']);_0x73544c[_0x6888('0x3c')]=qs[_0x6888('0x35')](_[_0x6888('0x3d')](_0x52595a[_0x6888('0x33')],_0x2fb841[_0x6888('0x35')]),_0x16dc8d);if(_0x52595a[_0x6888('0x33')][_0x6888('0x3e')]){_0x73544c[_0x6888('0x3c')]=_['merge'](_0x73544c['where'],{'$or':_[_0x6888('0x2d')](_0x16dc8d,function(_0xe9565a){if(_0xe9565a[_0x6888('0x31')]!==_0x6888('0x3f')){var _0x50f477={};_0x50f477[_0xe9565a['name']]={'$like':'%'+_0x52595a[_0x6888('0x33')][_0x6888('0x3e')]+'%'};return _0x50f477;}})});}_0x73544c=_[_0x6888('0x40')]({},_0x73544c,_0x52595a[_0x6888('0x41')]);var _0x273a30={'where':_0x73544c['where']};return db[_0x6888('0x2e')][_0x6888('0x20')](_0x273a30)['then'](function(_0x9c37ce){_0xa138c3[_0x6888('0x20')]=_0x9c37ce;if(_0x52595a[_0x6888('0x33')]['includeAll']){_0x73544c[_0x6888('0x42')]=[{'all':!![]}];}return db['IntegrationReport'][_0x6888('0x43')](_0x73544c);})[_0x6888('0x26')](function(_0x49da8a){_0xa138c3[_0x6888('0x44')]=_0x49da8a;return _0xa138c3;})[_0x6888('0x26')](respondWithFilteredResult(_0xeac4b8,_0x73544c))['catch'](handleError(_0xeac4b8,null));};exports[_0x6888('0x45')]=function(_0x232cea,_0x4074e9){var _0x15433b={'raw':![],'where':{'id':_0x232cea[_0x6888('0x46')]['id']}},_0x5114a4={};_0x5114a4['model']=_[_0x6888('0x34')](db[_0x6888('0x2e')][_0x6888('0x2f')]);_0x5114a4[_0x6888('0x33')]=_[_0x6888('0x34')](_0x232cea[_0x6888('0x33')]);_0x5114a4[_0x6888('0x35')]=_[_0x6888('0x36')](_0x5114a4['model'],_0x5114a4['query']);_0x15433b[_0x6888('0x37')]=_[_0x6888('0x36')](_0x5114a4['model'],qs[_0x6888('0x38')](_0x232cea[_0x6888('0x33')]['fields']));_0x15433b[_0x6888('0x37')]=_0x15433b[_0x6888('0x37')][_0x6888('0x47')]?_0x15433b[_0x6888('0x37')]:_0x5114a4[_0x6888('0x32')];if(_0x232cea[_0x6888('0x33')][_0x6888('0x48')]){_0x15433b[_0x6888('0x42')]=[{'all':!![]}];}_0x15433b=_[_0x6888('0x40')]({},_0x15433b,_0x232cea[_0x6888('0x41')]);return db[_0x6888('0x2e')][_0x6888('0x49')](_0x15433b)[_0x6888('0x26')](handleEntityNotFound(_0x4074e9,null))[_0x6888('0x26')](respondWithResult(_0x4074e9,null))[_0x6888('0x4a')](handleError(_0x4074e9,null));};exports['create']=function(_0x1a8bd1,_0x52c10a){return db[_0x6888('0x2e')][_0x6888('0x4b')](_0x1a8bd1[_0x6888('0x4c')],{})['then'](respondWithResult(_0x52c10a,0xc9))[_0x6888('0x4a')](handleError(_0x52c10a,null));};exports['update']=function(_0x42d4e8,_0x424c45){if(_0x42d4e8[_0x6888('0x4c')]['id']){delete _0x42d4e8[_0x6888('0x4c')]['id'];}return db[_0x6888('0x2e')][_0x6888('0x49')]({'where':{'id':_0x42d4e8[_0x6888('0x46')]['id']}})['then'](handleEntityNotFound(_0x424c45,null))[_0x6888('0x26')](saveUpdates(_0x42d4e8[_0x6888('0x4c')],null))['then'](respondWithResult(_0x424c45,null))[_0x6888('0x4a')](handleError(_0x424c45,null));};exports['destroy']=function(_0x4687b0,_0x59e9d8){return db[_0x6888('0x2e')][_0x6888('0x49')]({'where':{'id':_0x4687b0[_0x6888('0x46')]['id']}})[_0x6888('0x26')](handleEntityNotFound(_0x59e9d8,null))[_0x6888('0x26')](removeEntity(_0x59e9d8,null))[_0x6888('0x4a')](handleError(_0x59e9d8,null));};exports[_0x6888('0x4d')]=function(_0x209b3f,_0x27042e){return db[_0x6888('0x2e')][_0x6888('0x4d')]()[_0x6888('0x26')](respondWithResult(_0x27042e,null))[_0x6888('0x4a')](handleError(_0x27042e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 131c25d..0f94bc3 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 _0xb6bf=['report_integration','moment','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x353b68,_0x439ed6){var _0x40cf08=function(_0x243b8d){while(--_0x243b8d){_0x353b68['push'](_0x353b68['shift']());}};_0x40cf08(++_0x439ed6);}(_0xb6bf,0xac));var _0xfb6b=function(_0x21ad36,_0x5aba39){_0x21ad36=_0x21ad36-0x0;var _0x29eb95=_0xb6bf[_0x21ad36];return _0x29eb95;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfb6b('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb6b('0x1'));var rimraf=require(_0xfb6b('0x2'));var config=require(_0xfb6b('0x3'));var attributes=require(_0xfb6b('0x4'));module[_0xfb6b('0x5')]=function(_0x1c57f6,_0x24b908){return _0x1c57f6[_0xfb6b('0x6')](_0xfb6b('0x7'),attributes,{'tableName':_0xfb6b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ab5=['request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','moment','bluebird'];(function(_0x39dc19,_0x27a6bf){var _0x4d3ecf=function(_0x22d9c2){while(--_0x22d9c2){_0x39dc19['push'](_0x39dc19['shift']());}};_0x4d3ecf(++_0x27a6bf);}(_0x4ab5,0x1dc));var _0x54ab=function(_0x5cabfd,_0x5dea47){_0x5cabfd=_0x5cabfd-0x0;var _0x4bc06c=_0x4ab5[_0x5cabfd];return _0x4bc06c;};'use strict';var _=require('lodash');var util=require(_0x54ab('0x0'));var logger=require(_0x54ab('0x1'))('api');var moment=require(_0x54ab('0x2'));var BPromise=require(_0x54ab('0x3'));var rp=require(_0x54ab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54ab('0x5'));var config=require(_0x54ab('0x6'));var attributes=require(_0x54ab('0x7'));module[_0x54ab('0x8')]=function(_0x273717,_0x49fba0){return _0x273717[_0x54ab('0x9')](_0x54ab('0xa'),attributes,{'tableName':_0x54ab('0xb'),'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 8244ab7..604fa7a 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 _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x74066c,_0xe08895){var _0x4f2a15=function(_0x5372fc){while(--_0x5372fc){_0x74066c['push'](_0x74066c['shift']());}};_0x4f2a15(++_0xe08895);}(_0x2675,0x75));var _0x5267=function(_0x2fb88d,_0x17586e){_0x2fb88d=_0x2fb88d-0x0;var _0x28ff64=_0x2675[_0x2fb88d];return _0x28ff64;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x6f731,_0x1ee446){var _0x3b7eec=function(_0x281572){while(--_0x281572){_0x6f731['push'](_0x6f731['shift']());}};_0x3b7eec(++_0x1ee446);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'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')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 19fd4b5..203973c 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 _0x9576=['isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x9576,0x182));var _0x6957=function(_0x2308bb,_0x1edeeb){_0x2308bb=_0x2308bb-0x0;var _0x2f466e=_0x9576[_0x2308bb];return _0x2f466e;};'use strict';var multer=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var path=require(_0x6957('0x2'));var timeout=require(_0x6957('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6957('0x4'));var auth=require(_0x6957('0x5'));var interaction=require(_0x6957('0x6'));var config=require(_0x6957('0x7'));var controller=require(_0x6957('0x8'));router[_0x6957('0x9')]('/',auth[_0x6957('0xa')](),controller['index']);router[_0x6957('0x9')](_0x6957('0xb'),auth[_0x6957('0xa')](),controller[_0x6957('0xc')]);router[_0x6957('0x9')](_0x6957('0xd'),auth['isAuthenticated'](),controller[_0x6957('0xe')]);router[_0x6957('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6957('0xf')](_0x6957('0xd'),auth[_0x6957('0xa')](),controller[_0x6957('0x10')]);router[_0x6957('0xf')](_0x6957('0x11'),auth[_0x6957('0xa')](),controller['addIntervals']);router['put']('/:id',auth[_0x6957('0xa')](),controller[_0x6957('0x12')]);router[_0x6957('0x13')](_0x6957('0xb'),auth[_0x6957('0xa')](),controller[_0x6957('0x14')]);module[_0x6957('0x15')]=router; \ No newline at end of file +var _0xbb67=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id'];(function(_0xa1710c,_0x1d0203){var _0x39c935=function(_0x869c84){while(--_0x869c84){_0xa1710c['push'](_0xa1710c['shift']());}};_0x39c935(++_0x1d0203);}(_0xbb67,0x161));var _0x7bb6=function(_0x177805,_0x578629){_0x177805=_0x177805-0x0;var _0x2e4533=_0xbb67[_0x177805];return _0x2e4533;};'use strict';var multer=require('multer');var util=require(_0x7bb6('0x0'));var path=require(_0x7bb6('0x1'));var timeout=require(_0x7bb6('0x2'));var express=require(_0x7bb6('0x3'));var router=express[_0x7bb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7bb6('0x5'));var interaction=require(_0x7bb6('0x6'));var config=require(_0x7bb6('0x7'));var controller=require(_0x7bb6('0x8'));router[_0x7bb6('0x9')]('/',auth[_0x7bb6('0xa')](),controller[_0x7bb6('0xb')]);router[_0x7bb6('0x9')]('/:id',auth[_0x7bb6('0xa')](),controller[_0x7bb6('0xc')]);router[_0x7bb6('0x9')](_0x7bb6('0xd'),auth[_0x7bb6('0xa')](),controller[_0x7bb6('0xe')]);router[_0x7bb6('0xf')]('/',auth[_0x7bb6('0xa')](),controller[_0x7bb6('0x10')]);router['post'](_0x7bb6('0xd'),auth[_0x7bb6('0xa')](),controller[_0x7bb6('0x11')]);router[_0x7bb6('0xf')](_0x7bb6('0x12'),auth[_0x7bb6('0xa')](),controller[_0x7bb6('0x13')]);router[_0x7bb6('0x14')](_0x7bb6('0x15'),auth['isAuthenticated'](),controller['update']);router[_0x7bb6('0x16')](_0x7bb6('0x15'),auth['isAuthenticated'](),controller[_0x7bb6('0x17')]);module[_0x7bb6('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index f4215e4..094cdef 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 _0x8115=['exports','STRING','sequelize'];(function(_0x3512f7,_0x5040e8){var _0x10d297=function(_0x3065b6){while(--_0x3065b6){_0x3512f7['push'](_0x3512f7['shift']());}};_0x10d297(++_0x5040e8);}(_0x8115,0xb6));var _0x5811=function(_0x244c6b,_0x3c7436){_0x244c6b=_0x244c6b-0x0;var _0x2aada0=_0x8115[_0x244c6b];return _0x2aada0;};'use strict';var Sequelize=require(_0x5811('0x0'));module[_0x5811('0x1')]={'name':{'type':Sequelize[_0x5811('0x2')]},'description':{'type':Sequelize[_0x5811('0x2')]},'interval':{'type':Sequelize[_0x5811('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x5de9=['STRING','sequelize','exports'];(function(_0x3838f8,_0x25352a){var _0x587044=function(_0x4ae4ba){while(--_0x4ae4ba){_0x3838f8['push'](_0x3838f8['shift']());}};_0x587044(++_0x25352a);}(_0x5de9,0xbe));var _0x95de=function(_0xa9b067,_0x2047eb){_0xa9b067=_0xa9b067-0x0;var _0x492156=_0x5de9[_0xa9b067];return _0x492156;};'use strict';var Sequelize=require(_0x95de('0x0'));module[_0x95de('0x1')]={'name':{'type':Sequelize[_0x95de('0x2')]},'description':{'type':Sequelize[_0x95de('0x2')]},'interval':{'type':Sequelize[_0x95de('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index ad58e62..c228974 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 _0x2953=['query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','params','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','hasOwnProperty','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','destroy','then','Intervals','end','error','name','send','index','map','Interval','rawAttributes','fieldName','type'];(function(_0x194874,_0x564793){var _0x5af986=function(_0x317556){while(--_0x317556){_0x194874['push'](_0x194874['shift']());}};_0x5af986(++_0x564793);}(_0x2953,0x1ec));var _0x3295=function(_0x535f43,_0x59611f){_0x535f43=_0x535f43-0x0;var _0x34b84a=_0x2953[_0x535f43];return _0x34b84a;};'use strict';var emlformat=require(_0x3295('0x0'));var rimraf=require(_0x3295('0x1'));var zipdir=require(_0x3295('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3295('0x3'));var BPromise=require(_0x3295('0x4'));var Mustache=require(_0x3295('0x5'));var util=require('util');var path=require(_0x3295('0x6'));var sox=require(_0x3295('0x7'));var csv=require(_0x3295('0x8'));var ejs=require(_0x3295('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3295('0xa'));var squel=require(_0x3295('0xb'));var crypto=require(_0x3295('0xc'));var jsforce=require(_0x3295('0xd'));var deskjs=require(_0x3295('0xe'));var toCsv=require(_0x3295('0x8'));var querystring=require(_0x3295('0xf'));var Papa=require(_0x3295('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3295('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3295('0x12'))(_0x3295('0x13'));var utils=require(_0x3295('0x14'));var config=require(_0x3295('0x15'));var licenseUtil=require(_0x3295('0x16'));var db=require(_0x3295('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2d8bf4,_0x529923){_0x529923=_0x529923||0xcc;return function(_0x2ae702){if(_0x2ae702){return _0x2d8bf4[_0x3295('0x18')](_0x529923);}return _0x2d8bf4[_0x3295('0x19')](_0x529923)['end']();};}function respondWithResult(_0x29afae,_0x37a5a4){_0x37a5a4=_0x37a5a4||0xc8;return function(_0x23cb8e){if(_0x23cb8e){return _0x29afae[_0x3295('0x19')](_0x37a5a4)['json'](_0x23cb8e);}};}function respondWithFilteredResult(_0x3927ec,_0x526ab0){return function(_0x258b6f){if(_0x258b6f){var _0x5d033d=typeof _0x526ab0[_0x3295('0x1a')]===_0x3295('0x1b')&&typeof _0x526ab0[_0x3295('0x1c')]===_0x3295('0x1b');var _0x258124=_0x258b6f[_0x3295('0x1d')];var _0x324746=_0x5d033d?0x0:_0x526ab0['offset'];var _0x3864c6=_0x5d033d?_0x258b6f[_0x3295('0x1d')]:_0x526ab0[_0x3295('0x1a')]+_0x526ab0[_0x3295('0x1c')];var _0x55095e;if(_0x3864c6>=_0x258124){_0x3864c6=_0x258124;_0x55095e=0xc8;}else{_0x55095e=0xce;}_0x3927ec['status'](_0x55095e);return _0x3927ec[_0x3295('0x1e')]('Content-Range',_0x324746+'-'+_0x3864c6+'/'+_0x258124)[_0x3295('0x1f')](_0x258b6f);}return null;};}function patchUpdates(_0x2780f8){return function(_0x116885){try{jsonpatch['apply'](_0x116885,_0x2780f8,!![]);}catch(_0x31eecf){return BPromise[_0x3295('0x20')](_0x31eecf);}return _0x116885[_0x3295('0x21')]();};}function saveUpdates(_0x42735b,_0x11b31f){return function(_0x3ea0f4){if(_0x3ea0f4){return _0x3ea0f4[_0x3295('0x22')](_0x42735b)['then'](function(_0x309877){return _0x309877;});}return null;};}function removeEntity(_0x5b4e35,_0x19b8f){return function(_0x2a71d4){if(_0x2a71d4){return _0x2a71d4[_0x3295('0x23')]()[_0x3295('0x24')](function(){var _0x2d2fc1=_0x2a71d4['get']({'plain':!![]});var _0x4bc9eb=_0x3295('0x25');return db['UserProfileResource'][_0x3295('0x23')]({'where':{'type':_0x4bc9eb,'resourceId':_0x2d2fc1['id']}})[_0x3295('0x24')](function(){return _0x2a71d4;});})[_0x3295('0x24')](function(){_0x5b4e35[_0x3295('0x19')](0xcc)[_0x3295('0x26')]();});}};}function handleEntityNotFound(_0x404898,_0x4f00eb){return function(_0x1bc64a){if(!_0x1bc64a){_0x404898[_0x3295('0x18')](0x194);}return _0x1bc64a;};}function handleError(_0x5604d9,_0x35c277){_0x35c277=_0x35c277||0x1f4;return function(_0x1c8c07){logger[_0x3295('0x27')](_0x1c8c07['stack']);if(_0x1c8c07['name']){delete _0x1c8c07[_0x3295('0x28')];}_0x5604d9['status'](_0x35c277)[_0x3295('0x29')](_0x1c8c07);};}exports[_0x3295('0x2a')]=function(_0x37870c,_0x4c76dc){var _0x1e2dd5={},_0x415e3a={},_0x4482b1={'count':0x0,'rows':[]};var _0xcb761e=_[_0x3295('0x2b')](db[_0x3295('0x2c')][_0x3295('0x2d')],function(_0x4ef16a){return{'name':_0x4ef16a[_0x3295('0x2e')],'type':_0x4ef16a[_0x3295('0x2f')]['key']};});_0x415e3a['model']=_[_0x3295('0x2b')](_0xcb761e,_0x3295('0x28'));_0x415e3a[_0x3295('0x30')]=_[_0x3295('0x31')](_0x37870c[_0x3295('0x30')]);_0x415e3a['filters']=_[_0x3295('0x32')](_0x415e3a[_0x3295('0x33')],_0x415e3a[_0x3295('0x30')]);_0x1e2dd5['attributes']=_['intersection'](_0x415e3a[_0x3295('0x33')],qs[_0x3295('0x34')](_0x37870c[_0x3295('0x30')][_0x3295('0x34')]));_0x1e2dd5[_0x3295('0x35')]=_0x1e2dd5[_0x3295('0x35')][_0x3295('0x36')]?_0x1e2dd5[_0x3295('0x35')]:_0x415e3a[_0x3295('0x33')];if(!_0x37870c[_0x3295('0x30')]['hasOwnProperty'](_0x3295('0x37'))){_0x1e2dd5[_0x3295('0x1c')]=qs['limit'](_0x37870c[_0x3295('0x30')][_0x3295('0x1c')]);_0x1e2dd5[_0x3295('0x1a')]=qs[_0x3295('0x1a')](_0x37870c['query'][_0x3295('0x1a')]);}_0x1e2dd5[_0x3295('0x38')]=qs[_0x3295('0x39')](_0x37870c[_0x3295('0x30')][_0x3295('0x39')]);_0x1e2dd5[_0x3295('0x3a')]=qs['filters'](_[_0x3295('0x3b')](_0x37870c['query'],_0x415e3a[_0x3295('0x3c')]),_0xcb761e);if(_0x37870c[_0x3295('0x30')]['filter']){_0x1e2dd5[_0x3295('0x3a')]=_['merge'](_0x1e2dd5[_0x3295('0x3a')],{'$or':_[_0x3295('0x2b')](_0xcb761e,function(_0x5f2a5c){if(_0x5f2a5c['type']!=='VIRTUAL'){var _0xdc7189={};_0xdc7189[_0x5f2a5c[_0x3295('0x28')]]={'$like':'%'+_0x37870c['query'][_0x3295('0x3d')]+'%'};return _0xdc7189;}})});}_0x1e2dd5=_[_0x3295('0x3e')]({},_0x1e2dd5,_0x37870c['options']);var _0x4129db={'where':_0x1e2dd5[_0x3295('0x3a')]};return db[_0x3295('0x2c')][_0x3295('0x1d')](_0x4129db)[_0x3295('0x24')](function(_0x3338dd){_0x4482b1[_0x3295('0x1d')]=_0x3338dd;if(_0x37870c[_0x3295('0x30')][_0x3295('0x3f')]){_0x1e2dd5[_0x3295('0x40')]=[{'all':!![]}];}return db[_0x3295('0x2c')][_0x3295('0x41')](_0x1e2dd5);})[_0x3295('0x24')](function(_0x53b6af){_0x4482b1[_0x3295('0x42')]=_0x53b6af;return _0x4482b1;})[_0x3295('0x24')](respondWithFilteredResult(_0x4c76dc,_0x1e2dd5))['catch'](handleError(_0x4c76dc,null));};exports['show']=function(_0xea5f78,_0x463ee6){var _0x4e534c={'raw':!![],'where':{'id':_0xea5f78[_0x3295('0x43')]['id']}},_0x17bf45={};_0x17bf45[_0x3295('0x33')]=_[_0x3295('0x31')](db['Interval']['rawAttributes']);_0x17bf45[_0x3295('0x30')]=_[_0x3295('0x31')](_0xea5f78[_0x3295('0x30')]);_0x17bf45[_0x3295('0x3c')]=_[_0x3295('0x32')](_0x17bf45[_0x3295('0x33')],_0x17bf45[_0x3295('0x30')]);_0x4e534c['attributes']=_[_0x3295('0x32')](_0x17bf45[_0x3295('0x33')],qs[_0x3295('0x34')](_0xea5f78[_0x3295('0x30')][_0x3295('0x34')]));_0x4e534c[_0x3295('0x35')]=_0x4e534c[_0x3295('0x35')][_0x3295('0x36')]?_0x4e534c[_0x3295('0x35')]:_0x17bf45[_0x3295('0x33')];if(_0xea5f78[_0x3295('0x30')]['includeAll']){_0x4e534c[_0x3295('0x40')]=[{'all':!![]}];}_0x4e534c=_['merge']({},_0x4e534c,_0xea5f78[_0x3295('0x44')]);return db[_0x3295('0x2c')][_0x3295('0x45')](_0x4e534c)['then'](handleEntityNotFound(_0x463ee6,null))[_0x3295('0x24')](respondWithResult(_0x463ee6,null))[_0x3295('0x46')](handleError(_0x463ee6,null));};exports[_0x3295('0x47')]=function(_0x43b586,_0x1cd106){return db[_0x3295('0x2c')][_0x3295('0x47')](_0x43b586[_0x3295('0x48')],{})[_0x3295('0x24')](function(_0xcb50ae){var _0x47581=_0x43b586['user']['get']({'plain':!![]});if(!_0x47581)throw new Error(_0x3295('0x49'));if(_0x47581[_0x3295('0x4a')]===_0x3295('0x4b')){var _0x4be244=_0xcb50ae[_0x3295('0x4c')]({'plain':!![]});var _0x4890b4=_0x3295('0x25');return db[_0x3295('0x4d')][_0x3295('0x45')]({'where':{'name':_0x4890b4,'userProfileId':_0x47581[_0x3295('0x4e')]},'raw':!![]})[_0x3295('0x24')](function(_0xed0fb6){if(_0xed0fb6&&_0xed0fb6[_0x3295('0x4f')]===0x0){return db[_0x3295('0x50')]['create']({'name':_0x4be244['name'],'resourceId':_0x4be244['id'],'type':_0xed0fb6['name'],'sectionId':_0xed0fb6['id']},{})[_0x3295('0x24')](function(){return _0xcb50ae;});}else{return _0xcb50ae;}})[_0x3295('0x46')](function(_0x1a52fa){logger[_0x3295('0x27')](_0x3295('0x51'),_0x1a52fa);throw _0x1a52fa;});}return _0xcb50ae;})['then'](respondWithResult(_0x1cd106,0xc9))[_0x3295('0x46')](handleError(_0x1cd106,null));};exports['update']=function(_0x156f6a,_0x225389){if(_0x156f6a['body']['id']){delete _0x156f6a[_0x3295('0x48')]['id'];}return db[_0x3295('0x2c')]['find']({'where':{'id':_0x156f6a[_0x3295('0x43')]['id']}})[_0x3295('0x24')](handleEntityNotFound(_0x225389,null))[_0x3295('0x24')](saveUpdates(_0x156f6a[_0x3295('0x48')],null))['then'](respondWithResult(_0x225389,null))['catch'](handleError(_0x225389,null));};exports[_0x3295('0x23')]=function(_0x26340,_0x1580b6){return db[_0x3295('0x2c')][_0x3295('0x45')]({'where':{'id':_0x26340[_0x3295('0x43')]['id']}})[_0x3295('0x24')](handleEntityNotFound(_0x1580b6,null))['then'](removeEntity(_0x1580b6,null))['catch'](handleError(_0x1580b6,null));};exports[_0x3295('0x52')]=function(_0x20c7a1,_0x22b471,_0x42ca39){if(_0x20c7a1[_0x3295('0x48')]['id']){delete _0x20c7a1[_0x3295('0x48')]['id'];}return db[_0x3295('0x2c')][_0x3295('0x45')]({'where':{'id':_0x20c7a1[_0x3295('0x43')]['id']}})['then'](handleEntityNotFound(_0x22b471,null))[_0x3295('0x24')](function(_0x7ba171){if(_0x7ba171){_0x20c7a1[_0x3295('0x48')]['IntervalId']=_0x7ba171['id'];return db['Interval'][_0x3295('0x47')](_0x20c7a1[_0x3295('0x48')]);}})[_0x3295('0x24')](respondWithResult(_0x22b471,null))[_0x3295('0x46')](handleError(_0x22b471,null));};exports[_0x3295('0x53')]=function(_0xf1479f,_0x5557e4,_0x5f9db4){var _0x270e00={};var _0x42c177={};var _0x2eb0ae;var _0x58aee1;return db['Interval'][_0x3295('0x54')]({'where':{'id':_0xf1479f[_0x3295('0x43')]['id']}})['then'](handleEntityNotFound(_0x5557e4,null))[_0x3295('0x24')](function(_0xe7f0ea){if(_0xe7f0ea){_0x2eb0ae=_0xe7f0ea;_0x42c177[_0x3295('0x33')]=_[_0x3295('0x31')](db[_0x3295('0x2c')]['rawAttributes']);_0x42c177[_0x3295('0x30')]=_[_0x3295('0x31')](_0xf1479f[_0x3295('0x30')]);_0x42c177['filters']=_[_0x3295('0x32')](_0x42c177[_0x3295('0x33')],_0x42c177[_0x3295('0x30')]);_0x270e00[_0x3295('0x35')]=_['intersection'](_0x42c177[_0x3295('0x33')],qs[_0x3295('0x34')](_0xf1479f['query'][_0x3295('0x34')]));_0x270e00[_0x3295('0x35')]=_0x270e00['attributes'][_0x3295('0x36')]?_0x270e00[_0x3295('0x35')]:_0x42c177[_0x3295('0x33')];_0x270e00[_0x3295('0x38')]=qs[_0x3295('0x39')](_0xf1479f[_0x3295('0x30')][_0x3295('0x39')]);_0x270e00[_0x3295('0x3a')]=qs[_0x3295('0x3c')](_[_0x3295('0x3b')](_0xf1479f[_0x3295('0x30')],_0x42c177[_0x3295('0x3c')]));if(_0xf1479f[_0x3295('0x30')]['filter']){_0x270e00[_0x3295('0x3a')]=_[_0x3295('0x3e')](_0x270e00[_0x3295('0x3a')],{'$or':_['map'](_0x270e00[_0x3295('0x35')],function(_0x35ec7b){var _0x59dab5={};_0x59dab5[_0x35ec7b]={'$like':'%'+_0xf1479f['query'][_0x3295('0x3d')]+'%'};return _0x59dab5;})});}_0x270e00=_['merge']({},_0x270e00,_0xf1479f[_0x3295('0x44')]);return _0x2eb0ae['getIntervals'](_0x270e00);}})[_0x3295('0x24')](function(_0x1d931b){if(_0x1d931b){_0x58aee1=_0x1d931b['length'];if(!_0xf1479f[_0x3295('0x30')][_0x3295('0x55')]('nolimit')){_0x270e00['limit']=qs[_0x3295('0x1c')](_0xf1479f['query']['limit']);_0x270e00[_0x3295('0x1a')]=qs['offset'](_0xf1479f['query'][_0x3295('0x1a')]);}return _0x2eb0ae[_0x3295('0x53')](_0x270e00);}})[_0x3295('0x24')](function(_0x438155){if(_0x438155){return _0x438155?{'count':_0x58aee1,'rows':_0x438155}:null;}})['then'](respondWithResult(_0x5557e4,null))[_0x3295('0x46')](handleError(_0x5557e4,null));};exports['addIntervals']=function(_0x44670d,_0x383545,_0x563346){return db[_0x3295('0x2c')][_0x3295('0x54')]({'where':{'id':_0x44670d[_0x3295('0x43')]['id']}})['then'](handleEntityNotFound(_0x383545,null))[_0x3295('0x24')](function(_0x24cb95){if(_0x24cb95){return db[_0x3295('0x56')][_0x3295('0x57')](function(_0x33c003){return db[_0x3295('0x2c')][_0x3295('0x23')]({'where':{'IntervalId':_0x44670d['params']['id']},'transaction':_0x33c003})['then'](function(_0x10dc4e){var _0x2b6c19=_[_0x3295('0x2b')](_0x44670d[_0x3295('0x48')],function(_0x26a4cd){delete _0x26a4cd['id'];_0x26a4cd[_0x3295('0x58')]=_0x44670d[_0x3295('0x43')]['id'];return _0x26a4cd;});return db['Interval'][_0x3295('0x59')](_0x2b6c19,{'transaction':_0x33c003});});})[_0x3295('0x24')](function(){return db[_0x3295('0x2c')][_0x3295('0x41')]({'where':{'IntervalId':_0x44670d[_0x3295('0x43')]['id']}});});}})['then'](respondWithResult(_0x383545,null))['catch'](handleError(_0x383545,null));}; \ No newline at end of file +var _0xb9a9=['rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addInterval','IntervalId','getIntervals','findOne','pick','addIntervals','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Interval'];(function(_0x3bbb66,_0x460b6d){var _0x28cdee=function(_0x5f3220){while(--_0x5f3220){_0x3bbb66['push'](_0x3bbb66['shift']());}};_0x28cdee(++_0x460b6d);}(_0xb9a9,0x147));var _0x9b9a=function(_0x270225,_0x1fd4d5){_0x270225=_0x270225-0x0;var _0x5d1ef9=_0xb9a9[_0x270225];return _0x5d1ef9;};'use strict';var emlformat=require(_0x9b9a('0x0'));var rimraf=require(_0x9b9a('0x1'));var zipdir=require(_0x9b9a('0x2'));var jsonpatch=require(_0x9b9a('0x3'));var rp=require(_0x9b9a('0x4'));var moment=require(_0x9b9a('0x5'));var BPromise=require(_0x9b9a('0x6'));var Mustache=require(_0x9b9a('0x7'));var util=require('util');var path=require(_0x9b9a('0x8'));var sox=require(_0x9b9a('0x9'));var csv=require(_0x9b9a('0xa'));var ejs=require(_0x9b9a('0xb'));var fs=require('fs');var fs_extra=require(_0x9b9a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b9a('0xd'));var jsforce=require(_0x9b9a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9b9a('0xa'));var querystring=require('querystring');var Papa=require(_0x9b9a('0xf'));var Redis=require(_0x9b9a('0x10'));var authService=require(_0x9b9a('0x11'));var qs=require(_0x9b9a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b9a('0x13'))('api');var utils=require(_0x9b9a('0x14'));var config=require(_0x9b9a('0x15'));var licenseUtil=require(_0x9b9a('0x16'));var db=require(_0x9b9a('0x17'))['db'];var extensions=require(_0x9b9a('0x18'));function respondWithStatusCode(_0x54c396,_0x4b5845){_0x4b5845=_0x4b5845||0xcc;return function(_0x4d9b10){if(_0x4d9b10){return _0x54c396['sendStatus'](_0x4b5845);}return _0x54c396[_0x9b9a('0x19')](_0x4b5845)[_0x9b9a('0x1a')]();};}function respondWithResult(_0x3bbe12,_0x234fc8){_0x234fc8=_0x234fc8||0xc8;return function(_0x46ac7f){if(_0x46ac7f){return _0x3bbe12[_0x9b9a('0x19')](_0x234fc8)[_0x9b9a('0x1b')](_0x46ac7f);}};}function respondWithFilteredResult(_0x32a94b,_0x4ce6be){return function(_0x1e4f96){if(_0x1e4f96){var _0x22bc31=typeof _0x4ce6be[_0x9b9a('0x1c')]===_0x9b9a('0x1d')&&typeof _0x4ce6be[_0x9b9a('0x1e')]===_0x9b9a('0x1d');var _0xe9ef40=_0x1e4f96[_0x9b9a('0x1f')];var _0x83636b=_0x22bc31?0x0:_0x4ce6be[_0x9b9a('0x1c')];var _0x58d0f2=_0x22bc31?_0x1e4f96[_0x9b9a('0x1f')]:_0x4ce6be[_0x9b9a('0x1c')]+_0x4ce6be[_0x9b9a('0x1e')];var _0x187362;if(_0x58d0f2>=_0xe9ef40){_0x58d0f2=_0xe9ef40;_0x187362=0xc8;}else{_0x187362=0xce;}_0x32a94b[_0x9b9a('0x19')](_0x187362);return _0x32a94b[_0x9b9a('0x20')](_0x9b9a('0x21'),_0x83636b+'-'+_0x58d0f2+'/'+_0xe9ef40)[_0x9b9a('0x1b')](_0x1e4f96);}return null;};}function patchUpdates(_0x2bd397){return function(_0x288702){try{jsonpatch[_0x9b9a('0x22')](_0x288702,_0x2bd397,!![]);}catch(_0x10d57d){return BPromise[_0x9b9a('0x23')](_0x10d57d);}return _0x288702[_0x9b9a('0x24')]();};}function saveUpdates(_0x2ab9ce,_0xd4d4d8){return function(_0x1787e0){if(_0x1787e0){return _0x1787e0['update'](_0x2ab9ce)[_0x9b9a('0x25')](function(_0x20c67a){return _0x20c67a;});}return null;};}function removeEntity(_0x462989,_0xc4e1c7){return function(_0x10d0c2){if(_0x10d0c2){return _0x10d0c2[_0x9b9a('0x26')]()[_0x9b9a('0x25')](function(){var _0x3b1fb5=_0x10d0c2[_0x9b9a('0x27')]({'plain':!![]});var _0x8718e3='Intervals';return db[_0x9b9a('0x28')][_0x9b9a('0x26')]({'where':{'type':_0x8718e3,'resourceId':_0x3b1fb5['id']}})['then'](function(){return _0x10d0c2;});})['then'](function(){_0x462989[_0x9b9a('0x19')](0xcc)[_0x9b9a('0x1a')]();});}};}function handleEntityNotFound(_0x192d4d,_0x5a7fb5){return function(_0x5c8e2b){if(!_0x5c8e2b){_0x192d4d[_0x9b9a('0x29')](0x194);}return _0x5c8e2b;};}function handleError(_0x651eb3,_0x2b357a){_0x2b357a=_0x2b357a||0x1f4;return function(_0x2a7b58){logger[_0x9b9a('0x2a')](_0x2a7b58[_0x9b9a('0x2b')]);if(_0x2a7b58[_0x9b9a('0x2c')]){delete _0x2a7b58[_0x9b9a('0x2c')];}_0x651eb3['status'](_0x2b357a)[_0x9b9a('0x2d')](_0x2a7b58);};}exports[_0x9b9a('0x2e')]=function(_0x16aeda,_0x2600bd){var _0x4f9395={},_0x46f32d={},_0x5c6758={'count':0x0,'rows':[]};var _0x3f5cdf=_[_0x9b9a('0x2f')](db[_0x9b9a('0x30')][_0x9b9a('0x31')],function(_0x147b07){return{'name':_0x147b07[_0x9b9a('0x32')],'type':_0x147b07['type'][_0x9b9a('0x33')]};});_0x46f32d['model']=_[_0x9b9a('0x2f')](_0x3f5cdf,_0x9b9a('0x2c'));_0x46f32d[_0x9b9a('0x34')]=_[_0x9b9a('0x35')](_0x16aeda['query']);_0x46f32d[_0x9b9a('0x36')]=_[_0x9b9a('0x37')](_0x46f32d[_0x9b9a('0x38')],_0x46f32d[_0x9b9a('0x34')]);_0x4f9395[_0x9b9a('0x39')]=_[_0x9b9a('0x37')](_0x46f32d[_0x9b9a('0x38')],qs[_0x9b9a('0x3a')](_0x16aeda[_0x9b9a('0x34')][_0x9b9a('0x3a')]));_0x4f9395[_0x9b9a('0x39')]=_0x4f9395[_0x9b9a('0x39')][_0x9b9a('0x3b')]?_0x4f9395['attributes']:_0x46f32d['model'];if(!_0x16aeda[_0x9b9a('0x34')][_0x9b9a('0x3c')](_0x9b9a('0x3d'))){_0x4f9395[_0x9b9a('0x1e')]=qs[_0x9b9a('0x1e')](_0x16aeda[_0x9b9a('0x34')][_0x9b9a('0x1e')]);_0x4f9395[_0x9b9a('0x1c')]=qs[_0x9b9a('0x1c')](_0x16aeda['query'][_0x9b9a('0x1c')]);}_0x4f9395[_0x9b9a('0x3e')]=qs[_0x9b9a('0x3f')](_0x16aeda[_0x9b9a('0x34')][_0x9b9a('0x3f')]);_0x4f9395[_0x9b9a('0x40')]=qs['filters'](_['pick'](_0x16aeda[_0x9b9a('0x34')],_0x46f32d[_0x9b9a('0x36')]),_0x3f5cdf);if(_0x16aeda[_0x9b9a('0x34')][_0x9b9a('0x41')]){_0x4f9395[_0x9b9a('0x40')]=_[_0x9b9a('0x42')](_0x4f9395[_0x9b9a('0x40')],{'$or':_[_0x9b9a('0x2f')](_0x3f5cdf,function(_0x235451){if(_0x235451[_0x9b9a('0x43')]!==_0x9b9a('0x44')){var _0x482d00={};_0x482d00[_0x235451[_0x9b9a('0x2c')]]={'$like':'%'+_0x16aeda[_0x9b9a('0x34')][_0x9b9a('0x41')]+'%'};return _0x482d00;}})});}_0x4f9395=_['merge']({},_0x4f9395,_0x16aeda['options']);var _0xd061ad={'where':_0x4f9395[_0x9b9a('0x40')]};return db[_0x9b9a('0x30')]['count'](_0xd061ad)[_0x9b9a('0x25')](function(_0x4807b4){_0x5c6758[_0x9b9a('0x1f')]=_0x4807b4;if(_0x16aeda['query'][_0x9b9a('0x45')]){_0x4f9395[_0x9b9a('0x46')]=[{'all':!![]}];}return db[_0x9b9a('0x30')]['findAll'](_0x4f9395);})[_0x9b9a('0x25')](function(_0x59e50b){_0x5c6758[_0x9b9a('0x47')]=_0x59e50b;return _0x5c6758;})[_0x9b9a('0x25')](respondWithFilteredResult(_0x2600bd,_0x4f9395))[_0x9b9a('0x48')](handleError(_0x2600bd,null));};exports['show']=function(_0x3e9549,_0x490ea0){var _0xe42887={'raw':!![],'where':{'id':_0x3e9549['params']['id']}},_0x1077cd={};_0x1077cd['model']=_[_0x9b9a('0x35')](db[_0x9b9a('0x30')][_0x9b9a('0x31')]);_0x1077cd[_0x9b9a('0x34')]=_[_0x9b9a('0x35')](_0x3e9549[_0x9b9a('0x34')]);_0x1077cd[_0x9b9a('0x36')]=_[_0x9b9a('0x37')](_0x1077cd[_0x9b9a('0x38')],_0x1077cd[_0x9b9a('0x34')]);_0xe42887[_0x9b9a('0x39')]=_[_0x9b9a('0x37')](_0x1077cd['model'],qs[_0x9b9a('0x3a')](_0x3e9549['query']['fields']));_0xe42887[_0x9b9a('0x39')]=_0xe42887['attributes'][_0x9b9a('0x3b')]?_0xe42887['attributes']:_0x1077cd[_0x9b9a('0x38')];if(_0x3e9549['query'][_0x9b9a('0x45')]){_0xe42887[_0x9b9a('0x46')]=[{'all':!![]}];}_0xe42887=_[_0x9b9a('0x42')]({},_0xe42887,_0x3e9549[_0x9b9a('0x49')]);return db[_0x9b9a('0x30')][_0x9b9a('0x4a')](_0xe42887)[_0x9b9a('0x25')](handleEntityNotFound(_0x490ea0,null))['then'](respondWithResult(_0x490ea0,null))['catch'](handleError(_0x490ea0,null));};exports['create']=function(_0x34e650,_0x28befc){return db[_0x9b9a('0x30')][_0x9b9a('0x4b')](_0x34e650['body'],{})[_0x9b9a('0x25')](function(_0x49a34f){var _0x217005=_0x34e650[_0x9b9a('0x4c')][_0x9b9a('0x27')]({'plain':!![]});if(!_0x217005)throw new Error(_0x9b9a('0x4d'));if(_0x217005[_0x9b9a('0x4e')]===_0x9b9a('0x4c')){var _0x2737e9=_0x49a34f[_0x9b9a('0x27')]({'plain':!![]});var _0x234654=_0x9b9a('0x4f');return db['UserProfileSection'][_0x9b9a('0x4a')]({'where':{'name':_0x234654,'userProfileId':_0x217005[_0x9b9a('0x50')]},'raw':!![]})[_0x9b9a('0x25')](function(_0x5b4143){if(_0x5b4143&&_0x5b4143['autoAssociation']===0x0){return db[_0x9b9a('0x28')][_0x9b9a('0x4b')]({'name':_0x2737e9[_0x9b9a('0x2c')],'resourceId':_0x2737e9['id'],'type':_0x5b4143[_0x9b9a('0x2c')],'sectionId':_0x5b4143['id']},{})['then'](function(){return _0x49a34f;});}else{return _0x49a34f;}})[_0x9b9a('0x48')](function(_0x536181){logger[_0x9b9a('0x2a')](_0x9b9a('0x51'),_0x536181);throw _0x536181;});}return _0x49a34f;})[_0x9b9a('0x25')](respondWithResult(_0x28befc,0xc9))['catch'](handleError(_0x28befc,null));};exports[_0x9b9a('0x52')]=function(_0x401b58,_0x4665f9){if(_0x401b58[_0x9b9a('0x53')]['id']){delete _0x401b58[_0x9b9a('0x53')]['id'];}return db[_0x9b9a('0x30')]['find']({'where':{'id':_0x401b58[_0x9b9a('0x54')]['id']}})[_0x9b9a('0x25')](handleEntityNotFound(_0x4665f9,null))[_0x9b9a('0x25')](saveUpdates(_0x401b58['body'],null))['then'](respondWithResult(_0x4665f9,null))['catch'](handleError(_0x4665f9,null));};exports[_0x9b9a('0x26')]=function(_0x5c0e70,_0x4aa37d){return db['Interval'][_0x9b9a('0x4a')]({'where':{'id':_0x5c0e70['params']['id']}})['then'](handleEntityNotFound(_0x4aa37d,null))[_0x9b9a('0x25')](removeEntity(_0x4aa37d,null))[_0x9b9a('0x48')](handleError(_0x4aa37d,null));};exports[_0x9b9a('0x55')]=function(_0x39f8f2,_0x478727,_0x433216){if(_0x39f8f2[_0x9b9a('0x53')]['id']){delete _0x39f8f2['body']['id'];}return db[_0x9b9a('0x30')]['find']({'where':{'id':_0x39f8f2[_0x9b9a('0x54')]['id']}})[_0x9b9a('0x25')](handleEntityNotFound(_0x478727,null))[_0x9b9a('0x25')](function(_0x19ac32){if(_0x19ac32){_0x39f8f2[_0x9b9a('0x53')][_0x9b9a('0x56')]=_0x19ac32['id'];return db['Interval']['create'](_0x39f8f2[_0x9b9a('0x53')]);}})['then'](respondWithResult(_0x478727,null))[_0x9b9a('0x48')](handleError(_0x478727,null));};exports[_0x9b9a('0x57')]=function(_0x470f02,_0x2faae5,_0x51c1c9){var _0x103160={};var _0x6997f8={};var _0x103aa1;var _0x5d4e43;return db['Interval'][_0x9b9a('0x58')]({'where':{'id':_0x470f02[_0x9b9a('0x54')]['id']}})['then'](handleEntityNotFound(_0x2faae5,null))['then'](function(_0x3107eb){if(_0x3107eb){_0x103aa1=_0x3107eb;_0x6997f8[_0x9b9a('0x38')]=_[_0x9b9a('0x35')](db[_0x9b9a('0x30')][_0x9b9a('0x31')]);_0x6997f8[_0x9b9a('0x34')]=_[_0x9b9a('0x35')](_0x470f02[_0x9b9a('0x34')]);_0x6997f8[_0x9b9a('0x36')]=_['intersection'](_0x6997f8['model'],_0x6997f8[_0x9b9a('0x34')]);_0x103160[_0x9b9a('0x39')]=_[_0x9b9a('0x37')](_0x6997f8[_0x9b9a('0x38')],qs[_0x9b9a('0x3a')](_0x470f02['query'][_0x9b9a('0x3a')]));_0x103160[_0x9b9a('0x39')]=_0x103160[_0x9b9a('0x39')]['length']?_0x103160['attributes']:_0x6997f8[_0x9b9a('0x38')];_0x103160[_0x9b9a('0x3e')]=qs[_0x9b9a('0x3f')](_0x470f02['query'][_0x9b9a('0x3f')]);_0x103160['where']=qs[_0x9b9a('0x36')](_[_0x9b9a('0x59')](_0x470f02[_0x9b9a('0x34')],_0x6997f8['filters']));if(_0x470f02[_0x9b9a('0x34')]['filter']){_0x103160[_0x9b9a('0x40')]=_[_0x9b9a('0x42')](_0x103160['where'],{'$or':_[_0x9b9a('0x2f')](_0x103160[_0x9b9a('0x39')],function(_0x2355db){var _0xc54992={};_0xc54992[_0x2355db]={'$like':'%'+_0x470f02[_0x9b9a('0x34')]['filter']+'%'};return _0xc54992;})});}_0x103160=_[_0x9b9a('0x42')]({},_0x103160,_0x470f02[_0x9b9a('0x49')]);return _0x103aa1['getIntervals'](_0x103160);}})[_0x9b9a('0x25')](function(_0x47357b){if(_0x47357b){_0x5d4e43=_0x47357b[_0x9b9a('0x3b')];if(!_0x470f02[_0x9b9a('0x34')][_0x9b9a('0x3c')](_0x9b9a('0x3d'))){_0x103160[_0x9b9a('0x1e')]=qs[_0x9b9a('0x1e')](_0x470f02[_0x9b9a('0x34')][_0x9b9a('0x1e')]);_0x103160[_0x9b9a('0x1c')]=qs[_0x9b9a('0x1c')](_0x470f02[_0x9b9a('0x34')][_0x9b9a('0x1c')]);}return _0x103aa1['getIntervals'](_0x103160);}})[_0x9b9a('0x25')](function(_0x10b98f){if(_0x10b98f){return _0x10b98f?{'count':_0x5d4e43,'rows':_0x10b98f}:null;}})[_0x9b9a('0x25')](respondWithResult(_0x2faae5,null))['catch'](handleError(_0x2faae5,null));};exports[_0x9b9a('0x5a')]=function(_0x77e2b4,_0x25bdf5,_0x4fc25d){return db[_0x9b9a('0x30')][_0x9b9a('0x58')]({'where':{'id':_0x77e2b4[_0x9b9a('0x54')]['id']}})[_0x9b9a('0x25')](handleEntityNotFound(_0x25bdf5,null))[_0x9b9a('0x25')](function(_0x4fa51b){if(_0x4fa51b){return db[_0x9b9a('0x5b')][_0x9b9a('0x5c')](function(_0x220d26){return db[_0x9b9a('0x30')][_0x9b9a('0x26')]({'where':{'IntervalId':_0x77e2b4['params']['id']},'transaction':_0x220d26})['then'](function(_0x4992c4){var _0x5937c9=_[_0x9b9a('0x2f')](_0x77e2b4[_0x9b9a('0x53')],function(_0x408fca){delete _0x408fca['id'];_0x408fca['IntervalId']=_0x77e2b4[_0x9b9a('0x54')]['id'];return _0x408fca;});return db[_0x9b9a('0x30')]['bulkCreate'](_0x5937c9,{'transaction':_0x220d26});});})[_0x9b9a('0x25')](function(){return db[_0x9b9a('0x30')][_0x9b9a('0x5d')]({'where':{'IntervalId':_0x77e2b4[_0x9b9a('0x54')]['id']}});});}})['then'](respondWithResult(_0x25bdf5,null))['catch'](handleError(_0x25bdf5,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 3160fd5..d0cfaf0 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 _0x4f8b=['Interval','tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0x4f8b,0xb3));var _0xb4f8=function(_0x4c73ec,_0x156ea3){_0x4c73ec=_0x4c73ec-0x0;var _0x4d0ac8=_0x4f8b[_0x4c73ec];return _0x4d0ac8;};'use strict';var _=require('lodash');var util=require(_0xb4f8('0x0'));var logger=require(_0xb4f8('0x1'))(_0xb4f8('0x2'));var moment=require(_0xb4f8('0x3'));var BPromise=require(_0xb4f8('0x4'));var rp=require(_0xb4f8('0x5'));var fs=require('fs');var path=require(_0xb4f8('0x6'));var rimraf=require(_0xb4f8('0x7'));var config=require(_0xb4f8('0x8'));var attributes=require(_0xb4f8('0x9'));var extensions=require(_0xb4f8('0xa'));module[_0xb4f8('0xb')]=function(_0x109217,_0x27e8b4){return _0x109217[_0xb4f8('0xc')](_0xb4f8('0xd'),attributes,{'tableName':_0xb4f8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5841df,_0x1b72e4){extensions[_0xb4f8('0xf')](_0x109217,_0x5841df);},'afterBulkCreate':function(_0x4bdd57,_0x18d77c,_0x40da6b){_0x40da6b();extensions[_0xb4f8('0xf')](_0x109217,_0x4bdd57[0x0]);},'afterUpdate':function(_0x53b34a,_0x29e8d1){extensions[_0xb4f8('0xf')](_0x109217,_0x53b34a);},'afterDestroy':function(_0xf08095,_0x4da50a){extensions['rewrite'](_0x109217,_0xf08095);}}});}; \ No newline at end of file +var _0x2839=['Interval','tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x2839,0xe3));var _0x9283=function(_0x1f21ea,_0x3ccaf7){_0x1f21ea=_0x1f21ea-0x0;var _0x1d00a5=_0x2839[_0x1f21ea];return _0x1d00a5;};'use strict';var _=require('lodash');var util=require(_0x9283('0x0'));var logger=require(_0x9283('0x1'))(_0x9283('0x2'));var moment=require(_0x9283('0x3'));var BPromise=require(_0x9283('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9283('0x5'));var config=require(_0x9283('0x6'));var attributes=require(_0x9283('0x7'));var extensions=require(_0x9283('0x8'));module[_0x9283('0x9')]=function(_0x53cd4e,_0x3fc3ba){return _0x53cd4e[_0x9283('0xa')](_0x9283('0xb'),attributes,{'tableName':_0x9283('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x120c81,_0x91a200){extensions[_0x9283('0xd')](_0x53cd4e,_0x120c81);},'afterBulkCreate':function(_0x264792,_0xccf7f0,_0x392443){_0x392443();extensions[_0x9283('0xd')](_0x53cd4e,_0x264792[0x0]);},'afterUpdate':function(_0x47f8bc,_0x43d220){extensions[_0x9283('0xd')](_0x53cd4e,_0x47f8bc);},'afterDestroy':function(_0x19c87d,_0x10fbf8){extensions[_0x9283('0xd')](_0x53cd4e,_0x19c87d);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index e332022..4277c93 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(_0x409deb,_0x2b731){var _0x15a4f7=function(_0x556510){while(--_0x556510){_0x409deb['push'](_0x409deb['shift']());}};_0x15a4f7(++_0x2b731);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 de25750..cbfe38b 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0xe4b339,_0x3bd58f){var _0x2689e2=function(_0x533fe3){while(--_0x533fe3){_0xe4b339['push'](_0xe4b339['shift']());}};_0x2689e2(++_0x3bd58f);}(_0x2032,0xd9));var _0x2203=function(_0x16cc93,_0x3f6729){_0x16cc93=_0x16cc93-0x0;var _0x30c79f=_0x2032[_0x16cc93];return _0x30c79f;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x2e4636,_0x3c60a5){var _0x131dfd=function(_0x27427d){while(--_0x27427d){_0x2e4636['push'](_0x2e4636['shift']());}};_0x131dfd(++_0x3c60a5);}(_0xdb28,0x106));var _0x8db2=function(_0x26d9f8,_0x22b3ea){_0x26d9f8=_0x26d9f8-0x0;var _0x44efbb=_0xdb28[_0x26d9f8];return _0x44efbb;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 6297413..12f6a07 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 _0x0b1a=['issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','reason','customfield_10102','/rest/api/2/issue','POST','toString','stringify','request','utf8','end','status','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','description'];(function(_0x22a084,_0x4ce0e7){var _0x1f9964=function(_0x34e633){while(--_0x34e633){_0x22a084['push'](_0x22a084['shift']());}};_0x1f9964(++_0x4ce0e7);}(_0x0b1a,0x115));var _0xa0b1=function(_0x12fe36,_0x5cde20){_0x12fe36=_0x12fe36-0x0;var _0x18f1c9=_0x0b1a[_0x12fe36];return _0x18f1c9;};'use strict';var BPromise=require(_0xa0b1('0x0'));var https=require(_0xa0b1('0x1'));var logger=require(_0xa0b1('0x2'))(_0xa0b1('0x3'));var USERNAME=_0xa0b1('0x4');var PASSWORD=_0xa0b1('0x5');function openIssue(_0x298259,_0x10bae9){var _0x516daa={'fields':{'project':{'key':_0x298259[_0xa0b1('0x6')]||_0xa0b1('0x7')},'summary':(_0x298259['summary']||_0xa0b1('0x8'))+'\x20from\x20'+_0x298259['ip'],'description':_0x298259[_0xa0b1('0x9')]||JSON['stringify'](_0x298259),'issuetype':{'name':_0x298259[_0xa0b1('0xa')]||'Bug'}}};_0x516daa[_0xa0b1('0xb')][_0xa0b1('0xc')]=_0x298259[_0xa0b1('0xd')];_0x516daa[_0xa0b1('0xb')][_0xa0b1('0xe')]=_0x298259[_0xa0b1('0xf')];_0x516daa[_0xa0b1('0xb')][_0xa0b1('0x10')]=_0x298259['newToken'];_0x516daa[_0xa0b1('0xb')][_0xa0b1('0x11')]=_0x298259[_0xa0b1('0x12')];_0x516daa[_0xa0b1('0xb')]['customfield_11504']=_0x298259[_0xa0b1('0x13')];_0x516daa[_0xa0b1('0xb')][_0xa0b1('0x14')]=_0x298259['ip'];var _0x57c1cf={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xa0b1('0x15'),'method':_0xa0b1('0x16'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xa0b1('0x17')]('base64')}};var _0x441a20=JSON[_0xa0b1('0x18')](_0x516daa);var _0x42625=https[_0xa0b1('0x19')](_0x57c1cf,function(_0x10053f){_0x10053f['setEncoding'](_0xa0b1('0x1a'));var _0x551634='';_0x10053f['on']('data',function(_0x21c2eb){_0x551634+=_0x21c2eb;});_0x10053f['on'](_0xa0b1('0x1b'),function(){if(_0x10bae9){return _0x10bae9[_0xa0b1('0x1c')](_0x10053f['statusCode'])['json'](JSON[_0xa0b1('0x1d')](_0x551634));}});});_0x42625['on'](_0xa0b1('0x1e'),function(_0x354bc9){if(_0x10bae9){return _0x10bae9[_0xa0b1('0x1c')](0x1f4)['json']({'errors':[{'message':_0xa0b1('0x1f'),'type':_0xa0b1('0x20')}]});}});_0x42625[_0xa0b1('0x21')](_0x441a20);_0x42625['end']();}exports[_0xa0b1('0x22')]=openIssue;exports[_0xa0b1('0x23')]=function(_0x1ea0e9,_0x5e9177){_0x1ea0e9[_0xa0b1('0x24')]['ip']=_0x1ea0e9['headers'][_0xa0b1('0x25')]||_0x1ea0e9[_0xa0b1('0x26')]['remoteAddress']||_0x1ea0e9[_0xa0b1('0x27')][_0xa0b1('0x28')]||_0x1ea0e9[_0xa0b1('0x26')][_0xa0b1('0x27')]['remoteAddress'];return openIssue(_0x1ea0e9[_0xa0b1('0x24')],_0x5e9177);}; \ No newline at end of file +var _0x62fd=['name','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','end','status','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','body','headers','socket','connection','remoteAddress','bluebird','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','stringify','fields','customfield_11500','email','oldToken','customfield_11502','customfield_11503'];(function(_0x119259,_0x2462ec){var _0x266b29=function(_0x395d84){while(--_0x395d84){_0x119259['push'](_0x119259['shift']());}};_0x266b29(++_0x2462ec);}(_0x62fd,0x109));var _0xd62f=function(_0x344e95,_0x55b113){_0x344e95=_0x344e95-0x0;var _0x2761b4=_0x62fd[_0x344e95];return _0x2761b4;};'use strict';var BPromise=require(_0xd62f('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xd62f('0x1'));var USERNAME=_0xd62f('0x2');var PASSWORD=_0xd62f('0x3');function openIssue(_0x1e0970,_0x2c5f03){var _0x5e76c3={'fields':{'project':{'key':_0x1e0970[_0xd62f('0x4')]||_0xd62f('0x5')},'summary':(_0x1e0970['summary']||_0xd62f('0x6'))+_0xd62f('0x7')+_0x1e0970['ip'],'description':_0x1e0970['description']||JSON[_0xd62f('0x8')](_0x1e0970),'issuetype':{'name':_0x1e0970['issuetype']||'Bug'}}};_0x5e76c3[_0xd62f('0x9')][_0xd62f('0xa')]=_0x1e0970[_0xd62f('0xb')];_0x5e76c3['fields']['customfield_11501']=_0x1e0970[_0xd62f('0xc')];_0x5e76c3[_0xd62f('0x9')][_0xd62f('0xd')]=_0x1e0970['newToken'];_0x5e76c3[_0xd62f('0x9')][_0xd62f('0xe')]=_0x1e0970[_0xd62f('0xf')];_0x5e76c3[_0xd62f('0x9')]['customfield_11504']=_0x1e0970[_0xd62f('0x10')];_0x5e76c3['fields']['customfield_10102']=_0x1e0970['ip'];var _0x3b94a7={'host':_0xd62f('0x11'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xd62f('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0xd62f('0x13'),'Authorization':_0xd62f('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0xd62f('0x15')](_0xd62f('0x16'))}};var _0x420e2f=JSON[_0xd62f('0x8')](_0x5e76c3);var _0x2bd5c7=https[_0xd62f('0x17')](_0x3b94a7,function(_0x506fcb){_0x506fcb['setEncoding']('utf8');var _0x1cfe1b='';_0x506fcb['on']('data',function(_0x5437ee){_0x1cfe1b+=_0x5437ee;});_0x506fcb['on'](_0xd62f('0x18'),function(){if(_0x2c5f03){return _0x2c5f03[_0xd62f('0x19')](_0x506fcb['statusCode'])['json'](JSON[_0xd62f('0x1a')](_0x1cfe1b));}});});_0x2bd5c7['on'](_0xd62f('0x1b'),function(_0x283dfb){if(_0x2c5f03){return _0x2c5f03[_0xd62f('0x19')](0x1f4)['json']({'errors':[{'message':_0xd62f('0x1c'),'type':'api.jira'}]});}});_0x2bd5c7['write'](_0x420e2f);_0x2bd5c7[_0xd62f('0x18')]();}exports[_0xd62f('0x1d')]=openIssue;exports['send']=function(_0x3d0123,_0x482950){_0x3d0123[_0xd62f('0x1e')]['ip']=_0x3d0123[_0xd62f('0x1f')]['x-forwarded-for']||_0x3d0123['connection']['remoteAddress']||_0x3d0123[_0xd62f('0x20')]['remoteAddress']||_0x3d0123[_0xd62f('0x21')][_0xd62f('0x20')][_0xd62f('0x22')];return openIssue(_0x3d0123['body'],_0x482950);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9f7e1b3..2943449 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(_0x5a5ca9,_0x30bcd3){var _0x421a14=function(_0x55096d){while(--_0x55096d){_0x5a5ca9['push'](_0x5a5ca9['shift']());}};_0x421a14(++_0x30bcd3);}(_0xb903,0x185));var _0x3b90=function(_0xe8fd3c,_0x26e374){_0xe8fd3c=_0xe8fd3c-0x0;var _0xd2e240=_0xb903[_0xe8fd3c];return _0xd2e240;};'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(_0x197a33,_0x29f3f4){var _0x31d268=function(_0xbed098){while(--_0xbed098){_0x197a33['push'](_0x197a33['shift']());}};_0x31d268(++_0x29f3f4);}(_0xb821,0xa7));var _0x1b82=function(_0x5df09d,_0x42b378){_0x5df09d=_0x5df09d-0x0;var _0x50f93c=_0xb821[_0x5df09d];return _0x50f93c;};'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 ad31f66..518937a 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0xda5502,_0x5d75eb){_0xda5502=_0xda5502-0x0;var _0x3c9a46=_0x7a54[_0xda5502];return _0x3c9a46;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x85419d,_0x333136){_0x85419d=_0x85419d-0x0;var _0x1cb9da=_0x7a54[_0x85419d];return _0x1cb9da;};'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 b8d8d77..450f3b2 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 _0x3baf=['filter','where','merge','options','includeAll','JscriptyAnswerReport','rows','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','then','error','stack','name','rawAttributes','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick'];(function(_0x11e6f,_0x26f26a){var _0x29b33f=function(_0xb1e474){while(--_0xb1e474){_0x11e6f['push'](_0x11e6f['shift']());}};_0x29b33f(++_0x26f26a);}(_0x3baf,0xf7));var _0xf3ba=function(_0x13e42f,_0x3296e5){_0x13e42f=_0x13e42f-0x0;var _0x415720=_0x3baf[_0x13e42f];return _0x415720;};'use strict';var emlformat=require(_0xf3ba('0x0'));var rimraf=require(_0xf3ba('0x1'));var zipdir=require(_0xf3ba('0x2'));var jsonpatch=require(_0xf3ba('0x3'));var rp=require(_0xf3ba('0x4'));var moment=require(_0xf3ba('0x5'));var BPromise=require(_0xf3ba('0x6'));var Mustache=require(_0xf3ba('0x7'));var util=require(_0xf3ba('0x8'));var path=require(_0xf3ba('0x9'));var sox=require(_0xf3ba('0xa'));var csv=require(_0xf3ba('0xb'));var ejs=require(_0xf3ba('0xc'));var fs=require('fs');var fs_extra=require(_0xf3ba('0xd'));var _=require(_0xf3ba('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf3ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf3ba('0x10'));var Papa=require(_0xf3ba('0x11'));var Redis=require(_0xf3ba('0x12'));var authService=require(_0xf3ba('0x13'));var qs=require(_0xf3ba('0x14'));var as=require(_0xf3ba('0x15'));var hardwareService=require(_0xf3ba('0x16'));var logger=require(_0xf3ba('0x17'))(_0xf3ba('0x18'));var utils=require(_0xf3ba('0x19'));var config=require(_0xf3ba('0x1a'));var licenseUtil=require(_0xf3ba('0x1b'));var db=require(_0xf3ba('0x1c'))['db'];function respondWithStatusCode(_0x85939e,_0x26cefe){_0x26cefe=_0x26cefe||0xcc;return function(_0x17673a){if(_0x17673a){return _0x85939e[_0xf3ba('0x1d')](_0x26cefe);}return _0x85939e[_0xf3ba('0x1e')](_0x26cefe)['end']();};}function respondWithResult(_0x327675,_0x56816b){_0x56816b=_0x56816b||0xc8;return function(_0x815037){if(_0x815037){return _0x327675[_0xf3ba('0x1e')](_0x56816b)[_0xf3ba('0x1f')](_0x815037);}};}function respondWithFilteredResult(_0x1e2969,_0x235c8a){return function(_0x53f848){if(_0x53f848){var _0x301856=typeof _0x235c8a[_0xf3ba('0x20')]===_0xf3ba('0x21')&&typeof _0x235c8a['limit']===_0xf3ba('0x21');var _0x11fbd2=_0x53f848[_0xf3ba('0x22')];var _0x44de40=_0x301856?0x0:_0x235c8a['offset'];var _0x1e18ed=_0x301856?_0x53f848[_0xf3ba('0x22')]:_0x235c8a['offset']+_0x235c8a['limit'];var _0x35a03c;if(_0x1e18ed>=_0x11fbd2){_0x1e18ed=_0x11fbd2;_0x35a03c=0xc8;}else{_0x35a03c=0xce;}_0x1e2969[_0xf3ba('0x1e')](_0x35a03c);return _0x1e2969[_0xf3ba('0x23')]('Content-Range',_0x44de40+'-'+_0x1e18ed+'/'+_0x11fbd2)[_0xf3ba('0x1f')](_0x53f848);}return null;};}function patchUpdates(_0x327723){return function(_0x35d6d4){try{jsonpatch[_0xf3ba('0x24')](_0x35d6d4,_0x327723,!![]);}catch(_0x23a744){return BPromise[_0xf3ba('0x25')](_0x23a744);}return _0x35d6d4[_0xf3ba('0x26')]();};}function saveUpdates(_0x4caf74,_0x4e94a7){return function(_0x4a065a){if(_0x4a065a){return _0x4a065a[_0xf3ba('0x27')](_0x4caf74)[_0xf3ba('0x28')](function(_0x6f538f){return _0x6f538f;});}return null;};}function removeEntity(_0x3b6404,_0x2cc01a){return function(_0x545ee1){if(_0x545ee1){return _0x545ee1['destroy']()[_0xf3ba('0x28')](function(){_0x3b6404[_0xf3ba('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c9d6a,_0x37cba1){return function(_0x59ce48){if(!_0x59ce48){_0x1c9d6a['sendStatus'](0x194);}return _0x59ce48;};}function handleError(_0x396089,_0x7effa1){_0x7effa1=_0x7effa1||0x1f4;return function(_0x5f1709){logger[_0xf3ba('0x29')](_0x5f1709[_0xf3ba('0x2a')]);if(_0x5f1709[_0xf3ba('0x2b')]){delete _0x5f1709['name'];}_0x396089[_0xf3ba('0x1e')](_0x7effa1)['send'](_0x5f1709);};}exports['index']=function(_0x7c1a60,_0x19ef2c){var _0x5b4e0d={},_0x41c4b1={},_0x118aeb={'count':0x0,'rows':[]};var _0x5081aa=_['map'](db['JscriptyAnswerReport'][_0xf3ba('0x2c')],function(_0x6423f){return{'name':_0x6423f['fieldName'],'type':_0x6423f[_0xf3ba('0x2d')]['key']};});_0x41c4b1['model']=_[_0xf3ba('0x2e')](_0x5081aa,_0xf3ba('0x2b'));_0x41c4b1[_0xf3ba('0x2f')]=_[_0xf3ba('0x30')](_0x7c1a60[_0xf3ba('0x2f')]);_0x41c4b1[_0xf3ba('0x31')]=_['intersection'](_0x41c4b1[_0xf3ba('0x32')],_0x41c4b1['query']);_0x5b4e0d[_0xf3ba('0x33')]=_[_0xf3ba('0x34')](_0x41c4b1['model'],qs[_0xf3ba('0x35')](_0x7c1a60[_0xf3ba('0x2f')][_0xf3ba('0x35')]));_0x5b4e0d[_0xf3ba('0x33')]=_0x5b4e0d['attributes'][_0xf3ba('0x36')]?_0x5b4e0d['attributes']:_0x41c4b1['model'];if(!_0x7c1a60['query'][_0xf3ba('0x37')](_0xf3ba('0x38'))){_0x5b4e0d[_0xf3ba('0x39')]=qs[_0xf3ba('0x39')](_0x7c1a60[_0xf3ba('0x2f')]['limit']);_0x5b4e0d[_0xf3ba('0x20')]=qs['offset'](_0x7c1a60[_0xf3ba('0x2f')]['offset']);}_0x5b4e0d[_0xf3ba('0x3a')]=qs[_0xf3ba('0x3b')](_0x7c1a60[_0xf3ba('0x2f')][_0xf3ba('0x3b')]);_0x5b4e0d['where']=qs[_0xf3ba('0x31')](_[_0xf3ba('0x3c')](_0x7c1a60['query'],_0x41c4b1[_0xf3ba('0x31')]),_0x5081aa);if(_0x7c1a60[_0xf3ba('0x2f')][_0xf3ba('0x3d')]){_0x5b4e0d[_0xf3ba('0x3e')]=_[_0xf3ba('0x3f')](_0x5b4e0d[_0xf3ba('0x3e')],{'$or':_[_0xf3ba('0x2e')](_0x5081aa,function(_0x4d4f3d){if(_0x4d4f3d[_0xf3ba('0x2d')]!=='VIRTUAL'){var _0x4307db={};_0x4307db[_0x4d4f3d['name']]={'$like':'%'+_0x7c1a60[_0xf3ba('0x2f')][_0xf3ba('0x3d')]+'%'};return _0x4307db;}})});}_0x5b4e0d=_[_0xf3ba('0x3f')]({},_0x5b4e0d,_0x7c1a60[_0xf3ba('0x40')]);var _0x2cbfca={'where':_0x5b4e0d['where']};return db['JscriptyAnswerReport'][_0xf3ba('0x22')](_0x2cbfca)[_0xf3ba('0x28')](function(_0x417911){_0x118aeb[_0xf3ba('0x22')]=_0x417911;if(_0x7c1a60[_0xf3ba('0x2f')][_0xf3ba('0x41')]){_0x5b4e0d['include']=[{'all':!![]}];}return db[_0xf3ba('0x42')]['findAll'](_0x5b4e0d);})[_0xf3ba('0x28')](function(_0x239e2a){_0x118aeb[_0xf3ba('0x43')]=_0x239e2a;return _0x118aeb;})[_0xf3ba('0x28')](respondWithFilteredResult(_0x19ef2c,_0x5b4e0d))[_0xf3ba('0x44')](handleError(_0x19ef2c,null));};exports[_0xf3ba('0x45')]=function(_0x26f640,_0x3e5411){var _0x5b9a0c={'raw':!![],'where':{'id':_0x26f640[_0xf3ba('0x46')]['id']}},_0xd15662={};_0xd15662[_0xf3ba('0x32')]=_[_0xf3ba('0x30')](db[_0xf3ba('0x42')][_0xf3ba('0x2c')]);_0xd15662[_0xf3ba('0x2f')]=_['keys'](_0x26f640[_0xf3ba('0x2f')]);_0xd15662[_0xf3ba('0x31')]=_['intersection'](_0xd15662[_0xf3ba('0x32')],_0xd15662[_0xf3ba('0x2f')]);_0x5b9a0c[_0xf3ba('0x33')]=_[_0xf3ba('0x34')](_0xd15662[_0xf3ba('0x32')],qs[_0xf3ba('0x35')](_0x26f640[_0xf3ba('0x2f')][_0xf3ba('0x35')]));_0x5b9a0c[_0xf3ba('0x33')]=_0x5b9a0c[_0xf3ba('0x33')][_0xf3ba('0x36')]?_0x5b9a0c[_0xf3ba('0x33')]:_0xd15662[_0xf3ba('0x32')];if(_0x26f640[_0xf3ba('0x2f')][_0xf3ba('0x41')]){_0x5b9a0c[_0xf3ba('0x47')]=[{'all':!![]}];}_0x5b9a0c=_[_0xf3ba('0x3f')]({},_0x5b9a0c,_0x26f640[_0xf3ba('0x40')]);return db['JscriptyAnswerReport'][_0xf3ba('0x48')](_0x5b9a0c)[_0xf3ba('0x28')](handleEntityNotFound(_0x3e5411,null))['then'](respondWithResult(_0x3e5411,null))[_0xf3ba('0x44')](handleError(_0x3e5411,null));};exports[_0xf3ba('0x49')]=function(_0x188d88,_0x36f476){return db['JscriptyAnswerReport']['create'](_0x188d88[_0xf3ba('0x4a')],{})[_0xf3ba('0x28')](respondWithResult(_0x36f476,0xc9))[_0xf3ba('0x44')](handleError(_0x36f476,null));};exports[_0xf3ba('0x27')]=function(_0x502483,_0x2d3a0d){if(_0x502483[_0xf3ba('0x4a')]['id']){delete _0x502483[_0xf3ba('0x4a')]['id'];}return db['JscriptyAnswerReport'][_0xf3ba('0x48')]({'where':{'id':_0x502483[_0xf3ba('0x46')]['id']}})[_0xf3ba('0x28')](handleEntityNotFound(_0x2d3a0d,null))[_0xf3ba('0x28')](saveUpdates(_0x502483[_0xf3ba('0x4a')],null))[_0xf3ba('0x28')](respondWithResult(_0x2d3a0d,null))[_0xf3ba('0x44')](handleError(_0x2d3a0d,null));};exports[_0xf3ba('0x4b')]=function(_0x4620c0,_0x23c2c6){return db['JscriptyAnswerReport'][_0xf3ba('0x48')]({'where':{'id':_0x4620c0[_0xf3ba('0x46')]['id']}})[_0xf3ba('0x28')](handleEntityNotFound(_0x23c2c6,null))[_0xf3ba('0x28')](removeEntity(_0x23c2c6,null))['catch'](handleError(_0x23c2c6,null));};exports[_0xf3ba('0x4c')]=function(_0x5e275b,_0x5b5242){return db[_0xf3ba('0x42')][_0xf3ba('0x4c')]()[_0xf3ba('0x28')](respondWithResult(_0x5b5242,null))[_0xf3ba('0x44')](handleError(_0x5b5242,null));}; \ No newline at end of file +var _0x00b3=['includeAll','create','body','catch','find','params','describe','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','index','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyAnswerReport','include','findAll','rows','filters'];(function(_0x667324,_0x3e4ac6){var _0x498196=function(_0x3c5e41){while(--_0x3c5e41){_0x667324['push'](_0x667324['shift']());}};_0x498196(++_0x3e4ac6);}(_0x00b3,0x97));var _0x300b=function(_0x929f1,_0x58c418){_0x929f1=_0x929f1-0x0;var _0x179f9f=_0x00b3[_0x929f1];return _0x179f9f;};'use strict';var emlformat=require(_0x300b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x300b('0x1'));var rp=require(_0x300b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x300b('0x3'));var util=require(_0x300b('0x4'));var path=require(_0x300b('0x5'));var sox=require('sox');var csv=require(_0x300b('0x6'));var ejs=require(_0x300b('0x7'));var fs=require('fs');var fs_extra=require(_0x300b('0x8'));var _=require(_0x300b('0x9'));var squel=require(_0x300b('0xa'));var crypto=require(_0x300b('0xb'));var jsforce=require(_0x300b('0xc'));var deskjs=require(_0x300b('0xd'));var toCsv=require(_0x300b('0x6'));var querystring=require(_0x300b('0xe'));var Papa=require(_0x300b('0xf'));var Redis=require(_0x300b('0x10'));var authService=require(_0x300b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x300b('0x12'));var hardwareService=require(_0x300b('0x13'));var logger=require(_0x300b('0x14'))('api');var utils=require(_0x300b('0x15'));var config=require(_0x300b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12da4c,_0x51b8fc){_0x51b8fc=_0x51b8fc||0xcc;return function(_0x12b3b0){if(_0x12b3b0){return _0x12da4c[_0x300b('0x17')](_0x51b8fc);}return _0x12da4c[_0x300b('0x18')](_0x51b8fc)[_0x300b('0x19')]();};}function respondWithResult(_0x3c9f85,_0x1edb37){_0x1edb37=_0x1edb37||0xc8;return function(_0x5c507b){if(_0x5c507b){return _0x3c9f85['status'](_0x1edb37)[_0x300b('0x1a')](_0x5c507b);}};}function respondWithFilteredResult(_0x29f231,_0x14cba0){return function(_0x19ac43){if(_0x19ac43){var _0x349a29=typeof _0x14cba0[_0x300b('0x1b')]===_0x300b('0x1c')&&typeof _0x14cba0[_0x300b('0x1d')]==='undefined';var _0x41cde4=_0x19ac43[_0x300b('0x1e')];var _0x5b812f=_0x349a29?0x0:_0x14cba0[_0x300b('0x1b')];var _0x2fe0db=_0x349a29?_0x19ac43[_0x300b('0x1e')]:_0x14cba0[_0x300b('0x1b')]+_0x14cba0['limit'];var _0x1c79d7;if(_0x2fe0db>=_0x41cde4){_0x2fe0db=_0x41cde4;_0x1c79d7=0xc8;}else{_0x1c79d7=0xce;}_0x29f231[_0x300b('0x18')](_0x1c79d7);return _0x29f231[_0x300b('0x1f')](_0x300b('0x20'),_0x5b812f+'-'+_0x2fe0db+'/'+_0x41cde4)['json'](_0x19ac43);}return null;};}function patchUpdates(_0x57f111){return function(_0x5d60c0){try{jsonpatch['apply'](_0x5d60c0,_0x57f111,!![]);}catch(_0x7853ee){return BPromise[_0x300b('0x21')](_0x7853ee);}return _0x5d60c0[_0x300b('0x22')]();};}function saveUpdates(_0x466d2e,_0x5e7937){return function(_0x2724de){if(_0x2724de){return _0x2724de[_0x300b('0x23')](_0x466d2e)[_0x300b('0x24')](function(_0x3b4eee){return _0x3b4eee;});}return null;};}function removeEntity(_0x3a87d7,_0x5e4093){return function(_0x105982){if(_0x105982){return _0x105982[_0x300b('0x25')]()[_0x300b('0x24')](function(){_0x3a87d7[_0x300b('0x18')](0xcc)[_0x300b('0x19')]();});}};}function handleEntityNotFound(_0x473bfd,_0x21b8cf){return function(_0xa913e8){if(!_0xa913e8){_0x473bfd[_0x300b('0x17')](0x194);}return _0xa913e8;};}function handleError(_0x59cecc,_0x5385e6){_0x5385e6=_0x5385e6||0x1f4;return function(_0xaa84aa){logger['error'](_0xaa84aa[_0x300b('0x26')]);if(_0xaa84aa[_0x300b('0x27')]){delete _0xaa84aa[_0x300b('0x27')];}_0x59cecc[_0x300b('0x18')](_0x5385e6)['send'](_0xaa84aa);};}exports[_0x300b('0x28')]=function(_0xb2cf4d,_0x4fcf53){var _0x9eb721={},_0x1cff38={},_0x9ba13a={'count':0x0,'rows':[]};var _0x150ebe=_['map'](db['JscriptyAnswerReport'][_0x300b('0x29')],function(_0x39f2c5){return{'name':_0x39f2c5[_0x300b('0x2a')],'type':_0x39f2c5['type']['key']};});_0x1cff38[_0x300b('0x2b')]=_[_0x300b('0x2c')](_0x150ebe,_0x300b('0x27'));_0x1cff38[_0x300b('0x2d')]=_[_0x300b('0x2e')](_0xb2cf4d[_0x300b('0x2d')]);_0x1cff38['filters']=_[_0x300b('0x2f')](_0x1cff38[_0x300b('0x2b')],_0x1cff38[_0x300b('0x2d')]);_0x9eb721[_0x300b('0x30')]=_[_0x300b('0x2f')](_0x1cff38['model'],qs['fields'](_0xb2cf4d[_0x300b('0x2d')][_0x300b('0x31')]));_0x9eb721['attributes']=_0x9eb721[_0x300b('0x30')][_0x300b('0x32')]?_0x9eb721['attributes']:_0x1cff38[_0x300b('0x2b')];if(!_0xb2cf4d['query'][_0x300b('0x33')](_0x300b('0x34'))){_0x9eb721['limit']=qs[_0x300b('0x1d')](_0xb2cf4d[_0x300b('0x2d')][_0x300b('0x1d')]);_0x9eb721[_0x300b('0x1b')]=qs[_0x300b('0x1b')](_0xb2cf4d[_0x300b('0x2d')][_0x300b('0x1b')]);}_0x9eb721[_0x300b('0x35')]=qs[_0x300b('0x36')](_0xb2cf4d[_0x300b('0x2d')][_0x300b('0x36')]);_0x9eb721[_0x300b('0x37')]=qs['filters'](_[_0x300b('0x38')](_0xb2cf4d['query'],_0x1cff38['filters']),_0x150ebe);if(_0xb2cf4d[_0x300b('0x2d')][_0x300b('0x39')]){_0x9eb721['where']=_[_0x300b('0x3a')](_0x9eb721['where'],{'$or':_[_0x300b('0x2c')](_0x150ebe,function(_0x42b8ff){if(_0x42b8ff['type']!==_0x300b('0x3b')){var _0x7d023b={};_0x7d023b[_0x42b8ff[_0x300b('0x27')]]={'$like':'%'+_0xb2cf4d[_0x300b('0x2d')][_0x300b('0x39')]+'%'};return _0x7d023b;}})});}_0x9eb721=_[_0x300b('0x3a')]({},_0x9eb721,_0xb2cf4d['options']);var _0xfb87a5={'where':_0x9eb721[_0x300b('0x37')]};return db[_0x300b('0x3c')]['count'](_0xfb87a5)['then'](function(_0x41a982){_0x9ba13a[_0x300b('0x1e')]=_0x41a982;if(_0xb2cf4d[_0x300b('0x2d')]['includeAll']){_0x9eb721[_0x300b('0x3d')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x300b('0x3e')](_0x9eb721);})[_0x300b('0x24')](function(_0x4ab488){_0x9ba13a[_0x300b('0x3f')]=_0x4ab488;return _0x9ba13a;})[_0x300b('0x24')](respondWithFilteredResult(_0x4fcf53,_0x9eb721))['catch'](handleError(_0x4fcf53,null));};exports['show']=function(_0x1b8e18,_0x2037bb){var _0x5b0c07={'raw':!![],'where':{'id':_0x1b8e18['params']['id']}},_0x49fe13={};_0x49fe13[_0x300b('0x2b')]=_[_0x300b('0x2e')](db[_0x300b('0x3c')][_0x300b('0x29')]);_0x49fe13[_0x300b('0x2d')]=_[_0x300b('0x2e')](_0x1b8e18['query']);_0x49fe13[_0x300b('0x40')]=_[_0x300b('0x2f')](_0x49fe13[_0x300b('0x2b')],_0x49fe13[_0x300b('0x2d')]);_0x5b0c07[_0x300b('0x30')]=_[_0x300b('0x2f')](_0x49fe13[_0x300b('0x2b')],qs['fields'](_0x1b8e18[_0x300b('0x2d')][_0x300b('0x31')]));_0x5b0c07[_0x300b('0x30')]=_0x5b0c07[_0x300b('0x30')]['length']?_0x5b0c07[_0x300b('0x30')]:_0x49fe13[_0x300b('0x2b')];if(_0x1b8e18[_0x300b('0x2d')][_0x300b('0x41')]){_0x5b0c07['include']=[{'all':!![]}];}_0x5b0c07=_[_0x300b('0x3a')]({},_0x5b0c07,_0x1b8e18['options']);return db['JscriptyAnswerReport']['find'](_0x5b0c07)[_0x300b('0x24')](handleEntityNotFound(_0x2037bb,null))[_0x300b('0x24')](respondWithResult(_0x2037bb,null))['catch'](handleError(_0x2037bb,null));};exports[_0x300b('0x42')]=function(_0x18d519,_0x531666){return db['JscriptyAnswerReport'][_0x300b('0x42')](_0x18d519[_0x300b('0x43')],{})[_0x300b('0x24')](respondWithResult(_0x531666,0xc9))[_0x300b('0x44')](handleError(_0x531666,null));};exports['update']=function(_0x4aa017,_0x58a114){if(_0x4aa017['body']['id']){delete _0x4aa017[_0x300b('0x43')]['id'];}return db[_0x300b('0x3c')][_0x300b('0x45')]({'where':{'id':_0x4aa017[_0x300b('0x46')]['id']}})[_0x300b('0x24')](handleEntityNotFound(_0x58a114,null))[_0x300b('0x24')](saveUpdates(_0x4aa017[_0x300b('0x43')],null))[_0x300b('0x24')](respondWithResult(_0x58a114,null))['catch'](handleError(_0x58a114,null));};exports[_0x300b('0x25')]=function(_0x291a13,_0x5ec462){return db[_0x300b('0x3c')]['find']({'where':{'id':_0x291a13['params']['id']}})[_0x300b('0x24')](handleEntityNotFound(_0x5ec462,null))[_0x300b('0x24')](removeEntity(_0x5ec462,null))['catch'](handleError(_0x5ec462,null));};exports[_0x300b('0x47')]=function(_0x33c352,_0x1215a9){return db['JscriptyAnswerReport'][_0x300b('0x47')]()[_0x300b('0x24')](respondWithResult(_0x1215a9,null))['catch'](handleError(_0x1215a9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c15d24e..fd92b6a 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 _0x2e28=['report_jscripty_answers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0x5e2aa4,_0x2a3c0c){var _0x7bac53=function(_0xc78180){while(--_0xc78180){_0x5e2aa4['push'](_0x5e2aa4['shift']());}};_0x7bac53(++_0x2a3c0c);}(_0x2e28,0x139));var _0x82e2=function(_0x4807ce,_0x5108dc){_0x4807ce=_0x4807ce-0x0;var _0x5afe28=_0x2e28[_0x4807ce];return _0x5afe28;};'use strict';var _=require(_0x82e2('0x0'));var util=require(_0x82e2('0x1'));var logger=require(_0x82e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x82e2('0x3'));var rp=require(_0x82e2('0x4'));var fs=require('fs');var path=require(_0x82e2('0x5'));var rimraf=require(_0x82e2('0x6'));var config=require(_0x82e2('0x7'));var attributes=require(_0x82e2('0x8'));module[_0x82e2('0x9')]=function(_0x227d87,_0x1d00fd){return _0x227d87[_0x82e2('0xa')](_0x82e2('0xb'),attributes,{'tableName':_0x82e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4341=['../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','api','moment','bluebird','request-promise','path'];(function(_0x20d0bc,_0x44f58a){var _0x47d062=function(_0x5bdd15){while(--_0x5bdd15){_0x20d0bc['push'](_0x20d0bc['shift']());}};_0x47d062(++_0x44f58a);}(_0x4341,0x1d3));var _0x1434=function(_0x4607e1,_0x596f78){_0x4607e1=_0x4607e1-0x0;var _0x22f1b2=_0x4341[_0x4607e1];return _0x22f1b2;};'use strict';var _=require('lodash');var util=require(_0x1434('0x0'));var logger=require('../../config/logger')(_0x1434('0x1'));var moment=require(_0x1434('0x2'));var BPromise=require(_0x1434('0x3'));var rp=require(_0x1434('0x4'));var fs=require('fs');var path=require(_0x1434('0x5'));var rimraf=require('rimraf');var config=require(_0x1434('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x1434('0x7')]=function(_0x528180,_0x2d0cb9){return _0x528180[_0x1434('0x8')](_0x1434('0x9'),attributes,{'tableName':_0x1434('0xa'),'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 d2ee538..a43a47e 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 _0x0a48=['stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0xea26ce,_0x3a66f6){var _0x535908=function(_0x56a621){while(--_0x56a621){_0xea26ce['push'](_0xea26ce['shift']());}};_0x535908(++_0x3a66f6);}(_0x0a48,0x157));var _0x80a4=function(_0x2dfd68,_0x2fa790){_0x2dfd68=_0x2dfd68-0x0;var _0x4a2a63=_0x0a48[_0x2dfd68];return _0x4a2a63;};'use strict';var _=require(_0x80a4('0x0'));var util=require('util');var moment=require(_0x80a4('0x1'));var BPromise=require(_0x80a4('0x2'));var rs=require(_0x80a4('0x3'));var fs=require('fs');var Redis=require(_0x80a4('0x4'));var db=require(_0x80a4('0x5'))['db'];var utils=require(_0x80a4('0x6'));var logger=require(_0x80a4('0x7'))(_0x80a4('0x8'));var config=require(_0x80a4('0x9'));var jayson=require(_0x80a4('0xa'));var client=jayson[_0x80a4('0xb')][_0x80a4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x403d7f,_0x2a0ee7,_0x22c71b){return new BPromise(function(_0x488b49,_0x30e9d4){return client['request'](_0x403d7f,_0x22c71b)[_0x80a4('0xd')](function(_0x36d26f){logger[_0x80a4('0xe')](_0x80a4('0xf'),_0x2a0ee7,'request\x20sent');logger['debug'](_0x80a4('0x10'),_0x2a0ee7,'request\x20sent',JSON[_0x80a4('0x11')](_0x36d26f));if(_0x36d26f[_0x80a4('0x12')]){if(_0x36d26f['error'][_0x80a4('0x13')]===0x1f4){logger[_0x80a4('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2a0ee7,_0x36d26f[_0x80a4('0x12')][_0x80a4('0x14')]);return _0x30e9d4(_0x36d26f[_0x80a4('0x12')][_0x80a4('0x14')]);}logger[_0x80a4('0x12')](_0x80a4('0xf'),_0x2a0ee7,_0x36d26f[_0x80a4('0x12')][_0x80a4('0x14')]);return _0x488b49(_0x36d26f[_0x80a4('0x12')][_0x80a4('0x14')]);}else{logger[_0x80a4('0xe')](_0x80a4('0xf'),_0x2a0ee7,_0x80a4('0x15'));_0x488b49(_0x36d26f[_0x80a4('0x16')]['message']);}})[_0x80a4('0x17')](function(_0x567b20){logger[_0x80a4('0x12')](_0x80a4('0xf'),_0x2a0ee7,_0x567b20);_0x30e9d4(_0x567b20);});});} \ No newline at end of file +var _0x5c29=['stringify','JscriptyAnswerReport,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0x5c29,0x17c));var _0x95c2=function(_0x343bfe,_0x17808d){_0x343bfe=_0x343bfe-0x0;var _0x144921=_0x5c29[_0x343bfe];return _0x144921;};'use strict';var _=require('lodash');var util=require(_0x95c2('0x0'));var moment=require(_0x95c2('0x1'));var BPromise=require(_0x95c2('0x2'));var rs=require(_0x95c2('0x3'));var fs=require('fs');var Redis=require(_0x95c2('0x4'));var db=require(_0x95c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95c2('0x6'))('rpc');var config=require(_0x95c2('0x7'));var jayson=require(_0x95c2('0x8'));var client=jayson[_0x95c2('0x9')][_0x95c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1af20e,_0x5717e2,_0xb9d2a){return new BPromise(function(_0x4be0cd,_0x1e33f0){return client[_0x95c2('0xb')](_0x1af20e,_0xb9d2a)[_0x95c2('0xc')](function(_0x1cd62d){logger[_0x95c2('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5717e2,_0x95c2('0xe'));logger['debug'](_0x95c2('0xf'),_0x5717e2,'request\x20sent',JSON[_0x95c2('0x10')](_0x1cd62d));if(_0x1cd62d['error']){if(_0x1cd62d['error']['code']===0x1f4){logger['error'](_0x95c2('0x11'),_0x5717e2,_0x1cd62d[_0x95c2('0x12')][_0x95c2('0x13')]);return _0x1e33f0(_0x1cd62d[_0x95c2('0x12')]['message']);}logger['error'](_0x95c2('0x11'),_0x5717e2,_0x1cd62d[_0x95c2('0x12')][_0x95c2('0x13')]);return _0x4be0cd(_0x1cd62d['error'][_0x95c2('0x13')]);}else{logger['info'](_0x95c2('0x11'),_0x5717e2,_0x95c2('0xe'));_0x4be0cd(_0x1cd62d[_0x95c2('0x14')][_0x95c2('0x13')]);}})[_0x95c2('0x15')](function(_0x2106fa){logger[_0x95c2('0x12')](_0x95c2('0x11'),_0x5717e2,_0x2106fa);_0x1e33f0(_0x2106fa);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8f75e83..da47094 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 _0xa279=['isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0xa279,0x1c5));var _0x9a27=function(_0xe1e7f5,_0x34da23){_0xe1e7f5=_0xe1e7f5-0x0;var _0x3d4154=_0xa279[_0xe1e7f5];return _0x3d4154;};'use strict';var multer=require(_0x9a27('0x0'));var util=require(_0x9a27('0x1'));var path=require('path');var timeout=require(_0x9a27('0x2'));var express=require(_0x9a27('0x3'));var router=express[_0x9a27('0x4')]();var fs_extra=require(_0x9a27('0x5'));var auth=require(_0x9a27('0x6'));var interaction=require(_0x9a27('0x7'));var config=require(_0x9a27('0x8'));var controller=require(_0x9a27('0x9'));router[_0x9a27('0xa')]('/',auth[_0x9a27('0xb')](),controller[_0x9a27('0xc')]);router[_0x9a27('0xa')](_0x9a27('0xd'),auth[_0x9a27('0xb')](),controller[_0x9a27('0xe')]);router['get'](_0x9a27('0xf'),auth['isAuthenticated'](),controller[_0x9a27('0x10')]);router[_0x9a27('0xa')](_0x9a27('0x11'),auth['isAuthenticated'](),controller[_0x9a27('0x12')]);router['get'](_0x9a27('0x13'),auth[_0x9a27('0xb')](),timeout(_0x9a27('0x14')),controller['getSummary']);router[_0x9a27('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9a27('0x16'),auth[_0x9a27('0xb')](),controller[_0x9a27('0x17')]);router[_0x9a27('0x18')](_0x9a27('0xd'),auth[_0x9a27('0xb')](),controller[_0x9a27('0x19')]);router[_0x9a27('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x9a27('0x1b')]);module[_0x9a27('0x1c')]=router; \ No newline at end of file +var _0xe050=['update','delete','destroy','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','clone','put','/:id'];(function(_0x1fbe59,_0x45dd45){var _0x315b32=function(_0x403fe){while(--_0x403fe){_0x1fbe59['push'](_0x1fbe59['shift']());}};_0x315b32(++_0x45dd45);}(_0xe050,0x179));var _0x0e05=function(_0x23e40,_0x52da54){_0x23e40=_0x23e40-0x0;var _0x6f5131=_0xe050[_0x23e40];return _0x6f5131;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0e05('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0e05('0x1'));var interaction=require(_0x0e05('0x2'));var config=require(_0x0e05('0x3'));var controller=require('./jscriptyProject.controller');router[_0x0e05('0x4')]('/',auth[_0x0e05('0x5')](),controller[_0x0e05('0x6')]);router[_0x0e05('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x0e05('0x7')]);router[_0x0e05('0x4')](_0x0e05('0x8'),auth[_0x0e05('0x5')](),controller[_0x0e05('0x9')]);router['get'](_0x0e05('0xa'),auth[_0x0e05('0x5')](),controller['getAnswers']);router[_0x0e05('0x4')](_0x0e05('0xb'),auth['isAuthenticated'](),timeout(_0x0e05('0xc')),controller[_0x0e05('0xd')]);router[_0x0e05('0xe')]('/',auth[_0x0e05('0x5')](),controller[_0x0e05('0xf')]);router[_0x0e05('0xe')]('/:id/clone',auth['isAuthenticated'](),controller[_0x0e05('0x10')]);router[_0x0e05('0x11')](_0x0e05('0x12'),auth[_0x0e05('0x5')](),controller[_0x0e05('0x13')]);router[_0x0e05('0x14')](_0x0e05('0x12'),auth['isAuthenticated'](),controller[_0x0e05('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index fab2a11..2c9030b 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 _0x3130=['setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','sequelize','util','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString'];(function(_0x1de2bd,_0x953fb){var _0x595960=function(_0xea260b){while(--_0xea260b){_0x1de2bd['push'](_0x1de2bd['shift']());}};_0x595960(++_0x953fb);}(_0x3130,0xed));var _0x0313=function(_0x35837d,_0x1c3711){_0x35837d=_0x35837d-0x0;var _0x192bec=_0x3130[_0x35837d];return _0x192bec;};'use strict';var Sequelize=require(_0x0313('0x0'));var _=require('lodash');var util=require(_0x0313('0x1'));module['exports']={'name':{'type':Sequelize[_0x0313('0x2')],'unique':_0x0313('0x3')},'description':{'type':Sequelize[_0x0313('0x2')]},'formData':{'type':Sequelize[_0x0313('0x4')](_0x0313('0x5')),'set':function(_0x142459){if(_[_0x0313('0x6')](_0x142459)){this['setDataValue'](_0x0313('0x7'),JSON[_0x0313('0x8')](_0x142459));}else if(_[_0x0313('0x9')](_0x142459)){this[_0x0313('0xa')](_0x0313('0x7'),_0x142459);}else{this[_0x0313('0xa')](_0x0313('0x7'),util['format'](_0x0313('0xb'),this[_0x0313('0xc')](_0x0313('0x3'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8920=['util','exports','long','isObjectLike','stringify','isString','formData','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0x8920,0x195));var _0x0892=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8920[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x0892('0x0'));var _=require('lodash');var util=require(_0x0892('0x1'));module[_0x0892('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x0892('0x3')),'set':function(_0x38303e){if(_[_0x0892('0x4')](_0x38303e)){this['setDataValue']('formData',JSON[_0x0892('0x5')](_0x38303e));}else if(_[_0x0892('0x6')](_0x38303e)){this['setDataValue'](_0x0892('0x7'),_0x38303e);}else{this[_0x0892('0x8')](_0x0892('0x7'),util[_0x0892('0x9')](_0x0892('0xa'),this[_0x0892('0xb')]('name')||'',this[_0x0892('0xb')](_0x0892('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0892('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 8b76200..1696fe5 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 _0xb1a4=['writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','offset','undefined','count','status','set','Content-Range','apply','reject','update','then','get','Projects','UserProfileResource','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','destroy','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','getAnswers','order','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','isEmpty','now'];(function(_0x25d4b7,_0x1139fe){var _0x2ef539=function(_0xb581cf){while(--_0xb581cf){_0x25d4b7['push'](_0x25d4b7['shift']());}};_0x2ef539(++_0x1139fe);}(_0xb1a4,0x16a));var _0x4b1a=function(_0x3a68e9,_0x3ef131){_0x3a68e9=_0x3a68e9-0x0;var _0x1fe113=_0xb1a4[_0x3a68e9];return _0x1fe113;};'use strict';var emlformat=require(_0x4b1a('0x0'));var rimraf=require(_0x4b1a('0x1'));var zipdir=require(_0x4b1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4b1a('0x3'));var Mustache=require(_0x4b1a('0x4'));var util=require('util');var path=require(_0x4b1a('0x5'));var sox=require('sox');var csv=require(_0x4b1a('0x6'));var ejs=require(_0x4b1a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b1a('0x8'));var squel=require(_0x4b1a('0x9'));var crypto=require(_0x4b1a('0xa'));var jsforce=require(_0x4b1a('0xb'));var deskjs=require(_0x4b1a('0xc'));var toCsv=require(_0x4b1a('0x6'));var querystring=require('querystring');var Papa=require(_0x4b1a('0xd'));var Redis=require(_0x4b1a('0xe'));var authService=require(_0x4b1a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b1a('0x10'));var logger=require('../../config/logger')(_0x4b1a('0x11'));var utils=require(_0x4b1a('0x12'));var config=require(_0x4b1a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b1a('0x14'))['db'];function respondWithStatusCode(_0x51b5ac,_0x5e7f0c){_0x5e7f0c=_0x5e7f0c||0xcc;return function(_0x5d47ef){if(_0x5d47ef){return _0x51b5ac['sendStatus'](_0x5e7f0c);}return _0x51b5ac['status'](_0x5e7f0c)[_0x4b1a('0x15')]();};}function respondWithResult(_0x5bfdaa,_0x1bad04){_0x1bad04=_0x1bad04||0xc8;return function(_0x470cc1){if(_0x470cc1){return _0x5bfdaa['status'](_0x1bad04)['json'](_0x470cc1);}};}function respondWithFilteredResult(_0x54abe5,_0x1920e8){return function(_0x3350b8){if(_0x3350b8){var _0x438092=typeof _0x1920e8[_0x4b1a('0x16')]===_0x4b1a('0x17')&&typeof _0x1920e8['limit']==='undefined';var _0x173139=_0x3350b8[_0x4b1a('0x18')];var _0x5887ae=_0x438092?0x0:_0x1920e8[_0x4b1a('0x16')];var _0xa77f53=_0x438092?_0x3350b8[_0x4b1a('0x18')]:_0x1920e8[_0x4b1a('0x16')]+_0x1920e8['limit'];var _0x4cdbc0;if(_0xa77f53>=_0x173139){_0xa77f53=_0x173139;_0x4cdbc0=0xc8;}else{_0x4cdbc0=0xce;}_0x54abe5[_0x4b1a('0x19')](_0x4cdbc0);return _0x54abe5[_0x4b1a('0x1a')](_0x4b1a('0x1b'),_0x5887ae+'-'+_0xa77f53+'/'+_0x173139)['json'](_0x3350b8);}return null;};}function patchUpdates(_0x501ae1){return function(_0x2cb261){try{jsonpatch[_0x4b1a('0x1c')](_0x2cb261,_0x501ae1,!![]);}catch(_0x170e4c){return BPromise[_0x4b1a('0x1d')](_0x170e4c);}return _0x2cb261['save']();};}function saveUpdates(_0x1156b5,_0x33ef81){return function(_0xbfd042){if(_0xbfd042){return _0xbfd042[_0x4b1a('0x1e')](_0x1156b5)[_0x4b1a('0x1f')](function(_0x2250ed){return _0x2250ed;});}return null;};}function removeEntity(_0x462c8a,_0x5bbd70){return function(_0x368a9e){if(_0x368a9e){return _0x368a9e['destroy']()[_0x4b1a('0x1f')](function(){var _0x1becd5=_0x368a9e[_0x4b1a('0x20')]({'plain':!![]});var _0x4342d4=_0x4b1a('0x21');return db[_0x4b1a('0x22')]['destroy']({'where':{'type':_0x4342d4,'resourceId':_0x1becd5['id']}})[_0x4b1a('0x1f')](function(){return _0x368a9e;});})[_0x4b1a('0x1f')](function(){_0x462c8a[_0x4b1a('0x19')](0xcc)[_0x4b1a('0x15')]();});}};}function handleEntityNotFound(_0x368626,_0xa516){return function(_0x448da3){if(!_0x448da3){_0x368626[_0x4b1a('0x23')](0x194);}return _0x448da3;};}function handleError(_0x317923,_0x114413){_0x114413=_0x114413||0x1f4;return function(_0x35f399){logger[_0x4b1a('0x24')](_0x35f399[_0x4b1a('0x25')]);if(_0x35f399[_0x4b1a('0x26')]){delete _0x35f399[_0x4b1a('0x26')];}_0x317923[_0x4b1a('0x19')](_0x114413)[_0x4b1a('0x27')](_0x35f399);};}exports[_0x4b1a('0x28')]=function(_0x5893e0,_0x4bd38c){var _0xed54b1={},_0x2cc0ce={},_0x215045={'count':0x0,'rows':[]};var _0x220058=_[_0x4b1a('0x29')](db[_0x4b1a('0x2a')][_0x4b1a('0x2b')],function(_0x34cfe0){return{'name':_0x34cfe0['fieldName'],'type':_0x34cfe0[_0x4b1a('0x2c')][_0x4b1a('0x2d')]};});_0x2cc0ce['model']=_[_0x4b1a('0x29')](_0x220058,_0x4b1a('0x26'));_0x2cc0ce[_0x4b1a('0x2e')]=_[_0x4b1a('0x2f')](_0x5893e0[_0x4b1a('0x2e')]);_0x2cc0ce['filters']=_[_0x4b1a('0x30')](_0x2cc0ce[_0x4b1a('0x31')],_0x2cc0ce[_0x4b1a('0x2e')]);_0xed54b1[_0x4b1a('0x32')]=_[_0x4b1a('0x30')](_0x2cc0ce[_0x4b1a('0x31')],qs[_0x4b1a('0x33')](_0x5893e0[_0x4b1a('0x2e')]['fields']));_0xed54b1[_0x4b1a('0x32')]=_0xed54b1[_0x4b1a('0x32')][_0x4b1a('0x34')]?_0xed54b1['attributes']:_0x2cc0ce['model'];if(!_0x5893e0[_0x4b1a('0x2e')]['hasOwnProperty'](_0x4b1a('0x35'))){_0xed54b1[_0x4b1a('0x36')]=qs[_0x4b1a('0x36')](_0x5893e0[_0x4b1a('0x2e')]['limit']);_0xed54b1[_0x4b1a('0x16')]=qs[_0x4b1a('0x16')](_0x5893e0['query'][_0x4b1a('0x16')]);}_0xed54b1['order']=qs[_0x4b1a('0x37')](_0x5893e0[_0x4b1a('0x2e')][_0x4b1a('0x37')]);_0xed54b1['where']=qs[_0x4b1a('0x38')](_[_0x4b1a('0x39')](_0x5893e0[_0x4b1a('0x2e')],_0x2cc0ce[_0x4b1a('0x38')]),_0x220058);if(_0x5893e0[_0x4b1a('0x2e')][_0x4b1a('0x3a')]){_0xed54b1[_0x4b1a('0x3b')]=_[_0x4b1a('0x3c')](_0xed54b1[_0x4b1a('0x3b')],{'$or':_['map'](_0x220058,function(_0x2f493d){if(_0x2f493d[_0x4b1a('0x2c')]!==_0x4b1a('0x3d')){var _0xeb70c={};_0xeb70c[_0x2f493d[_0x4b1a('0x26')]]={'$like':'%'+_0x5893e0[_0x4b1a('0x2e')][_0x4b1a('0x3a')]+'%'};return _0xeb70c;}})});}_0xed54b1=_[_0x4b1a('0x3c')]({},_0xed54b1,_0x5893e0[_0x4b1a('0x3e')]);var _0x4d4747={'where':_0xed54b1[_0x4b1a('0x3b')]};return db[_0x4b1a('0x2a')][_0x4b1a('0x18')](_0x4d4747)[_0x4b1a('0x1f')](function(_0x5d00c0){_0x215045['count']=_0x5d00c0;if(_0x5893e0['query'][_0x4b1a('0x3f')]){_0xed54b1[_0x4b1a('0x40')]=[{'all':!![]}];}return db[_0x4b1a('0x2a')][_0x4b1a('0x41')](_0xed54b1);})[_0x4b1a('0x1f')](function(_0x4f4c77){_0x215045[_0x4b1a('0x42')]=_0x4f4c77;return _0x215045;})[_0x4b1a('0x1f')](respondWithFilteredResult(_0x4bd38c,_0xed54b1))[_0x4b1a('0x43')](handleError(_0x4bd38c,null));};exports[_0x4b1a('0x44')]=function(_0x46bf77,_0x161543){var _0x3db7a9={'raw':![],'where':{'id':_0x46bf77[_0x4b1a('0x45')]['id']}},_0x1a863e={};_0x1a863e[_0x4b1a('0x31')]=_[_0x4b1a('0x2f')](db[_0x4b1a('0x2a')][_0x4b1a('0x2b')]);_0x1a863e['query']=_[_0x4b1a('0x2f')](_0x46bf77['query']);_0x1a863e[_0x4b1a('0x38')]=_[_0x4b1a('0x30')](_0x1a863e[_0x4b1a('0x31')],_0x1a863e[_0x4b1a('0x2e')]);_0x3db7a9[_0x4b1a('0x32')]=_[_0x4b1a('0x30')](_0x1a863e['model'],qs[_0x4b1a('0x33')](_0x46bf77[_0x4b1a('0x2e')][_0x4b1a('0x33')]));_0x3db7a9[_0x4b1a('0x32')]=_0x3db7a9[_0x4b1a('0x32')]['length']?_0x3db7a9['attributes']:_0x1a863e['model'];if(_0x46bf77[_0x4b1a('0x2e')][_0x4b1a('0x3f')]){_0x3db7a9[_0x4b1a('0x40')]=[{'all':!![]}];}_0x3db7a9=_[_0x4b1a('0x3c')]({},_0x3db7a9,_0x46bf77[_0x4b1a('0x3e')]);return db[_0x4b1a('0x2a')][_0x4b1a('0x46')](_0x3db7a9)['then'](handleEntityNotFound(_0x161543,null))[_0x4b1a('0x1f')](respondWithResult(_0x161543,null))[_0x4b1a('0x43')](handleError(_0x161543,null));};exports[_0x4b1a('0x47')]=function(_0x601ecd,_0x4c3b46){return db[_0x4b1a('0x2a')][_0x4b1a('0x47')](_0x601ecd[_0x4b1a('0x48')],{})[_0x4b1a('0x1f')](function(_0x257e24){var _0x35966f=_0x601ecd[_0x4b1a('0x49')][_0x4b1a('0x20')]({'plain':!![]});if(!_0x35966f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35966f[_0x4b1a('0x4a')]===_0x4b1a('0x49')){var _0x1facd9=_0x257e24[_0x4b1a('0x20')]({'plain':!![]});var _0x42d686=_0x4b1a('0x21');return db[_0x4b1a('0x4b')][_0x4b1a('0x46')]({'where':{'name':_0x42d686,'userProfileId':_0x35966f[_0x4b1a('0x4c')]},'raw':!![]})[_0x4b1a('0x1f')](function(_0x3aa309){if(_0x3aa309&&_0x3aa309[_0x4b1a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x1facd9[_0x4b1a('0x26')],'resourceId':_0x1facd9['id'],'type':_0x3aa309['name'],'sectionId':_0x3aa309['id']},{})['then'](function(){return _0x257e24;});}else{return _0x257e24;}})[_0x4b1a('0x43')](function(_0x1b897c){logger[_0x4b1a('0x24')](_0x4b1a('0x4e'),_0x1b897c);throw _0x1b897c;});}return _0x257e24;})[_0x4b1a('0x1f')](respondWithResult(_0x4c3b46,0xc9))[_0x4b1a('0x43')](handleError(_0x4c3b46,null));};exports[_0x4b1a('0x4f')]=function(_0x3866a4,_0x1668b6){var _0x371ccf={'where':{'id':_0x3866a4[_0x4b1a('0x45')]['id']}},_0x208100={};_0x208100['model']=_[_0x4b1a('0x2f')](db['JscriptyProject'][_0x4b1a('0x2b')]);_0x371ccf['attributes']=_[_0x4b1a('0x30')](_0x208100[_0x4b1a('0x31')],qs['fields'](_0x3866a4[_0x4b1a('0x2e')][_0x4b1a('0x33')]));_0x371ccf['attributes']=_0x371ccf[_0x4b1a('0x32')][_0x4b1a('0x34')]?_0x371ccf[_0x4b1a('0x32')]:_0x208100[_0x4b1a('0x31')];if(_0x3866a4[_0x4b1a('0x2e')]['includeAll']){_0x371ccf['include']=[{'all':!![]}];}_0x371ccf=_[_0x4b1a('0x3c')]({},_0x371ccf,_0x3866a4['options']);return db[_0x4b1a('0x2a')][_0x4b1a('0x46')](_0x371ccf)[_0x4b1a('0x1f')](handleEntityNotFound(_0x1668b6,null))[_0x4b1a('0x1f')](function(_0x4950ab){if(_0x4950ab){var _0x48976d=_0x4950ab[_0x4b1a('0x20')]({'plain':!![]});_0x48976d=qs[_0x4b1a('0x50')](_0x48976d,['id',_0x4b1a('0x51'),_0x4b1a('0x52')]);_0x3866a4[_0x4b1a('0x48')]=_[_0x4b1a('0x50')](_0x3866a4[_0x4b1a('0x48')],['id',_0x4b1a('0x51'),'updatedAt']);return db[_0x4b1a('0x2a')][_0x4b1a('0x47')](_[_0x4b1a('0x3c')](_0x48976d,_0x3866a4[_0x4b1a('0x48')]),{'include':_0x3866a4[_0x4b1a('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x4b1a('0x1f')](function(_0x1eff9f){var _0x30ce51=_0x3866a4['user'][_0x4b1a('0x20')]({'plain':!![]});if(!_0x30ce51)throw new Error(_0x4b1a('0x53'));if(_0x30ce51[_0x4b1a('0x4a')]===_0x4b1a('0x49')){var _0x2180cc=_0x1eff9f[_0x4b1a('0x20')]({'plain':!![]});var _0xc65a46=_0x4b1a('0x21');return db[_0x4b1a('0x4b')][_0x4b1a('0x46')]({'where':{'name':_0xc65a46,'userProfileId':_0x30ce51[_0x4b1a('0x4c')]},'raw':!![]})[_0x4b1a('0x1f')](function(_0x54ebed){if(_0x54ebed&&_0x54ebed['autoAssociation']===0x0){return db[_0x4b1a('0x22')][_0x4b1a('0x47')]({'name':_0x2180cc[_0x4b1a('0x26')],'resourceId':_0x2180cc['id'],'type':_0x54ebed[_0x4b1a('0x26')],'sectionId':_0x54ebed['id']},{})[_0x4b1a('0x1f')](function(){return _0x1eff9f;});}else{return _0x1eff9f;}})[_0x4b1a('0x43')](function(_0x33d038){logger[_0x4b1a('0x24')](_0x4b1a('0x4e'),_0x33d038);throw _0x33d038;});}return _0x1eff9f;});}})[_0x4b1a('0x1f')](respondWithResult(_0x1668b6,0xc9))[_0x4b1a('0x43')](handleError(_0x1668b6,null));};exports[_0x4b1a('0x1e')]=function(_0x2b8891,_0x1e72bc){if(_0x2b8891['body']['id']){delete _0x2b8891[_0x4b1a('0x48')]['id'];}return db[_0x4b1a('0x2a')][_0x4b1a('0x46')]({'where':{'id':_0x2b8891['params']['id']}})[_0x4b1a('0x1f')](handleEntityNotFound(_0x1e72bc,null))[_0x4b1a('0x1f')](saveUpdates(_0x2b8891[_0x4b1a('0x48')],null))[_0x4b1a('0x1f')](respondWithResult(_0x1e72bc,null))[_0x4b1a('0x43')](handleError(_0x1e72bc,null));};exports[_0x4b1a('0x54')]=function(_0x5d7841,_0x4cceb8){return db[_0x4b1a('0x2a')][_0x4b1a('0x46')]({'where':{'id':_0x5d7841['params']['id']}})[_0x4b1a('0x1f')](handleEntityNotFound(_0x4cceb8,null))['then'](removeEntity(_0x4cceb8,null))[_0x4b1a('0x43')](handleError(_0x4cceb8,null));};exports['getSessions']=function(_0x45a2a4,_0x166302,_0x4ee029){var _0x46be0e={'raw':!![],'where':{}};var _0x206d04={};var _0x33f33c={'count':0x0,'rows':[]};return db[_0x4b1a('0x2a')][_0x4b1a('0x55')]({'where':{'id':_0x45a2a4['params']['id']}})[_0x4b1a('0x1f')](handleEntityNotFound(_0x166302,null))[_0x4b1a('0x1f')](function(_0x49a649){if(_0x49a649){_0x206d04[_0x4b1a('0x31')]=_[_0x4b1a('0x2f')](db[_0x4b1a('0x56')][_0x4b1a('0x2b')]);_0x206d04[_0x4b1a('0x2e')]=_[_0x4b1a('0x2f')](_0x45a2a4[_0x4b1a('0x2e')]);_0x206d04[_0x4b1a('0x38')]=_[_0x4b1a('0x30')](_0x206d04['model'],_0x206d04[_0x4b1a('0x2e')]);_0x46be0e[_0x4b1a('0x32')]=_[_0x4b1a('0x30')](_0x206d04[_0x4b1a('0x31')],qs[_0x4b1a('0x33')](_0x45a2a4[_0x4b1a('0x2e')][_0x4b1a('0x33')]));_0x46be0e['attributes']=_0x46be0e[_0x4b1a('0x32')][_0x4b1a('0x34')]?_0x46be0e[_0x4b1a('0x32')]:_0x206d04[_0x4b1a('0x31')];if(!_0x45a2a4[_0x4b1a('0x2e')][_0x4b1a('0x57')](_0x4b1a('0x35'))){_0x46be0e[_0x4b1a('0x36')]=qs[_0x4b1a('0x36')](_0x45a2a4[_0x4b1a('0x2e')][_0x4b1a('0x36')]);_0x46be0e[_0x4b1a('0x16')]=qs[_0x4b1a('0x16')](_0x45a2a4[_0x4b1a('0x2e')][_0x4b1a('0x16')]);}_0x46be0e['order']=qs[_0x4b1a('0x37')](_0x45a2a4['query']['sort']);_0x46be0e[_0x4b1a('0x3b')]=qs[_0x4b1a('0x38')](_[_0x4b1a('0x39')](_0x45a2a4[_0x4b1a('0x2e')],_0x206d04[_0x4b1a('0x38')]));_0x46be0e[_0x4b1a('0x3b')][_0x4b1a('0x58')]=_0x49a649['id'];if(_0x45a2a4['query'][_0x4b1a('0x3a')]){_0x46be0e[_0x4b1a('0x3b')]=_['merge'](_0x46be0e['where'],{'$or':_[_0x4b1a('0x29')](_0x46be0e[_0x4b1a('0x32')],function(_0x3fc193){var _0x203194={};_0x203194[_0x3fc193]={'$like':'%'+_0x45a2a4[_0x4b1a('0x2e')]['filter']+'%'};return _0x203194;})});}_0x46be0e=_[_0x4b1a('0x3c')]({},_0x46be0e,_0x45a2a4[_0x4b1a('0x3e')]);return db['JscriptySessionReport'][_0x4b1a('0x18')]({'where':_0x46be0e['where']})['then'](function(_0x55af1d){_0x33f33c['count']=_0x55af1d;if(_0x45a2a4[_0x4b1a('0x2e')][_0x4b1a('0x3f')]){_0x46be0e[_0x4b1a('0x40')]=[{'all':!![]}];}return db[_0x4b1a('0x56')][_0x4b1a('0x41')](_0x46be0e);})[_0x4b1a('0x1f')](function(_0x552cbe){_0x33f33c['rows']=_0x552cbe;return _0x33f33c;});}})[_0x4b1a('0x1f')](respondWithFilteredResult(_0x166302,_0x46be0e))['catch'](handleError(_0x166302,null));};exports[_0x4b1a('0x59')]=function(_0x3dbc75,_0x1d6728,_0x462c54){var _0x4f8c2b={'raw':!![],'where':{}};var _0x538f77={};var _0x5b85d8={'count':0x0,'rows':[]};return db[_0x4b1a('0x2a')][_0x4b1a('0x55')]({'where':{'id':_0x3dbc75[_0x4b1a('0x45')]['id']}})[_0x4b1a('0x1f')](handleEntityNotFound(_0x1d6728,null))['then'](function(_0x5306f1){if(_0x5306f1){_0x538f77[_0x4b1a('0x31')]=_[_0x4b1a('0x2f')](db['JscriptyAnswerReport'][_0x4b1a('0x2b')]);_0x538f77[_0x4b1a('0x2e')]=_['keys'](_0x3dbc75[_0x4b1a('0x2e')]);_0x538f77['filters']=_[_0x4b1a('0x30')](_0x538f77[_0x4b1a('0x31')],_0x538f77[_0x4b1a('0x2e')]);_0x4f8c2b[_0x4b1a('0x32')]=_['intersection'](_0x538f77[_0x4b1a('0x31')],qs[_0x4b1a('0x33')](_0x3dbc75[_0x4b1a('0x2e')][_0x4b1a('0x33')]));_0x4f8c2b[_0x4b1a('0x32')]=_0x4f8c2b[_0x4b1a('0x32')][_0x4b1a('0x34')]?_0x4f8c2b[_0x4b1a('0x32')]:_0x538f77['model'];if(!_0x3dbc75[_0x4b1a('0x2e')][_0x4b1a('0x57')](_0x4b1a('0x35'))){_0x4f8c2b[_0x4b1a('0x36')]=qs['limit'](_0x3dbc75['query'][_0x4b1a('0x36')]);_0x4f8c2b['offset']=qs[_0x4b1a('0x16')](_0x3dbc75[_0x4b1a('0x2e')][_0x4b1a('0x16')]);}_0x4f8c2b[_0x4b1a('0x5a')]=qs['sort'](_0x3dbc75[_0x4b1a('0x2e')][_0x4b1a('0x37')]);_0x4f8c2b['where']=qs[_0x4b1a('0x38')](_[_0x4b1a('0x39')](_0x3dbc75[_0x4b1a('0x2e')],_0x538f77[_0x4b1a('0x38')]));_0x4f8c2b['where'][_0x4b1a('0x58')]=_0x5306f1['id'];if(_0x3dbc75['query'][_0x4b1a('0x3a')]){_0x4f8c2b[_0x4b1a('0x3b')]=_[_0x4b1a('0x3c')](_0x4f8c2b['where'],{'$or':_[_0x4b1a('0x29')](_0x4f8c2b[_0x4b1a('0x32')],function(_0x25afc3){var _0x3f9be8={};_0x3f9be8[_0x25afc3]={'$like':'%'+_0x3dbc75[_0x4b1a('0x2e')][_0x4b1a('0x3a')]+'%'};return _0x3f9be8;})});}_0x4f8c2b=_[_0x4b1a('0x3c')]({},_0x4f8c2b,_0x3dbc75[_0x4b1a('0x3e')]);return db[_0x4b1a('0x5b')][_0x4b1a('0x18')]({'where':_0x4f8c2b[_0x4b1a('0x3b')]})[_0x4b1a('0x1f')](function(_0x46f4a9){_0x5b85d8[_0x4b1a('0x18')]=_0x46f4a9;if(_0x3dbc75[_0x4b1a('0x2e')][_0x4b1a('0x3f')]){_0x4f8c2b[_0x4b1a('0x40')]=[{'all':!![]}];}return db[_0x4b1a('0x5b')]['findAll'](_0x4f8c2b);})[_0x4b1a('0x1f')](function(_0x3501b2){_0x5b85d8[_0x4b1a('0x42')]=_0x3501b2;return _0x5b85d8;});}})['then'](respondWithFilteredResult(_0x1d6728,_0x4f8c2b))[_0x4b1a('0x43')](handleError(_0x1d6728,null));};function char(_0x58978f){return _0x4b1a('0x5c')===typeof _0x58978f?String[_0x4b1a('0x5d')][_0x4b1a('0x1c')](null,arguments):_0x58978f;}function needsEncapsulation(_0x1f8f5a){return!!_0x1f8f5a&&(_0x1f8f5a['toString']()[_0x4b1a('0x5e')](char(0xd))>=0x0||_0x1f8f5a[_0x4b1a('0x5f')]()[_0x4b1a('0x5e')](char(0xa))>=0x0||_0x1f8f5a[_0x4b1a('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x1f8f5a[_0x4b1a('0x5f')]()[_0x4b1a('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x587a7e){var _0x467dbf=char(0x22),_0x37c1b4='\x5c'+char(0x22),_0x47b966=_0x587a7e[_0x4b1a('0x5f')]()[_0x4b1a('0x60')](new RegExp(_0x467dbf,'g'),_0x37c1b4);return _0x467dbf+_0x47b966+_0x467dbf;}exports[_0x4b1a('0x61')]=function(_0x177875,_0x255c5d,_0x2ec680){var _0x32ae84,_0x1f159c;var _0x15c4eb={'where':{'ProjectId':_0x177875[_0x4b1a('0x45')]['id']}};if(_0x177875[_0x4b1a('0x2e')][_0x4b1a('0x62')]){_0x15c4eb[_0x4b1a('0x3b')][_0x4b1a('0x63')]=JSON[_0x4b1a('0x64')](_0x177875[_0x4b1a('0x2e')][_0x4b1a('0x62')]);}return db[_0x4b1a('0x56')][_0x4b1a('0x41')](_0x15c4eb)[_0x4b1a('0x1f')](handleEntityNotFound(_0x255c5d,null))[_0x4b1a('0x1f')](function(_0x578677){if(_0x578677){_0x32ae84=_0x578677;return db[_0x4b1a('0x65')][_0x4b1a('0x41')]({'where':{'SessionId':{'$in':_[_0x4b1a('0x29')](_0x32ae84,'id')},'ProjectId':_0x177875['params']['id']},'order':_0x4b1a('0x66')});}})[_0x4b1a('0x1f')](handleEntityNotFound(_0x255c5d,null))['then'](function(_0x3eb66d){if(_0x3eb66d){_0x1f159c=_0x3eb66d;var _0x4e05de={};for(var _0x5ca08c=0x0,_0x3a9263=_0x1f159c[_0x4b1a('0x34')];_0x5ca08c<_0x3a9263;_0x5ca08c++){if(!_0x4e05de['hasOwnProperty'](_0x1f159c[_0x5ca08c][_0x4b1a('0x67')])){_0x4e05de[_0x1f159c[_0x5ca08c][_0x4b1a('0x67')]]=needsEncapsulation(_0x1f159c[_0x5ca08c][_0x4b1a('0x68')])?encapsulate(_0x1f159c[_0x5ca08c][_0x4b1a('0x68')]):_0x1f159c[_0x5ca08c][_0x4b1a('0x68')];}}var _0xbf276a=[],_0x520e39={};for(var _0x2918e5=0x0,_0x1e3908=_0x32ae84[_0x4b1a('0x34')];_0x2918e5<_0x1e3908;_0x2918e5++){_0x520e39={'ProjectId':_0x177875[_0x4b1a('0x45')]['id'],'SessionId':_0x32ae84[_0x2918e5]['id'],'StartTime':moment(_0x32ae84[_0x2918e5]['starttime'])[_0x4b1a('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3b6f46=0x0,_0x61b5d2=_0x1f159c[_0x4b1a('0x34')];_0x3b6f46<_0x61b5d2;_0x3b6f46++){if(_0x1f159c[_0x3b6f46][_0x4b1a('0x6a')]==_0x32ae84[_0x2918e5]['id']&&_0x4e05de[_0x4b1a('0x57')](_0x1f159c[_0x3b6f46][_0x4b1a('0x67')])){_0x520e39[_0x4e05de[_0x1f159c[_0x3b6f46][_0x4b1a('0x67')]]]=_0x1f159c[_0x3b6f46][_0x4b1a('0x6b')];}}for(var _0x285d78 in _0x4e05de){if(!_0x520e39[_0x4b1a('0x57')](_0x4e05de[_0x285d78])){_0x520e39[_0x4e05de[_0x285d78]]=null;}}_0xbf276a['push'](_0x520e39);}return _0xbf276a;}})['then'](function(_0x4a200b){if(!_[_0x4b1a('0x6c')](_0x4a200b)){var _0x2b8402=toCsv(_0x4a200b);var _0x48b389=Date[_0x4b1a('0x6d')]();fs[_0x4b1a('0x6e')](util[_0x4b1a('0x69')](_0x4b1a('0x6f'),_0x177875[_0x4b1a('0x45')]['id'],_0x48b389),_0x2b8402);_0x255c5d[_0x4b1a('0x70')]('Content-disposition',_0x4b1a('0x71')+util[_0x4b1a('0x69')](_0x4b1a('0x72'),_0x177875[_0x4b1a('0x45')]['id'],_0x48b389));_0x255c5d[_0x4b1a('0x70')](_0x4b1a('0x73'),_0x4b1a('0x74'));return _0x255c5d[_0x4b1a('0x75')](util[_0x4b1a('0x69')](_0x4b1a('0x6f'),_0x177875[_0x4b1a('0x45')]['id'],_0x48b389));}else{return _0x255c5d[_0x4b1a('0x23')](0xcc);}})[_0x4b1a('0x43')](handleError(_0x255c5d,null));}; \ No newline at end of file +var _0x30c7=['clone','updatedAt','omit','role','getSessions','findOne','JscriptySessionReport','pick','findAll','getAnswers','JscriptyAnswerReport','ProjectId','number','toString','indexOf','replace','starttime','startTime','JscriptyQuestionReport','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','ejs','fs-extra','squel','crypto','jsforce','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','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','send','index','map','JscriptyProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','rows','show','params','keys','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch'];(function(_0xdef12a,_0x27ac9f){var _0xdc671b=function(_0x2f4e94){while(--_0x2f4e94){_0xdef12a['push'](_0xdef12a['shift']());}};_0xdc671b(++_0x27ac9f);}(_0x30c7,0x111));var _0x730c=function(_0x22465b,_0x13d040){_0x22465b=_0x22465b-0x0;var _0xd451ee=_0x30c7[_0x22465b];return _0xd451ee;};'use strict';var emlformat=require(_0x730c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x730c('0x1'));var jsonpatch=require(_0x730c('0x2'));var rp=require(_0x730c('0x3'));var moment=require('moment');var BPromise=require(_0x730c('0x4'));var Mustache=require(_0x730c('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x730c('0x6'));var fs=require('fs');var fs_extra=require(_0x730c('0x7'));var _=require('lodash');var squel=require(_0x730c('0x8'));var crypto=require(_0x730c('0x9'));var jsforce=require(_0x730c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x730c('0xb'));var querystring=require(_0x730c('0xc'));var Papa=require('papaparse');var Redis=require(_0x730c('0xd'));var authService=require(_0x730c('0xe'));var qs=require(_0x730c('0xf'));var as=require(_0x730c('0x10'));var hardwareService=require(_0x730c('0x11'));var logger=require(_0x730c('0x12'))(_0x730c('0x13'));var utils=require('../../config/utils');var config=require(_0x730c('0x14'));var licenseUtil=require(_0x730c('0x15'));var db=require(_0x730c('0x16'))['db'];function respondWithStatusCode(_0x97de24,_0x50d05b){_0x50d05b=_0x50d05b||0xcc;return function(_0x321a3a){if(_0x321a3a){return _0x97de24[_0x730c('0x17')](_0x50d05b);}return _0x97de24[_0x730c('0x18')](_0x50d05b)[_0x730c('0x19')]();};}function respondWithResult(_0x22d0ae,_0x253293){_0x253293=_0x253293||0xc8;return function(_0x419b7b){if(_0x419b7b){return _0x22d0ae[_0x730c('0x18')](_0x253293)[_0x730c('0x1a')](_0x419b7b);}};}function respondWithFilteredResult(_0x2ccabe,_0x2678de){return function(_0x55b19e){if(_0x55b19e){var _0x55e11c=typeof _0x2678de['offset']===_0x730c('0x1b')&&typeof _0x2678de[_0x730c('0x1c')]===_0x730c('0x1b');var _0xa7a352=_0x55b19e['count'];var _0x3b3fda=_0x55e11c?0x0:_0x2678de[_0x730c('0x1d')];var _0xbeb3fe=_0x55e11c?_0x55b19e[_0x730c('0x1e')]:_0x2678de[_0x730c('0x1d')]+_0x2678de[_0x730c('0x1c')];var _0x2fe217;if(_0xbeb3fe>=_0xa7a352){_0xbeb3fe=_0xa7a352;_0x2fe217=0xc8;}else{_0x2fe217=0xce;}_0x2ccabe[_0x730c('0x18')](_0x2fe217);return _0x2ccabe[_0x730c('0x1f')](_0x730c('0x20'),_0x3b3fda+'-'+_0xbeb3fe+'/'+_0xa7a352)['json'](_0x55b19e);}return null;};}function patchUpdates(_0x111fc9){return function(_0x2130a1){try{jsonpatch[_0x730c('0x21')](_0x2130a1,_0x111fc9,!![]);}catch(_0x2cc248){return BPromise[_0x730c('0x22')](_0x2cc248);}return _0x2130a1[_0x730c('0x23')]();};}function saveUpdates(_0x4f9339,_0x42ebd8){return function(_0x1e87e3){if(_0x1e87e3){return _0x1e87e3[_0x730c('0x24')](_0x4f9339)[_0x730c('0x25')](function(_0x2d0850){return _0x2d0850;});}return null;};}function removeEntity(_0x1faf13,_0x3145be){return function(_0x1d6c33){if(_0x1d6c33){return _0x1d6c33['destroy']()['then'](function(){var _0x4b9a00=_0x1d6c33[_0x730c('0x26')]({'plain':!![]});var _0xea1cfd=_0x730c('0x27');return db[_0x730c('0x28')][_0x730c('0x29')]({'where':{'type':_0xea1cfd,'resourceId':_0x4b9a00['id']}})['then'](function(){return _0x1d6c33;});})['then'](function(){_0x1faf13[_0x730c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58290c,_0x2b1c8e){return function(_0x1c7a00){if(!_0x1c7a00){_0x58290c[_0x730c('0x17')](0x194);}return _0x1c7a00;};}function handleError(_0x1e6ced,_0x5d1626){_0x5d1626=_0x5d1626||0x1f4;return function(_0x24552d){logger[_0x730c('0x2a')](_0x24552d[_0x730c('0x2b')]);if(_0x24552d[_0x730c('0x2c')]){delete _0x24552d[_0x730c('0x2c')];}_0x1e6ced[_0x730c('0x18')](_0x5d1626)[_0x730c('0x2d')](_0x24552d);};}exports[_0x730c('0x2e')]=function(_0x13d446,_0x80611f){var _0x11f55e={},_0x5d9068={},_0x25b50b={'count':0x0,'rows':[]};var _0x57cb05=_[_0x730c('0x2f')](db[_0x730c('0x30')]['rawAttributes'],function(_0x4cf98b){return{'name':_0x4cf98b[_0x730c('0x31')],'type':_0x4cf98b[_0x730c('0x32')][_0x730c('0x33')]};});_0x5d9068[_0x730c('0x34')]=_[_0x730c('0x2f')](_0x57cb05,_0x730c('0x2c'));_0x5d9068[_0x730c('0x35')]=_['keys'](_0x13d446[_0x730c('0x35')]);_0x5d9068[_0x730c('0x36')]=_[_0x730c('0x37')](_0x5d9068[_0x730c('0x34')],_0x5d9068['query']);_0x11f55e[_0x730c('0x38')]=_[_0x730c('0x37')](_0x5d9068['model'],qs[_0x730c('0x39')](_0x13d446[_0x730c('0x35')][_0x730c('0x39')]));_0x11f55e['attributes']=_0x11f55e[_0x730c('0x38')][_0x730c('0x3a')]?_0x11f55e[_0x730c('0x38')]:_0x5d9068['model'];if(!_0x13d446['query'][_0x730c('0x3b')](_0x730c('0x3c'))){_0x11f55e['limit']=qs[_0x730c('0x1c')](_0x13d446[_0x730c('0x35')][_0x730c('0x1c')]);_0x11f55e[_0x730c('0x1d')]=qs[_0x730c('0x1d')](_0x13d446[_0x730c('0x35')]['offset']);}_0x11f55e['order']=qs[_0x730c('0x3d')](_0x13d446['query'][_0x730c('0x3d')]);_0x11f55e[_0x730c('0x3e')]=qs[_0x730c('0x36')](_['pick'](_0x13d446[_0x730c('0x35')],_0x5d9068[_0x730c('0x36')]),_0x57cb05);if(_0x13d446[_0x730c('0x35')][_0x730c('0x3f')]){_0x11f55e['where']=_[_0x730c('0x40')](_0x11f55e[_0x730c('0x3e')],{'$or':_[_0x730c('0x2f')](_0x57cb05,function(_0x5a0560){if(_0x5a0560[_0x730c('0x32')]!==_0x730c('0x41')){var _0x3c0710={};_0x3c0710[_0x5a0560['name']]={'$like':'%'+_0x13d446[_0x730c('0x35')][_0x730c('0x3f')]+'%'};return _0x3c0710;}})});}_0x11f55e=_[_0x730c('0x40')]({},_0x11f55e,_0x13d446[_0x730c('0x42')]);var _0x3d32fe={'where':_0x11f55e[_0x730c('0x3e')]};return db[_0x730c('0x30')]['count'](_0x3d32fe)[_0x730c('0x25')](function(_0x3e3851){_0x25b50b[_0x730c('0x1e')]=_0x3e3851;if(_0x13d446[_0x730c('0x35')]['includeAll']){_0x11f55e[_0x730c('0x43')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x11f55e);})[_0x730c('0x25')](function(_0x37371e){_0x25b50b[_0x730c('0x44')]=_0x37371e;return _0x25b50b;})['then'](respondWithFilteredResult(_0x80611f,_0x11f55e))['catch'](handleError(_0x80611f,null));};exports[_0x730c('0x45')]=function(_0x199efd,_0x10be6a){var _0x29699e={'raw':![],'where':{'id':_0x199efd[_0x730c('0x46')]['id']}},_0x301aa2={};_0x301aa2[_0x730c('0x34')]=_[_0x730c('0x47')](db[_0x730c('0x30')][_0x730c('0x48')]);_0x301aa2['query']=_[_0x730c('0x47')](_0x199efd['query']);_0x301aa2[_0x730c('0x36')]=_['intersection'](_0x301aa2[_0x730c('0x34')],_0x301aa2[_0x730c('0x35')]);_0x29699e[_0x730c('0x38')]=_[_0x730c('0x37')](_0x301aa2[_0x730c('0x34')],qs[_0x730c('0x39')](_0x199efd[_0x730c('0x35')][_0x730c('0x39')]));_0x29699e[_0x730c('0x38')]=_0x29699e[_0x730c('0x38')][_0x730c('0x3a')]?_0x29699e[_0x730c('0x38')]:_0x301aa2[_0x730c('0x34')];if(_0x199efd[_0x730c('0x35')][_0x730c('0x49')]){_0x29699e[_0x730c('0x43')]=[{'all':!![]}];}_0x29699e=_[_0x730c('0x40')]({},_0x29699e,_0x199efd[_0x730c('0x42')]);return db['JscriptyProject'][_0x730c('0x4a')](_0x29699e)[_0x730c('0x25')](handleEntityNotFound(_0x10be6a,null))[_0x730c('0x25')](respondWithResult(_0x10be6a,null))['catch'](handleError(_0x10be6a,null));};exports[_0x730c('0x4b')]=function(_0x29b4d0,_0x30d6eb){return db[_0x730c('0x30')][_0x730c('0x4b')](_0x29b4d0[_0x730c('0x4c')],{})[_0x730c('0x25')](function(_0x2c10da){var _0x30b29e=_0x29b4d0['user'][_0x730c('0x26')]({'plain':!![]});if(!_0x30b29e)throw new Error(_0x730c('0x4d'));if(_0x30b29e['role']===_0x730c('0x4e')){var _0x52fff9=_0x2c10da[_0x730c('0x26')]({'plain':!![]});var _0x193584=_0x730c('0x27');return db[_0x730c('0x4f')][_0x730c('0x4a')]({'where':{'name':_0x193584,'userProfileId':_0x30b29e[_0x730c('0x50')]},'raw':!![]})[_0x730c('0x25')](function(_0x56fa97){if(_0x56fa97&&_0x56fa97[_0x730c('0x51')]===0x0){return db[_0x730c('0x28')][_0x730c('0x4b')]({'name':_0x52fff9[_0x730c('0x2c')],'resourceId':_0x52fff9['id'],'type':_0x56fa97[_0x730c('0x2c')],'sectionId':_0x56fa97['id']},{})[_0x730c('0x25')](function(){return _0x2c10da;});}else{return _0x2c10da;}})['catch'](function(_0x49e410){logger[_0x730c('0x2a')](_0x730c('0x52'),_0x49e410);throw _0x49e410;});}return _0x2c10da;})[_0x730c('0x25')](respondWithResult(_0x30d6eb,0xc9))[_0x730c('0x53')](handleError(_0x30d6eb,null));};exports[_0x730c('0x54')]=function(_0x591455,_0xbc675){var _0x207ca8={'where':{'id':_0x591455['params']['id']}},_0x49243a={};_0x49243a[_0x730c('0x34')]=_[_0x730c('0x47')](db[_0x730c('0x30')]['rawAttributes']);_0x207ca8[_0x730c('0x38')]=_['intersection'](_0x49243a['model'],qs[_0x730c('0x39')](_0x591455[_0x730c('0x35')]['fields']));_0x207ca8[_0x730c('0x38')]=_0x207ca8[_0x730c('0x38')][_0x730c('0x3a')]?_0x207ca8[_0x730c('0x38')]:_0x49243a[_0x730c('0x34')];if(_0x591455[_0x730c('0x35')][_0x730c('0x49')]){_0x207ca8['include']=[{'all':!![]}];}_0x207ca8=_[_0x730c('0x40')]({},_0x207ca8,_0x591455[_0x730c('0x42')]);return db[_0x730c('0x30')][_0x730c('0x4a')](_0x207ca8)[_0x730c('0x25')](handleEntityNotFound(_0xbc675,null))[_0x730c('0x25')](function(_0x344fab){if(_0x344fab){var _0x55af0f=_0x344fab['get']({'plain':!![]});_0x55af0f=qs['omit'](_0x55af0f,['id','createdAt',_0x730c('0x55')]);_0x591455[_0x730c('0x4c')]=_[_0x730c('0x56')](_0x591455['body'],['id','createdAt','updatedAt']);return db[_0x730c('0x30')][_0x730c('0x4b')](_[_0x730c('0x40')](_0x55af0f,_0x591455['body']),{'include':_0x591455[_0x730c('0x35')][_0x730c('0x49')]?[{'all':!![]}]:undefined})[_0x730c('0x25')](function(_0xa7aaeb){var _0x17a63e=_0x591455[_0x730c('0x4e')][_0x730c('0x26')]({'plain':!![]});if(!_0x17a63e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17a63e[_0x730c('0x57')]===_0x730c('0x4e')){var _0x4151dd=_0xa7aaeb[_0x730c('0x26')]({'plain':!![]});var _0x2a7fcd=_0x730c('0x27');return db[_0x730c('0x4f')][_0x730c('0x4a')]({'where':{'name':_0x2a7fcd,'userProfileId':_0x17a63e['userProfileId']},'raw':!![]})['then'](function(_0x3a630b){if(_0x3a630b&&_0x3a630b[_0x730c('0x51')]===0x0){return db[_0x730c('0x28')][_0x730c('0x4b')]({'name':_0x4151dd[_0x730c('0x2c')],'resourceId':_0x4151dd['id'],'type':_0x3a630b[_0x730c('0x2c')],'sectionId':_0x3a630b['id']},{})[_0x730c('0x25')](function(){return _0xa7aaeb;});}else{return _0xa7aaeb;}})[_0x730c('0x53')](function(_0x2a650b){logger[_0x730c('0x2a')](_0x730c('0x52'),_0x2a650b);throw _0x2a650b;});}return _0xa7aaeb;});}})['then'](respondWithResult(_0xbc675,0xc9))[_0x730c('0x53')](handleError(_0xbc675,null));};exports[_0x730c('0x24')]=function(_0x253645,_0x1d36b7){if(_0x253645[_0x730c('0x4c')]['id']){delete _0x253645[_0x730c('0x4c')]['id'];}return db['JscriptyProject'][_0x730c('0x4a')]({'where':{'id':_0x253645['params']['id']}})[_0x730c('0x25')](handleEntityNotFound(_0x1d36b7,null))['then'](saveUpdates(_0x253645[_0x730c('0x4c')],null))[_0x730c('0x25')](respondWithResult(_0x1d36b7,null))['catch'](handleError(_0x1d36b7,null));};exports[_0x730c('0x29')]=function(_0x3fd380,_0x80da66){return db[_0x730c('0x30')]['find']({'where':{'id':_0x3fd380[_0x730c('0x46')]['id']}})[_0x730c('0x25')](handleEntityNotFound(_0x80da66,null))['then'](removeEntity(_0x80da66,null))[_0x730c('0x53')](handleError(_0x80da66,null));};exports[_0x730c('0x58')]=function(_0x15e662,_0x1c3718,_0x29a31f){var _0x49d56a={'raw':!![],'where':{}};var _0x2771c2={};var _0x3c6495={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x730c('0x59')]({'where':{'id':_0x15e662[_0x730c('0x46')]['id']}})[_0x730c('0x25')](handleEntityNotFound(_0x1c3718,null))[_0x730c('0x25')](function(_0x20ec43){if(_0x20ec43){_0x2771c2[_0x730c('0x34')]=_[_0x730c('0x47')](db[_0x730c('0x5a')][_0x730c('0x48')]);_0x2771c2[_0x730c('0x35')]=_[_0x730c('0x47')](_0x15e662[_0x730c('0x35')]);_0x2771c2[_0x730c('0x36')]=_[_0x730c('0x37')](_0x2771c2['model'],_0x2771c2[_0x730c('0x35')]);_0x49d56a[_0x730c('0x38')]=_['intersection'](_0x2771c2['model'],qs[_0x730c('0x39')](_0x15e662[_0x730c('0x35')][_0x730c('0x39')]));_0x49d56a[_0x730c('0x38')]=_0x49d56a[_0x730c('0x38')]['length']?_0x49d56a[_0x730c('0x38')]:_0x2771c2[_0x730c('0x34')];if(!_0x15e662[_0x730c('0x35')][_0x730c('0x3b')](_0x730c('0x3c'))){_0x49d56a[_0x730c('0x1c')]=qs[_0x730c('0x1c')](_0x15e662[_0x730c('0x35')][_0x730c('0x1c')]);_0x49d56a[_0x730c('0x1d')]=qs[_0x730c('0x1d')](_0x15e662[_0x730c('0x35')][_0x730c('0x1d')]);}_0x49d56a['order']=qs[_0x730c('0x3d')](_0x15e662[_0x730c('0x35')]['sort']);_0x49d56a[_0x730c('0x3e')]=qs[_0x730c('0x36')](_[_0x730c('0x5b')](_0x15e662[_0x730c('0x35')],_0x2771c2['filters']));_0x49d56a[_0x730c('0x3e')]['ProjectId']=_0x20ec43['id'];if(_0x15e662['query'][_0x730c('0x3f')]){_0x49d56a[_0x730c('0x3e')]=_['merge'](_0x49d56a[_0x730c('0x3e')],{'$or':_[_0x730c('0x2f')](_0x49d56a[_0x730c('0x38')],function(_0x5ba587){var _0x3785b4={};_0x3785b4[_0x5ba587]={'$like':'%'+_0x15e662[_0x730c('0x35')]['filter']+'%'};return _0x3785b4;})});}_0x49d56a=_['merge']({},_0x49d56a,_0x15e662[_0x730c('0x42')]);return db['JscriptySessionReport'][_0x730c('0x1e')]({'where':_0x49d56a['where']})[_0x730c('0x25')](function(_0x395a36){_0x3c6495[_0x730c('0x1e')]=_0x395a36;if(_0x15e662[_0x730c('0x35')][_0x730c('0x49')]){_0x49d56a[_0x730c('0x43')]=[{'all':!![]}];}return db[_0x730c('0x5a')][_0x730c('0x5c')](_0x49d56a);})[_0x730c('0x25')](function(_0xeabf2a){_0x3c6495[_0x730c('0x44')]=_0xeabf2a;return _0x3c6495;});}})['then'](respondWithFilteredResult(_0x1c3718,_0x49d56a))[_0x730c('0x53')](handleError(_0x1c3718,null));};exports[_0x730c('0x5d')]=function(_0x2fd2c7,_0xab0139,_0xca7b4c){var _0x572a83={'raw':!![],'where':{}};var _0x5bc3c8={};var _0x3a69c1={'count':0x0,'rows':[]};return db[_0x730c('0x30')]['findOne']({'where':{'id':_0x2fd2c7['params']['id']}})[_0x730c('0x25')](handleEntityNotFound(_0xab0139,null))['then'](function(_0x88cc95){if(_0x88cc95){_0x5bc3c8[_0x730c('0x34')]=_[_0x730c('0x47')](db[_0x730c('0x5e')]['rawAttributes']);_0x5bc3c8['query']=_[_0x730c('0x47')](_0x2fd2c7[_0x730c('0x35')]);_0x5bc3c8[_0x730c('0x36')]=_[_0x730c('0x37')](_0x5bc3c8[_0x730c('0x34')],_0x5bc3c8[_0x730c('0x35')]);_0x572a83[_0x730c('0x38')]=_['intersection'](_0x5bc3c8['model'],qs[_0x730c('0x39')](_0x2fd2c7[_0x730c('0x35')][_0x730c('0x39')]));_0x572a83[_0x730c('0x38')]=_0x572a83['attributes']['length']?_0x572a83[_0x730c('0x38')]:_0x5bc3c8[_0x730c('0x34')];if(!_0x2fd2c7[_0x730c('0x35')]['hasOwnProperty'](_0x730c('0x3c'))){_0x572a83[_0x730c('0x1c')]=qs[_0x730c('0x1c')](_0x2fd2c7['query'][_0x730c('0x1c')]);_0x572a83['offset']=qs[_0x730c('0x1d')](_0x2fd2c7['query'][_0x730c('0x1d')]);}_0x572a83['order']=qs[_0x730c('0x3d')](_0x2fd2c7[_0x730c('0x35')]['sort']);_0x572a83[_0x730c('0x3e')]=qs[_0x730c('0x36')](_[_0x730c('0x5b')](_0x2fd2c7[_0x730c('0x35')],_0x5bc3c8[_0x730c('0x36')]));_0x572a83[_0x730c('0x3e')][_0x730c('0x5f')]=_0x88cc95['id'];if(_0x2fd2c7[_0x730c('0x35')][_0x730c('0x3f')]){_0x572a83[_0x730c('0x3e')]=_[_0x730c('0x40')](_0x572a83[_0x730c('0x3e')],{'$or':_[_0x730c('0x2f')](_0x572a83[_0x730c('0x38')],function(_0x5a55b4){var _0x39404c={};_0x39404c[_0x5a55b4]={'$like':'%'+_0x2fd2c7[_0x730c('0x35')][_0x730c('0x3f')]+'%'};return _0x39404c;})});}_0x572a83=_[_0x730c('0x40')]({},_0x572a83,_0x2fd2c7[_0x730c('0x42')]);return db[_0x730c('0x5e')][_0x730c('0x1e')]({'where':_0x572a83['where']})['then'](function(_0x2f8f48){_0x3a69c1[_0x730c('0x1e')]=_0x2f8f48;if(_0x2fd2c7[_0x730c('0x35')][_0x730c('0x49')]){_0x572a83[_0x730c('0x43')]=[{'all':!![]}];}return db[_0x730c('0x5e')][_0x730c('0x5c')](_0x572a83);})['then'](function(_0xfe70d1){_0x3a69c1[_0x730c('0x44')]=_0xfe70d1;return _0x3a69c1;});}})[_0x730c('0x25')](respondWithFilteredResult(_0xab0139,_0x572a83))[_0x730c('0x53')](handleError(_0xab0139,null));};function char(_0x1fe5d9){return _0x730c('0x60')===typeof _0x1fe5d9?String['fromCharCode'][_0x730c('0x21')](null,arguments):_0x1fe5d9;}function needsEncapsulation(_0x4cc29c){return!!_0x4cc29c&&(_0x4cc29c[_0x730c('0x61')]()[_0x730c('0x62')](char(0xd))>=0x0||_0x4cc29c[_0x730c('0x61')]()['indexOf'](char(0xa))>=0x0||_0x4cc29c[_0x730c('0x61')]()['indexOf'](char(0x2c))>=0x0||_0x4cc29c[_0x730c('0x61')]()[_0x730c('0x62')](char(0x22))>=0x0);}function encapsulate(_0x3c3a59){var _0x286afc=char(0x22),_0x43cbcc='\x5c'+char(0x22),_0x435d22=_0x3c3a59[_0x730c('0x61')]()[_0x730c('0x63')](new RegExp(_0x286afc,'g'),_0x43cbcc);return _0x286afc+_0x435d22+_0x286afc;}exports['getSummary']=function(_0x143456,_0x56db57,_0x1f09de){var _0x449483,_0x15c61e;var _0x2c3105={'where':{'ProjectId':_0x143456[_0x730c('0x46')]['id']}};if(_0x143456['query']['startTime']){_0x2c3105[_0x730c('0x3e')][_0x730c('0x64')]=JSON['parse'](_0x143456['query'][_0x730c('0x65')]);}return db[_0x730c('0x5a')][_0x730c('0x5c')](_0x2c3105)[_0x730c('0x25')](handleEntityNotFound(_0x56db57,null))[_0x730c('0x25')](function(_0x3dacec){if(_0x3dacec){_0x449483=_0x3dacec;return db[_0x730c('0x66')][_0x730c('0x5c')]({'where':{'SessionId':{'$in':_[_0x730c('0x2f')](_0x449483,'id')},'ProjectId':_0x143456['params']['id']},'order':'-createdAt'});}})[_0x730c('0x25')](handleEntityNotFound(_0x56db57,null))['then'](function(_0x22ad84){if(_0x22ad84){_0x15c61e=_0x22ad84;var _0xac90c1={};for(var _0x557a2c=0x0,_0x15da43=_0x15c61e[_0x730c('0x3a')];_0x557a2c<_0x15da43;_0x557a2c++){if(!_0xac90c1[_0x730c('0x3b')](_0x15c61e[_0x557a2c][_0x730c('0x67')])){_0xac90c1[_0x15c61e[_0x557a2c]['questionId']]=needsEncapsulation(_0x15c61e[_0x557a2c]['question'])?encapsulate(_0x15c61e[_0x557a2c][_0x730c('0x68')]):_0x15c61e[_0x557a2c]['question'];}}var _0x1b0445=[],_0x296b24={};for(var _0x48daf6=0x0,_0x325792=_0x449483[_0x730c('0x3a')];_0x48daf6<_0x325792;_0x48daf6++){_0x296b24={'ProjectId':_0x143456['params']['id'],'SessionId':_0x449483[_0x48daf6]['id'],'StartTime':moment(_0x449483[_0x48daf6][_0x730c('0x64')])['format'](_0x730c('0x69'))};for(var _0x31632a=0x0,_0x12d264=_0x15c61e[_0x730c('0x3a')];_0x31632a<_0x12d264;_0x31632a++){if(_0x15c61e[_0x31632a][_0x730c('0x6a')]==_0x449483[_0x48daf6]['id']&&_0xac90c1[_0x730c('0x3b')](_0x15c61e[_0x31632a]['questionId'])){_0x296b24[_0xac90c1[_0x15c61e[_0x31632a][_0x730c('0x67')]]]=_0x15c61e[_0x31632a][_0x730c('0x6b')];}}for(var _0x5d66b9 in _0xac90c1){if(!_0x296b24['hasOwnProperty'](_0xac90c1[_0x5d66b9])){_0x296b24[_0xac90c1[_0x5d66b9]]=null;}}_0x1b0445['push'](_0x296b24);}return _0x1b0445;}})[_0x730c('0x25')](function(_0x23ae50){if(!_[_0x730c('0x6c')](_0x23ae50)){var _0x73eca7=toCsv(_0x23ae50);var _0x1a5594=Date[_0x730c('0x6d')]();fs[_0x730c('0x6e')](util[_0x730c('0x6f')](_0x730c('0x70'),_0x143456[_0x730c('0x46')]['id'],_0x1a5594),_0x73eca7);_0x56db57[_0x730c('0x71')]('Content-disposition',_0x730c('0x72')+util[_0x730c('0x6f')](_0x730c('0x73'),_0x143456[_0x730c('0x46')]['id'],_0x1a5594));_0x56db57['setHeader'](_0x730c('0x74'),_0x730c('0x75'));return _0x56db57[_0x730c('0x76')](util[_0x730c('0x6f')](_0x730c('0x70'),_0x143456['params']['id'],_0x1a5594));}else{return _0x56db57[_0x730c('0x17')](0xcc);}})[_0x730c('0x53')](handleError(_0x56db57,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index a0bee04..9d142ee 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 _0x1f63=['JscriptyProject','jscripty_projects','lodash','util','api','moment','bluebird','path','rimraf','exports'];(function(_0x5f4cc6,_0x3fe04f){var _0x1aff75=function(_0x3aca8b){while(--_0x3aca8b){_0x5f4cc6['push'](_0x5f4cc6['shift']());}};_0x1aff75(++_0x3fe04f);}(_0x1f63,0x7a));var _0x31f6=function(_0x377e6e,_0x3d52e9){_0x377e6e=_0x377e6e-0x0;var _0x45f12e=_0x1f63[_0x377e6e];return _0x45f12e;};'use strict';var _=require(_0x31f6('0x0'));var util=require(_0x31f6('0x1'));var logger=require('../../config/logger')(_0x31f6('0x2'));var moment=require(_0x31f6('0x3'));var BPromise=require(_0x31f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31f6('0x5'));var rimraf=require(_0x31f6('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x31f6('0x7')]=function(_0x11250b,_0xe8437e){return _0x11250b['define'](_0x31f6('0x8'),attributes,{'tableName':_0x31f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6183=['../../config/environment','./jscriptyProject.attributes','exports','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1306d2,_0x3f8283){var _0x7c34b0=function(_0x528b83){while(--_0x528b83){_0x1306d2['push'](_0x1306d2['shift']());}};_0x7c34b0(++_0x3f8283);}(_0x6183,0x19b));var _0x3618=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x6183[_0x3e0b8f];return _0x22f742;};'use strict';var _=require('lodash');var util=require(_0x3618('0x0'));var logger=require(_0x3618('0x1'))(_0x3618('0x2'));var moment=require('moment');var BPromise=require(_0x3618('0x3'));var rp=require(_0x3618('0x4'));var fs=require('fs');var path=require(_0x3618('0x5'));var rimraf=require(_0x3618('0x6'));var config=require(_0x3618('0x7'));var attributes=require(_0x3618('0x8'));module[_0x3618('0x9')]=function(_0x1caf4f,_0x3d1f08){return _0x1caf4f[_0x3618('0xa')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','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 1328b30..383d4ba 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(_0x497a4a,_0x21c42a){var _0x36545a=function(_0x365a64){while(--_0x365a64){_0x497a4a['push'](_0x497a4a['shift']());}};_0x36545a(++_0x21c42a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x7f6abc,_0x3c2718){_0x7f6abc=_0x7f6abc-0x0;var _0x53d546=_0xb43b[_0x7f6abc];return _0x53d546;};'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 _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(_0x3921fc,_0x4cba68){var _0x112afa=function(_0x2ede89){while(--_0x2ede89){_0x3921fc['push'](_0x3921fc['shift']());}};_0x112afa(++_0x4cba68);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1639fc,_0xb314e6){_0x1639fc=_0x1639fc-0x0;var _0x3e63ea=_0xb43b[_0x1639fc];return _0x3e63ea;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 5ca6dc5..019cf5c 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 _0xc0d1=['show','post','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x518e54,_0x4c00cb){var _0x41b891=function(_0x6d8be4){while(--_0x6d8be4){_0x518e54['push'](_0x518e54['shift']());}};_0x41b891(++_0x4c00cb);}(_0xc0d1,0x6f));var _0x1c0d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xc0d1[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1c0d('0x0'));var timeout=require(_0x1c0d('0x1'));var express=require(_0x1c0d('0x2'));var router=express[_0x1c0d('0x3')]();var fs_extra=require(_0x1c0d('0x4'));var auth=require(_0x1c0d('0x5'));var interaction=require(_0x1c0d('0x6'));var config=require(_0x1c0d('0x7'));var controller=require(_0x1c0d('0x8'));router[_0x1c0d('0x9')]('/',auth[_0x1c0d('0xa')](),controller[_0x1c0d('0xb')]);router[_0x1c0d('0x9')](_0x1c0d('0xc'),auth[_0x1c0d('0xa')](),controller[_0x1c0d('0xd')]);router[_0x1c0d('0x9')](_0x1c0d('0xe'),auth[_0x1c0d('0xa')](),controller[_0x1c0d('0xf')]);router[_0x1c0d('0x10')]('/',auth[_0x1c0d('0xa')](),controller['create']);router[_0x1c0d('0x11')](_0x1c0d('0xe'),auth[_0x1c0d('0xa')](),controller[_0x1c0d('0x12')]);router[_0x1c0d('0x13')]('/:id',auth[_0x1c0d('0xa')](),controller['destroy']);module[_0x1c0d('0x14')]=router; \ No newline at end of file +var _0x9e54=['isAuthenticated','index','/describe','describe','get','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2cc939,_0x38e848){var _0x27f483=function(_0x2f4baf){while(--_0x2f4baf){_0x2cc939['push'](_0x2cc939['shift']());}};_0x27f483(++_0x38e848);}(_0x9e54,0x188));var _0x49e5=function(_0x4682f6,_0x5e7db2){_0x4682f6=_0x4682f6-0x0;var _0x29c5b4=_0x9e54[_0x4682f6];return _0x29c5b4;};'use strict';var multer=require(_0x49e5('0x0'));var util=require(_0x49e5('0x1'));var path=require(_0x49e5('0x2'));var timeout=require(_0x49e5('0x3'));var express=require(_0x49e5('0x4'));var router=express['Router']();var fs_extra=require(_0x49e5('0x5'));var auth=require(_0x49e5('0x6'));var interaction=require(_0x49e5('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x49e5('0x8')](),controller[_0x49e5('0x9')]);router['get'](_0x49e5('0xa'),auth[_0x49e5('0x8')](),controller[_0x49e5('0xb')]);router[_0x49e5('0xc')](_0x49e5('0xd'),auth[_0x49e5('0x8')](),controller[_0x49e5('0xe')]);router[_0x49e5('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x49e5('0xd'),auth[_0x49e5('0x8')](),controller[_0x49e5('0x10')]);router[_0x49e5('0x11')]('/:id',auth[_0x49e5('0x8')](),controller[_0x49e5('0x12')]);module[_0x49e5('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 ba29368..4b53e78 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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0x16cbfc,_0x5b0582){_0x16cbfc=_0x16cbfc-0x0;var _0x588de6=_0x7a54[_0x16cbfc];return _0x588de6;};'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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x57f8e9,_0x19075e){_0x57f8e9=_0x57f8e9-0x0;var _0x477ca4=_0x7a54[_0x57f8e9];return _0x477ca4;};'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 916496d..d117cf1 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 _0x7b55=['JscriptyQuestionReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','options','then','includeAll','include','findAll','rows','catch','merge','find','create','body','params','destroy','describe','eml-format','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map'];(function(_0x5eeb19,_0x3ab1d5){var _0x28194e=function(_0x2a6a36){while(--_0x2a6a36){_0x5eeb19['push'](_0x5eeb19['shift']());}};_0x28194e(++_0x3ab1d5);}(_0x7b55,0xb5));var _0x57b5=function(_0x3544b3,_0x44debb){_0x3544b3=_0x3544b3-0x0;var _0x4a7cc1=_0x7b55[_0x3544b3];return _0x4a7cc1;};'use strict';var emlformat=require(_0x57b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x57b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x57b5('0x2'));var util=require(_0x57b5('0x3'));var path=require(_0x57b5('0x4'));var sox=require('sox');var csv=require(_0x57b5('0x5'));var ejs=require(_0x57b5('0x6'));var fs=require('fs');var fs_extra=require(_0x57b5('0x7'));var _=require(_0x57b5('0x8'));var squel=require(_0x57b5('0x9'));var crypto=require(_0x57b5('0xa'));var jsforce=require(_0x57b5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x57b5('0x5'));var querystring=require(_0x57b5('0xc'));var Papa=require(_0x57b5('0xd'));var Redis=require(_0x57b5('0xe'));var authService=require(_0x57b5('0xf'));var qs=require(_0x57b5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x57b5('0x11'))(_0x57b5('0x12'));var utils=require('../../config/utils');var config=require(_0x57b5('0x13'));var licenseUtil=require(_0x57b5('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35a293,_0x21193a){_0x21193a=_0x21193a||0xcc;return function(_0x26161c){if(_0x26161c){return _0x35a293[_0x57b5('0x15')](_0x21193a);}return _0x35a293['status'](_0x21193a)[_0x57b5('0x16')]();};}function respondWithResult(_0x301e71,_0x5ceb7f){_0x5ceb7f=_0x5ceb7f||0xc8;return function(_0x197326){if(_0x197326){return _0x301e71[_0x57b5('0x17')](_0x5ceb7f)[_0x57b5('0x18')](_0x197326);}};}function respondWithFilteredResult(_0x3a7a30,_0x249533){return function(_0x4a1832){if(_0x4a1832){var _0x46c0fe=typeof _0x249533[_0x57b5('0x19')]==='undefined'&&typeof _0x249533[_0x57b5('0x1a')]===_0x57b5('0x1b');var _0x3eb3ce=_0x4a1832[_0x57b5('0x1c')];var _0xffef72=_0x46c0fe?0x0:_0x249533[_0x57b5('0x19')];var _0xccd83c=_0x46c0fe?_0x4a1832['count']:_0x249533[_0x57b5('0x19')]+_0x249533['limit'];var _0x170d9e;if(_0xccd83c>=_0x3eb3ce){_0xccd83c=_0x3eb3ce;_0x170d9e=0xc8;}else{_0x170d9e=0xce;}_0x3a7a30['status'](_0x170d9e);return _0x3a7a30[_0x57b5('0x1d')](_0x57b5('0x1e'),_0xffef72+'-'+_0xccd83c+'/'+_0x3eb3ce)['json'](_0x4a1832);}return null;};}function patchUpdates(_0x52951d){return function(_0x1fcfd9){try{jsonpatch[_0x57b5('0x1f')](_0x1fcfd9,_0x52951d,!![]);}catch(_0x689c6d){return BPromise[_0x57b5('0x20')](_0x689c6d);}return _0x1fcfd9[_0x57b5('0x21')]();};}function saveUpdates(_0xd1a568,_0x488b82){return function(_0x5ccef6){if(_0x5ccef6){return _0x5ccef6[_0x57b5('0x22')](_0xd1a568)['then'](function(_0x11f154){return _0x11f154;});}return null;};}function removeEntity(_0x460d49,_0x4c2e0e){return function(_0x2f0f25){if(_0x2f0f25){return _0x2f0f25['destroy']()['then'](function(){_0x460d49[_0x57b5('0x17')](0xcc)[_0x57b5('0x16')]();});}};}function handleEntityNotFound(_0x2812c1,_0x19e323){return function(_0x34cd48){if(!_0x34cd48){_0x2812c1[_0x57b5('0x15')](0x194);}return _0x34cd48;};}function handleError(_0x3bd66a,_0x18e9d2){_0x18e9d2=_0x18e9d2||0x1f4;return function(_0x47ae44){logger[_0x57b5('0x23')](_0x47ae44[_0x57b5('0x24')]);if(_0x47ae44[_0x57b5('0x25')]){delete _0x47ae44[_0x57b5('0x25')];}_0x3bd66a[_0x57b5('0x17')](_0x18e9d2)[_0x57b5('0x26')](_0x47ae44);};}exports[_0x57b5('0x27')]=function(_0x1edb6d,_0x5095d6){var _0x729e5f={},_0x28a86f={},_0x3494c1={'count':0x0,'rows':[]};var _0x148d5f=_[_0x57b5('0x28')](db[_0x57b5('0x29')][_0x57b5('0x2a')],function(_0x533764){return{'name':_0x533764[_0x57b5('0x2b')],'type':_0x533764['type'][_0x57b5('0x2c')]};});_0x28a86f['model']=_[_0x57b5('0x28')](_0x148d5f,'name');_0x28a86f[_0x57b5('0x2d')]=_[_0x57b5('0x2e')](_0x1edb6d[_0x57b5('0x2d')]);_0x28a86f[_0x57b5('0x2f')]=_['intersection'](_0x28a86f[_0x57b5('0x30')],_0x28a86f['query']);_0x729e5f[_0x57b5('0x31')]=_[_0x57b5('0x32')](_0x28a86f[_0x57b5('0x30')],qs[_0x57b5('0x33')](_0x1edb6d[_0x57b5('0x2d')][_0x57b5('0x33')]));_0x729e5f['attributes']=_0x729e5f[_0x57b5('0x31')][_0x57b5('0x34')]?_0x729e5f['attributes']:_0x28a86f[_0x57b5('0x30')];if(!_0x1edb6d[_0x57b5('0x2d')][_0x57b5('0x35')]('nolimit')){_0x729e5f[_0x57b5('0x1a')]=qs[_0x57b5('0x1a')](_0x1edb6d[_0x57b5('0x2d')][_0x57b5('0x1a')]);_0x729e5f['offset']=qs['offset'](_0x1edb6d[_0x57b5('0x2d')][_0x57b5('0x19')]);}_0x729e5f[_0x57b5('0x36')]=qs[_0x57b5('0x37')](_0x1edb6d[_0x57b5('0x2d')][_0x57b5('0x37')]);_0x729e5f[_0x57b5('0x38')]=qs[_0x57b5('0x2f')](_[_0x57b5('0x39')](_0x1edb6d[_0x57b5('0x2d')],_0x28a86f[_0x57b5('0x2f')]),_0x148d5f);if(_0x1edb6d[_0x57b5('0x2d')][_0x57b5('0x3a')]){_0x729e5f[_0x57b5('0x38')]=_['merge'](_0x729e5f[_0x57b5('0x38')],{'$or':_[_0x57b5('0x28')](_0x148d5f,function(_0x551487){if(_0x551487[_0x57b5('0x3b')]!=='VIRTUAL'){var _0x2731af={};_0x2731af[_0x551487[_0x57b5('0x25')]]={'$like':'%'+_0x1edb6d[_0x57b5('0x2d')][_0x57b5('0x3a')]+'%'};return _0x2731af;}})});}_0x729e5f=_['merge']({},_0x729e5f,_0x1edb6d[_0x57b5('0x3c')]);var _0x33d59f={'where':_0x729e5f[_0x57b5('0x38')]};return db[_0x57b5('0x29')][_0x57b5('0x1c')](_0x33d59f)[_0x57b5('0x3d')](function(_0x3b6900){_0x3494c1[_0x57b5('0x1c')]=_0x3b6900;if(_0x1edb6d[_0x57b5('0x2d')][_0x57b5('0x3e')]){_0x729e5f[_0x57b5('0x3f')]=[{'all':!![]}];}return db[_0x57b5('0x29')][_0x57b5('0x40')](_0x729e5f);})[_0x57b5('0x3d')](function(_0x2b6e78){_0x3494c1[_0x57b5('0x41')]=_0x2b6e78;return _0x3494c1;})[_0x57b5('0x3d')](respondWithFilteredResult(_0x5095d6,_0x729e5f))[_0x57b5('0x42')](handleError(_0x5095d6,null));};exports['show']=function(_0x28ebc7,_0x45f05a){var _0x4e9b85={'raw':!![],'where':{'id':_0x28ebc7['params']['id']}},_0x5f13d9={};_0x5f13d9['model']=_['keys'](db[_0x57b5('0x29')][_0x57b5('0x2a')]);_0x5f13d9[_0x57b5('0x2d')]=_[_0x57b5('0x2e')](_0x28ebc7['query']);_0x5f13d9[_0x57b5('0x2f')]=_[_0x57b5('0x32')](_0x5f13d9['model'],_0x5f13d9['query']);_0x4e9b85[_0x57b5('0x31')]=_[_0x57b5('0x32')](_0x5f13d9[_0x57b5('0x30')],qs['fields'](_0x28ebc7['query'][_0x57b5('0x33')]));_0x4e9b85[_0x57b5('0x31')]=_0x4e9b85[_0x57b5('0x31')][_0x57b5('0x34')]?_0x4e9b85[_0x57b5('0x31')]:_0x5f13d9[_0x57b5('0x30')];if(_0x28ebc7[_0x57b5('0x2d')]['includeAll']){_0x4e9b85['include']=[{'all':!![]}];}_0x4e9b85=_[_0x57b5('0x43')]({},_0x4e9b85,_0x28ebc7[_0x57b5('0x3c')]);return db[_0x57b5('0x29')][_0x57b5('0x44')](_0x4e9b85)[_0x57b5('0x3d')](handleEntityNotFound(_0x45f05a,null))[_0x57b5('0x3d')](respondWithResult(_0x45f05a,null))[_0x57b5('0x42')](handleError(_0x45f05a,null));};exports['create']=function(_0x399bbb,_0x573547){return db[_0x57b5('0x29')][_0x57b5('0x45')](_0x399bbb[_0x57b5('0x46')],{})[_0x57b5('0x3d')](respondWithResult(_0x573547,0xc9))[_0x57b5('0x42')](handleError(_0x573547,null));};exports[_0x57b5('0x22')]=function(_0x513d27,_0x420017){if(_0x513d27[_0x57b5('0x46')]['id']){delete _0x513d27[_0x57b5('0x46')]['id'];}return db['JscriptyQuestionReport'][_0x57b5('0x44')]({'where':{'id':_0x513d27[_0x57b5('0x47')]['id']}})[_0x57b5('0x3d')](handleEntityNotFound(_0x420017,null))[_0x57b5('0x3d')](saveUpdates(_0x513d27[_0x57b5('0x46')],null))[_0x57b5('0x3d')](respondWithResult(_0x420017,null))[_0x57b5('0x42')](handleError(_0x420017,null));};exports[_0x57b5('0x48')]=function(_0x4c40a9,_0x13cc95){return db[_0x57b5('0x29')]['find']({'where':{'id':_0x4c40a9[_0x57b5('0x47')]['id']}})[_0x57b5('0x3d')](handleEntityNotFound(_0x13cc95,null))[_0x57b5('0x3d')](removeEntity(_0x13cc95,null))[_0x57b5('0x42')](handleError(_0x13cc95,null));};exports['describe']=function(_0x45d2f9,_0x160df3){return db['JscriptyQuestionReport'][_0x57b5('0x49')]()[_0x57b5('0x3d')](respondWithResult(_0x160df3,null))['catch'](handleError(_0x160df3,null));}; \ No newline at end of file +var _0x623f=['JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','model','intersection','fields','length','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x623f,0x14d));var _0xf623=function(_0x126ed0,_0x1c689c){_0x126ed0=_0x126ed0-0x0;var _0x42ce32=_0x623f[_0x126ed0];return _0x42ce32;};'use strict';var emlformat=require(_0xf623('0x0'));var rimraf=require(_0xf623('0x1'));var zipdir=require(_0xf623('0x2'));var jsonpatch=require(_0xf623('0x3'));var rp=require(_0xf623('0x4'));var moment=require('moment');var BPromise=require(_0xf623('0x5'));var Mustache=require('mustache');var util=require(_0xf623('0x6'));var path=require(_0xf623('0x7'));var sox=require(_0xf623('0x8'));var csv=require(_0xf623('0x9'));var ejs=require(_0xf623('0xa'));var fs=require('fs');var fs_extra=require(_0xf623('0xb'));var _=require(_0xf623('0xc'));var squel=require(_0xf623('0xd'));var crypto=require(_0xf623('0xe'));var jsforce=require(_0xf623('0xf'));var deskjs=require(_0xf623('0x10'));var toCsv=require(_0xf623('0x9'));var querystring=require(_0xf623('0x11'));var Papa=require(_0xf623('0x12'));var Redis=require(_0xf623('0x13'));var authService=require(_0xf623('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf623('0x15'));var utils=require(_0xf623('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf623('0x17'));var db=require(_0xf623('0x18'))['db'];function respondWithStatusCode(_0x3a9ee9,_0x57baec){_0x57baec=_0x57baec||0xcc;return function(_0x281c62){if(_0x281c62){return _0x3a9ee9['sendStatus'](_0x57baec);}return _0x3a9ee9[_0xf623('0x19')](_0x57baec)[_0xf623('0x1a')]();};}function respondWithResult(_0x4e7e57,_0x9aa3a7){_0x9aa3a7=_0x9aa3a7||0xc8;return function(_0x5169b3){if(_0x5169b3){return _0x4e7e57[_0xf623('0x19')](_0x9aa3a7)[_0xf623('0x1b')](_0x5169b3);}};}function respondWithFilteredResult(_0x1f811b,_0x48063e){return function(_0x397da4){if(_0x397da4){var _0x17b605=typeof _0x48063e['offset']===_0xf623('0x1c')&&typeof _0x48063e[_0xf623('0x1d')]===_0xf623('0x1c');var _0x18a725=_0x397da4[_0xf623('0x1e')];var _0x4f3658=_0x17b605?0x0:_0x48063e['offset'];var _0x51a0a3=_0x17b605?_0x397da4[_0xf623('0x1e')]:_0x48063e['offset']+_0x48063e[_0xf623('0x1d')];var _0x2cb994;if(_0x51a0a3>=_0x18a725){_0x51a0a3=_0x18a725;_0x2cb994=0xc8;}else{_0x2cb994=0xce;}_0x1f811b[_0xf623('0x19')](_0x2cb994);return _0x1f811b[_0xf623('0x1f')](_0xf623('0x20'),_0x4f3658+'-'+_0x51a0a3+'/'+_0x18a725)['json'](_0x397da4);}return null;};}function patchUpdates(_0x399da1){return function(_0x1a2a4b){try{jsonpatch['apply'](_0x1a2a4b,_0x399da1,!![]);}catch(_0x39b691){return BPromise['reject'](_0x39b691);}return _0x1a2a4b[_0xf623('0x21')]();};}function saveUpdates(_0x46bb90,_0x3b2519){return function(_0x47a90f){if(_0x47a90f){return _0x47a90f[_0xf623('0x22')](_0x46bb90)[_0xf623('0x23')](function(_0x404bf5){return _0x404bf5;});}return null;};}function removeEntity(_0x48aa42,_0x294455){return function(_0x359346){if(_0x359346){return _0x359346[_0xf623('0x24')]()['then'](function(){_0x48aa42[_0xf623('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5849,_0x315a9d){return function(_0x32a4be){if(!_0x32a4be){_0x1e5849['sendStatus'](0x194);}return _0x32a4be;};}function handleError(_0x409e39,_0x108ec6){_0x108ec6=_0x108ec6||0x1f4;return function(_0x24a68a){logger[_0xf623('0x25')](_0x24a68a[_0xf623('0x26')]);if(_0x24a68a[_0xf623('0x27')]){delete _0x24a68a[_0xf623('0x27')];}_0x409e39[_0xf623('0x19')](_0x108ec6)[_0xf623('0x28')](_0x24a68a);};}exports['index']=function(_0x5ec92a,_0x3ede0a){var _0x4ee37a={},_0x5dd226={},_0x51b3df={'count':0x0,'rows':[]};var _0x285629=_[_0xf623('0x29')](db[_0xf623('0x2a')][_0xf623('0x2b')],function(_0x23db67){return{'name':_0x23db67[_0xf623('0x2c')],'type':_0x23db67[_0xf623('0x2d')][_0xf623('0x2e')]};});_0x5dd226['model']=_['map'](_0x285629,_0xf623('0x27'));_0x5dd226[_0xf623('0x2f')]=_[_0xf623('0x30')](_0x5ec92a[_0xf623('0x2f')]);_0x5dd226['filters']=_['intersection'](_0x5dd226[_0xf623('0x31')],_0x5dd226[_0xf623('0x2f')]);_0x4ee37a['attributes']=_[_0xf623('0x32')](_0x5dd226['model'],qs[_0xf623('0x33')](_0x5ec92a['query'][_0xf623('0x33')]));_0x4ee37a['attributes']=_0x4ee37a['attributes'][_0xf623('0x34')]?_0x4ee37a[_0xf623('0x35')]:_0x5dd226[_0xf623('0x31')];if(!_0x5ec92a[_0xf623('0x2f')][_0xf623('0x36')](_0xf623('0x37'))){_0x4ee37a[_0xf623('0x1d')]=qs[_0xf623('0x1d')](_0x5ec92a[_0xf623('0x2f')]['limit']);_0x4ee37a[_0xf623('0x38')]=qs[_0xf623('0x38')](_0x5ec92a[_0xf623('0x2f')][_0xf623('0x38')]);}_0x4ee37a[_0xf623('0x39')]=qs[_0xf623('0x3a')](_0x5ec92a[_0xf623('0x2f')]['sort']);_0x4ee37a[_0xf623('0x3b')]=qs['filters'](_[_0xf623('0x3c')](_0x5ec92a[_0xf623('0x2f')],_0x5dd226[_0xf623('0x3d')]),_0x285629);if(_0x5ec92a[_0xf623('0x2f')][_0xf623('0x3e')]){_0x4ee37a[_0xf623('0x3b')]=_[_0xf623('0x3f')](_0x4ee37a[_0xf623('0x3b')],{'$or':_[_0xf623('0x29')](_0x285629,function(_0xe3588a){if(_0xe3588a[_0xf623('0x2d')]!=='VIRTUAL'){var _0x464478={};_0x464478[_0xe3588a[_0xf623('0x27')]]={'$like':'%'+_0x5ec92a[_0xf623('0x2f')]['filter']+'%'};return _0x464478;}})});}_0x4ee37a=_[_0xf623('0x3f')]({},_0x4ee37a,_0x5ec92a[_0xf623('0x40')]);var _0x36f705={'where':_0x4ee37a['where']};return db[_0xf623('0x2a')][_0xf623('0x1e')](_0x36f705)[_0xf623('0x23')](function(_0x1d247b){_0x51b3df[_0xf623('0x1e')]=_0x1d247b;if(_0x5ec92a['query'][_0xf623('0x41')]){_0x4ee37a[_0xf623('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x4ee37a);})[_0xf623('0x23')](function(_0x2509ec){_0x51b3df[_0xf623('0x43')]=_0x2509ec;return _0x51b3df;})[_0xf623('0x23')](respondWithFilteredResult(_0x3ede0a,_0x4ee37a))[_0xf623('0x44')](handleError(_0x3ede0a,null));};exports[_0xf623('0x45')]=function(_0x2fa4be,_0xd76c2e){var _0x4465e0={'raw':!![],'where':{'id':_0x2fa4be[_0xf623('0x46')]['id']}},_0x413280={};_0x413280[_0xf623('0x31')]=_[_0xf623('0x30')](db[_0xf623('0x2a')][_0xf623('0x2b')]);_0x413280['query']=_[_0xf623('0x30')](_0x2fa4be[_0xf623('0x2f')]);_0x413280[_0xf623('0x3d')]=_[_0xf623('0x32')](_0x413280['model'],_0x413280[_0xf623('0x2f')]);_0x4465e0[_0xf623('0x35')]=_[_0xf623('0x32')](_0x413280[_0xf623('0x31')],qs['fields'](_0x2fa4be['query']['fields']));_0x4465e0[_0xf623('0x35')]=_0x4465e0['attributes'][_0xf623('0x34')]?_0x4465e0[_0xf623('0x35')]:_0x413280[_0xf623('0x31')];if(_0x2fa4be[_0xf623('0x2f')]['includeAll']){_0x4465e0['include']=[{'all':!![]}];}_0x4465e0=_['merge']({},_0x4465e0,_0x2fa4be[_0xf623('0x40')]);return db[_0xf623('0x2a')][_0xf623('0x47')](_0x4465e0)[_0xf623('0x23')](handleEntityNotFound(_0xd76c2e,null))[_0xf623('0x23')](respondWithResult(_0xd76c2e,null))[_0xf623('0x44')](handleError(_0xd76c2e,null));};exports[_0xf623('0x48')]=function(_0x354326,_0x5b8b01){return db[_0xf623('0x2a')][_0xf623('0x48')](_0x354326[_0xf623('0x49')],{})[_0xf623('0x23')](respondWithResult(_0x5b8b01,0xc9))[_0xf623('0x44')](handleError(_0x5b8b01,null));};exports[_0xf623('0x22')]=function(_0x5e8257,_0xb19f39){if(_0x5e8257[_0xf623('0x49')]['id']){delete _0x5e8257[_0xf623('0x49')]['id'];}return db[_0xf623('0x2a')][_0xf623('0x47')]({'where':{'id':_0x5e8257[_0xf623('0x46')]['id']}})[_0xf623('0x23')](handleEntityNotFound(_0xb19f39,null))['then'](saveUpdates(_0x5e8257['body'],null))[_0xf623('0x23')](respondWithResult(_0xb19f39,null))[_0xf623('0x44')](handleError(_0xb19f39,null));};exports[_0xf623('0x24')]=function(_0x40a71a,_0x2827b4){return db['JscriptyQuestionReport'][_0xf623('0x47')]({'where':{'id':_0x40a71a[_0xf623('0x46')]['id']}})[_0xf623('0x23')](handleEntityNotFound(_0x2827b4,null))[_0xf623('0x23')](removeEntity(_0x2827b4,null))[_0xf623('0x44')](handleError(_0x2827b4,null));};exports['describe']=function(_0x480a87,_0x12a923){return db[_0xf623('0x2a')][_0xf623('0x4a')]()[_0xf623('0x23')](respondWithResult(_0x12a923,null))[_0xf623('0x44')](handleError(_0x12a923,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 3c6de16..36c48b8 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 _0x4ecc=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0xd91aea,_0x90202d){var _0xed7cb0=function(_0x325633){while(--_0x325633){_0xd91aea['push'](_0xd91aea['shift']());}};_0xed7cb0(++_0x90202d);}(_0x4ecc,0x67));var _0xc4ec=function(_0x5396d4,_0x86297a){_0x5396d4=_0x5396d4-0x0;var _0x9fa122=_0x4ecc[_0x5396d4];return _0x9fa122;};'use strict';var _=require(_0xc4ec('0x0'));var util=require(_0xc4ec('0x1'));var logger=require(_0xc4ec('0x2'))(_0xc4ec('0x3'));var moment=require(_0xc4ec('0x4'));var BPromise=require(_0xc4ec('0x5'));var rp=require(_0xc4ec('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4ec('0x7'));var config=require(_0xc4ec('0x8'));var attributes=require(_0xc4ec('0x9'));module['exports']=function(_0x5cdfee,_0x3248c7){return _0x5cdfee[_0xc4ec('0xa')](_0xc4ec('0xb'),attributes,{'tableName':_0xc4ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8191=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','request-promise','path','rimraf','exports'];(function(_0x40d880,_0x4efb34){var _0x49c3b0=function(_0x30996f){while(--_0x30996f){_0x40d880['push'](_0x40d880['shift']());}};_0x49c3b0(++_0x4efb34);}(_0x8191,0xea));var _0x1819=function(_0x57aa39,_0x5b7dd9){_0x57aa39=_0x57aa39-0x0;var _0x1d9f2e=_0x8191[_0x57aa39];return _0x1d9f2e;};'use strict';var _=require(_0x1819('0x0'));var util=require(_0x1819('0x1'));var logger=require('../../config/logger')(_0x1819('0x2'));var moment=require(_0x1819('0x3'));var BPromise=require('bluebird');var rp=require(_0x1819('0x4'));var fs=require('fs');var path=require(_0x1819('0x5'));var rimraf=require(_0x1819('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0x1819('0x7')]=function(_0xb2ef93,_0x3f162f){return _0xb2ef93[_0x1819('0x8')](_0x1819('0x9'),attributes,{'tableName':_0x1819('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 682c4d9..ecb10ba 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 _0x8de2=['message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5e5067,_0x43a001){var _0x96d596=function(_0xd5d09){while(--_0xd5d09){_0x5e5067['push'](_0x5e5067['shift']());}};_0x96d596(++_0x43a001);}(_0x8de2,0x168));var _0x28de=function(_0x1a6363,_0x205f25){_0x1a6363=_0x1a6363-0x0;var _0xd22157=_0x8de2[_0x1a6363];return _0xd22157;};'use strict';var _=require(_0x28de('0x0'));var util=require(_0x28de('0x1'));var moment=require(_0x28de('0x2'));var BPromise=require('bluebird');var rs=require(_0x28de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x28de('0x4'));var logger=require(_0x28de('0x5'))(_0x28de('0x6'));var config=require(_0x28de('0x7'));var jayson=require(_0x28de('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24e2f4,_0x46c63b,_0x5d20fa){return new BPromise(function(_0x556465,_0x2bd566){return client[_0x28de('0x9')](_0x24e2f4,_0x5d20fa)['then'](function(_0x4774c9){logger[_0x28de('0xa')](_0x28de('0xb'),_0x46c63b,_0x28de('0xc'));logger[_0x28de('0xd')](_0x28de('0xe'),_0x46c63b,_0x28de('0xc'),JSON[_0x28de('0xf')](_0x4774c9));if(_0x4774c9[_0x28de('0x10')]){if(_0x4774c9['error'][_0x28de('0x11')]===0x1f4){logger[_0x28de('0x10')](_0x28de('0xb'),_0x46c63b,_0x4774c9[_0x28de('0x10')][_0x28de('0x12')]);return _0x2bd566(_0x4774c9[_0x28de('0x10')]['message']);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x46c63b,_0x4774c9['error'][_0x28de('0x12')]);return _0x556465(_0x4774c9['error'][_0x28de('0x12')]);}else{logger[_0x28de('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x46c63b,_0x28de('0xc'));_0x556465(_0x4774c9[_0x28de('0x13')][_0x28de('0x12')]);}})[_0x28de('0x14')](function(_0x51c9d5){logger[_0x28de('0x10')](_0x28de('0xb'),_0x46c63b,_0x51c9d5);_0x2bd566(_0x51c9d5);});});} \ No newline at end of file +var _0x4a65=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2e83cb,_0x2c7b56){var _0x339202=function(_0x1bf34d){while(--_0x1bf34d){_0x2e83cb['push'](_0x2e83cb['shift']());}};_0x339202(++_0x2c7b56);}(_0x4a65,0x6f));var _0x54a6=function(_0x29ddf9,_0x161a72){_0x29ddf9=_0x29ddf9-0x0;var _0x5060cb=_0x4a65[_0x29ddf9];return _0x5060cb;};'use strict';var _=require(_0x54a6('0x0'));var util=require(_0x54a6('0x1'));var moment=require(_0x54a6('0x2'));var BPromise=require(_0x54a6('0x3'));var rs=require(_0x54a6('0x4'));var fs=require('fs');var Redis=require(_0x54a6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x54a6('0x6'));var logger=require(_0x54a6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x54a6('0x8'));var client=jayson[_0x54a6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bdd52,_0x15615f,_0x37a412){return new BPromise(function(_0x5d8e03,_0x302762){return client[_0x54a6('0xa')](_0x2bdd52,_0x37a412)[_0x54a6('0xb')](function(_0x11d2f4){logger[_0x54a6('0xc')](_0x54a6('0xd'),_0x15615f,_0x54a6('0xe'));logger[_0x54a6('0xf')](_0x54a6('0x10'),_0x15615f,_0x54a6('0xe'),JSON[_0x54a6('0x11')](_0x11d2f4));if(_0x11d2f4[_0x54a6('0x12')]){if(_0x11d2f4[_0x54a6('0x12')][_0x54a6('0x13')]===0x1f4){logger[_0x54a6('0x12')](_0x54a6('0xd'),_0x15615f,_0x11d2f4[_0x54a6('0x12')]['message']);return _0x302762(_0x11d2f4[_0x54a6('0x12')][_0x54a6('0x14')]);}logger[_0x54a6('0x12')](_0x54a6('0xd'),_0x15615f,_0x11d2f4['error'][_0x54a6('0x14')]);return _0x5d8e03(_0x11d2f4[_0x54a6('0x12')][_0x54a6('0x14')]);}else{logger[_0x54a6('0xc')](_0x54a6('0xd'),_0x15615f,_0x54a6('0xe'));_0x5d8e03(_0x11d2f4['result'][_0x54a6('0x14')]);}})['catch'](function(_0x1c2d2a){logger[_0x54a6('0x12')](_0x54a6('0xd'),_0x15615f,_0x1c2d2a);_0x302762(_0x1c2d2a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 5a369fb..bec12b5 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 _0x6048=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','/describe','describe','get','getQuestions','post','put','/:id'];(function(_0x116d16,_0xaa138d){var _0x2c6405=function(_0x28524d){while(--_0x28524d){_0x116d16['push'](_0x116d16['shift']());}};_0x2c6405(++_0xaa138d);}(_0x6048,0x6c));var _0x8604=function(_0xabe340,_0x1c0b0c){_0xabe340=_0xabe340-0x0;var _0x29edb5=_0x6048[_0xabe340];return _0x29edb5;};'use strict';var multer=require(_0x8604('0x0'));var util=require('util');var path=require(_0x8604('0x1'));var timeout=require(_0x8604('0x2'));var express=require(_0x8604('0x3'));var router=express[_0x8604('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8604('0x5'));var interaction=require(_0x8604('0x6'));var config=require(_0x8604('0x7'));var controller=require(_0x8604('0x8'));router['get']('/',auth[_0x8604('0x9')](),controller[_0x8604('0xa')]);router['get'](_0x8604('0xb'),auth[_0x8604('0x9')](),controller[_0x8604('0xc')]);router[_0x8604('0xd')]('/:id',auth[_0x8604('0x9')](),controller['show']);router[_0x8604('0xd')]('/:id/questions',auth[_0x8604('0x9')](),controller[_0x8604('0xe')]);router[_0x8604('0xf')]('/',auth[_0x8604('0x9')](),controller['create']);router[_0x8604('0x10')](_0x8604('0x11'),auth[_0x8604('0x9')](),controller[_0x8604('0x12')]);router[_0x8604('0x13')](_0x8604('0x11'),auth[_0x8604('0x9')](),controller['destroy']);module[_0x8604('0x14')]=router; \ No newline at end of file +var _0xd83c=['describe','/:id','show','getQuestions','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe'];(function(_0x3d3d24,_0x5a3838){var _0xca243c=function(_0x595be3){while(--_0x595be3){_0x3d3d24['push'](_0x3d3d24['shift']());}};_0xca243c(++_0x5a3838);}(_0xd83c,0x1ee));var _0xcd83=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0xd83c[_0x39bfb6];return _0x23fef9;};'use strict';var multer=require(_0xcd83('0x0'));var util=require(_0xcd83('0x1'));var path=require(_0xcd83('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd83('0x3'));var router=express[_0xcd83('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcd83('0x5'));var interaction=require(_0xcd83('0x6'));var config=require(_0xcd83('0x7'));var controller=require(_0xcd83('0x8'));router[_0xcd83('0x9')]('/',auth[_0xcd83('0xa')](),controller['index']);router[_0xcd83('0x9')](_0xcd83('0xb'),auth[_0xcd83('0xa')](),controller[_0xcd83('0xc')]);router[_0xcd83('0x9')](_0xcd83('0xd'),auth[_0xcd83('0xa')](),controller[_0xcd83('0xe')]);router['get']('/:id/questions',auth['isAuthenticated'](),controller[_0xcd83('0xf')]);router[_0xcd83('0x10')]('/',auth[_0xcd83('0xa')](),controller[_0xcd83('0x11')]);router['put'](_0xcd83('0xd'),auth[_0xcd83('0xa')](),controller[_0xcd83('0x12')]);router[_0xcd83('0x13')](_0xcd83('0xd'),auth['isAuthenticated'](),controller[_0xcd83('0x14')]);module[_0xcd83('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index aad5a56..548d7af 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 _0xeccc=['DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xeccc,0x17a));var _0xcecc=function(_0x868611,_0x1a176e){_0x868611=_0x868611-0x0;var _0x143a08=_0xeccc[_0x868611];return _0x143a08;};'use strict';var moment=require(_0xcecc('0x0'));var Sequelize=require('sequelize');module[_0xcecc('0x1')]={'starttime':{'type':Sequelize[_0xcecc('0x2')],'set':function(_0x40baca){this[_0xcecc('0x3')](_0xcecc('0x4'),_0x40baca);this['setDataValue'](_0xcecc('0x5'),moment()[_0xcecc('0x6')](_0xcecc('0x7')));}},'endtime':{'type':Sequelize[_0xcecc('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xcecc('0x8')]},'queue':{'type':Sequelize[_0xcecc('0x8')]},'uniqueid':{'type':Sequelize[_0xcecc('0x8')]},'calleridname':{'type':Sequelize[_0xcecc('0x8')]},'calleridnum':{'type':Sequelize[_0xcecc('0x8')]},'completed':{'type':Sequelize[_0xcecc('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x68c3=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue','endtime'];(function(_0x2980d5,_0x3d3aa9){var _0x2042f4=function(_0x110716){while(--_0x110716){_0x2980d5['push'](_0x2980d5['shift']());}};_0x2042f4(++_0x3d3aa9);}(_0x68c3,0x8b));var _0x368c=function(_0x1b0cf1,_0x292fcd){_0x1b0cf1=_0x1b0cf1-0x0;var _0x4857e5=_0x68c3[_0x1b0cf1];return _0x4857e5;};'use strict';var moment=require(_0x368c('0x0'));var Sequelize=require('sequelize');module[_0x368c('0x1')]={'starttime':{'type':Sequelize[_0x368c('0x2')],'set':function(_0x3248af){this[_0x368c('0x3')]('starttime',_0x3248af);this[_0x368c('0x3')](_0x368c('0x4'),moment()[_0x368c('0x5')](_0x368c('0x6')));}},'endtime':{'type':Sequelize[_0x368c('0x2')]},'membername':{'type':Sequelize[_0x368c('0x7')]},'projectname':{'type':Sequelize[_0x368c('0x7')]},'queue':{'type':Sequelize[_0x368c('0x7')]},'uniqueid':{'type':Sequelize[_0x368c('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x368c('0x7')]},'completed':{'type':Sequelize[_0x368c('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index a51ad66..eaa787d 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 _0xa1e0=['includeAll','rows','catch','show','params','include','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','pick','SessionId','filter','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','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','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL'];(function(_0x3a259b,_0x3bf3d1){var _0x56dc4f=function(_0xc9a1f){while(--_0xc9a1f){_0x3a259b['push'](_0x3a259b['shift']());}};_0x56dc4f(++_0x3bf3d1);}(_0xa1e0,0x117));var _0x0a1e=function(_0x136ff3,_0x5020dd){_0x136ff3=_0x136ff3-0x0;var _0x1570bf=_0xa1e0[_0x136ff3];return _0x1570bf;};'use strict';var emlformat=require(_0x0a1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a1e('0x1'));var jsonpatch=require(_0x0a1e('0x2'));var rp=require(_0x0a1e('0x3'));var moment=require('moment');var BPromise=require(_0x0a1e('0x4'));var Mustache=require(_0x0a1e('0x5'));var util=require(_0x0a1e('0x6'));var path=require(_0x0a1e('0x7'));var sox=require(_0x0a1e('0x8'));var csv=require(_0x0a1e('0x9'));var ejs=require(_0x0a1e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a1e('0xb'));var squel=require(_0x0a1e('0xc'));var crypto=require(_0x0a1e('0xd'));var jsforce=require(_0x0a1e('0xe'));var deskjs=require(_0x0a1e('0xf'));var toCsv=require(_0x0a1e('0x9'));var querystring=require(_0x0a1e('0x10'));var Papa=require(_0x0a1e('0x11'));var Redis=require(_0x0a1e('0x12'));var authService=require(_0x0a1e('0x13'));var qs=require(_0x0a1e('0x14'));var as=require(_0x0a1e('0x15'));var hardwareService=require(_0x0a1e('0x16'));var logger=require(_0x0a1e('0x17'))(_0x0a1e('0x18'));var utils=require(_0x0a1e('0x19'));var config=require(_0x0a1e('0x1a'));var licenseUtil=require(_0x0a1e('0x1b'));var db=require(_0x0a1e('0x1c'))['db'];function respondWithStatusCode(_0x1939e5,_0x10f452){_0x10f452=_0x10f452||0xcc;return function(_0x30aa6d){if(_0x30aa6d){return _0x1939e5['sendStatus'](_0x10f452);}return _0x1939e5[_0x0a1e('0x1d')](_0x10f452)[_0x0a1e('0x1e')]();};}function respondWithResult(_0x3b9559,_0x1a6544){_0x1a6544=_0x1a6544||0xc8;return function(_0x134bdc){if(_0x134bdc){return _0x3b9559[_0x0a1e('0x1d')](_0x1a6544)[_0x0a1e('0x1f')](_0x134bdc);}};}function respondWithFilteredResult(_0x435d3d,_0x2630cf){return function(_0x56bac5){if(_0x56bac5){var _0x2c3e8c=typeof _0x2630cf[_0x0a1e('0x20')]==='undefined'&&typeof _0x2630cf[_0x0a1e('0x21')]==='undefined';var _0x5b3206=_0x56bac5['count'];var _0x2dc1ef=_0x2c3e8c?0x0:_0x2630cf[_0x0a1e('0x20')];var _0x4efec1=_0x2c3e8c?_0x56bac5[_0x0a1e('0x22')]:_0x2630cf[_0x0a1e('0x20')]+_0x2630cf[_0x0a1e('0x21')];var _0xcde029;if(_0x4efec1>=_0x5b3206){_0x4efec1=_0x5b3206;_0xcde029=0xc8;}else{_0xcde029=0xce;}_0x435d3d['status'](_0xcde029);return _0x435d3d[_0x0a1e('0x23')](_0x0a1e('0x24'),_0x2dc1ef+'-'+_0x4efec1+'/'+_0x5b3206)[_0x0a1e('0x1f')](_0x56bac5);}return null;};}function patchUpdates(_0x5092ca){return function(_0x1f9f7d){try{jsonpatch[_0x0a1e('0x25')](_0x1f9f7d,_0x5092ca,!![]);}catch(_0x5674b5){return BPromise[_0x0a1e('0x26')](_0x5674b5);}return _0x1f9f7d[_0x0a1e('0x27')]();};}function saveUpdates(_0x5a373a,_0x53ca0d){return function(_0x404b1e){if(_0x404b1e){return _0x404b1e[_0x0a1e('0x28')](_0x5a373a)[_0x0a1e('0x29')](function(_0x1c06b6){return _0x1c06b6;});}return null;};}function removeEntity(_0xe875f4,_0x20dd05){return function(_0x4176c9){if(_0x4176c9){return _0x4176c9[_0x0a1e('0x2a')]()[_0x0a1e('0x29')](function(){_0xe875f4[_0x0a1e('0x1d')](0xcc)[_0x0a1e('0x1e')]();});}};}function handleEntityNotFound(_0x2269a0,_0x4fec2b){return function(_0x20c32a){if(!_0x20c32a){_0x2269a0[_0x0a1e('0x2b')](0x194);}return _0x20c32a;};}function handleError(_0x597ad3,_0x62ab05){_0x62ab05=_0x62ab05||0x1f4;return function(_0x289b66){logger[_0x0a1e('0x2c')](_0x289b66[_0x0a1e('0x2d')]);if(_0x289b66['name']){delete _0x289b66[_0x0a1e('0x2e')];}_0x597ad3[_0x0a1e('0x1d')](_0x62ab05)[_0x0a1e('0x2f')](_0x289b66);};}exports[_0x0a1e('0x30')]=function(_0x117309,_0xae163a){var _0x25e81f={},_0xb7001b={},_0x3ea1a6={'count':0x0,'rows':[]};var _0x5be11a=_[_0x0a1e('0x31')](db[_0x0a1e('0x32')][_0x0a1e('0x33')],function(_0x245681){return{'name':_0x245681[_0x0a1e('0x34')],'type':_0x245681[_0x0a1e('0x35')][_0x0a1e('0x36')]};});_0xb7001b[_0x0a1e('0x37')]=_[_0x0a1e('0x31')](_0x5be11a,'name');_0xb7001b[_0x0a1e('0x38')]=_[_0x0a1e('0x39')](_0x117309[_0x0a1e('0x38')]);_0xb7001b[_0x0a1e('0x3a')]=_[_0x0a1e('0x3b')](_0xb7001b[_0x0a1e('0x37')],_0xb7001b[_0x0a1e('0x38')]);_0x25e81f['attributes']=_[_0x0a1e('0x3b')](_0xb7001b['model'],qs['fields'](_0x117309[_0x0a1e('0x38')][_0x0a1e('0x3c')]));_0x25e81f[_0x0a1e('0x3d')]=_0x25e81f[_0x0a1e('0x3d')][_0x0a1e('0x3e')]?_0x25e81f[_0x0a1e('0x3d')]:_0xb7001b[_0x0a1e('0x37')];if(!_0x117309[_0x0a1e('0x38')]['hasOwnProperty'](_0x0a1e('0x3f'))){_0x25e81f[_0x0a1e('0x21')]=qs[_0x0a1e('0x21')](_0x117309['query'][_0x0a1e('0x21')]);_0x25e81f[_0x0a1e('0x20')]=qs[_0x0a1e('0x20')](_0x117309[_0x0a1e('0x38')]['offset']);}_0x25e81f[_0x0a1e('0x40')]=qs['sort'](_0x117309[_0x0a1e('0x38')][_0x0a1e('0x41')]);_0x25e81f[_0x0a1e('0x42')]=qs[_0x0a1e('0x3a')](_['pick'](_0x117309['query'],_0xb7001b[_0x0a1e('0x3a')]),_0x5be11a);if(_0x117309[_0x0a1e('0x38')]['filter']){_0x25e81f['where']=_[_0x0a1e('0x43')](_0x25e81f[_0x0a1e('0x42')],{'$or':_['map'](_0x5be11a,function(_0x9ab414){if(_0x9ab414['type']!==_0x0a1e('0x44')){var _0x119ec2={};_0x119ec2[_0x9ab414[_0x0a1e('0x2e')]]={'$like':'%'+_0x117309[_0x0a1e('0x38')]['filter']+'%'};return _0x119ec2;}})});}_0x25e81f=_[_0x0a1e('0x43')]({},_0x25e81f,_0x117309['options']);var _0x505ada={'where':_0x25e81f[_0x0a1e('0x42')]};return db[_0x0a1e('0x32')][_0x0a1e('0x22')](_0x505ada)[_0x0a1e('0x29')](function(_0x457b3d){_0x3ea1a6[_0x0a1e('0x22')]=_0x457b3d;if(_0x117309[_0x0a1e('0x38')][_0x0a1e('0x45')]){_0x25e81f['include']=[{'all':!![]}];}return db[_0x0a1e('0x32')]['findAll'](_0x25e81f);})['then'](function(_0x27ae78){_0x3ea1a6[_0x0a1e('0x46')]=_0x27ae78;return _0x3ea1a6;})[_0x0a1e('0x29')](respondWithFilteredResult(_0xae163a,_0x25e81f))[_0x0a1e('0x47')](handleError(_0xae163a,null));};exports[_0x0a1e('0x48')]=function(_0xc8a163,_0x4175a4){var _0x86d64e={'raw':!![],'where':{'id':_0xc8a163[_0x0a1e('0x49')]['id']}},_0x2c90cc={};_0x2c90cc[_0x0a1e('0x37')]=_[_0x0a1e('0x39')](db[_0x0a1e('0x32')]['rawAttributes']);_0x2c90cc[_0x0a1e('0x38')]=_['keys'](_0xc8a163[_0x0a1e('0x38')]);_0x2c90cc[_0x0a1e('0x3a')]=_[_0x0a1e('0x3b')](_0x2c90cc[_0x0a1e('0x37')],_0x2c90cc['query']);_0x86d64e[_0x0a1e('0x3d')]=_[_0x0a1e('0x3b')](_0x2c90cc['model'],qs['fields'](_0xc8a163[_0x0a1e('0x38')][_0x0a1e('0x3c')]));_0x86d64e[_0x0a1e('0x3d')]=_0x86d64e['attributes'][_0x0a1e('0x3e')]?_0x86d64e[_0x0a1e('0x3d')]:_0x2c90cc[_0x0a1e('0x37')];if(_0xc8a163[_0x0a1e('0x38')][_0x0a1e('0x45')]){_0x86d64e[_0x0a1e('0x4a')]=[{'all':!![]}];}_0x86d64e=_['merge']({},_0x86d64e,_0xc8a163[_0x0a1e('0x4b')]);return db['JscriptySessionReport'][_0x0a1e('0x4c')](_0x86d64e)[_0x0a1e('0x29')](handleEntityNotFound(_0x4175a4,null))[_0x0a1e('0x29')](respondWithResult(_0x4175a4,null))['catch'](handleError(_0x4175a4,null));};exports[_0x0a1e('0x4d')]=function(_0x2fba98,_0x2090a9){return db[_0x0a1e('0x32')]['create'](_0x2fba98['body'],{})[_0x0a1e('0x29')](respondWithResult(_0x2090a9,0xc9))['catch'](handleError(_0x2090a9,null));};exports[_0x0a1e('0x28')]=function(_0x431b90,_0x1a1c60){if(_0x431b90[_0x0a1e('0x4e')]['id']){delete _0x431b90[_0x0a1e('0x4e')]['id'];}return db[_0x0a1e('0x32')]['find']({'where':{'id':_0x431b90['params']['id']}})[_0x0a1e('0x29')](handleEntityNotFound(_0x1a1c60,null))[_0x0a1e('0x29')](saveUpdates(_0x431b90[_0x0a1e('0x4e')],null))[_0x0a1e('0x29')](respondWithResult(_0x1a1c60,null))['catch'](handleError(_0x1a1c60,null));};exports['destroy']=function(_0x51e490,_0x44d918){return db[_0x0a1e('0x32')][_0x0a1e('0x4c')]({'where':{'id':_0x51e490[_0x0a1e('0x49')]['id']}})[_0x0a1e('0x29')](handleEntityNotFound(_0x44d918,null))['then'](removeEntity(_0x44d918,null))['catch'](handleError(_0x44d918,null));};exports['describe']=function(_0x1c317a,_0x570c2a){return db[_0x0a1e('0x32')][_0x0a1e('0x4f')]()[_0x0a1e('0x29')](respondWithResult(_0x570c2a,null))[_0x0a1e('0x47')](handleError(_0x570c2a,null));};exports[_0x0a1e('0x50')]=function(_0x4de810,_0x1e7df7,_0xdcd589){var _0x43252a={'raw':!![],'where':{}};var _0x4d1bb8={};var _0x4356ae={'count':0x0,'rows':[]};return db[_0x0a1e('0x32')][_0x0a1e('0x51')]({'where':{'id':_0x4de810[_0x0a1e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e7df7,null))['then'](function(_0x2c07df){if(_0x2c07df){_0x4d1bb8[_0x0a1e('0x37')]=_['keys'](db[_0x0a1e('0x52')][_0x0a1e('0x33')]);_0x4d1bb8[_0x0a1e('0x38')]=_[_0x0a1e('0x39')](_0x4de810[_0x0a1e('0x38')]);_0x4d1bb8[_0x0a1e('0x3a')]=_[_0x0a1e('0x3b')](_0x4d1bb8['model'],_0x4d1bb8[_0x0a1e('0x38')]);_0x43252a[_0x0a1e('0x3d')]=_[_0x0a1e('0x3b')](_0x4d1bb8['model'],qs[_0x0a1e('0x3c')](_0x4de810['query'][_0x0a1e('0x3c')]));_0x43252a['attributes']=_0x43252a['attributes'][_0x0a1e('0x3e')]?_0x43252a[_0x0a1e('0x3d')]:_0x4d1bb8[_0x0a1e('0x37')];if(!_0x4de810[_0x0a1e('0x38')][_0x0a1e('0x53')]('nolimit')){_0x43252a[_0x0a1e('0x21')]=qs[_0x0a1e('0x21')](_0x4de810[_0x0a1e('0x38')][_0x0a1e('0x21')]);_0x43252a[_0x0a1e('0x20')]=qs[_0x0a1e('0x20')](_0x4de810[_0x0a1e('0x38')]['offset']);}_0x43252a[_0x0a1e('0x40')]=qs[_0x0a1e('0x41')](_0x4de810[_0x0a1e('0x38')]['sort']);_0x43252a['where']=qs[_0x0a1e('0x3a')](_[_0x0a1e('0x54')](_0x4de810['query'],_0x4d1bb8[_0x0a1e('0x3a')]));_0x43252a[_0x0a1e('0x42')][_0x0a1e('0x55')]=_0x2c07df['id'];if(_0x4de810[_0x0a1e('0x38')][_0x0a1e('0x56')]){_0x43252a[_0x0a1e('0x42')]=_[_0x0a1e('0x43')](_0x43252a[_0x0a1e('0x42')],{'$or':_[_0x0a1e('0x31')](_0x43252a['attributes'],function(_0x34fcf8){var _0x305237={};_0x305237[_0x34fcf8]={'$like':'%'+_0x4de810['query'][_0x0a1e('0x56')]+'%'};return _0x305237;})});}_0x43252a=_['merge']({},_0x43252a,_0x4de810[_0x0a1e('0x4b')]);return db[_0x0a1e('0x52')]['count']({'where':_0x43252a['where']})[_0x0a1e('0x29')](function(_0x12c3ff){_0x4356ae[_0x0a1e('0x22')]=_0x12c3ff;if(_0x4de810['query'][_0x0a1e('0x45')]){_0x43252a[_0x0a1e('0x4a')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x43252a);})[_0x0a1e('0x29')](function(_0x136bf2){_0x4356ae[_0x0a1e('0x46')]=_0x136bf2;return _0x4356ae;});}})[_0x0a1e('0x29')](respondWithFilteredResult(_0x1e7df7,_0x43252a))[_0x0a1e('0x47')](handleError(_0x1e7df7,null));}; \ No newline at end of file +var _0x3203=['getQuestions','length','hasOwnProperty','order','pick','SessionId','JscriptyQuestionReport','includeAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','send','index','JscriptySessionReport','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','merge','filter','options','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x3203,0xac));var _0x3320=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0x3203[_0x569fef];return _0x11f20b;};'use strict';var emlformat=require(_0x3320('0x0'));var rimraf=require(_0x3320('0x1'));var zipdir=require(_0x3320('0x2'));var jsonpatch=require(_0x3320('0x3'));var rp=require(_0x3320('0x4'));var moment=require(_0x3320('0x5'));var BPromise=require(_0x3320('0x6'));var Mustache=require('mustache');var util=require(_0x3320('0x7'));var path=require(_0x3320('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3320('0x9'));var fs=require('fs');var fs_extra=require(_0x3320('0xa'));var _=require(_0x3320('0xb'));var squel=require(_0x3320('0xc'));var crypto=require('crypto');var jsforce=require(_0x3320('0xd'));var deskjs=require(_0x3320('0xe'));var toCsv=require(_0x3320('0xf'));var querystring=require(_0x3320('0x10'));var Papa=require('papaparse');var Redis=require(_0x3320('0x11'));var authService=require(_0x3320('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3320('0x13'));var hardwareService=require(_0x3320('0x14'));var logger=require(_0x3320('0x15'))('api');var utils=require(_0x3320('0x16'));var config=require(_0x3320('0x17'));var licenseUtil=require(_0x3320('0x18'));var db=require(_0x3320('0x19'))['db'];function respondWithStatusCode(_0x3fec1f,_0x80f6f7){_0x80f6f7=_0x80f6f7||0xcc;return function(_0xeee610){if(_0xeee610){return _0x3fec1f[_0x3320('0x1a')](_0x80f6f7);}return _0x3fec1f[_0x3320('0x1b')](_0x80f6f7)[_0x3320('0x1c')]();};}function respondWithResult(_0x14e170,_0x5aec3e){_0x5aec3e=_0x5aec3e||0xc8;return function(_0x35abc2){if(_0x35abc2){return _0x14e170[_0x3320('0x1b')](_0x5aec3e)[_0x3320('0x1d')](_0x35abc2);}};}function respondWithFilteredResult(_0x42cac7,_0x1bf687){return function(_0x21e723){if(_0x21e723){var _0x3a04fd=typeof _0x1bf687['offset']===_0x3320('0x1e')&&typeof _0x1bf687[_0x3320('0x1f')]===_0x3320('0x1e');var _0x8f9160=_0x21e723[_0x3320('0x20')];var _0x2612b7=_0x3a04fd?0x0:_0x1bf687[_0x3320('0x21')];var _0x328d42=_0x3a04fd?_0x21e723['count']:_0x1bf687[_0x3320('0x21')]+_0x1bf687[_0x3320('0x1f')];var _0x5c391b;if(_0x328d42>=_0x8f9160){_0x328d42=_0x8f9160;_0x5c391b=0xc8;}else{_0x5c391b=0xce;}_0x42cac7[_0x3320('0x1b')](_0x5c391b);return _0x42cac7[_0x3320('0x22')](_0x3320('0x23'),_0x2612b7+'-'+_0x328d42+'/'+_0x8f9160)[_0x3320('0x1d')](_0x21e723);}return null;};}function patchUpdates(_0x5d9cbd){return function(_0x1ed0ba){try{jsonpatch[_0x3320('0x24')](_0x1ed0ba,_0x5d9cbd,!![]);}catch(_0x46cb96){return BPromise['reject'](_0x46cb96);}return _0x1ed0ba[_0x3320('0x25')]();};}function saveUpdates(_0x7fc7c7,_0x1c99ba){return function(_0x372f02){if(_0x372f02){return _0x372f02[_0x3320('0x26')](_0x7fc7c7)[_0x3320('0x27')](function(_0x20cdf8){return _0x20cdf8;});}return null;};}function removeEntity(_0x542c26,_0xa6a8d2){return function(_0x3e5202){if(_0x3e5202){return _0x3e5202[_0x3320('0x28')]()[_0x3320('0x27')](function(){_0x542c26[_0x3320('0x1b')](0xcc)[_0x3320('0x1c')]();});}};}function handleEntityNotFound(_0x9b9601,_0x358653){return function(_0x4ee8d7){if(!_0x4ee8d7){_0x9b9601['sendStatus'](0x194);}return _0x4ee8d7;};}function handleError(_0x36b012,_0x1384fc){_0x1384fc=_0x1384fc||0x1f4;return function(_0x49da0f){logger[_0x3320('0x29')](_0x49da0f[_0x3320('0x2a')]);if(_0x49da0f['name']){delete _0x49da0f['name'];}_0x36b012[_0x3320('0x1b')](_0x1384fc)[_0x3320('0x2b')](_0x49da0f);};}exports[_0x3320('0x2c')]=function(_0x153c3b,_0x1ce566){var _0x4eb25f={},_0x16f188={},_0x3127d1={'count':0x0,'rows':[]};var _0x431574=_['map'](db[_0x3320('0x2d')]['rawAttributes'],function(_0x24d198){return{'name':_0x24d198[_0x3320('0x2e')],'type':_0x24d198[_0x3320('0x2f')]['key']};});_0x16f188[_0x3320('0x30')]=_[_0x3320('0x31')](_0x431574,_0x3320('0x32'));_0x16f188[_0x3320('0x33')]=_[_0x3320('0x34')](_0x153c3b[_0x3320('0x33')]);_0x16f188[_0x3320('0x35')]=_[_0x3320('0x36')](_0x16f188[_0x3320('0x30')],_0x16f188[_0x3320('0x33')]);_0x4eb25f[_0x3320('0x37')]=_['intersection'](_0x16f188[_0x3320('0x30')],qs['fields'](_0x153c3b[_0x3320('0x33')][_0x3320('0x38')]));_0x4eb25f[_0x3320('0x37')]=_0x4eb25f[_0x3320('0x37')]['length']?_0x4eb25f['attributes']:_0x16f188[_0x3320('0x30')];if(!_0x153c3b['query']['hasOwnProperty'](_0x3320('0x39'))){_0x4eb25f[_0x3320('0x1f')]=qs[_0x3320('0x1f')](_0x153c3b[_0x3320('0x33')][_0x3320('0x1f')]);_0x4eb25f[_0x3320('0x21')]=qs['offset'](_0x153c3b[_0x3320('0x33')][_0x3320('0x21')]);}_0x4eb25f['order']=qs[_0x3320('0x3a')](_0x153c3b[_0x3320('0x33')]['sort']);_0x4eb25f[_0x3320('0x3b')]=qs['filters'](_['pick'](_0x153c3b[_0x3320('0x33')],_0x16f188[_0x3320('0x35')]),_0x431574);if(_0x153c3b['query']['filter']){_0x4eb25f[_0x3320('0x3b')]=_[_0x3320('0x3c')](_0x4eb25f[_0x3320('0x3b')],{'$or':_['map'](_0x431574,function(_0x2a51bc){if(_0x2a51bc[_0x3320('0x2f')]!=='VIRTUAL'){var _0x2caf48={};_0x2caf48[_0x2a51bc[_0x3320('0x32')]]={'$like':'%'+_0x153c3b[_0x3320('0x33')][_0x3320('0x3d')]+'%'};return _0x2caf48;}})});}_0x4eb25f=_[_0x3320('0x3c')]({},_0x4eb25f,_0x153c3b[_0x3320('0x3e')]);var _0x5af4ff={'where':_0x4eb25f[_0x3320('0x3b')]};return db[_0x3320('0x2d')][_0x3320('0x20')](_0x5af4ff)[_0x3320('0x27')](function(_0x13d238){_0x3127d1[_0x3320('0x20')]=_0x13d238;if(_0x153c3b[_0x3320('0x33')]['includeAll']){_0x4eb25f[_0x3320('0x3f')]=[{'all':!![]}];}return db[_0x3320('0x2d')][_0x3320('0x40')](_0x4eb25f);})[_0x3320('0x27')](function(_0xd9f66b){_0x3127d1[_0x3320('0x41')]=_0xd9f66b;return _0x3127d1;})[_0x3320('0x27')](respondWithFilteredResult(_0x1ce566,_0x4eb25f))['catch'](handleError(_0x1ce566,null));};exports[_0x3320('0x42')]=function(_0x1e4fe4,_0x3642c1){var _0x487349={'raw':!![],'where':{'id':_0x1e4fe4[_0x3320('0x43')]['id']}},_0x4e7c2c={};_0x4e7c2c[_0x3320('0x30')]=_[_0x3320('0x34')](db[_0x3320('0x2d')][_0x3320('0x44')]);_0x4e7c2c[_0x3320('0x33')]=_['keys'](_0x1e4fe4['query']);_0x4e7c2c[_0x3320('0x35')]=_['intersection'](_0x4e7c2c[_0x3320('0x30')],_0x4e7c2c[_0x3320('0x33')]);_0x487349[_0x3320('0x37')]=_['intersection'](_0x4e7c2c[_0x3320('0x30')],qs[_0x3320('0x38')](_0x1e4fe4[_0x3320('0x33')][_0x3320('0x38')]));_0x487349[_0x3320('0x37')]=_0x487349[_0x3320('0x37')]['length']?_0x487349['attributes']:_0x4e7c2c[_0x3320('0x30')];if(_0x1e4fe4['query']['includeAll']){_0x487349[_0x3320('0x3f')]=[{'all':!![]}];}_0x487349=_['merge']({},_0x487349,_0x1e4fe4['options']);return db[_0x3320('0x2d')][_0x3320('0x45')](_0x487349)[_0x3320('0x27')](handleEntityNotFound(_0x3642c1,null))[_0x3320('0x27')](respondWithResult(_0x3642c1,null))[_0x3320('0x46')](handleError(_0x3642c1,null));};exports['create']=function(_0x2db56f,_0x4198d2){return db[_0x3320('0x2d')][_0x3320('0x47')](_0x2db56f[_0x3320('0x48')],{})['then'](respondWithResult(_0x4198d2,0xc9))[_0x3320('0x46')](handleError(_0x4198d2,null));};exports[_0x3320('0x26')]=function(_0xc53309,_0x24d5a9){if(_0xc53309['body']['id']){delete _0xc53309['body']['id'];}return db[_0x3320('0x2d')][_0x3320('0x45')]({'where':{'id':_0xc53309[_0x3320('0x43')]['id']}})[_0x3320('0x27')](handleEntityNotFound(_0x24d5a9,null))[_0x3320('0x27')](saveUpdates(_0xc53309[_0x3320('0x48')],null))[_0x3320('0x27')](respondWithResult(_0x24d5a9,null))[_0x3320('0x46')](handleError(_0x24d5a9,null));};exports[_0x3320('0x28')]=function(_0x13a989,_0x5a5544){return db[_0x3320('0x2d')]['find']({'where':{'id':_0x13a989[_0x3320('0x43')]['id']}})[_0x3320('0x27')](handleEntityNotFound(_0x5a5544,null))['then'](removeEntity(_0x5a5544,null))[_0x3320('0x46')](handleError(_0x5a5544,null));};exports[_0x3320('0x49')]=function(_0x2fa091,_0x27d6dd){return db[_0x3320('0x2d')][_0x3320('0x49')]()[_0x3320('0x27')](respondWithResult(_0x27d6dd,null))['catch'](handleError(_0x27d6dd,null));};exports[_0x3320('0x4a')]=function(_0x50b924,_0x23ddf4,_0x5a7a99){var _0x202867={'raw':!![],'where':{}};var _0xe61e3d={};var _0x2831a1={'count':0x0,'rows':[]};return db[_0x3320('0x2d')]['findOne']({'where':{'id':_0x50b924[_0x3320('0x43')]['id']}})[_0x3320('0x27')](handleEntityNotFound(_0x23ddf4,null))[_0x3320('0x27')](function(_0x24aad2){if(_0x24aad2){_0xe61e3d['model']=_['keys'](db['JscriptyQuestionReport'][_0x3320('0x44')]);_0xe61e3d[_0x3320('0x33')]=_[_0x3320('0x34')](_0x50b924[_0x3320('0x33')]);_0xe61e3d['filters']=_[_0x3320('0x36')](_0xe61e3d[_0x3320('0x30')],_0xe61e3d[_0x3320('0x33')]);_0x202867['attributes']=_['intersection'](_0xe61e3d[_0x3320('0x30')],qs[_0x3320('0x38')](_0x50b924[_0x3320('0x33')][_0x3320('0x38')]));_0x202867[_0x3320('0x37')]=_0x202867[_0x3320('0x37')][_0x3320('0x4b')]?_0x202867['attributes']:_0xe61e3d[_0x3320('0x30')];if(!_0x50b924['query'][_0x3320('0x4c')](_0x3320('0x39'))){_0x202867[_0x3320('0x1f')]=qs['limit'](_0x50b924[_0x3320('0x33')][_0x3320('0x1f')]);_0x202867['offset']=qs[_0x3320('0x21')](_0x50b924[_0x3320('0x33')][_0x3320('0x21')]);}_0x202867[_0x3320('0x4d')]=qs[_0x3320('0x3a')](_0x50b924[_0x3320('0x33')][_0x3320('0x3a')]);_0x202867[_0x3320('0x3b')]=qs[_0x3320('0x35')](_[_0x3320('0x4e')](_0x50b924[_0x3320('0x33')],_0xe61e3d[_0x3320('0x35')]));_0x202867[_0x3320('0x3b')][_0x3320('0x4f')]=_0x24aad2['id'];if(_0x50b924[_0x3320('0x33')][_0x3320('0x3d')]){_0x202867[_0x3320('0x3b')]=_[_0x3320('0x3c')](_0x202867[_0x3320('0x3b')],{'$or':_[_0x3320('0x31')](_0x202867[_0x3320('0x37')],function(_0x5915df){var _0x37ff2b={};_0x37ff2b[_0x5915df]={'$like':'%'+_0x50b924[_0x3320('0x33')][_0x3320('0x3d')]+'%'};return _0x37ff2b;})});}_0x202867=_[_0x3320('0x3c')]({},_0x202867,_0x50b924[_0x3320('0x3e')]);return db[_0x3320('0x50')][_0x3320('0x20')]({'where':_0x202867[_0x3320('0x3b')]})[_0x3320('0x27')](function(_0x487932){_0x2831a1[_0x3320('0x20')]=_0x487932;if(_0x50b924[_0x3320('0x33')][_0x3320('0x51')]){_0x202867['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x202867);})[_0x3320('0x27')](function(_0xcaee53){_0x2831a1[_0x3320('0x41')]=_0xcaee53;return _0x2831a1;});}})[_0x3320('0x27')](respondWithFilteredResult(_0x23ddf4,_0x202867))['catch'](handleError(_0x23ddf4,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 2db2f52..85315b1 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 _0xb4c7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2000db,_0x5d8751){_0x2000db=_0x2000db-0x0;var _0x42a6bc=_0xb4c7[_0x2000db];return _0x42a6bc;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'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/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index c4fcc07..c4c3f1b 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 _0x7ee1=['request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0xf13ca6,_0x5735ea){var _0x4a4387=function(_0x103f67){while(--_0x103f67){_0xf13ca6['push'](_0xf13ca6['shift']());}};_0x4a4387(++_0x5735ea);}(_0x7ee1,0x8d));var _0x17ee=function(_0x4a8f76,_0x5e85c0){_0x4a8f76=_0x4a8f76-0x0;var _0x489610=_0x7ee1[_0x4a8f76];return _0x489610;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17ee('0x1'));var fs=require('fs');var Redis=require(_0x17ee('0x2'));var db=require(_0x17ee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x17ee('0x4'))(_0x17ee('0x5'));var config=require(_0x17ee('0x6'));var jayson=require(_0x17ee('0x7'));var client=jayson['client'][_0x17ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b9eb,_0x54b4f6,_0x3f61af){return new BPromise(function(_0x57e1d1,_0x3d767b){return client[_0x17ee('0x9')](_0x29b9eb,_0x3f61af)[_0x17ee('0xa')](function(_0x4af369){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x54b4f6,_0x17ee('0xb'));logger['debug'](_0x17ee('0xc'),_0x54b4f6,_0x17ee('0xb'),JSON[_0x17ee('0xd')](_0x4af369));if(_0x4af369[_0x17ee('0xe')]){if(_0x4af369['error'][_0x17ee('0xf')]===0x1f4){logger['error'](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x3d767b(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x57e1d1(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x54b4f6,'request\x20sent');_0x57e1d1(_0x4af369['result'][_0x17ee('0x11')]);}})[_0x17ee('0x12')](function(_0x1b87c3){logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x1b87c3);_0x3d767b(_0x1b87c3);});});} \ No newline at end of file +var _0xe5af=['jayson/promise','client','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x78903f,_0x20fad9){var _0x461dd1=function(_0x3d7323){while(--_0x3d7323){_0x78903f['push'](_0x78903f['shift']());}};_0x461dd1(++_0x20fad9);}(_0xe5af,0x9c));var _0xfe5a=function(_0x3b6eb8,_0x3a65bc){_0x3b6eb8=_0x3b6eb8-0x0;var _0x50c029=_0xe5af[_0x3b6eb8];return _0x50c029;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index bd193f1..5444260 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 _0xceb5=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put','/:id','isAuthenticated','update','get','/download_log_file','downloadLogFile','exports','multer'];(function(_0x5e1f02,_0x3333f3){var _0xe2e013=function(_0x1e389b){while(--_0x1e389b){_0x5e1f02['push'](_0x5e1f02['shift']());}};_0xe2e013(++_0x3333f3);}(_0xceb5,0x76));var _0x5ceb=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xceb5[_0x4b91c4];return _0x25cb80;};'use strict';var multer=require(_0x5ceb('0x0'));var util=require(_0x5ceb('0x1'));var path=require(_0x5ceb('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ceb('0x3'));var router=express[_0x5ceb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ceb('0x5'));var interaction=require(_0x5ceb('0x6'));var config=require(_0x5ceb('0x7'));var controller=require('./license.controller');router['get']('/',controller[_0x5ceb('0x8')]);router[_0x5ceb('0x9')](_0x5ceb('0xa'),auth[_0x5ceb('0xb')](),controller[_0x5ceb('0xc')]);router[_0x5ceb('0xd')](_0x5ceb('0xe'),auth[_0x5ceb('0xb')](),controller[_0x5ceb('0xf')]);module[_0x5ceb('0x10')]=router; \ No newline at end of file +var _0x8762=['../../config/environment','./license.controller','get','update','isAuthenticated','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e3591,_0x3ed6d7){var _0x245a18=function(_0x167c93){while(--_0x167c93){_0x5e3591['push'](_0x5e3591['shift']());}};_0x245a18(++_0x3ed6d7);}(_0x8762,0x17f));var _0x2876=function(_0x1f0b85,_0x15d5b4){_0x1f0b85=_0x1f0b85-0x0;var _0x208800=_0x8762[_0x1f0b85];return _0x208800;};'use strict';var multer=require(_0x2876('0x0'));var util=require('util');var path=require(_0x2876('0x1'));var timeout=require(_0x2876('0x2'));var express=require(_0x2876('0x3'));var router=express['Router']();var fs_extra=require(_0x2876('0x4'));var auth=require(_0x2876('0x5'));var interaction=require(_0x2876('0x6'));var config=require(_0x2876('0x7'));var controller=require(_0x2876('0x8'));router[_0x2876('0x9')]('/',controller['index']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2876('0xa')]);router['get']('/download_log_file',auth[_0x2876('0xb')](),controller['downloadLogFile']);module[_0x2876('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 7d11231..f0e485f 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 _0x7aa4=['STRING','exports'];(function(_0xa37af5,_0x21aa07){var _0x2e8809=function(_0x2a5f11){while(--_0x2a5f11){_0xa37af5['push'](_0xa37af5['shift']());}};_0x2e8809(++_0x21aa07);}(_0x7aa4,0x1af));var _0x47aa=function(_0x2a78de,_0x596565){_0x2a78de=_0x2a78de-0x0;var _0x4cbfbf=_0x7aa4[_0x2a78de];return _0x4cbfbf;};'use strict';var Sequelize=require('sequelize');module[_0x47aa('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x47aa('0x1')]},'data2':{'type':Sequelize[_0x47aa('0x1')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xffd7=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xffd7,0x183));var _0x7ffd=function(_0x424a3b,_0x43d8e1){_0x424a3b=_0x424a3b-0x0;var _0x422638=_0xffd7[_0x424a3b];return _0x422638;};'use strict';var Sequelize=require(_0x7ffd('0x0'));module[_0x7ffd('0x1')]={'license':{'type':Sequelize[_0x7ffd('0x2')]},'data1':{'type':Sequelize[_0x7ffd('0x3')]},'data2':{'type':Sequelize[_0x7ffd('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x7ffd('0x4')],'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 7a22b09..5c45663 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 _0xe262=['rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','getLicense','catch','body','find','params','get','key','downloadLogFile','license-info.log','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format'];(function(_0x2d239f,_0x167856){var _0x1ca993=function(_0x277d5f){while(--_0x277d5f){_0x2d239f['push'](_0x2d239f['shift']());}};_0x1ca993(++_0x167856);}(_0xe262,0x1e2));var _0x2e26=function(_0x306284,_0x5ae322){_0x306284=_0x306284-0x0;var _0x568a1c=_0xe262[_0x306284];return _0x568a1c;};'use strict';var emlformat=require(_0x2e26('0x0'));var rimraf=require(_0x2e26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2e26('0x2'));var moment=require(_0x2e26('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2e26('0x4'));var util=require(_0x2e26('0x5'));var path=require(_0x2e26('0x6'));var sox=require(_0x2e26('0x7'));var csv=require(_0x2e26('0x8'));var ejs=require(_0x2e26('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2e26('0xa'));var crypto=require(_0x2e26('0xb'));var jsforce=require(_0x2e26('0xc'));var deskjs=require(_0x2e26('0xd'));var toCsv=require(_0x2e26('0x8'));var querystring=require(_0x2e26('0xe'));var Papa=require(_0x2e26('0xf'));var Redis=require('ioredis');var authService=require(_0x2e26('0x10'));var qs=require(_0x2e26('0x11'));var as=require(_0x2e26('0x12'));var hardwareService=require(_0x2e26('0x13'));var logger=require('../../config/logger')(_0x2e26('0x14'));var utils=require(_0x2e26('0x15'));var config=require(_0x2e26('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bacf0,_0x3b8f5d){_0x3b8f5d=_0x3b8f5d||0xcc;return function(_0x4d09a2){if(_0x4d09a2){return _0x1bacf0[_0x2e26('0x17')](_0x3b8f5d);}return _0x1bacf0[_0x2e26('0x18')](_0x3b8f5d)[_0x2e26('0x19')]();};}function respondWithResult(_0x4c33eb,_0x5d447d){_0x5d447d=_0x5d447d||0xc8;return function(_0x3c7fd3){if(_0x3c7fd3){return _0x4c33eb['status'](_0x5d447d)[_0x2e26('0x1a')](_0x3c7fd3);}};}function respondWithFilteredResult(_0x1f1c87,_0x13fc3b){return function(_0x1e2f71){if(_0x1e2f71){var _0x3588bd=typeof _0x13fc3b[_0x2e26('0x1b')]===_0x2e26('0x1c')&&typeof _0x13fc3b['limit']===_0x2e26('0x1c');var _0x58246d=_0x1e2f71['count'];var _0x552ba1=_0x3588bd?0x0:_0x13fc3b[_0x2e26('0x1b')];var _0xf424f4=_0x3588bd?_0x1e2f71[_0x2e26('0x1d')]:_0x13fc3b[_0x2e26('0x1b')]+_0x13fc3b[_0x2e26('0x1e')];var _0x5600ac;if(_0xf424f4>=_0x58246d){_0xf424f4=_0x58246d;_0x5600ac=0xc8;}else{_0x5600ac=0xce;}_0x1f1c87[_0x2e26('0x18')](_0x5600ac);return _0x1f1c87[_0x2e26('0x1f')]('Content-Range',_0x552ba1+'-'+_0xf424f4+'/'+_0x58246d)[_0x2e26('0x1a')](_0x1e2f71);}return null;};}function patchUpdates(_0xa2bbc8){return function(_0x43306e){try{jsonpatch[_0x2e26('0x20')](_0x43306e,_0xa2bbc8,!![]);}catch(_0x292c90){return BPromise['reject'](_0x292c90);}return _0x43306e['save']();};}function saveUpdates(_0x558b6c,_0x505628){return function(_0x4133c5){if(_0x4133c5){return _0x4133c5[_0x2e26('0x21')](_0x558b6c)[_0x2e26('0x22')](function(_0x5a9fed){return _0x5a9fed;});}return null;};}function removeEntity(_0x5ea7aa,_0x4ae75c){return function(_0x3d9ec4){if(_0x3d9ec4){return _0x3d9ec4[_0x2e26('0x23')]()['then'](function(){_0x5ea7aa[_0x2e26('0x18')](0xcc)[_0x2e26('0x19')]();});}};}function handleEntityNotFound(_0x38eff1,_0x132321){return function(_0x4e0bab){if(!_0x4e0bab){_0x38eff1[_0x2e26('0x17')](0x194);}return _0x4e0bab;};}function handleError(_0x332b27,_0x3de3b6){_0x3de3b6=_0x3de3b6||0x1f4;return function(_0x3910aa){logger[_0x2e26('0x24')](_0x3910aa[_0x2e26('0x25')]);if(_0x3910aa[_0x2e26('0x26')]){delete _0x3910aa[_0x2e26('0x26')];}_0x332b27[_0x2e26('0x18')](_0x3de3b6)[_0x2e26('0x27')](_0x3910aa);};}var utilLicense=require(_0x2e26('0x28'));exports[_0x2e26('0x29')]=function(_0x2e9f32,_0x8c468b){var _0x1d8c73={'raw':!![],'where':{'id':0x1}},_0x158e10={};_0x158e10[_0x2e26('0x2a')]=_[_0x2e26('0x2b')](db[_0x2e26('0x2c')][_0x2e26('0x2d')]);_0x158e10[_0x2e26('0x2e')]=_[_0x2e26('0x2b')](_0x2e9f32['query']);_0x158e10['filters']=_[_0x2e26('0x2f')](_0x158e10['model'],_0x158e10[_0x2e26('0x2e')]);_0x1d8c73[_0x2e26('0x30')]=_['intersection'](_0x158e10[_0x2e26('0x2a')],qs[_0x2e26('0x31')](_0x2e9f32[_0x2e26('0x2e')][_0x2e26('0x31')]));_0x1d8c73['attributes']=_0x1d8c73[_0x2e26('0x30')][_0x2e26('0x32')]?_0x1d8c73[_0x2e26('0x30')]:_0x158e10[_0x2e26('0x2a')];_0x1d8c73=_[_0x2e26('0x33')]({},_0x1d8c73,_0x2e9f32['options']);return utilLicense[_0x2e26('0x34')](_0x1d8c73)[_0x2e26('0x22')](respondWithResult(_0x8c468b,null))[_0x2e26('0x35')](handleError(_0x8c468b,null));};exports[_0x2e26('0x21')]=function(_0x4b1c6e,_0x352beb){if(_0x4b1c6e[_0x2e26('0x36')]['id']){delete _0x4b1c6e[_0x2e26('0x36')]['id'];}return db['License'][_0x2e26('0x37')]({'where':{'id':_0x4b1c6e[_0x2e26('0x38')]['id']}})[_0x2e26('0x22')](handleEntityNotFound(_0x352beb,null))[_0x2e26('0x22')](function(_0x440839){var _0x12c788=_0x440839[_0x2e26('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x12c788,_0x4b1c6e[_0x2e26('0x36')][_0x2e26('0x3a')]);})[_0x2e26('0x22')](function(_0x442a74){if(!_0x442a74['demo']){return saveUpdates(_0x4b1c6e[_0x2e26('0x36')],null);}return _0x442a74;})[_0x2e26('0x22')](respondWithResult(_0x352beb,null))[_0x2e26('0x35')](handleError(_0x352beb,null));};exports[_0x2e26('0x3b')]=function(_0x133c6e,_0x70ccfb){var _0x21aa31=_0x2e26('0x3c');var _0x3d521f=path[_0x2e26('0x3d')](_0x2e26('0x3e'),'log',_0x2e26('0x3f'),_0x21aa31);_0x70ccfb[_0x2e26('0x40')](_0x2e26('0x41'),_0x2e26('0x42')+_0x21aa31);_0x70ccfb[_0x2e26('0x1f')]('Content-Type',_0x2e26('0x43'));_0x70ccfb[_0x2e26('0x44')](_0x3d521f);}; \ No newline at end of file +var _0x3479=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','reject','save','update','destroy','error','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','getLicense','then','catch','body','find','get','demo','downloadLogFile','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','text/plain','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x383c94,_0x2c7402){var _0x149b61=function(_0x33dac0){while(--_0x33dac0){_0x383c94['push'](_0x383c94['shift']());}};_0x149b61(++_0x2c7402);}(_0x3479,0x107));var _0x9347=function(_0x2ff88b,_0x559d50){_0x2ff88b=_0x2ff88b-0x0;var _0x52bca0=_0x3479[_0x2ff88b];return _0x52bca0;};'use strict';var emlformat=require(_0x9347('0x0'));var rimraf=require(_0x9347('0x1'));var zipdir=require(_0x9347('0x2'));var jsonpatch=require(_0x9347('0x3'));var rp=require(_0x9347('0x4'));var moment=require(_0x9347('0x5'));var BPromise=require(_0x9347('0x6'));var Mustache=require(_0x9347('0x7'));var util=require(_0x9347('0x8'));var path=require('path');var sox=require(_0x9347('0x9'));var csv=require(_0x9347('0xa'));var ejs=require(_0x9347('0xb'));var fs=require('fs');var fs_extra=require(_0x9347('0xc'));var _=require(_0x9347('0xd'));var squel=require(_0x9347('0xe'));var crypto=require('crypto');var jsforce=require(_0x9347('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9347('0xa'));var querystring=require(_0x9347('0x10'));var Papa=require(_0x9347('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9347('0x12'));var as=require(_0x9347('0x13'));var hardwareService=require(_0x9347('0x14'));var logger=require('../../config/logger')(_0x9347('0x15'));var utils=require(_0x9347('0x16'));var config=require(_0x9347('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9347('0x18'))['db'];function respondWithStatusCode(_0x869bca,_0x130577){_0x130577=_0x130577||0xcc;return function(_0x7cffdc){if(_0x7cffdc){return _0x869bca[_0x9347('0x19')](_0x130577);}return _0x869bca[_0x9347('0x1a')](_0x130577)[_0x9347('0x1b')]();};}function respondWithResult(_0x1428f4,_0x61226c){_0x61226c=_0x61226c||0xc8;return function(_0x347d47){if(_0x347d47){return _0x1428f4[_0x9347('0x1a')](_0x61226c)[_0x9347('0x1c')](_0x347d47);}};}function respondWithFilteredResult(_0x1e070d,_0x4a9a40){return function(_0x510546){if(_0x510546){var _0x537dda=typeof _0x4a9a40['offset']==='undefined'&&typeof _0x4a9a40[_0x9347('0x1d')]===_0x9347('0x1e');var _0x2a405e=_0x510546[_0x9347('0x1f')];var _0x3bcb8b=_0x537dda?0x0:_0x4a9a40['offset'];var _0x38d3b3=_0x537dda?_0x510546[_0x9347('0x1f')]:_0x4a9a40[_0x9347('0x20')]+_0x4a9a40[_0x9347('0x1d')];var _0x19871a;if(_0x38d3b3>=_0x2a405e){_0x38d3b3=_0x2a405e;_0x19871a=0xc8;}else{_0x19871a=0xce;}_0x1e070d[_0x9347('0x1a')](_0x19871a);return _0x1e070d[_0x9347('0x21')]('Content-Range',_0x3bcb8b+'-'+_0x38d3b3+'/'+_0x2a405e)[_0x9347('0x1c')](_0x510546);}return null;};}function patchUpdates(_0x14b7ad){return function(_0x209970){try{jsonpatch['apply'](_0x209970,_0x14b7ad,!![]);}catch(_0xb63cfe){return BPromise[_0x9347('0x22')](_0xb63cfe);}return _0x209970[_0x9347('0x23')]();};}function saveUpdates(_0x378f01,_0x2ff28d){return function(_0x4e4b50){if(_0x4e4b50){return _0x4e4b50[_0x9347('0x24')](_0x378f01)['then'](function(_0x391a0e){return _0x391a0e;});}return null;};}function removeEntity(_0x28902c,_0x1797b6){return function(_0x493caa){if(_0x493caa){return _0x493caa[_0x9347('0x25')]()['then'](function(){_0x28902c[_0x9347('0x1a')](0xcc)[_0x9347('0x1b')]();});}};}function handleEntityNotFound(_0x165a8a,_0x4f367d){return function(_0x3cbfcf){if(!_0x3cbfcf){_0x165a8a[_0x9347('0x19')](0x194);}return _0x3cbfcf;};}function handleError(_0x105a43,_0x99c532){_0x99c532=_0x99c532||0x1f4;return function(_0x38917d){logger[_0x9347('0x26')](_0x38917d[_0x9347('0x27')]);if(_0x38917d[_0x9347('0x28')]){delete _0x38917d[_0x9347('0x28')];}_0x105a43['status'](_0x99c532)[_0x9347('0x29')](_0x38917d);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x2331fa,_0x57787e){var _0x5926bf={'raw':!![],'where':{'id':0x1}},_0x5ec021={};_0x5ec021[_0x9347('0x2a')]=_[_0x9347('0x2b')](db['License'][_0x9347('0x2c')]);_0x5ec021['query']=_['keys'](_0x2331fa[_0x9347('0x2d')]);_0x5ec021[_0x9347('0x2e')]=_[_0x9347('0x2f')](_0x5ec021[_0x9347('0x2a')],_0x5ec021[_0x9347('0x2d')]);_0x5926bf[_0x9347('0x30')]=_[_0x9347('0x2f')](_0x5ec021[_0x9347('0x2a')],qs[_0x9347('0x31')](_0x2331fa['query'][_0x9347('0x31')]));_0x5926bf[_0x9347('0x30')]=_0x5926bf[_0x9347('0x30')][_0x9347('0x32')]?_0x5926bf[_0x9347('0x30')]:_0x5ec021[_0x9347('0x2a')];_0x5926bf=_[_0x9347('0x33')]({},_0x5926bf,_0x2331fa['options']);return utilLicense[_0x9347('0x34')](_0x5926bf)[_0x9347('0x35')](respondWithResult(_0x57787e,null))[_0x9347('0x36')](handleError(_0x57787e,null));};exports['update']=function(_0xdb5ddd,_0x482e39){if(_0xdb5ddd[_0x9347('0x37')]['id']){delete _0xdb5ddd[_0x9347('0x37')]['id'];}return db['License'][_0x9347('0x38')]({'where':{'id':_0xdb5ddd['params']['id']}})['then'](handleEntityNotFound(_0x482e39,null))[_0x9347('0x35')](function(_0x9a583b){var _0x10dd6c=_0x9a583b[_0x9347('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x10dd6c,_0xdb5ddd[_0x9347('0x37')]['key']);})[_0x9347('0x35')](function(_0x3c5983){if(!_0x3c5983[_0x9347('0x3a')]){return saveUpdates(_0xdb5ddd[_0x9347('0x37')],null);}return _0x3c5983;})[_0x9347('0x35')](respondWithResult(_0x482e39,null))['catch'](handleError(_0x482e39,null));};exports[_0x9347('0x3b')]=function(_0x205674,_0x3aec57){var _0x1124f0='license-info.log';var _0x2930e6=path[_0x9347('0x3c')](_0x9347('0x3d'),_0x9347('0x3e'),'xcally',_0x1124f0);_0x3aec57[_0x9347('0x3f')](_0x9347('0x40'),_0x9347('0x41')+_0x1124f0);_0x3aec57['set']('Content-Type',_0x9347('0x42'));_0x3aec57['download'](_0x2930e6);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 32fea20..ddc33ab 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 _0x54ea=['../../config/logger','api','moment','path','../../config/environment','exports','License','license','lodash','util'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x54ea,0x80));var _0xa54e=function(_0x3d63f6,_0x8cd7e4){_0x3d63f6=_0x3d63f6-0x0;var _0x2ac67b=_0x54ea[_0x3d63f6];return _0x2ac67b;};'use strict';var _=require(_0xa54e('0x0'));var util=require(_0xa54e('0x1'));var logger=require(_0xa54e('0x2'))(_0xa54e('0x3'));var moment=require(_0xa54e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa54e('0x5'));var rimraf=require('rimraf');var config=require(_0xa54e('0x6'));var attributes=require('./license.attributes');module[_0xa54e('0x7')]=function(_0x5b9624,_0x1af5ed){return _0x5b9624['define'](_0xa54e('0x8'),attributes,{'tableName':_0xa54e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe086=['rimraf','../../config/environment','./license.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11e41a,_0x509edd){var _0x498bc3=function(_0xd092aa){while(--_0xd092aa){_0x11e41a['push'](_0x11e41a['shift']());}};_0x498bc3(++_0x509edd);}(_0xe086,0x14a));var _0x6e08=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe086[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6e08('0x0'));var util=require(_0x6e08('0x1'));var logger=require(_0x6e08('0x2'))(_0x6e08('0x3'));var moment=require(_0x6e08('0x4'));var BPromise=require(_0x6e08('0x5'));var rp=require(_0x6e08('0x6'));var fs=require('fs');var path=require(_0x6e08('0x7'));var rimraf=require(_0x6e08('0x8'));var config=require(_0x6e08('0x9'));var attributes=require(_0x6e08('0xa'));module[_0x6e08('0xb')]=function(_0x5bae7d,_0x11dcb5){return _0x5bae7d[_0x6e08('0xc')]('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 5f7367b..5fee5e9 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 _0xd687=['result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','License,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x17257b,_0x5c1043){var _0x348b3f=function(_0x136ca4){while(--_0x136ca4){_0x17257b['push'](_0x17257b['shift']());}};_0x348b3f(++_0x5c1043);}(_0xd687,0x156));var _0x7d68=function(_0x1f5ab3,_0x2d2473){_0x1f5ab3=_0x1f5ab3-0x0;var _0x2bd0d7=_0xd687[_0x1f5ab3];return _0x2bd0d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7d68('0x0'));var BPromise=require('bluebird');var rs=require(_0x7d68('0x1'));var fs=require('fs');var Redis=require(_0x7d68('0x2'));var db=require(_0x7d68('0x3'))['db'];var utils=require(_0x7d68('0x4'));var logger=require('../../config/logger')(_0x7d68('0x5'));var config=require(_0x7d68('0x6'));var jayson=require(_0x7d68('0x7'));var client=jayson['client'][_0x7d68('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x65feb7,_0x32ef22,_0x3f745d){return new BPromise(function(_0x561316,_0x201700){return client['request'](_0x65feb7,_0x3f745d)[_0x7d68('0x9')](function(_0x5c6905){logger[_0x7d68('0xa')](_0x7d68('0xb'),_0x32ef22,'request\x20sent');logger[_0x7d68('0xc')]('License,\x20%s,\x20%s,\x20%s',_0x32ef22,_0x7d68('0xd'),JSON[_0x7d68('0xe')](_0x5c6905));if(_0x5c6905[_0x7d68('0xf')]){if(_0x5c6905['error'][_0x7d68('0x10')]===0x1f4){logger[_0x7d68('0xf')](_0x7d68('0xb'),_0x32ef22,_0x5c6905['error'][_0x7d68('0x11')]);return _0x201700(_0x5c6905[_0x7d68('0xf')][_0x7d68('0x11')]);}logger[_0x7d68('0xf')](_0x7d68('0xb'),_0x32ef22,_0x5c6905[_0x7d68('0xf')][_0x7d68('0x11')]);return _0x561316(_0x5c6905[_0x7d68('0xf')]['message']);}else{logger[_0x7d68('0xa')]('License,\x20%s,\x20%s',_0x32ef22,_0x7d68('0xd'));_0x561316(_0x5c6905[_0x7d68('0x12')]['message']);}})[_0x7d68('0x13')](function(_0x351f3d){logger[_0x7d68('0xf')]('License,\x20%s,\x20%s',_0x32ef22,_0x351f3d);_0x201700(_0x351f3d);});});} \ No newline at end of file +var _0x275d=['http','request','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x45b518,_0x23faa8){var _0x45c6b6=function(_0xb0deef){while(--_0xb0deef){_0x45b518['push'](_0x45b518['shift']());}};_0x45c6b6(++_0x23faa8);}(_0x275d,0x124));var _0xd275=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x275d[_0x58c20f];return _0x3b0318;};'use strict';var _=require(_0xd275('0x0'));var util=require('util');var moment=require(_0xd275('0x1'));var BPromise=require('bluebird');var rs=require(_0xd275('0x2'));var fs=require('fs');var Redis=require(_0xd275('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd275('0x4'));var logger=require(_0xd275('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd275('0x6'));var client=jayson[_0xd275('0x7')][_0xd275('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x219c40,_0x446baa,_0x46b26a){return new BPromise(function(_0x267f4d,_0xca6445){return client[_0xd275('0x9')](_0x219c40,_0x46b26a)['then'](function(_0x1fbd6e){logger[_0xd275('0xa')]('License,\x20%s,\x20%s',_0x446baa,_0xd275('0xb'));logger[_0xd275('0xc')](_0xd275('0xd'),_0x446baa,_0xd275('0xb'),JSON[_0xd275('0xe')](_0x1fbd6e));if(_0x1fbd6e['error']){if(_0x1fbd6e[_0xd275('0xf')]['code']===0x1f4){logger[_0xd275('0xf')](_0xd275('0x10'),_0x446baa,_0x1fbd6e['error'][_0xd275('0x11')]);return _0xca6445(_0x1fbd6e[_0xd275('0xf')][_0xd275('0x11')]);}logger['error'](_0xd275('0x10'),_0x446baa,_0x1fbd6e[_0xd275('0xf')]['message']);return _0x267f4d(_0x1fbd6e['error'][_0xd275('0x11')]);}else{logger['info']('License,\x20%s,\x20%s',_0x446baa,_0xd275('0xb'));_0x267f4d(_0x1fbd6e[_0xd275('0x12')]['message']);}})[_0xd275('0x13')](function(_0x138464){logger[_0xd275('0xf')](_0xd275('0x10'),_0x446baa,_0x138464);_0xca6445(_0x138464);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 3757c40..d6edb1a 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 _0xe7b8=['addApplications','/:id/send','send','addAgents','put','delete','removeAnswers','removeSmtp','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','getInteractions','getApplications','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','/:id/applications'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xe7b8,0xb6));var _0x8e7b=function(_0x32a7b8,_0x120934){_0x32a7b8=_0x32a7b8-0x0;var _0x5310bd=_0xe7b8[_0x32a7b8];return _0x5310bd;};'use strict';var multer=require(_0x8e7b('0x0'));var util=require(_0x8e7b('0x1'));var path=require(_0x8e7b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8e7b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8e7b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8e7b('0x5'));var controller=require(_0x8e7b('0x6'));router[_0x8e7b('0x7')]('/',auth[_0x8e7b('0x8')](),controller['index']);router[_0x8e7b('0x7')]('/describe',auth[_0x8e7b('0x8')](),controller['describe']);router[_0x8e7b('0x7')](_0x8e7b('0x9'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0xa')]);router['get'](_0x8e7b('0xb'),auth['isAuthenticated'](),controller[_0x8e7b('0xc')]);router[_0x8e7b('0x7')](_0x8e7b('0xd'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0xe')]);router[_0x8e7b('0x7')](_0x8e7b('0xf'),auth[_0x8e7b('0x8')](),controller['getImap']);router[_0x8e7b('0x7')](_0x8e7b('0x10'),auth['isAuthenticated'](),controller[_0x8e7b('0x11')]);router[_0x8e7b('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x8e7b('0x12')]);router[_0x8e7b('0x7')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8e7b('0x13')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x8e7b('0x14')]);router[_0x8e7b('0x7')](_0x8e7b('0x15'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x16')]);router[_0x8e7b('0x7')](_0x8e7b('0x17'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x18')]);router['post'](_0x8e7b('0xb'),auth[_0x8e7b('0x8')](),controller['addDisposition']);router[_0x8e7b('0x19')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8e7b('0x1a')]);router[_0x8e7b('0x19')]('/',auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x1b')]);router[_0x8e7b('0x19')](_0x8e7b('0xf'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x1c')]);router['post'](_0x8e7b('0x10'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x1d')]);router['post'](_0x8e7b('0x1e'),auth['isAuthenticated'](),controller[_0x8e7b('0x1f')]);router[_0x8e7b('0x19')](_0x8e7b('0x20'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x21')]);router[_0x8e7b('0x19')](_0x8e7b('0x22'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x23')]);router[_0x8e7b('0x19')]('/:id/users',auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x24')]);router[_0x8e7b('0x25')](_0x8e7b('0x9'),auth[_0x8e7b('0x8')](),controller['update']);router[_0x8e7b('0x26')](_0x8e7b('0xb'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x27')]);router[_0x8e7b('0x26')](_0x8e7b('0xf'),auth['isAuthenticated'](),controller['removeImap']);router[_0x8e7b('0x26')](_0x8e7b('0x10'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x28')]);router[_0x8e7b('0x26')]('/:id',auth[_0x8e7b('0x8')](),controller['destroy']);router[_0x8e7b('0x26')](_0x8e7b('0x17'),auth[_0x8e7b('0x8')](),controller[_0x8e7b('0x29')]);module[_0x8e7b('0x2a')]=router; \ No newline at end of file +var _0xe22d=['addApplications','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe22d,0x1ce));var _0xde22=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe22d[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xde22('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xde22('0x1'));var express=require(_0xde22('0x2'));var router=express[_0xde22('0x3')]();var fs_extra=require(_0xde22('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xde22('0x5'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0xde22('0x6')]('/',auth[_0xde22('0x7')](),controller['index']);router[_0xde22('0x6')](_0xde22('0x8'),auth[_0xde22('0x7')](),controller['describe']);router['get'](_0xde22('0x9'),auth[_0xde22('0x7')](),controller[_0xde22('0xa')]);router[_0xde22('0x6')](_0xde22('0xb'),auth[_0xde22('0x7')](),controller['getDispositions']);router[_0xde22('0x6')](_0xde22('0xc'),auth['isAuthenticated'](),controller[_0xde22('0xd')]);router[_0xde22('0x6')](_0xde22('0xe'),auth[_0xde22('0x7')](),controller[_0xde22('0xf')]);router[_0xde22('0x6')]('/:id/out_servers',auth[_0xde22('0x7')](),controller[_0xde22('0x10')]);router[_0xde22('0x6')](_0xde22('0x11'),auth[_0xde22('0x7')](),controller[_0xde22('0x12')]);router[_0xde22('0x6')](_0xde22('0x13'),auth[_0xde22('0x7')](),controller[_0xde22('0x14')]);router[_0xde22('0x6')]('/:id/messages',auth[_0xde22('0x7')](),controller[_0xde22('0x15')]);router[_0xde22('0x6')]('/:id/verify',auth[_0xde22('0x7')](),controller[_0xde22('0x16')]);router[_0xde22('0x6')](_0xde22('0x17'),auth['isAuthenticated'](),controller[_0xde22('0x18')]);router[_0xde22('0x19')]('/:id/dispositions',auth[_0xde22('0x7')](),controller[_0xde22('0x1a')]);router['post'](_0xde22('0xc'),auth[_0xde22('0x7')](),controller[_0xde22('0x1b')]);router[_0xde22('0x19')]('/',auth['isAuthenticated'](),controller[_0xde22('0x1c')]);router[_0xde22('0x19')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xde22('0x1d')]);router[_0xde22('0x19')](_0xde22('0x1e'),auth[_0xde22('0x7')](),controller[_0xde22('0x1f')]);router[_0xde22('0x19')](_0xde22('0x11'),auth[_0xde22('0x7')](),controller[_0xde22('0x20')]);router[_0xde22('0x19')](_0xde22('0x13'),auth['isAuthenticated'](),controller[_0xde22('0x21')]);router[_0xde22('0x19')](_0xde22('0x22'),auth[_0xde22('0x7')](),controller[_0xde22('0x23')]);router[_0xde22('0x19')](_0xde22('0x17'),auth[_0xde22('0x7')](),controller['addAgents']);router[_0xde22('0x24')](_0xde22('0x9'),auth[_0xde22('0x7')](),controller[_0xde22('0x25')]);router[_0xde22('0x26')]('/:id/dispositions',auth[_0xde22('0x7')](),controller[_0xde22('0x27')]);router['delete'](_0xde22('0xc'),auth[_0xde22('0x7')](),controller[_0xde22('0x28')]);router[_0xde22('0x26')](_0xde22('0xe'),auth[_0xde22('0x7')](),controller[_0xde22('0x29')]);router[_0xde22('0x26')](_0xde22('0x1e'),auth[_0xde22('0x7')](),controller[_0xde22('0x2a')]);router[_0xde22('0x26')](_0xde22('0x9'),auth[_0xde22('0x7')](),controller['destroy']);router[_0xde22('0x26')]('/:id/users',auth[_0xde22('0x7')](),controller[_0xde22('0x2b')]);module[_0xde22('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 8c88656..7d0f3e6 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 _0xdc43=['mandatoryDisposition','ENUM','gmail','yahoo','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','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','setDataValue','mandatoryDispositionPauseId'];(function(_0x5cc0a5,_0x5d1c1a){var _0x1818cf=function(_0x337065){while(--_0x337065){_0x5cc0a5['push'](_0x5cc0a5['shift']());}};_0x1818cf(++_0x5d1c1a);}(_0xdc43,0x1db));var _0x3dc4=function(_0x4d8381,_0x341897){_0x4d8381=_0x4d8381-0x0;var _0x2576cc=_0xdc43[_0x4d8381];return _0x2576cc;};'use strict';var Sequelize=require(_0x3dc4('0x0'));module[_0x3dc4('0x1')]={'description':{'type':Sequelize[_0x3dc4('0x2')]},'name':{'type':Sequelize[_0x3dc4('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x3dc4('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3dc4('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x3dc4('0x4')]},'markAsUnread':{'type':Sequelize[_0x3dc4('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3dc4('0x2')],'allowNull':![],'defaultValue':_0x3dc4('0x5')},'fontSize':{'type':Sequelize[_0x3dc4('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3dc4('0x4')],'defaultValue':function(){return _0x3dc4('0x7');}},'notificationSound':{'type':Sequelize[_0x3dc4('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3dc4('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3dc4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3dc4('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3dc4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3dc4('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3dc4('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x3dc4('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x3dc4('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x517349){if(!_0x517349)this[_0x3dc4('0x9')](_0x3dc4('0xa'),null);this[_0x3dc4('0x9')](_0x3dc4('0xb'),_0x517349);}},'provider':{'type':Sequelize[_0x3dc4('0xc')](_0x3dc4('0xd'),'hotmail',_0x3dc4('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x3dc4('0xf')](_0x3dc4('0x10')))return _0x3dc4('0x11');return this['getDataValue'](_0x3dc4('0x10'));},'set':function(_0x4f8026){if(_0x4f8026===_0x3dc4('0x11'))_0x4f8026=null;return this[_0x3dc4('0x9')](_0x3dc4('0x10'),_0x4f8026);}}}; \ No newline at end of file +var _0xb795=['yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','TEXT','BOOLEAN','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail'];(function(_0x45c957,_0x1762a2){var _0x455a3b=function(_0x56a531){while(--_0x56a531){_0x45c957['push'](_0x45c957['shift']());}};_0x455a3b(++_0x1762a2);}(_0xb795,0x91));var _0x5b79=function(_0x51057a,_0x2c8c27){_0x51057a=_0x51057a-0x0;var _0x3cbdaa=_0xb795[_0x51057a];return _0x3cbdaa;};'use strict';var Sequelize=require(_0x5b79('0x0'));module[_0x5b79('0x1')]={'description':{'type':Sequelize[_0x5b79('0x2')]},'name':{'type':Sequelize[_0x5b79('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x5b79('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x5b79('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x5b79('0x3')]},'markAsUnread':{'type':Sequelize[_0x5b79('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5b79('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5b79('0x5')](0x2)[_0x5b79('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5b79('0x3')],'defaultValue':function(){return _0x5b79('0x7');}},'notificationSound':{'type':Sequelize[_0x5b79('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5b79('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5b79('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5b79('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b79('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x5b79('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x5b79('0x4')],'defaultValue':![],'comment':_0x5b79('0x9'),'set':function(_0xd6d06d){if(!_0xd6d06d)this['setDataValue'](_0x5b79('0xa'),null);this['setDataValue'](_0x5b79('0xb'),_0xd6d06d);}},'provider':{'type':Sequelize[_0x5b79('0xc')](_0x5b79('0xd'),_0x5b79('0xe'),_0x5b79('0xf'),_0x5b79('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return'custom';return this[_0x5b79('0x11')](_0x5b79('0x12'));},'set':function(_0xcd673f){if(_0xcd673f===_0x5b79('0x13'))_0xcd673f=null;return this['setDataValue'](_0x5b79('0x12'),_0xcd673f);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 8f01630..ce0434d 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 _0x37e5=['find','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','findOne','hasOwnProperty','removeDispositions','ids','CannedAnswer','getAnswers','order','removeAnswers','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','Contacts','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','List','defaults','messageId','subject','attach','out','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','get','MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','secure','service','authentication','port','Imap','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','MailServerIn','MailServerOut','keys','intersection','length','include','update','body','provider','custom'];(function(_0x4383e9,_0xa4b307){var _0x355405=function(_0x545b5b){while(--_0x545b5b){_0x4383e9['push'](_0x4383e9['shift']());}};_0x355405(++_0xa4b307);}(_0x37e5,0x124));var _0x537e=function(_0x4bfedd,_0xddfbf8){_0x4bfedd=_0x4bfedd-0x0;var _0x2e925c=_0x37e5[_0x4bfedd];return _0x2e925c;};'use strict';var moment=require(_0x537e('0x0'));var BPromise=require(_0x537e('0x1'));var util=require(_0x537e('0x2'));var path=require(_0x537e('0x3'));var _=require(_0x537e('0x4'));var juice=require(_0x537e('0x5'));var Redis=require('ioredis');var qs=require(_0x537e('0x6'));var logger=require('../../config/logger')(_0x537e('0x7'));var config=require(_0x537e('0x8'));var db=require(_0x537e('0x9'))['db'];config[_0x537e('0xa')]=_['defaults'](config[_0x537e('0xa')],{'host':_0x537e('0xb'),'port':0x18eb});var socket=require(_0x537e('0xc'))(new Redis(config[_0x537e('0xa')]));require(_0x537e('0xd'))[_0x537e('0xe')](socket);var jayson=require(_0x537e('0xf'));var client=jayson[_0x537e('0x10')][_0x537e('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x441852,_0x2d0a02,_0x146429,_0x443ea4){return new BPromise(function(_0x3c8591,_0x2be06c){var _0x345fc0=_0x443ea4||client;return _0x345fc0[_0x537e('0x12')](_0x441852,_0x146429)[_0x537e('0x13')](function(_0x56074a){logger[_0x537e('0x14')]('MailAccount,\x20%s,\x20%s',_0x2d0a02,_0x537e('0x15'));logger[_0x537e('0x16')](_0x537e('0x17'),_0x2d0a02,_0x537e('0x15'),JSON[_0x537e('0x18')](_0x56074a));if(_0x56074a[_0x537e('0x19')]){if(_0x56074a[_0x537e('0x19')][_0x537e('0x1a')]===0x1f4){logger[_0x537e('0x19')](_0x537e('0x1b'),_0x2d0a02,_0x56074a[_0x537e('0x19')][_0x537e('0x1c')]);return _0x2be06c(_0x56074a[_0x537e('0x19')][_0x537e('0x1c')]);}logger[_0x537e('0x19')](_0x537e('0x1b'),_0x2d0a02,_0x56074a[_0x537e('0x19')][_0x537e('0x1c')]);return _0x3c8591(_0x56074a[_0x537e('0x19')][_0x537e('0x1c')]);}else{logger[_0x537e('0x14')](_0x537e('0x1b'),_0x2d0a02,_0x537e('0x15'));_0x3c8591(_0x56074a[_0x537e('0x1d')][_0x537e('0x1c')]);}})['catch'](function(_0xd49137){logger[_0x537e('0x19')]('MailAccount,\x20%s,\x20%s',_0x2d0a02,_0xd49137);_0x2be06c(_0xd49137);});});}function respondWithStatusCode(_0x9e561f,_0x2d5513){_0x2d5513=_0x2d5513||0xcc;return function(_0x3fe5be){if(_0x3fe5be){return _0x9e561f[_0x537e('0x1e')](_0x2d5513);}return _0x9e561f['status'](_0x2d5513)['end']();};}function respondWithResult(_0x5e2d40,_0x233b51){_0x233b51=_0x233b51||0xc8;return function(_0x3085f7){if(_0x3085f7){return _0x5e2d40[_0x537e('0x1f')](_0x233b51)['json'](_0x3085f7);}};}function respondWithFilteredResult(_0x93a7a9,_0x5d0410){return function(_0x3f9a9b){if(_0x3f9a9b){var _0x387c3f=typeof _0x5d0410[_0x537e('0x20')]===_0x537e('0x21')&&typeof _0x5d0410[_0x537e('0x22')]===_0x537e('0x21');var _0x186d1d=_0x3f9a9b[_0x537e('0x23')];var _0x42a888=_0x387c3f?0x0:_0x5d0410[_0x537e('0x20')];var _0x2bd745=_0x387c3f?_0x3f9a9b['count']:_0x5d0410[_0x537e('0x20')]+_0x5d0410[_0x537e('0x22')];var _0x315893;if(_0x2bd745>=_0x186d1d){_0x2bd745=_0x186d1d;_0x315893=0xc8;}else{_0x315893=0xce;}_0x93a7a9[_0x537e('0x1f')](_0x315893);return _0x93a7a9[_0x537e('0x24')](_0x537e('0x25'),_0x42a888+'-'+_0x2bd745+'/'+_0x186d1d)[_0x537e('0x26')](_0x3f9a9b);}return null;};}function saveUpdates(_0x38d119){return function(_0x4c77af){if(_0x4c77af){return _0x4c77af['update'](_0x38d119)[_0x537e('0x13')](function(_0x5a3961){return _0x5a3961;});}return null;};}function removeEntity(_0xabab59){return function(_0x2299f1){if(_0x2299f1){return _0x2299f1['destroy']()['then'](function(){var _0x22c5a5=_0x2299f1[_0x537e('0x27')]({'plain':!![]});var _0x3e7894=_0x537e('0x28');return db[_0x537e('0x29')][_0x537e('0x2a')]({'where':{'type':_0x3e7894,'resourceId':_0x22c5a5['id']}})[_0x537e('0x13')](function(){return _0x2299f1;});})[_0x537e('0x13')](function(){_0xabab59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26e2c1){return function(_0xf812c8){if(!_0xf812c8){_0x26e2c1[_0x537e('0x1e')](0x194);}return _0xf812c8;};}function handleError(_0x3aea3b,_0x30d8ce){_0x30d8ce=_0x30d8ce||0x1f4;return function(_0x2ef933){logger[_0x537e('0x19')](_0x2ef933[_0x537e('0x2b')]);if(_0x2ef933[_0x537e('0x2c')]){delete _0x2ef933[_0x537e('0x2c')];}_0x3aea3b[_0x537e('0x1f')](_0x30d8ce)[_0x537e('0x2d')](_0x2ef933);};}function getImapHost(_0x46d50b){switch(_0x46d50b){case _0x537e('0x2e'):return _0x537e('0x2f');case _0x537e('0x30'):return _0x537e('0x31');case _0x537e('0x32'):return _0x537e('0x33');case'outlook365':return _0x537e('0x34');}throw new Error(_0x537e('0x35'),_0x46d50b);}function getSmtpHost(_0x4fe838){switch(_0x4fe838){case'gmail':return'smtp.gmail.com';case _0x537e('0x30'):return _0x537e('0x36');case _0x537e('0x32'):return _0x537e('0x37');case _0x537e('0x38'):return _0x537e('0x39');}throw new Error(_0x537e('0x35'),_0x4fe838);}function getAuthenticationOptions(_0xa3c821,_0x4474ae){var _0x4f281f={};var _0x1838dd={};if(_0xa3c821){_0x4f281f[_0x537e('0x3a')]=_0x1838dd[_0x537e('0x3a')]=_0x4474ae[_0x537e('0x3b')];_0x4f281f[_0x537e('0x3c')]=_0x1838dd['pass']=_0x4474ae['password'];if(_0x4474ae[_0x537e('0x3d')]){_0x4f281f[_0x537e('0x3d')]=_0x1838dd['modernAuthentication']=!![];_0x4f281f['CloudProviderId']=_0x1838dd['CloudProviderId']=_0x4474ae[_0x537e('0x3e')];_0x4f281f[_0x537e('0x3c')]=_0x1838dd[_0x537e('0x3f')]=null;}else{_0x4f281f[_0x537e('0x3e')]=_0x1838dd[_0x537e('0x3e')]=null;}_0x4f281f[_0x537e('0x40')]=getImapHost(_0xa3c821);_0x4f281f['port']=0x3e1;_0x1838dd[_0x537e('0x40')]=getSmtpHost(_0xa3c821);_0x1838dd['port']=0x24b;_0x1838dd[_0x537e('0x41')]=![];_0x4f281f[_0x537e('0x42')]=_0x1838dd[_0x537e('0x42')]=null;}else{if(_0x4474ae[_0x537e('0x43')]){_0x4f281f['user']=_0x1838dd['user']=_0x4474ae[_0x537e('0x3b')];_0x4f281f['password']=_0x1838dd[_0x537e('0x3f')]=_0x4474ae[_0x537e('0x3c')];}else{_0x4f281f[_0x537e('0x43')]=_0x1838dd[_0x537e('0x43')]=![];_0x4f281f[_0x537e('0x3a')]=_0x1838dd['user']=null;_0x4f281f[_0x537e('0x3c')]=_0x1838dd[_0x537e('0x3f')]=null;}_0x4f281f[_0x537e('0x40')]=_0x4474ae['Imap']['host'];_0x4f281f[_0x537e('0x44')]=_0x4474ae[_0x537e('0x45')][_0x537e('0x44')];_0x1838dd[_0x537e('0x40')]=_0x4474ae[_0x537e('0x46')]['host'];_0x1838dd[_0x537e('0x44')]=_0x4474ae['Smtp']['port'];}return{'Imap':_0x4f281f,'Smtp':_0x1838dd};}exports['index']=function(_0x32c059,_0xe64c0c){var _0x5ea469={'include':[{'model':db['MailServerIn'],'as':_0x537e('0x45')},{'model':db['MailServerOut'],'as':_0x537e('0x46')},{'model':db[_0x537e('0x47')],'as':_0x537e('0x48')}]},_0x47a0d5={},_0x53120d={'count':0x0,'rows':[]};var _0x78b228=_[_0x537e('0x49')](db[_0x537e('0x4a')][_0x537e('0x4b')],function(_0x3f98fd){return{'name':_0x3f98fd[_0x537e('0x4c')],'type':_0x3f98fd[_0x537e('0x4d')][_0x537e('0x4e')]};});_0x47a0d5[_0x537e('0x4f')]=_[_0x537e('0x49')](_0x78b228,'name');_0x47a0d5['query']=_['keys'](_0x32c059[_0x537e('0x50')]);_0x47a0d5[_0x537e('0x51')]=_['intersection'](_0x47a0d5['model'],_0x47a0d5[_0x537e('0x50')]);_0x5ea469[_0x537e('0x52')]=_['intersection'](_0x47a0d5[_0x537e('0x4f')],qs[_0x537e('0x53')](_0x32c059[_0x537e('0x50')][_0x537e('0x53')]));_0x5ea469['attributes']=_0x5ea469['attributes']['length']?_0x5ea469[_0x537e('0x52')]:_0x47a0d5['model'];if(!_0x32c059[_0x537e('0x50')]['hasOwnProperty'](_0x537e('0x54'))){_0x5ea469['limit']=qs[_0x537e('0x22')](_0x32c059[_0x537e('0x50')][_0x537e('0x22')]);_0x5ea469['offset']=qs[_0x537e('0x20')](_0x32c059[_0x537e('0x50')]['offset']);}_0x5ea469['order']=qs[_0x537e('0x55')](_0x32c059['query'][_0x537e('0x55')]);_0x5ea469[_0x537e('0x56')]=qs[_0x537e('0x51')](_[_0x537e('0x57')](_0x32c059[_0x537e('0x50')],_0x47a0d5[_0x537e('0x51')]),_0x78b228);if(_0x32c059[_0x537e('0x50')][_0x537e('0x58')]){_0x5ea469['where']=_[_0x537e('0x59')](_0x5ea469[_0x537e('0x56')],{'$or':_['map'](_0x78b228,function(_0x352708){if(_0x352708[_0x537e('0x4d')]!==_0x537e('0x5a')){var _0x544bd9={};_0x544bd9[_0x352708[_0x537e('0x2c')]]={'$like':'%'+_0x32c059[_0x537e('0x50')][_0x537e('0x58')]+'%'};return _0x544bd9;}})});}_0x5ea469=_[_0x537e('0x59')]({},_0x5ea469,_0x32c059[_0x537e('0x5b')]);var _0x4eaa54={'where':_0x5ea469[_0x537e('0x56')]};return db[_0x537e('0x4a')][_0x537e('0x23')](_0x4eaa54)['then'](function(_0x55ef66){_0x53120d[_0x537e('0x23')]=_0x55ef66;if(_0x32c059[_0x537e('0x50')][_0x537e('0x5c')]){_0x5ea469['include']=[{'all':!![]}];}return db[_0x537e('0x4a')][_0x537e('0x5d')](_0x5ea469);})[_0x537e('0x13')](function(_0x3ff869){_0x53120d[_0x537e('0x5e')]=_0x3ff869;return _0x53120d;})['then'](respondWithFilteredResult(_0xe64c0c,_0x5ea469))[_0x537e('0x5f')](handleError(_0xe64c0c,null));};exports[_0x537e('0x60')]=function(_0x3bf884,_0x4686b6){var _0x1f150f={'raw':![],'where':{'id':_0x3bf884[_0x537e('0x61')]['id']},'include':[{'model':db[_0x537e('0x62')],'as':_0x537e('0x45')},{'model':db[_0x537e('0x63')],'as':_0x537e('0x46')},{'model':db[_0x537e('0x47')],'as':_0x537e('0x48')}]},_0x1ffabc={};_0x1ffabc[_0x537e('0x4f')]=_[_0x537e('0x64')](db[_0x537e('0x4a')][_0x537e('0x4b')]);_0x1ffabc['query']=_['keys'](_0x3bf884[_0x537e('0x50')]);_0x1ffabc[_0x537e('0x51')]=_[_0x537e('0x65')](_0x1ffabc[_0x537e('0x4f')],_0x1ffabc[_0x537e('0x50')]);_0x1f150f[_0x537e('0x52')]=_['intersection'](_0x1ffabc[_0x537e('0x4f')],qs['fields'](_0x3bf884[_0x537e('0x50')][_0x537e('0x53')]));_0x1f150f[_0x537e('0x52')]=_0x1f150f['attributes'][_0x537e('0x66')]?_0x1f150f[_0x537e('0x52')]:_0x1ffabc[_0x537e('0x4f')];if(_0x3bf884[_0x537e('0x50')][_0x537e('0x5c')]){_0x1f150f[_0x537e('0x67')]=[{'all':!![]}];}_0x1f150f=_['merge']({},_0x1f150f,_0x3bf884['options']);return db[_0x537e('0x4a')]['find'](_0x1f150f)[_0x537e('0x13')](handleEntityNotFound(_0x4686b6,null))[_0x537e('0x13')](respondWithResult(_0x4686b6,null))[_0x537e('0x5f')](handleError(_0x4686b6,null));};exports[_0x537e('0x68')]=function(_0x141e7e,_0x128fa3){if(_0x141e7e[_0x537e('0x69')]['id']){delete _0x141e7e[_0x537e('0x69')]['id'];}var _0x54b768=_0x141e7e['body'][_0x537e('0x6a')]===_0x537e('0x6b')?null:_0x141e7e['body']['provider'];var _0x34c307=_0x141e7e[_0x537e('0x69')][_0x537e('0x45')]||{};var _0x45013c=_0x141e7e[_0x537e('0x69')][_0x537e('0x46')]||{};if(_0x54b768){_0x34c307[_0x537e('0x40')]=getImapHost(_0x54b768);_0x34c307[_0x537e('0x44')]=0x3e1;_0x45013c['host']=getSmtpHost(_0x54b768);_0x45013c[_0x537e('0x44')]=0x24b;_0x45013c[_0x537e('0x41')]=![];}if(_0x45013c['modernAuthentication']){_0x45013c['secure']=![];}else{_0x45013c[_0x537e('0x3e')]=null;}if(!_0x34c307[_0x537e('0x3d')])_0x34c307[_0x537e('0x3e')]=null;_0x141e7e[_0x537e('0x69')][_0x537e('0x45')]=_0x34c307;_0x141e7e['body']['Smtp']=_0x45013c;return db[_0x537e('0x4a')][_0x537e('0x6c')]({'where':{'id':_0x141e7e[_0x537e('0x61')]['id']},'include':[{'model':db[_0x537e('0x62')],'as':_0x537e('0x45')},{'model':db[_0x537e('0x63')],'as':_0x537e('0x46')},{'model':db[_0x537e('0x47')],'as':_0x537e('0x48')}]})[_0x537e('0x13')](handleEntityNotFound(_0x128fa3,null))['then'](function(_0x40c7c5){if(!_0x40c7c5)throw new Error(_0x537e('0x6d'));if(_0x40c7c5[_0x537e('0x42')])delete _0x141e7e['body']['Imap'];return _0x40c7c5;})[_0x537e('0x13')](saveUpdates(_0x141e7e[_0x537e('0x69')],null))[_0x537e('0x13')](function(_0xafac52){if(!_0x141e7e[_0x537e('0x69')][_0x537e('0x45')])return _0xafac52;return db[_0x537e('0x62')][_0x537e('0x68')](_0x141e7e['body'][_0x537e('0x45')],{'where':{'MailAccountId':_0xafac52['id']}})['then'](function(){return _0xafac52;});})['then'](function(_0x1fcc00){if(!_0x141e7e[_0x537e('0x69')][_0x537e('0x46')])return _0x1fcc00;return db[_0x537e('0x63')][_0x537e('0x68')](_0x141e7e[_0x537e('0x69')][_0x537e('0x46')],{'where':{'MailAccountId':_0x1fcc00['id']}})['then'](function(){return _0x1fcc00;});})[_0x537e('0x13')](respondWithResult(_0x128fa3,null))[_0x537e('0x5f')](handleError(_0x128fa3,null));};exports[_0x537e('0x6e')]=function(_0x42b7f3,_0x2f9848){return db[_0x537e('0x4a')][_0x537e('0x6e')]()[_0x537e('0x13')](respondWithResult(_0x2f9848,null))['catch'](handleError(_0x2f9848,null));};exports[_0x537e('0x6f')]=function(_0x4ed19c,_0x27603c){if(_0x4ed19c[_0x537e('0x69')]['id']){delete _0x4ed19c['body']['id'];}return db[_0x537e('0x4a')][_0x537e('0x6c')]({'where':{'id':_0x4ed19c[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x27603c,null))[_0x537e('0x13')](function(_0x5458b8){if(_0x5458b8){_0x4ed19c[_0x537e('0x69')][_0x537e('0x70')]=_0x5458b8['id'];return db[_0x537e('0x71')][_0x537e('0x72')](_0x4ed19c[_0x537e('0x69')]);}})[_0x537e('0x13')](respondWithResult(_0x27603c,null))[_0x537e('0x5f')](handleError(_0x27603c,null));};exports['getDispositions']=function(_0x7ae18d,_0x37b472){var _0x281217={'raw':![],'where':{}};var _0x9d257={};var _0x17ab04={'count':0x0,'rows':[]};return db[_0x537e('0x4a')][_0x537e('0x73')]({'where':{'id':_0x7ae18d[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x37b472,null))['then'](function(_0x559419){if(_0x559419){_0x9d257[_0x537e('0x4f')]=_[_0x537e('0x64')](db['Disposition'][_0x537e('0x4b')]);_0x9d257[_0x537e('0x50')]=_['keys'](_0x7ae18d[_0x537e('0x50')]);_0x9d257[_0x537e('0x51')]=_[_0x537e('0x65')](_0x9d257['model'],_0x9d257['query']);_0x281217[_0x537e('0x52')]=_['intersection'](_0x9d257['model'],qs[_0x537e('0x53')](_0x7ae18d[_0x537e('0x50')][_0x537e('0x53')]));_0x281217[_0x537e('0x52')]=_0x281217[_0x537e('0x52')][_0x537e('0x66')]?_0x281217['attributes']:_0x9d257[_0x537e('0x4f')];if(!_0x7ae18d[_0x537e('0x50')][_0x537e('0x74')](_0x537e('0x54'))){_0x281217['limit']=qs[_0x537e('0x22')](_0x7ae18d[_0x537e('0x50')][_0x537e('0x22')]);_0x281217['offset']=qs[_0x537e('0x20')](_0x7ae18d[_0x537e('0x50')][_0x537e('0x20')]);}_0x281217['order']=qs['sort'](_0x7ae18d[_0x537e('0x50')][_0x537e('0x55')]);_0x281217[_0x537e('0x56')]=qs['filters'](_['pick'](_0x7ae18d[_0x537e('0x50')],_0x9d257[_0x537e('0x51')]));_0x281217[_0x537e('0x56')][_0x537e('0x70')]=_0x559419['id'];if(_0x7ae18d[_0x537e('0x50')][_0x537e('0x58')]){_0x281217[_0x537e('0x56')]=_[_0x537e('0x59')](_0x281217[_0x537e('0x56')],{'$or':_[_0x537e('0x49')](_0x281217[_0x537e('0x52')],function(_0x324acd){var _0x362986={};_0x362986[_0x324acd]={'$like':'%'+_0x7ae18d['query'][_0x537e('0x58')]+'%'};return _0x362986;})});}_0x281217=_[_0x537e('0x59')]({},_0x281217,_0x7ae18d['options']);return db['Disposition'][_0x537e('0x23')]({'where':_0x281217[_0x537e('0x56')]})['then'](function(_0x357f1c){_0x17ab04[_0x537e('0x23')]=_0x357f1c;if(_0x7ae18d[_0x537e('0x50')][_0x537e('0x5c')]){_0x281217[_0x537e('0x67')]=[{'all':!![]}];}return db[_0x537e('0x71')][_0x537e('0x5d')](_0x281217);})[_0x537e('0x13')](function(_0x52acae){_0x17ab04[_0x537e('0x5e')]=_0x52acae;return _0x17ab04;});}})[_0x537e('0x13')](respondWithFilteredResult(_0x37b472,_0x281217))['catch'](handleError(_0x37b472,null));};exports[_0x537e('0x75')]=function(_0x57ab41,_0x432314){return db[_0x537e('0x4a')]['find']({'where':{'id':_0x57ab41[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x432314,null))[_0x537e('0x13')](function(_0x465d67){if(_0x465d67){return _0x465d67[_0x537e('0x75')](_0x57ab41[_0x537e('0x50')][_0x537e('0x76')]);}})[_0x537e('0x13')](respondWithStatusCode(_0x432314,null))[_0x537e('0x5f')](handleError(_0x432314,null));};exports['addAnswer']=function(_0x555122,_0x54eb20){if(_0x555122[_0x537e('0x69')]['id']){delete _0x555122['body']['id'];}return db[_0x537e('0x4a')][_0x537e('0x6c')]({'where':{'id':_0x555122['params']['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x54eb20,null))[_0x537e('0x13')](function(_0x34b41d){if(_0x34b41d){_0x555122['body']['MailAccountId']=_0x34b41d['id'];return db[_0x537e('0x77')]['create'](_0x555122['body']);}})[_0x537e('0x13')](respondWithResult(_0x54eb20,null))[_0x537e('0x5f')](handleError(_0x54eb20,null));};exports[_0x537e('0x78')]=function(_0x403539,_0x282dfc){var _0x41c32b={'raw':![],'where':{}};var _0x8bd6f8={};var _0x100d9b={'count':0x0,'rows':[]};return db[_0x537e('0x4a')][_0x537e('0x73')]({'where':{'id':_0x403539[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x282dfc,null))[_0x537e('0x13')](function(_0x4f85dd){if(_0x4f85dd){_0x8bd6f8[_0x537e('0x4f')]=_[_0x537e('0x64')](db[_0x537e('0x77')][_0x537e('0x4b')]);_0x8bd6f8[_0x537e('0x50')]=_['keys'](_0x403539[_0x537e('0x50')]);_0x8bd6f8[_0x537e('0x51')]=_[_0x537e('0x65')](_0x8bd6f8['model'],_0x8bd6f8[_0x537e('0x50')]);_0x41c32b[_0x537e('0x52')]=_[_0x537e('0x65')](_0x8bd6f8[_0x537e('0x4f')],qs[_0x537e('0x53')](_0x403539[_0x537e('0x50')]['fields']));_0x41c32b[_0x537e('0x52')]=_0x41c32b['attributes']['length']?_0x41c32b['attributes']:_0x8bd6f8[_0x537e('0x4f')];if(!_0x403539[_0x537e('0x50')][_0x537e('0x74')]('nolimit')){_0x41c32b[_0x537e('0x22')]=qs[_0x537e('0x22')](_0x403539[_0x537e('0x50')]['limit']);_0x41c32b[_0x537e('0x20')]=qs['offset'](_0x403539[_0x537e('0x50')][_0x537e('0x20')]);}_0x41c32b[_0x537e('0x79')]=qs[_0x537e('0x55')](_0x403539[_0x537e('0x50')]['sort']);_0x41c32b[_0x537e('0x56')]=qs[_0x537e('0x51')](_['pick'](_0x403539[_0x537e('0x50')],_0x8bd6f8[_0x537e('0x51')]));_0x41c32b[_0x537e('0x56')][_0x537e('0x70')]=_0x4f85dd['id'];if(_0x403539[_0x537e('0x50')][_0x537e('0x58')]){_0x41c32b['where']=_['merge'](_0x41c32b[_0x537e('0x56')],{'$or':_['map'](_0x41c32b[_0x537e('0x52')],function(_0x49d19a){var _0x3e89b6={};_0x3e89b6[_0x49d19a]={'$like':'%'+_0x403539[_0x537e('0x50')][_0x537e('0x58')]+'%'};return _0x3e89b6;})});}_0x41c32b=_[_0x537e('0x59')]({},_0x41c32b,_0x403539[_0x537e('0x5b')]);return db[_0x537e('0x77')]['count']({'where':_0x41c32b[_0x537e('0x56')]})[_0x537e('0x13')](function(_0x381395){_0x100d9b[_0x537e('0x23')]=_0x381395;if(_0x403539[_0x537e('0x50')][_0x537e('0x5c')]){_0x41c32b[_0x537e('0x67')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x41c32b);})[_0x537e('0x13')](function(_0x568b20){_0x100d9b['rows']=_0x568b20;return _0x100d9b;});}})[_0x537e('0x13')](respondWithFilteredResult(_0x282dfc,_0x41c32b))['catch'](handleError(_0x282dfc,null));};exports[_0x537e('0x7a')]=function(_0xff44c3,_0x1cf724){return db[_0x537e('0x4a')]['find']({'where':{'id':_0xff44c3['params']['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x1cf724,null))[_0x537e('0x13')](function(_0x35514b){if(_0x35514b){return _0x35514b['removeAnswers'](_0xff44c3[_0x537e('0x50')][_0x537e('0x76')]);}})[_0x537e('0x13')](respondWithStatusCode(_0x1cf724,null))[_0x537e('0x5f')](handleError(_0x1cf724,null));};exports[_0x537e('0x72')]=function(_0x1bfa2b,_0x37fcee){var _0x425331={'name':_0x1bfa2b[_0x537e('0x69')]['name'],'key':_0x1bfa2b['body'][_0x537e('0x4e')],'provider':_0x1bfa2b[_0x537e('0x69')][_0x537e('0x6a')]===_0x537e('0x6b')?null:_0x1bfa2b[_0x537e('0x69')][_0x537e('0x6a')],'email':_0x1bfa2b[_0x537e('0x69')]['email'],'ListId':_0x1bfa2b['body'][_0x537e('0x7b')],'active':!_[_0x537e('0x7c')](_0x1bfa2b[_0x537e('0x69')][_0x537e('0x7d')])?_0x1bfa2b[_0x537e('0x69')][_0x537e('0x7d')]:!![],'description':_0x1bfa2b[_0x537e('0x69')][_0x537e('0x7e')]||null};var _0x17f5d6=getAuthenticationOptions(_0x425331[_0x537e('0x6a')],_0x1bfa2b[_0x537e('0x69')]);_0x425331['Imap']=_0x17f5d6[_0x537e('0x45')];_0x425331[_0x537e('0x46')]=_0x17f5d6[_0x537e('0x46')];return db['MailAccount'][_0x537e('0x72')](_0x425331,{'include':[{'model':db['MailServerOut'],'as':_0x537e('0x46')},{'model':db[_0x537e('0x62')],'as':_0x537e('0x45')}]})[_0x537e('0x13')](function(_0x15d412){var _0x2261fc=_0x1bfa2b[_0x537e('0x3a')][_0x537e('0x27')]({'plain':!![]});if(!_0x2261fc)throw new Error(_0x537e('0x7f'));if(_0x2261fc[_0x537e('0x80')]===_0x537e('0x3a')){var _0x3987db=_0x15d412[_0x537e('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x537e('0x28'),'userProfileId':_0x2261fc['userProfileId']},'raw':!![]})[_0x537e('0x13')](function(_0x1b17ae){if(_0x1b17ae&&_0x1b17ae[_0x537e('0x81')]===0x0){return db[_0x537e('0x29')][_0x537e('0x72')]({'name':_0x3987db[_0x537e('0x2c')],'resourceId':_0x3987db['id'],'type':_0x1b17ae['name'],'sectionId':_0x1b17ae['id']},{})[_0x537e('0x13')](function(){return _0x15d412;});}else{return _0x15d412;}})['catch'](function(_0x43b118){logger['error'](_0x537e('0x82'),_0x43b118);throw _0x43b118;});}return _0x15d412;})[_0x537e('0x13')](respondWithResult(_0x37fcee,0xc9))[_0x537e('0x5f')](handleError(_0x37fcee,null));};exports[_0x537e('0x83')]=function(_0x1d34c3,_0x3b18db){return db['MailAccount']['findOne']({'where':{'id':_0x1d34c3[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x3b18db,null))[_0x537e('0x13')](function(_0x2d7a3d){if(_0x2d7a3d){return _0x2d7a3d[_0x537e('0x83')]();}return null;})['then'](respondWithResult(_0x3b18db,null))[_0x537e('0x5f')](handleError(_0x3b18db,null));};exports['addImap']=function(_0x479a92,_0x13e14e){if(_0x479a92[_0x537e('0x69')]['id']){delete _0x479a92[_0x537e('0x69')]['id'];}return db[_0x537e('0x4a')]['find']({'where':{'id':_0x479a92[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x13e14e,null))[_0x537e('0x13')](function(_0x3db23d){if(_0x3db23d){_0x479a92['body']['MailAccountId']=_0x3db23d['id'];return db[_0x537e('0x62')][_0x537e('0x72')](_0x479a92[_0x537e('0x69')]);}})[_0x537e('0x13')](respondWithResult(_0x13e14e,null))[_0x537e('0x5f')](handleError(_0x13e14e,null));};exports[_0x537e('0x84')]=function(_0x3b3332,_0xb56140){return db[_0x537e('0x4a')][_0x537e('0x73')]({'where':{'id':_0x3b3332[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0xb56140,null))[_0x537e('0x13')](function(_0x10199b){if(_0x10199b){return _0x10199b['setImap'](null);}return null;})[_0x537e('0x13')](respondWithStatusCode(_0xb56140,null))[_0x537e('0x5f')](handleError(_0xb56140,null));};exports[_0x537e('0x85')]=function(_0x2d1234,_0x59f63c){return db[_0x537e('0x4a')][_0x537e('0x73')]({'where':{'id':_0x2d1234['params']['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x59f63c,null))[_0x537e('0x13')](function(_0x1b780d){if(_0x1b780d){return _0x1b780d['getSmtp']();}return null;})[_0x537e('0x13')](respondWithResult(_0x59f63c,null))[_0x537e('0x5f')](handleError(_0x59f63c,null));};exports[_0x537e('0x86')]=function(_0xfb6f35,_0x5d2300){if(_0xfb6f35[_0x537e('0x69')]['id']){delete _0xfb6f35[_0x537e('0x69')]['id'];}return db[_0x537e('0x4a')][_0x537e('0x6c')]({'where':{'id':_0xfb6f35[_0x537e('0x61')]['id']}})['then'](handleEntityNotFound(_0x5d2300,null))[_0x537e('0x13')](function(_0x58c29b){if(_0x58c29b){_0xfb6f35[_0x537e('0x69')]['MailAccountId']=_0x58c29b['id'];return db['MailServerOut'][_0x537e('0x72')](_0xfb6f35['body']);}})[_0x537e('0x13')](respondWithResult(_0x5d2300,null))[_0x537e('0x5f')](handleError(_0x5d2300,null));};exports['removeSmtp']=function(_0x46f183,_0x4a45b1){return db['MailAccount'][_0x537e('0x73')]({'where':{'id':_0x46f183[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x4a45b1,null))[_0x537e('0x13')](function(_0x54304b){if(_0x54304b){return _0x54304b[_0x537e('0x87')](null);}return null;})[_0x537e('0x13')](respondWithStatusCode(_0x4a45b1,null))[_0x537e('0x5f')](handleError(_0x4a45b1,null));};exports[_0x537e('0x88')]=function(_0xaeea7b,_0x2f8de3){return db[_0x537e('0x89')]['find']({'where':{'id':_0xaeea7b[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x2f8de3,null))[_0x537e('0x13')](function(_0x251a08){if(_0x251a08){return _0x251a08[_0x537e('0x88')](_0xaeea7b[_0x537e('0x69')][_0x537e('0x76')],_['omit'](_0xaeea7b[_0x537e('0x69')],['ids','id'])||{});}})['then'](respondWithResult(_0x2f8de3,null))[_0x537e('0x5f')](handleError(_0x2f8de3,null));};exports[_0x537e('0x8a')]=function(_0x31b8f7,_0x6ac877){var _0x51a7b4={'raw':![],'where':{}};var _0x164a23={};var _0x417fda={'count':0x0,'rows':[]};return db['MailAccount'][_0x537e('0x73')]({'where':{'id':_0x31b8f7[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x6ac877,null))[_0x537e('0x13')](function(_0x158f3d){if(_0x158f3d){_0x164a23[_0x537e('0x4f')]=_[_0x537e('0x64')](db[_0x537e('0x89')][_0x537e('0x4b')]);_0x164a23[_0x537e('0x50')]=_[_0x537e('0x64')](_0x31b8f7[_0x537e('0x50')]);_0x164a23[_0x537e('0x51')]=_[_0x537e('0x65')](_0x164a23[_0x537e('0x4f')],_0x164a23[_0x537e('0x50')]);_0x51a7b4[_0x537e('0x52')]=_[_0x537e('0x65')](_0x164a23[_0x537e('0x4f')],qs[_0x537e('0x53')](_0x31b8f7[_0x537e('0x50')][_0x537e('0x53')]));_0x51a7b4[_0x537e('0x52')]=_0x51a7b4[_0x537e('0x52')][_0x537e('0x66')]?_0x51a7b4[_0x537e('0x52')]:_0x164a23[_0x537e('0x4f')];if(!_0x31b8f7[_0x537e('0x50')][_0x537e('0x74')](_0x537e('0x54'))){_0x51a7b4[_0x537e('0x22')]=qs[_0x537e('0x22')](_0x31b8f7[_0x537e('0x50')][_0x537e('0x22')]);_0x51a7b4[_0x537e('0x20')]=qs[_0x537e('0x20')](_0x31b8f7['query'][_0x537e('0x20')]);}_0x51a7b4[_0x537e('0x79')]=qs['sort'](_0x31b8f7['query']['sort']);_0x51a7b4[_0x537e('0x56')]=qs['filters'](_[_0x537e('0x57')](_0x31b8f7[_0x537e('0x50')],_0x164a23['filters']));_0x51a7b4[_0x537e('0x56')][_0x537e('0x70')]=_0x158f3d['id'];if(_0x31b8f7[_0x537e('0x50')][_0x537e('0x58')]){_0x51a7b4['where']=_[_0x537e('0x59')](_0x51a7b4[_0x537e('0x56')],{'$or':_[_0x537e('0x49')](_0x51a7b4[_0x537e('0x52')],function(_0x53aaa0){var _0x3b37cc={};_0x3b37cc[_0x53aaa0]={'$like':'%'+_0x31b8f7[_0x537e('0x50')]['filter']+'%'};return _0x3b37cc;})});}_0x51a7b4=_['merge']({},_0x51a7b4,_0x31b8f7[_0x537e('0x5b')]);return db[_0x537e('0x89')][_0x537e('0x23')]({'where':_0x51a7b4[_0x537e('0x56')]})[_0x537e('0x13')](function(_0x134d7c){_0x417fda['count']=_0x134d7c;if(_0x31b8f7[_0x537e('0x50')][_0x537e('0x5c')]){_0x51a7b4[_0x537e('0x67')]=[{'model':db['CmContact'],'as':_0x537e('0x8b'),'required':![]},{'model':db[_0x537e('0x8c')],'as':_0x537e('0x8d'),'attributes':[_0x537e('0x2c'),_0x537e('0x8e'),_0x537e('0x8f')],'required':![]},{'model':db[_0x537e('0x90')],'as':'Tags','attributes':['id',_0x537e('0x2c'),'color'],'where':_0x31b8f7[_0x537e('0x50')][_0x537e('0x91')]?{'id':_0x31b8f7['query'][_0x537e('0x91')]}:undefined,'required':_0x31b8f7[_0x537e('0x50')][_0x537e('0x91')]?!![]:![]}];}return db[_0x537e('0x89')][_0x537e('0x5d')](_0x51a7b4);})['then'](function(_0x5cce8f){_0x417fda[_0x537e('0x5e')]=_0x5cce8f;return _0x417fda;});}})[_0x537e('0x13')](respondWithFilteredResult(_0x6ac877,_0x51a7b4))[_0x537e('0x5f')](handleError(_0x6ac877,null));};exports[_0x537e('0x92')]=function addApplications(_0x42fe88,_0x490fc8){var _0x1f9c80=_0x42fe88[_0x537e('0x61')]['id'];var _0x741710=_0x42fe88[_0x537e('0x69')];var _0xdc049a=0xc8;var _0x27b227=null;return db[_0x537e('0x93')][_0x537e('0x94')]({'isolationLevel':db[_0x537e('0x93')][_0x537e('0x95')][_0x537e('0x96')][_0x537e('0x97')]},function(_0x17188e){return db[_0x537e('0x4a')][_0x537e('0x73')]({'where':{'id':_0x1f9c80},'transaction':_0x17188e})[_0x537e('0x13')](function(_0x3a1b48){if(_0x3a1b48){return db[_0x537e('0x98')][_0x537e('0x2a')]({'where':{'MailAccountId':_0x1f9c80},'transaction':_0x17188e})[_0x537e('0x13')](function(){var _0x4897b3=_[_0x537e('0x49')](_0x741710,function(_0x4be4b2){_0x4be4b2[_0x537e('0x70')]=_0x1f9c80;return _0x4be4b2;});return db[_0x537e('0x98')][_0x537e('0x99')](_0x4897b3,{'transaction':_0x17188e});});}else{_0xdc049a=0x194;_0x27b227=[];}});})[_0x537e('0x13')](function(){if(_0xdc049a!==0x194){return db[_0x537e('0x98')][_0x537e('0x9a')]({'where':{'MailAccountId':_0x1f9c80},'order':_0x537e('0x9b')})['then'](function(_0x267d3f){_0x27b227=_0x267d3f;});}})[_0x537e('0x5f')](function(_0x4e3480){_0xdc049a=0x1f4;logger[_0x537e('0x19')](_0x4e3480[_0x537e('0x2b')]);if(_0x4e3480[_0x537e('0x2c')]){delete _0x4e3480[_0x537e('0x2c')];}_0x27b227=_0x4e3480;})['finally'](function(){if(_0x27b227===null){_0x490fc8[_0x537e('0x1e')](_0xdc049a);}else{if(_0xdc049a===0x1f4){_0x490fc8[_0x537e('0x1f')](_0xdc049a)[_0x537e('0x2d')](_0x27b227);}else{_0x490fc8['status'](_0xdc049a)['json'](_0x27b227);}}});};exports['getApplications']=function(_0x2c56d4,_0x265153){var _0x506931={};var _0x141403={};var _0x4da0cb;var _0xb7e2b9;return db[_0x537e('0x4a')][_0x537e('0x73')]({'where':{'id':_0x2c56d4[_0x537e('0x61')]['id']}})['then'](handleEntityNotFound(_0x265153,null))[_0x537e('0x13')](function(_0x481dbd){if(_0x481dbd){_0x4da0cb=_0x481dbd;_0x141403['model']=_[_0x537e('0x64')](db[_0x537e('0x98')][_0x537e('0x4b')]);_0x141403[_0x537e('0x50')]=_[_0x537e('0x64')](_0x2c56d4[_0x537e('0x50')]);_0x141403[_0x537e('0x51')]=_['intersection'](_0x141403[_0x537e('0x4f')],_0x141403[_0x537e('0x50')]);_0x506931[_0x537e('0x52')]=_[_0x537e('0x65')](_0x141403[_0x537e('0x4f')],qs['fields'](_0x2c56d4[_0x537e('0x50')][_0x537e('0x53')]));_0x506931[_0x537e('0x52')]=_0x506931['attributes']['length']?_0x506931[_0x537e('0x52')]:_0x141403[_0x537e('0x4f')];_0x506931[_0x537e('0x79')]=qs['sort'](_0x2c56d4[_0x537e('0x50')][_0x537e('0x55')]);_0x506931[_0x537e('0x56')]=qs[_0x537e('0x51')](_['pick'](_0x2c56d4[_0x537e('0x50')],_0x141403[_0x537e('0x51')]));if(_0x2c56d4[_0x537e('0x50')][_0x537e('0x58')]){_0x506931[_0x537e('0x56')]=_[_0x537e('0x59')](_0x506931[_0x537e('0x56')],{'$or':_[_0x537e('0x49')](_0x506931['attributes'],function(_0x4c72f3){var _0x54bb81={};_0x54bb81[_0x4c72f3]={'$like':'%'+_0x2c56d4[_0x537e('0x50')]['filter']+'%'};return _0x54bb81;})});}_0x506931=_[_0x537e('0x59')]({},_0x506931,_0x2c56d4[_0x537e('0x5b')]);return _0x4da0cb['getApplications'](_0x506931);}})[_0x537e('0x13')](function(_0x67b9f1){if(_0x67b9f1){_0xb7e2b9=_0x67b9f1['length'];if(!_0x2c56d4[_0x537e('0x50')][_0x537e('0x74')](_0x537e('0x54'))){_0x506931[_0x537e('0x22')]=qs[_0x537e('0x22')](_0x2c56d4[_0x537e('0x50')][_0x537e('0x22')]);_0x506931[_0x537e('0x20')]=qs[_0x537e('0x20')](_0x2c56d4[_0x537e('0x50')][_0x537e('0x20')]);}return _0x4da0cb[_0x537e('0x9c')](_0x506931);}})[_0x537e('0x13')](function(_0x434411){if(_0x434411){return _0x434411?{'count':_0xb7e2b9,'rows':_0x434411}:null;}})['then'](respondWithResult(_0x265153,null))[_0x537e('0x5f')](handleError(_0x265153,null));};exports[_0x537e('0x9d')]=function(_0x1c3385,_0x185a0c){var _0x282051={'raw':!![],'where':{}};var _0x394885={};var _0x4b1f0c={'count':0x0,'rows':[]};return db[_0x537e('0x4a')]['findOne']({'where':{'id':_0x1c3385[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x185a0c,null))[_0x537e('0x13')](function(_0x44b310){if(_0x44b310){_0x394885['model']=_[_0x537e('0x64')](db['MailMessage']['rawAttributes']);_0x394885[_0x537e('0x50')]=_[_0x537e('0x64')](_0x1c3385[_0x537e('0x50')]);_0x394885[_0x537e('0x51')]=_[_0x537e('0x65')](_0x394885[_0x537e('0x4f')],_0x394885[_0x537e('0x50')]);_0x282051[_0x537e('0x52')]=_[_0x537e('0x65')](_0x394885[_0x537e('0x4f')],qs[_0x537e('0x53')](_0x1c3385['query'][_0x537e('0x53')]));_0x282051[_0x537e('0x52')]=_0x282051['attributes'][_0x537e('0x66')]?_0x282051[_0x537e('0x52')]:_0x394885[_0x537e('0x4f')];if(!_0x1c3385[_0x537e('0x50')][_0x537e('0x74')](_0x537e('0x54'))){_0x282051[_0x537e('0x22')]=qs[_0x537e('0x22')](_0x1c3385['query']['limit']);_0x282051[_0x537e('0x20')]=qs[_0x537e('0x20')](_0x1c3385[_0x537e('0x50')]['offset']);}_0x282051[_0x537e('0x79')]=qs[_0x537e('0x55')](_0x1c3385[_0x537e('0x50')][_0x537e('0x55')]);_0x282051['where']=qs[_0x537e('0x51')](_[_0x537e('0x57')](_0x1c3385[_0x537e('0x50')],_0x394885[_0x537e('0x51')]));_0x282051[_0x537e('0x56')][_0x537e('0x70')]=_0x44b310['id'];if(_0x1c3385[_0x537e('0x50')][_0x537e('0x58')]){_0x282051[_0x537e('0x56')]=_[_0x537e('0x59')](_0x282051[_0x537e('0x56')],{'$or':_['map'](_0x282051[_0x537e('0x52')],function(_0xd17718){var _0x5fc59e={};_0x5fc59e[_0xd17718]={'$like':'%'+_0x1c3385[_0x537e('0x50')][_0x537e('0x58')]+'%'};return _0x5fc59e;})});}if(_0x1c3385[_0x537e('0x50')]['$gte']){var _0x296f75=_0x1c3385['query'][_0x537e('0x9e')][_0x537e('0x9f')](',');var _0x5bfad1={};_0x5bfad1[_0x296f75[0x0]]={'$gte':moment(_0x296f75[0x1])[_0x537e('0xa0')](_0x537e('0xa1'))};_0x282051['where']=_['merge'](_0x282051[_0x537e('0x56')],_0x5bfad1);}_0x282051=_[_0x537e('0x59')]({},_0x282051,_0x1c3385[_0x537e('0x5b')]);return db['MailMessage'][_0x537e('0x23')]({'where':_0x282051[_0x537e('0x56')]})[_0x537e('0x13')](function(_0x10f4ec){_0x4b1f0c[_0x537e('0x23')]=_0x10f4ec;if(_0x1c3385[_0x537e('0x50')][_0x537e('0x5c')]){_0x282051[_0x537e('0x67')]=[{'all':!![]}];}return db[_0x537e('0xa2')][_0x537e('0x5d')](_0x282051);})[_0x537e('0x13')](function(_0x32ef7d){if(_0x1c3385[_0x537e('0x50')][_0x537e('0xa3')]==='true'){for(var _0x1d2622=0x0;_0x1d2622<_0x32ef7d['length'];_0x1d2622++){_0x32ef7d[_0x1d2622][_0x537e('0x69')]=juice(_0x32ef7d[_0x1d2622][_0x537e('0x69')]);}}_0x4b1f0c[_0x537e('0x5e')]=_0x32ef7d;return _0x4b1f0c;});}})[_0x537e('0x13')](respondWithFilteredResult(_0x185a0c,_0x282051))['catch'](handleError(_0x185a0c,null));};exports['send']=function(_0x29eabf,_0x3e5263){var _0x4e482a,_0x3e9861={},_0x5db5a1;if(_0x29eabf[_0x537e('0x69')]['to']){_0x5db5a1=_0x29eabf[_0x537e('0x69')]['to'][_0x537e('0x9f')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x29eabf[_0x537e('0x61')]['id']},'include':[{'model':db[_0x537e('0xa4')],'as':'List','include':[{'model':db['CmContact'],'as':_0x537e('0xa5'),'where':{'email':_0x5db5a1},'limit':0x1,'order':[[_0x537e('0xa6'),_0x537e('0xa7')]]}]},{'model':db[_0x537e('0x63')],'as':_0x537e('0x46'),'raw':!![],'include':[{'model':db[_0x537e('0xa8')],'as':'CloudProvider','raw':!![]}]}]})[_0x537e('0x13')](handleEntityNotFound(_0x3e5263,null))[_0x537e('0x13')](function(_0x39654d){if(!_0x39654d)return;_0x4e482a=_0x39654d;if(!_0x39654d[_0x537e('0x46')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x537e('0x7c')](_0x29eabf[_0x537e('0x69')][_0x537e('0xa9')])){_0x29eabf[_0x537e('0x69')][_0x537e('0xa9')]=util[_0x537e('0xa0')](_0x537e('0xaa'),_0x39654d[_0x537e('0x2c')],_0x39654d[_0x537e('0xab')]||_0x39654d['Smtp'][_0x537e('0x3a')]);}if(_0x29eabf[_0x537e('0x69')][_0x537e('0xac')]&&_0x29eabf[_0x537e('0x69')][_0x537e('0xac')]['length']){for(var _0x5a25a5=0x0;_0x5a25a5<_0x29eabf['body'][_0x537e('0xac')][_0x537e('0x66')];_0x5a25a5+=0x1){_0x29eabf[_0x537e('0x69')][_0x537e('0xac')][_0x5a25a5]={'filename':_0x29eabf[_0x537e('0x69')]['attachments'][_0x5a25a5][_0x537e('0x2c')],'path':path['join'](config[_0x537e('0xad')],_0x537e('0xae'),_0x29eabf[_0x537e('0x69')]['attachments'][_0x5a25a5][_0x537e('0xaf')])};}}var _0x2b5563=_0x39654d['getSmtpOptions']();return respondWithRpcPromise(_0x537e('0xb0'),_0x537e('0xb1'),{'account':_0x2b5563,'message':_0x29eabf['body']});})[_0x537e('0x13')](function(_0xf40fcd){if(!_0xf40fcd)return;_0x3e9861=_0xf40fcd;if(!_0x4e482a['List'])throw new Error(_0x537e('0xb2'));if(_0x4e482a[_0x537e('0xb3')][_0x537e('0xa5')][_0x537e('0x66')])return _0x4e482a[_0x537e('0xb3')][_0x537e('0xa5')][0x0];return db['CmContact'][_0x537e('0x72')](_[_0x537e('0xb4')](_0x29eabf['body'],{'firstName':_0x29eabf[_0x537e('0x69')]['to'],'email':_0x29eabf['body']['to'],'phone':_0x29eabf[_0x537e('0x69')]['to'],'ListId':_0x4e482a[_0x537e('0x7b')]}));})[_0x537e('0x13')](function(_0x5c9ae9){if(!_0x5c9ae9)return;var _0x1fbe01={'UserId':_0x29eabf[_0x537e('0x3a')]['id'],'ContactId':_0x5c9ae9['id'],'MailAccountId':_0x4e482a['id'],'inReplyTo':_0x3e9861[_0x537e('0xb5')],'to':_0x29eabf[_0x537e('0x69')][_0x537e('0xa9')],'cc':_0x29eabf['body']['cc'],'subject':_0x29eabf[_0x537e('0x69')][_0x537e('0xb6')],'attach':_0x29eabf[_0x537e('0x69')][_0x537e('0xb7')],'firstMsgDirection':_0x537e('0xb8'),'lastMsgAt':moment()['format'](_0x537e('0xa1')),'lastMsgDirection':_0x537e('0xb8'),'Messages':[_[_0x537e('0x59')](_0x29eabf[_0x537e('0x69')],{'messageId':_0x3e9861[_0x537e('0xb5')],'sentAt':moment()['format'](_0x537e('0xa1')),'read':!![],'MailAccountId':_0x4e482a['id'],'UserId':_0x29eabf[_0x537e('0x3a')]['id'],'ContactId':_0x5c9ae9['id']})]};if(_0x29eabf[_0x537e('0x69')][_0x537e('0xb9')]){_0x1fbe01=_[_0x537e('0x59')](_0x1fbe01,_0x29eabf[_0x537e('0x69')][_0x537e('0xb9')]);}return db[_0x537e('0x89')]['create'](_0x1fbe01,{'include':[{'model':db[_0x537e('0xa2')],'as':_0x537e('0xba')}]});})[_0x537e('0x13')](respondWithResult(_0x3e5263,null))[_0x537e('0x5f')](handleError(_0x3e5263,null));};exports[_0x537e('0xbb')]=function(_0x4aae63,_0x4bb47a){return db[_0x537e('0x4a')][_0x537e('0x6c')]({'where':{'id':_0x4aae63[_0x537e('0x61')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x537e('0x46'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x537e('0x13')](handleEntityNotFound(_0x4bb47a,null))[_0x537e('0x13')](function(_0x459187){if(!_0x459187[_0x537e('0x46')])return;var _0x47429b=_0x459187[_0x537e('0xbc')]();return respondWithRpcPromise(_0x537e('0xbd'),_0x537e('0xbb'),{'account':_0x47429b});})[_0x537e('0x13')](respondWithResult(_0x4bb47a,null))[_0x537e('0x5f')](handleError(_0x4bb47a,null));};exports[_0x537e('0x2a')]=function(_0x168a3f,_0xb42e68){return db[_0x537e('0x4a')][_0x537e('0x6c')]({'where':{'id':_0x168a3f[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0xb42e68,null))[_0x537e('0x13')](function(_0x23b024){if(_0x23b024&&_0x23b024[_0x537e('0x42')]){throw new db[(_0x537e('0xbe'))][(_0x537e('0xbf'))](_0x537e('0xc0'));}return _0x23b024;})[_0x537e('0x13')](removeEntity(_0xb42e68,null))[_0x537e('0x5f')](handleError(_0xb42e68,null));};exports[_0x537e('0xc1')]=function(_0x1d78ac,_0x5d9158){return db[_0x537e('0x4a')][_0x537e('0x6c')]({'where':{'id':_0x1d78ac[_0x537e('0x61')]['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x5d9158,null))['then'](function(_0x58da19){if(_0x58da19){return _0x58da19[_0x537e('0xc1')](_0x1d78ac[_0x537e('0x69')]['ids'],_[_0x537e('0xc2')](_0x1d78ac[_0x537e('0x69')],[_0x537e('0x76'),'id'])||{})['spread'](function(_0xf671f0){for(var _0x13797a=0x0;_0x13797a<_0x1d78ac['body'][_0x537e('0x76')]['length'];_0x13797a+=0x1){socket['emit'](_0x537e('0xc3'),{'UserId':Number(_0x1d78ac[_0x537e('0x69')][_0x537e('0x76')][_0x13797a]),'MailAccountId':Number(_0x1d78ac[_0x537e('0x61')]['id'])});}return _0xf671f0;});}})[_0x537e('0x13')](respondWithResult(_0x5d9158,null))[_0x537e('0x5f')](handleError(_0x5d9158,null));};exports[_0x537e('0xc4')]=function(_0x42f313,_0x358942){return db[_0x537e('0x4a')][_0x537e('0x6c')]({'where':{'id':_0x42f313['params']['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x358942,null))[_0x537e('0x13')](function(_0x4c1892){if(_0x4c1892){return _0x4c1892['removeAgents'](_0x42f313[_0x537e('0x50')][_0x537e('0x76')])['then'](function(){if(_['isArray'](_0x42f313[_0x537e('0x50')][_0x537e('0x76')])){for(var _0x13fe9c=0x0;_0x13fe9c<_0x42f313['query'][_0x537e('0x76')][_0x537e('0x66')];_0x13fe9c+=0x1){socket[_0x537e('0xc5')]('userMailAccount:remove',{'UserId':Number(_0x42f313[_0x537e('0x50')][_0x537e('0x76')][_0x13fe9c]),'MailAccountId':Number(_0x42f313[_0x537e('0x61')]['id'])});}}else{socket[_0x537e('0xc5')](_0x537e('0xc6'),{'UserId':Number(_0x42f313['query']['ids']),'MailAccountId':Number(_0x42f313[_0x537e('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x358942,null))['catch'](handleError(_0x358942,null));};exports[_0x537e('0xc7')]=function(_0x146f40,_0x1dbf70){var _0xe195fe={};var _0x89b380={};var _0x246aa7;var _0x4f0a7b;return db[_0x537e('0x4a')][_0x537e('0x73')]({'where':{'id':_0x146f40['params']['id']}})[_0x537e('0x13')](handleEntityNotFound(_0x1dbf70,null))[_0x537e('0x13')](function(_0x354ec0){if(_0x354ec0){_0x246aa7=_0x354ec0;_0x89b380[_0x537e('0x4f')]=_[_0x537e('0x64')](db[_0x537e('0x8c')][_0x537e('0x4b')]);_0x89b380['query']=_[_0x537e('0x64')](_0x146f40['query']);_0x89b380[_0x537e('0x51')]=_['intersection'](_0x89b380['model'],_0x89b380[_0x537e('0x50')]);_0xe195fe[_0x537e('0x52')]=_['intersection'](_0x89b380[_0x537e('0x4f')],qs[_0x537e('0x53')](_0x146f40[_0x537e('0x50')]['fields']));_0xe195fe[_0x537e('0x52')]=_0xe195fe[_0x537e('0x52')][_0x537e('0x66')]?_0xe195fe['attributes']:_0x89b380['model'];_0xe195fe[_0x537e('0x79')]=qs[_0x537e('0x55')](_0x146f40['query'][_0x537e('0x55')]);_0xe195fe[_0x537e('0x56')]=qs[_0x537e('0x51')](_[_0x537e('0x57')](_0x146f40[_0x537e('0x50')],_0x89b380[_0x537e('0x51')]));if(_0x146f40[_0x537e('0x50')][_0x537e('0x58')]){_0xe195fe[_0x537e('0x56')]=_[_0x537e('0x59')](_0xe195fe[_0x537e('0x56')],{'$or':_[_0x537e('0x49')](_0xe195fe['attributes'],function(_0x42f99a){var _0x557461={};_0x557461[_0x42f99a]={'$like':'%'+_0x146f40['query']['filter']+'%'};return _0x557461;})});}_0xe195fe=_[_0x537e('0x59')]({},_0xe195fe,_0x146f40[_0x537e('0x5b')]);return _0x246aa7['getAgents'](_0xe195fe);}})[_0x537e('0x13')](function(_0xbe8b0b){if(_0xbe8b0b){_0x4f0a7b=_0xbe8b0b['length'];if(!_0x146f40[_0x537e('0x50')][_0x537e('0x74')](_0x537e('0x54'))){_0xe195fe[_0x537e('0x22')]=qs[_0x537e('0x22')](_0x146f40['query'][_0x537e('0x22')]);_0xe195fe[_0x537e('0x20')]=qs[_0x537e('0x20')](_0x146f40['query']['offset']);}return _0x246aa7[_0x537e('0xc7')](_0xe195fe);}})[_0x537e('0x13')](function(_0x1e1593){if(_0x1e1593){return _0x1e1593?{'count':_0x4f0a7b,'rows':_0x1e1593}:null;}})['then'](respondWithResult(_0x1dbf70,null))[_0x537e('0x5f')](handleError(_0x1dbf70,null));}; \ No newline at end of file +var _0xcd2c=['finally','getApplications','getMessages','MailMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','bluebird','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','get','MailAccounts','destroy','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','service','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','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','Tags','color','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','findAndCountAll','priority','stack'];(function(_0x14225d,_0x3c3d00){var _0x5da31c=function(_0x3f51be){while(--_0x3f51be){_0x14225d['push'](_0x14225d['shift']());}};_0x5da31c(++_0x3c3d00);}(_0xcd2c,0xf6));var _0xccd2=function(_0x37750b,_0x368cc8){_0x37750b=_0x37750b-0x0;var _0x454f56=_0xcd2c[_0x37750b];return _0x454f56;};'use strict';var moment=require('moment');var BPromise=require(_0xccd2('0x0'));var util=require(_0xccd2('0x1'));var path=require(_0xccd2('0x2'));var _=require(_0xccd2('0x3'));var juice=require(_0xccd2('0x4'));var Redis=require(_0xccd2('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xccd2('0x6'))(_0xccd2('0x7'));var config=require(_0xccd2('0x8'));var db=require(_0xccd2('0x9'))['db'];config['redis']=_[_0xccd2('0xa')](config[_0xccd2('0xb')],{'host':_0xccd2('0xc'),'port':0x18eb});var socket=require(_0xccd2('0xd'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xccd2('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0xccd2('0xf')][_0xccd2('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x200ee1,_0x512341,_0x2a73b9,_0x3cd755){return new BPromise(function(_0x1e5083,_0x1fa60f){var _0x4e31ae=_0x3cd755||client;return _0x4e31ae[_0xccd2('0x11')](_0x200ee1,_0x2a73b9)[_0xccd2('0x12')](function(_0x5efdd3){logger[_0xccd2('0x13')](_0xccd2('0x14'),_0x512341,_0xccd2('0x15'));logger[_0xccd2('0x16')](_0xccd2('0x17'),_0x512341,_0xccd2('0x15'),JSON[_0xccd2('0x18')](_0x5efdd3));if(_0x5efdd3['error']){if(_0x5efdd3[_0xccd2('0x19')][_0xccd2('0x1a')]===0x1f4){logger[_0xccd2('0x19')](_0xccd2('0x14'),_0x512341,_0x5efdd3[_0xccd2('0x19')][_0xccd2('0x1b')]);return _0x1fa60f(_0x5efdd3[_0xccd2('0x19')][_0xccd2('0x1b')]);}logger['error'](_0xccd2('0x14'),_0x512341,_0x5efdd3[_0xccd2('0x19')][_0xccd2('0x1b')]);return _0x1e5083(_0x5efdd3[_0xccd2('0x19')]['message']);}else{logger[_0xccd2('0x13')](_0xccd2('0x14'),_0x512341,'request\x20sent');_0x1e5083(_0x5efdd3[_0xccd2('0x1c')]['message']);}})[_0xccd2('0x1d')](function(_0x1e4e73){logger['error']('MailAccount,\x20%s,\x20%s',_0x512341,_0x1e4e73);_0x1fa60f(_0x1e4e73);});});}function respondWithStatusCode(_0x36a7b3,_0x1823d4){_0x1823d4=_0x1823d4||0xcc;return function(_0x564712){if(_0x564712){return _0x36a7b3[_0xccd2('0x1e')](_0x1823d4);}return _0x36a7b3['status'](_0x1823d4)[_0xccd2('0x1f')]();};}function respondWithResult(_0x188348,_0x1e0175){_0x1e0175=_0x1e0175||0xc8;return function(_0x328c17){if(_0x328c17){return _0x188348['status'](_0x1e0175)['json'](_0x328c17);}};}function respondWithFilteredResult(_0x3f88f6,_0x4b014c){return function(_0x21639f){if(_0x21639f){var _0x4c6c82=typeof _0x4b014c[_0xccd2('0x20')]===_0xccd2('0x21')&&typeof _0x4b014c[_0xccd2('0x22')]===_0xccd2('0x21');var _0xfde64a=_0x21639f['count'];var _0x3827f1=_0x4c6c82?0x0:_0x4b014c[_0xccd2('0x20')];var _0x444395=_0x4c6c82?_0x21639f[_0xccd2('0x23')]:_0x4b014c[_0xccd2('0x20')]+_0x4b014c[_0xccd2('0x22')];var _0x180c5a;if(_0x444395>=_0xfde64a){_0x444395=_0xfde64a;_0x180c5a=0xc8;}else{_0x180c5a=0xce;}_0x3f88f6[_0xccd2('0x24')](_0x180c5a);return _0x3f88f6[_0xccd2('0x25')](_0xccd2('0x26'),_0x3827f1+'-'+_0x444395+'/'+_0xfde64a)[_0xccd2('0x27')](_0x21639f);}return null;};}function saveUpdates(_0x49ae19){return function(_0x5b86f9){if(_0x5b86f9){return _0x5b86f9['update'](_0x49ae19)[_0xccd2('0x12')](function(_0x2cd1e7){return _0x2cd1e7;});}return null;};}function removeEntity(_0x251f10){return function(_0x10960b){if(_0x10960b){return _0x10960b['destroy']()[_0xccd2('0x12')](function(){var _0x4e1630=_0x10960b[_0xccd2('0x28')]({'plain':!![]});var _0x49e97d=_0xccd2('0x29');return db['UserProfileResource'][_0xccd2('0x2a')]({'where':{'type':_0x49e97d,'resourceId':_0x4e1630['id']}})[_0xccd2('0x12')](function(){return _0x10960b;});})[_0xccd2('0x12')](function(){_0x251f10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a979){return function(_0x499042){if(!_0x499042){_0x42a979[_0xccd2('0x1e')](0x194);}return _0x499042;};}function handleError(_0x7bde32,_0x28bd53){_0x28bd53=_0x28bd53||0x1f4;return function(_0x3700bd){logger[_0xccd2('0x19')](_0x3700bd['stack']);if(_0x3700bd[_0xccd2('0x2b')]){delete _0x3700bd['name'];}_0x7bde32[_0xccd2('0x24')](_0x28bd53)[_0xccd2('0x2c')](_0x3700bd);};}function getImapHost(_0x93221f){switch(_0x93221f){case _0xccd2('0x2d'):return _0xccd2('0x2e');case _0xccd2('0x2f'):return _0xccd2('0x30');case _0xccd2('0x31'):return'imap-mail.outlook.com';case _0xccd2('0x32'):return _0xccd2('0x33');}throw new Error(_0xccd2('0x34'),_0x93221f);}function getSmtpHost(_0x23faf8){switch(_0x23faf8){case _0xccd2('0x2d'):return _0xccd2('0x35');case _0xccd2('0x2f'):return _0xccd2('0x36');case _0xccd2('0x31'):return _0xccd2('0x37');case _0xccd2('0x32'):return _0xccd2('0x38');}throw new Error('Unknown\x20email\x20service\x20provider',_0x23faf8);}function getAuthenticationOptions(_0x514afe,_0x445b62){var _0x534abe={};var _0x5d4fa6={};if(_0x514afe){_0x534abe[_0xccd2('0x39')]=_0x5d4fa6['user']=_0x445b62[_0xccd2('0x3a')];_0x534abe[_0xccd2('0x3b')]=_0x5d4fa6[_0xccd2('0x3c')]=_0x445b62[_0xccd2('0x3b')];if(_0x445b62[_0xccd2('0x3d')]){_0x534abe[_0xccd2('0x3d')]=_0x5d4fa6[_0xccd2('0x3d')]=!![];_0x534abe['CloudProviderId']=_0x5d4fa6[_0xccd2('0x3e')]=_0x445b62[_0xccd2('0x3e')];_0x534abe[_0xccd2('0x3b')]=_0x5d4fa6['pass']=null;}else{_0x534abe[_0xccd2('0x3e')]=_0x5d4fa6['CloudProviderId']=null;}_0x534abe[_0xccd2('0x3f')]=getImapHost(_0x514afe);_0x534abe[_0xccd2('0x40')]=0x3e1;_0x5d4fa6[_0xccd2('0x3f')]=getSmtpHost(_0x514afe);_0x5d4fa6[_0xccd2('0x40')]=0x24b;_0x5d4fa6[_0xccd2('0x41')]=![];_0x534abe['service']=_0x5d4fa6['service']=null;}else{if(_0x445b62[_0xccd2('0x42')]){_0x534abe['user']=_0x5d4fa6[_0xccd2('0x39')]=_0x445b62[_0xccd2('0x3a')];_0x534abe[_0xccd2('0x3b')]=_0x5d4fa6[_0xccd2('0x3c')]=_0x445b62[_0xccd2('0x3b')];}else{_0x534abe[_0xccd2('0x42')]=_0x5d4fa6[_0xccd2('0x42')]=![];_0x534abe[_0xccd2('0x39')]=_0x5d4fa6[_0xccd2('0x39')]=null;_0x534abe['password']=_0x5d4fa6[_0xccd2('0x3c')]=null;}_0x534abe[_0xccd2('0x3f')]=_0x445b62[_0xccd2('0x43')][_0xccd2('0x3f')];_0x534abe[_0xccd2('0x40')]=_0x445b62[_0xccd2('0x43')][_0xccd2('0x40')];_0x5d4fa6[_0xccd2('0x3f')]=_0x445b62[_0xccd2('0x44')][_0xccd2('0x3f')];_0x5d4fa6[_0xccd2('0x40')]=_0x445b62[_0xccd2('0x44')][_0xccd2('0x40')];}return{'Imap':_0x534abe,'Smtp':_0x5d4fa6};}exports['index']=function(_0x5a64aa,_0xd82eb5){var _0x14a2df={'include':[{'model':db[_0xccd2('0x45')],'as':'Imap'},{'model':db[_0xccd2('0x46')],'as':'Smtp'},{'model':db[_0xccd2('0x47')],'as':_0xccd2('0x48')}]},_0x2a7d11={},_0x2b99dd={'count':0x0,'rows':[]};var _0x4bf362=_[_0xccd2('0x49')](db[_0xccd2('0x4a')][_0xccd2('0x4b')],function(_0x142f77){return{'name':_0x142f77[_0xccd2('0x4c')],'type':_0x142f77['type']['key']};});_0x2a7d11[_0xccd2('0x4d')]=_[_0xccd2('0x49')](_0x4bf362,'name');_0x2a7d11['query']=_[_0xccd2('0x4e')](_0x5a64aa[_0xccd2('0x4f')]);_0x2a7d11[_0xccd2('0x50')]=_[_0xccd2('0x51')](_0x2a7d11['model'],_0x2a7d11['query']);_0x14a2df[_0xccd2('0x52')]=_[_0xccd2('0x51')](_0x2a7d11[_0xccd2('0x4d')],qs[_0xccd2('0x53')](_0x5a64aa[_0xccd2('0x4f')][_0xccd2('0x53')]));_0x14a2df[_0xccd2('0x52')]=_0x14a2df[_0xccd2('0x52')][_0xccd2('0x54')]?_0x14a2df[_0xccd2('0x52')]:_0x2a7d11[_0xccd2('0x4d')];if(!_0x5a64aa[_0xccd2('0x4f')][_0xccd2('0x55')]('nolimit')){_0x14a2df['limit']=qs[_0xccd2('0x22')](_0x5a64aa['query'][_0xccd2('0x22')]);_0x14a2df[_0xccd2('0x20')]=qs[_0xccd2('0x20')](_0x5a64aa[_0xccd2('0x4f')][_0xccd2('0x20')]);}_0x14a2df[_0xccd2('0x56')]=qs[_0xccd2('0x57')](_0x5a64aa[_0xccd2('0x4f')][_0xccd2('0x57')]);_0x14a2df[_0xccd2('0x58')]=qs['filters'](_[_0xccd2('0x59')](_0x5a64aa[_0xccd2('0x4f')],_0x2a7d11[_0xccd2('0x50')]),_0x4bf362);if(_0x5a64aa['query'][_0xccd2('0x5a')]){_0x14a2df[_0xccd2('0x58')]=_[_0xccd2('0x5b')](_0x14a2df[_0xccd2('0x58')],{'$or':_[_0xccd2('0x49')](_0x4bf362,function(_0x3512be){if(_0x3512be[_0xccd2('0x5c')]!=='VIRTUAL'){var _0x59ecb3={};_0x59ecb3[_0x3512be['name']]={'$like':'%'+_0x5a64aa[_0xccd2('0x4f')][_0xccd2('0x5a')]+'%'};return _0x59ecb3;}})});}_0x14a2df=_[_0xccd2('0x5b')]({},_0x14a2df,_0x5a64aa[_0xccd2('0x5d')]);var _0x43610c={'where':_0x14a2df[_0xccd2('0x58')]};return db['MailAccount'][_0xccd2('0x23')](_0x43610c)['then'](function(_0x3b6ce2){_0x2b99dd[_0xccd2('0x23')]=_0x3b6ce2;if(_0x5a64aa[_0xccd2('0x4f')][_0xccd2('0x5e')]){_0x14a2df[_0xccd2('0x5f')]=[{'all':!![]}];}return db[_0xccd2('0x4a')][_0xccd2('0x60')](_0x14a2df);})[_0xccd2('0x12')](function(_0x2cda7f){_0x2b99dd[_0xccd2('0x61')]=_0x2cda7f;return _0x2b99dd;})[_0xccd2('0x12')](respondWithFilteredResult(_0xd82eb5,_0x14a2df))[_0xccd2('0x1d')](handleError(_0xd82eb5,null));};exports[_0xccd2('0x62')]=function(_0x2f5aba,_0xd3f7b3){var _0x51d91d={'raw':![],'where':{'id':_0x2f5aba[_0xccd2('0x63')]['id']},'include':[{'model':db[_0xccd2('0x45')],'as':_0xccd2('0x43')},{'model':db[_0xccd2('0x46')],'as':_0xccd2('0x44')},{'model':db['Pause'],'as':_0xccd2('0x48')}]},_0x328e11={};_0x328e11[_0xccd2('0x4d')]=_['keys'](db[_0xccd2('0x4a')][_0xccd2('0x4b')]);_0x328e11[_0xccd2('0x4f')]=_['keys'](_0x2f5aba[_0xccd2('0x4f')]);_0x328e11['filters']=_['intersection'](_0x328e11['model'],_0x328e11[_0xccd2('0x4f')]);_0x51d91d[_0xccd2('0x52')]=_['intersection'](_0x328e11[_0xccd2('0x4d')],qs[_0xccd2('0x53')](_0x2f5aba[_0xccd2('0x4f')][_0xccd2('0x53')]));_0x51d91d[_0xccd2('0x52')]=_0x51d91d[_0xccd2('0x52')][_0xccd2('0x54')]?_0x51d91d['attributes']:_0x328e11[_0xccd2('0x4d')];if(_0x2f5aba['query']['includeAll']){_0x51d91d[_0xccd2('0x5f')]=[{'all':!![]}];}_0x51d91d=_[_0xccd2('0x5b')]({},_0x51d91d,_0x2f5aba[_0xccd2('0x5d')]);return db[_0xccd2('0x4a')][_0xccd2('0x64')](_0x51d91d)[_0xccd2('0x12')](handleEntityNotFound(_0xd3f7b3,null))[_0xccd2('0x12')](respondWithResult(_0xd3f7b3,null))[_0xccd2('0x1d')](handleError(_0xd3f7b3,null));};exports[_0xccd2('0x65')]=function(_0x18c289,_0x31cd97){if(_0x18c289[_0xccd2('0x66')]['id']){delete _0x18c289[_0xccd2('0x66')]['id'];}var _0x403324=_0x18c289[_0xccd2('0x66')][_0xccd2('0x67')]===_0xccd2('0x68')?null:_0x18c289[_0xccd2('0x66')][_0xccd2('0x67')];var _0x36b4e0=_0x18c289[_0xccd2('0x66')][_0xccd2('0x43')]||{};var _0xb29160=_0x18c289[_0xccd2('0x66')]['Smtp']||{};if(_0x403324){_0x36b4e0['host']=getImapHost(_0x403324);_0x36b4e0[_0xccd2('0x40')]=0x3e1;_0xb29160[_0xccd2('0x3f')]=getSmtpHost(_0x403324);_0xb29160[_0xccd2('0x40')]=0x24b;_0xb29160['secure']=![];}if(_0xb29160[_0xccd2('0x3d')]){_0xb29160['secure']=![];}else{_0xb29160[_0xccd2('0x3e')]=null;}if(!_0x36b4e0[_0xccd2('0x3d')])_0x36b4e0['CloudProviderId']=null;_0x18c289[_0xccd2('0x66')][_0xccd2('0x43')]=_0x36b4e0;_0x18c289[_0xccd2('0x66')][_0xccd2('0x44')]=_0xb29160;return db[_0xccd2('0x4a')][_0xccd2('0x64')]({'where':{'id':_0x18c289[_0xccd2('0x63')]['id']},'include':[{'model':db[_0xccd2('0x45')],'as':_0xccd2('0x43')},{'model':db['MailServerOut'],'as':_0xccd2('0x44')},{'model':db['Pause'],'as':_0xccd2('0x48')}]})[_0xccd2('0x12')](handleEntityNotFound(_0x31cd97,null))['then'](function(_0x493629){if(!_0x493629)throw new Error(_0xccd2('0x69'));if(_0x493629[_0xccd2('0x6a')])delete _0x18c289[_0xccd2('0x66')][_0xccd2('0x43')];return _0x493629;})[_0xccd2('0x12')](saveUpdates(_0x18c289[_0xccd2('0x66')],null))[_0xccd2('0x12')](function(_0x59ee3f){if(!_0x18c289['body'][_0xccd2('0x43')])return _0x59ee3f;return db[_0xccd2('0x45')][_0xccd2('0x65')](_0x18c289[_0xccd2('0x66')]['Imap'],{'where':{'MailAccountId':_0x59ee3f['id']}})[_0xccd2('0x12')](function(){return _0x59ee3f;});})[_0xccd2('0x12')](function(_0x4060af){if(!_0x18c289[_0xccd2('0x66')]['Smtp'])return _0x4060af;return db[_0xccd2('0x46')][_0xccd2('0x65')](_0x18c289[_0xccd2('0x66')][_0xccd2('0x44')],{'where':{'MailAccountId':_0x4060af['id']}})['then'](function(){return _0x4060af;});})[_0xccd2('0x12')](respondWithResult(_0x31cd97,null))['catch'](handleError(_0x31cd97,null));};exports[_0xccd2('0x6b')]=function(_0x51a4f2,_0x53be66){return db['MailAccount'][_0xccd2('0x6b')]()[_0xccd2('0x12')](respondWithResult(_0x53be66,null))[_0xccd2('0x1d')](handleError(_0x53be66,null));};exports[_0xccd2('0x6c')]=function(_0x420e9e,_0x24a47f){if(_0x420e9e[_0xccd2('0x66')]['id']){delete _0x420e9e['body']['id'];}return db[_0xccd2('0x4a')]['find']({'where':{'id':_0x420e9e[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x24a47f,null))[_0xccd2('0x12')](function(_0x3219a6){if(_0x3219a6){_0x420e9e[_0xccd2('0x66')][_0xccd2('0x6d')]=_0x3219a6['id'];return db[_0xccd2('0x6e')][_0xccd2('0x6f')](_0x420e9e[_0xccd2('0x66')]);}})[_0xccd2('0x12')](respondWithResult(_0x24a47f,null))[_0xccd2('0x1d')](handleError(_0x24a47f,null));};exports[_0xccd2('0x70')]=function(_0x20dc8e,_0x3ac1b9){var _0x1e8355={'raw':![],'where':{}};var _0x51be16={};var _0x546007={'count':0x0,'rows':[]};return db[_0xccd2('0x4a')][_0xccd2('0x71')]({'where':{'id':_0x20dc8e[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x3ac1b9,null))['then'](function(_0x5cbe90){if(_0x5cbe90){_0x51be16['model']=_[_0xccd2('0x4e')](db['Disposition'][_0xccd2('0x4b')]);_0x51be16[_0xccd2('0x4f')]=_[_0xccd2('0x4e')](_0x20dc8e[_0xccd2('0x4f')]);_0x51be16['filters']=_['intersection'](_0x51be16[_0xccd2('0x4d')],_0x51be16['query']);_0x1e8355[_0xccd2('0x52')]=_[_0xccd2('0x51')](_0x51be16['model'],qs[_0xccd2('0x53')](_0x20dc8e[_0xccd2('0x4f')][_0xccd2('0x53')]));_0x1e8355['attributes']=_0x1e8355['attributes'][_0xccd2('0x54')]?_0x1e8355[_0xccd2('0x52')]:_0x51be16[_0xccd2('0x4d')];if(!_0x20dc8e[_0xccd2('0x4f')][_0xccd2('0x55')](_0xccd2('0x72'))){_0x1e8355[_0xccd2('0x22')]=qs[_0xccd2('0x22')](_0x20dc8e['query']['limit']);_0x1e8355[_0xccd2('0x20')]=qs[_0xccd2('0x20')](_0x20dc8e[_0xccd2('0x4f')]['offset']);}_0x1e8355[_0xccd2('0x56')]=qs[_0xccd2('0x57')](_0x20dc8e['query'][_0xccd2('0x57')]);_0x1e8355[_0xccd2('0x58')]=qs[_0xccd2('0x50')](_[_0xccd2('0x59')](_0x20dc8e[_0xccd2('0x4f')],_0x51be16[_0xccd2('0x50')]));_0x1e8355[_0xccd2('0x58')][_0xccd2('0x6d')]=_0x5cbe90['id'];if(_0x20dc8e[_0xccd2('0x4f')][_0xccd2('0x5a')]){_0x1e8355[_0xccd2('0x58')]=_['merge'](_0x1e8355[_0xccd2('0x58')],{'$or':_[_0xccd2('0x49')](_0x1e8355[_0xccd2('0x52')],function(_0x57c3b6){var _0x4f8ca2={};_0x4f8ca2[_0x57c3b6]={'$like':'%'+_0x20dc8e[_0xccd2('0x4f')]['filter']+'%'};return _0x4f8ca2;})});}_0x1e8355=_['merge']({},_0x1e8355,_0x20dc8e[_0xccd2('0x5d')]);return db[_0xccd2('0x6e')][_0xccd2('0x23')]({'where':_0x1e8355[_0xccd2('0x58')]})['then'](function(_0x26fef8){_0x546007[_0xccd2('0x23')]=_0x26fef8;if(_0x20dc8e['query']['includeAll']){_0x1e8355[_0xccd2('0x5f')]=[{'all':!![]}];}return db[_0xccd2('0x6e')][_0xccd2('0x60')](_0x1e8355);})['then'](function(_0x1d14b1){_0x546007[_0xccd2('0x61')]=_0x1d14b1;return _0x546007;});}})['then'](respondWithFilteredResult(_0x3ac1b9,_0x1e8355))[_0xccd2('0x1d')](handleError(_0x3ac1b9,null));};exports['removeDispositions']=function(_0x92bf10,_0x3ab575){return db['MailAccount'][_0xccd2('0x64')]({'where':{'id':_0x92bf10['params']['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x3ab575,null))[_0xccd2('0x12')](function(_0x2bc8bb){if(_0x2bc8bb){return _0x2bc8bb[_0xccd2('0x73')](_0x92bf10[_0xccd2('0x4f')][_0xccd2('0x74')]);}})[_0xccd2('0x12')](respondWithStatusCode(_0x3ab575,null))['catch'](handleError(_0x3ab575,null));};exports[_0xccd2('0x75')]=function(_0xbf4776,_0x172379){if(_0xbf4776['body']['id']){delete _0xbf4776[_0xccd2('0x66')]['id'];}return db[_0xccd2('0x4a')][_0xccd2('0x64')]({'where':{'id':_0xbf4776[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x172379,null))[_0xccd2('0x12')](function(_0x574b83){if(_0x574b83){_0xbf4776[_0xccd2('0x66')]['MailAccountId']=_0x574b83['id'];return db[_0xccd2('0x76')][_0xccd2('0x6f')](_0xbf4776[_0xccd2('0x66')]);}})[_0xccd2('0x12')](respondWithResult(_0x172379,null))[_0xccd2('0x1d')](handleError(_0x172379,null));};exports['getAnswers']=function(_0x3284d5,_0xabb8d4){var _0x547cb5={'raw':![],'where':{}};var _0x5a3b0e={};var _0x3d85bf={'count':0x0,'rows':[]};return db['MailAccount'][_0xccd2('0x71')]({'where':{'id':_0x3284d5['params']['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0xabb8d4,null))[_0xccd2('0x12')](function(_0x29279e){if(_0x29279e){_0x5a3b0e['model']=_[_0xccd2('0x4e')](db['CannedAnswer'][_0xccd2('0x4b')]);_0x5a3b0e['query']=_[_0xccd2('0x4e')](_0x3284d5['query']);_0x5a3b0e[_0xccd2('0x50')]=_['intersection'](_0x5a3b0e[_0xccd2('0x4d')],_0x5a3b0e[_0xccd2('0x4f')]);_0x547cb5[_0xccd2('0x52')]=_[_0xccd2('0x51')](_0x5a3b0e['model'],qs[_0xccd2('0x53')](_0x3284d5['query']['fields']));_0x547cb5[_0xccd2('0x52')]=_0x547cb5['attributes'][_0xccd2('0x54')]?_0x547cb5[_0xccd2('0x52')]:_0x5a3b0e[_0xccd2('0x4d')];if(!_0x3284d5[_0xccd2('0x4f')]['hasOwnProperty'](_0xccd2('0x72'))){_0x547cb5[_0xccd2('0x22')]=qs[_0xccd2('0x22')](_0x3284d5['query'][_0xccd2('0x22')]);_0x547cb5[_0xccd2('0x20')]=qs['offset'](_0x3284d5['query']['offset']);}_0x547cb5[_0xccd2('0x56')]=qs[_0xccd2('0x57')](_0x3284d5[_0xccd2('0x4f')][_0xccd2('0x57')]);_0x547cb5[_0xccd2('0x58')]=qs[_0xccd2('0x50')](_[_0xccd2('0x59')](_0x3284d5[_0xccd2('0x4f')],_0x5a3b0e[_0xccd2('0x50')]));_0x547cb5[_0xccd2('0x58')][_0xccd2('0x6d')]=_0x29279e['id'];if(_0x3284d5[_0xccd2('0x4f')]['filter']){_0x547cb5[_0xccd2('0x58')]=_[_0xccd2('0x5b')](_0x547cb5['where'],{'$or':_[_0xccd2('0x49')](_0x547cb5['attributes'],function(_0x206d19){var _0x482c15={};_0x482c15[_0x206d19]={'$like':'%'+_0x3284d5[_0xccd2('0x4f')][_0xccd2('0x5a')]+'%'};return _0x482c15;})});}_0x547cb5=_[_0xccd2('0x5b')]({},_0x547cb5,_0x3284d5['options']);return db[_0xccd2('0x76')][_0xccd2('0x23')]({'where':_0x547cb5[_0xccd2('0x58')]})[_0xccd2('0x12')](function(_0x685a12){_0x3d85bf[_0xccd2('0x23')]=_0x685a12;if(_0x3284d5[_0xccd2('0x4f')]['includeAll']){_0x547cb5[_0xccd2('0x5f')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x547cb5);})['then'](function(_0x9f8ae5){_0x3d85bf[_0xccd2('0x61')]=_0x9f8ae5;return _0x3d85bf;});}})['then'](respondWithFilteredResult(_0xabb8d4,_0x547cb5))['catch'](handleError(_0xabb8d4,null));};exports[_0xccd2('0x77')]=function(_0x54fc06,_0x488472){return db[_0xccd2('0x4a')]['find']({'where':{'id':_0x54fc06['params']['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x488472,null))[_0xccd2('0x12')](function(_0x3ddb82){if(_0x3ddb82){return _0x3ddb82[_0xccd2('0x77')](_0x54fc06[_0xccd2('0x4f')][_0xccd2('0x74')]);}})[_0xccd2('0x12')](respondWithStatusCode(_0x488472,null))[_0xccd2('0x1d')](handleError(_0x488472,null));};exports[_0xccd2('0x6f')]=function(_0x5e90fd,_0x220e5e){var _0x2b3566={'name':_0x5e90fd['body'][_0xccd2('0x2b')],'key':_0x5e90fd[_0xccd2('0x66')]['key'],'provider':_0x5e90fd[_0xccd2('0x66')]['provider']==='custom'?null:_0x5e90fd['body'][_0xccd2('0x67')],'email':_0x5e90fd['body'][_0xccd2('0x78')],'ListId':_0x5e90fd[_0xccd2('0x66')]['ListId'],'active':!_[_0xccd2('0x79')](_0x5e90fd[_0xccd2('0x66')][_0xccd2('0x7a')])?_0x5e90fd[_0xccd2('0x66')][_0xccd2('0x7a')]:!![],'description':_0x5e90fd[_0xccd2('0x66')][_0xccd2('0x7b')]||null};var _0x407580=getAuthenticationOptions(_0x2b3566[_0xccd2('0x67')],_0x5e90fd[_0xccd2('0x66')]);_0x2b3566[_0xccd2('0x43')]=_0x407580[_0xccd2('0x43')];_0x2b3566[_0xccd2('0x44')]=_0x407580[_0xccd2('0x44')];return db[_0xccd2('0x4a')][_0xccd2('0x6f')](_0x2b3566,{'include':[{'model':db[_0xccd2('0x46')],'as':'Smtp'},{'model':db[_0xccd2('0x45')],'as':_0xccd2('0x43')}]})['then'](function(_0x153b7e){var _0x19c77f=_0x5e90fd[_0xccd2('0x39')][_0xccd2('0x28')]({'plain':!![]});if(!_0x19c77f)throw new Error(_0xccd2('0x7c'));if(_0x19c77f[_0xccd2('0x7d')]===_0xccd2('0x39')){var _0x6644b0=_0x153b7e[_0xccd2('0x28')]({'plain':!![]});return db[_0xccd2('0x7e')][_0xccd2('0x64')]({'where':{'name':_0xccd2('0x29'),'userProfileId':_0x19c77f[_0xccd2('0x7f')]},'raw':!![]})[_0xccd2('0x12')](function(_0x5bb5c4){if(_0x5bb5c4&&_0x5bb5c4[_0xccd2('0x80')]===0x0){return db[_0xccd2('0x81')][_0xccd2('0x6f')]({'name':_0x6644b0['name'],'resourceId':_0x6644b0['id'],'type':_0x5bb5c4['name'],'sectionId':_0x5bb5c4['id']},{})['then'](function(){return _0x153b7e;});}else{return _0x153b7e;}})[_0xccd2('0x1d')](function(_0x2ad4f9){logger[_0xccd2('0x19')](_0xccd2('0x82'),_0x2ad4f9);throw _0x2ad4f9;});}return _0x153b7e;})[_0xccd2('0x12')](respondWithResult(_0x220e5e,0xc9))[_0xccd2('0x1d')](handleError(_0x220e5e,null));};exports[_0xccd2('0x83')]=function(_0x1eedf1,_0x1452a4){return db[_0xccd2('0x4a')][_0xccd2('0x71')]({'where':{'id':_0x1eedf1[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x1452a4,null))[_0xccd2('0x12')](function(_0xf3aaf7){if(_0xf3aaf7){return _0xf3aaf7['getImap']();}return null;})[_0xccd2('0x12')](respondWithResult(_0x1452a4,null))[_0xccd2('0x1d')](handleError(_0x1452a4,null));};exports[_0xccd2('0x84')]=function(_0x47d07d,_0x1f7165){if(_0x47d07d['body']['id']){delete _0x47d07d['body']['id'];}return db[_0xccd2('0x4a')][_0xccd2('0x64')]({'where':{'id':_0x47d07d[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x1f7165,null))[_0xccd2('0x12')](function(_0x4d158e){if(_0x4d158e){_0x47d07d[_0xccd2('0x66')][_0xccd2('0x6d')]=_0x4d158e['id'];return db[_0xccd2('0x45')][_0xccd2('0x6f')](_0x47d07d['body']);}})[_0xccd2('0x12')](respondWithResult(_0x1f7165,null))[_0xccd2('0x1d')](handleError(_0x1f7165,null));};exports[_0xccd2('0x85')]=function(_0x4dd1ed,_0x47cad4){return db[_0xccd2('0x4a')][_0xccd2('0x71')]({'where':{'id':_0x4dd1ed[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x47cad4,null))['then'](function(_0x359029){if(_0x359029){return _0x359029[_0xccd2('0x86')](null);}return null;})[_0xccd2('0x12')](respondWithStatusCode(_0x47cad4,null))[_0xccd2('0x1d')](handleError(_0x47cad4,null));};exports['getSmtp']=function(_0x4be78c,_0x4af777){return db['MailAccount'][_0xccd2('0x71')]({'where':{'id':_0x4be78c[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x4af777,null))[_0xccd2('0x12')](function(_0x397d6a){if(_0x397d6a){return _0x397d6a[_0xccd2('0x87')]();}return null;})[_0xccd2('0x12')](respondWithResult(_0x4af777,null))[_0xccd2('0x1d')](handleError(_0x4af777,null));};exports[_0xccd2('0x88')]=function(_0x5c64f7,_0x2e67e4){if(_0x5c64f7[_0xccd2('0x66')]['id']){delete _0x5c64f7[_0xccd2('0x66')]['id'];}return db[_0xccd2('0x4a')]['find']({'where':{'id':_0x5c64f7['params']['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x2e67e4,null))[_0xccd2('0x12')](function(_0x217f33){if(_0x217f33){_0x5c64f7[_0xccd2('0x66')]['MailAccountId']=_0x217f33['id'];return db[_0xccd2('0x46')][_0xccd2('0x6f')](_0x5c64f7[_0xccd2('0x66')]);}})[_0xccd2('0x12')](respondWithResult(_0x2e67e4,null))[_0xccd2('0x1d')](handleError(_0x2e67e4,null));};exports[_0xccd2('0x89')]=function(_0x1a6854,_0x3e7d6b){return db[_0xccd2('0x4a')][_0xccd2('0x71')]({'where':{'id':_0x1a6854[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x3e7d6b,null))[_0xccd2('0x12')](function(_0x117bd6){if(_0x117bd6){return _0x117bd6[_0xccd2('0x8a')](null);}return null;})[_0xccd2('0x12')](respondWithStatusCode(_0x3e7d6b,null))['catch'](handleError(_0x3e7d6b,null));};exports['addInteraction']=function(_0x2c682b,_0x57820c){return db['MailInteraction'][_0xccd2('0x64')]({'where':{'id':_0x2c682b[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x57820c,null))[_0xccd2('0x12')](function(_0x2fe694){if(_0x2fe694){return _0x2fe694[_0xccd2('0x8b')](_0x2c682b[_0xccd2('0x66')]['ids'],_[_0xccd2('0x8c')](_0x2c682b['body'],[_0xccd2('0x74'),'id'])||{});}})[_0xccd2('0x12')](respondWithResult(_0x57820c,null))[_0xccd2('0x1d')](handleError(_0x57820c,null));};exports[_0xccd2('0x8d')]=function(_0x5cc747,_0x4b695f){var _0x338ca6={'raw':![],'where':{}};var _0x4a81cc={};var _0x1ad534={'count':0x0,'rows':[]};return db['MailAccount'][_0xccd2('0x71')]({'where':{'id':_0x5cc747['params']['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x4b695f,null))[_0xccd2('0x12')](function(_0x58021c){if(_0x58021c){_0x4a81cc[_0xccd2('0x4d')]=_[_0xccd2('0x4e')](db[_0xccd2('0x8e')]['rawAttributes']);_0x4a81cc[_0xccd2('0x4f')]=_[_0xccd2('0x4e')](_0x5cc747[_0xccd2('0x4f')]);_0x4a81cc[_0xccd2('0x50')]=_[_0xccd2('0x51')](_0x4a81cc[_0xccd2('0x4d')],_0x4a81cc['query']);_0x338ca6[_0xccd2('0x52')]=_['intersection'](_0x4a81cc[_0xccd2('0x4d')],qs['fields'](_0x5cc747['query'][_0xccd2('0x53')]));_0x338ca6[_0xccd2('0x52')]=_0x338ca6[_0xccd2('0x52')][_0xccd2('0x54')]?_0x338ca6['attributes']:_0x4a81cc[_0xccd2('0x4d')];if(!_0x5cc747[_0xccd2('0x4f')]['hasOwnProperty'](_0xccd2('0x72'))){_0x338ca6['limit']=qs['limit'](_0x5cc747[_0xccd2('0x4f')][_0xccd2('0x22')]);_0x338ca6['offset']=qs['offset'](_0x5cc747[_0xccd2('0x4f')][_0xccd2('0x20')]);}_0x338ca6[_0xccd2('0x56')]=qs[_0xccd2('0x57')](_0x5cc747[_0xccd2('0x4f')][_0xccd2('0x57')]);_0x338ca6[_0xccd2('0x58')]=qs[_0xccd2('0x50')](_[_0xccd2('0x59')](_0x5cc747['query'],_0x4a81cc['filters']));_0x338ca6[_0xccd2('0x58')]['MailAccountId']=_0x58021c['id'];if(_0x5cc747[_0xccd2('0x4f')]['filter']){_0x338ca6['where']=_['merge'](_0x338ca6['where'],{'$or':_[_0xccd2('0x49')](_0x338ca6['attributes'],function(_0x38e202){var _0x2137fe={};_0x2137fe[_0x38e202]={'$like':'%'+_0x5cc747[_0xccd2('0x4f')][_0xccd2('0x5a')]+'%'};return _0x2137fe;})});}_0x338ca6=_['merge']({},_0x338ca6,_0x5cc747[_0xccd2('0x5d')]);return db[_0xccd2('0x8e')][_0xccd2('0x23')]({'where':_0x338ca6[_0xccd2('0x58')]})['then'](function(_0x31a3c8){_0x1ad534[_0xccd2('0x23')]=_0x31a3c8;if(_0x5cc747['query']['includeAll']){_0x338ca6[_0xccd2('0x5f')]=[{'model':db[_0xccd2('0x8f')],'as':_0xccd2('0x90'),'required':![]},{'model':db[_0xccd2('0x91')],'as':_0xccd2('0x92'),'attributes':[_0xccd2('0x2b'),'fullname',_0xccd2('0x93')],'required':![]},{'model':db[_0xccd2('0x94')],'as':_0xccd2('0x95'),'attributes':['id',_0xccd2('0x2b'),_0xccd2('0x96')],'where':_0x5cc747['query']['tag']?{'id':_0x5cc747[_0xccd2('0x4f')]['tag']}:undefined,'required':_0x5cc747[_0xccd2('0x4f')]['tag']?!![]:![]}];}return db['MailInteraction'][_0xccd2('0x60')](_0x338ca6);})['then'](function(_0x44ff2c){_0x1ad534[_0xccd2('0x61')]=_0x44ff2c;return _0x1ad534;});}})[_0xccd2('0x12')](respondWithFilteredResult(_0x4b695f,_0x338ca6))['catch'](handleError(_0x4b695f,null));};exports[_0xccd2('0x97')]=function addApplications(_0x47516a,_0x33bcc9){var _0x105a64=_0x47516a['params']['id'];var _0x5b97a4=_0x47516a[_0xccd2('0x66')];var _0x1c9fd5=0xc8;var _0x35901d=null;return db[_0xccd2('0x98')][_0xccd2('0x99')]({'isolationLevel':db[_0xccd2('0x98')][_0xccd2('0x9a')][_0xccd2('0x9b')]['READ_COMMITTED']},function(_0x3cd27c){return db['MailAccount'][_0xccd2('0x71')]({'where':{'id':_0x105a64},'transaction':_0x3cd27c})['then'](function(_0x56401c){if(_0x56401c){return db[_0xccd2('0x9c')][_0xccd2('0x2a')]({'where':{'MailAccountId':_0x105a64},'transaction':_0x3cd27c})[_0xccd2('0x12')](function(){var _0x19bfba=_[_0xccd2('0x49')](_0x5b97a4,function(_0x3427db){_0x3427db['MailAccountId']=_0x105a64;return _0x3427db;});return db['MailApplication']['bulkCreate'](_0x19bfba,{'transaction':_0x3cd27c});});}else{_0x1c9fd5=0x194;_0x35901d=[];}});})['then'](function(){if(_0x1c9fd5!==0x194){return db[_0xccd2('0x9c')][_0xccd2('0x9d')]({'where':{'MailAccountId':_0x105a64},'order':_0xccd2('0x9e')})[_0xccd2('0x12')](function(_0x409c04){_0x35901d=_0x409c04;});}})['catch'](function(_0x29f682){_0x1c9fd5=0x1f4;logger['error'](_0x29f682[_0xccd2('0x9f')]);if(_0x29f682[_0xccd2('0x2b')]){delete _0x29f682['name'];}_0x35901d=_0x29f682;})[_0xccd2('0xa0')](function(){if(_0x35901d===null){_0x33bcc9[_0xccd2('0x1e')](_0x1c9fd5);}else{if(_0x1c9fd5===0x1f4){_0x33bcc9[_0xccd2('0x24')](_0x1c9fd5)[_0xccd2('0x2c')](_0x35901d);}else{_0x33bcc9[_0xccd2('0x24')](_0x1c9fd5)[_0xccd2('0x27')](_0x35901d);}}});};exports[_0xccd2('0xa1')]=function(_0x345a3f,_0x31dcda){var _0x1ed15d={};var _0x43fa9a={};var _0x163ce9;var _0x202bf6;return db[_0xccd2('0x4a')][_0xccd2('0x71')]({'where':{'id':_0x345a3f['params']['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x31dcda,null))[_0xccd2('0x12')](function(_0x1d5c2b){if(_0x1d5c2b){_0x163ce9=_0x1d5c2b;_0x43fa9a[_0xccd2('0x4d')]=_['keys'](db[_0xccd2('0x9c')][_0xccd2('0x4b')]);_0x43fa9a[_0xccd2('0x4f')]=_[_0xccd2('0x4e')](_0x345a3f[_0xccd2('0x4f')]);_0x43fa9a[_0xccd2('0x50')]=_[_0xccd2('0x51')](_0x43fa9a[_0xccd2('0x4d')],_0x43fa9a[_0xccd2('0x4f')]);_0x1ed15d[_0xccd2('0x52')]=_[_0xccd2('0x51')](_0x43fa9a[_0xccd2('0x4d')],qs['fields'](_0x345a3f[_0xccd2('0x4f')]['fields']));_0x1ed15d[_0xccd2('0x52')]=_0x1ed15d[_0xccd2('0x52')][_0xccd2('0x54')]?_0x1ed15d[_0xccd2('0x52')]:_0x43fa9a[_0xccd2('0x4d')];_0x1ed15d[_0xccd2('0x56')]=qs[_0xccd2('0x57')](_0x345a3f[_0xccd2('0x4f')][_0xccd2('0x57')]);_0x1ed15d[_0xccd2('0x58')]=qs['filters'](_[_0xccd2('0x59')](_0x345a3f[_0xccd2('0x4f')],_0x43fa9a['filters']));if(_0x345a3f[_0xccd2('0x4f')]['filter']){_0x1ed15d[_0xccd2('0x58')]=_['merge'](_0x1ed15d[_0xccd2('0x58')],{'$or':_[_0xccd2('0x49')](_0x1ed15d[_0xccd2('0x52')],function(_0x3cff73){var _0x52e366={};_0x52e366[_0x3cff73]={'$like':'%'+_0x345a3f[_0xccd2('0x4f')][_0xccd2('0x5a')]+'%'};return _0x52e366;})});}_0x1ed15d=_[_0xccd2('0x5b')]({},_0x1ed15d,_0x345a3f[_0xccd2('0x5d')]);return _0x163ce9[_0xccd2('0xa1')](_0x1ed15d);}})[_0xccd2('0x12')](function(_0x39eb60){if(_0x39eb60){_0x202bf6=_0x39eb60[_0xccd2('0x54')];if(!_0x345a3f['query']['hasOwnProperty'](_0xccd2('0x72'))){_0x1ed15d[_0xccd2('0x22')]=qs[_0xccd2('0x22')](_0x345a3f[_0xccd2('0x4f')][_0xccd2('0x22')]);_0x1ed15d['offset']=qs['offset'](_0x345a3f[_0xccd2('0x4f')][_0xccd2('0x20')]);}return _0x163ce9['getApplications'](_0x1ed15d);}})[_0xccd2('0x12')](function(_0x1b0ecc){if(_0x1b0ecc){return _0x1b0ecc?{'count':_0x202bf6,'rows':_0x1b0ecc}:null;}})[_0xccd2('0x12')](respondWithResult(_0x31dcda,null))[_0xccd2('0x1d')](handleError(_0x31dcda,null));};exports[_0xccd2('0xa2')]=function(_0x41c61b,_0x3f2474){var _0x189b05={'raw':!![],'where':{}};var _0x4484c1={};var _0x105b53={'count':0x0,'rows':[]};return db[_0xccd2('0x4a')][_0xccd2('0x71')]({'where':{'id':_0x41c61b[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x3f2474,null))[_0xccd2('0x12')](function(_0x2752cf){if(_0x2752cf){_0x4484c1[_0xccd2('0x4d')]=_[_0xccd2('0x4e')](db[_0xccd2('0xa3')][_0xccd2('0x4b')]);_0x4484c1[_0xccd2('0x4f')]=_[_0xccd2('0x4e')](_0x41c61b['query']);_0x4484c1[_0xccd2('0x50')]=_[_0xccd2('0x51')](_0x4484c1['model'],_0x4484c1['query']);_0x189b05[_0xccd2('0x52')]=_['intersection'](_0x4484c1[_0xccd2('0x4d')],qs[_0xccd2('0x53')](_0x41c61b[_0xccd2('0x4f')][_0xccd2('0x53')]));_0x189b05[_0xccd2('0x52')]=_0x189b05[_0xccd2('0x52')][_0xccd2('0x54')]?_0x189b05['attributes']:_0x4484c1[_0xccd2('0x4d')];if(!_0x41c61b['query'][_0xccd2('0x55')](_0xccd2('0x72'))){_0x189b05[_0xccd2('0x22')]=qs[_0xccd2('0x22')](_0x41c61b[_0xccd2('0x4f')][_0xccd2('0x22')]);_0x189b05[_0xccd2('0x20')]=qs['offset'](_0x41c61b[_0xccd2('0x4f')][_0xccd2('0x20')]);}_0x189b05[_0xccd2('0x56')]=qs[_0xccd2('0x57')](_0x41c61b[_0xccd2('0x4f')][_0xccd2('0x57')]);_0x189b05[_0xccd2('0x58')]=qs[_0xccd2('0x50')](_[_0xccd2('0x59')](_0x41c61b['query'],_0x4484c1[_0xccd2('0x50')]));_0x189b05[_0xccd2('0x58')]['MailAccountId']=_0x2752cf['id'];if(_0x41c61b['query'][_0xccd2('0x5a')]){_0x189b05[_0xccd2('0x58')]=_['merge'](_0x189b05[_0xccd2('0x58')],{'$or':_[_0xccd2('0x49')](_0x189b05['attributes'],function(_0x55bef5){var _0x4293a8={};_0x4293a8[_0x55bef5]={'$like':'%'+_0x41c61b[_0xccd2('0x4f')][_0xccd2('0x5a')]+'%'};return _0x4293a8;})});}if(_0x41c61b[_0xccd2('0x4f')]['$gte']){var _0x26115e=_0x41c61b[_0xccd2('0x4f')]['$gte'][_0xccd2('0xa4')](',');var _0xc5fb92={};_0xc5fb92[_0x26115e[0x0]]={'$gte':moment(_0x26115e[0x1])[_0xccd2('0xa5')](_0xccd2('0xa6'))};_0x189b05[_0xccd2('0x58')]=_[_0xccd2('0x5b')](_0x189b05['where'],_0xc5fb92);}_0x189b05=_[_0xccd2('0x5b')]({},_0x189b05,_0x41c61b[_0xccd2('0x5d')]);return db[_0xccd2('0xa3')][_0xccd2('0x23')]({'where':_0x189b05[_0xccd2('0x58')]})[_0xccd2('0x12')](function(_0x3f21a4){_0x105b53[_0xccd2('0x23')]=_0x3f21a4;if(_0x41c61b[_0xccd2('0x4f')][_0xccd2('0x5e')]){_0x189b05[_0xccd2('0x5f')]=[{'all':!![]}];}return db[_0xccd2('0xa3')][_0xccd2('0x60')](_0x189b05);})[_0xccd2('0x12')](function(_0x5ebcb1){if(_0x41c61b['query']['inlineCss']===_0xccd2('0xa7')){for(var _0x2c5c10=0x0;_0x2c5c10<_0x5ebcb1[_0xccd2('0x54')];_0x2c5c10++){_0x5ebcb1[_0x2c5c10]['body']=juice(_0x5ebcb1[_0x2c5c10]['body']);}}_0x105b53[_0xccd2('0x61')]=_0x5ebcb1;return _0x105b53;});}})[_0xccd2('0x12')](respondWithFilteredResult(_0x3f2474,_0x189b05))['catch'](handleError(_0x3f2474,null));};exports[_0xccd2('0x2c')]=function(_0x1d45c9,_0x1fc1a9){var _0x8204ce,_0x5d7b5f={},_0x2756a0;if(_0x1d45c9[_0xccd2('0x66')]['to']){_0x2756a0=_0x1d45c9[_0xccd2('0x66')]['to'][_0xccd2('0xa4')](',')[0x0];}return db[_0xccd2('0x4a')][_0xccd2('0x64')]({'where':{'id':_0x1d45c9[_0xccd2('0x63')]['id']},'include':[{'model':db[_0xccd2('0xa8')],'as':_0xccd2('0xa9'),'include':[{'model':db[_0xccd2('0x8f')],'as':_0xccd2('0xaa'),'where':{'email':_0x2756a0},'limit':0x1,'order':[[_0xccd2('0xab'),_0xccd2('0xac')]]}]},{'model':db['MailServerOut'],'as':_0xccd2('0x44'),'raw':!![],'include':[{'model':db[_0xccd2('0xad')],'as':_0xccd2('0xad'),'raw':!![]}]}]})[_0xccd2('0x12')](handleEntityNotFound(_0x1fc1a9,null))['then'](function(_0x191fc9){if(!_0x191fc9)return;_0x8204ce=_0x191fc9;if(!_0x191fc9[_0xccd2('0x44')])throw new Error(_0xccd2('0xae'));if(_[_0xccd2('0x79')](_0x1d45c9[_0xccd2('0x66')]['from'])){_0x1d45c9['body']['from']=util[_0xccd2('0xa5')](_0xccd2('0xaf'),_0x191fc9[_0xccd2('0x2b')],_0x191fc9[_0xccd2('0x78')]||_0x191fc9[_0xccd2('0x44')][_0xccd2('0x39')]);}if(_0x1d45c9[_0xccd2('0x66')][_0xccd2('0xb0')]&&_0x1d45c9['body'][_0xccd2('0xb0')][_0xccd2('0x54')]){for(var _0xb6f58e=0x0;_0xb6f58e<_0x1d45c9[_0xccd2('0x66')][_0xccd2('0xb0')][_0xccd2('0x54')];_0xb6f58e+=0x1){_0x1d45c9[_0xccd2('0x66')]['attachments'][_0xb6f58e]={'filename':_0x1d45c9[_0xccd2('0x66')][_0xccd2('0xb0')][_0xb6f58e][_0xccd2('0x2b')],'path':path[_0xccd2('0xb1')](config[_0xccd2('0xb2')],_0xccd2('0xb3'),_0x1d45c9[_0xccd2('0x66')][_0xccd2('0xb0')][_0xb6f58e][_0xccd2('0xb4')])};}}var _0x32717c=_0x191fc9[_0xccd2('0xb5')]();return respondWithRpcPromise(_0xccd2('0xb6'),'sendMail',{'account':_0x32717c,'message':_0x1d45c9[_0xccd2('0x66')]});})[_0xccd2('0x12')](function(_0x18ded3){if(!_0x18ded3)return;_0x5d7b5f=_0x18ded3;if(!_0x8204ce[_0xccd2('0xa9')])throw new Error(_0xccd2('0xb7'));if(_0x8204ce[_0xccd2('0xa9')][_0xccd2('0xaa')]['length'])return _0x8204ce[_0xccd2('0xa9')]['Contacts'][0x0];return db['CmContact'][_0xccd2('0x6f')](_[_0xccd2('0xa')](_0x1d45c9[_0xccd2('0x66')],{'firstName':_0x1d45c9[_0xccd2('0x66')]['to'],'email':_0x1d45c9['body']['to'],'phone':_0x1d45c9[_0xccd2('0x66')]['to'],'ListId':_0x8204ce[_0xccd2('0xb8')]}));})[_0xccd2('0x12')](function(_0x260268){if(!_0x260268)return;var _0x3eeb55={'UserId':_0x1d45c9[_0xccd2('0x39')]['id'],'ContactId':_0x260268['id'],'MailAccountId':_0x8204ce['id'],'inReplyTo':_0x5d7b5f[_0xccd2('0xb9')],'to':_0x1d45c9['body']['from'],'cc':_0x1d45c9[_0xccd2('0x66')]['cc'],'subject':_0x1d45c9['body'][_0xccd2('0xba')],'attach':_0x1d45c9[_0xccd2('0x66')][_0xccd2('0xbb')],'firstMsgDirection':_0xccd2('0xbc'),'lastMsgAt':moment()[_0xccd2('0xa5')](_0xccd2('0xa6')),'lastMsgDirection':'out','Messages':[_[_0xccd2('0x5b')](_0x1d45c9[_0xccd2('0x66')],{'messageId':_0x5d7b5f[_0xccd2('0xb9')],'sentAt':moment()[_0xccd2('0xa5')](_0xccd2('0xa6')),'read':!![],'MailAccountId':_0x8204ce['id'],'UserId':_0x1d45c9['user']['id'],'ContactId':_0x260268['id']})]};if(_0x1d45c9[_0xccd2('0x66')][_0xccd2('0xbd')]){_0x3eeb55=_['merge'](_0x3eeb55,_0x1d45c9[_0xccd2('0x66')][_0xccd2('0xbd')]);}return db[_0xccd2('0x8e')][_0xccd2('0x6f')](_0x3eeb55,{'include':[{'model':db[_0xccd2('0xa3')],'as':_0xccd2('0xbe')}]});})[_0xccd2('0x12')](respondWithResult(_0x1fc1a9,null))[_0xccd2('0x1d')](handleError(_0x1fc1a9,null));};exports['verifySmtp']=function(_0x5effe5,_0x119403){return db['MailAccount'][_0xccd2('0x64')]({'where':{'id':_0x5effe5['params']['id']},'include':[{'model':db[_0xccd2('0x46')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xccd2('0xad'),'raw':!![]}]}]})[_0xccd2('0x12')](handleEntityNotFound(_0x119403,null))['then'](function(_0x597d5f){if(!_0x597d5f[_0xccd2('0x44')])return;var _0x2b9766=_0x597d5f[_0xccd2('0xb5')]();return respondWithRpcPromise(_0xccd2('0xbf'),_0xccd2('0xc0'),{'account':_0x2b9766});})[_0xccd2('0x12')](respondWithResult(_0x119403,null))[_0xccd2('0x1d')](handleError(_0x119403,null));};exports[_0xccd2('0x2a')]=function(_0x3f9486,_0x17dd38){return db['MailAccount'][_0xccd2('0x64')]({'where':{'id':_0x3f9486[_0xccd2('0x63')]['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x17dd38,null))[_0xccd2('0x12')](function(_0x383457){if(_0x383457&&_0x383457[_0xccd2('0x6a')]){throw new db[(_0xccd2('0xc1'))]['ValidationError'](_0xccd2('0xc2'));}return _0x383457;})[_0xccd2('0x12')](removeEntity(_0x17dd38,null))[_0xccd2('0x1d')](handleError(_0x17dd38,null));};exports[_0xccd2('0xc3')]=function(_0x4d69c0,_0x53ff2f){return db['MailAccount']['find']({'where':{'id':_0x4d69c0[_0xccd2('0x63')]['id']}})['then'](handleEntityNotFound(_0x53ff2f,null))[_0xccd2('0x12')](function(_0x1e27d1){if(_0x1e27d1){return _0x1e27d1[_0xccd2('0xc3')](_0x4d69c0['body'][_0xccd2('0x74')],_[_0xccd2('0x8c')](_0x4d69c0[_0xccd2('0x66')],[_0xccd2('0x74'),'id'])||{})[_0xccd2('0xc4')](function(_0x2f70e8){for(var _0x5d4fc=0x0;_0x5d4fc<_0x4d69c0[_0xccd2('0x66')][_0xccd2('0x74')]['length'];_0x5d4fc+=0x1){socket['emit'](_0xccd2('0xc5'),{'UserId':Number(_0x4d69c0[_0xccd2('0x66')][_0xccd2('0x74')][_0x5d4fc]),'MailAccountId':Number(_0x4d69c0[_0xccd2('0x63')]['id'])});}return _0x2f70e8;});}})[_0xccd2('0x12')](respondWithResult(_0x53ff2f,null))[_0xccd2('0x1d')](handleError(_0x53ff2f,null));};exports[_0xccd2('0xc6')]=function(_0x1a1f6d,_0x5d928a){return db[_0xccd2('0x4a')][_0xccd2('0x64')]({'where':{'id':_0x1a1f6d['params']['id']}})[_0xccd2('0x12')](handleEntityNotFound(_0x5d928a,null))[_0xccd2('0x12')](function(_0x5c9cfa){if(_0x5c9cfa){return _0x5c9cfa[_0xccd2('0xc6')](_0x1a1f6d[_0xccd2('0x4f')][_0xccd2('0x74')])[_0xccd2('0x12')](function(){if(_[_0xccd2('0xc7')](_0x1a1f6d[_0xccd2('0x4f')]['ids'])){for(var _0x2205a0=0x0;_0x2205a0<_0x1a1f6d[_0xccd2('0x4f')]['ids']['length'];_0x2205a0+=0x1){socket[_0xccd2('0xc8')](_0xccd2('0xc9'),{'UserId':Number(_0x1a1f6d[_0xccd2('0x4f')][_0xccd2('0x74')][_0x2205a0]),'MailAccountId':Number(_0x1a1f6d['params']['id'])});}}else{socket[_0xccd2('0xc8')](_0xccd2('0xc9'),{'UserId':Number(_0x1a1f6d[_0xccd2('0x4f')][_0xccd2('0x74')]),'MailAccountId':Number(_0x1a1f6d['params']['id'])});}});}})[_0xccd2('0x12')](respondWithStatusCode(_0x5d928a,null))[_0xccd2('0x1d')](handleError(_0x5d928a,null));};exports[_0xccd2('0xca')]=function(_0x95998e,_0x1b4d59){var _0x359a6f={};var _0x41d6ca={};var _0xacca71;var _0x218ed7;return db[_0xccd2('0x4a')][_0xccd2('0x71')]({'where':{'id':_0x95998e[_0xccd2('0x63')]['id']}})['then'](handleEntityNotFound(_0x1b4d59,null))['then'](function(_0x427c3b){if(_0x427c3b){_0xacca71=_0x427c3b;_0x41d6ca['model']=_[_0xccd2('0x4e')](db[_0xccd2('0x91')][_0xccd2('0x4b')]);_0x41d6ca['query']=_[_0xccd2('0x4e')](_0x95998e[_0xccd2('0x4f')]);_0x41d6ca[_0xccd2('0x50')]=_[_0xccd2('0x51')](_0x41d6ca[_0xccd2('0x4d')],_0x41d6ca[_0xccd2('0x4f')]);_0x359a6f[_0xccd2('0x52')]=_['intersection'](_0x41d6ca[_0xccd2('0x4d')],qs[_0xccd2('0x53')](_0x95998e['query'][_0xccd2('0x53')]));_0x359a6f[_0xccd2('0x52')]=_0x359a6f[_0xccd2('0x52')]['length']?_0x359a6f[_0xccd2('0x52')]:_0x41d6ca[_0xccd2('0x4d')];_0x359a6f[_0xccd2('0x56')]=qs[_0xccd2('0x57')](_0x95998e['query']['sort']);_0x359a6f['where']=qs[_0xccd2('0x50')](_[_0xccd2('0x59')](_0x95998e[_0xccd2('0x4f')],_0x41d6ca[_0xccd2('0x50')]));if(_0x95998e[_0xccd2('0x4f')][_0xccd2('0x5a')]){_0x359a6f[_0xccd2('0x58')]=_['merge'](_0x359a6f[_0xccd2('0x58')],{'$or':_[_0xccd2('0x49')](_0x359a6f[_0xccd2('0x52')],function(_0x1ed72b){var _0xa6e215={};_0xa6e215[_0x1ed72b]={'$like':'%'+_0x95998e[_0xccd2('0x4f')][_0xccd2('0x5a')]+'%'};return _0xa6e215;})});}_0x359a6f=_[_0xccd2('0x5b')]({},_0x359a6f,_0x95998e['options']);return _0xacca71[_0xccd2('0xca')](_0x359a6f);}})[_0xccd2('0x12')](function(_0x4de80b){if(_0x4de80b){_0x218ed7=_0x4de80b['length'];if(!_0x95998e[_0xccd2('0x4f')][_0xccd2('0x55')](_0xccd2('0x72'))){_0x359a6f[_0xccd2('0x22')]=qs['limit'](_0x95998e[_0xccd2('0x4f')][_0xccd2('0x22')]);_0x359a6f[_0xccd2('0x20')]=qs[_0xccd2('0x20')](_0x95998e['query'][_0xccd2('0x20')]);}return _0xacca71[_0xccd2('0xca')](_0x359a6f);}})['then'](function(_0x34bef9){if(_0x34bef9){return _0x34bef9?{'count':_0x218ed7,'rows':_0x34bef9}:null;}})[_0xccd2('0x12')](respondWithResult(_0x1b4d59,null))[_0xccd2('0x1d')](handleError(_0x1b4d59,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 49de20f..a9b3035 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 _0xb46f=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb46f,0xb6));var _0xfb46=function(_0x526579,_0x51c0eb){_0x526579=_0x526579-0x0;var _0x4c748a=_0xb46f[_0x526579];return _0x4c748a;};'use strict';var EventEmitter=require(_0xfb46('0x0'));var MailAccount=require(_0xfb46('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xfb46('0x2')](0x0);var events={'afterCreate':_0xfb46('0x3'),'afterUpdate':_0xfb46('0x4'),'afterDestroy':_0xfb46('0x5')};function emitEvent(_0x37cc0f){return function(_0x4fb0bb,_0x95533e,_0x544ae9){MailAccountEvents[_0xfb46('0x6')](_0x37cc0f+':'+_0x4fb0bb['id'],_0x4fb0bb);MailAccountEvents[_0xfb46('0x6')](_0x37cc0f,_0x4fb0bb);_0x544ae9(null);};}for(var e in events){if(events[_0xfb46('0x7')](e)){var event=events[e];MailAccount[_0xfb46('0x8')](e,emitEvent(event));}}module[_0xfb46('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x6d11=['hook','exports','events','../../mysqldb','MailAccount','save','remove','emit','hasOwnProperty'];(function(_0x87ab76,_0x5a282c){var _0x301df0=function(_0x41c821){while(--_0x41c821){_0x87ab76['push'](_0x87ab76['shift']());}};_0x301df0(++_0x5a282c);}(_0x6d11,0xbf));var _0x16d1=function(_0x2b1632,_0x500b70){_0x2b1632=_0x2b1632-0x0;var _0x20d283=_0x6d11[_0x2b1632];return _0x20d283;};'use strict';var EventEmitter=require(_0x16d1('0x0'));var MailAccount=require(_0x16d1('0x1'))['db'][_0x16d1('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16d1('0x3'),'afterUpdate':'update','afterDestroy':_0x16d1('0x4')};function emitEvent(_0x2e1a35){return function(_0x4bce83,_0x48754e,_0x3e0e86){MailAccountEvents[_0x16d1('0x5')](_0x2e1a35+':'+_0x4bce83['id'],_0x4bce83);MailAccountEvents[_0x16d1('0x5')](_0x2e1a35,_0x4bce83);_0x3e0e86(null);};}for(var e in events){if(events[_0x16d1('0x6')](e)){var event=events[e];MailAccount[_0x16d1('0x7')](e,emitEvent(event));}}module[_0x16d1('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 35eb49e..7a13241 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 _0x7391=['host','port','Smtp','secure','modernAuthentication','CloudProvider','auth','user','data5','pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','provider','custom','service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7391,0xa3));var _0x1739=function(_0x558099,_0x4be744){_0x558099=_0x558099-0x0;var _0x18ac2e=_0x7391[_0x558099];return _0x18ac2e;};'use strict';var attributes=require(_0x1739('0x0'));module[_0x1739('0x1')]=function(_0x2ba100){return _0x2ba100['define'](_0x1739('0x2'),attributes,{'tableName':_0x1739('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xb525e3=this;var _0x4925c1={'id':_0xb525e3['id'],'tls':{'rejectUnauthorized':![]}};if(_0xb525e3[_0x1739('0x4')]!==_0x1739('0x5')){_0x4925c1[_0x1739('0x6')]=_0xb525e3[_0x1739('0x4')];}else{_0x4925c1[_0x1739('0x7')]=_0xb525e3['Smtp'][_0x1739('0x7')];_0x4925c1[_0x1739('0x8')]=_0xb525e3[_0x1739('0x9')]['port'];_0x4925c1[_0x1739('0xa')]=_0xb525e3[_0x1739('0x9')][_0x1739('0xa')];}if(_0xb525e3[_0x1739('0x9')]['authentication']){if(_0xb525e3[_0x1739('0x9')][_0x1739('0xb')]){if(!_0xb525e3[_0x1739('0x9')][_0x1739('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x4925c1[_0x1739('0xd')]={'type':'OAuth2','user':_0xb525e3[_0x1739('0x9')][_0x1739('0xe')],'accessToken':_0xb525e3[_0x1739('0x9')][_0x1739('0xc')][_0x1739('0xf')]};}else{_0x4925c1['auth']={'user':_0xb525e3[_0x1739('0x9')]['user'],'pass':_0xb525e3[_0x1739('0x9')][_0x1739('0x10')]};}}return _0x4925c1;}}});}; \ No newline at end of file +var _0xe6ce=['secure','authentication','CloudProvider','auth','OAuth2','data5','user','./mailAccount.attributes','exports','MailAccount','mail_accounts','provider','service','host','port','Smtp'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe6ce,0xc7));var _0xee6c=function(_0x13561a,_0x4676ae){_0x13561a=_0x13561a-0x0;var _0x5c1c2b=_0xe6ce[_0x13561a];return _0x5c1c2b;};'use strict';var attributes=require(_0xee6c('0x0'));module[_0xee6c('0x1')]=function(_0x6d608e){return _0x6d608e['define'](_0xee6c('0x2'),attributes,{'tableName':_0xee6c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1e2858=this;var _0x34aa49={'id':_0x1e2858['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1e2858[_0xee6c('0x4')]!=='custom'){_0x34aa49[_0xee6c('0x5')]=_0x1e2858[_0xee6c('0x4')];}else{_0x34aa49['host']=_0x1e2858['Smtp'][_0xee6c('0x6')];_0x34aa49[_0xee6c('0x7')]=_0x1e2858[_0xee6c('0x8')][_0xee6c('0x7')];_0x34aa49['secure']=_0x1e2858['Smtp'][_0xee6c('0x9')];}if(_0x1e2858[_0xee6c('0x8')][_0xee6c('0xa')]){if(_0x1e2858['Smtp']['modernAuthentication']){if(!_0x1e2858[_0xee6c('0x8')][_0xee6c('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x34aa49[_0xee6c('0xc')]={'type':_0xee6c('0xd'),'user':_0x1e2858['Smtp']['user'],'accessToken':_0x1e2858[_0xee6c('0x8')][_0xee6c('0xb')][_0xee6c('0xe')]};}else{_0x34aa49[_0xee6c('0xc')]={'user':_0x1e2858['Smtp'][_0xee6c('0xf')],'pass':_0x1e2858[_0xee6c('0x8')]['pass']};}}return _0x34aa49;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 9f7d34c..c841aff 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 _0x57ca=['setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','List','omit','applications','list','orderBy','asc','push','length','close','*,*,*,*','ListId','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','interaction','get','created','originCc','bcc','Email','Attachment','Attachments','UserId','User','unshift','name','waitForTheAssignedAgent','startRouting','Start','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','ShowMailAccount','MailAccount','find'];(function(_0x4e68c9,_0x5136e5){var _0xad312=function(_0x2873a5){while(--_0x2873a5){_0x4e68c9['push'](_0x4e68c9['shift']());}};_0xad312(++_0x5136e5);}(_0x57ca,0x108));var _0xa57c=function(_0x561bdd,_0x1bcbb8){_0x561bdd=_0x561bdd-0x0;var _0x137b13=_0x57ca[_0x561bdd];return _0x137b13;};'use strict';var _=require('lodash');var moment=require(_0xa57c('0x0'));var BPromise=require(_0xa57c('0x1'));var rs=require('randomstring');var Redis=require(_0xa57c('0x2'));var db=require(_0xa57c('0x3'))['db'];var logger=require(_0xa57c('0x4'))(_0xa57c('0x5'));var config=require(_0xa57c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa57c('0x7')][_0xa57c('0x8')]({'port':0x232c});config[_0xa57c('0x9')]=_[_0xa57c('0xa')](config[_0xa57c('0x9')],{'host':_0xa57c('0xb'),'port':0x18eb});var socket=require(_0xa57c('0xc'))(new Redis(config[_0xa57c('0x9')]));require('./mailAccount.socket')[_0xa57c('0xd')](socket);function respondWithRpcPromise(_0x4b51d8,_0x46ba92,_0x932dcc){return new BPromise(function(_0x4fa5ed,_0x156bca){return client['request'](_0x4b51d8,_0x932dcc)[_0xa57c('0xe')](function(_0x44b221){logger['info'](_0xa57c('0xf'),_0x46ba92,'request\x20sent');logger[_0xa57c('0x10')](_0xa57c('0x11'),_0x46ba92,_0xa57c('0x12'),JSON[_0xa57c('0x13')](_0x44b221));if(_0x44b221[_0xa57c('0x14')]){if(_0x44b221['error'][_0xa57c('0x15')]===0x1f4){logger['error'](_0xa57c('0xf'),_0x46ba92,_0x44b221[_0xa57c('0x14')][_0xa57c('0x16')]);return _0x156bca(_0x44b221[_0xa57c('0x14')][_0xa57c('0x16')]);}logger[_0xa57c('0x14')](_0xa57c('0xf'),_0x46ba92,_0x44b221['error'][_0xa57c('0x16')]);return _0x4fa5ed(_0x44b221[_0xa57c('0x14')][_0xa57c('0x16')]);}else{logger['info'](_0xa57c('0xf'),_0x46ba92,'request\x20sent');_0x4fa5ed(_0x44b221[_0xa57c('0x17')][_0xa57c('0x16')]);}})[_0xa57c('0x18')](function(_0xe3d505){logger[_0xa57c('0x14')](_0xa57c('0xf'),_0x46ba92,_0xe3d505);_0x156bca(_0xe3d505);});});}exports[_0xa57c('0x19')]=function(_0x595c7a){var _0x4e4399=this;return new Promise(function(_0x8a8856,_0x4a53ab){return db['MailAccount'][_0xa57c('0x1a')]({'raw':_0x595c7a[_0xa57c('0x1b')]?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x1c')]===undefined?!![]:![]:!![],'where':_0x595c7a['options']?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x1d')]||null:null,'attributes':_0x595c7a[_0xa57c('0x1b')]?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x1e')]||null:null,'limit':_0x595c7a[_0xa57c('0x1b')]?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x1f')]||null:null,'include':_0x595c7a[_0xa57c('0x1b')]?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x20')]?_[_0xa57c('0x21')](_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x20')],function(_0x431bec){return{'model':db[_0x431bec['model']],'as':_0x431bec['as'],'attributes':_0x431bec[_0xa57c('0x1e')],'include':_0x431bec[_0xa57c('0x20')]?_[_0xa57c('0x21')](_0x431bec[_0xa57c('0x20')],function(_0x315ad7){return{'model':db[_0x315ad7[_0xa57c('0x22')]],'as':_0x315ad7['as'],'attributes':_0x315ad7[_0xa57c('0x1e')],'include':_0x315ad7[_0xa57c('0x20')]?_[_0xa57c('0x21')](_0x315ad7[_0xa57c('0x20')],function(_0x57ebe0){return{'model':db[_0x57ebe0[_0xa57c('0x22')]],'as':_0x57ebe0['as'],'attributes':_0x57ebe0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x257661){logger[_0xa57c('0x23')]('GetMailAccount',_0x595c7a);logger[_0xa57c('0x10')](_0xa57c('0x19'),_0x595c7a,JSON[_0xa57c('0x13')](_0x257661));_0x8a8856(_0x257661);})['catch'](function(_0xd779f1){logger['error'](_0xa57c('0x19'),_0xd779f1['message'],_0x595c7a);_0x4a53ab(_0x4e4399[_0xa57c('0x14')](0x1f4,_0xd779f1['message']));});});};exports[_0xa57c('0x24')]=function(_0x532164){var _0x9e02bb=this;return new Promise(function(_0x1d82d9,_0x43c8f3){return db[_0xa57c('0x25')][_0xa57c('0x26')]({'raw':_0x532164[_0xa57c('0x1b')]?_0x532164[_0xa57c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x532164[_0xa57c('0x1b')]?_0x532164['options'][_0xa57c('0x1d')]||null:null,'attributes':_0x532164[_0xa57c('0x1b')]?_0x532164[_0xa57c('0x1b')]['attributes']||null:null,'include':_0x532164[_0xa57c('0x1b')]?_0x532164['options'][_0xa57c('0x20')]?_['map'](_0x532164[_0xa57c('0x1b')]['include'],function(_0x433116){return{'model':db[_0x433116[_0xa57c('0x22')]],'as':_0x433116['as'],'attributes':_0x433116['attributes'],'include':_0x433116[_0xa57c('0x20')]?_['map'](_0x433116[_0xa57c('0x20')],function(_0x5c56d3){return{'model':db[_0x5c56d3[_0xa57c('0x22')]],'as':_0x5c56d3['as'],'attributes':_0x5c56d3[_0xa57c('0x1e')],'include':_0x5c56d3[_0xa57c('0x20')]?_[_0xa57c('0x21')](_0x5c56d3[_0xa57c('0x20')],function(_0x44350f){return{'model':db[_0x44350f['model']],'as':_0x44350f['as'],'attributes':_0x44350f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa57c('0xe')](function(_0x13e390){if(_0x532164[_0xa57c('0x1b')]['smtp']===!![])_0x13e390[_0xa57c('0x27')]('smtpOptions',_0x13e390[_0xa57c('0x28')]());logger[_0xa57c('0x23')]('ShowMailAccount',_0x532164);logger['debug']('ShowMailAccount',_0x532164,JSON[_0xa57c('0x13')](_0x13e390));_0x1d82d9(_0x13e390);})[_0xa57c('0x18')](function(_0x269a19){logger[_0xa57c('0x14')](_0xa57c('0x24'),_0x269a19[_0xa57c('0x16')],_0x532164);_0x43c8f3(_0x9e02bb['error'](0x1f4,_0x269a19[_0xa57c('0x16')]));});});};exports[_0xa57c('0x29')]=function(_0x5a5490){var _0x5ed42d=this;return new Promise(function(_0x5e10b,_0x203375){var _0x5af5e9={'body':_0x5a5490[_0xa57c('0x2a')],'channel':_0xa57c('0x2b')};var _0x2112b7=_[_0xa57c('0x2c')](_[_0xa57c('0x2d')](db[_0xa57c('0x2e')]['rawAttributes']),[_0xa57c('0x2f'),'updatedAt','CompanyId','ListId']);var _0x520383=![];if(_0x5a5490['body']['id']){delete _0x5a5490[_0xa57c('0x2a')]['id'];}if(_[_0xa57c('0x30')](_0x5a5490[_0xa57c('0x2a')]['from'])){return _0x203375(_0x5ed42d['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xa57c('0x30')](_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x2a')])||_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x2a')]===''){return _0x203375(_0x5ed42d[_0xa57c('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa57c('0x30')](_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x31')])){return _0x203375(_0x5ed42d[_0xa57c('0x14')](0x1f4,_0xa57c('0x32')+_0x2112b7));}if(!_[_0xa57c('0x33')](_0x2112b7,_0x5a5490['body'][_0xa57c('0x31')])){return _0x203375(_0x5ed42d[_0xa57c('0x14')](0x1f4,_0xa57c('0x34')+_0x2112b7));}var _0x14e943={};_0x14e943[_0x5a5490[_0xa57c('0x2a')]['mapKey']]=_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x35')];return db[_0xa57c('0x25')][_0xa57c('0x26')]({'where':{'id':_0x5a5490[_0xa57c('0x36')]['id']},'include':[{'model':db[_0xa57c('0x37')],'as':'List','include':[{'model':db[_0xa57c('0x2e')],'as':_0xa57c('0x38'),'where':_0x14e943,'limit':0x1,'order':[[_0xa57c('0x39'),_0xa57c('0x3a')]]}]},{'model':db[_0xa57c('0x3b')],'as':_0xa57c('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0xa57c('0xe')](function(_0x49492f){if(_0x49492f&&_0x49492f[_0xa57c('0x3d')]){var _0xae87=_0x49492f['get']({'plain':!![]});_0x5af5e9[_0xa57c('0x36')]=_[_0xa57c('0x3e')](_0xae87,[_0xa57c('0x3c'),_0xa57c('0x3d')]);_0x5af5e9[_0xa57c('0x36')]['smtpOptions']=_0x49492f[_0xa57c('0x28')]();_0x5af5e9[_0xa57c('0x3f')]=_0xae87[_0xa57c('0x3c')];_0x5af5e9[_0xa57c('0x40')]=_0xae87[_0xa57c('0x3d')];_0x5af5e9['applications']=_[_0xa57c('0x41')](_0x5af5e9['applications'],['priority'],[_0xa57c('0x42')]);if(_0x5af5e9[_0xa57c('0x36')]&&_0x5af5e9[_0xa57c('0x36')]['autoclose']){_0x5af5e9['applications'][_0xa57c('0x43')]({'id':0x0,'priority':_0x5af5e9[_0xa57c('0x3f')][_0xa57c('0x44')]+0x1,'app':_0xa57c('0x45'),'appdata':'autoclose','interval':_0xa57c('0x46')});}if(_0x5af5e9[_0xa57c('0x36')][_0xa57c('0x3c')]){delete _0x5af5e9['account']['Applications'];}if(_0x5af5e9[_0xa57c('0x36')][_0xa57c('0x3d')]){delete _0x5af5e9['account'][_0xa57c('0x3d')];}if(_0xae87[_0xa57c('0x3d')][_0xa57c('0x38')][_0xa57c('0x44')]){return _0xae87[_0xa57c('0x3d')][_0xa57c('0x38')][0x0];}var _0x4fc413=_['defaults'](_0x5a5490['body'],{'firstName':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x35')],'ListId':_0xae87[_0xa57c('0x47')]});_0x4fc413[_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x31')]]=_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x35')];return db[_0xa57c('0x2e')]['create'](_0x4fc413);}else{throw new Error('List\x20not\x20found');}})[_0xa57c('0xe')](function(_0x4e18ad){_0x5af5e9[_0xa57c('0x48')]=_0x4e18ad;if(_0x4e18ad){if(!_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['messageId']){_0x5a5490[_0xa57c('0x2a')]['message'][_0xa57c('0x49')]=rs['generate']()+'\x20'+_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x35')];}var _0x26a8e1={'ContactId':_0x4e18ad['id'],'MailAccountId':_0x5a5490['account']['id'],'inReplyTo':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x49')],'to':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['from'],'cc':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['cc'],'subject':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4a')],'attach':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4b')],'lastMsgAt':moment()[_0xa57c('0x4c')](_0xa57c('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xa57c('0x26')]({'where':{'closed':![],'MailAccountId':_0x5a5490[_0xa57c('0x36')]['id']},'include':[{'model':db[_0xa57c('0x4e')],'as':_0xa57c('0x4f'),'attributes':[_0xa57c('0x49')],'where':{'messageId':_0x5a5490[_0xa57c('0x2a')]['message'][_0xa57c('0x50')]}}]})[_0xa57c('0xe')](function(_0x521acc){if(_0x521acc){return[_0x521acc,![]];}return db[_0xa57c('0x51')][_0xa57c('0x52')](_0x26a8e1)[_0xa57c('0xe')](function(_0xa78a75){return[_0xa78a75,!![]];});});}else{throw new Error(_0xa57c('0x53'));}})[_0xa57c('0x54')](function(_0x24efa0,_0x5e1103){if(_0x24efa0){_0x520383=_0x5e1103;if(!_0x5e1103){return _0x24efa0[_0xa57c('0x55')]({'inReplyTo':_0x5a5490['body'][_0xa57c('0x16')]['messageId'],'to':_0x5a5490[_0xa57c('0x2a')]['message'][_0xa57c('0x35')],'cc':_0x5a5490[_0xa57c('0x2a')]['message']['cc'],'subject':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4a')],'attach':_0x24efa0[_0xa57c('0x4b')]?_0x24efa0['attach']:_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4b')],'substatus':null,'substatusAt':moment()[_0xa57c('0x4c')](_0xa57c('0x4d')),'lastMsgAt':moment()[_0xa57c('0x4c')](_0xa57c('0x4d')),'lastMsgDirection':'in'});}else{return _0x24efa0;}}})[_0xa57c('0xe')](function(_0x11c13e){_0x5af5e9[_0xa57c('0x56')]=_0x11c13e[_0xa57c('0x57')]({'plain':!![]});_0x5af5e9[_0xa57c('0x56')][_0xa57c('0x58')]=_0x520383;return db[_0xa57c('0x4e')][_0xa57c('0x52')]({'body':_0x5a5490[_0xa57c('0x2a')]['body'],'MailAccountId':_0x5a5490[_0xa57c('0x36')]['id'],'MailInteractionId':_0x11c13e['id'],'direction':'in','ContactId':_0x5af5e9['contact']['id'],'messageId':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x49')],'from':_0x5a5490['body'][_0xa57c('0x16')][_0xa57c('0x35')],'to':_0x5a5490[_0xa57c('0x2a')]['message']['to'],'cc':_0x5a5490['body'][_0xa57c('0x16')]['cc'],'subject':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4a')],'attach':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4b')],'Attachments':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['attachments'],'originTo':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['originTo'],'originCc':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x59')],'bcc':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x5a')],'ChatWebsiteId':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['ChatWebsiteId']||null,'originChannel':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['originChannel']||_0xa57c('0x5b'),'ChatOfflineMessageId':_0x5a5490[_0xa57c('0x2a')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xa57c('0x5c')],'as':_0xa57c('0x5d')}]});})[_0xa57c('0xe')](function(_0x1604d6){_0x5af5e9[_0xa57c('0x16')]=_0x1604d6;if(_0x5af5e9['interaction'][_0xa57c('0x5e')]){return db[_0xa57c('0x5f')][_0xa57c('0x26')]({'attributes':['id','name'],'where':{'id':_0x5af5e9[_0xa57c('0x56')]['UserId']}})[_0xa57c('0xe')](function(_0x2963cb){if(_0x2963cb){_0x5af5e9[_0xa57c('0x3f')][_0xa57c('0x60')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2963cb[_0xa57c('0x61')]+','+(_0x5af5e9[_0xa57c('0x36')][_0xa57c('0x62')]||0xa),'interval':_0xa57c('0x46')});}return respondWithRpcPromise('Start',_0xa57c('0x63'),_0x5af5e9);});}return respondWithRpcPromise(_0xa57c('0x64'),_0xa57c('0x63'),_0x5af5e9);})['then'](function(_0x3da413){_0x5e10b(_0x3da413);})[_0xa57c('0x18')](function(_0x2ed4f4){_0x203375(_0x5ed42d['error'](0x1f4,_0x2ed4f4[_0xa57c('0x16')]));});});}; \ No newline at end of file +var _0x66fa=['ShowMailAccount','smtp','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','Applications','MailServerOut','Smtp','List','get','omit','smtpOptions','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','catch'];(function(_0xd2b0fa,_0x21e1f2){var _0x38f7e9=function(_0x31f580){while(--_0x31f580){_0xd2b0fa['push'](_0xd2b0fa['shift']());}};_0x38f7e9(++_0x21e1f2);}(_0x66fa,0x117));var _0xa66f=function(_0x59dbe1,_0x2d1688){_0x59dbe1=_0x59dbe1-0x0;var _0xfd6584=_0x66fa[_0x59dbe1];return _0xfd6584;};'use strict';var _=require(_0xa66f('0x0'));var moment=require(_0xa66f('0x1'));var BPromise=require('bluebird');var rs=require(_0xa66f('0x2'));var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var logger=require(_0xa66f('0x5'))(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var jayson=require(_0xa66f('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0xa66f('0x9')]=_[_0xa66f('0xa')](config[_0xa66f('0x9')],{'host':_0xa66f('0xb'),'port':0x18eb});var socket=require(_0xa66f('0xc'))(new Redis(config['redis']));require(_0xa66f('0xd'))['register'](socket);function respondWithRpcPromise(_0x46c788,_0x597c7c,_0x101e10){return new BPromise(function(_0x53ca76,_0x52d802){return client['request'](_0x46c788,_0x101e10)[_0xa66f('0xe')](function(_0x825868){logger['info'](_0xa66f('0xf'),_0x597c7c,'request\x20sent');logger[_0xa66f('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x597c7c,_0xa66f('0x11'),JSON[_0xa66f('0x12')](_0x825868));if(_0x825868[_0xa66f('0x13')]){if(_0x825868['error']['code']===0x1f4){logger[_0xa66f('0x13')]('MailAccount,\x20%s,\x20%s',_0x597c7c,_0x825868['error']['message']);return _0x52d802(_0x825868[_0xa66f('0x13')][_0xa66f('0x14')]);}logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x825868[_0xa66f('0x13')]['message']);return _0x53ca76(_0x825868['error'][_0xa66f('0x14')]);}else{logger[_0xa66f('0x15')](_0xa66f('0xf'),_0x597c7c,_0xa66f('0x11'));_0x53ca76(_0x825868['result'][_0xa66f('0x14')]);}})['catch'](function(_0x4a28d4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x4a28d4);_0x52d802(_0x4a28d4);});});}exports[_0xa66f('0x16')]=function(_0x355ddc){var _0x2c5b76=this;return new Promise(function(_0x408bc7,_0x251f60){return db[_0xa66f('0x17')][_0xa66f('0x18')]({'raw':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x355ddc['options']?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'limit':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')]['limit']||null:null,'include':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x355ddc['options']['include'],function(_0xed98b9){return{'model':db[_0xed98b9['model']],'as':_0xed98b9['as'],'attributes':_0xed98b9[_0xa66f('0x1c')],'include':_0xed98b9[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0xed98b9['include'],function(_0x4683c7){return{'model':db[_0x4683c7[_0xa66f('0x1f')]],'as':_0x4683c7['as'],'attributes':_0x4683c7[_0xa66f('0x1c')],'include':_0x4683c7[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x4683c7[_0xa66f('0x1d')],function(_0x1eb86a){return{'model':db[_0x1eb86a[_0xa66f('0x1f')]],'as':_0x1eb86a['as'],'attributes':_0x1eb86a[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xe')](function(_0x45f71c){logger[_0xa66f('0x15')](_0xa66f('0x16'),_0x355ddc);logger[_0xa66f('0x10')]('GetMailAccount',_0x355ddc,JSON['stringify'](_0x45f71c));_0x408bc7(_0x45f71c);})[_0xa66f('0x20')](function(_0x27ceae){logger['error'](_0xa66f('0x16'),_0x27ceae[_0xa66f('0x14')],_0x355ddc);_0x251f60(_0x2c5b76['error'](0x1f4,_0x27ceae[_0xa66f('0x14')]));});});};exports[_0xa66f('0x21')]=function(_0x9d78d5){var _0x2c2ace=this;return new Promise(function(_0x395623,_0x548add){return db[_0xa66f('0x17')]['find']({'raw':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'include':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')],function(_0x35ef27){return{'model':db[_0x35ef27[_0xa66f('0x1f')]],'as':_0x35ef27['as'],'attributes':_0x35ef27['attributes'],'include':_0x35ef27[_0xa66f('0x1d')]?_['map'](_0x35ef27[_0xa66f('0x1d')],function(_0x46f6cc){return{'model':db[_0x46f6cc[_0xa66f('0x1f')]],'as':_0x46f6cc['as'],'attributes':_0x46f6cc[_0xa66f('0x1c')],'include':_0x46f6cc[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x46f6cc[_0xa66f('0x1d')],function(_0xcee582){return{'model':db[_0xcee582['model']],'as':_0xcee582['as'],'attributes':_0xcee582[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4477cf){if(_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x22')]===!![])_0x4477cf['setDataValue']('smtpOptions',_0x4477cf[_0xa66f('0x23')]());logger[_0xa66f('0x15')](_0xa66f('0x21'),_0x9d78d5);logger[_0xa66f('0x10')](_0xa66f('0x21'),_0x9d78d5,JSON['stringify'](_0x4477cf));_0x395623(_0x4477cf);})['catch'](function(_0x49b869){logger[_0xa66f('0x13')]('ShowMailAccount',_0x49b869['message'],_0x9d78d5);_0x548add(_0x2c2ace['error'](0x1f4,_0x49b869[_0xa66f('0x14')]));});});};exports['NotifyMailAccount']=function(_0x8965d3){var _0x17d942=this;return new Promise(function(_0x23a546,_0x1647a0){var _0xd65c5d={'body':_0x8965d3[_0xa66f('0x24')],'channel':_0xa66f('0x25')};var _0x261089=_[_0xa66f('0x26')](_[_0xa66f('0x27')](db[_0xa66f('0x28')][_0xa66f('0x29')]),[_0xa66f('0x2a'),_0xa66f('0x2b'),'CompanyId',_0xa66f('0x2c')]);var _0x25c2cb=![];if(_0x8965d3['body']['id']){delete _0x8965d3[_0xa66f('0x24')]['id'];}if(_['isNil'](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')])){return _0x1647a0(_0x17d942['error'](0x1f4,_0xa66f('0x2e')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')]['body'])||_0x8965d3[_0xa66f('0x24')]['body']===''){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x30')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x32')+_0x261089));}if(!_['includes'](_0x261089,_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x33')+_0x261089));}var _0x374e53={};_0x374e53[_0x8965d3['body']['mapKey']]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x17')][_0xa66f('0x34')]({'where':{'id':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x36')],'as':'List','include':[{'model':db[_0xa66f('0x28')],'as':_0xa66f('0x37'),'where':_0x374e53,'limit':0x1,'order':[[_0xa66f('0x2b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xa66f('0x38')},{'model':db[_0xa66f('0x39')],'as':_0xa66f('0x3a'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x19e7ce){if(_0x19e7ce&&_0x19e7ce[_0xa66f('0x3b')]){var _0x40d3b6=_0x19e7ce[_0xa66f('0x3c')]({'plain':!![]});_0xd65c5d[_0xa66f('0x35')]=_[_0xa66f('0x3d')](_0x40d3b6,[_0xa66f('0x38'),_0xa66f('0x3b')]);_0xd65c5d['account'][_0xa66f('0x3e')]=_0x19e7ce[_0xa66f('0x23')]();_0xd65c5d[_0xa66f('0x3f')]=_0x40d3b6[_0xa66f('0x38')];_0xd65c5d[_0xa66f('0x40')]=_0x40d3b6[_0xa66f('0x3b')];_0xd65c5d['applications']=_[_0xa66f('0x41')](_0xd65c5d[_0xa66f('0x3f')],[_0xa66f('0x42')],[_0xa66f('0x43')]);if(_0xd65c5d[_0xa66f('0x35')]&&_0xd65c5d['account'][_0xa66f('0x44')]){_0xd65c5d['applications'][_0xa66f('0x45')]({'id':0x0,'priority':_0xd65c5d['applications']['length']+0x1,'app':_0xa66f('0x46'),'appdata':_0xa66f('0x44'),'interval':_0xa66f('0x47')});}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x38')]){delete _0xd65c5d[_0xa66f('0x35')]['Applications'];}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')]){delete _0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')];}if(_0x40d3b6['List'][_0xa66f('0x37')]['length']){return _0x40d3b6[_0xa66f('0x3b')][_0xa66f('0x37')][0x0];}var _0x21482f=_[_0xa66f('0xa')](_0x8965d3[_0xa66f('0x24')],{'firstName':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')],'ListId':_0x40d3b6['ListId']});_0x21482f[_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')]]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x28')][_0xa66f('0x48')](_0x21482f);}else{throw new Error(_0xa66f('0x49'));}})[_0xa66f('0xe')](function(_0x350fce){_0xd65c5d['contact']=_0x350fce;if(_0x350fce){if(!_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')]){_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')]=rs[_0xa66f('0x4b')]()+'\x20'+_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x2d')];}var _0x11c89e={'ContactId':_0x350fce['id'],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'inReplyTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x4a')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3['body']['message'][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['attach'],'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'};return db[_0xa66f('0x4f')][_0xa66f('0x34')]({'where':{'closed':![],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x50')],'as':_0xa66f('0x51'),'attributes':[_0xa66f('0x4a')],'where':{'messageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x52')]}}]})[_0xa66f('0xe')](function(_0x235e4f){if(_0x235e4f){return[_0x235e4f,![]];}return db[_0xa66f('0x4f')][_0xa66f('0x48')](_0x11c89e)[_0xa66f('0xe')](function(_0x41ffa7){return[_0x41ffa7,!![]];});});}else{throw new Error(_0xa66f('0x53'));}})['spread'](function(_0x52f22d,_0x46327d){if(_0x52f22d){_0x25c2cb=_0x46327d;if(!_0x46327d){return _0x52f22d[_0xa66f('0x54')]({'inReplyTo':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')],'to':_0x8965d3['body'][_0xa66f('0x14')]['from'],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['subject'],'attach':_0x52f22d[_0xa66f('0x55')]?_0x52f22d[_0xa66f('0x55')]:_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x55')],'substatus':null,'substatusAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'});}else{return _0x52f22d;}}})[_0xa66f('0xe')](function(_0x290323){_0xd65c5d[_0xa66f('0x56')]=_0x290323['get']({'plain':!![]});_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x57')]=_0x25c2cb;return db[_0xa66f('0x50')][_0xa66f('0x48')]({'body':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x24')],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'MailInteractionId':_0x290323['id'],'direction':'in','ContactId':_0xd65c5d[_0xa66f('0x58')]['id'],'messageId':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')],'from':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['to'],'cc':_0x8965d3[_0xa66f('0x24')]['message']['cc'],'subject':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')]['message']['attach'],'Attachments':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x59')],'originTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5a')],'originCc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5b')],'bcc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5c')],'ChatWebsiteId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5d')]||null,'originChannel':_0x8965d3[_0xa66f('0x24')]['message']['originChannel']||_0xa66f('0x5e'),'ChatOfflineMessageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0xa66f('0x60')}]});})['then'](function(_0x4feda0){_0xd65c5d['message']=_0x4feda0;if(_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]){return db[_0xa66f('0x62')][_0xa66f('0x34')]({'attributes':['id',_0xa66f('0x63')],'where':{'id':_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]}})[_0xa66f('0xe')](function(_0x1ee6e0){if(_0x1ee6e0){_0xd65c5d[_0xa66f('0x3f')][_0xa66f('0x64')]({'id':0x0,'priority':0x0,'app':_0xa66f('0x65'),'appdata':_0x1ee6e0[_0xa66f('0x63')]+','+(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x66')]||0xa),'interval':_0xa66f('0x47')});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);})['then'](function(_0xc4b32b){_0x23a546(_0xc4b32b);})[_0xa66f('0x20')](function(_0x2bb4e5){_0x1647a0(_0x17d942['error'](0x1f4,_0x2bb4e5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 55db739..d4640fc 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 _0x50a8=['removeListener','register','length','save','update'];(function(_0x4a6934,_0x1237f4){var _0x532acf=function(_0x5f49fe){while(--_0x5f49fe){_0x4a6934['push'](_0x4a6934['shift']());}};_0x532acf(++_0x1237f4);}(_0x50a8,0x193));var _0x850a=function(_0x307c57,_0x2ff9e5){_0x307c57=_0x307c57-0x0;var _0x232faa=_0x50a8[_0x307c57];return _0x232faa;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x850a('0x0'),'remove',_0x850a('0x1')];function createListener(_0xd71f18,_0x11c233){return function(_0x2c4e88){_0x11c233['emit'](_0xd71f18,_0x2c4e88);};}function removeListener(_0x5458e6,_0x5ca0f6){return function(){MailAccountEvents[_0x850a('0x2')](_0x5458e6,_0x5ca0f6);};}exports[_0x850a('0x3')]=function(_0x530b92){for(var _0x31c037=0x0,_0x4d74c5=events[_0x850a('0x4')];_0x31c037<_0x4d74c5;_0x31c037++){var _0x2cfc90=events[_0x31c037];var _0x245f43=createListener('mailAccount:'+_0x2cfc90,_0x530b92);MailAccountEvents['on'](_0x2cfc90,_0x245f43);}}; \ No newline at end of file +var _0xc7bb=['update','removeListener','register','mailAccount:','./mailAccount.events'];(function(_0x58f45e,_0x5ec2f6){var _0x155acd=function(_0x5aa35c){while(--_0x5aa35c){_0x58f45e['push'](_0x58f45e['shift']());}};_0x155acd(++_0x5ec2f6);}(_0xc7bb,0x158));var _0xbc7b=function(_0xcc9be2,_0x5e80e1){_0xcc9be2=_0xcc9be2-0x0;var _0x5174d1=_0xc7bb[_0xcc9be2];return _0x5174d1;};'use strict';var MailAccountEvents=require(_0xbc7b('0x0'));var events=['save','remove',_0xbc7b('0x1')];function createListener(_0x13843f,_0x46930e){return function(_0x4e9fd8){_0x46930e['emit'](_0x13843f,_0x4e9fd8);};}function removeListener(_0x460552,_0x450c65){return function(){MailAccountEvents[_0xbc7b('0x2')](_0x460552,_0x450c65);};}exports[_0xbc7b('0x3')]=function(_0x65a0c7){for(var _0x496d01=0x0,_0x21adf3=events['length'];_0x496d01<_0x21adf3;_0x496d01++){var _0x347e7d=events[_0x496d01];var _0x390afd=createListener(_0xbc7b('0x4')+_0x347e7d,_0x65a0c7);MailAccountEvents['on'](_0x347e7d,_0x390afd);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5606ecd..ffd107a 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 _0xae4b=['put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xae4b,0x1a9));var _0xbae4=function(_0x5553db,_0x3d3077){_0x5553db=_0x5553db-0x0;var _0xd7ec63=_0xae4b[_0x5553db];return _0xd7ec63;};'use strict';var multer=require(_0xbae4('0x0'));var util=require(_0xbae4('0x1'));var path=require(_0xbae4('0x2'));var timeout=require('connect-timeout');var express=require(_0xbae4('0x3'));var router=express['Router']();var fs_extra=require(_0xbae4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbae4('0x5'));var controller=require(_0xbae4('0x6'));router['get'](_0xbae4('0x7'),auth[_0xbae4('0x8')](),controller[_0xbae4('0x9')]);router[_0xbae4('0xa')]('/:id',auth[_0xbae4('0x8')](),controller[_0xbae4('0xb')]);router[_0xbae4('0xc')]('/:id',auth[_0xbae4('0x8')](),controller[_0xbae4('0xd')]);module[_0xbae4('0xe')]=router; \ No newline at end of file +var _0x76a0=['isAuthenticated','/:id','update','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x57d666,_0x589764){var _0x21f825=function(_0x213b18){while(--_0x213b18){_0x57d666['push'](_0x57d666['shift']());}};_0x21f825(++_0x589764);}(_0x76a0,0x180));var _0x076a=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x76a0[_0x2fbd0e];return _0x481c9f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x076a('0x0'));var timeout=require(_0x076a('0x1'));var express=require('express');var router=express[_0x076a('0x2')]();var fs_extra=require(_0x076a('0x3'));var auth=require(_0x076a('0x4'));var interaction=require(_0x076a('0x5'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router['get']('/:id',auth[_0x076a('0x6')](),controller['show']);router['put'](_0x076a('0x7'),auth[_0x076a('0x6')](),controller[_0x076a('0x8')]);router['delete'](_0x076a('0x7'),auth[_0x076a('0x6')](),controller['destroy']);module[_0x076a('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a9374b3..a2e4224 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 _0xaa01=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0xfad6b,_0x1c93a3){var _0x214ae5=function(_0x34059a){while(--_0x34059a){_0xfad6b['push'](_0xfad6b['shift']());}};_0x214ae5(++_0x1c93a3);}(_0xaa01,0x1dd));var _0x1aa0=function(_0x1e3963,_0x5abd8f){_0x1e3963=_0x1e3963-0x0;var _0x5d9385=_0xaa01[_0x1e3963];return _0x5d9385;};'use strict';var Sequelize=require(_0x1aa0('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1aa0('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1aa0('0x2')],'allowNull':![],'defaultValue':_0x1aa0('0x3')},'appdata':{'type':Sequelize[_0x1aa0('0x4')]()},'description':{'type':Sequelize[_0x1aa0('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1aa0('0x5')}}; \ No newline at end of file +var _0x9272=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0x9272,0x142));var _0x2927=function(_0x83898,_0x362fdc){_0x83898=_0x83898-0x0;var _0x539c77=_0x9272[_0x83898];return _0x539c77;};'use strict';var Sequelize=require(_0x2927('0x0'));module[_0x2927('0x1')]={'priority':{'type':Sequelize[_0x2927('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2927('0x3')],'allowNull':![],'defaultValue':_0x2927('0x4')},'appdata':{'type':Sequelize[_0x2927('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2927('0x3')],'defaultValue':_0x2927('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 05e69ca..f7809cd 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x2be6d9,_0xd31df5){var _0x45e38b=function(_0x1237b0){while(--_0x1237b0){_0x2be6d9['push'](_0x2be6d9['shift']());}};_0x45e38b(++_0xd31df5);}(_0x70e0,0x17b));var _0x070e=function(_0x37e6d8,_0x319512){_0x37e6d8=_0x37e6d8-0x0;var _0x15712f=_0x70e0[_0x37e6d8];return _0x15712f;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +var _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(_0x24e7d3,_0x46f920){var _0x3db220=function(_0x4d6ed5){while(--_0x4d6ed5){_0x24e7d3['push'](_0x24e7d3['shift']());}};_0x3db220(++_0x46f920);}(_0x54ef,0x112));var _0xf54e=function(_0x4df055,_0x5e1c45){_0x4df055=_0x4df055-0x0;var _0x52b3c4=_0x54ef[_0x4df055];return _0x52b3c4;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 1affe2d..9ac70a4 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 _0x1193=['exports','MailApplication','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1f459f,_0x21ac07){var _0x4a555b=function(_0x10a4ca){while(--_0x10a4ca){_0x1f459f['push'](_0x1f459f['shift']());}};_0x4a555b(++_0x21ac07);}(_0x1193,0x1cd));var _0x3119=function(_0x20ca86,_0x4140be){_0x20ca86=_0x20ca86-0x0;var _0x39d146=_0x1193[_0x20ca86];return _0x39d146;};'use strict';var _=require('lodash');var util=require(_0x3119('0x0'));var logger=require(_0x3119('0x1'))('api');var moment=require(_0x3119('0x2'));var BPromise=require(_0x3119('0x3'));var rp=require(_0x3119('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3119('0x5'));var config=require(_0x3119('0x6'));var attributes=require('./mailApplication.attributes');module[_0x3119('0x7')]=function(_0x18c358,_0x12034e){return _0x18c358['define'](_0x3119('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe50d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1859cb,_0x4b44b9){var _0x3b5c24=function(_0x5c2ee3){while(--_0x5c2ee3){_0x1859cb['push'](_0x1859cb['shift']());}};_0x3b5c24(++_0x4b44b9);}(_0xe50d,0x19e));var _0xde50=function(_0x477611,_0x133172){_0x477611=_0x477611-0x0;var _0x4c1287=_0xe50d[_0x477611];return _0x4c1287;};'use strict';var _=require(_0xde50('0x0'));var util=require(_0xde50('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xde50('0x2'));var BPromise=require(_0xde50('0x3'));var rp=require(_0xde50('0x4'));var fs=require('fs');var path=require(_0xde50('0x5'));var rimraf=require(_0xde50('0x6'));var config=require(_0xde50('0x7'));var attributes=require(_0xde50('0x8'));module[_0xde50('0x9')]=function(_0x2c42d2,_0x3a8d22){return _0x2c42d2['define']('MailApplication',attributes,{'tableName':_0xde50('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde50('0xb'),'collate':_0xde50('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index ca04ce7..ace0853 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 _0xe0ce=['body','options','raw','where','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update'];(function(_0x558838,_0x38c6da){var _0x337d6b=function(_0x1b48be){while(--_0x1b48be){_0x558838['push'](_0x558838['shift']());}};_0x337d6b(++_0x38c6da);}(_0xe0ce,0x198));var _0xee0c=function(_0x36d221,_0x268765){_0x36d221=_0x36d221-0x0;var _0x15cb44=_0xe0ce[_0x36d221];return _0x15cb44;};'use strict';var _=require(_0xee0c('0x0'));var util=require('util');var moment=require(_0xee0c('0x1'));var BPromise=require('bluebird');var rs=require(_0xee0c('0x2'));var fs=require('fs');var Redis=require(_0xee0c('0x3'));var db=require(_0xee0c('0x4'))['db'];var utils=require(_0xee0c('0x5'));var logger=require(_0xee0c('0x6'))('rpc');var config=require(_0xee0c('0x7'));var jayson=require(_0xee0c('0x8'));var client=jayson['client'][_0xee0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1430f5,_0xb28f0f,_0x5a821b){return new BPromise(function(_0x216472,_0x1ad57f){return client[_0xee0c('0xa')](_0x1430f5,_0x5a821b)[_0xee0c('0xb')](function(_0x2f5364){logger[_0xee0c('0xc')](_0xee0c('0xd'),_0xb28f0f,_0xee0c('0xe'));logger[_0xee0c('0xf')](_0xee0c('0x10'),_0xb28f0f,'request\x20sent',JSON[_0xee0c('0x11')](_0x2f5364));if(_0x2f5364[_0xee0c('0x12')]){if(_0x2f5364['error'][_0xee0c('0x13')]===0x1f4){logger[_0xee0c('0x12')](_0xee0c('0xd'),_0xb28f0f,_0x2f5364['error'][_0xee0c('0x14')]);return _0x1ad57f(_0x2f5364[_0xee0c('0x12')][_0xee0c('0x14')]);}logger['error'](_0xee0c('0xd'),_0xb28f0f,_0x2f5364[_0xee0c('0x12')][_0xee0c('0x14')]);return _0x216472(_0x2f5364[_0xee0c('0x12')][_0xee0c('0x14')]);}else{logger['info'](_0xee0c('0xd'),_0xb28f0f,_0xee0c('0xe'));_0x216472(_0x2f5364[_0xee0c('0x15')]['message']);}})[_0xee0c('0x16')](function(_0x4f1539){logger[_0xee0c('0x12')](_0xee0c('0xd'),_0xb28f0f,_0x4f1539);_0x1ad57f(_0x4f1539);});});}exports[_0xee0c('0x17')]=function(_0x135787){var _0x4cebd6=this;return new Promise(function(_0x373c6c,_0x45b56f){return db[_0xee0c('0x18')][_0xee0c('0x19')](_0x135787[_0xee0c('0x1a')],{'raw':_0x135787[_0xee0c('0x1b')]?_0x135787['options'][_0xee0c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x135787[_0xee0c('0x1b')]?_0x135787[_0xee0c('0x1b')][_0xee0c('0x1d')]||null:null,'attributes':_0x135787[_0xee0c('0x1b')]?_0x135787[_0xee0c('0x1b')][_0xee0c('0x1e')]||null:null,'limit':_0x135787[_0xee0c('0x1b')]?_0x135787[_0xee0c('0x1b')]['limit']||null:null})[_0xee0c('0xb')](function(_0x1c2f79){logger['info'](_0xee0c('0x17'),_0x135787);logger['debug'](_0xee0c('0x17'),_0x135787,JSON['stringify'](_0x1c2f79));_0x373c6c(_0x1c2f79);})[_0xee0c('0x16')](function(_0x3c5e32){logger[_0xee0c('0x12')](_0xee0c('0x17'),_0x3c5e32[_0xee0c('0x14')],_0x135787);_0x45b56f(_0x4cebd6['error'](0x1f4,_0x3c5e32[_0xee0c('0x14')]));});});}; \ No newline at end of file +var _0xafad=['jayson/promise','client','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','result','MailApplication','body','options','raw','where','UpdateMailApplication','catch','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x28cc72,_0x2c0643){var _0xed74ab=function(_0x5e02c8){while(--_0x5e02c8){_0x28cc72['push'](_0x28cc72['shift']());}};_0xed74ab(++_0x2c0643);}(_0xafad,0x13b));var _0xdafa=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0xafad[_0x374ada];return _0x449ed8;};'use strict';var _=require(_0xdafa('0x0'));var util=require(_0xdafa('0x1'));var moment=require(_0xdafa('0x2'));var BPromise=require('bluebird');var rs=require(_0xdafa('0x3'));var fs=require('fs');var Redis=require(_0xdafa('0x4'));var db=require(_0xdafa('0x5'))['db'];var utils=require(_0xdafa('0x6'));var logger=require('../../config/logger')(_0xdafa('0x7'));var config=require(_0xdafa('0x8'));var jayson=require(_0xdafa('0x9'));var client=jayson[_0xdafa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b94d8,_0x51be2b,_0x463386){return new BPromise(function(_0x5a3d54,_0x4fa412){return client['request'](_0x2b94d8,_0x463386)[_0xdafa('0xb')](function(_0xaca783){logger[_0xdafa('0xc')](_0xdafa('0xd'),_0x51be2b,_0xdafa('0xe'));logger[_0xdafa('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x51be2b,'request\x20sent',JSON[_0xdafa('0x10')](_0xaca783));if(_0xaca783[_0xdafa('0x11')]){if(_0xaca783['error']['code']===0x1f4){logger[_0xdafa('0x11')](_0xdafa('0xd'),_0x51be2b,_0xaca783[_0xdafa('0x11')]['message']);return _0x4fa412(_0xaca783['error']['message']);}logger[_0xdafa('0x11')](_0xdafa('0xd'),_0x51be2b,_0xaca783[_0xdafa('0x11')]['message']);return _0x5a3d54(_0xaca783[_0xdafa('0x11')]['message']);}else{logger[_0xdafa('0xc')]('MailApplication,\x20%s,\x20%s',_0x51be2b,'request\x20sent');_0x5a3d54(_0xaca783[_0xdafa('0x12')]['message']);}})['catch'](function(_0x551267){logger[_0xdafa('0x11')](_0xdafa('0xd'),_0x51be2b,_0x551267);_0x4fa412(_0x551267);});});}exports['UpdateMailApplication']=function(_0x50a636){var _0x587f2b=this;return new Promise(function(_0x4fb66c,_0x49fdf3){return db[_0xdafa('0x13')]['update'](_0x50a636[_0xdafa('0x14')],{'raw':_0x50a636[_0xdafa('0x15')]?_0x50a636[_0xdafa('0x15')][_0xdafa('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50a636[_0xdafa('0x15')]?_0x50a636[_0xdafa('0x15')][_0xdafa('0x17')]||null:null,'attributes':_0x50a636[_0xdafa('0x15')]?_0x50a636[_0xdafa('0x15')]['attributes']||null:null,'limit':_0x50a636[_0xdafa('0x15')]?_0x50a636[_0xdafa('0x15')]['limit']||null:null})['then'](function(_0x28c486){logger['info']('UpdateMailApplication',_0x50a636);logger[_0xdafa('0xf')](_0xdafa('0x18'),_0x50a636,JSON[_0xdafa('0x10')](_0x28c486));_0x4fb66c(_0x28c486);})[_0xdafa('0x19')](function(_0x179710){logger[_0xdafa('0x11')](_0xdafa('0x18'),_0x179710[_0xdafa('0x1a')],_0x50a636);_0x49fdf3(_0x587f2b[_0xdafa('0x11')](0x1f4,_0x179710[_0xdafa('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index aedd082..d0a95c1 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 _0x944f=['getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','put','mailinteraction:update','update','tracked','destroy','delete','removeTags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x944f,0x154));var _0xf944=function(_0x49ca6b,_0x3ba842){_0x49ca6b=_0x49ca6b-0x0;var _0x1d957f=_0x944f[_0x49ca6b];return _0x1d957f;};'use strict';var express=require(_0xf944('0x0'));var router=express['Router']();var auth=require(_0xf944('0x1'));var interaction=require(_0xf944('0x2'));var controller=require(_0xf944('0x3'));router[_0xf944('0x4')]('/',auth[_0xf944('0x5')](),controller['index']);router[_0xf944('0x4')](_0xf944('0x6'),auth[_0xf944('0x5')](),controller[_0xf944('0x7')]);router[_0xf944('0x4')](_0xf944('0x8'),auth[_0xf944('0x5')](),controller[_0xf944('0x9')]);router[_0xf944('0x4')](_0xf944('0xa'),auth[_0xf944('0x5')](),controller[_0xf944('0xb')]);router['get'](_0xf944('0xc'),auth[_0xf944('0x5')](),controller[_0xf944('0xd')]);router[_0xf944('0xe')]('/',auth['isAuthenticated'](),controller[_0xf944('0xf')]);router['post'](_0xf944('0xa'),auth[_0xf944('0x5')](),controller[_0xf944('0x10')]);router[_0xf944('0xe')](_0xf944('0x11'),auth[_0xf944('0x5')](),interaction['tracked'](_0xf944('0x12'),'mailinteraction:addtags'),controller['addTags']);router[_0xf944('0x13')]('/:id',auth[_0xf944('0x5')](),interaction['tracked'](_0xf944('0x12'),_0xf944('0x14')),controller[_0xf944('0x15')]);router['delete'](_0xf944('0x8'),auth[_0xf944('0x5')](),interaction[_0xf944('0x16')]('mail','mailinteraction:destroy'),controller[_0xf944('0x17')]);router[_0xf944('0x18')]('/:id/tags',auth[_0xf944('0x5')](),controller[_0xf944('0x19')]);module[_0xf944('0x1a')]=router; \ No newline at end of file +var _0x9409=['mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','tracked','destroy','removeTags','exports','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags'];(function(_0x5102eb,_0x73cfe5){var _0x36bae9=function(_0x52dea9){while(--_0x52dea9){_0x5102eb['push'](_0x5102eb['shift']());}};_0x36bae9(++_0x73cfe5);}(_0x9409,0x1af));var _0x9940=function(_0x29f258,_0x559572){_0x29f258=_0x29f258-0x0;var _0x1315c7=_0x9409[_0x29f258];return _0x1315c7;};'use strict';var express=require(_0x9940('0x0'));var router=express['Router']();var auth=require(_0x9940('0x1'));var interaction=require(_0x9940('0x2'));var controller=require('./mailInteraction.controller');router[_0x9940('0x3')]('/',auth[_0x9940('0x4')](),controller[_0x9940('0x5')]);router['get'](_0x9940('0x6'),auth[_0x9940('0x4')](),controller[_0x9940('0x7')]);router[_0x9940('0x3')](_0x9940('0x8'),auth[_0x9940('0x4')](),controller[_0x9940('0x9')]);router[_0x9940('0x3')](_0x9940('0xa'),auth[_0x9940('0x4')](),controller[_0x9940('0xb')]);router[_0x9940('0x3')](_0x9940('0xc'),auth['isAuthenticated'](),controller[_0x9940('0xd')]);router[_0x9940('0xe')]('/',auth[_0x9940('0x4')](),controller[_0x9940('0xf')]);router[_0x9940('0xe')]('/:id/messages',auth[_0x9940('0x4')](),controller['addMessage']);router[_0x9940('0xe')](_0x9940('0x10'),auth[_0x9940('0x4')](),interaction['tracked'](_0x9940('0x11'),_0x9940('0x12')),controller[_0x9940('0x13')]);router[_0x9940('0x14')]('/:id',auth[_0x9940('0x4')](),interaction['tracked'](_0x9940('0x11'),_0x9940('0x15')),controller[_0x9940('0x16')]);router[_0x9940('0x17')]('/:id',auth[_0x9940('0x4')](),interaction[_0x9940('0x18')](_0x9940('0x11'),'mailinteraction:destroy'),controller[_0x9940('0x19')]);router[_0x9940('0x17')](_0x9940('0x10'),auth[_0x9940('0x4')](),controller[_0x9940('0x1a')]);module[_0x9940('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 16deb56..186cd92 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 _0x4dd1=['out','DATE','sequelize','exports','BOOLEAN','STRING','TEXT','long','ENUM'];(function(_0x30ed24,_0x1d037d){var _0x50cdb1=function(_0x4ebd67){while(--_0x4ebd67){_0x30ed24['push'](_0x30ed24['shift']());}};_0x50cdb1(++_0x1d037d);}(_0x4dd1,0xbf));var _0x14dd=function(_0x2bfa25,_0x51fb43){_0x2bfa25=_0x2bfa25-0x0;var _0x1bc227=_0x4dd1[_0x2bfa25];return _0x1bc227;};'use strict';var Sequelize=require(_0x14dd('0x0'));var iconv=require('iconv');module[_0x14dd('0x1')]={'closed':{'type':Sequelize[_0x14dd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x14dd('0x3')]},'thirdDisposition':{'type':Sequelize[_0x14dd('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x14dd('0x3')](0x1fe)},'to':{'type':Sequelize[_0x14dd('0x3')]},'cc':{'type':Sequelize[_0x14dd('0x4')](_0x14dd('0x5'))},'subject':{'type':Sequelize[_0x14dd('0x4')]()},'attach':{'type':Sequelize[_0x14dd('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x14dd('0x6')]('in',_0x14dd('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x14dd('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x14dd('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x14dd('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbdba=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0x9841ff,_0x4b5467){var _0x2d6f38=function(_0x2021ba){while(--_0x2021ba){_0x9841ff['push'](_0x9841ff['shift']());}};_0x2d6f38(++_0x4b5467);}(_0xbdba,0xc7));var _0xabdb=function(_0x3f665d,_0x5704e7){_0x3f665d=_0x3f665d-0x0;var _0x2f3044=_0xbdba[_0x3f665d];return _0x2f3044;};'use strict';var Sequelize=require(_0xabdb('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0xabdb('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xabdb('0x2')]},'disposition':{'type':Sequelize[_0xabdb('0x3')]},'secondDisposition':{'type':Sequelize[_0xabdb('0x3')]},'thirdDisposition':{'type':Sequelize[_0xabdb('0x3')]},'note':{'type':Sequelize[_0xabdb('0x3')]},'inReplyTo':{'type':Sequelize[_0xabdb('0x3')](0x1fe)},'to':{'type':Sequelize[_0xabdb('0x3')]},'cc':{'type':Sequelize[_0xabdb('0x4')](_0xabdb('0x5'))},'subject':{'type':Sequelize[_0xabdb('0x4')]()},'attach':{'type':Sequelize[_0xabdb('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xabdb('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xabdb('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xabdb('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xabdb('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xabdb('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xabdb('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 3624899..35a5f7b 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 _0xd8ee=['options','find','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','findOne','filters','nolimit','order','sort','pick','where','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','Tag','color','removeTags','download','unix','toString','join','files','tmp','root','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','then','status','stack','name','send','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','catch','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','include','merge'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x47fa5b,_0x31323c){_0x47fa5b=_0x47fa5b-0x0;var _0x3b10ca=_0xd8ee[_0x47fa5b];return _0x3b10ca;};'use strict';var emlformat=require(_0xed8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed8e('0x1'));var moment=require(_0xed8e('0x2'));var BPromise=require(_0xed8e('0x3'));var util=require('util');var path=require(_0xed8e('0x4'));var fs=require('fs');var _=require(_0xed8e('0x5'));var juice=require(_0xed8e('0x6'));var Redis=require(_0xed8e('0x7'));var interaction=require(_0xed8e('0x8'));var qs=require(_0xed8e('0x9'));var logger=require('../../config/logger')(_0xed8e('0xa'));var config=require(_0xed8e('0xb'));var db=require(_0xed8e('0xc'))['db'];var htmlEntities=require(_0xed8e('0xd'));config[_0xed8e('0xe')]=_[_0xed8e('0xf')](config[_0xed8e('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed8e('0xe')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3edaee,_0x5b9066){_0x5b9066=_0x5b9066||0xcc;return function(_0x7357ad){if(_0x7357ad){return _0x3edaee[_0xed8e('0x10')](_0x5b9066);}return _0x3edaee['status'](_0x5b9066)[_0xed8e('0x11')]();};}function respondWithResult(_0x128b6e,_0x5aa728){_0x5aa728=_0x5aa728||0xc8;return function(_0x409f8f){if(_0x409f8f){return _0x128b6e['status'](_0x5aa728)[_0xed8e('0x12')](_0x409f8f);}};}function respondWithFilteredResult(_0x20f34b,_0x2d9925){return function(_0xd4559b){if(_0xd4559b){var _0x35a6db=typeof _0x2d9925[_0xed8e('0x13')]===_0xed8e('0x14')&&typeof _0x2d9925[_0xed8e('0x15')]===_0xed8e('0x14');var _0x17b3c7=_0xd4559b[_0xed8e('0x16')];var _0x28dd7b=_0x35a6db?0x0:_0x2d9925[_0xed8e('0x13')];var _0x4cefe4=_0x35a6db?_0xd4559b[_0xed8e('0x16')]:_0x2d9925['offset']+_0x2d9925[_0xed8e('0x15')];var _0xec2257;if(_0x4cefe4>=_0x17b3c7){_0x4cefe4=_0x17b3c7;_0xec2257=0xc8;}else{_0xec2257=0xce;}_0x20f34b['status'](_0xec2257);return _0x20f34b[_0xed8e('0x17')](_0xed8e('0x18'),_0x28dd7b+'-'+_0x4cefe4+'/'+_0x17b3c7)[_0xed8e('0x12')](_0xd4559b);}return null;};}function saveUpdates(_0x51d6a2){return function(_0x4a19d9){if(_0x4a19d9){return _0x4a19d9['update'](_0x51d6a2)[_0xed8e('0x19')](function(_0x1c8ceb){return _0x1c8ceb;});}return null;};}function removeEntity(_0x1ff8d9){return function(_0x421e50){if(_0x421e50){return _0x421e50['destroy']()['then'](function(){_0x1ff8d9[_0xed8e('0x1a')](0xcc)[_0xed8e('0x11')]();});}};}function handleEntityNotFound(_0x29e6ca){return function(_0x2a4c3f){if(!_0x2a4c3f){_0x29e6ca[_0xed8e('0x10')](0x194);}return _0x2a4c3f;};}function handleError(_0x5a042a,_0x5619b2){_0x5619b2=_0x5619b2||0x1f4;return function(_0xe2f3da){logger['error'](_0xe2f3da[_0xed8e('0x1b')]);if(_0xe2f3da[_0xed8e('0x1c')]){delete _0xe2f3da['name'];}_0x5a042a[_0xed8e('0x1a')](_0x5619b2)[_0xed8e('0x1d')](_0xe2f3da);};}exports['index']=function(_0x65fe20,_0x4986cf){var _0x53f9d0={};var _0x26c644=_[_0xed8e('0x1e')](db[_0xed8e('0x1f')][_0xed8e('0x20')],function(_0x177e05){return{'name':_0x177e05[_0xed8e('0x21')],'type':_0x177e05[_0xed8e('0x22')][_0xed8e('0x23')]};});_0x53f9d0=qs[_0xed8e('0x24')](_0x26c644,_0x65fe20);return interaction[_0xed8e('0x25')](_0xed8e('0x26'),_0x65fe20['query'],_0x65fe20['user'],_0x53f9d0,_0x26c644)['then'](respondWithFilteredResult(_0x4986cf,_0x53f9d0))[_0xed8e('0x27')](handleError(_0x4986cf,null));};exports[_0xed8e('0x28')]=function(_0x56ca88,_0x112f4b){var _0x518537={'raw':![],'where':{'id':_0x56ca88[_0xed8e('0x29')]['id']}},_0x3531ce={};_0x3531ce[_0xed8e('0x2a')]=_[_0xed8e('0x2b')](db[_0xed8e('0x1f')][_0xed8e('0x20')]);_0x3531ce[_0xed8e('0x2c')]=_[_0xed8e('0x2b')](_0x56ca88[_0xed8e('0x2c')]);_0x3531ce['filters']=_[_0xed8e('0x2d')](_0x3531ce[_0xed8e('0x2a')],_0x3531ce[_0xed8e('0x2c')]);_0x518537[_0xed8e('0x2e')]=_[_0xed8e('0x2d')](_0x3531ce[_0xed8e('0x2a')],qs[_0xed8e('0x2f')](_0x56ca88[_0xed8e('0x2c')][_0xed8e('0x2f')]));_0x518537[_0xed8e('0x2e')]=_0x518537[_0xed8e('0x2e')][_0xed8e('0x30')]?_0x518537[_0xed8e('0x2e')]:_0x3531ce[_0xed8e('0x2a')];if(_0x56ca88[_0xed8e('0x2c')][_0xed8e('0x31')]){_0x518537[_0xed8e('0x32')]=[{'all':!![]}];}_0x518537=_[_0xed8e('0x33')]({},_0x518537,_0x56ca88[_0xed8e('0x34')]);return db[_0xed8e('0x1f')][_0xed8e('0x35')](_0x518537)[_0xed8e('0x19')](handleEntityNotFound(_0x112f4b,null))[_0xed8e('0x19')](respondWithResult(_0x112f4b,null))[_0xed8e('0x27')](handleError(_0x112f4b,null));};exports[_0xed8e('0x36')]=function(_0x49623c,_0x2b2e3a){return db[_0xed8e('0x1f')][_0xed8e('0x36')](_0x49623c[_0xed8e('0x37')],{})[_0xed8e('0x19')](respondWithResult(_0x2b2e3a,0xc9))['catch'](handleError(_0x2b2e3a,null));};exports['update']=function(_0x1b9f9e,_0x529e45){if(_0x1b9f9e[_0xed8e('0x37')]['id']){delete _0x1b9f9e[_0xed8e('0x37')]['id'];}return db[_0xed8e('0x1f')][_0xed8e('0x35')]({'where':{'id':_0x1b9f9e[_0xed8e('0x29')]['id']}})[_0xed8e('0x19')](handleEntityNotFound(_0x529e45,null))[_0xed8e('0x19')](saveUpdates(_0x1b9f9e[_0xed8e('0x37')],null))[_0xed8e('0x19')](respondWithResult(_0x529e45,null))['catch'](handleError(_0x529e45,null));};exports['destroy']=function(_0x2f80cd,_0x2760ca){return db[_0xed8e('0x1f')][_0xed8e('0x35')]({'where':{'id':_0x2f80cd[_0xed8e('0x29')]['id']}})['then'](handleEntityNotFound(_0x2760ca,null))['then'](removeEntity(_0x2760ca,null))[_0xed8e('0x27')](handleError(_0x2760ca,null));};exports[_0xed8e('0x38')]=function(_0x273a6f,_0x158d82){return db[_0xed8e('0x1f')][_0xed8e('0x38')]()[_0xed8e('0x19')](respondWithResult(_0x158d82,null))[_0xed8e('0x27')](handleError(_0x158d82,null));};exports[_0xed8e('0x39')]=function(_0x1e15c9,_0x4afea6){return db[_0xed8e('0x3a')]['find']({'where':{'id':_0x1e15c9[_0xed8e('0x29')]['id']}})[_0xed8e('0x19')](handleEntityNotFound(_0x4afea6,null))[_0xed8e('0x19')](function(_0x36ae79){if(_0x36ae79){return _0x36ae79[_0xed8e('0x39')](_0x1e15c9['body']['ids'],_[_0xed8e('0x3b')](_0x1e15c9['body'],[_0xed8e('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x4afea6,null))[_0xed8e('0x27')](handleError(_0x4afea6,null));};exports[_0xed8e('0x3d')]=function(_0x3d3a7a,_0x353c3e){var _0x329b89={'raw':![],'where':{}};var _0x16f14a={};var _0x47d211={'count':0x0,'rows':[]};return db['MailInteraction'][_0xed8e('0x3e')]({'where':{'id':_0x3d3a7a[_0xed8e('0x29')]['id']}})['then'](handleEntityNotFound(_0x353c3e,null))[_0xed8e('0x19')](function(_0x29c279){if(_0x29c279){_0x16f14a[_0xed8e('0x2a')]=_['keys'](db['MailMessage'][_0xed8e('0x20')]);_0x16f14a[_0xed8e('0x2c')]=_['keys'](_0x3d3a7a[_0xed8e('0x2c')]);_0x16f14a[_0xed8e('0x3f')]=_[_0xed8e('0x2d')](_0x16f14a[_0xed8e('0x2a')],_0x16f14a[_0xed8e('0x2c')]);_0x329b89[_0xed8e('0x2e')]=_[_0xed8e('0x2d')](_0x16f14a[_0xed8e('0x2a')],qs[_0xed8e('0x2f')](_0x3d3a7a[_0xed8e('0x2c')][_0xed8e('0x2f')]));_0x329b89['attributes']=_0x329b89[_0xed8e('0x2e')][_0xed8e('0x30')]?_0x329b89[_0xed8e('0x2e')]:_0x16f14a[_0xed8e('0x2a')];if(!_0x3d3a7a[_0xed8e('0x2c')]['hasOwnProperty'](_0xed8e('0x40'))){_0x329b89['limit']=qs[_0xed8e('0x15')](_0x3d3a7a['query'][_0xed8e('0x15')]);_0x329b89[_0xed8e('0x13')]=qs[_0xed8e('0x13')](_0x3d3a7a[_0xed8e('0x2c')][_0xed8e('0x13')]);}_0x329b89[_0xed8e('0x41')]=qs[_0xed8e('0x42')](_0x3d3a7a[_0xed8e('0x2c')]['sort']);_0x329b89['where']=qs[_0xed8e('0x3f')](_[_0xed8e('0x43')](_0x3d3a7a['query'],_0x16f14a[_0xed8e('0x3f')]));_0x329b89[_0xed8e('0x44')][_0xed8e('0x45')]=_0x29c279['id'];if(_0x3d3a7a[_0xed8e('0x2c')][_0xed8e('0x46')]){_0x329b89['where']=_[_0xed8e('0x33')](_0x329b89[_0xed8e('0x44')],{'$or':_[_0xed8e('0x1e')](_0x329b89['attributes'],function(_0x3c4a0c){var _0x107860={};_0x107860[_0x3c4a0c]={'$like':'%'+_0x3d3a7a[_0xed8e('0x2c')][_0xed8e('0x46')]+'%'};return _0x107860;})});}if(_0x3d3a7a['query'][_0xed8e('0x47')]){var _0x195943=_0x3d3a7a[_0xed8e('0x2c')]['$gte']['split'](',');var _0x4b139e={};_0x4b139e[_0x195943[0x0]]={'$gte':moment(_0x195943[0x1])[_0xed8e('0x48')](_0xed8e('0x49'))};_0x329b89[_0xed8e('0x44')]=_[_0xed8e('0x33')](_0x329b89[_0xed8e('0x44')],_0x4b139e);}_0x329b89=_['merge']({},_0x329b89,_0x3d3a7a[_0xed8e('0x34')]);return db[_0xed8e('0x3a')]['count']({'where':_0x329b89[_0xed8e('0x44')]})[_0xed8e('0x19')](function(_0x59164a){_0x47d211['count']=_0x59164a;if(_0x3d3a7a['query']['includeAll']){_0x329b89[_0xed8e('0x32')]=[{'all':!![]}];}return db[_0xed8e('0x3a')][_0xed8e('0x25')](_0x329b89);})[_0xed8e('0x19')](function(_0x9fa426){if(_0x3d3a7a[_0xed8e('0x2c')][_0xed8e('0x4a')]===_0xed8e('0x4b')){for(var _0x5ae27f=0x0;_0x5ae27f<_0x9fa426['length'];_0x5ae27f++){_0x9fa426[_0x5ae27f][_0xed8e('0x37')]=juice(_0x9fa426[_0x5ae27f]['body']);}}_0x47d211[_0xed8e('0x4c')]=_0x9fa426;return _0x47d211;});}})[_0xed8e('0x19')](respondWithFilteredResult(_0x353c3e,_0x329b89))[_0xed8e('0x27')](handleError(_0x353c3e,null));};exports[_0xed8e('0x4d')]=function(_0x3da66b,_0x40e7b0){return db[_0xed8e('0x1f')]['find']({'where':{'id':_0x3da66b[_0xed8e('0x29')]['id']}})[_0xed8e('0x19')](handleEntityNotFound(_0x40e7b0,null))[_0xed8e('0x19')](function(_0x36147f){if(_0x36147f){return _0x36147f[_0xed8e('0x4e')](_0x3da66b[_0xed8e('0x37')][_0xed8e('0x3c')],_[_0xed8e('0x3b')](_0x3da66b[_0xed8e('0x37')],[_0xed8e('0x3c'),'id'])||{})['spread'](function(){return db[_0xed8e('0x4f')]['findAll']({'attributes':['id',_0xed8e('0x1c'),_0xed8e('0x50')],'where':{'id':_0x3da66b[_0xed8e('0x37')][_0xed8e('0x3c')]}});})[_0xed8e('0x19')](function(_0x2681ef){socket['emit']('mailInteractionTags:save',{'id':Number(_0x3da66b[_0xed8e('0x29')]['id']),'tags':_0x2681ef||[]});return{'id':Number(_0x3da66b['params']['id']),'tags':_0x2681ef||[]};});}})['then'](respondWithResult(_0x40e7b0,null))[_0xed8e('0x27')](handleError(_0x40e7b0,null));};exports[_0xed8e('0x51')]=function(_0x5ece7e,_0x32d05c){return db['MailInteraction']['find']({'where':{'id':_0x5ece7e['params']['id']}})[_0xed8e('0x19')](handleEntityNotFound(_0x32d05c,null))[_0xed8e('0x19')](function(_0x3c7f77){if(_0x3c7f77){return _0x3c7f77[_0xed8e('0x51')](_0x5ece7e[_0xed8e('0x2c')][_0xed8e('0x3c')]);}})[_0xed8e('0x19')](respondWithStatusCode(_0x32d05c,null))['catch'](handleError(_0x32d05c,null));};exports[_0xed8e('0x52')]=function(_0x3aec9e,_0x4bf2e2){var _0x3252cf=moment()[_0xed8e('0x53')]()[_0xed8e('0x54')]();var _0x5ac94c=path[_0xed8e('0x55')](config['root'],'server',_0xed8e('0x56'),_0xed8e('0x57'));var _0x276cc0=path[_0xed8e('0x55')](config[_0xed8e('0x58')],'server',_0xed8e('0x56'),_0xed8e('0x59'));var _0x51eb53=path[_0xed8e('0x55')](_0x5ac94c,_0x3252cf);var _0x2e00e4=util[_0xed8e('0x48')](_0xed8e('0x5a'),_0x3aec9e[_0xed8e('0x29')]['id'],_0x3252cf);var _0x24807d=path[_0xed8e('0x55')](_0x5ac94c,_0x2e00e4);var _0x5eff5=[];if(_0x3aec9e[_0xed8e('0x2c')]['attachments']){_0x5eff5[_0xed8e('0x5b')]({'model':db[_0xed8e('0x5c')],'as':_0xed8e('0x5d'),'raw':!![]});}var _0x5541c5=[{'model':db[_0xed8e('0x3a')],'as':_0xed8e('0x5e'),'attributes':['id',_0xed8e('0x37'),_0xed8e('0x5f'),'to','cc',_0xed8e('0x60'),_0xed8e('0x61'),_0xed8e('0x62')],'where':{'secret':![]},'order':qs[_0xed8e('0x42')]('id'),'include':_0x5eff5}];return db[_0xed8e('0x1f')][_0xed8e('0x35')]({'where':{'id':_0x3aec9e[_0xed8e('0x29')]['id']},'include':_0x5541c5})['then'](handleEntityNotFound(_0x4bf2e2,null))['then'](function(_0x627dcc){if(_0x627dcc&&_0x627dcc[_0xed8e('0x5e')]){var _0x548571=_0x627dcc['get']({'plain':!![]});fs[_0xed8e('0x63')](_0x51eb53);return BPromise['each'](_0x548571[_0xed8e('0x5e')],function(_0x59fbce,_0x16dce7){var _0x34813c={'from':_0x59fbce['from'],'to':_0x59fbce['to'],'subject':_0x59fbce[_0xed8e('0x61')],'html':htmlEntities[_0xed8e('0x64')](_0x59fbce[_0xed8e('0x37')]),'headers':{'Date':moment(_0x59fbce[_0xed8e('0x62')])[_0xed8e('0x48')](_0xed8e('0x65'))},'attachments':[]};if(_0x59fbce['cc']){_0x34813c[_0xed8e('0x66')]['Cc']=_0x59fbce['cc'];}if(_0x59fbce[_0xed8e('0x60')]){_0x34813c[_0xed8e('0x66')]['Bcc']=_0x59fbce['bcc'];}return new BPromise(function(_0x41cba5,_0x371093){if(_0x59fbce[_0xed8e('0x5d')]){for(var _0x2b0b9a=0x0;_0x2b0b9a<_0x59fbce['Attachments']['length'];_0x2b0b9a++){var _0x4188d=_0x59fbce['Attachments'][_0x2b0b9a];var _0x1927f8=path['join'](_0x276cc0,_0x4188d[_0xed8e('0x67')]);if(fs[_0xed8e('0x68')](_0x1927f8)){_0x34813c[_0xed8e('0x59')][_0xed8e('0x5b')]({'name':_0x4188d[_0xed8e('0x1c')],'contentType':_0x4188d['type'],'data':fs[_0xed8e('0x69')](_0x1927f8)});}}}emlformat[_0xed8e('0x6a')](_0x34813c,function(_0xbe684c,_0x3aef4f){if(_0xbe684c)return _0x371093(_0xbe684c);fs[_0xed8e('0x6b')](path[_0xed8e('0x55')](_0x51eb53,util['format'](_0xed8e('0x6c'),_0x16dce7)),_0x3aef4f);return _0x41cba5(_0x3aef4f);});});})[_0xed8e('0x19')](function(){return new BPromise(function(_0x3a975d,_0x54ae51){zipdir(_0x51eb53,{'saveTo':_0x24807d},function(_0x3da324,_0x226f06){if(_0x3da324)return _0x54ae51(_0x3da324);return _0x3a975d(_0x226f06);});})[_0xed8e('0x19')](function(){return new BPromise(function(_0x1eb26b,_0x3a7960){rimraf(_0x51eb53,function(_0x50a78f){if(_0x50a78f)_0x3a7960(_0x50a78f);return _0x1eb26b();});});})['then'](function(){return _0x4bf2e2[_0xed8e('0x52')](_0x24807d,_0x2e00e4,function(_0x3756a3){if(!_0x3756a3)fs[_0xed8e('0x6d')](_0x24807d);});});});}else{return _0x4bf2e2[_0xed8e('0x10')](0xc8);}})[_0xed8e('0x27')](handleError(_0x4bf2e2,null));}; \ No newline at end of file +var _0x7857=['mail','query','show','params','model','keys','rawAttributes','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','omit','ids','getMessages','findOne','MailMessage','filters','length','hasOwnProperty','nolimit','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','toString','join','root','server','tmp','files','attachments','push','Attachment','Messages','from','bcc','createdAt','sort','get','mkdirSync','each','subject','decode','headers','Bcc','Attachments','basename','existsSync','type','readFileSync','build','writeFileSync','message%d.eml','eml-format','rimraf','moment','bluebird','path','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','update','then','destroy','error','stack','name','send','index','map','MailInteraction','fieldName','key','findAll'];(function(_0x4921a7,_0x5286c8){var _0x4d1442=function(_0x21d884){while(--_0x21d884){_0x4921a7['push'](_0x4921a7['shift']());}};_0x4d1442(++_0x5286c8);}(_0x7857,0x1a9));var _0x7785=function(_0xaad0,_0x5af5a6){_0xaad0=_0xaad0-0x0;var _0x578be4=_0x7857[_0xaad0];return _0x578be4;};'use strict';var emlformat=require(_0x7785('0x0'));var rimraf=require(_0x7785('0x1'));var zipdir=require('zip-dir');var moment=require(_0x7785('0x2'));var BPromise=require(_0x7785('0x3'));var util=require('util');var path=require(_0x7785('0x4'));var fs=require('fs');var _=require(_0x7785('0x5'));var juice=require(_0x7785('0x6'));var Redis=require('ioredis');var interaction=require(_0x7785('0x7'));var qs=require(_0x7785('0x8'));var logger=require(_0x7785('0x9'))('api');var config=require('../../config/environment');var db=require(_0x7785('0xa'))['db'];var htmlEntities=require(_0x7785('0xb'));config['redis']=_[_0x7785('0xc')](config[_0x7785('0xd')],{'host':_0x7785('0xe'),'port':0x18eb});var socket=require(_0x7785('0xf'))(new Redis(config['redis']));require(_0x7785('0x10'))['register'](socket);function respondWithStatusCode(_0x40d659,_0x2a2562){_0x2a2562=_0x2a2562||0xcc;return function(_0x4a880a){if(_0x4a880a){return _0x40d659[_0x7785('0x11')](_0x2a2562);}return _0x40d659[_0x7785('0x12')](_0x2a2562)[_0x7785('0x13')]();};}function respondWithResult(_0x24bbd2,_0x1314f4){_0x1314f4=_0x1314f4||0xc8;return function(_0x203fb8){if(_0x203fb8){return _0x24bbd2['status'](_0x1314f4)[_0x7785('0x14')](_0x203fb8);}};}function respondWithFilteredResult(_0x1f034d,_0x49f204){return function(_0x302321){if(_0x302321){var _0x424446=typeof _0x49f204['offset']==='undefined'&&typeof _0x49f204[_0x7785('0x15')]===_0x7785('0x16');var _0x12d51c=_0x302321[_0x7785('0x17')];var _0x16597d=_0x424446?0x0:_0x49f204['offset'];var _0x325808=_0x424446?_0x302321[_0x7785('0x17')]:_0x49f204[_0x7785('0x18')]+_0x49f204[_0x7785('0x15')];var _0x1c50a9;if(_0x325808>=_0x12d51c){_0x325808=_0x12d51c;_0x1c50a9=0xc8;}else{_0x1c50a9=0xce;}_0x1f034d[_0x7785('0x12')](_0x1c50a9);return _0x1f034d['set'](_0x7785('0x19'),_0x16597d+'-'+_0x325808+'/'+_0x12d51c)[_0x7785('0x14')](_0x302321);}return null;};}function saveUpdates(_0x411865){return function(_0x29246f){if(_0x29246f){return _0x29246f[_0x7785('0x1a')](_0x411865)[_0x7785('0x1b')](function(_0x478194){return _0x478194;});}return null;};}function removeEntity(_0x43f590){return function(_0x1c96c4){if(_0x1c96c4){return _0x1c96c4[_0x7785('0x1c')]()[_0x7785('0x1b')](function(){_0x43f590[_0x7785('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee1ee){return function(_0x2a410a){if(!_0x2a410a){_0x2ee1ee['sendStatus'](0x194);}return _0x2a410a;};}function handleError(_0x4882b5,_0x22ff5f){_0x22ff5f=_0x22ff5f||0x1f4;return function(_0x37dd87){logger[_0x7785('0x1d')](_0x37dd87[_0x7785('0x1e')]);if(_0x37dd87[_0x7785('0x1f')]){delete _0x37dd87['name'];}_0x4882b5['status'](_0x22ff5f)[_0x7785('0x20')](_0x37dd87);};}exports[_0x7785('0x21')]=function(_0x218d07,_0x383933){var _0x396885={};var _0x3e356a=_[_0x7785('0x22')](db[_0x7785('0x23')]['rawAttributes'],function(_0x38efe2){return{'name':_0x38efe2[_0x7785('0x24')],'type':_0x38efe2['type'][_0x7785('0x25')]};});_0x396885=qs['getOptions'](_0x3e356a,_0x218d07);return interaction[_0x7785('0x26')](_0x7785('0x27'),_0x218d07[_0x7785('0x28')],_0x218d07['user'],_0x396885,_0x3e356a)[_0x7785('0x1b')](respondWithFilteredResult(_0x383933,_0x396885))['catch'](handleError(_0x383933,null));};exports[_0x7785('0x29')]=function(_0x175db0,_0x4b0b3c){var _0x7af80f={'raw':![],'where':{'id':_0x175db0[_0x7785('0x2a')]['id']}},_0xbd1aed={};_0xbd1aed[_0x7785('0x2b')]=_[_0x7785('0x2c')](db['MailInteraction'][_0x7785('0x2d')]);_0xbd1aed['query']=_[_0x7785('0x2c')](_0x175db0[_0x7785('0x28')]);_0xbd1aed['filters']=_['intersection'](_0xbd1aed['model'],_0xbd1aed[_0x7785('0x28')]);_0x7af80f[_0x7785('0x2e')]=_[_0x7785('0x2f')](_0xbd1aed['model'],qs[_0x7785('0x30')](_0x175db0[_0x7785('0x28')][_0x7785('0x30')]));_0x7af80f['attributes']=_0x7af80f['attributes']['length']?_0x7af80f[_0x7785('0x2e')]:_0xbd1aed['model'];if(_0x175db0[_0x7785('0x28')][_0x7785('0x31')]){_0x7af80f[_0x7785('0x32')]=[{'all':!![]}];}_0x7af80f=_[_0x7785('0x33')]({},_0x7af80f,_0x175db0[_0x7785('0x34')]);return db[_0x7785('0x23')][_0x7785('0x35')](_0x7af80f)[_0x7785('0x1b')](handleEntityNotFound(_0x4b0b3c,null))[_0x7785('0x1b')](respondWithResult(_0x4b0b3c,null))[_0x7785('0x36')](handleError(_0x4b0b3c,null));};exports[_0x7785('0x37')]=function(_0x45e201,_0x204395){return db['MailInteraction']['create'](_0x45e201[_0x7785('0x38')],{})['then'](respondWithResult(_0x204395,0xc9))[_0x7785('0x36')](handleError(_0x204395,null));};exports[_0x7785('0x1a')]=function(_0xc3acda,_0x1b2fd2){if(_0xc3acda[_0x7785('0x38')]['id']){delete _0xc3acda[_0x7785('0x38')]['id'];}return db[_0x7785('0x23')]['find']({'where':{'id':_0xc3acda[_0x7785('0x2a')]['id']}})[_0x7785('0x1b')](handleEntityNotFound(_0x1b2fd2,null))[_0x7785('0x1b')](saveUpdates(_0xc3acda[_0x7785('0x38')],null))[_0x7785('0x1b')](respondWithResult(_0x1b2fd2,null))[_0x7785('0x36')](handleError(_0x1b2fd2,null));};exports[_0x7785('0x1c')]=function(_0x10312b,_0x3c60c0){return db[_0x7785('0x23')]['find']({'where':{'id':_0x10312b[_0x7785('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3c60c0,null))[_0x7785('0x1b')](removeEntity(_0x3c60c0,null))[_0x7785('0x36')](handleError(_0x3c60c0,null));};exports[_0x7785('0x39')]=function(_0x95851f,_0x23aa74){return db[_0x7785('0x23')]['describe']()['then'](respondWithResult(_0x23aa74,null))[_0x7785('0x36')](handleError(_0x23aa74,null));};exports[_0x7785('0x3a')]=function(_0x46868f,_0x25f3b8){return db['MailMessage'][_0x7785('0x35')]({'where':{'id':_0x46868f[_0x7785('0x2a')]['id']}})[_0x7785('0x1b')](handleEntityNotFound(_0x25f3b8,null))[_0x7785('0x1b')](function(_0x571349){if(_0x571349){return _0x571349['addMessage'](_0x46868f[_0x7785('0x38')]['ids'],_[_0x7785('0x3b')](_0x46868f[_0x7785('0x38')],[_0x7785('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x25f3b8,null))[_0x7785('0x36')](handleError(_0x25f3b8,null));};exports[_0x7785('0x3d')]=function(_0x1653fa,_0x12f4f5){var _0x1c5d5e={'raw':![],'where':{}};var _0x5a2d1b={};var _0x4b2099={'count':0x0,'rows':[]};return db[_0x7785('0x23')][_0x7785('0x3e')]({'where':{'id':_0x1653fa['params']['id']}})[_0x7785('0x1b')](handleEntityNotFound(_0x12f4f5,null))[_0x7785('0x1b')](function(_0x238a5f){if(_0x238a5f){_0x5a2d1b['model']=_[_0x7785('0x2c')](db[_0x7785('0x3f')]['rawAttributes']);_0x5a2d1b[_0x7785('0x28')]=_['keys'](_0x1653fa[_0x7785('0x28')]);_0x5a2d1b[_0x7785('0x40')]=_['intersection'](_0x5a2d1b[_0x7785('0x2b')],_0x5a2d1b[_0x7785('0x28')]);_0x1c5d5e['attributes']=_[_0x7785('0x2f')](_0x5a2d1b[_0x7785('0x2b')],qs['fields'](_0x1653fa['query']['fields']));_0x1c5d5e[_0x7785('0x2e')]=_0x1c5d5e[_0x7785('0x2e')][_0x7785('0x41')]?_0x1c5d5e['attributes']:_0x5a2d1b[_0x7785('0x2b')];if(!_0x1653fa['query'][_0x7785('0x42')](_0x7785('0x43'))){_0x1c5d5e['limit']=qs['limit'](_0x1653fa[_0x7785('0x28')][_0x7785('0x15')]);_0x1c5d5e[_0x7785('0x18')]=qs['offset'](_0x1653fa[_0x7785('0x28')][_0x7785('0x18')]);}_0x1c5d5e['order']=qs['sort'](_0x1653fa['query']['sort']);_0x1c5d5e[_0x7785('0x44')]=qs[_0x7785('0x40')](_[_0x7785('0x45')](_0x1653fa['query'],_0x5a2d1b[_0x7785('0x40')]));_0x1c5d5e[_0x7785('0x44')][_0x7785('0x46')]=_0x238a5f['id'];if(_0x1653fa[_0x7785('0x28')][_0x7785('0x47')]){_0x1c5d5e[_0x7785('0x44')]=_['merge'](_0x1c5d5e['where'],{'$or':_['map'](_0x1c5d5e[_0x7785('0x2e')],function(_0x4a1e4d){var _0xda6baa={};_0xda6baa[_0x4a1e4d]={'$like':'%'+_0x1653fa['query']['filter']+'%'};return _0xda6baa;})});}if(_0x1653fa[_0x7785('0x28')][_0x7785('0x48')]){var _0x568ebf=_0x1653fa[_0x7785('0x28')][_0x7785('0x48')][_0x7785('0x49')](',');var _0x3489bb={};_0x3489bb[_0x568ebf[0x0]]={'$gte':moment(_0x568ebf[0x1])[_0x7785('0x4a')](_0x7785('0x4b'))};_0x1c5d5e[_0x7785('0x44')]=_[_0x7785('0x33')](_0x1c5d5e[_0x7785('0x44')],_0x3489bb);}_0x1c5d5e=_[_0x7785('0x33')]({},_0x1c5d5e,_0x1653fa['options']);return db[_0x7785('0x3f')][_0x7785('0x17')]({'where':_0x1c5d5e['where']})[_0x7785('0x1b')](function(_0xb7342d){_0x4b2099[_0x7785('0x17')]=_0xb7342d;if(_0x1653fa[_0x7785('0x28')]['includeAll']){_0x1c5d5e[_0x7785('0x32')]=[{'all':!![]}];}return db[_0x7785('0x3f')][_0x7785('0x26')](_0x1c5d5e);})['then'](function(_0x20ddfe){if(_0x1653fa[_0x7785('0x28')][_0x7785('0x4c')]===_0x7785('0x4d')){for(var _0x3185a3=0x0;_0x3185a3<_0x20ddfe[_0x7785('0x41')];_0x3185a3++){_0x20ddfe[_0x3185a3][_0x7785('0x38')]=juice(_0x20ddfe[_0x3185a3][_0x7785('0x38')]);}}_0x4b2099['rows']=_0x20ddfe;return _0x4b2099;});}})[_0x7785('0x1b')](respondWithFilteredResult(_0x12f4f5,_0x1c5d5e))['catch'](handleError(_0x12f4f5,null));};exports[_0x7785('0x4e')]=function(_0x1037bb,_0x2a9b28){return db[_0x7785('0x23')][_0x7785('0x35')]({'where':{'id':_0x1037bb[_0x7785('0x2a')]['id']}})[_0x7785('0x1b')](handleEntityNotFound(_0x2a9b28,null))['then'](function(_0x3f2bbb){if(_0x3f2bbb){return _0x3f2bbb[_0x7785('0x4f')](_0x1037bb[_0x7785('0x38')][_0x7785('0x3c')],_[_0x7785('0x3b')](_0x1037bb[_0x7785('0x38')],[_0x7785('0x3c'),'id'])||{})[_0x7785('0x50')](function(){return db[_0x7785('0x51')][_0x7785('0x26')]({'attributes':['id',_0x7785('0x1f'),_0x7785('0x52')],'where':{'id':_0x1037bb[_0x7785('0x38')][_0x7785('0x3c')]}});})[_0x7785('0x1b')](function(_0x489191){socket[_0x7785('0x53')](_0x7785('0x54'),{'id':Number(_0x1037bb['params']['id']),'tags':_0x489191||[]});return{'id':Number(_0x1037bb[_0x7785('0x2a')]['id']),'tags':_0x489191||[]};});}})[_0x7785('0x1b')](respondWithResult(_0x2a9b28,null))[_0x7785('0x36')](handleError(_0x2a9b28,null));};exports[_0x7785('0x55')]=function(_0x5ba233,_0x16ed47){return db[_0x7785('0x23')]['find']({'where':{'id':_0x5ba233[_0x7785('0x2a')]['id']}})['then'](handleEntityNotFound(_0x16ed47,null))[_0x7785('0x1b')](function(_0x232a71){if(_0x232a71){return _0x232a71[_0x7785('0x55')](_0x5ba233['query']['ids']);}})[_0x7785('0x1b')](respondWithStatusCode(_0x16ed47,null))[_0x7785('0x36')](handleError(_0x16ed47,null));};exports[_0x7785('0x56')]=function(_0xc9d8f6,_0xdeddb9){var _0x3f8275=moment()['unix']()[_0x7785('0x57')]();var _0x49ce83=path[_0x7785('0x58')](config[_0x7785('0x59')],_0x7785('0x5a'),'files',_0x7785('0x5b'));var _0x9c45dd=path[_0x7785('0x58')](config[_0x7785('0x59')],'server',_0x7785('0x5c'),_0x7785('0x5d'));var _0x5a388c=path['join'](_0x49ce83,_0x3f8275);var _0x1288ce=util[_0x7785('0x4a')]('transcript-%d-%s.zip',_0xc9d8f6[_0x7785('0x2a')]['id'],_0x3f8275);var _0xe9c85a=path[_0x7785('0x58')](_0x49ce83,_0x1288ce);var _0x1e146e=[];if(_0xc9d8f6['query'][_0x7785('0x5d')]){_0x1e146e[_0x7785('0x5e')]({'model':db[_0x7785('0x5f')],'as':'Attachments','raw':!![]});}var _0x3b5f4a=[{'model':db[_0x7785('0x3f')],'as':_0x7785('0x60'),'attributes':['id','body',_0x7785('0x61'),'to','cc',_0x7785('0x62'),'subject',_0x7785('0x63')],'where':{'secret':![]},'order':qs[_0x7785('0x64')]('id'),'include':_0x1e146e}];return db[_0x7785('0x23')]['find']({'where':{'id':_0xc9d8f6[_0x7785('0x2a')]['id']},'include':_0x3b5f4a})[_0x7785('0x1b')](handleEntityNotFound(_0xdeddb9,null))[_0x7785('0x1b')](function(_0x1ae095){if(_0x1ae095&&_0x1ae095[_0x7785('0x60')]){var _0x4eaa2f=_0x1ae095[_0x7785('0x65')]({'plain':!![]});fs[_0x7785('0x66')](_0x5a388c);return BPromise[_0x7785('0x67')](_0x4eaa2f[_0x7785('0x60')],function(_0x2976b0,_0x4ab20b){var _0x4cf0b7={'from':_0x2976b0['from'],'to':_0x2976b0['to'],'subject':_0x2976b0[_0x7785('0x68')],'html':htmlEntities[_0x7785('0x69')](_0x2976b0[_0x7785('0x38')]),'headers':{'Date':moment(_0x2976b0['createdAt'])[_0x7785('0x4a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2976b0['cc']){_0x4cf0b7[_0x7785('0x6a')]['Cc']=_0x2976b0['cc'];}if(_0x2976b0[_0x7785('0x62')]){_0x4cf0b7[_0x7785('0x6a')][_0x7785('0x6b')]=_0x2976b0[_0x7785('0x62')];}return new BPromise(function(_0x5d187c,_0x297d36){if(_0x2976b0['Attachments']){for(var _0x3aad03=0x0;_0x3aad03<_0x2976b0[_0x7785('0x6c')][_0x7785('0x41')];_0x3aad03++){var _0x3bcc38=_0x2976b0['Attachments'][_0x3aad03];var _0x4ceab3=path[_0x7785('0x58')](_0x9c45dd,_0x3bcc38[_0x7785('0x6d')]);if(fs[_0x7785('0x6e')](_0x4ceab3)){_0x4cf0b7['attachments']['push']({'name':_0x3bcc38['name'],'contentType':_0x3bcc38[_0x7785('0x6f')],'data':fs[_0x7785('0x70')](_0x4ceab3)});}}}emlformat[_0x7785('0x71')](_0x4cf0b7,function(_0x35c2c3,_0x5cd184){if(_0x35c2c3)return _0x297d36(_0x35c2c3);fs[_0x7785('0x72')](path['join'](_0x5a388c,util[_0x7785('0x4a')](_0x7785('0x73'),_0x4ab20b)),_0x5cd184);return _0x5d187c(_0x5cd184);});});})[_0x7785('0x1b')](function(){return new BPromise(function(_0x701cd,_0x3fb338){zipdir(_0x5a388c,{'saveTo':_0xe9c85a},function(_0x50bebe,_0x2ecb3a){if(_0x50bebe)return _0x3fb338(_0x50bebe);return _0x701cd(_0x2ecb3a);});})[_0x7785('0x1b')](function(){return new BPromise(function(_0x1c7617,_0x37e009){rimraf(_0x5a388c,function(_0x5b0022){if(_0x5b0022)_0x37e009(_0x5b0022);return _0x1c7617();});});})[_0x7785('0x1b')](function(){return _0xdeddb9['download'](_0xe9c85a,_0x1288ce,function(_0x330175){if(!_0x330175)fs['unlinkSync'](_0xe9c85a);});});});}else{return _0xdeddb9[_0x7785('0x11')](0xc8);}})['catch'](handleError(_0xdeddb9,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a2d4f29..0915d18 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 _0x8362=['save','update','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x8362,0x132));var _0x2836=function(_0x208601,_0x4d1d65){_0x208601=_0x208601-0x0;var _0x522326=_0x8362[_0x208601];return _0x522326;};'use strict';var EventEmitter=require(_0x2836('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x2836('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2836('0x2'),'afterUpdate':_0x2836('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3c7f14){return function(_0x380dcf,_0x465901,_0x4f88d4){_0x380dcf[_0x2836('0x4')]({'attributes':['id'],'raw':!![]})[_0x2836('0x5')](function(_0x3be521){_0x380dcf[_0x2836('0x6')](_0x2836('0x7'),_0x3be521[_0x2836('0x8')](function(_0x13a379){return{'id':_0x13a379['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x380dcf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2836('0x5')](function(_0x1e63e7){_0x380dcf[_0x2836('0x6')]('unreadMessages',_0x1e63e7[_0x2836('0x9')]);MailInteractionEvents[_0x2836('0xa')](_0x3c7f14+':'+_0x380dcf['id'],_0x380dcf);MailInteractionEvents[_0x2836('0xa')](_0x3c7f14,_0x380dcf);_0x4f88d4(null);})[_0x2836('0xb')](_0x4f88d4(null));};}for(var e in events){if(events[_0x2836('0xc')](e)){var event=events[e];MailInteraction[_0x2836('0xd')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xd0c1=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','getUsers','then','setDataValue'];(function(_0x196f6f,_0x4918bb){var _0x3d7f04=function(_0x8d5fc2){while(--_0x8d5fc2){_0x196f6f['push'](_0x196f6f['shift']());}};_0x3d7f04(++_0x4918bb);}(_0xd0c1,0x16f));var _0x1d0c=function(_0x1a3dc1,_0x1699d9){_0x1a3dc1=_0x1a3dc1-0x0;var _0x3d20d7=_0xd0c1[_0x1a3dc1];return _0x3d20d7;};'use strict';var EventEmitter=require(_0x1d0c('0x0'));var MailInteraction=require(_0x1d0c('0x1'))['db'][_0x1d0c('0x2')];var MailMessage=require(_0x1d0c('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1d0c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19fa51){return function(_0x3a9f64,_0x48d1b3,_0x1599f0){_0x3a9f64[_0x1d0c('0x4')]({'attributes':['id'],'raw':!![]})[_0x1d0c('0x5')](function(_0x3c04ff){_0x3a9f64[_0x1d0c('0x6')](_0x1d0c('0x7'),_0x3c04ff[_0x1d0c('0x8')](function(_0x555a71){return{'id':_0x555a71['id']};}));return MailMessage[_0x1d0c('0x9')]({'where':{'MailInteractionId':_0x3a9f64['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1d0c('0x5')](function(_0x45789f){_0x3a9f64[_0x1d0c('0x6')](_0x1d0c('0xa'),_0x45789f[_0x1d0c('0xb')]);MailInteractionEvents[_0x1d0c('0xc')](_0x19fa51+':'+_0x3a9f64['id'],_0x3a9f64);MailInteractionEvents['emit'](_0x19fa51,_0x3a9f64);_0x1599f0(null);})[_0x1d0c('0xd')](_0x1599f0(null));};}for(var e in events){if(events[_0x1d0c('0xe')](e)){var event=events[e];MailInteraction[_0x1d0c('0xf')](e,emitEvent(event));}}module[_0x1d0c('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index f23a0fe..84acaaf 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 _0xbcd8=['format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','models','get','closed','update','then','utf8mb4_unicode_ci','lodash','util','api','moment','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0xbcd8,0x15c));var _0x8bcd=function(_0x339615,_0x470f3d){_0x339615=_0x339615-0x0;var _0x5125de=_0xbcd8[_0x339615];return _0x5125de;};'use strict';var _=require(_0x8bcd('0x0'));var util=require(_0x8bcd('0x1'));var logger=require('../../config/logger')(_0x8bcd('0x2'));var moment=require(_0x8bcd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bcd('0x4'));var rimraf=require(_0x8bcd('0x5'));var config=require(_0x8bcd('0x6'));var attributes=require(_0x8bcd('0x7'));module[_0x8bcd('0x8')]=function(_0x469873,_0x5c21f9){return _0x469873['define'](_0x8bcd('0x9'),attributes,{'tableName':_0x8bcd('0xa'),'paranoid':![],'indexes':[{'name':_0x8bcd('0xb'),'fields':[_0x8bcd('0xc'),'to'],'type':_0x8bcd('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4bffa4,_0x210856,_0x3bee42){if(_0x4bffa4[_0x8bcd('0xe')]){_0x4bffa4[_0x8bcd('0xf')]=moment()[_0x8bcd('0x10')](_0x8bcd('0x11'));}if(_0x4bffa4['closed']){_0x4bffa4[_0x8bcd('0x12')]=moment()[_0x8bcd('0x10')](_0x8bcd('0x11'));}_0x3bee42(null,_0x210856);},'beforeUpdate':function(_0x393f44,_0xfc6a48,_0x380680){if(_0x393f44[_0x8bcd('0x13')](_0x8bcd('0xe'))){_0x393f44[_0x8bcd('0xf')]=_0x393f44[_0x8bcd('0xe')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x393f44[_0x8bcd('0x13')]('closed')){_0x393f44[_0x8bcd('0x12')]=moment()[_0x8bcd('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x393f44[_0x8bcd('0xe')]=null;_0x393f44[_0x8bcd('0xf')]=null;}_0x380680(null,_0x393f44);},'afterUpdate':function(_0xbe2ca4,_0xdff629,_0x51761b){var _0x54bbf6=_0x469873[_0x8bcd('0x14')];var _0x4e5c28=_0xbe2ca4[_0x8bcd('0x15')]({'plain':!![]});if(_0x4e5c28[_0x8bcd('0x16')]){return _0x54bbf6['MailMessage'][_0x8bcd('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x4e5c28['id']}})[_0x8bcd('0x18')](function(){_0x51761b();})['catch'](function(_0x30f52b){_0x51761b(_0x30f52b);});}else{_0x51761b();}}},'charset':'utf8mb4','collate':_0x8bcd('0x19')});}; \ No newline at end of file +var _0x0624=['changed','YYYY-MM-DD\x20HH:mm:ss','closedAt','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','util','bluebird','path','rimraf','../../config/environment','exports','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','closed','format'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x0624,0x1d2));var _0x4062=function(_0x2c4c12,_0x4945a4){_0x2c4c12=_0x2c4c12-0x0;var _0x550965=_0x0624[_0x2c4c12];return _0x550965;};'use strict';var _=require('lodash');var util=require(_0x4062('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4062('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4062('0x2'));var rimraf=require(_0x4062('0x3'));var config=require(_0x4062('0x4'));var attributes=require('./mailInteraction.attributes');module[_0x4062('0x5')]=function(_0x157864,_0x3d1459){return _0x157864['define'](_0x4062('0x6'),attributes,{'tableName':_0x4062('0x7'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x4062('0x8'),'to'],'type':_0x4062('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1de02a,_0x20ac4a,_0x242a91){if(_0x1de02a[_0x4062('0xa')]){_0x1de02a[_0x4062('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1de02a[_0x4062('0xc')]){_0x1de02a['closedAt']=moment()[_0x4062('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x242a91(null,_0x20ac4a);},'beforeUpdate':function(_0x5ec353,_0x4ea7e8,_0x311535){if(_0x5ec353[_0x4062('0xe')](_0x4062('0xa'))){_0x5ec353[_0x4062('0xb')]=_0x5ec353[_0x4062('0xa')]?moment()[_0x4062('0xd')](_0x4062('0xf')):null;}if(_0x5ec353['changed'](_0x4062('0xc'))){_0x5ec353[_0x4062('0x10')]=moment()[_0x4062('0xd')](_0x4062('0xf'));_0x5ec353['substatus']=null;_0x5ec353[_0x4062('0xb')]=null;}_0x311535(null,_0x5ec353);},'afterUpdate':function(_0x365f06,_0x558fbd,_0x460739){var _0x4c4ae1=_0x157864[_0x4062('0x11')];var _0x5ed280=_0x365f06[_0x4062('0x12')]({'plain':!![]});if(_0x5ed280['closed']){return _0x4c4ae1[_0x4062('0x13')][_0x4062('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x5ed280['id']}})[_0x4062('0x15')](function(){_0x460739();})[_0x4062('0x16')](function(_0x2610d1){_0x460739(_0x2610d1);});}else{_0x460739();}}},'charset':'utf8mb4','collate':_0x4062('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 3072f28..4eb3e95 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 _0xf559=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','MailInteraction','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','debug','AddTagsToMailInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x40bc8a,_0x572c23){var _0x6b1faa=function(_0xada012){while(--_0xada012){_0x40bc8a['push'](_0x40bc8a['shift']());}};_0x6b1faa(++_0x572c23);}(_0xf559,0x113));var _0x9f55=function(_0xc70ff5,_0x1f8a90){_0xc70ff5=_0xc70ff5-0x0;var _0x3f84b4=_0xf559[_0xc70ff5];return _0x3f84b4;};'use strict';var _=require(_0x9f55('0x0'));var util=require(_0x9f55('0x1'));var moment=require(_0x9f55('0x2'));var BPromise=require(_0x9f55('0x3'));var rs=require(_0x9f55('0x4'));var fs=require('fs');var Redis=require(_0x9f55('0x5'));var db=require(_0x9f55('0x6'))['db'];var utils=require(_0x9f55('0x7'));var logger=require(_0x9f55('0x8'))(_0x9f55('0x9'));var config=require(_0x9f55('0xa'));var jayson=require(_0x9f55('0xb'));var client=jayson['client'][_0x9f55('0xc')]({'port':0x232a});config[_0x9f55('0xd')]=_[_0x9f55('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9f55('0xf'))(new Redis(config[_0x9f55('0xd')]));require(_0x9f55('0x10'))[_0x9f55('0x11')](socket);function respondWithRpcPromise(_0x265d4e,_0x93a06e,_0x51bbe7){return new BPromise(function(_0x348199,_0xf3e849){return client[_0x9f55('0x12')](_0x265d4e,_0x51bbe7)[_0x9f55('0x13')](function(_0x29b4f9){logger[_0x9f55('0x14')]('MailInteraction,\x20%s,\x20%s',_0x93a06e,_0x9f55('0x15'));logger['debug'](_0x9f55('0x16'),_0x93a06e,_0x9f55('0x15'),JSON[_0x9f55('0x17')](_0x29b4f9));if(_0x29b4f9[_0x9f55('0x18')]){if(_0x29b4f9['error'][_0x9f55('0x19')]===0x1f4){logger[_0x9f55('0x18')](_0x9f55('0x1a'),_0x93a06e,_0x29b4f9[_0x9f55('0x18')][_0x9f55('0x1b')]);return _0xf3e849(_0x29b4f9[_0x9f55('0x18')][_0x9f55('0x1b')]);}logger['error'](_0x9f55('0x1a'),_0x93a06e,_0x29b4f9[_0x9f55('0x18')][_0x9f55('0x1b')]);return _0x348199(_0x29b4f9[_0x9f55('0x18')][_0x9f55('0x1b')]);}else{logger[_0x9f55('0x14')](_0x9f55('0x1a'),_0x93a06e,_0x9f55('0x15'));_0x348199(_0x29b4f9[_0x9f55('0x1c')]['message']);}})[_0x9f55('0x1d')](function(_0x47b17b){logger[_0x9f55('0x18')](_0x9f55('0x1a'),_0x93a06e,_0x47b17b);_0xf3e849(_0x47b17b);});});}exports['UpdateMailInteraction']=function(_0x5c9658){var _0x365cfd=this;return new Promise(function(_0x212dd5,_0x1314cb){return db[_0x9f55('0x1e')][_0x9f55('0x1f')](_0x5c9658[_0x9f55('0x20')],{'raw':_0x5c9658[_0x9f55('0x21')]?_0x5c9658[_0x9f55('0x21')][_0x9f55('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c9658['options']?_0x5c9658['options'][_0x9f55('0x23')]||null:null,'attributes':_0x5c9658[_0x9f55('0x21')]?_0x5c9658[_0x9f55('0x21')][_0x9f55('0x24')]||null:null,'limit':_0x5c9658['options']?_0x5c9658[_0x9f55('0x21')][_0x9f55('0x25')]||null:null})[_0x9f55('0x13')](function(_0x2fa394){logger[_0x9f55('0x14')](_0x9f55('0x26'),_0x5c9658);logger[_0x9f55('0x27')]('UpdateMailInteraction',_0x5c9658,JSON[_0x9f55('0x17')](_0x2fa394));_0x212dd5(_0x2fa394);})[_0x9f55('0x1d')](function(_0x23c049){logger[_0x9f55('0x18')](_0x9f55('0x26'),_0x23c049[_0x9f55('0x1b')],_0x5c9658);_0x1314cb(_0x365cfd[_0x9f55('0x18')](0x1f4,_0x23c049[_0x9f55('0x1b')]));});});};exports[_0x9f55('0x28')]=function(_0x9f66ed){return new Promise(function(_0x6e35ae,_0x2ea4d3){return db[_0x9f55('0x1e')][_0x9f55('0x29')]({'where':_0x9f66ed[_0x9f55('0x21')]?_0x9f66ed['options'][_0x9f55('0x23')]||null:null})[_0x9f55('0x13')](function(_0x430889){if(_0x430889){return _0x430889[_0x9f55('0x2a')](_0x9f66ed[_0x9f55('0x20')]['ids'],_[_0x9f55('0x2b')](_0x9f66ed[_0x9f55('0x20')],[_0x9f55('0x2c'),'id'])||{});}})[_0x9f55('0x2d')](function(_0xfe9ebf){logger['info'](_0x9f55('0x2e'),_0x9f66ed);logger['debug'](_0x9f55('0x2e'),_0x9f66ed,JSON[_0x9f55('0x17')](_0xfe9ebf));_0x6e35ae(_0xfe9ebf);})[_0x9f55('0x1d')](function(_0x5782bc){logger[_0x9f55('0x18')]('AddTags',_0x5782bc[_0x9f55('0x1b')],_0x9f66ed);_0x2ea4d3(_this['error'](0x1f4,_0x5782bc[_0x9f55('0x1b')]));});});}; \ No newline at end of file +var _0x0fc5=['stringify','error','code','MailInteraction,\x20%s,\x20%s','message','info','result','UpdateMailInteraction','MailInteraction','body','options','raw','attributes','then','catch','AddTagsToMailInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailInteraction.socket','request','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4dade6,_0x16b01d){var _0x513270=function(_0x1d4a7f){while(--_0x1d4a7f){_0x4dade6['push'](_0x4dade6['shift']());}};_0x513270(++_0x16b01d);}(_0x0fc5,0x6c));var _0x50fc=function(_0x3d5aa3,_0x50f8ff){_0x3d5aa3=_0x3d5aa3-0x0;var _0x2a44d7=_0x0fc5[_0x3d5aa3];return _0x2a44d7;};'use strict';var _=require(_0x50fc('0x0'));var util=require(_0x50fc('0x1'));var moment=require(_0x50fc('0x2'));var BPromise=require(_0x50fc('0x3'));var rs=require(_0x50fc('0x4'));var fs=require('fs');var Redis=require(_0x50fc('0x5'));var db=require(_0x50fc('0x6'))['db'];var utils=require(_0x50fc('0x7'));var logger=require(_0x50fc('0x8'))(_0x50fc('0x9'));var config=require(_0x50fc('0xa'));var jayson=require(_0x50fc('0xb'));var client=jayson['client'][_0x50fc('0xc')]({'port':0x232a});config[_0x50fc('0xd')]=_[_0x50fc('0xe')](config[_0x50fc('0xd')],{'host':_0x50fc('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50fc('0xd')]));require(_0x50fc('0x10'))['register'](socket);function respondWithRpcPromise(_0xbf9a33,_0x215cc9,_0x5d767b){return new BPromise(function(_0x2273f5,_0x3c3915){return client[_0x50fc('0x11')](_0xbf9a33,_0x5d767b)['then'](function(_0x1da472){logger['info']('MailInteraction,\x20%s,\x20%s',_0x215cc9,'request\x20sent');logger[_0x50fc('0x12')](_0x50fc('0x13'),_0x215cc9,_0x50fc('0x14'),JSON[_0x50fc('0x15')](_0x1da472));if(_0x1da472[_0x50fc('0x16')]){if(_0x1da472[_0x50fc('0x16')][_0x50fc('0x17')]===0x1f4){logger['error'](_0x50fc('0x18'),_0x215cc9,_0x1da472[_0x50fc('0x16')][_0x50fc('0x19')]);return _0x3c3915(_0x1da472['error']['message']);}logger[_0x50fc('0x16')](_0x50fc('0x18'),_0x215cc9,_0x1da472[_0x50fc('0x16')]['message']);return _0x2273f5(_0x1da472[_0x50fc('0x16')][_0x50fc('0x19')]);}else{logger[_0x50fc('0x1a')]('MailInteraction,\x20%s,\x20%s',_0x215cc9,'request\x20sent');_0x2273f5(_0x1da472[_0x50fc('0x1b')][_0x50fc('0x19')]);}})['catch'](function(_0x2c6e70){logger[_0x50fc('0x16')](_0x50fc('0x18'),_0x215cc9,_0x2c6e70);_0x3c3915(_0x2c6e70);});});}exports[_0x50fc('0x1c')]=function(_0x185b41){var _0xd5760b=this;return new Promise(function(_0x11c882,_0x4eb89d){return db[_0x50fc('0x1d')]['update'](_0x185b41[_0x50fc('0x1e')],{'raw':_0x185b41[_0x50fc('0x1f')]?_0x185b41[_0x50fc('0x1f')][_0x50fc('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x185b41[_0x50fc('0x1f')]?_0x185b41[_0x50fc('0x1f')]['where']||null:null,'attributes':_0x185b41[_0x50fc('0x1f')]?_0x185b41[_0x50fc('0x1f')][_0x50fc('0x21')]||null:null,'limit':_0x185b41['options']?_0x185b41['options']['limit']||null:null})[_0x50fc('0x22')](function(_0x3fbec8){logger[_0x50fc('0x1a')]('UpdateMailInteraction',_0x185b41);logger[_0x50fc('0x12')](_0x50fc('0x1c'),_0x185b41,JSON[_0x50fc('0x15')](_0x3fbec8));_0x11c882(_0x3fbec8);})[_0x50fc('0x23')](function(_0x5befd2){logger[_0x50fc('0x16')](_0x50fc('0x1c'),_0x5befd2[_0x50fc('0x19')],_0x185b41);_0x4eb89d(_0xd5760b[_0x50fc('0x16')](0x1f4,_0x5befd2[_0x50fc('0x19')]));});});};exports[_0x50fc('0x24')]=function(_0x2b1de8){return new Promise(function(_0x351582,_0x48af59){return db[_0x50fc('0x1d')][_0x50fc('0x25')]({'where':_0x2b1de8[_0x50fc('0x1f')]?_0x2b1de8[_0x50fc('0x1f')][_0x50fc('0x26')]||null:null})[_0x50fc('0x22')](function(_0xd5a82d){if(_0xd5a82d){return _0xd5a82d[_0x50fc('0x27')](_0x2b1de8[_0x50fc('0x1e')][_0x50fc('0x28')],_['omit'](_0x2b1de8[_0x50fc('0x1e')],[_0x50fc('0x28'),'id'])||{});}})[_0x50fc('0x29')](function(_0x51b712){logger['info']('AddTags',_0x2b1de8);logger['debug'](_0x50fc('0x2a'),_0x2b1de8,JSON[_0x50fc('0x15')](_0x51b712));_0x351582(_0x51b712);})[_0x50fc('0x23')](function(_0x5cf1f6){logger[_0x50fc('0x16')](_0x50fc('0x2a'),_0x5cf1f6[_0x50fc('0x19')],_0x2b1de8);_0x48af59(_this['error'](0x1f4,_0x5cf1f6['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 91bd2d4..fd2fb57 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 _0xe025=['update','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe025,0x13d));var _0x5e02=function(_0x3ee906,_0x4213c4){_0x3ee906=_0x3ee906-0x0;var _0x42efa5=_0xe025[_0x3ee906];return _0x42efa5;};'use strict';var MailInteractionEvents=require(_0x5e02('0x0'));var events=[_0x5e02('0x1'),_0x5e02('0x2'),_0x5e02('0x3')];function createListener(_0x5a3703,_0x52fb04){return function(_0x82695b){_0x52fb04['emit'](_0x5a3703,_0x82695b);};}function removeListener(_0xfdad6f,_0x11a32c){return function(){MailInteractionEvents[_0x5e02('0x4')](_0xfdad6f,_0x11a32c);};}exports[_0x5e02('0x5')]=function(_0x3e5f47){for(var _0x25d9ac=0x0,_0xe244f0=events[_0x5e02('0x6')];_0x25d9ac<_0xe244f0;_0x25d9ac++){var _0x572462=events[_0x25d9ac];var _0x369423=createListener(_0x5e02('0x7')+_0x572462,_0x3e5f47);MailInteractionEvents['on'](_0x572462,_0x369423);}}; \ No newline at end of file +var _0x5122=['save','remove','update','emit','removeListener','register','length','./mailInteraction.events'];(function(_0xc48869,_0x56b37b){var _0x1f5dca=function(_0x508043){while(--_0x508043){_0xc48869['push'](_0xc48869['shift']());}};_0x1f5dca(++_0x56b37b);}(_0x5122,0x10f));var _0x2512=function(_0x4893ec,_0x51a6c8){_0x4893ec=_0x4893ec-0x0;var _0x3c0b1a=_0x5122[_0x4893ec];return _0x3c0b1a;};'use strict';var MailInteractionEvents=require(_0x2512('0x0'));var events=[_0x2512('0x1'),_0x2512('0x2'),_0x2512('0x3')];function createListener(_0x33ccf9,_0x3df458){return function(_0x186f54){_0x3df458[_0x2512('0x4')](_0x33ccf9,_0x186f54);};}function removeListener(_0x536c9c,_0x1cfc4b){return function(){MailInteractionEvents[_0x2512('0x5')](_0x536c9c,_0x1cfc4b);};}exports[_0x2512('0x6')]=function(_0xe6d67a){for(var _0x4a9620=0x0,_0x472cdf=events[_0x2512('0x7')];_0x4a9620<_0x472cdf;_0x4a9620++){var _0x45d471=events[_0x4a9620];var _0x2c15ff=createListener('mailInteraction:'+_0x45d471,_0xe6d67a);MailInteractionEvents['on'](_0x45d471,_0x2c15ff);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 0c9248a..aa3e798 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 _0xd1da=['/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','tracked','mail','put','update'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0xd1da,0x162));var _0xad1d=function(_0x36cff7,_0x5cb048){_0x36cff7=_0x36cff7-0x0;var _0x21c697=_0xd1da[_0x36cff7];return _0x21c697;};'use strict';var multer=require(_0xad1d('0x0'));var util=require(_0xad1d('0x1'));var path=require(_0xad1d('0x2'));var timeout=require(_0xad1d('0x3'));var express=require(_0xad1d('0x4'));var router=express[_0xad1d('0x5')]();var fs_extra=require(_0xad1d('0x6'));var auth=require(_0xad1d('0x7'));var interaction=require(_0xad1d('0x8'));var config=require(_0xad1d('0x9'));var controller=require(_0xad1d('0xa'));router[_0xad1d('0xb')]('/',auth[_0xad1d('0xc')](),controller['index']);router['get'](_0xad1d('0xd'),auth[_0xad1d('0xc')](),controller[_0xad1d('0xe')]);router[_0xad1d('0xb')](_0xad1d('0xf'),auth[_0xad1d('0xc')](),controller[_0xad1d('0x10')]);router[_0xad1d('0xb')](_0xad1d('0x11'),auth[_0xad1d('0xc')](),controller[_0xad1d('0x12')]);router['post']('/',auth[_0xad1d('0xc')](),interaction[_0xad1d('0x13')](_0xad1d('0x14'),'mailmessage:create'),controller['create']);router[_0xad1d('0x15')](_0xad1d('0xf'),auth[_0xad1d('0xc')](),controller[_0xad1d('0x16')]);router[_0xad1d('0x15')](_0xad1d('0x17'),auth['isAuthenticated'](),controller[_0xad1d('0x18')]);router[_0xad1d('0x15')](_0xad1d('0x19'),auth[_0xad1d('0xc')](),controller['reject']);router[_0xad1d('0x1a')](_0xad1d('0xf'),auth[_0xad1d('0xc')](),controller[_0xad1d('0x1b')]);module[_0xad1d('0x1c')]=router; \ No newline at end of file +var _0xe211=['put','update','/:id/accept','accept','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','mail','create'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xe211,0x166));var _0x1e21=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe211[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1e21('0x0'));var timeout=require('connect-timeout');var express=require(_0x1e21('0x1'));var router=express[_0x1e21('0x2')]();var fs_extra=require(_0x1e21('0x3'));var auth=require(_0x1e21('0x4'));var interaction=require(_0x1e21('0x5'));var config=require('../../config/environment');var controller=require(_0x1e21('0x6'));router[_0x1e21('0x7')]('/',auth[_0x1e21('0x8')](),controller[_0x1e21('0x9')]);router[_0x1e21('0x7')]('/describe',auth[_0x1e21('0x8')](),controller[_0x1e21('0xa')]);router[_0x1e21('0x7')](_0x1e21('0xb'),auth[_0x1e21('0x8')](),controller[_0x1e21('0xc')]);router[_0x1e21('0x7')]('/:id/download',auth[_0x1e21('0x8')](),controller['download']);router[_0x1e21('0xd')]('/',auth[_0x1e21('0x8')](),interaction['tracked'](_0x1e21('0xe'),'mailmessage:create'),controller[_0x1e21('0xf')]);router[_0x1e21('0x10')](_0x1e21('0xb'),auth[_0x1e21('0x8')](),controller[_0x1e21('0x11')]);router[_0x1e21('0x10')](_0x1e21('0x12'),auth[_0x1e21('0x8')](),controller[_0x1e21('0x13')]);router[_0x1e21('0x10')]('/:id/reject',auth[_0x1e21('0x8')](),controller['reject']);router[_0x1e21('0x14')](_0x1e21('0xb'),auth[_0x1e21('0x8')](),controller[_0x1e21('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 867e5d0..c25e404 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 _0xa622=['TEXT','medium','BOOLEAN','ENUM','STRING','long','DATE','INTEGER','Email','Chat','sequelize','lodash','exports'];(function(_0x2d2763,_0x479617){var _0x42c863=function(_0xc559dd){while(--_0xc559dd){_0x2d2763['push'](_0x2d2763['shift']());}};_0x42c863(++_0x479617);}(_0xa622,0x1d1));var _0x2a62=function(_0x4a9881,_0x14b8b2){_0x4a9881=_0x4a9881-0x0;var _0x2763ea=_0xa622[_0x4a9881];return _0x2763ea;};'use strict';var Sequelize=require(_0x2a62('0x0'));var _=require(_0x2a62('0x1'));module[_0x2a62('0x2')]={'body':{'type':Sequelize[_0x2a62('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2a62('0x3')](_0x2a62('0x4'))},'read':{'type':Sequelize[_0x2a62('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2a62('0x6')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2a62('0x7')](0x1fe)},'from':{'type':Sequelize[_0x2a62('0x7')]},'to':{'type':Sequelize[_0x2a62('0x3')]('long')},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x2a62('0x3')](_0x2a62('0x8'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x2a62('0x9')]},'attach':{'type':Sequelize[_0x2a62('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x2a62('0x3')](_0x2a62('0x8'))},'originCc':{'type':Sequelize[_0x2a62('0x3')]('long')},'originChannel':{'type':Sequelize[_0x2a62('0x6')](_0x2a62('0xb'),_0x2a62('0xc')),'defaultValue':_0x2a62('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xa4db=['Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER'];(function(_0x323ea8,_0x31a3b1){var _0x4b9362=function(_0x4477a7){while(--_0x4477a7){_0x323ea8['push'](_0x323ea8['shift']());}};_0x4b9362(++_0x31a3b1);}(_0xa4db,0xd4));var _0xba4d=function(_0x56be44,_0x51f7f6){_0x56be44=_0x56be44-0x0;var _0x1f6f2d=_0xa4db[_0x56be44];return _0x1f6f2d;};'use strict';var Sequelize=require(_0xba4d('0x0'));var _=require(_0xba4d('0x1'));module[_0xba4d('0x2')]={'body':{'type':Sequelize[_0xba4d('0x3')](_0xba4d('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xba4d('0x5'))},'read':{'type':Sequelize[_0xba4d('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xba4d('0x7')]('in',_0xba4d('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xba4d('0x9')](0x1fe)},'from':{'type':Sequelize[_0xba4d('0x9')]},'to':{'type':Sequelize[_0xba4d('0x3')](_0xba4d('0x4'))},'cc':{'type':Sequelize[_0xba4d('0x3')](_0xba4d('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xba4d('0x3')]},'sentAt':{'type':Sequelize[_0xba4d('0xa')]},'attach':{'type':Sequelize[_0xba4d('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xba4d('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xba4d('0x3')](_0xba4d('0x4'))},'originCc':{'type':Sequelize[_0xba4d('0x3')](_0xba4d('0x4'))},'originChannel':{'type':Sequelize[_0xba4d('0x7')](_0xba4d('0xc'),_0xba4d('0xd')),'defaultValue':_0xba4d('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 7d15452..b4665e1 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 _0x63f1=['ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','json','undefined','limit','count','offset','status','set','Content-Range','update','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','attributes','length','find','body','destroy','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','Contacts','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','join','server/files/attachments','basename','List','CmContact','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','MailInteraction','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','rejectmessage','download','unix','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','headers','bcc','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','eml-format','moment','util','path'];(function(_0x5379d0,_0x49a1fb){var _0xb9120f=function(_0x572e9d){while(--_0x572e9d){_0x5379d0['push'](_0x5379d0['shift']());}};_0xb9120f(++_0x49a1fb);}(_0x63f1,0x9d));var _0x163f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x63f1[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x163f('0x0'));var moment=require(_0x163f('0x1'));var BPromise=require('bluebird');var util=require(_0x163f('0x2'));var path=require(_0x163f('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x163f('0x4'));var htmlToText=require(_0x163f('0x5'));var qs=require(_0x163f('0x6'));var logger=require(_0x163f('0x7'))(_0x163f('0x8'));var interaction_log=require(_0x163f('0x7'))(_0x163f('0x9'));var config=require(_0x163f('0xa'));var db=require(_0x163f('0xb'))['db'];config['redis']=_[_0x163f('0xc')](config[_0x163f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x163f('0xe'))(new Redis(config[_0x163f('0xd')]));var htmlEntities=require(_0x163f('0xf'));require('./mailMessage.socket')[_0x163f('0x10')](socket);var jayson=require(_0x163f('0x11'));var client=jayson[_0x163f('0x12')][_0x163f('0x13')]({'port':0x232c});var client9003=jayson[_0x163f('0x12')]['http']({'port':0x232b});var client9002=jayson[_0x163f('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2102a1,_0xa42971,_0x483d63,_0x1c36ac){return new BPromise(function(_0x14c423,_0x2e631d){var _0x48273e=_0x1c36ac||client;return _0x48273e[_0x163f('0x14')](_0x2102a1,_0x483d63)[_0x163f('0x15')](function(_0x2a1a77){logger[_0x163f('0x16')](_0x163f('0x17'),_0xa42971,'request\x20sent');logger[_0x163f('0x18')](_0x163f('0x19'),_0xa42971,_0x163f('0x1a'),JSON[_0x163f('0x1b')](_0x2a1a77));if(_0x2a1a77[_0x163f('0x1c')]){if(_0x2a1a77[_0x163f('0x1c')]['code']===0x1f4){logger[_0x163f('0x1c')](_0x163f('0x17'),_0xa42971,_0x2a1a77['error'][_0x163f('0x1d')]);return _0x2e631d(_0x2a1a77[_0x163f('0x1c')][_0x163f('0x1d')]);}logger[_0x163f('0x1c')]('MailMessage,\x20%s,\x20%s',_0xa42971,_0x2a1a77['error']['message']);return _0x14c423(_0x2a1a77[_0x163f('0x1c')][_0x163f('0x1d')]);}else{logger[_0x163f('0x16')](_0x163f('0x17'),_0xa42971,'request\x20sent');_0x14c423(_0x2a1a77[_0x163f('0x1e')][_0x163f('0x1d')]);}})[_0x163f('0x1f')](function(_0x3d0eb6){logger[_0x163f('0x1c')](_0x163f('0x17'),_0xa42971,_0x3d0eb6);_0x2e631d(_0x3d0eb6);});});}function respondWithResult(_0x2f9e2e,_0x2d2f7a){_0x2d2f7a=_0x2d2f7a||0xc8;return function(_0x5d9b75){if(_0x5d9b75){return _0x2f9e2e['status'](_0x2d2f7a)[_0x163f('0x20')](_0x5d9b75);}};}function respondWithFilteredResult(_0x579168,_0x21e2df){return function(_0x2e52eb){if(_0x2e52eb){var _0x48a3cf=typeof _0x21e2df['offset']===_0x163f('0x21')&&typeof _0x21e2df[_0x163f('0x22')]===_0x163f('0x21');var _0x17e6f3=_0x2e52eb[_0x163f('0x23')];var _0x368c96=_0x48a3cf?0x0:_0x21e2df['offset'];var _0x53f6ab=_0x48a3cf?_0x2e52eb[_0x163f('0x23')]:_0x21e2df[_0x163f('0x24')]+_0x21e2df[_0x163f('0x22')];var _0x3d5096;if(_0x53f6ab>=_0x17e6f3){_0x53f6ab=_0x17e6f3;_0x3d5096=0xc8;}else{_0x3d5096=0xce;}_0x579168[_0x163f('0x25')](_0x3d5096);return _0x579168[_0x163f('0x26')](_0x163f('0x27'),_0x368c96+'-'+_0x53f6ab+'/'+_0x17e6f3)[_0x163f('0x20')](_0x2e52eb);}return null;};}function saveUpdates(_0x380c55){return function(_0x5df28f){if(_0x5df28f){return _0x5df28f[_0x163f('0x28')](_0x380c55)[_0x163f('0x15')](function(_0xfb5f5b){return _0xfb5f5b;});}return null;};}function removeEntity(_0xc0877a){return function(_0x504136){if(_0x504136){return _0x504136['destroy']()['then'](function(){_0xc0877a[_0x163f('0x25')](0xcc)[_0x163f('0x29')]();});}};}function handleEntityNotFound(_0x4ccb5a){return function(_0x544037){if(!_0x544037){_0x4ccb5a[_0x163f('0x2a')](0x194);}return _0x544037;};}function handleError(_0x13244d,_0x472aa0){_0x472aa0=_0x472aa0||0x1f4;return function(_0x433367){logger['error'](_0x433367[_0x163f('0x2b')]);if(_0x433367[_0x163f('0x2c')]){delete _0x433367[_0x163f('0x2c')];}_0x13244d['status'](_0x472aa0)[_0x163f('0x2d')](_0x433367);};}exports[_0x163f('0x2e')]=function(_0x2bd38b,_0x2812c1){var _0x134c1f={},_0x5c272d={},_0x20ef1b={'count':0x0,'rows':[]};var _0x2cf25c=_[_0x163f('0x2f')](db[_0x163f('0x30')][_0x163f('0x31')],function(_0x460f29){return{'name':_0x460f29[_0x163f('0x32')],'type':_0x460f29[_0x163f('0x33')][_0x163f('0x34')]};});_0x5c272d[_0x163f('0x35')]=_[_0x163f('0x2f')](_0x2cf25c,_0x163f('0x2c'));_0x5c272d['query']=_[_0x163f('0x36')](_0x2bd38b['query']);_0x5c272d[_0x163f('0x37')]=_[_0x163f('0x38')](_0x5c272d[_0x163f('0x35')],_0x5c272d[_0x163f('0x39')]);_0x134c1f['attributes']=_[_0x163f('0x38')](_0x5c272d[_0x163f('0x35')],qs[_0x163f('0x3a')](_0x2bd38b[_0x163f('0x39')][_0x163f('0x3a')]));_0x134c1f['attributes']=_0x134c1f['attributes']['length']?_0x134c1f['attributes']:_0x5c272d[_0x163f('0x35')];if(!_0x2bd38b['query'][_0x163f('0x3b')](_0x163f('0x3c'))){_0x134c1f[_0x163f('0x22')]=qs['limit'](_0x2bd38b[_0x163f('0x39')][_0x163f('0x22')]);_0x134c1f['offset']=qs[_0x163f('0x24')](_0x2bd38b[_0x163f('0x39')]['offset']);}_0x134c1f[_0x163f('0x3d')]=qs[_0x163f('0x3e')](_0x2bd38b[_0x163f('0x39')][_0x163f('0x3e')]);_0x134c1f[_0x163f('0x3f')]=qs[_0x163f('0x37')](_[_0x163f('0x40')](_0x2bd38b[_0x163f('0x39')],_0x5c272d[_0x163f('0x37')]),_0x2cf25c);if(_0x2bd38b[_0x163f('0x39')][_0x163f('0x41')]){_0x134c1f[_0x163f('0x3f')]=_[_0x163f('0x42')](_0x134c1f[_0x163f('0x3f')],{'$or':_[_0x163f('0x2f')](_0x2cf25c,function(_0x6cd0d6){if(_0x6cd0d6[_0x163f('0x33')]!==_0x163f('0x43')){var _0x3abe3e={};_0x3abe3e[_0x6cd0d6[_0x163f('0x2c')]]={'$like':'%'+_0x2bd38b[_0x163f('0x39')][_0x163f('0x41')]+'%'};return _0x3abe3e;}})});}_0x134c1f=_[_0x163f('0x42')]({},_0x134c1f,_0x2bd38b[_0x163f('0x44')]);var _0x572e6a={'where':_0x134c1f[_0x163f('0x3f')]};return db[_0x163f('0x30')][_0x163f('0x23')](_0x572e6a)[_0x163f('0x15')](function(_0x386c03){_0x20ef1b['count']=_0x386c03;if(_0x2bd38b[_0x163f('0x39')][_0x163f('0x45')]){_0x134c1f[_0x163f('0x46')]=[{'all':!![]}];}return db['MailMessage'][_0x163f('0x47')](_0x134c1f);})[_0x163f('0x15')](function(_0x4389cc){_0x20ef1b['rows']=_0x4389cc;return _0x20ef1b;})['then'](respondWithFilteredResult(_0x2812c1,_0x134c1f))[_0x163f('0x1f')](handleError(_0x2812c1,null));};exports[_0x163f('0x48')]=function(_0x167987,_0x2b4a8f){var _0x221700={'raw':!![],'where':{'id':_0x167987[_0x163f('0x49')]['id']}},_0x5276c2={};_0x5276c2[_0x163f('0x35')]=_['keys'](db[_0x163f('0x30')][_0x163f('0x31')]);_0x5276c2[_0x163f('0x39')]=_[_0x163f('0x36')](_0x167987['query']);_0x5276c2['filters']=_[_0x163f('0x38')](_0x5276c2[_0x163f('0x35')],_0x5276c2[_0x163f('0x39')]);_0x221700[_0x163f('0x4a')]=_[_0x163f('0x38')](_0x5276c2[_0x163f('0x35')],qs[_0x163f('0x3a')](_0x167987['query'][_0x163f('0x3a')]));_0x221700['attributes']=_0x221700[_0x163f('0x4a')][_0x163f('0x4b')]?_0x221700['attributes']:_0x5276c2[_0x163f('0x35')];if(_0x167987[_0x163f('0x39')][_0x163f('0x45')]){_0x221700[_0x163f('0x46')]=[{'all':!![]}];}_0x221700=_[_0x163f('0x42')]({},_0x221700,_0x167987[_0x163f('0x44')]);return db[_0x163f('0x30')][_0x163f('0x4c')](_0x221700)[_0x163f('0x15')](handleEntityNotFound(_0x2b4a8f,null))[_0x163f('0x15')](respondWithResult(_0x2b4a8f,null))[_0x163f('0x1f')](handleError(_0x2b4a8f,null));};exports[_0x163f('0x28')]=function(_0x461efd,_0x42eeec){if(_0x461efd[_0x163f('0x4d')]['id']){delete _0x461efd['body']['id'];}return db[_0x163f('0x30')][_0x163f('0x4c')]({'where':{'id':_0x461efd[_0x163f('0x49')]['id']}})['then'](handleEntityNotFound(_0x42eeec,null))[_0x163f('0x15')](saveUpdates(_0x461efd[_0x163f('0x4d')],null))[_0x163f('0x15')](respondWithResult(_0x42eeec,null))[_0x163f('0x1f')](handleError(_0x42eeec,null));};exports[_0x163f('0x4e')]=function(_0x2e857a,_0x63ea50){return db[_0x163f('0x30')][_0x163f('0x4c')]({'where':{'id':_0x2e857a[_0x163f('0x49')]['id']}})[_0x163f('0x15')](handleEntityNotFound(_0x63ea50,null))[_0x163f('0x15')](removeEntity(_0x63ea50,null))[_0x163f('0x1f')](handleError(_0x63ea50,null));};exports[_0x163f('0x4f')]=function(_0x3968e8,_0x1e58de){return db[_0x163f('0x30')][_0x163f('0x4f')]()[_0x163f('0x15')](respondWithResult(_0x1e58de,null))[_0x163f('0x1f')](handleError(_0x1e58de,null));};exports[_0x163f('0x50')]=function(_0x3b87ea,_0x4d482d){return db['MailMessage'][_0x163f('0x50')](_0x3b87ea[_0x163f('0x4d')])[_0x163f('0x15')](function(_0x561060){if(_0x561060){if(_0x561060['direction']===_0x163f('0x51')&&!_0x561060[_0x163f('0x52')]){var _0x4c0c7b,_0x398f35,_0x71ea40;if(_0x3b87ea[_0x163f('0x4d')]['to']){_0x398f35=_0x3b87ea[_0x163f('0x4d')]['to'][_0x163f('0x53')](',')[0x0];}return db[_0x163f('0x54')][_0x163f('0x55')]({'where':{'id':_0x561060[_0x163f('0x56')]},'include':[{'model':db[_0x163f('0x57')],'as':'List','include':[{'model':db['CmContact'],'as':_0x163f('0x58'),'where':{'email':_0x398f35},'limit':0x1,'order':[['updatedAt',_0x163f('0x59')]]}]},{'model':db['MailServerOut'],'as':_0x163f('0x5a'),'raw':!![],'include':[{'model':db[_0x163f('0x5b')],'as':_0x163f('0x5b'),'raw':!![]}]}]})[_0x163f('0x15')](function(_0x48c7d8){_0x4c0c7b=_0x48c7d8;if(!_0x4c0c7b||!_0x4c0c7b[_0x163f('0x5a')])return;var _0x2ec109=_0x4c0c7b[_0x163f('0x5c')]();if(_0x3b87ea[_0x163f('0x4d')][_0x163f('0x5d')]&&_0x3b87ea['body'][_0x163f('0x5d')]['length']){for(var _0x22e37e=0x0;_0x22e37e<_0x3b87ea[_0x163f('0x4d')][_0x163f('0x5d')][_0x163f('0x4b')];_0x22e37e+=0x1){_0x3b87ea['body'][_0x163f('0x5d')][_0x22e37e]={'filename':_0x3b87ea[_0x163f('0x4d')][_0x163f('0x5d')][_0x22e37e][_0x163f('0x2c')],'path':path[_0x163f('0x5e')](config['root'],_0x163f('0x5f'),_0x3b87ea[_0x163f('0x4d')][_0x163f('0x5d')][_0x22e37e][_0x163f('0x60')])};}}_0x71ea40={'account':_0x2ec109,'message':_0x3b87ea[_0x163f('0x4d')]};return;})['then'](function(){if(_0x4c0c7b['List']){if(_0x4c0c7b[_0x163f('0x61')][_0x163f('0x58')][_0x163f('0x4b')]){return _0x4c0c7b[_0x163f('0x61')][_0x163f('0x58')][0x0];}else{return db[_0x163f('0x62')][_0x163f('0x50')](_[_0x163f('0xc')](_0x3b87ea[_0x163f('0x4d')],{'firstName':_0x3b87ea[_0x163f('0x4d')]['to'],'email':_0x3b87ea['body']['to'],'phone':_0x3b87ea[_0x163f('0x4d')]['to'],'ListId':_0x4c0c7b['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0x163f('0x15')](function(){if(_0x71ea40){return respondWithRpcPromise('SendMail',_0x163f('0x63'),_0x71ea40,client9003)['then'](function(_0x3b0054){return _0x561060[_0x163f('0x28')]({'read':!![],'messageId':_0x3b0054['messageId'],'sentAt':moment()[_0x163f('0x64')](_0x163f('0x65'))});})[_0x163f('0x1f')](function(_0x4a2457){logger[_0x163f('0x1c')]('%s',JSON[_0x163f('0x1b')](_0x4a2457));return _0x561060;});}return _0x561060;});}return _0x561060;}})[_0x163f('0x15')](respondWithResult(_0x4d482d,0xc9))['catch'](handleError(_0x4d482d,null));};exports[_0x163f('0x66')]=function(_0x31a44c,_0x5d5e96){var _0x356b3c={'agent':{},'channel':_0x163f('0x67')};if(_0x31a44c[_0x163f('0x4d')]['id']){delete _0x31a44c[_0x163f('0x4d')]['id'];}_0x31a44c[_0x163f('0x4d')][_0x163f('0x68')]=!![];_0x31a44c['body'][_0x163f('0x69')]=moment()['format'](_0x163f('0x65'));_0x31a44c[_0x163f('0x4d')][_0x163f('0x6a')]=_0x31a44c['body'][_0x163f('0x6a')]||_0x31a44c[_0x163f('0x6b')]['id'];_0x356b3c['agent']['id']=_0x31a44c[_0x163f('0x4d')][_0x163f('0x6a')];return db[_0x163f('0x30')]['find']({'where':{'id':_0x31a44c[_0x163f('0x49')]['id'],'UserId':null}})[_0x163f('0x15')](handleEntityNotFound(_0x5d5e96,null))[_0x163f('0x15')](saveUpdates(_0x31a44c[_0x163f('0x4d')],null))[_0x163f('0x15')](function(_0x15cf08){if(_0x15cf08){_0x356b3c[_0x163f('0x1d')]=_0x15cf08['get']({'plain':!![]});return db[_0x163f('0x6c')][_0x163f('0x4c')]({'where':{'id':_0x15cf08['MailInteractionId']}});}return null;})[_0x163f('0x15')](handleEntityNotFound(_0x5d5e96,null))[_0x163f('0x15')](function(_0x54a4b7){if(_0x54a4b7){return _0x54a4b7[_0x163f('0x28')]({'UserId':_0x31a44c[_0x163f('0x4d')][_0x163f('0x6a')],'read1stAt':_[_0x163f('0x6d')](_0x54a4b7[_0x163f('0x6e')])?moment()[_0x163f('0x64')](_0x163f('0x65')):undefined});}return null;})[_0x163f('0x15')](function(_0x493abc){if(_0x493abc){_0x356b3c[_0x163f('0x6f')]=_0x493abc['get']({'plain':!![]});interaction_log['info'](_0x163f('0x70'),_0x31a44c[_0x163f('0x6b')]['id'],_0x31a44c[_0x163f('0x6b')][_0x163f('0x2c')],_0x31a44c[_0x163f('0x6b')][_0x163f('0x71')],_0x356b3c[_0x163f('0x6f')]['id'],_0x31a44c[_0x163f('0x4d')]?JSON[_0x163f('0x1b')](_0x31a44c[_0x163f('0x4d')]):_0x163f('0x72'));return respondWithRpcPromise(_0x163f('0x73'),_0x163f('0x74'),_0x356b3c);}return null;})[_0x163f('0x15')](function(_0xc463ad){var _0x578b72=_0x163f('0x75')+_0xc463ad[_0x163f('0x1d')][_0x163f('0x76')];return db[_0x163f('0x77')]['query'](_0x578b72,{'type':db[_0x163f('0x78')][_0x163f('0x79')]['SELECT'],'raw':!![]})[_0x163f('0x15')](function(_0x3a392b){return _0x3a392b;});})[_0x163f('0x15')](function(_0x64f73c){if(_0x64f73c){_0x356b3c[_0x163f('0x1d')][_0x163f('0x7a')]=_0x64f73c[0x0];if(!_0x31a44c['body'][_0x163f('0x6a')])return;return db[_0x163f('0x7b')][_0x163f('0x4c')]({'where':{'id':_0x31a44c[_0x163f('0x4d')][_0x163f('0x6a')],'role':_0x163f('0x7c')},'attributes':['id',_0x163f('0x2c'),_0x163f('0x7d'),_0x163f('0x7e'),_0x163f('0x7f')],'raw':!![]});}return null;})['then'](function(_0x2ab8db){if(!_0x2ab8db)return null;_0x356b3c[_0x163f('0x1d')][_0x163f('0x7c')]=_0x2ab8db;return _0x356b3c;})['then'](function(_0x2f535e){if(_0x2f535e){if(_0x31a44c[_0x163f('0x4d')][_0x163f('0x80')]){_0x356b3c[_0x163f('0x1d')][_0x163f('0x81')]=util[_0x163f('0x64')](_0x163f('0x82'),_0x31a44c['user']['name']);_0x356b3c[_0x163f('0x1d')][_0x163f('0x83')]=_0x356b3c[_0x163f('0x83')];_0x356b3c['message'][_0x163f('0x84')]=_0x356b3c['channel'];_0x356b3c[_0x163f('0x1d')][_0x163f('0x85')]='accept';_0x356b3c[_0x163f('0x1d')][_0x163f('0x4d')]=htmlToText[_0x163f('0x86')](_0x356b3c[_0x163f('0x1d')][_0x163f('0x4d')]);return respondWithRpcPromise('EventManager',_0x163f('0x87'),{'event':_0x163f('0x88'),'message':_0x356b3c[_0x163f('0x1d')]},client9002)[_0x163f('0x15')](function(){return _0x356b3c;});}return _0x356b3c;}return null;})['then'](respondWithResult(_0x5d5e96,null))['catch'](handleError(_0x5d5e96,null));};exports['reject']=function(_0x25633e,_0x2ba034){var _0x556e4f={'agent':{},'channel':_0x163f('0x67')};if(_0x25633e[_0x163f('0x4d')]['id']){delete _0x25633e[_0x163f('0x4d')]['id'];}_0x25633e[_0x163f('0x4d')][_0x163f('0x6a')]=_0x25633e[_0x163f('0x4d')][_0x163f('0x6a')]||_0x25633e[_0x163f('0x6b')]['id'];_0x556e4f['agent']['id']=_0x25633e[_0x163f('0x4d')]['UserId'];return db['MailMessage'][_0x163f('0x4c')]({'where':{'id':_0x25633e[_0x163f('0x49')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ba034,null))[_0x163f('0x15')](function(_0x3ba591){if(_0x3ba591){_0x556e4f[_0x163f('0x1d')]=_0x3ba591['get']({'plain':!![]});return db[_0x163f('0x6c')][_0x163f('0x4c')]({'where':{'id':_0x3ba591[_0x163f('0x89')]}});}return null;})['then'](handleEntityNotFound(_0x2ba034,null))[_0x163f('0x15')](function(_0x2f84e2){if(_0x2f84e2){_0x556e4f[_0x163f('0x6f')]=_0x2f84e2['get']({'plain':!![]});interaction_log['info'](_0x163f('0x8a'),_0x25633e[_0x163f('0x6b')]['id'],_0x25633e[_0x163f('0x6b')][_0x163f('0x2c')],_0x25633e[_0x163f('0x6b')][_0x163f('0x71')],_0x556e4f['interaction']['id'],_0x25633e[_0x163f('0x4d')]?JSON[_0x163f('0x1b')](_0x25633e[_0x163f('0x4d')]):_0x163f('0x72'));return respondWithRpcPromise('RejectMessage',_0x163f('0x8b'),_0x556e4f);}return null;})[_0x163f('0x15')](function(_0x130883){var _0x74193f=_0x163f('0x75')+_0x130883[_0x163f('0x1d')][_0x163f('0x76')];return db[_0x163f('0x77')][_0x163f('0x39')](_0x74193f,{'type':db[_0x163f('0x78')][_0x163f('0x79')][_0x163f('0x8c')],'raw':!![]})[_0x163f('0x15')](function(_0x53b761){return _0x53b761;});})[_0x163f('0x15')](function(_0x2fd7fc){if(_0x2fd7fc){_0x556e4f[_0x163f('0x1d')][_0x163f('0x7a')]=_0x2fd7fc[0x0];if(!_0x25633e[_0x163f('0x4d')][_0x163f('0x6a')])return;return db[_0x163f('0x7b')][_0x163f('0x4c')]({'where':{'id':_0x25633e[_0x163f('0x4d')]['UserId'],'role':_0x163f('0x7c')},'attributes':['id',_0x163f('0x2c'),_0x163f('0x7d'),_0x163f('0x7e'),_0x163f('0x7f')],'raw':!![]});}return null;})['then'](function(_0x4960b6){if(!_0x4960b6)return null;_0x556e4f[_0x163f('0x1d')][_0x163f('0x7c')]=_0x4960b6;return _0x556e4f;})[_0x163f('0x15')](function(_0x2f66d){if(_0x2f66d){_0x2f66d['message']['interface']=util[_0x163f('0x64')]('SIP/%s',_0x25633e[_0x163f('0x6b')][_0x163f('0x2c')]);_0x2f66d['message'][_0x163f('0x83')]=_0x556e4f[_0x163f('0x83')];_0x2f66d['message'][_0x163f('0x84')]=_0x556e4f['channel'];_0x2f66d[_0x163f('0x1d')][_0x163f('0x85')]='reject';_0x2f66d['message'][_0x163f('0x4d')]=htmlToText[_0x163f('0x86')](_0x556e4f[_0x163f('0x1d')]['body']);respondWithRpcPromise(_0x163f('0x87'),_0x163f('0x87'),{'event':_0x163f('0x8d'),'message':_0x2f66d[_0x163f('0x1d')]},client9002);return _0x556e4f;}return null;})[_0x163f('0x15')](respondWithResult(_0x2ba034,null))[_0x163f('0x1f')](handleError(_0x2ba034,null));};exports[_0x163f('0x8e')]=function(_0x1d795c,_0xcc7c36){var _0x2cd449=moment()[_0x163f('0x8f')]()['toString']();var _0x34d0f3=path[_0x163f('0x5e')](config['root'],_0x163f('0x90'),_0x163f('0x91'),_0x163f('0x92'));var _0x1430c0=path[_0x163f('0x5e')](config['root'],_0x163f('0x90'),'files','attachments');var _0x599033=util['format'](_0x163f('0x93'),_0x2cd449);return db[_0x163f('0x30')][_0x163f('0x4c')]({'where':{'id':_0x1d795c['params']['id']},'attributes':['id','body',_0x163f('0x94'),'to','cc','bcc',_0x163f('0x95'),_0x163f('0x96')],'include':_0x1d795c[_0x163f('0x39')][_0x163f('0x5d')]?[{'model':db[_0x163f('0x97')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0xcc7c36,null))['then'](function(_0xe1cb1d){if(_0xe1cb1d){var _0x4416a7=_0xe1cb1d;var _0x544eea={'from':_0x4416a7[_0x163f('0x94')],'to':_0x4416a7['to'],'subject':_0x4416a7['subject'],'html':htmlEntities['decode'](_0x4416a7[_0x163f('0x4d')]),'headers':{'Date':moment(_0x4416a7[_0x163f('0x96')])[_0x163f('0x64')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xe1cb1d['cc']){_0x544eea[_0x163f('0x98')]['Cc']=_0xe1cb1d['cc'];}if(_0xe1cb1d[_0x163f('0x99')]){_0x544eea[_0x163f('0x98')][_0x163f('0x9a')]=_0xe1cb1d[_0x163f('0x99')];}return new BPromise(function(_0x55f4a8,_0x205204){if(_0xe1cb1d[_0x163f('0x9b')]){for(var _0x13e86f=0x0;_0x13e86f<_0xe1cb1d['Attachments'][_0x163f('0x4b')];_0x13e86f++){var _0x2f340e=_0xe1cb1d[_0x163f('0x9b')][_0x13e86f];var _0x3ea55f=path['join'](_0x1430c0,_0x2f340e[_0x163f('0x60')]);if(fs[_0x163f('0x9c')](_0x3ea55f)){_0x544eea[_0x163f('0x5d')][_0x163f('0x9d')]({'name':_0x2f340e[_0x163f('0x2c')],'contentType':_0x2f340e[_0x163f('0x33')],'data':fs[_0x163f('0x9e')](_0x3ea55f)});}}}emlformat[_0x163f('0x9f')](_0x544eea,function(_0x1ad5ab,_0x5874af){if(_0x1ad5ab)return _0x205204(_0x1ad5ab);fs[_0x163f('0xa0')](path[_0x163f('0x5e')](_0x34d0f3,_0x599033),_0x5874af);return _0x55f4a8(_0x5874af);});});}})[_0x163f('0x15')](function(_0x40c4a6){if(_0x40c4a6){return _0xcc7c36['download'](path[_0x163f('0x5e')](_0x34d0f3,_0x599033),_0x599033,function(_0x46b432){if(!_0x46b432)fs['unlinkSync'](path['join'](_0x34d0f3,_0x599033));});}})[_0x163f('0x1f')](handleError(_0xcc7c36,null));}; \ No newline at end of file +var _0x7f4a=['Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','readFileSync','build','writeFileSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','html-entities','./mailMessage.socket','register','jayson/promise','http','client','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','status','json','offset','undefined','limit','count','set','then','destroy','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','body','catch','describe','create','direction','out','MailAccount','findOne','MailAccountId','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','attachments','join','server/files/attachments','List','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','update','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','readAt','format','UserId','user','agent','get','MailInteraction','isNil','read1stAt','interaction','info','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','channel','motionChannel','event','fromString','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','email','EventManager','rejectmessage','download','toString','root','tmp','files','message-%s.eml','subject','Attachment'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x7f4a,0x1e5));var _0xa7f4=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x7f4a[_0x11ca63];return _0x41f1f6;};'use strict';var emlformat=require(_0xa7f4('0x0'));var moment=require(_0xa7f4('0x1'));var BPromise=require(_0xa7f4('0x2'));var util=require(_0xa7f4('0x3'));var path=require(_0xa7f4('0x4'));var fs=require('fs');var _=require(_0xa7f4('0x5'));var Redis=require(_0xa7f4('0x6'));var htmlToText=require(_0xa7f4('0x7'));var qs=require(_0xa7f4('0x8'));var logger=require(_0xa7f4('0x9'))(_0xa7f4('0xa'));var interaction_log=require(_0xa7f4('0x9'))('mail-interactions');var config=require('../../config/environment');var db=require(_0xa7f4('0xb'))['db'];config[_0xa7f4('0xc')]=_[_0xa7f4('0xd')](config['redis'],{'host':_0xa7f4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7f4('0xc')]));var htmlEntities=require(_0xa7f4('0xf'));require(_0xa7f4('0x10'))[_0xa7f4('0x11')](socket);var jayson=require(_0xa7f4('0x12'));var client=jayson['client'][_0xa7f4('0x13')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0xa7f4('0x14')][_0xa7f4('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x4c4bc8,_0x591608,_0x5579af,_0x374f07){return new BPromise(function(_0x55e452,_0x2009a0){var _0x528354=_0x374f07||client;return _0x528354['request'](_0x4c4bc8,_0x5579af)['then'](function(_0x36b6c3){logger['info'](_0xa7f4('0x15'),_0x591608,_0xa7f4('0x16'));logger[_0xa7f4('0x17')](_0xa7f4('0x18'),_0x591608,'request\x20sent',JSON['stringify'](_0x36b6c3));if(_0x36b6c3[_0xa7f4('0x19')]){if(_0x36b6c3[_0xa7f4('0x19')][_0xa7f4('0x1a')]===0x1f4){logger[_0xa7f4('0x19')]('MailMessage,\x20%s,\x20%s',_0x591608,_0x36b6c3[_0xa7f4('0x19')][_0xa7f4('0x1b')]);return _0x2009a0(_0x36b6c3[_0xa7f4('0x19')][_0xa7f4('0x1b')]);}logger[_0xa7f4('0x19')](_0xa7f4('0x15'),_0x591608,_0x36b6c3[_0xa7f4('0x19')][_0xa7f4('0x1b')]);return _0x55e452(_0x36b6c3['error'][_0xa7f4('0x1b')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x591608,_0xa7f4('0x16'));_0x55e452(_0x36b6c3['result'][_0xa7f4('0x1b')]);}})['catch'](function(_0x15c148){logger[_0xa7f4('0x19')](_0xa7f4('0x15'),_0x591608,_0x15c148);_0x2009a0(_0x15c148);});});}function respondWithResult(_0x4a305b,_0x14f5d5){_0x14f5d5=_0x14f5d5||0xc8;return function(_0x247ff7){if(_0x247ff7){return _0x4a305b[_0xa7f4('0x1c')](_0x14f5d5)[_0xa7f4('0x1d')](_0x247ff7);}};}function respondWithFilteredResult(_0x504b6e,_0x2d8aff){return function(_0x4528d7){if(_0x4528d7){var _0x43b60f=typeof _0x2d8aff[_0xa7f4('0x1e')]===_0xa7f4('0x1f')&&typeof _0x2d8aff[_0xa7f4('0x20')]==='undefined';var _0x3e5050=_0x4528d7[_0xa7f4('0x21')];var _0x3b124b=_0x43b60f?0x0:_0x2d8aff['offset'];var _0x2f7cd1=_0x43b60f?_0x4528d7[_0xa7f4('0x21')]:_0x2d8aff[_0xa7f4('0x1e')]+_0x2d8aff[_0xa7f4('0x20')];var _0x41e00f;if(_0x2f7cd1>=_0x3e5050){_0x2f7cd1=_0x3e5050;_0x41e00f=0xc8;}else{_0x41e00f=0xce;}_0x504b6e[_0xa7f4('0x1c')](_0x41e00f);return _0x504b6e[_0xa7f4('0x22')]('Content-Range',_0x3b124b+'-'+_0x2f7cd1+'/'+_0x3e5050)[_0xa7f4('0x1d')](_0x4528d7);}return null;};}function saveUpdates(_0xde12f3){return function(_0x11d301){if(_0x11d301){return _0x11d301['update'](_0xde12f3)[_0xa7f4('0x23')](function(_0x55e0b1){return _0x55e0b1;});}return null;};}function removeEntity(_0x2435da){return function(_0x42fcd7){if(_0x42fcd7){return _0x42fcd7[_0xa7f4('0x24')]()['then'](function(){_0x2435da[_0xa7f4('0x1c')](0xcc)[_0xa7f4('0x25')]();});}};}function handleEntityNotFound(_0x3a6cc0){return function(_0x818efb){if(!_0x818efb){_0x3a6cc0[_0xa7f4('0x26')](0x194);}return _0x818efb;};}function handleError(_0x43a59f,_0x2cb8ca){_0x2cb8ca=_0x2cb8ca||0x1f4;return function(_0x33be11){logger[_0xa7f4('0x19')](_0x33be11[_0xa7f4('0x27')]);if(_0x33be11[_0xa7f4('0x28')]){delete _0x33be11[_0xa7f4('0x28')];}_0x43a59f[_0xa7f4('0x1c')](_0x2cb8ca)[_0xa7f4('0x29')](_0x33be11);};}exports[_0xa7f4('0x2a')]=function(_0x270a8b,_0x54964f){var _0x937d1c={},_0x562f07={},_0x2a99df={'count':0x0,'rows':[]};var _0x36b9a9=_['map'](db[_0xa7f4('0x2b')][_0xa7f4('0x2c')],function(_0xa9c1b8){return{'name':_0xa9c1b8['fieldName'],'type':_0xa9c1b8[_0xa7f4('0x2d')][_0xa7f4('0x2e')]};});_0x562f07[_0xa7f4('0x2f')]=_[_0xa7f4('0x30')](_0x36b9a9,_0xa7f4('0x28'));_0x562f07[_0xa7f4('0x31')]=_['keys'](_0x270a8b[_0xa7f4('0x31')]);_0x562f07[_0xa7f4('0x32')]=_[_0xa7f4('0x33')](_0x562f07[_0xa7f4('0x2f')],_0x562f07[_0xa7f4('0x31')]);_0x937d1c[_0xa7f4('0x34')]=_[_0xa7f4('0x33')](_0x562f07[_0xa7f4('0x2f')],qs[_0xa7f4('0x35')](_0x270a8b['query'][_0xa7f4('0x35')]));_0x937d1c['attributes']=_0x937d1c[_0xa7f4('0x34')][_0xa7f4('0x36')]?_0x937d1c[_0xa7f4('0x34')]:_0x562f07[_0xa7f4('0x2f')];if(!_0x270a8b[_0xa7f4('0x31')][_0xa7f4('0x37')](_0xa7f4('0x38'))){_0x937d1c[_0xa7f4('0x20')]=qs['limit'](_0x270a8b[_0xa7f4('0x31')]['limit']);_0x937d1c[_0xa7f4('0x1e')]=qs[_0xa7f4('0x1e')](_0x270a8b['query'][_0xa7f4('0x1e')]);}_0x937d1c[_0xa7f4('0x39')]=qs[_0xa7f4('0x3a')](_0x270a8b[_0xa7f4('0x31')][_0xa7f4('0x3a')]);_0x937d1c[_0xa7f4('0x3b')]=qs['filters'](_[_0xa7f4('0x3c')](_0x270a8b['query'],_0x562f07[_0xa7f4('0x32')]),_0x36b9a9);if(_0x270a8b[_0xa7f4('0x31')][_0xa7f4('0x3d')]){_0x937d1c[_0xa7f4('0x3b')]=_['merge'](_0x937d1c[_0xa7f4('0x3b')],{'$or':_[_0xa7f4('0x30')](_0x36b9a9,function(_0x13e4b9){if(_0x13e4b9[_0xa7f4('0x2d')]!==_0xa7f4('0x3e')){var _0x1fce83={};_0x1fce83[_0x13e4b9[_0xa7f4('0x28')]]={'$like':'%'+_0x270a8b[_0xa7f4('0x31')]['filter']+'%'};return _0x1fce83;}})});}_0x937d1c=_['merge']({},_0x937d1c,_0x270a8b[_0xa7f4('0x3f')]);var _0x36470a={'where':_0x937d1c['where']};return db[_0xa7f4('0x2b')][_0xa7f4('0x21')](_0x36470a)[_0xa7f4('0x23')](function(_0x2880dd){_0x2a99df[_0xa7f4('0x21')]=_0x2880dd;if(_0x270a8b[_0xa7f4('0x31')][_0xa7f4('0x40')]){_0x937d1c[_0xa7f4('0x41')]=[{'all':!![]}];}return db[_0xa7f4('0x2b')][_0xa7f4('0x42')](_0x937d1c);})[_0xa7f4('0x23')](function(_0x16f225){_0x2a99df['rows']=_0x16f225;return _0x2a99df;})[_0xa7f4('0x23')](respondWithFilteredResult(_0x54964f,_0x937d1c))['catch'](handleError(_0x54964f,null));};exports[_0xa7f4('0x43')]=function(_0xfd57c7,_0x22a62b){var _0x17cdec={'raw':!![],'where':{'id':_0xfd57c7[_0xa7f4('0x44')]['id']}},_0x37b774={};_0x37b774[_0xa7f4('0x2f')]=_[_0xa7f4('0x45')](db[_0xa7f4('0x2b')][_0xa7f4('0x2c')]);_0x37b774['query']=_[_0xa7f4('0x45')](_0xfd57c7[_0xa7f4('0x31')]);_0x37b774[_0xa7f4('0x32')]=_[_0xa7f4('0x33')](_0x37b774[_0xa7f4('0x2f')],_0x37b774[_0xa7f4('0x31')]);_0x17cdec[_0xa7f4('0x34')]=_[_0xa7f4('0x33')](_0x37b774[_0xa7f4('0x2f')],qs[_0xa7f4('0x35')](_0xfd57c7[_0xa7f4('0x31')][_0xa7f4('0x35')]));_0x17cdec['attributes']=_0x17cdec['attributes'][_0xa7f4('0x36')]?_0x17cdec[_0xa7f4('0x34')]:_0x37b774[_0xa7f4('0x2f')];if(_0xfd57c7['query'][_0xa7f4('0x40')]){_0x17cdec[_0xa7f4('0x41')]=[{'all':!![]}];}_0x17cdec=_['merge']({},_0x17cdec,_0xfd57c7['options']);return db['MailMessage'][_0xa7f4('0x46')](_0x17cdec)[_0xa7f4('0x23')](handleEntityNotFound(_0x22a62b,null))[_0xa7f4('0x23')](respondWithResult(_0x22a62b,null))['catch'](handleError(_0x22a62b,null));};exports['update']=function(_0x1a2089,_0x511435){if(_0x1a2089['body']['id']){delete _0x1a2089[_0xa7f4('0x47')]['id'];}return db['MailMessage'][_0xa7f4('0x46')]({'where':{'id':_0x1a2089[_0xa7f4('0x44')]['id']}})['then'](handleEntityNotFound(_0x511435,null))[_0xa7f4('0x23')](saveUpdates(_0x1a2089[_0xa7f4('0x47')],null))[_0xa7f4('0x23')](respondWithResult(_0x511435,null))['catch'](handleError(_0x511435,null));};exports['destroy']=function(_0x28b64c,_0x84a7f9){return db['MailMessage'][_0xa7f4('0x46')]({'where':{'id':_0x28b64c['params']['id']}})[_0xa7f4('0x23')](handleEntityNotFound(_0x84a7f9,null))[_0xa7f4('0x23')](removeEntity(_0x84a7f9,null))[_0xa7f4('0x48')](handleError(_0x84a7f9,null));};exports[_0xa7f4('0x49')]=function(_0x2dbf1a,_0x203fd8){return db[_0xa7f4('0x2b')][_0xa7f4('0x49')]()[_0xa7f4('0x23')](respondWithResult(_0x203fd8,null))['catch'](handleError(_0x203fd8,null));};exports[_0xa7f4('0x4a')]=function(_0x313ec8,_0x12daa6){return db[_0xa7f4('0x2b')][_0xa7f4('0x4a')](_0x313ec8[_0xa7f4('0x47')])[_0xa7f4('0x23')](function(_0x2c231d){if(_0x2c231d){if(_0x2c231d[_0xa7f4('0x4b')]===_0xa7f4('0x4c')&&!_0x2c231d['secret']){var _0x3fe409,_0x197fbf,_0x320d74;if(_0x313ec8[_0xa7f4('0x47')]['to']){_0x197fbf=_0x313ec8[_0xa7f4('0x47')]['to']['split'](',')[0x0];}return db[_0xa7f4('0x4d')][_0xa7f4('0x4e')]({'where':{'id':_0x2c231d[_0xa7f4('0x4f')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xa7f4('0x50'),'where':{'email':_0x197fbf},'limit':0x1,'order':[[_0xa7f4('0x51'),'DESC']]}]},{'model':db[_0xa7f4('0x52')],'as':_0xa7f4('0x53'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa7f4('0x54'),'raw':!![]}]}]})[_0xa7f4('0x23')](function(_0x103303){_0x3fe409=_0x103303;if(!_0x3fe409||!_0x3fe409['Smtp'])return;var _0x4a186b=_0x3fe409['getSmtpOptions']();if(_0x313ec8[_0xa7f4('0x47')][_0xa7f4('0x55')]&&_0x313ec8[_0xa7f4('0x47')][_0xa7f4('0x55')][_0xa7f4('0x36')]){for(var _0x480f67=0x0;_0x480f67<_0x313ec8['body']['attachments'][_0xa7f4('0x36')];_0x480f67+=0x1){_0x313ec8[_0xa7f4('0x47')]['attachments'][_0x480f67]={'filename':_0x313ec8['body'][_0xa7f4('0x55')][_0x480f67]['name'],'path':path[_0xa7f4('0x56')](config['root'],_0xa7f4('0x57'),_0x313ec8[_0xa7f4('0x47')][_0xa7f4('0x55')][_0x480f67]['basename'])};}}_0x320d74={'account':_0x4a186b,'message':_0x313ec8[_0xa7f4('0x47')]};return;})[_0xa7f4('0x23')](function(){if(_0x3fe409['List']){if(_0x3fe409[_0xa7f4('0x58')]['Contacts'][_0xa7f4('0x36')]){return _0x3fe409[_0xa7f4('0x58')][_0xa7f4('0x50')][0x0];}else{return db[_0xa7f4('0x59')][_0xa7f4('0x4a')](_[_0xa7f4('0xd')](_0x313ec8[_0xa7f4('0x47')],{'firstName':_0x313ec8[_0xa7f4('0x47')]['to'],'email':_0x313ec8[_0xa7f4('0x47')]['to'],'phone':_0x313ec8[_0xa7f4('0x47')]['to'],'ListId':_0x3fe409[_0xa7f4('0x5a')]}));}}else{throw new Error(_0xa7f4('0x5b'));}})[_0xa7f4('0x23')](function(){if(_0x320d74){return respondWithRpcPromise(_0xa7f4('0x5c'),_0xa7f4('0x5d'),_0x320d74,client9003)[_0xa7f4('0x23')](function(_0x301da9){return _0x2c231d[_0xa7f4('0x5e')]({'read':!![],'messageId':_0x301da9[_0xa7f4('0x5f')],'sentAt':moment()['format'](_0xa7f4('0x60'))});})[_0xa7f4('0x48')](function(_0x5e4ffe){logger[_0xa7f4('0x19')]('%s',JSON[_0xa7f4('0x61')](_0x5e4ffe));return _0x2c231d;});}return _0x2c231d;});}return _0x2c231d;}})[_0xa7f4('0x23')](respondWithResult(_0x12daa6,0xc9))['catch'](handleError(_0x12daa6,null));};exports[_0xa7f4('0x62')]=function(_0x5d7ed1,_0x2e7ae4){var _0x1d4c90={'agent':{},'channel':_0xa7f4('0x63')};if(_0x5d7ed1[_0xa7f4('0x47')]['id']){delete _0x5d7ed1[_0xa7f4('0x47')]['id'];}_0x5d7ed1[_0xa7f4('0x47')]['read']=!![];_0x5d7ed1[_0xa7f4('0x47')][_0xa7f4('0x64')]=moment()[_0xa7f4('0x65')](_0xa7f4('0x60'));_0x5d7ed1[_0xa7f4('0x47')][_0xa7f4('0x66')]=_0x5d7ed1['body'][_0xa7f4('0x66')]||_0x5d7ed1[_0xa7f4('0x67')]['id'];_0x1d4c90[_0xa7f4('0x68')]['id']=_0x5d7ed1['body'][_0xa7f4('0x66')];return db['MailMessage'][_0xa7f4('0x46')]({'where':{'id':_0x5d7ed1[_0xa7f4('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e7ae4,null))['then'](saveUpdates(_0x5d7ed1[_0xa7f4('0x47')],null))['then'](function(_0xa65850){if(_0xa65850){_0x1d4c90['message']=_0xa65850[_0xa7f4('0x69')]({'plain':!![]});return db[_0xa7f4('0x6a')][_0xa7f4('0x46')]({'where':{'id':_0xa65850['MailInteractionId']}});}return null;})[_0xa7f4('0x23')](handleEntityNotFound(_0x2e7ae4,null))[_0xa7f4('0x23')](function(_0x59616e){if(_0x59616e){return _0x59616e[_0xa7f4('0x5e')]({'UserId':_0x5d7ed1[_0xa7f4('0x47')][_0xa7f4('0x66')],'read1stAt':_[_0xa7f4('0x6b')](_0x59616e[_0xa7f4('0x6c')])?moment()[_0xa7f4('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5913f9){if(_0x5913f9){_0x1d4c90[_0xa7f4('0x6d')]=_0x5913f9[_0xa7f4('0x69')]({'plain':!![]});interaction_log[_0xa7f4('0x6e')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d7ed1[_0xa7f4('0x67')]['id'],_0x5d7ed1[_0xa7f4('0x67')][_0xa7f4('0x28')],_0x5d7ed1[_0xa7f4('0x67')][_0xa7f4('0x6f')],_0x1d4c90['interaction']['id'],_0x5d7ed1[_0xa7f4('0x47')]?JSON[_0xa7f4('0x61')](_0x5d7ed1['body']):_0xa7f4('0x70'));return respondWithRpcPromise(_0xa7f4('0x71'),_0xa7f4('0x72'),_0x1d4c90);}return null;})[_0xa7f4('0x23')](function(_0x4901c8){var _0x49c847='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4901c8[_0xa7f4('0x1b')][_0xa7f4('0x73')];return db['sequelize'][_0xa7f4('0x31')](_0x49c847,{'type':db[_0xa7f4('0x74')]['QueryTypes'][_0xa7f4('0x75')],'raw':!![]})[_0xa7f4('0x23')](function(_0x4e197b){return _0x4e197b;});})[_0xa7f4('0x23')](function(_0x2c9992){if(_0x2c9992){_0x1d4c90[_0xa7f4('0x1b')][_0xa7f4('0x76')]=_0x2c9992[0x0];if(!_0x5d7ed1['body'][_0xa7f4('0x66')])return;return db[_0xa7f4('0x77')][_0xa7f4('0x46')]({'where':{'id':_0x5d7ed1[_0xa7f4('0x47')][_0xa7f4('0x66')],'role':'agent'},'attributes':['id',_0xa7f4('0x28'),_0xa7f4('0x78'),'email',_0xa7f4('0x79')],'raw':!![]});}return null;})[_0xa7f4('0x23')](function(_0x512922){if(!_0x512922)return null;_0x1d4c90['message']['agent']=_0x512922;return _0x1d4c90;})['then'](function(_0x1b9ec2){if(_0x1b9ec2){if(_0x5d7ed1[_0xa7f4('0x47')][_0xa7f4('0x7a')]){_0x1d4c90[_0xa7f4('0x1b')][_0xa7f4('0x7b')]=util[_0xa7f4('0x65')]('SIP/%s',_0x5d7ed1[_0xa7f4('0x67')][_0xa7f4('0x28')]);_0x1d4c90[_0xa7f4('0x1b')][_0xa7f4('0x7c')]=_0x1d4c90[_0xa7f4('0x7c')];_0x1d4c90[_0xa7f4('0x1b')][_0xa7f4('0x7d')]=_0x1d4c90[_0xa7f4('0x7c')];_0x1d4c90[_0xa7f4('0x1b')][_0xa7f4('0x7e')]=_0xa7f4('0x62');_0x1d4c90[_0xa7f4('0x1b')]['body']=htmlToText[_0xa7f4('0x7f')](_0x1d4c90[_0xa7f4('0x1b')][_0xa7f4('0x47')]);return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x1d4c90[_0xa7f4('0x1b')]},client9002)[_0xa7f4('0x23')](function(){return _0x1d4c90;});}return _0x1d4c90;}return null;})['then'](respondWithResult(_0x2e7ae4,null))[_0xa7f4('0x48')](handleError(_0x2e7ae4,null));};exports[_0xa7f4('0x80')]=function(_0x5ef3b1,_0x5ce974){var _0x22a53a={'agent':{},'channel':_0xa7f4('0x63')};if(_0x5ef3b1[_0xa7f4('0x47')]['id']){delete _0x5ef3b1[_0xa7f4('0x47')]['id'];}_0x5ef3b1[_0xa7f4('0x47')][_0xa7f4('0x66')]=_0x5ef3b1[_0xa7f4('0x47')]['UserId']||_0x5ef3b1[_0xa7f4('0x67')]['id'];_0x22a53a['agent']['id']=_0x5ef3b1['body'][_0xa7f4('0x66')];return db['MailMessage'][_0xa7f4('0x46')]({'where':{'id':_0x5ef3b1['params']['id'],'UserId':null}})[_0xa7f4('0x23')](handleEntityNotFound(_0x5ce974,null))[_0xa7f4('0x23')](function(_0x5618b3){if(_0x5618b3){_0x22a53a[_0xa7f4('0x1b')]=_0x5618b3[_0xa7f4('0x69')]({'plain':!![]});return db[_0xa7f4('0x6a')][_0xa7f4('0x46')]({'where':{'id':_0x5618b3[_0xa7f4('0x81')]}});}return null;})[_0xa7f4('0x23')](handleEntityNotFound(_0x5ce974,null))[_0xa7f4('0x23')](function(_0x1eccde){if(_0x1eccde){_0x22a53a[_0xa7f4('0x6d')]=_0x1eccde[_0xa7f4('0x69')]({'plain':!![]});interaction_log[_0xa7f4('0x6e')](_0xa7f4('0x82'),_0x5ef3b1['user']['id'],_0x5ef3b1['user']['name'],_0x5ef3b1[_0xa7f4('0x67')]['role'],_0x22a53a['interaction']['id'],_0x5ef3b1['body']?JSON[_0xa7f4('0x61')](_0x5ef3b1[_0xa7f4('0x47')]):_0xa7f4('0x70'));return respondWithRpcPromise(_0xa7f4('0x83'),_0xa7f4('0x84'),_0x22a53a);}return null;})[_0xa7f4('0x23')](function(_0x5e7197){var _0x1e9843=_0xa7f4('0x85')+_0x5e7197['message'][_0xa7f4('0x73')];return db[_0xa7f4('0x86')][_0xa7f4('0x31')](_0x1e9843,{'type':db[_0xa7f4('0x74')][_0xa7f4('0x87')][_0xa7f4('0x75')],'raw':!![]})[_0xa7f4('0x23')](function(_0x495f4a){return _0x495f4a;});})[_0xa7f4('0x23')](function(_0x27e218){if(_0x27e218){_0x22a53a[_0xa7f4('0x1b')][_0xa7f4('0x76')]=_0x27e218[0x0];if(!_0x5ef3b1[_0xa7f4('0x47')][_0xa7f4('0x66')])return;return db[_0xa7f4('0x77')][_0xa7f4('0x46')]({'where':{'id':_0x5ef3b1[_0xa7f4('0x47')]['UserId'],'role':'agent'},'attributes':['id','name',_0xa7f4('0x78'),_0xa7f4('0x88'),_0xa7f4('0x79')],'raw':!![]});}return null;})[_0xa7f4('0x23')](function(_0x3528b7){if(!_0x3528b7)return null;_0x22a53a[_0xa7f4('0x1b')][_0xa7f4('0x68')]=_0x3528b7;return _0x22a53a;})[_0xa7f4('0x23')](function(_0x4a56f5){if(_0x4a56f5){_0x4a56f5[_0xa7f4('0x1b')][_0xa7f4('0x7b')]=util[_0xa7f4('0x65')]('SIP/%s',_0x5ef3b1[_0xa7f4('0x67')]['name']);_0x4a56f5[_0xa7f4('0x1b')]['channel']=_0x22a53a[_0xa7f4('0x7c')];_0x4a56f5[_0xa7f4('0x1b')][_0xa7f4('0x7d')]=_0x22a53a[_0xa7f4('0x7c')];_0x4a56f5[_0xa7f4('0x1b')][_0xa7f4('0x7e')]='reject';_0x4a56f5[_0xa7f4('0x1b')][_0xa7f4('0x47')]=htmlToText[_0xa7f4('0x7f')](_0x22a53a[_0xa7f4('0x1b')][_0xa7f4('0x47')]);respondWithRpcPromise('EventManager',_0xa7f4('0x89'),{'event':_0xa7f4('0x8a'),'message':_0x4a56f5[_0xa7f4('0x1b')]},client9002);return _0x22a53a;}return null;})[_0xa7f4('0x23')](respondWithResult(_0x5ce974,null))[_0xa7f4('0x48')](handleError(_0x5ce974,null));};exports[_0xa7f4('0x8b')]=function(_0x27dcb5,_0x57e257){var _0x1775d9=moment()['unix']()[_0xa7f4('0x8c')]();var _0x23990f=path[_0xa7f4('0x56')](config[_0xa7f4('0x8d')],'server','files',_0xa7f4('0x8e'));var _0x14ab7e=path['join'](config[_0xa7f4('0x8d')],'server',_0xa7f4('0x8f'),_0xa7f4('0x55'));var _0x3929fa=util[_0xa7f4('0x65')](_0xa7f4('0x90'),_0x1775d9);return db[_0xa7f4('0x2b')][_0xa7f4('0x46')]({'where':{'id':_0x27dcb5['params']['id']},'attributes':['id',_0xa7f4('0x47'),'from','to','cc','bcc',_0xa7f4('0x91'),'createdAt'],'include':_0x27dcb5[_0xa7f4('0x31')][_0xa7f4('0x55')]?[{'model':db[_0xa7f4('0x92')],'as':_0xa7f4('0x93')}]:undefined})[_0xa7f4('0x23')](handleEntityNotFound(_0x57e257,null))[_0xa7f4('0x23')](function(_0x506a6d){if(_0x506a6d){var _0x4b0ee6=_0x506a6d;var _0x13ed67={'from':_0x4b0ee6[_0xa7f4('0x94')],'to':_0x4b0ee6['to'],'subject':_0x4b0ee6[_0xa7f4('0x91')],'html':htmlEntities[_0xa7f4('0x95')](_0x4b0ee6[_0xa7f4('0x47')]),'headers':{'Date':moment(_0x4b0ee6['createdAt'])[_0xa7f4('0x65')](_0xa7f4('0x96'))},'attachments':[]};if(_0x506a6d['cc']){_0x13ed67[_0xa7f4('0x97')]['Cc']=_0x506a6d['cc'];}if(_0x506a6d[_0xa7f4('0x98')]){_0x13ed67[_0xa7f4('0x97')][_0xa7f4('0x99')]=_0x506a6d[_0xa7f4('0x98')];}return new BPromise(function(_0x2667d4,_0x5b886e){if(_0x506a6d[_0xa7f4('0x93')]){for(var _0x4f37fc=0x0;_0x4f37fc<_0x506a6d[_0xa7f4('0x93')]['length'];_0x4f37fc++){var _0x5d8372=_0x506a6d['Attachments'][_0x4f37fc];var _0xa62ab2=path['join'](_0x14ab7e,_0x5d8372['basename']);if(fs[_0xa7f4('0x9a')](_0xa62ab2)){_0x13ed67[_0xa7f4('0x55')]['push']({'name':_0x5d8372['name'],'contentType':_0x5d8372[_0xa7f4('0x2d')],'data':fs[_0xa7f4('0x9b')](_0xa62ab2)});}}}emlformat[_0xa7f4('0x9c')](_0x13ed67,function(_0x188a0f,_0x2e67a5){if(_0x188a0f)return _0x5b886e(_0x188a0f);fs[_0xa7f4('0x9d')](path[_0xa7f4('0x56')](_0x23990f,_0x3929fa),_0x2e67a5);return _0x2667d4(_0x2e67a5);});});}})[_0xa7f4('0x23')](function(_0x4f924f){if(_0x4f924f){return _0x57e257[_0xa7f4('0x8b')](path[_0xa7f4('0x56')](_0x23990f,_0x3929fa),_0x3929fa,function(_0x5ad0f1){if(!_0x5ad0f1)fs['unlinkSync'](path[_0xa7f4('0x56')](_0x23990f,_0x3929fa));});}})[_0xa7f4('0x48')](handleError(_0x57e257,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index abbdc83..0c2bda9 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 _0x3a26=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x10a563,_0x3b91fc){var _0x2cfc5d=function(_0x343cdc){while(--_0x343cdc){_0x10a563['push'](_0x10a563['shift']());}};_0x2cfc5d(++_0x3b91fc);}(_0x3a26,0x1cb));var _0x63a2=function(_0x3a87e8,_0x5dd8bf){_0x3a87e8=_0x3a87e8-0x0;var _0x4c7055=_0x3a26[_0x3a87e8];return _0x4c7055;};'use strict';var EventEmitter=require(_0x63a2('0x0'));var MailMessage=require(_0x63a2('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x63a2('0x2')](0x0);var events={'afterCreate':_0x63a2('0x3'),'afterUpdate':_0x63a2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x187b9a){return function(_0x2251ec,_0x17380c,_0x58db58){MailMessageEvents[_0x63a2('0x5')](_0x187b9a+':'+_0x2251ec['id'],_0x2251ec);MailMessageEvents['emit'](_0x187b9a,_0x2251ec);_0x58db58(null);};}for(var e in events){if(events[_0x63a2('0x6')](e)){var event=events[e];MailMessage[_0x63a2('0x7')](e,emitEvent(event));}}module[_0x63a2('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x13e0=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x4d5256,_0x572fd3){var _0x315f40=function(_0x3b8dfc){while(--_0x3b8dfc){_0x4d5256['push'](_0x4d5256['shift']());}};_0x315f40(++_0x572fd3);}(_0x13e0,0xca));var _0x013e=function(_0x4f156b,_0x5402c9){_0x4f156b=_0x4f156b-0x0;var _0x46e3d8=_0x13e0[_0x4f156b];return _0x46e3d8;};'use strict';var EventEmitter=require(_0x013e('0x0'));var MailMessage=require(_0x013e('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x013e('0x2')](0x0);var events={'afterCreate':_0x013e('0x3'),'afterUpdate':_0x013e('0x4'),'afterDestroy':_0x013e('0x5')};function emitEvent(_0x218e9f){return function(_0x1cfc0,_0x11a285,_0x1c45eb){MailMessageEvents[_0x013e('0x6')](_0x218e9f+':'+_0x1cfc0['id'],_0x1cfc0);MailMessageEvents[_0x013e('0x6')](_0x218e9f,_0x1cfc0);_0x1c45eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x013e('0x7')](e,emitEvent(event));}}module[_0x013e('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 1465605..2861564 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 _0xbcef=['moment','bluebird','request-promise','path','./mailMessage.attributes','define','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','out','isNil','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x321106,_0x464618){var _0x42f1d6=function(_0x57a0e1){while(--_0x57a0e1){_0x321106['push'](_0x321106['shift']());}};_0x42f1d6(++_0x464618);}(_0xbcef,0x13c));var _0xfbce=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbcef[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfbce('0x0'));var util=require('util');var logger=require(_0xfbce('0x1'))(_0xfbce('0x2'));var moment=require(_0xfbce('0x3'));var BPromise=require(_0xfbce('0x4'));var rp=require(_0xfbce('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xfbce('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfbce('0x7'));module['exports']=function(_0x2db547,_0x512390){return _0x2db547[_0xfbce('0x8')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xfbce('0x9')]},{'name':'fti_mail_messages','fields':[_0xfbce('0xa'),_0xfbce('0xb')],'type':_0xfbce('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x31a711,_0x56a40b,_0x3be22a){if(_0x31a711[_0xfbce('0xd')]){_0x31a711['plainBody']=htmlToText[_0xfbce('0xe')](_0x31a711[_0xfbce('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3be22a(null,_0x56a40b);},'afterCreate':function(_0x44da4c,_0x1a92ba,_0x1a8720){var _0x4d0bba=_0x2db547[_0xfbce('0xf')];var _0x570342=_0x44da4c[_0xfbce('0x10')]({'plain':!![]});if(_0x570342['direction'][_0xfbce('0x11')]()==='in'||_0x570342['direction']['toLowerCase']()===_0xfbce('0x12')&&!_0x570342['secret']&&!_[_0xfbce('0x13')](_0x570342['UserId'])){_0x4d0bba[_0xfbce('0x14')]['findOne']({'where':{'id':_0x570342[_0xfbce('0x15')]}})[_0xfbce('0x16')](function(_0x17744f){if(_0x17744f){_0x17744f[_0xfbce('0x17')]({'lastMsgAt':_0x570342[_0xfbce('0x18')],'lastMsgDirection':_0x570342['direction'][_0xfbce('0x11')]()});}})[_0xfbce('0x19')](function(_0xec500b){console[_0xfbce('0x1a')](_0xec500b);});}_0x1a8720();}},'charset':_0xfbce('0x1b'),'collate':_0xfbce('0x1c')});}; \ No newline at end of file +var _0x1e8c=['MailInteractionId','then','update','createdAt','catch','utf8mb4','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne'];(function(_0x57fa5c,_0x22d1e7){var _0x270ebe=function(_0xf97a43){while(--_0xf97a43){_0x57fa5c['push'](_0x57fa5c['shift']());}};_0x270ebe(++_0x22d1e7);}(_0x1e8c,0x192));var _0xc1e8=function(_0x2c7516,_0x2ca7f1){_0x2c7516=_0x2c7516-0x0;var _0x1d76a2=_0x1e8c[_0x2c7516];return _0x1d76a2;};'use strict';var _=require('lodash');var util=require(_0xc1e8('0x0'));var logger=require(_0xc1e8('0x1'))(_0xc1e8('0x2'));var moment=require(_0xc1e8('0x3'));var BPromise=require(_0xc1e8('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xc1e8('0x5'));var rimraf=require(_0xc1e8('0x6'));var config=require(_0xc1e8('0x7'));var attributes=require(_0xc1e8('0x8'));module[_0xc1e8('0x9')]=function(_0x5688b2,_0x368c5a){return _0x5688b2[_0xc1e8('0xa')]('MailMessage',attributes,{'tableName':_0xc1e8('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc1e8('0xc')]},{'name':_0xc1e8('0xd'),'fields':[_0xc1e8('0xe'),'subject'],'type':_0xc1e8('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x45478b,_0x379aae,_0x14935b){if(_0x45478b[_0xc1e8('0x10')]){_0x45478b[_0xc1e8('0xe')]=htmlToText[_0xc1e8('0x11')](_0x45478b[_0xc1e8('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x14935b(null,_0x379aae);},'afterCreate':function(_0x5439b1,_0x3b7a58,_0x5bdef7){var _0x51d3ec=_0x5688b2[_0xc1e8('0x12')];var _0x19b05a=_0x5439b1[_0xc1e8('0x13')]({'plain':!![]});if(_0x19b05a[_0xc1e8('0x14')][_0xc1e8('0x15')]()==='in'||_0x19b05a['direction']['toLowerCase']()===_0xc1e8('0x16')&&!_0x19b05a[_0xc1e8('0x17')]&&!_[_0xc1e8('0x18')](_0x19b05a['UserId'])){_0x51d3ec[_0xc1e8('0x19')][_0xc1e8('0x1a')]({'where':{'id':_0x19b05a[_0xc1e8('0x1b')]}})[_0xc1e8('0x1c')](function(_0x152662){if(_0x152662){_0x152662[_0xc1e8('0x1d')]({'lastMsgAt':_0x19b05a[_0xc1e8('0x1e')],'lastMsgDirection':_0x19b05a[_0xc1e8('0x14')]['toLowerCase']()});}})[_0xc1e8('0x1f')](function(_0xb4eaf3){console['error'](_0xb4eaf3);});}_0x5bdef7();}},'charset':_0xc1e8('0x20'),'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 bfeed9a..0094a6f 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 _0x958a=['./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x35560c,_0x5832af){var _0x162b5a=function(_0x108a94){while(--_0x108a94){_0x35560c['push'](_0x35560c['shift']());}};_0x162b5a(++_0x5832af);}(_0x958a,0x128));var _0xa958=function(_0x455ba5,_0x4f0c86){_0x455ba5=_0x455ba5-0x0;var _0x51a9be=_0x958a[_0x455ba5];return _0x51a9be;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});config[_0xa958('0xb')]=_[_0xa958('0xc')](config[_0xa958('0xb')],{'host':_0xa958('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa958('0xe'))[_0xa958('0xf')](socket);function respondWithRpcPromise(_0x11f090,_0x44b66e,_0x37afa0){return new BPromise(function(_0x94caac,_0xebb1c6){return client[_0xa958('0x10')](_0x11f090,_0x37afa0)[_0xa958('0x11')](function(_0x250999){logger[_0xa958('0x12')](_0xa958('0x13'),_0x44b66e,_0xa958('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x44b66e,'request\x20sent',JSON[_0xa958('0x15')](_0x250999));if(_0x250999[_0xa958('0x16')]){if(_0x250999[_0xa958('0x16')]['code']===0x1f4){logger[_0xa958('0x16')]('MailMessage,\x20%s,\x20%s',_0x44b66e,_0x250999['error']['message']);return _0xebb1c6(_0x250999[_0xa958('0x16')][_0xa958('0x17')]);}logger[_0xa958('0x16')](_0xa958('0x13'),_0x44b66e,_0x250999[_0xa958('0x16')][_0xa958('0x17')]);return _0x94caac(_0x250999[_0xa958('0x16')][_0xa958('0x17')]);}else{logger['info'](_0xa958('0x13'),_0x44b66e,'request\x20sent');_0x94caac(_0x250999[_0xa958('0x18')][_0xa958('0x17')]);}})['catch'](function(_0xe4129a){logger[_0xa958('0x16')](_0xa958('0x13'),_0x44b66e,_0xe4129a);_0xebb1c6(_0xe4129a);});});}exports[_0xa958('0x19')]=function(_0x2759ad){var _0x1f82aa=this;return new Promise(function(_0x56314b,_0x4a90c2){return db[_0xa958('0x1a')][_0xa958('0x1b')](_0x2759ad[_0xa958('0x1c')],{'raw':_0x2759ad['options']?_0x2759ad[_0xa958('0x1d')][_0xa958('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x28cf12){logger[_0xa958('0x12')]('CreateMailMessage',_0x2759ad);logger['debug'](_0xa958('0x19'),_0x2759ad,JSON[_0xa958('0x15')](_0x28cf12));_0x56314b(_0x28cf12);})['catch'](function(_0x25f461){logger[_0xa958('0x16')](_0xa958('0x19'),_0x25f461[_0xa958('0x17')],_0x2759ad);_0x4a90c2(_0x1f82aa[_0xa958('0x16')](0x1f4,_0x25f461[_0xa958('0x17')]));});});}; \ No newline at end of file +var _0x0598=['CreateMailMessage','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','MailMessage','create','body','raw'];(function(_0x1602fd,_0x847115){var _0x1eaf42=function(_0x2e09f1){while(--_0x2e09f1){_0x1602fd['push'](_0x1602fd['shift']());}};_0x1eaf42(++_0x847115);}(_0x0598,0x92));var _0x8059=function(_0x4494b1,_0x3cf8a6){_0x4494b1=_0x4494b1-0x0;var _0x18ac78=_0x0598[_0x4494b1];return _0x18ac78;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});config['redis']=_[_0x8059('0x7')](config[_0x8059('0x8')],{'host':_0x8059('0x9'),'port':0x18eb});var socket=require(_0x8059('0xa'))(new Redis(config['redis']));require('./mailMessage.socket')[_0x8059('0xb')](socket);function respondWithRpcPromise(_0x1bf5fd,_0x336f85,_0x5097d6){return new BPromise(function(_0x283b63,_0x52a60d){return client['request'](_0x1bf5fd,_0x5097d6)[_0x8059('0xc')](function(_0x4109a9){logger['info']('MailMessage,\x20%s,\x20%s',_0x336f85,'request\x20sent');logger[_0x8059('0xd')](_0x8059('0xe'),_0x336f85,_0x8059('0xf'),JSON[_0x8059('0x10')](_0x4109a9));if(_0x4109a9[_0x8059('0x11')]){if(_0x4109a9['error'][_0x8059('0x12')]===0x1f4){logger['error'](_0x8059('0x13'),_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x52a60d(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x283b63(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}else{logger[_0x8059('0x15')](_0x8059('0x13'),_0x336f85,'request\x20sent');_0x283b63(_0x4109a9[_0x8059('0x16')][_0x8059('0x14')]);}})[_0x8059('0x17')](function(_0x1c4566){logger['error'](_0x8059('0x13'),_0x336f85,_0x1c4566);_0x52a60d(_0x1c4566);});});}exports['CreateMailMessage']=function(_0x113f42){var _0x493825=this;return new Promise(function(_0x1857c1,_0x56d794){return db[_0x8059('0x18')][_0x8059('0x19')](_0x113f42[_0x8059('0x1a')],{'raw':_0x113f42['options']?_0x113f42['options'][_0x8059('0x1b')]===undefined?!![]:![]:!![]})[_0x8059('0xc')](function(_0x32aeda){logger[_0x8059('0x15')]('CreateMailMessage',_0x113f42);logger[_0x8059('0xd')](_0x8059('0x1c'),_0x113f42,JSON[_0x8059('0x10')](_0x32aeda));_0x1857c1(_0x32aeda);})['catch'](function(_0xe9a72d){logger[_0x8059('0x11')](_0x8059('0x1c'),_0xe9a72d[_0x8059('0x14')],_0x113f42);_0x56d794(_0x493825['error'](0x1f4,_0xe9a72d[_0x8059('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 99666db..8352d29 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 _0x0f0c=['mailMessage:','./mailMessage.events','remove','update','removeListener','length'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x0f0c,0xaf));var _0xc0f0=function(_0x3d5a37,_0x2ac2f8){_0x3d5a37=_0x3d5a37-0x0;var _0x28723f=_0x0f0c[_0x3d5a37];return _0x28723f;};'use strict';var MailMessageEvents=require(_0xc0f0('0x0'));var events=['save',_0xc0f0('0x1'),_0xc0f0('0x2')];function createListener(_0x183f4e,_0x13aa40){return function(_0x561fe5){_0x13aa40['emit'](_0x183f4e,_0x561fe5);};}function removeListener(_0x1fc24d,_0xe24a3f){return function(){MailMessageEvents[_0xc0f0('0x3')](_0x1fc24d,_0xe24a3f);};}exports['register']=function(_0x471a2f){for(var _0x57a5d3=0x0,_0x1a6ca6=events[_0xc0f0('0x4')];_0x57a5d3<_0x1a6ca6;_0x57a5d3++){var _0x41e8da=events[_0x57a5d3];var _0x2e520c=createListener(_0xc0f0('0x5')+_0x41e8da,_0x471a2f);MailMessageEvents['on'](_0x41e8da,_0x2e520c);}}; \ No newline at end of file +var _0xe790=['mailMessage:','save','remove','removeListener','register','length'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xe790,0x175));var _0x0e79=function(_0x46bb1f,_0x48a9ea){_0x46bb1f=_0x46bb1f-0x0;var _0x5aba1c=_0xe790[_0x46bb1f];return _0x5aba1c;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x0e79('0x0'),_0x0e79('0x1'),'update'];function createListener(_0x544481,_0x4cd7d9){return function(_0x4e8a77){_0x4cd7d9['emit'](_0x544481,_0x4e8a77);};}function removeListener(_0x409985,_0x2f9a76){return function(){MailMessageEvents[_0x0e79('0x2')](_0x409985,_0x2f9a76);};}exports[_0x0e79('0x3')]=function(_0x46bc15){for(var _0x175b82=0x0,_0xdbb220=events[_0x0e79('0x4')];_0x175b82<_0xdbb220;_0x175b82++){var _0x3a8a37=events[_0x175b82];var _0x56eaab=createListener(_0x0e79('0x5')+_0x3a8a37,_0x46bc15);MailMessageEvents['on'](_0x3a8a37,_0x56eaab);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 5bab310..7950d83 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 _0x2e10=['removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getAgents','create','post','/:id/teams','addTeams','/:id/users','addAgents','/:id','delete','removeTeams'];(function(_0x47e3f5,_0x1a3360){var _0x54947a=function(_0x122348){while(--_0x122348){_0x47e3f5['push'](_0x47e3f5['shift']());}};_0x54947a(++_0x1a3360);}(_0x2e10,0x8e));var _0x02e1=function(_0x14c5f3,_0x2131fa){_0x14c5f3=_0x14c5f3-0x0;var _0x90549=_0x2e10[_0x14c5f3];return _0x90549;};'use strict';var multer=require('multer');var util=require(_0x02e1('0x0'));var path=require(_0x02e1('0x1'));var timeout=require(_0x02e1('0x2'));var express=require(_0x02e1('0x3'));var router=express[_0x02e1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x02e1('0x5'));var interaction=require(_0x02e1('0x6'));var config=require(_0x02e1('0x7'));var controller=require('./mailQueue.controller');router[_0x02e1('0x8')]('/',auth[_0x02e1('0x9')](),controller[_0x02e1('0xa')]);router[_0x02e1('0x8')](_0x02e1('0xb'),auth[_0x02e1('0x9')](),controller[_0x02e1('0xc')]);router[_0x02e1('0x8')]('/:id',auth[_0x02e1('0x9')](),controller[_0x02e1('0xd')]);router[_0x02e1('0x8')](_0x02e1('0xe'),auth[_0x02e1('0x9')](),controller[_0x02e1('0xf')]);router[_0x02e1('0x8')]('/:id/teams',auth[_0x02e1('0x9')](),controller['getTeams']);router['get']('/:id/users',auth[_0x02e1('0x9')](),controller[_0x02e1('0x10')]);router['post']('/',auth[_0x02e1('0x9')](),controller[_0x02e1('0x11')]);router[_0x02e1('0x12')](_0x02e1('0x13'),auth[_0x02e1('0x9')](),controller[_0x02e1('0x14')]);router[_0x02e1('0x12')](_0x02e1('0x15'),auth[_0x02e1('0x9')](),controller[_0x02e1('0x16')]);router['put']('/:id',auth[_0x02e1('0x9')](),controller['update']);router['delete'](_0x02e1('0x17'),auth[_0x02e1('0x9')](),controller['destroy']);router[_0x02e1('0x18')]('/:id/teams',auth[_0x02e1('0x9')](),controller[_0x02e1('0x19')]);router[_0x02e1('0x18')](_0x02e1('0x15'),auth[_0x02e1('0x9')](),controller[_0x02e1('0x1a')]);module[_0x02e1('0x1b')]=router; \ No newline at end of file +var _0xfb3a=['get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','/:id','update','destroy','delete','removeAgents','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller'];(function(_0x39f554,_0x24bca2){var _0x26168b=function(_0x29d7ac){while(--_0x29d7ac){_0x39f554['push'](_0x39f554['shift']());}};_0x26168b(++_0x24bca2);}(_0xfb3a,0xf5));var _0xafb3=function(_0x519ff1,_0x3db830){_0x519ff1=_0x519ff1-0x0;var _0x2a5702=_0xfb3a[_0x519ff1];return _0x2a5702;};'use strict';var multer=require(_0xafb3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xafb3('0x1'));var express=require('express');var router=express[_0xafb3('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xafb3('0x3'));var interaction=require(_0xafb3('0x4'));var config=require(_0xafb3('0x5'));var controller=require(_0xafb3('0x6'));router[_0xafb3('0x7')]('/',auth[_0xafb3('0x8')](),controller[_0xafb3('0x9')]);router[_0xafb3('0x7')](_0xafb3('0xa'),auth[_0xafb3('0x8')](),controller[_0xafb3('0xb')]);router[_0xafb3('0x7')]('/:id',auth[_0xafb3('0x8')](),controller[_0xafb3('0xc')]);router[_0xafb3('0x7')](_0xafb3('0xd'),auth[_0xafb3('0x8')](),controller['getMembers']);router['get'](_0xafb3('0xe'),auth[_0xafb3('0x8')](),controller[_0xafb3('0xf')]);router[_0xafb3('0x7')]('/:id/users',auth[_0xafb3('0x8')](),controller[_0xafb3('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xafb3('0x11')]);router[_0xafb3('0x12')](_0xafb3('0xe'),auth[_0xafb3('0x8')](),controller[_0xafb3('0x13')]);router[_0xafb3('0x12')](_0xafb3('0x14'),auth[_0xafb3('0x8')](),controller[_0xafb3('0x15')]);router['put'](_0xafb3('0x16'),auth['isAuthenticated'](),controller[_0xafb3('0x17')]);router['delete'](_0xafb3('0x16'),auth[_0xafb3('0x8')](),controller[_0xafb3('0x18')]);router[_0xafb3('0x19')](_0xafb3('0xe'),auth[_0xafb3('0x8')](),controller['removeTeams']);router[_0xafb3('0x19')]('/:id/users',auth[_0xafb3('0x8')](),controller[_0xafb3('0x1a')]);module[_0xafb3('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4bec282..234a5e4 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 _0x2f96=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f96,0x1cd));var _0x62f9=function(_0xb1f138,_0x44ec54){_0xb1f138=_0xb1f138-0x0;var _0x1688c9=_0x2f96[_0xb1f138];return _0x1688c9;};'use strict';var Sequelize=require(_0x62f9('0x0'));module[_0x62f9('0x1')]={'name':{'type':Sequelize[_0x62f9('0x2')],'unique':_0x62f9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x62f9('0x2')]},'timeout':{'type':Sequelize[_0x62f9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x62f9('0x5')](_0x62f9('0x6'),_0x62f9('0x7'),_0x62f9('0x8'))}}; \ No newline at end of file +var _0xebe1=['roundrobin','STRING','INTEGER','rrmemory','beepall'];(function(_0x4785db,_0x555678){var _0x3ae3b3=function(_0x50325b){while(--_0x50325b){_0x4785db['push'](_0x4785db['shift']());}};_0x3ae3b3(++_0x555678);}(_0xebe1,0x79));var _0x1ebe=function(_0x5082f5,_0x166c02){_0x5082f5=_0x5082f5-0x0;var _0x556d9b=_0xebe1[_0x5082f5];return _0x556d9b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1ebe('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1ebe('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1ebe('0x2'),_0x1ebe('0x3'),_0x1ebe('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 2ebad0f..e9127e1 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 _0xdb46=['create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','nolimit','MailQueueId','findAndCountAll','agent','mailPause','%s/%s','createdAt','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','removeTeams','select','field','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','MailQueue','findAll','rows','catch','show','params','attributes','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','autoAssociation'];(function(_0x3ebfae,_0x40b4c0){var _0x234222=function(_0x36a9a1){while(--_0x36a9a1){_0x3ebfae['push'](_0x3ebfae['shift']());}};_0x234222(++_0x40b4c0);}(_0xdb46,0x158));var _0x6db4=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xdb46[_0x23b655];return _0x364b32;};'use strict';var emlformat=require(_0x6db4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6db4('0x1'));var rp=require(_0x6db4('0x2'));var moment=require(_0x6db4('0x3'));var BPromise=require(_0x6db4('0x4'));var Mustache=require('mustache');var util=require(_0x6db4('0x5'));var path=require(_0x6db4('0x6'));var sox=require('sox');var csv=require(_0x6db4('0x7'));var ejs=require(_0x6db4('0x8'));var fs=require('fs');var fs_extra=require(_0x6db4('0x9'));var _=require(_0x6db4('0xa'));var squel=require('squel');var crypto=require(_0x6db4('0xb'));var jsforce=require(_0x6db4('0xc'));var deskjs=require(_0x6db4('0xd'));var toCsv=require(_0x6db4('0x7'));var querystring=require(_0x6db4('0xe'));var Papa=require(_0x6db4('0xf'));var Redis=require(_0x6db4('0x10'));var authService=require(_0x6db4('0x11'));var qs=require(_0x6db4('0x12'));var as=require(_0x6db4('0x13'));var hardwareService=require(_0x6db4('0x14'));var logger=require('../../config/logger')(_0x6db4('0x15'));var utils=require('../../config/utils');var config=require(_0x6db4('0x16'));var licenseUtil=require(_0x6db4('0x17'));var db=require(_0x6db4('0x18'))['db'];config['redis']=_[_0x6db4('0x19')](config[_0x6db4('0x1a')],{'host':_0x6db4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x913dde,_0x26d148){_0x26d148=_0x26d148||0xcc;return function(_0x3f261d){if(_0x3f261d){return _0x913dde[_0x6db4('0x1c')](_0x26d148);}return _0x913dde['status'](_0x26d148)[_0x6db4('0x1d')]();};}function respondWithResult(_0x1f6981,_0x21fe35){_0x21fe35=_0x21fe35||0xc8;return function(_0x4a675e){if(_0x4a675e){return _0x1f6981[_0x6db4('0x1e')](_0x21fe35)[_0x6db4('0x1f')](_0x4a675e);}};}function respondWithFilteredResult(_0x27fc2e,_0xa889ac){return function(_0x4c8602){if(_0x4c8602){var _0xf9906b=typeof _0xa889ac[_0x6db4('0x20')]===_0x6db4('0x21')&&typeof _0xa889ac[_0x6db4('0x22')]===_0x6db4('0x21');var _0xb1d812=_0x4c8602[_0x6db4('0x23')];var _0x1367e3=_0xf9906b?0x0:_0xa889ac['offset'];var _0x27cfc8=_0xf9906b?_0x4c8602[_0x6db4('0x23')]:_0xa889ac[_0x6db4('0x20')]+_0xa889ac[_0x6db4('0x22')];var _0x25d039;if(_0x27cfc8>=_0xb1d812){_0x27cfc8=_0xb1d812;_0x25d039=0xc8;}else{_0x25d039=0xce;}_0x27fc2e[_0x6db4('0x1e')](_0x25d039);return _0x27fc2e[_0x6db4('0x24')](_0x6db4('0x25'),_0x1367e3+'-'+_0x27cfc8+'/'+_0xb1d812)[_0x6db4('0x1f')](_0x4c8602);}return null;};}function patchUpdates(_0x7a1d68){return function(_0x2cdee8){try{jsonpatch[_0x6db4('0x26')](_0x2cdee8,_0x7a1d68,!![]);}catch(_0x54f802){return BPromise[_0x6db4('0x27')](_0x54f802);}return _0x2cdee8['save']();};}function saveUpdates(_0x28cec0,_0x4da8ad){return function(_0xc33556){if(_0xc33556){return _0xc33556[_0x6db4('0x28')](_0x28cec0)[_0x6db4('0x29')](function(_0x296c15){return _0x296c15;});}return null;};}function removeEntity(_0x5d7b45,_0x5552e2){return function(_0x15d96b){if(_0x15d96b){return _0x15d96b[_0x6db4('0x2a')]()[_0x6db4('0x29')](function(){var _0x277e46=_0x15d96b[_0x6db4('0x2b')]({'plain':!![]});var _0x11d1b9='MailQueues';return db[_0x6db4('0x2c')][_0x6db4('0x2a')]({'where':{'type':_0x11d1b9,'resourceId':_0x277e46['id']}})[_0x6db4('0x29')](function(){return _0x15d96b;});})[_0x6db4('0x29')](function(){_0x5d7b45[_0x6db4('0x1e')](0xcc)[_0x6db4('0x1d')]();});}};}function handleEntityNotFound(_0x5f3995,_0x5057){return function(_0x327be0){if(!_0x327be0){_0x5f3995[_0x6db4('0x1c')](0x194);}return _0x327be0;};}function handleError(_0x369bf7,_0x4896f3){_0x4896f3=_0x4896f3||0x1f4;return function(_0x59be79){logger[_0x6db4('0x2d')](_0x59be79['stack']);if(_0x59be79[_0x6db4('0x2e')]){delete _0x59be79[_0x6db4('0x2e')];}_0x369bf7['status'](_0x4896f3)[_0x6db4('0x2f')](_0x59be79);};}exports[_0x6db4('0x30')]=function(_0x43f512,_0x2e5167){var _0x1830ab={},_0x1eba23={},_0x5259cc={'count':0x0,'rows':[]};var _0x4954fd=_['map'](db['MailQueue'][_0x6db4('0x31')],function(_0x161801){return{'name':_0x161801[_0x6db4('0x32')],'type':_0x161801['type'][_0x6db4('0x33')]};});_0x1eba23[_0x6db4('0x34')]=_[_0x6db4('0x35')](_0x4954fd,_0x6db4('0x2e'));_0x1eba23[_0x6db4('0x36')]=_[_0x6db4('0x37')](_0x43f512[_0x6db4('0x36')]);_0x1eba23[_0x6db4('0x38')]=_['intersection'](_0x1eba23[_0x6db4('0x34')],_0x1eba23[_0x6db4('0x36')]);_0x1830ab['attributes']=_[_0x6db4('0x39')](_0x1eba23[_0x6db4('0x34')],qs[_0x6db4('0x3a')](_0x43f512[_0x6db4('0x36')][_0x6db4('0x3a')]));_0x1830ab['attributes']=_0x1830ab['attributes'][_0x6db4('0x3b')]?_0x1830ab['attributes']:_0x1eba23[_0x6db4('0x34')];if(!_0x43f512[_0x6db4('0x36')][_0x6db4('0x3c')]('nolimit')){_0x1830ab[_0x6db4('0x22')]=qs[_0x6db4('0x22')](_0x43f512[_0x6db4('0x36')]['limit']);_0x1830ab[_0x6db4('0x20')]=qs[_0x6db4('0x20')](_0x43f512[_0x6db4('0x36')][_0x6db4('0x20')]);}_0x1830ab[_0x6db4('0x3d')]=qs[_0x6db4('0x3e')](_0x43f512[_0x6db4('0x36')][_0x6db4('0x3e')]);_0x1830ab['where']=qs[_0x6db4('0x38')](_[_0x6db4('0x3f')](_0x43f512[_0x6db4('0x36')],_0x1eba23[_0x6db4('0x38')]),_0x4954fd);if(_0x43f512['query'][_0x6db4('0x40')]){_0x1830ab[_0x6db4('0x41')]=_[_0x6db4('0x42')](_0x1830ab[_0x6db4('0x41')],{'$or':_[_0x6db4('0x35')](_0x4954fd,function(_0x277ebc){if(_0x277ebc[_0x6db4('0x43')]!==_0x6db4('0x44')){var _0x1c0932={};_0x1c0932[_0x277ebc[_0x6db4('0x2e')]]={'$like':'%'+_0x43f512[_0x6db4('0x36')][_0x6db4('0x40')]+'%'};return _0x1c0932;}})});}_0x1830ab=_[_0x6db4('0x42')]({},_0x1830ab,_0x43f512[_0x6db4('0x45')]);var _0x1b54a8={'where':_0x1830ab['where']};return db['MailQueue'][_0x6db4('0x23')](_0x1b54a8)[_0x6db4('0x29')](function(_0x2c6193){_0x5259cc['count']=_0x2c6193;if(_0x43f512[_0x6db4('0x36')][_0x6db4('0x46')]){_0x1830ab[_0x6db4('0x47')]=[{'all':!![]}];}return db[_0x6db4('0x48')][_0x6db4('0x49')](_0x1830ab);})[_0x6db4('0x29')](function(_0x36ee08){_0x5259cc[_0x6db4('0x4a')]=_0x36ee08;return _0x5259cc;})[_0x6db4('0x29')](respondWithFilteredResult(_0x2e5167,_0x1830ab))[_0x6db4('0x4b')](handleError(_0x2e5167,null));};exports[_0x6db4('0x4c')]=function(_0x3cc899,_0x5b1e01){var _0x16c3ee={'raw':!![],'where':{'id':_0x3cc899[_0x6db4('0x4d')]['id']}},_0x3547b0={};_0x3547b0[_0x6db4('0x34')]=_[_0x6db4('0x37')](db[_0x6db4('0x48')][_0x6db4('0x31')]);_0x3547b0[_0x6db4('0x36')]=_[_0x6db4('0x37')](_0x3cc899[_0x6db4('0x36')]);_0x3547b0[_0x6db4('0x38')]=_[_0x6db4('0x39')](_0x3547b0[_0x6db4('0x34')],_0x3547b0[_0x6db4('0x36')]);_0x16c3ee[_0x6db4('0x4e')]=_['intersection'](_0x3547b0[_0x6db4('0x34')],qs[_0x6db4('0x3a')](_0x3cc899['query']['fields']));_0x16c3ee['attributes']=_0x16c3ee[_0x6db4('0x4e')][_0x6db4('0x3b')]?_0x16c3ee['attributes']:_0x3547b0['model'];if(_0x3cc899[_0x6db4('0x36')][_0x6db4('0x46')]){_0x16c3ee[_0x6db4('0x47')]=[{'all':!![]}];}_0x16c3ee=_['merge']({},_0x16c3ee,_0x3cc899[_0x6db4('0x45')]);return db['MailQueue'][_0x6db4('0x4f')](_0x16c3ee)['then'](handleEntityNotFound(_0x5b1e01,null))[_0x6db4('0x29')](respondWithResult(_0x5b1e01,null))[_0x6db4('0x4b')](handleError(_0x5b1e01,null));};exports['create']=function(_0x55f07d,_0x3f64eb){return db['MailQueue']['create'](_0x55f07d[_0x6db4('0x50')],{})[_0x6db4('0x29')](function(_0x518b11){var _0x56eb18=_0x55f07d['user'][_0x6db4('0x2b')]({'plain':!![]});if(!_0x56eb18)throw new Error(_0x6db4('0x51'));if(_0x56eb18[_0x6db4('0x52')]===_0x6db4('0x53')){var _0x2418c3=_0x518b11[_0x6db4('0x2b')]({'plain':!![]});var _0x5ed332=_0x6db4('0x54');return db[_0x6db4('0x55')]['find']({'where':{'name':_0x5ed332,'userProfileId':_0x56eb18[_0x6db4('0x56')]},'raw':!![]})[_0x6db4('0x29')](function(_0x3933b1){if(_0x3933b1&&_0x3933b1[_0x6db4('0x57')]===0x0){return db[_0x6db4('0x2c')][_0x6db4('0x58')]({'name':_0x2418c3[_0x6db4('0x2e')],'resourceId':_0x2418c3['id'],'type':_0x3933b1[_0x6db4('0x2e')],'sectionId':_0x3933b1['id']},{})[_0x6db4('0x29')](function(){return _0x518b11;});}else{return _0x518b11;}})[_0x6db4('0x4b')](function(_0x481428){logger[_0x6db4('0x2d')](_0x6db4('0x59'),_0x481428);throw _0x481428;});}return _0x518b11;})['then'](respondWithResult(_0x3f64eb,0xc9))[_0x6db4('0x4b')](handleError(_0x3f64eb,null));};exports[_0x6db4('0x28')]=function(_0x416528,_0x32b630){if(_0x416528[_0x6db4('0x50')]['id']){delete _0x416528[_0x6db4('0x50')]['id'];}return db[_0x6db4('0x48')]['find']({'where':{'id':_0x416528['params']['id']}})['then'](handleEntityNotFound(_0x32b630,null))[_0x6db4('0x29')](saveUpdates(_0x416528['body'],null))[_0x6db4('0x29')](respondWithResult(_0x32b630,null))['catch'](handleError(_0x32b630,null));};exports['destroy']=function(_0x4daf5a,_0x176b95){return db[_0x6db4('0x48')][_0x6db4('0x4f')]({'where':{'id':_0x4daf5a[_0x6db4('0x4d')]['id']}})[_0x6db4('0x29')](handleEntityNotFound(_0x176b95,null))[_0x6db4('0x29')](removeEntity(_0x176b95,null))['catch'](handleError(_0x176b95,null));};exports[_0x6db4('0x5a')]=function(_0x4e8a4e,_0x506c8b){return db['MailQueue'][_0x6db4('0x5a')]()['then'](respondWithResult(_0x506c8b,null))[_0x6db4('0x4b')](handleError(_0x506c8b,null));};exports['getMembers']=function(_0x110ae1,_0x34bf6f,_0x28ab6b){var _0x4c82e7={'raw':!![],'where':{}},_0x36586c={},_0x6e26ed;return db[_0x6db4('0x48')][_0x6db4('0x5b')]({'where':{'id':_0x110ae1['params']['id']}})['then'](handleEntityNotFound(_0x34bf6f,null))[_0x6db4('0x29')](function(_0x4c31f7){if(_0x4c31f7){_0x6e26ed=_0x4c31f7[_0x6db4('0x2b')]({'plain':!![]});_0x36586c['model']=_['keys'](db[_0x6db4('0x5c')][_0x6db4('0x31')]);_0x36586c[_0x6db4('0x36')]=_[_0x6db4('0x37')](_0x110ae1['query']);_0x36586c[_0x6db4('0x38')]=_[_0x6db4('0x39')](_0x36586c[_0x6db4('0x34')],_0x36586c['query']);_0x4c82e7[_0x6db4('0x4e')]=_[_0x6db4('0x39')](_0x36586c[_0x6db4('0x34')],qs['fields'](_0x110ae1[_0x6db4('0x36')][_0x6db4('0x3a')]));_0x4c82e7[_0x6db4('0x4e')]=_0x4c82e7['attributes']['length']?_0x4c82e7[_0x6db4('0x4e')]:_0x36586c[_0x6db4('0x34')];if(!_0x110ae1[_0x6db4('0x36')][_0x6db4('0x3c')](_0x6db4('0x5d'))){_0x4c82e7[_0x6db4('0x22')]=qs[_0x6db4('0x22')](_0x110ae1[_0x6db4('0x36')][_0x6db4('0x22')]);_0x4c82e7[_0x6db4('0x20')]=qs['offset'](_0x110ae1['query']['offset']);}_0x4c82e7[_0x6db4('0x3d')]=qs[_0x6db4('0x3e')](_0x110ae1[_0x6db4('0x36')][_0x6db4('0x3e')]);_0x4c82e7[_0x6db4('0x41')]=qs[_0x6db4('0x38')](_[_0x6db4('0x3f')](_0x110ae1[_0x6db4('0x36')],_0x36586c[_0x6db4('0x38')]));_0x4c82e7[_0x6db4('0x41')][_0x6db4('0x5e')]=_0x4c31f7['id'];if(_0x110ae1[_0x6db4('0x36')][_0x6db4('0x40')]){_0x4c82e7[_0x6db4('0x41')]=_[_0x6db4('0x42')](_0x4c82e7[_0x6db4('0x41')],{'$or':_[_0x6db4('0x35')](_0x4c82e7[_0x6db4('0x4e')],function(_0x34f7dc){var _0x179e3a={};_0x179e3a[_0x34f7dc]={'$like':'%'+_0x110ae1[_0x6db4('0x36')][_0x6db4('0x40')]+'%'};return _0x179e3a;})});}_0x4c82e7=_['merge']({},_0x4c82e7,_0x110ae1['options']);return db[_0x6db4('0x5c')][_0x6db4('0x49')](_0x4c82e7);}})[_0x6db4('0x29')](function(_0x4d5d6e){if(_0x4d5d6e){return db['User'][_0x6db4('0x5f')]({'where':{'id':_[_0x6db4('0x35')](_0x4d5d6e,'UserId'),'role':_0x6db4('0x60')},'attributes':['id',_0x6db4('0x2e'),_0x6db4('0x61'),'updatedAt','createdAt']});}})[_0x6db4('0x29')](function(_0x2687cd){if(_0x2687cd){return{'count':_0x2687cd[_0x6db4('0x23')],'rows':_[_0x6db4('0x35')](_0x2687cd['rows'],function(_0x566ef1){return{'membername':_0x566ef1[_0x6db4('0x2e')],'UserId':_0x566ef1['id'],'queue_name':_0x6e26ed[_0x6db4('0x2e')],'MailQueueId':_0x6e26ed['id'],'interface':util['format'](_0x6db4('0x62'),'SIP',_0x566ef1['name']),'penalty':0x0,'paused':_0x566ef1[_0x6db4('0x61')],'createdAt':_0x566ef1[_0x6db4('0x63')],'updatedAt':_0x566ef1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6db4('0x29')](respondWithFilteredResult(_0x34bf6f,_0x4c82e7))[_0x6db4('0x4b')](handleError(_0x34bf6f,null));};exports[_0x6db4('0x64')]=function(_0x5d3367,_0x22047a,_0x1f6c86){var _0x5465f9={};var _0x47e66e={};var _0x29c17f;var _0x49368d;return db[_0x6db4('0x48')]['findOne']({'where':{'id':_0x5d3367[_0x6db4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x22047a,null))[_0x6db4('0x29')](function(_0x192b59){if(_0x192b59){_0x29c17f=_0x192b59;_0x47e66e[_0x6db4('0x34')]=_['keys'](db[_0x6db4('0x65')][_0x6db4('0x31')]);_0x47e66e[_0x6db4('0x36')]=_['keys'](_0x5d3367[_0x6db4('0x36')]);_0x47e66e[_0x6db4('0x38')]=_['intersection'](_0x47e66e[_0x6db4('0x34')],_0x47e66e[_0x6db4('0x36')]);_0x5465f9[_0x6db4('0x4e')]=_[_0x6db4('0x39')](_0x47e66e[_0x6db4('0x34')],qs[_0x6db4('0x3a')](_0x5d3367[_0x6db4('0x36')][_0x6db4('0x3a')]));_0x5465f9[_0x6db4('0x4e')]=_0x5465f9[_0x6db4('0x4e')][_0x6db4('0x3b')]?_0x5465f9[_0x6db4('0x4e')]:_0x47e66e[_0x6db4('0x34')];_0x5465f9[_0x6db4('0x3d')]=qs['sort'](_0x5d3367[_0x6db4('0x36')][_0x6db4('0x3e')]);_0x5465f9[_0x6db4('0x41')]=qs[_0x6db4('0x38')](_[_0x6db4('0x3f')](_0x5d3367[_0x6db4('0x36')],_0x47e66e[_0x6db4('0x38')]));if(_0x5d3367[_0x6db4('0x36')][_0x6db4('0x40')]){_0x5465f9[_0x6db4('0x41')]=_['merge'](_0x5465f9[_0x6db4('0x41')],{'$or':_[_0x6db4('0x35')](_0x5465f9[_0x6db4('0x4e')],function(_0x2787c6){var _0x28f78c={};_0x28f78c[_0x2787c6]={'$like':'%'+_0x5d3367[_0x6db4('0x36')][_0x6db4('0x40')]+'%'};return _0x28f78c;})});}_0x5465f9=_[_0x6db4('0x42')]({},_0x5465f9,_0x5d3367['options']);return _0x29c17f['getTeams'](_0x5465f9);}})[_0x6db4('0x29')](function(_0x16fcba){if(_0x16fcba){_0x49368d=_0x16fcba[_0x6db4('0x3b')];if(!_0x5d3367[_0x6db4('0x36')][_0x6db4('0x3c')]('nolimit')){_0x5465f9['limit']=qs[_0x6db4('0x22')](_0x5d3367[_0x6db4('0x36')][_0x6db4('0x22')]);_0x5465f9[_0x6db4('0x20')]=qs[_0x6db4('0x20')](_0x5d3367[_0x6db4('0x36')][_0x6db4('0x20')]);}return _0x29c17f['getTeams'](_0x5465f9);}})[_0x6db4('0x29')](function(_0x2a73f3){if(_0x2a73f3){return _0x2a73f3?{'count':_0x49368d,'rows':_0x2a73f3}:null;}})[_0x6db4('0x29')](respondWithResult(_0x22047a,null))[_0x6db4('0x4b')](handleError(_0x22047a,null));};exports[_0x6db4('0x66')]=function(_0x55434e,_0x2c3d24,_0x3243e2){var _0x38a44b=_0x55434e[_0x6db4('0x50')][_0x6db4('0x67')];return db[_0x6db4('0x65')][_0x6db4('0x49')]({'where':{'id':_0x38a44b},'attributes':['id'],'include':[{'model':db[_0x6db4('0x68')],'as':_0x6db4('0x69'),'attributes':['id',_0x6db4('0x2e'),_0x6db4('0x6a'),_0x6db4('0x6b'),_0x6db4('0x6c')],'raw':!![]}]})[_0x6db4('0x29')](function(_0x28eda6){if(_0x28eda6){var _0x534716=_[_0x6db4('0x6d')](_0x28eda6,function(_0x1500bb){var _0x35a858=_0x1500bb[_0x6db4('0x2b')]({'plain':!![]});return _0x35a858[_0x6db4('0x69')];});return db[_0x6db4('0x48')][_0x6db4('0x4f')]({'where':{'id':_0x55434e[_0x6db4('0x4d')]['id']}})[_0x6db4('0x29')](function(_0x8ca110){return db['sequelize'][_0x6db4('0x6e')](function(_0x31576e){return _0x8ca110['addTeams'](_0x38a44b,{'transaction':_0x31576e})[_0x6db4('0x29')](function(){return BPromise[_0x6db4('0x6f')](_0x534716,function(_0x51bc4e){return db[_0x6db4('0x5c')][_0x6db4('0x70')]({'where':{'UserId':_0x51bc4e['id'],'MailQueueId':_0x55434e[_0x6db4('0x4d')]['id']},'transaction':_0x31576e});});})[_0x6db4('0x29')](function(){_0x534716[_0x6db4('0x71')](function(_0x30641e){socket['emit']('userMailQueue:save',{'UserId':_0x30641e['id'],'MailQueueId':_0x8ca110['id']});});});});});}})[_0x6db4('0x29')](respondWithStatusCode(_0x2c3d24,null))['catch'](handleError(_0x2c3d24,null));};exports[_0x6db4('0x72')]=function(_0x583a29,_0x4b0386,_0x48119c){return db[_0x6db4('0x65')]['findAll']({'where':{'id':_0x583a29[_0x6db4('0x36')][_0x6db4('0x67')]},'attributes':['id'],'include':[{'model':db[_0x6db4('0x68')],'as':_0x6db4('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b0386,null))[_0x6db4('0x29')](function(_0x44c0ed){var _0x5000f9=_[_0x6db4('0x35')](_0x44c0ed,'id');var _0x643233=[];var _0x1aa5c3=[];var _0x43c3db=squel[_0x6db4('0x73')]();_0x43c3db[_0x6db4('0x74')]('tq.TeamId')['from'](_0x6db4('0x75'),'tq')[_0x6db4('0x76')](_0x6db4('0x77'),'ut',_0x6db4('0x78'))[_0x6db4('0x41')](_0x6db4('0x79'),_0x583a29['params']['id']);for(var _0x2a0d33=0x0;_0x2a0d33<_0x44c0ed[_0x6db4('0x3b')];_0x2a0d33+=0x1){let _0x1b6b6d=_0x44c0ed[_0x2a0d33];for(var _0xb34da3=0x0;_0xb34da3<_0x1b6b6d['Agents'][_0x6db4('0x3b')];_0xb34da3+=0x1){let _0x5ebd51=_0x1b6b6d[_0x6db4('0x69')][_0xb34da3];var _0x4f8eaf=_0x43c3db[_0x6db4('0x7a')]();_0x4f8eaf[_0x6db4('0x41')]('ut.UserId\x20=\x20?',_0x5ebd51['id']);_0x1aa5c3[_0x6db4('0x7b')](db[_0x6db4('0x7c')]['query'](_0x4f8eaf[_0x6db4('0x7d')](),{'type':db[_0x6db4('0x7c')][_0x6db4('0x7e')][_0x6db4('0x7f')]})[_0x6db4('0x29')](function(_0x4ff034){if(_0x4ff034[_0x6db4('0x3b')]===0x1){return _0x5ebd51['id'];}else{var _0x3230e2=_[_0x6db4('0x80')](_['map'](_0x4ff034,_0x6db4('0x81')),function(_0xdd076){return _[_0x6db4('0x82')](_0x5000f9,_0xdd076);});if(_0x3230e2){return _0x5ebd51['id'];}}}));}}return BPromise[_0x6db4('0x83')](_0x1aa5c3)[_0x6db4('0x29')](function(_0x47ecbf){_0x643233=_(_0x643233)['union'](_0x47ecbf)[_0x6db4('0x84')]()[_0x6db4('0x85')]();return db[_0x6db4('0x48')]['find']({'where':{'id':_0x583a29[_0x6db4('0x4d')]['id']}})[_0x6db4('0x29')](function(_0x1bfdda){return db['sequelize'][_0x6db4('0x6e')](function(_0x5ccb68){return _0x1bfdda[_0x6db4('0x72')](_0x583a29[_0x6db4('0x36')]['ids'],{'transaction':_0x5ccb68})[_0x6db4('0x29')](function(){if(!_[_0x6db4('0x86')](_0x643233)){return _0x1bfdda[_0x6db4('0x87')](_0x643233,{'transaction':_0x5ccb68});}})[_0x6db4('0x29')](function(){_0x643233['forEach'](function(_0x116b6f){socket[_0x6db4('0x88')](_0x6db4('0x89'),{'UserId':_0x116b6f,'MailQueueId':_0x1bfdda['id']});});});});});});})[_0x6db4('0x29')](respondWithStatusCode(_0x4b0386,null))[_0x6db4('0x4b')](handleError(_0x4b0386,null));};exports[_0x6db4('0x8a')]=function(_0x585ab9,_0x3f8d62,_0x3502b3){return db['MailQueue'][_0x6db4('0x4f')]({'where':{'id':_0x585ab9[_0x6db4('0x4d')]['id']}})[_0x6db4('0x29')](handleEntityNotFound(_0x3f8d62,null))[_0x6db4('0x29')](function(_0x26179c){if(_0x26179c){return _0x26179c[_0x6db4('0x8a')](_0x585ab9[_0x6db4('0x50')]['ids'],_[_0x6db4('0x8b')](_0x585ab9[_0x6db4('0x50')],[_0x6db4('0x67'),'id'])||{})[_0x6db4('0x8c')](function(_0x93f64a){for(var _0xa10c83=0x0;_0xa10c83<_0x585ab9[_0x6db4('0x50')][_0x6db4('0x67')][_0x6db4('0x3b')];_0xa10c83+=0x1){socket[_0x6db4('0x88')](_0x6db4('0x8d'),{'UserId':Number(_0x585ab9['body'][_0x6db4('0x67')][_0xa10c83]),'MailQueueId':Number(_0x585ab9[_0x6db4('0x4d')]['id'])});}return _0x93f64a;});}})['then'](respondWithResult(_0x3f8d62,null))['catch'](handleError(_0x3f8d62,null));};exports[_0x6db4('0x87')]=function(_0x57c9c7,_0x2e91d4,_0x5f157f){return db[_0x6db4('0x48')][_0x6db4('0x4f')]({'where':{'id':_0x57c9c7[_0x6db4('0x4d')]['id']}})[_0x6db4('0x29')](handleEntityNotFound(_0x2e91d4,null))[_0x6db4('0x29')](function(_0x1ca508){if(_0x1ca508){return _0x1ca508[_0x6db4('0x87')](_0x57c9c7['query']['ids'])[_0x6db4('0x29')](function(){if(_[_0x6db4('0x8e')](_0x57c9c7[_0x6db4('0x36')][_0x6db4('0x67')])){for(var _0x2401d3=0x0;_0x2401d3<_0x57c9c7[_0x6db4('0x36')]['ids'][_0x6db4('0x3b')];_0x2401d3+=0x1){socket[_0x6db4('0x88')](_0x6db4('0x89'),{'UserId':Number(_0x57c9c7[_0x6db4('0x36')][_0x6db4('0x67')][_0x2401d3]),'MailQueueId':Number(_0x57c9c7['params']['id'])});}}else{socket[_0x6db4('0x88')]('userMailQueue:remove',{'UserId':Number(_0x57c9c7['query'][_0x6db4('0x67')]),'MailQueueId':Number(_0x57c9c7[_0x6db4('0x4d')]['id'])});}});}})[_0x6db4('0x29')](respondWithStatusCode(_0x2e91d4,null))[_0x6db4('0x4b')](handleError(_0x2e91d4,null));};exports[_0x6db4('0x8f')]=function(_0x2c1e1c,_0x236e8f,_0x4b4767){var _0x4bf049={};var _0x5acc1d={};var _0x3ffc1e;var _0x4d170f;return db['MailQueue']['findOne']({'where':{'id':_0x2c1e1c[_0x6db4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x236e8f,null))['then'](function(_0x232eb1){if(_0x232eb1){_0x3ffc1e=_0x232eb1;_0x5acc1d[_0x6db4('0x34')]=_[_0x6db4('0x37')](db[_0x6db4('0x68')][_0x6db4('0x31')]);_0x5acc1d[_0x6db4('0x36')]=_['keys'](_0x2c1e1c['query']);_0x5acc1d[_0x6db4('0x38')]=_[_0x6db4('0x39')](_0x5acc1d['model'],_0x5acc1d[_0x6db4('0x36')]);_0x4bf049[_0x6db4('0x4e')]=_['intersection'](_0x5acc1d['model'],qs[_0x6db4('0x3a')](_0x2c1e1c[_0x6db4('0x36')][_0x6db4('0x3a')]));_0x4bf049[_0x6db4('0x4e')]=_0x4bf049[_0x6db4('0x4e')][_0x6db4('0x3b')]?_0x4bf049[_0x6db4('0x4e')]:_0x5acc1d[_0x6db4('0x34')];_0x4bf049[_0x6db4('0x3d')]=qs[_0x6db4('0x3e')](_0x2c1e1c[_0x6db4('0x36')][_0x6db4('0x3e')]);_0x4bf049[_0x6db4('0x41')]=qs[_0x6db4('0x38')](_[_0x6db4('0x3f')](_0x2c1e1c[_0x6db4('0x36')],_0x5acc1d[_0x6db4('0x38')]));if(_0x2c1e1c[_0x6db4('0x36')]['filter']){_0x4bf049[_0x6db4('0x41')]=_[_0x6db4('0x42')](_0x4bf049[_0x6db4('0x41')],{'$or':_[_0x6db4('0x35')](_0x4bf049[_0x6db4('0x4e')],function(_0x787d59){var _0x4668e3={};_0x4668e3[_0x787d59]={'$like':'%'+_0x2c1e1c[_0x6db4('0x36')][_0x6db4('0x40')]+'%'};return _0x4668e3;})});}_0x4bf049=_[_0x6db4('0x42')]({},_0x4bf049,_0x2c1e1c[_0x6db4('0x45')]);return _0x3ffc1e['getAgents'](_0x4bf049);}})[_0x6db4('0x29')](function(_0x2b8134){if(_0x2b8134){_0x4d170f=_0x2b8134['length'];if(!_0x2c1e1c['query'][_0x6db4('0x3c')](_0x6db4('0x5d'))){_0x4bf049['limit']=qs[_0x6db4('0x22')](_0x2c1e1c['query']['limit']);_0x4bf049[_0x6db4('0x20')]=qs[_0x6db4('0x20')](_0x2c1e1c[_0x6db4('0x36')][_0x6db4('0x20')]);}return _0x3ffc1e[_0x6db4('0x8f')](_0x4bf049);}})['then'](function(_0x465eca){if(_0x465eca){return _0x465eca?{'count':_0x4d170f,'rows':_0x465eca}:null;}})[_0x6db4('0x29')](respondWithResult(_0x236e8f,null))[_0x6db4('0x4b')](handleError(_0x236e8f,null));}; \ No newline at end of file +var _0x8aa7=['updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','flatMap','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','UserProfileResource','sendStatus','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','catch','params','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserMailQueue','findAll','User','findAndCountAll','UserId','agent','mailPause'];(function(_0x5b01fe,_0x864f13){var _0x31991e=function(_0x2c7496){while(--_0x2c7496){_0x5b01fe['push'](_0x5b01fe['shift']());}};_0x31991e(++_0x864f13);}(_0x8aa7,0xb6));var _0x78aa=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x8aa7[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78aa('0x0'));var zipdir=require(_0x78aa('0x1'));var jsonpatch=require(_0x78aa('0x2'));var rp=require(_0x78aa('0x3'));var moment=require(_0x78aa('0x4'));var BPromise=require(_0x78aa('0x5'));var Mustache=require(_0x78aa('0x6'));var util=require('util');var path=require(_0x78aa('0x7'));var sox=require(_0x78aa('0x8'));var csv=require(_0x78aa('0x9'));var ejs=require(_0x78aa('0xa'));var fs=require('fs');var fs_extra=require(_0x78aa('0xb'));var _=require(_0x78aa('0xc'));var squel=require(_0x78aa('0xd'));var crypto=require(_0x78aa('0xe'));var jsforce=require(_0x78aa('0xf'));var deskjs=require(_0x78aa('0x10'));var toCsv=require(_0x78aa('0x9'));var querystring=require(_0x78aa('0x11'));var Papa=require(_0x78aa('0x12'));var Redis=require(_0x78aa('0x13'));var authService=require(_0x78aa('0x14'));var qs=require(_0x78aa('0x15'));var as=require(_0x78aa('0x16'));var hardwareService=require(_0x78aa('0x17'));var logger=require(_0x78aa('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x78aa('0x19'));var licenseUtil=require(_0x78aa('0x1a'));var db=require('../../mysqldb')['db'];config[_0x78aa('0x1b')]=_[_0x78aa('0x1c')](config[_0x78aa('0x1b')],{'host':_0x78aa('0x1d'),'port':0x18eb});var socket=require(_0x78aa('0x1e'))(new Redis(config['redis']));require(_0x78aa('0x1f'))[_0x78aa('0x20')](socket);function respondWithStatusCode(_0x28d235,_0x2b0f8d){_0x2b0f8d=_0x2b0f8d||0xcc;return function(_0x38e744){if(_0x38e744){return _0x28d235['sendStatus'](_0x2b0f8d);}return _0x28d235[_0x78aa('0x21')](_0x2b0f8d)[_0x78aa('0x22')]();};}function respondWithResult(_0x23dbb4,_0xa70322){_0xa70322=_0xa70322||0xc8;return function(_0x390ce5){if(_0x390ce5){return _0x23dbb4[_0x78aa('0x21')](_0xa70322)['json'](_0x390ce5);}};}function respondWithFilteredResult(_0x4a1eed,_0xded973){return function(_0x345e4d){if(_0x345e4d){var _0xc316d9=typeof _0xded973[_0x78aa('0x23')]===_0x78aa('0x24')&&typeof _0xded973[_0x78aa('0x25')]===_0x78aa('0x24');var _0x137354=_0x345e4d[_0x78aa('0x26')];var _0x30289d=_0xc316d9?0x0:_0xded973[_0x78aa('0x23')];var _0x4fb6b3=_0xc316d9?_0x345e4d[_0x78aa('0x26')]:_0xded973[_0x78aa('0x23')]+_0xded973['limit'];var _0xa732df;if(_0x4fb6b3>=_0x137354){_0x4fb6b3=_0x137354;_0xa732df=0xc8;}else{_0xa732df=0xce;}_0x4a1eed[_0x78aa('0x21')](_0xa732df);return _0x4a1eed[_0x78aa('0x27')]('Content-Range',_0x30289d+'-'+_0x4fb6b3+'/'+_0x137354)['json'](_0x345e4d);}return null;};}function patchUpdates(_0x157d43){return function(_0x109c88){try{jsonpatch['apply'](_0x109c88,_0x157d43,!![]);}catch(_0x13a601){return BPromise[_0x78aa('0x28')](_0x13a601);}return _0x109c88[_0x78aa('0x29')]();};}function saveUpdates(_0x3b17b8,_0x4beba8){return function(_0x2f241e){if(_0x2f241e){return _0x2f241e[_0x78aa('0x2a')](_0x3b17b8)[_0x78aa('0x2b')](function(_0x24cbaa){return _0x24cbaa;});}return null;};}function removeEntity(_0x45b012,_0x262cc7){return function(_0x45a391){if(_0x45a391){return _0x45a391[_0x78aa('0x2c')]()['then'](function(){var _0x339805=_0x45a391['get']({'plain':!![]});var _0x18f930='MailQueues';return db[_0x78aa('0x2d')][_0x78aa('0x2c')]({'where':{'type':_0x18f930,'resourceId':_0x339805['id']}})[_0x78aa('0x2b')](function(){return _0x45a391;});})[_0x78aa('0x2b')](function(){_0x45b012[_0x78aa('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d8b5e,_0x434bc4){return function(_0x4dc0a6){if(!_0x4dc0a6){_0x2d8b5e[_0x78aa('0x2e')](0x194);}return _0x4dc0a6;};}function handleError(_0x4d6616,_0x568012){_0x568012=_0x568012||0x1f4;return function(_0x6d8516){logger['error'](_0x6d8516['stack']);if(_0x6d8516[_0x78aa('0x2f')]){delete _0x6d8516[_0x78aa('0x2f')];}_0x4d6616[_0x78aa('0x21')](_0x568012)[_0x78aa('0x30')](_0x6d8516);};}exports[_0x78aa('0x31')]=function(_0x2a9fad,_0x3a3f45){var _0x53dd7e={},_0x47ae09={},_0x4976be={'count':0x0,'rows':[]};var _0x1c91de=_[_0x78aa('0x32')](db[_0x78aa('0x33')][_0x78aa('0x34')],function(_0x565098){return{'name':_0x565098[_0x78aa('0x35')],'type':_0x565098[_0x78aa('0x36')][_0x78aa('0x37')]};});_0x47ae09['model']=_['map'](_0x1c91de,'name');_0x47ae09['query']=_[_0x78aa('0x38')](_0x2a9fad[_0x78aa('0x39')]);_0x47ae09[_0x78aa('0x3a')]=_[_0x78aa('0x3b')](_0x47ae09[_0x78aa('0x3c')],_0x47ae09[_0x78aa('0x39')]);_0x53dd7e[_0x78aa('0x3d')]=_[_0x78aa('0x3b')](_0x47ae09[_0x78aa('0x3c')],qs['fields'](_0x2a9fad[_0x78aa('0x39')]['fields']));_0x53dd7e[_0x78aa('0x3d')]=_0x53dd7e[_0x78aa('0x3d')][_0x78aa('0x3e')]?_0x53dd7e[_0x78aa('0x3d')]:_0x47ae09[_0x78aa('0x3c')];if(!_0x2a9fad[_0x78aa('0x39')][_0x78aa('0x3f')](_0x78aa('0x40'))){_0x53dd7e['limit']=qs[_0x78aa('0x25')](_0x2a9fad[_0x78aa('0x39')]['limit']);_0x53dd7e[_0x78aa('0x23')]=qs['offset'](_0x2a9fad[_0x78aa('0x39')][_0x78aa('0x23')]);}_0x53dd7e[_0x78aa('0x41')]=qs[_0x78aa('0x42')](_0x2a9fad[_0x78aa('0x39')][_0x78aa('0x42')]);_0x53dd7e[_0x78aa('0x43')]=qs[_0x78aa('0x3a')](_[_0x78aa('0x44')](_0x2a9fad[_0x78aa('0x39')],_0x47ae09[_0x78aa('0x3a')]),_0x1c91de);if(_0x2a9fad[_0x78aa('0x39')][_0x78aa('0x45')]){_0x53dd7e[_0x78aa('0x43')]=_['merge'](_0x53dd7e['where'],{'$or':_[_0x78aa('0x32')](_0x1c91de,function(_0x5d5068){if(_0x5d5068[_0x78aa('0x36')]!==_0x78aa('0x46')){var _0x577964={};_0x577964[_0x5d5068[_0x78aa('0x2f')]]={'$like':'%'+_0x2a9fad[_0x78aa('0x39')]['filter']+'%'};return _0x577964;}})});}_0x53dd7e=_[_0x78aa('0x47')]({},_0x53dd7e,_0x2a9fad['options']);var _0x4d9913={'where':_0x53dd7e[_0x78aa('0x43')]};return db[_0x78aa('0x33')][_0x78aa('0x26')](_0x4d9913)[_0x78aa('0x2b')](function(_0x59d035){_0x4976be[_0x78aa('0x26')]=_0x59d035;if(_0x2a9fad['query'][_0x78aa('0x48')]){_0x53dd7e[_0x78aa('0x49')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x53dd7e);})[_0x78aa('0x2b')](function(_0x4c4e82){_0x4976be['rows']=_0x4c4e82;return _0x4976be;})[_0x78aa('0x2b')](respondWithFilteredResult(_0x3a3f45,_0x53dd7e))[_0x78aa('0x4a')](handleError(_0x3a3f45,null));};exports['show']=function(_0x199c90,_0x27e240){var _0xb17d0e={'raw':!![],'where':{'id':_0x199c90[_0x78aa('0x4b')]['id']}},_0xe86024={};_0xe86024[_0x78aa('0x3c')]=_[_0x78aa('0x38')](db[_0x78aa('0x33')][_0x78aa('0x34')]);_0xe86024[_0x78aa('0x39')]=_[_0x78aa('0x38')](_0x199c90[_0x78aa('0x39')]);_0xe86024[_0x78aa('0x3a')]=_['intersection'](_0xe86024['model'],_0xe86024[_0x78aa('0x39')]);_0xb17d0e[_0x78aa('0x3d')]=_['intersection'](_0xe86024[_0x78aa('0x3c')],qs['fields'](_0x199c90[_0x78aa('0x39')][_0x78aa('0x4c')]));_0xb17d0e['attributes']=_0xb17d0e['attributes'][_0x78aa('0x3e')]?_0xb17d0e[_0x78aa('0x3d')]:_0xe86024['model'];if(_0x199c90['query'][_0x78aa('0x48')]){_0xb17d0e[_0x78aa('0x49')]=[{'all':!![]}];}_0xb17d0e=_['merge']({},_0xb17d0e,_0x199c90[_0x78aa('0x4d')]);return db[_0x78aa('0x33')][_0x78aa('0x4e')](_0xb17d0e)[_0x78aa('0x2b')](handleEntityNotFound(_0x27e240,null))[_0x78aa('0x2b')](respondWithResult(_0x27e240,null))['catch'](handleError(_0x27e240,null));};exports[_0x78aa('0x4f')]=function(_0x39497b,_0x35ecf8){return db[_0x78aa('0x33')][_0x78aa('0x4f')](_0x39497b[_0x78aa('0x50')],{})['then'](function(_0x465d21){var _0x178554=_0x39497b[_0x78aa('0x51')]['get']({'plain':!![]});if(!_0x178554)throw new Error(_0x78aa('0x52'));if(_0x178554['role']==='user'){var _0x4c5b47=_0x465d21[_0x78aa('0x53')]({'plain':!![]});var _0x24f647='MailQueues';return db[_0x78aa('0x54')][_0x78aa('0x4e')]({'where':{'name':_0x24f647,'userProfileId':_0x178554[_0x78aa('0x55')]},'raw':!![]})['then'](function(_0x383d71){if(_0x383d71&&_0x383d71[_0x78aa('0x56')]===0x0){return db[_0x78aa('0x2d')][_0x78aa('0x4f')]({'name':_0x4c5b47[_0x78aa('0x2f')],'resourceId':_0x4c5b47['id'],'type':_0x383d71['name'],'sectionId':_0x383d71['id']},{})[_0x78aa('0x2b')](function(){return _0x465d21;});}else{return _0x465d21;}})[_0x78aa('0x4a')](function(_0x273f09){logger['error'](_0x78aa('0x57'),_0x273f09);throw _0x273f09;});}return _0x465d21;})[_0x78aa('0x2b')](respondWithResult(_0x35ecf8,0xc9))[_0x78aa('0x4a')](handleError(_0x35ecf8,null));};exports['update']=function(_0x3cc02d,_0x58d065){if(_0x3cc02d[_0x78aa('0x50')]['id']){delete _0x3cc02d[_0x78aa('0x50')]['id'];}return db[_0x78aa('0x33')]['find']({'where':{'id':_0x3cc02d[_0x78aa('0x4b')]['id']}})[_0x78aa('0x2b')](handleEntityNotFound(_0x58d065,null))[_0x78aa('0x2b')](saveUpdates(_0x3cc02d[_0x78aa('0x50')],null))['then'](respondWithResult(_0x58d065,null))[_0x78aa('0x4a')](handleError(_0x58d065,null));};exports['destroy']=function(_0x5cf84a,_0x4888ce){return db['MailQueue']['find']({'where':{'id':_0x5cf84a[_0x78aa('0x4b')]['id']}})[_0x78aa('0x2b')](handleEntityNotFound(_0x4888ce,null))['then'](removeEntity(_0x4888ce,null))[_0x78aa('0x4a')](handleError(_0x4888ce,null));};exports[_0x78aa('0x58')]=function(_0x2816bb,_0x167f3d){return db['MailQueue'][_0x78aa('0x58')]()[_0x78aa('0x2b')](respondWithResult(_0x167f3d,null))['catch'](handleError(_0x167f3d,null));};exports['getMembers']=function(_0x47ea78,_0x5d8261,_0x42fa3e){var _0x389681={'raw':!![],'where':{}},_0x21337e={},_0x5706d7;return db[_0x78aa('0x33')]['findOne']({'where':{'id':_0x47ea78[_0x78aa('0x4b')]['id']}})[_0x78aa('0x2b')](handleEntityNotFound(_0x5d8261,null))[_0x78aa('0x2b')](function(_0xc54536){if(_0xc54536){_0x5706d7=_0xc54536[_0x78aa('0x53')]({'plain':!![]});_0x21337e[_0x78aa('0x3c')]=_[_0x78aa('0x38')](db[_0x78aa('0x59')]['rawAttributes']);_0x21337e[_0x78aa('0x39')]=_['keys'](_0x47ea78[_0x78aa('0x39')]);_0x21337e[_0x78aa('0x3a')]=_[_0x78aa('0x3b')](_0x21337e[_0x78aa('0x3c')],_0x21337e[_0x78aa('0x39')]);_0x389681['attributes']=_[_0x78aa('0x3b')](_0x21337e[_0x78aa('0x3c')],qs[_0x78aa('0x4c')](_0x47ea78[_0x78aa('0x39')][_0x78aa('0x4c')]));_0x389681[_0x78aa('0x3d')]=_0x389681[_0x78aa('0x3d')]['length']?_0x389681[_0x78aa('0x3d')]:_0x21337e['model'];if(!_0x47ea78[_0x78aa('0x39')][_0x78aa('0x3f')](_0x78aa('0x40'))){_0x389681[_0x78aa('0x25')]=qs['limit'](_0x47ea78[_0x78aa('0x39')][_0x78aa('0x25')]);_0x389681[_0x78aa('0x23')]=qs[_0x78aa('0x23')](_0x47ea78[_0x78aa('0x39')][_0x78aa('0x23')]);}_0x389681[_0x78aa('0x41')]=qs['sort'](_0x47ea78[_0x78aa('0x39')][_0x78aa('0x42')]);_0x389681[_0x78aa('0x43')]=qs[_0x78aa('0x3a')](_[_0x78aa('0x44')](_0x47ea78['query'],_0x21337e[_0x78aa('0x3a')]));_0x389681['where']['MailQueueId']=_0xc54536['id'];if(_0x47ea78[_0x78aa('0x39')][_0x78aa('0x45')]){_0x389681[_0x78aa('0x43')]=_['merge'](_0x389681['where'],{'$or':_[_0x78aa('0x32')](_0x389681[_0x78aa('0x3d')],function(_0x527731){var _0x1ab49d={};_0x1ab49d[_0x527731]={'$like':'%'+_0x47ea78[_0x78aa('0x39')]['filter']+'%'};return _0x1ab49d;})});}_0x389681=_['merge']({},_0x389681,_0x47ea78[_0x78aa('0x4d')]);return db[_0x78aa('0x59')][_0x78aa('0x5a')](_0x389681);}})['then'](function(_0x3b00bf){if(_0x3b00bf){return db[_0x78aa('0x5b')][_0x78aa('0x5c')]({'where':{'id':_[_0x78aa('0x32')](_0x3b00bf,_0x78aa('0x5d')),'role':_0x78aa('0x5e')},'attributes':['id',_0x78aa('0x2f'),_0x78aa('0x5f'),_0x78aa('0x60'),_0x78aa('0x61')]});}})[_0x78aa('0x2b')](function(_0x1d766b){if(_0x1d766b){return{'count':_0x1d766b[_0x78aa('0x26')],'rows':_[_0x78aa('0x32')](_0x1d766b[_0x78aa('0x62')],function(_0xa0e2c7){return{'membername':_0xa0e2c7[_0x78aa('0x2f')],'UserId':_0xa0e2c7['id'],'queue_name':_0x5706d7['name'],'MailQueueId':_0x5706d7['id'],'interface':util[_0x78aa('0x63')](_0x78aa('0x64'),_0x78aa('0x65'),_0xa0e2c7[_0x78aa('0x2f')]),'penalty':0x0,'paused':_0xa0e2c7[_0x78aa('0x5f')],'createdAt':_0xa0e2c7[_0x78aa('0x61')],'updatedAt':_0xa0e2c7[_0x78aa('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x78aa('0x2b')](respondWithFilteredResult(_0x5d8261,_0x389681))['catch'](handleError(_0x5d8261,null));};exports[_0x78aa('0x66')]=function(_0x55a953,_0x5c1909,_0x3f7679){var _0x5b3c4a={};var _0x19cc44={};var _0x9d0f7b;var _0x25d63a;return db['MailQueue']['findOne']({'where':{'id':_0x55a953[_0x78aa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c1909,null))[_0x78aa('0x2b')](function(_0x182210){if(_0x182210){_0x9d0f7b=_0x182210;_0x19cc44['model']=_['keys'](db[_0x78aa('0x67')][_0x78aa('0x34')]);_0x19cc44[_0x78aa('0x39')]=_['keys'](_0x55a953['query']);_0x19cc44[_0x78aa('0x3a')]=_[_0x78aa('0x3b')](_0x19cc44[_0x78aa('0x3c')],_0x19cc44[_0x78aa('0x39')]);_0x5b3c4a[_0x78aa('0x3d')]=_['intersection'](_0x19cc44[_0x78aa('0x3c')],qs['fields'](_0x55a953['query'][_0x78aa('0x4c')]));_0x5b3c4a[_0x78aa('0x3d')]=_0x5b3c4a[_0x78aa('0x3d')][_0x78aa('0x3e')]?_0x5b3c4a[_0x78aa('0x3d')]:_0x19cc44[_0x78aa('0x3c')];_0x5b3c4a[_0x78aa('0x41')]=qs[_0x78aa('0x42')](_0x55a953[_0x78aa('0x39')][_0x78aa('0x42')]);_0x5b3c4a[_0x78aa('0x43')]=qs[_0x78aa('0x3a')](_[_0x78aa('0x44')](_0x55a953[_0x78aa('0x39')],_0x19cc44[_0x78aa('0x3a')]));if(_0x55a953[_0x78aa('0x39')][_0x78aa('0x45')]){_0x5b3c4a[_0x78aa('0x43')]=_['merge'](_0x5b3c4a[_0x78aa('0x43')],{'$or':_['map'](_0x5b3c4a['attributes'],function(_0xe990fe){var _0x3437dd={};_0x3437dd[_0xe990fe]={'$like':'%'+_0x55a953[_0x78aa('0x39')][_0x78aa('0x45')]+'%'};return _0x3437dd;})});}_0x5b3c4a=_[_0x78aa('0x47')]({},_0x5b3c4a,_0x55a953[_0x78aa('0x4d')]);return _0x9d0f7b[_0x78aa('0x66')](_0x5b3c4a);}})[_0x78aa('0x2b')](function(_0x3b2adf){if(_0x3b2adf){_0x25d63a=_0x3b2adf[_0x78aa('0x3e')];if(!_0x55a953['query'][_0x78aa('0x3f')](_0x78aa('0x40'))){_0x5b3c4a[_0x78aa('0x25')]=qs['limit'](_0x55a953[_0x78aa('0x39')][_0x78aa('0x25')]);_0x5b3c4a['offset']=qs[_0x78aa('0x23')](_0x55a953[_0x78aa('0x39')][_0x78aa('0x23')]);}return _0x9d0f7b[_0x78aa('0x66')](_0x5b3c4a);}})[_0x78aa('0x2b')](function(_0x4d4420){if(_0x4d4420){return _0x4d4420?{'count':_0x25d63a,'rows':_0x4d4420}:null;}})['then'](respondWithResult(_0x5c1909,null))['catch'](handleError(_0x5c1909,null));};exports['addTeams']=function(_0x58ba29,_0x1e02b,_0x292f34){var _0x3a3f8d=_0x58ba29['body'][_0x78aa('0x68')];return db[_0x78aa('0x67')][_0x78aa('0x5a')]({'where':{'id':_0x3a3f8d},'attributes':['id'],'include':[{'model':db[_0x78aa('0x5b')],'as':_0x78aa('0x69'),'attributes':['id',_0x78aa('0x2f'),_0x78aa('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x78aa('0x2b')](function(_0x38c298){if(_0x38c298){var _0x4ea120=_[_0x78aa('0x6b')](_0x38c298,function(_0x5284c6){var _0x28eeb1=_0x5284c6['get']({'plain':!![]});return _0x28eeb1[_0x78aa('0x69')];});return db[_0x78aa('0x33')][_0x78aa('0x4e')]({'where':{'id':_0x58ba29[_0x78aa('0x4b')]['id']}})[_0x78aa('0x2b')](function(_0x19c158){return db['sequelize'][_0x78aa('0x6c')](function(_0x270f5f){return _0x19c158['addTeams'](_0x3a3f8d,{'transaction':_0x270f5f})[_0x78aa('0x2b')](function(){return BPromise[_0x78aa('0x6d')](_0x4ea120,function(_0x240c75){return db[_0x78aa('0x59')][_0x78aa('0x6e')]({'where':{'UserId':_0x240c75['id'],'MailQueueId':_0x58ba29[_0x78aa('0x4b')]['id']},'transaction':_0x270f5f});});})[_0x78aa('0x2b')](function(){_0x4ea120['forEach'](function(_0x1ad626){socket[_0x78aa('0x6f')](_0x78aa('0x70'),{'UserId':_0x1ad626['id'],'MailQueueId':_0x19c158['id']});});});});});}})[_0x78aa('0x2b')](respondWithStatusCode(_0x1e02b,null))['catch'](handleError(_0x1e02b,null));};exports[_0x78aa('0x71')]=function(_0x1b1501,_0x2c3452,_0x324de3){return db[_0x78aa('0x67')]['findAll']({'where':{'id':_0x1b1501[_0x78aa('0x39')][_0x78aa('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2c3452,null))[_0x78aa('0x2b')](function(_0x54dc5d){var _0x49d131=_['map'](_0x54dc5d,'id');var _0x25487c=[];var _0x5a5ad7=[];var _0x5015a0=squel[_0x78aa('0x72')]();_0x5015a0[_0x78aa('0x73')](_0x78aa('0x74'))[_0x78aa('0x75')](_0x78aa('0x76'),'tq')[_0x78aa('0x77')](_0x78aa('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x78aa('0x79'),_0x1b1501[_0x78aa('0x4b')]['id']);for(var _0x149206=0x0;_0x149206<_0x54dc5d['length'];_0x149206+=0x1){let _0xe515bc=_0x54dc5d[_0x149206];for(var _0x4021d4=0x0;_0x4021d4<_0xe515bc[_0x78aa('0x69')][_0x78aa('0x3e')];_0x4021d4+=0x1){let _0x2e2204=_0xe515bc['Agents'][_0x4021d4];var _0x2943e6=_0x5015a0[_0x78aa('0x7a')]();_0x2943e6[_0x78aa('0x43')](_0x78aa('0x7b'),_0x2e2204['id']);_0x5a5ad7['push'](db['sequelize'][_0x78aa('0x39')](_0x2943e6[_0x78aa('0x7c')](),{'type':db['sequelize']['QueryTypes'][_0x78aa('0x7d')]})[_0x78aa('0x2b')](function(_0x517201){if(_0x517201[_0x78aa('0x3e')]===0x1){return _0x2e2204['id'];}else{var _0x1d1a61=_[_0x78aa('0x7e')](_['map'](_0x517201,_0x78aa('0x7f')),function(_0x2f0503){return _[_0x78aa('0x80')](_0x49d131,_0x2f0503);});if(_0x1d1a61){return _0x2e2204['id'];}}}));}}return BPromise[_0x78aa('0x81')](_0x5a5ad7)[_0x78aa('0x2b')](function(_0x30c122){_0x25487c=_(_0x25487c)['union'](_0x30c122)[_0x78aa('0x82')]()[_0x78aa('0x83')]();return db['MailQueue'][_0x78aa('0x4e')]({'where':{'id':_0x1b1501[_0x78aa('0x4b')]['id']}})[_0x78aa('0x2b')](function(_0x3d2b11){return db['sequelize']['transaction'](function(_0x3b96b9){return _0x3d2b11[_0x78aa('0x71')](_0x1b1501[_0x78aa('0x39')][_0x78aa('0x68')],{'transaction':_0x3b96b9})[_0x78aa('0x2b')](function(){if(!_[_0x78aa('0x84')](_0x25487c)){return _0x3d2b11[_0x78aa('0x85')](_0x25487c,{'transaction':_0x3b96b9});}})[_0x78aa('0x2b')](function(){_0x25487c[_0x78aa('0x86')](function(_0x4a008e){socket['emit'](_0x78aa('0x87'),{'UserId':_0x4a008e,'MailQueueId':_0x3d2b11['id']});});});});});});})[_0x78aa('0x2b')](respondWithStatusCode(_0x2c3452,null))[_0x78aa('0x4a')](handleError(_0x2c3452,null));};exports[_0x78aa('0x88')]=function(_0x57204c,_0x171992,_0x1d8187){return db[_0x78aa('0x33')][_0x78aa('0x4e')]({'where':{'id':_0x57204c[_0x78aa('0x4b')]['id']}})[_0x78aa('0x2b')](handleEntityNotFound(_0x171992,null))[_0x78aa('0x2b')](function(_0xddc21b){if(_0xddc21b){return _0xddc21b[_0x78aa('0x88')](_0x57204c['body'][_0x78aa('0x68')],_[_0x78aa('0x89')](_0x57204c[_0x78aa('0x50')],[_0x78aa('0x68'),'id'])||{})['spread'](function(_0x3a44f1){for(var _0x30f3ed=0x0;_0x30f3ed<_0x57204c[_0x78aa('0x50')][_0x78aa('0x68')]['length'];_0x30f3ed+=0x1){socket[_0x78aa('0x6f')]('userMailQueue:save',{'UserId':Number(_0x57204c[_0x78aa('0x50')][_0x78aa('0x68')][_0x30f3ed]),'MailQueueId':Number(_0x57204c[_0x78aa('0x4b')]['id'])});}return _0x3a44f1;});}})[_0x78aa('0x2b')](respondWithResult(_0x171992,null))[_0x78aa('0x4a')](handleError(_0x171992,null));};exports[_0x78aa('0x85')]=function(_0x2fb097,_0x5bab5f,_0x2369fb){return db[_0x78aa('0x33')][_0x78aa('0x4e')]({'where':{'id':_0x2fb097[_0x78aa('0x4b')]['id']}})[_0x78aa('0x2b')](handleEntityNotFound(_0x5bab5f,null))['then'](function(_0x5300fc){if(_0x5300fc){return _0x5300fc[_0x78aa('0x85')](_0x2fb097[_0x78aa('0x39')][_0x78aa('0x68')])[_0x78aa('0x2b')](function(){if(_['isArray'](_0x2fb097[_0x78aa('0x39')][_0x78aa('0x68')])){for(var _0x488f7a=0x0;_0x488f7a<_0x2fb097['query']['ids'][_0x78aa('0x3e')];_0x488f7a+=0x1){socket[_0x78aa('0x6f')](_0x78aa('0x87'),{'UserId':Number(_0x2fb097['query']['ids'][_0x488f7a]),'MailQueueId':Number(_0x2fb097[_0x78aa('0x4b')]['id'])});}}else{socket[_0x78aa('0x6f')]('userMailQueue:remove',{'UserId':Number(_0x2fb097[_0x78aa('0x39')][_0x78aa('0x68')]),'MailQueueId':Number(_0x2fb097[_0x78aa('0x4b')]['id'])});}});}})[_0x78aa('0x2b')](respondWithStatusCode(_0x5bab5f,null))['catch'](handleError(_0x5bab5f,null));};exports[_0x78aa('0x8a')]=function(_0x18985a,_0x12ac00,_0x42fa05){var _0x484816={};var _0x55f8b7={};var _0x4578f7;var _0x42d28b;return db[_0x78aa('0x33')]['findOne']({'where':{'id':_0x18985a[_0x78aa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x12ac00,null))[_0x78aa('0x2b')](function(_0x47c637){if(_0x47c637){_0x4578f7=_0x47c637;_0x55f8b7[_0x78aa('0x3c')]=_[_0x78aa('0x38')](db['User']['rawAttributes']);_0x55f8b7['query']=_[_0x78aa('0x38')](_0x18985a[_0x78aa('0x39')]);_0x55f8b7[_0x78aa('0x3a')]=_[_0x78aa('0x3b')](_0x55f8b7[_0x78aa('0x3c')],_0x55f8b7[_0x78aa('0x39')]);_0x484816[_0x78aa('0x3d')]=_[_0x78aa('0x3b')](_0x55f8b7[_0x78aa('0x3c')],qs[_0x78aa('0x4c')](_0x18985a[_0x78aa('0x39')][_0x78aa('0x4c')]));_0x484816['attributes']=_0x484816[_0x78aa('0x3d')][_0x78aa('0x3e')]?_0x484816['attributes']:_0x55f8b7['model'];_0x484816[_0x78aa('0x41')]=qs[_0x78aa('0x42')](_0x18985a[_0x78aa('0x39')][_0x78aa('0x42')]);_0x484816[_0x78aa('0x43')]=qs[_0x78aa('0x3a')](_['pick'](_0x18985a[_0x78aa('0x39')],_0x55f8b7[_0x78aa('0x3a')]));if(_0x18985a[_0x78aa('0x39')][_0x78aa('0x45')]){_0x484816['where']=_['merge'](_0x484816[_0x78aa('0x43')],{'$or':_[_0x78aa('0x32')](_0x484816[_0x78aa('0x3d')],function(_0x35a388){var _0x321329={};_0x321329[_0x35a388]={'$like':'%'+_0x18985a[_0x78aa('0x39')][_0x78aa('0x45')]+'%'};return _0x321329;})});}_0x484816=_['merge']({},_0x484816,_0x18985a['options']);return _0x4578f7[_0x78aa('0x8a')](_0x484816);}})['then'](function(_0xa0c86a){if(_0xa0c86a){_0x42d28b=_0xa0c86a[_0x78aa('0x3e')];if(!_0x18985a[_0x78aa('0x39')][_0x78aa('0x3f')](_0x78aa('0x40'))){_0x484816['limit']=qs[_0x78aa('0x25')](_0x18985a[_0x78aa('0x39')][_0x78aa('0x25')]);_0x484816['offset']=qs[_0x78aa('0x23')](_0x18985a[_0x78aa('0x39')][_0x78aa('0x23')]);}return _0x4578f7[_0x78aa('0x8a')](_0x484816);}})[_0x78aa('0x2b')](function(_0x4022a5){if(_0x4022a5){return _0x4022a5?{'count':_0x42d28b,'rows':_0x4022a5}:null;}})[_0x78aa('0x2b')](respondWithResult(_0x12ac00,null))[_0x78aa('0x4a')](handleError(_0x12ac00,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 2591f19..74f6a84 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 _0x687e=['remove','emit','hasOwnProperty','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687e,0x1ce));var _0xe687=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x687e[_0x8c43de];return _0xa6591b;};'use strict';var EventEmitter=require(_0xe687('0x0'));var MailQueue=require(_0xe687('0x1'))['db'][_0xe687('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe687('0x3')](0x0);var events={'afterCreate':_0xe687('0x4'),'afterUpdate':_0xe687('0x5'),'afterDestroy':_0xe687('0x6')};function emitEvent(_0x4fbcb7){return function(_0x2b2385,_0x340397,_0x3e05be){MailQueueEvents[_0xe687('0x7')](_0x4fbcb7+':'+_0x2b2385['id'],_0x2b2385);MailQueueEvents[_0xe687('0x7')](_0x4fbcb7,_0x2b2385);_0x3e05be(null);};}for(var e in events){if(events[_0xe687('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x67fd=['emit','hasOwnProperty','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x67fd,0x192));var _0xd67f=function(_0x43cf73,_0x272d88){_0x43cf73=_0x43cf73-0x0;var _0x76420a=_0x67fd[_0x43cf73];return _0x76420a;};'use strict';var EventEmitter=require(_0xd67f('0x0'));var MailQueue=require(_0xd67f('0x1'))['db'][_0xd67f('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd67f('0x3')](0x0);var events={'afterCreate':_0xd67f('0x4'),'afterUpdate':_0xd67f('0x5'),'afterDestroy':'remove'};function emitEvent(_0xf086a1){return function(_0x3f5f94,_0x36620d,_0x12058c){MailQueueEvents[_0xd67f('0x6')](_0xf086a1+':'+_0x3f5f94['id'],_0x3f5f94);MailQueueEvents[_0xd67f('0x6')](_0xf086a1,_0x3f5f94);_0x12058c(null);};}for(var e in events){if(events[_0xd67f('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 69f3884..fcce8c2 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 _0xef61=['exports','define','MailQueue','mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3975e6,_0x52af10){var _0x1e8cf4=function(_0x5ae42d){while(--_0x5ae42d){_0x3975e6['push'](_0x3975e6['shift']());}};_0x1e8cf4(++_0x52af10);}(_0xef61,0xa0));var _0x1ef6=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0xef61[_0x39caaa];return _0x9b9c7d;};'use strict';var _=require('lodash');var util=require(_0x1ef6('0x0'));var logger=require(_0x1ef6('0x1'))(_0x1ef6('0x2'));var moment=require(_0x1ef6('0x3'));var BPromise=require(_0x1ef6('0x4'));var rp=require(_0x1ef6('0x5'));var fs=require('fs');var path=require(_0x1ef6('0x6'));var rimraf=require(_0x1ef6('0x7'));var config=require(_0x1ef6('0x8'));var attributes=require('./mailQueue.attributes');module[_0x1ef6('0x9')]=function(_0x4ec7fc,_0x3a049b){return _0x4ec7fc[_0x1ef6('0xa')](_0x1ef6('0xb'),attributes,{'tableName':_0x1ef6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb454=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailQueue','mail_queues'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0xb454,0xea));var _0x4b45=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0xb454[_0x671369];return _0x33f2b4;};'use strict';var _=require(_0x4b45('0x0'));var util=require(_0x4b45('0x1'));var logger=require(_0x4b45('0x2'))(_0x4b45('0x3'));var moment=require(_0x4b45('0x4'));var BPromise=require(_0x4b45('0x5'));var rp=require(_0x4b45('0x6'));var fs=require('fs');var path=require(_0x4b45('0x7'));var rimraf=require(_0x4b45('0x8'));var config=require(_0x4b45('0x9'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x1851fb,_0x5f1592){return _0x1851fb[_0x4b45('0xa')](_0x4b45('0xb'),attributes,{'tableName':_0x4b45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index bf8b509..ee55d66 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 _0xd0dc=['stringify','error','code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','where','limit','include','model','attributes','debug','find','map','ShowMailQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3d460b,_0x20929f){var _0x209c32=function(_0x5564e8){while(--_0x5564e8){_0x3d460b['push'](_0x3d460b['shift']());}};_0x209c32(++_0x20929f);}(_0xd0dc,0x1c1));var _0xcd0d=function(_0x8806a6,_0x686e06){_0x8806a6=_0x8806a6-0x0;var _0x49cdd3=_0xd0dc[_0x8806a6];return _0x49cdd3;};'use strict';var _=require(_0xcd0d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcd0d('0x1'));var rs=require(_0xcd0d('0x2'));var fs=require('fs');var Redis=require(_0xcd0d('0x3'));var db=require(_0xcd0d('0x4'))['db'];var utils=require(_0xcd0d('0x5'));var logger=require(_0xcd0d('0x6'))(_0xcd0d('0x7'));var config=require(_0xcd0d('0x8'));var jayson=require(_0xcd0d('0x9'));var client=jayson[_0xcd0d('0xa')]['http']({'port':0x232a});config[_0xcd0d('0xb')]=_[_0xcd0d('0xc')](config[_0xcd0d('0xb')],{'host':_0xcd0d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcd0d('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a7888,_0x2b8129,_0x13d45c){return new BPromise(function(_0xcf1170,_0x2eda5c){return client[_0xcd0d('0xf')](_0x4a7888,_0x13d45c)[_0xcd0d('0x10')](function(_0xbcfbda){logger['info'](_0xcd0d('0x11'),_0x2b8129,_0xcd0d('0x12'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x2b8129,_0xcd0d('0x12'),JSON[_0xcd0d('0x13')](_0xbcfbda));if(_0xbcfbda[_0xcd0d('0x14')]){if(_0xbcfbda[_0xcd0d('0x14')][_0xcd0d('0x15')]===0x1f4){logger[_0xcd0d('0x14')](_0xcd0d('0x11'),_0x2b8129,_0xbcfbda[_0xcd0d('0x14')][_0xcd0d('0x16')]);return _0x2eda5c(_0xbcfbda[_0xcd0d('0x14')][_0xcd0d('0x16')]);}logger[_0xcd0d('0x14')](_0xcd0d('0x11'),_0x2b8129,_0xbcfbda[_0xcd0d('0x14')][_0xcd0d('0x16')]);return _0xcf1170(_0xbcfbda[_0xcd0d('0x14')][_0xcd0d('0x16')]);}else{logger[_0xcd0d('0x17')](_0xcd0d('0x11'),_0x2b8129,_0xcd0d('0x12'));_0xcf1170(_0xbcfbda[_0xcd0d('0x18')][_0xcd0d('0x16')]);}})[_0xcd0d('0x19')](function(_0x3890e7){logger[_0xcd0d('0x14')](_0xcd0d('0x11'),_0x2b8129,_0x3890e7);_0x2eda5c(_0x3890e7);});});}exports[_0xcd0d('0x1a')]=function(_0x54c8d7){var _0x3b7436=this;return new Promise(function(_0x5cdaa8,_0x2748dd){return db[_0xcd0d('0x1b')][_0xcd0d('0x1c')]({'raw':_0x54c8d7[_0xcd0d('0x1d')]?_0x54c8d7[_0xcd0d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x54c8d7[_0xcd0d('0x1d')]?_0x54c8d7[_0xcd0d('0x1d')][_0xcd0d('0x1e')]||null:null,'attributes':_0x54c8d7[_0xcd0d('0x1d')]?_0x54c8d7[_0xcd0d('0x1d')]['attributes']||null:null,'limit':_0x54c8d7['options']?_0x54c8d7['options'][_0xcd0d('0x1f')]||null:null,'include':_0x54c8d7[_0xcd0d('0x1d')]?_0x54c8d7['options'][_0xcd0d('0x20')]?_['map'](_0x54c8d7[_0xcd0d('0x1d')][_0xcd0d('0x20')],function(_0x2437d9){return{'model':db[_0x2437d9[_0xcd0d('0x21')]],'as':_0x2437d9['as'],'attributes':_0x2437d9[_0xcd0d('0x22')],'include':_0x2437d9[_0xcd0d('0x20')]?_['map'](_0x2437d9[_0xcd0d('0x20')],function(_0x15f49d){return{'model':db[_0x15f49d[_0xcd0d('0x21')]],'as':_0x15f49d['as'],'attributes':_0x15f49d['attributes'],'include':_0x15f49d[_0xcd0d('0x20')]?_['map'](_0x15f49d[_0xcd0d('0x20')],function(_0x2a7b25){return{'model':db[_0x2a7b25['model']],'as':_0x2a7b25['as'],'attributes':_0x2a7b25['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd0d('0x10')](function(_0x553af3){logger['info']('GetMailQueue',_0x54c8d7);logger[_0xcd0d('0x23')]('GetMailQueue',_0x54c8d7,JSON[_0xcd0d('0x13')](_0x553af3));_0x5cdaa8(_0x553af3);})['catch'](function(_0x2d7933){logger['error'](_0xcd0d('0x1a'),_0x2d7933[_0xcd0d('0x16')],_0x54c8d7);_0x2748dd(_0x3b7436['error'](0x1f4,_0x2d7933[_0xcd0d('0x16')]));});});};exports['ShowMailQueue']=function(_0x599680){var _0x272957=this;return new Promise(function(_0x1ea05b,_0x66dd4e){return db[_0xcd0d('0x1b')][_0xcd0d('0x24')]({'raw':_0x599680[_0xcd0d('0x1d')]?_0x599680[_0xcd0d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x599680[_0xcd0d('0x1d')]?_0x599680[_0xcd0d('0x1d')][_0xcd0d('0x1e')]||null:null,'attributes':_0x599680[_0xcd0d('0x1d')]?_0x599680[_0xcd0d('0x1d')][_0xcd0d('0x22')]||null:null,'include':_0x599680[_0xcd0d('0x1d')]?_0x599680[_0xcd0d('0x1d')][_0xcd0d('0x20')]?_['map'](_0x599680[_0xcd0d('0x1d')][_0xcd0d('0x20')],function(_0x4f2769){return{'model':db[_0x4f2769[_0xcd0d('0x21')]],'as':_0x4f2769['as'],'attributes':_0x4f2769[_0xcd0d('0x22')],'include':_0x4f2769['include']?_[_0xcd0d('0x25')](_0x4f2769[_0xcd0d('0x20')],function(_0x244027){return{'model':db[_0x244027[_0xcd0d('0x21')]],'as':_0x244027['as'],'attributes':_0x244027[_0xcd0d('0x22')],'include':_0x244027[_0xcd0d('0x20')]?_[_0xcd0d('0x25')](_0x244027['include'],function(_0x4af120){return{'model':db[_0x4af120[_0xcd0d('0x21')]],'as':_0x4af120['as'],'attributes':_0x4af120['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd0d('0x10')](function(_0x23451a){logger['info']('ShowMailQueue',_0x599680);logger[_0xcd0d('0x23')](_0xcd0d('0x26'),_0x599680,JSON[_0xcd0d('0x13')](_0x23451a));_0x1ea05b(_0x23451a);})[_0xcd0d('0x19')](function(_0x30d759){logger[_0xcd0d('0x14')](_0xcd0d('0x26'),_0x30d759[_0xcd0d('0x16')],_0x599680);_0x66dd4e(_0x272957['error'](0x1f4,_0x30d759[_0xcd0d('0x16')]));});});}; \ No newline at end of file +var _0xdd45=['../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowMailQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x2eec12,_0x1a0869){var _0x36c9ea=function(_0x9cd95e){while(--_0x9cd95e){_0x2eec12['push'](_0x2eec12['shift']());}};_0x36c9ea(++_0x1a0869);}(_0xdd45,0x10a));var _0x5dd4=function(_0x700428,_0x4b8500){_0x700428=_0x700428-0x0;var _0x19bbc4=_0xdd45[_0x700428];return _0x19bbc4;};'use strict';var _=require(_0x5dd4('0x0'));var util=require('util');var moment=require(_0x5dd4('0x1'));var BPromise=require(_0x5dd4('0x2'));var rs=require(_0x5dd4('0x3'));var fs=require('fs');var Redis=require(_0x5dd4('0x4'));var db=require(_0x5dd4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5dd4('0x6'));var config=require(_0x5dd4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dd4('0x8')][_0x5dd4('0x9')]({'port':0x232a});config['redis']=_[_0x5dd4('0xa')](config[_0x5dd4('0xb')],{'host':_0x5dd4('0xc'),'port':0x18eb});var socket=require(_0x5dd4('0xd'))(new Redis(config[_0x5dd4('0xb')]));require('./mailQueue.socket')[_0x5dd4('0xe')](socket);function respondWithRpcPromise(_0x224202,_0x5cec30,_0x235f30){return new BPromise(function(_0x2f34dd,_0x38b396){return client[_0x5dd4('0xf')](_0x224202,_0x235f30)[_0x5dd4('0x10')](function(_0x27748a){logger[_0x5dd4('0x11')](_0x5dd4('0x12'),_0x5cec30,_0x5dd4('0x13'));logger[_0x5dd4('0x14')](_0x5dd4('0x15'),_0x5cec30,'request\x20sent',JSON[_0x5dd4('0x16')](_0x27748a));if(_0x27748a[_0x5dd4('0x17')]){if(_0x27748a[_0x5dd4('0x17')][_0x5dd4('0x18')]===0x1f4){logger[_0x5dd4('0x17')](_0x5dd4('0x12'),_0x5cec30,_0x27748a['error'][_0x5dd4('0x19')]);return _0x38b396(_0x27748a[_0x5dd4('0x17')][_0x5dd4('0x19')]);}logger[_0x5dd4('0x17')](_0x5dd4('0x12'),_0x5cec30,_0x27748a[_0x5dd4('0x17')][_0x5dd4('0x19')]);return _0x2f34dd(_0x27748a[_0x5dd4('0x17')]['message']);}else{logger[_0x5dd4('0x11')](_0x5dd4('0x12'),_0x5cec30,_0x5dd4('0x13'));_0x2f34dd(_0x27748a['result'][_0x5dd4('0x19')]);}})[_0x5dd4('0x1a')](function(_0x4b98c4){logger[_0x5dd4('0x17')]('MailQueue,\x20%s,\x20%s',_0x5cec30,_0x4b98c4);_0x38b396(_0x4b98c4);});});}exports[_0x5dd4('0x1b')]=function(_0x4d360b){var _0x2d6974=this;return new Promise(function(_0x5c1c7e,_0x141df6){return db[_0x5dd4('0x1c')][_0x5dd4('0x1d')]({'raw':_0x4d360b['options']?_0x4d360b[_0x5dd4('0x1e')][_0x5dd4('0x1f')]===undefined?!![]:![]:!![],'where':_0x4d360b[_0x5dd4('0x1e')]?_0x4d360b[_0x5dd4('0x1e')][_0x5dd4('0x20')]||null:null,'attributes':_0x4d360b[_0x5dd4('0x1e')]?_0x4d360b[_0x5dd4('0x1e')]['attributes']||null:null,'limit':_0x4d360b[_0x5dd4('0x1e')]?_0x4d360b[_0x5dd4('0x1e')][_0x5dd4('0x21')]||null:null,'include':_0x4d360b[_0x5dd4('0x1e')]?_0x4d360b['options'][_0x5dd4('0x22')]?_[_0x5dd4('0x23')](_0x4d360b['options'][_0x5dd4('0x22')],function(_0x48fde4){return{'model':db[_0x48fde4[_0x5dd4('0x24')]],'as':_0x48fde4['as'],'attributes':_0x48fde4[_0x5dd4('0x25')],'include':_0x48fde4[_0x5dd4('0x22')]?_['map'](_0x48fde4['include'],function(_0x48fb85){return{'model':db[_0x48fb85[_0x5dd4('0x24')]],'as':_0x48fb85['as'],'attributes':_0x48fb85[_0x5dd4('0x25')],'include':_0x48fb85[_0x5dd4('0x22')]?_[_0x5dd4('0x23')](_0x48fb85['include'],function(_0x52ed51){return{'model':db[_0x52ed51[_0x5dd4('0x24')]],'as':_0x52ed51['as'],'attributes':_0x52ed51['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40e9f3){logger[_0x5dd4('0x11')](_0x5dd4('0x1b'),_0x4d360b);logger[_0x5dd4('0x14')]('GetMailQueue',_0x4d360b,JSON[_0x5dd4('0x16')](_0x40e9f3));_0x5c1c7e(_0x40e9f3);})['catch'](function(_0x15a7d2){logger['error'](_0x5dd4('0x1b'),_0x15a7d2[_0x5dd4('0x19')],_0x4d360b);_0x141df6(_0x2d6974[_0x5dd4('0x17')](0x1f4,_0x15a7d2[_0x5dd4('0x19')]));});});};exports[_0x5dd4('0x26')]=function(_0x1ac938){var _0x36aa04=this;return new Promise(function(_0x27a739,_0x53241b){return db[_0x5dd4('0x1c')]['find']({'raw':_0x1ac938['options']?_0x1ac938[_0x5dd4('0x1e')][_0x5dd4('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ac938[_0x5dd4('0x1e')]?_0x1ac938[_0x5dd4('0x1e')][_0x5dd4('0x20')]||null:null,'attributes':_0x1ac938[_0x5dd4('0x1e')]?_0x1ac938[_0x5dd4('0x1e')][_0x5dd4('0x25')]||null:null,'include':_0x1ac938[_0x5dd4('0x1e')]?_0x1ac938[_0x5dd4('0x1e')][_0x5dd4('0x22')]?_[_0x5dd4('0x23')](_0x1ac938[_0x5dd4('0x1e')][_0x5dd4('0x22')],function(_0x49c1f7){return{'model':db[_0x49c1f7[_0x5dd4('0x24')]],'as':_0x49c1f7['as'],'attributes':_0x49c1f7[_0x5dd4('0x25')],'include':_0x49c1f7['include']?_[_0x5dd4('0x23')](_0x49c1f7[_0x5dd4('0x22')],function(_0x43e43b){return{'model':db[_0x43e43b[_0x5dd4('0x24')]],'as':_0x43e43b['as'],'attributes':_0x43e43b['attributes'],'include':_0x43e43b[_0x5dd4('0x22')]?_['map'](_0x43e43b['include'],function(_0x6c1329){return{'model':db[_0x6c1329[_0x5dd4('0x24')]],'as':_0x6c1329['as'],'attributes':_0x6c1329[_0x5dd4('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5dd4('0x10')](function(_0x69ba53){logger[_0x5dd4('0x11')](_0x5dd4('0x26'),_0x1ac938);logger[_0x5dd4('0x14')](_0x5dd4('0x26'),_0x1ac938,JSON[_0x5dd4('0x16')](_0x69ba53));_0x27a739(_0x69ba53);})[_0x5dd4('0x1a')](function(_0x367d5f){logger['error'](_0x5dd4('0x26'),_0x367d5f[_0x5dd4('0x19')],_0x1ac938);_0x53241b(_0x36aa04[_0x5dd4('0x17')](0x1f4,_0x367d5f[_0x5dd4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index adf9af1..34b5a8f 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 _0x43a5=['emit','removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x1ae5f4,_0x5d064d){var _0x58d508=function(_0x19f13e){while(--_0x19f13e){_0x1ae5f4['push'](_0x1ae5f4['shift']());}};_0x58d508(++_0x5d064d);}(_0x43a5,0xb0));var _0x543a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x43a5[_0x321bb2];return _0x9c12ed;};'use strict';var MailQueueEvents=require(_0x543a('0x0'));var events=[_0x543a('0x1'),_0x543a('0x2'),_0x543a('0x3')];function createListener(_0x3ad55b,_0x1ce097){return function(_0x3fa822){_0x1ce097[_0x543a('0x4')](_0x3ad55b,_0x3fa822);};}function removeListener(_0x1bf340,_0x22d48e){return function(){MailQueueEvents[_0x543a('0x5')](_0x1bf340,_0x22d48e);};}exports[_0x543a('0x6')]=function(_0x58d6cf){for(var _0x437c97=0x0,_0x40b408=events[_0x543a('0x7')];_0x437c97<_0x40b408;_0x437c97++){var _0x36d616=events[_0x437c97];var _0x38514e=createListener(_0x543a('0x8')+_0x36d616,_0x58d6cf);MailQueueEvents['on'](_0x36d616,_0x38514e);}}; \ No newline at end of file +var _0xf7a3=['emit','register','length','mailQueue:','remove','update'];(function(_0x27d46e,_0x5e621a){var _0x41cb68=function(_0x1f30e2){while(--_0x1f30e2){_0x27d46e['push'](_0x27d46e['shift']());}};_0x41cb68(++_0x5e621a);}(_0xf7a3,0xac));var _0x3f7a=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0xf7a3[_0x21f931];return _0x3f083c;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0x3f7a('0x0'),_0x3f7a('0x1')];function createListener(_0x5cec67,_0x99b502){return function(_0x5148b3){_0x99b502[_0x3f7a('0x2')](_0x5cec67,_0x5148b3);};}function removeListener(_0x449f54,_0xf61a3){return function(){MailQueueEvents['removeListener'](_0x449f54,_0xf61a3);};}exports[_0x3f7a('0x3')]=function(_0x72a19d){for(var _0x58d8e7=0x0,_0x1bb3e1=events[_0x3f7a('0x4')];_0x58d8e7<_0x1bb3e1;_0x58d8e7++){var _0x6148f0=events[_0x58d8e7];var _0x4e3edb=createListener(_0x3f7a('0x5')+_0x6148f0,_0x72a19d);MailQueueEvents['on'](_0x6148f0,_0x4e3edb);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 9954238..359c480 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 _0xd6bc=['exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','create','put','update','delete','destroy'];(function(_0x5b635b,_0x153946){var _0x59af10=function(_0x4aaf23){while(--_0x4aaf23){_0x5b635b['push'](_0x5b635b['shift']());}};_0x59af10(++_0x153946);}(_0xd6bc,0x144));var _0xcd6b=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xd6bc[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0xcd6b('0x0'));var util=require(_0xcd6b('0x1'));var path=require(_0xcd6b('0x2'));var timeout=require(_0xcd6b('0x3'));var express=require(_0xcd6b('0x4'));var router=express[_0xcd6b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcd6b('0x6'));var controller=require(_0xcd6b('0x7'));router[_0xcd6b('0x8')]('/',auth[_0xcd6b('0x9')](),controller['index']);router[_0xcd6b('0x8')](_0xcd6b('0xa'),auth[_0xcd6b('0x9')](),controller[_0xcd6b('0xb')]);router[_0xcd6b('0x8')](_0xcd6b('0xc'),auth[_0xcd6b('0x9')](),controller['show']);router['post']('/',auth[_0xcd6b('0x9')](),controller[_0xcd6b('0xd')]);router[_0xcd6b('0xe')](_0xcd6b('0xc'),auth[_0xcd6b('0x9')](),controller[_0xcd6b('0xf')]);router[_0xcd6b('0x10')](_0xcd6b('0xc'),auth[_0xcd6b('0x9')](),controller[_0xcd6b('0x11')]);module[_0xcd6b('0x12')]=router; \ No newline at end of file +var _0xe39a=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x495c18,_0xae1131){var _0x27b50d=function(_0x44fbaf){while(--_0x44fbaf){_0x495c18['push'](_0x495c18['shift']());}};_0x27b50d(++_0xae1131);}(_0xe39a,0xbc));var _0xae39=function(_0x58e693,_0x570f3d){_0x58e693=_0x58e693-0x0;var _0x3379d7=_0xe39a[_0x58e693];return _0x3379d7;};'use strict';var multer=require(_0xae39('0x0'));var util=require(_0xae39('0x1'));var path=require(_0xae39('0x2'));var timeout=require('connect-timeout');var express=require(_0xae39('0x3'));var router=express[_0xae39('0x4')]();var fs_extra=require(_0xae39('0x5'));var auth=require(_0xae39('0x6'));var interaction=require(_0xae39('0x7'));var config=require(_0xae39('0x8'));var controller=require(_0xae39('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xae39('0xa')](_0xae39('0xb'),auth[_0xae39('0xc')](),controller['describe']);router[_0xae39('0xa')](_0xae39('0xd'),auth[_0xae39('0xc')](),controller[_0xae39('0xe')]);router[_0xae39('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xae39('0x10')](_0xae39('0xd'),auth[_0xae39('0xc')](),controller[_0xae39('0x11')]);router[_0xae39('0x12')](_0xae39('0xd'),auth[_0xae39('0xc')](),controller[_0xae39('0x13')]);module[_0xae39('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 673fb30..495f0cb 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 _0x975f=['DATE','moment','exports','STRING'];(function(_0x32fdb8,_0x5057c7){var _0x37c150=function(_0x2495b7){while(--_0x2495b7){_0x32fdb8['push'](_0x32fdb8['shift']());}};_0x37c150(++_0x5057c7);}(_0x975f,0x191));var _0xf975=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x975f[_0x3b90ab];return _0x206e92;};'use strict';var moment=require(_0xf975('0x0'));var Sequelize=require('sequelize');module[_0xf975('0x1')]={'uniqueid':{'type':Sequelize[_0xf975('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf975('0x2')]},'joinAt':{'type':Sequelize[_0xf975('0x3')]},'leaveAt':{'type':Sequelize[_0xf975('0x3')]},'acceptAt':{'type':Sequelize[_0xf975('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf975('0x2')]}}; \ No newline at end of file +var _0x67c9=['STRING','DATE','exports'];(function(_0x21234c,_0x6137bd){var _0x305c1f=function(_0x122ecb){while(--_0x122ecb){_0x21234c['push'](_0x21234c['shift']());}};_0x305c1f(++_0x6137bd);}(_0x67c9,0x146));var _0x967c=function(_0x260e4b,_0x54668d){_0x260e4b=_0x260e4b-0x0;var _0x18dfba=_0x67c9[_0x260e4b];return _0x18dfba;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x967c('0x0')]={'uniqueid':{'type':Sequelize[_0x967c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x967c('0x1')]},'joinAt':{'type':Sequelize[_0x967c('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x967c('0x2')]},'exitAt':{'type':Sequelize[_0x967c('0x2')]},'reason':{'type':Sequelize[_0x967c('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index be96c7e..0ec6b4c 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 _0x7bd0=['model','name','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','MailQueueReport','findAll','rows','show','keys','length','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','sendStatus','error','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x52cebd,_0xa9d123){var _0x1ff656=function(_0x4e0b0e){while(--_0x4e0b0e){_0x52cebd['push'](_0x52cebd['shift']());}};_0x1ff656(++_0xa9d123);}(_0x7bd0,0x111));var _0x07bd=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x7bd0[_0x53afa6];return _0x51f86a;};'use strict';var emlformat=require(_0x07bd('0x0'));var rimraf=require(_0x07bd('0x1'));var zipdir=require(_0x07bd('0x2'));var jsonpatch=require(_0x07bd('0x3'));var rp=require(_0x07bd('0x4'));var moment=require(_0x07bd('0x5'));var BPromise=require(_0x07bd('0x6'));var Mustache=require(_0x07bd('0x7'));var util=require('util');var path=require(_0x07bd('0x8'));var sox=require(_0x07bd('0x9'));var csv=require(_0x07bd('0xa'));var ejs=require(_0x07bd('0xb'));var fs=require('fs');var fs_extra=require(_0x07bd('0xc'));var _=require(_0x07bd('0xd'));var squel=require(_0x07bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x07bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07bd('0xa'));var querystring=require(_0x07bd('0x10'));var Papa=require(_0x07bd('0x11'));var Redis=require('ioredis');var authService=require(_0x07bd('0x12'));var qs=require(_0x07bd('0x13'));var as=require(_0x07bd('0x14'));var hardwareService=require(_0x07bd('0x15'));var logger=require('../../config/logger')(_0x07bd('0x16'));var utils=require(_0x07bd('0x17'));var config=require(_0x07bd('0x18'));var licenseUtil=require(_0x07bd('0x19'));var db=require(_0x07bd('0x1a'))['db'];function respondWithStatusCode(_0x1eff6c,_0x10aa2e){_0x10aa2e=_0x10aa2e||0xcc;return function(_0x2b8409){if(_0x2b8409){return _0x1eff6c['sendStatus'](_0x10aa2e);}return _0x1eff6c['status'](_0x10aa2e)[_0x07bd('0x1b')]();};}function respondWithResult(_0x3fe523,_0x1c59c2){_0x1c59c2=_0x1c59c2||0xc8;return function(_0x247f3f){if(_0x247f3f){return _0x3fe523[_0x07bd('0x1c')](_0x1c59c2)[_0x07bd('0x1d')](_0x247f3f);}};}function respondWithFilteredResult(_0x2c9166,_0x49d962){return function(_0x418444){if(_0x418444){var _0x505839=typeof _0x49d962[_0x07bd('0x1e')]===_0x07bd('0x1f')&&typeof _0x49d962[_0x07bd('0x20')]===_0x07bd('0x1f');var _0x8aa645=_0x418444['count'];var _0x3f9f0b=_0x505839?0x0:_0x49d962[_0x07bd('0x1e')];var _0x4948f4=_0x505839?_0x418444[_0x07bd('0x21')]:_0x49d962[_0x07bd('0x1e')]+_0x49d962[_0x07bd('0x20')];var _0x2fcc59;if(_0x4948f4>=_0x8aa645){_0x4948f4=_0x8aa645;_0x2fcc59=0xc8;}else{_0x2fcc59=0xce;}_0x2c9166[_0x07bd('0x1c')](_0x2fcc59);return _0x2c9166[_0x07bd('0x22')](_0x07bd('0x23'),_0x3f9f0b+'-'+_0x4948f4+'/'+_0x8aa645)[_0x07bd('0x1d')](_0x418444);}return null;};}function patchUpdates(_0x29a52e){return function(_0x50109f){try{jsonpatch[_0x07bd('0x24')](_0x50109f,_0x29a52e,!![]);}catch(_0x227807){return BPromise[_0x07bd('0x25')](_0x227807);}return _0x50109f[_0x07bd('0x26')]();};}function saveUpdates(_0x16d0e6,_0x47bd50){return function(_0x4c673a){if(_0x4c673a){return _0x4c673a[_0x07bd('0x27')](_0x16d0e6)['then'](function(_0x2b0dee){return _0x2b0dee;});}return null;};}function removeEntity(_0x480c9c,_0x50bd12){return function(_0x4165bc){if(_0x4165bc){return _0x4165bc[_0x07bd('0x28')]()[_0x07bd('0x29')](function(){_0x480c9c[_0x07bd('0x1c')](0xcc)[_0x07bd('0x1b')]();});}};}function handleEntityNotFound(_0x43cbc8,_0x557042){return function(_0x180b43){if(!_0x180b43){_0x43cbc8[_0x07bd('0x2a')](0x194);}return _0x180b43;};}function handleError(_0x3db9d0,_0x2a7202){_0x2a7202=_0x2a7202||0x1f4;return function(_0x12ce26){logger[_0x07bd('0x2b')](_0x12ce26['stack']);if(_0x12ce26['name']){delete _0x12ce26['name'];}_0x3db9d0[_0x07bd('0x1c')](_0x2a7202)[_0x07bd('0x2c')](_0x12ce26);};}exports[_0x07bd('0x2d')]=function(_0x51efa8,_0x1a3aa9){var _0x400cc0={},_0x253dc0={},_0x46ed12={'count':0x0,'rows':[]};var _0x3f9424=_[_0x07bd('0x2e')](db['MailQueueReport'][_0x07bd('0x2f')],function(_0x20cc94){return{'name':_0x20cc94[_0x07bd('0x30')],'type':_0x20cc94[_0x07bd('0x31')][_0x07bd('0x32')]};});_0x253dc0[_0x07bd('0x33')]=_[_0x07bd('0x2e')](_0x3f9424,_0x07bd('0x34'));_0x253dc0['query']=_['keys'](_0x51efa8[_0x07bd('0x35')]);_0x253dc0[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x253dc0['model'],_0x253dc0[_0x07bd('0x35')]);_0x400cc0[_0x07bd('0x38')]=_[_0x07bd('0x37')](_0x253dc0['model'],qs['fields'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x39')]));_0x400cc0[_0x07bd('0x38')]=_0x400cc0[_0x07bd('0x38')]['length']?_0x400cc0[_0x07bd('0x38')]:_0x253dc0[_0x07bd('0x33')];if(!_0x51efa8[_0x07bd('0x35')]['hasOwnProperty'](_0x07bd('0x3a'))){_0x400cc0[_0x07bd('0x20')]=qs['limit'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x20')]);_0x400cc0[_0x07bd('0x1e')]=qs[_0x07bd('0x1e')](_0x51efa8['query']['offset']);}_0x400cc0[_0x07bd('0x3b')]=qs['sort'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3c')]);_0x400cc0[_0x07bd('0x3d')]=qs[_0x07bd('0x36')](_[_0x07bd('0x3e')](_0x51efa8[_0x07bd('0x35')],_0x253dc0[_0x07bd('0x36')]),_0x3f9424);if(_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3f')]){_0x400cc0[_0x07bd('0x3d')]=_[_0x07bd('0x40')](_0x400cc0[_0x07bd('0x3d')],{'$or':_[_0x07bd('0x2e')](_0x3f9424,function(_0x51e8e2){if(_0x51e8e2[_0x07bd('0x31')]!==_0x07bd('0x41')){var _0x220a8e={};_0x220a8e[_0x51e8e2[_0x07bd('0x34')]]={'$like':'%'+_0x51efa8['query'][_0x07bd('0x3f')]+'%'};return _0x220a8e;}})});}_0x400cc0=_[_0x07bd('0x40')]({},_0x400cc0,_0x51efa8[_0x07bd('0x42')]);var _0x408a0a={'where':_0x400cc0[_0x07bd('0x3d')]};return db['MailQueueReport']['count'](_0x408a0a)[_0x07bd('0x29')](function(_0x88e174){_0x46ed12[_0x07bd('0x21')]=_0x88e174;if(_0x51efa8[_0x07bd('0x35')]['includeAll']){_0x400cc0[_0x07bd('0x43')]=[{'all':!![]}];}return db[_0x07bd('0x44')][_0x07bd('0x45')](_0x400cc0);})[_0x07bd('0x29')](function(_0x318b7c){_0x46ed12[_0x07bd('0x46')]=_0x318b7c;return _0x46ed12;})[_0x07bd('0x29')](respondWithFilteredResult(_0x1a3aa9,_0x400cc0))['catch'](handleError(_0x1a3aa9,null));};exports[_0x07bd('0x47')]=function(_0x7b1042,_0x33389b){var _0x3a5827={'raw':!![],'where':{'id':_0x7b1042['params']['id']}},_0x418f26={};_0x418f26[_0x07bd('0x33')]=_[_0x07bd('0x48')](db[_0x07bd('0x44')][_0x07bd('0x2f')]);_0x418f26[_0x07bd('0x35')]=_['keys'](_0x7b1042[_0x07bd('0x35')]);_0x418f26[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],_0x418f26['query']);_0x3a5827['attributes']=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],qs[_0x07bd('0x39')](_0x7b1042[_0x07bd('0x35')][_0x07bd('0x39')]));_0x3a5827[_0x07bd('0x38')]=_0x3a5827[_0x07bd('0x38')][_0x07bd('0x49')]?_0x3a5827[_0x07bd('0x38')]:_0x418f26['model'];if(_0x7b1042['query'][_0x07bd('0x4a')]){_0x3a5827[_0x07bd('0x43')]=[{'all':!![]}];}_0x3a5827=_[_0x07bd('0x40')]({},_0x3a5827,_0x7b1042[_0x07bd('0x42')]);return db[_0x07bd('0x44')][_0x07bd('0x4b')](_0x3a5827)['then'](handleEntityNotFound(_0x33389b,null))[_0x07bd('0x29')](respondWithResult(_0x33389b,null))[_0x07bd('0x4c')](handleError(_0x33389b,null));};exports[_0x07bd('0x4d')]=function(_0x39823e,_0x7755e2){return db[_0x07bd('0x44')]['create'](_0x39823e[_0x07bd('0x4e')],{})[_0x07bd('0x29')](respondWithResult(_0x7755e2,0xc9))[_0x07bd('0x4c')](handleError(_0x7755e2,null));};exports[_0x07bd('0x27')]=function(_0x1d05ad,_0xc96a7d){if(_0x1d05ad[_0x07bd('0x4e')]['id']){delete _0x1d05ad[_0x07bd('0x4e')]['id'];}return db[_0x07bd('0x44')][_0x07bd('0x4b')]({'where':{'id':_0x1d05ad[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0xc96a7d,null))['then'](saveUpdates(_0x1d05ad[_0x07bd('0x4e')],null))[_0x07bd('0x29')](respondWithResult(_0xc96a7d,null))[_0x07bd('0x4c')](handleError(_0xc96a7d,null));};exports['destroy']=function(_0x51c9f4,_0x1e7a6e){return db['MailQueueReport'][_0x07bd('0x4b')]({'where':{'id':_0x51c9f4[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0x1e7a6e,null))[_0x07bd('0x29')](removeEntity(_0x1e7a6e,null))[_0x07bd('0x4c')](handleError(_0x1e7a6e,null));};exports[_0x07bd('0x50')]=function(_0x2cadbb,_0x157eb4){return db['MailQueueReport'][_0x07bd('0x50')]()[_0x07bd('0x29')](respondWithResult(_0x157eb4,null))[_0x07bd('0x4c')](handleError(_0x157eb4,null));}; \ No newline at end of file +var _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5f2098,_0x47308b){var _0x18af32=function(_0xa53c8e){while(--_0xa53c8e){_0x5f2098['push'](_0x5f2098['shift']());}};_0x18af32(++_0x47308b);}(_0x430c,0x1a1));var _0xc430=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0x430c[_0x3de4f8];return _0x3d81fc;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c5ac800..99e0bb6 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 _0xf5ec=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf5ec,0x165));var _0xcf5e=function(_0x56f856,_0x2a3cc4){_0x56f856=_0x56f856-0x0;var _0x254e71=_0xf5ec[_0x56f856];return _0x254e71;};'use strict';var _=require(_0xcf5e('0x0'));var util=require(_0xcf5e('0x1'));var logger=require(_0xcf5e('0x2'))('api');var moment=require(_0xcf5e('0x3'));var BPromise=require(_0xcf5e('0x4'));var rp=require(_0xcf5e('0x5'));var fs=require('fs');var path=require(_0xcf5e('0x6'));var rimraf=require(_0xcf5e('0x7'));var config=require(_0xcf5e('0x8'));var attributes=require(_0xcf5e('0x9'));module[_0xcf5e('0xa')]=function(_0x433871,_0x3b700d){return _0x433871['define'](_0xcf5e('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xcf5e('0xc'),'fields':[_0xcf5e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe0b=['define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x580534,_0x572545){var _0x225d77=function(_0x206c2a){while(--_0x206c2a){_0x580534['push'](_0x580534['shift']());}};_0x225d77(++_0x572545);}(_0xfe0b,0x122));var _0xbfe0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfe0b[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xbfe0('0x0'));var util=require(_0xbfe0('0x1'));var logger=require(_0xbfe0('0x2'))(_0xbfe0('0x3'));var moment=require(_0xbfe0('0x4'));var BPromise=require(_0xbfe0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfe0('0x6'));var rimraf=require('rimraf');var config=require(_0xbfe0('0x7'));var attributes=require(_0xbfe0('0x8'));module[_0xbfe0('0x9')]=function(_0x382f01,_0x548e4b){return _0x382f01[_0xbfe0('0xa')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xbfe0('0xb'),'fields':[_0xbfe0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b6abfb1..d5c9b4e 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 _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(_0x303fe3,_0x3dbdb1){var _0x27899c=function(_0x3c6e45){while(--_0x3c6e45){_0x303fe3['push'](_0x303fe3['shift']());}};_0x27899c(++_0x3dbdb1);}(_0x1261,0x144));var _0x1126=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0x1261[_0x287059];return _0x225c79;};'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 +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(_0x3d1820,_0x26959f){var _0xfcdf8b=function(_0x2ae825){while(--_0x2ae825){_0x3d1820['push'](_0x3d1820['shift']());}};_0xfcdf8b(++_0x26959f);}(_0x1261,0x144));var _0x1126=function(_0x288d33,_0x58ee36){_0x288d33=_0x288d33-0x0;var _0x1033bd=_0x1261[_0x288d33];return _0x1033bd;};'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 0b3f8e1..617d140 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x52da21,_0x242123){var _0x12cb79=function(_0xb7f988){while(--_0xb7f988){_0x52da21['push'](_0x52da21['shift']());}};_0x12cb79(++_0x242123);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x15b835,_0x44669f){var _0x1d0e92=function(_0x1f505a){while(--_0x1f505a){_0x15b835['push'](_0x15b835['shift']());}};_0x1d0e92(++_0x44669f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 095dfe2..dfaf37f 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 _0x36b9=['INTEGER','sequelize','exports','STRING','BOOLEAN','INBOX'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x36b9,0x9d));var _0x936b=function(_0x25671c,_0xfac689){_0x25671c=_0x25671c-0x0;var _0x465472=_0x36b9[_0x25671c];return _0x465472;};'use strict';var Sequelize=require(_0x936b('0x0'));module[_0x936b('0x1')]={'description':{'type':Sequelize[_0x936b('0x2')]},'host':{'type':Sequelize[_0x936b('0x2')]},'authentication':{'type':Sequelize[_0x936b('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x936b('0x2')]},'password':{'type':Sequelize[_0x936b('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x936b('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x936b('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x936b('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x936b('0x2')]},'modernAuthentication':{'type':Sequelize[_0x936b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x670c=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x4e0488,_0x24a706){var _0x12c0cd=function(_0x1a1d36){while(--_0x1a1d36){_0x4e0488['push'](_0x4e0488['shift']());}};_0x12c0cd(++_0x24a706);}(_0x670c,0x1bb));var _0xc670=function(_0x55418f,_0x136522){_0x55418f=_0x55418f-0x0;var _0x5d3323=_0x670c[_0x55418f];return _0x5d3323;};'use strict';var Sequelize=require(_0xc670('0x0'));module[_0xc670('0x1')]={'description':{'type':Sequelize[_0xc670('0x2')]},'host':{'type':Sequelize[_0xc670('0x2')]},'authentication':{'type':Sequelize[_0xc670('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc670('0x2')]},'port':{'type':Sequelize[_0xc670('0x4')]},'tls':{'type':Sequelize[_0xc670('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xc670('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc670('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc670('0x2')]},'modernAuthentication':{'type':Sequelize[_0xc670('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index db8146b..82069ed 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 _0x8224=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5af243,_0x495eb8){var _0x5c77a8=function(_0x5702cd){while(--_0x5702cd){_0x5af243['push'](_0x5af243['shift']());}};_0x5c77a8(++_0x495eb8);}(_0x8224,0x166));var _0x4822=function(_0x29874b,_0x4c5fc2){_0x29874b=_0x29874b-0x0;var _0x2ddfff=_0x8224[_0x29874b];return _0x2ddfff;};'use strict';var _=require('lodash');var util=require(_0x4822('0x0'));var logger=require(_0x4822('0x1'))(_0x4822('0x2'));var moment=require('moment');var BPromise=require(_0x4822('0x3'));var rp=require(_0x4822('0x4'));var fs=require('fs');var path=require(_0x4822('0x5'));var rimraf=require(_0x4822('0x6'));var config=require(_0x4822('0x7'));var attributes=require(_0x4822('0x8'));module[_0x4822('0x9')]=function(_0x134c97,_0x4a93c9){return _0x134c97[_0x4822('0xa')](_0x4822('0xb'),attributes,{'tableName':_0x4822('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90dd=['lodash','util','api','moment','bluebird','path','./mailServerIn.attributes','exports','define','mail_servers_in'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x90dd,0x78));var _0xd90d=function(_0x5f09f2,_0x41eec6){_0x5f09f2=_0x5f09f2-0x0;var _0xcab019=_0x90dd[_0x5f09f2];return _0xcab019;};'use strict';var _=require(_0xd90d('0x0'));var util=require(_0xd90d('0x1'));var logger=require('../../config/logger')(_0xd90d('0x2'));var moment=require(_0xd90d('0x3'));var BPromise=require(_0xd90d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd90d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd90d('0x6'));module[_0xd90d('0x7')]=function(_0x58665e,_0x39eb6a){return _0x58665e[_0xd90d('0x8')]('MailServerIn',attributes,{'tableName':_0xd90d('0x9'),'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 c0220be..fb59d2e 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 _0xb377=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','MailServerIn','options','raw','where','limit','include','map','attributes','model','debug','stringify','lodash','util','moment','bluebird'];(function(_0x22b2be,_0x4b164c){var _0x213c31=function(_0x475528){while(--_0x475528){_0x22b2be['push'](_0x22b2be['shift']());}};_0x213c31(++_0x4b164c);}(_0xb377,0x1b6));var _0x7b37=function(_0x4d3157,_0x59534a){_0x4d3157=_0x4d3157-0x0;var _0x2a5fd1=_0xb377[_0x4d3157];return _0x2a5fd1;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var moment=require(_0x7b37('0x2'));var BPromise=require(_0x7b37('0x3'));var rs=require(_0x7b37('0x4'));var fs=require('fs');var Redis=require(_0x7b37('0x5'));var db=require(_0x7b37('0x6'))['db'];var utils=require(_0x7b37('0x7'));var logger=require(_0x7b37('0x8'))(_0x7b37('0x9'));var config=require(_0x7b37('0xa'));var jayson=require(_0x7b37('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x4cb89b,_0x5afdb8){return new BPromise(function(_0x3de992,_0x3df40f){return client[_0x7b37('0xc')](_0x409d34,_0x5afdb8)[_0x7b37('0xd')](function(_0x1d435b){logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));logger['debug'](_0x7b37('0x11'),_0x4cb89b,_0x7b37('0x10'),JSON['stringify'](_0x1d435b));if(_0x1d435b['error']){if(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x13')]===0x1f4){logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3df40f(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3de992(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}else{logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));_0x3de992(_0x1d435b['result']['message']);}})[_0x7b37('0x15')](function(_0x5b06f9){logger['error'](_0x7b37('0xf'),_0x4cb89b,_0x5b06f9);_0x3df40f(_0x5b06f9);});});}exports[_0x7b37('0x16')]=function(_0x1447aa){var _0x487f5c=this;return new Promise(function(_0x29a9dd,_0x46955a){return db[_0x7b37('0x17')]['findAll']({'raw':_0x1447aa['options']?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x19')]===undefined?!![]:![]:!![],'where':_0x1447aa[_0x7b37('0x18')]?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x1a')]||null:null,'attributes':_0x1447aa['options']?_0x1447aa['options']['attributes']||null:null,'limit':_0x1447aa[_0x7b37('0x18')]?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x1b')]||null:null,'include':_0x1447aa[_0x7b37('0x18')]?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x1c')]?_[_0x7b37('0x1d')](_0x1447aa['options'][_0x7b37('0x1c')],function(_0x2e60d9){return{'model':db[_0x2e60d9['model']],'as':_0x2e60d9['as'],'attributes':_0x2e60d9[_0x7b37('0x1e')],'include':_0x2e60d9['include']?_[_0x7b37('0x1d')](_0x2e60d9['include'],function(_0x5cf943){return{'model':db[_0x5cf943[_0x7b37('0x1f')]],'as':_0x5cf943['as'],'attributes':_0x5cf943[_0x7b37('0x1e')],'include':_0x5cf943[_0x7b37('0x1c')]?_[_0x7b37('0x1d')](_0x5cf943[_0x7b37('0x1c')],function(_0x5ab694){return{'model':db[_0x5ab694['model']],'as':_0x5ab694['as'],'attributes':_0x5ab694[_0x7b37('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7b37('0xd')](function(_0x8df2fc){logger[_0x7b37('0xe')](_0x7b37('0x16'),_0x1447aa);logger[_0x7b37('0x20')](_0x7b37('0x16'),_0x1447aa,JSON[_0x7b37('0x21')](_0x8df2fc));_0x29a9dd(_0x8df2fc);})[_0x7b37('0x15')](function(_0x55eb54){logger[_0x7b37('0x12')](_0x7b37('0x16'),_0x55eb54[_0x7b37('0x14')],_0x1447aa);_0x46955a(_0x487f5c[_0x7b37('0x12')](0x1f4,_0x55eb54['message']));});});}; \ No newline at end of file +var _0x5d0e=['include','model','attributes','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','map'];(function(_0x529b35,_0x35387b){var _0x42bdef=function(_0x328cb0){while(--_0x328cb0){_0x529b35['push'](_0x529b35['shift']());}};_0x42bdef(++_0x35387b);}(_0x5d0e,0x78));var _0xe5d0=function(_0x435669,_0x4fe80e){_0x435669=_0x435669-0x0;var _0x4050ef=_0x5d0e[_0x435669];return _0x4050ef;};'use strict';var _=require(_0xe5d0('0x0'));var util=require(_0xe5d0('0x1'));var moment=require('moment');var BPromise=require(_0xe5d0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5d0('0x3'));var db=require(_0xe5d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5d0('0x5'))(_0xe5d0('0x6'));var config=require(_0xe5d0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe5d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eff62,_0xc8fa4e,_0x477fff){return new BPromise(function(_0x5786e6,_0x396932){return client[_0xe5d0('0x9')](_0x4eff62,_0x477fff)[_0xe5d0('0xa')](function(_0x34dd73){logger[_0xe5d0('0xb')](_0xe5d0('0xc'),_0xc8fa4e,_0xe5d0('0xd'));logger['debug'](_0xe5d0('0xe'),_0xc8fa4e,_0xe5d0('0xd'),JSON[_0xe5d0('0xf')](_0x34dd73));if(_0x34dd73[_0xe5d0('0x10')]){if(_0x34dd73[_0xe5d0('0x10')][_0xe5d0('0x11')]===0x1f4){logger[_0xe5d0('0x10')]('MailServerIn,\x20%s,\x20%s',_0xc8fa4e,_0x34dd73[_0xe5d0('0x10')][_0xe5d0('0x12')]);return _0x396932(_0x34dd73[_0xe5d0('0x10')]['message']);}logger[_0xe5d0('0x10')](_0xe5d0('0xc'),_0xc8fa4e,_0x34dd73[_0xe5d0('0x10')]['message']);return _0x5786e6(_0x34dd73[_0xe5d0('0x10')]['message']);}else{logger['info'](_0xe5d0('0xc'),_0xc8fa4e,_0xe5d0('0xd'));_0x5786e6(_0x34dd73[_0xe5d0('0x13')][_0xe5d0('0x12')]);}})[_0xe5d0('0x14')](function(_0x486249){logger[_0xe5d0('0x10')](_0xe5d0('0xc'),_0xc8fa4e,_0x486249);_0x396932(_0x486249);});});}exports[_0xe5d0('0x15')]=function(_0x41c69a){var _0x4f0448=this;return new Promise(function(_0x23bde3,_0x36c839){return db[_0xe5d0('0x16')]['findAll']({'raw':_0x41c69a[_0xe5d0('0x17')]?_0x41c69a[_0xe5d0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x41c69a[_0xe5d0('0x17')]?_0x41c69a['options']['where']||null:null,'attributes':_0x41c69a[_0xe5d0('0x17')]?_0x41c69a[_0xe5d0('0x17')]['attributes']||null:null,'limit':_0x41c69a[_0xe5d0('0x17')]?_0x41c69a[_0xe5d0('0x17')]['limit']||null:null,'include':_0x41c69a[_0xe5d0('0x17')]?_0x41c69a['options']['include']?_[_0xe5d0('0x18')](_0x41c69a[_0xe5d0('0x17')][_0xe5d0('0x19')],function(_0x21b8ba){return{'model':db[_0x21b8ba[_0xe5d0('0x1a')]],'as':_0x21b8ba['as'],'attributes':_0x21b8ba['attributes'],'include':_0x21b8ba[_0xe5d0('0x19')]?_[_0xe5d0('0x18')](_0x21b8ba[_0xe5d0('0x19')],function(_0x396e){return{'model':db[_0x396e['model']],'as':_0x396e['as'],'attributes':_0x396e[_0xe5d0('0x1b')],'include':_0x396e[_0xe5d0('0x19')]?_['map'](_0x396e['include'],function(_0x34391c){return{'model':db[_0x34391c['model']],'as':_0x34391c['as'],'attributes':_0x34391c[_0xe5d0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe5d0('0xa')](function(_0x1d0345){logger[_0xe5d0('0xb')]('GetMailServerIn',_0x41c69a);logger[_0xe5d0('0x1c')](_0xe5d0('0x15'),_0x41c69a,JSON['stringify'](_0x1d0345));_0x23bde3(_0x1d0345);})[_0xe5d0('0x14')](function(_0x533c61){logger['error'](_0xe5d0('0x15'),_0x533c61[_0xe5d0('0x12')],_0x41c69a);_0x36c839(_0x4f0448[_0xe5d0('0x10')](0x1f4,_0x533c61[_0xe5d0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index a2b9d8d..683805f 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(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x7a54,0x106));var _0x47a5=function(_0x108d4c,_0x575d8b){_0x108d4c=_0x108d4c-0x0;var _0x4dba50=_0x7a54[_0x108d4c];return _0x4dba50;};'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 _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(_0x1e73e1,_0x43cfb8){_0x1e73e1=_0x1e73e1-0x0;var _0x202f8f=_0x7a54[_0x1e73e1];return _0x202f8f;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 5426de4..b3c4fc2 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 _0xed3c=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x5a65f0,_0x303f54){var _0x5975d1=function(_0x1fd9e9){while(--_0x1fd9e9){_0x5a65f0['push'](_0x5a65f0['shift']());}};_0x5975d1(++_0x303f54);}(_0xed3c,0x1a6));var _0xced3=function(_0xd5160a,_0x572c4b){_0xd5160a=_0xd5160a-0x0;var _0x576cf9=_0xed3c[_0xd5160a];return _0x576cf9;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'description':{'type':Sequelize[_0xced3('0x2')]},'host':{'type':Sequelize[_0xced3('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xced3('0x2')]},'port':{'type':Sequelize[_0xced3('0x3')]},'secure':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x58a4=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x45283b,_0xe68902){var _0x1b23f9=function(_0x34f4d9){while(--_0x34f4d9){_0x45283b['push'](_0x45283b['shift']());}};_0x1b23f9(++_0xe68902);}(_0x58a4,0xbf));var _0x458a=function(_0x4990d5,_0xe2c486){_0x4990d5=_0x4990d5-0x0;var _0x275e25=_0x58a4[_0x4990d5];return _0x275e25;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'description':{'type':Sequelize[_0x458a('0x2')]},'host':{'type':Sequelize[_0x458a('0x2')]},'user':{'type':Sequelize[_0x458a('0x2')]},'pass':{'type':Sequelize[_0x458a('0x2')]},'port':{'type':Sequelize[_0x458a('0x3')]},'secure':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x458a('0x2')]},'authentication':{'type':Sequelize[_0x458a('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x458a('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 b28fb3d..64ee19a 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 _0xcc23=['lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','offset','count','limit','set','Content-Range','json','apply','save','then','destroy','end','error','name','send','map','MailServerOut','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra'];(function(_0x53b1a5,_0x2bd37f){var _0x3baba4=function(_0x416796){while(--_0x416796){_0x53b1a5['push'](_0x53b1a5['shift']());}};_0x3baba4(++_0x2bd37f);}(_0xcc23,0x1c3));var _0x3cc2=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0xcc23[_0x9a3e0f];return _0x3d2a9a;};'use strict';var emlformat=require(_0x3cc2('0x0'));var rimraf=require(_0x3cc2('0x1'));var zipdir=require(_0x3cc2('0x2'));var jsonpatch=require(_0x3cc2('0x3'));var rp=require(_0x3cc2('0x4'));var moment=require(_0x3cc2('0x5'));var BPromise=require(_0x3cc2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3cc2('0x7'));var sox=require(_0x3cc2('0x8'));var csv=require('to-csv');var ejs=require(_0x3cc2('0x9'));var fs=require('fs');var fs_extra=require(_0x3cc2('0xa'));var _=require(_0x3cc2('0xb'));var squel=require(_0x3cc2('0xc'));var crypto=require('crypto');var jsforce=require(_0x3cc2('0xd'));var deskjs=require(_0x3cc2('0xe'));var toCsv=require(_0x3cc2('0xf'));var querystring=require(_0x3cc2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3cc2('0x11'));var qs=require(_0x3cc2('0x12'));var as=require(_0x3cc2('0x13'));var hardwareService=require(_0x3cc2('0x14'));var logger=require(_0x3cc2('0x15'))(_0x3cc2('0x16'));var utils=require(_0x3cc2('0x17'));var config=require(_0x3cc2('0x18'));var licenseUtil=require(_0x3cc2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419e54,_0x1b78cb){_0x1b78cb=_0x1b78cb||0xcc;return function(_0x4b3d5f){if(_0x4b3d5f){return _0x419e54[_0x3cc2('0x1a')](_0x1b78cb);}return _0x419e54[_0x3cc2('0x1b')](_0x1b78cb)['end']();};}function respondWithResult(_0xb7e7fe,_0x361613){_0x361613=_0x361613||0xc8;return function(_0x3341ca){if(_0x3341ca){return _0xb7e7fe['status'](_0x361613)['json'](_0x3341ca);}};}function respondWithFilteredResult(_0x5a90f0,_0x3b1c1a){return function(_0x4f5e08){if(_0x4f5e08){var _0x30e7b3=typeof _0x3b1c1a['offset']===_0x3cc2('0x1c')&&typeof _0x3b1c1a['limit']===_0x3cc2('0x1c');var _0x30ec81=_0x4f5e08['count'];var _0x130e8a=_0x30e7b3?0x0:_0x3b1c1a[_0x3cc2('0x1d')];var _0x5c3ad1=_0x30e7b3?_0x4f5e08[_0x3cc2('0x1e')]:_0x3b1c1a['offset']+_0x3b1c1a[_0x3cc2('0x1f')];var _0x4ab245;if(_0x5c3ad1>=_0x30ec81){_0x5c3ad1=_0x30ec81;_0x4ab245=0xc8;}else{_0x4ab245=0xce;}_0x5a90f0[_0x3cc2('0x1b')](_0x4ab245);return _0x5a90f0[_0x3cc2('0x20')](_0x3cc2('0x21'),_0x130e8a+'-'+_0x5c3ad1+'/'+_0x30ec81)[_0x3cc2('0x22')](_0x4f5e08);}return null;};}function patchUpdates(_0x237972){return function(_0x3b3ecc){try{jsonpatch[_0x3cc2('0x23')](_0x3b3ecc,_0x237972,!![]);}catch(_0x38e905){return BPromise['reject'](_0x38e905);}return _0x3b3ecc[_0x3cc2('0x24')]();};}function saveUpdates(_0x3f8fbf,_0xcf62d2){return function(_0x29888b){if(_0x29888b){return _0x29888b['update'](_0x3f8fbf)[_0x3cc2('0x25')](function(_0x40b7f4){return _0x40b7f4;});}return null;};}function removeEntity(_0x27c992,_0xe226d5){return function(_0x46cf07){if(_0x46cf07){return _0x46cf07[_0x3cc2('0x26')]()[_0x3cc2('0x25')](function(){_0x27c992[_0x3cc2('0x1b')](0xcc)[_0x3cc2('0x27')]();});}};}function handleEntityNotFound(_0x20017e,_0x493652){return function(_0x237294){if(!_0x237294){_0x20017e[_0x3cc2('0x1a')](0x194);}return _0x237294;};}function handleError(_0x32c3b7,_0x1f23ec){_0x1f23ec=_0x1f23ec||0x1f4;return function(_0xa5c7a){logger[_0x3cc2('0x28')](_0xa5c7a['stack']);if(_0xa5c7a[_0x3cc2('0x29')]){delete _0xa5c7a['name'];}_0x32c3b7[_0x3cc2('0x1b')](_0x1f23ec)[_0x3cc2('0x2a')](_0xa5c7a);};}exports['index']=function(_0x127910,_0x52ca28){var _0x128e16={},_0x7a6933={},_0x35d106={'count':0x0,'rows':[]};var _0x23380a=_[_0x3cc2('0x2b')](db[_0x3cc2('0x2c')]['rawAttributes'],function(_0x733ef){return{'name':_0x733ef[_0x3cc2('0x2d')],'type':_0x733ef[_0x3cc2('0x2e')][_0x3cc2('0x2f')]};});_0x7a6933[_0x3cc2('0x30')]=_[_0x3cc2('0x2b')](_0x23380a,_0x3cc2('0x29'));_0x7a6933[_0x3cc2('0x31')]=_[_0x3cc2('0x32')](_0x127910[_0x3cc2('0x31')]);_0x7a6933[_0x3cc2('0x33')]=_['intersection'](_0x7a6933['model'],_0x7a6933['query']);_0x128e16[_0x3cc2('0x34')]=_[_0x3cc2('0x35')](_0x7a6933[_0x3cc2('0x30')],qs[_0x3cc2('0x36')](_0x127910['query']['fields']));_0x128e16[_0x3cc2('0x34')]=_0x128e16[_0x3cc2('0x34')][_0x3cc2('0x37')]?_0x128e16[_0x3cc2('0x34')]:_0x7a6933['model'];if(!_0x127910[_0x3cc2('0x31')][_0x3cc2('0x38')](_0x3cc2('0x39'))){_0x128e16[_0x3cc2('0x1f')]=qs['limit'](_0x127910[_0x3cc2('0x31')][_0x3cc2('0x1f')]);_0x128e16[_0x3cc2('0x1d')]=qs[_0x3cc2('0x1d')](_0x127910['query']['offset']);}_0x128e16[_0x3cc2('0x3a')]=qs[_0x3cc2('0x3b')](_0x127910[_0x3cc2('0x31')][_0x3cc2('0x3b')]);_0x128e16[_0x3cc2('0x3c')]=qs[_0x3cc2('0x33')](_[_0x3cc2('0x3d')](_0x127910[_0x3cc2('0x31')],_0x7a6933[_0x3cc2('0x33')]),_0x23380a);if(_0x127910['query'][_0x3cc2('0x3e')]){_0x128e16['where']=_[_0x3cc2('0x3f')](_0x128e16[_0x3cc2('0x3c')],{'$or':_['map'](_0x23380a,function(_0x6d7a43){if(_0x6d7a43['type']!==_0x3cc2('0x40')){var _0xb4714f={};_0xb4714f[_0x6d7a43[_0x3cc2('0x29')]]={'$like':'%'+_0x127910[_0x3cc2('0x31')][_0x3cc2('0x3e')]+'%'};return _0xb4714f;}})});}_0x128e16=_['merge']({},_0x128e16,_0x127910[_0x3cc2('0x41')]);var _0x59e388={'where':_0x128e16[_0x3cc2('0x3c')]};return db[_0x3cc2('0x2c')]['count'](_0x59e388)[_0x3cc2('0x25')](function(_0x18eb14){_0x35d106[_0x3cc2('0x1e')]=_0x18eb14;if(_0x127910[_0x3cc2('0x31')][_0x3cc2('0x42')]){_0x128e16[_0x3cc2('0x43')]=[{'all':!![]}];}return db[_0x3cc2('0x2c')][_0x3cc2('0x44')](_0x128e16);})[_0x3cc2('0x25')](function(_0x241cac){_0x35d106[_0x3cc2('0x45')]=_0x241cac;return _0x35d106;})['then'](respondWithFilteredResult(_0x52ca28,_0x128e16))[_0x3cc2('0x46')](handleError(_0x52ca28,null));};exports[_0x3cc2('0x47')]=function(_0x2d4919,_0x53291b){var _0x1dddba={'raw':!![],'where':{'id':_0x2d4919[_0x3cc2('0x48')]['id']}},_0x410c44={};_0x410c44['model']=_[_0x3cc2('0x32')](db[_0x3cc2('0x2c')][_0x3cc2('0x49')]);_0x410c44[_0x3cc2('0x31')]=_[_0x3cc2('0x32')](_0x2d4919['query']);_0x410c44['filters']=_[_0x3cc2('0x35')](_0x410c44[_0x3cc2('0x30')],_0x410c44[_0x3cc2('0x31')]);_0x1dddba['attributes']=_[_0x3cc2('0x35')](_0x410c44['model'],qs['fields'](_0x2d4919['query']['fields']));_0x1dddba['attributes']=_0x1dddba[_0x3cc2('0x34')][_0x3cc2('0x37')]?_0x1dddba[_0x3cc2('0x34')]:_0x410c44[_0x3cc2('0x30')];if(_0x2d4919['query'][_0x3cc2('0x42')]){_0x1dddba[_0x3cc2('0x43')]=[{'all':!![]}];}_0x1dddba=_[_0x3cc2('0x3f')]({},_0x1dddba,_0x2d4919[_0x3cc2('0x41')]);return db['MailServerOut']['find'](_0x1dddba)[_0x3cc2('0x25')](handleEntityNotFound(_0x53291b,null))[_0x3cc2('0x25')](respondWithResult(_0x53291b,null))[_0x3cc2('0x46')](handleError(_0x53291b,null));};exports[_0x3cc2('0x4a')]=function(_0x366552,_0x29277a){return db[_0x3cc2('0x2c')][_0x3cc2('0x4a')](_0x366552[_0x3cc2('0x4b')],{})['then'](respondWithResult(_0x29277a,0xc9))[_0x3cc2('0x46')](handleError(_0x29277a,null));};exports[_0x3cc2('0x4c')]=function(_0x52063c,_0xd96b93){if(_0x52063c[_0x3cc2('0x4b')]['id']){delete _0x52063c[_0x3cc2('0x4b')]['id'];}return db[_0x3cc2('0x2c')]['find']({'where':{'id':_0x52063c['params']['id']}})[_0x3cc2('0x25')](handleEntityNotFound(_0xd96b93,null))[_0x3cc2('0x25')](saveUpdates(_0x52063c[_0x3cc2('0x4b')],null))[_0x3cc2('0x25')](respondWithResult(_0xd96b93,null))[_0x3cc2('0x46')](handleError(_0xd96b93,null));};exports[_0x3cc2('0x26')]=function(_0x594c78,_0x4fe8db){return db['MailServerOut']['find']({'where':{'id':_0x594c78[_0x3cc2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4fe8db,null))[_0x3cc2('0x25')](removeEntity(_0x4fe8db,null))[_0x3cc2('0x46')](handleError(_0x4fe8db,null));}; \ No newline at end of file +var _0x9982=['json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','create','request-promise','moment','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','api','sendStatus','status','end','undefined','limit','count','offset','Content-Range'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x9982,0x18e));var _0x2998=function(_0x507e46,_0x4166c1){_0x507e46=_0x507e46-0x0;var _0x3604d3=_0x9982[_0x507e46];return _0x3604d3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2998('0x0'));var moment=require(_0x2998('0x1'));var BPromise=require(_0x2998('0x2'));var Mustache=require(_0x2998('0x3'));var util=require('util');var path=require(_0x2998('0x4'));var sox=require(_0x2998('0x5'));var csv=require(_0x2998('0x6'));var ejs=require(_0x2998('0x7'));var fs=require('fs');var fs_extra=require(_0x2998('0x8'));var _=require(_0x2998('0x9'));var squel=require(_0x2998('0xa'));var crypto=require(_0x2998('0xb'));var jsforce=require(_0x2998('0xc'));var deskjs=require(_0x2998('0xd'));var toCsv=require(_0x2998('0x6'));var querystring=require(_0x2998('0xe'));var Papa=require('papaparse');var Redis=require(_0x2998('0xf'));var authService=require(_0x2998('0x10'));var qs=require(_0x2998('0x11'));var as=require(_0x2998('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2998('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x100d76,_0x2169e6){_0x2169e6=_0x2169e6||0xcc;return function(_0x553a04){if(_0x553a04){return _0x100d76[_0x2998('0x14')](_0x2169e6);}return _0x100d76[_0x2998('0x15')](_0x2169e6)[_0x2998('0x16')]();};}function respondWithResult(_0x2e5cbc,_0x2e266d){_0x2e266d=_0x2e266d||0xc8;return function(_0x232698){if(_0x232698){return _0x2e5cbc[_0x2998('0x15')](_0x2e266d)['json'](_0x232698);}};}function respondWithFilteredResult(_0x2eac35,_0x1bc2c8){return function(_0x2985f4){if(_0x2985f4){var _0x532b72=typeof _0x1bc2c8['offset']===_0x2998('0x17')&&typeof _0x1bc2c8[_0x2998('0x18')]===_0x2998('0x17');var _0x5720f3=_0x2985f4[_0x2998('0x19')];var _0x39adaa=_0x532b72?0x0:_0x1bc2c8['offset'];var _0x3ae838=_0x532b72?_0x2985f4[_0x2998('0x19')]:_0x1bc2c8[_0x2998('0x1a')]+_0x1bc2c8[_0x2998('0x18')];var _0x7e4202;if(_0x3ae838>=_0x5720f3){_0x3ae838=_0x5720f3;_0x7e4202=0xc8;}else{_0x7e4202=0xce;}_0x2eac35[_0x2998('0x15')](_0x7e4202);return _0x2eac35['set'](_0x2998('0x1b'),_0x39adaa+'-'+_0x3ae838+'/'+_0x5720f3)[_0x2998('0x1c')](_0x2985f4);}return null;};}function patchUpdates(_0x2826bb){return function(_0x17177f){try{jsonpatch[_0x2998('0x1d')](_0x17177f,_0x2826bb,!![]);}catch(_0x4a0f17){return BPromise[_0x2998('0x1e')](_0x4a0f17);}return _0x17177f[_0x2998('0x1f')]();};}function saveUpdates(_0x4daf8d,_0x1ae21e){return function(_0x209d41){if(_0x209d41){return _0x209d41[_0x2998('0x20')](_0x4daf8d)[_0x2998('0x21')](function(_0x1eed7f){return _0x1eed7f;});}return null;};}function removeEntity(_0x14f41b,_0x3ffd8f){return function(_0x4364cb){if(_0x4364cb){return _0x4364cb[_0x2998('0x22')]()[_0x2998('0x21')](function(){_0x14f41b['status'](0xcc)[_0x2998('0x16')]();});}};}function handleEntityNotFound(_0x53d5cd,_0x2748f6){return function(_0x302152){if(!_0x302152){_0x53d5cd[_0x2998('0x14')](0x194);}return _0x302152;};}function handleError(_0x446ee5,_0x423187){_0x423187=_0x423187||0x1f4;return function(_0x5343d2){logger[_0x2998('0x23')](_0x5343d2[_0x2998('0x24')]);if(_0x5343d2[_0x2998('0x25')]){delete _0x5343d2[_0x2998('0x25')];}_0x446ee5['status'](_0x423187)[_0x2998('0x26')](_0x5343d2);};}exports[_0x2998('0x27')]=function(_0x3e81a1,_0x2621bf){var _0x21605e={},_0x55c070={},_0x22c6aa={'count':0x0,'rows':[]};var _0x14a5ad=_[_0x2998('0x28')](db[_0x2998('0x29')][_0x2998('0x2a')],function(_0x265d67){return{'name':_0x265d67[_0x2998('0x2b')],'type':_0x265d67[_0x2998('0x2c')][_0x2998('0x2d')]};});_0x55c070[_0x2998('0x2e')]=_[_0x2998('0x28')](_0x14a5ad,_0x2998('0x25'));_0x55c070['query']=_[_0x2998('0x2f')](_0x3e81a1[_0x2998('0x30')]);_0x55c070[_0x2998('0x31')]=_['intersection'](_0x55c070[_0x2998('0x2e')],_0x55c070['query']);_0x21605e['attributes']=_['intersection'](_0x55c070[_0x2998('0x2e')],qs[_0x2998('0x32')](_0x3e81a1[_0x2998('0x30')][_0x2998('0x32')]));_0x21605e['attributes']=_0x21605e[_0x2998('0x33')][_0x2998('0x34')]?_0x21605e['attributes']:_0x55c070[_0x2998('0x2e')];if(!_0x3e81a1[_0x2998('0x30')][_0x2998('0x35')]('nolimit')){_0x21605e[_0x2998('0x18')]=qs['limit'](_0x3e81a1[_0x2998('0x30')][_0x2998('0x18')]);_0x21605e[_0x2998('0x1a')]=qs[_0x2998('0x1a')](_0x3e81a1[_0x2998('0x30')]['offset']);}_0x21605e[_0x2998('0x36')]=qs[_0x2998('0x37')](_0x3e81a1['query'][_0x2998('0x37')]);_0x21605e[_0x2998('0x38')]=qs['filters'](_[_0x2998('0x39')](_0x3e81a1[_0x2998('0x30')],_0x55c070[_0x2998('0x31')]),_0x14a5ad);if(_0x3e81a1[_0x2998('0x30')][_0x2998('0x3a')]){_0x21605e[_0x2998('0x38')]=_[_0x2998('0x3b')](_0x21605e['where'],{'$or':_['map'](_0x14a5ad,function(_0x40c5f7){if(_0x40c5f7['type']!==_0x2998('0x3c')){var _0x1e53a5={};_0x1e53a5[_0x40c5f7[_0x2998('0x25')]]={'$like':'%'+_0x3e81a1[_0x2998('0x30')][_0x2998('0x3a')]+'%'};return _0x1e53a5;}})});}_0x21605e=_['merge']({},_0x21605e,_0x3e81a1[_0x2998('0x3d')]);var _0x347e8c={'where':_0x21605e[_0x2998('0x38')]};return db[_0x2998('0x29')][_0x2998('0x19')](_0x347e8c)[_0x2998('0x21')](function(_0x2155a0){_0x22c6aa[_0x2998('0x19')]=_0x2155a0;if(_0x3e81a1[_0x2998('0x30')][_0x2998('0x3e')]){_0x21605e[_0x2998('0x3f')]=[{'all':!![]}];}return db[_0x2998('0x29')][_0x2998('0x40')](_0x21605e);})[_0x2998('0x21')](function(_0x51bae4){_0x22c6aa['rows']=_0x51bae4;return _0x22c6aa;})[_0x2998('0x21')](respondWithFilteredResult(_0x2621bf,_0x21605e))[_0x2998('0x41')](handleError(_0x2621bf,null));};exports[_0x2998('0x42')]=function(_0x263b4c,_0x445d18){var _0x2a16a8={'raw':!![],'where':{'id':_0x263b4c[_0x2998('0x43')]['id']}},_0x5efe60={};_0x5efe60['model']=_[_0x2998('0x2f')](db[_0x2998('0x29')][_0x2998('0x2a')]);_0x5efe60['query']=_[_0x2998('0x2f')](_0x263b4c[_0x2998('0x30')]);_0x5efe60[_0x2998('0x31')]=_[_0x2998('0x44')](_0x5efe60[_0x2998('0x2e')],_0x5efe60['query']);_0x2a16a8[_0x2998('0x33')]=_[_0x2998('0x44')](_0x5efe60[_0x2998('0x2e')],qs[_0x2998('0x32')](_0x263b4c[_0x2998('0x30')][_0x2998('0x32')]));_0x2a16a8[_0x2998('0x33')]=_0x2a16a8[_0x2998('0x33')][_0x2998('0x34')]?_0x2a16a8[_0x2998('0x33')]:_0x5efe60[_0x2998('0x2e')];if(_0x263b4c['query'][_0x2998('0x3e')]){_0x2a16a8[_0x2998('0x3f')]=[{'all':!![]}];}_0x2a16a8=_[_0x2998('0x3b')]({},_0x2a16a8,_0x263b4c[_0x2998('0x3d')]);return db[_0x2998('0x29')][_0x2998('0x45')](_0x2a16a8)[_0x2998('0x21')](handleEntityNotFound(_0x445d18,null))['then'](respondWithResult(_0x445d18,null))[_0x2998('0x41')](handleError(_0x445d18,null));};exports[_0x2998('0x46')]=function(_0x1a3213,_0x2a5e0e){return db[_0x2998('0x29')]['create'](_0x1a3213['body'],{})[_0x2998('0x21')](respondWithResult(_0x2a5e0e,0xc9))[_0x2998('0x41')](handleError(_0x2a5e0e,null));};exports[_0x2998('0x20')]=function(_0x13f75e,_0x47aaa5){if(_0x13f75e['body']['id']){delete _0x13f75e['body']['id'];}return db[_0x2998('0x29')][_0x2998('0x45')]({'where':{'id':_0x13f75e[_0x2998('0x43')]['id']}})[_0x2998('0x21')](handleEntityNotFound(_0x47aaa5,null))[_0x2998('0x21')](saveUpdates(_0x13f75e['body'],null))[_0x2998('0x21')](respondWithResult(_0x47aaa5,null))[_0x2998('0x41')](handleError(_0x47aaa5,null));};exports['destroy']=function(_0x3aa77b,_0x40163b){return db[_0x2998('0x29')][_0x2998('0x45')]({'where':{'id':_0x3aa77b[_0x2998('0x43')]['id']}})[_0x2998('0x21')](handleEntityNotFound(_0x40163b,null))[_0x2998('0x21')](removeEntity(_0x40163b,null))[_0x2998('0x41')](handleError(_0x40163b,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 94bb72e..e5e73f7 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 _0x14db=['bluebird','path','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x14db,0x1d5));var _0xb14d=function(_0x595389,_0x23c02e){_0x595389=_0x595389-0x0;var _0x372d02=_0x14db[_0x595389];return _0x372d02;};'use strict';var _=require(_0xb14d('0x0'));var util=require(_0xb14d('0x1'));var logger=require(_0xb14d('0x2'))(_0xb14d('0x3'));var moment=require('moment');var BPromise=require(_0xb14d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb14d('0x5'));var rimraf=require('rimraf');var config=require(_0xb14d('0x6'));var attributes=require(_0xb14d('0x7'));module[_0xb14d('0x8')]=function(_0x3734c4,_0xfe0ba5){return _0x3734c4[_0xb14d('0x9')]('MailServerOut',attributes,{'tableName':_0xb14d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd467=['request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api'];(function(_0x15532c,_0x1e3c7e){var _0x366543=function(_0x3ab558){while(--_0x3ab558){_0x15532c['push'](_0x15532c['shift']());}};_0x366543(++_0x1e3c7e);}(_0xd467,0x158));var _0x7d46=function(_0x2ca9b6,_0x3c319e){_0x2ca9b6=_0x2ca9b6-0x0;var _0x241aa3=_0xd467[_0x2ca9b6];return _0x241aa3;};'use strict';var _=require(_0x7d46('0x0'));var util=require(_0x7d46('0x1'));var logger=require(_0x7d46('0x2'))(_0x7d46('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d46('0x4'));var fs=require('fs');var path=require(_0x7d46('0x5'));var rimraf=require('rimraf');var config=require(_0x7d46('0x6'));var attributes=require(_0x7d46('0x7'));module[_0x7d46('0x8')]=function(_0x515421,_0x27861a){return _0x515421[_0x7d46('0x9')](_0x7d46('0xa'),attributes,{'tableName':_0x7d46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index c42cbcf..b8b99e4 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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x28d673,_0x489832){_0x28d673=_0x28d673-0x0;var _0x982321=_0x7a54[_0x28d673];return _0x982321;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x351f5b,_0x4f2780){_0x351f5b=_0x351f5b-0x0;var _0x10fed6=_0x7a54[_0x351f5b];return _0x10fed6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index eeccecf..5d9d3dd 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 _0x83c1=['create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe','describe','/:id','isAuthenticated','show'];(function(_0x149aeb,_0x48893c){var _0x88583b=function(_0x3e3e26){while(--_0x3e3e26){_0x149aeb['push'](_0x149aeb['shift']());}};_0x88583b(++_0x48893c);}(_0x83c1,0xa4));var _0x183c=function(_0xe7f3f7,_0x4c7c3c){_0xe7f3f7=_0xe7f3f7-0x0;var _0x526e64=_0x83c1[_0xe7f3f7];return _0x526e64;};'use strict';var multer=require(_0x183c('0x0'));var util=require(_0x183c('0x1'));var path=require('path');var timeout=require(_0x183c('0x2'));var express=require(_0x183c('0x3'));var router=express[_0x183c('0x4')]();var fs_extra=require(_0x183c('0x5'));var auth=require(_0x183c('0x6'));var interaction=require(_0x183c('0x7'));var config=require('../../config/environment');var controller=require(_0x183c('0x8'));router[_0x183c('0x9')]('/',auth['isAuthenticated'](),controller[_0x183c('0xa')]);router[_0x183c('0x9')](_0x183c('0xb'),auth['isAuthenticated'](),controller[_0x183c('0xc')]);router[_0x183c('0x9')](_0x183c('0xd'),auth[_0x183c('0xe')](),controller[_0x183c('0xf')]);router['post']('/',auth[_0x183c('0xe')](),controller[_0x183c('0x10')]);router[_0x183c('0x11')](_0x183c('0xd'),auth[_0x183c('0xe')](),controller['update']);router[_0x183c('0x12')](_0x183c('0xd'),auth[_0x183c('0xe')](),controller['destroy']);module[_0x183c('0x13')]=router; \ No newline at end of file +var _0x2ddd=['../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x2ddd,0x10a));var _0xd2dd=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2ddd[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0xd2dd('0x0'));var util=require(_0xd2dd('0x1'));var path=require(_0xd2dd('0x2'));var timeout=require(_0xd2dd('0x3'));var express=require(_0xd2dd('0x4'));var router=express[_0xd2dd('0x5')]();var fs_extra=require(_0xd2dd('0x6'));var auth=require(_0xd2dd('0x7'));var interaction=require(_0xd2dd('0x8'));var config=require(_0xd2dd('0x9'));var controller=require(_0xd2dd('0xa'));router[_0xd2dd('0xb')]('/',auth[_0xd2dd('0xc')](),controller[_0xd2dd('0xd')]);router[_0xd2dd('0xb')](_0xd2dd('0xe'),auth[_0xd2dd('0xc')](),controller[_0xd2dd('0xf')]);router[_0xd2dd('0xb')]('/:id',auth[_0xd2dd('0xc')](),controller[_0xd2dd('0x10')]);router[_0xd2dd('0x11')]('/',auth['isAuthenticated'](),controller[_0xd2dd('0x12')]);router[_0xd2dd('0x13')](_0xd2dd('0x14'),auth[_0xd2dd('0xc')](),controller[_0xd2dd('0x15')]);router[_0xd2dd('0x16')]('/:id',auth[_0xd2dd('0xc')](),controller[_0xd2dd('0x17')]);module[_0xd2dd('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 5dec161..ec1925f 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 _0x7278=['name','sequelize','exports','STRING'];(function(_0x3c7a73,_0x3cd0f5){var _0xd0e2b6=function(_0x5df90d){while(--_0x5df90d){_0x3c7a73['push'](_0x3c7a73['shift']());}};_0xd0e2b6(++_0x3cd0f5);}(_0x7278,0x161));var _0x8727=function(_0x462069,_0x4f11a8){_0x462069=_0x462069-0x0;var _0x26bf39=_0x7278[_0x462069];return _0x26bf39;};'use strict';var Sequelize=require(_0x8727('0x0'));module[_0x8727('0x1')]={'name':{'type':Sequelize[_0x8727('0x2')],'unique':_0x8727('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8727('0x2')]}}; \ No newline at end of file +var _0x236d=['sequelize','exports','name'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd236('0x0'));module[_0xd236('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd236('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 9740e17..7ee80d6 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 _0x2641=['model','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','rawAttributes','create','body','catch','destroy','describe','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','name','send','index','map','MailSubstatus','fieldName','type','key','keys','query','filters','intersection','attributes'];(function(_0x55d726,_0x3f25f0){var _0x2a463e=function(_0x39f745){while(--_0x39f745){_0x55d726['push'](_0x55d726['shift']());}};_0x2a463e(++_0x3f25f0);}(_0x2641,0x1a2));var _0x1264=function(_0x3d710e,_0x482838){_0x3d710e=_0x3d710e-0x0;var _0x7d1373=_0x2641[_0x3d710e];return _0x7d1373;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1264('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1264('0x1'));var moment=require(_0x1264('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1264('0x3'));var path=require('path');var sox=require(_0x1264('0x4'));var csv=require(_0x1264('0x5'));var ejs=require(_0x1264('0x6'));var fs=require('fs');var fs_extra=require(_0x1264('0x7'));var _=require('lodash');var squel=require(_0x1264('0x8'));var crypto=require(_0x1264('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1264('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1264('0xb'));var as=require(_0x1264('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1264('0xd'))(_0x1264('0xe'));var utils=require('../../config/utils');var config=require(_0x1264('0xf'));var licenseUtil=require(_0x1264('0x10'));var db=require(_0x1264('0x11'))['db'];function respondWithStatusCode(_0x2fcbed,_0x2985f4){_0x2985f4=_0x2985f4||0xcc;return function(_0x52917a){if(_0x52917a){return _0x2fcbed[_0x1264('0x12')](_0x2985f4);}return _0x2fcbed[_0x1264('0x13')](_0x2985f4)['end']();};}function respondWithResult(_0x33a301,_0x402d9c){_0x402d9c=_0x402d9c||0xc8;return function(_0x2bf9d6){if(_0x2bf9d6){return _0x33a301['status'](_0x402d9c)[_0x1264('0x14')](_0x2bf9d6);}};}function respondWithFilteredResult(_0x14ecaf,_0x91b3ad){return function(_0x1a2b65){if(_0x1a2b65){var _0x3eebcf=typeof _0x91b3ad[_0x1264('0x15')]===_0x1264('0x16')&&typeof _0x91b3ad[_0x1264('0x17')]===_0x1264('0x16');var _0x327afd=_0x1a2b65[_0x1264('0x18')];var _0x217510=_0x3eebcf?0x0:_0x91b3ad[_0x1264('0x15')];var _0xca05ed=_0x3eebcf?_0x1a2b65[_0x1264('0x18')]:_0x91b3ad[_0x1264('0x15')]+_0x91b3ad[_0x1264('0x17')];var _0x6abd6;if(_0xca05ed>=_0x327afd){_0xca05ed=_0x327afd;_0x6abd6=0xc8;}else{_0x6abd6=0xce;}_0x14ecaf[_0x1264('0x13')](_0x6abd6);return _0x14ecaf[_0x1264('0x19')](_0x1264('0x1a'),_0x217510+'-'+_0xca05ed+'/'+_0x327afd)[_0x1264('0x14')](_0x1a2b65);}return null;};}function patchUpdates(_0x1a66a4){return function(_0xcd611){try{jsonpatch[_0x1264('0x1b')](_0xcd611,_0x1a66a4,!![]);}catch(_0x49a03f){return BPromise['reject'](_0x49a03f);}return _0xcd611['save']();};}function saveUpdates(_0xce629d,_0x1a389e){return function(_0x1111e1){if(_0x1111e1){return _0x1111e1[_0x1264('0x1c')](_0xce629d)[_0x1264('0x1d')](function(_0x332c34){return _0x332c34;});}return null;};}function removeEntity(_0x26b8b1,_0x3ac7a0){return function(_0x1c6421){if(_0x1c6421){return _0x1c6421['destroy']()[_0x1264('0x1d')](function(){_0x26b8b1[_0x1264('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e8036,_0x90f87b){return function(_0xd089b1){if(!_0xd089b1){_0x2e8036[_0x1264('0x12')](0x194);}return _0xd089b1;};}function handleError(_0x231fcf,_0x5b07ad){_0x5b07ad=_0x5b07ad||0x1f4;return function(_0x3993c4){logger[_0x1264('0x1e')](_0x3993c4['stack']);if(_0x3993c4[_0x1264('0x1f')]){delete _0x3993c4[_0x1264('0x1f')];}_0x231fcf[_0x1264('0x13')](_0x5b07ad)[_0x1264('0x20')](_0x3993c4);};}exports[_0x1264('0x21')]=function(_0xa9b146,_0x52912b){var _0x42c6a7={},_0x2ae6e9={},_0x4c07c0={'count':0x0,'rows':[]};var _0x47645d=_[_0x1264('0x22')](db[_0x1264('0x23')]['rawAttributes'],function(_0x1b91b5){return{'name':_0x1b91b5[_0x1264('0x24')],'type':_0x1b91b5[_0x1264('0x25')][_0x1264('0x26')]};});_0x2ae6e9['model']=_[_0x1264('0x22')](_0x47645d,_0x1264('0x1f'));_0x2ae6e9['query']=_[_0x1264('0x27')](_0xa9b146[_0x1264('0x28')]);_0x2ae6e9[_0x1264('0x29')]=_[_0x1264('0x2a')](_0x2ae6e9['model'],_0x2ae6e9['query']);_0x42c6a7[_0x1264('0x2b')]=_[_0x1264('0x2a')](_0x2ae6e9[_0x1264('0x2c')],qs[_0x1264('0x2d')](_0xa9b146[_0x1264('0x28')][_0x1264('0x2d')]));_0x42c6a7[_0x1264('0x2b')]=_0x42c6a7[_0x1264('0x2b')][_0x1264('0x2e')]?_0x42c6a7['attributes']:_0x2ae6e9[_0x1264('0x2c')];if(!_0xa9b146[_0x1264('0x28')][_0x1264('0x2f')](_0x1264('0x30'))){_0x42c6a7[_0x1264('0x17')]=qs[_0x1264('0x17')](_0xa9b146[_0x1264('0x28')][_0x1264('0x17')]);_0x42c6a7['offset']=qs[_0x1264('0x15')](_0xa9b146[_0x1264('0x28')]['offset']);}_0x42c6a7['order']=qs['sort'](_0xa9b146[_0x1264('0x28')][_0x1264('0x31')]);_0x42c6a7['where']=qs[_0x1264('0x29')](_[_0x1264('0x32')](_0xa9b146[_0x1264('0x28')],_0x2ae6e9[_0x1264('0x29')]),_0x47645d);if(_0xa9b146[_0x1264('0x28')][_0x1264('0x33')]){_0x42c6a7[_0x1264('0x34')]=_[_0x1264('0x35')](_0x42c6a7[_0x1264('0x34')],{'$or':_[_0x1264('0x22')](_0x47645d,function(_0x233b77){if(_0x233b77[_0x1264('0x25')]!=='VIRTUAL'){var _0xe586d3={};_0xe586d3[_0x233b77[_0x1264('0x1f')]]={'$like':'%'+_0xa9b146[_0x1264('0x28')][_0x1264('0x33')]+'%'};return _0xe586d3;}})});}_0x42c6a7=_[_0x1264('0x35')]({},_0x42c6a7,_0xa9b146[_0x1264('0x36')]);var _0x2561af={'where':_0x42c6a7[_0x1264('0x34')]};return db[_0x1264('0x23')][_0x1264('0x18')](_0x2561af)[_0x1264('0x1d')](function(_0xbb957f){_0x4c07c0[_0x1264('0x18')]=_0xbb957f;if(_0xa9b146[_0x1264('0x28')][_0x1264('0x37')]){_0x42c6a7[_0x1264('0x38')]=[{'all':!![]}];}return db[_0x1264('0x23')]['findAll'](_0x42c6a7);})['then'](function(_0x30bd6a){_0x4c07c0[_0x1264('0x39')]=_0x30bd6a;return _0x4c07c0;})[_0x1264('0x1d')](respondWithFilteredResult(_0x52912b,_0x42c6a7))['catch'](handleError(_0x52912b,null));};exports[_0x1264('0x3a')]=function(_0x16e190,_0x4b9f3f){var _0x36b7fe={'raw':!![],'where':{'id':_0x16e190[_0x1264('0x3b')]['id']}},_0x3fdee0={};_0x3fdee0[_0x1264('0x2c')]=_['keys'](db[_0x1264('0x23')][_0x1264('0x3c')]);_0x3fdee0[_0x1264('0x28')]=_[_0x1264('0x27')](_0x16e190['query']);_0x3fdee0[_0x1264('0x29')]=_[_0x1264('0x2a')](_0x3fdee0[_0x1264('0x2c')],_0x3fdee0[_0x1264('0x28')]);_0x36b7fe[_0x1264('0x2b')]=_[_0x1264('0x2a')](_0x3fdee0[_0x1264('0x2c')],qs[_0x1264('0x2d')](_0x16e190['query'][_0x1264('0x2d')]));_0x36b7fe[_0x1264('0x2b')]=_0x36b7fe[_0x1264('0x2b')][_0x1264('0x2e')]?_0x36b7fe[_0x1264('0x2b')]:_0x3fdee0[_0x1264('0x2c')];if(_0x16e190['query'][_0x1264('0x37')]){_0x36b7fe['include']=[{'all':!![]}];}_0x36b7fe=_[_0x1264('0x35')]({},_0x36b7fe,_0x16e190['options']);return db['MailSubstatus']['find'](_0x36b7fe)['then'](handleEntityNotFound(_0x4b9f3f,null))[_0x1264('0x1d')](respondWithResult(_0x4b9f3f,null))['catch'](handleError(_0x4b9f3f,null));};exports['create']=function(_0x43d386,_0x3a8903){return db['MailSubstatus'][_0x1264('0x3d')](_0x43d386[_0x1264('0x3e')],{})[_0x1264('0x1d')](respondWithResult(_0x3a8903,0xc9))[_0x1264('0x3f')](handleError(_0x3a8903,null));};exports[_0x1264('0x1c')]=function(_0x27fb80,_0x440dba){if(_0x27fb80[_0x1264('0x3e')]['id']){delete _0x27fb80[_0x1264('0x3e')]['id'];}return db[_0x1264('0x23')]['find']({'where':{'id':_0x27fb80[_0x1264('0x3b')]['id']}})[_0x1264('0x1d')](handleEntityNotFound(_0x440dba,null))['then'](saveUpdates(_0x27fb80[_0x1264('0x3e')],null))['then'](respondWithResult(_0x440dba,null))['catch'](handleError(_0x440dba,null));};exports[_0x1264('0x40')]=function(_0x4ed78c,_0x5d494f){return db[_0x1264('0x23')]['find']({'where':{'id':_0x4ed78c[_0x1264('0x3b')]['id']}})[_0x1264('0x1d')](handleEntityNotFound(_0x5d494f,null))['then'](removeEntity(_0x5d494f,null))[_0x1264('0x3f')](handleError(_0x5d494f,null));};exports['describe']=function(_0x36a017,_0x52943d){return db[_0x1264('0x23')][_0x1264('0x41')]()[_0x1264('0x1d')](respondWithResult(_0x52943d,null))[_0x1264('0x3f')](handleError(_0x52943d,null));}; \ No newline at end of file +var _0x47e4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','MailSubstatus','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x28b0e3,_0x1c14de){var _0x35788b=function(_0x481d37){while(--_0x481d37){_0x28b0e3['push'](_0x28b0e3['shift']());}};_0x35788b(++_0x1c14de);}(_0x47e4,0x113));var _0x447e=function(_0x3c7936,_0x4bf3ec){_0x3c7936=_0x3c7936-0x0;var _0x56df6c=_0x47e4[_0x3c7936];return _0x56df6c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x447e('0x0'));var jsonpatch=require(_0x447e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x447e('0x2'));var util=require(_0x447e('0x3'));var path=require(_0x447e('0x4'));var sox=require('sox');var csv=require(_0x447e('0x5'));var ejs=require(_0x447e('0x6'));var fs=require('fs');var fs_extra=require(_0x447e('0x7'));var _=require(_0x447e('0x8'));var squel=require('squel');var crypto=require(_0x447e('0x9'));var jsforce=require(_0x447e('0xa'));var deskjs=require(_0x447e('0xb'));var toCsv=require(_0x447e('0x5'));var querystring=require(_0x447e('0xc'));var Papa=require('papaparse');var Redis=require(_0x447e('0xd'));var authService=require(_0x447e('0xe'));var qs=require(_0x447e('0xf'));var as=require(_0x447e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x447e('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x447e('0x12'));var licenseUtil=require(_0x447e('0x13'));var db=require(_0x447e('0x14'))['db'];function respondWithStatusCode(_0x30241b,_0x24cf6c){_0x24cf6c=_0x24cf6c||0xcc;return function(_0x79ec22){if(_0x79ec22){return _0x30241b[_0x447e('0x15')](_0x24cf6c);}return _0x30241b[_0x447e('0x16')](_0x24cf6c)[_0x447e('0x17')]();};}function respondWithResult(_0x4cec72,_0x3676f7){_0x3676f7=_0x3676f7||0xc8;return function(_0x348d87){if(_0x348d87){return _0x4cec72[_0x447e('0x16')](_0x3676f7)['json'](_0x348d87);}};}function respondWithFilteredResult(_0x45f62d,_0x4cd23a){return function(_0x2501b3){if(_0x2501b3){var _0x113a4e=typeof _0x4cd23a[_0x447e('0x18')]===_0x447e('0x19')&&typeof _0x4cd23a[_0x447e('0x1a')]===_0x447e('0x19');var _0x191334=_0x2501b3[_0x447e('0x1b')];var _0x259ecb=_0x113a4e?0x0:_0x4cd23a[_0x447e('0x18')];var _0x5aa7ed=_0x113a4e?_0x2501b3[_0x447e('0x1b')]:_0x4cd23a[_0x447e('0x18')]+_0x4cd23a[_0x447e('0x1a')];var _0x162a7d;if(_0x5aa7ed>=_0x191334){_0x5aa7ed=_0x191334;_0x162a7d=0xc8;}else{_0x162a7d=0xce;}_0x45f62d[_0x447e('0x16')](_0x162a7d);return _0x45f62d['set'](_0x447e('0x1c'),_0x259ecb+'-'+_0x5aa7ed+'/'+_0x191334)['json'](_0x2501b3);}return null;};}function patchUpdates(_0x59044d){return function(_0xbc1fdb){try{jsonpatch[_0x447e('0x1d')](_0xbc1fdb,_0x59044d,!![]);}catch(_0x53125a){return BPromise[_0x447e('0x1e')](_0x53125a);}return _0xbc1fdb[_0x447e('0x1f')]();};}function saveUpdates(_0xb6c7e9,_0x22fe1d){return function(_0x5305cf){if(_0x5305cf){return _0x5305cf[_0x447e('0x20')](_0xb6c7e9)[_0x447e('0x21')](function(_0x444bcc){return _0x444bcc;});}return null;};}function removeEntity(_0x1f3d98,_0x533fbc){return function(_0x4ea866){if(_0x4ea866){return _0x4ea866[_0x447e('0x22')]()[_0x447e('0x21')](function(){_0x1f3d98[_0x447e('0x16')](0xcc)[_0x447e('0x17')]();});}};}function handleEntityNotFound(_0x1b34a5,_0x343ee3){return function(_0x2831b3){if(!_0x2831b3){_0x1b34a5[_0x447e('0x15')](0x194);}return _0x2831b3;};}function handleError(_0x3b141b,_0x3b48fd){_0x3b48fd=_0x3b48fd||0x1f4;return function(_0x5e2fc4){logger[_0x447e('0x23')](_0x5e2fc4[_0x447e('0x24')]);if(_0x5e2fc4[_0x447e('0x25')]){delete _0x5e2fc4['name'];}_0x3b141b[_0x447e('0x16')](_0x3b48fd)[_0x447e('0x26')](_0x5e2fc4);};}exports['index']=function(_0x573208,_0x43c85c){var _0x5b23a3={},_0x53548c={},_0x1035d2={'count':0x0,'rows':[]};var _0x403251=_[_0x447e('0x27')](db['MailSubstatus'][_0x447e('0x28')],function(_0x1e7362){return{'name':_0x1e7362[_0x447e('0x29')],'type':_0x1e7362[_0x447e('0x2a')]['key']};});_0x53548c[_0x447e('0x2b')]=_[_0x447e('0x27')](_0x403251,_0x447e('0x25'));_0x53548c['query']=_[_0x447e('0x2c')](_0x573208['query']);_0x53548c[_0x447e('0x2d')]=_[_0x447e('0x2e')](_0x53548c['model'],_0x53548c[_0x447e('0x2f')]);_0x5b23a3[_0x447e('0x30')]=_[_0x447e('0x2e')](_0x53548c[_0x447e('0x2b')],qs[_0x447e('0x31')](_0x573208[_0x447e('0x2f')][_0x447e('0x31')]));_0x5b23a3['attributes']=_0x5b23a3[_0x447e('0x30')][_0x447e('0x32')]?_0x5b23a3['attributes']:_0x53548c[_0x447e('0x2b')];if(!_0x573208[_0x447e('0x2f')][_0x447e('0x33')](_0x447e('0x34'))){_0x5b23a3[_0x447e('0x1a')]=qs['limit'](_0x573208[_0x447e('0x2f')][_0x447e('0x1a')]);_0x5b23a3[_0x447e('0x18')]=qs[_0x447e('0x18')](_0x573208['query'][_0x447e('0x18')]);}_0x5b23a3[_0x447e('0x35')]=qs['sort'](_0x573208[_0x447e('0x2f')][_0x447e('0x36')]);_0x5b23a3['where']=qs[_0x447e('0x2d')](_['pick'](_0x573208[_0x447e('0x2f')],_0x53548c[_0x447e('0x2d')]),_0x403251);if(_0x573208[_0x447e('0x2f')][_0x447e('0x37')]){_0x5b23a3[_0x447e('0x38')]=_['merge'](_0x5b23a3['where'],{'$or':_['map'](_0x403251,function(_0x81e917){if(_0x81e917['type']!==_0x447e('0x39')){var _0x42ebc3={};_0x42ebc3[_0x81e917[_0x447e('0x25')]]={'$like':'%'+_0x573208[_0x447e('0x2f')][_0x447e('0x37')]+'%'};return _0x42ebc3;}})});}_0x5b23a3=_[_0x447e('0x3a')]({},_0x5b23a3,_0x573208[_0x447e('0x3b')]);var _0x49964b={'where':_0x5b23a3[_0x447e('0x38')]};return db[_0x447e('0x3c')][_0x447e('0x1b')](_0x49964b)['then'](function(_0x2fdd04){_0x1035d2['count']=_0x2fdd04;if(_0x573208['query'][_0x447e('0x3d')]){_0x5b23a3['include']=[{'all':!![]}];}return db[_0x447e('0x3c')][_0x447e('0x3e')](_0x5b23a3);})['then'](function(_0x279bcb){_0x1035d2[_0x447e('0x3f')]=_0x279bcb;return _0x1035d2;})[_0x447e('0x21')](respondWithFilteredResult(_0x43c85c,_0x5b23a3))['catch'](handleError(_0x43c85c,null));};exports[_0x447e('0x40')]=function(_0x89c2a8,_0x18c090){var _0x1cf1bf={'raw':!![],'where':{'id':_0x89c2a8[_0x447e('0x41')]['id']}},_0x5a7c71={};_0x5a7c71[_0x447e('0x2b')]=_[_0x447e('0x2c')](db[_0x447e('0x3c')][_0x447e('0x28')]);_0x5a7c71[_0x447e('0x2f')]=_[_0x447e('0x2c')](_0x89c2a8[_0x447e('0x2f')]);_0x5a7c71[_0x447e('0x2d')]=_[_0x447e('0x2e')](_0x5a7c71[_0x447e('0x2b')],_0x5a7c71['query']);_0x1cf1bf['attributes']=_[_0x447e('0x2e')](_0x5a7c71[_0x447e('0x2b')],qs[_0x447e('0x31')](_0x89c2a8[_0x447e('0x2f')][_0x447e('0x31')]));_0x1cf1bf[_0x447e('0x30')]=_0x1cf1bf[_0x447e('0x30')][_0x447e('0x32')]?_0x1cf1bf[_0x447e('0x30')]:_0x5a7c71[_0x447e('0x2b')];if(_0x89c2a8[_0x447e('0x2f')]['includeAll']){_0x1cf1bf[_0x447e('0x42')]=[{'all':!![]}];}_0x1cf1bf=_['merge']({},_0x1cf1bf,_0x89c2a8[_0x447e('0x3b')]);return db[_0x447e('0x3c')][_0x447e('0x43')](_0x1cf1bf)[_0x447e('0x21')](handleEntityNotFound(_0x18c090,null))[_0x447e('0x21')](respondWithResult(_0x18c090,null))[_0x447e('0x44')](handleError(_0x18c090,null));};exports[_0x447e('0x45')]=function(_0x51ae2c,_0x4720c1){return db['MailSubstatus'][_0x447e('0x45')](_0x51ae2c[_0x447e('0x46')],{})[_0x447e('0x21')](respondWithResult(_0x4720c1,0xc9))[_0x447e('0x44')](handleError(_0x4720c1,null));};exports[_0x447e('0x20')]=function(_0x559a6d,_0x3f05d2){if(_0x559a6d['body']['id']){delete _0x559a6d[_0x447e('0x46')]['id'];}return db['MailSubstatus'][_0x447e('0x43')]({'where':{'id':_0x559a6d['params']['id']}})['then'](handleEntityNotFound(_0x3f05d2,null))[_0x447e('0x21')](saveUpdates(_0x559a6d[_0x447e('0x46')],null))[_0x447e('0x21')](respondWithResult(_0x3f05d2,null))[_0x447e('0x44')](handleError(_0x3f05d2,null));};exports[_0x447e('0x22')]=function(_0x46ee03,_0x2df7d8){return db['MailSubstatus'][_0x447e('0x43')]({'where':{'id':_0x46ee03[_0x447e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2df7d8,null))[_0x447e('0x21')](removeEntity(_0x2df7d8,null))[_0x447e('0x44')](handleError(_0x2df7d8,null));};exports[_0x447e('0x47')]=function(_0x1551b3,_0x212658){return db['MailSubstatus'][_0x447e('0x47')]()['then'](respondWithResult(_0x212658,null))[_0x447e('0x44')](handleError(_0x212658,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 7be2437..56f64bf 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 _0xc81c=['update','emit','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x24a48c,_0x42844c){var _0x24bab6=function(_0x55f7f9){while(--_0x55f7f9){_0x24a48c['push'](_0x24a48c['shift']());}};_0x24bab6(++_0x42844c);}(_0xc81c,0x17c));var _0xcc81=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc81c[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xcc81('0x0'));var MailSubstatus=require(_0xcc81('0x1'))['db'][_0xcc81('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xcc81('0x3')](0x0);var events={'afterUpdate':_0xcc81('0x4')};function emitEvent(_0x46ff77){return function(_0x2917f7,_0x4c73b1,_0x489a4a){MailSubstatusEvents[_0xcc81('0x5')](_0x46ff77+':'+_0x2917f7['id'],_0x2917f7);MailSubstatusEvents[_0xcc81('0x5')](_0x46ff77,_0x2917f7);_0x489a4a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xcc81('0x6')](e,emitEvent(event));}}module[_0xcc81('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x9a4d=['emit','hasOwnProperty','hook','events','../../mysqldb','MailSubstatus','update'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x9a4d,0x161));var _0xd9a4=function(_0x1acf4b,_0x5a750c){_0x1acf4b=_0x1acf4b-0x0;var _0x4eca09=_0x9a4d[_0x1acf4b];return _0x4eca09;};'use strict';var EventEmitter=require(_0xd9a4('0x0'));var MailSubstatus=require(_0xd9a4('0x1'))['db'][_0xd9a4('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xd9a4('0x3')};function emitEvent(_0x394d6e){return function(_0x498ce0,_0x120e12,_0x3bd051){MailSubstatusEvents[_0xd9a4('0x4')](_0x394d6e+':'+_0x498ce0['id'],_0x498ce0);MailSubstatusEvents[_0xd9a4('0x4')](_0x394d6e,_0x498ce0);_0x3bd051(null);};}for(var e in events){if(events[_0xd9a4('0x5')](e)){var event=events[e];MailSubstatus[_0xd9a4('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 9eee034..0455958 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 _0x5dca=['MailSubstatus','Condition','update','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5dca,0x101));var _0xa5dc=function(_0x52aec0,_0xe1a1eb){_0x52aec0=_0x52aec0-0x0;var _0x423b14=_0x5dca[_0x52aec0];return _0x423b14;};'use strict';var attributes=require(_0xa5dc('0x0'));module[_0xa5dc('0x1')]=function(_0xa18cac){var _0x69db7f=_0xa18cac[_0xa5dc('0x2')];return _0xa18cac['define'](_0xa5dc('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5baa54,_0x1575e2,_0x52f068){return _0x69db7f[_0xa5dc('0x4')][_0xa5dc('0x5')]({'value':_0x5baa54['name']},{'where':{'field':_0xa5dc('0x6'),'value':_0x5baa54[_0xa5dc('0x7')]['name']}})[_0xa5dc('0x8')](function(){_0x52f068();})[_0xa5dc('0x9')](function(_0x2126c1){_0x52f068(_0x2126c1);});}}});}; \ No newline at end of file +var _0x31b6=['exports','models','Condition','update','name','_previousDataValues','then','catch','./mailSubstatus.attributes'];(function(_0x514532,_0x1985d6){var _0x4ae990=function(_0x1ddf14){while(--_0x1ddf14){_0x514532['push'](_0x514532['shift']());}};_0x4ae990(++_0x1985d6);}(_0x31b6,0xd7));var _0x631b=function(_0x1d1fb9,_0x5e606e){_0x1d1fb9=_0x1d1fb9-0x0;var _0x476a48=_0x31b6[_0x1d1fb9];return _0x476a48;};'use strict';var attributes=require(_0x631b('0x0'));module[_0x631b('0x1')]=function(_0x102a1c){var _0x4f9777=_0x102a1c[_0x631b('0x2')];return _0x102a1c['define']('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x20f11b,_0x4932b1,_0x21c9c0){return _0x4f9777[_0x631b('0x3')][_0x631b('0x4')]({'value':_0x20f11b[_0x631b('0x5')]},{'where':{'field':'mailSubstatus','value':_0x20f11b[_0x631b('0x6')][_0x631b('0x5')]}})[_0x631b('0x7')](function(){_0x21c9c0();})[_0x631b('0x8')](function(_0x3cfe4b){_0x21c9c0(_0x3cfe4b);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index ce06c97..b29028f 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 _0x344a=['request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MailSubstatus,\x20%s,\x20%s'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0x344a,0xd0));var _0xa344=function(_0xa573a7,_0x43ec2d){_0xa573a7=_0xa573a7-0x0;var _0x23d29e=_0x344a[_0xa573a7];return _0x23d29e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa344('0x0'));var BPromise=require(_0xa344('0x1'));var rs=require(_0xa344('0x2'));var fs=require('fs');var Redis=require(_0xa344('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa344('0x4'))(_0xa344('0x5'));var config=require(_0xa344('0x6'));var jayson=require(_0xa344('0x7'));var client=jayson[_0xa344('0x8')][_0xa344('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37d211,_0x5871a8,_0x5e90a2){return new BPromise(function(_0x298d1a,_0x20fd49){return client['request'](_0x37d211,_0x5e90a2)[_0xa344('0xa')](function(_0x25fab5){logger['info'](_0xa344('0xb'),_0x5871a8,_0xa344('0xc'));logger['debug'](_0xa344('0xd'),_0x5871a8,_0xa344('0xc'),JSON[_0xa344('0xe')](_0x25fab5));if(_0x25fab5[_0xa344('0xf')]){if(_0x25fab5['error']['code']===0x1f4){logger[_0xa344('0xf')](_0xa344('0xb'),_0x5871a8,_0x25fab5[_0xa344('0xf')]['message']);return _0x20fd49(_0x25fab5[_0xa344('0xf')][_0xa344('0x10')]);}logger[_0xa344('0xf')](_0xa344('0xb'),_0x5871a8,_0x25fab5[_0xa344('0xf')]['message']);return _0x298d1a(_0x25fab5['error'][_0xa344('0x10')]);}else{logger[_0xa344('0x11')](_0xa344('0xb'),_0x5871a8,'request\x20sent');_0x298d1a(_0x25fab5[_0xa344('0x12')]['message']);}})[_0xa344('0x13')](function(_0xa028f2){logger[_0xa344('0xf')](_0xa344('0xb'),_0x5871a8,_0xa028f2);_0x20fd49(_0xa028f2);});});} \ No newline at end of file +var _0xa487=['MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0xc8224,_0x4385c7){var _0x20ecc3=function(_0xc3f744){while(--_0xc3f744){_0xc8224['push'](_0xc8224['shift']());}};_0x20ecc3(++_0x4385c7);}(_0xa487,0x8b));var _0x7a48=function(_0x45b554,_0x5258bb){_0x45b554=_0x45b554-0x0;var _0x5d6824=_0xa487[_0x45b554];return _0x5d6824;};'use strict';var _=require(_0x7a48('0x0'));var util=require('util');var moment=require(_0x7a48('0x1'));var BPromise=require(_0x7a48('0x2'));var rs=require(_0x7a48('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a48('0x4'))['db'];var utils=require(_0x7a48('0x5'));var logger=require('../../config/logger')(_0x7a48('0x6'));var config=require(_0x7a48('0x7'));var jayson=require(_0x7a48('0x8'));var client=jayson[_0x7a48('0x9')][_0x7a48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f5e9e,_0x38a2e6,_0x5736db){return new BPromise(function(_0x2fa660,_0x2fd0a3){return client[_0x7a48('0xb')](_0x3f5e9e,_0x5736db)['then'](function(_0x2489c5){logger[_0x7a48('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x38a2e6,_0x7a48('0xd'));logger[_0x7a48('0xe')](_0x7a48('0xf'),_0x38a2e6,_0x7a48('0xd'),JSON['stringify'](_0x2489c5));if(_0x2489c5[_0x7a48('0x10')]){if(_0x2489c5[_0x7a48('0x10')][_0x7a48('0x11')]===0x1f4){logger[_0x7a48('0x10')](_0x7a48('0x12'),_0x38a2e6,_0x2489c5[_0x7a48('0x10')][_0x7a48('0x13')]);return _0x2fd0a3(_0x2489c5[_0x7a48('0x10')]['message']);}logger[_0x7a48('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x38a2e6,_0x2489c5[_0x7a48('0x10')]['message']);return _0x2fa660(_0x2489c5[_0x7a48('0x10')][_0x7a48('0x13')]);}else{logger[_0x7a48('0xc')](_0x7a48('0x12'),_0x38a2e6,_0x7a48('0xd'));_0x2fa660(_0x2489c5[_0x7a48('0x14')][_0x7a48('0x13')]);}})[_0x7a48('0x15')](function(_0x200e09){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x38a2e6,_0x200e09);_0x2fd0a3(_0x200e09);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b69ba37..fe276a3 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 _0x5ca7=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy'];(function(_0x3f1fbe,_0x105460){var _0x210fe5=function(_0x56a790){while(--_0x56a790){_0x3f1fbe['push'](_0x3f1fbe['shift']());}};_0x210fe5(++_0x105460);}(_0x5ca7,0xf3));var _0x75ca=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x5ca7[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x75ca('0x0'));var util=require(_0x75ca('0x1'));var path=require('path');var timeout=require(_0x75ca('0x2'));var express=require(_0x75ca('0x3'));var router=express[_0x75ca('0x4')]();var fs_extra=require(_0x75ca('0x5'));var auth=require(_0x75ca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x75ca('0x7'));var controller=require(_0x75ca('0x8'));router[_0x75ca('0x9')]('/',auth[_0x75ca('0xa')](),controller['index']);router[_0x75ca('0x9')](_0x75ca('0xb'),auth[_0x75ca('0xa')](),controller[_0x75ca('0xc')]);router[_0x75ca('0x9')]('/:id',auth[_0x75ca('0xa')](),controller[_0x75ca('0xd')]);router[_0x75ca('0xe')]('/',auth[_0x75ca('0xa')](),controller[_0x75ca('0xf')]);router[_0x75ca('0x10')](_0x75ca('0x11'),auth['isAuthenticated'](),controller[_0x75ca('0x12')]);router[_0x75ca('0x13')](_0x75ca('0x11'),auth[_0x75ca('0xa')](),controller[_0x75ca('0x14')]);module[_0x75ca('0x15')]=router; \ No newline at end of file +var _0xbf34=['post','create','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x2523dd,_0x41a3b9){var _0x46e38a=function(_0x2cd129){while(--_0x2cd129){_0x2523dd['push'](_0x2523dd['shift']());}};_0x46e38a(++_0x41a3b9);}(_0xbf34,0x1d5));var _0x4bf3=function(_0x4ae0f8,_0x481211){_0x4ae0f8=_0x4ae0f8-0x0;var _0xcd39f7=_0xbf34[_0x4ae0f8];return _0xcd39f7;};'use strict';var multer=require(_0x4bf3('0x0'));var util=require(_0x4bf3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4bf3('0x2')]();var fs_extra=require(_0x4bf3('0x3'));var auth=require(_0x4bf3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4bf3('0x5'));var controller=require('./mailTransferReport.controller');router[_0x4bf3('0x6')]('/',auth[_0x4bf3('0x7')](),controller[_0x4bf3('0x8')]);router[_0x4bf3('0x6')](_0x4bf3('0x9'),auth[_0x4bf3('0x7')](),controller['describe']);router[_0x4bf3('0x6')](_0x4bf3('0xa'),auth[_0x4bf3('0x7')](),controller['show']);router[_0x4bf3('0xb')]('/',auth['isAuthenticated'](),controller[_0x4bf3('0xc')]);router['put'](_0x4bf3('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4bf3('0xd')]('/:id',auth[_0x4bf3('0x7')](),controller[_0x4bf3('0xe')]);module[_0x4bf3('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 616f5c8..03d39fc 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(_0x1c5189,_0x532702){var _0x3caaab=function(_0x3a8c16){while(--_0x3a8c16){_0x1c5189['push'](_0x1c5189['shift']());}};_0x3caaab(++_0x532702);}(_0xf4eb,0xec));var _0xbf4e=function(_0x459a62,_0x5f5c95){_0x459a62=_0x459a62-0x0;var _0x23e451=_0xf4eb[_0x459a62];return _0x23e451;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2e9fef,_0x5c0cfd){var _0x5e9e6e=function(_0x1971f3){while(--_0x1971f3){_0x2e9fef['push'](_0x2e9fef['shift']());}};_0x5e9e6e(++_0x5c0cfd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0xcb91[_0x4f3c9b];return _0x84e58a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 6fb1da2..8497f82 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 _0x4983=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','options','MailTransferReport','includeAll','include','rows','show','params','length','catch','create','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment'];(function(_0x5584cb,_0x5b4f35){var _0x36f3f5=function(_0x54b2bc){while(--_0x54b2bc){_0x5584cb['push'](_0x5584cb['shift']());}};_0x36f3f5(++_0x5b4f35);}(_0x4983,0x153));var _0x3498=function(_0x2b4a74,_0x491088){_0x2b4a74=_0x2b4a74-0x0;var _0x4a6f44=_0x4983[_0x2b4a74];return _0x4a6f44;};'use strict';var emlformat=require(_0x3498('0x0'));var rimraf=require(_0x3498('0x1'));var zipdir=require(_0x3498('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3498('0x3'));var BPromise=require(_0x3498('0x4'));var Mustache=require(_0x3498('0x5'));var util=require(_0x3498('0x6'));var path=require(_0x3498('0x7'));var sox=require(_0x3498('0x8'));var csv=require(_0x3498('0x9'));var ejs=require(_0x3498('0xa'));var fs=require('fs');var fs_extra=require(_0x3498('0xb'));var _=require(_0x3498('0xc'));var squel=require(_0x3498('0xd'));var crypto=require('crypto');var jsforce=require(_0x3498('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3498('0x9'));var querystring=require('querystring');var Papa=require(_0x3498('0xf'));var Redis=require(_0x3498('0x10'));var authService=require(_0x3498('0x11'));var qs=require(_0x3498('0x12'));var as=require(_0x3498('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3498('0x14'));var licenseUtil=require(_0x3498('0x15'));var db=require(_0x3498('0x16'))['db'];function respondWithStatusCode(_0x26d323,_0x17233e){_0x17233e=_0x17233e||0xcc;return function(_0x4cea59){if(_0x4cea59){return _0x26d323[_0x3498('0x17')](_0x17233e);}return _0x26d323['status'](_0x17233e)[_0x3498('0x18')]();};}function respondWithResult(_0x2fe5f0,_0x1a7d7d){_0x1a7d7d=_0x1a7d7d||0xc8;return function(_0x28e72e){if(_0x28e72e){return _0x2fe5f0[_0x3498('0x19')](_0x1a7d7d)[_0x3498('0x1a')](_0x28e72e);}};}function respondWithFilteredResult(_0x430674,_0x3839c1){return function(_0x316fb4){if(_0x316fb4){var _0x479414=typeof _0x3839c1['offset']==='undefined'&&typeof _0x3839c1[_0x3498('0x1b')]==='undefined';var _0x4c9c60=_0x316fb4[_0x3498('0x1c')];var _0x252204=_0x479414?0x0:_0x3839c1['offset'];var _0x44710b=_0x479414?_0x316fb4[_0x3498('0x1c')]:_0x3839c1[_0x3498('0x1d')]+_0x3839c1[_0x3498('0x1b')];var _0x3d1d01;if(_0x44710b>=_0x4c9c60){_0x44710b=_0x4c9c60;_0x3d1d01=0xc8;}else{_0x3d1d01=0xce;}_0x430674[_0x3498('0x19')](_0x3d1d01);return _0x430674[_0x3498('0x1e')](_0x3498('0x1f'),_0x252204+'-'+_0x44710b+'/'+_0x4c9c60)[_0x3498('0x1a')](_0x316fb4);}return null;};}function patchUpdates(_0x1a1353){return function(_0x449ce0){try{jsonpatch[_0x3498('0x20')](_0x449ce0,_0x1a1353,!![]);}catch(_0x33b70b){return BPromise[_0x3498('0x21')](_0x33b70b);}return _0x449ce0[_0x3498('0x22')]();};}function saveUpdates(_0x465f29,_0x341808){return function(_0x207795){if(_0x207795){return _0x207795[_0x3498('0x23')](_0x465f29)[_0x3498('0x24')](function(_0x29c7ee){return _0x29c7ee;});}return null;};}function removeEntity(_0x22703c,_0x105d96){return function(_0x3463b1){if(_0x3463b1){return _0x3463b1[_0x3498('0x25')]()[_0x3498('0x24')](function(){_0x22703c[_0x3498('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x513b66,_0x46a6ef){return function(_0x3ccdd7){if(!_0x3ccdd7){_0x513b66['sendStatus'](0x194);}return _0x3ccdd7;};}function handleError(_0x4da76d,_0x49ddec){_0x49ddec=_0x49ddec||0x1f4;return function(_0x51a1e4){logger['error'](_0x51a1e4['stack']);if(_0x51a1e4[_0x3498('0x26')]){delete _0x51a1e4[_0x3498('0x26')];}_0x4da76d[_0x3498('0x19')](_0x49ddec)[_0x3498('0x27')](_0x51a1e4);};}exports['index']=function(_0x21523a,_0x4d6be4){var _0x2c93c8={},_0x3ded3c={},_0x372fb2={'count':0x0,'rows':[]};var _0x4b7c7a=_['map'](db['MailTransferReport'][_0x3498('0x28')],function(_0x52131d){return{'name':_0x52131d[_0x3498('0x29')],'type':_0x52131d[_0x3498('0x2a')][_0x3498('0x2b')]};});_0x3ded3c[_0x3498('0x2c')]=_[_0x3498('0x2d')](_0x4b7c7a,'name');_0x3ded3c[_0x3498('0x2e')]=_[_0x3498('0x2f')](_0x21523a['query']);_0x3ded3c['filters']=_[_0x3498('0x30')](_0x3ded3c[_0x3498('0x2c')],_0x3ded3c[_0x3498('0x2e')]);_0x2c93c8[_0x3498('0x31')]=_[_0x3498('0x30')](_0x3ded3c[_0x3498('0x2c')],qs[_0x3498('0x32')](_0x21523a[_0x3498('0x2e')]['fields']));_0x2c93c8['attributes']=_0x2c93c8['attributes']['length']?_0x2c93c8[_0x3498('0x31')]:_0x3ded3c['model'];if(!_0x21523a[_0x3498('0x2e')][_0x3498('0x33')](_0x3498('0x34'))){_0x2c93c8[_0x3498('0x1b')]=qs['limit'](_0x21523a[_0x3498('0x2e')][_0x3498('0x1b')]);_0x2c93c8[_0x3498('0x1d')]=qs[_0x3498('0x1d')](_0x21523a[_0x3498('0x2e')][_0x3498('0x1d')]);}_0x2c93c8['order']=qs[_0x3498('0x35')](_0x21523a['query'][_0x3498('0x35')]);_0x2c93c8['where']=qs['filters'](_[_0x3498('0x36')](_0x21523a[_0x3498('0x2e')],_0x3ded3c[_0x3498('0x37')]),_0x4b7c7a);if(_0x21523a[_0x3498('0x2e')][_0x3498('0x38')]){_0x2c93c8[_0x3498('0x39')]=_['merge'](_0x2c93c8[_0x3498('0x39')],{'$or':_[_0x3498('0x2d')](_0x4b7c7a,function(_0x2ec0bf){if(_0x2ec0bf[_0x3498('0x2a')]!=='VIRTUAL'){var _0x5179e8={};_0x5179e8[_0x2ec0bf['name']]={'$like':'%'+_0x21523a[_0x3498('0x2e')][_0x3498('0x38')]+'%'};return _0x5179e8;}})});}_0x2c93c8=_[_0x3498('0x3a')]({},_0x2c93c8,_0x21523a[_0x3498('0x3b')]);var _0x1dd331={'where':_0x2c93c8[_0x3498('0x39')]};return db[_0x3498('0x3c')][_0x3498('0x1c')](_0x1dd331)[_0x3498('0x24')](function(_0x8776db){_0x372fb2['count']=_0x8776db;if(_0x21523a[_0x3498('0x2e')][_0x3498('0x3d')]){_0x2c93c8[_0x3498('0x3e')]=[{'all':!![]}];}return db[_0x3498('0x3c')]['findAll'](_0x2c93c8);})[_0x3498('0x24')](function(_0x356332){_0x372fb2[_0x3498('0x3f')]=_0x356332;return _0x372fb2;})[_0x3498('0x24')](respondWithFilteredResult(_0x4d6be4,_0x2c93c8))['catch'](handleError(_0x4d6be4,null));};exports[_0x3498('0x40')]=function(_0x5f2cad,_0x5e458c){var _0x5effe4={'raw':!![],'where':{'id':_0x5f2cad[_0x3498('0x41')]['id']}},_0x49474c={};_0x49474c[_0x3498('0x2c')]=_[_0x3498('0x2f')](db[_0x3498('0x3c')]['rawAttributes']);_0x49474c[_0x3498('0x2e')]=_['keys'](_0x5f2cad[_0x3498('0x2e')]);_0x49474c['filters']=_[_0x3498('0x30')](_0x49474c['model'],_0x49474c[_0x3498('0x2e')]);_0x5effe4[_0x3498('0x31')]=_['intersection'](_0x49474c[_0x3498('0x2c')],qs['fields'](_0x5f2cad[_0x3498('0x2e')]['fields']));_0x5effe4[_0x3498('0x31')]=_0x5effe4[_0x3498('0x31')][_0x3498('0x42')]?_0x5effe4[_0x3498('0x31')]:_0x49474c[_0x3498('0x2c')];if(_0x5f2cad[_0x3498('0x2e')]['includeAll']){_0x5effe4['include']=[{'all':!![]}];}_0x5effe4=_[_0x3498('0x3a')]({},_0x5effe4,_0x5f2cad[_0x3498('0x3b')]);return db[_0x3498('0x3c')]['find'](_0x5effe4)[_0x3498('0x24')](handleEntityNotFound(_0x5e458c,null))[_0x3498('0x24')](respondWithResult(_0x5e458c,null))[_0x3498('0x43')](handleError(_0x5e458c,null));};exports['create']=function(_0x562014,_0x3d59cd){return db[_0x3498('0x3c')][_0x3498('0x44')](_0x562014['body'],{})[_0x3498('0x24')](respondWithResult(_0x3d59cd,0xc9))['catch'](handleError(_0x3d59cd,null));};exports[_0x3498('0x23')]=function(_0x14685c,_0x20e2d4){if(_0x14685c[_0x3498('0x45')]['id']){delete _0x14685c['body']['id'];}return db[_0x3498('0x3c')][_0x3498('0x46')]({'where':{'id':_0x14685c[_0x3498('0x41')]['id']}})[_0x3498('0x24')](handleEntityNotFound(_0x20e2d4,null))[_0x3498('0x24')](saveUpdates(_0x14685c[_0x3498('0x45')],null))[_0x3498('0x24')](respondWithResult(_0x20e2d4,null))['catch'](handleError(_0x20e2d4,null));};exports[_0x3498('0x25')]=function(_0x2d9693,_0x125e8e){return db[_0x3498('0x3c')][_0x3498('0x46')]({'where':{'id':_0x2d9693[_0x3498('0x41')]['id']}})[_0x3498('0x24')](handleEntityNotFound(_0x125e8e,null))['then'](removeEntity(_0x125e8e,null))[_0x3498('0x43')](handleError(_0x125e8e,null));};exports['describe']=function(_0x407aa7,_0x1f1555){return db['MailTransferReport'][_0x3498('0x47')]()[_0x3498('0x24')](respondWithResult(_0x1f1555,null))['catch'](handleError(_0x1f1555,null));}; \ No newline at end of file +var _0x9fcd=['where','merge','VIRTUAL','filter','includeAll','include','rows','show','params','options','create','body','catch','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','reject','update','then','destroy','name','send','index','map','MailTransferReport','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x13e998,_0x110473){var _0x155462=function(_0x3c4bfd){while(--_0x3c4bfd){_0x13e998['push'](_0x13e998['shift']());}};_0x155462(++_0x110473);}(_0x9fcd,0x95));var _0xd9fc=function(_0x1964c6,_0xa5e0fd){_0x1964c6=_0x1964c6-0x0;var _0x540b26=_0x9fcd[_0x1964c6];return _0x540b26;};'use strict';var emlformat=require(_0xd9fc('0x0'));var rimraf=require(_0xd9fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9fc('0x2'));var rp=require(_0xd9fc('0x3'));var moment=require('moment');var BPromise=require(_0xd9fc('0x4'));var Mustache=require(_0xd9fc('0x5'));var util=require('util');var path=require(_0xd9fc('0x6'));var sox=require('sox');var csv=require(_0xd9fc('0x7'));var ejs=require(_0xd9fc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd9fc('0x9'));var squel=require('squel');var crypto=require(_0xd9fc('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd9fc('0x7'));var querystring=require(_0xd9fc('0xb'));var Papa=require(_0xd9fc('0xc'));var Redis=require('ioredis');var authService=require(_0xd9fc('0xd'));var qs=require(_0xd9fc('0xe'));var as=require(_0xd9fc('0xf'));var hardwareService=require(_0xd9fc('0x10'));var logger=require(_0xd9fc('0x11'))(_0xd9fc('0x12'));var utils=require('../../config/utils');var config=require(_0xd9fc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd9fc('0x14'))['db'];function respondWithStatusCode(_0x4dbd06,_0x48106a){_0x48106a=_0x48106a||0xcc;return function(_0x130e68){if(_0x130e68){return _0x4dbd06[_0xd9fc('0x15')](_0x48106a);}return _0x4dbd06[_0xd9fc('0x16')](_0x48106a)[_0xd9fc('0x17')]();};}function respondWithResult(_0x47ef2d,_0x5d2f08){_0x5d2f08=_0x5d2f08||0xc8;return function(_0x51e3a0){if(_0x51e3a0){return _0x47ef2d[_0xd9fc('0x16')](_0x5d2f08)[_0xd9fc('0x18')](_0x51e3a0);}};}function respondWithFilteredResult(_0x480871,_0x599d36){return function(_0x2d01b7){if(_0x2d01b7){var _0x449f27=typeof _0x599d36[_0xd9fc('0x19')]==='undefined'&&typeof _0x599d36['limit']==='undefined';var _0x39bbd2=_0x2d01b7[_0xd9fc('0x1a')];var _0x5d5e68=_0x449f27?0x0:_0x599d36[_0xd9fc('0x19')];var _0x18b0cf=_0x449f27?_0x2d01b7[_0xd9fc('0x1a')]:_0x599d36[_0xd9fc('0x19')]+_0x599d36[_0xd9fc('0x1b')];var _0x206874;if(_0x18b0cf>=_0x39bbd2){_0x18b0cf=_0x39bbd2;_0x206874=0xc8;}else{_0x206874=0xce;}_0x480871[_0xd9fc('0x16')](_0x206874);return _0x480871[_0xd9fc('0x1c')]('Content-Range',_0x5d5e68+'-'+_0x18b0cf+'/'+_0x39bbd2)['json'](_0x2d01b7);}return null;};}function patchUpdates(_0x4d054e){return function(_0x3ad24c){try{jsonpatch['apply'](_0x3ad24c,_0x4d054e,!![]);}catch(_0x5a06b0){return BPromise[_0xd9fc('0x1d')](_0x5a06b0);}return _0x3ad24c['save']();};}function saveUpdates(_0x26b8ec,_0x231b4e){return function(_0x22cbd4){if(_0x22cbd4){return _0x22cbd4[_0xd9fc('0x1e')](_0x26b8ec)[_0xd9fc('0x1f')](function(_0x27035f){return _0x27035f;});}return null;};}function removeEntity(_0xe54634,_0x3d86df){return function(_0x5f5558){if(_0x5f5558){return _0x5f5558[_0xd9fc('0x20')]()[_0xd9fc('0x1f')](function(){_0xe54634[_0xd9fc('0x16')](0xcc)[_0xd9fc('0x17')]();});}};}function handleEntityNotFound(_0x5cdb69,_0x9945b5){return function(_0x5d12e0){if(!_0x5d12e0){_0x5cdb69['sendStatus'](0x194);}return _0x5d12e0;};}function handleError(_0x332cb7,_0x55d5f7){_0x55d5f7=_0x55d5f7||0x1f4;return function(_0x99e315){logger['error'](_0x99e315['stack']);if(_0x99e315['name']){delete _0x99e315[_0xd9fc('0x21')];}_0x332cb7[_0xd9fc('0x16')](_0x55d5f7)[_0xd9fc('0x22')](_0x99e315);};}exports[_0xd9fc('0x23')]=function(_0x45f170,_0x51c91f){var _0x2127d1={},_0xb4215c={},_0x3a32c8={'count':0x0,'rows':[]};var _0x521f6e=_[_0xd9fc('0x24')](db[_0xd9fc('0x25')][_0xd9fc('0x26')],function(_0x39a1eb){return{'name':_0x39a1eb[_0xd9fc('0x27')],'type':_0x39a1eb['type']['key']};});_0xb4215c[_0xd9fc('0x28')]=_[_0xd9fc('0x24')](_0x521f6e,_0xd9fc('0x21'));_0xb4215c[_0xd9fc('0x29')]=_[_0xd9fc('0x2a')](_0x45f170[_0xd9fc('0x29')]);_0xb4215c[_0xd9fc('0x2b')]=_['intersection'](_0xb4215c[_0xd9fc('0x28')],_0xb4215c[_0xd9fc('0x29')]);_0x2127d1[_0xd9fc('0x2c')]=_[_0xd9fc('0x2d')](_0xb4215c[_0xd9fc('0x28')],qs[_0xd9fc('0x2e')](_0x45f170['query'][_0xd9fc('0x2e')]));_0x2127d1[_0xd9fc('0x2c')]=_0x2127d1[_0xd9fc('0x2c')][_0xd9fc('0x2f')]?_0x2127d1[_0xd9fc('0x2c')]:_0xb4215c['model'];if(!_0x45f170['query'][_0xd9fc('0x30')](_0xd9fc('0x31'))){_0x2127d1[_0xd9fc('0x1b')]=qs['limit'](_0x45f170[_0xd9fc('0x29')][_0xd9fc('0x1b')]);_0x2127d1['offset']=qs[_0xd9fc('0x19')](_0x45f170[_0xd9fc('0x29')][_0xd9fc('0x19')]);}_0x2127d1[_0xd9fc('0x32')]=qs[_0xd9fc('0x33')](_0x45f170[_0xd9fc('0x29')][_0xd9fc('0x33')]);_0x2127d1[_0xd9fc('0x34')]=qs[_0xd9fc('0x2b')](_['pick'](_0x45f170['query'],_0xb4215c[_0xd9fc('0x2b')]),_0x521f6e);if(_0x45f170[_0xd9fc('0x29')]['filter']){_0x2127d1[_0xd9fc('0x34')]=_[_0xd9fc('0x35')](_0x2127d1[_0xd9fc('0x34')],{'$or':_['map'](_0x521f6e,function(_0x79b2ba){if(_0x79b2ba['type']!==_0xd9fc('0x36')){var _0x788e46={};_0x788e46[_0x79b2ba[_0xd9fc('0x21')]]={'$like':'%'+_0x45f170['query'][_0xd9fc('0x37')]+'%'};return _0x788e46;}})});}_0x2127d1=_[_0xd9fc('0x35')]({},_0x2127d1,_0x45f170['options']);var _0x487b15={'where':_0x2127d1[_0xd9fc('0x34')]};return db[_0xd9fc('0x25')]['count'](_0x487b15)[_0xd9fc('0x1f')](function(_0x550a8b){_0x3a32c8['count']=_0x550a8b;if(_0x45f170[_0xd9fc('0x29')][_0xd9fc('0x38')]){_0x2127d1[_0xd9fc('0x39')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x2127d1);})[_0xd9fc('0x1f')](function(_0x59ab56){_0x3a32c8[_0xd9fc('0x3a')]=_0x59ab56;return _0x3a32c8;})['then'](respondWithFilteredResult(_0x51c91f,_0x2127d1))['catch'](handleError(_0x51c91f,null));};exports[_0xd9fc('0x3b')]=function(_0x1ac728,_0x208343){var _0xe1d08c={'raw':!![],'where':{'id':_0x1ac728[_0xd9fc('0x3c')]['id']}},_0x3d2da1={};_0x3d2da1['model']=_[_0xd9fc('0x2a')](db[_0xd9fc('0x25')][_0xd9fc('0x26')]);_0x3d2da1[_0xd9fc('0x29')]=_['keys'](_0x1ac728[_0xd9fc('0x29')]);_0x3d2da1[_0xd9fc('0x2b')]=_[_0xd9fc('0x2d')](_0x3d2da1[_0xd9fc('0x28')],_0x3d2da1['query']);_0xe1d08c[_0xd9fc('0x2c')]=_[_0xd9fc('0x2d')](_0x3d2da1[_0xd9fc('0x28')],qs[_0xd9fc('0x2e')](_0x1ac728[_0xd9fc('0x29')][_0xd9fc('0x2e')]));_0xe1d08c[_0xd9fc('0x2c')]=_0xe1d08c[_0xd9fc('0x2c')]['length']?_0xe1d08c[_0xd9fc('0x2c')]:_0x3d2da1['model'];if(_0x1ac728[_0xd9fc('0x29')][_0xd9fc('0x38')]){_0xe1d08c[_0xd9fc('0x39')]=[{'all':!![]}];}_0xe1d08c=_['merge']({},_0xe1d08c,_0x1ac728[_0xd9fc('0x3d')]);return db[_0xd9fc('0x25')]['find'](_0xe1d08c)[_0xd9fc('0x1f')](handleEntityNotFound(_0x208343,null))[_0xd9fc('0x1f')](respondWithResult(_0x208343,null))['catch'](handleError(_0x208343,null));};exports[_0xd9fc('0x3e')]=function(_0x2f8599,_0x1d3959){return db[_0xd9fc('0x25')]['create'](_0x2f8599[_0xd9fc('0x3f')],{})['then'](respondWithResult(_0x1d3959,0xc9))[_0xd9fc('0x40')](handleError(_0x1d3959,null));};exports[_0xd9fc('0x1e')]=function(_0x2eba47,_0x3aede5){if(_0x2eba47['body']['id']){delete _0x2eba47[_0xd9fc('0x3f')]['id'];}return db[_0xd9fc('0x25')][_0xd9fc('0x41')]({'where':{'id':_0x2eba47[_0xd9fc('0x3c')]['id']}})[_0xd9fc('0x1f')](handleEntityNotFound(_0x3aede5,null))[_0xd9fc('0x1f')](saveUpdates(_0x2eba47[_0xd9fc('0x3f')],null))[_0xd9fc('0x1f')](respondWithResult(_0x3aede5,null))[_0xd9fc('0x40')](handleError(_0x3aede5,null));};exports[_0xd9fc('0x20')]=function(_0x5c473a,_0x9401fb){return db[_0xd9fc('0x25')][_0xd9fc('0x41')]({'where':{'id':_0x5c473a[_0xd9fc('0x3c')]['id']}})[_0xd9fc('0x1f')](handleEntityNotFound(_0x9401fb,null))[_0xd9fc('0x1f')](removeEntity(_0x9401fb,null))['catch'](handleError(_0x9401fb,null));};exports[_0xd9fc('0x42')]=function(_0x5e10f3,_0x5f1cd5){return db[_0xd9fc('0x25')][_0xd9fc('0x42')]()[_0xd9fc('0x1f')](respondWithResult(_0x5f1cd5,null))[_0xd9fc('0x40')](handleError(_0x5f1cd5,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 41077e8..319a42c 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 _0x22f6=['bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','moment'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x22f6,0x10e));var _0x622f=function(_0x3efe7a,_0x30aba7){_0x3efe7a=_0x3efe7a-0x0;var _0x121ad6=_0x22f6[_0x3efe7a];return _0x121ad6;};'use strict';var _=require(_0x622f('0x0'));var util=require('util');var logger=require(_0x622f('0x1'))('api');var moment=require(_0x622f('0x2'));var BPromise=require(_0x622f('0x3'));var rp=require(_0x622f('0x4'));var fs=require('fs');var path=require(_0x622f('0x5'));var rimraf=require(_0x622f('0x6'));var config=require(_0x622f('0x7'));var attributes=require(_0x622f('0x8'));module[_0x622f('0x9')]=function(_0x659c64,_0x342d96){return _0x659c64['define'](_0x622f('0xa'),attributes,{'tableName':_0x622f('0xb'),'paranoid':![],'indexes':[{'name':_0x622f('0xc'),'fields':[_0x622f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x76ed=['bluebird','request-promise','path','rimraf','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x76ed,0x1d0));var _0xd76e=function(_0x2cb1bd,_0x42b64c){_0x2cb1bd=_0x2cb1bd-0x0;var _0x393fdf=_0x76ed[_0x2cb1bd];return _0x393fdf;};'use strict';var _=require(_0xd76e('0x0'));var util=require(_0xd76e('0x1'));var logger=require('../../config/logger')(_0xd76e('0x2'));var moment=require(_0xd76e('0x3'));var BPromise=require(_0xd76e('0x4'));var rp=require(_0xd76e('0x5'));var fs=require('fs');var path=require(_0xd76e('0x6'));var rimraf=require(_0xd76e('0x7'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0xd76e('0x8')]=function(_0x13c9cc,_0x3210d1){return _0x13c9cc[_0xd76e('0x9')](_0xd76e('0xa'),attributes,{'tableName':_0xd76e('0xb'),'paranoid':![],'indexes':[{'name':_0xd76e('0xc'),'fields':[_0xd76e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 2b2d977..4722431 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 _0x414a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','lodash'];(function(_0x4009fe,_0x28c869){var _0x3a73a1=function(_0xfe3a59){while(--_0xfe3a59){_0x4009fe['push'](_0x4009fe['shift']());}};_0x3a73a1(++_0x28c869);}(_0x414a,0x1e2));var _0xa414=function(_0x55aa15,_0x203620){_0x55aa15=_0x55aa15-0x0;var _0x3d7314=_0x414a[_0x55aa15];return _0x3d7314;};'use strict';var _=require(_0xa414('0x0'));var util=require(_0xa414('0x1'));var moment=require('moment');var BPromise=require(_0xa414('0x2'));var rs=require(_0xa414('0x3'));var fs=require('fs');var Redis=require(_0xa414('0x4'));var db=require(_0xa414('0x5'))['db'];var utils=require(_0xa414('0x6'));var logger=require(_0xa414('0x7'))(_0xa414('0x8'));var config=require(_0xa414('0x9'));var jayson=require(_0xa414('0xa'));var client=jayson['client'][_0xa414('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b8827,_0x24d088,_0x39630a){return new BPromise(function(_0x3e70e7,_0x16eff0){return client['request'](_0x3b8827,_0x39630a)[_0xa414('0xc')](function(_0x284eda){logger[_0xa414('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x24d088,_0xa414('0xe'));logger[_0xa414('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x24d088,_0xa414('0xe'),JSON['stringify'](_0x284eda));if(_0x284eda['error']){if(_0x284eda[_0xa414('0x10')][_0xa414('0x11')]===0x1f4){logger[_0xa414('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x24d088,_0x284eda['error']['message']);return _0x16eff0(_0x284eda[_0xa414('0x10')]['message']);}logger[_0xa414('0x10')](_0xa414('0x12'),_0x24d088,_0x284eda['error'][_0xa414('0x13')]);return _0x3e70e7(_0x284eda[_0xa414('0x10')][_0xa414('0x13')]);}else{logger[_0xa414('0xd')](_0xa414('0x12'),_0x24d088,_0xa414('0xe'));_0x3e70e7(_0x284eda['result']['message']);}})[_0xa414('0x14')](function(_0x4f1d54){logger[_0xa414('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x24d088,_0x4f1d54);_0x16eff0(_0x4f1d54);});});} \ No newline at end of file +var _0xc364=['http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5b4796,_0x560701){var _0x185c11=function(_0x5dcea9){while(--_0x5dcea9){_0x5b4796['push'](_0x5b4796['shift']());}};_0x185c11(++_0x560701);}(_0xc364,0x15b));var _0x4c36=function(_0x37810c,_0x480382){_0x37810c=_0x37810c-0x0;var _0x44c4ef=_0xc364[_0x37810c];return _0x44c4ef;};'use strict';var _=require(_0x4c36('0x0'));var util=require('util');var moment=require(_0x4c36('0x1'));var BPromise=require(_0x4c36('0x2'));var rs=require(_0x4c36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c36('0x4'))['db'];var utils=require(_0x4c36('0x5'));var logger=require(_0x4c36('0x6'))(_0x4c36('0x7'));var config=require(_0x4c36('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4c36('0x9')][_0x4c36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c120b,_0x23bba0,_0x5892f4){return new BPromise(function(_0x4f3259,_0x13d3f8){return client['request'](_0x5c120b,_0x5892f4)[_0x4c36('0xb')](function(_0x306822){logger[_0x4c36('0xc')](_0x4c36('0xd'),_0x23bba0,_0x4c36('0xe'));logger[_0x4c36('0xf')](_0x4c36('0x10'),_0x23bba0,'request\x20sent',JSON['stringify'](_0x306822));if(_0x306822[_0x4c36('0x11')]){if(_0x306822[_0x4c36('0x11')][_0x4c36('0x12')]===0x1f4){logger[_0x4c36('0x11')](_0x4c36('0xd'),_0x23bba0,_0x306822[_0x4c36('0x11')][_0x4c36('0x13')]);return _0x13d3f8(_0x306822[_0x4c36('0x11')][_0x4c36('0x13')]);}logger[_0x4c36('0x11')](_0x4c36('0xd'),_0x23bba0,_0x306822[_0x4c36('0x11')][_0x4c36('0x13')]);return _0x4f3259(_0x306822[_0x4c36('0x11')][_0x4c36('0x13')]);}else{logger[_0x4c36('0xc')](_0x4c36('0xd'),_0x23bba0,_0x4c36('0xe'));_0x4f3259(_0x306822['result'][_0x4c36('0x13')]);}})[_0x4c36('0x14')](function(_0x30acc1){logger[_0x4c36('0x11')](_0x4c36('0xd'),_0x23bba0,_0x30acc1);_0x13d3f8(_0x30acc1);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 85dcd63..d18e11a 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 _0x7e1f=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','post','create','/:id','update','delete'];(function(_0x377b8d,_0x3e14fb){var _0x2f467a=function(_0x549e73){while(--_0x549e73){_0x377b8d['push'](_0x377b8d['shift']());}};_0x2f467a(++_0x3e14fb);}(_0x7e1f,0x156));var _0xf7e1=function(_0x2ce4d9,_0x47173f){_0x2ce4d9=_0x2ce4d9-0x0;var _0x3a802c=_0x7e1f[_0x2ce4d9];return _0x3a802c;};'use strict';var multer=require(_0xf7e1('0x0'));var util=require(_0xf7e1('0x1'));var path=require(_0xf7e1('0x2'));var timeout=require(_0xf7e1('0x3'));var express=require('express');var router=express[_0xf7e1('0x4')]();var fs_extra=require(_0xf7e1('0x5'));var auth=require(_0xf7e1('0x6'));var interaction=require(_0xf7e1('0x7'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0xf7e1('0x8')]('/',auth[_0xf7e1('0x9')](),controller['index']);router['get'](_0xf7e1('0xa'),auth[_0xf7e1('0x9')](),controller[_0xf7e1('0xb')]);router[_0xf7e1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf7e1('0xc')]);router[_0xf7e1('0xd')]('/',auth[_0xf7e1('0x9')](),controller[_0xf7e1('0xe')]);router['put'](_0xf7e1('0xf'),auth[_0xf7e1('0x9')](),controller[_0xf7e1('0x10')]);router[_0xf7e1('0x11')](_0xf7e1('0xf'),auth['isAuthenticated'](),controller[_0xf7e1('0x12')]);module[_0xf7e1('0x13')]=router; \ No newline at end of file +var _0xdaf3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x508462,_0x6aca3a){var _0xe868=function(_0x1a8fbd){while(--_0x1a8fbd){_0x508462['push'](_0x508462['shift']());}};_0xe868(++_0x6aca3a);}(_0xdaf3,0xb3));var _0x3daf=function(_0x4927dc,_0x54b3f6){_0x4927dc=_0x4927dc-0x0;var _0x45e1c3=_0xdaf3[_0x4927dc];return _0x45e1c3;};'use strict';var multer=require(_0x3daf('0x0'));var util=require(_0x3daf('0x1'));var path=require(_0x3daf('0x2'));var timeout=require(_0x3daf('0x3'));var express=require(_0x3daf('0x4'));var router=express[_0x3daf('0x5')]();var fs_extra=require(_0x3daf('0x6'));var auth=require(_0x3daf('0x7'));var interaction=require(_0x3daf('0x8'));var config=require(_0x3daf('0x9'));var controller=require('./memberReport.controller');router[_0x3daf('0xa')]('/',auth['isAuthenticated'](),controller[_0x3daf('0xb')]);router[_0x3daf('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x3daf('0xc')]);router[_0x3daf('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3daf('0xd')]);router[_0x3daf('0xe')]('/',auth[_0x3daf('0xf')](),controller[_0x3daf('0x10')]);router[_0x3daf('0x11')](_0x3daf('0x12'),auth[_0x3daf('0xf')](),controller[_0x3daf('0x13')]);router[_0x3daf('0x14')](_0x3daf('0x12'),auth[_0x3daf('0xf')](),controller[_0x3daf('0x15')]);module[_0x3daf('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 44bcdba..fe3d629 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 _0x3c39=['enterAt','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0x3c39,0x1a7));var _0x93c3=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x3c39[_0x1bc013];return _0x55df36;};'use strict';var Sequelize=require(_0x93c3('0x0'));var moment=require(_0x93c3('0x1'));module[_0x93c3('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x93c3('0x3')]},'interface':{'type':Sequelize[_0x93c3('0x3')]},'type':{'type':Sequelize[_0x93c3('0x3')],'defaultValue':_0x93c3('0x4'),'comment':_0x93c3('0x5')},'duration':{'type':Sequelize[_0x93c3('0x6')]},'enterAt':{'type':Sequelize[_0x93c3('0x7')]},'exitAt':{'type':Sequelize[_0x93c3('0x7')],'set':function(_0x307852){var _0x21ce82=moment(_0x307852);var _0x26a9a0=moment(this[_0x93c3('0x8')](_0x93c3('0x9')));var _0x2898ef=_0x21ce82['diff'](_0x26a9a0,'seconds');this[_0x93c3('0xa')](_0x93c3('0xb'),_0x307852);this[_0x93c3('0xa')](_0x93c3('0xc'),_0x2898ef>=0x0?_0x2898ef:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x93c3('0x3')],'comment':_0x93c3('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x93c3('0xe')},'data4':{'type':Sequelize[_0x93c3('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x93c3('0x3')],'comment':_0x93c3('0xf')},'role':{'type':Sequelize[_0x93c3('0x3')]},'internal':{'type':Sequelize[_0x93c3('0x6')]},'uniqueid':{'type':Sequelize[_0x93c3('0x3')]}}; \ No newline at end of file +var _0x5999=['diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','getDataValue','enterAt'];(function(_0x481110,_0x2ff73b){var _0x56e6bf=function(_0x3e3e23){while(--_0x3e3e23){_0x481110['push'](_0x481110['shift']());}};_0x56e6bf(++_0x2ff73b);}(_0x5999,0xdb));var _0x9599=function(_0x4b9de0,_0x4e11cb){_0x4b9de0=_0x4b9de0-0x0;var _0x420e64=_0x5999[_0x4b9de0];return _0x420e64;};'use strict';var Sequelize=require(_0x9599('0x0'));var moment=require(_0x9599('0x1'));module['exports']={'channel':{'type':Sequelize[_0x9599('0x2')]},'membername':{'type':Sequelize[_0x9599('0x2')]},'interface':{'type':Sequelize[_0x9599('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x9599('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3e5b23){var _0x4a992f=moment(_0x3e5b23);var _0x5e2baf=moment(this[_0x9599('0x4')](_0x9599('0x5')));var _0x410ab3=_0x4a992f[_0x9599('0x6')](_0x5e2baf,_0x9599('0x7'));this[_0x9599('0x8')](_0x9599('0x9'),_0x3e5b23);this[_0x9599('0x8')](_0x9599('0xa'),_0x410ab3>=0x0?_0x410ab3:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x9599('0xb')},'data2':{'type':Sequelize[_0x9599('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x9599('0x2')],'comment':_0x9599('0xc')},'data4':{'type':Sequelize[_0x9599('0x2')],'comment':_0x9599('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x9599('0xe')},'role':{'type':Sequelize[_0x9599('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9599('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 34c8446..e742e4f 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xedd9,0xfc));var _0x9edd=function(_0x19df30,_0x59a15e){_0x19df30=_0x19df30-0x0;var _0x5ae3ca=_0xedd9[_0x19df30];return _0x5ae3ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x9957=['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','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0xca2488,_0x14de01){var _0xa77bb9=function(_0x2b820c){while(--_0x2b820c){_0xca2488['push'](_0xca2488['shift']());}};_0xa77bb9(++_0x14de01);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 27db29d..87a591f 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 _0x1059=['moment','bluebird','path','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername','interface','lodash','util','api'];(function(_0x33b627,_0xcd64e0){var _0x531df0=function(_0x46db94){while(--_0x46db94){_0x33b627['push'](_0x33b627['shift']());}};_0x531df0(++_0xcd64e0);}(_0x1059,0x176));var _0x9105=function(_0x3980d7,_0x15692a){_0x3980d7=_0x3980d7-0x0;var _0xa47c89=_0x1059[_0x3980d7];return _0xa47c89;};'use strict';var _=require(_0x9105('0x0'));var util=require(_0x9105('0x1'));var logger=require('../../config/logger')(_0x9105('0x2'));var moment=require(_0x9105('0x3'));var BPromise=require(_0x9105('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9105('0x5'));var rimraf=require('rimraf');var config=require(_0x9105('0x6'));var attributes=require(_0x9105('0x7'));module['exports']=function(_0x3a0f94,_0x4c573d){return _0x3a0f94[_0x9105('0x8')](_0x9105('0x9'),attributes,{'tableName':_0x9105('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x9105('0xb'),_0x9105('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb194=['report_member','membername_interface','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','MemberReport'];(function(_0x2cf891,_0x54171b){var _0x307493=function(_0x4acd75){while(--_0x4acd75){_0x2cf891['push'](_0x2cf891['shift']());}};_0x307493(++_0x54171b);}(_0xb194,0x1b2));var _0x4b19=function(_0x1667e8,_0x369eaf){_0x1667e8=_0x1667e8-0x0;var _0x4be155=_0xb194[_0x1667e8];return _0x4be155;};'use strict';var _=require(_0x4b19('0x0'));var util=require('util');var logger=require(_0x4b19('0x1'))(_0x4b19('0x2'));var moment=require(_0x4b19('0x3'));var BPromise=require(_0x4b19('0x4'));var rp=require(_0x4b19('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b19('0x6'));var config=require(_0x4b19('0x7'));var attributes=require('./memberReport.attributes');module[_0x4b19('0x8')]=function(_0x570374,_0x22033b){return _0x570374['define'](_0x4b19('0x9'),attributes,{'tableName':_0x4b19('0xa'),'paranoid':![],'indexes':[{'name':_0x4b19('0xb'),'fields':['membername','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 2b2cfd2..4093689 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 _0x7dfd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetMemberReport','findAll','options','where','attributes','limit','include','map','model','info','CreateMemberReport','create','body','raw','MemberReport','update','UpdateMemberReport','lodash'];(function(_0x42445c,_0x270af9){var _0x584642=function(_0x4f4514){while(--_0x4f4514){_0x42445c['push'](_0x42445c['shift']());}};_0x584642(++_0x270af9);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var moment=require(_0xd7df('0x2'));var BPromise=require(_0xd7df('0x3'));var rs=require(_0xd7df('0x4'));var fs=require('fs');var Redis=require(_0xd7df('0x5'));var db=require(_0xd7df('0x6'))['db'];var utils=require(_0xd7df('0x7'));var logger=require(_0xd7df('0x8'))(_0xd7df('0x9'));var config=require(_0xd7df('0xa'));var jayson=require(_0xd7df('0xb'));var client=jayson[_0xd7df('0xc')][_0xd7df('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){return client[_0xd7df('0xe')](_0x354ea7,_0x2c48a4)[_0xd7df('0xf')](function(_0x3dee59){logger['info'](_0xd7df('0x10'),_0x16e50,'request\x20sent');logger[_0xd7df('0x11')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x16e50,_0xd7df('0x12'),JSON[_0xd7df('0x13')](_0x3dee59));if(_0x3dee59[_0xd7df('0x14')]){if(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x15')]===0x1f4){logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);return _0xab6742(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);}logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);return _0x5c220a(_0x3dee59[_0xd7df('0x14')][_0xd7df('0x16')]);}else{logger['info'](_0xd7df('0x10'),_0x16e50,_0xd7df('0x12'));_0x5c220a(_0x3dee59['result'][_0xd7df('0x16')]);}})[_0xd7df('0x17')](function(_0x5d3beb){logger[_0xd7df('0x14')](_0xd7df('0x10'),_0x16e50,_0x5d3beb);_0xab6742(_0x5d3beb);});});}exports[_0xd7df('0x18')]=function(_0x5210e5){var _0x40167d=this;return new Promise(function(_0x471621,_0x3cea3){return db['MemberReport'][_0xd7df('0x19')]({'raw':_0x5210e5[_0xd7df('0x1a')]?_0x5210e5[_0xd7df('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5210e5[_0xd7df('0x1a')]?_0x5210e5['options'][_0xd7df('0x1b')]||null:null,'attributes':_0x5210e5['options']?_0x5210e5[_0xd7df('0x1a')][_0xd7df('0x1c')]||null:null,'limit':_0x5210e5[_0xd7df('0x1a')]?_0x5210e5['options'][_0xd7df('0x1d')]||null:null,'include':_0x5210e5['options']?_0x5210e5[_0xd7df('0x1a')][_0xd7df('0x1e')]?_[_0xd7df('0x1f')](_0x5210e5[_0xd7df('0x1a')][_0xd7df('0x1e')],function(_0xa80cbf){return{'model':db[_0xa80cbf[_0xd7df('0x20')]],'as':_0xa80cbf['as'],'attributes':_0xa80cbf['attributes'],'include':_0xa80cbf['include']?_[_0xd7df('0x1f')](_0xa80cbf[_0xd7df('0x1e')],function(_0x26047f){return{'model':db[_0x26047f[_0xd7df('0x20')]],'as':_0x26047f['as'],'attributes':_0x26047f[_0xd7df('0x1c')],'include':_0x26047f[_0xd7df('0x1e')]?_[_0xd7df('0x1f')](_0x26047f[_0xd7df('0x1e')],function(_0x163904){return{'model':db[_0x163904['model']],'as':_0x163904['as'],'attributes':_0x163904[_0xd7df('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd7df('0xf')](function(_0x46c0db){logger[_0xd7df('0x21')](_0xd7df('0x18'),_0x5210e5);logger[_0xd7df('0x11')](_0xd7df('0x18'),_0x5210e5,JSON[_0xd7df('0x13')](_0x46c0db));_0x471621(_0x46c0db);})['catch'](function(_0x4ba779){logger['error']('GetMemberReport',_0x4ba779['message'],_0x5210e5);_0x3cea3(_0x40167d[_0xd7df('0x14')](0x1f4,_0x4ba779['message']));});});};exports[_0xd7df('0x22')]=function(_0x156612){var _0x503a90=this;return new Promise(function(_0x3ef553,_0x2887db){return db['MemberReport'][_0xd7df('0x23')](_0x156612[_0xd7df('0x24')],{'raw':_0x156612[_0xd7df('0x1a')]?_0x156612[_0xd7df('0x1a')][_0xd7df('0x25')]===undefined?!![]:![]:!![]})[_0xd7df('0xf')](function(_0x5a658f){logger[_0xd7df('0x21')](_0xd7df('0x22'),_0x156612);logger[_0xd7df('0x11')](_0xd7df('0x22'),_0x156612,JSON[_0xd7df('0x13')](_0x5a658f));_0x3ef553(_0x5a658f);})[_0xd7df('0x17')](function(_0x141206){logger[_0xd7df('0x14')](_0xd7df('0x22'),_0x141206[_0xd7df('0x16')],_0x156612);_0x2887db(_0x503a90[_0xd7df('0x14')](0x1f4,_0x141206['message']));});});};exports['UpdateMemberReport']=function(_0x4051fb){var _0x564562=this;return new Promise(function(_0x2a3bcf,_0xab3dd8){return db[_0xd7df('0x26')][_0xd7df('0x27')](_0x4051fb['body'],{'raw':_0x4051fb['options']?_0x4051fb['options'][_0xd7df('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4051fb[_0xd7df('0x1a')]?_0x4051fb['options'][_0xd7df('0x1b')]||null:null,'attributes':_0x4051fb[_0xd7df('0x1a')]?_0x4051fb[_0xd7df('0x1a')][_0xd7df('0x1c')]||null:null,'limit':_0x4051fb['options']?_0x4051fb[_0xd7df('0x1a')][_0xd7df('0x1d')]||null:null})['then'](function(_0x52933f){logger['info'](_0xd7df('0x28'),_0x4051fb);logger[_0xd7df('0x11')](_0xd7df('0x28'),_0x4051fb,JSON['stringify'](_0x52933f));_0x2a3bcf(_0x52933f);})[_0xd7df('0x17')](function(_0x2a7252){logger[_0xd7df('0x14')](_0xd7df('0x28'),_0x2a7252['message'],_0x4051fb);_0xab3dd8(_0x564562[_0xd7df('0x14')](0x1f4,_0x2a7252[_0xd7df('0x16')]));});});}; \ No newline at end of file +var _0xe451=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetMemberReport','options','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','body','update','raw','UpdateMemberReport','moment','../../mysqldb'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xe451,0xec));var _0x1e45=function(_0x5e0228,_0x130a53){_0x5e0228=_0x5e0228-0x0;var _0xa4c65a=_0xe451[_0x5e0228];return _0xa4c65a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e45('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e45('0x1'))['db'];var utils=require(_0x1e45('0x2'));var logger=require(_0x1e45('0x3'))(_0x1e45('0x4'));var config=require('../../config/environment');var jayson=require(_0x1e45('0x5'));var client=jayson[_0x1e45('0x6')][_0x1e45('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x563405,_0xc62c6f,_0x31c118){return new BPromise(function(_0x4dd77f,_0x544710){return client[_0x1e45('0x8')](_0x563405,_0x31c118)[_0x1e45('0x9')](function(_0xde48d9){logger['info'](_0x1e45('0xa'),_0xc62c6f,_0x1e45('0xb'));logger[_0x1e45('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0xc62c6f,'request\x20sent',JSON[_0x1e45('0xd')](_0xde48d9));if(_0xde48d9[_0x1e45('0xe')]){if(_0xde48d9[_0x1e45('0xe')][_0x1e45('0xf')]===0x1f4){logger['error'](_0x1e45('0xa'),_0xc62c6f,_0xde48d9[_0x1e45('0xe')][_0x1e45('0x10')]);return _0x544710(_0xde48d9['error'][_0x1e45('0x10')]);}logger[_0x1e45('0xe')](_0x1e45('0xa'),_0xc62c6f,_0xde48d9[_0x1e45('0xe')]['message']);return _0x4dd77f(_0xde48d9[_0x1e45('0xe')]['message']);}else{logger[_0x1e45('0x11')](_0x1e45('0xa'),_0xc62c6f,'request\x20sent');_0x4dd77f(_0xde48d9[_0x1e45('0x12')][_0x1e45('0x10')]);}})[_0x1e45('0x13')](function(_0x1e5b73){logger[_0x1e45('0xe')](_0x1e45('0xa'),_0xc62c6f,_0x1e5b73);_0x544710(_0x1e5b73);});});}exports[_0x1e45('0x14')]=function(_0x2a6f47){var _0x2aa114=this;return new Promise(function(_0x5d24a7,_0x359dc6){return db['MemberReport']['findAll']({'raw':_0x2a6f47[_0x1e45('0x15')]?_0x2a6f47['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a6f47['options']?_0x2a6f47['options'][_0x1e45('0x16')]||null:null,'attributes':_0x2a6f47[_0x1e45('0x15')]?_0x2a6f47['options'][_0x1e45('0x17')]||null:null,'limit':_0x2a6f47['options']?_0x2a6f47['options'][_0x1e45('0x18')]||null:null,'include':_0x2a6f47['options']?_0x2a6f47['options'][_0x1e45('0x19')]?_[_0x1e45('0x1a')](_0x2a6f47['options'][_0x1e45('0x19')],function(_0x2fb478){return{'model':db[_0x2fb478[_0x1e45('0x1b')]],'as':_0x2fb478['as'],'attributes':_0x2fb478[_0x1e45('0x17')],'include':_0x2fb478[_0x1e45('0x19')]?_[_0x1e45('0x1a')](_0x2fb478[_0x1e45('0x19')],function(_0x55e968){return{'model':db[_0x55e968[_0x1e45('0x1b')]],'as':_0x55e968['as'],'attributes':_0x55e968[_0x1e45('0x17')],'include':_0x55e968[_0x1e45('0x19')]?_[_0x1e45('0x1a')](_0x55e968[_0x1e45('0x19')],function(_0xfd7633){return{'model':db[_0xfd7633[_0x1e45('0x1b')]],'as':_0xfd7633['as'],'attributes':_0xfd7633['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e45('0x9')](function(_0x3a9286){logger[_0x1e45('0x11')](_0x1e45('0x14'),_0x2a6f47);logger['debug'](_0x1e45('0x14'),_0x2a6f47,JSON[_0x1e45('0xd')](_0x3a9286));_0x5d24a7(_0x3a9286);})[_0x1e45('0x13')](function(_0x5229e7){logger[_0x1e45('0xe')]('GetMemberReport',_0x5229e7[_0x1e45('0x10')],_0x2a6f47);_0x359dc6(_0x2aa114['error'](0x1f4,_0x5229e7['message']));});});};exports[_0x1e45('0x1c')]=function(_0x3f33bf){var _0x363615=this;return new Promise(function(_0x3e6836,_0x51facf){return db[_0x1e45('0x1d')]['create'](_0x3f33bf[_0x1e45('0x1e')],{'raw':_0x3f33bf[_0x1e45('0x15')]?_0x3f33bf[_0x1e45('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x1e45('0x9')](function(_0x435fc2){logger[_0x1e45('0x11')]('CreateMemberReport',_0x3f33bf);logger[_0x1e45('0xc')](_0x1e45('0x1c'),_0x3f33bf,JSON[_0x1e45('0xd')](_0x435fc2));_0x3e6836(_0x435fc2);})[_0x1e45('0x13')](function(_0x58e351){logger[_0x1e45('0xe')](_0x1e45('0x1c'),_0x58e351[_0x1e45('0x10')],_0x3f33bf);_0x51facf(_0x363615[_0x1e45('0xe')](0x1f4,_0x58e351[_0x1e45('0x10')]));});});};exports['UpdateMemberReport']=function(_0x56deb6){var _0x542443=this;return new Promise(function(_0x552e4a,_0x215dc4){return db['MemberReport'][_0x1e45('0x1f')](_0x56deb6[_0x1e45('0x1e')],{'raw':_0x56deb6['options']?_0x56deb6['options'][_0x1e45('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56deb6[_0x1e45('0x15')]?_0x56deb6[_0x1e45('0x15')][_0x1e45('0x16')]||null:null,'attributes':_0x56deb6['options']?_0x56deb6[_0x1e45('0x15')][_0x1e45('0x17')]||null:null,'limit':_0x56deb6[_0x1e45('0x15')]?_0x56deb6[_0x1e45('0x15')]['limit']||null:null})[_0x1e45('0x9')](function(_0x1b1f47){logger[_0x1e45('0x11')]('UpdateMemberReport',_0x56deb6);logger['debug'](_0x1e45('0x21'),_0x56deb6,JSON['stringify'](_0x1b1f47));_0x552e4a(_0x1b1f47);})['catch'](function(_0x1bd93a){logger['error']('UpdateMemberReport',_0x1bd93a[_0x1e45('0x10')],_0x56deb6);_0x215dc4(_0x542443[_0x1e45('0xe')](0x1f4,_0x1bd93a[_0x1e45('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 1e640b4..737c7a9 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 _0xfbd8=['get','index','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xfbd8,0x1ba));var _0x8fbd=function(_0x584cba,_0x58414c){_0x584cba=_0x584cba-0x0;var _0x5e636f=_0xfbd8[_0x584cba];return _0x5e636f;};'use strict';var multer=require(_0x8fbd('0x0'));var util=require(_0x8fbd('0x1'));var path=require(_0x8fbd('0x2'));var timeout=require(_0x8fbd('0x3'));var express=require(_0x8fbd('0x4'));var router=express[_0x8fbd('0x5')]();var fs_extra=require(_0x8fbd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8fbd('0x7'));var config=require(_0x8fbd('0x8'));var controller=require('./migration.controller');router[_0x8fbd('0x9')]('/',controller[_0x8fbd('0xa')]);module['exports']=router; \ No newline at end of file +var _0xe3c3=['../../components/interaction/service','./migration.controller','get','index','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xefcf31,_0xa8f99a){var _0x22063d=function(_0x56f756){while(--_0x56f756){_0xefcf31['push'](_0xefcf31['shift']());}};_0x22063d(++_0xa8f99a);}(_0xe3c3,0xb4));var _0x3e3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe3c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3e3c('0x0'));var util=require(_0x3e3c('0x1'));var path=require(_0x3e3c('0x2'));var timeout=require(_0x3e3c('0x3'));var express=require(_0x3e3c('0x4'));var router=express[_0x3e3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3e3c('0x6'));var interaction=require(_0x3e3c('0x7'));var config=require('../../config/environment');var controller=require(_0x3e3c('0x8'));router[_0x3e3c('0x9')]('/',controller[_0x3e3c('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 27f16cb..5c3fa60 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 _0x3b27=['sequelize','STRING','version'];(function(_0x4173c4,_0x95e680){var _0xa004a8=function(_0x3d85c2){while(--_0x3d85c2){_0x4173c4['push'](_0x4173c4['shift']());}};_0xa004a8(++_0x95e680);}(_0x3b27,0x198));var _0x73b2=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x3b27[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x73b2('0x0'));module['exports']={'version':{'type':Sequelize[_0x73b2('0x1')],'unique':_0x73b2('0x2')}}; \ No newline at end of file +var _0xb444=['STRING','version','sequelize','exports'];(function(_0xd30739,_0xd201d8){var _0x2a32e8=function(_0x12b7a7){while(--_0x12b7a7){_0xd30739['push'](_0xd30739['shift']());}};_0x2a32e8(++_0xd201d8);}(_0xb444,0xfe));var _0x4b44=function(_0x5fae42,_0x1a3619){_0x5fae42=_0x5fae42-0x0;var _0x53884d=_0xb444[_0x5fae42];return _0x53884d;};'use strict';var Sequelize=require(_0x4b44('0x0'));module[_0x4b44('0x1')]={'version':{'type':Sequelize[_0x4b44('0x2')],'unique':_0x4b44('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index cf8440a..1493102 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 _0x4796=['VIRTUAL','options','includeAll','include','findAll','rows','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','Migration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge'];(function(_0x1c666a,_0x21e9fc){var _0x507f85=function(_0x5f1f4e){while(--_0x5f1f4e){_0x1c666a['push'](_0x1c666a['shift']());}};_0x507f85(++_0x21e9fc);}(_0x4796,0x8e));var _0x6479=function(_0x3f537d,_0x113978){_0x3f537d=_0x3f537d-0x0;var _0x176091=_0x4796[_0x3f537d];return _0x176091;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6479('0x0'));var moment=require(_0x6479('0x1'));var BPromise=require(_0x6479('0x2'));var Mustache=require('mustache');var util=require(_0x6479('0x3'));var path=require(_0x6479('0x4'));var sox=require(_0x6479('0x5'));var csv=require(_0x6479('0x6'));var ejs=require(_0x6479('0x7'));var fs=require('fs');var fs_extra=require(_0x6479('0x8'));var _=require(_0x6479('0x9'));var squel=require(_0x6479('0xa'));var crypto=require(_0x6479('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6479('0xc'));var toCsv=require(_0x6479('0x6'));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('../../config/license/hardware');var logger=require(_0x6479('0x12'))(_0x6479('0x13'));var utils=require(_0x6479('0x14'));var config=require(_0x6479('0x15'));var licenseUtil=require(_0x6479('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18adf1,_0x9e8d84){_0x9e8d84=_0x9e8d84||0xcc;return function(_0x36f7a2){if(_0x36f7a2){return _0x18adf1[_0x6479('0x17')](_0x9e8d84);}return _0x18adf1[_0x6479('0x18')](_0x9e8d84)['end']();};}function respondWithResult(_0x496ad2,_0xadd536){_0xadd536=_0xadd536||0xc8;return function(_0x20d3b8){if(_0x20d3b8){return _0x496ad2[_0x6479('0x18')](_0xadd536)[_0x6479('0x19')](_0x20d3b8);}};}function respondWithFilteredResult(_0x256cbe,_0x473a21){return function(_0x4657c8){if(_0x4657c8){var _0xd675ff=typeof _0x473a21[_0x6479('0x1a')]===_0x6479('0x1b')&&typeof _0x473a21[_0x6479('0x1c')]===_0x6479('0x1b');var _0x196443=_0x4657c8[_0x6479('0x1d')];var _0x36d87c=_0xd675ff?0x0:_0x473a21[_0x6479('0x1a')];var _0x268071=_0xd675ff?_0x4657c8['count']:_0x473a21['offset']+_0x473a21['limit'];var _0x1e25b2;if(_0x268071>=_0x196443){_0x268071=_0x196443;_0x1e25b2=0xc8;}else{_0x1e25b2=0xce;}_0x256cbe[_0x6479('0x18')](_0x1e25b2);return _0x256cbe[_0x6479('0x1e')](_0x6479('0x1f'),_0x36d87c+'-'+_0x268071+'/'+_0x196443)[_0x6479('0x19')](_0x4657c8);}return null;};}function patchUpdates(_0x317b4e){return function(_0xa90227){try{jsonpatch[_0x6479('0x20')](_0xa90227,_0x317b4e,!![]);}catch(_0xd7767d){return BPromise[_0x6479('0x21')](_0xd7767d);}return _0xa90227[_0x6479('0x22')]();};}function saveUpdates(_0x399697,_0x296377){return function(_0x17f00c){if(_0x17f00c){return _0x17f00c[_0x6479('0x23')](_0x399697)[_0x6479('0x24')](function(_0x152622){return _0x152622;});}return null;};}function removeEntity(_0x3c1eb7,_0xa96bce){return function(_0x12d83b){if(_0x12d83b){return _0x12d83b[_0x6479('0x25')]()['then'](function(){_0x3c1eb7[_0x6479('0x18')](0xcc)[_0x6479('0x26')]();});}};}function handleEntityNotFound(_0x465e69,_0x2ceeb1){return function(_0x253992){if(!_0x253992){_0x465e69['sendStatus'](0x194);}return _0x253992;};}function handleError(_0x3b5ba4,_0x462cc1){_0x462cc1=_0x462cc1||0x1f4;return function(_0x4d94e6){logger['error'](_0x4d94e6[_0x6479('0x27')]);if(_0x4d94e6[_0x6479('0x28')]){delete _0x4d94e6[_0x6479('0x28')];}_0x3b5ba4[_0x6479('0x18')](_0x462cc1)[_0x6479('0x29')](_0x4d94e6);};}exports[_0x6479('0x2a')]=function(_0x1612a3,_0x58f5e7){var _0x5bf44b={},_0x3adccf={},_0x2d2739={'count':0x0,'rows':[]};var _0x221ce2=_[_0x6479('0x2b')](db[_0x6479('0x2c')][_0x6479('0x2d')],function(_0x7505db){return{'name':_0x7505db['fieldName'],'type':_0x7505db[_0x6479('0x2e')][_0x6479('0x2f')]};});_0x3adccf[_0x6479('0x30')]=_[_0x6479('0x2b')](_0x221ce2,'name');_0x3adccf[_0x6479('0x31')]=_[_0x6479('0x32')](_0x1612a3['query']);_0x3adccf[_0x6479('0x33')]=_[_0x6479('0x34')](_0x3adccf[_0x6479('0x30')],_0x3adccf[_0x6479('0x31')]);_0x5bf44b[_0x6479('0x35')]=_[_0x6479('0x34')](_0x3adccf['model'],qs[_0x6479('0x36')](_0x1612a3[_0x6479('0x31')]['fields']));_0x5bf44b['attributes']=_0x5bf44b[_0x6479('0x35')]['length']?_0x5bf44b[_0x6479('0x35')]:_0x3adccf['model'];if(!_0x1612a3[_0x6479('0x31')][_0x6479('0x37')](_0x6479('0x38'))){_0x5bf44b[_0x6479('0x1c')]=qs['limit'](_0x1612a3[_0x6479('0x31')][_0x6479('0x1c')]);_0x5bf44b[_0x6479('0x1a')]=qs[_0x6479('0x1a')](_0x1612a3['query']['offset']);}_0x5bf44b['order']=qs[_0x6479('0x39')](_0x1612a3['query'][_0x6479('0x39')]);_0x5bf44b['where']=qs[_0x6479('0x33')](_[_0x6479('0x3a')](_0x1612a3[_0x6479('0x31')],_0x3adccf['filters']),_0x221ce2);if(_0x1612a3[_0x6479('0x31')][_0x6479('0x3b')]){_0x5bf44b[_0x6479('0x3c')]=_[_0x6479('0x3d')](_0x5bf44b[_0x6479('0x3c')],{'$or':_[_0x6479('0x2b')](_0x221ce2,function(_0x4f315e){if(_0x4f315e[_0x6479('0x2e')]!==_0x6479('0x3e')){var _0x8a5ea5={};_0x8a5ea5[_0x4f315e[_0x6479('0x28')]]={'$like':'%'+_0x1612a3[_0x6479('0x31')][_0x6479('0x3b')]+'%'};return _0x8a5ea5;}})});}_0x5bf44b=_[_0x6479('0x3d')]({},_0x5bf44b,_0x1612a3[_0x6479('0x3f')]);var _0x58eaa3={'where':_0x5bf44b[_0x6479('0x3c')]};return db[_0x6479('0x2c')]['count'](_0x58eaa3)[_0x6479('0x24')](function(_0x45aac1){_0x2d2739[_0x6479('0x1d')]=_0x45aac1;if(_0x1612a3[_0x6479('0x31')][_0x6479('0x40')]){_0x5bf44b[_0x6479('0x41')]=[{'all':!![]}];}return db[_0x6479('0x2c')][_0x6479('0x42')](_0x5bf44b);})[_0x6479('0x24')](function(_0x4492fb){_0x2d2739[_0x6479('0x43')]=_0x4492fb;return _0x2d2739;})[_0x6479('0x24')](respondWithFilteredResult(_0x58f5e7,_0x5bf44b))['catch'](handleError(_0x58f5e7,null));}; \ No newline at end of file +var _0x6a7a=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','Migration','includeAll','findAll','catch','eml-format','rimraf','zip-dir','request-promise','util','path','ejs','fs-extra','lodash','squel'];(function(_0x101dca,_0x349265){var _0x21c671=function(_0x252f27){while(--_0x252f27){_0x101dca['push'](_0x101dca['shift']());}};_0x21c671(++_0x349265);}(_0x6a7a,0x82));var _0xa6a7=function(_0x2b0834,_0x127ebe){_0x2b0834=_0x2b0834-0x0;var _0x16dc89=_0x6a7a[_0x2b0834];return _0x16dc89;};'use strict';var emlformat=require(_0xa6a7('0x0'));var rimraf=require(_0xa6a7('0x1'));var zipdir=require(_0xa6a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6a7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa6a7('0x4'));var path=require(_0xa6a7('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6a7('0x6'));var fs=require('fs');var fs_extra=require(_0xa6a7('0x7'));var _=require(_0xa6a7('0x8'));var squel=require(_0xa6a7('0x9'));var crypto=require(_0xa6a7('0xa'));var jsforce=require(_0xa6a7('0xb'));var deskjs=require(_0xa6a7('0xc'));var toCsv=require(_0xa6a7('0xd'));var querystring=require(_0xa6a7('0xe'));var Papa=require(_0xa6a7('0xf'));var Redis=require(_0xa6a7('0x10'));var authService=require(_0xa6a7('0x11'));var qs=require(_0xa6a7('0x12'));var as=require(_0xa6a7('0x13'));var hardwareService=require(_0xa6a7('0x14'));var logger=require(_0xa6a7('0x15'))(_0xa6a7('0x16'));var utils=require(_0xa6a7('0x17'));var config=require(_0xa6a7('0x18'));var licenseUtil=require(_0xa6a7('0x19'));var db=require(_0xa6a7('0x1a'))['db'];function respondWithStatusCode(_0x11446a,_0x263ada){_0x263ada=_0x263ada||0xcc;return function(_0x1b79c5){if(_0x1b79c5){return _0x11446a['sendStatus'](_0x263ada);}return _0x11446a[_0xa6a7('0x1b')](_0x263ada)[_0xa6a7('0x1c')]();};}function respondWithResult(_0x49add2,_0x3e479a){_0x3e479a=_0x3e479a||0xc8;return function(_0x1703bd){if(_0x1703bd){return _0x49add2[_0xa6a7('0x1b')](_0x3e479a)[_0xa6a7('0x1d')](_0x1703bd);}};}function respondWithFilteredResult(_0x18dd0f,_0x1e536c){return function(_0x7446f8){if(_0x7446f8){var _0x316b31=typeof _0x1e536c[_0xa6a7('0x1e')]===_0xa6a7('0x1f')&&typeof _0x1e536c[_0xa6a7('0x20')]==='undefined';var _0x27d991=_0x7446f8[_0xa6a7('0x21')];var _0x54d6a3=_0x316b31?0x0:_0x1e536c[_0xa6a7('0x1e')];var _0x5e9c21=_0x316b31?_0x7446f8[_0xa6a7('0x21')]:_0x1e536c[_0xa6a7('0x1e')]+_0x1e536c['limit'];var _0x483b17;if(_0x5e9c21>=_0x27d991){_0x5e9c21=_0x27d991;_0x483b17=0xc8;}else{_0x483b17=0xce;}_0x18dd0f[_0xa6a7('0x1b')](_0x483b17);return _0x18dd0f[_0xa6a7('0x22')](_0xa6a7('0x23'),_0x54d6a3+'-'+_0x5e9c21+'/'+_0x27d991)[_0xa6a7('0x1d')](_0x7446f8);}return null;};}function patchUpdates(_0x255056){return function(_0x566ab8){try{jsonpatch[_0xa6a7('0x24')](_0x566ab8,_0x255056,!![]);}catch(_0xf810f4){return BPromise[_0xa6a7('0x25')](_0xf810f4);}return _0x566ab8[_0xa6a7('0x26')]();};}function saveUpdates(_0x55dc2c,_0x12bdc0){return function(_0x1a17e1){if(_0x1a17e1){return _0x1a17e1['update'](_0x55dc2c)[_0xa6a7('0x27')](function(_0x44a98d){return _0x44a98d;});}return null;};}function removeEntity(_0x7330a5,_0x57b473){return function(_0x148db9){if(_0x148db9){return _0x148db9[_0xa6a7('0x28')]()[_0xa6a7('0x27')](function(){_0x7330a5[_0xa6a7('0x1b')](0xcc)[_0xa6a7('0x1c')]();});}};}function handleEntityNotFound(_0x57bb98,_0x1683e2){return function(_0x585b59){if(!_0x585b59){_0x57bb98[_0xa6a7('0x29')](0x194);}return _0x585b59;};}function handleError(_0xfe5973,_0x356991){_0x356991=_0x356991||0x1f4;return function(_0x512433){logger['error'](_0x512433[_0xa6a7('0x2a')]);if(_0x512433[_0xa6a7('0x2b')]){delete _0x512433[_0xa6a7('0x2b')];}_0xfe5973[_0xa6a7('0x1b')](_0x356991)[_0xa6a7('0x2c')](_0x512433);};}exports[_0xa6a7('0x2d')]=function(_0x176912,_0xf86b4){var _0x42a01b={},_0x17e619={},_0x5b4f8b={'count':0x0,'rows':[]};var _0x63eb9d=_[_0xa6a7('0x2e')](db['Migration'][_0xa6a7('0x2f')],function(_0x5f0b26){return{'name':_0x5f0b26[_0xa6a7('0x30')],'type':_0x5f0b26['type'][_0xa6a7('0x31')]};});_0x17e619[_0xa6a7('0x32')]=_[_0xa6a7('0x2e')](_0x63eb9d,_0xa6a7('0x2b'));_0x17e619['query']=_[_0xa6a7('0x33')](_0x176912[_0xa6a7('0x34')]);_0x17e619[_0xa6a7('0x35')]=_[_0xa6a7('0x36')](_0x17e619['model'],_0x17e619['query']);_0x42a01b[_0xa6a7('0x37')]=_[_0xa6a7('0x36')](_0x17e619[_0xa6a7('0x32')],qs[_0xa6a7('0x38')](_0x176912[_0xa6a7('0x34')][_0xa6a7('0x38')]));_0x42a01b[_0xa6a7('0x37')]=_0x42a01b[_0xa6a7('0x37')][_0xa6a7('0x39')]?_0x42a01b['attributes']:_0x17e619[_0xa6a7('0x32')];if(!_0x176912[_0xa6a7('0x34')][_0xa6a7('0x3a')](_0xa6a7('0x3b'))){_0x42a01b[_0xa6a7('0x20')]=qs[_0xa6a7('0x20')](_0x176912[_0xa6a7('0x34')][_0xa6a7('0x20')]);_0x42a01b[_0xa6a7('0x1e')]=qs[_0xa6a7('0x1e')](_0x176912[_0xa6a7('0x34')][_0xa6a7('0x1e')]);}_0x42a01b['order']=qs[_0xa6a7('0x3c')](_0x176912['query']['sort']);_0x42a01b[_0xa6a7('0x3d')]=qs[_0xa6a7('0x35')](_[_0xa6a7('0x3e')](_0x176912[_0xa6a7('0x34')],_0x17e619[_0xa6a7('0x35')]),_0x63eb9d);if(_0x176912[_0xa6a7('0x34')]['filter']){_0x42a01b[_0xa6a7('0x3d')]=_[_0xa6a7('0x3f')](_0x42a01b[_0xa6a7('0x3d')],{'$or':_[_0xa6a7('0x2e')](_0x63eb9d,function(_0x84038b){if(_0x84038b[_0xa6a7('0x40')]!=='VIRTUAL'){var _0x15af07={};_0x15af07[_0x84038b[_0xa6a7('0x2b')]]={'$like':'%'+_0x176912[_0xa6a7('0x34')][_0xa6a7('0x41')]+'%'};return _0x15af07;}})});}_0x42a01b=_['merge']({},_0x42a01b,_0x176912['options']);var _0x33e94d={'where':_0x42a01b['where']};return db[_0xa6a7('0x42')]['count'](_0x33e94d)[_0xa6a7('0x27')](function(_0x195053){_0x5b4f8b['count']=_0x195053;if(_0x176912[_0xa6a7('0x34')][_0xa6a7('0x43')]){_0x42a01b['include']=[{'all':!![]}];}return db[_0xa6a7('0x42')][_0xa6a7('0x44')](_0x42a01b);})[_0xa6a7('0x27')](function(_0x3a83fb){_0x5b4f8b['rows']=_0x3a83fb;return _0x5b4f8b;})['then'](respondWithFilteredResult(_0xf86b4,_0x42a01b))[_0xa6a7('0x45')](handleError(_0xf86b4,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index e0beeac..5b154cd 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 _0x3aa5=['exports','define','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3aa5,0xec));var _0x53aa=function(_0x4f7b5b,_0x4b77c2){_0x4f7b5b=_0x4f7b5b-0x0;var _0x51d9cb=_0x3aa5[_0x4f7b5b];return _0x51d9cb;};'use strict';var _=require(_0x53aa('0x0'));var util=require(_0x53aa('0x1'));var logger=require('../../config/logger')(_0x53aa('0x2'));var moment=require(_0x53aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x53aa('0x4'));var fs=require('fs');var path=require(_0x53aa('0x5'));var rimraf=require(_0x53aa('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x53aa('0x7')]=function(_0x236ee4,_0x1d8a1a){return _0x236ee4[_0x53aa('0x8')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb16e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','lodash','util','api'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xb16e,0x105));var _0xeb16=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0xb16e[_0x1bd323];return _0x13097b;};'use strict';var _=require(_0xeb16('0x0'));var util=require(_0xeb16('0x1'));var logger=require('../../config/logger')(_0xeb16('0x2'));var moment=require(_0xeb16('0x3'));var BPromise=require(_0xeb16('0x4'));var rp=require(_0xeb16('0x5'));var fs=require('fs');var path=require(_0xeb16('0x6'));var rimraf=require(_0xeb16('0x7'));var config=require(_0xeb16('0x8'));var attributes=require(_0xeb16('0x9'));module[_0xeb16('0xa')]=function(_0x33a6dd,_0x49852a){return _0x33a6dd['define'](_0xeb16('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 4b796d4..31d82f8 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 _0x43c8=['client','http','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x43c8,0xaf));var _0x843c=function(_0x382cfb,_0x523777){_0x382cfb=_0x382cfb-0x0;var _0x39fcde=_0x43c8[_0x382cfb];return _0x39fcde;};'use strict';var _=require('lodash');var util=require(_0x843c('0x0'));var moment=require('moment');var BPromise=require(_0x843c('0x1'));var rs=require(_0x843c('0x2'));var fs=require('fs');var Redis=require(_0x843c('0x3'));var db=require(_0x843c('0x4'))['db'];var utils=require(_0x843c('0x5'));var logger=require(_0x843c('0x6'))(_0x843c('0x7'));var config=require('../../config/environment');var jayson=require(_0x843c('0x8'));var client=jayson[_0x843c('0x9')][_0x843c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15bb1f,_0xd198e5,_0x49aee7){return new BPromise(function(_0x327327,_0x41f56d){return client['request'](_0x15bb1f,_0x49aee7)[_0x843c('0xb')](function(_0x566777){logger['info'](_0x843c('0xc'),_0xd198e5,'request\x20sent');logger[_0x843c('0xd')](_0x843c('0xe'),_0xd198e5,_0x843c('0xf'),JSON[_0x843c('0x10')](_0x566777));if(_0x566777['error']){if(_0x566777[_0x843c('0x11')][_0x843c('0x12')]===0x1f4){logger[_0x843c('0x11')](_0x843c('0xc'),_0xd198e5,_0x566777[_0x843c('0x11')][_0x843c('0x13')]);return _0x41f56d(_0x566777[_0x843c('0x11')][_0x843c('0x13')]);}logger[_0x843c('0x11')](_0x843c('0xc'),_0xd198e5,_0x566777[_0x843c('0x11')][_0x843c('0x13')]);return _0x327327(_0x566777[_0x843c('0x11')][_0x843c('0x13')]);}else{logger[_0x843c('0x14')]('Migration,\x20%s,\x20%s',_0xd198e5,_0x843c('0xf'));_0x327327(_0x566777[_0x843c('0x15')][_0x843c('0x13')]);}})[_0x843c('0x16')](function(_0x16e8f6){logger['error'](_0x843c('0xc'),_0xd198e5,_0x16e8f6);_0x41f56d(_0x16e8f6);});});} \ No newline at end of file +var _0x1c4d=['info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x54420f,_0xbf65e3){_0x54420f=_0x54420f-0x0;var _0x3fb7c6=_0x1c4d[_0x54420f];return _0x3fb7c6;};'use strict';var _=require('lodash');var util=require(_0xd1c4('0x0'));var moment=require(_0xd1c4('0x1'));var BPromise=require(_0xd1c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1c4('0x3'));var db=require(_0xd1c4('0x4'))['db'];var utils=require(_0xd1c4('0x5'));var logger=require(_0xd1c4('0x6'))('rpc');var config=require(_0xd1c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd1c4('0x8')][_0xd1c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41cc76,_0x35cbf5,_0x429dc6){return new BPromise(function(_0xc9284c,_0x49c2dc){return client[_0xd1c4('0xa')](_0x41cc76,_0x429dc6)[_0xd1c4('0xb')](function(_0x5443f3){logger[_0xd1c4('0xc')]('Migration,\x20%s,\x20%s',_0x35cbf5,_0xd1c4('0xd'));logger[_0xd1c4('0xe')](_0xd1c4('0xf'),_0x35cbf5,_0xd1c4('0xd'),JSON[_0xd1c4('0x10')](_0x5443f3));if(_0x5443f3[_0xd1c4('0x11')]){if(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x12')]===0x1f4){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0x49c2dc(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x14')]);}logger['error']('Migration,\x20%s,\x20%s',_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0xc9284c(_0x5443f3[_0xd1c4('0x11')]['message']);}else{logger['info'](_0xd1c4('0x13'),_0x35cbf5,'request\x20sent');_0xc9284c(_0x5443f3[_0xd1c4('0x15')][_0xd1c4('0x14')]);}})[_0xd1c4('0x16')](function(_0x4af352){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x4af352);_0x49c2dc(_0x4af352);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 4645b60..e992ea6 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 _0x14a0=['../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14a0,0x109));var _0x014a=function(_0x3857b2,_0x5c0294){_0x3857b2=_0x3857b2-0x0;var _0x137759=_0x14a0[_0x3857b2];return _0x137759;};'use strict';var multer=require(_0x014a('0x0'));var util=require(_0x014a('0x1'));var path=require(_0x014a('0x2'));var timeout=require(_0x014a('0x3'));var express=require(_0x014a('0x4'));var router=express[_0x014a('0x5')]();var fs_extra=require(_0x014a('0x6'));var auth=require(_0x014a('0x7'));var interaction=require(_0x014a('0x8'));var config=require('../../config/environment');var controller=require(_0x014a('0x9'));router[_0x014a('0xa')]('/',auth['isAuthenticated'](),controller[_0x014a('0xb')]);router[_0x014a('0xa')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0xe')]);router['post']('/',auth[_0x014a('0xd')](),controller[_0x014a('0xf')]);router[_0x014a('0x10')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0x13')]);module[_0x014a('0x14')]=router; \ No newline at end of file +var _0xccd4=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','create','update'];(function(_0x3575bf,_0x33ce4b){var _0x452f25=function(_0x307b27){while(--_0x307b27){_0x3575bf['push'](_0x3575bf['shift']());}};_0x452f25(++_0x33ce4b);}(_0xccd4,0xa4));var _0x4ccd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xccd4[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x4ccd('0x0'));var util=require(_0x4ccd('0x1'));var path=require(_0x4ccd('0x2'));var timeout=require(_0x4ccd('0x3'));var express=require(_0x4ccd('0x4'));var router=express[_0x4ccd('0x5')]();var fs_extra=require(_0x4ccd('0x6'));var auth=require(_0x4ccd('0x7'));var interaction=require(_0x4ccd('0x8'));var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0x4ccd('0x9')](),controller[_0x4ccd('0xa')]);router[_0x4ccd('0xb')](_0x4ccd('0xc'),auth[_0x4ccd('0x9')](),controller[_0x4ccd('0xd')]);router['post']('/',auth[_0x4ccd('0x9')](),controller[_0x4ccd('0xe')]);router['put']('/:id',auth[_0x4ccd('0x9')](),controller[_0x4ccd('0xf')]);router['delete'](_0x4ccd('0xc'),auth[_0x4ccd('0x9')](),controller[_0x4ccd('0x10')]);module[_0x4ccd('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 31cdb3e..73947fe 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 _0xcf15=['ENUM','stun','turn','STRING','sequelize','exports'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xcf15,0x6a));var _0x5cf1=function(_0x2f706c,_0x2b5f9b){_0x2f706c=_0x2f706c-0x0;var _0x32b562=_0xcf15[_0x2f706c];return _0x32b562;};'use strict';var Sequelize=require(_0x5cf1('0x0'));module[_0x5cf1('0x1')]={'type':{'type':Sequelize[_0x5cf1('0x2')]('localnet','externip',_0x5cf1('0x3'),_0x5cf1('0x4'))},'value':{'type':Sequelize[_0x5cf1('0x5')]},'username':{'type':Sequelize[_0x5cf1('0x5')]},'password':{'type':Sequelize[_0x5cf1('0x5')]}}; \ No newline at end of file +var _0x74a2=['STRING','sequelize','ENUM','stun','turn'];(function(_0x3acb89,_0x2ca05e){var _0x4d38f2=function(_0x4cb6a9){while(--_0x4cb6a9){_0x3acb89['push'](_0x3acb89['shift']());}};_0x4d38f2(++_0x2ca05e);}(_0x74a2,0x1af));var _0x274a=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0x74a2[_0x27d8bc];return _0x4b04cb;};'use strict';var Sequelize=require(_0x274a('0x0'));module['exports']={'type':{'type':Sequelize[_0x274a('0x1')]('localnet','externip',_0x274a('0x2'),_0x274a('0x3'))},'value':{'type':Sequelize[_0x274a('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x274a('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index c5e6984..93084fd 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 _0x90ab=['request','then','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','info','result','status','json','undefined','limit','count','offset','set','Content-Range','destroy','end','sendStatus','stack','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','filter','options','includeAll','include','Network','catch','show','params','rawAttributes','create','body','findAll','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','update','server/files/templates/turn_multiple.ejs','util','path','ejs','lodash','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http'];(function(_0x53fea5,_0x114ca5){var _0x46372f=function(_0x5b02c2){while(--_0x5b02c2){_0x53fea5['push'](_0x53fea5['shift']());}};_0x46372f(++_0x114ca5);}(_0x90ab,0xa4));var _0xb90a=function(_0x498c78,_0x2eab48){_0x498c78=_0x498c78-0x0;var _0xb7697f=_0x90ab[_0x498c78];return _0xb7697f;};'use strict';var util=require(_0xb90a('0x0'));var path=require(_0xb90a('0x1'));var ejs=require(_0xb90a('0x2'));var fs=require('fs');var _=require(_0xb90a('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xb90a('0x4'))(_0xb90a('0x5'));var config=require(_0xb90a('0x6'));var db=require(_0xb90a('0x7'))['db'];var jayson=require(_0xb90a('0x8'));var client=jayson['client'][_0xb90a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d767c,_0x52de80,_0xb621c,_0x2bac79){return new Promise(function(_0x38324e,_0x4f7fbf){var _0x5a7f1d=_0x2bac79||client;return _0x5a7f1d[_0xb90a('0xa')](_0x8d767c,_0xb621c)[_0xb90a('0xb')](function(_0x3e41fd){logger['info']('Network,\x20%s,\x20%s',_0x52de80,_0xb90a('0xc'));logger[_0xb90a('0xd')](_0xb90a('0xe'),_0x52de80,_0xb90a('0xc'),JSON[_0xb90a('0xf')](_0x3e41fd));if(_0x3e41fd[_0xb90a('0x10')]){if(_0x3e41fd[_0xb90a('0x10')][_0xb90a('0x11')]===0x1f4){logger[_0xb90a('0x10')](_0xb90a('0x12'),_0x52de80,_0x3e41fd['error']['message']);return _0x4f7fbf(_0x3e41fd['error'][_0xb90a('0x13')]);}logger['error'](_0xb90a('0x12'),_0x52de80,_0x3e41fd[_0xb90a('0x10')][_0xb90a('0x13')]);return _0x38324e(_0x3e41fd['error']['message']);}else{logger[_0xb90a('0x14')]('Network,\x20%s,\x20%s',_0x52de80,_0xb90a('0xc'));_0x38324e(_0x3e41fd[_0xb90a('0x15')][_0xb90a('0x13')]);}})['catch'](function(_0x59a560){logger['error'](_0xb90a('0x12'),_0x52de80,_0x59a560);_0x4f7fbf(_0x59a560);});});}function respondWithResult(_0x14f8b2,_0x113d58){_0x113d58=_0x113d58||0xc8;return function(_0x287295){if(_0x287295){return _0x14f8b2[_0xb90a('0x16')](_0x113d58)[_0xb90a('0x17')](_0x287295);}};}function respondWithFilteredResult(_0x46904b,_0x2d3b51){return function(_0x4f06b6){if(_0x4f06b6){var _0x30644c=typeof _0x2d3b51['offset']===_0xb90a('0x18')&&typeof _0x2d3b51[_0xb90a('0x19')]===_0xb90a('0x18');var _0x64d326=_0x4f06b6[_0xb90a('0x1a')];var _0x372d89=_0x30644c?0x0:_0x2d3b51[_0xb90a('0x1b')];var _0x3c2662=_0x30644c?_0x4f06b6[_0xb90a('0x1a')]:_0x2d3b51['offset']+_0x2d3b51[_0xb90a('0x19')];var _0x35656b;if(_0x3c2662>=_0x64d326){_0x3c2662=_0x64d326;_0x35656b=0xc8;}else{_0x35656b=0xce;}_0x46904b[_0xb90a('0x16')](_0x35656b);return _0x46904b[_0xb90a('0x1c')](_0xb90a('0x1d'),_0x372d89+'-'+_0x3c2662+'/'+_0x64d326)[_0xb90a('0x17')](_0x4f06b6);}return null;};}function saveUpdates(_0x4ad57b){return function(_0x55b4dc){if(_0x55b4dc){return _0x55b4dc['update'](_0x4ad57b)[_0xb90a('0xb')](function(_0x2a9de6){return _0x2a9de6;});}return null;};}function removeEntity(_0x2b9129){return function(_0x417a90){if(_0x417a90){return _0x417a90[_0xb90a('0x1e')]()[_0xb90a('0xb')](function(){_0x2b9129[_0xb90a('0x16')](0xcc)[_0xb90a('0x1f')]();});}};}function handleEntityNotFound(_0x145c70){return function(_0x51643e){if(!_0x51643e){_0x145c70[_0xb90a('0x20')](0x194);}return _0x51643e;};}function handleError(_0x2428cb,_0x2dd9d0){_0x2dd9d0=_0x2dd9d0||0x1f4;return function(_0x379674){logger[_0xb90a('0x10')](_0x379674[_0xb90a('0x21')]);if(_0x379674['name']){delete _0x379674[_0xb90a('0x22')];}_0x2428cb[_0xb90a('0x16')](_0x2dd9d0)[_0xb90a('0x23')](_0x379674);};}exports['index']=function(_0x26be28,_0x4ca654){var _0x1e1db4={},_0xc0d594={},_0x1b88ab={'count':0x0,'rows':[]};var _0x5be761=_[_0xb90a('0x24')](db['Network']['rawAttributes'],function(_0x36e0a9){return{'name':_0x36e0a9[_0xb90a('0x25')],'type':_0x36e0a9[_0xb90a('0x26')][_0xb90a('0x27')]};});_0xc0d594[_0xb90a('0x28')]=_[_0xb90a('0x24')](_0x5be761,'name');_0xc0d594[_0xb90a('0x29')]=_[_0xb90a('0x2a')](_0x26be28[_0xb90a('0x29')]);_0xc0d594[_0xb90a('0x2b')]=_['intersection'](_0xc0d594[_0xb90a('0x28')],_0xc0d594['query']);_0x1e1db4[_0xb90a('0x2c')]=_[_0xb90a('0x2d')](_0xc0d594[_0xb90a('0x28')],qs[_0xb90a('0x2e')](_0x26be28[_0xb90a('0x29')]['fields']));_0x1e1db4[_0xb90a('0x2c')]=_0x1e1db4[_0xb90a('0x2c')][_0xb90a('0x2f')]?_0x1e1db4['attributes']:_0xc0d594[_0xb90a('0x28')];if(!_0x26be28[_0xb90a('0x29')]['hasOwnProperty'](_0xb90a('0x30'))){_0x1e1db4[_0xb90a('0x19')]=qs[_0xb90a('0x19')](_0x26be28[_0xb90a('0x29')][_0xb90a('0x19')]);_0x1e1db4['offset']=qs[_0xb90a('0x1b')](_0x26be28[_0xb90a('0x29')][_0xb90a('0x1b')]);}_0x1e1db4[_0xb90a('0x31')]=qs[_0xb90a('0x32')](_0x26be28[_0xb90a('0x29')][_0xb90a('0x32')]);_0x1e1db4[_0xb90a('0x33')]=qs[_0xb90a('0x2b')](_['pick'](_0x26be28[_0xb90a('0x29')],_0xc0d594['filters']),_0x5be761);if(_0x26be28[_0xb90a('0x29')]['filter']){_0x1e1db4['where']=_[_0xb90a('0x34')](_0x1e1db4[_0xb90a('0x33')],{'$or':_['map'](_0x5be761,function(_0x3cad25){if(_0x3cad25[_0xb90a('0x26')]!=='VIRTUAL'){var _0x452f82={};_0x452f82[_0x3cad25['name']]={'$like':'%'+_0x26be28['query'][_0xb90a('0x35')]+'%'};return _0x452f82;}})});}_0x1e1db4=_[_0xb90a('0x34')]({},_0x1e1db4,_0x26be28[_0xb90a('0x36')]);var _0x11c8c1={'where':_0x1e1db4[_0xb90a('0x33')]};return db['Network'][_0xb90a('0x1a')](_0x11c8c1)['then'](function(_0x45802a){_0x1b88ab[_0xb90a('0x1a')]=_0x45802a;if(_0x26be28[_0xb90a('0x29')][_0xb90a('0x37')]){_0x1e1db4[_0xb90a('0x38')]=[{'all':!![]}];}return db[_0xb90a('0x39')]['findAll'](_0x1e1db4);})['then'](function(_0x30f06f){_0x1b88ab['rows']=_0x30f06f;return _0x1b88ab;})[_0xb90a('0xb')](respondWithFilteredResult(_0x4ca654,_0x1e1db4))[_0xb90a('0x3a')](handleError(_0x4ca654,null));};exports[_0xb90a('0x3b')]=function(_0x82190f,_0x4ed055){var _0x2d8ab9={'raw':!![],'where':{'id':_0x82190f[_0xb90a('0x3c')]['id']}},_0x2fd0cf={};_0x2fd0cf[_0xb90a('0x28')]=_[_0xb90a('0x2a')](db[_0xb90a('0x39')][_0xb90a('0x3d')]);_0x2fd0cf[_0xb90a('0x29')]=_[_0xb90a('0x2a')](_0x82190f[_0xb90a('0x29')]);_0x2fd0cf[_0xb90a('0x2b')]=_['intersection'](_0x2fd0cf[_0xb90a('0x28')],_0x2fd0cf['query']);_0x2d8ab9[_0xb90a('0x2c')]=_[_0xb90a('0x2d')](_0x2fd0cf[_0xb90a('0x28')],qs[_0xb90a('0x2e')](_0x82190f['query'][_0xb90a('0x2e')]));_0x2d8ab9[_0xb90a('0x2c')]=_0x2d8ab9[_0xb90a('0x2c')][_0xb90a('0x2f')]?_0x2d8ab9['attributes']:_0x2fd0cf[_0xb90a('0x28')];if(_0x82190f[_0xb90a('0x29')][_0xb90a('0x37')]){_0x2d8ab9[_0xb90a('0x38')]=[{'all':!![]}];}_0x2d8ab9=_[_0xb90a('0x34')]({},_0x2d8ab9,_0x82190f[_0xb90a('0x36')]);return db[_0xb90a('0x39')]['find'](_0x2d8ab9)[_0xb90a('0xb')](handleEntityNotFound(_0x4ed055,null))[_0xb90a('0xb')](respondWithResult(_0x4ed055,null))['catch'](handleError(_0x4ed055,null));};exports['create']=function(_0x20f83f,_0x2c8d4f){var _0x4dddae;return db[_0xb90a('0x39')][_0xb90a('0x3e')](_0x20f83f[_0xb90a('0x3f')],{'raw':!![]})[_0xb90a('0xb')](function(_0x57cec6){_0x4dddae=_0x57cec6;return db[_0xb90a('0x39')][_0xb90a('0x40')]({'where':{'type':_0x20f83f[_0xb90a('0x3f')][_0xb90a('0x26')]},'raw':!![]});})['then'](function(_0x52a65e){if(_0x4dddae[_0xb90a('0x26')][_0xb90a('0x41')]()==_0xb90a('0x42')){var _0x25891d=fs[_0xb90a('0x43')](path[_0xb90a('0x44')](config[_0xb90a('0x45')],_0xb90a('0x46')),_0xb90a('0x47'));var _0x358f1c=ejs[_0xb90a('0x48')](_0x25891d,{'networks':_0x52a65e||[]});fs[_0xb90a('0x49')](_0xb90a('0x4a'),_0x358f1c);return respondWithRpcPromise(_0xb90a('0x4b'),_0xb90a('0x3e'),{'module':_0xb90a('0x4c')});}else if(_0x4dddae[_0xb90a('0x26')][_0xb90a('0x41')]()==_0xb90a('0x4d')){var _0x2ae2b8=fs[_0xb90a('0x43')](path['join'](config[_0xb90a('0x45')],'server/files/templates/turn_multiple.ejs'),_0xb90a('0x47'));var _0x4c94bd=ejs[_0xb90a('0x48')](_0x2ae2b8,{'networks':_0x52a65e||[]});fs['writeFileSync'](_0xb90a('0x4e'),_0x4c94bd);return respondWithRpcPromise('Reload','create',{'module':_0xb90a('0x4c')});}else{var _0x53b3a3=fs[_0xb90a('0x43')](path['join'](config[_0xb90a('0x45')],_0xb90a('0x4f')),_0xb90a('0x47'));var _0xcfae18=ejs['render'](_0x53b3a3,{'networks':_0x52a65e||[]});fs[_0xb90a('0x49')](util[_0xb90a('0x50')](_0xb90a('0x51'),_0x20f83f[_0xb90a('0x3f')][_0xb90a('0x26')][_0xb90a('0x52')]()),_0xcfae18);return respondWithRpcPromise(_0xb90a('0x4b'),'create',{'module':_0xb90a('0x53')});}})[_0xb90a('0xb')](function(){return _0x4dddae;})[_0xb90a('0xb')](respondWithResult(_0x2c8d4f,0xc9))[_0xb90a('0x3a')](handleError(_0x2c8d4f,null));};exports['update']=function(_0x5f19ab,_0x4ecc26){var _0x142597;return db[_0xb90a('0x39')][_0xb90a('0x54')]({'where':{'id':_0x5f19ab['params']['id']}})[_0xb90a('0xb')](handleEntityNotFound(_0x4ecc26,null))['then'](saveUpdates(_0x5f19ab[_0xb90a('0x3f')],null))[_0xb90a('0xb')](function(_0x191428){if(_0x191428){_0x142597=_0x191428;return db[_0xb90a('0x39')][_0xb90a('0x40')]({'where':{'type':_0x142597[_0xb90a('0x26')]},'raw':!![]});}return null;})[_0xb90a('0xb')](function(_0x3f84a7){if(_0x142597[_0xb90a('0x26')][_0xb90a('0x41')]()==_0xb90a('0x42')){var _0x3442ed=fs[_0xb90a('0x43')](path[_0xb90a('0x44')](config['root'],_0xb90a('0x46')),_0xb90a('0x47'));var _0x13b70f=ejs[_0xb90a('0x48')](_0x3442ed,{'networks':_0x3f84a7||[]});fs[_0xb90a('0x49')]('/etc/asterisk/stun_xcally.conf',_0x13b70f);return respondWithRpcPromise(_0xb90a('0x4b'),_0xb90a('0x55'),{'module':_0xb90a('0x4c')});}else if(_0x142597['type'][_0xb90a('0x41')]()==_0xb90a('0x4d')){var _0x627be2=fs['readFileSync'](path['join'](config[_0xb90a('0x45')],_0xb90a('0x56')),_0xb90a('0x47'));var _0x377661=ejs[_0xb90a('0x48')](_0x627be2,{'networks':_0x3f84a7||[]});fs[_0xb90a('0x49')]('/etc/asterisk/turn_xcally.conf',_0x377661);return respondWithRpcPromise(_0xb90a('0x4b'),'update',{'module':'res_stun_monitor.so'});}else{var _0x1aa4c6=fs['readFileSync'](path[_0xb90a('0x44')](config[_0xb90a('0x45')],'server/files/templates/network.ejs'),_0xb90a('0x47'));var _0x375411=ejs[_0xb90a('0x48')](_0x1aa4c6,{'networks':_0x3f84a7||[]});fs[_0xb90a('0x49')](util[_0xb90a('0x50')](_0xb90a('0x51'),_0x5f19ab[_0xb90a('0x3f')]['type']['toLowerCase']()),_0x375411);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}})['then'](function(_0x13e7cd){if(_0x13e7cd){return _0x142597;}return null;})[_0xb90a('0xb')](respondWithResult(_0x4ecc26,null))[_0xb90a('0x3a')](handleError(_0x4ecc26,null));};exports[_0xb90a('0x1e')]=function(_0x341116,_0x39de8a){var _0x44eda9;return db[_0xb90a('0x39')][_0xb90a('0x54')]({'where':{'id':_0x341116[_0xb90a('0x3c')]['id']}})['then'](function(_0x1bd57d){_0x44eda9=_0x1bd57d;return _0x1bd57d;})[_0xb90a('0xb')](handleEntityNotFound(_0x39de8a,null))[_0xb90a('0xb')](removeEntity(_0x39de8a,null))[_0xb90a('0xb')](function(){if(_0x44eda9){return db[_0xb90a('0x39')][_0xb90a('0x40')]({'where':{'type':_0x44eda9['type']},'raw':!![]});}})[_0xb90a('0xb')](function(_0x440da3){if(_0x44eda9[_0xb90a('0x26')][_0xb90a('0x41')]()=='STUN'){var _0x390a1f=fs[_0xb90a('0x43')](path[_0xb90a('0x44')](config[_0xb90a('0x45')],_0xb90a('0x46')),_0xb90a('0x47'));var _0x3ba41b=ejs[_0xb90a('0x48')](_0x390a1f,{'networks':_0x440da3||[]});fs[_0xb90a('0x49')](_0xb90a('0x4a'),_0x3ba41b);return respondWithRpcPromise(_0xb90a('0x4b'),_0xb90a('0x1e'),{'module':_0xb90a('0x4c')});}else if(_0x44eda9[_0xb90a('0x26')][_0xb90a('0x41')]()==_0xb90a('0x4d')){var _0x19b138=fs[_0xb90a('0x43')](path['join'](config[_0xb90a('0x45')],_0xb90a('0x56')),'utf8');var _0x3b9ad5=ejs['render'](_0x19b138,{'networks':_0x440da3||[]});fs[_0xb90a('0x49')]('/etc/asterisk/turn_xcally.conf',_0x3b9ad5);return respondWithRpcPromise(_0xb90a('0x4b'),_0xb90a('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x376f50=fs['readFileSync'](path[_0xb90a('0x44')](config[_0xb90a('0x45')],_0xb90a('0x4f')),_0xb90a('0x47'));var _0x311347=ejs[_0xb90a('0x48')](_0x376f50,{'networks':_0x440da3||[]});fs[_0xb90a('0x49')](util[_0xb90a('0x50')]('/etc/asterisk/sip_xcally_%s.conf',_0x44eda9[_0xb90a('0x26')]['toLowerCase']()),_0x311347);return respondWithRpcPromise('Reload',_0xb90a('0x1e'),{'module':'chan_sip.so'});}})[_0xb90a('0x3a')](handleError(_0x39de8a,null));}; \ No newline at end of file +var _0x5a9d=['limit','count','set','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','map','Network','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','rawAttributes','find','create','body','findAll','type','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','offset','undefined'];(function(_0x43f65c,_0x584ab2){var _0x112342=function(_0x377b12){while(--_0x377b12){_0x43f65c['push'](_0x43f65c['shift']());}};_0x112342(++_0x584ab2);}(_0x5a9d,0xee));var _0xd5a9=function(_0x4b9681,_0x382e13){_0x4b9681=_0x4b9681-0x0;var _0x5c6e98=_0x5a9d[_0x4b9681];return _0x5c6e98;};'use strict';var util=require(_0xd5a9('0x0'));var path=require(_0xd5a9('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd5a9('0x2'));var qs=require(_0xd5a9('0x3'));var logger=require(_0xd5a9('0x4'))(_0xd5a9('0x5'));var config=require(_0xd5a9('0x6'));var db=require(_0xd5a9('0x7'))['db'];var jayson=require(_0xd5a9('0x8'));var client=jayson[_0xd5a9('0x9')][_0xd5a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cdef9,_0x11fbbb,_0x3700d4,_0x94d316){return new Promise(function(_0x2f6492,_0x4a03ce){var _0x15ebee=_0x94d316||client;return _0x15ebee[_0xd5a9('0xb')](_0x5cdef9,_0x3700d4)[_0xd5a9('0xc')](function(_0x46c967){logger['info'](_0xd5a9('0xd'),_0x11fbbb,_0xd5a9('0xe'));logger[_0xd5a9('0xf')](_0xd5a9('0x10'),_0x11fbbb,_0xd5a9('0xe'),JSON[_0xd5a9('0x11')](_0x46c967));if(_0x46c967[_0xd5a9('0x12')]){if(_0x46c967[_0xd5a9('0x12')][_0xd5a9('0x13')]===0x1f4){logger[_0xd5a9('0x12')](_0xd5a9('0xd'),_0x11fbbb,_0x46c967['error']['message']);return _0x4a03ce(_0x46c967[_0xd5a9('0x12')]['message']);}logger[_0xd5a9('0x12')](_0xd5a9('0xd'),_0x11fbbb,_0x46c967[_0xd5a9('0x12')][_0xd5a9('0x14')]);return _0x2f6492(_0x46c967[_0xd5a9('0x12')]['message']);}else{logger[_0xd5a9('0x15')](_0xd5a9('0xd'),_0x11fbbb,'request\x20sent');_0x2f6492(_0x46c967['result'][_0xd5a9('0x14')]);}})[_0xd5a9('0x16')](function(_0x1a3645){logger['error']('Network,\x20%s,\x20%s',_0x11fbbb,_0x1a3645);_0x4a03ce(_0x1a3645);});});}function respondWithResult(_0x46f1f6,_0x518582){_0x518582=_0x518582||0xc8;return function(_0x2da077){if(_0x2da077){return _0x46f1f6[_0xd5a9('0x17')](_0x518582)['json'](_0x2da077);}};}function respondWithFilteredResult(_0x2be4fa,_0x4c4a70){return function(_0x19ff8f){if(_0x19ff8f){var _0x2bdddb=typeof _0x4c4a70[_0xd5a9('0x18')]===_0xd5a9('0x19')&&typeof _0x4c4a70[_0xd5a9('0x1a')]===_0xd5a9('0x19');var _0x2d884d=_0x19ff8f[_0xd5a9('0x1b')];var _0x194162=_0x2bdddb?0x0:_0x4c4a70[_0xd5a9('0x18')];var _0x4ab938=_0x2bdddb?_0x19ff8f[_0xd5a9('0x1b')]:_0x4c4a70[_0xd5a9('0x18')]+_0x4c4a70[_0xd5a9('0x1a')];var _0x3b5adf;if(_0x4ab938>=_0x2d884d){_0x4ab938=_0x2d884d;_0x3b5adf=0xc8;}else{_0x3b5adf=0xce;}_0x2be4fa['status'](_0x3b5adf);return _0x2be4fa[_0xd5a9('0x1c')](_0xd5a9('0x1d'),_0x194162+'-'+_0x4ab938+'/'+_0x2d884d)[_0xd5a9('0x1e')](_0x19ff8f);}return null;};}function saveUpdates(_0x2819f3){return function(_0x31add1){if(_0x31add1){return _0x31add1[_0xd5a9('0x1f')](_0x2819f3)['then'](function(_0x37a0fc){return _0x37a0fc;});}return null;};}function removeEntity(_0x2ad402){return function(_0x4886c0){if(_0x4886c0){return _0x4886c0[_0xd5a9('0x20')]()[_0xd5a9('0xc')](function(){_0x2ad402[_0xd5a9('0x17')](0xcc)[_0xd5a9('0x21')]();});}};}function handleEntityNotFound(_0x3a2ea8){return function(_0x346986){if(!_0x346986){_0x3a2ea8[_0xd5a9('0x22')](0x194);}return _0x346986;};}function handleError(_0x4196ff,_0x132425){_0x132425=_0x132425||0x1f4;return function(_0x523306){logger['error'](_0x523306[_0xd5a9('0x23')]);if(_0x523306[_0xd5a9('0x24')]){delete _0x523306[_0xd5a9('0x24')];}_0x4196ff[_0xd5a9('0x17')](_0x132425)[_0xd5a9('0x25')](_0x523306);};}exports['index']=function(_0x53de76,_0x3d188c){var _0x520350={},_0x456a9e={},_0x21228c={'count':0x0,'rows':[]};var _0x42dda6=_[_0xd5a9('0x26')](db[_0xd5a9('0x27')]['rawAttributes'],function(_0x31a476){return{'name':_0x31a476[_0xd5a9('0x28')],'type':_0x31a476['type'][_0xd5a9('0x29')]};});_0x456a9e[_0xd5a9('0x2a')]=_[_0xd5a9('0x26')](_0x42dda6,_0xd5a9('0x24'));_0x456a9e[_0xd5a9('0x2b')]=_[_0xd5a9('0x2c')](_0x53de76[_0xd5a9('0x2b')]);_0x456a9e['filters']=_['intersection'](_0x456a9e[_0xd5a9('0x2a')],_0x456a9e[_0xd5a9('0x2b')]);_0x520350['attributes']=_[_0xd5a9('0x2d')](_0x456a9e[_0xd5a9('0x2a')],qs['fields'](_0x53de76[_0xd5a9('0x2b')][_0xd5a9('0x2e')]));_0x520350['attributes']=_0x520350[_0xd5a9('0x2f')][_0xd5a9('0x30')]?_0x520350[_0xd5a9('0x2f')]:_0x456a9e[_0xd5a9('0x2a')];if(!_0x53de76[_0xd5a9('0x2b')][_0xd5a9('0x31')]('nolimit')){_0x520350['limit']=qs[_0xd5a9('0x1a')](_0x53de76[_0xd5a9('0x2b')][_0xd5a9('0x1a')]);_0x520350['offset']=qs[_0xd5a9('0x18')](_0x53de76['query']['offset']);}_0x520350[_0xd5a9('0x32')]=qs[_0xd5a9('0x33')](_0x53de76[_0xd5a9('0x2b')][_0xd5a9('0x33')]);_0x520350[_0xd5a9('0x34')]=qs[_0xd5a9('0x35')](_[_0xd5a9('0x36')](_0x53de76[_0xd5a9('0x2b')],_0x456a9e[_0xd5a9('0x35')]),_0x42dda6);if(_0x53de76['query'][_0xd5a9('0x37')]){_0x520350[_0xd5a9('0x34')]=_['merge'](_0x520350[_0xd5a9('0x34')],{'$or':_[_0xd5a9('0x26')](_0x42dda6,function(_0x5d0b3a){if(_0x5d0b3a['type']!==_0xd5a9('0x38')){var _0x32df96={};_0x32df96[_0x5d0b3a[_0xd5a9('0x24')]]={'$like':'%'+_0x53de76['query']['filter']+'%'};return _0x32df96;}})});}_0x520350=_[_0xd5a9('0x39')]({},_0x520350,_0x53de76[_0xd5a9('0x3a')]);var _0x143c5e={'where':_0x520350['where']};return db[_0xd5a9('0x27')][_0xd5a9('0x1b')](_0x143c5e)[_0xd5a9('0xc')](function(_0x1dea02){_0x21228c[_0xd5a9('0x1b')]=_0x1dea02;if(_0x53de76[_0xd5a9('0x2b')][_0xd5a9('0x3b')]){_0x520350[_0xd5a9('0x3c')]=[{'all':!![]}];}return db[_0xd5a9('0x27')]['findAll'](_0x520350);})[_0xd5a9('0xc')](function(_0x1393e9){_0x21228c[_0xd5a9('0x3d')]=_0x1393e9;return _0x21228c;})['then'](respondWithFilteredResult(_0x3d188c,_0x520350))[_0xd5a9('0x16')](handleError(_0x3d188c,null));};exports['show']=function(_0x3befd5,_0x37ca2b){var _0x3cc888={'raw':!![],'where':{'id':_0x3befd5[_0xd5a9('0x3e')]['id']}},_0x164509={};_0x164509[_0xd5a9('0x2a')]=_[_0xd5a9('0x2c')](db[_0xd5a9('0x27')][_0xd5a9('0x3f')]);_0x164509['query']=_['keys'](_0x3befd5[_0xd5a9('0x2b')]);_0x164509[_0xd5a9('0x35')]=_[_0xd5a9('0x2d')](_0x164509['model'],_0x164509[_0xd5a9('0x2b')]);_0x3cc888[_0xd5a9('0x2f')]=_[_0xd5a9('0x2d')](_0x164509[_0xd5a9('0x2a')],qs[_0xd5a9('0x2e')](_0x3befd5[_0xd5a9('0x2b')][_0xd5a9('0x2e')]));_0x3cc888[_0xd5a9('0x2f')]=_0x3cc888[_0xd5a9('0x2f')][_0xd5a9('0x30')]?_0x3cc888['attributes']:_0x164509[_0xd5a9('0x2a')];if(_0x3befd5[_0xd5a9('0x2b')][_0xd5a9('0x3b')]){_0x3cc888[_0xd5a9('0x3c')]=[{'all':!![]}];}_0x3cc888=_[_0xd5a9('0x39')]({},_0x3cc888,_0x3befd5['options']);return db['Network'][_0xd5a9('0x40')](_0x3cc888)[_0xd5a9('0xc')](handleEntityNotFound(_0x37ca2b,null))[_0xd5a9('0xc')](respondWithResult(_0x37ca2b,null))[_0xd5a9('0x16')](handleError(_0x37ca2b,null));};exports['create']=function(_0x5dfab0,_0x577f9c){var _0x59fc61;return db[_0xd5a9('0x27')][_0xd5a9('0x41')](_0x5dfab0[_0xd5a9('0x42')],{'raw':!![]})[_0xd5a9('0xc')](function(_0x515f90){_0x59fc61=_0x515f90;return db['Network'][_0xd5a9('0x43')]({'where':{'type':_0x5dfab0[_0xd5a9('0x42')][_0xd5a9('0x44')]},'raw':!![]});})[_0xd5a9('0xc')](function(_0x5581a9){if(_0x59fc61[_0xd5a9('0x44')][_0xd5a9('0x45')]()==_0xd5a9('0x46')){var _0x363074=fs[_0xd5a9('0x47')](path[_0xd5a9('0x48')](config[_0xd5a9('0x49')],_0xd5a9('0x4a')),_0xd5a9('0x4b'));var _0xf6eaf2=ejs[_0xd5a9('0x4c')](_0x363074,{'networks':_0x5581a9||[]});fs[_0xd5a9('0x4d')](_0xd5a9('0x4e'),_0xf6eaf2);return respondWithRpcPromise(_0xd5a9('0x4f'),_0xd5a9('0x41'),{'module':_0xd5a9('0x50')});}else if(_0x59fc61[_0xd5a9('0x44')]['toUpperCase']()==_0xd5a9('0x51')){var _0x5b2a35=fs[_0xd5a9('0x47')](path[_0xd5a9('0x48')](config[_0xd5a9('0x49')],_0xd5a9('0x52')),_0xd5a9('0x4b'));var _0x8b49be=ejs[_0xd5a9('0x4c')](_0x5b2a35,{'networks':_0x5581a9||[]});fs[_0xd5a9('0x4d')](_0xd5a9('0x53'),_0x8b49be);return respondWithRpcPromise(_0xd5a9('0x4f'),'create',{'module':_0xd5a9('0x50')});}else{var _0x13b2f4=fs[_0xd5a9('0x47')](path['join'](config[_0xd5a9('0x49')],_0xd5a9('0x54')),'utf8');var _0x202460=ejs['render'](_0x13b2f4,{'networks':_0x5581a9||[]});fs[_0xd5a9('0x4d')](util['format'](_0xd5a9('0x55'),_0x5dfab0['body'][_0xd5a9('0x44')][_0xd5a9('0x56')]()),_0x202460);return respondWithRpcPromise(_0xd5a9('0x4f'),_0xd5a9('0x41'),{'module':'chan_sip.so'});}})[_0xd5a9('0xc')](function(){return _0x59fc61;})[_0xd5a9('0xc')](respondWithResult(_0x577f9c,0xc9))['catch'](handleError(_0x577f9c,null));};exports[_0xd5a9('0x1f')]=function(_0x4b5252,_0x25583d){var _0x410341;return db[_0xd5a9('0x27')][_0xd5a9('0x40')]({'where':{'id':_0x4b5252['params']['id']}})[_0xd5a9('0xc')](handleEntityNotFound(_0x25583d,null))[_0xd5a9('0xc')](saveUpdates(_0x4b5252[_0xd5a9('0x42')],null))[_0xd5a9('0xc')](function(_0x18d1ad){if(_0x18d1ad){_0x410341=_0x18d1ad;return db[_0xd5a9('0x27')]['findAll']({'where':{'type':_0x410341[_0xd5a9('0x44')]},'raw':!![]});}return null;})[_0xd5a9('0xc')](function(_0x4e5a8f){if(_0x410341[_0xd5a9('0x44')]['toUpperCase']()==_0xd5a9('0x46')){var _0x273eec=fs[_0xd5a9('0x47')](path['join'](config[_0xd5a9('0x49')],'server/files/templates/stun_multiple.ejs'),_0xd5a9('0x4b'));var _0x1fce2e=ejs[_0xd5a9('0x4c')](_0x273eec,{'networks':_0x4e5a8f||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1fce2e);return respondWithRpcPromise(_0xd5a9('0x4f'),_0xd5a9('0x1f'),{'module':_0xd5a9('0x50')});}else if(_0x410341[_0xd5a9('0x44')][_0xd5a9('0x45')]()==_0xd5a9('0x51')){var _0x290fb3=fs['readFileSync'](path[_0xd5a9('0x48')](config['root'],_0xd5a9('0x52')),'utf8');var _0x3c625a=ejs[_0xd5a9('0x4c')](_0x290fb3,{'networks':_0x4e5a8f||[]});fs[_0xd5a9('0x4d')]('/etc/asterisk/turn_xcally.conf',_0x3c625a);return respondWithRpcPromise(_0xd5a9('0x4f'),_0xd5a9('0x1f'),{'module':'res_stun_monitor.so'});}else{var _0xcb115e=fs[_0xd5a9('0x47')](path[_0xd5a9('0x48')](config[_0xd5a9('0x49')],_0xd5a9('0x54')),'utf8');var _0x10394b=ejs[_0xd5a9('0x4c')](_0xcb115e,{'networks':_0x4e5a8f||[]});fs['writeFileSync'](util['format'](_0xd5a9('0x55'),_0x4b5252[_0xd5a9('0x42')][_0xd5a9('0x44')][_0xd5a9('0x56')]()),_0x10394b);return respondWithRpcPromise('Reload','update',{'module':_0xd5a9('0x57')});}})[_0xd5a9('0xc')](function(_0xfa9196){if(_0xfa9196){return _0x410341;}return null;})[_0xd5a9('0xc')](respondWithResult(_0x25583d,null))['catch'](handleError(_0x25583d,null));};exports[_0xd5a9('0x20')]=function(_0x1608be,_0x3171de){var _0x5ceb3d;return db['Network'][_0xd5a9('0x40')]({'where':{'id':_0x1608be[_0xd5a9('0x3e')]['id']}})[_0xd5a9('0xc')](function(_0x4d22c9){_0x5ceb3d=_0x4d22c9;return _0x4d22c9;})[_0xd5a9('0xc')](handleEntityNotFound(_0x3171de,null))[_0xd5a9('0xc')](removeEntity(_0x3171de,null))[_0xd5a9('0xc')](function(){if(_0x5ceb3d){return db[_0xd5a9('0x27')]['findAll']({'where':{'type':_0x5ceb3d[_0xd5a9('0x44')]},'raw':!![]});}})[_0xd5a9('0xc')](function(_0x3a3f5d){if(_0x5ceb3d[_0xd5a9('0x44')]['toUpperCase']()==_0xd5a9('0x46')){var _0x2981c2=fs[_0xd5a9('0x47')](path[_0xd5a9('0x48')](config[_0xd5a9('0x49')],_0xd5a9('0x4a')),_0xd5a9('0x4b'));var _0x1540a2=ejs[_0xd5a9('0x4c')](_0x2981c2,{'networks':_0x3a3f5d||[]});fs[_0xd5a9('0x4d')]('/etc/asterisk/stun_xcally.conf',_0x1540a2);return respondWithRpcPromise(_0xd5a9('0x4f'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x5ceb3d[_0xd5a9('0x44')][_0xd5a9('0x45')]()=='TURN'){var _0x25cf0f=fs[_0xd5a9('0x47')](path[_0xd5a9('0x48')](config[_0xd5a9('0x49')],_0xd5a9('0x52')),'utf8');var _0x5921be=ejs['render'](_0x25cf0f,{'networks':_0x3a3f5d||[]});fs[_0xd5a9('0x4d')](_0xd5a9('0x53'),_0x5921be);return respondWithRpcPromise('Reload',_0xd5a9('0x20'),{'module':_0xd5a9('0x50')});}else{var _0x3dc00e=fs[_0xd5a9('0x47')](path[_0xd5a9('0x48')](config[_0xd5a9('0x49')],'server/files/templates/network.ejs'),_0xd5a9('0x4b'));var _0x13f8c0=ejs['render'](_0x3dc00e,{'networks':_0x3a3f5d||[]});fs[_0xd5a9('0x4d')](util['format'](_0xd5a9('0x55'),_0x5ceb3d['type']['toLowerCase']()),_0x13f8c0);return respondWithRpcPromise('Reload',_0xd5a9('0x20'),{'module':_0xd5a9('0x57')});}})[_0xd5a9('0x16')](handleError(_0x3171de,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 2c2e529..8626b8b 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 _0xbf6e=['./network.attributes','exports','define','Network','network','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5b9041,_0x3516ee){var _0x38094e=function(_0x127c4b){while(--_0x127c4b){_0x5b9041['push'](_0x5b9041['shift']());}};_0x38094e(++_0x3516ee);}(_0xbf6e,0x149));var _0xebf6=function(_0x17e88d,_0x5330f7){_0x17e88d=_0x17e88d-0x0;var _0x52137a=_0xbf6e[_0x17e88d];return _0x52137a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xebf6('0x0'))(_0xebf6('0x1'));var moment=require(_0xebf6('0x2'));var BPromise=require(_0xebf6('0x3'));var rp=require(_0xebf6('0x4'));var fs=require('fs');var path=require(_0xebf6('0x5'));var rimraf=require(_0xebf6('0x6'));var config=require('../../config/environment');var attributes=require(_0xebf6('0x7'));module[_0xebf6('0x8')]=function(_0x3b2bb6,_0x1e15cf){return _0x3b2bb6[_0xebf6('0x9')](_0xebf6('0xa'),attributes,{'tableName':_0xebf6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3140=['../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2d98c2,_0x1c016c){var _0x1c935b=function(_0x7134db){while(--_0x7134db){_0x2d98c2['push'](_0x2d98c2['shift']());}};_0x1c935b(++_0x1c016c);}(_0x3140,0xaf));var _0x0314=function(_0x42e6e7,_0x4ee4f6){_0x42e6e7=_0x42e6e7-0x0;var _0x32909b=_0x3140[_0x42e6e7];return _0x32909b;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var logger=require(_0x0314('0x2'))(_0x0314('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0314('0x4'));var fs=require('fs');var path=require(_0x0314('0x5'));var rimraf=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var attributes=require(_0x0314('0x8'));module[_0x0314('0x9')]=function(_0x9e308d,_0xf87d26){return _0x9e308d[_0x0314('0xa')](_0x0314('0xb'),attributes,{'tableName':_0x0314('0xc'),'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 015d5cd..9b6d785 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e2725,_0x505fd1){var _0x32b9be=function(_0x166954){while(--_0x166954){_0x1e2725['push'](_0x1e2725['shift']());}};_0x32b9be(++_0x505fd1);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _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(_0x4bb143,_0xc0aa5d){var _0x3f85d4=function(_0x533587){while(--_0x533587){_0x4bb143['push'](_0x4bb143['shift']());}};_0x3f85d4(++_0xc0aa5d);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 31a764e..f241338 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 _0xccf9=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','getAgents','post','create','addDisposition','/:id/notify','addApplications','/:id/users','addAgents','/:id/send','send','delete','destroy','removeAgents'];(function(_0xe2206b,_0x158dbd){var _0x3ebe97=function(_0x4b88a6){while(--_0x4b88a6){_0xe2206b['push'](_0xe2206b['shift']());}};_0x3ebe97(++_0x158dbd);}(_0xccf9,0x1c7));var _0x9ccf=function(_0x5138ee,_0x9eb4b9){_0x5138ee=_0x5138ee-0x0;var _0x138e1a=_0xccf9[_0x5138ee];return _0x138e1a;};'use strict';var multer=require(_0x9ccf('0x0'));var util=require(_0x9ccf('0x1'));var path=require(_0x9ccf('0x2'));var timeout=require(_0x9ccf('0x3'));var express=require(_0x9ccf('0x4'));var router=express['Router']();var fs_extra=require(_0x9ccf('0x5'));var auth=require(_0x9ccf('0x6'));var interaction=require(_0x9ccf('0x7'));var config=require(_0x9ccf('0x8'));var controller=require(_0x9ccf('0x9'));router[_0x9ccf('0xa')]('/',auth['isAuthenticated'](),controller[_0x9ccf('0xb')]);router['get'](_0x9ccf('0xc'),auth[_0x9ccf('0xd')](),controller[_0x9ccf('0xe')]);router[_0x9ccf('0xa')](_0x9ccf('0xf'),auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x10')]);router[_0x9ccf('0xa')](_0x9ccf('0x11'),auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x12')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x9ccf('0x13'),auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x14')]);router[_0x9ccf('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x9ccf('0x15')]);router[_0x9ccf('0xa')]('/:id/users',auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x16')]);router[_0x9ccf('0x17')]('/',auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x18')]);router[_0x9ccf('0x17')]('/:id/dispositions',auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x19')]);router[_0x9ccf('0x17')]('/:id/canned_answers',auth[_0x9ccf('0xd')](),controller['addAnswer']);router[_0x9ccf('0x17')](_0x9ccf('0x1a'),controller['notify']);router[_0x9ccf('0x17')](_0x9ccf('0x13'),auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x1b')]);router[_0x9ccf('0x17')](_0x9ccf('0x1c'),auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x1d')]);router[_0x9ccf('0x17')](_0x9ccf('0x1e'),auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x1f')]);router['put'](_0x9ccf('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9ccf('0x20')](_0x9ccf('0xf'),auth[_0x9ccf('0xd')](),controller[_0x9ccf('0x21')]);router[_0x9ccf('0x20')](_0x9ccf('0x11'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x9ccf('0x20')]('/:id/canned_answers',auth[_0x9ccf('0xd')](),controller['removeAnswers']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x9ccf('0x22')]);module['exports']=router; \ No newline at end of file +var _0xf27d=['removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','/:id','update','destroy','removeDispositions','delete'];(function(_0x4b1908,_0xcac5f5){var _0x4df1d0=function(_0x4d1321){while(--_0x4d1321){_0x4b1908['push'](_0x4b1908['shift']());}};_0x4df1d0(++_0xcac5f5);}(_0xf27d,0x13a));var _0xdf27=function(_0x53935f,_0xab8c3d){_0x53935f=_0x53935f-0x0;var _0xd4774e=_0xf27d[_0x53935f];return _0xd4774e;};'use strict';var multer=require('multer');var util=require(_0xdf27('0x0'));var path=require(_0xdf27('0x1'));var timeout=require(_0xdf27('0x2'));var express=require(_0xdf27('0x3'));var router=express[_0xdf27('0x4')]();var fs_extra=require(_0xdf27('0x5'));var auth=require(_0xdf27('0x6'));var interaction=require(_0xdf27('0x7'));var config=require(_0xdf27('0x8'));var controller=require(_0xdf27('0x9'));router[_0xdf27('0xa')]('/',auth[_0xdf27('0xb')](),controller['index']);router[_0xdf27('0xa')](_0xdf27('0xc'),auth[_0xdf27('0xb')](),controller[_0xdf27('0xd')]);router['get']('/:id',auth[_0xdf27('0xb')](),controller[_0xdf27('0xe')]);router[_0xdf27('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xdf27('0xa')](_0xdf27('0xf'),auth[_0xdf27('0xb')](),controller[_0xdf27('0x10')]);router['get'](_0xdf27('0x11'),auth[_0xdf27('0xb')](),controller[_0xdf27('0x12')]);router['get']('/:id/interactions',auth[_0xdf27('0xb')](),controller[_0xdf27('0x13')]);router[_0xdf27('0xa')](_0xdf27('0x14'),auth[_0xdf27('0xb')](),controller['getAgents']);router[_0xdf27('0x15')]('/',auth['isAuthenticated'](),controller[_0xdf27('0x16')]);router[_0xdf27('0x15')](_0xdf27('0x17'),auth[_0xdf27('0xb')](),controller[_0xdf27('0x18')]);router['post'](_0xdf27('0xf'),auth[_0xdf27('0xb')](),controller[_0xdf27('0x19')]);router[_0xdf27('0x15')]('/:id/notify',controller[_0xdf27('0x1a')]);router['post']('/:id/applications',auth[_0xdf27('0xb')](),controller[_0xdf27('0x1b')]);router[_0xdf27('0x15')]('/:id/users',auth[_0xdf27('0xb')](),controller[_0xdf27('0x1c')]);router['post'](_0xdf27('0x1d'),auth[_0xdf27('0xb')](),controller[_0xdf27('0x1e')]);router[_0xdf27('0x1f')](_0xdf27('0x20'),auth[_0xdf27('0xb')](),controller[_0xdf27('0x21')]);router['delete'](_0xdf27('0x20'),auth['isAuthenticated'](),controller[_0xdf27('0x22')]);router['delete'](_0xdf27('0x17'),auth[_0xdf27('0xb')](),controller[_0xdf27('0x23')]);router[_0xdf27('0x24')](_0xdf27('0xf'),auth[_0xdf27('0xb')](),controller['removeAnswers']);router[_0xdf27('0x24')](_0xdf27('0x14'),auth[_0xdf27('0xb')](),controller[_0xdf27('0x25')]);module[_0xdf27('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 eb51d22..ca860d1 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 _0x8a4d=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','randomstring','STRING','name','generate','TEXT','BOOLEAN'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x8a4d,0x14f));var _0xd8a4=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0x8a4d[_0x4f8f3b];return _0x4c250c;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd8a4('0x0'));module['exports']={'name':{'type':Sequelize[_0xd8a4('0x1')],'unique':_0xd8a4('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd8a4('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd8a4('0x3')]();}},'replyUri':{'type':Sequelize[_0xd8a4('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd8a4('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd8a4('0x4')],'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[_0xd8a4('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xd8a4('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd8a4('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd8a4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd8a4('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd8a4('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xd8a4('0x5')],'defaultValue':![],'comment':_0xd8a4('0x8'),'set':function(_0x5b2946){if(!_0x5b2946)this['setDataValue'](_0xd8a4('0x9'),null);this[_0xd8a4('0xa')]('mandatoryDisposition',_0x5b2946);}}}; \ No newline at end of file +var _0x500c=['name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x107f87,_0x2fc1b3){var _0x1a18fe=function(_0x4d737c){while(--_0x4d737c){_0x107f87['push'](_0x107f87['shift']());}};_0x1a18fe(++_0x2fc1b3);}(_0x500c,0x16a));var _0xc500=function(_0x18fc61,_0x5082c3){_0x18fc61=_0x18fc61-0x0;var _0x41d3f5=_0x500c[_0x18fc61];return _0x41d3f5;};'use strict';var Sequelize=require(_0xc500('0x0'));var rs=require('randomstring');module[_0xc500('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc500('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc500('0x3')]},'token':{'type':Sequelize[_0xc500('0x3')],'defaultValue':function(){return rs[_0xc500('0x4')]();}},'replyUri':{'type':Sequelize[_0xc500('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc500('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc500('0x5')],'defaultValue':function(){return _0xc500('0x6');}},'notificationSound':{'type':Sequelize[_0xc500('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc500('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc500('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc500('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc500('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc500('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc500('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xc500('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc500('0x7')],'defaultValue':![],'comment':_0xc500('0xa'),'set':function(_0x1ff988){if(!_0x1ff988)this[_0xc500('0xb')](_0xc500('0xc'),null);this[_0xc500('0xb')](_0xc500('0xd'),_0x1ff988);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8f1fbc7..086048d 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 _0x55ca=['findAll','rows','show','Pause','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','autoAssociation','UserProfileResource','params','describe','addDisposition','Disposition','getDispositions','findOne','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','CmContact','ValidationError','createdAt','updatedAt','difference','CompanyId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','Applications','List','account','applications','orderBy','priority','asc','defaults','from','ListId','mapKey','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','Transaction','READ_COMMITTED','OpenchannelAccountId','bulkCreate','finally','getApplications','OpenchannelApplication','hasOwnProperty','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','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','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','stack','name','send','OpenchannelAccount','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include'];(function(_0x36802a,_0x31c1af){var _0x27b418=function(_0x3f5ecc){while(--_0x3f5ecc){_0x36802a['push'](_0x36802a['shift']());}};_0x27b418(++_0x31c1af);}(_0x55ca,0x126));var _0xa55c=function(_0x35b07d,_0x3d0ae7){_0x35b07d=_0x35b07d-0x0;var _0x2868bc=_0x55ca[_0x35b07d];return _0x2868bc;};'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'];config['redis']=_['defaults'](config[_0xa55c('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa55c('0x19'))[_0xa55c('0x1a')](socket);var jayson=require(_0xa55c('0x1b'));var client=jayson[_0xa55c('0x1c')][_0xa55c('0x1d')]({'port':0x232c});var client9002=jayson[_0xa55c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ccf65,_0x3dcf4f,_0x25934f,_0x31e10d){return new BPromise(function(_0x1c4cfd,_0x3ae86b){var _0x51590e=_0x31e10d||client;return _0x51590e[_0xa55c('0x1e')](_0x3ccf65,_0x25934f)[_0xa55c('0x1f')](function(_0x4cee3c){logger[_0xa55c('0x20')](_0xa55c('0x21'),_0x3dcf4f,_0xa55c('0x22'));logger[_0xa55c('0x23')](_0xa55c('0x24'),_0x3dcf4f,_0xa55c('0x22'),JSON['stringify'](_0x4cee3c));if(_0x4cee3c['error']){if(_0x4cee3c[_0xa55c('0x25')][_0xa55c('0x26')]===0x1f4){logger[_0xa55c('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x3dcf4f,_0x4cee3c[_0xa55c('0x25')][_0xa55c('0x27')]);return _0x3ae86b(_0x4cee3c['error'][_0xa55c('0x27')]);}logger[_0xa55c('0x25')](_0xa55c('0x21'),_0x3dcf4f,_0x4cee3c[_0xa55c('0x25')][_0xa55c('0x27')]);return _0x1c4cfd(_0x4cee3c['error'][_0xa55c('0x27')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3dcf4f,'request\x20sent');_0x1c4cfd(_0x4cee3c[_0xa55c('0x28')]['message']);}})[_0xa55c('0x29')](function(_0x190757){logger[_0xa55c('0x25')](_0xa55c('0x21'),_0x3dcf4f,_0x190757);_0x3ae86b(_0x190757);});});}function respondWithStatusCode(_0x2313a9,_0x170ba4){_0x170ba4=_0x170ba4||0xcc;return function(_0x1da633){if(_0x1da633){return _0x2313a9[_0xa55c('0x2a')](_0x170ba4);}return _0x2313a9[_0xa55c('0x2b')](_0x170ba4)[_0xa55c('0x2c')]();};}function respondWithResult(_0x1273d7,_0x57f271){_0x57f271=_0x57f271||0xc8;return function(_0x430d55){if(_0x430d55){return _0x1273d7[_0xa55c('0x2b')](_0x57f271)[_0xa55c('0x2d')](_0x430d55);}};}function respondWithFilteredResult(_0x906caa,_0x5d940d){return function(_0x1377b0){if(_0x1377b0){var _0x22f6b6=typeof _0x5d940d[_0xa55c('0x2e')]===_0xa55c('0x2f')&&typeof _0x5d940d[_0xa55c('0x30')]===_0xa55c('0x2f');var _0x52d37f=_0x1377b0[_0xa55c('0x31')];var _0x490b7d=_0x22f6b6?0x0:_0x5d940d[_0xa55c('0x2e')];var _0x1d730b=_0x22f6b6?_0x1377b0[_0xa55c('0x31')]:_0x5d940d[_0xa55c('0x2e')]+_0x5d940d['limit'];var _0x3d28fb;if(_0x1d730b>=_0x52d37f){_0x1d730b=_0x52d37f;_0x3d28fb=0xc8;}else{_0x3d28fb=0xce;}_0x906caa[_0xa55c('0x2b')](_0x3d28fb);return _0x906caa[_0xa55c('0x32')](_0xa55c('0x33'),_0x490b7d+'-'+_0x1d730b+'/'+_0x52d37f)[_0xa55c('0x2d')](_0x1377b0);}return null;};}function patchUpdates(_0x1225c3){return function(_0x29748a){try{jsonpatch[_0xa55c('0x34')](_0x29748a,_0x1225c3,!![]);}catch(_0x2808e9){return BPromise[_0xa55c('0x35')](_0x2808e9);}return _0x29748a[_0xa55c('0x36')]();};}function saveUpdates(_0x4eb7c4,_0x54ca97){return function(_0x4146f3){if(_0x4146f3){return _0x4146f3[_0xa55c('0x37')](_0x4eb7c4)['then'](function(_0x30fadd){return _0x30fadd;});}return null;};}function removeEntity(_0x2f0110,_0x2e9623){return function(_0x1839ac){if(_0x1839ac){return _0x1839ac[_0xa55c('0x38')]()[_0xa55c('0x1f')](function(){var _0x3ce1b3=_0x1839ac[_0xa55c('0x39')]({'plain':!![]});var _0x3959e3='OpenchannelAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x3959e3,'resourceId':_0x3ce1b3['id']}})[_0xa55c('0x1f')](function(){return _0x1839ac;});})[_0xa55c('0x1f')](function(){_0x2f0110[_0xa55c('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x768408,_0x547930){return function(_0x119220){if(!_0x119220){_0x768408['sendStatus'](0x194);}return _0x119220;};}function handleError(_0x18c6f1,_0x39267c){_0x39267c=_0x39267c||0x1f4;return function(_0x3c0ec1){logger['error'](_0x3c0ec1[_0xa55c('0x3a')]);if(_0x3c0ec1[_0xa55c('0x3b')]){delete _0x3c0ec1['name'];}_0x18c6f1[_0xa55c('0x2b')](_0x39267c)[_0xa55c('0x3c')](_0x3c0ec1);};}exports['index']=function(_0x529ff8,_0x235f6b){var _0x5d3960={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1e75dc={},_0x284bcf={'count':0x0,'rows':[]};var _0x5e50b6=_['map'](db[_0xa55c('0x3d')][_0xa55c('0x3e')],function(_0x429336){return{'name':_0x429336[_0xa55c('0x3f')],'type':_0x429336[_0xa55c('0x40')]['key']};});_0x1e75dc[_0xa55c('0x41')]=_[_0xa55c('0x42')](_0x5e50b6,_0xa55c('0x3b'));_0x1e75dc[_0xa55c('0x43')]=_[_0xa55c('0x44')](_0x529ff8[_0xa55c('0x43')]);_0x1e75dc['filters']=_[_0xa55c('0x45')](_0x1e75dc['model'],_0x1e75dc['query']);_0x5d3960[_0xa55c('0x46')]=_[_0xa55c('0x45')](_0x1e75dc['model'],qs[_0xa55c('0x47')](_0x529ff8['query']['fields']));_0x5d3960[_0xa55c('0x46')]=_0x5d3960[_0xa55c('0x46')][_0xa55c('0x48')]?_0x5d3960['attributes']:_0x1e75dc[_0xa55c('0x41')];if(!_0x529ff8[_0xa55c('0x43')]['hasOwnProperty'](_0xa55c('0x49'))){_0x5d3960['limit']=qs[_0xa55c('0x30')](_0x529ff8[_0xa55c('0x43')]['limit']);_0x5d3960[_0xa55c('0x2e')]=qs[_0xa55c('0x2e')](_0x529ff8['query'][_0xa55c('0x2e')]);}_0x5d3960[_0xa55c('0x4a')]=qs[_0xa55c('0x4b')](_0x529ff8['query'][_0xa55c('0x4b')]);_0x5d3960['where']=qs[_0xa55c('0x4c')](_[_0xa55c('0x4d')](_0x529ff8[_0xa55c('0x43')],_0x1e75dc['filters']),_0x5e50b6);if(_0x529ff8[_0xa55c('0x43')][_0xa55c('0x4e')]){_0x5d3960['where']=_[_0xa55c('0x4f')](_0x5d3960[_0xa55c('0x50')],{'$or':_['map'](_0x5e50b6,function(_0x11ff1d){if(_0x11ff1d[_0xa55c('0x40')]!=='VIRTUAL'){var _0x46f839={};_0x46f839[_0x11ff1d[_0xa55c('0x3b')]]={'$like':'%'+_0x529ff8[_0xa55c('0x43')][_0xa55c('0x4e')]+'%'};return _0x46f839;}})});}_0x5d3960=_['merge']({},_0x5d3960,_0x529ff8[_0xa55c('0x51')]);var _0x58a7ea={'where':_0x5d3960[_0xa55c('0x50')]};return db[_0xa55c('0x3d')][_0xa55c('0x31')](_0x58a7ea)['then'](function(_0x39bd3d){_0x284bcf[_0xa55c('0x31')]=_0x39bd3d;if(_0x529ff8['query'][_0xa55c('0x52')]){_0x5d3960[_0xa55c('0x53')]=[{'all':!![]}];}return db[_0xa55c('0x3d')][_0xa55c('0x54')](_0x5d3960);})[_0xa55c('0x1f')](function(_0x1c84d9){_0x284bcf[_0xa55c('0x55')]=_0x1c84d9;return _0x284bcf;})[_0xa55c('0x1f')](respondWithFilteredResult(_0x235f6b,_0x5d3960))[_0xa55c('0x29')](handleError(_0x235f6b,null));};exports[_0xa55c('0x56')]=function(_0x4fc0a9,_0x13e1d4){var _0x46e27d={'raw':![],'where':{'id':_0x4fc0a9['params']['id']},'include':[{'model':db[_0xa55c('0x57')],'as':_0xa55c('0x58')}]},_0x216de8={};_0x216de8['model']=_[_0xa55c('0x44')](db['OpenchannelAccount'][_0xa55c('0x3e')]);_0x216de8[_0xa55c('0x43')]=_[_0xa55c('0x44')](_0x4fc0a9[_0xa55c('0x43')]);_0x216de8[_0xa55c('0x4c')]=_['intersection'](_0x216de8[_0xa55c('0x41')],_0x216de8[_0xa55c('0x43')]);_0x46e27d['attributes']=_[_0xa55c('0x45')](_0x216de8[_0xa55c('0x41')],qs[_0xa55c('0x47')](_0x4fc0a9[_0xa55c('0x43')]['fields']));_0x46e27d['attributes']=_0x46e27d[_0xa55c('0x46')][_0xa55c('0x48')]?_0x46e27d[_0xa55c('0x46')]:_0x216de8[_0xa55c('0x41')];if(_0x4fc0a9['query'][_0xa55c('0x52')]){_0x46e27d['include']=[{'all':!![]}];}_0x46e27d=_[_0xa55c('0x4f')]({},_0x46e27d,_0x4fc0a9[_0xa55c('0x51')]);return db[_0xa55c('0x3d')][_0xa55c('0x59')](_0x46e27d)[_0xa55c('0x1f')](handleEntityNotFound(_0x13e1d4,null))['then'](respondWithResult(_0x13e1d4,null))[_0xa55c('0x29')](handleError(_0x13e1d4,null));};exports['create']=function(_0x23f67f,_0x157afe){return db[_0xa55c('0x3d')][_0xa55c('0x5a')](_0x23f67f[_0xa55c('0x5b')],{})[_0xa55c('0x1f')](function(_0x5d14e0){var _0x53e2be=_0x23f67f[_0xa55c('0x5c')][_0xa55c('0x39')]({'plain':!![]});if(!_0x53e2be)throw new Error(_0xa55c('0x5d'));if(_0x53e2be[_0xa55c('0x5e')]===_0xa55c('0x5c')){var _0x5ba2b0=_0x5d14e0[_0xa55c('0x39')]({'plain':!![]});var _0x3cd40d=_0xa55c('0x5f');return db[_0xa55c('0x60')][_0xa55c('0x59')]({'where':{'name':_0x3cd40d,'userProfileId':_0x53e2be['userProfileId']},'raw':!![]})[_0xa55c('0x1f')](function(_0x21725b){if(_0x21725b&&_0x21725b[_0xa55c('0x61')]===0x0){return db[_0xa55c('0x62')][_0xa55c('0x5a')]({'name':_0x5ba2b0['name'],'resourceId':_0x5ba2b0['id'],'type':_0x21725b[_0xa55c('0x3b')],'sectionId':_0x21725b['id']},{})['then'](function(){return _0x5d14e0;});}else{return _0x5d14e0;}})[_0xa55c('0x29')](function(_0x5e3a28){logger[_0xa55c('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e3a28);throw _0x5e3a28;});}return _0x5d14e0;})[_0xa55c('0x1f')](respondWithResult(_0x157afe,0xc9))[_0xa55c('0x29')](handleError(_0x157afe,null));};exports[_0xa55c('0x37')]=function(_0x2f811e,_0x4cb38c){if(_0x2f811e[_0xa55c('0x5b')]['id']){delete _0x2f811e[_0xa55c('0x5b')]['id'];}return db[_0xa55c('0x3d')][_0xa55c('0x59')]({'where':{'id':_0x2f811e[_0xa55c('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0xa55c('0x58')}]})[_0xa55c('0x1f')](handleEntityNotFound(_0x4cb38c,null))['then'](saveUpdates(_0x2f811e[_0xa55c('0x5b')],null))[_0xa55c('0x1f')](respondWithResult(_0x4cb38c,null))[_0xa55c('0x29')](handleError(_0x4cb38c,null));};exports[_0xa55c('0x38')]=function(_0x1b8b06,_0xa38271){return db[_0xa55c('0x3d')][_0xa55c('0x59')]({'where':{'id':_0x1b8b06['params']['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0xa38271,null))[_0xa55c('0x1f')](removeEntity(_0xa38271,null))[_0xa55c('0x29')](handleError(_0xa38271,null));};exports[_0xa55c('0x64')]=function(_0x1a52b9,_0x1bcb40){return db[_0xa55c('0x3d')][_0xa55c('0x64')]()[_0xa55c('0x1f')](respondWithResult(_0x1bcb40,null))['catch'](handleError(_0x1bcb40,null));};exports[_0xa55c('0x65')]=function(_0x4174eb,_0x40c56a,_0x26606c){if(_0x4174eb[_0xa55c('0x5b')]['id']){delete _0x4174eb[_0xa55c('0x5b')]['id'];}return db[_0xa55c('0x3d')][_0xa55c('0x59')]({'where':{'id':_0x4174eb[_0xa55c('0x63')]['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0x40c56a,null))[_0xa55c('0x1f')](function(_0x5c598a){if(_0x5c598a){_0x4174eb[_0xa55c('0x5b')]['OpenchannelAccountId']=_0x5c598a['id'];return db[_0xa55c('0x66')][_0xa55c('0x5a')](_0x4174eb[_0xa55c('0x5b')]);}})['then'](respondWithResult(_0x40c56a,null))['catch'](handleError(_0x40c56a,null));};exports[_0xa55c('0x67')]=function(_0x182cd9,_0x23c84c,_0x42529f){var _0x4c7ee1={'raw':![],'where':{}};var _0x149cb9={};var _0xd02251={'count':0x0,'rows':[]};return db[_0xa55c('0x3d')][_0xa55c('0x68')]({'where':{'id':_0x182cd9[_0xa55c('0x63')]['id']}})['then'](handleEntityNotFound(_0x23c84c,null))['then'](function(_0x3f7fca){if(_0x3f7fca){_0x149cb9[_0xa55c('0x41')]=_[_0xa55c('0x44')](db[_0xa55c('0x66')][_0xa55c('0x3e')]);_0x149cb9['query']=_[_0xa55c('0x44')](_0x182cd9[_0xa55c('0x43')]);_0x149cb9['filters']=_[_0xa55c('0x45')](_0x149cb9[_0xa55c('0x41')],_0x149cb9[_0xa55c('0x43')]);_0x4c7ee1['attributes']=_[_0xa55c('0x45')](_0x149cb9[_0xa55c('0x41')],qs[_0xa55c('0x47')](_0x182cd9[_0xa55c('0x43')][_0xa55c('0x47')]));_0x4c7ee1['attributes']=_0x4c7ee1[_0xa55c('0x46')][_0xa55c('0x48')]?_0x4c7ee1['attributes']:_0x149cb9['model'];if(!_0x182cd9[_0xa55c('0x43')]['hasOwnProperty'](_0xa55c('0x49'))){_0x4c7ee1[_0xa55c('0x30')]=qs[_0xa55c('0x30')](_0x182cd9[_0xa55c('0x43')][_0xa55c('0x30')]);_0x4c7ee1[_0xa55c('0x2e')]=qs[_0xa55c('0x2e')](_0x182cd9[_0xa55c('0x43')][_0xa55c('0x2e')]);}_0x4c7ee1['order']=qs[_0xa55c('0x4b')](_0x182cd9[_0xa55c('0x43')][_0xa55c('0x4b')]);_0x4c7ee1[_0xa55c('0x50')]=qs['filters'](_[_0xa55c('0x4d')](_0x182cd9[_0xa55c('0x43')],_0x149cb9[_0xa55c('0x4c')]));_0x4c7ee1[_0xa55c('0x50')]['OpenchannelAccountId']=_0x3f7fca['id'];if(_0x182cd9['query'][_0xa55c('0x4e')]){_0x4c7ee1[_0xa55c('0x50')]=_[_0xa55c('0x4f')](_0x4c7ee1[_0xa55c('0x50')],{'$or':_['map'](_0x4c7ee1['attributes'],function(_0x40663){var _0x3b2a5c={};_0x3b2a5c[_0x40663]={'$like':'%'+_0x182cd9[_0xa55c('0x43')][_0xa55c('0x4e')]+'%'};return _0x3b2a5c;})});}_0x4c7ee1=_[_0xa55c('0x4f')]({},_0x4c7ee1,_0x182cd9[_0xa55c('0x51')]);return db[_0xa55c('0x66')]['count']({'where':_0x4c7ee1[_0xa55c('0x50')]})['then'](function(_0x2859a0){_0xd02251['count']=_0x2859a0;if(_0x182cd9[_0xa55c('0x43')][_0xa55c('0x52')]){_0x4c7ee1[_0xa55c('0x53')]=[{'all':!![]}];}return db[_0xa55c('0x66')][_0xa55c('0x54')](_0x4c7ee1);})[_0xa55c('0x1f')](function(_0x1ea5b6){_0xd02251[_0xa55c('0x55')]=_0x1ea5b6;return _0xd02251;});}})['then'](respondWithFilteredResult(_0x23c84c,_0x4c7ee1))['catch'](handleError(_0x23c84c,null));};exports[_0xa55c('0x69')]=function(_0x2948b1,_0xc2ad5c,_0x256db0){return db[_0xa55c('0x3d')][_0xa55c('0x59')]({'where':{'id':_0x2948b1['params']['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0xc2ad5c,null))[_0xa55c('0x1f')](function(_0x301e56){if(_0x301e56){return _0x301e56[_0xa55c('0x69')](_0x2948b1[_0xa55c('0x43')][_0xa55c('0x6a')]);}})[_0xa55c('0x1f')](respondWithStatusCode(_0xc2ad5c,null))[_0xa55c('0x29')](handleError(_0xc2ad5c,null));};exports['addAnswer']=function(_0x25d09d,_0xb29c7c,_0x42d773){if(_0x25d09d[_0xa55c('0x5b')]['id']){delete _0x25d09d[_0xa55c('0x5b')]['id'];}return db['OpenchannelAccount'][_0xa55c('0x59')]({'where':{'id':_0x25d09d[_0xa55c('0x63')]['id']}})['then'](handleEntityNotFound(_0xb29c7c,null))['then'](function(_0x1f7b00){if(_0x1f7b00){_0x25d09d[_0xa55c('0x5b')]['OpenchannelAccountId']=_0x1f7b00['id'];return db['CannedAnswer']['create'](_0x25d09d['body']);}})[_0xa55c('0x1f')](respondWithResult(_0xb29c7c,null))[_0xa55c('0x29')](handleError(_0xb29c7c,null));};exports[_0xa55c('0x6b')]=function(_0x1a2f31,_0x3e7aa2,_0x3c07ed){var _0x568a5b={'raw':![],'where':{}};var _0xf4ea45={};var _0x3b6abe={'count':0x0,'rows':[]};return db[_0xa55c('0x3d')][_0xa55c('0x68')]({'where':{'id':_0x1a2f31['params']['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0x3e7aa2,null))[_0xa55c('0x1f')](function(_0x36824c){if(_0x36824c){_0xf4ea45['model']=_[_0xa55c('0x44')](db['CannedAnswer']['rawAttributes']);_0xf4ea45[_0xa55c('0x43')]=_[_0xa55c('0x44')](_0x1a2f31[_0xa55c('0x43')]);_0xf4ea45[_0xa55c('0x4c')]=_[_0xa55c('0x45')](_0xf4ea45[_0xa55c('0x41')],_0xf4ea45[_0xa55c('0x43')]);_0x568a5b['attributes']=_['intersection'](_0xf4ea45[_0xa55c('0x41')],qs[_0xa55c('0x47')](_0x1a2f31[_0xa55c('0x43')][_0xa55c('0x47')]));_0x568a5b[_0xa55c('0x46')]=_0x568a5b[_0xa55c('0x46')][_0xa55c('0x48')]?_0x568a5b[_0xa55c('0x46')]:_0xf4ea45[_0xa55c('0x41')];if(!_0x1a2f31[_0xa55c('0x43')]['hasOwnProperty'](_0xa55c('0x49'))){_0x568a5b[_0xa55c('0x30')]=qs['limit'](_0x1a2f31[_0xa55c('0x43')]['limit']);_0x568a5b[_0xa55c('0x2e')]=qs[_0xa55c('0x2e')](_0x1a2f31[_0xa55c('0x43')][_0xa55c('0x2e')]);}_0x568a5b[_0xa55c('0x4a')]=qs['sort'](_0x1a2f31[_0xa55c('0x43')][_0xa55c('0x4b')]);_0x568a5b[_0xa55c('0x50')]=qs[_0xa55c('0x4c')](_[_0xa55c('0x4d')](_0x1a2f31[_0xa55c('0x43')],_0xf4ea45[_0xa55c('0x4c')]));_0x568a5b['where']['OpenchannelAccountId']=_0x36824c['id'];if(_0x1a2f31['query'][_0xa55c('0x4e')]){_0x568a5b['where']=_[_0xa55c('0x4f')](_0x568a5b[_0xa55c('0x50')],{'$or':_[_0xa55c('0x42')](_0x568a5b[_0xa55c('0x46')],function(_0x26ca90){var _0x4f8f56={};_0x4f8f56[_0x26ca90]={'$like':'%'+_0x1a2f31[_0xa55c('0x43')]['filter']+'%'};return _0x4f8f56;})});}_0x568a5b=_[_0xa55c('0x4f')]({},_0x568a5b,_0x1a2f31[_0xa55c('0x51')]);return db[_0xa55c('0x6c')][_0xa55c('0x31')]({'where':_0x568a5b['where']})[_0xa55c('0x1f')](function(_0x46f8ab){_0x3b6abe[_0xa55c('0x31')]=_0x46f8ab;if(_0x1a2f31[_0xa55c('0x43')][_0xa55c('0x52')]){_0x568a5b[_0xa55c('0x53')]=[{'all':!![]}];}return db[_0xa55c('0x6c')][_0xa55c('0x54')](_0x568a5b);})['then'](function(_0x147962){_0x3b6abe[_0xa55c('0x55')]=_0x147962;return _0x3b6abe;});}})[_0xa55c('0x1f')](respondWithFilteredResult(_0x3e7aa2,_0x568a5b))[_0xa55c('0x29')](handleError(_0x3e7aa2,null));};exports[_0xa55c('0x6d')]=function(_0x111113,_0x4c6ac5,_0x46124b){return db['OpenchannelAccount'][_0xa55c('0x59')]({'where':{'id':_0x111113['params']['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0x4c6ac5,null))[_0xa55c('0x1f')](function(_0x17312b){if(_0x17312b){return _0x17312b['removeAnswers'](_0x111113[_0xa55c('0x43')][_0xa55c('0x6a')]);}})[_0xa55c('0x1f')](respondWithStatusCode(_0x4c6ac5,null))['catch'](handleError(_0x4c6ac5,null));};exports[_0xa55c('0x6e')]=function(_0x4c0c82,_0x777c32,_0x1cf9d0){var _0x5d39ca={'body':_0x4c0c82[_0xa55c('0x5b')],'channel':'openchannel'};var _0x4286e0=[];var _0x3d9a87=[];var _0x51082f={};var _0x41a2ef=![];return db[_0xa55c('0x6f')]['describe']()[_0xa55c('0x1f')](function(_0x8f3d34){if(!_0x8f3d34){throw new db['Sequelize'][(_0xa55c('0x70'))]('no\x20available\x20attributes');}_0x4286e0=_['difference'](_[_0xa55c('0x44')](_0x8f3d34),[_0xa55c('0x71'),_0xa55c('0x72')]);_0x3d9a87=_[_0xa55c('0x73')](_['keys'](_0x8f3d34),[_0xa55c('0x71'),'updatedAt',_0xa55c('0x74'),'ListId']);if(_0x4c0c82['body']['id']){delete _0x4c0c82['body']['id'];}if(_[_0xa55c('0x75')](_0x4c0c82['body']['from'])){throw new db[(_0xa55c('0x76'))][(_0xa55c('0x70'))](_0xa55c('0x77'));}if(_[_0xa55c('0x75')](_0x4c0c82[_0xa55c('0x5b')][_0xa55c('0x5b')])||_0x4c0c82[_0xa55c('0x5b')][_0xa55c('0x5b')]===''){throw new db[(_0xa55c('0x76'))][(_0xa55c('0x70'))](_0xa55c('0x78'));}if(_[_0xa55c('0x75')](_0x4c0c82[_0xa55c('0x5b')]['mapKey'])){throw new db[(_0xa55c('0x76'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d9a87);}if(!_['includes'](_0x3d9a87,_0x4c0c82[_0xa55c('0x5b')]['mapKey'])){throw new db[(_0xa55c('0x76'))]['ValidationError'](_0xa55c('0x79')+_0x3d9a87);}_0x51082f[_0x4c0c82['body']['mapKey']]=_0x4c0c82[_0xa55c('0x5b')]['from'];})['then'](function(){return db[_0xa55c('0x3d')][_0xa55c('0x59')]({'where':{'id':_0x4c0c82['params']['id']},'include':[{'model':db[_0xa55c('0x7a')],'as':'List','include':[{'model':db[_0xa55c('0x6f')],'as':_0xa55c('0x7b'),'where':_0x51082f,'limit':0x1,'order':[[_0xa55c('0x72'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xa55c('0x7c')}]});})[_0xa55c('0x1f')](handleEntityNotFound(_0x777c32,null))[_0xa55c('0x1f')](function(_0xfda07f){if(_0xfda07f&&_0xfda07f[_0xa55c('0x7d')]){_0x5d39ca[_0xa55c('0x7e')]=_0xfda07f;_0x5d39ca[_0xa55c('0x7f')]=_0xfda07f[_0xa55c('0x7c')];_0x5d39ca['list']=_0xfda07f[_0xa55c('0x7d')];_0x5d39ca[_0xa55c('0x7f')]=_[_0xa55c('0x80')](_0x5d39ca[_0xa55c('0x7f')],[_0xa55c('0x81')],[_0xa55c('0x82')]);if(_0x5d39ca[_0xa55c('0x7e')][_0xa55c('0x7c')]){delete _0x5d39ca[_0xa55c('0x7e')]['Applications'];}if(_0x5d39ca[_0xa55c('0x7e')][_0xa55c('0x7d')]&&_0x5d39ca[_0xa55c('0x7e')]['List']['Contacts']['length']){return _0x5d39ca[_0xa55c('0x7e')]['List'][_0xa55c('0x7b')][0x0];}var _0x41242e=_[_0xa55c('0x83')](_0x4c0c82[_0xa55c('0x5b')],{'firstName':_0x4c0c82[_0xa55c('0x5b')][_0xa55c('0x84')],'ListId':_0xfda07f[_0xa55c('0x85')]});_0x41242e[_0x4c0c82[_0xa55c('0x5b')][_0xa55c('0x86')]]=_0x4c0c82[_0xa55c('0x5b')][_0xa55c('0x84')];return db[_0xa55c('0x6f')][_0xa55c('0x5a')](_0x41242e,{'fields':_0x4286e0,'raw':!![]});}})[_0xa55c('0x1f')](handleEntityNotFound(_0x777c32,null))[_0xa55c('0x1f')](function(_0x1c7aec){_0x5d39ca[_0xa55c('0x87')]=_0x1c7aec;if(_0x1c7aec){var _0x414680={'ContactId':_0x1c7aec['id'],'OpenchannelAccountId':_0x4c0c82[_0xa55c('0x63')]['id'],'from':(_0x1c7aec[_0xa55c('0x88')]||'')+'\x20'+(_0x1c7aec[_0xa55c('0x89')]||'')};var _0x360bfa={'OpenchannelAccountId':_0x4c0c82[_0xa55c('0x63')]['id'],'closed':![]};if(_0x4c0c82[_0xa55c('0x5b')]['threadId']){_0x360bfa[_0xa55c('0x8a')]=_0x4c0c82[_0xa55c('0x5b')]['threadId'];return db[_0xa55c('0x8b')][_0xa55c('0x59')]({'where':_0x360bfa})[_0xa55c('0x1f')](function(_0x1761ac){if(_0x1761ac){return[_0x1761ac,![]];}_0x414680[_0xa55c('0x8a')]=_0x4c0c82['body'][_0xa55c('0x8a')];_0x414680['externalUrl']=_0x4c0c82['body'][_0xa55c('0x8c')];return db[_0xa55c('0x8b')][_0xa55c('0x5a')](_0x414680)[_0xa55c('0x1f')](function(_0x370986){return[_0x370986,!![]];});});}else{_0x360bfa[_0xa55c('0x8a')]=null;}_0x360bfa[_0xa55c('0x8d')]=_0x1c7aec['id'];return db[_0xa55c('0x8b')][_0xa55c('0x59')]({'where':_0x360bfa})[_0xa55c('0x1f')](function(_0x1036b3){if(_0x1036b3){return[_0x1036b3,![]];}return db[_0xa55c('0x8b')][_0xa55c('0x5a')](_0x414680)[_0xa55c('0x1f')](function(_0x414abc){return[_0x414abc,!![]];});});}})[_0xa55c('0x8e')](function(_0x1f00f8,_0x222fd9){if(_0x1f00f8){_0x41a2ef=_0x222fd9;if(!_0x222fd9){var _0x1073c5={'from':(_0x5d39ca['contact']['firstName']||'')+'\x20'+(_0x5d39ca['contact'][_0xa55c('0x89')]||'')};if(_0x4c0c82[_0xa55c('0x5b')]['threadId']&&_0x4c0c82[_0xa55c('0x5b')]['messageId']&&_0x4c0c82[_0xa55c('0x5b')]['threadId']!=_0x4c0c82[_0xa55c('0x5b')][_0xa55c('0x8f')]){_0x1073c5[_0xa55c('0x8a')]=_0x4c0c82[_0xa55c('0x5b')][_0xa55c('0x8f')];}return _0x1f00f8[_0xa55c('0x37')](_0x1073c5);}else{return _0x1f00f8;}}})[_0xa55c('0x1f')](function(_0x41aa56){_0x5d39ca[_0xa55c('0x90')]=_0x41aa56[_0xa55c('0x39')]({'plain':!![]});_0x5d39ca[_0xa55c('0x90')]['created']=_0x41a2ef;if(_0x5d39ca['interaction'][_0xa55c('0x91')]){if(_0x5d39ca['account'][_0xa55c('0x92')]){_0x5d39ca['applications'][_0xa55c('0x93')]({'id':0x0,'priority':_0x5d39ca[_0xa55c('0x7f')][_0xa55c('0x48')]+0x1,'app':'close','appdata':_0xa55c('0x94'),'interval':_0xa55c('0x95')});}}return db[_0xa55c('0x96')]['create']({'body':_0x4c0c82[_0xa55c('0x5b')]['body'],'OpenchannelAccountId':_0x4c0c82[_0xa55c('0x63')]['id'],'OpenchannelInteractionId':_0x41aa56['id'],'direction':'in','ContactId':_0x5d39ca['contact']['id'],'AttachmentId':_0x4c0c82['body'][_0xa55c('0x97')]});})[_0xa55c('0x1f')](function(_0x203bf7){_0x5d39ca['message']=_0x203bf7;if(_0x5d39ca[_0xa55c('0x90')][_0xa55c('0x98')]){return db[_0xa55c('0x99')][_0xa55c('0x59')]({'attributes':['id',_0xa55c('0x3b')],'where':{'id':_0x5d39ca[_0xa55c('0x90')][_0xa55c('0x98')]}})[_0xa55c('0x1f')](function(_0x4b1762){if(_0x4b1762){_0x5d39ca[_0xa55c('0x7f')][_0xa55c('0x9a')]({'id':0x0,'priority':0x0,'app':_0xa55c('0x9b'),'appdata':_0x4b1762[_0xa55c('0x3b')]+','+(_0x5d39ca[_0xa55c('0x7e')][_0xa55c('0x9c')]||0xa),'interval':_0xa55c('0x95')});_0x5d39ca[_0xa55c('0x9d')]=![];}return respondWithRpcPromise(_0xa55c('0x9e'),_0xa55c('0x9f'),_0x5d39ca);});}return respondWithRpcPromise(_0xa55c('0x9e'),'startRouting',_0x5d39ca);})[_0xa55c('0x1f')](function(_0x48127c){respondWithRpcPromise('EventManager',_0xa55c('0xa0'),{'event':'notify','message':_0x48127c},client9002);return _0x48127c;})[_0xa55c('0x1f')](respondWithResult(_0x777c32,null))['catch'](handleError(_0x777c32,null));};exports[_0xa55c('0xa1')]=function(_0x231499,_0x1db744){var _0x2d3e42=_0x231499[_0xa55c('0x63')]['id'];var _0x5c7c60=_0x231499[_0xa55c('0x5b')];var _0x51b21e=0xc8;var _0x3f089b=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xa55c('0xa2')][_0xa55c('0xa3')]['ISOLATION_LEVELS'][_0xa55c('0xa4')]},function(_0x25e576){return db[_0xa55c('0x3d')]['findOne']({'where':{'id':_0x2d3e42},'transaction':_0x25e576})['then'](function(_0x57a1fc){if(_0x57a1fc){return db['OpenchannelApplication'][_0xa55c('0x38')]({'where':{'OpenchannelAccountId':_0x2d3e42},'transaction':_0x25e576})[_0xa55c('0x1f')](function(){var _0x4c77c4=_[_0xa55c('0x42')](_0x5c7c60,function(_0x1322a0){_0x1322a0[_0xa55c('0xa5')]=_0x2d3e42;return _0x1322a0;});return db['OpenchannelApplication'][_0xa55c('0xa6')](_0x4c77c4,{'transaction':_0x25e576});});}else{_0x51b21e=0x194;_0x3f089b=[];}});})['then'](function(){if(_0x51b21e!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2d3e42},'order':_0xa55c('0x81')})['then'](function(_0x197f31){_0x3f089b=_0x197f31;});}})['catch'](function(_0x6917f2){_0x51b21e=0x1f4;logger[_0xa55c('0x25')](_0x6917f2[_0xa55c('0x3a')]);if(_0x6917f2['name']){delete _0x6917f2[_0xa55c('0x3b')];}_0x3f089b=_0x6917f2;})[_0xa55c('0xa7')](function(){if(_0x3f089b===null){_0x1db744[_0xa55c('0x2a')](_0x51b21e);}else{if(_0x51b21e===0x1f4){_0x1db744[_0xa55c('0x2b')](_0x51b21e)[_0xa55c('0x3c')](_0x3f089b);}else{_0x1db744[_0xa55c('0x2b')](_0x51b21e)[_0xa55c('0x2d')](_0x3f089b);}}});};exports[_0xa55c('0xa8')]=function(_0xfb7289,_0x4a0792,_0x8e0aeb){var _0x2a9a51={};var _0x288498={};var _0x297c38;var _0x185b41;return db[_0xa55c('0x3d')]['findOne']({'where':{'id':_0xfb7289[_0xa55c('0x63')]['id']}})['then'](handleEntityNotFound(_0x4a0792,null))[_0xa55c('0x1f')](function(_0x3c29ae){if(_0x3c29ae){_0x297c38=_0x3c29ae;_0x288498['model']=_[_0xa55c('0x44')](db[_0xa55c('0xa9')]['rawAttributes']);_0x288498['query']=_[_0xa55c('0x44')](_0xfb7289[_0xa55c('0x43')]);_0x288498[_0xa55c('0x4c')]=_[_0xa55c('0x45')](_0x288498[_0xa55c('0x41')],_0x288498[_0xa55c('0x43')]);_0x2a9a51[_0xa55c('0x46')]=_[_0xa55c('0x45')](_0x288498['model'],qs[_0xa55c('0x47')](_0xfb7289[_0xa55c('0x43')][_0xa55c('0x47')]));_0x2a9a51[_0xa55c('0x46')]=_0x2a9a51[_0xa55c('0x46')]['length']?_0x2a9a51[_0xa55c('0x46')]:_0x288498['model'];_0x2a9a51['order']=qs[_0xa55c('0x4b')](_0xfb7289[_0xa55c('0x43')][_0xa55c('0x4b')]);_0x2a9a51[_0xa55c('0x50')]=qs['filters'](_[_0xa55c('0x4d')](_0xfb7289[_0xa55c('0x43')],_0x288498[_0xa55c('0x4c')]));if(_0xfb7289[_0xa55c('0x43')][_0xa55c('0x4e')]){_0x2a9a51[_0xa55c('0x50')]=_[_0xa55c('0x4f')](_0x2a9a51[_0xa55c('0x50')],{'$or':_['map'](_0x2a9a51[_0xa55c('0x46')],function(_0xb72ac3){var _0x2639cc={};_0x2639cc[_0xb72ac3]={'$like':'%'+_0xfb7289[_0xa55c('0x43')]['filter']+'%'};return _0x2639cc;})});}_0x2a9a51=_[_0xa55c('0x4f')]({},_0x2a9a51,_0xfb7289[_0xa55c('0x51')]);return _0x297c38[_0xa55c('0xa8')](_0x2a9a51);}})['then'](function(_0x43eb27){if(_0x43eb27){_0x185b41=_0x43eb27[_0xa55c('0x48')];if(!_0xfb7289[_0xa55c('0x43')][_0xa55c('0xaa')](_0xa55c('0x49'))){_0x2a9a51[_0xa55c('0x30')]=qs[_0xa55c('0x30')](_0xfb7289['query'][_0xa55c('0x30')]);_0x2a9a51[_0xa55c('0x2e')]=qs['offset'](_0xfb7289[_0xa55c('0x43')][_0xa55c('0x2e')]);}return _0x297c38[_0xa55c('0xa8')](_0x2a9a51);}})['then'](function(_0x485382){if(_0x485382){return _0x485382?{'count':_0x185b41,'rows':_0x485382}:null;}})['then'](respondWithResult(_0x4a0792,null))[_0xa55c('0x29')](handleError(_0x4a0792,null));};exports[_0xa55c('0xab')]=function(_0x527b19,_0x507c86,_0x4754e1){var _0x1c53f0={'raw':![],'where':{}};var _0x591ee3={};var _0x5a01b0={'count':0x0,'rows':[]};return db[_0xa55c('0x3d')][_0xa55c('0x68')]({'where':{'id':_0x527b19[_0xa55c('0x63')]['id']}})['then'](handleEntityNotFound(_0x507c86,null))['then'](function(_0x37a7e1){if(_0x37a7e1){_0x591ee3['model']=_[_0xa55c('0x44')](db[_0xa55c('0x8b')]['rawAttributes']);_0x591ee3[_0xa55c('0x43')]=_['keys'](_0x527b19['query']);_0x591ee3['filters']=_['intersection'](_0x591ee3['model'],_0x591ee3[_0xa55c('0x43')]);_0x1c53f0['attributes']=_[_0xa55c('0x45')](_0x591ee3[_0xa55c('0x41')],qs[_0xa55c('0x47')](_0x527b19['query'][_0xa55c('0x47')]));_0x1c53f0[_0xa55c('0x46')]=_0x1c53f0[_0xa55c('0x46')][_0xa55c('0x48')]?_0x1c53f0[_0xa55c('0x46')]:_0x591ee3[_0xa55c('0x41')];if(!_0x527b19[_0xa55c('0x43')][_0xa55c('0xaa')](_0xa55c('0x49'))){_0x1c53f0[_0xa55c('0x30')]=qs['limit'](_0x527b19[_0xa55c('0x43')][_0xa55c('0x30')]);_0x1c53f0['offset']=qs[_0xa55c('0x2e')](_0x527b19[_0xa55c('0x43')][_0xa55c('0x2e')]);}_0x1c53f0[_0xa55c('0x4a')]=qs[_0xa55c('0x4b')](_0x527b19[_0xa55c('0x43')][_0xa55c('0x4b')]);_0x1c53f0[_0xa55c('0x50')]=qs[_0xa55c('0x4c')](_[_0xa55c('0x4d')](_0x527b19[_0xa55c('0x43')],_0x591ee3[_0xa55c('0x4c')]));_0x1c53f0[_0xa55c('0x50')][_0xa55c('0xa5')]=_0x37a7e1['id'];if(_0x527b19[_0xa55c('0x43')]['filter']){_0x1c53f0[_0xa55c('0x50')]=_['merge'](_0x1c53f0[_0xa55c('0x50')],{'$or':_[_0xa55c('0x42')](_0x1c53f0[_0xa55c('0x46')],function(_0x41de39){var _0x4a80fd={};_0x4a80fd[_0x41de39]={'$like':'%'+_0x527b19[_0xa55c('0x43')][_0xa55c('0x4e')]+'%'};return _0x4a80fd;})});}_0x1c53f0=_[_0xa55c('0x4f')]({},_0x1c53f0,_0x527b19['options']);return db[_0xa55c('0x8b')][_0xa55c('0x31')]({'where':_0x1c53f0[_0xa55c('0x50')]})['then'](function(_0x191a39){_0x5a01b0[_0xa55c('0x31')]=_0x191a39;if(_0x527b19[_0xa55c('0x43')]['includeAll']){_0x1c53f0[_0xa55c('0x53')]=[{'model':db['CmContact'],'as':_0xa55c('0xac'),'required':![]},{'model':db[_0xa55c('0x99')],'as':_0xa55c('0xad'),'attributes':[_0xa55c('0x3b'),_0xa55c('0xae'),'internal'],'required':![]},{'model':db[_0xa55c('0xaf')],'as':_0xa55c('0xb0'),'attributes':['id',_0xa55c('0x3b'),'color'],'where':_0x527b19[_0xa55c('0x43')][_0xa55c('0xb1')]?{'id':_0x527b19[_0xa55c('0x43')]['tag']}:undefined,'required':_0x527b19[_0xa55c('0x43')][_0xa55c('0xb1')]?!![]:![]}];}return db[_0xa55c('0x8b')][_0xa55c('0x54')](_0x1c53f0);})[_0xa55c('0x1f')](function(_0x2aad69){_0x5a01b0[_0xa55c('0x55')]=_0x2aad69;return _0x5a01b0;});}})['then'](respondWithFilteredResult(_0x507c86,_0x1c53f0))[_0xa55c('0x29')](handleError(_0x507c86,null));};exports[_0xa55c('0xb2')]=function(_0x3f0e63,_0x100ccb,_0x531e60){return db[_0xa55c('0x3d')][_0xa55c('0x59')]({'where':{'id':_0x3f0e63[_0xa55c('0x63')]['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0x100ccb,null))[_0xa55c('0x1f')](function(_0xcd4149){if(_0xcd4149){return _0xcd4149[_0xa55c('0xb2')](_0x3f0e63['body'][_0xa55c('0x6a')],_[_0xa55c('0xb3')](_0x3f0e63[_0xa55c('0x5b')],[_0xa55c('0x6a'),'id'])||{})[_0xa55c('0x8e')](function(_0x489873){for(var _0x58d20c=0x0;_0x58d20c<_0x3f0e63['body'][_0xa55c('0x6a')][_0xa55c('0x48')];_0x58d20c+=0x1){socket[_0xa55c('0xb4')](_0xa55c('0xb5'),{'UserId':Number(_0x3f0e63[_0xa55c('0x5b')][_0xa55c('0x6a')][_0x58d20c]),'OpenchannelAccountId':Number(_0x3f0e63[_0xa55c('0x63')]['id'])});}return _0x489873;});}})[_0xa55c('0x1f')](respondWithResult(_0x100ccb,null))['catch'](handleError(_0x100ccb,null));};exports[_0xa55c('0xb6')]=function(_0x3b2174,_0x35375e,_0x19a5f1){return db[_0xa55c('0x3d')][_0xa55c('0x59')]({'where':{'id':_0x3b2174['params']['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0x35375e,null))['then'](function(_0x47e382){if(_0x47e382){return _0x47e382['removeAgents'](_0x3b2174['query'][_0xa55c('0x6a')])[_0xa55c('0x1f')](function(){if(_[_0xa55c('0xb7')](_0x3b2174[_0xa55c('0x43')][_0xa55c('0x6a')])){for(var _0xe125dd=0x0;_0xe125dd<_0x3b2174[_0xa55c('0x43')][_0xa55c('0x6a')][_0xa55c('0x48')];_0xe125dd+=0x1){socket[_0xa55c('0xb4')](_0xa55c('0xb8'),{'UserId':Number(_0x3b2174['query']['ids'][_0xe125dd]),'OpenchannelAccountId':Number(_0x3b2174[_0xa55c('0x63')]['id'])});}}else{socket['emit'](_0xa55c('0xb8'),{'UserId':Number(_0x3b2174[_0xa55c('0x43')][_0xa55c('0x6a')]),'OpenchannelAccountId':Number(_0x3b2174[_0xa55c('0x63')]['id'])});}});}})[_0xa55c('0x1f')](respondWithStatusCode(_0x35375e,null))[_0xa55c('0x29')](handleError(_0x35375e,null));};exports[_0xa55c('0xb9')]=function(_0x3011ac,_0x2144fe,_0x563a64){var _0x3425fe={};var _0x434754={};var _0x558889;var _0x4b8436;return db[_0xa55c('0x3d')][_0xa55c('0x68')]({'where':{'id':_0x3011ac[_0xa55c('0x63')]['id']}})['then'](handleEntityNotFound(_0x2144fe,null))[_0xa55c('0x1f')](function(_0x3622dd){if(_0x3622dd){_0x558889=_0x3622dd;_0x434754[_0xa55c('0x41')]=_[_0xa55c('0x44')](db['User']['rawAttributes']);_0x434754[_0xa55c('0x43')]=_['keys'](_0x3011ac['query']);_0x434754[_0xa55c('0x4c')]=_[_0xa55c('0x45')](_0x434754[_0xa55c('0x41')],_0x434754[_0xa55c('0x43')]);_0x3425fe['attributes']=_[_0xa55c('0x45')](_0x434754[_0xa55c('0x41')],qs[_0xa55c('0x47')](_0x3011ac[_0xa55c('0x43')][_0xa55c('0x47')]));_0x3425fe['attributes']=_0x3425fe[_0xa55c('0x46')][_0xa55c('0x48')]?_0x3425fe[_0xa55c('0x46')]:_0x434754[_0xa55c('0x41')];_0x3425fe[_0xa55c('0x4a')]=qs[_0xa55c('0x4b')](_0x3011ac[_0xa55c('0x43')]['sort']);_0x3425fe[_0xa55c('0x50')]=qs['filters'](_[_0xa55c('0x4d')](_0x3011ac[_0xa55c('0x43')],_0x434754[_0xa55c('0x4c')]));if(_0x3011ac['query']['filter']){_0x3425fe[_0xa55c('0x50')]=_[_0xa55c('0x4f')](_0x3425fe['where'],{'$or':_['map'](_0x3425fe[_0xa55c('0x46')],function(_0x1732c7){var _0x59f11d={};_0x59f11d[_0x1732c7]={'$like':'%'+_0x3011ac[_0xa55c('0x43')]['filter']+'%'};return _0x59f11d;})});}_0x3425fe=_[_0xa55c('0x4f')]({},_0x3425fe,_0x3011ac[_0xa55c('0x51')]);return _0x558889[_0xa55c('0xb9')](_0x3425fe);}})[_0xa55c('0x1f')](function(_0x53bceb){if(_0x53bceb){_0x4b8436=_0x53bceb[_0xa55c('0x48')];if(!_0x3011ac[_0xa55c('0x43')][_0xa55c('0xaa')]('nolimit')){_0x3425fe['limit']=qs[_0xa55c('0x30')](_0x3011ac['query']['limit']);_0x3425fe[_0xa55c('0x2e')]=qs[_0xa55c('0x2e')](_0x3011ac[_0xa55c('0x43')][_0xa55c('0x2e')]);}return _0x558889[_0xa55c('0xb9')](_0x3425fe);}})[_0xa55c('0x1f')](function(_0x450be7){if(_0x450be7){return _0x450be7?{'count':_0x4b8436,'rows':_0x450be7}:null;}})[_0xa55c('0x1f')](respondWithResult(_0x2144fe,null))[_0xa55c('0x29')](handleError(_0x2144fe,null));};exports[_0xa55c('0x3c')]=function(_0x59786e,_0x59452f,_0x2b6738){var _0x1d4701,_0x2fa997,_0x29fd8e;if(_['isNil'](_0x59786e[_0xa55c('0x5b')][_0xa55c('0x5b')])||_0x59786e[_0xa55c('0x5b')][_0xa55c('0x5b')]===''){throw new db['Sequelize'][(_0xa55c('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x59786e['body']['to'])){}_0x1d4701=_0x59786e['body']['to'];return db[_0xa55c('0x3d')][_0xa55c('0x68')]({'where':{'id':_0x59786e['params']['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0x59452f,null))[_0xa55c('0x1f')](function(_0x1942e8){if(_0x1942e8){return db[_0xa55c('0x3d')][_0xa55c('0x59')]({'where':{'id':_0x1942e8['id']},'include':[{'model':db[_0xa55c('0x7a')],'as':'List','include':[{'model':db[_0xa55c('0x6f')],'as':_0xa55c('0x7b'),'where':{[_0x1942e8[_0xa55c('0x86')]]:_0x1d4701},'limit':0x1,'order':[[_0xa55c('0x72'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x59452f,null))['then'](function(_0x212b54){if(_0x212b54&&_0x212b54[_0xa55c('0x7d')]){_0x2fa997=_0x212b54[_0xa55c('0x39')]({'plain':!![]});if(_0x2fa997[_0xa55c('0x7d')]&&_0x2fa997[_0xa55c('0x7d')][_0xa55c('0x7b')][_0xa55c('0x48')]){return _0x2fa997[_0xa55c('0x7d')]['Contacts'][0x0];}return db['CmContact'][_0xa55c('0x5a')](_[_0xa55c('0x83')](_0x59786e['body'],{'firstName':_0x1d4701,[_0x212b54[_0xa55c('0x86')]]:_0x1d4701,'phone':_0x1d4701,'ListId':_0x2fa997[_0xa55c('0x85')]}));}})['then'](handleEntityNotFound(_0x59452f,null))['then'](function(_0x1b82ab){if(_0x1b82ab){_0x29fd8e=_0x1b82ab;return db[_0xa55c('0x8b')][_0xa55c('0x59')]({'where':{'ContactId':_0x29fd8e['id'],'closed':![],'OpenchannelAccountId':_0x2fa997['id']}})[_0xa55c('0x1f')](function(_0x4f9c89){if(_0x4f9c89){return[_0x4f9c89,![]];}return db['OpenchannelInteraction'][_0xa55c('0x5a')]({'UserId':_0x59786e[_0xa55c('0x5c')]['id'],'ContactId':_0x29fd8e['id'],'OpenchannelAccountId':_0x2fa997['id'],'lastMsgDirection':_0xa55c('0xba'),'firstMsgDirection':_0xa55c('0xba'),'Messages':[_[_0xa55c('0x4f')](_0x59786e[_0xa55c('0x5b')],{'read':![],'body':_0x59786e[_0xa55c('0x5b')][_0xa55c('0x5b')],'OpenchannelAccountId':_0x2fa997['id'],'UserId':_0x59786e[_0xa55c('0x5c')]['id'],'ContactId':_0x29fd8e['id']})]},{'include':[{'model':db[_0xa55c('0x96')],'as':'Messages'}]})[_0xa55c('0x1f')](function(_0x55276f){return[_0x55276f,!![]];});});}})[_0xa55c('0x8e')](function(_0x3064dd,_0x385a0a){if(_0x385a0a){return _0x3064dd;}return db[_0xa55c('0x96')][_0xa55c('0x5a')](_[_0xa55c('0x4f')](_0x59786e[_0xa55c('0x5b')],{'read':![],'body':_0x59786e[_0xa55c('0x5b')][_0xa55c('0x5b')],'OpenchannelAccountId':_0x2fa997['id'],'OpenchannelInteractionId':_0x3064dd['id'],'UserId':_0x59786e[_0xa55c('0x5c')]['id'],'ContactId':_0x29fd8e['id']}))[_0xa55c('0x1f')](function(_0x157a13){_0x3064dd[_0xa55c('0xbb')]['Messages']=[];_0x3064dd[_0xa55c('0xbb')][_0xa55c('0xbc')]['push'](_0x157a13[_0xa55c('0xbb')]);return _0x3064dd;});});}})[_0xa55c('0x1f')](respondWithResult(_0x59452f,null))[_0xa55c('0x29')](handleError(_0x59452f,null));}; \ No newline at end of file +var _0xf0ba=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','options','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','getAnswers','CannedAnswer','length','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','orderBy','priority','Applications','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','sequelize','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x228b45,_0x1bda94){var _0x3eb78c=function(_0x364b98){while(--_0x364b98){_0x228b45['push'](_0x228b45['shift']());}};_0x3eb78c(++_0x1bda94);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaf0b('0x0'));var rimraf=require(_0xaf0b('0x1'));var zipdir=require(_0xaf0b('0x2'));var jsonpatch=require(_0xaf0b('0x3'));var rp=require(_0xaf0b('0x4'));var moment=require('moment');var BPromise=require(_0xaf0b('0x5'));var Mustache=require(_0xaf0b('0x6'));var util=require('util');var path=require(_0xaf0b('0x7'));var sox=require('sox');var csv=require(_0xaf0b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf0b('0x9'));var squel=require(_0xaf0b('0xa'));var crypto=require(_0xaf0b('0xb'));var jsforce=require(_0xaf0b('0xc'));var deskjs=require(_0xaf0b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaf0b('0xe'));var Papa=require(_0xaf0b('0xf'));var Redis=require(_0xaf0b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaf0b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf0b('0x12'));var logger=require(_0xaf0b('0x13'))(_0xaf0b('0x14'));var utils=require('../../config/utils');var config=require(_0xaf0b('0x15'));var licenseUtil=require(_0xaf0b('0x16'));var db=require(_0xaf0b('0x17'))['db'];config[_0xaf0b('0x18')]=_[_0xaf0b('0x19')](config[_0xaf0b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf0b('0x1a'))(new Redis(config[_0xaf0b('0x18')]));require(_0xaf0b('0x1b'))[_0xaf0b('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xaf0b('0x1d')][_0xaf0b('0x1e')]({'port':0x232c});var client9002=jayson[_0xaf0b('0x1d')][_0xaf0b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3b2347,_0x15d4a6,_0x2afbae,_0x1f1308){return new BPromise(function(_0x4885da,_0x1cff0a){var _0x535612=_0x1f1308||client;return _0x535612[_0xaf0b('0x1f')](_0x3b2347,_0x2afbae)[_0xaf0b('0x20')](function(_0x36b059){logger[_0xaf0b('0x21')](_0xaf0b('0x22'),_0x15d4a6,_0xaf0b('0x23'));logger[_0xaf0b('0x24')](_0xaf0b('0x25'),_0x15d4a6,_0xaf0b('0x23'),JSON[_0xaf0b('0x26')](_0x36b059));if(_0x36b059['error']){if(_0x36b059[_0xaf0b('0x27')][_0xaf0b('0x28')]===0x1f4){logger[_0xaf0b('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x15d4a6,_0x36b059[_0xaf0b('0x27')][_0xaf0b('0x29')]);return _0x1cff0a(_0x36b059['error'][_0xaf0b('0x29')]);}logger[_0xaf0b('0x27')](_0xaf0b('0x22'),_0x15d4a6,_0x36b059[_0xaf0b('0x27')][_0xaf0b('0x29')]);return _0x4885da(_0x36b059['error']['message']);}else{logger[_0xaf0b('0x21')](_0xaf0b('0x22'),_0x15d4a6,_0xaf0b('0x23'));_0x4885da(_0x36b059[_0xaf0b('0x2a')][_0xaf0b('0x29')]);}})[_0xaf0b('0x2b')](function(_0x234040){logger[_0xaf0b('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x15d4a6,_0x234040);_0x1cff0a(_0x234040);});});}function respondWithStatusCode(_0x1ffa30,_0x21e0e6){_0x21e0e6=_0x21e0e6||0xcc;return function(_0x3a4820){if(_0x3a4820){return _0x1ffa30['sendStatus'](_0x21e0e6);}return _0x1ffa30[_0xaf0b('0x2c')](_0x21e0e6)[_0xaf0b('0x2d')]();};}function respondWithResult(_0x54c3be,_0x5a3e1b){_0x5a3e1b=_0x5a3e1b||0xc8;return function(_0x4bae53){if(_0x4bae53){return _0x54c3be[_0xaf0b('0x2c')](_0x5a3e1b)[_0xaf0b('0x2e')](_0x4bae53);}};}function respondWithFilteredResult(_0x862513,_0x550586){return function(_0x33481c){if(_0x33481c){var _0x674048=typeof _0x550586[_0xaf0b('0x2f')]===_0xaf0b('0x30')&&typeof _0x550586[_0xaf0b('0x31')]===_0xaf0b('0x30');var _0x159389=_0x33481c['count'];var _0x2860e=_0x674048?0x0:_0x550586[_0xaf0b('0x2f')];var _0x4beee6=_0x674048?_0x33481c[_0xaf0b('0x32')]:_0x550586[_0xaf0b('0x2f')]+_0x550586[_0xaf0b('0x31')];var _0x3fbfab;if(_0x4beee6>=_0x159389){_0x4beee6=_0x159389;_0x3fbfab=0xc8;}else{_0x3fbfab=0xce;}_0x862513[_0xaf0b('0x2c')](_0x3fbfab);return _0x862513[_0xaf0b('0x33')](_0xaf0b('0x34'),_0x2860e+'-'+_0x4beee6+'/'+_0x159389)[_0xaf0b('0x2e')](_0x33481c);}return null;};}function patchUpdates(_0x14a952){return function(_0x4fe4b3){try{jsonpatch[_0xaf0b('0x35')](_0x4fe4b3,_0x14a952,!![]);}catch(_0x588726){return BPromise['reject'](_0x588726);}return _0x4fe4b3['save']();};}function saveUpdates(_0x1d6771,_0x3b0f51){return function(_0x270195){if(_0x270195){return _0x270195[_0xaf0b('0x36')](_0x1d6771)[_0xaf0b('0x20')](function(_0x460e37){return _0x460e37;});}return null;};}function removeEntity(_0x4c22be,_0x18fd18){return function(_0x95f467){if(_0x95f467){return _0x95f467[_0xaf0b('0x37')]()[_0xaf0b('0x20')](function(){var _0x6522aa=_0x95f467[_0xaf0b('0x38')]({'plain':!![]});var _0x613b5c=_0xaf0b('0x39');return db[_0xaf0b('0x3a')][_0xaf0b('0x37')]({'where':{'type':_0x613b5c,'resourceId':_0x6522aa['id']}})['then'](function(){return _0x95f467;});})[_0xaf0b('0x20')](function(){_0x4c22be['status'](0xcc)[_0xaf0b('0x2d')]();});}};}function handleEntityNotFound(_0x478dec,_0x1f429d){return function(_0x56f5ec){if(!_0x56f5ec){_0x478dec[_0xaf0b('0x3b')](0x194);}return _0x56f5ec;};}function handleError(_0x477b0a,_0x5b535f){_0x5b535f=_0x5b535f||0x1f4;return function(_0x24fcde){logger[_0xaf0b('0x27')](_0x24fcde[_0xaf0b('0x3c')]);if(_0x24fcde[_0xaf0b('0x3d')]){delete _0x24fcde['name'];}_0x477b0a[_0xaf0b('0x2c')](_0x5b535f)[_0xaf0b('0x3e')](_0x24fcde);};}exports[_0xaf0b('0x3f')]=function(_0x17fe16,_0x4b26cd){var _0xf44ffd={'include':[{'model':db[_0xaf0b('0x40')],'as':_0xaf0b('0x41')}]},_0x1c71af={},_0x46855a={'count':0x0,'rows':[]};var _0x5df6d2=_[_0xaf0b('0x42')](db[_0xaf0b('0x43')][_0xaf0b('0x44')],function(_0x1422dd){return{'name':_0x1422dd[_0xaf0b('0x45')],'type':_0x1422dd[_0xaf0b('0x46')][_0xaf0b('0x47')]};});_0x1c71af['model']=_[_0xaf0b('0x42')](_0x5df6d2,'name');_0x1c71af[_0xaf0b('0x48')]=_[_0xaf0b('0x49')](_0x17fe16[_0xaf0b('0x48')]);_0x1c71af[_0xaf0b('0x4a')]=_[_0xaf0b('0x4b')](_0x1c71af[_0xaf0b('0x4c')],_0x1c71af[_0xaf0b('0x48')]);_0xf44ffd[_0xaf0b('0x4d')]=_[_0xaf0b('0x4b')](_0x1c71af['model'],qs[_0xaf0b('0x4e')](_0x17fe16[_0xaf0b('0x48')][_0xaf0b('0x4e')]));_0xf44ffd[_0xaf0b('0x4d')]=_0xf44ffd[_0xaf0b('0x4d')]['length']?_0xf44ffd[_0xaf0b('0x4d')]:_0x1c71af['model'];if(!_0x17fe16[_0xaf0b('0x48')][_0xaf0b('0x4f')](_0xaf0b('0x50'))){_0xf44ffd[_0xaf0b('0x31')]=qs[_0xaf0b('0x31')](_0x17fe16[_0xaf0b('0x48')][_0xaf0b('0x31')]);_0xf44ffd[_0xaf0b('0x2f')]=qs[_0xaf0b('0x2f')](_0x17fe16['query'][_0xaf0b('0x2f')]);}_0xf44ffd[_0xaf0b('0x51')]=qs['sort'](_0x17fe16[_0xaf0b('0x48')][_0xaf0b('0x52')]);_0xf44ffd[_0xaf0b('0x53')]=qs[_0xaf0b('0x4a')](_[_0xaf0b('0x54')](_0x17fe16[_0xaf0b('0x48')],_0x1c71af[_0xaf0b('0x4a')]),_0x5df6d2);if(_0x17fe16[_0xaf0b('0x48')][_0xaf0b('0x55')]){_0xf44ffd[_0xaf0b('0x53')]=_[_0xaf0b('0x56')](_0xf44ffd['where'],{'$or':_[_0xaf0b('0x42')](_0x5df6d2,function(_0x1c20c0){if(_0x1c20c0[_0xaf0b('0x46')]!==_0xaf0b('0x57')){var _0x474863={};_0x474863[_0x1c20c0[_0xaf0b('0x3d')]]={'$like':'%'+_0x17fe16[_0xaf0b('0x48')][_0xaf0b('0x55')]+'%'};return _0x474863;}})});}_0xf44ffd=_[_0xaf0b('0x56')]({},_0xf44ffd,_0x17fe16['options']);var _0x12cfaf={'where':_0xf44ffd['where']};return db[_0xaf0b('0x43')][_0xaf0b('0x32')](_0x12cfaf)[_0xaf0b('0x20')](function(_0x412f9a){_0x46855a[_0xaf0b('0x32')]=_0x412f9a;if(_0x17fe16[_0xaf0b('0x48')]['includeAll']){_0xf44ffd[_0xaf0b('0x58')]=[{'all':!![]}];}return db[_0xaf0b('0x43')][_0xaf0b('0x59')](_0xf44ffd);})[_0xaf0b('0x20')](function(_0x1992a7){_0x46855a[_0xaf0b('0x5a')]=_0x1992a7;return _0x46855a;})['then'](respondWithFilteredResult(_0x4b26cd,_0xf44ffd))[_0xaf0b('0x2b')](handleError(_0x4b26cd,null));};exports[_0xaf0b('0x5b')]=function(_0x3cc93f,_0x232170){var _0x2c105d={'raw':![],'where':{'id':_0x3cc93f[_0xaf0b('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xaf0b('0x41')}]},_0x11c1d1={};_0x11c1d1[_0xaf0b('0x4c')]=_[_0xaf0b('0x49')](db['OpenchannelAccount'][_0xaf0b('0x44')]);_0x11c1d1['query']=_[_0xaf0b('0x49')](_0x3cc93f[_0xaf0b('0x48')]);_0x11c1d1[_0xaf0b('0x4a')]=_[_0xaf0b('0x4b')](_0x11c1d1['model'],_0x11c1d1[_0xaf0b('0x48')]);_0x2c105d[_0xaf0b('0x4d')]=_[_0xaf0b('0x4b')](_0x11c1d1[_0xaf0b('0x4c')],qs[_0xaf0b('0x4e')](_0x3cc93f[_0xaf0b('0x48')][_0xaf0b('0x4e')]));_0x2c105d[_0xaf0b('0x4d')]=_0x2c105d[_0xaf0b('0x4d')]['length']?_0x2c105d[_0xaf0b('0x4d')]:_0x11c1d1['model'];if(_0x3cc93f[_0xaf0b('0x48')][_0xaf0b('0x5d')]){_0x2c105d['include']=[{'all':!![]}];}_0x2c105d=_['merge']({},_0x2c105d,_0x3cc93f[_0xaf0b('0x5e')]);return db[_0xaf0b('0x43')]['find'](_0x2c105d)[_0xaf0b('0x20')](handleEntityNotFound(_0x232170,null))['then'](respondWithResult(_0x232170,null))[_0xaf0b('0x2b')](handleError(_0x232170,null));};exports[_0xaf0b('0x5f')]=function(_0x2d21ae,_0x5e7b46){return db[_0xaf0b('0x43')][_0xaf0b('0x5f')](_0x2d21ae[_0xaf0b('0x60')],{})[_0xaf0b('0x20')](function(_0x29ea6b){var _0x5e17d1=_0x2d21ae[_0xaf0b('0x61')][_0xaf0b('0x38')]({'plain':!![]});if(!_0x5e17d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e17d1[_0xaf0b('0x62')]===_0xaf0b('0x61')){var _0x28161b=_0x29ea6b[_0xaf0b('0x38')]({'plain':!![]});var _0x3aa699=_0xaf0b('0x39');return db[_0xaf0b('0x63')][_0xaf0b('0x64')]({'where':{'name':_0x3aa699,'userProfileId':_0x5e17d1[_0xaf0b('0x65')]},'raw':!![]})[_0xaf0b('0x20')](function(_0x55cc97){if(_0x55cc97&&_0x55cc97[_0xaf0b('0x66')]===0x0){return db[_0xaf0b('0x3a')][_0xaf0b('0x5f')]({'name':_0x28161b[_0xaf0b('0x3d')],'resourceId':_0x28161b['id'],'type':_0x55cc97['name'],'sectionId':_0x55cc97['id']},{})[_0xaf0b('0x20')](function(){return _0x29ea6b;});}else{return _0x29ea6b;}})[_0xaf0b('0x2b')](function(_0x54208d){logger['error'](_0xaf0b('0x67'),_0x54208d);throw _0x54208d;});}return _0x29ea6b;})[_0xaf0b('0x20')](respondWithResult(_0x5e7b46,0xc9))[_0xaf0b('0x2b')](handleError(_0x5e7b46,null));};exports['update']=function(_0x47c5f6,_0x5f0bf4){if(_0x47c5f6['body']['id']){delete _0x47c5f6['body']['id'];}return db[_0xaf0b('0x43')][_0xaf0b('0x64')]({'where':{'id':_0x47c5f6[_0xaf0b('0x5c')]['id']},'include':[{'model':db[_0xaf0b('0x40')],'as':_0xaf0b('0x41')}]})['then'](handleEntityNotFound(_0x5f0bf4,null))[_0xaf0b('0x20')](saveUpdates(_0x47c5f6['body'],null))[_0xaf0b('0x20')](respondWithResult(_0x5f0bf4,null))[_0xaf0b('0x2b')](handleError(_0x5f0bf4,null));};exports[_0xaf0b('0x37')]=function(_0x409e41,_0x5e20bc){return db['OpenchannelAccount'][_0xaf0b('0x64')]({'where':{'id':_0x409e41['params']['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x5e20bc,null))[_0xaf0b('0x20')](removeEntity(_0x5e20bc,null))['catch'](handleError(_0x5e20bc,null));};exports[_0xaf0b('0x68')]=function(_0x15d37e,_0x55fe9f){return db['OpenchannelAccount']['describe']()[_0xaf0b('0x20')](respondWithResult(_0x55fe9f,null))[_0xaf0b('0x2b')](handleError(_0x55fe9f,null));};exports['addDisposition']=function(_0x4b55f7,_0x562b89,_0x16b4ba){if(_0x4b55f7['body']['id']){delete _0x4b55f7['body']['id'];}return db[_0xaf0b('0x43')][_0xaf0b('0x64')]({'where':{'id':_0x4b55f7[_0xaf0b('0x5c')]['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x562b89,null))['then'](function(_0x25554f){if(_0x25554f){_0x4b55f7[_0xaf0b('0x60')][_0xaf0b('0x69')]=_0x25554f['id'];return db[_0xaf0b('0x6a')][_0xaf0b('0x5f')](_0x4b55f7[_0xaf0b('0x60')]);}})[_0xaf0b('0x20')](respondWithResult(_0x562b89,null))[_0xaf0b('0x2b')](handleError(_0x562b89,null));};exports[_0xaf0b('0x6b')]=function(_0x280534,_0x4a5193,_0x2d7f4d){var _0x404d75={'raw':![],'where':{}};var _0x4e523e={};var _0x2da4b4={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xaf0b('0x6c')]({'where':{'id':_0x280534[_0xaf0b('0x5c')]['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x4a5193,null))[_0xaf0b('0x20')](function(_0x69785a){if(_0x69785a){_0x4e523e['model']=_['keys'](db[_0xaf0b('0x6a')][_0xaf0b('0x44')]);_0x4e523e[_0xaf0b('0x48')]=_['keys'](_0x280534[_0xaf0b('0x48')]);_0x4e523e[_0xaf0b('0x4a')]=_[_0xaf0b('0x4b')](_0x4e523e[_0xaf0b('0x4c')],_0x4e523e['query']);_0x404d75[_0xaf0b('0x4d')]=_[_0xaf0b('0x4b')](_0x4e523e['model'],qs[_0xaf0b('0x4e')](_0x280534[_0xaf0b('0x48')]['fields']));_0x404d75[_0xaf0b('0x4d')]=_0x404d75[_0xaf0b('0x4d')]['length']?_0x404d75[_0xaf0b('0x4d')]:_0x4e523e[_0xaf0b('0x4c')];if(!_0x280534[_0xaf0b('0x48')][_0xaf0b('0x4f')]('nolimit')){_0x404d75[_0xaf0b('0x31')]=qs['limit'](_0x280534[_0xaf0b('0x48')]['limit']);_0x404d75[_0xaf0b('0x2f')]=qs['offset'](_0x280534[_0xaf0b('0x48')][_0xaf0b('0x2f')]);}_0x404d75['order']=qs[_0xaf0b('0x52')](_0x280534[_0xaf0b('0x48')]['sort']);_0x404d75[_0xaf0b('0x53')]=qs[_0xaf0b('0x4a')](_[_0xaf0b('0x54')](_0x280534[_0xaf0b('0x48')],_0x4e523e['filters']));_0x404d75[_0xaf0b('0x53')][_0xaf0b('0x69')]=_0x69785a['id'];if(_0x280534[_0xaf0b('0x48')]['filter']){_0x404d75[_0xaf0b('0x53')]=_[_0xaf0b('0x56')](_0x404d75[_0xaf0b('0x53')],{'$or':_[_0xaf0b('0x42')](_0x404d75[_0xaf0b('0x4d')],function(_0x582335){var _0x4a9a7a={};_0x4a9a7a[_0x582335]={'$like':'%'+_0x280534[_0xaf0b('0x48')]['filter']+'%'};return _0x4a9a7a;})});}_0x404d75=_[_0xaf0b('0x56')]({},_0x404d75,_0x280534['options']);return db[_0xaf0b('0x6a')][_0xaf0b('0x32')]({'where':_0x404d75[_0xaf0b('0x53')]})[_0xaf0b('0x20')](function(_0x127975){_0x2da4b4[_0xaf0b('0x32')]=_0x127975;if(_0x280534[_0xaf0b('0x48')][_0xaf0b('0x5d')]){_0x404d75['include']=[{'all':!![]}];}return db[_0xaf0b('0x6a')][_0xaf0b('0x59')](_0x404d75);})[_0xaf0b('0x20')](function(_0x2a41dc){_0x2da4b4[_0xaf0b('0x5a')]=_0x2a41dc;return _0x2da4b4;});}})[_0xaf0b('0x20')](respondWithFilteredResult(_0x4a5193,_0x404d75))['catch'](handleError(_0x4a5193,null));};exports[_0xaf0b('0x6d')]=function(_0x5c68ab,_0x526039,_0x28a6e5){return db[_0xaf0b('0x43')]['find']({'where':{'id':_0x5c68ab['params']['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x526039,null))[_0xaf0b('0x20')](function(_0x203019){if(_0x203019){return _0x203019[_0xaf0b('0x6d')](_0x5c68ab[_0xaf0b('0x48')][_0xaf0b('0x6e')]);}})['then'](respondWithStatusCode(_0x526039,null))[_0xaf0b('0x2b')](handleError(_0x526039,null));};exports['addAnswer']=function(_0x434c3c,_0x1394d9,_0x183cad){if(_0x434c3c[_0xaf0b('0x60')]['id']){delete _0x434c3c[_0xaf0b('0x60')]['id'];}return db[_0xaf0b('0x43')]['find']({'where':{'id':_0x434c3c['params']['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x1394d9,null))[_0xaf0b('0x20')](function(_0xcf38ed){if(_0xcf38ed){_0x434c3c['body'][_0xaf0b('0x69')]=_0xcf38ed['id'];return db['CannedAnswer'][_0xaf0b('0x5f')](_0x434c3c['body']);}})[_0xaf0b('0x20')](respondWithResult(_0x1394d9,null))[_0xaf0b('0x2b')](handleError(_0x1394d9,null));};exports[_0xaf0b('0x6f')]=function(_0x23f9a4,_0x1adac7,_0x85637a){var _0x404b00={'raw':![],'where':{}};var _0x5ae81d={};var _0x549de4={'count':0x0,'rows':[]};return db[_0xaf0b('0x43')][_0xaf0b('0x6c')]({'where':{'id':_0x23f9a4['params']['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x1adac7,null))[_0xaf0b('0x20')](function(_0x2a5235){if(_0x2a5235){_0x5ae81d[_0xaf0b('0x4c')]=_[_0xaf0b('0x49')](db[_0xaf0b('0x70')][_0xaf0b('0x44')]);_0x5ae81d[_0xaf0b('0x48')]=_[_0xaf0b('0x49')](_0x23f9a4[_0xaf0b('0x48')]);_0x5ae81d[_0xaf0b('0x4a')]=_[_0xaf0b('0x4b')](_0x5ae81d['model'],_0x5ae81d['query']);_0x404b00[_0xaf0b('0x4d')]=_['intersection'](_0x5ae81d['model'],qs[_0xaf0b('0x4e')](_0x23f9a4[_0xaf0b('0x48')][_0xaf0b('0x4e')]));_0x404b00[_0xaf0b('0x4d')]=_0x404b00[_0xaf0b('0x4d')][_0xaf0b('0x71')]?_0x404b00[_0xaf0b('0x4d')]:_0x5ae81d[_0xaf0b('0x4c')];if(!_0x23f9a4[_0xaf0b('0x48')]['hasOwnProperty'](_0xaf0b('0x50'))){_0x404b00[_0xaf0b('0x31')]=qs[_0xaf0b('0x31')](_0x23f9a4[_0xaf0b('0x48')][_0xaf0b('0x31')]);_0x404b00[_0xaf0b('0x2f')]=qs[_0xaf0b('0x2f')](_0x23f9a4[_0xaf0b('0x48')][_0xaf0b('0x2f')]);}_0x404b00[_0xaf0b('0x51')]=qs[_0xaf0b('0x52')](_0x23f9a4[_0xaf0b('0x48')][_0xaf0b('0x52')]);_0x404b00['where']=qs[_0xaf0b('0x4a')](_[_0xaf0b('0x54')](_0x23f9a4[_0xaf0b('0x48')],_0x5ae81d[_0xaf0b('0x4a')]));_0x404b00[_0xaf0b('0x53')]['OpenchannelAccountId']=_0x2a5235['id'];if(_0x23f9a4[_0xaf0b('0x48')][_0xaf0b('0x55')]){_0x404b00[_0xaf0b('0x53')]=_[_0xaf0b('0x56')](_0x404b00[_0xaf0b('0x53')],{'$or':_[_0xaf0b('0x42')](_0x404b00[_0xaf0b('0x4d')],function(_0x3be52a){var _0x3d7ac2={};_0x3d7ac2[_0x3be52a]={'$like':'%'+_0x23f9a4[_0xaf0b('0x48')][_0xaf0b('0x55')]+'%'};return _0x3d7ac2;})});}_0x404b00=_[_0xaf0b('0x56')]({},_0x404b00,_0x23f9a4['options']);return db[_0xaf0b('0x70')][_0xaf0b('0x32')]({'where':_0x404b00['where']})[_0xaf0b('0x20')](function(_0x4c5a03){_0x549de4[_0xaf0b('0x32')]=_0x4c5a03;if(_0x23f9a4[_0xaf0b('0x48')][_0xaf0b('0x5d')]){_0x404b00[_0xaf0b('0x58')]=[{'all':!![]}];}return db[_0xaf0b('0x70')][_0xaf0b('0x59')](_0x404b00);})[_0xaf0b('0x20')](function(_0xd3ac12){_0x549de4[_0xaf0b('0x5a')]=_0xd3ac12;return _0x549de4;});}})[_0xaf0b('0x20')](respondWithFilteredResult(_0x1adac7,_0x404b00))['catch'](handleError(_0x1adac7,null));};exports[_0xaf0b('0x72')]=function(_0x523cbc,_0x1ccdd5,_0x3e7bff){return db[_0xaf0b('0x43')][_0xaf0b('0x64')]({'where':{'id':_0x523cbc[_0xaf0b('0x5c')]['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x1ccdd5,null))['then'](function(_0x593dc2){if(_0x593dc2){return _0x593dc2[_0xaf0b('0x72')](_0x523cbc[_0xaf0b('0x48')][_0xaf0b('0x6e')]);}})[_0xaf0b('0x20')](respondWithStatusCode(_0x1ccdd5,null))['catch'](handleError(_0x1ccdd5,null));};exports[_0xaf0b('0x73')]=function(_0x254392,_0x23e7d5,_0x5999c9){var _0x21bff8={'body':_0x254392['body'],'channel':_0xaf0b('0x74')};var _0x84b3bc=[];var _0x54d554=[];var _0x14be9a={};var _0x1c3241=![];return db[_0xaf0b('0x75')][_0xaf0b('0x68')]()[_0xaf0b('0x20')](function(_0x4a0f30){if(!_0x4a0f30){throw new db[(_0xaf0b('0x76'))][(_0xaf0b('0x77'))](_0xaf0b('0x78'));}_0x84b3bc=_[_0xaf0b('0x79')](_['keys'](_0x4a0f30),[_0xaf0b('0x7a'),_0xaf0b('0x7b')]);_0x54d554=_['difference'](_[_0xaf0b('0x49')](_0x4a0f30),['createdAt','updatedAt','CompanyId',_0xaf0b('0x7c')]);if(_0x254392['body']['id']){delete _0x254392[_0xaf0b('0x60')]['id'];}if(_[_0xaf0b('0x7d')](_0x254392[_0xaf0b('0x60')]['from'])){throw new db[(_0xaf0b('0x76'))][(_0xaf0b('0x77'))](_0xaf0b('0x7e'));}if(_['isNil'](_0x254392[_0xaf0b('0x60')][_0xaf0b('0x60')])||_0x254392['body'][_0xaf0b('0x60')]===''){throw new db[(_0xaf0b('0x76'))][(_0xaf0b('0x77'))](_0xaf0b('0x7f'));}if(_[_0xaf0b('0x7d')](_0x254392[_0xaf0b('0x60')]['mapKey'])){throw new db[(_0xaf0b('0x76'))][(_0xaf0b('0x77'))](_0xaf0b('0x80')+_0x54d554);}if(!_[_0xaf0b('0x81')](_0x54d554,_0x254392['body'][_0xaf0b('0x82')])){throw new db[(_0xaf0b('0x76'))][(_0xaf0b('0x77'))](_0xaf0b('0x83')+_0x54d554);}_0x14be9a[_0x254392[_0xaf0b('0x60')]['mapKey']]=_0x254392[_0xaf0b('0x60')][_0xaf0b('0x84')];})[_0xaf0b('0x20')](function(){return db[_0xaf0b('0x43')][_0xaf0b('0x64')]({'where':{'id':_0x254392[_0xaf0b('0x5c')]['id']},'include':[{'model':db[_0xaf0b('0x85')],'as':_0xaf0b('0x86'),'include':[{'model':db[_0xaf0b('0x75')],'as':_0xaf0b('0x87'),'where':_0x14be9a,'limit':0x1,'order':[[_0xaf0b('0x7b'),_0xaf0b('0x88')]]}]},{'model':db[_0xaf0b('0x89')],'as':'Applications'}]});})[_0xaf0b('0x20')](handleEntityNotFound(_0x23e7d5,null))['then'](function(_0x439cec){if(_0x439cec&&_0x439cec[_0xaf0b('0x86')]){_0x21bff8[_0xaf0b('0x8a')]=_0x439cec;_0x21bff8['applications']=_0x439cec['Applications'];_0x21bff8['list']=_0x439cec[_0xaf0b('0x86')];_0x21bff8[_0xaf0b('0x8b')]=_[_0xaf0b('0x8c')](_0x21bff8[_0xaf0b('0x8b')],[_0xaf0b('0x8d')],['asc']);if(_0x21bff8['account']['Applications']){delete _0x21bff8[_0xaf0b('0x8a')][_0xaf0b('0x8e')];}if(_0x21bff8[_0xaf0b('0x8a')][_0xaf0b('0x86')]&&_0x21bff8[_0xaf0b('0x8a')][_0xaf0b('0x86')][_0xaf0b('0x87')][_0xaf0b('0x71')]){return _0x21bff8[_0xaf0b('0x8a')]['List'][_0xaf0b('0x87')][0x0];}var _0x4665bd=_['defaults'](_0x254392['body'],{'firstName':_0x254392['body'][_0xaf0b('0x84')],'ListId':_0x439cec['ListId']});_0x4665bd[_0x254392[_0xaf0b('0x60')]['mapKey']]=_0x254392['body'][_0xaf0b('0x84')];return db[_0xaf0b('0x75')]['create'](_0x4665bd,{'fields':_0x84b3bc,'raw':!![]});}})['then'](handleEntityNotFound(_0x23e7d5,null))[_0xaf0b('0x20')](function(_0x5e89be){_0x21bff8['contact']=_0x5e89be;if(_0x5e89be){var _0x1ef117={'ContactId':_0x5e89be['id'],'OpenchannelAccountId':_0x254392[_0xaf0b('0x5c')]['id'],'from':(_0x5e89be['firstName']||'')+'\x20'+(_0x5e89be[_0xaf0b('0x8f')]||'')};var _0x1f5aff={'OpenchannelAccountId':_0x254392[_0xaf0b('0x5c')]['id'],'closed':![]};if(_0x254392[_0xaf0b('0x60')][_0xaf0b('0x90')]){_0x1f5aff[_0xaf0b('0x90')]=_0x254392[_0xaf0b('0x60')][_0xaf0b('0x90')];return db['OpenchannelInteraction'][_0xaf0b('0x64')]({'where':_0x1f5aff})[_0xaf0b('0x20')](function(_0x5668de){if(_0x5668de){return[_0x5668de,![]];}_0x1ef117[_0xaf0b('0x90')]=_0x254392['body'][_0xaf0b('0x90')];_0x1ef117[_0xaf0b('0x91')]=_0x254392[_0xaf0b('0x60')][_0xaf0b('0x91')];return db[_0xaf0b('0x92')][_0xaf0b('0x5f')](_0x1ef117)[_0xaf0b('0x20')](function(_0x40dbf6){return[_0x40dbf6,!![]];});});}else{_0x1f5aff[_0xaf0b('0x90')]=null;}_0x1f5aff[_0xaf0b('0x93')]=_0x5e89be['id'];return db[_0xaf0b('0x92')][_0xaf0b('0x64')]({'where':_0x1f5aff})['then'](function(_0x137526){if(_0x137526){return[_0x137526,![]];}return db['OpenchannelInteraction'][_0xaf0b('0x5f')](_0x1ef117)[_0xaf0b('0x20')](function(_0x57bcba){return[_0x57bcba,!![]];});});}})[_0xaf0b('0x94')](function(_0x2a4cb3,_0x27e4c5){if(_0x2a4cb3){_0x1c3241=_0x27e4c5;if(!_0x27e4c5){var _0x443e35={'from':(_0x21bff8[_0xaf0b('0x95')]['firstName']||'')+'\x20'+(_0x21bff8[_0xaf0b('0x95')][_0xaf0b('0x8f')]||'')};if(_0x254392[_0xaf0b('0x60')][_0xaf0b('0x90')]&&_0x254392['body'][_0xaf0b('0x96')]&&_0x254392[_0xaf0b('0x60')][_0xaf0b('0x90')]!=_0x254392['body'][_0xaf0b('0x96')]){_0x443e35['threadId']=_0x254392[_0xaf0b('0x60')]['messageId'];}return _0x2a4cb3[_0xaf0b('0x36')](_0x443e35);}else{return _0x2a4cb3;}}})[_0xaf0b('0x20')](function(_0x42ad0d){_0x21bff8[_0xaf0b('0x97')]=_0x42ad0d[_0xaf0b('0x38')]({'plain':!![]});_0x21bff8[_0xaf0b('0x97')][_0xaf0b('0x98')]=_0x1c3241;if(_0x21bff8[_0xaf0b('0x97')][_0xaf0b('0x98')]){if(_0x21bff8['account'][_0xaf0b('0x99')]){_0x21bff8[_0xaf0b('0x8b')][_0xaf0b('0x9a')]({'id':0x0,'priority':_0x21bff8[_0xaf0b('0x8b')][_0xaf0b('0x71')]+0x1,'app':_0xaf0b('0x9b'),'appdata':_0xaf0b('0x9c'),'interval':'*,*,*,*'});}}return db[_0xaf0b('0x9d')]['create']({'body':_0x254392[_0xaf0b('0x60')]['body'],'OpenchannelAccountId':_0x254392[_0xaf0b('0x5c')]['id'],'OpenchannelInteractionId':_0x42ad0d['id'],'direction':'in','ContactId':_0x21bff8[_0xaf0b('0x95')]['id'],'AttachmentId':_0x254392[_0xaf0b('0x60')][_0xaf0b('0x9e')]});})[_0xaf0b('0x20')](function(_0x1ed3a9){_0x21bff8[_0xaf0b('0x29')]=_0x1ed3a9;if(_0x21bff8[_0xaf0b('0x97')][_0xaf0b('0x9f')]){return db[_0xaf0b('0xa0')][_0xaf0b('0x64')]({'attributes':['id',_0xaf0b('0x3d')],'where':{'id':_0x21bff8[_0xaf0b('0x97')][_0xaf0b('0x9f')]}})['then'](function(_0x2e3d9c){if(_0x2e3d9c){_0x21bff8[_0xaf0b('0x8b')][_0xaf0b('0xa1')]({'id':0x0,'priority':0x0,'app':_0xaf0b('0xa2'),'appdata':_0x2e3d9c[_0xaf0b('0x3d')]+','+(_0x21bff8[_0xaf0b('0x8a')]['waitForTheAssignedAgent']||0xa),'interval':_0xaf0b('0xa3')});_0x21bff8[_0xaf0b('0xa4')]=![];}return respondWithRpcPromise(_0xaf0b('0xa5'),_0xaf0b('0xa6'),_0x21bff8);});}return respondWithRpcPromise(_0xaf0b('0xa5'),_0xaf0b('0xa6'),_0x21bff8);})['then'](function(_0x2d81dd){respondWithRpcPromise(_0xaf0b('0xa7'),_0xaf0b('0xa7'),{'event':'notify','message':_0x2d81dd},client9002);return _0x2d81dd;})[_0xaf0b('0x20')](respondWithResult(_0x23e7d5,null))['catch'](handleError(_0x23e7d5,null));};exports['addApplications']=function(_0x579d43,_0x1b9b3c){var _0x8e7173=_0x579d43['params']['id'];var _0x31bff2=_0x579d43[_0xaf0b('0x60')];var _0x3f2ed7=0xc8;var _0xd6dc91=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xaf0b('0xa8')]['Transaction'][_0xaf0b('0xa9')]['READ_COMMITTED']},function(_0x5c8de4){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x8e7173},'transaction':_0x5c8de4})[_0xaf0b('0x20')](function(_0x45676e){if(_0x45676e){return db[_0xaf0b('0x89')]['destroy']({'where':{'OpenchannelAccountId':_0x8e7173},'transaction':_0x5c8de4})[_0xaf0b('0x20')](function(){var _0x2f545d=_[_0xaf0b('0x42')](_0x31bff2,function(_0x7b9004){_0x7b9004[_0xaf0b('0x69')]=_0x8e7173;return _0x7b9004;});return db[_0xaf0b('0x89')]['bulkCreate'](_0x2f545d,{'transaction':_0x5c8de4});});}else{_0x3f2ed7=0x194;_0xd6dc91=[];}});})['then'](function(){if(_0x3f2ed7!==0x194){return db[_0xaf0b('0x89')][_0xaf0b('0xaa')]({'where':{'OpenchannelAccountId':_0x8e7173},'order':_0xaf0b('0x8d')})['then'](function(_0x98a5d3){_0xd6dc91=_0x98a5d3;});}})[_0xaf0b('0x2b')](function(_0x19ba58){_0x3f2ed7=0x1f4;logger[_0xaf0b('0x27')](_0x19ba58[_0xaf0b('0x3c')]);if(_0x19ba58[_0xaf0b('0x3d')]){delete _0x19ba58[_0xaf0b('0x3d')];}_0xd6dc91=_0x19ba58;})[_0xaf0b('0xab')](function(){if(_0xd6dc91===null){_0x1b9b3c[_0xaf0b('0x3b')](_0x3f2ed7);}else{if(_0x3f2ed7===0x1f4){_0x1b9b3c['status'](_0x3f2ed7)['send'](_0xd6dc91);}else{_0x1b9b3c[_0xaf0b('0x2c')](_0x3f2ed7)['json'](_0xd6dc91);}}});};exports[_0xaf0b('0xac')]=function(_0x51d8bd,_0x3d551b,_0x13ff30){var _0x1870b0={};var _0x2d25b0={};var _0x3024d0;var _0x41691d;return db[_0xaf0b('0x43')][_0xaf0b('0x6c')]({'where':{'id':_0x51d8bd[_0xaf0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3d551b,null))[_0xaf0b('0x20')](function(_0x5bb93f){if(_0x5bb93f){_0x3024d0=_0x5bb93f;_0x2d25b0[_0xaf0b('0x4c')]=_[_0xaf0b('0x49')](db['OpenchannelApplication'][_0xaf0b('0x44')]);_0x2d25b0[_0xaf0b('0x48')]=_[_0xaf0b('0x49')](_0x51d8bd[_0xaf0b('0x48')]);_0x2d25b0[_0xaf0b('0x4a')]=_['intersection'](_0x2d25b0[_0xaf0b('0x4c')],_0x2d25b0[_0xaf0b('0x48')]);_0x1870b0[_0xaf0b('0x4d')]=_['intersection'](_0x2d25b0['model'],qs[_0xaf0b('0x4e')](_0x51d8bd['query'][_0xaf0b('0x4e')]));_0x1870b0[_0xaf0b('0x4d')]=_0x1870b0[_0xaf0b('0x4d')][_0xaf0b('0x71')]?_0x1870b0[_0xaf0b('0x4d')]:_0x2d25b0['model'];_0x1870b0[_0xaf0b('0x51')]=qs['sort'](_0x51d8bd[_0xaf0b('0x48')]['sort']);_0x1870b0[_0xaf0b('0x53')]=qs[_0xaf0b('0x4a')](_['pick'](_0x51d8bd[_0xaf0b('0x48')],_0x2d25b0[_0xaf0b('0x4a')]));if(_0x51d8bd[_0xaf0b('0x48')][_0xaf0b('0x55')]){_0x1870b0[_0xaf0b('0x53')]=_[_0xaf0b('0x56')](_0x1870b0[_0xaf0b('0x53')],{'$or':_[_0xaf0b('0x42')](_0x1870b0[_0xaf0b('0x4d')],function(_0x2dc6d4){var _0x29fa5d={};_0x29fa5d[_0x2dc6d4]={'$like':'%'+_0x51d8bd['query'][_0xaf0b('0x55')]+'%'};return _0x29fa5d;})});}_0x1870b0=_['merge']({},_0x1870b0,_0x51d8bd[_0xaf0b('0x5e')]);return _0x3024d0[_0xaf0b('0xac')](_0x1870b0);}})[_0xaf0b('0x20')](function(_0x497e1b){if(_0x497e1b){_0x41691d=_0x497e1b[_0xaf0b('0x71')];if(!_0x51d8bd[_0xaf0b('0x48')][_0xaf0b('0x4f')](_0xaf0b('0x50'))){_0x1870b0[_0xaf0b('0x31')]=qs[_0xaf0b('0x31')](_0x51d8bd['query'][_0xaf0b('0x31')]);_0x1870b0[_0xaf0b('0x2f')]=qs['offset'](_0x51d8bd[_0xaf0b('0x48')][_0xaf0b('0x2f')]);}return _0x3024d0['getApplications'](_0x1870b0);}})[_0xaf0b('0x20')](function(_0x1b9899){if(_0x1b9899){return _0x1b9899?{'count':_0x41691d,'rows':_0x1b9899}:null;}})['then'](respondWithResult(_0x3d551b,null))[_0xaf0b('0x2b')](handleError(_0x3d551b,null));};exports[_0xaf0b('0xad')]=function(_0xb924d5,_0x2aafa1,_0x4caa71){var _0x4230f2={'raw':![],'where':{}};var _0x3a2d1a={};var _0x472ad9={'count':0x0,'rows':[]};return db[_0xaf0b('0x43')][_0xaf0b('0x6c')]({'where':{'id':_0xb924d5[_0xaf0b('0x5c')]['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x2aafa1,null))['then'](function(_0x989c3f){if(_0x989c3f){_0x3a2d1a[_0xaf0b('0x4c')]=_[_0xaf0b('0x49')](db[_0xaf0b('0x92')][_0xaf0b('0x44')]);_0x3a2d1a[_0xaf0b('0x48')]=_[_0xaf0b('0x49')](_0xb924d5[_0xaf0b('0x48')]);_0x3a2d1a[_0xaf0b('0x4a')]=_['intersection'](_0x3a2d1a[_0xaf0b('0x4c')],_0x3a2d1a['query']);_0x4230f2['attributes']=_['intersection'](_0x3a2d1a[_0xaf0b('0x4c')],qs['fields'](_0xb924d5[_0xaf0b('0x48')][_0xaf0b('0x4e')]));_0x4230f2[_0xaf0b('0x4d')]=_0x4230f2[_0xaf0b('0x4d')][_0xaf0b('0x71')]?_0x4230f2[_0xaf0b('0x4d')]:_0x3a2d1a[_0xaf0b('0x4c')];if(!_0xb924d5[_0xaf0b('0x48')]['hasOwnProperty'](_0xaf0b('0x50'))){_0x4230f2['limit']=qs['limit'](_0xb924d5['query'][_0xaf0b('0x31')]);_0x4230f2['offset']=qs[_0xaf0b('0x2f')](_0xb924d5[_0xaf0b('0x48')][_0xaf0b('0x2f')]);}_0x4230f2['order']=qs[_0xaf0b('0x52')](_0xb924d5[_0xaf0b('0x48')][_0xaf0b('0x52')]);_0x4230f2['where']=qs[_0xaf0b('0x4a')](_[_0xaf0b('0x54')](_0xb924d5[_0xaf0b('0x48')],_0x3a2d1a[_0xaf0b('0x4a')]));_0x4230f2[_0xaf0b('0x53')][_0xaf0b('0x69')]=_0x989c3f['id'];if(_0xb924d5[_0xaf0b('0x48')][_0xaf0b('0x55')]){_0x4230f2[_0xaf0b('0x53')]=_[_0xaf0b('0x56')](_0x4230f2[_0xaf0b('0x53')],{'$or':_[_0xaf0b('0x42')](_0x4230f2[_0xaf0b('0x4d')],function(_0xe12336){var _0x64eb5={};_0x64eb5[_0xe12336]={'$like':'%'+_0xb924d5[_0xaf0b('0x48')][_0xaf0b('0x55')]+'%'};return _0x64eb5;})});}_0x4230f2=_['merge']({},_0x4230f2,_0xb924d5['options']);return db['OpenchannelInteraction'][_0xaf0b('0x32')]({'where':_0x4230f2['where']})['then'](function(_0xb179d1){_0x472ad9[_0xaf0b('0x32')]=_0xb179d1;if(_0xb924d5[_0xaf0b('0x48')]['includeAll']){_0x4230f2[_0xaf0b('0x58')]=[{'model':db[_0xaf0b('0x75')],'as':_0xaf0b('0xae'),'required':![]},{'model':db[_0xaf0b('0xa0')],'as':'Owner','attributes':[_0xaf0b('0x3d'),'fullname',_0xaf0b('0xaf')],'required':![]},{'model':db[_0xaf0b('0xb0')],'as':_0xaf0b('0xb1'),'attributes':['id',_0xaf0b('0x3d'),_0xaf0b('0xb2')],'where':_0xb924d5[_0xaf0b('0x48')]['tag']?{'id':_0xb924d5[_0xaf0b('0x48')][_0xaf0b('0xb3')]}:undefined,'required':_0xb924d5[_0xaf0b('0x48')][_0xaf0b('0xb3')]?!![]:![]}];}return db[_0xaf0b('0x92')][_0xaf0b('0x59')](_0x4230f2);})[_0xaf0b('0x20')](function(_0x2740c8){_0x472ad9[_0xaf0b('0x5a')]=_0x2740c8;return _0x472ad9;});}})[_0xaf0b('0x20')](respondWithFilteredResult(_0x2aafa1,_0x4230f2))[_0xaf0b('0x2b')](handleError(_0x2aafa1,null));};exports[_0xaf0b('0xb4')]=function(_0x1258d6,_0x42b477,_0x218b20){return db[_0xaf0b('0x43')][_0xaf0b('0x64')]({'where':{'id':_0x1258d6['params']['id']}})[_0xaf0b('0x20')](handleEntityNotFound(_0x42b477,null))[_0xaf0b('0x20')](function(_0x2ab990){if(_0x2ab990){return _0x2ab990[_0xaf0b('0xb4')](_0x1258d6[_0xaf0b('0x60')][_0xaf0b('0x6e')],_[_0xaf0b('0xb5')](_0x1258d6['body'],[_0xaf0b('0x6e'),'id'])||{})[_0xaf0b('0x94')](function(_0x31c83a){for(var _0x1dcbbd=0x0;_0x1dcbbd<_0x1258d6[_0xaf0b('0x60')]['ids'][_0xaf0b('0x71')];_0x1dcbbd+=0x1){socket[_0xaf0b('0xb6')](_0xaf0b('0xb7'),{'UserId':Number(_0x1258d6[_0xaf0b('0x60')][_0xaf0b('0x6e')][_0x1dcbbd]),'OpenchannelAccountId':Number(_0x1258d6[_0xaf0b('0x5c')]['id'])});}return _0x31c83a;});}})[_0xaf0b('0x20')](respondWithResult(_0x42b477,null))[_0xaf0b('0x2b')](handleError(_0x42b477,null));};exports[_0xaf0b('0xb8')]=function(_0x1a177f,_0x2f0fac,_0x4b02b2){return db[_0xaf0b('0x43')][_0xaf0b('0x64')]({'where':{'id':_0x1a177f[_0xaf0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f0fac,null))['then'](function(_0x5daabb){if(_0x5daabb){return _0x5daabb[_0xaf0b('0xb8')](_0x1a177f[_0xaf0b('0x48')][_0xaf0b('0x6e')])[_0xaf0b('0x20')](function(){if(_['isArray'](_0x1a177f[_0xaf0b('0x48')]['ids'])){for(var _0x539bc7=0x0;_0x539bc7<_0x1a177f[_0xaf0b('0x48')][_0xaf0b('0x6e')][_0xaf0b('0x71')];_0x539bc7+=0x1){socket['emit'](_0xaf0b('0xb9'),{'UserId':Number(_0x1a177f[_0xaf0b('0x48')]['ids'][_0x539bc7]),'OpenchannelAccountId':Number(_0x1a177f[_0xaf0b('0x5c')]['id'])});}}else{socket[_0xaf0b('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1a177f['query'][_0xaf0b('0x6e')]),'OpenchannelAccountId':Number(_0x1a177f[_0xaf0b('0x5c')]['id'])});}});}})[_0xaf0b('0x20')](respondWithStatusCode(_0x2f0fac,null))[_0xaf0b('0x2b')](handleError(_0x2f0fac,null));};exports[_0xaf0b('0xba')]=function(_0x5a539b,_0x23fc11,_0x3d7bcc){var _0x21a765={};var _0x4195a9={};var _0x211228;var _0xf7736c;return db[_0xaf0b('0x43')][_0xaf0b('0x6c')]({'where':{'id':_0x5a539b[_0xaf0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x23fc11,null))[_0xaf0b('0x20')](function(_0x578c38){if(_0x578c38){_0x211228=_0x578c38;_0x4195a9['model']=_['keys'](db['User'][_0xaf0b('0x44')]);_0x4195a9[_0xaf0b('0x48')]=_[_0xaf0b('0x49')](_0x5a539b[_0xaf0b('0x48')]);_0x4195a9[_0xaf0b('0x4a')]=_[_0xaf0b('0x4b')](_0x4195a9[_0xaf0b('0x4c')],_0x4195a9[_0xaf0b('0x48')]);_0x21a765[_0xaf0b('0x4d')]=_[_0xaf0b('0x4b')](_0x4195a9[_0xaf0b('0x4c')],qs[_0xaf0b('0x4e')](_0x5a539b[_0xaf0b('0x48')][_0xaf0b('0x4e')]));_0x21a765['attributes']=_0x21a765[_0xaf0b('0x4d')][_0xaf0b('0x71')]?_0x21a765['attributes']:_0x4195a9[_0xaf0b('0x4c')];_0x21a765[_0xaf0b('0x51')]=qs[_0xaf0b('0x52')](_0x5a539b[_0xaf0b('0x48')]['sort']);_0x21a765[_0xaf0b('0x53')]=qs[_0xaf0b('0x4a')](_['pick'](_0x5a539b[_0xaf0b('0x48')],_0x4195a9[_0xaf0b('0x4a')]));if(_0x5a539b['query'][_0xaf0b('0x55')]){_0x21a765[_0xaf0b('0x53')]=_[_0xaf0b('0x56')](_0x21a765[_0xaf0b('0x53')],{'$or':_[_0xaf0b('0x42')](_0x21a765[_0xaf0b('0x4d')],function(_0x56bd3e){var _0x1ab49d={};_0x1ab49d[_0x56bd3e]={'$like':'%'+_0x5a539b[_0xaf0b('0x48')][_0xaf0b('0x55')]+'%'};return _0x1ab49d;})});}_0x21a765=_[_0xaf0b('0x56')]({},_0x21a765,_0x5a539b[_0xaf0b('0x5e')]);return _0x211228[_0xaf0b('0xba')](_0x21a765);}})[_0xaf0b('0x20')](function(_0x5255cb){if(_0x5255cb){_0xf7736c=_0x5255cb[_0xaf0b('0x71')];if(!_0x5a539b[_0xaf0b('0x48')][_0xaf0b('0x4f')](_0xaf0b('0x50'))){_0x21a765[_0xaf0b('0x31')]=qs['limit'](_0x5a539b[_0xaf0b('0x48')][_0xaf0b('0x31')]);_0x21a765[_0xaf0b('0x2f')]=qs[_0xaf0b('0x2f')](_0x5a539b[_0xaf0b('0x48')][_0xaf0b('0x2f')]);}return _0x211228[_0xaf0b('0xba')](_0x21a765);}})[_0xaf0b('0x20')](function(_0x59ba8b){if(_0x59ba8b){return _0x59ba8b?{'count':_0xf7736c,'rows':_0x59ba8b}:null;}})['then'](respondWithResult(_0x23fc11,null))[_0xaf0b('0x2b')](handleError(_0x23fc11,null));};exports[_0xaf0b('0x3e')]=function(_0x2d9204,_0x15414b,_0x1b9e46){var _0x5bb3b7,_0x570e79,_0x34bbf8;if(_[_0xaf0b('0x7d')](_0x2d9204[_0xaf0b('0x60')]['body'])||_0x2d9204[_0xaf0b('0x60')][_0xaf0b('0x60')]===''){throw new db['Sequelize'][(_0xaf0b('0x77'))](_0xaf0b('0x7f'));}if(_[_0xaf0b('0x7d')](_0x2d9204[_0xaf0b('0x60')]['to'])){}_0x5bb3b7=_0x2d9204[_0xaf0b('0x60')]['to'];return db[_0xaf0b('0x43')]['findOne']({'where':{'id':_0x2d9204[_0xaf0b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x15414b,null))[_0xaf0b('0x20')](function(_0xdaf7c7){if(_0xdaf7c7){return db[_0xaf0b('0x43')][_0xaf0b('0x64')]({'where':{'id':_0xdaf7c7['id']},'include':[{'model':db[_0xaf0b('0x85')],'as':_0xaf0b('0x86'),'include':[{'model':db['CmContact'],'as':_0xaf0b('0x87'),'where':{[_0xdaf7c7[_0xaf0b('0x82')]]:_0x5bb3b7},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xaf0b('0x20')](handleEntityNotFound(_0x15414b,null))[_0xaf0b('0x20')](function(_0x2e9512){if(_0x2e9512&&_0x2e9512[_0xaf0b('0x86')]){_0x570e79=_0x2e9512['get']({'plain':!![]});if(_0x570e79['List']&&_0x570e79[_0xaf0b('0x86')]['Contacts'][_0xaf0b('0x71')]){return _0x570e79[_0xaf0b('0x86')][_0xaf0b('0x87')][0x0];}return db[_0xaf0b('0x75')][_0xaf0b('0x5f')](_['defaults'](_0x2d9204[_0xaf0b('0x60')],{'firstName':_0x5bb3b7,[_0x2e9512['mapKey']]:_0x5bb3b7,'phone':_0x5bb3b7,'ListId':_0x570e79[_0xaf0b('0x7c')]}));}})[_0xaf0b('0x20')](handleEntityNotFound(_0x15414b,null))[_0xaf0b('0x20')](function(_0x5e8d27){if(_0x5e8d27){_0x34bbf8=_0x5e8d27;return db[_0xaf0b('0x92')][_0xaf0b('0x64')]({'where':{'ContactId':_0x34bbf8['id'],'closed':![],'OpenchannelAccountId':_0x570e79['id']}})[_0xaf0b('0x20')](function(_0x227741){if(_0x227741){return[_0x227741,![]];}return db[_0xaf0b('0x92')][_0xaf0b('0x5f')]({'UserId':_0x2d9204['user']['id'],'ContactId':_0x34bbf8['id'],'OpenchannelAccountId':_0x570e79['id'],'lastMsgDirection':_0xaf0b('0xbb'),'firstMsgDirection':'out','Messages':[_[_0xaf0b('0x56')](_0x2d9204[_0xaf0b('0x60')],{'read':![],'body':_0x2d9204[_0xaf0b('0x60')][_0xaf0b('0x60')],'OpenchannelAccountId':_0x570e79['id'],'UserId':_0x2d9204[_0xaf0b('0x61')]['id'],'ContactId':_0x34bbf8['id']})]},{'include':[{'model':db[_0xaf0b('0x9d')],'as':_0xaf0b('0xbc')}]})['then'](function(_0x30fbc7){return[_0x30fbc7,!![]];});});}})['spread'](function(_0x96cc5d,_0x487c6c){if(_0x487c6c){return _0x96cc5d;}return db[_0xaf0b('0x9d')][_0xaf0b('0x5f')](_[_0xaf0b('0x56')](_0x2d9204['body'],{'read':![],'body':_0x2d9204['body'][_0xaf0b('0x60')],'OpenchannelAccountId':_0x570e79['id'],'OpenchannelInteractionId':_0x96cc5d['id'],'UserId':_0x2d9204[_0xaf0b('0x61')]['id'],'ContactId':_0x34bbf8['id']}))['then'](function(_0x5bfc29){_0x96cc5d['dataValues']['Messages']=[];_0x96cc5d[_0xaf0b('0xbd')][_0xaf0b('0xbc')][_0xaf0b('0x9a')](_0x5bfc29[_0xaf0b('0xbd')]);return _0x96cc5d;});});}})[_0xaf0b('0x20')](respondWithResult(_0x15414b,null))[_0xaf0b('0x2b')](handleError(_0x15414b,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 134c01e..7da853d 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 _0x6e6c=['../../mysqldb','setMaxListeners','save','emit','hook','exports','events'];(function(_0x108f9a,_0x9c2847){var _0x2f7282=function(_0x46af9c){while(--_0x46af9c){_0x108f9a['push'](_0x108f9a['shift']());}};_0x2f7282(++_0x9c2847);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xc6e6('0x0'));var OpenchannelAccount=require(_0xc6e6('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xc6e6('0x2')](0x0);var events={'afterCreate':_0xc6e6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e97f5){return function(_0x5a9e2b,_0x40b7e1,_0x4b13f0){OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5+':'+_0x5a9e2b['id'],_0x5a9e2b);OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5,_0x5a9e2b);_0x4b13f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc6e6('0x5')](e,emitEvent(event));}}module[_0xc6e6('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xec56=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x3d7fa1,_0x340c0e){var _0x4f5e46=function(_0x587608){while(--_0x587608){_0x3d7fa1['push'](_0x3d7fa1['shift']());}};_0x4f5e46(++_0x340c0e);}(_0xec56,0x1bd));var _0x6ec5=function(_0x5c5f55,_0x5d3d31){_0x5c5f55=_0x5c5f55-0x0;var _0x5f576d=_0xec56[_0x5c5f55];return _0x5f576d;};'use strict';var EventEmitter=require(_0x6ec5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6ec5('0x1')](0x0);var events={'afterCreate':_0x6ec5('0x2'),'afterUpdate':_0x6ec5('0x3'),'afterDestroy':_0x6ec5('0x4')};function emitEvent(_0x43c2cd){return function(_0x399441,_0x469679,_0x173aeb){OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd+':'+_0x399441['id'],_0x399441);OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd,_0x399441);_0x173aeb(null);};}for(var e in events){if(events[_0x6ec5('0x6')](e)){var event=events[e];OpenchannelAccount[_0x6ec5('0x7')](e,emitEvent(event));}}module[_0x6ec5('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 4ca0ab3..bce0411 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(_0x592630,_0x399a94){var _0x32feb2=function(_0x4bded8){while(--_0x4bded8){_0x592630['push'](_0x592630['shift']());}};_0x32feb2(++_0x399a94);}(_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 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(_0x34f17a,_0x581f10){var _0x5371be=function(_0x4fcfdf){while(--_0x4fcfdf){_0x34f17a['push'](_0x34f17a['shift']());}};_0x5371be(++_0x581f10);}(_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 4307d39..24d6cc1 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 _0x0db9=['stringify','error','code','message','info','result','catch','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s'];(function(_0xea767b,_0x23c2e7){var _0x3e0105=function(_0x4b250d){while(--_0x4b250d){_0xea767b['push'](_0xea767b['shift']());}};_0x3e0105(++_0x23c2e7);}(_0x0db9,0xa3));var _0x90db=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x0db9[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x90db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x90db('0x1'));var fs=require('fs');var Redis=require(_0x90db('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x90db('0x3'));var logger=require('../../config/logger')(_0x90db('0x4'));var config=require(_0x90db('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x90db('0x6')][_0x90db('0x7')]({'port':0x232a});config[_0x90db('0x8')]=_[_0x90db('0x9')](config[_0x90db('0x8')],{'host':_0x90db('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x90db('0x8')]));require(_0x90db('0xb'))[_0x90db('0xc')](socket);function respondWithRpcPromise(_0x3d5bfd,_0x26eb8f,_0x9a578c){return new BPromise(function(_0xbd058e,_0x1d9f78){return client[_0x90db('0xd')](_0x3d5bfd,_0x9a578c)[_0x90db('0xe')](function(_0x2cb70b){logger['info'](_0x90db('0xf'),_0x26eb8f,_0x90db('0x10'));logger[_0x90db('0x11')](_0x90db('0x12'),_0x26eb8f,_0x90db('0x10'),JSON[_0x90db('0x13')](_0x2cb70b));if(_0x2cb70b[_0x90db('0x14')]){if(_0x2cb70b[_0x90db('0x14')][_0x90db('0x15')]===0x1f4){logger[_0x90db('0x14')](_0x90db('0xf'),_0x26eb8f,_0x2cb70b[_0x90db('0x14')][_0x90db('0x16')]);return _0x1d9f78(_0x2cb70b[_0x90db('0x14')]['message']);}logger[_0x90db('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x26eb8f,_0x2cb70b[_0x90db('0x14')][_0x90db('0x16')]);return _0xbd058e(_0x2cb70b[_0x90db('0x14')][_0x90db('0x16')]);}else{logger[_0x90db('0x17')](_0x90db('0xf'),_0x26eb8f,_0x90db('0x10'));_0xbd058e(_0x2cb70b[_0x90db('0x18')][_0x90db('0x16')]);}})[_0x90db('0x19')](function(_0x5b373b){logger[_0x90db('0x14')](_0x90db('0xf'),_0x26eb8f,_0x5b373b);_0x1d9f78(_0x5b373b);});});} \ No newline at end of file +var _0xf45e=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then'];(function(_0x287ca2,_0x345455){var _0x157fa=function(_0x5a60b6){while(--_0x5a60b6){_0x287ca2['push'](_0x287ca2['shift']());}};_0x157fa(++_0x345455);}(_0xf45e,0x115));var _0xef45=function(_0x558d2a,_0x20d7fa){_0x558d2a=_0x558d2a-0x0;var _0x46a953=_0xf45e[_0x558d2a];return _0x46a953;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var moment=require(_0xef45('0x1'));var BPromise=require('bluebird');var rs=require(_0xef45('0x2'));var fs=require('fs');var Redis=require(_0xef45('0x3'));var db=require(_0xef45('0x4'))['db'];var utils=require(_0xef45('0x5'));var logger=require(_0xef45('0x6'))(_0xef45('0x7'));var config=require(_0xef45('0x8'));var jayson=require(_0xef45('0x9'));var client=jayson[_0xef45('0xa')][_0xef45('0xb')]({'port':0x232a});config[_0xef45('0xc')]=_[_0xef45('0xd')](config[_0xef45('0xc')],{'host':_0xef45('0xe'),'port':0x18eb});var socket=require(_0xef45('0xf'))(new Redis(config[_0xef45('0xc')]));require(_0xef45('0x10'))[_0xef45('0x11')](socket);function respondWithRpcPromise(_0xdac512,_0x4d5cc7,_0x3e852f){return new BPromise(function(_0x400d25,_0x46cfeb){return client[_0xef45('0x12')](_0xdac512,_0x3e852f)[_0xef45('0x13')](function(_0x2b429f){logger['info'](_0xef45('0x14'),_0x4d5cc7,_0xef45('0x15'));logger[_0xef45('0x16')](_0xef45('0x17'),_0x4d5cc7,_0xef45('0x15'),JSON['stringify'](_0x2b429f));if(_0x2b429f['error']){if(_0x2b429f[_0xef45('0x18')]['code']===0x1f4){logger[_0xef45('0x18')](_0xef45('0x14'),_0x4d5cc7,_0x2b429f[_0xef45('0x18')]['message']);return _0x46cfeb(_0x2b429f['error'][_0xef45('0x19')]);}logger['error'](_0xef45('0x14'),_0x4d5cc7,_0x2b429f[_0xef45('0x18')][_0xef45('0x19')]);return _0x400d25(_0x2b429f[_0xef45('0x18')]['message']);}else{logger['info'](_0xef45('0x14'),_0x4d5cc7,_0xef45('0x15'));_0x400d25(_0x2b429f[_0xef45('0x1a')][_0xef45('0x19')]);}})['catch'](function(_0x562955){logger[_0xef45('0x18')](_0xef45('0x14'),_0x4d5cc7,_0x562955);_0x46cfeb(_0x562955);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 8a89edb..3c36aa5 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 _0x8bdf=['./openchannelAccount.events','save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x535724,_0x4e589e){var _0x68e768=function(_0x16ee4d){while(--_0x16ee4d){_0x535724['push'](_0x535724['shift']());}};_0x68e768(++_0x4e589e);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8bdf[_0x297fd3];return _0x2af381;};'use strict';var OpenchannelAccountEvents=require(_0xf8bd('0x0'));var events=[_0xf8bd('0x1'),_0xf8bd('0x2'),_0xf8bd('0x3')];function createListener(_0x336d9f,_0x57e7be){return function(_0x35ddcf){_0x57e7be[_0xf8bd('0x4')](_0x336d9f,_0x35ddcf);};}function removeListener(_0x147fea,_0x3b32a1){return function(){OpenchannelAccountEvents[_0xf8bd('0x5')](_0x147fea,_0x3b32a1);};}exports[_0xf8bd('0x6')]=function(_0x59eff9){for(var _0x4ed701=0x0,_0x504c82=events[_0xf8bd('0x7')];_0x4ed701<_0x504c82;_0x4ed701++){var _0x22a277=events[_0x4ed701];var _0x3e1db1=createListener(_0xf8bd('0x8')+_0x22a277,_0x59eff9);OpenchannelAccountEvents['on'](_0x22a277,_0x3e1db1);}}; \ No newline at end of file +var _0x342b=['register','length','./openchannelAccount.events','remove','update','removeListener'];(function(_0x8e5a15,_0x35d68f){var _0x4e7528=function(_0x2862b2){while(--_0x2862b2){_0x8e5a15['push'](_0x8e5a15['shift']());}};_0x4e7528(++_0x35d68f);}(_0x342b,0xbc));var _0xb342=function(_0x4ac45e,_0x339cb2){_0x4ac45e=_0x4ac45e-0x0;var _0x5ace37=_0x342b[_0x4ac45e];return _0x5ace37;};'use strict';var OpenchannelAccountEvents=require(_0xb342('0x0'));var events=['save',_0xb342('0x1'),_0xb342('0x2')];function createListener(_0x21d8fb,_0x586739){return function(_0x509812){_0x586739['emit'](_0x21d8fb,_0x509812);};}function removeListener(_0x5b7c7f,_0x1b1604){return function(){OpenchannelAccountEvents[_0xb342('0x3')](_0x5b7c7f,_0x1b1604);};}exports[_0xb342('0x4')]=function(_0x28bca8){for(var _0x25ecba=0x0,_0x2f6281=events[_0xb342('0x5')];_0x25ecba<_0x2f6281;_0x25ecba++){var _0x3c7ac7=events[_0x25ecba];var _0x54175e=createListener('openchannelAccount:'+_0x3c7ac7,_0x28bca8);OpenchannelAccountEvents['on'](_0x3c7ac7,_0x54175e);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 0102aa7..079d841 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 _0xe0d5=['exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show','post','isAuthenticated','create','delete','destroy'];(function(_0x2e10b1,_0x845b82){var _0x41de8b=function(_0x3cad6d){while(--_0x3cad6d){_0x2e10b1['push'](_0x2e10b1['shift']());}};_0x41de8b(++_0x845b82);}(_0xe0d5,0x1c1));var _0x5e0d=function(_0x21adfc,_0x13ca07){_0x21adfc=_0x21adfc-0x0;var _0x1a0778=_0xe0d5[_0x21adfc];return _0x1a0778;};'use strict';var multer=require('multer');var util=require(_0x5e0d('0x0'));var path=require('path');var timeout=require(_0x5e0d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5e0d('0x2'));var auth=require(_0x5e0d('0x3'));var interaction=require(_0x5e0d('0x4'));var config=require(_0x5e0d('0x5'));var controller=require('./openchannelApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5e0d('0x6')]);router[_0x5e0d('0x7')](_0x5e0d('0x8'),auth['isAuthenticated'](),controller[_0x5e0d('0x9')]);router[_0x5e0d('0xa')]('/',auth[_0x5e0d('0xb')](),controller[_0x5e0d('0xc')]);router['put'](_0x5e0d('0x8'),auth[_0x5e0d('0xb')](),controller['update']);router[_0x5e0d('0xd')]('/:id',auth[_0x5e0d('0xb')](),controller[_0x5e0d('0xe')]);module[_0x5e0d('0xf')]=router; \ No newline at end of file +var _0xf196=['delete','destroy','exports','multer','Router','fs-extra','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','/:id','put','update'];(function(_0xde5744,_0x5c49fe){var _0x1dc4fc=function(_0x1c7643){while(--_0x1c7643){_0xde5744['push'](_0xde5744['shift']());}};_0x1dc4fc(++_0x5c49fe);}(_0xf196,0x107));var _0x6f19=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf196[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x6f19('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f19('0x1')]();var fs_extra=require(_0x6f19('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x6f19('0x3'));var config=require('../../config/environment');var controller=require(_0x6f19('0x4'));router[_0x6f19('0x5')]('/',auth[_0x6f19('0x6')](),controller['index']);router['get'](_0x6f19('0x7'),auth[_0x6f19('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6f19('0x8')](_0x6f19('0x7'),auth[_0x6f19('0x6')](),controller[_0x6f19('0x9')]);router[_0x6f19('0xa')](_0x6f19('0x7'),auth['isAuthenticated'](),controller[_0x6f19('0xb')]);module[_0x6f19('0xc')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3932b7f..8e997e0 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 _0x398e=['TEXT','STRING','exports','INTEGER'];(function(_0x4a2fa8,_0x536247){var _0xf982c6=function(_0x4006d1){while(--_0x4006d1){_0x4a2fa8['push'](_0x4a2fa8['shift']());}};_0xf982c6(++_0x536247);}(_0x398e,0x192));var _0xe398=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x398e[_0x4dab14];return _0xf41aa;};'use strict';var Sequelize=require('sequelize');module[_0xe398('0x0')]={'priority':{'type':Sequelize[_0xe398('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe398('0x2')]()},'description':{'type':Sequelize[_0xe398('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x468d=['sequelize','TEXT','STRING'];(function(_0x487b25,_0x33ae48){var _0x22ba2f=function(_0x4ce058){while(--_0x4ce058){_0x487b25['push'](_0x487b25['shift']());}};_0x22ba2f(++_0x33ae48);}(_0x468d,0x72));var _0xd468=function(_0x1d1fdc,_0x1259fa){_0x1d1fdc=_0x1d1fdc-0x0;var _0x30782b=_0x468d[_0x1d1fdc];return _0x30782b;};'use strict';var Sequelize=require(_0xd468('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd468('0x1')]()},'description':{'type':Sequelize[_0xd468('0x2')]},'interval':{'type':Sequelize[_0xd468('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 6d0b683..d4310cb 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 _0xf619=['set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','OpenchannelApplication','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','length','options','create','body','find','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x44439b,_0x304902){var _0x51037a=function(_0x43cad8){while(--_0x43cad8){_0x44439b['push'](_0x44439b['shift']());}};_0x51037a(++_0x304902);}(_0xf619,0x14e));var _0x9f61=function(_0x543e66,_0x562c37){_0x543e66=_0x543e66-0x0;var _0x1e01e9=_0xf619[_0x543e66];return _0x1e01e9;};'use strict';var emlformat=require(_0x9f61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f61('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f61('0x2'));var moment=require(_0x9f61('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9f61('0x4'));var util=require(_0x9f61('0x5'));var path=require(_0x9f61('0x6'));var sox=require(_0x9f61('0x7'));var csv=require(_0x9f61('0x8'));var ejs=require(_0x9f61('0x9'));var fs=require('fs');var fs_extra=require(_0x9f61('0xa'));var _=require(_0x9f61('0xb'));var squel=require(_0x9f61('0xc'));var crypto=require(_0x9f61('0xd'));var jsforce=require(_0x9f61('0xe'));var deskjs=require(_0x9f61('0xf'));var toCsv=require(_0x9f61('0x8'));var querystring=require(_0x9f61('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9f61('0x11'));var as=require(_0x9f61('0x12'));var hardwareService=require(_0x9f61('0x13'));var logger=require('../../config/logger')(_0x9f61('0x14'));var utils=require('../../config/utils');var config=require(_0x9f61('0x15'));var licenseUtil=require(_0x9f61('0x16'));var db=require(_0x9f61('0x17'))['db'];function respondWithStatusCode(_0x27dd2c,_0x111184){_0x111184=_0x111184||0xcc;return function(_0x162181){if(_0x162181){return _0x27dd2c[_0x9f61('0x18')](_0x111184);}return _0x27dd2c[_0x9f61('0x19')](_0x111184)['end']();};}function respondWithResult(_0x576f8e,_0x33e6d1){_0x33e6d1=_0x33e6d1||0xc8;return function(_0x38dbec){if(_0x38dbec){return _0x576f8e[_0x9f61('0x19')](_0x33e6d1)[_0x9f61('0x1a')](_0x38dbec);}};}function respondWithFilteredResult(_0x284f78,_0x4a8e17){return function(_0x51dbb9){if(_0x51dbb9){var _0xb96701=typeof _0x4a8e17[_0x9f61('0x1b')]===_0x9f61('0x1c')&&typeof _0x4a8e17[_0x9f61('0x1d')]===_0x9f61('0x1c');var _0x201d9a=_0x51dbb9[_0x9f61('0x1e')];var _0x4fef00=_0xb96701?0x0:_0x4a8e17['offset'];var _0x3ec105=_0xb96701?_0x51dbb9[_0x9f61('0x1e')]:_0x4a8e17['offset']+_0x4a8e17[_0x9f61('0x1d')];var _0x58f256;if(_0x3ec105>=_0x201d9a){_0x3ec105=_0x201d9a;_0x58f256=0xc8;}else{_0x58f256=0xce;}_0x284f78[_0x9f61('0x19')](_0x58f256);return _0x284f78[_0x9f61('0x1f')](_0x9f61('0x20'),_0x4fef00+'-'+_0x3ec105+'/'+_0x201d9a)[_0x9f61('0x1a')](_0x51dbb9);}return null;};}function patchUpdates(_0x13897b){return function(_0x5c138d){try{jsonpatch[_0x9f61('0x21')](_0x5c138d,_0x13897b,!![]);}catch(_0x2ba534){return BPromise[_0x9f61('0x22')](_0x2ba534);}return _0x5c138d[_0x9f61('0x23')]();};}function saveUpdates(_0x34c408,_0x25d1ac){return function(_0x47db5e){if(_0x47db5e){return _0x47db5e[_0x9f61('0x24')](_0x34c408)['then'](function(_0x3725a8){return _0x3725a8;});}return null;};}function removeEntity(_0x2fbf62,_0x319f94){return function(_0x3e9af8){if(_0x3e9af8){return _0x3e9af8[_0x9f61('0x25')]()[_0x9f61('0x26')](function(){_0x2fbf62[_0x9f61('0x19')](0xcc)[_0x9f61('0x27')]();});}};}function handleEntityNotFound(_0x1917d1,_0x4ef9f6){return function(_0x5d0344){if(!_0x5d0344){_0x1917d1['sendStatus'](0x194);}return _0x5d0344;};}function handleError(_0x1e6a1a,_0x11bfee){_0x11bfee=_0x11bfee||0x1f4;return function(_0x51a853){logger[_0x9f61('0x28')](_0x51a853[_0x9f61('0x29')]);if(_0x51a853[_0x9f61('0x2a')]){delete _0x51a853[_0x9f61('0x2a')];}_0x1e6a1a[_0x9f61('0x19')](_0x11bfee)[_0x9f61('0x2b')](_0x51a853);};}exports['index']=function(_0x3cb875,_0x340b8c){var _0x3a2aa4={},_0x16aa67={},_0x9dd44d={'count':0x0,'rows':[]};var _0x3ed766=_['map'](db[_0x9f61('0x2c')][_0x9f61('0x2d')],function(_0x5e4aa6){return{'name':_0x5e4aa6[_0x9f61('0x2e')],'type':_0x5e4aa6[_0x9f61('0x2f')]['key']};});_0x16aa67['model']=_[_0x9f61('0x30')](_0x3ed766,'name');_0x16aa67[_0x9f61('0x31')]=_[_0x9f61('0x32')](_0x3cb875[_0x9f61('0x31')]);_0x16aa67['filters']=_['intersection'](_0x16aa67[_0x9f61('0x33')],_0x16aa67[_0x9f61('0x31')]);_0x3a2aa4[_0x9f61('0x34')]=_[_0x9f61('0x35')](_0x16aa67[_0x9f61('0x33')],qs[_0x9f61('0x36')](_0x3cb875['query'][_0x9f61('0x36')]));_0x3a2aa4['attributes']=_0x3a2aa4[_0x9f61('0x34')]['length']?_0x3a2aa4[_0x9f61('0x34')]:_0x16aa67['model'];if(!_0x3cb875[_0x9f61('0x31')][_0x9f61('0x37')]('nolimit')){_0x3a2aa4[_0x9f61('0x1d')]=qs[_0x9f61('0x1d')](_0x3cb875[_0x9f61('0x31')][_0x9f61('0x1d')]);_0x3a2aa4[_0x9f61('0x1b')]=qs[_0x9f61('0x1b')](_0x3cb875[_0x9f61('0x31')][_0x9f61('0x1b')]);}_0x3a2aa4['order']=qs[_0x9f61('0x38')](_0x3cb875[_0x9f61('0x31')][_0x9f61('0x38')]);_0x3a2aa4[_0x9f61('0x39')]=qs[_0x9f61('0x3a')](_[_0x9f61('0x3b')](_0x3cb875[_0x9f61('0x31')],_0x16aa67[_0x9f61('0x3a')]),_0x3ed766);if(_0x3cb875[_0x9f61('0x31')][_0x9f61('0x3c')]){_0x3a2aa4[_0x9f61('0x39')]=_[_0x9f61('0x3d')](_0x3a2aa4[_0x9f61('0x39')],{'$or':_['map'](_0x3ed766,function(_0x6f2669){if(_0x6f2669[_0x9f61('0x2f')]!==_0x9f61('0x3e')){var _0x1c867f={};_0x1c867f[_0x6f2669[_0x9f61('0x2a')]]={'$like':'%'+_0x3cb875[_0x9f61('0x31')][_0x9f61('0x3c')]+'%'};return _0x1c867f;}})});}_0x3a2aa4=_[_0x9f61('0x3d')]({},_0x3a2aa4,_0x3cb875['options']);var _0x8c3481={'where':_0x3a2aa4[_0x9f61('0x39')]};return db[_0x9f61('0x2c')]['count'](_0x8c3481)[_0x9f61('0x26')](function(_0x4b70a6){_0x9dd44d[_0x9f61('0x1e')]=_0x4b70a6;if(_0x3cb875[_0x9f61('0x31')][_0x9f61('0x3f')]){_0x3a2aa4['include']=[{'all':!![]}];}return db[_0x9f61('0x2c')][_0x9f61('0x40')](_0x3a2aa4);})[_0x9f61('0x26')](function(_0xe4822a){_0x9dd44d[_0x9f61('0x41')]=_0xe4822a;return _0x9dd44d;})[_0x9f61('0x26')](respondWithFilteredResult(_0x340b8c,_0x3a2aa4))[_0x9f61('0x42')](handleError(_0x340b8c,null));};exports['show']=function(_0x518b47,_0x5ddb7d){var _0x35c454={'raw':!![],'where':{'id':_0x518b47[_0x9f61('0x43')]['id']}},_0x27eac0={};_0x27eac0[_0x9f61('0x33')]=_[_0x9f61('0x32')](db[_0x9f61('0x2c')][_0x9f61('0x2d')]);_0x27eac0[_0x9f61('0x31')]=_[_0x9f61('0x32')](_0x518b47[_0x9f61('0x31')]);_0x27eac0[_0x9f61('0x3a')]=_['intersection'](_0x27eac0[_0x9f61('0x33')],_0x27eac0[_0x9f61('0x31')]);_0x35c454[_0x9f61('0x34')]=_[_0x9f61('0x35')](_0x27eac0['model'],qs['fields'](_0x518b47[_0x9f61('0x31')][_0x9f61('0x36')]));_0x35c454[_0x9f61('0x34')]=_0x35c454['attributes'][_0x9f61('0x44')]?_0x35c454['attributes']:_0x27eac0['model'];if(_0x518b47['query'][_0x9f61('0x3f')]){_0x35c454['include']=[{'all':!![]}];}_0x35c454=_[_0x9f61('0x3d')]({},_0x35c454,_0x518b47[_0x9f61('0x45')]);return db['OpenchannelApplication']['find'](_0x35c454)[_0x9f61('0x26')](handleEntityNotFound(_0x5ddb7d,null))[_0x9f61('0x26')](respondWithResult(_0x5ddb7d,null))['catch'](handleError(_0x5ddb7d,null));};exports[_0x9f61('0x46')]=function(_0x308698,_0x496e11){return db[_0x9f61('0x2c')][_0x9f61('0x46')](_0x308698[_0x9f61('0x47')],{})[_0x9f61('0x26')](respondWithResult(_0x496e11,0xc9))[_0x9f61('0x42')](handleError(_0x496e11,null));};exports[_0x9f61('0x24')]=function(_0x527290,_0x80c26a){if(_0x527290['body']['id']){delete _0x527290[_0x9f61('0x47')]['id'];}return db[_0x9f61('0x2c')][_0x9f61('0x48')]({'where':{'id':_0x527290['params']['id']}})['then'](handleEntityNotFound(_0x80c26a,null))[_0x9f61('0x26')](saveUpdates(_0x527290[_0x9f61('0x47')],null))[_0x9f61('0x26')](respondWithResult(_0x80c26a,null))[_0x9f61('0x42')](handleError(_0x80c26a,null));};exports[_0x9f61('0x25')]=function(_0x4866ba,_0x2608b7){return db[_0x9f61('0x2c')][_0x9f61('0x48')]({'where':{'id':_0x4866ba[_0x9f61('0x43')]['id']}})[_0x9f61('0x26')](handleEntityNotFound(_0x2608b7,null))[_0x9f61('0x26')](removeEntity(_0x2608b7,null))[_0x9f61('0x42')](handleError(_0x2608b7,null));}; \ No newline at end of file +var _0x6c31=['../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error','stack','index','map','rawAttributes','fieldName','type','key','name','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','OpenchannelApplication','includeAll','include','rows','catch','params','keys','merge','find','create','body','update','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x13aa0a,_0x55079e){var _0xf05be=function(_0xb9541f){while(--_0xb9541f){_0x13aa0a['push'](_0x13aa0a['shift']());}};_0xf05be(++_0x55079e);}(_0x6c31,0x111));var _0x16c3=function(_0x43f552,_0x42808c){_0x43f552=_0x43f552-0x0;var _0x17911b=_0x6c31[_0x43f552];return _0x17911b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16c3('0x0'));var zipdir=require(_0x16c3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16c3('0x2'));var moment=require(_0x16c3('0x3'));var BPromise=require(_0x16c3('0x4'));var Mustache=require(_0x16c3('0x5'));var util=require(_0x16c3('0x6'));var path=require(_0x16c3('0x7'));var sox=require(_0x16c3('0x8'));var csv=require(_0x16c3('0x9'));var ejs=require(_0x16c3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16c3('0xb'));var squel=require(_0x16c3('0xc'));var crypto=require(_0x16c3('0xd'));var jsforce=require(_0x16c3('0xe'));var deskjs=require(_0x16c3('0xf'));var toCsv=require(_0x16c3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x16c3('0x10'));var qs=require(_0x16c3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x16c3('0x12'))(_0x16c3('0x13'));var utils=require(_0x16c3('0x14'));var config=require(_0x16c3('0x15'));var licenseUtil=require(_0x16c3('0x16'));var db=require(_0x16c3('0x17'))['db'];function respondWithStatusCode(_0x4416ae,_0x24c890){_0x24c890=_0x24c890||0xcc;return function(_0x39cf17){if(_0x39cf17){return _0x4416ae[_0x16c3('0x18')](_0x24c890);}return _0x4416ae[_0x16c3('0x19')](_0x24c890)[_0x16c3('0x1a')]();};}function respondWithResult(_0xf311d4,_0x14bff0){_0x14bff0=_0x14bff0||0xc8;return function(_0x45aa7b){if(_0x45aa7b){return _0xf311d4[_0x16c3('0x19')](_0x14bff0)[_0x16c3('0x1b')](_0x45aa7b);}};}function respondWithFilteredResult(_0x31d85a,_0xaa4a34){return function(_0xd6423d){if(_0xd6423d){var _0x5214d6=typeof _0xaa4a34[_0x16c3('0x1c')]==='undefined'&&typeof _0xaa4a34[_0x16c3('0x1d')]===_0x16c3('0x1e');var _0x4b708b=_0xd6423d[_0x16c3('0x1f')];var _0x11fc8e=_0x5214d6?0x0:_0xaa4a34[_0x16c3('0x1c')];var _0x59bd96=_0x5214d6?_0xd6423d[_0x16c3('0x1f')]:_0xaa4a34[_0x16c3('0x1c')]+_0xaa4a34[_0x16c3('0x1d')];var _0x39ad9a;if(_0x59bd96>=_0x4b708b){_0x59bd96=_0x4b708b;_0x39ad9a=0xc8;}else{_0x39ad9a=0xce;}_0x31d85a[_0x16c3('0x19')](_0x39ad9a);return _0x31d85a[_0x16c3('0x20')](_0x16c3('0x21'),_0x11fc8e+'-'+_0x59bd96+'/'+_0x4b708b)[_0x16c3('0x1b')](_0xd6423d);}return null;};}function patchUpdates(_0x675602){return function(_0x970e77){try{jsonpatch[_0x16c3('0x22')](_0x970e77,_0x675602,!![]);}catch(_0x3c0f57){return BPromise['reject'](_0x3c0f57);}return _0x970e77[_0x16c3('0x23')]();};}function saveUpdates(_0x358b95,_0x5eb80b){return function(_0x20d429){if(_0x20d429){return _0x20d429['update'](_0x358b95)['then'](function(_0x3c0b4b){return _0x3c0b4b;});}return null;};}function removeEntity(_0x58fe8c,_0x4e6f81){return function(_0x2576b9){if(_0x2576b9){return _0x2576b9[_0x16c3('0x24')]()[_0x16c3('0x25')](function(){_0x58fe8c[_0x16c3('0x19')](0xcc)[_0x16c3('0x1a')]();});}};}function handleEntityNotFound(_0x474492,_0x29d6e6){return function(_0x1c349d){if(!_0x1c349d){_0x474492[_0x16c3('0x18')](0x194);}return _0x1c349d;};}function handleError(_0x30e2df,_0x4ffec1){_0x4ffec1=_0x4ffec1||0x1f4;return function(_0x1a6ccf){logger[_0x16c3('0x26')](_0x1a6ccf[_0x16c3('0x27')]);if(_0x1a6ccf['name']){delete _0x1a6ccf['name'];}_0x30e2df[_0x16c3('0x19')](_0x4ffec1)['send'](_0x1a6ccf);};}exports[_0x16c3('0x28')]=function(_0x38ecba,_0xa2ab51){var _0x39497c={},_0x383669={},_0x285781={'count':0x0,'rows':[]};var _0x428f75=_[_0x16c3('0x29')](db['OpenchannelApplication'][_0x16c3('0x2a')],function(_0x18ff8e){return{'name':_0x18ff8e[_0x16c3('0x2b')],'type':_0x18ff8e[_0x16c3('0x2c')][_0x16c3('0x2d')]};});_0x383669['model']=_[_0x16c3('0x29')](_0x428f75,_0x16c3('0x2e'));_0x383669['query']=_['keys'](_0x38ecba['query']);_0x383669['filters']=_[_0x16c3('0x2f')](_0x383669[_0x16c3('0x30')],_0x383669[_0x16c3('0x31')]);_0x39497c[_0x16c3('0x32')]=_[_0x16c3('0x2f')](_0x383669[_0x16c3('0x30')],qs['fields'](_0x38ecba[_0x16c3('0x31')][_0x16c3('0x33')]));_0x39497c[_0x16c3('0x32')]=_0x39497c[_0x16c3('0x32')][_0x16c3('0x34')]?_0x39497c[_0x16c3('0x32')]:_0x383669[_0x16c3('0x30')];if(!_0x38ecba[_0x16c3('0x31')]['hasOwnProperty'](_0x16c3('0x35'))){_0x39497c[_0x16c3('0x1d')]=qs['limit'](_0x38ecba[_0x16c3('0x31')][_0x16c3('0x1d')]);_0x39497c[_0x16c3('0x1c')]=qs[_0x16c3('0x1c')](_0x38ecba['query']['offset']);}_0x39497c[_0x16c3('0x36')]=qs[_0x16c3('0x37')](_0x38ecba[_0x16c3('0x31')][_0x16c3('0x37')]);_0x39497c[_0x16c3('0x38')]=qs[_0x16c3('0x39')](_[_0x16c3('0x3a')](_0x38ecba[_0x16c3('0x31')],_0x383669['filters']),_0x428f75);if(_0x38ecba[_0x16c3('0x31')][_0x16c3('0x3b')]){_0x39497c[_0x16c3('0x38')]=_['merge'](_0x39497c[_0x16c3('0x38')],{'$or':_[_0x16c3('0x29')](_0x428f75,function(_0xe24f86){if(_0xe24f86[_0x16c3('0x2c')]!==_0x16c3('0x3c')){var _0x164406={};_0x164406[_0xe24f86[_0x16c3('0x2e')]]={'$like':'%'+_0x38ecba[_0x16c3('0x31')][_0x16c3('0x3b')]+'%'};return _0x164406;}})});}_0x39497c=_['merge']({},_0x39497c,_0x38ecba[_0x16c3('0x3d')]);var _0x32c7f5={'where':_0x39497c[_0x16c3('0x38')]};return db[_0x16c3('0x3e')][_0x16c3('0x1f')](_0x32c7f5)[_0x16c3('0x25')](function(_0x456cea){_0x285781[_0x16c3('0x1f')]=_0x456cea;if(_0x38ecba['query'][_0x16c3('0x3f')]){_0x39497c[_0x16c3('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x39497c);})[_0x16c3('0x25')](function(_0x348a1f){_0x285781[_0x16c3('0x41')]=_0x348a1f;return _0x285781;})[_0x16c3('0x25')](respondWithFilteredResult(_0xa2ab51,_0x39497c))[_0x16c3('0x42')](handleError(_0xa2ab51,null));};exports['show']=function(_0x52ba3f,_0x430271){var _0x2cf42d={'raw':!![],'where':{'id':_0x52ba3f[_0x16c3('0x43')]['id']}},_0x3bd0e7={};_0x3bd0e7['model']=_[_0x16c3('0x44')](db[_0x16c3('0x3e')][_0x16c3('0x2a')]);_0x3bd0e7[_0x16c3('0x31')]=_[_0x16c3('0x44')](_0x52ba3f[_0x16c3('0x31')]);_0x3bd0e7[_0x16c3('0x39')]=_['intersection'](_0x3bd0e7[_0x16c3('0x30')],_0x3bd0e7[_0x16c3('0x31')]);_0x2cf42d[_0x16c3('0x32')]=_[_0x16c3('0x2f')](_0x3bd0e7[_0x16c3('0x30')],qs['fields'](_0x52ba3f['query'][_0x16c3('0x33')]));_0x2cf42d['attributes']=_0x2cf42d['attributes']['length']?_0x2cf42d['attributes']:_0x3bd0e7[_0x16c3('0x30')];if(_0x52ba3f['query'][_0x16c3('0x3f')]){_0x2cf42d[_0x16c3('0x40')]=[{'all':!![]}];}_0x2cf42d=_[_0x16c3('0x45')]({},_0x2cf42d,_0x52ba3f[_0x16c3('0x3d')]);return db['OpenchannelApplication'][_0x16c3('0x46')](_0x2cf42d)[_0x16c3('0x25')](handleEntityNotFound(_0x430271,null))[_0x16c3('0x25')](respondWithResult(_0x430271,null))[_0x16c3('0x42')](handleError(_0x430271,null));};exports[_0x16c3('0x47')]=function(_0x3530ba,_0x5eba9a){return db[_0x16c3('0x3e')][_0x16c3('0x47')](_0x3530ba[_0x16c3('0x48')],{})[_0x16c3('0x25')](respondWithResult(_0x5eba9a,0xc9))['catch'](handleError(_0x5eba9a,null));};exports[_0x16c3('0x49')]=function(_0x174565,_0x543e8a){if(_0x174565[_0x16c3('0x48')]['id']){delete _0x174565[_0x16c3('0x48')]['id'];}return db[_0x16c3('0x3e')]['find']({'where':{'id':_0x174565[_0x16c3('0x43')]['id']}})['then'](handleEntityNotFound(_0x543e8a,null))[_0x16c3('0x25')](saveUpdates(_0x174565['body'],null))[_0x16c3('0x25')](respondWithResult(_0x543e8a,null))[_0x16c3('0x42')](handleError(_0x543e8a,null));};exports[_0x16c3('0x24')]=function(_0x3d0e63,_0x36ac9a){return db[_0x16c3('0x3e')][_0x16c3('0x46')]({'where':{'id':_0x3d0e63[_0x16c3('0x43')]['id']}})[_0x16c3('0x25')](handleEntityNotFound(_0x36ac9a,null))['then'](removeEntity(_0x36ac9a,null))['catch'](handleError(_0x36ac9a,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index d3d2bb2..f1e2a17 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 _0x7f23=['path','../../config/environment','exports','define','OpenchannelApplication','utf8mb4','lodash','api','moment','bluebird','request-promise'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x7f23,0x12f));var _0x37f2=function(_0x560dc9,_0x1c92a8){_0x560dc9=_0x560dc9-0x0;var _0x352cef=_0x7f23[_0x560dc9];return _0x352cef;};'use strict';var _=require(_0x37f2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x37f2('0x1'));var moment=require(_0x37f2('0x2'));var BPromise=require(_0x37f2('0x3'));var rp=require(_0x37f2('0x4'));var fs=require('fs');var path=require(_0x37f2('0x5'));var rimraf=require('rimraf');var config=require(_0x37f2('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0x37f2('0x7')]=function(_0x3f96c1,_0x282fd8){return _0x3f96c1[_0x37f2('0x8')](_0x37f2('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x37f2('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4ffa=['../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x31af83,_0x33449b){var _0x5f0c72=function(_0x6c6d67){while(--_0x6c6d67){_0x31af83['push'](_0x31af83['shift']());}};_0x5f0c72(++_0x33449b);}(_0x4ffa,0x88));var _0xa4ff=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4ffa[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xa4ff('0x0'));var logger=require(_0xa4ff('0x1'))(_0xa4ff('0x2'));var moment=require(_0xa4ff('0x3'));var BPromise=require(_0xa4ff('0x4'));var rp=require(_0xa4ff('0x5'));var fs=require('fs');var path=require(_0xa4ff('0x6'));var rimraf=require(_0xa4ff('0x7'));var config=require(_0xa4ff('0x8'));var attributes=require(_0xa4ff('0x9'));module[_0xa4ff('0xa')]=function(_0x3eb2b5,_0x349b48){return _0x3eb2b5[_0xa4ff('0xb')](_0xa4ff('0xc'),attributes,{'tableName':_0xa4ff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa4ff('0xe'),'collate':_0xa4ff('0xf')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 1d1f28b..e79b300 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 _0x2e5c=['where','limit','UpdateOpenchannelApplication','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','catch','OpenchannelApplication','update','body','options','raw'];(function(_0x3acd45,_0x45e5d0){var _0x219166=function(_0x35d0c8){while(--_0x35d0c8){_0x3acd45['push'](_0x3acd45['shift']());}};_0x219166(++_0x45e5d0);}(_0x2e5c,0x189));var _0xc2e5=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x2e5c[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0xc2e5('0x0'));var util=require(_0xc2e5('0x1'));var moment=require(_0xc2e5('0x2'));var BPromise=require('bluebird');var rs=require(_0xc2e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2e5('0x4'))['db'];var utils=require(_0xc2e5('0x5'));var logger=require('../../config/logger')(_0xc2e5('0x6'));var config=require(_0xc2e5('0x7'));var jayson=require(_0xc2e5('0x8'));var client=jayson[_0xc2e5('0x9')][_0xc2e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a7548,_0x480e50,_0x32b60e){return new BPromise(function(_0x54945d,_0x2863dd){return client[_0xc2e5('0xb')](_0x5a7548,_0x32b60e)[_0xc2e5('0xc')](function(_0x231a4f){logger[_0xc2e5('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x480e50,'request\x20sent');logger[_0xc2e5('0xe')](_0xc2e5('0xf'),_0x480e50,_0xc2e5('0x10'),JSON[_0xc2e5('0x11')](_0x231a4f));if(_0x231a4f[_0xc2e5('0x12')]){if(_0x231a4f[_0xc2e5('0x12')]['code']===0x1f4){logger[_0xc2e5('0x12')](_0xc2e5('0x13'),_0x480e50,_0x231a4f[_0xc2e5('0x12')]['message']);return _0x2863dd(_0x231a4f[_0xc2e5('0x12')][_0xc2e5('0x14')]);}logger['error'](_0xc2e5('0x13'),_0x480e50,_0x231a4f[_0xc2e5('0x12')][_0xc2e5('0x14')]);return _0x54945d(_0x231a4f['error']['message']);}else{logger[_0xc2e5('0xd')](_0xc2e5('0x13'),_0x480e50,_0xc2e5('0x10'));_0x54945d(_0x231a4f['result'][_0xc2e5('0x14')]);}})[_0xc2e5('0x15')](function(_0x486cff){logger[_0xc2e5('0x12')](_0xc2e5('0x13'),_0x480e50,_0x486cff);_0x2863dd(_0x486cff);});});}exports['UpdateOpenchannelApplication']=function(_0x2b1d2d){var _0x1b4919=this;return new Promise(function(_0x128be5,_0x5c67a2){return db[_0xc2e5('0x16')][_0xc2e5('0x17')](_0x2b1d2d[_0xc2e5('0x18')],{'raw':_0x2b1d2d[_0xc2e5('0x19')]?_0x2b1d2d[_0xc2e5('0x19')][_0xc2e5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1d2d[_0xc2e5('0x19')]?_0x2b1d2d[_0xc2e5('0x19')][_0xc2e5('0x1b')]||null:null,'attributes':_0x2b1d2d[_0xc2e5('0x19')]?_0x2b1d2d['options']['attributes']||null:null,'limit':_0x2b1d2d[_0xc2e5('0x19')]?_0x2b1d2d[_0xc2e5('0x19')][_0xc2e5('0x1c')]||null:null})[_0xc2e5('0xc')](function(_0x51449b){logger['info'](_0xc2e5('0x1d'),_0x2b1d2d);logger[_0xc2e5('0xe')](_0xc2e5('0x1d'),_0x2b1d2d,JSON[_0xc2e5('0x11')](_0x51449b));_0x128be5(_0x51449b);})[_0xc2e5('0x15')](function(_0x458ee3){logger[_0xc2e5('0x12')](_0xc2e5('0x1d'),_0x458ee3[_0xc2e5('0x14')],_0x2b1d2d);_0x5c67a2(_0x1b4919[_0xc2e5('0x12')](0x1f4,_0x458ee3[_0xc2e5('0x14')]));});});}; \ No newline at end of file +var _0xa6fe=['code','error','message','info','result','OpenchannelApplication','update','body','options','raw','where','attributes','UpdateOpenchannelApplication','debug','stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0xa6fe,0x1c2));var _0xea6f=function(_0x4ce022,_0x556b16){_0x4ce022=_0x4ce022-0x0;var _0x23509e=_0xa6fe[_0x4ce022];return _0x23509e;};'use strict';var _=require(_0xea6f('0x0'));var util=require(_0xea6f('0x1'));var moment=require('moment');var BPromise=require(_0xea6f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea6f('0x3'));var db=require(_0xea6f('0x4'))['db'];var utils=require(_0xea6f('0x5'));var logger=require(_0xea6f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xea6f('0x7'));var client=jayson[_0xea6f('0x8')][_0xea6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x448260,_0x1b3084,_0x108abc){return new BPromise(function(_0x1be9b1,_0x25242f){return client[_0xea6f('0xa')](_0x448260,_0x108abc)[_0xea6f('0xb')](function(_0x511764){logger['info'](_0xea6f('0xc'),_0x1b3084,_0xea6f('0xd'));logger['debug'](_0xea6f('0xe'),_0x1b3084,_0xea6f('0xd'),JSON['stringify'](_0x511764));if(_0x511764['error']){if(_0x511764['error'][_0xea6f('0xf')]===0x1f4){logger['error'](_0xea6f('0xc'),_0x1b3084,_0x511764[_0xea6f('0x10')]['message']);return _0x25242f(_0x511764[_0xea6f('0x10')][_0xea6f('0x11')]);}logger['error'](_0xea6f('0xc'),_0x1b3084,_0x511764['error'][_0xea6f('0x11')]);return _0x1be9b1(_0x511764['error'][_0xea6f('0x11')]);}else{logger[_0xea6f('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x1b3084,_0xea6f('0xd'));_0x1be9b1(_0x511764[_0xea6f('0x13')]['message']);}})['catch'](function(_0x216cc0){logger[_0xea6f('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x1b3084,_0x216cc0);_0x25242f(_0x216cc0);});});}exports['UpdateOpenchannelApplication']=function(_0x2ddac5){var _0x27784d=this;return new Promise(function(_0x260231,_0x3c48b0){return db[_0xea6f('0x14')][_0xea6f('0x15')](_0x2ddac5[_0xea6f('0x16')],{'raw':_0x2ddac5[_0xea6f('0x17')]?_0x2ddac5[_0xea6f('0x17')][_0xea6f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ddac5['options']?_0x2ddac5[_0xea6f('0x17')][_0xea6f('0x19')]||null:null,'attributes':_0x2ddac5[_0xea6f('0x17')]?_0x2ddac5[_0xea6f('0x17')][_0xea6f('0x1a')]||null:null,'limit':_0x2ddac5[_0xea6f('0x17')]?_0x2ddac5[_0xea6f('0x17')]['limit']||null:null})[_0xea6f('0xb')](function(_0x319738){logger[_0xea6f('0x12')](_0xea6f('0x1b'),_0x2ddac5);logger[_0xea6f('0x1c')](_0xea6f('0x1b'),_0x2ddac5,JSON[_0xea6f('0x1d')](_0x319738));_0x260231(_0x319738);})[_0xea6f('0x1e')](function(_0x666ffa){logger[_0xea6f('0x10')](_0xea6f('0x1b'),_0x666ffa['message'],_0x2ddac5);_0x3c48b0(_0x27784d[_0xea6f('0x10')](0x1f4,_0x666ffa[_0xea6f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 3ae430e..b2347f9 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 _0xca5d=['tracked','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','openchannel','openchannelinteraction:addtags','addTags','put'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xca5d,0x88));var _0xdca5=function(_0x29965b,_0x4bebd3){_0x29965b=_0x29965b-0x0;var _0x189bdc=_0xca5d[_0x29965b];return _0x189bdc;};'use strict';var multer=require(_0xdca5('0x0'));var util=require('util');var path=require(_0xdca5('0x1'));var timeout=require(_0xdca5('0x2'));var express=require('express');var router=express[_0xdca5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdca5('0x4'));var config=require('../../config/environment');var controller=require(_0xdca5('0x5'));router[_0xdca5('0x6')]('/',auth[_0xdca5('0x7')](),controller[_0xdca5('0x8')]);router[_0xdca5('0x6')](_0xdca5('0x9'),auth[_0xdca5('0x7')](),controller[_0xdca5('0xa')]);router[_0xdca5('0x6')](_0xdca5('0xb'),auth['isAuthenticated'](),controller[_0xdca5('0xc')]);router['get'](_0xdca5('0xd'),auth[_0xdca5('0x7')](),controller[_0xdca5('0xe')]);router[_0xdca5('0x6')](_0xdca5('0xf'),auth[_0xdca5('0x7')](),controller[_0xdca5('0x10')]);router[_0xdca5('0x11')]('/',auth['isAuthenticated'](),controller[_0xdca5('0x12')]);router[_0xdca5('0x11')](_0xdca5('0xd'),auth[_0xdca5('0x7')](),controller[_0xdca5('0x13')]);router[_0xdca5('0x11')]('/:id/tags',auth[_0xdca5('0x7')](),interaction['tracked'](_0xdca5('0x14'),_0xdca5('0x15')),controller[_0xdca5('0x16')]);router[_0xdca5('0x17')](_0xdca5('0xb'),auth[_0xdca5('0x7')](),interaction[_0xdca5('0x18')]('openchannel',_0xdca5('0x19')),controller['update']);router[_0xdca5('0x1a')](_0xdca5('0xb'),auth['isAuthenticated'](),interaction[_0xdca5('0x18')](_0xdca5('0x14'),_0xdca5('0x1b')),controller[_0xdca5('0x1c')]);router[_0xdca5('0x1a')](_0xdca5('0x1d'),auth[_0xdca5('0x7')](),controller[_0xdca5('0x1e')]);module[_0xdca5('0x1f')]=router; \ No newline at end of file +var _0x566e=['/:id/download','post','create','openchannel','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','/:id/tags','removeTags','exports','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','/:id','/:id/messages','getMessages'];(function(_0xc0d832,_0x5165ae){var _0x443c53=function(_0x2bd0c9){while(--_0x2bd0c9){_0xc0d832['push'](_0xc0d832['shift']());}};_0x443c53(++_0x5165ae);}(_0x566e,0x1bf));var _0xe566=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x566e[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe566('0x0'));var express=require(_0xe566('0x1'));var router=express['Router']();var fs_extra=require(_0xe566('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xe566('0x3'));var config=require(_0xe566('0x4'));var controller=require(_0xe566('0x5'));router[_0xe566('0x6')]('/',auth[_0xe566('0x7')](),controller['index']);router['get'](_0xe566('0x8'),auth[_0xe566('0x7')](),controller['describe']);router[_0xe566('0x6')](_0xe566('0x9'),auth[_0xe566('0x7')](),controller['show']);router[_0xe566('0x6')](_0xe566('0xa'),auth[_0xe566('0x7')](),controller[_0xe566('0xb')]);router[_0xe566('0x6')](_0xe566('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xe566('0xd')]('/',auth['isAuthenticated'](),controller[_0xe566('0xe')]);router[_0xe566('0xd')](_0xe566('0xa'),auth[_0xe566('0x7')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xe566('0xf'),_0xe566('0x10')),controller[_0xe566('0x11')]);router[_0xe566('0x12')](_0xe566('0x9'),auth[_0xe566('0x7')](),interaction[_0xe566('0x13')](_0xe566('0xf'),_0xe566('0x14')),controller[_0xe566('0x15')]);router[_0xe566('0x16')](_0xe566('0x9'),auth['isAuthenticated'](),interaction[_0xe566('0x13')](_0xe566('0xf'),_0xe566('0x17')),controller['destroy']);router[_0xe566('0x16')](_0xe566('0x18'),auth[_0xe566('0x7')](),controller[_0xe566('0x19')]);module[_0xe566('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 507c982..1f036ea 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 _0xb205=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x19718d,_0x37281c){var _0x126b33=function(_0x4eafab){while(--_0x4eafab){_0x19718d['push'](_0x19718d['shift']());}};_0x126b33(++_0x37281c);}(_0xb205,0xf0));var _0x5b20=function(_0x1fd6b0,_0x43c536){_0x1fd6b0=_0x1fd6b0-0x0;var _0x3a2ee8=_0xb205[_0x1fd6b0];return _0x3a2ee8;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'closed':{'type':Sequelize[_0x5b20('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5b20('0x3')]},'disposition':{'type':Sequelize[_0x5b20('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5b20('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x5b20('0x4')]},'externalUrl':{'type':Sequelize[_0x5b20('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x5b20('0x5')]('in',_0x5b20('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x5b20('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5b20('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x5b20('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xaa88=['exports','BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x5deaee,_0x201d30){var _0x2891f5=function(_0x2aade2){while(--_0x2aade2){_0x5deaee['push'](_0x5deaee['shift']());}};_0x2891f5(++_0x201d30);}(_0xaa88,0x137));var _0x8aa8=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0xaa88[_0x349a9e];return _0x24c207;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'closed':{'type':Sequelize[_0x8aa8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8aa8('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8aa8('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8aa8('0x4')]},'note':{'type':Sequelize[_0x8aa8('0x4')]},'read1stAt':{'type':Sequelize[_0x8aa8('0x3')]},'threadId':{'type':Sequelize[_0x8aa8('0x4')]},'externalUrl':{'type':Sequelize[_0x8aa8('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8aa8('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8aa8('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8aa8('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x8aa8('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 66d0715..db97fd3 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 _0x6e31=['query','user','catch','show','from','params','model','keys','OpenchannelInteraction','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','limit','order','where','pick','OpenchannelInteractionId','map','$gte','format','rows','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','server','files','root','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','secret','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','Private','filter','existsSync','createReadStream','pipe','createWriteStream','basename','out','firstName','direction','read','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','json','offset','undefined','count','set','update','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel'];(function(_0x4d0e8b,_0x25837e){var _0x1163d3=function(_0x417a53){while(--_0x417a53){_0x4d0e8b['push'](_0x4d0e8b['shift']());}};_0x1163d3(++_0x25837e);}(_0x6e31,0xe8));var _0x16e3=function(_0x6bdb38,_0x19ea23){_0x6bdb38=_0x6bdb38-0x0;var _0xa38184=_0x6e31[_0x6bdb38];return _0xa38184;};'use strict';var rimraf=require(_0x16e3('0x0'));var zipdir=require(_0x16e3('0x1'));var moment=require(_0x16e3('0x2'));var util=require(_0x16e3('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x16e3('0x4'));var Redis=require(_0x16e3('0x5'));var interaction=require(_0x16e3('0x6'));var qs=require(_0x16e3('0x7'));var pdf=require(_0x16e3('0x8'));var logger=require(_0x16e3('0x9'))(_0x16e3('0xa'));var config=require(_0x16e3('0xb'));var db=require(_0x16e3('0xc'))['db'];config[_0x16e3('0xd')]=_[_0x16e3('0xe')](config[_0x16e3('0xd')],{'host':_0x16e3('0xf'),'port':0x18eb});var socket=require(_0x16e3('0x10'))(new Redis(config['redis']));require(_0x16e3('0x11'))['register'](socket);function respondWithStatusCode(_0x1cb31f,_0x3af48a){_0x3af48a=_0x3af48a||0xcc;return function(_0x3bb95a){if(_0x3bb95a){return _0x1cb31f[_0x16e3('0x12')](_0x3af48a);}return _0x1cb31f[_0x16e3('0x13')](_0x3af48a)['end']();};}function respondWithResult(_0x5c9d6b,_0x4f7c68){_0x4f7c68=_0x4f7c68||0xc8;return function(_0x53c364){if(_0x53c364){return _0x5c9d6b['status'](_0x4f7c68)[_0x16e3('0x14')](_0x53c364);}};}function respondWithFilteredResult(_0x547598,_0x230888){return function(_0x5eb614){if(_0x5eb614){var _0x387ca1=typeof _0x230888[_0x16e3('0x15')]===_0x16e3('0x16')&&typeof _0x230888['limit']===_0x16e3('0x16');var _0x422601=_0x5eb614[_0x16e3('0x17')];var _0x5edd9e=_0x387ca1?0x0:_0x230888[_0x16e3('0x15')];var _0x51020a=_0x387ca1?_0x5eb614['count']:_0x230888[_0x16e3('0x15')]+_0x230888['limit'];var _0x455b6a;if(_0x51020a>=_0x422601){_0x51020a=_0x422601;_0x455b6a=0xc8;}else{_0x455b6a=0xce;}_0x547598[_0x16e3('0x13')](_0x455b6a);return _0x547598[_0x16e3('0x18')]('Content-Range',_0x5edd9e+'-'+_0x51020a+'/'+_0x422601)[_0x16e3('0x14')](_0x5eb614);}return null;};}function saveUpdates(_0x1e1825){return function(_0x231502){if(_0x231502){return _0x231502[_0x16e3('0x19')](_0x1e1825)[_0x16e3('0x1a')](function(_0x3ba9f4){return _0x3ba9f4;});}return null;};}function removeEntity(_0x5edbdc){return function(_0x24936f){if(_0x24936f){return _0x24936f['destroy']()[_0x16e3('0x1a')](function(){_0x5edbdc[_0x16e3('0x13')](0xcc)[_0x16e3('0x1b')]();});}};}function handleEntityNotFound(_0x5db1b1){return function(_0x3fd86f){if(!_0x3fd86f){_0x5db1b1['sendStatus'](0x194);}return _0x3fd86f;};}function handleError(_0x175db9,_0x5da767){_0x5da767=_0x5da767||0x1f4;return function(_0x5e8016){logger[_0x16e3('0x1c')](_0x5e8016[_0x16e3('0x1d')]);if(_0x5e8016[_0x16e3('0x1e')]){delete _0x5e8016['name'];}_0x175db9[_0x16e3('0x13')](_0x5da767)[_0x16e3('0x1f')](_0x5e8016);};}exports[_0x16e3('0x20')]=function(_0x1f33f9,_0x251a2f){var _0x1b6ecf={};var _0x358e7b=_['map'](db['OpenchannelInteraction'][_0x16e3('0x21')],function(_0x4b174d){return{'name':_0x4b174d[_0x16e3('0x22')],'type':_0x4b174d[_0x16e3('0x23')][_0x16e3('0x24')]};});_0x1b6ecf=qs[_0x16e3('0x25')](_0x358e7b,_0x1f33f9);return interaction[_0x16e3('0x26')](_0x16e3('0x27'),_0x1f33f9[_0x16e3('0x28')],_0x1f33f9[_0x16e3('0x29')],_0x1b6ecf,_0x358e7b)[_0x16e3('0x1a')](respondWithFilteredResult(_0x251a2f,_0x1b6ecf))[_0x16e3('0x2a')](handleError(_0x251a2f,null));};exports[_0x16e3('0x2b')]=function(_0x59a8e7,_0x570c44){var _0x9483e={};if(_0x59a8e7['query']['type']&&_0x59a8e7[_0x16e3('0x28')][_0x16e3('0x23')]===_0x16e3('0x2c')){_0x9483e[_0x16e3('0x2c')]=_0x59a8e7[_0x16e3('0x2d')]['id'];}else{_0x9483e['id']=_0x59a8e7[_0x16e3('0x2d')]['id'];}var _0x3374f2={'raw':![],'where':_0x9483e},_0x5b4085={};_0x5b4085[_0x16e3('0x2e')]=_[_0x16e3('0x2f')](db[_0x16e3('0x30')]['rawAttributes']);_0x5b4085[_0x16e3('0x28')]=_[_0x16e3('0x2f')](_0x59a8e7[_0x16e3('0x28')]);_0x5b4085[_0x16e3('0x31')]=_[_0x16e3('0x32')](_0x5b4085[_0x16e3('0x2e')],_0x5b4085[_0x16e3('0x28')]);_0x3374f2[_0x16e3('0x33')]=_['intersection'](_0x5b4085['model'],qs[_0x16e3('0x34')](_0x59a8e7[_0x16e3('0x28')][_0x16e3('0x34')]));_0x3374f2[_0x16e3('0x33')]=_0x3374f2['attributes'][_0x16e3('0x35')]?_0x3374f2[_0x16e3('0x33')]:_0x5b4085[_0x16e3('0x2e')];if(_0x59a8e7['query'][_0x16e3('0x36')]){_0x3374f2[_0x16e3('0x37')]=[{'all':!![]}];}_0x3374f2=_[_0x16e3('0x38')]({},_0x3374f2,_0x59a8e7[_0x16e3('0x39')]);return db[_0x16e3('0x30')][_0x16e3('0x3a')](_0x3374f2)[_0x16e3('0x1a')](handleEntityNotFound(_0x570c44,null))[_0x16e3('0x1a')](respondWithResult(_0x570c44,null))[_0x16e3('0x2a')](handleError(_0x570c44,null));};exports['create']=function(_0x389d55,_0x4678b5){return db[_0x16e3('0x30')][_0x16e3('0x3b')](_0x389d55['body'],{})[_0x16e3('0x1a')](respondWithResult(_0x4678b5,0xc9))[_0x16e3('0x2a')](handleError(_0x4678b5,null));};exports[_0x16e3('0x19')]=function(_0x4acd05,_0x425cce){if(_0x4acd05[_0x16e3('0x3c')]['id']){delete _0x4acd05['body']['id'];}return db[_0x16e3('0x30')][_0x16e3('0x3a')]({'where':{'id':_0x4acd05['params']['id']}})[_0x16e3('0x1a')](handleEntityNotFound(_0x425cce,null))['then'](saveUpdates(_0x4acd05[_0x16e3('0x3c')],null))[_0x16e3('0x1a')](respondWithResult(_0x425cce,null))[_0x16e3('0x2a')](handleError(_0x425cce,null));};exports[_0x16e3('0x3d')]=function(_0x441b7a,_0x4c0634){return db[_0x16e3('0x30')][_0x16e3('0x3a')]({'where':{'id':_0x441b7a['params']['id']}})[_0x16e3('0x1a')](handleEntityNotFound(_0x4c0634,null))[_0x16e3('0x1a')](removeEntity(_0x4c0634,null))[_0x16e3('0x2a')](handleError(_0x4c0634,null));};exports[_0x16e3('0x3e')]=function(_0x9d8539,_0x418761){return db[_0x16e3('0x30')][_0x16e3('0x3e')]()[_0x16e3('0x1a')](respondWithResult(_0x418761,null))[_0x16e3('0x2a')](handleError(_0x418761,null));};exports['addMessage']=function(_0x54d349,_0x26d644){return db['OpenchannelMessage'][_0x16e3('0x3a')]({'where':{'id':_0x54d349[_0x16e3('0x2d')]['id']}})[_0x16e3('0x1a')](handleEntityNotFound(_0x26d644,null))[_0x16e3('0x1a')](function(_0x4a2b5a){if(_0x4a2b5a){return _0x4a2b5a[_0x16e3('0x3f')](_0x54d349[_0x16e3('0x3c')][_0x16e3('0x40')],_[_0x16e3('0x41')](_0x54d349[_0x16e3('0x3c')],[_0x16e3('0x40'),'id'])||{});}})[_0x16e3('0x1a')](respondWithResult(_0x26d644,null))[_0x16e3('0x2a')](handleError(_0x26d644,null));};exports[_0x16e3('0x42')]=function(_0x15b1ed,_0x59aab6){var _0x49fa75={'raw':![],'where':{}};var _0x128bae={};var _0x230744={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x16e3('0x43')]({'where':{'id':_0x15b1ed['params']['id']}})[_0x16e3('0x1a')](handleEntityNotFound(_0x59aab6,null))[_0x16e3('0x1a')](function(_0x8b16ba){if(_0x8b16ba){_0x128bae[_0x16e3('0x2e')]=_[_0x16e3('0x2f')](db[_0x16e3('0x44')]['rawAttributes']);_0x128bae[_0x16e3('0x28')]=_[_0x16e3('0x2f')](_0x15b1ed[_0x16e3('0x28')]);_0x128bae[_0x16e3('0x31')]=_[_0x16e3('0x32')](_0x128bae[_0x16e3('0x2e')],_0x128bae[_0x16e3('0x28')]);_0x49fa75[_0x16e3('0x33')]=_['intersection'](_0x128bae['model'],qs['fields'](_0x15b1ed[_0x16e3('0x28')][_0x16e3('0x34')]));_0x49fa75[_0x16e3('0x33')]=_0x49fa75['attributes'][_0x16e3('0x35')]?_0x49fa75[_0x16e3('0x33')]:_0x128bae[_0x16e3('0x2e')];if(!_0x15b1ed['query'][_0x16e3('0x45')](_0x16e3('0x46'))){_0x49fa75['limit']=qs[_0x16e3('0x47')](_0x15b1ed['query']['limit']);_0x49fa75[_0x16e3('0x15')]=qs['offset'](_0x15b1ed[_0x16e3('0x28')][_0x16e3('0x15')]);}_0x49fa75[_0x16e3('0x48')]=qs['sort'](_0x15b1ed[_0x16e3('0x28')]['sort']);_0x49fa75[_0x16e3('0x49')]=qs[_0x16e3('0x31')](_[_0x16e3('0x4a')](_0x15b1ed[_0x16e3('0x28')],_0x128bae['filters']));_0x49fa75[_0x16e3('0x49')][_0x16e3('0x4b')]=_0x8b16ba['id'];if(_0x15b1ed[_0x16e3('0x28')]['filter']){_0x49fa75[_0x16e3('0x49')]=_[_0x16e3('0x38')](_0x49fa75['where'],{'$or':_[_0x16e3('0x4c')](_0x49fa75[_0x16e3('0x33')],function(_0x380fd6){var _0x67c832={};_0x67c832[_0x380fd6]={'$like':'%'+_0x15b1ed['query']['filter']+'%'};return _0x67c832;})});}if(_0x15b1ed[_0x16e3('0x28')]['$gte']){var _0x40461b=_0x15b1ed['query'][_0x16e3('0x4d')]['split'](',');var _0x2723ea={};_0x2723ea[_0x40461b[0x0]]={'$gte':moment(_0x40461b[0x1])[_0x16e3('0x4e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x49fa75[_0x16e3('0x49')]=_[_0x16e3('0x38')](_0x49fa75[_0x16e3('0x49')],_0x2723ea);}_0x49fa75=_[_0x16e3('0x38')]({},_0x49fa75,_0x15b1ed[_0x16e3('0x39')]);return db[_0x16e3('0x44')][_0x16e3('0x17')]({'where':_0x49fa75[_0x16e3('0x49')]})['then'](function(_0x34801b){_0x230744['count']=_0x34801b;if(_0x15b1ed['query']['includeAll']){_0x49fa75['include']=[{'all':!![]}];}return db[_0x16e3('0x44')][_0x16e3('0x26')](_0x49fa75);})[_0x16e3('0x1a')](function(_0x2db577){_0x230744[_0x16e3('0x4f')]=_0x2db577;return _0x230744;});}})[_0x16e3('0x1a')](respondWithFilteredResult(_0x59aab6,_0x49fa75))[_0x16e3('0x2a')](handleError(_0x59aab6,null));};exports[_0x16e3('0x50')]=function(_0x40676e,_0x495cb3){return db['OpenchannelInteraction'][_0x16e3('0x3a')]({'where':{'id':_0x40676e[_0x16e3('0x2d')]['id']}})[_0x16e3('0x1a')](handleEntityNotFound(_0x495cb3,null))[_0x16e3('0x1a')](function(_0x51fb9d){if(_0x51fb9d){return _0x51fb9d[_0x16e3('0x51')](_0x40676e['body'][_0x16e3('0x40')],_[_0x16e3('0x41')](_0x40676e[_0x16e3('0x3c')],['ids','id'])||{})[_0x16e3('0x52')](function(){return db['Tag'][_0x16e3('0x26')]({'attributes':['id',_0x16e3('0x1e'),_0x16e3('0x53')],'where':{'id':_0x40676e[_0x16e3('0x3c')]['ids']}});})['then'](function(_0x159e31){socket[_0x16e3('0x54')](_0x16e3('0x55'),{'id':Number(_0x40676e['params']['id']),'tags':_0x159e31||[]});return{'id':Number(_0x40676e['params']['id']),'tags':_0x159e31||[]};});}})[_0x16e3('0x1a')](respondWithResult(_0x495cb3,null))[_0x16e3('0x2a')](handleError(_0x495cb3,null));};exports[_0x16e3('0x56')]=function(_0x49cf4c,_0x113914){return db['OpenchannelInteraction'][_0x16e3('0x3a')]({'where':{'id':_0x49cf4c[_0x16e3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x113914,null))[_0x16e3('0x1a')](function(_0x2ab63d){if(_0x2ab63d){return _0x2ab63d['removeTags'](_0x49cf4c[_0x16e3('0x28')][_0x16e3('0x40')]);}})[_0x16e3('0x1a')](respondWithStatusCode(_0x113914,null))[_0x16e3('0x2a')](handleError(_0x113914,null));};exports[_0x16e3('0x57')]=function(_0x141854,_0xe11850){var _0x205c09=moment()[_0x16e3('0x58')]()[_0x16e3('0x59')]();var _0x115524=path[_0x16e3('0x5a')](config['root'],_0x16e3('0x5b'),_0x16e3('0x5c'),'tmp');var _0x524b90=path[_0x16e3('0x5a')](config[_0x16e3('0x5d')],_0x16e3('0x5b'),_0x16e3('0x5c'),_0x16e3('0x5e'));var _0x9c2e10=path[_0x16e3('0x5a')](_0x115524,_0x205c09);var _0x219d85=util[_0x16e3('0x4e')](_0x16e3('0x5f'),_0x141854[_0x16e3('0x2d')]['id'],_0x205c09);var _0x55f497=path[_0x16e3('0x5a')](_0x115524,_0x219d85);var _0x15ddd0=[];_0x15ddd0[_0x16e3('0x60')]({'model':db[_0x16e3('0x61')],'as':'User','attributes':['id',_0x16e3('0x62')],'raw':!![]});_0x15ddd0[_0x16e3('0x60')]({'model':db[_0x16e3('0x63')],'as':_0x16e3('0x64'),'attributes':['id','firstName',_0x16e3('0x65')],'raw':!![]});if(_0x141854[_0x16e3('0x28')][_0x16e3('0x5e')]){_0x15ddd0[_0x16e3('0x60')]({'model':db[_0x16e3('0x66')],'as':_0x16e3('0x66'),'raw':!![]});}var _0x4b7852=[{'model':db[_0x16e3('0x44')],'as':_0x16e3('0x67'),'attributes':['id','body',_0x16e3('0x68'),'direction',_0x16e3('0x69'),'read'],'include':_0x15ddd0}];_0x4b7852[_0x16e3('0x60')]({'model':db[_0x16e3('0x6a')],'as':'Account','attributes':['id',_0x16e3('0x1e')]});_0x4b7852[_0x16e3('0x60')]({'model':db[_0x16e3('0x61')],'as':_0x16e3('0x6b'),'attributes':['id',_0x16e3('0x62')]});return db[_0x16e3('0x30')][_0x16e3('0x3a')]({'where':{'id':_0x141854[_0x16e3('0x2d')]['id']},'include':_0x4b7852})[_0x16e3('0x1a')](handleEntityNotFound(_0xe11850,null))[_0x16e3('0x1a')](function(_0x22f4fe){if(_0x22f4fe){var _0x45ea9d=_0x22f4fe[_0x16e3('0x6c')]({'plain':!![]});fs[_0x16e3('0x6d')](_0x9c2e10);var _0x2ac5c6={'channel':_0x16e3('0x6e'),'account':_0x45ea9d[_0x16e3('0x6f')]['name'],'agent':_0x45ea9d[_0x16e3('0x6b')]?_0x45ea9d[_0x16e3('0x6b')][_0x16e3('0x62')]:_0x16e3('0x70'),'createdAt':moment(_0x45ea9d['createdAt'])[_0x16e3('0x4e')](_0x16e3('0x71'))['toString'](),'closedAt':_0x45ea9d['closed']?moment(_0x45ea9d['closedAt'])[_0x16e3('0x4e')]('YYYY-MM-DD\x20HH:mm:ss')[_0x16e3('0x59')]():'','disposition':_0x45ea9d[_0x16e3('0x72')],'visibility':_0x45ea9d[_0x16e3('0x73')]?_0x16e3('0x74'):_0x16e3('0x75'),'messages':_(_0x45ea9d[_0x16e3('0x67')])[_0x16e3('0x76')]({'secret':![]})[_0x16e3('0x4c')](function(_0x153d1e){if(_0x153d1e['Attachment']){var _0x1a2b37=path[_0x16e3('0x5a')](_0x524b90,_0x153d1e[_0x16e3('0x66')]['basename']);if(fs[_0x16e3('0x77')](_0x1a2b37)){fs[_0x16e3('0x78')](_0x1a2b37)[_0x16e3('0x79')](fs[_0x16e3('0x7a')](path[_0x16e3('0x5a')](_0x9c2e10,_0x153d1e[_0x16e3('0x66')][_0x16e3('0x7b')])));}}return{'date':moment(_0x153d1e[_0x16e3('0x68')])['format'](_0x16e3('0x71'))['toString'](),'sender':_0x153d1e['direction']===_0x16e3('0x7c')?_0x153d1e[_0x16e3('0x61')]?_0x153d1e[_0x16e3('0x61')][_0x16e3('0x62')]:'System':_0x153d1e['Contact'][_0x16e3('0x7d')]+(_0x153d1e[_0x16e3('0x64')][_0x16e3('0x65')]?'\x20'+_0x153d1e[_0x16e3('0x64')][_0x16e3('0x65')]:''),'body':_0x153d1e['Attachment']?_0x153d1e[_0x16e3('0x66')][_0x16e3('0x7b')]:_0x153d1e[_0x16e3('0x3c')],'direction':_0x153d1e[_0x16e3('0x7e')]===_0x16e3('0x7c')?'A':'C','secret':_0x153d1e[_0x16e3('0x69')],'read':_0x153d1e[_0x16e3('0x7f')],'attachment':_0x153d1e['Attachment']};})[_0x16e3('0x80')]()};return ejs[_0x16e3('0x81')](path[_0x16e3('0x5a')](config['root'],_0x16e3('0x5b'),_0x16e3('0x82'),_0x16e3('0x83')),{'interaction':_0x2ac5c6})[_0x16e3('0x1a')](function(_0x20b79e){var _0x133fa9=path[_0x16e3('0x5a')](_0x9c2e10,'transcript-'+_0x45ea9d['id']+'-'+_0x205c09+_0x16e3('0x84'));var _0x38944d={'path':_0x133fa9,'channel':_0x16e3('0x6e'),'interactionId':_0x45ea9d['id']};return pdf[_0x16e3('0x85')](_0x20b79e,_0x38944d);})['then'](function(){return new Promise(function(_0x534be2,_0x59870f){zipdir(_0x9c2e10,{'saveTo':_0x55f497},function(_0x184539,_0x26b608){if(_0x184539)return _0x59870f(_0x184539);return _0x534be2(_0x26b608);});})['then'](function(){return new Promise(function(_0x1f592a,_0x5356fb){rimraf(_0x9c2e10,function(_0x4ac2fe){if(_0x4ac2fe)_0x5356fb(_0x4ac2fe);return _0x1f592a();});});})[_0x16e3('0x1a')](function(){return _0xe11850['download'](_0x55f497,_0x219d85,function(_0x34e367){if(_0x34e367){logger[_0x16e3('0x1c')](_0x16e3('0x86'),_0x34e367);}else{fs[_0x16e3('0x87')](_0x55f497);}});});});}else{return _0xe11850[_0x16e3('0x12')](0xc8);}})['catch'](handleError(_0xe11850,null));}; \ No newline at end of file +var _0xca12=['toString','join','root','server','tmp','files','attachments','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','Account','Owner','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','out','System','Contact','read','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','map','rawAttributes','type','getOptions','openchannel','query','user','show','from','params','keys','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','OpenchannelInteraction','catch','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','filter','where','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','Tag','findAll','color','emit','openchannelInteractionTags:save','removeTags','unix'];(function(_0x42c0f7,_0x13ca46){var _0x88e12c=function(_0x45af69){while(--_0x45af69){_0x42c0f7['push'](_0x42c0f7['shift']());}};_0x88e12c(++_0x13ca46);}(_0xca12,0x12f));var _0x2ca1=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xca12[_0x413feb];return _0x40ee88;};'use strict';var rimraf=require(_0x2ca1('0x0'));var zipdir=require(_0x2ca1('0x1'));var moment=require(_0x2ca1('0x2'));var util=require(_0x2ca1('0x3'));var path=require(_0x2ca1('0x4'));var ejs=require(_0x2ca1('0x5'));var fs=require('fs');var _=require(_0x2ca1('0x6'));var Redis=require(_0x2ca1('0x7'));var interaction=require(_0x2ca1('0x8'));var qs=require(_0x2ca1('0x9'));var pdf=require(_0x2ca1('0xa'));var logger=require(_0x2ca1('0xb'))(_0x2ca1('0xc'));var config=require('../../config/environment');var db=require(_0x2ca1('0xd'))['db'];config[_0x2ca1('0xe')]=_[_0x2ca1('0xf')](config['redis'],{'host':_0x2ca1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ca1('0xe')]));require(_0x2ca1('0x11'))[_0x2ca1('0x12')](socket);function respondWithStatusCode(_0x1149f5,_0xbc4b5b){_0xbc4b5b=_0xbc4b5b||0xcc;return function(_0x2be0ef){if(_0x2be0ef){return _0x1149f5['sendStatus'](_0xbc4b5b);}return _0x1149f5[_0x2ca1('0x13')](_0xbc4b5b)[_0x2ca1('0x14')]();};}function respondWithResult(_0x7cda0c,_0xd77116){_0xd77116=_0xd77116||0xc8;return function(_0x1867df){if(_0x1867df){return _0x7cda0c['status'](_0xd77116)['json'](_0x1867df);}};}function respondWithFilteredResult(_0x3e2454,_0x40bd15){return function(_0x194814){if(_0x194814){var _0x5d921c=typeof _0x40bd15[_0x2ca1('0x15')]===_0x2ca1('0x16')&&typeof _0x40bd15[_0x2ca1('0x17')]==='undefined';var _0x3b76d5=_0x194814[_0x2ca1('0x18')];var _0x4df052=_0x5d921c?0x0:_0x40bd15[_0x2ca1('0x15')];var _0x5ef215=_0x5d921c?_0x194814[_0x2ca1('0x18')]:_0x40bd15[_0x2ca1('0x15')]+_0x40bd15[_0x2ca1('0x17')];var _0x17d116;if(_0x5ef215>=_0x3b76d5){_0x5ef215=_0x3b76d5;_0x17d116=0xc8;}else{_0x17d116=0xce;}_0x3e2454[_0x2ca1('0x13')](_0x17d116);return _0x3e2454[_0x2ca1('0x19')](_0x2ca1('0x1a'),_0x4df052+'-'+_0x5ef215+'/'+_0x3b76d5)[_0x2ca1('0x1b')](_0x194814);}return null;};}function saveUpdates(_0x3b13a6){return function(_0x150f7b){if(_0x150f7b){return _0x150f7b[_0x2ca1('0x1c')](_0x3b13a6)[_0x2ca1('0x1d')](function(_0x561a8d){return _0x561a8d;});}return null;};}function removeEntity(_0x4b9d56){return function(_0x9d4288){if(_0x9d4288){return _0x9d4288[_0x2ca1('0x1e')]()[_0x2ca1('0x1d')](function(){_0x4b9d56[_0x2ca1('0x13')](0xcc)[_0x2ca1('0x14')]();});}};}function handleEntityNotFound(_0x29f7ed){return function(_0x40a585){if(!_0x40a585){_0x29f7ed[_0x2ca1('0x1f')](0x194);}return _0x40a585;};}function handleError(_0x46cc68,_0x329beb){_0x329beb=_0x329beb||0x1f4;return function(_0x4833aa){logger[_0x2ca1('0x20')](_0x4833aa[_0x2ca1('0x21')]);if(_0x4833aa[_0x2ca1('0x22')]){delete _0x4833aa[_0x2ca1('0x22')];}_0x46cc68[_0x2ca1('0x13')](_0x329beb)['send'](_0x4833aa);};}exports['index']=function(_0x326ad5,_0x546c96){var _0x4df3a9={};var _0x5e52bc=_[_0x2ca1('0x23')](db['OpenchannelInteraction'][_0x2ca1('0x24')],function(_0x441d65){return{'name':_0x441d65['fieldName'],'type':_0x441d65[_0x2ca1('0x25')]['key']};});_0x4df3a9=qs[_0x2ca1('0x26')](_0x5e52bc,_0x326ad5);return interaction['findAll'](_0x2ca1('0x27'),_0x326ad5[_0x2ca1('0x28')],_0x326ad5[_0x2ca1('0x29')],_0x4df3a9,_0x5e52bc)[_0x2ca1('0x1d')](respondWithFilteredResult(_0x546c96,_0x4df3a9))['catch'](handleError(_0x546c96,null));};exports[_0x2ca1('0x2a')]=function(_0x2780f6,_0x4e9664){var _0x29e088={};if(_0x2780f6[_0x2ca1('0x28')][_0x2ca1('0x25')]&&_0x2780f6[_0x2ca1('0x28')][_0x2ca1('0x25')]===_0x2ca1('0x2b')){_0x29e088[_0x2ca1('0x2b')]=_0x2780f6[_0x2ca1('0x2c')]['id'];}else{_0x29e088['id']=_0x2780f6[_0x2ca1('0x2c')]['id'];}var _0xbc3455={'raw':![],'where':_0x29e088},_0x16b13e={};_0x16b13e['model']=_[_0x2ca1('0x2d')](db['OpenchannelInteraction'][_0x2ca1('0x24')]);_0x16b13e[_0x2ca1('0x28')]=_['keys'](_0x2780f6['query']);_0x16b13e[_0x2ca1('0x2e')]=_['intersection'](_0x16b13e[_0x2ca1('0x2f')],_0x16b13e[_0x2ca1('0x28')]);_0xbc3455[_0x2ca1('0x30')]=_[_0x2ca1('0x31')](_0x16b13e[_0x2ca1('0x2f')],qs[_0x2ca1('0x32')](_0x2780f6[_0x2ca1('0x28')][_0x2ca1('0x32')]));_0xbc3455[_0x2ca1('0x30')]=_0xbc3455['attributes'][_0x2ca1('0x33')]?_0xbc3455[_0x2ca1('0x30')]:_0x16b13e['model'];if(_0x2780f6[_0x2ca1('0x28')][_0x2ca1('0x34')]){_0xbc3455[_0x2ca1('0x35')]=[{'all':!![]}];}_0xbc3455=_[_0x2ca1('0x36')]({},_0xbc3455,_0x2780f6[_0x2ca1('0x37')]);return db['OpenchannelInteraction'][_0x2ca1('0x38')](_0xbc3455)['then'](handleEntityNotFound(_0x4e9664,null))[_0x2ca1('0x1d')](respondWithResult(_0x4e9664,null))['catch'](handleError(_0x4e9664,null));};exports[_0x2ca1('0x39')]=function(_0x448291,_0x34673e){return db['OpenchannelInteraction'][_0x2ca1('0x39')](_0x448291[_0x2ca1('0x3a')],{})[_0x2ca1('0x1d')](respondWithResult(_0x34673e,0xc9))['catch'](handleError(_0x34673e,null));};exports['update']=function(_0xe801a4,_0x2c57e4){if(_0xe801a4[_0x2ca1('0x3a')]['id']){delete _0xe801a4['body']['id'];}return db[_0x2ca1('0x3b')][_0x2ca1('0x38')]({'where':{'id':_0xe801a4[_0x2ca1('0x2c')]['id']}})[_0x2ca1('0x1d')](handleEntityNotFound(_0x2c57e4,null))[_0x2ca1('0x1d')](saveUpdates(_0xe801a4[_0x2ca1('0x3a')],null))[_0x2ca1('0x1d')](respondWithResult(_0x2c57e4,null))[_0x2ca1('0x3c')](handleError(_0x2c57e4,null));};exports[_0x2ca1('0x1e')]=function(_0x349e02,_0x149f75){return db['OpenchannelInteraction'][_0x2ca1('0x38')]({'where':{'id':_0x349e02[_0x2ca1('0x2c')]['id']}})[_0x2ca1('0x1d')](handleEntityNotFound(_0x149f75,null))[_0x2ca1('0x1d')](removeEntity(_0x149f75,null))[_0x2ca1('0x3c')](handleError(_0x149f75,null));};exports[_0x2ca1('0x3d')]=function(_0x84bca4,_0x1f0aef){return db[_0x2ca1('0x3b')][_0x2ca1('0x3d')]()[_0x2ca1('0x1d')](respondWithResult(_0x1f0aef,null))['catch'](handleError(_0x1f0aef,null));};exports[_0x2ca1('0x3e')]=function(_0xa89126,_0xe3a43c){return db[_0x2ca1('0x3f')][_0x2ca1('0x38')]({'where':{'id':_0xa89126[_0x2ca1('0x2c')]['id']}})[_0x2ca1('0x1d')](handleEntityNotFound(_0xe3a43c,null))[_0x2ca1('0x1d')](function(_0x4f54a3){if(_0x4f54a3){return _0x4f54a3['addMessage'](_0xa89126['body'][_0x2ca1('0x40')],_[_0x2ca1('0x41')](_0xa89126[_0x2ca1('0x3a')],['ids','id'])||{});}})[_0x2ca1('0x1d')](respondWithResult(_0xe3a43c,null))['catch'](handleError(_0xe3a43c,null));};exports[_0x2ca1('0x42')]=function(_0x2666f1,_0x2cca32){var _0x18f330={'raw':![],'where':{}};var _0xec2a5a={};var _0x4bbb55={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x2ca1('0x43')]({'where':{'id':_0x2666f1[_0x2ca1('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2cca32,null))[_0x2ca1('0x1d')](function(_0x470907){if(_0x470907){_0xec2a5a['model']=_[_0x2ca1('0x2d')](db[_0x2ca1('0x3f')][_0x2ca1('0x24')]);_0xec2a5a[_0x2ca1('0x28')]=_[_0x2ca1('0x2d')](_0x2666f1[_0x2ca1('0x28')]);_0xec2a5a[_0x2ca1('0x2e')]=_['intersection'](_0xec2a5a['model'],_0xec2a5a[_0x2ca1('0x28')]);_0x18f330['attributes']=_[_0x2ca1('0x31')](_0xec2a5a[_0x2ca1('0x2f')],qs[_0x2ca1('0x32')](_0x2666f1[_0x2ca1('0x28')][_0x2ca1('0x32')]));_0x18f330['attributes']=_0x18f330['attributes'][_0x2ca1('0x33')]?_0x18f330[_0x2ca1('0x30')]:_0xec2a5a[_0x2ca1('0x2f')];if(!_0x2666f1[_0x2ca1('0x28')][_0x2ca1('0x44')](_0x2ca1('0x45'))){_0x18f330[_0x2ca1('0x17')]=qs[_0x2ca1('0x17')](_0x2666f1[_0x2ca1('0x28')][_0x2ca1('0x17')]);_0x18f330[_0x2ca1('0x15')]=qs[_0x2ca1('0x15')](_0x2666f1[_0x2ca1('0x28')][_0x2ca1('0x15')]);}_0x18f330[_0x2ca1('0x46')]=qs[_0x2ca1('0x47')](_0x2666f1[_0x2ca1('0x28')][_0x2ca1('0x47')]);_0x18f330['where']=qs['filters'](_[_0x2ca1('0x48')](_0x2666f1[_0x2ca1('0x28')],_0xec2a5a[_0x2ca1('0x2e')]));_0x18f330['where']['OpenchannelInteractionId']=_0x470907['id'];if(_0x2666f1['query'][_0x2ca1('0x49')]){_0x18f330[_0x2ca1('0x4a')]=_[_0x2ca1('0x36')](_0x18f330[_0x2ca1('0x4a')],{'$or':_[_0x2ca1('0x23')](_0x18f330[_0x2ca1('0x30')],function(_0x386cd3){var _0x3fe3fd={};_0x3fe3fd[_0x386cd3]={'$like':'%'+_0x2666f1[_0x2ca1('0x28')][_0x2ca1('0x49')]+'%'};return _0x3fe3fd;})});}if(_0x2666f1[_0x2ca1('0x28')]['$gte']){var _0x304557=_0x2666f1[_0x2ca1('0x28')]['$gte'][_0x2ca1('0x4b')](',');var _0x3d1db9={};_0x3d1db9[_0x304557[0x0]]={'$gte':moment(_0x304557[0x1])[_0x2ca1('0x4c')](_0x2ca1('0x4d'))};_0x18f330[_0x2ca1('0x4a')]=_[_0x2ca1('0x36')](_0x18f330[_0x2ca1('0x4a')],_0x3d1db9);}_0x18f330=_[_0x2ca1('0x36')]({},_0x18f330,_0x2666f1[_0x2ca1('0x37')]);return db[_0x2ca1('0x3f')][_0x2ca1('0x18')]({'where':_0x18f330[_0x2ca1('0x4a')]})[_0x2ca1('0x1d')](function(_0x476454){_0x4bbb55['count']=_0x476454;if(_0x2666f1['query'][_0x2ca1('0x34')]){_0x18f330[_0x2ca1('0x35')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x18f330);})[_0x2ca1('0x1d')](function(_0x43a75c){_0x4bbb55[_0x2ca1('0x4e')]=_0x43a75c;return _0x4bbb55;});}})['then'](respondWithFilteredResult(_0x2cca32,_0x18f330))[_0x2ca1('0x3c')](handleError(_0x2cca32,null));};exports[_0x2ca1('0x4f')]=function(_0x27c503,_0x16ece6){return db['OpenchannelInteraction'][_0x2ca1('0x38')]({'where':{'id':_0x27c503[_0x2ca1('0x2c')]['id']}})[_0x2ca1('0x1d')](handleEntityNotFound(_0x16ece6,null))['then'](function(_0x4281ce){if(_0x4281ce){return _0x4281ce['setTags'](_0x27c503[_0x2ca1('0x3a')][_0x2ca1('0x40')],_['omit'](_0x27c503[_0x2ca1('0x3a')],[_0x2ca1('0x40'),'id'])||{})['spread'](function(){return db[_0x2ca1('0x50')][_0x2ca1('0x51')]({'attributes':['id',_0x2ca1('0x22'),_0x2ca1('0x52')],'where':{'id':_0x27c503[_0x2ca1('0x3a')][_0x2ca1('0x40')]}});})[_0x2ca1('0x1d')](function(_0x4fa023){socket[_0x2ca1('0x53')](_0x2ca1('0x54'),{'id':Number(_0x27c503[_0x2ca1('0x2c')]['id']),'tags':_0x4fa023||[]});return{'id':Number(_0x27c503['params']['id']),'tags':_0x4fa023||[]};});}})[_0x2ca1('0x1d')](respondWithResult(_0x16ece6,null))['catch'](handleError(_0x16ece6,null));};exports[_0x2ca1('0x55')]=function(_0x12a4fa,_0x52a713){return db[_0x2ca1('0x3b')][_0x2ca1('0x38')]({'where':{'id':_0x12a4fa['params']['id']}})[_0x2ca1('0x1d')](handleEntityNotFound(_0x52a713,null))[_0x2ca1('0x1d')](function(_0x177368){if(_0x177368){return _0x177368['removeTags'](_0x12a4fa[_0x2ca1('0x28')][_0x2ca1('0x40')]);}})[_0x2ca1('0x1d')](respondWithStatusCode(_0x52a713,null))[_0x2ca1('0x3c')](handleError(_0x52a713,null));};exports['download']=function(_0x26a2ce,_0x26e361){var _0x30d825=moment()[_0x2ca1('0x56')]()[_0x2ca1('0x57')]();var _0x5238a9=path[_0x2ca1('0x58')](config[_0x2ca1('0x59')],_0x2ca1('0x5a'),'files',_0x2ca1('0x5b'));var _0x8ab7e3=path['join'](config['root'],_0x2ca1('0x5a'),_0x2ca1('0x5c'),_0x2ca1('0x5d'));var _0x1c13fb=path[_0x2ca1('0x58')](_0x5238a9,_0x30d825);var _0x194240=util[_0x2ca1('0x4c')]('transcript-%d-%s.zip',_0x26a2ce['params']['id'],_0x30d825);var _0x361bee=path['join'](_0x5238a9,_0x194240);var _0xf5be5a=[];_0xf5be5a[_0x2ca1('0x5e')]({'model':db[_0x2ca1('0x5f')],'as':_0x2ca1('0x5f'),'attributes':['id',_0x2ca1('0x60')],'raw':!![]});_0xf5be5a[_0x2ca1('0x5e')]({'model':db[_0x2ca1('0x61')],'as':'Contact','attributes':['id',_0x2ca1('0x62'),_0x2ca1('0x63')],'raw':!![]});if(_0x26a2ce[_0x2ca1('0x28')][_0x2ca1('0x5d')]){_0xf5be5a[_0x2ca1('0x5e')]({'model':db['Attachment'],'as':_0x2ca1('0x64'),'raw':!![]});}var _0x5c26ba=[{'model':db[_0x2ca1('0x3f')],'as':_0x2ca1('0x65'),'attributes':['id',_0x2ca1('0x3a'),_0x2ca1('0x66'),_0x2ca1('0x67'),_0x2ca1('0x68'),'read'],'include':_0xf5be5a}];_0x5c26ba[_0x2ca1('0x5e')]({'model':db['OpenchannelAccount'],'as':_0x2ca1('0x69'),'attributes':['id',_0x2ca1('0x22')]});_0x5c26ba[_0x2ca1('0x5e')]({'model':db['User'],'as':_0x2ca1('0x6a'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0x2ca1('0x38')]({'where':{'id':_0x26a2ce[_0x2ca1('0x2c')]['id']},'include':_0x5c26ba})[_0x2ca1('0x1d')](handleEntityNotFound(_0x26e361,null))[_0x2ca1('0x1d')](function(_0x5ec2e5){if(_0x5ec2e5){var _0xd8a86d=_0x5ec2e5['get']({'plain':!![]});fs[_0x2ca1('0x6b')](_0x1c13fb);var _0x10303e={'channel':_0x2ca1('0x6c'),'account':_0xd8a86d['Account'][_0x2ca1('0x22')],'agent':_0xd8a86d[_0x2ca1('0x6a')]?_0xd8a86d[_0x2ca1('0x6a')]['fullname']:_0x2ca1('0x6d'),'createdAt':moment(_0xd8a86d['createdAt'])[_0x2ca1('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2ca1('0x57')](),'closedAt':_0xd8a86d[_0x2ca1('0x6e')]?moment(_0xd8a86d[_0x2ca1('0x6f')])[_0x2ca1('0x4c')](_0x2ca1('0x4d'))[_0x2ca1('0x57')]():'','disposition':_0xd8a86d[_0x2ca1('0x70')],'visibility':_0xd8a86d[_0x2ca1('0x71')]?'Public':_0x2ca1('0x72'),'messages':_(_0xd8a86d['Messages'])[_0x2ca1('0x49')]({'secret':![]})[_0x2ca1('0x23')](function(_0x486b4e){if(_0x486b4e[_0x2ca1('0x64')]){var _0x322e01=path[_0x2ca1('0x58')](_0x8ab7e3,_0x486b4e['Attachment'][_0x2ca1('0x73')]);if(fs[_0x2ca1('0x74')](_0x322e01)){fs[_0x2ca1('0x75')](_0x322e01)[_0x2ca1('0x76')](fs['createWriteStream'](path[_0x2ca1('0x58')](_0x1c13fb,_0x486b4e[_0x2ca1('0x64')][_0x2ca1('0x73')])));}}return{'date':moment(_0x486b4e['createdAt'])[_0x2ca1('0x4c')](_0x2ca1('0x4d'))[_0x2ca1('0x57')](),'sender':_0x486b4e[_0x2ca1('0x67')]===_0x2ca1('0x77')?_0x486b4e['User']?_0x486b4e[_0x2ca1('0x5f')][_0x2ca1('0x60')]:_0x2ca1('0x78'):_0x486b4e[_0x2ca1('0x79')][_0x2ca1('0x62')]+(_0x486b4e[_0x2ca1('0x79')]['lastName']?'\x20'+_0x486b4e[_0x2ca1('0x79')]['lastName']:''),'body':_0x486b4e['Attachment']?_0x486b4e[_0x2ca1('0x64')][_0x2ca1('0x73')]:_0x486b4e[_0x2ca1('0x3a')],'direction':_0x486b4e[_0x2ca1('0x67')]==='out'?'A':'C','secret':_0x486b4e[_0x2ca1('0x68')],'read':_0x486b4e[_0x2ca1('0x7a')],'attachment':_0x486b4e[_0x2ca1('0x64')]};})[_0x2ca1('0x7b')]()};return ejs['renderFile'](path[_0x2ca1('0x58')](config['root'],'server','views',_0x2ca1('0x7c')),{'interaction':_0x10303e})[_0x2ca1('0x1d')](function(_0x4935dd){var _0x5ee573=path[_0x2ca1('0x58')](_0x1c13fb,_0x2ca1('0x7d')+_0xd8a86d['id']+'-'+_0x30d825+_0x2ca1('0x7e'));var _0x4bf0cc={'path':_0x5ee573,'channel':_0x2ca1('0x6c'),'interactionId':_0xd8a86d['id']};return pdf[_0x2ca1('0x7f')](_0x4935dd,_0x4bf0cc);})[_0x2ca1('0x1d')](function(){return new Promise(function(_0x187a5d,_0x43998d){zipdir(_0x1c13fb,{'saveTo':_0x361bee},function(_0x361374,_0x52fd14){if(_0x361374)return _0x43998d(_0x361374);return _0x187a5d(_0x52fd14);});})[_0x2ca1('0x1d')](function(){return new Promise(function(_0x3fe546,_0x18e3a0){rimraf(_0x1c13fb,function(_0x486c2d){if(_0x486c2d)_0x18e3a0(_0x486c2d);return _0x3fe546();});});})[_0x2ca1('0x1d')](function(){return _0x26e361[_0x2ca1('0x80')](_0x361bee,_0x194240,function(_0x4692fd){if(_0x4692fd){logger[_0x2ca1('0x20')]('Unable\x20to\x20delete\x20zip\x20file',_0x4692fd);}else{fs[_0x2ca1('0x81')](_0x361bee);}});});});}else{return _0x26e361[_0x2ca1('0x1f')](0xc8);}})[_0x2ca1('0x3c')](handleError(_0x26e361,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 4f93206..50fd639 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 _0x9182=['hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9182,0xe6));var _0x2918=function(_0x19b267,_0x5ea777){_0x19b267=_0x19b267-0x0;var _0x3103af=_0x9182[_0x19b267];return _0x3103af;};'use strict';var EventEmitter=require(_0x2918('0x0'));var OpenchannelInteraction=require(_0x2918('0x1'))['db'][_0x2918('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x2918('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2918('0x4')](0x0);var events={'afterCreate':_0x2918('0x5'),'afterUpdate':_0x2918('0x6'),'afterDestroy':'remove'};function emitEvent(_0x46059d){return function(_0x65164a,_0x194eb4,_0x331822){_0x65164a[_0x2918('0x7')]({'attributes':['id'],'raw':!![]})[_0x2918('0x8')](function(_0x3ae33c){_0x65164a[_0x2918('0x9')]('Users',_0x3ae33c[_0x2918('0xa')](function(_0x132239){return{'id':_0x132239['id']};}));return OpenchannelMessage[_0x2918('0xb')]({'where':{'OpenchannelInteractionId':_0x65164a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2918('0x8')](function(_0xaac3e9){_0x65164a[_0x2918('0x9')](_0x2918('0xc'),_0xaac3e9[_0x2918('0xd')]);OpenchannelInteractionEvents[_0x2918('0xe')](_0x46059d+':'+_0x65164a['id'],_0x65164a);OpenchannelInteractionEvents['emit'](_0x46059d,_0x65164a);_0x331822(null);})[_0x2918('0xf')](_0x331822(null));};}for(var e in events){if(events[_0x2918('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x2918('0x11')](e,emitEvent(event));}}module[_0x2918('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x7ba4=['findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x5b327d,_0x570af7){var _0x4ac585=function(_0x203fc0){while(--_0x203fc0){_0x5b327d['push'](_0x5b327d['shift']());}};_0x4ac585(++_0x570af7);}(_0x7ba4,0x1db));var _0x47ba=function(_0x3989cf,_0x5f1035){_0x3989cf=_0x3989cf-0x0;var _0x22d38c=_0x7ba4[_0x3989cf];return _0x22d38c;};'use strict';var EventEmitter=require(_0x47ba('0x0'));var OpenchannelInteraction=require(_0x47ba('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x47ba('0x1'))['db'][_0x47ba('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x47ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47ba('0x4'),'afterDestroy':_0x47ba('0x5')};function emitEvent(_0x2fe006){return function(_0x176304,_0x4631b7,_0x1ab4ac){_0x176304[_0x47ba('0x6')]({'attributes':['id'],'raw':!![]})[_0x47ba('0x7')](function(_0x492992){_0x176304[_0x47ba('0x8')](_0x47ba('0x9'),_0x492992[_0x47ba('0xa')](function(_0x176d17){return{'id':_0x176d17['id']};}));return OpenchannelMessage[_0x47ba('0xb')]({'where':{'OpenchannelInteractionId':_0x176304['id'],'direction':'in','read':![]},'raw':!![]});})[_0x47ba('0x7')](function(_0x26dc97){_0x176304['setDataValue'](_0x47ba('0xc'),_0x26dc97[_0x47ba('0xd')]);OpenchannelInteractionEvents[_0x47ba('0xe')](_0x2fe006+':'+_0x176304['id'],_0x176304);OpenchannelInteractionEvents[_0x47ba('0xe')](_0x2fe006,_0x176304);_0x1ab4ac(null);})[_0x47ba('0xf')](_0x1ab4ac(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x47ba('0x10')](e,emitEvent(event));}}module[_0x47ba('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9f8b54e..0450489 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 _0x1856=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','format'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x1856,0x121));var _0x6185=function(_0x4cca8e,_0x4e35c6){_0x4cca8e=_0x4cca8e-0x0;var _0x50ac6d=_0x1856[_0x4cca8e];return _0x50ac6d;};'use strict';var _=require(_0x6185('0x0'));var util=require(_0x6185('0x1'));var logger=require(_0x6185('0x2'))('api');var moment=require(_0x6185('0x3'));var BPromise=require(_0x6185('0x4'));var rp=require(_0x6185('0x5'));var fs=require('fs');var path=require(_0x6185('0x6'));var rimraf=require(_0x6185('0x7'));var config=require(_0x6185('0x8'));var attributes=require(_0x6185('0x9'));module[_0x6185('0xa')]=function(_0xbf3b32,_0x4c7bef){return _0xbf3b32[_0x6185('0xb')](_0x6185('0xc'),attributes,{'tableName':_0x6185('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6185('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x5e05f1,_0x23ca88,_0x3aa4d0){if(_0x5e05f1[_0x6185('0xf')]('closed')){_0x5e05f1['closedAt']=moment()[_0x6185('0x10')](_0x6185('0x11'));}_0x3aa4d0(null,_0x5e05f1);}}});}; \ No newline at end of file +var _0x2e2c=['exports','define','OpenchannelInteraction','utf8mb4','changed','closed','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelInteraction.attributes'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0x2e2c,0x160));var _0xc2e2=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x2e2c[_0x2067e9];return _0x280ce4;};'use strict';var _=require(_0xc2e2('0x0'));var util=require(_0xc2e2('0x1'));var logger=require(_0xc2e2('0x2'))(_0xc2e2('0x3'));var moment=require(_0xc2e2('0x4'));var BPromise=require(_0xc2e2('0x5'));var rp=require(_0xc2e2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc2e2('0x7'));module[_0xc2e2('0x8')]=function(_0x273fdf,_0xa6717a){return _0x273fdf[_0xc2e2('0x9')](_0xc2e2('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc2e2('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x462c86,_0x19cdad,_0x5d5de9){if(_0x462c86[_0xc2e2('0xc')](_0xc2e2('0xd'))){_0x462c86['closedAt']=moment()[_0xc2e2('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5d5de9(null,_0x462c86);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 6833d98..7f6904e 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 _0x9b75=['AddTags','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','attributes','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread'];(function(_0x4cde79,_0x5b2a84){var _0x1cbd6a=function(_0x53879a){while(--_0x53879a){_0x4cde79['push'](_0x4cde79['shift']());}};_0x1cbd6a(++_0x5b2a84);}(_0x9b75,0x191));var _0x59b7=function(_0xab6fd4,_0x2040fa){_0xab6fd4=_0xab6fd4-0x0;var _0x4843b9=_0x9b75[_0xab6fd4];return _0x4843b9;};'use strict';var _=require('lodash');var util=require(_0x59b7('0x0'));var moment=require('moment');var BPromise=require(_0x59b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59b7('0x2'));var db=require(_0x59b7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x59b7('0x4'));var config=require(_0x59b7('0x5'));var jayson=require(_0x59b7('0x6'));var client=jayson[_0x59b7('0x7')][_0x59b7('0x8')]({'port':0x232a});config[_0x59b7('0x9')]=_[_0x59b7('0xa')](config[_0x59b7('0x9')],{'host':_0x59b7('0xb'),'port':0x18eb});var socket=require(_0x59b7('0xc'))(new Redis(config[_0x59b7('0x9')]));require(_0x59b7('0xd'))['register'](socket);function respondWithRpcPromise(_0xf5daed,_0x34cac1,_0x4d2644){return new BPromise(function(_0x34ac38,_0x4829e4){return client[_0x59b7('0xe')](_0xf5daed,_0x4d2644)[_0x59b7('0xf')](function(_0x2cd82d){logger[_0x59b7('0x10')](_0x59b7('0x11'),_0x34cac1,_0x59b7('0x12'));logger[_0x59b7('0x13')](_0x59b7('0x14'),_0x34cac1,'request\x20sent',JSON[_0x59b7('0x15')](_0x2cd82d));if(_0x2cd82d[_0x59b7('0x16')]){if(_0x2cd82d[_0x59b7('0x16')][_0x59b7('0x17')]===0x1f4){logger[_0x59b7('0x16')](_0x59b7('0x11'),_0x34cac1,_0x2cd82d[_0x59b7('0x16')][_0x59b7('0x18')]);return _0x4829e4(_0x2cd82d[_0x59b7('0x16')][_0x59b7('0x18')]);}logger[_0x59b7('0x16')](_0x59b7('0x11'),_0x34cac1,_0x2cd82d[_0x59b7('0x16')]['message']);return _0x34ac38(_0x2cd82d[_0x59b7('0x16')][_0x59b7('0x18')]);}else{logger[_0x59b7('0x10')](_0x59b7('0x11'),_0x34cac1,'request\x20sent');_0x34ac38(_0x2cd82d[_0x59b7('0x19')][_0x59b7('0x18')]);}})[_0x59b7('0x1a')](function(_0x4e5845){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x34cac1,_0x4e5845);_0x4829e4(_0x4e5845);});});}exports[_0x59b7('0x1b')]=function(_0x32c41c){var _0x439870=this;return new Promise(function(_0x4a6996,_0x414e69){return db[_0x59b7('0x1c')]['update'](_0x32c41c[_0x59b7('0x1d')],{'raw':_0x32c41c[_0x59b7('0x1e')]?_0x32c41c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32c41c[_0x59b7('0x1e')]?_0x32c41c[_0x59b7('0x1e')][_0x59b7('0x1f')]||null:null,'attributes':_0x32c41c[_0x59b7('0x1e')]?_0x32c41c['options'][_0x59b7('0x20')]||null:null,'limit':_0x32c41c['options']?_0x32c41c['options']['limit']||null:null})[_0x59b7('0xf')](function(_0xcd234e){logger['info'](_0x59b7('0x1b'),_0x32c41c);logger[_0x59b7('0x13')](_0x59b7('0x1b'),_0x32c41c,JSON[_0x59b7('0x15')](_0xcd234e));_0x4a6996(_0xcd234e);})['catch'](function(_0x37fc1f){logger[_0x59b7('0x16')]('UpdateOpenchannelInteraction',_0x37fc1f[_0x59b7('0x18')],_0x32c41c);_0x414e69(_0x439870[_0x59b7('0x16')](0x1f4,_0x37fc1f[_0x59b7('0x18')]));});});};exports[_0x59b7('0x21')]=function(_0x205585){return new Promise(function(_0x2cafec,_0x29acfe){return db[_0x59b7('0x1c')][_0x59b7('0x22')]({'where':_0x205585['options']?_0x205585[_0x59b7('0x1e')][_0x59b7('0x1f')]||null:null})[_0x59b7('0xf')](function(_0x2ef020){if(_0x2ef020){return _0x2ef020[_0x59b7('0x23')](_0x205585[_0x59b7('0x1d')][_0x59b7('0x24')],_[_0x59b7('0x25')](_0x205585[_0x59b7('0x1d')],[_0x59b7('0x24'),'id'])||{});}})[_0x59b7('0x26')](function(_0x8623da){logger[_0x59b7('0x10')]('AddTags',_0x205585);logger[_0x59b7('0x13')]('AddTags',_0x205585,JSON[_0x59b7('0x15')](_0x8623da));_0x2cafec(_0x8623da);})[_0x59b7('0x1a')](function(_0x4ffeff){logger[_0x59b7('0x16')](_0x59b7('0x27'),_0x4ffeff[_0x59b7('0x18')],_0x205585);_0x29acfe(_this['error'](0x1f4,_0x4ffeff[_0x59b7('0x18')]));});});}; \ No newline at end of file +var _0x07bd=['redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x21ac06,_0x40dd86){var _0x327865=function(_0x156c80){while(--_0x156c80){_0x21ac06['push'](_0x21ac06['shift']());}};_0x327865(++_0x40dd86);}(_0x07bd,0x15d));var _0xd07b=function(_0x5c535e,_0x3d2e11){_0x5c535e=_0x5c535e-0x0;var _0x5461f5=_0x07bd[_0x5c535e];return _0x5461f5;};'use strict';var _=require(_0xd07b('0x0'));var util=require('util');var moment=require(_0xd07b('0x1'));var BPromise=require(_0xd07b('0x2'));var rs=require(_0xd07b('0x3'));var fs=require('fs');var Redis=require(_0xd07b('0x4'));var db=require(_0xd07b('0x5'))['db'];var utils=require(_0xd07b('0x6'));var logger=require(_0xd07b('0x7'))(_0xd07b('0x8'));var config=require(_0xd07b('0x9'));var jayson=require(_0xd07b('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xd07b('0xb')]=_[_0xd07b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd07b('0xd'))(new Redis(config[_0xd07b('0xb')]));require(_0xd07b('0xe'))[_0xd07b('0xf')](socket);function respondWithRpcPromise(_0x395954,_0x467707,_0x3e2763){return new BPromise(function(_0x4c9f9c,_0x19f37c){return client[_0xd07b('0x10')](_0x395954,_0x3e2763)[_0xd07b('0x11')](function(_0x2b0bde){logger[_0xd07b('0x12')](_0xd07b('0x13'),_0x467707,'request\x20sent');logger[_0xd07b('0x14')](_0xd07b('0x15'),_0x467707,'request\x20sent',JSON[_0xd07b('0x16')](_0x2b0bde));if(_0x2b0bde[_0xd07b('0x17')]){if(_0x2b0bde[_0xd07b('0x17')][_0xd07b('0x18')]===0x1f4){logger[_0xd07b('0x17')](_0xd07b('0x13'),_0x467707,_0x2b0bde[_0xd07b('0x17')]['message']);return _0x19f37c(_0x2b0bde[_0xd07b('0x17')][_0xd07b('0x19')]);}logger[_0xd07b('0x17')](_0xd07b('0x13'),_0x467707,_0x2b0bde[_0xd07b('0x17')][_0xd07b('0x19')]);return _0x4c9f9c(_0x2b0bde[_0xd07b('0x17')][_0xd07b('0x19')]);}else{logger[_0xd07b('0x12')](_0xd07b('0x13'),_0x467707,'request\x20sent');_0x4c9f9c(_0x2b0bde[_0xd07b('0x1a')][_0xd07b('0x19')]);}})[_0xd07b('0x1b')](function(_0x4b5840){logger['error'](_0xd07b('0x13'),_0x467707,_0x4b5840);_0x19f37c(_0x4b5840);});});}exports[_0xd07b('0x1c')]=function(_0x3d4d15){var _0x3897b2=this;return new Promise(function(_0x3aceec,_0x443daa){return db[_0xd07b('0x1d')][_0xd07b('0x1e')](_0x3d4d15[_0xd07b('0x1f')],{'raw':_0x3d4d15['options']?_0x3d4d15[_0xd07b('0x20')][_0xd07b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d4d15['options']?_0x3d4d15['options'][_0xd07b('0x22')]||null:null,'attributes':_0x3d4d15[_0xd07b('0x20')]?_0x3d4d15['options'][_0xd07b('0x23')]||null:null,'limit':_0x3d4d15[_0xd07b('0x20')]?_0x3d4d15[_0xd07b('0x20')][_0xd07b('0x24')]||null:null})[_0xd07b('0x11')](function(_0x5d34fa){logger[_0xd07b('0x12')](_0xd07b('0x1c'),_0x3d4d15);logger[_0xd07b('0x14')]('UpdateOpenchannelInteraction',_0x3d4d15,JSON[_0xd07b('0x16')](_0x5d34fa));_0x3aceec(_0x5d34fa);})[_0xd07b('0x1b')](function(_0x172444){logger[_0xd07b('0x17')](_0xd07b('0x1c'),_0x172444[_0xd07b('0x19')],_0x3d4d15);_0x443daa(_0x3897b2[_0xd07b('0x17')](0x1f4,_0x172444[_0xd07b('0x19')]));});});};exports[_0xd07b('0x25')]=function(_0x47034f){return new Promise(function(_0x5a447b,_0x16ba4d){return db[_0xd07b('0x1d')]['find']({'where':_0x47034f[_0xd07b('0x20')]?_0x47034f['options']['where']||null:null})['then'](function(_0x3a297d){if(_0x3a297d){return _0x3a297d['addTags'](_0x47034f[_0xd07b('0x1f')]['ids'],_['omit'](_0x47034f['body'],['ids','id'])||{});}})[_0xd07b('0x26')](function(_0x5edfee){logger[_0xd07b('0x12')](_0xd07b('0x27'),_0x47034f);logger['debug'](_0xd07b('0x27'),_0x47034f,JSON[_0xd07b('0x16')](_0x5edfee));_0x5a447b(_0x5edfee);})['catch'](function(_0x13d656){logger[_0xd07b('0x17')](_0xd07b('0x27'),_0x13d656[_0xd07b('0x19')],_0x47034f);_0x16ba4d(_this[_0xd07b('0x17')](0x1f4,_0x13d656[_0xd07b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index dfe843a..8c50432 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 _0xfbed=['emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x5caee9,_0x2d5230){var _0x2463a3=function(_0x4c13cd){while(--_0x4c13cd){_0x5caee9['push'](_0x5caee9['shift']());}};_0x2463a3(++_0x2d5230);}(_0xfbed,0x155));var _0xdfbe=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xfbed[_0x4b055c];return _0x4b62bb;};'use strict';var OpenchannelInteractionEvents=require(_0xdfbe('0x0'));var events=[_0xdfbe('0x1'),_0xdfbe('0x2'),'update'];function createListener(_0x151585,_0x8b29d4){return function(_0x42c466){_0x8b29d4[_0xdfbe('0x3')](_0x151585,_0x42c466);};}function removeListener(_0x3714c3,_0x432384){return function(){OpenchannelInteractionEvents[_0xdfbe('0x4')](_0x3714c3,_0x432384);};}exports[_0xdfbe('0x5')]=function(_0xb01404){for(var _0x274144=0x0,_0x7cf7ad=events[_0xdfbe('0x6')];_0x274144<_0x7cf7ad;_0x274144++){var _0x5f3da0=events[_0x274144];var _0x56cbb9=createListener(_0xdfbe('0x7')+_0x5f3da0,_0xb01404);OpenchannelInteractionEvents['on'](_0x5f3da0,_0x56cbb9);}}; \ No newline at end of file +var _0xbf53=['openchannelInteraction:','./openchannelInteraction.events','save','update','removeListener','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbf53,0x13c));var _0x3bf5=function(_0x239c0d,_0x3df13f){_0x239c0d=_0x239c0d-0x0;var _0x527c7b=_0xbf53[_0x239c0d];return _0x527c7b;};'use strict';var OpenchannelInteractionEvents=require(_0x3bf5('0x0'));var events=[_0x3bf5('0x1'),'remove',_0x3bf5('0x2')];function createListener(_0x5843a0,_0x2d8cde){return function(_0x4fbae5){_0x2d8cde['emit'](_0x5843a0,_0x4fbae5);};}function removeListener(_0x224df7,_0x4baf8b){return function(){OpenchannelInteractionEvents[_0x3bf5('0x3')](_0x224df7,_0x4baf8b);};}exports[_0x3bf5('0x4')]=function(_0x154ae5){for(var _0x3fff57=0x0,_0x29a93b=events[_0x3bf5('0x5')];_0x3fff57<_0x29a93b;_0x3fff57++){var _0x103484=events[_0x3fff57];var _0x4286f3=createListener(_0x3bf5('0x6')+_0x103484,_0x154ae5);OpenchannelInteractionEvents['on'](_0x103484,_0x4286f3);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 8a4eaaa..48f77ae 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x355adc,_0xac51ab){var _0x4df04f=function(_0x4a787d){while(--_0x4a787d){_0x355adc['push'](_0x355adc['shift']());}};_0x4df04f(++_0xac51ab);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0xcb91[_0x1ee62e];return _0x27c6c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x572d79,_0x71755){var _0x192f80=function(_0x393816){while(--_0x393816){_0x572d79['push'](_0x572d79['shift']());}};_0x192f80(++_0x71755);}(_0xedd9,0xfc));var _0x9edd=function(_0x26ee16,_0x4da133){_0x26ee16=_0x26ee16-0x0;var _0x4fb841=_0xedd9[_0x26ee16];return _0x4fb841;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 616649c..d2ba55d 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 _0x57f8=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x1e78cb,_0x423703){var _0x40eaf4=function(_0x12e83b){while(--_0x12e83b){_0x1e78cb['push'](_0x1e78cb['shift']());}};_0x40eaf4(++_0x423703);}(_0x57f8,0x198));var _0x857f=function(_0x2493a8,_0x5a240d){_0x2493a8=_0x2493a8-0x0;var _0x2b06c9=_0x57f8[_0x2493a8];return _0x2b06c9;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'body':{'type':Sequelize[_0x857f('0x1')](_0x857f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x857f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x857f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x857f('0x4')]('in',_0x857f('0x5')),'defaultValue':_0x857f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x857f('0x6')]},'providerName':{'type':Sequelize[_0x857f('0x7')]},'providerResponse':{'type':Sequelize[_0x857f('0x1')]}}; \ No newline at end of file +var _0x7462=['out','STRING','TEXT','sequelize','exports','BOOLEAN'];(function(_0x173ec1,_0x4da580){var _0xef8429=function(_0x2a5647){while(--_0x2a5647){_0x173ec1['push'](_0x173ec1['shift']());}};_0xef8429(++_0x4da580);}(_0x7462,0x165));var _0x2746=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0x7462[_0x108d5f];return _0x456ea3;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2746('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2746('0x3')),'defaultValue':_0x2746('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2746('0x4')]},'providerResponse':{'type':Sequelize[_0x2746('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 8326d26..a3ca47c 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 _0x6e04=['interaction','role','stringify','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','fullname','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','OpenchannelMessage','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','openchannel-interactions','accept','openchannel','readAt','format','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x14792e,_0xa801a5){var _0x2bfbfb=function(_0xe06f79){while(--_0xe06f79){_0x14792e['push'](_0x14792e['shift']());}};_0x2bfbfb(++_0xa801a5);}(_0x6e04,0x99));var _0x46e0=function(_0x3a21c0,_0x348451){_0x3a21c0=_0x3a21c0-0x0;var _0x411e84=_0x6e04[_0x3a21c0];return _0x411e84;};'use strict';var emlformat=require(_0x46e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x46e0('0x1'));var jsonpatch=require(_0x46e0('0x2'));var rp=require(_0x46e0('0x3'));var moment=require(_0x46e0('0x4'));var BPromise=require(_0x46e0('0x5'));var Mustache=require(_0x46e0('0x6'));var util=require(_0x46e0('0x7'));var path=require(_0x46e0('0x8'));var sox=require('sox');var csv=require(_0x46e0('0x9'));var ejs=require(_0x46e0('0xa'));var fs=require('fs');var fs_extra=require(_0x46e0('0xb'));var _=require(_0x46e0('0xc'));var squel=require('squel');var crypto=require(_0x46e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x46e0('0xe'));var toCsv=require(_0x46e0('0x9'));var querystring=require(_0x46e0('0xf'));var Papa=require('papaparse');var Redis=require(_0x46e0('0x10'));var authService=require(_0x46e0('0x11'));var qs=require(_0x46e0('0x12'));var as=require(_0x46e0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46e0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x46e0('0x15'));var licenseUtil=require(_0x46e0('0x16'));var db=require('../../mysqldb')['db'];config[_0x46e0('0x17')]=_[_0x46e0('0x18')](config[_0x46e0('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x46e0('0x19'))(new Redis(config[_0x46e0('0x17')]));require(_0x46e0('0x1a'))[_0x46e0('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x46e0('0x1c')][_0x46e0('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35e440,_0x5e923c,_0x480b73,_0x526a5c){return new BPromise(function(_0x576476,_0x43cdc0){var _0x3027d1=_0x526a5c||client;return _0x3027d1[_0x46e0('0x1e')](_0x35e440,_0x480b73)[_0x46e0('0x1f')](function(_0x46b8ac){logger[_0x46e0('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x5e923c,_0x46e0('0x21'));logger[_0x46e0('0x22')](_0x46e0('0x23'),_0x5e923c,_0x46e0('0x21'),JSON['stringify'](_0x46b8ac));if(_0x46b8ac[_0x46e0('0x24')]){if(_0x46b8ac[_0x46e0('0x24')][_0x46e0('0x25')]===0x1f4){logger[_0x46e0('0x24')](_0x46e0('0x26'),_0x5e923c,_0x46b8ac[_0x46e0('0x24')][_0x46e0('0x27')]);return _0x43cdc0(_0x46b8ac[_0x46e0('0x24')][_0x46e0('0x27')]);}logger[_0x46e0('0x24')](_0x46e0('0x26'),_0x5e923c,_0x46b8ac['error']['message']);return _0x576476(_0x46b8ac[_0x46e0('0x24')]['message']);}else{logger[_0x46e0('0x20')](_0x46e0('0x26'),_0x5e923c,_0x46e0('0x21'));_0x576476(_0x46b8ac[_0x46e0('0x28')]['message']);}})[_0x46e0('0x29')](function(_0x5885f6){logger[_0x46e0('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x5e923c,_0x5885f6);_0x43cdc0(_0x5885f6);});});}function respondWithStatusCode(_0x1f136f,_0x36167e){_0x36167e=_0x36167e||0xcc;return function(_0x1525ce){if(_0x1525ce){return _0x1f136f['sendStatus'](_0x36167e);}return _0x1f136f[_0x46e0('0x2a')](_0x36167e)[_0x46e0('0x2b')]();};}function respondWithResult(_0xc71c84,_0x36b349){_0x36b349=_0x36b349||0xc8;return function(_0x187cc1){if(_0x187cc1){return _0xc71c84['status'](_0x36b349)[_0x46e0('0x2c')](_0x187cc1);}};}function respondWithFilteredResult(_0x32709c,_0x439138){return function(_0x1920bc){if(_0x1920bc){var _0x8b6aa6=typeof _0x439138[_0x46e0('0x2d')]===_0x46e0('0x2e')&&typeof _0x439138[_0x46e0('0x2f')]===_0x46e0('0x2e');var _0x1026aa=_0x1920bc['count'];var _0x28e324=_0x8b6aa6?0x0:_0x439138[_0x46e0('0x2d')];var _0x4e997e=_0x8b6aa6?_0x1920bc[_0x46e0('0x30')]:_0x439138[_0x46e0('0x2d')]+_0x439138['limit'];var _0x279537;if(_0x4e997e>=_0x1026aa){_0x4e997e=_0x1026aa;_0x279537=0xc8;}else{_0x279537=0xce;}_0x32709c[_0x46e0('0x2a')](_0x279537);return _0x32709c[_0x46e0('0x31')](_0x46e0('0x32'),_0x28e324+'-'+_0x4e997e+'/'+_0x1026aa)[_0x46e0('0x2c')](_0x1920bc);}return null;};}function patchUpdates(_0x58b3cd){return function(_0x4cfa8d){try{jsonpatch[_0x46e0('0x33')](_0x4cfa8d,_0x58b3cd,!![]);}catch(_0x3c2ad5){return BPromise[_0x46e0('0x34')](_0x3c2ad5);}return _0x4cfa8d[_0x46e0('0x35')]();};}function saveUpdates(_0x1b1141,_0xc58bb5){return function(_0x75958b){if(_0x75958b){return _0x75958b[_0x46e0('0x36')](_0x1b1141)['then'](function(_0x396b19){return _0x396b19;});}return null;};}function removeEntity(_0x41269d,_0x266d5b){return function(_0x1f2b84){if(_0x1f2b84){return _0x1f2b84[_0x46e0('0x37')]()['then'](function(){_0x41269d[_0x46e0('0x2a')](0xcc)[_0x46e0('0x2b')]();});}};}function handleEntityNotFound(_0xb6ecf2,_0x28b7ed){return function(_0x492623){if(!_0x492623){_0xb6ecf2[_0x46e0('0x38')](0x194);}return _0x492623;};}function handleError(_0x235272,_0x552461){_0x552461=_0x552461||0x1f4;return function(_0x10ef79){logger['error'](_0x10ef79['stack']);if(_0x10ef79[_0x46e0('0x39')]){delete _0x10ef79['name'];}_0x235272[_0x46e0('0x2a')](_0x552461)[_0x46e0('0x3a')](_0x10ef79);};}exports[_0x46e0('0x3b')]=function(_0x539916,_0x5e489d){var _0x26513a={},_0x5efd38={},_0x3654d2={'count':0x0,'rows':[]};var _0x3ec02f=_['map'](db[_0x46e0('0x3c')]['rawAttributes'],function(_0x2a1421){return{'name':_0x2a1421['fieldName'],'type':_0x2a1421[_0x46e0('0x3d')]['key']};});_0x5efd38[_0x46e0('0x3e')]=_[_0x46e0('0x3f')](_0x3ec02f,'name');_0x5efd38[_0x46e0('0x40')]=_['keys'](_0x539916[_0x46e0('0x40')]);_0x5efd38[_0x46e0('0x41')]=_['intersection'](_0x5efd38[_0x46e0('0x3e')],_0x5efd38[_0x46e0('0x40')]);_0x26513a['attributes']=_[_0x46e0('0x42')](_0x5efd38[_0x46e0('0x3e')],qs[_0x46e0('0x43')](_0x539916[_0x46e0('0x40')][_0x46e0('0x43')]));_0x26513a['attributes']=_0x26513a[_0x46e0('0x44')][_0x46e0('0x45')]?_0x26513a[_0x46e0('0x44')]:_0x5efd38['model'];if(!_0x539916['query'][_0x46e0('0x46')](_0x46e0('0x47'))){_0x26513a[_0x46e0('0x2f')]=qs[_0x46e0('0x2f')](_0x539916[_0x46e0('0x40')][_0x46e0('0x2f')]);_0x26513a[_0x46e0('0x2d')]=qs[_0x46e0('0x2d')](_0x539916['query'][_0x46e0('0x2d')]);}_0x26513a[_0x46e0('0x48')]=qs[_0x46e0('0x49')](_0x539916['query'][_0x46e0('0x49')]);_0x26513a[_0x46e0('0x4a')]=qs['filters'](_['pick'](_0x539916[_0x46e0('0x40')],_0x5efd38[_0x46e0('0x41')]),_0x3ec02f);if(_0x539916[_0x46e0('0x40')][_0x46e0('0x4b')]){_0x26513a[_0x46e0('0x4a')]=_['merge'](_0x26513a[_0x46e0('0x4a')],{'$or':_[_0x46e0('0x3f')](_0x3ec02f,function(_0x882567){if(_0x882567['type']!==_0x46e0('0x4c')){var _0x323bf2={};_0x323bf2[_0x882567[_0x46e0('0x39')]]={'$like':'%'+_0x539916[_0x46e0('0x40')][_0x46e0('0x4b')]+'%'};return _0x323bf2;}})});}_0x26513a=_[_0x46e0('0x4d')]({},_0x26513a,_0x539916[_0x46e0('0x4e')]);var _0x512c02={'where':_0x26513a[_0x46e0('0x4a')]};return db[_0x46e0('0x3c')]['count'](_0x512c02)['then'](function(_0x1989c8){_0x3654d2[_0x46e0('0x30')]=_0x1989c8;if(_0x539916[_0x46e0('0x40')][_0x46e0('0x4f')]){_0x26513a[_0x46e0('0x50')]=[{'all':!![]}];}return db[_0x46e0('0x3c')][_0x46e0('0x51')](_0x26513a);})[_0x46e0('0x1f')](function(_0x3d229c){_0x3654d2[_0x46e0('0x52')]=_0x3d229c;return _0x3654d2;})['then'](respondWithFilteredResult(_0x5e489d,_0x26513a))['catch'](handleError(_0x5e489d,null));};exports[_0x46e0('0x53')]=function(_0x38c7a5,_0x1d8de0){var _0x88deaa={'raw':!![],'where':{'id':_0x38c7a5[_0x46e0('0x54')]['id']}},_0x1df5b3={};_0x1df5b3[_0x46e0('0x3e')]=_['keys'](db[_0x46e0('0x3c')][_0x46e0('0x55')]);_0x1df5b3['query']=_['keys'](_0x38c7a5[_0x46e0('0x40')]);_0x1df5b3['filters']=_[_0x46e0('0x42')](_0x1df5b3[_0x46e0('0x3e')],_0x1df5b3[_0x46e0('0x40')]);_0x88deaa['attributes']=_[_0x46e0('0x42')](_0x1df5b3[_0x46e0('0x3e')],qs[_0x46e0('0x43')](_0x38c7a5[_0x46e0('0x40')][_0x46e0('0x43')]));_0x88deaa[_0x46e0('0x44')]=_0x88deaa['attributes'][_0x46e0('0x45')]?_0x88deaa[_0x46e0('0x44')]:_0x1df5b3[_0x46e0('0x3e')];if(_0x38c7a5[_0x46e0('0x40')]['includeAll']){_0x88deaa[_0x46e0('0x50')]=[{'all':!![]}];}_0x88deaa=_[_0x46e0('0x4d')]({},_0x88deaa,_0x38c7a5[_0x46e0('0x4e')]);return db[_0x46e0('0x3c')][_0x46e0('0x56')](_0x88deaa)['then'](handleEntityNotFound(_0x1d8de0,null))[_0x46e0('0x1f')](respondWithResult(_0x1d8de0,null))[_0x46e0('0x29')](handleError(_0x1d8de0,null));};exports['create']=function(_0x119a79,_0x33e88c){return db[_0x46e0('0x3c')][_0x46e0('0x57')](_0x119a79[_0x46e0('0x58')],{})['then'](respondWithResult(_0x33e88c,0xc9))[_0x46e0('0x29')](handleError(_0x33e88c,null));};exports['update']=function(_0x4277a8,_0x1d8c1a){if(_0x4277a8[_0x46e0('0x58')]['id']){delete _0x4277a8[_0x46e0('0x58')]['id'];}return db[_0x46e0('0x3c')][_0x46e0('0x56')]({'where':{'id':_0x4277a8[_0x46e0('0x54')]['id']}})[_0x46e0('0x1f')](handleEntityNotFound(_0x1d8c1a,null))[_0x46e0('0x1f')](saveUpdates(_0x4277a8[_0x46e0('0x58')],null))[_0x46e0('0x1f')](respondWithResult(_0x1d8c1a,null))[_0x46e0('0x29')](handleError(_0x1d8c1a,null));};exports[_0x46e0('0x37')]=function(_0x4384a4,_0x57e5c5){return db['OpenchannelMessage']['find']({'where':{'id':_0x4384a4[_0x46e0('0x54')]['id']}})[_0x46e0('0x1f')](handleEntityNotFound(_0x57e5c5,null))['then'](removeEntity(_0x57e5c5,null))[_0x46e0('0x29')](handleError(_0x57e5c5,null));};exports[_0x46e0('0x59')]=function(_0x1a078e,_0x5569f8){return db[_0x46e0('0x3c')][_0x46e0('0x59')]()['then'](respondWithResult(_0x5569f8,null))[_0x46e0('0x29')](handleError(_0x5569f8,null));};var interaction_log=require(_0x46e0('0x14'))(_0x46e0('0x5a'));exports[_0x46e0('0x5b')]=function(_0x2b1fb4,_0x5d46c0,_0x7d309c){var _0x2da509={'agent':{},'channel':_0x46e0('0x5c')};if(_0x2b1fb4[_0x46e0('0x58')]['id']){delete _0x2b1fb4['body']['id'];}_0x2b1fb4[_0x46e0('0x58')]['read']=!![];_0x2b1fb4[_0x46e0('0x58')][_0x46e0('0x5d')]=moment()[_0x46e0('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b1fb4['body']['UserId']=_0x2b1fb4['body'][_0x46e0('0x5f')]||_0x2b1fb4[_0x46e0('0x60')]['id'];_0x2da509[_0x46e0('0x61')]['id']=_0x2b1fb4[_0x46e0('0x58')][_0x46e0('0x5f')];return db[_0x46e0('0x3c')][_0x46e0('0x56')]({'where':{'id':_0x2b1fb4[_0x46e0('0x54')]['id'],'UserId':null}})[_0x46e0('0x1f')](handleEntityNotFound(_0x5d46c0,null))['then'](saveUpdates(_0x2b1fb4[_0x46e0('0x58')],null))[_0x46e0('0x1f')](function(_0x52dbf0){if(_0x52dbf0){_0x2da509['message']=_0x52dbf0[_0x46e0('0x62')]({'plain':!![]});return db[_0x46e0('0x63')][_0x46e0('0x56')]({'where':{'id':_0x52dbf0['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5d46c0,null))['then'](function(_0x48430d){if(_0x48430d){return _0x48430d['update']({'UserId':_0x2b1fb4[_0x46e0('0x58')][_0x46e0('0x5f')],'read1stAt':_[_0x46e0('0x64')](_0x48430d[_0x46e0('0x65')])?moment()[_0x46e0('0x5e')](_0x46e0('0x66')):undefined});}return null;})[_0x46e0('0x1f')](function(_0x6fc521){if(_0x6fc521){_0x2da509[_0x46e0('0x67')]=_0x6fc521[_0x46e0('0x62')]({'plain':!![]});interaction_log[_0x46e0('0x20')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b1fb4[_0x46e0('0x60')]['id'],_0x2b1fb4[_0x46e0('0x60')][_0x46e0('0x39')],_0x2b1fb4[_0x46e0('0x60')][_0x46e0('0x68')],_0x2da509[_0x46e0('0x67')]['id'],_0x2b1fb4[_0x46e0('0x58')]?JSON[_0x46e0('0x69')](_0x2b1fb4[_0x46e0('0x58')]):_0x46e0('0x6a'));return respondWithRpcPromise(_0x46e0('0x6b'),'acceptMessage',_0x2da509);}return null;})[_0x46e0('0x1f')](function(_0x15f01b){var _0x2be3b3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15f01b[_0x46e0('0x27')][_0x46e0('0x6c')];return db[_0x46e0('0x6d')][_0x46e0('0x40')](_0x2be3b3,{'type':db[_0x46e0('0x6e')][_0x46e0('0x6f')][_0x46e0('0x70')],'raw':!![]})[_0x46e0('0x1f')](function(_0xa59db0){return _0xa59db0;});})['then'](function(_0x2bbd1a){if(_0x2bbd1a){_0x2da509['message'][_0x46e0('0x71')]=_0x2bbd1a[0x0];if(!_0x2b1fb4[_0x46e0('0x58')][_0x46e0('0x5f')])return;return db['User']['find']({'where':{'id':_0x2b1fb4[_0x46e0('0x58')]['UserId'],'role':_0x46e0('0x61')},'attributes':['id',_0x46e0('0x39'),'fullname',_0x46e0('0x72'),_0x46e0('0x73')],'raw':!![]});}return null;})[_0x46e0('0x1f')](function(_0x514433){if(!_0x514433)return null;_0x2da509[_0x46e0('0x27')][_0x46e0('0x61')]=_0x514433;return _0x2da509;})[_0x46e0('0x1f')](function(_0x5c8059){if(_0x5c8059){if(_0x2b1fb4[_0x46e0('0x58')]['manual']){_0x2da509[_0x46e0('0x27')][_0x46e0('0x74')]=util[_0x46e0('0x5e')](_0x46e0('0x75'),_0x2b1fb4[_0x46e0('0x60')][_0x46e0('0x39')]);_0x2da509[_0x46e0('0x27')][_0x46e0('0x76')]=_0x2da509[_0x46e0('0x76')];_0x2da509[_0x46e0('0x27')][_0x46e0('0x77')]=_0x2da509[_0x46e0('0x76')];_0x2da509['message'][_0x46e0('0x78')]=_0x46e0('0x5b');return respondWithRpcPromise(_0x46e0('0x79'),'EventManager',{'event':_0x46e0('0x7a'),'message':_0x2da509[_0x46e0('0x27')]},client9002)[_0x46e0('0x1f')](function(){return _0x2da509;});}return _0x2da509;}return null;})[_0x46e0('0x1f')](respondWithResult(_0x5d46c0,null))[_0x46e0('0x29')](handleError(_0x5d46c0,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x46e0('0x34')]=function(_0x233a30,_0x2611e3,_0x1495c0){var _0x28500f={'agent':{},'channel':'openchannel'};if(_0x233a30[_0x46e0('0x58')]['id']){delete _0x233a30['body']['id'];}_0x233a30[_0x46e0('0x58')][_0x46e0('0x5f')]=_0x233a30[_0x46e0('0x58')]['UserId']||_0x233a30[_0x46e0('0x60')]['id'];_0x28500f[_0x46e0('0x61')]['id']=_0x233a30[_0x46e0('0x58')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x233a30[_0x46e0('0x54')]['id'],'UserId':null}})[_0x46e0('0x1f')](handleEntityNotFound(_0x2611e3,null))['then'](function(_0x2c9ebb){if(_0x2c9ebb){_0x28500f['message']=_0x2c9ebb[_0x46e0('0x62')]({'plain':!![]});return db[_0x46e0('0x63')][_0x46e0('0x56')]({'where':{'id':_0x2c9ebb[_0x46e0('0x7b')]}});}return null;})[_0x46e0('0x1f')](handleEntityNotFound(_0x2611e3,null))[_0x46e0('0x1f')](function(_0x41a776){if(_0x41a776){_0x28500f[_0x46e0('0x67')]=_0x41a776['get']({'plain':!![]});interaction_log['info'](_0x46e0('0x7c'),_0x233a30['user']['id'],_0x233a30[_0x46e0('0x60')][_0x46e0('0x39')],_0x233a30[_0x46e0('0x60')][_0x46e0('0x68')],_0x28500f[_0x46e0('0x67')]['id'],_0x233a30['body']?JSON['stringify'](_0x233a30[_0x46e0('0x58')]):_0x46e0('0x6a'));return respondWithRpcPromise('RejectMessage',_0x46e0('0x7d'),_0x28500f);}return null;})[_0x46e0('0x1f')](function(_0x55a5bf){var _0x35b1cf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x55a5bf['message'][_0x46e0('0x6c')];return db[_0x46e0('0x6d')][_0x46e0('0x40')](_0x35b1cf,{'type':db['Sequelize'][_0x46e0('0x6f')]['SELECT'],'raw':!![]})[_0x46e0('0x1f')](function(_0x3fb55f){return _0x3fb55f;});})[_0x46e0('0x1f')](function(_0x36ee3f){if(_0x36ee3f){_0x28500f[_0x46e0('0x27')]['contact']=_0x36ee3f[0x0];if(!_0x233a30['body'][_0x46e0('0x5f')])return;return db[_0x46e0('0x7e')]['find']({'where':{'id':_0x233a30[_0x46e0('0x58')][_0x46e0('0x5f')],'role':'agent'},'attributes':['id',_0x46e0('0x39'),_0x46e0('0x7f'),_0x46e0('0x72'),'internal'],'raw':!![]});}return null;})[_0x46e0('0x1f')](function(_0x54e656){if(!_0x54e656)return null;_0x28500f['message'][_0x46e0('0x61')]=_0x54e656;return _0x28500f;})['then'](function(_0xf3deda){if(_0xf3deda){_0xf3deda[_0x46e0('0x27')][_0x46e0('0x74')]=util['format'](_0x46e0('0x75'),_0x233a30[_0x46e0('0x60')][_0x46e0('0x39')]);_0xf3deda[_0x46e0('0x27')][_0x46e0('0x76')]=_0x28500f[_0x46e0('0x76')];_0xf3deda['message'][_0x46e0('0x77')]=_0x28500f[_0x46e0('0x76')];_0xf3deda[_0x46e0('0x27')]['event']=_0x46e0('0x34');respondWithRpcPromise(_0x46e0('0x79'),_0x46e0('0x79'),{'event':'rejectmessage','message':_0xf3deda['message']},client9002);return _0x28500f;}return null;})[_0x46e0('0x1f')](respondWithResult(_0x2611e3,null))['catch'](handleError(_0x2611e3,null));}; \ No newline at end of file +var _0x5c79=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','User','agent','fullname','email','interface','SIP/%s','channel','motionChannel','EventManager','openchannel-interactions','openchannel','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','QueryTypes','internal','event','rejectmessage','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','OpenchannelMessage','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','map','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','length','options','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','OpenchannelInteraction','isNil','interaction','get','role','null','AcceptMessage'];(function(_0x45937f,_0x256a25){var _0x5bf5d1=function(_0x4300bd){while(--_0x4300bd){_0x45937f['push'](_0x45937f['shift']());}};_0x5bf5d1(++_0x256a25);}(_0x5c79,0x18c));var _0x95c7=function(_0x250ce7,_0x502ad3){_0x250ce7=_0x250ce7-0x0;var _0x416428=_0x5c79[_0x250ce7];return _0x416428;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95c7('0x0'));var zipdir=require(_0x95c7('0x1'));var jsonpatch=require(_0x95c7('0x2'));var rp=require('request-promise');var moment=require(_0x95c7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x95c7('0x4'));var sox=require(_0x95c7('0x5'));var csv=require(_0x95c7('0x6'));var ejs=require(_0x95c7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95c7('0x8'));var squel=require(_0x95c7('0x9'));var crypto=require(_0x95c7('0xa'));var jsforce=require(_0x95c7('0xb'));var deskjs=require(_0x95c7('0xc'));var toCsv=require(_0x95c7('0x6'));var querystring=require(_0x95c7('0xd'));var Papa=require(_0x95c7('0xe'));var Redis=require('ioredis');var authService=require(_0x95c7('0xf'));var qs=require(_0x95c7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95c7('0x11'));var logger=require(_0x95c7('0x12'))(_0x95c7('0x13'));var utils=require('../../config/utils');var config=require(_0x95c7('0x14'));var licenseUtil=require(_0x95c7('0x15'));var db=require('../../mysqldb')['db'];config[_0x95c7('0x16')]=_['defaults'](config['redis'],{'host':_0x95c7('0x17'),'port':0x18eb});var socket=require(_0x95c7('0x18'))(new Redis(config[_0x95c7('0x16')]));require(_0x95c7('0x19'))['register'](socket);var jayson=require(_0x95c7('0x1a'));var client=jayson[_0x95c7('0x1b')][_0x95c7('0x1c')]({'port':0x232c});var client9002=jayson[_0x95c7('0x1b')][_0x95c7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x48243a,_0x3e37a8,_0x563369,_0x493a6f){return new BPromise(function(_0x262796,_0x51721e){var _0x528840=_0x493a6f||client;return _0x528840['request'](_0x48243a,_0x563369)['then'](function(_0x23cacf){logger[_0x95c7('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e37a8,'request\x20sent');logger[_0x95c7('0x1e')](_0x95c7('0x1f'),_0x3e37a8,_0x95c7('0x20'),JSON[_0x95c7('0x21')](_0x23cacf));if(_0x23cacf['error']){if(_0x23cacf[_0x95c7('0x22')][_0x95c7('0x23')]===0x1f4){logger[_0x95c7('0x22')](_0x95c7('0x24'),_0x3e37a8,_0x23cacf[_0x95c7('0x22')][_0x95c7('0x25')]);return _0x51721e(_0x23cacf[_0x95c7('0x22')][_0x95c7('0x25')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3e37a8,_0x23cacf[_0x95c7('0x22')]['message']);return _0x262796(_0x23cacf[_0x95c7('0x22')][_0x95c7('0x25')]);}else{logger[_0x95c7('0x1d')](_0x95c7('0x24'),_0x3e37a8,_0x95c7('0x20'));_0x262796(_0x23cacf[_0x95c7('0x26')][_0x95c7('0x25')]);}})[_0x95c7('0x27')](function(_0x2dd2e9){logger[_0x95c7('0x22')](_0x95c7('0x24'),_0x3e37a8,_0x2dd2e9);_0x51721e(_0x2dd2e9);});});}function respondWithStatusCode(_0x577f95,_0x59e6a8){_0x59e6a8=_0x59e6a8||0xcc;return function(_0x5e7482){if(_0x5e7482){return _0x577f95[_0x95c7('0x28')](_0x59e6a8);}return _0x577f95[_0x95c7('0x29')](_0x59e6a8)[_0x95c7('0x2a')]();};}function respondWithResult(_0x2258de,_0x22100d){_0x22100d=_0x22100d||0xc8;return function(_0x515a44){if(_0x515a44){return _0x2258de[_0x95c7('0x29')](_0x22100d)['json'](_0x515a44);}};}function respondWithFilteredResult(_0x49bf3c,_0x3457b2){return function(_0x3a262f){if(_0x3a262f){var _0x2e2e6d=typeof _0x3457b2[_0x95c7('0x2b')]==='undefined'&&typeof _0x3457b2[_0x95c7('0x2c')]==='undefined';var _0x8ca00c=_0x3a262f[_0x95c7('0x2d')];var _0x4f7a08=_0x2e2e6d?0x0:_0x3457b2[_0x95c7('0x2b')];var _0x366470=_0x2e2e6d?_0x3a262f[_0x95c7('0x2d')]:_0x3457b2[_0x95c7('0x2b')]+_0x3457b2['limit'];var _0x11b8db;if(_0x366470>=_0x8ca00c){_0x366470=_0x8ca00c;_0x11b8db=0xc8;}else{_0x11b8db=0xce;}_0x49bf3c[_0x95c7('0x29')](_0x11b8db);return _0x49bf3c[_0x95c7('0x2e')](_0x95c7('0x2f'),_0x4f7a08+'-'+_0x366470+'/'+_0x8ca00c)['json'](_0x3a262f);}return null;};}function patchUpdates(_0xbe7d54){return function(_0xe6e632){try{jsonpatch[_0x95c7('0x30')](_0xe6e632,_0xbe7d54,!![]);}catch(_0x1fb692){return BPromise[_0x95c7('0x31')](_0x1fb692);}return _0xe6e632['save']();};}function saveUpdates(_0x2c1c69,_0x4b5ca2){return function(_0x12b59d){if(_0x12b59d){return _0x12b59d[_0x95c7('0x32')](_0x2c1c69)[_0x95c7('0x33')](function(_0x13002e){return _0x13002e;});}return null;};}function removeEntity(_0x20120f,_0x137e4e){return function(_0x480e69){if(_0x480e69){return _0x480e69[_0x95c7('0x34')]()[_0x95c7('0x33')](function(){_0x20120f['status'](0xcc)[_0x95c7('0x2a')]();});}};}function handleEntityNotFound(_0x1af776,_0x4b85b3){return function(_0xe283df){if(!_0xe283df){_0x1af776[_0x95c7('0x28')](0x194);}return _0xe283df;};}function handleError(_0x35e73c,_0x34d99d){_0x34d99d=_0x34d99d||0x1f4;return function(_0x1f8b53){logger[_0x95c7('0x22')](_0x1f8b53[_0x95c7('0x35')]);if(_0x1f8b53[_0x95c7('0x36')]){delete _0x1f8b53[_0x95c7('0x36')];}_0x35e73c[_0x95c7('0x29')](_0x34d99d)['send'](_0x1f8b53);};}exports[_0x95c7('0x37')]=function(_0x2aa7ae,_0x4d7085){var _0x19e239={},_0x93a9e1={},_0x16cd54={'count':0x0,'rows':[]};var _0x36848f=_['map'](db[_0x95c7('0x38')][_0x95c7('0x39')],function(_0x37bfff){return{'name':_0x37bfff['fieldName'],'type':_0x37bfff[_0x95c7('0x3a')][_0x95c7('0x3b')]};});_0x93a9e1[_0x95c7('0x3c')]=_['map'](_0x36848f,_0x95c7('0x36'));_0x93a9e1['query']=_[_0x95c7('0x3d')](_0x2aa7ae[_0x95c7('0x3e')]);_0x93a9e1[_0x95c7('0x3f')]=_[_0x95c7('0x40')](_0x93a9e1[_0x95c7('0x3c')],_0x93a9e1[_0x95c7('0x3e')]);_0x19e239[_0x95c7('0x41')]=_[_0x95c7('0x40')](_0x93a9e1[_0x95c7('0x3c')],qs[_0x95c7('0x42')](_0x2aa7ae['query']['fields']));_0x19e239[_0x95c7('0x41')]=_0x19e239[_0x95c7('0x41')]['length']?_0x19e239[_0x95c7('0x41')]:_0x93a9e1['model'];if(!_0x2aa7ae[_0x95c7('0x3e')]['hasOwnProperty'](_0x95c7('0x43'))){_0x19e239[_0x95c7('0x2c')]=qs['limit'](_0x2aa7ae[_0x95c7('0x3e')]['limit']);_0x19e239[_0x95c7('0x2b')]=qs[_0x95c7('0x2b')](_0x2aa7ae['query'][_0x95c7('0x2b')]);}_0x19e239['order']=qs[_0x95c7('0x44')](_0x2aa7ae[_0x95c7('0x3e')][_0x95c7('0x44')]);_0x19e239[_0x95c7('0x45')]=qs[_0x95c7('0x3f')](_['pick'](_0x2aa7ae[_0x95c7('0x3e')],_0x93a9e1[_0x95c7('0x3f')]),_0x36848f);if(_0x2aa7ae[_0x95c7('0x3e')]['filter']){_0x19e239[_0x95c7('0x45')]=_['merge'](_0x19e239['where'],{'$or':_[_0x95c7('0x46')](_0x36848f,function(_0x162531){if(_0x162531[_0x95c7('0x3a')]!==_0x95c7('0x47')){var _0x430c64={};_0x430c64[_0x162531[_0x95c7('0x36')]]={'$like':'%'+_0x2aa7ae[_0x95c7('0x3e')][_0x95c7('0x48')]+'%'};return _0x430c64;}})});}_0x19e239=_[_0x95c7('0x49')]({},_0x19e239,_0x2aa7ae['options']);var _0xe63b18={'where':_0x19e239['where']};return db['OpenchannelMessage']['count'](_0xe63b18)[_0x95c7('0x33')](function(_0x1d3501){_0x16cd54['count']=_0x1d3501;if(_0x2aa7ae[_0x95c7('0x3e')][_0x95c7('0x4a')]){_0x19e239[_0x95c7('0x4b')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x95c7('0x4c')](_0x19e239);})[_0x95c7('0x33')](function(_0x13e4f8){_0x16cd54[_0x95c7('0x4d')]=_0x13e4f8;return _0x16cd54;})[_0x95c7('0x33')](respondWithFilteredResult(_0x4d7085,_0x19e239))[_0x95c7('0x27')](handleError(_0x4d7085,null));};exports[_0x95c7('0x4e')]=function(_0x5a38bb,_0x372424){var _0x5dc15a={'raw':!![],'where':{'id':_0x5a38bb[_0x95c7('0x4f')]['id']}},_0x3b1edc={};_0x3b1edc[_0x95c7('0x3c')]=_[_0x95c7('0x3d')](db['OpenchannelMessage'][_0x95c7('0x39')]);_0x3b1edc[_0x95c7('0x3e')]=_[_0x95c7('0x3d')](_0x5a38bb[_0x95c7('0x3e')]);_0x3b1edc['filters']=_[_0x95c7('0x40')](_0x3b1edc['model'],_0x3b1edc[_0x95c7('0x3e')]);_0x5dc15a[_0x95c7('0x41')]=_[_0x95c7('0x40')](_0x3b1edc[_0x95c7('0x3c')],qs[_0x95c7('0x42')](_0x5a38bb['query'][_0x95c7('0x42')]));_0x5dc15a['attributes']=_0x5dc15a[_0x95c7('0x41')][_0x95c7('0x50')]?_0x5dc15a[_0x95c7('0x41')]:_0x3b1edc[_0x95c7('0x3c')];if(_0x5a38bb[_0x95c7('0x3e')]['includeAll']){_0x5dc15a[_0x95c7('0x4b')]=[{'all':!![]}];}_0x5dc15a=_[_0x95c7('0x49')]({},_0x5dc15a,_0x5a38bb[_0x95c7('0x51')]);return db[_0x95c7('0x38')][_0x95c7('0x52')](_0x5dc15a)['then'](handleEntityNotFound(_0x372424,null))['then'](respondWithResult(_0x372424,null))[_0x95c7('0x27')](handleError(_0x372424,null));};exports[_0x95c7('0x53')]=function(_0x11b260,_0x4e99a1){return db['OpenchannelMessage'][_0x95c7('0x53')](_0x11b260[_0x95c7('0x54')],{})[_0x95c7('0x33')](respondWithResult(_0x4e99a1,0xc9))[_0x95c7('0x27')](handleError(_0x4e99a1,null));};exports['update']=function(_0x367672,_0x5204b8){if(_0x367672['body']['id']){delete _0x367672[_0x95c7('0x54')]['id'];}return db[_0x95c7('0x38')][_0x95c7('0x52')]({'where':{'id':_0x367672[_0x95c7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5204b8,null))['then'](saveUpdates(_0x367672['body'],null))[_0x95c7('0x33')](respondWithResult(_0x5204b8,null))[_0x95c7('0x27')](handleError(_0x5204b8,null));};exports['destroy']=function(_0x112f74,_0x1c2aea){return db[_0x95c7('0x38')][_0x95c7('0x52')]({'where':{'id':_0x112f74[_0x95c7('0x4f')]['id']}})[_0x95c7('0x33')](handleEntityNotFound(_0x1c2aea,null))[_0x95c7('0x33')](removeEntity(_0x1c2aea,null))[_0x95c7('0x27')](handleError(_0x1c2aea,null));};exports['describe']=function(_0x39db08,_0x118448){return db['OpenchannelMessage'][_0x95c7('0x55')]()['then'](respondWithResult(_0x118448,null))[_0x95c7('0x27')](handleError(_0x118448,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x95c7('0x56')]=function(_0x199e89,_0x3982e1,_0x39865f){var _0x564058={'agent':{},'channel':'openchannel'};if(_0x199e89[_0x95c7('0x54')]['id']){delete _0x199e89[_0x95c7('0x54')]['id'];}_0x199e89[_0x95c7('0x54')][_0x95c7('0x57')]=!![];_0x199e89[_0x95c7('0x54')][_0x95c7('0x58')]=moment()[_0x95c7('0x59')](_0x95c7('0x5a'));_0x199e89[_0x95c7('0x54')][_0x95c7('0x5b')]=_0x199e89[_0x95c7('0x54')][_0x95c7('0x5b')]||_0x199e89[_0x95c7('0x5c')]['id'];_0x564058['agent']['id']=_0x199e89[_0x95c7('0x54')][_0x95c7('0x5b')];return db[_0x95c7('0x38')][_0x95c7('0x52')]({'where':{'id':_0x199e89['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3982e1,null))[_0x95c7('0x33')](saveUpdates(_0x199e89[_0x95c7('0x54')],null))[_0x95c7('0x33')](function(_0x1f100d){if(_0x1f100d){_0x564058[_0x95c7('0x25')]=_0x1f100d['get']({'plain':!![]});return db[_0x95c7('0x5d')][_0x95c7('0x52')]({'where':{'id':_0x1f100d['OpenchannelInteractionId']}});}return null;})[_0x95c7('0x33')](handleEntityNotFound(_0x3982e1,null))[_0x95c7('0x33')](function(_0x2e6b5b){if(_0x2e6b5b){return _0x2e6b5b[_0x95c7('0x32')]({'UserId':_0x199e89[_0x95c7('0x54')][_0x95c7('0x5b')],'read1stAt':_[_0x95c7('0x5e')](_0x2e6b5b['read1stAt'])?moment()['format'](_0x95c7('0x5a')):undefined});}return null;})[_0x95c7('0x33')](function(_0x1ac80a){if(_0x1ac80a){_0x564058[_0x95c7('0x5f')]=_0x1ac80a[_0x95c7('0x60')]({'plain':!![]});interaction_log[_0x95c7('0x1d')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x199e89['user']['id'],_0x199e89[_0x95c7('0x5c')][_0x95c7('0x36')],_0x199e89['user'][_0x95c7('0x61')],_0x564058[_0x95c7('0x5f')]['id'],_0x199e89[_0x95c7('0x54')]?JSON[_0x95c7('0x21')](_0x199e89[_0x95c7('0x54')]):_0x95c7('0x62'));return respondWithRpcPromise(_0x95c7('0x63'),_0x95c7('0x64'),_0x564058);}return null;})[_0x95c7('0x33')](function(_0x36fa5b){var _0x16cc87=_0x95c7('0x65')+_0x36fa5b[_0x95c7('0x25')]['ContactId'];return db['sequelize']['query'](_0x16cc87,{'type':db[_0x95c7('0x66')]['QueryTypes'][_0x95c7('0x67')],'raw':!![]})[_0x95c7('0x33')](function(_0x3669bc){return _0x3669bc;});})[_0x95c7('0x33')](function(_0xd0f4ce){if(_0xd0f4ce){_0x564058[_0x95c7('0x25')][_0x95c7('0x68')]=_0xd0f4ce[0x0];if(!_0x199e89['body'][_0x95c7('0x5b')])return;return db[_0x95c7('0x69')][_0x95c7('0x52')]({'where':{'id':_0x199e89['body']['UserId'],'role':_0x95c7('0x6a')},'attributes':['id',_0x95c7('0x36'),_0x95c7('0x6b'),_0x95c7('0x6c'),'internal'],'raw':!![]});}return null;})[_0x95c7('0x33')](function(_0x5a4d1f){if(!_0x5a4d1f)return null;_0x564058[_0x95c7('0x25')]['agent']=_0x5a4d1f;return _0x564058;})[_0x95c7('0x33')](function(_0x13f637){if(_0x13f637){if(_0x199e89[_0x95c7('0x54')]['manual']){_0x564058[_0x95c7('0x25')][_0x95c7('0x6d')]=util[_0x95c7('0x59')](_0x95c7('0x6e'),_0x199e89[_0x95c7('0x5c')][_0x95c7('0x36')]);_0x564058['message'][_0x95c7('0x6f')]=_0x564058[_0x95c7('0x6f')];_0x564058[_0x95c7('0x25')][_0x95c7('0x70')]=_0x564058[_0x95c7('0x6f')];_0x564058['message']['event']='accept';return respondWithRpcPromise(_0x95c7('0x71'),_0x95c7('0x71'),{'event':'acceptmessage','message':_0x564058[_0x95c7('0x25')]},client9002)[_0x95c7('0x33')](function(){return _0x564058;});}return _0x564058;}return null;})['then'](respondWithResult(_0x3982e1,null))['catch'](handleError(_0x3982e1,null));};var interaction_log=require('../../config/logger')(_0x95c7('0x72'));exports['reject']=function(_0xe94685,_0x332d39,_0x3be98e){var _0x1913e4={'agent':{},'channel':_0x95c7('0x73')};if(_0xe94685[_0x95c7('0x54')]['id']){delete _0xe94685[_0x95c7('0x54')]['id'];}_0xe94685[_0x95c7('0x54')][_0x95c7('0x5b')]=_0xe94685[_0x95c7('0x54')][_0x95c7('0x5b')]||_0xe94685[_0x95c7('0x5c')]['id'];_0x1913e4['agent']['id']=_0xe94685[_0x95c7('0x54')][_0x95c7('0x5b')];return db['OpenchannelMessage']['find']({'where':{'id':_0xe94685[_0x95c7('0x4f')]['id'],'UserId':null}})[_0x95c7('0x33')](handleEntityNotFound(_0x332d39,null))[_0x95c7('0x33')](function(_0x1174b1){if(_0x1174b1){_0x1913e4[_0x95c7('0x25')]=_0x1174b1[_0x95c7('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0x95c7('0x52')]({'where':{'id':_0x1174b1[_0x95c7('0x74')]}});}return null;})['then'](handleEntityNotFound(_0x332d39,null))[_0x95c7('0x33')](function(_0xacf6ac){if(_0xacf6ac){_0x1913e4[_0x95c7('0x5f')]=_0xacf6ac[_0x95c7('0x60')]({'plain':!![]});interaction_log[_0x95c7('0x1d')](_0x95c7('0x75'),_0xe94685[_0x95c7('0x5c')]['id'],_0xe94685[_0x95c7('0x5c')]['name'],_0xe94685['user'][_0x95c7('0x61')],_0x1913e4[_0x95c7('0x5f')]['id'],_0xe94685[_0x95c7('0x54')]?JSON[_0x95c7('0x21')](_0xe94685['body']):_0x95c7('0x62'));return respondWithRpcPromise('RejectMessage',_0x95c7('0x76'),_0x1913e4);}return null;})[_0x95c7('0x33')](function(_0x58b38d){var _0x38b1a8=_0x95c7('0x65')+_0x58b38d[_0x95c7('0x25')][_0x95c7('0x77')];return db['sequelize'][_0x95c7('0x3e')](_0x38b1a8,{'type':db[_0x95c7('0x66')][_0x95c7('0x78')][_0x95c7('0x67')],'raw':!![]})[_0x95c7('0x33')](function(_0x2071b3){return _0x2071b3;});})['then'](function(_0x459ac3){if(_0x459ac3){_0x1913e4[_0x95c7('0x25')][_0x95c7('0x68')]=_0x459ac3[0x0];if(!_0xe94685['body']['UserId'])return;return db[_0x95c7('0x69')][_0x95c7('0x52')]({'where':{'id':_0xe94685['body'][_0x95c7('0x5b')],'role':'agent'},'attributes':['id',_0x95c7('0x36'),_0x95c7('0x6b'),'email',_0x95c7('0x79')],'raw':!![]});}return null;})[_0x95c7('0x33')](function(_0x400876){if(!_0x400876)return null;_0x1913e4[_0x95c7('0x25')][_0x95c7('0x6a')]=_0x400876;return _0x1913e4;})[_0x95c7('0x33')](function(_0x453e90){if(_0x453e90){_0x453e90[_0x95c7('0x25')][_0x95c7('0x6d')]=util['format'](_0x95c7('0x6e'),_0xe94685['user'][_0x95c7('0x36')]);_0x453e90[_0x95c7('0x25')][_0x95c7('0x6f')]=_0x1913e4['channel'];_0x453e90[_0x95c7('0x25')][_0x95c7('0x70')]=_0x1913e4[_0x95c7('0x6f')];_0x453e90[_0x95c7('0x25')][_0x95c7('0x7a')]=_0x95c7('0x31');respondWithRpcPromise(_0x95c7('0x71'),_0x95c7('0x71'),{'event':_0x95c7('0x7b'),'message':_0x453e90[_0x95c7('0x25')]},client9002);return _0x1913e4;}return null;})['then'](respondWithResult(_0x332d39,null))[_0x95c7('0x27')](handleError(_0x332d39,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 47bfe31..54c22e4 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 _0x1885=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelMessage'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x1885,0x15d));var _0x5188=function(_0x3e3edf,_0x146094){_0x3e3edf=_0x3e3edf-0x0;var _0x10dc2a=_0x1885[_0x3e3edf];return _0x10dc2a;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x5188('0x0'))['db'][_0x5188('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5188('0x2')](0x0);var events={'afterCreate':_0x5188('0x3'),'afterUpdate':_0x5188('0x4'),'afterDestroy':_0x5188('0x5')};function emitEvent(_0x67b0ac){return function(_0x5db661,_0x10f72f,_0x46527f){OpenchannelMessageEvents[_0x5188('0x6')](_0x67b0ac+':'+_0x5db661['id'],_0x5db661);OpenchannelMessageEvents['emit'](_0x67b0ac,_0x5db661);_0x46527f(null);};}for(var e in events){if(events[_0x5188('0x7')](e)){var event=events[e];OpenchannelMessage[_0x5188('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x748c=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x10385f,_0x1f7083){var _0xa48457=function(_0x5dceba){while(--_0x5dceba){_0x10385f['push'](_0x10385f['shift']());}};_0xa48457(++_0x1f7083);}(_0x748c,0x150));var _0xc748=function(_0x2cd1e8,_0x37f555){_0x2cd1e8=_0x2cd1e8-0x0;var _0x1b8ef1=_0x748c[_0x2cd1e8];return _0x1b8ef1;};'use strict';var EventEmitter=require(_0xc748('0x0'));var OpenchannelMessage=require(_0xc748('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc748('0x2'),'afterUpdate':_0xc748('0x3'),'afterDestroy':_0xc748('0x4')};function emitEvent(_0x1da203){return function(_0xe40ee9,_0xf78c6e,_0x1095b7){OpenchannelMessageEvents[_0xc748('0x5')](_0x1da203+':'+_0xe40ee9['id'],_0xe40ee9);OpenchannelMessageEvents['emit'](_0x1da203,_0xe40ee9);_0x1095b7(null);};}for(var e in events){if(events[_0xc748('0x6')](e)){var event=events[e];OpenchannelMessage[_0xc748('0x7')](e,emitEvent(event));}}module[_0xc748('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 0aada0e..56063bf 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 _0x45ae=['toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','catch','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','CmContact','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','openchannel_messages','fti_openchannel_messages','body','models','get','direction'];(function(_0xfd700f,_0xa53af5){var _0x42344e=function(_0x3c30c6){while(--_0x3c30c6){_0xfd700f['push'](_0xfd700f['shift']());}};_0x42344e(++_0xa53af5);}(_0x45ae,0x1eb));var _0xe45a=function(_0x204047,_0x11bc27){_0x204047=_0x204047-0x0;var _0x3408f5=_0x45ae[_0x204047];return _0x3408f5;};'use strict';var _=require('lodash');var util=require(_0xe45a('0x0'));var logger=require(_0xe45a('0x1'))(_0xe45a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe45a('0x3'));var fs=require('fs');var path=require(_0xe45a('0x4'));var rimraf=require(_0xe45a('0x5'));var config=require(_0xe45a('0x6'));var attributes=require(_0xe45a('0x7'));module[_0xe45a('0x8')]=function(_0x4d70c8,_0x2b5d7e){return _0x4d70c8['define']('OpenchannelMessage',attributes,{'tableName':_0xe45a('0x9'),'paranoid':![],'indexes':[{'name':_0xe45a('0xa'),'fields':[_0xe45a('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b91bd,_0x2df66a,_0x2c408b){var _0x35ef7a=_0x4d70c8[_0xe45a('0xc')];var _0x4d4621=_0x4b91bd[_0xe45a('0xd')]({'plain':!![]});if(_0x4d4621[_0xe45a('0xe')][_0xe45a('0xf')]()==='in'||_0x4d4621[_0xe45a('0xe')][_0xe45a('0xf')]()===_0xe45a('0x10')&&!_0x4d4621[_0xe45a('0x11')]&&!_[_0xe45a('0x12')](_0x4d4621[_0xe45a('0x13')])){_0x35ef7a[_0xe45a('0x14')]['findOne']({'where':{'id':_0x4d4621[_0xe45a('0x15')]}})[_0xe45a('0x16')](function(_0x2bf712){if(_0x2bf712){_0x2bf712[_0xe45a('0x17')]({'lastMsgAt':_0x4d4621['createdAt'],'lastMsgDirection':_0x4d4621[_0xe45a('0xe')][_0xe45a('0xf')]()});}})[_0xe45a('0x18')](function(_0x138eb8){console['error'](_0x138eb8);});}if(_0x4d4621[_0xe45a('0xe')]===_0xe45a('0x10')&&!_0x4d4621[_0xe45a('0x11')]){var _0x51ff62;_0x35ef7a['CmContact'][_0xe45a('0x19')]()[_0xe45a('0x16')](function(_0x2f6fc3){return _0x35ef7a[_0xe45a('0x1a')]['find']({'where':{'id':_0x4d4621[_0xe45a('0x1b')]},'include':[{'model':_0x35ef7a['OpenchannelInteraction'],'as':_0xe45a('0x1c'),'where':{'id':_0x4d4621[_0xe45a('0x15')]},'limit':0x1,'include':[{'model':_0x35ef7a[_0xe45a('0x1d')],'as':_0xe45a('0x1e'),'attributes':_[_0xe45a('0x1f')](_0x2f6fc3)}]}]});})[_0xe45a('0x16')](function(_0xb0360a){_0x51ff62=_0xb0360a['get']({'plain':!![]});if(_0x51ff62&&_0x51ff62[_0xe45a('0x20')]){logger['info'](_0xe45a('0x21'),_0xe45a('0x22'),util[_0xe45a('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x4d4621['id'],_0x51ff62[_0xe45a('0x20')]));if(_0x51ff62[_0xe45a('0x1c')]&&_0x51ff62[_0xe45a('0x1c')][_0xe45a('0x24')]){_0x4d4621[_0xe45a('0x25')]=_['omit'](_0x51ff62['Interactions'][0x0],_0xe45a('0x1e'));_0x4d4621[_0xe45a('0x1e')]=_0x51ff62['Interactions'][0x0][_0xe45a('0x1e')];}var _0x2df66a={'method':_0xe45a('0x26'),'uri':encodeURI(_0x51ff62[_0xe45a('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2df66a[_0xe45a('0x27')]){case _0xe45a('0x28'):_0x2df66a['qs']=_0x4d4621;break;case _0xe45a('0x26'):_0x2df66a[_0xe45a('0xb')]=_0x4d4621;break;}return rp(_0x2df66a)['then'](function(_0x4aef71){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xe45a('0x22'),util[_0xe45a('0x23')](_0xe45a('0x29'),_0x4d4621['id'],_0x51ff62[_0xe45a('0x20')]));if(_0x4aef71['body'][_0xe45a('0x2a')]&&_0x4aef71[_0xe45a('0xb')][_0xe45a('0x2a')]!=_0x4d4621[_0xe45a('0x25')][_0xe45a('0x2a')]){return _0x35ef7a['OpenchannelInteraction'][_0xe45a('0x17')]({'threadId':_0x4aef71[_0xe45a('0xb')][_0xe45a('0x2a')]},{'where':{'id':_0x4d4621['Interaction']['id']}});}else{return;}})['then'](function(){return _0x4b91bd[_0xe45a('0x17')]({'read':!![]});})[_0xe45a('0x18')](function(_0x2724b7){logger[_0xe45a('0x2b')](_0xe45a('0x21'),_0xe45a('0x22'),util[_0xe45a('0x2c')](_0x2724b7,{'showHidden':![],'depth':null}));_0x2c408b();});}else{_0x2c408b();}})['finally'](function(){_0x2c408b();});}else{_0x2c408b();}}},'charset':'utf8mb4','collate':_0xe45a('0x2d')});}; \ No newline at end of file +var _0xaf86=['../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','toLowerCase','direction','secret','UserId','findOne','then','update','catch','out','CmContact','describe','OpenchannelAccount','find','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Interaction','POST','method','GET','afterCreate','threadId','OpenchannelInteraction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x268263,_0x5eb5b3){var _0x4629d1=function(_0x344140){while(--_0x344140){_0x268263['push'](_0x268263['shift']());}};_0x4629d1(++_0x5eb5b3);}(_0xaf86,0x178));var _0x6af8=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0xaf86[_0x3f3f40];return _0x403b7a;};'use strict';var _=require(_0x6af8('0x0'));var util=require(_0x6af8('0x1'));var logger=require(_0x6af8('0x2'))(_0x6af8('0x3'));var moment=require(_0x6af8('0x4'));var BPromise=require(_0x6af8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6af8('0x6'));var rimraf=require(_0x6af8('0x7'));var config=require(_0x6af8('0x8'));var attributes=require(_0x6af8('0x9'));module['exports']=function(_0x12b17b,_0x54a6fd){return _0x12b17b['define'](_0x6af8('0xa'),attributes,{'tableName':_0x6af8('0xb'),'paranoid':![],'indexes':[{'name':_0x6af8('0xc'),'fields':[_0x6af8('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cfca2,_0x2d7e19,_0x42f73c){var _0x1b1666=_0x12b17b[_0x6af8('0xe')];var _0x39cd57=_0x5cfca2[_0x6af8('0xf')]({'plain':!![]});if(_0x39cd57['direction'][_0x6af8('0x10')]()==='in'||_0x39cd57[_0x6af8('0x11')]['toLowerCase']()==='out'&&!_0x39cd57[_0x6af8('0x12')]&&!_['isNil'](_0x39cd57[_0x6af8('0x13')])){_0x1b1666['OpenchannelInteraction'][_0x6af8('0x14')]({'where':{'id':_0x39cd57['OpenchannelInteractionId']}})[_0x6af8('0x15')](function(_0x30ce8c){if(_0x30ce8c){_0x30ce8c[_0x6af8('0x16')]({'lastMsgAt':_0x39cd57['createdAt'],'lastMsgDirection':_0x39cd57[_0x6af8('0x11')][_0x6af8('0x10')]()});}})[_0x6af8('0x17')](function(_0xb68c48){console['error'](_0xb68c48);});}if(_0x39cd57[_0x6af8('0x11')]===_0x6af8('0x18')&&!_0x39cd57['secret']){var _0xede0d9;_0x1b1666[_0x6af8('0x19')][_0x6af8('0x1a')]()[_0x6af8('0x15')](function(_0x5bdc76){return _0x1b1666[_0x6af8('0x1b')][_0x6af8('0x1c')]({'where':{'id':_0x39cd57['OpenchannelAccountId']},'include':[{'model':_0x1b1666['OpenchannelInteraction'],'as':_0x6af8('0x1d'),'where':{'id':_0x39cd57[_0x6af8('0x1e')]},'limit':0x1,'include':[{'model':_0x1b1666[_0x6af8('0x19')],'as':_0x6af8('0x1f'),'attributes':_[_0x6af8('0x20')](_0x5bdc76)}]}]});})[_0x6af8('0x15')](function(_0x11c724){_0xede0d9=_0x11c724[_0x6af8('0xf')]({'plain':!![]});if(_0xede0d9&&_0xede0d9[_0x6af8('0x21')]){logger[_0x6af8('0x22')](_0x6af8('0x23'),'afterCreate',util[_0x6af8('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x39cd57['id'],_0xede0d9[_0x6af8('0x21')]));if(_0xede0d9[_0x6af8('0x1d')]&&_0xede0d9[_0x6af8('0x1d')]['length']){_0x39cd57[_0x6af8('0x25')]=_['omit'](_0xede0d9['Interactions'][0x0],'Contact');_0x39cd57[_0x6af8('0x1f')]=_0xede0d9['Interactions'][0x0][_0x6af8('0x1f')];}var _0x2d7e19={'method':_0x6af8('0x26'),'uri':encodeURI(_0xede0d9[_0x6af8('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2d7e19[_0x6af8('0x27')]){case _0x6af8('0x28'):_0x2d7e19['qs']=_0x39cd57;break;case _0x6af8('0x26'):_0x2d7e19[_0x6af8('0xd')]=_0x39cd57;break;}return rp(_0x2d7e19)[_0x6af8('0x15')](function(_0x2341ad){logger[_0x6af8('0x22')](_0x6af8('0x23'),_0x6af8('0x29'),util[_0x6af8('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x39cd57['id'],_0xede0d9[_0x6af8('0x21')]));if(_0x2341ad[_0x6af8('0xd')]['threadId']&&_0x2341ad[_0x6af8('0xd')]['threadId']!=_0x39cd57[_0x6af8('0x25')][_0x6af8('0x2a')]){return _0x1b1666[_0x6af8('0x2b')][_0x6af8('0x16')]({'threadId':_0x2341ad['body']['threadId']},{'where':{'id':_0x39cd57[_0x6af8('0x25')]['id']}});}else{return;}})[_0x6af8('0x15')](function(){return _0x5cfca2['update']({'read':!![]});})['catch'](function(_0x58ec0b){logger['error'](_0x6af8('0x23'),_0x6af8('0x29'),util[_0x6af8('0x2c')](_0x58ec0b,{'showHidden':![],'depth':null}));_0x42f73c();});}else{_0x42f73c();}})[_0x6af8('0x2d')](function(){_0x42f73c();});}else{_0x42f73c();}}},'charset':_0x6af8('0x2e'),'collate':_0x6af8('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 80b5b92..fedd3a9 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 _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x5aa00e,_0x99cd93){var _0xf69379=function(_0x3a5fbf){while(--_0x3a5fbf){_0x5aa00e['push'](_0x5aa00e['shift']());}};_0xf69379(++_0x99cd93);}(_0xadb5,0xad));var _0x5adb=function(_0x196040,_0x2429a3){_0x196040=_0x196040-0x0;var _0x13a713=_0xadb5[_0x196040];return _0x13a713;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x86f304,_0x5f3f5f){var _0xac005=function(_0x3eb277){while(--_0x3eb277){_0x86f304['push'](_0x86f304['shift']());}};_0xac005(++_0x5f3f5f);}(_0x7a54,0x106));var _0x47a5=function(_0x4771e0,_0xdf6cc3){_0x4771e0=_0x4771e0-0x0;var _0x4a1d91=_0x7a54[_0x4771e0];return _0x4a1d91;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 9840c12..22acca5 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 _0x0e26=['removeListener','length','openchannelMessage:','save','remove','emit'];(function(_0x55d7c2,_0x4ce6fb){var _0x1755ef=function(_0xddc25c){while(--_0xddc25c){_0x55d7c2['push'](_0x55d7c2['shift']());}};_0x1755ef(++_0x4ce6fb);}(_0x0e26,0x19b));var _0x60e2=function(_0x4496ae,_0x2e1282){_0x4496ae=_0x4496ae-0x0;var _0x3defd9=_0x0e26[_0x4496ae];return _0x3defd9;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x60e2('0x0'),_0x60e2('0x1'),'update'];function createListener(_0x10e9b3,_0x2eb9c3){return function(_0x2cca54){_0x2eb9c3[_0x60e2('0x2')](_0x10e9b3,_0x2cca54);};}function removeListener(_0x431bba,_0x2c63c0){return function(){OpenchannelMessageEvents[_0x60e2('0x3')](_0x431bba,_0x2c63c0);};}exports['register']=function(_0x3fc7fb){for(var _0x35393b=0x0,_0x36e315=events[_0x60e2('0x4')];_0x35393b<_0x36e315;_0x35393b++){var _0x110845=events[_0x35393b];var _0x2e1583=createListener(_0x60e2('0x5')+_0x110845,_0x3fc7fb);OpenchannelMessageEvents['on'](_0x110845,_0x2e1583);}}; \ No newline at end of file +var _0x0dd6=['removeListener','openchannelMessage:','remove','update','emit'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x0dd6,0xca));var _0x60dd=function(_0x589968,_0x2f6b12){_0x589968=_0x589968-0x0;var _0x34884b=_0x0dd6[_0x589968];return _0x34884b;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x60dd('0x0'),_0x60dd('0x1')];function createListener(_0x292e8,_0x200bcf){return function(_0x1cf933){_0x200bcf[_0x60dd('0x2')](_0x292e8,_0x1cf933);};}function removeListener(_0x8fc15c,_0x684bfa){return function(){OpenchannelMessageEvents[_0x60dd('0x3')](_0x8fc15c,_0x684bfa);};}exports['register']=function(_0x1c8c4e){for(var _0x4875cb=0x0,_0x87ab7=events['length'];_0x4875cb<_0x87ab7;_0x4875cb++){var _0x30543f=events[_0x4875cb];var _0x407a6c=createListener(_0x60dd('0x4')+_0x30543f,_0x1c8c4e);OpenchannelMessageEvents['on'](_0x30543f,_0x407a6c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 4bfb095..c3c9981 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 _0x2902=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','delete','removeAgents'];(function(_0x3783ca,_0x4969fd){var _0x5f455e=function(_0x1670c6){while(--_0x1670c6){_0x3783ca['push'](_0x3783ca['shift']());}};_0x5f455e(++_0x4969fd);}(_0x2902,0xa3));var _0x2290=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0x2902[_0x33c603];return _0xae96f4;};'use strict';var multer=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var path=require(_0x2290('0x2'));var timeout=require(_0x2290('0x3'));var express=require(_0x2290('0x4'));var router=express[_0x2290('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2290('0x6'));var interaction=require(_0x2290('0x7'));var config=require(_0x2290('0x8'));var controller=require(_0x2290('0x9'));router[_0x2290('0xa')]('/',auth[_0x2290('0xb')](),controller[_0x2290('0xc')]);router[_0x2290('0xa')](_0x2290('0xd'),auth[_0x2290('0xb')](),controller['describe']);router[_0x2290('0xa')](_0x2290('0xe'),auth[_0x2290('0xb')](),controller['show']);router[_0x2290('0xa')](_0x2290('0xf'),auth[_0x2290('0xb')](),controller[_0x2290('0x10')]);router[_0x2290('0xa')](_0x2290('0x11'),auth[_0x2290('0xb')](),controller[_0x2290('0x12')]);router[_0x2290('0xa')](_0x2290('0x13'),auth[_0x2290('0xb')](),controller['getAgents']);router[_0x2290('0x14')]('/',auth[_0x2290('0xb')](),controller[_0x2290('0x15')]);router[_0x2290('0x14')](_0x2290('0x11'),auth[_0x2290('0xb')](),controller[_0x2290('0x16')]);router[_0x2290('0x14')](_0x2290('0x13'),auth[_0x2290('0xb')](),controller[_0x2290('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2290('0x18')](_0x2290('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x2290('0x18')]('/:id/teams',auth[_0x2290('0xb')](),controller['removeTeams']);router[_0x2290('0x18')](_0x2290('0x13'),auth[_0x2290('0xb')](),controller[_0x2290('0x19')]);module[_0x2290('0x1a')]=router; \ No newline at end of file +var _0xfcd2=['getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x1009e2,_0x51a70f){var _0xf326d1=function(_0x116544){while(--_0x116544){_0x1009e2['push'](_0x1009e2['shift']());}};_0xf326d1(++_0x51a70f);}(_0xfcd2,0xfc));var _0x2fcd=function(_0x4fa75b,_0x2a7deb){_0x4fa75b=_0x4fa75b-0x0;var _0xb6fe47=_0xfcd2[_0x4fa75b];return _0xb6fe47;};'use strict';var multer=require(_0x2fcd('0x0'));var util=require('util');var path=require(_0x2fcd('0x1'));var timeout=require(_0x2fcd('0x2'));var express=require(_0x2fcd('0x3'));var router=express['Router']();var fs_extra=require(_0x2fcd('0x4'));var auth=require(_0x2fcd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2fcd('0x6'));var controller=require(_0x2fcd('0x7'));router[_0x2fcd('0x8')]('/',auth[_0x2fcd('0x9')](),controller[_0x2fcd('0xa')]);router[_0x2fcd('0x8')](_0x2fcd('0xb'),auth['isAuthenticated'](),controller[_0x2fcd('0xc')]);router[_0x2fcd('0x8')](_0x2fcd('0xd'),auth[_0x2fcd('0x9')](),controller[_0x2fcd('0xe')]);router[_0x2fcd('0x8')](_0x2fcd('0xf'),auth[_0x2fcd('0x9')](),controller[_0x2fcd('0x10')]);router[_0x2fcd('0x8')](_0x2fcd('0x11'),auth['isAuthenticated'](),controller[_0x2fcd('0x12')]);router[_0x2fcd('0x8')](_0x2fcd('0x13'),auth[_0x2fcd('0x9')](),controller['getAgents']);router[_0x2fcd('0x14')]('/',auth[_0x2fcd('0x9')](),controller[_0x2fcd('0x15')]);router[_0x2fcd('0x14')](_0x2fcd('0x11'),auth[_0x2fcd('0x9')](),controller[_0x2fcd('0x16')]);router[_0x2fcd('0x14')](_0x2fcd('0x13'),auth[_0x2fcd('0x9')](),controller[_0x2fcd('0x17')]);router[_0x2fcd('0x18')](_0x2fcd('0xd'),auth[_0x2fcd('0x9')](),controller[_0x2fcd('0x19')]);router['delete'](_0x2fcd('0xd'),auth[_0x2fcd('0x9')](),controller[_0x2fcd('0x1a')]);router[_0x2fcd('0x1b')](_0x2fcd('0x11'),auth[_0x2fcd('0x9')](),controller[_0x2fcd('0x1c')]);router['delete']('/:id/users',auth[_0x2fcd('0x9')](),controller['removeAgents']);module[_0x2fcd('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 808d334..50b5acc 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 _0x66e7=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x45aeff,_0x4609d2){var _0x2ffc3c=function(_0x3a41ea){while(--_0x3a41ea){_0x45aeff['push'](_0x45aeff['shift']());}};_0x2ffc3c(++_0x4609d2);}(_0x66e7,0x90));var _0x766e=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x66e7[_0x2b91c5];return _0xbd5531;};'use strict';var Sequelize=require('sequelize');module[_0x766e('0x0')]={'name':{'type':Sequelize[_0x766e('0x1')],'unique':_0x766e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x766e('0x1')]},'timeout':{'type':Sequelize[_0x766e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x766e('0x4')](_0x766e('0x5'),_0x766e('0x6'),_0x766e('0x7'))}}; \ No newline at end of file +var _0x7f5e=['name','INTEGER','ENUM','exports','STRING'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7f5e,0xb7));var _0xe7f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f5e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xe7f5('0x0')]={'name':{'type':Sequelize[_0xe7f5('0x1')],'unique':_0xe7f5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe7f5('0x1')]},'timeout':{'type':Sequelize[_0xe7f5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe7f5('0x4')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 84e3833..d2a3a79 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 _0x1f45=['apply','reject','save','update','then','destroy','get','OpenchannelQueues','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','OpenchannelQueue','includeAll','include','rows','catch','show','params','length','merge','find','body','role','user','UserProfileResource','create','describe','getMembers','findOne','UserOpenchannelQueue','order','OpenchannelQueueId','findAndCountAll','agent','updatedAt','createdAt','SIP','openchannelPause','hasOwnProperty','getTeams','addTeams','ids','findAll','User','online','voicePause','interface','flatMap','Agents','transaction','userOpenchannelQueue:save','removeTeams','Team','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','omit','spread','emit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x273ace,_0x3b28bc){var _0x5a5548=function(_0x2d2aaf){while(--_0x2d2aaf){_0x273ace['push'](_0x273ace['shift']());}};_0x5a5548(++_0x3b28bc);}(_0x1f45,0x64));var _0x51f4=function(_0x313513,_0x1c30b4){_0x313513=_0x313513-0x0;var _0x1c96c9=_0x1f45[_0x313513];return _0x1c96c9;};'use strict';var emlformat=require(_0x51f4('0x0'));var rimraf=require(_0x51f4('0x1'));var zipdir=require(_0x51f4('0x2'));var jsonpatch=require(_0x51f4('0x3'));var rp=require('request-promise');var moment=require(_0x51f4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51f4('0x5'));var util=require('util');var path=require(_0x51f4('0x6'));var sox=require(_0x51f4('0x7'));var csv=require('to-csv');var ejs=require(_0x51f4('0x8'));var fs=require('fs');var fs_extra=require(_0x51f4('0x9'));var _=require('lodash');var squel=require(_0x51f4('0xa'));var crypto=require(_0x51f4('0xb'));var jsforce=require(_0x51f4('0xc'));var deskjs=require(_0x51f4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x51f4('0xe'));var Papa=require(_0x51f4('0xf'));var Redis=require(_0x51f4('0x10'));var authService=require(_0x51f4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x51f4('0x12'));var hardwareService=require(_0x51f4('0x13'));var logger=require(_0x51f4('0x14'))(_0x51f4('0x15'));var utils=require(_0x51f4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x51f4('0x17'));var db=require(_0x51f4('0x18'))['db'];config[_0x51f4('0x19')]=_['defaults'](config['redis'],{'host':_0x51f4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51f4('0x19')]));require(_0x51f4('0x1b'))[_0x51f4('0x1c')](socket);function respondWithStatusCode(_0x362635,_0x136af1){_0x136af1=_0x136af1||0xcc;return function(_0x2e9665){if(_0x2e9665){return _0x362635[_0x51f4('0x1d')](_0x136af1);}return _0x362635[_0x51f4('0x1e')](_0x136af1)[_0x51f4('0x1f')]();};}function respondWithResult(_0x4bcbd2,_0x27340f){_0x27340f=_0x27340f||0xc8;return function(_0x4f34a8){if(_0x4f34a8){return _0x4bcbd2[_0x51f4('0x1e')](_0x27340f)[_0x51f4('0x20')](_0x4f34a8);}};}function respondWithFilteredResult(_0x30787e,_0x2fcff6){return function(_0x50409c){if(_0x50409c){var _0x432033=typeof _0x2fcff6['offset']===_0x51f4('0x21')&&typeof _0x2fcff6[_0x51f4('0x22')]==='undefined';var _0x4c1420=_0x50409c[_0x51f4('0x23')];var _0x803238=_0x432033?0x0:_0x2fcff6[_0x51f4('0x24')];var _0x48c925=_0x432033?_0x50409c[_0x51f4('0x23')]:_0x2fcff6[_0x51f4('0x24')]+_0x2fcff6[_0x51f4('0x22')];var _0x3a5ecb;if(_0x48c925>=_0x4c1420){_0x48c925=_0x4c1420;_0x3a5ecb=0xc8;}else{_0x3a5ecb=0xce;}_0x30787e[_0x51f4('0x1e')](_0x3a5ecb);return _0x30787e[_0x51f4('0x25')](_0x51f4('0x26'),_0x803238+'-'+_0x48c925+'/'+_0x4c1420)[_0x51f4('0x20')](_0x50409c);}return null;};}function patchUpdates(_0xec7b59){return function(_0x3da675){try{jsonpatch[_0x51f4('0x27')](_0x3da675,_0xec7b59,!![]);}catch(_0x47a4b0){return BPromise[_0x51f4('0x28')](_0x47a4b0);}return _0x3da675[_0x51f4('0x29')]();};}function saveUpdates(_0x524a75,_0x4bab6a){return function(_0x26984d){if(_0x26984d){return _0x26984d[_0x51f4('0x2a')](_0x524a75)[_0x51f4('0x2b')](function(_0x51e60c){return _0x51e60c;});}return null;};}function removeEntity(_0x4a6b88,_0x3888fa){return function(_0x164543){if(_0x164543){return _0x164543[_0x51f4('0x2c')]()[_0x51f4('0x2b')](function(){var _0x39bc65=_0x164543[_0x51f4('0x2d')]({'plain':!![]});var _0x4e6432=_0x51f4('0x2e');return db['UserProfileResource'][_0x51f4('0x2c')]({'where':{'type':_0x4e6432,'resourceId':_0x39bc65['id']}})[_0x51f4('0x2b')](function(){return _0x164543;});})[_0x51f4('0x2b')](function(){_0x4a6b88[_0x51f4('0x1e')](0xcc)[_0x51f4('0x1f')]();});}};}function handleEntityNotFound(_0x3ad4df,_0xcc36e2){return function(_0x57af55){if(!_0x57af55){_0x3ad4df['sendStatus'](0x194);}return _0x57af55;};}function handleError(_0x496a9a,_0x56044b){_0x56044b=_0x56044b||0x1f4;return function(_0x14fb0f){logger[_0x51f4('0x2f')](_0x14fb0f[_0x51f4('0x30')]);if(_0x14fb0f[_0x51f4('0x31')]){delete _0x14fb0f['name'];}_0x496a9a[_0x51f4('0x1e')](_0x56044b)['send'](_0x14fb0f);};}exports[_0x51f4('0x32')]=function(_0x992ded,_0x1be676){var _0x13bbef={},_0x310881={},_0x1e43b5={'count':0x0,'rows':[]};var _0x4aae44=_[_0x51f4('0x33')](db['OpenchannelQueue'][_0x51f4('0x34')],function(_0x2762a3){return{'name':_0x2762a3[_0x51f4('0x35')],'type':_0x2762a3[_0x51f4('0x36')][_0x51f4('0x37')]};});_0x310881[_0x51f4('0x38')]=_[_0x51f4('0x33')](_0x4aae44,_0x51f4('0x31'));_0x310881[_0x51f4('0x39')]=_[_0x51f4('0x3a')](_0x992ded[_0x51f4('0x39')]);_0x310881['filters']=_[_0x51f4('0x3b')](_0x310881['model'],_0x310881[_0x51f4('0x39')]);_0x13bbef['attributes']=_[_0x51f4('0x3b')](_0x310881[_0x51f4('0x38')],qs[_0x51f4('0x3c')](_0x992ded[_0x51f4('0x39')]['fields']));_0x13bbef[_0x51f4('0x3d')]=_0x13bbef[_0x51f4('0x3d')]['length']?_0x13bbef[_0x51f4('0x3d')]:_0x310881[_0x51f4('0x38')];if(!_0x992ded[_0x51f4('0x39')]['hasOwnProperty'](_0x51f4('0x3e'))){_0x13bbef['limit']=qs['limit'](_0x992ded[_0x51f4('0x39')][_0x51f4('0x22')]);_0x13bbef[_0x51f4('0x24')]=qs[_0x51f4('0x24')](_0x992ded[_0x51f4('0x39')][_0x51f4('0x24')]);}_0x13bbef['order']=qs[_0x51f4('0x3f')](_0x992ded[_0x51f4('0x39')]['sort']);_0x13bbef['where']=qs[_0x51f4('0x40')](_[_0x51f4('0x41')](_0x992ded['query'],_0x310881[_0x51f4('0x40')]),_0x4aae44);if(_0x992ded[_0x51f4('0x39')][_0x51f4('0x42')]){_0x13bbef[_0x51f4('0x43')]=_['merge'](_0x13bbef[_0x51f4('0x43')],{'$or':_[_0x51f4('0x33')](_0x4aae44,function(_0x5e71b2){if(_0x5e71b2[_0x51f4('0x36')]!==_0x51f4('0x44')){var _0x42d4de={};_0x42d4de[_0x5e71b2[_0x51f4('0x31')]]={'$like':'%'+_0x992ded[_0x51f4('0x39')][_0x51f4('0x42')]+'%'};return _0x42d4de;}})});}_0x13bbef=_['merge']({},_0x13bbef,_0x992ded[_0x51f4('0x45')]);var _0x4e0796={'where':_0x13bbef['where']};return db[_0x51f4('0x46')][_0x51f4('0x23')](_0x4e0796)[_0x51f4('0x2b')](function(_0x166c4b){_0x1e43b5[_0x51f4('0x23')]=_0x166c4b;if(_0x992ded[_0x51f4('0x39')][_0x51f4('0x47')]){_0x13bbef[_0x51f4('0x48')]=[{'all':!![]}];}return db[_0x51f4('0x46')]['findAll'](_0x13bbef);})[_0x51f4('0x2b')](function(_0x152f24){_0x1e43b5[_0x51f4('0x49')]=_0x152f24;return _0x1e43b5;})[_0x51f4('0x2b')](respondWithFilteredResult(_0x1be676,_0x13bbef))[_0x51f4('0x4a')](handleError(_0x1be676,null));};exports[_0x51f4('0x4b')]=function(_0x5419b9,_0xdf33a4){var _0x3fc078={'raw':!![],'where':{'id':_0x5419b9[_0x51f4('0x4c')]['id']}},_0x1d8a29={};_0x1d8a29[_0x51f4('0x38')]=_[_0x51f4('0x3a')](db[_0x51f4('0x46')]['rawAttributes']);_0x1d8a29[_0x51f4('0x39')]=_[_0x51f4('0x3a')](_0x5419b9[_0x51f4('0x39')]);_0x1d8a29[_0x51f4('0x40')]=_[_0x51f4('0x3b')](_0x1d8a29[_0x51f4('0x38')],_0x1d8a29[_0x51f4('0x39')]);_0x3fc078[_0x51f4('0x3d')]=_[_0x51f4('0x3b')](_0x1d8a29['model'],qs[_0x51f4('0x3c')](_0x5419b9['query'][_0x51f4('0x3c')]));_0x3fc078['attributes']=_0x3fc078[_0x51f4('0x3d')][_0x51f4('0x4d')]?_0x3fc078[_0x51f4('0x3d')]:_0x1d8a29[_0x51f4('0x38')];if(_0x5419b9[_0x51f4('0x39')][_0x51f4('0x47')]){_0x3fc078[_0x51f4('0x48')]=[{'all':!![]}];}_0x3fc078=_[_0x51f4('0x4e')]({},_0x3fc078,_0x5419b9[_0x51f4('0x45')]);return db[_0x51f4('0x46')][_0x51f4('0x4f')](_0x3fc078)['then'](handleEntityNotFound(_0xdf33a4,null))[_0x51f4('0x2b')](respondWithResult(_0xdf33a4,null))[_0x51f4('0x4a')](handleError(_0xdf33a4,null));};exports['create']=function(_0x3b7837,_0x537903){return db['OpenchannelQueue']['create'](_0x3b7837[_0x51f4('0x50')],{})[_0x51f4('0x2b')](function(_0x132b8c){var _0x529dc1=_0x3b7837['user'][_0x51f4('0x2d')]({'plain':!![]});if(!_0x529dc1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x529dc1[_0x51f4('0x51')]===_0x51f4('0x52')){var _0xf9650a=_0x132b8c['get']({'plain':!![]});var _0x435391='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x435391,'userProfileId':_0x529dc1['userProfileId']},'raw':!![]})[_0x51f4('0x2b')](function(_0x29b27a){if(_0x29b27a&&_0x29b27a['autoAssociation']===0x0){return db[_0x51f4('0x53')][_0x51f4('0x54')]({'name':_0xf9650a[_0x51f4('0x31')],'resourceId':_0xf9650a['id'],'type':_0x29b27a[_0x51f4('0x31')],'sectionId':_0x29b27a['id']},{})[_0x51f4('0x2b')](function(){return _0x132b8c;});}else{return _0x132b8c;}})[_0x51f4('0x4a')](function(_0x527da5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x527da5);throw _0x527da5;});}return _0x132b8c;})[_0x51f4('0x2b')](respondWithResult(_0x537903,0xc9))[_0x51f4('0x4a')](handleError(_0x537903,null));};exports[_0x51f4('0x2a')]=function(_0x29f242,_0x55c3bd){if(_0x29f242['body']['id']){delete _0x29f242['body']['id'];}return db['OpenchannelQueue'][_0x51f4('0x4f')]({'where':{'id':_0x29f242[_0x51f4('0x4c')]['id']}})[_0x51f4('0x2b')](handleEntityNotFound(_0x55c3bd,null))[_0x51f4('0x2b')](saveUpdates(_0x29f242[_0x51f4('0x50')],null))[_0x51f4('0x2b')](respondWithResult(_0x55c3bd,null))['catch'](handleError(_0x55c3bd,null));};exports['destroy']=function(_0x20b09f,_0x45c07e){return db['OpenchannelQueue'][_0x51f4('0x4f')]({'where':{'id':_0x20b09f['params']['id']}})[_0x51f4('0x2b')](handleEntityNotFound(_0x45c07e,null))['then'](removeEntity(_0x45c07e,null))['catch'](handleError(_0x45c07e,null));};exports[_0x51f4('0x55')]=function(_0x4d02c7,_0xed099b){return db[_0x51f4('0x46')]['describe']()[_0x51f4('0x2b')](respondWithResult(_0xed099b,null))['catch'](handleError(_0xed099b,null));};exports[_0x51f4('0x56')]=function(_0x19cf6c,_0x3ce876,_0x3ca893){var _0x12e97a={'raw':!![],'where':{}},_0x5340c1={},_0x33ede0;return db['OpenchannelQueue'][_0x51f4('0x57')]({'where':{'id':_0x19cf6c[_0x51f4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ce876,null))[_0x51f4('0x2b')](function(_0x52dfa5){if(_0x52dfa5){_0x33ede0=_0x52dfa5[_0x51f4('0x2d')]({'plain':!![]});_0x5340c1['model']=_[_0x51f4('0x3a')](db[_0x51f4('0x58')][_0x51f4('0x34')]);_0x5340c1[_0x51f4('0x39')]=_['keys'](_0x19cf6c['query']);_0x5340c1['filters']=_[_0x51f4('0x3b')](_0x5340c1[_0x51f4('0x38')],_0x5340c1['query']);_0x12e97a[_0x51f4('0x3d')]=_[_0x51f4('0x3b')](_0x5340c1[_0x51f4('0x38')],qs[_0x51f4('0x3c')](_0x19cf6c['query'][_0x51f4('0x3c')]));_0x12e97a[_0x51f4('0x3d')]=_0x12e97a[_0x51f4('0x3d')][_0x51f4('0x4d')]?_0x12e97a[_0x51f4('0x3d')]:_0x5340c1[_0x51f4('0x38')];if(!_0x19cf6c[_0x51f4('0x39')]['hasOwnProperty'](_0x51f4('0x3e'))){_0x12e97a['limit']=qs[_0x51f4('0x22')](_0x19cf6c[_0x51f4('0x39')]['limit']);_0x12e97a[_0x51f4('0x24')]=qs[_0x51f4('0x24')](_0x19cf6c[_0x51f4('0x39')]['offset']);}_0x12e97a[_0x51f4('0x59')]=qs[_0x51f4('0x3f')](_0x19cf6c[_0x51f4('0x39')]['sort']);_0x12e97a['where']=qs[_0x51f4('0x40')](_[_0x51f4('0x41')](_0x19cf6c[_0x51f4('0x39')],_0x5340c1['filters']));_0x12e97a[_0x51f4('0x43')][_0x51f4('0x5a')]=_0x52dfa5['id'];if(_0x19cf6c[_0x51f4('0x39')][_0x51f4('0x42')]){_0x12e97a['where']=_['merge'](_0x12e97a[_0x51f4('0x43')],{'$or':_['map'](_0x12e97a[_0x51f4('0x3d')],function(_0x1f916d){var _0x29a358={};_0x29a358[_0x1f916d]={'$like':'%'+_0x19cf6c[_0x51f4('0x39')]['filter']+'%'};return _0x29a358;})});}_0x12e97a=_[_0x51f4('0x4e')]({},_0x12e97a,_0x19cf6c[_0x51f4('0x45')]);return db[_0x51f4('0x58')]['findAll'](_0x12e97a);}})[_0x51f4('0x2b')](function(_0x315377){if(_0x315377){return db['User'][_0x51f4('0x5b')]({'where':{'id':_['map'](_0x315377,'UserId'),'role':_0x51f4('0x5c')},'attributes':['id',_0x51f4('0x31'),'openchannelPause',_0x51f4('0x5d'),_0x51f4('0x5e')]});}})['then'](function(_0x44cd1a){if(_0x44cd1a){return{'count':_0x44cd1a[_0x51f4('0x23')],'rows':_[_0x51f4('0x33')](_0x44cd1a[_0x51f4('0x49')],function(_0x2e2033){return{'membername':_0x2e2033['name'],'UserId':_0x2e2033['id'],'queue_name':_0x33ede0['name'],'OpenchannelQueueId':_0x33ede0['id'],'interface':util['format']('%s/%s',_0x51f4('0x5f'),_0x2e2033[_0x51f4('0x31')]),'penalty':0x0,'paused':_0x2e2033[_0x51f4('0x60')],'createdAt':_0x2e2033[_0x51f4('0x5e')],'updatedAt':_0x2e2033[_0x51f4('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x51f4('0x2b')](respondWithFilteredResult(_0x3ce876,_0x12e97a))['catch'](handleError(_0x3ce876,null));};exports['getTeams']=function(_0x2f51f0,_0x265c55,_0x312393){var _0x40a9f0={};var _0x421c6d={};var _0x571cff;var _0x4aea66;return db['OpenchannelQueue'][_0x51f4('0x57')]({'where':{'id':_0x2f51f0[_0x51f4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x265c55,null))[_0x51f4('0x2b')](function(_0x406fff){if(_0x406fff){_0x571cff=_0x406fff;_0x421c6d[_0x51f4('0x38')]=_[_0x51f4('0x3a')](db['Team'][_0x51f4('0x34')]);_0x421c6d['query']=_[_0x51f4('0x3a')](_0x2f51f0['query']);_0x421c6d[_0x51f4('0x40')]=_['intersection'](_0x421c6d[_0x51f4('0x38')],_0x421c6d[_0x51f4('0x39')]);_0x40a9f0[_0x51f4('0x3d')]=_[_0x51f4('0x3b')](_0x421c6d[_0x51f4('0x38')],qs[_0x51f4('0x3c')](_0x2f51f0[_0x51f4('0x39')][_0x51f4('0x3c')]));_0x40a9f0['attributes']=_0x40a9f0[_0x51f4('0x3d')][_0x51f4('0x4d')]?_0x40a9f0[_0x51f4('0x3d')]:_0x421c6d[_0x51f4('0x38')];_0x40a9f0[_0x51f4('0x59')]=qs[_0x51f4('0x3f')](_0x2f51f0[_0x51f4('0x39')][_0x51f4('0x3f')]);_0x40a9f0[_0x51f4('0x43')]=qs[_0x51f4('0x40')](_[_0x51f4('0x41')](_0x2f51f0[_0x51f4('0x39')],_0x421c6d[_0x51f4('0x40')]));if(_0x2f51f0['query']['filter']){_0x40a9f0[_0x51f4('0x43')]=_[_0x51f4('0x4e')](_0x40a9f0[_0x51f4('0x43')],{'$or':_[_0x51f4('0x33')](_0x40a9f0[_0x51f4('0x3d')],function(_0x4952da){var _0x549d96={};_0x549d96[_0x4952da]={'$like':'%'+_0x2f51f0['query'][_0x51f4('0x42')]+'%'};return _0x549d96;})});}_0x40a9f0=_['merge']({},_0x40a9f0,_0x2f51f0[_0x51f4('0x45')]);return _0x571cff['getTeams'](_0x40a9f0);}})[_0x51f4('0x2b')](function(_0x517a2d){if(_0x517a2d){_0x4aea66=_0x517a2d[_0x51f4('0x4d')];if(!_0x2f51f0[_0x51f4('0x39')][_0x51f4('0x61')](_0x51f4('0x3e'))){_0x40a9f0['limit']=qs['limit'](_0x2f51f0['query'][_0x51f4('0x22')]);_0x40a9f0[_0x51f4('0x24')]=qs[_0x51f4('0x24')](_0x2f51f0[_0x51f4('0x39')][_0x51f4('0x24')]);}return _0x571cff[_0x51f4('0x62')](_0x40a9f0);}})['then'](function(_0x1db6cb){if(_0x1db6cb){return _0x1db6cb?{'count':_0x4aea66,'rows':_0x1db6cb}:null;}})[_0x51f4('0x2b')](respondWithResult(_0x265c55,null))['catch'](handleError(_0x265c55,null));};exports[_0x51f4('0x63')]=function(_0xbeb1e0,_0x3d1c01,_0x20bb2e){var _0x3da320=_0xbeb1e0[_0x51f4('0x50')][_0x51f4('0x64')];return db['Team'][_0x51f4('0x65')]({'where':{'id':_0x3da320},'attributes':['id'],'include':[{'model':db[_0x51f4('0x66')],'as':'Agents','attributes':['id',_0x51f4('0x31'),_0x51f4('0x67'),_0x51f4('0x68'),_0x51f4('0x69')],'raw':!![]}]})[_0x51f4('0x2b')](function(_0x242630){if(_0x242630){var _0x244073=_[_0x51f4('0x6a')](_0x242630,function(_0x2dd508){var _0x240cbb=_0x2dd508[_0x51f4('0x2d')]({'plain':!![]});return _0x240cbb[_0x51f4('0x6b')];});return db[_0x51f4('0x46')][_0x51f4('0x4f')]({'where':{'id':_0xbeb1e0[_0x51f4('0x4c')]['id']}})['then'](function(_0x1dc9e3){return db['sequelize'][_0x51f4('0x6c')](function(_0x33eb15){return _0x1dc9e3[_0x51f4('0x63')](_0x3da320,{'transaction':_0x33eb15})['then'](function(){return BPromise['each'](_0x244073,function(_0x5cec28){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x5cec28['id'],'OpenchannelQueueId':_0xbeb1e0[_0x51f4('0x4c')]['id']},'transaction':_0x33eb15});});})['then'](function(){_0x244073['forEach'](function(_0x32ef42){socket['emit'](_0x51f4('0x6d'),{'UserId':_0x32ef42['id'],'OpenchannelQueueId':_0x1dc9e3['id']});});});});});}})[_0x51f4('0x2b')](respondWithStatusCode(_0x3d1c01,null))[_0x51f4('0x4a')](handleError(_0x3d1c01,null));};exports[_0x51f4('0x6e')]=function(_0x503192,_0x5c4f00,_0x45c9ef){return db[_0x51f4('0x6f')][_0x51f4('0x65')]({'where':{'id':_0x503192['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x51f4('0x66')],'as':_0x51f4('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x51f4('0x2b')](handleEntityNotFound(_0x5c4f00,null))[_0x51f4('0x2b')](function(_0x1e3105){var _0x15555f=_[_0x51f4('0x33')](_0x1e3105,'id');var _0x134af4=[];var _0x4573ed=[];var _0x3ae689=squel[_0x51f4('0x70')]();_0x3ae689[_0x51f4('0x71')](_0x51f4('0x72'))['from']('team_has_openchannel_queues','tq')[_0x51f4('0x73')](_0x51f4('0x74'),'ut',_0x51f4('0x75'))[_0x51f4('0x43')](_0x51f4('0x76'),_0x503192[_0x51f4('0x4c')]['id']);for(var _0xed4dec=0x0;_0xed4dec<_0x1e3105[_0x51f4('0x4d')];_0xed4dec+=0x1){let _0x1624c0=_0x1e3105[_0xed4dec];for(var _0x4e8a4f=0x0;_0x4e8a4f<_0x1624c0['Agents'][_0x51f4('0x4d')];_0x4e8a4f+=0x1){let _0xe99b03=_0x1624c0[_0x51f4('0x6b')][_0x4e8a4f];var _0x53855e=_0x3ae689[_0x51f4('0x77')]();_0x53855e[_0x51f4('0x43')]('ut.UserId\x20=\x20?',_0xe99b03['id']);_0x4573ed['push'](db[_0x51f4('0x78')]['query'](_0x53855e[_0x51f4('0x79')](),{'type':db['sequelize']['QueryTypes'][_0x51f4('0x7a')]})[_0x51f4('0x2b')](function(_0x2a8967){if(_0x2a8967[_0x51f4('0x4d')]===0x1){return _0xe99b03['id'];}else{var _0x2cefdb=_[_0x51f4('0x7b')](_[_0x51f4('0x33')](_0x2a8967,_0x51f4('0x7c')),function(_0x2ac487){return _[_0x51f4('0x7d')](_0x15555f,_0x2ac487);});if(_0x2cefdb){return _0xe99b03['id'];}}}));}}return BPromise[_0x51f4('0x7e')](_0x4573ed)[_0x51f4('0x2b')](function(_0x4be6e9){_0x134af4=_(_0x134af4)[_0x51f4('0x7f')](_0x4be6e9)[_0x51f4('0x80')]()[_0x51f4('0x81')]();return db[_0x51f4('0x46')]['find']({'where':{'id':_0x503192[_0x51f4('0x4c')]['id']}})[_0x51f4('0x2b')](function(_0x5bd827){return db[_0x51f4('0x78')][_0x51f4('0x6c')](function(_0x4f0298){return _0x5bd827[_0x51f4('0x6e')](_0x503192[_0x51f4('0x39')][_0x51f4('0x64')],{'transaction':_0x4f0298})[_0x51f4('0x2b')](function(){if(!_[_0x51f4('0x82')](_0x134af4)){return _0x5bd827[_0x51f4('0x83')](_0x134af4,{'transaction':_0x4f0298});}})[_0x51f4('0x2b')](function(){_0x134af4[_0x51f4('0x84')](function(_0x14f928){socket['emit'](_0x51f4('0x85'),{'UserId':_0x14f928,'OpenchannelQueueId':_0x5bd827['id']});});});});});});})[_0x51f4('0x2b')](respondWithStatusCode(_0x5c4f00,null))['catch'](handleError(_0x5c4f00,null));};exports['addAgents']=function(_0x47c218,_0xe2656f,_0x26f0c4){return db['OpenchannelQueue'][_0x51f4('0x4f')]({'where':{'id':_0x47c218[_0x51f4('0x4c')]['id']}})[_0x51f4('0x2b')](handleEntityNotFound(_0xe2656f,null))[_0x51f4('0x2b')](function(_0x5afd84){if(_0x5afd84){return _0x5afd84['addAgents'](_0x47c218[_0x51f4('0x50')][_0x51f4('0x64')],_[_0x51f4('0x86')](_0x47c218[_0x51f4('0x50')],[_0x51f4('0x64'),'id'])||{})[_0x51f4('0x87')](function(_0x6539f6){for(var _0x5ac479=0x0;_0x5ac479<_0x47c218[_0x51f4('0x50')][_0x51f4('0x64')][_0x51f4('0x4d')];_0x5ac479+=0x1){socket[_0x51f4('0x88')]('userOpenchannelQueue:save',{'UserId':Number(_0x47c218['body'][_0x51f4('0x64')][_0x5ac479]),'OpenchannelQueueId':Number(_0x47c218[_0x51f4('0x4c')]['id'])});}return _0x6539f6;});}})[_0x51f4('0x2b')](respondWithResult(_0xe2656f,null))[_0x51f4('0x4a')](handleError(_0xe2656f,null));};exports[_0x51f4('0x83')]=function(_0x751baf,_0x2c4526,_0x5163d8){return db[_0x51f4('0x46')][_0x51f4('0x4f')]({'where':{'id':_0x751baf['params']['id']}})['then'](handleEntityNotFound(_0x2c4526,null))['then'](function(_0x137de9){if(_0x137de9){return _0x137de9[_0x51f4('0x83')](_0x751baf[_0x51f4('0x39')][_0x51f4('0x64')])['then'](function(){if(_[_0x51f4('0x89')](_0x751baf[_0x51f4('0x39')][_0x51f4('0x64')])){for(var _0x5de063=0x0;_0x5de063<_0x751baf['query'][_0x51f4('0x64')][_0x51f4('0x4d')];_0x5de063+=0x1){socket['emit'](_0x51f4('0x85'),{'UserId':Number(_0x751baf[_0x51f4('0x39')]['ids'][_0x5de063]),'OpenchannelQueueId':Number(_0x751baf['params']['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x751baf[_0x51f4('0x39')][_0x51f4('0x64')]),'OpenchannelQueueId':Number(_0x751baf[_0x51f4('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c4526,null))[_0x51f4('0x4a')](handleError(_0x2c4526,null));};exports[_0x51f4('0x8a')]=function(_0x268995,_0x295735,_0x54a79b){var _0x1fbca6={};var _0x11cbfb={};var _0x3c9247;var _0x27b25d;return db[_0x51f4('0x46')][_0x51f4('0x57')]({'where':{'id':_0x268995['params']['id']}})[_0x51f4('0x2b')](handleEntityNotFound(_0x295735,null))[_0x51f4('0x2b')](function(_0x11170){if(_0x11170){_0x3c9247=_0x11170;_0x11cbfb[_0x51f4('0x38')]=_[_0x51f4('0x3a')](db['User'][_0x51f4('0x34')]);_0x11cbfb[_0x51f4('0x39')]=_[_0x51f4('0x3a')](_0x268995['query']);_0x11cbfb['filters']=_['intersection'](_0x11cbfb[_0x51f4('0x38')],_0x11cbfb[_0x51f4('0x39')]);_0x1fbca6[_0x51f4('0x3d')]=_[_0x51f4('0x3b')](_0x11cbfb[_0x51f4('0x38')],qs[_0x51f4('0x3c')](_0x268995[_0x51f4('0x39')]['fields']));_0x1fbca6[_0x51f4('0x3d')]=_0x1fbca6[_0x51f4('0x3d')][_0x51f4('0x4d')]?_0x1fbca6[_0x51f4('0x3d')]:_0x11cbfb[_0x51f4('0x38')];_0x1fbca6[_0x51f4('0x59')]=qs[_0x51f4('0x3f')](_0x268995[_0x51f4('0x39')]['sort']);_0x1fbca6['where']=qs[_0x51f4('0x40')](_[_0x51f4('0x41')](_0x268995[_0x51f4('0x39')],_0x11cbfb[_0x51f4('0x40')]));if(_0x268995[_0x51f4('0x39')][_0x51f4('0x42')]){_0x1fbca6['where']=_[_0x51f4('0x4e')](_0x1fbca6[_0x51f4('0x43')],{'$or':_['map'](_0x1fbca6[_0x51f4('0x3d')],function(_0x2f2b00){var _0x14f123={};_0x14f123[_0x2f2b00]={'$like':'%'+_0x268995[_0x51f4('0x39')]['filter']+'%'};return _0x14f123;})});}_0x1fbca6=_[_0x51f4('0x4e')]({},_0x1fbca6,_0x268995[_0x51f4('0x45')]);return _0x3c9247[_0x51f4('0x8a')](_0x1fbca6);}})[_0x51f4('0x2b')](function(_0xe74ef6){if(_0xe74ef6){_0x27b25d=_0xe74ef6[_0x51f4('0x4d')];if(!_0x268995[_0x51f4('0x39')][_0x51f4('0x61')](_0x51f4('0x3e'))){_0x1fbca6[_0x51f4('0x22')]=qs['limit'](_0x268995[_0x51f4('0x39')][_0x51f4('0x22')]);_0x1fbca6['offset']=qs[_0x51f4('0x24')](_0x268995[_0x51f4('0x39')][_0x51f4('0x24')]);}return _0x3c9247[_0x51f4('0x8a')](_0x1fbca6);}})[_0x51f4('0x2b')](function(_0x285770){if(_0x285770){return _0x285770?{'count':_0x27b25d,'rows':_0x285770}:null;}})[_0x51f4('0x2b')](respondWithResult(_0x295735,null))[_0x51f4('0x4a')](handleError(_0x295735,null));}; \ No newline at end of file +var _0x7ecb=['UserId','agent','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','SIP','findOne','ids','Team','findAll','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','field','team_has_openchannel_queues','join','user_has_teams','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','name','index','map','OpenchannelQueue','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','catch','create','body','role','user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','nolimit','order','pick','OpenchannelQueueId','User','findAndCountAll'];(function(_0xe70da9,_0x32ef62){var _0x15897c=function(_0x3298ab){while(--_0x3298ab){_0xe70da9['push'](_0xe70da9['shift']());}};_0x15897c(++_0x32ef62);}(_0x7ecb,0x13e));var _0xb7ec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ecb[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb7ec('0x0'));var rp=require(_0xb7ec('0x1'));var moment=require(_0xb7ec('0x2'));var BPromise=require(_0xb7ec('0x3'));var Mustache=require(_0xb7ec('0x4'));var util=require(_0xb7ec('0x5'));var path=require('path');var sox=require(_0xb7ec('0x6'));var csv=require(_0xb7ec('0x7'));var ejs=require(_0xb7ec('0x8'));var fs=require('fs');var fs_extra=require(_0xb7ec('0x9'));var _=require(_0xb7ec('0xa'));var squel=require('squel');var crypto=require(_0xb7ec('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb7ec('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb7ec('0xd'));var Papa=require(_0xb7ec('0xe'));var Redis=require(_0xb7ec('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb7ec('0x10'));var as=require(_0xb7ec('0x11'));var hardwareService=require(_0xb7ec('0x12'));var logger=require(_0xb7ec('0x13'))(_0xb7ec('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb7ec('0x15'));var db=require('../../mysqldb')['db'];config[_0xb7ec('0x16')]=_['defaults'](config[_0xb7ec('0x16')],{'host':_0xb7ec('0x17'),'port':0x18eb});var socket=require(_0xb7ec('0x18'))(new Redis(config['redis']));require(_0xb7ec('0x19'))[_0xb7ec('0x1a')](socket);function respondWithStatusCode(_0x2e3ccf,_0x51e300){_0x51e300=_0x51e300||0xcc;return function(_0x5b280b){if(_0x5b280b){return _0x2e3ccf[_0xb7ec('0x1b')](_0x51e300);}return _0x2e3ccf[_0xb7ec('0x1c')](_0x51e300)[_0xb7ec('0x1d')]();};}function respondWithResult(_0x23b11d,_0x274d89){_0x274d89=_0x274d89||0xc8;return function(_0x33f5fb){if(_0x33f5fb){return _0x23b11d[_0xb7ec('0x1c')](_0x274d89)[_0xb7ec('0x1e')](_0x33f5fb);}};}function respondWithFilteredResult(_0x2732b9,_0x2644d3){return function(_0x3e10fc){if(_0x3e10fc){var _0x57acb3=typeof _0x2644d3[_0xb7ec('0x1f')]===_0xb7ec('0x20')&&typeof _0x2644d3[_0xb7ec('0x21')]===_0xb7ec('0x20');var _0x318517=_0x3e10fc[_0xb7ec('0x22')];var _0x461f6a=_0x57acb3?0x0:_0x2644d3['offset'];var _0x2961e5=_0x57acb3?_0x3e10fc[_0xb7ec('0x22')]:_0x2644d3[_0xb7ec('0x1f')]+_0x2644d3[_0xb7ec('0x21')];var _0x5be59b;if(_0x2961e5>=_0x318517){_0x2961e5=_0x318517;_0x5be59b=0xc8;}else{_0x5be59b=0xce;}_0x2732b9['status'](_0x5be59b);return _0x2732b9[_0xb7ec('0x23')](_0xb7ec('0x24'),_0x461f6a+'-'+_0x2961e5+'/'+_0x318517)['json'](_0x3e10fc);}return null;};}function patchUpdates(_0xd41b56){return function(_0x49d9bd){try{jsonpatch[_0xb7ec('0x25')](_0x49d9bd,_0xd41b56,!![]);}catch(_0x5dd8d1){return BPromise[_0xb7ec('0x26')](_0x5dd8d1);}return _0x49d9bd[_0xb7ec('0x27')]();};}function saveUpdates(_0x2cc85f,_0xb21ba7){return function(_0x56c681){if(_0x56c681){return _0x56c681[_0xb7ec('0x28')](_0x2cc85f)['then'](function(_0x1c50bc){return _0x1c50bc;});}return null;};}function removeEntity(_0x5071c9,_0x1b7133){return function(_0x21ba89){if(_0x21ba89){return _0x21ba89[_0xb7ec('0x29')]()[_0xb7ec('0x2a')](function(){var _0x5ae8e3=_0x21ba89[_0xb7ec('0x2b')]({'plain':!![]});var _0x1cf9b5=_0xb7ec('0x2c');return db[_0xb7ec('0x2d')][_0xb7ec('0x29')]({'where':{'type':_0x1cf9b5,'resourceId':_0x5ae8e3['id']}})[_0xb7ec('0x2a')](function(){return _0x21ba89;});})[_0xb7ec('0x2a')](function(){_0x5071c9[_0xb7ec('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x485be3,_0x505114){return function(_0x42ef75){if(!_0x42ef75){_0x485be3[_0xb7ec('0x1b')](0x194);}return _0x42ef75;};}function handleError(_0x41b920,_0x212179){_0x212179=_0x212179||0x1f4;return function(_0x3de7b0){logger['error'](_0x3de7b0['stack']);if(_0x3de7b0[_0xb7ec('0x2e')]){delete _0x3de7b0['name'];}_0x41b920[_0xb7ec('0x1c')](_0x212179)['send'](_0x3de7b0);};}exports[_0xb7ec('0x2f')]=function(_0x7442bf,_0x5629a1){var _0x50a613={},_0x1e2c38={},_0x1f64fa={'count':0x0,'rows':[]};var _0x4bfced=_[_0xb7ec('0x30')](db[_0xb7ec('0x31')]['rawAttributes'],function(_0x4e6d88){return{'name':_0x4e6d88[_0xb7ec('0x32')],'type':_0x4e6d88[_0xb7ec('0x33')][_0xb7ec('0x34')]};});_0x1e2c38[_0xb7ec('0x35')]=_[_0xb7ec('0x30')](_0x4bfced,'name');_0x1e2c38[_0xb7ec('0x36')]=_[_0xb7ec('0x37')](_0x7442bf[_0xb7ec('0x36')]);_0x1e2c38[_0xb7ec('0x38')]=_[_0xb7ec('0x39')](_0x1e2c38['model'],_0x1e2c38['query']);_0x50a613['attributes']=_['intersection'](_0x1e2c38['model'],qs[_0xb7ec('0x3a')](_0x7442bf[_0xb7ec('0x36')][_0xb7ec('0x3a')]));_0x50a613[_0xb7ec('0x3b')]=_0x50a613[_0xb7ec('0x3b')][_0xb7ec('0x3c')]?_0x50a613['attributes']:_0x1e2c38[_0xb7ec('0x35')];if(!_0x7442bf[_0xb7ec('0x36')][_0xb7ec('0x3d')]('nolimit')){_0x50a613[_0xb7ec('0x21')]=qs['limit'](_0x7442bf[_0xb7ec('0x36')][_0xb7ec('0x21')]);_0x50a613['offset']=qs['offset'](_0x7442bf[_0xb7ec('0x36')][_0xb7ec('0x1f')]);}_0x50a613['order']=qs['sort'](_0x7442bf['query'][_0xb7ec('0x3e')]);_0x50a613[_0xb7ec('0x3f')]=qs[_0xb7ec('0x38')](_['pick'](_0x7442bf[_0xb7ec('0x36')],_0x1e2c38[_0xb7ec('0x38')]),_0x4bfced);if(_0x7442bf[_0xb7ec('0x36')][_0xb7ec('0x40')]){_0x50a613[_0xb7ec('0x3f')]=_[_0xb7ec('0x41')](_0x50a613[_0xb7ec('0x3f')],{'$or':_[_0xb7ec('0x30')](_0x4bfced,function(_0x14f77e){if(_0x14f77e[_0xb7ec('0x33')]!==_0xb7ec('0x42')){var _0x365ee2={};_0x365ee2[_0x14f77e[_0xb7ec('0x2e')]]={'$like':'%'+_0x7442bf[_0xb7ec('0x36')][_0xb7ec('0x40')]+'%'};return _0x365ee2;}})});}_0x50a613=_[_0xb7ec('0x41')]({},_0x50a613,_0x7442bf[_0xb7ec('0x43')]);var _0x3552cb={'where':_0x50a613['where']};return db[_0xb7ec('0x31')][_0xb7ec('0x22')](_0x3552cb)[_0xb7ec('0x2a')](function(_0xb10df8){_0x1f64fa[_0xb7ec('0x22')]=_0xb10df8;if(_0x7442bf[_0xb7ec('0x36')][_0xb7ec('0x44')]){_0x50a613[_0xb7ec('0x45')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x50a613);})[_0xb7ec('0x2a')](function(_0x3ab8d2){_0x1f64fa['rows']=_0x3ab8d2;return _0x1f64fa;})[_0xb7ec('0x2a')](respondWithFilteredResult(_0x5629a1,_0x50a613))['catch'](handleError(_0x5629a1,null));};exports[_0xb7ec('0x46')]=function(_0x1a5ad9,_0x114f74){var _0x53b73f={'raw':!![],'where':{'id':_0x1a5ad9[_0xb7ec('0x47')]['id']}},_0xc9915d={};_0xc9915d['model']=_[_0xb7ec('0x37')](db[_0xb7ec('0x31')][_0xb7ec('0x48')]);_0xc9915d[_0xb7ec('0x36')]=_[_0xb7ec('0x37')](_0x1a5ad9['query']);_0xc9915d[_0xb7ec('0x38')]=_[_0xb7ec('0x39')](_0xc9915d[_0xb7ec('0x35')],_0xc9915d[_0xb7ec('0x36')]);_0x53b73f[_0xb7ec('0x3b')]=_[_0xb7ec('0x39')](_0xc9915d[_0xb7ec('0x35')],qs[_0xb7ec('0x3a')](_0x1a5ad9['query'][_0xb7ec('0x3a')]));_0x53b73f['attributes']=_0x53b73f['attributes'][_0xb7ec('0x3c')]?_0x53b73f['attributes']:_0xc9915d[_0xb7ec('0x35')];if(_0x1a5ad9[_0xb7ec('0x36')][_0xb7ec('0x44')]){_0x53b73f[_0xb7ec('0x45')]=[{'all':!![]}];}_0x53b73f=_[_0xb7ec('0x41')]({},_0x53b73f,_0x1a5ad9['options']);return db[_0xb7ec('0x31')][_0xb7ec('0x49')](_0x53b73f)['then'](handleEntityNotFound(_0x114f74,null))[_0xb7ec('0x2a')](respondWithResult(_0x114f74,null))[_0xb7ec('0x4a')](handleError(_0x114f74,null));};exports[_0xb7ec('0x4b')]=function(_0xb0e100,_0x141f80){return db[_0xb7ec('0x31')]['create'](_0xb0e100[_0xb7ec('0x4c')],{})['then'](function(_0x35e5cf){var _0x1e32c6=_0xb0e100['user']['get']({'plain':!![]});if(!_0x1e32c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e32c6[_0xb7ec('0x4d')]===_0xb7ec('0x4e')){var _0x530c5d=_0x35e5cf[_0xb7ec('0x2b')]({'plain':!![]});var _0x1b2b6a=_0xb7ec('0x2c');return db['UserProfileSection'][_0xb7ec('0x49')]({'where':{'name':_0x1b2b6a,'userProfileId':_0x1e32c6['userProfileId']},'raw':!![]})[_0xb7ec('0x2a')](function(_0x2c1ae1){if(_0x2c1ae1&&_0x2c1ae1[_0xb7ec('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x530c5d['name'],'resourceId':_0x530c5d['id'],'type':_0x2c1ae1[_0xb7ec('0x2e')],'sectionId':_0x2c1ae1['id']},{})[_0xb7ec('0x2a')](function(){return _0x35e5cf;});}else{return _0x35e5cf;}})[_0xb7ec('0x4a')](function(_0x1db0e6){logger[_0xb7ec('0x50')](_0xb7ec('0x51'),_0x1db0e6);throw _0x1db0e6;});}return _0x35e5cf;})[_0xb7ec('0x2a')](respondWithResult(_0x141f80,0xc9))['catch'](handleError(_0x141f80,null));};exports[_0xb7ec('0x28')]=function(_0x56dccf,_0x5c177f){if(_0x56dccf[_0xb7ec('0x4c')]['id']){delete _0x56dccf['body']['id'];}return db[_0xb7ec('0x31')][_0xb7ec('0x49')]({'where':{'id':_0x56dccf[_0xb7ec('0x47')]['id']}})[_0xb7ec('0x2a')](handleEntityNotFound(_0x5c177f,null))[_0xb7ec('0x2a')](saveUpdates(_0x56dccf['body'],null))[_0xb7ec('0x2a')](respondWithResult(_0x5c177f,null))[_0xb7ec('0x4a')](handleError(_0x5c177f,null));};exports[_0xb7ec('0x29')]=function(_0x15b296,_0x5c1e73){return db[_0xb7ec('0x31')][_0xb7ec('0x49')]({'where':{'id':_0x15b296['params']['id']}})['then'](handleEntityNotFound(_0x5c1e73,null))[_0xb7ec('0x2a')](removeEntity(_0x5c1e73,null))[_0xb7ec('0x4a')](handleError(_0x5c1e73,null));};exports[_0xb7ec('0x52')]=function(_0x266a22,_0x130af6){return db[_0xb7ec('0x31')]['describe']()[_0xb7ec('0x2a')](respondWithResult(_0x130af6,null))[_0xb7ec('0x4a')](handleError(_0x130af6,null));};exports['getMembers']=function(_0x29dd98,_0x2c4e99,_0x358bb1){var _0xb4a5df={'raw':!![],'where':{}},_0x1d2ddc={},_0x3c81d3;return db[_0xb7ec('0x31')]['findOne']({'where':{'id':_0x29dd98[_0xb7ec('0x47')]['id']}})[_0xb7ec('0x2a')](handleEntityNotFound(_0x2c4e99,null))[_0xb7ec('0x2a')](function(_0x44c4cd){if(_0x44c4cd){_0x3c81d3=_0x44c4cd[_0xb7ec('0x2b')]({'plain':!![]});_0x1d2ddc['model']=_[_0xb7ec('0x37')](db[_0xb7ec('0x53')]['rawAttributes']);_0x1d2ddc['query']=_[_0xb7ec('0x37')](_0x29dd98[_0xb7ec('0x36')]);_0x1d2ddc[_0xb7ec('0x38')]=_[_0xb7ec('0x39')](_0x1d2ddc[_0xb7ec('0x35')],_0x1d2ddc['query']);_0xb4a5df[_0xb7ec('0x3b')]=_[_0xb7ec('0x39')](_0x1d2ddc[_0xb7ec('0x35')],qs[_0xb7ec('0x3a')](_0x29dd98[_0xb7ec('0x36')]['fields']));_0xb4a5df[_0xb7ec('0x3b')]=_0xb4a5df[_0xb7ec('0x3b')][_0xb7ec('0x3c')]?_0xb4a5df['attributes']:_0x1d2ddc[_0xb7ec('0x35')];if(!_0x29dd98[_0xb7ec('0x36')][_0xb7ec('0x3d')](_0xb7ec('0x54'))){_0xb4a5df[_0xb7ec('0x21')]=qs[_0xb7ec('0x21')](_0x29dd98['query'][_0xb7ec('0x21')]);_0xb4a5df[_0xb7ec('0x1f')]=qs['offset'](_0x29dd98[_0xb7ec('0x36')][_0xb7ec('0x1f')]);}_0xb4a5df[_0xb7ec('0x55')]=qs[_0xb7ec('0x3e')](_0x29dd98[_0xb7ec('0x36')][_0xb7ec('0x3e')]);_0xb4a5df['where']=qs['filters'](_[_0xb7ec('0x56')](_0x29dd98[_0xb7ec('0x36')],_0x1d2ddc['filters']));_0xb4a5df[_0xb7ec('0x3f')][_0xb7ec('0x57')]=_0x44c4cd['id'];if(_0x29dd98[_0xb7ec('0x36')][_0xb7ec('0x40')]){_0xb4a5df[_0xb7ec('0x3f')]=_[_0xb7ec('0x41')](_0xb4a5df[_0xb7ec('0x3f')],{'$or':_[_0xb7ec('0x30')](_0xb4a5df[_0xb7ec('0x3b')],function(_0x3941c0){var _0x44e175={};_0x44e175[_0x3941c0]={'$like':'%'+_0x29dd98[_0xb7ec('0x36')][_0xb7ec('0x40')]+'%'};return _0x44e175;})});}_0xb4a5df=_[_0xb7ec('0x41')]({},_0xb4a5df,_0x29dd98['options']);return db['UserOpenchannelQueue']['findAll'](_0xb4a5df);}})[_0xb7ec('0x2a')](function(_0x4cfede){if(_0x4cfede){return db[_0xb7ec('0x58')][_0xb7ec('0x59')]({'where':{'id':_[_0xb7ec('0x30')](_0x4cfede,_0xb7ec('0x5a')),'role':_0xb7ec('0x5b')},'attributes':['id','name',_0xb7ec('0x5c'),_0xb7ec('0x5d'),_0xb7ec('0x5e')]});}})[_0xb7ec('0x2a')](function(_0x4f3c1a){if(_0x4f3c1a){return{'count':_0x4f3c1a['count'],'rows':_[_0xb7ec('0x30')](_0x4f3c1a[_0xb7ec('0x5f')],function(_0x250f14){return{'membername':_0x250f14['name'],'UserId':_0x250f14['id'],'queue_name':_0x3c81d3[_0xb7ec('0x2e')],'OpenchannelQueueId':_0x3c81d3['id'],'interface':util[_0xb7ec('0x60')](_0xb7ec('0x61'),_0xb7ec('0x62'),_0x250f14[_0xb7ec('0x2e')]),'penalty':0x0,'paused':_0x250f14[_0xb7ec('0x5c')],'createdAt':_0x250f14[_0xb7ec('0x5e')],'updatedAt':_0x250f14[_0xb7ec('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2c4e99,_0xb4a5df))['catch'](handleError(_0x2c4e99,null));};exports['getTeams']=function(_0x4c2b77,_0x108e76,_0x1eeaec){var _0x59e7b6={};var _0x2650d0={};var _0x3d268e;var _0x5655a7;return db[_0xb7ec('0x31')][_0xb7ec('0x63')]({'where':{'id':_0x4c2b77['params']['id']}})['then'](handleEntityNotFound(_0x108e76,null))[_0xb7ec('0x2a')](function(_0xc39984){if(_0xc39984){_0x3d268e=_0xc39984;_0x2650d0[_0xb7ec('0x35')]=_[_0xb7ec('0x37')](db['Team']['rawAttributes']);_0x2650d0[_0xb7ec('0x36')]=_[_0xb7ec('0x37')](_0x4c2b77['query']);_0x2650d0[_0xb7ec('0x38')]=_['intersection'](_0x2650d0[_0xb7ec('0x35')],_0x2650d0[_0xb7ec('0x36')]);_0x59e7b6[_0xb7ec('0x3b')]=_['intersection'](_0x2650d0['model'],qs[_0xb7ec('0x3a')](_0x4c2b77[_0xb7ec('0x36')][_0xb7ec('0x3a')]));_0x59e7b6[_0xb7ec('0x3b')]=_0x59e7b6[_0xb7ec('0x3b')][_0xb7ec('0x3c')]?_0x59e7b6['attributes']:_0x2650d0['model'];_0x59e7b6[_0xb7ec('0x55')]=qs[_0xb7ec('0x3e')](_0x4c2b77['query'][_0xb7ec('0x3e')]);_0x59e7b6['where']=qs[_0xb7ec('0x38')](_[_0xb7ec('0x56')](_0x4c2b77[_0xb7ec('0x36')],_0x2650d0['filters']));if(_0x4c2b77[_0xb7ec('0x36')][_0xb7ec('0x40')]){_0x59e7b6['where']=_[_0xb7ec('0x41')](_0x59e7b6[_0xb7ec('0x3f')],{'$or':_[_0xb7ec('0x30')](_0x59e7b6[_0xb7ec('0x3b')],function(_0x509c72){var _0x2ab773={};_0x2ab773[_0x509c72]={'$like':'%'+_0x4c2b77[_0xb7ec('0x36')][_0xb7ec('0x40')]+'%'};return _0x2ab773;})});}_0x59e7b6=_['merge']({},_0x59e7b6,_0x4c2b77['options']);return _0x3d268e['getTeams'](_0x59e7b6);}})[_0xb7ec('0x2a')](function(_0x671a6){if(_0x671a6){_0x5655a7=_0x671a6[_0xb7ec('0x3c')];if(!_0x4c2b77[_0xb7ec('0x36')][_0xb7ec('0x3d')](_0xb7ec('0x54'))){_0x59e7b6[_0xb7ec('0x21')]=qs[_0xb7ec('0x21')](_0x4c2b77[_0xb7ec('0x36')][_0xb7ec('0x21')]);_0x59e7b6['offset']=qs[_0xb7ec('0x1f')](_0x4c2b77[_0xb7ec('0x36')][_0xb7ec('0x1f')]);}return _0x3d268e['getTeams'](_0x59e7b6);}})['then'](function(_0xeb98d){if(_0xeb98d){return _0xeb98d?{'count':_0x5655a7,'rows':_0xeb98d}:null;}})[_0xb7ec('0x2a')](respondWithResult(_0x108e76,null))[_0xb7ec('0x4a')](handleError(_0x108e76,null));};exports['addTeams']=function(_0x485c7c,_0x579dd2,_0x4ac1c3){var _0x4a8862=_0x485c7c['body'][_0xb7ec('0x64')];return db[_0xb7ec('0x65')][_0xb7ec('0x66')]({'where':{'id':_0x4a8862},'attributes':['id'],'include':[{'model':db[_0xb7ec('0x58')],'as':_0xb7ec('0x67'),'attributes':['id',_0xb7ec('0x2e'),_0xb7ec('0x68'),'voicePause',_0xb7ec('0x69')],'raw':!![]}]})[_0xb7ec('0x2a')](function(_0x53a2b8){if(_0x53a2b8){var _0x2e1e34=_[_0xb7ec('0x6a')](_0x53a2b8,function(_0x3fc518){var _0x1c497a=_0x3fc518[_0xb7ec('0x2b')]({'plain':!![]});return _0x1c497a[_0xb7ec('0x67')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x485c7c[_0xb7ec('0x47')]['id']}})['then'](function(_0x51792d){return db[_0xb7ec('0x6b')][_0xb7ec('0x6c')](function(_0x4dbe49){return _0x51792d[_0xb7ec('0x6d')](_0x4a8862,{'transaction':_0x4dbe49})[_0xb7ec('0x2a')](function(){return BPromise[_0xb7ec('0x6e')](_0x2e1e34,function(_0x3cdea7){return db[_0xb7ec('0x53')][_0xb7ec('0x6f')]({'where':{'UserId':_0x3cdea7['id'],'OpenchannelQueueId':_0x485c7c[_0xb7ec('0x47')]['id']},'transaction':_0x4dbe49});});})['then'](function(){_0x2e1e34[_0xb7ec('0x70')](function(_0x370f01){socket[_0xb7ec('0x71')](_0xb7ec('0x72'),{'UserId':_0x370f01['id'],'OpenchannelQueueId':_0x51792d['id']});});});});});}})['then'](respondWithStatusCode(_0x579dd2,null))[_0xb7ec('0x4a')](handleError(_0x579dd2,null));};exports['removeTeams']=function(_0x37eb29,_0x412bc2,_0x21dbe9){return db[_0xb7ec('0x65')]['findAll']({'where':{'id':_0x37eb29[_0xb7ec('0x36')][_0xb7ec('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x412bc2,null))[_0xb7ec('0x2a')](function(_0x446faf){var _0x2fa6c2=_[_0xb7ec('0x30')](_0x446faf,'id');var _0x4c2359=[];var _0x124995=[];var _0x2f2a35=squel['select']();_0x2f2a35[_0xb7ec('0x73')]('tq.TeamId')['from'](_0xb7ec('0x74'),'tq')[_0xb7ec('0x75')](_0xb7ec('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb7ec('0x3f')]('OpenchannelQueueId\x20=\x20?',_0x37eb29[_0xb7ec('0x47')]['id']);for(var _0x21db31=0x0;_0x21db31<_0x446faf[_0xb7ec('0x3c')];_0x21db31+=0x1){let _0x443496=_0x446faf[_0x21db31];for(var _0x4262e3=0x0;_0x4262e3<_0x443496[_0xb7ec('0x67')][_0xb7ec('0x3c')];_0x4262e3+=0x1){let _0x530764=_0x443496[_0xb7ec('0x67')][_0x4262e3];var _0x374ec4=_0x2f2a35[_0xb7ec('0x77')]();_0x374ec4[_0xb7ec('0x3f')]('ut.UserId\x20=\x20?',_0x530764['id']);_0x124995[_0xb7ec('0x78')](db[_0xb7ec('0x6b')]['query'](_0x374ec4[_0xb7ec('0x79')](),{'type':db[_0xb7ec('0x6b')][_0xb7ec('0x7a')][_0xb7ec('0x7b')]})['then'](function(_0x2e09b6){if(_0x2e09b6[_0xb7ec('0x3c')]===0x1){return _0x530764['id'];}else{var _0x40c8c5=_[_0xb7ec('0x7c')](_[_0xb7ec('0x30')](_0x2e09b6,_0xb7ec('0x7d')),function(_0x1a49a9){return _['includes'](_0x2fa6c2,_0x1a49a9);});if(_0x40c8c5){return _0x530764['id'];}}}));}}return BPromise[_0xb7ec('0x7e')](_0x124995)[_0xb7ec('0x2a')](function(_0x740750){_0x4c2359=_(_0x4c2359)['union'](_0x740750)[_0xb7ec('0x7f')]()[_0xb7ec('0x80')]();return db['OpenchannelQueue'][_0xb7ec('0x49')]({'where':{'id':_0x37eb29[_0xb7ec('0x47')]['id']}})[_0xb7ec('0x2a')](function(_0x12c597){return db[_0xb7ec('0x6b')][_0xb7ec('0x6c')](function(_0x470340){return _0x12c597['removeTeams'](_0x37eb29['query'][_0xb7ec('0x64')],{'transaction':_0x470340})[_0xb7ec('0x2a')](function(){if(!_[_0xb7ec('0x81')](_0x4c2359)){return _0x12c597['removeAgents'](_0x4c2359,{'transaction':_0x470340});}})[_0xb7ec('0x2a')](function(){_0x4c2359[_0xb7ec('0x70')](function(_0x1e461a){socket[_0xb7ec('0x71')](_0xb7ec('0x82'),{'UserId':_0x1e461a,'OpenchannelQueueId':_0x12c597['id']});});});});});});})[_0xb7ec('0x2a')](respondWithStatusCode(_0x412bc2,null))[_0xb7ec('0x4a')](handleError(_0x412bc2,null));};exports[_0xb7ec('0x83')]=function(_0x12474a,_0x22a23b,_0x329d6e){return db[_0xb7ec('0x31')][_0xb7ec('0x49')]({'where':{'id':_0x12474a[_0xb7ec('0x47')]['id']}})['then'](handleEntityNotFound(_0x22a23b,null))[_0xb7ec('0x2a')](function(_0x3100ae){if(_0x3100ae){return _0x3100ae[_0xb7ec('0x83')](_0x12474a[_0xb7ec('0x4c')][_0xb7ec('0x64')],_[_0xb7ec('0x84')](_0x12474a[_0xb7ec('0x4c')],[_0xb7ec('0x64'),'id'])||{})['spread'](function(_0x2aab63){for(var _0x1e23b9=0x0;_0x1e23b9<_0x12474a[_0xb7ec('0x4c')][_0xb7ec('0x64')][_0xb7ec('0x3c')];_0x1e23b9+=0x1){socket[_0xb7ec('0x71')]('userOpenchannelQueue:save',{'UserId':Number(_0x12474a[_0xb7ec('0x4c')][_0xb7ec('0x64')][_0x1e23b9]),'OpenchannelQueueId':Number(_0x12474a['params']['id'])});}return _0x2aab63;});}})[_0xb7ec('0x2a')](respondWithResult(_0x22a23b,null))['catch'](handleError(_0x22a23b,null));};exports['removeAgents']=function(_0x53b22e,_0xc4c80b,_0x812faf){return db[_0xb7ec('0x31')][_0xb7ec('0x49')]({'where':{'id':_0x53b22e['params']['id']}})[_0xb7ec('0x2a')](handleEntityNotFound(_0xc4c80b,null))[_0xb7ec('0x2a')](function(_0x2d185b){if(_0x2d185b){return _0x2d185b[_0xb7ec('0x85')](_0x53b22e['query'][_0xb7ec('0x64')])[_0xb7ec('0x2a')](function(){if(_[_0xb7ec('0x86')](_0x53b22e[_0xb7ec('0x36')][_0xb7ec('0x64')])){for(var _0x1f7cac=0x0;_0x1f7cac<_0x53b22e[_0xb7ec('0x36')]['ids'][_0xb7ec('0x3c')];_0x1f7cac+=0x1){socket[_0xb7ec('0x71')](_0xb7ec('0x82'),{'UserId':Number(_0x53b22e[_0xb7ec('0x36')][_0xb7ec('0x64')][_0x1f7cac]),'OpenchannelQueueId':Number(_0x53b22e['params']['id'])});}}else{socket[_0xb7ec('0x71')](_0xb7ec('0x82'),{'UserId':Number(_0x53b22e['query'][_0xb7ec('0x64')]),'OpenchannelQueueId':Number(_0x53b22e[_0xb7ec('0x47')]['id'])});}});}})[_0xb7ec('0x2a')](respondWithStatusCode(_0xc4c80b,null))[_0xb7ec('0x4a')](handleError(_0xc4c80b,null));};exports['getAgents']=function(_0x1cd47c,_0x4ca55c,_0x2edd06){var _0x33a14a={};var _0x47729c={};var _0x4a131c;var _0x10f2dd;return db[_0xb7ec('0x31')][_0xb7ec('0x63')]({'where':{'id':_0x1cd47c[_0xb7ec('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ca55c,null))[_0xb7ec('0x2a')](function(_0x99fd34){if(_0x99fd34){_0x4a131c=_0x99fd34;_0x47729c[_0xb7ec('0x35')]=_[_0xb7ec('0x37')](db[_0xb7ec('0x58')]['rawAttributes']);_0x47729c[_0xb7ec('0x36')]=_['keys'](_0x1cd47c[_0xb7ec('0x36')]);_0x47729c[_0xb7ec('0x38')]=_['intersection'](_0x47729c[_0xb7ec('0x35')],_0x47729c[_0xb7ec('0x36')]);_0x33a14a[_0xb7ec('0x3b')]=_[_0xb7ec('0x39')](_0x47729c[_0xb7ec('0x35')],qs[_0xb7ec('0x3a')](_0x1cd47c[_0xb7ec('0x36')][_0xb7ec('0x3a')]));_0x33a14a['attributes']=_0x33a14a[_0xb7ec('0x3b')][_0xb7ec('0x3c')]?_0x33a14a[_0xb7ec('0x3b')]:_0x47729c[_0xb7ec('0x35')];_0x33a14a[_0xb7ec('0x55')]=qs[_0xb7ec('0x3e')](_0x1cd47c[_0xb7ec('0x36')][_0xb7ec('0x3e')]);_0x33a14a[_0xb7ec('0x3f')]=qs[_0xb7ec('0x38')](_[_0xb7ec('0x56')](_0x1cd47c[_0xb7ec('0x36')],_0x47729c[_0xb7ec('0x38')]));if(_0x1cd47c[_0xb7ec('0x36')]['filter']){_0x33a14a[_0xb7ec('0x3f')]=_[_0xb7ec('0x41')](_0x33a14a[_0xb7ec('0x3f')],{'$or':_['map'](_0x33a14a[_0xb7ec('0x3b')],function(_0x53b29e){var _0x209e01={};_0x209e01[_0x53b29e]={'$like':'%'+_0x1cd47c[_0xb7ec('0x36')][_0xb7ec('0x40')]+'%'};return _0x209e01;})});}_0x33a14a=_[_0xb7ec('0x41')]({},_0x33a14a,_0x1cd47c[_0xb7ec('0x43')]);return _0x4a131c[_0xb7ec('0x87')](_0x33a14a);}})['then'](function(_0x1f1f26){if(_0x1f1f26){_0x10f2dd=_0x1f1f26[_0xb7ec('0x3c')];if(!_0x1cd47c[_0xb7ec('0x36')][_0xb7ec('0x3d')](_0xb7ec('0x54'))){_0x33a14a[_0xb7ec('0x21')]=qs[_0xb7ec('0x21')](_0x1cd47c['query'][_0xb7ec('0x21')]);_0x33a14a[_0xb7ec('0x1f')]=qs['offset'](_0x1cd47c[_0xb7ec('0x36')][_0xb7ec('0x1f')]);}return _0x4a131c[_0xb7ec('0x87')](_0x33a14a);}})[_0xb7ec('0x2a')](function(_0x1ec6a4){if(_0x1ec6a4){return _0x1ec6a4?{'count':_0x10f2dd,'rows':_0x1ec6a4}:null;}})['then'](respondWithResult(_0x4ca55c,null))[_0xb7ec('0x4a')](handleError(_0x4ca55c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8e7fc8f..2a59bee 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 _0x50a6=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x4ad00a,_0xd5cc1){var _0x2e8b37=function(_0x5eff13){while(--_0x5eff13){_0x4ad00a['push'](_0x4ad00a['shift']());}};_0x2e8b37(++_0xd5cc1);}(_0x50a6,0x6d));var _0x650a=function(_0x581e1d,_0x1ed7d4){_0x581e1d=_0x581e1d-0x0;var _0x39965b=_0x50a6[_0x581e1d];return _0x39965b;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x650a('0x0'))['db'][_0x650a('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x650a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x650a('0x3')};function emitEvent(_0xe23430){return function(_0x2d9e44,_0x1d91d3,_0x15814d){OpenchannelQueueEvents[_0x650a('0x4')](_0xe23430+':'+_0x2d9e44['id'],_0x2d9e44);OpenchannelQueueEvents['emit'](_0xe23430,_0x2d9e44);_0x15814d(null);};}for(var e in events){if(events[_0x650a('0x5')](e)){var event=events[e];OpenchannelQueue[_0x650a('0x6')](e,emitEvent(event));}}module[_0x650a('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xaa68=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xaa68,0x17e));var _0x8aa6=function(_0x5e0a90,_0x539f42){_0x5e0a90=_0x5e0a90-0x0;var _0x3aceb4=_0xaa68[_0x5e0a90];return _0x3aceb4;};'use strict';var EventEmitter=require(_0x8aa6('0x0'));var OpenchannelQueue=require(_0x8aa6('0x1'))['db'][_0x8aa6('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8aa6('0x3')](0x0);var events={'afterCreate':_0x8aa6('0x4'),'afterUpdate':_0x8aa6('0x5'),'afterDestroy':_0x8aa6('0x6')};function emitEvent(_0x58c90){return function(_0x4df73f,_0x5b9787,_0x505402){OpenchannelQueueEvents[_0x8aa6('0x7')](_0x58c90+':'+_0x4df73f['id'],_0x4df73f);OpenchannelQueueEvents[_0x8aa6('0x7')](_0x58c90,_0x4df73f);_0x505402(null);};}for(var e in events){if(events[_0x8aa6('0x8')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x8aa6('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 0dc13fd..33872b0 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 _0xac38=['../../config/logger','moment','request-promise','../../config/environment','exports','OpenchannelQueue','openchannel_queues','util'];(function(_0x1cbfd3,_0x8b30a4){var _0x400c68=function(_0x391773){while(--_0x391773){_0x1cbfd3['push'](_0x1cbfd3['shift']());}};_0x400c68(++_0x8b30a4);}(_0xac38,0x13f));var _0x8ac3=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0xac38[_0x2cc711];return _0x31a52e;};'use strict';var _=require('lodash');var util=require(_0x8ac3('0x0'));var logger=require(_0x8ac3('0x1'))('api');var moment=require(_0x8ac3('0x2'));var BPromise=require('bluebird');var rp=require(_0x8ac3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8ac3('0x4'));var attributes=require('./openchannelQueue.attributes');module[_0x8ac3('0x5')]=function(_0x5cf37b,_0x3d3969){return _0x5cf37b['define'](_0x8ac3('0x6'),attributes,{'tableName':_0x8ac3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc05d=['request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','util','../../config/logger','api','bluebird'];(function(_0x540e54,_0x86cd79){var _0x3805e5=function(_0x59199d){while(--_0x59199d){_0x540e54['push'](_0x540e54['shift']());}};_0x3805e5(++_0x86cd79);}(_0xc05d,0x150));var _0xdc05=function(_0x32087c,_0x13af17){_0x32087c=_0x32087c-0x0;var _0x492386=_0xc05d[_0x32087c];return _0x492386;};'use strict';var _=require('lodash');var util=require(_0xdc05('0x0'));var logger=require(_0xdc05('0x1'))(_0xdc05('0x2'));var moment=require('moment');var BPromise=require(_0xdc05('0x3'));var rp=require(_0xdc05('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc05('0x5'));var config=require(_0xdc05('0x6'));var attributes=require(_0xdc05('0x7'));module['exports']=function(_0x5b0f99,_0xa4e4e9){return _0x5b0f99[_0xdc05('0x8')]('OpenchannelQueue',attributes,{'tableName':_0xdc05('0x9'),'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 2ebd70b..f2e5884 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 _0xd0b0=['http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xe096fd,_0x221b15){var _0x116b36=function(_0xa4436a){while(--_0xa4436a){_0xe096fd['push'](_0xe096fd['shift']());}};_0x116b36(++_0x221b15);}(_0xd0b0,0x135));var _0x0d0b=function(_0x39238c,_0x4cc91c){_0x39238c=_0x39238c-0x0;var _0xfa45b3=_0xd0b0[_0x39238c];return _0xfa45b3;};'use strict';var _=require(_0x0d0b('0x0'));var util=require(_0x0d0b('0x1'));var moment=require(_0x0d0b('0x2'));var BPromise=require(_0x0d0b('0x3'));var rs=require(_0x0d0b('0x4'));var fs=require('fs');var Redis=require(_0x0d0b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d0b('0x6'));var logger=require(_0x0d0b('0x7'))(_0x0d0b('0x8'));var config=require(_0x0d0b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0d0b('0xa')][_0x0d0b('0xb')]({'port':0x232a});config[_0x0d0b('0xc')]=_[_0x0d0b('0xd')](config[_0x0d0b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d0b('0xe'))(new Redis(config['redis']));require(_0x0d0b('0xf'))['register'](socket);function respondWithRpcPromise(_0x2723dd,_0x5db5a1,_0x494e79){return new BPromise(function(_0x31488e,_0x41dc79){return client[_0x0d0b('0x10')](_0x2723dd,_0x494e79)['then'](function(_0x2cd832){logger[_0x0d0b('0x11')](_0x0d0b('0x12'),_0x5db5a1,_0x0d0b('0x13'));logger[_0x0d0b('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5db5a1,_0x0d0b('0x13'),JSON[_0x0d0b('0x15')](_0x2cd832));if(_0x2cd832[_0x0d0b('0x16')]){if(_0x2cd832[_0x0d0b('0x16')]['code']===0x1f4){logger[_0x0d0b('0x16')](_0x0d0b('0x12'),_0x5db5a1,_0x2cd832[_0x0d0b('0x16')][_0x0d0b('0x17')]);return _0x41dc79(_0x2cd832[_0x0d0b('0x16')][_0x0d0b('0x17')]);}logger[_0x0d0b('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x5db5a1,_0x2cd832[_0x0d0b('0x16')][_0x0d0b('0x17')]);return _0x31488e(_0x2cd832[_0x0d0b('0x16')][_0x0d0b('0x17')]);}else{logger[_0x0d0b('0x11')](_0x0d0b('0x12'),_0x5db5a1,_0x0d0b('0x13'));_0x31488e(_0x2cd832[_0x0d0b('0x18')][_0x0d0b('0x17')]);}})[_0x0d0b('0x19')](function(_0x50711a){logger[_0x0d0b('0x16')](_0x0d0b('0x12'),_0x5db5a1,_0x50711a);_0x41dc79(_0x50711a);});});}exports[_0x0d0b('0x1a')]=function(_0x5d54a5){var _0x49a868=this;return new Promise(function(_0x50eafd,_0x29a600){return db[_0x0d0b('0x1b')][_0x0d0b('0x1c')]({'raw':_0x5d54a5[_0x0d0b('0x1d')]?_0x5d54a5[_0x0d0b('0x1d')][_0x0d0b('0x1e')]===undefined?!![]:![]:!![],'where':_0x5d54a5[_0x0d0b('0x1d')]?_0x5d54a5['options'][_0x0d0b('0x1f')]||null:null,'attributes':_0x5d54a5['options']?_0x5d54a5[_0x0d0b('0x1d')]['attributes']||null:null,'limit':_0x5d54a5[_0x0d0b('0x1d')]?_0x5d54a5[_0x0d0b('0x1d')][_0x0d0b('0x20')]||null:null,'include':_0x5d54a5[_0x0d0b('0x1d')]?_0x5d54a5[_0x0d0b('0x1d')][_0x0d0b('0x21')]?_[_0x0d0b('0x22')](_0x5d54a5[_0x0d0b('0x1d')][_0x0d0b('0x21')],function(_0x54f987){return{'model':db[_0x54f987[_0x0d0b('0x23')]],'as':_0x54f987['as'],'attributes':_0x54f987[_0x0d0b('0x24')],'include':_0x54f987['include']?_[_0x0d0b('0x22')](_0x54f987['include'],function(_0x3936e5){return{'model':db[_0x3936e5[_0x0d0b('0x23')]],'as':_0x3936e5['as'],'attributes':_0x3936e5['attributes'],'include':_0x3936e5['include']?_[_0x0d0b('0x22')](_0x3936e5['include'],function(_0x1bf5ba){return{'model':db[_0x1bf5ba[_0x0d0b('0x23')]],'as':_0x1bf5ba['as'],'attributes':_0x1bf5ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d0b('0x25')](function(_0x21d6bb){logger[_0x0d0b('0x11')](_0x0d0b('0x1a'),_0x5d54a5);logger[_0x0d0b('0x14')](_0x0d0b('0x1a'),_0x5d54a5,JSON[_0x0d0b('0x15')](_0x21d6bb));_0x50eafd(_0x21d6bb);})[_0x0d0b('0x19')](function(_0x2f3345){logger[_0x0d0b('0x16')](_0x0d0b('0x1a'),_0x2f3345['message'],_0x5d54a5);_0x29a600(_0x49a868[_0x0d0b('0x16')](0x1f4,_0x2f3345[_0x0d0b('0x17')]));});});};exports[_0x0d0b('0x26')]=function(_0x31a83d){var _0x22e8e1=this;return new Promise(function(_0x34f026,_0x839c30){return db[_0x0d0b('0x1b')][_0x0d0b('0x27')]({'raw':_0x31a83d['options']?_0x31a83d['options']['raw']===undefined?!![]:![]:!![],'where':_0x31a83d[_0x0d0b('0x1d')]?_0x31a83d[_0x0d0b('0x1d')][_0x0d0b('0x1f')]||null:null,'attributes':_0x31a83d[_0x0d0b('0x1d')]?_0x31a83d[_0x0d0b('0x1d')][_0x0d0b('0x24')]||null:null,'include':_0x31a83d[_0x0d0b('0x1d')]?_0x31a83d[_0x0d0b('0x1d')][_0x0d0b('0x21')]?_[_0x0d0b('0x22')](_0x31a83d[_0x0d0b('0x1d')]['include'],function(_0x4aaddc){return{'model':db[_0x4aaddc[_0x0d0b('0x23')]],'as':_0x4aaddc['as'],'attributes':_0x4aaddc['attributes'],'include':_0x4aaddc[_0x0d0b('0x21')]?_[_0x0d0b('0x22')](_0x4aaddc[_0x0d0b('0x21')],function(_0x8fc63d){return{'model':db[_0x8fc63d[_0x0d0b('0x23')]],'as':_0x8fc63d['as'],'attributes':_0x8fc63d[_0x0d0b('0x24')],'include':_0x8fc63d[_0x0d0b('0x21')]?_[_0x0d0b('0x22')](_0x8fc63d[_0x0d0b('0x21')],function(_0x29420e){return{'model':db[_0x29420e[_0x0d0b('0x23')]],'as':_0x29420e['as'],'attributes':_0x29420e[_0x0d0b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0d0b('0x25')](function(_0x29663f){logger['info'](_0x0d0b('0x26'),_0x31a83d);logger[_0x0d0b('0x14')]('ShowOpenchannelQueue',_0x31a83d,JSON[_0x0d0b('0x15')](_0x29663f));_0x34f026(_0x29663f);})[_0x0d0b('0x19')](function(_0x1d5b14){logger['error'](_0x0d0b('0x26'),_0x1d5b14[_0x0d0b('0x17')],_0x31a83d);_0x839c30(_0x22e8e1['error'](0x1f4,_0x1d5b14[_0x0d0b('0x17')]));});});}; \ No newline at end of file +var _0xe24a=['model','map','ShowOpenchannelQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','attributes','limit','include'];(function(_0x38ca4c,_0x33fe0b){var _0x54e3dd=function(_0x26a965){while(--_0x26a965){_0x38ca4c['push'](_0x38ca4c['shift']());}};_0x54e3dd(++_0x33fe0b);}(_0xe24a,0x1b3));var _0xae24=function(_0x37fe9a,_0x1e0c8f){_0x37fe9a=_0x37fe9a-0x0;var _0x1f65f0=_0xe24a[_0x37fe9a];return _0x1f65f0;};'use strict';var _=require('lodash');var util=require(_0xae24('0x0'));var moment=require(_0xae24('0x1'));var BPromise=require(_0xae24('0x2'));var rs=require(_0xae24('0x3'));var fs=require('fs');var Redis=require(_0xae24('0x4'));var db=require(_0xae24('0x5'))['db'];var utils=require(_0xae24('0x6'));var logger=require(_0xae24('0x7'))(_0xae24('0x8'));var config=require(_0xae24('0x9'));var jayson=require(_0xae24('0xa'));var client=jayson[_0xae24('0xb')][_0xae24('0xc')]({'port':0x232a});config['redis']=_[_0xae24('0xd')](config[_0xae24('0xe')],{'host':_0xae24('0xf'),'port':0x18eb});var socket=require(_0xae24('0x10'))(new Redis(config[_0xae24('0xe')]));require(_0xae24('0x11'))[_0xae24('0x12')](socket);function respondWithRpcPromise(_0x4fa974,_0x4e1879,_0x2eee33){return new BPromise(function(_0x5a1fe8,_0x504406){return client[_0xae24('0x13')](_0x4fa974,_0x2eee33)[_0xae24('0x14')](function(_0x4d67d7){logger[_0xae24('0x15')](_0xae24('0x16'),_0x4e1879,_0xae24('0x17'));logger[_0xae24('0x18')](_0xae24('0x19'),_0x4e1879,_0xae24('0x17'),JSON[_0xae24('0x1a')](_0x4d67d7));if(_0x4d67d7[_0xae24('0x1b')]){if(_0x4d67d7[_0xae24('0x1b')][_0xae24('0x1c')]===0x1f4){logger['error'](_0xae24('0x16'),_0x4e1879,_0x4d67d7['error'][_0xae24('0x1d')]);return _0x504406(_0x4d67d7[_0xae24('0x1b')][_0xae24('0x1d')]);}logger[_0xae24('0x1b')](_0xae24('0x16'),_0x4e1879,_0x4d67d7['error'][_0xae24('0x1d')]);return _0x5a1fe8(_0x4d67d7[_0xae24('0x1b')][_0xae24('0x1d')]);}else{logger[_0xae24('0x15')](_0xae24('0x16'),_0x4e1879,_0xae24('0x17'));_0x5a1fe8(_0x4d67d7['result'][_0xae24('0x1d')]);}})[_0xae24('0x1e')](function(_0x419b96){logger[_0xae24('0x1b')](_0xae24('0x16'),_0x4e1879,_0x419b96);_0x504406(_0x419b96);});});}exports[_0xae24('0x1f')]=function(_0x32f4e6){var _0x279c15=this;return new Promise(function(_0x3629e8,_0x11a5ee){return db[_0xae24('0x20')]['findAll']({'raw':_0x32f4e6['options']?_0x32f4e6[_0xae24('0x21')][_0xae24('0x22')]===undefined?!![]:![]:!![],'where':_0x32f4e6['options']?_0x32f4e6['options']['where']||null:null,'attributes':_0x32f4e6[_0xae24('0x21')]?_0x32f4e6[_0xae24('0x21')][_0xae24('0x23')]||null:null,'limit':_0x32f4e6[_0xae24('0x21')]?_0x32f4e6[_0xae24('0x21')][_0xae24('0x24')]||null:null,'include':_0x32f4e6[_0xae24('0x21')]?_0x32f4e6[_0xae24('0x21')][_0xae24('0x25')]?_['map'](_0x32f4e6[_0xae24('0x21')][_0xae24('0x25')],function(_0x2b703d){return{'model':db[_0x2b703d[_0xae24('0x26')]],'as':_0x2b703d['as'],'attributes':_0x2b703d[_0xae24('0x23')],'include':_0x2b703d[_0xae24('0x25')]?_[_0xae24('0x27')](_0x2b703d[_0xae24('0x25')],function(_0x5df345){return{'model':db[_0x5df345[_0xae24('0x26')]],'as':_0x5df345['as'],'attributes':_0x5df345[_0xae24('0x23')],'include':_0x5df345['include']?_['map'](_0x5df345[_0xae24('0x25')],function(_0x4700f4){return{'model':db[_0x4700f4[_0xae24('0x26')]],'as':_0x4700f4['as'],'attributes':_0x4700f4[_0xae24('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49141e){logger[_0xae24('0x15')](_0xae24('0x1f'),_0x32f4e6);logger[_0xae24('0x18')]('GetOpenchannelQueue',_0x32f4e6,JSON[_0xae24('0x1a')](_0x49141e));_0x3629e8(_0x49141e);})[_0xae24('0x1e')](function(_0x457211){logger['error']('GetOpenchannelQueue',_0x457211['message'],_0x32f4e6);_0x11a5ee(_0x279c15['error'](0x1f4,_0x457211['message']));});});};exports[_0xae24('0x28')]=function(_0x3d5751){var _0x216f86=this;return new Promise(function(_0x182038,_0x453f8e){return db[_0xae24('0x20')][_0xae24('0x29')]({'raw':_0x3d5751[_0xae24('0x21')]?_0x3d5751[_0xae24('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x3d5751['options']?_0x3d5751['options'][_0xae24('0x2a')]||null:null,'attributes':_0x3d5751['options']?_0x3d5751[_0xae24('0x21')][_0xae24('0x23')]||null:null,'include':_0x3d5751[_0xae24('0x21')]?_0x3d5751[_0xae24('0x21')][_0xae24('0x25')]?_[_0xae24('0x27')](_0x3d5751[_0xae24('0x21')][_0xae24('0x25')],function(_0x308c02){return{'model':db[_0x308c02[_0xae24('0x26')]],'as':_0x308c02['as'],'attributes':_0x308c02[_0xae24('0x23')],'include':_0x308c02['include']?_[_0xae24('0x27')](_0x308c02[_0xae24('0x25')],function(_0x131bde){return{'model':db[_0x131bde[_0xae24('0x26')]],'as':_0x131bde['as'],'attributes':_0x131bde[_0xae24('0x23')],'include':_0x131bde[_0xae24('0x25')]?_[_0xae24('0x27')](_0x131bde[_0xae24('0x25')],function(_0x2089be){return{'model':db[_0x2089be[_0xae24('0x26')]],'as':_0x2089be['as'],'attributes':_0x2089be[_0xae24('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52b8ca){logger['info'](_0xae24('0x28'),_0x3d5751);logger[_0xae24('0x18')](_0xae24('0x28'),_0x3d5751,JSON[_0xae24('0x1a')](_0x52b8ca));_0x182038(_0x52b8ca);})[_0xae24('0x1e')](function(_0x1b6e55){logger['error'](_0xae24('0x28'),_0x1b6e55[_0xae24('0x1d')],_0x3d5751);_0x453f8e(_0x216f86['error'](0x1f4,_0x1b6e55[_0xae24('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index f2a0d43..439553e 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 _0x8057=['remove','update','emit','removeListener','openchannelQueue:'];(function(_0x340f62,_0x42d4a3){var _0x82a7d8=function(_0x3b0487){while(--_0x3b0487){_0x340f62['push'](_0x340f62['shift']());}};_0x82a7d8(++_0x42d4a3);}(_0x8057,0x140));var _0x7805=function(_0x4ed891,_0x5d3a1e){_0x4ed891=_0x4ed891-0x0;var _0xe5fce3=_0x8057[_0x4ed891];return _0xe5fce3;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x7805('0x0'),_0x7805('0x1')];function createListener(_0x581d25,_0x396fad){return function(_0x42fcf7){_0x396fad[_0x7805('0x2')](_0x581d25,_0x42fcf7);};}function removeListener(_0x5f2844,_0x4e9a91){return function(){OpenchannelQueueEvents[_0x7805('0x3')](_0x5f2844,_0x4e9a91);};}exports['register']=function(_0x2ed71d){for(var _0xf2715b=0x0,_0x43df01=events['length'];_0xf2715b<_0x43df01;_0xf2715b++){var _0x132ac1=events[_0xf2715b];var _0x5318af=createListener(_0x7805('0x4')+_0x132ac1,_0x2ed71d);OpenchannelQueueEvents['on'](_0x132ac1,_0x5318af);}}; \ No newline at end of file +var _0x616a=['length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener','register'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x616a,0x1b2));var _0xa616=function(_0x2ff7b6,_0x5d62d5){_0x2ff7b6=_0x2ff7b6-0x0;var _0x9edd1b=_0x616a[_0x2ff7b6];return _0x9edd1b;};'use strict';var OpenchannelQueueEvents=require(_0xa616('0x0'));var events=[_0xa616('0x1'),_0xa616('0x2'),'update'];function createListener(_0x5a803f,_0x135e81){return function(_0x63bedf){_0x135e81[_0xa616('0x3')](_0x5a803f,_0x63bedf);};}function removeListener(_0x1722fa,_0x177b3d){return function(){OpenchannelQueueEvents[_0xa616('0x4')](_0x1722fa,_0x177b3d);};}exports[_0xa616('0x5')]=function(_0x59f7ff){for(var _0x333452=0x0,_0x596472=events[_0xa616('0x6')];_0x333452<_0x596472;_0x333452++){var _0x556737=events[_0x333452];var _0xde8abb=createListener(_0xa616('0x7')+_0x556737,_0x59f7ff);OpenchannelQueueEvents['on'](_0x556737,_0xde8abb);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index c8ab065..13e98bc 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 _0x7c6d=['post','create','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x7c6d,0xd6));var _0xd7c6=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x7c6d[_0x2cf2e9];return _0xd3670d;};'use strict';var multer=require(_0xd7c6('0x0'));var util=require('util');var path=require(_0xd7c6('0x1'));var timeout=require(_0xd7c6('0x2'));var express=require(_0xd7c6('0x3'));var router=express[_0xd7c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd7c6('0x5'));var config=require('../../config/environment');var controller=require(_0xd7c6('0x6'));router[_0xd7c6('0x7')]('/',auth['isAuthenticated'](),controller[_0xd7c6('0x8')]);router['get'](_0xd7c6('0x9'),auth[_0xd7c6('0xa')](),controller[_0xd7c6('0xb')]);router['get'](_0xd7c6('0xc'),auth['isAuthenticated'](),controller[_0xd7c6('0xd')]);router[_0xd7c6('0xe')]('/',auth[_0xd7c6('0xa')](),controller[_0xd7c6('0xf')]);router[_0xd7c6('0x10')](_0xd7c6('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd7c6('0x11')](_0xd7c6('0xc'),auth[_0xd7c6('0xa')](),controller['destroy']);module[_0xd7c6('0x12')]=router; \ No newline at end of file +var _0xed8d=['show','post','create','put','/:id','update','delete','destroy','exports','express','fs-extra','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xed8d,0x1b9));var _0xded8=function(_0x52f498,_0xeec0c3){_0x52f498=_0x52f498-0x0;var _0x2a97cb=_0xed8d[_0x52f498];return _0x2a97cb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xded8('0x0'));var router=express['Router']();var fs_extra=require(_0xded8('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xded8('0x2'));var config=require('../../config/environment');var controller=require(_0xded8('0x3'));router[_0xded8('0x4')]('/',auth[_0xded8('0x5')](),controller['index']);router[_0xded8('0x4')](_0xded8('0x6'),auth[_0xded8('0x5')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xded8('0x7')]);router[_0xded8('0x8')]('/',auth[_0xded8('0x5')](),controller[_0xded8('0x9')]);router[_0xded8('0xa')](_0xded8('0xb'),auth[_0xded8('0x5')](),controller[_0xded8('0xc')]);router[_0xded8('0xd')](_0xded8('0xb'),auth['isAuthenticated'](),controller[_0xded8('0xe')]);module[_0xded8('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 13c1578..0c29f92 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 _0xb2be=['sequelize','exports','STRING','DATE','moment'];(function(_0x5d72c8,_0x85e2e1){var _0x3abc9e=function(_0x1311b){while(--_0x1311b){_0x5d72c8['push'](_0x5d72c8['shift']());}};_0x3abc9e(++_0x85e2e1);}(_0xb2be,0x1da));var _0xeb2b=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0xb2be[_0x14d250];return _0xb991d8;};'use strict';var moment=require(_0xeb2b('0x0'));var Sequelize=require(_0xeb2b('0x1'));module[_0xeb2b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xeb2b('0x3')]},'joinAt':{'type':Sequelize[_0xeb2b('0x4')]},'leaveAt':{'type':Sequelize[_0xeb2b('0x4')]},'acceptAt':{'type':Sequelize[_0xeb2b('0x4')]},'exitAt':{'type':Sequelize[_0xeb2b('0x4')]},'reason':{'type':Sequelize[_0xeb2b('0x3')]}}; \ No newline at end of file +var _0x08aa=['STRING','DATE','sequelize','exports'];(function(_0x116117,_0x597217){var _0x3e4035=function(_0x3e7fce){while(--_0x3e7fce){_0x116117['push'](_0x116117['shift']());}};_0x3e4035(++_0x597217);}(_0x08aa,0x9a));var _0xa08a=function(_0x485c48,_0x200b1a){_0x485c48=_0x485c48-0x0;var _0x129013=_0x08aa[_0x485c48];return _0x129013;};'use strict';var moment=require('moment');var Sequelize=require(_0xa08a('0x0'));module[_0xa08a('0x1')]={'uniqueid':{'type':Sequelize[_0xa08a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa08a('0x2')]},'joinAt':{'type':Sequelize[_0xa08a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa08a('0x3')]},'exitAt':{'type':Sequelize[_0xa08a('0x3')]},'reason':{'type':Sequelize[_0xa08a('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 3ec8e2e..72a5f91 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 _0x7c4d=['util','path','sox','ejs','lodash','squel','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c4d,0x19e));var _0xd7c4=function(_0x4fcca6,_0x29466d){_0x4fcca6=_0x4fcca6-0x0;var _0x2719a0=_0x7c4d[_0x4fcca6];return _0x2719a0;};'use strict';var emlformat=require(_0xd7c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7c4('0x1'));var jsonpatch=require(_0xd7c4('0x2'));var rp=require('request-promise');var moment=require(_0xd7c4('0x3'));var BPromise=require(_0xd7c4('0x4'));var Mustache=require(_0xd7c4('0x5'));var util=require(_0xd7c4('0x6'));var path=require(_0xd7c4('0x7'));var sox=require(_0xd7c4('0x8'));var csv=require('to-csv');var ejs=require(_0xd7c4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7c4('0xa'));var squel=require(_0xd7c4('0xb'));var crypto=require(_0xd7c4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd7c4('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd7c4('0xe'));var authService=require(_0xd7c4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd7c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7c4('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd7c4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7c4('0x13'))['db'];function respondWithStatusCode(_0x1f9e40,_0x1ef23e){_0x1ef23e=_0x1ef23e||0xcc;return function(_0x3495fb){if(_0x3495fb){return _0x1f9e40[_0xd7c4('0x14')](_0x1ef23e);}return _0x1f9e40[_0xd7c4('0x15')](_0x1ef23e)[_0xd7c4('0x16')]();};}function respondWithResult(_0x450950,_0x1eb670){_0x1eb670=_0x1eb670||0xc8;return function(_0x55561e){if(_0x55561e){return _0x450950[_0xd7c4('0x15')](_0x1eb670)[_0xd7c4('0x17')](_0x55561e);}};}function respondWithFilteredResult(_0x4dc5b3,_0x5a9824){return function(_0x57b1b1){if(_0x57b1b1){var _0x31b077=typeof _0x5a9824['offset']===_0xd7c4('0x18')&&typeof _0x5a9824['limit']==='undefined';var _0xe7bc29=_0x57b1b1[_0xd7c4('0x19')];var _0x52d224=_0x31b077?0x0:_0x5a9824[_0xd7c4('0x1a')];var _0x5280c6=_0x31b077?_0x57b1b1[_0xd7c4('0x19')]:_0x5a9824[_0xd7c4('0x1a')]+_0x5a9824[_0xd7c4('0x1b')];var _0x1ba719;if(_0x5280c6>=_0xe7bc29){_0x5280c6=_0xe7bc29;_0x1ba719=0xc8;}else{_0x1ba719=0xce;}_0x4dc5b3['status'](_0x1ba719);return _0x4dc5b3[_0xd7c4('0x1c')]('Content-Range',_0x52d224+'-'+_0x5280c6+'/'+_0xe7bc29)[_0xd7c4('0x17')](_0x57b1b1);}return null;};}function patchUpdates(_0x296ee9){return function(_0x4e4102){try{jsonpatch[_0xd7c4('0x1d')](_0x4e4102,_0x296ee9,!![]);}catch(_0x5ac268){return BPromise[_0xd7c4('0x1e')](_0x5ac268);}return _0x4e4102[_0xd7c4('0x1f')]();};}function saveUpdates(_0x20e8d1,_0x3aa0f8){return function(_0x1d3598){if(_0x1d3598){return _0x1d3598[_0xd7c4('0x20')](_0x20e8d1)[_0xd7c4('0x21')](function(_0x5f53b7){return _0x5f53b7;});}return null;};}function removeEntity(_0x38c3e6,_0x601dfb){return function(_0x40c8f8){if(_0x40c8f8){return _0x40c8f8[_0xd7c4('0x22')]()[_0xd7c4('0x21')](function(){_0x38c3e6['status'](0xcc)[_0xd7c4('0x16')]();});}};}function handleEntityNotFound(_0x3cab71,_0x3ae19a){return function(_0x533d80){if(!_0x533d80){_0x3cab71[_0xd7c4('0x14')](0x194);}return _0x533d80;};}function handleError(_0x25943e,_0x879b06){_0x879b06=_0x879b06||0x1f4;return function(_0x207a3f){logger[_0xd7c4('0x23')](_0x207a3f['stack']);if(_0x207a3f[_0xd7c4('0x24')]){delete _0x207a3f['name'];}_0x25943e[_0xd7c4('0x15')](_0x879b06)['send'](_0x207a3f);};}exports['index']=function(_0x586581,_0x34d1ef){var _0x4cf90e={},_0x1fdc74={},_0x212295={'count':0x0,'rows':[]};var _0x43a9d9=_[_0xd7c4('0x25')](db[_0xd7c4('0x26')][_0xd7c4('0x27')],function(_0x1fe603){return{'name':_0x1fe603[_0xd7c4('0x28')],'type':_0x1fe603[_0xd7c4('0x29')][_0xd7c4('0x2a')]};});_0x1fdc74['model']=_[_0xd7c4('0x25')](_0x43a9d9,_0xd7c4('0x24'));_0x1fdc74[_0xd7c4('0x2b')]=_['keys'](_0x586581['query']);_0x1fdc74[_0xd7c4('0x2c')]=_[_0xd7c4('0x2d')](_0x1fdc74[_0xd7c4('0x2e')],_0x1fdc74[_0xd7c4('0x2b')]);_0x4cf90e[_0xd7c4('0x2f')]=_[_0xd7c4('0x2d')](_0x1fdc74[_0xd7c4('0x2e')],qs[_0xd7c4('0x30')](_0x586581['query']['fields']));_0x4cf90e['attributes']=_0x4cf90e['attributes'][_0xd7c4('0x31')]?_0x4cf90e[_0xd7c4('0x2f')]:_0x1fdc74[_0xd7c4('0x2e')];if(!_0x586581['query']['hasOwnProperty'](_0xd7c4('0x32'))){_0x4cf90e[_0xd7c4('0x1b')]=qs[_0xd7c4('0x1b')](_0x586581[_0xd7c4('0x2b')]['limit']);_0x4cf90e['offset']=qs[_0xd7c4('0x1a')](_0x586581['query'][_0xd7c4('0x1a')]);}_0x4cf90e[_0xd7c4('0x33')]=qs['sort'](_0x586581['query'][_0xd7c4('0x34')]);_0x4cf90e[_0xd7c4('0x35')]=qs['filters'](_[_0xd7c4('0x36')](_0x586581['query'],_0x1fdc74['filters']),_0x43a9d9);if(_0x586581[_0xd7c4('0x2b')][_0xd7c4('0x37')]){_0x4cf90e['where']=_[_0xd7c4('0x38')](_0x4cf90e[_0xd7c4('0x35')],{'$or':_[_0xd7c4('0x25')](_0x43a9d9,function(_0x350207){if(_0x350207[_0xd7c4('0x29')]!=='VIRTUAL'){var _0x8ca82b={};_0x8ca82b[_0x350207['name']]={'$like':'%'+_0x586581[_0xd7c4('0x2b')][_0xd7c4('0x37')]+'%'};return _0x8ca82b;}})});}_0x4cf90e=_[_0xd7c4('0x38')]({},_0x4cf90e,_0x586581[_0xd7c4('0x39')]);var _0x5e8a93={'where':_0x4cf90e[_0xd7c4('0x35')]};return db['OpenchannelQueueReport']['count'](_0x5e8a93)['then'](function(_0x57c728){_0x212295[_0xd7c4('0x19')]=_0x57c728;if(_0x586581[_0xd7c4('0x2b')][_0xd7c4('0x3a')]){_0x4cf90e[_0xd7c4('0x3b')]=[{'all':!![]}];}return db[_0xd7c4('0x26')][_0xd7c4('0x3c')](_0x4cf90e);})[_0xd7c4('0x21')](function(_0x148f3a){_0x212295[_0xd7c4('0x3d')]=_0x148f3a;return _0x212295;})[_0xd7c4('0x21')](respondWithFilteredResult(_0x34d1ef,_0x4cf90e))['catch'](handleError(_0x34d1ef,null));};exports[_0xd7c4('0x3e')]=function(_0x1a081e,_0x1825fa){var _0x1fa606={'raw':!![],'where':{'id':_0x1a081e[_0xd7c4('0x3f')]['id']}},_0x3f96ff={};_0x3f96ff[_0xd7c4('0x2e')]=_['keys'](db[_0xd7c4('0x26')][_0xd7c4('0x27')]);_0x3f96ff['query']=_[_0xd7c4('0x40')](_0x1a081e[_0xd7c4('0x2b')]);_0x3f96ff['filters']=_[_0xd7c4('0x2d')](_0x3f96ff['model'],_0x3f96ff['query']);_0x1fa606['attributes']=_['intersection'](_0x3f96ff['model'],qs[_0xd7c4('0x30')](_0x1a081e[_0xd7c4('0x2b')]['fields']));_0x1fa606[_0xd7c4('0x2f')]=_0x1fa606[_0xd7c4('0x2f')][_0xd7c4('0x31')]?_0x1fa606['attributes']:_0x3f96ff[_0xd7c4('0x2e')];if(_0x1a081e[_0xd7c4('0x2b')][_0xd7c4('0x3a')]){_0x1fa606[_0xd7c4('0x3b')]=[{'all':!![]}];}_0x1fa606=_['merge']({},_0x1fa606,_0x1a081e[_0xd7c4('0x39')]);return db[_0xd7c4('0x26')]['find'](_0x1fa606)[_0xd7c4('0x21')](handleEntityNotFound(_0x1825fa,null))[_0xd7c4('0x21')](respondWithResult(_0x1825fa,null))[_0xd7c4('0x41')](handleError(_0x1825fa,null));};exports[_0xd7c4('0x42')]=function(_0x1fa873,_0x587226){return db['OpenchannelQueueReport'][_0xd7c4('0x42')](_0x1fa873[_0xd7c4('0x43')],{})[_0xd7c4('0x21')](respondWithResult(_0x587226,0xc9))['catch'](handleError(_0x587226,null));};exports[_0xd7c4('0x20')]=function(_0x212e13,_0x1b4dcd){if(_0x212e13[_0xd7c4('0x43')]['id']){delete _0x212e13[_0xd7c4('0x43')]['id'];}return db[_0xd7c4('0x26')][_0xd7c4('0x44')]({'where':{'id':_0x212e13[_0xd7c4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1b4dcd,null))[_0xd7c4('0x21')](saveUpdates(_0x212e13[_0xd7c4('0x43')],null))[_0xd7c4('0x21')](respondWithResult(_0x1b4dcd,null))['catch'](handleError(_0x1b4dcd,null));};exports[_0xd7c4('0x22')]=function(_0x2d0456,_0x2a6773){return db[_0xd7c4('0x26')]['find']({'where':{'id':_0x2d0456['params']['id']}})[_0xd7c4('0x21')](handleEntityNotFound(_0x2a6773,null))[_0xd7c4('0x21')](removeEntity(_0x2a6773,null))[_0xd7c4('0x41')](handleError(_0x2a6773,null));};exports[_0xd7c4('0x45')]=function(_0xbd1232,_0x14905f){return db[_0xd7c4('0x26')][_0xd7c4('0x45')]()[_0xd7c4('0x21')](respondWithResult(_0x14905f,null))[_0xd7c4('0x41')](handleError(_0x14905f,null));}; \ No newline at end of file +var _0x6ac9=['query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','then','includeAll','findAll','rows','catch','show','params','include','merge','options','find','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','type','key','model','map'];(function(_0x3414ab,_0x5beee8){var _0x3fa9fb=function(_0x443231){while(--_0x443231){_0x3414ab['push'](_0x3414ab['shift']());}};_0x3fa9fb(++_0x5beee8);}(_0x6ac9,0x108));var _0x96ac=function(_0x22a651,_0x59382e){_0x22a651=_0x22a651-0x0;var _0x540790=_0x6ac9[_0x22a651];return _0x540790;};'use strict';var emlformat=require(_0x96ac('0x0'));var rimraf=require(_0x96ac('0x1'));var zipdir=require(_0x96ac('0x2'));var jsonpatch=require(_0x96ac('0x3'));var rp=require('request-promise');var moment=require(_0x96ac('0x4'));var BPromise=require(_0x96ac('0x5'));var Mustache=require(_0x96ac('0x6'));var util=require(_0x96ac('0x7'));var path=require(_0x96ac('0x8'));var sox=require(_0x96ac('0x9'));var csv=require(_0x96ac('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96ac('0xb'));var _=require(_0x96ac('0xc'));var squel=require(_0x96ac('0xd'));var crypto=require(_0x96ac('0xe'));var jsforce=require(_0x96ac('0xf'));var deskjs=require(_0x96ac('0x10'));var toCsv=require(_0x96ac('0xa'));var querystring=require(_0x96ac('0x11'));var Papa=require(_0x96ac('0x12'));var Redis=require(_0x96ac('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x96ac('0x14'));var as=require(_0x96ac('0x15'));var hardwareService=require(_0x96ac('0x16'));var logger=require(_0x96ac('0x17'))(_0x96ac('0x18'));var utils=require('../../config/utils');var config=require(_0x96ac('0x19'));var licenseUtil=require(_0x96ac('0x1a'));var db=require(_0x96ac('0x1b'))['db'];function respondWithStatusCode(_0x561a77,_0x29bf5a){_0x29bf5a=_0x29bf5a||0xcc;return function(_0x2b9891){if(_0x2b9891){return _0x561a77[_0x96ac('0x1c')](_0x29bf5a);}return _0x561a77[_0x96ac('0x1d')](_0x29bf5a)[_0x96ac('0x1e')]();};}function respondWithResult(_0x3e4417,_0x1f4dab){_0x1f4dab=_0x1f4dab||0xc8;return function(_0x41c2b5){if(_0x41c2b5){return _0x3e4417[_0x96ac('0x1d')](_0x1f4dab)[_0x96ac('0x1f')](_0x41c2b5);}};}function respondWithFilteredResult(_0x13875c,_0x261689){return function(_0x52ab19){if(_0x52ab19){var _0x244e1e=typeof _0x261689[_0x96ac('0x20')]===_0x96ac('0x21')&&typeof _0x261689[_0x96ac('0x22')]===_0x96ac('0x21');var _0x3b23ae=_0x52ab19[_0x96ac('0x23')];var _0x1f2821=_0x244e1e?0x0:_0x261689[_0x96ac('0x20')];var _0x5222a3=_0x244e1e?_0x52ab19[_0x96ac('0x23')]:_0x261689[_0x96ac('0x20')]+_0x261689[_0x96ac('0x22')];var _0x27534b;if(_0x5222a3>=_0x3b23ae){_0x5222a3=_0x3b23ae;_0x27534b=0xc8;}else{_0x27534b=0xce;}_0x13875c['status'](_0x27534b);return _0x13875c[_0x96ac('0x24')]('Content-Range',_0x1f2821+'-'+_0x5222a3+'/'+_0x3b23ae)[_0x96ac('0x1f')](_0x52ab19);}return null;};}function patchUpdates(_0x28cb12){return function(_0x35b71f){try{jsonpatch[_0x96ac('0x25')](_0x35b71f,_0x28cb12,!![]);}catch(_0x1e5039){return BPromise['reject'](_0x1e5039);}return _0x35b71f[_0x96ac('0x26')]();};}function saveUpdates(_0x44f45e,_0x2fa38a){return function(_0x565f5b){if(_0x565f5b){return _0x565f5b[_0x96ac('0x27')](_0x44f45e)['then'](function(_0x500159){return _0x500159;});}return null;};}function removeEntity(_0x4b58e8,_0x3a0370){return function(_0xd53545){if(_0xd53545){return _0xd53545[_0x96ac('0x28')]()['then'](function(){_0x4b58e8[_0x96ac('0x1d')](0xcc)[_0x96ac('0x1e')]();});}};}function handleEntityNotFound(_0x1c6df3,_0x2240cf){return function(_0x1b2f6a){if(!_0x1b2f6a){_0x1c6df3[_0x96ac('0x1c')](0x194);}return _0x1b2f6a;};}function handleError(_0x14151b,_0x17b55a){_0x17b55a=_0x17b55a||0x1f4;return function(_0x47f615){logger[_0x96ac('0x29')](_0x47f615[_0x96ac('0x2a')]);if(_0x47f615[_0x96ac('0x2b')]){delete _0x47f615['name'];}_0x14151b[_0x96ac('0x1d')](_0x17b55a)[_0x96ac('0x2c')](_0x47f615);};}exports[_0x96ac('0x2d')]=function(_0x540d89,_0x2d1aa3){var _0x5e3e1a={},_0x42fd19={},_0x35cd4e={'count':0x0,'rows':[]};var _0x3d9009=_['map'](db[_0x96ac('0x2e')][_0x96ac('0x2f')],function(_0x59d623){return{'name':_0x59d623['fieldName'],'type':_0x59d623[_0x96ac('0x30')][_0x96ac('0x31')]};});_0x42fd19[_0x96ac('0x32')]=_[_0x96ac('0x33')](_0x3d9009,_0x96ac('0x2b'));_0x42fd19[_0x96ac('0x34')]=_[_0x96ac('0x35')](_0x540d89['query']);_0x42fd19['filters']=_[_0x96ac('0x36')](_0x42fd19[_0x96ac('0x32')],_0x42fd19[_0x96ac('0x34')]);_0x5e3e1a[_0x96ac('0x37')]=_['intersection'](_0x42fd19['model'],qs[_0x96ac('0x38')](_0x540d89[_0x96ac('0x34')][_0x96ac('0x38')]));_0x5e3e1a['attributes']=_0x5e3e1a['attributes'][_0x96ac('0x39')]?_0x5e3e1a['attributes']:_0x42fd19['model'];if(!_0x540d89[_0x96ac('0x34')]['hasOwnProperty'](_0x96ac('0x3a'))){_0x5e3e1a[_0x96ac('0x22')]=qs[_0x96ac('0x22')](_0x540d89[_0x96ac('0x34')][_0x96ac('0x22')]);_0x5e3e1a['offset']=qs[_0x96ac('0x20')](_0x540d89[_0x96ac('0x34')]['offset']);}_0x5e3e1a[_0x96ac('0x3b')]=qs[_0x96ac('0x3c')](_0x540d89[_0x96ac('0x34')]['sort']);_0x5e3e1a[_0x96ac('0x3d')]=qs[_0x96ac('0x3e')](_['pick'](_0x540d89[_0x96ac('0x34')],_0x42fd19[_0x96ac('0x3e')]),_0x3d9009);if(_0x540d89[_0x96ac('0x34')][_0x96ac('0x3f')]){_0x5e3e1a['where']=_['merge'](_0x5e3e1a[_0x96ac('0x3d')],{'$or':_['map'](_0x3d9009,function(_0x47601a){if(_0x47601a[_0x96ac('0x30')]!==_0x96ac('0x40')){var _0x18e91c={};_0x18e91c[_0x47601a[_0x96ac('0x2b')]]={'$like':'%'+_0x540d89[_0x96ac('0x34')][_0x96ac('0x3f')]+'%'};return _0x18e91c;}})});}_0x5e3e1a=_['merge']({},_0x5e3e1a,_0x540d89['options']);var _0x38104a={'where':_0x5e3e1a[_0x96ac('0x3d')]};return db['OpenchannelQueueReport'][_0x96ac('0x23')](_0x38104a)[_0x96ac('0x41')](function(_0x210d44){_0x35cd4e[_0x96ac('0x23')]=_0x210d44;if(_0x540d89[_0x96ac('0x34')][_0x96ac('0x42')]){_0x5e3e1a['include']=[{'all':!![]}];}return db[_0x96ac('0x2e')][_0x96ac('0x43')](_0x5e3e1a);})[_0x96ac('0x41')](function(_0x113918){_0x35cd4e[_0x96ac('0x44')]=_0x113918;return _0x35cd4e;})[_0x96ac('0x41')](respondWithFilteredResult(_0x2d1aa3,_0x5e3e1a))[_0x96ac('0x45')](handleError(_0x2d1aa3,null));};exports[_0x96ac('0x46')]=function(_0x1dfbf8,_0x40ab24){var _0x13c140={'raw':!![],'where':{'id':_0x1dfbf8[_0x96ac('0x47')]['id']}},_0x48f16a={};_0x48f16a[_0x96ac('0x32')]=_[_0x96ac('0x35')](db[_0x96ac('0x2e')]['rawAttributes']);_0x48f16a[_0x96ac('0x34')]=_['keys'](_0x1dfbf8[_0x96ac('0x34')]);_0x48f16a[_0x96ac('0x3e')]=_[_0x96ac('0x36')](_0x48f16a[_0x96ac('0x32')],_0x48f16a[_0x96ac('0x34')]);_0x13c140['attributes']=_['intersection'](_0x48f16a[_0x96ac('0x32')],qs[_0x96ac('0x38')](_0x1dfbf8['query'][_0x96ac('0x38')]));_0x13c140[_0x96ac('0x37')]=_0x13c140[_0x96ac('0x37')]['length']?_0x13c140['attributes']:_0x48f16a[_0x96ac('0x32')];if(_0x1dfbf8[_0x96ac('0x34')]['includeAll']){_0x13c140[_0x96ac('0x48')]=[{'all':!![]}];}_0x13c140=_[_0x96ac('0x49')]({},_0x13c140,_0x1dfbf8[_0x96ac('0x4a')]);return db[_0x96ac('0x2e')][_0x96ac('0x4b')](_0x13c140)[_0x96ac('0x41')](handleEntityNotFound(_0x40ab24,null))[_0x96ac('0x41')](respondWithResult(_0x40ab24,null))[_0x96ac('0x45')](handleError(_0x40ab24,null));};exports[_0x96ac('0x4c')]=function(_0x2013e6,_0x33d3a9){return db['OpenchannelQueueReport'][_0x96ac('0x4c')](_0x2013e6['body'],{})[_0x96ac('0x41')](respondWithResult(_0x33d3a9,0xc9))[_0x96ac('0x45')](handleError(_0x33d3a9,null));};exports['update']=function(_0x4ad045,_0x465a07){if(_0x4ad045[_0x96ac('0x4d')]['id']){delete _0x4ad045['body']['id'];}return db[_0x96ac('0x2e')][_0x96ac('0x4b')]({'where':{'id':_0x4ad045['params']['id']}})[_0x96ac('0x41')](handleEntityNotFound(_0x465a07,null))[_0x96ac('0x41')](saveUpdates(_0x4ad045[_0x96ac('0x4d')],null))[_0x96ac('0x41')](respondWithResult(_0x465a07,null))['catch'](handleError(_0x465a07,null));};exports[_0x96ac('0x28')]=function(_0x1d9e1c,_0x256ff9){return db[_0x96ac('0x2e')][_0x96ac('0x4b')]({'where':{'id':_0x1d9e1c[_0x96ac('0x47')]['id']}})[_0x96ac('0x41')](handleEntityNotFound(_0x256ff9,null))[_0x96ac('0x41')](removeEntity(_0x256ff9,null))[_0x96ac('0x45')](handleError(_0x256ff9,null));};exports[_0x96ac('0x4e')]=function(_0x3693bf,_0x410df8){return db[_0x96ac('0x2e')][_0x96ac('0x4e')]()[_0x96ac('0x41')](respondWithResult(_0x410df8,null))[_0x96ac('0x45')](handleError(_0x410df8,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2517402..1a5bf41 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(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x814b,0x1a2));var _0xb814=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0x814b[_0x13b330];return _0x1f666c;};'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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x2f5816,_0x320b3a){var _0x3beb09=function(_0x9c30fb){while(--_0x9c30fb){_0x2f5816['push'](_0x2f5816['shift']());}};_0x3beb09(++_0x320b3a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x5fc3[_0x874cf1];return _0x233579;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0c0695f..5f51f6f 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 _0x5204=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','update','raw','where','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1ad547,_0x19bd4c){var _0x21aca7=function(_0x1a42e9){while(--_0x1a42e9){_0x1ad547['push'](_0x1ad547['shift']());}};_0x21aca7(++_0x19bd4c);}(_0x5204,0xdf));var _0x4520=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0x5204[_0x1de43c];return _0x296d3e;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')](_0x2e00f4[_0x4520('0x1a')],{'raw':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c46c5){logger[_0x4520('0xc')]('CreateOpenchannelQueueReport',_0x2e00f4);logger[_0x4520('0xf')](_0x4520('0x17'),_0x2e00f4,JSON[_0x4520('0x11')](_0x4c46c5));_0x4ba69f(_0x4c46c5);})['catch'](function(_0x3199a9){logger[_0x4520('0x12')](_0x4520('0x17'),_0x3199a9['message'],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x3199a9[_0x4520('0x14')]));});});};exports[_0x4520('0x1c')]=function(_0x3a4680){var _0x2a8528=this;return new Promise(function(_0x552da1,_0x3774bd){return db[_0x4520('0x18')][_0x4520('0x1d')](_0x3a4680[_0x4520('0x1a')],{'raw':_0x3a4680['options']?_0x3a4680[_0x4520('0x1b')][_0x4520('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')][_0x4520('0x1f')]||null:null,'attributes':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')][_0x4520('0x20')]||null:null,'limit':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')]['limit']||null:null})[_0x4520('0x21')](function(_0x5c1a0b){logger[_0x4520('0xc')](_0x4520('0x1c'),_0x3a4680);logger[_0x4520('0xf')](_0x4520('0x1c'),_0x3a4680,JSON[_0x4520('0x11')](_0x5c1a0b));_0x552da1(_0x5c1a0b);})[_0x4520('0x16')](function(_0x5bb163){logger[_0x4520('0x12')]('UpdateOpenchannelQueueReport',_0x5bb163[_0x4520('0x14')],_0x3a4680);_0x3774bd(_0x2a8528['error'](0x1f4,_0x5bb163[_0x4520('0x14')]));});});}; \ No newline at end of file +var _0xe605=['UpdateOpenchannelQueueReport','update','where','attributes','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xe605,0x92));var _0x5e60=function(_0x3d0ff5,_0x518ced){_0x3d0ff5=_0x3d0ff5-0x0;var _0x3bcf16=_0xe605[_0x3d0ff5];return _0x3bcf16;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x168a14,_0x4e3501,_0x1c5a6f){return new BPromise(function(_0x55ff5c,_0x593118){return client['request'](_0x168a14,_0x1c5a6f)[_0x5e60('0xd')](function(_0xe93f9c){logger[_0x5e60('0xe')](_0x5e60('0xf'),_0x4e3501,_0x5e60('0x10'));logger[_0x5e60('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4e3501,_0x5e60('0x10'),JSON['stringify'](_0xe93f9c));if(_0xe93f9c[_0x5e60('0x12')]){if(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x13')]===0x1f4){logger['error'](_0x5e60('0xf'),_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x593118(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}logger[_0x5e60('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x55ff5c(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}else{logger['info'](_0x5e60('0xf'),_0x4e3501,'request\x20sent');_0x55ff5c(_0xe93f9c[_0x5e60('0x15')][_0x5e60('0x14')]);}})['catch'](function(_0x39be57){logger[_0x5e60('0x12')](_0x5e60('0xf'),_0x4e3501,_0x39be57);_0x593118(_0x39be57);});});}exports[_0x5e60('0x16')]=function(_0x5c485d){var _0xdd0a71=this;return new Promise(function(_0x22d718,_0x52cc15){return db[_0x5e60('0x17')][_0x5e60('0x18')](_0x5c485d[_0x5e60('0x19')],{'raw':_0x5c485d[_0x5e60('0x1a')]?_0x5c485d[_0x5e60('0x1a')][_0x5e60('0x1b')]===undefined?!![]:![]:!![]})[_0x5e60('0xd')](function(_0x524c93){logger[_0x5e60('0xe')](_0x5e60('0x16'),_0x5c485d);logger[_0x5e60('0x11')]('CreateOpenchannelQueueReport',_0x5c485d,JSON[_0x5e60('0x1c')](_0x524c93));_0x22d718(_0x524c93);})['catch'](function(_0x376069){logger[_0x5e60('0x12')](_0x5e60('0x16'),_0x376069[_0x5e60('0x14')],_0x5c485d);_0x52cc15(_0xdd0a71[_0x5e60('0x12')](0x1f4,_0x376069[_0x5e60('0x14')]));});});};exports[_0x5e60('0x1d')]=function(_0x5d2c03){var _0x18d527=this;return new Promise(function(_0x7dbdb7,_0x19f37b){return db['OpenchannelQueueReport'][_0x5e60('0x1e')](_0x5d2c03[_0x5e60('0x19')],{'raw':_0x5d2c03[_0x5e60('0x1a')]?_0x5d2c03[_0x5e60('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d2c03[_0x5e60('0x1a')]?_0x5d2c03['options'][_0x5e60('0x1f')]||null:null,'attributes':_0x5d2c03[_0x5e60('0x1a')]?_0x5d2c03['options'][_0x5e60('0x20')]||null:null,'limit':_0x5d2c03[_0x5e60('0x1a')]?_0x5d2c03['options'][_0x5e60('0x21')]||null:null})[_0x5e60('0xd')](function(_0x52c97c){logger['info']('UpdateOpenchannelQueueReport',_0x5d2c03);logger[_0x5e60('0x11')](_0x5e60('0x1d'),_0x5d2c03,JSON[_0x5e60('0x1c')](_0x52c97c));_0x7dbdb7(_0x52c97c);})[_0x5e60('0x22')](function(_0x3ccfee){logger['error'](_0x5e60('0x1d'),_0x3ccfee[_0x5e60('0x14')],_0x5d2c03);_0x19f37b(_0x18d527['error'](0x1f4,_0x3ccfee[_0x5e60('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index dc63b18..cadd09d 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 _0xbc5e=['destroy','exports','multer','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0xcfac1e,_0x53f88d){var _0x494d4b=function(_0x5bf85c){while(--_0x5bf85c){_0xcfac1e['push'](_0xcfac1e['shift']());}};_0x494d4b(++_0x53f88d);}(_0xbc5e,0x1a4));var _0xebc5=function(_0x1bc773,_0x4a3eb4){_0x1bc773=_0x1bc773-0x0;var _0x327323=_0xbc5e[_0x1bc773];return _0x327323;};'use strict';var multer=require(_0xebc5('0x0'));var util=require('util');var path=require(_0xebc5('0x1'));var timeout=require('connect-timeout');var express=require(_0xebc5('0x2'));var router=express[_0xebc5('0x3')]();var fs_extra=require(_0xebc5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xebc5('0x5'));var controller=require('./openchannelTransferReport.controller');router[_0xebc5('0x6')]('/',auth[_0xebc5('0x7')](),controller[_0xebc5('0x8')]);router[_0xebc5('0x6')](_0xebc5('0x9'),auth['isAuthenticated'](),controller[_0xebc5('0xa')]);router['get'](_0xebc5('0xb'),auth[_0xebc5('0x7')](),controller['show']);router[_0xebc5('0xc')]('/',auth['isAuthenticated'](),controller[_0xebc5('0xd')]);router[_0xebc5('0xe')](_0xebc5('0xb'),auth[_0xebc5('0x7')](),controller[_0xebc5('0xf')]);router[_0xebc5('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xebc5('0x11')]);module[_0xebc5('0x12')]=router; \ No newline at end of file +var _0xd4f2=['describe','/:id','show','post','create','update','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','index','get','/describe','isAuthenticated'];(function(_0x4997a7,_0x47e5a2){var _0xfb48cd=function(_0x1f5ea1){while(--_0x1f5ea1){_0x4997a7['push'](_0x4997a7['shift']());}};_0xfb48cd(++_0x47e5a2);}(_0xd4f2,0xa7));var _0x2d4f=function(_0x54ae83,_0x323eb3){_0x54ae83=_0x54ae83-0x0;var _0x3baf50=_0xd4f2[_0x54ae83];return _0x3baf50;};'use strict';var multer=require(_0x2d4f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4f('0x1'));var express=require('express');var router=express[_0x2d4f('0x2')]();var fs_extra=require(_0x2d4f('0x3'));var auth=require(_0x2d4f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2d4f('0x5')]);router[_0x2d4f('0x6')](_0x2d4f('0x7'),auth[_0x2d4f('0x8')](),controller[_0x2d4f('0x9')]);router[_0x2d4f('0x6')](_0x2d4f('0xa'),auth[_0x2d4f('0x8')](),controller[_0x2d4f('0xb')]);router[_0x2d4f('0xc')]('/',auth[_0x2d4f('0x8')](),controller[_0x2d4f('0xd')]);router['put'](_0x2d4f('0xa'),auth['isAuthenticated'](),controller[_0x2d4f('0xe')]);router['delete'](_0x2d4f('0xa'),auth[_0x2d4f('0x8')](),controller['destroy']);module[_0x2d4f('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index ef5b2b5..406c27f 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x179239,_0x26f4ed){_0x179239=_0x179239-0x0;var _0x2c9c17=_0x9bde[_0x179239];return _0x2c9c17;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0x008c,0x188));var _0xc008=function(_0x20b6e2,_0x1105f2){_0x20b6e2=_0x20b6e2-0x0;var _0x1e6dde=_0x008c[_0x20b6e2];return _0x1e6dde;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index f156097..bdd5ffe 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 _0xc849=['name','send','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','fields','options','create','update','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','then','sendStatus','error'];(function(_0xd291e2,_0x49978a){var _0xb4ca1b=function(_0x385262){while(--_0x385262){_0xd291e2['push'](_0xd291e2['shift']());}};_0xb4ca1b(++_0x49978a);}(_0xc849,0xb7));var _0x9c84=function(_0x18176e,_0x5c8a7b){_0x18176e=_0x18176e-0x0;var _0x561593=_0xc849[_0x18176e];return _0x561593;};'use strict';var emlformat=require(_0x9c84('0x0'));var rimraf=require(_0x9c84('0x1'));var zipdir=require(_0x9c84('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c84('0x3'));var moment=require(_0x9c84('0x4'));var BPromise=require(_0x9c84('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9c84('0x6'));var sox=require(_0x9c84('0x7'));var csv=require('to-csv');var ejs=require(_0x9c84('0x8'));var fs=require('fs');var fs_extra=require(_0x9c84('0x9'));var _=require(_0x9c84('0xa'));var squel=require(_0x9c84('0xb'));var crypto=require(_0x9c84('0xc'));var jsforce=require(_0x9c84('0xd'));var deskjs=require(_0x9c84('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9c84('0xf'));var Papa=require('papaparse');var Redis=require(_0x9c84('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9c84('0x11'));var as=require(_0x9c84('0x12'));var hardwareService=require(_0x9c84('0x13'));var logger=require(_0x9c84('0x14'))(_0x9c84('0x15'));var utils=require(_0x9c84('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9c84('0x17'));var db=require(_0x9c84('0x18'))['db'];function respondWithStatusCode(_0x29756c,_0xad67ac){_0xad67ac=_0xad67ac||0xcc;return function(_0x54bb39){if(_0x54bb39){return _0x29756c['sendStatus'](_0xad67ac);}return _0x29756c[_0x9c84('0x19')](_0xad67ac)['end']();};}function respondWithResult(_0x5ceee2,_0x14e742){_0x14e742=_0x14e742||0xc8;return function(_0xf65ce7){if(_0xf65ce7){return _0x5ceee2[_0x9c84('0x19')](_0x14e742)[_0x9c84('0x1a')](_0xf65ce7);}};}function respondWithFilteredResult(_0x2014ae,_0x44a1f8){return function(_0x5c1177){if(_0x5c1177){var _0x537860=typeof _0x44a1f8[_0x9c84('0x1b')]===_0x9c84('0x1c')&&typeof _0x44a1f8[_0x9c84('0x1d')]===_0x9c84('0x1c');var _0x37bc1d=_0x5c1177[_0x9c84('0x1e')];var _0x388459=_0x537860?0x0:_0x44a1f8[_0x9c84('0x1b')];var _0x549269=_0x537860?_0x5c1177[_0x9c84('0x1e')]:_0x44a1f8[_0x9c84('0x1b')]+_0x44a1f8[_0x9c84('0x1d')];var _0x2d7598;if(_0x549269>=_0x37bc1d){_0x549269=_0x37bc1d;_0x2d7598=0xc8;}else{_0x2d7598=0xce;}_0x2014ae[_0x9c84('0x19')](_0x2d7598);return _0x2014ae[_0x9c84('0x1f')]('Content-Range',_0x388459+'-'+_0x549269+'/'+_0x37bc1d)[_0x9c84('0x1a')](_0x5c1177);}return null;};}function patchUpdates(_0x3b48ab){return function(_0xbfca31){try{jsonpatch[_0x9c84('0x20')](_0xbfca31,_0x3b48ab,!![]);}catch(_0x4fb3ba){return BPromise['reject'](_0x4fb3ba);}return _0xbfca31['save']();};}function saveUpdates(_0x3b81b7,_0x29746e){return function(_0x575855){if(_0x575855){return _0x575855['update'](_0x3b81b7)[_0x9c84('0x21')](function(_0x59849f){return _0x59849f;});}return null;};}function removeEntity(_0x5a2937,_0x3a4ea3){return function(_0x1236fe){if(_0x1236fe){return _0x1236fe['destroy']()[_0x9c84('0x21')](function(){_0x5a2937[_0x9c84('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa7b1a1,_0x379e79){return function(_0x4845e8){if(!_0x4845e8){_0xa7b1a1[_0x9c84('0x22')](0x194);}return _0x4845e8;};}function handleError(_0x4a4415,_0x3fadc8){_0x3fadc8=_0x3fadc8||0x1f4;return function(_0x9cb7){logger[_0x9c84('0x23')](_0x9cb7['stack']);if(_0x9cb7[_0x9c84('0x24')]){delete _0x9cb7[_0x9c84('0x24')];}_0x4a4415[_0x9c84('0x19')](_0x3fadc8)[_0x9c84('0x25')](_0x9cb7);};}exports[_0x9c84('0x26')]=function(_0x1283f6,_0x5ec377){var _0x3a034d={},_0x4f66e2={},_0x3b1d9b={'count':0x0,'rows':[]};var _0x7d1bfd=_[_0x9c84('0x27')](db[_0x9c84('0x28')]['rawAttributes'],function(_0x5266c9){return{'name':_0x5266c9[_0x9c84('0x29')],'type':_0x5266c9[_0x9c84('0x2a')][_0x9c84('0x2b')]};});_0x4f66e2[_0x9c84('0x2c')]=_[_0x9c84('0x27')](_0x7d1bfd,'name');_0x4f66e2[_0x9c84('0x2d')]=_[_0x9c84('0x2e')](_0x1283f6[_0x9c84('0x2d')]);_0x4f66e2['filters']=_[_0x9c84('0x2f')](_0x4f66e2[_0x9c84('0x2c')],_0x4f66e2[_0x9c84('0x2d')]);_0x3a034d[_0x9c84('0x30')]=_[_0x9c84('0x2f')](_0x4f66e2['model'],qs['fields'](_0x1283f6[_0x9c84('0x2d')]['fields']));_0x3a034d['attributes']=_0x3a034d['attributes'][_0x9c84('0x31')]?_0x3a034d[_0x9c84('0x30')]:_0x4f66e2['model'];if(!_0x1283f6[_0x9c84('0x2d')]['hasOwnProperty'](_0x9c84('0x32'))){_0x3a034d[_0x9c84('0x1d')]=qs['limit'](_0x1283f6[_0x9c84('0x2d')][_0x9c84('0x1d')]);_0x3a034d[_0x9c84('0x1b')]=qs[_0x9c84('0x1b')](_0x1283f6[_0x9c84('0x2d')][_0x9c84('0x1b')]);}_0x3a034d[_0x9c84('0x33')]=qs[_0x9c84('0x34')](_0x1283f6['query'][_0x9c84('0x34')]);_0x3a034d[_0x9c84('0x35')]=qs[_0x9c84('0x36')](_[_0x9c84('0x37')](_0x1283f6[_0x9c84('0x2d')],_0x4f66e2['filters']),_0x7d1bfd);if(_0x1283f6[_0x9c84('0x2d')]['filter']){_0x3a034d[_0x9c84('0x35')]=_['merge'](_0x3a034d[_0x9c84('0x35')],{'$or':_[_0x9c84('0x27')](_0x7d1bfd,function(_0x35a467){if(_0x35a467['type']!=='VIRTUAL'){var _0xcd59aa={};_0xcd59aa[_0x35a467[_0x9c84('0x24')]]={'$like':'%'+_0x1283f6[_0x9c84('0x2d')][_0x9c84('0x38')]+'%'};return _0xcd59aa;}})});}_0x3a034d=_[_0x9c84('0x39')]({},_0x3a034d,_0x1283f6['options']);var _0x29434b={'where':_0x3a034d[_0x9c84('0x35')]};return db[_0x9c84('0x28')]['count'](_0x29434b)[_0x9c84('0x21')](function(_0x2e3316){_0x3b1d9b['count']=_0x2e3316;if(_0x1283f6['query'][_0x9c84('0x3a')]){_0x3a034d[_0x9c84('0x3b')]=[{'all':!![]}];}return db[_0x9c84('0x28')][_0x9c84('0x3c')](_0x3a034d);})[_0x9c84('0x21')](function(_0x59dff0){_0x3b1d9b[_0x9c84('0x3d')]=_0x59dff0;return _0x3b1d9b;})[_0x9c84('0x21')](respondWithFilteredResult(_0x5ec377,_0x3a034d))[_0x9c84('0x3e')](handleError(_0x5ec377,null));};exports[_0x9c84('0x3f')]=function(_0x1e7586,_0x322135){var _0x2375d1={'raw':!![],'where':{'id':_0x1e7586[_0x9c84('0x40')]['id']}},_0x1eb919={};_0x1eb919['model']=_[_0x9c84('0x2e')](db[_0x9c84('0x28')]['rawAttributes']);_0x1eb919[_0x9c84('0x2d')]=_[_0x9c84('0x2e')](_0x1e7586[_0x9c84('0x2d')]);_0x1eb919['filters']=_[_0x9c84('0x2f')](_0x1eb919[_0x9c84('0x2c')],_0x1eb919[_0x9c84('0x2d')]);_0x2375d1[_0x9c84('0x30')]=_[_0x9c84('0x2f')](_0x1eb919[_0x9c84('0x2c')],qs['fields'](_0x1e7586[_0x9c84('0x2d')][_0x9c84('0x41')]));_0x2375d1[_0x9c84('0x30')]=_0x2375d1[_0x9c84('0x30')][_0x9c84('0x31')]?_0x2375d1[_0x9c84('0x30')]:_0x1eb919[_0x9c84('0x2c')];if(_0x1e7586[_0x9c84('0x2d')][_0x9c84('0x3a')]){_0x2375d1[_0x9c84('0x3b')]=[{'all':!![]}];}_0x2375d1=_['merge']({},_0x2375d1,_0x1e7586[_0x9c84('0x42')]);return db[_0x9c84('0x28')]['find'](_0x2375d1)[_0x9c84('0x21')](handleEntityNotFound(_0x322135,null))[_0x9c84('0x21')](respondWithResult(_0x322135,null))[_0x9c84('0x3e')](handleError(_0x322135,null));};exports[_0x9c84('0x43')]=function(_0x1182c7,_0x11fa4a){return db[_0x9c84('0x28')][_0x9c84('0x43')](_0x1182c7['body'],{})['then'](respondWithResult(_0x11fa4a,0xc9))[_0x9c84('0x3e')](handleError(_0x11fa4a,null));};exports[_0x9c84('0x44')]=function(_0x4b3e02,_0x1556f8){if(_0x4b3e02[_0x9c84('0x45')]['id']){delete _0x4b3e02[_0x9c84('0x45')]['id'];}return db['OpenchannelTransferReport'][_0x9c84('0x46')]({'where':{'id':_0x4b3e02[_0x9c84('0x40')]['id']}})[_0x9c84('0x21')](handleEntityNotFound(_0x1556f8,null))[_0x9c84('0x21')](saveUpdates(_0x4b3e02[_0x9c84('0x45')],null))[_0x9c84('0x21')](respondWithResult(_0x1556f8,null))[_0x9c84('0x3e')](handleError(_0x1556f8,null));};exports[_0x9c84('0x47')]=function(_0x3c892d,_0x1e5aab){return db[_0x9c84('0x28')][_0x9c84('0x46')]({'where':{'id':_0x3c892d[_0x9c84('0x40')]['id']}})[_0x9c84('0x21')](handleEntityNotFound(_0x1e5aab,null))[_0x9c84('0x21')](removeEntity(_0x1e5aab,null))[_0x9c84('0x3e')](handleError(_0x1e5aab,null));};exports[_0x9c84('0x48')]=function(_0x540a75,_0x2418be){return db[_0x9c84('0x28')]['describe']()[_0x9c84('0x21')](respondWithResult(_0x2418be,null))[_0x9c84('0x3e')](handleError(_0x2418be,null));}; \ No newline at end of file +var _0x2bea=['index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','stack','name','send'];(function(_0x3374fd,_0x59a9bc){var _0xb10792=function(_0x51eb9d){while(--_0x51eb9d){_0x3374fd['push'](_0x3374fd['shift']());}};_0xb10792(++_0x59a9bc);}(_0x2bea,0x156));var _0xa2be=function(_0x2a5e91,_0x42c2d3){_0x2a5e91=_0x2a5e91-0x0;var _0x4aa546=_0x2bea[_0x2a5e91];return _0x4aa546;};'use strict';var emlformat=require(_0xa2be('0x0'));var rimraf=require(_0xa2be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2be('0x2'));var rp=require(_0xa2be('0x3'));var moment=require('moment');var BPromise=require(_0xa2be('0x4'));var Mustache=require('mustache');var util=require(_0xa2be('0x5'));var path=require(_0xa2be('0x6'));var sox=require(_0xa2be('0x7'));var csv=require(_0xa2be('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2be('0x9'));var _=require(_0xa2be('0xa'));var squel=require(_0xa2be('0xb'));var crypto=require(_0xa2be('0xc'));var jsforce=require(_0xa2be('0xd'));var deskjs=require(_0xa2be('0xe'));var toCsv=require(_0xa2be('0x8'));var querystring=require(_0xa2be('0xf'));var Papa=require(_0xa2be('0x10'));var Redis=require(_0xa2be('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa2be('0x12'));var as=require(_0xa2be('0x13'));var hardwareService=require(_0xa2be('0x14'));var logger=require('../../config/logger')(_0xa2be('0x15'));var utils=require(_0xa2be('0x16'));var config=require(_0xa2be('0x17'));var licenseUtil=require(_0xa2be('0x18'));var db=require(_0xa2be('0x19'))['db'];function respondWithStatusCode(_0x5571ee,_0x4213a4){_0x4213a4=_0x4213a4||0xcc;return function(_0x55428d){if(_0x55428d){return _0x5571ee[_0xa2be('0x1a')](_0x4213a4);}return _0x5571ee[_0xa2be('0x1b')](_0x4213a4)[_0xa2be('0x1c')]();};}function respondWithResult(_0x2f6ebe,_0x33f9db){_0x33f9db=_0x33f9db||0xc8;return function(_0x4ab3ee){if(_0x4ab3ee){return _0x2f6ebe[_0xa2be('0x1b')](_0x33f9db)[_0xa2be('0x1d')](_0x4ab3ee);}};}function respondWithFilteredResult(_0x3e496a,_0x38c4d5){return function(_0x10e423){if(_0x10e423){var _0x5f57c3=typeof _0x38c4d5['offset']===_0xa2be('0x1e')&&typeof _0x38c4d5[_0xa2be('0x1f')]===_0xa2be('0x1e');var _0x1daa7c=_0x10e423['count'];var _0x5a3e02=_0x5f57c3?0x0:_0x38c4d5[_0xa2be('0x20')];var _0x583738=_0x5f57c3?_0x10e423[_0xa2be('0x21')]:_0x38c4d5['offset']+_0x38c4d5[_0xa2be('0x1f')];var _0x1aefcc;if(_0x583738>=_0x1daa7c){_0x583738=_0x1daa7c;_0x1aefcc=0xc8;}else{_0x1aefcc=0xce;}_0x3e496a[_0xa2be('0x1b')](_0x1aefcc);return _0x3e496a[_0xa2be('0x22')](_0xa2be('0x23'),_0x5a3e02+'-'+_0x583738+'/'+_0x1daa7c)[_0xa2be('0x1d')](_0x10e423);}return null;};}function patchUpdates(_0x38a5bc){return function(_0x28e43a){try{jsonpatch[_0xa2be('0x24')](_0x28e43a,_0x38a5bc,!![]);}catch(_0x395f9f){return BPromise['reject'](_0x395f9f);}return _0x28e43a[_0xa2be('0x25')]();};}function saveUpdates(_0x1ee92b,_0x8689e3){return function(_0x333d6b){if(_0x333d6b){return _0x333d6b[_0xa2be('0x26')](_0x1ee92b)[_0xa2be('0x27')](function(_0xade0dd){return _0xade0dd;});}return null;};}function removeEntity(_0x129684,_0x1fedec){return function(_0x11c304){if(_0x11c304){return _0x11c304['destroy']()['then'](function(){_0x129684['status'](0xcc)[_0xa2be('0x1c')]();});}};}function handleEntityNotFound(_0x42418c,_0x530cd4){return function(_0x3f42e2){if(!_0x3f42e2){_0x42418c['sendStatus'](0x194);}return _0x3f42e2;};}function handleError(_0x5d9a1d,_0x3d8708){_0x3d8708=_0x3d8708||0x1f4;return function(_0x250098){logger['error'](_0x250098[_0xa2be('0x28')]);if(_0x250098[_0xa2be('0x29')]){delete _0x250098[_0xa2be('0x29')];}_0x5d9a1d[_0xa2be('0x1b')](_0x3d8708)[_0xa2be('0x2a')](_0x250098);};}exports[_0xa2be('0x2b')]=function(_0x1ed6d8,_0x1f467a){var _0x4c0ff5={},_0x480162={},_0x24e7c1={'count':0x0,'rows':[]};var _0x1ecdb4=_[_0xa2be('0x2c')](db[_0xa2be('0x2d')][_0xa2be('0x2e')],function(_0x4d788f){return{'name':_0x4d788f['fieldName'],'type':_0x4d788f[_0xa2be('0x2f')][_0xa2be('0x30')]};});_0x480162[_0xa2be('0x31')]=_[_0xa2be('0x2c')](_0x1ecdb4,_0xa2be('0x29'));_0x480162[_0xa2be('0x32')]=_[_0xa2be('0x33')](_0x1ed6d8[_0xa2be('0x32')]);_0x480162[_0xa2be('0x34')]=_[_0xa2be('0x35')](_0x480162[_0xa2be('0x31')],_0x480162[_0xa2be('0x32')]);_0x4c0ff5[_0xa2be('0x36')]=_[_0xa2be('0x35')](_0x480162[_0xa2be('0x31')],qs[_0xa2be('0x37')](_0x1ed6d8[_0xa2be('0x32')][_0xa2be('0x37')]));_0x4c0ff5[_0xa2be('0x36')]=_0x4c0ff5[_0xa2be('0x36')]['length']?_0x4c0ff5[_0xa2be('0x36')]:_0x480162[_0xa2be('0x31')];if(!_0x1ed6d8[_0xa2be('0x32')][_0xa2be('0x38')](_0xa2be('0x39'))){_0x4c0ff5[_0xa2be('0x1f')]=qs[_0xa2be('0x1f')](_0x1ed6d8['query'][_0xa2be('0x1f')]);_0x4c0ff5[_0xa2be('0x20')]=qs[_0xa2be('0x20')](_0x1ed6d8['query'][_0xa2be('0x20')]);}_0x4c0ff5[_0xa2be('0x3a')]=qs[_0xa2be('0x3b')](_0x1ed6d8[_0xa2be('0x32')][_0xa2be('0x3b')]);_0x4c0ff5[_0xa2be('0x3c')]=qs[_0xa2be('0x34')](_['pick'](_0x1ed6d8[_0xa2be('0x32')],_0x480162[_0xa2be('0x34')]),_0x1ecdb4);if(_0x1ed6d8['query'][_0xa2be('0x3d')]){_0x4c0ff5[_0xa2be('0x3c')]=_[_0xa2be('0x3e')](_0x4c0ff5[_0xa2be('0x3c')],{'$or':_[_0xa2be('0x2c')](_0x1ecdb4,function(_0x417517){if(_0x417517[_0xa2be('0x2f')]!==_0xa2be('0x3f')){var _0x2c7c4e={};_0x2c7c4e[_0x417517['name']]={'$like':'%'+_0x1ed6d8[_0xa2be('0x32')][_0xa2be('0x3d')]+'%'};return _0x2c7c4e;}})});}_0x4c0ff5=_[_0xa2be('0x3e')]({},_0x4c0ff5,_0x1ed6d8['options']);var _0x49c585={'where':_0x4c0ff5[_0xa2be('0x3c')]};return db['OpenchannelTransferReport']['count'](_0x49c585)[_0xa2be('0x27')](function(_0x5e801b){_0x24e7c1['count']=_0x5e801b;if(_0x1ed6d8['query'][_0xa2be('0x40')]){_0x4c0ff5[_0xa2be('0x41')]=[{'all':!![]}];}return db[_0xa2be('0x2d')][_0xa2be('0x42')](_0x4c0ff5);})['then'](function(_0x1f4974){_0x24e7c1[_0xa2be('0x43')]=_0x1f4974;return _0x24e7c1;})['then'](respondWithFilteredResult(_0x1f467a,_0x4c0ff5))[_0xa2be('0x44')](handleError(_0x1f467a,null));};exports[_0xa2be('0x45')]=function(_0xf9b661,_0x15ef44){var _0x1b565a={'raw':!![],'where':{'id':_0xf9b661[_0xa2be('0x46')]['id']}},_0x3bec82={};_0x3bec82['model']=_[_0xa2be('0x33')](db['OpenchannelTransferReport'][_0xa2be('0x2e')]);_0x3bec82[_0xa2be('0x32')]=_['keys'](_0xf9b661['query']);_0x3bec82[_0xa2be('0x34')]=_['intersection'](_0x3bec82['model'],_0x3bec82[_0xa2be('0x32')]);_0x1b565a[_0xa2be('0x36')]=_[_0xa2be('0x35')](_0x3bec82[_0xa2be('0x31')],qs[_0xa2be('0x37')](_0xf9b661[_0xa2be('0x32')][_0xa2be('0x37')]));_0x1b565a[_0xa2be('0x36')]=_0x1b565a[_0xa2be('0x36')][_0xa2be('0x47')]?_0x1b565a['attributes']:_0x3bec82['model'];if(_0xf9b661[_0xa2be('0x32')][_0xa2be('0x40')]){_0x1b565a[_0xa2be('0x41')]=[{'all':!![]}];}_0x1b565a=_[_0xa2be('0x3e')]({},_0x1b565a,_0xf9b661[_0xa2be('0x48')]);return db[_0xa2be('0x2d')]['find'](_0x1b565a)[_0xa2be('0x27')](handleEntityNotFound(_0x15ef44,null))[_0xa2be('0x27')](respondWithResult(_0x15ef44,null))[_0xa2be('0x44')](handleError(_0x15ef44,null));};exports[_0xa2be('0x49')]=function(_0x4105f5,_0x43f3c9){return db['OpenchannelTransferReport'][_0xa2be('0x49')](_0x4105f5[_0xa2be('0x4a')],{})[_0xa2be('0x27')](respondWithResult(_0x43f3c9,0xc9))[_0xa2be('0x44')](handleError(_0x43f3c9,null));};exports[_0xa2be('0x26')]=function(_0x1fe6b9,_0x4e9fd0){if(_0x1fe6b9[_0xa2be('0x4a')]['id']){delete _0x1fe6b9[_0xa2be('0x4a')]['id'];}return db[_0xa2be('0x2d')][_0xa2be('0x4b')]({'where':{'id':_0x1fe6b9[_0xa2be('0x46')]['id']}})[_0xa2be('0x27')](handleEntityNotFound(_0x4e9fd0,null))[_0xa2be('0x27')](saveUpdates(_0x1fe6b9[_0xa2be('0x4a')],null))[_0xa2be('0x27')](respondWithResult(_0x4e9fd0,null))[_0xa2be('0x44')](handleError(_0x4e9fd0,null));};exports['destroy']=function(_0x3f8850,_0x12f42b){return db['OpenchannelTransferReport'][_0xa2be('0x4b')]({'where':{'id':_0x3f8850[_0xa2be('0x46')]['id']}})[_0xa2be('0x27')](handleEntityNotFound(_0x12f42b,null))[_0xa2be('0x27')](removeEntity(_0x12f42b,null))[_0xa2be('0x44')](handleError(_0x12f42b,null));};exports[_0xa2be('0x4c')]=function(_0x114da3,_0x5d4001){return db[_0xa2be('0x2d')][_0xa2be('0x4c')]()['then'](respondWithResult(_0x5d4001,null))[_0xa2be('0x44')](handleError(_0x5d4001,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a8c00f1..a86a840 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 _0xd871=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','report_openchannel_transfer'];(function(_0x1e6e99,_0xd3bb5f){var _0x6b6ca8=function(_0xa29245){while(--_0xa29245){_0x1e6e99['push'](_0x1e6e99['shift']());}};_0x6b6ca8(++_0xd3bb5f);}(_0xd871,0x109));var _0x1d87=function(_0x34b244,_0x5c9a1d){_0x34b244=_0x34b244-0x0;var _0x304eee=_0xd871[_0x34b244];return _0x304eee;};'use strict';var _=require(_0x1d87('0x0'));var util=require(_0x1d87('0x1'));var logger=require(_0x1d87('0x2'))(_0x1d87('0x3'));var moment=require('moment');var BPromise=require(_0x1d87('0x4'));var rp=require(_0x1d87('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d87('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x1d87('0x7')]=function(_0x2fec67,_0x3a4d70){return _0x2fec67[_0x1d87('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x1d87('0x9'),'paranoid':![],'indexes':[{'name':_0x1d87('0xa'),'fields':[_0x1d87('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe7a7=['./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x310653,_0x55eede){var _0x1165c9=function(_0xfc902b){while(--_0xfc902b){_0x310653['push'](_0x310653['shift']());}};_0x1165c9(++_0x55eede);}(_0xe7a7,0x101));var _0x7e7a=function(_0x2a7785,_0x4c1bf4){_0x2a7785=_0x2a7785-0x0;var _0x55f1c9=_0xe7a7[_0x2a7785];return _0x55f1c9;};'use strict';var _=require(_0x7e7a('0x0'));var util=require(_0x7e7a('0x1'));var logger=require('../../config/logger')(_0x7e7a('0x2'));var moment=require(_0x7e7a('0x3'));var BPromise=require(_0x7e7a('0x4'));var rp=require(_0x7e7a('0x5'));var fs=require('fs');var path=require(_0x7e7a('0x6'));var rimraf=require(_0x7e7a('0x7'));var config=require(_0x7e7a('0x8'));var attributes=require(_0x7e7a('0x9'));module[_0x7e7a('0xa')]=function(_0x2d0b83,_0x20a31f){return _0x2d0b83['define'](_0x7e7a('0xb'),attributes,{'tableName':_0x7e7a('0xc'),'paranoid':![],'indexes':[{'name':_0x7e7a('0xd'),'fields':[_0x7e7a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 5f917c5..621188c 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 _0xac95=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x12494f,_0x3a0512){var _0x242919=function(_0x5320b7){while(--_0x5320b7){_0x12494f['push'](_0x12494f['shift']());}};_0x242919(++_0x3a0512);}(_0xac95,0xa8));var _0x5ac9=function(_0x5d41e3,_0x42fcc9){_0x5d41e3=_0x5d41e3-0x0;var _0x47c5bf=_0xac95[_0x5d41e3];return _0x47c5bf;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var moment=require(_0x5ac9('0x2'));var BPromise=require(_0x5ac9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ac9('0x4'))['db'];var utils=require(_0x5ac9('0x5'));var logger=require('../../config/logger')(_0x5ac9('0x6'));var config=require(_0x5ac9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ac9('0x8')][_0x5ac9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8675ec,_0x4bddcf,_0x4dffb8){return new BPromise(function(_0x32afbc,_0x2ab11c){return client[_0x5ac9('0xa')](_0x8675ec,_0x4dffb8)[_0x5ac9('0xb')](function(_0x397bb8){logger[_0x5ac9('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4bddcf,_0x5ac9('0xd'));logger[_0x5ac9('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4bddcf,_0x5ac9('0xd'),JSON['stringify'](_0x397bb8));if(_0x397bb8[_0x5ac9('0xf')]){if(_0x397bb8['error'][_0x5ac9('0x10')]===0x1f4){logger[_0x5ac9('0xf')](_0x5ac9('0x11'),_0x4bddcf,_0x397bb8[_0x5ac9('0xf')]['message']);return _0x2ab11c(_0x397bb8['error'][_0x5ac9('0x12')]);}logger['error'](_0x5ac9('0x11'),_0x4bddcf,_0x397bb8[_0x5ac9('0xf')]['message']);return _0x32afbc(_0x397bb8[_0x5ac9('0xf')][_0x5ac9('0x12')]);}else{logger[_0x5ac9('0xc')](_0x5ac9('0x11'),_0x4bddcf,_0x5ac9('0xd'));_0x32afbc(_0x397bb8[_0x5ac9('0x13')][_0x5ac9('0x12')]);}})[_0x5ac9('0x14')](function(_0x460fd7){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4bddcf,_0x460fd7);_0x2ab11c(_0x460fd7);});});} \ No newline at end of file +var _0xe009=['client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x43c827,_0x2f4fce){var _0x244fa3=function(_0x904377){while(--_0x904377){_0x43c827['push'](_0x43c827['shift']());}};_0x244fa3(++_0x2f4fce);}(_0xe009,0x122));var _0x9e00=function(_0x282491,_0x5bf255){_0x282491=_0x282491-0x0;var _0x3504df=_0xe009[_0x282491];return _0x3504df;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var moment=require(_0x9e00('0x2'));var BPromise=require(_0x9e00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e00('0x5'));var logger=require(_0x9e00('0x6'))(_0x9e00('0x7'));var config=require(_0x9e00('0x8'));var jayson=require(_0x9e00('0x9'));var client=jayson[_0x9e00('0xa')][_0x9e00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x402bb0,_0x22417d,_0x1eb956){return new BPromise(function(_0x5da6a4,_0x292a51){return client['request'](_0x402bb0,_0x1eb956)['then'](function(_0x531c9b){logger[_0x9e00('0xc')](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));logger['debug'](_0x9e00('0xf'),_0x22417d,_0x9e00('0xe'),JSON[_0x9e00('0x10')](_0x531c9b));if(_0x531c9b['error']){if(_0x531c9b[_0x9e00('0x11')]['code']===0x1f4){logger['error'](_0x9e00('0xd'),_0x22417d,_0x531c9b['error'][_0x9e00('0x12')]);return _0x292a51(_0x531c9b[_0x9e00('0x11')][_0x9e00('0x12')]);}logger[_0x9e00('0x11')](_0x9e00('0xd'),_0x22417d,_0x531c9b[_0x9e00('0x11')]['message']);return _0x5da6a4(_0x531c9b['error'][_0x9e00('0x12')]);}else{logger['info'](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));_0x5da6a4(_0x531c9b[_0x9e00('0x13')][_0x9e00('0x12')]);}})['catch'](function(_0x4f9007){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x22417d,_0x4f9007);_0x292a51(_0x4f9007);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 73e0d1e..22fcb58 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 _0x8286=['post','create','put','/:id','destroy','exports','util','express','Router','fs-extra','./pause.controller','get','isAuthenticated','index','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8286,0x105));var _0x6828=function(_0x245a2c,_0x2fd853){_0x245a2c=_0x245a2c-0x0;var _0x2ff642=_0x8286[_0x245a2c];return _0x2ff642;};'use strict';var multer=require('multer');var util=require(_0x6828('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6828('0x1'));var router=express[_0x6828('0x2')]();var fs_extra=require(_0x6828('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6828('0x4'));router[_0x6828('0x5')]('/',auth[_0x6828('0x6')](),controller[_0x6828('0x7')]);router[_0x6828('0x5')]('/:id',auth[_0x6828('0x6')](),controller[_0x6828('0x8')]);router[_0x6828('0x9')]('/',auth['isAuthenticated'](),controller[_0x6828('0xa')]);router[_0x6828('0xb')](_0x6828('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6828('0xc'),auth[_0x6828('0x6')](),controller[_0x6828('0xd')]);module[_0x6828('0xe')]=router; \ No newline at end of file +var _0xa49e=['show','post','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id'];(function(_0x5e0926,_0x5f5ca7){var _0x2ffe9e=function(_0x4f23c2){while(--_0x4f23c2){_0x5e0926['push'](_0x5e0926['shift']());}};_0x2ffe9e(++_0x5f5ca7);}(_0xa49e,0x147));var _0xea49=function(_0x501d0d,_0x38b758){_0x501d0d=_0x501d0d-0x0;var _0x37a8b8=_0xa49e[_0x501d0d];return _0x37a8b8;};'use strict';var multer=require(_0xea49('0x0'));var util=require('util');var path=require(_0xea49('0x1'));var timeout=require('connect-timeout');var express=require(_0xea49('0x2'));var router=express[_0xea49('0x3')]();var fs_extra=require(_0xea49('0x4'));var auth=require(_0xea49('0x5'));var interaction=require(_0xea49('0x6'));var config=require(_0xea49('0x7'));var controller=require(_0xea49('0x8'));router[_0xea49('0x9')]('/',auth[_0xea49('0xa')](),controller[_0xea49('0xb')]);router[_0xea49('0x9')](_0xea49('0xc'),auth['isAuthenticated'](),controller[_0xea49('0xd')]);router[_0xea49('0xe')]('/',auth['isAuthenticated'](),controller[_0xea49('0xf')]);router[_0xea49('0x10')](_0xea49('0xc'),auth[_0xea49('0xa')](),controller['update']);router[_0xea49('0x11')](_0xea49('0xc'),auth[_0xea49('0xa')](),controller[_0xea49('0x12')]);module[_0xea49('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 4658dc1..059bced 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 _0x59fa=['name','exports'];(function(_0x552fb8,_0x4ed24b){var _0x2a741a=function(_0x15b7a1){while(--_0x15b7a1){_0x552fb8['push'](_0x552fb8['shift']());}};_0x2a741a(++_0x4ed24b);}(_0x59fa,0x15b));var _0xa59f=function(_0x64777f,_0x5d7ed6){_0x64777f=_0x64777f-0x0;var _0x4a0018=_0x59fa[_0x64777f];return _0x4a0018;};'use strict';var Sequelize=require('sequelize');module[_0xa59f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa59f('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8ae9=['STRING','name','sequelize','exports'];(function(_0x1fec86,_0x422ed7){var _0x55e897=function(_0x5750ca){while(--_0x5750ca){_0x1fec86['push'](_0x1fec86['shift']());}};_0x55e897(++_0x422ed7);}(_0x8ae9,0x102));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x98ae('0x0'));module[_0x98ae('0x1')]={'name':{'type':Sequelize[_0x98ae('0x2')],'unique':_0x98ae('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x98ae('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 84dc46d..cd63710 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 _0xfc1e=['Pause','type','key','model','map','name','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','rawAttributes','intersection','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Pauses','UserProfileResource','destroy','end','stack','index'];(function(_0x589cdf,_0x53f463){var _0x5f0774=function(_0x530589){while(--_0x530589){_0x589cdf['push'](_0x589cdf['shift']());}};_0x5f0774(++_0x53f463);}(_0xfc1e,0x182));var _0xefc1=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xfc1e[_0x2eb3db];return _0x358f33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefc1('0x0'));var zipdir=require(_0xefc1('0x1'));var jsonpatch=require(_0xefc1('0x2'));var rp=require(_0xefc1('0x3'));var moment=require(_0xefc1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xefc1('0x5'));var util=require(_0xefc1('0x6'));var path=require(_0xefc1('0x7'));var sox=require('sox');var csv=require(_0xefc1('0x8'));var ejs=require(_0xefc1('0x9'));var fs=require('fs');var fs_extra=require(_0xefc1('0xa'));var _=require(_0xefc1('0xb'));var squel=require(_0xefc1('0xc'));var crypto=require(_0xefc1('0xd'));var jsforce=require(_0xefc1('0xe'));var deskjs=require(_0xefc1('0xf'));var toCsv=require(_0xefc1('0x8'));var querystring=require(_0xefc1('0x10'));var Papa=require(_0xefc1('0x11'));var Redis=require(_0xefc1('0x12'));var authService=require(_0xefc1('0x13'));var qs=require(_0xefc1('0x14'));var as=require(_0xefc1('0x15'));var hardwareService=require(_0xefc1('0x16'));var logger=require('../../config/logger')(_0xefc1('0x17'));var utils=require(_0xefc1('0x18'));var config=require(_0xefc1('0x19'));var licenseUtil=require(_0xefc1('0x1a'));var db=require(_0xefc1('0x1b'))['db'];function respondWithStatusCode(_0x1db671,_0x216b66){_0x216b66=_0x216b66||0xcc;return function(_0x5a74ab){if(_0x5a74ab){return _0x1db671[_0xefc1('0x1c')](_0x216b66);}return _0x1db671[_0xefc1('0x1d')](_0x216b66)['end']();};}function respondWithResult(_0x2de030,_0x10a625){_0x10a625=_0x10a625||0xc8;return function(_0x3273bb){if(_0x3273bb){return _0x2de030[_0xefc1('0x1d')](_0x10a625)[_0xefc1('0x1e')](_0x3273bb);}};}function respondWithFilteredResult(_0x56d5a7,_0x50648c){return function(_0x687aef){if(_0x687aef){var _0x2f10e1=typeof _0x50648c['offset']===_0xefc1('0x1f')&&typeof _0x50648c[_0xefc1('0x20')]===_0xefc1('0x1f');var _0x560d0b=_0x687aef[_0xefc1('0x21')];var _0x3aaaeb=_0x2f10e1?0x0:_0x50648c[_0xefc1('0x22')];var _0x2def7e=_0x2f10e1?_0x687aef[_0xefc1('0x21')]:_0x50648c[_0xefc1('0x22')]+_0x50648c[_0xefc1('0x20')];var _0x1d660a;if(_0x2def7e>=_0x560d0b){_0x2def7e=_0x560d0b;_0x1d660a=0xc8;}else{_0x1d660a=0xce;}_0x56d5a7[_0xefc1('0x1d')](_0x1d660a);return _0x56d5a7[_0xefc1('0x23')](_0xefc1('0x24'),_0x3aaaeb+'-'+_0x2def7e+'/'+_0x560d0b)['json'](_0x687aef);}return null;};}function patchUpdates(_0x2b0be6){return function(_0x233d95){try{jsonpatch[_0xefc1('0x25')](_0x233d95,_0x2b0be6,!![]);}catch(_0x4b2ff7){return BPromise[_0xefc1('0x26')](_0x4b2ff7);}return _0x233d95[_0xefc1('0x27')]();};}function saveUpdates(_0x26b036,_0x29c80c){return function(_0x50b2cd){if(_0x50b2cd){return _0x50b2cd[_0xefc1('0x28')](_0x26b036)[_0xefc1('0x29')](function(_0x5eac67){return _0x5eac67;});}return null;};}function removeEntity(_0x575c37,_0x281b3e){return function(_0x3f6001){if(_0x3f6001){return _0x3f6001['destroy']()[_0xefc1('0x29')](function(){var _0x89159c=_0x3f6001[_0xefc1('0x2a')]({'plain':!![]});var _0x239314=_0xefc1('0x2b');return db[_0xefc1('0x2c')][_0xefc1('0x2d')]({'where':{'type':_0x239314,'resourceId':_0x89159c['id']}})[_0xefc1('0x29')](function(){return _0x3f6001;});})[_0xefc1('0x29')](function(){_0x575c37[_0xefc1('0x1d')](0xcc)[_0xefc1('0x2e')]();});}};}function handleEntityNotFound(_0x3244d8,_0x104394){return function(_0x2a836d){if(!_0x2a836d){_0x3244d8[_0xefc1('0x1c')](0x194);}return _0x2a836d;};}function handleError(_0x6a4c2d,_0x343954){_0x343954=_0x343954||0x1f4;return function(_0x22b36e){logger['error'](_0x22b36e[_0xefc1('0x2f')]);if(_0x22b36e['name']){delete _0x22b36e['name'];}_0x6a4c2d[_0xefc1('0x1d')](_0x343954)['send'](_0x22b36e);};}exports[_0xefc1('0x30')]=function(_0x49a6fc,_0x417cef){var _0x70ad8c={},_0x10fd61={},_0x1c6261={'count':0x0,'rows':[]};var _0x4e202e=_['map'](db[_0xefc1('0x31')]['rawAttributes'],function(_0x25d1e7){return{'name':_0x25d1e7['fieldName'],'type':_0x25d1e7[_0xefc1('0x32')][_0xefc1('0x33')]};});_0x10fd61[_0xefc1('0x34')]=_[_0xefc1('0x35')](_0x4e202e,_0xefc1('0x36'));_0x10fd61[_0xefc1('0x37')]=_[_0xefc1('0x38')](_0x49a6fc[_0xefc1('0x37')]);_0x10fd61[_0xefc1('0x39')]=_['intersection'](_0x10fd61[_0xefc1('0x34')],_0x10fd61[_0xefc1('0x37')]);_0x70ad8c['attributes']=_['intersection'](_0x10fd61[_0xefc1('0x34')],qs[_0xefc1('0x3a')](_0x49a6fc[_0xefc1('0x37')]['fields']));_0x70ad8c[_0xefc1('0x3b')]=_0x70ad8c['attributes'][_0xefc1('0x3c')]?_0x70ad8c[_0xefc1('0x3b')]:_0x10fd61[_0xefc1('0x34')];if(!_0x49a6fc[_0xefc1('0x37')][_0xefc1('0x3d')](_0xefc1('0x3e'))){_0x70ad8c[_0xefc1('0x20')]=qs['limit'](_0x49a6fc[_0xefc1('0x37')]['limit']);_0x70ad8c[_0xefc1('0x22')]=qs[_0xefc1('0x22')](_0x49a6fc['query'][_0xefc1('0x22')]);}_0x70ad8c[_0xefc1('0x3f')]=qs[_0xefc1('0x40')](_0x49a6fc[_0xefc1('0x37')]['sort']);_0x70ad8c[_0xefc1('0x41')]=qs[_0xefc1('0x39')](_[_0xefc1('0x42')](_0x49a6fc[_0xefc1('0x37')],_0x10fd61['filters']),_0x4e202e);if(_0x49a6fc[_0xefc1('0x37')][_0xefc1('0x43')]){_0x70ad8c['where']=_['merge'](_0x70ad8c[_0xefc1('0x41')],{'$or':_['map'](_0x4e202e,function(_0x25fd26){if(_0x25fd26[_0xefc1('0x32')]!=='VIRTUAL'){var _0x101e33={};_0x101e33[_0x25fd26[_0xefc1('0x36')]]={'$like':'%'+_0x49a6fc[_0xefc1('0x37')]['filter']+'%'};return _0x101e33;}})});}_0x70ad8c=_[_0xefc1('0x44')]({},_0x70ad8c,_0x49a6fc[_0xefc1('0x45')]);var _0xef6a9c={'where':_0x70ad8c[_0xefc1('0x41')]};return db[_0xefc1('0x31')][_0xefc1('0x21')](_0xef6a9c)[_0xefc1('0x29')](function(_0x4e3738){_0x1c6261['count']=_0x4e3738;if(_0x49a6fc[_0xefc1('0x37')]['includeAll']){_0x70ad8c[_0xefc1('0x46')]=[{'all':!![]}];}return db[_0xefc1('0x31')]['findAll'](_0x70ad8c);})[_0xefc1('0x29')](function(_0x3756ca){_0x1c6261[_0xefc1('0x47')]=_0x3756ca;return _0x1c6261;})[_0xefc1('0x29')](respondWithFilteredResult(_0x417cef,_0x70ad8c))[_0xefc1('0x48')](handleError(_0x417cef,null));};exports[_0xefc1('0x49')]=function(_0x596a7d,_0x40c3f5){var _0x2911dc={'raw':!![],'where':{'id':_0x596a7d['params']['id']}},_0x1d2c03={};_0x1d2c03[_0xefc1('0x34')]=_[_0xefc1('0x38')](db[_0xefc1('0x31')][_0xefc1('0x4a')]);_0x1d2c03['query']=_[_0xefc1('0x38')](_0x596a7d['query']);_0x1d2c03['filters']=_[_0xefc1('0x4b')](_0x1d2c03[_0xefc1('0x34')],_0x1d2c03[_0xefc1('0x37')]);_0x2911dc['attributes']=_[_0xefc1('0x4b')](_0x1d2c03['model'],qs[_0xefc1('0x3a')](_0x596a7d[_0xefc1('0x37')][_0xefc1('0x3a')]));_0x2911dc[_0xefc1('0x3b')]=_0x2911dc[_0xefc1('0x3b')]['length']?_0x2911dc[_0xefc1('0x3b')]:_0x1d2c03[_0xefc1('0x34')];if(_0x596a7d['query'][_0xefc1('0x4c')]){_0x2911dc[_0xefc1('0x46')]=[{'all':!![]}];}_0x2911dc=_[_0xefc1('0x44')]({},_0x2911dc,_0x596a7d[_0xefc1('0x45')]);return db[_0xefc1('0x31')][_0xefc1('0x4d')](_0x2911dc)[_0xefc1('0x29')](handleEntityNotFound(_0x40c3f5,null))[_0xefc1('0x29')](respondWithResult(_0x40c3f5,null))['catch'](handleError(_0x40c3f5,null));};exports['create']=function(_0x306e18,_0x4465b1){return db['Pause'][_0xefc1('0x4e')](_0x306e18['body'],{})['then'](function(_0x5540ec){var _0x167288=_0x306e18[_0xefc1('0x4f')][_0xefc1('0x2a')]({'plain':!![]});if(!_0x167288)throw new Error(_0xefc1('0x50'));if(_0x167288['role']==='user'){var _0x400638=_0x5540ec[_0xefc1('0x2a')]({'plain':!![]});var _0xdab41c=_0xefc1('0x2b');return db[_0xefc1('0x51')][_0xefc1('0x4d')]({'where':{'name':_0xdab41c,'userProfileId':_0x167288[_0xefc1('0x52')]},'raw':!![]})['then'](function(_0x39a02e){if(_0x39a02e&&_0x39a02e[_0xefc1('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x400638[_0xefc1('0x36')],'resourceId':_0x400638['id'],'type':_0x39a02e[_0xefc1('0x36')],'sectionId':_0x39a02e['id']},{})[_0xefc1('0x29')](function(){return _0x5540ec;});}else{return _0x5540ec;}})[_0xefc1('0x48')](function(_0xff2b60){logger['error'](_0xefc1('0x54'),_0xff2b60);throw _0xff2b60;});}return _0x5540ec;})[_0xefc1('0x29')](respondWithResult(_0x4465b1,0xc9))[_0xefc1('0x48')](handleError(_0x4465b1,null));};exports['update']=function(_0x392379,_0xcf4a70){if(_0x392379[_0xefc1('0x55')]['id']){delete _0x392379[_0xefc1('0x55')]['id'];}return db[_0xefc1('0x31')][_0xefc1('0x4d')]({'where':{'id':_0x392379[_0xefc1('0x56')]['id']}})[_0xefc1('0x29')](handleEntityNotFound(_0xcf4a70,null))[_0xefc1('0x29')](saveUpdates(_0x392379[_0xefc1('0x55')],null))[_0xefc1('0x29')](respondWithResult(_0xcf4a70,null))[_0xefc1('0x48')](handleError(_0xcf4a70,null));};exports[_0xefc1('0x2d')]=function(_0x242499,_0x50af9b){return db[_0xefc1('0x31')]['find']({'where':{'id':_0x242499['params']['id']}})[_0xefc1('0x29')](handleEntityNotFound(_0x50af9b,null))[_0xefc1('0x29')](removeEntity(_0x50af9b,null))[_0xefc1('0x48')](handleError(_0x50af9b,null));}; \ No newline at end of file +var _0xc54c=['util','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Pause','includeAll','include','findAll','show','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Pauses','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc54c,0xea));var _0xcc54=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0xc54c[_0x22eb96];return _0x5e1adf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc54('0x0'));var zipdir=require(_0xcc54('0x1'));var jsonpatch=require(_0xcc54('0x2'));var rp=require(_0xcc54('0x3'));var moment=require('moment');var BPromise=require(_0xcc54('0x4'));var Mustache=require(_0xcc54('0x5'));var util=require(_0xcc54('0x6'));var path=require('path');var sox=require(_0xcc54('0x7'));var csv=require('to-csv');var ejs=require(_0xcc54('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc54('0x9'));var squel=require('squel');var crypto=require(_0xcc54('0xa'));var jsforce=require(_0xcc54('0xb'));var deskjs=require(_0xcc54('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc54('0xd'));var Redis=require(_0xcc54('0xe'));var authService=require(_0xcc54('0xf'));var qs=require(_0xcc54('0x10'));var as=require(_0xcc54('0x11'));var hardwareService=require(_0xcc54('0x12'));var logger=require(_0xcc54('0x13'))(_0xcc54('0x14'));var utils=require('../../config/utils');var config=require(_0xcc54('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc54('0x16'))['db'];function respondWithStatusCode(_0x413d97,_0x5d1408){_0x5d1408=_0x5d1408||0xcc;return function(_0x4dfafe){if(_0x4dfafe){return _0x413d97['sendStatus'](_0x5d1408);}return _0x413d97[_0xcc54('0x17')](_0x5d1408)[_0xcc54('0x18')]();};}function respondWithResult(_0x1e3fc9,_0x2598c7){_0x2598c7=_0x2598c7||0xc8;return function(_0x47bd98){if(_0x47bd98){return _0x1e3fc9[_0xcc54('0x17')](_0x2598c7)[_0xcc54('0x19')](_0x47bd98);}};}function respondWithFilteredResult(_0x27bdef,_0x41db70){return function(_0x353e40){if(_0x353e40){var _0x5027aa=typeof _0x41db70['offset']===_0xcc54('0x1a')&&typeof _0x41db70[_0xcc54('0x1b')]===_0xcc54('0x1a');var _0x21bf2e=_0x353e40[_0xcc54('0x1c')];var _0x1c81a2=_0x5027aa?0x0:_0x41db70[_0xcc54('0x1d')];var _0xc9ec6d=_0x5027aa?_0x353e40[_0xcc54('0x1c')]:_0x41db70[_0xcc54('0x1d')]+_0x41db70[_0xcc54('0x1b')];var _0x25f7c9;if(_0xc9ec6d>=_0x21bf2e){_0xc9ec6d=_0x21bf2e;_0x25f7c9=0xc8;}else{_0x25f7c9=0xce;}_0x27bdef[_0xcc54('0x17')](_0x25f7c9);return _0x27bdef['set'](_0xcc54('0x1e'),_0x1c81a2+'-'+_0xc9ec6d+'/'+_0x21bf2e)[_0xcc54('0x19')](_0x353e40);}return null;};}function patchUpdates(_0x97aa29){return function(_0x3fb246){try{jsonpatch[_0xcc54('0x1f')](_0x3fb246,_0x97aa29,!![]);}catch(_0x444ed7){return BPromise[_0xcc54('0x20')](_0x444ed7);}return _0x3fb246['save']();};}function saveUpdates(_0x62bf39,_0x2da6cf){return function(_0x101283){if(_0x101283){return _0x101283[_0xcc54('0x21')](_0x62bf39)[_0xcc54('0x22')](function(_0x4b7f47){return _0x4b7f47;});}return null;};}function removeEntity(_0x4367d3,_0x1087fb){return function(_0x584ae8){if(_0x584ae8){return _0x584ae8[_0xcc54('0x23')]()[_0xcc54('0x22')](function(){var _0x2e21c9=_0x584ae8[_0xcc54('0x24')]({'plain':!![]});var _0x43fa24='Pauses';return db[_0xcc54('0x25')][_0xcc54('0x23')]({'where':{'type':_0x43fa24,'resourceId':_0x2e21c9['id']}})[_0xcc54('0x22')](function(){return _0x584ae8;});})[_0xcc54('0x22')](function(){_0x4367d3['status'](0xcc)[_0xcc54('0x18')]();});}};}function handleEntityNotFound(_0x8a1bd5,_0x5e1107){return function(_0x2129b7){if(!_0x2129b7){_0x8a1bd5[_0xcc54('0x26')](0x194);}return _0x2129b7;};}function handleError(_0x1261a9,_0x33b457){_0x33b457=_0x33b457||0x1f4;return function(_0x1c3847){logger['error'](_0x1c3847[_0xcc54('0x27')]);if(_0x1c3847['name']){delete _0x1c3847[_0xcc54('0x28')];}_0x1261a9['status'](_0x33b457)['send'](_0x1c3847);};}exports['index']=function(_0xc7b98b,_0x30ad8e){var _0x3f3e7e={},_0x4c0338={},_0x39633c={'count':0x0,'rows':[]};var _0x46d3a2=_[_0xcc54('0x29')](db['Pause'][_0xcc54('0x2a')],function(_0x480e23){return{'name':_0x480e23[_0xcc54('0x2b')],'type':_0x480e23[_0xcc54('0x2c')][_0xcc54('0x2d')]};});_0x4c0338[_0xcc54('0x2e')]=_[_0xcc54('0x29')](_0x46d3a2,'name');_0x4c0338[_0xcc54('0x2f')]=_[_0xcc54('0x30')](_0xc7b98b['query']);_0x4c0338[_0xcc54('0x31')]=_[_0xcc54('0x32')](_0x4c0338['model'],_0x4c0338[_0xcc54('0x2f')]);_0x3f3e7e[_0xcc54('0x33')]=_['intersection'](_0x4c0338[_0xcc54('0x2e')],qs[_0xcc54('0x34')](_0xc7b98b[_0xcc54('0x2f')][_0xcc54('0x34')]));_0x3f3e7e[_0xcc54('0x33')]=_0x3f3e7e[_0xcc54('0x33')][_0xcc54('0x35')]?_0x3f3e7e[_0xcc54('0x33')]:_0x4c0338[_0xcc54('0x2e')];if(!_0xc7b98b[_0xcc54('0x2f')]['hasOwnProperty'](_0xcc54('0x36'))){_0x3f3e7e[_0xcc54('0x1b')]=qs[_0xcc54('0x1b')](_0xc7b98b[_0xcc54('0x2f')][_0xcc54('0x1b')]);_0x3f3e7e[_0xcc54('0x1d')]=qs[_0xcc54('0x1d')](_0xc7b98b[_0xcc54('0x2f')][_0xcc54('0x1d')]);}_0x3f3e7e[_0xcc54('0x37')]=qs[_0xcc54('0x38')](_0xc7b98b[_0xcc54('0x2f')][_0xcc54('0x38')]);_0x3f3e7e[_0xcc54('0x39')]=qs[_0xcc54('0x31')](_[_0xcc54('0x3a')](_0xc7b98b[_0xcc54('0x2f')],_0x4c0338[_0xcc54('0x31')]),_0x46d3a2);if(_0xc7b98b[_0xcc54('0x2f')]['filter']){_0x3f3e7e[_0xcc54('0x39')]=_[_0xcc54('0x3b')](_0x3f3e7e['where'],{'$or':_[_0xcc54('0x29')](_0x46d3a2,function(_0x68cfbd){if(_0x68cfbd[_0xcc54('0x2c')]!==_0xcc54('0x3c')){var _0x73f23a={};_0x73f23a[_0x68cfbd[_0xcc54('0x28')]]={'$like':'%'+_0xc7b98b[_0xcc54('0x2f')][_0xcc54('0x3d')]+'%'};return _0x73f23a;}})});}_0x3f3e7e=_[_0xcc54('0x3b')]({},_0x3f3e7e,_0xc7b98b[_0xcc54('0x3e')]);var _0x47c755={'where':_0x3f3e7e[_0xcc54('0x39')]};return db[_0xcc54('0x3f')][_0xcc54('0x1c')](_0x47c755)['then'](function(_0x371501){_0x39633c[_0xcc54('0x1c')]=_0x371501;if(_0xc7b98b[_0xcc54('0x2f')][_0xcc54('0x40')]){_0x3f3e7e[_0xcc54('0x41')]=[{'all':!![]}];}return db['Pause'][_0xcc54('0x42')](_0x3f3e7e);})[_0xcc54('0x22')](function(_0x4a1275){_0x39633c['rows']=_0x4a1275;return _0x39633c;})['then'](respondWithFilteredResult(_0x30ad8e,_0x3f3e7e))['catch'](handleError(_0x30ad8e,null));};exports[_0xcc54('0x43')]=function(_0xf4d8f1,_0x5f2242){var _0x4b73b4={'raw':!![],'where':{'id':_0xf4d8f1['params']['id']}},_0xf13782={};_0xf13782[_0xcc54('0x2e')]=_[_0xcc54('0x30')](db[_0xcc54('0x3f')][_0xcc54('0x2a')]);_0xf13782['query']=_['keys'](_0xf4d8f1['query']);_0xf13782[_0xcc54('0x31')]=_[_0xcc54('0x32')](_0xf13782[_0xcc54('0x2e')],_0xf13782[_0xcc54('0x2f')]);_0x4b73b4[_0xcc54('0x33')]=_[_0xcc54('0x32')](_0xf13782['model'],qs[_0xcc54('0x34')](_0xf4d8f1[_0xcc54('0x2f')][_0xcc54('0x34')]));_0x4b73b4['attributes']=_0x4b73b4[_0xcc54('0x33')][_0xcc54('0x35')]?_0x4b73b4[_0xcc54('0x33')]:_0xf13782[_0xcc54('0x2e')];if(_0xf4d8f1[_0xcc54('0x2f')][_0xcc54('0x40')]){_0x4b73b4[_0xcc54('0x41')]=[{'all':!![]}];}_0x4b73b4=_[_0xcc54('0x3b')]({},_0x4b73b4,_0xf4d8f1[_0xcc54('0x3e')]);return db[_0xcc54('0x3f')][_0xcc54('0x44')](_0x4b73b4)[_0xcc54('0x22')](handleEntityNotFound(_0x5f2242,null))[_0xcc54('0x22')](respondWithResult(_0x5f2242,null))[_0xcc54('0x45')](handleError(_0x5f2242,null));};exports['create']=function(_0x51f60c,_0x28a066){return db[_0xcc54('0x3f')][_0xcc54('0x46')](_0x51f60c['body'],{})[_0xcc54('0x22')](function(_0xb06f05){var _0x3f55c4=_0x51f60c['user'][_0xcc54('0x24')]({'plain':!![]});if(!_0x3f55c4)throw new Error(_0xcc54('0x47'));if(_0x3f55c4[_0xcc54('0x48')]===_0xcc54('0x49')){var _0x3eda61=_0xb06f05[_0xcc54('0x24')]({'plain':!![]});var _0x178bef=_0xcc54('0x4a');return db[_0xcc54('0x4b')][_0xcc54('0x44')]({'where':{'name':_0x178bef,'userProfileId':_0x3f55c4[_0xcc54('0x4c')]},'raw':!![]})['then'](function(_0x37434e){if(_0x37434e&&_0x37434e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3eda61[_0xcc54('0x28')],'resourceId':_0x3eda61['id'],'type':_0x37434e[_0xcc54('0x28')],'sectionId':_0x37434e['id']},{})[_0xcc54('0x22')](function(){return _0xb06f05;});}else{return _0xb06f05;}})[_0xcc54('0x45')](function(_0x5714c9){logger['error'](_0xcc54('0x4d'),_0x5714c9);throw _0x5714c9;});}return _0xb06f05;})['then'](respondWithResult(_0x28a066,0xc9))[_0xcc54('0x45')](handleError(_0x28a066,null));};exports['update']=function(_0x32665f,_0x14916f){if(_0x32665f['body']['id']){delete _0x32665f[_0xcc54('0x4e')]['id'];}return db[_0xcc54('0x3f')][_0xcc54('0x44')]({'where':{'id':_0x32665f[_0xcc54('0x4f')]['id']}})[_0xcc54('0x22')](handleEntityNotFound(_0x14916f,null))[_0xcc54('0x22')](saveUpdates(_0x32665f[_0xcc54('0x4e')],null))[_0xcc54('0x22')](respondWithResult(_0x14916f,null))[_0xcc54('0x45')](handleError(_0x14916f,null));};exports[_0xcc54('0x23')]=function(_0x5e114a,_0x4bb702){return db['Pause'][_0xcc54('0x44')]({'where':{'id':_0x5e114a[_0xcc54('0x4f')]['id']}})[_0xcc54('0x22')](handleEntityNotFound(_0x4bb702,null))['then'](removeEntity(_0x4bb702,null))[_0xcc54('0x45')](handleError(_0x4bb702,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index fcc176e..102d32f 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 _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x2b78cb,_0x3f5912){var _0x4b8ba6=function(_0x2c145f){while(--_0x2c145f){_0x2b78cb['push'](_0x2b78cb['shift']());}};_0x4b8ba6(++_0x3f5912);}(_0x5fab,0x177));var _0xb5fa=function(_0x2220d7,_0x804d20){_0x2220d7=_0x2220d7-0x0;var _0xe4a29f=_0x5fab[_0x2220d7];return _0xe4a29f;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x3e0968,_0x54c6ab){var _0x4ba80e=function(_0x1b7c18){while(--_0x1b7c18){_0x3e0968['push'](_0x3e0968['shift']());}};_0x4ba80e(++_0x54c6ab);}(_0xe14b,0x93));var _0xbe14=function(_0x14daa6,_0x1f327b){_0x14daa6=_0x14daa6-0x0;var _0x1e3ae3=_0xe14b[_0x14daa6];return _0x1e3ae3;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 0b0e617..7bc5244 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x41d200,_0x230259){var _0x53c364=function(_0x541f7f){while(--_0x541f7f){_0x41d200['push'](_0x41d200['shift']());}};_0x53c364(++_0x230259);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0xb10b[_0x3a1ea5];return _0xfac9b2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x347594,_0x222ded){var _0x516c0a=function(_0x3c2185){while(--_0x3c2185){_0x347594['push'](_0x347594['shift']());}};_0x516c0a(++_0x222ded);}(_0xb10b,0x12a));var _0xbb10=function(_0x2918fb,_0x1ac725){_0x2918fb=_0x2918fb-0x0;var _0xef01f8=_0xb10b[_0x2918fb];return _0xef01f8;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index a48ded8..51a27d3 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 _0xb903=['replace','basename','originalname','now','extname','post','single','/webhook','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','webhookGet','/:id','isAuthenticated','join','root'];(function(_0x392a82,_0x51f168){var _0x1e6b71=function(_0xdf18b0){while(--_0xdf18b0){_0x392a82['push'](_0x392a82['shift']());}};_0x1e6b71(++_0x51f168);}(_0xb903,0x185));var _0x3b90=function(_0x2431f7,_0x4d4a47){_0x2431f7=_0x2431f7-0x0;var _0x2ca3ce=_0xb903[_0x2431f7];return _0x2ca3ce;};'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']('/webhook',controller[_0x3b90('0xc')]);router[_0x3b90('0xa')](_0x3b90('0xd'),auth[_0x3b90('0xe')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x336913,_0x5af39c,_0x574955){_0x574955(null,path[_0x3b90('0xf')](config[_0x3b90('0x10')],'server/files/plugins'));},'filename':function(_0x45b75f,_0x174c0d,_0x43c08c){_0x174c0d['originalname']=_0x174c0d['originalname'][_0x3b90('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43c08c(null,util['format']('%s-%s%s',path[_0x3b90('0x12')](_0x174c0d[_0x3b90('0x13')],path['extname'](_0x174c0d['originalname'])),Date[_0x3b90('0x14')](),path[_0x3b90('0x15')](_0x174c0d[_0x3b90('0x13')])));}})});router[_0x3b90('0x16')]('/',upload[_0x3b90('0x17')]('file'),controller['upload']);router[_0x3b90('0x16')](_0x3b90('0x18'),controller['webhookPost']);router[_0x3b90('0x19')](_0x3b90('0xd'),auth[_0x3b90('0xe')](),controller[_0x3b90('0x1a')]);router['delete'](_0x3b90('0xd'),auth['isAuthenticated'](),controller[_0x3b90('0x1b')]);module[_0x3b90('0x1c')]=router; \ No newline at end of file +var _0x008c=['/:id','/:id/download','join','root','server/files/plugins','originalname','format','basename','extname','now','single','file','upload','post','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet'];(function(_0x1b826b,_0x51b45c){var _0x202810=function(_0x29582e){while(--_0x29582e){_0x1b826b['push'](_0x1b826b['shift']());}};_0x202810(++_0x51b45c);}(_0x008c,0x188));var _0xc008=function(_0x5c3891,_0x284f4c){_0x5c3891=_0x5c3891-0x0;var _0x34ecda=_0x008c[_0x5c3891];return _0x34ecda;};'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')]('/webhook',controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0xa')](_0xc008('0xf'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1eacfa,_0xc881aa,_0x5b2004){_0x5b2004(null,path[_0xc008('0x10')](config[_0xc008('0x11')],_0xc008('0x12')));},'filename':function(_0x2a5b4e,_0x9ffa93,_0x1819c6){_0x9ffa93[_0xc008('0x13')]=_0x9ffa93['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1819c6(null,util[_0xc008('0x14')]('%s-%s%s',path[_0xc008('0x15')](_0x9ffa93[_0xc008('0x13')],path[_0xc008('0x16')](_0x9ffa93[_0xc008('0x13')])),Date[_0xc008('0x17')](),path['extname'](_0x9ffa93['originalname'])));}})});router['post']('/',upload[_0xc008('0x18')](_0xc008('0x19')),controller[_0xc008('0x1a')]);router[_0xc008('0x1b')]('/webhook',controller['webhookPost']);router['put']('/:id',auth[_0xc008('0xb')](),controller[_0xc008('0x1c')]);router['delete'](_0xc008('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 63cbb07..d8c5a82 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 _0x3dd3=['sequelize','exports','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x3dd3,0x75));var _0x33dd=function(_0x2d4eef,_0x2c37d5){_0x2d4eef=_0x2d4eef-0x0;var _0x25839d=_0x3dd3[_0x2d4eef];return _0x25839d;};'use strict';var Sequelize=require(_0x33dd('0x0'));module[_0x33dd('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x33dd('0x2')](_0x33dd('0x3'),'script')},'description':{'type':Sequelize[_0x33dd('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x33dd('0x5')},'active':{'type':Sequelize[_0x33dd('0x6')],'defaultValue':0x0,'comment':_0x33dd('0x7')},'sidebar':{'type':Sequelize[_0x33dd('0x2')](_0x33dd('0x8'),'agentOnly','always',_0x33dd('0x9')),'defaultValue':_0x33dd('0xa'),'comment':_0x33dd('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x33dd('0xc')]},'agentUrl':{'type':Sequelize[_0x33dd('0xc')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x33dd('0xc')]}}; \ No newline at end of file +var _0x4ee4=['sequelize','exports','STRING','html','script','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4ee4,0xfd));var _0x44ee=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x4ee4[_0x57add2];return _0x4e3670;};'use strict';var Sequelize=require(_0x44ee('0x0'));module[_0x44ee('0x1')]={'name':{'type':Sequelize[_0x44ee('0x2')]},'type':{'type':Sequelize['ENUM'](_0x44ee('0x3'),_0x44ee('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x44ee('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x44ee('0x5')},'sidebar':{'type':Sequelize[_0x44ee('0x6')](_0x44ee('0x7'),_0x44ee('0x8'),_0x44ee('0x9'),'never'),'defaultValue':_0x44ee('0x9'),'comment':_0x44ee('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x44ee('0x2')]},'agentUrl':{'type':Sequelize[_0x44ee('0x2')]},'scriptName':{'type':Sequelize[_0x44ee('0x2')]},'scriptPath':{'type':Sequelize[_0x44ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c2c1078..c13101a 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 _0xf2a9=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','show','includeAll','options','Plugin','find','catch','download','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','attachments/**/*','finalize','close','Error','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./plugin.socket','register','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','destroy','then','get','Plugins','UserProfileResource','error','name','send','index','map'];(function(_0xe80d4f,_0x4afb7d){var _0x45d4a2=function(_0x238536){while(--_0x238536){_0xe80d4f['push'](_0xe80d4f['shift']());}};_0x45d4a2(++_0x4afb7d);}(_0xf2a9,0x1db));var _0x9f2a=function(_0x5a6161,_0x18251b){_0x5a6161=_0x5a6161-0x0;var _0x30191f=_0xf2a9[_0x5a6161];return _0x30191f;};'use strict';var emlformat=require(_0x9f2a('0x0'));var rimraf=require(_0x9f2a('0x1'));var zipdir=require(_0x9f2a('0x2'));var jsonpatch=require(_0x9f2a('0x3'));var rp=require(_0x9f2a('0x4'));var moment=require(_0x9f2a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f2a('0x6'));var path=require(_0x9f2a('0x7'));var sox=require(_0x9f2a('0x8'));var csv=require('to-csv');var ejs=require(_0x9f2a('0x9'));var fs=require('fs');var fs_extra=require(_0x9f2a('0xa'));var _=require(_0x9f2a('0xb'));var squel=require(_0x9f2a('0xc'));var crypto=require('crypto');var jsforce=require(_0x9f2a('0xd'));var deskjs=require(_0x9f2a('0xe'));var toCsv=require(_0x9f2a('0xf'));var querystring=require(_0x9f2a('0x10'));var Papa=require(_0x9f2a('0x11'));var extract=require(_0x9f2a('0x12'));var rimraf=require(_0x9f2a('0x1'));var archiver=require('archiver');var Redis=require(_0x9f2a('0x13'));var authService=require(_0x9f2a('0x14'));var qs=require(_0x9f2a('0x15'));var as=require(_0x9f2a('0x16'));var hardwareService=require(_0x9f2a('0x17'));var logger=require('../../config/logger')(_0x9f2a('0x18'));var utils=require(_0x9f2a('0x19'));var config=require(_0x9f2a('0x1a'));var licenseUtil=require(_0x9f2a('0x1b'));var db=require(_0x9f2a('0x1c'))['db'];config['redis']=_[_0x9f2a('0x1d')](config['redis'],{'host':_0x9f2a('0x1e'),'port':0x18eb});var socket=require(_0x9f2a('0x1f'))(new Redis(config[_0x9f2a('0x20')]));require(_0x9f2a('0x21'))[_0x9f2a('0x22')](socket);function respondWithStatusCode(_0x5e4d36,_0x23991c){_0x23991c=_0x23991c||0xcc;return function(_0x52e498){if(_0x52e498){return _0x5e4d36[_0x9f2a('0x23')](_0x23991c);}return _0x5e4d36['status'](_0x23991c)[_0x9f2a('0x24')]();};}function respondWithResult(_0x56b8a3,_0x35dcea){_0x35dcea=_0x35dcea||0xc8;return function(_0x16ca9b){if(_0x16ca9b){return _0x56b8a3['status'](_0x35dcea)[_0x9f2a('0x25')](_0x16ca9b);}};}function respondWithFilteredResult(_0xe742ce,_0x9a3f5){return function(_0xb3f334){if(_0xb3f334){var _0x145183=typeof _0x9a3f5[_0x9f2a('0x26')]==='undefined'&&typeof _0x9a3f5[_0x9f2a('0x27')]===_0x9f2a('0x28');var _0x3cfee1=_0xb3f334[_0x9f2a('0x29')];var _0xf10911=_0x145183?0x0:_0x9a3f5['offset'];var _0x5582eb=_0x145183?_0xb3f334[_0x9f2a('0x29')]:_0x9a3f5[_0x9f2a('0x26')]+_0x9a3f5[_0x9f2a('0x27')];var _0x2e3307;if(_0x5582eb>=_0x3cfee1){_0x5582eb=_0x3cfee1;_0x2e3307=0xc8;}else{_0x2e3307=0xce;}_0xe742ce[_0x9f2a('0x2a')](_0x2e3307);return _0xe742ce['set'](_0x9f2a('0x2b'),_0xf10911+'-'+_0x5582eb+'/'+_0x3cfee1)[_0x9f2a('0x25')](_0xb3f334);}return null;};}function patchUpdates(_0x5194dd){return function(_0x2aa25b){try{jsonpatch[_0x9f2a('0x2c')](_0x2aa25b,_0x5194dd,!![]);}catch(_0x3a7df2){return BPromise[_0x9f2a('0x2d')](_0x3a7df2);}return _0x2aa25b['save']();};}function saveUpdates(_0x536786,_0x192980){return function(_0x5ce953){if(_0x5ce953){return _0x5ce953['update'](_0x536786)['then'](function(_0x5deb26){return _0x5deb26;});}return null;};}function removeEntity(_0x5f28c1,_0x1d4669){return function(_0x3181fd){if(_0x3181fd){return _0x3181fd[_0x9f2a('0x2e')]()[_0x9f2a('0x2f')](function(){var _0x52a844=_0x3181fd[_0x9f2a('0x30')]({'plain':!![]});var _0x22963a=_0x9f2a('0x31');return db[_0x9f2a('0x32')][_0x9f2a('0x2e')]({'where':{'type':_0x22963a,'resourceId':_0x52a844['id']}})[_0x9f2a('0x2f')](function(){return _0x3181fd;});})[_0x9f2a('0x2f')](function(){_0x5f28c1['status'](0xcc)[_0x9f2a('0x24')]();});}};}function handleEntityNotFound(_0x5ee280,_0x4eef30){return function(_0x4876e0){if(!_0x4876e0){_0x5ee280[_0x9f2a('0x23')](0x194);}return _0x4876e0;};}function handleError(_0x495acd,_0x477b6d){_0x477b6d=_0x477b6d||0x1f4;return function(_0x32bac0){logger[_0x9f2a('0x33')](_0x32bac0['stack']);if(_0x32bac0['name']){delete _0x32bac0[_0x9f2a('0x34')];}_0x495acd['status'](_0x477b6d)[_0x9f2a('0x35')](_0x32bac0);};}exports[_0x9f2a('0x36')]=function(_0x168738,_0x4ce9e1){var _0x4225e5={},_0x86b765={},_0x52657c={'count':0x0,'rows':[]};var _0x3aec3f=_[_0x9f2a('0x37')](db['Plugin'][_0x9f2a('0x38')],function(_0x5306ce){return{'name':_0x5306ce[_0x9f2a('0x39')],'type':_0x5306ce[_0x9f2a('0x3a')][_0x9f2a('0x3b')]};});_0x86b765['model']=_[_0x9f2a('0x37')](_0x3aec3f,_0x9f2a('0x34'));_0x86b765[_0x9f2a('0x3c')]=_[_0x9f2a('0x3d')](_0x168738['query']);_0x86b765[_0x9f2a('0x3e')]=_[_0x9f2a('0x3f')](_0x86b765[_0x9f2a('0x40')],_0x86b765[_0x9f2a('0x3c')]);_0x4225e5[_0x9f2a('0x41')]=_['intersection'](_0x86b765[_0x9f2a('0x40')],qs[_0x9f2a('0x42')](_0x168738[_0x9f2a('0x3c')]['fields']));_0x4225e5[_0x9f2a('0x41')]=_0x4225e5[_0x9f2a('0x41')][_0x9f2a('0x43')]?_0x4225e5[_0x9f2a('0x41')]:_0x86b765[_0x9f2a('0x40')];if(!_0x168738[_0x9f2a('0x3c')][_0x9f2a('0x44')]('nolimit')){_0x4225e5[_0x9f2a('0x27')]=qs[_0x9f2a('0x27')](_0x168738[_0x9f2a('0x3c')][_0x9f2a('0x27')]);_0x4225e5['offset']=qs['offset'](_0x168738[_0x9f2a('0x3c')][_0x9f2a('0x26')]);}_0x4225e5[_0x9f2a('0x45')]=qs[_0x9f2a('0x46')](_0x168738['query'][_0x9f2a('0x46')]);_0x4225e5[_0x9f2a('0x47')]=qs[_0x9f2a('0x3e')](_[_0x9f2a('0x48')](_0x168738[_0x9f2a('0x3c')],_0x86b765[_0x9f2a('0x3e')]),_0x3aec3f);if(_0x168738[_0x9f2a('0x3c')]['filter']){_0x4225e5[_0x9f2a('0x47')]=_['merge'](_0x4225e5['where'],{'$or':_['map'](_0x3aec3f,function(_0x1d170){if(_0x1d170[_0x9f2a('0x3a')]!==_0x9f2a('0x49')){var _0x41bcb6={};_0x41bcb6[_0x1d170[_0x9f2a('0x34')]]={'$like':'%'+_0x168738[_0x9f2a('0x3c')][_0x9f2a('0x4a')]+'%'};return _0x41bcb6;}})});}_0x4225e5=_[_0x9f2a('0x4b')]({},_0x4225e5,_0x168738['options']);var _0x11fd4d={'where':_0x4225e5[_0x9f2a('0x47')]};return db['Plugin'][_0x9f2a('0x29')](_0x11fd4d)[_0x9f2a('0x2f')](function(_0xa5007a){_0x52657c[_0x9f2a('0x29')]=_0xa5007a;if(_0x168738[_0x9f2a('0x3c')]['includeAll']){_0x4225e5[_0x9f2a('0x4c')]=[{'all':!![]}];}return db['Plugin'][_0x9f2a('0x4d')](_0x4225e5);})[_0x9f2a('0x2f')](function(_0x4b4514){_0x52657c[_0x9f2a('0x4e')]=_0x4b4514;return _0x52657c;})['then'](respondWithFilteredResult(_0x4ce9e1,_0x4225e5))['catch'](handleError(_0x4ce9e1,null));};exports[_0x9f2a('0x4f')]=function(_0x427a68,_0x2833a0){var _0x103ef1={'raw':!![],'where':{'id':_0x427a68['params']['id']}},_0xcb9a59={};_0xcb9a59['model']=_[_0x9f2a('0x3d')](db['Plugin'][_0x9f2a('0x38')]);_0xcb9a59[_0x9f2a('0x3c')]=_[_0x9f2a('0x3d')](_0x427a68[_0x9f2a('0x3c')]);_0xcb9a59['filters']=_['intersection'](_0xcb9a59[_0x9f2a('0x40')],_0xcb9a59[_0x9f2a('0x3c')]);_0x103ef1[_0x9f2a('0x41')]=_['intersection'](_0xcb9a59['model'],qs[_0x9f2a('0x42')](_0x427a68[_0x9f2a('0x3c')]['fields']));_0x103ef1[_0x9f2a('0x41')]=_0x103ef1[_0x9f2a('0x41')]['length']?_0x103ef1['attributes']:_0xcb9a59[_0x9f2a('0x40')];if(_0x427a68[_0x9f2a('0x3c')][_0x9f2a('0x50')]){_0x103ef1[_0x9f2a('0x4c')]=[{'all':!![]}];}_0x103ef1=_[_0x9f2a('0x4b')]({},_0x103ef1,_0x427a68[_0x9f2a('0x51')]);return db[_0x9f2a('0x52')][_0x9f2a('0x53')](_0x103ef1)[_0x9f2a('0x2f')](handleEntityNotFound(_0x2833a0,null))[_0x9f2a('0x2f')](respondWithResult(_0x2833a0,null))[_0x9f2a('0x54')](handleError(_0x2833a0,null));};exports[_0x9f2a('0x55')]=function(_0x2336ba,_0x2aade7,_0x91f026){return db['Plugin'][_0x9f2a('0x53')]({'where':{'id':_0x2336ba[_0x9f2a('0x56')]['id']},'attributes':[_0x9f2a('0x34'),'path'],'raw':!![]})[_0x9f2a('0x2f')](handleEntityNotFound(_0x2aade7,null))[_0x9f2a('0x2f')](function(_0x100b8f){if(_0x100b8f){var _0x5e0a62=path[_0x9f2a('0x57')](config[_0x9f2a('0x58')],_0x9f2a('0x59'),util[_0x9f2a('0x5a')](_0x9f2a('0x5b'),path[_0x9f2a('0x5c')](_0x100b8f[_0x9f2a('0x7')])));var _0x48c7f5=fs[_0x9f2a('0x5d')](_0x5e0a62);var _0x262242=archiver(_0x9f2a('0x5e'),{'zlib':{'level':0x9}});_0x262242['on'](_0x9f2a('0x5f'),function(_0x533871){if(_0x533871[_0x9f2a('0x60')]===_0x9f2a('0x61')){logger[_0x9f2a('0x33')](_0x533871);}else{throw new db[(_0x9f2a('0x62'))]['Error'](_0x9f2a('0x63'));}});_0x262242['on'](_0x9f2a('0x33'),function(_0x34878b){throw new db[(_0x9f2a('0x62'))]['Error'](_0x9f2a('0x63'));});_0x262242['pipe'](_0x48c7f5);_0x262242[_0x9f2a('0x64')](_0x9f2a('0x65'),{'cwd':path['join'](config[_0x9f2a('0x58')],_0x9f2a('0x59'),path['dirname'](_0x100b8f['path'])),'ignore':[path[_0x9f2a('0x57')](path[_0x9f2a('0x5c')](_0x100b8f['path']),'node_modules/**/*'),path[_0x9f2a('0x57')](path[_0x9f2a('0x5c')](_0x100b8f['path']),_0x9f2a('0x66'))],'nodir':!![]})[_0x9f2a('0x67')]();_0x48c7f5['on'](_0x9f2a('0x68'),function(){if(!fs['existsSync'](_0x5e0a62)){throw new db[(_0x9f2a('0x62'))][(_0x9f2a('0x69'))](_0x9f2a('0x6a'));}return _0x2aade7[_0x9f2a('0x55')](_0x5e0a62,util[_0x9f2a('0x5a')](_0x9f2a('0x5b'),path[_0x9f2a('0x5c')](_0x100b8f[_0x9f2a('0x7')])),function(_0x2cc291){if(_0x2cc291){throw new db[(_0x9f2a('0x62'))][(_0x9f2a('0x69'))](_0x9f2a('0x6b'));}fs[_0x9f2a('0x6c')](_0x5e0a62);logger[_0x9f2a('0x6d')](_0x9f2a('0x6e'));logger['info'](_0x9f2a('0x6f'));});});}return null;})['catch'](handleError(_0x2aade7,null));};exports[_0x9f2a('0x70')]=function(_0x49d726,_0x3aadfe,_0x12edbb){var _0xc8a87c=path[_0x9f2a('0x5c')](_0x49d726['file'][_0x9f2a('0x71')],path[_0x9f2a('0x72')](_0x49d726[_0x9f2a('0x73')][_0x9f2a('0x71')]));var _0x3b0c3a=path[_0x9f2a('0x57')](config[_0x9f2a('0x58')],'server/files/plugins',_0x49d726[_0x9f2a('0x73')][_0x9f2a('0x71')]);var _0x3fc13d=path['join'](config[_0x9f2a('0x58')],_0x9f2a('0x59'),_0xc8a87c);logger['info'](_0x9f2a('0x74'),_0x3b0c3a);logger[_0x9f2a('0x6d')]('Plugin\x20upload\x20destination:\x20%s',_0x3fc13d);try{fs[_0x9f2a('0x75')](_0x3b0c3a,parseInt(_0x9f2a('0x76'),0x8));extract(_0x3b0c3a,{'dir':_0x3fc13d},function(_0xadbc47){if(_0xadbc47){logger['error'](_0xadbc47);handleError(_0xadbc47,!![]);};var _0x5e4ea6=fs[_0x9f2a('0x77')](_0x3fc13d);if(_0x5e4ea6[_0x9f2a('0x43')]>0x1){removeReferences(_0x3b0c3a,_0x3fc13d);logger[_0x9f2a('0x33')](_0x9f2a('0x78'));return _0x12edbb(new Error(_0x9f2a('0x78')));}var _0x372317=fs['lstatSync'](path[_0x9f2a('0x57')](_0x3fc13d,_0x5e4ea6[0x0]));if(_0x372317['isFile']()){removeReferences(_0x3b0c3a,_0x3fc13d);logger[_0x9f2a('0x33')]('Invalid\x20plugin\x20structure');return _0x12edbb(new Error(_0x9f2a('0x78')));}if(_0x372317[_0x9f2a('0x79')]()){var _0x5b3c9d=fs['readdirSync'](path['join'](_0x3fc13d,_0x5e4ea6[0x0]));if(_0x5b3c9d[_0x9f2a('0x43')]===0x0){removeReferences(_0x3b0c3a,_0x3fc13d);logger[_0x9f2a('0x33')](_0x9f2a('0x78'));return _0x12edbb(new Error(_0x9f2a('0x78')));}var _0x265b3a=_0x5b3c9d[_0x9f2a('0x7a')](function(_0x46543a){return _0x46543a===_0x9f2a('0x7b');});if(!_0x265b3a){return _0x12edbb(new Error(_0x9f2a('0x7c')));}var _0x1cd0ae=fs[_0x9f2a('0x7d')](path[_0x9f2a('0x57')](_0x3fc13d,_0x5e4ea6[0x0],_0x9f2a('0x7b')));var _0x33aaeb=JSON['parse'](_0x1cd0ae);if(_0x9f2a('0x28')==typeof _0x33aaeb[_0x9f2a('0x34')]){return _0x12edbb(new Error(_0x9f2a('0x7e')));}if('undefined'==typeof _0x33aaeb[_0x9f2a('0x3a')]){return _0x12edbb(new Error(_0x9f2a('0x7f')));}if('undefined'==typeof _0x33aaeb[_0x9f2a('0x80')]){return _0x12edbb(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x9f2a('0x28')==typeof _0x33aaeb[_0x9f2a('0x81')]){return _0x12edbb(new Error(_0x9f2a('0x82')));}if(_0x33aaeb[_0x9f2a('0x3a')]===_0x9f2a('0x83')){if(_0x9f2a('0x28')==typeof _0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x84')]){return _0x12edbb(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x9f2a('0x28')==typeof _0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x84')][_0x9f2a('0x85')]&&'undefined'==typeof _0x33aaeb[_0x9f2a('0x81')]['views'][_0x9f2a('0x86')]){return _0x12edbb(new Error(_0x9f2a('0x87')));}}else if(_0x33aaeb[_0x9f2a('0x3a')]===_0x9f2a('0x88')){if('undefined'==typeof _0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x89')]){return _0x12edbb(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x9f2a('0x28')==typeof _0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x8a')]){return _0x12edbb(new Error(_0x9f2a('0x8b')));}}else{return _0x12edbb(new Error(_0x9f2a('0x8c')));}var _0x36e11e=_0x33aaeb['name'];var _0x2c7a12=_0x33aaeb['description'];var _0x39af30=_0x33aaeb['type'];var _0xde323f=_0x33aaeb['sidebar']?_0x33aaeb[_0x9f2a('0x8d')]:_0x9f2a('0x8e');var _0x533be7=_0x33aaeb[_0x9f2a('0x8f')]?_0x33aaeb[_0x9f2a('0x8f')]:'icon-apps';var _0x4e2c22='';var _0x3581da='';var _0x3e940a='';var _0xd5a95a='';var _0xfe1f88=_0x33aaeb[_0x9f2a('0x80')];if(_0x39af30===_0x9f2a('0x83')){if(_0x9f2a('0x28')!=typeof _0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x84')]['admin']){var _0x2041b9=_0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x84')][_0x9f2a('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x9f2a('0x90')](_0x2041b9)){_0x4e2c22=path[_0x9f2a('0x57')](_0x9f2a('0x91'),_0xc8a87c,_0x5e4ea6[0x0],_0x2041b9);}else{_0x4e2c22=_0x2041b9;}}else{logger[_0x9f2a('0x6d')](_0x9f2a('0x92'));}if(_0x9f2a('0x28')!=typeof _0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x84')][_0x9f2a('0x86')]){var _0x1395cc=_0x33aaeb[_0x9f2a('0x81')]['views'][_0x9f2a('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x9f2a('0x90')](_0x1395cc)){_0x3581da=path[_0x9f2a('0x57')](_0x9f2a('0x91'),_0xc8a87c,_0x5e4ea6[0x0],_0x1395cc);}else{_0x3581da=_0x1395cc;}}else{logger[_0x9f2a('0x6d')](_0x9f2a('0x93'));}}else if(_0x39af30==='script'){_0x3e940a=_0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x89')];_0xd5a95a=_0x33aaeb['parameters'][_0x9f2a('0x8a')];if('undefined'!=typeof _0x33aaeb['parameters'][_0x9f2a('0x84')]){if('undefined'!=typeof _0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x84')][_0x9f2a('0x85')]){var _0x2041b9=_0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x84')][_0x9f2a('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x9f2a('0x90')](_0x2041b9)){_0x4e2c22=path[_0x9f2a('0x57')](_0x9f2a('0x91'),_0xc8a87c,_0x5e4ea6[0x0],_0x2041b9);}else{_0x4e2c22=_0x2041b9;}}if('undefined'!=typeof _0x33aaeb['parameters'][_0x9f2a('0x84')][_0x9f2a('0x86')]){var _0x1395cc=_0x33aaeb[_0x9f2a('0x81')][_0x9f2a('0x84')][_0x9f2a('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x9f2a('0x90')](_0x1395cc)){_0x3581da=path[_0x9f2a('0x57')](_0x9f2a('0x91'),_0xc8a87c,_0x5e4ea6[0x0],_0x1395cc);}else{_0x3581da=_0x1395cc;}}}}var _0x8452dd={'name':_0x36e11e,'description':_0x2c7a12,'path':path['join'](_0xc8a87c,_0x5e4ea6[0x0]),'type':_0x39af30,'sidebar':_0xde323f,'icon':_0x533be7,'adminUrl':_0x4e2c22,'agentUrl':_0x3581da,'scriptName':_0x3e940a,'scriptPath':_0xd5a95a,'version':_0xfe1f88};removeReferences(_0x3b0c3a,null);return db[_0x9f2a('0x52')][_0x9f2a('0x94')](_0x8452dd)[_0x9f2a('0x2f')](function(_0x5ab007){var _0x46c442={'role':_0x49d726[_0x9f2a('0x95')][_0x9f2a('0x96')],'userProfileId':_0x49d726[_0x9f2a('0x95')][_0x9f2a('0x97')]};if(!_0x46c442)throw new Error(_0x9f2a('0x98'));if(_0x46c442[_0x9f2a('0x96')]===_0x9f2a('0x99')){var _0x1cc5f1=_0x5ab007['get']({'plain':!![]});return db[_0x9f2a('0x9a')][_0x9f2a('0x53')]({'where':{'name':_0x9f2a('0x31'),'userProfileId':_0x46c442[_0x9f2a('0x97')]},'raw':!![]})[_0x9f2a('0x2f')](function(_0x401df5){if(_0x401df5&&_0x401df5[_0x9f2a('0x9b')]===0x0){return db[_0x9f2a('0x32')]['create']({'name':_0x1cc5f1['name'],'resourceId':_0x1cc5f1['id'],'type':_0x401df5['name'],'sectionId':_0x401df5['id']},{})['then'](function(){return _0x5ab007;});}else{return _0x5ab007;}})[_0x9f2a('0x54')](function(_0x58b06c){logger[_0x9f2a('0x33')](_0x9f2a('0x9c'),_0x58b06c);throw _0x58b06c;});}return _0x5ab007;})['then'](respondWithResult(_0x3aadfe,null))[_0x9f2a('0x54')](handleError(_0x3aadfe,null));}});}catch(_0x2d5ac4){_0x3aadfe[_0x9f2a('0x2a')](0x1f4)[_0x9f2a('0x35')](_0x2d5ac4);}};function removeReferences(_0x3d1ce8,_0x4765cc){try{if(_0x3d1ce8){fs[_0x9f2a('0x6c')](_0x3d1ce8);logger['info'](_0x9f2a('0x9d'));}if(_0x4765cc){rimraf(_0x4765cc,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x4b10c1){logger[_0x9f2a('0x33')](_0x4b10c1);}}exports['update']=function(_0x1518c6,_0x144ec5,_0xa1b241){return db['Plugin'][_0x9f2a('0x53')]({'where':{'id':_0x1518c6[_0x9f2a('0x56')]['id']}})[_0x9f2a('0x2f')](handleEntityNotFound(_0x144ec5,null))['then'](saveUpdates(_0x1518c6[_0x9f2a('0x95')],null))[_0x9f2a('0x2f')](respondWithResult(_0x144ec5,null))[_0x9f2a('0x54')](handleError(_0x144ec5,null));};exports[_0x9f2a('0x9e')]=function(_0x127595,_0x16f8c3,_0x1e9b72){return db[_0x9f2a('0x52')][_0x9f2a('0x53')]({'where':{'id':_0x127595[_0x9f2a('0x56')]['id']}})['then'](function(_0x400f7a){if(_0x400f7a){return _0x400f7a['destroy']();}})['then'](function(_0x1734ee){rimraf(path[_0x9f2a('0x57')](config['root'],_0x9f2a('0x59'),path[_0x9f2a('0x9f')](_0x1734ee[_0x9f2a('0x7')])),function(){});return _0x1734ee;})[_0x9f2a('0x2f')](handleEntityNotFound(_0x16f8c3,null))['then'](respondWithStatusCode(_0x16f8c3,null))[_0x9f2a('0x54')](handleError(_0x16f8c3,null));};exports[_0x9f2a('0xa0')]=function(_0x2fca27,_0x25a366,_0x52cfc2){return BPromise[_0x9f2a('0xa1')]()[_0x9f2a('0x2f')](function(){if(!_0x2fca27[_0x9f2a('0x3c')][_0x9f2a('0x7')]){throw new Error(_0x9f2a('0xa2'));}if(!_0x2fca27[_0x9f2a('0x3c')][_0x9f2a('0xa3')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2db7a5=_0x2fca27[_0x9f2a('0x3c')][_0x9f2a('0xa4')]?_0x2fca27[_0x9f2a('0x3c')][_0x9f2a('0xa4')]+':'+_0x2fca27[_0x9f2a('0x3c')]['port']:_0x9f2a('0xa5')+_0x2fca27[_0x9f2a('0x3c')][_0x9f2a('0xa3')];var _0x152803=_0x2fca27[_0x9f2a('0x3c')][_0x9f2a('0x25')]?_0x2fca27[_0x9f2a('0x3c')]['json']:!![];var _0x13d41c=_0x2fca27[_0x9f2a('0x3c')]['encoding']?_0x2fca27[_0x9f2a('0x3c')][_0x9f2a('0xa6')]:null;var _0x3c204d={'method':_0x2fca27[_0x9f2a('0xa7')],'uri':util[_0x9f2a('0x5a')](_0x9f2a('0xa8'),_0x2db7a5,_0x2fca27[_0x9f2a('0x3c')]['path']),'json':_0x152803,'resolveWithFullResponse':!![],'encoding':_0x13d41c,'qs':_0x2fca27['query']};if(_0x2fca27[_0x9f2a('0xa9')]){_0x3c204d[_0x9f2a('0xa9')]=_0x2fca27['headers'];if(_0x3c204d['headers'][_0x9f2a('0xaa')]){delete _0x3c204d[_0x9f2a('0xa9')][_0x9f2a('0xaa')];}}if(_0x3c204d[_0x9f2a('0xa9')][_0x9f2a('0xab')]){delete _0x3c204d[_0x9f2a('0xa9')][_0x9f2a('0xab')];}return rp(_0x3c204d);})[_0x9f2a('0x2f')](function(_0x3ad436){if(_0x3ad436){_0x25a366['set'](_0x3ad436['headers']);logger[_0x9f2a('0x6d')](_0x3ad436['body']);if(_[_0x9f2a('0xac')](_0x2fca27[_0x9f2a('0x3c')]['path'],'download')&&_0x3ad436[_0x9f2a('0xad')]==0x1f4){return _0x25a366[_0x9f2a('0x23')](_0x3ad436[_0x9f2a('0xad')]);}else{return _0x25a366[_0x9f2a('0x2a')](_0x3ad436[_0x9f2a('0xad')])['send'](_0x3ad436[_0x9f2a('0x95')]);}}else{return _0x25a366[_0x9f2a('0x23')](0xc8);}})['catch'](handleError(_0x25a366,null));};exports[_0x9f2a('0xae')]=function(_0x4f0825,_0x3db226,_0x88bd8f){return BPromise['resolve']()[_0x9f2a('0x2f')](function(){if(!_0x4f0825[_0x9f2a('0x3c')][_0x9f2a('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4f0825[_0x9f2a('0x3c')]['port']){throw new Error(_0x9f2a('0xaf'));}var _0x266bed=_0x4f0825['query'][_0x9f2a('0xa4')]?_0x4f0825['query'][_0x9f2a('0xa4')]+':'+_0x4f0825[_0x9f2a('0x3c')][_0x9f2a('0xa3')]:'http://localhost:'+_0x4f0825[_0x9f2a('0x3c')][_0x9f2a('0xa3')];var _0x1fc50b=_0x4f0825[_0x9f2a('0x3c')]['json']?_0x4f0825['query'][_0x9f2a('0x25')]:!![];var _0x247483=_0x4f0825[_0x9f2a('0x3c')][_0x9f2a('0xa6')]?_0x4f0825[_0x9f2a('0x3c')][_0x9f2a('0xa6')]:null;var _0x3cc6ae={'method':_0x4f0825[_0x9f2a('0xa7')],'uri':util[_0x9f2a('0x5a')]('%s%s',_0x266bed,_0x4f0825[_0x9f2a('0x3c')][_0x9f2a('0x7')]),'json':_0x1fc50b,'resolveWithFullResponse':!![],'encoding':_0x247483,'body':_0x4f0825[_0x9f2a('0x95')]};if(_0x4f0825[_0x9f2a('0xa9')]){_0x3cc6ae['headers']=_0x4f0825[_0x9f2a('0xa9')];if(_0x3cc6ae[_0x9f2a('0xa9')][_0x9f2a('0xaa')]){delete _0x3cc6ae[_0x9f2a('0xa9')][_0x9f2a('0xaa')];}}if(_0x3cc6ae['headers']['content-type']){delete _0x3cc6ae[_0x9f2a('0xa9')][_0x9f2a('0xab')];}return rp(_0x3cc6ae);})[_0x9f2a('0x2f')](function(_0x2da981){if(_0x2da981){_0x3db226[_0x9f2a('0xb0')](_0x2da981[_0x9f2a('0xa9')]);logger['info'](_0x2da981[_0x9f2a('0x95')]);return _0x3db226['status'](_0x2da981[_0x9f2a('0xad')])[_0x9f2a('0x35')](_0x2da981[_0x9f2a('0x95')]);}else{return _0x3db226[_0x9f2a('0x23')](0xc8);}})[_0x9f2a('0x54')](handleError(_0x3db226,null));}; \ No newline at end of file +var _0x012f=['filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','findAll','rows','catch','params','include','download','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','find','dirname','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','http://localhost:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x5c149d,_0x365736){var _0x3a71ac=function(_0xb5193b){while(--_0xb5193b){_0x5c149d['push'](_0x5c149d['shift']());}};_0x3a71ac(++_0x365736);}(_0x012f,0x64));var _0xf012=function(_0x407138,_0x4e617d){_0x407138=_0x407138-0x0;var _0x51b291=_0x012f[_0x407138];return _0x51b291;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf012('0x0'));var zipdir=require(_0xf012('0x1'));var jsonpatch=require(_0xf012('0x2'));var rp=require(_0xf012('0x3'));var moment=require(_0xf012('0x4'));var BPromise=require(_0xf012('0x5'));var Mustache=require(_0xf012('0x6'));var util=require(_0xf012('0x7'));var path=require(_0xf012('0x8'));var sox=require(_0xf012('0x9'));var csv=require(_0xf012('0xa'));var ejs=require(_0xf012('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf012('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf012('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0xf012('0xd'));var qs=require(_0xf012('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf012('0xf'));var logger=require(_0xf012('0x10'))(_0xf012('0x11'));var utils=require(_0xf012('0x12'));var config=require(_0xf012('0x13'));var licenseUtil=require(_0xf012('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf012('0x15')](config[_0xf012('0x16')],{'host':_0xf012('0x17'),'port':0x18eb});var socket=require(_0xf012('0x18'))(new Redis(config[_0xf012('0x16')]));require(_0xf012('0x19'))[_0xf012('0x1a')](socket);function respondWithStatusCode(_0x4b23a0,_0x423234){_0x423234=_0x423234||0xcc;return function(_0x2d708d){if(_0x2d708d){return _0x4b23a0[_0xf012('0x1b')](_0x423234);}return _0x4b23a0['status'](_0x423234)[_0xf012('0x1c')]();};}function respondWithResult(_0x2fa9a,_0xa6585c){_0xa6585c=_0xa6585c||0xc8;return function(_0x2e8908){if(_0x2e8908){return _0x2fa9a[_0xf012('0x1d')](_0xa6585c)['json'](_0x2e8908);}};}function respondWithFilteredResult(_0x4c34bc,_0x263302){return function(_0x2c3037){if(_0x2c3037){var _0x37d134=typeof _0x263302['offset']===_0xf012('0x1e')&&typeof _0x263302[_0xf012('0x1f')]==='undefined';var _0x3b8917=_0x2c3037[_0xf012('0x20')];var _0x5dbf7f=_0x37d134?0x0:_0x263302[_0xf012('0x21')];var _0x2afe0e=_0x37d134?_0x2c3037[_0xf012('0x20')]:_0x263302['offset']+_0x263302['limit'];var _0x2eb7f1;if(_0x2afe0e>=_0x3b8917){_0x2afe0e=_0x3b8917;_0x2eb7f1=0xc8;}else{_0x2eb7f1=0xce;}_0x4c34bc[_0xf012('0x1d')](_0x2eb7f1);return _0x4c34bc[_0xf012('0x22')](_0xf012('0x23'),_0x5dbf7f+'-'+_0x2afe0e+'/'+_0x3b8917)[_0xf012('0x24')](_0x2c3037);}return null;};}function patchUpdates(_0x2d77f7){return function(_0x51926b){try{jsonpatch[_0xf012('0x25')](_0x51926b,_0x2d77f7,!![]);}catch(_0x89f1fd){return BPromise[_0xf012('0x26')](_0x89f1fd);}return _0x51926b[_0xf012('0x27')]();};}function saveUpdates(_0x3d233d,_0x4f7f1d){return function(_0x3ee5ee){if(_0x3ee5ee){return _0x3ee5ee[_0xf012('0x28')](_0x3d233d)[_0xf012('0x29')](function(_0x40554c){return _0x40554c;});}return null;};}function removeEntity(_0x4ac02e,_0x400f25){return function(_0x19808b){if(_0x19808b){return _0x19808b[_0xf012('0x2a')]()[_0xf012('0x29')](function(){var _0x48878f=_0x19808b[_0xf012('0x2b')]({'plain':!![]});var _0x3c9c98='Plugins';return db[_0xf012('0x2c')][_0xf012('0x2a')]({'where':{'type':_0x3c9c98,'resourceId':_0x48878f['id']}})[_0xf012('0x29')](function(){return _0x19808b;});})[_0xf012('0x29')](function(){_0x4ac02e[_0xf012('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3407cb,_0x387449){return function(_0x2387ad){if(!_0x2387ad){_0x3407cb[_0xf012('0x1b')](0x194);}return _0x2387ad;};}function handleError(_0x178b69,_0x53f47e){_0x53f47e=_0x53f47e||0x1f4;return function(_0x10fe78){logger[_0xf012('0x2d')](_0x10fe78[_0xf012('0x2e')]);if(_0x10fe78[_0xf012('0x2f')]){delete _0x10fe78[_0xf012('0x2f')];}_0x178b69['status'](_0x53f47e)[_0xf012('0x30')](_0x10fe78);};}exports[_0xf012('0x31')]=function(_0x18f85d,_0x3b1f01){var _0x1291fd={},_0x3e0638={},_0x21f78c={'count':0x0,'rows':[]};var _0x370522=_[_0xf012('0x32')](db[_0xf012('0x33')][_0xf012('0x34')],function(_0x115aca){return{'name':_0x115aca[_0xf012('0x35')],'type':_0x115aca[_0xf012('0x36')][_0xf012('0x37')]};});_0x3e0638[_0xf012('0x38')]=_[_0xf012('0x32')](_0x370522,_0xf012('0x2f'));_0x3e0638[_0xf012('0x39')]=_[_0xf012('0x3a')](_0x18f85d[_0xf012('0x39')]);_0x3e0638[_0xf012('0x3b')]=_[_0xf012('0x3c')](_0x3e0638[_0xf012('0x38')],_0x3e0638['query']);_0x1291fd['attributes']=_[_0xf012('0x3c')](_0x3e0638[_0xf012('0x38')],qs[_0xf012('0x3d')](_0x18f85d['query']['fields']));_0x1291fd[_0xf012('0x3e')]=_0x1291fd[_0xf012('0x3e')][_0xf012('0x3f')]?_0x1291fd[_0xf012('0x3e')]:_0x3e0638[_0xf012('0x38')];if(!_0x18f85d[_0xf012('0x39')][_0xf012('0x40')]('nolimit')){_0x1291fd[_0xf012('0x1f')]=qs['limit'](_0x18f85d[_0xf012('0x39')][_0xf012('0x1f')]);_0x1291fd[_0xf012('0x21')]=qs['offset'](_0x18f85d[_0xf012('0x39')][_0xf012('0x21')]);}_0x1291fd['order']=qs['sort'](_0x18f85d[_0xf012('0x39')][_0xf012('0x41')]);_0x1291fd[_0xf012('0x42')]=qs[_0xf012('0x3b')](_['pick'](_0x18f85d[_0xf012('0x39')],_0x3e0638[_0xf012('0x3b')]),_0x370522);if(_0x18f85d[_0xf012('0x39')][_0xf012('0x43')]){_0x1291fd['where']=_[_0xf012('0x44')](_0x1291fd[_0xf012('0x42')],{'$or':_[_0xf012('0x32')](_0x370522,function(_0x3a8b43){if(_0x3a8b43['type']!=='VIRTUAL'){var _0x2b8788={};_0x2b8788[_0x3a8b43['name']]={'$like':'%'+_0x18f85d[_0xf012('0x39')][_0xf012('0x43')]+'%'};return _0x2b8788;}})});}_0x1291fd=_[_0xf012('0x44')]({},_0x1291fd,_0x18f85d[_0xf012('0x45')]);var _0x30c565={'where':_0x1291fd[_0xf012('0x42')]};return db['Plugin'][_0xf012('0x20')](_0x30c565)['then'](function(_0x26e8b3){_0x21f78c[_0xf012('0x20')]=_0x26e8b3;if(_0x18f85d[_0xf012('0x39')][_0xf012('0x46')]){_0x1291fd['include']=[{'all':!![]}];}return db[_0xf012('0x33')][_0xf012('0x47')](_0x1291fd);})[_0xf012('0x29')](function(_0x2992a9){_0x21f78c[_0xf012('0x48')]=_0x2992a9;return _0x21f78c;})[_0xf012('0x29')](respondWithFilteredResult(_0x3b1f01,_0x1291fd))[_0xf012('0x49')](handleError(_0x3b1f01,null));};exports['show']=function(_0x30fb04,_0x20f12a){var _0x5e423f={'raw':!![],'where':{'id':_0x30fb04[_0xf012('0x4a')]['id']}},_0x5a877d={};_0x5a877d[_0xf012('0x38')]=_[_0xf012('0x3a')](db[_0xf012('0x33')][_0xf012('0x34')]);_0x5a877d[_0xf012('0x39')]=_['keys'](_0x30fb04['query']);_0x5a877d[_0xf012('0x3b')]=_[_0xf012('0x3c')](_0x5a877d[_0xf012('0x38')],_0x5a877d[_0xf012('0x39')]);_0x5e423f['attributes']=_[_0xf012('0x3c')](_0x5a877d[_0xf012('0x38')],qs[_0xf012('0x3d')](_0x30fb04['query'][_0xf012('0x3d')]));_0x5e423f['attributes']=_0x5e423f[_0xf012('0x3e')][_0xf012('0x3f')]?_0x5e423f[_0xf012('0x3e')]:_0x5a877d[_0xf012('0x38')];if(_0x30fb04[_0xf012('0x39')][_0xf012('0x46')]){_0x5e423f[_0xf012('0x4b')]=[{'all':!![]}];}_0x5e423f=_[_0xf012('0x44')]({},_0x5e423f,_0x30fb04[_0xf012('0x45')]);return db[_0xf012('0x33')]['find'](_0x5e423f)['then'](handleEntityNotFound(_0x20f12a,null))[_0xf012('0x29')](respondWithResult(_0x20f12a,null))[_0xf012('0x49')](handleError(_0x20f12a,null));};exports[_0xf012('0x4c')]=function(_0x5b40ea,_0x4c8cbb,_0x3c8c79){return db[_0xf012('0x33')]['find']({'where':{'id':_0x5b40ea[_0xf012('0x4a')]['id']},'attributes':[_0xf012('0x2f'),_0xf012('0x8')],'raw':!![]})[_0xf012('0x29')](handleEntityNotFound(_0x4c8cbb,null))['then'](function(_0x461af5){if(_0x461af5){var _0x12b41a=path[_0xf012('0x4d')](config['root'],_0xf012('0x4e'),util[_0xf012('0x4f')](_0xf012('0x50'),path[_0xf012('0x51')](_0x461af5[_0xf012('0x8')])));var _0x404b27=fs[_0xf012('0x52')](_0x12b41a);var _0x35e926=archiver(_0xf012('0x53'),{'zlib':{'level':0x9}});_0x35e926['on']('warning',function(_0x2d687c){if(_0x2d687c[_0xf012('0x54')]==='ENOENT'){logger[_0xf012('0x2d')](_0x2d687c);}else{throw new db[(_0xf012('0x55'))][(_0xf012('0x56'))](_0xf012('0x57'));}});_0x35e926['on']('error',function(_0x33fea8){throw new db[(_0xf012('0x55'))]['Error'](_0xf012('0x57'));});_0x35e926[_0xf012('0x58')](_0x404b27);_0x35e926[_0xf012('0x59')](_0xf012('0x5a'),{'cwd':path['join'](config[_0xf012('0x5b')],'server/files/plugins',path['dirname'](_0x461af5[_0xf012('0x8')])),'ignore':[path[_0xf012('0x4d')](path[_0xf012('0x51')](_0x461af5[_0xf012('0x8')]),_0xf012('0x5c')),path['join'](path['basename'](_0x461af5[_0xf012('0x8')]),'attachments/**/*')],'nodir':!![]})[_0xf012('0x5d')]();_0x404b27['on'](_0xf012('0x5e'),function(){if(!fs[_0xf012('0x5f')](_0x12b41a)){throw new db[(_0xf012('0x55'))][(_0xf012('0x56'))](_0xf012('0x60'));}return _0x4c8cbb[_0xf012('0x4c')](_0x12b41a,util[_0xf012('0x4f')](_0xf012('0x50'),path[_0xf012('0x51')](_0x461af5[_0xf012('0x8')])),function(_0x5e468b){if(_0x5e468b){throw new db[(_0xf012('0x55'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x12b41a);logger[_0xf012('0x61')](_0xf012('0x62'));logger[_0xf012('0x61')](_0xf012('0x63'));});});}return null;})[_0xf012('0x49')](handleError(_0x4c8cbb,null));};exports['upload']=function(_0x405f17,_0x124058,_0x365c25){var _0x578edb=path['basename'](_0x405f17[_0xf012('0x64')][_0xf012('0x65')],path['extname'](_0x405f17['file'][_0xf012('0x65')]));var _0x5c1de8=path[_0xf012('0x4d')](config['root'],'server/files/plugins',_0x405f17['file'][_0xf012('0x65')]);var _0x526e53=path[_0xf012('0x4d')](config[_0xf012('0x5b')],_0xf012('0x4e'),_0x578edb);logger[_0xf012('0x61')]('Plugin\x20upload\x20filepath:\x20%s',_0x5c1de8);logger[_0xf012('0x61')](_0xf012('0x66'),_0x526e53);try{fs['chmodSync'](_0x5c1de8,parseInt(_0xf012('0x67'),0x8));extract(_0x5c1de8,{'dir':_0x526e53},function(_0x4c9ab7){if(_0x4c9ab7){logger[_0xf012('0x2d')](_0x4c9ab7);handleError(_0x4c9ab7,!![]);};var _0x3fbe52=fs[_0xf012('0x68')](_0x526e53);if(_0x3fbe52[_0xf012('0x3f')]>0x1){removeReferences(_0x5c1de8,_0x526e53);logger[_0xf012('0x2d')](_0xf012('0x69'));return _0x365c25(new Error(_0xf012('0x69')));}var _0xc0a5d9=fs['lstatSync'](path[_0xf012('0x4d')](_0x526e53,_0x3fbe52[0x0]));if(_0xc0a5d9['isFile']()){removeReferences(_0x5c1de8,_0x526e53);logger['error'](_0xf012('0x69'));return _0x365c25(new Error('Invalid\x20plugin\x20structure'));}if(_0xc0a5d9[_0xf012('0x6a')]()){var _0x26ea5f=fs['readdirSync'](path[_0xf012('0x4d')](_0x526e53,_0x3fbe52[0x0]));if(_0x26ea5f[_0xf012('0x3f')]===0x0){removeReferences(_0x5c1de8,_0x526e53);logger['error'](_0xf012('0x69'));return _0x365c25(new Error('Invalid\x20plugin\x20structure'));}var _0x4080d0=_0x26ea5f['some'](function(_0x8144d9){return _0x8144d9===_0xf012('0x6b');});if(!_0x4080d0){return _0x365c25(new Error(_0xf012('0x6c')));}var _0x72ac90=fs[_0xf012('0x6d')](path['join'](_0x526e53,_0x3fbe52[0x0],_0xf012('0x6b')));var _0x13f346=JSON['parse'](_0x72ac90);if(_0xf012('0x1e')==typeof _0x13f346[_0xf012('0x2f')]){return _0x365c25(new Error(_0xf012('0x6e')));}if(_0xf012('0x1e')==typeof _0x13f346['type']){return _0x365c25(new Error(_0xf012('0x6f')));}if(_0xf012('0x1e')==typeof _0x13f346['version']){return _0x365c25(new Error(_0xf012('0x70')));}if(_0xf012('0x1e')==typeof _0x13f346[_0xf012('0x71')]){return _0x365c25(new Error(_0xf012('0x72')));}if(_0x13f346[_0xf012('0x36')]===_0xf012('0x73')){if('undefined'==typeof _0x13f346['parameters'][_0xf012('0x74')]){return _0x365c25(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xf012('0x1e')==typeof _0x13f346[_0xf012('0x71')]['views'][_0xf012('0x75')]&&'undefined'==typeof _0x13f346[_0xf012('0x71')][_0xf012('0x74')][_0xf012('0x76')]){return _0x365c25(new Error(_0xf012('0x77')));}}else if(_0x13f346[_0xf012('0x36')]===_0xf012('0x78')){if('undefined'==typeof _0x13f346['parameters'][_0xf012('0x79')]){return _0x365c25(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xf012('0x1e')==typeof _0x13f346['parameters'][_0xf012('0x7a')]){return _0x365c25(new Error(_0xf012('0x7b')));}}else{return _0x365c25(new Error(_0xf012('0x7c')));}var _0xe256e3=_0x13f346['name'];var _0x5c99a9=_0x13f346['description'];var _0x3af504=_0x13f346['type'];var _0x4afe4a=_0x13f346[_0xf012('0x7d')]?_0x13f346[_0xf012('0x7d')]:_0xf012('0x7e');var _0x3fc5f7=_0x13f346[_0xf012('0x7f')]?_0x13f346[_0xf012('0x7f')]:_0xf012('0x80');var _0x195f6c='';var _0xbd49d6='';var _0x31afc9='';var _0x2663b9='';var _0xc72b73=_0x13f346[_0xf012('0x81')];if(_0x3af504===_0xf012('0x73')){if(_0xf012('0x1e')!=typeof _0x13f346['parameters']['views'][_0xf012('0x75')]){var _0x429761=_0x13f346['parameters'][_0xf012('0x74')][_0xf012('0x75')];if(!/^(f|ht)tps?:\/\//i[_0xf012('0x82')](_0x429761)){_0x195f6c=path[_0xf012('0x4d')](_0xf012('0x83'),_0x578edb,_0x3fbe52[0x0],_0x429761);}else{_0x195f6c=_0x429761;}}else{logger[_0xf012('0x61')](_0xf012('0x84'));}if(_0xf012('0x1e')!=typeof _0x13f346[_0xf012('0x71')][_0xf012('0x74')]['agent']){var _0x3b947e=_0x13f346[_0xf012('0x71')][_0xf012('0x74')][_0xf012('0x76')];if(!/^(f|ht)tps?:\/\//i[_0xf012('0x82')](_0x3b947e)){_0xbd49d6=path[_0xf012('0x4d')](_0xf012('0x83'),_0x578edb,_0x3fbe52[0x0],_0x3b947e);}else{_0xbd49d6=_0x3b947e;}}else{logger[_0xf012('0x61')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3af504===_0xf012('0x78')){_0x31afc9=_0x13f346[_0xf012('0x71')][_0xf012('0x79')];_0x2663b9=_0x13f346[_0xf012('0x71')][_0xf012('0x7a')];if(_0xf012('0x1e')!=typeof _0x13f346[_0xf012('0x71')][_0xf012('0x74')]){if(_0xf012('0x1e')!=typeof _0x13f346[_0xf012('0x71')][_0xf012('0x74')]['admin']){var _0x429761=_0x13f346[_0xf012('0x71')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xf012('0x82')](_0x429761)){_0x195f6c=path[_0xf012('0x4d')]('plugins',_0x578edb,_0x3fbe52[0x0],_0x429761);}else{_0x195f6c=_0x429761;}}if(_0xf012('0x1e')!=typeof _0x13f346[_0xf012('0x71')][_0xf012('0x74')][_0xf012('0x76')]){var _0x3b947e=_0x13f346[_0xf012('0x71')][_0xf012('0x74')][_0xf012('0x76')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3b947e)){_0xbd49d6=path[_0xf012('0x4d')]('plugins',_0x578edb,_0x3fbe52[0x0],_0x3b947e);}else{_0xbd49d6=_0x3b947e;}}}}var _0x2b3975={'name':_0xe256e3,'description':_0x5c99a9,'path':path[_0xf012('0x4d')](_0x578edb,_0x3fbe52[0x0]),'type':_0x3af504,'sidebar':_0x4afe4a,'icon':_0x3fc5f7,'adminUrl':_0x195f6c,'agentUrl':_0xbd49d6,'scriptName':_0x31afc9,'scriptPath':_0x2663b9,'version':_0xc72b73};removeReferences(_0x5c1de8,null);return db[_0xf012('0x33')][_0xf012('0x85')](_0x2b3975)[_0xf012('0x29')](function(_0x37b660){var _0x117728={'role':_0x405f17[_0xf012('0x86')][_0xf012('0x87')],'userProfileId':_0x405f17[_0xf012('0x86')]['userProfileId']};if(!_0x117728)throw new Error(_0xf012('0x88'));if(_0x117728['role']===_0xf012('0x89')){var _0x17b35a=_0x37b660[_0xf012('0x2b')]({'plain':!![]});return db[_0xf012('0x8a')]['find']({'where':{'name':'Plugins','userProfileId':_0x117728[_0xf012('0x8b')]},'raw':!![]})[_0xf012('0x29')](function(_0x2d405c){if(_0x2d405c&&_0x2d405c[_0xf012('0x8c')]===0x0){return db[_0xf012('0x2c')][_0xf012('0x85')]({'name':_0x17b35a[_0xf012('0x2f')],'resourceId':_0x17b35a['id'],'type':_0x2d405c[_0xf012('0x2f')],'sectionId':_0x2d405c['id']},{})[_0xf012('0x29')](function(){return _0x37b660;});}else{return _0x37b660;}})[_0xf012('0x49')](function(_0x295437){logger[_0xf012('0x2d')](_0xf012('0x8d'),_0x295437);throw _0x295437;});}return _0x37b660;})[_0xf012('0x29')](respondWithResult(_0x124058,null))[_0xf012('0x49')](handleError(_0x124058,null));}});}catch(_0xe9f3be){_0x124058[_0xf012('0x1d')](0x1f4)['send'](_0xe9f3be);}};function removeReferences(_0x1dc40a,_0x1dac26){try{if(_0x1dc40a){fs[_0xf012('0x8e')](_0x1dc40a);logger[_0xf012('0x61')](_0xf012('0x8f'));}if(_0x1dac26){rimraf(_0x1dac26,function(){});logger[_0xf012('0x61')]('Extracted\x20folder\x20removed');}}catch(_0x197bca){logger[_0xf012('0x2d')](_0x197bca);}}exports[_0xf012('0x28')]=function(_0x5c94fb,_0x23dabd,_0x2f24a4){return db['Plugin']['find']({'where':{'id':_0x5c94fb[_0xf012('0x4a')]['id']}})[_0xf012('0x29')](handleEntityNotFound(_0x23dabd,null))[_0xf012('0x29')](saveUpdates(_0x5c94fb[_0xf012('0x86')],null))[_0xf012('0x29')](respondWithResult(_0x23dabd,null))[_0xf012('0x49')](handleError(_0x23dabd,null));};exports['delete']=function(_0x72ee26,_0x45c907,_0x821200){return db[_0xf012('0x33')][_0xf012('0x90')]({'where':{'id':_0x72ee26['params']['id']}})[_0xf012('0x29')](function(_0x43876b){if(_0x43876b){return _0x43876b[_0xf012('0x2a')]();}})['then'](function(_0x9b5d0b){rimraf(path['join'](config[_0xf012('0x5b')],_0xf012('0x4e'),path[_0xf012('0x91')](_0x9b5d0b[_0xf012('0x8')])),function(){});return _0x9b5d0b;})[_0xf012('0x29')](handleEntityNotFound(_0x45c907,null))[_0xf012('0x29')](respondWithStatusCode(_0x45c907,null))[_0xf012('0x49')](handleError(_0x45c907,null));};exports['webhookGet']=function(_0xfd9ec6,_0x27864a,_0xf7317b){return BPromise['resolve']()[_0xf012('0x29')](function(){if(!_0xfd9ec6[_0xf012('0x39')][_0xf012('0x8')]){throw new Error(_0xf012('0x92'));}if(!_0xfd9ec6[_0xf012('0x39')][_0xf012('0x93')]){throw new Error(_0xf012('0x94'));}var _0x3135ed=_0xfd9ec6[_0xf012('0x39')][_0xf012('0x95')]?_0xfd9ec6[_0xf012('0x39')][_0xf012('0x95')]+':'+_0xfd9ec6[_0xf012('0x39')][_0xf012('0x93')]:'http://localhost:'+_0xfd9ec6[_0xf012('0x39')][_0xf012('0x93')];var _0x24eecd=_0xfd9ec6['query'][_0xf012('0x24')]?_0xfd9ec6['query'][_0xf012('0x24')]:!![];var _0x3cd9de=_0xfd9ec6[_0xf012('0x39')][_0xf012('0x96')]?_0xfd9ec6[_0xf012('0x39')]['encoding']:null;var _0x495512={'method':_0xfd9ec6[_0xf012('0x97')],'uri':util['format'](_0xf012('0x98'),_0x3135ed,_0xfd9ec6[_0xf012('0x39')][_0xf012('0x8')]),'json':_0x24eecd,'resolveWithFullResponse':!![],'encoding':_0x3cd9de,'qs':_0xfd9ec6[_0xf012('0x39')]};if(_0xfd9ec6[_0xf012('0x99')]){_0x495512['headers']=_0xfd9ec6['headers'];if(_0x495512[_0xf012('0x99')][_0xf012('0x9a')]){delete _0x495512[_0xf012('0x99')][_0xf012('0x9a')];}}if(_0x495512[_0xf012('0x99')][_0xf012('0x9b')]){delete _0x495512[_0xf012('0x99')][_0xf012('0x9b')];}return rp(_0x495512);})[_0xf012('0x29')](function(_0x1b1e06){if(_0x1b1e06){_0x27864a['set'](_0x1b1e06[_0xf012('0x99')]);logger[_0xf012('0x61')](_0x1b1e06['body']);if(_['endsWith'](_0xfd9ec6['query'][_0xf012('0x8')],'download')&&_0x1b1e06['statusCode']==0x1f4){return _0x27864a[_0xf012('0x1b')](_0x1b1e06['statusCode']);}else{return _0x27864a['status'](_0x1b1e06[_0xf012('0x9c')])['send'](_0x1b1e06[_0xf012('0x86')]);}}else{return _0x27864a[_0xf012('0x1b')](0xc8);}})[_0xf012('0x49')](handleError(_0x27864a,null));};exports[_0xf012('0x9d')]=function(_0x52eb35,_0x1bf91a,_0x26a81a){return BPromise['resolve']()[_0xf012('0x29')](function(){if(!_0x52eb35['query'][_0xf012('0x8')]){throw new Error(_0xf012('0x92'));}if(!_0x52eb35[_0xf012('0x39')][_0xf012('0x93')]){throw new Error(_0xf012('0x94'));}var _0xb29c4c=_0x52eb35['query']['hostname']?_0x52eb35[_0xf012('0x39')]['hostname']+':'+_0x52eb35['query'][_0xf012('0x93')]:_0xf012('0x9e')+_0x52eb35[_0xf012('0x39')][_0xf012('0x93')];var _0x175edb=_0x52eb35[_0xf012('0x39')][_0xf012('0x24')]?_0x52eb35['query'][_0xf012('0x24')]:!![];var _0x210916=_0x52eb35[_0xf012('0x39')][_0xf012('0x96')]?_0x52eb35[_0xf012('0x39')][_0xf012('0x96')]:null;var _0x5ac1dd={'method':_0x52eb35[_0xf012('0x97')],'uri':util[_0xf012('0x4f')](_0xf012('0x98'),_0xb29c4c,_0x52eb35['query'][_0xf012('0x8')]),'json':_0x175edb,'resolveWithFullResponse':!![],'encoding':_0x210916,'body':_0x52eb35['body']};if(_0x52eb35['headers']){_0x5ac1dd[_0xf012('0x99')]=_0x52eb35[_0xf012('0x99')];if(_0x5ac1dd[_0xf012('0x99')][_0xf012('0x9a')]){delete _0x5ac1dd[_0xf012('0x99')][_0xf012('0x9a')];}}if(_0x5ac1dd[_0xf012('0x99')][_0xf012('0x9b')]){delete _0x5ac1dd[_0xf012('0x99')]['content-type'];}return rp(_0x5ac1dd);})[_0xf012('0x29')](function(_0x3f809a){if(_0x3f809a){_0x1bf91a[_0xf012('0x22')](_0x3f809a[_0xf012('0x99')]);logger['info'](_0x3f809a[_0xf012('0x86')]);return _0x1bf91a['status'](_0x3f809a[_0xf012('0x9c')])[_0xf012('0x30')](_0x3f809a[_0xf012('0x86')]);}else{return _0x1bf91a[_0xf012('0x1b')](0xc8);}})['catch'](handleError(_0x1bf91a,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index c5a4ea5..0eb0737 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 _0x4148=['Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x4148,0xc6));var _0x8414=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x4148[_0x55ff79];return _0x579067;};'use strict';var EventEmitter=require(_0x8414('0x0'));var Plugin=require(_0x8414('0x1'))['db'][_0x8414('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x8414('0x3')](0x0);var events={'afterCreate':_0x8414('0x4'),'afterUpdate':'update','afterDestroy':_0x8414('0x5')};function emitEvent(_0x39b377){return function(_0x41ddde,_0x361d0b,_0x5dfe3c){PluginEvents[_0x8414('0x6')](_0x39b377+':'+_0x41ddde['id'],_0x41ddde);PluginEvents['emit'](_0x39b377,_0x41ddde);_0x5dfe3c(null);};}for(var e in events){if(events[_0x8414('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x7c09=['Plugin','save','update','remove','hook','exports','../../mysqldb'];(function(_0x3064c0,_0x4d0121){var _0x4bdf6a=function(_0x2b68eb){while(--_0x2b68eb){_0x3064c0['push'](_0x3064c0['shift']());}};_0x4bdf6a(++_0x4d0121);}(_0x7c09,0x102));var _0x97c0=function(_0x1bd041,_0x120b5e){_0x1bd041=_0x1bd041-0x0;var _0x16285a=_0x7c09[_0x1bd041];return _0x16285a;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x97c0('0x0'))['db'][_0x97c0('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x97c0('0x2'),'afterUpdate':_0x97c0('0x3'),'afterDestroy':_0x97c0('0x4')};function emitEvent(_0x214897){return function(_0x12eb6d,_0x99bf54,_0x15c67b){PluginEvents['emit'](_0x214897+':'+_0x12eb6d['id'],_0x12eb6d);PluginEvents['emit'](_0x214897,_0x12eb6d);_0x15c67b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x97c0('0x5')](e,emitEvent(event));}}module[_0x97c0('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b59073a..b559f56 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 _0x213e=['rimraf','./plugin.attributes','exports','define','Plugin','plugins','util','../../config/logger','api','moment','request-promise','path'];(function(_0x572165,_0x6a45cc){var _0x8c8709=function(_0x43faab){while(--_0x43faab){_0x572165['push'](_0x572165['shift']());}};_0x8c8709(++_0x6a45cc);}(_0x213e,0x102));var _0xe213=function(_0x3834d2,_0x5f23bd){_0x3834d2=_0x3834d2-0x0;var _0x206f96=_0x213e[_0x3834d2];return _0x206f96;};'use strict';var _=require('lodash');var util=require(_0xe213('0x0'));var logger=require(_0xe213('0x1'))(_0xe213('0x2'));var moment=require(_0xe213('0x3'));var BPromise=require('bluebird');var rp=require(_0xe213('0x4'));var fs=require('fs');var path=require(_0xe213('0x5'));var rimraf=require(_0xe213('0x6'));var config=require('../../config/environment');var attributes=require(_0xe213('0x7'));module[_0xe213('0x8')]=function(_0x3ec8b2,_0x3cbd44){return _0x3ec8b2[_0xe213('0x9')](_0xe213('0xa'),attributes,{'tableName':_0xe213('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9eae=['api','moment','request-promise','../../config/environment','./plugin.attributes','exports','plugins','../../config/logger'];(function(_0x3c5ebb,_0x5bcd77){var _0xe139b=function(_0x1e6f29){while(--_0x1e6f29){_0x3c5ebb['push'](_0x3c5ebb['shift']());}};_0xe139b(++_0x5bcd77);}(_0x9eae,0x7f));var _0xe9ea=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9eae[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe9ea('0x0'))(_0xe9ea('0x1'));var moment=require(_0xe9ea('0x2'));var BPromise=require('bluebird');var rp=require(_0xe9ea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe9ea('0x4'));var attributes=require(_0xe9ea('0x5'));module[_0xe9ea('0x6')]=function(_0x2bde63,_0x33be69){return _0x2bde63['define']('Plugin',attributes,{'tableName':_0xe9ea('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 9b3ff6e..73d54b4 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 _0xb6f8=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','CreatePlugin','Plugin','options','raw','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1b7d1d,_0x1762a4){var _0x35c42b=function(_0x4584ef){while(--_0x4584ef){_0x1b7d1d['push'](_0x1b7d1d['shift']());}};_0x35c42b(++_0x1762a4);}(_0xb6f8,0x9d));var _0x8b6f=function(_0x31f308,_0x3db808){_0x31f308=_0x31f308-0x0;var _0x24faed=_0xb6f8[_0x31f308];return _0x24faed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8b6f('0x0'));var BPromise=require(_0x8b6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b6f('0x2'));var db=require(_0x8b6f('0x3'))['db'];var utils=require(_0x8b6f('0x4'));var logger=require(_0x8b6f('0x5'))(_0x8b6f('0x6'));var config=require(_0x8b6f('0x7'));var jayson=require(_0x8b6f('0x8'));var client=jayson[_0x8b6f('0x9')][_0x8b6f('0xa')]({'port':0x232a});config['redis']=_[_0x8b6f('0xb')](config[_0x8b6f('0xc')],{'host':_0x8b6f('0xd'),'port':0x18eb});var socket=require(_0x8b6f('0xe'))(new Redis(config[_0x8b6f('0xc')]));require(_0x8b6f('0xf'))[_0x8b6f('0x10')](socket);function respondWithRpcPromise(_0x142fe4,_0x21121d,_0x364adf){return new BPromise(function(_0x422ed5,_0x2c50dd){return client[_0x8b6f('0x11')](_0x142fe4,_0x364adf)[_0x8b6f('0x12')](function(_0x5cbbc8){logger['info'](_0x8b6f('0x13'),_0x21121d,'request\x20sent');logger[_0x8b6f('0x14')](_0x8b6f('0x15'),_0x21121d,_0x8b6f('0x16'),JSON[_0x8b6f('0x17')](_0x5cbbc8));if(_0x5cbbc8['error']){if(_0x5cbbc8['error'][_0x8b6f('0x18')]===0x1f4){logger[_0x8b6f('0x19')](_0x8b6f('0x13'),_0x21121d,_0x5cbbc8[_0x8b6f('0x19')][_0x8b6f('0x1a')]);return _0x2c50dd(_0x5cbbc8[_0x8b6f('0x19')][_0x8b6f('0x1a')]);}logger['error'](_0x8b6f('0x13'),_0x21121d,_0x5cbbc8[_0x8b6f('0x19')][_0x8b6f('0x1a')]);return _0x422ed5(_0x5cbbc8['error']['message']);}else{logger[_0x8b6f('0x1b')]('Plugin,\x20%s,\x20%s',_0x21121d,_0x8b6f('0x16'));_0x422ed5(_0x5cbbc8['result']['message']);}})['catch'](function(_0x4de61b){logger[_0x8b6f('0x19')]('Plugin,\x20%s,\x20%s',_0x21121d,_0x4de61b);_0x2c50dd(_0x4de61b);});});}exports[_0x8b6f('0x1c')]=function(_0xb16abd){var _0xbbb9d7=this;return new Promise(function(_0x2cf0e1,_0x296063){return db[_0x8b6f('0x1d')]['create'](_0xb16abd['body'],{'raw':_0xb16abd[_0x8b6f('0x1e')]?_0xb16abd[_0x8b6f('0x1e')][_0x8b6f('0x1f')]===undefined?!![]:![]:!![]})[_0x8b6f('0x12')](function(_0x31604b){logger[_0x8b6f('0x1b')](_0x8b6f('0x1c'),_0xb16abd);logger['debug'](_0x8b6f('0x1c'),_0xb16abd,JSON[_0x8b6f('0x17')](_0x31604b));_0x2cf0e1(_0x31604b);})[_0x8b6f('0x20')](function(_0x612ec9){logger[_0x8b6f('0x19')](_0x8b6f('0x1c'),_0x612ec9['message'],_0xb16abd);_0x296063(_0xbbb9d7['error'](0x1f4,_0x612ec9['message']));});});}; \ No newline at end of file +var _0x4a4b=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreatePlugin','Plugin','create','body','options','raw','catch','util','bluebird'];(function(_0x527899,_0x2538a3){var _0x4d9e24=function(_0x369323){while(--_0x369323){_0x527899['push'](_0x527899['shift']());}};_0x4d9e24(++_0x2538a3);}(_0x4a4b,0xb2));var _0xb4a4=function(_0x2ec6dd,_0x38e152){_0x2ec6dd=_0x2ec6dd-0x0;var _0x392ae2=_0x4a4b[_0x2ec6dd];return _0x392ae2;};'use strict';var _=require('lodash');var util=require(_0xb4a4('0x0'));var moment=require('moment');var BPromise=require(_0xb4a4('0x1'));var rs=require(_0xb4a4('0x2'));var fs=require('fs');var Redis=require(_0xb4a4('0x3'));var db=require(_0xb4a4('0x4'))['db'];var utils=require(_0xb4a4('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb4a4('0x6'));var client=jayson[_0xb4a4('0x7')][_0xb4a4('0x8')]({'port':0x232a});config[_0xb4a4('0x9')]=_[_0xb4a4('0xa')](config[_0xb4a4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4a4('0xb'))(new Redis(config['redis']));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x1be525,_0x21f1ca,_0x2cc54b){return new BPromise(function(_0x3c484a,_0x434a9b){return client[_0xb4a4('0xc')](_0x1be525,_0x2cc54b)[_0xb4a4('0xd')](function(_0x51313c){logger['info'](_0xb4a4('0xe'),_0x21f1ca,_0xb4a4('0xf'));logger[_0xb4a4('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x21f1ca,_0xb4a4('0xf'),JSON[_0xb4a4('0x11')](_0x51313c));if(_0x51313c[_0xb4a4('0x12')]){if(_0x51313c[_0xb4a4('0x12')][_0xb4a4('0x13')]===0x1f4){logger['error'](_0xb4a4('0xe'),_0x21f1ca,_0x51313c[_0xb4a4('0x12')][_0xb4a4('0x14')]);return _0x434a9b(_0x51313c[_0xb4a4('0x12')][_0xb4a4('0x14')]);}logger[_0xb4a4('0x12')](_0xb4a4('0xe'),_0x21f1ca,_0x51313c[_0xb4a4('0x12')]['message']);return _0x3c484a(_0x51313c[_0xb4a4('0x12')][_0xb4a4('0x14')]);}else{logger[_0xb4a4('0x15')]('Plugin,\x20%s,\x20%s',_0x21f1ca,_0xb4a4('0xf'));_0x3c484a(_0x51313c[_0xb4a4('0x16')][_0xb4a4('0x14')]);}})['catch'](function(_0x5e1b2d){logger[_0xb4a4('0x12')](_0xb4a4('0xe'),_0x21f1ca,_0x5e1b2d);_0x434a9b(_0x5e1b2d);});});}exports[_0xb4a4('0x17')]=function(_0x3ea801){var _0x5c3a03=this;return new Promise(function(_0x361618,_0x565d49){return db[_0xb4a4('0x18')][_0xb4a4('0x19')](_0x3ea801[_0xb4a4('0x1a')],{'raw':_0x3ea801[_0xb4a4('0x1b')]?_0x3ea801[_0xb4a4('0x1b')][_0xb4a4('0x1c')]===undefined?!![]:![]:!![]})[_0xb4a4('0xd')](function(_0x6b781a){logger['info'](_0xb4a4('0x17'),_0x3ea801);logger[_0xb4a4('0x10')](_0xb4a4('0x17'),_0x3ea801,JSON[_0xb4a4('0x11')](_0x6b781a));_0x361618(_0x6b781a);})[_0xb4a4('0x1d')](function(_0x15c899){logger[_0xb4a4('0x12')](_0xb4a4('0x17'),_0x15c899[_0xb4a4('0x14')],_0x3ea801);_0x565d49(_0x5c3a03[_0xb4a4('0x12')](0x1f4,_0x15c899['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 1123515..7a2b742 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 _0xa708=['./plugin.events','update','emit','register','plugin:'];(function(_0x5cf6ad,_0x5960b7){var _0x57ef9d=function(_0x3099f9){while(--_0x3099f9){_0x5cf6ad['push'](_0x5cf6ad['shift']());}};_0x57ef9d(++_0x5960b7);}(_0xa708,0x190));var _0x8a70=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa708[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0x8a70('0x0'));var events=['save','remove',_0x8a70('0x1')];function createListener(_0x17a927,_0x53d6b3){return function(_0x58db1b){_0x53d6b3[_0x8a70('0x2')](_0x17a927,_0x58db1b);};}function removeListener(_0x1a9ae5,_0x5814fe){return function(){PluginEvents['removeListener'](_0x1a9ae5,_0x5814fe);};}exports[_0x8a70('0x3')]=function(_0x551068){for(var _0x1726d5=0x0,_0x23498f=events['length'];_0x1726d5<_0x23498f;_0x1726d5++){var _0xb4c671=events[_0x1726d5];var _0x71b62b=createListener(_0x8a70('0x4')+_0xb4c671,_0x551068);PluginEvents['on'](_0xb4c671,_0x71b62b);}}; \ No newline at end of file +var _0x67cc=['save','update','emit','removeListener','plugin:','./plugin.events'];(function(_0x2ae730,_0xe2d61a){var _0x5e2637=function(_0x27b9bf){while(--_0x27b9bf){_0x2ae730['push'](_0x2ae730['shift']());}};_0x5e2637(++_0xe2d61a);}(_0x67cc,0x18b));var _0xc67c=function(_0xbfc389,_0x5aad2e){_0xbfc389=_0xbfc389-0x0;var _0x31583a=_0x67cc[_0xbfc389];return _0x31583a;};'use strict';var PluginEvents=require(_0xc67c('0x0'));var events=[_0xc67c('0x1'),'remove',_0xc67c('0x2')];function createListener(_0x47cea3,_0x51061d){return function(_0x5c3d69){_0x51061d[_0xc67c('0x3')](_0x47cea3,_0x5c3d69);};}function removeListener(_0x501533,_0x5d1916){return function(){PluginEvents[_0xc67c('0x4')](_0x501533,_0x5d1916);};}exports['register']=function(_0x3bf413){for(var _0x6e246c=0x0,_0x5d9183=events['length'];_0x6e246c<_0x5d9183;_0x6e246c++){var _0x29ab58=events[_0x6e246c];var _0x2fd898=createListener(_0xc67c('0x5')+_0x29ab58,_0x3bf413);PluginEvents['on'](_0x29ab58,_0x2fd898);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index df14e8c..ca8b4ea 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(_0xd52e29,_0x1653c8){var _0x5077f9=function(_0x4906ae){while(--_0x4906ae){_0xd52e29['push'](_0xd52e29['shift']());}};_0x5077f9(++_0x1653c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x3520f7,_0x541650){var _0x14b6db=function(_0x49b718){while(--_0x49b718){_0x3520f7['push'](_0x3520f7['shift']());}};_0x14b6db(++_0x541650);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 17d02a7..dc8c2e9 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 _0x91a7=['params','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','length','show','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','catch','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status'];(function(_0x39714b,_0x5e0b0e){var _0x45ed60=function(_0x3ce5c8){while(--_0x3ce5c8){_0x39714b['push'](_0x39714b['shift']());}};_0x45ed60(++_0x5e0b0e);}(_0x91a7,0xe7));var _0x791a=function(_0x3456a7,_0x2c4e6c){_0x3456a7=_0x3456a7-0x0;var _0x32f35a=_0x91a7[_0x3456a7];return _0x32f35a;};'use strict';var _=require('lodash');var pm2=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var path=require('path');var exec=require(_0x791a('0x3'))['exec'];var BPromise=require(_0x791a('0x4'));function handleEntityNotFound(_0x535640,_0x50ab29){return function(_0x32fe2b){if(!_0x32fe2b){_0x535640[_0x791a('0x5')](0x194);;}return _0x32fe2b;};}function respondWithResult(_0x49a9b7,_0x361f53){_0x361f53=_0x361f53||0xc8;return function(_0x5db6db){if(_0x5db6db){return _0x49a9b7[_0x791a('0x6')](_0x361f53)[_0x791a('0x7')](_0x5db6db);}return null;};}function handleError(_0x5aa10a,_0x1a32b4){_0x1a32b4=_0x1a32b4||0x1f4;return function(_0x12884d){logger[_0x791a('0x8')](_0x12884d[_0x791a('0x9')]);if(_0x12884d[_0x791a('0xa')]){delete _0x12884d['name'];}_0x5aa10a[_0x791a('0x6')](_0x1a32b4)[_0x791a('0xb')](_0x12884d);};}function execChildProcess(){return new BPromise(function(_0x57e99c,_0x2bd26a){exec(_0x791a('0xc'),function(_0x167bc4,_0x17cf33,_0x2805c9){logger[_0x791a('0xd')](_0x17cf33);logger['info'](_0x2805c9);if(_0x167bc4){logger['error'](_0x167bc4);return _0x2bd26a(_0x167bc4);}return _0x57e99c(_0x17cf33);});});}exports[_0x791a('0xe')]=function(_0x2f2d8d,_0x4c56f0){return pm2[_0x791a('0xf')]()[_0x791a('0x10')](function(_0x5d5b11){if(_0x5d5b11){var _0x2887f0=_[_0x791a('0x11')](_0x5d5b11,function(_0x2ef5c5){return _0x2ef5c5[_0x791a('0xa')]==='express'||_0x2ef5c5[_0x791a('0xa')]==='motion2';});return{'rows':_0x2887f0,'count':_0x2887f0[_0x791a('0x12')]};}return null;})[_0x791a('0x10')](respondWithResult(_0x4c56f0,null))['catch'](handleError(_0x4c56f0,null));};exports[_0x791a('0x13')]=function(_0x5bea2e,_0x35fe48){return pm2['describe'](_0x5bea2e['params']['id'])['then'](respondWithResult(_0x35fe48,null))[_0x791a('0x10')](handleEntityNotFound(_0x35fe48,null))['catch'](handleError(_0x35fe48,null));};exports['create']=function(_0x39c60b,_0x5a702e){if(_0x39c60b[_0x791a('0x14')][_0x791a('0xa')]&&_0x39c60b['body'][_0x791a('0x15')]){var _0xcb5e66=path[_0x791a('0x16')](__dirname,_0x791a('0x17'),_0x39c60b['body'][_0x791a('0x15')]);var _0x2054c6=process[_0x791a('0x18')]();process[_0x791a('0x19')](path[_0x791a('0x1a')](_0xcb5e66));return execChildProcess()[_0x791a('0x10')](function(_0x2241a0){process[_0x791a('0x19')](_0x2054c6);return pm2[_0x791a('0x1b')]({'name':_0x39c60b[_0x791a('0x14')][_0x791a('0xa')],'script':_0xcb5e66});})['then'](function(_0x1102c9){pm2[_0x791a('0x1c')]();return _0x1102c9[0x0];})[_0x791a('0x10')](respondWithResult(_0x5a702e,0xc9))[_0x791a('0x1d')](handleError(_0x5a702e,null));}else{return _0x5a702e['status'](0x1f4)[_0x791a('0xb')]({'message':_0x791a('0x1e')});}};exports['update']=function(_0xdfa84f,_0x1785f5){if(_0xdfa84f[_0x791a('0x14')]['id']){delete _0xdfa84f['body']['id'];}var _0x29194d={'online':_0x791a('0x1f'),'stopped':_0x791a('0x20')};if(_0x29194d[_0x791a('0x21')](_0xdfa84f[_0x791a('0x14')][_0x791a('0x6')])){return pm2[_0x29194d[_0xdfa84f[_0x791a('0x14')][_0x791a('0x6')]]](_0xdfa84f['params']['id'])[_0x791a('0x10')](respondWithResult(_0x1785f5,0xc8))[_0x791a('0x1d')](handleError(_0x1785f5,null));}else{return _0x1785f5[_0x791a('0x6')](0x1f4)['send']({'message':_0x791a('0x22')});}};exports['destroy']=function(_0xc59f5e,_0x2e4ec8){if(_0xc59f5e[_0x791a('0x14')]['id']){delete _0xc59f5e[_0x791a('0x14')]['id'];}if(_0xc59f5e[_0x791a('0x23')]['id']){return pm2[_0x791a('0x24')](_0xc59f5e[_0x791a('0x23')]['id'])['then'](function(_0x3662c6){pm2[_0x791a('0x1c')]();return _0x3662c6[0x0];})[_0x791a('0x10')](respondWithResult(_0x2e4ec8,null))[_0x791a('0x1d')](handleError(_0x2e4ec8,null));}else{return _0x2e4ec8[_0x791a('0x6')](0x1f4)['send']({'message':_0x791a('0x25')});}}; \ 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(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5ff3,0x17d));var _0x35ff=function(_0x8df24d,_0x16daa5){_0x8df24d=_0x8df24d-0x0;var _0x114c35=_0x5ff3[_0x8df24d];return _0x114c35;};'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 260910c..6e481e6 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 _0x9c10=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getQueues','express','Router'];(function(_0x628091,_0x592bc8){var _0xcbe30a=function(_0xec612f){while(--_0xec612f){_0x628091['push'](_0x628091['shift']());}};_0xcbe30a(++_0x592bc8);}(_0x9c10,0x9e));var _0x09c1=function(_0x54ac7a,_0x313ae3){_0x54ac7a=_0x54ac7a-0x0;var _0x5a438e=_0x9c10[_0x54ac7a];return _0x5a438e;};'use strict';var express=require(_0x09c1('0x0'));var router=express[_0x09c1('0x1')]();var auth=require(_0x09c1('0x2'));var controller=require(_0x09c1('0x3'));router[_0x09c1('0x4')](_0x09c1('0x5'),auth[_0x09c1('0x6')](),controller['getAgents']);router[_0x09c1('0x4')]('/queues',auth[_0x09c1('0x6')](),controller[_0x09c1('0x7')]);module['exports']=router; \ No newline at end of file +var _0x8180=['/agents','isAuthenticated','getAgents','get','exports','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8180,0x115));var _0x0818=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x8180[_0x51020b];return _0x371e47;};'use strict';var express=require(_0x0818('0x0'));var router=express[_0x0818('0x1')]();var auth=require(_0x0818('0x2'));var controller=require('./realtime.controller');router['get'](_0x0818('0x3'),auth[_0x0818('0x4')](),controller[_0x0818('0x5')]);router[_0x0818('0x6')]('/queues',auth['isAuthenticated'](),controller['getQueues']);module[_0x0818('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 3deecac..090bc59 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 _0xbf12=['loggedIn','available','waiting','paused','voice','outbound','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','find','merge','pick','queue','length','busy','some','internal','toString','talking','getMembers','UserId','accountcode','online','voiceStatus','push','User','Queue','Pause','findAll','QueueId','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','pause','resolve','channel','sort','validateSortParameter','fields','join','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','role','agent','getOptions','raw','sequelize','literal','FIELD(id,','order','*pause','forEach','where','user','Agents','extraQueryConditions','UserProfile','findAndCountAll','filterAgentAttributes','getAgentStatus','globalStatus','Status','getQueues','rawAttributes','type','key','QueueCampaigns','getRealtimeAgents','util','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','api','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','send','request','startCase','Queues','then','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels'];(function(_0x2c825a,_0x5761d8){var _0x25f2c2=function(_0x433b8c){while(--_0x433b8c){_0x2c825a['push'](_0x2c825a['shift']());}};_0x25f2c2(++_0x5761d8);}(_0xbf12,0x1d2));var _0x2bf1=function(_0x462f5c,_0xd41889){_0x462f5c=_0x462f5c-0x0;var _0x52df33=_0xbf12[_0x462f5c];return _0x52df33;};'use strict';var util=require(_0x2bf1('0x0'));var _=require(_0x2bf1('0x1'));var jayson=require(_0x2bf1('0x2'));var rta=require(_0x2bf1('0x3'));var qs=require(_0x2bf1('0x4'));var utils=require(_0x2bf1('0x5'));var logger=require(_0x2bf1('0x6'))(_0x2bf1('0x7'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client'][_0x2bf1('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x31e568,_0x552681){return function(_0x1c4aff){if(_0x1c4aff){var _0x21a4b3=typeof _0x552681[_0x2bf1('0x9')]===_0x2bf1('0xa')&&typeof _0x552681[_0x2bf1('0xb')]===_0x2bf1('0xa');var _0x4061fa=_0x1c4aff[_0x2bf1('0xc')];var _0x17cb58=_0x21a4b3?0x0:_0x552681[_0x2bf1('0x9')];var _0x53e387=_0x21a4b3?_0x1c4aff['count']:_0x552681['offset']+_0x552681['limit'];var _0x47cec2;if(_0x53e387>=_0x4061fa){_0x53e387=_0x4061fa;_0x47cec2=0xc8;}else{_0x47cec2=0xce;}_0x31e568[_0x2bf1('0xd')](_0x47cec2);return _0x31e568[_0x2bf1('0xe')](_0x2bf1('0xf'),_0x17cb58+'-'+_0x53e387+'/'+_0x4061fa)[_0x2bf1('0x10')](_0x1c4aff);}return null;};}function handleError(_0x516732,_0x516122){_0x516122=_0x516122||0x1f4;return function(_0x429e42){logger[_0x2bf1('0x11')](_0x429e42[_0x2bf1('0x12')]);if(_0x429e42[_0x2bf1('0x13')]){delete _0x429e42[_0x2bf1('0x13')];}_0x516732[_0x2bf1('0xd')](_0x516122)[_0x2bf1('0x14')](_0x429e42);};}function getRealtimeQueues(_0x1072d1,_0x1d2787){return new Promise(function(_0x145ca1,_0x44b54c){var _0x50ebc6=_0x1d2787==='voice'?amiClient:routingClient;return _0x50ebc6[_0x2bf1('0x15')](_[_0x2bf1('0x16')](_0x1d2787)+_0x2bf1('0x17'),_0x1072d1)[_0x2bf1('0x18')](function(_0x58cde7){if(_0x58cde7[_0x2bf1('0x11')])throw new Error(util['format'](_0x2bf1('0x19'),_0x1d2787));return _0x145ca1(_0x58cde7[_0x2bf1('0x1a')]);})[_0x2bf1('0x1b')](function(_0x4cfd26){_0x44b54c(_0x4cfd26);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x410b1e,_0x5e7102){return amiClient[_0x2bf1('0x15')](_0x2bf1('0x1c'),{})[_0x2bf1('0x18')](function(_0x59bc2){if(_0x59bc2['error'])throw new Error(_0x2bf1('0x1d'));return _0x410b1e(_0x59bc2['result']);})[_0x2bf1('0x1b')](function(_0x46899f){_0x5e7102(_0x46899f);});});}function initializeQueues(_0x3cd0e2,_0x373be3,_0x55e081,_0x1ae073){var _0x523ea0=[_0x2bf1('0x1e'),_0x2bf1('0x1f'),_0x2bf1('0x20'),'talking',_0x2bf1('0x21')];if(_0x55e081===_0x2bf1('0x22')&&_0x1ae073===_0x2bf1('0x23')){_0x523ea0['push'](_0x2bf1('0x24'),_0x2bf1('0x25'),_0x2bf1('0x26'),_0x2bf1('0x27'),_0x2bf1('0x28'),_0x2bf1('0x29'),_0x2bf1('0x2a'),_0x2bf1('0x2b'),_0x2bf1('0x2c'),_0x2bf1('0x2d'),_0x2bf1('0x2e'),_0x2bf1('0x2f'),_0x2bf1('0x30'),'dialPredictiveIntervalMaxThreshold',_0x2bf1('0x31'),_0x2bf1('0x32'),_0x2bf1('0x33'),_0x2bf1('0x34'),_0x2bf1('0x35'),'predictiveIntervalDroppedCallsCallersExit',_0x2bf1('0x36'),_0x2bf1('0x37'));}return _0x3cd0e2[_0x2bf1('0x38')](function(_0x5da1ff){var _0x11c8e7=_0x5da1ff[_0x2bf1('0x39')]({'plain':!![]});_0x11c8e7[_0x2bf1('0x3a')]=[];_0x11c8e7[_0x2bf1('0x21')]=0x0;_0x11c8e7[_0x2bf1('0x3b')]=0x0;_0x11c8e7[_0x2bf1('0x1e')]=0x0;_0x11c8e7[_0x2bf1('0x1f')]=0x0;_0x11c8e7['waiting']=0x0;if(_0x55e081==='voice'){_0x11c8e7['talking']=0x0;_0x11c8e7['busy']=0x0;if(_0x1ae073===_0x2bf1('0x23')){_0x11c8e7['pTalking']=0x0;_0x11c8e7['originated']=0x0;}}var _0x58ba58=_[_0x2bf1('0x3c')](_0x373be3,['id',_0x11c8e7['id']]);if(_0x58ba58)_[_0x2bf1('0x3d')](_0x11c8e7,_[_0x2bf1('0x3e')](_0x58ba58,_0x523ea0));return _0x11c8e7;});}function updateAgentVoiceStatus(_0x539966,_0xf7dc8b,_0x522245){var _0x43f125=_['filter'](_0x522245,[_0x2bf1('0x3f'),_0xf7dc8b[_0x2bf1('0x13')]]);if(_0x43f125[_0x2bf1('0x40')]===0x0)return _0x539966[_0x2bf1('0x41')]=!![];if(_[_0x2bf1('0x42')](_0x43f125,['connectedlinenum',_0x539966[_0x2bf1('0x43')][_0x2bf1('0x44')]()]))return _0x539966[_0x2bf1('0x45')]=!![];if(!_0x539966[_0x2bf1('0x45')])return _0x539966[_0x2bf1('0x41')]=!![];}function getVoiceQueueAgents(_0x2c2199,_0x57d362,_0x39038f,_0x3676b6){var _0x15b89e=_[_0x2bf1('0x3c')](_0x57d362,['id',_0x2c2199['id']]);if(!_0x15b89e)return _0x2c2199;return _0x15b89e[_0x2bf1('0x46')]({'raw':!![]})['then'](function(_0x5f090b){for(var _0x4767f2=0x0;_0x4767f2<_0x5f090b[_0x2bf1('0x40')];_0x4767f2++){var _0x438bc3=_['find'](_0x39038f,['id',_0x5f090b[_0x4767f2]['UserId']]);if(!_0x438bc3){_0x438bc3={'id':_0x5f090b[_0x4767f2][_0x2bf1('0x47')],'name':_0x5f090b[_0x4767f2][_0x2bf1('0x47')],'accountcode':'','online':![]};}var _0x890742={'id':_0x438bc3['id'],'name':_0x438bc3[_0x2bf1('0x13')],'internal':_0x438bc3[_0x2bf1('0x48')],'online':Boolean(_0x438bc3[_0x2bf1('0x49')]),'paused':Boolean(_0x5f090b[_0x4767f2]['paused'])};if(_0x438bc3[_0x2bf1('0x4a')]===_0x2bf1('0x45'))updateAgentVoiceStatus(_0x890742,_0x2c2199,_0x3676b6);if(_0x890742[_0x2bf1('0x49')])_0x2c2199[_0x2bf1('0x3b')]++;if(_0x890742[_0x2bf1('0x41')])_0x2c2199['busy']++;if(_0x890742['paused']&&!_0x890742[_0x2bf1('0x41')]&&!_0x890742[_0x2bf1('0x45')])_0x2c2199[_0x2bf1('0x21')]++;_0x2c2199[_0x2bf1('0x3a')][_0x2bf1('0x4b')](_0x890742);}return _0x2c2199;});}function getQueueAgents(_0xc4c169,_0x2a12ce,_0xe14c7f){var _0x21e292=_0x2bf1('0x4c')+_['startCase'](_0xe14c7f)+_0x2bf1('0x4d');var _0x5a55bf=_0xe14c7f+_0x2bf1('0x4e');return db[_0x21e292][_0x2bf1('0x4f')]({'where':{[_[_0x2bf1('0x16')](_0xe14c7f)+_0x2bf1('0x50')]:_0xc4c169['id']},'raw':!![]})['then'](function(_0x1e6553){for(var _0x330929=0x0;_0x330929<_0x1e6553[_0x2bf1('0x40')];_0x330929++){var _0x53ada3=_[_0x2bf1('0x3c')](_0x2a12ce,['id',_0x1e6553[_0x330929][_0x2bf1('0x47')]]);if(!_0x53ada3){_0x53ada3={'id':_0x1e6553[_0x330929][_0x2bf1('0x47')],'name':_0x1e6553[_0x330929][_0x2bf1('0x47')],'online':![],['pauseField']:![]};}var _0x3fc321={'id':_0x53ada3['id'],'name':_0x53ada3[_0x2bf1('0x13')],'online':Boolean(_0x53ada3[_0x2bf1('0x49')]),'paused':Boolean(_0x53ada3[_0x5a55bf])};if(_0x3fc321[_0x2bf1('0x49')])_0xc4c169[_0x2bf1('0x3b')]++;_0xc4c169['agents'][_0x2bf1('0x4b')](_0x3fc321);}return _0xc4c169;});}function validateChannel(_0x55b4e8){var _0x37d2a0=utils[_0x2bf1('0x51')]();if(!_[_0x2bf1('0x52')](_0x37d2a0,_0x55b4e8[_0x2bf1('0x53')]()))throw new Error(_0x2bf1('0x54'));return _0x55b4e8[_0x2bf1('0x53')]();}exports[_0x2bf1('0x55')]=function(_0x3e8ada,_0x1bb3b6){var _0x483358={'count':0x0,'rows':[]};var _0x3647f0={};var _0xca6758;var _0x3e896c;var _0x2a8a83;var _0x597169;var _0x585240=utils['getChannels']();var _0x396331=_0x3e8ada[_0x2bf1('0x56')][_0x2bf1('0x57')];var _0x26917e=_0x3e8ada['query']['globalStatusFilter'];var _0x4c63b1=_0x3e8ada[_0x2bf1('0x56')]['pauseTypeFilter'];var _0x56de45=_0x26917e===_0x2bf1('0x58')||_0x26917e==='*pause'?!![]:![];var _0xc55695=[];var _0x2ccb8c;Promise[_0x2bf1('0x59')]()['then'](function(){if(_0x3e8ada[_0x2bf1('0x56')][_0x2bf1('0x5a')]){_0xca6758=validateChannel(_0x3e8ada['query'][_0x2bf1('0x5a')]);}if(!_0x3e8ada['query'][_0x2bf1('0x5b')]||!_0x3e8ada[_0x2bf1('0x56')][_0x2bf1('0x5b')][_0x2bf1('0x52')]('globalStatus')){_0x3e8ada[_0x2bf1('0x56')][_0x2bf1('0x5b')]=rta[_0x2bf1('0x5c')](_0x3e8ada[_0x2bf1('0x56')]['sort']);return;}var _0x39023b=rta['getUpdatedSortOptions'](_0x3e8ada['query'][_0x2bf1('0x5b')]);_0x3e8ada[_0x2bf1('0x56')]['sort']=_0x39023b[_0x2bf1('0x5d')][_0x2bf1('0x5e')](',');_0x3e896c=_0x39023b['order'];})['then'](function(){if(!_0x396331){return[];}return rta[_0x2bf1('0x5f')](_0x396331,_0xca6758);})['then'](function(_0x4b984c){_0xc55695=_0x4b984c;return rta['getRealtimeAgents']();})['then'](function(_0x2f8437){_0x597169=_0x2f8437[_0x2bf1('0x60')];if((!_0x26917e||_0x56de45)&&!_0x3e896c){return _0xc55695;}if(_0x3e896c&&!_0x26917e){return rta[_0x2bf1('0x61')](_0x597169,_0xc55695,_0x3e896c);}else{return rta['getAgentIdsByStatus'](_0x597169,_0xc55695,_0x26917e);}})[_0x2bf1('0x18')](function(_0x199adb){_0xc55695=_0x199adb;var _0x3d4746=![];if(_0xc55695['length']===0x0){if(_0x396331||_0x26917e){_0x3d4746=!![];}if(_0x56de45){_0x3d4746=![];}}if(_0x3d4746){return _0x483358;}var _0x5e3762=_['map'](db['User']['rawAttributes'],function(_0x20085f){return{'name':_0x20085f['fieldName'],'type':_0x20085f['type']['key']};});_0x3e8ada[_0x2bf1('0x56')][_0x2bf1('0x62')]=_0x2bf1('0x63');_0x3e8ada[_0x2bf1('0x56')][_0x2bf1('0x49')]=!![];_0x3647f0=qs[_0x2bf1('0x64')](_0x5e3762,_0x3e8ada);_0x3647f0[_0x2bf1('0x65')]=!![];var _0x133d25=[];if(_0xc55695[_0x2bf1('0x40')]>0x0){_0x133d25[_0x2bf1('0x4b')]({'id':{'$in':_0xc55695}});if(_0x3e896c&&!_0x26917e){_0x2ccb8c=[db[_0x2bf1('0x66')][_0x2bf1('0x67')](_0x2bf1('0x68')+_0xc55695+')')];_0x3647f0[_0x2bf1('0x69')]=_0x2ccb8c;}}if(_0x56de45){_0x585240['forEach'](function(_0x1bf51d){var _0x3604b7=!![];if(_0x26917e===_0x2bf1('0x6a')&&_0xca6758!==_0x1bf51d){_0x3604b7=![];}_0x133d25['push']({[_0x1bf51d+_0x2bf1('0x4e')]:_0x3604b7});});if(_0x4c63b1){_0x133d25[_0x2bf1('0x4b')]({'pauseType':_0x4c63b1});}}else if(_0x26917e){_0x585240[_0x2bf1('0x6b')](function(_0x5b5d82){_0x133d25[_0x2bf1('0x4b')]({[_0x5b5d82+_0x2bf1('0x4e')]:![]});});}_0x3647f0[_0x2bf1('0x6c')]=_[_0x2bf1('0x3d')](_0x3647f0['where'],{'$and':_0x133d25});if(_0x3e8ada[_0x2bf1('0x6d')][_0x2bf1('0x62')]===_0x2bf1('0x6d')){var _0x18cf77={'params':{'id':_0x3e8ada[_0x2bf1('0x6d')]['userProfileId']},'query':{'section':_0x2bf1('0x6e'),'role':'agent','online':!![],'raw':!![],'ids':_0xc55695,'customSorting':_0x2ccb8c}};if(_0x56de45){_0x18cf77[_0x2bf1('0x56')][_0x2bf1('0x6f')]=_0x133d25;}_0x18cf77[_0x2bf1('0x56')]=Object['assign'](_0x18cf77[_0x2bf1('0x56')],_0x3e8ada['query']);delete _0x18cf77[_0x2bf1('0x56')]['id'];return db[_0x2bf1('0x70')]['getResources'](_0x18cf77);}return db[_0x2bf1('0x4c')][_0x2bf1('0x71')](_0x3647f0);})[_0x2bf1('0x18')](function(_0x32669a){_0x483358['count']=_0x32669a['count'];_0x2a8a83=_0x32669a[_0x2bf1('0x60')];return _0x2a8a83[_0x2bf1('0x38')](function(_0x829461){var _0x3aa4b1=_[_0x2bf1('0x3c')](_0x597169,['id',_0x829461['id']]);if(_0x3aa4b1){var _0x9c9187=rta[_0x2bf1('0x72')](_0x3aa4b1);_[_0x2bf1('0x3d')](_0x829461,_0x9c9187);}_0x829461['globalStatus']=rta[_0x2bf1('0x73')](_0x829461);if(_0x829461[_0x2bf1('0x74')][_0x2bf1('0x52')]('pause')){_0x585240[_0x2bf1('0x6b')](function(_0x3bbada){if(_0x829461[_0x3bbada+'Pause']){_0x829461[_0x3bbada+_0x2bf1('0x75')]=_0x2bf1('0x58');}});}return _0x829461;});})[_0x2bf1('0x18')](function(_0x75fd11){if(!_0x3e896c||_0x2ccb8c){return _0x75fd11;}return rta['sortAgentsByStatus'](_0x75fd11,_0x3e896c);})[_0x2bf1('0x18')](function(_0x2e59fd){_0x483358[_0x2bf1('0x60')]=_0x2e59fd;return _0x483358;})[_0x2bf1('0x18')](respondWithFilteredResult(_0x1bb3b6,_0x3647f0))[_0x2bf1('0x1b')](handleError(_0x1bb3b6,null));};exports[_0x2bf1('0x76')]=function(_0x525c18,_0x593bed){var _0x293f45={'count':0x0,'rows':[]},_0x2b2f2a={},_0x445a74,_0x44e167,_0x1b1950,_0x2adcc4,_0x58c325;Promise[_0x2bf1('0x59')]()[_0x2bf1('0x18')](function(){if(_0x525c18['query'][_0x2bf1('0x5a')])_0x445a74=validateChannel(_0x525c18[_0x2bf1('0x56')][_0x2bf1('0x5a')]);var _0x1e5a51=_[_0x2bf1('0x16')](_0x445a74)+_0x2bf1('0x4d');var _0x1ef14b=_['map'](db[_0x1e5a51][_0x2bf1('0x77')],function(_0x135f18){return{'name':_0x135f18['fieldName'],'type':_0x135f18[_0x2bf1('0x78')][_0x2bf1('0x79')]};});_0x2b2f2a=qs[_0x2bf1('0x64')](_0x1ef14b,_0x525c18);if(_0x525c18[_0x2bf1('0x6d')][_0x2bf1('0x62')]===_0x2bf1('0x6d')){var _0x3a4ed7={'params':{'id':_0x525c18['user']['userProfileId']},'query':{'section':_0x445a74===_0x2bf1('0x22')&&_0x525c18['query'][_0x2bf1('0x78')]===_0x2bf1('0x23')?_0x2bf1('0x7a'):_[_0x2bf1('0x16')](_0x445a74)+_0x2bf1('0x17'),'type':_0x525c18[_0x2bf1('0x56')][_0x2bf1('0x78')],'nolimit':!![],'sort':_0x2bf1('0x13'),'filter':_0x525c18[_0x2bf1('0x56')]['filter']}};return db[_0x2bf1('0x70')]['getResources'](_0x3a4ed7);}return db[_0x1e5a51][_0x2bf1('0x71')](_0x2b2f2a);})[_0x2bf1('0x18')](function(_0xad66d){_0x293f45[_0x2bf1('0xc')]=_0xad66d[_0x2bf1('0xc')];_0x44e167=_0xad66d[_0x2bf1('0x60')];return getRealtimeQueues(_0x525c18,_0x445a74);})[_0x2bf1('0x18')](function(_0x467fdd){_0x2adcc4=_0x467fdd[_0x2bf1('0x60')];return rta[_0x2bf1('0x7b')]();})[_0x2bf1('0x18')](function(_0x35ddb4){_0x1b1950=_0x35ddb4['rows'];if(_0x445a74!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x389090){_0x58c325=_0x389090?_0x389090[_0x2bf1('0x60')]:[];return initializeQueues(_0x44e167,_0x2adcc4,_0x445a74,_0x525c18[_0x2bf1('0x56')]['type']);})['then'](function(_0x2d21e0){var _0x872ca4=_0x2d21e0[_0x2bf1('0x38')](function(_0x5e099f){if(_0x445a74==='voice')return getVoiceQueueAgents(_0x5e099f,_0x44e167,_0x1b1950,_0x58c325);else return getQueueAgents(_0x5e099f,_0x1b1950,_0x445a74);});return Promise['all'](_0x872ca4);})[_0x2bf1('0x18')](function(_0x1f7490){_0x293f45[_0x2bf1('0x60')]=_0x1f7490;return _0x293f45;})[_0x2bf1('0x18')](respondWithFilteredResult(_0x593bed,_0x2b2f2a))[_0x2bf1('0x1b')](handleError(_0x593bed,null));}; \ No newline at end of file +var _0x2dd5=['map','getAgentStatus','getQueues','all','util','lodash','../../components/parsers/qs','../../config/utils','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','offset','set','Content-Range','stack','name','status','send','voice','request','startCase','Queues','then','error','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','paused','outbound','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','loggedInDb','available','talking','originated','find','merge','pick','filter','queue','length','busy','connectedlinenum','toString','getMembers','UserId','accountcode','online','agents','push','User','Queue','Pause','findAll','QueueId','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','globalQueueFilter','globalStatusFilter','query','pauseTypeFilter','pause','*pause','resolve','channel','sort','globalStatus','validateSortParameter','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','fieldName','type','key','role','agent','getOptions','sequelize','literal','FIELD(id,','order','forEach','where','user','userProfileId','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll'];(function(_0x9e752,_0x64d8ff){var _0x5cba5b=function(_0x3151b3){while(--_0x3151b3){_0x9e752['push'](_0x9e752['shift']());}};_0x5cba5b(++_0x64d8ff);}(_0x2dd5,0xf0));var _0x52dd=function(_0x6aa0fa,_0x2dfae7){_0x6aa0fa=_0x6aa0fa-0x0;var _0xae97bf=_0x2dd5[_0x6aa0fa];return _0xae97bf;};'use strict';var util=require(_0x52dd('0x0'));var _=require(_0x52dd('0x1'));var jayson=require('jayson/promise');var rta=require('../../components/realtime/agents');var qs=require(_0x52dd('0x2'));var utils=require(_0x52dd('0x3'));var logger=require(_0x52dd('0x4'))(_0x52dd('0x5'));var db=require(_0x52dd('0x6'))['db'];var amiClient=jayson[_0x52dd('0x7')][_0x52dd('0x8')]({'port':0x232a});var routingClient=jayson[_0x52dd('0x7')][_0x52dd('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x49715a,_0x9357f1){return function(_0x2b54c2){if(_0x2b54c2){var _0x3a63fa=typeof _0x9357f1['offset']===_0x52dd('0x9')&&typeof _0x9357f1[_0x52dd('0xa')]===_0x52dd('0x9');var _0x356abc=_0x2b54c2['count'];var _0x1002b5=_0x3a63fa?0x0:_0x9357f1['offset'];var _0x5db266=_0x3a63fa?_0x2b54c2[_0x52dd('0xb')]:_0x9357f1[_0x52dd('0xc')]+_0x9357f1[_0x52dd('0xa')];var _0x329935;if(_0x5db266>=_0x356abc){_0x5db266=_0x356abc;_0x329935=0xc8;}else{_0x329935=0xce;}_0x49715a['status'](_0x329935);return _0x49715a[_0x52dd('0xd')](_0x52dd('0xe'),_0x1002b5+'-'+_0x5db266+'/'+_0x356abc)['json'](_0x2b54c2);}return null;};}function handleError(_0xd3caea,_0x46117e){_0x46117e=_0x46117e||0x1f4;return function(_0x5b9703){logger['error'](_0x5b9703[_0x52dd('0xf')]);if(_0x5b9703[_0x52dd('0x10')]){delete _0x5b9703[_0x52dd('0x10')];}_0xd3caea[_0x52dd('0x11')](_0x46117e)[_0x52dd('0x12')](_0x5b9703);};}function getRealtimeQueues(_0x98b987,_0x286516){return new Promise(function(_0x4fe94e,_0x54c4d9){var _0x1adb8d=_0x286516===_0x52dd('0x13')?amiClient:routingClient;return _0x1adb8d[_0x52dd('0x14')](_[_0x52dd('0x15')](_0x286516)+_0x52dd('0x16'),_0x98b987)[_0x52dd('0x17')](function(_0x530fcb){if(_0x530fcb[_0x52dd('0x18')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x286516));return _0x4fe94e(_0x530fcb[_0x52dd('0x19')]);})[_0x52dd('0x1a')](function(_0x3bbe99){_0x54c4d9(_0x3bbe99);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1b13c1,_0x3f2dc7){return amiClient[_0x52dd('0x14')](_0x52dd('0x1b'),{})[_0x52dd('0x17')](function(_0x19fce7){if(_0x19fce7[_0x52dd('0x18')])throw new Error(_0x52dd('0x1c'));return _0x1b13c1(_0x19fce7[_0x52dd('0x19')]);})[_0x52dd('0x1a')](function(_0xd8d1d){_0x3f2dc7(_0xd8d1d);});});}function initializeQueues(_0x568614,_0x26c4e0,_0x28024c,_0x35a0b1){var _0x203411=[_0x52dd('0x1d'),'available','waiting','talking',_0x52dd('0x1e')];if(_0x28024c==='voice'&&_0x35a0b1===_0x52dd('0x1f')){_0x203411['push'](_0x52dd('0x20'),'originated',_0x52dd('0x21'),_0x52dd('0x22'),_0x52dd('0x23'),_0x52dd('0x24'),_0x52dd('0x25'),_0x52dd('0x26'),_0x52dd('0x27'),'erlangCallToSecond',_0x52dd('0x28'),'erlangBusyFactor',_0x52dd('0x29'),_0x52dd('0x2a'),_0x52dd('0x2b'),_0x52dd('0x2c'),_0x52dd('0x2d'),_0x52dd('0x2e'),_0x52dd('0x2f'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x52dd('0x30'));}return _0x568614['map'](function(_0x2364fb){var _0x43392f=_0x2364fb['get']({'plain':!![]});_0x43392f['agents']=[];_0x43392f['paused']=0x0;_0x43392f[_0x52dd('0x31')]=0x0;_0x43392f[_0x52dd('0x1d')]=0x0;_0x43392f[_0x52dd('0x32')]=0x0;_0x43392f['waiting']=0x0;if(_0x28024c===_0x52dd('0x13')){_0x43392f[_0x52dd('0x33')]=0x0;_0x43392f['busy']=0x0;if(_0x35a0b1==='outbound'){_0x43392f[_0x52dd('0x20')]=0x0;_0x43392f[_0x52dd('0x34')]=0x0;}}var _0x18a764=_[_0x52dd('0x35')](_0x26c4e0,['id',_0x43392f['id']]);if(_0x18a764)_[_0x52dd('0x36')](_0x43392f,_[_0x52dd('0x37')](_0x18a764,_0x203411));return _0x43392f;});}function updateAgentVoiceStatus(_0x2cb8c8,_0x36c77f,_0x401c94){var _0x53f759=_[_0x52dd('0x38')](_0x401c94,[_0x52dd('0x39'),_0x36c77f[_0x52dd('0x10')]]);if(_0x53f759[_0x52dd('0x3a')]===0x0)return _0x2cb8c8[_0x52dd('0x3b')]=!![];if(_['some'](_0x53f759,[_0x52dd('0x3c'),_0x2cb8c8['internal'][_0x52dd('0x3d')]()]))return _0x2cb8c8['talking']=!![];if(!_0x2cb8c8[_0x52dd('0x33')])return _0x2cb8c8[_0x52dd('0x3b')]=!![];}function getVoiceQueueAgents(_0x857f93,_0x20d50b,_0x411678,_0x40365b){var _0x434c45=_[_0x52dd('0x35')](_0x20d50b,['id',_0x857f93['id']]);if(!_0x434c45)return _0x857f93;return _0x434c45[_0x52dd('0x3e')]({'raw':!![]})[_0x52dd('0x17')](function(_0x3a912c){for(var _0xe9d022=0x0;_0xe9d022<_0x3a912c[_0x52dd('0x3a')];_0xe9d022++){var _0x49ef97=_['find'](_0x411678,['id',_0x3a912c[_0xe9d022]['UserId']]);if(!_0x49ef97){_0x49ef97={'id':_0x3a912c[_0xe9d022][_0x52dd('0x3f')],'name':_0x3a912c[_0xe9d022][_0x52dd('0x3f')],'accountcode':'','online':![]};}var _0x208ce8={'id':_0x49ef97['id'],'name':_0x49ef97[_0x52dd('0x10')],'internal':_0x49ef97[_0x52dd('0x40')],'online':Boolean(_0x49ef97[_0x52dd('0x41')]),'paused':Boolean(_0x3a912c[_0xe9d022][_0x52dd('0x1e')])};if(_0x49ef97['voiceStatus']==='talking')updateAgentVoiceStatus(_0x208ce8,_0x857f93,_0x40365b);if(_0x208ce8[_0x52dd('0x41')])_0x857f93['loggedInDb']++;if(_0x208ce8[_0x52dd('0x3b')])_0x857f93[_0x52dd('0x3b')]++;if(_0x208ce8[_0x52dd('0x1e')]&&!_0x208ce8[_0x52dd('0x3b')]&&!_0x208ce8[_0x52dd('0x33')])_0x857f93[_0x52dd('0x1e')]++;_0x857f93[_0x52dd('0x42')][_0x52dd('0x43')](_0x208ce8);}return _0x857f93;});}function getQueueAgents(_0x5ea1c0,_0x2b7ec2,_0x23a619){var _0x412f94=_0x52dd('0x44')+_['startCase'](_0x23a619)+_0x52dd('0x45');var _0x17f9f4=_0x23a619+_0x52dd('0x46');return db[_0x412f94][_0x52dd('0x47')]({'where':{[_[_0x52dd('0x15')](_0x23a619)+_0x52dd('0x48')]:_0x5ea1c0['id']},'raw':!![]})['then'](function(_0x5869e3){for(var _0x413fd1=0x0;_0x413fd1<_0x5869e3[_0x52dd('0x3a')];_0x413fd1++){var _0x2b6baf=_[_0x52dd('0x35')](_0x2b7ec2,['id',_0x5869e3[_0x413fd1][_0x52dd('0x3f')]]);if(!_0x2b6baf){_0x2b6baf={'id':_0x5869e3[_0x413fd1]['UserId'],'name':_0x5869e3[_0x413fd1][_0x52dd('0x3f')],'online':![],['pauseField']:![]};}var _0xfaa12c={'id':_0x2b6baf['id'],'name':_0x2b6baf[_0x52dd('0x10')],'online':Boolean(_0x2b6baf['online']),'paused':Boolean(_0x2b6baf[_0x17f9f4])};if(_0xfaa12c[_0x52dd('0x41')])_0x5ea1c0[_0x52dd('0x31')]++;_0x5ea1c0['agents'][_0x52dd('0x43')](_0xfaa12c);}return _0x5ea1c0;});}function validateChannel(_0x245ca2){var _0x26f901=utils[_0x52dd('0x49')]();if(!_[_0x52dd('0x4a')](_0x26f901,_0x245ca2[_0x52dd('0x4b')]()))throw new Error(_0x52dd('0x4c'));return _0x245ca2['toLowerCase']();}exports[_0x52dd('0x4d')]=function(_0x10207b,_0x586e3d){var _0xbf7a93={'count':0x0,'rows':[]};var _0xde2915={};var _0x2bf74b;var _0x2d06c7;var _0x17c3b1;var _0x5c2f1e;var _0x321f70=utils[_0x52dd('0x49')]();var _0x19345e=_0x10207b['query'][_0x52dd('0x4e')];var _0x7cd856=_0x10207b['query'][_0x52dd('0x4f')];var _0x4fadd6=_0x10207b[_0x52dd('0x50')][_0x52dd('0x51')];var _0x32695b=_0x7cd856===_0x52dd('0x52')||_0x7cd856===_0x52dd('0x53')?!![]:![];var _0x4831bf=[];var _0x44ddcc;Promise[_0x52dd('0x54')]()[_0x52dd('0x17')](function(){if(_0x10207b[_0x52dd('0x50')][_0x52dd('0x55')]){_0x2bf74b=validateChannel(_0x10207b['query']['channel']);}if(!_0x10207b[_0x52dd('0x50')][_0x52dd('0x56')]||!_0x10207b[_0x52dd('0x50')][_0x52dd('0x56')][_0x52dd('0x4a')](_0x52dd('0x57'))){_0x10207b[_0x52dd('0x50')]['sort']=rta[_0x52dd('0x58')](_0x10207b[_0x52dd('0x50')]['sort']);return;}var _0x5da22a=rta['getUpdatedSortOptions'](_0x10207b[_0x52dd('0x50')][_0x52dd('0x56')]);_0x10207b[_0x52dd('0x50')][_0x52dd('0x56')]=_0x5da22a['fields']['join'](',');_0x2d06c7=_0x5da22a['order'];})[_0x52dd('0x17')](function(){if(!_0x19345e){return[];}return rta[_0x52dd('0x59')](_0x19345e,_0x2bf74b);})[_0x52dd('0x17')](function(_0x2b7f79){_0x4831bf=_0x2b7f79;return rta[_0x52dd('0x5a')]();})[_0x52dd('0x17')](function(_0x493313){_0x5c2f1e=_0x493313[_0x52dd('0x5b')];if((!_0x7cd856||_0x32695b)&&!_0x2d06c7){return _0x4831bf;}if(_0x2d06c7&&!_0x7cd856){return rta[_0x52dd('0x5c')](_0x5c2f1e,_0x4831bf,_0x2d06c7);}else{return rta[_0x52dd('0x5d')](_0x5c2f1e,_0x4831bf,_0x7cd856);}})['then'](function(_0x245d76){_0x4831bf=_0x245d76;var _0x17dc81=![];if(_0x4831bf[_0x52dd('0x3a')]===0x0){if(_0x19345e||_0x7cd856){_0x17dc81=!![];}if(_0x32695b){_0x17dc81=![];}}if(_0x17dc81){return _0xbf7a93;}var _0x4168f0=_['map'](db[_0x52dd('0x44')][_0x52dd('0x5e')],function(_0x32b777){return{'name':_0x32b777[_0x52dd('0x5f')],'type':_0x32b777[_0x52dd('0x60')][_0x52dd('0x61')]};});_0x10207b[_0x52dd('0x50')][_0x52dd('0x62')]=_0x52dd('0x63');_0x10207b['query'][_0x52dd('0x41')]=!![];_0xde2915=qs[_0x52dd('0x64')](_0x4168f0,_0x10207b);_0xde2915['raw']=!![];var _0x515bbb=[];if(_0x4831bf[_0x52dd('0x3a')]>0x0){_0x515bbb['push']({'id':{'$in':_0x4831bf}});if(_0x2d06c7&&!_0x7cd856){_0x44ddcc=[db[_0x52dd('0x65')][_0x52dd('0x66')](_0x52dd('0x67')+_0x4831bf+')')];_0xde2915[_0x52dd('0x68')]=_0x44ddcc;}}if(_0x32695b){_0x321f70[_0x52dd('0x69')](function(_0x5c34e3){var _0x38f5d6=!![];if(_0x7cd856==='*pause'&&_0x2bf74b!==_0x5c34e3){_0x38f5d6=![];}_0x515bbb['push']({[_0x5c34e3+_0x52dd('0x46')]:_0x38f5d6});});if(_0x4fadd6){_0x515bbb['push']({'pauseType':_0x4fadd6});}}else if(_0x7cd856){_0x321f70[_0x52dd('0x69')](function(_0x487600){_0x515bbb['push']({[_0x487600+'Pause']:![]});});}_0xde2915[_0x52dd('0x6a')]=_[_0x52dd('0x36')](_0xde2915['where'],{'$and':_0x515bbb});if(_0x10207b[_0x52dd('0x6b')][_0x52dd('0x62')]===_0x52dd('0x6b')){var _0x2ff2e4={'params':{'id':_0x10207b[_0x52dd('0x6b')][_0x52dd('0x6c')]},'query':{'section':'Agents','role':'agent','online':!![],'raw':!![],'ids':_0x4831bf,'customSorting':_0x44ddcc}};if(_0x32695b){_0x2ff2e4[_0x52dd('0x50')][_0x52dd('0x6d')]=_0x515bbb;}_0x2ff2e4[_0x52dd('0x50')]=Object[_0x52dd('0x6e')](_0x2ff2e4['query'],_0x10207b['query']);delete _0x2ff2e4[_0x52dd('0x50')]['id'];return db[_0x52dd('0x6f')][_0x52dd('0x70')](_0x2ff2e4);}return db[_0x52dd('0x44')][_0x52dd('0x71')](_0xde2915);})['then'](function(_0x373748){_0xbf7a93[_0x52dd('0xb')]=_0x373748['count'];_0x17c3b1=_0x373748[_0x52dd('0x5b')];return _0x17c3b1[_0x52dd('0x72')](function(_0x2ac420){var _0x51ac3d=_[_0x52dd('0x35')](_0x5c2f1e,['id',_0x2ac420['id']]);if(_0x51ac3d){var _0x3030cf=rta['filterAgentAttributes'](_0x51ac3d);_['merge'](_0x2ac420,_0x3030cf);}_0x2ac420['globalStatus']=rta[_0x52dd('0x73')](_0x2ac420);if(_0x2ac420[_0x52dd('0x57')][_0x52dd('0x4a')]('pause')){_0x321f70[_0x52dd('0x69')](function(_0x373a9d){if(_0x2ac420[_0x373a9d+'Pause']){_0x2ac420[_0x373a9d+'Status']=_0x52dd('0x52');}});}return _0x2ac420;});})[_0x52dd('0x17')](function(_0x2061ba){if(!_0x2d06c7||_0x44ddcc){return _0x2061ba;}return rta['sortAgentsByStatus'](_0x2061ba,_0x2d06c7);})['then'](function(_0x37bea8){_0xbf7a93['rows']=_0x37bea8;return _0xbf7a93;})[_0x52dd('0x17')](respondWithFilteredResult(_0x586e3d,_0xde2915))['catch'](handleError(_0x586e3d,null));};exports[_0x52dd('0x74')]=function(_0x5b7b03,_0xa5a0c5){var _0x77c1ab={'count':0x0,'rows':[]},_0x511043={},_0xf1048a,_0x371cbe,_0x38fb29,_0x28dc3b,_0x6ca56c;Promise['resolve']()[_0x52dd('0x17')](function(){if(_0x5b7b03[_0x52dd('0x50')]['channel'])_0xf1048a=validateChannel(_0x5b7b03[_0x52dd('0x50')]['channel']);var _0x367dd7=_[_0x52dd('0x15')](_0xf1048a)+_0x52dd('0x45');var _0x4e1716=_['map'](db[_0x367dd7][_0x52dd('0x5e')],function(_0x1e3c0){return{'name':_0x1e3c0[_0x52dd('0x5f')],'type':_0x1e3c0[_0x52dd('0x60')][_0x52dd('0x61')]};});_0x511043=qs['getOptions'](_0x4e1716,_0x5b7b03);if(_0x5b7b03[_0x52dd('0x6b')][_0x52dd('0x62')]===_0x52dd('0x6b')){var _0x2344a3={'params':{'id':_0x5b7b03[_0x52dd('0x6b')][_0x52dd('0x6c')]},'query':{'section':_0xf1048a===_0x52dd('0x13')&&_0x5b7b03['query'][_0x52dd('0x60')]===_0x52dd('0x1f')?'QueueCampaigns':_[_0x52dd('0x15')](_0xf1048a)+'Queues','type':_0x5b7b03[_0x52dd('0x50')][_0x52dd('0x60')],'nolimit':!![],'sort':_0x52dd('0x10'),'filter':_0x5b7b03[_0x52dd('0x50')]['filter']}};return db[_0x52dd('0x6f')][_0x52dd('0x70')](_0x2344a3);}return db[_0x367dd7][_0x52dd('0x71')](_0x511043);})[_0x52dd('0x17')](function(_0x2c7320){_0x77c1ab[_0x52dd('0xb')]=_0x2c7320[_0x52dd('0xb')];_0x371cbe=_0x2c7320[_0x52dd('0x5b')];return getRealtimeQueues(_0x5b7b03,_0xf1048a);})[_0x52dd('0x17')](function(_0x45994d){_0x28dc3b=_0x45994d[_0x52dd('0x5b')];return rta[_0x52dd('0x5a')]();})[_0x52dd('0x17')](function(_0x2971c2){_0x38fb29=_0x2971c2[_0x52dd('0x5b')];if(_0xf1048a!=_0x52dd('0x13'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x3450f0){_0x6ca56c=_0x3450f0?_0x3450f0[_0x52dd('0x5b')]:[];return initializeQueues(_0x371cbe,_0x28dc3b,_0xf1048a,_0x5b7b03[_0x52dd('0x50')][_0x52dd('0x60')]);})['then'](function(_0x544834){var _0x4e09f6=_0x544834['map'](function(_0x2f565d){if(_0xf1048a===_0x52dd('0x13'))return getVoiceQueueAgents(_0x2f565d,_0x371cbe,_0x38fb29,_0x6ca56c);else return getQueueAgents(_0x2f565d,_0x38fb29,_0xf1048a);});return Promise[_0x52dd('0x75')](_0x4e09f6);})[_0x52dd('0x17')](function(_0x487b34){_0x77c1ab[_0x52dd('0x5b')]=_0x487b34;return _0x77c1ab;})[_0x52dd('0x17')](respondWithFilteredResult(_0xa5a0c5,_0x511043))[_0x52dd('0x1a')](handleError(_0xa5a0c5,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index ec36938..87c91a9 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x34f63b,_0x46798b){var _0x45f97b=function(_0x3d3b0e){while(--_0x3d3b0e){_0x34f63b['push'](_0x34f63b['shift']());}};_0x45f97b(++_0x46798b);}(_0x70e0,0x17b));var _0x070e=function(_0x574983,_0x9e1159){_0x574983=_0x574983-0x0;var _0x22dd49=_0x70e0[_0x574983];return _0x22dd49;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x57e04d,_0x27db47){var _0x4b4d5d=function(_0x1b1376){while(--_0x1b1376){_0x57e04d['push'](_0x57e04d['shift']());}};_0x4b4d5d(++_0x27db47);}(_0x70e0,0x17b));var _0x070e=function(_0x56e16e,_0x2f18d9){_0x56e16e=_0x56e16e-0x0;var _0x47d60f=_0x70e0[_0x56e16e];return _0x47d60f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 47d32ac..e0279de 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 _0xb242=['INTEGER','STRING','DATE','exports'];(function(_0x2b876f,_0x2c0f13){var _0x50392a=function(_0x5cbda2){while(--_0x5cbda2){_0x2b876f['push'](_0x2b876f['shift']());}};_0x50392a(++_0x2c0f13);}(_0xb242,0x1f3));var _0x2b24=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0xb242[_0x4695ba];return _0x524b7d;};'use strict';var Sequelize=require('sequelize');module[_0x2b24('0x0')]={'state':{'type':Sequelize[_0x2b24('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2b24('0x2')]},'scheduledat':{'type':Sequelize[_0x2b24('0x3')]},'uniqueid':{'type':Sequelize[_0x2b24('0x2')]},'starttime':{'type':Sequelize[_0x2b24('0x3')]},'responsetime':{'type':Sequelize[_0x2b24('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2b24('0x2')]},'membername':{'type':Sequelize[_0x2b24('0x2')]}}; \ No newline at end of file +var _0x038b=['exports','INTEGER','STRING','DATE'];(function(_0x218c0c,_0x2b21e3){var _0xf0347d=function(_0xb3b51c){while(--_0xb3b51c){_0x218c0c['push'](_0x218c0c['shift']());}};_0xf0347d(++_0x2b21e3);}(_0x038b,0x114));var _0xb038=function(_0x279dd6,_0x31d399){_0x279dd6=_0x279dd6-0x0;var _0x290723=_0x038b[_0x279dd6];return _0x290723;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'state':{'type':Sequelize[_0xb038('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb038('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xb038('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb038('0x3')]},'ringtime':{'type':Sequelize[_0xb038('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb038('0x2')]},'membername':{'type':Sequelize[_0xb038('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index aeef7e3..1c44223 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 _0xb938=['../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xb938,0x1f2));var _0x8b93=function(_0xcfd89a,_0xcea52b){_0xcfd89a=_0xcfd89a-0x0;var _0x4335cc=_0xb938[_0xcfd89a];return _0x4335cc;};'use strict';var _=require(_0x8b93('0x0'));var util=require('util');var logger=require(_0x8b93('0x1'))(_0x8b93('0x2'));var moment=require('moment');var BPromise=require(_0x8b93('0x3'));var rp=require(_0x8b93('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b93('0x5'));var config=require(_0x8b93('0x6'));var attributes=require(_0x8b93('0x7'));module[_0x8b93('0x8')]=function(_0x21d3dc,_0x4d6096){return _0x21d3dc[_0x8b93('0x9')](_0x8b93('0xa'),attributes,{'tableName':_0x8b93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d46=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','lodash','util'];(function(_0x50a732,_0x1eab82){var _0x2047a1=function(_0x277e50){while(--_0x277e50){_0x50a732['push'](_0x50a732['shift']());}};_0x2047a1(++_0x1eab82);}(_0x7d46,0x8a));var _0x67d4=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x7d46[_0x412e27];return _0x53da42;};'use strict';var _=require(_0x67d4('0x0'));var util=require(_0x67d4('0x1'));var logger=require(_0x67d4('0x2'))('api');var moment=require(_0x67d4('0x3'));var BPromise=require(_0x67d4('0x4'));var rp=require(_0x67d4('0x5'));var fs=require('fs');var path=require(_0x67d4('0x6'));var rimraf=require(_0x67d4('0x7'));var config=require(_0x67d4('0x8'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x24a59b,_0x2ad20b){return _0x24a59b[_0x67d4('0x9')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','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 3f17089..1de3c6c 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 _0xb3c3=['../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb3c3,0x88));var _0x3b3c=function(_0x39ff0a,_0x3904cc){_0x39ff0a=_0x39ff0a-0x0;var _0x384f45=_0xb3c3[_0x39ff0a];return _0x384f45;};'use strict';var _=require(_0x3b3c('0x0'));var util=require(_0x3b3c('0x1'));var moment=require(_0x3b3c('0x2'));var BPromise=require(_0x3b3c('0x3'));var rs=require(_0x3b3c('0x4'));var fs=require('fs');var Redis=require(_0x3b3c('0x5'));var db=require(_0x3b3c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b3c('0x7'))(_0x3b3c('0x8'));var config=require(_0x3b3c('0x9'));var jayson=require(_0x3b3c('0xa'));var client=jayson[_0x3b3c('0xb')][_0x3b3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e9b89,_0x5e36c2,_0x440286){return new BPromise(function(_0x38ba66,_0x3ae324){return client['request'](_0x3e9b89,_0x440286)[_0x3b3c('0xd')](function(_0x547465){logger[_0x3b3c('0xe')](_0x3b3c('0xf'),_0x5e36c2,_0x3b3c('0x10'));logger[_0x3b3c('0x11')](_0x3b3c('0x12'),_0x5e36c2,_0x3b3c('0x10'),JSON[_0x3b3c('0x13')](_0x547465));if(_0x547465[_0x3b3c('0x14')]){if(_0x547465[_0x3b3c('0x14')][_0x3b3c('0x15')]===0x1f4){logger[_0x3b3c('0x14')](_0x3b3c('0xf'),_0x5e36c2,_0x547465[_0x3b3c('0x14')]['message']);return _0x3ae324(_0x547465[_0x3b3c('0x14')][_0x3b3c('0x16')]);}logger[_0x3b3c('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x5e36c2,_0x547465[_0x3b3c('0x14')]['message']);return _0x38ba66(_0x547465['error'][_0x3b3c('0x16')]);}else{logger[_0x3b3c('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x5e36c2,_0x3b3c('0x10'));_0x38ba66(_0x547465[_0x3b3c('0x17')]['message']);}})[_0x3b3c('0x18')](function(_0x4a38eb){logger[_0x3b3c('0x14')](_0x3b3c('0xf'),_0x5e36c2,_0x4a38eb);_0x3ae324(_0x4a38eb);});});}exports[_0x3b3c('0x19')]=function(_0x5b9dac){var _0x33461a=this;return new Promise(function(_0x459a2,_0x5e3918){return db['ReportAgentPreview']['create'](_0x5b9dac[_0x3b3c('0x1a')],{'raw':_0x5b9dac['options']?_0x5b9dac[_0x3b3c('0x1b')][_0x3b3c('0x1c')]===undefined?!![]:![]:!![]})[_0x3b3c('0xd')](function(_0x22e99d){logger[_0x3b3c('0xe')](_0x3b3c('0x19'),_0x5b9dac);logger[_0x3b3c('0x11')](_0x3b3c('0x19'),_0x5b9dac,JSON[_0x3b3c('0x13')](_0x22e99d));_0x459a2(_0x22e99d);})[_0x3b3c('0x18')](function(_0x5e6e7d){logger[_0x3b3c('0x14')](_0x3b3c('0x19'),_0x5e6e7d[_0x3b3c('0x16')],_0x5b9dac);_0x5e3918(_0x33461a[_0x3b3c('0x14')](0x1f4,_0x5e6e7d[_0x3b3c('0x16')]));});});}; \ No newline at end of file +var _0xe9d0=['stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s'];(function(_0x37a0ce,_0x28dc04){var _0x569f4e=function(_0x1671c0){while(--_0x1671c0){_0x37a0ce['push'](_0x37a0ce['shift']());}};_0x569f4e(++_0x28dc04);}(_0xe9d0,0xf5));var _0x0e9d=function(_0x1f4a62,_0x24192a){_0x1f4a62=_0x1f4a62-0x0;var _0x2a9fe7=_0xe9d0[_0x1f4a62];return _0x2a9fe7;};'use strict';var _=require(_0x0e9d('0x0'));var util=require('util');var moment=require(_0x0e9d('0x1'));var BPromise=require(_0x0e9d('0x2'));var rs=require(_0x0e9d('0x3'));var fs=require('fs');var Redis=require(_0x0e9d('0x4'));var db=require(_0x0e9d('0x5'))['db'];var utils=require(_0x0e9d('0x6'));var logger=require(_0x0e9d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0e9d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x820c2f,_0x3f87dc,_0x21d418){return new BPromise(function(_0xdbf93c,_0x12e3a0){return client[_0x0e9d('0x9')](_0x820c2f,_0x21d418)[_0x0e9d('0xa')](function(_0x37e414){logger[_0x0e9d('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x3f87dc,_0x0e9d('0xc'));logger[_0x0e9d('0xd')](_0x0e9d('0xe'),_0x3f87dc,_0x0e9d('0xc'),JSON[_0x0e9d('0xf')](_0x37e414));if(_0x37e414[_0x0e9d('0x10')]){if(_0x37e414[_0x0e9d('0x10')]['code']===0x1f4){logger[_0x0e9d('0x10')](_0x0e9d('0x11'),_0x3f87dc,_0x37e414[_0x0e9d('0x10')][_0x0e9d('0x12')]);return _0x12e3a0(_0x37e414[_0x0e9d('0x10')][_0x0e9d('0x12')]);}logger[_0x0e9d('0x10')](_0x0e9d('0x11'),_0x3f87dc,_0x37e414[_0x0e9d('0x10')][_0x0e9d('0x12')]);return _0xdbf93c(_0x37e414[_0x0e9d('0x10')][_0x0e9d('0x12')]);}else{logger[_0x0e9d('0xb')](_0x0e9d('0x11'),_0x3f87dc,_0x0e9d('0xc'));_0xdbf93c(_0x37e414[_0x0e9d('0x13')]['message']);}})['catch'](function(_0x3bbcb5){logger[_0x0e9d('0x10')](_0x0e9d('0x11'),_0x3f87dc,_0x3bbcb5);_0x12e3a0(_0x3bbcb5);});});}exports[_0x0e9d('0x14')]=function(_0x53649a){var _0x18c259=this;return new Promise(function(_0x3f89f4,_0x509331){return db[_0x0e9d('0x15')][_0x0e9d('0x16')](_0x53649a['body'],{'raw':_0x53649a['options']?_0x53649a[_0x0e9d('0x17')][_0x0e9d('0x18')]===undefined?!![]:![]:!![]})[_0x0e9d('0xa')](function(_0xdfa212){logger[_0x0e9d('0xb')](_0x0e9d('0x14'),_0x53649a);logger['debug'](_0x0e9d('0x14'),_0x53649a,JSON[_0x0e9d('0xf')](_0xdfa212));_0x3f89f4(_0xdfa212);})[_0x0e9d('0x19')](function(_0x3758d7){logger[_0x0e9d('0x10')](_0x0e9d('0x14'),_0x3758d7[_0x0e9d('0x12')],_0x53649a);_0x509331(_0x18c259[_0x0e9d('0x10')](0x1f4,_0x3758d7['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 35d794c..8906cd2 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 _0x31dc=['/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','/outbound','outbound','agents','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify'];(function(_0x4ae8f3,_0x3a27cf){var _0x1bcedd=function(_0x5d782f){while(--_0x5d782f){_0x4ae8f3['push'](_0x4ae8f3['shift']());}};_0x1bcedd(++_0x3a27cf);}(_0x31dc,0x1ab));var _0xc31d=function(_0x3bcef8,_0x3dfb4a){_0x3bcef8=_0x3bcef8-0x0;var _0x114a95=_0x31dc[_0x3bcef8];return _0x114a95;};'use strict';var multer=require('multer');var util=require(_0xc31d('0x0'));var path=require(_0xc31d('0x1'));var express=require(_0xc31d('0x2'));var router=express[_0xc31d('0x3')]();var auth=require(_0xc31d('0x4'));var controller=require(_0xc31d('0x5'));router[_0xc31d('0x6')](_0xc31d('0x7'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x9')]);router[_0xc31d('0x6')](_0xc31d('0xa'),auth[_0xc31d('0x8')](),controller[_0xc31d('0xb')]);router[_0xc31d('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xc31d('0x8')](),controller[_0xc31d('0xc')]);router[_0xc31d('0x6')](_0xc31d('0xd'),auth[_0xc31d('0x8')](),controller[_0xc31d('0xe')]);router[_0xc31d('0x6')](_0xc31d('0xf'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x10')]);router[_0xc31d('0x6')](_0xc31d('0x11'),auth['isAuthenticated'](),controller[_0xc31d('0x12')]);router[_0xc31d('0x6')]('/mail/accounts',auth['isAuthenticated'](),controller[_0xc31d('0x13')]);router[_0xc31d('0x6')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0xc31d('0x14')]);router['get'](_0xc31d('0x15'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x16')]);router['get']('/whatsapp/queues',auth[_0xc31d('0x8')](),controller[_0xc31d('0x17')]);router['get']('/fax/queues',auth[_0xc31d('0x8')](),controller['faxQueues']);router[_0xc31d('0x6')](_0xc31d('0x18'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x19')]);router[_0xc31d('0x6')](_0xc31d('0x1a'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x1b')]);router[_0xc31d('0x6')](_0xc31d('0x1c'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x1d')]);router[_0xc31d('0x6')](_0xc31d('0x1e'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x1f')]);router['get'](_0xc31d('0x20'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x21')]);router['get']('/voice/queues/:id',auth[_0xc31d('0x8')](),controller[_0xc31d('0x22')]);router[_0xc31d('0x23')](_0xc31d('0x24'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0xc31d('0x6')](_0xc31d('0x25'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x26')]);router[_0xc31d('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller['outboundChannels']);router[_0xc31d('0x6')]('/agents',auth[_0xc31d('0x8')](),controller[_0xc31d('0x27')]);router['put']('/agents/:id/capacity',auth[_0xc31d('0x8')](),controller[_0xc31d('0x28')]);router['get']('/telephones',auth[_0xc31d('0x8')](),controller[_0xc31d('0x29')]);router[_0xc31d('0x6')](_0xc31d('0x2a'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x2b')]);router[_0xc31d('0x6')](_0xc31d('0x2c'),auth['isAuthenticated'](),controller[_0xc31d('0x2d')]);router[_0xc31d('0x6')](_0xc31d('0x2e'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x2f')]);router[_0xc31d('0x6')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xc31d('0x30')]);router[_0xc31d('0x6')](_0xc31d('0x31'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x32')]);router[_0xc31d('0x6')](_0xc31d('0x33'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xc31d('0x6')](_0xc31d('0x34'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x35')]);router[_0xc31d('0x6')](_0xc31d('0x36'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x37')]);router[_0xc31d('0x6')](_0xc31d('0x38'),auth[_0xc31d('0x8')](),controller['whatsappQueuesWaitingInteractions']);router[_0xc31d('0x6')](_0xc31d('0x39'),auth['isAuthenticated'](),controller[_0xc31d('0x3a')]);router[_0xc31d('0x3b')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc31d('0x3c')](_0xc31d('0x3d')));router['get'](_0xc31d('0x3e'),auth['isAuthenticated'](),controller[_0xc31d('0x3f')]);router[_0xc31d('0x3b')](_0xc31d('0x40'),auth['isAuthenticated'](),controller[_0xc31d('0x3c')]('chat'));router[_0xc31d('0x6')](_0xc31d('0x41'),auth['isAuthenticated'](),controller[_0xc31d('0x42')]);router[_0xc31d('0x3b')](_0xc31d('0x43'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x3c')]('fax'));router[_0xc31d('0x6')](_0xc31d('0x44'),auth[_0xc31d('0x8')](),controller['showFaxQueues']);router[_0xc31d('0x3b')](_0xc31d('0x45'),auth['isAuthenticated'](),controller['queueNotify'](_0xc31d('0x46')));router['get'](_0xc31d('0x47'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x48')]);router['post'](_0xc31d('0x49'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x3c')](_0xc31d('0x4a')));router[_0xc31d('0x3b')]('/whatsapp/queues/:id/notify',auth[_0xc31d('0x8')](),controller[_0xc31d('0x3c')](_0xc31d('0x4b')));router[_0xc31d('0x6')](_0xc31d('0x4c'),auth['isAuthenticated'](),controller[_0xc31d('0x4d')]);router[_0xc31d('0x6')](_0xc31d('0x4e'),auth[_0xc31d('0x8')](),controller[_0xc31d('0x4f')]);router['post']('/agents/:id/notify',auth[_0xc31d('0x8')](),controller[_0xc31d('0x50')]);module[_0xc31d('0x51')]=router; \ No newline at end of file +var _0xda16=['exports','multer','util','path','express','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','agentNotify'];(function(_0x695793,_0x2db830){var _0x4fe910=function(_0x34d20a){while(--_0x34d20a){_0x695793['push'](_0x695793['shift']());}};_0x4fe910(++_0x2db830);}(_0xda16,0x1cf));var _0x6da1=function(_0x56f4f2,_0x2fd8c0){_0x56f4f2=_0x56f4f2-0x0;var _0x2a27e1=_0xda16[_0x56f4f2];return _0x2a27e1;};'use strict';var multer=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var path=require(_0x6da1('0x2'));var express=require(_0x6da1('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x6da1('0x4')](_0x6da1('0x5'),auth[_0x6da1('0x6')](),controller['voiceChannels']);router[_0x6da1('0x4')](_0x6da1('0x7'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x8')]);router['get'](_0x6da1('0x9'),auth['isAuthenticated'](),controller[_0x6da1('0xa')]);router['get'](_0x6da1('0xb'),auth[_0x6da1('0x6')](),controller[_0x6da1('0xc')]);router[_0x6da1('0x4')](_0x6da1('0xd'),auth[_0x6da1('0x6')](),controller['chatQueues']);router[_0x6da1('0x4')](_0x6da1('0xe'),auth[_0x6da1('0x6')](),controller[_0x6da1('0xf')]);router[_0x6da1('0x4')](_0x6da1('0x10'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x11')]);router['get']('/openchannel/queues',auth[_0x6da1('0x6')](),controller[_0x6da1('0x12')]);router['get'](_0x6da1('0x13'),auth[_0x6da1('0x6')](),controller['smsQueues']);router[_0x6da1('0x4')](_0x6da1('0x14'),auth[_0x6da1('0x6')](),controller['whatsappQueues']);router[_0x6da1('0x4')](_0x6da1('0x15'),auth[_0x6da1('0x6')](),controller['faxQueues']);router['get'](_0x6da1('0x16'),auth['isAuthenticated'](),controller[_0x6da1('0x17')]);router[_0x6da1('0x4')]('/voice/queues/channels',auth[_0x6da1('0x6')](),controller[_0x6da1('0x18')]);router[_0x6da1('0x4')]('/voice/queues/channels/:uniqueid',auth[_0x6da1('0x6')](),controller['voiceQueuesChannel']);router[_0x6da1('0x4')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x6da1('0x19')]);router['get'](_0x6da1('0x1a'),auth[_0x6da1('0x6')](),controller['voiceQueuesChannelRedirect']);router[_0x6da1('0x4')](_0x6da1('0x1b'),auth['isAuthenticated'](),controller[_0x6da1('0x1c')]);router[_0x6da1('0x1d')](_0x6da1('0x1b'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x1e')]);router[_0x6da1('0x4')](_0x6da1('0x1f'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x20')]);router[_0x6da1('0x4')]('/outbound/channels',auth[_0x6da1('0x6')](),controller['outboundChannels']);router['get'](_0x6da1('0x21'),auth['isAuthenticated'](),controller[_0x6da1('0x22')]);router[_0x6da1('0x1d')](_0x6da1('0x23'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x24')]);router[_0x6da1('0x4')](_0x6da1('0x25'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x26')]);router['get'](_0x6da1('0x27'),auth['isAuthenticated'](),controller[_0x6da1('0x28')]);router[_0x6da1('0x4')](_0x6da1('0x29'),auth[_0x6da1('0x6')](),controller['campaigns']);router[_0x6da1('0x4')](_0x6da1('0x2a'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x2b')]);router[_0x6da1('0x4')](_0x6da1('0x2c'),auth[_0x6da1('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x6da1('0x4')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x6da1('0x2d')]);router[_0x6da1('0x4')](_0x6da1('0x2e'),auth[_0x6da1('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x6da1('0x4')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x6da1('0x2f')]);router['get'](_0x6da1('0x30'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x31')]);router[_0x6da1('0x4')](_0x6da1('0x32'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x33')]);router['get'](_0x6da1('0x34'),auth['isAuthenticated'](),controller[_0x6da1('0x35')]);router[_0x6da1('0x36')](_0x6da1('0x37'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x38')](_0x6da1('0x39')));router['get'](_0x6da1('0x3a'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x3b')]);router['post'](_0x6da1('0x3c'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x38')](_0x6da1('0x3d')));router[_0x6da1('0x4')](_0x6da1('0x3e'),auth['isAuthenticated'](),controller[_0x6da1('0x3f')]);router[_0x6da1('0x36')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x6da1('0x40')));router[_0x6da1('0x4')](_0x6da1('0x41'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x42')]);router['post'](_0x6da1('0x43'),auth['isAuthenticated'](),controller[_0x6da1('0x38')](_0x6da1('0x44')));router[_0x6da1('0x4')]('/openchannel/queues/:id',auth[_0x6da1('0x6')](),controller[_0x6da1('0x45')]);router[_0x6da1('0x36')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x6da1('0x38')]('sms'));router[_0x6da1('0x36')](_0x6da1('0x46'),auth['isAuthenticated'](),controller[_0x6da1('0x38')](_0x6da1('0x47')));router[_0x6da1('0x4')](_0x6da1('0x48'),auth[_0x6da1('0x6')](),controller['showSmsQueues']);router['get'](_0x6da1('0x49'),auth[_0x6da1('0x6')](),controller[_0x6da1('0x4a')]);router[_0x6da1('0x36')]('/agents/:id/notify',auth[_0x6da1('0x6')](),controller[_0x6da1('0x4b')]);module[_0x6da1('0x4c')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 637f224..62f6d23 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 _0x038b=['\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','create','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','update','Start','agentTransferTimeout','moment','lodash','util','../../config/logger','jayson/promise','client','http','request','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','then','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne'];(function(_0xb72220,_0x2f7d42){var _0x20af34=function(_0x229d37){while(--_0x229d37){_0xb72220['push'](_0xb72220['shift']());}};_0x20af34(++_0x2f7d42);}(_0x038b,0x114));var _0xb038=function(_0x2042e6,_0x4208de){_0x2042e6=_0x2042e6-0x0;var _0x3c8770=_0x038b[_0x2042e6];return _0x3c8770;};'use strict';var BPromise=require('bluebird');var moment=require(_0xb038('0x0'));var _=require(_0xb038('0x1'));var util=require(_0xb038('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xb038('0x3'))('api');var jayson=require(_0xb038('0x4'));var amiClient=jayson[_0xb038('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xb038('0x5')][_0xb038('0x6')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2e3e64,_0x1b077a,_0x1534a9){return new BPromise(function(_0x4b4085,_0x48a4d7){var _0x462e8f=_0x1534a9?_0x1534a9:amiClient;return _0x462e8f[_0xb038('0x7')](_0x2e3e64,_0x1b077a)['then'](function(_0x53bcc0){if(_0x53bcc0[_0xb038('0x8')]){if(_0x53bcc0[_0xb038('0x8')]['code']===0x1f4){return _0x48a4d7(_0x53bcc0[_0xb038('0x8')][_0xb038('0x9')]);}return _0x4b4085(_0x53bcc0[_0xb038('0x8')][_0xb038('0x9')]);}else{_0x4b4085(_0x53bcc0[_0xb038('0xa')]);}})[_0xb038('0xb')](function(_0x1e6474){_0x48a4d7(_0x1e6474);});});}function respondWithResult(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xc8;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0xc')](_0x16e4a3)[_0xb038('0xd')](_0x57acd8);}return _0x439751[_0xb038('0xe')](0x194);};}function handleError(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0x1f4;return function(_0x13acc7){logger[_0xb038('0x8')](_0x13acc7['stack']);if(_0x13acc7[_0xb038('0xf')]){delete _0x13acc7[_0xb038('0xf')];}_0x3cc717[_0xb038('0xc')](_0x3a71a6)[_0xb038('0x10')](_0x13acc7);};}function findById(_0xdef213){return function(_0x2b4173){if(!_['isNil'](_0xdef213)&&!_[_0xb038('0x11')](_0x2b4173)&&!_[_0xb038('0x11')](_0x2b4173[_0xb038('0x12')])){return _[_0xb038('0x13')](_0x2b4173['rows'],function(_0x49b237){return _0x49b237['id']==_0xdef213;});}return null;};}exports[_0xb038('0x14')]=function(_0x3f48e6,_0x3e06ef){return respondWithRpcPromise(_0xb038('0x15'),_0x3f48e6['query'])[_0xb038('0x16')](respondWithResult(_0x3e06ef,null))[_0xb038('0xb')](handleError(_0x3e06ef,null));};exports[_0xb038('0x17')]=function(_0x33a377,_0xc6cd61){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xb038('0x18')](_0x33a377[_0xb038('0x19')],_0x33a377[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0xc6cd61,null))['catch'](handleError(_0xc6cd61,null));};exports[_0xb038('0x1b')]=function(_0x1b7505,_0x4bbf38){return respondWithRpcPromise(_0xb038('0x1c'),_[_0xb038('0x18')](_0x1b7505['query'],_0x1b7505[_0xb038('0x1a')]))['then'](respondWithResult(_0x4bbf38,null))[_0xb038('0xb')](handleError(_0x4bbf38,null));};exports[_0xb038('0x1d')]=function(_0x27ff21,_0x1df7c4){return respondWithRpcPromise(_0xb038('0x1e'),_0x27ff21[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x1df7c4,null))['catch'](handleError(_0x1df7c4,null));};exports[_0xb038('0x1f')]=function(_0x33cf3c,_0x226631){return respondWithRpcPromise('VoiceQueues',_0x33cf3c[_0xb038('0x19')])[_0xb038('0x16')](findById(_0x33cf3c[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x226631,null))[_0xb038('0xb')](handleError(_0x226631,null));};exports[_0xb038('0x20')]=function(_0x28a6a9,_0x12b3b6){return respondWithRpcPromise(_0xb038('0x21'),_['merge'](_0x28a6a9[_0xb038('0x22')],_0x28a6a9[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x12b3b6,null))[_0xb038('0xb')](handleError(_0x12b3b6,null));};exports[_0xb038('0x23')]=function(_0xbc8958,_0x29a0d7){return respondWithRpcPromise(_0xb038('0x24'),_[_0xb038('0x18')](_0xbc8958[_0xb038('0x19')],_0xbc8958[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x29a0d7,null))[_0xb038('0xb')](handleError(_0x29a0d7,null));};exports['voiceQueuesChannels']=function(_0x1d807a,_0x598554){return respondWithRpcPromise(_0xb038('0x25'),_0x1d807a[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x598554,null))[_0xb038('0xb')](handleError(_0x598554,null));};exports[_0xb038('0x26')]=function(_0x424b81,_0x3a393d){return respondWithRpcPromise(_0xb038('0x27'),_[_0xb038('0x18')](_0x424b81[_0xb038('0x19')],_0x424b81['params']))[_0xb038('0x16')](respondWithResult(_0x3a393d,null))[_0xb038('0xb')](handleError(_0x3a393d,null));};exports[_0xb038('0x28')]=function(_0x560342,_0x51e649){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xb038('0x18')](_0x560342[_0xb038('0x19')],_0x560342[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x51e649,null))[_0xb038('0xb')](handleError(_0x51e649,null));};exports[_0xb038('0x29')]=function(_0x48f777,_0x16abea){return respondWithRpcPromise(_0xb038('0x2a'),_[_0xb038('0x18')](_0x48f777[_0xb038('0x19')],_0x48f777['params']))[_0xb038('0x16')](respondWithResult(_0x16abea,null))[_0xb038('0xb')](handleError(_0x16abea,null));};exports['outbound']=function(_0x5cb40c,_0x26c769){return respondWithRpcPromise(_0xb038('0x2b'),_0x5cb40c[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x26c769,null))[_0xb038('0xb')](handleError(_0x26c769,null));};exports['outboundChannels']=function(_0x404f82,_0x125d2a){return respondWithRpcPromise(_0xb038('0x2c'),_0x404f82[_0xb038('0x19')])['then'](respondWithResult(_0x125d2a,null))[_0xb038('0xb')](handleError(_0x125d2a,null));};exports[_0xb038('0x2d')]=function(_0x7d2f79,_0x573426){var _0x412d71;return respondWithRpcPromise('Agents',_0x7d2f79[_0xb038('0x19')])[_0xb038('0x16')](function(_0x3ac1db){_0x412d71=_0x3ac1db;return respondWithRpcPromise('Agents',_0x7d2f79[_0xb038('0x19')],routingClient);})[_0xb038('0x16')](function(_0x4e0533){return _['merge']({},_0x4e0533,_0x412d71);})[_0xb038('0x16')](respondWithResult(_0x573426,null))[_0xb038('0xb')](handleError(_0x573426,null));};exports[_0xb038('0x2e')]=function(_0x3c291e,_0x5ad462){if(_0x3c291e[_0xb038('0x22')]&&_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')]&&_0x3c291e[_0xb038('0x30')]&&_0x3c291e['user'][_0xb038('0xf')]){for(var _0x269c7d in _0x3c291e['body'][_0xb038('0x2f')]){if(_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')]['hasOwnProperty'](_0x269c7d)){db[_0xb038('0x31')][_0xb038('0x32')]({'where':{'channel':_0x269c7d,'membername':_0x3c291e['user']['name'],'type':_0xb038('0x33'),'exitAt':null,'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d]&&_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0xb038('0x34')]?{'$notIn':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d]}:{'$ne':null}}})['then'](function(_0x5f0d9d){var _0x5e8383=moment()[_0xb038('0x35')](_0xb038('0x36'));for(var _0x52f0b8=0x0,_0x46a724=_0x5f0d9d[_0xb038('0x34')];_0x52f0b8<_0x46a724;_0x52f0b8+=0x1){_0x5f0d9d[_0x52f0b8][_0xb038('0x37')]({'exitAt':_0x5e8383});}});for(var _0x5f24cd=0x0;_0x5f24cd<_0x3c291e[_0xb038('0x22')]['interaction'][_0x269c7d]['length'];_0x5f24cd+=0x1){db[_0xb038('0x31')][_0xb038('0x38')]({'where':{'channel':_0x269c7d,'membername':_0x3c291e[_0xb038('0x30')][_0xb038('0xf')],'type':_0xb038('0x33'),'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0x5f24cd],'exitAt':null},'defaults':{'channel':_0x269c7d,'membername':_0x3c291e[_0xb038('0x30')][_0xb038('0xf')],'interface':_[_0xb038('0x11')](_0x3c291e['user'][_0xb038('0x39')])?util[_0xb038('0x35')]('SIP/%s',_0x3c291e[_0xb038('0x30')][_0xb038('0xf')]):_0x3c291e['user'][_0xb038('0x39')],'type':_0xb038('0x33'),'enterAt':moment()[_0xb038('0x35')](_0xb038('0x36')),'role':_0xb038('0x3a'),'internal':_0x3c291e[_0xb038('0x30')][_0xb038('0x3b')],'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0x5f24cd]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3c291e[_0xb038('0x1a')]['id'],'capacity':_0x3c291e[_0xb038('0x22')][_0xb038('0x3c')]},routingClient)[_0xb038('0x16')](respondWithResult(_0x5ad462,null))[_0xb038('0xb')](handleError(_0x5ad462,null));};exports[_0xb038('0x3d')]=function(_0x591077,_0x1f4997){return respondWithRpcPromise(_0xb038('0x3e'),_0x591077[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x1f4997,null))[_0xb038('0xb')](handleError(_0x1f4997,null));};exports[_0xb038('0x3f')]=function(_0xd7a862,_0x5b82f4){return respondWithRpcPromise(_0xb038('0x40'),_0xd7a862['query'])[_0xb038('0x16')](respondWithResult(_0x5b82f4,null))[_0xb038('0xb')](handleError(_0x5b82f4,null));};exports[_0xb038('0x41')]=function(_0x998fe3,_0x1518c4){return respondWithRpcPromise('Campaigns',_0x998fe3['query'])['then'](respondWithResult(_0x1518c4,null))[_0xb038('0xb')](handleError(_0x1518c4,null));};exports[_0xb038('0x42')]=function(_0x276fac,_0x218368){return respondWithRpcPromise(_0xb038('0x43'),_0x276fac[_0xb038('0x19')],routingClient)['then'](respondWithResult(_0x218368,null))[_0xb038('0xb')](handleError(_0x218368,null));};exports[_0xb038('0x44')]=function(_0x5b2cbb,_0x5b27d3){return respondWithRpcPromise(_0xb038('0x43'),_0x5b2cbb['query'],routingClient)[_0xb038('0x16')](findById(_0x5b2cbb['params']['id']))[_0xb038('0x16')](respondWithResult(_0x5b27d3,null))[_0xb038('0xb')](handleError(_0x5b27d3,null));};exports[_0xb038('0x45')]=function(_0x4300e9,_0x4ee38b){return respondWithRpcPromise(_0xb038('0x46'),_0x4300e9[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x4ee38b,null))[_0xb038('0xb')](handleError(_0x4ee38b,null));};exports[_0xb038('0x47')]=function(_0x1246c8,_0x14a553){return respondWithRpcPromise(_0xb038('0x46'),_0x1246c8[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x1246c8[_0xb038('0x1a')]['id']))[_0xb038('0x16')](respondWithResult(_0x14a553,null))['catch'](handleError(_0x14a553,null));};exports[_0xb038('0x48')]=function(_0x2fc38d,_0x438e7e){return respondWithRpcPromise(_0xb038('0x49'),_0x2fc38d[_0xb038('0x19')],mailClient)['then'](respondWithResult(_0x438e7e,null))[_0xb038('0xb')](handleError(_0x438e7e,null));};exports['openchannelQueues']=function(_0xfb3ce6,_0x170a7e){return respondWithRpcPromise('OpenchannelQueues',_0xfb3ce6[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x170a7e,null))[_0xb038('0xb')](handleError(_0x170a7e,null));};exports[_0xb038('0x4a')]=function(_0x120cc7,_0x2f01c0){return respondWithRpcPromise(_0xb038('0x4b'),_0x120cc7[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x120cc7[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x2f01c0,null))[_0xb038('0xb')](handleError(_0x2f01c0,null));};exports['smsQueues']=function(_0x189894,_0x37e445){return respondWithRpcPromise(_0xb038('0x4c'),_0x189894[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x37e445,null))[_0xb038('0xb')](handleError(_0x37e445,null));};exports[_0xb038('0x4d')]=function(_0x4c23b2,_0x572ad4){return respondWithRpcPromise(_0xb038('0x4c'),_0x4c23b2[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x4c23b2['params']['id']))['then'](respondWithResult(_0x572ad4,null))[_0xb038('0xb')](handleError(_0x572ad4,null));};exports['whatsappQueues']=function(_0x35da9e,_0x50e078){return respondWithRpcPromise(_0xb038('0x4e'),_0x35da9e['query'],routingClient)[_0xb038('0x16')](respondWithResult(_0x50e078,null))[_0xb038('0xb')](handleError(_0x50e078,null));};exports[_0xb038('0x4f')]=function(_0x112d77,_0x2c57b9){return respondWithRpcPromise(_0xb038('0x4e'),_0x112d77['query'],routingClient)['then'](findById(_0x112d77[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x2c57b9,null))[_0xb038('0xb')](handleError(_0x2c57b9,null));};exports[_0xb038('0x50')]=function(_0x2f4650,_0x538690){return respondWithRpcPromise(_0xb038('0x51'),_0x2f4650['query'],routingClient)[_0xb038('0x16')](respondWithResult(_0x538690,null))[_0xb038('0xb')](handleError(_0x538690,null));};exports[_0xb038('0x52')]=function(_0x4a417a,_0x40abb7){return respondWithRpcPromise(_0xb038('0x51'),_0x4a417a[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x4a417a[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x40abb7,null))['catch'](handleError(_0x40abb7,null));};exports['faxAccounts']=function(_0x609caf,_0x4efa0f){return respondWithRpcPromise(_0xb038('0x53'),_0x609caf['query'])[_0xb038('0x16')](respondWithResult(_0x4efa0f,null))[_0xb038('0xb')](handleError(_0x4efa0f,null));};exports[_0xb038('0x54')]=function(_0x1294d7,_0x7c8d01){return respondWithRpcPromise(_0xb038('0x55'),_0x1294d7[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x7c8d01,null))[_0xb038('0xb')](handleError(_0x7c8d01,null));};exports[_0xb038('0x56')]=function(_0x1db407,_0x1a5cf6){return respondWithRpcPromise(_0xb038('0x57'),_0x1db407[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x1a5cf6,null))[_0xb038('0xb')](handleError(_0x1a5cf6,null));};exports[_0xb038('0x58')]=function(_0x123e31,_0x1f9a30){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x123e31[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x1f9a30,null))[_0xb038('0xb')](handleError(_0x1f9a30,null));};exports[_0xb038('0x59')]=function(_0xdaacfe,_0x5ead21){return respondWithRpcPromise(_0xb038('0x5a'),_0xdaacfe[_0xb038('0x19')],routingClient)[_0xb038('0x16')](function(_0x80d720){if(_0xdaacfe[_0xb038('0x19')][_0xb038('0x5b')]!==undefined){var _0x2acbf6=_(_0x80d720[_0xb038('0x12')])[_0xb038('0x5c')]([_0xdaacfe['query']['type'],_0xdaacfe[_0xb038('0x1a')]['id']])['map'](_0xb038('0x5d'))['uniq']()['value']();return _0x80d720['rows'][_0xb038('0x5c')](function(_0x463ae6){return _0x2acbf6['indexOf'](_0x463ae6[_0xb038('0x5d')])>-0x1;});}else{return _0x80d720[_0xb038('0x12')][_0xb038('0x5c')](function(_0x31ccf7){return _0x31ccf7[_0xb038('0x5d')]===parseInt(_0xdaacfe[_0xb038('0x1a')]['id']);});}})[_0xb038('0x16')](respondWithResult(_0x5ead21,null))[_0xb038('0xb')](handleError(_0x5ead21,null));};exports[_0xb038('0x5e')]=function(_0xde487d,_0x4b15b7){return respondWithRpcPromise(_0xb038('0x5f'),_0xde487d[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x4b15b7,null))[_0xb038('0xb')](handleError(_0x4b15b7,null));};exports[_0xb038('0x60')]=function(_0x222e90,_0x425854){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x222e90[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x425854,null))[_0xb038('0xb')](handleError(_0x425854,null));};exports['faxQueuesWaitingInteractions']=function(_0x551fcc,_0x2adf3b){return respondWithRpcPromise(_0xb038('0x61'),_0x551fcc[_0xb038('0x19')],routingClient)['then'](respondWithResult(_0x2adf3b,null))[_0xb038('0xb')](handleError(_0x2adf3b,null));};exports[_0xb038('0x62')]=function(_0x5b003a){return function(_0x2e6db4,_0x1d5640){var _0x240d06,_0x2a41c8;var _0x24f810=_[_0xb038('0x63')](_0x5b003a);var _0x1ea747=_0x5b003a===_0xb038('0x64')?_0xb038('0x65'):_0xb038('0x66');return db[_0x24f810+_0xb038('0x67')][_0xb038('0x68')]({'raw':!![],'where':{'id':_0x2e6db4[_0xb038('0x1a')]['id']}})[_0xb038('0x16')](function(_0x5d1410){if(_[_0xb038('0x11')](_0x5d1410)){throw new Error(_0x24f810+_0xb038('0x69'));}_0x240d06=_0x5d1410;return db[_0x24f810+_0xb038('0x6a')][_0xb038('0x68')]({'where':{'id':_0x2e6db4[_0xb038('0x22')][_0xb038('0x6b')]},'include':[{'model':db[_0x24f810+_0xb038('0x6c')],'as':_0xb038('0x6c')},{'model':db[_0x24f810+_0x1ea747],'as':'Account'}]});})[_0xb038('0x16')](function(_0x3e01ce){if(_['isNil'](_0x3e01ce)){throw new Error(_0x24f810+_0xb038('0x6d'));}_0x2a41c8=_0x3e01ce;return _0x3e01ce['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x38a4d3={'uniqueid':_0x5b003a+'.'+_0x2a41c8['id']+'.'+_0x2a41c8['Interaction']['id'],'FromUserId':_0x2e6db4[_0xb038('0x30')]['id'],'type':'queue'};_0x38a4d3[_0x24f810+_0xb038('0x6e')]=_0x2a41c8['id'];_0x38a4d3[_0x24f810+_0xb038('0x6f')]=_0x2a41c8[_0xb038('0x6c')]['id'];_0x38a4d3[_0xb038('0x70')+_0x24f810+_0x1ea747+'Id']=_0x2a41c8[_0xb038('0x66')]['id'];_0x38a4d3['To'+_0x24f810+_0xb038('0x71')]=_0x240d06['id'];return db[_0x24f810+_0xb038('0x72')][_0xb038('0x73')](_0x38a4d3);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5b003a,'interaction':_0x2a41c8[_0xb038('0x6c')],'message':_0x2a41c8,'account':_0x2a41c8[_0xb038('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb038('0x74'),'appdata':_0x240d06[_0xb038('0xf')]+','+(_0x2a41c8['Account'][_0xb038('0x75')]||0x12c),'interval':_0xb038('0x76')}]},routingClient);})[_0xb038('0x16')](respondWithResult(_0x1d5640,null))[_0xb038('0xb')](handleError(_0x1d5640,null));};};exports[_0xb038('0x77')]=function(_0x139ffa,_0x208cdd){var _0x2ee9bd,_0x32ee35;if(_[_0xb038('0x11')](_0x139ffa['body']['channel'])){throw new Error(_0xb038('0x78'));}var _0xb7f025=_0x139ffa[_0xb038('0x22')][_0xb038('0x79')];var _0x3ee569=_[_0xb038('0x63')](_0xb7f025);var _0x3e129d=_0xb7f025==='chat'?_0xb038('0x65'):_0xb038('0x66');return db[_0xb038('0x7a')][_0xb038('0x68')]({'raw':!![],'where':{'id':_0x139ffa[_0xb038('0x1a')]['id'],'role':_0xb038('0x3a')}})['then'](function(_0x451fe5){if(_[_0xb038('0x11')](_0x451fe5)){throw new Error(_0xb038('0x7b'));}_0x2ee9bd=_0x451fe5;return db[_0x3ee569+_0xb038('0x6a')][_0xb038('0x68')]({'where':{'id':_0x139ffa[_0xb038('0x22')][_0xb038('0x6b')]},'include':[{'model':db[_0x3ee569+_0xb038('0x6c')],'as':_0xb038('0x6c')},{'model':db[_0x3ee569+_0x3e129d],'as':_0xb038('0x66')}]});})[_0xb038('0x16')](function(_0x22e0bd){if(_[_0xb038('0x11')](_0x22e0bd)){throw new Error(_0x3ee569+_0xb038('0x6d'));}_0x32ee35=_0x22e0bd;return _0x22e0bd[_0xb038('0x7c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb038('0x16')](function(){var _0x5448e3={'uniqueid':_0xb7f025+'.'+_0x32ee35['id']+'.'+_0x32ee35['Interaction']['id'],'FromUserId':_0x139ffa[_0xb038('0x30')]['id'],'type':_0xb038('0x74'),'ToUserId':_0x2ee9bd['id']};_0x5448e3[_0x3ee569+_0xb038('0x6e')]=_0x32ee35['id'];_0x5448e3[_0x3ee569+'InteractionId']=_0x32ee35[_0xb038('0x6c')]['id'];_0x5448e3[_0xb038('0x70')+_0x3ee569+_0x3e129d+'Id']=_0x32ee35[_0xb038('0x66')]['id'];return db[_0x3ee569+_0xb038('0x72')]['create'](_0x5448e3);})['then'](function(){return respondWithRpcPromise(_0xb038('0x7d'),{'channel':_0xb7f025,'interaction':_0x32ee35[_0xb038('0x6c')],'message':_0x32ee35,'account':_0x32ee35['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xb038('0x3a'),'appdata':_0x2ee9bd[_0xb038('0xf')]+','+(_0x32ee35[_0xb038('0x66')][_0xb038('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb038('0x16')](respondWithResult(_0x208cdd,null))[_0xb038('0xb')](handleError(_0x208cdd,null));}; \ No newline at end of file +var _0xd8fb=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','map','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Message','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','find','rows','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','MailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd8fb,0x99));var _0xbd8f=function(_0x1b1b1f,_0x4fe5f1){_0x1b1b1f=_0x1b1b1f-0x0;var _0x11ae67=_0xd8fb[_0x1b1b1f];return _0x11ae67;};'use strict';var BPromise=require(_0xbd8f('0x0'));var moment=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));var util=require(_0xbd8f('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xbd8f('0x4'));var amiClient=jayson[_0xbd8f('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xbd8f('0x5')][_0xbd8f('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0xbd8f('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){var _0x493298=_0x578499?_0x578499:amiClient;return _0x493298['request'](_0x4e97cf,_0xf503c4)[_0xbd8f('0x7')](function(_0x2393a9){if(_0x2393a9[_0xbd8f('0x8')]){if(_0x2393a9['error'][_0xbd8f('0x9')]===0x1f4){return _0x403edc(_0x2393a9[_0xbd8f('0x8')]['message']);}return _0x197827(_0x2393a9['error'][_0xbd8f('0xa')]);}else{_0x197827(_0x2393a9[_0xbd8f('0xb')]);}})[_0xbd8f('0xc')](function(_0x5d5705){_0x403edc(_0x5d5705);});});}function respondWithResult(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xc8;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0xd')](_0x159f09)[_0xbd8f('0xe')](_0x39be16);}return _0x230988[_0xbd8f('0xf')](0x194);};}function handleError(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0x1f4;return function(_0x14606c){logger['error'](_0x14606c[_0xbd8f('0x10')]);if(_0x14606c[_0xbd8f('0x11')]){delete _0x14606c[_0xbd8f('0x11')];}_0x37d4d5[_0xbd8f('0xd')](_0x29ffe8)['send'](_0x14606c);};}function findById(_0x174929){return function(_0x63db18){if(!_['isNil'](_0x174929)&&!_[_0xbd8f('0x12')](_0x63db18)&&!_[_0xbd8f('0x12')](_0x63db18['rows'])){return _[_0xbd8f('0x13')](_0x63db18[_0xbd8f('0x14')],function(_0x47d317){return _0x47d317['id']==_0x174929;});}return null;};}exports['voiceChannels']=function(_0x33f77c,_0x5d2fdb){return respondWithRpcPromise('VoiceChannels',_0x33f77c[_0xbd8f('0x15')])['then'](respondWithResult(_0x5d2fdb,null))[_0xbd8f('0xc')](handleError(_0x5d2fdb,null));};exports[_0xbd8f('0x16')]=function(_0xb47c8e,_0x897f25){return respondWithRpcPromise(_0xbd8f('0x17'),_[_0xbd8f('0x18')](_0xb47c8e[_0xbd8f('0x15')],_0xb47c8e[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x897f25,null))[_0xbd8f('0xc')](handleError(_0x897f25,null));};exports[_0xbd8f('0x1a')]=function(_0x1628f5,_0x2f7c45){return respondWithRpcPromise(_0xbd8f('0x1b'),_[_0xbd8f('0x18')](_0x1628f5[_0xbd8f('0x15')],_0x1628f5[_0xbd8f('0x19')]))['then'](respondWithResult(_0x2f7c45,null))[_0xbd8f('0xc')](handleError(_0x2f7c45,null));};exports[_0xbd8f('0x1c')]=function(_0x1f9fcc,_0x2f3df7){return respondWithRpcPromise(_0xbd8f('0x1d'),_0x1f9fcc[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x2f3df7,null))[_0xbd8f('0xc')](handleError(_0x2f3df7,null));};exports['showVoiceQueues']=function(_0x40cb43,_0x421f3e){return respondWithRpcPromise('VoiceQueues',_0x40cb43[_0xbd8f('0x15')])['then'](findById(_0x40cb43[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x421f3e,null))[_0xbd8f('0xc')](handleError(_0x421f3e,null));};exports[_0xbd8f('0x1e')]=function(_0x2aefa2,_0x247b07){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xbd8f('0x18')](_0x2aefa2[_0xbd8f('0x1f')],_0x2aefa2[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x247b07,null))[_0xbd8f('0xc')](handleError(_0x247b07,null));};exports[_0xbd8f('0x20')]=function(_0x2a4b32,_0x479a0c){return respondWithRpcPromise(_0xbd8f('0x21'),_[_0xbd8f('0x18')](_0x2a4b32[_0xbd8f('0x15')],_0x2a4b32[_0xbd8f('0x19')]))['then'](respondWithResult(_0x479a0c,null))['catch'](handleError(_0x479a0c,null));};exports[_0xbd8f('0x22')]=function(_0x3cdec2,_0x2fd6f8){return respondWithRpcPromise(_0xbd8f('0x23'),_0x3cdec2['query'])[_0xbd8f('0x7')](respondWithResult(_0x2fd6f8,null))[_0xbd8f('0xc')](handleError(_0x2fd6f8,null));};exports[_0xbd8f('0x24')]=function(_0x2137ed,_0x25ad9a){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xbd8f('0x18')](_0x2137ed[_0xbd8f('0x15')],_0x2137ed[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x25ad9a,null))[_0xbd8f('0xc')](handleError(_0x25ad9a,null));};exports['voiceQueuesChannelHangup']=function(_0x24e5f4,_0x5f404e){return respondWithRpcPromise(_0xbd8f('0x25'),_[_0xbd8f('0x18')](_0x24e5f4[_0xbd8f('0x15')],_0x24e5f4[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x5f404e,null))[_0xbd8f('0xc')](handleError(_0x5f404e,null));};exports['voiceQueuesChannelRedirect']=function(_0x4bafcd,_0x4c9a8d){return respondWithRpcPromise(_0xbd8f('0x26'),_[_0xbd8f('0x18')](_0x4bafcd[_0xbd8f('0x15')],_0x4bafcd[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x4c9a8d,null))[_0xbd8f('0xc')](handleError(_0x4c9a8d,null));};exports[_0xbd8f('0x27')]=function(_0x30c1c2,_0x2d4882){return respondWithRpcPromise(_0xbd8f('0x28'),_0x30c1c2[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x2d4882,null))[_0xbd8f('0xc')](handleError(_0x2d4882,null));};exports[_0xbd8f('0x29')]=function(_0x391d45,_0x50e081){return respondWithRpcPromise(_0xbd8f('0x2a'),_0x391d45[_0xbd8f('0x15')])['then'](respondWithResult(_0x50e081,null))[_0xbd8f('0xc')](handleError(_0x50e081,null));};exports[_0xbd8f('0x2b')]=function(_0x3d3902,_0x582bcf){var _0x21da54;return respondWithRpcPromise('Agents',_0x3d3902[_0xbd8f('0x15')])[_0xbd8f('0x7')](function(_0x298952){_0x21da54=_0x298952;return respondWithRpcPromise('Agents',_0x3d3902[_0xbd8f('0x15')],routingClient);})[_0xbd8f('0x7')](function(_0xdab323){return _['merge']({},_0xdab323,_0x21da54);})[_0xbd8f('0x7')](respondWithResult(_0x582bcf,null))[_0xbd8f('0xc')](handleError(_0x582bcf,null));};exports[_0xbd8f('0x2c')]=function(_0x351027,_0x280d95){if(_0x351027[_0xbd8f('0x1f')]&&_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')]&&_0x351027[_0xbd8f('0x2e')]&&_0x351027['user']['name']){for(var _0x2907a3 in _0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')]){if(_0x351027[_0xbd8f('0x1f')]['interaction'][_0xbd8f('0x2f')](_0x2907a3)){db[_0xbd8f('0x30')][_0xbd8f('0x31')]({'where':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x351027['body'][_0xbd8f('0x2d')][_0x2907a3]&&_0x351027['body'][_0xbd8f('0x2d')][_0x2907a3][_0xbd8f('0x32')]?{'$notIn':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3]}:{'$ne':null}}})[_0xbd8f('0x7')](function(_0x151f82){var _0x1ea49a=moment()[_0xbd8f('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x36c43f=0x0,_0x2fbbbe=_0x151f82[_0xbd8f('0x32')];_0x36c43f<_0x2fbbbe;_0x36c43f+=0x1){_0x151f82[_0x36c43f][_0xbd8f('0x34')]({'exitAt':_0x1ea49a});}});for(var _0x229bc0=0x0;_0x229bc0<_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3][_0xbd8f('0x32')];_0x229bc0+=0x1){db['MemberReport'][_0xbd8f('0x35')]({'where':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'type':_0xbd8f('0x36'),'uniqueid':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3][_0x229bc0],'exitAt':null},'defaults':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'interface':_[_0xbd8f('0x12')](_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x37')])?util[_0xbd8f('0x33')](_0xbd8f('0x38'),_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')]):_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x37')],'type':_0xbd8f('0x36'),'enterAt':moment()[_0xbd8f('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xbd8f('0x39'),'internal':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x3a')],'uniqueid':_0x351027[_0xbd8f('0x1f')]['interaction'][_0x2907a3][_0x229bc0]}});}}}}return respondWithRpcPromise(_0xbd8f('0x3b'),{'id':_0x351027['params']['id'],'capacity':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x3c')]},routingClient)[_0xbd8f('0x7')](respondWithResult(_0x280d95,null))[_0xbd8f('0xc')](handleError(_0x280d95,null));};exports['telephones']=function(_0x3964f5,_0x35b814){return respondWithRpcPromise(_0xbd8f('0x3d'),_0x3964f5[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x35b814,null))[_0xbd8f('0xc')](handleError(_0x35b814,null));};exports['trunks']=function(_0x42a597,_0x4a2da8){return respondWithRpcPromise(_0xbd8f('0x3e'),_0x42a597[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x4a2da8,null))[_0xbd8f('0xc')](handleError(_0x4a2da8,null));};exports[_0xbd8f('0x3f')]=function(_0x358424,_0x2a331d){return respondWithRpcPromise(_0xbd8f('0x40'),_0x358424[_0xbd8f('0x15')])['then'](respondWithResult(_0x2a331d,null))[_0xbd8f('0xc')](handleError(_0x2a331d,null));};exports['chatQueues']=function(_0xd09e5,_0xb04dae){return respondWithRpcPromise('ChatQueues',_0xd09e5[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0xb04dae,null))['catch'](handleError(_0xb04dae,null));};exports['showChatQueues']=function(_0x55de68,_0x4042e0){return respondWithRpcPromise(_0xbd8f('0x41'),_0x55de68[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x55de68[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x4042e0,null))['catch'](handleError(_0x4042e0,null));};exports[_0xbd8f('0x42')]=function(_0x3848cb,_0x21d40b){return respondWithRpcPromise(_0xbd8f('0x43'),_0x3848cb[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x21d40b,null))[_0xbd8f('0xc')](handleError(_0x21d40b,null));};exports['showMailQueues']=function(_0x9cf2d5,_0x40c834){return respondWithRpcPromise(_0xbd8f('0x43'),_0x9cf2d5['query'],routingClient)[_0xbd8f('0x7')](findById(_0x9cf2d5[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x40c834,null))[_0xbd8f('0xc')](handleError(_0x40c834,null));};exports['mailAccounts']=function(_0x5327f2,_0x388af8){return respondWithRpcPromise('MailAccounts',_0x5327f2[_0xbd8f('0x15')],mailClient)[_0xbd8f('0x7')](respondWithResult(_0x388af8,null))[_0xbd8f('0xc')](handleError(_0x388af8,null));};exports[_0xbd8f('0x44')]=function(_0x4a86a9,_0x5ea275){return respondWithRpcPromise(_0xbd8f('0x45'),_0x4a86a9[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5ea275,null))[_0xbd8f('0xc')](handleError(_0x5ea275,null));};exports[_0xbd8f('0x46')]=function(_0x21cad7,_0x31adfb){return respondWithRpcPromise(_0xbd8f('0x45'),_0x21cad7[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x21cad7[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x31adfb,null))[_0xbd8f('0xc')](handleError(_0x31adfb,null));};exports[_0xbd8f('0x47')]=function(_0x225ebd,_0x12ee82){return respondWithRpcPromise(_0xbd8f('0x48'),_0x225ebd[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x12ee82,null))[_0xbd8f('0xc')](handleError(_0x12ee82,null));};exports[_0xbd8f('0x49')]=function(_0x538fd7,_0x5e18fc){return respondWithRpcPromise(_0xbd8f('0x48'),_0x538fd7[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x538fd7['params']['id']))['then'](respondWithResult(_0x5e18fc,null))[_0xbd8f('0xc')](handleError(_0x5e18fc,null));};exports['whatsappQueues']=function(_0x565e63,_0x5b5bd8){return respondWithRpcPromise('WhatsappQueues',_0x565e63['query'],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5b5bd8,null))['catch'](handleError(_0x5b5bd8,null));};exports[_0xbd8f('0x4a')]=function(_0x400aac,_0x53f297){return respondWithRpcPromise(_0xbd8f('0x4b'),_0x400aac[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x400aac[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x53f297,null))['catch'](handleError(_0x53f297,null));};exports['faxQueues']=function(_0x378e72,_0x44469e){return respondWithRpcPromise(_0xbd8f('0x4c'),_0x378e72[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x44469e,null))[_0xbd8f('0xc')](handleError(_0x44469e,null));};exports['showFaxQueues']=function(_0x4eddf2,_0x467b0f){return respondWithRpcPromise(_0xbd8f('0x4c'),_0x4eddf2['query'],routingClient)[_0xbd8f('0x7')](findById(_0x4eddf2[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x467b0f,null))[_0xbd8f('0xc')](handleError(_0x467b0f,null));};exports[_0xbd8f('0x4d')]=function(_0x10268a,_0x5a8c8f){return respondWithRpcPromise('FaxAccounts',_0x10268a[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x5a8c8f,null))[_0xbd8f('0xc')](handleError(_0x5a8c8f,null));};exports[_0xbd8f('0x4e')]=function(_0x41be86,_0x5b900c){return respondWithRpcPromise(_0xbd8f('0x4f'),_0x41be86[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5b900c,null))[_0xbd8f('0xc')](handleError(_0x5b900c,null));};exports[_0xbd8f('0x50')]=function(_0x3574a6,_0x2a7eaa){return respondWithRpcPromise(_0xbd8f('0x51'),_0x3574a6[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x2a7eaa,null))[_0xbd8f('0xc')](handleError(_0x2a7eaa,null));};exports[_0xbd8f('0x52')]=function(_0x34eec5,_0x40fc53){return respondWithRpcPromise(_0xbd8f('0x53'),_0x34eec5[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x40fc53,null))[_0xbd8f('0xc')](handleError(_0x40fc53,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x38d98e,_0x2957fd){return respondWithRpcPromise(_0xbd8f('0x53'),_0x38d98e[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](function(_0x18ccf2){if(_0x38d98e['query']['type']!==undefined){var _0x2a3982=_(_0x18ccf2[_0xbd8f('0x14')])['filter']([_0x38d98e[_0xbd8f('0x15')]['type'],_0x38d98e[_0xbd8f('0x19')]['id']])[_0xbd8f('0x54')](_0xbd8f('0x55'))[_0xbd8f('0x56')]()['value']();return _0x18ccf2[_0xbd8f('0x14')][_0xbd8f('0x57')](function(_0x84e98d){return _0x2a3982['indexOf'](_0x84e98d[_0xbd8f('0x55')])>-0x1;});}else{return _0x18ccf2[_0xbd8f('0x14')][_0xbd8f('0x57')](function(_0x161ec8){return _0x161ec8['queue_id']===parseInt(_0x38d98e[_0xbd8f('0x19')]['id']);});}})[_0xbd8f('0x7')](respondWithResult(_0x2957fd,null))[_0xbd8f('0xc')](handleError(_0x2957fd,null));};exports[_0xbd8f('0x58')]=function(_0x18645e,_0x23e962){return respondWithRpcPromise(_0xbd8f('0x59'),_0x18645e[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x23e962,null))[_0xbd8f('0xc')](handleError(_0x23e962,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3da31b,_0x4e908d){return respondWithRpcPromise(_0xbd8f('0x5a'),_0x3da31b[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x4e908d,null))[_0xbd8f('0xc')](handleError(_0x4e908d,null));};exports[_0xbd8f('0x5b')]=function(_0x60cd2b,_0x2ab853){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x60cd2b[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x2ab853,null))[_0xbd8f('0xc')](handleError(_0x2ab853,null));};exports[_0xbd8f('0x5c')]=function(_0x58651d){return function(_0x4e19ec,_0x2fb942){var _0x3641e9,_0x1f685d;var _0x2acd13=_[_0xbd8f('0x5d')](_0x58651d);var _0x53076d=_0x58651d===_0xbd8f('0x5e')?_0xbd8f('0x5f'):_0xbd8f('0x60');return db[_0x2acd13+_0xbd8f('0x61')][_0xbd8f('0x62')]({'raw':!![],'where':{'id':_0x4e19ec['params']['id']}})['then'](function(_0x542075){if(_[_0xbd8f('0x12')](_0x542075)){throw new Error(_0x2acd13+'\x20Queue\x20not\x20found');}_0x3641e9=_0x542075;return db[_0x2acd13+'Message']['findOne']({'where':{'id':_0x4e19ec[_0xbd8f('0x1f')][_0xbd8f('0x63')]},'include':[{'model':db[_0x2acd13+_0xbd8f('0x64')],'as':_0xbd8f('0x64')},{'model':db[_0x2acd13+_0x53076d],'as':_0xbd8f('0x60')}]});})[_0xbd8f('0x7')](function(_0xefcfc1){if(_[_0xbd8f('0x12')](_0xefcfc1)){throw new Error(_0x2acd13+'\x20Message\x20not\x20found');}_0x1f685d=_0xefcfc1;return _0xefcfc1[_0xbd8f('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd8f('0x7')](function(){var _0x3caa98={'uniqueid':_0x58651d+'.'+_0x1f685d['id']+'.'+_0x1f685d['Interaction']['id'],'FromUserId':_0x4e19ec[_0xbd8f('0x2e')]['id'],'type':_0xbd8f('0x66')};_0x3caa98[_0x2acd13+_0xbd8f('0x67')]=_0x1f685d['id'];_0x3caa98[_0x2acd13+_0xbd8f('0x68')]=_0x1f685d[_0xbd8f('0x64')]['id'];_0x3caa98[_0xbd8f('0x69')+_0x2acd13+_0x53076d+'Id']=_0x1f685d[_0xbd8f('0x60')]['id'];_0x3caa98['To'+_0x2acd13+_0xbd8f('0x6a')]=_0x3641e9['id'];return db[_0x2acd13+_0xbd8f('0x6b')][_0xbd8f('0x6c')](_0x3caa98);})['then'](function(){return respondWithRpcPromise(_0xbd8f('0x6d'),{'channel':_0x58651d,'interaction':_0x1f685d[_0xbd8f('0x64')],'message':_0x1f685d,'account':_0x1f685d[_0xbd8f('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3641e9[_0xbd8f('0x11')]+','+(_0x1f685d['Account'][_0xbd8f('0x6e')]||0x12c),'interval':_0xbd8f('0x6f')}]},routingClient);})[_0xbd8f('0x7')](respondWithResult(_0x2fb942,null))[_0xbd8f('0xc')](handleError(_0x2fb942,null));};};exports[_0xbd8f('0x70')]=function(_0x57762c,_0xe58b64){var _0x198d4b,_0x60c94c;if(_[_0xbd8f('0x12')](_0x57762c[_0xbd8f('0x1f')][_0xbd8f('0x71')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x672cfb=_0x57762c[_0xbd8f('0x1f')]['channel'];var _0x49e15e=_[_0xbd8f('0x5d')](_0x672cfb);var _0x5b0716=_0x672cfb==='chat'?'Website':_0xbd8f('0x60');return db[_0xbd8f('0x72')][_0xbd8f('0x62')]({'raw':!![],'where':{'id':_0x57762c[_0xbd8f('0x19')]['id'],'role':'agent'}})[_0xbd8f('0x7')](function(_0x398cc9){if(_['isNil'](_0x398cc9)){throw new Error('Agent\x20not\x20found');}_0x198d4b=_0x398cc9;return db[_0x49e15e+_0xbd8f('0x73')]['findOne']({'where':{'id':_0x57762c[_0xbd8f('0x1f')]['messageId']},'include':[{'model':db[_0x49e15e+'Interaction'],'as':_0xbd8f('0x64')},{'model':db[_0x49e15e+_0x5b0716],'as':_0xbd8f('0x60')}]});})[_0xbd8f('0x7')](function(_0x18e9f0){if(_[_0xbd8f('0x12')](_0x18e9f0)){throw new Error(_0x49e15e+'\x20Message\x20not\x20found');}_0x60c94c=_0x18e9f0;return _0x18e9f0[_0xbd8f('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd8f('0x7')](function(){var _0x3a6ec4={'uniqueid':_0x672cfb+'.'+_0x60c94c['id']+'.'+_0x60c94c['Interaction']['id'],'FromUserId':_0x57762c[_0xbd8f('0x2e')]['id'],'type':_0xbd8f('0x66'),'ToUserId':_0x198d4b['id']};_0x3a6ec4[_0x49e15e+_0xbd8f('0x67')]=_0x60c94c['id'];_0x3a6ec4[_0x49e15e+_0xbd8f('0x68')]=_0x60c94c[_0xbd8f('0x64')]['id'];_0x3a6ec4[_0xbd8f('0x69')+_0x49e15e+_0x5b0716+'Id']=_0x60c94c[_0xbd8f('0x60')]['id'];return db[_0x49e15e+_0xbd8f('0x6b')][_0xbd8f('0x6c')](_0x3a6ec4);})[_0xbd8f('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x672cfb,'interaction':_0x60c94c['Interaction'],'message':_0x60c94c,'account':_0x60c94c['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x198d4b[_0xbd8f('0x11')]+','+(_0x60c94c[_0xbd8f('0x60')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0xe58b64,null))['catch'](handleError(_0xe58b64,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f2f96a2..8f8f319 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 _0x67d3=['path','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/run','run','post','create','/:id','destroy','exports','multer','util'];(function(_0x3fe2af,_0x144df2){var _0x213c7a=function(_0x9e3b07){while(--_0x9e3b07){_0x3fe2af['push'](_0x3fe2af['shift']());}};_0x213c7a(++_0x144df2);}(_0x67d3,0x12e));var _0x367d=function(_0x1f2509,_0x49520e){_0x1f2509=_0x1f2509-0x0;var _0x2ba954=_0x67d3[_0x1f2509];return _0x2ba954;};'use strict';var multer=require(_0x367d('0x0'));var util=require(_0x367d('0x1'));var path=require(_0x367d('0x2'));var timeout=require('connect-timeout');var express=require(_0x367d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x367d('0x4'));var interaction=require(_0x367d('0x5'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x367d('0x6')]('/',auth[_0x367d('0x7')](),controller[_0x367d('0x8')]);router[_0x367d('0x6')]('/:id',auth[_0x367d('0x7')](),controller['show']);router[_0x367d('0x6')](_0x367d('0x9'),auth[_0x367d('0x7')](),controller[_0x367d('0xa')]);router[_0x367d('0xb')]('/',auth['isAuthenticated'](),controller[_0x367d('0xc')]);router['put']('/:id',auth[_0x367d('0x7')](),controller['update']);router['delete'](_0x367d('0xd'),auth['isAuthenticated'](),controller[_0x367d('0xe')]);module[_0x367d('0xf')]=router; \ No newline at end of file +var _0xad2a=['index','/:id','show','run','create','put','delete','exports','multer','util','path','connect-timeout','Router','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0xfa5587,_0x487e0a){var _0x3fb885=function(_0x339add){while(--_0x339add){_0xfa5587['push'](_0xfa5587['shift']());}};_0x3fb885(++_0x487e0a);}(_0xad2a,0x107));var _0xaad2=function(_0x309b8d,_0x2fbc5a){_0x309b8d=_0x309b8d-0x0;var _0xcfebf7=_0xad2a[_0x309b8d];return _0xcfebf7;};'use strict';var multer=require(_0xaad2('0x0'));var util=require(_0xaad2('0x1'));var path=require(_0xaad2('0x2'));var timeout=require(_0xaad2('0x3'));var express=require('express');var router=express[_0xaad2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaad2('0x5'));var controller=require(_0xaad2('0x6'));router[_0xaad2('0x7')]('/',auth[_0xaad2('0x8')](),controller[_0xaad2('0x9')]);router['get'](_0xaad2('0xa'),auth[_0xaad2('0x8')](),controller[_0xaad2('0xb')]);router[_0xaad2('0x7')]('/:id/run',auth[_0xaad2('0x8')](),controller[_0xaad2('0xc')]);router['post']('/',auth[_0xaad2('0x8')](),controller[_0xaad2('0xd')]);router[_0xaad2('0xe')]('/:id',auth[_0xaad2('0x8')](),controller['update']);router[_0xaad2('0xf')](_0xaad2('0xa'),auth[_0xaad2('0x8')](),controller['destroy']);module[_0xaad2('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 71ea8e1..db3a9f3 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 _0x254c=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','weeks','days','hours','pdf','csv','default','custom','BOOLEAN','TEXT','sequelize','STRING'];(function(_0xd86a22,_0x58034d){var _0x2cc68b=function(_0x16171e){while(--_0x16171e){_0xd86a22['push'](_0xd86a22['shift']());}};_0x2cc68b(++_0x58034d);}(_0x254c,0xdb));var _0xc254=function(_0x56cdf8,_0x58e7b9){_0x56cdf8=_0x56cdf8-0x0;var _0x35da11=_0x254c[_0x56cdf8];return _0x35da11;};'use strict';var Sequelize=require(_0xc254('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc254('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc254('0x1')],'allowNull':![],'defaultValue':_0xc254('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xc254('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc254('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xc254('0x5')](_0xc254('0x6'),'quarters',_0xc254('0x7'),_0xc254('0x8'),_0xc254('0x9'),_0xc254('0xa'),'minutes'),'allowNull':![],'defaultValue':_0xc254('0x9')},'output':{'type':Sequelize[_0xc254('0x5')]('csv',_0xc254('0xb'),'xlsx'),'allowNull':![],'defaultValue':_0xc254('0xc')},'type':{'type':Sequelize[_0xc254('0x5')]('custom',_0xc254('0xd')),'allowNull':![],'defaultValue':_0xc254('0xe')},'sendMail':{'type':Sequelize[_0xc254('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0xc254('0x1')]},'cc':{'type':Sequelize[_0xc254('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xc254('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0x83e4=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','weeks','hours','minutes','days','csv','xlsx','custom','default','TEXT','exports','STRING'];(function(_0xf1402a,_0x187f5c){var _0x4f7ead=function(_0x57dfd9){while(--_0x57dfd9){_0xf1402a['push'](_0xf1402a['shift']());}};_0x4f7ead(++_0x187f5c);}(_0x83e4,0x19c));var _0x483e=function(_0xd562d1,_0x1e27e1){_0xd562d1=_0xd562d1-0x0;var _0x48d63b=_0x83e4[_0xd562d1];return _0x48d63b;};'use strict';var Sequelize=require('sequelize');module[_0x483e('0x0')]={'name':{'type':Sequelize[_0x483e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x483e('0x1')]},'active':{'type':Sequelize[_0x483e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x483e('0x1')],'allowNull':![],'defaultValue':_0x483e('0x3')},'startAt':{'type':Sequelize[_0x483e('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x483e('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x483e('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x483e('0x6')](_0x483e('0x7'),'quarters',_0x483e('0x8'),_0x483e('0x9'),'days',_0x483e('0xa'),_0x483e('0xb')),'allowNull':![],'defaultValue':_0x483e('0xc')},'output':{'type':Sequelize[_0x483e('0x6')](_0x483e('0xd'),'pdf',_0x483e('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x483e('0xf'),_0x483e('0x10')),'allowNull':![],'defaultValue':_0x483e('0xf')},'sendMail':{'type':Sequelize[_0x483e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x483e('0x1')]},'cc':{'type':Sequelize[_0x483e('0x11')]},'bcc':{'type':Sequelize[_0x483e('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x483e('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 1a668d2..c6f88ef 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 _0x493a=['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/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','find','autoAssociation','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs'];(function(_0x5f1863,_0x12fa59){var _0x365402=function(_0x45abf7){while(--_0x45abf7){_0x5f1863['push'](_0x5f1863['shift']());}};_0x365402(++_0x12fa59);}(_0x493a,0x9b));var _0xa493=function(_0xa5d9f9,_0x17c6bf){_0xa5d9f9=_0xa5d9f9-0x0;var _0x40e9f6=_0x493a[_0xa5d9f9];return _0x40e9f6;};'use strict';var emlformat=require(_0xa493('0x0'));var rimraf=require(_0xa493('0x1'));var zipdir=require(_0xa493('0x2'));var jsonpatch=require(_0xa493('0x3'));var rp=require(_0xa493('0x4'));var moment=require(_0xa493('0x5'));var BPromise=require(_0xa493('0x6'));var Mustache=require('mustache');var util=require(_0xa493('0x7'));var path=require(_0xa493('0x8'));var sox=require('sox');var csv=require(_0xa493('0x9'));var ejs=require(_0xa493('0xa'));var fs=require('fs');var fs_extra=require(_0xa493('0xb'));var _=require(_0xa493('0xc'));var squel=require('squel');var crypto=require(_0xa493('0xd'));var jsforce=require(_0xa493('0xe'));var deskjs=require(_0xa493('0xf'));var toCsv=require(_0xa493('0x9'));var querystring=require(_0xa493('0x10'));var Papa=require(_0xa493('0x11'));var Redis=require(_0xa493('0x12'));var authService=require(_0xa493('0x13'));var qs=require(_0xa493('0x14'));var as=require(_0xa493('0x15'));var hardwareService=require(_0xa493('0x16'));var logger=require(_0xa493('0x17'))(_0xa493('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa493('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf76776,_0x2540ba){_0x2540ba=_0x2540ba||0xcc;return function(_0x9a5c67){if(_0x9a5c67){return _0xf76776['sendStatus'](_0x2540ba);}return _0xf76776['status'](_0x2540ba)[_0xa493('0x1a')]();};}function respondWithResult(_0x23933d,_0x22c40d){_0x22c40d=_0x22c40d||0xc8;return function(_0x1b87cd){if(_0x1b87cd){return _0x23933d[_0xa493('0x1b')](_0x22c40d)[_0xa493('0x1c')](_0x1b87cd);}};}function respondWithFilteredResult(_0x377918,_0x5ecb96){return function(_0x130728){if(_0x130728){var _0x3e0374=typeof _0x5ecb96['offset']===_0xa493('0x1d')&&typeof _0x5ecb96[_0xa493('0x1e')]===_0xa493('0x1d');var _0xff54c6=_0x130728[_0xa493('0x1f')];var _0x1de471=_0x3e0374?0x0:_0x5ecb96[_0xa493('0x20')];var _0x5233af=_0x3e0374?_0x130728['count']:_0x5ecb96[_0xa493('0x20')]+_0x5ecb96['limit'];var _0x5c462b;if(_0x5233af>=_0xff54c6){_0x5233af=_0xff54c6;_0x5c462b=0xc8;}else{_0x5c462b=0xce;}_0x377918[_0xa493('0x1b')](_0x5c462b);return _0x377918[_0xa493('0x21')](_0xa493('0x22'),_0x1de471+'-'+_0x5233af+'/'+_0xff54c6)[_0xa493('0x1c')](_0x130728);}return null;};}function patchUpdates(_0x5b53f0){return function(_0x16d234){try{jsonpatch[_0xa493('0x23')](_0x16d234,_0x5b53f0,!![]);}catch(_0x256d59){return BPromise['reject'](_0x256d59);}return _0x16d234[_0xa493('0x24')]();};}function saveUpdates(_0x1e3a59,_0x3bba97){return function(_0x2b941b){if(_0x2b941b){return _0x2b941b[_0xa493('0x25')](_0x1e3a59)[_0xa493('0x26')](function(_0x41b5f6){return _0x41b5f6;});}return null;};}function removeEntity(_0x19339a,_0x14ca8d){return function(_0x597ed0){if(_0x597ed0){return _0x597ed0[_0xa493('0x27')]()[_0xa493('0x26')](function(){var _0x374343=_0x597ed0[_0xa493('0x28')]({'plain':!![]});var _0x31233b='Scheduler';return db[_0xa493('0x29')]['destroy']({'where':{'type':_0x31233b,'resourceId':_0x374343['id']}})[_0xa493('0x26')](function(){return _0x597ed0;});})['then'](function(){_0x19339a[_0xa493('0x1b')](0xcc)[_0xa493('0x1a')]();});}};}function handleEntityNotFound(_0x4c2d26,_0xd4a230){return function(_0x168a2a){if(!_0x168a2a){_0x4c2d26['sendStatus'](0x194);}return _0x168a2a;};}function handleError(_0x20416e,_0x592322){_0x592322=_0x592322||0x1f4;return function(_0x400ab1){logger[_0xa493('0x2a')](_0x400ab1[_0xa493('0x2b')]);if(_0x400ab1[_0xa493('0x2c')]){delete _0x400ab1[_0xa493('0x2c')];}_0x20416e[_0xa493('0x1b')](_0x592322)[_0xa493('0x2d')](_0x400ab1);};}exports[_0xa493('0x2e')]=function(_0x52bf11,_0x525545){var _0x86aa5a={},_0x5c7985={},_0x486ef6={'count':0x0,'rows':[]};var _0x119fa1=_[_0xa493('0x2f')](db[_0xa493('0x30')][_0xa493('0x31')],function(_0x5c6fd3){return{'name':_0x5c6fd3['fieldName'],'type':_0x5c6fd3['type'][_0xa493('0x32')]};});_0x5c7985['model']=_[_0xa493('0x2f')](_0x119fa1,_0xa493('0x2c'));_0x5c7985[_0xa493('0x33')]=_['keys'](_0x52bf11['query']);_0x5c7985[_0xa493('0x34')]=_[_0xa493('0x35')](_0x5c7985[_0xa493('0x36')],_0x5c7985[_0xa493('0x33')]);_0x86aa5a[_0xa493('0x37')]=_[_0xa493('0x35')](_0x5c7985['model'],qs[_0xa493('0x38')](_0x52bf11[_0xa493('0x33')][_0xa493('0x38')]));_0x86aa5a[_0xa493('0x37')]=_0x86aa5a[_0xa493('0x37')]['length']?_0x86aa5a[_0xa493('0x37')]:_0x5c7985[_0xa493('0x36')];if(!_0x52bf11[_0xa493('0x33')][_0xa493('0x39')](_0xa493('0x3a'))){_0x86aa5a[_0xa493('0x1e')]=qs[_0xa493('0x1e')](_0x52bf11['query']['limit']);_0x86aa5a[_0xa493('0x20')]=qs[_0xa493('0x20')](_0x52bf11['query'][_0xa493('0x20')]);}_0x86aa5a[_0xa493('0x3b')]=qs['sort'](_0x52bf11[_0xa493('0x33')]['sort']);_0x86aa5a[_0xa493('0x3c')]=qs[_0xa493('0x34')](_[_0xa493('0x3d')](_0x52bf11['query'],_0x5c7985[_0xa493('0x34')]),_0x119fa1);if(_0x52bf11[_0xa493('0x33')][_0xa493('0x3e')]){_0x86aa5a['where']=_[_0xa493('0x3f')](_0x86aa5a[_0xa493('0x3c')],{'$or':_[_0xa493('0x2f')](_0x119fa1,function(_0x55d2a2){if(_0x55d2a2['type']!=='VIRTUAL'){var _0x1f647b={};_0x1f647b[_0x55d2a2[_0xa493('0x2c')]]={'$like':'%'+_0x52bf11[_0xa493('0x33')][_0xa493('0x3e')]+'%'};return _0x1f647b;}})});}_0x86aa5a=_['merge']({},_0x86aa5a,_0x52bf11[_0xa493('0x40')]);var _0x32913c={'where':_0x86aa5a[_0xa493('0x3c')]};return db[_0xa493('0x30')]['count'](_0x32913c)['then'](function(_0x289f47){_0x486ef6['count']=_0x289f47;if(_0x52bf11[_0xa493('0x33')][_0xa493('0x41')]){_0x86aa5a['include']=[{'all':!![]}];}return db[_0xa493('0x30')][_0xa493('0x42')](_0x86aa5a);})[_0xa493('0x26')](function(_0x231d35){_0x486ef6[_0xa493('0x43')]=_0x231d35;return _0x486ef6;})[_0xa493('0x26')](respondWithFilteredResult(_0x525545,_0x86aa5a))[_0xa493('0x44')](handleError(_0x525545,null));};exports[_0xa493('0x45')]=function(_0xa30061,_0x117b38){var _0x28a6f1={'raw':![],'where':{'id':_0xa30061[_0xa493('0x46')]['id']}},_0x4d672c={};_0x4d672c[_0xa493('0x36')]=_[_0xa493('0x47')](db[_0xa493('0x30')]['rawAttributes']);_0x4d672c[_0xa493('0x33')]=_[_0xa493('0x47')](_0xa30061['query']);_0x4d672c[_0xa493('0x34')]=_[_0xa493('0x35')](_0x4d672c['model'],_0x4d672c[_0xa493('0x33')]);_0x28a6f1['attributes']=_[_0xa493('0x35')](_0x4d672c['model'],qs[_0xa493('0x38')](_0xa30061[_0xa493('0x33')][_0xa493('0x38')]));_0x28a6f1[_0xa493('0x37')]=_0x28a6f1[_0xa493('0x37')]['length']?_0x28a6f1[_0xa493('0x37')]:_0x4d672c['model'];if(_0xa30061[_0xa493('0x33')]['includeAll']){_0x28a6f1['include']=[{'all':!![]}];}_0x28a6f1=_[_0xa493('0x3f')]({},_0x28a6f1,_0xa30061[_0xa493('0x40')]);return db[_0xa493('0x30')]['find'](_0x28a6f1)[_0xa493('0x26')](handleEntityNotFound(_0x117b38,null))['then'](respondWithResult(_0x117b38,null))[_0xa493('0x44')](handleError(_0x117b38,null));};exports[_0xa493('0x48')]=function(_0x53b73f,_0x3cd3b7){return db['Schedule'][_0xa493('0x48')](_0x53b73f[_0xa493('0x49')],{})[_0xa493('0x26')](function(_0x30c723){var _0x577a2a=_0x53b73f[_0xa493('0x4a')]['get']({'plain':!![]});if(!_0x577a2a)throw new Error(_0xa493('0x4b'));if(_0x577a2a[_0xa493('0x4c')]==='user'){var _0x2a9c31=_0x30c723[_0xa493('0x28')]({'plain':!![]});var _0xbe14fb=_0xa493('0x4d');return db[_0xa493('0x4e')][_0xa493('0x4f')]({'where':{'name':_0xbe14fb,'userProfileId':_0x577a2a['userProfileId']},'raw':!![]})['then'](function(_0xc3903){if(_0xc3903&&_0xc3903[_0xa493('0x50')]===0x0){return db[_0xa493('0x29')][_0xa493('0x48')]({'name':_0x2a9c31[_0xa493('0x2c')],'resourceId':_0x2a9c31['id'],'type':_0xc3903[_0xa493('0x2c')],'sectionId':_0xc3903['id']},{})['then'](function(){return _0x30c723;});}else{return _0x30c723;}})[_0xa493('0x44')](function(_0x3509e0){logger[_0xa493('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3509e0);throw _0x3509e0;});}return _0x30c723;})[_0xa493('0x26')](respondWithResult(_0x3cd3b7,0xc9))[_0xa493('0x44')](handleError(_0x3cd3b7,null));};exports[_0xa493('0x25')]=function(_0x1caebf,_0x29dc78){if(_0x1caebf[_0xa493('0x49')]['id']){delete _0x1caebf['body']['id'];}return db[_0xa493('0x30')][_0xa493('0x4f')]({'where':{'id':_0x1caebf[_0xa493('0x46')]['id']}})[_0xa493('0x26')](handleEntityNotFound(_0x29dc78,null))[_0xa493('0x26')](saveUpdates(_0x1caebf[_0xa493('0x49')],null))['then'](respondWithResult(_0x29dc78,null))[_0xa493('0x44')](handleError(_0x29dc78,null));};exports[_0xa493('0x27')]=function(_0x5864cc,_0x1c1faf){return db[_0xa493('0x30')]['find']({'where':{'id':_0x5864cc[_0xa493('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c1faf,null))[_0xa493('0x26')](removeEntity(_0x1c1faf,null))['catch'](handleError(_0x1c1faf,null));};exports[_0xa493('0x51')]=function(_0x26c862,_0x469edd,_0x1b2e53){var _0x291b2f=require(_0xa493('0x52'));return db[_0xa493('0x30')][_0xa493('0x4f')]({'where':{'id':_0x26c862['params']['id']},'raw':!![]})[_0xa493('0x26')](handleEntityNotFound(_0x469edd,null))[_0xa493('0x26')](function(){_0x291b2f[_0xa493('0x51')](_0x26c862[_0xa493('0x46')]['id']);})[_0xa493('0x26')](respondWithStatusCode(_0x469edd,null))[_0xa493('0x44')](handleError(_0x469edd,null));}; \ No newline at end of file +var _0xf3bd=['map','Schedule','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','fields','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','get','Scheduler','UserProfileResource','destroy','sendStatus','stack','name','send','index'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xf3bd,0xd6));var _0xdf3b=function(_0x3fe635,_0x2fd398){_0x3fe635=_0x3fe635-0x0;var _0xacf2f7=_0xf3bd[_0x3fe635];return _0xacf2f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf3b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf3b('0x1'));var rp=require('request-promise');var moment=require(_0xdf3b('0x2'));var BPromise=require(_0xdf3b('0x3'));var Mustache=require(_0xdf3b('0x4'));var util=require('util');var path=require(_0xdf3b('0x5'));var sox=require(_0xdf3b('0x6'));var csv=require(_0xdf3b('0x7'));var ejs=require(_0xdf3b('0x8'));var fs=require('fs');var fs_extra=require(_0xdf3b('0x9'));var _=require(_0xdf3b('0xa'));var squel=require(_0xdf3b('0xb'));var crypto=require(_0xdf3b('0xc'));var jsforce=require(_0xdf3b('0xd'));var deskjs=require(_0xdf3b('0xe'));var toCsv=require(_0xdf3b('0x7'));var querystring=require(_0xdf3b('0xf'));var Papa=require(_0xdf3b('0x10'));var Redis=require('ioredis');var authService=require(_0xdf3b('0x11'));var qs=require(_0xdf3b('0x12'));var as=require(_0xdf3b('0x13'));var hardwareService=require(_0xdf3b('0x14'));var logger=require(_0xdf3b('0x15'))(_0xdf3b('0x16'));var utils=require('../../config/utils');var config=require(_0xdf3b('0x17'));var licenseUtil=require(_0xdf3b('0x18'));var db=require(_0xdf3b('0x19'))['db'];function respondWithStatusCode(_0x2fbfc5,_0x5b4a38){_0x5b4a38=_0x5b4a38||0xcc;return function(_0x12e361){if(_0x12e361){return _0x2fbfc5['sendStatus'](_0x5b4a38);}return _0x2fbfc5['status'](_0x5b4a38)[_0xdf3b('0x1a')]();};}function respondWithResult(_0x1c4717,_0xcac007){_0xcac007=_0xcac007||0xc8;return function(_0x20a2a7){if(_0x20a2a7){return _0x1c4717[_0xdf3b('0x1b')](_0xcac007)[_0xdf3b('0x1c')](_0x20a2a7);}};}function respondWithFilteredResult(_0xb2dc9b,_0x3d80a1){return function(_0x22ce69){if(_0x22ce69){var _0x48e772=typeof _0x3d80a1[_0xdf3b('0x1d')]===_0xdf3b('0x1e')&&typeof _0x3d80a1['limit']===_0xdf3b('0x1e');var _0x2e563d=_0x22ce69['count'];var _0x4a5a29=_0x48e772?0x0:_0x3d80a1['offset'];var _0xcdf8a2=_0x48e772?_0x22ce69[_0xdf3b('0x1f')]:_0x3d80a1[_0xdf3b('0x1d')]+_0x3d80a1[_0xdf3b('0x20')];var _0x496591;if(_0xcdf8a2>=_0x2e563d){_0xcdf8a2=_0x2e563d;_0x496591=0xc8;}else{_0x496591=0xce;}_0xb2dc9b[_0xdf3b('0x1b')](_0x496591);return _0xb2dc9b[_0xdf3b('0x21')]('Content-Range',_0x4a5a29+'-'+_0xcdf8a2+'/'+_0x2e563d)['json'](_0x22ce69);}return null;};}function patchUpdates(_0x1041b1){return function(_0x24cc0a){try{jsonpatch[_0xdf3b('0x22')](_0x24cc0a,_0x1041b1,!![]);}catch(_0x3acf3f){return BPromise['reject'](_0x3acf3f);}return _0x24cc0a[_0xdf3b('0x23')]();};}function saveUpdates(_0x3a8897,_0x5064f4){return function(_0x5e6572){if(_0x5e6572){return _0x5e6572[_0xdf3b('0x24')](_0x3a8897)[_0xdf3b('0x25')](function(_0x392810){return _0x392810;});}return null;};}function removeEntity(_0x14078d,_0x3bd216){return function(_0x16f0ed){if(_0x16f0ed){return _0x16f0ed['destroy']()[_0xdf3b('0x25')](function(){var _0x406503=_0x16f0ed[_0xdf3b('0x26')]({'plain':!![]});var _0x295c7a=_0xdf3b('0x27');return db[_0xdf3b('0x28')][_0xdf3b('0x29')]({'where':{'type':_0x295c7a,'resourceId':_0x406503['id']}})[_0xdf3b('0x25')](function(){return _0x16f0ed;});})['then'](function(){_0x14078d[_0xdf3b('0x1b')](0xcc)[_0xdf3b('0x1a')]();});}};}function handleEntityNotFound(_0x30456e,_0x1f6271){return function(_0x354017){if(!_0x354017){_0x30456e[_0xdf3b('0x2a')](0x194);}return _0x354017;};}function handleError(_0x2dc9f8,_0x236600){_0x236600=_0x236600||0x1f4;return function(_0x185992){logger['error'](_0x185992[_0xdf3b('0x2b')]);if(_0x185992[_0xdf3b('0x2c')]){delete _0x185992[_0xdf3b('0x2c')];}_0x2dc9f8[_0xdf3b('0x1b')](_0x236600)[_0xdf3b('0x2d')](_0x185992);};}exports[_0xdf3b('0x2e')]=function(_0x343989,_0x41fa71){var _0x1547f4={},_0x5c65d5={},_0x28f6c0={'count':0x0,'rows':[]};var _0x377590=_[_0xdf3b('0x2f')](db[_0xdf3b('0x30')]['rawAttributes'],function(_0x40d1f3){return{'name':_0x40d1f3[_0xdf3b('0x31')],'type':_0x40d1f3[_0xdf3b('0x32')][_0xdf3b('0x33')]};});_0x5c65d5[_0xdf3b('0x34')]=_[_0xdf3b('0x2f')](_0x377590,_0xdf3b('0x2c'));_0x5c65d5[_0xdf3b('0x35')]=_['keys'](_0x343989[_0xdf3b('0x35')]);_0x5c65d5[_0xdf3b('0x36')]=_[_0xdf3b('0x37')](_0x5c65d5['model'],_0x5c65d5[_0xdf3b('0x35')]);_0x1547f4['attributes']=_['intersection'](_0x5c65d5['model'],qs['fields'](_0x343989[_0xdf3b('0x35')]['fields']));_0x1547f4['attributes']=_0x1547f4[_0xdf3b('0x38')][_0xdf3b('0x39')]?_0x1547f4[_0xdf3b('0x38')]:_0x5c65d5[_0xdf3b('0x34')];if(!_0x343989['query'][_0xdf3b('0x3a')]('nolimit')){_0x1547f4['limit']=qs['limit'](_0x343989[_0xdf3b('0x35')]['limit']);_0x1547f4[_0xdf3b('0x1d')]=qs[_0xdf3b('0x1d')](_0x343989[_0xdf3b('0x35')][_0xdf3b('0x1d')]);}_0x1547f4[_0xdf3b('0x3b')]=qs['sort'](_0x343989[_0xdf3b('0x35')][_0xdf3b('0x3c')]);_0x1547f4[_0xdf3b('0x3d')]=qs[_0xdf3b('0x36')](_[_0xdf3b('0x3e')](_0x343989[_0xdf3b('0x35')],_0x5c65d5[_0xdf3b('0x36')]),_0x377590);if(_0x343989[_0xdf3b('0x35')][_0xdf3b('0x3f')]){_0x1547f4['where']=_[_0xdf3b('0x40')](_0x1547f4[_0xdf3b('0x3d')],{'$or':_['map'](_0x377590,function(_0x1b0420){if(_0x1b0420['type']!==_0xdf3b('0x41')){var _0x45cbe7={};_0x45cbe7[_0x1b0420[_0xdf3b('0x2c')]]={'$like':'%'+_0x343989['query'][_0xdf3b('0x3f')]+'%'};return _0x45cbe7;}})});}_0x1547f4=_[_0xdf3b('0x40')]({},_0x1547f4,_0x343989[_0xdf3b('0x42')]);var _0x258a75={'where':_0x1547f4[_0xdf3b('0x3d')]};return db[_0xdf3b('0x30')][_0xdf3b('0x1f')](_0x258a75)['then'](function(_0x4ac1fa){_0x28f6c0[_0xdf3b('0x1f')]=_0x4ac1fa;if(_0x343989['query'][_0xdf3b('0x43')]){_0x1547f4[_0xdf3b('0x44')]=[{'all':!![]}];}return db[_0xdf3b('0x30')][_0xdf3b('0x45')](_0x1547f4);})[_0xdf3b('0x25')](function(_0x59d604){_0x28f6c0[_0xdf3b('0x46')]=_0x59d604;return _0x28f6c0;})[_0xdf3b('0x25')](respondWithFilteredResult(_0x41fa71,_0x1547f4))[_0xdf3b('0x47')](handleError(_0x41fa71,null));};exports['show']=function(_0x10a680,_0x5e2fa){var _0x75521={'raw':![],'where':{'id':_0x10a680[_0xdf3b('0x48')]['id']}},_0x37341c={};_0x37341c[_0xdf3b('0x34')]=_[_0xdf3b('0x49')](db['Schedule'][_0xdf3b('0x4a')]);_0x37341c[_0xdf3b('0x35')]=_[_0xdf3b('0x49')](_0x10a680[_0xdf3b('0x35')]);_0x37341c[_0xdf3b('0x36')]=_[_0xdf3b('0x37')](_0x37341c['model'],_0x37341c[_0xdf3b('0x35')]);_0x75521[_0xdf3b('0x38')]=_[_0xdf3b('0x37')](_0x37341c[_0xdf3b('0x34')],qs[_0xdf3b('0x4b')](_0x10a680[_0xdf3b('0x35')][_0xdf3b('0x4b')]));_0x75521[_0xdf3b('0x38')]=_0x75521[_0xdf3b('0x38')][_0xdf3b('0x39')]?_0x75521[_0xdf3b('0x38')]:_0x37341c[_0xdf3b('0x34')];if(_0x10a680[_0xdf3b('0x35')][_0xdf3b('0x43')]){_0x75521[_0xdf3b('0x44')]=[{'all':!![]}];}_0x75521=_['merge']({},_0x75521,_0x10a680['options']);return db[_0xdf3b('0x30')][_0xdf3b('0x4c')](_0x75521)[_0xdf3b('0x25')](handleEntityNotFound(_0x5e2fa,null))[_0xdf3b('0x25')](respondWithResult(_0x5e2fa,null))['catch'](handleError(_0x5e2fa,null));};exports[_0xdf3b('0x4d')]=function(_0x2308cd,_0x4a0e24){return db['Schedule'][_0xdf3b('0x4d')](_0x2308cd['body'],{})['then'](function(_0x463da8){var _0x2211b5=_0x2308cd[_0xdf3b('0x4e')][_0xdf3b('0x26')]({'plain':!![]});if(!_0x2211b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2211b5['role']===_0xdf3b('0x4e')){var _0x35329e=_0x463da8[_0xdf3b('0x26')]({'plain':!![]});var _0x2914f3=_0xdf3b('0x27');return db[_0xdf3b('0x4f')][_0xdf3b('0x4c')]({'where':{'name':_0x2914f3,'userProfileId':_0x2211b5[_0xdf3b('0x50')]},'raw':!![]})[_0xdf3b('0x25')](function(_0xf35b69){if(_0xf35b69&&_0xf35b69[_0xdf3b('0x51')]===0x0){return db[_0xdf3b('0x28')][_0xdf3b('0x4d')]({'name':_0x35329e['name'],'resourceId':_0x35329e['id'],'type':_0xf35b69[_0xdf3b('0x2c')],'sectionId':_0xf35b69['id']},{})['then'](function(){return _0x463da8;});}else{return _0x463da8;}})[_0xdf3b('0x47')](function(_0xa49c5a){logger[_0xdf3b('0x52')](_0xdf3b('0x53'),_0xa49c5a);throw _0xa49c5a;});}return _0x463da8;})['then'](respondWithResult(_0x4a0e24,0xc9))['catch'](handleError(_0x4a0e24,null));};exports[_0xdf3b('0x24')]=function(_0x53193c,_0x1bb6c6){if(_0x53193c['body']['id']){delete _0x53193c['body']['id'];}return db[_0xdf3b('0x30')][_0xdf3b('0x4c')]({'where':{'id':_0x53193c[_0xdf3b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bb6c6,null))[_0xdf3b('0x25')](saveUpdates(_0x53193c[_0xdf3b('0x54')],null))[_0xdf3b('0x25')](respondWithResult(_0x1bb6c6,null))[_0xdf3b('0x47')](handleError(_0x1bb6c6,null));};exports[_0xdf3b('0x29')]=function(_0x124b8f,_0x4d6491){return db[_0xdf3b('0x30')][_0xdf3b('0x4c')]({'where':{'id':_0x124b8f[_0xdf3b('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d6491,null))[_0xdf3b('0x25')](removeEntity(_0x4d6491,null))[_0xdf3b('0x47')](handleError(_0x4d6491,null));};exports[_0xdf3b('0x55')]=function(_0x437600,_0x15fd94,_0x5cd0ab){var _0x462749=require(_0xdf3b('0x56'));return db[_0xdf3b('0x30')]['find']({'where':{'id':_0x437600[_0xdf3b('0x48')]['id']},'raw':!![]})[_0xdf3b('0x25')](handleEntityNotFound(_0x15fd94,null))['then'](function(){_0x462749['run'](_0x437600[_0xdf3b('0x48')]['id']);})[_0xdf3b('0x25')](respondWithStatusCode(_0x15fd94,null))[_0xdf3b('0x47')](handleError(_0x15fd94,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 0ba7d7e..ad0d08a 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 _0xb957=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','Schedule','tools_schedules','lodash'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xb957,0xc5));var _0x7b95=function(_0x45df6c,_0x1df8db){_0x45df6c=_0x45df6c-0x0;var _0x3f60b3=_0xb957[_0x45df6c];return _0x3f60b3;};'use strict';var _=require(_0x7b95('0x0'));var util=require('util');var logger=require(_0x7b95('0x1'))(_0x7b95('0x2'));var moment=require(_0x7b95('0x3'));var BPromise=require(_0x7b95('0x4'));var rp=require(_0x7b95('0x5'));var fs=require('fs');var path=require(_0x7b95('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x7b95('0x7')]=function(_0x982f67,_0x58fd80){return _0x982f67[_0x7b95('0x8')](_0x7b95('0x9'),attributes,{'tableName':_0x7b95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c8b=['lodash','util','moment','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x3c8b,0x1a2));var _0xb3c8=function(_0x52d920,_0x4ac332){_0x52d920=_0x52d920-0x0;var _0x264f87=_0x3c8b[_0x52d920];return _0x264f87;};'use strict';var _=require(_0xb3c8('0x0'));var util=require(_0xb3c8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb3c8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb3c8('0x3'));var rimraf=require(_0xb3c8('0x4'));var config=require(_0xb3c8('0x5'));var attributes=require(_0xb3c8('0x6'));module[_0xb3c8('0x7')]=function(_0x148439,_0x195816){return _0x148439[_0xb3c8('0x8')](_0xb3c8('0x9'),attributes,{'tableName':_0xb3c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 06b2d54..e023b01 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 _0xa9d8=['jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x51eb91,_0x4799d5){var _0x1c4fc4=function(_0x1fd807){while(--_0x1fd807){_0x51eb91['push'](_0x51eb91['shift']());}};_0x1c4fc4(++_0x4799d5);}(_0xa9d8,0x174));var _0x8a9d=function(_0x4487b2,_0x432f6b){_0x4487b2=_0x4487b2-0x0;var _0x5b33a1=_0xa9d8[_0x4487b2];return _0x5b33a1;};'use strict';var _=require(_0x8a9d('0x0'));var util=require(_0x8a9d('0x1'));var moment=require('moment');var BPromise=require(_0x8a9d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a9d('0x3'));var db=require(_0x8a9d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a9d('0x5'))(_0x8a9d('0x6'));var config=require(_0x8a9d('0x7'));var jayson=require(_0x8a9d('0x8'));var client=jayson[_0x8a9d('0x9')][_0x8a9d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29cd5d,_0xcc84cd,_0x3573ac){return new BPromise(function(_0x1e5ced,_0xbb0a6f){return client['request'](_0x29cd5d,_0x3573ac)[_0x8a9d('0xb')](function(_0x320582){logger[_0x8a9d('0xc')](_0x8a9d('0xd'),_0xcc84cd,_0x8a9d('0xe'));logger['debug'](_0x8a9d('0xf'),_0xcc84cd,_0x8a9d('0xe'),JSON['stringify'](_0x320582));if(_0x320582['error']){if(_0x320582[_0x8a9d('0x10')][_0x8a9d('0x11')]===0x1f4){logger[_0x8a9d('0x10')](_0x8a9d('0xd'),_0xcc84cd,_0x320582['error']['message']);return _0xbb0a6f(_0x320582['error'][_0x8a9d('0x12')]);}logger[_0x8a9d('0x10')](_0x8a9d('0xd'),_0xcc84cd,_0x320582[_0x8a9d('0x10')]['message']);return _0x1e5ced(_0x320582['error'][_0x8a9d('0x12')]);}else{logger[_0x8a9d('0xc')](_0x8a9d('0xd'),_0xcc84cd,_0x8a9d('0xe'));_0x1e5ced(_0x320582['result'][_0x8a9d('0x12')]);}})['catch'](function(_0x4bb264){logger[_0x8a9d('0x10')]('Schedule,\x20%s,\x20%s',_0xcc84cd,_0x4bb264);_0xbb0a6f(_0x4bb264);});});} \ No newline at end of file +var _0x03be=['message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1a4861,_0x510d80){var _0x55c004=function(_0x5c8dd0){while(--_0x5c8dd0){_0x1a4861['push'](_0x1a4861['shift']());}};_0x55c004(++_0x510d80);}(_0x03be,0x1a6));var _0xe03b=function(_0x43867f,_0x5b7ae8){_0x43867f=_0x43867f-0x0;var _0x1df714=_0x03be[_0x43867f];return _0x1df714;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe03b('0x0'));var BPromise=require('bluebird');var rs=require(_0xe03b('0x1'));var fs=require('fs');var Redis=require(_0xe03b('0x2'));var db=require(_0xe03b('0x3'))['db'];var utils=require(_0xe03b('0x4'));var logger=require(_0xe03b('0x5'))(_0xe03b('0x6'));var config=require('../../config/environment');var jayson=require(_0xe03b('0x7'));var client=jayson[_0xe03b('0x8')][_0xe03b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x259392,_0x218739,_0x4fbc7c){return new BPromise(function(_0x1cbd04,_0x330ced){return client[_0xe03b('0xa')](_0x259392,_0x4fbc7c)[_0xe03b('0xb')](function(_0x2fc4fe){logger[_0xe03b('0xc')](_0xe03b('0xd'),_0x218739,_0xe03b('0xe'));logger[_0xe03b('0xf')](_0xe03b('0x10'),_0x218739,_0xe03b('0xe'),JSON['stringify'](_0x2fc4fe));if(_0x2fc4fe[_0xe03b('0x11')]){if(_0x2fc4fe[_0xe03b('0x11')][_0xe03b('0x12')]===0x1f4){logger['error'](_0xe03b('0xd'),_0x218739,_0x2fc4fe[_0xe03b('0x11')]['message']);return _0x330ced(_0x2fc4fe[_0xe03b('0x11')][_0xe03b('0x13')]);}logger[_0xe03b('0x11')](_0xe03b('0xd'),_0x218739,_0x2fc4fe[_0xe03b('0x11')][_0xe03b('0x13')]);return _0x1cbd04(_0x2fc4fe[_0xe03b('0x11')]['message']);}else{logger[_0xe03b('0xc')](_0xe03b('0xd'),_0x218739,_0xe03b('0xe'));_0x1cbd04(_0x2fc4fe[_0xe03b('0x14')][_0xe03b('0x13')]);}})['catch'](function(_0x48ae4a){logger[_0xe03b('0x11')](_0xe03b('0xd'),_0x218739,_0x48ae4a);_0x330ced(_0x48ae4a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 1833906..270f451 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 _0xc918=['describe','/:id','show','/:id/download','download','put','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x3d398b,_0x542808){var _0xaf8fd4=function(_0x112ac6){while(--_0x112ac6){_0x3d398b['push'](_0x3d398b['shift']());}};_0xaf8fd4(++_0x542808);}(_0xc918,0x14b));var _0x8c91=function(_0x38e0e6,_0x4fb62b){_0x38e0e6=_0x38e0e6-0x0;var _0x52d426=_0xc918[_0x38e0e6];return _0x52d426;};'use strict';var multer=require(_0x8c91('0x0'));var util=require(_0x8c91('0x1'));var path=require(_0x8c91('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c91('0x3'));var router=express[_0x8c91('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8c91('0x5'));var interaction=require(_0x8c91('0x6'));var config=require(_0x8c91('0x7'));var controller=require('./screenRecording.controller');router[_0x8c91('0x8')]('/',auth[_0x8c91('0x9')](),controller['index']);router['get'](_0x8c91('0xa'),auth['isAuthenticated'](),controller[_0x8c91('0xb')]);router[_0x8c91('0x8')](_0x8c91('0xc'),auth[_0x8c91('0x9')](),controller[_0x8c91('0xd')]);router['get'](_0x8c91('0xe'),auth[_0x8c91('0x9')](),controller[_0x8c91('0xf')]);router['post']('/',auth[_0x8c91('0x9')](),controller['create']);router[_0x8c91('0x10')](_0x8c91('0xc'),auth[_0x8c91('0x9')](),controller['update']);router['delete'](_0x8c91('0xc'),auth[_0x8c91('0x9')](),controller[_0x8c91('0x11')]);module[_0x8c91('0x12')]=router; \ No newline at end of file +var _0x9cd4=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','delete','multer'];(function(_0x299d86,_0x1a69a5){var _0x10bc47=function(_0x3da627){while(--_0x3da627){_0x299d86['push'](_0x299d86['shift']());}};_0x10bc47(++_0x1a69a5);}(_0x9cd4,0x1da));var _0x49cd=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x9cd4[_0x754ab4];return _0x34079a;};'use strict';var multer=require(_0x49cd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x49cd('0x1'));var router=express[_0x49cd('0x2')]();var fs_extra=require(_0x49cd('0x3'));var auth=require(_0x49cd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x49cd('0x5'));var controller=require(_0x49cd('0x6'));router[_0x49cd('0x7')]('/',auth['isAuthenticated'](),controller[_0x49cd('0x8')]);router[_0x49cd('0x7')](_0x49cd('0x9'),auth[_0x49cd('0xa')](),controller[_0x49cd('0xb')]);router[_0x49cd('0x7')](_0x49cd('0xc'),auth[_0x49cd('0xa')](),controller[_0x49cd('0xd')]);router['get'](_0x49cd('0xe'),auth['isAuthenticated'](),controller[_0x49cd('0xf')]);router[_0x49cd('0x10')]('/',auth[_0x49cd('0xa')](),controller[_0x49cd('0x11')]);router['put'](_0x49cd('0xc'),auth[_0x49cd('0xa')](),controller['update']);router[_0x49cd('0x12')]('/:id',auth[_0x49cd('0xa')](),controller['destroy']);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 da577a2..26de60e 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 _0xf08c=['replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','STRING'];(function(_0x1d20e5,_0x3d4f74){var _0x14c8d3=function(_0x368a35){while(--_0x368a35){_0x1d20e5['push'](_0x1d20e5['shift']());}};_0x14c8d3(++_0x3d4f74);}(_0xf08c,0xb5));var _0xcf08=function(_0x4a0131,_0x53c22a){_0x4a0131=_0x4a0131-0x0;var _0x1104ab=_0xf08c[_0x4a0131];return _0x1104ab;};'use strict';var Sequelize=require(_0xcf08('0x0'));var moment=require(_0xcf08('0x1'));var path=require(_0xcf08('0x2'));var config=require('../../config/environment');module[_0xcf08('0x3')]={'format':{'type':Sequelize[_0xcf08('0x4')],'get':function(){return this[_0xcf08('0x5')](_0xcf08('0x6'))?path['extname'](this['getDataValue'](_0xcf08('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xcf08('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xcf08('0x7')],'set':function(_0x37efab){var _0x13b89c=_0x37efab[_0xcf08('0x8')](/\\/g,'/');this['setDataValue']('value',_0x13b89c);}},'rating':{'type':Sequelize[_0xcf08('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x1ab45d){this[_0xcf08('0xa')](_0xcf08('0xb'),moment()[_0xcf08('0xc')](_0x1ab45d,'ms'));this['setDataValue'](_0xcf08('0xd'),moment());this[_0xcf08('0xa')](_0xcf08('0xe'),_0x1ab45d);}},'startedAt':{'type':Sequelize[_0xcf08('0xf')],'get':function(){return moment(this[_0xcf08('0x5')](_0xcf08('0xb')))[_0xcf08('0x10')](_0xcf08('0x11'))[_0xcf08('0x12')]();}},'closedAt':{'type':Sequelize[_0xcf08('0xf')],'get':function(){return moment(this[_0xcf08('0x5')]('closedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xcf08('0x12')]();}},'createdAt':{'type':Sequelize[_0xcf08('0xf')],'get':function(){return moment(this['getDataValue'](_0xcf08('0x13')))[_0xcf08('0x10')](_0xcf08('0x11'))[_0xcf08('0x12')]();}},'updatedAt':{'type':Sequelize[_0xcf08('0xf')],'get':function(){return moment(this['getDataValue'](_0xcf08('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0xcf08('0x12')]();}}}; \ No newline at end of file +var _0x5853=['MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE','format','toString'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5853,0x113));var _0x3585=function(_0x1df5cd,_0x3dc641){_0x1df5cd=_0x1df5cd-0x0;var _0xf6df9b=_0x5853[_0x1df5cd];return _0xf6df9b;};'use strict';var Sequelize=require(_0x3585('0x0'));var moment=require(_0x3585('0x1'));var path=require(_0x3585('0x2'));var config=require(_0x3585('0x3'));module[_0x3585('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3585('0x5')](_0x3585('0x6'))?path[_0x3585('0x7')](this[_0x3585('0x5')](_0x3585('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x3585('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x3585('0x8')],'set':function(_0x48b3ff){var _0x5d8c2d=_0x48b3ff[_0x3585('0x9')](/\\/g,'/');this['setDataValue'](_0x3585('0x6'),_0x5d8c2d);}},'rating':{'type':Sequelize[_0x3585('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x3585('0xa')],'set':function(_0x2febe8){this[_0x3585('0xb')](_0x3585('0xc'),moment()[_0x3585('0xd')](_0x2febe8,'ms'));this['setDataValue'](_0x3585('0xe'),moment());this[_0x3585('0xb')](_0x3585('0xf'),_0x2febe8);}},'startedAt':{'type':Sequelize[_0x3585('0x10')],'get':function(){return moment(this[_0x3585('0x5')](_0x3585('0xc')))[_0x3585('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x3585('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('closedAt'))['format'](_0x3585('0x13'))['toString']();}},'createdAt':{'type':Sequelize[_0x3585('0x10')],'get':function(){return moment(this[_0x3585('0x5')]('createdAt'))[_0x3585('0x11')](_0x3585('0x13'))['toString']();}},'updatedAt':{'type':Sequelize[_0x3585('0x10')],'get':function(){return moment(this[_0x3585('0x5')](_0x3585('0x14')))[_0x3585('0x11')](_0x3585('0x13'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index cc4161e..a9b58cc 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 _0xb458=['differenceBy','format','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','ScreenRecording','includeAll','rows','catch','show','params','include','create','body','createdAt','closedAt','find','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x4310f8,_0x28fe3a){var _0x49cbed=function(_0x34b2e3){while(--_0x34b2e3){_0x4310f8['push'](_0x4310f8['shift']());}};_0x49cbed(++_0x28fe3a);}(_0xb458,0x103));var _0x8b45=function(_0x376830,_0x1adaca){_0x376830=_0x376830-0x0;var _0x51ead4=_0xb458[_0x376830];return _0x51ead4;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['ScreenRecording'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x2f')](_[_0x8b45('0x29')](_0x1ba2d4,'name'),[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x461017[_0x8b45('0x31')]);_0xf21bd1[_0x8b45('0x33')]=_['intersection'](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7['attributes']=_[_0x8b45('0x34')](_0xf21bd1[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x461017[_0x8b45('0x31')][_0x8b45('0x35')]));_0x1733a7[_0x8b45('0x36')]=_0x1733a7['attributes'][_0x8b45('0x37')]?_0x1733a7[_0x8b45('0x36')]:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x31')]['hasOwnProperty'](_0x8b45('0x38'))){_0x1733a7[_0x8b45('0x1c')]=qs[_0x8b45('0x1c')](_0x461017['query'][_0x8b45('0x1c')]);_0x1733a7[_0x8b45('0x1a')]=qs[_0x8b45('0x1a')](_0x461017['query'][_0x8b45('0x1a')]);}_0x1733a7[_0x8b45('0x39')]=qs[_0x8b45('0x3a')](_0x461017[_0x8b45('0x31')]['sort']);_0x1733a7[_0x8b45('0x3b')]=qs[_0x8b45('0x33')](_[_0x8b45('0x3c')](_0x461017[_0x8b45('0x31')],_0xf21bd1[_0x8b45('0x33')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x31')]['filter']){_0x1733a7['where']=_[_0x8b45('0x3d')](_0x1733a7[_0x8b45('0x3b')],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x12d4b2){if(_0x12d4b2[_0x8b45('0x2c')]!=='VIRTUAL'){var _0x120068={};_0x120068[_0x12d4b2['name']]={'$like':'%'+_0x461017[_0x8b45('0x31')][_0x8b45('0x3e')]+'%'};return _0x120068;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3f')]);var _0x254f17={'where':_0x1733a7[_0x8b45('0x3b')]};return db[_0x8b45('0x40')][_0x8b45('0x1d')](_0x254f17)[_0x8b45('0x23')](function(_0x2ca00e){_0x339c73[_0x8b45('0x1d')]=_0x2ca00e;if(_0x461017['query'][_0x8b45('0x41')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x40')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x224c45){_0x339c73[_0x8b45('0x42')]=_0x224c45;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x43')](handleError(_0x234f62,null));};exports[_0x8b45('0x44')]=function(_0x58e663,_0x6fbca4){var _0x5916c7={'raw':![],'where':{'id':_0x58e663[_0x8b45('0x45')]['id']}},_0x4c56c8={};_0x4c56c8[_0x8b45('0x2e')]=_[_0x8b45('0x32')](db['ScreenRecording'][_0x8b45('0x2a')]);_0x4c56c8['query']=_[_0x8b45('0x32')](_0x58e663[_0x8b45('0x31')]);_0x4c56c8[_0x8b45('0x33')]=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],_0x4c56c8[_0x8b45('0x31')]);_0x5916c7['attributes']=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x58e663[_0x8b45('0x31')][_0x8b45('0x35')]));_0x5916c7[_0x8b45('0x36')]=_0x5916c7[_0x8b45('0x36')][_0x8b45('0x37')]?_0x5916c7[_0x8b45('0x36')]:_0x4c56c8[_0x8b45('0x2e')];if(_0x58e663[_0x8b45('0x31')][_0x8b45('0x41')]){_0x5916c7[_0x8b45('0x46')]=[{'all':!![]}];}_0x5916c7=_[_0x8b45('0x3d')]({},_0x5916c7,_0x58e663[_0x8b45('0x3f')]);return db[_0x8b45('0x40')]['find'](_0x5916c7)['then'](handleEntityNotFound(_0x6fbca4,null))['then'](respondWithResult(_0x6fbca4,null))[_0x8b45('0x43')](handleError(_0x6fbca4,null));};exports[_0x8b45('0x47')]=function(_0x3a1621,_0x473530){return db[_0x8b45('0x40')][_0x8b45('0x47')](_0x3a1621[_0x8b45('0x48')],{})[_0x8b45('0x23')](respondWithResult(_0x473530,0xc9))['catch'](handleError(_0x473530,null));};exports[_0x8b45('0x22')]=function(_0x5d5be2,_0x23b5c6){if(_0x5d5be2[_0x8b45('0x48')]['id']){delete _0x5d5be2[_0x8b45('0x48')]['id'];}delete _0x5d5be2[_0x8b45('0x48')]['duration'];delete _0x5d5be2[_0x8b45('0x48')][_0x8b45('0x49')];delete _0x5d5be2['body'][_0x8b45('0x4a')];delete _0x5d5be2[_0x8b45('0x48')]['value'];return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':{'id':_0x5d5be2[_0x8b45('0x45')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0x23b5c6,null))[_0x8b45('0x23')](saveUpdates(_0x5d5be2[_0x8b45('0x48')],null))['then'](respondWithResult(_0x23b5c6,null))['catch'](handleError(_0x23b5c6,null));};exports[_0x8b45('0x4c')]=function(_0x2a2e59,_0x2d5b31){return db['ScreenRecording'][_0x8b45('0x4c')]()[_0x8b45('0x23')](respondWithResult(_0x2d5b31,null))[_0x8b45('0x43')](handleError(_0x2d5b31,null));};exports[_0x8b45('0x4d')]=function(_0x2d6b66,_0x597402,_0x34c05d){var _0xa92a05=require('../../components/encryptor');var _0x422da0=![];var _0x4c3f38={};if(_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]&&_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]==='uniqueid'){_0x4c3f38[_0x8b45('0x4e')]=_0x2d6b66[_0x8b45('0x45')]['id'];}else{_0x4c3f38['id']=_0x2d6b66[_0x8b45('0x45')]['id'];}return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':_0x4c3f38,'attributes':['id',_0x8b45('0x4f')],'raw':!![]})[_0x8b45('0x23')](handleEntityNotFound(_0x597402,null))[_0x8b45('0x23')](function(_0x446fe5){if(_0x446fe5){var _0x5ba878=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x446fe5[_0x8b45('0x4f')]);var _0x1851c2=util['format'](_0x8b45('0x53'),_0x5ba878);if(fs[_0x8b45('0x54')](_0x1851c2)){_0x422da0=!![];return _0xa92a05[_0x8b45('0x55')](_0x1851c2,_0x5ba878,config['secrets'][_0x8b45('0x56')])[_0x8b45('0x23')](function(){return _0x446fe5;});}return _0x446fe5;}})[_0x8b45('0x23')](function(_0x9eacc1){if(_0x9eacc1){var _0x5795ca=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x9eacc1[_0x8b45('0x4f')]);if(!fs['existsSync'](_0x5795ca)){throw new db[(_0x8b45('0x57'))][(_0x8b45('0x58'))](_0x8b45('0x59'));}if(_0x9eacc1[_0x8b45('0x5a')]){return _0x597402[_0x8b45('0x4d')](_0x5795ca,_0x9eacc1['filename']+path[_0x8b45('0x5b')](_0x5795ca),function(){if(_0x422da0){fs['unlink'](_0x5795ca);}});}else{return _0x597402[_0x8b45('0x4d')](_0x5795ca,function(_0x2f7ab0){if(_0x422da0){fs[_0x8b45('0x5c')](_0x5795ca);}});}}})[_0x8b45('0x43')](function(_0x6a77bd){if(_0x6a77bd[_0x8b45('0x5d')]==='ScreenRecording\x20not\x20found'){_0x597402['status'](0x194)[_0x8b45('0x27')](_0x8b45('0x5e'));}else{return handleError(_0x597402,null);}});};exports['destroy']=function(_0x461c83,_0x239330){return db[_0x8b45('0x40')]['find']({'where':{'id':_0x461c83['params']['id']}})[_0x8b45('0x23')](function(_0x8e5a41){if(_['isNil'](_0x8e5a41)){throw new ReferenceError(_0x8b45('0x5f'));}return _0x8e5a41;})['then'](function(_0xf1ab37){var _0x560c51=path['join'](config[_0x8b45('0x51')],_0x8b45('0x52'),_0xf1ab37['value']);logger[_0x8b45('0x60')](_0x8b45('0x61'),_0x560c51);if(!_[_0x8b45('0x62')](_0xf1ab37[_0x8b45('0x4f')])&&fs[_0x8b45('0x54')](_0x560c51)){logger['info'](_0x8b45('0x63')+_0x560c51+_0x8b45('0x64'));fs[_0x8b45('0x65')](_0x560c51);}_0x560c51=_0x560c51+'.cypher';if(!_['isNil'](_0xf1ab37[_0x8b45('0x4f')])&&fs['existsSync'](_0x560c51)){logger[_0x8b45('0x60')]('File:\x20\x22'+_0x560c51+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x560c51);}return _0xf1ab37;})[_0x8b45('0x23')](function(_0x4df581){if(!_0x4df581)throw new InternalError();return _0x4df581[_0x8b45('0x24')]();})[_0x8b45('0x23')](function(){_0x239330['status'](0xcc)[_0x8b45('0x18')]();})[_0x8b45('0x43')](handleError(_0x239330,null));}; \ No newline at end of file +var _0xed1f=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','catch','create','body','duration','createdAt','closedAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf'];(function(_0x58f70f,_0x506dcb){var _0xada9c9=function(_0x1e937c){while(--_0x1e937c){_0x58f70f['push'](_0x58f70f['shift']());}};_0xada9c9(++_0x506dcb);}(_0xed1f,0x6a));var _0xfed1=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xed1f[_0x44946b];return _0x249bc4;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require(_0xfed1('0x2'));var jsonpatch=require(_0xfed1('0x3'));var rp=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var BPromise=require(_0xfed1('0x6'));var Mustache=require(_0xfed1('0x7'));var util=require(_0xfed1('0x8'));var path=require(_0xfed1('0x9'));var sox=require(_0xfed1('0xa'));var csv=require(_0xfed1('0xb'));var ejs=require(_0xfed1('0xc'));var fs=require('fs');var fs_extra=require(_0xfed1('0xd'));var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xb'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];function respondWithStatusCode(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xcc;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['sendStatus'](_0x17f4fe);}return _0x569a6e[_0xfed1('0x1a')](_0x17f4fe)[_0xfed1('0x1b')]();};}function respondWithResult(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0xc8;return function(_0x5b9455){if(_0x5b9455){return _0x532537['status'](_0x2dde3a)[_0xfed1('0x1c')](_0x5b9455);}};}function respondWithFilteredResult(_0x39aa0c,_0x1fbb7a){return function(_0x123c46){if(_0x123c46){var _0x582e67=typeof _0x1fbb7a[_0xfed1('0x1d')]==='undefined'&&typeof _0x1fbb7a[_0xfed1('0x1e')]===_0xfed1('0x1f');var _0x489a0f=_0x123c46[_0xfed1('0x20')];var _0xa72a20=_0x582e67?0x0:_0x1fbb7a['offset'];var _0x59509b=_0x582e67?_0x123c46['count']:_0x1fbb7a[_0xfed1('0x1d')]+_0x1fbb7a['limit'];var _0x201f18;if(_0x59509b>=_0x489a0f){_0x59509b=_0x489a0f;_0x201f18=0xc8;}else{_0x201f18=0xce;}_0x39aa0c[_0xfed1('0x1a')](_0x201f18);return _0x39aa0c['set'](_0xfed1('0x21'),_0xa72a20+'-'+_0x59509b+'/'+_0x489a0f)[_0xfed1('0x1c')](_0x123c46);}return null;};}function patchUpdates(_0x59ee9d){return function(_0x3ce944){try{jsonpatch[_0xfed1('0x22')](_0x3ce944,_0x59ee9d,!![]);}catch(_0xff4842){return BPromise[_0xfed1('0x23')](_0xff4842);}return _0x3ce944['save']();};}function saveUpdates(_0x203cec,_0x59333e){return function(_0x446558){if(_0x446558){return _0x446558[_0xfed1('0x24')](_0x203cec)[_0xfed1('0x25')](function(_0x532ec2){return _0x532ec2;});}return null;};}function removeEntity(_0x41d22c,_0x594917){return function(_0x460555){if(_0x460555){return _0x460555[_0xfed1('0x26')]()[_0xfed1('0x25')](function(){_0x41d22c[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();});}};}function handleEntityNotFound(_0x1199b7,_0x527fc7){return function(_0x465ce6){if(!_0x465ce6){_0x1199b7[_0xfed1('0x27')](0x194);}return _0x465ce6;};}function handleError(_0x49072b,_0x1d6c72){_0x1d6c72=_0x1d6c72||0x1f4;return function(_0x2b9dd2){logger[_0xfed1('0x28')](_0x2b9dd2[_0xfed1('0x29')]);if(_0x2b9dd2[_0xfed1('0x2a')]){delete _0x2b9dd2[_0xfed1('0x2a')];}_0x49072b['status'](_0x1d6c72)[_0xfed1('0x2b')](_0x2b9dd2);};}exports['index']=function(_0x3106ee,_0x4e5249){var _0x53b0c9={},_0x1cec64={},_0x42c950={'count':0x0,'rows':[]};var _0x2d334e=_['map'](db[_0xfed1('0x2c')][_0xfed1('0x2d')],function(_0x13f414){return{'name':_0x13f414[_0xfed1('0x2e')],'type':_0x13f414[_0xfed1('0x2f')][_0xfed1('0x30')]};});_0x1cec64['model']=_[_0xfed1('0x31')](_[_0xfed1('0x32')](_0x2d334e,'name'),['format']);_0x1cec64[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0x3106ee[_0xfed1('0x33')]);_0x1cec64[_0xfed1('0x35')]=_[_0xfed1('0x36')](_0x1cec64['model'],_0x1cec64[_0xfed1('0x33')]);_0x53b0c9[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1cec64[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0x3106ee['query'][_0xfed1('0x39')]));_0x53b0c9['attributes']=_0x53b0c9[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x53b0c9[_0xfed1('0x37')]:_0x1cec64[_0xfed1('0x38')];if(!_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3b')](_0xfed1('0x3c'))){_0x53b0c9[_0xfed1('0x1e')]=qs['limit'](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x1e')]);_0x53b0c9[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x3106ee['query']['offset']);}_0x53b0c9[_0xfed1('0x3d')]=qs[_0xfed1('0x3e')](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3e')]);_0x53b0c9[_0xfed1('0x3f')]=qs[_0xfed1('0x35')](_[_0xfed1('0x40')](_0x3106ee[_0xfed1('0x33')],_0x1cec64['filters']),_0x2d334e);if(_0x3106ee['query'][_0xfed1('0x41')]){_0x53b0c9[_0xfed1('0x3f')]=_['merge'](_0x53b0c9[_0xfed1('0x3f')],{'$or':_[_0xfed1('0x32')](_0x2d334e,function(_0x3b0973){if(_0x3b0973[_0xfed1('0x2f')]!==_0xfed1('0x42')){var _0x31ffeb={};_0x31ffeb[_0x3b0973[_0xfed1('0x2a')]]={'$like':'%'+_0x3106ee[_0xfed1('0x33')][_0xfed1('0x41')]+'%'};return _0x31ffeb;}})});}_0x53b0c9=_['merge']({},_0x53b0c9,_0x3106ee['options']);var _0x5598dc={'where':_0x53b0c9[_0xfed1('0x3f')]};return db[_0xfed1('0x2c')][_0xfed1('0x20')](_0x5598dc)['then'](function(_0x3454e6){_0x42c950['count']=_0x3454e6;if(_0x3106ee[_0xfed1('0x33')][_0xfed1('0x43')]){_0x53b0c9[_0xfed1('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0xfed1('0x45')](_0x53b0c9);})[_0xfed1('0x25')](function(_0x422433){_0x42c950['rows']=_0x422433;return _0x42c950;})[_0xfed1('0x25')](respondWithFilteredResult(_0x4e5249,_0x53b0c9))['catch'](handleError(_0x4e5249,null));};exports[_0xfed1('0x46')]=function(_0xf1f739,_0x229fc7){var _0x13c087={'raw':![],'where':{'id':_0xf1f739[_0xfed1('0x47')]['id']}},_0x1bfbe8={};_0x1bfbe8[_0xfed1('0x38')]=_[_0xfed1('0x34')](db[_0xfed1('0x2c')]['rawAttributes']);_0x1bfbe8[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0xf1f739[_0xfed1('0x33')]);_0x1bfbe8['filters']=_['intersection'](_0x1bfbe8[_0xfed1('0x38')],_0x1bfbe8[_0xfed1('0x33')]);_0x13c087[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1bfbe8[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0xf1f739[_0xfed1('0x33')][_0xfed1('0x39')]));_0x13c087[_0xfed1('0x37')]=_0x13c087[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x13c087[_0xfed1('0x37')]:_0x1bfbe8['model'];if(_0xf1f739[_0xfed1('0x33')][_0xfed1('0x43')]){_0x13c087[_0xfed1('0x44')]=[{'all':!![]}];}_0x13c087=_[_0xfed1('0x48')]({},_0x13c087,_0xf1f739[_0xfed1('0x49')]);return db[_0xfed1('0x2c')]['find'](_0x13c087)[_0xfed1('0x25')](handleEntityNotFound(_0x229fc7,null))[_0xfed1('0x25')](respondWithResult(_0x229fc7,null))[_0xfed1('0x4a')](handleError(_0x229fc7,null));};exports['create']=function(_0x22874a,_0x10f98d){return db[_0xfed1('0x2c')][_0xfed1('0x4b')](_0x22874a['body'],{})[_0xfed1('0x25')](respondWithResult(_0x10f98d,0xc9))[_0xfed1('0x4a')](handleError(_0x10f98d,null));};exports[_0xfed1('0x24')]=function(_0x42761f,_0x14745e){if(_0x42761f[_0xfed1('0x4c')]['id']){delete _0x42761f[_0xfed1('0x4c')]['id'];}delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4d')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4e')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4f')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x50')];return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x42761f[_0xfed1('0x47')]['id']}})['then'](handleEntityNotFound(_0x14745e,null))['then'](saveUpdates(_0x42761f[_0xfed1('0x4c')],null))[_0xfed1('0x25')](respondWithResult(_0x14745e,null))[_0xfed1('0x4a')](handleError(_0x14745e,null));};exports[_0xfed1('0x52')]=function(_0x5da599,_0x3c2534){return db[_0xfed1('0x2c')]['describe']()['then'](respondWithResult(_0x3c2534,null))['catch'](handleError(_0x3c2534,null));};exports[_0xfed1('0x53')]=function(_0x1aaa3d,_0x15e90f,_0x1d8ef2){var _0x2665c8=require(_0xfed1('0x54'));var _0x1a9f22=![];var _0x144102={};if(_0x1aaa3d[_0xfed1('0x33')][_0xfed1('0x2f')]&&_0x1aaa3d['query']['type']===_0xfed1('0x55')){_0x144102[_0xfed1('0x55')]=_0x1aaa3d[_0xfed1('0x47')]['id'];}else{_0x144102['id']=_0x1aaa3d[_0xfed1('0x47')]['id'];}return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':_0x144102,'attributes':['id',_0xfed1('0x50')],'raw':!![]})[_0xfed1('0x25')](handleEntityNotFound(_0x15e90f,null))[_0xfed1('0x25')](function(_0x427fa6){if(_0x427fa6){var _0xbd49dc=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x427fa6[_0xfed1('0x50')]);var _0x3a7a42=util[_0xfed1('0x59')]('%s.cypher',_0xbd49dc);if(fs['existsSync'](_0x3a7a42)){_0x1a9f22=!![];return _0x2665c8[_0xfed1('0x5a')](_0x3a7a42,_0xbd49dc,config[_0xfed1('0x5b')][_0xfed1('0x5c')])[_0xfed1('0x25')](function(){return _0x427fa6;});}return _0x427fa6;}})[_0xfed1('0x25')](function(_0x41a22a){if(_0x41a22a){var _0x2ccdc3=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x41a22a[_0xfed1('0x50')]);if(!fs[_0xfed1('0x5d')](_0x2ccdc3)){throw new db[(_0xfed1('0x5e'))][(_0xfed1('0x5f'))]('ScreenRecording\x20not\x20found');}if(_0x41a22a[_0xfed1('0x60')]){return _0x15e90f['download'](_0x2ccdc3,_0x41a22a['filename']+path[_0xfed1('0x61')](_0x2ccdc3),function(){if(_0x1a9f22){fs['unlink'](_0x2ccdc3);}});}else{return _0x15e90f[_0xfed1('0x53')](_0x2ccdc3,function(_0x5acc45){if(_0x1a9f22){fs[_0xfed1('0x62')](_0x2ccdc3);}});}}})[_0xfed1('0x4a')](function(_0x53f0ab){if(_0x53f0ab[_0xfed1('0x63')]===_0xfed1('0x64')){_0x15e90f['status'](0x194)[_0xfed1('0x2b')](_0xfed1('0x65'));}else{return handleError(_0x15e90f,null);}});};exports[_0xfed1('0x26')]=function(_0x2f37b9,_0x59a23a){return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x2f37b9[_0xfed1('0x47')]['id']}})[_0xfed1('0x25')](function(_0x23347a){if(_[_0xfed1('0x66')](_0x23347a)){throw new ReferenceError(_0xfed1('0x67'));}return _0x23347a;})[_0xfed1('0x25')](function(_0x5c043d){var _0x2d66ec=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x5c043d[_0xfed1('0x50')]);logger[_0xfed1('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d66ec);if(!_['isNil'](_0x5c043d['value'])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}_0x2d66ec=_0x2d66ec+_0xfed1('0x6b');if(!_['isNil'](_0x5c043d[_0xfed1('0x50')])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}return _0x5c043d;})[_0xfed1('0x25')](function(_0x6b74cb){if(!_0x6b74cb)throw new InternalError();return _0x6b74cb[_0xfed1('0x26')]();})['then'](function(){_0x59a23a[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();})[_0xfed1('0x4a')](handleError(_0x59a23a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 6b14971..f6c9d8e 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 _0x5f61=['interactionid','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x333ded,_0x15a86c){var _0x99f844=function(_0x5ae8f8){while(--_0x5ae8f8){_0x333ded['push'](_0x333ded['shift']());}};_0x99f844(++_0x15a86c);}(_0x5f61,0xd9));var _0x15f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f61[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x15f6('0x0'));var logger=require(_0x15f6('0x1'))('api');var moment=require(_0x15f6('0x2'));var BPromise=require(_0x15f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15f6('0x4'));var rimraf=require(_0x15f6('0x5'));var config=require(_0x15f6('0x6'));var attributes=require(_0x15f6('0x7'));module[_0x15f6('0x8')]=function(_0x3bb9d2,_0x5a863a){return _0x3bb9d2[_0x15f6('0x9')](_0x15f6('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x15f6('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x38b6=['interactionid','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x466e89,_0x237ae3){var _0x580986=function(_0x1ca46d){while(--_0x1ca46d){_0x466e89['push'](_0x466e89['shift']());}};_0x580986(++_0x237ae3);}(_0x38b6,0x12d));var _0x638b=function(_0x3b5c5b,_0x4bc7c3){_0x3b5c5b=_0x3b5c5b-0x0;var _0x275f6c=_0x38b6[_0x3b5c5b];return _0x275f6c;};'use strict';var _=require(_0x638b('0x0'));var util=require(_0x638b('0x1'));var logger=require('../../config/logger')(_0x638b('0x2'));var moment=require(_0x638b('0x3'));var BPromise=require('bluebird');var rp=require(_0x638b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x638b('0x5'));var config=require(_0x638b('0x6'));var attributes=require(_0x638b('0x7'));module[_0x638b('0x8')]=function(_0x376994,_0x49bee6){return _0x376994[_0x638b('0x9')](_0x638b('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x638b('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 59ced33..aec55f1 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 _0x64ee=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x557510,_0x4b4cb6){var _0x538506=function(_0x15c311){while(--_0x15c311){_0x557510['push'](_0x557510['shift']());}};_0x538506(++_0x4b4cb6);}(_0x64ee,0x157));var _0xe64e=function(_0x153891,_0x4eb35f){_0x153891=_0x153891-0x0;var _0x5869fe=_0x64ee[_0x153891];return _0x5869fe;};'use strict';var _=require(_0xe64e('0x0'));var util=require('util');var moment=require(_0xe64e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe64e('0x2'));var db=require(_0xe64e('0x3'))['db'];var utils=require(_0xe64e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe64e('0x5'));var jayson=require(_0xe64e('0x6'));var client=jayson[_0xe64e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18ce25,_0x4815d7,_0x2d7faa){return new BPromise(function(_0x47c59e,_0x122e4c){return client['request'](_0x18ce25,_0x2d7faa)['then'](function(_0x4e45b8){logger[_0xe64e('0x8')](_0xe64e('0x9'),_0x4815d7,_0xe64e('0xa'));logger[_0xe64e('0xb')](_0xe64e('0xc'),_0x4815d7,'request\x20sent',JSON[_0xe64e('0xd')](_0x4e45b8));if(_0x4e45b8[_0xe64e('0xe')]){if(_0x4e45b8[_0xe64e('0xe')]['code']===0x1f4){logger[_0xe64e('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x4815d7,_0x4e45b8[_0xe64e('0xe')][_0xe64e('0xf')]);return _0x122e4c(_0x4e45b8[_0xe64e('0xe')][_0xe64e('0xf')]);}logger['error'](_0xe64e('0x9'),_0x4815d7,_0x4e45b8[_0xe64e('0xe')][_0xe64e('0xf')]);return _0x47c59e(_0x4e45b8[_0xe64e('0xe')][_0xe64e('0xf')]);}else{logger[_0xe64e('0x8')](_0xe64e('0x9'),_0x4815d7,_0xe64e('0xa'));_0x47c59e(_0x4e45b8[_0xe64e('0x10')][_0xe64e('0xf')]);}})[_0xe64e('0x11')](function(_0x2af287){logger[_0xe64e('0xe')](_0xe64e('0x9'),_0x4815d7,_0x2af287);_0x122e4c(_0x2af287);});});} \ No newline at end of file +var _0xaa09=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x90d668,_0x89fd23){var _0x4ad2cc=function(_0x2ca1e3){while(--_0x2ca1e3){_0x90d668['push'](_0x90d668['shift']());}};_0x4ad2cc(++_0x89fd23);}(_0xaa09,0x94));var _0x9aa0=function(_0x5e7601,_0x2226d3){_0x5e7601=_0x5e7601-0x0;var _0x12b47b=_0xaa09[_0x5e7601];return _0x12b47b;};'use strict';var _=require(_0x9aa0('0x0'));var util=require(_0x9aa0('0x1'));var moment=require(_0x9aa0('0x2'));var BPromise=require(_0x9aa0('0x3'));var rs=require(_0x9aa0('0x4'));var fs=require('fs');var Redis=require(_0x9aa0('0x5'));var db=require(_0x9aa0('0x6'))['db'];var utils=require(_0x9aa0('0x7'));var logger=require(_0x9aa0('0x8'))('rpc');var config=require(_0x9aa0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9aa0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5318bd,_0xe5a8c2,_0x3def19){return new BPromise(function(_0x1f061a,_0x465a7d){return client[_0x9aa0('0xb')](_0x5318bd,_0x3def19)['then'](function(_0x4d3042){logger[_0x9aa0('0xc')]('ScreenRecording,\x20%s,\x20%s',_0xe5a8c2,_0x9aa0('0xd'));logger[_0x9aa0('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0xe5a8c2,_0x9aa0('0xd'),JSON[_0x9aa0('0xf')](_0x4d3042));if(_0x4d3042[_0x9aa0('0x10')]){if(_0x4d3042[_0x9aa0('0x10')][_0x9aa0('0x11')]===0x1f4){logger['error'](_0x9aa0('0x12'),_0xe5a8c2,_0x4d3042['error'][_0x9aa0('0x13')]);return _0x465a7d(_0x4d3042['error'][_0x9aa0('0x13')]);}logger['error'](_0x9aa0('0x12'),_0xe5a8c2,_0x4d3042[_0x9aa0('0x10')]['message']);return _0x1f061a(_0x4d3042[_0x9aa0('0x10')][_0x9aa0('0x13')]);}else{logger[_0x9aa0('0xc')]('ScreenRecording,\x20%s,\x20%s',_0xe5a8c2,_0x9aa0('0xd'));_0x1f061a(_0x4d3042[_0x9aa0('0x14')]['message']);}})[_0x9aa0('0x15')](function(_0x320c6a){logger[_0x9aa0('0x10')](_0x9aa0('0x12'),_0xe5a8c2,_0x320c6a);_0x465a7d(_0x320c6a);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 206d714..0d2dadb 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 _0x2a23=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','originalname','post','file','addLogo','extname','single','addLogoLogin','preferred','addPreferred','put','exports'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x2a23,0x72));var _0x32a2=function(_0x51f92c,_0x18337a){_0x51f92c=_0x51f92c-0x0;var _0x4c5a2e=_0x2a23[_0x51f92c];return _0x4c5a2e;};'use strict';var multer=require('multer');var util=require(_0x32a2('0x0'));var path=require(_0x32a2('0x1'));var timeout=require(_0x32a2('0x2'));var express=require(_0x32a2('0x3'));var router=express[_0x32a2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x32a2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x32a2('0x6'));var controller=require(_0x32a2('0x7'));router[_0x32a2('0x8')]('/',auth[_0x32a2('0x9')](),controller[_0x32a2('0xa')]);router[_0x32a2('0x8')](_0x32a2('0xb'),controller['getDate']);router[_0x32a2('0x8')](_0x32a2('0xc'),controller[_0x32a2('0xd')]);router[_0x32a2('0x8')](_0x32a2('0xe'),controller[_0x32a2('0xf')]);router[_0x32a2('0x8')](_0x32a2('0x10'),controller[_0x32a2('0x11')]);router[_0x32a2('0x8')](_0x32a2('0x12'),controller['gdpr']);router[_0x32a2('0x8')](_0x32a2('0x13'),controller['getPreferred']);router[_0x32a2('0x8')](_0x32a2('0x14'),controller['getFavicon']);var upload=multer({'storage':multer[_0x32a2('0x15')]({'destination':function(_0x55166e,_0x184751,_0x284458){_0x284458(null,path[_0x32a2('0x16')](config[_0x32a2('0x17')],_0x32a2('0x18')));},'filename':function(_0xa1324,_0x5f1ea9,_0x1ff8ad){_0x1ff8ad(null,util[_0x32a2('0x19')](_0x32a2('0x1a'),'logo',path['extname'](_0x5f1ea9[_0x32a2('0x1b')])));}})});router[_0x32a2('0x1c')](_0x32a2('0xe'),upload['single'](_0x32a2('0x1d')),controller[_0x32a2('0x1e')]);var upload=multer({'storage':multer[_0x32a2('0x15')]({'destination':function(_0x4e116b,_0x576b1c,_0x1db555){_0x1db555(null,path[_0x32a2('0x16')](config[_0x32a2('0x17')],_0x32a2('0x18')));},'filename':function(_0x263ccc,_0x53aec4,_0x48fff5){_0x48fff5(null,util[_0x32a2('0x19')](_0x32a2('0x1a'),'logologin',path[_0x32a2('0x1f')](_0x53aec4[_0x32a2('0x1b')])));}})});router[_0x32a2('0x1c')](_0x32a2('0x10'),upload[_0x32a2('0x20')](_0x32a2('0x1d')),controller[_0x32a2('0x21')]);var upload=multer({'storage':multer[_0x32a2('0x15')]({'destination':function(_0x230f2b,_0x189fdb,_0x5004ee){_0x5004ee(null,path[_0x32a2('0x16')](config[_0x32a2('0x17')],_0x32a2('0x18')));},'filename':function(_0x3b0d8c,_0x26b466,_0x31933f){_0x31933f(null,util[_0x32a2('0x19')](_0x32a2('0x1a'),_0x32a2('0x22'),path[_0x32a2('0x1f')](_0x26b466[_0x32a2('0x1b')])));}})});router[_0x32a2('0x1c')]('/:id/preferred',upload[_0x32a2('0x20')](_0x32a2('0x1d')),controller[_0x32a2('0x23')]);var upload=multer({'storage':multer[_0x32a2('0x15')]({'destination':function(_0x273938,_0x5fac32,_0xa0315e){_0xa0315e(null,path[_0x32a2('0x16')](config[_0x32a2('0x17')],_0x32a2('0x18')));},'filename':function(_0x2faa5b,_0x313e16,_0x220f8e){_0x220f8e(null,util[_0x32a2('0x19')](_0x32a2('0x1a'),'favicon',path[_0x32a2('0x1f')](_0x313e16[_0x32a2('0x1b')])));}})});router[_0x32a2('0x1c')](_0x32a2('0x14'),upload[_0x32a2('0x20')](_0x32a2('0x1d')),controller['addFavicon']);router[_0x32a2('0x24')](_0x32a2('0xc'),auth['isAuthenticated'](),controller['update']);module[_0x32a2('0x25')]=router; \ No newline at end of file +var _0xb33e=['favicon','addFavicon','put','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','index','/now','getDate','get','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','logo','extname','originalname','single','file','addLogo','format','post','addLogoLogin','%s%s','addPreferred'];(function(_0xe260c2,_0x56d51e){var _0x32ddfb=function(_0x3bcdca){while(--_0x3bcdca){_0xe260c2['push'](_0xe260c2['shift']());}};_0x32ddfb(++_0x56d51e);}(_0xb33e,0x7e));var _0xeb33=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb33e[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xeb33('0x0'));var util=require(_0xeb33('0x1'));var path=require('path');var timeout=require(_0xeb33('0x2'));var express=require(_0xeb33('0x3'));var router=express[_0xeb33('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xeb33('0x5'));var interaction=require(_0xeb33('0x6'));var config=require(_0xeb33('0x7'));var controller=require(_0xeb33('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xeb33('0x9')]);router['get'](_0xeb33('0xa'),controller[_0xeb33('0xb')]);router[_0xeb33('0xc')]('/:id',controller[_0xeb33('0xd')]);router[_0xeb33('0xc')](_0xeb33('0xe'),controller[_0xeb33('0xf')]);router['get'](_0xeb33('0x10'),controller['getLogoLogin']);router['get'](_0xeb33('0x11'),controller[_0xeb33('0x12')]);router[_0xeb33('0xc')](_0xeb33('0x13'),controller[_0xeb33('0x14')]);router[_0xeb33('0xc')](_0xeb33('0x15'),controller[_0xeb33('0x16')]);var upload=multer({'storage':multer[_0xeb33('0x17')]({'destination':function(_0xf5c56f,_0x439b59,_0x652f53){_0x652f53(null,path[_0xeb33('0x18')](config[_0xeb33('0x19')],_0xeb33('0x1a')));},'filename':function(_0x28e4fb,_0x1eea3d,_0x58ba91){_0x58ba91(null,util['format']('%s%s',_0xeb33('0x1b'),path[_0xeb33('0x1c')](_0x1eea3d[_0xeb33('0x1d')])));}})});router['post'](_0xeb33('0xe'),upload[_0xeb33('0x1e')](_0xeb33('0x1f')),controller[_0xeb33('0x20')]);var upload=multer({'storage':multer[_0xeb33('0x17')]({'destination':function(_0x2be9c2,_0x4074b4,_0x2bd4b5){_0x2bd4b5(null,path[_0xeb33('0x18')](config[_0xeb33('0x19')],_0xeb33('0x1a')));},'filename':function(_0x311a6a,_0x29f9f5,_0x495535){_0x495535(null,util[_0xeb33('0x21')]('%s%s','logologin',path['extname'](_0x29f9f5[_0xeb33('0x1d')])));}})});router[_0xeb33('0x22')]('/:id/logo_login',upload[_0xeb33('0x1e')](_0xeb33('0x1f')),controller[_0xeb33('0x23')]);var upload=multer({'storage':multer[_0xeb33('0x17')]({'destination':function(_0x4795a6,_0x4cac0c,_0x2b6a36){_0x2b6a36(null,path[_0xeb33('0x18')](config[_0xeb33('0x19')],_0xeb33('0x1a')));},'filename':function(_0x1cd367,_0x2f523b,_0x40df01){_0x40df01(null,util[_0xeb33('0x21')](_0xeb33('0x24'),'preferred',path[_0xeb33('0x1c')](_0x2f523b[_0xeb33('0x1d')])));}})});router['post'](_0xeb33('0x13'),upload[_0xeb33('0x1e')](_0xeb33('0x1f')),controller[_0xeb33('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc2d73e,_0x57af40,_0x549799){_0x549799(null,path[_0xeb33('0x18')](config['root'],_0xeb33('0x1a')));},'filename':function(_0x47b243,_0x4c9ab4,_0x3b5dad){_0x3b5dad(null,util['format'](_0xeb33('0x24'),_0xeb33('0x26'),path['extname'](_0x4c9ab4[_0xeb33('0x1d')])));}})});router[_0xeb33('0x22')](_0xeb33('0x15'),upload[_0xeb33('0x1e')]('file'),controller[_0xeb33('0x27')]);router[_0xeb33('0x28')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index e5d033a..793d10d 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4d2218,_0x126628){var _0xee353f=function(_0x4a0e82){while(--_0x4a0e82){_0x4d2218['push'](_0x4d2218['shift']());}};_0xee353f(++_0x126628);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x38c1e1,_0x240083){var _0x2d349f=function(_0x378779){while(--_0x378779){_0x38c1e1['push'](_0x38c1e1['shift']());}};_0x2d349f(++_0x240083);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8eb32cd..a6e8b26 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 _0xc694=['find','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','\x20not\x20found','getLogoLogin','getLicense','preferred','default_loginLogo.svg','Sequelize','ValidationError','download','securePassword','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','sendStatus','stack','index','map','rawAttributes','fieldName','key','model','name','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','show','params','intersection','options','Setting','body'];(function(_0x12186a,_0x110c8c){var _0x12da52=function(_0x3285b1){while(--_0x3285b1){_0x12186a['push'](_0x12186a['shift']());}};_0x12da52(++_0x110c8c);}(_0xc694,0x11e));var _0x4c69=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0xc694[_0x547456];return _0xc1fd7b;};'use strict';var emlformat=require(_0x4c69('0x0'));var rimraf=require(_0x4c69('0x1'));var zipdir=require(_0x4c69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4c69('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c69('0x4'));var util=require(_0x4c69('0x5'));var path=require('path');var sox=require(_0x4c69('0x6'));var csv=require(_0x4c69('0x7'));var ejs=require(_0x4c69('0x8'));var fs=require('fs');var fs_extra=require(_0x4c69('0x9'));var _=require(_0x4c69('0xa'));var squel=require(_0x4c69('0xb'));var crypto=require(_0x4c69('0xc'));var jsforce=require(_0x4c69('0xd'));var deskjs=require(_0x4c69('0xe'));var toCsv=require(_0x4c69('0x7'));var querystring=require(_0x4c69('0xf'));var Papa=require(_0x4c69('0x10'));var Redis=require(_0x4c69('0x11'));var authService=require(_0x4c69('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4c69('0x13'));var hardwareService=require(_0x4c69('0x14'));var logger=require(_0x4c69('0x15'))(_0x4c69('0x16'));var utils=require('../../config/utils');var config=require(_0x4c69('0x17'));var licenseUtil=require(_0x4c69('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4c69('0x19'));var client=jayson[_0x4c69('0x1a')][_0x4c69('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4fa492,_0x16e430,_0x26931b,_0x108815){return new BPromise(function(_0x47eb1f,_0xee9d26){var _0x95584b=_0x108815||client;return _0x95584b['request'](_0x4fa492,_0x26931b)['then'](function(_0x2b7bfa){logger[_0x4c69('0x1c')](_0x4c69('0x1d'),_0x16e430,_0x4c69('0x1e'));logger[_0x4c69('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x16e430,_0x4c69('0x1e'),JSON[_0x4c69('0x20')](_0x2b7bfa));if(_0x2b7bfa[_0x4c69('0x21')]){if(_0x2b7bfa[_0x4c69('0x21')][_0x4c69('0x22')]===0x1f4){logger['error'](_0x4c69('0x1d'),_0x16e430,_0x2b7bfa['error']['message']);return _0xee9d26(_0x2b7bfa[_0x4c69('0x21')][_0x4c69('0x23')]);}logger[_0x4c69('0x21')](_0x4c69('0x1d'),_0x16e430,_0x2b7bfa[_0x4c69('0x21')][_0x4c69('0x23')]);return _0x47eb1f(_0x2b7bfa['error'][_0x4c69('0x23')]);}else{logger[_0x4c69('0x1c')](_0x4c69('0x1d'),_0x16e430,_0x4c69('0x1e'));_0x47eb1f(_0x2b7bfa[_0x4c69('0x24')][_0x4c69('0x23')]);}})[_0x4c69('0x25')](function(_0x39545e){logger[_0x4c69('0x21')](_0x4c69('0x1d'),_0x16e430,_0x39545e);_0xee9d26(_0x39545e);});});}function respondWithStatusCode(_0x2ae750,_0x947361){_0x947361=_0x947361||0xcc;return function(_0x537312){if(_0x537312){return _0x2ae750['sendStatus'](_0x947361);}return _0x2ae750[_0x4c69('0x26')](_0x947361)[_0x4c69('0x27')]();};}function respondWithResult(_0x13becb,_0x3491bf){_0x3491bf=_0x3491bf||0xc8;return function(_0x59f32e){if(_0x59f32e){return _0x13becb['status'](_0x3491bf)[_0x4c69('0x28')](_0x59f32e);}};}function respondWithFilteredResult(_0x1c4577,_0x5002e9){return function(_0x222896){if(_0x222896){var _0x24f7fd=typeof _0x5002e9['offset']==='undefined'&&typeof _0x5002e9[_0x4c69('0x29')]===_0x4c69('0x2a');var _0x2a3d3d=_0x222896[_0x4c69('0x2b')];var _0x2fe4ac=_0x24f7fd?0x0:_0x5002e9[_0x4c69('0x2c')];var _0x5f288c=_0x24f7fd?_0x222896[_0x4c69('0x2b')]:_0x5002e9['offset']+_0x5002e9[_0x4c69('0x29')];var _0xb9eb42;if(_0x5f288c>=_0x2a3d3d){_0x5f288c=_0x2a3d3d;_0xb9eb42=0xc8;}else{_0xb9eb42=0xce;}_0x1c4577[_0x4c69('0x26')](_0xb9eb42);return _0x1c4577[_0x4c69('0x2d')](_0x4c69('0x2e'),_0x2fe4ac+'-'+_0x5f288c+'/'+_0x2a3d3d)[_0x4c69('0x28')](_0x222896);}return null;};}function patchUpdates(_0x1ced84){return function(_0xdd5e43){try{jsonpatch['apply'](_0xdd5e43,_0x1ced84,!![]);}catch(_0x2f5d9d){return BPromise[_0x4c69('0x2f')](_0x2f5d9d);}return _0xdd5e43[_0x4c69('0x30')]();};}function saveUpdates(_0x1621c6,_0x1d341f){return function(_0x522d24){if(_0x522d24){return _0x522d24[_0x4c69('0x31')](_0x1621c6)[_0x4c69('0x32')](function(_0x12e4e6){return _0x12e4e6;});}return null;};}function removeEntity(_0x26d1b9,_0x214c05){return function(_0x33d18c){if(_0x33d18c){return _0x33d18c['destroy']()[_0x4c69('0x32')](function(){_0x26d1b9[_0x4c69('0x26')](0xcc)[_0x4c69('0x27')]();});}};}function handleEntityNotFound(_0x6d465c,_0x231f19){return function(_0x3af8c8){if(!_0x3af8c8){_0x6d465c[_0x4c69('0x33')](0x194);}return _0x3af8c8;};}function handleError(_0x379cef,_0xc46674){_0xc46674=_0xc46674||0x1f4;return function(_0x1bd843){logger[_0x4c69('0x21')](_0x1bd843[_0x4c69('0x34')]);if(_0x1bd843['name']){delete _0x1bd843['name'];}_0x379cef['status'](_0xc46674)['send'](_0x1bd843);};}exports[_0x4c69('0x35')]=function(_0x5abcdb,_0x28998c){var _0x1e3c8d={},_0x2396a7={},_0x3ababf={'count':0x0,'rows':[]};var _0x1d2440=_[_0x4c69('0x36')](db['Setting'][_0x4c69('0x37')],function(_0x10993e){return{'name':_0x10993e[_0x4c69('0x38')],'type':_0x10993e['type'][_0x4c69('0x39')]};});_0x2396a7[_0x4c69('0x3a')]=_[_0x4c69('0x36')](_0x1d2440,_0x4c69('0x3b'));_0x2396a7[_0x4c69('0x3c')]=_[_0x4c69('0x3d')](_0x5abcdb[_0x4c69('0x3c')]);_0x2396a7['filters']=_['intersection'](_0x2396a7['model'],_0x2396a7['query']);_0x1e3c8d[_0x4c69('0x3e')]=_['intersection'](_0x2396a7[_0x4c69('0x3a')],qs[_0x4c69('0x3f')](_0x5abcdb['query']['fields']));_0x1e3c8d[_0x4c69('0x3e')]=_0x1e3c8d['attributes'][_0x4c69('0x40')]?_0x1e3c8d[_0x4c69('0x3e')]:_0x2396a7[_0x4c69('0x3a')];if(!_0x5abcdb[_0x4c69('0x3c')]['hasOwnProperty'](_0x4c69('0x41'))){_0x1e3c8d[_0x4c69('0x29')]=qs[_0x4c69('0x29')](_0x5abcdb['query'][_0x4c69('0x29')]);_0x1e3c8d[_0x4c69('0x2c')]=qs[_0x4c69('0x2c')](_0x5abcdb[_0x4c69('0x3c')][_0x4c69('0x2c')]);}_0x1e3c8d[_0x4c69('0x42')]=qs[_0x4c69('0x43')](_0x5abcdb[_0x4c69('0x3c')][_0x4c69('0x43')]);_0x1e3c8d[_0x4c69('0x44')]=qs[_0x4c69('0x45')](_[_0x4c69('0x46')](_0x5abcdb[_0x4c69('0x3c')],_0x2396a7[_0x4c69('0x45')]),_0x1d2440);if(_0x5abcdb[_0x4c69('0x3c')][_0x4c69('0x47')]){_0x1e3c8d[_0x4c69('0x44')]=_['merge'](_0x1e3c8d[_0x4c69('0x44')],{'$or':_['map'](_0x1d2440,function(_0x9bddb5){if(_0x9bddb5['type']!=='VIRTUAL'){var _0x1ee961={};_0x1ee961[_0x9bddb5[_0x4c69('0x3b')]]={'$like':'%'+_0x5abcdb[_0x4c69('0x3c')][_0x4c69('0x47')]+'%'};return _0x1ee961;}})});}_0x1e3c8d=_[_0x4c69('0x48')]({},_0x1e3c8d,_0x5abcdb['options']);var _0x425e75={'where':_0x1e3c8d['where']};return db['Setting'][_0x4c69('0x2b')](_0x425e75)[_0x4c69('0x32')](function(_0x33307a){_0x3ababf[_0x4c69('0x2b')]=_0x33307a;if(_0x5abcdb[_0x4c69('0x3c')][_0x4c69('0x49')]){_0x1e3c8d[_0x4c69('0x4a')]=[{'all':!![]}];}return db['Setting'][_0x4c69('0x4b')](_0x1e3c8d);})[_0x4c69('0x32')](function(_0x1eae37){_0x3ababf[_0x4c69('0x4c')]=_0x1eae37;return _0x3ababf;})[_0x4c69('0x32')](respondWithFilteredResult(_0x28998c,_0x1e3c8d))[_0x4c69('0x25')](handleError(_0x28998c,null));};exports[_0x4c69('0x4d')]=function(_0xc233,_0x1dab62){var _0x450582={'raw':![],'where':{'id':_0xc233[_0x4c69('0x4e')]['id']}},_0x44d519={};_0x44d519[_0x4c69('0x3a')]=_[_0x4c69('0x3d')](db['Setting'][_0x4c69('0x37')]);_0x44d519[_0x4c69('0x3c')]=_[_0x4c69('0x3d')](_0xc233['query']);_0x44d519['filters']=_['intersection'](_0x44d519['model'],_0x44d519['query']);_0x450582[_0x4c69('0x3e')]=_[_0x4c69('0x4f')](_0x44d519[_0x4c69('0x3a')],qs[_0x4c69('0x3f')](_0xc233[_0x4c69('0x3c')][_0x4c69('0x3f')]));_0x450582['attributes']=_0x450582[_0x4c69('0x3e')][_0x4c69('0x40')]?_0x450582[_0x4c69('0x3e')]:_0x44d519['model'];if(_0xc233['query'][_0x4c69('0x49')]){_0x450582[_0x4c69('0x4a')]=[{'all':!![]}];}_0x450582=_[_0x4c69('0x48')]({},_0x450582,_0xc233[_0x4c69('0x50')]);return db[_0x4c69('0x51')]['find'](_0x450582)[_0x4c69('0x32')](handleEntityNotFound(_0x1dab62,null))[_0x4c69('0x32')](respondWithResult(_0x1dab62,null))[_0x4c69('0x25')](handleError(_0x1dab62,null));};exports[_0x4c69('0x31')]=function(_0x47f487,_0x353cb2){if(_0x47f487[_0x4c69('0x52')]['id']){delete _0x47f487[_0x4c69('0x52')]['id'];}return db[_0x4c69('0x51')][_0x4c69('0x53')]({'where':{'id':_0x47f487['params']['id']}})[_0x4c69('0x32')](handleEntityNotFound(_0x353cb2,null))[_0x4c69('0x32')](saveUpdates(_0x47f487['body'],null))[_0x4c69('0x32')](respondWithResult(_0x353cb2,null))[_0x4c69('0x25')](handleError(_0x353cb2,null));};exports[_0x4c69('0x54')]=function(_0x5f032c,_0x1cc353,_0x1356e8){if(_0x5f032c['file']&&_0x5f032c[_0x4c69('0x55')][_0x4c69('0x56')]){_0x5f032c[_0x4c69('0x52')][_0x4c69('0x57')]=_0x5f032c[_0x4c69('0x55')]['filename'];}return db[_0x4c69('0x51')]['find']({'where':{'id':_0x5f032c[_0x4c69('0x4e')]['id']}})[_0x4c69('0x32')](handleEntityNotFound(_0x1cc353,null))['then'](saveUpdates(_0x5f032c[_0x4c69('0x52')],null))['then'](respondWithResult(_0x1cc353,null))[_0x4c69('0x25')](handleError(_0x1cc353,null));};exports[_0x4c69('0x58')]=function(_0x31da6b,_0x4bddad,_0x4313d1){if(_0x31da6b['file']&&_0x31da6b[_0x4c69('0x55')][_0x4c69('0x56')]){_0x31da6b[_0x4c69('0x52')][_0x4c69('0x59')]=_0x31da6b[_0x4c69('0x55')][_0x4c69('0x56')];}return db[_0x4c69('0x51')][_0x4c69('0x53')]({'where':{'id':_0x31da6b[_0x4c69('0x4e')]['id']}})[_0x4c69('0x32')](handleEntityNotFound(_0x4bddad,null))['then'](saveUpdates(_0x31da6b[_0x4c69('0x52')],null))[_0x4c69('0x32')](respondWithResult(_0x4bddad,null))[_0x4c69('0x25')](handleError(_0x4bddad,null));};var utilLicense=require(_0x4c69('0x18'));exports[_0x4c69('0x5a')]=function(_0x3052ef,_0x54324e,_0x4e7457){var _0x1346b0=_0x4c69('0x5b');var _0x1a31be={'custom':![]};return utilLicense['getLicense']()[_0x4c69('0x32')](function(_0x67220c){if(_0x67220c){_0x1a31be=_0x67220c;}return db['Setting']['find']({'where':{'id':_0x3052ef['params']['id']},'attributes':[_0x4c69('0x57'),'loginLogo','preferred',_0x4c69('0x5c'),_0x4c69('0x5d'),_0x4c69('0x5e'),_0x4c69('0x5f'),_0x4c69('0x60')],'raw':!![]});})[_0x4c69('0x32')](handleEntityNotFound(_0x54324e,null))[_0x4c69('0x32')](function(_0x32c9a5){if(_0x32c9a5){var _0x115f65=_0x32c9a5['logo']&&fs[_0x4c69('0x61')](path[_0x4c69('0x62')](config[_0x4c69('0x63')],_0x1346b0,_[_0x4c69('0x64')](_0x32c9a5['logo'])))?path[_0x4c69('0x62')](config['root'],_0x1346b0,_[_0x4c69('0x64')](_0x32c9a5['logo'])):path['join'](config[_0x4c69('0x63')],_0x1346b0,_[_0x4c69('0x64')](_0x4c69('0x65')));var _0x39b9af=_0x4c69('0x66')+_[_0x4c69('0x67')](_0x4c69('0x57'));if(_0x32c9a5[_0x39b9af]||!_0x1a31be[_0x4c69('0x68')]){_0x115f65=path[_0x4c69('0x62')](config[_0x4c69('0x63')],_0x1346b0,_[_0x4c69('0x64')](_0x4c69('0x65')));}if(!fs['existsSync'](_0x115f65)){throw new db['Sequelize']['ValidationError'](_[_0x4c69('0x67')](_0x4c69('0x57'))+_0x4c69('0x69'));}return _0x54324e['download'](_0x115f65);}})[_0x4c69('0x25')](handleError(_0x54324e,null));};var utilLicense=require(_0x4c69('0x18'));exports[_0x4c69('0x6a')]=function(_0x431af7,_0x2e864d,_0x3e8793){var _0x49ff19=_0x4c69('0x5b');var _0x505003={'custom':![]};return utilLicense[_0x4c69('0x6b')]()['then'](function(_0x5b0759){if(_0x5b0759){_0x505003=_0x5b0759;}return db['Setting'][_0x4c69('0x53')]({'where':{'id':_0x431af7[_0x4c69('0x4e')]['id']},'attributes':[_0x4c69('0x57'),_0x4c69('0x59'),_0x4c69('0x6c'),_0x4c69('0x5c'),_0x4c69('0x5d'),_0x4c69('0x5e'),_0x4c69('0x5f'),_0x4c69('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x2e864d,null))['then'](function(_0x5a5a86){if(_0x5a5a86){var _0x8e1c99=_0x5a5a86[_0x4c69('0x59')]&&fs[_0x4c69('0x61')](path[_0x4c69('0x62')](config[_0x4c69('0x63')],_0x49ff19,_[_0x4c69('0x64')](_0x5a5a86[_0x4c69('0x59')])))?path['join'](config['root'],_0x49ff19,_[_0x4c69('0x64')](_0x5a5a86[_0x4c69('0x59')])):path['join'](config[_0x4c69('0x63')],_0x49ff19,_[_0x4c69('0x64')](_0x4c69('0x6d')));var _0x2449ce='default'+_[_0x4c69('0x67')](_0x4c69('0x59'));if(_0x5a5a86[_0x2449ce]||!_0x505003['custom']){_0x8e1c99=path[_0x4c69('0x62')](config[_0x4c69('0x63')],_0x49ff19,_[_0x4c69('0x64')](_0x4c69('0x6d')));}if(!fs[_0x4c69('0x61')](_0x8e1c99)){throw new db[(_0x4c69('0x6e'))][(_0x4c69('0x6f'))](_[_0x4c69('0x67')](_0x4c69('0x59'))+_0x4c69('0x69'));}return _0x2e864d[_0x4c69('0x70')](_0x8e1c99);}})[_0x4c69('0x25')](handleError(_0x2e864d,null));};exports['gdpr']=function(_0x1c7e73,_0x92bc58){return db[_0x4c69('0x51')]['find']({'where':{'id':_0x1c7e73[_0x4c69('0x4e')]['id']},'attributes':[_0x4c69('0x71')]})[_0x4c69('0x32')](respondWithResult(_0x92bc58,null))[_0x4c69('0x25')](handleError(_0x92bc58,null));};exports['addPreferred']=function(_0x4bcb9e,_0x4a6724,_0x2fa2a2){if(_0x4bcb9e[_0x4c69('0x55')]&&_0x4bcb9e[_0x4c69('0x55')][_0x4c69('0x56')]){_0x4bcb9e[_0x4c69('0x52')][_0x4c69('0x6c')]=_0x4bcb9e[_0x4c69('0x55')][_0x4c69('0x56')];}return db[_0x4c69('0x51')]['find']({'where':{'id':_0x4bcb9e[_0x4c69('0x4e')]['id']}})[_0x4c69('0x32')](handleEntityNotFound(_0x4a6724,null))['then'](saveUpdates(_0x4bcb9e[_0x4c69('0x52')],null))[_0x4c69('0x32')](respondWithResult(_0x4a6724,null))['catch'](handleError(_0x4a6724,null));};var utilLicense=require(_0x4c69('0x18'));exports['getPreferred']=function(_0x245c87,_0x590574,_0x149b97){var _0x490d7f='server/files/images/logos';var _0xbd75e5={'custom':![]};return utilLicense[_0x4c69('0x6b')]()[_0x4c69('0x32')](function(_0x409584){if(_0x409584){_0xbd75e5=_0x409584;}return db[_0x4c69('0x51')]['find']({'where':{'id':_0x245c87[_0x4c69('0x4e')]['id']},'attributes':[_0x4c69('0x57'),_0x4c69('0x59'),_0x4c69('0x6c'),'favicon',_0x4c69('0x5d'),_0x4c69('0x5e'),'defaultPreferred',_0x4c69('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x590574,null))[_0x4c69('0x32')](function(_0x3ddca8){if(_0x3ddca8){var _0x489d90=_0x3ddca8[_0x4c69('0x6c')]&&fs[_0x4c69('0x61')](path[_0x4c69('0x62')](config['root'],_0x490d7f,_[_0x4c69('0x64')](_0x3ddca8[_0x4c69('0x6c')])))?path[_0x4c69('0x62')](config[_0x4c69('0x63')],_0x490d7f,_[_0x4c69('0x64')](_0x3ddca8['preferred'])):path['join'](config['root'],_0x490d7f,_[_0x4c69('0x64')](_0x4c69('0x72')));var _0x2063bf=_0x4c69('0x66')+_[_0x4c69('0x67')](_0x4c69('0x6c'));if(_0x3ddca8[_0x2063bf]||!_0xbd75e5[_0x4c69('0x68')]||!_0xbd75e5['preferred']){_0x489d90=path[_0x4c69('0x62')](config[_0x4c69('0x63')],_0x490d7f,_[_0x4c69('0x64')](_0x4c69('0x72')));}if(!fs[_0x4c69('0x61')](_0x489d90)){throw new db['Sequelize'][(_0x4c69('0x6f'))](_[_0x4c69('0x67')](_0x4c69('0x6c'))+_0x4c69('0x69'));}return _0x590574[_0x4c69('0x70')](_0x489d90);}})[_0x4c69('0x25')](handleError(_0x590574,null));};exports[_0x4c69('0x73')]=function(_0x43fbd5,_0x356854,_0x17364){if(_0x43fbd5[_0x4c69('0x55')]&&_0x43fbd5['file'][_0x4c69('0x56')]){_0x43fbd5[_0x4c69('0x52')][_0x4c69('0x5c')]=_0x43fbd5[_0x4c69('0x55')][_0x4c69('0x56')];}return db[_0x4c69('0x51')][_0x4c69('0x53')]({'where':{'id':_0x43fbd5['params']['id']}})['then'](handleEntityNotFound(_0x356854,null))[_0x4c69('0x32')](saveUpdates(_0x43fbd5[_0x4c69('0x52')],null))[_0x4c69('0x32')](respondWithResult(_0x356854,null))[_0x4c69('0x25')](handleError(_0x356854,null));};var utilLicense=require(_0x4c69('0x18'));exports['getFavicon']=function(_0x2c3188,_0x249065,_0x23de49){var _0x43539c=_0x4c69('0x5b');var _0x4f62c8={'custom':![]};return utilLicense[_0x4c69('0x6b')]()[_0x4c69('0x32')](function(_0x5ca322){if(_0x5ca322){_0x4f62c8=_0x5ca322;}return db[_0x4c69('0x51')]['find']({'where':{'id':_0x2c3188[_0x4c69('0x4e')]['id']},'attributes':[_0x4c69('0x57'),_0x4c69('0x59'),_0x4c69('0x6c'),_0x4c69('0x5c'),_0x4c69('0x5d'),_0x4c69('0x5e'),_0x4c69('0x5f'),_0x4c69('0x60')],'raw':!![]});})[_0x4c69('0x32')](handleEntityNotFound(_0x249065,null))[_0x4c69('0x32')](function(_0x4d06e5){if(_0x4d06e5){var _0x2e5512=_0x4d06e5[_0x4c69('0x5c')]&&fs[_0x4c69('0x61')](path[_0x4c69('0x62')](config[_0x4c69('0x63')],_0x43539c,_[_0x4c69('0x64')](_0x4d06e5['favicon'])))?path['join'](config[_0x4c69('0x63')],_0x43539c,_[_0x4c69('0x64')](_0x4d06e5[_0x4c69('0x5c')])):path[_0x4c69('0x62')](config['root'],_0x43539c,_[_0x4c69('0x64')](_0x4c69('0x74')));var _0x36f719=_0x4c69('0x66')+_[_0x4c69('0x67')](_0x4c69('0x5c'));if(_0x4d06e5[_0x36f719]||!_0x4f62c8['custom']){_0x2e5512=path['join'](config[_0x4c69('0x63')],_0x43539c,_['toLower']('default_favicon.ico'));}if(!fs[_0x4c69('0x61')](_0x2e5512)){throw new db[(_0x4c69('0x6e'))][(_0x4c69('0x6f'))](_['upperFirst'](_0x4c69('0x5c'))+'\x20not\x20found');}return _0x249065['download'](_0x2e5512);}})['catch'](handleError(_0x249065,null));};exports[_0x4c69('0x75')]=function(_0xf0b63a,_0x1b1daa){var _0x1815e0={'offset':moment()[_0x4c69('0x76')]()};_0x1815e0[_0x4c69('0x77')]=moment()[_0x4c69('0x76')](_0x1815e0['offset'])[_0x4c69('0x78')](_0x4c69('0x79'));return _0x1b1daa[_0x4c69('0x26')](0xc8)[_0x4c69('0x7a')](_0x1815e0);}; \ No newline at end of file +var _0x7d86=['getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code','message','result','Setting,\x20%s,\x20%s','status','end','offset','undefined','count','set','json','apply','reject','save','destroy','stack','name','Setting','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','options','find','body','file','filename','logo','params','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','ValidationError','download','../../config/license/util','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','defaultFavicon','default_preferred.png','\x20not\x20found','addFavicon'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7d86,0x86));var _0x67d8=function(_0x49aae7,_0x4708a7){_0x49aae7=_0x49aae7-0x0;var _0x3dcf6e=_0x7d86[_0x49aae7];return _0x3dcf6e;};'use strict';var emlformat=require(_0x67d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x67d8('0x1'));var jsonpatch=require(_0x67d8('0x2'));var rp=require(_0x67d8('0x3'));var moment=require(_0x67d8('0x4'));var BPromise=require(_0x67d8('0x5'));var Mustache=require(_0x67d8('0x6'));var util=require(_0x67d8('0x7'));var path=require('path');var sox=require(_0x67d8('0x8'));var csv=require(_0x67d8('0x9'));var ejs=require(_0x67d8('0xa'));var fs=require('fs');var fs_extra=require(_0x67d8('0xb'));var _=require(_0x67d8('0xc'));var squel=require(_0x67d8('0xd'));var crypto=require(_0x67d8('0xe'));var jsforce=require(_0x67d8('0xf'));var deskjs=require(_0x67d8('0x10'));var toCsv=require(_0x67d8('0x9'));var querystring=require(_0x67d8('0x11'));var Papa=require(_0x67d8('0x12'));var Redis=require(_0x67d8('0x13'));var authService=require(_0x67d8('0x14'));var qs=require(_0x67d8('0x15'));var as=require(_0x67d8('0x16'));var hardwareService=require(_0x67d8('0x17'));var logger=require(_0x67d8('0x18'))(_0x67d8('0x19'));var utils=require(_0x67d8('0x1a'));var config=require(_0x67d8('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x67d8('0x1c'))['db'];var jayson=require(_0x67d8('0x1d'));var client=jayson[_0x67d8('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x159982,_0xfa31ae,_0x2f6f93,_0x13758c){return new BPromise(function(_0x2d54e6,_0x2d7851){var _0x3dd3bb=_0x13758c||client;return _0x3dd3bb['request'](_0x159982,_0x2f6f93)[_0x67d8('0x1f')](function(_0x2f83e9){logger[_0x67d8('0x20')]('Setting,\x20%s,\x20%s',_0xfa31ae,_0x67d8('0x21'));logger[_0x67d8('0x22')]('Setting,\x20%s,\x20%s,\x20%s',_0xfa31ae,_0x67d8('0x21'),JSON[_0x67d8('0x23')](_0x2f83e9));if(_0x2f83e9[_0x67d8('0x24')]){if(_0x2f83e9[_0x67d8('0x24')][_0x67d8('0x25')]===0x1f4){logger[_0x67d8('0x24')]('Setting,\x20%s,\x20%s',_0xfa31ae,_0x2f83e9[_0x67d8('0x24')][_0x67d8('0x26')]);return _0x2d7851(_0x2f83e9[_0x67d8('0x24')][_0x67d8('0x26')]);}logger[_0x67d8('0x24')]('Setting,\x20%s,\x20%s',_0xfa31ae,_0x2f83e9[_0x67d8('0x24')][_0x67d8('0x26')]);return _0x2d54e6(_0x2f83e9['error']['message']);}else{logger[_0x67d8('0x20')]('Setting,\x20%s,\x20%s',_0xfa31ae,_0x67d8('0x21'));_0x2d54e6(_0x2f83e9[_0x67d8('0x27')][_0x67d8('0x26')]);}})['catch'](function(_0x576858){logger[_0x67d8('0x24')](_0x67d8('0x28'),_0xfa31ae,_0x576858);_0x2d7851(_0x576858);});});}function respondWithStatusCode(_0x43694a,_0x3949ce){_0x3949ce=_0x3949ce||0xcc;return function(_0x2072d4){if(_0x2072d4){return _0x43694a['sendStatus'](_0x3949ce);}return _0x43694a[_0x67d8('0x29')](_0x3949ce)[_0x67d8('0x2a')]();};}function respondWithResult(_0x590cff,_0x509ee9){_0x509ee9=_0x509ee9||0xc8;return function(_0x18e515){if(_0x18e515){return _0x590cff[_0x67d8('0x29')](_0x509ee9)['json'](_0x18e515);}};}function respondWithFilteredResult(_0x3eb6e1,_0x36fec9){return function(_0x4de8ae){if(_0x4de8ae){var _0x5a3a33=typeof _0x36fec9[_0x67d8('0x2b')]===_0x67d8('0x2c')&&typeof _0x36fec9['limit']===_0x67d8('0x2c');var _0x2d2506=_0x4de8ae['count'];var _0x1e7e8f=_0x5a3a33?0x0:_0x36fec9['offset'];var _0x7232a4=_0x5a3a33?_0x4de8ae[_0x67d8('0x2d')]:_0x36fec9[_0x67d8('0x2b')]+_0x36fec9['limit'];var _0x57cbb5;if(_0x7232a4>=_0x2d2506){_0x7232a4=_0x2d2506;_0x57cbb5=0xc8;}else{_0x57cbb5=0xce;}_0x3eb6e1['status'](_0x57cbb5);return _0x3eb6e1[_0x67d8('0x2e')]('Content-Range',_0x1e7e8f+'-'+_0x7232a4+'/'+_0x2d2506)[_0x67d8('0x2f')](_0x4de8ae);}return null;};}function patchUpdates(_0x6430a){return function(_0x40c4ef){try{jsonpatch[_0x67d8('0x30')](_0x40c4ef,_0x6430a,!![]);}catch(_0x5d994b){return BPromise[_0x67d8('0x31')](_0x5d994b);}return _0x40c4ef[_0x67d8('0x32')]();};}function saveUpdates(_0x1620f2,_0x48e81e){return function(_0x4e93ea){if(_0x4e93ea){return _0x4e93ea['update'](_0x1620f2)[_0x67d8('0x1f')](function(_0x25153d){return _0x25153d;});}return null;};}function removeEntity(_0x5d72b5,_0x21b195){return function(_0x1d8440){if(_0x1d8440){return _0x1d8440[_0x67d8('0x33')]()[_0x67d8('0x1f')](function(){_0x5d72b5[_0x67d8('0x29')](0xcc)[_0x67d8('0x2a')]();});}};}function handleEntityNotFound(_0x1a58b9,_0x2dc621){return function(_0x51e9bb){if(!_0x51e9bb){_0x1a58b9['sendStatus'](0x194);}return _0x51e9bb;};}function handleError(_0x333f19,_0x31ab29){_0x31ab29=_0x31ab29||0x1f4;return function(_0x4f5a3b){logger[_0x67d8('0x24')](_0x4f5a3b[_0x67d8('0x34')]);if(_0x4f5a3b[_0x67d8('0x35')]){delete _0x4f5a3b[_0x67d8('0x35')];}_0x333f19[_0x67d8('0x29')](_0x31ab29)['send'](_0x4f5a3b);};}exports['index']=function(_0x2330ea,_0x36fd54){var _0x45a9d6={},_0x1168c8={},_0x564023={'count':0x0,'rows':[]};var _0x69882f=_['map'](db[_0x67d8('0x36')][_0x67d8('0x37')],function(_0x426416){return{'name':_0x426416[_0x67d8('0x38')],'type':_0x426416[_0x67d8('0x39')][_0x67d8('0x3a')]};});_0x1168c8[_0x67d8('0x3b')]=_['map'](_0x69882f,_0x67d8('0x35'));_0x1168c8[_0x67d8('0x3c')]=_[_0x67d8('0x3d')](_0x2330ea['query']);_0x1168c8['filters']=_[_0x67d8('0x3e')](_0x1168c8['model'],_0x1168c8[_0x67d8('0x3c')]);_0x45a9d6[_0x67d8('0x3f')]=_[_0x67d8('0x3e')](_0x1168c8[_0x67d8('0x3b')],qs[_0x67d8('0x40')](_0x2330ea['query'][_0x67d8('0x40')]));_0x45a9d6[_0x67d8('0x3f')]=_0x45a9d6['attributes'][_0x67d8('0x41')]?_0x45a9d6[_0x67d8('0x3f')]:_0x1168c8[_0x67d8('0x3b')];if(!_0x2330ea[_0x67d8('0x3c')][_0x67d8('0x42')](_0x67d8('0x43'))){_0x45a9d6['limit']=qs[_0x67d8('0x44')](_0x2330ea['query'][_0x67d8('0x44')]);_0x45a9d6[_0x67d8('0x2b')]=qs[_0x67d8('0x2b')](_0x2330ea[_0x67d8('0x3c')][_0x67d8('0x2b')]);}_0x45a9d6[_0x67d8('0x45')]=qs[_0x67d8('0x46')](_0x2330ea[_0x67d8('0x3c')][_0x67d8('0x46')]);_0x45a9d6[_0x67d8('0x47')]=qs[_0x67d8('0x48')](_[_0x67d8('0x49')](_0x2330ea[_0x67d8('0x3c')],_0x1168c8[_0x67d8('0x48')]),_0x69882f);if(_0x2330ea[_0x67d8('0x3c')][_0x67d8('0x4a')]){_0x45a9d6[_0x67d8('0x47')]=_[_0x67d8('0x4b')](_0x45a9d6[_0x67d8('0x47')],{'$or':_[_0x67d8('0x4c')](_0x69882f,function(_0x3e420e){if(_0x3e420e[_0x67d8('0x39')]!==_0x67d8('0x4d')){var _0x1d7ef5={};_0x1d7ef5[_0x3e420e[_0x67d8('0x35')]]={'$like':'%'+_0x2330ea[_0x67d8('0x3c')][_0x67d8('0x4a')]+'%'};return _0x1d7ef5;}})});}_0x45a9d6=_[_0x67d8('0x4b')]({},_0x45a9d6,_0x2330ea['options']);var _0xca1613={'where':_0x45a9d6[_0x67d8('0x47')]};return db[_0x67d8('0x36')][_0x67d8('0x2d')](_0xca1613)[_0x67d8('0x1f')](function(_0x5f1f0){_0x564023['count']=_0x5f1f0;if(_0x2330ea['query'][_0x67d8('0x4e')]){_0x45a9d6['include']=[{'all':!![]}];}return db[_0x67d8('0x36')][_0x67d8('0x4f')](_0x45a9d6);})[_0x67d8('0x1f')](function(_0x145f32){_0x564023[_0x67d8('0x50')]=_0x145f32;return _0x564023;})[_0x67d8('0x1f')](respondWithFilteredResult(_0x36fd54,_0x45a9d6))[_0x67d8('0x51')](handleError(_0x36fd54,null));};exports['show']=function(_0x1e2fe2,_0x51b59a){var _0x17be11={'raw':![],'where':{'id':_0x1e2fe2['params']['id']}},_0x3c4e7f={};_0x3c4e7f[_0x67d8('0x3b')]=_[_0x67d8('0x3d')](db['Setting'][_0x67d8('0x37')]);_0x3c4e7f[_0x67d8('0x3c')]=_[_0x67d8('0x3d')](_0x1e2fe2[_0x67d8('0x3c')]);_0x3c4e7f['filters']=_['intersection'](_0x3c4e7f[_0x67d8('0x3b')],_0x3c4e7f['query']);_0x17be11[_0x67d8('0x3f')]=_[_0x67d8('0x3e')](_0x3c4e7f['model'],qs[_0x67d8('0x40')](_0x1e2fe2[_0x67d8('0x3c')]['fields']));_0x17be11['attributes']=_0x17be11[_0x67d8('0x3f')][_0x67d8('0x41')]?_0x17be11[_0x67d8('0x3f')]:_0x3c4e7f[_0x67d8('0x3b')];if(_0x1e2fe2[_0x67d8('0x3c')][_0x67d8('0x4e')]){_0x17be11['include']=[{'all':!![]}];}_0x17be11=_[_0x67d8('0x4b')]({},_0x17be11,_0x1e2fe2[_0x67d8('0x52')]);return db[_0x67d8('0x36')][_0x67d8('0x53')](_0x17be11)[_0x67d8('0x1f')](handleEntityNotFound(_0x51b59a,null))['then'](respondWithResult(_0x51b59a,null))['catch'](handleError(_0x51b59a,null));};exports['update']=function(_0x219159,_0x23aa01){if(_0x219159[_0x67d8('0x54')]['id']){delete _0x219159[_0x67d8('0x54')]['id'];}return db['Setting'][_0x67d8('0x53')]({'where':{'id':_0x219159['params']['id']}})['then'](handleEntityNotFound(_0x23aa01,null))[_0x67d8('0x1f')](saveUpdates(_0x219159[_0x67d8('0x54')],null))['then'](respondWithResult(_0x23aa01,null))['catch'](handleError(_0x23aa01,null));};exports['addLogo']=function(_0x66667,_0x31d6bd,_0x10ba69){if(_0x66667[_0x67d8('0x55')]&&_0x66667['file'][_0x67d8('0x56')]){_0x66667['body'][_0x67d8('0x57')]=_0x66667[_0x67d8('0x55')]['filename'];}return db['Setting']['find']({'where':{'id':_0x66667[_0x67d8('0x58')]['id']}})[_0x67d8('0x1f')](handleEntityNotFound(_0x31d6bd,null))[_0x67d8('0x1f')](saveUpdates(_0x66667[_0x67d8('0x54')],null))[_0x67d8('0x1f')](respondWithResult(_0x31d6bd,null))[_0x67d8('0x51')](handleError(_0x31d6bd,null));};exports[_0x67d8('0x59')]=function(_0x3eeb4b,_0x3f5a40,_0x224804){if(_0x3eeb4b[_0x67d8('0x55')]&&_0x3eeb4b[_0x67d8('0x55')][_0x67d8('0x56')]){_0x3eeb4b[_0x67d8('0x54')][_0x67d8('0x5a')]=_0x3eeb4b[_0x67d8('0x55')]['filename'];}return db[_0x67d8('0x36')][_0x67d8('0x53')]({'where':{'id':_0x3eeb4b[_0x67d8('0x58')]['id']}})[_0x67d8('0x1f')](handleEntityNotFound(_0x3f5a40,null))['then'](saveUpdates(_0x3eeb4b[_0x67d8('0x54')],null))[_0x67d8('0x1f')](respondWithResult(_0x3f5a40,null))[_0x67d8('0x51')](handleError(_0x3f5a40,null));};var utilLicense=require('../../config/license/util');exports[_0x67d8('0x5b')]=function(_0x21bcf1,_0x350778,_0x13c92a){var _0x4f370c=_0x67d8('0x5c');var _0x4373fb={'custom':![]};return utilLicense[_0x67d8('0x5d')]()[_0x67d8('0x1f')](function(_0x58f04c){if(_0x58f04c){_0x4373fb=_0x58f04c;}return db[_0x67d8('0x36')]['find']({'where':{'id':_0x21bcf1[_0x67d8('0x58')]['id']},'attributes':['logo','loginLogo',_0x67d8('0x5e'),_0x67d8('0x5f'),_0x67d8('0x60'),_0x67d8('0x61'),_0x67d8('0x62'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x350778,null))[_0x67d8('0x1f')](function(_0x2c8787){if(_0x2c8787){var _0x3d0083=_0x2c8787[_0x67d8('0x57')]&&fs[_0x67d8('0x63')](path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x4f370c,_[_0x67d8('0x66')](_0x2c8787[_0x67d8('0x57')])))?path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x4f370c,_[_0x67d8('0x66')](_0x2c8787[_0x67d8('0x57')])):path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x4f370c,_[_0x67d8('0x66')]('default_logo.svg'));var _0x1e71f6=_0x67d8('0x67')+_[_0x67d8('0x68')]('logo');if(_0x2c8787[_0x1e71f6]||!_0x4373fb[_0x67d8('0x69')]){_0x3d0083=path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x4f370c,_[_0x67d8('0x66')](_0x67d8('0x6a')));}if(!fs['existsSync'](_0x3d0083)){throw new db['Sequelize'][(_0x67d8('0x6b'))](_['upperFirst'](_0x67d8('0x57'))+'\x20not\x20found');}return _0x350778[_0x67d8('0x6c')](_0x3d0083);}})[_0x67d8('0x51')](handleError(_0x350778,null));};var utilLicense=require(_0x67d8('0x6d'));exports[_0x67d8('0x6e')]=function(_0x8f8127,_0x3d87c5,_0x525772){var _0x1c20d9=_0x67d8('0x5c');var _0x1af50a={'custom':![]};return utilLicense[_0x67d8('0x5d')]()[_0x67d8('0x1f')](function(_0x2088ce){if(_0x2088ce){_0x1af50a=_0x2088ce;}return db[_0x67d8('0x36')][_0x67d8('0x53')]({'where':{'id':_0x8f8127['params']['id']},'attributes':[_0x67d8('0x57'),_0x67d8('0x5a'),_0x67d8('0x5e'),_0x67d8('0x5f'),_0x67d8('0x60'),_0x67d8('0x61'),_0x67d8('0x62'),'defaultFavicon'],'raw':!![]});})[_0x67d8('0x1f')](handleEntityNotFound(_0x3d87c5,null))[_0x67d8('0x1f')](function(_0x3c1a0e){if(_0x3c1a0e){var _0x3e085b=_0x3c1a0e[_0x67d8('0x5a')]&&fs[_0x67d8('0x63')](path['join'](config['root'],_0x1c20d9,_[_0x67d8('0x66')](_0x3c1a0e[_0x67d8('0x5a')])))?path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x1c20d9,_['toLower'](_0x3c1a0e[_0x67d8('0x5a')])):path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x1c20d9,_['toLower'](_0x67d8('0x6f')));var _0x5ed206='default'+_[_0x67d8('0x68')](_0x67d8('0x5a'));if(_0x3c1a0e[_0x5ed206]||!_0x1af50a[_0x67d8('0x69')]){_0x3e085b=path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x1c20d9,_['toLower'](_0x67d8('0x6f')));}if(!fs[_0x67d8('0x63')](_0x3e085b)){throw new db['Sequelize']['ValidationError'](_[_0x67d8('0x68')](_0x67d8('0x5a'))+'\x20not\x20found');}return _0x3d87c5['download'](_0x3e085b);}})[_0x67d8('0x51')](handleError(_0x3d87c5,null));};exports[_0x67d8('0x70')]=function(_0x5b4dbc,_0x22bf47){return db['Setting']['find']({'where':{'id':_0x5b4dbc[_0x67d8('0x58')]['id']},'attributes':[_0x67d8('0x71')]})['then'](respondWithResult(_0x22bf47,null))[_0x67d8('0x51')](handleError(_0x22bf47,null));};exports[_0x67d8('0x72')]=function(_0x52e04a,_0x363348,_0x21439b){if(_0x52e04a[_0x67d8('0x55')]&&_0x52e04a[_0x67d8('0x55')]['filename']){_0x52e04a[_0x67d8('0x54')][_0x67d8('0x5e')]=_0x52e04a[_0x67d8('0x55')][_0x67d8('0x56')];}return db[_0x67d8('0x36')][_0x67d8('0x53')]({'where':{'id':_0x52e04a[_0x67d8('0x58')]['id']}})[_0x67d8('0x1f')](handleEntityNotFound(_0x363348,null))[_0x67d8('0x1f')](saveUpdates(_0x52e04a[_0x67d8('0x54')],null))[_0x67d8('0x1f')](respondWithResult(_0x363348,null))[_0x67d8('0x51')](handleError(_0x363348,null));};var utilLicense=require(_0x67d8('0x6d'));exports[_0x67d8('0x73')]=function(_0x48a8da,_0x576de0,_0x2d429b){var _0x7d785a=_0x67d8('0x5c');var _0x4dd15a={'custom':![]};return utilLicense[_0x67d8('0x5d')]()[_0x67d8('0x1f')](function(_0xe84293){if(_0xe84293){_0x4dd15a=_0xe84293;}return db[_0x67d8('0x36')][_0x67d8('0x53')]({'where':{'id':_0x48a8da[_0x67d8('0x58')]['id']},'attributes':['logo','loginLogo',_0x67d8('0x5e'),_0x67d8('0x5f'),'defaultLogo','defaultLoginLogo',_0x67d8('0x62'),_0x67d8('0x74')],'raw':!![]});})[_0x67d8('0x1f')](handleEntityNotFound(_0x576de0,null))[_0x67d8('0x1f')](function(_0x4aa4f3){if(_0x4aa4f3){var _0x4f9794=_0x4aa4f3[_0x67d8('0x5e')]&&fs['existsSync'](path['join'](config['root'],_0x7d785a,_[_0x67d8('0x66')](_0x4aa4f3[_0x67d8('0x5e')])))?path['join'](config[_0x67d8('0x65')],_0x7d785a,_[_0x67d8('0x66')](_0x4aa4f3['preferred'])):path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x7d785a,_[_0x67d8('0x66')](_0x67d8('0x75')));var _0x4351f9=_0x67d8('0x67')+_[_0x67d8('0x68')](_0x67d8('0x5e'));if(_0x4aa4f3[_0x4351f9]||!_0x4dd15a[_0x67d8('0x69')]||!_0x4dd15a[_0x67d8('0x5e')]){_0x4f9794=path[_0x67d8('0x64')](config['root'],_0x7d785a,_['toLower']('default_preferred.png'));}if(!fs[_0x67d8('0x63')](_0x4f9794)){throw new db['Sequelize'][(_0x67d8('0x6b'))](_['upperFirst']('preferred')+_0x67d8('0x76'));}return _0x576de0[_0x67d8('0x6c')](_0x4f9794);}})[_0x67d8('0x51')](handleError(_0x576de0,null));};exports[_0x67d8('0x77')]=function(_0x1fa07f,_0x2aa6bc,_0x3f1df5){if(_0x1fa07f['file']&&_0x1fa07f[_0x67d8('0x55')][_0x67d8('0x56')]){_0x1fa07f[_0x67d8('0x54')][_0x67d8('0x5f')]=_0x1fa07f[_0x67d8('0x55')][_0x67d8('0x56')];}return db['Setting'][_0x67d8('0x53')]({'where':{'id':_0x1fa07f[_0x67d8('0x58')]['id']}})[_0x67d8('0x1f')](handleEntityNotFound(_0x2aa6bc,null))[_0x67d8('0x1f')](saveUpdates(_0x1fa07f[_0x67d8('0x54')],null))[_0x67d8('0x1f')](respondWithResult(_0x2aa6bc,null))[_0x67d8('0x51')](handleError(_0x2aa6bc,null));};var utilLicense=require(_0x67d8('0x6d'));exports[_0x67d8('0x78')]=function(_0x37a6a5,_0x18397f,_0x1d08e8){var _0x2049db=_0x67d8('0x5c');var _0xbbd3ac={'custom':![]};return utilLicense['getLicense']()[_0x67d8('0x1f')](function(_0x357b0){if(_0x357b0){_0xbbd3ac=_0x357b0;}return db[_0x67d8('0x36')][_0x67d8('0x53')]({'where':{'id':_0x37a6a5[_0x67d8('0x58')]['id']},'attributes':[_0x67d8('0x57'),_0x67d8('0x5a'),_0x67d8('0x5e'),_0x67d8('0x5f'),_0x67d8('0x60'),_0x67d8('0x61'),_0x67d8('0x62'),'defaultFavicon'],'raw':!![]});})[_0x67d8('0x1f')](handleEntityNotFound(_0x18397f,null))['then'](function(_0xd28ea2){if(_0xd28ea2){var _0xd0e43=_0xd28ea2['favicon']&&fs[_0x67d8('0x63')](path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x2049db,_[_0x67d8('0x66')](_0xd28ea2[_0x67d8('0x5f')])))?path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x2049db,_['toLower'](_0xd28ea2[_0x67d8('0x5f')])):path[_0x67d8('0x64')](config[_0x67d8('0x65')],_0x2049db,_[_0x67d8('0x66')](_0x67d8('0x79')));var _0x55aceb='default'+_[_0x67d8('0x68')]('favicon');if(_0xd28ea2[_0x55aceb]||!_0xbbd3ac[_0x67d8('0x69')]){_0xd0e43=path['join'](config[_0x67d8('0x65')],_0x2049db,_['toLower'](_0x67d8('0x79')));}if(!fs[_0x67d8('0x63')](_0xd0e43)){throw new db['Sequelize'][(_0x67d8('0x6b'))](_['upperFirst']('favicon')+_0x67d8('0x76'));}return _0x18397f[_0x67d8('0x6c')](_0xd0e43);}})[_0x67d8('0x51')](handleError(_0x18397f,null));};exports[_0x67d8('0x7a')]=function(_0x942057,_0x572801){var _0x568678={'offset':moment()[_0x67d8('0x7b')]()};_0x568678[_0x67d8('0x7c')]=moment()[_0x67d8('0x7b')](_0x568678['offset'])['format'](_0x67d8('0x7d'));return _0x572801[_0x67d8('0x29')](0xc8)[_0x67d8('0x7e')](_0x568678);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d765675..497608d 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x245505,_0x2cfe7b){var _0x424bcb=function(_0x10c8df){while(--_0x10c8df){_0x245505['push'](_0x245505['shift']());}};_0x424bcb(++_0x2cfe7b);}(_0x3e74,0x175));var _0x43e7=function(_0x1d3f69,_0x5caa96){_0x1d3f69=_0x1d3f69-0x0;var _0x9d899f=_0x3e74[_0x1d3f69];return _0x9d899f;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7217,0x19e));var _0x7721=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x7217[_0x433a86];return _0x23000c;};'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 f0352d6..002376f 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 _0x825d=['Setting,\x20%s,\x20%s,\x20%s','error','message','catch','ShowSetting','Setting','find','options','where','include','map','attributes','model','debug','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','then','info','Setting,\x20%s,\x20%s','request\x20sent'];(function(_0x3162b1,_0x4ae511){var _0x144344=function(_0x2df0cd){while(--_0x2df0cd){_0x3162b1['push'](_0x3162b1['shift']());}};_0x144344(++_0x4ae511);}(_0x825d,0x143));var _0xd825=function(_0x11e64a,_0x1333ad){_0x11e64a=_0x11e64a-0x0;var _0x48a502=_0x825d[_0x11e64a];return _0x48a502;};'use strict';var _=require(_0xd825('0x0'));var util=require(_0xd825('0x1'));var moment=require(_0xd825('0x2'));var BPromise=require(_0xd825('0x3'));var rs=require(_0xd825('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd825('0x5'));var logger=require(_0xd825('0x6'))('rpc');var config=require(_0xd825('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd825('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d72d9,_0x13e69b,_0x4a42f4){return new BPromise(function(_0x5d769b,_0x3343b4){return client['request'](_0x4d72d9,_0x4a42f4)[_0xd825('0x9')](function(_0x496447){logger[_0xd825('0xa')](_0xd825('0xb'),_0x13e69b,_0xd825('0xc'));logger['debug'](_0xd825('0xd'),_0x13e69b,'request\x20sent',JSON['stringify'](_0x496447));if(_0x496447[_0xd825('0xe')]){if(_0x496447['error']['code']===0x1f4){logger[_0xd825('0xe')]('Setting,\x20%s,\x20%s',_0x13e69b,_0x496447[_0xd825('0xe')][_0xd825('0xf')]);return _0x3343b4(_0x496447[_0xd825('0xe')][_0xd825('0xf')]);}logger[_0xd825('0xe')]('Setting,\x20%s,\x20%s',_0x13e69b,_0x496447[_0xd825('0xe')][_0xd825('0xf')]);return _0x5d769b(_0x496447[_0xd825('0xe')][_0xd825('0xf')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x13e69b,_0xd825('0xc'));_0x5d769b(_0x496447['result']['message']);}})[_0xd825('0x10')](function(_0x3d8dca){logger[_0xd825('0xe')]('Setting,\x20%s,\x20%s',_0x13e69b,_0x3d8dca);_0x3343b4(_0x3d8dca);});});}exports[_0xd825('0x11')]=function(_0x37cebf){var _0x4c6ced=this;return new Promise(function(_0xc6f116,_0x454546){return db[_0xd825('0x12')][_0xd825('0x13')]({'raw':_0x37cebf[_0xd825('0x14')]?_0x37cebf[_0xd825('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x37cebf[_0xd825('0x14')]?_0x37cebf['options'][_0xd825('0x15')]||null:null,'attributes':_0x37cebf[_0xd825('0x14')]?_0x37cebf['options']['attributes']||null:null,'include':_0x37cebf[_0xd825('0x14')]?_0x37cebf[_0xd825('0x14')][_0xd825('0x16')]?_[_0xd825('0x17')](_0x37cebf['options']['include'],function(_0x46a818){return{'model':db[_0x46a818['model']],'as':_0x46a818['as'],'attributes':_0x46a818[_0xd825('0x18')],'include':_0x46a818[_0xd825('0x16')]?_[_0xd825('0x17')](_0x46a818[_0xd825('0x16')],function(_0x260a5){return{'model':db[_0x260a5[_0xd825('0x19')]],'as':_0x260a5['as'],'attributes':_0x260a5[_0xd825('0x18')],'include':_0x260a5[_0xd825('0x16')]?_[_0xd825('0x17')](_0x260a5[_0xd825('0x16')],function(_0x5301d9){return{'model':db[_0x5301d9[_0xd825('0x19')]],'as':_0x5301d9['as'],'attributes':_0x5301d9[_0xd825('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd825('0x9')](function(_0x4b3944){logger[_0xd825('0xa')](_0xd825('0x11'),_0x37cebf);logger[_0xd825('0x1a')]('ShowSetting',_0x37cebf,JSON[_0xd825('0x1b')](_0x4b3944));_0xc6f116(_0x4b3944);})[_0xd825('0x10')](function(_0x149cee){logger[_0xd825('0xe')](_0xd825('0x11'),_0x149cee[_0xd825('0xf')],_0x37cebf);_0x454546(_0x4c6ced[_0xd825('0xe')](0x1f4,_0x149cee[_0xd825('0xf')]));});});}; \ No newline at end of file +var _0xa794=['then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','Setting','find','options','raw','where','attributes','include','model','map','ShowSetting','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x99d710,_0x52fca0){var _0x54ffbd=function(_0x45c96a){while(--_0x45c96a){_0x99d710['push'](_0x99d710['shift']());}};_0x54ffbd(++_0x52fca0);}(_0xa794,0x1c1));var _0x4a79=function(_0x52f932,_0x1e9273){_0x52f932=_0x52f932-0x0;var _0x53d454=_0xa794[_0x52f932];return _0x53d454;};'use strict';var _=require(_0x4a79('0x0'));var util=require(_0x4a79('0x1'));var moment=require(_0x4a79('0x2'));var BPromise=require(_0x4a79('0x3'));var rs=require(_0x4a79('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a79('0x5'));var logger=require(_0x4a79('0x6'))(_0x4a79('0x7'));var config=require(_0x4a79('0x8'));var jayson=require(_0x4a79('0x9'));var client=jayson[_0x4a79('0xa')][_0x4a79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3296ed,_0x55047e,_0x485099){return new BPromise(function(_0x331a6d,_0x42299e){return client[_0x4a79('0xc')](_0x3296ed,_0x485099)[_0x4a79('0xd')](function(_0x1b5774){logger[_0x4a79('0xe')](_0x4a79('0xf'),_0x55047e,'request\x20sent');logger[_0x4a79('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x55047e,_0x4a79('0x11'),JSON[_0x4a79('0x12')](_0x1b5774));if(_0x1b5774[_0x4a79('0x13')]){if(_0x1b5774[_0x4a79('0x13')]['code']===0x1f4){logger[_0x4a79('0x13')](_0x4a79('0xf'),_0x55047e,_0x1b5774[_0x4a79('0x13')][_0x4a79('0x14')]);return _0x42299e(_0x1b5774['error'][_0x4a79('0x14')]);}logger[_0x4a79('0x13')]('Setting,\x20%s,\x20%s',_0x55047e,_0x1b5774[_0x4a79('0x13')][_0x4a79('0x14')]);return _0x331a6d(_0x1b5774[_0x4a79('0x13')][_0x4a79('0x14')]);}else{logger['info'](_0x4a79('0xf'),_0x55047e,'request\x20sent');_0x331a6d(_0x1b5774[_0x4a79('0x15')]['message']);}})[_0x4a79('0x16')](function(_0x569d01){logger[_0x4a79('0x13')](_0x4a79('0xf'),_0x55047e,_0x569d01);_0x42299e(_0x569d01);});});}exports['ShowSetting']=function(_0x5753c8){var _0x4133f6=this;return new Promise(function(_0x4909af,_0x5ab65a){return db[_0x4a79('0x17')][_0x4a79('0x18')]({'raw':_0x5753c8[_0x4a79('0x19')]?_0x5753c8['options'][_0x4a79('0x1a')]===undefined?!![]:![]:!![],'where':_0x5753c8[_0x4a79('0x19')]?_0x5753c8['options'][_0x4a79('0x1b')]||null:null,'attributes':_0x5753c8[_0x4a79('0x19')]?_0x5753c8['options'][_0x4a79('0x1c')]||null:null,'include':_0x5753c8[_0x4a79('0x19')]?_0x5753c8[_0x4a79('0x19')][_0x4a79('0x1d')]?_['map'](_0x5753c8['options'][_0x4a79('0x1d')],function(_0x4bcd5a){return{'model':db[_0x4bcd5a[_0x4a79('0x1e')]],'as':_0x4bcd5a['as'],'attributes':_0x4bcd5a[_0x4a79('0x1c')],'include':_0x4bcd5a[_0x4a79('0x1d')]?_['map'](_0x4bcd5a['include'],function(_0x1d1e88){return{'model':db[_0x1d1e88[_0x4a79('0x1e')]],'as':_0x1d1e88['as'],'attributes':_0x1d1e88[_0x4a79('0x1c')],'include':_0x1d1e88[_0x4a79('0x1d')]?_[_0x4a79('0x1f')](_0x1d1e88[_0x4a79('0x1d')],function(_0x2a1a00){return{'model':db[_0x2a1a00['model']],'as':_0x2a1a00['as'],'attributes':_0x2a1a00[_0x4a79('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4a79('0xd')](function(_0xa83cc8){logger[_0x4a79('0xe')](_0x4a79('0x20'),_0x5753c8);logger[_0x4a79('0x10')](_0x4a79('0x20'),_0x5753c8,JSON['stringify'](_0xa83cc8));_0x4909af(_0xa83cc8);})['catch'](function(_0x5c3486){logger[_0x4a79('0x13')](_0x4a79('0x20'),_0x5c3486[_0x4a79('0x14')],_0x5753c8);_0x5ab65a(_0x4133f6[_0x4a79('0x13')](0x1f4,_0x5c3486[_0x4a79('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 69d7796..7c0301d 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 _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x2c4540,_0x2859d2){var _0x527b47=function(_0x2a73e5){while(--_0x2a73e5){_0x2c4540['push'](_0x2c4540['shift']());}};_0x527b47(++_0x2859d2);}(_0x6aa7,0x178));var _0x76aa=function(_0x27dcca,_0x16d4dd){_0x27dcca=_0x27dcca-0x0;var _0x1b10f7=_0x6aa7[_0x27dcca];return _0x1b10f7;};'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('./smsAccount.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('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x3274b8,_0x4b1656){var _0x5a017c=function(_0x19f90b){while(--_0x19f90b){_0x3274b8['push'](_0x3274b8['shift']());}};_0x5a017c(++_0x4b1656);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 148f33e..cb2358a 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 _0x130c=['bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','plivo'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0x130c,0x1ae));var _0xc130=function(_0x550e8f,_0x4bba5c){_0x550e8f=_0x550e8f-0x0;var _0x3e67a7=_0x130c[_0x550e8f];return _0x3e67a7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc130('0x0'));module[_0xc130('0x1')]={'name':{'type':Sequelize[_0xc130('0x2')],'unique':_0xc130('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc130('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xc130('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc130('0x4')]();}},'phone':{'type':Sequelize[_0xc130('0x2')]},'type':{'type':Sequelize[_0xc130('0x5')](_0xc130('0x6'),_0xc130('0x7'),_0xc130('0x8'),'clicksend',_0xc130('0x9'),'clickatell',_0xc130('0xa'),_0xc130('0xb'),_0xc130('0xc'),_0xc130('0xd'))},'accountSid':{'type':Sequelize[_0xc130('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc130('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xc130('0x2')]},'password':{'type':Sequelize[_0xc130('0x2')]},'apiKey':{'type':Sequelize[_0xc130('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xc130('0x2')]},'deliveryReport':{'type':Sequelize[_0xc130('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xc130('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc130('0xf')],'defaultValue':function(){return _0xc130('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc130('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc130('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc130('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc130('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc130('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc130('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc130('0x11')],'comment':_0xc130('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xc130('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x130f87){if(!_0x130f87)this[_0xc130('0x13')](_0xc130('0x14'),null);this['setDataValue'](_0xc130('0x15'),_0x130f87);}}}; \ No newline at end of file +var _0x32ea=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x43bf3b,_0x45e80b){var _0xa540d7=function(_0x3301b9){while(--_0x3301b9){_0x43bf3b['push'](_0x43bf3b['shift']());}};_0xa540d7(++_0x45e80b);}(_0x32ea,0xde));var _0xa32e=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x32ea[_0x22f8ab];return _0x2a70e5;};'use strict';var Sequelize=require(_0xa32e('0x0'));var rs=require(_0xa32e('0x1'));module[_0xa32e('0x2')]={'name':{'type':Sequelize[_0xa32e('0x3')],'unique':_0xa32e('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xa32e('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa32e('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xa32e('0x3')]},'type':{'type':Sequelize[_0xa32e('0x5')](_0xa32e('0x6'),_0xa32e('0x7'),'connectel',_0xa32e('0x8'),'plivo',_0xa32e('0x9'),_0xa32e('0xa'),_0xa32e('0xb'),_0xa32e('0xc'),_0xa32e('0xd'))},'accountSid':{'type':Sequelize[_0xa32e('0x3')]},'authId':{'type':Sequelize[_0xa32e('0x3')]},'authToken':{'type':Sequelize[_0xa32e('0x3')]},'smsMethod':{'type':Sequelize[_0xa32e('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa32e('0x3')]},'password':{'type':Sequelize[_0xa32e('0x3')]},'apiKey':{'type':Sequelize[_0xa32e('0x3')]},'applicationId':{'type':Sequelize[_0xa32e('0x3')]},'accountId':{'type':Sequelize[_0xa32e('0x3')]},'senderString':{'type':Sequelize[_0xa32e('0x3')]},'deliveryReport':{'type':Sequelize[_0xa32e('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xa32e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa32e('0xf');}},'notificationSound':{'type':Sequelize[_0xa32e('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa32e('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa32e('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa32e('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa32e('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa32e('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa32e('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa32e('0x10')],'comment':_0xa32e('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xa32e('0xe')],'defaultValue':![],'comment':_0xa32e('0x12'),'set':function(_0x3c0063){if(!_0x3c0063)this[_0xa32e('0x13')]('mandatoryDispositionPauseId',null);this[_0xa32e('0x13')]('mandatoryDisposition',_0x3c0063);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index c2603e4..663b711 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 _0xfd4e=['sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','name','send','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','query','filters','model','attributes','fields','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows','show','Pause','keys','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','findAll','removeAnswers','sms','SmsApplication','Applications','account','orderBy','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','from','From','MessageSid','skebby','text','connectel','clicksend','messageId','plivo','Text','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','CmContact','DESC','list','omit','Contacts','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','addApplications','sequelize','ISOLATION_LEVELS','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','tag','to\x20is\x20mandatory','CmList','List','dataValues','Messages','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','message_id','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','csc','state','message-id','addAgents','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x33a62a,_0x4ea9c8){var _0x3afa43=function(_0x5c2bab){while(--_0x5c2bab){_0x33a62a['push'](_0x33a62a['shift']());}};_0x3afa43(++_0x4ea9c8);}(_0xfd4e,0x1bc));var _0xefd4=function(_0x5d9fd0,_0x2cb36f){_0x5d9fd0=_0x5d9fd0-0x0;var _0x9a10be=_0xfd4e[_0x5d9fd0];return _0x9a10be;};'use strict';var emlformat=require(_0xefd4('0x0'));var rimraf=require(_0xefd4('0x1'));var zipdir=require(_0xefd4('0x2'));var jsonpatch=require(_0xefd4('0x3'));var rp=require(_0xefd4('0x4'));var moment=require(_0xefd4('0x5'));var BPromise=require(_0xefd4('0x6'));var Mustache=require('mustache');var util=require(_0xefd4('0x7'));var path=require('path');var sox=require(_0xefd4('0x8'));var csv=require('to-csv');var ejs=require(_0xefd4('0x9'));var fs=require('fs');var fs_extra=require(_0xefd4('0xa'));var _=require('lodash');var squel=require(_0xefd4('0xb'));var crypto=require('crypto');var jsforce=require(_0xefd4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xefd4('0xd'));var querystring=require(_0xefd4('0xe'));var Papa=require(_0xefd4('0xf'));var Redis=require(_0xefd4('0x10'));var authService=require(_0xefd4('0x11'));var qs=require(_0xefd4('0x12'));var as=require(_0xefd4('0x13'));var hardwareService=require(_0xefd4('0x14'));var logger=require(_0xefd4('0x15'))(_0xefd4('0x16'));var utils=require(_0xefd4('0x17'));var config=require(_0xefd4('0x18'));var licenseUtil=require(_0xefd4('0x19'));var db=require(_0xefd4('0x1a'))['db'];config['redis']=_[_0xefd4('0x1b')](config['redis'],{'host':_0xefd4('0x1c'),'port':0x18eb});var socket=require(_0xefd4('0x1d'))(new Redis(config[_0xefd4('0x1e')]));require('./smsAccount.socket')[_0xefd4('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xefd4('0x20')][_0xefd4('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x59e657,_0x33dfc7,_0x580a79,_0x3ed587){return new BPromise(function(_0x11490b,_0x176ea3){var _0x4cf783=_0x3ed587||client;return _0x4cf783[_0xefd4('0x22')](_0x59e657,_0x580a79)[_0xefd4('0x23')](function(_0x4e483f){logger[_0xefd4('0x24')](_0xefd4('0x25'),_0x33dfc7,_0xefd4('0x26'));logger[_0xefd4('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33dfc7,_0xefd4('0x26'),JSON['stringify'](_0x4e483f));if(_0x4e483f[_0xefd4('0x28')]){if(_0x4e483f[_0xefd4('0x28')][_0xefd4('0x29')]===0x1f4){logger[_0xefd4('0x28')](_0xefd4('0x25'),_0x33dfc7,_0x4e483f[_0xefd4('0x28')][_0xefd4('0x2a')]);return _0x176ea3(_0x4e483f[_0xefd4('0x28')][_0xefd4('0x2a')]);}logger['error'](_0xefd4('0x25'),_0x33dfc7,_0x4e483f[_0xefd4('0x28')][_0xefd4('0x2a')]);return _0x11490b(_0x4e483f[_0xefd4('0x28')]['message']);}else{logger[_0xefd4('0x24')](_0xefd4('0x25'),_0x33dfc7,_0xefd4('0x26'));_0x11490b(_0x4e483f[_0xefd4('0x2b')]['message']);}})[_0xefd4('0x2c')](function(_0x3b9030){logger[_0xefd4('0x28')](_0xefd4('0x25'),_0x33dfc7,_0x3b9030);_0x176ea3(_0x3b9030);});});}function respondWithStatusCode(_0x56ab82,_0x17dd2c){_0x17dd2c=_0x17dd2c||0xcc;return function(_0x506625){if(_0x506625){return _0x56ab82[_0xefd4('0x2d')](_0x17dd2c);}return _0x56ab82[_0xefd4('0x2e')](_0x17dd2c)[_0xefd4('0x2f')]();};}function respondWithResult(_0x361dd1,_0x49509d){_0x49509d=_0x49509d||0xc8;return function(_0x23e4c1){if(_0x23e4c1){return _0x361dd1['status'](_0x49509d)[_0xefd4('0x30')](_0x23e4c1);}};}function respondWithFilteredResult(_0x106a6a,_0x3e5560){return function(_0x15046d){if(_0x15046d){var _0x3702bd=typeof _0x3e5560[_0xefd4('0x31')]===_0xefd4('0x32')&&typeof _0x3e5560[_0xefd4('0x33')]===_0xefd4('0x32');var _0xc0c57f=_0x15046d[_0xefd4('0x34')];var _0x78af39=_0x3702bd?0x0:_0x3e5560[_0xefd4('0x31')];var _0x52ca07=_0x3702bd?_0x15046d[_0xefd4('0x34')]:_0x3e5560[_0xefd4('0x31')]+_0x3e5560[_0xefd4('0x33')];var _0x51242a;if(_0x52ca07>=_0xc0c57f){_0x52ca07=_0xc0c57f;_0x51242a=0xc8;}else{_0x51242a=0xce;}_0x106a6a[_0xefd4('0x2e')](_0x51242a);return _0x106a6a[_0xefd4('0x35')](_0xefd4('0x36'),_0x78af39+'-'+_0x52ca07+'/'+_0xc0c57f)[_0xefd4('0x30')](_0x15046d);}return null;};}function patchUpdates(_0x48c25b){return function(_0x3f8787){try{jsonpatch[_0xefd4('0x37')](_0x3f8787,_0x48c25b,!![]);}catch(_0x3c20a7){return BPromise[_0xefd4('0x38')](_0x3c20a7);}return _0x3f8787['save']();};}function saveUpdates(_0x77995e,_0x4d3e50){return function(_0x4c2140){if(_0x4c2140){return _0x4c2140[_0xefd4('0x39')](_0x77995e)[_0xefd4('0x23')](function(_0x516469){return _0x516469;});}return null;};}function removeEntity(_0x5930b8,_0x1a257b){return function(_0x5b3fed){if(_0x5b3fed){return _0x5b3fed[_0xefd4('0x3a')]()[_0xefd4('0x23')](function(){var _0x3c8cfd=_0x5b3fed[_0xefd4('0x3b')]({'plain':!![]});var _0x4a91ec=_0xefd4('0x3c');return db[_0xefd4('0x3d')][_0xefd4('0x3a')]({'where':{'type':_0x4a91ec,'resourceId':_0x3c8cfd['id']}})['then'](function(){return _0x5b3fed;});})[_0xefd4('0x23')](function(){_0x5930b8['status'](0xcc)[_0xefd4('0x2f')]();});}};}function handleEntityNotFound(_0x2facaf,_0x793534){return function(_0x4ef094){if(!_0x4ef094){_0x2facaf[_0xefd4('0x2d')](0x194);}return _0x4ef094;};}function handleError(_0x509dcc,_0x518e4f){_0x518e4f=_0x518e4f||0x1f4;return function(_0x596cb3){logger[_0xefd4('0x28')](_0x596cb3['stack']);if(_0x596cb3[_0xefd4('0x3e')]){delete _0x596cb3[_0xefd4('0x3e')];}_0x509dcc['status'](_0x518e4f)[_0xefd4('0x3f')](_0x596cb3);};}exports['index']=function(_0x4bb169,_0x2e0224){var _0x15ecfb={'include':[{'model':db['Pause'],'as':_0xefd4('0x40')}]},_0x203d63={},_0x294977={'count':0x0,'rows':[]};var _0x3baa7e=_[_0xefd4('0x41')](db[_0xefd4('0x42')][_0xefd4('0x43')],function(_0x16ea34){return{'name':_0x16ea34[_0xefd4('0x44')],'type':_0x16ea34['type'][_0xefd4('0x45')]};});_0x203d63['model']=_[_0xefd4('0x41')](_0x3baa7e,_0xefd4('0x3e'));_0x203d63[_0xefd4('0x46')]=_['keys'](_0x4bb169['query']);_0x203d63[_0xefd4('0x47')]=_['intersection'](_0x203d63[_0xefd4('0x48')],_0x203d63[_0xefd4('0x46')]);_0x15ecfb[_0xefd4('0x49')]=_['intersection'](_0x203d63['model'],qs[_0xefd4('0x4a')](_0x4bb169[_0xefd4('0x46')][_0xefd4('0x4a')]));_0x15ecfb[_0xefd4('0x49')]=_0x15ecfb['attributes']['length']?_0x15ecfb[_0xefd4('0x49')]:_0x203d63[_0xefd4('0x48')];if(!_0x4bb169[_0xefd4('0x46')][_0xefd4('0x4b')]('nolimit')){_0x15ecfb[_0xefd4('0x33')]=qs[_0xefd4('0x33')](_0x4bb169[_0xefd4('0x46')][_0xefd4('0x33')]);_0x15ecfb[_0xefd4('0x31')]=qs[_0xefd4('0x31')](_0x4bb169[_0xefd4('0x46')][_0xefd4('0x31')]);}_0x15ecfb[_0xefd4('0x4c')]=qs[_0xefd4('0x4d')](_0x4bb169[_0xefd4('0x46')]['sort']);_0x15ecfb[_0xefd4('0x4e')]=qs[_0xefd4('0x47')](_[_0xefd4('0x4f')](_0x4bb169[_0xefd4('0x46')],_0x203d63[_0xefd4('0x47')]),_0x3baa7e);if(_0x4bb169[_0xefd4('0x46')]['filter']){_0x15ecfb['where']=_['merge'](_0x15ecfb[_0xefd4('0x4e')],{'$or':_['map'](_0x3baa7e,function(_0x5cb59d){if(_0x5cb59d[_0xefd4('0x50')]!==_0xefd4('0x51')){var _0x4329eb={};_0x4329eb[_0x5cb59d[_0xefd4('0x3e')]]={'$like':'%'+_0x4bb169[_0xefd4('0x46')]['filter']+'%'};return _0x4329eb;}})});}_0x15ecfb=_[_0xefd4('0x52')]({},_0x15ecfb,_0x4bb169[_0xefd4('0x53')]);var _0x4beed4={'where':_0x15ecfb['where']};return db[_0xefd4('0x42')][_0xefd4('0x34')](_0x4beed4)['then'](function(_0x11cff8){_0x294977['count']=_0x11cff8;if(_0x4bb169[_0xefd4('0x46')][_0xefd4('0x54')]){_0x15ecfb[_0xefd4('0x55')]=[{'all':!![]}];}return db[_0xefd4('0x42')]['findAll'](_0x15ecfb);})['then'](function(_0x487b53){_0x294977[_0xefd4('0x56')]=_0x487b53;return _0x294977;})[_0xefd4('0x23')](respondWithFilteredResult(_0x2e0224,_0x15ecfb))[_0xefd4('0x2c')](handleError(_0x2e0224,null));};exports[_0xefd4('0x57')]=function(_0x23e380,_0x3918a6){var _0x593b62={'raw':![],'where':{'id':_0x23e380['params']['id']},'include':[{'model':db[_0xefd4('0x58')],'as':_0xefd4('0x40')}]},_0x372142={};_0x372142['model']=_[_0xefd4('0x59')](db['SmsAccount'][_0xefd4('0x43')]);_0x372142[_0xefd4('0x46')]=_[_0xefd4('0x59')](_0x23e380['query']);_0x372142[_0xefd4('0x47')]=_[_0xefd4('0x5a')](_0x372142['model'],_0x372142[_0xefd4('0x46')]);_0x593b62[_0xefd4('0x49')]=_[_0xefd4('0x5a')](_0x372142[_0xefd4('0x48')],qs['fields'](_0x23e380['query'][_0xefd4('0x4a')]));_0x593b62[_0xefd4('0x49')]=_0x593b62[_0xefd4('0x49')][_0xefd4('0x5b')]?_0x593b62[_0xefd4('0x49')]:_0x372142[_0xefd4('0x48')];if(_0x23e380[_0xefd4('0x46')][_0xefd4('0x54')]){_0x593b62[_0xefd4('0x55')]=[{'all':!![]}];}_0x593b62=_['merge']({},_0x593b62,_0x23e380[_0xefd4('0x53')]);return db[_0xefd4('0x42')][_0xefd4('0x5c')](_0x593b62)['then'](handleEntityNotFound(_0x3918a6,null))[_0xefd4('0x23')](respondWithResult(_0x3918a6,null))[_0xefd4('0x2c')](handleError(_0x3918a6,null));};exports['create']=function(_0x2a45a6,_0x3d33f1){return db[_0xefd4('0x42')][_0xefd4('0x5d')](_0x2a45a6[_0xefd4('0x5e')],{})[_0xefd4('0x23')](function(_0x6c8a4c){var _0x7ad4ac=_0x2a45a6[_0xefd4('0x5f')][_0xefd4('0x3b')]({'plain':!![]});if(!_0x7ad4ac)throw new Error(_0xefd4('0x60'));if(_0x7ad4ac[_0xefd4('0x61')]===_0xefd4('0x5f')){var _0x45c49c=_0x6c8a4c[_0xefd4('0x3b')]({'plain':!![]});var _0x8f4c6d='SmsAccounts';return db[_0xefd4('0x62')][_0xefd4('0x5c')]({'where':{'name':_0x8f4c6d,'userProfileId':_0x7ad4ac['userProfileId']},'raw':!![]})[_0xefd4('0x23')](function(_0xe1a4f4){if(_0xe1a4f4&&_0xe1a4f4['autoAssociation']===0x0){return db['UserProfileResource'][_0xefd4('0x5d')]({'name':_0x45c49c[_0xefd4('0x3e')],'resourceId':_0x45c49c['id'],'type':_0xe1a4f4[_0xefd4('0x3e')],'sectionId':_0xe1a4f4['id']},{})[_0xefd4('0x23')](function(){return _0x6c8a4c;});}else{return _0x6c8a4c;}})[_0xefd4('0x2c')](function(_0x2cebca){logger[_0xefd4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cebca);throw _0x2cebca;});}return _0x6c8a4c;})[_0xefd4('0x23')](respondWithResult(_0x3d33f1,0xc9))[_0xefd4('0x2c')](handleError(_0x3d33f1,null));};exports['update']=function(_0x320835,_0x3a059b){if(_0x320835[_0xefd4('0x5e')]['id']){delete _0x320835[_0xefd4('0x5e')]['id'];}return db['SmsAccount'][_0xefd4('0x5c')]({'where':{'id':_0x320835[_0xefd4('0x63')]['id']},'include':[{'model':db[_0xefd4('0x58')],'as':_0xefd4('0x40')}]})[_0xefd4('0x23')](handleEntityNotFound(_0x3a059b,null))[_0xefd4('0x23')](saveUpdates(_0x320835[_0xefd4('0x5e')],null))[_0xefd4('0x23')](respondWithResult(_0x3a059b,null))[_0xefd4('0x2c')](handleError(_0x3a059b,null));};exports[_0xefd4('0x3a')]=function(_0x164d1b,_0x20ab3b){return db[_0xefd4('0x42')][_0xefd4('0x5c')]({'where':{'id':_0x164d1b['params']['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x20ab3b,null))[_0xefd4('0x23')](removeEntity(_0x20ab3b,null))[_0xefd4('0x2c')](handleError(_0x20ab3b,null));};exports[_0xefd4('0x64')]=function(_0x548e6f,_0x59762a){return db[_0xefd4('0x42')]['describe']()[_0xefd4('0x23')](respondWithResult(_0x59762a,null))[_0xefd4('0x2c')](handleError(_0x59762a,null));};exports[_0xefd4('0x65')]=function(_0x464b9f,_0x2adf94,_0x5563cb){if(_0x464b9f[_0xefd4('0x5e')]['id']){delete _0x464b9f[_0xefd4('0x5e')]['id'];}return db[_0xefd4('0x42')][_0xefd4('0x5c')]({'where':{'id':_0x464b9f[_0xefd4('0x63')]['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x2adf94,null))[_0xefd4('0x23')](function(_0x175e23){if(_0x175e23){_0x464b9f['body'][_0xefd4('0x66')]=_0x175e23['id'];return db[_0xefd4('0x67')]['create'](_0x464b9f[_0xefd4('0x5e')]);}})[_0xefd4('0x23')](respondWithResult(_0x2adf94,null))[_0xefd4('0x2c')](handleError(_0x2adf94,null));};exports[_0xefd4('0x68')]=function(_0x30bc70,_0x3c27dc,_0x5914bd){var _0x49ed2b={'raw':![],'where':{}};var _0x54bef0={};var _0x99e754={'count':0x0,'rows':[]};return db['SmsAccount'][_0xefd4('0x69')]({'where':{'id':_0x30bc70[_0xefd4('0x63')]['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x3c27dc,null))[_0xefd4('0x23')](function(_0xe6f836){if(_0xe6f836){_0x54bef0['model']=_[_0xefd4('0x59')](db[_0xefd4('0x67')][_0xefd4('0x43')]);_0x54bef0[_0xefd4('0x46')]=_['keys'](_0x30bc70[_0xefd4('0x46')]);_0x54bef0[_0xefd4('0x47')]=_[_0xefd4('0x5a')](_0x54bef0[_0xefd4('0x48')],_0x54bef0['query']);_0x49ed2b[_0xefd4('0x49')]=_[_0xefd4('0x5a')](_0x54bef0[_0xefd4('0x48')],qs[_0xefd4('0x4a')](_0x30bc70['query'][_0xefd4('0x4a')]));_0x49ed2b['attributes']=_0x49ed2b[_0xefd4('0x49')][_0xefd4('0x5b')]?_0x49ed2b[_0xefd4('0x49')]:_0x54bef0[_0xefd4('0x48')];if(!_0x30bc70[_0xefd4('0x46')][_0xefd4('0x4b')]('nolimit')){_0x49ed2b[_0xefd4('0x33')]=qs[_0xefd4('0x33')](_0x30bc70['query'][_0xefd4('0x33')]);_0x49ed2b[_0xefd4('0x31')]=qs[_0xefd4('0x31')](_0x30bc70[_0xefd4('0x46')]['offset']);}_0x49ed2b['order']=qs[_0xefd4('0x4d')](_0x30bc70['query'][_0xefd4('0x4d')]);_0x49ed2b['where']=qs[_0xefd4('0x47')](_[_0xefd4('0x4f')](_0x30bc70[_0xefd4('0x46')],_0x54bef0[_0xefd4('0x47')]));_0x49ed2b[_0xefd4('0x4e')][_0xefd4('0x66')]=_0xe6f836['id'];if(_0x30bc70['query'][_0xefd4('0x6a')]){_0x49ed2b[_0xefd4('0x4e')]=_[_0xefd4('0x52')](_0x49ed2b['where'],{'$or':_[_0xefd4('0x41')](_0x49ed2b[_0xefd4('0x49')],function(_0x1c1818){var _0x16937f={};_0x16937f[_0x1c1818]={'$like':'%'+_0x30bc70[_0xefd4('0x46')][_0xefd4('0x6a')]+'%'};return _0x16937f;})});}_0x49ed2b=_['merge']({},_0x49ed2b,_0x30bc70[_0xefd4('0x53')]);return db[_0xefd4('0x67')]['count']({'where':_0x49ed2b[_0xefd4('0x4e')]})[_0xefd4('0x23')](function(_0x530552){_0x99e754[_0xefd4('0x34')]=_0x530552;if(_0x30bc70[_0xefd4('0x46')]['includeAll']){_0x49ed2b['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x49ed2b);})[_0xefd4('0x23')](function(_0x57978b){_0x99e754[_0xefd4('0x56')]=_0x57978b;return _0x99e754;});}})[_0xefd4('0x23')](respondWithFilteredResult(_0x3c27dc,_0x49ed2b))[_0xefd4('0x2c')](handleError(_0x3c27dc,null));};exports[_0xefd4('0x6b')]=function(_0x5989b6,_0x450cb2,_0x508de6){return db[_0xefd4('0x42')][_0xefd4('0x5c')]({'where':{'id':_0x5989b6[_0xefd4('0x63')]['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x450cb2,null))[_0xefd4('0x23')](function(_0x57d300){if(_0x57d300){return _0x57d300[_0xefd4('0x6b')](_0x5989b6[_0xefd4('0x46')][_0xefd4('0x6c')]);}})[_0xefd4('0x23')](respondWithStatusCode(_0x450cb2,null))['catch'](handleError(_0x450cb2,null));};exports[_0xefd4('0x6d')]=function(_0x5defdf,_0x596b6a,_0x2da081){if(_0x5defdf['body']['id']){delete _0x5defdf['body']['id'];}return db[_0xefd4('0x42')][_0xefd4('0x5c')]({'where':{'id':_0x5defdf[_0xefd4('0x63')]['id']}})['then'](handleEntityNotFound(_0x596b6a,null))[_0xefd4('0x23')](function(_0x344595){if(_0x344595){_0x5defdf['body'][_0xefd4('0x66')]=_0x344595['id'];return db[_0xefd4('0x6e')][_0xefd4('0x5d')](_0x5defdf['body']);}})[_0xefd4('0x23')](respondWithResult(_0x596b6a,null))['catch'](handleError(_0x596b6a,null));};exports[_0xefd4('0x6f')]=function(_0x5228aa,_0x2d211f,_0x27a534){var _0x1fbda3={'raw':![],'where':{}};var _0x73c287={};var _0x5460a4={'count':0x0,'rows':[]};return db[_0xefd4('0x42')][_0xefd4('0x69')]({'where':{'id':_0x5228aa[_0xefd4('0x63')]['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x2d211f,null))[_0xefd4('0x23')](function(_0x1d95b2){if(_0x1d95b2){_0x73c287['model']=_[_0xefd4('0x59')](db[_0xefd4('0x6e')][_0xefd4('0x43')]);_0x73c287[_0xefd4('0x46')]=_['keys'](_0x5228aa[_0xefd4('0x46')]);_0x73c287[_0xefd4('0x47')]=_[_0xefd4('0x5a')](_0x73c287[_0xefd4('0x48')],_0x73c287[_0xefd4('0x46')]);_0x1fbda3['attributes']=_[_0xefd4('0x5a')](_0x73c287['model'],qs[_0xefd4('0x4a')](_0x5228aa[_0xefd4('0x46')]['fields']));_0x1fbda3[_0xefd4('0x49')]=_0x1fbda3['attributes'][_0xefd4('0x5b')]?_0x1fbda3[_0xefd4('0x49')]:_0x73c287[_0xefd4('0x48')];if(!_0x5228aa[_0xefd4('0x46')][_0xefd4('0x4b')](_0xefd4('0x70'))){_0x1fbda3[_0xefd4('0x33')]=qs[_0xefd4('0x33')](_0x5228aa['query']['limit']);_0x1fbda3[_0xefd4('0x31')]=qs[_0xefd4('0x31')](_0x5228aa[_0xefd4('0x46')]['offset']);}_0x1fbda3[_0xefd4('0x4c')]=qs['sort'](_0x5228aa[_0xefd4('0x46')][_0xefd4('0x4d')]);_0x1fbda3['where']=qs[_0xefd4('0x47')](_[_0xefd4('0x4f')](_0x5228aa['query'],_0x73c287[_0xefd4('0x47')]));_0x1fbda3[_0xefd4('0x4e')]['SmsAccountId']=_0x1d95b2['id'];if(_0x5228aa[_0xefd4('0x46')][_0xefd4('0x6a')]){_0x1fbda3[_0xefd4('0x4e')]=_[_0xefd4('0x52')](_0x1fbda3['where'],{'$or':_[_0xefd4('0x41')](_0x1fbda3[_0xefd4('0x49')],function(_0x4680b2){var _0x1dcd89={};_0x1dcd89[_0x4680b2]={'$like':'%'+_0x5228aa[_0xefd4('0x46')][_0xefd4('0x6a')]+'%'};return _0x1dcd89;})});}_0x1fbda3=_[_0xefd4('0x52')]({},_0x1fbda3,_0x5228aa['options']);return db[_0xefd4('0x6e')]['count']({'where':_0x1fbda3[_0xefd4('0x4e')]})[_0xefd4('0x23')](function(_0x1e3e35){_0x5460a4[_0xefd4('0x34')]=_0x1e3e35;if(_0x5228aa[_0xefd4('0x46')]['includeAll']){_0x1fbda3[_0xefd4('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xefd4('0x71')](_0x1fbda3);})[_0xefd4('0x23')](function(_0x4911fa){_0x5460a4[_0xefd4('0x56')]=_0x4911fa;return _0x5460a4;});}})[_0xefd4('0x23')](respondWithFilteredResult(_0x2d211f,_0x1fbda3))['catch'](handleError(_0x2d211f,null));};exports['removeAnswers']=function(_0x306c5c,_0x5bcf70,_0x420315){return db[_0xefd4('0x42')]['find']({'where':{'id':_0x306c5c[_0xefd4('0x63')]['id']}})['then'](handleEntityNotFound(_0x5bcf70,null))['then'](function(_0x51fc3e){if(_0x51fc3e){return _0x51fc3e[_0xefd4('0x72')](_0x306c5c[_0xefd4('0x46')][_0xefd4('0x6c')]);}})[_0xefd4('0x23')](respondWithStatusCode(_0x5bcf70,null))['catch'](handleError(_0x5bcf70,null));};exports['notify']=function(_0x1d3ac7,_0x1b59d2,_0x52523d){var _0x11a595={'channel':_0xefd4('0x73')};var _0x521727=[];var _0x4a18be=[];var _0x2049b8={};return db['SmsAccount'][_0xefd4('0x5c')]({'where':{'id':_0x1d3ac7[_0xefd4('0x63')]['id']},'include':[{'model':db[_0xefd4('0x74')],'as':_0xefd4('0x75')}]})[_0xefd4('0x23')](handleEntityNotFound(_0x1b59d2,null))[_0xefd4('0x23')](function(_0x1dfafd){_0x11a595[_0xefd4('0x76')]=_0x1dfafd;_0x11a595['applications']=_[_0xefd4('0x77')](_0x1dfafd[_0xefd4('0x75')],['priority'],[_0xefd4('0x78')]);if(_0x11a595[_0xefd4('0x76')][_0xefd4('0x75')]){delete _0x11a595[_0xefd4('0x76')][_0xefd4('0x75')];}return db['CmContact'][_0xefd4('0x64')]();})['then'](function(_0x320e2d){if(!_0x320e2d){throw new db[(_0xefd4('0x79'))]['ValidationError'](_0xefd4('0x7a'));}_0x521727=_[_0xefd4('0x7b')](_[_0xefd4('0x59')](_0x320e2d),[_0xefd4('0x7c'),'updatedAt']);_0x4a18be=_[_0xefd4('0x7b')](_['keys'](_0x320e2d),[_0xefd4('0x7c'),_0xefd4('0x7d'),_0xefd4('0x7e'),'ListId']);_0x11a595[_0xefd4('0x5e')]={'mapKey':_0xefd4('0x7f')};if(_0x11a595[_0xefd4('0x76')][_0xefd4('0x50')]){switch(_0x11a595[_0xefd4('0x76')][_0xefd4('0x50')]){case'twilio':_0x11a595[_0xefd4('0x5e')][_0xefd4('0x80')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x81')];_0x11a595['body']['body']=_0x1d3ac7['body']['Body'];_0x11a595['body']['messageId']=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x82')];break;case _0xefd4('0x83'):_0x11a595[_0xefd4('0x5e')][_0xefd4('0x80')]='+'+_0x1d3ac7[_0xefd4('0x5e')]['sender'];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x5e')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x84')];break;case _0xefd4('0x85'):_0x11a595[_0xefd4('0x5e')]['from']=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x80')];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x5e')]=_0x1d3ac7['body'][_0xefd4('0x2a')];break;case _0xefd4('0x86'):_0x11a595['body'][_0xefd4('0x80')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x80')];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x5e')]=_0x1d3ac7[_0xefd4('0x5e')]['body'];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x87')]=_0x1d3ac7[_0xefd4('0x5e')]['message_id'];break;case _0xefd4('0x88'):_0x11a595[_0xefd4('0x5e')]['from']=_0x1d3ac7['body'][_0xefd4('0x81')];_0x11a595['body'][_0xefd4('0x5e')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x89')];_0x11a595['body']['messageId']=_0x1d3ac7[_0xefd4('0x5e')]['MessageUUID'];break;case _0xefd4('0x8a'):_0x11a595[_0xefd4('0x5e')][_0xefd4('0x80')]='+'+_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x8b')][0x0][_0xefd4('0x80')];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x5e')]=_0x1d3ac7['body'][_0xefd4('0x8b')][0x0][_0xefd4('0x84')];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x87')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x8b')][0x0][_0xefd4('0x87')];break;case'csc':_0x11a595['body'][_0xefd4('0x80')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x8c')];_0x11a595['body'][_0xefd4('0x5e')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x8d')]['message'];break;case _0xefd4('0x8e'):_0x11a595[_0xefd4('0x5e')][_0xefd4('0x80')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x8f')];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x5e')]=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x84')];_0x11a595['body']['messageId']=_0x1d3ac7[_0xefd4('0x5e')][_0xefd4('0x90')];break;case _0xefd4('0x91'):_0x11a595['body'][_0xefd4('0x87')]=_0x1d3ac7[_0xefd4('0x5e')][0x0]['message']['id'];_0x11a595[_0xefd4('0x5e')]['from']=_0x1d3ac7['body'][0x0]['message']['from'];_0x11a595['body'][_0xefd4('0x5e')]=_0x1d3ac7[_0xefd4('0x5e')][0x0][_0xefd4('0x2a')][_0xefd4('0x84')];break;case _0xefd4('0x92'):_0x11a595[_0xefd4('0x5e')]['from']=_0x1d3ac7['body'][_0xefd4('0x80')];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x5e')]=_0x1d3ac7['body']['message'];_0x11a595[_0xefd4('0x5e')][_0xefd4('0x87')]=_0x1d3ac7['body']['refid'];break;}}if(_0x11a595[_0xefd4('0x5e')]['id']){delete _0x11a595[_0xefd4('0x5e')]['id'];}if(_['isNil'](_0x11a595[_0xefd4('0x5e')][_0xefd4('0x80')])){throw new db[(_0xefd4('0x79'))][(_0xefd4('0x93'))]('from\x20is\x20mandatory');}if(_[_0xefd4('0x94')](_0x11a595[_0xefd4('0x5e')][_0xefd4('0x5e')])||_0x11a595['body'][_0xefd4('0x5e')]===''){throw new db['Sequelize']['ValidationError'](_0xefd4('0x95'));}if(_['isNil'](_0x11a595[_0xefd4('0x5e')]['mapKey'])){throw new db[(_0xefd4('0x79'))][(_0xefd4('0x93'))](_0xefd4('0x96')+_0x4a18be);}if(!_['includes'](_0x4a18be,_0x11a595[_0xefd4('0x5e')][_0xefd4('0x97')])){throw new db[(_0xefd4('0x79'))]['ValidationError'](_0xefd4('0x98')+_0x4a18be);}_0x2049b8[_0x11a595[_0xefd4('0x5e')]['mapKey']]=_0x11a595[_0xefd4('0x5e')][_0xefd4('0x80')];return db['CmList'][_0xefd4('0x5c')]({'where':{'id':_0x11a595['account'][_0xefd4('0x99')]},'include':[{'model':db[_0xefd4('0x9a')],'as':'Contacts','where':_0x2049b8,'limit':0x1,'order':[[_0xefd4('0x7d'),_0xefd4('0x9b')]]}]});})[_0xefd4('0x23')](handleEntityNotFound(_0x1b59d2,null))[_0xefd4('0x23')](function(_0x5d970b){if(_0x5d970b){_0x11a595[_0xefd4('0x9c')]=_[_0xefd4('0x9d')](_0x5d970b,[_0xefd4('0x9e')]);if(_0x5d970b[_0xefd4('0x9e')][_0xefd4('0x5b')]){return _0x5d970b[_0xefd4('0x9e')][0x0];}var _0xb91572=_['defaults'](_0x11a595[_0xefd4('0x5e')],{'firstName':_0x11a595[_0xefd4('0x5e')][_0xefd4('0x80')],'ListId':_0x5d970b['id']});_0xb91572[_0x11a595[_0xefd4('0x5e')][_0xefd4('0x97')]]=_0x11a595['body'][_0xefd4('0x80')];return db[_0xefd4('0x9a')][_0xefd4('0x5d')](_0xb91572,{'fields':_0x521727,'raw':!![]});}})['then'](handleEntityNotFound(_0x1b59d2,null))[_0xefd4('0x23')](function(_0x18af7b){if(_0x18af7b){_0x11a595['contact']=_0x18af7b;var _0xccffa9={'ContactId':_0x18af7b['id'],'phone':_0x11a595['body'][_0xefd4('0x80')],'SmsAccountId':_0x1d3ac7[_0xefd4('0x63')]['id']};var _0x42c5df={'ContactId':_0x18af7b['id'],'SmsAccountId':_0x1d3ac7[_0xefd4('0x63')]['id'],'closed':![]};return db[_0xefd4('0x9f')][_0xefd4('0x5c')]({'where':_0x42c5df})[_0xefd4('0x23')](function(_0x41eb3d){if(_0x41eb3d){return[_0x41eb3d,![]];}return db['SmsInteraction'][_0xefd4('0x5d')](_0xccffa9)[_0xefd4('0x23')](function(_0x48a895){return[_0x48a895,!![]];});});}})[_0xefd4('0xa0')](function(_0x24efe0,_0x18db51){_0x11a595[_0xefd4('0xa1')]=_0x24efe0[_0xefd4('0x3b')]({'plain':!![]});_0x11a595[_0xefd4('0xa1')][_0xefd4('0xa2')]=![];if(_0x18db51){if(_0x11a595[_0xefd4('0x76')][_0xefd4('0xa3')]){_0x11a595[_0xefd4('0xa4')][_0xefd4('0xa5')]({'id':0x0,'priority':_0x11a595[_0xefd4('0xa4')][_0xefd4('0x5b')]+0x1,'app':_0xefd4('0xa6'),'appdata':'unmanaged','interval':_0xefd4('0xa7')});}_0x11a595[_0xefd4('0xa1')]['created']=!![];}return db[_0xefd4('0xa8')][_0xefd4('0x5d')]({'phone':_0x11a595[_0xefd4('0x5e')][_0xefd4('0x80')],'messageId':_0x11a595[_0xefd4('0x5e')][_0xefd4('0x87')],'body':_0x11a595[_0xefd4('0x5e')][_0xefd4('0x5e')],'SmsAccountId':_0x1d3ac7['params']['id'],'SmsInteractionId':_0x24efe0['id'],'direction':'in','ContactId':_0x24efe0[_0xefd4('0xa9')],'AttachmentId':_0x11a595[_0xefd4('0x5e')][_0xefd4('0xaa')]});})[_0xefd4('0x23')](function(_0xc0ca2f){_0x11a595[_0xefd4('0x2a')]=_0xc0ca2f;if(_0x11a595['interaction'][_0xefd4('0xab')]){return db[_0xefd4('0xac')][_0xefd4('0x5c')]({'attributes':['id','name'],'where':{'id':_0x11a595[_0xefd4('0xa1')][_0xefd4('0xab')]}})[_0xefd4('0x23')](function(_0x42d183){if(_0x42d183){_0x11a595['applications'][_0xefd4('0xad')]({'id':0x0,'priority':0x0,'app':_0xefd4('0xae'),'appdata':_0x42d183[_0xefd4('0x3e')]+','+(_0x11a595[_0xefd4('0x76')][_0xefd4('0xaf')]||0xa),'interval':_0xefd4('0xa7')});}return respondWithRpcPromise('Start',_0xefd4('0xb0'),_0x11a595);});}return respondWithRpcPromise(_0xefd4('0xb1'),_0xefd4('0xb0'),_0x11a595);})[_0xefd4('0x23')](function(_0x162ef8){if(_0x162ef8){var _0x42ea06=0xc8;var _0x471dcf=_0xefd4('0xb2');logger[_0xefd4('0x24')](_0xefd4('0xb3'),_0x471dcf,_0x42ea06,_0xefd4('0xb4'));logger[_0xefd4('0x27')](_0xefd4('0xb5'),_0x471dcf,_0x42ea06,_0xefd4('0xb4'),JSON[_0xefd4('0xb6')](_0x162ef8));if(_0x11a595[_0xefd4('0x76')]['type']==='twilio'){return _0x1b59d2[_0xefd4('0x2e')](_0x42ea06)[_0xefd4('0x35')]('Content-Type',_0xefd4('0xb7'))['send'](_0xefd4('0xb8'));}else{return _0x1b59d2[_0xefd4('0x2e')](_0x42ea06)[_0xefd4('0x30')](_0x162ef8);}}})[_0xefd4('0x2c')](handleError(_0x1b59d2,null));};exports[_0xefd4('0xb9')]=function(_0xf0e762,_0x1df705){var _0x54c1eb=_0xf0e762[_0xefd4('0x63')]['id'];var _0x53dca6=_0xf0e762[_0xefd4('0x5e')];var _0x16a7f5=0xc8;var _0xc545c8=null;return db[_0xefd4('0xba')]['transaction']({'isolationLevel':db[_0xefd4('0xba')]['Transaction'][_0xefd4('0xbb')]['READ_COMMITTED']},function(_0x244427){return db[_0xefd4('0x42')][_0xefd4('0x69')]({'where':{'id':_0x54c1eb},'transaction':_0x244427})[_0xefd4('0x23')](function(_0x8d3a29){if(_0x8d3a29){return db[_0xefd4('0x74')][_0xefd4('0x3a')]({'where':{'SmsAccountId':_0x54c1eb},'transaction':_0x244427})[_0xefd4('0x23')](function(){var _0xa8f460=_[_0xefd4('0x41')](_0x53dca6,function(_0x1c9002){_0x1c9002[_0xefd4('0x66')]=_0x54c1eb;return _0x1c9002;});return db[_0xefd4('0x74')]['bulkCreate'](_0xa8f460,{'transaction':_0x244427});});}else{_0x16a7f5=0x194;_0xc545c8=[];}});})[_0xefd4('0x23')](function(){if(_0x16a7f5!==0x194){return db[_0xefd4('0x74')]['findAndCountAll']({'where':{'SmsAccountId':_0x54c1eb},'order':'priority'})[_0xefd4('0x23')](function(_0xc28cca){_0xc545c8=_0xc28cca;});}})[_0xefd4('0x2c')](function(_0x4663bb){_0x16a7f5=0x1f4;logger[_0xefd4('0x28')](_0x4663bb['stack']);if(_0x4663bb[_0xefd4('0x3e')]){delete _0x4663bb[_0xefd4('0x3e')];}_0xc545c8=_0x4663bb;})[_0xefd4('0xbc')](function(){if(_0xc545c8===null){_0x1df705['sendStatus'](_0x16a7f5);}else{if(_0x16a7f5===0x1f4){_0x1df705[_0xefd4('0x2e')](_0x16a7f5)[_0xefd4('0x3f')](_0xc545c8);}else{_0x1df705[_0xefd4('0x2e')](_0x16a7f5)[_0xefd4('0x30')](_0xc545c8);}}});};exports['getApplications']=function(_0x2c7e9f,_0x10fea2,_0x5b9366){var _0x15722e={};var _0xfa66a9={};var _0x4af640;var _0x4d9448;return db[_0xefd4('0x42')][_0xefd4('0x69')]({'where':{'id':_0x2c7e9f[_0xefd4('0x63')]['id']}})['then'](handleEntityNotFound(_0x10fea2,null))['then'](function(_0x15038b){if(_0x15038b){_0x4af640=_0x15038b;_0xfa66a9['model']=_[_0xefd4('0x59')](db[_0xefd4('0x74')][_0xefd4('0x43')]);_0xfa66a9[_0xefd4('0x46')]=_['keys'](_0x2c7e9f[_0xefd4('0x46')]);_0xfa66a9[_0xefd4('0x47')]=_[_0xefd4('0x5a')](_0xfa66a9[_0xefd4('0x48')],_0xfa66a9['query']);_0x15722e[_0xefd4('0x49')]=_[_0xefd4('0x5a')](_0xfa66a9['model'],qs['fields'](_0x2c7e9f[_0xefd4('0x46')][_0xefd4('0x4a')]));_0x15722e['attributes']=_0x15722e['attributes'][_0xefd4('0x5b')]?_0x15722e[_0xefd4('0x49')]:_0xfa66a9[_0xefd4('0x48')];_0x15722e[_0xefd4('0x4c')]=qs[_0xefd4('0x4d')](_0x2c7e9f[_0xefd4('0x46')][_0xefd4('0x4d')]);_0x15722e['where']=qs[_0xefd4('0x47')](_[_0xefd4('0x4f')](_0x2c7e9f[_0xefd4('0x46')],_0xfa66a9[_0xefd4('0x47')]));if(_0x2c7e9f[_0xefd4('0x46')]['filter']){_0x15722e[_0xefd4('0x4e')]=_[_0xefd4('0x52')](_0x15722e['where'],{'$or':_['map'](_0x15722e['attributes'],function(_0xa5c3a9){var _0x486bb4={};_0x486bb4[_0xa5c3a9]={'$like':'%'+_0x2c7e9f['query']['filter']+'%'};return _0x486bb4;})});}_0x15722e=_[_0xefd4('0x52')]({},_0x15722e,_0x2c7e9f['options']);return _0x4af640['getApplications'](_0x15722e);}})['then'](function(_0x184f49){if(_0x184f49){_0x4d9448=_0x184f49[_0xefd4('0x5b')];if(!_0x2c7e9f[_0xefd4('0x46')]['hasOwnProperty']('nolimit')){_0x15722e[_0xefd4('0x33')]=qs[_0xefd4('0x33')](_0x2c7e9f[_0xefd4('0x46')][_0xefd4('0x33')]);_0x15722e['offset']=qs['offset'](_0x2c7e9f['query'][_0xefd4('0x31')]);}return _0x4af640[_0xefd4('0xbd')](_0x15722e);}})[_0xefd4('0x23')](function(_0x3a6ef8){if(_0x3a6ef8){return _0x3a6ef8?{'count':_0x4d9448,'rows':_0x3a6ef8}:null;}})[_0xefd4('0x23')](respondWithResult(_0x10fea2,null))[_0xefd4('0x2c')](handleError(_0x10fea2,null));};exports[_0xefd4('0xbe')]=function(_0x1f0302,_0x1620de,_0x10889a){var _0x4d4994={'raw':![],'where':{}};var _0x39a447={};var _0x3c8fe5={'count':0x0,'rows':[]};return db[_0xefd4('0x42')]['findOne']({'where':{'id':_0x1f0302['params']['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x1620de,null))[_0xefd4('0x23')](function(_0x255fec){if(_0x255fec){_0x39a447[_0xefd4('0x48')]=_[_0xefd4('0x59')](db[_0xefd4('0x9f')][_0xefd4('0x43')]);_0x39a447['query']=_[_0xefd4('0x59')](_0x1f0302[_0xefd4('0x46')]);_0x39a447[_0xefd4('0x47')]=_[_0xefd4('0x5a')](_0x39a447[_0xefd4('0x48')],_0x39a447[_0xefd4('0x46')]);_0x4d4994[_0xefd4('0x49')]=_[_0xefd4('0x5a')](_0x39a447[_0xefd4('0x48')],qs[_0xefd4('0x4a')](_0x1f0302[_0xefd4('0x46')][_0xefd4('0x4a')]));_0x4d4994[_0xefd4('0x49')]=_0x4d4994[_0xefd4('0x49')][_0xefd4('0x5b')]?_0x4d4994['attributes']:_0x39a447['model'];if(!_0x1f0302[_0xefd4('0x46')][_0xefd4('0x4b')]('nolimit')){_0x4d4994[_0xefd4('0x33')]=qs[_0xefd4('0x33')](_0x1f0302[_0xefd4('0x46')]['limit']);_0x4d4994['offset']=qs[_0xefd4('0x31')](_0x1f0302[_0xefd4('0x46')][_0xefd4('0x31')]);}_0x4d4994['order']=qs['sort'](_0x1f0302[_0xefd4('0x46')]['sort']);_0x4d4994[_0xefd4('0x4e')]=qs[_0xefd4('0x47')](_[_0xefd4('0x4f')](_0x1f0302[_0xefd4('0x46')],_0x39a447['filters']));_0x4d4994[_0xefd4('0x4e')][_0xefd4('0x66')]=_0x255fec['id'];if(_0x1f0302['query']['filter']){_0x4d4994[_0xefd4('0x4e')]=_[_0xefd4('0x52')](_0x4d4994['where'],{'$or':_[_0xefd4('0x41')](_0x4d4994[_0xefd4('0x49')],function(_0x2b836c){var _0x58cd51={};_0x58cd51[_0x2b836c]={'$like':'%'+_0x1f0302[_0xefd4('0x46')][_0xefd4('0x6a')]+'%'};return _0x58cd51;})});}_0x4d4994=_[_0xefd4('0x52')]({},_0x4d4994,_0x1f0302[_0xefd4('0x53')]);return db[_0xefd4('0x9f')]['count']({'where':_0x4d4994[_0xefd4('0x4e')]})['then'](function(_0x5419a0){_0x3c8fe5[_0xefd4('0x34')]=_0x5419a0;if(_0x1f0302[_0xefd4('0x46')][_0xefd4('0x54')]){_0x4d4994['include']=[{'model':db['CmContact'],'as':_0xefd4('0xbf'),'required':![]},{'model':db[_0xefd4('0xac')],'as':_0xefd4('0xc0'),'attributes':['name',_0xefd4('0xc1'),_0xefd4('0xc2')],'required':![]},{'model':db[_0xefd4('0xc3')],'as':'Tags','attributes':['id','name','color'],'where':_0x1f0302[_0xefd4('0x46')][_0xefd4('0xc4')]?{'id':_0x1f0302['query']['tag']}:undefined,'required':_0x1f0302[_0xefd4('0x46')][_0xefd4('0xc4')]?!![]:![]}];}return db[_0xefd4('0x9f')]['findAll'](_0x4d4994);})[_0xefd4('0x23')](function(_0x37bc1d){_0x3c8fe5['rows']=_0x37bc1d;return _0x3c8fe5;});}})[_0xefd4('0x23')](respondWithFilteredResult(_0x1620de,_0x4d4994))[_0xefd4('0x2c')](handleError(_0x1620de,null));};exports[_0xefd4('0x3f')]=function(_0xeffbc6,_0x1ab99d,_0x393a2c){var _0x12cc61,_0x57754d,_0x372d09;if(_['isNil'](_0xeffbc6[_0xefd4('0x5e')][_0xefd4('0x5e')])||_0xeffbc6[_0xefd4('0x5e')][_0xefd4('0x5e')]===''){throw new db[(_0xefd4('0x79'))][(_0xefd4('0x93'))](_0xefd4('0x95'));}if(_[_0xefd4('0x94')](_0xeffbc6[_0xefd4('0x5e')]['to'])){throw new db[(_0xefd4('0x79'))][(_0xefd4('0x93'))](_0xefd4('0xc5'));}_0x12cc61=_0xeffbc6['body']['to'];return db[_0xefd4('0x42')][_0xefd4('0x5c')]({'where':{'id':_0xeffbc6[_0xefd4('0x63')]['id']},'include':[{'model':db[_0xefd4('0xc6')],'as':_0xefd4('0xc7'),'include':[{'model':db[_0xefd4('0x9a')],'as':'Contacts','where':{'mobile':_0x12cc61},'limit':0x1,'order':[['updatedAt',_0xefd4('0x9b')]]}]}]})[_0xefd4('0x23')](handleEntityNotFound(_0x1ab99d,null))['then'](function(_0x121f97){if(_0x121f97&&_0x121f97[_0xefd4('0xc7')]){_0x57754d=_0x121f97[_0xefd4('0x3b')]({'plain':!![]});if(_0x57754d['List']&&_0x57754d[_0xefd4('0xc7')][_0xefd4('0x9e')][_0xefd4('0x5b')]){return _0x57754d[_0xefd4('0xc7')][_0xefd4('0x9e')][0x0];}return db[_0xefd4('0x9a')][_0xefd4('0x5d')](_[_0xefd4('0x1b')](_0xeffbc6[_0xefd4('0x5e')],{'firstName':_0x12cc61,'mobile':_0x12cc61,'phone':_0x12cc61,'ListId':_0x57754d[_0xefd4('0x99')]}));}})['then'](handleEntityNotFound(_0x1ab99d,null))[_0xefd4('0x23')](function(_0x371ea7){if(_0x371ea7){_0x372d09=_0x371ea7;return db[_0xefd4('0x9f')][_0xefd4('0x5c')]({'where':{'ContactId':_0x372d09['id'],'closed':![],'SmsAccountId':_0x57754d['id']}})[_0xefd4('0x23')](function(_0x29f3eb){if(_0x29f3eb){return[_0x29f3eb,![]];}return db[_0xefd4('0x9f')]['create']({'UserId':_0xeffbc6[_0xefd4('0x5f')]['id'],'ContactId':_0x372d09['id'],'SmsAccountId':_0x57754d['id'],'phone':_0x12cc61,'firstMsgDirection':'out','Messages':[_[_0xefd4('0x52')](_0xeffbc6[_0xefd4('0x5e')],{'read':![],'body':_0xeffbc6[_0xefd4('0x5e')]['body'],'phone':_0x12cc61,'SmsAccountId':_0x57754d['id'],'UserId':_0xeffbc6['user']['id'],'ContactId':_0x372d09['id']})]},{'include':[{'model':db[_0xefd4('0xa8')],'as':'Messages'}]})[_0xefd4('0x23')](function(_0x387722){return[_0x387722,!![]];});});}})[_0xefd4('0xa0')](function(_0x35bdbb,_0x198d13){if(_0x198d13){return _0x35bdbb;}return db[_0xefd4('0xa8')][_0xefd4('0x5d')](_[_0xefd4('0x52')](_0xeffbc6[_0xefd4('0x5e')],{'read':![],'body':_0xeffbc6[_0xefd4('0x5e')][_0xefd4('0x5e')],'phone':_0x12cc61,'SmsAccountId':_0x57754d['id'],'SmsInteractionId':_0x35bdbb['id'],'UserId':_0xeffbc6[_0xefd4('0x5f')]['id'],'ContactId':_0x372d09['id']}))[_0xefd4('0x23')](function(_0x356e34){_0x35bdbb['dataValues']['Messages']=[];_0x35bdbb[_0xefd4('0xc8')][_0xefd4('0xc9')][_0xefd4('0xa5')](_0x356e34[_0xefd4('0xc8')]);return _0x35bdbb;});})[_0xefd4('0x23')](respondWithResult(_0x1ab99d,null))[_0xefd4('0x2c')](handleError(_0x1ab99d,null));};exports[_0xefd4('0x2e')]=function(_0x19b276,_0x3094b3,_0x3f36ae){if(_0x19b276[_0xefd4('0x5e')]['id']){delete _0x19b276[_0xefd4('0x5e')]['id'];}var _0x2d5767,_0x383260,_0xe515d5;return db[_0xefd4('0x42')][_0xefd4('0x5c')]({'where':{'id':_0x19b276['params']['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x3094b3,null))[_0xefd4('0x23')](function(_0x2e464d){if(_0x2e464d){_0xe515d5=_0x2e464d;logger['debug'](_0xefd4('0xb3'),_0xefd4('0x2e'),_0xefd4('0xca'),_0x2e464d[_0xefd4('0x50')],util['inspect'](_0x19b276[_0xefd4('0x5e')],{'showHidden':![],'depth':null}));switch(_0x2e464d[_0xefd4('0x50')]){case _0xefd4('0x83'):if(_0x19b276['body'][_0xefd4('0xcb')]&&_0x19b276[_0xefd4('0x5e')][_0xefd4('0x2e')]){_0x383260=_0x19b276[_0xefd4('0x5e')][_0xefd4('0x2e')];return db['SmsMessage'][_0xefd4('0x5c')]({'where':{'messageId':_0x19b276[_0xefd4('0x5e')][_0xefd4('0xcb')]}});}break;case'connectel':if(_0x19b276[_0xefd4('0x5e')][_0xefd4('0xcc')]&&_0x19b276['body'][_0xefd4('0xcd')]){_0x383260=_0x19b276[_0xefd4('0x5e')][_0xefd4('0xcd')];return db[_0xefd4('0xa8')][_0xefd4('0x5c')]({'where':{'messageId':_0x19b276[_0xefd4('0x5e')]['requestid']}});}break;case _0xefd4('0x86'):if(_0x19b276[_0xefd4('0x5e')]['message_id']&&_0x19b276[_0xefd4('0x5e')][_0xefd4('0xce')]){_0x383260=_0x19b276['body'][_0xefd4('0xce')];return db[_0xefd4('0xa8')][_0xefd4('0x5c')]({'where':{'messageId':_0x19b276[_0xefd4('0x5e')][_0xefd4('0xcf')]}});}break;case'infobip':var _0xfa4b8f=_0x19b276[_0xefd4('0x5e')][_0xefd4('0x8b')][0x0];if(_0xfa4b8f[_0xefd4('0x87')]&&_0xfa4b8f['status'][_0xefd4('0xd0')]===_0xefd4('0xd1')){_0x383260=_0xfa4b8f[_0xefd4('0x2e')][_0xefd4('0xd0')];return db['SmsMessage'][_0xefd4('0x5c')]({'where':{'messageId':_0xfa4b8f[_0xefd4('0x87')]}});}break;case _0xefd4('0x8e'):if(_0x19b276[_0xefd4('0x5e')]['messageId']&&_0x19b276[_0xefd4('0x5e')][_0xefd4('0x2e')]){_0x383260=_0x19b276[_0xefd4('0x5e')][_0xefd4('0x2e')];return db[_0xefd4('0xa8')][_0xefd4('0x5c')]({'where':{'messageId':_0x19b276[_0xefd4('0x5e')]['messageId']}});}break;case _0xefd4('0x91'):if(_0x19b276['body'][0x0][_0xefd4('0x2a')]['id']){_0x383260=_0x19b276[_0xefd4('0x5e')][0x0]['type'];return db['SmsMessage'][_0xefd4('0x5c')]({'where':{'messageId':_0x19b276['body'][0x0][_0xefd4('0x2a')]['id']}});}break;case'intelepeer':if(_0x19b276[_0xefd4('0x5e')]['redif']&&_0x19b276['body'][_0xefd4('0x2e')]){_0x383260=_0x19b276['body']['status'];return db[_0xefd4('0xa8')][_0xefd4('0x5c')]({'where':{'messageId':_0x19b276[_0xefd4('0x5e')][_0xefd4('0xd2')]}});}break;}}})[_0xefd4('0x23')](handleEntityNotFound(_0x3094b3,null))[_0xefd4('0x23')](function(_0x10a0ae){if(_0x10a0ae){_0x2d5767=_0x10a0ae;switch(_0xe515d5[_0xefd4('0x50')]){case _0xefd4('0x83'):if(_0x383260==='DELIVERED'){return _0x2d5767[_0xefd4('0x39')]({'read':!![]});}else{logger['error'](_0xefd4('0xb3'),_0xefd4('0x2e'),'skebby',util[_0xefd4('0xd3')](_0x19b276['body'],{'showHidden':![],'depth':null}));}break;case _0xefd4('0x85'):if(_0x383260==='1'){return _0x2d5767[_0xefd4('0x39')]({'read':!![]});}else{logger[_0xefd4('0x28')](_0xefd4('0xb3'),_0xefd4('0x2e'),_0xefd4('0x83'),util[_0xefd4('0xd3')](_0x19b276[_0xefd4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xefd4('0x86'):if(!_0x19b276[_0xefd4('0x5e')][_0xefd4('0xd4')]&&_0x383260>=0xc8&&_0x383260<=0xce){return _0x2d5767[_0xefd4('0x39')]({'read':!![]});}else{logger[_0xefd4('0x28')](_0xefd4('0xb3'),_0xefd4('0x2e'),_0xefd4('0x86'),util[_0xefd4('0xd3')](_0x19b276['body'],{'showHidden':![],'depth':null}));}break;case _0xefd4('0x8a'):var _0x7ec7ce=_0x19b276[_0xefd4('0x5e')][_0xefd4('0x8b')][0x0];if(_0x7ec7ce[_0xefd4('0x2e')][_0xefd4('0xd0')]===_0xefd4('0xd1')){return _0x2d5767[_0xefd4('0x39')]({'read':!![]});}else{logger[_0xefd4('0x28')](_0xefd4('0xb3'),_0xefd4('0x2e'),'infobip',util[_0xefd4('0xd3')](_0x19b276[_0xefd4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xefd4('0x8e'):if(_0x383260==_0xefd4('0xd5')||_0x383260==_0xefd4('0xd6')){return _0x2d5767[_0xefd4('0x39')]({'read':!![]});}else{logger[_0xefd4('0x28')](_0xefd4('0xb3'),'status',_0xefd4('0x8e'),util['inspect'](_0x19b276[_0xefd4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xefd4('0x91'):if(_0x383260=='message-delivered'){return _0x2d5767[_0xefd4('0x39')]({'read':!![]});}else{logger[_0xefd4('0x28')](_0xefd4('0xb3'),'status',_0xefd4('0x91'),util['inspect'](_0x19b276[_0xefd4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xefd4('0x92'):if(_0x383260===_0xefd4('0xd7')||_0x383260==='ACCEPTD'){return _0x2d5767[_0xefd4('0x39')]({'read':!![]});}else{logger[_0xefd4('0x28')](_0xefd4('0xb3'),_0xefd4('0x2e'),'intelepeer',util[_0xefd4('0xd3')](_0x19b276[_0xefd4('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x2d5767;}})['then'](respondWithResult(_0x3094b3,null))[_0xefd4('0x2c')](handleError(_0x3094b3,null));};exports[_0xefd4('0xd8')]=function(_0x121726,_0x314c8a,_0x268992){var _0x2ba2fa,_0x26fff5,_0x581792;return db[_0xefd4('0x42')]['find']({'where':{'id':_0x121726['params']['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x314c8a,null))['then'](function(_0x3f9df5){if(_0x3f9df5){_0x581792=_0x3f9df5;logger[_0xefd4('0x27')](_0xefd4('0xb3'),_0xefd4('0x2e'),_0xefd4('0xca'),_0x3f9df5[_0xefd4('0x50')],util['inspect'](_0x121726[_0xefd4('0x46')],{'showHidden':![],'depth':null}));switch(_0x3f9df5[_0xefd4('0x50')]){case _0xefd4('0xd9'):if(_0x121726[_0xefd4('0x46')]['message-id']&&_0x121726[_0xefd4('0x46')][_0xefd4('0xda')]){_0x26fff5=_0x121726['query'][_0xefd4('0xda')];return db[_0xefd4('0xa8')]['find']({'where':{'messageId':_0x121726['query'][_0xefd4('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x314c8a,null))[_0xefd4('0x23')](function(_0x13a6db){if(_0x13a6db){_0x2ba2fa=_0x13a6db;switch(_0x581792[_0xefd4('0x50')]){case _0xefd4('0xd9'):if(_0x26fff5==='2'||_0x26fff5==='6'){return _0x2ba2fa[_0xefd4('0x39')]({'read':!![]});}else{logger['error'](_0xefd4('0xb3'),'status',_0xefd4('0xd9'),util[_0xefd4('0xd3')](_0x121726['query'],{'showHidden':![],'depth':null}));};break;}return _0x2ba2fa;}})[_0xefd4('0x23')](respondWithResult(_0x314c8a,null))[_0xefd4('0x2c')](handleError(_0x314c8a,null));};exports[_0xefd4('0xdc')]=function(_0x3a8b65,_0x3a8e77,_0x247b65){return db['SmsAccount'][_0xefd4('0x5c')]({'where':{'id':_0x3a8b65[_0xefd4('0x63')]['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x3a8e77,null))[_0xefd4('0x23')](function(_0x3a7ef8){if(_0x3a7ef8){return _0x3a7ef8[_0xefd4('0xdc')](_0x3a8b65[_0xefd4('0x5e')][_0xefd4('0x6c')],_['omit'](_0x3a8b65[_0xefd4('0x5e')],[_0xefd4('0x6c'),'id'])||{})[_0xefd4('0xa0')](function(_0x5e5da0){for(var _0x58fc0c=0x0;_0x58fc0c<_0x3a8b65['body']['ids'][_0xefd4('0x5b')];_0x58fc0c+=0x1){socket['emit'](_0xefd4('0xdd'),{'UserId':Number(_0x3a8b65['body']['ids'][_0x58fc0c]),'SmsAccountId':Number(_0x3a8b65['params']['id'])});}return _0x5e5da0;});}})['then'](respondWithResult(_0x3a8e77,null))[_0xefd4('0x2c')](handleError(_0x3a8e77,null));};exports[_0xefd4('0xde')]=function(_0x13e642,_0x1b33c9,_0x1bcc93){return db[_0xefd4('0x42')][_0xefd4('0x5c')]({'where':{'id':_0x13e642[_0xefd4('0x63')]['id']}})[_0xefd4('0x23')](handleEntityNotFound(_0x1b33c9,null))[_0xefd4('0x23')](function(_0x2dadda){if(_0x2dadda){return _0x2dadda[_0xefd4('0xde')](_0x13e642[_0xefd4('0x46')][_0xefd4('0x6c')])[_0xefd4('0x23')](function(){if(_['isArray'](_0x13e642[_0xefd4('0x46')][_0xefd4('0x6c')])){for(var _0x57f970=0x0;_0x57f970<_0x13e642[_0xefd4('0x46')]['ids'][_0xefd4('0x5b')];_0x57f970+=0x1){socket[_0xefd4('0xdf')](_0xefd4('0xe0'),{'UserId':Number(_0x13e642[_0xefd4('0x46')][_0xefd4('0x6c')][_0x57f970]),'SmsAccountId':Number(_0x13e642[_0xefd4('0x63')]['id'])});}}else{socket[_0xefd4('0xdf')](_0xefd4('0xe0'),{'UserId':Number(_0x13e642[_0xefd4('0x46')][_0xefd4('0x6c')]),'SmsAccountId':Number(_0x13e642[_0xefd4('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b33c9,null))[_0xefd4('0x2c')](handleError(_0x1b33c9,null));};exports[_0xefd4('0xe1')]=function(_0x2666fc,_0x576b35,_0x2b679f){var _0x2caf97={};var _0x39a47a={};var _0x177825;var _0x5e1171;return db[_0xefd4('0x42')][_0xefd4('0x69')]({'where':{'id':_0x2666fc[_0xefd4('0x63')]['id']}})['then'](handleEntityNotFound(_0x576b35,null))[_0xefd4('0x23')](function(_0x33aba9){if(_0x33aba9){_0x177825=_0x33aba9;_0x39a47a['model']=_[_0xefd4('0x59')](db[_0xefd4('0xac')]['rawAttributes']);_0x39a47a[_0xefd4('0x46')]=_[_0xefd4('0x59')](_0x2666fc['query']);_0x39a47a[_0xefd4('0x47')]=_[_0xefd4('0x5a')](_0x39a47a[_0xefd4('0x48')],_0x39a47a[_0xefd4('0x46')]);_0x2caf97[_0xefd4('0x49')]=_[_0xefd4('0x5a')](_0x39a47a[_0xefd4('0x48')],qs[_0xefd4('0x4a')](_0x2666fc[_0xefd4('0x46')]['fields']));_0x2caf97[_0xefd4('0x49')]=_0x2caf97[_0xefd4('0x49')]['length']?_0x2caf97['attributes']:_0x39a47a[_0xefd4('0x48')];_0x2caf97[_0xefd4('0x4c')]=qs[_0xefd4('0x4d')](_0x2666fc[_0xefd4('0x46')][_0xefd4('0x4d')]);_0x2caf97['where']=qs[_0xefd4('0x47')](_[_0xefd4('0x4f')](_0x2666fc[_0xefd4('0x46')],_0x39a47a[_0xefd4('0x47')]));if(_0x2666fc[_0xefd4('0x46')][_0xefd4('0x6a')]){_0x2caf97[_0xefd4('0x4e')]=_[_0xefd4('0x52')](_0x2caf97[_0xefd4('0x4e')],{'$or':_[_0xefd4('0x41')](_0x2caf97[_0xefd4('0x49')],function(_0x3f83c1){var _0x1e3286={};_0x1e3286[_0x3f83c1]={'$like':'%'+_0x2666fc[_0xefd4('0x46')][_0xefd4('0x6a')]+'%'};return _0x1e3286;})});}_0x2caf97=_[_0xefd4('0x52')]({},_0x2caf97,_0x2666fc[_0xefd4('0x53')]);return _0x177825[_0xefd4('0xe1')](_0x2caf97);}})[_0xefd4('0x23')](function(_0x3cc8db){if(_0x3cc8db){_0x5e1171=_0x3cc8db[_0xefd4('0x5b')];if(!_0x2666fc[_0xefd4('0x46')][_0xefd4('0x4b')]('nolimit')){_0x2caf97[_0xefd4('0x33')]=qs['limit'](_0x2666fc['query'][_0xefd4('0x33')]);_0x2caf97[_0xefd4('0x31')]=qs[_0xefd4('0x31')](_0x2666fc[_0xefd4('0x46')][_0xefd4('0x31')]);}return _0x177825[_0xefd4('0xe1')](_0x2caf97);}})[_0xefd4('0x23')](function(_0x4b8fb0){if(_0x4b8fb0){return _0x4b8fb0?{'count':_0x5e1171,'rows':_0x4b8fb0}:null;}})['then'](respondWithResult(_0x576b35,null))[_0xefd4('0x2c')](handleError(_0x576b35,null));}; \ No newline at end of file +var _0x3e04=['ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','jayson/promise','client','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','length','options','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','SmsAccountId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','skebby','connectel','clicksend','messageId','message_id','plivo','MessageUUID','infobip','results','text','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','*,*,*,*','SmsMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','receiveMessage','info','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','sequelize','Transaction','findAndCountAll','finally','getApplications','Contact','User','Owner','fullname','internal','Tag','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','List','out','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','message-id','state','csc','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1b7107,_0x374126){var _0x233fa1=function(_0xee5b54){while(--_0xee5b54){_0x1b7107['push'](_0x1b7107['shift']());}};_0x233fa1(++_0x374126);}(_0x3e04,0x1b9));var _0x43e0=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x3e04[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0x43e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e0('0x1'));var jsonpatch=require(_0x43e0('0x2'));var rp=require(_0x43e0('0x3'));var moment=require(_0x43e0('0x4'));var BPromise=require(_0x43e0('0x5'));var Mustache=require(_0x43e0('0x6'));var util=require(_0x43e0('0x7'));var path=require(_0x43e0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x43e0('0x9'));var fs=require('fs');var fs_extra=require(_0x43e0('0xa'));var _=require('lodash');var squel=require(_0x43e0('0xb'));var crypto=require('crypto');var jsforce=require(_0x43e0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x43e0('0xd'));var querystring=require(_0x43e0('0xe'));var Papa=require(_0x43e0('0xf'));var Redis=require(_0x43e0('0x10'));var authService=require(_0x43e0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x43e0('0x12'));var hardwareService=require(_0x43e0('0x13'));var logger=require(_0x43e0('0x14'))(_0x43e0('0x15'));var utils=require('../../config/utils');var config=require(_0x43e0('0x16'));var licenseUtil=require(_0x43e0('0x17'));var db=require(_0x43e0('0x18'))['db'];config[_0x43e0('0x19')]=_[_0x43e0('0x1a')](config[_0x43e0('0x19')],{'host':_0x43e0('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43e0('0x19')]));require(_0x43e0('0x1c'))['register'](socket);var jayson=require(_0x43e0('0x1d'));var client=jayson[_0x43e0('0x1e')][_0x43e0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xd64a01,_0x31c1fd,_0x52be69,_0x2c811a){return new BPromise(function(_0x164d98,_0x5a75ac){var _0xc5d1a3=_0x2c811a||client;return _0xc5d1a3[_0x43e0('0x20')](_0xd64a01,_0x52be69)[_0x43e0('0x21')](function(_0x1c9b09){logger['info'](_0x43e0('0x22'),_0x31c1fd,_0x43e0('0x23'));logger[_0x43e0('0x24')](_0x43e0('0x25'),_0x31c1fd,_0x43e0('0x23'),JSON[_0x43e0('0x26')](_0x1c9b09));if(_0x1c9b09[_0x43e0('0x27')]){if(_0x1c9b09[_0x43e0('0x27')][_0x43e0('0x28')]===0x1f4){logger[_0x43e0('0x27')](_0x43e0('0x22'),_0x31c1fd,_0x1c9b09[_0x43e0('0x27')][_0x43e0('0x29')]);return _0x5a75ac(_0x1c9b09[_0x43e0('0x27')][_0x43e0('0x29')]);}logger[_0x43e0('0x27')](_0x43e0('0x22'),_0x31c1fd,_0x1c9b09[_0x43e0('0x27')][_0x43e0('0x29')]);return _0x164d98(_0x1c9b09[_0x43e0('0x27')][_0x43e0('0x29')]);}else{logger['info'](_0x43e0('0x22'),_0x31c1fd,_0x43e0('0x23'));_0x164d98(_0x1c9b09[_0x43e0('0x2a')][_0x43e0('0x29')]);}})['catch'](function(_0x413efb){logger[_0x43e0('0x27')](_0x43e0('0x22'),_0x31c1fd,_0x413efb);_0x5a75ac(_0x413efb);});});}function respondWithStatusCode(_0x3aa224,_0x36910c){_0x36910c=_0x36910c||0xcc;return function(_0x59cfdf){if(_0x59cfdf){return _0x3aa224['sendStatus'](_0x36910c);}return _0x3aa224[_0x43e0('0x2b')](_0x36910c)[_0x43e0('0x2c')]();};}function respondWithResult(_0x8400f7,_0x4be456){_0x4be456=_0x4be456||0xc8;return function(_0x286dbf){if(_0x286dbf){return _0x8400f7['status'](_0x4be456)[_0x43e0('0x2d')](_0x286dbf);}};}function respondWithFilteredResult(_0x1f8e06,_0x547656){return function(_0x40ac81){if(_0x40ac81){var _0x28f5e1=typeof _0x547656[_0x43e0('0x2e')]===_0x43e0('0x2f')&&typeof _0x547656[_0x43e0('0x30')]===_0x43e0('0x2f');var _0x9f77b2=_0x40ac81[_0x43e0('0x31')];var _0x3d4a04=_0x28f5e1?0x0:_0x547656[_0x43e0('0x2e')];var _0x12c134=_0x28f5e1?_0x40ac81[_0x43e0('0x31')]:_0x547656[_0x43e0('0x2e')]+_0x547656[_0x43e0('0x30')];var _0x337cc2;if(_0x12c134>=_0x9f77b2){_0x12c134=_0x9f77b2;_0x337cc2=0xc8;}else{_0x337cc2=0xce;}_0x1f8e06[_0x43e0('0x2b')](_0x337cc2);return _0x1f8e06[_0x43e0('0x32')](_0x43e0('0x33'),_0x3d4a04+'-'+_0x12c134+'/'+_0x9f77b2)[_0x43e0('0x2d')](_0x40ac81);}return null;};}function patchUpdates(_0xa08cb9){return function(_0x3be5d6){try{jsonpatch[_0x43e0('0x34')](_0x3be5d6,_0xa08cb9,!![]);}catch(_0x1dbf82){return BPromise[_0x43e0('0x35')](_0x1dbf82);}return _0x3be5d6[_0x43e0('0x36')]();};}function saveUpdates(_0x585376,_0x321a60){return function(_0xb7d23c){if(_0xb7d23c){return _0xb7d23c[_0x43e0('0x37')](_0x585376)[_0x43e0('0x21')](function(_0x1b2a0b){return _0x1b2a0b;});}return null;};}function removeEntity(_0xdb9033,_0x25d5ff){return function(_0x5b5fd8){if(_0x5b5fd8){return _0x5b5fd8[_0x43e0('0x38')]()[_0x43e0('0x21')](function(){var _0x6cb575=_0x5b5fd8[_0x43e0('0x39')]({'plain':!![]});var _0x531e4a=_0x43e0('0x3a');return db[_0x43e0('0x3b')][_0x43e0('0x38')]({'where':{'type':_0x531e4a,'resourceId':_0x6cb575['id']}})[_0x43e0('0x21')](function(){return _0x5b5fd8;});})[_0x43e0('0x21')](function(){_0xdb9033[_0x43e0('0x2b')](0xcc)[_0x43e0('0x2c')]();});}};}function handleEntityNotFound(_0x4d663c,_0x46e959){return function(_0x3deebd){if(!_0x3deebd){_0x4d663c[_0x43e0('0x3c')](0x194);}return _0x3deebd;};}function handleError(_0x2f269d,_0x41d914){_0x41d914=_0x41d914||0x1f4;return function(_0x3b25db){logger[_0x43e0('0x27')](_0x3b25db[_0x43e0('0x3d')]);if(_0x3b25db['name']){delete _0x3b25db[_0x43e0('0x3e')];}_0x2f269d[_0x43e0('0x2b')](_0x41d914)[_0x43e0('0x3f')](_0x3b25db);};}exports[_0x43e0('0x40')]=function(_0x386eb9,_0x10b343){var _0x5c6468={'include':[{'model':db[_0x43e0('0x41')],'as':_0x43e0('0x42')}]},_0x28febd={},_0x23814e={'count':0x0,'rows':[]};var _0x2f5c52=_['map'](db[_0x43e0('0x43')][_0x43e0('0x44')],function(_0x8371b3){return{'name':_0x8371b3['fieldName'],'type':_0x8371b3[_0x43e0('0x45')][_0x43e0('0x46')]};});_0x28febd[_0x43e0('0x47')]=_['map'](_0x2f5c52,_0x43e0('0x3e'));_0x28febd[_0x43e0('0x48')]=_['keys'](_0x386eb9[_0x43e0('0x48')]);_0x28febd[_0x43e0('0x49')]=_['intersection'](_0x28febd[_0x43e0('0x47')],_0x28febd[_0x43e0('0x48')]);_0x5c6468[_0x43e0('0x4a')]=_[_0x43e0('0x4b')](_0x28febd[_0x43e0('0x47')],qs[_0x43e0('0x4c')](_0x386eb9[_0x43e0('0x48')][_0x43e0('0x4c')]));_0x5c6468[_0x43e0('0x4a')]=_0x5c6468[_0x43e0('0x4a')]['length']?_0x5c6468[_0x43e0('0x4a')]:_0x28febd[_0x43e0('0x47')];if(!_0x386eb9[_0x43e0('0x48')][_0x43e0('0x4d')](_0x43e0('0x4e'))){_0x5c6468[_0x43e0('0x30')]=qs[_0x43e0('0x30')](_0x386eb9[_0x43e0('0x48')]['limit']);_0x5c6468[_0x43e0('0x2e')]=qs[_0x43e0('0x2e')](_0x386eb9[_0x43e0('0x48')]['offset']);}_0x5c6468[_0x43e0('0x4f')]=qs['sort'](_0x386eb9[_0x43e0('0x48')][_0x43e0('0x50')]);_0x5c6468[_0x43e0('0x51')]=qs[_0x43e0('0x49')](_[_0x43e0('0x52')](_0x386eb9[_0x43e0('0x48')],_0x28febd['filters']),_0x2f5c52);if(_0x386eb9[_0x43e0('0x48')]['filter']){_0x5c6468[_0x43e0('0x51')]=_[_0x43e0('0x53')](_0x5c6468['where'],{'$or':_[_0x43e0('0x54')](_0x2f5c52,function(_0xa2e2a2){if(_0xa2e2a2['type']!==_0x43e0('0x55')){var _0x3f7937={};_0x3f7937[_0xa2e2a2['name']]={'$like':'%'+_0x386eb9[_0x43e0('0x48')][_0x43e0('0x56')]+'%'};return _0x3f7937;}})});}_0x5c6468=_[_0x43e0('0x53')]({},_0x5c6468,_0x386eb9['options']);var _0x54fbbe={'where':_0x5c6468[_0x43e0('0x51')]};return db['SmsAccount'][_0x43e0('0x31')](_0x54fbbe)[_0x43e0('0x21')](function(_0x149090){_0x23814e[_0x43e0('0x31')]=_0x149090;if(_0x386eb9['query'][_0x43e0('0x57')]){_0x5c6468[_0x43e0('0x58')]=[{'all':!![]}];}return db[_0x43e0('0x43')][_0x43e0('0x59')](_0x5c6468);})[_0x43e0('0x21')](function(_0xc55cde){_0x23814e['rows']=_0xc55cde;return _0x23814e;})['then'](respondWithFilteredResult(_0x10b343,_0x5c6468))[_0x43e0('0x5a')](handleError(_0x10b343,null));};exports[_0x43e0('0x5b')]=function(_0x2683f8,_0x50ec69){var _0x1ffc61={'raw':![],'where':{'id':_0x2683f8[_0x43e0('0x5c')]['id']},'include':[{'model':db[_0x43e0('0x41')],'as':_0x43e0('0x42')}]},_0x6df6a5={};_0x6df6a5['model']=_['keys'](db['SmsAccount'][_0x43e0('0x44')]);_0x6df6a5['query']=_[_0x43e0('0x5d')](_0x2683f8[_0x43e0('0x48')]);_0x6df6a5[_0x43e0('0x49')]=_[_0x43e0('0x4b')](_0x6df6a5[_0x43e0('0x47')],_0x6df6a5[_0x43e0('0x48')]);_0x1ffc61[_0x43e0('0x4a')]=_['intersection'](_0x6df6a5[_0x43e0('0x47')],qs[_0x43e0('0x4c')](_0x2683f8[_0x43e0('0x48')][_0x43e0('0x4c')]));_0x1ffc61[_0x43e0('0x4a')]=_0x1ffc61['attributes'][_0x43e0('0x5e')]?_0x1ffc61[_0x43e0('0x4a')]:_0x6df6a5['model'];if(_0x2683f8[_0x43e0('0x48')]['includeAll']){_0x1ffc61[_0x43e0('0x58')]=[{'all':!![]}];}_0x1ffc61=_['merge']({},_0x1ffc61,_0x2683f8[_0x43e0('0x5f')]);return db[_0x43e0('0x43')]['find'](_0x1ffc61)[_0x43e0('0x21')](handleEntityNotFound(_0x50ec69,null))['then'](respondWithResult(_0x50ec69,null))[_0x43e0('0x5a')](handleError(_0x50ec69,null));};exports[_0x43e0('0x60')]=function(_0x1113dd,_0x59b9eb){return db[_0x43e0('0x43')][_0x43e0('0x60')](_0x1113dd['body'],{})['then'](function(_0x541011){var _0x343e68=_0x1113dd['user'][_0x43e0('0x39')]({'plain':!![]});if(!_0x343e68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x343e68['role']===_0x43e0('0x61')){var _0xbbee84=_0x541011[_0x43e0('0x39')]({'plain':!![]});var _0x506930='SmsAccounts';return db[_0x43e0('0x62')]['find']({'where':{'name':_0x506930,'userProfileId':_0x343e68[_0x43e0('0x63')]},'raw':!![]})['then'](function(_0x55a3e7){if(_0x55a3e7&&_0x55a3e7['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e0('0x60')]({'name':_0xbbee84[_0x43e0('0x3e')],'resourceId':_0xbbee84['id'],'type':_0x55a3e7[_0x43e0('0x3e')],'sectionId':_0x55a3e7['id']},{})[_0x43e0('0x21')](function(){return _0x541011;});}else{return _0x541011;}})['catch'](function(_0x560de5){logger['error'](_0x43e0('0x64'),_0x560de5);throw _0x560de5;});}return _0x541011;})['then'](respondWithResult(_0x59b9eb,0xc9))[_0x43e0('0x5a')](handleError(_0x59b9eb,null));};exports['update']=function(_0x481919,_0x767b20){if(_0x481919['body']['id']){delete _0x481919[_0x43e0('0x65')]['id'];}return db['SmsAccount'][_0x43e0('0x66')]({'where':{'id':_0x481919[_0x43e0('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x43e0('0x42')}]})[_0x43e0('0x21')](handleEntityNotFound(_0x767b20,null))[_0x43e0('0x21')](saveUpdates(_0x481919[_0x43e0('0x65')],null))[_0x43e0('0x21')](respondWithResult(_0x767b20,null))[_0x43e0('0x5a')](handleError(_0x767b20,null));};exports[_0x43e0('0x38')]=function(_0x513d70,_0x158e39){return db[_0x43e0('0x43')][_0x43e0('0x66')]({'where':{'id':_0x513d70['params']['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x158e39,null))[_0x43e0('0x21')](removeEntity(_0x158e39,null))['catch'](handleError(_0x158e39,null));};exports[_0x43e0('0x67')]=function(_0x96a2f2,_0x315c99){return db[_0x43e0('0x43')][_0x43e0('0x67')]()[_0x43e0('0x21')](respondWithResult(_0x315c99,null))[_0x43e0('0x5a')](handleError(_0x315c99,null));};exports['addDisposition']=function(_0x43109c,_0x34e6de,_0x38d7e1){if(_0x43109c[_0x43e0('0x65')]['id']){delete _0x43109c[_0x43e0('0x65')]['id'];}return db[_0x43e0('0x43')]['find']({'where':{'id':_0x43109c['params']['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x34e6de,null))[_0x43e0('0x21')](function(_0x3d8830){if(_0x3d8830){_0x43109c[_0x43e0('0x65')][_0x43e0('0x68')]=_0x3d8830['id'];return db['Disposition'][_0x43e0('0x60')](_0x43109c[_0x43e0('0x65')]);}})[_0x43e0('0x21')](respondWithResult(_0x34e6de,null))[_0x43e0('0x5a')](handleError(_0x34e6de,null));};exports[_0x43e0('0x69')]=function(_0x490567,_0x382838,_0x2469f8){var _0x3d6a4d={'raw':![],'where':{}};var _0x52eab5={};var _0x295c0b={'count':0x0,'rows':[]};return db[_0x43e0('0x43')][_0x43e0('0x6a')]({'where':{'id':_0x490567[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x382838,null))[_0x43e0('0x21')](function(_0x58a8fc){if(_0x58a8fc){_0x52eab5[_0x43e0('0x47')]=_[_0x43e0('0x5d')](db[_0x43e0('0x6b')][_0x43e0('0x44')]);_0x52eab5['query']=_['keys'](_0x490567[_0x43e0('0x48')]);_0x52eab5[_0x43e0('0x49')]=_[_0x43e0('0x4b')](_0x52eab5[_0x43e0('0x47')],_0x52eab5[_0x43e0('0x48')]);_0x3d6a4d[_0x43e0('0x4a')]=_[_0x43e0('0x4b')](_0x52eab5[_0x43e0('0x47')],qs['fields'](_0x490567[_0x43e0('0x48')][_0x43e0('0x4c')]));_0x3d6a4d[_0x43e0('0x4a')]=_0x3d6a4d[_0x43e0('0x4a')][_0x43e0('0x5e')]?_0x3d6a4d['attributes']:_0x52eab5['model'];if(!_0x490567[_0x43e0('0x48')][_0x43e0('0x4d')](_0x43e0('0x4e'))){_0x3d6a4d[_0x43e0('0x30')]=qs[_0x43e0('0x30')](_0x490567['query'][_0x43e0('0x30')]);_0x3d6a4d[_0x43e0('0x2e')]=qs[_0x43e0('0x2e')](_0x490567[_0x43e0('0x48')]['offset']);}_0x3d6a4d[_0x43e0('0x4f')]=qs[_0x43e0('0x50')](_0x490567[_0x43e0('0x48')]['sort']);_0x3d6a4d['where']=qs[_0x43e0('0x49')](_['pick'](_0x490567['query'],_0x52eab5[_0x43e0('0x49')]));_0x3d6a4d[_0x43e0('0x51')][_0x43e0('0x68')]=_0x58a8fc['id'];if(_0x490567[_0x43e0('0x48')][_0x43e0('0x56')]){_0x3d6a4d[_0x43e0('0x51')]=_['merge'](_0x3d6a4d[_0x43e0('0x51')],{'$or':_[_0x43e0('0x54')](_0x3d6a4d[_0x43e0('0x4a')],function(_0x3da8f5){var _0x4f631b={};_0x4f631b[_0x3da8f5]={'$like':'%'+_0x490567[_0x43e0('0x48')][_0x43e0('0x56')]+'%'};return _0x4f631b;})});}_0x3d6a4d=_['merge']({},_0x3d6a4d,_0x490567[_0x43e0('0x5f')]);return db[_0x43e0('0x6b')][_0x43e0('0x31')]({'where':_0x3d6a4d['where']})[_0x43e0('0x21')](function(_0x3c23bc){_0x295c0b[_0x43e0('0x31')]=_0x3c23bc;if(_0x490567[_0x43e0('0x48')][_0x43e0('0x57')]){_0x3d6a4d[_0x43e0('0x58')]=[{'all':!![]}];}return db[_0x43e0('0x6b')][_0x43e0('0x59')](_0x3d6a4d);})[_0x43e0('0x21')](function(_0x526d3d){_0x295c0b[_0x43e0('0x6c')]=_0x526d3d;return _0x295c0b;});}})[_0x43e0('0x21')](respondWithFilteredResult(_0x382838,_0x3d6a4d))[_0x43e0('0x5a')](handleError(_0x382838,null));};exports[_0x43e0('0x6d')]=function(_0x524cc4,_0x2052d2,_0x14bd0d){return db['SmsAccount']['find']({'where':{'id':_0x524cc4[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x2052d2,null))[_0x43e0('0x21')](function(_0x3ec657){if(_0x3ec657){return _0x3ec657['removeDispositions'](_0x524cc4['query'][_0x43e0('0x6e')]);}})[_0x43e0('0x21')](respondWithStatusCode(_0x2052d2,null))[_0x43e0('0x5a')](handleError(_0x2052d2,null));};exports[_0x43e0('0x6f')]=function(_0x118d23,_0x23ed74,_0x15a21e){if(_0x118d23[_0x43e0('0x65')]['id']){delete _0x118d23['body']['id'];}return db[_0x43e0('0x43')][_0x43e0('0x66')]({'where':{'id':_0x118d23[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x23ed74,null))[_0x43e0('0x21')](function(_0x624553){if(_0x624553){_0x118d23['body'][_0x43e0('0x68')]=_0x624553['id'];return db[_0x43e0('0x70')][_0x43e0('0x60')](_0x118d23[_0x43e0('0x65')]);}})[_0x43e0('0x21')](respondWithResult(_0x23ed74,null))[_0x43e0('0x5a')](handleError(_0x23ed74,null));};exports[_0x43e0('0x71')]=function(_0x497949,_0xf4ca2,_0x4e8cb){var _0x1c997a={'raw':![],'where':{}};var _0x1f628c={};var _0x5435a7={'count':0x0,'rows':[]};return db[_0x43e0('0x43')][_0x43e0('0x6a')]({'where':{'id':_0x497949[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0xf4ca2,null))[_0x43e0('0x21')](function(_0x2e4b9c){if(_0x2e4b9c){_0x1f628c['model']=_['keys'](db[_0x43e0('0x70')]['rawAttributes']);_0x1f628c[_0x43e0('0x48')]=_['keys'](_0x497949[_0x43e0('0x48')]);_0x1f628c[_0x43e0('0x49')]=_[_0x43e0('0x4b')](_0x1f628c['model'],_0x1f628c[_0x43e0('0x48')]);_0x1c997a[_0x43e0('0x4a')]=_[_0x43e0('0x4b')](_0x1f628c[_0x43e0('0x47')],qs[_0x43e0('0x4c')](_0x497949[_0x43e0('0x48')][_0x43e0('0x4c')]));_0x1c997a[_0x43e0('0x4a')]=_0x1c997a[_0x43e0('0x4a')][_0x43e0('0x5e')]?_0x1c997a[_0x43e0('0x4a')]:_0x1f628c['model'];if(!_0x497949[_0x43e0('0x48')][_0x43e0('0x4d')](_0x43e0('0x4e'))){_0x1c997a[_0x43e0('0x30')]=qs[_0x43e0('0x30')](_0x497949[_0x43e0('0x48')][_0x43e0('0x30')]);_0x1c997a['offset']=qs[_0x43e0('0x2e')](_0x497949[_0x43e0('0x48')][_0x43e0('0x2e')]);}_0x1c997a['order']=qs[_0x43e0('0x50')](_0x497949['query'][_0x43e0('0x50')]);_0x1c997a['where']=qs['filters'](_[_0x43e0('0x52')](_0x497949[_0x43e0('0x48')],_0x1f628c[_0x43e0('0x49')]));_0x1c997a[_0x43e0('0x51')][_0x43e0('0x68')]=_0x2e4b9c['id'];if(_0x497949['query'][_0x43e0('0x56')]){_0x1c997a[_0x43e0('0x51')]=_[_0x43e0('0x53')](_0x1c997a[_0x43e0('0x51')],{'$or':_[_0x43e0('0x54')](_0x1c997a[_0x43e0('0x4a')],function(_0x331068){var _0x1120f0={};_0x1120f0[_0x331068]={'$like':'%'+_0x497949[_0x43e0('0x48')]['filter']+'%'};return _0x1120f0;})});}_0x1c997a=_[_0x43e0('0x53')]({},_0x1c997a,_0x497949[_0x43e0('0x5f')]);return db[_0x43e0('0x70')]['count']({'where':_0x1c997a['where']})[_0x43e0('0x21')](function(_0x4e9635){_0x5435a7[_0x43e0('0x31')]=_0x4e9635;if(_0x497949[_0x43e0('0x48')]['includeAll']){_0x1c997a[_0x43e0('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x43e0('0x59')](_0x1c997a);})[_0x43e0('0x21')](function(_0x29b433){_0x5435a7[_0x43e0('0x6c')]=_0x29b433;return _0x5435a7;});}})[_0x43e0('0x21')](respondWithFilteredResult(_0xf4ca2,_0x1c997a))[_0x43e0('0x5a')](handleError(_0xf4ca2,null));};exports[_0x43e0('0x72')]=function(_0x113c84,_0x3f34f9,_0x308ba7){return db['SmsAccount'][_0x43e0('0x66')]({'where':{'id':_0x113c84[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x3f34f9,null))[_0x43e0('0x21')](function(_0x17cf76){if(_0x17cf76){return _0x17cf76[_0x43e0('0x72')](_0x113c84[_0x43e0('0x48')][_0x43e0('0x6e')]);}})[_0x43e0('0x21')](respondWithStatusCode(_0x3f34f9,null))['catch'](handleError(_0x3f34f9,null));};exports[_0x43e0('0x73')]=function(_0x4f9d40,_0x2a6602,_0x413f56){var _0x3697a9={'channel':_0x43e0('0x74')};var _0x536cbf=[];var _0x100f46=[];var _0x1bb365={};return db[_0x43e0('0x43')][_0x43e0('0x66')]({'where':{'id':_0x4f9d40[_0x43e0('0x5c')]['id']},'include':[{'model':db[_0x43e0('0x75')],'as':_0x43e0('0x76')}]})[_0x43e0('0x21')](handleEntityNotFound(_0x2a6602,null))[_0x43e0('0x21')](function(_0x34e682){_0x3697a9[_0x43e0('0x77')]=_0x34e682;_0x3697a9['applications']=_['orderBy'](_0x34e682[_0x43e0('0x76')],[_0x43e0('0x78')],[_0x43e0('0x79')]);if(_0x3697a9[_0x43e0('0x77')][_0x43e0('0x76')]){delete _0x3697a9['account'][_0x43e0('0x76')];}return db[_0x43e0('0x7a')]['describe']();})[_0x43e0('0x21')](function(_0x3124ed){if(!_0x3124ed){throw new db['Sequelize'][(_0x43e0('0x7b'))](_0x43e0('0x7c'));}_0x536cbf=_[_0x43e0('0x7d')](_[_0x43e0('0x5d')](_0x3124ed),[_0x43e0('0x7e'),_0x43e0('0x7f')]);_0x100f46=_[_0x43e0('0x7d')](_['keys'](_0x3124ed),[_0x43e0('0x7e'),'updatedAt',_0x43e0('0x80'),'ListId']);_0x3697a9[_0x43e0('0x65')]={'mapKey':_0x43e0('0x81')};if(_0x3697a9['account'][_0x43e0('0x45')]){switch(_0x3697a9[_0x43e0('0x77')]['type']){case _0x43e0('0x82'):_0x3697a9[_0x43e0('0x65')][_0x43e0('0x83')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x84')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]=_0x4f9d40[_0x43e0('0x65')]['Body'];_0x3697a9[_0x43e0('0x65')]['messageId']=_0x4f9d40[_0x43e0('0x65')]['MessageSid'];break;case _0x43e0('0x85'):_0x3697a9[_0x43e0('0x65')]['from']='+'+_0x4f9d40[_0x43e0('0x65')]['sender'];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]=_0x4f9d40[_0x43e0('0x65')]['text'];break;case _0x43e0('0x86'):_0x3697a9['body']['from']=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x83')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x29')];break;case _0x43e0('0x87'):_0x3697a9['body'][_0x43e0('0x83')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x83')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x65')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x88')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x89')];break;case _0x43e0('0x8a'):_0x3697a9[_0x43e0('0x65')][_0x43e0('0x83')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x84')];_0x3697a9[_0x43e0('0x65')]['body']=_0x4f9d40[_0x43e0('0x65')]['Text'];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x88')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x8b')];break;case _0x43e0('0x8c'):_0x3697a9[_0x43e0('0x65')]['from']='+'+_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x8d')][0x0]['from'];_0x3697a9[_0x43e0('0x65')]['body']=_0x4f9d40['body'][_0x43e0('0x8d')][0x0][_0x43e0('0x8e')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x88')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x8d')][0x0]['messageId'];break;case'csc':_0x3697a9[_0x43e0('0x65')][_0x43e0('0x83')]=_0x4f9d40[_0x43e0('0x65')]['originatingAddress'];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]=_0x4f9d40[_0x43e0('0x65')]['segmentedMessage']['message'];break;case _0x43e0('0x8f'):_0x3697a9['body'][_0x43e0('0x83')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x90')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]=_0x4f9d40['body'][_0x43e0('0x8e')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x88')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x91')];break;case _0x43e0('0x92'):_0x3697a9[_0x43e0('0x65')][_0x43e0('0x88')]=_0x4f9d40['body'][0x0][_0x43e0('0x29')]['id'];_0x3697a9['body'][_0x43e0('0x83')]=_0x4f9d40['body'][0x0][_0x43e0('0x29')][_0x43e0('0x83')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]=_0x4f9d40[_0x43e0('0x65')][0x0][_0x43e0('0x29')][_0x43e0('0x8e')];break;case _0x43e0('0x93'):_0x3697a9[_0x43e0('0x65')][_0x43e0('0x83')]=_0x4f9d40[_0x43e0('0x65')]['from'];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]=_0x4f9d40[_0x43e0('0x65')][_0x43e0('0x29')];_0x3697a9[_0x43e0('0x65')][_0x43e0('0x88')]=_0x4f9d40[_0x43e0('0x65')]['refid'];break;}}if(_0x3697a9[_0x43e0('0x65')]['id']){delete _0x3697a9[_0x43e0('0x65')]['id'];}if(_[_0x43e0('0x94')](_0x3697a9['body']['from'])){throw new db['Sequelize']['ValidationError'](_0x43e0('0x95'));}if(_['isNil'](_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')])||_0x3697a9[_0x43e0('0x65')][_0x43e0('0x65')]===''){throw new db[(_0x43e0('0x96'))][(_0x43e0('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x43e0('0x94')](_0x3697a9[_0x43e0('0x65')][_0x43e0('0x97')])){throw new db[(_0x43e0('0x96'))][(_0x43e0('0x7b'))](_0x43e0('0x98')+_0x100f46);}if(!_[_0x43e0('0x99')](_0x100f46,_0x3697a9[_0x43e0('0x65')][_0x43e0('0x97')])){throw new db[(_0x43e0('0x96'))][(_0x43e0('0x7b'))](_0x43e0('0x9a')+_0x100f46);}_0x1bb365[_0x3697a9[_0x43e0('0x65')][_0x43e0('0x97')]]=_0x3697a9[_0x43e0('0x65')]['from'];return db['CmList'][_0x43e0('0x66')]({'where':{'id':_0x3697a9[_0x43e0('0x77')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x43e0('0x9b'),'where':_0x1bb365,'limit':0x1,'order':[[_0x43e0('0x7f'),_0x43e0('0x9c')]]}]});})[_0x43e0('0x21')](handleEntityNotFound(_0x2a6602,null))[_0x43e0('0x21')](function(_0xf291b1){if(_0xf291b1){_0x3697a9[_0x43e0('0x9d')]=_[_0x43e0('0x9e')](_0xf291b1,['Contacts']);if(_0xf291b1[_0x43e0('0x9b')][_0x43e0('0x5e')]){return _0xf291b1[_0x43e0('0x9b')][0x0];}var _0x1e2dd9=_[_0x43e0('0x1a')](_0x3697a9[_0x43e0('0x65')],{'firstName':_0x3697a9[_0x43e0('0x65')]['from'],'ListId':_0xf291b1['id']});_0x1e2dd9[_0x3697a9['body'][_0x43e0('0x97')]]=_0x3697a9['body'][_0x43e0('0x83')];return db[_0x43e0('0x7a')][_0x43e0('0x60')](_0x1e2dd9,{'fields':_0x536cbf,'raw':!![]});}})['then'](handleEntityNotFound(_0x2a6602,null))[_0x43e0('0x21')](function(_0x29415b){if(_0x29415b){_0x3697a9[_0x43e0('0x9f')]=_0x29415b;var _0x44a6e5={'ContactId':_0x29415b['id'],'phone':_0x3697a9['body'][_0x43e0('0x83')],'SmsAccountId':_0x4f9d40[_0x43e0('0x5c')]['id']};var _0x5ca6cf={'ContactId':_0x29415b['id'],'SmsAccountId':_0x4f9d40['params']['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x5ca6cf})[_0x43e0('0x21')](function(_0x531355){if(_0x531355){return[_0x531355,![]];}return db[_0x43e0('0xa0')][_0x43e0('0x60')](_0x44a6e5)[_0x43e0('0x21')](function(_0x408d48){return[_0x408d48,!![]];});});}})[_0x43e0('0xa1')](function(_0x2d2ff1,_0xc564f7){_0x3697a9[_0x43e0('0xa2')]=_0x2d2ff1[_0x43e0('0x39')]({'plain':!![]});_0x3697a9['interaction'][_0x43e0('0xa3')]=![];if(_0xc564f7){if(_0x3697a9[_0x43e0('0x77')][_0x43e0('0xa4')]){_0x3697a9[_0x43e0('0xa5')][_0x43e0('0xa6')]({'id':0x0,'priority':_0x3697a9[_0x43e0('0xa5')]['length']+0x1,'app':_0x43e0('0xa7'),'appdata':'unmanaged','interval':_0x43e0('0xa8')});}_0x3697a9[_0x43e0('0xa2')][_0x43e0('0xa3')]=!![];}return db[_0x43e0('0xa9')]['create']({'phone':_0x3697a9[_0x43e0('0x65')]['from'],'messageId':_0x3697a9[_0x43e0('0x65')][_0x43e0('0x88')],'body':_0x3697a9[_0x43e0('0x65')]['body'],'SmsAccountId':_0x4f9d40['params']['id'],'SmsInteractionId':_0x2d2ff1['id'],'direction':'in','ContactId':_0x2d2ff1['ContactId'],'AttachmentId':_0x3697a9[_0x43e0('0x65')][_0x43e0('0xaa')]});})[_0x43e0('0x21')](function(_0x2bfb52){_0x3697a9[_0x43e0('0x29')]=_0x2bfb52;if(_0x3697a9[_0x43e0('0xa2')][_0x43e0('0xab')]){return db['User']['find']({'attributes':['id',_0x43e0('0x3e')],'where':{'id':_0x3697a9[_0x43e0('0xa2')][_0x43e0('0xab')]}})[_0x43e0('0x21')](function(_0x83adc){if(_0x83adc){_0x3697a9[_0x43e0('0xa5')][_0x43e0('0xac')]({'id':0x0,'priority':0x0,'app':_0x43e0('0xad'),'appdata':_0x83adc['name']+','+(_0x3697a9['account'][_0x43e0('0xae')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x43e0('0xaf'),'startRouting',_0x3697a9);});}return respondWithRpcPromise('Start','startRouting',_0x3697a9);})['then'](function(_0x108c8a){if(_0x108c8a){var _0x16b5de=0xc8;var _0x33416b=_0x43e0('0xb0');logger[_0x43e0('0xb1')](_0x43e0('0x25'),_0x33416b,_0x16b5de,'entity\x20found');logger[_0x43e0('0x24')](_0x43e0('0xb2'),_0x33416b,_0x16b5de,'entity\x20found',JSON[_0x43e0('0x26')](_0x108c8a));if(_0x3697a9[_0x43e0('0x77')][_0x43e0('0x45')]===_0x43e0('0x82')){return _0x2a6602[_0x43e0('0x2b')](_0x16b5de)['set'](_0x43e0('0xb3'),_0x43e0('0xb4'))[_0x43e0('0x3f')](_0x43e0('0xb5'));}else{return _0x2a6602[_0x43e0('0x2b')](_0x16b5de)[_0x43e0('0x2d')](_0x108c8a);}}})['catch'](handleError(_0x2a6602,null));};exports['addApplications']=function(_0x5833f7,_0x18e4d0){var _0x1b8f73=_0x5833f7['params']['id'];var _0x2da024=_0x5833f7[_0x43e0('0x65')];var _0x4fdfb3=0xc8;var _0x37bc3d=null;return db[_0x43e0('0xb6')]['transaction']({'isolationLevel':db['sequelize'][_0x43e0('0xb7')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x12ce74){return db[_0x43e0('0x43')]['findOne']({'where':{'id':_0x1b8f73},'transaction':_0x12ce74})[_0x43e0('0x21')](function(_0x339255){if(_0x339255){return db['SmsApplication'][_0x43e0('0x38')]({'where':{'SmsAccountId':_0x1b8f73},'transaction':_0x12ce74})[_0x43e0('0x21')](function(){var _0x37f186=_[_0x43e0('0x54')](_0x2da024,function(_0x3511be){_0x3511be['SmsAccountId']=_0x1b8f73;return _0x3511be;});return db[_0x43e0('0x75')]['bulkCreate'](_0x37f186,{'transaction':_0x12ce74});});}else{_0x4fdfb3=0x194;_0x37bc3d=[];}});})[_0x43e0('0x21')](function(){if(_0x4fdfb3!==0x194){return db['SmsApplication'][_0x43e0('0xb8')]({'where':{'SmsAccountId':_0x1b8f73},'order':_0x43e0('0x78')})[_0x43e0('0x21')](function(_0x57b288){_0x37bc3d=_0x57b288;});}})[_0x43e0('0x5a')](function(_0x7e991d){_0x4fdfb3=0x1f4;logger[_0x43e0('0x27')](_0x7e991d[_0x43e0('0x3d')]);if(_0x7e991d[_0x43e0('0x3e')]){delete _0x7e991d[_0x43e0('0x3e')];}_0x37bc3d=_0x7e991d;})[_0x43e0('0xb9')](function(){if(_0x37bc3d===null){_0x18e4d0[_0x43e0('0x3c')](_0x4fdfb3);}else{if(_0x4fdfb3===0x1f4){_0x18e4d0['status'](_0x4fdfb3)[_0x43e0('0x3f')](_0x37bc3d);}else{_0x18e4d0['status'](_0x4fdfb3)[_0x43e0('0x2d')](_0x37bc3d);}}});};exports[_0x43e0('0xba')]=function(_0x3970f2,_0x3934b3,_0x6097b1){var _0xd562b={};var _0xc34236={};var _0x265536;var _0x387b61;return db[_0x43e0('0x43')][_0x43e0('0x6a')]({'where':{'id':_0x3970f2[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x3934b3,null))[_0x43e0('0x21')](function(_0x97c70d){if(_0x97c70d){_0x265536=_0x97c70d;_0xc34236[_0x43e0('0x47')]=_[_0x43e0('0x5d')](db[_0x43e0('0x75')][_0x43e0('0x44')]);_0xc34236[_0x43e0('0x48')]=_['keys'](_0x3970f2['query']);_0xc34236['filters']=_[_0x43e0('0x4b')](_0xc34236[_0x43e0('0x47')],_0xc34236[_0x43e0('0x48')]);_0xd562b[_0x43e0('0x4a')]=_[_0x43e0('0x4b')](_0xc34236['model'],qs[_0x43e0('0x4c')](_0x3970f2[_0x43e0('0x48')][_0x43e0('0x4c')]));_0xd562b[_0x43e0('0x4a')]=_0xd562b[_0x43e0('0x4a')][_0x43e0('0x5e')]?_0xd562b['attributes']:_0xc34236['model'];_0xd562b['order']=qs[_0x43e0('0x50')](_0x3970f2[_0x43e0('0x48')]['sort']);_0xd562b[_0x43e0('0x51')]=qs['filters'](_[_0x43e0('0x52')](_0x3970f2[_0x43e0('0x48')],_0xc34236[_0x43e0('0x49')]));if(_0x3970f2[_0x43e0('0x48')][_0x43e0('0x56')]){_0xd562b[_0x43e0('0x51')]=_[_0x43e0('0x53')](_0xd562b[_0x43e0('0x51')],{'$or':_[_0x43e0('0x54')](_0xd562b[_0x43e0('0x4a')],function(_0x47179c){var _0x3299b2={};_0x3299b2[_0x47179c]={'$like':'%'+_0x3970f2[_0x43e0('0x48')][_0x43e0('0x56')]+'%'};return _0x3299b2;})});}_0xd562b=_['merge']({},_0xd562b,_0x3970f2['options']);return _0x265536[_0x43e0('0xba')](_0xd562b);}})[_0x43e0('0x21')](function(_0x3f8f62){if(_0x3f8f62){_0x387b61=_0x3f8f62[_0x43e0('0x5e')];if(!_0x3970f2[_0x43e0('0x48')][_0x43e0('0x4d')](_0x43e0('0x4e'))){_0xd562b[_0x43e0('0x30')]=qs['limit'](_0x3970f2[_0x43e0('0x48')]['limit']);_0xd562b['offset']=qs[_0x43e0('0x2e')](_0x3970f2[_0x43e0('0x48')]['offset']);}return _0x265536[_0x43e0('0xba')](_0xd562b);}})['then'](function(_0x332ccc){if(_0x332ccc){return _0x332ccc?{'count':_0x387b61,'rows':_0x332ccc}:null;}})[_0x43e0('0x21')](respondWithResult(_0x3934b3,null))[_0x43e0('0x5a')](handleError(_0x3934b3,null));};exports['getInteractions']=function(_0x361b7a,_0x29a9f4,_0x5c6c4f){var _0x2def0e={'raw':![],'where':{}};var _0x3a5f26={};var _0x451607={'count':0x0,'rows':[]};return db[_0x43e0('0x43')][_0x43e0('0x6a')]({'where':{'id':_0x361b7a[_0x43e0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x29a9f4,null))[_0x43e0('0x21')](function(_0xfbfd41){if(_0xfbfd41){_0x3a5f26[_0x43e0('0x47')]=_[_0x43e0('0x5d')](db[_0x43e0('0xa0')][_0x43e0('0x44')]);_0x3a5f26[_0x43e0('0x48')]=_[_0x43e0('0x5d')](_0x361b7a[_0x43e0('0x48')]);_0x3a5f26['filters']=_[_0x43e0('0x4b')](_0x3a5f26[_0x43e0('0x47')],_0x3a5f26[_0x43e0('0x48')]);_0x2def0e[_0x43e0('0x4a')]=_['intersection'](_0x3a5f26[_0x43e0('0x47')],qs['fields'](_0x361b7a[_0x43e0('0x48')][_0x43e0('0x4c')]));_0x2def0e['attributes']=_0x2def0e[_0x43e0('0x4a')][_0x43e0('0x5e')]?_0x2def0e[_0x43e0('0x4a')]:_0x3a5f26['model'];if(!_0x361b7a[_0x43e0('0x48')][_0x43e0('0x4d')](_0x43e0('0x4e'))){_0x2def0e['limit']=qs[_0x43e0('0x30')](_0x361b7a[_0x43e0('0x48')][_0x43e0('0x30')]);_0x2def0e['offset']=qs[_0x43e0('0x2e')](_0x361b7a[_0x43e0('0x48')][_0x43e0('0x2e')]);}_0x2def0e[_0x43e0('0x4f')]=qs[_0x43e0('0x50')](_0x361b7a[_0x43e0('0x48')][_0x43e0('0x50')]);_0x2def0e[_0x43e0('0x51')]=qs['filters'](_[_0x43e0('0x52')](_0x361b7a[_0x43e0('0x48')],_0x3a5f26[_0x43e0('0x49')]));_0x2def0e['where'][_0x43e0('0x68')]=_0xfbfd41['id'];if(_0x361b7a[_0x43e0('0x48')][_0x43e0('0x56')]){_0x2def0e[_0x43e0('0x51')]=_['merge'](_0x2def0e[_0x43e0('0x51')],{'$or':_[_0x43e0('0x54')](_0x2def0e['attributes'],function(_0x53c069){var _0x386077={};_0x386077[_0x53c069]={'$like':'%'+_0x361b7a['query'][_0x43e0('0x56')]+'%'};return _0x386077;})});}_0x2def0e=_[_0x43e0('0x53')]({},_0x2def0e,_0x361b7a[_0x43e0('0x5f')]);return db[_0x43e0('0xa0')][_0x43e0('0x31')]({'where':_0x2def0e[_0x43e0('0x51')]})[_0x43e0('0x21')](function(_0x54200f){_0x451607[_0x43e0('0x31')]=_0x54200f;if(_0x361b7a[_0x43e0('0x48')][_0x43e0('0x57')]){_0x2def0e[_0x43e0('0x58')]=[{'model':db[_0x43e0('0x7a')],'as':_0x43e0('0xbb'),'required':![]},{'model':db[_0x43e0('0xbc')],'as':_0x43e0('0xbd'),'attributes':['name',_0x43e0('0xbe'),_0x43e0('0xbf')],'required':![]},{'model':db[_0x43e0('0xc0')],'as':_0x43e0('0xc1'),'attributes':['id',_0x43e0('0x3e'),'color'],'where':_0x361b7a[_0x43e0('0x48')][_0x43e0('0xc2')]?{'id':_0x361b7a[_0x43e0('0x48')][_0x43e0('0xc2')]}:undefined,'required':_0x361b7a[_0x43e0('0x48')][_0x43e0('0xc2')]?!![]:![]}];}return db[_0x43e0('0xa0')]['findAll'](_0x2def0e);})[_0x43e0('0x21')](function(_0x2fda0e){_0x451607[_0x43e0('0x6c')]=_0x2fda0e;return _0x451607;});}})[_0x43e0('0x21')](respondWithFilteredResult(_0x29a9f4,_0x2def0e))['catch'](handleError(_0x29a9f4,null));};exports[_0x43e0('0x3f')]=function(_0x17a317,_0x47bcbb,_0x5a188e){var _0x16e01c,_0xfce399,_0x18ccc2;if(_[_0x43e0('0x94')](_0x17a317[_0x43e0('0x65')][_0x43e0('0x65')])||_0x17a317['body'][_0x43e0('0x65')]===''){throw new db['Sequelize'][(_0x43e0('0x7b'))](_0x43e0('0xc3'));}if(_['isNil'](_0x17a317[_0x43e0('0x65')]['to'])){throw new db[(_0x43e0('0x96'))][(_0x43e0('0x7b'))]('to\x20is\x20mandatory');}_0x16e01c=_0x17a317[_0x43e0('0x65')]['to'];return db[_0x43e0('0x43')][_0x43e0('0x66')]({'where':{'id':_0x17a317[_0x43e0('0x5c')]['id']},'include':[{'model':db[_0x43e0('0xc4')],'as':_0x43e0('0xc5'),'include':[{'model':db[_0x43e0('0x7a')],'as':'Contacts','where':{'mobile':_0x16e01c},'limit':0x1,'order':[[_0x43e0('0x7f'),_0x43e0('0x9c')]]}]}]})[_0x43e0('0x21')](handleEntityNotFound(_0x47bcbb,null))[_0x43e0('0x21')](function(_0x130dec){if(_0x130dec&&_0x130dec['List']){_0xfce399=_0x130dec[_0x43e0('0x39')]({'plain':!![]});if(_0xfce399[_0x43e0('0xc5')]&&_0xfce399[_0x43e0('0xc5')][_0x43e0('0x9b')][_0x43e0('0x5e')]){return _0xfce399['List'][_0x43e0('0x9b')][0x0];}return db[_0x43e0('0x7a')][_0x43e0('0x60')](_[_0x43e0('0x1a')](_0x17a317[_0x43e0('0x65')],{'firstName':_0x16e01c,'mobile':_0x16e01c,'phone':_0x16e01c,'ListId':_0xfce399['ListId']}));}})[_0x43e0('0x21')](handleEntityNotFound(_0x47bcbb,null))[_0x43e0('0x21')](function(_0x3fe200){if(_0x3fe200){_0x18ccc2=_0x3fe200;return db['SmsInteraction'][_0x43e0('0x66')]({'where':{'ContactId':_0x18ccc2['id'],'closed':![],'SmsAccountId':_0xfce399['id']}})[_0x43e0('0x21')](function(_0x1bed9f){if(_0x1bed9f){return[_0x1bed9f,![]];}return db[_0x43e0('0xa0')][_0x43e0('0x60')]({'UserId':_0x17a317[_0x43e0('0x61')]['id'],'ContactId':_0x18ccc2['id'],'SmsAccountId':_0xfce399['id'],'phone':_0x16e01c,'firstMsgDirection':_0x43e0('0xc6'),'Messages':[_['merge'](_0x17a317[_0x43e0('0x65')],{'read':![],'body':_0x17a317[_0x43e0('0x65')][_0x43e0('0x65')],'phone':_0x16e01c,'SmsAccountId':_0xfce399['id'],'UserId':_0x17a317[_0x43e0('0x61')]['id'],'ContactId':_0x18ccc2['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x43e0('0xc7')}]})[_0x43e0('0x21')](function(_0x171f33){return[_0x171f33,!![]];});});}})[_0x43e0('0xa1')](function(_0x511b02,_0x114218){if(_0x114218){return _0x511b02;}return db['SmsMessage']['create'](_['merge'](_0x17a317[_0x43e0('0x65')],{'read':![],'body':_0x17a317[_0x43e0('0x65')]['body'],'phone':_0x16e01c,'SmsAccountId':_0xfce399['id'],'SmsInteractionId':_0x511b02['id'],'UserId':_0x17a317['user']['id'],'ContactId':_0x18ccc2['id']}))[_0x43e0('0x21')](function(_0x386420){_0x511b02[_0x43e0('0xc8')]['Messages']=[];_0x511b02[_0x43e0('0xc8')][_0x43e0('0xc7')][_0x43e0('0xa6')](_0x386420[_0x43e0('0xc8')]);return _0x511b02;});})[_0x43e0('0x21')](respondWithResult(_0x47bcbb,null))[_0x43e0('0x5a')](handleError(_0x47bcbb,null));};exports[_0x43e0('0x2b')]=function(_0x971dd8,_0x20bed6,_0x18780f){if(_0x971dd8[_0x43e0('0x65')]['id']){delete _0x971dd8['body']['id'];}var _0x5d05ae,_0x15ef38,_0x4ac52e;return db['SmsAccount'][_0x43e0('0x66')]({'where':{'id':_0x971dd8[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x20bed6,null))[_0x43e0('0x21')](function(_0x38ea87){if(_0x38ea87){_0x4ac52e=_0x38ea87;logger[_0x43e0('0x24')](_0x43e0('0x25'),_0x43e0('0x2b'),'received\x20delivery\x20report\x20from',_0x38ea87['type'],util[_0x43e0('0xc9')](_0x971dd8[_0x43e0('0x65')],{'showHidden':![],'depth':null}));switch(_0x38ea87['type']){case'skebby':if(_0x971dd8[_0x43e0('0x65')][_0x43e0('0xca')]&&_0x971dd8['body'][_0x43e0('0x2b')]){_0x15ef38=_0x971dd8['body']['status'];return db[_0x43e0('0xa9')]['find']({'where':{'messageId':_0x971dd8['body']['skebby_dispatch_id']}});}break;case _0x43e0('0x86'):if(_0x971dd8['body']['requestid']&&_0x971dd8[_0x43e0('0x65')][_0x43e0('0xcb')]){_0x15ef38=_0x971dd8[_0x43e0('0x65')][_0x43e0('0xcb')];return db[_0x43e0('0xa9')][_0x43e0('0x66')]({'where':{'messageId':_0x971dd8[_0x43e0('0x65')][_0x43e0('0xcc')]}});}break;case'clicksend':if(_0x971dd8[_0x43e0('0x65')]['message_id']&&_0x971dd8[_0x43e0('0x65')][_0x43e0('0xcd')]){_0x15ef38=_0x971dd8['body'][_0x43e0('0xcd')];return db[_0x43e0('0xa9')][_0x43e0('0x66')]({'where':{'messageId':_0x971dd8[_0x43e0('0x65')]['message_id']}});}break;case'infobip':var _0x15ab6b=_0x971dd8[_0x43e0('0x65')][_0x43e0('0x8d')][0x0];if(_0x15ab6b[_0x43e0('0x88')]&&_0x15ab6b['status'][_0x43e0('0xce')]===_0x43e0('0xcf')){_0x15ef38=_0x15ab6b[_0x43e0('0x2b')]['groupName'];return db[_0x43e0('0xa9')][_0x43e0('0x66')]({'where':{'messageId':_0x15ab6b[_0x43e0('0x88')]}});}break;case _0x43e0('0x8f'):if(_0x971dd8['body'][_0x43e0('0x88')]&&_0x971dd8[_0x43e0('0x65')]['status']){_0x15ef38=_0x971dd8[_0x43e0('0x65')][_0x43e0('0x2b')];return db[_0x43e0('0xa9')][_0x43e0('0x66')]({'where':{'messageId':_0x971dd8[_0x43e0('0x65')][_0x43e0('0x88')]}});}break;case _0x43e0('0x92'):if(_0x971dd8[_0x43e0('0x65')][0x0][_0x43e0('0x29')]['id']){_0x15ef38=_0x971dd8[_0x43e0('0x65')][0x0][_0x43e0('0x45')];return db[_0x43e0('0xa9')][_0x43e0('0x66')]({'where':{'messageId':_0x971dd8[_0x43e0('0x65')][0x0][_0x43e0('0x29')]['id']}});}break;case _0x43e0('0x93'):if(_0x971dd8[_0x43e0('0x65')][_0x43e0('0xd0')]&&_0x971dd8[_0x43e0('0x65')][_0x43e0('0x2b')]){_0x15ef38=_0x971dd8[_0x43e0('0x65')]['status'];return db[_0x43e0('0xa9')]['find']({'where':{'messageId':_0x971dd8['body'][_0x43e0('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x20bed6,null))[_0x43e0('0x21')](function(_0x24c250){if(_0x24c250){_0x5d05ae=_0x24c250;switch(_0x4ac52e[_0x43e0('0x45')]){case _0x43e0('0x85'):if(_0x15ef38===_0x43e0('0xcf')){return _0x5d05ae[_0x43e0('0x37')]({'read':!![]});}else{logger[_0x43e0('0x27')](_0x43e0('0x25'),_0x43e0('0x2b'),_0x43e0('0x85'),util[_0x43e0('0xc9')](_0x971dd8[_0x43e0('0x65')],{'showHidden':![],'depth':null}));}break;case _0x43e0('0x86'):if(_0x15ef38==='1'){return _0x5d05ae[_0x43e0('0x37')]({'read':!![]});}else{logger[_0x43e0('0x27')](_0x43e0('0x25'),_0x43e0('0x2b'),_0x43e0('0x85'),util[_0x43e0('0xc9')](_0x971dd8[_0x43e0('0x65')],{'showHidden':![],'depth':null}));}break;case _0x43e0('0x87'):if(!_0x971dd8['body'][_0x43e0('0xd1')]&&_0x15ef38>=0xc8&&_0x15ef38<=0xce){return _0x5d05ae[_0x43e0('0x37')]({'read':!![]});}else{logger[_0x43e0('0x27')](_0x43e0('0x25'),'status','clicksend',util['inspect'](_0x971dd8[_0x43e0('0x65')],{'showHidden':![],'depth':null}));}break;case _0x43e0('0x8c'):var _0x92132a=_0x971dd8[_0x43e0('0x65')][_0x43e0('0x8d')][0x0];if(_0x92132a['status'][_0x43e0('0xce')]===_0x43e0('0xcf')){return _0x5d05ae[_0x43e0('0x37')]({'read':!![]});}else{logger[_0x43e0('0x27')](_0x43e0('0x25'),_0x43e0('0x2b'),'infobip',util[_0x43e0('0xc9')](_0x971dd8['body'],{'showHidden':![],'depth':null}));}break;case _0x43e0('0x8f'):if(_0x15ef38==_0x43e0('0xd2')||_0x15ef38==_0x43e0('0xd3')){return _0x5d05ae['update']({'read':!![]});}else{logger[_0x43e0('0x27')](_0x43e0('0x25'),_0x43e0('0x2b'),_0x43e0('0x8f'),util[_0x43e0('0xc9')](_0x971dd8['body'],{'showHidden':![],'depth':null}));}break;case _0x43e0('0x92'):if(_0x15ef38==_0x43e0('0xd4')){return _0x5d05ae[_0x43e0('0x37')]({'read':!![]});}else{logger[_0x43e0('0x27')](_0x43e0('0x25'),_0x43e0('0x2b'),_0x43e0('0x92'),util[_0x43e0('0xc9')](_0x971dd8[_0x43e0('0x65')],{'showHidden':![],'depth':null}));}break;case _0x43e0('0x93'):if(_0x15ef38===_0x43e0('0xd5')||_0x15ef38===_0x43e0('0xd6')){return _0x5d05ae['update']({'read':!![]});}else{logger['error'](_0x43e0('0x25'),_0x43e0('0x2b'),_0x43e0('0x93'),util[_0x43e0('0xc9')](_0x971dd8[_0x43e0('0x65')],{'showHidden':![],'depth':null}));}break;}return _0x5d05ae;}})[_0x43e0('0x21')](respondWithResult(_0x20bed6,null))[_0x43e0('0x5a')](handleError(_0x20bed6,null));};exports['statusGet']=function(_0x46fbed,_0x1065f0,_0x3cc7b4){var _0x54022e,_0x1edc5b,_0x42f90c;return db['SmsAccount']['find']({'where':{'id':_0x46fbed[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x1065f0,null))[_0x43e0('0x21')](function(_0x5cc9f2){if(_0x5cc9f2){_0x42f90c=_0x5cc9f2;logger[_0x43e0('0x24')](_0x43e0('0x25'),_0x43e0('0x2b'),'received\x20delivery\x20report\x20from',_0x5cc9f2['type'],util[_0x43e0('0xc9')](_0x46fbed['query'],{'showHidden':![],'depth':null}));switch(_0x5cc9f2['type']){case'csc':if(_0x46fbed['query'][_0x43e0('0xd7')]&&_0x46fbed['query'][_0x43e0('0xd8')]){_0x1edc5b=_0x46fbed[_0x43e0('0x48')][_0x43e0('0xd8')];return db[_0x43e0('0xa9')][_0x43e0('0x66')]({'where':{'messageId':_0x46fbed['query'][_0x43e0('0xd7')]}});}break;}}})[_0x43e0('0x21')](handleEntityNotFound(_0x1065f0,null))[_0x43e0('0x21')](function(_0x5ceef6){if(_0x5ceef6){_0x54022e=_0x5ceef6;switch(_0x42f90c['type']){case'csc':if(_0x1edc5b==='2'||_0x1edc5b==='6'){return _0x54022e[_0x43e0('0x37')]({'read':!![]});}else{logger[_0x43e0('0x27')](_0x43e0('0x25'),'status',_0x43e0('0xd9'),util[_0x43e0('0xc9')](_0x46fbed[_0x43e0('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x54022e;}})[_0x43e0('0x21')](respondWithResult(_0x1065f0,null))[_0x43e0('0x5a')](handleError(_0x1065f0,null));};exports[_0x43e0('0xda')]=function(_0x5a1304,_0x332c1a,_0x3ab01d){return db[_0x43e0('0x43')][_0x43e0('0x66')]({'where':{'id':_0x5a1304[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x332c1a,null))['then'](function(_0x362e5b){if(_0x362e5b){return _0x362e5b[_0x43e0('0xda')](_0x5a1304['body']['ids'],_[_0x43e0('0x9e')](_0x5a1304['body'],[_0x43e0('0x6e'),'id'])||{})['spread'](function(_0x4a037e){for(var _0x353a32=0x0;_0x353a32<_0x5a1304[_0x43e0('0x65')]['ids'][_0x43e0('0x5e')];_0x353a32+=0x1){socket[_0x43e0('0xdb')](_0x43e0('0xdc'),{'UserId':Number(_0x5a1304[_0x43e0('0x65')][_0x43e0('0x6e')][_0x353a32]),'SmsAccountId':Number(_0x5a1304['params']['id'])});}return _0x4a037e;});}})[_0x43e0('0x21')](respondWithResult(_0x332c1a,null))[_0x43e0('0x5a')](handleError(_0x332c1a,null));};exports['removeAgents']=function(_0x598b70,_0x25903a,_0x4b3e7c){return db[_0x43e0('0x43')][_0x43e0('0x66')]({'where':{'id':_0x598b70[_0x43e0('0x5c')]['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x25903a,null))[_0x43e0('0x21')](function(_0x27cec0){if(_0x27cec0){return _0x27cec0[_0x43e0('0xdd')](_0x598b70['query'][_0x43e0('0x6e')])[_0x43e0('0x21')](function(){if(_[_0x43e0('0xde')](_0x598b70[_0x43e0('0x48')][_0x43e0('0x6e')])){for(var _0x39a08d=0x0;_0x39a08d<_0x598b70[_0x43e0('0x48')][_0x43e0('0x6e')]['length'];_0x39a08d+=0x1){socket[_0x43e0('0xdb')](_0x43e0('0xdf'),{'UserId':Number(_0x598b70[_0x43e0('0x48')]['ids'][_0x39a08d]),'SmsAccountId':Number(_0x598b70[_0x43e0('0x5c')]['id'])});}}else{socket['emit'](_0x43e0('0xdf'),{'UserId':Number(_0x598b70[_0x43e0('0x48')][_0x43e0('0x6e')]),'SmsAccountId':Number(_0x598b70[_0x43e0('0x5c')]['id'])});}});}})[_0x43e0('0x21')](respondWithStatusCode(_0x25903a,null))[_0x43e0('0x5a')](handleError(_0x25903a,null));};exports[_0x43e0('0xe0')]=function(_0x5ab12e,_0x4955b1,_0x16544f){var _0x161eb7={};var _0x3d2ffa={};var _0x8a5186;var _0x5cb749;return db['SmsAccount'][_0x43e0('0x6a')]({'where':{'id':_0x5ab12e['params']['id']}})[_0x43e0('0x21')](handleEntityNotFound(_0x4955b1,null))[_0x43e0('0x21')](function(_0x2ffadc){if(_0x2ffadc){_0x8a5186=_0x2ffadc;_0x3d2ffa[_0x43e0('0x47')]=_['keys'](db[_0x43e0('0xbc')][_0x43e0('0x44')]);_0x3d2ffa[_0x43e0('0x48')]=_[_0x43e0('0x5d')](_0x5ab12e['query']);_0x3d2ffa['filters']=_[_0x43e0('0x4b')](_0x3d2ffa[_0x43e0('0x47')],_0x3d2ffa['query']);_0x161eb7[_0x43e0('0x4a')]=_['intersection'](_0x3d2ffa[_0x43e0('0x47')],qs[_0x43e0('0x4c')](_0x5ab12e[_0x43e0('0x48')][_0x43e0('0x4c')]));_0x161eb7[_0x43e0('0x4a')]=_0x161eb7[_0x43e0('0x4a')]['length']?_0x161eb7[_0x43e0('0x4a')]:_0x3d2ffa[_0x43e0('0x47')];_0x161eb7[_0x43e0('0x4f')]=qs[_0x43e0('0x50')](_0x5ab12e[_0x43e0('0x48')][_0x43e0('0x50')]);_0x161eb7['where']=qs[_0x43e0('0x49')](_[_0x43e0('0x52')](_0x5ab12e[_0x43e0('0x48')],_0x3d2ffa[_0x43e0('0x49')]));if(_0x5ab12e['query'][_0x43e0('0x56')]){_0x161eb7[_0x43e0('0x51')]=_['merge'](_0x161eb7[_0x43e0('0x51')],{'$or':_[_0x43e0('0x54')](_0x161eb7[_0x43e0('0x4a')],function(_0x36fc83){var _0x6e9710={};_0x6e9710[_0x36fc83]={'$like':'%'+_0x5ab12e[_0x43e0('0x48')][_0x43e0('0x56')]+'%'};return _0x6e9710;})});}_0x161eb7=_[_0x43e0('0x53')]({},_0x161eb7,_0x5ab12e[_0x43e0('0x5f')]);return _0x8a5186[_0x43e0('0xe0')](_0x161eb7);}})['then'](function(_0xf9d7bf){if(_0xf9d7bf){_0x5cb749=_0xf9d7bf[_0x43e0('0x5e')];if(!_0x5ab12e[_0x43e0('0x48')][_0x43e0('0x4d')](_0x43e0('0x4e'))){_0x161eb7[_0x43e0('0x30')]=qs['limit'](_0x5ab12e[_0x43e0('0x48')][_0x43e0('0x30')]);_0x161eb7['offset']=qs[_0x43e0('0x2e')](_0x5ab12e[_0x43e0('0x48')][_0x43e0('0x2e')]);}return _0x8a5186[_0x43e0('0xe0')](_0x161eb7);}})[_0x43e0('0x21')](function(_0x393442){if(_0x393442){return _0x393442?{'count':_0x5cb749,'rows':_0x393442}:null;}})[_0x43e0('0x21')](respondWithResult(_0x4955b1,null))[_0x43e0('0x5a')](handleError(_0x4955b1,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 402a9cd..975edb2 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 _0x75fc=['exports','events','SmsAccount','update','remove','emit','hasOwnProperty','hook'];(function(_0x393055,_0x309968){var _0x5411f9=function(_0x6c4426){while(--_0x6c4426){_0x393055['push'](_0x393055['shift']());}};_0x5411f9(++_0x309968);}(_0x75fc,0x199));var _0xc75f=function(_0x260bed,_0x553a99){_0x260bed=_0x260bed-0x0;var _0x32d6fb=_0x75fc[_0x260bed];return _0x32d6fb;};'use strict';var EventEmitter=require(_0xc75f('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xc75f('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc75f('0x2'),'afterDestroy':_0xc75f('0x3')};function emitEvent(_0x5399eb){return function(_0x3cd51d,_0xd310b9,_0x108111){SmsAccountEvents[_0xc75f('0x4')](_0x5399eb+':'+_0x3cd51d['id'],_0x3cd51d);SmsAccountEvents['emit'](_0x5399eb,_0x3cd51d);_0x108111(null);};}for(var e in events){if(events[_0xc75f('0x5')](e)){var event=events[e];SmsAccount[_0xc75f('0x6')](e,emitEvent(event));}}module[_0xc75f('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x2d93=['save','update','remove','emit','hook','events','SmsAccount'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x2d93,0x19b));var _0x32d9=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x2d93[_0x164eca];return _0x2ce562;};'use strict';var EventEmitter=require(_0x32d9('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x32d9('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x32d9('0x2'),'afterUpdate':_0x32d9('0x3'),'afterDestroy':_0x32d9('0x4')};function emitEvent(_0x37e4f6){return function(_0x1f3200,_0x5c77a3,_0x3e9172){SmsAccountEvents['emit'](_0x37e4f6+':'+_0x1f3200['id'],_0x1f3200);SmsAccountEvents[_0x32d9('0x5')](_0x37e4f6,_0x1f3200);_0x3e9172(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x32d9('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 281cce5..207c3b2 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 _0x70b2=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util'];(function(_0x55a493,_0xfed0ba){var _0x41d1b9=function(_0x3ad47b){while(--_0x3ad47b){_0x55a493['push'](_0x55a493['shift']());}};_0x41d1b9(++_0xfed0ba);}(_0x70b2,0x1b9));var _0x270b=function(_0x5b69fa,_0x2e4f35){_0x5b69fa=_0x5b69fa-0x0;var _0x34144a=_0x70b2[_0x5b69fa];return _0x34144a;};'use strict';var _=require('lodash');var util=require(_0x270b('0x0'));var logger=require(_0x270b('0x1'))(_0x270b('0x2'));var moment=require('moment');var BPromise=require(_0x270b('0x3'));var rp=require(_0x270b('0x4'));var fs=require('fs');var path=require(_0x270b('0x5'));var rimraf=require(_0x270b('0x6'));var config=require(_0x270b('0x7'));var attributes=require(_0x270b('0x8'));module[_0x270b('0x9')]=function(_0xfa233,_0x5cd96c){return _0xfa233[_0x270b('0xa')](_0x270b('0xb'),attributes,{'tableName':_0x270b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aa3=['path','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','../../config/logger','api','bluebird'];(function(_0x578578,_0x389c24){var _0xef6339=function(_0x108e7b){while(--_0x108e7b){_0x578578['push'](_0x578578['shift']());}};_0xef6339(++_0x389c24);}(_0x7aa3,0xb7));var _0x37aa=function(_0x42674e,_0x4f9dd8){_0x42674e=_0x42674e-0x0;var _0xc49782=_0x7aa3[_0x42674e];return _0xc49782;};'use strict';var _=require(_0x37aa('0x0'));var util=require('util');var logger=require(_0x37aa('0x1'))(_0x37aa('0x2'));var moment=require('moment');var BPromise=require(_0x37aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37aa('0x4'));var rimraf=require('rimraf');var config=require(_0x37aa('0x5'));var attributes=require(_0x37aa('0x6'));module[_0x37aa('0x7')]=function(_0x24186b,_0x561003){return _0x24186b[_0x37aa('0x8')](_0x37aa('0x9'),attributes,{'tableName':_0x37aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index d7d6d12..370fa1a 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 _0xfa18=['model','ShowSmsAccount','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./smsAccount.socket','register','then','info','request\x20sent','debug','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','find','options','where','attributes','include','map'];(function(_0x109876,_0x4dabbd){var _0x2e6067=function(_0x396866){while(--_0x396866){_0x109876['push'](_0x109876['shift']());}};_0x2e6067(++_0x4dabbd);}(_0xfa18,0x8b));var _0x8fa1=function(_0x384352,_0x8f42a3){_0x384352=_0x384352-0x0;var _0x4604fb=_0xfa18[_0x384352];return _0x4604fb;};'use strict';var _=require('lodash');var util=require(_0x8fa1('0x0'));var moment=require('moment');var BPromise=require(_0x8fa1('0x1'));var rs=require(_0x8fa1('0x2'));var fs=require('fs');var Redis=require(_0x8fa1('0x3'));var db=require(_0x8fa1('0x4'))['db'];var utils=require(_0x8fa1('0x5'));var logger=require(_0x8fa1('0x6'))(_0x8fa1('0x7'));var config=require(_0x8fa1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8fa1('0x9')][_0x8fa1('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8fa1('0xb')],{'host':_0x8fa1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8fa1('0xd'))[_0x8fa1('0xe')](socket);function respondWithRpcPromise(_0x14c075,_0x315959,_0x48f71b){return new BPromise(function(_0x2d7935,_0x2b7a33){return client['request'](_0x14c075,_0x48f71b)[_0x8fa1('0xf')](function(_0xb0755){logger[_0x8fa1('0x10')]('SmsAccount,\x20%s,\x20%s',_0x315959,_0x8fa1('0x11'));logger[_0x8fa1('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x315959,_0x8fa1('0x11'),JSON['stringify'](_0xb0755));if(_0xb0755['error']){if(_0xb0755[_0x8fa1('0x13')][_0x8fa1('0x14')]===0x1f4){logger['error'](_0x8fa1('0x15'),_0x315959,_0xb0755[_0x8fa1('0x13')][_0x8fa1('0x16')]);return _0x2b7a33(_0xb0755['error'][_0x8fa1('0x16')]);}logger[_0x8fa1('0x13')](_0x8fa1('0x15'),_0x315959,_0xb0755['error']['message']);return _0x2d7935(_0xb0755[_0x8fa1('0x13')][_0x8fa1('0x16')]);}else{logger[_0x8fa1('0x10')]('SmsAccount,\x20%s,\x20%s',_0x315959,_0x8fa1('0x11'));_0x2d7935(_0xb0755[_0x8fa1('0x17')][_0x8fa1('0x16')]);}})[_0x8fa1('0x18')](function(_0x3f0207){logger[_0x8fa1('0x13')]('SmsAccount,\x20%s,\x20%s',_0x315959,_0x3f0207);_0x2b7a33(_0x3f0207);});});}exports['ShowSmsAccount']=function(_0xbbf368){var _0x4a6601=this;return new Promise(function(_0x530eb8,_0x431eeb){return db['SmsAccount'][_0x8fa1('0x19')]({'raw':_0xbbf368[_0x8fa1('0x1a')]?_0xbbf368[_0x8fa1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xbbf368[_0x8fa1('0x1a')]?_0xbbf368[_0x8fa1('0x1a')][_0x8fa1('0x1b')]||null:null,'attributes':_0xbbf368[_0x8fa1('0x1a')]?_0xbbf368[_0x8fa1('0x1a')][_0x8fa1('0x1c')]||null:null,'include':_0xbbf368[_0x8fa1('0x1a')]?_0xbbf368[_0x8fa1('0x1a')][_0x8fa1('0x1d')]?_[_0x8fa1('0x1e')](_0xbbf368[_0x8fa1('0x1a')]['include'],function(_0x1883ac){return{'model':db[_0x1883ac[_0x8fa1('0x1f')]],'as':_0x1883ac['as'],'attributes':_0x1883ac[_0x8fa1('0x1c')],'include':_0x1883ac[_0x8fa1('0x1d')]?_[_0x8fa1('0x1e')](_0x1883ac[_0x8fa1('0x1d')],function(_0x281391){return{'model':db[_0x281391['model']],'as':_0x281391['as'],'attributes':_0x281391[_0x8fa1('0x1c')],'include':_0x281391[_0x8fa1('0x1d')]?_[_0x8fa1('0x1e')](_0x281391[_0x8fa1('0x1d')],function(_0x21070f){return{'model':db[_0x21070f[_0x8fa1('0x1f')]],'as':_0x21070f['as'],'attributes':_0x21070f[_0x8fa1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8fa1('0xf')](function(_0xe7ec1b){logger[_0x8fa1('0x10')](_0x8fa1('0x20'),_0xbbf368);logger['debug']('ShowSmsAccount',_0xbbf368,JSON[_0x8fa1('0x21')](_0xe7ec1b));_0x530eb8(_0xe7ec1b);})[_0x8fa1('0x18')](function(_0x5dc96f){logger[_0x8fa1('0x13')](_0x8fa1('0x20'),_0x5dc96f[_0x8fa1('0x16')],_0xbbf368);_0x431eeb(_0x4a6601[_0x8fa1('0x13')](0x1f4,_0x5dc96f[_0x8fa1('0x16')]));});});}; \ No newline at end of file +var _0x0150=['attributes','include','map','model','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','ShowSmsAccount','find','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0150,0xdc));var _0x0015=function(_0x587511,_0x39b50b){_0x587511=_0x587511-0x0;var _0x41d734=_0x0150[_0x587511];return _0x41d734;};'use strict';var _=require(_0x0015('0x0'));var util=require(_0x0015('0x1'));var moment=require(_0x0015('0x2'));var BPromise=require(_0x0015('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0015('0x4'))['db'];var utils=require(_0x0015('0x5'));var logger=require(_0x0015('0x6'))(_0x0015('0x7'));var config=require('../../config/environment');var jayson=require(_0x0015('0x8'));var client=jayson['client'][_0x0015('0x9')]({'port':0x232a});config[_0x0015('0xa')]=_[_0x0015('0xb')](config[_0x0015('0xa')],{'host':_0x0015('0xc'),'port':0x18eb});var socket=require(_0x0015('0xd'))(new Redis(config[_0x0015('0xa')]));require(_0x0015('0xe'))['register'](socket);function respondWithRpcPromise(_0x4e97e8,_0x31fb45,_0x225a13){return new BPromise(function(_0x46fd4c,_0xce6288){return client[_0x0015('0xf')](_0x4e97e8,_0x225a13)[_0x0015('0x10')](function(_0x1cfadf){logger[_0x0015('0x11')](_0x0015('0x12'),_0x31fb45,'request\x20sent');logger[_0x0015('0x13')](_0x0015('0x14'),_0x31fb45,_0x0015('0x15'),JSON[_0x0015('0x16')](_0x1cfadf));if(_0x1cfadf['error']){if(_0x1cfadf['error'][_0x0015('0x17')]===0x1f4){logger[_0x0015('0x18')](_0x0015('0x12'),_0x31fb45,_0x1cfadf['error'][_0x0015('0x19')]);return _0xce6288(_0x1cfadf[_0x0015('0x18')][_0x0015('0x19')]);}logger[_0x0015('0x18')](_0x0015('0x12'),_0x31fb45,_0x1cfadf[_0x0015('0x18')][_0x0015('0x19')]);return _0x46fd4c(_0x1cfadf[_0x0015('0x18')][_0x0015('0x19')]);}else{logger[_0x0015('0x11')](_0x0015('0x12'),_0x31fb45,_0x0015('0x15'));_0x46fd4c(_0x1cfadf[_0x0015('0x1a')][_0x0015('0x19')]);}})[_0x0015('0x1b')](function(_0x1e4a2b){logger[_0x0015('0x18')](_0x0015('0x12'),_0x31fb45,_0x1e4a2b);_0xce6288(_0x1e4a2b);});});}exports[_0x0015('0x1c')]=function(_0x470cd3){var _0x541e4d=this;return new Promise(function(_0x4f4f54,_0x78d9fa){return db['SmsAccount'][_0x0015('0x1d')]({'raw':_0x470cd3[_0x0015('0x1e')]?_0x470cd3[_0x0015('0x1e')][_0x0015('0x1f')]===undefined?!![]:![]:!![],'where':_0x470cd3[_0x0015('0x1e')]?_0x470cd3['options']['where']||null:null,'attributes':_0x470cd3['options']?_0x470cd3[_0x0015('0x1e')][_0x0015('0x20')]||null:null,'include':_0x470cd3['options']?_0x470cd3[_0x0015('0x1e')][_0x0015('0x21')]?_[_0x0015('0x22')](_0x470cd3['options'][_0x0015('0x21')],function(_0x375db9){return{'model':db[_0x375db9[_0x0015('0x23')]],'as':_0x375db9['as'],'attributes':_0x375db9['attributes'],'include':_0x375db9[_0x0015('0x21')]?_[_0x0015('0x22')](_0x375db9['include'],function(_0x5e1b84){return{'model':db[_0x5e1b84[_0x0015('0x23')]],'as':_0x5e1b84['as'],'attributes':_0x5e1b84[_0x0015('0x20')],'include':_0x5e1b84[_0x0015('0x21')]?_[_0x0015('0x22')](_0x5e1b84[_0x0015('0x21')],function(_0x1b0ccf){return{'model':db[_0x1b0ccf[_0x0015('0x23')]],'as':_0x1b0ccf['as'],'attributes':_0x1b0ccf[_0x0015('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0015('0x10')](function(_0x33ce0c){logger[_0x0015('0x11')](_0x0015('0x1c'),_0x470cd3);logger[_0x0015('0x13')](_0x0015('0x1c'),_0x470cd3,JSON[_0x0015('0x16')](_0x33ce0c));_0x4f4f54(_0x33ce0c);})[_0x0015('0x1b')](function(_0x472f10){logger['error'](_0x0015('0x1c'),_0x472f10[_0x0015('0x19')],_0x470cd3);_0x78d9fa(_0x541e4d[_0x0015('0x18')](0x1f4,_0x472f10[_0x0015('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bb25eb5..bfa756d 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 390d015..0c0c45a 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x468342,_0x15e0ed){var _0x204a5c=function(_0x20917d){while(--_0x20917d){_0x468342['push'](_0x468342['shift']());}};_0x204a5c(++_0x15e0ed);}(_0x34e8,0x12c));var _0x834e=function(_0x432c92,_0x114b1e){_0x432c92=_0x432c92-0x0;var _0x2cdf70=_0x34e8[_0x432c92];return _0x2cdf70;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b30598f..6f804b4 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 _0xa19e=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x1b9f5a,_0x4543b0){var _0x4a5969=function(_0x571bb3){while(--_0x571bb3){_0x1b9f5a['push'](_0x1b9f5a['shift']());}};_0x4a5969(++_0x4543b0);}(_0xa19e,0x12e));var _0xea19=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xa19e[_0x126f47];return _0x49508a;};'use strict';var Sequelize=require(_0xea19('0x0'));module[_0xea19('0x1')]={'priority':{'type':Sequelize[_0xea19('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xea19('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xea19('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xea19('0x5')}}; \ No newline at end of file +var _0x648a=['sequelize','exports','STRING','*,*,*,*'];(function(_0x2bb269,_0x20ee77){var _0x515d7e=function(_0x2ed3a7){while(--_0x2ed3a7){_0x2bb269['push'](_0x2bb269['shift']());}};_0x515d7e(++_0x20ee77);}(_0x648a,0xc0));var _0xa648=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x648a[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0xa648('0x0'));module[_0xa648('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa648('0x2')]},'interval':{'type':Sequelize[_0xa648('0x2')],'defaultValue':_0xa648('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 229c75e..d63e5bf 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 _0xdb2c=['desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4fdd64,_0x4ec5d4){var _0x1e9ae1=function(_0x60bf04){while(--_0x60bf04){_0x4fdd64['push'](_0x4fdd64['shift']());}};_0x1e9ae1(++_0x4ec5d4);}(_0xdb2c,0x1a9));var _0xcdb2=function(_0x34e731,_0x2ecf48){_0x34e731=_0x34e731-0x0;var _0x115ff0=_0xdb2c[_0x34e731];return _0x115ff0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdb2('0x0'));var zipdir=require(_0xcdb2('0x1'));var jsonpatch=require(_0xcdb2('0x2'));var rp=require(_0xcdb2('0x3'));var moment=require('moment');var BPromise=require(_0xcdb2('0x4'));var Mustache=require(_0xcdb2('0x5'));var util=require(_0xcdb2('0x6'));var path=require(_0xcdb2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcdb2('0x8'));var fs=require('fs');var fs_extra=require(_0xcdb2('0x9'));var _=require(_0xcdb2('0xa'));var squel=require(_0xcdb2('0xb'));var crypto=require(_0xcdb2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcdb2('0xd'));var toCsv=require(_0xcdb2('0xe'));var querystring=require('querystring');var Papa=require(_0xcdb2('0xf'));var Redis=require('ioredis');var authService=require(_0xcdb2('0x10'));var qs=require(_0xcdb2('0x11'));var as=require(_0xcdb2('0x12'));var hardwareService=require(_0xcdb2('0x13'));var logger=require('../../config/logger')(_0xcdb2('0x14'));var utils=require(_0xcdb2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcdb2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ec031,_0xf192be){_0xf192be=_0xf192be||0xcc;return function(_0x91a5f5){if(_0x91a5f5){return _0x3ec031['sendStatus'](_0xf192be);}return _0x3ec031[_0xcdb2('0x17')](_0xf192be)[_0xcdb2('0x18')]();};}function respondWithResult(_0x1d6a34,_0x78ffb3){_0x78ffb3=_0x78ffb3||0xc8;return function(_0x3c5660){if(_0x3c5660){return _0x1d6a34[_0xcdb2('0x17')](_0x78ffb3)[_0xcdb2('0x19')](_0x3c5660);}};}function respondWithFilteredResult(_0x16b883,_0x9a479b){return function(_0x122903){if(_0x122903){var _0x773a0b=typeof _0x9a479b[_0xcdb2('0x1a')]===_0xcdb2('0x1b')&&typeof _0x9a479b[_0xcdb2('0x1c')]===_0xcdb2('0x1b');var _0x8c3db7=_0x122903[_0xcdb2('0x1d')];var _0x4173f3=_0x773a0b?0x0:_0x9a479b['offset'];var _0xc00fd2=_0x773a0b?_0x122903[_0xcdb2('0x1d')]:_0x9a479b[_0xcdb2('0x1a')]+_0x9a479b[_0xcdb2('0x1c')];var _0x2825f8;if(_0xc00fd2>=_0x8c3db7){_0xc00fd2=_0x8c3db7;_0x2825f8=0xc8;}else{_0x2825f8=0xce;}_0x16b883[_0xcdb2('0x17')](_0x2825f8);return _0x16b883[_0xcdb2('0x1e')](_0xcdb2('0x1f'),_0x4173f3+'-'+_0xc00fd2+'/'+_0x8c3db7)['json'](_0x122903);}return null;};}function patchUpdates(_0x57176d){return function(_0x557ef3){try{jsonpatch['apply'](_0x557ef3,_0x57176d,!![]);}catch(_0x23ab3c){return BPromise[_0xcdb2('0x20')](_0x23ab3c);}return _0x557ef3[_0xcdb2('0x21')]();};}function saveUpdates(_0x2af901,_0x53f78a){return function(_0x58521c){if(_0x58521c){return _0x58521c[_0xcdb2('0x22')](_0x2af901)['then'](function(_0x112d26){return _0x112d26;});}return null;};}function removeEntity(_0x47f279,_0x4f2244){return function(_0x5455f0){if(_0x5455f0){return _0x5455f0[_0xcdb2('0x23')]()[_0xcdb2('0x24')](function(){_0x47f279[_0xcdb2('0x17')](0xcc)[_0xcdb2('0x18')]();});}};}function handleEntityNotFound(_0x3d9001,_0x55f1d4){return function(_0x33c759){if(!_0x33c759){_0x3d9001[_0xcdb2('0x25')](0x194);}return _0x33c759;};}function handleError(_0x4c69e9,_0x48506a){_0x48506a=_0x48506a||0x1f4;return function(_0x30f31b){logger[_0xcdb2('0x26')](_0x30f31b[_0xcdb2('0x27')]);if(_0x30f31b[_0xcdb2('0x28')]){delete _0x30f31b[_0xcdb2('0x28')];}_0x4c69e9['status'](_0x48506a)['send'](_0x30f31b);};}exports['index']=function(_0x4f68fa,_0x228cfe){var _0x537d5f={},_0x18deb4={},_0x558bef={'count':0x0,'rows':[]};var _0x2c0b2e=_[_0xcdb2('0x29')](db[_0xcdb2('0x2a')][_0xcdb2('0x2b')],function(_0x55b49c){return{'name':_0x55b49c[_0xcdb2('0x2c')],'type':_0x55b49c[_0xcdb2('0x2d')][_0xcdb2('0x2e')]};});_0x18deb4['model']=_[_0xcdb2('0x29')](_0x2c0b2e,'name');_0x18deb4[_0xcdb2('0x2f')]=_[_0xcdb2('0x30')](_0x4f68fa[_0xcdb2('0x2f')]);_0x18deb4[_0xcdb2('0x31')]=_[_0xcdb2('0x32')](_0x18deb4[_0xcdb2('0x33')],_0x18deb4[_0xcdb2('0x2f')]);_0x537d5f[_0xcdb2('0x34')]=_[_0xcdb2('0x32')](_0x18deb4[_0xcdb2('0x33')],qs[_0xcdb2('0x35')](_0x4f68fa[_0xcdb2('0x2f')]['fields']));_0x537d5f[_0xcdb2('0x34')]=_0x537d5f[_0xcdb2('0x34')][_0xcdb2('0x36')]?_0x537d5f[_0xcdb2('0x34')]:_0x18deb4[_0xcdb2('0x33')];if(!_0x4f68fa['query'][_0xcdb2('0x37')](_0xcdb2('0x38'))){_0x537d5f[_0xcdb2('0x1c')]=qs['limit'](_0x4f68fa['query'][_0xcdb2('0x1c')]);_0x537d5f['offset']=qs['offset'](_0x4f68fa[_0xcdb2('0x2f')][_0xcdb2('0x1a')]);}_0x537d5f['order']=qs[_0xcdb2('0x39')](_0x4f68fa[_0xcdb2('0x2f')]['sort']);_0x537d5f[_0xcdb2('0x3a')]=qs[_0xcdb2('0x31')](_[_0xcdb2('0x3b')](_0x4f68fa[_0xcdb2('0x2f')],_0x18deb4[_0xcdb2('0x31')]),_0x2c0b2e);if(_0x4f68fa['query']['filter']){_0x537d5f[_0xcdb2('0x3a')]=_['merge'](_0x537d5f[_0xcdb2('0x3a')],{'$or':_[_0xcdb2('0x29')](_0x2c0b2e,function(_0x1c37f4){if(_0x1c37f4['type']!==_0xcdb2('0x3c')){var _0x5a1174={};_0x5a1174[_0x1c37f4[_0xcdb2('0x28')]]={'$like':'%'+_0x4f68fa['query'][_0xcdb2('0x3d')]+'%'};return _0x5a1174;}})});}_0x537d5f=_[_0xcdb2('0x3e')]({},_0x537d5f,_0x4f68fa[_0xcdb2('0x3f')]);var _0x5667e4={'where':_0x537d5f[_0xcdb2('0x3a')]};return db['SmsApplication'][_0xcdb2('0x1d')](_0x5667e4)[_0xcdb2('0x24')](function(_0x3fa2e1){_0x558bef[_0xcdb2('0x1d')]=_0x3fa2e1;if(_0x4f68fa['query'][_0xcdb2('0x40')]){_0x537d5f[_0xcdb2('0x41')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x537d5f);})[_0xcdb2('0x24')](function(_0x1aa871){_0x558bef[_0xcdb2('0x42')]=_0x1aa871;return _0x558bef;})[_0xcdb2('0x24')](respondWithFilteredResult(_0x228cfe,_0x537d5f))[_0xcdb2('0x43')](handleError(_0x228cfe,null));};exports[_0xcdb2('0x44')]=function(_0x5cef9d,_0x19f18d){var _0x13eda9={'raw':!![],'where':{'id':_0x5cef9d[_0xcdb2('0x45')]['id']}},_0x34ce15={};_0x34ce15['model']=_[_0xcdb2('0x30')](db[_0xcdb2('0x2a')][_0xcdb2('0x2b')]);_0x34ce15[_0xcdb2('0x2f')]=_[_0xcdb2('0x30')](_0x5cef9d['query']);_0x34ce15[_0xcdb2('0x31')]=_[_0xcdb2('0x32')](_0x34ce15['model'],_0x34ce15[_0xcdb2('0x2f')]);_0x13eda9['attributes']=_['intersection'](_0x34ce15[_0xcdb2('0x33')],qs[_0xcdb2('0x35')](_0x5cef9d[_0xcdb2('0x2f')]['fields']));_0x13eda9[_0xcdb2('0x34')]=_0x13eda9[_0xcdb2('0x34')][_0xcdb2('0x36')]?_0x13eda9[_0xcdb2('0x34')]:_0x34ce15['model'];if(_0x5cef9d[_0xcdb2('0x2f')][_0xcdb2('0x40')]){_0x13eda9[_0xcdb2('0x41')]=[{'all':!![]}];}_0x13eda9=_[_0xcdb2('0x3e')]({},_0x13eda9,_0x5cef9d['options']);return db['SmsApplication'][_0xcdb2('0x46')](_0x13eda9)[_0xcdb2('0x24')](handleEntityNotFound(_0x19f18d,null))[_0xcdb2('0x24')](respondWithResult(_0x19f18d,null))[_0xcdb2('0x43')](handleError(_0x19f18d,null));};exports['create']=function(_0x54e674,_0x19b605){return db[_0xcdb2('0x2a')][_0xcdb2('0x47')](_0x54e674[_0xcdb2('0x48')],{})[_0xcdb2('0x24')](respondWithResult(_0x19b605,0xc9))[_0xcdb2('0x43')](handleError(_0x19b605,null));};exports[_0xcdb2('0x22')]=function(_0x1e11ac,_0x4d348b){if(_0x1e11ac[_0xcdb2('0x48')]['id']){delete _0x1e11ac[_0xcdb2('0x48')]['id'];}return db[_0xcdb2('0x2a')][_0xcdb2('0x46')]({'where':{'id':_0x1e11ac['params']['id']}})['then'](handleEntityNotFound(_0x4d348b,null))[_0xcdb2('0x24')](saveUpdates(_0x1e11ac[_0xcdb2('0x48')],null))['then'](respondWithResult(_0x4d348b,null))[_0xcdb2('0x43')](handleError(_0x4d348b,null));};exports[_0xcdb2('0x23')]=function(_0x5bb1cb,_0x2d72f8){return db['SmsApplication'][_0xcdb2('0x46')]({'where':{'id':_0x5bb1cb[_0xcdb2('0x45')]['id']}})[_0xcdb2('0x24')](handleEntityNotFound(_0x2d72f8,null))[_0xcdb2('0x24')](removeEntity(_0x2d72f8,null))[_0xcdb2('0x43')](handleError(_0x2d72f8,null));}; \ No newline at end of file +var _0xecc1=['apply','reject','save','then','error','name','send','map','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SmsApplication','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range'];(function(_0xa6642e,_0x44d760){var _0x51f701=function(_0x264875){while(--_0x264875){_0xa6642e['push'](_0xa6642e['shift']());}};_0x51f701(++_0x44d760);}(_0xecc1,0x1a1));var _0x1ecc=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0xecc1[_0x12a554];return _0x244ba0;};'use strict';var emlformat=require(_0x1ecc('0x0'));var rimraf=require(_0x1ecc('0x1'));var zipdir=require(_0x1ecc('0x2'));var jsonpatch=require(_0x1ecc('0x3'));var rp=require(_0x1ecc('0x4'));var moment=require(_0x1ecc('0x5'));var BPromise=require(_0x1ecc('0x6'));var Mustache=require('mustache');var util=require(_0x1ecc('0x7'));var path=require(_0x1ecc('0x8'));var sox=require('sox');var csv=require(_0x1ecc('0x9'));var ejs=require(_0x1ecc('0xa'));var fs=require('fs');var fs_extra=require(_0x1ecc('0xb'));var _=require('lodash');var squel=require(_0x1ecc('0xc'));var crypto=require(_0x1ecc('0xd'));var jsforce=require(_0x1ecc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1ecc('0x9'));var querystring=require('querystring');var Papa=require(_0x1ecc('0xf'));var Redis=require(_0x1ecc('0x10'));var authService=require(_0x1ecc('0x11'));var qs=require(_0x1ecc('0x12'));var as=require(_0x1ecc('0x13'));var hardwareService=require(_0x1ecc('0x14'));var logger=require('../../config/logger')(_0x1ecc('0x15'));var utils=require(_0x1ecc('0x16'));var config=require(_0x1ecc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ecc('0x18'))['db'];function respondWithStatusCode(_0xab3857,_0x14d05d){_0x14d05d=_0x14d05d||0xcc;return function(_0x16640f){if(_0x16640f){return _0xab3857['sendStatus'](_0x14d05d);}return _0xab3857['status'](_0x14d05d)[_0x1ecc('0x19')]();};}function respondWithResult(_0x543acc,_0x465bf2){_0x465bf2=_0x465bf2||0xc8;return function(_0x971da7){if(_0x971da7){return _0x543acc[_0x1ecc('0x1a')](_0x465bf2)[_0x1ecc('0x1b')](_0x971da7);}};}function respondWithFilteredResult(_0x479880,_0xa1ade4){return function(_0x3fd26c){if(_0x3fd26c){var _0x1da32d=typeof _0xa1ade4[_0x1ecc('0x1c')]===_0x1ecc('0x1d')&&typeof _0xa1ade4[_0x1ecc('0x1e')]===_0x1ecc('0x1d');var _0x2256d4=_0x3fd26c[_0x1ecc('0x1f')];var _0x4c6a4d=_0x1da32d?0x0:_0xa1ade4[_0x1ecc('0x1c')];var _0x2aa6cf=_0x1da32d?_0x3fd26c[_0x1ecc('0x1f')]:_0xa1ade4[_0x1ecc('0x1c')]+_0xa1ade4['limit'];var _0x4603bc;if(_0x2aa6cf>=_0x2256d4){_0x2aa6cf=_0x2256d4;_0x4603bc=0xc8;}else{_0x4603bc=0xce;}_0x479880[_0x1ecc('0x1a')](_0x4603bc);return _0x479880['set'](_0x1ecc('0x20'),_0x4c6a4d+'-'+_0x2aa6cf+'/'+_0x2256d4)['json'](_0x3fd26c);}return null;};}function patchUpdates(_0x38565b){return function(_0x4343be){try{jsonpatch[_0x1ecc('0x21')](_0x4343be,_0x38565b,!![]);}catch(_0x4889a9){return BPromise[_0x1ecc('0x22')](_0x4889a9);}return _0x4343be[_0x1ecc('0x23')]();};}function saveUpdates(_0x33637e,_0xa9bd24){return function(_0x3aa142){if(_0x3aa142){return _0x3aa142['update'](_0x33637e)[_0x1ecc('0x24')](function(_0xb8a4f6){return _0xb8a4f6;});}return null;};}function removeEntity(_0x1e5506,_0x4c88f2){return function(_0x3bc2b3){if(_0x3bc2b3){return _0x3bc2b3['destroy']()['then'](function(){_0x1e5506[_0x1ecc('0x1a')](0xcc)[_0x1ecc('0x19')]();});}};}function handleEntityNotFound(_0x37a834,_0x353674){return function(_0x428bdd){if(!_0x428bdd){_0x37a834['sendStatus'](0x194);}return _0x428bdd;};}function handleError(_0x3c62c3,_0x104ec6){_0x104ec6=_0x104ec6||0x1f4;return function(_0x1c1993){logger[_0x1ecc('0x25')](_0x1c1993['stack']);if(_0x1c1993[_0x1ecc('0x26')]){delete _0x1c1993[_0x1ecc('0x26')];}_0x3c62c3[_0x1ecc('0x1a')](_0x104ec6)[_0x1ecc('0x27')](_0x1c1993);};}exports['index']=function(_0x4e5438,_0xf9eca9){var _0x5a8665={},_0xaaa486={},_0x413bf9={'count':0x0,'rows':[]};var _0x5a452d=_[_0x1ecc('0x28')](db['SmsApplication'][_0x1ecc('0x29')],function(_0x4c07d0){return{'name':_0x4c07d0['fieldName'],'type':_0x4c07d0[_0x1ecc('0x2a')][_0x1ecc('0x2b')]};});_0xaaa486['model']=_[_0x1ecc('0x28')](_0x5a452d,'name');_0xaaa486[_0x1ecc('0x2c')]=_[_0x1ecc('0x2d')](_0x4e5438[_0x1ecc('0x2c')]);_0xaaa486[_0x1ecc('0x2e')]=_['intersection'](_0xaaa486['model'],_0xaaa486['query']);_0x5a8665[_0x1ecc('0x2f')]=_[_0x1ecc('0x30')](_0xaaa486[_0x1ecc('0x31')],qs[_0x1ecc('0x32')](_0x4e5438['query']['fields']));_0x5a8665[_0x1ecc('0x2f')]=_0x5a8665['attributes'][_0x1ecc('0x33')]?_0x5a8665[_0x1ecc('0x2f')]:_0xaaa486['model'];if(!_0x4e5438[_0x1ecc('0x2c')][_0x1ecc('0x34')](_0x1ecc('0x35'))){_0x5a8665['limit']=qs[_0x1ecc('0x1e')](_0x4e5438[_0x1ecc('0x2c')][_0x1ecc('0x1e')]);_0x5a8665[_0x1ecc('0x1c')]=qs[_0x1ecc('0x1c')](_0x4e5438[_0x1ecc('0x2c')][_0x1ecc('0x1c')]);}_0x5a8665[_0x1ecc('0x36')]=qs[_0x1ecc('0x37')](_0x4e5438[_0x1ecc('0x2c')]['sort']);_0x5a8665['where']=qs['filters'](_[_0x1ecc('0x38')](_0x4e5438[_0x1ecc('0x2c')],_0xaaa486[_0x1ecc('0x2e')]),_0x5a452d);if(_0x4e5438['query'][_0x1ecc('0x39')]){_0x5a8665[_0x1ecc('0x3a')]=_[_0x1ecc('0x3b')](_0x5a8665[_0x1ecc('0x3a')],{'$or':_[_0x1ecc('0x28')](_0x5a452d,function(_0x42071d){if(_0x42071d[_0x1ecc('0x2a')]!==_0x1ecc('0x3c')){var _0x1390f2={};_0x1390f2[_0x42071d['name']]={'$like':'%'+_0x4e5438[_0x1ecc('0x2c')][_0x1ecc('0x39')]+'%'};return _0x1390f2;}})});}_0x5a8665=_[_0x1ecc('0x3b')]({},_0x5a8665,_0x4e5438[_0x1ecc('0x3d')]);var _0x505adb={'where':_0x5a8665[_0x1ecc('0x3a')]};return db[_0x1ecc('0x3e')][_0x1ecc('0x1f')](_0x505adb)[_0x1ecc('0x24')](function(_0x3302bc){_0x413bf9['count']=_0x3302bc;if(_0x4e5438[_0x1ecc('0x2c')][_0x1ecc('0x3f')]){_0x5a8665['include']=[{'all':!![]}];}return db[_0x1ecc('0x3e')][_0x1ecc('0x40')](_0x5a8665);})[_0x1ecc('0x24')](function(_0x119500){_0x413bf9[_0x1ecc('0x41')]=_0x119500;return _0x413bf9;})[_0x1ecc('0x24')](respondWithFilteredResult(_0xf9eca9,_0x5a8665))[_0x1ecc('0x42')](handleError(_0xf9eca9,null));};exports[_0x1ecc('0x43')]=function(_0x2a75e9,_0x27c869){var _0x37cf88={'raw':!![],'where':{'id':_0x2a75e9[_0x1ecc('0x44')]['id']}},_0x181fe6={};_0x181fe6['model']=_[_0x1ecc('0x2d')](db[_0x1ecc('0x3e')]['rawAttributes']);_0x181fe6[_0x1ecc('0x2c')]=_[_0x1ecc('0x2d')](_0x2a75e9['query']);_0x181fe6[_0x1ecc('0x2e')]=_[_0x1ecc('0x30')](_0x181fe6[_0x1ecc('0x31')],_0x181fe6[_0x1ecc('0x2c')]);_0x37cf88[_0x1ecc('0x2f')]=_[_0x1ecc('0x30')](_0x181fe6['model'],qs['fields'](_0x2a75e9['query']['fields']));_0x37cf88[_0x1ecc('0x2f')]=_0x37cf88[_0x1ecc('0x2f')][_0x1ecc('0x33')]?_0x37cf88[_0x1ecc('0x2f')]:_0x181fe6[_0x1ecc('0x31')];if(_0x2a75e9['query'][_0x1ecc('0x3f')]){_0x37cf88[_0x1ecc('0x45')]=[{'all':!![]}];}_0x37cf88=_[_0x1ecc('0x3b')]({},_0x37cf88,_0x2a75e9[_0x1ecc('0x3d')]);return db[_0x1ecc('0x3e')][_0x1ecc('0x46')](_0x37cf88)['then'](handleEntityNotFound(_0x27c869,null))['then'](respondWithResult(_0x27c869,null))[_0x1ecc('0x42')](handleError(_0x27c869,null));};exports[_0x1ecc('0x47')]=function(_0x29b09f,_0x5ef236){return db[_0x1ecc('0x3e')][_0x1ecc('0x47')](_0x29b09f[_0x1ecc('0x48')],{})['then'](respondWithResult(_0x5ef236,0xc9))[_0x1ecc('0x42')](handleError(_0x5ef236,null));};exports[_0x1ecc('0x49')]=function(_0x28b3e7,_0x3973d1){if(_0x28b3e7['body']['id']){delete _0x28b3e7['body']['id'];}return db[_0x1ecc('0x3e')][_0x1ecc('0x46')]({'where':{'id':_0x28b3e7[_0x1ecc('0x44')]['id']}})[_0x1ecc('0x24')](handleEntityNotFound(_0x3973d1,null))[_0x1ecc('0x24')](saveUpdates(_0x28b3e7[_0x1ecc('0x48')],null))['then'](respondWithResult(_0x3973d1,null))[_0x1ecc('0x42')](handleError(_0x3973d1,null));};exports[_0x1ecc('0x4a')]=function(_0x34d5e8,_0xdba36c){return db[_0x1ecc('0x3e')][_0x1ecc('0x46')]({'where':{'id':_0x34d5e8['params']['id']}})[_0x1ecc('0x24')](handleEntityNotFound(_0xdba36c,null))[_0x1ecc('0x24')](removeEntity(_0xdba36c,null))[_0x1ecc('0x42')](handleError(_0xdba36c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 9a8968d..67d458c 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 _0x2cff=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SmsApplication','sms_applications'];(function(_0x450262,_0x51ce04){var _0x14339c=function(_0x5b3367){while(--_0x5b3367){_0x450262['push'](_0x450262['shift']());}};_0x14339c(++_0x51ce04);}(_0x2cff,0xa7));var _0xf2cf=function(_0x74923d,_0x4eff77){_0x74923d=_0x74923d-0x0;var _0x2c9e16=_0x2cff[_0x74923d];return _0x2c9e16;};'use strict';var _=require(_0xf2cf('0x0'));var util=require(_0xf2cf('0x1'));var logger=require(_0xf2cf('0x2'))(_0xf2cf('0x3'));var moment=require(_0xf2cf('0x4'));var BPromise=require(_0xf2cf('0x5'));var rp=require(_0xf2cf('0x6'));var fs=require('fs');var path=require(_0xf2cf('0x7'));var rimraf=require(_0xf2cf('0x8'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xf2cf('0x9')]=function(_0x13a0c2,_0x2f09f1){return _0x13a0c2[_0xf2cf('0xa')](_0xf2cf('0xb'),attributes,{'tableName':_0xf2cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2cf('0xd'),'collate':_0xf2cf('0xe')});}; \ No newline at end of file +var _0x1f36=['sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication'];(function(_0xdc2b18,_0x385615){var _0x2b5b88=function(_0x4c77d5){while(--_0x4c77d5){_0xdc2b18['push'](_0xdc2b18['shift']());}};_0x2b5b88(++_0x385615);}(_0x1f36,0x1ed));var _0x61f3=function(_0x48accc,_0x3142e9){_0x48accc=_0x48accc-0x0;var _0x460cc4=_0x1f36[_0x48accc];return _0x460cc4;};'use strict';var _=require(_0x61f3('0x0'));var util=require(_0x61f3('0x1'));var logger=require(_0x61f3('0x2'))(_0x61f3('0x3'));var moment=require('moment');var BPromise=require(_0x61f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f3('0x5'));var rimraf=require(_0x61f3('0x6'));var config=require(_0x61f3('0x7'));var attributes=require(_0x61f3('0x8'));module[_0x61f3('0x9')]=function(_0x12c372,_0x72af3d){return _0x12c372['define'](_0x61f3('0xa'),attributes,{'tableName':_0x61f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61f3('0xc'),'collate':_0x61f3('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 4f0d1c8..1b7655d 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 _0x4e7b=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','SmsApplication,\x20%s,\x20%s'];(function(_0x3e2d65,_0x405694){var _0x47d254=function(_0x104c21){while(--_0x104c21){_0x3e2d65['push'](_0x3e2d65['shift']());}};_0x47d254(++_0x405694);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x251036,_0xd8d59a){_0x251036=_0x251036-0x0;var _0x4a7ce0=_0x4e7b[_0x251036];return _0x4a7ce0;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var moment=require('moment');var BPromise=require(_0xb4e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4e7('0x3'));var db=require(_0xb4e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4e7('0x5'))(_0xb4e7('0x6'));var config=require('../../config/environment');var jayson=require(_0xb4e7('0x7'));var client=jayson[_0xb4e7('0x8')][_0xb4e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dcf05,_0x315c27,_0x490b1b){return new BPromise(function(_0x366595,_0x3e621e){return client['request'](_0x1dcf05,_0x490b1b)[_0xb4e7('0xa')](function(_0x472973){logger[_0xb4e7('0xb')]('SmsApplication,\x20%s,\x20%s',_0x315c27,_0xb4e7('0xc'));logger[_0xb4e7('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x315c27,'request\x20sent',JSON['stringify'](_0x472973));if(_0x472973['error']){if(_0x472973[_0xb4e7('0xe')][_0xb4e7('0xf')]===0x1f4){logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x3e621e(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x366595(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}else{logger['info'](_0xb4e7('0x10'),_0x315c27,_0xb4e7('0xc'));_0x366595(_0x472973[_0xb4e7('0x12')][_0xb4e7('0x11')]);}})[_0xb4e7('0x13')](function(_0x3078a0){logger['error']('SmsApplication,\x20%s,\x20%s',_0x315c27,_0x3078a0);_0x3e621e(_0x3078a0);});});} \ No newline at end of file +var _0x0a48=['request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x4bea53,_0x18b9db){var _0x16452c=function(_0x496096){while(--_0x496096){_0x4bea53['push'](_0x4bea53['shift']());}};_0x16452c(++_0x18b9db);}(_0x0a48,0x95));var _0x80a4=function(_0x41f5a6,_0xb35c51){_0x41f5a6=_0x41f5a6-0x0;var _0x241efd=_0x0a48[_0x41f5a6];return _0x241efd;};'use strict';var _=require(_0x80a4('0x0'));var util=require(_0x80a4('0x1'));var moment=require('moment');var BPromise=require(_0x80a4('0x2'));var rs=require(_0x80a4('0x3'));var fs=require('fs');var Redis=require(_0x80a4('0x4'));var db=require(_0x80a4('0x5'))['db'];var utils=require(_0x80a4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x80a4('0x7'));var jayson=require(_0x80a4('0x8'));var client=jayson[_0x80a4('0x9')][_0x80a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3ac0,_0x3ccc33,_0x55bd77){return new BPromise(function(_0x5c7c37,_0x338d47){return client[_0x80a4('0xb')](_0x5f3ac0,_0x55bd77)['then'](function(_0x5dfe4a){logger[_0x80a4('0xc')](_0x80a4('0xd'),_0x3ccc33,_0x80a4('0xe'));logger[_0x80a4('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3ccc33,_0x80a4('0xe'),JSON['stringify'](_0x5dfe4a));if(_0x5dfe4a[_0x80a4('0x10')]){if(_0x5dfe4a['error'][_0x80a4('0x11')]===0x1f4){logger[_0x80a4('0x10')]('SmsApplication,\x20%s,\x20%s',_0x3ccc33,_0x5dfe4a[_0x80a4('0x10')][_0x80a4('0x12')]);return _0x338d47(_0x5dfe4a[_0x80a4('0x10')][_0x80a4('0x12')]);}logger[_0x80a4('0x10')](_0x80a4('0xd'),_0x3ccc33,_0x5dfe4a[_0x80a4('0x10')]['message']);return _0x5c7c37(_0x5dfe4a['error'][_0x80a4('0x12')]);}else{logger[_0x80a4('0xc')](_0x80a4('0xd'),_0x3ccc33,_0x80a4('0xe'));_0x5c7c37(_0x5dfe4a['result'][_0x80a4('0x12')]);}})[_0x80a4('0x13')](function(_0x38ba44){logger[_0x80a4('0x10')](_0x80a4('0xd'),_0x3ccc33,_0x38ba44);_0x338d47(_0x38ba44);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index eba399e..4074370 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 _0x9ffd=['sms','smsinteraction:addtags','put','smsinteraction:update','delete','tracked','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x1f2734,_0x529bad){var _0x17b385=function(_0x5eabc1){while(--_0x5eabc1){_0x1f2734['push'](_0x1f2734['shift']());}};_0x17b385(++_0x529bad);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x272c60,_0x51587d){_0x272c60=_0x272c60-0x0;var _0x49dd88=_0x9ffd[_0x272c60];return _0x49dd88;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x12')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router['post']('/:id/messages',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x14')]);router[_0xd9ff('0x12')](_0xd9ff('0x15'),auth[_0xd9ff('0x9')](),interaction['tracked'](_0xd9ff('0x16'),_0xd9ff('0x17')),controller['addTags']);router[_0xd9ff('0x18')]('/:id',auth['isAuthenticated'](),interaction['tracked']('sms',_0xd9ff('0x19')),controller['update']);router[_0xd9ff('0x1a')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),interaction[_0xd9ff('0x1b')](_0xd9ff('0x16'),_0xd9ff('0x1c')),controller[_0xd9ff('0x1d')]);router[_0xd9ff('0x1a')](_0xd9ff('0x15'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x1e')]);module[_0xd9ff('0x1f')]=router; \ No newline at end of file +var _0x7916=['smsinteraction:update','update','sms','destroy','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','smsinteraction:addtags','put','/:id'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x7916,0x128));var _0x6791=function(_0x1c529b,_0x17dc54){_0x1c529b=_0x1c529b-0x0;var _0x5e64ca=_0x7916[_0x1c529b];return _0x5e64ca;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['get']('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['get'](_0x6791('0xf'),auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);router[_0x6791('0x11')]('/',auth[_0x6791('0x8')](),controller[_0x6791('0x12')]);router[_0x6791('0x11')](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0x13')]);router[_0x6791('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x6791('0x14')]('sms',_0x6791('0x15')),controller['addTags']);router[_0x6791('0x16')](_0x6791('0x17'),auth['isAuthenticated'](),interaction[_0x6791('0x14')]('sms',_0x6791('0x18')),controller[_0x6791('0x19')]);router['delete'](_0x6791('0x17'),auth[_0x6791('0x8')](),interaction['tracked'](_0x6791('0x1a'),'smsinteraction:destroy'),controller[_0x6791('0x1b')]);router[_0x6791('0x1c')](_0x6791('0x1d'),auth[_0x6791('0x8')](),controller[_0x6791('0x1e')]);module[_0x6791('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 3058117..9a84093 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 _0x4b19=['DATE','STRING','ENUM','sequelize','exports','BOOLEAN'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4b19,0x195));var _0x94b1=function(_0x3d2bab,_0x114f32){_0x3d2bab=_0x3d2bab-0x0;var _0x5d0a66=_0x4b19[_0x3d2bab];return _0x5d0a66;};'use strict';var Sequelize=require(_0x94b1('0x0'));var moment=require('moment');module[_0x94b1('0x1')]={'closed':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x94b1('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x94b1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x94b1('0x4')]},'note':{'type':Sequelize[_0x94b1('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x94b1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x94b1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x94b1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x94b1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x49fe=['STRING','DATE','out','ENUM','sequelize','moment','exports'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x49fe,0x100));var _0xe49f=function(_0x5db798,_0xc512db){_0x5db798=_0x5db798-0x0;var _0x48704b=_0x49fe[_0x5db798];return _0x48704b;};'use strict';var Sequelize=require(_0xe49f('0x0'));var moment=require(_0xe49f('0x1'));module[_0xe49f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe49f('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe49f('0x3')]},'note':{'type':Sequelize[_0xe49f('0x3')]},'phone':{'type':Sequelize[_0xe49f('0x3')]},'read1stAt':{'type':Sequelize[_0xe49f('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe49f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe49f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe49f('0x6')]('in',_0xe49f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 3b40583..c705807 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 _0xe047=['split','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','format','transcript-%d-%s.zip','push','User','Contact','createdAt','direction','secret','read','Account','Owner','get','Sms','fullname','N.A.','toString','closed','disposition','Messages','out','System','firstName','lastName','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','error','stack','name','send','index','SmsInteraction','rawAttributes','type','key','getOptions','sms','query','user','then','catch','show','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','update','describe','addMessage','SmsMessage','ids','omit','findOne','nolimit','order','sort','where','pick','filter','map','$gte'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0xe047,0x119));var _0x7e04=function(_0x2cd793,_0x2f6819){_0x2cd793=_0x2cd793-0x0;var _0x5554ab=_0xe047[_0x2cd793];return _0x5554ab;};'use strict';var rimraf=require(_0x7e04('0x0'));var zipdir=require(_0x7e04('0x1'));var moment=require('moment');var BPromise=require(_0x7e04('0x2'));var util=require(_0x7e04('0x3'));var path=require(_0x7e04('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e04('0x5'));var Redis=require(_0x7e04('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x7e04('0x7'));var pdf=require(_0x7e04('0x8'));var logger=require(_0x7e04('0x9'))(_0x7e04('0xa'));var config=require(_0x7e04('0xb'));var db=require(_0x7e04('0xc'))['db'];config[_0x7e04('0xd')]=_[_0x7e04('0xe')](config[_0x7e04('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e04('0xf'))(new Redis(config[_0x7e04('0xd')]));require(_0x7e04('0x10'))[_0x7e04('0x11')](socket);function respondWithStatusCode(_0xd7edf8,_0xc8bfda){_0xc8bfda=_0xc8bfda||0xcc;return function(_0xe13f91){if(_0xe13f91){return _0xd7edf8[_0x7e04('0x12')](_0xc8bfda);}return _0xd7edf8['status'](_0xc8bfda)['end']();};}function respondWithResult(_0x19d9f1,_0xf60f66){_0xf60f66=_0xf60f66||0xc8;return function(_0x21f5bd){if(_0x21f5bd){return _0x19d9f1[_0x7e04('0x13')](_0xf60f66)[_0x7e04('0x14')](_0x21f5bd);}};}function respondWithFilteredResult(_0x1d870f,_0x45afea){return function(_0x14f80b){if(_0x14f80b){var _0x6ff8d7=typeof _0x45afea[_0x7e04('0x15')]===_0x7e04('0x16')&&typeof _0x45afea['limit']==='undefined';var _0x119cd3=_0x14f80b[_0x7e04('0x17')];var _0x409270=_0x6ff8d7?0x0:_0x45afea[_0x7e04('0x15')];var _0x59fd20=_0x6ff8d7?_0x14f80b['count']:_0x45afea['offset']+_0x45afea[_0x7e04('0x18')];var _0x58dd14;if(_0x59fd20>=_0x119cd3){_0x59fd20=_0x119cd3;_0x58dd14=0xc8;}else{_0x58dd14=0xce;}_0x1d870f['status'](_0x58dd14);return _0x1d870f[_0x7e04('0x19')](_0x7e04('0x1a'),_0x409270+'-'+_0x59fd20+'/'+_0x119cd3)[_0x7e04('0x14')](_0x14f80b);}return null;};}function saveUpdates(_0x9a8c82){return function(_0x3bc3cc){if(_0x3bc3cc){return _0x3bc3cc['update'](_0x9a8c82)['then'](function(_0x272297){return _0x272297;});}return null;};}function removeEntity(_0x347af8){return function(_0x1fc842){if(_0x1fc842){return _0x1fc842[_0x7e04('0x1b')]()['then'](function(){_0x347af8[_0x7e04('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5118df){return function(_0x285065){if(!_0x285065){_0x5118df[_0x7e04('0x12')](0x194);}return _0x285065;};}function handleError(_0x1ac628,_0x23e36d){_0x23e36d=_0x23e36d||0x1f4;return function(_0x6b676b){logger[_0x7e04('0x1c')](_0x6b676b[_0x7e04('0x1d')]);if(_0x6b676b[_0x7e04('0x1e')]){delete _0x6b676b[_0x7e04('0x1e')];}_0x1ac628[_0x7e04('0x13')](_0x23e36d)[_0x7e04('0x1f')](_0x6b676b);};}exports[_0x7e04('0x20')]=function(_0x57a3d8,_0x3a9d2f){var _0x32ddf3={};var _0x1a24bb=_['map'](db[_0x7e04('0x21')][_0x7e04('0x22')],function(_0x15d82f){return{'name':_0x15d82f['fieldName'],'type':_0x15d82f[_0x7e04('0x23')][_0x7e04('0x24')]};});_0x32ddf3=qs[_0x7e04('0x25')](_0x1a24bb,_0x57a3d8);return interaction['findAll'](_0x7e04('0x26'),_0x57a3d8[_0x7e04('0x27')],_0x57a3d8[_0x7e04('0x28')],_0x32ddf3,_0x1a24bb)[_0x7e04('0x29')](respondWithFilteredResult(_0x3a9d2f,_0x32ddf3))[_0x7e04('0x2a')](handleError(_0x3a9d2f,null));};exports[_0x7e04('0x2b')]=function(_0x57a28b,_0xdff2c9){var _0xcba1a6={'raw':![],'where':{'id':_0x57a28b[_0x7e04('0x2c')]['id']}},_0x576bd2={};_0x576bd2[_0x7e04('0x2d')]=_[_0x7e04('0x2e')](db[_0x7e04('0x21')][_0x7e04('0x22')]);_0x576bd2[_0x7e04('0x27')]=_[_0x7e04('0x2e')](_0x57a28b[_0x7e04('0x27')]);_0x576bd2[_0x7e04('0x2f')]=_[_0x7e04('0x30')](_0x576bd2[_0x7e04('0x2d')],_0x576bd2['query']);_0xcba1a6[_0x7e04('0x31')]=_[_0x7e04('0x30')](_0x576bd2[_0x7e04('0x2d')],qs[_0x7e04('0x32')](_0x57a28b[_0x7e04('0x27')][_0x7e04('0x32')]));_0xcba1a6['attributes']=_0xcba1a6[_0x7e04('0x31')][_0x7e04('0x33')]?_0xcba1a6[_0x7e04('0x31')]:_0x576bd2[_0x7e04('0x2d')];if(_0x57a28b[_0x7e04('0x27')]['includeAll']){_0xcba1a6[_0x7e04('0x34')]=[{'all':!![]}];}_0xcba1a6=_[_0x7e04('0x35')]({},_0xcba1a6,_0x57a28b[_0x7e04('0x36')]);return db[_0x7e04('0x21')][_0x7e04('0x37')](_0xcba1a6)['then'](handleEntityNotFound(_0xdff2c9,null))[_0x7e04('0x29')](respondWithResult(_0xdff2c9,null))[_0x7e04('0x2a')](handleError(_0xdff2c9,null));};exports[_0x7e04('0x38')]=function(_0x1b49fd,_0x240639){return db[_0x7e04('0x21')]['create'](_0x1b49fd[_0x7e04('0x39')],{})[_0x7e04('0x29')](respondWithResult(_0x240639,0xc9))[_0x7e04('0x2a')](handleError(_0x240639,null));};exports[_0x7e04('0x3a')]=function(_0x210ff6,_0x3b7e46){if(_0x210ff6['body']['id']){delete _0x210ff6[_0x7e04('0x39')]['id'];}return db['SmsInteraction'][_0x7e04('0x37')]({'where':{'id':_0x210ff6[_0x7e04('0x2c')]['id']}})[_0x7e04('0x29')](handleEntityNotFound(_0x3b7e46,null))[_0x7e04('0x29')](saveUpdates(_0x210ff6[_0x7e04('0x39')],null))[_0x7e04('0x29')](respondWithResult(_0x3b7e46,null))[_0x7e04('0x2a')](handleError(_0x3b7e46,null));};exports[_0x7e04('0x1b')]=function(_0x31c0cb,_0x514470){return db['SmsInteraction'][_0x7e04('0x37')]({'where':{'id':_0x31c0cb[_0x7e04('0x2c')]['id']}})['then'](handleEntityNotFound(_0x514470,null))[_0x7e04('0x29')](removeEntity(_0x514470,null))[_0x7e04('0x2a')](handleError(_0x514470,null));};exports[_0x7e04('0x3b')]=function(_0x4032a2,_0x2f38f9){return db[_0x7e04('0x21')][_0x7e04('0x3b')]()[_0x7e04('0x29')](respondWithResult(_0x2f38f9,null))[_0x7e04('0x2a')](handleError(_0x2f38f9,null));};exports[_0x7e04('0x3c')]=function(_0x47c35b,_0x1051c4){return db[_0x7e04('0x3d')]['find']({'where':{'id':_0x47c35b['params']['id']}})[_0x7e04('0x29')](handleEntityNotFound(_0x1051c4,null))[_0x7e04('0x29')](function(_0x2b9f6f){if(_0x2b9f6f){return _0x2b9f6f['addMessage'](_0x47c35b[_0x7e04('0x39')][_0x7e04('0x3e')],_[_0x7e04('0x3f')](_0x47c35b[_0x7e04('0x39')],[_0x7e04('0x3e'),'id'])||{});}})[_0x7e04('0x29')](respondWithResult(_0x1051c4,null))[_0x7e04('0x2a')](handleError(_0x1051c4,null));};exports['getMessages']=function(_0x259f75,_0x1b4b51){var _0x23da01={'raw':![],'where':{}};var _0x2c3daa={};var _0x7d8295={'count':0x0,'rows':[]};return db[_0x7e04('0x21')][_0x7e04('0x40')]({'where':{'id':_0x259f75['params']['id']}})[_0x7e04('0x29')](handleEntityNotFound(_0x1b4b51,null))[_0x7e04('0x29')](function(_0x2b1069){if(_0x2b1069){_0x2c3daa[_0x7e04('0x2d')]=_[_0x7e04('0x2e')](db[_0x7e04('0x3d')][_0x7e04('0x22')]);_0x2c3daa[_0x7e04('0x27')]=_[_0x7e04('0x2e')](_0x259f75[_0x7e04('0x27')]);_0x2c3daa[_0x7e04('0x2f')]=_[_0x7e04('0x30')](_0x2c3daa['model'],_0x2c3daa[_0x7e04('0x27')]);_0x23da01[_0x7e04('0x31')]=_[_0x7e04('0x30')](_0x2c3daa[_0x7e04('0x2d')],qs[_0x7e04('0x32')](_0x259f75['query'][_0x7e04('0x32')]));_0x23da01['attributes']=_0x23da01[_0x7e04('0x31')]['length']?_0x23da01[_0x7e04('0x31')]:_0x2c3daa['model'];if(!_0x259f75[_0x7e04('0x27')]['hasOwnProperty'](_0x7e04('0x41'))){_0x23da01[_0x7e04('0x18')]=qs['limit'](_0x259f75['query'][_0x7e04('0x18')]);_0x23da01[_0x7e04('0x15')]=qs[_0x7e04('0x15')](_0x259f75[_0x7e04('0x27')][_0x7e04('0x15')]);}_0x23da01[_0x7e04('0x42')]=qs[_0x7e04('0x43')](_0x259f75['query'][_0x7e04('0x43')]);_0x23da01[_0x7e04('0x44')]=qs['filters'](_[_0x7e04('0x45')](_0x259f75[_0x7e04('0x27')],_0x2c3daa['filters']));_0x23da01['where']['SmsInteractionId']=_0x2b1069['id'];if(_0x259f75['query'][_0x7e04('0x46')]){_0x23da01[_0x7e04('0x44')]=_[_0x7e04('0x35')](_0x23da01['where'],{'$or':_[_0x7e04('0x47')](_0x23da01[_0x7e04('0x31')],function(_0x2f6003){var _0xbbd6a0={};_0xbbd6a0[_0x2f6003]={'$like':'%'+_0x259f75['query'][_0x7e04('0x46')]+'%'};return _0xbbd6a0;})});}if(_0x259f75[_0x7e04('0x27')][_0x7e04('0x48')]){var _0x4f52d4=_0x259f75[_0x7e04('0x27')][_0x7e04('0x48')][_0x7e04('0x49')](',');var _0x4b5f85={};_0x4b5f85[_0x4f52d4[0x0]]={'$gte':moment(_0x4f52d4[0x1])['format'](_0x7e04('0x4a'))};_0x23da01[_0x7e04('0x44')]=_[_0x7e04('0x35')](_0x23da01[_0x7e04('0x44')],_0x4b5f85);}_0x23da01=_['merge']({},_0x23da01,_0x259f75['options']);return db[_0x7e04('0x3d')][_0x7e04('0x17')]({'where':_0x23da01[_0x7e04('0x44')]})['then'](function(_0x59e70c){_0x7d8295[_0x7e04('0x17')]=_0x59e70c;if(_0x259f75[_0x7e04('0x27')]['includeAll']){_0x23da01['include']=[{'all':!![]}];}return db[_0x7e04('0x3d')][_0x7e04('0x4b')](_0x23da01);})[_0x7e04('0x29')](function(_0x41a2a1){_0x7d8295['rows']=_0x41a2a1;return _0x7d8295;});}})['then'](respondWithFilteredResult(_0x1b4b51,_0x23da01))[_0x7e04('0x2a')](handleError(_0x1b4b51,null));};exports[_0x7e04('0x4c')]=function(_0x11b512,_0xf9056d){return db[_0x7e04('0x21')][_0x7e04('0x37')]({'where':{'id':_0x11b512[_0x7e04('0x2c')]['id']}})['then'](handleEntityNotFound(_0xf9056d,null))[_0x7e04('0x29')](function(_0xce54d0){if(_0xce54d0){return _0xce54d0[_0x7e04('0x4d')](_0x11b512[_0x7e04('0x39')][_0x7e04('0x3e')],_[_0x7e04('0x3f')](_0x11b512[_0x7e04('0x39')],[_0x7e04('0x3e'),'id'])||{})[_0x7e04('0x4e')](function(){return db[_0x7e04('0x4f')][_0x7e04('0x4b')]({'attributes':['id',_0x7e04('0x1e'),'color'],'where':{'id':_0x11b512[_0x7e04('0x39')][_0x7e04('0x3e')]}});})[_0x7e04('0x29')](function(_0x3b9ef9){socket['emit'](_0x7e04('0x50'),{'id':Number(_0x11b512['params']['id']),'tags':_0x3b9ef9||[]});return{'id':Number(_0x11b512[_0x7e04('0x2c')]['id']),'tags':_0x3b9ef9||[]};});}})['then'](respondWithResult(_0xf9056d,null))[_0x7e04('0x2a')](handleError(_0xf9056d,null));};exports[_0x7e04('0x51')]=function(_0x3dba29,_0x4217df){return db['SmsInteraction'][_0x7e04('0x37')]({'where':{'id':_0x3dba29[_0x7e04('0x2c')]['id']}})[_0x7e04('0x29')](handleEntityNotFound(_0x4217df,null))[_0x7e04('0x29')](function(_0x5ceef1){if(_0x5ceef1){return _0x5ceef1[_0x7e04('0x51')](_0x3dba29[_0x7e04('0x27')][_0x7e04('0x3e')]);}})[_0x7e04('0x29')](respondWithStatusCode(_0x4217df,null))[_0x7e04('0x2a')](handleError(_0x4217df,null));};exports[_0x7e04('0x52')]=function(_0x102a4d,_0x18cfc3){var _0x57bac9=moment()[_0x7e04('0x53')]()['toString']();var _0x276757=path['join'](config[_0x7e04('0x54')],_0x7e04('0x55'),_0x7e04('0x56'),_0x7e04('0x57'));var _0xcec462=path[_0x7e04('0x58')](_0x276757,_0x57bac9);var _0x542bbd=util[_0x7e04('0x59')](_0x7e04('0x5a'),_0x102a4d[_0x7e04('0x2c')]['id'],_0x57bac9);var _0x428eb0=path['join'](_0x276757,_0x542bbd);var _0x444656=[];_0x444656[_0x7e04('0x5b')]({'model':db[_0x7e04('0x5c')],'as':_0x7e04('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x444656[_0x7e04('0x5b')]({'model':db['CmContact'],'as':_0x7e04('0x5d'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0xcd40ac=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x7e04('0x39'),_0x7e04('0x5e'),_0x7e04('0x5f'),_0x7e04('0x60'),_0x7e04('0x61')],'include':_0x444656}];_0xcd40ac[_0x7e04('0x5b')]({'model':db['SmsAccount'],'as':_0x7e04('0x62'),'attributes':['id',_0x7e04('0x1e')]});_0xcd40ac['push']({'model':db[_0x7e04('0x5c')],'as':_0x7e04('0x63'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x7e04('0x37')]({'where':{'id':_0x102a4d['params']['id']},'include':_0xcd40ac})[_0x7e04('0x29')](handleEntityNotFound(_0x18cfc3,null))[_0x7e04('0x29')](function(_0x3711b4){if(_0x3711b4){var _0x3b13c7=_0x3711b4[_0x7e04('0x64')]({'plain':!![]});fs['mkdirSync'](_0xcec462);var _0x24b34d={'channel':_0x7e04('0x65'),'account':_0x3b13c7[_0x7e04('0x62')][_0x7e04('0x1e')],'agent':_0x3b13c7[_0x7e04('0x63')]?_0x3b13c7['Owner'][_0x7e04('0x66')]:_0x7e04('0x67'),'createdAt':moment(_0x3b13c7[_0x7e04('0x5e')])[_0x7e04('0x59')](_0x7e04('0x4a'))[_0x7e04('0x68')](),'closedAt':_0x3b13c7[_0x7e04('0x69')]?moment(_0x3b13c7['closedAt'])[_0x7e04('0x59')](_0x7e04('0x4a'))[_0x7e04('0x68')]():'','disposition':_0x3b13c7[_0x7e04('0x6a')],'messages':_(_0x3b13c7[_0x7e04('0x6b')])['filter']({'secret':![]})['map'](function(_0x140571){return{'date':moment(_0x140571[_0x7e04('0x5e')])[_0x7e04('0x59')](_0x7e04('0x4a'))[_0x7e04('0x68')](),'sender':_0x140571['direction']===_0x7e04('0x6c')?_0x140571[_0x7e04('0x5c')]?_0x140571[_0x7e04('0x5c')][_0x7e04('0x66')]:_0x7e04('0x6d'):_0x140571[_0x7e04('0x5d')][_0x7e04('0x6e')]+(_0x140571[_0x7e04('0x5d')][_0x7e04('0x6f')]?'\x20'+_0x140571[_0x7e04('0x5d')][_0x7e04('0x6f')]:''),'body':_0x140571[_0x7e04('0x39')],'direction':_0x140571[_0x7e04('0x5f')]===_0x7e04('0x6c')?'A':'C','secret':_0x140571[_0x7e04('0x60')],'read':_0x140571[_0x7e04('0x61')]};})['value']()};return ejs['renderFile'](path[_0x7e04('0x58')](config['root'],_0x7e04('0x55'),_0x7e04('0x70'),_0x7e04('0x71')),{'interaction':_0x24b34d})[_0x7e04('0x29')](function(_0x2d5dc1){var _0x200a79=path[_0x7e04('0x58')](_0xcec462,'transcript-'+_0x3b13c7['id']+'-'+_0x57bac9+'.pdf');var _0x353cd5={'path':_0x200a79,'channel':_0x7e04('0x65'),'interactionId':_0x3b13c7['id']};return pdf[_0x7e04('0x72')](_0x2d5dc1,_0x353cd5);})[_0x7e04('0x29')](function(){return new BPromise(function(_0x1d90b5,_0x274bb1){zipdir(_0xcec462,{'saveTo':_0x428eb0},function(_0x46e3e5,_0x3b03e1){if(_0x46e3e5)return _0x274bb1(_0x46e3e5);return _0x1d90b5(_0x3b03e1);});})['then'](function(){return new BPromise(function(_0x2777d3,_0xabe249){rimraf(_0xcec462,function(_0xd32539){if(_0xd32539)_0xabe249(_0xd32539);return _0x2777d3();});});})[_0x7e04('0x29')](function(){return _0x18cfc3[_0x7e04('0x52')](_0x428eb0,_0x542bbd,function(_0x3ed577){if(_0x3ed577){console[_0x7e04('0x73')](_0x7e04('0x74'),_0x3ed577);}else{fs[_0x7e04('0x75')](_0x428eb0);}});});});}else{return _0x18cfc3['sendStatus'](0xc8);}})['catch'](handleError(_0x18cfc3,null));}; \ No newline at end of file +var _0x19ce=['Sms','closed','disposition','out','System','Contact','firstName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','status','end','json','limit','undefined','count','offset','set','Content-Range','update','then','destroy','sendStatus','error','name','send','index','map','SmsInteraction','rawAttributes','fieldName','key','getOptions','sms','query','params','keys','intersection','model','attributes','length','includeAll','include','find','create','body','catch','addMessage','SmsMessage','ids','findOne','filters','fields','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','omit','spread','Tag','emit','smsInteractionTags:save','removeTags','unix','toString','join','root','server','tmp','format','transcript-%d-%s.zip','push','User','fullname','CmContact','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','get'];(function(_0x11defd,_0x22c171){var _0x28e8d0=function(_0x189367){while(--_0x189367){_0x11defd['push'](_0x11defd['shift']());}};_0x28e8d0(++_0x22c171);}(_0x19ce,0xf9));var _0xe19c=function(_0x247235,_0x319bf5){_0x247235=_0x247235-0x0;var _0x27730d=_0x19ce[_0x247235];return _0x27730d;};'use strict';var rimraf=require(_0xe19c('0x0'));var zipdir=require(_0xe19c('0x1'));var moment=require('moment');var BPromise=require(_0xe19c('0x2'));var util=require('util');var path=require(_0xe19c('0x3'));var ejs=require(_0xe19c('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xe19c('0x5'));var interaction=require(_0xe19c('0x6'));var qs=require(_0xe19c('0x7'));var pdf=require(_0xe19c('0x8'));var logger=require('../../config/logger')(_0xe19c('0x9'));var config=require(_0xe19c('0xa'));var db=require(_0xe19c('0xb'))['db'];config[_0xe19c('0xc')]=_['defaults'](config[_0xe19c('0xc')],{'host':_0xe19c('0xd'),'port':0x18eb});var socket=require(_0xe19c('0xe'))(new Redis(config[_0xe19c('0xc')]));require(_0xe19c('0xf'))['register'](socket);function respondWithStatusCode(_0x1c9715,_0x406b4b){_0x406b4b=_0x406b4b||0xcc;return function(_0x257b11){if(_0x257b11){return _0x1c9715['sendStatus'](_0x406b4b);}return _0x1c9715[_0xe19c('0x10')](_0x406b4b)[_0xe19c('0x11')]();};}function respondWithResult(_0x5304d9,_0x32973a){_0x32973a=_0x32973a||0xc8;return function(_0x30e316){if(_0x30e316){return _0x5304d9[_0xe19c('0x10')](_0x32973a)[_0xe19c('0x12')](_0x30e316);}};}function respondWithFilteredResult(_0x32e501,_0x279713){return function(_0x3cfc5c){if(_0x3cfc5c){var _0x2dfbae=typeof _0x279713['offset']==='undefined'&&typeof _0x279713[_0xe19c('0x13')]===_0xe19c('0x14');var _0x4541a2=_0x3cfc5c[_0xe19c('0x15')];var _0x469847=_0x2dfbae?0x0:_0x279713[_0xe19c('0x16')];var _0x5240f7=_0x2dfbae?_0x3cfc5c[_0xe19c('0x15')]:_0x279713[_0xe19c('0x16')]+_0x279713[_0xe19c('0x13')];var _0x187073;if(_0x5240f7>=_0x4541a2){_0x5240f7=_0x4541a2;_0x187073=0xc8;}else{_0x187073=0xce;}_0x32e501[_0xe19c('0x10')](_0x187073);return _0x32e501[_0xe19c('0x17')](_0xe19c('0x18'),_0x469847+'-'+_0x5240f7+'/'+_0x4541a2)[_0xe19c('0x12')](_0x3cfc5c);}return null;};}function saveUpdates(_0x4a3c7c){return function(_0x2023a3){if(_0x2023a3){return _0x2023a3[_0xe19c('0x19')](_0x4a3c7c)[_0xe19c('0x1a')](function(_0x1d8af8){return _0x1d8af8;});}return null;};}function removeEntity(_0x5077fe){return function(_0x2267c8){if(_0x2267c8){return _0x2267c8[_0xe19c('0x1b')]()[_0xe19c('0x1a')](function(){_0x5077fe['status'](0xcc)[_0xe19c('0x11')]();});}};}function handleEntityNotFound(_0x334faa){return function(_0x28a946){if(!_0x28a946){_0x334faa[_0xe19c('0x1c')](0x194);}return _0x28a946;};}function handleError(_0x13c11a,_0x2d1c0e){_0x2d1c0e=_0x2d1c0e||0x1f4;return function(_0x3fc743){logger[_0xe19c('0x1d')](_0x3fc743['stack']);if(_0x3fc743[_0xe19c('0x1e')]){delete _0x3fc743['name'];}_0x13c11a[_0xe19c('0x10')](_0x2d1c0e)[_0xe19c('0x1f')](_0x3fc743);};}exports[_0xe19c('0x20')]=function(_0xbfb5b5,_0xed999c){var _0x26c60e={};var _0x1f1bcd=_[_0xe19c('0x21')](db[_0xe19c('0x22')][_0xe19c('0x23')],function(_0x514466){return{'name':_0x514466[_0xe19c('0x24')],'type':_0x514466['type'][_0xe19c('0x25')]};});_0x26c60e=qs[_0xe19c('0x26')](_0x1f1bcd,_0xbfb5b5);return interaction['findAll'](_0xe19c('0x27'),_0xbfb5b5[_0xe19c('0x28')],_0xbfb5b5['user'],_0x26c60e,_0x1f1bcd)[_0xe19c('0x1a')](respondWithFilteredResult(_0xed999c,_0x26c60e))['catch'](handleError(_0xed999c,null));};exports['show']=function(_0x443764,_0x59e69d){var _0x260966={'raw':![],'where':{'id':_0x443764[_0xe19c('0x29')]['id']}},_0x2d0025={};_0x2d0025['model']=_[_0xe19c('0x2a')](db[_0xe19c('0x22')][_0xe19c('0x23')]);_0x2d0025[_0xe19c('0x28')]=_[_0xe19c('0x2a')](_0x443764[_0xe19c('0x28')]);_0x2d0025['filters']=_[_0xe19c('0x2b')](_0x2d0025[_0xe19c('0x2c')],_0x2d0025[_0xe19c('0x28')]);_0x260966[_0xe19c('0x2d')]=_[_0xe19c('0x2b')](_0x2d0025[_0xe19c('0x2c')],qs['fields'](_0x443764[_0xe19c('0x28')]['fields']));_0x260966[_0xe19c('0x2d')]=_0x260966[_0xe19c('0x2d')][_0xe19c('0x2e')]?_0x260966[_0xe19c('0x2d')]:_0x2d0025[_0xe19c('0x2c')];if(_0x443764['query'][_0xe19c('0x2f')]){_0x260966[_0xe19c('0x30')]=[{'all':!![]}];}_0x260966=_['merge']({},_0x260966,_0x443764['options']);return db[_0xe19c('0x22')][_0xe19c('0x31')](_0x260966)[_0xe19c('0x1a')](handleEntityNotFound(_0x59e69d,null))[_0xe19c('0x1a')](respondWithResult(_0x59e69d,null))['catch'](handleError(_0x59e69d,null));};exports[_0xe19c('0x32')]=function(_0x5434a8,_0x8e18f4){return db[_0xe19c('0x22')][_0xe19c('0x32')](_0x5434a8['body'],{})[_0xe19c('0x1a')](respondWithResult(_0x8e18f4,0xc9))['catch'](handleError(_0x8e18f4,null));};exports[_0xe19c('0x19')]=function(_0x4de5f6,_0x43e060){if(_0x4de5f6[_0xe19c('0x33')]['id']){delete _0x4de5f6[_0xe19c('0x33')]['id'];}return db[_0xe19c('0x22')][_0xe19c('0x31')]({'where':{'id':_0x4de5f6['params']['id']}})['then'](handleEntityNotFound(_0x43e060,null))[_0xe19c('0x1a')](saveUpdates(_0x4de5f6['body'],null))[_0xe19c('0x1a')](respondWithResult(_0x43e060,null))['catch'](handleError(_0x43e060,null));};exports[_0xe19c('0x1b')]=function(_0x4a67e1,_0x3ee889){return db[_0xe19c('0x22')][_0xe19c('0x31')]({'where':{'id':_0x4a67e1[_0xe19c('0x29')]['id']}})['then'](handleEntityNotFound(_0x3ee889,null))[_0xe19c('0x1a')](removeEntity(_0x3ee889,null))[_0xe19c('0x34')](handleError(_0x3ee889,null));};exports['describe']=function(_0x176fcb,_0x22a2e1){return db[_0xe19c('0x22')]['describe']()[_0xe19c('0x1a')](respondWithResult(_0x22a2e1,null))[_0xe19c('0x34')](handleError(_0x22a2e1,null));};exports[_0xe19c('0x35')]=function(_0x2d6e18,_0x53fcf3){return db[_0xe19c('0x36')][_0xe19c('0x31')]({'where':{'id':_0x2d6e18[_0xe19c('0x29')]['id']}})[_0xe19c('0x1a')](handleEntityNotFound(_0x53fcf3,null))[_0xe19c('0x1a')](function(_0x418fe9){if(_0x418fe9){return _0x418fe9[_0xe19c('0x35')](_0x2d6e18['body'][_0xe19c('0x37')],_['omit'](_0x2d6e18[_0xe19c('0x33')],[_0xe19c('0x37'),'id'])||{});}})[_0xe19c('0x1a')](respondWithResult(_0x53fcf3,null))[_0xe19c('0x34')](handleError(_0x53fcf3,null));};exports['getMessages']=function(_0x1953eb,_0x230504){var _0x41e917={'raw':![],'where':{}};var _0x41b9c3={};var _0x32400c={'count':0x0,'rows':[]};return db[_0xe19c('0x22')][_0xe19c('0x38')]({'where':{'id':_0x1953eb[_0xe19c('0x29')]['id']}})[_0xe19c('0x1a')](handleEntityNotFound(_0x230504,null))['then'](function(_0x461ec6){if(_0x461ec6){_0x41b9c3[_0xe19c('0x2c')]=_[_0xe19c('0x2a')](db[_0xe19c('0x36')]['rawAttributes']);_0x41b9c3['query']=_[_0xe19c('0x2a')](_0x1953eb[_0xe19c('0x28')]);_0x41b9c3[_0xe19c('0x39')]=_[_0xe19c('0x2b')](_0x41b9c3[_0xe19c('0x2c')],_0x41b9c3[_0xe19c('0x28')]);_0x41e917['attributes']=_[_0xe19c('0x2b')](_0x41b9c3[_0xe19c('0x2c')],qs[_0xe19c('0x3a')](_0x1953eb[_0xe19c('0x28')][_0xe19c('0x3a')]));_0x41e917[_0xe19c('0x2d')]=_0x41e917[_0xe19c('0x2d')]['length']?_0x41e917[_0xe19c('0x2d')]:_0x41b9c3['model'];if(!_0x1953eb[_0xe19c('0x28')][_0xe19c('0x3b')](_0xe19c('0x3c'))){_0x41e917['limit']=qs[_0xe19c('0x13')](_0x1953eb[_0xe19c('0x28')][_0xe19c('0x13')]);_0x41e917[_0xe19c('0x16')]=qs[_0xe19c('0x16')](_0x1953eb[_0xe19c('0x28')][_0xe19c('0x16')]);}_0x41e917[_0xe19c('0x3d')]=qs[_0xe19c('0x3e')](_0x1953eb[_0xe19c('0x28')][_0xe19c('0x3e')]);_0x41e917[_0xe19c('0x3f')]=qs['filters'](_['pick'](_0x1953eb[_0xe19c('0x28')],_0x41b9c3[_0xe19c('0x39')]));_0x41e917['where'][_0xe19c('0x40')]=_0x461ec6['id'];if(_0x1953eb[_0xe19c('0x28')][_0xe19c('0x41')]){_0x41e917[_0xe19c('0x3f')]=_[_0xe19c('0x42')](_0x41e917[_0xe19c('0x3f')],{'$or':_[_0xe19c('0x21')](_0x41e917[_0xe19c('0x2d')],function(_0x4ed1b9){var _0x239303={};_0x239303[_0x4ed1b9]={'$like':'%'+_0x1953eb['query'][_0xe19c('0x41')]+'%'};return _0x239303;})});}if(_0x1953eb[_0xe19c('0x28')]['$gte']){var _0x467747=_0x1953eb[_0xe19c('0x28')][_0xe19c('0x43')][_0xe19c('0x44')](',');var _0x568a95={};_0x568a95[_0x467747[0x0]]={'$gte':moment(_0x467747[0x1])['format'](_0xe19c('0x45'))};_0x41e917['where']=_[_0xe19c('0x42')](_0x41e917['where'],_0x568a95);}_0x41e917=_[_0xe19c('0x42')]({},_0x41e917,_0x1953eb[_0xe19c('0x46')]);return db[_0xe19c('0x36')][_0xe19c('0x15')]({'where':_0x41e917[_0xe19c('0x3f')]})[_0xe19c('0x1a')](function(_0x435112){_0x32400c['count']=_0x435112;if(_0x1953eb['query'][_0xe19c('0x2f')]){_0x41e917['include']=[{'all':!![]}];}return db[_0xe19c('0x36')]['findAll'](_0x41e917);})[_0xe19c('0x1a')](function(_0x42f7d2){_0x32400c[_0xe19c('0x47')]=_0x42f7d2;return _0x32400c;});}})[_0xe19c('0x1a')](respondWithFilteredResult(_0x230504,_0x41e917))[_0xe19c('0x34')](handleError(_0x230504,null));};exports[_0xe19c('0x48')]=function(_0x350a27,_0x2ec6e9){return db[_0xe19c('0x22')]['find']({'where':{'id':_0x350a27[_0xe19c('0x29')]['id']}})[_0xe19c('0x1a')](handleEntityNotFound(_0x2ec6e9,null))[_0xe19c('0x1a')](function(_0x45704e){if(_0x45704e){return _0x45704e[_0xe19c('0x49')](_0x350a27[_0xe19c('0x33')]['ids'],_[_0xe19c('0x4a')](_0x350a27[_0xe19c('0x33')],['ids','id'])||{})[_0xe19c('0x4b')](function(){return db[_0xe19c('0x4c')]['findAll']({'attributes':['id',_0xe19c('0x1e'),'color'],'where':{'id':_0x350a27['body'][_0xe19c('0x37')]}});})[_0xe19c('0x1a')](function(_0x433c56){socket[_0xe19c('0x4d')](_0xe19c('0x4e'),{'id':Number(_0x350a27[_0xe19c('0x29')]['id']),'tags':_0x433c56||[]});return{'id':Number(_0x350a27['params']['id']),'tags':_0x433c56||[]};});}})[_0xe19c('0x1a')](respondWithResult(_0x2ec6e9,null))[_0xe19c('0x34')](handleError(_0x2ec6e9,null));};exports[_0xe19c('0x4f')]=function(_0x148e62,_0x52c49a){return db[_0xe19c('0x22')]['find']({'where':{'id':_0x148e62[_0xe19c('0x29')]['id']}})['then'](handleEntityNotFound(_0x52c49a,null))['then'](function(_0x2f5ae0){if(_0x2f5ae0){return _0x2f5ae0[_0xe19c('0x4f')](_0x148e62['query'][_0xe19c('0x37')]);}})[_0xe19c('0x1a')](respondWithStatusCode(_0x52c49a,null))[_0xe19c('0x34')](handleError(_0x52c49a,null));};exports['download']=function(_0x279063,_0x71daee){var _0x41a57e=moment()[_0xe19c('0x50')]()[_0xe19c('0x51')]();var _0x5621ac=path[_0xe19c('0x52')](config[_0xe19c('0x53')],_0xe19c('0x54'),'files',_0xe19c('0x55'));var _0x42844e=path[_0xe19c('0x52')](_0x5621ac,_0x41a57e);var _0x41f167=util[_0xe19c('0x56')](_0xe19c('0x57'),_0x279063['params']['id'],_0x41a57e);var _0x560310=path[_0xe19c('0x52')](_0x5621ac,_0x41f167);var _0x343bdb=[];_0x343bdb[_0xe19c('0x58')]({'model':db[_0xe19c('0x59')],'as':_0xe19c('0x59'),'attributes':['id',_0xe19c('0x5a')],'raw':!![]});_0x343bdb[_0xe19c('0x58')]({'model':db[_0xe19c('0x5b')],'as':'Contact','attributes':['id','firstName',_0xe19c('0x5c')],'raw':!![]});var _0x1e2335=[{'model':db[_0xe19c('0x36')],'as':_0xe19c('0x5d'),'attributes':['id',_0xe19c('0x33'),_0xe19c('0x5e'),_0xe19c('0x5f'),_0xe19c('0x60'),_0xe19c('0x61')],'include':_0x343bdb}];_0x1e2335[_0xe19c('0x58')]({'model':db[_0xe19c('0x62')],'as':_0xe19c('0x63'),'attributes':['id',_0xe19c('0x1e')]});_0x1e2335[_0xe19c('0x58')]({'model':db[_0xe19c('0x59')],'as':_0xe19c('0x64'),'attributes':['id',_0xe19c('0x5a')]});return db['SmsInteraction']['find']({'where':{'id':_0x279063['params']['id']},'include':_0x1e2335})['then'](handleEntityNotFound(_0x71daee,null))[_0xe19c('0x1a')](function(_0x500fba){if(_0x500fba){var _0x17d344=_0x500fba[_0xe19c('0x65')]({'plain':!![]});fs['mkdirSync'](_0x42844e);var _0x582645={'channel':_0xe19c('0x66'),'account':_0x17d344[_0xe19c('0x63')][_0xe19c('0x1e')],'agent':_0x17d344[_0xe19c('0x64')]?_0x17d344['Owner'][_0xe19c('0x5a')]:'N.A.','createdAt':moment(_0x17d344[_0xe19c('0x5e')])[_0xe19c('0x56')](_0xe19c('0x45'))[_0xe19c('0x51')](),'closedAt':_0x17d344[_0xe19c('0x67')]?moment(_0x17d344['closedAt'])[_0xe19c('0x56')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe19c('0x51')]():'','disposition':_0x17d344[_0xe19c('0x68')],'messages':_(_0x17d344['Messages'])[_0xe19c('0x41')]({'secret':![]})['map'](function(_0x4f2300){return{'date':moment(_0x4f2300[_0xe19c('0x5e')])['format'](_0xe19c('0x45'))[_0xe19c('0x51')](),'sender':_0x4f2300[_0xe19c('0x5f')]===_0xe19c('0x69')?_0x4f2300[_0xe19c('0x59')]?_0x4f2300[_0xe19c('0x59')]['fullname']:_0xe19c('0x6a'):_0x4f2300[_0xe19c('0x6b')][_0xe19c('0x6c')]+(_0x4f2300[_0xe19c('0x6b')][_0xe19c('0x5c')]?'\x20'+_0x4f2300[_0xe19c('0x6b')][_0xe19c('0x5c')]:''),'body':_0x4f2300[_0xe19c('0x33')],'direction':_0x4f2300[_0xe19c('0x5f')]===_0xe19c('0x69')?'A':'C','secret':_0x4f2300[_0xe19c('0x60')],'read':_0x4f2300[_0xe19c('0x61')]};})['value']()};return ejs[_0xe19c('0x6d')](path[_0xe19c('0x52')](config['root'],_0xe19c('0x54'),_0xe19c('0x6e'),_0xe19c('0x6f')),{'interaction':_0x582645})[_0xe19c('0x1a')](function(_0x497b28){var _0xfc97ff=path[_0xe19c('0x52')](_0x42844e,'transcript-'+_0x17d344['id']+'-'+_0x41a57e+_0xe19c('0x70'));var _0x2eb478={'path':_0xfc97ff,'channel':_0xe19c('0x66'),'interactionId':_0x17d344['id']};return pdf[_0xe19c('0x71')](_0x497b28,_0x2eb478);})[_0xe19c('0x1a')](function(){return new BPromise(function(_0xcb96af,_0x5190cc){zipdir(_0x42844e,{'saveTo':_0x560310},function(_0x4fb211,_0x26535){if(_0x4fb211)return _0x5190cc(_0x4fb211);return _0xcb96af(_0x26535);});})['then'](function(){return new BPromise(function(_0x439aff,_0x3f599f){rimraf(_0x42844e,function(_0x3a7f80){if(_0x3a7f80)_0x3f599f(_0x3a7f80);return _0x439aff();});});})[_0xe19c('0x1a')](function(){return _0x71daee['download'](_0x560310,_0x41f167,function(_0x389e9a){if(_0x389e9a){console[_0xe19c('0x72')](_0xe19c('0x73'),_0x389e9a);}else{fs[_0xe19c('0x74')](_0x560310);}});});});}else{return _0x71daee[_0xe19c('0x1c')](0xc8);}})['catch'](handleError(_0x71daee,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 2e7bbd5..ac5fac7 100644 --- a/server/api/smsInteraction/smsInteraction.events.js +++ b/server/api/smsInteraction/smsInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0x36242b,_0x543bcc){var _0x4cdae5=function(_0x3b63f7){while(--_0x3b63f7){_0x36242b['push'](_0x36242b['shift']());}};_0x4cdae5(++_0x543bcc);}(_0x583c,0x12b));var _0xc583=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x583c[_0x1abeb2];return _0x48da20;};'use strict';var EventEmitter=require(_0xc583('0x0'));var SmsInteraction=require(_0xc583('0x1'))['db'][_0xc583('0x2')];var SmsMessage=require(_0xc583('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc583('0x3')](0x0);var events={'afterCreate':_0xc583('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13b8a7){return function(_0xf03852,_0x5b7292,_0xd3a750){_0xf03852[_0xc583('0x5')]({'attributes':['id'],'raw':!![]})[_0xc583('0x6')](function(_0x1dd37c){_0xf03852['setDataValue'](_0xc583('0x7'),_0x1dd37c[_0xc583('0x8')](function(_0x5b456e){return{'id':_0x5b456e['id']};}));return SmsMessage[_0xc583('0x9')]({'where':{'SmsInteractionId':_0xf03852['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc583('0x6')](function(_0x25f8d3){_0xf03852[_0xc583('0xa')](_0xc583('0xb'),_0x25f8d3['length']);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7+':'+_0xf03852['id'],_0xf03852);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7,_0xf03852);_0xd3a750(null);})['catch'](_0xd3a750(null));};}for(var e in events){if(events[_0xc583('0xd')](e)){var event=events[e];SmsInteraction[_0xc583('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x955f=['save','getUsers','setDataValue','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x57e2d5,_0x59ec41){var _0x542560=function(_0xde14bd){while(--_0xde14bd){_0x57e2d5['push'](_0x57e2d5['shift']());}};_0x542560(++_0x59ec41);}(_0x955f,0x1eb));var _0xf955=function(_0x5bc7cb,_0x1e295d){_0x5bc7cb=_0x5bc7cb-0x0;var _0x155dcf=_0x955f[_0x5bc7cb];return _0x155dcf;};'use strict';var EventEmitter=require(_0xf955('0x0'));var SmsInteraction=require(_0xf955('0x1'))['db'][_0xf955('0x2')];var SmsMessage=require(_0xf955('0x1'))['db'][_0xf955('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf955('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1db0dd){return function(_0x5a20bc,_0x13b796,_0x2caff2){_0x5a20bc[_0xf955('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x18432f){_0x5a20bc[_0xf955('0x6')]('Users',_0x18432f[_0xf955('0x7')](function(_0x151034){return{'id':_0x151034['id']};}));return SmsMessage[_0xf955('0x8')]({'where':{'SmsInteractionId':_0x5a20bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf955('0x9')](function(_0x134c1b){_0x5a20bc[_0xf955('0x6')](_0xf955('0xa'),_0x134c1b['length']);SmsInteractionEvents[_0xf955('0xb')](_0x1db0dd+':'+_0x5a20bc['id'],_0x5a20bc);SmsInteractionEvents['emit'](_0x1db0dd,_0x5a20bc);_0x2caff2(null);})[_0xf955('0xc')](_0x2caff2(null));};}for(var e in events){if(events[_0xf955('0xd')](e)){var event=events[e];SmsInteraction[_0xf955('0xe')](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 51a15d5..3d1edb7 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 _0xbfa7=['moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xbfa7,0x14e));var _0x7bfa=function(_0x51319e,_0x6bf44b){_0x51319e=_0x51319e-0x0;var _0x1b44b2=_0xbfa7[_0x51319e];return _0x1b44b2;};'use strict';var _=require('lodash');var util=require(_0x7bfa('0x0'));var logger=require('../../config/logger')(_0x7bfa('0x1'));var moment=require(_0x7bfa('0x2'));var BPromise=require(_0x7bfa('0x3'));var rp=require(_0x7bfa('0x4'));var fs=require('fs');var path=require(_0x7bfa('0x5'));var rimraf=require(_0x7bfa('0x6'));var config=require('../../config/environment');var attributes=require(_0x7bfa('0x7'));module[_0x7bfa('0x8')]=function(_0x325d29,_0x38db4c){return _0x325d29['define'](_0x7bfa('0x9'),attributes,{'tableName':_0x7bfa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x278a3b,_0x4577ff,_0x4ced7b){if(_0x278a3b[_0x7bfa('0xb')](_0x7bfa('0xc'))){_0x278a3b[_0x7bfa('0xd')]=moment()[_0x7bfa('0xe')](_0x7bfa('0xf'));}_0x4ced7b(null,_0x278a3b);}}});}; \ No newline at end of file +var _0x405d=['rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','path'];(function(_0xe2f81e,_0x3a8cbe){var _0x2ff77c=function(_0x5ea494){while(--_0x5ea494){_0xe2f81e['push'](_0xe2f81e['shift']());}};_0x2ff77c(++_0x3a8cbe);}(_0x405d,0x10c));var _0xd405=function(_0x4e2fea,_0x105e9a){_0x4e2fea=_0x4e2fea-0x0;var _0x4dd3a5=_0x405d[_0x4e2fea];return _0x4dd3a5;};'use strict';var _=require(_0xd405('0x0'));var util=require(_0xd405('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd405('0x2'));var BPromise=require(_0xd405('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd405('0x4'));var rimraf=require(_0xd405('0x5'));var config=require('../../config/environment');var attributes=require(_0xd405('0x6'));module['exports']=function(_0x24d5b3,_0x2174ef){return _0x24d5b3[_0xd405('0x7')](_0xd405('0x8'),attributes,{'tableName':_0xd405('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42fdb5,_0x15180a,_0x1628a2){if(_0x42fdb5[_0xd405('0xa')]('closed')){_0x42fdb5[_0xd405('0xb')]=moment()['format'](_0xd405('0xc'));}_0x1628a2(null,_0x42fdb5);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 999d97f..d6d5a8b 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 _0xd3f9=['body','options','raw','where','attributes','limit','then','find','addTags','omit','spread','AddTags','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','defaults','localhost','redis','./smsInteraction.socket','register','request','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsInteraction,\x20%s,\x20%s','result','UpdateSmsInteraction','SmsInteraction','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd3f9,0x1af));var _0x9d3f=function(_0x570b5d,_0x267462){_0x570b5d=_0x570b5d-0x0;var _0x2d06be=_0xd3f9[_0x570b5d];return _0x2d06be;};'use strict';var _=require(_0x9d3f('0x0'));var util=require(_0x9d3f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d3f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d3f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d3f('0x4'))('rpc');var config=require(_0x9d3f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9d3f('0x6')]['http']({'port':0x232a});config['redis']=_[_0x9d3f('0x7')](config['redis'],{'host':_0x9d3f('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d3f('0x9')]));require(_0x9d3f('0xa'))[_0x9d3f('0xb')](socket);function respondWithRpcPromise(_0x2e571e,_0x55063b,_0x3b2763){return new BPromise(function(_0x4dcd2f,_0x1c5838){return client[_0x9d3f('0xc')](_0x2e571e,_0x3b2763)['then'](function(_0x4cf90a){logger[_0x9d3f('0xd')]('SmsInteraction,\x20%s,\x20%s',_0x55063b,_0x9d3f('0xe'));logger[_0x9d3f('0xf')](_0x9d3f('0x10'),_0x55063b,_0x9d3f('0xe'),JSON[_0x9d3f('0x11')](_0x4cf90a));if(_0x4cf90a[_0x9d3f('0x12')]){if(_0x4cf90a[_0x9d3f('0x12')]['code']===0x1f4){logger[_0x9d3f('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x55063b,_0x4cf90a[_0x9d3f('0x12')][_0x9d3f('0x13')]);return _0x1c5838(_0x4cf90a[_0x9d3f('0x12')][_0x9d3f('0x13')]);}logger[_0x9d3f('0x12')](_0x9d3f('0x14'),_0x55063b,_0x4cf90a[_0x9d3f('0x12')][_0x9d3f('0x13')]);return _0x4dcd2f(_0x4cf90a['error'][_0x9d3f('0x13')]);}else{logger['info'](_0x9d3f('0x14'),_0x55063b,_0x9d3f('0xe'));_0x4dcd2f(_0x4cf90a[_0x9d3f('0x15')]['message']);}})['catch'](function(_0x2ccf28){logger[_0x9d3f('0x12')](_0x9d3f('0x14'),_0x55063b,_0x2ccf28);_0x1c5838(_0x2ccf28);});});}exports[_0x9d3f('0x16')]=function(_0x356a12){var _0x4d7d80=this;return new Promise(function(_0x492764,_0x324010){return db[_0x9d3f('0x17')][_0x9d3f('0x18')](_0x356a12[_0x9d3f('0x19')],{'raw':_0x356a12[_0x9d3f('0x1a')]?_0x356a12[_0x9d3f('0x1a')][_0x9d3f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x356a12[_0x9d3f('0x1a')]?_0x356a12[_0x9d3f('0x1a')][_0x9d3f('0x1c')]||null:null,'attributes':_0x356a12[_0x9d3f('0x1a')]?_0x356a12['options'][_0x9d3f('0x1d')]||null:null,'limit':_0x356a12[_0x9d3f('0x1a')]?_0x356a12[_0x9d3f('0x1a')][_0x9d3f('0x1e')]||null:null})[_0x9d3f('0x1f')](function(_0x559319){logger[_0x9d3f('0xd')](_0x9d3f('0x16'),_0x356a12);logger['debug'](_0x9d3f('0x16'),_0x356a12,JSON['stringify'](_0x559319));_0x492764(_0x559319);})['catch'](function(_0x4e031d){logger[_0x9d3f('0x12')](_0x9d3f('0x16'),_0x4e031d[_0x9d3f('0x13')],_0x356a12);_0x324010(_0x4d7d80[_0x9d3f('0x12')](0x1f4,_0x4e031d['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x47a626){return new Promise(function(_0x2ed145,_0x412866){return db[_0x9d3f('0x17')][_0x9d3f('0x20')]({'where':_0x47a626[_0x9d3f('0x1a')]?_0x47a626[_0x9d3f('0x1a')]['where']||null:null})['then'](function(_0x37b760){if(_0x37b760){return _0x37b760[_0x9d3f('0x21')](_0x47a626[_0x9d3f('0x19')]['ids'],_[_0x9d3f('0x22')](_0x47a626[_0x9d3f('0x19')],['ids','id'])||{});}})[_0x9d3f('0x23')](function(_0x4afe71){logger[_0x9d3f('0xd')](_0x9d3f('0x24'),_0x47a626);logger['debug'](_0x9d3f('0x24'),_0x47a626,JSON['stringify'](_0x4afe71));_0x2ed145(_0x4afe71);})[_0x9d3f('0x25')](function(_0x216398){logger['error']('AddTags',_0x216398[_0x9d3f('0x13')],_0x47a626);_0x412866(_this['error'](0x1f4,_0x216398[_0x9d3f('0x13')]));});});}; \ No newline at end of file +var _0xd382=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','SmsInteraction','update','body','options','raw','where','attributes','UpdateSmsInteraction','debug','catch','find','addTags','ids','spread','AddTags','stringify','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd382,0x124));var _0x2d38=function(_0x1a21b0,_0x4071f3){_0x1a21b0=_0x1a21b0-0x0;var _0xba042d=_0xd382[_0x1a21b0];return _0xba042d;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var moment=require(_0x2d38('0x2'));var BPromise=require(_0x2d38('0x3'));var rs=require(_0x2d38('0x4'));var fs=require('fs');var Redis=require(_0x2d38('0x5'));var db=require(_0x2d38('0x6'))['db'];var utils=require(_0x2d38('0x7'));var logger=require('../../config/logger')(_0x2d38('0x8'));var config=require(_0x2d38('0x9'));var jayson=require(_0x2d38('0xa'));var client=jayson[_0x2d38('0xb')]['http']({'port':0x232a});config[_0x2d38('0xc')]=_[_0x2d38('0xd')](config['redis'],{'host':_0x2d38('0xe'),'port':0x18eb});var socket=require(_0x2d38('0xf'))(new Redis(config[_0x2d38('0xc')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5277d0,_0x52f230,_0x4b5c60){return new BPromise(function(_0x263c32,_0x2c5f14){return client[_0x2d38('0x10')](_0x5277d0,_0x4b5c60)[_0x2d38('0x11')](function(_0x540167){logger['info'](_0x2d38('0x12'),_0x52f230,'request\x20sent');logger['debug'](_0x2d38('0x13'),_0x52f230,_0x2d38('0x14'),JSON['stringify'](_0x540167));if(_0x540167[_0x2d38('0x15')]){if(_0x540167[_0x2d38('0x15')][_0x2d38('0x16')]===0x1f4){logger[_0x2d38('0x15')](_0x2d38('0x12'),_0x52f230,_0x540167[_0x2d38('0x15')][_0x2d38('0x17')]);return _0x2c5f14(_0x540167['error'][_0x2d38('0x17')]);}logger['error'](_0x2d38('0x12'),_0x52f230,_0x540167[_0x2d38('0x15')]['message']);return _0x263c32(_0x540167[_0x2d38('0x15')][_0x2d38('0x17')]);}else{logger[_0x2d38('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x52f230,_0x2d38('0x14'));_0x263c32(_0x540167[_0x2d38('0x19')][_0x2d38('0x17')]);}})['catch'](function(_0x431e1f){logger[_0x2d38('0x15')](_0x2d38('0x12'),_0x52f230,_0x431e1f);_0x2c5f14(_0x431e1f);});});}exports['UpdateSmsInteraction']=function(_0x293980){var _0x5b0f6a=this;return new Promise(function(_0x3d7ca2,_0x26776f){return db[_0x2d38('0x1a')][_0x2d38('0x1b')](_0x293980[_0x2d38('0x1c')],{'raw':_0x293980[_0x2d38('0x1d')]?_0x293980[_0x2d38('0x1d')][_0x2d38('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293980[_0x2d38('0x1d')]?_0x293980['options'][_0x2d38('0x1f')]||null:null,'attributes':_0x293980['options']?_0x293980[_0x2d38('0x1d')][_0x2d38('0x20')]||null:null,'limit':_0x293980[_0x2d38('0x1d')]?_0x293980[_0x2d38('0x1d')]['limit']||null:null})[_0x2d38('0x11')](function(_0x26e0bc){logger[_0x2d38('0x18')](_0x2d38('0x21'),_0x293980);logger[_0x2d38('0x22')](_0x2d38('0x21'),_0x293980,JSON['stringify'](_0x26e0bc));_0x3d7ca2(_0x26e0bc);})[_0x2d38('0x23')](function(_0x37a31a){logger[_0x2d38('0x15')](_0x2d38('0x21'),_0x37a31a[_0x2d38('0x17')],_0x293980);_0x26776f(_0x5b0f6a['error'](0x1f4,_0x37a31a['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x267fd5){return new Promise(function(_0x3bb8da,_0x539de1){return db['SmsInteraction'][_0x2d38('0x24')]({'where':_0x267fd5[_0x2d38('0x1d')]?_0x267fd5[_0x2d38('0x1d')][_0x2d38('0x1f')]||null:null})['then'](function(_0x154292){if(_0x154292){return _0x154292[_0x2d38('0x25')](_0x267fd5[_0x2d38('0x1c')][_0x2d38('0x26')],_['omit'](_0x267fd5['body'],[_0x2d38('0x26'),'id'])||{});}})[_0x2d38('0x27')](function(_0x1d19d6){logger[_0x2d38('0x18')](_0x2d38('0x28'),_0x267fd5);logger['debug'](_0x2d38('0x28'),_0x267fd5,JSON[_0x2d38('0x29')](_0x1d19d6));_0x3bb8da(_0x1d19d6);})[_0x2d38('0x23')](function(_0x187d2e){logger[_0x2d38('0x15')](_0x2d38('0x28'),_0x187d2e[_0x2d38('0x17')],_0x267fd5);_0x539de1(_this[_0x2d38('0x15')](0x1f4,_0x187d2e[_0x2d38('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 26f22d8..8a40010 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 _0x9bfd=['./smsInteraction.events','save','update','emit','removeListener','smsInteraction:'];(function(_0x464e6b,_0x49e3bc){var _0x13ed4b=function(_0x583421){while(--_0x583421){_0x464e6b['push'](_0x464e6b['shift']());}};_0x13ed4b(++_0x49e3bc);}(_0x9bfd,0x10e));var _0xd9bf=function(_0x3827dd,_0x3dc148){_0x3827dd=_0x3827dd-0x0;var _0x3f9460=_0x9bfd[_0x3827dd];return _0x3f9460;};'use strict';var SmsInteractionEvents=require(_0xd9bf('0x0'));var events=[_0xd9bf('0x1'),'remove',_0xd9bf('0x2')];function createListener(_0x39e7fc,_0x42a9ee){return function(_0x15701c){_0x42a9ee[_0xd9bf('0x3')](_0x39e7fc,_0x15701c);};}function removeListener(_0x1cd8c6,_0x21107c){return function(){SmsInteractionEvents[_0xd9bf('0x4')](_0x1cd8c6,_0x21107c);};}exports['register']=function(_0x2abf8e){for(var _0x2ae791=0x0,_0x4e8878=events['length'];_0x2ae791<_0x4e8878;_0x2ae791++){var _0x2681ab=events[_0x2ae791];var _0x535372=createListener(_0xd9bf('0x5')+_0x2681ab,_0x2abf8e);SmsInteractionEvents['on'](_0x2681ab,_0x535372);}}; \ No newline at end of file +var _0x0e9a=['save','update','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x2406b4,_0x2f9771){var _0x7f3752=function(_0x583971){while(--_0x583971){_0x2406b4['push'](_0x2406b4['shift']());}};_0x7f3752(++_0x2f9771);}(_0x0e9a,0xa7));var _0xa0e9=function(_0x4e1963,_0x4791fc){_0x4e1963=_0x4e1963-0x0;var _0x205aea=_0x0e9a[_0x4e1963];return _0x205aea;};'use strict';var SmsInteractionEvents=require(_0xa0e9('0x0'));var events=[_0xa0e9('0x1'),'remove',_0xa0e9('0x2')];function createListener(_0x4628e6,_0x450ee2){return function(_0x53a41f){_0x450ee2['emit'](_0x4628e6,_0x53a41f);};}function removeListener(_0x18c588,_0x1e5d5b){return function(){SmsInteractionEvents[_0xa0e9('0x3')](_0x18c588,_0x1e5d5b);};}exports[_0xa0e9('0x4')]=function(_0x1cabaf){for(var _0x2fa7df=0x0,_0x1350dd=events[_0xa0e9('0x5')];_0x2fa7df<_0x1350dd;_0x2fa7df++){var _0x428341=events[_0x2fa7df];var _0x5722d2=createListener(_0xa0e9('0x6')+_0x428341,_0x1cabaf);SmsInteractionEvents['on'](_0x428341,_0x5722d2);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index e2912d9..b63bdfe 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 _0x7275=['path','express','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','show','tracked','smsmessage:create','create','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x3592ab,_0x4f669a){var _0x13298a=function(_0x25f018){while(--_0x25f018){_0x3592ab['push'](_0x3592ab['shift']());}};_0x13298a(++_0x4f669a);}(_0x7275,0x143));var _0x5727=function(_0x2d897b,_0x358269){_0x2d897b=_0x2d897b-0x0;var _0x2e81c6=_0x7275[_0x2d897b];return _0x2e81c6;};'use strict';var multer=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var path=require(_0x5727('0x2'));var timeout=require('connect-timeout');var express=require(_0x5727('0x3'));var router=express['Router']();var fs_extra=require(_0x5727('0x4'));var auth=require(_0x5727('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5727('0x6'));var controller=require(_0x5727('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5727('0x8')]('/describe',auth[_0x5727('0x9')](),controller['describe']);router[_0x5727('0x8')]('/:id',auth[_0x5727('0x9')](),controller[_0x5727('0xa')]);router['post']('/',auth[_0x5727('0x9')](),interaction[_0x5727('0xb')]('sms',_0x5727('0xc')),controller[_0x5727('0xd')]);router['post'](_0x5727('0xe'),controller[_0x5727('0xf')]);router[_0x5727('0x10')](_0x5727('0x11'),auth[_0x5727('0x9')](),controller[_0x5727('0x12')]);router['put'](_0x5727('0x13'),auth[_0x5727('0x9')](),controller[_0x5727('0x14')]);router[_0x5727('0x10')](_0x5727('0x15'),auth[_0x5727('0x9')](),controller[_0x5727('0x16')]);router['delete'](_0x5727('0x11'),auth[_0x5727('0x9')](),controller[_0x5727('0x17')]);module[_0x5727('0x18')]=router; \ No newline at end of file +var _0xc1aa=['destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','describe','post','tracked','sms','smsmessage:create','create','/:id/status','status','/:id','update','/:id/accept','accept','put','/:id/reject','reject','delete'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xc1aa,0xa9));var _0xac1a=function(_0x11787d,_0x150904){_0x11787d=_0x11787d-0x0;var _0x56d3f7=_0xc1aa[_0x11787d];return _0x56d3f7;};'use strict';var multer=require(_0xac1a('0x0'));var util=require('util');var path=require(_0xac1a('0x1'));var timeout=require(_0xac1a('0x2'));var express=require(_0xac1a('0x3'));var router=express['Router']();var fs_extra=require(_0xac1a('0x4'));var auth=require(_0xac1a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xac1a('0x6'));var controller=require('./smsMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xac1a('0x7')]);router[_0xac1a('0x8')](_0xac1a('0x9'),auth[_0xac1a('0xa')](),controller[_0xac1a('0xb')]);router['get']('/:id',auth[_0xac1a('0xa')](),controller['show']);router[_0xac1a('0xc')]('/',auth[_0xac1a('0xa')](),interaction[_0xac1a('0xd')](_0xac1a('0xe'),_0xac1a('0xf')),controller[_0xac1a('0x10')]);router['post'](_0xac1a('0x11'),controller[_0xac1a('0x12')]);router['put'](_0xac1a('0x13'),auth[_0xac1a('0xa')](),controller[_0xac1a('0x14')]);router['put'](_0xac1a('0x15'),auth['isAuthenticated'](),controller[_0xac1a('0x16')]);router[_0xac1a('0x17')](_0xac1a('0x18'),auth[_0xac1a('0xa')](),controller[_0xac1a('0x19')]);router[_0xac1a('0x1a')]('/:id',auth[_0xac1a('0xa')](),controller[_0xac1a('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 6f35909..d560df1 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 _0xed20=['STRING','sequelize','medium','BOOLEAN','ENUM'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0xed20,0x1b9));var _0x0ed2=function(_0x824460,_0x51539d){_0x824460=_0x824460-0x0;var _0x81354=_0xed20[_0x824460];return _0x81354;};'use strict';var Sequelize=require(_0x0ed2('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x0ed2('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x0ed2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0ed2('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x0ed2('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x0ed2('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0ed2('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1b50=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x22484b,_0xc43a49){var _0x16aeaf=function(_0x5877e9){while(--_0x5877e9){_0x22484b['push'](_0x22484b['shift']());}};_0x16aeaf(++_0xc43a49);}(_0x1b50,0x94));var _0x01b5=function(_0x874a2a,_0x5e979f){_0x874a2a=_0x874a2a-0x0;var _0x4c1699=_0x1b50[_0x874a2a];return _0x4c1699;};'use strict';var Sequelize=require(_0x01b5('0x0'));module[_0x01b5('0x1')]={'body':{'type':Sequelize[_0x01b5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x01b5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x01b5('0x4')]('in','out'),'defaultValue':_0x01b5('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x01b5('0x6')](0xbe)},'phone':{'type':Sequelize[_0x01b5('0x6')]},'readAt':{'type':Sequelize[_0x01b5('0x7')]},'secret':{'type':Sequelize[_0x01b5('0x3')],'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 3cf14a7..c890348 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 _0x7097=['results','groupName','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','destroy','send','index','map','SmsMessage','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','includeAll','include','findAll','rows','params','keys','length','options','find','create','body','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','User','email','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip'];(function(_0x3ee9cc,_0x2dfe30){var _0x2040fb=function(_0xf57ed2){while(--_0xf57ed2){_0x3ee9cc['push'](_0x3ee9cc['shift']());}};_0x2040fb(++_0x2dfe30);}(_0x7097,0x1be));var _0x7709=function(_0x62916e,_0x5a2b6c){_0x62916e=_0x62916e-0x0;var _0xe1277c=_0x7097[_0x62916e];return _0xe1277c;};'use strict';var emlformat=require(_0x7709('0x0'));var rimraf=require(_0x7709('0x1'));var zipdir=require(_0x7709('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7709('0x3'));var BPromise=require(_0x7709('0x4'));var Mustache=require(_0x7709('0x5'));var util=require(_0x7709('0x6'));var path=require(_0x7709('0x7'));var sox=require('sox');var csv=require(_0x7709('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7709('0x9'));var _=require('lodash');var squel=require(_0x7709('0xa'));var crypto=require(_0x7709('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7709('0xc'));var Redis=require(_0x7709('0xd'));var authService=require(_0x7709('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7709('0xf'));var hardwareService=require(_0x7709('0x10'));var logger=require(_0x7709('0x11'))(_0x7709('0x12'));var utils=require(_0x7709('0x13'));var config=require(_0x7709('0x14'));var licenseUtil=require(_0x7709('0x15'));var db=require(_0x7709('0x16'))['db'];config[_0x7709('0x17')]=_[_0x7709('0x18')](config[_0x7709('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7709('0x19'))(new Redis(config['redis']));require(_0x7709('0x1a'))[_0x7709('0x1b')](socket);var jayson=require(_0x7709('0x1c'));var client=jayson[_0x7709('0x1d')][_0x7709('0x1e')]({'port':0x232c});var client9002=jayson[_0x7709('0x1d')][_0x7709('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x29b2cf,_0x407632,_0x365f38,_0x361d3e){return new BPromise(function(_0x18883d,_0x55aac8){var _0x2b2090=_0x361d3e||client;return _0x2b2090[_0x7709('0x1f')](_0x29b2cf,_0x365f38)[_0x7709('0x20')](function(_0x4ea50f){logger[_0x7709('0x21')]('SmsMessage,\x20%s,\x20%s',_0x407632,'request\x20sent');logger[_0x7709('0x22')](_0x7709('0x23'),_0x407632,'request\x20sent',JSON[_0x7709('0x24')](_0x4ea50f));if(_0x4ea50f['error']){if(_0x4ea50f[_0x7709('0x25')]['code']===0x1f4){logger['error'](_0x7709('0x26'),_0x407632,_0x4ea50f[_0x7709('0x25')]['message']);return _0x55aac8(_0x4ea50f['error'][_0x7709('0x27')]);}logger['error'](_0x7709('0x26'),_0x407632,_0x4ea50f[_0x7709('0x25')][_0x7709('0x27')]);return _0x18883d(_0x4ea50f[_0x7709('0x25')][_0x7709('0x27')]);}else{logger[_0x7709('0x21')](_0x7709('0x26'),_0x407632,_0x7709('0x28'));_0x18883d(_0x4ea50f[_0x7709('0x29')][_0x7709('0x27')]);}})[_0x7709('0x2a')](function(_0x35ca8e){logger['error'](_0x7709('0x26'),_0x407632,_0x35ca8e);_0x55aac8(_0x35ca8e);});});}function respondWithStatusCode(_0x1b065b,_0x273e05){_0x273e05=_0x273e05||0xcc;return function(_0x490618){if(_0x490618){return _0x1b065b[_0x7709('0x2b')](_0x273e05);}return _0x1b065b[_0x7709('0x2c')](_0x273e05)[_0x7709('0x2d')]();};}function respondWithResult(_0x5ced5f,_0x35c0e2){_0x35c0e2=_0x35c0e2||0xc8;return function(_0x36baff){if(_0x36baff){return _0x5ced5f[_0x7709('0x2c')](_0x35c0e2)[_0x7709('0x2e')](_0x36baff);}};}function respondWithFilteredResult(_0x2fa3da,_0x379f58){return function(_0x5d473b){if(_0x5d473b){var _0x12b925=typeof _0x379f58[_0x7709('0x2f')]===_0x7709('0x30')&&typeof _0x379f58['limit']==='undefined';var _0x1d420c=_0x5d473b[_0x7709('0x31')];var _0x928391=_0x12b925?0x0:_0x379f58['offset'];var _0x4d856f=_0x12b925?_0x5d473b[_0x7709('0x31')]:_0x379f58['offset']+_0x379f58[_0x7709('0x32')];var _0x5d729b;if(_0x4d856f>=_0x1d420c){_0x4d856f=_0x1d420c;_0x5d729b=0xc8;}else{_0x5d729b=0xce;}_0x2fa3da[_0x7709('0x2c')](_0x5d729b);return _0x2fa3da[_0x7709('0x33')]('Content-Range',_0x928391+'-'+_0x4d856f+'/'+_0x1d420c)[_0x7709('0x2e')](_0x5d473b);}return null;};}function patchUpdates(_0x1a44b3){return function(_0x2da058){try{jsonpatch[_0x7709('0x34')](_0x2da058,_0x1a44b3,!![]);}catch(_0x5ab951){return BPromise[_0x7709('0x35')](_0x5ab951);}return _0x2da058['save']();};}function saveUpdates(_0x30c093,_0x24e382){return function(_0x5d6e4e){if(_0x5d6e4e){return _0x5d6e4e[_0x7709('0x36')](_0x30c093)[_0x7709('0x20')](function(_0x484ca6){return _0x484ca6;});}return null;};}function removeEntity(_0x2726a2,_0x397802){return function(_0x57c9e4){if(_0x57c9e4){return _0x57c9e4[_0x7709('0x37')]()[_0x7709('0x20')](function(){_0x2726a2[_0x7709('0x2c')](0xcc)[_0x7709('0x2d')]();});}};}function handleEntityNotFound(_0x54b54c,_0xc4685c){return function(_0x9802f3){if(!_0x9802f3){_0x54b54c['sendStatus'](0x194);}return _0x9802f3;};}function handleError(_0x154227,_0x22b68e){_0x22b68e=_0x22b68e||0x1f4;return function(_0x3f7d2a){logger[_0x7709('0x25')](_0x3f7d2a['stack']);if(_0x3f7d2a['name']){delete _0x3f7d2a['name'];}_0x154227[_0x7709('0x2c')](_0x22b68e)[_0x7709('0x38')](_0x3f7d2a);};}exports[_0x7709('0x39')]=function(_0xe7dd84,_0x5119c5){var _0x13bd52={},_0x3148d4={},_0x361cfa={'count':0x0,'rows':[]};var _0x5bf06a=_[_0x7709('0x3a')](db[_0x7709('0x3b')][_0x7709('0x3c')],function(_0x13a862){return{'name':_0x13a862['fieldName'],'type':_0x13a862[_0x7709('0x3d')][_0x7709('0x3e')]};});_0x3148d4[_0x7709('0x3f')]=_['map'](_0x5bf06a,_0x7709('0x40'));_0x3148d4[_0x7709('0x41')]=_['keys'](_0xe7dd84[_0x7709('0x41')]);_0x3148d4[_0x7709('0x42')]=_[_0x7709('0x43')](_0x3148d4[_0x7709('0x3f')],_0x3148d4['query']);_0x13bd52[_0x7709('0x44')]=_['intersection'](_0x3148d4['model'],qs[_0x7709('0x45')](_0xe7dd84[_0x7709('0x41')][_0x7709('0x45')]));_0x13bd52['attributes']=_0x13bd52[_0x7709('0x44')]['length']?_0x13bd52['attributes']:_0x3148d4['model'];if(!_0xe7dd84['query'][_0x7709('0x46')]('nolimit')){_0x13bd52[_0x7709('0x32')]=qs[_0x7709('0x32')](_0xe7dd84[_0x7709('0x41')][_0x7709('0x32')]);_0x13bd52[_0x7709('0x2f')]=qs[_0x7709('0x2f')](_0xe7dd84[_0x7709('0x41')][_0x7709('0x2f')]);}_0x13bd52[_0x7709('0x47')]=qs[_0x7709('0x48')](_0xe7dd84[_0x7709('0x41')][_0x7709('0x48')]);_0x13bd52[_0x7709('0x49')]=qs[_0x7709('0x42')](_['pick'](_0xe7dd84['query'],_0x3148d4['filters']),_0x5bf06a);if(_0xe7dd84[_0x7709('0x41')]['filter']){_0x13bd52['where']=_[_0x7709('0x4a')](_0x13bd52['where'],{'$or':_['map'](_0x5bf06a,function(_0x118079){if(_0x118079[_0x7709('0x3d')]!=='VIRTUAL'){var _0x302c78={};_0x302c78[_0x118079[_0x7709('0x40')]]={'$like':'%'+_0xe7dd84['query'][_0x7709('0x4b')]+'%'};return _0x302c78;}})});}_0x13bd52=_[_0x7709('0x4a')]({},_0x13bd52,_0xe7dd84['options']);var _0x505dd3={'where':_0x13bd52[_0x7709('0x49')]};return db[_0x7709('0x3b')]['count'](_0x505dd3)[_0x7709('0x20')](function(_0x2b8ce3){_0x361cfa[_0x7709('0x31')]=_0x2b8ce3;if(_0xe7dd84['query'][_0x7709('0x4c')]){_0x13bd52[_0x7709('0x4d')]=[{'all':!![]}];}return db['SmsMessage'][_0x7709('0x4e')](_0x13bd52);})[_0x7709('0x20')](function(_0x14ccb5){_0x361cfa[_0x7709('0x4f')]=_0x14ccb5;return _0x361cfa;})[_0x7709('0x20')](respondWithFilteredResult(_0x5119c5,_0x13bd52))[_0x7709('0x2a')](handleError(_0x5119c5,null));};exports['show']=function(_0xfa7c,_0x453bd8){var _0x525628={'raw':!![],'where':{'id':_0xfa7c[_0x7709('0x50')]['id']}},_0x4be2cd={};_0x4be2cd[_0x7709('0x3f')]=_[_0x7709('0x51')](db[_0x7709('0x3b')][_0x7709('0x3c')]);_0x4be2cd[_0x7709('0x41')]=_[_0x7709('0x51')](_0xfa7c['query']);_0x4be2cd[_0x7709('0x42')]=_['intersection'](_0x4be2cd['model'],_0x4be2cd[_0x7709('0x41')]);_0x525628[_0x7709('0x44')]=_[_0x7709('0x43')](_0x4be2cd[_0x7709('0x3f')],qs[_0x7709('0x45')](_0xfa7c[_0x7709('0x41')][_0x7709('0x45')]));_0x525628[_0x7709('0x44')]=_0x525628[_0x7709('0x44')][_0x7709('0x52')]?_0x525628[_0x7709('0x44')]:_0x4be2cd['model'];if(_0xfa7c[_0x7709('0x41')]['includeAll']){_0x525628[_0x7709('0x4d')]=[{'all':!![]}];}_0x525628=_['merge']({},_0x525628,_0xfa7c[_0x7709('0x53')]);return db[_0x7709('0x3b')][_0x7709('0x54')](_0x525628)['then'](handleEntityNotFound(_0x453bd8,null))[_0x7709('0x20')](respondWithResult(_0x453bd8,null))[_0x7709('0x2a')](handleError(_0x453bd8,null));};exports[_0x7709('0x55')]=function(_0x271ac2,_0x384384){return db[_0x7709('0x3b')][_0x7709('0x55')](_0x271ac2[_0x7709('0x56')],{})[_0x7709('0x20')](respondWithResult(_0x384384,0xc9))[_0x7709('0x2a')](handleError(_0x384384,null));};exports[_0x7709('0x36')]=function(_0x33e156,_0x164def){if(_0x33e156[_0x7709('0x56')]['id']){delete _0x33e156[_0x7709('0x56')]['id'];}return db['SmsMessage'][_0x7709('0x54')]({'where':{'id':_0x33e156[_0x7709('0x50')]['id']}})[_0x7709('0x20')](handleEntityNotFound(_0x164def,null))[_0x7709('0x20')](saveUpdates(_0x33e156[_0x7709('0x56')],null))['then'](respondWithResult(_0x164def,null))[_0x7709('0x2a')](handleError(_0x164def,null));};exports[_0x7709('0x37')]=function(_0x186daf,_0x5449ab){return db[_0x7709('0x3b')][_0x7709('0x54')]({'where':{'id':_0x186daf[_0x7709('0x50')]['id']}})['then'](handleEntityNotFound(_0x5449ab,null))[_0x7709('0x20')](removeEntity(_0x5449ab,null))[_0x7709('0x2a')](handleError(_0x5449ab,null));};exports[_0x7709('0x57')]=function(_0x567ef1,_0x578faf){return db['SmsMessage']['describe']()['then'](respondWithResult(_0x578faf,null))['catch'](handleError(_0x578faf,null));};var interaction_log=require(_0x7709('0x11'))(_0x7709('0x58'));exports[_0x7709('0x59')]=function(_0x124e83,_0x109614,_0x50aad7){var _0x5978bc={'agent':{},'channel':_0x7709('0x5a')};if(_0x124e83[_0x7709('0x56')]['id']){delete _0x124e83['body']['id'];}_0x124e83['body'][_0x7709('0x5b')]=!![];_0x124e83['body'][_0x7709('0x5c')]=moment()['format'](_0x7709('0x5d'));_0x124e83['body']['UserId']=_0x124e83['body'][_0x7709('0x5e')]||_0x124e83['user']['id'];_0x5978bc[_0x7709('0x5f')]['id']=_0x124e83[_0x7709('0x56')][_0x7709('0x5e')];return db[_0x7709('0x3b')][_0x7709('0x54')]({'where':{'id':_0x124e83[_0x7709('0x50')]['id'],'UserId':null}})[_0x7709('0x20')](handleEntityNotFound(_0x109614,null))[_0x7709('0x20')](saveUpdates(_0x124e83[_0x7709('0x56')],null))[_0x7709('0x20')](function(_0x4d356a){if(_0x4d356a){_0x5978bc[_0x7709('0x27')]=_0x4d356a[_0x7709('0x60')]({'plain':!![]});return db[_0x7709('0x61')][_0x7709('0x54')]({'where':{'id':_0x4d356a[_0x7709('0x62')]}});}return null;})[_0x7709('0x20')](handleEntityNotFound(_0x109614,null))[_0x7709('0x20')](function(_0x2fa55a){if(_0x2fa55a){return _0x2fa55a[_0x7709('0x36')]({'UserId':_0x124e83['body']['UserId'],'read1stAt':_[_0x7709('0x63')](_0x2fa55a[_0x7709('0x64')])?moment()[_0x7709('0x65')](_0x7709('0x5d')):undefined});}return null;})[_0x7709('0x20')](function(_0x5f158d){if(_0x5f158d){_0x5978bc[_0x7709('0x66')]=_0x5f158d['get']({'plain':!![]});interaction_log[_0x7709('0x21')](_0x7709('0x67'),_0x124e83[_0x7709('0x68')]['id'],_0x124e83['user'][_0x7709('0x40')],_0x124e83[_0x7709('0x68')][_0x7709('0x69')],_0x5978bc[_0x7709('0x66')]['id'],_0x124e83[_0x7709('0x56')]?JSON[_0x7709('0x24')](_0x124e83[_0x7709('0x56')]):'null');return respondWithRpcPromise(_0x7709('0x6a'),_0x7709('0x6b'),_0x5978bc);}return null;})[_0x7709('0x20')](function(_0x45cc8d){var _0x2dad03=_0x7709('0x6c')+_0x45cc8d['message'][_0x7709('0x6d')];return db[_0x7709('0x6e')]['query'](_0x2dad03,{'type':db['Sequelize'][_0x7709('0x6f')][_0x7709('0x70')],'raw':!![]})[_0x7709('0x20')](function(_0x123e26){return _0x123e26;});})[_0x7709('0x20')](function(_0x9c6621){if(_0x9c6621){_0x5978bc[_0x7709('0x27')][_0x7709('0x71')]=_0x9c6621[0x0];if(!_0x124e83['body']['UserId'])return;return db['User'][_0x7709('0x54')]({'where':{'id':_0x124e83[_0x7709('0x56')][_0x7709('0x5e')],'role':_0x7709('0x5f')},'attributes':['id','name',_0x7709('0x72'),'email',_0x7709('0x73')],'raw':!![]});}return null;})['then'](function(_0x4248d5){if(!_0x4248d5)return null;_0x5978bc[_0x7709('0x27')]['agent']=_0x4248d5;return _0x5978bc;})[_0x7709('0x20')](function(_0x11d11c){if(_0x11d11c){if(_0x124e83[_0x7709('0x56')][_0x7709('0x74')]){_0x5978bc[_0x7709('0x27')][_0x7709('0x75')]=util[_0x7709('0x65')](_0x7709('0x76'),_0x124e83['user'][_0x7709('0x40')]);_0x5978bc[_0x7709('0x27')]['channel']=_0x5978bc['channel'];_0x5978bc['message'][_0x7709('0x77')]=_0x5978bc[_0x7709('0x78')];_0x5978bc[_0x7709('0x27')][_0x7709('0x79')]=_0x7709('0x59');return respondWithRpcPromise(_0x7709('0x7a'),_0x7709('0x7a'),{'event':_0x7709('0x7b'),'message':_0x5978bc['message']},client9002)[_0x7709('0x20')](function(){return _0x5978bc;});}return _0x5978bc;}return null;})[_0x7709('0x20')](respondWithResult(_0x109614,null))['catch'](handleError(_0x109614,null));};var interaction_log=require(_0x7709('0x11'))(_0x7709('0x58'));exports['reject']=function(_0x5ca44d,_0xfadd95,_0x11b632){var _0x4a9450={'agent':{},'channel':_0x7709('0x5a')};if(_0x5ca44d[_0x7709('0x56')]['id']){delete _0x5ca44d[_0x7709('0x56')]['id'];}_0x5ca44d['body'][_0x7709('0x5e')]=_0x5ca44d[_0x7709('0x56')][_0x7709('0x5e')]||_0x5ca44d[_0x7709('0x68')]['id'];_0x4a9450[_0x7709('0x5f')]['id']=_0x5ca44d[_0x7709('0x56')]['UserId'];return db[_0x7709('0x3b')]['find']({'where':{'id':_0x5ca44d[_0x7709('0x50')]['id'],'UserId':null}})[_0x7709('0x20')](handleEntityNotFound(_0xfadd95,null))[_0x7709('0x20')](function(_0x58adbb){if(_0x58adbb){_0x4a9450[_0x7709('0x27')]=_0x58adbb['get']({'plain':!![]});return db['SmsInteraction'][_0x7709('0x54')]({'where':{'id':_0x58adbb[_0x7709('0x62')]}});}return null;})[_0x7709('0x20')](handleEntityNotFound(_0xfadd95,null))[_0x7709('0x20')](function(_0x5d1777){if(_0x5d1777){_0x4a9450['interaction']=_0x5d1777[_0x7709('0x60')]({'plain':!![]});interaction_log[_0x7709('0x21')](_0x7709('0x7c'),_0x5ca44d[_0x7709('0x68')]['id'],_0x5ca44d[_0x7709('0x68')][_0x7709('0x40')],_0x5ca44d[_0x7709('0x68')][_0x7709('0x69')],_0x4a9450['interaction']['id'],_0x5ca44d[_0x7709('0x56')]?JSON[_0x7709('0x24')](_0x5ca44d[_0x7709('0x56')]):_0x7709('0x7d'));return respondWithRpcPromise(_0x7709('0x7e'),_0x7709('0x7f'),_0x4a9450);}return null;})[_0x7709('0x20')](function(_0x53b739){var _0x4355a4=_0x7709('0x6c')+_0x53b739[_0x7709('0x27')][_0x7709('0x6d')];return db[_0x7709('0x6e')][_0x7709('0x41')](_0x4355a4,{'type':db['Sequelize'][_0x7709('0x6f')]['SELECT'],'raw':!![]})[_0x7709('0x20')](function(_0x3dab79){return _0x3dab79;});})[_0x7709('0x20')](function(_0x2f159c){if(_0x2f159c){_0x4a9450['message']['contact']=_0x2f159c[0x0];if(!_0x5ca44d[_0x7709('0x56')][_0x7709('0x5e')])return;return db[_0x7709('0x80')][_0x7709('0x54')]({'where':{'id':_0x5ca44d[_0x7709('0x56')][_0x7709('0x5e')],'role':'agent'},'attributes':['id',_0x7709('0x40'),'fullname',_0x7709('0x81'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1ba508){if(!_0x1ba508)return null;_0x4a9450[_0x7709('0x27')][_0x7709('0x5f')]=_0x1ba508;return _0x4a9450;})[_0x7709('0x20')](function(_0x36c25f){if(_0x36c25f){_0x36c25f[_0x7709('0x27')][_0x7709('0x75')]=util[_0x7709('0x65')](_0x7709('0x76'),_0x5ca44d[_0x7709('0x68')][_0x7709('0x40')]);_0x36c25f[_0x7709('0x27')]['channel']=_0x4a9450['channel'];_0x36c25f[_0x7709('0x27')][_0x7709('0x77')]=_0x4a9450[_0x7709('0x78')];_0x36c25f[_0x7709('0x27')][_0x7709('0x79')]=_0x7709('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0x7709('0x82'),'message':_0x36c25f[_0x7709('0x27')]},client9002);return _0x4a9450;}return null;})[_0x7709('0x20')](respondWithResult(_0xfadd95,null))['catch'](handleError(_0xfadd95,null));};exports[_0x7709('0x2c')]=function(_0x1afb75,_0x132d7c,_0x395a4d){if(_0x1afb75['body']['id']){delete _0x1afb75[_0x7709('0x56')]['id'];}var _0x25adf0;return db[_0x7709('0x3b')][_0x7709('0x54')]({'where':{'id':_0x1afb75[_0x7709('0x50')]['id']}})[_0x7709('0x20')](handleEntityNotFound(_0x132d7c,null))[_0x7709('0x20')](function(_0x5928b9){if(_0x5928b9){_0x25adf0=_0x5928b9;return db[_0x7709('0x83')][_0x7709('0x54')]({'where':{'id':_0x5928b9['SmsAccountId']}});}})[_0x7709('0x20')](handleEntityNotFound(_0x132d7c,null))[_0x7709('0x20')](function(_0x1ac7eb){if(_0x1ac7eb){logger['debug'](_0x7709('0x23'),'status',_0x7709('0x84'),_0x1ac7eb[_0x7709('0x3d')],util['inspect'](_0x1afb75[_0x7709('0x56')],{'showHidden':![],'depth':null}));switch(_0x1ac7eb[_0x7709('0x3d')]){case _0x7709('0x85'):if(_0x1afb75['body'][_0x7709('0x86')]&&_0x1afb75[_0x7709('0x56')][_0x7709('0x86')]===_0x25adf0['messageId']){return _0x25adf0[_0x7709('0x36')]({'read':!![]});}else{logger[_0x7709('0x25')](_0x7709('0x87'),_0x7709('0x2c'),_0x7709('0x85'),util[_0x7709('0x88')](_0x1afb75['body'],{'showHidden':![],'depth':null}));}break;case _0x7709('0x89'):if(_0x1afb75['body'][_0x7709('0x8a')]&&_0x1afb75[_0x7709('0x56')][_0x7709('0x8a')]===_0x25adf0[_0x7709('0x8b')]&&_[_0x7709('0x8c')]([_0x7709('0x8d'),_0x7709('0x8e')],_0x1afb75[_0x7709('0x56')][_0x7709('0x8f')])>=0x0){return _0x25adf0[_0x7709('0x36')]({'read':!![]});}else{logger[_0x7709('0x25')](_0x7709('0x87'),_0x7709('0x2c'),_0x7709('0x90'),util[_0x7709('0x88')](_0x1afb75['body'],{'showHidden':![],'depth':null}));}break;case _0x7709('0x91'):var _0x784d7a=_0x1afb75[_0x7709('0x56')][_0x7709('0x92')][0x0];if(_0x784d7a[_0x7709('0x2c')][_0x7709('0x93')]==='DELIVERED'){return _0x25adf0[_0x7709('0x36')]({'read':!![]});}else{logger[_0x7709('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7709('0x2c'),_0x7709('0x91'),util['inspect'](_0x1afb75[_0x7709('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x25adf0;}})[_0x7709('0x20')](respondWithResult(_0x132d7c,null))[_0x7709('0x2a')](handleError(_0x132d7c,null));}; \ No newline at end of file +var _0xf811=['SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','map','SmsMessage','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','destroy','describe','sms-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','fullname','email','internal','agent','channel','event','accept','EventManager','acceptmessage','sms','rejectMessage','sequelize','contact','format','SIP/%s','motionChannel','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','sent','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','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','./smsMessage.socket','jayson/promise','client','http','then'];(function(_0x2f6c45,_0x22ccb2){var _0x26cf1c=function(_0x2af465){while(--_0x2af465){_0x2f6c45['push'](_0x2f6c45['shift']());}};_0x26cf1c(++_0x22ccb2);}(_0xf811,0x6f));var _0x1f81=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xf811[_0x22f8ab];return _0x2a70e5;};'use strict';var emlformat=require(_0x1f81('0x0'));var rimraf=require(_0x1f81('0x1'));var zipdir=require(_0x1f81('0x2'));var jsonpatch=require(_0x1f81('0x3'));var rp=require(_0x1f81('0x4'));var moment=require(_0x1f81('0x5'));var BPromise=require(_0x1f81('0x6'));var Mustache=require(_0x1f81('0x7'));var util=require(_0x1f81('0x8'));var path=require(_0x1f81('0x9'));var sox=require(_0x1f81('0xa'));var csv=require(_0x1f81('0xb'));var ejs=require(_0x1f81('0xc'));var fs=require('fs');var fs_extra=require(_0x1f81('0xd'));var _=require('lodash');var squel=require(_0x1f81('0xe'));var crypto=require(_0x1f81('0xf'));var jsforce=require(_0x1f81('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1f81('0xb'));var querystring=require(_0x1f81('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1f81('0x13'));var as=require(_0x1f81('0x14'));var hardwareService=require(_0x1f81('0x15'));var logger=require(_0x1f81('0x16'))(_0x1f81('0x17'));var utils=require(_0x1f81('0x18'));var config=require(_0x1f81('0x19'));var licenseUtil=require(_0x1f81('0x1a'));var db=require(_0x1f81('0x1b'))['db'];config[_0x1f81('0x1c')]=_[_0x1f81('0x1d')](config[_0x1f81('0x1c')],{'host':_0x1f81('0x1e'),'port':0x18eb});var socket=require(_0x1f81('0x1f'))(new Redis(config[_0x1f81('0x1c')]));require(_0x1f81('0x20'))['register'](socket);var jayson=require(_0x1f81('0x21'));var client=jayson[_0x1f81('0x22')]['http']({'port':0x232c});var client9002=jayson['client'][_0x1f81('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1a781d,_0x5da9d1,_0x3c042c,_0x558761){return new BPromise(function(_0x37434a,_0x95a32d){var _0x4bdba8=_0x558761||client;return _0x4bdba8['request'](_0x1a781d,_0x3c042c)[_0x1f81('0x24')](function(_0x1b399e){logger['info'](_0x1f81('0x25'),_0x5da9d1,'request\x20sent');logger[_0x1f81('0x26')](_0x1f81('0x27'),_0x5da9d1,_0x1f81('0x28'),JSON['stringify'](_0x1b399e));if(_0x1b399e[_0x1f81('0x29')]){if(_0x1b399e[_0x1f81('0x29')][_0x1f81('0x2a')]===0x1f4){logger[_0x1f81('0x29')](_0x1f81('0x25'),_0x5da9d1,_0x1b399e[_0x1f81('0x29')]['message']);return _0x95a32d(_0x1b399e[_0x1f81('0x29')][_0x1f81('0x2b')]);}logger[_0x1f81('0x29')]('SmsMessage,\x20%s,\x20%s',_0x5da9d1,_0x1b399e['error'][_0x1f81('0x2b')]);return _0x37434a(_0x1b399e['error'][_0x1f81('0x2b')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x5da9d1,_0x1f81('0x28'));_0x37434a(_0x1b399e['result'][_0x1f81('0x2b')]);}})['catch'](function(_0x21caa5){logger[_0x1f81('0x29')](_0x1f81('0x25'),_0x5da9d1,_0x21caa5);_0x95a32d(_0x21caa5);});});}function respondWithStatusCode(_0x17129b,_0x19dab0){_0x19dab0=_0x19dab0||0xcc;return function(_0x3d9e7a){if(_0x3d9e7a){return _0x17129b[_0x1f81('0x2c')](_0x19dab0);}return _0x17129b[_0x1f81('0x2d')](_0x19dab0)[_0x1f81('0x2e')]();};}function respondWithResult(_0x243bf5,_0x587636){_0x587636=_0x587636||0xc8;return function(_0x292758){if(_0x292758){return _0x243bf5['status'](_0x587636)[_0x1f81('0x2f')](_0x292758);}};}function respondWithFilteredResult(_0x197da5,_0x537166){return function(_0x3d547b){if(_0x3d547b){var _0x186e42=typeof _0x537166[_0x1f81('0x30')]===_0x1f81('0x31')&&typeof _0x537166[_0x1f81('0x32')]===_0x1f81('0x31');var _0x236676=_0x3d547b[_0x1f81('0x33')];var _0x5c70ac=_0x186e42?0x0:_0x537166[_0x1f81('0x30')];var _0x21666b=_0x186e42?_0x3d547b[_0x1f81('0x33')]:_0x537166[_0x1f81('0x30')]+_0x537166[_0x1f81('0x32')];var _0x36edb4;if(_0x21666b>=_0x236676){_0x21666b=_0x236676;_0x36edb4=0xc8;}else{_0x36edb4=0xce;}_0x197da5[_0x1f81('0x2d')](_0x36edb4);return _0x197da5[_0x1f81('0x34')](_0x1f81('0x35'),_0x5c70ac+'-'+_0x21666b+'/'+_0x236676)[_0x1f81('0x2f')](_0x3d547b);}return null;};}function patchUpdates(_0x182565){return function(_0x4b8335){try{jsonpatch[_0x1f81('0x36')](_0x4b8335,_0x182565,!![]);}catch(_0x2254c6){return BPromise[_0x1f81('0x37')](_0x2254c6);}return _0x4b8335[_0x1f81('0x38')]();};}function saveUpdates(_0x5e591a,_0x1d0410){return function(_0x15f596){if(_0x15f596){return _0x15f596[_0x1f81('0x39')](_0x5e591a)['then'](function(_0x56950c){return _0x56950c;});}return null;};}function removeEntity(_0xb1969e,_0x4f092b){return function(_0x3765aa){if(_0x3765aa){return _0x3765aa['destroy']()[_0x1f81('0x24')](function(){_0xb1969e[_0x1f81('0x2d')](0xcc)[_0x1f81('0x2e')]();});}};}function handleEntityNotFound(_0x2230d0,_0x299592){return function(_0x38bc16){if(!_0x38bc16){_0x2230d0[_0x1f81('0x2c')](0x194);}return _0x38bc16;};}function handleError(_0x4e0cce,_0x3ed523){_0x3ed523=_0x3ed523||0x1f4;return function(_0x47ccd5){logger[_0x1f81('0x29')](_0x47ccd5[_0x1f81('0x3a')]);if(_0x47ccd5['name']){delete _0x47ccd5[_0x1f81('0x3b')];}_0x4e0cce[_0x1f81('0x2d')](_0x3ed523)[_0x1f81('0x3c')](_0x47ccd5);};}exports['index']=function(_0x37bcc2,_0x2115de){var _0x42a7eb={},_0x2e46dc={},_0x1df098={'count':0x0,'rows':[]};var _0x499d56=_[_0x1f81('0x3d')](db[_0x1f81('0x3e')]['rawAttributes'],function(_0x5a57d1){return{'name':_0x5a57d1['fieldName'],'type':_0x5a57d1[_0x1f81('0x3f')][_0x1f81('0x40')]};});_0x2e46dc['model']=_['map'](_0x499d56,'name');_0x2e46dc[_0x1f81('0x41')]=_[_0x1f81('0x42')](_0x37bcc2['query']);_0x2e46dc[_0x1f81('0x43')]=_[_0x1f81('0x44')](_0x2e46dc[_0x1f81('0x45')],_0x2e46dc['query']);_0x42a7eb[_0x1f81('0x46')]=_[_0x1f81('0x44')](_0x2e46dc[_0x1f81('0x45')],qs[_0x1f81('0x47')](_0x37bcc2[_0x1f81('0x41')][_0x1f81('0x47')]));_0x42a7eb['attributes']=_0x42a7eb[_0x1f81('0x46')][_0x1f81('0x48')]?_0x42a7eb[_0x1f81('0x46')]:_0x2e46dc[_0x1f81('0x45')];if(!_0x37bcc2['query'][_0x1f81('0x49')](_0x1f81('0x4a'))){_0x42a7eb['limit']=qs[_0x1f81('0x32')](_0x37bcc2['query'][_0x1f81('0x32')]);_0x42a7eb['offset']=qs[_0x1f81('0x30')](_0x37bcc2['query'][_0x1f81('0x30')]);}_0x42a7eb[_0x1f81('0x4b')]=qs[_0x1f81('0x4c')](_0x37bcc2['query'][_0x1f81('0x4c')]);_0x42a7eb[_0x1f81('0x4d')]=qs['filters'](_[_0x1f81('0x4e')](_0x37bcc2[_0x1f81('0x41')],_0x2e46dc[_0x1f81('0x43')]),_0x499d56);if(_0x37bcc2[_0x1f81('0x41')][_0x1f81('0x4f')]){_0x42a7eb[_0x1f81('0x4d')]=_[_0x1f81('0x50')](_0x42a7eb['where'],{'$or':_[_0x1f81('0x3d')](_0x499d56,function(_0x229388){if(_0x229388['type']!==_0x1f81('0x51')){var _0x250340={};_0x250340[_0x229388[_0x1f81('0x3b')]]={'$like':'%'+_0x37bcc2['query'][_0x1f81('0x4f')]+'%'};return _0x250340;}})});}_0x42a7eb=_[_0x1f81('0x50')]({},_0x42a7eb,_0x37bcc2['options']);var _0x38df8c={'where':_0x42a7eb['where']};return db['SmsMessage'][_0x1f81('0x33')](_0x38df8c)[_0x1f81('0x24')](function(_0x337f11){_0x1df098['count']=_0x337f11;if(_0x37bcc2['query'][_0x1f81('0x52')]){_0x42a7eb['include']=[{'all':!![]}];}return db[_0x1f81('0x3e')][_0x1f81('0x53')](_0x42a7eb);})[_0x1f81('0x24')](function(_0x43ab81){_0x1df098[_0x1f81('0x54')]=_0x43ab81;return _0x1df098;})['then'](respondWithFilteredResult(_0x2115de,_0x42a7eb))[_0x1f81('0x55')](handleError(_0x2115de,null));};exports[_0x1f81('0x56')]=function(_0x178538,_0x30767d){var _0x4fca09={'raw':!![],'where':{'id':_0x178538[_0x1f81('0x57')]['id']}},_0x536ef3={};_0x536ef3[_0x1f81('0x45')]=_['keys'](db[_0x1f81('0x3e')]['rawAttributes']);_0x536ef3[_0x1f81('0x41')]=_['keys'](_0x178538[_0x1f81('0x41')]);_0x536ef3['filters']=_[_0x1f81('0x44')](_0x536ef3['model'],_0x536ef3[_0x1f81('0x41')]);_0x4fca09[_0x1f81('0x46')]=_[_0x1f81('0x44')](_0x536ef3['model'],qs[_0x1f81('0x47')](_0x178538[_0x1f81('0x41')][_0x1f81('0x47')]));_0x4fca09[_0x1f81('0x46')]=_0x4fca09['attributes']['length']?_0x4fca09[_0x1f81('0x46')]:_0x536ef3[_0x1f81('0x45')];if(_0x178538[_0x1f81('0x41')]['includeAll']){_0x4fca09[_0x1f81('0x58')]=[{'all':!![]}];}_0x4fca09=_['merge']({},_0x4fca09,_0x178538[_0x1f81('0x59')]);return db['SmsMessage'][_0x1f81('0x5a')](_0x4fca09)[_0x1f81('0x24')](handleEntityNotFound(_0x30767d,null))[_0x1f81('0x24')](respondWithResult(_0x30767d,null))[_0x1f81('0x55')](handleError(_0x30767d,null));};exports[_0x1f81('0x5b')]=function(_0x3eaa0e,_0x2b9ec9){return db['SmsMessage']['create'](_0x3eaa0e[_0x1f81('0x5c')],{})['then'](respondWithResult(_0x2b9ec9,0xc9))[_0x1f81('0x55')](handleError(_0x2b9ec9,null));};exports[_0x1f81('0x39')]=function(_0x5a6dd3,_0x518317){if(_0x5a6dd3['body']['id']){delete _0x5a6dd3['body']['id'];}return db['SmsMessage']['find']({'where':{'id':_0x5a6dd3[_0x1f81('0x57')]['id']}})['then'](handleEntityNotFound(_0x518317,null))[_0x1f81('0x24')](saveUpdates(_0x5a6dd3['body'],null))[_0x1f81('0x24')](respondWithResult(_0x518317,null))[_0x1f81('0x55')](handleError(_0x518317,null));};exports[_0x1f81('0x5d')]=function(_0x7c42e0,_0x3d3122){return db['SmsMessage']['find']({'where':{'id':_0x7c42e0['params']['id']}})[_0x1f81('0x24')](handleEntityNotFound(_0x3d3122,null))['then'](removeEntity(_0x3d3122,null))[_0x1f81('0x55')](handleError(_0x3d3122,null));};exports['describe']=function(_0x4f1c9e,_0x4e2899){return db['SmsMessage'][_0x1f81('0x5e')]()['then'](respondWithResult(_0x4e2899,null))[_0x1f81('0x55')](handleError(_0x4e2899,null));};var interaction_log=require(_0x1f81('0x16'))(_0x1f81('0x5f'));exports['accept']=function(_0x21f7f8,_0xb740c5,_0x35b6cd){var _0x403a45={'agent':{},'channel':'sms'};if(_0x21f7f8[_0x1f81('0x5c')]['id']){delete _0x21f7f8[_0x1f81('0x5c')]['id'];}_0x21f7f8[_0x1f81('0x5c')][_0x1f81('0x60')]=!![];_0x21f7f8[_0x1f81('0x5c')][_0x1f81('0x61')]=moment()['format'](_0x1f81('0x62'));_0x21f7f8[_0x1f81('0x5c')][_0x1f81('0x63')]=_0x21f7f8[_0x1f81('0x5c')]['UserId']||_0x21f7f8[_0x1f81('0x64')]['id'];_0x403a45['agent']['id']=_0x21f7f8[_0x1f81('0x5c')][_0x1f81('0x63')];return db[_0x1f81('0x3e')][_0x1f81('0x5a')]({'where':{'id':_0x21f7f8['params']['id'],'UserId':null}})[_0x1f81('0x24')](handleEntityNotFound(_0xb740c5,null))[_0x1f81('0x24')](saveUpdates(_0x21f7f8[_0x1f81('0x5c')],null))[_0x1f81('0x24')](function(_0x3adc53){if(_0x3adc53){_0x403a45['message']=_0x3adc53[_0x1f81('0x65')]({'plain':!![]});return db[_0x1f81('0x66')][_0x1f81('0x5a')]({'where':{'id':_0x3adc53['SmsInteractionId']}});}return null;})[_0x1f81('0x24')](handleEntityNotFound(_0xb740c5,null))[_0x1f81('0x24')](function(_0x446c95){if(_0x446c95){return _0x446c95[_0x1f81('0x39')]({'UserId':_0x21f7f8['body'][_0x1f81('0x63')],'read1stAt':_['isNil'](_0x446c95['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x581e13){if(_0x581e13){_0x403a45['interaction']=_0x581e13['get']({'plain':!![]});interaction_log[_0x1f81('0x67')](_0x1f81('0x68'),_0x21f7f8[_0x1f81('0x64')]['id'],_0x21f7f8[_0x1f81('0x64')][_0x1f81('0x3b')],_0x21f7f8[_0x1f81('0x64')][_0x1f81('0x69')],_0x403a45[_0x1f81('0x6a')]['id'],_0x21f7f8[_0x1f81('0x5c')]?JSON[_0x1f81('0x6b')](_0x21f7f8['body']):_0x1f81('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x1f81('0x6d'),_0x403a45);}return null;})[_0x1f81('0x24')](function(_0x4f9db7){var _0x359410=_0x1f81('0x6e')+_0x4f9db7[_0x1f81('0x2b')][_0x1f81('0x6f')];return db['sequelize'][_0x1f81('0x41')](_0x359410,{'type':db['Sequelize'][_0x1f81('0x70')][_0x1f81('0x71')],'raw':!![]})['then'](function(_0x4b9a00){return _0x4b9a00;});})['then'](function(_0x464f7e){if(_0x464f7e){_0x403a45[_0x1f81('0x2b')]['contact']=_0x464f7e[0x0];if(!_0x21f7f8[_0x1f81('0x5c')][_0x1f81('0x63')])return;return db[_0x1f81('0x72')]['find']({'where':{'id':_0x21f7f8[_0x1f81('0x5c')][_0x1f81('0x63')],'role':'agent'},'attributes':['id',_0x1f81('0x3b'),_0x1f81('0x73'),_0x1f81('0x74'),_0x1f81('0x75')],'raw':!![]});}return null;})[_0x1f81('0x24')](function(_0x9a32c0){if(!_0x9a32c0)return null;_0x403a45['message'][_0x1f81('0x76')]=_0x9a32c0;return _0x403a45;})[_0x1f81('0x24')](function(_0x1ec8af){if(_0x1ec8af){if(_0x21f7f8[_0x1f81('0x5c')]['manual']){_0x403a45[_0x1f81('0x2b')]['interface']=util['format']('SIP/%s',_0x21f7f8[_0x1f81('0x64')][_0x1f81('0x3b')]);_0x403a45['message'][_0x1f81('0x77')]=_0x403a45[_0x1f81('0x77')];_0x403a45[_0x1f81('0x2b')]['motionChannel']=_0x403a45[_0x1f81('0x77')];_0x403a45[_0x1f81('0x2b')][_0x1f81('0x78')]=_0x1f81('0x79');return respondWithRpcPromise('EventManager',_0x1f81('0x7a'),{'event':_0x1f81('0x7b'),'message':_0x403a45['message']},client9002)[_0x1f81('0x24')](function(){return _0x403a45;});}return _0x403a45;}return null;})[_0x1f81('0x24')](respondWithResult(_0xb740c5,null))[_0x1f81('0x55')](handleError(_0xb740c5,null));};var interaction_log=require(_0x1f81('0x16'))(_0x1f81('0x5f'));exports[_0x1f81('0x37')]=function(_0x454d0a,_0x48a6d2,_0x5bdba8){var _0xab67bc={'agent':{},'channel':_0x1f81('0x7c')};if(_0x454d0a[_0x1f81('0x5c')]['id']){delete _0x454d0a[_0x1f81('0x5c')]['id'];}_0x454d0a['body'][_0x1f81('0x63')]=_0x454d0a[_0x1f81('0x5c')][_0x1f81('0x63')]||_0x454d0a['user']['id'];_0xab67bc['agent']['id']=_0x454d0a[_0x1f81('0x5c')][_0x1f81('0x63')];return db[_0x1f81('0x3e')][_0x1f81('0x5a')]({'where':{'id':_0x454d0a[_0x1f81('0x57')]['id'],'UserId':null}})[_0x1f81('0x24')](handleEntityNotFound(_0x48a6d2,null))[_0x1f81('0x24')](function(_0x163a22){if(_0x163a22){_0xab67bc[_0x1f81('0x2b')]=_0x163a22[_0x1f81('0x65')]({'plain':!![]});return db['SmsInteraction'][_0x1f81('0x5a')]({'where':{'id':_0x163a22['SmsInteractionId']}});}return null;})[_0x1f81('0x24')](handleEntityNotFound(_0x48a6d2,null))[_0x1f81('0x24')](function(_0x396474){if(_0x396474){_0xab67bc[_0x1f81('0x6a')]=_0x396474[_0x1f81('0x65')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x454d0a['user']['id'],_0x454d0a['user']['name'],_0x454d0a[_0x1f81('0x64')][_0x1f81('0x69')],_0xab67bc['interaction']['id'],_0x454d0a[_0x1f81('0x5c')]?JSON[_0x1f81('0x6b')](_0x454d0a[_0x1f81('0x5c')]):_0x1f81('0x6c'));return respondWithRpcPromise('RejectMessage',_0x1f81('0x7d'),_0xab67bc);}return null;})[_0x1f81('0x24')](function(_0x2be186){var _0xa38ee3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2be186['message'][_0x1f81('0x6f')];return db[_0x1f81('0x7e')][_0x1f81('0x41')](_0xa38ee3,{'type':db['Sequelize'][_0x1f81('0x70')][_0x1f81('0x71')],'raw':!![]})[_0x1f81('0x24')](function(_0x5d0297){return _0x5d0297;});})[_0x1f81('0x24')](function(_0x3d44a6){if(_0x3d44a6){_0xab67bc[_0x1f81('0x2b')][_0x1f81('0x7f')]=_0x3d44a6[0x0];if(!_0x454d0a[_0x1f81('0x5c')][_0x1f81('0x63')])return;return db[_0x1f81('0x72')][_0x1f81('0x5a')]({'where':{'id':_0x454d0a[_0x1f81('0x5c')][_0x1f81('0x63')],'role':_0x1f81('0x76')},'attributes':['id',_0x1f81('0x3b'),'fullname',_0x1f81('0x74'),_0x1f81('0x75')],'raw':!![]});}return null;})[_0x1f81('0x24')](function(_0x427550){if(!_0x427550)return null;_0xab67bc['message']['agent']=_0x427550;return _0xab67bc;})['then'](function(_0x13de15){if(_0x13de15){_0x13de15[_0x1f81('0x2b')]['interface']=util[_0x1f81('0x80')](_0x1f81('0x81'),_0x454d0a[_0x1f81('0x64')]['name']);_0x13de15[_0x1f81('0x2b')][_0x1f81('0x77')]=_0xab67bc[_0x1f81('0x77')];_0x13de15[_0x1f81('0x2b')][_0x1f81('0x82')]=_0xab67bc[_0x1f81('0x77')];_0x13de15['message'][_0x1f81('0x78')]='reject';respondWithRpcPromise(_0x1f81('0x7a'),'EventManager',{'event':'rejectmessage','message':_0x13de15[_0x1f81('0x2b')]},client9002);return _0xab67bc;}return null;})[_0x1f81('0x24')](respondWithResult(_0x48a6d2,null))[_0x1f81('0x55')](handleError(_0x48a6d2,null));};exports['status']=function(_0x400e11,_0x5079bd,_0x130eba){if(_0x400e11[_0x1f81('0x5c')]['id']){delete _0x400e11['body']['id'];}var _0x453fab;return db[_0x1f81('0x3e')][_0x1f81('0x5a')]({'where':{'id':_0x400e11['params']['id']}})['then'](handleEntityNotFound(_0x5079bd,null))['then'](function(_0x445c65){if(_0x445c65){_0x453fab=_0x445c65;return db[_0x1f81('0x83')]['find']({'where':{'id':_0x445c65[_0x1f81('0x84')]}});}})[_0x1f81('0x24')](handleEntityNotFound(_0x5079bd,null))['then'](function(_0x482ee3){if(_0x482ee3){logger['debug'](_0x1f81('0x27'),_0x1f81('0x2d'),_0x1f81('0x85'),_0x482ee3[_0x1f81('0x3f')],util['inspect'](_0x400e11[_0x1f81('0x5c')],{'showHidden':![],'depth':null}));switch(_0x482ee3['type']){case _0x1f81('0x86'):if(_0x400e11[_0x1f81('0x5c')]['MessageSid']&&_0x400e11[_0x1f81('0x5c')][_0x1f81('0x87')]===_0x453fab[_0x1f81('0x88')]){return _0x453fab[_0x1f81('0x39')]({'read':!![]});}else{logger[_0x1f81('0x29')](_0x1f81('0x89'),_0x1f81('0x2d'),_0x1f81('0x86'),util[_0x1f81('0x8a')](_0x400e11['body'],{'showHidden':![],'depth':null}));}break;case _0x1f81('0x8b'):if(_0x400e11[_0x1f81('0x5c')][_0x1f81('0x8c')]&&_0x400e11['body'][_0x1f81('0x8c')]===_0x453fab[_0x1f81('0x88')]&&_['indexOf']([_0x1f81('0x8d'),'delivered'],_0x400e11['body'][_0x1f81('0x8e')])>=0x0){return _0x453fab['update']({'read':!![]});}else{logger[_0x1f81('0x29')](_0x1f81('0x89'),'status',_0x1f81('0x8f'),util[_0x1f81('0x8a')](_0x400e11[_0x1f81('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x1f81('0x90'):var _0x55ffbb=_0x400e11[_0x1f81('0x5c')][_0x1f81('0x91')][0x0];if(_0x55ffbb[_0x1f81('0x2d')][_0x1f81('0x92')]===_0x1f81('0x93')){return _0x453fab[_0x1f81('0x39')]({'read':!![]});}else{logger['error'](_0x1f81('0x89'),'status','infobip',util[_0x1f81('0x8a')](_0x400e11[_0x1f81('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x453fab;}})[_0x1f81('0x24')](respondWithResult(_0x5079bd,null))[_0x1f81('0x55')](handleError(_0x5079bd,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index b31e45e..e30505d 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 _0xaaad=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','SmsMessage'];(function(_0x2f7dd5,_0x2ff089){var _0x5acbd6=function(_0x3303e6){while(--_0x3303e6){_0x2f7dd5['push'](_0x2f7dd5['shift']());}};_0x5acbd6(++_0x2ff089);}(_0xaaad,0x115));var _0xdaaa=function(_0x3f3835,_0x4ad60c){_0x3f3835=_0x3f3835-0x0;var _0x131b9c=_0xaaad[_0x3f3835];return _0x131b9c;};'use strict';var EventEmitter=require(_0xdaaa('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xdaaa('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdaaa('0x2')](0x0);var events={'afterCreate':_0xdaaa('0x3'),'afterUpdate':'update','afterDestroy':_0xdaaa('0x4')};function emitEvent(_0x3ca04b){return function(_0x294542,_0x59af8a,_0x21a20f){SmsMessageEvents[_0xdaaa('0x5')](_0x3ca04b+':'+_0x294542['id'],_0x294542);SmsMessageEvents['emit'](_0x3ca04b,_0x294542);_0x21a20f(null);};}for(var e in events){if(events[_0xdaaa('0x6')](e)){var event=events[e];SmsMessage[_0xdaaa('0x7')](e,emitEvent(event));}}module[_0xdaaa('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xb9eb=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0x240264,_0x1a6210){var _0x37d24c=function(_0x49f986){while(--_0x49f986){_0x240264['push'](_0x240264['shift']());}};_0x37d24c(++_0x1a6210);}(_0xb9eb,0x1bc));var _0xbb9e=function(_0x37d7ae,_0x2f4b9b){_0x37d7ae=_0x37d7ae-0x0;var _0x543b54=_0xb9eb[_0x37d7ae];return _0x543b54;};'use strict';var EventEmitter=require(_0xbb9e('0x0'));var SmsMessage=require(_0xbb9e('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbb9e('0x2'),'afterUpdate':_0xbb9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x451c12){return function(_0x2d423b,_0x2b7145,_0x1e5036){SmsMessageEvents[_0xbb9e('0x4')](_0x451c12+':'+_0x2d423b['id'],_0x2d423b);SmsMessageEvents['emit'](_0x451c12,_0x2d423b);_0x1e5036(null);};}for(var e in events){if(events[_0xbb9e('0x5')](e)){var event=events[e];SmsMessage[_0xbb9e('0x6')](e,emitEvent(event));}}module[_0xbb9e('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index a26fea7..bbd5f8e 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 _0x14a6=['sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','GET','split','sms','POST','session_key','total_sent','internal_order_id','inspect','connectel','requestid','deliveryReport','Missing\x20parameters:\x20authToken','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','http_code','data','queued_count','head','message_id','read','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','token','Missing\x20parameters:\x20base_url','csc','crypto','sender','text','timestamp','keys','sort','length','apiKey','md5','digest','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','refid','Token\x20not\x20received','finally','utf8mb4','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token='];(function(_0x1ac0b6,_0x37b48b){var _0x155f39=function(_0x55f7e8){while(--_0x55f7e8){_0x1ac0b6['push'](_0x1ac0b6['shift']());}};_0x155f39(++_0x37b48b);}(_0x14a6,0xc7));var _0x614a=function(_0x3d90b4,_0x1e2fc6){_0x3d90b4=_0x3d90b4-0x0;var _0x4c65d3=_0x14a6[_0x3d90b4];return _0x4c65d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x614a('0x0'))('api');var moment=require(_0x614a('0x1'));var BPromise=require(_0x614a('0x2'));var rp=require(_0x614a('0x3'));var fs=require('fs');var path=require(_0x614a('0x4'));var rimraf=require('rimraf');var config=require(_0x614a('0x5'));var attributes=require('./smsMessage.attributes');module[_0x614a('0x6')]=function(_0x47db87,_0x1c4e67){return _0x47db87[_0x614a('0x7')](_0x614a('0x8'),attributes,{'tableName':_0x614a('0x9'),'paranoid':![],'indexes':[{'name':_0x614a('0xa'),'fields':[_0x614a('0xa')]},{'name':_0x614a('0xb'),'fields':[_0x614a('0xc')],'type':_0x614a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x116dca,_0x12747a,_0x3ca4ec){var _0x4b5aff=_0x47db87[_0x614a('0xe')];var _0xf77d15=_0x116dca[_0x614a('0xf')]({'plain':!![]});if(_0xf77d15['direction']['toLowerCase']()==='in'||_0xf77d15[_0x614a('0x10')][_0x614a('0x11')]()===_0x614a('0x12')&&!_0xf77d15[_0x614a('0x13')]&&!_[_0x614a('0x14')](_0xf77d15['UserId'])&&!_[_0x614a('0x14')](_0xf77d15[_0x614a('0x15')])){_0x4b5aff['SmsInteraction'][_0x614a('0x16')]({'where':{'id':_0xf77d15[_0x614a('0x15')]}})[_0x614a('0x17')](function(_0x11ed49){if(_0x11ed49){_0x11ed49[_0x614a('0x18')]({'lastMsgAt':_0xf77d15[_0x614a('0x19')],'lastMsgDirection':_0xf77d15[_0x614a('0x10')][_0x614a('0x11')]()});}})[_0x614a('0x1a')](function(_0x36b0db){console[_0x614a('0x1b')](_0x36b0db);});}if(_0xf77d15['direction']===_0x614a('0x12')&&!_0xf77d15[_0x614a('0x13')]){var _0x2f8bc1;_0x4b5aff[_0x614a('0x1c')][_0x614a('0x1d')]({'where':{'id':_0xf77d15[_0x614a('0x1e')]},'raw':!![]})[_0x614a('0x17')](function(_0x28e3c8){_0x2f8bc1=_0x28e3c8;if(_0x2f8bc1&&_0x2f8bc1['type']){switch(_0x2f8bc1[_0x614a('0x1f')]){case'twilio':var _0x45b3e0=require(_0x614a('0x20'));if(_0x2f8bc1[_0x614a('0x21')]&&_0x2f8bc1[_0x614a('0x22')]&&_0x2f8bc1['phone']){var _0x457124=new _0x45b3e0(_0x2f8bc1['accountSid'],_0x2f8bc1[_0x614a('0x22')]);_0x457124[_0x614a('0x23')][_0x614a('0x24')]({'body':_0xf77d15[_0x614a('0xc')],'to':_0xf77d15[_0x614a('0x25')],'from':_0x2f8bc1[_0x614a('0x25')],'statusCallback':_0x2f8bc1[_0x614a('0x26')]+_0x614a('0x27')+_0xf77d15['id']+_0x614a('0x28')+_0x2f8bc1['token']})[_0x614a('0x17')](function(_0xaf956c){if(_0xaf956c[_0x614a('0x29')]){return _0x116dca['update']({'messageId':_0xaf956c[_0x614a('0x29')]});}})[_0x614a('0x1a')](function(_0x21e8de){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x614a('0x20'),util['inspect'](_0x21e8de,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x20'),_0x614a('0x2c'));}break;case _0x614a('0x2d'):var _0x4c73d3='https://api.skebby.it/API/v1.0/REST/';if(_0x2f8bc1[_0x614a('0x2e')]&&_0x2f8bc1[_0x614a('0x2f')]){var _0x4ebf01={'recipient':[_0xf77d15[_0x614a('0x25')]],'message':_0xf77d15[_0x614a('0xc')],'message_type':_0x2f8bc1[_0x614a('0x30')]};if(_0x2f8bc1[_0x614a('0x30')]&&_0x2f8bc1[_0x614a('0x30')]!=='SI'){_0x4ebf01['sender']=_0x2f8bc1['phone'];}var _0x3580b9={'url':_0x4c73d3+_0x614a('0x31')+_0x2f8bc1[_0x614a('0x2e')]+'&password='+_0x2f8bc1['password'],'method':_0x614a('0x32')};rp(_0x3580b9)[_0x614a('0x17')](function(_0x19b78c){var _0x137b71=_0x19b78c[_0x614a('0x33')](';');var _0xd7072a={'user_key':_0x137b71[0x0],'session_key':_0x137b71[0x1]};_0x3580b9={'url':_0x4c73d3+_0x614a('0x34'),'method':_0x614a('0x35'),'headers':{'user_key':_0xd7072a['user_key'],'Session_key':_0xd7072a[_0x614a('0x36')]},'json':!![],'body':_0x4ebf01};return rp(_0x3580b9);})[_0x614a('0x17')](function(_0x5746fa){if(_0x5746fa[_0x614a('0x37')]>=0x1){var _0x503ee2={'messageId':_0x5746fa[_0x614a('0x38')]};if(_0x2f8bc1['smsMethod']!=='GP'||!_0x2f8bc1['deliveryReport']){_0x503ee2['read']=!![];}return _0x116dca['update'](_0x503ee2);}else{return logger[_0x614a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x614a('0x2b'),_0x614a('0x2d'),util[_0x614a('0x39')](_0x5746fa,{'showHidden':![],'depth':null}));}})[_0x614a('0x1a')](function(_0x2a37c8){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x614a('0x2d'),util['inspect'](_0x2a37c8,{'showHidden':![],'depth':null}));});}else{logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x614a('0x3a'):if(_0x2f8bc1[_0x614a('0x22')]){var _0x55e2f3={'recipient':_0xf77d15['phone'],'message':_0xf77d15['body'],'sender':_0x2f8bc1['senderString']||_0x2f8bc1[_0x614a('0x25')],'authorization':_0x2f8bc1[_0x614a('0x22')]};var _0x12747a={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x55e2f3,'json':!![]};rp(_0x12747a)[_0x614a('0x17')](function(_0x265e38){var _0x5cb7a8={'messageId':_0x265e38[_0x614a('0x3b')]};if(!_0x2f8bc1[_0x614a('0x3c')]){_0x5cb7a8['read']=!![];}return _0x116dca[_0x614a('0x18')](_0x5cb7a8);})[_0x614a('0x1a')](function(_0x2e610f){logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x3a'),util[_0x614a('0x39')](_0x2e610f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x3a'),_0x614a('0x3d'));}break;case'clicksend':if(_0x2f8bc1[_0x614a('0x2e')]&&_0x2f8bc1[_0x614a('0x2f')]){var _0x55e2f3={'messages':[{'source':'xCALLY\x20Motion','to':_0xf77d15[_0x614a('0x25')],'body':_0xf77d15[_0x614a('0xc')],'from':_0x2f8bc1[_0x614a('0x3e')]||_0x2f8bc1[_0x614a('0x25')]}]};var _0x4010f9=util[_0x614a('0x3f')](_0x614a('0x40'),_0x2f8bc1[_0x614a('0x2e')],_0x2f8bc1[_0x614a('0x2f')]);var _0x12747a={'method':'POST','uri':_0x614a('0x41'),'body':_0x55e2f3,'headers':{'Authorization':util[_0x614a('0x3f')]('Basic\x20%s',new Buffer(_0x4010f9)[_0x614a('0x42')]('base64'))},'json':!![]};rp(_0x12747a)[_0x614a('0x17')](function(_0x440c55){if(_0x440c55[_0x614a('0x43')]>=0xc8&&_0x440c55[_0x614a('0x43')]<=0xce){if(_0x440c55[_0x614a('0x44')]&&_0x440c55['data'][_0x614a('0x45')]>0x0){var _0x57e0d8=_[_0x614a('0x46')](_0x440c55['data'][_0x614a('0x23')]);var _0x1514c8={'messageId':_0x57e0d8[_0x614a('0x47')]};if(!_0x2f8bc1[_0x614a('0x3c')]){_0x1514c8[_0x614a('0x48')]=!![];}return _0x116dca[_0x614a('0x18')](_0x1514c8);}else{logger[_0x614a('0x1b')](_0x614a('0x2a'),'afterCreate',_0x614a('0x49'),util[_0x614a('0x39')](_0x440c55,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x49'),util[_0x614a('0x39')](_0x440c55,{'showHidden':![],'depth':null}));}})[_0x614a('0x1a')](function(_0x7670e6){logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),'clickSend',util[_0x614a('0x39')](_0x7670e6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x614a('0x2a'),'afterCreate',_0x614a('0x49'),_0x614a('0x4a'));}break;case _0x614a('0x4b'):if(_0x2f8bc1[_0x614a('0x4c')]&&_0x2f8bc1[_0x614a('0x22')]){var _0x55e2f3={'dst':_0xf77d15[_0x614a('0x25')],'text':_0xf77d15[_0x614a('0xc')],'src':_0x2f8bc1[_0x614a('0x3e')]||_0x2f8bc1[_0x614a('0x25')],'url':_0x2f8bc1[_0x614a('0x26')]+_0x614a('0x27')+_0xf77d15['id']+'/status?token='+_0x2f8bc1['token']};var _0x4010f9=util[_0x614a('0x3f')](_0x614a('0x40'),_0x2f8bc1[_0x614a('0x4c')],_0x2f8bc1[_0x614a('0x22')]);var _0x12747a={'method':_0x614a('0x35'),'uri':util[_0x614a('0x3f')](_0x614a('0x4d'),_0x2f8bc1[_0x614a('0x4c')]),'body':_0x55e2f3,'headers':{'Authorization':util[_0x614a('0x3f')](_0x614a('0x4e'),new Buffer(_0x4010f9)[_0x614a('0x42')](_0x614a('0x4f')))},'json':!![]};rp(_0x12747a)['then'](function(_0x14664e){var _0x1d66e5={'messageId':_0x14664e[_0x614a('0x50')][0x0]};return _0x116dca[_0x614a('0x18')](_0x1d66e5);})[_0x614a('0x1a')](function(_0x201f11){logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x4b'),util[_0x614a('0x39')](_0x201f11,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x4b'),_0x614a('0x51'));}break;case _0x614a('0x52'):if(_0x2f8bc1['username']&&_0x2f8bc1[_0x614a('0x2f')]){if(_0x2f8bc1[_0x614a('0x53')]){var _0x25e7a3={'method':_0x614a('0x35'),'uri':_0x2f8bc1[_0x614a('0x53')]+'/auth/1/session','body':{'username':_0x2f8bc1[_0x614a('0x2e')],'password':_0x2f8bc1['password']},'json':!![]};return rp(_0x25e7a3)[_0x614a('0x17')](function(_0x41769d){var _0x59ae06={'method':_0x614a('0x35'),'uri':_0x2f8bc1[_0x614a('0x53')]+_0x614a('0x54'),'body':{'messages':[{'from':_0x2f8bc1[_0x614a('0x25')],'destinations':[{'to':_0xf77d15[_0x614a('0x25')]}],'text':_0xf77d15[_0x614a('0xc')],'notifyUrl':_0x2f8bc1['remote']+_0x614a('0x27')+_0xf77d15['id']+_0x614a('0x28')+_0x2f8bc1['token'],'notifyContentType':_0x614a('0x55'),'callbackData':_0x2f8bc1[_0x614a('0x25')]+';'+_0xf77d15[_0x614a('0xc')]}]},'headers':{'Authorization':_0x614a('0x56')+_0x41769d[_0x614a('0x57')]},'json':!![]};return rp(_0x59ae06)[_0x614a('0x17')](function(_0x5d1fc2){if(_0x5d1fc2[_0x614a('0x23')]){var _0x15e644={'messageId':_0x5d1fc2[_0x614a('0x23')][0x0][_0x614a('0xa')]};if(!_0x2f8bc1[_0x614a('0x3c')]){_0x15e644[_0x614a('0x48')]=!![];}return _0x116dca[_0x614a('0x18')](_0x15e644);}else{return logger[_0x614a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x614a('0x2b'),'infobip',util[_0x614a('0x39')](_0x5d1fc2,{'showHidden':![],'depth':null}));}});})[_0x614a('0x1a')](function(_0x13d159){return logger[_0x614a('0x1b')](_0x614a('0x2a'),'afterCreate',_0x614a('0x52'),util[_0x614a('0x39')](_0x13d159,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x52'),_0x614a('0x58'));}}else{logger['error'](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x614a('0x59'):var _0x2f2629=require(_0x614a('0x5a'));if(_0x2f8bc1['apiKey']){var _0x1a03fa={};_0x1a03fa['login']=_0x2f8bc1[_0x614a('0x2e')];_0x1a03fa[_0x614a('0x25')]=_0xf77d15['phone'];_0x1a03fa[_0x614a('0x5b')]=_0x2f8bc1['phone'];_0x1a03fa[_0x614a('0x5c')]=_0xf77d15['body'];_0x1a03fa[_0x614a('0x5d')]=+new Date();var _0x32d825='';var _0x110201='';var _0x623173=Object[_0x614a('0x5e')](_0x1a03fa);_0x623173[_0x614a('0x5f')]();for(var _0x20ca3c=0x0;_0x20ca3c<_0x623173[_0x614a('0x60')];_0x20ca3c++){if(_0x32d825!=''){_0x32d825+='&';}_0x32d825+=_0x623173[_0x20ca3c]+'='+encodeURIComponent(_0x1a03fa[_0x623173[_0x20ca3c]]);_0x110201+=_0x1a03fa[_0x623173[_0x20ca3c]];}_0x110201+=_0x2f8bc1[_0x614a('0x61')];_0x110201=_0x2f2629['createHash'](_0x614a('0x62'))[_0x614a('0x18')](_0x110201)[_0x614a('0x63')]('hex');if(_0x32d825!==''){_0x32d825+='&';}_0x32d825+=_0x614a('0x64')+_0x110201;var _0x3580b9={'method':'GET','uri':_0x2f8bc1['baseUrl']+_0x614a('0x65')+_0x32d825,'json':!![]};return rp(_0x3580b9)['then'](function(_0x85150e){var _0x25e90b=Object[_0x614a('0x5e')](_0x85150e);if(_0x85150e[_0x25e90b[0x0]]['error']&&parseInt(_0x85150e[_0x25e90b[0x0]][_0x614a('0x1b')])===0x0){var _0xb0da2={'messageId':_0x85150e[_0x25e90b[0x0]]['id_sms']};if(!_0x2f8bc1[_0x614a('0x3c')]){_0xb0da2[_0x614a('0x48')]=!![];}return _0x116dca[_0x614a('0x18')](_0xb0da2);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x614a('0x2b'),_0x614a('0x59'),util[_0x614a('0x39')](_0x85150e['error'],{'showHidden':![],'depth':null}));}})[_0x614a('0x1a')](function(_0x43edec){return logger['error'](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x59'),util[_0x614a('0x39')](_0x43edec,{'showHidden':![],'depth':null}));});}else{logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x59'),_0x614a('0x66'));}break;case _0x614a('0x67'):if(_0x2f8bc1[_0x614a('0x61')]){var _0x34c817={'method':_0x614a('0x35'),'uri':_0x614a('0x68'),'headers':{'Authorization':_0x2f8bc1[_0x614a('0x61')]},'body':{'content':_0xf77d15[_0x614a('0xc')],'to':[_0xf77d15[_0x614a('0x25')]],'from':_0x2f8bc1['phone'],'binary':![],'clientMessageId':_0x614a('0x69'),'charset':_0x614a('0x6a')},'json':!![]};rp(_0x34c817)[_0x614a('0x17')](function(_0x1bdfe2){if(!_0x1bdfe2[_0x614a('0x1b')]){var _0x5a66e6={'messageId':_0x1bdfe2[_0x614a('0x23')][0x0][_0x614a('0x6b')]};if(!_0x2f8bc1['deliveryReport']){_0x5a66e6[_0x614a('0x48')]=!![];}return _0x116dca[_0x614a('0x18')](_0x5a66e6);}else{return logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),'clickatell',util[_0x614a('0x39')](_0x1bdfe2[_0x614a('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x17131b){return logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x67'),util[_0x614a('0x39')](_0x17131b,{'showHidden':![],'depth':null}));});}else{logger[_0x614a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x614a('0x67'),_0x614a('0x66'));}break;case'bandwidth':if(_0x2f8bc1[_0x614a('0x2e')]&&_0x2f8bc1[_0x614a('0x2f')]){var _0x4010f9=util[_0x614a('0x3f')](_0x614a('0x40'),_0x2f8bc1['username'],_0x2f8bc1[_0x614a('0x2f')]);var _0x12747a={'method':_0x614a('0x35'),'uri':_0x614a('0x6c')+_0x2f8bc1[_0x614a('0x6d')]+_0x614a('0x6e'),'body':{'to':[_0xf77d15[_0x614a('0x25')]],'text':_0xf77d15[_0x614a('0xc')],'from':_0x2f8bc1['phone'],'applicationId':_0x2f8bc1['applicationId']},'headers':{'Authorization':util[_0x614a('0x3f')](_0x614a('0x4e'),new Buffer(_0x4010f9)['toString']('base64'))},'json':!![]};rp(_0x12747a)[_0x614a('0x17')](function(_0x1df28c){if(_0x1df28c['id']){var _0x2f3420={'messageId':_0x1df28c['id']};return _0x116dca[_0x614a('0x18')](_0x2f3420);}else{logger[_0x614a('0x1b')](_0x614a('0x2a'),'afterCreate',_0x614a('0x6f'),util[_0x614a('0x39')](_0x1df28c,{'showHidden':![],'depth':null}));}})[_0x614a('0x1a')](function(_0xd05782){logger['error'](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x6f'),util[_0x614a('0x39')](_0xd05782,{'showHidden':![],'depth':null}));});}else{logger[_0x614a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x614a('0x2b'),_0x614a('0x6f'),_0x614a('0x4a'));}break;case _0x614a('0x70'):if(_0x2f8bc1['apiKey']){var _0x3edb49={};var _0x3580b9={'method':_0x614a('0x35'),'uri':_0x614a('0x71'),'headers':{'Authorization':_0x614a('0x72')+_0x2f8bc1[_0x614a('0x61')],'Content-Type':_0x614a('0x55')},'body':{'from':_0x2f8bc1[_0x614a('0x25')],'to':_0xf77d15[_0x614a('0x25')],'text':_0xf77d15[_0x614a('0xc')]},'json':!![]};return rp(_0x3580b9)[_0x614a('0x17')](function(_0x100d38){if(_0x100d38['code']==0xca){_0x3edb49['message']=_0x100d38;var _0x1997f8={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x614a('0x72')+_0x2f8bc1[_0x614a('0x61')],'Content-Type':_0x614a('0x55')},'body':{'refid':_0x3edb49[_0x614a('0x73')][_0x614a('0x74')]},'json':!![]};return rp(_0x1997f8)[_0x614a('0x17')](function(_0x51c10b){_0x3edb49['status']=_0x51c10b;var _0x2c9dd1={'messageId':_0x3edb49['message'][_0x614a('0x74')],'read':!![]};return _0x116dca['update'](_0x2c9dd1);});}else{return logger[_0x614a('0x1b')](_0x614a('0x2a'),'afterCreate',_0x614a('0x70'),util[_0x614a('0x39')](_0x100d38,{'showHidden':![],'depth':null}));}})[_0x614a('0x1a')](function(_0x4c9d66){return logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x70'),util[_0x614a('0x39')](_0x4c9d66,{'showHidden':![],'depth':null}));});}else{return logger[_0x614a('0x1b')](_0x614a('0x2a'),_0x614a('0x2b'),_0x614a('0x70'),_0x614a('0x75'));}break;}}})[_0x614a('0x76')](function(){_0x3ca4ec();});}else{_0x3ca4ec();}}},'charset':_0x614a('0x77'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xabb4=['total_sent','deliveryReport','read','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','password','Basic\x20%s','base64','http_code','data','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','login','timestamp','keys','sort','length','apiKey','createHash','digest','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','createdAt','catch','SmsAccount','find','then','type','twilio','phone','accountSid','authToken','messages','create','/api/sms/messages/','/status?token=','token','update','sid','error','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','body','smsMethod','sender','login?username=','&password=','GET','POST','user_key','session_key'];(function(_0xa66363,_0x1944fe){var _0x4f1161=function(_0x4166b2){while(--_0x4166b2){_0xa66363['push'](_0xa66363['shift']());}};_0x4f1161(++_0x1944fe);}(_0xabb4,0xc1));var _0x4abb=function(_0x20c56d,_0x350e3d){_0x20c56d=_0x20c56d-0x0;var _0x3dce2a=_0xabb4[_0x20c56d];return _0x3dce2a;};'use strict';var _=require('lodash');var util=require(_0x4abb('0x0'));var logger=require(_0x4abb('0x1'))(_0x4abb('0x2'));var moment=require(_0x4abb('0x3'));var BPromise=require(_0x4abb('0x4'));var rp=require(_0x4abb('0x5'));var fs=require('fs');var path=require(_0x4abb('0x6'));var rimraf=require(_0x4abb('0x7'));var config=require(_0x4abb('0x8'));var attributes=require(_0x4abb('0x9'));module[_0x4abb('0xa')]=function(_0x3eb7f3,_0x5f2639){return _0x3eb7f3[_0x4abb('0xb')]('SmsMessage',attributes,{'tableName':_0x4abb('0xc'),'paranoid':![],'indexes':[{'name':_0x4abb('0xd'),'fields':[_0x4abb('0xd')]},{'name':_0x4abb('0xe'),'fields':['body'],'type':_0x4abb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa652bf,_0xa56405,_0x1c4c72){var _0x5e38a8=_0x3eb7f3[_0x4abb('0x10')];var _0x313af1=_0xa652bf[_0x4abb('0x11')]({'plain':!![]});if(_0x313af1['direction'][_0x4abb('0x12')]()==='in'||_0x313af1[_0x4abb('0x13')][_0x4abb('0x12')]()===_0x4abb('0x14')&&!_0x313af1[_0x4abb('0x15')]&&!_['isNil'](_0x313af1[_0x4abb('0x16')])&&!_[_0x4abb('0x17')](_0x313af1[_0x4abb('0x18')])){_0x5e38a8[_0x4abb('0x19')][_0x4abb('0x1a')]({'where':{'id':_0x313af1[_0x4abb('0x18')]}})['then'](function(_0x336d1a){if(_0x336d1a){_0x336d1a['update']({'lastMsgAt':_0x313af1[_0x4abb('0x1b')],'lastMsgDirection':_0x313af1[_0x4abb('0x13')][_0x4abb('0x12')]()});}})[_0x4abb('0x1c')](function(_0x15b843){console['error'](_0x15b843);});}if(_0x313af1[_0x4abb('0x13')]===_0x4abb('0x14')&&!_0x313af1[_0x4abb('0x15')]){var _0x1960b9;_0x5e38a8[_0x4abb('0x1d')][_0x4abb('0x1e')]({'where':{'id':_0x313af1['SmsAccountId']},'raw':!![]})[_0x4abb('0x1f')](function(_0x103a8b){_0x1960b9=_0x103a8b;if(_0x1960b9&&_0x1960b9[_0x4abb('0x20')]){switch(_0x1960b9[_0x4abb('0x20')]){case _0x4abb('0x21'):var _0xad537f=require('twilio');if(_0x1960b9['accountSid']&&_0x1960b9['authToken']&&_0x1960b9[_0x4abb('0x22')]){var _0x705c32=new _0xad537f(_0x1960b9[_0x4abb('0x23')],_0x1960b9[_0x4abb('0x24')]);_0x705c32[_0x4abb('0x25')][_0x4abb('0x26')]({'body':_0x313af1['body'],'to':_0x313af1[_0x4abb('0x22')],'from':_0x1960b9[_0x4abb('0x22')],'statusCallback':_0x1960b9['remote']+_0x4abb('0x27')+_0x313af1['id']+_0x4abb('0x28')+_0x1960b9[_0x4abb('0x29')]})['then'](function(_0x351cee){if(_0x351cee['sid']){return _0xa652bf[_0x4abb('0x2a')]({'messageId':_0x351cee[_0x4abb('0x2b')]});}})[_0x4abb('0x1c')](function(_0xfa78b){logger[_0x4abb('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4abb('0x2d'),_0x4abb('0x21'),util['inspect'](_0xfa78b,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4abb('0x2d'),_0x4abb('0x21'),_0x4abb('0x2e'));}break;case _0x4abb('0x2f'):var _0x8b136c=_0x4abb('0x30');if(_0x1960b9[_0x4abb('0x31')]&&_0x1960b9['password']){var _0x2e2ad1={'recipient':[_0x313af1[_0x4abb('0x22')]],'message':_0x313af1[_0x4abb('0x32')],'message_type':_0x1960b9[_0x4abb('0x33')]};if(_0x1960b9[_0x4abb('0x33')]&&_0x1960b9[_0x4abb('0x33')]!=='SI'){_0x2e2ad1[_0x4abb('0x34')]=_0x1960b9[_0x4abb('0x22')];}var _0x47c67c={'url':_0x8b136c+_0x4abb('0x35')+_0x1960b9[_0x4abb('0x31')]+_0x4abb('0x36')+_0x1960b9['password'],'method':_0x4abb('0x37')};rp(_0x47c67c)[_0x4abb('0x1f')](function(_0x3b387c){var _0x2a8a49=_0x3b387c['split'](';');var _0x3cf088={'user_key':_0x2a8a49[0x0],'session_key':_0x2a8a49[0x1]};_0x47c67c={'url':_0x8b136c+'sms','method':_0x4abb('0x38'),'headers':{'user_key':_0x3cf088[_0x4abb('0x39')],'Session_key':_0x3cf088[_0x4abb('0x3a')]},'json':!![],'body':_0x2e2ad1};return rp(_0x47c67c);})['then'](function(_0x54478c){if(_0x54478c[_0x4abb('0x3b')]>=0x1){var _0x4b293a={'messageId':_0x54478c['internal_order_id']};if(_0x1960b9['smsMethod']!=='GP'||!_0x1960b9[_0x4abb('0x3c')]){_0x4b293a[_0x4abb('0x3d')]=!![];}return _0xa652bf[_0x4abb('0x2a')](_0x4b293a);}else{return logger[_0x4abb('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4abb('0x2d'),_0x4abb('0x2f'),util[_0x4abb('0x3e')](_0x54478c,{'showHidden':![],'depth':null}));}})[_0x4abb('0x1c')](function(_0x493140){return logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x2f'),util[_0x4abb('0x3e')](_0x493140,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x2f'),_0x4abb('0x40'));}break;case _0x4abb('0x41'):if(_0x1960b9[_0x4abb('0x24')]){var _0x175ff4={'recipient':_0x313af1['phone'],'message':_0x313af1[_0x4abb('0x32')],'sender':_0x1960b9[_0x4abb('0x42')]||_0x1960b9[_0x4abb('0x22')],'authorization':_0x1960b9[_0x4abb('0x24')]};var _0xa56405={'method':_0x4abb('0x38'),'uri':_0x4abb('0x43'),'body':_0x175ff4,'json':!![]};rp(_0xa56405)[_0x4abb('0x1f')](function(_0x272d69){var _0x3bb048={'messageId':_0x272d69[_0x4abb('0x44')]};if(!_0x1960b9['deliveryReport']){_0x3bb048[_0x4abb('0x3d')]=!![];}return _0xa652bf[_0x4abb('0x2a')](_0x3bb048);})[_0x4abb('0x1c')](function(_0x4f5aa2){logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x41'),util['inspect'](_0x4f5aa2,{'showHidden':![],'depth':null}));});}else{logger[_0x4abb('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4abb('0x41'),_0x4abb('0x45'));}break;case _0x4abb('0x46'):if(_0x1960b9[_0x4abb('0x31')]&&_0x1960b9['password']){var _0x175ff4={'messages':[{'source':_0x4abb('0x47'),'to':_0x313af1[_0x4abb('0x22')],'body':_0x313af1[_0x4abb('0x32')],'from':_0x1960b9[_0x4abb('0x42')]||_0x1960b9[_0x4abb('0x22')]}]};var _0x3dd078=util[_0x4abb('0x48')](_0x4abb('0x49'),_0x1960b9[_0x4abb('0x31')],_0x1960b9[_0x4abb('0x4a')]);var _0xa56405={'method':_0x4abb('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x175ff4,'headers':{'Authorization':util['format'](_0x4abb('0x4b'),new Buffer(_0x3dd078)['toString'](_0x4abb('0x4c')))},'json':!![]};rp(_0xa56405)[_0x4abb('0x1f')](function(_0x20ec28){if(_0x20ec28[_0x4abb('0x4d')]>=0xc8&&_0x20ec28[_0x4abb('0x4d')]<=0xce){if(_0x20ec28['data']&&_0x20ec28['data']['queued_count']>0x0){var _0x29c1f4=_['head'](_0x20ec28[_0x4abb('0x4e')][_0x4abb('0x25')]);var _0x5d3d10={'messageId':_0x29c1f4[_0x4abb('0x4f')]};if(!_0x1960b9[_0x4abb('0x3c')]){_0x5d3d10[_0x4abb('0x3d')]=!![];}return _0xa652bf[_0x4abb('0x2a')](_0x5d3d10);}else{logger[_0x4abb('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4abb('0x2d'),_0x4abb('0x50'),util['inspect'](_0x20ec28,{'showHidden':![],'depth':null}));}}else{logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x50'),util[_0x4abb('0x3e')](_0x20ec28,{'showHidden':![],'depth':null}));}})[_0x4abb('0x1c')](function(_0x5e4b4d){logger[_0x4abb('0x2c')](_0x4abb('0x3f'),'afterCreate','clickSend',util['inspect'](_0x5e4b4d,{'showHidden':![],'depth':null}));});}else{logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4abb('0x51'):if(_0x1960b9[_0x4abb('0x52')]&&_0x1960b9['authToken']){var _0x175ff4={'dst':_0x313af1[_0x4abb('0x22')],'text':_0x313af1[_0x4abb('0x32')],'src':_0x1960b9['senderString']||_0x1960b9[_0x4abb('0x22')],'url':_0x1960b9[_0x4abb('0x53')]+'/api/sms/messages/'+_0x313af1['id']+_0x4abb('0x28')+_0x1960b9[_0x4abb('0x29')]};var _0x3dd078=util[_0x4abb('0x48')]('%s:%s',_0x1960b9['authId'],_0x1960b9[_0x4abb('0x24')]);var _0xa56405={'method':_0x4abb('0x38'),'uri':util[_0x4abb('0x48')](_0x4abb('0x54'),_0x1960b9[_0x4abb('0x52')]),'body':_0x175ff4,'headers':{'Authorization':util[_0x4abb('0x48')](_0x4abb('0x4b'),new Buffer(_0x3dd078)[_0x4abb('0x55')](_0x4abb('0x4c')))},'json':!![]};rp(_0xa56405)[_0x4abb('0x1f')](function(_0x5c4193){var _0x540db5={'messageId':_0x5c4193[_0x4abb('0x56')][0x0]};return _0xa652bf[_0x4abb('0x2a')](_0x540db5);})[_0x4abb('0x1c')](function(_0x461c74){logger[_0x4abb('0x2c')](_0x4abb('0x3f'),'afterCreate','plivo',util['inspect'](_0x461c74,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x51'),_0x4abb('0x57'));}break;case _0x4abb('0x58'):if(_0x1960b9[_0x4abb('0x31')]&&_0x1960b9['password']){if(_0x1960b9[_0x4abb('0x59')]){var _0x7ae3a={'method':_0x4abb('0x38'),'uri':_0x1960b9[_0x4abb('0x59')]+'/auth/1/session','body':{'username':_0x1960b9[_0x4abb('0x31')],'password':_0x1960b9[_0x4abb('0x4a')]},'json':!![]};return rp(_0x7ae3a)[_0x4abb('0x1f')](function(_0x396cd2){var _0x5c3a69={'method':_0x4abb('0x38'),'uri':_0x1960b9['baseUrl']+_0x4abb('0x5a'),'body':{'messages':[{'from':_0x1960b9[_0x4abb('0x22')],'destinations':[{'to':_0x313af1['phone']}],'text':_0x313af1['body'],'notifyUrl':_0x1960b9[_0x4abb('0x53')]+_0x4abb('0x27')+_0x313af1['id']+'/status?token='+_0x1960b9[_0x4abb('0x29')],'notifyContentType':_0x4abb('0x5b'),'callbackData':_0x1960b9[_0x4abb('0x22')]+';'+_0x313af1[_0x4abb('0x32')]}]},'headers':{'Authorization':_0x4abb('0x5c')+_0x396cd2['token']},'json':!![]};return rp(_0x5c3a69)[_0x4abb('0x1f')](function(_0x5e5ef0){if(_0x5e5ef0[_0x4abb('0x25')]){var _0x14048f={'messageId':_0x5e5ef0[_0x4abb('0x25')][0x0][_0x4abb('0xd')]};if(!_0x1960b9['deliveryReport']){_0x14048f['read']=!![];}return _0xa652bf[_0x4abb('0x2a')](_0x14048f);}else{return logger[_0x4abb('0x2c')](_0x4abb('0x3f'),'afterCreate',_0x4abb('0x58'),util[_0x4abb('0x3e')](_0x5e5ef0,{'showHidden':![],'depth':null}));}});})[_0x4abb('0x1c')](function(_0x189685){return logger[_0x4abb('0x2c')](_0x4abb('0x3f'),'afterCreate',_0x4abb('0x58'),util['inspect'](_0x189685,{'showHidden':![],'depth':null}));});}else{logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x58'),_0x4abb('0x40'));}break;case _0x4abb('0x5d'):var _0x250715=require(_0x4abb('0x5e'));if(_0x1960b9['apiKey']){var _0x54b1e8={};_0x54b1e8[_0x4abb('0x5f')]=_0x1960b9['username'];_0x54b1e8[_0x4abb('0x22')]=_0x313af1[_0x4abb('0x22')];_0x54b1e8[_0x4abb('0x34')]=_0x1960b9[_0x4abb('0x22')];_0x54b1e8['text']=_0x313af1[_0x4abb('0x32')];_0x54b1e8[_0x4abb('0x60')]=+new Date();var _0x123530='';var _0x5977a3='';var _0x2be0b3=Object[_0x4abb('0x61')](_0x54b1e8);_0x2be0b3[_0x4abb('0x62')]();for(var _0x56a913=0x0;_0x56a913<_0x2be0b3[_0x4abb('0x63')];_0x56a913++){if(_0x123530!=''){_0x123530+='&';}_0x123530+=_0x2be0b3[_0x56a913]+'='+encodeURIComponent(_0x54b1e8[_0x2be0b3[_0x56a913]]);_0x5977a3+=_0x54b1e8[_0x2be0b3[_0x56a913]];}_0x5977a3+=_0x1960b9[_0x4abb('0x64')];_0x5977a3=_0x250715[_0x4abb('0x65')]('md5')[_0x4abb('0x2a')](_0x5977a3)[_0x4abb('0x66')]('hex');if(_0x123530!==''){_0x123530+='&';}_0x123530+=_0x4abb('0x67')+_0x5977a3;var _0x47c67c={'method':_0x4abb('0x37'),'uri':_0x1960b9[_0x4abb('0x59')]+'/external/get/send.php?'+_0x123530,'json':!![]};return rp(_0x47c67c)[_0x4abb('0x1f')](function(_0x25c12e){var _0x495263=Object['keys'](_0x25c12e);if(_0x25c12e[_0x495263[0x0]][_0x4abb('0x2c')]&&parseInt(_0x25c12e[_0x495263[0x0]][_0x4abb('0x2c')])===0x0){var _0x314cb9={'messageId':_0x25c12e[_0x495263[0x0]][_0x4abb('0x68')]};if(!_0x1960b9[_0x4abb('0x3c')]){_0x314cb9[_0x4abb('0x3d')]=!![];}return _0xa652bf[_0x4abb('0x2a')](_0x314cb9);}else{return logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x5d'),util[_0x4abb('0x3e')](_0x25c12e[_0x4abb('0x2c')],{'showHidden':![],'depth':null}));}})[_0x4abb('0x1c')](function(_0x175521){return logger[_0x4abb('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4abb('0x5d'),util[_0x4abb('0x3e')](_0x175521,{'showHidden':![],'depth':null}));});}else{logger[_0x4abb('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4abb('0x2d'),_0x4abb('0x5d'),_0x4abb('0x69'));}break;case _0x4abb('0x6a'):if(_0x1960b9[_0x4abb('0x64')]){var _0x50ab9e={'method':_0x4abb('0x38'),'uri':_0x4abb('0x6b'),'headers':{'Authorization':_0x1960b9[_0x4abb('0x64')]},'body':{'content':_0x313af1[_0x4abb('0x32')],'to':[_0x313af1[_0x4abb('0x22')]],'from':_0x1960b9[_0x4abb('0x22')],'binary':![],'clientMessageId':'uuid','charset':_0x4abb('0x6c')},'json':!![]};rp(_0x50ab9e)[_0x4abb('0x1f')](function(_0x3c6402){if(!_0x3c6402[_0x4abb('0x2c')]){var _0x4f09db={'messageId':_0x3c6402[_0x4abb('0x25')][0x0][_0x4abb('0x6d')]};if(!_0x1960b9[_0x4abb('0x3c')]){_0x4f09db[_0x4abb('0x3d')]=!![];}return _0xa652bf[_0x4abb('0x2a')](_0x4f09db);}else{return logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x6a'),util['inspect'](_0x3c6402[_0x4abb('0x2c')],{'showHidden':![],'depth':null}));}})[_0x4abb('0x1c')](function(_0x1b2004){return logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x6a'),util[_0x4abb('0x3e')](_0x1b2004,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4abb('0x2d'),_0x4abb('0x6a'),_0x4abb('0x69'));}break;case _0x4abb('0x6e'):if(_0x1960b9['username']&&_0x1960b9['password']){var _0x3dd078=util[_0x4abb('0x48')](_0x4abb('0x49'),_0x1960b9[_0x4abb('0x31')],_0x1960b9[_0x4abb('0x4a')]);var _0xa56405={'method':_0x4abb('0x38'),'uri':_0x4abb('0x6f')+_0x1960b9['accountId']+_0x4abb('0x70'),'body':{'to':[_0x313af1[_0x4abb('0x22')]],'text':_0x313af1[_0x4abb('0x32')],'from':_0x1960b9[_0x4abb('0x22')],'applicationId':_0x1960b9[_0x4abb('0x71')]},'headers':{'Authorization':util[_0x4abb('0x48')](_0x4abb('0x4b'),new Buffer(_0x3dd078)['toString'](_0x4abb('0x4c')))},'json':!![]};rp(_0xa56405)[_0x4abb('0x1f')](function(_0x2ddaf3){if(_0x2ddaf3['id']){var _0x10f0c4={'messageId':_0x2ddaf3['id']};return _0xa652bf[_0x4abb('0x2a')](_0x10f0c4);}else{logger[_0x4abb('0x2c')](_0x4abb('0x3f'),'afterCreate',_0x4abb('0x6e'),util[_0x4abb('0x3e')](_0x2ddaf3,{'showHidden':![],'depth':null}));}})[_0x4abb('0x1c')](function(_0x4534c0){logger['error'](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x6e'),util[_0x4abb('0x3e')](_0x4534c0,{'showHidden':![],'depth':null}));});}else{logger[_0x4abb('0x2c')](_0x4abb('0x3f'),'afterCreate',_0x4abb('0x6e'),_0x4abb('0x40'));}break;case _0x4abb('0x72'):if(_0x1960b9[_0x4abb('0x64')]){var _0x4f2d4e={};var _0x47c67c={'method':_0x4abb('0x38'),'uri':_0x4abb('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x1960b9['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x1960b9[_0x4abb('0x22')],'to':_0x313af1[_0x4abb('0x22')],'text':_0x313af1[_0x4abb('0x32')]},'json':!![]};return rp(_0x47c67c)['then'](function(_0x3c8bb7){if(_0x3c8bb7[_0x4abb('0x74')]==0xca){_0x4f2d4e[_0x4abb('0x75')]=_0x3c8bb7;var _0x36818c={'method':'POST','uri':_0x4abb('0x76'),'headers':{'Authorization':_0x4abb('0x77')+_0x1960b9[_0x4abb('0x64')],'Content-Type':_0x4abb('0x5b')},'body':{'refid':_0x4f2d4e[_0x4abb('0x75')][_0x4abb('0x78')]},'json':!![]};return rp(_0x36818c)[_0x4abb('0x1f')](function(_0x2f0a3c){_0x4f2d4e[_0x4abb('0x79')]=_0x2f0a3c;var _0x40c95c={'messageId':_0x4f2d4e['message'][_0x4abb('0x78')],'read':!![]};return _0xa652bf[_0x4abb('0x2a')](_0x40c95c);});}else{return logger['error'](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x72'),util[_0x4abb('0x3e')](_0x3c8bb7,{'showHidden':![],'depth':null}));}})[_0x4abb('0x1c')](function(_0x1c8f73){return logger[_0x4abb('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4abb('0x2d'),'intelepeer',util[_0x4abb('0x3e')](_0x1c8f73,{'showHidden':![],'depth':null}));});}else{return logger[_0x4abb('0x2c')](_0x4abb('0x3f'),_0x4abb('0x2d'),_0x4abb('0x72'),_0x4abb('0x7a'));}break;}}})[_0x4abb('0x7b')](function(){_0x1c4c72();});}else{_0x1c4c72();}}},'charset':_0x4abb('0x7c'),'collate':_0x4abb('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 3784bf7..2635e42 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 _0x86bb=['code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xc4d6bd,_0x569f98){var _0x37d365=function(_0x2af42c){while(--_0x2af42c){_0xc4d6bd['push'](_0xc4d6bd['shift']());}};_0x37d365(++_0x569f98);}(_0x86bb,0xb9));var _0xb86b=function(_0x4f1ee6,_0x3a0ac1){_0x4f1ee6=_0x4f1ee6-0x0;var _0x331ef3=_0x86bb[_0x4f1ee6];return _0x331ef3;};'use strict';var _=require(_0xb86b('0x0'));var util=require(_0xb86b('0x1'));var moment=require(_0xb86b('0x2'));var BPromise=require(_0xb86b('0x3'));var rs=require(_0xb86b('0x4'));var fs=require('fs');var Redis=require(_0xb86b('0x5'));var db=require(_0xb86b('0x6'))['db'];var utils=require(_0xb86b('0x7'));var logger=require(_0xb86b('0x8'))('rpc');var config=require(_0xb86b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb86b('0xa')][_0xb86b('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb86b('0xc')],{'host':_0xb86b('0xd'),'port':0x18eb});var socket=require(_0xb86b('0xe'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xb86b('0xf')](socket);function respondWithRpcPromise(_0x52c9a4,_0x370218,_0x5c5f56){return new BPromise(function(_0x472f84,_0x2aafb1){return client[_0xb86b('0x10')](_0x52c9a4,_0x5c5f56)[_0xb86b('0x11')](function(_0x450119){logger[_0xb86b('0x12')](_0xb86b('0x13'),_0x370218,_0xb86b('0x14'));logger[_0xb86b('0x15')](_0xb86b('0x16'),_0x370218,'request\x20sent',JSON[_0xb86b('0x17')](_0x450119));if(_0x450119['error']){if(_0x450119[_0xb86b('0x18')][_0xb86b('0x19')]===0x1f4){logger[_0xb86b('0x18')](_0xb86b('0x13'),_0x370218,_0x450119[_0xb86b('0x18')][_0xb86b('0x1a')]);return _0x2aafb1(_0x450119['error'][_0xb86b('0x1a')]);}logger['error'](_0xb86b('0x13'),_0x370218,_0x450119[_0xb86b('0x18')][_0xb86b('0x1a')]);return _0x472f84(_0x450119[_0xb86b('0x18')][_0xb86b('0x1a')]);}else{logger[_0xb86b('0x12')](_0xb86b('0x13'),_0x370218,_0xb86b('0x14'));_0x472f84(_0x450119[_0xb86b('0x1b')]['message']);}})[_0xb86b('0x1c')](function(_0x5e35e5){logger[_0xb86b('0x18')](_0xb86b('0x13'),_0x370218,_0x5e35e5);_0x2aafb1(_0x5e35e5);});});}exports[_0xb86b('0x1d')]=function(_0x2c9073){var _0x145ed2=this;return new Promise(function(_0x73010d,_0x3f0f1a){return db[_0xb86b('0x1e')][_0xb86b('0x1f')](_0x2c9073[_0xb86b('0x20')],{'raw':_0x2c9073['options']?_0x2c9073[_0xb86b('0x21')][_0xb86b('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x2e2343){logger[_0xb86b('0x12')](_0xb86b('0x1d'),_0x2c9073);logger[_0xb86b('0x15')](_0xb86b('0x1d'),_0x2c9073,JSON[_0xb86b('0x17')](_0x2e2343));_0x73010d(_0x2e2343);})[_0xb86b('0x1c')](function(_0x5546a0){logger[_0xb86b('0x18')](_0xb86b('0x1d'),_0x5546a0[_0xb86b('0x1a')],_0x2c9073);_0x3f0f1a(_0x145ed2[_0xb86b('0x18')](0x1f4,_0x5546a0[_0xb86b('0x1a')]));});});}; \ No newline at end of file +var _0x710d=['error','SmsMessage,\x20%s,\x20%s','message','CreateSmsMessage','SmsMessage','create','body','options','raw','catch','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','request\x20sent','debug','stringify'];(function(_0x249d64,_0x4b0321){var _0xed0280=function(_0x26feda){while(--_0x26feda){_0x249d64['push'](_0x249d64['shift']());}};_0xed0280(++_0x4b0321);}(_0x710d,0x91));var _0xd710=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0x710d[_0x3f00ee];return _0x18a07e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd710('0x0'));var BPromise=require(_0xd710('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd710('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd710('0x3'))(_0xd710('0x4'));var config=require(_0xd710('0x5'));var jayson=require(_0xd710('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xd710('0x7')]=_['defaults'](config['redis'],{'host':_0xd710('0x8'),'port':0x18eb});var socket=require(_0xd710('0x9'))(new Redis(config[_0xd710('0x7')]));require(_0xd710('0xa'))['register'](socket);function respondWithRpcPromise(_0x20586a,_0x264ef4,_0x38a87d){return new BPromise(function(_0xdf3e40,_0x3c260f){return client[_0xd710('0xb')](_0x20586a,_0x38a87d)[_0xd710('0xc')](function(_0x33d443){logger[_0xd710('0xd')]('SmsMessage,\x20%s,\x20%s',_0x264ef4,_0xd710('0xe'));logger[_0xd710('0xf')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x264ef4,_0xd710('0xe'),JSON[_0xd710('0x10')](_0x33d443));if(_0x33d443[_0xd710('0x11')]){if(_0x33d443[_0xd710('0x11')]['code']===0x1f4){logger[_0xd710('0x11')](_0xd710('0x12'),_0x264ef4,_0x33d443[_0xd710('0x11')]['message']);return _0x3c260f(_0x33d443['error'][_0xd710('0x13')]);}logger[_0xd710('0x11')](_0xd710('0x12'),_0x264ef4,_0x33d443[_0xd710('0x11')][_0xd710('0x13')]);return _0xdf3e40(_0x33d443['error']['message']);}else{logger['info'](_0xd710('0x12'),_0x264ef4,_0xd710('0xe'));_0xdf3e40(_0x33d443['result'][_0xd710('0x13')]);}})['catch'](function(_0x1b8952){logger[_0xd710('0x11')]('SmsMessage,\x20%s,\x20%s',_0x264ef4,_0x1b8952);_0x3c260f(_0x1b8952);});});}exports[_0xd710('0x14')]=function(_0x1fa798){var _0x4f84a8=this;return new Promise(function(_0x115122,_0xfae2df){return db[_0xd710('0x15')][_0xd710('0x16')](_0x1fa798[_0xd710('0x17')],{'raw':_0x1fa798['options']?_0x1fa798[_0xd710('0x18')][_0xd710('0x19')]===undefined?!![]:![]:!![]})[_0xd710('0xc')](function(_0x3bd8c2){logger[_0xd710('0xd')](_0xd710('0x14'),_0x1fa798);logger[_0xd710('0xf')](_0xd710('0x14'),_0x1fa798,JSON[_0xd710('0x10')](_0x3bd8c2));_0x115122(_0x3bd8c2);})[_0xd710('0x1a')](function(_0x5c0c44){logger[_0xd710('0x11')](_0xd710('0x14'),_0x5c0c44[_0xd710('0x13')],_0x1fa798);_0xfae2df(_0x4f84a8['error'](0x1f4,_0x5c0c44[_0xd710('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 36fa32e..b1df53e 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 _0xf94a=['removeListener','register','length','smsMessage:','./smsMessage.events','save','remove','emit'];(function(_0x36b18a,_0x247ff5){var _0x13706b=function(_0x4d2a63){while(--_0x4d2a63){_0x36b18a['push'](_0x36b18a['shift']());}};_0x13706b(++_0x247ff5);}(_0xf94a,0x17c));var _0xaf94=function(_0x393839,_0x27a377){_0x393839=_0x393839-0x0;var _0x111e02=_0xf94a[_0x393839];return _0x111e02;};'use strict';var SmsMessageEvents=require(_0xaf94('0x0'));var events=[_0xaf94('0x1'),_0xaf94('0x2'),'update'];function createListener(_0x5b226f,_0x1c6add){return function(_0x37ae33){_0x1c6add[_0xaf94('0x3')](_0x5b226f,_0x37ae33);};}function removeListener(_0x450700,_0x437745){return function(){SmsMessageEvents[_0xaf94('0x4')](_0x450700,_0x437745);};}exports[_0xaf94('0x5')]=function(_0x50c518){for(var _0x1cccda=0x0,_0x35b4c1=events[_0xaf94('0x6')];_0x1cccda<_0x35b4c1;_0x1cccda++){var _0x27b418=events[_0x1cccda];var _0x5e8624=createListener(_0xaf94('0x7')+_0x27b418,_0x50c518);SmsMessageEvents['on'](_0x27b418,_0x5e8624);}}; \ No newline at end of file +var _0x454e=['emit','register','length','smsMessage:','./smsMessage.events','update'];(function(_0x38b909,_0x2c14f1){var _0x856a8f=function(_0x2db17b){while(--_0x2db17b){_0x38b909['push'](_0x38b909['shift']());}};_0x856a8f(++_0x2c14f1);}(_0x454e,0x70));var _0xe454=function(_0x2eee25,_0x53460d){_0x2eee25=_0x2eee25-0x0;var _0x1cb8c4=_0x454e[_0x2eee25];return _0x1cb8c4;};'use strict';var SmsMessageEvents=require(_0xe454('0x0'));var events=['save','remove',_0xe454('0x1')];function createListener(_0x24388d,_0x1b9b47){return function(_0x2fb0c0){_0x1b9b47[_0xe454('0x2')](_0x24388d,_0x2fb0c0);};}function removeListener(_0x44e4e9,_0x5c267e){return function(){SmsMessageEvents['removeListener'](_0x44e4e9,_0x5c267e);};}exports[_0xe454('0x3')]=function(_0x3cbd47){for(var _0x455138=0x0,_0x4de961=events[_0xe454('0x4')];_0x455138<_0x4de961;_0x455138++){var _0x365c4a=events[_0x455138];var _0x4fc5fb=createListener(_0xe454('0x5')+_0x365c4a,_0x3cbd47);SmsMessageEvents['on'](_0x365c4a,_0x4fc5fb);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 10c2c37..a14fb66 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 _0xe2e5=['../../config/environment','./smsQueue.controller','get','index','/describe','/:id','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x458fb3,_0x5dd915){var _0x233fac=function(_0x507747){while(--_0x507747){_0x458fb3['push'](_0x458fb3['shift']());}};_0x233fac(++_0x5dd915);}(_0xe2e5,0x1a3));var _0x5e2e=function(_0x4b9f25,_0x541580){_0x4b9f25=_0x4b9f25-0x0;var _0x12710e=_0xe2e5[_0x4b9f25];return _0x12710e;};'use strict';var multer=require(_0x5e2e('0x0'));var util=require('util');var path=require(_0x5e2e('0x1'));var timeout=require(_0x5e2e('0x2'));var express=require(_0x5e2e('0x3'));var router=express[_0x5e2e('0x4')]();var fs_extra=require(_0x5e2e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e2e('0x6'));var controller=require(_0x5e2e('0x7'));router[_0x5e2e('0x8')]('/',auth['isAuthenticated'](),controller[_0x5e2e('0x9')]);router[_0x5e2e('0x8')](_0x5e2e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x5e2e('0x8')](_0x5e2e('0xb'),auth[_0x5e2e('0xc')](),controller['show']);router[_0x5e2e('0x8')](_0x5e2e('0xd'),auth[_0x5e2e('0xc')](),controller[_0x5e2e('0xe')]);router[_0x5e2e('0x8')](_0x5e2e('0xf'),auth[_0x5e2e('0xc')](),controller[_0x5e2e('0x10')]);router[_0x5e2e('0x8')](_0x5e2e('0x11'),auth[_0x5e2e('0xc')](),controller['getAgents']);router[_0x5e2e('0x12')]('/',auth['isAuthenticated'](),controller[_0x5e2e('0x13')]);router[_0x5e2e('0x12')](_0x5e2e('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0x5e2e('0x12')](_0x5e2e('0x11'),auth[_0x5e2e('0xc')](),controller[_0x5e2e('0x14')]);router[_0x5e2e('0x15')](_0x5e2e('0xb'),auth[_0x5e2e('0xc')](),controller[_0x5e2e('0x16')]);router[_0x5e2e('0x17')](_0x5e2e('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x5e2e('0x17')](_0x5e2e('0xf'),auth[_0x5e2e('0xc')](),controller['removeTeams']);router[_0x5e2e('0x17')](_0x5e2e('0x11'),auth[_0x5e2e('0xc')](),controller['removeAgents']);module[_0x5e2e('0x18')]=router; \ No newline at end of file +var _0x9571=['update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put'];(function(_0xcb3d27,_0x57be2b){var _0x11a0ad=function(_0x16f135){while(--_0x16f135){_0xcb3d27['push'](_0xcb3d27['shift']());}};_0x11a0ad(++_0x57be2b);}(_0x9571,0x96));var _0x1957=function(_0x239a98,_0x288178){_0x239a98=_0x239a98-0x0;var _0x16d789=_0x9571[_0x239a98];return _0x16d789;};'use strict';var multer=require(_0x1957('0x0'));var util=require('util');var path=require(_0x1957('0x1'));var timeout=require(_0x1957('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1957('0x3'));var auth=require(_0x1957('0x4'));var interaction=require(_0x1957('0x5'));var config=require(_0x1957('0x6'));var controller=require(_0x1957('0x7'));router[_0x1957('0x8')]('/',auth[_0x1957('0x9')](),controller['index']);router[_0x1957('0x8')](_0x1957('0xa'),auth[_0x1957('0x9')](),controller[_0x1957('0xb')]);router[_0x1957('0x8')](_0x1957('0xc'),auth[_0x1957('0x9')](),controller[_0x1957('0xd')]);router[_0x1957('0x8')](_0x1957('0xe'),auth['isAuthenticated'](),controller[_0x1957('0xf')]);router[_0x1957('0x8')](_0x1957('0x10'),auth[_0x1957('0x9')](),controller[_0x1957('0x11')]);router['get'](_0x1957('0x12'),auth[_0x1957('0x9')](),controller[_0x1957('0x13')]);router[_0x1957('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1957('0x10'),auth['isAuthenticated'](),controller[_0x1957('0x15')]);router[_0x1957('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x1957('0x16')]);router[_0x1957('0x17')](_0x1957('0xc'),auth['isAuthenticated'](),controller[_0x1957('0x18')]);router[_0x1957('0x19')](_0x1957('0xc'),auth[_0x1957('0x9')](),controller[_0x1957('0x1a')]);router[_0x1957('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1957('0x1b')]);router['delete'](_0x1957('0x12'),auth[_0x1957('0x9')](),controller[_0x1957('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 2e3c519..62905ca 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 _0x55dc=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x1d58ed,_0x520f5a){var _0xa4d106=function(_0x3385db){while(--_0x3385db){_0x1d58ed['push'](_0x1d58ed['shift']());}};_0xa4d106(++_0x520f5a);}(_0x55dc,0xaa));var _0xc55d=function(_0x337e83,_0x14b3a5){_0x337e83=_0x337e83-0x0;var _0x2b48fa=_0x55dc[_0x337e83];return _0x2b48fa;};'use strict';var Sequelize=require(_0xc55d('0x0'));module[_0xc55d('0x1')]={'name':{'type':Sequelize[_0xc55d('0x2')],'unique':_0xc55d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc55d('0x2')]},'timeout':{'type':Sequelize[_0xc55d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc55d('0x5')](_0xc55d('0x6'),'beepall',_0xc55d('0x7'))}}; \ No newline at end of file +var _0x6117=['ENUM','rrmemory','roundrobin','exports','STRING','name','INTEGER'];(function(_0x17e3e8,_0x110af2){var _0x30ce45=function(_0x116440){while(--_0x116440){_0x17e3e8['push'](_0x17e3e8['shift']());}};_0x30ce45(++_0x110af2);}(_0x6117,0x1e6));var _0x7611=function(_0x2a4b34,_0x2ec5c4){_0x2a4b34=_0x2a4b34-0x0;var _0x40c480=_0x6117[_0x2a4b34];return _0x40c480;};'use strict';var Sequelize=require('sequelize');module[_0x7611('0x0')]={'name':{'type':Sequelize[_0x7611('0x1')],'unique':_0x7611('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7611('0x1')]},'timeout':{'type':Sequelize[_0x7611('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7611('0x4')](_0x7611('0x5'),'beepall',_0x7611('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index c6d3619..8dc1a8b 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 _0x4012=['userSmsQueue:remove','addAgents','omit','emit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','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','./smsQueue.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SmsQueue','count','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','order','SmsQueueId','UserSmsQueue','User','findAndCountAll','smsPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','length','addTeams','Agents','online','voicePause','flatMap','transaction','each','forEach','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x4012,0x1bf));var _0x2401=function(_0x230747,_0x1d413c){_0x230747=_0x230747-0x0;var _0xfe856f=_0x4012[_0x230747];return _0xfe856f;};'use strict';var emlformat=require(_0x2401('0x0'));var rimraf=require(_0x2401('0x1'));var zipdir=require(_0x2401('0x2'));var jsonpatch=require(_0x2401('0x3'));var rp=require(_0x2401('0x4'));var moment=require('moment');var BPromise=require(_0x2401('0x5'));var Mustache=require(_0x2401('0x6'));var util=require(_0x2401('0x7'));var path=require(_0x2401('0x8'));var sox=require(_0x2401('0x9'));var csv=require(_0x2401('0xa'));var ejs=require(_0x2401('0xb'));var fs=require('fs');var fs_extra=require(_0x2401('0xc'));var _=require(_0x2401('0xd'));var squel=require(_0x2401('0xe'));var crypto=require(_0x2401('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2401('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2401('0x11'));var Papa=require(_0x2401('0x12'));var Redis=require(_0x2401('0x13'));var authService=require(_0x2401('0x14'));var qs=require(_0x2401('0x15'));var as=require(_0x2401('0x16'));var hardwareService=require(_0x2401('0x17'));var logger=require(_0x2401('0x18'))(_0x2401('0x19'));var utils=require(_0x2401('0x1a'));var config=require(_0x2401('0x1b'));var licenseUtil=require(_0x2401('0x1c'));var db=require(_0x2401('0x1d'))['db'];config[_0x2401('0x1e')]=_['defaults'](config[_0x2401('0x1e')],{'host':'localhost','port':0x18eb});var socket=require(_0x2401('0x1f'))(new Redis(config[_0x2401('0x1e')]));require(_0x2401('0x20'))[_0x2401('0x21')](socket);function respondWithStatusCode(_0x3f54e4,_0x5f3c68){_0x5f3c68=_0x5f3c68||0xcc;return function(_0x523978){if(_0x523978){return _0x3f54e4[_0x2401('0x22')](_0x5f3c68);}return _0x3f54e4['status'](_0x5f3c68)['end']();};}function respondWithResult(_0x2abb8c,_0x17d709){_0x17d709=_0x17d709||0xc8;return function(_0x29568a){if(_0x29568a){return _0x2abb8c[_0x2401('0x23')](_0x17d709)[_0x2401('0x24')](_0x29568a);}};}function respondWithFilteredResult(_0x2c66c,_0x1ba9bf){return function(_0x4ca827){if(_0x4ca827){var _0xfa9520=typeof _0x1ba9bf[_0x2401('0x25')]==='undefined'&&typeof _0x1ba9bf['limit']==='undefined';var _0x4d1fd1=_0x4ca827['count'];var _0x1716ef=_0xfa9520?0x0:_0x1ba9bf['offset'];var _0x3412e5=_0xfa9520?_0x4ca827['count']:_0x1ba9bf[_0x2401('0x25')]+_0x1ba9bf[_0x2401('0x26')];var _0xbbfcbd;if(_0x3412e5>=_0x4d1fd1){_0x3412e5=_0x4d1fd1;_0xbbfcbd=0xc8;}else{_0xbbfcbd=0xce;}_0x2c66c['status'](_0xbbfcbd);return _0x2c66c[_0x2401('0x27')](_0x2401('0x28'),_0x1716ef+'-'+_0x3412e5+'/'+_0x4d1fd1)[_0x2401('0x24')](_0x4ca827);}return null;};}function patchUpdates(_0x46a4ce){return function(_0x21e90c){try{jsonpatch[_0x2401('0x29')](_0x21e90c,_0x46a4ce,!![]);}catch(_0x2ff84c){return BPromise['reject'](_0x2ff84c);}return _0x21e90c[_0x2401('0x2a')]();};}function saveUpdates(_0x38d527,_0x5482fe){return function(_0x396b0b){if(_0x396b0b){return _0x396b0b[_0x2401('0x2b')](_0x38d527)[_0x2401('0x2c')](function(_0x1111c3){return _0x1111c3;});}return null;};}function removeEntity(_0x402749,_0x3426e7){return function(_0x1655c1){if(_0x1655c1){return _0x1655c1['destroy']()['then'](function(){var _0x24a660=_0x1655c1[_0x2401('0x2d')]({'plain':!![]});var _0x17bde0='SmsQueues';return db[_0x2401('0x2e')][_0x2401('0x2f')]({'where':{'type':_0x17bde0,'resourceId':_0x24a660['id']}})[_0x2401('0x2c')](function(){return _0x1655c1;});})['then'](function(){_0x402749[_0x2401('0x23')](0xcc)[_0x2401('0x30')]();});}};}function handleEntityNotFound(_0x292a78,_0x3fad1b){return function(_0x19302a){if(!_0x19302a){_0x292a78[_0x2401('0x22')](0x194);}return _0x19302a;};}function handleError(_0x5b7764,_0xc6403c){_0xc6403c=_0xc6403c||0x1f4;return function(_0x38a820){logger[_0x2401('0x31')](_0x38a820[_0x2401('0x32')]);if(_0x38a820[_0x2401('0x33')]){delete _0x38a820[_0x2401('0x33')];}_0x5b7764[_0x2401('0x23')](_0xc6403c)['send'](_0x38a820);};}exports[_0x2401('0x34')]=function(_0x44bc40,_0x2b7f7a){var _0x108e4a={},_0x13ae3f={},_0x28bd41={'count':0x0,'rows':[]};var _0x1e7ce2=_[_0x2401('0x35')](db['SmsQueue'][_0x2401('0x36')],function(_0x3d28e6){return{'name':_0x3d28e6[_0x2401('0x37')],'type':_0x3d28e6[_0x2401('0x38')][_0x2401('0x39')]};});_0x13ae3f[_0x2401('0x3a')]=_[_0x2401('0x35')](_0x1e7ce2,'name');_0x13ae3f['query']=_[_0x2401('0x3b')](_0x44bc40[_0x2401('0x3c')]);_0x13ae3f[_0x2401('0x3d')]=_['intersection'](_0x13ae3f[_0x2401('0x3a')],_0x13ae3f[_0x2401('0x3c')]);_0x108e4a[_0x2401('0x3e')]=_[_0x2401('0x3f')](_0x13ae3f[_0x2401('0x3a')],qs[_0x2401('0x40')](_0x44bc40[_0x2401('0x3c')]['fields']));_0x108e4a['attributes']=_0x108e4a['attributes']['length']?_0x108e4a[_0x2401('0x3e')]:_0x13ae3f[_0x2401('0x3a')];if(!_0x44bc40[_0x2401('0x3c')][_0x2401('0x41')](_0x2401('0x42'))){_0x108e4a[_0x2401('0x26')]=qs[_0x2401('0x26')](_0x44bc40[_0x2401('0x3c')]['limit']);_0x108e4a[_0x2401('0x25')]=qs['offset'](_0x44bc40[_0x2401('0x3c')]['offset']);}_0x108e4a['order']=qs[_0x2401('0x43')](_0x44bc40[_0x2401('0x3c')][_0x2401('0x43')]);_0x108e4a[_0x2401('0x44')]=qs[_0x2401('0x3d')](_[_0x2401('0x45')](_0x44bc40[_0x2401('0x3c')],_0x13ae3f[_0x2401('0x3d')]),_0x1e7ce2);if(_0x44bc40[_0x2401('0x3c')][_0x2401('0x46')]){_0x108e4a['where']=_[_0x2401('0x47')](_0x108e4a[_0x2401('0x44')],{'$or':_['map'](_0x1e7ce2,function(_0x1a9d53){if(_0x1a9d53[_0x2401('0x38')]!==_0x2401('0x48')){var _0x22409b={};_0x22409b[_0x1a9d53[_0x2401('0x33')]]={'$like':'%'+_0x44bc40[_0x2401('0x3c')][_0x2401('0x46')]+'%'};return _0x22409b;}})});}_0x108e4a=_['merge']({},_0x108e4a,_0x44bc40[_0x2401('0x49')]);var _0x4c2c9b={'where':_0x108e4a[_0x2401('0x44')]};return db[_0x2401('0x4a')][_0x2401('0x4b')](_0x4c2c9b)[_0x2401('0x2c')](function(_0x4a7b5b){_0x28bd41[_0x2401('0x4b')]=_0x4a7b5b;if(_0x44bc40['query'][_0x2401('0x4c')]){_0x108e4a[_0x2401('0x4d')]=[{'all':!![]}];}return db[_0x2401('0x4a')][_0x2401('0x4e')](_0x108e4a);})['then'](function(_0x1fbe14){_0x28bd41[_0x2401('0x4f')]=_0x1fbe14;return _0x28bd41;})['then'](respondWithFilteredResult(_0x2b7f7a,_0x108e4a))[_0x2401('0x50')](handleError(_0x2b7f7a,null));};exports[_0x2401('0x51')]=function(_0x25e795,_0x5bb1e6){var _0x5a4479={'raw':!![],'where':{'id':_0x25e795[_0x2401('0x52')]['id']}},_0x3878be={};_0x3878be[_0x2401('0x3a')]=_[_0x2401('0x3b')](db['SmsQueue']['rawAttributes']);_0x3878be['query']=_[_0x2401('0x3b')](_0x25e795[_0x2401('0x3c')]);_0x3878be[_0x2401('0x3d')]=_[_0x2401('0x3f')](_0x3878be['model'],_0x3878be[_0x2401('0x3c')]);_0x5a4479['attributes']=_[_0x2401('0x3f')](_0x3878be[_0x2401('0x3a')],qs[_0x2401('0x40')](_0x25e795[_0x2401('0x3c')][_0x2401('0x40')]));_0x5a4479[_0x2401('0x3e')]=_0x5a4479['attributes']['length']?_0x5a4479[_0x2401('0x3e')]:_0x3878be[_0x2401('0x3a')];if(_0x25e795[_0x2401('0x3c')][_0x2401('0x4c')]){_0x5a4479[_0x2401('0x4d')]=[{'all':!![]}];}_0x5a4479=_[_0x2401('0x47')]({},_0x5a4479,_0x25e795['options']);return db[_0x2401('0x4a')]['find'](_0x5a4479)[_0x2401('0x2c')](handleEntityNotFound(_0x5bb1e6,null))[_0x2401('0x2c')](respondWithResult(_0x5bb1e6,null))[_0x2401('0x50')](handleError(_0x5bb1e6,null));};exports[_0x2401('0x53')]=function(_0x7228c7,_0x469a21){return db[_0x2401('0x4a')]['create'](_0x7228c7[_0x2401('0x54')],{})[_0x2401('0x2c')](function(_0x5147ec){var _0x36ce0e=_0x7228c7[_0x2401('0x55')]['get']({'plain':!![]});if(!_0x36ce0e)throw new Error(_0x2401('0x56'));if(_0x36ce0e[_0x2401('0x57')]==='user'){var _0x42d19f=_0x5147ec[_0x2401('0x2d')]({'plain':!![]});var _0xf3950f=_0x2401('0x58');return db['UserProfileSection'][_0x2401('0x59')]({'where':{'name':_0xf3950f,'userProfileId':_0x36ce0e[_0x2401('0x5a')]},'raw':!![]})[_0x2401('0x2c')](function(_0x2cd67d){if(_0x2cd67d&&_0x2cd67d[_0x2401('0x5b')]===0x0){return db['UserProfileResource'][_0x2401('0x53')]({'name':_0x42d19f[_0x2401('0x33')],'resourceId':_0x42d19f['id'],'type':_0x2cd67d[_0x2401('0x33')],'sectionId':_0x2cd67d['id']},{})['then'](function(){return _0x5147ec;});}else{return _0x5147ec;}})['catch'](function(_0x571168){logger['error'](_0x2401('0x5c'),_0x571168);throw _0x571168;});}return _0x5147ec;})[_0x2401('0x2c')](respondWithResult(_0x469a21,0xc9))[_0x2401('0x50')](handleError(_0x469a21,null));};exports[_0x2401('0x2b')]=function(_0xb89830,_0x23d5b0){if(_0xb89830[_0x2401('0x54')]['id']){delete _0xb89830[_0x2401('0x54')]['id'];}return db[_0x2401('0x4a')]['find']({'where':{'id':_0xb89830[_0x2401('0x52')]['id']}})[_0x2401('0x2c')](handleEntityNotFound(_0x23d5b0,null))['then'](saveUpdates(_0xb89830[_0x2401('0x54')],null))['then'](respondWithResult(_0x23d5b0,null))[_0x2401('0x50')](handleError(_0x23d5b0,null));};exports[_0x2401('0x2f')]=function(_0xde2daa,_0x4c44be){return db[_0x2401('0x4a')]['find']({'where':{'id':_0xde2daa[_0x2401('0x52')]['id']}})[_0x2401('0x2c')](handleEntityNotFound(_0x4c44be,null))[_0x2401('0x2c')](removeEntity(_0x4c44be,null))[_0x2401('0x50')](handleError(_0x4c44be,null));};exports[_0x2401('0x5d')]=function(_0x363776,_0x687791){return db[_0x2401('0x4a')]['describe']()[_0x2401('0x2c')](respondWithResult(_0x687791,null))['catch'](handleError(_0x687791,null));};exports['getMembers']=function(_0x194d1c,_0x402134,_0xcb09d3){var _0x3878af={'raw':!![],'where':{}},_0x39f6f5={},_0x1929d9;return db[_0x2401('0x4a')][_0x2401('0x5e')]({'where':{'id':_0x194d1c[_0x2401('0x52')]['id']}})[_0x2401('0x2c')](handleEntityNotFound(_0x402134,null))[_0x2401('0x2c')](function(_0x10ca12){if(_0x10ca12){_0x1929d9=_0x10ca12[_0x2401('0x2d')]({'plain':!![]});_0x39f6f5['model']=_[_0x2401('0x3b')](db['UserSmsQueue'][_0x2401('0x36')]);_0x39f6f5['query']=_[_0x2401('0x3b')](_0x194d1c[_0x2401('0x3c')]);_0x39f6f5[_0x2401('0x3d')]=_[_0x2401('0x3f')](_0x39f6f5[_0x2401('0x3a')],_0x39f6f5[_0x2401('0x3c')]);_0x3878af['attributes']=_[_0x2401('0x3f')](_0x39f6f5[_0x2401('0x3a')],qs[_0x2401('0x40')](_0x194d1c[_0x2401('0x3c')]['fields']));_0x3878af['attributes']=_0x3878af[_0x2401('0x3e')]['length']?_0x3878af[_0x2401('0x3e')]:_0x39f6f5['model'];if(!_0x194d1c[_0x2401('0x3c')][_0x2401('0x41')](_0x2401('0x42'))){_0x3878af[_0x2401('0x26')]=qs['limit'](_0x194d1c[_0x2401('0x3c')][_0x2401('0x26')]);_0x3878af['offset']=qs[_0x2401('0x25')](_0x194d1c['query'][_0x2401('0x25')]);}_0x3878af[_0x2401('0x5f')]=qs[_0x2401('0x43')](_0x194d1c[_0x2401('0x3c')][_0x2401('0x43')]);_0x3878af['where']=qs[_0x2401('0x3d')](_[_0x2401('0x45')](_0x194d1c['query'],_0x39f6f5[_0x2401('0x3d')]));_0x3878af[_0x2401('0x44')][_0x2401('0x60')]=_0x10ca12['id'];if(_0x194d1c[_0x2401('0x3c')][_0x2401('0x46')]){_0x3878af[_0x2401('0x44')]=_[_0x2401('0x47')](_0x3878af[_0x2401('0x44')],{'$or':_[_0x2401('0x35')](_0x3878af[_0x2401('0x3e')],function(_0x4ddf9b){var _0x402af1={};_0x402af1[_0x4ddf9b]={'$like':'%'+_0x194d1c[_0x2401('0x3c')]['filter']+'%'};return _0x402af1;})});}_0x3878af=_[_0x2401('0x47')]({},_0x3878af,_0x194d1c['options']);return db[_0x2401('0x61')][_0x2401('0x4e')](_0x3878af);}})[_0x2401('0x2c')](function(_0x2a80cc){if(_0x2a80cc){return db[_0x2401('0x62')][_0x2401('0x63')]({'where':{'id':_[_0x2401('0x35')](_0x2a80cc,'UserId'),'role':'agent'},'attributes':['id',_0x2401('0x33'),_0x2401('0x64'),'updatedAt',_0x2401('0x65')]});}})['then'](function(_0x3eaf2c){if(_0x3eaf2c){return{'count':_0x3eaf2c[_0x2401('0x4b')],'rows':_[_0x2401('0x35')](_0x3eaf2c[_0x2401('0x4f')],function(_0x578d5c){return{'membername':_0x578d5c[_0x2401('0x33')],'UserId':_0x578d5c['id'],'queue_name':_0x1929d9['name'],'SmsQueueId':_0x1929d9['id'],'interface':util[_0x2401('0x66')](_0x2401('0x67'),'SIP',_0x578d5c['name']),'penalty':0x0,'paused':_0x578d5c[_0x2401('0x64')],'createdAt':_0x578d5c[_0x2401('0x65')],'updatedAt':_0x578d5c[_0x2401('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2401('0x2c')](respondWithFilteredResult(_0x402134,_0x3878af))['catch'](handleError(_0x402134,null));};exports[_0x2401('0x69')]=function(_0x48a084,_0x2e91f6,_0xd6e4c3){var _0x131490={};var _0x50b252={};var _0x4f1a48;var _0xdf427e;return db[_0x2401('0x4a')][_0x2401('0x5e')]({'where':{'id':_0x48a084['params']['id']}})['then'](handleEntityNotFound(_0x2e91f6,null))[_0x2401('0x2c')](function(_0x17280d){if(_0x17280d){_0x4f1a48=_0x17280d;_0x50b252['model']=_[_0x2401('0x3b')](db[_0x2401('0x6a')][_0x2401('0x36')]);_0x50b252[_0x2401('0x3c')]=_[_0x2401('0x3b')](_0x48a084[_0x2401('0x3c')]);_0x50b252[_0x2401('0x3d')]=_[_0x2401('0x3f')](_0x50b252[_0x2401('0x3a')],_0x50b252[_0x2401('0x3c')]);_0x131490[_0x2401('0x3e')]=_[_0x2401('0x3f')](_0x50b252['model'],qs[_0x2401('0x40')](_0x48a084['query'][_0x2401('0x40')]));_0x131490['attributes']=_0x131490[_0x2401('0x3e')][_0x2401('0x6b')]?_0x131490[_0x2401('0x3e')]:_0x50b252['model'];_0x131490[_0x2401('0x5f')]=qs[_0x2401('0x43')](_0x48a084[_0x2401('0x3c')][_0x2401('0x43')]);_0x131490[_0x2401('0x44')]=qs['filters'](_[_0x2401('0x45')](_0x48a084[_0x2401('0x3c')],_0x50b252[_0x2401('0x3d')]));if(_0x48a084['query'][_0x2401('0x46')]){_0x131490[_0x2401('0x44')]=_[_0x2401('0x47')](_0x131490[_0x2401('0x44')],{'$or':_[_0x2401('0x35')](_0x131490['attributes'],function(_0x5aab59){var _0x541883={};_0x541883[_0x5aab59]={'$like':'%'+_0x48a084[_0x2401('0x3c')][_0x2401('0x46')]+'%'};return _0x541883;})});}_0x131490=_[_0x2401('0x47')]({},_0x131490,_0x48a084[_0x2401('0x49')]);return _0x4f1a48[_0x2401('0x69')](_0x131490);}})[_0x2401('0x2c')](function(_0x3b37da){if(_0x3b37da){_0xdf427e=_0x3b37da['length'];if(!_0x48a084['query'][_0x2401('0x41')]('nolimit')){_0x131490[_0x2401('0x26')]=qs[_0x2401('0x26')](_0x48a084[_0x2401('0x3c')]['limit']);_0x131490['offset']=qs[_0x2401('0x25')](_0x48a084['query'][_0x2401('0x25')]);}return _0x4f1a48[_0x2401('0x69')](_0x131490);}})[_0x2401('0x2c')](function(_0x311951){if(_0x311951){return _0x311951?{'count':_0xdf427e,'rows':_0x311951}:null;}})[_0x2401('0x2c')](respondWithResult(_0x2e91f6,null))['catch'](handleError(_0x2e91f6,null));};exports[_0x2401('0x6c')]=function(_0x5239d7,_0x1540a8,_0x278359){var _0x4f6349=_0x5239d7['body']['ids'];return db[_0x2401('0x6a')][_0x2401('0x4e')]({'where':{'id':_0x4f6349},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2401('0x6d'),'attributes':['id',_0x2401('0x33'),_0x2401('0x6e'),_0x2401('0x6f'),'interface'],'raw':!![]}]})[_0x2401('0x2c')](function(_0x12ae80){if(_0x12ae80){var _0x39d402=_[_0x2401('0x70')](_0x12ae80,function(_0x3cc659){var _0x22a041=_0x3cc659['get']({'plain':!![]});return _0x22a041[_0x2401('0x6d')];});return db[_0x2401('0x4a')]['find']({'where':{'id':_0x5239d7['params']['id']}})['then'](function(_0x4c1f98){return db['sequelize'][_0x2401('0x71')](function(_0x552ed1){return _0x4c1f98[_0x2401('0x6c')](_0x4f6349,{'transaction':_0x552ed1})[_0x2401('0x2c')](function(){return BPromise[_0x2401('0x72')](_0x39d402,function(_0x210eaf){return db[_0x2401('0x61')]['findOrCreate']({'where':{'UserId':_0x210eaf['id'],'SmsQueueId':_0x5239d7['params']['id']},'transaction':_0x552ed1});});})[_0x2401('0x2c')](function(){_0x39d402[_0x2401('0x73')](function(_0x5b2dc4){socket['emit'](_0x2401('0x74'),{'UserId':_0x5b2dc4['id'],'SmsQueueId':_0x4c1f98['id']});});});});});}})['then'](respondWithStatusCode(_0x1540a8,null))[_0x2401('0x50')](handleError(_0x1540a8,null));};exports[_0x2401('0x75')]=function(_0x566007,_0x41efab,_0x234806){return db[_0x2401('0x6a')][_0x2401('0x4e')]({'where':{'id':_0x566007[_0x2401('0x3c')][_0x2401('0x76')]},'attributes':['id'],'include':[{'model':db[_0x2401('0x62')],'as':_0x2401('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x2401('0x2c')](handleEntityNotFound(_0x41efab,null))['then'](function(_0x2d476c){var _0x12ed6b=_[_0x2401('0x35')](_0x2d476c,'id');var _0x8d725b=[];var _0x55c65e=[];var _0x34582c=squel[_0x2401('0x77')]();_0x34582c[_0x2401('0x78')](_0x2401('0x79'))[_0x2401('0x7a')](_0x2401('0x7b'),'tq')[_0x2401('0x7c')](_0x2401('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2401('0x7e'),_0x566007[_0x2401('0x52')]['id']);for(var _0x268297=0x0;_0x268297<_0x2d476c[_0x2401('0x6b')];_0x268297+=0x1){let _0x65e4c3=_0x2d476c[_0x268297];for(var _0x2612a5=0x0;_0x2612a5<_0x65e4c3[_0x2401('0x6d')]['length'];_0x2612a5+=0x1){let _0x150553=_0x65e4c3[_0x2401('0x6d')][_0x2612a5];var _0x2edb79=_0x34582c['clone']();_0x2edb79['where'](_0x2401('0x7f'),_0x150553['id']);_0x55c65e[_0x2401('0x80')](db[_0x2401('0x81')][_0x2401('0x3c')](_0x2edb79[_0x2401('0x82')](),{'type':db['sequelize'][_0x2401('0x83')][_0x2401('0x84')]})[_0x2401('0x2c')](function(_0x2891ae){if(_0x2891ae['length']===0x1){return _0x150553['id'];}else{var _0x29e596=_['every'](_[_0x2401('0x35')](_0x2891ae,_0x2401('0x85')),function(_0x1a680a){return _[_0x2401('0x86')](_0x12ed6b,_0x1a680a);});if(_0x29e596){return _0x150553['id'];}}}));}}return BPromise[_0x2401('0x87')](_0x55c65e)[_0x2401('0x2c')](function(_0x296116){_0x8d725b=_(_0x8d725b)[_0x2401('0x88')](_0x296116)[_0x2401('0x89')]()[_0x2401('0x8a')]();return db[_0x2401('0x4a')][_0x2401('0x59')]({'where':{'id':_0x566007[_0x2401('0x52')]['id']}})[_0x2401('0x2c')](function(_0x49ac03){return db[_0x2401('0x81')][_0x2401('0x71')](function(_0x4a6b55){return _0x49ac03[_0x2401('0x75')](_0x566007['query'][_0x2401('0x76')],{'transaction':_0x4a6b55})[_0x2401('0x2c')](function(){if(!_[_0x2401('0x8b')](_0x8d725b)){return _0x49ac03[_0x2401('0x8c')](_0x8d725b,{'transaction':_0x4a6b55});}})[_0x2401('0x2c')](function(){_0x8d725b['forEach'](function(_0xe9c49b){socket['emit'](_0x2401('0x8d'),{'UserId':_0xe9c49b,'SmsQueueId':_0x49ac03['id']});});});});});});})[_0x2401('0x2c')](respondWithStatusCode(_0x41efab,null))[_0x2401('0x50')](handleError(_0x41efab,null));};exports['addAgents']=function(_0x2feb31,_0x5c770a,_0x869c25){return db[_0x2401('0x4a')][_0x2401('0x59')]({'where':{'id':_0x2feb31['params']['id']}})[_0x2401('0x2c')](handleEntityNotFound(_0x5c770a,null))[_0x2401('0x2c')](function(_0x1b1d81){if(_0x1b1d81){return _0x1b1d81[_0x2401('0x8e')](_0x2feb31[_0x2401('0x54')][_0x2401('0x76')],_[_0x2401('0x8f')](_0x2feb31[_0x2401('0x54')],[_0x2401('0x76'),'id'])||{})['spread'](function(_0x2aad28){for(var _0x4f1b68=0x0;_0x4f1b68<_0x2feb31['body'][_0x2401('0x76')][_0x2401('0x6b')];_0x4f1b68+=0x1){socket[_0x2401('0x90')](_0x2401('0x74'),{'UserId':Number(_0x2feb31[_0x2401('0x54')][_0x2401('0x76')][_0x4f1b68]),'SmsQueueId':Number(_0x2feb31[_0x2401('0x52')]['id'])});}return _0x2aad28;});}})[_0x2401('0x2c')](respondWithResult(_0x5c770a,null))[_0x2401('0x50')](handleError(_0x5c770a,null));};exports[_0x2401('0x8c')]=function(_0x595e5d,_0x37ed20,_0x588d6d){return db['SmsQueue'][_0x2401('0x59')]({'where':{'id':_0x595e5d[_0x2401('0x52')]['id']}})[_0x2401('0x2c')](handleEntityNotFound(_0x37ed20,null))[_0x2401('0x2c')](function(_0x38fb48){if(_0x38fb48){return _0x38fb48[_0x2401('0x8c')](_0x595e5d[_0x2401('0x3c')][_0x2401('0x76')])[_0x2401('0x2c')](function(){if(_[_0x2401('0x91')](_0x595e5d['query'][_0x2401('0x76')])){for(var _0x2c206f=0x0;_0x2c206f<_0x595e5d[_0x2401('0x3c')][_0x2401('0x76')]['length'];_0x2c206f+=0x1){socket[_0x2401('0x90')](_0x2401('0x8d'),{'UserId':Number(_0x595e5d[_0x2401('0x3c')][_0x2401('0x76')][_0x2c206f]),'SmsQueueId':Number(_0x595e5d[_0x2401('0x52')]['id'])});}}else{socket['emit'](_0x2401('0x8d'),{'UserId':Number(_0x595e5d[_0x2401('0x3c')]['ids']),'SmsQueueId':Number(_0x595e5d[_0x2401('0x52')]['id'])});}});}})[_0x2401('0x2c')](respondWithStatusCode(_0x37ed20,null))[_0x2401('0x50')](handleError(_0x37ed20,null));};exports[_0x2401('0x92')]=function(_0x5b8c66,_0x426cb7,_0x16f2eb){var _0x12551a={};var _0x47b002={};var _0xbc469a;var _0x1c0ed0;return db[_0x2401('0x4a')][_0x2401('0x5e')]({'where':{'id':_0x5b8c66['params']['id']}})[_0x2401('0x2c')](handleEntityNotFound(_0x426cb7,null))['then'](function(_0x323772){if(_0x323772){_0xbc469a=_0x323772;_0x47b002[_0x2401('0x3a')]=_['keys'](db['User'][_0x2401('0x36')]);_0x47b002[_0x2401('0x3c')]=_[_0x2401('0x3b')](_0x5b8c66[_0x2401('0x3c')]);_0x47b002[_0x2401('0x3d')]=_[_0x2401('0x3f')](_0x47b002[_0x2401('0x3a')],_0x47b002['query']);_0x12551a[_0x2401('0x3e')]=_['intersection'](_0x47b002[_0x2401('0x3a')],qs[_0x2401('0x40')](_0x5b8c66[_0x2401('0x3c')][_0x2401('0x40')]));_0x12551a['attributes']=_0x12551a[_0x2401('0x3e')]['length']?_0x12551a[_0x2401('0x3e')]:_0x47b002[_0x2401('0x3a')];_0x12551a[_0x2401('0x5f')]=qs[_0x2401('0x43')](_0x5b8c66[_0x2401('0x3c')]['sort']);_0x12551a[_0x2401('0x44')]=qs[_0x2401('0x3d')](_[_0x2401('0x45')](_0x5b8c66['query'],_0x47b002['filters']));if(_0x5b8c66['query'][_0x2401('0x46')]){_0x12551a[_0x2401('0x44')]=_[_0x2401('0x47')](_0x12551a[_0x2401('0x44')],{'$or':_[_0x2401('0x35')](_0x12551a[_0x2401('0x3e')],function(_0x5f3123){var _0x108221={};_0x108221[_0x5f3123]={'$like':'%'+_0x5b8c66[_0x2401('0x3c')][_0x2401('0x46')]+'%'};return _0x108221;})});}_0x12551a=_[_0x2401('0x47')]({},_0x12551a,_0x5b8c66['options']);return _0xbc469a[_0x2401('0x92')](_0x12551a);}})[_0x2401('0x2c')](function(_0x198122){if(_0x198122){_0x1c0ed0=_0x198122['length'];if(!_0x5b8c66[_0x2401('0x3c')]['hasOwnProperty'](_0x2401('0x42'))){_0x12551a[_0x2401('0x26')]=qs[_0x2401('0x26')](_0x5b8c66[_0x2401('0x3c')][_0x2401('0x26')]);_0x12551a[_0x2401('0x25')]=qs[_0x2401('0x25')](_0x5b8c66['query'][_0x2401('0x25')]);}return _0xbc469a['getAgents'](_0x12551a);}})[_0x2401('0x2c')](function(_0x405d20){if(_0x405d20){return _0x405d20?{'count':_0x1c0ed0,'rows':_0x405d20}:null;}})['then'](respondWithResult(_0x426cb7,null))[_0x2401('0x50')](handleError(_0x426cb7,null));}; \ No newline at end of file +var _0x5210=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','SmsQueue','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','count','includeAll','rows','catch','show','params','include','options','create','body','role','user','SmsQueues','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','nolimit','addTeams','ids','online','voicePause','Agents','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5a14cc,_0x9826ab){var _0x270cfc=function(_0x40b268){while(--_0x40b268){_0x5a14cc['push'](_0x5a14cc['shift']());}};_0x270cfc(++_0x9826ab);}(_0x5210,0x1a1));var _0x0521=function(_0x1feaab,_0x546eb6){_0x1feaab=_0x1feaab-0x0;var _0x5bf7c5=_0x5210[_0x1feaab];return _0x5bf7c5;};'use strict';var emlformat=require(_0x0521('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0521('0x1'));var rp=require(_0x0521('0x2'));var moment=require(_0x0521('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0521('0x4'));var util=require(_0x0521('0x5'));var path=require(_0x0521('0x6'));var sox=require(_0x0521('0x7'));var csv=require(_0x0521('0x8'));var ejs=require(_0x0521('0x9'));var fs=require('fs');var fs_extra=require(_0x0521('0xa'));var _=require(_0x0521('0xb'));var squel=require(_0x0521('0xc'));var crypto=require(_0x0521('0xd'));var jsforce=require(_0x0521('0xe'));var deskjs=require(_0x0521('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0521('0x10'));var Papa=require(_0x0521('0x11'));var Redis=require(_0x0521('0x12'));var authService=require(_0x0521('0x13'));var qs=require(_0x0521('0x14'));var as=require(_0x0521('0x15'));var hardwareService=require(_0x0521('0x16'));var logger=require(_0x0521('0x17'))(_0x0521('0x18'));var utils=require(_0x0521('0x19'));var config=require(_0x0521('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0521('0x1b')]=_[_0x0521('0x1c')](config[_0x0521('0x1b')],{'host':_0x0521('0x1d'),'port':0x18eb});var socket=require(_0x0521('0x1e'))(new Redis(config[_0x0521('0x1b')]));require(_0x0521('0x1f'))['register'](socket);function respondWithStatusCode(_0x3fad84,_0x878319){_0x878319=_0x878319||0xcc;return function(_0x47137b){if(_0x47137b){return _0x3fad84[_0x0521('0x20')](_0x878319);}return _0x3fad84[_0x0521('0x21')](_0x878319)[_0x0521('0x22')]();};}function respondWithResult(_0xd87f52,_0x3b58fb){_0x3b58fb=_0x3b58fb||0xc8;return function(_0x159ce6){if(_0x159ce6){return _0xd87f52[_0x0521('0x21')](_0x3b58fb)[_0x0521('0x23')](_0x159ce6);}};}function respondWithFilteredResult(_0x5895a2,_0x3aba16){return function(_0x3395ae){if(_0x3395ae){var _0x4800c6=typeof _0x3aba16['offset']==='undefined'&&typeof _0x3aba16[_0x0521('0x24')]===_0x0521('0x25');var _0x3f9c9b=_0x3395ae['count'];var _0x2a9c0=_0x4800c6?0x0:_0x3aba16[_0x0521('0x26')];var _0x3072a5=_0x4800c6?_0x3395ae['count']:_0x3aba16[_0x0521('0x26')]+_0x3aba16[_0x0521('0x24')];var _0x538757;if(_0x3072a5>=_0x3f9c9b){_0x3072a5=_0x3f9c9b;_0x538757=0xc8;}else{_0x538757=0xce;}_0x5895a2['status'](_0x538757);return _0x5895a2[_0x0521('0x27')](_0x0521('0x28'),_0x2a9c0+'-'+_0x3072a5+'/'+_0x3f9c9b)[_0x0521('0x23')](_0x3395ae);}return null;};}function patchUpdates(_0x198334){return function(_0x10606c){try{jsonpatch[_0x0521('0x29')](_0x10606c,_0x198334,!![]);}catch(_0x5b9364){return BPromise[_0x0521('0x2a')](_0x5b9364);}return _0x10606c[_0x0521('0x2b')]();};}function saveUpdates(_0x38f3fc,_0x598a02){return function(_0x5c935d){if(_0x5c935d){return _0x5c935d[_0x0521('0x2c')](_0x38f3fc)[_0x0521('0x2d')](function(_0x3307ce){return _0x3307ce;});}return null;};}function removeEntity(_0x247b1e,_0x13c4df){return function(_0x2d7e23){if(_0x2d7e23){return _0x2d7e23[_0x0521('0x2e')]()['then'](function(){var _0x696fce=_0x2d7e23[_0x0521('0x2f')]({'plain':!![]});var _0x502f13='SmsQueues';return db[_0x0521('0x30')]['destroy']({'where':{'type':_0x502f13,'resourceId':_0x696fce['id']}})['then'](function(){return _0x2d7e23;});})[_0x0521('0x2d')](function(){_0x247b1e[_0x0521('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4c75,_0x29f56f){return function(_0x46e871){if(!_0x46e871){_0x4b4c75[_0x0521('0x20')](0x194);}return _0x46e871;};}function handleError(_0x519883,_0x224313){_0x224313=_0x224313||0x1f4;return function(_0xaa56f5){logger[_0x0521('0x31')](_0xaa56f5['stack']);if(_0xaa56f5[_0x0521('0x32')]){delete _0xaa56f5[_0x0521('0x32')];}_0x519883['status'](_0x224313)[_0x0521('0x33')](_0xaa56f5);};}exports[_0x0521('0x34')]=function(_0x44796b,_0x548f5e){var _0x3b4f7d={},_0x1efb34={},_0x2f956d={'count':0x0,'rows':[]};var _0x25e4ac=_['map'](db[_0x0521('0x35')][_0x0521('0x36')],function(_0x78716c){return{'name':_0x78716c['fieldName'],'type':_0x78716c[_0x0521('0x37')][_0x0521('0x38')]};});_0x1efb34[_0x0521('0x39')]=_[_0x0521('0x3a')](_0x25e4ac,_0x0521('0x32'));_0x1efb34['query']=_[_0x0521('0x3b')](_0x44796b[_0x0521('0x3c')]);_0x1efb34[_0x0521('0x3d')]=_[_0x0521('0x3e')](_0x1efb34[_0x0521('0x39')],_0x1efb34[_0x0521('0x3c')]);_0x3b4f7d[_0x0521('0x3f')]=_[_0x0521('0x3e')](_0x1efb34['model'],qs[_0x0521('0x40')](_0x44796b[_0x0521('0x3c')][_0x0521('0x40')]));_0x3b4f7d['attributes']=_0x3b4f7d[_0x0521('0x3f')][_0x0521('0x41')]?_0x3b4f7d[_0x0521('0x3f')]:_0x1efb34[_0x0521('0x39')];if(!_0x44796b[_0x0521('0x3c')][_0x0521('0x42')]('nolimit')){_0x3b4f7d['limit']=qs[_0x0521('0x24')](_0x44796b[_0x0521('0x3c')]['limit']);_0x3b4f7d[_0x0521('0x26')]=qs[_0x0521('0x26')](_0x44796b['query'][_0x0521('0x26')]);}_0x3b4f7d[_0x0521('0x43')]=qs[_0x0521('0x44')](_0x44796b[_0x0521('0x3c')][_0x0521('0x44')]);_0x3b4f7d[_0x0521('0x45')]=qs['filters'](_['pick'](_0x44796b[_0x0521('0x3c')],_0x1efb34[_0x0521('0x3d')]),_0x25e4ac);if(_0x44796b['query'][_0x0521('0x46')]){_0x3b4f7d[_0x0521('0x45')]=_[_0x0521('0x47')](_0x3b4f7d[_0x0521('0x45')],{'$or':_[_0x0521('0x3a')](_0x25e4ac,function(_0x2a0d06){if(_0x2a0d06['type']!=='VIRTUAL'){var _0x3fb54d={};_0x3fb54d[_0x2a0d06[_0x0521('0x32')]]={'$like':'%'+_0x44796b[_0x0521('0x3c')]['filter']+'%'};return _0x3fb54d;}})});}_0x3b4f7d=_[_0x0521('0x47')]({},_0x3b4f7d,_0x44796b['options']);var _0x5aa295={'where':_0x3b4f7d[_0x0521('0x45')]};return db[_0x0521('0x35')]['count'](_0x5aa295)['then'](function(_0x42ff0b){_0x2f956d[_0x0521('0x48')]=_0x42ff0b;if(_0x44796b['query'][_0x0521('0x49')]){_0x3b4f7d['include']=[{'all':!![]}];}return db[_0x0521('0x35')]['findAll'](_0x3b4f7d);})['then'](function(_0x32e79f){_0x2f956d[_0x0521('0x4a')]=_0x32e79f;return _0x2f956d;})[_0x0521('0x2d')](respondWithFilteredResult(_0x548f5e,_0x3b4f7d))[_0x0521('0x4b')](handleError(_0x548f5e,null));};exports[_0x0521('0x4c')]=function(_0x1eaf0a,_0x4817ee){var _0x450129={'raw':!![],'where':{'id':_0x1eaf0a[_0x0521('0x4d')]['id']}},_0x3cfe6e={};_0x3cfe6e[_0x0521('0x39')]=_[_0x0521('0x3b')](db[_0x0521('0x35')][_0x0521('0x36')]);_0x3cfe6e[_0x0521('0x3c')]=_['keys'](_0x1eaf0a['query']);_0x3cfe6e['filters']=_['intersection'](_0x3cfe6e['model'],_0x3cfe6e[_0x0521('0x3c')]);_0x450129[_0x0521('0x3f')]=_[_0x0521('0x3e')](_0x3cfe6e[_0x0521('0x39')],qs['fields'](_0x1eaf0a[_0x0521('0x3c')][_0x0521('0x40')]));_0x450129[_0x0521('0x3f')]=_0x450129[_0x0521('0x3f')][_0x0521('0x41')]?_0x450129['attributes']:_0x3cfe6e[_0x0521('0x39')];if(_0x1eaf0a[_0x0521('0x3c')][_0x0521('0x49')]){_0x450129[_0x0521('0x4e')]=[{'all':!![]}];}_0x450129=_[_0x0521('0x47')]({},_0x450129,_0x1eaf0a[_0x0521('0x4f')]);return db[_0x0521('0x35')]['find'](_0x450129)[_0x0521('0x2d')](handleEntityNotFound(_0x4817ee,null))[_0x0521('0x2d')](respondWithResult(_0x4817ee,null))[_0x0521('0x4b')](handleError(_0x4817ee,null));};exports[_0x0521('0x50')]=function(_0x3e6b30,_0x3ec015){return db['SmsQueue'][_0x0521('0x50')](_0x3e6b30[_0x0521('0x51')],{})[_0x0521('0x2d')](function(_0x2f15da){var _0x27f037=_0x3e6b30['user']['get']({'plain':!![]});if(!_0x27f037)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27f037[_0x0521('0x52')]===_0x0521('0x53')){var _0x28055e=_0x2f15da['get']({'plain':!![]});var _0x1be66d=_0x0521('0x54');return db[_0x0521('0x55')][_0x0521('0x56')]({'where':{'name':_0x1be66d,'userProfileId':_0x27f037['userProfileId']},'raw':!![]})[_0x0521('0x2d')](function(_0xa36bb5){if(_0xa36bb5&&_0xa36bb5[_0x0521('0x57')]===0x0){return db[_0x0521('0x30')][_0x0521('0x50')]({'name':_0x28055e[_0x0521('0x32')],'resourceId':_0x28055e['id'],'type':_0xa36bb5['name'],'sectionId':_0xa36bb5['id']},{})['then'](function(){return _0x2f15da;});}else{return _0x2f15da;}})['catch'](function(_0x201af8){logger[_0x0521('0x31')](_0x0521('0x58'),_0x201af8);throw _0x201af8;});}return _0x2f15da;})[_0x0521('0x2d')](respondWithResult(_0x3ec015,0xc9))[_0x0521('0x4b')](handleError(_0x3ec015,null));};exports[_0x0521('0x2c')]=function(_0x5a6817,_0x3f3c4b){if(_0x5a6817['body']['id']){delete _0x5a6817[_0x0521('0x51')]['id'];}return db[_0x0521('0x35')][_0x0521('0x56')]({'where':{'id':_0x5a6817['params']['id']}})[_0x0521('0x2d')](handleEntityNotFound(_0x3f3c4b,null))[_0x0521('0x2d')](saveUpdates(_0x5a6817[_0x0521('0x51')],null))[_0x0521('0x2d')](respondWithResult(_0x3f3c4b,null))[_0x0521('0x4b')](handleError(_0x3f3c4b,null));};exports['destroy']=function(_0x43fd1e,_0x592e72){return db['SmsQueue'][_0x0521('0x56')]({'where':{'id':_0x43fd1e['params']['id']}})[_0x0521('0x2d')](handleEntityNotFound(_0x592e72,null))[_0x0521('0x2d')](removeEntity(_0x592e72,null))[_0x0521('0x4b')](handleError(_0x592e72,null));};exports['describe']=function(_0x58fc95,_0x334fdc){return db[_0x0521('0x35')][_0x0521('0x59')]()[_0x0521('0x2d')](respondWithResult(_0x334fdc,null))[_0x0521('0x4b')](handleError(_0x334fdc,null));};exports[_0x0521('0x5a')]=function(_0xab6c04,_0x366b42,_0x545eb1){var _0x2669d2={'raw':!![],'where':{}},_0x18e092={},_0xf36a80;return db[_0x0521('0x35')][_0x0521('0x5b')]({'where':{'id':_0xab6c04[_0x0521('0x4d')]['id']}})[_0x0521('0x2d')](handleEntityNotFound(_0x366b42,null))[_0x0521('0x2d')](function(_0x1e0165){if(_0x1e0165){_0xf36a80=_0x1e0165[_0x0521('0x2f')]({'plain':!![]});_0x18e092[_0x0521('0x39')]=_[_0x0521('0x3b')](db[_0x0521('0x5c')][_0x0521('0x36')]);_0x18e092[_0x0521('0x3c')]=_[_0x0521('0x3b')](_0xab6c04[_0x0521('0x3c')]);_0x18e092[_0x0521('0x3d')]=_[_0x0521('0x3e')](_0x18e092[_0x0521('0x39')],_0x18e092[_0x0521('0x3c')]);_0x2669d2['attributes']=_[_0x0521('0x3e')](_0x18e092[_0x0521('0x39')],qs['fields'](_0xab6c04[_0x0521('0x3c')][_0x0521('0x40')]));_0x2669d2[_0x0521('0x3f')]=_0x2669d2[_0x0521('0x3f')][_0x0521('0x41')]?_0x2669d2[_0x0521('0x3f')]:_0x18e092[_0x0521('0x39')];if(!_0xab6c04[_0x0521('0x3c')]['hasOwnProperty']('nolimit')){_0x2669d2[_0x0521('0x24')]=qs[_0x0521('0x24')](_0xab6c04[_0x0521('0x3c')][_0x0521('0x24')]);_0x2669d2['offset']=qs['offset'](_0xab6c04[_0x0521('0x3c')][_0x0521('0x26')]);}_0x2669d2[_0x0521('0x43')]=qs[_0x0521('0x44')](_0xab6c04[_0x0521('0x3c')]['sort']);_0x2669d2['where']=qs[_0x0521('0x3d')](_[_0x0521('0x5d')](_0xab6c04[_0x0521('0x3c')],_0x18e092[_0x0521('0x3d')]));_0x2669d2[_0x0521('0x45')][_0x0521('0x5e')]=_0x1e0165['id'];if(_0xab6c04['query']['filter']){_0x2669d2['where']=_['merge'](_0x2669d2['where'],{'$or':_[_0x0521('0x3a')](_0x2669d2[_0x0521('0x3f')],function(_0x3e333e){var _0x2c8b0e={};_0x2c8b0e[_0x3e333e]={'$like':'%'+_0xab6c04[_0x0521('0x3c')]['filter']+'%'};return _0x2c8b0e;})});}_0x2669d2=_[_0x0521('0x47')]({},_0x2669d2,_0xab6c04[_0x0521('0x4f')]);return db['UserSmsQueue'][_0x0521('0x5f')](_0x2669d2);}})[_0x0521('0x2d')](function(_0x1624ea){if(_0x1624ea){return db[_0x0521('0x60')][_0x0521('0x61')]({'where':{'id':_['map'](_0x1624ea,_0x0521('0x62')),'role':_0x0521('0x63')},'attributes':['id',_0x0521('0x32'),_0x0521('0x64'),_0x0521('0x65'),_0x0521('0x66')]});}})['then'](function(_0xd47e8f){if(_0xd47e8f){return{'count':_0xd47e8f[_0x0521('0x48')],'rows':_[_0x0521('0x3a')](_0xd47e8f['rows'],function(_0x5dbe3b){return{'membername':_0x5dbe3b[_0x0521('0x32')],'UserId':_0x5dbe3b['id'],'queue_name':_0xf36a80[_0x0521('0x32')],'SmsQueueId':_0xf36a80['id'],'interface':util[_0x0521('0x67')](_0x0521('0x68'),_0x0521('0x69'),_0x5dbe3b[_0x0521('0x32')]),'penalty':0x0,'paused':_0x5dbe3b[_0x0521('0x64')],'createdAt':_0x5dbe3b[_0x0521('0x66')],'updatedAt':_0x5dbe3b[_0x0521('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x366b42,_0x2669d2))[_0x0521('0x4b')](handleError(_0x366b42,null));};exports['getTeams']=function(_0x41c4d5,_0x48c67c,_0x16d12d){var _0x161c31={};var _0x2af83e={};var _0x3c14b4;var _0x540b92;return db[_0x0521('0x35')][_0x0521('0x5b')]({'where':{'id':_0x41c4d5[_0x0521('0x4d')]['id']}})[_0x0521('0x2d')](handleEntityNotFound(_0x48c67c,null))['then'](function(_0x5a296d){if(_0x5a296d){_0x3c14b4=_0x5a296d;_0x2af83e[_0x0521('0x39')]=_[_0x0521('0x3b')](db[_0x0521('0x6a')][_0x0521('0x36')]);_0x2af83e['query']=_[_0x0521('0x3b')](_0x41c4d5[_0x0521('0x3c')]);_0x2af83e['filters']=_[_0x0521('0x3e')](_0x2af83e[_0x0521('0x39')],_0x2af83e[_0x0521('0x3c')]);_0x161c31[_0x0521('0x3f')]=_[_0x0521('0x3e')](_0x2af83e[_0x0521('0x39')],qs[_0x0521('0x40')](_0x41c4d5[_0x0521('0x3c')][_0x0521('0x40')]));_0x161c31[_0x0521('0x3f')]=_0x161c31[_0x0521('0x3f')]['length']?_0x161c31[_0x0521('0x3f')]:_0x2af83e[_0x0521('0x39')];_0x161c31['order']=qs[_0x0521('0x44')](_0x41c4d5['query']['sort']);_0x161c31['where']=qs[_0x0521('0x3d')](_[_0x0521('0x5d')](_0x41c4d5[_0x0521('0x3c')],_0x2af83e['filters']));if(_0x41c4d5['query'][_0x0521('0x46')]){_0x161c31[_0x0521('0x45')]=_[_0x0521('0x47')](_0x161c31[_0x0521('0x45')],{'$or':_['map'](_0x161c31[_0x0521('0x3f')],function(_0x5317e5){var _0x49bf0d={};_0x49bf0d[_0x5317e5]={'$like':'%'+_0x41c4d5[_0x0521('0x3c')]['filter']+'%'};return _0x49bf0d;})});}_0x161c31=_['merge']({},_0x161c31,_0x41c4d5[_0x0521('0x4f')]);return _0x3c14b4[_0x0521('0x6b')](_0x161c31);}})[_0x0521('0x2d')](function(_0x3937e4){if(_0x3937e4){_0x540b92=_0x3937e4[_0x0521('0x41')];if(!_0x41c4d5[_0x0521('0x3c')][_0x0521('0x42')](_0x0521('0x6c'))){_0x161c31[_0x0521('0x24')]=qs[_0x0521('0x24')](_0x41c4d5[_0x0521('0x3c')][_0x0521('0x24')]);_0x161c31['offset']=qs['offset'](_0x41c4d5[_0x0521('0x3c')][_0x0521('0x26')]);}return _0x3c14b4[_0x0521('0x6b')](_0x161c31);}})[_0x0521('0x2d')](function(_0x2c119a){if(_0x2c119a){return _0x2c119a?{'count':_0x540b92,'rows':_0x2c119a}:null;}})[_0x0521('0x2d')](respondWithResult(_0x48c67c,null))['catch'](handleError(_0x48c67c,null));};exports[_0x0521('0x6d')]=function(_0x5d1683,_0x4c0aa1,_0x3e6548){var _0x16af88=_0x5d1683['body'][_0x0521('0x6e')];return db[_0x0521('0x6a')][_0x0521('0x5f')]({'where':{'id':_0x16af88},'attributes':['id'],'include':[{'model':db[_0x0521('0x60')],'as':'Agents','attributes':['id','name',_0x0521('0x6f'),_0x0521('0x70'),'interface'],'raw':!![]}]})[_0x0521('0x2d')](function(_0x16d700){if(_0x16d700){var _0x5bda6e=_['flatMap'](_0x16d700,function(_0x5a0719){var _0xc13652=_0x5a0719[_0x0521('0x2f')]({'plain':!![]});return _0xc13652[_0x0521('0x71')];});return db[_0x0521('0x35')][_0x0521('0x56')]({'where':{'id':_0x5d1683['params']['id']}})[_0x0521('0x2d')](function(_0x421076){return db[_0x0521('0x72')][_0x0521('0x73')](function(_0x13944c){return _0x421076[_0x0521('0x6d')](_0x16af88,{'transaction':_0x13944c})['then'](function(){return BPromise[_0x0521('0x74')](_0x5bda6e,function(_0x4a2403){return db['UserSmsQueue'][_0x0521('0x75')]({'where':{'UserId':_0x4a2403['id'],'SmsQueueId':_0x5d1683[_0x0521('0x4d')]['id']},'transaction':_0x13944c});});})['then'](function(){_0x5bda6e['forEach'](function(_0x43cbbc){socket[_0x0521('0x76')]('userSmsQueue:save',{'UserId':_0x43cbbc['id'],'SmsQueueId':_0x421076['id']});});});});});}})['then'](respondWithStatusCode(_0x4c0aa1,null))[_0x0521('0x4b')](handleError(_0x4c0aa1,null));};exports[_0x0521('0x77')]=function(_0x457620,_0x322579,_0x43250f){return db[_0x0521('0x6a')][_0x0521('0x5f')]({'where':{'id':_0x457620[_0x0521('0x3c')][_0x0521('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x0521('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x322579,null))['then'](function(_0x5344c0){var _0x27218f=_['map'](_0x5344c0,'id');var _0x5ddbfa=[];var _0x48f066=[];var _0x455411=squel[_0x0521('0x78')]();_0x455411[_0x0521('0x79')](_0x0521('0x7a'))['from'](_0x0521('0x7b'),'tq')['join']('user_has_teams','ut',_0x0521('0x7c'))[_0x0521('0x45')]('SmsQueueId\x20=\x20?',_0x457620[_0x0521('0x4d')]['id']);for(var _0x401b88=0x0;_0x401b88<_0x5344c0[_0x0521('0x41')];_0x401b88+=0x1){let _0x597e66=_0x5344c0[_0x401b88];for(var _0xeac3a7=0x0;_0xeac3a7<_0x597e66[_0x0521('0x71')][_0x0521('0x41')];_0xeac3a7+=0x1){let _0x294245=_0x597e66[_0x0521('0x71')][_0xeac3a7];var _0xcaddc2=_0x455411['clone']();_0xcaddc2[_0x0521('0x45')](_0x0521('0x7d'),_0x294245['id']);_0x48f066[_0x0521('0x7e')](db['sequelize'][_0x0521('0x3c')](_0xcaddc2[_0x0521('0x7f')](),{'type':db[_0x0521('0x72')][_0x0521('0x80')][_0x0521('0x81')]})[_0x0521('0x2d')](function(_0x4a8b70){if(_0x4a8b70[_0x0521('0x41')]===0x1){return _0x294245['id'];}else{var _0x5280f8=_[_0x0521('0x82')](_[_0x0521('0x3a')](_0x4a8b70,'TeamId'),function(_0x49d43e){return _[_0x0521('0x83')](_0x27218f,_0x49d43e);});if(_0x5280f8){return _0x294245['id'];}}}));}}return BPromise[_0x0521('0x84')](_0x48f066)[_0x0521('0x2d')](function(_0x2f4bd3){_0x5ddbfa=_(_0x5ddbfa)[_0x0521('0x85')](_0x2f4bd3)[_0x0521('0x86')]()[_0x0521('0x87')]();return db[_0x0521('0x35')][_0x0521('0x56')]({'where':{'id':_0x457620[_0x0521('0x4d')]['id']}})['then'](function(_0x1d82e0){return db['sequelize'][_0x0521('0x73')](function(_0x3a8d25){return _0x1d82e0[_0x0521('0x77')](_0x457620['query'][_0x0521('0x6e')],{'transaction':_0x3a8d25})[_0x0521('0x2d')](function(){if(!_[_0x0521('0x88')](_0x5ddbfa)){return _0x1d82e0[_0x0521('0x89')](_0x5ddbfa,{'transaction':_0x3a8d25});}})['then'](function(){_0x5ddbfa[_0x0521('0x8a')](function(_0x2acb66){socket[_0x0521('0x76')](_0x0521('0x8b'),{'UserId':_0x2acb66,'SmsQueueId':_0x1d82e0['id']});});});});});});})[_0x0521('0x2d')](respondWithStatusCode(_0x322579,null))['catch'](handleError(_0x322579,null));};exports[_0x0521('0x8c')]=function(_0x5ecb99,_0x267647,_0x1120ec){return db['SmsQueue'][_0x0521('0x56')]({'where':{'id':_0x5ecb99['params']['id']}})[_0x0521('0x2d')](handleEntityNotFound(_0x267647,null))['then'](function(_0x24515e){if(_0x24515e){return _0x24515e['addAgents'](_0x5ecb99[_0x0521('0x51')][_0x0521('0x6e')],_[_0x0521('0x8d')](_0x5ecb99[_0x0521('0x51')],[_0x0521('0x6e'),'id'])||{})['spread'](function(_0x20a17f){for(var _0x5ec323=0x0;_0x5ec323<_0x5ecb99['body']['ids'][_0x0521('0x41')];_0x5ec323+=0x1){socket[_0x0521('0x76')]('userSmsQueue:save',{'UserId':Number(_0x5ecb99[_0x0521('0x51')][_0x0521('0x6e')][_0x5ec323]),'SmsQueueId':Number(_0x5ecb99['params']['id'])});}return _0x20a17f;});}})[_0x0521('0x2d')](respondWithResult(_0x267647,null))[_0x0521('0x4b')](handleError(_0x267647,null));};exports[_0x0521('0x89')]=function(_0xf128d,_0x32bef7,_0x51dfd1){return db[_0x0521('0x35')][_0x0521('0x56')]({'where':{'id':_0xf128d[_0x0521('0x4d')]['id']}})[_0x0521('0x2d')](handleEntityNotFound(_0x32bef7,null))['then'](function(_0x20647d){if(_0x20647d){return _0x20647d[_0x0521('0x89')](_0xf128d['query'][_0x0521('0x6e')])['then'](function(){if(_[_0x0521('0x8e')](_0xf128d[_0x0521('0x3c')][_0x0521('0x6e')])){for(var _0x32b94a=0x0;_0x32b94a<_0xf128d[_0x0521('0x3c')]['ids'][_0x0521('0x41')];_0x32b94a+=0x1){socket[_0x0521('0x76')]('userSmsQueue:remove',{'UserId':Number(_0xf128d[_0x0521('0x3c')]['ids'][_0x32b94a]),'SmsQueueId':Number(_0xf128d[_0x0521('0x4d')]['id'])});}}else{socket[_0x0521('0x76')](_0x0521('0x8b'),{'UserId':Number(_0xf128d[_0x0521('0x3c')][_0x0521('0x6e')]),'SmsQueueId':Number(_0xf128d[_0x0521('0x4d')]['id'])});}});}})[_0x0521('0x2d')](respondWithStatusCode(_0x32bef7,null))[_0x0521('0x4b')](handleError(_0x32bef7,null));};exports[_0x0521('0x8f')]=function(_0x2ba7a5,_0x558be4,_0x28d03f){var _0x59d95b={};var _0x377e46={};var _0x103e04;var _0x39a30a;return db[_0x0521('0x35')][_0x0521('0x5b')]({'where':{'id':_0x2ba7a5[_0x0521('0x4d')]['id']}})[_0x0521('0x2d')](handleEntityNotFound(_0x558be4,null))[_0x0521('0x2d')](function(_0xfd4838){if(_0xfd4838){_0x103e04=_0xfd4838;_0x377e46[_0x0521('0x39')]=_[_0x0521('0x3b')](db['User'][_0x0521('0x36')]);_0x377e46[_0x0521('0x3c')]=_['keys'](_0x2ba7a5['query']);_0x377e46[_0x0521('0x3d')]=_[_0x0521('0x3e')](_0x377e46[_0x0521('0x39')],_0x377e46['query']);_0x59d95b[_0x0521('0x3f')]=_[_0x0521('0x3e')](_0x377e46[_0x0521('0x39')],qs[_0x0521('0x40')](_0x2ba7a5[_0x0521('0x3c')][_0x0521('0x40')]));_0x59d95b[_0x0521('0x3f')]=_0x59d95b[_0x0521('0x3f')][_0x0521('0x41')]?_0x59d95b['attributes']:_0x377e46[_0x0521('0x39')];_0x59d95b[_0x0521('0x43')]=qs[_0x0521('0x44')](_0x2ba7a5[_0x0521('0x3c')][_0x0521('0x44')]);_0x59d95b['where']=qs[_0x0521('0x3d')](_[_0x0521('0x5d')](_0x2ba7a5[_0x0521('0x3c')],_0x377e46[_0x0521('0x3d')]));if(_0x2ba7a5['query'][_0x0521('0x46')]){_0x59d95b['where']=_[_0x0521('0x47')](_0x59d95b[_0x0521('0x45')],{'$or':_[_0x0521('0x3a')](_0x59d95b['attributes'],function(_0x2dd2c0){var _0x1cec65={};_0x1cec65[_0x2dd2c0]={'$like':'%'+_0x2ba7a5['query']['filter']+'%'};return _0x1cec65;})});}_0x59d95b=_[_0x0521('0x47')]({},_0x59d95b,_0x2ba7a5[_0x0521('0x4f')]);return _0x103e04[_0x0521('0x8f')](_0x59d95b);}})[_0x0521('0x2d')](function(_0x1fd330){if(_0x1fd330){_0x39a30a=_0x1fd330[_0x0521('0x41')];if(!_0x2ba7a5['query']['hasOwnProperty'](_0x0521('0x6c'))){_0x59d95b[_0x0521('0x24')]=qs[_0x0521('0x24')](_0x2ba7a5[_0x0521('0x3c')]['limit']);_0x59d95b['offset']=qs[_0x0521('0x26')](_0x2ba7a5[_0x0521('0x3c')][_0x0521('0x26')]);}return _0x103e04[_0x0521('0x8f')](_0x59d95b);}})['then'](function(_0x4cb09f){if(_0x4cb09f){return _0x4cb09f?{'count':_0x39a30a,'rows':_0x4cb09f}:null;}})[_0x0521('0x2d')](respondWithResult(_0x558be4,null))[_0x0521('0x4b')](handleError(_0x558be4,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index ad66a2a..36fe830 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 _0x7c0a=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x4e3394,_0xf90364){var _0x3a5d65=function(_0x390985){while(--_0x390985){_0x4e3394['push'](_0x4e3394['shift']());}};_0x3a5d65(++_0xf90364);}(_0x7c0a,0x9c));var _0xa7c0=function(_0x4da626,_0x583923){_0x4da626=_0x4da626-0x0;var _0x28ba58=_0x7c0a[_0x4da626];return _0x28ba58;};'use strict';var EventEmitter=require(_0xa7c0('0x0'));var SmsQueue=require(_0xa7c0('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa7c0('0x2')](0x0);var events={'afterCreate':_0xa7c0('0x3'),'afterUpdate':_0xa7c0('0x4'),'afterDestroy':_0xa7c0('0x5')};function emitEvent(_0x4ae19f){return function(_0x93e272,_0x42e6a6,_0x2c6389){SmsQueueEvents['emit'](_0x4ae19f+':'+_0x93e272['id'],_0x93e272);SmsQueueEvents[_0xa7c0('0x6')](_0x4ae19f,_0x93e272);_0x2c6389(null);};}for(var e in events){if(events[_0xa7c0('0x7')](e)){var event=events[e];SmsQueue[_0xa7c0('0x8')](e,emitEvent(event));}}module[_0xa7c0('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xba95=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x1c09ba,_0x5eb0c0){var _0x4b3a39=function(_0x50ed32){while(--_0x50ed32){_0x1c09ba['push'](_0x1c09ba['shift']());}};_0x4b3a39(++_0x5eb0c0);}(_0xba95,0x1e0));var _0x5ba9=function(_0x4a96d3,_0x5056f0){_0x4a96d3=_0x4a96d3-0x0;var _0x5d08ef=_0xba95[_0x4a96d3];return _0x5d08ef;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x5ba9('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5ba9('0x1')](0x0);var events={'afterCreate':_0x5ba9('0x2'),'afterUpdate':_0x5ba9('0x3'),'afterDestroy':_0x5ba9('0x4')};function emitEvent(_0x25344c){return function(_0x8d14cd,_0x50d883,_0x517e5c){SmsQueueEvents[_0x5ba9('0x5')](_0x25344c+':'+_0x8d14cd['id'],_0x8d14cd);SmsQueueEvents['emit'](_0x25344c,_0x8d14cd);_0x517e5c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x5ba9('0x6')](e,emitEvent(event));}}module[_0x5ba9('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 4061a7b..7002c12 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 _0xcd7c=['./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xd96162,_0x12f9ec){var _0x56076b=function(_0x53148f){while(--_0x53148f){_0xd96162['push'](_0xd96162['shift']());}};_0x56076b(++_0x12f9ec);}(_0xcd7c,0x162));var _0xccd7=function(_0x36a8fc,_0x35a32e){_0x36a8fc=_0x36a8fc-0x0;var _0x22c1a1=_0xcd7c[_0x36a8fc];return _0x22c1a1;};'use strict';var _=require(_0xccd7('0x0'));var util=require(_0xccd7('0x1'));var logger=require(_0xccd7('0x2'))(_0xccd7('0x3'));var moment=require(_0xccd7('0x4'));var BPromise=require(_0xccd7('0x5'));var rp=require(_0xccd7('0x6'));var fs=require('fs');var path=require(_0xccd7('0x7'));var rimraf=require(_0xccd7('0x8'));var config=require(_0xccd7('0x9'));var attributes=require(_0xccd7('0xa'));module[_0xccd7('0xb')]=function(_0x330998,_0x510a7e){return _0x330998[_0xccd7('0xc')]('SmsQueue',attributes,{'tableName':_0xccd7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ed8=['define','SmsQueue','sms_queues','lodash','moment','bluebird','path','./smsQueue.attributes','exports'];(function(_0x17c4fa,_0x3395ef){var _0x297fe9=function(_0x2afdd0){while(--_0x2afdd0){_0x17c4fa['push'](_0x17c4fa['shift']());}};_0x297fe9(++_0x3395ef);}(_0x7ed8,0x13e));var _0x87ed=function(_0x3419cf,_0x49e526){_0x3419cf=_0x3419cf-0x0;var _0x3efb16=_0x7ed8[_0x3419cf];return _0x3efb16;};'use strict';var _=require(_0x87ed('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x87ed('0x1'));var BPromise=require(_0x87ed('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87ed('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x87ed('0x4'));module[_0x87ed('0x5')]=function(_0x12052c,_0x21af67){return _0x12052c[_0x87ed('0x6')](_0x87ed('0x7'),attributes,{'tableName':_0x87ed('0x8'),'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 51efb87..96745e0 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 _0x8d3e=['findAll','options','raw','where','attributes','map','model','include','then','debug','find','ShowSmsQueue','lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsQueue.socket','request','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetSmsQueue','SmsQueue'];(function(_0x4c25cb,_0xce5c6c){var _0x5a61f2=function(_0x5ad642){while(--_0x5ad642){_0x4c25cb['push'](_0x4c25cb['shift']());}};_0x5a61f2(++_0xce5c6c);}(_0x8d3e,0x1bc));var _0xe8d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d3e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8d3('0x0'));var util=require('util');var moment=require(_0xe8d3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8d3('0x2'))['db'];var utils=require(_0xe8d3('0x3'));var logger=require('../../config/logger')(_0xe8d3('0x4'));var config=require(_0xe8d3('0x5'));var jayson=require(_0xe8d3('0x6'));var client=jayson['client'][_0xe8d3('0x7')]({'port':0x232a});config[_0xe8d3('0x8')]=_[_0xe8d3('0x9')](config[_0xe8d3('0x8')],{'host':_0xe8d3('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe8d3('0x8')]));require(_0xe8d3('0xb'))['register'](socket);function respondWithRpcPromise(_0x3a3b24,_0x21880d,_0x139ab9){return new BPromise(function(_0x5ca1a0,_0x2a6e2c){return client[_0xe8d3('0xc')](_0x3a3b24,_0x139ab9)['then'](function(_0x27b4a2){logger['info'](_0xe8d3('0xd'),_0x21880d,_0xe8d3('0xe'));logger['debug'](_0xe8d3('0xf'),_0x21880d,_0xe8d3('0xe'),JSON[_0xe8d3('0x10')](_0x27b4a2));if(_0x27b4a2['error']){if(_0x27b4a2[_0xe8d3('0x11')]['code']===0x1f4){logger[_0xe8d3('0x11')](_0xe8d3('0xd'),_0x21880d,_0x27b4a2[_0xe8d3('0x11')][_0xe8d3('0x12')]);return _0x2a6e2c(_0x27b4a2[_0xe8d3('0x11')][_0xe8d3('0x12')]);}logger[_0xe8d3('0x11')]('SmsQueue,\x20%s,\x20%s',_0x21880d,_0x27b4a2[_0xe8d3('0x11')][_0xe8d3('0x12')]);return _0x5ca1a0(_0x27b4a2[_0xe8d3('0x11')]['message']);}else{logger[_0xe8d3('0x13')]('SmsQueue,\x20%s,\x20%s',_0x21880d,'request\x20sent');_0x5ca1a0(_0x27b4a2[_0xe8d3('0x14')][_0xe8d3('0x12')]);}})[_0xe8d3('0x15')](function(_0x2811d7){logger[_0xe8d3('0x11')](_0xe8d3('0xd'),_0x21880d,_0x2811d7);_0x2a6e2c(_0x2811d7);});});}exports[_0xe8d3('0x16')]=function(_0x2a9f39){var _0x2f4458=this;return new Promise(function(_0x4d1f79,_0x321d3c){return db[_0xe8d3('0x17')][_0xe8d3('0x18')]({'raw':_0x2a9f39[_0xe8d3('0x19')]?_0x2a9f39[_0xe8d3('0x19')][_0xe8d3('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a9f39[_0xe8d3('0x19')]?_0x2a9f39[_0xe8d3('0x19')][_0xe8d3('0x1b')]||null:null,'attributes':_0x2a9f39[_0xe8d3('0x19')]?_0x2a9f39[_0xe8d3('0x19')][_0xe8d3('0x1c')]||null:null,'limit':_0x2a9f39['options']?_0x2a9f39[_0xe8d3('0x19')]['limit']||null:null,'include':_0x2a9f39[_0xe8d3('0x19')]?_0x2a9f39[_0xe8d3('0x19')]['include']?_[_0xe8d3('0x1d')](_0x2a9f39[_0xe8d3('0x19')]['include'],function(_0x1c9a77){return{'model':db[_0x1c9a77[_0xe8d3('0x1e')]],'as':_0x1c9a77['as'],'attributes':_0x1c9a77['attributes'],'include':_0x1c9a77[_0xe8d3('0x1f')]?_[_0xe8d3('0x1d')](_0x1c9a77[_0xe8d3('0x1f')],function(_0x4ee081){return{'model':db[_0x4ee081[_0xe8d3('0x1e')]],'as':_0x4ee081['as'],'attributes':_0x4ee081['attributes'],'include':_0x4ee081[_0xe8d3('0x1f')]?_[_0xe8d3('0x1d')](_0x4ee081[_0xe8d3('0x1f')],function(_0x461eeb){return{'model':db[_0x461eeb[_0xe8d3('0x1e')]],'as':_0x461eeb['as'],'attributes':_0x461eeb[_0xe8d3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe8d3('0x20')](function(_0x2e6c2e){logger[_0xe8d3('0x13')](_0xe8d3('0x16'),_0x2a9f39);logger[_0xe8d3('0x21')](_0xe8d3('0x16'),_0x2a9f39,JSON[_0xe8d3('0x10')](_0x2e6c2e));_0x4d1f79(_0x2e6c2e);})[_0xe8d3('0x15')](function(_0x8402d2){logger[_0xe8d3('0x11')](_0xe8d3('0x16'),_0x8402d2[_0xe8d3('0x12')],_0x2a9f39);_0x321d3c(_0x2f4458[_0xe8d3('0x11')](0x1f4,_0x8402d2[_0xe8d3('0x12')]));});});};exports['ShowSmsQueue']=function(_0x37f475){var _0x23ddfb=this;return new Promise(function(_0x1c090e,_0x1636fe){return db[_0xe8d3('0x17')][_0xe8d3('0x22')]({'raw':_0x37f475[_0xe8d3('0x19')]?_0x37f475[_0xe8d3('0x19')][_0xe8d3('0x1a')]===undefined?!![]:![]:!![],'where':_0x37f475[_0xe8d3('0x19')]?_0x37f475[_0xe8d3('0x19')]['where']||null:null,'attributes':_0x37f475[_0xe8d3('0x19')]?_0x37f475['options'][_0xe8d3('0x1c')]||null:null,'include':_0x37f475[_0xe8d3('0x19')]?_0x37f475[_0xe8d3('0x19')][_0xe8d3('0x1f')]?_[_0xe8d3('0x1d')](_0x37f475[_0xe8d3('0x19')][_0xe8d3('0x1f')],function(_0x2315c2){return{'model':db[_0x2315c2[_0xe8d3('0x1e')]],'as':_0x2315c2['as'],'attributes':_0x2315c2['attributes'],'include':_0x2315c2['include']?_[_0xe8d3('0x1d')](_0x2315c2['include'],function(_0x40648d){return{'model':db[_0x40648d['model']],'as':_0x40648d['as'],'attributes':_0x40648d[_0xe8d3('0x1c')],'include':_0x40648d[_0xe8d3('0x1f')]?_[_0xe8d3('0x1d')](_0x40648d[_0xe8d3('0x1f')],function(_0x2f4b72){return{'model':db[_0x2f4b72[_0xe8d3('0x1e')]],'as':_0x2f4b72['as'],'attributes':_0x2f4b72[_0xe8d3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe8d3('0x20')](function(_0x84d0f9){logger['info']('ShowSmsQueue',_0x37f475);logger[_0xe8d3('0x21')](_0xe8d3('0x23'),_0x37f475,JSON[_0xe8d3('0x10')](_0x84d0f9));_0x1c090e(_0x84d0f9);})[_0xe8d3('0x15')](function(_0x7aa55f){logger[_0xe8d3('0x11')]('ShowSmsQueue',_0x7aa55f[_0xe8d3('0x12')],_0x37f475);_0x1636fe(_0x23ddfb[_0xe8d3('0x11')](0x1f4,_0x7aa55f['message']));});});}; \ No newline at end of file +var _0x3d75=['map','model','ShowSmsQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0x3d75,0x189));var _0x53d7=function(_0x1a812e,_0x32f34f){_0x1a812e=_0x1a812e-0x0;var _0x257e73=_0x3d75[_0x1a812e];return _0x257e73;};'use strict';var _=require('lodash');var util=require(_0x53d7('0x0'));var moment=require(_0x53d7('0x1'));var BPromise=require(_0x53d7('0x2'));var rs=require(_0x53d7('0x3'));var fs=require('fs');var Redis=require(_0x53d7('0x4'));var db=require(_0x53d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53d7('0x6'))(_0x53d7('0x7'));var config=require(_0x53d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x53d7('0x9')][_0x53d7('0xa')]({'port':0x232a});config[_0x53d7('0xb')]=_[_0x53d7('0xc')](config['redis'],{'host':_0x53d7('0xd'),'port':0x18eb});var socket=require(_0x53d7('0xe'))(new Redis(config[_0x53d7('0xb')]));require(_0x53d7('0xf'))['register'](socket);function respondWithRpcPromise(_0x1c5efe,_0x1adf39,_0x46c8d4){return new BPromise(function(_0x113bcb,_0x5a8e9c){return client[_0x53d7('0x10')](_0x1c5efe,_0x46c8d4)[_0x53d7('0x11')](function(_0x3182b7){logger[_0x53d7('0x12')]('SmsQueue,\x20%s,\x20%s',_0x1adf39,'request\x20sent');logger[_0x53d7('0x13')](_0x53d7('0x14'),_0x1adf39,_0x53d7('0x15'),JSON[_0x53d7('0x16')](_0x3182b7));if(_0x3182b7['error']){if(_0x3182b7[_0x53d7('0x17')][_0x53d7('0x18')]===0x1f4){logger[_0x53d7('0x17')](_0x53d7('0x19'),_0x1adf39,_0x3182b7['error'][_0x53d7('0x1a')]);return _0x5a8e9c(_0x3182b7[_0x53d7('0x17')][_0x53d7('0x1a')]);}logger[_0x53d7('0x17')]('SmsQueue,\x20%s,\x20%s',_0x1adf39,_0x3182b7['error'][_0x53d7('0x1a')]);return _0x113bcb(_0x3182b7['error'][_0x53d7('0x1a')]);}else{logger[_0x53d7('0x12')]('SmsQueue,\x20%s,\x20%s',_0x1adf39,_0x53d7('0x15'));_0x113bcb(_0x3182b7['result'][_0x53d7('0x1a')]);}})[_0x53d7('0x1b')](function(_0xab5283){logger[_0x53d7('0x17')](_0x53d7('0x19'),_0x1adf39,_0xab5283);_0x5a8e9c(_0xab5283);});});}exports[_0x53d7('0x1c')]=function(_0x1f6da3){var _0x46ad53=this;return new Promise(function(_0x5edae5,_0x27f479){return db[_0x53d7('0x1d')][_0x53d7('0x1e')]({'raw':_0x1f6da3[_0x53d7('0x1f')]?_0x1f6da3['options'][_0x53d7('0x20')]===undefined?!![]:![]:!![],'where':_0x1f6da3[_0x53d7('0x1f')]?_0x1f6da3[_0x53d7('0x1f')][_0x53d7('0x21')]||null:null,'attributes':_0x1f6da3[_0x53d7('0x1f')]?_0x1f6da3['options'][_0x53d7('0x22')]||null:null,'limit':_0x1f6da3[_0x53d7('0x1f')]?_0x1f6da3[_0x53d7('0x1f')]['limit']||null:null,'include':_0x1f6da3[_0x53d7('0x1f')]?_0x1f6da3['options'][_0x53d7('0x23')]?_[_0x53d7('0x24')](_0x1f6da3['options'][_0x53d7('0x23')],function(_0x554901){return{'model':db[_0x554901[_0x53d7('0x25')]],'as':_0x554901['as'],'attributes':_0x554901[_0x53d7('0x22')],'include':_0x554901['include']?_[_0x53d7('0x24')](_0x554901[_0x53d7('0x23')],function(_0x12dea6){return{'model':db[_0x12dea6[_0x53d7('0x25')]],'as':_0x12dea6['as'],'attributes':_0x12dea6[_0x53d7('0x22')],'include':_0x12dea6[_0x53d7('0x23')]?_[_0x53d7('0x24')](_0x12dea6[_0x53d7('0x23')],function(_0x199cb0){return{'model':db[_0x199cb0[_0x53d7('0x25')]],'as':_0x199cb0['as'],'attributes':_0x199cb0[_0x53d7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x53d7('0x11')](function(_0x356c91){logger[_0x53d7('0x12')](_0x53d7('0x1c'),_0x1f6da3);logger['debug']('GetSmsQueue',_0x1f6da3,JSON['stringify'](_0x356c91));_0x5edae5(_0x356c91);})['catch'](function(_0x564b8e){logger['error']('GetSmsQueue',_0x564b8e['message'],_0x1f6da3);_0x27f479(_0x46ad53[_0x53d7('0x17')](0x1f4,_0x564b8e[_0x53d7('0x1a')]));});});};exports[_0x53d7('0x26')]=function(_0x25854f){var _0x1b92b4=this;return new Promise(function(_0x299fc7,_0x38936b){return db[_0x53d7('0x1d')]['find']({'raw':_0x25854f[_0x53d7('0x1f')]?_0x25854f[_0x53d7('0x1f')][_0x53d7('0x20')]===undefined?!![]:![]:!![],'where':_0x25854f['options']?_0x25854f[_0x53d7('0x1f')][_0x53d7('0x21')]||null:null,'attributes':_0x25854f[_0x53d7('0x1f')]?_0x25854f[_0x53d7('0x1f')][_0x53d7('0x22')]||null:null,'include':_0x25854f[_0x53d7('0x1f')]?_0x25854f[_0x53d7('0x1f')][_0x53d7('0x23')]?_['map'](_0x25854f['options']['include'],function(_0x11c394){return{'model':db[_0x11c394[_0x53d7('0x25')]],'as':_0x11c394['as'],'attributes':_0x11c394[_0x53d7('0x22')],'include':_0x11c394['include']?_[_0x53d7('0x24')](_0x11c394[_0x53d7('0x23')],function(_0x3794a1){return{'model':db[_0x3794a1[_0x53d7('0x25')]],'as':_0x3794a1['as'],'attributes':_0x3794a1[_0x53d7('0x22')],'include':_0x3794a1['include']?_[_0x53d7('0x24')](_0x3794a1[_0x53d7('0x23')],function(_0x4dfd06){return{'model':db[_0x4dfd06['model']],'as':_0x4dfd06['as'],'attributes':_0x4dfd06[_0x53d7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x53d7('0x11')](function(_0xa290fc){logger[_0x53d7('0x12')](_0x53d7('0x26'),_0x25854f);logger[_0x53d7('0x13')](_0x53d7('0x26'),_0x25854f,JSON['stringify'](_0xa290fc));_0x299fc7(_0xa290fc);})[_0x53d7('0x1b')](function(_0x1afacb){logger[_0x53d7('0x17')](_0x53d7('0x26'),_0x1afacb[_0x53d7('0x1a')],_0x25854f);_0x38936b(_0x1b92b4[_0x53d7('0x17')](0x1f4,_0x1afacb[_0x53d7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 7060b15..721a4b6 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 _0x95a7=['length','./smsQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x95a7,0x161));var _0x795a=function(_0x845041,_0x1c2043){_0x845041=_0x845041-0x0;var _0x2f8542=_0x95a7[_0x845041];return _0x2f8542;};'use strict';var SmsQueueEvents=require(_0x795a('0x0'));var events=[_0x795a('0x1'),_0x795a('0x2'),_0x795a('0x3')];function createListener(_0x2e84e0,_0x7e4938){return function(_0x29b1ee){_0x7e4938[_0x795a('0x4')](_0x2e84e0,_0x29b1ee);};}function removeListener(_0x361462,_0x3039b8){return function(){SmsQueueEvents[_0x795a('0x5')](_0x361462,_0x3039b8);};}exports[_0x795a('0x6')]=function(_0x37b803){for(var _0x54b9eb=0x0,_0x1f2cff=events[_0x795a('0x7')];_0x54b9eb<_0x1f2cff;_0x54b9eb++){var _0x100a52=events[_0x54b9eb];var _0x5c9926=createListener('smsQueue:'+_0x100a52,_0x37b803);SmsQueueEvents['on'](_0x100a52,_0x5c9926);}}; \ No newline at end of file +var _0x08d8=['update','emit','register','length','save','remove'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x08d8,0x1a8));var _0x808d=function(_0x1ca599,_0x2dc752){_0x1ca599=_0x1ca599-0x0;var _0x4682a4=_0x08d8[_0x1ca599];return _0x4682a4;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x808d('0x0'),_0x808d('0x1'),_0x808d('0x2')];function createListener(_0x5e0b40,_0x3f0b1c){return function(_0x32cd94){_0x3f0b1c[_0x808d('0x3')](_0x5e0b40,_0x32cd94);};}function removeListener(_0x19f7d8,_0x24cb6c){return function(){SmsQueueEvents['removeListener'](_0x19f7d8,_0x24cb6c);};}exports[_0x808d('0x4')]=function(_0x4c07e6){for(var _0x2d97ac=0x0,_0x5c72b1=events[_0x808d('0x5')];_0x2d97ac<_0x5c72b1;_0x2d97ac++){var _0x52cd10=events[_0x2d97ac];var _0x23de64=createListener('smsQueue:'+_0x52cd10,_0x4c07e6);SmsQueueEvents['on'](_0x52cd10,_0x23de64);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index e76c485..acf649c 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 _0xf77f=['describe','show','post','create','put','/:id','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x4c2ba3,_0x1696d8){var _0xca6c93=function(_0x49d209){while(--_0x49d209){_0x4c2ba3['push'](_0x4c2ba3['shift']());}};_0xca6c93(++_0x1696d8);}(_0xf77f,0x134));var _0xff77=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0xf77f[_0x1aba25];return _0x47d997;};'use strict';var multer=require(_0xff77('0x0'));var util=require('util');var path=require(_0xff77('0x1'));var timeout=require(_0xff77('0x2'));var express=require(_0xff77('0x3'));var router=express[_0xff77('0x4')]();var fs_extra=require(_0xff77('0x5'));var auth=require(_0xff77('0x6'));var interaction=require(_0xff77('0x7'));var config=require(_0xff77('0x8'));var controller=require('./smsQueueReport.controller');router[_0xff77('0x9')]('/',auth[_0xff77('0xa')](),controller['index']);router['get'](_0xff77('0xb'),auth[_0xff77('0xa')](),controller[_0xff77('0xc')]);router[_0xff77('0x9')]('/:id',auth[_0xff77('0xa')](),controller[_0xff77('0xd')]);router[_0xff77('0xe')]('/',auth[_0xff77('0xa')](),controller[_0xff77('0xf')]);router[_0xff77('0x10')](_0xff77('0x11'),auth['isAuthenticated'](),controller[_0xff77('0x12')]);router[_0xff77('0x13')](_0xff77('0x11'),auth[_0xff77('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3981=['/describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x241b8d,_0x27f8a5){var _0x2c1f4b=function(_0x306c03){while(--_0x306c03){_0x241b8d['push'](_0x241b8d['shift']());}};_0x2c1f4b(++_0x27f8a5);}(_0x3981,0x144));var _0x1398=function(_0x3f8701,_0x2e138a){_0x3f8701=_0x3f8701-0x0;var _0x565aed=_0x3981[_0x3f8701];return _0x565aed;};'use strict';var multer=require(_0x1398('0x0'));var util=require('util');var path=require(_0x1398('0x1'));var timeout=require(_0x1398('0x2'));var express=require(_0x1398('0x3'));var router=express[_0x1398('0x4')]();var fs_extra=require(_0x1398('0x5'));var auth=require(_0x1398('0x6'));var interaction=require(_0x1398('0x7'));var config=require(_0x1398('0x8'));var controller=require(_0x1398('0x9'));router[_0x1398('0xa')]('/',auth[_0x1398('0xb')](),controller['index']);router[_0x1398('0xa')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller['describe']);router[_0x1398('0xa')](_0x1398('0xd'),auth[_0x1398('0xb')](),controller[_0x1398('0xe')]);router[_0x1398('0xf')]('/',auth[_0x1398('0xb')](),controller['create']);router[_0x1398('0x10')](_0x1398('0xd'),auth[_0x1398('0xb')](),controller[_0x1398('0x11')]);router[_0x1398('0x12')](_0x1398('0xd'),auth[_0x1398('0xb')](),controller[_0x1398('0x13')]);module[_0x1398('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0378cf7..9ed15ad 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 _0xd23d=['DATE','sequelize','exports','STRING'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0xd23d,0xed));var _0xdd23=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0xd23d[_0x22eb96];return _0x5e1adf;};'use strict';var moment=require('moment');var Sequelize=require(_0xdd23('0x0'));module[_0xdd23('0x1')]={'uniqueid':{'type':Sequelize[_0xdd23('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdd23('0x3')]},'leaveAt':{'type':Sequelize[_0xdd23('0x3')]},'acceptAt':{'type':Sequelize[_0xdd23('0x3')]},'exitAt':{'type':Sequelize[_0xdd23('0x3')]},'reason':{'type':Sequelize[_0xdd23('0x2')]}}; \ No newline at end of file +var _0xd10c=['exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd10c,0x1c3));var _0xcd10=function(_0x211280,_0x514024){_0x211280=_0x211280-0x0;var _0x4344ea=_0xd10c[_0x211280];return _0x4344ea;};'use strict';var moment=require(_0xcd10('0x0'));var Sequelize=require('sequelize');module[_0xcd10('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcd10('0x2')]},'joinAt':{'type':Sequelize[_0xcd10('0x3')]},'leaveAt':{'type':Sequelize[_0xcd10('0x3')]},'acceptAt':{'type':Sequelize[_0xcd10('0x3')]},'exitAt':{'type':Sequelize[_0xcd10('0x3')]},'reason':{'type':Sequelize[_0xcd10('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index a71a9af..702d1e6 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 _0xfd45=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','json','apply','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','VIRTUAL','options','SmsQueueReport','includeAll','findAll','rows','catch','params','keys','length','merge','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd45,0x156));var _0x5fd4=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xfd45[_0x5834bc];return _0x3e183a;};'use strict';var emlformat=require(_0x5fd4('0x0'));var rimraf=require(_0x5fd4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5fd4('0x2'));var rp=require(_0x5fd4('0x3'));var moment=require(_0x5fd4('0x4'));var BPromise=require(_0x5fd4('0x5'));var Mustache=require(_0x5fd4('0x6'));var util=require(_0x5fd4('0x7'));var path=require(_0x5fd4('0x8'));var sox=require(_0x5fd4('0x9'));var csv=require(_0x5fd4('0xa'));var ejs=require(_0x5fd4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fd4('0xc'));var squel=require('squel');var crypto=require(_0x5fd4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5fd4('0xe'));var toCsv=require(_0x5fd4('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5fd4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5fd4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fd4('0x11'));var logger=require('../../config/logger')(_0x5fd4('0x12'));var utils=require(_0x5fd4('0x13'));var config=require(_0x5fd4('0x14'));var licenseUtil=require(_0x5fd4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2739a6,_0x52fa31){_0x52fa31=_0x52fa31||0xcc;return function(_0x54ebaf){if(_0x54ebaf){return _0x2739a6[_0x5fd4('0x16')](_0x52fa31);}return _0x2739a6[_0x5fd4('0x17')](_0x52fa31)[_0x5fd4('0x18')]();};}function respondWithResult(_0x2f8488,_0x588b77){_0x588b77=_0x588b77||0xc8;return function(_0x230e5e){if(_0x230e5e){return _0x2f8488['status'](_0x588b77)['json'](_0x230e5e);}};}function respondWithFilteredResult(_0x1a4269,_0x1b6470){return function(_0xd93780){if(_0xd93780){var _0x500110=typeof _0x1b6470[_0x5fd4('0x19')]===_0x5fd4('0x1a')&&typeof _0x1b6470['limit']===_0x5fd4('0x1a');var _0x37362e=_0xd93780[_0x5fd4('0x1b')];var _0x4f1e72=_0x500110?0x0:_0x1b6470[_0x5fd4('0x19')];var _0x4b3eca=_0x500110?_0xd93780['count']:_0x1b6470[_0x5fd4('0x19')]+_0x1b6470['limit'];var _0x31b1c8;if(_0x4b3eca>=_0x37362e){_0x4b3eca=_0x37362e;_0x31b1c8=0xc8;}else{_0x31b1c8=0xce;}_0x1a4269['status'](_0x31b1c8);return _0x1a4269[_0x5fd4('0x1c')]('Content-Range',_0x4f1e72+'-'+_0x4b3eca+'/'+_0x37362e)[_0x5fd4('0x1d')](_0xd93780);}return null;};}function patchUpdates(_0x44c597){return function(_0x29c9ae){try{jsonpatch[_0x5fd4('0x1e')](_0x29c9ae,_0x44c597,!![]);}catch(_0x3e7fd2){return BPromise['reject'](_0x3e7fd2);}return _0x29c9ae[_0x5fd4('0x1f')]();};}function saveUpdates(_0x4c6e1f,_0x149eab){return function(_0x40ce24){if(_0x40ce24){return _0x40ce24[_0x5fd4('0x20')](_0x4c6e1f)[_0x5fd4('0x21')](function(_0x2e71ad){return _0x2e71ad;});}return null;};}function removeEntity(_0x48e017,_0x473d07){return function(_0x48a75b){if(_0x48a75b){return _0x48a75b['destroy']()['then'](function(){_0x48e017[_0x5fd4('0x17')](0xcc)[_0x5fd4('0x18')]();});}};}function handleEntityNotFound(_0xde6714,_0x1e1af5){return function(_0x48a387){if(!_0x48a387){_0xde6714[_0x5fd4('0x16')](0x194);}return _0x48a387;};}function handleError(_0x526df0,_0x5cab07){_0x5cab07=_0x5cab07||0x1f4;return function(_0xeae3d9){logger[_0x5fd4('0x22')](_0xeae3d9[_0x5fd4('0x23')]);if(_0xeae3d9[_0x5fd4('0x24')]){delete _0xeae3d9[_0x5fd4('0x24')];}_0x526df0[_0x5fd4('0x17')](_0x5cab07)['send'](_0xeae3d9);};}exports[_0x5fd4('0x25')]=function(_0x1049b8,_0x5c961f){var _0x35ace0={},_0x138a97={},_0x4fdd3e={'count':0x0,'rows':[]};var _0x3d7699=_[_0x5fd4('0x26')](db['SmsQueueReport'][_0x5fd4('0x27')],function(_0x50215c){return{'name':_0x50215c[_0x5fd4('0x28')],'type':_0x50215c[_0x5fd4('0x29')]['key']};});_0x138a97[_0x5fd4('0x2a')]=_[_0x5fd4('0x26')](_0x3d7699,_0x5fd4('0x24'));_0x138a97['query']=_['keys'](_0x1049b8[_0x5fd4('0x2b')]);_0x138a97['filters']=_['intersection'](_0x138a97[_0x5fd4('0x2a')],_0x138a97[_0x5fd4('0x2b')]);_0x35ace0[_0x5fd4('0x2c')]=_[_0x5fd4('0x2d')](_0x138a97['model'],qs['fields'](_0x1049b8[_0x5fd4('0x2b')][_0x5fd4('0x2e')]));_0x35ace0['attributes']=_0x35ace0[_0x5fd4('0x2c')]['length']?_0x35ace0[_0x5fd4('0x2c')]:_0x138a97[_0x5fd4('0x2a')];if(!_0x1049b8['query'][_0x5fd4('0x2f')](_0x5fd4('0x30'))){_0x35ace0[_0x5fd4('0x31')]=qs[_0x5fd4('0x31')](_0x1049b8[_0x5fd4('0x2b')][_0x5fd4('0x31')]);_0x35ace0['offset']=qs[_0x5fd4('0x19')](_0x1049b8[_0x5fd4('0x2b')][_0x5fd4('0x19')]);}_0x35ace0[_0x5fd4('0x32')]=qs[_0x5fd4('0x33')](_0x1049b8[_0x5fd4('0x2b')][_0x5fd4('0x33')]);_0x35ace0['where']=qs[_0x5fd4('0x34')](_[_0x5fd4('0x35')](_0x1049b8[_0x5fd4('0x2b')],_0x138a97[_0x5fd4('0x34')]),_0x3d7699);if(_0x1049b8[_0x5fd4('0x2b')][_0x5fd4('0x36')]){_0x35ace0[_0x5fd4('0x37')]=_['merge'](_0x35ace0[_0x5fd4('0x37')],{'$or':_[_0x5fd4('0x26')](_0x3d7699,function(_0x2cf57f){if(_0x2cf57f['type']!==_0x5fd4('0x38')){var _0x3a8042={};_0x3a8042[_0x2cf57f[_0x5fd4('0x24')]]={'$like':'%'+_0x1049b8[_0x5fd4('0x2b')]['filter']+'%'};return _0x3a8042;}})});}_0x35ace0=_['merge']({},_0x35ace0,_0x1049b8[_0x5fd4('0x39')]);var _0x414176={'where':_0x35ace0['where']};return db[_0x5fd4('0x3a')][_0x5fd4('0x1b')](_0x414176)[_0x5fd4('0x21')](function(_0x5ac00a){_0x4fdd3e['count']=_0x5ac00a;if(_0x1049b8[_0x5fd4('0x2b')][_0x5fd4('0x3b')]){_0x35ace0['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0x5fd4('0x3c')](_0x35ace0);})[_0x5fd4('0x21')](function(_0x1992d9){_0x4fdd3e[_0x5fd4('0x3d')]=_0x1992d9;return _0x4fdd3e;})[_0x5fd4('0x21')](respondWithFilteredResult(_0x5c961f,_0x35ace0))[_0x5fd4('0x3e')](handleError(_0x5c961f,null));};exports['show']=function(_0x32276d,_0x50a1f2){var _0x53ec27={'raw':!![],'where':{'id':_0x32276d[_0x5fd4('0x3f')]['id']}},_0x4b6c13={};_0x4b6c13[_0x5fd4('0x2a')]=_[_0x5fd4('0x40')](db[_0x5fd4('0x3a')][_0x5fd4('0x27')]);_0x4b6c13['query']=_['keys'](_0x32276d[_0x5fd4('0x2b')]);_0x4b6c13['filters']=_[_0x5fd4('0x2d')](_0x4b6c13['model'],_0x4b6c13['query']);_0x53ec27[_0x5fd4('0x2c')]=_[_0x5fd4('0x2d')](_0x4b6c13['model'],qs[_0x5fd4('0x2e')](_0x32276d[_0x5fd4('0x2b')][_0x5fd4('0x2e')]));_0x53ec27[_0x5fd4('0x2c')]=_0x53ec27[_0x5fd4('0x2c')][_0x5fd4('0x41')]?_0x53ec27[_0x5fd4('0x2c')]:_0x4b6c13[_0x5fd4('0x2a')];if(_0x32276d[_0x5fd4('0x2b')][_0x5fd4('0x3b')]){_0x53ec27['include']=[{'all':!![]}];}_0x53ec27=_[_0x5fd4('0x42')]({},_0x53ec27,_0x32276d['options']);return db['SmsQueueReport']['find'](_0x53ec27)[_0x5fd4('0x21')](handleEntityNotFound(_0x50a1f2,null))[_0x5fd4('0x21')](respondWithResult(_0x50a1f2,null))[_0x5fd4('0x3e')](handleError(_0x50a1f2,null));};exports[_0x5fd4('0x43')]=function(_0x2dbb29,_0x39aeb5){return db[_0x5fd4('0x3a')]['create'](_0x2dbb29[_0x5fd4('0x44')],{})[_0x5fd4('0x21')](respondWithResult(_0x39aeb5,0xc9))[_0x5fd4('0x3e')](handleError(_0x39aeb5,null));};exports['update']=function(_0x57b243,_0x445e7a){if(_0x57b243[_0x5fd4('0x44')]['id']){delete _0x57b243[_0x5fd4('0x44')]['id'];}return db['SmsQueueReport'][_0x5fd4('0x45')]({'where':{'id':_0x57b243[_0x5fd4('0x3f')]['id']}})[_0x5fd4('0x21')](handleEntityNotFound(_0x445e7a,null))['then'](saveUpdates(_0x57b243['body'],null))[_0x5fd4('0x21')](respondWithResult(_0x445e7a,null))['catch'](handleError(_0x445e7a,null));};exports[_0x5fd4('0x46')]=function(_0x2dd149,_0x4937a){return db['SmsQueueReport'][_0x5fd4('0x45')]({'where':{'id':_0x2dd149[_0x5fd4('0x3f')]['id']}})[_0x5fd4('0x21')](handleEntityNotFound(_0x4937a,null))['then'](removeEntity(_0x4937a,null))['catch'](handleError(_0x4937a,null));};exports[_0x5fd4('0x47')]=function(_0xc90bf7,_0x4eaec0){return db[_0x5fd4('0x3a')][_0x5fd4('0x47')]()[_0x5fd4('0x21')](respondWithResult(_0x4eaec0,null))[_0x5fd4('0x3e')](handleError(_0x4eaec0,null));}; \ No newline at end of file +var _0x209d=['rows','catch','show','keys','include','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','SmsQueueReport','findAll'];(function(_0x149013,_0x268258){var _0x502195=function(_0x4ec420){while(--_0x4ec420){_0x149013['push'](_0x149013['shift']());}};_0x502195(++_0x268258);}(_0x209d,0x190));var _0xd209=function(_0xa8041a,_0xdbefc0){_0xa8041a=_0xa8041a-0x0;var _0x3b55c7=_0x209d[_0xa8041a];return _0x3b55c7;};'use strict';var emlformat=require(_0xd209('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd209('0x1'));var moment=require(_0xd209('0x2'));var BPromise=require(_0xd209('0x3'));var Mustache=require(_0xd209('0x4'));var util=require(_0xd209('0x5'));var path=require(_0xd209('0x6'));var sox=require(_0xd209('0x7'));var csv=require(_0xd209('0x8'));var ejs=require(_0xd209('0x9'));var fs=require('fs');var fs_extra=require(_0xd209('0xa'));var _=require(_0xd209('0xb'));var squel=require(_0xd209('0xc'));var crypto=require(_0xd209('0xd'));var jsforce=require(_0xd209('0xe'));var deskjs=require(_0xd209('0xf'));var toCsv=require(_0xd209('0x8'));var querystring=require(_0xd209('0x10'));var Papa=require(_0xd209('0x11'));var Redis=require('ioredis');var authService=require(_0xd209('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd209('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd209('0x14'))(_0xd209('0x15'));var utils=require(_0xd209('0x16'));var config=require(_0xd209('0x17'));var licenseUtil=require(_0xd209('0x18'));var db=require(_0xd209('0x19'))['db'];function respondWithStatusCode(_0x2b7525,_0x3c9a0d){_0x3c9a0d=_0x3c9a0d||0xcc;return function(_0x492183){if(_0x492183){return _0x2b7525[_0xd209('0x1a')](_0x3c9a0d);}return _0x2b7525[_0xd209('0x1b')](_0x3c9a0d)['end']();};}function respondWithResult(_0x474eb6,_0x2c4392){_0x2c4392=_0x2c4392||0xc8;return function(_0x3aff6c){if(_0x3aff6c){return _0x474eb6[_0xd209('0x1b')](_0x2c4392)['json'](_0x3aff6c);}};}function respondWithFilteredResult(_0x6558bd,_0x40dc35){return function(_0x207ec3){if(_0x207ec3){var _0x34b5bb=typeof _0x40dc35[_0xd209('0x1c')]===_0xd209('0x1d')&&typeof _0x40dc35['limit']===_0xd209('0x1d');var _0x29136d=_0x207ec3['count'];var _0x2e1813=_0x34b5bb?0x0:_0x40dc35[_0xd209('0x1c')];var _0x3493f0=_0x34b5bb?_0x207ec3[_0xd209('0x1e')]:_0x40dc35['offset']+_0x40dc35['limit'];var _0x1079fa;if(_0x3493f0>=_0x29136d){_0x3493f0=_0x29136d;_0x1079fa=0xc8;}else{_0x1079fa=0xce;}_0x6558bd[_0xd209('0x1b')](_0x1079fa);return _0x6558bd[_0xd209('0x1f')](_0xd209('0x20'),_0x2e1813+'-'+_0x3493f0+'/'+_0x29136d)['json'](_0x207ec3);}return null;};}function patchUpdates(_0x36af27){return function(_0x28c979){try{jsonpatch[_0xd209('0x21')](_0x28c979,_0x36af27,!![]);}catch(_0x19b10f){return BPromise[_0xd209('0x22')](_0x19b10f);}return _0x28c979[_0xd209('0x23')]();};}function saveUpdates(_0x5c5934,_0x199ed2){return function(_0x3946a8){if(_0x3946a8){return _0x3946a8[_0xd209('0x24')](_0x5c5934)[_0xd209('0x25')](function(_0x27014f){return _0x27014f;});}return null;};}function removeEntity(_0x5cbe43,_0x33fa29){return function(_0x347ee7){if(_0x347ee7){return _0x347ee7[_0xd209('0x26')]()['then'](function(){_0x5cbe43[_0xd209('0x1b')](0xcc)[_0xd209('0x27')]();});}};}function handleEntityNotFound(_0x10064c,_0x4cb283){return function(_0x5b12e2){if(!_0x5b12e2){_0x10064c[_0xd209('0x1a')](0x194);}return _0x5b12e2;};}function handleError(_0x2eca85,_0x2fb8e3){_0x2fb8e3=_0x2fb8e3||0x1f4;return function(_0x4a1042){logger[_0xd209('0x28')](_0x4a1042['stack']);if(_0x4a1042[_0xd209('0x29')]){delete _0x4a1042[_0xd209('0x29')];}_0x2eca85['status'](_0x2fb8e3)[_0xd209('0x2a')](_0x4a1042);};}exports[_0xd209('0x2b')]=function(_0x40b5e9,_0x2d23bf){var _0x34ff6e={},_0x13f61f={},_0x15df32={'count':0x0,'rows':[]};var _0x1d4bc5=_[_0xd209('0x2c')](db['SmsQueueReport'][_0xd209('0x2d')],function(_0x49115b){return{'name':_0x49115b['fieldName'],'type':_0x49115b[_0xd209('0x2e')][_0xd209('0x2f')]};});_0x13f61f['model']=_['map'](_0x1d4bc5,_0xd209('0x29'));_0x13f61f['query']=_['keys'](_0x40b5e9[_0xd209('0x30')]);_0x13f61f[_0xd209('0x31')]=_[_0xd209('0x32')](_0x13f61f[_0xd209('0x33')],_0x13f61f[_0xd209('0x30')]);_0x34ff6e[_0xd209('0x34')]=_[_0xd209('0x32')](_0x13f61f[_0xd209('0x33')],qs[_0xd209('0x35')](_0x40b5e9[_0xd209('0x30')][_0xd209('0x35')]));_0x34ff6e['attributes']=_0x34ff6e[_0xd209('0x34')][_0xd209('0x36')]?_0x34ff6e[_0xd209('0x34')]:_0x13f61f['model'];if(!_0x40b5e9[_0xd209('0x30')][_0xd209('0x37')](_0xd209('0x38'))){_0x34ff6e[_0xd209('0x39')]=qs[_0xd209('0x39')](_0x40b5e9[_0xd209('0x30')][_0xd209('0x39')]);_0x34ff6e['offset']=qs[_0xd209('0x1c')](_0x40b5e9['query'][_0xd209('0x1c')]);}_0x34ff6e[_0xd209('0x3a')]=qs[_0xd209('0x3b')](_0x40b5e9[_0xd209('0x30')]['sort']);_0x34ff6e[_0xd209('0x3c')]=qs[_0xd209('0x31')](_['pick'](_0x40b5e9[_0xd209('0x30')],_0x13f61f['filters']),_0x1d4bc5);if(_0x40b5e9[_0xd209('0x30')][_0xd209('0x3d')]){_0x34ff6e['where']=_[_0xd209('0x3e')](_0x34ff6e[_0xd209('0x3c')],{'$or':_['map'](_0x1d4bc5,function(_0x57deb9){if(_0x57deb9[_0xd209('0x2e')]!==_0xd209('0x3f')){var _0x43261e={};_0x43261e[_0x57deb9['name']]={'$like':'%'+_0x40b5e9[_0xd209('0x30')][_0xd209('0x3d')]+'%'};return _0x43261e;}})});}_0x34ff6e=_[_0xd209('0x3e')]({},_0x34ff6e,_0x40b5e9[_0xd209('0x40')]);var _0x4e2dcc={'where':_0x34ff6e[_0xd209('0x3c')]};return db['SmsQueueReport'][_0xd209('0x1e')](_0x4e2dcc)['then'](function(_0x46a6fa){_0x15df32[_0xd209('0x1e')]=_0x46a6fa;if(_0x40b5e9[_0xd209('0x30')][_0xd209('0x41')]){_0x34ff6e['include']=[{'all':!![]}];}return db[_0xd209('0x42')][_0xd209('0x43')](_0x34ff6e);})['then'](function(_0x2f238e){_0x15df32[_0xd209('0x44')]=_0x2f238e;return _0x15df32;})[_0xd209('0x25')](respondWithFilteredResult(_0x2d23bf,_0x34ff6e))[_0xd209('0x45')](handleError(_0x2d23bf,null));};exports[_0xd209('0x46')]=function(_0x53ad01,_0x540fda){var _0x14644a={'raw':!![],'where':{'id':_0x53ad01['params']['id']}},_0x53cf98={};_0x53cf98[_0xd209('0x33')]=_[_0xd209('0x47')](db[_0xd209('0x42')][_0xd209('0x2d')]);_0x53cf98['query']=_['keys'](_0x53ad01[_0xd209('0x30')]);_0x53cf98[_0xd209('0x31')]=_[_0xd209('0x32')](_0x53cf98[_0xd209('0x33')],_0x53cf98[_0xd209('0x30')]);_0x14644a[_0xd209('0x34')]=_['intersection'](_0x53cf98['model'],qs[_0xd209('0x35')](_0x53ad01[_0xd209('0x30')][_0xd209('0x35')]));_0x14644a[_0xd209('0x34')]=_0x14644a[_0xd209('0x34')][_0xd209('0x36')]?_0x14644a[_0xd209('0x34')]:_0x53cf98[_0xd209('0x33')];if(_0x53ad01[_0xd209('0x30')][_0xd209('0x41')]){_0x14644a[_0xd209('0x48')]=[{'all':!![]}];}_0x14644a=_['merge']({},_0x14644a,_0x53ad01['options']);return db[_0xd209('0x42')][_0xd209('0x49')](_0x14644a)['then'](handleEntityNotFound(_0x540fda,null))[_0xd209('0x25')](respondWithResult(_0x540fda,null))['catch'](handleError(_0x540fda,null));};exports[_0xd209('0x4a')]=function(_0x183bc5,_0x41fa86){return db['SmsQueueReport'][_0xd209('0x4a')](_0x183bc5[_0xd209('0x4b')],{})[_0xd209('0x25')](respondWithResult(_0x41fa86,0xc9))[_0xd209('0x45')](handleError(_0x41fa86,null));};exports[_0xd209('0x24')]=function(_0x1d3a66,_0x1294e2){if(_0x1d3a66[_0xd209('0x4b')]['id']){delete _0x1d3a66[_0xd209('0x4b')]['id'];}return db['SmsQueueReport'][_0xd209('0x49')]({'where':{'id':_0x1d3a66[_0xd209('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1294e2,null))[_0xd209('0x25')](saveUpdates(_0x1d3a66['body'],null))[_0xd209('0x25')](respondWithResult(_0x1294e2,null))[_0xd209('0x45')](handleError(_0x1294e2,null));};exports['destroy']=function(_0x20c141,_0x1c8a06){return db[_0xd209('0x42')][_0xd209('0x49')]({'where':{'id':_0x20c141[_0xd209('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1c8a06,null))[_0xd209('0x25')](removeEntity(_0x1c8a06,null))[_0xd209('0x45')](handleError(_0x1c8a06,null));};exports[_0xd209('0x4d')]=function(_0x5a5fa1,_0x212c13){return db['SmsQueueReport'][_0xd209('0x4d')]()[_0xd209('0x25')](respondWithResult(_0x212c13,null))[_0xd209('0x45')](handleError(_0x212c13,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 4ae902a..544bd2d 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x35c64a,_0x359100){var _0x40cadd=function(_0x1d1fa9){while(--_0x1d1fa9){_0x35c64a['push'](_0x35c64a['shift']());}};_0x40cadd(++_0x359100);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_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'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 9a7df6e..120d383 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 _0xec3e=['raw','SmsQueueReport','where','UpdateSmsQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body','options'];(function(_0x4134f7,_0x6801d1){var _0x4b7dfc=function(_0x33617a){while(--_0x33617a){_0x4134f7['push'](_0x4134f7['shift']());}};_0x4b7dfc(++_0x6801d1);}(_0xec3e,0x1d4));var _0xeec3=function(_0x328ccb,_0x171c91){_0x328ccb=_0x328ccb-0x0;var _0x5da119=_0xec3e[_0x328ccb];return _0x5da119;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeec3('0x0'));var BPromise=require(_0xeec3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeec3('0x2'));var db=require(_0xeec3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xeec3('0x4'))(_0xeec3('0x5'));var config=require(_0xeec3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xeec3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x241da4,_0x46637b,_0x59fd69){return new BPromise(function(_0x12a9cb,_0x247262){return client[_0xeec3('0x8')](_0x241da4,_0x59fd69)[_0xeec3('0x9')](function(_0xb17cdb){logger[_0xeec3('0xa')](_0xeec3('0xb'),_0x46637b,'request\x20sent');logger[_0xeec3('0xc')](_0xeec3('0xd'),_0x46637b,_0xeec3('0xe'),JSON[_0xeec3('0xf')](_0xb17cdb));if(_0xb17cdb[_0xeec3('0x10')]){if(_0xb17cdb[_0xeec3('0x10')][_0xeec3('0x11')]===0x1f4){logger[_0xeec3('0x10')](_0xeec3('0xb'),_0x46637b,_0xb17cdb[_0xeec3('0x10')][_0xeec3('0x12')]);return _0x247262(_0xb17cdb[_0xeec3('0x10')]['message']);}logger[_0xeec3('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x46637b,_0xb17cdb[_0xeec3('0x10')]['message']);return _0x12a9cb(_0xb17cdb[_0xeec3('0x10')][_0xeec3('0x12')]);}else{logger[_0xeec3('0xa')](_0xeec3('0xb'),_0x46637b,'request\x20sent');_0x12a9cb(_0xb17cdb[_0xeec3('0x13')]['message']);}})[_0xeec3('0x14')](function(_0x302e71){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x46637b,_0x302e71);_0x247262(_0x302e71);});});}exports[_0xeec3('0x15')]=function(_0x58c374){var _0xa72a95=this;return new Promise(function(_0x419538,_0x19afb0){return db['SmsQueueReport'][_0xeec3('0x16')](_0x58c374[_0xeec3('0x17')],{'raw':_0x58c374[_0xeec3('0x18')]?_0x58c374[_0xeec3('0x18')][_0xeec3('0x19')]===undefined?!![]:![]:!![]})[_0xeec3('0x9')](function(_0x25c589){logger['info'](_0xeec3('0x15'),_0x58c374);logger[_0xeec3('0xc')]('CreateSmsQueueReport',_0x58c374,JSON[_0xeec3('0xf')](_0x25c589));_0x419538(_0x25c589);})['catch'](function(_0x48afc1){logger[_0xeec3('0x10')](_0xeec3('0x15'),_0x48afc1[_0xeec3('0x12')],_0x58c374);_0x19afb0(_0xa72a95[_0xeec3('0x10')](0x1f4,_0x48afc1[_0xeec3('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x30d233){var _0x43cd84=this;return new Promise(function(_0x326709,_0x5010fb){return db[_0xeec3('0x1a')]['update'](_0x30d233['body'],{'raw':_0x30d233[_0xeec3('0x18')]?_0x30d233[_0xeec3('0x18')][_0xeec3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30d233[_0xeec3('0x18')]?_0x30d233['options'][_0xeec3('0x1b')]||null:null,'attributes':_0x30d233[_0xeec3('0x18')]?_0x30d233['options']['attributes']||null:null,'limit':_0x30d233['options']?_0x30d233[_0xeec3('0x18')]['limit']||null:null})['then'](function(_0x298a44){logger['info'](_0xeec3('0x1c'),_0x30d233);logger[_0xeec3('0xc')](_0xeec3('0x1c'),_0x30d233,JSON[_0xeec3('0xf')](_0x298a44));_0x326709(_0x298a44);})[_0xeec3('0x14')](function(_0x114a26){logger[_0xeec3('0x10')](_0xeec3('0x1c'),_0x114a26['message'],_0x30d233);_0x5010fb(_0x43cd84['error'](0x1f4,_0x114a26[_0xeec3('0x12')]));});});}; \ No newline at end of file +var _0xaa30=['SmsQueueReport','update','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsQueueReport','body','options'];(function(_0x2da230,_0x5a5dfc){var _0x3504a9=function(_0x5bc685){while(--_0x5bc685){_0x2da230['push'](_0x2da230['shift']());}};_0x3504a9(++_0x5a5dfc);}(_0xaa30,0x1b9));var _0x0aa3=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xaa30[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0aa3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0aa3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0aa3('0x2'));var db=require(_0x0aa3('0x3'))['db'];var utils=require(_0x0aa3('0x4'));var logger=require(_0x0aa3('0x5'))(_0x0aa3('0x6'));var config=require(_0x0aa3('0x7'));var jayson=require(_0x0aa3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfedc98,_0x1e0479,_0xa8eb28){return new BPromise(function(_0x169ec0,_0x45c392){return client[_0x0aa3('0x9')](_0xfedc98,_0xa8eb28)[_0x0aa3('0xa')](function(_0x54b7fa){logger[_0x0aa3('0xb')](_0x0aa3('0xc'),_0x1e0479,'request\x20sent');logger[_0x0aa3('0xd')](_0x0aa3('0xe'),_0x1e0479,_0x0aa3('0xf'),JSON[_0x0aa3('0x10')](_0x54b7fa));if(_0x54b7fa[_0x0aa3('0x11')]){if(_0x54b7fa[_0x0aa3('0x11')]['code']===0x1f4){logger[_0x0aa3('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x1e0479,_0x54b7fa['error']['message']);return _0x45c392(_0x54b7fa[_0x0aa3('0x11')][_0x0aa3('0x12')]);}logger[_0x0aa3('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x1e0479,_0x54b7fa['error'][_0x0aa3('0x12')]);return _0x169ec0(_0x54b7fa[_0x0aa3('0x11')]['message']);}else{logger['info'](_0x0aa3('0xc'),_0x1e0479,'request\x20sent');_0x169ec0(_0x54b7fa[_0x0aa3('0x13')]['message']);}})[_0x0aa3('0x14')](function(_0x2fca41){logger[_0x0aa3('0x11')](_0x0aa3('0xc'),_0x1e0479,_0x2fca41);_0x45c392(_0x2fca41);});});}exports[_0x0aa3('0x15')]=function(_0x41b2a2){var _0x1c028c=this;return new Promise(function(_0x4fcd17,_0x212836){return db['SmsQueueReport']['create'](_0x41b2a2[_0x0aa3('0x16')],{'raw':_0x41b2a2[_0x0aa3('0x17')]?_0x41b2a2['options']['raw']===undefined?!![]:![]:!![]})[_0x0aa3('0xa')](function(_0x4ccfee){logger[_0x0aa3('0xb')](_0x0aa3('0x15'),_0x41b2a2);logger[_0x0aa3('0xd')](_0x0aa3('0x15'),_0x41b2a2,JSON[_0x0aa3('0x10')](_0x4ccfee));_0x4fcd17(_0x4ccfee);})[_0x0aa3('0x14')](function(_0xd8981){logger[_0x0aa3('0x11')](_0x0aa3('0x15'),_0xd8981[_0x0aa3('0x12')],_0x41b2a2);_0x212836(_0x1c028c[_0x0aa3('0x11')](0x1f4,_0xd8981[_0x0aa3('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x35b834){var _0x2af24b=this;return new Promise(function(_0x3cc630,_0xf58952){return db[_0x0aa3('0x18')][_0x0aa3('0x19')](_0x35b834[_0x0aa3('0x16')],{'raw':_0x35b834['options']?_0x35b834[_0x0aa3('0x17')][_0x0aa3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35b834['options']?_0x35b834['options'][_0x0aa3('0x1b')]||null:null,'attributes':_0x35b834['options']?_0x35b834[_0x0aa3('0x17')][_0x0aa3('0x1c')]||null:null,'limit':_0x35b834[_0x0aa3('0x17')]?_0x35b834['options'][_0x0aa3('0x1d')]||null:null})[_0x0aa3('0xa')](function(_0x342b6a){logger[_0x0aa3('0xb')](_0x0aa3('0x1e'),_0x35b834);logger[_0x0aa3('0xd')]('UpdateSmsQueueReport',_0x35b834,JSON[_0x0aa3('0x10')](_0x342b6a));_0x3cc630(_0x342b6a);})[_0x0aa3('0x14')](function(_0x4845b8){logger[_0x0aa3('0x11')](_0x0aa3('0x1e'),_0x4845b8[_0x0aa3('0x12')],_0x35b834);_0xf58952(_0x2af24b[_0x0aa3('0x11')](0x1f4,_0x4845b8['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b0d042d..5c780b9 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 _0xeec6=['isAuthenticated','index','/describe','describe','get','show','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3a3b9e,_0xc59037){_0x3a3b9e=_0x3a3b9e-0x0;var _0x148103=_0xeec6[_0x3a3b9e];return _0x148103;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6eec('0x11'),auth[_0x6eec('0xa')](),controller['update']);router['delete'](_0x6eec('0x11'),auth['isAuthenticated'](),controller[_0x6eec('0x12')]);module[_0x6eec('0x13')]=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','./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x5b9f97,_0x4ab02a){var _0x2d8ba6=function(_0x1b5ba7){while(--_0x1b5ba7){_0x5b9f97['push'](_0x5b9f97['shift']());}};_0x2d8ba6(++_0x4ab02a);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x16e2b4,_0x5225f2){_0x16e2b4=_0x16e2b4-0x0;var _0x1e740b=_0xd6d6[_0x16e2b4];return _0x1e740b;};'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/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index dca6787..29265e6 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x212a63,_0x2d0ce4){var _0x2cecf2=function(_0x29133a){while(--_0x29133a){_0x212a63['push'](_0x212a63['shift']());}};_0x2cecf2(++_0x2d0ce4);}(_0xedd9,0xfc));var _0x9edd=function(_0x47d5e3,_0x19fe4c){_0x47d5e3=_0x47d5e3-0x0;var _0x4023b9=_0xedd9[_0x47d5e3];return _0x4023b9;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x316d09,_0x50cb67){var _0x294e8c=function(_0x2c8521){while(--_0x2c8521){_0x316d09['push'](_0x316d09['shift']());}};_0x294e8c(++_0x50cb67);}(_0xaa88,0x137));var _0x8aa8=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0xaa88[_0xcd0918];return _0x250704;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index c85106c..7b39d66 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 _0xbd83=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty'];(function(_0x247ff8,_0x3bfc15){var _0x4f68cd=function(_0x7f3e9a){while(--_0x7f3e9a){_0x247ff8['push'](_0x247ff8['shift']());}};_0x4f68cd(++_0x3bfc15);}(_0xbd83,0x14d));var _0x3bd8=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0xbd83[_0x233716];return _0x302298;};'use strict';var emlformat=require(_0x3bd8('0x0'));var rimraf=require(_0x3bd8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3bd8('0x2'));var rp=require('request-promise');var moment=require(_0x3bd8('0x3'));var BPromise=require(_0x3bd8('0x4'));var Mustache=require('mustache');var util=require(_0x3bd8('0x5'));var path=require(_0x3bd8('0x6'));var sox=require(_0x3bd8('0x7'));var csv=require(_0x3bd8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bd8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3bd8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3bd8('0xb'));var toCsv=require(_0x3bd8('0x8'));var querystring=require('querystring');var Papa=require(_0x3bd8('0xc'));var Redis=require('ioredis');var authService=require(_0x3bd8('0xd'));var qs=require(_0x3bd8('0xe'));var as=require(_0x3bd8('0xf'));var hardwareService=require(_0x3bd8('0x10'));var logger=require(_0x3bd8('0x11'))(_0x3bd8('0x12'));var utils=require(_0x3bd8('0x13'));var config=require(_0x3bd8('0x14'));var licenseUtil=require(_0x3bd8('0x15'));var db=require(_0x3bd8('0x16'))['db'];function respondWithStatusCode(_0x40fe17,_0x591833){_0x591833=_0x591833||0xcc;return function(_0x1e52e5){if(_0x1e52e5){return _0x40fe17['sendStatus'](_0x591833);}return _0x40fe17[_0x3bd8('0x17')](_0x591833)[_0x3bd8('0x18')]();};}function respondWithResult(_0x437890,_0x2f4f28){_0x2f4f28=_0x2f4f28||0xc8;return function(_0x88dc5a){if(_0x88dc5a){return _0x437890[_0x3bd8('0x17')](_0x2f4f28)[_0x3bd8('0x19')](_0x88dc5a);}};}function respondWithFilteredResult(_0x266b67,_0xbf990b){return function(_0x19d49b){if(_0x19d49b){var _0x307b05=typeof _0xbf990b['offset']===_0x3bd8('0x1a')&&typeof _0xbf990b[_0x3bd8('0x1b')]===_0x3bd8('0x1a');var _0x45972e=_0x19d49b['count'];var _0x4b5897=_0x307b05?0x0:_0xbf990b[_0x3bd8('0x1c')];var _0x149b52=_0x307b05?_0x19d49b[_0x3bd8('0x1d')]:_0xbf990b[_0x3bd8('0x1c')]+_0xbf990b['limit'];var _0x440254;if(_0x149b52>=_0x45972e){_0x149b52=_0x45972e;_0x440254=0xc8;}else{_0x440254=0xce;}_0x266b67[_0x3bd8('0x17')](_0x440254);return _0x266b67[_0x3bd8('0x1e')](_0x3bd8('0x1f'),_0x4b5897+'-'+_0x149b52+'/'+_0x45972e)[_0x3bd8('0x19')](_0x19d49b);}return null;};}function patchUpdates(_0x5192af){return function(_0x2a150e){try{jsonpatch[_0x3bd8('0x20')](_0x2a150e,_0x5192af,!![]);}catch(_0x212f1c){return BPromise[_0x3bd8('0x21')](_0x212f1c);}return _0x2a150e[_0x3bd8('0x22')]();};}function saveUpdates(_0x2b8c36,_0x5b723a){return function(_0x2a44d7){if(_0x2a44d7){return _0x2a44d7['update'](_0x2b8c36)[_0x3bd8('0x23')](function(_0x501e1e){return _0x501e1e;});}return null;};}function removeEntity(_0x80a3bc,_0x45bc66){return function(_0x1de79e){if(_0x1de79e){return _0x1de79e[_0x3bd8('0x24')]()[_0x3bd8('0x23')](function(){_0x80a3bc[_0x3bd8('0x17')](0xcc)[_0x3bd8('0x18')]();});}};}function handleEntityNotFound(_0x26fbba,_0x10a76f){return function(_0x5130b7){if(!_0x5130b7){_0x26fbba[_0x3bd8('0x25')](0x194);}return _0x5130b7;};}function handleError(_0x44075a,_0x58c787){_0x58c787=_0x58c787||0x1f4;return function(_0x4744eb){logger[_0x3bd8('0x26')](_0x4744eb[_0x3bd8('0x27')]);if(_0x4744eb[_0x3bd8('0x28')]){delete _0x4744eb[_0x3bd8('0x28')];}_0x44075a[_0x3bd8('0x17')](_0x58c787)[_0x3bd8('0x29')](_0x4744eb);};}exports[_0x3bd8('0x2a')]=function(_0x4c43bc,_0x4267d4){var _0x316275={},_0x467332={},_0x35ed3b={'count':0x0,'rows':[]};var _0x187257=_[_0x3bd8('0x2b')](db[_0x3bd8('0x2c')][_0x3bd8('0x2d')],function(_0xf03a7d){return{'name':_0xf03a7d[_0x3bd8('0x2e')],'type':_0xf03a7d[_0x3bd8('0x2f')][_0x3bd8('0x30')]};});_0x467332[_0x3bd8('0x31')]=_[_0x3bd8('0x2b')](_0x187257,_0x3bd8('0x28'));_0x467332[_0x3bd8('0x32')]=_[_0x3bd8('0x33')](_0x4c43bc[_0x3bd8('0x32')]);_0x467332[_0x3bd8('0x34')]=_[_0x3bd8('0x35')](_0x467332[_0x3bd8('0x31')],_0x467332['query']);_0x316275['attributes']=_[_0x3bd8('0x35')](_0x467332['model'],qs['fields'](_0x4c43bc[_0x3bd8('0x32')]['fields']));_0x316275[_0x3bd8('0x36')]=_0x316275['attributes'][_0x3bd8('0x37')]?_0x316275[_0x3bd8('0x36')]:_0x467332[_0x3bd8('0x31')];if(!_0x4c43bc['query'][_0x3bd8('0x38')](_0x3bd8('0x39'))){_0x316275['limit']=qs[_0x3bd8('0x1b')](_0x4c43bc[_0x3bd8('0x32')][_0x3bd8('0x1b')]);_0x316275['offset']=qs['offset'](_0x4c43bc[_0x3bd8('0x32')]['offset']);}_0x316275[_0x3bd8('0x3a')]=qs[_0x3bd8('0x3b')](_0x4c43bc['query'][_0x3bd8('0x3b')]);_0x316275['where']=qs[_0x3bd8('0x34')](_['pick'](_0x4c43bc[_0x3bd8('0x32')],_0x467332[_0x3bd8('0x34')]),_0x187257);if(_0x4c43bc[_0x3bd8('0x32')][_0x3bd8('0x3c')]){_0x316275[_0x3bd8('0x3d')]=_[_0x3bd8('0x3e')](_0x316275['where'],{'$or':_[_0x3bd8('0x2b')](_0x187257,function(_0x4b2998){if(_0x4b2998['type']!==_0x3bd8('0x3f')){var _0x172177={};_0x172177[_0x4b2998[_0x3bd8('0x28')]]={'$like':'%'+_0x4c43bc['query'][_0x3bd8('0x3c')]+'%'};return _0x172177;}})});}_0x316275=_[_0x3bd8('0x3e')]({},_0x316275,_0x4c43bc[_0x3bd8('0x40')]);var _0xa8aa70={'where':_0x316275[_0x3bd8('0x3d')]};return db[_0x3bd8('0x2c')][_0x3bd8('0x1d')](_0xa8aa70)[_0x3bd8('0x23')](function(_0x2d73b5){_0x35ed3b['count']=_0x2d73b5;if(_0x4c43bc[_0x3bd8('0x32')][_0x3bd8('0x41')]){_0x316275['include']=[{'all':!![]}];}return db[_0x3bd8('0x2c')][_0x3bd8('0x42')](_0x316275);})[_0x3bd8('0x23')](function(_0x2dd429){_0x35ed3b[_0x3bd8('0x43')]=_0x2dd429;return _0x35ed3b;})[_0x3bd8('0x23')](respondWithFilteredResult(_0x4267d4,_0x316275))[_0x3bd8('0x44')](handleError(_0x4267d4,null));};exports[_0x3bd8('0x45')]=function(_0x378c44,_0x5dd2fb){var _0x28ac5e={'raw':!![],'where':{'id':_0x378c44[_0x3bd8('0x46')]['id']}},_0x1a1532={};_0x1a1532['model']=_[_0x3bd8('0x33')](db['SmsTransferReport'][_0x3bd8('0x2d')]);_0x1a1532[_0x3bd8('0x32')]=_[_0x3bd8('0x33')](_0x378c44['query']);_0x1a1532[_0x3bd8('0x34')]=_[_0x3bd8('0x35')](_0x1a1532[_0x3bd8('0x31')],_0x1a1532['query']);_0x28ac5e['attributes']=_[_0x3bd8('0x35')](_0x1a1532['model'],qs[_0x3bd8('0x47')](_0x378c44['query'][_0x3bd8('0x47')]));_0x28ac5e[_0x3bd8('0x36')]=_0x28ac5e[_0x3bd8('0x36')][_0x3bd8('0x37')]?_0x28ac5e['attributes']:_0x1a1532[_0x3bd8('0x31')];if(_0x378c44['query']['includeAll']){_0x28ac5e[_0x3bd8('0x48')]=[{'all':!![]}];}_0x28ac5e=_[_0x3bd8('0x3e')]({},_0x28ac5e,_0x378c44[_0x3bd8('0x40')]);return db['SmsTransferReport'][_0x3bd8('0x49')](_0x28ac5e)[_0x3bd8('0x23')](handleEntityNotFound(_0x5dd2fb,null))[_0x3bd8('0x23')](respondWithResult(_0x5dd2fb,null))[_0x3bd8('0x44')](handleError(_0x5dd2fb,null));};exports[_0x3bd8('0x4a')]=function(_0x16a59b,_0x454fda){return db[_0x3bd8('0x2c')]['create'](_0x16a59b[_0x3bd8('0x4b')],{})[_0x3bd8('0x23')](respondWithResult(_0x454fda,0xc9))[_0x3bd8('0x44')](handleError(_0x454fda,null));};exports[_0x3bd8('0x4c')]=function(_0x3ce069,_0x5ce15d){if(_0x3ce069[_0x3bd8('0x4b')]['id']){delete _0x3ce069[_0x3bd8('0x4b')]['id'];}return db[_0x3bd8('0x2c')][_0x3bd8('0x49')]({'where':{'id':_0x3ce069[_0x3bd8('0x46')]['id']}})[_0x3bd8('0x23')](handleEntityNotFound(_0x5ce15d,null))['then'](saveUpdates(_0x3ce069[_0x3bd8('0x4b')],null))['then'](respondWithResult(_0x5ce15d,null))['catch'](handleError(_0x5ce15d,null));};exports[_0x3bd8('0x24')]=function(_0x33b128,_0x53b709){return db[_0x3bd8('0x2c')][_0x3bd8('0x49')]({'where':{'id':_0x33b128[_0x3bd8('0x46')]['id']}})[_0x3bd8('0x23')](handleEntityNotFound(_0x53b709,null))[_0x3bd8('0x23')](removeEntity(_0x53b709,null))[_0x3bd8('0x44')](handleError(_0x53b709,null));};exports[_0x3bd8('0x4d')]=function(_0x1ec16c,_0x493594){return db['SmsTransferReport'][_0x3bd8('0x4d')]()[_0x3bd8('0x23')](respondWithResult(_0x493594,null))[_0x3bd8('0x44')](handleError(_0x493594,null));}; \ No newline at end of file +var _0x739a=['length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','catch','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','attributes','intersection','fields'];(function(_0x2d0729,_0x45b58c){var _0x18290b=function(_0x3dc104){while(--_0x3dc104){_0x2d0729['push'](_0x2d0729['shift']());}};_0x18290b(++_0x45b58c);}(_0x739a,0xf4));var _0xa739=function(_0x430469,_0x20e783){_0x430469=_0x430469-0x0;var _0x1ca55e=_0x739a[_0x430469];return _0x1ca55e;};'use strict';var emlformat=require(_0xa739('0x0'));var rimraf=require(_0xa739('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa739('0x2'));var moment=require(_0xa739('0x3'));var BPromise=require(_0xa739('0x4'));var Mustache=require(_0xa739('0x5'));var util=require('util');var path=require(_0xa739('0x6'));var sox=require(_0xa739('0x7'));var csv=require(_0xa739('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa739('0x9'));var _=require(_0xa739('0xa'));var squel=require(_0xa739('0xb'));var crypto=require(_0xa739('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa739('0xd'));var toCsv=require(_0xa739('0x8'));var querystring=require(_0xa739('0xe'));var Papa=require(_0xa739('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa739('0x10'));var as=require(_0xa739('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa739('0x12'));var config=require(_0xa739('0x13'));var licenseUtil=require(_0xa739('0x14'));var db=require(_0xa739('0x15'))['db'];function respondWithStatusCode(_0x3c5a49,_0x37fafc){_0x37fafc=_0x37fafc||0xcc;return function(_0x22dfb7){if(_0x22dfb7){return _0x3c5a49[_0xa739('0x16')](_0x37fafc);}return _0x3c5a49['status'](_0x37fafc)[_0xa739('0x17')]();};}function respondWithResult(_0x59f0e8,_0x20cacd){_0x20cacd=_0x20cacd||0xc8;return function(_0x38daeb){if(_0x38daeb){return _0x59f0e8[_0xa739('0x18')](_0x20cacd)[_0xa739('0x19')](_0x38daeb);}};}function respondWithFilteredResult(_0x4c491c,_0x3af73f){return function(_0xc3b39c){if(_0xc3b39c){var _0x7a7ae0=typeof _0x3af73f[_0xa739('0x1a')]===_0xa739('0x1b')&&typeof _0x3af73f['limit']===_0xa739('0x1b');var _0x1a1f1a=_0xc3b39c[_0xa739('0x1c')];var _0x5ee58e=_0x7a7ae0?0x0:_0x3af73f[_0xa739('0x1a')];var _0x4e645e=_0x7a7ae0?_0xc3b39c['count']:_0x3af73f['offset']+_0x3af73f[_0xa739('0x1d')];var _0xc93021;if(_0x4e645e>=_0x1a1f1a){_0x4e645e=_0x1a1f1a;_0xc93021=0xc8;}else{_0xc93021=0xce;}_0x4c491c[_0xa739('0x18')](_0xc93021);return _0x4c491c[_0xa739('0x1e')](_0xa739('0x1f'),_0x5ee58e+'-'+_0x4e645e+'/'+_0x1a1f1a)[_0xa739('0x19')](_0xc3b39c);}return null;};}function patchUpdates(_0x33a329){return function(_0x6e8cdd){try{jsonpatch[_0xa739('0x20')](_0x6e8cdd,_0x33a329,!![]);}catch(_0xbf583e){return BPromise[_0xa739('0x21')](_0xbf583e);}return _0x6e8cdd[_0xa739('0x22')]();};}function saveUpdates(_0xcd8033,_0x389366){return function(_0x34d83c){if(_0x34d83c){return _0x34d83c[_0xa739('0x23')](_0xcd8033)[_0xa739('0x24')](function(_0x124c47){return _0x124c47;});}return null;};}function removeEntity(_0x2c7d11,_0x1196e3){return function(_0x2e6aa9){if(_0x2e6aa9){return _0x2e6aa9[_0xa739('0x25')]()[_0xa739('0x24')](function(){_0x2c7d11[_0xa739('0x18')](0xcc)[_0xa739('0x17')]();});}};}function handleEntityNotFound(_0xa8a556,_0x3b8a6a){return function(_0x119c86){if(!_0x119c86){_0xa8a556[_0xa739('0x16')](0x194);}return _0x119c86;};}function handleError(_0x38b8ac,_0x2415d7){_0x2415d7=_0x2415d7||0x1f4;return function(_0x6ebcdf){logger['error'](_0x6ebcdf[_0xa739('0x26')]);if(_0x6ebcdf[_0xa739('0x27')]){delete _0x6ebcdf[_0xa739('0x27')];}_0x38b8ac[_0xa739('0x18')](_0x2415d7)['send'](_0x6ebcdf);};}exports[_0xa739('0x28')]=function(_0x50194c,_0xd1d00e){var _0x31ff6d={},_0x3aa827={},_0x34ce0a={'count':0x0,'rows':[]};var _0x3c4bf3=_[_0xa739('0x29')](db[_0xa739('0x2a')]['rawAttributes'],function(_0x1a8f66){return{'name':_0x1a8f66[_0xa739('0x2b')],'type':_0x1a8f66[_0xa739('0x2c')][_0xa739('0x2d')]};});_0x3aa827[_0xa739('0x2e')]=_[_0xa739('0x29')](_0x3c4bf3,_0xa739('0x27'));_0x3aa827[_0xa739('0x2f')]=_[_0xa739('0x30')](_0x50194c[_0xa739('0x2f')]);_0x3aa827['filters']=_['intersection'](_0x3aa827[_0xa739('0x2e')],_0x3aa827[_0xa739('0x2f')]);_0x31ff6d[_0xa739('0x31')]=_[_0xa739('0x32')](_0x3aa827[_0xa739('0x2e')],qs[_0xa739('0x33')](_0x50194c['query'][_0xa739('0x33')]));_0x31ff6d[_0xa739('0x31')]=_0x31ff6d[_0xa739('0x31')][_0xa739('0x34')]?_0x31ff6d[_0xa739('0x31')]:_0x3aa827[_0xa739('0x2e')];if(!_0x50194c[_0xa739('0x2f')][_0xa739('0x35')](_0xa739('0x36'))){_0x31ff6d['limit']=qs[_0xa739('0x1d')](_0x50194c['query'][_0xa739('0x1d')]);_0x31ff6d[_0xa739('0x1a')]=qs['offset'](_0x50194c[_0xa739('0x2f')][_0xa739('0x1a')]);}_0x31ff6d[_0xa739('0x37')]=qs['sort'](_0x50194c['query'][_0xa739('0x38')]);_0x31ff6d[_0xa739('0x39')]=qs['filters'](_[_0xa739('0x3a')](_0x50194c['query'],_0x3aa827[_0xa739('0x3b')]),_0x3c4bf3);if(_0x50194c[_0xa739('0x2f')][_0xa739('0x3c')]){_0x31ff6d[_0xa739('0x39')]=_[_0xa739('0x3d')](_0x31ff6d[_0xa739('0x39')],{'$or':_[_0xa739('0x29')](_0x3c4bf3,function(_0x1b6c7b){if(_0x1b6c7b['type']!==_0xa739('0x3e')){var _0x313e26={};_0x313e26[_0x1b6c7b[_0xa739('0x27')]]={'$like':'%'+_0x50194c[_0xa739('0x2f')]['filter']+'%'};return _0x313e26;}})});}_0x31ff6d=_['merge']({},_0x31ff6d,_0x50194c[_0xa739('0x3f')]);var _0x265d10={'where':_0x31ff6d['where']};return db['SmsTransferReport'][_0xa739('0x1c')](_0x265d10)[_0xa739('0x24')](function(_0x5ef9ac){_0x34ce0a[_0xa739('0x1c')]=_0x5ef9ac;if(_0x50194c[_0xa739('0x2f')][_0xa739('0x40')]){_0x31ff6d['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xa739('0x41')](_0x31ff6d);})['then'](function(_0x33ea45){_0x34ce0a['rows']=_0x33ea45;return _0x34ce0a;})[_0xa739('0x24')](respondWithFilteredResult(_0xd1d00e,_0x31ff6d))['catch'](handleError(_0xd1d00e,null));};exports[_0xa739('0x42')]=function(_0x3857fb,_0x4d7eba){var _0x25fcd8={'raw':!![],'where':{'id':_0x3857fb[_0xa739('0x43')]['id']}},_0x58a05={};_0x58a05[_0xa739('0x2e')]=_[_0xa739('0x30')](db[_0xa739('0x2a')]['rawAttributes']);_0x58a05[_0xa739('0x2f')]=_[_0xa739('0x30')](_0x3857fb[_0xa739('0x2f')]);_0x58a05[_0xa739('0x3b')]=_[_0xa739('0x32')](_0x58a05[_0xa739('0x2e')],_0x58a05[_0xa739('0x2f')]);_0x25fcd8['attributes']=_['intersection'](_0x58a05['model'],qs[_0xa739('0x33')](_0x3857fb['query'][_0xa739('0x33')]));_0x25fcd8[_0xa739('0x31')]=_0x25fcd8[_0xa739('0x31')]['length']?_0x25fcd8[_0xa739('0x31')]:_0x58a05[_0xa739('0x2e')];if(_0x3857fb['query']['includeAll']){_0x25fcd8[_0xa739('0x44')]=[{'all':!![]}];}_0x25fcd8=_[_0xa739('0x3d')]({},_0x25fcd8,_0x3857fb[_0xa739('0x3f')]);return db[_0xa739('0x2a')]['find'](_0x25fcd8)[_0xa739('0x24')](handleEntityNotFound(_0x4d7eba,null))['then'](respondWithResult(_0x4d7eba,null))[_0xa739('0x45')](handleError(_0x4d7eba,null));};exports[_0xa739('0x46')]=function(_0x249dcc,_0x184769){return db[_0xa739('0x2a')]['create'](_0x249dcc['body'],{})['then'](respondWithResult(_0x184769,0xc9))[_0xa739('0x45')](handleError(_0x184769,null));};exports[_0xa739('0x23')]=function(_0x58b892,_0xe9f21e){if(_0x58b892['body']['id']){delete _0x58b892[_0xa739('0x47')]['id'];}return db[_0xa739('0x2a')][_0xa739('0x48')]({'where':{'id':_0x58b892[_0xa739('0x43')]['id']}})['then'](handleEntityNotFound(_0xe9f21e,null))[_0xa739('0x24')](saveUpdates(_0x58b892['body'],null))[_0xa739('0x24')](respondWithResult(_0xe9f21e,null))['catch'](handleError(_0xe9f21e,null));};exports['destroy']=function(_0x21547f,_0x592338){return db['SmsTransferReport'][_0xa739('0x48')]({'where':{'id':_0x21547f[_0xa739('0x43')]['id']}})[_0xa739('0x24')](handleEntityNotFound(_0x592338,null))[_0xa739('0x24')](removeEntity(_0x592338,null))[_0xa739('0x45')](handleError(_0x592338,null));};exports['describe']=function(_0xe61832,_0x585f30){return db['SmsTransferReport'][_0xa739('0x49')]()[_0xa739('0x24')](respondWithResult(_0x585f30,null))[_0xa739('0x45')](handleError(_0x585f30,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a842711..4ef8222 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 _0x60a1=['./smsTransferReport.attributes','exports','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1068ff,_0x3dd4f0){var _0x2040ac=function(_0x4bb635){while(--_0x4bb635){_0x1068ff['push'](_0x1068ff['shift']());}};_0x2040ac(++_0x3dd4f0);}(_0x60a1,0x9f));var _0x160a=function(_0x45b282,_0x3e50d1){_0x45b282=_0x45b282-0x0;var _0x35859b=_0x60a1[_0x45b282];return _0x35859b;};'use strict';var _=require(_0x160a('0x0'));var util=require(_0x160a('0x1'));var logger=require(_0x160a('0x2'))(_0x160a('0x3'));var moment=require(_0x160a('0x4'));var BPromise=require(_0x160a('0x5'));var rp=require(_0x160a('0x6'));var fs=require('fs');var path=require(_0x160a('0x7'));var rimraf=require(_0x160a('0x8'));var config=require('../../config/environment');var attributes=require(_0x160a('0x9'));module[_0x160a('0xa')]=function(_0x14f8da,_0x475942){return _0x14f8da['define']('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x160a('0xb'),'fields':[_0x160a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88b4=['util','../../config/logger','moment','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0xc0b854,_0x493a67){var _0x36a21c=function(_0x36ebc7){while(--_0x36ebc7){_0xc0b854['push'](_0xc0b854['shift']());}};_0x36a21c(++_0x493a67);}(_0x88b4,0xa8));var _0x488b=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x88b4[_0x4d8789];return _0x404e41;};'use strict';var _=require(_0x488b('0x0'));var util=require(_0x488b('0x1'));var logger=require(_0x488b('0x2'))('api');var moment=require(_0x488b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x488b('0x4'));var rimraf=require(_0x488b('0x5'));var config=require(_0x488b('0x6'));var attributes=require(_0x488b('0x7'));module[_0x488b('0x8')]=function(_0x1f2ee4,_0x414bc9){return _0x1f2ee4[_0x488b('0x9')](_0x488b('0xa'),attributes,{'tableName':_0x488b('0xb'),'paranoid':![],'indexes':[{'name':_0x488b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index ea33585..d1e0fd7 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 _0x254a=['http','request','info','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x254a,0x138));var _0xa254=function(_0x1b5f7a,_0x281348){_0x1b5f7a=_0x1b5f7a-0x0;var _0x205dd7=_0x254a[_0x1b5f7a];return _0x205dd7;};'use strict';var _=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var moment=require(_0xa254('0x2'));var BPromise=require('bluebird');var rs=require(_0xa254('0x3'));var fs=require('fs');var Redis=require(_0xa254('0x4'));var db=require(_0xa254('0x5'))['db'];var utils=require(_0xa254('0x6'));var logger=require('../../config/logger')(_0xa254('0x7'));var config=require('../../config/environment');var jayson=require(_0xa254('0x8'));var client=jayson[_0xa254('0x9')][_0xa254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597d72,_0x5951b2,_0xaeed42){return new BPromise(function(_0x352a44,_0x50c5a3){return client[_0xa254('0xb')](_0x597d72,_0xaeed42)['then'](function(_0x19d140){logger[_0xa254('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x5951b2,'request\x20sent');logger[_0xa254('0xd')](_0xa254('0xe'),_0x5951b2,_0xa254('0xf'),JSON[_0xa254('0x10')](_0x19d140));if(_0x19d140[_0xa254('0x11')]){if(_0x19d140['error'][_0xa254('0x12')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x5951b2,_0x19d140[_0xa254('0x11')][_0xa254('0x13')]);return _0x50c5a3(_0x19d140['error'][_0xa254('0x13')]);}logger[_0xa254('0x11')](_0xa254('0x14'),_0x5951b2,_0x19d140[_0xa254('0x11')][_0xa254('0x13')]);return _0x352a44(_0x19d140['error'][_0xa254('0x13')]);}else{logger[_0xa254('0xc')](_0xa254('0x14'),_0x5951b2,_0xa254('0xf'));_0x352a44(_0x19d140[_0xa254('0x15')][_0xa254('0x13')]);}})[_0xa254('0x16')](function(_0x1f21ae){logger[_0xa254('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x5951b2,_0x1f21ae);_0x50c5a3(_0x1f21ae);});});} \ No newline at end of file +var _0xdc97=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5bc008,_0x531d68){var _0x23dfc6=function(_0x269e62){while(--_0x269e62){_0x5bc008['push'](_0x5bc008['shift']());}};_0x23dfc6(++_0x531d68);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3c1c11,_0x54d77d){_0x3c1c11=_0x3c1c11-0x0;var _0x5686ea=_0xdc97[_0x3c1c11];return _0x5686ea;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){return client[_0x7dc9('0xa')](_0x2636ef,_0x4b3229)[_0x7dc9('0xb')](function(_0x3dd07e){logger['info'](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x4f91c7,_0x7dc9('0xd'),JSON[_0x7dc9('0x10')](_0x3dd07e));if(_0x3dd07e[_0x7dc9('0x11')]){if(_0x3dd07e['error']['code']===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x23737d(_0x3dd07e['error'][_0x7dc9('0x12')]);}logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x2ff923(_0x3dd07e[_0x7dc9('0x11')]['message']);}else{logger[_0x7dc9('0x13')](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));_0x2ff923(_0x3dd07e[_0x7dc9('0x14')][_0x7dc9('0x12')]);}})[_0x7dc9('0x15')](function(_0x45698c){logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x45698c);_0x23737d(_0x45698c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 36238bf..2ad1e59 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 _0x35c8=['fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','single','file','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x35c8,0x17a));var _0x835c=function(_0x26e5d4,_0xbb879e){_0x26e5d4=_0x26e5d4-0x0;var _0x4cdfb7=_0x35c8[_0x26e5d4];return _0x4cdfb7;};'use strict';var multer=require(_0x835c('0x0'));var util=require(_0x835c('0x1'));var path=require(_0x835c('0x2'));var timeout=require(_0x835c('0x3'));var express=require(_0x835c('0x4'));var router=express[_0x835c('0x5')]();var fs_extra=require(_0x835c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x835c('0x7'));var config=require(_0x835c('0x8'));var controller=require(_0x835c('0x9'));router[_0x835c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x835c('0xa')](_0x835c('0xb'),auth[_0x835c('0xc')](),controller[_0x835c('0xd')]);router[_0x835c('0xa')](_0x835c('0xe'),auth[_0x835c('0xc')](),controller[_0x835c('0xf')]);var upload=multer({'storage':multer[_0x835c('0x10')]({'destination':function(_0x1dfe08,_0x5d8fb3,_0x1b6c0d){_0x1b6c0d(null,path[_0x835c('0x11')](config[_0x835c('0x12')],_0x835c('0x13')));},'filename':function(_0x4fe27e,_0xb4dbb0,_0x4be5b0){_0xb4dbb0[_0x835c('0x14')]=_0xb4dbb0[_0x835c('0x14')][_0x835c('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4be5b0(null,util[_0x835c('0x16')]('%s-%s%s',path[_0x835c('0x17')](_0xb4dbb0[_0x835c('0x14')],path[_0x835c('0x18')](_0xb4dbb0[_0x835c('0x14')])),Date[_0x835c('0x19')](),path[_0x835c('0x18')](_0xb4dbb0[_0x835c('0x14')])));}})});router[_0x835c('0x1a')]('/',upload[_0x835c('0x1b')](_0x835c('0x1c')),controller['create']);router[_0x835c('0x1d')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x835c('0x1e')]('/:id',auth['isAuthenticated'](),controller['delete']);module[_0x835c('0x1f')]=router; \ No newline at end of file +var _0x6ea8=['originalname','replace','format','%s-%s%s','post','single','file','delete','/:id','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','join','root','server/files/sounds/original/'];(function(_0x1ccb4b,_0x1c5bdc){var _0x2fd92c=function(_0x1a0286){while(--_0x1a0286){_0x1ccb4b['push'](_0x1ccb4b['shift']());}};_0x2fd92c(++_0x1c5bdc);}(_0x6ea8,0x11e));var _0x86ea=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x6ea8[_0x119705];return _0x2affc2;};'use strict';var multer=require(_0x86ea('0x0'));var util=require('util');var path=require(_0x86ea('0x1'));var timeout=require('connect-timeout');var express=require(_0x86ea('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x86ea('0x3'));var interaction=require(_0x86ea('0x4'));var config=require(_0x86ea('0x5'));var controller=require(_0x86ea('0x6'));router['get']('/',auth[_0x86ea('0x7')](),controller[_0x86ea('0x8')]);router[_0x86ea('0x9')]('/:id',auth[_0x86ea('0x7')](),controller['show']);router[_0x86ea('0x9')]('/:id/download',auth[_0x86ea('0x7')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x286be6,_0x338648,_0x2163a7){_0x2163a7(null,path[_0x86ea('0xa')](config[_0x86ea('0xb')],_0x86ea('0xc')));},'filename':function(_0x228699,_0x1badc3,_0xb7757){_0x1badc3[_0x86ea('0xd')]=_0x1badc3[_0x86ea('0xd')][_0x86ea('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb7757(null,util[_0x86ea('0xf')](_0x86ea('0x10'),path['basename'](_0x1badc3[_0x86ea('0xd')],path['extname'](_0x1badc3['originalname'])),Date['now'](),path['extname'](_0x1badc3[_0x86ea('0xd')])));}})});router[_0x86ea('0x11')]('/',upload[_0x86ea('0x12')](_0x86ea('0x13')),controller['create']);router['put']('/:id',auth[_0x86ea('0x7')](),controller['update']);router[_0x86ea('0x14')](_0x86ea('0x15'),auth[_0x86ea('0x7')](),controller['delete']);module[_0x86ea('0x16')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index acddc51..971f3dd 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 _0xde76=['INTEGER','exports','name','STRING','FLOAT','BIGINT'];(function(_0x1ed10b,_0x59032f){var _0x14dc1a=function(_0x171b9f){while(--_0x171b9f){_0x1ed10b['push'](_0x1ed10b['shift']());}};_0x14dc1a(++_0x59032f);}(_0xde76,0xd3));var _0x6de7=function(_0x2e78e4,_0x1e089a){_0x2e78e4=_0x2e78e4-0x0;var _0x457ce1=_0xde76[_0x2e78e4];return _0x457ce1;};'use strict';var Sequelize=require('sequelize');module[_0x6de7('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6de7('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6de7('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x6de7('0x2')]},'original_format':{'type':Sequelize[_0x6de7('0x2')]},'original_duration':{'type':Sequelize[_0x6de7('0x3')]},'original_sampleCount':{'type':Sequelize[_0x6de7('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x6de7('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x6de7('0x4')]},'converted_channelCount':{'type':Sequelize[_0x6de7('0x5')]},'converted_bitRate':{'type':Sequelize[_0x6de7('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x6de7('0x5')]}}; \ No newline at end of file +var _0x303f=['STRING','INTEGER','BIGINT','FLOAT','sequelize','name'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x303f,0xbe));var _0xf303=function(_0x4da8a0,_0x4ddaff){_0x4da8a0=_0x4da8a0-0x0;var _0x50da95=_0x303f[_0x4da8a0];return _0x50da95;};'use strict';var Sequelize=require(_0xf303('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf303('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf303('0x2')]},'display_name':{'type':Sequelize[_0xf303('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xf303('0x2')]},'original_format':{'type':Sequelize[_0xf303('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xf303('0x3')]},'original_bitRate':{'type':Sequelize[_0xf303('0x4')]},'original_sampleRate':{'type':Sequelize[_0xf303('0x3')]},'converted_format':{'type':Sequelize[_0xf303('0x2')]},'converted_duration':{'type':Sequelize[_0xf303('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xf303('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xf303('0x4')]},'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 9e5133e..81ca3f2 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 _0x748f=['Content-Range','json','reject','save','then','destroy','get','Sounds','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','options','Sound','includeAll','catch','show','keys','length','include','find','download','params','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','create','basename','originalname','file','filename','extname','substring','wav','join','server/files/sounds/original','format','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','user','UserProfileSection','autoAssociation','start','update','delete','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set'];(function(_0x10ad20,_0x348a7f){var _0x1712c0=function(_0x38ddbb){while(--_0x38ddbb){_0x10ad20['push'](_0x10ad20['shift']());}};_0x1712c0(++_0x348a7f);}(_0x748f,0xd6));var _0xf748=function(_0x59d1ef,_0x137c8b){_0x59d1ef=_0x59d1ef-0x0;var _0x3b54ad=_0x748f[_0x59d1ef];return _0x3b54ad;};'use strict';var emlformat=require(_0xf748('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf748('0x1'));var jsonpatch=require(_0xf748('0x2'));var rp=require(_0xf748('0x3'));var moment=require(_0xf748('0x4'));var BPromise=require(_0xf748('0x5'));var Mustache=require(_0xf748('0x6'));var util=require('util');var path=require(_0xf748('0x7'));var sox=require(_0xf748('0x8'));var csv=require(_0xf748('0x9'));var ejs=require(_0xf748('0xa'));var fs=require('fs');var fs_extra=require(_0xf748('0xb'));var _=require(_0xf748('0xc'));var squel=require(_0xf748('0xd'));var crypto=require(_0xf748('0xe'));var jsforce=require(_0xf748('0xf'));var deskjs=require(_0xf748('0x10'));var toCsv=require(_0xf748('0x9'));var querystring=require(_0xf748('0x11'));var Papa=require(_0xf748('0x12'));var Redis=require(_0xf748('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf748('0x14'));var as=require(_0xf748('0x15'));var hardwareService=require(_0xf748('0x16'));var logger=require(_0xf748('0x17'))('api');var utils=require(_0xf748('0x18'));var config=require(_0xf748('0x19'));var licenseUtil=require(_0xf748('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7eadfb,_0x12cb1d){_0x12cb1d=_0x12cb1d||0xcc;return function(_0x14eb95){if(_0x14eb95){return _0x7eadfb['sendStatus'](_0x12cb1d);}return _0x7eadfb[_0xf748('0x1b')](_0x12cb1d)[_0xf748('0x1c')]();};}function respondWithResult(_0x4ff377,_0x359ae5){_0x359ae5=_0x359ae5||0xc8;return function(_0x14c178){if(_0x14c178){return _0x4ff377['status'](_0x359ae5)['json'](_0x14c178);}};}function respondWithFilteredResult(_0x2dceff,_0x3ce5eb){return function(_0x117ea2){if(_0x117ea2){var _0x52c610=typeof _0x3ce5eb[_0xf748('0x1d')]===_0xf748('0x1e')&&typeof _0x3ce5eb['limit']===_0xf748('0x1e');var _0xe67cdc=_0x117ea2['count'];var _0x229aff=_0x52c610?0x0:_0x3ce5eb['offset'];var _0x3e5433=_0x52c610?_0x117ea2[_0xf748('0x1f')]:_0x3ce5eb[_0xf748('0x1d')]+_0x3ce5eb[_0xf748('0x20')];var _0x39de0a;if(_0x3e5433>=_0xe67cdc){_0x3e5433=_0xe67cdc;_0x39de0a=0xc8;}else{_0x39de0a=0xce;}_0x2dceff['status'](_0x39de0a);return _0x2dceff[_0xf748('0x21')](_0xf748('0x22'),_0x229aff+'-'+_0x3e5433+'/'+_0xe67cdc)[_0xf748('0x23')](_0x117ea2);}return null;};}function patchUpdates(_0x77b63d){return function(_0x33e6a7){try{jsonpatch['apply'](_0x33e6a7,_0x77b63d,!![]);}catch(_0x1f3088){return BPromise[_0xf748('0x24')](_0x1f3088);}return _0x33e6a7[_0xf748('0x25')]();};}function saveUpdates(_0x55a7c6,_0x246c05){return function(_0x300f50){if(_0x300f50){return _0x300f50['update'](_0x55a7c6)[_0xf748('0x26')](function(_0xcf7697){return _0xcf7697;});}return null;};}function removeEntity(_0xbbcd09,_0x41eb69){return function(_0x17c990){if(_0x17c990){return _0x17c990[_0xf748('0x27')]()[_0xf748('0x26')](function(){var _0x4f3624=_0x17c990[_0xf748('0x28')]({'plain':!![]});var _0xea22b1=_0xf748('0x29');return db[_0xf748('0x2a')][_0xf748('0x27')]({'where':{'type':_0xea22b1,'resourceId':_0x4f3624['id']}})[_0xf748('0x26')](function(){return _0x17c990;});})[_0xf748('0x26')](function(){_0xbbcd09['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2be039,_0x272484){return function(_0x20b6ac){if(!_0x20b6ac){_0x2be039[_0xf748('0x2b')](0x194);}return _0x20b6ac;};}function handleError(_0x1229f6,_0x1e92c2){_0x1e92c2=_0x1e92c2||0x1f4;return function(_0x8776c3){logger['error'](_0x8776c3[_0xf748('0x2c')]);if(_0x8776c3[_0xf748('0x2d')]){delete _0x8776c3[_0xf748('0x2d')];}_0x1229f6['status'](_0x1e92c2)[_0xf748('0x2e')](_0x8776c3);};}exports[_0xf748('0x2f')]=function(_0x2ded39,_0x4d4147){var _0x2c9f34={},_0x1266f8={},_0x351b6c={'count':0x0,'rows':[]};var _0x51b9e0=_[_0xf748('0x30')](db['Sound'][_0xf748('0x31')],function(_0x4f3d04){return{'name':_0x4f3d04[_0xf748('0x32')],'type':_0x4f3d04[_0xf748('0x33')][_0xf748('0x34')]};});_0x1266f8[_0xf748('0x35')]=_[_0xf748('0x30')](_0x51b9e0,_0xf748('0x2d'));_0x1266f8[_0xf748('0x36')]=_['keys'](_0x2ded39['query']);_0x1266f8[_0xf748('0x37')]=_[_0xf748('0x38')](_0x1266f8[_0xf748('0x35')],_0x1266f8[_0xf748('0x36')]);_0x2c9f34[_0xf748('0x39')]=_[_0xf748('0x38')](_0x1266f8['model'],qs['fields'](_0x2ded39['query'][_0xf748('0x3a')]));_0x2c9f34[_0xf748('0x39')]=_0x2c9f34[_0xf748('0x39')]['length']?_0x2c9f34[_0xf748('0x39')]:_0x1266f8['model'];if(!_0x2ded39[_0xf748('0x36')]['hasOwnProperty'](_0xf748('0x3b'))){_0x2c9f34[_0xf748('0x20')]=qs['limit'](_0x2ded39['query'][_0xf748('0x20')]);_0x2c9f34[_0xf748('0x1d')]=qs[_0xf748('0x1d')](_0x2ded39[_0xf748('0x36')][_0xf748('0x1d')]);}_0x2c9f34['order']=qs[_0xf748('0x3c')](_0x2ded39[_0xf748('0x36')][_0xf748('0x3c')]);_0x2c9f34[_0xf748('0x3d')]=qs[_0xf748('0x37')](_[_0xf748('0x3e')](_0x2ded39[_0xf748('0x36')],_0x1266f8[_0xf748('0x37')]),_0x51b9e0);if(_0x2ded39[_0xf748('0x36')][_0xf748('0x3f')]){_0x2c9f34['where']=_[_0xf748('0x40')](_0x2c9f34[_0xf748('0x3d')],{'$or':_[_0xf748('0x30')](_0x51b9e0,function(_0x5665ae){if(_0x5665ae[_0xf748('0x33')]!=='VIRTUAL'){var _0x2eff70={};_0x2eff70[_0x5665ae[_0xf748('0x2d')]]={'$like':'%'+_0x2ded39['query'][_0xf748('0x3f')]+'%'};return _0x2eff70;}})});}_0x2c9f34=_[_0xf748('0x40')]({},_0x2c9f34,_0x2ded39[_0xf748('0x41')]);var _0x1a5c17={'where':_0x2c9f34['where']};return db[_0xf748('0x42')][_0xf748('0x1f')](_0x1a5c17)['then'](function(_0x17c354){_0x351b6c[_0xf748('0x1f')]=_0x17c354;if(_0x2ded39[_0xf748('0x36')][_0xf748('0x43')]){_0x2c9f34['include']=[{'all':!![]}];}return db[_0xf748('0x42')]['findAll'](_0x2c9f34);})[_0xf748('0x26')](function(_0x5960c9){_0x351b6c['rows']=_0x5960c9;return _0x351b6c;})[_0xf748('0x26')](respondWithFilteredResult(_0x4d4147,_0x2c9f34))[_0xf748('0x44')](handleError(_0x4d4147,null));};exports[_0xf748('0x45')]=function(_0x1d93b3,_0x5081e1){var _0x5d2893={'raw':!![],'where':{'id':_0x1d93b3['params']['id']}},_0x232188={};_0x232188[_0xf748('0x35')]=_[_0xf748('0x46')](db[_0xf748('0x42')][_0xf748('0x31')]);_0x232188[_0xf748('0x36')]=_[_0xf748('0x46')](_0x1d93b3[_0xf748('0x36')]);_0x232188[_0xf748('0x37')]=_[_0xf748('0x38')](_0x232188[_0xf748('0x35')],_0x232188['query']);_0x5d2893['attributes']=_[_0xf748('0x38')](_0x232188[_0xf748('0x35')],qs[_0xf748('0x3a')](_0x1d93b3[_0xf748('0x36')][_0xf748('0x3a')]));_0x5d2893[_0xf748('0x39')]=_0x5d2893[_0xf748('0x39')][_0xf748('0x47')]?_0x5d2893[_0xf748('0x39')]:_0x232188[_0xf748('0x35')];if(_0x1d93b3['query'][_0xf748('0x43')]){_0x5d2893[_0xf748('0x48')]=[{'all':!![]}];}_0x5d2893=_[_0xf748('0x40')]({},_0x5d2893,_0x1d93b3['options']);return db[_0xf748('0x42')][_0xf748('0x49')](_0x5d2893)['then'](handleEntityNotFound(_0x5081e1,null))['then'](respondWithResult(_0x5081e1,null))[_0xf748('0x44')](handleError(_0x5081e1,null));};exports[_0xf748('0x4a')]=function(_0x2201d5,_0xfe89a2,_0x363df1){return db[_0xf748('0x42')][_0xf748('0x49')]({'where':{'id':_0x2201d5[_0xf748('0x4b')]['id']},'attributes':[_0xf748('0x2d'),_0xf748('0x4c'),_0xf748('0x4d')],'raw':!![]})[_0xf748('0x26')](handleEntityNotFound(_0xfe89a2,null))[_0xf748('0x26')](function(_0x44c8ce){if(_0x44c8ce){if(!fs[_0xf748('0x4e')](path['join'](config[_0xf748('0x4f')],_0xf748('0x50'),_0x44c8ce[_0xf748('0x4c')]+'.'+_0x44c8ce['converted_format']))){throw new db[(_0xf748('0x51'))][(_0xf748('0x52'))](_0xf748('0x53'));}return _0xfe89a2['download'](path['join'](config['root'],_0xf748('0x50'),util['format']('%s.%s',_0x44c8ce[_0xf748('0x4c')],_0x44c8ce[_0xf748('0x4d')])),util['format']('%s.%s',_0x44c8ce['name'],_0x44c8ce[_0xf748('0x4d')]));}return null;})[_0xf748('0x44')](handleError(_0xfe89a2,null));};exports[_0xf748('0x54')]=function(_0x2cf02d,_0x543a85,_0x309e19){var _0x4b2922={'name':path[_0xf748('0x55')](_0x2cf02d['file'][_0xf748('0x56')],path['extname'](_0x2cf02d[_0xf748('0x57')][_0xf748('0x56')])),'save_name':path[_0xf748('0x55')](_0x2cf02d[_0xf748('0x57')][_0xf748('0x58')],path['extname'](_0x2cf02d[_0xf748('0x57')][_0xf748('0x58')])),'original_format':path[_0xf748('0x59')](_0x2cf02d[_0xf748('0x57')][_0xf748('0x56')])[_0xf748('0x5a')](0x1),'converted_format':_0xf748('0x5b')};var _0x1f8ef5=path[_0xf748('0x5c')](config[_0xf748('0x4f')],_0xf748('0x5d'),_0x2cf02d[_0xf748('0x57')][_0xf748('0x58')]);var _0x518493=path[_0xf748('0x5c')](config[_0xf748('0x4f')],_0xf748('0x50'),util[_0xf748('0x5e')](_0xf748('0x5f'),path[_0xf748('0x55')](_0x2cf02d[_0xf748('0x57')][_0xf748('0x58')],path[_0xf748('0x59')](_0x2cf02d['file'][_0xf748('0x58')])),_0x4b2922[_0xf748('0x4d')]));logger[_0xf748('0x60')]('Sound\x20upload\x20filepath:\x20%s',_0x1f8ef5);logger['info'](_0xf748('0x61'),_0x518493);try{fs[_0xf748('0x62')](_0x1f8ef5,parseInt(_0xf748('0x63'),0x8));var _0xc93555=sox[_0xf748('0x64')](_0x1f8ef5,_0x518493,{'sampleRate':0x1f40,'format':_0xf748('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xc93555['on'](_0xf748('0x65'),function(_0x16fe29){fs[_0xf748('0x66')](_0x1f8ef5);_0x543a85[_0xf748('0x1b')](0x1f4)[_0xf748('0x2e')](_0x16fe29);});_0xc93555['on']('src',function(_0x3461aa){_0x4b2922['original_duration']=isNaN(_0x3461aa[_0xf748('0x67')])?null:_0x3461aa[_0xf748('0x67')]*0x3e8;_0x4b2922[_0xf748('0x68')]=isNaN(_0x3461aa[_0xf748('0x69')])?null:_0x3461aa[_0xf748('0x69')];_0x4b2922['original_channelCount']=isNaN(_0x3461aa[_0xf748('0x6a')])?null:_0x3461aa['channelCount'];_0x4b2922['original_bitRate']=isNaN(_0x3461aa[_0xf748('0x6b')])?null:_0x3461aa[_0xf748('0x6b')];_0x4b2922[_0xf748('0x6c')]=isNaN(_0x3461aa[_0xf748('0x6d')])?null:_0x3461aa['sampleRate'];});_0xc93555['on']('dest',function(_0x2dd7e6){_0x4b2922[_0xf748('0x6e')]=isNaN(_0x2dd7e6[_0xf748('0x67')])?null:_0x2dd7e6[_0xf748('0x67')]*0x3e8;_0x4b2922[_0xf748('0x6f')]=isNaN(_0x2dd7e6[_0xf748('0x69')])?null:_0x2dd7e6[_0xf748('0x69')];_0x4b2922[_0xf748('0x70')]=isNaN(_0x2dd7e6[_0xf748('0x6a')])?null:_0x2dd7e6[_0xf748('0x6a')];_0x4b2922[_0xf748('0x71')]=isNaN(_0x2dd7e6[_0xf748('0x6b')])?null:_0x2dd7e6[_0xf748('0x6b')];_0x4b2922['converted_sampleRate']=isNaN(_0x2dd7e6[_0xf748('0x6d')])?null:_0x2dd7e6['sampleRate'];});_0xc93555['on'](_0xf748('0x1c'),function(){fs[_0xf748('0x62')](_0x518493,parseInt(_0xf748('0x63'),0x8));return db[_0xf748('0x42')][_0xf748('0x54')](_0x4b2922)[_0xf748('0x26')](function(_0x56545b){var _0x5b96a1={'role':_0x2cf02d[_0xf748('0x72')][_0xf748('0x73')],'userProfileId':_0x2cf02d[_0xf748('0x72')][_0xf748('0x74')]};if(!_0x5b96a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b96a1[_0xf748('0x73')]===_0xf748('0x75')){var _0x51c7bd=_0x56545b['get']({'plain':!![]});return db[_0xf748('0x76')]['find']({'where':{'name':_0xf748('0x29'),'userProfileId':_0x5b96a1[_0xf748('0x74')]},'raw':!![]})[_0xf748('0x26')](function(_0x2a55a5){if(_0x2a55a5&&_0x2a55a5[_0xf748('0x77')]===0x0){return db[_0xf748('0x2a')]['create']({'name':_0x51c7bd['name'],'resourceId':_0x51c7bd['id'],'type':_0x2a55a5[_0xf748('0x2d')],'sectionId':_0x2a55a5['id']},{})['then'](function(){return _0x56545b;});}else{return _0x56545b;}})['catch'](function(_0x42ee98){logger[_0xf748('0x65')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42ee98);throw _0x42ee98;});}return _0x56545b;})[_0xf748('0x26')](respondWithResult(_0x543a85,null))[_0xf748('0x44')](handleError(_0x543a85,null));});_0xc93555[_0xf748('0x78')]();}catch(_0x54b35b){_0x543a85[_0xf748('0x1b')](0x1f4)[_0xf748('0x2e')](_0x54b35b);}};exports[_0xf748('0x79')]=function(_0x47f883,_0x290c47,_0x42fa50){return db[_0xf748('0x42')][_0xf748('0x49')]({'where':{'id':_0x47f883[_0xf748('0x4b')]['id']}})['then'](handleEntityNotFound(_0x290c47,null))['then'](saveUpdates(_[_0xf748('0x3e')](_0x47f883[_0xf748('0x72')],[_0xf748('0x2d'),'description']),null))['then'](respondWithResult(_0x290c47,null))['catch'](handleError(_0x290c47,null));};exports[_0xf748('0x7a')]=function(_0x461328,_0x44a0d0,_0x500edf){return db[_0xf748('0x42')]['find']({'where':{'id':_0x461328[_0xf748('0x4b')]['id']}})['then'](function(_0x1fcb4a){if(_0x1fcb4a){return _0x1fcb4a[_0xf748('0x27')]();}})['then'](function(_0x1d8015){var _0x351a68=path[_0xf748('0x5c')](config[_0xf748('0x4f')],_0xf748('0x5d'),util['format'](_0xf748('0x5f'),_0x1d8015[_0xf748('0x4c')],_0x1d8015[_0xf748('0x7b')]));var _0x32a8cc=path[_0xf748('0x5c')](config[_0xf748('0x4f')],_0xf748('0x50'),util[_0xf748('0x5e')](_0xf748('0x5f'),_0x1d8015[_0xf748('0x4c')],_0x1d8015[_0xf748('0x4d')]));fs[_0xf748('0x66')](_0x351a68);fs[_0xf748('0x66')](_0x32a8cc);return _0x1d8015;})[_0xf748('0x26')](function(_0x3dee23){if(_0x3dee23){return _0x44a0d0[_0xf748('0x1b')](0xcc)[_0xf748('0x1c')]();}})[_0xf748('0x26')](handleEntityNotFound(_0x44a0d0,null))[_0xf748('0x44')](handleError(_0x44a0d0,null));}; \ No newline at end of file +var _0x8157=['name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','pick','merge','where','VIRTUAL','options','Sound','includeAll','include','findAll','rows','catch','show','length','find','download','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','basename','file','extname','originalname','filename','substring','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','start','delete','original_format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8157,0x1c3));var _0x7815=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0x8157[_0x4c98b9];return _0x3a257a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7815('0x0'));var zipdir=require(_0x7815('0x1'));var jsonpatch=require(_0x7815('0x2'));var rp=require(_0x7815('0x3'));var moment=require(_0x7815('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7815('0x5'));var path=require(_0x7815('0x6'));var sox=require('sox');var csv=require(_0x7815('0x7'));var ejs=require(_0x7815('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7815('0x9'));var squel=require(_0x7815('0xa'));var crypto=require('crypto');var jsforce=require(_0x7815('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7815('0x7'));var querystring=require(_0x7815('0xc'));var Papa=require(_0x7815('0xd'));var Redis=require(_0x7815('0xe'));var authService=require(_0x7815('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7815('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7815('0x11'))('api');var utils=require(_0x7815('0x12'));var config=require(_0x7815('0x13'));var licenseUtil=require(_0x7815('0x14'));var db=require(_0x7815('0x15'))['db'];function respondWithStatusCode(_0x3d301a,_0xca0eb4){_0xca0eb4=_0xca0eb4||0xcc;return function(_0x5250e3){if(_0x5250e3){return _0x3d301a[_0x7815('0x16')](_0xca0eb4);}return _0x3d301a['status'](_0xca0eb4)[_0x7815('0x17')]();};}function respondWithResult(_0x5d4fb2,_0x3d7e11){_0x3d7e11=_0x3d7e11||0xc8;return function(_0x3819f1){if(_0x3819f1){return _0x5d4fb2[_0x7815('0x18')](_0x3d7e11)[_0x7815('0x19')](_0x3819f1);}};}function respondWithFilteredResult(_0x581e42,_0x3dcb63){return function(_0x1e035a){if(_0x1e035a){var _0x58c968=typeof _0x3dcb63[_0x7815('0x1a')]==='undefined'&&typeof _0x3dcb63[_0x7815('0x1b')]===_0x7815('0x1c');var _0x18c5a6=_0x1e035a['count'];var _0x24f02c=_0x58c968?0x0:_0x3dcb63['offset'];var _0x5828fc=_0x58c968?_0x1e035a[_0x7815('0x1d')]:_0x3dcb63[_0x7815('0x1a')]+_0x3dcb63[_0x7815('0x1b')];var _0x271ae5;if(_0x5828fc>=_0x18c5a6){_0x5828fc=_0x18c5a6;_0x271ae5=0xc8;}else{_0x271ae5=0xce;}_0x581e42[_0x7815('0x18')](_0x271ae5);return _0x581e42[_0x7815('0x1e')]('Content-Range',_0x24f02c+'-'+_0x5828fc+'/'+_0x18c5a6)['json'](_0x1e035a);}return null;};}function patchUpdates(_0x17553b){return function(_0x413672){try{jsonpatch[_0x7815('0x1f')](_0x413672,_0x17553b,!![]);}catch(_0x2cd07d){return BPromise['reject'](_0x2cd07d);}return _0x413672[_0x7815('0x20')]();};}function saveUpdates(_0x1801fc,_0x1fd1b6){return function(_0x37bf32){if(_0x37bf32){return _0x37bf32[_0x7815('0x21')](_0x1801fc)[_0x7815('0x22')](function(_0x2cafbe){return _0x2cafbe;});}return null;};}function removeEntity(_0x295ca1,_0x594ff5){return function(_0x2efcdf){if(_0x2efcdf){return _0x2efcdf[_0x7815('0x23')]()[_0x7815('0x22')](function(){var _0x4b2a08=_0x2efcdf[_0x7815('0x24')]({'plain':!![]});var _0x8ebe0a=_0x7815('0x25');return db[_0x7815('0x26')]['destroy']({'where':{'type':_0x8ebe0a,'resourceId':_0x4b2a08['id']}})['then'](function(){return _0x2efcdf;});})['then'](function(){_0x295ca1[_0x7815('0x18')](0xcc)[_0x7815('0x17')]();});}};}function handleEntityNotFound(_0x1be3d0,_0x5e1a7e){return function(_0x417f8a){if(!_0x417f8a){_0x1be3d0[_0x7815('0x16')](0x194);}return _0x417f8a;};}function handleError(_0x126874,_0x3ecbfb){_0x3ecbfb=_0x3ecbfb||0x1f4;return function(_0x337ff8){logger[_0x7815('0x27')](_0x337ff8[_0x7815('0x28')]);if(_0x337ff8['name']){delete _0x337ff8[_0x7815('0x29')];}_0x126874[_0x7815('0x18')](_0x3ecbfb)[_0x7815('0x2a')](_0x337ff8);};}exports['index']=function(_0x52a792,_0x2c0610){var _0x1e13f1={},_0x483510={},_0x55acce={'count':0x0,'rows':[]};var _0x2c53b5=_[_0x7815('0x2b')](db['Sound'][_0x7815('0x2c')],function(_0x254f99){return{'name':_0x254f99[_0x7815('0x2d')],'type':_0x254f99['type'][_0x7815('0x2e')]};});_0x483510['model']=_[_0x7815('0x2b')](_0x2c53b5,'name');_0x483510[_0x7815('0x2f')]=_[_0x7815('0x30')](_0x52a792[_0x7815('0x2f')]);_0x483510[_0x7815('0x31')]=_[_0x7815('0x32')](_0x483510['model'],_0x483510[_0x7815('0x2f')]);_0x1e13f1[_0x7815('0x33')]=_[_0x7815('0x32')](_0x483510[_0x7815('0x34')],qs[_0x7815('0x35')](_0x52a792['query'][_0x7815('0x35')]));_0x1e13f1[_0x7815('0x33')]=_0x1e13f1[_0x7815('0x33')]['length']?_0x1e13f1[_0x7815('0x33')]:_0x483510[_0x7815('0x34')];if(!_0x52a792[_0x7815('0x2f')]['hasOwnProperty'](_0x7815('0x36'))){_0x1e13f1['limit']=qs[_0x7815('0x1b')](_0x52a792[_0x7815('0x2f')][_0x7815('0x1b')]);_0x1e13f1['offset']=qs[_0x7815('0x1a')](_0x52a792[_0x7815('0x2f')]['offset']);}_0x1e13f1[_0x7815('0x37')]=qs[_0x7815('0x38')](_0x52a792['query'][_0x7815('0x38')]);_0x1e13f1['where']=qs[_0x7815('0x31')](_[_0x7815('0x39')](_0x52a792[_0x7815('0x2f')],_0x483510['filters']),_0x2c53b5);if(_0x52a792[_0x7815('0x2f')]['filter']){_0x1e13f1['where']=_[_0x7815('0x3a')](_0x1e13f1[_0x7815('0x3b')],{'$or':_[_0x7815('0x2b')](_0x2c53b5,function(_0x35f824){if(_0x35f824['type']!==_0x7815('0x3c')){var _0x4be1cd={};_0x4be1cd[_0x35f824[_0x7815('0x29')]]={'$like':'%'+_0x52a792['query']['filter']+'%'};return _0x4be1cd;}})});}_0x1e13f1=_[_0x7815('0x3a')]({},_0x1e13f1,_0x52a792[_0x7815('0x3d')]);var _0xd59753={'where':_0x1e13f1['where']};return db[_0x7815('0x3e')]['count'](_0xd59753)[_0x7815('0x22')](function(_0x390702){_0x55acce[_0x7815('0x1d')]=_0x390702;if(_0x52a792[_0x7815('0x2f')][_0x7815('0x3f')]){_0x1e13f1[_0x7815('0x40')]=[{'all':!![]}];}return db[_0x7815('0x3e')][_0x7815('0x41')](_0x1e13f1);})[_0x7815('0x22')](function(_0x419513){_0x55acce[_0x7815('0x42')]=_0x419513;return _0x55acce;})[_0x7815('0x22')](respondWithFilteredResult(_0x2c0610,_0x1e13f1))[_0x7815('0x43')](handleError(_0x2c0610,null));};exports[_0x7815('0x44')]=function(_0x5a446a,_0x241362){var _0xfde0d0={'raw':!![],'where':{'id':_0x5a446a['params']['id']}},_0x3bb704={};_0x3bb704[_0x7815('0x34')]=_['keys'](db['Sound']['rawAttributes']);_0x3bb704[_0x7815('0x2f')]=_[_0x7815('0x30')](_0x5a446a[_0x7815('0x2f')]);_0x3bb704[_0x7815('0x31')]=_[_0x7815('0x32')](_0x3bb704[_0x7815('0x34')],_0x3bb704['query']);_0xfde0d0[_0x7815('0x33')]=_['intersection'](_0x3bb704[_0x7815('0x34')],qs[_0x7815('0x35')](_0x5a446a[_0x7815('0x2f')]['fields']));_0xfde0d0[_0x7815('0x33')]=_0xfde0d0['attributes'][_0x7815('0x45')]?_0xfde0d0[_0x7815('0x33')]:_0x3bb704[_0x7815('0x34')];if(_0x5a446a['query']['includeAll']){_0xfde0d0[_0x7815('0x40')]=[{'all':!![]}];}_0xfde0d0=_[_0x7815('0x3a')]({},_0xfde0d0,_0x5a446a[_0x7815('0x3d')]);return db[_0x7815('0x3e')][_0x7815('0x46')](_0xfde0d0)[_0x7815('0x22')](handleEntityNotFound(_0x241362,null))['then'](respondWithResult(_0x241362,null))['catch'](handleError(_0x241362,null));};exports[_0x7815('0x47')]=function(_0x291da8,_0x2c1f28,_0x85dbfc){return db[_0x7815('0x3e')][_0x7815('0x46')]({'where':{'id':_0x291da8[_0x7815('0x48')]['id']},'attributes':[_0x7815('0x29'),_0x7815('0x49'),_0x7815('0x4a')],'raw':!![]})[_0x7815('0x22')](handleEntityNotFound(_0x2c1f28,null))[_0x7815('0x22')](function(_0x4ebd5a){if(_0x4ebd5a){if(!fs[_0x7815('0x4b')](path[_0x7815('0x4c')](config[_0x7815('0x4d')],_0x7815('0x4e'),_0x4ebd5a[_0x7815('0x49')]+'.'+_0x4ebd5a[_0x7815('0x4a')]))){throw new db[(_0x7815('0x4f'))][(_0x7815('0x50'))](_0x7815('0x51'));}return _0x2c1f28[_0x7815('0x47')](path['join'](config[_0x7815('0x4d')],_0x7815('0x4e'),util[_0x7815('0x52')]('%s.%s',_0x4ebd5a['save_name'],_0x4ebd5a[_0x7815('0x4a')])),util['format']('%s.%s',_0x4ebd5a[_0x7815('0x29')],_0x4ebd5a[_0x7815('0x4a')]));}return null;})[_0x7815('0x43')](handleError(_0x2c1f28,null));};exports['create']=function(_0x2cbc63,_0x2e473a,_0x35f2ba){var _0xb18ca3={'name':path[_0x7815('0x53')](_0x2cbc63[_0x7815('0x54')]['originalname'],path[_0x7815('0x55')](_0x2cbc63[_0x7815('0x54')][_0x7815('0x56')])),'save_name':path[_0x7815('0x53')](_0x2cbc63[_0x7815('0x54')][_0x7815('0x57')],path[_0x7815('0x55')](_0x2cbc63[_0x7815('0x54')][_0x7815('0x57')])),'original_format':path[_0x7815('0x55')](_0x2cbc63[_0x7815('0x54')][_0x7815('0x56')])[_0x7815('0x58')](0x1),'converted_format':'wav'};var _0x317dd3=path['join'](config[_0x7815('0x4d')],_0x7815('0x59'),_0x2cbc63[_0x7815('0x54')][_0x7815('0x57')]);var _0x57e52e=path[_0x7815('0x4c')](config['root'],'server/files/sounds/converted',util[_0x7815('0x52')](_0x7815('0x5a'),path['basename'](_0x2cbc63[_0x7815('0x54')]['filename'],path[_0x7815('0x55')](_0x2cbc63[_0x7815('0x54')][_0x7815('0x57')])),_0xb18ca3[_0x7815('0x4a')]));logger[_0x7815('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x317dd3);logger[_0x7815('0x5b')](_0x7815('0x5c'),_0x57e52e);try{fs[_0x7815('0x5d')](_0x317dd3,parseInt(_0x7815('0x5e'),0x8));var _0x176f9e=sox['transcode'](_0x317dd3,_0x57e52e,{'sampleRate':0x1f40,'format':_0x7815('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x176f9e['on']('error',function(_0x364c0e){fs[_0x7815('0x60')](_0x317dd3);_0x2e473a[_0x7815('0x18')](0x1f4)['send'](_0x364c0e);});_0x176f9e['on']('src',function(_0x4eff67){_0xb18ca3[_0x7815('0x61')]=isNaN(_0x4eff67[_0x7815('0x62')])?null:_0x4eff67[_0x7815('0x62')]*0x3e8;_0xb18ca3[_0x7815('0x63')]=isNaN(_0x4eff67[_0x7815('0x64')])?null:_0x4eff67[_0x7815('0x64')];_0xb18ca3[_0x7815('0x65')]=isNaN(_0x4eff67['channelCount'])?null:_0x4eff67[_0x7815('0x66')];_0xb18ca3[_0x7815('0x67')]=isNaN(_0x4eff67['bitRate'])?null:_0x4eff67[_0x7815('0x68')];_0xb18ca3[_0x7815('0x69')]=isNaN(_0x4eff67[_0x7815('0x6a')])?null:_0x4eff67[_0x7815('0x6a')];});_0x176f9e['on'](_0x7815('0x6b'),function(_0x5e0685){_0xb18ca3['converted_duration']=isNaN(_0x5e0685[_0x7815('0x62')])?null:_0x5e0685[_0x7815('0x62')]*0x3e8;_0xb18ca3[_0x7815('0x6c')]=isNaN(_0x5e0685['sampleCount'])?null:_0x5e0685[_0x7815('0x64')];_0xb18ca3[_0x7815('0x6d')]=isNaN(_0x5e0685[_0x7815('0x66')])?null:_0x5e0685['channelCount'];_0xb18ca3[_0x7815('0x6e')]=isNaN(_0x5e0685[_0x7815('0x68')])?null:_0x5e0685[_0x7815('0x68')];_0xb18ca3[_0x7815('0x6f')]=isNaN(_0x5e0685[_0x7815('0x6a')])?null:_0x5e0685[_0x7815('0x6a')];});_0x176f9e['on'](_0x7815('0x17'),function(){fs['chmodSync'](_0x57e52e,parseInt(_0x7815('0x5e'),0x8));return db[_0x7815('0x3e')][_0x7815('0x70')](_0xb18ca3)['then'](function(_0x5d4cdd){var _0x25b870={'role':_0x2cbc63['body'][_0x7815('0x71')],'userProfileId':_0x2cbc63[_0x7815('0x72')][_0x7815('0x73')]};if(!_0x25b870)throw new Error(_0x7815('0x74'));if(_0x25b870[_0x7815('0x71')]===_0x7815('0x75')){var _0x4704ea=_0x5d4cdd[_0x7815('0x24')]({'plain':!![]});return db[_0x7815('0x76')][_0x7815('0x46')]({'where':{'name':_0x7815('0x25'),'userProfileId':_0x25b870[_0x7815('0x73')]},'raw':!![]})[_0x7815('0x22')](function(_0x2d9ba5){if(_0x2d9ba5&&_0x2d9ba5[_0x7815('0x77')]===0x0){return db['UserProfileResource']['create']({'name':_0x4704ea[_0x7815('0x29')],'resourceId':_0x4704ea['id'],'type':_0x2d9ba5[_0x7815('0x29')],'sectionId':_0x2d9ba5['id']},{})['then'](function(){return _0x5d4cdd;});}else{return _0x5d4cdd;}})[_0x7815('0x43')](function(_0x21e0d7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21e0d7);throw _0x21e0d7;});}return _0x5d4cdd;})[_0x7815('0x22')](respondWithResult(_0x2e473a,null))['catch'](handleError(_0x2e473a,null));});_0x176f9e[_0x7815('0x78')]();}catch(_0x359f7c){_0x2e473a[_0x7815('0x18')](0x1f4)['send'](_0x359f7c);}};exports['update']=function(_0x5ea52c,_0x5e4605,_0x14cb85){return db[_0x7815('0x3e')]['find']({'where':{'id':_0x5ea52c[_0x7815('0x48')]['id']}})[_0x7815('0x22')](handleEntityNotFound(_0x5e4605,null))[_0x7815('0x22')](saveUpdates(_[_0x7815('0x39')](_0x5ea52c[_0x7815('0x72')],[_0x7815('0x29'),'description']),null))[_0x7815('0x22')](respondWithResult(_0x5e4605,null))['catch'](handleError(_0x5e4605,null));};exports[_0x7815('0x79')]=function(_0x94d17e,_0x333bcb,_0x267e8a){return db['Sound'][_0x7815('0x46')]({'where':{'id':_0x94d17e[_0x7815('0x48')]['id']}})[_0x7815('0x22')](function(_0x1ee491){if(_0x1ee491){return _0x1ee491[_0x7815('0x23')]();}})[_0x7815('0x22')](function(_0x596ee6){var _0x5585ea=path[_0x7815('0x4c')](config[_0x7815('0x4d')],_0x7815('0x59'),util['format'](_0x7815('0x5a'),_0x596ee6[_0x7815('0x49')],_0x596ee6[_0x7815('0x7a')]));var _0x504171=path['join'](config[_0x7815('0x4d')],'server/files/sounds/converted',util[_0x7815('0x52')]('%s.%s',_0x596ee6[_0x7815('0x49')],_0x596ee6[_0x7815('0x4a')]));fs[_0x7815('0x60')](_0x5585ea);fs['unlinkSync'](_0x504171);return _0x596ee6;})['then'](function(_0x23431c){if(_0x23431c){return _0x333bcb['status'](0xcc)[_0x7815('0x17')]();}})['then'](handleEntityNotFound(_0x333bcb,null))[_0x7815('0x43')](handleError(_0x333bcb,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c710672..c654fd2 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 _0xa012=['rimraf','../../config/environment','./sound.attributes','define','Sound','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0xa012,0x185));var _0x2a01=function(_0x5f0d94,_0x5618be){_0x5f0d94=_0x5f0d94-0x0;var _0x4fe50d=_0xa012[_0x5f0d94];return _0x4fe50d;};'use strict';var _=require(_0x2a01('0x0'));var util=require(_0x2a01('0x1'));var logger=require(_0x2a01('0x2'))('api');var moment=require(_0x2a01('0x3'));var BPromise=require(_0x2a01('0x4'));var rp=require(_0x2a01('0x5'));var fs=require('fs');var path=require(_0x2a01('0x6'));var rimraf=require(_0x2a01('0x7'));var config=require(_0x2a01('0x8'));var attributes=require(_0x2a01('0x9'));module['exports']=function(_0x53e6a9,_0x543433){return _0x53e6a9[_0x2a01('0xa')](_0x2a01('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x779c=['define','Sound','tools_sounds','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x5b1614,_0x2eb32c){var _0x5cce6a=function(_0x42447c){while(--_0x42447c){_0x5b1614['push'](_0x5b1614['shift']());}};_0x5cce6a(++_0x2eb32c);}(_0x779c,0x1f1));var _0xc779=function(_0x5b0e80,_0x46f096){_0x5b0e80=_0x5b0e80-0x0;var _0x20b1cb=_0x779c[_0x5b0e80];return _0x20b1cb;};'use strict';var _=require(_0xc779('0x0'));var util=require(_0xc779('0x1'));var logger=require(_0xc779('0x2'))('api');var moment=require(_0xc779('0x3'));var BPromise=require(_0xc779('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc779('0x5'));var rimraf=require(_0xc779('0x6'));var config=require(_0xc779('0x7'));var attributes=require(_0xc779('0x8'));module[_0xc779('0x9')]=function(_0x109f87,_0x179813){return _0x109f87[_0xc779('0xa')](_0xc779('0xb'),attributes,{'tableName':_0xc779('0xc'),'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 81ad62f..99b33ef 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 _0xb81d=['ShowSound','Sound','find','options','raw','where','attributes','model','map','include','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','Sound,\x20%s,\x20%s','message','info','catch'];(function(_0x2188b9,_0x44fa4a){var _0x4d50fa=function(_0x2be866){while(--_0x2be866){_0x2188b9['push'](_0x2188b9['shift']());}};_0x4d50fa(++_0x44fa4a);}(_0xb81d,0x6d));var _0xdb81=function(_0x71dc3,_0x220d82){_0x71dc3=_0x71dc3-0x0;var _0x7f763f=_0xb81d[_0x71dc3];return _0x7f763f;};'use strict';var _=require(_0xdb81('0x0'));var util=require('util');var moment=require(_0xdb81('0x1'));var BPromise=require(_0xdb81('0x2'));var rs=require(_0xdb81('0x3'));var fs=require('fs');var Redis=require(_0xdb81('0x4'));var db=require(_0xdb81('0x5'))['db'];var utils=require(_0xdb81('0x6'));var logger=require(_0xdb81('0x7'))(_0xdb81('0x8'));var config=require(_0xdb81('0x9'));var jayson=require(_0xdb81('0xa'));var client=jayson['client'][_0xdb81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d4153,_0x3777e1,_0x13359e){return new BPromise(function(_0x296c55,_0x34e463){return client[_0xdb81('0xc')](_0x2d4153,_0x13359e)[_0xdb81('0xd')](function(_0x52e301){logger['info']('Sound,\x20%s,\x20%s',_0x3777e1,_0xdb81('0xe'));logger[_0xdb81('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x3777e1,_0xdb81('0xe'),JSON[_0xdb81('0x10')](_0x52e301));if(_0x52e301['error']){if(_0x52e301[_0xdb81('0x11')][_0xdb81('0x12')]===0x1f4){logger[_0xdb81('0x11')](_0xdb81('0x13'),_0x3777e1,_0x52e301[_0xdb81('0x11')]['message']);return _0x34e463(_0x52e301['error']['message']);}logger[_0xdb81('0x11')](_0xdb81('0x13'),_0x3777e1,_0x52e301['error'][_0xdb81('0x14')]);return _0x296c55(_0x52e301[_0xdb81('0x11')][_0xdb81('0x14')]);}else{logger[_0xdb81('0x15')](_0xdb81('0x13'),_0x3777e1,_0xdb81('0xe'));_0x296c55(_0x52e301['result'][_0xdb81('0x14')]);}})[_0xdb81('0x16')](function(_0x2f3a76){logger['error'](_0xdb81('0x13'),_0x3777e1,_0x2f3a76);_0x34e463(_0x2f3a76);});});}exports[_0xdb81('0x17')]=function(_0x8cad13){var _0x58b6e0=this;return new Promise(function(_0x9e20c7,_0xdd0372){return db[_0xdb81('0x18')][_0xdb81('0x19')]({'raw':_0x8cad13[_0xdb81('0x1a')]?_0x8cad13[_0xdb81('0x1a')][_0xdb81('0x1b')]===undefined?!![]:![]:!![],'where':_0x8cad13['options']?_0x8cad13[_0xdb81('0x1a')][_0xdb81('0x1c')]||null:null,'attributes':_0x8cad13['options']?_0x8cad13['options'][_0xdb81('0x1d')]||null:null,'include':_0x8cad13['options']?_0x8cad13[_0xdb81('0x1a')]['include']?_['map'](_0x8cad13[_0xdb81('0x1a')]['include'],function(_0xd32ae4){return{'model':db[_0xd32ae4[_0xdb81('0x1e')]],'as':_0xd32ae4['as'],'attributes':_0xd32ae4[_0xdb81('0x1d')],'include':_0xd32ae4['include']?_[_0xdb81('0x1f')](_0xd32ae4[_0xdb81('0x20')],function(_0x3180b){return{'model':db[_0x3180b['model']],'as':_0x3180b['as'],'attributes':_0x3180b['attributes'],'include':_0x3180b[_0xdb81('0x20')]?_[_0xdb81('0x1f')](_0x3180b[_0xdb81('0x20')],function(_0x18c5b5){return{'model':db[_0x18c5b5['model']],'as':_0x18c5b5['as'],'attributes':_0x18c5b5[_0xdb81('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdb81('0xd')](function(_0x140bb1){logger[_0xdb81('0x15')](_0xdb81('0x17'),_0x8cad13);logger[_0xdb81('0xf')](_0xdb81('0x17'),_0x8cad13,JSON[_0xdb81('0x10')](_0x140bb1));_0x9e20c7(_0x140bb1);})[_0xdb81('0x16')](function(_0x4caa27){logger[_0xdb81('0x11')](_0xdb81('0x17'),_0x4caa27[_0xdb81('0x14')],_0x8cad13);_0xdd0372(_0x58b6e0[_0xdb81('0x11')](0x1f4,_0x4caa27['message']));});});}; \ No newline at end of file +var _0x842a=['map','model','attributes','ShowSound','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','find','options','where','include'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0x842a,0x130));var _0xa842=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0x842a[_0x12d951];return _0x44de17;};'use strict';var _=require(_0xa842('0x0'));var util=require(_0xa842('0x1'));var moment=require(_0xa842('0x2'));var BPromise=require(_0xa842('0x3'));var rs=require(_0xa842('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa842('0x5'))['db'];var utils=require(_0xa842('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa842('0x7'));var jayson=require(_0xa842('0x8'));var client=jayson['client'][_0xa842('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dce0e,_0x1afd9f,_0x4f64e5){return new BPromise(function(_0x2b0f69,_0x1633d2){return client[_0xa842('0xa')](_0x2dce0e,_0x4f64e5)[_0xa842('0xb')](function(_0x6faaf9){logger[_0xa842('0xc')](_0xa842('0xd'),_0x1afd9f,'request\x20sent');logger[_0xa842('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x1afd9f,_0xa842('0xf'),JSON[_0xa842('0x10')](_0x6faaf9));if(_0x6faaf9[_0xa842('0x11')]){if(_0x6faaf9[_0xa842('0x11')][_0xa842('0x12')]===0x1f4){logger[_0xa842('0x11')](_0xa842('0xd'),_0x1afd9f,_0x6faaf9[_0xa842('0x11')][_0xa842('0x13')]);return _0x1633d2(_0x6faaf9[_0xa842('0x11')][_0xa842('0x13')]);}logger[_0xa842('0x11')]('Sound,\x20%s,\x20%s',_0x1afd9f,_0x6faaf9[_0xa842('0x11')]['message']);return _0x2b0f69(_0x6faaf9['error'][_0xa842('0x13')]);}else{logger['info'](_0xa842('0xd'),_0x1afd9f,_0xa842('0xf'));_0x2b0f69(_0x6faaf9[_0xa842('0x14')][_0xa842('0x13')]);}})[_0xa842('0x15')](function(_0xe4ffda){logger[_0xa842('0x11')](_0xa842('0xd'),_0x1afd9f,_0xe4ffda);_0x1633d2(_0xe4ffda);});});}exports['ShowSound']=function(_0x52f1ab){var _0x105baf=this;return new Promise(function(_0x3ecdaf,_0x13080f){return db['Sound'][_0xa842('0x16')]({'raw':_0x52f1ab[_0xa842('0x17')]?_0x52f1ab['options']['raw']===undefined?!![]:![]:!![],'where':_0x52f1ab['options']?_0x52f1ab['options'][_0xa842('0x18')]||null:null,'attributes':_0x52f1ab[_0xa842('0x17')]?_0x52f1ab[_0xa842('0x17')]['attributes']||null:null,'include':_0x52f1ab[_0xa842('0x17')]?_0x52f1ab[_0xa842('0x17')][_0xa842('0x19')]?_[_0xa842('0x1a')](_0x52f1ab[_0xa842('0x17')][_0xa842('0x19')],function(_0x417703){return{'model':db[_0x417703[_0xa842('0x1b')]],'as':_0x417703['as'],'attributes':_0x417703[_0xa842('0x1c')],'include':_0x417703[_0xa842('0x19')]?_[_0xa842('0x1a')](_0x417703['include'],function(_0x2f0bb1){return{'model':db[_0x2f0bb1['model']],'as':_0x2f0bb1['as'],'attributes':_0x2f0bb1[_0xa842('0x1c')],'include':_0x2f0bb1[_0xa842('0x19')]?_[_0xa842('0x1a')](_0x2f0bb1[_0xa842('0x19')],function(_0x30cef4){return{'model':db[_0x30cef4[_0xa842('0x1b')]],'as':_0x30cef4['as'],'attributes':_0x30cef4[_0xa842('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25caac){logger['info'](_0xa842('0x1d'),_0x52f1ab);logger['debug']('ShowSound',_0x52f1ab,JSON['stringify'](_0x25caac));_0x3ecdaf(_0x25caac);})[_0xa842('0x15')](function(_0xeede17){logger[_0xa842('0x11')](_0xa842('0x1d'),_0xeede17[_0xa842('0x13')],_0x52f1ab);_0x13080f(_0x105baf['error'](0x1f4,_0xeede17[_0xa842('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 4d8a465..4f12a06 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 _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0x50516c,_0x500c0f){var _0x5c3523=function(_0x2c6dbe){while(--_0x2c6dbe){_0x50516c['push'](_0x50516c['shift']());}};_0x5c3523(++_0x500c0f);}(_0x14a0,0x8e));var _0x014a=function(_0x248f86,_0x47b892){_0x248f86=_0x248f86-0x0;var _0x53f443=_0x14a0[_0x248f86];return _0x53f443;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file +var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x38cc75,_0x10ccda){var _0x12e50c=function(_0x4b75d1){while(--_0x4b75d1){_0x38cc75['push'](_0x38cc75['shift']());}};_0x12e50c(++_0x10ccda);}(_0xac4a,0x13f));var _0xaac4=function(_0x4365b2,_0xb26976){_0x4365b2=_0x4365b2-0x0;var _0x39533f=_0xac4a[_0x4365b2];return _0x39533f;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 0093ed2..1efa265 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 _0x1aa0=['medium','out','sequelize','STRING','TEXT'];(function(_0x383fac,_0xeda6b6){var _0x38d3b6=function(_0x481966){while(--_0x481966){_0x383fac['push'](_0x383fac['shift']());}};_0x38d3b6(++_0xeda6b6);}(_0x1aa0,0xe3));var _0x01aa=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x1aa0[_0x2085f3];return _0x384e3c;};'use strict';var Sequelize=require(_0x01aa('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x01aa('0x1')]},'body':{'type':Sequelize[_0x01aa('0x2')](_0x01aa('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x01aa('0x4')),'defaultValue':_0x01aa('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x01aa('0x1')]},'providerResponse':{'type':Sequelize[_0x01aa('0x2')]}}; \ No newline at end of file +var _0x65b3=['TEXT','medium','out','sequelize'];(function(_0x551186,_0x558b62){var _0x5b9b1e=function(_0x762d3c){while(--_0x762d3c){_0x551186['push'](_0x551186['shift']());}};_0x5b9b1e(++_0x558b62);}(_0x65b3,0x177));var _0x365b=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x65b3[_0x56756b];return _0xa3002;};'use strict';var Sequelize=require(_0x365b('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x365b('0x1')](_0x365b('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x365b('0x3')),'defaultValue':_0x365b('0x3'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 9fdac42..8e3cb01 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 _0xc1d3=['rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareMessage','includeAll','include','findAll'];(function(_0x3e5f15,_0x203d61){var _0x33af59=function(_0x2218d1){while(--_0x2218d1){_0x3e5f15['push'](_0x3e5f15['shift']());}};_0x33af59(++_0x203d61);}(_0xc1d3,0x147));var _0x3c1d=function(_0x271720,_0x4f678b){_0x271720=_0x271720-0x0;var _0x553803=_0xc1d3[_0x271720];return _0x553803;};'use strict';var emlformat=require(_0x3c1d('0x0'));var rimraf=require(_0x3c1d('0x1'));var zipdir=require(_0x3c1d('0x2'));var jsonpatch=require(_0x3c1d('0x3'));var rp=require(_0x3c1d('0x4'));var moment=require(_0x3c1d('0x5'));var BPromise=require(_0x3c1d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3c1d('0x7'));var sox=require(_0x3c1d('0x8'));var csv=require(_0x3c1d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c1d('0xa'));var _=require(_0x3c1d('0xb'));var squel=require(_0x3c1d('0xc'));var crypto=require(_0x3c1d('0xd'));var jsforce=require(_0x3c1d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3c1d('0x9'));var querystring=require(_0x3c1d('0xf'));var Papa=require(_0x3c1d('0x10'));var Redis=require(_0x3c1d('0x11'));var authService=require(_0x3c1d('0x12'));var qs=require(_0x3c1d('0x13'));var as=require(_0x3c1d('0x14'));var hardwareService=require(_0x3c1d('0x15'));var logger=require('../../config/logger')(_0x3c1d('0x16'));var utils=require(_0x3c1d('0x17'));var config=require(_0x3c1d('0x18'));var licenseUtil=require(_0x3c1d('0x19'));var db=require(_0x3c1d('0x1a'))['db'];function respondWithStatusCode(_0x5a2402,_0xf3cd6d){_0xf3cd6d=_0xf3cd6d||0xcc;return function(_0x209b55){if(_0x209b55){return _0x5a2402['sendStatus'](_0xf3cd6d);}return _0x5a2402[_0x3c1d('0x1b')](_0xf3cd6d)['end']();};}function respondWithResult(_0x4ed530,_0x4b941d){_0x4b941d=_0x4b941d||0xc8;return function(_0x2875a9){if(_0x2875a9){return _0x4ed530[_0x3c1d('0x1b')](_0x4b941d)[_0x3c1d('0x1c')](_0x2875a9);}};}function respondWithFilteredResult(_0x434dbc,_0x2ed7af){return function(_0x2c0b83){if(_0x2c0b83){var _0x4e6157=typeof _0x2ed7af['offset']===_0x3c1d('0x1d')&&typeof _0x2ed7af['limit']===_0x3c1d('0x1d');var _0x295467=_0x2c0b83['count'];var _0x4a7e42=_0x4e6157?0x0:_0x2ed7af['offset'];var _0x33637d=_0x4e6157?_0x2c0b83[_0x3c1d('0x1e')]:_0x2ed7af[_0x3c1d('0x1f')]+_0x2ed7af[_0x3c1d('0x20')];var _0x9dce85;if(_0x33637d>=_0x295467){_0x33637d=_0x295467;_0x9dce85=0xc8;}else{_0x9dce85=0xce;}_0x434dbc['status'](_0x9dce85);return _0x434dbc['set'](_0x3c1d('0x21'),_0x4a7e42+'-'+_0x33637d+'/'+_0x295467)[_0x3c1d('0x1c')](_0x2c0b83);}return null;};}function patchUpdates(_0x3c7455){return function(_0x233dff){try{jsonpatch[_0x3c1d('0x22')](_0x233dff,_0x3c7455,!![]);}catch(_0x5b2720){return BPromise[_0x3c1d('0x23')](_0x5b2720);}return _0x233dff[_0x3c1d('0x24')]();};}function saveUpdates(_0xa5fd81,_0x5211d7){return function(_0x129497){if(_0x129497){return _0x129497[_0x3c1d('0x25')](_0xa5fd81)[_0x3c1d('0x26')](function(_0x210e9c){return _0x210e9c;});}return null;};}function removeEntity(_0x2e1af4,_0x1a853d){return function(_0x41a683){if(_0x41a683){return _0x41a683[_0x3c1d('0x27')]()[_0x3c1d('0x26')](function(){_0x2e1af4['status'](0xcc)[_0x3c1d('0x28')]();});}};}function handleEntityNotFound(_0x2a8854,_0x2078d5){return function(_0x4f7cd8){if(!_0x4f7cd8){_0x2a8854[_0x3c1d('0x29')](0x194);}return _0x4f7cd8;};}function handleError(_0x3bde45,_0x4e1f79){_0x4e1f79=_0x4e1f79||0x1f4;return function(_0x392bb1){logger[_0x3c1d('0x2a')](_0x392bb1[_0x3c1d('0x2b')]);if(_0x392bb1['name']){delete _0x392bb1[_0x3c1d('0x2c')];}_0x3bde45['status'](_0x4e1f79)[_0x3c1d('0x2d')](_0x392bb1);};}exports[_0x3c1d('0x2e')]=function(_0x59db0a,_0x4ff12a){var _0x356f61={},_0x2f7af9={},_0x93a3b1={'count':0x0,'rows':[]};var _0x52ab2b=_[_0x3c1d('0x2f')](db['SquareMessage'][_0x3c1d('0x30')],function(_0x438b09){return{'name':_0x438b09[_0x3c1d('0x31')],'type':_0x438b09['type'][_0x3c1d('0x32')]};});_0x2f7af9[_0x3c1d('0x33')]=_[_0x3c1d('0x2f')](_0x52ab2b,_0x3c1d('0x2c'));_0x2f7af9[_0x3c1d('0x34')]=_[_0x3c1d('0x35')](_0x59db0a[_0x3c1d('0x34')]);_0x2f7af9[_0x3c1d('0x36')]=_[_0x3c1d('0x37')](_0x2f7af9['model'],_0x2f7af9['query']);_0x356f61[_0x3c1d('0x38')]=_['intersection'](_0x2f7af9[_0x3c1d('0x33')],qs[_0x3c1d('0x39')](_0x59db0a[_0x3c1d('0x34')][_0x3c1d('0x39')]));_0x356f61[_0x3c1d('0x38')]=_0x356f61['attributes'][_0x3c1d('0x3a')]?_0x356f61[_0x3c1d('0x38')]:_0x2f7af9['model'];if(!_0x59db0a['query'][_0x3c1d('0x3b')](_0x3c1d('0x3c'))){_0x356f61[_0x3c1d('0x20')]=qs[_0x3c1d('0x20')](_0x59db0a[_0x3c1d('0x34')]['limit']);_0x356f61[_0x3c1d('0x1f')]=qs[_0x3c1d('0x1f')](_0x59db0a['query']['offset']);}_0x356f61['order']=qs[_0x3c1d('0x3d')](_0x59db0a[_0x3c1d('0x34')][_0x3c1d('0x3d')]);_0x356f61[_0x3c1d('0x3e')]=qs['filters'](_[_0x3c1d('0x3f')](_0x59db0a['query'],_0x2f7af9[_0x3c1d('0x36')]),_0x52ab2b);if(_0x59db0a[_0x3c1d('0x34')][_0x3c1d('0x40')]){_0x356f61[_0x3c1d('0x3e')]=_[_0x3c1d('0x41')](_0x356f61['where'],{'$or':_[_0x3c1d('0x2f')](_0x52ab2b,function(_0x28c575){if(_0x28c575[_0x3c1d('0x42')]!==_0x3c1d('0x43')){var _0x59c8fb={};_0x59c8fb[_0x28c575[_0x3c1d('0x2c')]]={'$like':'%'+_0x59db0a['query']['filter']+'%'};return _0x59c8fb;}})});}_0x356f61=_[_0x3c1d('0x41')]({},_0x356f61,_0x59db0a[_0x3c1d('0x44')]);var _0x58c490={'where':_0x356f61['where']};return db[_0x3c1d('0x45')][_0x3c1d('0x1e')](_0x58c490)['then'](function(_0x4f07d6){_0x93a3b1[_0x3c1d('0x1e')]=_0x4f07d6;if(_0x59db0a[_0x3c1d('0x34')][_0x3c1d('0x46')]){_0x356f61[_0x3c1d('0x47')]=[{'all':!![]}];}return db[_0x3c1d('0x45')][_0x3c1d('0x48')](_0x356f61);})[_0x3c1d('0x26')](function(_0x11bca2){_0x93a3b1[_0x3c1d('0x49')]=_0x11bca2;return _0x93a3b1;})[_0x3c1d('0x26')](respondWithFilteredResult(_0x4ff12a,_0x356f61))[_0x3c1d('0x4a')](handleError(_0x4ff12a,null));};exports[_0x3c1d('0x4b')]=function(_0x4b0f40,_0x21dbef){var _0x5ca02c={'raw':!![],'where':{'id':_0x4b0f40['params']['id']}},_0x415a61={};_0x415a61[_0x3c1d('0x33')]=_['keys'](db[_0x3c1d('0x45')][_0x3c1d('0x30')]);_0x415a61[_0x3c1d('0x34')]=_[_0x3c1d('0x35')](_0x4b0f40['query']);_0x415a61[_0x3c1d('0x36')]=_['intersection'](_0x415a61[_0x3c1d('0x33')],_0x415a61[_0x3c1d('0x34')]);_0x5ca02c[_0x3c1d('0x38')]=_[_0x3c1d('0x37')](_0x415a61['model'],qs[_0x3c1d('0x39')](_0x4b0f40[_0x3c1d('0x34')][_0x3c1d('0x39')]));_0x5ca02c[_0x3c1d('0x38')]=_0x5ca02c[_0x3c1d('0x38')]['length']?_0x5ca02c[_0x3c1d('0x38')]:_0x415a61[_0x3c1d('0x33')];if(_0x4b0f40[_0x3c1d('0x34')]['includeAll']){_0x5ca02c['include']=[{'all':!![]}];}_0x5ca02c=_[_0x3c1d('0x41')]({},_0x5ca02c,_0x4b0f40[_0x3c1d('0x44')]);return db[_0x3c1d('0x45')][_0x3c1d('0x4c')](_0x5ca02c)[_0x3c1d('0x26')](handleEntityNotFound(_0x21dbef,null))[_0x3c1d('0x26')](respondWithResult(_0x21dbef,null))['catch'](handleError(_0x21dbef,null));};exports[_0x3c1d('0x4d')]=function(_0x4c533e,_0x34ad3a){return db[_0x3c1d('0x45')][_0x3c1d('0x4d')](_0x4c533e[_0x3c1d('0x4e')],{})[_0x3c1d('0x26')](respondWithResult(_0x34ad3a,0xc9))[_0x3c1d('0x4a')](handleError(_0x34ad3a,null));};exports[_0x3c1d('0x25')]=function(_0x4f0b44,_0x576552){if(_0x4f0b44['body']['id']){delete _0x4f0b44[_0x3c1d('0x4e')]['id'];}return db[_0x3c1d('0x45')][_0x3c1d('0x4c')]({'where':{'id':_0x4f0b44[_0x3c1d('0x4f')]['id']}})[_0x3c1d('0x26')](handleEntityNotFound(_0x576552,null))[_0x3c1d('0x26')](saveUpdates(_0x4f0b44['body'],null))[_0x3c1d('0x26')](respondWithResult(_0x576552,null))[_0x3c1d('0x4a')](handleError(_0x576552,null));};exports['destroy']=function(_0x4bc4ac,_0x4302f3){return db[_0x3c1d('0x45')][_0x3c1d('0x4c')]({'where':{'id':_0x4bc4ac[_0x3c1d('0x4f')]['id']}})[_0x3c1d('0x26')](handleEntityNotFound(_0x4302f3,null))[_0x3c1d('0x26')](removeEntity(_0x4302f3,null))[_0x3c1d('0x4a')](handleError(_0x4302f3,null));}; \ No newline at end of file +var _0x49a1=['reject','save','update','destroy','then','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','SquareMessage','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','apply'];(function(_0x3a2b5b,_0x28abc9){var _0x357270=function(_0x8593c7){while(--_0x8593c7){_0x3a2b5b['push'](_0x3a2b5b['shift']());}};_0x357270(++_0x28abc9);}(_0x49a1,0x190));var _0x149a=function(_0x315812,_0x252a78){_0x315812=_0x315812-0x0;var _0x2c8d37=_0x49a1[_0x315812];return _0x2c8d37;};'use strict';var emlformat=require(_0x149a('0x0'));var rimraf=require(_0x149a('0x1'));var zipdir=require(_0x149a('0x2'));var jsonpatch=require(_0x149a('0x3'));var rp=require(_0x149a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x149a('0x5'));var path=require(_0x149a('0x6'));var sox=require('sox');var csv=require(_0x149a('0x7'));var ejs=require(_0x149a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x149a('0x9'));var squel=require('squel');var crypto=require(_0x149a('0xa'));var jsforce=require(_0x149a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x149a('0x7'));var querystring=require(_0x149a('0xc'));var Papa=require(_0x149a('0xd'));var Redis=require(_0x149a('0xe'));var authService=require(_0x149a('0xf'));var qs=require(_0x149a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x149a('0x11'))(_0x149a('0x12'));var utils=require(_0x149a('0x13'));var config=require(_0x149a('0x14'));var licenseUtil=require(_0x149a('0x15'));var db=require(_0x149a('0x16'))['db'];function respondWithStatusCode(_0x191f29,_0x4ff4ef){_0x4ff4ef=_0x4ff4ef||0xcc;return function(_0x5ddccb){if(_0x5ddccb){return _0x191f29[_0x149a('0x17')](_0x4ff4ef);}return _0x191f29['status'](_0x4ff4ef)[_0x149a('0x18')]();};}function respondWithResult(_0x2c2b7b,_0x28b843){_0x28b843=_0x28b843||0xc8;return function(_0x3a9b6b){if(_0x3a9b6b){return _0x2c2b7b[_0x149a('0x19')](_0x28b843)[_0x149a('0x1a')](_0x3a9b6b);}};}function respondWithFilteredResult(_0xe55b75,_0x103990){return function(_0x2b84ae){if(_0x2b84ae){var _0x3e7e0b=typeof _0x103990['offset']===_0x149a('0x1b')&&typeof _0x103990[_0x149a('0x1c')]===_0x149a('0x1b');var _0x339931=_0x2b84ae['count'];var _0x25ff29=_0x3e7e0b?0x0:_0x103990['offset'];var _0xe41fc6=_0x3e7e0b?_0x2b84ae['count']:_0x103990[_0x149a('0x1d')]+_0x103990[_0x149a('0x1c')];var _0x47afe7;if(_0xe41fc6>=_0x339931){_0xe41fc6=_0x339931;_0x47afe7=0xc8;}else{_0x47afe7=0xce;}_0xe55b75[_0x149a('0x19')](_0x47afe7);return _0xe55b75[_0x149a('0x1e')]('Content-Range',_0x25ff29+'-'+_0xe41fc6+'/'+_0x339931)['json'](_0x2b84ae);}return null;};}function patchUpdates(_0x560e9a){return function(_0x2c8bdc){try{jsonpatch[_0x149a('0x1f')](_0x2c8bdc,_0x560e9a,!![]);}catch(_0x4b2f91){return BPromise[_0x149a('0x20')](_0x4b2f91);}return _0x2c8bdc[_0x149a('0x21')]();};}function saveUpdates(_0x228c90,_0x3b765d){return function(_0x152cca){if(_0x152cca){return _0x152cca[_0x149a('0x22')](_0x228c90)['then'](function(_0x5653ba){return _0x5653ba;});}return null;};}function removeEntity(_0xd40885,_0x1b7a8c){return function(_0x336cf2){if(_0x336cf2){return _0x336cf2[_0x149a('0x23')]()[_0x149a('0x24')](function(){_0xd40885[_0x149a('0x19')](0xcc)[_0x149a('0x18')]();});}};}function handleEntityNotFound(_0x433aa9,_0x28eedb){return function(_0x11b590){if(!_0x11b590){_0x433aa9[_0x149a('0x17')](0x194);}return _0x11b590;};}function handleError(_0x47e5fe,_0x141a46){_0x141a46=_0x141a46||0x1f4;return function(_0x164c8f){logger['error'](_0x164c8f['stack']);if(_0x164c8f[_0x149a('0x25')]){delete _0x164c8f[_0x149a('0x25')];}_0x47e5fe[_0x149a('0x19')](_0x141a46)['send'](_0x164c8f);};}exports[_0x149a('0x26')]=function(_0x375a56,_0x37f76f){var _0xd3457={},_0x19671d={},_0x4b5f97={'count':0x0,'rows':[]};var _0x3419f8=_[_0x149a('0x27')](db['SquareMessage'][_0x149a('0x28')],function(_0x4689da){return{'name':_0x4689da[_0x149a('0x29')],'type':_0x4689da[_0x149a('0x2a')][_0x149a('0x2b')]};});_0x19671d[_0x149a('0x2c')]=_['map'](_0x3419f8,'name');_0x19671d['query']=_[_0x149a('0x2d')](_0x375a56[_0x149a('0x2e')]);_0x19671d[_0x149a('0x2f')]=_['intersection'](_0x19671d['model'],_0x19671d['query']);_0xd3457[_0x149a('0x30')]=_[_0x149a('0x31')](_0x19671d[_0x149a('0x2c')],qs[_0x149a('0x32')](_0x375a56[_0x149a('0x2e')][_0x149a('0x32')]));_0xd3457['attributes']=_0xd3457[_0x149a('0x30')][_0x149a('0x33')]?_0xd3457['attributes']:_0x19671d[_0x149a('0x2c')];if(!_0x375a56[_0x149a('0x2e')]['hasOwnProperty'](_0x149a('0x34'))){_0xd3457['limit']=qs[_0x149a('0x1c')](_0x375a56[_0x149a('0x2e')][_0x149a('0x1c')]);_0xd3457[_0x149a('0x1d')]=qs[_0x149a('0x1d')](_0x375a56[_0x149a('0x2e')][_0x149a('0x1d')]);}_0xd3457[_0x149a('0x35')]=qs[_0x149a('0x36')](_0x375a56[_0x149a('0x2e')][_0x149a('0x36')]);_0xd3457[_0x149a('0x37')]=qs[_0x149a('0x2f')](_[_0x149a('0x38')](_0x375a56[_0x149a('0x2e')],_0x19671d[_0x149a('0x2f')]),_0x3419f8);if(_0x375a56[_0x149a('0x2e')][_0x149a('0x39')]){_0xd3457[_0x149a('0x37')]=_['merge'](_0xd3457[_0x149a('0x37')],{'$or':_[_0x149a('0x27')](_0x3419f8,function(_0xa7e5b0){if(_0xa7e5b0[_0x149a('0x2a')]!==_0x149a('0x3a')){var _0x2eb895={};_0x2eb895[_0xa7e5b0[_0x149a('0x25')]]={'$like':'%'+_0x375a56[_0x149a('0x2e')][_0x149a('0x39')]+'%'};return _0x2eb895;}})});}_0xd3457=_[_0x149a('0x3b')]({},_0xd3457,_0x375a56[_0x149a('0x3c')]);var _0x3bf1ee={'where':_0xd3457[_0x149a('0x37')]};return db['SquareMessage']['count'](_0x3bf1ee)[_0x149a('0x24')](function(_0x4fc274){_0x4b5f97[_0x149a('0x3d')]=_0x4fc274;if(_0x375a56[_0x149a('0x2e')]['includeAll']){_0xd3457[_0x149a('0x3e')]=[{'all':!![]}];}return db[_0x149a('0x3f')]['findAll'](_0xd3457);})[_0x149a('0x24')](function(_0x4f5344){_0x4b5f97[_0x149a('0x40')]=_0x4f5344;return _0x4b5f97;})[_0x149a('0x24')](respondWithFilteredResult(_0x37f76f,_0xd3457))[_0x149a('0x41')](handleError(_0x37f76f,null));};exports[_0x149a('0x42')]=function(_0xa279cd,_0x395e75){var _0x54e4ac={'raw':!![],'where':{'id':_0xa279cd[_0x149a('0x43')]['id']}},_0x14d55b={};_0x14d55b[_0x149a('0x2c')]=_[_0x149a('0x2d')](db[_0x149a('0x3f')]['rawAttributes']);_0x14d55b['query']=_[_0x149a('0x2d')](_0xa279cd[_0x149a('0x2e')]);_0x14d55b[_0x149a('0x2f')]=_[_0x149a('0x31')](_0x14d55b[_0x149a('0x2c')],_0x14d55b['query']);_0x54e4ac[_0x149a('0x30')]=_[_0x149a('0x31')](_0x14d55b[_0x149a('0x2c')],qs[_0x149a('0x32')](_0xa279cd['query']['fields']));_0x54e4ac[_0x149a('0x30')]=_0x54e4ac[_0x149a('0x30')][_0x149a('0x33')]?_0x54e4ac[_0x149a('0x30')]:_0x14d55b[_0x149a('0x2c')];if(_0xa279cd['query'][_0x149a('0x44')]){_0x54e4ac[_0x149a('0x3e')]=[{'all':!![]}];}_0x54e4ac=_[_0x149a('0x3b')]({},_0x54e4ac,_0xa279cd[_0x149a('0x3c')]);return db[_0x149a('0x3f')][_0x149a('0x45')](_0x54e4ac)[_0x149a('0x24')](handleEntityNotFound(_0x395e75,null))[_0x149a('0x24')](respondWithResult(_0x395e75,null))[_0x149a('0x41')](handleError(_0x395e75,null));};exports[_0x149a('0x46')]=function(_0x1d780c,_0xeece2f){return db[_0x149a('0x3f')][_0x149a('0x46')](_0x1d780c[_0x149a('0x47')],{})[_0x149a('0x24')](respondWithResult(_0xeece2f,0xc9))[_0x149a('0x41')](handleError(_0xeece2f,null));};exports[_0x149a('0x22')]=function(_0x379e03,_0x3c10c9){if(_0x379e03[_0x149a('0x47')]['id']){delete _0x379e03[_0x149a('0x47')]['id'];}return db[_0x149a('0x3f')]['find']({'where':{'id':_0x379e03[_0x149a('0x43')]['id']}})[_0x149a('0x24')](handleEntityNotFound(_0x3c10c9,null))[_0x149a('0x24')](saveUpdates(_0x379e03[_0x149a('0x47')],null))[_0x149a('0x24')](respondWithResult(_0x3c10c9,null))[_0x149a('0x41')](handleError(_0x3c10c9,null));};exports['destroy']=function(_0x11477e,_0x41e252){return db['SquareMessage'][_0x149a('0x45')]({'where':{'id':_0x11477e['params']['id']}})[_0x149a('0x24')](handleEntityNotFound(_0x41e252,null))[_0x149a('0x24')](removeEntity(_0x41e252,null))[_0x149a('0x41')](handleError(_0x41e252,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index edcf21c..9af2f21 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 _0x5b5f=['square_messages','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareMessage.attributes','SquareMessage'];(function(_0x33f4bc,_0x375ed2){var _0x565bdd=function(_0x55b083){while(--_0x55b083){_0x33f4bc['push'](_0x33f4bc['shift']());}};_0x565bdd(++_0x375ed2);}(_0x5b5f,0xd9));var _0xf5b5=function(_0xbdf091,_0x35a06c){_0xbdf091=_0xbdf091-0x0;var _0x129fd5=_0x5b5f[_0xbdf091];return _0x129fd5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5b5('0x0'))(_0xf5b5('0x1'));var moment=require(_0xf5b5('0x2'));var BPromise=require('bluebird');var rp=require(_0xf5b5('0x3'));var fs=require('fs');var path=require(_0xf5b5('0x4'));var rimraf=require('rimraf');var config=require(_0xf5b5('0x5'));var attributes=require(_0xf5b5('0x6'));module['exports']=function(_0x46c9e4,_0x56bd04){return _0x46c9e4['define'](_0xf5b5('0x7'),attributes,{'tableName':_0xf5b5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb771=['request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','moment','bluebird'];(function(_0x40d65f,_0x3e0480){var _0xe89581=function(_0x52f1cb){while(--_0x52f1cb){_0x40d65f['push'](_0x40d65f['shift']());}};_0xe89581(++_0x3e0480);}(_0xb771,0x1e7));var _0x1b77=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb771[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x1b77('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1b77('0x1'));var BPromise=require(_0x1b77('0x2'));var rp=require(_0x1b77('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b77('0x4'));var config=require(_0x1b77('0x5'));var attributes=require(_0x1b77('0x6'));module[_0x1b77('0x7')]=function(_0x49fe74,_0x180834){return _0x49fe74['define'](_0x1b77('0x8'),attributes,{'tableName':_0x1b77('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 8bc753d..18db434 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 _0x779e=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x321291,_0xa447e7){var _0x17c066=function(_0x50ac5a){while(--_0x50ac5a){_0x321291['push'](_0x321291['shift']());}};_0x17c066(++_0xa447e7);}(_0x779e,0x6e));var _0xe779=function(_0x1a3243,_0x201872){_0x1a3243=_0x1a3243-0x0;var _0x33f2ca=_0x779e[_0x1a3243];return _0x33f2ca;};'use strict';var _=require(_0xe779('0x0'));var util=require(_0xe779('0x1'));var moment=require(_0xe779('0x2'));var BPromise=require(_0xe779('0x3'));var rs=require(_0xe779('0x4'));var fs=require('fs');var Redis=require(_0xe779('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe779('0x6'));var config=require(_0xe779('0x7'));var jayson=require(_0xe779('0x8'));var client=jayson[_0xe779('0x9')][_0xe779('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfaeb4,_0x2fb463,_0x510bea){return new BPromise(function(_0x5f06c8,_0x53eb9e){return client['request'](_0xfaeb4,_0x510bea)[_0xe779('0xb')](function(_0x4b1102){logger[_0xe779('0xc')]('SquareMessage,\x20%s,\x20%s',_0x2fb463,_0xe779('0xd'));logger[_0xe779('0xe')](_0xe779('0xf'),_0x2fb463,_0xe779('0xd'),JSON['stringify'](_0x4b1102));if(_0x4b1102[_0xe779('0x10')]){if(_0x4b1102['error'][_0xe779('0x11')]===0x1f4){logger[_0xe779('0x10')]('SquareMessage,\x20%s,\x20%s',_0x2fb463,_0x4b1102[_0xe779('0x10')]['message']);return _0x53eb9e(_0x4b1102[_0xe779('0x10')][_0xe779('0x12')]);}logger[_0xe779('0x10')]('SquareMessage,\x20%s,\x20%s',_0x2fb463,_0x4b1102[_0xe779('0x10')]['message']);return _0x5f06c8(_0x4b1102[_0xe779('0x10')]['message']);}else{logger[_0xe779('0xc')](_0xe779('0x13'),_0x2fb463,'request\x20sent');_0x5f06c8(_0x4b1102[_0xe779('0x14')][_0xe779('0x12')]);}})[_0xe779('0x15')](function(_0xf63ad3){logger[_0xe779('0x10')](_0xe779('0x13'),_0x2fb463,_0xf63ad3);_0x53eb9e(_0xf63ad3);});});}exports[_0xe779('0x16')]=function(_0x5ee1ca){var _0x1cd60a=this;return new Promise(function(_0x378faa,_0x25300f){return db[_0xe779('0x17')][_0xe779('0x18')](_0x5ee1ca[_0xe779('0x19')],{'raw':_0x5ee1ca['options']?_0x5ee1ca[_0xe779('0x1a')][_0xe779('0x1b')]===undefined?!![]:![]:!![]})[_0xe779('0xb')](function(_0x37a110){logger['info'](_0xe779('0x16'),_0x5ee1ca);logger[_0xe779('0xe')](_0xe779('0x16'),_0x5ee1ca,JSON[_0xe779('0x1c')](_0x37a110));_0x378faa(_0x37a110);})['catch'](function(_0x5e2649){logger['error'](_0xe779('0x16'),_0x5e2649['message'],_0x5ee1ca);_0x25300f(_0x1cd60a[_0xe779('0x10')](0x1f4,_0x5e2649[_0xe779('0x12')]));});});}; \ No newline at end of file +var _0x1d81=['error','SquareMessage,\x20%s,\x20%s','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1d81,0x110));var _0x11d8=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x1d81[_0x469a3c];return _0x968f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x11d8('0x0'));var rs=require(_0x11d8('0x1'));var fs=require('fs');var Redis=require(_0x11d8('0x2'));var db=require(_0x11d8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x11d8('0x4'))(_0x11d8('0x5'));var config=require(_0x11d8('0x6'));var jayson=require(_0x11d8('0x7'));var client=jayson[_0x11d8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d3dd2,_0x3f64d2,_0x17c68b){return new BPromise(function(_0x2f4b6f,_0xa59d3d){return client['request'](_0x2d3dd2,_0x17c68b)[_0x11d8('0x9')](function(_0x3b7436){logger['info']('SquareMessage,\x20%s,\x20%s',_0x3f64d2,'request\x20sent');logger[_0x11d8('0xa')](_0x11d8('0xb'),_0x3f64d2,_0x11d8('0xc'),JSON['stringify'](_0x3b7436));if(_0x3b7436['error']){if(_0x3b7436['error'][_0x11d8('0xd')]===0x1f4){logger[_0x11d8('0xe')](_0x11d8('0xf'),_0x3f64d2,_0x3b7436[_0x11d8('0xe')][_0x11d8('0x10')]);return _0xa59d3d(_0x3b7436['error']['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x3f64d2,_0x3b7436[_0x11d8('0xe')]['message']);return _0x2f4b6f(_0x3b7436[_0x11d8('0xe')][_0x11d8('0x10')]);}else{logger[_0x11d8('0x11')]('SquareMessage,\x20%s,\x20%s',_0x3f64d2,_0x11d8('0xc'));_0x2f4b6f(_0x3b7436[_0x11d8('0x12')][_0x11d8('0x10')]);}})[_0x11d8('0x13')](function(_0x3ed0ae){logger[_0x11d8('0xe')](_0x11d8('0xf'),_0x3f64d2,_0x3ed0ae);_0xa59d3d(_0x3ed0ae);});});}exports[_0x11d8('0x14')]=function(_0x4facb5){var _0x4607e9=this;return new Promise(function(_0x55c846,_0x16d562){return db[_0x11d8('0x15')][_0x11d8('0x16')](_0x4facb5[_0x11d8('0x17')],{'raw':_0x4facb5[_0x11d8('0x18')]?_0x4facb5['options'][_0x11d8('0x19')]===undefined?!![]:![]:!![]})[_0x11d8('0x9')](function(_0x385122){logger[_0x11d8('0x11')](_0x11d8('0x14'),_0x4facb5);logger[_0x11d8('0xa')](_0x11d8('0x14'),_0x4facb5,JSON['stringify'](_0x385122));_0x55c846(_0x385122);})[_0x11d8('0x13')](function(_0x37cf2c){logger[_0x11d8('0xe')](_0x11d8('0x14'),_0x37cf2c[_0x11d8('0x10')],_0x4facb5);_0x16d562(_0x4607e9[_0x11d8('0xe')](0x1f4,_0x37cf2c[_0x11d8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 3c5d0ef..e410bd3 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 _0xe207=['fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x112929,_0x7da466){var _0x333c16=function(_0x762dc0){while(--_0x762dc0){_0x112929['push'](_0x112929['shift']());}};_0x333c16(++_0x7da466);}(_0xe207,0x175));var _0x7e20=function(_0x399efe,_0x45e643){_0x399efe=_0x399efe-0x0;var _0x493c73=_0xe207[_0x399efe];return _0x493c73;};'use strict';var multer=require(_0x7e20('0x0'));var util=require(_0x7e20('0x1'));var path=require('path');var timeout=require(_0x7e20('0x2'));var express=require(_0x7e20('0x3'));var router=express[_0x7e20('0x4')]();var fs_extra=require(_0x7e20('0x5'));var auth=require(_0x7e20('0x6'));var interaction=require(_0x7e20('0x7'));var config=require('../../config/environment');var controller=require(_0x7e20('0x8'));router[_0x7e20('0x9')]('/',auth[_0x7e20('0xa')](),controller[_0x7e20('0xb')]);router['get'](_0x7e20('0xc'),auth[_0x7e20('0xa')](),controller[_0x7e20('0xd')]);router[_0x7e20('0x9')]('/:id/test',auth[_0x7e20('0xa')](),timeout('15s'),controller[_0x7e20('0xe')]);router[_0x7e20('0xf')]('/',auth[_0x7e20('0xa')](),controller[_0x7e20('0x10')]);router[_0x7e20('0x11')](_0x7e20('0xc'),auth[_0x7e20('0xa')](),controller[_0x7e20('0x12')]);router[_0x7e20('0x13')](_0x7e20('0xc'),auth[_0x7e20('0xa')](),controller['destroy']);module[_0x7e20('0x14')]=router; \ No newline at end of file +var _0x5bb7=['./squareOdbc.controller','isAuthenticated','index','get','/:id','show','/:id/test','15s','test','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x381007,_0x3cc0fe){var _0x3b263b=function(_0x12972f){while(--_0x12972f){_0x381007['push'](_0x381007['shift']());}};_0x3b263b(++_0x3cc0fe);}(_0x5bb7,0x1ac));var _0x75bb=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x5bb7[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x75bb('0x0'));var util=require(_0x75bb('0x1'));var path=require(_0x75bb('0x2'));var timeout=require(_0x75bb('0x3'));var express=require(_0x75bb('0x4'));var router=express[_0x75bb('0x5')]();var fs_extra=require(_0x75bb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x75bb('0x7'));var config=require(_0x75bb('0x8'));var controller=require(_0x75bb('0x9'));router['get']('/',auth[_0x75bb('0xa')](),controller[_0x75bb('0xb')]);router[_0x75bb('0xc')](_0x75bb('0xd'),auth[_0x75bb('0xa')](),controller[_0x75bb('0xe')]);router[_0x75bb('0xc')](_0x75bb('0xf'),auth[_0x75bb('0xa')](),timeout(_0x75bb('0x10')),controller[_0x75bb('0x11')]);router[_0x75bb('0x12')]('/',auth[_0x75bb('0xa')](),controller[_0x75bb('0x13')]);router[_0x75bb('0x14')](_0x75bb('0xd'),auth[_0x75bb('0xa')](),controller[_0x75bb('0x15')]);router['delete'](_0x75bb('0xd'),auth[_0x75bb('0xa')](),controller[_0x75bb('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 08ce41e..9a7ef17 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 _0x6088=['exports','name','STRING','sequelize'];(function(_0x5eba02,_0x5e3745){var _0x1d9617=function(_0x277d65){while(--_0x277d65){_0x5eba02['push'](_0x5eba02['shift']());}};_0x1d9617(++_0x5e3745);}(_0x6088,0x16b));var _0x8608=function(_0x41ff31,_0x4e234b){_0x41ff31=_0x41ff31-0x0;var _0x3409dc=_0x6088[_0x41ff31];return _0x3409dc;};'use strict';var Sequelize=require(_0x8608('0x0'));module[_0x8608('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8608('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8608('0x3')]},'description':{'type':Sequelize[_0x8608('0x3')]}}; \ No newline at end of file +var _0xbe3c=['exports','STRING','name','sequelize'];(function(_0x1dc274,_0xe48284){var _0x276069=function(_0x32b670){while(--_0x32b670){_0x1dc274['push'](_0x1dc274['shift']());}};_0x276069(++_0xe48284);}(_0xbe3c,0xfb));var _0xcbe3=function(_0x5252b8,_0x56e845){_0x5252b8=_0x5252b8-0x0;var _0x14bb8e=_0xbe3c[_0x5252b8];return _0x14bb8e;};'use strict';var Sequelize=require(_0xcbe3('0x0'));module[_0xcbe3('0x1')]={'name':{'type':Sequelize[_0xcbe3('0x2')],'unique':_0xcbe3('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xcbe3('0x2')]},'description':{'type':Sequelize[_0xcbe3('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index ca26af6..6889901 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 _0x3793=['update','then','destroy','get','ODBC','error','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','SquareOdbc','includeAll','include','findAll','params','keys','find','catch','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','openSync','dsn','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5308ef,_0x1a9bda){var _0x53eef9=function(_0x5eca02){while(--_0x5eca02){_0x5308ef['push'](_0x5308ef['shift']());}};_0x53eef9(++_0x1a9bda);}(_0x3793,0xd9));var _0x3379=function(_0x5d5fe4,_0x3e6dcf){_0x5d5fe4=_0x5d5fe4-0x0;var _0x512d41=_0x3793[_0x5d5fe4];return _0x512d41;};'use strict';var emlformat=require(_0x3379('0x0'));var rimraf=require(_0x3379('0x1'));var zipdir=require(_0x3379('0x2'));var jsonpatch=require(_0x3379('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3379('0x4'));var Mustache=require(_0x3379('0x5'));var util=require('util');var path=require(_0x3379('0x6'));var sox=require(_0x3379('0x7'));var csv=require(_0x3379('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3379('0x9'));var _=require(_0x3379('0xa'));var squel=require('squel');var crypto=require(_0x3379('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3379('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3379('0xd'));var Redis=require(_0x3379('0xe'));var authService=require(_0x3379('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3379('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3379('0x11'))(_0x3379('0x12'));var utils=require('../../config/utils');var config=require(_0x3379('0x13'));var licenseUtil=require(_0x3379('0x14'));var db=require(_0x3379('0x15'))['db'];function respondWithStatusCode(_0x13fe6e,_0x3acf22){_0x3acf22=_0x3acf22||0xcc;return function(_0x209c23){if(_0x209c23){return _0x13fe6e[_0x3379('0x16')](_0x3acf22);}return _0x13fe6e[_0x3379('0x17')](_0x3acf22)[_0x3379('0x18')]();};}function respondWithResult(_0x435188,_0x45ebfc){_0x45ebfc=_0x45ebfc||0xc8;return function(_0x4786a2){if(_0x4786a2){return _0x435188[_0x3379('0x17')](_0x45ebfc)[_0x3379('0x19')](_0x4786a2);}};}function respondWithFilteredResult(_0x17e2ab,_0x30af3d){return function(_0x38a8d5){if(_0x38a8d5){var _0x154512=typeof _0x30af3d[_0x3379('0x1a')]===_0x3379('0x1b')&&typeof _0x30af3d[_0x3379('0x1c')]===_0x3379('0x1b');var _0xf79d8c=_0x38a8d5['count'];var _0x42fbfb=_0x154512?0x0:_0x30af3d['offset'];var _0x417c78=_0x154512?_0x38a8d5[_0x3379('0x1d')]:_0x30af3d[_0x3379('0x1a')]+_0x30af3d[_0x3379('0x1c')];var _0x1c9451;if(_0x417c78>=_0xf79d8c){_0x417c78=_0xf79d8c;_0x1c9451=0xc8;}else{_0x1c9451=0xce;}_0x17e2ab[_0x3379('0x17')](_0x1c9451);return _0x17e2ab[_0x3379('0x1e')](_0x3379('0x1f'),_0x42fbfb+'-'+_0x417c78+'/'+_0xf79d8c)[_0x3379('0x19')](_0x38a8d5);}return null;};}function patchUpdates(_0x56d08b){return function(_0x18f3e0){try{jsonpatch[_0x3379('0x20')](_0x18f3e0,_0x56d08b,!![]);}catch(_0x19da16){return BPromise[_0x3379('0x21')](_0x19da16);}return _0x18f3e0[_0x3379('0x22')]();};}function saveUpdates(_0x390b2b,_0x575bea){return function(_0x467f45){if(_0x467f45){return _0x467f45[_0x3379('0x23')](_0x390b2b)[_0x3379('0x24')](function(_0x24b3f3){return _0x24b3f3;});}return null;};}function removeEntity(_0x1e21bd,_0x574ea8){return function(_0x3d9a6e){if(_0x3d9a6e){return _0x3d9a6e[_0x3379('0x25')]()[_0x3379('0x24')](function(){var _0xe5cb24=_0x3d9a6e[_0x3379('0x26')]({'plain':!![]});var _0x780fa3=_0x3379('0x27');return db['UserProfileResource'][_0x3379('0x25')]({'where':{'type':_0x780fa3,'resourceId':_0xe5cb24['id']}})[_0x3379('0x24')](function(){return _0x3d9a6e;});})[_0x3379('0x24')](function(){_0x1e21bd[_0x3379('0x17')](0xcc)[_0x3379('0x18')]();});}};}function handleEntityNotFound(_0x194d7b,_0x97074){return function(_0x4d7195){if(!_0x4d7195){_0x194d7b[_0x3379('0x16')](0x194);}return _0x4d7195;};}function handleError(_0xf11718,_0x3d1920){_0x3d1920=_0x3d1920||0x1f4;return function(_0x59e079){logger[_0x3379('0x28')](_0x59e079['stack']);if(_0x59e079['name']){delete _0x59e079[_0x3379('0x29')];}_0xf11718[_0x3379('0x17')](_0x3d1920)[_0x3379('0x2a')](_0x59e079);};}exports[_0x3379('0x2b')]=function(_0x45366e,_0x3efafb){var _0x239e41={},_0x308c60={},_0x3411f4={'count':0x0,'rows':[]};var _0x566595=_[_0x3379('0x2c')](db['SquareOdbc'][_0x3379('0x2d')],function(_0x4f27ef){return{'name':_0x4f27ef[_0x3379('0x2e')],'type':_0x4f27ef[_0x3379('0x2f')]['key']};});_0x308c60['model']=_['map'](_0x566595,_0x3379('0x29'));_0x308c60['query']=_['keys'](_0x45366e[_0x3379('0x30')]);_0x308c60['filters']=_[_0x3379('0x31')](_0x308c60[_0x3379('0x32')],_0x308c60['query']);_0x239e41[_0x3379('0x33')]=_[_0x3379('0x31')](_0x308c60['model'],qs['fields'](_0x45366e['query'][_0x3379('0x34')]));_0x239e41[_0x3379('0x33')]=_0x239e41[_0x3379('0x33')][_0x3379('0x35')]?_0x239e41[_0x3379('0x33')]:_0x308c60[_0x3379('0x32')];if(!_0x45366e['query']['hasOwnProperty'](_0x3379('0x36'))){_0x239e41['limit']=qs[_0x3379('0x1c')](_0x45366e[_0x3379('0x30')][_0x3379('0x1c')]);_0x239e41[_0x3379('0x1a')]=qs['offset'](_0x45366e['query'][_0x3379('0x1a')]);}_0x239e41[_0x3379('0x37')]=qs[_0x3379('0x38')](_0x45366e['query'][_0x3379('0x38')]);_0x239e41['where']=qs[_0x3379('0x39')](_[_0x3379('0x3a')](_0x45366e[_0x3379('0x30')],_0x308c60[_0x3379('0x39')]),_0x566595);if(_0x45366e[_0x3379('0x30')][_0x3379('0x3b')]){_0x239e41[_0x3379('0x3c')]=_['merge'](_0x239e41[_0x3379('0x3c')],{'$or':_[_0x3379('0x2c')](_0x566595,function(_0x38b8bc){if(_0x38b8bc['type']!==_0x3379('0x3d')){var _0x46a61e={};_0x46a61e[_0x38b8bc['name']]={'$like':'%'+_0x45366e[_0x3379('0x30')][_0x3379('0x3b')]+'%'};return _0x46a61e;}})});}_0x239e41=_[_0x3379('0x3e')]({},_0x239e41,_0x45366e[_0x3379('0x3f')]);var _0x28c8ce={'where':_0x239e41[_0x3379('0x3c')]};return db[_0x3379('0x40')][_0x3379('0x1d')](_0x28c8ce)[_0x3379('0x24')](function(_0x4315f5){_0x3411f4['count']=_0x4315f5;if(_0x45366e['query'][_0x3379('0x41')]){_0x239e41[_0x3379('0x42')]=[{'all':!![]}];}return db[_0x3379('0x40')][_0x3379('0x43')](_0x239e41);})[_0x3379('0x24')](function(_0x5bce9a){_0x3411f4['rows']=_0x5bce9a;return _0x3411f4;})['then'](respondWithFilteredResult(_0x3efafb,_0x239e41))['catch'](handleError(_0x3efafb,null));};exports['show']=function(_0x23103d,_0x408c79){var _0x462b7f={'raw':!![],'where':{'id':_0x23103d[_0x3379('0x44')]['id']}},_0x37f585={};_0x37f585['model']=_[_0x3379('0x45')](db[_0x3379('0x40')][_0x3379('0x2d')]);_0x37f585['query']=_[_0x3379('0x45')](_0x23103d['query']);_0x37f585[_0x3379('0x39')]=_[_0x3379('0x31')](_0x37f585[_0x3379('0x32')],_0x37f585['query']);_0x462b7f[_0x3379('0x33')]=_['intersection'](_0x37f585[_0x3379('0x32')],qs[_0x3379('0x34')](_0x23103d[_0x3379('0x30')][_0x3379('0x34')]));_0x462b7f[_0x3379('0x33')]=_0x462b7f['attributes'][_0x3379('0x35')]?_0x462b7f['attributes']:_0x37f585[_0x3379('0x32')];if(_0x23103d['query'][_0x3379('0x41')]){_0x462b7f[_0x3379('0x42')]=[{'all':!![]}];}_0x462b7f=_[_0x3379('0x3e')]({},_0x462b7f,_0x23103d[_0x3379('0x3f')]);return db[_0x3379('0x40')][_0x3379('0x46')](_0x462b7f)[_0x3379('0x24')](handleEntityNotFound(_0x408c79,null))['then'](respondWithResult(_0x408c79,null))[_0x3379('0x47')](handleError(_0x408c79,null));};exports[_0x3379('0x48')]=function(_0x206186,_0x2dd9cb){return db[_0x3379('0x40')][_0x3379('0x48')](_0x206186['body'],{})[_0x3379('0x24')](function(_0x47e244){var _0x4dc094=_0x206186['user'][_0x3379('0x26')]({'plain':!![]});if(!_0x4dc094)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4dc094['role']===_0x3379('0x49')){var _0x12c6eb=_0x47e244[_0x3379('0x26')]({'plain':!![]});var _0x5dde15='ODBC';return db[_0x3379('0x4a')][_0x3379('0x46')]({'where':{'name':_0x5dde15,'userProfileId':_0x4dc094[_0x3379('0x4b')]},'raw':!![]})['then'](function(_0x28d771){if(_0x28d771&&_0x28d771[_0x3379('0x4c')]===0x0){return db[_0x3379('0x4d')][_0x3379('0x48')]({'name':_0x12c6eb[_0x3379('0x29')],'resourceId':_0x12c6eb['id'],'type':_0x28d771[_0x3379('0x29')],'sectionId':_0x28d771['id']},{})['then'](function(){return _0x47e244;});}else{return _0x47e244;}})[_0x3379('0x47')](function(_0x290ebd){logger[_0x3379('0x28')](_0x3379('0x4e'),_0x290ebd);throw _0x290ebd;});}return _0x47e244;})[_0x3379('0x24')](respondWithResult(_0x2dd9cb,0xc9))[_0x3379('0x47')](handleError(_0x2dd9cb,null));};exports['update']=function(_0x3941d7,_0x1eb8e9){if(_0x3941d7[_0x3379('0x4f')]['id']){delete _0x3941d7['body']['id'];}return db[_0x3379('0x40')][_0x3379('0x46')]({'where':{'id':_0x3941d7[_0x3379('0x44')]['id']}})[_0x3379('0x24')](handleEntityNotFound(_0x1eb8e9,null))['then'](saveUpdates(_0x3941d7[_0x3379('0x4f')],null))['then'](respondWithResult(_0x1eb8e9,null))[_0x3379('0x47')](handleError(_0x1eb8e9,null));};exports['destroy']=function(_0x3f309f,_0x3697a0){return db['SquareOdbc'][_0x3379('0x46')]({'where':{'id':_0x3f309f[_0x3379('0x44')]['id']}})['then'](handleEntityNotFound(_0x3697a0,null))[_0x3379('0x24')](removeEntity(_0x3697a0,null))[_0x3379('0x47')](handleError(_0x3697a0,null));};exports[_0x3379('0x50')]=function(_0x268e88,_0x3e7585,_0x38541f){var _0x5e6796;return db[_0x3379('0x40')]['find']({'where':{'id':_0x268e88[_0x3379('0x44')]['id']},'attributes':['id','dsn']})[_0x3379('0x24')](handleEntityNotFound(_0x3e7585,null))[_0x3379('0x24')](function(_0x4a8a31){if(_0x4a8a31){var _0x76e594=require(_0x3379('0x51'))();_0x76e594[_0x3379('0x52')](_0x4a8a31[_0x3379('0x53')]);_0x76e594['closeSync']();return _0x4a8a31;}})['then'](respondWithResult(_0x3e7585,null))[_0x3379('0x47')](handleError(_0x3e7585,null));}; \ No newline at end of file +var _0x03dd=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','ODBC','UserProfileResource','stack','name','send','index','SquareOdbc','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','update','dsn','openSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x4bc770,_0x53d0d7){var _0x17cf53=function(_0x5c488f){while(--_0x5c488f){_0x4bc770['push'](_0x4bc770['shift']());}};_0x17cf53(++_0x53d0d7);}(_0x03dd,0xea));var _0xd03d=function(_0xfa260b,_0xd2d0d){_0xfa260b=_0xfa260b-0x0;var _0x48fb84=_0x03dd[_0xfa260b];return _0x48fb84;};'use strict';var emlformat=require(_0xd03d('0x0'));var rimraf=require(_0xd03d('0x1'));var zipdir=require(_0xd03d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd03d('0x3'));var moment=require(_0xd03d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd03d('0x5'));var util=require(_0xd03d('0x6'));var path=require('path');var sox=require(_0xd03d('0x7'));var csv=require('to-csv');var ejs=require(_0xd03d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd03d('0x9'));var crypto=require('crypto');var jsforce=require(_0xd03d('0xa'));var deskjs=require(_0xd03d('0xb'));var toCsv=require(_0xd03d('0xc'));var querystring=require(_0xd03d('0xd'));var Papa=require('papaparse');var Redis=require(_0xd03d('0xe'));var authService=require(_0xd03d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd03d('0x10'));var hardwareService=require(_0xd03d('0x11'));var logger=require(_0xd03d('0x12'))(_0xd03d('0x13'));var utils=require('../../config/utils');var config=require(_0xd03d('0x14'));var licenseUtil=require(_0xd03d('0x15'));var db=require(_0xd03d('0x16'))['db'];function respondWithStatusCode(_0x5b1338,_0x407fbe){_0x407fbe=_0x407fbe||0xcc;return function(_0x522273){if(_0x522273){return _0x5b1338[_0xd03d('0x17')](_0x407fbe);}return _0x5b1338[_0xd03d('0x18')](_0x407fbe)[_0xd03d('0x19')]();};}function respondWithResult(_0x2864b0,_0x50feba){_0x50feba=_0x50feba||0xc8;return function(_0x7f6ac0){if(_0x7f6ac0){return _0x2864b0[_0xd03d('0x18')](_0x50feba)[_0xd03d('0x1a')](_0x7f6ac0);}};}function respondWithFilteredResult(_0xc0395d,_0x29e245){return function(_0x198d98){if(_0x198d98){var _0x8fa9f2=typeof _0x29e245[_0xd03d('0x1b')]===_0xd03d('0x1c')&&typeof _0x29e245[_0xd03d('0x1d')]===_0xd03d('0x1c');var _0x198728=_0x198d98[_0xd03d('0x1e')];var _0x5a40e3=_0x8fa9f2?0x0:_0x29e245[_0xd03d('0x1b')];var _0x350fa1=_0x8fa9f2?_0x198d98[_0xd03d('0x1e')]:_0x29e245['offset']+_0x29e245['limit'];var _0x30cfff;if(_0x350fa1>=_0x198728){_0x350fa1=_0x198728;_0x30cfff=0xc8;}else{_0x30cfff=0xce;}_0xc0395d[_0xd03d('0x18')](_0x30cfff);return _0xc0395d[_0xd03d('0x1f')](_0xd03d('0x20'),_0x5a40e3+'-'+_0x350fa1+'/'+_0x198728)[_0xd03d('0x1a')](_0x198d98);}return null;};}function patchUpdates(_0x2659cb){return function(_0x2a2c38){try{jsonpatch['apply'](_0x2a2c38,_0x2659cb,!![]);}catch(_0x4eea0a){return BPromise[_0xd03d('0x21')](_0x4eea0a);}return _0x2a2c38[_0xd03d('0x22')]();};}function saveUpdates(_0x2ec832,_0x14188c){return function(_0x4818b1){if(_0x4818b1){return _0x4818b1['update'](_0x2ec832)[_0xd03d('0x23')](function(_0x33d9d0){return _0x33d9d0;});}return null;};}function removeEntity(_0x32d63,_0x46e814){return function(_0x551371){if(_0x551371){return _0x551371[_0xd03d('0x24')]()[_0xd03d('0x23')](function(){var _0x172898=_0x551371[_0xd03d('0x25')]({'plain':!![]});var _0x3d9934=_0xd03d('0x26');return db[_0xd03d('0x27')][_0xd03d('0x24')]({'where':{'type':_0x3d9934,'resourceId':_0x172898['id']}})[_0xd03d('0x23')](function(){return _0x551371;});})[_0xd03d('0x23')](function(){_0x32d63[_0xd03d('0x18')](0xcc)[_0xd03d('0x19')]();});}};}function handleEntityNotFound(_0x394c76,_0x1baa13){return function(_0x43898a){if(!_0x43898a){_0x394c76['sendStatus'](0x194);}return _0x43898a;};}function handleError(_0x313ed7,_0x33c054){_0x33c054=_0x33c054||0x1f4;return function(_0x170993){logger['error'](_0x170993[_0xd03d('0x28')]);if(_0x170993[_0xd03d('0x29')]){delete _0x170993[_0xd03d('0x29')];}_0x313ed7[_0xd03d('0x18')](_0x33c054)[_0xd03d('0x2a')](_0x170993);};}exports[_0xd03d('0x2b')]=function(_0xa12f02,_0x15cd03){var _0x54027c={},_0x191a9a={},_0x26a52d={'count':0x0,'rows':[]};var _0x16fbc1=_['map'](db[_0xd03d('0x2c')][_0xd03d('0x2d')],function(_0x2ef57e){return{'name':_0x2ef57e['fieldName'],'type':_0x2ef57e[_0xd03d('0x2e')][_0xd03d('0x2f')]};});_0x191a9a[_0xd03d('0x30')]=_['map'](_0x16fbc1,_0xd03d('0x29'));_0x191a9a[_0xd03d('0x31')]=_[_0xd03d('0x32')](_0xa12f02[_0xd03d('0x31')]);_0x191a9a['filters']=_[_0xd03d('0x33')](_0x191a9a[_0xd03d('0x30')],_0x191a9a['query']);_0x54027c[_0xd03d('0x34')]=_['intersection'](_0x191a9a[_0xd03d('0x30')],qs[_0xd03d('0x35')](_0xa12f02[_0xd03d('0x31')][_0xd03d('0x35')]));_0x54027c[_0xd03d('0x34')]=_0x54027c['attributes']['length']?_0x54027c[_0xd03d('0x34')]:_0x191a9a[_0xd03d('0x30')];if(!_0xa12f02['query'][_0xd03d('0x36')](_0xd03d('0x37'))){_0x54027c[_0xd03d('0x1d')]=qs[_0xd03d('0x1d')](_0xa12f02[_0xd03d('0x31')]['limit']);_0x54027c[_0xd03d('0x1b')]=qs[_0xd03d('0x1b')](_0xa12f02['query'][_0xd03d('0x1b')]);}_0x54027c['order']=qs[_0xd03d('0x38')](_0xa12f02[_0xd03d('0x31')]['sort']);_0x54027c[_0xd03d('0x39')]=qs[_0xd03d('0x3a')](_[_0xd03d('0x3b')](_0xa12f02[_0xd03d('0x31')],_0x191a9a['filters']),_0x16fbc1);if(_0xa12f02['query'][_0xd03d('0x3c')]){_0x54027c['where']=_[_0xd03d('0x3d')](_0x54027c[_0xd03d('0x39')],{'$or':_[_0xd03d('0x3e')](_0x16fbc1,function(_0x2c9ceb){if(_0x2c9ceb[_0xd03d('0x2e')]!==_0xd03d('0x3f')){var _0x1d2da8={};_0x1d2da8[_0x2c9ceb[_0xd03d('0x29')]]={'$like':'%'+_0xa12f02['query'][_0xd03d('0x3c')]+'%'};return _0x1d2da8;}})});}_0x54027c=_[_0xd03d('0x3d')]({},_0x54027c,_0xa12f02[_0xd03d('0x40')]);var _0x1cba81={'where':_0x54027c[_0xd03d('0x39')]};return db[_0xd03d('0x2c')][_0xd03d('0x1e')](_0x1cba81)[_0xd03d('0x23')](function(_0x491267){_0x26a52d[_0xd03d('0x1e')]=_0x491267;if(_0xa12f02[_0xd03d('0x31')][_0xd03d('0x41')]){_0x54027c[_0xd03d('0x42')]=[{'all':!![]}];}return db[_0xd03d('0x2c')][_0xd03d('0x43')](_0x54027c);})['then'](function(_0x2d8c4c){_0x26a52d[_0xd03d('0x44')]=_0x2d8c4c;return _0x26a52d;})[_0xd03d('0x23')](respondWithFilteredResult(_0x15cd03,_0x54027c))[_0xd03d('0x45')](handleError(_0x15cd03,null));};exports['show']=function(_0x2141b4,_0x1874f3){var _0x1c0447={'raw':!![],'where':{'id':_0x2141b4[_0xd03d('0x46')]['id']}},_0x4bfd0b={};_0x4bfd0b[_0xd03d('0x30')]=_['keys'](db[_0xd03d('0x2c')][_0xd03d('0x2d')]);_0x4bfd0b['query']=_[_0xd03d('0x32')](_0x2141b4[_0xd03d('0x31')]);_0x4bfd0b[_0xd03d('0x3a')]=_['intersection'](_0x4bfd0b[_0xd03d('0x30')],_0x4bfd0b['query']);_0x1c0447[_0xd03d('0x34')]=_[_0xd03d('0x33')](_0x4bfd0b[_0xd03d('0x30')],qs[_0xd03d('0x35')](_0x2141b4[_0xd03d('0x31')][_0xd03d('0x35')]));_0x1c0447[_0xd03d('0x34')]=_0x1c0447[_0xd03d('0x34')][_0xd03d('0x47')]?_0x1c0447[_0xd03d('0x34')]:_0x4bfd0b[_0xd03d('0x30')];if(_0x2141b4['query'][_0xd03d('0x41')]){_0x1c0447[_0xd03d('0x42')]=[{'all':!![]}];}_0x1c0447=_[_0xd03d('0x3d')]({},_0x1c0447,_0x2141b4[_0xd03d('0x40')]);return db['SquareOdbc'][_0xd03d('0x48')](_0x1c0447)[_0xd03d('0x23')](handleEntityNotFound(_0x1874f3,null))[_0xd03d('0x23')](respondWithResult(_0x1874f3,null))[_0xd03d('0x45')](handleError(_0x1874f3,null));};exports[_0xd03d('0x49')]=function(_0x4e2881,_0x376136){return db[_0xd03d('0x2c')][_0xd03d('0x49')](_0x4e2881[_0xd03d('0x4a')],{})[_0xd03d('0x23')](function(_0x451a73){var _0x226e6b=_0x4e2881[_0xd03d('0x4b')][_0xd03d('0x25')]({'plain':!![]});if(!_0x226e6b)throw new Error(_0xd03d('0x4c'));if(_0x226e6b['role']===_0xd03d('0x4b')){var _0x2d4cdc=_0x451a73[_0xd03d('0x25')]({'plain':!![]});var _0x465832=_0xd03d('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x465832,'userProfileId':_0x226e6b[_0xd03d('0x4d')]},'raw':!![]})[_0xd03d('0x23')](function(_0xd671e6){if(_0xd671e6&&_0xd671e6[_0xd03d('0x4e')]===0x0){return db[_0xd03d('0x27')][_0xd03d('0x49')]({'name':_0x2d4cdc[_0xd03d('0x29')],'resourceId':_0x2d4cdc['id'],'type':_0xd671e6[_0xd03d('0x29')],'sectionId':_0xd671e6['id']},{})[_0xd03d('0x23')](function(){return _0x451a73;});}else{return _0x451a73;}})[_0xd03d('0x45')](function(_0x540a7f){logger[_0xd03d('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x540a7f);throw _0x540a7f;});}return _0x451a73;})[_0xd03d('0x23')](respondWithResult(_0x376136,0xc9))['catch'](handleError(_0x376136,null));};exports[_0xd03d('0x50')]=function(_0x118dbb,_0x2565c7){if(_0x118dbb[_0xd03d('0x4a')]['id']){delete _0x118dbb['body']['id'];}return db[_0xd03d('0x2c')][_0xd03d('0x48')]({'where':{'id':_0x118dbb['params']['id']}})[_0xd03d('0x23')](handleEntityNotFound(_0x2565c7,null))[_0xd03d('0x23')](saveUpdates(_0x118dbb[_0xd03d('0x4a')],null))['then'](respondWithResult(_0x2565c7,null))[_0xd03d('0x45')](handleError(_0x2565c7,null));};exports['destroy']=function(_0x7dfa2e,_0x200e95){return db['SquareOdbc']['find']({'where':{'id':_0x7dfa2e['params']['id']}})[_0xd03d('0x23')](handleEntityNotFound(_0x200e95,null))[_0xd03d('0x23')](removeEntity(_0x200e95,null))[_0xd03d('0x45')](handleError(_0x200e95,null));};exports['test']=function(_0x4b51b0,_0x4cbaf2,_0x3870b3){var _0xd8f4e0;return db['SquareOdbc'][_0xd03d('0x48')]({'where':{'id':_0x4b51b0[_0xd03d('0x46')]['id']},'attributes':['id',_0xd03d('0x51')]})[_0xd03d('0x23')](handleEntityNotFound(_0x4cbaf2,null))[_0xd03d('0x23')](function(_0x558ddb){if(_0x558ddb){var _0x4d0991=require('odbc')();_0x4d0991[_0xd03d('0x52')](_0x558ddb[_0xd03d('0x51')]);_0x4d0991['closeSync']();return _0x558ddb;}})[_0xd03d('0x23')](respondWithResult(_0x4cbaf2,null))['catch'](handleError(_0x4cbaf2,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index c7dc042..4f67f97 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 _0x612a=['SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','request-promise','path','./squareOdbc.attributes','exports','define'];(function(_0x4a1ec0,_0x26287b){var _0x49ab91=function(_0x206584){while(--_0x206584){_0x4a1ec0['push'](_0x4a1ec0['shift']());}};_0x49ab91(++_0x26287b);}(_0x612a,0xf2));var _0xa612=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0x612a[_0x50bf5a];return _0x4ddc1d;};'use strict';var _=require(_0xa612('0x0'));var util=require(_0xa612('0x1'));var logger=require('../../config/logger')(_0xa612('0x2'));var moment=require(_0xa612('0x3'));var BPromise=require(_0xa612('0x4'));var rp=require(_0xa612('0x5'));var fs=require('fs');var path=require(_0xa612('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa612('0x7'));module[_0xa612('0x8')]=function(_0x2254d4,_0x11d007){return _0x2254d4[_0xa612('0x9')](_0xa612('0xa'),attributes,{'tableName':_0xa612('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f03=['./squareOdbc.attributes','exports','define','SquareOdbc','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b8138,_0x33a5b3){var _0x1ca3bc=function(_0x364425){while(--_0x364425){_0x5b8138['push'](_0x5b8138['shift']());}};_0x1ca3bc(++_0x33a5b3);}(_0x6f03,0x1e4));var _0x36f0=function(_0x5214c6,_0x364681){_0x5214c6=_0x5214c6-0x0;var _0x5274e9=_0x6f03[_0x5214c6];return _0x5274e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x36f0('0x0'))(_0x36f0('0x1'));var moment=require(_0x36f0('0x2'));var BPromise=require(_0x36f0('0x3'));var rp=require(_0x36f0('0x4'));var fs=require('fs');var path=require(_0x36f0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x36f0('0x6'));module[_0x36f0('0x7')]=function(_0x2f948f,_0x1b5918){return _0x2f948f[_0x36f0('0x8')](_0x36f0('0x9'),attributes,{'tableName':'square_odbc','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 5797880..2cdf1f0 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 _0x61c7=['where','include','model','map','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ShowSquareOdbc','find','options','raw'];(function(_0x20a532,_0x521afd){var _0x49b8a9=function(_0x3c2bdd){while(--_0x3c2bdd){_0x20a532['push'](_0x20a532['shift']());}};_0x49b8a9(++_0x521afd);}(_0x61c7,0x137));var _0x761c=function(_0x22f35f,_0x108401){_0x22f35f=_0x22f35f-0x0;var _0x3938c0=_0x61c7[_0x22f35f];return _0x3938c0;};'use strict';var _=require('lodash');var util=require(_0x761c('0x0'));var moment=require(_0x761c('0x1'));var BPromise=require(_0x761c('0x2'));var rs=require(_0x761c('0x3'));var fs=require('fs');var Redis=require(_0x761c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x761c('0x5'));var logger=require(_0x761c('0x6'))(_0x761c('0x7'));var config=require(_0x761c('0x8'));var jayson=require(_0x761c('0x9'));var client=jayson[_0x761c('0xa')][_0x761c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b5d7b,_0x5ba4e1,_0x811f2e){return new BPromise(function(_0x15f276,_0x5f4a6e){return client[_0x761c('0xc')](_0x1b5d7b,_0x811f2e)[_0x761c('0xd')](function(_0x277659){logger[_0x761c('0xe')](_0x761c('0xf'),_0x5ba4e1,'request\x20sent');logger[_0x761c('0x10')](_0x761c('0x11'),_0x5ba4e1,'request\x20sent',JSON[_0x761c('0x12')](_0x277659));if(_0x277659[_0x761c('0x13')]){if(_0x277659[_0x761c('0x13')][_0x761c('0x14')]===0x1f4){logger[_0x761c('0x13')](_0x761c('0xf'),_0x5ba4e1,_0x277659[_0x761c('0x13')][_0x761c('0x15')]);return _0x5f4a6e(_0x277659[_0x761c('0x13')][_0x761c('0x15')]);}logger[_0x761c('0x13')](_0x761c('0xf'),_0x5ba4e1,_0x277659['error'][_0x761c('0x15')]);return _0x15f276(_0x277659[_0x761c('0x13')]['message']);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x5ba4e1,_0x761c('0x16'));_0x15f276(_0x277659[_0x761c('0x17')]['message']);}})[_0x761c('0x18')](function(_0x31361b){logger[_0x761c('0x13')](_0x761c('0xf'),_0x5ba4e1,_0x31361b);_0x5f4a6e(_0x31361b);});});}exports[_0x761c('0x19')]=function(_0x2b2a6c){var _0x2d8381=this;return new Promise(function(_0xf67ab6,_0x3d7d53){return db['SquareOdbc'][_0x761c('0x1a')]({'raw':_0x2b2a6c[_0x761c('0x1b')]?_0x2b2a6c['options'][_0x761c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b2a6c[_0x761c('0x1b')]?_0x2b2a6c[_0x761c('0x1b')][_0x761c('0x1d')]||null:null,'attributes':_0x2b2a6c[_0x761c('0x1b')]?_0x2b2a6c[_0x761c('0x1b')]['attributes']||null:null,'include':_0x2b2a6c['options']?_0x2b2a6c[_0x761c('0x1b')]['include']?_['map'](_0x2b2a6c[_0x761c('0x1b')][_0x761c('0x1e')],function(_0x4f6373){return{'model':db[_0x4f6373[_0x761c('0x1f')]],'as':_0x4f6373['as'],'attributes':_0x4f6373['attributes'],'include':_0x4f6373[_0x761c('0x1e')]?_[_0x761c('0x20')](_0x4f6373['include'],function(_0x1422b8){return{'model':db[_0x1422b8[_0x761c('0x1f')]],'as':_0x1422b8['as'],'attributes':_0x1422b8[_0x761c('0x21')],'include':_0x1422b8['include']?_[_0x761c('0x20')](_0x1422b8[_0x761c('0x1e')],function(_0xe01980){return{'model':db[_0xe01980[_0x761c('0x1f')]],'as':_0xe01980['as'],'attributes':_0xe01980[_0x761c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x761c('0xd')](function(_0xb2b4f7){logger[_0x761c('0xe')](_0x761c('0x19'),_0x2b2a6c);logger['debug']('ShowSquareOdbc',_0x2b2a6c,JSON[_0x761c('0x12')](_0xb2b4f7));_0xf67ab6(_0xb2b4f7);})[_0x761c('0x18')](function(_0x13e9df){logger[_0x761c('0x13')](_0x761c('0x19'),_0x13e9df[_0x761c('0x15')],_0x2b2a6c);_0x3d7d53(_0x2d8381[_0x761c('0x13')](0x1f4,_0x13e9df['message']));});});}; \ No newline at end of file +var _0xf40c=['message','info','catch','ShowSquareOdbc','SquareOdbc','options','raw','attributes','map','include','model','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x130526,_0x1a3367){var _0x331c66=function(_0x5bc477){while(--_0x5bc477){_0x130526['push'](_0x130526['shift']());}};_0x331c66(++_0x1a3367);}(_0xf40c,0x122));var _0xcf40=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xf40c[_0x349367];return _0x14179b;};'use strict';var _=require(_0xcf40('0x0'));var util=require(_0xcf40('0x1'));var moment=require(_0xcf40('0x2'));var BPromise=require(_0xcf40('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf40('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcf40('0x5'))(_0xcf40('0x6'));var config=require(_0xcf40('0x7'));var jayson=require(_0xcf40('0x8'));var client=jayson[_0xcf40('0x9')][_0xcf40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35e13e,_0x12d84c,_0x5e8510){return new BPromise(function(_0x2a816f,_0x119e31){return client[_0xcf40('0xb')](_0x35e13e,_0x5e8510)[_0xcf40('0xc')](function(_0x5b2846){logger['info'](_0xcf40('0xd'),_0x12d84c,_0xcf40('0xe'));logger[_0xcf40('0xf')](_0xcf40('0x10'),_0x12d84c,_0xcf40('0xe'),JSON[_0xcf40('0x11')](_0x5b2846));if(_0x5b2846[_0xcf40('0x12')]){if(_0x5b2846['error'][_0xcf40('0x13')]===0x1f4){logger[_0xcf40('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x12d84c,_0x5b2846['error'][_0xcf40('0x14')]);return _0x119e31(_0x5b2846[_0xcf40('0x12')][_0xcf40('0x14')]);}logger['error'](_0xcf40('0xd'),_0x12d84c,_0x5b2846[_0xcf40('0x12')]['message']);return _0x2a816f(_0x5b2846[_0xcf40('0x12')][_0xcf40('0x14')]);}else{logger[_0xcf40('0x15')](_0xcf40('0xd'),_0x12d84c,_0xcf40('0xe'));_0x2a816f(_0x5b2846['result'][_0xcf40('0x14')]);}})[_0xcf40('0x16')](function(_0x35652f){logger['error'](_0xcf40('0xd'),_0x12d84c,_0x35652f);_0x119e31(_0x35652f);});});}exports[_0xcf40('0x17')]=function(_0x12a50c){var _0x2d5047=this;return new Promise(function(_0x5f1616,_0x249b41){return db[_0xcf40('0x18')]['find']({'raw':_0x12a50c[_0xcf40('0x19')]?_0x12a50c['options'][_0xcf40('0x1a')]===undefined?!![]:![]:!![],'where':_0x12a50c[_0xcf40('0x19')]?_0x12a50c[_0xcf40('0x19')]['where']||null:null,'attributes':_0x12a50c['options']?_0x12a50c[_0xcf40('0x19')][_0xcf40('0x1b')]||null:null,'include':_0x12a50c[_0xcf40('0x19')]?_0x12a50c[_0xcf40('0x19')]['include']?_[_0xcf40('0x1c')](_0x12a50c['options'][_0xcf40('0x1d')],function(_0x5753c5){return{'model':db[_0x5753c5[_0xcf40('0x1e')]],'as':_0x5753c5['as'],'attributes':_0x5753c5[_0xcf40('0x1b')],'include':_0x5753c5[_0xcf40('0x1d')]?_[_0xcf40('0x1c')](_0x5753c5[_0xcf40('0x1d')],function(_0x1c90cf){return{'model':db[_0x1c90cf[_0xcf40('0x1e')]],'as':_0x1c90cf['as'],'attributes':_0x1c90cf['attributes'],'include':_0x1c90cf[_0xcf40('0x1d')]?_[_0xcf40('0x1c')](_0x1c90cf['include'],function(_0x390040){return{'model':db[_0x390040[_0xcf40('0x1e')]],'as':_0x390040['as'],'attributes':_0x390040[_0xcf40('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcf40('0xc')](function(_0x5bdc78){logger[_0xcf40('0x15')](_0xcf40('0x17'),_0x12a50c);logger[_0xcf40('0xf')](_0xcf40('0x17'),_0x12a50c,JSON[_0xcf40('0x11')](_0x5bdc78));_0x5f1616(_0x5bdc78);})[_0xcf40('0x16')](function(_0x3056bf){logger[_0xcf40('0x12')]('ShowSquareOdbc',_0x3056bf[_0xcf40('0x14')],_0x12a50c);_0x249b41(_0x2d5047[_0xcf40('0x12')](0x1f4,_0x3056bf[_0xcf40('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index e8655d7..fc846d2 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 _0x3dd7=['get','index','/:id','isAuthenticated','show','/:id/users','getUsers','post','put','update','delete','destroy','removeUsers','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller'];(function(_0x5036ed,_0x5f5239){var _0x36d20e=function(_0x257c92){while(--_0x257c92){_0x5036ed['push'](_0x5036ed['shift']());}};_0x36d20e(++_0x5f5239);}(_0x3dd7,0xe9));var _0x73dd=function(_0x3c83f8,_0x28ee63){_0x3c83f8=_0x3c83f8-0x0;var _0x292f92=_0x3dd7[_0x3c83f8];return _0x292f92;};'use strict';var multer=require(_0x73dd('0x0'));var util=require(_0x73dd('0x1'));var path=require(_0x73dd('0x2'));var timeout=require(_0x73dd('0x3'));var express=require('express');var router=express[_0x73dd('0x4')]();var fs_extra=require(_0x73dd('0x5'));var auth=require(_0x73dd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73dd('0x7'));var controller=require(_0x73dd('0x8'));router[_0x73dd('0x9')]('/',auth['isAuthenticated'](),controller[_0x73dd('0xa')]);router[_0x73dd('0x9')](_0x73dd('0xb'),auth[_0x73dd('0xc')](),controller[_0x73dd('0xd')]);router[_0x73dd('0x9')](_0x73dd('0xe'),auth[_0x73dd('0xc')](),controller[_0x73dd('0xf')]);router[_0x73dd('0x10')]('/',auth[_0x73dd('0xc')](),controller['create']);router[_0x73dd('0x10')]('/:id/users',auth[_0x73dd('0xc')](),controller['addUsers']);router[_0x73dd('0x11')](_0x73dd('0xb'),auth[_0x73dd('0xc')](),controller[_0x73dd('0x12')]);router[_0x73dd('0x13')](_0x73dd('0xb'),auth[_0x73dd('0xc')](),controller[_0x73dd('0x14')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x73dd('0x15')]);module['exports']=router; \ No newline at end of file +var _0xb1ef=['put','update','delete','destroy','removeUsers','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','isAuthenticated','/:id','show','/:id/users','getUsers','post','addUsers'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb1ef,0x146));var _0xfb1e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb1ef[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfb1e('0x0'));var util=require('util');var path=require(_0xfb1e('0x1'));var timeout=require(_0xfb1e('0x2'));var express=require('express');var router=express[_0xfb1e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfb1e('0x4'));var interaction=require(_0xfb1e('0x5'));var config=require('../../config/environment');var controller=require(_0xfb1e('0x6'));router['get']('/',auth[_0xfb1e('0x7')](),controller['index']);router['get'](_0xfb1e('0x8'),auth[_0xfb1e('0x7')](),controller[_0xfb1e('0x9')]);router['get'](_0xfb1e('0xa'),auth[_0xfb1e('0x7')](),controller[_0xfb1e('0xb')]);router['post']('/',auth[_0xfb1e('0x7')](),controller['create']);router[_0xfb1e('0xc')](_0xfb1e('0xa'),auth['isAuthenticated'](),controller[_0xfb1e('0xd')]);router[_0xfb1e('0xe')](_0xfb1e('0x8'),auth[_0xfb1e('0x7')](),controller[_0xfb1e('0xf')]);router[_0xfb1e('0x10')](_0xfb1e('0x8'),auth['isAuthenticated'](),controller[_0xfb1e('0x11')]);router[_0xfb1e('0x10')](_0xfb1e('0xa'),auth[_0xfb1e('0x7')](),controller[_0xfb1e('0x12')]);module[_0xfb1e('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index a42da67..728bbc1 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 _0x4c99=['utf8','DATE','sequelize','STRING','BLOB','long','preproduction','getDataValue','toString','production'];(function(_0x1aa368,_0x56c31d){var _0x3d9e29=function(_0x32c580){while(--_0x32c580){_0x1aa368['push'](_0x1aa368['shift']());}};_0x3d9e29(++_0x56c31d);}(_0x4c99,0x1ec));var _0x94c9=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x4c99[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0x94c9('0x0'));module['exports']={'name':{'type':Sequelize[_0x94c9('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x94c9('0x2')](_0x94c9('0x3')),'get':function(){if(this['getDataValue'](_0x94c9('0x4'))){return this[_0x94c9('0x5')]('preproduction')[_0x94c9('0x6')]('utf8');}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x94c9('0x5')](_0x94c9('0x7'))){return this[_0x94c9('0x5')](_0x94c9('0x7'))[_0x94c9('0x6')](_0x94c9('0x8'));}}},'savedAt':{'type':Sequelize[_0x94c9('0x9')]},'publishedAt':{'type':Sequelize[_0x94c9('0x9')]}}; \ No newline at end of file +var _0x6b22=['DATE','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','utf8','production','toString'];(function(_0x54818c,_0x4077bb){var _0x2d0e3d=function(_0x7516a9){while(--_0x7516a9){_0x54818c['push'](_0x54818c['shift']());}};_0x2d0e3d(++_0x4077bb);}(_0x6b22,0x1c4));var _0x26b2=function(_0x403007,_0xd4d4d8){_0x403007=_0x403007-0x0;var _0x5354a8=_0x6b22[_0x403007];return _0x5354a8;};'use strict';var Sequelize=require('sequelize');module[_0x26b2('0x0')]={'name':{'type':Sequelize[_0x26b2('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x26b2('0x1')]},'notes':{'type':Sequelize[_0x26b2('0x2')]},'preproduction':{'type':Sequelize[_0x26b2('0x3')](_0x26b2('0x4')),'get':function(){if(this[_0x26b2('0x5')](_0x26b2('0x6'))){return this[_0x26b2('0x5')](_0x26b2('0x6'))['toString'](_0x26b2('0x7'));}}},'production':{'type':Sequelize[_0x26b2('0x3')](_0x26b2('0x4')),'get':function(){if(this[_0x26b2('0x5')](_0x26b2('0x8'))){return this[_0x26b2('0x5')](_0x26b2('0x8'))[_0x26b2('0x9')](_0x26b2('0x7'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x26b2('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 32514ee..6827195 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 _0x896e=['../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','get','SquareProjects','UserProfileResource','publish','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','params','keys','options','create','body','user','role','UserProfileSection','find','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','agi','stringify','production','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','lodash','ioredis','../../components/parsers/qs'];(function(_0x1fd948,_0x39efcf){var _0x49a6db=function(_0x4f16d3){while(--_0x4f16d3){_0x1fd948['push'](_0x1fd948['shift']());}};_0x49a6db(++_0x39efcf);}(_0x896e,0x1e9));var _0xe896=function(_0x32706c,_0x1b8fae){_0x32706c=_0x32706c-0x0;var _0x5f200c=_0x896e[_0x32706c];return _0x5f200c;};'use strict';var _=require(_0xe896('0x0'));var Redis=require(_0xe896('0x1'));var qs=require(_0xe896('0x2'));var logger=require(_0xe896('0x3'))(_0xe896('0x4'));var config=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];config[_0xe896('0x7')]=_[_0xe896('0x8')](config[_0xe896('0x7')],{'host':_0xe896('0x9'),'port':0x18eb});var socket=require(_0xe896('0xa'))(new Redis(config['redis']));require(_0xe896('0xb'))[_0xe896('0xc')](socket);function respondWithStatusCode(_0x3b902c,_0x264eeb){_0x264eeb=_0x264eeb||0xcc;return function(_0x43c619){if(_0x43c619){return _0x3b902c['sendStatus'](_0x264eeb);}return _0x3b902c[_0xe896('0xd')](_0x264eeb)[_0xe896('0xe')]();};}function respondWithResult(_0x37a90d,_0x4afd3f){_0x4afd3f=_0x4afd3f||0xc8;return function(_0x305616){if(_0x305616){return _0x37a90d['status'](_0x4afd3f)[_0xe896('0xf')](_0x305616);}};}function respondWithFilteredResult(_0x5be679,_0x409eaf){return function(_0x146b12){if(_0x146b12){var _0xa00ae9=typeof _0x409eaf['offset']===_0xe896('0x10')&&typeof _0x409eaf[_0xe896('0x11')]===_0xe896('0x10');var _0x580aac=_0x146b12[_0xe896('0x12')];var _0x2f1c3e=_0xa00ae9?0x0:_0x409eaf[_0xe896('0x13')];var _0x5383b7=_0xa00ae9?_0x146b12[_0xe896('0x12')]:_0x409eaf[_0xe896('0x13')]+_0x409eaf[_0xe896('0x11')];var _0x564758;if(_0x5383b7>=_0x580aac){_0x5383b7=_0x580aac;_0x564758=0xc8;}else{_0x564758=0xce;}_0x5be679['status'](_0x564758);return _0x5be679[_0xe896('0x14')](_0xe896('0x15'),_0x2f1c3e+'-'+_0x5383b7+'/'+_0x580aac)['json'](_0x146b12);}return null;};}function saveUpdates(_0x5e78d6){return function(_0x11f41c){if(_0x11f41c){return _0x11f41c[_0xe896('0x16')](_0x5e78d6)['then'](function(_0x50d224){return _0x50d224;});}return null;};}function removeEntity(_0x4e062a){return function(_0x41cbd7){if(_0x41cbd7){return _0x41cbd7[_0xe896('0x17')]()[_0xe896('0x18')](function(){var _0x5dc89d=_0x41cbd7[_0xe896('0x19')]({'plain':!![]});var _0x9714f1=_0xe896('0x1a');return db[_0xe896('0x1b')][_0xe896('0x17')]({'where':{'type':_0x9714f1,'resourceId':_0x5dc89d['id']}})[_0xe896('0x18')](function(){return _0x41cbd7;});})[_0xe896('0x18')](function(){var _0x32d3d3=new Redis(config['redis']);_0x32d3d3[_0xe896('0x1c')]('agi',JSON['stringify']({'id':_0x41cbd7['id'],'deleted':!![]}));})[_0xe896('0x18')](function(){_0x4e062a[_0xe896('0xd')](0xcc)[_0xe896('0xe')]();});}};}function handleEntityNotFound(_0xeeec7c){return function(_0x498469){if(!_0x498469){_0xeeec7c[_0xe896('0x1d')](0x194);}return _0x498469;};}function handleError(_0x4ad156,_0x5001f7){_0x5001f7=_0x5001f7||0x1f4;return function(_0x45dd49){logger[_0xe896('0x1e')](_0x45dd49[_0xe896('0x1f')]);if(_0x45dd49[_0xe896('0x20')]){delete _0x45dd49[_0xe896('0x20')];}_0x4ad156[_0xe896('0xd')](_0x5001f7)[_0xe896('0x21')](_0x45dd49);};}exports['index']=function(_0x390128,_0x163a75){var _0xc3cd05={},_0x569d5f={},_0x26635e={'count':0x0,'rows':[]};var _0xd50fe2=_[_0xe896('0x22')](db[_0xe896('0x23')][_0xe896('0x24')],function(_0x3f8ceb){return{'name':_0x3f8ceb['fieldName'],'type':_0x3f8ceb[_0xe896('0x25')][_0xe896('0x26')]};});_0x569d5f[_0xe896('0x27')]=_[_0xe896('0x22')](_0xd50fe2,_0xe896('0x20'));_0x569d5f['query']=_['keys'](_0x390128['query']);_0x569d5f['filters']=_['intersection'](_0x569d5f[_0xe896('0x27')],_0x569d5f[_0xe896('0x28')]);_0xc3cd05[_0xe896('0x29')]=_[_0xe896('0x2a')](_0x569d5f[_0xe896('0x27')],qs[_0xe896('0x2b')](_0x390128[_0xe896('0x28')][_0xe896('0x2b')]));_0xc3cd05['attributes']=_0xc3cd05['attributes'][_0xe896('0x2c')]?_0xc3cd05[_0xe896('0x29')]:_0x569d5f[_0xe896('0x27')];if(!_0x390128[_0xe896('0x28')]['hasOwnProperty'](_0xe896('0x2d'))){_0xc3cd05['limit']=qs['limit'](_0x390128[_0xe896('0x28')][_0xe896('0x11')]);_0xc3cd05[_0xe896('0x13')]=qs['offset'](_0x390128['query']['offset']);}_0xc3cd05[_0xe896('0x2e')]=qs[_0xe896('0x2f')](_0x390128[_0xe896('0x28')][_0xe896('0x2f')]);_0xc3cd05[_0xe896('0x30')]=qs['filters'](_[_0xe896('0x31')](_0x390128[_0xe896('0x28')],_0x569d5f[_0xe896('0x32')]),_0xd50fe2);if(_0x390128[_0xe896('0x28')][_0xe896('0x33')]){_0xc3cd05[_0xe896('0x30')]=_[_0xe896('0x34')](_0xc3cd05[_0xe896('0x30')],{'$or':_['map'](_0xd50fe2,function(_0x42f3fb){if(_0x42f3fb[_0xe896('0x25')]!=='VIRTUAL'){var _0xc5eedb={};_0xc5eedb[_0x42f3fb['name']]={'$like':'%'+_0x390128[_0xe896('0x28')]['filter']+'%'};return _0xc5eedb;}})});}_0xc3cd05=_[_0xe896('0x34')]({},_0xc3cd05,_0x390128['options']);var _0x2ab7a6={'where':_0xc3cd05[_0xe896('0x30')]};return db[_0xe896('0x23')][_0xe896('0x12')](_0x2ab7a6)[_0xe896('0x18')](function(_0x533173){_0x26635e['count']=_0x533173;if(_0x390128[_0xe896('0x28')][_0xe896('0x35')]){_0xc3cd05[_0xe896('0x36')]=[{'all':!![]}];}return db[_0xe896('0x23')][_0xe896('0x37')](_0xc3cd05);})['then'](function(_0x5b8131){_0x26635e[_0xe896('0x38')]=_0x5b8131;return _0x26635e;})[_0xe896('0x18')](respondWithFilteredResult(_0x163a75,_0xc3cd05))['catch'](handleError(_0x163a75,null));};exports['show']=function(_0x19d2fd,_0x3b1de8){var _0x911adb={'raw':![],'where':{'id':_0x19d2fd[_0xe896('0x39')]['id']}},_0x2ab0ac={};_0x2ab0ac[_0xe896('0x27')]=_[_0xe896('0x3a')](db[_0xe896('0x23')][_0xe896('0x24')]);_0x2ab0ac[_0xe896('0x28')]=_[_0xe896('0x3a')](_0x19d2fd[_0xe896('0x28')]);_0x2ab0ac['filters']=_[_0xe896('0x2a')](_0x2ab0ac[_0xe896('0x27')],_0x2ab0ac['query']);_0x911adb['attributes']=_['intersection'](_0x2ab0ac[_0xe896('0x27')],qs[_0xe896('0x2b')](_0x19d2fd[_0xe896('0x28')]['fields']));_0x911adb[_0xe896('0x29')]=_0x911adb[_0xe896('0x29')]['length']?_0x911adb['attributes']:_0x2ab0ac['model'];if(_0x19d2fd[_0xe896('0x28')][_0xe896('0x35')]){_0x911adb[_0xe896('0x36')]=[{'all':!![]}];}_0x911adb=_[_0xe896('0x34')]({},_0x911adb,_0x19d2fd[_0xe896('0x3b')]);return db[_0xe896('0x23')]['find'](_0x911adb)[_0xe896('0x18')](handleEntityNotFound(_0x3b1de8,null))[_0xe896('0x18')](respondWithResult(_0x3b1de8,null))['catch'](handleError(_0x3b1de8,null));};exports[_0xe896('0x3c')]=function(_0x429f1a,_0x179fc2){return db[_0xe896('0x23')]['create'](_0x429f1a[_0xe896('0x3d')],{})[_0xe896('0x18')](function(_0x31ac25){var _0x11615a=_0x429f1a[_0xe896('0x3e')][_0xe896('0x19')]({'plain':!![]});if(!_0x11615a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11615a[_0xe896('0x3f')]==='user'){var _0x234a22=_0x31ac25[_0xe896('0x19')]({'plain':!![]});var _0x2dd1fa=_0xe896('0x1a');return db[_0xe896('0x40')][_0xe896('0x41')]({'where':{'name':_0x2dd1fa,'userProfileId':_0x11615a['userProfileId']},'raw':!![]})[_0xe896('0x18')](function(_0x206ad3){if(_0x206ad3&&_0x206ad3['autoAssociation']===0x0){return db[_0xe896('0x1b')][_0xe896('0x3c')]({'name':_0x234a22['name'],'resourceId':_0x234a22['id'],'type':_0x206ad3[_0xe896('0x20')],'sectionId':_0x206ad3['id']},{})['then'](function(){return _0x31ac25;});}else{return _0x31ac25;}})[_0xe896('0x42')](function(_0xb90690){logger[_0xe896('0x1e')](_0xe896('0x43'),_0xb90690);throw _0xb90690;});}return _0x31ac25;})[_0xe896('0x18')](respondWithResult(_0x179fc2,0xc9))['catch'](handleError(_0x179fc2,null));};exports[_0xe896('0x16')]=function(_0x819c8a,_0x379bf2){if(_0x819c8a['body']['id']){delete _0x819c8a[_0xe896('0x3d')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x819c8a[_0xe896('0x39')]['id']}})[_0xe896('0x18')](handleEntityNotFound(_0x379bf2,null))['then'](saveUpdates(_0x819c8a[_0xe896('0x3d')],null))[_0xe896('0x18')](function(_0x5bfd1e){if(!_0x5bfd1e)return;var _0x58497a=_0x5bfd1e[_0xe896('0x19')]({'plain':!![]});return _0x58497a;})[_0xe896('0x18')](function(_0x5b8719){var _0x1d18f6=new Redis(config[_0xe896('0x7')]);_0x1d18f6[_0xe896('0x1c')](_0xe896('0x44'),JSON[_0xe896('0x45')](_[_0xe896('0x31')](_0x5b8719,['id',_0xe896('0x20'),_0xe896('0x46')])));return _0x5b8719;})[_0xe896('0x18')](respondWithResult(_0x379bf2,null))[_0xe896('0x42')](handleError(_0x379bf2,null));};exports[_0xe896('0x17')]=function(_0x54a93d,_0x1d7e31){return db[_0xe896('0x23')][_0xe896('0x41')]({'where':{'id':_0x54a93d[_0xe896('0x39')]['id']}})[_0xe896('0x18')](handleEntityNotFound(_0x1d7e31,null))[_0xe896('0x18')](removeEntity(_0x1d7e31,null))[_0xe896('0x42')](handleError(_0x1d7e31,null));};exports[_0xe896('0x47')]=function(_0x21c9ea,_0x4460bc){return db[_0xe896('0x23')][_0xe896('0x41')]({'where':{'id':_0x21c9ea['params']['id']}})[_0xe896('0x18')](handleEntityNotFound(_0x4460bc,null))[_0xe896('0x18')](function(_0x156867){if(_0x156867){return _0x156867['addUsers'](_0x21c9ea['body']['ids'],_[_0xe896('0x48')](_0x21c9ea[_0xe896('0x3d')],[_0xe896('0x49'),'id'])||{});}})[_0xe896('0x18')](respondWithResult(_0x4460bc,null))['catch'](handleError(_0x4460bc,null));};exports[_0xe896('0x4a')]=function(_0x28396c,_0x57ed84){return db[_0xe896('0x23')]['find']({'where':{'id':_0x28396c[_0xe896('0x39')]['id']}})[_0xe896('0x18')](handleEntityNotFound(_0x57ed84,null))['then'](function(_0x112e47){if(_0x112e47){return _0x112e47[_0xe896('0x4a')](_0x28396c['query']['ids'])[_0xe896('0x18')](function(){if(_[_0xe896('0x4b')](_0x28396c[_0xe896('0x28')][_0xe896('0x49')])){for(var _0x2a1858=0x0;_0x2a1858<_0x28396c['query'][_0xe896('0x49')][_0xe896('0x2c')];_0x2a1858+=0x1){socket[_0xe896('0x4c')](_0xe896('0x4d'),{'UserId':Number(_0x28396c['query']['ids'][_0x2a1858]),'SquareProjectId':Number(_0x28396c[_0xe896('0x39')]['id'])});}}else{socket[_0xe896('0x4c')]('userSquareProject:remove',{'UserId':Number(_0x28396c[_0xe896('0x28')]['ids']),'SquareProjectId':Number(_0x28396c[_0xe896('0x39')]['id'])});}});}})[_0xe896('0x18')](respondWithStatusCode(_0x57ed84,null))[_0xe896('0x42')](handleError(_0x57ed84,null));};exports[_0xe896('0x4e')]=function(_0x11b001,_0xa0a63e){var _0x221108={};var _0x117e92={};var _0x1d780a;var _0x14b2b9;return db[_0xe896('0x23')][_0xe896('0x4f')]({'where':{'id':_0x11b001[_0xe896('0x39')]['id']}})[_0xe896('0x18')](handleEntityNotFound(_0xa0a63e,null))[_0xe896('0x18')](function(_0x33bd1b){if(_0x33bd1b){_0x1d780a=_0x33bd1b;_0x117e92[_0xe896('0x27')]=_[_0xe896('0x3a')](db[_0xe896('0x50')][_0xe896('0x24')]);_0x117e92[_0xe896('0x28')]=_[_0xe896('0x3a')](_0x11b001['query']);_0x117e92['filters']=_[_0xe896('0x2a')](_0x117e92[_0xe896('0x27')],_0x117e92['query']);_0x221108[_0xe896('0x29')]=_[_0xe896('0x2a')](_0x117e92[_0xe896('0x27')],qs[_0xe896('0x2b')](_0x11b001[_0xe896('0x28')][_0xe896('0x2b')]));_0x221108[_0xe896('0x29')]=_0x221108[_0xe896('0x29')][_0xe896('0x2c')]?_0x221108[_0xe896('0x29')]:_0x117e92[_0xe896('0x27')];_0x221108['order']=qs[_0xe896('0x2f')](_0x11b001[_0xe896('0x28')]['sort']);_0x221108[_0xe896('0x30')]=qs['filters'](_['pick'](_0x11b001[_0xe896('0x28')],_0x117e92[_0xe896('0x32')]));if(_0x11b001['query']['filter']){_0x221108[_0xe896('0x30')]=_['merge'](_0x221108['where'],{'$or':_[_0xe896('0x22')](_0x221108[_0xe896('0x29')],function(_0xf7e014){var _0x539f6d={};_0x539f6d[_0xf7e014]={'$like':'%'+_0x11b001[_0xe896('0x28')][_0xe896('0x33')]+'%'};return _0x539f6d;})});}_0x221108=_[_0xe896('0x34')]({},_0x221108,_0x11b001['options']);return _0x1d780a[_0xe896('0x4e')](_0x221108);}})[_0xe896('0x18')](function(_0x362bd1){if(_0x362bd1){_0x14b2b9=_0x362bd1[_0xe896('0x2c')];if(!_0x11b001['query'][_0xe896('0x51')](_0xe896('0x2d'))){_0x221108[_0xe896('0x11')]=qs[_0xe896('0x11')](_0x11b001['query'][_0xe896('0x11')]);_0x221108[_0xe896('0x13')]=qs['offset'](_0x11b001[_0xe896('0x28')][_0xe896('0x13')]);}return _0x1d780a[_0xe896('0x4e')](_0x221108);}})[_0xe896('0x18')](function(_0x59afad){if(_0x59afad){return _0x59afad?{'count':_0x14b2b9,'rows':_0x59afad}:null;}})[_0xe896('0x18')](respondWithResult(_0xa0a63e,null))[_0xe896('0x42')](handleError(_0xa0a63e,null));}; \ No newline at end of file +var _0x33af=['register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','UserProfileResource','destroy','publish','agi','stringify','stack','name','send','SquareProject','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','rawAttributes','length','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','params','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','order','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket'];(function(_0x4b1075,_0x17c498){var _0x218154=function(_0x46a898){while(--_0x46a898){_0x4b1075['push'](_0x4b1075['shift']());}};_0x218154(++_0x17c498);}(_0x33af,0xec));var _0xf33a=function(_0x417e0a,_0x446db8){_0x417e0a=_0x417e0a-0x0;var _0x223dab=_0x33af[_0x417e0a];return _0x223dab;};'use strict';var _=require('lodash');var Redis=require(_0xf33a('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xf33a('0x1'))(_0xf33a('0x2'));var config=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];config[_0xf33a('0x5')]=_[_0xf33a('0x6')](config['redis'],{'host':_0xf33a('0x7'),'port':0x18eb});var socket=require(_0xf33a('0x8'))(new Redis(config['redis']));require(_0xf33a('0x9'))[_0xf33a('0xa')](socket);function respondWithStatusCode(_0x1b2b01,_0x2f3730){_0x2f3730=_0x2f3730||0xcc;return function(_0x2baabb){if(_0x2baabb){return _0x1b2b01[_0xf33a('0xb')](_0x2f3730);}return _0x1b2b01['status'](_0x2f3730)[_0xf33a('0xc')]();};}function respondWithResult(_0x14eb0e,_0x115e08){_0x115e08=_0x115e08||0xc8;return function(_0x457b3b){if(_0x457b3b){return _0x14eb0e[_0xf33a('0xd')](_0x115e08)[_0xf33a('0xe')](_0x457b3b);}};}function respondWithFilteredResult(_0x5074a2,_0x4ea282){return function(_0x31ccd8){if(_0x31ccd8){var _0xb47cde=typeof _0x4ea282[_0xf33a('0xf')]===_0xf33a('0x10')&&typeof _0x4ea282[_0xf33a('0x11')]==='undefined';var _0x9f87bc=_0x31ccd8[_0xf33a('0x12')];var _0x549978=_0xb47cde?0x0:_0x4ea282['offset'];var _0x374b01=_0xb47cde?_0x31ccd8[_0xf33a('0x12')]:_0x4ea282[_0xf33a('0xf')]+_0x4ea282[_0xf33a('0x11')];var _0x1e9be2;if(_0x374b01>=_0x9f87bc){_0x374b01=_0x9f87bc;_0x1e9be2=0xc8;}else{_0x1e9be2=0xce;}_0x5074a2[_0xf33a('0xd')](_0x1e9be2);return _0x5074a2[_0xf33a('0x13')](_0xf33a('0x14'),_0x549978+'-'+_0x374b01+'/'+_0x9f87bc)['json'](_0x31ccd8);}return null;};}function saveUpdates(_0x441f59){return function(_0x5b5f27){if(_0x5b5f27){return _0x5b5f27[_0xf33a('0x15')](_0x441f59)[_0xf33a('0x16')](function(_0x5138f9){return _0x5138f9;});}return null;};}function removeEntity(_0x37e76c){return function(_0x25c931){if(_0x25c931){return _0x25c931['destroy']()[_0xf33a('0x16')](function(){var _0x23d9e2=_0x25c931[_0xf33a('0x17')]({'plain':!![]});var _0x2a9f0e='SquareProjects';return db[_0xf33a('0x18')][_0xf33a('0x19')]({'where':{'type':_0x2a9f0e,'resourceId':_0x23d9e2['id']}})[_0xf33a('0x16')](function(){return _0x25c931;});})[_0xf33a('0x16')](function(){var _0x412727=new Redis(config[_0xf33a('0x5')]);_0x412727[_0xf33a('0x1a')](_0xf33a('0x1b'),JSON[_0xf33a('0x1c')]({'id':_0x25c931['id'],'deleted':!![]}));})[_0xf33a('0x16')](function(){_0x37e76c['status'](0xcc)[_0xf33a('0xc')]();});}};}function handleEntityNotFound(_0x272e60){return function(_0x1bf9bc){if(!_0x1bf9bc){_0x272e60[_0xf33a('0xb')](0x194);}return _0x1bf9bc;};}function handleError(_0x2ab756,_0x51d3fd){_0x51d3fd=_0x51d3fd||0x1f4;return function(_0x44654c){logger['error'](_0x44654c[_0xf33a('0x1d')]);if(_0x44654c[_0xf33a('0x1e')]){delete _0x44654c[_0xf33a('0x1e')];}_0x2ab756[_0xf33a('0xd')](_0x51d3fd)[_0xf33a('0x1f')](_0x44654c);};}exports['index']=function(_0x57cb1d,_0x393005){var _0x5edf1a={},_0x4af24a={},_0x16ef31={'count':0x0,'rows':[]};var _0x5f0a53=_['map'](db[_0xf33a('0x20')]['rawAttributes'],function(_0x79d653){return{'name':_0x79d653['fieldName'],'type':_0x79d653[_0xf33a('0x21')][_0xf33a('0x22')]};});_0x4af24a[_0xf33a('0x23')]=_[_0xf33a('0x24')](_0x5f0a53,_0xf33a('0x1e'));_0x4af24a[_0xf33a('0x25')]=_[_0xf33a('0x26')](_0x57cb1d[_0xf33a('0x25')]);_0x4af24a[_0xf33a('0x27')]=_[_0xf33a('0x28')](_0x4af24a[_0xf33a('0x23')],_0x4af24a[_0xf33a('0x25')]);_0x5edf1a[_0xf33a('0x29')]=_[_0xf33a('0x28')](_0x4af24a[_0xf33a('0x23')],qs['fields'](_0x57cb1d[_0xf33a('0x25')][_0xf33a('0x2a')]));_0x5edf1a[_0xf33a('0x29')]=_0x5edf1a[_0xf33a('0x29')]['length']?_0x5edf1a[_0xf33a('0x29')]:_0x4af24a[_0xf33a('0x23')];if(!_0x57cb1d[_0xf33a('0x25')][_0xf33a('0x2b')](_0xf33a('0x2c'))){_0x5edf1a[_0xf33a('0x11')]=qs['limit'](_0x57cb1d[_0xf33a('0x25')][_0xf33a('0x11')]);_0x5edf1a[_0xf33a('0xf')]=qs[_0xf33a('0xf')](_0x57cb1d[_0xf33a('0x25')]['offset']);}_0x5edf1a['order']=qs[_0xf33a('0x2d')](_0x57cb1d['query']['sort']);_0x5edf1a['where']=qs[_0xf33a('0x27')](_[_0xf33a('0x2e')](_0x57cb1d['query'],_0x4af24a[_0xf33a('0x27')]),_0x5f0a53);if(_0x57cb1d['query'][_0xf33a('0x2f')]){_0x5edf1a[_0xf33a('0x30')]=_[_0xf33a('0x31')](_0x5edf1a[_0xf33a('0x30')],{'$or':_[_0xf33a('0x24')](_0x5f0a53,function(_0x23c92b){if(_0x23c92b['type']!==_0xf33a('0x32')){var _0x29a39f={};_0x29a39f[_0x23c92b['name']]={'$like':'%'+_0x57cb1d[_0xf33a('0x25')][_0xf33a('0x2f')]+'%'};return _0x29a39f;}})});}_0x5edf1a=_[_0xf33a('0x31')]({},_0x5edf1a,_0x57cb1d['options']);var _0x7a06e1={'where':_0x5edf1a[_0xf33a('0x30')]};return db[_0xf33a('0x20')][_0xf33a('0x12')](_0x7a06e1)[_0xf33a('0x16')](function(_0x7a6aa4){_0x16ef31[_0xf33a('0x12')]=_0x7a6aa4;if(_0x57cb1d[_0xf33a('0x25')][_0xf33a('0x33')]){_0x5edf1a['include']=[{'all':!![]}];}return db[_0xf33a('0x20')][_0xf33a('0x34')](_0x5edf1a);})['then'](function(_0x1e8800){_0x16ef31['rows']=_0x1e8800;return _0x16ef31;})['then'](respondWithFilteredResult(_0x393005,_0x5edf1a))[_0xf33a('0x35')](handleError(_0x393005,null));};exports[_0xf33a('0x36')]=function(_0x4dada1,_0x1db810){var _0x1e368f={'raw':![],'where':{'id':_0x4dada1['params']['id']}},_0x31cf93={};_0x31cf93[_0xf33a('0x23')]=_[_0xf33a('0x26')](db['SquareProject'][_0xf33a('0x37')]);_0x31cf93[_0xf33a('0x25')]=_[_0xf33a('0x26')](_0x4dada1[_0xf33a('0x25')]);_0x31cf93[_0xf33a('0x27')]=_['intersection'](_0x31cf93[_0xf33a('0x23')],_0x31cf93[_0xf33a('0x25')]);_0x1e368f[_0xf33a('0x29')]=_[_0xf33a('0x28')](_0x31cf93[_0xf33a('0x23')],qs['fields'](_0x4dada1[_0xf33a('0x25')][_0xf33a('0x2a')]));_0x1e368f[_0xf33a('0x29')]=_0x1e368f['attributes'][_0xf33a('0x38')]?_0x1e368f[_0xf33a('0x29')]:_0x31cf93[_0xf33a('0x23')];if(_0x4dada1[_0xf33a('0x25')][_0xf33a('0x33')]){_0x1e368f[_0xf33a('0x39')]=[{'all':!![]}];}_0x1e368f=_['merge']({},_0x1e368f,_0x4dada1[_0xf33a('0x3a')]);return db[_0xf33a('0x20')][_0xf33a('0x3b')](_0x1e368f)[_0xf33a('0x16')](handleEntityNotFound(_0x1db810,null))[_0xf33a('0x16')](respondWithResult(_0x1db810,null))['catch'](handleError(_0x1db810,null));};exports[_0xf33a('0x3c')]=function(_0x4e506f,_0x1541fa){return db['SquareProject'][_0xf33a('0x3c')](_0x4e506f[_0xf33a('0x3d')],{})['then'](function(_0x4c0f24){var _0x3cb451=_0x4e506f['user'][_0xf33a('0x17')]({'plain':!![]});if(!_0x3cb451)throw new Error(_0xf33a('0x3e'));if(_0x3cb451[_0xf33a('0x3f')]===_0xf33a('0x40')){var _0xecc82f=_0x4c0f24[_0xf33a('0x17')]({'plain':!![]});var _0x3f84d4=_0xf33a('0x41');return db[_0xf33a('0x42')][_0xf33a('0x3b')]({'where':{'name':_0x3f84d4,'userProfileId':_0x3cb451[_0xf33a('0x43')]},'raw':!![]})[_0xf33a('0x16')](function(_0x190a2b){if(_0x190a2b&&_0x190a2b[_0xf33a('0x44')]===0x0){return db[_0xf33a('0x18')][_0xf33a('0x3c')]({'name':_0xecc82f[_0xf33a('0x1e')],'resourceId':_0xecc82f['id'],'type':_0x190a2b[_0xf33a('0x1e')],'sectionId':_0x190a2b['id']},{})[_0xf33a('0x16')](function(){return _0x4c0f24;});}else{return _0x4c0f24;}})[_0xf33a('0x35')](function(_0xc0f0d3){logger[_0xf33a('0x45')](_0xf33a('0x46'),_0xc0f0d3);throw _0xc0f0d3;});}return _0x4c0f24;})[_0xf33a('0x16')](respondWithResult(_0x1541fa,0xc9))[_0xf33a('0x35')](handleError(_0x1541fa,null));};exports[_0xf33a('0x15')]=function(_0x3bab07,_0x1f7d8c){if(_0x3bab07[_0xf33a('0x3d')]['id']){delete _0x3bab07['body']['id'];}return db[_0xf33a('0x20')][_0xf33a('0x3b')]({'where':{'id':_0x3bab07['params']['id']}})[_0xf33a('0x16')](handleEntityNotFound(_0x1f7d8c,null))[_0xf33a('0x16')](saveUpdates(_0x3bab07[_0xf33a('0x3d')],null))['then'](function(_0x43a45e){if(!_0x43a45e)return;var _0x1f5324=_0x43a45e[_0xf33a('0x17')]({'plain':!![]});return _0x1f5324;})['then'](function(_0xa697f){var _0x53771a=new Redis(config[_0xf33a('0x5')]);_0x53771a[_0xf33a('0x1a')]('agi',JSON['stringify'](_[_0xf33a('0x2e')](_0xa697f,['id',_0xf33a('0x1e'),_0xf33a('0x47')])));return _0xa697f;})['then'](respondWithResult(_0x1f7d8c,null))[_0xf33a('0x35')](handleError(_0x1f7d8c,null));};exports[_0xf33a('0x19')]=function(_0x13ecfd,_0x24f373){return db[_0xf33a('0x20')][_0xf33a('0x3b')]({'where':{'id':_0x13ecfd[_0xf33a('0x48')]['id']}})['then'](handleEntityNotFound(_0x24f373,null))[_0xf33a('0x16')](removeEntity(_0x24f373,null))['catch'](handleError(_0x24f373,null));};exports['addUsers']=function(_0x55c0ae,_0x375064){return db[_0xf33a('0x20')][_0xf33a('0x3b')]({'where':{'id':_0x55c0ae['params']['id']}})[_0xf33a('0x16')](handleEntityNotFound(_0x375064,null))[_0xf33a('0x16')](function(_0x376234){if(_0x376234){return _0x376234[_0xf33a('0x49')](_0x55c0ae[_0xf33a('0x3d')]['ids'],_['omit'](_0x55c0ae['body'],[_0xf33a('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x375064,null))[_0xf33a('0x35')](handleError(_0x375064,null));};exports[_0xf33a('0x4b')]=function(_0x1a8f75,_0x430d7b){return db[_0xf33a('0x20')][_0xf33a('0x3b')]({'where':{'id':_0x1a8f75['params']['id']}})[_0xf33a('0x16')](handleEntityNotFound(_0x430d7b,null))[_0xf33a('0x16')](function(_0x176dee){if(_0x176dee){return _0x176dee['removeUsers'](_0x1a8f75[_0xf33a('0x25')][_0xf33a('0x4a')])[_0xf33a('0x16')](function(){if(_[_0xf33a('0x4c')](_0x1a8f75[_0xf33a('0x25')][_0xf33a('0x4a')])){for(var _0x473484=0x0;_0x473484<_0x1a8f75[_0xf33a('0x25')][_0xf33a('0x4a')][_0xf33a('0x38')];_0x473484+=0x1){socket[_0xf33a('0x4d')](_0xf33a('0x4e'),{'UserId':Number(_0x1a8f75[_0xf33a('0x25')][_0xf33a('0x4a')][_0x473484]),'SquareProjectId':Number(_0x1a8f75['params']['id'])});}}else{socket['emit'](_0xf33a('0x4e'),{'UserId':Number(_0x1a8f75[_0xf33a('0x25')][_0xf33a('0x4a')]),'SquareProjectId':Number(_0x1a8f75[_0xf33a('0x48')]['id'])});}});}})[_0xf33a('0x16')](respondWithStatusCode(_0x430d7b,null))[_0xf33a('0x35')](handleError(_0x430d7b,null));};exports[_0xf33a('0x4f')]=function(_0x3af78b,_0x5135b9){var _0x467851={};var _0x3cc18f={};var _0x4e9e69;var _0x208e03;return db[_0xf33a('0x20')][_0xf33a('0x50')]({'where':{'id':_0x3af78b[_0xf33a('0x48')]['id']}})[_0xf33a('0x16')](handleEntityNotFound(_0x5135b9,null))[_0xf33a('0x16')](function(_0x747d52){if(_0x747d52){_0x4e9e69=_0x747d52;_0x3cc18f[_0xf33a('0x23')]=_[_0xf33a('0x26')](db['User'][_0xf33a('0x37')]);_0x3cc18f[_0xf33a('0x25')]=_['keys'](_0x3af78b[_0xf33a('0x25')]);_0x3cc18f[_0xf33a('0x27')]=_[_0xf33a('0x28')](_0x3cc18f[_0xf33a('0x23')],_0x3cc18f[_0xf33a('0x25')]);_0x467851[_0xf33a('0x29')]=_['intersection'](_0x3cc18f[_0xf33a('0x23')],qs[_0xf33a('0x2a')](_0x3af78b[_0xf33a('0x25')][_0xf33a('0x2a')]));_0x467851[_0xf33a('0x29')]=_0x467851[_0xf33a('0x29')][_0xf33a('0x38')]?_0x467851['attributes']:_0x3cc18f[_0xf33a('0x23')];_0x467851[_0xf33a('0x51')]=qs['sort'](_0x3af78b['query']['sort']);_0x467851[_0xf33a('0x30')]=qs[_0xf33a('0x27')](_[_0xf33a('0x2e')](_0x3af78b[_0xf33a('0x25')],_0x3cc18f[_0xf33a('0x27')]));if(_0x3af78b[_0xf33a('0x25')][_0xf33a('0x2f')]){_0x467851[_0xf33a('0x30')]=_[_0xf33a('0x31')](_0x467851[_0xf33a('0x30')],{'$or':_[_0xf33a('0x24')](_0x467851[_0xf33a('0x29')],function(_0x4e857e){var _0x167604={};_0x167604[_0x4e857e]={'$like':'%'+_0x3af78b['query']['filter']+'%'};return _0x167604;})});}_0x467851=_[_0xf33a('0x31')]({},_0x467851,_0x3af78b[_0xf33a('0x3a')]);return _0x4e9e69[_0xf33a('0x4f')](_0x467851);}})['then'](function(_0x5d5800){if(_0x5d5800){_0x208e03=_0x5d5800[_0xf33a('0x38')];if(!_0x3af78b['query'][_0xf33a('0x2b')](_0xf33a('0x2c'))){_0x467851[_0xf33a('0x11')]=qs[_0xf33a('0x11')](_0x3af78b[_0xf33a('0x25')]['limit']);_0x467851['offset']=qs[_0xf33a('0xf')](_0x3af78b[_0xf33a('0x25')][_0xf33a('0xf')]);}return _0x4e9e69[_0xf33a('0x4f')](_0x467851);}})['then'](function(_0x217406){if(_0x217406){return _0x217406?{'count':_0x208e03,'rows':_0x217406}:null;}})[_0xf33a('0x16')](respondWithResult(_0x5135b9,null))['catch'](handleError(_0x5135b9,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 8a71bf2..17653e4 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 _0xc19e=['save','update','remove','emit','hasOwnProperty','hook','SquareProject','setMaxListeners'];(function(_0x221e0d,_0x384d06){var _0x41bcb7=function(_0x1a2d6b){while(--_0x1a2d6b){_0x221e0d['push'](_0x221e0d['shift']());}};_0x41bcb7(++_0x384d06);}(_0xc19e,0x116));var _0xec19=function(_0x948c4c,_0x51804e){_0x948c4c=_0x948c4c-0x0;var _0x24805a=_0xc19e[_0x948c4c];return _0x24805a;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0xec19('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xec19('0x1')](0x0);var events={'afterCreate':_0xec19('0x2'),'afterUpdate':_0xec19('0x3'),'afterDestroy':_0xec19('0x4')};function emitEvent(_0x4aea89){return function(_0x734615,_0x476b43,_0x2f505c){SquareProjectEvents['emit'](_0x4aea89+':'+_0x734615['id'],_0x734615);SquareProjectEvents[_0xec19('0x5')](_0x4aea89,_0x734615);_0x2f505c(null);};}for(var e in events){if(events[_0xec19('0x6')](e)){var event=events[e];SquareProject[_0xec19('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x31ed=['hook','exports','events','../../mysqldb','SquareProject','update','remove','emit','hasOwnProperty'];(function(_0x4ccb60,_0x2d931a){var _0x59e378=function(_0x260e46){while(--_0x260e46){_0x4ccb60['push'](_0x4ccb60['shift']());}};_0x59e378(++_0x2d931a);}(_0x31ed,0x1a0));var _0xd31e=function(_0x51fc0d,_0x2bac03){_0x51fc0d=_0x51fc0d-0x0;var _0xf805ec=_0x31ed[_0x51fc0d];return _0xf805ec;};'use strict';var EventEmitter=require(_0xd31e('0x0'));var SquareProject=require(_0xd31e('0x1'))['db'][_0xd31e('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd31e('0x3'),'afterDestroy':_0xd31e('0x4')};function emitEvent(_0x55a21b){return function(_0x2725ff,_0x3a671c,_0x2635d6){SquareProjectEvents['emit'](_0x55a21b+':'+_0x2725ff['id'],_0x2725ff);SquareProjectEvents[_0xd31e('0x5')](_0x55a21b,_0x2725ff);_0x2635d6(null);};}for(var e in events){if(events[_0xd31e('0x6')](e)){var event=events[e];SquareProject[_0xd31e('0x7')](e,emitEvent(event));}}module[_0xd31e('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 8374ae8..74d7c5e 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 _0xaded=['production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','square_projects','savedAt','format','changed'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xaded,0x1ce));var _0xdade=function(_0x15bfc0,_0x4703bf){_0x15bfc0=_0x15bfc0-0x0;var _0x1246b5=_0xaded[_0x15bfc0];return _0x1246b5;};'use strict';var _=require(_0xdade('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdade('0x1'));var moment=require(_0xdade('0x2'));var BPromise=require(_0xdade('0x3'));var rp=require(_0xdade('0x4'));var fs=require('fs');var path=require(_0xdade('0x5'));var rimraf=require(_0xdade('0x6'));var config=require(_0xdade('0x7'));var attributes=require('./squareProject.attributes');module[_0xdade('0x8')]=function(_0x113ad4,_0x2e60c1){return _0x113ad4[_0xdade('0x9')]('SquareProject',attributes,{'tableName':_0xdade('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x508a44,_0x50f42a,_0x5d760e){if(_0x508a44['changed']('preproduction')){_0x508a44[_0xdade('0xb')]=moment()[_0xdade('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x508a44[_0xdade('0xd')](_0xdade('0xe'))){_0x508a44[_0xdade('0xf')]=moment()['format'](_0xdade('0x10'));}_0x5d760e(null,_0x508a44);}}});}; \ No newline at end of file +var _0x9338=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','preproduction','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','format','lodash','util','../../config/logger','api','bluebird'];(function(_0x2f326e,_0x4635ee){var _0x5b3749=function(_0x54e32e){while(--_0x54e32e){_0x2f326e['push'](_0x2f326e['shift']());}};_0x5b3749(++_0x4635ee);}(_0x9338,0x19d));var _0x8933=function(_0xa72cf,_0x24a05c){_0xa72cf=_0xa72cf-0x0;var _0x263735=_0x9338[_0xa72cf];return _0x263735;};'use strict';var _=require(_0x8933('0x0'));var util=require(_0x8933('0x1'));var logger=require(_0x8933('0x2'))(_0x8933('0x3'));var moment=require('moment');var BPromise=require(_0x8933('0x4'));var rp=require(_0x8933('0x5'));var fs=require('fs');var path=require(_0x8933('0x6'));var rimraf=require(_0x8933('0x7'));var config=require(_0x8933('0x8'));var attributes=require(_0x8933('0x9'));module['exports']=function(_0x4d81e9,_0x4f7264){return _0x4d81e9[_0x8933('0xa')](_0x8933('0xb'),attributes,{'tableName':_0x8933('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c38ff,_0x5d003f,_0x19bfa7){if(_0x4c38ff['changed'](_0x8933('0xd'))){_0x4c38ff['savedAt']=moment()['format'](_0x8933('0xe'));}if(_0x4c38ff[_0x8933('0xf')](_0x8933('0x10'))){_0x4c38ff[_0x8933('0x11')]=moment()[_0x8933('0x12')](_0x8933('0xe'));}_0x19bfa7(null,_0x4c38ff);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index e2b46af..2f48c8d 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 _0x0958=['options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','error','message','SquareProject','find','ShowSquareProject','ioredis','rpc','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','findAll'];(function(_0x2f8f9c,_0x2d6090){var _0x39d3e8=function(_0x23f3ff){while(--_0x23f3ff){_0x2f8f9c['push'](_0x2f8f9c['shift']());}};_0x39d3e8(++_0x2d6090);}(_0x0958,0xb3));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var Redis=require(_0x8095('0x0'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x8095('0x1'));var config=require(_0x8095('0x2'));config[_0x8095('0x3')]=_[_0x8095('0x4')](config[_0x8095('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0x8095('0x5'))(new Redis(config[_0x8095('0x3')]));require(_0x8095('0x6'))[_0x8095('0x7')](socket);exports[_0x8095('0x8')]=function(_0x7dd167){var _0x3219fd=this;return new Promise(function(_0x1436f8,_0x30b25b){return db['SquareProject'][_0x8095('0x9')]({'raw':_0x7dd167[_0x8095('0xa')]?_0x7dd167[_0x8095('0xa')][_0x8095('0xb')]===undefined?!![]:![]:!![],'where':_0x7dd167['options']?_0x7dd167['options'][_0x8095('0xc')]||null:null,'attributes':_0x7dd167[_0x8095('0xa')]?_0x7dd167[_0x8095('0xa')][_0x8095('0xd')]||null:null,'limit':_0x7dd167[_0x8095('0xa')]?_0x7dd167[_0x8095('0xa')][_0x8095('0xe')]||null:null,'include':_0x7dd167['options']?_0x7dd167[_0x8095('0xa')][_0x8095('0xf')]?_[_0x8095('0x10')](_0x7dd167[_0x8095('0xa')]['include'],function(_0x5d5836){return{'model':db[_0x5d5836[_0x8095('0x11')]],'as':_0x5d5836['as'],'attributes':_0x5d5836[_0x8095('0xd')],'include':_0x5d5836[_0x8095('0xf')]?_['map'](_0x5d5836['include'],function(_0x4d8d3c){return{'model':db[_0x4d8d3c[_0x8095('0x11')]],'as':_0x4d8d3c['as'],'attributes':_0x4d8d3c[_0x8095('0xd')],'include':_0x4d8d3c[_0x8095('0xf')]?_['map'](_0x4d8d3c[_0x8095('0xf')],function(_0x528974){return{'model':db[_0x528974[_0x8095('0x11')]],'as':_0x528974['as'],'attributes':_0x528974['attributes']};}):[]};}):[]};}):[]:[]})[_0x8095('0x12')](function(_0x3b0072){logger[_0x8095('0x13')](_0x8095('0x8'),_0x7dd167);logger[_0x8095('0x14')](_0x8095('0x8'),_0x7dd167,JSON[_0x8095('0x15')](_0x3b0072));_0x1436f8(_0x3b0072);})['catch'](function(_0x5ff247){logger[_0x8095('0x16')](_0x8095('0x8'),_0x5ff247[_0x8095('0x17')],_0x7dd167);_0x30b25b(_0x3219fd[_0x8095('0x16')](0x1f4,_0x5ff247[_0x8095('0x17')]));});});};exports['ShowSquareProject']=function(_0x511661){var _0xff3263=this;return new Promise(function(_0x588d23,_0x16a5df){return db[_0x8095('0x18')][_0x8095('0x19')]({'raw':_0x511661[_0x8095('0xa')]?_0x511661[_0x8095('0xa')][_0x8095('0xb')]===undefined?!![]:![]:!![],'where':_0x511661[_0x8095('0xa')]?_0x511661[_0x8095('0xa')][_0x8095('0xc')]||null:null,'attributes':_0x511661[_0x8095('0xa')]?_0x511661[_0x8095('0xa')][_0x8095('0xd')]||null:null,'include':_0x511661[_0x8095('0xa')]?_0x511661[_0x8095('0xa')][_0x8095('0xf')]?_[_0x8095('0x10')](_0x511661[_0x8095('0xa')][_0x8095('0xf')],function(_0x1d915e){return{'model':db[_0x1d915e[_0x8095('0x11')]],'as':_0x1d915e['as'],'attributes':_0x1d915e[_0x8095('0xd')],'include':_0x1d915e[_0x8095('0xf')]?_[_0x8095('0x10')](_0x1d915e[_0x8095('0xf')],function(_0x4ef362){return{'model':db[_0x4ef362[_0x8095('0x11')]],'as':_0x4ef362['as'],'attributes':_0x4ef362[_0x8095('0xd')],'include':_0x4ef362['include']?_[_0x8095('0x10')](_0x4ef362[_0x8095('0xf')],function(_0x1b3235){return{'model':db[_0x1b3235[_0x8095('0x11')]],'as':_0x1b3235['as'],'attributes':_0x1b3235[_0x8095('0xd')]};}):[]};}):[]};}):[]:[]})[_0x8095('0x12')](function(_0x230969){logger[_0x8095('0x13')](_0x8095('0x1a'),_0x511661);logger[_0x8095('0x14')](_0x8095('0x1a'),_0x511661,JSON[_0x8095('0x15')](_0x230969));_0x588d23(_0x230969);})['catch'](function(_0x25623c){logger[_0x8095('0x16')]('ShowSquareProject',_0x25623c[_0x8095('0x17')],_0x511661);_0x16a5df(_0xff3263[_0x8095('0x16')](0x1f4,_0x25623c[_0x8095('0x17')]));});});}; \ No newline at end of file +var _0xcc35=['stringify','catch','message','error','ShowSquareProject','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','info','GetSquareProjects','debug'];(function(_0x428ca1,_0x193713){var _0x5071e3=function(_0x4c2939){while(--_0x4c2939){_0x428ca1['push'](_0x428ca1['shift']());}};_0x5071e3(++_0x193713);}(_0xcc35,0xf6));var _0x5cc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc35[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5cc3('0x0'));var Redis=require(_0x5cc3('0x1'));var db=require(_0x5cc3('0x2'))['db'];var logger=require(_0x5cc3('0x3'))(_0x5cc3('0x4'));var config=require(_0x5cc3('0x5'));config['redis']=_[_0x5cc3('0x6')](config[_0x5cc3('0x7')],{'host':_0x5cc3('0x8'),'port':0x18eb});var socket=require(_0x5cc3('0x9'))(new Redis(config[_0x5cc3('0x7')]));require('./squareProject.socket')['register'](socket);exports['GetSquareProjects']=function(_0x3cd056){var _0x34b19f=this;return new Promise(function(_0x44b9a8,_0x7b8541){return db[_0x5cc3('0xa')][_0x5cc3('0xb')]({'raw':_0x3cd056[_0x5cc3('0xc')]?_0x3cd056[_0x5cc3('0xc')][_0x5cc3('0xd')]===undefined?!![]:![]:!![],'where':_0x3cd056[_0x5cc3('0xc')]?_0x3cd056['options'][_0x5cc3('0xe')]||null:null,'attributes':_0x3cd056[_0x5cc3('0xc')]?_0x3cd056['options'][_0x5cc3('0xf')]||null:null,'limit':_0x3cd056[_0x5cc3('0xc')]?_0x3cd056[_0x5cc3('0xc')][_0x5cc3('0x10')]||null:null,'include':_0x3cd056[_0x5cc3('0xc')]?_0x3cd056[_0x5cc3('0xc')][_0x5cc3('0x11')]?_[_0x5cc3('0x12')](_0x3cd056[_0x5cc3('0xc')][_0x5cc3('0x11')],function(_0x2e19de){return{'model':db[_0x2e19de[_0x5cc3('0x13')]],'as':_0x2e19de['as'],'attributes':_0x2e19de[_0x5cc3('0xf')],'include':_0x2e19de[_0x5cc3('0x11')]?_[_0x5cc3('0x12')](_0x2e19de['include'],function(_0x1eea0e){return{'model':db[_0x1eea0e[_0x5cc3('0x13')]],'as':_0x1eea0e['as'],'attributes':_0x1eea0e[_0x5cc3('0xf')],'include':_0x1eea0e[_0x5cc3('0x11')]?_[_0x5cc3('0x12')](_0x1eea0e[_0x5cc3('0x11')],function(_0x362d8a){return{'model':db[_0x362d8a[_0x5cc3('0x13')]],'as':_0x362d8a['as'],'attributes':_0x362d8a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cc3('0x14')](function(_0x2a8c37){logger[_0x5cc3('0x15')](_0x5cc3('0x16'),_0x3cd056);logger[_0x5cc3('0x17')](_0x5cc3('0x16'),_0x3cd056,JSON[_0x5cc3('0x18')](_0x2a8c37));_0x44b9a8(_0x2a8c37);})[_0x5cc3('0x19')](function(_0x5f5721){logger['error'](_0x5cc3('0x16'),_0x5f5721[_0x5cc3('0x1a')],_0x3cd056);_0x7b8541(_0x34b19f[_0x5cc3('0x1b')](0x1f4,_0x5f5721[_0x5cc3('0x1a')]));});});};exports[_0x5cc3('0x1c')]=function(_0x2356d1){var _0x38b960=this;return new Promise(function(_0x305d97,_0x1d3131){return db['SquareProject'][_0x5cc3('0x1d')]({'raw':_0x2356d1[_0x5cc3('0xc')]?_0x2356d1[_0x5cc3('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x2356d1[_0x5cc3('0xc')]?_0x2356d1[_0x5cc3('0xc')][_0x5cc3('0xe')]||null:null,'attributes':_0x2356d1[_0x5cc3('0xc')]?_0x2356d1['options'][_0x5cc3('0xf')]||null:null,'include':_0x2356d1[_0x5cc3('0xc')]?_0x2356d1['options']['include']?_[_0x5cc3('0x12')](_0x2356d1['options'][_0x5cc3('0x11')],function(_0x417f77){return{'model':db[_0x417f77[_0x5cc3('0x13')]],'as':_0x417f77['as'],'attributes':_0x417f77['attributes'],'include':_0x417f77[_0x5cc3('0x11')]?_['map'](_0x417f77[_0x5cc3('0x11')],function(_0x3bfd58){return{'model':db[_0x3bfd58[_0x5cc3('0x13')]],'as':_0x3bfd58['as'],'attributes':_0x3bfd58[_0x5cc3('0xf')],'include':_0x3bfd58[_0x5cc3('0x11')]?_[_0x5cc3('0x12')](_0x3bfd58[_0x5cc3('0x11')],function(_0xc896c0){return{'model':db[_0xc896c0[_0x5cc3('0x13')]],'as':_0xc896c0['as'],'attributes':_0xc896c0[_0x5cc3('0xf')]};}):[]};}):[]};}):[]:[]})[_0x5cc3('0x14')](function(_0x3ee640){logger[_0x5cc3('0x15')](_0x5cc3('0x1c'),_0x2356d1);logger[_0x5cc3('0x17')]('ShowSquareProject',_0x2356d1,JSON[_0x5cc3('0x18')](_0x3ee640));_0x305d97(_0x3ee640);})[_0x5cc3('0x19')](function(_0xc346d4){logger['error']('ShowSquareProject',_0xc346d4[_0x5cc3('0x1a')],_0x2356d1);_0x1d3131(_0x38b960[_0x5cc3('0x1b')](0x1f4,_0xc346d4[_0x5cc3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 50e52e6..ab11536 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 _0x5c0e=['emit','removeListener','register','length','squareProject:','./squareProject.events','update'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x5c0e,0x1c5));var _0xe5c0=function(_0x2656a4,_0x28dd1b){_0x2656a4=_0x2656a4-0x0;var _0x48ce85=_0x5c0e[_0x2656a4];return _0x48ce85;};'use strict';var SquareProjectEvents=require(_0xe5c0('0x0'));var events=['save','remove',_0xe5c0('0x1')];function createListener(_0x500de2,_0x45eca9){return function(_0x4eee6f){_0x45eca9[_0xe5c0('0x2')](_0x500de2,_0x4eee6f);};}function removeListener(_0x5432be,_0x2e9581){return function(){SquareProjectEvents[_0xe5c0('0x3')](_0x5432be,_0x2e9581);};}exports[_0xe5c0('0x4')]=function(_0x39fff9){for(var _0x59ef08=0x0,_0x20fe84=events[_0xe5c0('0x5')];_0x59ef08<_0x20fe84;_0x59ef08++){var _0x4d3c67=events[_0x59ef08];var _0x1bcba8=createListener(_0xe5c0('0x6')+_0x4d3c67,_0x39fff9);SquareProjectEvents['on'](_0x4d3c67,_0x1bcba8);}}; \ No newline at end of file +var _0x8f4b=['./squareProject.events','emit','removeListener','length','squareProject:'];(function(_0x424e6c,_0x169bc4){var _0x524028=function(_0x24fd8f){while(--_0x24fd8f){_0x424e6c['push'](_0x424e6c['shift']());}};_0x524028(++_0x169bc4);}(_0x8f4b,0xe1));var _0xb8f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f4b[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0xb8f4('0x0'));var events=['save','remove','update'];function createListener(_0x2ff6a8,_0x3f597c){return function(_0x534c20){_0x3f597c[_0xb8f4('0x1')](_0x2ff6a8,_0x534c20);};}function removeListener(_0x613aa,_0x4ba0d7){return function(){SquareProjectEvents[_0xb8f4('0x2')](_0x613aa,_0x4ba0d7);};}exports['register']=function(_0x4a8b59){for(var _0x49b47b=0x0,_0x31b09e=events[_0xb8f4('0x3')];_0x49b47b<_0x31b09e;_0x49b47b++){var _0x40475d=events[_0x49b47b];var _0x1c3973=createListener(_0xb8f4('0x4')+_0x40475d,_0x4a8b59);SquareProjectEvents['on'](_0x40475d,_0x1c3973);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 01445b2..977516b 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x25fa21,_0x100f42){var _0x3ce8c9=function(_0x5bc466){while(--_0x5bc466){_0x25fa21['push'](_0x25fa21['shift']());}};_0x3ce8c9(++_0x100f42);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0x5fc3[_0xd578cb];return _0x775533;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x49384c,_0x38fad9){var _0x2baca6=function(_0x383725){while(--_0x383725){_0x49384c['push'](_0x49384c['shift']());}};_0x2baca6(++_0x38fad9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 92e3486..3da069b 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 _0x326f=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x5f2f64,_0x35a099){var _0x2b4199=function(_0x154aff){while(--_0x154aff){_0x5f2f64['push'](_0x5f2f64['shift']());}};_0x2b4199(++_0x35a099);}(_0x326f,0xd1));var _0xf326=function(_0x280126,_0xf23689){_0x280126=_0x280126-0x0;var _0x2b2e70=_0x326f[_0x280126];return _0x2b2e70;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf326('0x1')]},'calleridname':{'type':Sequelize[_0xf326('0x1')]},'context':{'type':Sequelize[_0xf326('0x1')]},'extension':{'type':Sequelize[_0xf326('0x1')]},'priority':{'type':Sequelize[_0xf326('0x1')]},'accountcode':{'type':Sequelize[_0xf326('0x1')]},'dnid':{'type':Sequelize[_0xf326('0x1')]},'projectName':{'type':Sequelize[_0xf326('0x1')]},'saveName':{'type':Sequelize[_0xf326('0x1')]},'filename':{'type':Sequelize[_0xf326('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf326('0x2')],'get':function(){var _0x3851eb='';var _0x165f95=this[_0xf326('0x3')]('savePath');if(_0x165f95){_0x3851eb=_0x165f95['substring'](_0x165f95['lastIndexOf']('.'));}return _0x3851eb;}}}; \ No newline at end of file +var _0x2eb2=['substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x2eb2[_0x5b561d];return _0x431060;};'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 diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 6c947fa..9e887af 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 _0xf2ad=['index','map','rawAttributes','type','key','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareRecording','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','download','uniqueid','savePath','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','zip-dir','bluebird','mustache','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','stack'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xf2ad,0x8f));var _0xdf2a=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0xf2ad[_0x555ebb];return _0x3c0a4a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdf2a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdf2a('0x1'));var Mustache=require(_0xdf2a('0x2'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdf2a('0x3'));var crypto=require(_0xdf2a('0x4'));var jsforce=require(_0xdf2a('0x5'));var deskjs=require(_0xdf2a('0x6'));var toCsv=require(_0xdf2a('0x7'));var querystring=require(_0xdf2a('0x8'));var Papa=require('papaparse');var Redis=require(_0xdf2a('0x9'));var authService=require('../../components/auth/service');var qs=require(_0xdf2a('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf2a('0xb'));var logger=require(_0xdf2a('0xc'))(_0xdf2a('0xd'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdf2a('0xe'))['db'];function respondWithStatusCode(_0x78e57b,_0x506d87){_0x506d87=_0x506d87||0xcc;return function(_0x5457f1){if(_0x5457f1){return _0x78e57b[_0xdf2a('0xf')](_0x506d87);}return _0x78e57b['status'](_0x506d87)[_0xdf2a('0x10')]();};}function respondWithResult(_0x40baef,_0x4bc32f){_0x4bc32f=_0x4bc32f||0xc8;return function(_0x26372f){if(_0x26372f){return _0x40baef[_0xdf2a('0x11')](_0x4bc32f)[_0xdf2a('0x12')](_0x26372f);}};}function respondWithFilteredResult(_0x3cf3e5,_0x5271e3){return function(_0xe7b97d){if(_0xe7b97d){var _0x45aa0d=typeof _0x5271e3[_0xdf2a('0x13')]===_0xdf2a('0x14')&&typeof _0x5271e3[_0xdf2a('0x15')]==='undefined';var _0x292837=_0xe7b97d[_0xdf2a('0x16')];var _0x3dbf41=_0x45aa0d?0x0:_0x5271e3[_0xdf2a('0x13')];var _0x1903a9=_0x45aa0d?_0xe7b97d[_0xdf2a('0x16')]:_0x5271e3[_0xdf2a('0x13')]+_0x5271e3[_0xdf2a('0x15')];var _0x486cd5;if(_0x1903a9>=_0x292837){_0x1903a9=_0x292837;_0x486cd5=0xc8;}else{_0x486cd5=0xce;}_0x3cf3e5[_0xdf2a('0x11')](_0x486cd5);return _0x3cf3e5['set'](_0xdf2a('0x17'),_0x3dbf41+'-'+_0x1903a9+'/'+_0x292837)[_0xdf2a('0x12')](_0xe7b97d);}return null;};}function patchUpdates(_0x39d554){return function(_0x286839){try{jsonpatch[_0xdf2a('0x18')](_0x286839,_0x39d554,!![]);}catch(_0x4d4c3b){return BPromise['reject'](_0x4d4c3b);}return _0x286839[_0xdf2a('0x19')]();};}function saveUpdates(_0x5f28c9,_0x452b14){return function(_0x11380b){if(_0x11380b){return _0x11380b['update'](_0x5f28c9)[_0xdf2a('0x1a')](function(_0x5a3b42){return _0x5a3b42;});}return null;};}function removeEntity(_0x5474c8,_0x21fb33){return function(_0x51ae10){if(_0x51ae10){return _0x51ae10[_0xdf2a('0x1b')]()[_0xdf2a('0x1a')](function(){_0x5474c8[_0xdf2a('0x11')](0xcc)[_0xdf2a('0x10')]();});}};}function handleEntityNotFound(_0xc66711,_0x276c63){return function(_0x2df178){if(!_0x2df178){_0xc66711['sendStatus'](0x194);}return _0x2df178;};}function handleError(_0x400992,_0x55b3f1){_0x55b3f1=_0x55b3f1||0x1f4;return function(_0x23b683){logger['error'](_0x23b683[_0xdf2a('0x1c')]);if(_0x23b683['name']){delete _0x23b683['name'];}_0x400992[_0xdf2a('0x11')](_0x55b3f1)['send'](_0x23b683);};}exports[_0xdf2a('0x1d')]=function(_0x5029f2,_0x9beea7){var _0x4403a4={},_0x152b3c={},_0x37dc88={'count':0x0,'rows':[]};var _0x20dd08=_[_0xdf2a('0x1e')](db['SquareRecording'][_0xdf2a('0x1f')],function(_0x335901){return{'name':_0x335901['fieldName'],'type':_0x335901[_0xdf2a('0x20')][_0xdf2a('0x21')]};});_0x152b3c[_0xdf2a('0x22')]=_[_0xdf2a('0x1e')](_0x20dd08,_0xdf2a('0x23'));_0x152b3c['query']=_[_0xdf2a('0x24')](_0x5029f2['query']);_0x152b3c[_0xdf2a('0x25')]=_[_0xdf2a('0x26')](_0x152b3c['model'],_0x152b3c[_0xdf2a('0x27')]);_0x4403a4[_0xdf2a('0x28')]=_[_0xdf2a('0x26')](_0x152b3c[_0xdf2a('0x22')],qs[_0xdf2a('0x29')](_0x5029f2['query']['fields']));_0x4403a4['attributes']=_0x4403a4[_0xdf2a('0x28')][_0xdf2a('0x2a')]?_0x4403a4[_0xdf2a('0x28')]:_0x152b3c[_0xdf2a('0x22')];if(!_0x5029f2[_0xdf2a('0x27')][_0xdf2a('0x2b')](_0xdf2a('0x2c'))){_0x4403a4[_0xdf2a('0x15')]=qs[_0xdf2a('0x15')](_0x5029f2[_0xdf2a('0x27')][_0xdf2a('0x15')]);_0x4403a4['offset']=qs[_0xdf2a('0x13')](_0x5029f2['query'][_0xdf2a('0x13')]);}_0x4403a4[_0xdf2a('0x2d')]=qs[_0xdf2a('0x2e')](_0x5029f2[_0xdf2a('0x27')]['sort']);_0x4403a4[_0xdf2a('0x2f')]=qs['filters'](_[_0xdf2a('0x30')](_0x5029f2[_0xdf2a('0x27')],_0x152b3c[_0xdf2a('0x25')]),_0x20dd08);if(_0x5029f2[_0xdf2a('0x27')][_0xdf2a('0x31')]){_0x4403a4[_0xdf2a('0x2f')]=_[_0xdf2a('0x32')](_0x4403a4[_0xdf2a('0x2f')],{'$or':_['map'](_0x20dd08,function(_0x31fcf8){if(_0x31fcf8[_0xdf2a('0x20')]!==_0xdf2a('0x33')){var _0x43f1bc={};_0x43f1bc[_0x31fcf8['name']]={'$like':'%'+_0x5029f2['query'][_0xdf2a('0x31')]+'%'};return _0x43f1bc;}})});}_0x4403a4=_[_0xdf2a('0x32')]({},_0x4403a4,_0x5029f2[_0xdf2a('0x34')]);var _0x4f8f17={'where':_0x4403a4[_0xdf2a('0x2f')]};return db[_0xdf2a('0x35')][_0xdf2a('0x16')](_0x4f8f17)[_0xdf2a('0x1a')](function(_0x117386){_0x37dc88[_0xdf2a('0x16')]=_0x117386;if(_0x5029f2['query'][_0xdf2a('0x36')]){_0x4403a4[_0xdf2a('0x37')]=[{'all':!![]}];}return db[_0xdf2a('0x35')][_0xdf2a('0x38')](_0x4403a4);})[_0xdf2a('0x1a')](function(_0x439e80){_0x37dc88[_0xdf2a('0x39')]=_0x439e80;return _0x37dc88;})[_0xdf2a('0x1a')](respondWithFilteredResult(_0x9beea7,_0x4403a4))[_0xdf2a('0x3a')](handleError(_0x9beea7,null));};exports[_0xdf2a('0x3b')]=function(_0x42dea3,_0xd902e6){var _0x9d50a={'raw':!![],'where':{'id':_0x42dea3['params']['id']}},_0x466a68={};_0x466a68['model']=_[_0xdf2a('0x24')](db[_0xdf2a('0x35')]['rawAttributes']);_0x466a68[_0xdf2a('0x27')]=_[_0xdf2a('0x24')](_0x42dea3['query']);_0x466a68['filters']=_['intersection'](_0x466a68[_0xdf2a('0x22')],_0x466a68[_0xdf2a('0x27')]);_0x9d50a[_0xdf2a('0x28')]=_[_0xdf2a('0x26')](_0x466a68[_0xdf2a('0x22')],qs['fields'](_0x42dea3[_0xdf2a('0x27')][_0xdf2a('0x29')]));_0x9d50a[_0xdf2a('0x28')]=_0x9d50a[_0xdf2a('0x28')]['length']?_0x9d50a[_0xdf2a('0x28')]:_0x466a68[_0xdf2a('0x22')];if(_0x42dea3[_0xdf2a('0x27')][_0xdf2a('0x36')]){_0x9d50a[_0xdf2a('0x37')]=[{'all':!![]}];}_0x9d50a=_[_0xdf2a('0x32')]({},_0x9d50a,_0x42dea3[_0xdf2a('0x34')]);return db[_0xdf2a('0x35')][_0xdf2a('0x3c')](_0x9d50a)[_0xdf2a('0x1a')](handleEntityNotFound(_0xd902e6,null))[_0xdf2a('0x1a')](respondWithResult(_0xd902e6,null))[_0xdf2a('0x3a')](handleError(_0xd902e6,null));};exports[_0xdf2a('0x3d')]=function(_0x46849f,_0x2a493d){return db[_0xdf2a('0x35')][_0xdf2a('0x3d')](_0x46849f[_0xdf2a('0x3e')],{})[_0xdf2a('0x1a')](respondWithResult(_0x2a493d,0xc9))['catch'](handleError(_0x2a493d,null));};exports[_0xdf2a('0x3f')]=function(_0x40d611,_0x5f13d7){if(_0x40d611['body']['id']){delete _0x40d611[_0xdf2a('0x3e')]['id'];}return db[_0xdf2a('0x35')][_0xdf2a('0x3c')]({'where':{'id':_0x40d611[_0xdf2a('0x40')]['id']}})[_0xdf2a('0x1a')](handleEntityNotFound(_0x5f13d7,null))[_0xdf2a('0x1a')](saveUpdates(_0x40d611[_0xdf2a('0x3e')],null))['then'](respondWithResult(_0x5f13d7,null))[_0xdf2a('0x3a')](handleError(_0x5f13d7,null));};exports[_0xdf2a('0x41')]=function(_0x5fca96,_0x47b33d,_0x2987c2){var _0x4bde26=require('../../components/encryptor');var _0x44c624=![];var _0x45adef={};if(_0x5fca96['query'][_0xdf2a('0x20')]&&_0x5fca96[_0xdf2a('0x27')]['type']==='uniqueid'){_0x45adef[_0xdf2a('0x42')]=_0x5fca96['params']['id'];}else{_0x45adef['id']=_0x5fca96[_0xdf2a('0x40')]['id'];}return db[_0xdf2a('0x35')]['find']({'where':_0x45adef,'attributes':['id',_0xdf2a('0x43'),'filename'],'raw':!![]})[_0xdf2a('0x1a')](handleEntityNotFound(_0x47b33d,null))[_0xdf2a('0x1a')](function(_0x284dbe){if(_0x284dbe){var _0x3188b9=_0x284dbe[_0xdf2a('0x43')];var _0x4f23e5=util[_0xdf2a('0x44')]('%s.cypher',_0x3188b9);if(fs[_0xdf2a('0x45')](_0x4f23e5)){_0x44c624=!![];return _0x4bde26[_0xdf2a('0x46')](_0x4f23e5,_0x3188b9,config[_0xdf2a('0x47')]['recording'])[_0xdf2a('0x1a')](function(){return _0x284dbe;});}return _0x284dbe;}})[_0xdf2a('0x1a')](function(_0x1aa386){if(_0x1aa386){var _0x439785=_0x1aa386['savePath'];if(!fs[_0xdf2a('0x45')](_0x439785)){throw new db[(_0xdf2a('0x48'))][(_0xdf2a('0x49'))](_0xdf2a('0x4a'));}if(_0x1aa386[_0xdf2a('0x4b')]){return _0x47b33d['download'](_0x439785,_0x1aa386[_0xdf2a('0x4b')]+path[_0xdf2a('0x4c')](_0x439785),function(){if(_0x44c624){fs['unlink'](_0x439785);}});}else{return _0x47b33d['download'](_0x439785,function(_0xb5b5fa){if(_0x44c624){fs[_0xdf2a('0x4d')](_0x439785);}});}}})[_0xdf2a('0x3a')](function(_0x3303d0){if(_0x3303d0[_0xdf2a('0x4e')]===_0xdf2a('0x4a')){_0x47b33d['status'](0x194)['send'](_0xdf2a('0x4f'));}else{return handleError(_0x47b33d,null);}});};exports[_0xdf2a('0x1b')]=function(_0x45ee52,_0x12fcd3){return db[_0xdf2a('0x35')]['find']({'where':{'id':_0x45ee52['params']['id']}})[_0xdf2a('0x1a')](function(_0x5857c7){if(_[_0xdf2a('0x50')](_0x5857c7)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5857c7;})[_0xdf2a('0x1a')](function(_0x550856){var _0x5abd4e=_0x550856[_0xdf2a('0x43')];logger[_0xdf2a('0x51')](_0xdf2a('0x52'),_0x5abd4e);if(!_[_0xdf2a('0x50')](_0x550856['savePath'])&&fs['existsSync'](_0x5abd4e)){logger[_0xdf2a('0x51')](_0xdf2a('0x53')+_0x5abd4e+_0xdf2a('0x54'));fs['unlinkSync'](_0x5abd4e);}_0x5abd4e=_0x5abd4e+'.cypher';if(!_[_0xdf2a('0x50')](_0x550856[_0xdf2a('0x43')])&&fs['existsSync'](_0x5abd4e)){logger[_0xdf2a('0x51')]('File:\x20\x22'+_0x5abd4e+_0xdf2a('0x54'));fs[_0xdf2a('0x55')](_0x5abd4e);}return _0x550856;})[_0xdf2a('0x1a')](function(_0x13f1b6){if(!_0x13f1b6)throw new InternalError();return _0x13f1b6[_0xdf2a('0x1b')]();})[_0xdf2a('0x1a')](function(){_0x12fcd3[_0xdf2a('0x11')](0xcc)['end']();})[_0xdf2a('0x3a')](handleError(_0x12fcd3,null));}; \ No newline at end of file +var _0xef78=['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','apply','reject','save','update','destroy','then','error','stack','name','index','SquareRecording','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','map','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','SquareRecording\x20not\x20found','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse'];(function(_0x36b991,_0x443720){var _0xd7d18=function(_0x518695){while(--_0x518695){_0x36b991['push'](_0x36b991['shift']());}};_0xd7d18(++_0x443720);}(_0xef78,0x11d));var _0x8ef7=function(_0x26664c,_0xced888){_0x26664c=_0x26664c-0x0;var _0x5b9ab8=_0xef78[_0x26664c];return _0x5b9ab8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ef7('0x0'));var zipdir=require(_0x8ef7('0x1'));var jsonpatch=require(_0x8ef7('0x2'));var rp=require(_0x8ef7('0x3'));var moment=require('moment');var BPromise=require(_0x8ef7('0x4'));var Mustache=require(_0x8ef7('0x5'));var util=require(_0x8ef7('0x6'));var path=require(_0x8ef7('0x7'));var sox=require(_0x8ef7('0x8'));var csv=require(_0x8ef7('0x9'));var ejs=require(_0x8ef7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ef7('0xb'));var squel=require('squel');var crypto=require(_0x8ef7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8ef7('0xd'));var toCsv=require(_0x8ef7('0x9'));var querystring=require('querystring');var Papa=require(_0x8ef7('0xe'));var Redis=require(_0x8ef7('0xf'));var authService=require(_0x8ef7('0x10'));var qs=require(_0x8ef7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ef7('0x12'));var logger=require(_0x8ef7('0x13'))('api');var utils=require(_0x8ef7('0x14'));var config=require(_0x8ef7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ef7('0x16'))['db'];function respondWithStatusCode(_0x4b220a,_0x2e05d2){_0x2e05d2=_0x2e05d2||0xcc;return function(_0x489000){if(_0x489000){return _0x4b220a[_0x8ef7('0x17')](_0x2e05d2);}return _0x4b220a[_0x8ef7('0x18')](_0x2e05d2)['end']();};}function respondWithResult(_0x4611c7,_0x4fd2c9){_0x4fd2c9=_0x4fd2c9||0xc8;return function(_0x415877){if(_0x415877){return _0x4611c7[_0x8ef7('0x18')](_0x4fd2c9)[_0x8ef7('0x19')](_0x415877);}};}function respondWithFilteredResult(_0x36d113,_0x814353){return function(_0x405e56){if(_0x405e56){var _0x88de6d=typeof _0x814353[_0x8ef7('0x1a')]===_0x8ef7('0x1b')&&typeof _0x814353[_0x8ef7('0x1c')]===_0x8ef7('0x1b');var _0x176364=_0x405e56[_0x8ef7('0x1d')];var _0x311325=_0x88de6d?0x0:_0x814353[_0x8ef7('0x1a')];var _0x450f66=_0x88de6d?_0x405e56[_0x8ef7('0x1d')]:_0x814353[_0x8ef7('0x1a')]+_0x814353[_0x8ef7('0x1c')];var _0xf71254;if(_0x450f66>=_0x176364){_0x450f66=_0x176364;_0xf71254=0xc8;}else{_0xf71254=0xce;}_0x36d113[_0x8ef7('0x18')](_0xf71254);return _0x36d113[_0x8ef7('0x1e')]('Content-Range',_0x311325+'-'+_0x450f66+'/'+_0x176364)['json'](_0x405e56);}return null;};}function patchUpdates(_0x41aa7d){return function(_0x17bc3f){try{jsonpatch[_0x8ef7('0x1f')](_0x17bc3f,_0x41aa7d,!![]);}catch(_0x185a9f){return BPromise[_0x8ef7('0x20')](_0x185a9f);}return _0x17bc3f[_0x8ef7('0x21')]();};}function saveUpdates(_0x8c9031,_0x1e639e){return function(_0x4d4095){if(_0x4d4095){return _0x4d4095[_0x8ef7('0x22')](_0x8c9031)['then'](function(_0x5b7745){return _0x5b7745;});}return null;};}function removeEntity(_0x1bc86f,_0x503f24){return function(_0x1ee0da){if(_0x1ee0da){return _0x1ee0da[_0x8ef7('0x23')]()[_0x8ef7('0x24')](function(){_0x1bc86f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49aa60,_0x55644e){return function(_0x377988){if(!_0x377988){_0x49aa60[_0x8ef7('0x17')](0x194);}return _0x377988;};}function handleError(_0xb12526,_0x48d258){_0x48d258=_0x48d258||0x1f4;return function(_0x50223e){logger[_0x8ef7('0x25')](_0x50223e[_0x8ef7('0x26')]);if(_0x50223e[_0x8ef7('0x27')]){delete _0x50223e['name'];}_0xb12526['status'](_0x48d258)['send'](_0x50223e);};}exports[_0x8ef7('0x28')]=function(_0x56dd64,_0x8cafcf){var _0x3a3929={},_0x2b5f56={},_0x43d2fc={'count':0x0,'rows':[]};var _0x466033=_['map'](db[_0x8ef7('0x29')][_0x8ef7('0x2a')],function(_0x262101){return{'name':_0x262101[_0x8ef7('0x2b')],'type':_0x262101['type'][_0x8ef7('0x2c')]};});_0x2b5f56[_0x8ef7('0x2d')]=_['map'](_0x466033,'name');_0x2b5f56['query']=_[_0x8ef7('0x2e')](_0x56dd64[_0x8ef7('0x2f')]);_0x2b5f56['filters']=_[_0x8ef7('0x30')](_0x2b5f56['model'],_0x2b5f56['query']);_0x3a3929[_0x8ef7('0x31')]=_[_0x8ef7('0x30')](_0x2b5f56[_0x8ef7('0x2d')],qs[_0x8ef7('0x32')](_0x56dd64[_0x8ef7('0x2f')][_0x8ef7('0x32')]));_0x3a3929['attributes']=_0x3a3929[_0x8ef7('0x31')][_0x8ef7('0x33')]?_0x3a3929[_0x8ef7('0x31')]:_0x2b5f56[_0x8ef7('0x2d')];if(!_0x56dd64[_0x8ef7('0x2f')]['hasOwnProperty'](_0x8ef7('0x34'))){_0x3a3929['limit']=qs['limit'](_0x56dd64[_0x8ef7('0x2f')][_0x8ef7('0x1c')]);_0x3a3929['offset']=qs[_0x8ef7('0x1a')](_0x56dd64[_0x8ef7('0x2f')][_0x8ef7('0x1a')]);}_0x3a3929[_0x8ef7('0x35')]=qs['sort'](_0x56dd64['query'][_0x8ef7('0x36')]);_0x3a3929[_0x8ef7('0x37')]=qs[_0x8ef7('0x38')](_[_0x8ef7('0x39')](_0x56dd64[_0x8ef7('0x2f')],_0x2b5f56[_0x8ef7('0x38')]),_0x466033);if(_0x56dd64[_0x8ef7('0x2f')]['filter']){_0x3a3929[_0x8ef7('0x37')]=_['merge'](_0x3a3929[_0x8ef7('0x37')],{'$or':_[_0x8ef7('0x3a')](_0x466033,function(_0x3d3d3c){if(_0x3d3d3c[_0x8ef7('0x3b')]!==_0x8ef7('0x3c')){var _0x18fffe={};_0x18fffe[_0x3d3d3c[_0x8ef7('0x27')]]={'$like':'%'+_0x56dd64['query'][_0x8ef7('0x3d')]+'%'};return _0x18fffe;}})});}_0x3a3929=_[_0x8ef7('0x3e')]({},_0x3a3929,_0x56dd64[_0x8ef7('0x3f')]);var _0x35a891={'where':_0x3a3929[_0x8ef7('0x37')]};return db['SquareRecording'][_0x8ef7('0x1d')](_0x35a891)[_0x8ef7('0x24')](function(_0x422142){_0x43d2fc[_0x8ef7('0x1d')]=_0x422142;if(_0x56dd64[_0x8ef7('0x2f')][_0x8ef7('0x40')]){_0x3a3929['include']=[{'all':!![]}];}return db['SquareRecording'][_0x8ef7('0x41')](_0x3a3929);})[_0x8ef7('0x24')](function(_0x5d5425){_0x43d2fc[_0x8ef7('0x42')]=_0x5d5425;return _0x43d2fc;})['then'](respondWithFilteredResult(_0x8cafcf,_0x3a3929))['catch'](handleError(_0x8cafcf,null));};exports[_0x8ef7('0x43')]=function(_0x1358c1,_0x2872a5){var _0xa9d86d={'raw':!![],'where':{'id':_0x1358c1[_0x8ef7('0x44')]['id']}},_0x2853dd={};_0x2853dd[_0x8ef7('0x2d')]=_['keys'](db[_0x8ef7('0x29')][_0x8ef7('0x2a')]);_0x2853dd[_0x8ef7('0x2f')]=_['keys'](_0x1358c1['query']);_0x2853dd[_0x8ef7('0x38')]=_[_0x8ef7('0x30')](_0x2853dd[_0x8ef7('0x2d')],_0x2853dd[_0x8ef7('0x2f')]);_0xa9d86d['attributes']=_['intersection'](_0x2853dd['model'],qs[_0x8ef7('0x32')](_0x1358c1[_0x8ef7('0x2f')]['fields']));_0xa9d86d[_0x8ef7('0x31')]=_0xa9d86d[_0x8ef7('0x31')][_0x8ef7('0x33')]?_0xa9d86d[_0x8ef7('0x31')]:_0x2853dd['model'];if(_0x1358c1['query'][_0x8ef7('0x40')]){_0xa9d86d[_0x8ef7('0x45')]=[{'all':!![]}];}_0xa9d86d=_['merge']({},_0xa9d86d,_0x1358c1[_0x8ef7('0x3f')]);return db[_0x8ef7('0x29')][_0x8ef7('0x46')](_0xa9d86d)['then'](handleEntityNotFound(_0x2872a5,null))[_0x8ef7('0x24')](respondWithResult(_0x2872a5,null))[_0x8ef7('0x47')](handleError(_0x2872a5,null));};exports[_0x8ef7('0x48')]=function(_0x15326c,_0x48dd86){return db[_0x8ef7('0x29')][_0x8ef7('0x48')](_0x15326c[_0x8ef7('0x49')],{})[_0x8ef7('0x24')](respondWithResult(_0x48dd86,0xc9))[_0x8ef7('0x47')](handleError(_0x48dd86,null));};exports[_0x8ef7('0x22')]=function(_0x5dbcbf,_0x2c519c){if(_0x5dbcbf['body']['id']){delete _0x5dbcbf[_0x8ef7('0x49')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x5dbcbf[_0x8ef7('0x44')]['id']}})[_0x8ef7('0x24')](handleEntityNotFound(_0x2c519c,null))[_0x8ef7('0x24')](saveUpdates(_0x5dbcbf[_0x8ef7('0x49')],null))[_0x8ef7('0x24')](respondWithResult(_0x2c519c,null))['catch'](handleError(_0x2c519c,null));};exports[_0x8ef7('0x4a')]=function(_0x28f19f,_0x588a32,_0x2d3ea0){var _0x27f08d=require(_0x8ef7('0x4b'));var _0x1081cc=![];var _0x2813cd={};if(_0x28f19f[_0x8ef7('0x2f')][_0x8ef7('0x3b')]&&_0x28f19f[_0x8ef7('0x2f')][_0x8ef7('0x3b')]===_0x8ef7('0x4c')){_0x2813cd['uniqueid']=_0x28f19f[_0x8ef7('0x44')]['id'];}else{_0x2813cd['id']=_0x28f19f[_0x8ef7('0x44')]['id'];}return db['SquareRecording'][_0x8ef7('0x46')]({'where':_0x2813cd,'attributes':['id',_0x8ef7('0x4d'),_0x8ef7('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x588a32,null))['then'](function(_0x39f966){if(_0x39f966){var _0x24a2ba=_0x39f966['savePath'];var _0x34a981=util[_0x8ef7('0x4f')](_0x8ef7('0x50'),_0x24a2ba);if(fs[_0x8ef7('0x51')](_0x34a981)){_0x1081cc=!![];return _0x27f08d[_0x8ef7('0x52')](_0x34a981,_0x24a2ba,config[_0x8ef7('0x53')][_0x8ef7('0x54')])[_0x8ef7('0x24')](function(){return _0x39f966;});}return _0x39f966;}})[_0x8ef7('0x24')](function(_0x5e4811){if(_0x5e4811){var _0x41f85e=_0x5e4811['savePath'];if(!fs[_0x8ef7('0x51')](_0x41f85e)){throw new db[(_0x8ef7('0x55'))][(_0x8ef7('0x56'))]('SquareRecording\x20not\x20found');}if(_0x5e4811[_0x8ef7('0x4e')]){return _0x588a32[_0x8ef7('0x4a')](_0x41f85e,_0x5e4811[_0x8ef7('0x4e')]+path[_0x8ef7('0x57')](_0x41f85e),function(){if(_0x1081cc){fs['unlink'](_0x41f85e);}});}else{return _0x588a32[_0x8ef7('0x4a')](_0x41f85e,function(_0x20ef3d){if(_0x1081cc){fs['unlink'](_0x41f85e);}});}}})['catch'](function(_0x3175b3){if(_0x3175b3['message']===_0x8ef7('0x58')){_0x588a32[_0x8ef7('0x18')](0x194)[_0x8ef7('0x59')](_0x8ef7('0x5a'));}else{return handleError(_0x588a32,null);}});};exports['destroy']=function(_0x5ee863,_0xac868a){return db[_0x8ef7('0x29')][_0x8ef7('0x46')]({'where':{'id':_0x5ee863[_0x8ef7('0x44')]['id']}})[_0x8ef7('0x24')](function(_0x1f1d02){if(_[_0x8ef7('0x5b')](_0x1f1d02)){throw new ReferenceError(_0x8ef7('0x5c'));}return _0x1f1d02;})['then'](function(_0x12a3b4){var _0x40a384=_0x12a3b4['savePath'];logger[_0x8ef7('0x5d')](_0x8ef7('0x5e'),_0x40a384);if(!_[_0x8ef7('0x5b')](_0x12a3b4[_0x8ef7('0x4d')])&&fs[_0x8ef7('0x51')](_0x40a384)){logger[_0x8ef7('0x5d')](_0x8ef7('0x5f')+_0x40a384+_0x8ef7('0x60'));fs[_0x8ef7('0x61')](_0x40a384);}_0x40a384=_0x40a384+_0x8ef7('0x62');if(!_[_0x8ef7('0x5b')](_0x12a3b4[_0x8ef7('0x4d')])&&fs['existsSync'](_0x40a384)){logger[_0x8ef7('0x5d')]('File:\x20\x22'+_0x40a384+_0x8ef7('0x60'));fs[_0x8ef7('0x61')](_0x40a384);}return _0x12a3b4;})['then'](function(_0x50a725){if(!_0x50a725)throw new InternalError();return _0x50a725['destroy']();})[_0x8ef7('0x24')](function(){_0xac868a[_0x8ef7('0x18')](0xcc)[_0x8ef7('0x63')]();})[_0x8ef7('0x47')](handleError(_0xac868a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e0ef8fa..caab411 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 _0x5d58=['request-promise','rimraf','../../config/environment','exports','define','square_recordings','bluebird'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x5d58,0x187));var _0x85d5=function(_0x41fc73,_0x7cb3c5){_0x41fc73=_0x41fc73-0x0;var _0x10d8eb=_0x5d58[_0x41fc73];return _0x10d8eb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./squareRecording.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('SquareRecording',attributes,{'tableName':_0x85d5('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50e5=['square_recordings','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x1d4d9b,_0x10eee9){var _0x2a91af=function(_0x4c15f7){while(--_0x4c15f7){_0x1d4d9b['push'](_0x1d4d9b['shift']());}};_0x2a91af(++_0x10eee9);}(_0x50e5,0xb7));var _0x550e=function(_0xdc2f49,_0x442faf){_0xdc2f49=_0xdc2f49-0x0;var _0x55d7e5=_0x50e5[_0xdc2f49];return _0x55d7e5;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var logger=require('../../config/logger')(_0x550e('0x2'));var moment=require(_0x550e('0x3'));var BPromise=require(_0x550e('0x4'));var rp=require(_0x550e('0x5'));var fs=require('fs');var path=require(_0x550e('0x6'));var rimraf=require(_0x550e('0x7'));var config=require(_0x550e('0x8'));var attributes=require(_0x550e('0x9'));module[_0x550e('0xa')]=function(_0x3d8c9b,_0x863e3b){return _0x3d8c9b[_0x550e('0xb')]('SquareRecording',attributes,{'tableName':_0x550e('0xc'),'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 502b369..98ad3e9 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 _0xf494=['http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ca31c,_0x3810a6){var _0x503b0f=function(_0x30431d){while(--_0x30431d){_0x4ca31c['push'](_0x4ca31c['shift']());}};_0x503b0f(++_0x3810a6);}(_0xf494,0x13e));var _0x4f49=function(_0x2ec2d4,_0x2c73f9){_0x2ec2d4=_0x2ec2d4-0x0;var _0x5c35c4=_0xf494[_0x2ec2d4];return _0x5c35c4;};'use strict';var _=require(_0x4f49('0x0'));var util=require('util');var moment=require(_0x4f49('0x1'));var BPromise=require(_0x4f49('0x2'));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(_0x5091df,_0x4bb472,_0x2d20c7){return new BPromise(function(_0x422f54,_0x10c8b4){return client[_0x4f49('0xd')](_0x5091df,_0x2d20c7)[_0x4f49('0xe')](function(_0x29d472){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x4bb472,'request\x20sent');logger[_0x4f49('0x11')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4bb472,'request\x20sent',JSON[_0x4f49('0x12')](_0x29d472));if(_0x29d472['error']){if(_0x29d472[_0x4f49('0x13')]['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x4bb472,_0x29d472[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x10c8b4(_0x29d472['error'][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x4bb472,_0x29d472['error']['message']);return _0x422f54(_0x29d472[_0x4f49('0x13')][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x4bb472,_0x4f49('0x15'));_0x422f54(_0x29d472[_0x4f49('0x16')][_0x4f49('0x14')]);}})[_0x4f49('0x17')](function(_0x98c37d){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x4bb472,_0x98c37d);_0x10c8b4(_0x98c37d);});});}exports[_0x4f49('0x18')]=function(_0x1789d4){var _0x31f16c=this;return new Promise(function(_0x3a44b7,_0x1729de){return db[_0x4f49('0x19')][_0x4f49('0x1a')](_0x1789d4[_0x4f49('0x1b')],{'raw':_0x1789d4[_0x4f49('0x1c')]?_0x1789d4[_0x4f49('0x1c')][_0x4f49('0x1d')]===undefined?!![]:![]:!![]})[_0x4f49('0xe')](function(_0x30ee72){logger['info']('CreateSquareRecording',_0x1789d4);logger[_0x4f49('0x11')]('CreateSquareRecording',_0x1789d4,JSON['stringify'](_0x30ee72));_0x3a44b7(_0x30ee72);})[_0x4f49('0x17')](function(_0x2fed56){logger['error'](_0x4f49('0x18'),_0x2fed56['message'],_0x1789d4);_0x1729de(_0x31f16c[_0x4f49('0x13')](0x1f4,_0x2fed56['message']));});});}; \ No newline at end of file +var _0xf313=['message','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x41e74d,_0x1968fa){var _0x47c712=function(_0x595225){while(--_0x595225){_0x41e74d['push'](_0x41e74d['shift']());}};_0x47c712(++_0x1968fa);}(_0xf313,0x134));var _0x3f31=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf313[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x3f31('0x0'));var util=require(_0x3f31('0x1'));var moment=require(_0x3f31('0x2'));var BPromise=require(_0x3f31('0x3'));var rs=require(_0x3f31('0x4'));var fs=require('fs');var Redis=require(_0x3f31('0x5'));var db=require(_0x3f31('0x6'))['db'];var utils=require(_0x3f31('0x7'));var logger=require(_0x3f31('0x8'))(_0x3f31('0x9'));var config=require(_0x3f31('0xa'));var jayson=require(_0x3f31('0xb'));var client=jayson[_0x3f31('0xc')][_0x3f31('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5dee6f,_0x1f9e55,_0x5b1f5f){return new BPromise(function(_0x5d2768,_0x1f4a1f){return client[_0x3f31('0xe')](_0x5dee6f,_0x5b1f5f)['then'](function(_0x635a4d){logger[_0x3f31('0xf')](_0x3f31('0x10'),_0x1f9e55,_0x3f31('0x11'));logger[_0x3f31('0x12')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1f9e55,'request\x20sent',JSON[_0x3f31('0x13')](_0x635a4d));if(_0x635a4d[_0x3f31('0x14')]){if(_0x635a4d[_0x3f31('0x14')][_0x3f31('0x15')]===0x1f4){logger[_0x3f31('0x14')]('SquareRecording,\x20%s,\x20%s',_0x1f9e55,_0x635a4d['error'][_0x3f31('0x16')]);return _0x1f4a1f(_0x635a4d[_0x3f31('0x14')]['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x1f9e55,_0x635a4d[_0x3f31('0x14')][_0x3f31('0x16')]);return _0x5d2768(_0x635a4d[_0x3f31('0x14')][_0x3f31('0x16')]);}else{logger[_0x3f31('0xf')](_0x3f31('0x10'),_0x1f9e55,_0x3f31('0x11'));_0x5d2768(_0x635a4d['result']['message']);}})['catch'](function(_0x3b1556){logger[_0x3f31('0x14')](_0x3f31('0x10'),_0x1f9e55,_0x3b1556);_0x1f4a1f(_0x3b1556);});});}exports[_0x3f31('0x17')]=function(_0x5157ef){var _0x2a766f=this;return new Promise(function(_0x59de0f,_0x126ea9){return db[_0x3f31('0x18')][_0x3f31('0x19')](_0x5157ef[_0x3f31('0x1a')],{'raw':_0x5157ef[_0x3f31('0x1b')]?_0x5157ef['options'][_0x3f31('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5cb22f){logger[_0x3f31('0xf')](_0x3f31('0x17'),_0x5157ef);logger['debug'](_0x3f31('0x17'),_0x5157ef,JSON[_0x3f31('0x13')](_0x5cb22f));_0x59de0f(_0x5cb22f);})[_0x3f31('0x1d')](function(_0x2d9704){logger[_0x3f31('0x14')](_0x3f31('0x17'),_0x2d9704['message'],_0x5157ef);_0x126ea9(_0x2a766f[_0x3f31('0x14')](0x1f4,_0x2d9704[_0x3f31('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 2daa5fd..a66b7e5 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _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(_0x1fa543,_0x2f6c01){var _0x9e1d1b=function(_0x4efe1f){while(--_0x4efe1f){_0x1fa543['push'](_0x1fa543['shift']());}};_0x9e1d1b(++_0x2f6c01);}(_0xe706,0xa3));var _0x6e70=function(_0x4c76ad,_0x24bdab){_0x4c76ad=_0x4c76ad-0x0;var _0xde0a18=_0xe706[_0x4c76ad];return _0xde0a18;};'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 0ea7440..2978ed2 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 _0x3e94=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0xb509e5,_0x5a7f48){var _0x16a111=function(_0x8d8366){while(--_0x8d8366){_0xb509e5['push'](_0xb509e5['shift']());}};_0x16a111(++_0x5a7f48);}(_0x3e94,0x99));var _0x43e9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3e94[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x43e9('0x0'));module[_0x43e9('0x1')]={'network':{'type':Sequelize[_0x43e9('0x2')]},'network_script':{'type':Sequelize[_0x43e9('0x2')]},'request':{'type':Sequelize[_0x43e9('0x2')]},'channel':{'type':Sequelize[_0x43e9('0x2')]},'language':{'type':Sequelize[_0x43e9('0x2')]},'type':{'type':Sequelize[_0x43e9('0x2')]},'uniqueid':{'type':Sequelize[_0x43e9('0x2')]},'version':{'type':Sequelize[_0x43e9('0x2')]},'callerid':{'type':Sequelize[_0x43e9('0x2')]},'calleridname':{'type':Sequelize[_0x43e9('0x2')]},'callingpres':{'type':Sequelize[_0x43e9('0x2')]},'callingani2':{'type':Sequelize[_0x43e9('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x43e9('0x2')]},'rdnis':{'type':Sequelize[_0x43e9('0x2')]},'context':{'type':Sequelize[_0x43e9('0x2')]},'extension':{'type':Sequelize[_0x43e9('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x43e9('0x2')]},'accountcode':{'type':Sequelize[_0x43e9('0x2')]},'threadid':{'type':Sequelize[_0x43e9('0x2')]},'project_name':{'type':Sequelize[_0x43e9('0x2')]},'joinAt':{'type':Sequelize[_0x43e9('0x3')]},'leaveAt':{'type':Sequelize[_0x43e9('0x3')]},'bot':{'type':Sequelize[_0x43e9('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x514d=['exports','STRING','DATE','sequelize'];(function(_0x71b5b1,_0x34353c){var _0x5abe46=function(_0x3228c9){while(--_0x3228c9){_0x71b5b1['push'](_0x71b5b1['shift']());}};_0x5abe46(++_0x34353c);}(_0x514d,0x1e3));var _0xd514=function(_0x4472cd,_0x1c836d){_0x4472cd=_0x4472cd-0x0;var _0x3d2b15=_0x514d[_0x4472cd];return _0x3d2b15;};'use strict';var Sequelize=require(_0xd514('0x0'));module[_0xd514('0x1')]={'network':{'type':Sequelize[_0xd514('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xd514('0x2')]},'channel':{'type':Sequelize[_0xd514('0x2')]},'language':{'type':Sequelize[_0xd514('0x2')]},'type':{'type':Sequelize[_0xd514('0x2')]},'uniqueid':{'type':Sequelize[_0xd514('0x2')]},'version':{'type':Sequelize[_0xd514('0x2')]},'callerid':{'type':Sequelize[_0xd514('0x2')]},'calleridname':{'type':Sequelize[_0xd514('0x2')]},'callingpres':{'type':Sequelize[_0xd514('0x2')]},'callingani2':{'type':Sequelize[_0xd514('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xd514('0x2')]},'dnid':{'type':Sequelize[_0xd514('0x2')]},'rdnis':{'type':Sequelize[_0xd514('0x2')]},'context':{'type':Sequelize[_0xd514('0x2')]},'extension':{'type':Sequelize[_0xd514('0x2')]},'priority':{'type':Sequelize[_0xd514('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd514('0x3')]},'leaveAt':{'type':Sequelize[_0xd514('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 b603c4f..95b9378 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 _0xe7b8=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','then','end','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x3f0646,_0x367112){var _0x1b5ffe=function(_0x22ed7d){while(--_0x22ed7d){_0x3f0646['push'](_0x3f0646['shift']());}};_0x1b5ffe(++_0x367112);}(_0xe7b8,0xda));var _0x8e7b=function(_0x5aa605,_0x871096){_0x5aa605=_0x5aa605-0x0;var _0x3fa635=_0xe7b8[_0x5aa605];return _0x3fa635;};'use strict';var emlformat=require(_0x8e7b('0x0'));var rimraf=require(_0x8e7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e7b('0x2'));var rp=require(_0x8e7b('0x3'));var moment=require(_0x8e7b('0x4'));var BPromise=require(_0x8e7b('0x5'));var Mustache=require(_0x8e7b('0x6'));var util=require(_0x8e7b('0x7'));var path=require(_0x8e7b('0x8'));var sox=require(_0x8e7b('0x9'));var csv=require(_0x8e7b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e7b('0xb'));var _=require(_0x8e7b('0xc'));var squel=require(_0x8e7b('0xd'));var crypto=require(_0x8e7b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8e7b('0xf'));var toCsv=require(_0x8e7b('0xa'));var querystring=require(_0x8e7b('0x10'));var Papa=require(_0x8e7b('0x11'));var Redis=require(_0x8e7b('0x12'));var authService=require(_0x8e7b('0x13'));var qs=require(_0x8e7b('0x14'));var as=require(_0x8e7b('0x15'));var hardwareService=require(_0x8e7b('0x16'));var logger=require('../../config/logger')(_0x8e7b('0x17'));var utils=require(_0x8e7b('0x18'));var config=require(_0x8e7b('0x19'));var licenseUtil=require(_0x8e7b('0x1a'));var db=require(_0x8e7b('0x1b'))['db'];function respondWithStatusCode(_0x689437,_0x84774a){_0x84774a=_0x84774a||0xcc;return function(_0x5b7df4){if(_0x5b7df4){return _0x689437[_0x8e7b('0x1c')](_0x84774a);}return _0x689437[_0x8e7b('0x1d')](_0x84774a)['end']();};}function respondWithResult(_0x2dfc84,_0x28e221){_0x28e221=_0x28e221||0xc8;return function(_0x38a09f){if(_0x38a09f){return _0x2dfc84['status'](_0x28e221)['json'](_0x38a09f);}};}function respondWithFilteredResult(_0x117650,_0x5b9ec4){return function(_0xc3fe39){if(_0xc3fe39){var _0x130f96=typeof _0x5b9ec4[_0x8e7b('0x1e')]===_0x8e7b('0x1f')&&typeof _0x5b9ec4[_0x8e7b('0x20')]===_0x8e7b('0x1f');var _0x58306a=_0xc3fe39[_0x8e7b('0x21')];var _0x14b627=_0x130f96?0x0:_0x5b9ec4[_0x8e7b('0x1e')];var _0x5270a7=_0x130f96?_0xc3fe39['count']:_0x5b9ec4[_0x8e7b('0x1e')]+_0x5b9ec4[_0x8e7b('0x20')];var _0x1aa627;if(_0x5270a7>=_0x58306a){_0x5270a7=_0x58306a;_0x1aa627=0xc8;}else{_0x1aa627=0xce;}_0x117650[_0x8e7b('0x1d')](_0x1aa627);return _0x117650[_0x8e7b('0x22')]('Content-Range',_0x14b627+'-'+_0x5270a7+'/'+_0x58306a)[_0x8e7b('0x23')](_0xc3fe39);}return null;};}function patchUpdates(_0x1d3ba2){return function(_0xa2ddab){try{jsonpatch[_0x8e7b('0x24')](_0xa2ddab,_0x1d3ba2,!![]);}catch(_0x2ab119){return BPromise[_0x8e7b('0x25')](_0x2ab119);}return _0xa2ddab['save']();};}function saveUpdates(_0x34f194,_0x53fada){return function(_0x868cdf){if(_0x868cdf){return _0x868cdf[_0x8e7b('0x26')](_0x34f194)[_0x8e7b('0x27')](function(_0x45227e){return _0x45227e;});}return null;};}function removeEntity(_0x412fb3,_0x3ab593){return function(_0x107205){if(_0x107205){return _0x107205['destroy']()['then'](function(){_0x412fb3[_0x8e7b('0x1d')](0xcc)[_0x8e7b('0x28')]();});}};}function handleEntityNotFound(_0x115963,_0x4d3380){return function(_0x578b06){if(!_0x578b06){_0x115963['sendStatus'](0x194);}return _0x578b06;};}function handleError(_0x3fdc18,_0x4003cf){_0x4003cf=_0x4003cf||0x1f4;return function(_0x452868){logger['error'](_0x452868['stack']);if(_0x452868['name']){delete _0x452868[_0x8e7b('0x29')];}_0x3fdc18[_0x8e7b('0x1d')](_0x4003cf)['send'](_0x452868);};}exports['index']=function(_0x30bfd2,_0xd32921){var _0xbca6e1={},_0x338d79={},_0x3830c4={'count':0x0,'rows':[]};var _0x1f5afa=_[_0x8e7b('0x2a')](db['SquareReport'][_0x8e7b('0x2b')],function(_0x4132b5){return{'name':_0x4132b5[_0x8e7b('0x2c')],'type':_0x4132b5[_0x8e7b('0x2d')][_0x8e7b('0x2e')]};});_0x338d79['model']=_[_0x8e7b('0x2a')](_0x1f5afa,_0x8e7b('0x29'));_0x338d79[_0x8e7b('0x2f')]=_[_0x8e7b('0x30')](_0x30bfd2['query']);_0x338d79[_0x8e7b('0x31')]=_[_0x8e7b('0x32')](_0x338d79[_0x8e7b('0x33')],_0x338d79[_0x8e7b('0x2f')]);_0xbca6e1['attributes']=_['intersection'](_0x338d79[_0x8e7b('0x33')],qs['fields'](_0x30bfd2[_0x8e7b('0x2f')][_0x8e7b('0x34')]));_0xbca6e1[_0x8e7b('0x35')]=_0xbca6e1[_0x8e7b('0x35')][_0x8e7b('0x36')]?_0xbca6e1[_0x8e7b('0x35')]:_0x338d79[_0x8e7b('0x33')];if(!_0x30bfd2[_0x8e7b('0x2f')][_0x8e7b('0x37')](_0x8e7b('0x38'))){_0xbca6e1[_0x8e7b('0x20')]=qs[_0x8e7b('0x20')](_0x30bfd2[_0x8e7b('0x2f')][_0x8e7b('0x20')]);_0xbca6e1[_0x8e7b('0x1e')]=qs[_0x8e7b('0x1e')](_0x30bfd2[_0x8e7b('0x2f')]['offset']);}_0xbca6e1[_0x8e7b('0x39')]=qs[_0x8e7b('0x3a')](_0x30bfd2[_0x8e7b('0x2f')][_0x8e7b('0x3a')]);_0xbca6e1[_0x8e7b('0x3b')]=qs[_0x8e7b('0x31')](_[_0x8e7b('0x3c')](_0x30bfd2[_0x8e7b('0x2f')],_0x338d79[_0x8e7b('0x31')]),_0x1f5afa);if(_0x30bfd2[_0x8e7b('0x2f')][_0x8e7b('0x3d')]){_0xbca6e1['where']=_[_0x8e7b('0x3e')](_0xbca6e1['where'],{'$or':_[_0x8e7b('0x2a')](_0x1f5afa,function(_0x56f971){if(_0x56f971[_0x8e7b('0x2d')]!==_0x8e7b('0x3f')){var _0x2206cb={};_0x2206cb[_0x56f971[_0x8e7b('0x29')]]={'$like':'%'+_0x30bfd2[_0x8e7b('0x2f')]['filter']+'%'};return _0x2206cb;}})});}_0xbca6e1=_[_0x8e7b('0x3e')]({},_0xbca6e1,_0x30bfd2[_0x8e7b('0x40')]);var _0x1fe3c6={'where':_0xbca6e1[_0x8e7b('0x3b')]};return db[_0x8e7b('0x41')][_0x8e7b('0x21')](_0x1fe3c6)['then'](function(_0x598cbe){_0x3830c4[_0x8e7b('0x21')]=_0x598cbe;if(_0x30bfd2[_0x8e7b('0x2f')][_0x8e7b('0x42')]){_0xbca6e1[_0x8e7b('0x43')]=[{'all':!![]}];}return db[_0x8e7b('0x41')][_0x8e7b('0x44')](_0xbca6e1);})['then'](function(_0x5e15e5){_0x3830c4[_0x8e7b('0x45')]=_0x5e15e5;return _0x3830c4;})[_0x8e7b('0x27')](respondWithFilteredResult(_0xd32921,_0xbca6e1))[_0x8e7b('0x46')](handleError(_0xd32921,null));};exports['show']=function(_0x3c704b,_0x4a394a){var _0x46a016={'raw':!![],'where':{'id':_0x3c704b[_0x8e7b('0x47')]['id']}},_0x574dc7={};_0x574dc7[_0x8e7b('0x33')]=_[_0x8e7b('0x30')](db[_0x8e7b('0x41')][_0x8e7b('0x2b')]);_0x574dc7[_0x8e7b('0x2f')]=_[_0x8e7b('0x30')](_0x3c704b[_0x8e7b('0x2f')]);_0x574dc7['filters']=_[_0x8e7b('0x32')](_0x574dc7[_0x8e7b('0x33')],_0x574dc7[_0x8e7b('0x2f')]);_0x46a016[_0x8e7b('0x35')]=_[_0x8e7b('0x32')](_0x574dc7['model'],qs[_0x8e7b('0x34')](_0x3c704b[_0x8e7b('0x2f')][_0x8e7b('0x34')]));_0x46a016[_0x8e7b('0x35')]=_0x46a016['attributes'][_0x8e7b('0x36')]?_0x46a016[_0x8e7b('0x35')]:_0x574dc7['model'];if(_0x3c704b[_0x8e7b('0x2f')][_0x8e7b('0x42')]){_0x46a016[_0x8e7b('0x43')]=[{'all':!![]}];}_0x46a016=_[_0x8e7b('0x3e')]({},_0x46a016,_0x3c704b[_0x8e7b('0x40')]);return db[_0x8e7b('0x41')][_0x8e7b('0x48')](_0x46a016)[_0x8e7b('0x27')](handleEntityNotFound(_0x4a394a,null))['then'](respondWithResult(_0x4a394a,null))[_0x8e7b('0x46')](handleError(_0x4a394a,null));};exports[_0x8e7b('0x49')]=function(_0xfafa4e,_0x58d5e4){return db['SquareReport']['create'](_0xfafa4e[_0x8e7b('0x4a')],{})[_0x8e7b('0x27')](respondWithResult(_0x58d5e4,0xc9))[_0x8e7b('0x46')](handleError(_0x58d5e4,null));};exports[_0x8e7b('0x26')]=function(_0x9c614f,_0x1e0926){if(_0x9c614f['body']['id']){delete _0x9c614f[_0x8e7b('0x4a')]['id'];}return db[_0x8e7b('0x41')][_0x8e7b('0x48')]({'where':{'id':_0x9c614f[_0x8e7b('0x47')]['id']}})[_0x8e7b('0x27')](handleEntityNotFound(_0x1e0926,null))[_0x8e7b('0x27')](saveUpdates(_0x9c614f[_0x8e7b('0x4a')],null))['then'](respondWithResult(_0x1e0926,null))[_0x8e7b('0x46')](handleError(_0x1e0926,null));};exports[_0x8e7b('0x4b')]=function(_0x44b6c6,_0x55bc51){return db[_0x8e7b('0x41')]['find']({'where':{'id':_0x44b6c6['params']['id']}})[_0x8e7b('0x27')](handleEntityNotFound(_0x55bc51,null))[_0x8e7b('0x27')](removeEntity(_0x55bc51,null))['catch'](handleError(_0x55bc51,null));};exports[_0x8e7b('0x4c')]=function(_0x40786f,_0x35c1fb){return db[_0x8e7b('0x41')][_0x8e7b('0x4c')]()['then'](respondWithResult(_0x35c1fb,null))['catch'](handleError(_0x35c1fb,null));}; \ No newline at end of file +var _0x26f4=['intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x181714,_0x12caad){var _0x361646=function(_0x4d094a){while(--_0x4d094a){_0x181714['push'](_0x181714['shift']());}};_0x361646(++_0x12caad);}(_0x26f4,0xb5));var _0x426f=function(_0x47c40d,_0x1a33ff){_0x47c40d=_0x47c40d-0x0;var _0xe9a301=_0x26f4[_0x47c40d];return _0xe9a301;};'use strict';var emlformat=require(_0x426f('0x0'));var rimraf=require(_0x426f('0x1'));var zipdir=require(_0x426f('0x2'));var jsonpatch=require(_0x426f('0x3'));var rp=require('request-promise');var moment=require(_0x426f('0x4'));var BPromise=require(_0x426f('0x5'));var Mustache=require(_0x426f('0x6'));var util=require(_0x426f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x426f('0x8'));var ejs=require(_0x426f('0x9'));var fs=require('fs');var fs_extra=require(_0x426f('0xa'));var _=require(_0x426f('0xb'));var squel=require(_0x426f('0xc'));var crypto=require(_0x426f('0xd'));var jsforce=require(_0x426f('0xe'));var deskjs=require(_0x426f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x426f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x426f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x426f('0x12'));var logger=require(_0x426f('0x13'))(_0x426f('0x14'));var utils=require(_0x426f('0x15'));var config=require(_0x426f('0x16'));var licenseUtil=require(_0x426f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xadc7d1,_0x4f7001){_0x4f7001=_0x4f7001||0xcc;return function(_0x3796eb){if(_0x3796eb){return _0xadc7d1[_0x426f('0x18')](_0x4f7001);}return _0xadc7d1['status'](_0x4f7001)['end']();};}function respondWithResult(_0x58ff3c,_0x19931f){_0x19931f=_0x19931f||0xc8;return function(_0x355a88){if(_0x355a88){return _0x58ff3c[_0x426f('0x19')](_0x19931f)['json'](_0x355a88);}};}function respondWithFilteredResult(_0x41f426,_0xe8022c){return function(_0x599e49){if(_0x599e49){var _0x4b942a=typeof _0xe8022c['offset']==='undefined'&&typeof _0xe8022c[_0x426f('0x1a')]===_0x426f('0x1b');var _0x4d37a8=_0x599e49[_0x426f('0x1c')];var _0x516498=_0x4b942a?0x0:_0xe8022c[_0x426f('0x1d')];var _0x24430d=_0x4b942a?_0x599e49[_0x426f('0x1c')]:_0xe8022c[_0x426f('0x1d')]+_0xe8022c[_0x426f('0x1a')];var _0x363fff;if(_0x24430d>=_0x4d37a8){_0x24430d=_0x4d37a8;_0x363fff=0xc8;}else{_0x363fff=0xce;}_0x41f426['status'](_0x363fff);return _0x41f426[_0x426f('0x1e')](_0x426f('0x1f'),_0x516498+'-'+_0x24430d+'/'+_0x4d37a8)[_0x426f('0x20')](_0x599e49);}return null;};}function patchUpdates(_0x8e8586){return function(_0x26f08c){try{jsonpatch[_0x426f('0x21')](_0x26f08c,_0x8e8586,!![]);}catch(_0x2aede3){return BPromise[_0x426f('0x22')](_0x2aede3);}return _0x26f08c[_0x426f('0x23')]();};}function saveUpdates(_0x4c0b92,_0x5aadd3){return function(_0x2fa02f){if(_0x2fa02f){return _0x2fa02f[_0x426f('0x24')](_0x4c0b92)[_0x426f('0x25')](function(_0x3dd46a){return _0x3dd46a;});}return null;};}function removeEntity(_0x4d836f,_0x103cfb){return function(_0x596ace){if(_0x596ace){return _0x596ace[_0x426f('0x26')]()[_0x426f('0x25')](function(){_0x4d836f['status'](0xcc)[_0x426f('0x27')]();});}};}function handleEntityNotFound(_0x443ade,_0x49f02b){return function(_0xd7d7c){if(!_0xd7d7c){_0x443ade[_0x426f('0x18')](0x194);}return _0xd7d7c;};}function handleError(_0xc14f58,_0x324b87){_0x324b87=_0x324b87||0x1f4;return function(_0x50579d){logger[_0x426f('0x28')](_0x50579d[_0x426f('0x29')]);if(_0x50579d[_0x426f('0x2a')]){delete _0x50579d[_0x426f('0x2a')];}_0xc14f58['status'](_0x324b87)[_0x426f('0x2b')](_0x50579d);};}exports[_0x426f('0x2c')]=function(_0x206ee1,_0x60c147){var _0x32cf8d={},_0xa7eba4={},_0x300492={'count':0x0,'rows':[]};var _0x3a55e3=_[_0x426f('0x2d')](db[_0x426f('0x2e')][_0x426f('0x2f')],function(_0x433846){return{'name':_0x433846[_0x426f('0x30')],'type':_0x433846['type'][_0x426f('0x31')]};});_0xa7eba4['model']=_[_0x426f('0x2d')](_0x3a55e3,_0x426f('0x2a'));_0xa7eba4['query']=_[_0x426f('0x32')](_0x206ee1[_0x426f('0x33')]);_0xa7eba4[_0x426f('0x34')]=_[_0x426f('0x35')](_0xa7eba4[_0x426f('0x36')],_0xa7eba4[_0x426f('0x33')]);_0x32cf8d['attributes']=_['intersection'](_0xa7eba4[_0x426f('0x36')],qs['fields'](_0x206ee1[_0x426f('0x33')][_0x426f('0x37')]));_0x32cf8d['attributes']=_0x32cf8d['attributes']['length']?_0x32cf8d[_0x426f('0x38')]:_0xa7eba4[_0x426f('0x36')];if(!_0x206ee1[_0x426f('0x33')][_0x426f('0x39')](_0x426f('0x3a'))){_0x32cf8d[_0x426f('0x1a')]=qs['limit'](_0x206ee1[_0x426f('0x33')][_0x426f('0x1a')]);_0x32cf8d[_0x426f('0x1d')]=qs[_0x426f('0x1d')](_0x206ee1['query'][_0x426f('0x1d')]);}_0x32cf8d[_0x426f('0x3b')]=qs['sort'](_0x206ee1['query'][_0x426f('0x3c')]);_0x32cf8d[_0x426f('0x3d')]=qs[_0x426f('0x34')](_[_0x426f('0x3e')](_0x206ee1[_0x426f('0x33')],_0xa7eba4[_0x426f('0x34')]),_0x3a55e3);if(_0x206ee1[_0x426f('0x33')][_0x426f('0x3f')]){_0x32cf8d['where']=_[_0x426f('0x40')](_0x32cf8d[_0x426f('0x3d')],{'$or':_[_0x426f('0x2d')](_0x3a55e3,function(_0x29b373){if(_0x29b373[_0x426f('0x41')]!==_0x426f('0x42')){var _0x22de82={};_0x22de82[_0x29b373[_0x426f('0x2a')]]={'$like':'%'+_0x206ee1[_0x426f('0x33')][_0x426f('0x3f')]+'%'};return _0x22de82;}})});}_0x32cf8d=_[_0x426f('0x40')]({},_0x32cf8d,_0x206ee1[_0x426f('0x43')]);var _0x1f144e={'where':_0x32cf8d['where']};return db[_0x426f('0x2e')][_0x426f('0x1c')](_0x1f144e)['then'](function(_0x1328a0){_0x300492['count']=_0x1328a0;if(_0x206ee1[_0x426f('0x33')][_0x426f('0x44')]){_0x32cf8d[_0x426f('0x45')]=[{'all':!![]}];}return db[_0x426f('0x2e')][_0x426f('0x46')](_0x32cf8d);})[_0x426f('0x25')](function(_0x15351e){_0x300492[_0x426f('0x47')]=_0x15351e;return _0x300492;})[_0x426f('0x25')](respondWithFilteredResult(_0x60c147,_0x32cf8d))[_0x426f('0x48')](handleError(_0x60c147,null));};exports['show']=function(_0x115f97,_0x37d7a7){var _0x190210={'raw':!![],'where':{'id':_0x115f97[_0x426f('0x49')]['id']}},_0x435eb8={};_0x435eb8[_0x426f('0x36')]=_[_0x426f('0x32')](db['SquareReport'][_0x426f('0x2f')]);_0x435eb8[_0x426f('0x33')]=_[_0x426f('0x32')](_0x115f97[_0x426f('0x33')]);_0x435eb8[_0x426f('0x34')]=_[_0x426f('0x35')](_0x435eb8[_0x426f('0x36')],_0x435eb8[_0x426f('0x33')]);_0x190210[_0x426f('0x38')]=_[_0x426f('0x35')](_0x435eb8['model'],qs['fields'](_0x115f97[_0x426f('0x33')][_0x426f('0x37')]));_0x190210[_0x426f('0x38')]=_0x190210[_0x426f('0x38')]['length']?_0x190210[_0x426f('0x38')]:_0x435eb8[_0x426f('0x36')];if(_0x115f97[_0x426f('0x33')]['includeAll']){_0x190210['include']=[{'all':!![]}];}_0x190210=_[_0x426f('0x40')]({},_0x190210,_0x115f97['options']);return db['SquareReport']['find'](_0x190210)[_0x426f('0x25')](handleEntityNotFound(_0x37d7a7,null))[_0x426f('0x25')](respondWithResult(_0x37d7a7,null))[_0x426f('0x48')](handleError(_0x37d7a7,null));};exports[_0x426f('0x4a')]=function(_0x4b7de0,_0x197ada){return db[_0x426f('0x2e')][_0x426f('0x4a')](_0x4b7de0[_0x426f('0x4b')],{})[_0x426f('0x25')](respondWithResult(_0x197ada,0xc9))[_0x426f('0x48')](handleError(_0x197ada,null));};exports[_0x426f('0x24')]=function(_0x4da525,_0x588914){if(_0x4da525[_0x426f('0x4b')]['id']){delete _0x4da525[_0x426f('0x4b')]['id'];}return db[_0x426f('0x2e')][_0x426f('0x4c')]({'where':{'id':_0x4da525[_0x426f('0x49')]['id']}})[_0x426f('0x25')](handleEntityNotFound(_0x588914,null))[_0x426f('0x25')](saveUpdates(_0x4da525['body'],null))[_0x426f('0x25')](respondWithResult(_0x588914,null))[_0x426f('0x48')](handleError(_0x588914,null));};exports[_0x426f('0x26')]=function(_0x22cbc0,_0x181044){return db['SquareReport'][_0x426f('0x4c')]({'where':{'id':_0x22cbc0['params']['id']}})['then'](handleEntityNotFound(_0x181044,null))[_0x426f('0x25')](removeEntity(_0x181044,null))[_0x426f('0x48')](handleError(_0x181044,null));};exports[_0x426f('0x4d')]=function(_0xf2c461,_0x1b4074){return db[_0x426f('0x2e')]['describe']()[_0x426f('0x25')](respondWithResult(_0x1b4074,null))['catch'](handleError(_0x1b4074,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5da684f..4c46184 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 _0xd1c2=['lodash','../../config/logger','api','moment','rimraf','../../config/environment','./squareReport.attributes','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x46e7da,_0xe066cc){var _0xb30d53=function(_0x437e8c){while(--_0x437e8c){_0x46e7da['push'](_0x46e7da['shift']());}};_0xb30d53(++_0xe066cc);}(_0xd1c2,0xa8));var _0x2d1c=function(_0x519714,_0x4fc507){_0x519714=_0x519714-0x0;var _0x4bc00d=_0xd1c2[_0x519714];return _0x4bc00d;};'use strict';var _=require(_0x2d1c('0x0'));var util=require('util');var logger=require(_0x2d1c('0x1'))(_0x2d1c('0x2'));var moment=require(_0x2d1c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2d1c('0x4'));var config=require(_0x2d1c('0x5'));var attributes=require(_0x2d1c('0x6'));module['exports']=function(_0x581cd9,_0x45bf06){return _0x581cd9['define'](_0x2d1c('0x7'),attributes,{'tableName':_0x2d1c('0x8'),'paranoid':![],'indexes':[{'name':_0x2d1c('0x9'),'fields':[_0x2d1c('0xa'),_0x2d1c('0xb')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x684b=['request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','uid_pname','project_name','lodash','util','../../config/logger'];(function(_0x2e8d62,_0x1b4c25){var _0x3563ce=function(_0x22bfce){while(--_0x22bfce){_0x2e8d62['push'](_0x2e8d62['shift']());}};_0x3563ce(++_0x1b4c25);}(_0x684b,0x189));var _0xb684=function(_0x5b42b7,_0x293d9f){_0x5b42b7=_0x5b42b7-0x0;var _0x268e7c=_0x684b[_0x5b42b7];return _0x268e7c;};'use strict';var _=require(_0xb684('0x0'));var util=require(_0xb684('0x1'));var logger=require(_0xb684('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb684('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb684('0x4'));var config=require(_0xb684('0x5'));var attributes=require(_0xb684('0x6'));module[_0xb684('0x7')]=function(_0x142dce,_0x3cf2cd){return _0x142dce[_0xb684('0x8')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xb684('0x9'),'fields':['uniqueid',_0xb684('0xa')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 81f185e..56f070e 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 _0x85ee=['../../config/logger','rpc','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareReport','create','body','options','raw','stringify','where','attributes','limit','UpdateSquareReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c8ec4,_0x514c1b){var _0xb59229=function(_0x114046){while(--_0x114046){_0x2c8ec4['push'](_0x2c8ec4['shift']());}};_0xb59229(++_0x514c1b);}(_0x85ee,0x19a));var _0xe85e=function(_0x18be8d,_0xb462e){_0x18be8d=_0x18be8d-0x0;var _0x109582=_0x85ee[_0x18be8d];return _0x109582;};'use strict';var _=require(_0xe85e('0x0'));var util=require('util');var moment=require(_0xe85e('0x1'));var BPromise=require('bluebird');var rs=require(_0xe85e('0x2'));var fs=require('fs');var Redis=require(_0xe85e('0x3'));var db=require(_0xe85e('0x4'))['db'];var utils=require(_0xe85e('0x5'));var logger=require(_0xe85e('0x6'))(_0xe85e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe85e('0x8')][_0xe85e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb00338,_0x59af07,_0x36944b){return new BPromise(function(_0x167286,_0x521f79){return client[_0xe85e('0xa')](_0xb00338,_0x36944b)[_0xe85e('0xb')](function(_0xc1abc){logger[_0xe85e('0xc')](_0xe85e('0xd'),_0x59af07,_0xe85e('0xe'));logger[_0xe85e('0xf')](_0xe85e('0x10'),_0x59af07,_0xe85e('0xe'),JSON['stringify'](_0xc1abc));if(_0xc1abc[_0xe85e('0x11')]){if(_0xc1abc[_0xe85e('0x11')][_0xe85e('0x12')]===0x1f4){logger['error'](_0xe85e('0xd'),_0x59af07,_0xc1abc[_0xe85e('0x11')][_0xe85e('0x13')]);return _0x521f79(_0xc1abc[_0xe85e('0x11')]['message']);}logger['error'](_0xe85e('0xd'),_0x59af07,_0xc1abc['error']['message']);return _0x167286(_0xc1abc[_0xe85e('0x11')][_0xe85e('0x13')]);}else{logger[_0xe85e('0xc')]('SquareReport,\x20%s,\x20%s',_0x59af07,'request\x20sent');_0x167286(_0xc1abc[_0xe85e('0x14')]['message']);}})[_0xe85e('0x15')](function(_0x21e47){logger[_0xe85e('0x11')](_0xe85e('0xd'),_0x59af07,_0x21e47);_0x521f79(_0x21e47);});});}exports[_0xe85e('0x16')]=function(_0x272593){var _0x33468b=this;return new Promise(function(_0x3315c2,_0x5106ae){return db['SquareReport'][_0xe85e('0x17')](_0x272593[_0xe85e('0x18')],{'raw':_0x272593[_0xe85e('0x19')]?_0x272593[_0xe85e('0x19')][_0xe85e('0x1a')]===undefined?!![]:![]:!![]})[_0xe85e('0xb')](function(_0x195bdb){logger[_0xe85e('0xc')](_0xe85e('0x16'),_0x272593);logger[_0xe85e('0xf')](_0xe85e('0x16'),_0x272593,JSON[_0xe85e('0x1b')](_0x195bdb));_0x3315c2(_0x195bdb);})[_0xe85e('0x15')](function(_0x552570){logger['error'](_0xe85e('0x16'),_0x552570[_0xe85e('0x13')],_0x272593);_0x5106ae(_0x33468b[_0xe85e('0x11')](0x1f4,_0x552570[_0xe85e('0x13')]));});});};exports['UpdateSquareReport']=function(_0x4226ce){var _0x4dcfae=this;return new Promise(function(_0x5578ca,_0x1816f6){return db['SquareReport']['update'](_0x4226ce[_0xe85e('0x18')],{'raw':_0x4226ce[_0xe85e('0x19')]?_0x4226ce[_0xe85e('0x19')][_0xe85e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4226ce[_0xe85e('0x19')]?_0x4226ce['options'][_0xe85e('0x1c')]||null:null,'attributes':_0x4226ce[_0xe85e('0x19')]?_0x4226ce['options'][_0xe85e('0x1d')]||null:null,'limit':_0x4226ce[_0xe85e('0x19')]?_0x4226ce[_0xe85e('0x19')][_0xe85e('0x1e')]||null:null})[_0xe85e('0xb')](function(_0x485c93){logger[_0xe85e('0xc')](_0xe85e('0x1f'),_0x4226ce);logger[_0xe85e('0xf')](_0xe85e('0x1f'),_0x4226ce,JSON[_0xe85e('0x1b')](_0x485c93));_0x5578ca(_0x485c93);})['catch'](function(_0x4ebb7f){logger[_0xe85e('0x11')](_0xe85e('0x1f'),_0x4ebb7f['message'],_0x4226ce);_0x1816f6(_0x4dcfae[_0xe85e('0x11')](0x1f4,_0x4ebb7f['message']));});});}; \ No newline at end of file +var _0xa7cc=['catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','update','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x350386,_0x601b80){var _0x126f42=function(_0x33d278){while(--_0x33d278){_0x350386['push'](_0x350386['shift']());}};_0x126f42(++_0x601b80);}(_0xa7cc,0xe2));var _0xca7c=function(_0x4abb45,_0x567b10){_0x4abb45=_0x4abb45-0x0;var _0x2b1604=_0xa7cc[_0x4abb45];return _0x2b1604;};'use strict';var _=require(_0xca7c('0x0'));var util=require(_0xca7c('0x1'));var moment=require('moment');var BPromise=require(_0xca7c('0x2'));var rs=require(_0xca7c('0x3'));var fs=require('fs');var Redis=require(_0xca7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xca7c('0x5'));var logger=require(_0xca7c('0x6'))(_0xca7c('0x7'));var config=require(_0xca7c('0x8'));var jayson=require(_0xca7c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4212,_0x3f3fe9,_0x56dcbb){return new BPromise(function(_0x222f30,_0x2dc4af){return client[_0xca7c('0xa')](_0x3c4212,_0x56dcbb)[_0xca7c('0xb')](function(_0x53e295){logger[_0xca7c('0xc')](_0xca7c('0xd'),_0x3f3fe9,_0xca7c('0xe'));logger[_0xca7c('0xf')](_0xca7c('0x10'),_0x3f3fe9,'request\x20sent',JSON[_0xca7c('0x11')](_0x53e295));if(_0x53e295[_0xca7c('0x12')]){if(_0x53e295[_0xca7c('0x12')][_0xca7c('0x13')]===0x1f4){logger[_0xca7c('0x12')](_0xca7c('0xd'),_0x3f3fe9,_0x53e295[_0xca7c('0x12')][_0xca7c('0x14')]);return _0x2dc4af(_0x53e295[_0xca7c('0x12')][_0xca7c('0x14')]);}logger[_0xca7c('0x12')](_0xca7c('0xd'),_0x3f3fe9,_0x53e295['error']['message']);return _0x222f30(_0x53e295['error'][_0xca7c('0x14')]);}else{logger['info'](_0xca7c('0xd'),_0x3f3fe9,_0xca7c('0xe'));_0x222f30(_0x53e295[_0xca7c('0x15')][_0xca7c('0x14')]);}})[_0xca7c('0x16')](function(_0x45e111){logger[_0xca7c('0x12')](_0xca7c('0xd'),_0x3f3fe9,_0x45e111);_0x2dc4af(_0x45e111);});});}exports[_0xca7c('0x17')]=function(_0x34e290){var _0x48f83d=this;return new Promise(function(_0x4dc129,_0x3b778e){return db[_0xca7c('0x18')]['create'](_0x34e290[_0xca7c('0x19')],{'raw':_0x34e290[_0xca7c('0x1a')]?_0x34e290['options'][_0xca7c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x320bfd){logger['info']('CreateSquareReport',_0x34e290);logger[_0xca7c('0xf')](_0xca7c('0x17'),_0x34e290,JSON[_0xca7c('0x11')](_0x320bfd));_0x4dc129(_0x320bfd);})['catch'](function(_0x4bd84f){logger['error'](_0xca7c('0x17'),_0x4bd84f[_0xca7c('0x14')],_0x34e290);_0x3b778e(_0x48f83d[_0xca7c('0x12')](0x1f4,_0x4bd84f[_0xca7c('0x14')]));});});};exports[_0xca7c('0x1c')]=function(_0x1738dc){var _0x5e7f49=this;return new Promise(function(_0x231d6f,_0x1710b0){return db[_0xca7c('0x18')][_0xca7c('0x1d')](_0x1738dc['body'],{'raw':_0x1738dc[_0xca7c('0x1a')]?_0x1738dc[_0xca7c('0x1a')][_0xca7c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1738dc['options']?_0x1738dc['options'][_0xca7c('0x1e')]||null:null,'attributes':_0x1738dc[_0xca7c('0x1a')]?_0x1738dc[_0xca7c('0x1a')]['attributes']||null:null,'limit':_0x1738dc[_0xca7c('0x1a')]?_0x1738dc[_0xca7c('0x1a')]['limit']||null:null})[_0xca7c('0xb')](function(_0x3f7aa4){logger[_0xca7c('0xc')](_0xca7c('0x1c'),_0x1738dc);logger[_0xca7c('0xf')](_0xca7c('0x1c'),_0x1738dc,JSON[_0xca7c('0x11')](_0x3f7aa4));_0x231d6f(_0x3f7aa4);})[_0xca7c('0x16')](function(_0x1cc34c){logger[_0xca7c('0x12')](_0xca7c('0x1c'),_0x1cc34c[_0xca7c('0x14')],_0x1738dc);_0x1710b0(_0x5e7f49['error'](0x1f4,_0x1cc34c[_0xca7c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 91e48e7..32a34d1 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 _0x9e9c=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','get','describe','/:id','show','create','put','update','delete'];(function(_0x37257e,_0x4415ca){var _0x2eca67=function(_0x280736){while(--_0x280736){_0x37257e['push'](_0x37257e['shift']());}};_0x2eca67(++_0x4415ca);}(_0x9e9c,0x66));var _0xc9e9=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x9e9c[_0x1ed116];return _0x574066;};'use strict';var multer=require(_0xc9e9('0x0'));var util=require('util');var path=require(_0xc9e9('0x1'));var timeout=require(_0xc9e9('0x2'));var express=require('express');var router=express[_0xc9e9('0x3')]();var fs_extra=require(_0xc9e9('0x4'));var auth=require(_0xc9e9('0x5'));var interaction=require(_0xc9e9('0x6'));var config=require(_0xc9e9('0x7'));var controller=require(_0xc9e9('0x8'));router['get']('/',auth[_0xc9e9('0x9')](),controller['index']);router[_0xc9e9('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xc9e9('0xb')]);router['get'](_0xc9e9('0xc'),auth[_0xc9e9('0x9')](),controller[_0xc9e9('0xd')]);router['post']('/',auth[_0xc9e9('0x9')](),controller[_0xc9e9('0xe')]);router[_0xc9e9('0xf')](_0xc9e9('0xc'),auth['isAuthenticated'](),controller[_0xc9e9('0x10')]);router[_0xc9e9('0x11')](_0xc9e9('0xc'),auth[_0xc9e9('0x9')](),controller[_0xc9e9('0x12')]);module[_0xc9e9('0x13')]=router; \ No newline at end of file +var _0x4372=['multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x52c50c,_0x5949a3){var _0x2ffe8a=function(_0x2368e6){while(--_0x2368e6){_0x52c50c['push'](_0x52c50c['shift']());}};_0x2ffe8a(++_0x5949a3);}(_0x4372,0xe7));var _0x2437=function(_0x3c7e26,_0x3cc265){_0x3c7e26=_0x3c7e26-0x0;var _0x530070=_0x4372[_0x3c7e26];return _0x530070;};'use strict';var multer=require(_0x2437('0x0'));var util=require('util');var path=require(_0x2437('0x1'));var timeout=require(_0x2437('0x2'));var express=require(_0x2437('0x3'));var router=express['Router']();var fs_extra=require(_0x2437('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2437('0x5'));var config=require(_0x2437('0x6'));var controller=require(_0x2437('0x7'));router[_0x2437('0x8')]('/',auth[_0x2437('0x9')](),controller['index']);router[_0x2437('0x8')](_0x2437('0xa'),auth[_0x2437('0x9')](),controller[_0x2437('0xb')]);router[_0x2437('0x8')](_0x2437('0xc'),auth[_0x2437('0x9')](),controller[_0x2437('0xd')]);router[_0x2437('0xe')]('/',auth[_0x2437('0x9')](),controller[_0x2437('0xf')]);router[_0x2437('0x10')](_0x2437('0xc'),auth[_0x2437('0x9')](),controller[_0x2437('0x11')]);router[_0x2437('0x12')](_0x2437('0xc'),auth[_0x2437('0x9')](),controller[_0x2437('0x13')]);module[_0x2437('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 26bdc15..942859b 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 _0x446b=['sequelize','exports','STRING'];(function(_0xfb44c0,_0x122534){var _0x4a7536=function(_0x3f108f){while(--_0x3f108f){_0xfb44c0['push'](_0xfb44c0['shift']());}};_0x4a7536(++_0x122534);}(_0x446b,0x12c));var _0xb446=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x446b[_0x18afca];return _0x11603f;};'use strict';var Sequelize=require(_0xb446('0x0'));module[_0xb446('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xb446('0x2')]},'application':{'type':Sequelize[_0xb446('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xb446('0x2')]},'callerid':{'type':Sequelize[_0xb446('0x2')]}}; \ No newline at end of file +var _0xc60a=['TEXT','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc60a,0x148));var _0xac60=function(_0xb5be0a,_0x25c53b){_0xb5be0a=_0xb5be0a-0x0;var _0x241943=_0xc60a[_0xb5be0a];return _0x241943;};'use strict';var Sequelize=require('sequelize');module[_0xac60('0x0')]={'uniqueid':{'type':Sequelize[_0xac60('0x1')]},'node':{'type':Sequelize[_0xac60('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xac60('0x2')]},'project_name':{'type':Sequelize[_0xac60('0x1')]},'callerid':{'type':Sequelize[_0xac60('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 067e3fd..1bcbad9 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 _0xb79b=['includeAll','include','find','body','catch','describe','eml-format','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','show','params','filters','length'];(function(_0x2f97aa,_0x4790a9){var _0x9471d5=function(_0x8fab25){while(--_0x8fab25){_0x2f97aa['push'](_0x2f97aa['shift']());}};_0x9471d5(++_0x4790a9);}(_0xb79b,0x126));var _0xbb79=function(_0x197df0,_0x4a9a64){_0x197df0=_0x197df0-0x0;var _0x10a925=_0xb79b[_0x197df0];return _0x10a925;};'use strict';var emlformat=require(_0xbb79('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbb79('0x1'));var BPromise=require(_0xbb79('0x2'));var Mustache=require('mustache');var util=require(_0xbb79('0x3'));var path=require('path');var sox=require(_0xbb79('0x4'));var csv=require(_0xbb79('0x5'));var ejs=require(_0xbb79('0x6'));var fs=require('fs');var fs_extra=require(_0xbb79('0x7'));var _=require('lodash');var squel=require(_0xbb79('0x8'));var crypto=require('crypto');var jsforce=require(_0xbb79('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xbb79('0x5'));var querystring=require(_0xbb79('0xa'));var Papa=require(_0xbb79('0xb'));var Redis=require('ioredis');var authService=require(_0xbb79('0xc'));var qs=require(_0xbb79('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb79('0xe'));var logger=require(_0xbb79('0xf'))(_0xbb79('0x10'));var utils=require(_0xbb79('0x11'));var config=require(_0xbb79('0x12'));var licenseUtil=require(_0xbb79('0x13'));var db=require(_0xbb79('0x14'))['db'];function respondWithStatusCode(_0x30a761,_0x452b6e){_0x452b6e=_0x452b6e||0xcc;return function(_0x57ff25){if(_0x57ff25){return _0x30a761[_0xbb79('0x15')](_0x452b6e);}return _0x30a761[_0xbb79('0x16')](_0x452b6e)[_0xbb79('0x17')]();};}function respondWithResult(_0x577ca0,_0x32e63b){_0x32e63b=_0x32e63b||0xc8;return function(_0x13e3be){if(_0x13e3be){return _0x577ca0['status'](_0x32e63b)[_0xbb79('0x18')](_0x13e3be);}};}function respondWithFilteredResult(_0x687658,_0x548b0a){return function(_0x2571d1){if(_0x2571d1){var _0x54f162=typeof _0x548b0a[_0xbb79('0x19')]===_0xbb79('0x1a')&&typeof _0x548b0a[_0xbb79('0x1b')]===_0xbb79('0x1a');var _0x4fc3d3=_0x2571d1['count'];var _0x1a83ea=_0x54f162?0x0:_0x548b0a[_0xbb79('0x19')];var _0x19f42f=_0x54f162?_0x2571d1[_0xbb79('0x1c')]:_0x548b0a[_0xbb79('0x19')]+_0x548b0a['limit'];var _0x9cb1a1;if(_0x19f42f>=_0x4fc3d3){_0x19f42f=_0x4fc3d3;_0x9cb1a1=0xc8;}else{_0x9cb1a1=0xce;}_0x687658[_0xbb79('0x16')](_0x9cb1a1);return _0x687658[_0xbb79('0x1d')](_0xbb79('0x1e'),_0x1a83ea+'-'+_0x19f42f+'/'+_0x4fc3d3)[_0xbb79('0x18')](_0x2571d1);}return null;};}function patchUpdates(_0x21cff8){return function(_0x290d1e){try{jsonpatch[_0xbb79('0x1f')](_0x290d1e,_0x21cff8,!![]);}catch(_0x1c58a){return BPromise['reject'](_0x1c58a);}return _0x290d1e[_0xbb79('0x20')]();};}function saveUpdates(_0x54ff63,_0xc39839){return function(_0x4539cd){if(_0x4539cd){return _0x4539cd[_0xbb79('0x21')](_0x54ff63)['then'](function(_0xde8b7c){return _0xde8b7c;});}return null;};}function removeEntity(_0x27b956,_0x1c50e4){return function(_0x3e4e5a){if(_0x3e4e5a){return _0x3e4e5a[_0xbb79('0x22')]()[_0xbb79('0x23')](function(){_0x27b956[_0xbb79('0x16')](0xcc)[_0xbb79('0x17')]();});}};}function handleEntityNotFound(_0x2853e5,_0x3e11d8){return function(_0x51c73a){if(!_0x51c73a){_0x2853e5[_0xbb79('0x15')](0x194);}return _0x51c73a;};}function handleError(_0xa9945d,_0x81343c){_0x81343c=_0x81343c||0x1f4;return function(_0x142899){logger[_0xbb79('0x24')](_0x142899[_0xbb79('0x25')]);if(_0x142899[_0xbb79('0x26')]){delete _0x142899[_0xbb79('0x26')];}_0xa9945d[_0xbb79('0x16')](_0x81343c)['send'](_0x142899);};}exports[_0xbb79('0x27')]=function(_0x47dfc5,_0x166a59){var _0xe49213={},_0x53a719={},_0x76c29c={'count':0x0,'rows':[]};var _0x59364c=_[_0xbb79('0x28')](db[_0xbb79('0x29')][_0xbb79('0x2a')],function(_0x473e55){return{'name':_0x473e55[_0xbb79('0x2b')],'type':_0x473e55[_0xbb79('0x2c')][_0xbb79('0x2d')]};});_0x53a719[_0xbb79('0x2e')]=_[_0xbb79('0x28')](_0x59364c,'name');_0x53a719['query']=_[_0xbb79('0x2f')](_0x47dfc5[_0xbb79('0x30')]);_0x53a719['filters']=_['intersection'](_0x53a719[_0xbb79('0x2e')],_0x53a719[_0xbb79('0x30')]);_0xe49213[_0xbb79('0x31')]=_[_0xbb79('0x32')](_0x53a719['model'],qs['fields'](_0x47dfc5['query'][_0xbb79('0x33')]));_0xe49213[_0xbb79('0x31')]=_0xe49213[_0xbb79('0x31')]['length']?_0xe49213[_0xbb79('0x31')]:_0x53a719['model'];if(!_0x47dfc5['query'][_0xbb79('0x34')](_0xbb79('0x35'))){_0xe49213[_0xbb79('0x1b')]=qs['limit'](_0x47dfc5[_0xbb79('0x30')][_0xbb79('0x1b')]);_0xe49213['offset']=qs[_0xbb79('0x19')](_0x47dfc5[_0xbb79('0x30')][_0xbb79('0x19')]);}_0xe49213[_0xbb79('0x36')]=qs['sort'](_0x47dfc5[_0xbb79('0x30')][_0xbb79('0x37')]);_0xe49213[_0xbb79('0x38')]=qs['filters'](_[_0xbb79('0x39')](_0x47dfc5[_0xbb79('0x30')],_0x53a719['filters']),_0x59364c);if(_0x47dfc5[_0xbb79('0x30')][_0xbb79('0x3a')]){_0xe49213[_0xbb79('0x38')]=_[_0xbb79('0x3b')](_0xe49213[_0xbb79('0x38')],{'$or':_[_0xbb79('0x28')](_0x59364c,function(_0xab0dcb){if(_0xab0dcb[_0xbb79('0x2c')]!=='VIRTUAL'){var _0x4b4267={};_0x4b4267[_0xab0dcb[_0xbb79('0x26')]]={'$like':'%'+_0x47dfc5['query'][_0xbb79('0x3a')]+'%'};return _0x4b4267;}})});}_0xe49213=_[_0xbb79('0x3b')]({},_0xe49213,_0x47dfc5[_0xbb79('0x3c')]);var _0x578ff0={'where':_0xe49213['where']};return db[_0xbb79('0x29')]['count'](_0x578ff0)[_0xbb79('0x23')](function(_0x5095a8){_0x76c29c[_0xbb79('0x1c')]=_0x5095a8;if(_0x47dfc5[_0xbb79('0x30')]['includeAll']){_0xe49213['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0xbb79('0x3d')](_0xe49213);})[_0xbb79('0x23')](function(_0x3fd98e){_0x76c29c['rows']=_0x3fd98e;return _0x76c29c;})[_0xbb79('0x23')](respondWithFilteredResult(_0x166a59,_0xe49213))['catch'](handleError(_0x166a59,null));};exports[_0xbb79('0x3e')]=function(_0x4f87d9,_0x18f6e1){var _0x756c60={'raw':!![],'where':{'id':_0x4f87d9[_0xbb79('0x3f')]['id']}},_0x1b21f9={};_0x1b21f9[_0xbb79('0x2e')]=_['keys'](db[_0xbb79('0x29')][_0xbb79('0x2a')]);_0x1b21f9[_0xbb79('0x30')]=_[_0xbb79('0x2f')](_0x4f87d9[_0xbb79('0x30')]);_0x1b21f9[_0xbb79('0x40')]=_[_0xbb79('0x32')](_0x1b21f9[_0xbb79('0x2e')],_0x1b21f9['query']);_0x756c60[_0xbb79('0x31')]=_[_0xbb79('0x32')](_0x1b21f9[_0xbb79('0x2e')],qs['fields'](_0x4f87d9['query'][_0xbb79('0x33')]));_0x756c60[_0xbb79('0x31')]=_0x756c60['attributes'][_0xbb79('0x41')]?_0x756c60[_0xbb79('0x31')]:_0x1b21f9['model'];if(_0x4f87d9[_0xbb79('0x30')][_0xbb79('0x42')]){_0x756c60[_0xbb79('0x43')]=[{'all':!![]}];}_0x756c60=_[_0xbb79('0x3b')]({},_0x756c60,_0x4f87d9['options']);return db[_0xbb79('0x29')][_0xbb79('0x44')](_0x756c60)[_0xbb79('0x23')](handleEntityNotFound(_0x18f6e1,null))[_0xbb79('0x23')](respondWithResult(_0x18f6e1,null))['catch'](handleError(_0x18f6e1,null));};exports['create']=function(_0x38989e,_0x10c276){return db[_0xbb79('0x29')]['create'](_0x38989e[_0xbb79('0x45')],{})['then'](respondWithResult(_0x10c276,0xc9))[_0xbb79('0x46')](handleError(_0x10c276,null));};exports['update']=function(_0xa57394,_0x2023e3){if(_0xa57394[_0xbb79('0x45')]['id']){delete _0xa57394[_0xbb79('0x45')]['id'];}return db[_0xbb79('0x29')][_0xbb79('0x44')]({'where':{'id':_0xa57394['params']['id']}})[_0xbb79('0x23')](handleEntityNotFound(_0x2023e3,null))[_0xbb79('0x23')](saveUpdates(_0xa57394[_0xbb79('0x45')],null))[_0xbb79('0x23')](respondWithResult(_0x2023e3,null))['catch'](handleError(_0x2023e3,null));};exports[_0xbb79('0x22')]=function(_0x1e8b74,_0x44b1bd){return db[_0xbb79('0x29')][_0xbb79('0x44')]({'where':{'id':_0x1e8b74['params']['id']}})[_0xbb79('0x23')](handleEntityNotFound(_0x44b1bd,null))['then'](removeEntity(_0x44b1bd,null))[_0xbb79('0x46')](handleError(_0x44b1bd,null));};exports['describe']=function(_0x555cea,_0x52cfcf){return db[_0xbb79('0x29')][_0xbb79('0x47')]()[_0xbb79('0x23')](respondWithResult(_0x52cfcf,null))['catch'](handleError(_0x52cfcf,null));}; \ No newline at end of file +var _0xe96d=['query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','keys'];(function(_0x201894,_0x192a6e){var _0x23a5fa=function(_0x5e5ef5){while(--_0x5e5ef5){_0x201894['push'](_0x201894['shift']());}};_0x23a5fa(++_0x192a6e);}(_0xe96d,0xb5));var _0xde96=function(_0x25dfef,_0x12e86c){_0x25dfef=_0x25dfef-0x0;var _0x1b7ad4=_0xe96d[_0x25dfef];return _0x1b7ad4;};'use strict';var emlformat=require(_0xde96('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xde96('0x1'));var rp=require(_0xde96('0x2'));var moment=require(_0xde96('0x3'));var BPromise=require(_0xde96('0x4'));var Mustache=require(_0xde96('0x5'));var util=require('util');var path=require(_0xde96('0x6'));var sox=require(_0xde96('0x7'));var csv=require(_0xde96('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde96('0x9'));var _=require(_0xde96('0xa'));var squel=require(_0xde96('0xb'));var crypto=require(_0xde96('0xc'));var jsforce=require(_0xde96('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xde96('0x8'));var querystring=require(_0xde96('0xe'));var Papa=require(_0xde96('0xf'));var Redis=require(_0xde96('0x10'));var authService=require(_0xde96('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde96('0x12'));var logger=require('../../config/logger')(_0xde96('0x13'));var utils=require(_0xde96('0x14'));var config=require(_0xde96('0x15'));var licenseUtil=require(_0xde96('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9fa0e7,_0x3122c2){_0x3122c2=_0x3122c2||0xcc;return function(_0xe5b216){if(_0xe5b216){return _0x9fa0e7['sendStatus'](_0x3122c2);}return _0x9fa0e7[_0xde96('0x17')](_0x3122c2)[_0xde96('0x18')]();};}function respondWithResult(_0x29e820,_0x3a1e69){_0x3a1e69=_0x3a1e69||0xc8;return function(_0x34bc39){if(_0x34bc39){return _0x29e820['status'](_0x3a1e69)['json'](_0x34bc39);}};}function respondWithFilteredResult(_0x4ed2fa,_0xcf564a){return function(_0x110c08){if(_0x110c08){var _0x46d914=typeof _0xcf564a[_0xde96('0x19')]===_0xde96('0x1a')&&typeof _0xcf564a[_0xde96('0x1b')]===_0xde96('0x1a');var _0x39e9d1=_0x110c08[_0xde96('0x1c')];var _0x48e985=_0x46d914?0x0:_0xcf564a[_0xde96('0x19')];var _0x3068c0=_0x46d914?_0x110c08[_0xde96('0x1c')]:_0xcf564a[_0xde96('0x19')]+_0xcf564a['limit'];var _0x47c50d;if(_0x3068c0>=_0x39e9d1){_0x3068c0=_0x39e9d1;_0x47c50d=0xc8;}else{_0x47c50d=0xce;}_0x4ed2fa[_0xde96('0x17')](_0x47c50d);return _0x4ed2fa[_0xde96('0x1d')](_0xde96('0x1e'),_0x48e985+'-'+_0x3068c0+'/'+_0x39e9d1)[_0xde96('0x1f')](_0x110c08);}return null;};}function patchUpdates(_0x5d5aeb){return function(_0x5626ee){try{jsonpatch[_0xde96('0x20')](_0x5626ee,_0x5d5aeb,!![]);}catch(_0x54bd88){return BPromise['reject'](_0x54bd88);}return _0x5626ee[_0xde96('0x21')]();};}function saveUpdates(_0x4ebdb3,_0x4615b7){return function(_0x36b48f){if(_0x36b48f){return _0x36b48f[_0xde96('0x22')](_0x4ebdb3)[_0xde96('0x23')](function(_0x563071){return _0x563071;});}return null;};}function removeEntity(_0x3d2876,_0x47ef0){return function(_0xd6bf5d){if(_0xd6bf5d){return _0xd6bf5d[_0xde96('0x24')]()[_0xde96('0x23')](function(){_0x3d2876[_0xde96('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3abcfc,_0x1e7f53){return function(_0x33fb59){if(!_0x33fb59){_0x3abcfc[_0xde96('0x25')](0x194);}return _0x33fb59;};}function handleError(_0x42cb1c,_0x1ac3e7){_0x1ac3e7=_0x1ac3e7||0x1f4;return function(_0x1ac57e){logger[_0xde96('0x26')](_0x1ac57e[_0xde96('0x27')]);if(_0x1ac57e[_0xde96('0x28')]){delete _0x1ac57e['name'];}_0x42cb1c['status'](_0x1ac3e7)[_0xde96('0x29')](_0x1ac57e);};}exports[_0xde96('0x2a')]=function(_0x48948f,_0x262962){var _0x160b5e={},_0x5e1b60={},_0x4db2e5={'count':0x0,'rows':[]};var _0x292d45=_[_0xde96('0x2b')](db[_0xde96('0x2c')][_0xde96('0x2d')],function(_0x477cdd){return{'name':_0x477cdd[_0xde96('0x2e')],'type':_0x477cdd[_0xde96('0x2f')][_0xde96('0x30')]};});_0x5e1b60['model']=_[_0xde96('0x2b')](_0x292d45,'name');_0x5e1b60['query']=_[_0xde96('0x31')](_0x48948f[_0xde96('0x32')]);_0x5e1b60[_0xde96('0x33')]=_[_0xde96('0x34')](_0x5e1b60[_0xde96('0x35')],_0x5e1b60[_0xde96('0x32')]);_0x160b5e['attributes']=_[_0xde96('0x34')](_0x5e1b60['model'],qs[_0xde96('0x36')](_0x48948f[_0xde96('0x32')][_0xde96('0x36')]));_0x160b5e[_0xde96('0x37')]=_0x160b5e[_0xde96('0x37')][_0xde96('0x38')]?_0x160b5e['attributes']:_0x5e1b60['model'];if(!_0x48948f[_0xde96('0x32')][_0xde96('0x39')](_0xde96('0x3a'))){_0x160b5e[_0xde96('0x1b')]=qs[_0xde96('0x1b')](_0x48948f[_0xde96('0x32')]['limit']);_0x160b5e['offset']=qs['offset'](_0x48948f['query'][_0xde96('0x19')]);}_0x160b5e['order']=qs[_0xde96('0x3b')](_0x48948f[_0xde96('0x32')]['sort']);_0x160b5e[_0xde96('0x3c')]=qs[_0xde96('0x33')](_[_0xde96('0x3d')](_0x48948f['query'],_0x5e1b60[_0xde96('0x33')]),_0x292d45);if(_0x48948f['query'][_0xde96('0x3e')]){_0x160b5e[_0xde96('0x3c')]=_[_0xde96('0x3f')](_0x160b5e[_0xde96('0x3c')],{'$or':_[_0xde96('0x2b')](_0x292d45,function(_0x53ce35){if(_0x53ce35['type']!==_0xde96('0x40')){var _0x1bbc4e={};_0x1bbc4e[_0x53ce35[_0xde96('0x28')]]={'$like':'%'+_0x48948f[_0xde96('0x32')][_0xde96('0x3e')]+'%'};return _0x1bbc4e;}})});}_0x160b5e=_['merge']({},_0x160b5e,_0x48948f[_0xde96('0x41')]);var _0x5fb089={'where':_0x160b5e['where']};return db[_0xde96('0x2c')][_0xde96('0x1c')](_0x5fb089)[_0xde96('0x23')](function(_0x179137){_0x4db2e5[_0xde96('0x1c')]=_0x179137;if(_0x48948f[_0xde96('0x32')][_0xde96('0x42')]){_0x160b5e[_0xde96('0x43')]=[{'all':!![]}];}return db[_0xde96('0x2c')][_0xde96('0x44')](_0x160b5e);})[_0xde96('0x23')](function(_0x598868){_0x4db2e5[_0xde96('0x45')]=_0x598868;return _0x4db2e5;})[_0xde96('0x23')](respondWithFilteredResult(_0x262962,_0x160b5e))[_0xde96('0x46')](handleError(_0x262962,null));};exports[_0xde96('0x47')]=function(_0x29f330,_0x40b261){var _0x369fa6={'raw':!![],'where':{'id':_0x29f330['params']['id']}},_0x985bf6={};_0x985bf6[_0xde96('0x35')]=_[_0xde96('0x31')](db[_0xde96('0x2c')][_0xde96('0x2d')]);_0x985bf6[_0xde96('0x32')]=_['keys'](_0x29f330['query']);_0x985bf6['filters']=_[_0xde96('0x34')](_0x985bf6['model'],_0x985bf6[_0xde96('0x32')]);_0x369fa6['attributes']=_['intersection'](_0x985bf6[_0xde96('0x35')],qs[_0xde96('0x36')](_0x29f330['query'][_0xde96('0x36')]));_0x369fa6['attributes']=_0x369fa6[_0xde96('0x37')]['length']?_0x369fa6[_0xde96('0x37')]:_0x985bf6[_0xde96('0x35')];if(_0x29f330[_0xde96('0x32')][_0xde96('0x42')]){_0x369fa6[_0xde96('0x43')]=[{'all':!![]}];}_0x369fa6=_[_0xde96('0x3f')]({},_0x369fa6,_0x29f330[_0xde96('0x41')]);return db[_0xde96('0x2c')][_0xde96('0x48')](_0x369fa6)[_0xde96('0x23')](handleEntityNotFound(_0x40b261,null))[_0xde96('0x23')](respondWithResult(_0x40b261,null))['catch'](handleError(_0x40b261,null));};exports[_0xde96('0x49')]=function(_0x500a6d,_0x58cf33){return db[_0xde96('0x2c')][_0xde96('0x49')](_0x500a6d[_0xde96('0x4a')],{})['then'](respondWithResult(_0x58cf33,0xc9))['catch'](handleError(_0x58cf33,null));};exports[_0xde96('0x22')]=function(_0x19cf0c,_0x27abf4){if(_0x19cf0c[_0xde96('0x4a')]['id']){delete _0x19cf0c['body']['id'];}return db[_0xde96('0x2c')][_0xde96('0x48')]({'where':{'id':_0x19cf0c[_0xde96('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27abf4,null))[_0xde96('0x23')](saveUpdates(_0x19cf0c[_0xde96('0x4a')],null))[_0xde96('0x23')](respondWithResult(_0x27abf4,null))[_0xde96('0x46')](handleError(_0x27abf4,null));};exports[_0xde96('0x24')]=function(_0x96f26e,_0x53815a){return db['SquareDetailsReport']['find']({'where':{'id':_0x96f26e[_0xde96('0x4b')]['id']}})[_0xde96('0x23')](handleEntityNotFound(_0x53815a,null))[_0xde96('0x23')](removeEntity(_0x53815a,null))[_0xde96('0x46')](handleError(_0x53815a,null));};exports[_0xde96('0x4c')]=function(_0x2c7896,_0x22ec47){return db[_0xde96('0x2c')]['describe']()[_0xde96('0x23')](respondWithResult(_0x22ec47,null))['catch'](handleError(_0x22ec47,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8cee975..a7b7832 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 _0xfbc3=['SquareDetailsReport','report_square_details','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xfbc3,0xf2));var _0x3fbc=function(_0xb267f6,_0x5f4501){_0xb267f6=_0xb267f6-0x0;var _0x18d026=_0xfbc3[_0xb267f6];return _0x18d026;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3fbc('0x0'));var moment=require(_0x3fbc('0x1'));var BPromise=require('bluebird');var rp=require(_0x3fbc('0x2'));var fs=require('fs');var path=require(_0x3fbc('0x3'));var rimraf=require(_0x3fbc('0x4'));var config=require(_0x3fbc('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0x3fbc('0x6')]=function(_0x584a3c,_0x1dd067){return _0x584a3c[_0x3fbc('0x7')](_0x3fbc('0x8'),attributes,{'tableName':_0x3fbc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7848=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3266ec,_0x4e42d8){var _0x5aa545=function(_0x509a37){while(--_0x509a37){_0x3266ec['push'](_0x3266ec['shift']());}};_0x5aa545(++_0x4e42d8);}(_0x7848,0x1da));var _0x8784=function(_0x5bff9e,_0x39ea3a){_0x5bff9e=_0x5bff9e-0x0;var _0x7f42ef=_0x7848[_0x5bff9e];return _0x7f42ef;};'use strict';var _=require(_0x8784('0x0'));var util=require('util');var logger=require(_0x8784('0x1'))(_0x8784('0x2'));var moment=require(_0x8784('0x3'));var BPromise=require(_0x8784('0x4'));var rp=require(_0x8784('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8784('0x6'));var attributes=require(_0x8784('0x7'));module[_0x8784('0x8')]=function(_0x360e89,_0x1d048f){return _0x360e89[_0x8784('0x9')](_0x8784('0xa'),attributes,{'tableName':_0x8784('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index f88f900..404ea75 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 _0x1775=['code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x11f3c9,_0x21fe37){var _0x3ff1e2=function(_0x5a3501){while(--_0x5a3501){_0x11f3c9['push'](_0x11f3c9['shift']());}};_0x3ff1e2(++_0x21fe37);}(_0x1775,0x1db));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'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['create'](_0x1b4102[_0x5177('0x1c')],{'raw':_0x1b4102['options']?_0x1b4102[_0x5177('0x1d')][_0x5177('0x1e')]===undefined?!![]:![]:!![]})[_0x5177('0xe')](function(_0x27b732){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON[_0x5177('0x13')](_0x27b732));_0x3e6944(_0x27b732);})[_0x5177('0x19')](function(_0x23dad2){logger[_0x5177('0x14')]('CreateSquareDetailsReport',_0x23dad2[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4['error'](0x1f4,_0x23dad2[_0x5177('0x17')]));});});}; \ No newline at end of file +var _0xfcbb=['code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4b9f35,_0x287585){var _0x200ea1=function(_0x9bf668){while(--_0x9bf668){_0x4b9f35['push'](_0x4b9f35['shift']());}};_0x200ea1(++_0x287585);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x1c78a4,_0x40b31f){_0x1c78a4=_0x1c78a4-0x0;var _0x48ccc8=_0xfcbb[_0x1c78a4];return _0x48ccc8;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbfcb('0xa')](function(_0x1a7225){logger['info']('CreateSquareDetailsReport',_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x1a7225));_0x3404aa(_0x1a7225);})[_0xbfcb('0x15')](function(_0x1c5924){logger['error'](_0xbfcb('0x16'),_0x1c5924[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1c5924[_0xbfcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b138e3d..d25f098 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 _0x2f9d=['isAuthenticated','killProcess','exports','express','../../components/auth/service','./system.controller','get','/process/:pid/kill'];(function(_0x58dd18,_0x4e6fa0){var _0x1bc723=function(_0x14fedf){while(--_0x14fedf){_0x58dd18['push'](_0x58dd18['shift']());}};_0x1bc723(++_0x4e6fa0);}(_0x2f9d,0x9b));var _0xd2f9=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2f9d[_0x502c7d];return _0x30b7ed;};'use strict';var express=require(_0xd2f9('0x0'));var router=express['Router']();var auth=require(_0xd2f9('0x1'));var controller=require(_0xd2f9('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd2f9('0x3')](_0xd2f9('0x4'),auth[_0xd2f9('0x5')](),controller[_0xd2f9('0x6')]);module[_0xd2f9('0x7')]=router; \ No newline at end of file +var _0xb871=['isAuthenticated','killProcess','exports','Router','../../components/auth/service','./system.controller','get','/process/:pid/kill'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0xb871,0x6b));var _0x1b87=function(_0x35f58d,_0x56c821){_0x35f58d=_0x35f58d-0x0;var _0xbca79b=_0xb871[_0x35f58d];return _0xbca79b;};'use strict';var express=require('express');var router=express[_0x1b87('0x0')]();var auth=require(_0x1b87('0x1'));var controller=require(_0x1b87('0x2'));router[_0x1b87('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1b87('0x3')](_0x1b87('0x4'),auth[_0x1b87('0x5')](),controller[_0x1b87('0x6')]);module[_0x1b87('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 8d8f9ec..8a297de 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 _0x9dd8=['then','json','catch','components/import/cm','format','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','util','bluebird','inspect','name','status','send','index','getAllData'];(function(_0x4084e9,_0x4557fb){var _0x45b452=function(_0xf6adce){while(--_0xf6adce){_0x4084e9['push'](_0x4084e9['shift']());}};_0x45b452(++_0x4557fb);}(_0x9dd8,0x17a));var _0x89dd=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x9dd8[_0xda464c];return _0x19e222;};'use strict';var info=require(_0x89dd('0x0'));var exec=require(_0x89dd('0x1'))[_0x89dd('0x2')];var logger=require(_0x89dd('0x3'))('api');var util=require(_0x89dd('0x4'));var BPromise=require(_0x89dd('0x5'));var _=require('lodash');function handleError(_0x4edc99,_0x34366c,_0x5a20b3){_0x34366c=_0x34366c||0x1f4;return function(_0x372272){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x5a20b3,_0x34366c,util[_0x89dd('0x6')](_0x372272,{'showHidden':![],'depth':null}));delete _0x372272[_0x89dd('0x7')];_0x4edc99[_0x89dd('0x8')](_0x34366c)[_0x89dd('0x9')](_0x372272);};}exports[_0x89dd('0xa')]=function(_0x2bc2ac,_0x4bf36c){return info[_0x89dd('0xb')]()[_0x89dd('0xc')](function(_0x130660){return _0x4bf36c[_0x89dd('0x8')](0xc8)[_0x89dd('0xd')](_0x130660);})[_0x89dd('0xe')](function(_0x40d1b4){return _0x4bf36c[_0x89dd('0x8')](0x1f4)[_0x89dd('0xd')](_0x40d1b4);});};exports['killProcess']=function(_0x1b447b,_0x3b6cfc){var _0x797d60=[_0x89dd('0xf')];return new BPromise(function(_0x2d27fd,_0x54bbf7){return exec(util[_0x89dd('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1b447b[_0x89dd('0x11')][_0x89dd('0x12')]),function(_0x5bfd15,_0x283dfe,_0x1ece8e){if(_0x5bfd15){return _0x54bbf7(_0x5bfd15);}return _0x2d27fd(_0x283dfe);});})[_0x89dd('0xc')](function(_0x1dc05c){var _0x38b00a=![];var _0x2836a1=_0x1dc05c[_0x89dd('0x13')](/\n/);for(var _0x5b9eb2=0x0,_0xf72a1d=_0x797d60[_0x89dd('0x14')];_0x5b9eb2<_0xf72a1d,_0x38b00a===![];_0x5b9eb2+=0x1){if(_0x1dc05c[_0x89dd('0x15')](_0x797d60[_0x5b9eb2])>=0x0){_0x38b00a=!![];}}if(!_0x38b00a){throw new Error(util[_0x89dd('0x10')](_0x89dd('0x16'),_0x1b447b[_0x89dd('0x11')]['pid']));}process[_0x89dd('0x17')](_0x1b447b[_0x89dd('0x11')][_0x89dd('0x12')],_0x89dd('0x18'));return _0x3b6cfc['status'](0xc8)[_0x89dd('0xd')]({'message':util[_0x89dd('0x10')](_0x89dd('0x19'),_0x1b447b[_0x89dd('0x11')][_0x89dd('0x12')])});})['catch'](handleError(_0x3b6cfc,null,'killProcess'));}; \ No newline at end of file +var _0xd985=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','index','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','pid','kill','status','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','bluebird','lodash','error'];(function(_0x41ec6c,_0x4d8f99){var _0x42ec26=function(_0x3957b7){while(--_0x3957b7){_0x41ec6c['push'](_0x41ec6c['shift']());}};_0x42ec26(++_0x4d8f99);}(_0xd985,0x131));var _0x5d98=function(_0x5a7fbc,_0xa081de){_0x5a7fbc=_0x5a7fbc-0x0;var _0xcba0fc=_0xd985[_0x5a7fbc];return _0xcba0fc;};'use strict';var info=require(_0x5d98('0x0'));var exec=require('child_process')[_0x5d98('0x1')];var logger=require(_0x5d98('0x2'))(_0x5d98('0x3'));var util=require('util');var BPromise=require(_0x5d98('0x4'));var _=require(_0x5d98('0x5'));function handleError(_0x4a5b1d,_0x3cc9fa,_0x302a19){_0x3cc9fa=_0x3cc9fa||0x1f4;return function(_0x1ed131){logger[_0x5d98('0x6')](_0x5d98('0x7'),_0x302a19,_0x3cc9fa,util[_0x5d98('0x8')](_0x1ed131,{'showHidden':![],'depth':null}));delete _0x1ed131['name'];_0x4a5b1d['status'](_0x3cc9fa)[_0x5d98('0x9')](_0x1ed131);};}exports[_0x5d98('0xa')]=function(_0x5af114,_0x54771b){return info['getAllData']()[_0x5d98('0xb')](function(_0x474232){return _0x54771b['status'](0xc8)[_0x5d98('0xc')](_0x474232);})[_0x5d98('0xd')](function(_0x573c48){return _0x54771b['status'](0x1f4)[_0x5d98('0xc')](_0x573c48);});};exports[_0x5d98('0xe')]=function(_0xf9749c,_0x1ea5aa){var _0x5a4e84=[_0x5d98('0xf')];return new BPromise(function(_0x51a2f3,_0x4c30dc){return exec(util['format'](_0x5d98('0x10'),_0xf9749c['params']['pid']),function(_0x3bd29b,_0x254908,_0x5a0dca){if(_0x3bd29b){return _0x4c30dc(_0x3bd29b);}return _0x51a2f3(_0x254908);});})[_0x5d98('0xb')](function(_0x2ecf1e){var _0x14a200=![];var _0x31c79f=_0x2ecf1e[_0x5d98('0x11')](/\n/);for(var _0x3d7856=0x0,_0x8325dc=_0x5a4e84['length'];_0x3d7856<_0x8325dc,_0x14a200===![];_0x3d7856+=0x1){if(_0x2ecf1e[_0x5d98('0x12')](_0x5a4e84[_0x3d7856])>=0x0){_0x14a200=!![];}}if(!_0x14a200){throw new Error(util[_0x5d98('0x13')](_0x5d98('0x14'),_0xf9749c[_0x5d98('0x15')][_0x5d98('0x16')]));}process[_0x5d98('0x17')](_0xf9749c['params']['pid'],'SIGINT');return _0x1ea5aa[_0x5d98('0x18')](0xc8)[_0x5d98('0xc')]({'message':util[_0x5d98('0x13')](_0x5d98('0x19'),_0xf9749c[_0x5d98('0x15')]['pid'])});})[_0x5d98('0xd')](handleError(_0x1ea5aa,null,_0x5d98('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8251039..47b3405 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 _0x1e4c=['destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0xb4f654,_0x33ce4b){var _0x521323=function(_0x531016){while(--_0x531016){_0xb4f654['push'](_0xb4f654['shift']());}};_0x521323(++_0x33ce4b);}(_0x1e4c,0x1bc));var _0xc1e4=function(_0xb94716,_0x36189b){_0xb94716=_0xb94716-0x0;var _0x444fdb=_0x1e4c[_0xb94716];return _0x444fdb;};'use strict';var multer=require(_0xc1e4('0x0'));var util=require(_0xc1e4('0x1'));var path=require(_0xc1e4('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1e4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc1e4('0x4'));var interaction=require(_0xc1e4('0x5'));var config=require(_0xc1e4('0x6'));var controller=require('./tag.controller');router[_0xc1e4('0x7')]('/',auth[_0xc1e4('0x8')](),controller[_0xc1e4('0x9')]);router[_0xc1e4('0x7')](_0xc1e4('0xa'),auth['isAuthenticated'](),controller[_0xc1e4('0xb')]);router[_0xc1e4('0xc')]('/',auth[_0xc1e4('0x8')](),controller['create']);router[_0xc1e4('0xd')]('/:id',auth[_0xc1e4('0x8')](),controller[_0xc1e4('0xe')]);router['delete'](_0xc1e4('0xa'),auth[_0xc1e4('0x8')](),controller[_0xc1e4('0xf')]);module[_0xc1e4('0x10')]=router; \ No newline at end of file +var _0x20c9=['create','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','/:id','post'];(function(_0x3932c8,_0x42a852){var _0x526701=function(_0x56d1f1){while(--_0x56d1f1){_0x3932c8['push'](_0x3932c8['shift']());}};_0x526701(++_0x42a852);}(_0x20c9,0x163));var _0x920c=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x20c9[_0x496738];return _0xee1381;};'use strict';var multer=require(_0x920c('0x0'));var util=require('util');var path=require(_0x920c('0x1'));var timeout=require(_0x920c('0x2'));var express=require('express');var router=express[_0x920c('0x3')]();var fs_extra=require(_0x920c('0x4'));var auth=require(_0x920c('0x5'));var interaction=require(_0x920c('0x6'));var config=require(_0x920c('0x7'));var controller=require(_0x920c('0x8'));router['get']('/',auth[_0x920c('0x9')](),controller[_0x920c('0xa')]);router['get'](_0x920c('0xb'),auth[_0x920c('0x9')](),controller['show']);router[_0x920c('0xc')]('/',auth[_0x920c('0x9')](),controller[_0x920c('0xd')]);router['put']('/:id',auth[_0x920c('0x9')](),controller[_0x920c('0xe')]);router[_0x920c('0xf')](_0x920c('0xb'),auth[_0x920c('0x9')](),controller['destroy']);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 8dfa8ee..a2ad656 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 _0xbb35=['STRING','name','#0091EA','exports'];(function(_0x277176,_0x4b72ee){var _0x75ae92=function(_0x41d7c4){while(--_0x41d7c4){_0x277176['push'](_0x277176['shift']());}};_0x75ae92(++_0x4b72ee);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x498819,_0x5f17e0){_0x498819=_0x498819-0x0;var _0x20a9a6=_0xbb35[_0x498819];return _0x20a9a6;};'use strict';var Sequelize=require('sequelize');module[_0x5bb3('0x0')]={'name':{'type':Sequelize[_0x5bb3('0x1')],'unique':_0x5bb3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5bb3('0x1')],'defaultValue':_0x5bb3('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0833=['name','sequelize','exports','STRING'];(function(_0x1adf07,_0x2fff75){var _0x4af631=function(_0x3f5ca2){while(--_0x3f5ca2){_0x1adf07['push'](_0x1adf07['shift']());}};_0x4af631(++_0x2fff75);}(_0x0833,0x1bd));var _0x3083=function(_0x372a66,_0x5a1c2b){_0x372a66=_0x372a66-0x0;var _0x3b2a92=_0x0833[_0x372a66];return _0x3b2a92;};'use strict';var Sequelize=require(_0x3083('0x0'));module[_0x3083('0x1')]={'name':{'type':Sequelize[_0x3083('0x2')],'unique':_0x3083('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3083('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 8e29150..6f73bb2 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 _0x750a=['filter','options','Tag','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','get','Tags','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x3e93c7,_0x9d5904){var _0xdba5b6=function(_0x3aadaa){while(--_0x3aadaa){_0x3e93c7['push'](_0x3e93c7['shift']());}};_0xdba5b6(++_0x9d5904);}(_0x750a,0x140));var _0xa750=function(_0x27d18e,_0x5b5383){_0x27d18e=_0x27d18e-0x0;var _0x333597=_0x750a[_0x27d18e];return _0x333597;};'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'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){var _0x1b80a5=_0x2ec6c4[_0xa750('0x1e')]({'plain':!![]});var _0x3001bc=_0xa750('0x1f');return db[_0xa750('0x20')][_0xa750('0x1c')]({'where':{'type':_0x3001bc,'resourceId':_0x1b80a5['id']}})[_0xa750('0x1d')](function(){return _0x2ec6c4;});})[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x310e2d,_0x4ffff4){return function(_0x3d3923){if(!_0x3d3923){_0x310e2d[_0xa750('0x21')](0x194);}return _0x3d3923;};}function handleError(_0x21cd2c,_0x4cceee){_0x4cceee=_0x4cceee||0x1f4;return function(_0x35ab53){logger[_0xa750('0x22')](_0x35ab53[_0xa750('0x23')]);if(_0x35ab53[_0xa750('0x24')]){delete _0x35ab53['name'];}_0x21cd2c[_0xa750('0x15')](_0x4cceee)[_0xa750('0x25')](_0x35ab53);};}exports[_0xa750('0x26')]=function(_0x2aef3a,_0x2c5253){var _0x59ab33={},_0x46cc11={},_0x4c2c9e={'count':0x0,'rows':[]};var _0x2d0e93=_[_0xa750('0x27')](db['Tag'][_0xa750('0x28')],function(_0x6bc25d){return{'name':_0x6bc25d[_0xa750('0x29')],'type':_0x6bc25d[_0xa750('0x2a')][_0xa750('0x2b')]};});_0x46cc11[_0xa750('0x2c')]=_[_0xa750('0x27')](_0x2d0e93,_0xa750('0x24'));_0x46cc11['query']=_[_0xa750('0x2d')](_0x2aef3a['query']);_0x46cc11[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],_0x46cc11[_0xa750('0x30')]);_0x59ab33['attributes']=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],qs['fields'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x31')]));_0x59ab33[_0xa750('0x32')]=_0x59ab33[_0xa750('0x32')]['length']?_0x59ab33[_0xa750('0x32')]:_0x46cc11['model'];if(!_0x2aef3a['query'][_0xa750('0x33')](_0xa750('0x34'))){_0x59ab33[_0xa750('0x35')]=qs['limit'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x35')]);_0x59ab33[_0xa750('0x17')]=qs['offset'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x17')]);}_0x59ab33[_0xa750('0x36')]=qs['sort'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x37')]);_0x59ab33[_0xa750('0x38')]=qs['filters'](_[_0xa750('0x39')](_0x2aef3a[_0xa750('0x30')],_0x46cc11[_0xa750('0x2e')]),_0x2d0e93);if(_0x2aef3a[_0xa750('0x30')]['filter']){_0x59ab33['where']=_[_0xa750('0x3a')](_0x59ab33[_0xa750('0x38')],{'$or':_['map'](_0x2d0e93,function(_0x43dc3a){if(_0x43dc3a[_0xa750('0x2a')]!==_0xa750('0x3b')){var _0x1166ff={};_0x1166ff[_0x43dc3a[_0xa750('0x24')]]={'$like':'%'+_0x2aef3a['query'][_0xa750('0x3c')]+'%'};return _0x1166ff;}})});}_0x59ab33=_[_0xa750('0x3a')]({},_0x59ab33,_0x2aef3a[_0xa750('0x3d')]);var _0x134874={'where':_0x59ab33[_0xa750('0x38')]};return db[_0xa750('0x3e')][_0xa750('0x19')](_0x134874)['then'](function(_0x3daa38){_0x4c2c9e['count']=_0x3daa38;if(_0x2aef3a[_0xa750('0x30')]['includeAll']){_0x59ab33[_0xa750('0x3f')]=[{'all':!![]}];}return db[_0xa750('0x3e')][_0xa750('0x40')](_0x59ab33);})[_0xa750('0x1d')](function(_0x430d60){_0x4c2c9e[_0xa750('0x41')]=_0x430d60;return _0x4c2c9e;})[_0xa750('0x1d')](respondWithFilteredResult(_0x2c5253,_0x59ab33))[_0xa750('0x42')](handleError(_0x2c5253,null));};exports[_0xa750('0x43')]=function(_0x108a1a,_0x36a8d6){var _0x1458f1={'raw':!![],'where':{'id':_0x108a1a[_0xa750('0x44')]['id']}},_0x3ec860={};_0x3ec860[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x3e')][_0xa750('0x28')]);_0x3ec860[_0xa750('0x30')]=_[_0xa750('0x2d')](_0x108a1a['query']);_0x3ec860[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],_0x3ec860[_0xa750('0x30')]);_0x1458f1[_0xa750('0x32')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x108a1a[_0xa750('0x30')]['fields']));_0x1458f1[_0xa750('0x32')]=_0x1458f1[_0xa750('0x32')]['length']?_0x1458f1[_0xa750('0x32')]:_0x3ec860[_0xa750('0x2c')];if(_0x108a1a[_0xa750('0x30')][_0xa750('0x45')]){_0x1458f1[_0xa750('0x3f')]=[{'all':!![]}];}_0x1458f1=_[_0xa750('0x3a')]({},_0x1458f1,_0x108a1a[_0xa750('0x3d')]);return db[_0xa750('0x3e')][_0xa750('0x46')](_0x1458f1)[_0xa750('0x1d')](handleEntityNotFound(_0x36a8d6,null))['then'](respondWithResult(_0x36a8d6,null))[_0xa750('0x42')](handleError(_0x36a8d6,null));};exports[_0xa750('0x47')]=function(_0x58afd2,_0x93e49f){return db[_0xa750('0x3e')][_0xa750('0x47')](_0x58afd2['body'],{})[_0xa750('0x1d')](function(_0x3fc623){var _0x1e5a9a=_0x58afd2[_0xa750('0x48')]['get']({'plain':!![]});if(!_0x1e5a9a)throw new Error(_0xa750('0x49'));if(_0x1e5a9a[_0xa750('0x4a')]===_0xa750('0x48')){var _0xed4f88=_0x3fc623['get']({'plain':!![]});var _0x203f2a=_0xa750('0x1f');return db['UserProfileSection'][_0xa750('0x46')]({'where':{'name':_0x203f2a,'userProfileId':_0x1e5a9a['userProfileId']},'raw':!![]})[_0xa750('0x1d')](function(_0x69995b){if(_0x69995b&&_0x69995b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xed4f88[_0xa750('0x24')],'resourceId':_0xed4f88['id'],'type':_0x69995b[_0xa750('0x24')],'sectionId':_0x69995b['id']},{})['then'](function(){return _0x3fc623;});}else{return _0x3fc623;}})[_0xa750('0x42')](function(_0x1a79a9){logger[_0xa750('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a79a9);throw _0x1a79a9;});}return _0x3fc623;})['then'](respondWithResult(_0x93e49f,0xc9))['catch'](handleError(_0x93e49f,null));};exports['update']=function(_0x3c34d4,_0x4a1b5d){if(_0x3c34d4[_0xa750('0x4b')]['id']){delete _0x3c34d4[_0xa750('0x4b')]['id'];}return db['Tag'][_0xa750('0x46')]({'where':{'id':_0x3c34d4['params']['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4a1b5d,null))['then'](saveUpdates(_0x3c34d4['body'],null))['then'](respondWithResult(_0x4a1b5d,null))['catch'](handleError(_0x4a1b5d,null));};exports[_0xa750('0x1c')]=function(_0x40dac2,_0x5f1313){return db['Tag']['find']({'where':{'id':_0x40dac2[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x5f1313,null))[_0xa750('0x1d')](removeEntity(_0x5f1313,null))[_0xa750('0x42')](handleError(_0x5f1313,null));}; \ No newline at end of file +var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','destroy','error','stack','name','send','index','map','Tag','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x306243,_0x4074dd){var _0x48725c=function(_0x1d6882){while(--_0x1d6882){_0x306243['push'](_0x306243['shift']());}};_0x48725c(++_0x4074dd);}(_0xe5b3,0x133));var _0x3e5b=function(_0x201053,_0xffd017){_0x201053=_0x201053-0x0;var _0x2b0156=_0xe5b3[_0x201053];return _0x2b0156;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['Tag'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['Tag'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['Tag'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index e255aec..59bd753 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 _0x283c=['./tag.attributes','exports','define','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x25b997,_0x9d645b){var _0x203842=function(_0x1f5d06){while(--_0x1f5d06){_0x25b997['push'](_0x25b997['shift']());}};_0x203842(++_0x9d645b);}(_0x283c,0x170));var _0xc283=function(_0xc8422d,_0x49ab0d){_0xc8422d=_0xc8422d-0x0;var _0x49c438=_0x283c[_0xc8422d];return _0x49c438;};'use strict';var _=require(_0xc283('0x0'));var util=require(_0xc283('0x1'));var logger=require(_0xc283('0x2'))(_0xc283('0x3'));var moment=require('moment');var BPromise=require(_0xc283('0x4'));var rp=require(_0xc283('0x5'));var fs=require('fs');var path=require(_0xc283('0x6'));var rimraf=require(_0xc283('0x7'));var config=require(_0xc283('0x8'));var attributes=require(_0xc283('0x9'));module[_0xc283('0xa')]=function(_0x2c18a4,_0x35a392){return _0x2c18a4[_0xc283('0xb')]('Tag',attributes,{'tableName':_0xc283('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29c5=['../../config/environment','exports','define','Tag','tools_tags','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x29c5,0x14a));var _0x529c=function(_0x754ddf,_0x37b08e){_0x754ddf=_0x754ddf-0x0;var _0x185af5=_0x29c5[_0x754ddf];return _0x185af5;};'use strict';var _=require(_0x529c('0x0'));var util=require(_0x529c('0x1'));var logger=require(_0x529c('0x2'))('api');var moment=require(_0x529c('0x3'));var BPromise=require(_0x529c('0x4'));var rp=require(_0x529c('0x5'));var fs=require('fs');var path=require(_0x529c('0x6'));var rimraf=require(_0x529c('0x7'));var config=require(_0x529c('0x8'));var attributes=require('./tag.attributes');module[_0x529c('0x9')]=function(_0x2aa909,_0x106ae7){return _0x2aa909[_0x529c('0xa')](_0x529c('0xb'),attributes,{'tableName':_0x529c('0xc'),'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 5144e85..fe7fe0d 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 _0x826a=['debug','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x826a,0x1aa));var _0xa826=function(_0x5e09ce,_0x4f9662){_0x5e09ce=_0x5e09ce-0x0;var _0x17c118=_0x826a[_0x5e09ce];return _0x17c118;};'use strict';var _=require('lodash');var util=require(_0xa826('0x0'));var moment=require('moment');var BPromise=require(_0xa826('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa826('0x2'));var db=require(_0xa826('0x3'))['db'];var utils=require(_0xa826('0x4'));var logger=require(_0xa826('0x5'))('rpc');var config=require(_0xa826('0x6'));var jayson=require(_0xa826('0x7'));var client=jayson[_0xa826('0x8')][_0xa826('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45154f,_0x4124f5,_0x4339f9){return new BPromise(function(_0x14c2ba,_0xc348d2){return client[_0xa826('0xa')](_0x45154f,_0x4339f9)[_0xa826('0xb')](function(_0x1005e6){logger[_0xa826('0xc')](_0xa826('0xd'),_0x4124f5,_0xa826('0xe'));logger[_0xa826('0xf')]('Tag,\x20%s,\x20%s,\x20%s',_0x4124f5,_0xa826('0xe'),JSON['stringify'](_0x1005e6));if(_0x1005e6[_0xa826('0x10')]){if(_0x1005e6[_0xa826('0x10')][_0xa826('0x11')]===0x1f4){logger[_0xa826('0x10')](_0xa826('0xd'),_0x4124f5,_0x1005e6[_0xa826('0x10')][_0xa826('0x12')]);return _0xc348d2(_0x1005e6['error'][_0xa826('0x12')]);}logger['error'](_0xa826('0xd'),_0x4124f5,_0x1005e6[_0xa826('0x10')]['message']);return _0x14c2ba(_0x1005e6['error']['message']);}else{logger[_0xa826('0xc')]('Tag,\x20%s,\x20%s',_0x4124f5,'request\x20sent');_0x14c2ba(_0x1005e6[_0xa826('0x13')][_0xa826('0x12')]);}})[_0xa826('0x14')](function(_0x5832b9){logger[_0xa826('0x10')](_0xa826('0xd'),_0x4124f5,_0x5832b9);_0xc348d2(_0x5832b9);});});} \ No newline at end of file +var _0x2123=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Tag,\x20%s,\x20%s','message','catch'];(function(_0x475aa9,_0x439aab){var _0x360bbc=function(_0x331a22){while(--_0x331a22){_0x475aa9['push'](_0x475aa9['shift']());}};_0x360bbc(++_0x439aab);}(_0x2123,0x190));var _0x3212=function(_0x315a8a,_0x4ffb71){_0x315a8a=_0x315a8a-0x0;var _0x3f71ab=_0x2123[_0x315a8a];return _0x3f71ab;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var Redis=require(_0x3212('0x5'));var db=require(_0x3212('0x6'))['db'];var utils=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var config=require(_0x3212('0xa'));var jayson=require(_0x3212('0xb'));var client=jayson['client'][_0x3212('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b1302,_0x1fec5d,_0x4b35e9){return new BPromise(function(_0x3e17a3,_0x56c38f){return client[_0x3212('0xd')](_0x2b1302,_0x4b35e9)[_0x3212('0xe')](function(_0x8ca483){logger[_0x3212('0xf')]('Tag,\x20%s,\x20%s',_0x1fec5d,'request\x20sent');logger[_0x3212('0x10')](_0x3212('0x11'),_0x1fec5d,_0x3212('0x12'),JSON[_0x3212('0x13')](_0x8ca483));if(_0x8ca483[_0x3212('0x14')]){if(_0x8ca483[_0x3212('0x14')][_0x3212('0x15')]===0x1f4){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x56c38f(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x3e17a3(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}else{logger[_0x3212('0xf')](_0x3212('0x16'),_0x1fec5d,_0x3212('0x12'));_0x3e17a3(_0x8ca483['result'][_0x3212('0x17')]);}})[_0x3212('0x18')](function(_0x2720c6){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x2720c6);_0x56c38f(_0x2720c6);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 1971218..2e00a7b 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_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/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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 01a904b..0f4f434 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(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'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 _0xb10b=['name','sequelize','STRING'];(function(_0x34e554,_0x4ed86b){var _0xb19e35=function(_0xb8ccc4){while(--_0xb8ccc4){_0x34e554['push'](_0x34e554['shift']());}};_0xb19e35(++_0x4ed86b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ba88a,_0x30b1d8){_0x1ba88a=_0x1ba88a-0x0;var _0x5d0fe7=_0xb10b[_0x1ba88a];return _0x5d0fe7;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 39132f0..1aeae7d 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 _0x6e61=['Sms','Fax','Openchannel','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','QueueId','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','TeamVoicePrefix','UserVoicePrefix','addAgents','removeAgents','Chat','Whatsapp','getAgents','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','register','status','end','offset','undefined','count','limit','set','save','update','then','sendStatus','error','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','transaction','sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','addQueues','findOne','add','Queues','ids','removeQueues','remove','isArray','Voice','Mail'];(function(_0x4576aa,_0x46c8a8){var _0x1ec6ba=function(_0x356675){while(--_0x356675){_0x4576aa['push'](_0x4576aa['shift']());}};_0x1ec6ba(++_0x46c8a8);}(_0x6e61,0x1eb));var _0x16e6=function(_0x3355c0,_0x4b530b){_0x3355c0=_0x3355c0-0x0;var _0x5a3288=_0x6e61[_0x3355c0];return _0x5a3288;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16e6('0x0'));var zipdir=require(_0x16e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x16e6('0x2'));var Mustache=require(_0x16e6('0x3'));var util=require(_0x16e6('0x4'));var path=require('path');var sox=require(_0x16e6('0x5'));var csv=require(_0x16e6('0x6'));var ejs=require(_0x16e6('0x7'));var fs=require('fs');var fs_extra=require(_0x16e6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x16e6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x16e6('0xa'));var toCsv=require(_0x16e6('0x6'));var querystring=require(_0x16e6('0xb'));var Papa=require(_0x16e6('0xc'));var Redis=require(_0x16e6('0xd'));var authService=require(_0x16e6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x16e6('0xf'));var hardwareService=require(_0x16e6('0x10'));var logger=require(_0x16e6('0x11'))(_0x16e6('0x12'));var utils=require('../../config/utils');var config=require(_0x16e6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x16e6('0x14'))['db'];config[_0x16e6('0x15')]=_[_0x16e6('0x16')](config['redis'],{'host':_0x16e6('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x16e6('0x15')]));require(_0x16e6('0x18'))[_0x16e6('0x19')](socket);function respondWithStatusCode(_0x5aa136,_0x1e6728){_0x1e6728=_0x1e6728||0xcc;return function(_0x1367e8){if(_0x1367e8){return _0x5aa136['sendStatus'](_0x1e6728);}return _0x5aa136[_0x16e6('0x1a')](_0x1e6728)[_0x16e6('0x1b')]();};}function respondWithResult(_0x5177a2,_0x4391c1){_0x4391c1=_0x4391c1||0xc8;return function(_0x326fd9){if(_0x326fd9){return _0x5177a2[_0x16e6('0x1a')](_0x4391c1)['json'](_0x326fd9);}};}function respondWithFilteredResult(_0x4692c0,_0x159677){return function(_0x2acd1f){if(_0x2acd1f){var _0x5c9b26=typeof _0x159677[_0x16e6('0x1c')]===_0x16e6('0x1d')&&typeof _0x159677['limit']==='undefined';var _0x2a7484=_0x2acd1f[_0x16e6('0x1e')];var _0x30648f=_0x5c9b26?0x0:_0x159677[_0x16e6('0x1c')];var _0x23bf00=_0x5c9b26?_0x2acd1f[_0x16e6('0x1e')]:_0x159677['offset']+_0x159677[_0x16e6('0x1f')];var _0x419cfa;if(_0x23bf00>=_0x2a7484){_0x23bf00=_0x2a7484;_0x419cfa=0xc8;}else{_0x419cfa=0xce;}_0x4692c0['status'](_0x419cfa);return _0x4692c0[_0x16e6('0x20')]('Content-Range',_0x30648f+'-'+_0x23bf00+'/'+_0x2a7484)['json'](_0x2acd1f);}return null;};}function patchUpdates(_0x5298d9){return function(_0x10d91f){try{jsonpatch['apply'](_0x10d91f,_0x5298d9,!![]);}catch(_0x4972f5){return BPromise['reject'](_0x4972f5);}return _0x10d91f[_0x16e6('0x21')]();};}function saveUpdates(_0x1927a5,_0x422e33){return function(_0x19c007){if(_0x19c007){return _0x19c007[_0x16e6('0x22')](_0x1927a5)[_0x16e6('0x23')](function(_0x1ad159){return _0x1ad159;});}return null;};}function handleEntityNotFound(_0x51ab30,_0x1201a5){return function(_0x46bb59){if(!_0x46bb59){_0x51ab30[_0x16e6('0x24')](0x194);}return _0x46bb59;};}function handleError(_0x34d340,_0x3a3194){_0x3a3194=_0x3a3194||0x1f4;return function(_0x153f6a){logger[_0x16e6('0x25')](_0x153f6a['stack']);if(_0x153f6a[_0x16e6('0x26')]){delete _0x153f6a[_0x16e6('0x26')];}_0x34d340[_0x16e6('0x1a')](_0x3a3194)[_0x16e6('0x27')](_0x153f6a);};}exports[_0x16e6('0x28')]=function(_0x49df6a,_0x158f92){var _0x2308e8={},_0x22aa52={},_0x2b9272={'count':0x0,'rows':[]};var _0x18d578=_[_0x16e6('0x29')](db[_0x16e6('0x2a')][_0x16e6('0x2b')],function(_0x4aea6d){return{'name':_0x4aea6d[_0x16e6('0x2c')],'type':_0x4aea6d[_0x16e6('0x2d')][_0x16e6('0x2e')]};});_0x22aa52[_0x16e6('0x2f')]=_['map'](_0x18d578,_0x16e6('0x26'));_0x22aa52[_0x16e6('0x30')]=_[_0x16e6('0x31')](_0x49df6a['query']);_0x22aa52[_0x16e6('0x32')]=_[_0x16e6('0x33')](_0x22aa52[_0x16e6('0x2f')],_0x22aa52[_0x16e6('0x30')]);_0x2308e8[_0x16e6('0x34')]=_[_0x16e6('0x33')](_0x22aa52['model'],qs[_0x16e6('0x35')](_0x49df6a[_0x16e6('0x30')][_0x16e6('0x35')]));_0x2308e8[_0x16e6('0x34')]=_0x2308e8[_0x16e6('0x34')]['length']?_0x2308e8['attributes']:_0x22aa52['model'];if(!_0x49df6a[_0x16e6('0x30')][_0x16e6('0x36')](_0x16e6('0x37'))){_0x2308e8[_0x16e6('0x1f')]=qs[_0x16e6('0x1f')](_0x49df6a[_0x16e6('0x30')]['limit']);_0x2308e8[_0x16e6('0x1c')]=qs[_0x16e6('0x1c')](_0x49df6a[_0x16e6('0x30')]['offset']);}_0x2308e8['order']=qs[_0x16e6('0x38')](_0x49df6a[_0x16e6('0x30')]['sort']);_0x2308e8[_0x16e6('0x39')]=qs[_0x16e6('0x32')](_[_0x16e6('0x3a')](_0x49df6a[_0x16e6('0x30')],_0x22aa52['filters']),_0x18d578);if(_0x49df6a[_0x16e6('0x30')][_0x16e6('0x3b')]){_0x2308e8[_0x16e6('0x39')]=_[_0x16e6('0x3c')](_0x2308e8[_0x16e6('0x39')],{'$or':_[_0x16e6('0x29')](_0x18d578,function(_0x504236){if(_0x504236[_0x16e6('0x2d')]!==_0x16e6('0x3d')){var _0x3dae48={};_0x3dae48[_0x504236[_0x16e6('0x26')]]={'$like':'%'+_0x49df6a[_0x16e6('0x30')][_0x16e6('0x3b')]+'%'};return _0x3dae48;}})});}_0x2308e8=_['merge']({},_0x2308e8,_0x49df6a[_0x16e6('0x3e')]);var _0x2783ed={'where':_0x2308e8[_0x16e6('0x39')]};return db[_0x16e6('0x2a')][_0x16e6('0x1e')](_0x2783ed)['then'](function(_0x53741a){_0x2b9272[_0x16e6('0x1e')]=_0x53741a;if(_0x49df6a[_0x16e6('0x30')][_0x16e6('0x3f')]){_0x2308e8['include']=[{'all':!![]}];}return db[_0x16e6('0x2a')][_0x16e6('0x40')](_0x2308e8);})[_0x16e6('0x23')](function(_0x3e435b){_0x2b9272[_0x16e6('0x41')]=_0x3e435b;return _0x2b9272;})[_0x16e6('0x23')](respondWithFilteredResult(_0x158f92,_0x2308e8))[_0x16e6('0x42')](handleError(_0x158f92,null));};exports[_0x16e6('0x43')]=function(_0x4d1e3f,_0x19a404){var _0x18132a={'raw':![],'where':{'id':_0x4d1e3f['params']['id']}},_0x441a08={};_0x441a08[_0x16e6('0x2f')]=_['keys'](db[_0x16e6('0x2a')]['rawAttributes']);_0x441a08['query']=_[_0x16e6('0x31')](_0x4d1e3f['query']);_0x441a08[_0x16e6('0x32')]=_[_0x16e6('0x33')](_0x441a08[_0x16e6('0x2f')],_0x441a08[_0x16e6('0x30')]);_0x18132a['attributes']=_[_0x16e6('0x33')](_0x441a08[_0x16e6('0x2f')],qs[_0x16e6('0x35')](_0x4d1e3f[_0x16e6('0x30')][_0x16e6('0x35')]));_0x18132a[_0x16e6('0x34')]=_0x18132a[_0x16e6('0x34')][_0x16e6('0x44')]?_0x18132a[_0x16e6('0x34')]:_0x441a08['model'];if(_0x4d1e3f[_0x16e6('0x30')]['includeAll']){_0x18132a[_0x16e6('0x45')]=[{'all':!![]}];}_0x18132a=_[_0x16e6('0x3c')]({},_0x18132a,_0x4d1e3f['options']);return db[_0x16e6('0x2a')]['find'](_0x18132a)[_0x16e6('0x23')](handleEntityNotFound(_0x19a404,null))[_0x16e6('0x23')](respondWithResult(_0x19a404,null))[_0x16e6('0x42')](handleError(_0x19a404,null));};exports[_0x16e6('0x46')]=function(_0x41ef39,_0x2cde02){return db['Team'][_0x16e6('0x46')](_0x41ef39[_0x16e6('0x47')],{})[_0x16e6('0x23')](function(_0x4858dd){var _0x482166=_0x41ef39['user'][_0x16e6('0x48')]({'plain':!![]});if(!_0x482166)throw new Error(_0x16e6('0x49'));if(_0x482166[_0x16e6('0x4a')]===_0x16e6('0x4b')){var _0x5babad=_0x4858dd['get']({'plain':!![]});var _0x2760e0=_0x16e6('0x4c');return db[_0x16e6('0x4d')][_0x16e6('0x4e')]({'where':{'name':_0x2760e0,'userProfileId':_0x482166[_0x16e6('0x4f')]},'raw':!![]})[_0x16e6('0x23')](function(_0x52c4f4){if(_0x52c4f4&&_0x52c4f4[_0x16e6('0x50')]===0x0){return db[_0x16e6('0x51')][_0x16e6('0x46')]({'name':_0x5babad[_0x16e6('0x26')],'resourceId':_0x5babad['id'],'type':_0x52c4f4[_0x16e6('0x26')],'sectionId':_0x52c4f4['id']},{})['then'](function(){return _0x4858dd;});}else{return _0x4858dd;}})['catch'](function(_0x22a42b){logger[_0x16e6('0x25')](_0x16e6('0x52'),_0x22a42b);throw _0x22a42b;});}return _0x4858dd;})[_0x16e6('0x23')](respondWithResult(_0x2cde02,0xc9))[_0x16e6('0x42')](handleError(_0x2cde02,null));};exports[_0x16e6('0x22')]=function(_0xb76060,_0x1156b0){if(_0xb76060[_0x16e6('0x47')]['id']){delete _0xb76060[_0x16e6('0x47')]['id'];}return db[_0x16e6('0x2a')][_0x16e6('0x4e')]({'where':{'id':_0xb76060[_0x16e6('0x53')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x1156b0,null))[_0x16e6('0x23')](saveUpdates(_0xb76060[_0x16e6('0x47')],null))[_0x16e6('0x23')](respondWithResult(_0x1156b0,null))[_0x16e6('0x42')](handleError(_0x1156b0,null));};exports['destroy']=function(_0x7a6a62,_0x140345){var _0x45bc01=_0x7a6a62[_0x16e6('0x53')]['id'];var _0x150229=[];return db['sequelize'][_0x16e6('0x54')](function(_0x48733f){var _0x3d2849='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x45bc01;return db[_0x16e6('0x55')][_0x16e6('0x30')](_0x3d2849,{'type':db['Sequelize'][_0x16e6('0x56')][_0x16e6('0x57')],'raw':!![],'transaction':_0x48733f})[_0x16e6('0x23')](function(_0x3c38d3){_0x150229=_[_0x16e6('0x29')](_0x3c38d3,function(_0x50a033){return Number(_0x50a033[_0x16e6('0x58')]);});})[_0x16e6('0x23')](function(){var _0x2358d2=_0x16e6('0x59')+_0x45bc01;return db[_0x16e6('0x55')]['query'](_0x2358d2,{'type':db[_0x16e6('0x5a')]['QueryTypes'][_0x16e6('0x57')],'raw':!![],'transaction':_0x48733f});})[_0x16e6('0x23')](function(_0x302175){var _0x213797=_[_0x16e6('0x29')](_0x302175,function(_0x24c7cd){return Number(_0x24c7cd['VoiceQueueId']);});return db[_0x16e6('0x5b')][_0x16e6('0x5c')]({'where':{'UserId':{'$in':_0x150229},'VoiceQueueId':{'$in':_0x213797}},'transaction':_0x48733f});})[_0x16e6('0x23')](function(){var _0x31d956=_0x16e6('0x5d')+_0x45bc01;return db[_0x16e6('0x55')][_0x16e6('0x30')](_0x31d956,{'type':db[_0x16e6('0x5a')]['QueryTypes'][_0x16e6('0x57')],'raw':!![],'transaction':_0x48733f});})[_0x16e6('0x23')](function(_0x5a4195){var _0x295cab=_['map'](_0x5a4195,function(_0xa20511){return Number(_0xa20511[_0x16e6('0x5e')]);});return db[_0x16e6('0x5f')][_0x16e6('0x5c')]({'where':{'UserId':{'$in':_0x150229},'MailQueueId':{'$in':_0x295cab}},'transaction':_0x48733f});})[_0x16e6('0x23')](function(){var _0x480c03=_0x16e6('0x60')+_0x45bc01;return db[_0x16e6('0x55')][_0x16e6('0x30')](_0x480c03,{'type':db[_0x16e6('0x5a')][_0x16e6('0x56')][_0x16e6('0x57')],'raw':!![],'transaction':_0x48733f});})[_0x16e6('0x23')](function(_0x10eefd){var _0x507377=_[_0x16e6('0x29')](_0x10eefd,function(_0x392798){return Number(_0x392798[_0x16e6('0x61')]);});return db[_0x16e6('0x62')][_0x16e6('0x5c')]({'where':{'UserId':{'$in':_0x150229},'SmsQueueId':{'$in':_0x507377}},'transaction':_0x48733f});})[_0x16e6('0x23')](function(){var _0xe724f8=_0x16e6('0x63')+_0x45bc01;return db['sequelize'][_0x16e6('0x30')](_0xe724f8,{'type':db[_0x16e6('0x5a')]['QueryTypes'][_0x16e6('0x57')],'raw':!![],'transaction':_0x48733f});})['then'](function(_0x522504){var _0x3e9998=_[_0x16e6('0x29')](_0x522504,function(_0x35c3d7){return Number(_0x35c3d7['ChatQueueId']);});return db[_0x16e6('0x64')][_0x16e6('0x5c')]({'where':{'UserId':{'$in':_0x150229},'ChatQueueId':{'$in':_0x3e9998}},'transaction':_0x48733f});})[_0x16e6('0x23')](function(){var _0x4329b1=_0x16e6('0x65')+_0x45bc01;return db[_0x16e6('0x55')][_0x16e6('0x30')](_0x4329b1,{'type':db[_0x16e6('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x48733f});})[_0x16e6('0x23')](function(_0x3e9b05){var _0x1631a2=_[_0x16e6('0x29')](_0x3e9b05,function(_0x518102){return Number(_0x518102['FaxQueueId']);});return db[_0x16e6('0x66')][_0x16e6('0x5c')]({'where':{'UserId':{'$in':_0x150229},'FaxQueueId':{'$in':_0x1631a2}},'transaction':_0x48733f});})[_0x16e6('0x23')](function(){var _0x446962=_0x16e6('0x67')+_0x45bc01;return db[_0x16e6('0x55')][_0x16e6('0x30')](_0x446962,{'type':db['Sequelize'][_0x16e6('0x56')]['SELECT'],'raw':!![],'transaction':_0x48733f});})[_0x16e6('0x23')](function(_0x1fd3d1){var _0x24e9f6=_[_0x16e6('0x29')](_0x1fd3d1,function(_0xb132ce){return Number(_0xb132ce[_0x16e6('0x68')]);});return db[_0x16e6('0x69')]['destroy']({'where':{'UserId':{'$in':_0x150229},'OpenchannelQueueId':{'$in':_0x24e9f6}},'transaction':_0x48733f});})[_0x16e6('0x23')](function(){var _0x57332c=_0x16e6('0x6a')+_0x45bc01;return db[_0x16e6('0x55')][_0x16e6('0x30')](_0x57332c,{'type':db['Sequelize'][_0x16e6('0x56')][_0x16e6('0x57')],'raw':!![],'transaction':_0x48733f});})[_0x16e6('0x23')](function(_0x5c4b6b){var _0x223fb9=_[_0x16e6('0x29')](_0x5c4b6b,function(_0x5a561d){return Number(_0x5a561d[_0x16e6('0x6b')]);});return db[_0x16e6('0x6c')][_0x16e6('0x5c')]({'where':{'UserId':{'$in':_0x150229},'WhatsappQueueId':{'$in':_0x223fb9}},'transaction':_0x48733f});})[_0x16e6('0x23')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x45bc01}});})[_0x16e6('0x23')](function(_0x52e02e){if(_0x52e02e===null){return;}return db['UserVoicePrefix'][_0x16e6('0x5c')]({'where':{'UserId':{'$in':_0x150229},'VoicePrefixId':_0x52e02e[_0x16e6('0x6d')]},'transaction':_0x48733f});})[_0x16e6('0x23')](function(){return db[_0x16e6('0x2a')][_0x16e6('0x5c')]({'where':{'id':_0x45bc01},'cascade':!![],'transaction':_0x48733f});})[_0x16e6('0x23')](function(_0x2b86a8){if(_0x2b86a8===0x0){_0x140345['sendStatus'](0x194);}else{return db[_0x16e6('0x51')]['destroy']({'where':{'type':_0x16e6('0x4c'),'resourceId':_0x45bc01},'cascade':!![],'transaction':_0x48733f})[_0x16e6('0x23')](function(){_0x140345[_0x16e6('0x1a')](0xcc)['end']();});}})[_0x16e6('0x42')](function(_0x102020){_0x140345[_0x16e6('0x1a')](0x1f4)[_0x16e6('0x27')](_0x102020);});});};exports[_0x16e6('0x6e')]=function(_0x117b90,_0x3c0991,_0x39b091){return db[_0x16e6('0x2a')]['findOne']({'where':{'id':_0x117b90[_0x16e6('0x53')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x3c0991,null))['then'](function(_0x143f7e){if(!_0x117b90[_0x16e6('0x30')][_0x16e6('0x6f')]||!utils[_0x16e6('0x70')](_0x117b90['query']['channel'])){throw new db[(_0x16e6('0x5a'))][(_0x16e6('0x71'))](_0x16e6('0x72'));}var _0x5f430b={};var _0x1bfcb8={};_0x1bfcb8[_0x16e6('0x2f')]=_[_0x16e6('0x31')](db[_[_0x16e6('0x73')](_0x117b90[_0x16e6('0x30')][_0x16e6('0x6f')][_0x16e6('0x74')]())+_0x16e6('0x75')][_0x16e6('0x2b')]);_0x1bfcb8[_0x16e6('0x30')]=_[_0x16e6('0x31')](_0x117b90[_0x16e6('0x30')]);_0x1bfcb8['filters']=_['intersection'](_0x1bfcb8['model'],_0x1bfcb8[_0x16e6('0x30')]);_0x5f430b[_0x16e6('0x34')]=_['intersection'](_0x1bfcb8['model'],qs[_0x16e6('0x35')](_0x117b90[_0x16e6('0x30')][_0x16e6('0x35')]));_0x5f430b['attributes']=_0x5f430b[_0x16e6('0x34')]['length']?_0x5f430b[_0x16e6('0x34')]:_0x1bfcb8[_0x16e6('0x2f')];_0x5f430b[_0x16e6('0x1f')]=qs['limit'](_0x117b90[_0x16e6('0x30')][_0x16e6('0x1f')]);_0x5f430b[_0x16e6('0x1c')]=qs[_0x16e6('0x1c')](_0x117b90[_0x16e6('0x30')][_0x16e6('0x1c')]);_0x5f430b[_0x16e6('0x76')]=qs['sort'](_0x117b90[_0x16e6('0x30')][_0x16e6('0x38')]);_0x5f430b[_0x16e6('0x39')]=qs['filters'](_[_0x16e6('0x3a')](_0x117b90[_0x16e6('0x30')],_0x1bfcb8[_0x16e6('0x32')]));_0x5f430b=_[_0x16e6('0x3c')]({},_0x5f430b,_0x117b90[_0x16e6('0x3e')]);return _0x143f7e['get'+_[_0x16e6('0x73')](_0x117b90[_0x16e6('0x30')][_0x16e6('0x6f')]['toLowerCase']())+'Queues'](_0x5f430b);})[_0x16e6('0x23')](respondWithResult(_0x3c0991,null))['catch'](handleError(_0x3c0991,null));};exports[_0x16e6('0x77')]=function(_0x440dc7,_0x349131,_0x1b3113){return db[_0x16e6('0x2a')][_0x16e6('0x78')]({'where':{'id':_0x440dc7['params']['id']}})[_0x16e6('0x23')](function(_0x2d0c3b){if(_0x2d0c3b){if(!_0x440dc7[_0x16e6('0x47')][_0x16e6('0x6f')]||!utils[_0x16e6('0x70')](_0x440dc7[_0x16e6('0x47')]['channel'])){throw new db[(_0x16e6('0x5a'))]['ValidationError'](_0x16e6('0x72'));}return _0x2d0c3b[_0x16e6('0x79')+_['capitalize'](_0x440dc7[_0x16e6('0x47')][_0x16e6('0x6f')][_0x16e6('0x74')]())+_0x16e6('0x7a')](_0x440dc7[_0x16e6('0x47')][_0x16e6('0x7b')]);}return null;})[_0x16e6('0x23')](handleEntityNotFound(_0x349131,null))[_0x16e6('0x23')](respondWithStatusCode(_0x349131,null))[_0x16e6('0x42')](handleError(_0x349131,null));};exports[_0x16e6('0x7c')]=function(_0x5df0b7,_0x91af8,_0x27e353){return db['Team']['findOne']({'where':{'id':_0x5df0b7['params']['id']}})[_0x16e6('0x23')](function(_0x521a05){if(_0x521a05){if(!_0x5df0b7[_0x16e6('0x30')][_0x16e6('0x6f')]||!utils[_0x16e6('0x70')](_0x5df0b7['query']['channel'])){throw new db[(_0x16e6('0x5a'))]['ValidationError']('Unknown\x20channel');}return _0x521a05[_0x16e6('0x7d')+_[_0x16e6('0x73')](_0x5df0b7['query']['channel'][_0x16e6('0x74')]())+'Queues'](_0x5df0b7[_0x16e6('0x30')]['ids']);}return null;})[_0x16e6('0x23')](handleEntityNotFound(_0x91af8,null))['then'](respondWithStatusCode(_0x91af8,null))[_0x16e6('0x42')](handleError(_0x91af8,null));};exports['addAgents']=function(_0x196b3d,_0x4ccf80){var _0x3d4238=_[_0x16e6('0x7e')](_0x196b3d[_0x16e6('0x47')]['ids'])?_0x196b3d[_0x16e6('0x47')][_0x16e6('0x7b')]:[_0x196b3d[_0x16e6('0x47')][_0x16e6('0x7b')]];var _0x486b45=_0x196b3d[_0x16e6('0x53')]['id'];return db[_0x16e6('0x2a')][_0x16e6('0x4e')]({'where':{'id':_0x486b45}})[_0x16e6('0x23')](handleEntityNotFound(_0x4ccf80,null))[_0x16e6('0x23')](function(_0x81394a){if(_0x81394a){var _0x4f265f=[_0x16e6('0x7f'),'Chat',_0x16e6('0x80'),_0x16e6('0x81'),_0x16e6('0x82'),_0x16e6('0x83'),'Whatsapp'];return db['sequelize'][_0x16e6('0x54')](function(_0x3535d5){var _0x113cfa=_[_0x16e6('0x29')](_0x4f265f,function(_0x518546){var _0x4ea439={'attributes':['id',_0x16e6('0x26')]};if(_0x518546===_0x16e6('0x7f')){_0x4ea439[_0x16e6('0x84')]={'attributes':[_0x16e6('0x85')]};}return _0x81394a['get'+_0x518546+_0x16e6('0x7a')](_0x4ea439)[_0x16e6('0x23')](function(_0x53b286){var _0x13e9d6=_['map'](_0x53b286,function(_0x9c55b0){var _0x4efa3e=_['map'](_0x3d4238,function(_0x1d8c58){var _0x13f3c5={'where':{'UserId':_0x1d8c58,[_0x518546+'QueueId']:_0x9c55b0['id']},'transaction':_0x3535d5};if(_0x518546===_0x16e6('0x7f')){_0x13f3c5[_0x16e6('0x16')]={'penalty':_0x9c55b0[_0x16e6('0x86')][_0x16e6('0x85')]};}return db[_0x16e6('0x87')+_0x518546+'Queue'][_0x16e6('0x88')](_0x13f3c5)['then'](function(){socket[_0x16e6('0x89')]('user'+_0x518546+_0x16e6('0x8a'),{'UserId':_0x1d8c58,[_0x518546+_0x16e6('0x8b')]:_0x9c55b0['id']});if(_0x518546!==_0x16e6('0x7f')){return;}return db[_0x16e6('0x87')][_0x16e6('0x40')]({'where':{'id':_0x3d4238,'online':0x1},'attributes':['id',_0x16e6('0x26'),'online','voicePause',_0x16e6('0x8c')],'raw':!![]})[_0x16e6('0x23')](function(_0x500858){var _0x3a53d5=_[_0x16e6('0x29')](_0x500858,function(_0x21b9fe){return db[_0x16e6('0x8d')][_0x16e6('0x8e')]({'membername':_0x21b9fe[_0x16e6('0x26')],'UserId':_0x21b9fe['id'],'queue_name':_0x9c55b0[_0x16e6('0x26')],'VoiceQueueId':_0x9c55b0['id'],'interface':_[_0x16e6('0x8f')](_0x21b9fe[_0x16e6('0x8c')])?util[_0x16e6('0x90')](_0x16e6('0x91'),_0x21b9fe[_0x16e6('0x26')]):_0x21b9fe[_0x16e6('0x8c')],'paused':_0x21b9fe[_0x16e6('0x92')]||![],'penalty':_0x9c55b0[_0x16e6('0x86')][_0x16e6('0x85')]},{'transaction':_0x3535d5});});return Promise[_0x16e6('0x93')](_0x3a53d5);});});});return Promise['all'](_0x4efa3e);});return Promise['all'](_0x13e9d6);})[_0x16e6('0x23')](function(){return db[_0x16e6('0x94')][_0x16e6('0x78')]({'where':{'teamId':_0x486b45}})[_0x16e6('0x23')](function(_0x57244e){if(_0x57244e){var _0x48cb4e=_['map'](_0x3d4238,function(_0x492c56){db[_0x16e6('0x95')][_0x16e6('0x8e')]({'UserId':_0x492c56,'VoicePrefixId':_0x57244e[_0x16e6('0x6d')]});});return Promise['all'](_0x48cb4e);}});});});return Promise['all'](_0x113cfa)['then'](function(){return _0x81394a[_0x16e6('0x96')](_0x3d4238,{'transaction':_0x3535d5})['spread'](function(_0x1f8be4){return _0x1f8be4;});});});}})[_0x16e6('0x23')](respondWithResult(_0x4ccf80,null))[_0x16e6('0x42')](handleError(_0x4ccf80,null));};exports[_0x16e6('0x97')]=function(_0x3990c1,_0x308b40){var _0x53e8bf=_[_0x16e6('0x7e')](_0x3990c1[_0x16e6('0x30')][_0x16e6('0x7b')])?_0x3990c1[_0x16e6('0x30')][_0x16e6('0x7b')]:[_0x3990c1[_0x16e6('0x30')][_0x16e6('0x7b')]];var _0x576fe5=_0x3990c1[_0x16e6('0x53')]['id'];return db[_0x16e6('0x2a')][_0x16e6('0x4e')]({'where':{'id':_0x576fe5}})['then'](handleEntityNotFound(_0x308b40,null))[_0x16e6('0x23')](function(_0x766661){if(_0x766661){var _0x1d6c7c=['Voice',_0x16e6('0x98'),_0x16e6('0x80'),_0x16e6('0x81'),_0x16e6('0x82'),_0x16e6('0x83'),_0x16e6('0x99')];return db[_0x16e6('0x55')][_0x16e6('0x54')](function(_0x2d1034){var _0x1332a7=_[_0x16e6('0x29')](_0x1d6c7c,function(_0x570241){var _0x16dea2={'attributes':['id','name']};return _0x766661['get'+_0x570241+_0x16e6('0x7a')](_0x16dea2)[_0x16e6('0x23')](function(_0x50c386){var _0x14e867=_[_0x16e6('0x29')](_0x50c386,function(_0x213e7c){return _0x213e7c['removeAgents'](_0x53e8bf,{'transaction':_0x2d1034})[_0x16e6('0x23')](function(){var _0x21add3=_[_0x16e6('0x29')](_0x53e8bf,function(_0x4a51c5){socket[_0x16e6('0x89')](_0x16e6('0x4b')+_0x570241+'Queue:remove',{'UserId':Number(_0x4a51c5),[_0x570241+'QueueId']:_0x213e7c['id']});if(_0x570241!==_0x16e6('0x7f')){return;}return db[_0x16e6('0x8d')]['destroy']({'where':{'VoiceQueueId':_0x213e7c['id'],'UserId':_0x4a51c5},'transaction':_0x2d1034});});return Promise[_0x16e6('0x93')](_0x21add3);});});return Promise[_0x16e6('0x93')](_0x14e867);});});return Promise[_0x16e6('0x93')](_0x1332a7)[_0x16e6('0x23')](function(){return _0x766661[_0x16e6('0x97')](_0x53e8bf,{'transaction':_0x2d1034});})['then'](function(){return db[_0x16e6('0x94')][_0x16e6('0x78')]({'where':{'teamId':_0x576fe5}})['then'](function(_0x35ee51){if(_0x35ee51){var _0x3df95f=_['map'](_0x53e8bf,function(_0x4ffed5){db[_0x16e6('0x95')][_0x16e6('0x5c')]({'where':{'UserId':_0x4ffed5,'VoicePrefixId':_0x35ee51[_0x16e6('0x6d')]}});});return Promise[_0x16e6('0x93')](_0x3df95f);}});});});}})[_0x16e6('0x23')](respondWithStatusCode(_0x308b40,null))['catch'](handleError(_0x308b40,null));};exports['getAgents']=function(_0x2fbb45,_0x3ba523,_0x2337a9){var _0x2e55d7={};var _0x2a9b3a={};var _0x2cd457;var _0x289262;return db[_0x16e6('0x2a')][_0x16e6('0x78')]({'where':{'id':_0x2fbb45[_0x16e6('0x53')]['id']}})[_0x16e6('0x23')](handleEntityNotFound(_0x3ba523,null))['then'](function(_0x4cde8f){if(_0x4cde8f){_0x2cd457=_0x4cde8f;_0x2a9b3a['model']=_[_0x16e6('0x31')](db[_0x16e6('0x87')][_0x16e6('0x2b')]);_0x2a9b3a[_0x16e6('0x30')]=_[_0x16e6('0x31')](_0x2fbb45['query']);_0x2a9b3a[_0x16e6('0x32')]=_[_0x16e6('0x33')](_0x2a9b3a[_0x16e6('0x2f')],_0x2a9b3a[_0x16e6('0x30')]);_0x2e55d7[_0x16e6('0x34')]=_[_0x16e6('0x33')](_0x2a9b3a[_0x16e6('0x2f')],qs[_0x16e6('0x35')](_0x2fbb45['query'][_0x16e6('0x35')]));_0x2e55d7[_0x16e6('0x34')]=_0x2e55d7[_0x16e6('0x34')]['length']?_0x2e55d7[_0x16e6('0x34')]:_0x2a9b3a[_0x16e6('0x2f')];_0x2e55d7[_0x16e6('0x76')]=qs['sort'](_0x2fbb45['query']['sort']);_0x2e55d7[_0x16e6('0x39')]=qs[_0x16e6('0x32')](_['pick'](_0x2fbb45['query'],_0x2a9b3a[_0x16e6('0x32')]));if(_0x2fbb45[_0x16e6('0x30')][_0x16e6('0x3b')]){_0x2e55d7['where']=_[_0x16e6('0x3c')](_0x2e55d7[_0x16e6('0x39')],{'$or':_[_0x16e6('0x29')](_0x2e55d7[_0x16e6('0x34')],function(_0x542371){var _0x1aa711={};_0x1aa711[_0x542371]={'$like':'%'+_0x2fbb45[_0x16e6('0x30')][_0x16e6('0x3b')]+'%'};return _0x1aa711;})});}_0x2e55d7=_[_0x16e6('0x3c')]({},_0x2e55d7,_0x2fbb45[_0x16e6('0x3e')]);return _0x2cd457[_0x16e6('0x9a')](_0x2e55d7);}})[_0x16e6('0x23')](function(_0x4ed865){if(_0x4ed865){_0x289262=_0x4ed865[_0x16e6('0x44')];if(!_0x2fbb45[_0x16e6('0x30')][_0x16e6('0x36')](_0x16e6('0x37'))){_0x2e55d7['limit']=qs[_0x16e6('0x1f')](_0x2fbb45[_0x16e6('0x30')][_0x16e6('0x1f')]);_0x2e55d7['offset']=qs[_0x16e6('0x1c')](_0x2fbb45[_0x16e6('0x30')][_0x16e6('0x1c')]);}return _0x2cd457[_0x16e6('0x9a')](_0x2e55d7);}})[_0x16e6('0x23')](function(_0x2906b5){if(_0x2906b5){return _0x2906b5?{'count':_0x289262,'rows':_0x2906b5}:null;}})[_0x16e6('0x23')](respondWithResult(_0x3ba523,null))[_0x16e6('0x42')](handleError(_0x3ba523,null));}; \ No newline at end of file +var _0x4196=['status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','create','user','get','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','Teams','end','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','Queue','Queues','addQueues','ValidationError','add','toLowerCase','ids','remove','capitalize','addAgents','isArray','Voice','Mail','Sms','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','SIP/%s','all','UserVoicePrefix','spread','Fax','Openchannel','Queue:remove','removeAgents','getAgents','hasOwnProperty','eml-format','zip-dir','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus'];(function(_0xfac10b,_0x172584){var _0x1b1acb=function(_0x44d286){while(--_0x44d286){_0xfac10b['push'](_0xfac10b['shift']());}};_0x1b1acb(++_0x172584);}(_0x4196,0x121));var _0x6419=function(_0x1fe4a2,_0x2210b0){_0x1fe4a2=_0x1fe4a2-0x0;var _0x312795=_0x4196[_0x1fe4a2];return _0x312795;};'use strict';var emlformat=require(_0x6419('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6419('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6419('0x2'));var Mustache=require(_0x6419('0x3'));var util=require(_0x6419('0x4'));var path=require('path');var sox=require(_0x6419('0x5'));var csv=require(_0x6419('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6419('0x7'));var _=require('lodash');var squel=require(_0x6419('0x8'));var crypto=require(_0x6419('0x9'));var jsforce=require(_0x6419('0xa'));var deskjs=require(_0x6419('0xb'));var toCsv=require(_0x6419('0x6'));var querystring=require(_0x6419('0xc'));var Papa=require(_0x6419('0xd'));var Redis=require(_0x6419('0xe'));var authService=require(_0x6419('0xf'));var qs=require(_0x6419('0x10'));var as=require(_0x6419('0x11'));var hardwareService=require(_0x6419('0x12'));var logger=require(_0x6419('0x13'))(_0x6419('0x14'));var utils=require('../../config/utils');var config=require(_0x6419('0x15'));var licenseUtil=require(_0x6419('0x16'));var db=require(_0x6419('0x17'))['db'];config[_0x6419('0x18')]=_[_0x6419('0x19')](config[_0x6419('0x18')],{'host':_0x6419('0x1a'),'port':0x18eb});var socket=require(_0x6419('0x1b'))(new Redis(config[_0x6419('0x18')]));require(_0x6419('0x1c'))[_0x6419('0x1d')](socket);function respondWithStatusCode(_0x39bb4f,_0x6ec778){_0x6ec778=_0x6ec778||0xcc;return function(_0xb13157){if(_0xb13157){return _0x39bb4f[_0x6419('0x1e')](_0x6ec778);}return _0x39bb4f[_0x6419('0x1f')](_0x6ec778)['end']();};}function respondWithResult(_0x2e4cd7,_0x21376f){_0x21376f=_0x21376f||0xc8;return function(_0x4e6456){if(_0x4e6456){return _0x2e4cd7[_0x6419('0x1f')](_0x21376f)['json'](_0x4e6456);}};}function respondWithFilteredResult(_0x4cf887,_0xabd249){return function(_0x2ba806){if(_0x2ba806){var _0xf98d5c=typeof _0xabd249[_0x6419('0x20')]===_0x6419('0x21')&&typeof _0xabd249[_0x6419('0x22')]===_0x6419('0x21');var _0x5bad85=_0x2ba806['count'];var _0x576cb3=_0xf98d5c?0x0:_0xabd249['offset'];var _0x4cfc14=_0xf98d5c?_0x2ba806[_0x6419('0x23')]:_0xabd249[_0x6419('0x20')]+_0xabd249[_0x6419('0x22')];var _0x41a493;if(_0x4cfc14>=_0x5bad85){_0x4cfc14=_0x5bad85;_0x41a493=0xc8;}else{_0x41a493=0xce;}_0x4cf887['status'](_0x41a493);return _0x4cf887[_0x6419('0x24')](_0x6419('0x25'),_0x576cb3+'-'+_0x4cfc14+'/'+_0x5bad85)[_0x6419('0x26')](_0x2ba806);}return null;};}function patchUpdates(_0xb52de4){return function(_0x48202f){try{jsonpatch[_0x6419('0x27')](_0x48202f,_0xb52de4,!![]);}catch(_0x545bc1){return BPromise[_0x6419('0x28')](_0x545bc1);}return _0x48202f[_0x6419('0x29')]();};}function saveUpdates(_0x210b04,_0x4e1222){return function(_0x226d96){if(_0x226d96){return _0x226d96[_0x6419('0x2a')](_0x210b04)[_0x6419('0x2b')](function(_0x3dc57b){return _0x3dc57b;});}return null;};}function handleEntityNotFound(_0x5054bf,_0x401260){return function(_0x58e189){if(!_0x58e189){_0x5054bf[_0x6419('0x1e')](0x194);}return _0x58e189;};}function handleError(_0x25056f,_0x50127f){_0x50127f=_0x50127f||0x1f4;return function(_0x2f4c8b){logger[_0x6419('0x2c')](_0x2f4c8b[_0x6419('0x2d')]);if(_0x2f4c8b[_0x6419('0x2e')]){delete _0x2f4c8b[_0x6419('0x2e')];}_0x25056f[_0x6419('0x1f')](_0x50127f)[_0x6419('0x2f')](_0x2f4c8b);};}exports[_0x6419('0x30')]=function(_0x1a6514,_0x5d366f){var _0x551c22={},_0x2df34b={},_0x1f85d9={'count':0x0,'rows':[]};var _0x1aee44=_[_0x6419('0x31')](db[_0x6419('0x32')][_0x6419('0x33')],function(_0x9dd3c9){return{'name':_0x9dd3c9[_0x6419('0x34')],'type':_0x9dd3c9[_0x6419('0x35')]['key']};});_0x2df34b[_0x6419('0x36')]=_[_0x6419('0x31')](_0x1aee44,_0x6419('0x2e'));_0x2df34b[_0x6419('0x37')]=_['keys'](_0x1a6514['query']);_0x2df34b[_0x6419('0x38')]=_[_0x6419('0x39')](_0x2df34b['model'],_0x2df34b[_0x6419('0x37')]);_0x551c22[_0x6419('0x3a')]=_[_0x6419('0x39')](_0x2df34b[_0x6419('0x36')],qs['fields'](_0x1a6514[_0x6419('0x37')]['fields']));_0x551c22[_0x6419('0x3a')]=_0x551c22[_0x6419('0x3a')][_0x6419('0x3b')]?_0x551c22[_0x6419('0x3a')]:_0x2df34b[_0x6419('0x36')];if(!_0x1a6514[_0x6419('0x37')]['hasOwnProperty'](_0x6419('0x3c'))){_0x551c22[_0x6419('0x22')]=qs[_0x6419('0x22')](_0x1a6514[_0x6419('0x37')][_0x6419('0x22')]);_0x551c22[_0x6419('0x20')]=qs[_0x6419('0x20')](_0x1a6514[_0x6419('0x37')][_0x6419('0x20')]);}_0x551c22[_0x6419('0x3d')]=qs[_0x6419('0x3e')](_0x1a6514[_0x6419('0x37')][_0x6419('0x3e')]);_0x551c22['where']=qs[_0x6419('0x38')](_[_0x6419('0x3f')](_0x1a6514[_0x6419('0x37')],_0x2df34b['filters']),_0x1aee44);if(_0x1a6514[_0x6419('0x37')][_0x6419('0x40')]){_0x551c22[_0x6419('0x41')]=_[_0x6419('0x42')](_0x551c22['where'],{'$or':_[_0x6419('0x31')](_0x1aee44,function(_0xe10df1){if(_0xe10df1[_0x6419('0x35')]!==_0x6419('0x43')){var _0x12f27a={};_0x12f27a[_0xe10df1[_0x6419('0x2e')]]={'$like':'%'+_0x1a6514[_0x6419('0x37')][_0x6419('0x40')]+'%'};return _0x12f27a;}})});}_0x551c22=_[_0x6419('0x42')]({},_0x551c22,_0x1a6514[_0x6419('0x44')]);var _0xa23a13={'where':_0x551c22[_0x6419('0x41')]};return db['Team']['count'](_0xa23a13)[_0x6419('0x2b')](function(_0x1cbd8d){_0x1f85d9[_0x6419('0x23')]=_0x1cbd8d;if(_0x1a6514[_0x6419('0x37')][_0x6419('0x45')]){_0x551c22[_0x6419('0x46')]=[{'all':!![]}];}return db[_0x6419('0x32')][_0x6419('0x47')](_0x551c22);})[_0x6419('0x2b')](function(_0x4fe116){_0x1f85d9[_0x6419('0x48')]=_0x4fe116;return _0x1f85d9;})[_0x6419('0x2b')](respondWithFilteredResult(_0x5d366f,_0x551c22))[_0x6419('0x49')](handleError(_0x5d366f,null));};exports[_0x6419('0x4a')]=function(_0x58ea9b,_0x15b29e){var _0x96e09e={'raw':![],'where':{'id':_0x58ea9b[_0x6419('0x4b')]['id']}},_0x5e9385={};_0x5e9385[_0x6419('0x36')]=_['keys'](db[_0x6419('0x32')]['rawAttributes']);_0x5e9385[_0x6419('0x37')]=_[_0x6419('0x4c')](_0x58ea9b[_0x6419('0x37')]);_0x5e9385[_0x6419('0x38')]=_[_0x6419('0x39')](_0x5e9385[_0x6419('0x36')],_0x5e9385['query']);_0x96e09e[_0x6419('0x3a')]=_[_0x6419('0x39')](_0x5e9385['model'],qs[_0x6419('0x4d')](_0x58ea9b[_0x6419('0x37')][_0x6419('0x4d')]));_0x96e09e['attributes']=_0x96e09e[_0x6419('0x3a')][_0x6419('0x3b')]?_0x96e09e['attributes']:_0x5e9385[_0x6419('0x36')];if(_0x58ea9b[_0x6419('0x37')][_0x6419('0x45')]){_0x96e09e[_0x6419('0x46')]=[{'all':!![]}];}_0x96e09e=_[_0x6419('0x42')]({},_0x96e09e,_0x58ea9b[_0x6419('0x44')]);return db[_0x6419('0x32')]['find'](_0x96e09e)[_0x6419('0x2b')](handleEntityNotFound(_0x15b29e,null))[_0x6419('0x2b')](respondWithResult(_0x15b29e,null))[_0x6419('0x49')](handleError(_0x15b29e,null));};exports[_0x6419('0x4e')]=function(_0x586b71,_0x4fee61){return db[_0x6419('0x32')][_0x6419('0x4e')](_0x586b71['body'],{})[_0x6419('0x2b')](function(_0x1e4b48){var _0x519522=_0x586b71[_0x6419('0x4f')][_0x6419('0x50')]({'plain':!![]});if(!_0x519522)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x519522[_0x6419('0x51')]===_0x6419('0x4f')){var _0x542bea=_0x1e4b48['get']({'plain':!![]});var _0x350113='Teams';return db[_0x6419('0x52')][_0x6419('0x53')]({'where':{'name':_0x350113,'userProfileId':_0x519522[_0x6419('0x54')]},'raw':!![]})[_0x6419('0x2b')](function(_0x2c99ec){if(_0x2c99ec&&_0x2c99ec['autoAssociation']===0x0){return db['UserProfileResource'][_0x6419('0x4e')]({'name':_0x542bea['name'],'resourceId':_0x542bea['id'],'type':_0x2c99ec[_0x6419('0x2e')],'sectionId':_0x2c99ec['id']},{})[_0x6419('0x2b')](function(){return _0x1e4b48;});}else{return _0x1e4b48;}})['catch'](function(_0x127c09){logger['error'](_0x6419('0x55'),_0x127c09);throw _0x127c09;});}return _0x1e4b48;})[_0x6419('0x2b')](respondWithResult(_0x4fee61,0xc9))[_0x6419('0x49')](handleError(_0x4fee61,null));};exports[_0x6419('0x2a')]=function(_0x50edf8,_0x95f1ba){if(_0x50edf8[_0x6419('0x56')]['id']){delete _0x50edf8[_0x6419('0x56')]['id'];}return db[_0x6419('0x32')][_0x6419('0x53')]({'where':{'id':_0x50edf8['params']['id']}})[_0x6419('0x2b')](handleEntityNotFound(_0x95f1ba,null))[_0x6419('0x2b')](saveUpdates(_0x50edf8[_0x6419('0x56')],null))['then'](respondWithResult(_0x95f1ba,null))[_0x6419('0x49')](handleError(_0x95f1ba,null));};exports['destroy']=function(_0x1385e2,_0x20f2fe){var _0x1adb35=_0x1385e2[_0x6419('0x4b')]['id'];var _0x40ef00=[];return db['sequelize'][_0x6419('0x57')](function(_0x161c32){var _0x3e2bfd=_0x6419('0x58')+_0x1adb35;return db[_0x6419('0x59')][_0x6419('0x37')](_0x3e2bfd,{'type':db[_0x6419('0x5a')][_0x6419('0x5b')][_0x6419('0x5c')],'raw':!![],'transaction':_0x161c32})[_0x6419('0x2b')](function(_0x1f81eb){_0x40ef00=_['map'](_0x1f81eb,function(_0x295f83){return Number(_0x295f83[_0x6419('0x5d')]);});})['then'](function(){var _0x23689d='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1adb35;return db[_0x6419('0x59')][_0x6419('0x37')](_0x23689d,{'type':db[_0x6419('0x5a')][_0x6419('0x5b')][_0x6419('0x5c')],'raw':!![],'transaction':_0x161c32});})[_0x6419('0x2b')](function(_0x1bf8d5){var _0x358796=_[_0x6419('0x31')](_0x1bf8d5,function(_0x3ba924){return Number(_0x3ba924[_0x6419('0x5e')]);});return db['UserVoiceQueue'][_0x6419('0x5f')]({'where':{'UserId':{'$in':_0x40ef00},'VoiceQueueId':{'$in':_0x358796}},'transaction':_0x161c32});})[_0x6419('0x2b')](function(){var _0x474c3f=_0x6419('0x60')+_0x1adb35;return db[_0x6419('0x59')]['query'](_0x474c3f,{'type':db[_0x6419('0x5a')][_0x6419('0x5b')]['SELECT'],'raw':!![],'transaction':_0x161c32});})[_0x6419('0x2b')](function(_0x40e7a3){var _0xf72473=_[_0x6419('0x31')](_0x40e7a3,function(_0x32860e){return Number(_0x32860e[_0x6419('0x61')]);});return db[_0x6419('0x62')]['destroy']({'where':{'UserId':{'$in':_0x40ef00},'MailQueueId':{'$in':_0xf72473}},'transaction':_0x161c32});})[_0x6419('0x2b')](function(){var _0x5219f3=_0x6419('0x63')+_0x1adb35;return db[_0x6419('0x59')]['query'](_0x5219f3,{'type':db[_0x6419('0x5a')][_0x6419('0x5b')][_0x6419('0x5c')],'raw':!![],'transaction':_0x161c32});})[_0x6419('0x2b')](function(_0x6c6917){var _0x1bf89c=_['map'](_0x6c6917,function(_0x4f07ad){return Number(_0x4f07ad[_0x6419('0x64')]);});return db['UserSmsQueue'][_0x6419('0x5f')]({'where':{'UserId':{'$in':_0x40ef00},'SmsQueueId':{'$in':_0x1bf89c}},'transaction':_0x161c32});})[_0x6419('0x2b')](function(){var _0x253880=_0x6419('0x65')+_0x1adb35;return db[_0x6419('0x59')]['query'](_0x253880,{'type':db[_0x6419('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x161c32});})[_0x6419('0x2b')](function(_0x5e236d){var _0x19a412=_[_0x6419('0x31')](_0x5e236d,function(_0x1bdc0f){return Number(_0x1bdc0f[_0x6419('0x66')]);});return db[_0x6419('0x67')]['destroy']({'where':{'UserId':{'$in':_0x40ef00},'ChatQueueId':{'$in':_0x19a412}},'transaction':_0x161c32});})[_0x6419('0x2b')](function(){var _0x89f5fa=_0x6419('0x68')+_0x1adb35;return db[_0x6419('0x59')][_0x6419('0x37')](_0x89f5fa,{'type':db['Sequelize']['QueryTypes'][_0x6419('0x5c')],'raw':!![],'transaction':_0x161c32});})[_0x6419('0x2b')](function(_0x14f566){var _0x39ab1e=_['map'](_0x14f566,function(_0x5dd54a){return Number(_0x5dd54a[_0x6419('0x69')]);});return db[_0x6419('0x6a')][_0x6419('0x5f')]({'where':{'UserId':{'$in':_0x40ef00},'FaxQueueId':{'$in':_0x39ab1e}},'transaction':_0x161c32});})[_0x6419('0x2b')](function(){var _0x5678c4='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1adb35;return db[_0x6419('0x59')][_0x6419('0x37')](_0x5678c4,{'type':db[_0x6419('0x5a')][_0x6419('0x5b')][_0x6419('0x5c')],'raw':!![],'transaction':_0x161c32});})['then'](function(_0x30baeb){var _0x3ff295=_[_0x6419('0x31')](_0x30baeb,function(_0x4f529b){return Number(_0x4f529b['OpenchannelQueueId']);});return db[_0x6419('0x6b')][_0x6419('0x5f')]({'where':{'UserId':{'$in':_0x40ef00},'OpenchannelQueueId':{'$in':_0x3ff295}},'transaction':_0x161c32});})[_0x6419('0x2b')](function(){var _0x3ad5d5=_0x6419('0x6c')+_0x1adb35;return db[_0x6419('0x59')][_0x6419('0x37')](_0x3ad5d5,{'type':db[_0x6419('0x5a')][_0x6419('0x5b')][_0x6419('0x5c')],'raw':!![],'transaction':_0x161c32});})[_0x6419('0x2b')](function(_0x27a9b3){var _0x3243dc=_[_0x6419('0x31')](_0x27a9b3,function(_0x3d6634){return Number(_0x3d6634[_0x6419('0x6d')]);});return db[_0x6419('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x40ef00},'WhatsappQueueId':{'$in':_0x3243dc}},'transaction':_0x161c32});})[_0x6419('0x2b')](function(){return db[_0x6419('0x6f')][_0x6419('0x53')]({'where':{'TeamId':_0x1adb35}});})[_0x6419('0x2b')](function(_0x59a971){if(_0x59a971===null){return;}return db['UserVoicePrefix'][_0x6419('0x5f')]({'where':{'UserId':{'$in':_0x40ef00},'VoicePrefixId':_0x59a971[_0x6419('0x70')]},'transaction':_0x161c32});})[_0x6419('0x2b')](function(){return db['Team']['destroy']({'where':{'id':_0x1adb35},'cascade':!![],'transaction':_0x161c32});})[_0x6419('0x2b')](function(_0x4bed9b){if(_0x4bed9b===0x0){_0x20f2fe[_0x6419('0x1e')](0x194);}else{return db[_0x6419('0x71')][_0x6419('0x5f')]({'where':{'type':_0x6419('0x72'),'resourceId':_0x1adb35},'cascade':!![],'transaction':_0x161c32})[_0x6419('0x2b')](function(){_0x20f2fe[_0x6419('0x1f')](0xcc)[_0x6419('0x73')]();});}})['catch'](function(_0x5c3f71){_0x20f2fe[_0x6419('0x1f')](0x1f4)[_0x6419('0x2f')](_0x5c3f71);});});};exports[_0x6419('0x74')]=function(_0xb9343c,_0x309654,_0x117321){return db[_0x6419('0x32')][_0x6419('0x75')]({'where':{'id':_0xb9343c[_0x6419('0x4b')]['id']}})[_0x6419('0x2b')](handleEntityNotFound(_0x309654,null))[_0x6419('0x2b')](function(_0x35c683){if(!_0xb9343c[_0x6419('0x37')][_0x6419('0x76')]||!utils[_0x6419('0x77')](_0xb9343c[_0x6419('0x37')]['channel'])){throw new db[(_0x6419('0x5a'))]['ValidationError'](_0x6419('0x78'));}var _0x3aeacb={};var _0x50019a={};_0x50019a['model']=_[_0x6419('0x4c')](db[_['capitalize'](_0xb9343c[_0x6419('0x37')][_0x6419('0x76')]['toLowerCase']())+_0x6419('0x79')][_0x6419('0x33')]);_0x50019a[_0x6419('0x37')]=_[_0x6419('0x4c')](_0xb9343c[_0x6419('0x37')]);_0x50019a[_0x6419('0x38')]=_['intersection'](_0x50019a['model'],_0x50019a['query']);_0x3aeacb[_0x6419('0x3a')]=_[_0x6419('0x39')](_0x50019a[_0x6419('0x36')],qs[_0x6419('0x4d')](_0xb9343c[_0x6419('0x37')][_0x6419('0x4d')]));_0x3aeacb[_0x6419('0x3a')]=_0x3aeacb[_0x6419('0x3a')][_0x6419('0x3b')]?_0x3aeacb['attributes']:_0x50019a[_0x6419('0x36')];_0x3aeacb[_0x6419('0x22')]=qs[_0x6419('0x22')](_0xb9343c[_0x6419('0x37')][_0x6419('0x22')]);_0x3aeacb['offset']=qs[_0x6419('0x20')](_0xb9343c['query'][_0x6419('0x20')]);_0x3aeacb[_0x6419('0x3d')]=qs[_0x6419('0x3e')](_0xb9343c[_0x6419('0x37')]['sort']);_0x3aeacb['where']=qs[_0x6419('0x38')](_[_0x6419('0x3f')](_0xb9343c[_0x6419('0x37')],_0x50019a[_0x6419('0x38')]));_0x3aeacb=_[_0x6419('0x42')]({},_0x3aeacb,_0xb9343c[_0x6419('0x44')]);return _0x35c683[_0x6419('0x50')+_['capitalize'](_0xb9343c[_0x6419('0x37')][_0x6419('0x76')]['toLowerCase']())+_0x6419('0x7a')](_0x3aeacb);})['then'](respondWithResult(_0x309654,null))['catch'](handleError(_0x309654,null));};exports[_0x6419('0x7b')]=function(_0x222fdd,_0x3adf2c,_0x3585e0){return db[_0x6419('0x32')][_0x6419('0x75')]({'where':{'id':_0x222fdd[_0x6419('0x4b')]['id']}})[_0x6419('0x2b')](function(_0x47a979){if(_0x47a979){if(!_0x222fdd[_0x6419('0x56')][_0x6419('0x76')]||!utils[_0x6419('0x77')](_0x222fdd[_0x6419('0x56')]['channel'])){throw new db[(_0x6419('0x5a'))][(_0x6419('0x7c'))]('Unknown\x20channel');}return _0x47a979[_0x6419('0x7d')+_['capitalize'](_0x222fdd['body'][_0x6419('0x76')][_0x6419('0x7e')]())+_0x6419('0x7a')](_0x222fdd[_0x6419('0x56')][_0x6419('0x7f')]);}return null;})['then'](handleEntityNotFound(_0x3adf2c,null))['then'](respondWithStatusCode(_0x3adf2c,null))[_0x6419('0x49')](handleError(_0x3adf2c,null));};exports['removeQueues']=function(_0x24c57d,_0xa026df,_0xf561c8){return db['Team'][_0x6419('0x75')]({'where':{'id':_0x24c57d[_0x6419('0x4b')]['id']}})[_0x6419('0x2b')](function(_0x2602c7){if(_0x2602c7){if(!_0x24c57d[_0x6419('0x37')][_0x6419('0x76')]||!utils[_0x6419('0x77')](_0x24c57d[_0x6419('0x37')][_0x6419('0x76')])){throw new db[(_0x6419('0x5a'))][(_0x6419('0x7c'))](_0x6419('0x78'));}return _0x2602c7[_0x6419('0x80')+_[_0x6419('0x81')](_0x24c57d[_0x6419('0x37')][_0x6419('0x76')][_0x6419('0x7e')]())+_0x6419('0x7a')](_0x24c57d[_0x6419('0x37')][_0x6419('0x7f')]);}return null;})[_0x6419('0x2b')](handleEntityNotFound(_0xa026df,null))[_0x6419('0x2b')](respondWithStatusCode(_0xa026df,null))['catch'](handleError(_0xa026df,null));};exports[_0x6419('0x82')]=function(_0x37480d,_0x3d6873){var _0x54fa89=_[_0x6419('0x83')](_0x37480d[_0x6419('0x56')][_0x6419('0x7f')])?_0x37480d[_0x6419('0x56')][_0x6419('0x7f')]:[_0x37480d[_0x6419('0x56')][_0x6419('0x7f')]];var _0x422e=_0x37480d[_0x6419('0x4b')]['id'];return db[_0x6419('0x32')][_0x6419('0x53')]({'where':{'id':_0x422e}})['then'](handleEntityNotFound(_0x3d6873,null))['then'](function(_0x49a2aa){if(_0x49a2aa){var _0x1ec57e=[_0x6419('0x84'),'Chat',_0x6419('0x85'),_0x6419('0x86'),'Fax','Openchannel',_0x6419('0x87')];return db[_0x6419('0x59')]['transaction'](function(_0x2c17c2){var _0x4e59f0=_[_0x6419('0x31')](_0x1ec57e,function(_0x102ad2){var _0x3423c0={'attributes':['id','name']};if(_0x102ad2===_0x6419('0x84')){_0x3423c0[_0x6419('0x88')]={'attributes':[_0x6419('0x89')]};}return _0x49a2aa[_0x6419('0x50')+_0x102ad2+_0x6419('0x7a')](_0x3423c0)['then'](function(_0xe52510){var _0xe2d97e=_[_0x6419('0x31')](_0xe52510,function(_0x1753cc){var _0x488413=_['map'](_0x54fa89,function(_0xd75664){var _0x3ca510={'where':{'UserId':_0xd75664,[_0x102ad2+_0x6419('0x8a')]:_0x1753cc['id']},'transaction':_0x2c17c2};if(_0x102ad2===_0x6419('0x84')){_0x3ca510[_0x6419('0x19')]={'penalty':_0x1753cc[_0x6419('0x8b')]['penalty']};}return db[_0x6419('0x8c')+_0x102ad2+_0x6419('0x79')][_0x6419('0x8d')](_0x3ca510)['then'](function(){socket[_0x6419('0x8e')](_0x6419('0x4f')+_0x102ad2+_0x6419('0x8f'),{'UserId':_0xd75664,[_0x102ad2+_0x6419('0x8a')]:_0x1753cc['id']});if(_0x102ad2!==_0x6419('0x84')){return;}return db[_0x6419('0x8c')]['findAll']({'where':{'id':_0x54fa89,'online':0x1},'attributes':['id',_0x6419('0x2e'),_0x6419('0x90'),_0x6419('0x91'),'interface'],'raw':!![]})[_0x6419('0x2b')](function(_0x14da2c){var _0x5e6f9e=_[_0x6419('0x31')](_0x14da2c,function(_0x361986){return db[_0x6419('0x92')][_0x6419('0x93')]({'membername':_0x361986[_0x6419('0x2e')],'UserId':_0x361986['id'],'queue_name':_0x1753cc[_0x6419('0x2e')],'VoiceQueueId':_0x1753cc['id'],'interface':_[_0x6419('0x94')](_0x361986[_0x6419('0x95')])?util['format'](_0x6419('0x96'),_0x361986[_0x6419('0x2e')]):_0x361986[_0x6419('0x95')],'paused':_0x361986['voicePause']||![],'penalty':_0x1753cc[_0x6419('0x8b')]['penalty']},{'transaction':_0x2c17c2});});return Promise[_0x6419('0x97')](_0x5e6f9e);});});});return Promise['all'](_0x488413);});return Promise[_0x6419('0x97')](_0xe2d97e);})[_0x6419('0x2b')](function(){return db[_0x6419('0x6f')][_0x6419('0x75')]({'where':{'teamId':_0x422e}})[_0x6419('0x2b')](function(_0x776c4){if(_0x776c4){var _0x59d7b9=_[_0x6419('0x31')](_0x54fa89,function(_0x1d7a25){db[_0x6419('0x98')][_0x6419('0x93')]({'UserId':_0x1d7a25,'VoicePrefixId':_0x776c4[_0x6419('0x70')]});});return Promise['all'](_0x59d7b9);}});});});return Promise['all'](_0x4e59f0)[_0x6419('0x2b')](function(){return _0x49a2aa[_0x6419('0x82')](_0x54fa89,{'transaction':_0x2c17c2})[_0x6419('0x99')](function(_0x3088ca){return _0x3088ca;});});});}})[_0x6419('0x2b')](respondWithResult(_0x3d6873,null))[_0x6419('0x49')](handleError(_0x3d6873,null));};exports['removeAgents']=function(_0x5351c0,_0x406b9e){var _0x4433d1=_[_0x6419('0x83')](_0x5351c0[_0x6419('0x37')][_0x6419('0x7f')])?_0x5351c0[_0x6419('0x37')][_0x6419('0x7f')]:[_0x5351c0['query'][_0x6419('0x7f')]];var _0x58da33=_0x5351c0['params']['id'];return db[_0x6419('0x32')]['find']({'where':{'id':_0x58da33}})[_0x6419('0x2b')](handleEntityNotFound(_0x406b9e,null))[_0x6419('0x2b')](function(_0x1bab6e){if(_0x1bab6e){var _0x137c1b=[_0x6419('0x84'),'Chat',_0x6419('0x85'),_0x6419('0x86'),_0x6419('0x9a'),_0x6419('0x9b'),_0x6419('0x87')];return db[_0x6419('0x59')][_0x6419('0x57')](function(_0x479d2f){var _0x2c666c=_[_0x6419('0x31')](_0x137c1b,function(_0x26f925){var _0x548b94={'attributes':['id',_0x6419('0x2e')]};return _0x1bab6e[_0x6419('0x50')+_0x26f925+_0x6419('0x7a')](_0x548b94)[_0x6419('0x2b')](function(_0x274e69){var _0x352a05=_[_0x6419('0x31')](_0x274e69,function(_0xdc0ef9){return _0xdc0ef9['removeAgents'](_0x4433d1,{'transaction':_0x479d2f})['then'](function(){var _0x43b27f=_['map'](_0x4433d1,function(_0x5f4e85){socket[_0x6419('0x8e')](_0x6419('0x4f')+_0x26f925+_0x6419('0x9c'),{'UserId':Number(_0x5f4e85),[_0x26f925+_0x6419('0x8a')]:_0xdc0ef9['id']});if(_0x26f925!==_0x6419('0x84')){return;}return db['UserVoiceQueueRt'][_0x6419('0x5f')]({'where':{'VoiceQueueId':_0xdc0ef9['id'],'UserId':_0x5f4e85},'transaction':_0x479d2f});});return Promise['all'](_0x43b27f);});});return Promise[_0x6419('0x97')](_0x352a05);});});return Promise[_0x6419('0x97')](_0x2c666c)[_0x6419('0x2b')](function(){return _0x1bab6e[_0x6419('0x9d')](_0x4433d1,{'transaction':_0x479d2f});})[_0x6419('0x2b')](function(){return db[_0x6419('0x6f')][_0x6419('0x75')]({'where':{'teamId':_0x58da33}})[_0x6419('0x2b')](function(_0x317d18){if(_0x317d18){var _0x22f59b=_['map'](_0x4433d1,function(_0x1141c0){db['UserVoicePrefix'][_0x6419('0x5f')]({'where':{'UserId':_0x1141c0,'VoicePrefixId':_0x317d18['VoicePrefixId']}});});return Promise[_0x6419('0x97')](_0x22f59b);}});});});}})['then'](respondWithStatusCode(_0x406b9e,null))['catch'](handleError(_0x406b9e,null));};exports[_0x6419('0x9e')]=function(_0x46cd43,_0x36e72d,_0xd2108c){var _0x512845={};var _0x2875dc={};var _0x21ac00;var _0x519c92;return db[_0x6419('0x32')][_0x6419('0x75')]({'where':{'id':_0x46cd43[_0x6419('0x4b')]['id']}})[_0x6419('0x2b')](handleEntityNotFound(_0x36e72d,null))['then'](function(_0x55c018){if(_0x55c018){_0x21ac00=_0x55c018;_0x2875dc['model']=_['keys'](db['User'][_0x6419('0x33')]);_0x2875dc[_0x6419('0x37')]=_['keys'](_0x46cd43['query']);_0x2875dc['filters']=_[_0x6419('0x39')](_0x2875dc[_0x6419('0x36')],_0x2875dc[_0x6419('0x37')]);_0x512845['attributes']=_[_0x6419('0x39')](_0x2875dc[_0x6419('0x36')],qs[_0x6419('0x4d')](_0x46cd43[_0x6419('0x37')][_0x6419('0x4d')]));_0x512845[_0x6419('0x3a')]=_0x512845['attributes'][_0x6419('0x3b')]?_0x512845[_0x6419('0x3a')]:_0x2875dc[_0x6419('0x36')];_0x512845[_0x6419('0x3d')]=qs[_0x6419('0x3e')](_0x46cd43['query'][_0x6419('0x3e')]);_0x512845['where']=qs[_0x6419('0x38')](_[_0x6419('0x3f')](_0x46cd43[_0x6419('0x37')],_0x2875dc[_0x6419('0x38')]));if(_0x46cd43['query']['filter']){_0x512845['where']=_[_0x6419('0x42')](_0x512845[_0x6419('0x41')],{'$or':_[_0x6419('0x31')](_0x512845[_0x6419('0x3a')],function(_0x564739){var _0x361378={};_0x361378[_0x564739]={'$like':'%'+_0x46cd43[_0x6419('0x37')]['filter']+'%'};return _0x361378;})});}_0x512845=_['merge']({},_0x512845,_0x46cd43[_0x6419('0x44')]);return _0x21ac00[_0x6419('0x9e')](_0x512845);}})[_0x6419('0x2b')](function(_0xa46c3c){if(_0xa46c3c){_0x519c92=_0xa46c3c['length'];if(!_0x46cd43['query'][_0x6419('0x9f')](_0x6419('0x3c'))){_0x512845[_0x6419('0x22')]=qs[_0x6419('0x22')](_0x46cd43['query'][_0x6419('0x22')]);_0x512845[_0x6419('0x20')]=qs['offset'](_0x46cd43[_0x6419('0x37')][_0x6419('0x20')]);}return _0x21ac00[_0x6419('0x9e')](_0x512845);}})[_0x6419('0x2b')](function(_0x6f2792){if(_0x6f2792){return _0x6f2792?{'count':_0x519c92,'rows':_0x6f2792}:null;}})[_0x6419('0x2b')](respondWithResult(_0x36e72d,null))['catch'](handleError(_0x36e72d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index b107212..1f3eeaf 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 _0xc064=['../../mysqldb','Team','emit','hasOwnProperty','exports','events'];(function(_0x563201,_0x9b82b6){var _0xa91133=function(_0x149db4){while(--_0x149db4){_0x563201['push'](_0x563201['shift']());}};_0xa91133(++_0x9b82b6);}(_0xc064,0x1af));var _0x4c06=function(_0x5aefb8,_0x8db666){_0x5aefb8=_0x5aefb8-0x0;var _0x257c0a=_0xc064[_0x5aefb8];return _0x257c0a;};'use strict';var EventEmitter=require(_0x4c06('0x0'));var Team=require(_0x4c06('0x1'))['db'][_0x4c06('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21b91){return function(_0x1095bf,_0x22c71a,_0x4c66ea){TeamEvents[_0x4c06('0x3')](_0x21b91+':'+_0x1095bf['id'],_0x1095bf);TeamEvents[_0x4c06('0x3')](_0x21b91,_0x1095bf);_0x4c66ea(null);};}for(var e in events){if(events[_0x4c06('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x4c06('0x5')]=TeamEvents; \ No newline at end of file +var _0xc714=['../../mysqldb','Team','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x430459,_0x58519c){var _0x3a2439=function(_0x27a0b3){while(--_0x27a0b3){_0x430459['push'](_0x430459['shift']());}};_0x3a2439(++_0x58519c);}(_0xc714,0x13a));var _0x4c71=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc714[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x4c71('0x0'));var Team=require(_0x4c71('0x1'))['db'][_0x4c71('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4c71('0x3')](0x0);var events={'afterCreate':_0x4c71('0x4'),'afterUpdate':_0x4c71('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4336d4){return function(_0x559c23,_0x5f4274,_0x41593a){TeamEvents[_0x4c71('0x6')](_0x4336d4+':'+_0x559c23['id'],_0x559c23);TeamEvents['emit'](_0x4336d4,_0x559c23);_0x41593a(null);};}for(var e in events){if(events[_0x4c71('0x7')](e)){var event=events[e];Team[_0x4c71('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 1827632..51b8b19 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 _0x7cb7=['Team','teams','Chat','Mail','Voice','Whatsapp','resolve','all','lodash','then','map','setDataValue','channel','catch','exports','define'];(function(_0x2ebfcc,_0x58f78f){var _0x5970fa=function(_0x1a5af0){while(--_0x1a5af0){_0x2ebfcc['push'](_0x2ebfcc['shift']());}};_0x5970fa(++_0x58f78f);}(_0x7cb7,0xc8));var _0x77cb=function(_0x1ab516,_0x331ba9){_0x1ab516=_0x1ab516-0x0;var _0x2a293e=_0x7cb7[_0x1ab516];return _0x2a293e;};'use strict';var _=require(_0x77cb('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x4a698b,_0x1b1318){var _0x4298ba='get'+_0x1b1318+'Queues';return _0x4a698b[_0x4298ba]()[_0x77cb('0x1')](function(_0x5b92ec){return _[_0x77cb('0x2')](_0x5b92ec,function(_0x55f3e8){_0x55f3e8[_0x77cb('0x3')](_0x77cb('0x4'),_0x1b1318);return _0x55f3e8;});})[_0x77cb('0x5')](function(_0x2a7078){throw _0x2a7078;});}module[_0x77cb('0x6')]=function(_0x4d0d56){return _0x4d0d56[_0x77cb('0x7')](_0x77cb('0x8'),attributes,{'tableName':_0x77cb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2464f3=this;var _0x134d89=[_0x77cb('0xa'),'Fax',_0x77cb('0xb'),'Openchannel','Sms',_0x77cb('0xc'),_0x77cb('0xd')];return Promise[_0x77cb('0xe')]()[_0x77cb('0x1')](function(){var _0xbf01e9=_[_0x77cb('0x2')](_0x134d89,function(_0x38490c){return getQueuesByChannel(_0x2464f3,_0x38490c);});return Promise[_0x77cb('0xf')](_0xbf01e9);})[_0x77cb('0x5')](function(_0x20d488){throw _0x20d488;});}}});}; \ No newline at end of file +var _0xe8a2=['channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','lodash','get','Queues','then','map','setDataValue'];(function(_0x3b9b30,_0x4b3d26){var _0x4bf216=function(_0x1445be){while(--_0x1445be){_0x3b9b30['push'](_0x3b9b30['shift']());}};_0x4bf216(++_0x4b3d26);}(_0xe8a2,0x120));var _0x2e8a=function(_0x47ca5c,_0x133a37){_0x47ca5c=_0x47ca5c-0x0;var _0x221fbe=_0xe8a2[_0x47ca5c];return _0x221fbe;};'use strict';var _=require(_0x2e8a('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x5657b8,_0x5b3b23){var _0x2d62e1=_0x2e8a('0x1')+_0x5b3b23+_0x2e8a('0x2');return _0x5657b8[_0x2d62e1]()[_0x2e8a('0x3')](function(_0x29fd39){return _[_0x2e8a('0x4')](_0x29fd39,function(_0x4dc15a){_0x4dc15a[_0x2e8a('0x5')](_0x2e8a('0x6'),_0x5b3b23);return _0x4dc15a;});})[_0x2e8a('0x7')](function(_0x1c7048){throw _0x1c7048;});}module[_0x2e8a('0x8')]=function(_0x7eb1b3){return _0x7eb1b3[_0x2e8a('0x9')](_0x2e8a('0xa'),attributes,{'tableName':_0x2e8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5e636d=this;var _0x2c6df7=[_0x2e8a('0xc'),_0x2e8a('0xd'),_0x2e8a('0xe'),_0x2e8a('0xf'),_0x2e8a('0x10'),_0x2e8a('0x11'),_0x2e8a('0x12')];return Promise[_0x2e8a('0x13')]()['then'](function(){var _0x38b1b2=_['map'](_0x2c6df7,function(_0x5c825a){return getQueuesByChannel(_0x5e636d,_0x5c825a);});return Promise[_0x2e8a('0x14')](_0x38b1b2);})[_0x2e8a('0x7')](function(_0x2e2ec2){throw _0x2e2ec2;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 17c9f46..1c656be 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 _0xc7d7=['stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','defaults','redis','./team.socket','register','request','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0x2dfaec,_0x387ea1){var _0x50ffff=function(_0x376536){while(--_0x376536){_0x2dfaec['push'](_0x2dfaec['shift']());}};_0x50ffff(++_0x387ea1);}(_0xc7d7,0x11a));var _0x7c7d=function(_0x836e67,_0x23b165){_0x836e67=_0x836e67-0x0;var _0x178ba4=_0xc7d7[_0x836e67];return _0x178ba4;};'use strict';var _=require(_0x7c7d('0x0'));var util=require('util');var moment=require(_0x7c7d('0x1'));var BPromise=require(_0x7c7d('0x2'));var rs=require(_0x7c7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7c7d('0x5'));var config=require(_0x7c7d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7c7d('0x7')][_0x7c7d('0x8')]({'port':0x232a});config['redis']=_[_0x7c7d('0x9')](config[_0x7c7d('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c7d('0xa')]));require(_0x7c7d('0xb'))[_0x7c7d('0xc')](socket);function respondWithRpcPromise(_0xcdf007,_0x157fcc,_0x3dd405){return new BPromise(function(_0x5b386d,_0x5ddf6c){return client[_0x7c7d('0xd')](_0xcdf007,_0x3dd405)['then'](function(_0xec41a1){logger[_0x7c7d('0xe')](_0x7c7d('0xf'),_0x157fcc,'request\x20sent');logger[_0x7c7d('0x10')](_0x7c7d('0x11'),_0x157fcc,'request\x20sent',JSON[_0x7c7d('0x12')](_0xec41a1));if(_0xec41a1[_0x7c7d('0x13')]){if(_0xec41a1[_0x7c7d('0x13')][_0x7c7d('0x14')]===0x1f4){logger[_0x7c7d('0x13')](_0x7c7d('0xf'),_0x157fcc,_0xec41a1[_0x7c7d('0x13')][_0x7c7d('0x15')]);return _0x5ddf6c(_0xec41a1[_0x7c7d('0x13')][_0x7c7d('0x15')]);}logger[_0x7c7d('0x13')](_0x7c7d('0xf'),_0x157fcc,_0xec41a1[_0x7c7d('0x13')][_0x7c7d('0x15')]);return _0x5b386d(_0xec41a1[_0x7c7d('0x13')][_0x7c7d('0x15')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x157fcc,_0x7c7d('0x16'));_0x5b386d(_0xec41a1[_0x7c7d('0x17')][_0x7c7d('0x15')]);}})[_0x7c7d('0x18')](function(_0x46f640){logger[_0x7c7d('0x13')](_0x7c7d('0xf'),_0x157fcc,_0x46f640);_0x5ddf6c(_0x46f640);});});} \ No newline at end of file +var _0x7123=['then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request'];(function(_0x373224,_0x5c6cc8){var _0x3f8d8b=function(_0x48745c){while(--_0x48745c){_0x373224['push'](_0x373224['shift']());}};_0x3f8d8b(++_0x5c6cc8);}(_0x7123,0xfe));var _0x3712=function(_0x4f7403,_0x402afc){_0x4f7403=_0x4f7403-0x0;var _0x2c10d6=_0x7123[_0x4f7403];return _0x2c10d6;};'use strict';var _=require(_0x3712('0x0'));var util=require(_0x3712('0x1'));var moment=require(_0x3712('0x2'));var BPromise=require(_0x3712('0x3'));var rs=require(_0x3712('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3712('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3712('0x6'))('rpc');var config=require(_0x3712('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3712('0x8')]({'port':0x232a});config['redis']=_[_0x3712('0x9')](config[_0x3712('0xa')],{'host':_0x3712('0xb'),'port':0x18eb});var socket=require(_0x3712('0xc'))(new Redis(config[_0x3712('0xa')]));require(_0x3712('0xd'))[_0x3712('0xe')](socket);function respondWithRpcPromise(_0x397526,_0x2e7d6c,_0x12930e){return new BPromise(function(_0x22cde4,_0x44b579){return client[_0x3712('0xf')](_0x397526,_0x12930e)[_0x3712('0x10')](function(_0x51fa9e){logger[_0x3712('0x11')](_0x3712('0x12'),_0x2e7d6c,'request\x20sent');logger[_0x3712('0x13')](_0x3712('0x14'),_0x2e7d6c,_0x3712('0x15'),JSON[_0x3712('0x16')](_0x51fa9e));if(_0x51fa9e[_0x3712('0x17')]){if(_0x51fa9e[_0x3712('0x17')][_0x3712('0x18')]===0x1f4){logger[_0x3712('0x17')](_0x3712('0x12'),_0x2e7d6c,_0x51fa9e['error'][_0x3712('0x19')]);return _0x44b579(_0x51fa9e[_0x3712('0x17')][_0x3712('0x19')]);}logger['error'](_0x3712('0x12'),_0x2e7d6c,_0x51fa9e[_0x3712('0x17')][_0x3712('0x19')]);return _0x22cde4(_0x51fa9e[_0x3712('0x17')][_0x3712('0x19')]);}else{logger[_0x3712('0x11')]('Team,\x20%s,\x20%s',_0x2e7d6c,_0x3712('0x15'));_0x22cde4(_0x51fa9e[_0x3712('0x1a')][_0x3712('0x19')]);}})['catch'](function(_0x3cf2f0){logger[_0x3712('0x17')](_0x3712('0x12'),_0x2e7d6c,_0x3cf2f0);_0x44b579(_0x3cf2f0);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 87bc684..92b1616 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 _0xfca2=['emit','register','length','team:','./team.events','remove','update'];(function(_0x355ca3,_0xd3e1e7){var _0x55edba=function(_0x29ec8e){while(--_0x29ec8e){_0x355ca3['push'](_0x355ca3['shift']());}};_0x55edba(++_0xd3e1e7);}(_0xfca2,0x6d));var _0x2fca=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0xfca2[_0x5d1044];return _0x3cd90e;};'use strict';var TeamEvents=require(_0x2fca('0x0'));var events=['save',_0x2fca('0x1'),_0x2fca('0x2')];function createListener(_0x7acaf8,_0x96bab8){return function(_0x28a583){_0x96bab8[_0x2fca('0x3')](_0x7acaf8,_0x28a583);};}function removeListener(_0x23361b,_0xb17e73){return function(){TeamEvents['removeListener'](_0x23361b,_0xb17e73);};}exports[_0x2fca('0x4')]=function(_0xc65361){for(var _0xfa36ca=0x0,_0x459131=events[_0x2fca('0x5')];_0xfa36ca<_0x459131;_0xfa36ca++){var _0x54bb89=events[_0xfa36ca];var _0x34151b=createListener(_0x2fca('0x6')+_0x54bb89,_0xc65361);TeamEvents['on'](_0x54bb89,_0x34151b);}}; \ No newline at end of file +var _0xff8f=['remove','update','emit','removeListener','register','length','team:','save'];(function(_0x135f08,_0x3dd11e){var _0x1b5091=function(_0x98366){while(--_0x98366){_0x135f08['push'](_0x135f08['shift']());}};_0x1b5091(++_0x3dd11e);}(_0xff8f,0xa7));var _0xfff8=function(_0x30aef0,_0x3753ca){_0x30aef0=_0x30aef0-0x0;var _0x21b6bf=_0xff8f[_0x30aef0];return _0x21b6bf;};'use strict';var TeamEvents=require('./team.events');var events=[_0xfff8('0x0'),_0xfff8('0x1'),_0xfff8('0x2')];function createListener(_0x32c91a,_0x4ac0bb){return function(_0x44eb18){_0x4ac0bb[_0xfff8('0x3')](_0x32c91a,_0x44eb18);};}function removeListener(_0x2236cc,_0x26561b){return function(){TeamEvents[_0xfff8('0x4')](_0x2236cc,_0x26561b);};}exports[_0xfff8('0x5')]=function(_0x5d3f21){for(var _0x2f7b1a=0x0,_0x410acf=events[_0xfff8('0x6')];_0x2f7b1a<_0x410acf;_0x2f7b1a++){var _0x4b3667=events[_0x2f7b1a];var _0x55bb63=createListener(_0xfff8('0x7')+_0x4b3667,_0x5d3f21);TeamEvents['on'](_0x4b3667,_0x55bb63);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 610a810..8f8e44f 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 _0x3ef0=['sequelize','INTEGER'];(function(_0x55d27a,_0x2be62c){var _0x22d271=function(_0x387536){while(--_0x387536){_0x55d27a['push'](_0x55d27a['shift']());}};_0x22d271(++_0x2be62c);}(_0x3ef0,0x19a));var _0x03ef=function(_0x279629,_0x82681e){_0x279629=_0x279629-0x0;var _0x31c8a4=_0x3ef0[_0x279629];return _0x31c8a4;};'use strict';var Sequelize=require(_0x03ef('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x03ef('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf2c7=['INTEGER','sequelize','exports'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xf2c7[_0x52085a];return _0x5afc1a;};'use strict';var Sequelize=require(_0x7f2c('0x0'));module[_0x7f2c('0x1')]={'TeamId':{'type':Sequelize[_0x7f2c('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7f2c('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index b563e8a..1ad5166 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 _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','TeamVoicePrefix'];(function(_0x1c97d8,_0x593cb2){var _0x35853a=function(_0x161c20){while(--_0x161c20){_0x1c97d8['push'](_0x1c97d8['shift']());}};_0x35853a(++_0x593cb2);}(_0x8f4c,0x113));var _0xc8f4=function(_0x3349ac,_0x889beb){_0x3349ac=_0x3349ac-0x0;var _0x18d071=_0x8f4c[_0x3349ac];return _0x18d071;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd31=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','team_has_voice_prefixes','util','../../config/logger','api'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xcd31,0x15d));var _0x1cd3=function(_0x3a93bf,_0x4fc091){_0x3a93bf=_0x3a93bf-0x0;var _0x754089=_0xcd31[_0x3a93bf];return _0x754089;};'use strict';var _=require('lodash');var util=require(_0x1cd3('0x0'));var logger=require(_0x1cd3('0x1'))(_0x1cd3('0x2'));var moment=require('moment');var BPromise=require(_0x1cd3('0x3'));var rp=require(_0x1cd3('0x4'));var fs=require('fs');var path=require(_0x1cd3('0x5'));var rimraf=require(_0x1cd3('0x6'));var config=require(_0x1cd3('0x7'));var attributes=require(_0x1cd3('0x8'));module['exports']=function(_0x26ffcb,_0x1ca151){return _0x26ffcb[_0x1cd3('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x1cd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 5678680..25da6e5 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x44f4c5,_0x60cd8b){var _0x35cf6a=function(_0x43a904){while(--_0x43a904){_0x44f4c5['push'](_0x44f4c5['shift']());}};_0x35cf6a(++_0x60cd8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5af9ff,_0x3c42e8){var _0x42f9dd=function(_0x48b20f){while(--_0x48b20f){_0x5af9ff['push'](_0x5af9ff['shift']());}};_0x42f9dd(++_0x3c42e8);}(_0xe706,0xa3));var _0x6e70=function(_0x48cf09,_0x3b5f6c){_0x48cf09=_0x48cf09-0x0;var _0x203b57=_0xe706[_0x48cf09];return _0x203b57;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index b56c6e2..224aaa3 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 _0x8d84=['INTEGER','sequelize','exports'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x8d84,0x64));var _0x48d8=function(_0x1880af,_0x2948d4){_0x1880af=_0x1880af-0x0;var _0x218579=_0x8d84[_0x1880af];return _0x218579;};'use strict';var Sequelize=require(_0x48d8('0x0'));module[_0x48d8('0x1')]={'penalty':{'type':Sequelize[_0x48d8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4db5=['exports','INTEGER'];(function(_0x23b76f,_0x4054ce){var _0x37a7d7=function(_0x4ada32){while(--_0x4ada32){_0x23b76f['push'](_0x23b76f['shift']());}};_0x37a7d7(++_0x4054ce);}(_0x4db5,0x192));var _0x54db=function(_0x74fc64,_0x2260fa){_0x74fc64=_0x74fc64-0x0;var _0x3ab60e=_0x4db5[_0x74fc64];return _0x3ab60e;};'use strict';var Sequelize=require('sequelize');module[_0x54db('0x0')]={'penalty':{'type':Sequelize[_0x54db('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 788a3b9..04628e2 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 _0xf6fb=['define','TeamVoiceQueue','team_has_voice_queues','../../config/logger','api','bluebird','request-promise','rimraf','./teamVoiceQueue.attributes','exports'];(function(_0x1a9204,_0x3328bc){var _0x501fa2=function(_0x43a43b){while(--_0x43a43b){_0x1a9204['push'](_0x1a9204['shift']());}};_0x501fa2(++_0x3328bc);}(_0xf6fb,0x111));var _0xbf6f=function(_0x4b8377,_0x50d1c3){_0x4b8377=_0x4b8377-0x0;var _0x58506f=_0xf6fb[_0x4b8377];return _0x58506f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf6f('0x0'))(_0xbf6f('0x1'));var moment=require('moment');var BPromise=require(_0xbf6f('0x2'));var rp=require(_0xbf6f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf6f('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf6f('0x5'));module[_0xbf6f('0x6')]=function(_0x2d8ffb,_0x370983){return _0x2d8ffb[_0xbf6f('0x7')](_0xbf6f('0x8'),attributes,{'tableName':_0xbf6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fad=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','lodash','util'];(function(_0x28bc89,_0x2faa0d){var _0x1e61fa=function(_0x228821){while(--_0x228821){_0x28bc89['push'](_0x28bc89['shift']());}};_0x1e61fa(++_0x2faa0d);}(_0x6fad,0x174));var _0xd6fa=function(_0x2bced3,_0x5e0d41){_0x2bced3=_0x2bced3-0x0;var _0x1ed985=_0x6fad[_0x2bced3];return _0x1ed985;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var logger=require(_0xd6fa('0x2'))(_0xd6fa('0x3'));var moment=require('moment');var BPromise=require(_0xd6fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6fa('0x5'));var rimraf=require(_0xd6fa('0x6'));var config=require(_0xd6fa('0x7'));var attributes=require(_0xd6fa('0x8'));module['exports']=function(_0x45dad4,_0x329390){return _0x45dad4[_0xd6fa('0x9')](_0xd6fa('0xa'),attributes,{'tableName':'team_has_voice_queues','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 2a075c9..d10bec8 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 _0x02e5=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xe6ad32,_0x346005){var _0x483d39=function(_0x4099dd){while(--_0x4099dd){_0xe6ad32['push'](_0xe6ad32['shift']());}};_0x483d39(++_0x346005);}(_0x02e5,0x132));var _0x502e=function(_0xc39752,_0x34338a){_0xc39752=_0xc39752-0x0;var _0x5c4099=_0x02e5[_0xc39752];return _0x5c4099;};'use strict';var _=require(_0x502e('0x0'));var util=require(_0x502e('0x1'));var moment=require(_0x502e('0x2'));var BPromise=require('bluebird');var rs=require(_0x502e('0x3'));var fs=require('fs');var Redis=require(_0x502e('0x4'));var db=require(_0x502e('0x5'))['db'];var utils=require(_0x502e('0x6'));var logger=require(_0x502e('0x7'))(_0x502e('0x8'));var config=require(_0x502e('0x9'));var jayson=require(_0x502e('0xa'));var client=jayson[_0x502e('0xb')][_0x502e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38efb2,_0x1f97dd,_0x257de3){return new BPromise(function(_0x4432d1,_0x2a461e){return client[_0x502e('0xd')](_0x38efb2,_0x257de3)[_0x502e('0xe')](function(_0x2fc2ec){logger[_0x502e('0xf')](_0x502e('0x10'),_0x1f97dd,_0x502e('0x11'));logger[_0x502e('0x12')](_0x502e('0x13'),_0x1f97dd,'request\x20sent',JSON[_0x502e('0x14')](_0x2fc2ec));if(_0x2fc2ec['error']){if(_0x2fc2ec['error'][_0x502e('0x15')]===0x1f4){logger[_0x502e('0x16')](_0x502e('0x10'),_0x1f97dd,_0x2fc2ec[_0x502e('0x16')][_0x502e('0x17')]);return _0x2a461e(_0x2fc2ec[_0x502e('0x16')]['message']);}logger[_0x502e('0x16')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1f97dd,_0x2fc2ec[_0x502e('0x16')][_0x502e('0x17')]);return _0x4432d1(_0x2fc2ec[_0x502e('0x16')][_0x502e('0x17')]);}else{logger[_0x502e('0xf')](_0x502e('0x10'),_0x1f97dd,_0x502e('0x11'));_0x4432d1(_0x2fc2ec['result'][_0x502e('0x17')]);}})[_0x502e('0x18')](function(_0x59df43){logger[_0x502e('0x16')](_0x502e('0x10'),_0x1f97dd,_0x59df43);_0x2a461e(_0x59df43);});});} \ No newline at end of file +var _0xcc36=['code','message','TeamVoiceQueue,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a1d9b,_0x5ea65a){var _0x1d7a59=function(_0xa1dea2){while(--_0xa1dea2){_0x1a1d9b['push'](_0x1a1d9b['shift']());}};_0x1d7a59(++_0x5ea65a);}(_0xcc36,0x1a6));var _0x6cc3=function(_0x12e75a,_0x269578){_0x12e75a=_0x12e75a-0x0;var _0x11650d=_0xcc36[_0x12e75a];return _0x11650d;};'use strict';var _=require(_0x6cc3('0x0'));var util=require(_0x6cc3('0x1'));var moment=require(_0x6cc3('0x2'));var BPromise=require(_0x6cc3('0x3'));var rs=require(_0x6cc3('0x4'));var fs=require('fs');var Redis=require(_0x6cc3('0x5'));var db=require(_0x6cc3('0x6'))['db'];var utils=require(_0x6cc3('0x7'));var logger=require(_0x6cc3('0x8'))(_0x6cc3('0x9'));var config=require('../../config/environment');var jayson=require(_0x6cc3('0xa'));var client=jayson[_0x6cc3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38e122,_0x2dfd33,_0x49385e){return new BPromise(function(_0x1e9dda,_0x39abe2){return client[_0x6cc3('0xc')](_0x38e122,_0x49385e)['then'](function(_0x4344c2){logger[_0x6cc3('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2dfd33,'request\x20sent');logger[_0x6cc3('0xe')](_0x6cc3('0xf'),_0x2dfd33,'request\x20sent',JSON[_0x6cc3('0x10')](_0x4344c2));if(_0x4344c2['error']){if(_0x4344c2[_0x6cc3('0x11')][_0x6cc3('0x12')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x2dfd33,_0x4344c2[_0x6cc3('0x11')][_0x6cc3('0x13')]);return _0x39abe2(_0x4344c2['error']['message']);}logger[_0x6cc3('0x11')](_0x6cc3('0x14'),_0x2dfd33,_0x4344c2[_0x6cc3('0x11')][_0x6cc3('0x13')]);return _0x1e9dda(_0x4344c2['error'][_0x6cc3('0x13')]);}else{logger[_0x6cc3('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2dfd33,'request\x20sent');_0x1e9dda(_0x4344c2[_0x6cc3('0x15')]['message']);}})['catch'](function(_0x4f4f5b){logger[_0x6cc3('0x11')](_0x6cc3('0x14'),_0x2dfd33,_0x4f4f5b);_0x39abe2(_0x4f4f5b);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 53fdad8..5deab2f 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 _0x0650=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','delete','multer','path','connect-timeout'];(function(_0x5938d8,_0x52d748){var _0xa99dc9=function(_0x2fa8f3){while(--_0x2fa8f3){_0x5938d8['push'](_0x5938d8['shift']());}};_0xa99dc9(++_0x52d748);}(_0x0650,0xed));var _0x0065=function(_0x234ce7,_0x3e909c){_0x234ce7=_0x234ce7-0x0;var _0x57c561=_0x0650[_0x234ce7];return _0x57c561;};'use strict';var multer=require(_0x0065('0x0'));var util=require('util');var path=require(_0x0065('0x1'));var timeout=require(_0x0065('0x2'));var express=require('express');var router=express[_0x0065('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0065('0x4'));var interaction=require(_0x0065('0x5'));var config=require(_0x0065('0x6'));var controller=require('./template.controller');router[_0x0065('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0065('0x8'),auth[_0x0065('0x9')](),controller[_0x0065('0xa')]);router[_0x0065('0xb')]('/',auth[_0x0065('0x9')](),controller[_0x0065('0xc')]);router[_0x0065('0xd')](_0x0065('0x8'),auth[_0x0065('0x9')](),controller['update']);router[_0x0065('0xe')](_0x0065('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd1f1=['isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x6f3151,_0x406745){var _0x305fb8=function(_0x24e5a8){while(--_0x24e5a8){_0x6f3151['push'](_0x6f3151['shift']());}};_0x305fb8(++_0x406745);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x1cc325,_0x537298){_0x1cc325=_0x1cc325-0x0;var _0x33d644=_0xd1f1[_0x1cc325];return _0x33d644;};'use strict';var multer=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var path=require('path');var timeout=require(_0x1d1f('0x2'));var express=require(_0x1d1f('0x3'));var router=express[_0x1d1f('0x4')]();var fs_extra=require(_0x1d1f('0x5'));var auth=require(_0x1d1f('0x6'));var interaction=require(_0x1d1f('0x7'));var config=require(_0x1d1f('0x8'));var controller=require('./template.controller');router[_0x1d1f('0x9')]('/',auth[_0x1d1f('0xa')](),controller[_0x1d1f('0xb')]);router[_0x1d1f('0x9')](_0x1d1f('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1d1f('0xa')](),controller[_0x1d1f('0xd')]);router[_0x1d1f('0xe')](_0x1d1f('0xc'),auth['isAuthenticated'](),controller[_0x1d1f('0xf')]);router[_0x1d1f('0x10')](_0x1d1f('0xc'),auth[_0x1d1f('0xa')](),controller[_0x1d1f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index b58c3a0..e8fa685 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 _0xe4fc=['STRING','TEXT','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xe4fc,0x134));var _0xce4f=function(_0x13c774,_0x4d3531){_0x13c774=_0x13c774-0x0;var _0x5ae4e7=_0xe4fc[_0x13c774];return _0x5ae4e7;};'use strict';var Sequelize=require('sequelize');module[_0xce4f('0x0')]={'name':{'type':Sequelize[_0xce4f('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xce4f('0x2')]}}; \ No newline at end of file +var _0x7356=['exports','TEXT','sequelize'];(function(_0x1b3e51,_0x541e72){var _0x205b24=function(_0x4f84c9){while(--_0x4f84c9){_0x1b3e51['push'](_0x1b3e51['shift']());}};_0x205b24(++_0x541e72);}(_0x7356,0xda));var _0x6735=function(_0x321c26,_0x2bf051){_0x321c26=_0x321c26-0x0;var _0x2deb79=_0x7356[_0x321c26];return _0x2deb79;};'use strict';var Sequelize=require(_0x6735('0x0'));module[_0x6735('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x6735('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 514eaae..595619e 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 _0x9bc8=['filter','merge','Template','findAll','rows','catch','show','params','keys','length','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x45d886,_0x694715){var _0x3c1904=function(_0x120ec1){while(--_0x120ec1){_0x45d886['push'](_0x45d886['shift']());}};_0x3c1904(++_0x694715);}(_0x9bc8,0x68));var _0x89bc=function(_0x3dc2a4,_0x224ebd){_0x3dc2a4=_0x3dc2a4-0x0;var _0x347524=_0x9bc8[_0x3dc2a4];return _0x347524;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89bc('0x0'));var zipdir=require(_0x89bc('0x1'));var jsonpatch=require(_0x89bc('0x2'));var rp=require('request-promise');var moment=require(_0x89bc('0x3'));var BPromise=require(_0x89bc('0x4'));var Mustache=require(_0x89bc('0x5'));var util=require('util');var path=require(_0x89bc('0x6'));var sox=require(_0x89bc('0x7'));var csv=require(_0x89bc('0x8'));var ejs=require(_0x89bc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89bc('0xa'));var squel=require(_0x89bc('0xb'));var crypto=require(_0x89bc('0xc'));var jsforce=require(_0x89bc('0xd'));var deskjs=require(_0x89bc('0xe'));var toCsv=require(_0x89bc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x89bc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89bc('0x10'));var logger=require(_0x89bc('0x11'))(_0x89bc('0x12'));var utils=require(_0x89bc('0x13'));var config=require(_0x89bc('0x14'));var licenseUtil=require(_0x89bc('0x15'));var db=require(_0x89bc('0x16'))['db'];function respondWithStatusCode(_0x4cfe77,_0x57d666){_0x57d666=_0x57d666||0xcc;return function(_0x39dde3){if(_0x39dde3){return _0x4cfe77['sendStatus'](_0x57d666);}return _0x4cfe77[_0x89bc('0x17')](_0x57d666)[_0x89bc('0x18')]();};}function respondWithResult(_0x1f09bb,_0x45f7bc){_0x45f7bc=_0x45f7bc||0xc8;return function(_0x1a7e16){if(_0x1a7e16){return _0x1f09bb[_0x89bc('0x17')](_0x45f7bc)[_0x89bc('0x19')](_0x1a7e16);}};}function respondWithFilteredResult(_0x5a6eb4,_0x170dee){return function(_0x5d5e01){if(_0x5d5e01){var _0x52cc32=typeof _0x170dee[_0x89bc('0x1a')]==='undefined'&&typeof _0x170dee[_0x89bc('0x1b')]===_0x89bc('0x1c');var _0x4e412e=_0x5d5e01[_0x89bc('0x1d')];var _0x3f4afb=_0x52cc32?0x0:_0x170dee[_0x89bc('0x1a')];var _0x1f0f74=_0x52cc32?_0x5d5e01[_0x89bc('0x1d')]:_0x170dee['offset']+_0x170dee[_0x89bc('0x1b')];var _0x12ec0c;if(_0x1f0f74>=_0x4e412e){_0x1f0f74=_0x4e412e;_0x12ec0c=0xc8;}else{_0x12ec0c=0xce;}_0x5a6eb4['status'](_0x12ec0c);return _0x5a6eb4[_0x89bc('0x1e')](_0x89bc('0x1f'),_0x3f4afb+'-'+_0x1f0f74+'/'+_0x4e412e)[_0x89bc('0x19')](_0x5d5e01);}return null;};}function patchUpdates(_0x81f4b){return function(_0x4f01c4){try{jsonpatch[_0x89bc('0x20')](_0x4f01c4,_0x81f4b,!![]);}catch(_0xc41af0){return BPromise[_0x89bc('0x21')](_0xc41af0);}return _0x4f01c4[_0x89bc('0x22')]();};}function saveUpdates(_0x26c901,_0x3c1b46){return function(_0xb6f9da){if(_0xb6f9da){return _0xb6f9da[_0x89bc('0x23')](_0x26c901)[_0x89bc('0x24')](function(_0x17a703){return _0x17a703;});}return null;};}function removeEntity(_0x39e19d,_0x2b4bd4){return function(_0x3c5730){if(_0x3c5730){return _0x3c5730[_0x89bc('0x25')]()[_0x89bc('0x24')](function(){var _0x5f09e1=_0x3c5730[_0x89bc('0x26')]({'plain':!![]});var _0x428148=_0x89bc('0x27');return db[_0x89bc('0x28')]['destroy']({'where':{'type':_0x428148,'resourceId':_0x5f09e1['id']}})[_0x89bc('0x24')](function(){return _0x3c5730;});})[_0x89bc('0x24')](function(){_0x39e19d[_0x89bc('0x17')](0xcc)[_0x89bc('0x18')]();});}};}function handleEntityNotFound(_0x465e66,_0x286ea3){return function(_0x477366){if(!_0x477366){_0x465e66[_0x89bc('0x29')](0x194);}return _0x477366;};}function handleError(_0x1d9999,_0x2225cc){_0x2225cc=_0x2225cc||0x1f4;return function(_0x1b9a39){logger[_0x89bc('0x2a')](_0x1b9a39[_0x89bc('0x2b')]);if(_0x1b9a39[_0x89bc('0x2c')]){delete _0x1b9a39[_0x89bc('0x2c')];}_0x1d9999[_0x89bc('0x17')](_0x2225cc)[_0x89bc('0x2d')](_0x1b9a39);};}exports[_0x89bc('0x2e')]=function(_0x4354c2,_0x5cac09){var _0x13ce0f={},_0x1a1319={},_0x1a3dd3={'count':0x0,'rows':[]};var _0x2fad0c=_['map'](db['Template'][_0x89bc('0x2f')],function(_0x27eada){return{'name':_0x27eada[_0x89bc('0x30')],'type':_0x27eada[_0x89bc('0x31')]['key']};});_0x1a1319[_0x89bc('0x32')]=_[_0x89bc('0x33')](_0x2fad0c,_0x89bc('0x2c'));_0x1a1319['query']=_['keys'](_0x4354c2[_0x89bc('0x34')]);_0x1a1319[_0x89bc('0x35')]=_[_0x89bc('0x36')](_0x1a1319[_0x89bc('0x32')],_0x1a1319[_0x89bc('0x34')]);_0x13ce0f[_0x89bc('0x37')]=_[_0x89bc('0x36')](_0x1a1319[_0x89bc('0x32')],qs['fields'](_0x4354c2[_0x89bc('0x34')][_0x89bc('0x38')]));_0x13ce0f[_0x89bc('0x37')]=_0x13ce0f[_0x89bc('0x37')]['length']?_0x13ce0f['attributes']:_0x1a1319[_0x89bc('0x32')];if(!_0x4354c2['query'][_0x89bc('0x39')](_0x89bc('0x3a'))){_0x13ce0f[_0x89bc('0x1b')]=qs[_0x89bc('0x1b')](_0x4354c2[_0x89bc('0x34')]['limit']);_0x13ce0f[_0x89bc('0x1a')]=qs[_0x89bc('0x1a')](_0x4354c2[_0x89bc('0x34')][_0x89bc('0x1a')]);}_0x13ce0f[_0x89bc('0x3b')]=qs[_0x89bc('0x3c')](_0x4354c2[_0x89bc('0x34')][_0x89bc('0x3c')]);_0x13ce0f[_0x89bc('0x3d')]=qs[_0x89bc('0x35')](_['pick'](_0x4354c2['query'],_0x1a1319[_0x89bc('0x35')]),_0x2fad0c);if(_0x4354c2[_0x89bc('0x34')][_0x89bc('0x3e')]){_0x13ce0f[_0x89bc('0x3d')]=_[_0x89bc('0x3f')](_0x13ce0f['where'],{'$or':_[_0x89bc('0x33')](_0x2fad0c,function(_0x459824){if(_0x459824[_0x89bc('0x31')]!=='VIRTUAL'){var _0x1f2dec={};_0x1f2dec[_0x459824['name']]={'$like':'%'+_0x4354c2[_0x89bc('0x34')][_0x89bc('0x3e')]+'%'};return _0x1f2dec;}})});}_0x13ce0f=_['merge']({},_0x13ce0f,_0x4354c2['options']);var _0x1c0308={'where':_0x13ce0f[_0x89bc('0x3d')]};return db['Template']['count'](_0x1c0308)['then'](function(_0x3f80a3){_0x1a3dd3[_0x89bc('0x1d')]=_0x3f80a3;if(_0x4354c2[_0x89bc('0x34')]['includeAll']){_0x13ce0f['include']=[{'all':!![]}];}return db[_0x89bc('0x40')][_0x89bc('0x41')](_0x13ce0f);})[_0x89bc('0x24')](function(_0x39096b){_0x1a3dd3[_0x89bc('0x42')]=_0x39096b;return _0x1a3dd3;})[_0x89bc('0x24')](respondWithFilteredResult(_0x5cac09,_0x13ce0f))[_0x89bc('0x43')](handleError(_0x5cac09,null));};exports[_0x89bc('0x44')]=function(_0x355a52,_0x55974d){var _0x38ff28={'raw':!![],'where':{'id':_0x355a52[_0x89bc('0x45')]['id']}},_0x133048={};_0x133048[_0x89bc('0x32')]=_[_0x89bc('0x46')](db[_0x89bc('0x40')][_0x89bc('0x2f')]);_0x133048[_0x89bc('0x34')]=_[_0x89bc('0x46')](_0x355a52[_0x89bc('0x34')]);_0x133048[_0x89bc('0x35')]=_[_0x89bc('0x36')](_0x133048[_0x89bc('0x32')],_0x133048['query']);_0x38ff28['attributes']=_[_0x89bc('0x36')](_0x133048['model'],qs[_0x89bc('0x38')](_0x355a52['query'][_0x89bc('0x38')]));_0x38ff28[_0x89bc('0x37')]=_0x38ff28[_0x89bc('0x37')][_0x89bc('0x47')]?_0x38ff28[_0x89bc('0x37')]:_0x133048[_0x89bc('0x32')];if(_0x355a52[_0x89bc('0x34')][_0x89bc('0x48')]){_0x38ff28[_0x89bc('0x49')]=[{'all':!![]}];}_0x38ff28=_[_0x89bc('0x3f')]({},_0x38ff28,_0x355a52['options']);return db[_0x89bc('0x40')]['find'](_0x38ff28)[_0x89bc('0x24')](handleEntityNotFound(_0x55974d,null))[_0x89bc('0x24')](respondWithResult(_0x55974d,null))[_0x89bc('0x43')](handleError(_0x55974d,null));};exports['create']=function(_0x3adc5a,_0x26abc5){return db[_0x89bc('0x40')][_0x89bc('0x4a')](_0x3adc5a[_0x89bc('0x4b')],{})[_0x89bc('0x24')](function(_0x453878){var _0xab8693=_0x3adc5a[_0x89bc('0x4c')][_0x89bc('0x26')]({'plain':!![]});if(!_0xab8693)throw new Error(_0x89bc('0x4d'));if(_0xab8693[_0x89bc('0x4e')]==='user'){var _0x1b9185=_0x453878['get']({'plain':!![]});var _0x5adbf0=_0x89bc('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x5adbf0,'userProfileId':_0xab8693[_0x89bc('0x4f')]},'raw':!![]})['then'](function(_0x449903){if(_0x449903&&_0x449903[_0x89bc('0x50')]===0x0){return db['UserProfileResource'][_0x89bc('0x4a')]({'name':_0x1b9185[_0x89bc('0x2c')],'resourceId':_0x1b9185['id'],'type':_0x449903[_0x89bc('0x2c')],'sectionId':_0x449903['id']},{})[_0x89bc('0x24')](function(){return _0x453878;});}else{return _0x453878;}})[_0x89bc('0x43')](function(_0x1b4e7b){logger[_0x89bc('0x2a')](_0x89bc('0x51'),_0x1b4e7b);throw _0x1b4e7b;});}return _0x453878;})[_0x89bc('0x24')](respondWithResult(_0x26abc5,0xc9))[_0x89bc('0x43')](handleError(_0x26abc5,null));};exports[_0x89bc('0x23')]=function(_0x184a12,_0x470a05){if(_0x184a12[_0x89bc('0x4b')]['id']){delete _0x184a12[_0x89bc('0x4b')]['id'];}return db['Template'][_0x89bc('0x52')]({'where':{'id':_0x184a12[_0x89bc('0x45')]['id']}})['then'](handleEntityNotFound(_0x470a05,null))['then'](saveUpdates(_0x184a12[_0x89bc('0x4b')],null))[_0x89bc('0x24')](respondWithResult(_0x470a05,null))['catch'](handleError(_0x470a05,null));};exports[_0x89bc('0x25')]=function(_0xe64372,_0x2405da){return db[_0x89bc('0x40')]['find']({'where':{'id':_0xe64372[_0x89bc('0x45')]['id']}})[_0x89bc('0x24')](handleEntityNotFound(_0x2405da,null))[_0x89bc('0x24')](removeEntity(_0x2405da,null))['catch'](handleError(_0x2405da,null));}; \ No newline at end of file +var _0x6c26=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','destroy','get','Templates','UserProfileResource','then','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0xf0e391,_0x5433d4){var _0x1c126d=function(_0x520c70){while(--_0x520c70){_0xf0e391['push'](_0xf0e391['shift']());}};_0x1c126d(++_0x5433d4);}(_0x6c26,0xc3));var _0x66c2=function(_0x213e91,_0x3e22e3){_0x213e91=_0x213e91-0x0;var _0x356a97=_0x6c26[_0x213e91];return _0x356a97;};'use strict';var emlformat=require(_0x66c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66c2('0x1'));var jsonpatch=require(_0x66c2('0x2'));var rp=require('request-promise');var moment=require(_0x66c2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x66c2('0x4'));var util=require(_0x66c2('0x5'));var path=require(_0x66c2('0x6'));var sox=require(_0x66c2('0x7'));var csv=require(_0x66c2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66c2('0x9'));var _=require(_0x66c2('0xa'));var squel=require(_0x66c2('0xb'));var crypto=require(_0x66c2('0xc'));var jsforce=require(_0x66c2('0xd'));var deskjs=require(_0x66c2('0xe'));var toCsv=require(_0x66c2('0x8'));var querystring=require(_0x66c2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x66c2('0x10'));var as=require(_0x66c2('0x11'));var hardwareService=require(_0x66c2('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x66c2('0x13'));var licenseUtil=require(_0x66c2('0x14'));var db=require(_0x66c2('0x15'))['db'];function respondWithStatusCode(_0x592d7b,_0x32e577){_0x32e577=_0x32e577||0xcc;return function(_0x12c0c0){if(_0x12c0c0){return _0x592d7b[_0x66c2('0x16')](_0x32e577);}return _0x592d7b[_0x66c2('0x17')](_0x32e577)[_0x66c2('0x18')]();};}function respondWithResult(_0x1be73a,_0x3cd20c){_0x3cd20c=_0x3cd20c||0xc8;return function(_0x563bf0){if(_0x563bf0){return _0x1be73a[_0x66c2('0x17')](_0x3cd20c)['json'](_0x563bf0);}};}function respondWithFilteredResult(_0x5483ed,_0x38d4ca){return function(_0x43b30a){if(_0x43b30a){var _0x4bd4df=typeof _0x38d4ca['offset']===_0x66c2('0x19')&&typeof _0x38d4ca[_0x66c2('0x1a')]===_0x66c2('0x19');var _0x4c668a=_0x43b30a[_0x66c2('0x1b')];var _0x754e5a=_0x4bd4df?0x0:_0x38d4ca[_0x66c2('0x1c')];var _0x513e1f=_0x4bd4df?_0x43b30a['count']:_0x38d4ca[_0x66c2('0x1c')]+_0x38d4ca[_0x66c2('0x1a')];var _0x9b623;if(_0x513e1f>=_0x4c668a){_0x513e1f=_0x4c668a;_0x9b623=0xc8;}else{_0x9b623=0xce;}_0x5483ed[_0x66c2('0x17')](_0x9b623);return _0x5483ed['set'](_0x66c2('0x1d'),_0x754e5a+'-'+_0x513e1f+'/'+_0x4c668a)[_0x66c2('0x1e')](_0x43b30a);}return null;};}function patchUpdates(_0x3955c8){return function(_0x5e4bb0){try{jsonpatch[_0x66c2('0x1f')](_0x5e4bb0,_0x3955c8,!![]);}catch(_0x5dd4bb){return BPromise['reject'](_0x5dd4bb);}return _0x5e4bb0[_0x66c2('0x20')]();};}function saveUpdates(_0x57ac42,_0x5912df){return function(_0x63f1b1){if(_0x63f1b1){return _0x63f1b1[_0x66c2('0x21')](_0x57ac42)['then'](function(_0x441b34){return _0x441b34;});}return null;};}function removeEntity(_0x533c3c,_0x4e6772){return function(_0x4f5d0a){if(_0x4f5d0a){return _0x4f5d0a[_0x66c2('0x22')]()['then'](function(){var _0x1a02f5=_0x4f5d0a[_0x66c2('0x23')]({'plain':!![]});var _0x2c8f1c=_0x66c2('0x24');return db[_0x66c2('0x25')][_0x66c2('0x22')]({'where':{'type':_0x2c8f1c,'resourceId':_0x1a02f5['id']}})[_0x66c2('0x26')](function(){return _0x4f5d0a;});})[_0x66c2('0x26')](function(){_0x533c3c[_0x66c2('0x17')](0xcc)[_0x66c2('0x18')]();});}};}function handleEntityNotFound(_0x3f2d5c,_0x12a0ad){return function(_0x1b0f08){if(!_0x1b0f08){_0x3f2d5c['sendStatus'](0x194);}return _0x1b0f08;};}function handleError(_0x5be281,_0x4f027f){_0x4f027f=_0x4f027f||0x1f4;return function(_0x5b5e12){logger[_0x66c2('0x27')](_0x5b5e12[_0x66c2('0x28')]);if(_0x5b5e12[_0x66c2('0x29')]){delete _0x5b5e12[_0x66c2('0x29')];}_0x5be281[_0x66c2('0x17')](_0x4f027f)[_0x66c2('0x2a')](_0x5b5e12);};}exports[_0x66c2('0x2b')]=function(_0x3f4d25,_0x2aee47){var _0x226b95={},_0x3334c7={},_0x554aa8={'count':0x0,'rows':[]};var _0x4594a6=_[_0x66c2('0x2c')](db[_0x66c2('0x2d')][_0x66c2('0x2e')],function(_0x38b08a){return{'name':_0x38b08a[_0x66c2('0x2f')],'type':_0x38b08a[_0x66c2('0x30')]['key']};});_0x3334c7[_0x66c2('0x31')]=_[_0x66c2('0x2c')](_0x4594a6,'name');_0x3334c7[_0x66c2('0x32')]=_[_0x66c2('0x33')](_0x3f4d25[_0x66c2('0x32')]);_0x3334c7['filters']=_['intersection'](_0x3334c7[_0x66c2('0x31')],_0x3334c7[_0x66c2('0x32')]);_0x226b95['attributes']=_[_0x66c2('0x34')](_0x3334c7[_0x66c2('0x31')],qs[_0x66c2('0x35')](_0x3f4d25[_0x66c2('0x32')]['fields']));_0x226b95[_0x66c2('0x36')]=_0x226b95[_0x66c2('0x36')][_0x66c2('0x37')]?_0x226b95[_0x66c2('0x36')]:_0x3334c7[_0x66c2('0x31')];if(!_0x3f4d25[_0x66c2('0x32')][_0x66c2('0x38')](_0x66c2('0x39'))){_0x226b95['limit']=qs[_0x66c2('0x1a')](_0x3f4d25['query'][_0x66c2('0x1a')]);_0x226b95[_0x66c2('0x1c')]=qs[_0x66c2('0x1c')](_0x3f4d25[_0x66c2('0x32')][_0x66c2('0x1c')]);}_0x226b95[_0x66c2('0x3a')]=qs[_0x66c2('0x3b')](_0x3f4d25[_0x66c2('0x32')][_0x66c2('0x3b')]);_0x226b95[_0x66c2('0x3c')]=qs[_0x66c2('0x3d')](_[_0x66c2('0x3e')](_0x3f4d25[_0x66c2('0x32')],_0x3334c7['filters']),_0x4594a6);if(_0x3f4d25[_0x66c2('0x32')][_0x66c2('0x3f')]){_0x226b95[_0x66c2('0x3c')]=_[_0x66c2('0x40')](_0x226b95[_0x66c2('0x3c')],{'$or':_[_0x66c2('0x2c')](_0x4594a6,function(_0x43a8a8){if(_0x43a8a8['type']!==_0x66c2('0x41')){var _0x52f97a={};_0x52f97a[_0x43a8a8[_0x66c2('0x29')]]={'$like':'%'+_0x3f4d25['query'][_0x66c2('0x3f')]+'%'};return _0x52f97a;}})});}_0x226b95=_[_0x66c2('0x40')]({},_0x226b95,_0x3f4d25[_0x66c2('0x42')]);var _0x3b8d9b={'where':_0x226b95[_0x66c2('0x3c')]};return db['Template'][_0x66c2('0x1b')](_0x3b8d9b)['then'](function(_0x16f4ff){_0x554aa8[_0x66c2('0x1b')]=_0x16f4ff;if(_0x3f4d25[_0x66c2('0x32')]['includeAll']){_0x226b95['include']=[{'all':!![]}];}return db[_0x66c2('0x2d')][_0x66c2('0x43')](_0x226b95);})['then'](function(_0xa8c2c9){_0x554aa8[_0x66c2('0x44')]=_0xa8c2c9;return _0x554aa8;})[_0x66c2('0x26')](respondWithFilteredResult(_0x2aee47,_0x226b95))[_0x66c2('0x45')](handleError(_0x2aee47,null));};exports[_0x66c2('0x46')]=function(_0x1398a2,_0x2f336f){var _0x4d1a6d={'raw':!![],'where':{'id':_0x1398a2[_0x66c2('0x47')]['id']}},_0x5ada62={};_0x5ada62[_0x66c2('0x31')]=_[_0x66c2('0x33')](db['Template'][_0x66c2('0x2e')]);_0x5ada62[_0x66c2('0x32')]=_[_0x66c2('0x33')](_0x1398a2[_0x66c2('0x32')]);_0x5ada62[_0x66c2('0x3d')]=_[_0x66c2('0x34')](_0x5ada62[_0x66c2('0x31')],_0x5ada62[_0x66c2('0x32')]);_0x4d1a6d[_0x66c2('0x36')]=_[_0x66c2('0x34')](_0x5ada62[_0x66c2('0x31')],qs[_0x66c2('0x35')](_0x1398a2[_0x66c2('0x32')]['fields']));_0x4d1a6d['attributes']=_0x4d1a6d['attributes'][_0x66c2('0x37')]?_0x4d1a6d[_0x66c2('0x36')]:_0x5ada62['model'];if(_0x1398a2[_0x66c2('0x32')][_0x66c2('0x48')]){_0x4d1a6d[_0x66c2('0x49')]=[{'all':!![]}];}_0x4d1a6d=_['merge']({},_0x4d1a6d,_0x1398a2[_0x66c2('0x42')]);return db[_0x66c2('0x2d')][_0x66c2('0x4a')](_0x4d1a6d)[_0x66c2('0x26')](handleEntityNotFound(_0x2f336f,null))[_0x66c2('0x26')](respondWithResult(_0x2f336f,null))[_0x66c2('0x45')](handleError(_0x2f336f,null));};exports[_0x66c2('0x4b')]=function(_0x2967ff,_0x19fa5b){return db[_0x66c2('0x2d')][_0x66c2('0x4b')](_0x2967ff[_0x66c2('0x4c')],{})[_0x66c2('0x26')](function(_0x5f30f9){var _0x33d75b=_0x2967ff[_0x66c2('0x4d')]['get']({'plain':!![]});if(!_0x33d75b)throw new Error(_0x66c2('0x4e'));if(_0x33d75b[_0x66c2('0x4f')]==='user'){var _0x19d7a3=_0x5f30f9['get']({'plain':!![]});var _0x2f4110=_0x66c2('0x24');return db[_0x66c2('0x50')][_0x66c2('0x4a')]({'where':{'name':_0x2f4110,'userProfileId':_0x33d75b[_0x66c2('0x51')]},'raw':!![]})[_0x66c2('0x26')](function(_0x25d49f){if(_0x25d49f&&_0x25d49f[_0x66c2('0x52')]===0x0){return db[_0x66c2('0x25')][_0x66c2('0x4b')]({'name':_0x19d7a3['name'],'resourceId':_0x19d7a3['id'],'type':_0x25d49f[_0x66c2('0x29')],'sectionId':_0x25d49f['id']},{})[_0x66c2('0x26')](function(){return _0x5f30f9;});}else{return _0x5f30f9;}})[_0x66c2('0x45')](function(_0x43f79c){logger[_0x66c2('0x27')](_0x66c2('0x53'),_0x43f79c);throw _0x43f79c;});}return _0x5f30f9;})['then'](respondWithResult(_0x19fa5b,0xc9))['catch'](handleError(_0x19fa5b,null));};exports['update']=function(_0x3629c7,_0x27f47f){if(_0x3629c7[_0x66c2('0x4c')]['id']){delete _0x3629c7[_0x66c2('0x4c')]['id'];}return db[_0x66c2('0x2d')][_0x66c2('0x4a')]({'where':{'id':_0x3629c7['params']['id']}})['then'](handleEntityNotFound(_0x27f47f,null))[_0x66c2('0x26')](saveUpdates(_0x3629c7['body'],null))[_0x66c2('0x26')](respondWithResult(_0x27f47f,null))[_0x66c2('0x45')](handleError(_0x27f47f,null));};exports[_0x66c2('0x22')]=function(_0x3821e3,_0x1d16a5){return db[_0x66c2('0x2d')][_0x66c2('0x4a')]({'where':{'id':_0x3821e3[_0x66c2('0x47')]['id']}})[_0x66c2('0x26')](handleEntityNotFound(_0x1d16a5,null))['then'](removeEntity(_0x1d16a5,null))[_0x66c2('0x45')](handleError(_0x1d16a5,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 364771f..dded08a 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 _0x39e2=['path','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','api','moment','request-promise'];(function(_0x2487b3,_0x9c573c){var _0x43df45=function(_0x4ae9e9){while(--_0x4ae9e9){_0x2487b3['push'](_0x2487b3['shift']());}};_0x43df45(++_0x9c573c);}(_0x39e2,0x128));var _0x239e=function(_0x56447f,_0x47d4f8){_0x56447f=_0x56447f-0x0;var _0x15557b=_0x39e2[_0x56447f];return _0x15557b;};'use strict';var _=require(_0x239e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x239e('0x1'));var moment=require(_0x239e('0x2'));var BPromise=require('bluebird');var rp=require(_0x239e('0x3'));var fs=require('fs');var path=require(_0x239e('0x4'));var rimraf=require('rimraf');var config=require(_0x239e('0x5'));var attributes=require(_0x239e('0x6'));module['exports']=function(_0x573f5c,_0x5cd74d){return _0x573f5c[_0x239e('0x7')](_0x239e('0x8'),attributes,{'tableName':_0x239e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa00=['exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1a2c59,_0x359fc1){var _0x584748=function(_0x190ca5){while(--_0x190ca5){_0x1a2c59['push'](_0x1a2c59['shift']());}};_0x584748(++_0x359fc1);}(_0xfa00,0xad));var _0x0fa0=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xfa00[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x0fa0('0x0'));var util=require(_0x0fa0('0x1'));var logger=require(_0x0fa0('0x2'))(_0x0fa0('0x3'));var moment=require(_0x0fa0('0x4'));var BPromise=require(_0x0fa0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fa0('0x6'));var rimraf=require(_0x0fa0('0x7'));var config=require(_0x0fa0('0x8'));var attributes=require('./template.attributes');module[_0x0fa0('0x9')]=function(_0x524e04,_0x1cee46){return _0x524e04[_0x0fa0('0xa')](_0x0fa0('0xb'),attributes,{'tableName':_0x0fa0('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 b3c85fe..c454303 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 _0x4f0f=['jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x4f0f,0xdf));var _0xf4f0=function(_0x11c15b,_0x28de76){_0x11c15b=_0x11c15b-0x0;var _0x132c01=_0x4f0f[_0x11c15b];return _0x132c01;};'use strict';var _=require(_0xf4f0('0x0'));var util=require(_0xf4f0('0x1'));var moment=require(_0xf4f0('0x2'));var BPromise=require(_0xf4f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4f0('0x4'));var db=require(_0xf4f0('0x5'))['db'];var utils=require(_0xf4f0('0x6'));var logger=require('../../config/logger')(_0xf4f0('0x7'));var config=require('../../config/environment');var jayson=require(_0xf4f0('0x8'));var client=jayson['client'][_0xf4f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x793a01,_0x595027,_0x127bad){return new BPromise(function(_0x3157db,_0x1f3419){return client[_0xf4f0('0xa')](_0x793a01,_0x127bad)[_0xf4f0('0xb')](function(_0x212e81){logger[_0xf4f0('0xc')](_0xf4f0('0xd'),_0x595027,'request\x20sent');logger[_0xf4f0('0xe')](_0xf4f0('0xf'),_0x595027,_0xf4f0('0x10'),JSON[_0xf4f0('0x11')](_0x212e81));if(_0x212e81[_0xf4f0('0x12')]){if(_0x212e81[_0xf4f0('0x12')]['code']===0x1f4){logger[_0xf4f0('0x12')](_0xf4f0('0xd'),_0x595027,_0x212e81[_0xf4f0('0x12')][_0xf4f0('0x13')]);return _0x1f3419(_0x212e81[_0xf4f0('0x12')]['message']);}logger['error'](_0xf4f0('0xd'),_0x595027,_0x212e81[_0xf4f0('0x12')][_0xf4f0('0x13')]);return _0x3157db(_0x212e81[_0xf4f0('0x12')]['message']);}else{logger[_0xf4f0('0xc')]('Template,\x20%s,\x20%s',_0x595027,'request\x20sent');_0x3157db(_0x212e81[_0xf4f0('0x14')]['message']);}})[_0xf4f0('0x15')](function(_0x4182c6){logger[_0xf4f0('0x12')](_0xf4f0('0xd'),_0x595027,_0x4182c6);_0x1f3419(_0x4182c6);});});}exports[_0xf4f0('0x16')]=function(_0x3fcd8f){var _0x10388b=this;return new Promise(function(_0xfc1755,_0x1184ce){return db[_0xf4f0('0x17')][_0xf4f0('0x18')]({'raw':_0x3fcd8f[_0xf4f0('0x19')]?_0x3fcd8f[_0xf4f0('0x19')][_0xf4f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3fcd8f[_0xf4f0('0x19')]?_0x3fcd8f['options'][_0xf4f0('0x1b')]||null:null,'attributes':_0x3fcd8f[_0xf4f0('0x19')]?_0x3fcd8f[_0xf4f0('0x19')][_0xf4f0('0x1c')]||null:null,'limit':_0x3fcd8f[_0xf4f0('0x19')]?_0x3fcd8f[_0xf4f0('0x19')][_0xf4f0('0x1d')]||null:null,'include':_0x3fcd8f[_0xf4f0('0x19')]?_0x3fcd8f[_0xf4f0('0x19')][_0xf4f0('0x1e')]?_[_0xf4f0('0x1f')](_0x3fcd8f[_0xf4f0('0x19')][_0xf4f0('0x1e')],function(_0x50358c){return{'model':db[_0x50358c[_0xf4f0('0x20')]],'as':_0x50358c['as'],'attributes':_0x50358c['attributes'],'include':_0x50358c[_0xf4f0('0x1e')]?_['map'](_0x50358c[_0xf4f0('0x1e')],function(_0x1cfe65){return{'model':db[_0x1cfe65[_0xf4f0('0x20')]],'as':_0x1cfe65['as'],'attributes':_0x1cfe65[_0xf4f0('0x1c')],'include':_0x1cfe65[_0xf4f0('0x1e')]?_[_0xf4f0('0x1f')](_0x1cfe65[_0xf4f0('0x1e')],function(_0x34a3f8){return{'model':db[_0x34a3f8[_0xf4f0('0x20')]],'as':_0x34a3f8['as'],'attributes':_0x34a3f8[_0xf4f0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf4f0('0xb')](function(_0x446473){logger[_0xf4f0('0xc')](_0xf4f0('0x16'),_0x3fcd8f);logger[_0xf4f0('0xe')](_0xf4f0('0x16'),_0x3fcd8f,JSON[_0xf4f0('0x11')](_0x446473));_0xfc1755(_0x446473);})['catch'](function(_0x2059a4){logger[_0xf4f0('0x12')](_0xf4f0('0x16'),_0x2059a4['message'],_0x3fcd8f);_0x1184ce(_0x10388b['error'](0x1f4,_0x2059a4[_0xf4f0('0x13')]));});});}; \ No newline at end of file +var _0xc5b8=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Template,\x20%s,\x20%s','result','GetTemplate','Template','options','raw','where','attributes','include','map','model','debug','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4e457b,_0x31b37c){var _0x248e7b=function(_0x35d865){while(--_0x35d865){_0x4e457b['push'](_0x4e457b['shift']());}};_0x248e7b(++_0x31b37c);}(_0xc5b8,0xbb));var _0x8c5b=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0xc5b8[_0x3b632f];return _0x10e788;};'use strict';var _=require(_0x8c5b('0x0'));var util=require(_0x8c5b('0x1'));var moment=require(_0x8c5b('0x2'));var BPromise=require(_0x8c5b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c5b('0x4'));var db=require(_0x8c5b('0x5'))['db'];var utils=require(_0x8c5b('0x6'));var logger=require('../../config/logger')(_0x8c5b('0x7'));var config=require(_0x8c5b('0x8'));var jayson=require(_0x8c5b('0x9'));var client=jayson['client'][_0x8c5b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fac05,_0x1614cb,_0x143508){return new BPromise(function(_0x564813,_0xc46838){return client['request'](_0x1fac05,_0x143508)[_0x8c5b('0xb')](function(_0x2d7985){logger[_0x8c5b('0xc')]('Template,\x20%s,\x20%s',_0x1614cb,'request\x20sent');logger['debug'](_0x8c5b('0xd'),_0x1614cb,_0x8c5b('0xe'),JSON[_0x8c5b('0xf')](_0x2d7985));if(_0x2d7985[_0x8c5b('0x10')]){if(_0x2d7985[_0x8c5b('0x10')][_0x8c5b('0x11')]===0x1f4){logger[_0x8c5b('0x10')]('Template,\x20%s,\x20%s',_0x1614cb,_0x2d7985[_0x8c5b('0x10')][_0x8c5b('0x12')]);return _0xc46838(_0x2d7985[_0x8c5b('0x10')][_0x8c5b('0x12')]);}logger[_0x8c5b('0x10')](_0x8c5b('0x13'),_0x1614cb,_0x2d7985['error']['message']);return _0x564813(_0x2d7985[_0x8c5b('0x10')][_0x8c5b('0x12')]);}else{logger[_0x8c5b('0xc')](_0x8c5b('0x13'),_0x1614cb,'request\x20sent');_0x564813(_0x2d7985[_0x8c5b('0x14')][_0x8c5b('0x12')]);}})['catch'](function(_0x3d69ff){logger[_0x8c5b('0x10')](_0x8c5b('0x13'),_0x1614cb,_0x3d69ff);_0xc46838(_0x3d69ff);});});}exports[_0x8c5b('0x15')]=function(_0x245029){var _0x20e402=this;return new Promise(function(_0x5b8692,_0x5a1581){return db[_0x8c5b('0x16')]['findAll']({'raw':_0x245029[_0x8c5b('0x17')]?_0x245029['options'][_0x8c5b('0x18')]===undefined?!![]:![]:!![],'where':_0x245029[_0x8c5b('0x17')]?_0x245029[_0x8c5b('0x17')][_0x8c5b('0x19')]||null:null,'attributes':_0x245029[_0x8c5b('0x17')]?_0x245029[_0x8c5b('0x17')][_0x8c5b('0x1a')]||null:null,'limit':_0x245029[_0x8c5b('0x17')]?_0x245029['options']['limit']||null:null,'include':_0x245029[_0x8c5b('0x17')]?_0x245029['options'][_0x8c5b('0x1b')]?_[_0x8c5b('0x1c')](_0x245029['options'][_0x8c5b('0x1b')],function(_0x31e0c3){return{'model':db[_0x31e0c3[_0x8c5b('0x1d')]],'as':_0x31e0c3['as'],'attributes':_0x31e0c3[_0x8c5b('0x1a')],'include':_0x31e0c3[_0x8c5b('0x1b')]?_['map'](_0x31e0c3[_0x8c5b('0x1b')],function(_0x2bea97){return{'model':db[_0x2bea97[_0x8c5b('0x1d')]],'as':_0x2bea97['as'],'attributes':_0x2bea97['attributes'],'include':_0x2bea97[_0x8c5b('0x1b')]?_[_0x8c5b('0x1c')](_0x2bea97[_0x8c5b('0x1b')],function(_0x44a503){return{'model':db[_0x44a503[_0x8c5b('0x1d')]],'as':_0x44a503['as'],'attributes':_0x44a503[_0x8c5b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8c5b('0xb')](function(_0x219255){logger[_0x8c5b('0xc')](_0x8c5b('0x15'),_0x245029);logger[_0x8c5b('0x1e')](_0x8c5b('0x15'),_0x245029,JSON[_0x8c5b('0xf')](_0x219255));_0x5b8692(_0x219255);})[_0x8c5b('0x1f')](function(_0x2d83ee){logger[_0x8c5b('0x10')](_0x8c5b('0x15'),_0x2d83ee[_0x8c5b('0x12')],_0x245029);_0x5a1581(_0x20e402[_0x8c5b('0x10')](0x1f4,_0x2d83ee[_0x8c5b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 9cb2467..36a0564 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 _0xe34e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','get','/:id','show','/:id/all_conditions','getAnyConditions','getActions','post','create','/:id/any_conditions','addAction','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x4c807c,_0x3e41c5){var _0xad2435=function(_0x1e7b31){while(--_0x1e7b31){_0x4c807c['push'](_0x4c807c['shift']());}};_0xad2435(++_0x3e41c5);}(_0xe34e,0x132));var _0xee34=function(_0x1fb26f,_0x18b096){_0x1fb26f=_0x1fb26f-0x0;var _0x285528=_0xe34e[_0x1fb26f];return _0x285528;};'use strict';var multer=require(_0xee34('0x0'));var util=require(_0xee34('0x1'));var path=require('path');var timeout=require(_0xee34('0x2'));var express=require(_0xee34('0x3'));var router=express[_0xee34('0x4')]();var fs_extra=require(_0xee34('0x5'));var auth=require(_0xee34('0x6'));var interaction=require(_0xee34('0x7'));var config=require(_0xee34('0x8'));var controller=require(_0xee34('0x9'));router['get']('/',auth[_0xee34('0xa')](),controller['index']);router[_0xee34('0xb')](_0xee34('0xc'),auth[_0xee34('0xa')](),controller[_0xee34('0xd')]);router[_0xee34('0xb')](_0xee34('0xe'),auth[_0xee34('0xa')](),controller['getAllConditions']);router[_0xee34('0xb')]('/:id/any_conditions',auth[_0xee34('0xa')](),controller[_0xee34('0xf')]);router['get']('/:id/actions',auth[_0xee34('0xa')](),controller[_0xee34('0x10')]);router[_0xee34('0x11')]('/',auth['isAuthenticated'](),controller[_0xee34('0x12')]);router[_0xee34('0x11')](_0xee34('0xe'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0xee34('0x11')](_0xee34('0x13'),auth[_0xee34('0xa')](),controller['addAnyCondition']);router[_0xee34('0x11')]('/:id/actions',auth[_0xee34('0xa')](),controller[_0xee34('0x14')]);router[_0xee34('0x15')]('/:id',auth[_0xee34('0xa')](),controller[_0xee34('0x16')]);router[_0xee34('0x17')](_0xee34('0xc'),auth['isAuthenticated'](),controller[_0xee34('0x18')]);module[_0xee34('0x19')]=router; \ No newline at end of file +var _0xe672=['addAnyCondition','addAction','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','/:id/all_conditions','addAllCondition'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe672,0x1e4));var _0x2e67=function(_0x8a672a,_0x2446de){_0x8a672a=_0x8a672a-0x0;var _0x51bad9=_0xe672[_0x8a672a];return _0x51bad9;};'use strict';var multer=require(_0x2e67('0x0'));var util=require('util');var path=require(_0x2e67('0x1'));var timeout=require(_0x2e67('0x2'));var express=require(_0x2e67('0x3'));var router=express[_0x2e67('0x4')]();var fs_extra=require(_0x2e67('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2e67('0x6'));var controller=require(_0x2e67('0x7'));router[_0x2e67('0x8')]('/',auth[_0x2e67('0x9')](),controller['index']);router['get'](_0x2e67('0xa'),auth[_0x2e67('0x9')](),controller[_0x2e67('0xb')]);router[_0x2e67('0x8')]('/:id/all_conditions',auth[_0x2e67('0x9')](),controller[_0x2e67('0xc')]);router[_0x2e67('0x8')](_0x2e67('0xd'),auth[_0x2e67('0x9')](),controller[_0x2e67('0xe')]);router[_0x2e67('0x8')](_0x2e67('0xf'),auth[_0x2e67('0x9')](),controller[_0x2e67('0x10')]);router[_0x2e67('0x11')]('/',auth[_0x2e67('0x9')](),controller['create']);router['post'](_0x2e67('0x12'),auth[_0x2e67('0x9')](),controller[_0x2e67('0x13')]);router[_0x2e67('0x11')](_0x2e67('0xd'),auth[_0x2e67('0x9')](),controller[_0x2e67('0x14')]);router[_0x2e67('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x2e67('0x15')]);router['put'](_0x2e67('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2e67('0x16')](_0x2e67('0xa'),auth[_0x2e67('0x9')](),controller[_0x2e67('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 8cd17f2..619f4b8 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 _0xb2ba=['BOOLEAN','sequelize','exports','STRING'];(function(_0x39d980,_0x15c127){var _0x33fcbc=function(_0x32548a){while(--_0x32548a){_0x39d980['push'](_0x39d980['shift']());}};_0x33fcbc(++_0x15c127);}(_0xb2ba,0x1b5));var _0xab2b=function(_0x57b973,_0x3e3578){_0x57b973=_0x57b973-0x0;var _0xcba513=_0xb2ba[_0x57b973];return _0xcba513;};'use strict';var Sequelize=require(_0xab2b('0x0'));module[_0xab2b('0x1')]={'name':{'type':Sequelize[_0xab2b('0x2')]},'channel':{'type':Sequelize[_0xab2b('0x2')]},'description':{'type':Sequelize[_0xab2b('0x2')]},'status':{'type':Sequelize[_0xab2b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdf66=['STRING','BOOLEAN','exports'];(function(_0x68b90b,_0xb8b06a){var _0x5220ec=function(_0x226484){while(--_0x226484){_0x68b90b['push'](_0x68b90b['shift']());}};_0x5220ec(++_0xb8b06a);}(_0xdf66,0x8c));var _0x6df6=function(_0x1998bb,_0x1f1da1){_0x1998bb=_0x1998bb-0x0;var _0x4ae4c9=_0xdf66[_0x1998bb];return _0x4ae4c9;};'use strict';var Sequelize=require('sequelize');module[_0x6df6('0x0')]={'name':{'type':Sequelize[_0x6df6('0x1')]},'channel':{'type':Sequelize[_0x6df6('0x1')]},'description':{'type':Sequelize[_0x6df6('0x1')]},'status':{'type':Sequelize[_0x6df6('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index df0fd97..15084fe 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 _0x0238=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','pick','getAllConditions','getAnyConditions','addAction','TriggerId','getActions','Action','eml-format','rimraf','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','Triggers','UserProfileResource','error','stack','send','map','Trigger','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x0238,0x18b));var _0x8023=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x0238[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x8023('0x0'));var rimraf=require(_0x8023('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8023('0x2'));var Mustache=require('mustache');var util=require(_0x8023('0x3'));var path=require(_0x8023('0x4'));var sox=require(_0x8023('0x5'));var csv=require(_0x8023('0x6'));var ejs=require(_0x8023('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8023('0x8'));var jsforce=require(_0x8023('0x9'));var deskjs=require(_0x8023('0xa'));var toCsv=require(_0x8023('0x6'));var querystring=require(_0x8023('0xb'));var Papa=require(_0x8023('0xc'));var Redis=require(_0x8023('0xd'));var authService=require(_0x8023('0xe'));var qs=require(_0x8023('0xf'));var as=require(_0x8023('0x10'));var hardwareService=require(_0x8023('0x11'));var logger=require(_0x8023('0x12'))(_0x8023('0x13'));var utils=require(_0x8023('0x14'));var config=require(_0x8023('0x15'));var licenseUtil=require(_0x8023('0x16'));var db=require(_0x8023('0x17'))['db'];function respondWithStatusCode(_0x3100e4,_0x2d65a7){_0x2d65a7=_0x2d65a7||0xcc;return function(_0x452c2f){if(_0x452c2f){return _0x3100e4[_0x8023('0x18')](_0x2d65a7);}return _0x3100e4['status'](_0x2d65a7)[_0x8023('0x19')]();};}function respondWithResult(_0x27cadc,_0x231c32){_0x231c32=_0x231c32||0xc8;return function(_0xd0123c){if(_0xd0123c){return _0x27cadc[_0x8023('0x1a')](_0x231c32)['json'](_0xd0123c);}};}function respondWithFilteredResult(_0x2872fc,_0x4443b9){return function(_0x383b83){if(_0x383b83){var _0x31c08a=typeof _0x4443b9[_0x8023('0x1b')]===_0x8023('0x1c')&&typeof _0x4443b9[_0x8023('0x1d')]===_0x8023('0x1c');var _0xffec09=_0x383b83[_0x8023('0x1e')];var _0x15dc37=_0x31c08a?0x0:_0x4443b9[_0x8023('0x1b')];var _0x5871b4=_0x31c08a?_0x383b83[_0x8023('0x1e')]:_0x4443b9[_0x8023('0x1b')]+_0x4443b9[_0x8023('0x1d')];var _0x1b12ec;if(_0x5871b4>=_0xffec09){_0x5871b4=_0xffec09;_0x1b12ec=0xc8;}else{_0x1b12ec=0xce;}_0x2872fc['status'](_0x1b12ec);return _0x2872fc[_0x8023('0x1f')](_0x8023('0x20'),_0x15dc37+'-'+_0x5871b4+'/'+_0xffec09)['json'](_0x383b83);}return null;};}function patchUpdates(_0x371a8b){return function(_0x2e3a80){try{jsonpatch['apply'](_0x2e3a80,_0x371a8b,!![]);}catch(_0x1037ed){return BPromise[_0x8023('0x21')](_0x1037ed);}return _0x2e3a80['save']();};}function saveUpdates(_0x497c3b,_0x47b1d1){return function(_0x3e75b0){if(_0x3e75b0){return _0x3e75b0[_0x8023('0x22')](_0x497c3b)['then'](function(_0x1bd70c){return _0x1bd70c;});}return null;};}function removeEntity(_0x300041,_0x10eb58){return function(_0x47f702){if(_0x47f702){return _0x47f702[_0x8023('0x23')]()[_0x8023('0x24')](function(){var _0x3d587c=_0x47f702[_0x8023('0x25')]({'plain':!![]});var _0x46274e=_0x8023('0x26');return db[_0x8023('0x27')][_0x8023('0x23')]({'where':{'type':_0x46274e,'resourceId':_0x3d587c['id']}})['then'](function(){return _0x47f702;});})['then'](function(){_0x300041[_0x8023('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1105a9,_0x23e2b3){return function(_0x3de0c3){if(!_0x3de0c3){_0x1105a9['sendStatus'](0x194);}return _0x3de0c3;};}function handleError(_0x3d5784,_0x5d0f3b){_0x5d0f3b=_0x5d0f3b||0x1f4;return function(_0x2c774e){logger[_0x8023('0x28')](_0x2c774e[_0x8023('0x29')]);if(_0x2c774e['name']){delete _0x2c774e['name'];}_0x3d5784[_0x8023('0x1a')](_0x5d0f3b)[_0x8023('0x2a')](_0x2c774e);};}exports['index']=function(_0x3ce26b,_0x42c054){var _0x4e266f={},_0x829284={},_0x28e595={'count':0x0,'rows':[]};var _0x165909=_[_0x8023('0x2b')](db[_0x8023('0x2c')][_0x8023('0x2d')],function(_0xe9ded0){return{'name':_0xe9ded0[_0x8023('0x2e')],'type':_0xe9ded0[_0x8023('0x2f')][_0x8023('0x30')]};});_0x829284[_0x8023('0x31')]=_[_0x8023('0x2b')](_0x165909,_0x8023('0x32'));_0x829284[_0x8023('0x33')]=_[_0x8023('0x34')](_0x3ce26b[_0x8023('0x33')]);_0x829284['filters']=_[_0x8023('0x35')](_0x829284['model'],_0x829284[_0x8023('0x33')]);_0x4e266f[_0x8023('0x36')]=_['intersection'](_0x829284[_0x8023('0x31')],qs[_0x8023('0x37')](_0x3ce26b[_0x8023('0x33')][_0x8023('0x37')]));_0x4e266f['attributes']=_0x4e266f['attributes'][_0x8023('0x38')]?_0x4e266f[_0x8023('0x36')]:_0x829284[_0x8023('0x31')];if(!_0x3ce26b[_0x8023('0x33')][_0x8023('0x39')](_0x8023('0x3a'))){_0x4e266f[_0x8023('0x1d')]=qs[_0x8023('0x1d')](_0x3ce26b[_0x8023('0x33')][_0x8023('0x1d')]);_0x4e266f[_0x8023('0x1b')]=qs[_0x8023('0x1b')](_0x3ce26b['query'][_0x8023('0x1b')]);}_0x4e266f[_0x8023('0x3b')]=qs['sort'](_0x3ce26b[_0x8023('0x33')][_0x8023('0x3c')]);_0x4e266f[_0x8023('0x3d')]=qs[_0x8023('0x3e')](_['pick'](_0x3ce26b[_0x8023('0x33')],_0x829284[_0x8023('0x3e')]),_0x165909);if(_0x3ce26b[_0x8023('0x33')][_0x8023('0x3f')]){_0x4e266f[_0x8023('0x3d')]=_[_0x8023('0x40')](_0x4e266f[_0x8023('0x3d')],{'$or':_[_0x8023('0x2b')](_0x165909,function(_0xbdbd4e){if(_0xbdbd4e[_0x8023('0x2f')]!==_0x8023('0x41')){var _0xc922e8={};_0xc922e8[_0xbdbd4e[_0x8023('0x32')]]={'$like':'%'+_0x3ce26b[_0x8023('0x33')][_0x8023('0x3f')]+'%'};return _0xc922e8;}})});}_0x4e266f=_[_0x8023('0x40')]({},_0x4e266f,_0x3ce26b[_0x8023('0x42')]);var _0x92adc7={'where':_0x4e266f[_0x8023('0x3d')]};return db[_0x8023('0x2c')]['count'](_0x92adc7)['then'](function(_0x2c9f4f){_0x28e595[_0x8023('0x1e')]=_0x2c9f4f;if(_0x3ce26b['query'][_0x8023('0x43')]){_0x4e266f[_0x8023('0x44')]=[{'all':!![]}];}return db[_0x8023('0x2c')][_0x8023('0x45')](_0x4e266f);})[_0x8023('0x24')](function(_0x27a094){_0x28e595[_0x8023('0x46')]=_0x27a094;return _0x28e595;})[_0x8023('0x24')](respondWithFilteredResult(_0x42c054,_0x4e266f))[_0x8023('0x47')](handleError(_0x42c054,null));};exports[_0x8023('0x48')]=function(_0x7326b0,_0x42427b){var _0x5ea476={'raw':![],'where':{'id':_0x7326b0[_0x8023('0x49')]['id']}},_0x15669f={};_0x15669f[_0x8023('0x31')]=_[_0x8023('0x34')](db[_0x8023('0x2c')][_0x8023('0x2d')]);_0x15669f[_0x8023('0x33')]=_['keys'](_0x7326b0['query']);_0x15669f[_0x8023('0x3e')]=_['intersection'](_0x15669f[_0x8023('0x31')],_0x15669f[_0x8023('0x33')]);_0x5ea476[_0x8023('0x36')]=_[_0x8023('0x35')](_0x15669f[_0x8023('0x31')],qs[_0x8023('0x37')](_0x7326b0[_0x8023('0x33')][_0x8023('0x37')]));_0x5ea476[_0x8023('0x36')]=_0x5ea476[_0x8023('0x36')][_0x8023('0x38')]?_0x5ea476[_0x8023('0x36')]:_0x15669f['model'];if(_0x7326b0[_0x8023('0x33')]['includeAll']){_0x5ea476[_0x8023('0x44')]=[{'all':!![]}];}_0x5ea476=_[_0x8023('0x40')]({},_0x5ea476,_0x7326b0['options']);return db[_0x8023('0x2c')]['find'](_0x5ea476)[_0x8023('0x24')](handleEntityNotFound(_0x42427b,null))[_0x8023('0x24')](respondWithResult(_0x42427b,null))[_0x8023('0x47')](handleError(_0x42427b,null));};exports[_0x8023('0x4a')]=function(_0x3d7710,_0xf18707){return db[_0x8023('0x2c')][_0x8023('0x4a')](_0x3d7710[_0x8023('0x4b')],{})[_0x8023('0x24')](function(_0x56a567){var _0x5bbdac=_0x3d7710[_0x8023('0x4c')][_0x8023('0x25')]({'plain':!![]});if(!_0x5bbdac)throw new Error(_0x8023('0x4d'));if(_0x5bbdac['role']===_0x8023('0x4c')){var _0x579705=_0x56a567[_0x8023('0x25')]({'plain':!![]});var _0x1c287e=_0x8023('0x26');return db['UserProfileSection'][_0x8023('0x4e')]({'where':{'name':_0x1c287e,'userProfileId':_0x5bbdac[_0x8023('0x4f')]},'raw':!![]})[_0x8023('0x24')](function(_0xb318cd){if(_0xb318cd&&_0xb318cd[_0x8023('0x50')]===0x0){return db[_0x8023('0x27')][_0x8023('0x4a')]({'name':_0x579705[_0x8023('0x32')],'resourceId':_0x579705['id'],'type':_0xb318cd['name'],'sectionId':_0xb318cd['id']},{})[_0x8023('0x24')](function(){return _0x56a567;});}else{return _0x56a567;}})[_0x8023('0x47')](function(_0x58b8a9){logger[_0x8023('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58b8a9);throw _0x58b8a9;});}return _0x56a567;})[_0x8023('0x24')](respondWithResult(_0xf18707,0xc9))['catch'](handleError(_0xf18707,null));};exports[_0x8023('0x22')]=function(_0x4051e8,_0xd66792){if(_0x4051e8['body']['id']){delete _0x4051e8[_0x8023('0x4b')]['id'];}return db['Trigger'][_0x8023('0x4e')]({'where':{'id':_0x4051e8[_0x8023('0x49')]['id']}})[_0x8023('0x24')](handleEntityNotFound(_0xd66792,null))[_0x8023('0x24')](saveUpdates(_0x4051e8[_0x8023('0x4b')],null))[_0x8023('0x24')](respondWithResult(_0xd66792,null))['catch'](handleError(_0xd66792,null));};exports[_0x8023('0x23')]=function(_0x45707b,_0x2cfca3){return db[_0x8023('0x2c')][_0x8023('0x4e')]({'where':{'id':_0x45707b[_0x8023('0x49')]['id']}})[_0x8023('0x24')](handleEntityNotFound(_0x2cfca3,null))[_0x8023('0x24')](removeEntity(_0x2cfca3,null))['catch'](handleError(_0x2cfca3,null));};exports[_0x8023('0x51')]=function(_0x8f16d6,_0x5dff9a,_0x408cc7){if(_0x8f16d6[_0x8023('0x4b')]['id']){delete _0x8f16d6[_0x8023('0x4b')]['id'];}return db[_0x8023('0x2c')][_0x8023('0x4e')]({'where':{'id':_0x8f16d6['params']['id']}})[_0x8023('0x24')](handleEntityNotFound(_0x5dff9a,null))['then'](function(_0x17175e){if(_0x17175e){_0x8f16d6[_0x8023('0x4b')][_0x8023('0x52')]=_0x17175e['id'];return db[_0x8023('0x53')][_0x8023('0x4a')](_0x8f16d6[_0x8023('0x4b')]);}})[_0x8023('0x24')](respondWithResult(_0x5dff9a,null))[_0x8023('0x47')](handleError(_0x5dff9a,null));};exports[_0x8023('0x54')]=function(_0x51e2ad,_0xf3998c,_0x401dd1){if(_0x51e2ad[_0x8023('0x4b')]['id']){delete _0x51e2ad[_0x8023('0x4b')]['id'];}return db[_0x8023('0x2c')][_0x8023('0x4e')]({'where':{'id':_0x51e2ad[_0x8023('0x49')]['id']}})['then'](handleEntityNotFound(_0xf3998c,null))[_0x8023('0x24')](function(_0x307022){if(_0x307022){_0x51e2ad['body'][_0x8023('0x55')]=_0x307022['id'];return db[_0x8023('0x53')][_0x8023('0x4a')](_0x51e2ad[_0x8023('0x4b')]);}})[_0x8023('0x24')](respondWithResult(_0xf3998c,null))[_0x8023('0x47')](handleError(_0xf3998c,null));};exports['getAllConditions']=function(_0x59621c,_0x3c2e1f,_0x40a62a){var _0x444536={};var _0x29e6d6={};var _0x198ff4;var _0x54b61d;return db[_0x8023('0x2c')][_0x8023('0x56')]({'where':{'id':_0x59621c[_0x8023('0x49')]['id']}})[_0x8023('0x24')](handleEntityNotFound(_0x3c2e1f,null))[_0x8023('0x24')](function(_0x519865){if(_0x519865){_0x198ff4=_0x519865;_0x29e6d6['model']=_[_0x8023('0x34')](db[_0x8023('0x53')][_0x8023('0x2d')]);_0x29e6d6[_0x8023('0x33')]=_[_0x8023('0x34')](_0x59621c[_0x8023('0x33')]);_0x29e6d6['filters']=_['intersection'](_0x29e6d6['model'],_0x29e6d6[_0x8023('0x33')]);_0x444536['attributes']=_[_0x8023('0x35')](_0x29e6d6[_0x8023('0x31')],qs[_0x8023('0x37')](_0x59621c[_0x8023('0x33')][_0x8023('0x37')]));_0x444536['attributes']=_0x444536[_0x8023('0x36')]['length']?_0x444536['attributes']:_0x29e6d6[_0x8023('0x31')];_0x444536[_0x8023('0x3b')]=qs[_0x8023('0x3c')](_0x59621c[_0x8023('0x33')][_0x8023('0x3c')]);_0x444536['where']=qs[_0x8023('0x3e')](_[_0x8023('0x57')](_0x59621c[_0x8023('0x33')],_0x29e6d6[_0x8023('0x3e')]));if(_0x59621c['query']['filter']){_0x444536[_0x8023('0x3d')]=_[_0x8023('0x40')](_0x444536[_0x8023('0x3d')],{'$or':_[_0x8023('0x2b')](_0x444536['attributes'],function(_0x5961a2){var _0x11d564={};_0x11d564[_0x5961a2]={'$like':'%'+_0x59621c[_0x8023('0x33')][_0x8023('0x3f')]+'%'};return _0x11d564;})});}_0x444536=_['merge']({},_0x444536,_0x59621c['options']);return _0x198ff4[_0x8023('0x58')](_0x444536);}})[_0x8023('0x24')](function(_0x2ab2be){if(_0x2ab2be){_0x54b61d=_0x2ab2be[_0x8023('0x38')];if(!_0x59621c['query']['hasOwnProperty']('nolimit')){_0x444536[_0x8023('0x1d')]=qs[_0x8023('0x1d')](_0x59621c[_0x8023('0x33')][_0x8023('0x1d')]);_0x444536[_0x8023('0x1b')]=qs['offset'](_0x59621c[_0x8023('0x33')]['offset']);}return _0x198ff4[_0x8023('0x58')](_0x444536);}})[_0x8023('0x24')](function(_0x577d1e){if(_0x577d1e){return _0x577d1e?{'count':_0x54b61d,'rows':_0x577d1e}:null;}})[_0x8023('0x24')](respondWithResult(_0x3c2e1f,null))[_0x8023('0x47')](handleError(_0x3c2e1f,null));};exports[_0x8023('0x59')]=function(_0x90f051,_0x4d0ba0,_0x8d9bd1){var _0x65fc77={};var _0x245dee={};var _0x5d12e2;var _0xb5768f;return db[_0x8023('0x2c')][_0x8023('0x56')]({'where':{'id':_0x90f051[_0x8023('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d0ba0,null))[_0x8023('0x24')](function(_0x40f5b9){if(_0x40f5b9){_0x5d12e2=_0x40f5b9;_0x245dee[_0x8023('0x31')]=_[_0x8023('0x34')](db[_0x8023('0x53')]['rawAttributes']);_0x245dee[_0x8023('0x33')]=_[_0x8023('0x34')](_0x90f051[_0x8023('0x33')]);_0x245dee['filters']=_[_0x8023('0x35')](_0x245dee[_0x8023('0x31')],_0x245dee[_0x8023('0x33')]);_0x65fc77[_0x8023('0x36')]=_[_0x8023('0x35')](_0x245dee[_0x8023('0x31')],qs[_0x8023('0x37')](_0x90f051[_0x8023('0x33')][_0x8023('0x37')]));_0x65fc77[_0x8023('0x36')]=_0x65fc77[_0x8023('0x36')][_0x8023('0x38')]?_0x65fc77[_0x8023('0x36')]:_0x245dee[_0x8023('0x31')];_0x65fc77[_0x8023('0x3b')]=qs[_0x8023('0x3c')](_0x90f051[_0x8023('0x33')][_0x8023('0x3c')]);_0x65fc77[_0x8023('0x3d')]=qs[_0x8023('0x3e')](_[_0x8023('0x57')](_0x90f051['query'],_0x245dee[_0x8023('0x3e')]));if(_0x90f051[_0x8023('0x33')]['filter']){_0x65fc77[_0x8023('0x3d')]=_[_0x8023('0x40')](_0x65fc77[_0x8023('0x3d')],{'$or':_[_0x8023('0x2b')](_0x65fc77[_0x8023('0x36')],function(_0xc8bffa){var _0x29f502={};_0x29f502[_0xc8bffa]={'$like':'%'+_0x90f051[_0x8023('0x33')]['filter']+'%'};return _0x29f502;})});}_0x65fc77=_['merge']({},_0x65fc77,_0x90f051[_0x8023('0x42')]);return _0x5d12e2[_0x8023('0x59')](_0x65fc77);}})[_0x8023('0x24')](function(_0x5942ea){if(_0x5942ea){_0xb5768f=_0x5942ea[_0x8023('0x38')];if(!_0x90f051[_0x8023('0x33')][_0x8023('0x39')]('nolimit')){_0x65fc77[_0x8023('0x1d')]=qs[_0x8023('0x1d')](_0x90f051[_0x8023('0x33')]['limit']);_0x65fc77['offset']=qs[_0x8023('0x1b')](_0x90f051[_0x8023('0x33')][_0x8023('0x1b')]);}return _0x5d12e2[_0x8023('0x59')](_0x65fc77);}})[_0x8023('0x24')](function(_0x7d2939){if(_0x7d2939){return _0x7d2939?{'count':_0xb5768f,'rows':_0x7d2939}:null;}})['then'](respondWithResult(_0x4d0ba0,null))['catch'](handleError(_0x4d0ba0,null));};exports[_0x8023('0x5a')]=function(_0x174b28,_0x34bc99,_0x4b78e3){if(_0x174b28[_0x8023('0x4b')]['id']){delete _0x174b28['body']['id'];}return db[_0x8023('0x2c')][_0x8023('0x4e')]({'where':{'id':_0x174b28['params']['id']}})[_0x8023('0x24')](handleEntityNotFound(_0x34bc99,null))['then'](function(_0x2af2d7){if(_0x2af2d7){_0x174b28['body'][_0x8023('0x5b')]=_0x2af2d7['id'];return db['Action'][_0x8023('0x4a')](_0x174b28['body']);}})['then'](respondWithResult(_0x34bc99,null))[_0x8023('0x47')](handleError(_0x34bc99,null));};exports[_0x8023('0x5c')]=function(_0x5c22f7,_0x47372a,_0x14a969){var _0x16506c={};var _0x51236d={};var _0x33e8a6;var _0x5d210a;return db[_0x8023('0x2c')]['findOne']({'where':{'id':_0x5c22f7[_0x8023('0x49')]['id']}})['then'](handleEntityNotFound(_0x47372a,null))[_0x8023('0x24')](function(_0x34b4ac){if(_0x34b4ac){_0x33e8a6=_0x34b4ac;_0x51236d[_0x8023('0x31')]=_[_0x8023('0x34')](db[_0x8023('0x5d')][_0x8023('0x2d')]);_0x51236d[_0x8023('0x33')]=_[_0x8023('0x34')](_0x5c22f7['query']);_0x51236d[_0x8023('0x3e')]=_[_0x8023('0x35')](_0x51236d[_0x8023('0x31')],_0x51236d[_0x8023('0x33')]);_0x16506c['attributes']=_['intersection'](_0x51236d['model'],qs[_0x8023('0x37')](_0x5c22f7[_0x8023('0x33')][_0x8023('0x37')]));_0x16506c['attributes']=_0x16506c[_0x8023('0x36')][_0x8023('0x38')]?_0x16506c[_0x8023('0x36')]:_0x51236d[_0x8023('0x31')];_0x16506c[_0x8023('0x3b')]=qs[_0x8023('0x3c')](_0x5c22f7['query'][_0x8023('0x3c')]);_0x16506c[_0x8023('0x3d')]=qs[_0x8023('0x3e')](_['pick'](_0x5c22f7[_0x8023('0x33')],_0x51236d[_0x8023('0x3e')]));if(_0x5c22f7[_0x8023('0x33')][_0x8023('0x3f')]){_0x16506c[_0x8023('0x3d')]=_[_0x8023('0x40')](_0x16506c[_0x8023('0x3d')],{'$or':_[_0x8023('0x2b')](_0x16506c[_0x8023('0x36')],function(_0x3b1f63){var _0x5560d6={};_0x5560d6[_0x3b1f63]={'$like':'%'+_0x5c22f7['query'][_0x8023('0x3f')]+'%'};return _0x5560d6;})});}_0x16506c=_[_0x8023('0x40')]({},_0x16506c,_0x5c22f7[_0x8023('0x42')]);return _0x33e8a6[_0x8023('0x5c')](_0x16506c);}})[_0x8023('0x24')](function(_0x1f9e0a){if(_0x1f9e0a){_0x5d210a=_0x1f9e0a[_0x8023('0x38')];if(!_0x5c22f7['query'][_0x8023('0x39')](_0x8023('0x3a'))){_0x16506c['limit']=qs[_0x8023('0x1d')](_0x5c22f7['query'][_0x8023('0x1d')]);_0x16506c[_0x8023('0x1b')]=qs[_0x8023('0x1b')](_0x5c22f7[_0x8023('0x33')][_0x8023('0x1b')]);}return _0x33e8a6[_0x8023('0x5c')](_0x16506c);}})['then'](function(_0x16a35b){if(_0x16a35b){return _0x16a35b?{'count':_0x5d210a,'rows':_0x16a35b}:null;}})[_0x8023('0x24')](respondWithResult(_0x47372a,null))[_0x8023('0x47')](handleError(_0x47372a,null));}; \ No newline at end of file +var _0x69d0=['name','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','sort','where','pick','VIRTUAL','filter','merge','options','Trigger','include','findAll','catch','show','params','rawAttributes','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Triggers','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addAllCondition','Condition','addAnyCondition','getAllConditions','order','hasOwnProperty','nolimit','getAnyConditions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','end','error','stack'];(function(_0x4753f8,_0x48b131){var _0x45d4e4=function(_0x2d59a9){while(--_0x2d59a9){_0x4753f8['push'](_0x4753f8['shift']());}};_0x45d4e4(++_0x48b131);}(_0x69d0,0xef));var _0x069d=function(_0x73725c,_0x18f2b0){_0x73725c=_0x73725c-0x0;var _0x58953a=_0x69d0[_0x73725c];return _0x58953a;};'use strict';var emlformat=require(_0x069d('0x0'));var rimraf=require(_0x069d('0x1'));var zipdir=require(_0x069d('0x2'));var jsonpatch=require(_0x069d('0x3'));var rp=require(_0x069d('0x4'));var moment=require(_0x069d('0x5'));var BPromise=require(_0x069d('0x6'));var Mustache=require(_0x069d('0x7'));var util=require(_0x069d('0x8'));var path=require(_0x069d('0x9'));var sox=require(_0x069d('0xa'));var csv=require(_0x069d('0xb'));var ejs=require(_0x069d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x069d('0xd'));var squel=require(_0x069d('0xe'));var crypto=require('crypto');var jsforce=require(_0x069d('0xf'));var deskjs=require(_0x069d('0x10'));var toCsv=require(_0x069d('0xb'));var querystring=require(_0x069d('0x11'));var Papa=require(_0x069d('0x12'));var Redis=require(_0x069d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x069d('0x14'));var as=require(_0x069d('0x15'));var hardwareService=require(_0x069d('0x16'));var logger=require(_0x069d('0x17'))(_0x069d('0x18'));var utils=require(_0x069d('0x19'));var config=require(_0x069d('0x1a'));var licenseUtil=require(_0x069d('0x1b'));var db=require(_0x069d('0x1c'))['db'];function respondWithStatusCode(_0x217a8c,_0x22a742){_0x22a742=_0x22a742||0xcc;return function(_0x3267c8){if(_0x3267c8){return _0x217a8c[_0x069d('0x1d')](_0x22a742);}return _0x217a8c[_0x069d('0x1e')](_0x22a742)['end']();};}function respondWithResult(_0x4d2b5b,_0x4d7bcf){_0x4d7bcf=_0x4d7bcf||0xc8;return function(_0xeb051b){if(_0xeb051b){return _0x4d2b5b[_0x069d('0x1e')](_0x4d7bcf)[_0x069d('0x1f')](_0xeb051b);}};}function respondWithFilteredResult(_0x52ed85,_0x32754a){return function(_0x13664d){if(_0x13664d){var _0x2e59e5=typeof _0x32754a[_0x069d('0x20')]===_0x069d('0x21')&&typeof _0x32754a[_0x069d('0x22')]===_0x069d('0x21');var _0x38acc1=_0x13664d[_0x069d('0x23')];var _0x13954e=_0x2e59e5?0x0:_0x32754a[_0x069d('0x20')];var _0x3fe081=_0x2e59e5?_0x13664d['count']:_0x32754a[_0x069d('0x20')]+_0x32754a[_0x069d('0x22')];var _0x543547;if(_0x3fe081>=_0x38acc1){_0x3fe081=_0x38acc1;_0x543547=0xc8;}else{_0x543547=0xce;}_0x52ed85[_0x069d('0x1e')](_0x543547);return _0x52ed85[_0x069d('0x24')](_0x069d('0x25'),_0x13954e+'-'+_0x3fe081+'/'+_0x38acc1)[_0x069d('0x1f')](_0x13664d);}return null;};}function patchUpdates(_0x2cc6cb){return function(_0x391b92){try{jsonpatch['apply'](_0x391b92,_0x2cc6cb,!![]);}catch(_0x427306){return BPromise[_0x069d('0x26')](_0x427306);}return _0x391b92[_0x069d('0x27')]();};}function saveUpdates(_0x1882e5,_0x417a4d){return function(_0x14b3ba){if(_0x14b3ba){return _0x14b3ba[_0x069d('0x28')](_0x1882e5)[_0x069d('0x29')](function(_0x355e21){return _0x355e21;});}return null;};}function removeEntity(_0x1ea033,_0x229799){return function(_0x1cbb43){if(_0x1cbb43){return _0x1cbb43['destroy']()['then'](function(){var _0x38ee82=_0x1cbb43[_0x069d('0x2a')]({'plain':!![]});var _0x4498f7='Triggers';return db['UserProfileResource']['destroy']({'where':{'type':_0x4498f7,'resourceId':_0x38ee82['id']}})['then'](function(){return _0x1cbb43;});})[_0x069d('0x29')](function(){_0x1ea033[_0x069d('0x1e')](0xcc)[_0x069d('0x2b')]();});}};}function handleEntityNotFound(_0x2b7f14,_0x2fa414){return function(_0x5e7a8c){if(!_0x5e7a8c){_0x2b7f14[_0x069d('0x1d')](0x194);}return _0x5e7a8c;};}function handleError(_0x3ab681,_0x15a67e){_0x15a67e=_0x15a67e||0x1f4;return function(_0x39a8c2){logger[_0x069d('0x2c')](_0x39a8c2[_0x069d('0x2d')]);if(_0x39a8c2['name']){delete _0x39a8c2[_0x069d('0x2e')];}_0x3ab681[_0x069d('0x1e')](_0x15a67e)['send'](_0x39a8c2);};}exports[_0x069d('0x2f')]=function(_0x469830,_0xe42ea){var _0x3e6bf3={},_0x446f7a={},_0x207ec0={'count':0x0,'rows':[]};var _0x124893=_['map'](db['Trigger']['rawAttributes'],function(_0x2a78df){return{'name':_0x2a78df[_0x069d('0x30')],'type':_0x2a78df[_0x069d('0x31')][_0x069d('0x32')]};});_0x446f7a[_0x069d('0x33')]=_[_0x069d('0x34')](_0x124893,_0x069d('0x2e'));_0x446f7a[_0x069d('0x35')]=_[_0x069d('0x36')](_0x469830[_0x069d('0x35')]);_0x446f7a[_0x069d('0x37')]=_[_0x069d('0x38')](_0x446f7a[_0x069d('0x33')],_0x446f7a[_0x069d('0x35')]);_0x3e6bf3[_0x069d('0x39')]=_['intersection'](_0x446f7a['model'],qs['fields'](_0x469830[_0x069d('0x35')][_0x069d('0x3a')]));_0x3e6bf3[_0x069d('0x39')]=_0x3e6bf3[_0x069d('0x39')]['length']?_0x3e6bf3[_0x069d('0x39')]:_0x446f7a[_0x069d('0x33')];if(!_0x469830[_0x069d('0x35')]['hasOwnProperty']('nolimit')){_0x3e6bf3['limit']=qs['limit'](_0x469830[_0x069d('0x35')][_0x069d('0x22')]);_0x3e6bf3[_0x069d('0x20')]=qs[_0x069d('0x20')](_0x469830['query'][_0x069d('0x20')]);}_0x3e6bf3['order']=qs[_0x069d('0x3b')](_0x469830[_0x069d('0x35')][_0x069d('0x3b')]);_0x3e6bf3[_0x069d('0x3c')]=qs[_0x069d('0x37')](_[_0x069d('0x3d')](_0x469830[_0x069d('0x35')],_0x446f7a[_0x069d('0x37')]),_0x124893);if(_0x469830['query']['filter']){_0x3e6bf3[_0x069d('0x3c')]=_['merge'](_0x3e6bf3['where'],{'$or':_['map'](_0x124893,function(_0x57485b){if(_0x57485b[_0x069d('0x31')]!==_0x069d('0x3e')){var _0x2ce432={};_0x2ce432[_0x57485b['name']]={'$like':'%'+_0x469830[_0x069d('0x35')][_0x069d('0x3f')]+'%'};return _0x2ce432;}})});}_0x3e6bf3=_[_0x069d('0x40')]({},_0x3e6bf3,_0x469830[_0x069d('0x41')]);var _0x117412={'where':_0x3e6bf3[_0x069d('0x3c')]};return db[_0x069d('0x42')][_0x069d('0x23')](_0x117412)[_0x069d('0x29')](function(_0xbd1ac){_0x207ec0['count']=_0xbd1ac;if(_0x469830[_0x069d('0x35')]['includeAll']){_0x3e6bf3[_0x069d('0x43')]=[{'all':!![]}];}return db[_0x069d('0x42')][_0x069d('0x44')](_0x3e6bf3);})[_0x069d('0x29')](function(_0x5a88ae){_0x207ec0['rows']=_0x5a88ae;return _0x207ec0;})[_0x069d('0x29')](respondWithFilteredResult(_0xe42ea,_0x3e6bf3))[_0x069d('0x45')](handleError(_0xe42ea,null));};exports[_0x069d('0x46')]=function(_0x6269f6,_0x35fddd){var _0x395d3a={'raw':![],'where':{'id':_0x6269f6[_0x069d('0x47')]['id']}},_0x3c7eca={};_0x3c7eca['model']=_[_0x069d('0x36')](db[_0x069d('0x42')][_0x069d('0x48')]);_0x3c7eca['query']=_['keys'](_0x6269f6[_0x069d('0x35')]);_0x3c7eca[_0x069d('0x37')]=_[_0x069d('0x38')](_0x3c7eca[_0x069d('0x33')],_0x3c7eca[_0x069d('0x35')]);_0x395d3a[_0x069d('0x39')]=_[_0x069d('0x38')](_0x3c7eca['model'],qs['fields'](_0x6269f6[_0x069d('0x35')][_0x069d('0x3a')]));_0x395d3a['attributes']=_0x395d3a[_0x069d('0x39')][_0x069d('0x49')]?_0x395d3a['attributes']:_0x3c7eca[_0x069d('0x33')];if(_0x6269f6['query']['includeAll']){_0x395d3a[_0x069d('0x43')]=[{'all':!![]}];}_0x395d3a=_[_0x069d('0x40')]({},_0x395d3a,_0x6269f6[_0x069d('0x41')]);return db[_0x069d('0x42')]['find'](_0x395d3a)[_0x069d('0x29')](handleEntityNotFound(_0x35fddd,null))[_0x069d('0x29')](respondWithResult(_0x35fddd,null))[_0x069d('0x45')](handleError(_0x35fddd,null));};exports[_0x069d('0x4a')]=function(_0x34f2a6,_0x4fe2dd){return db['Trigger'][_0x069d('0x4a')](_0x34f2a6[_0x069d('0x4b')],{})[_0x069d('0x29')](function(_0xb0d594){var _0x1c0aca=_0x34f2a6['user'][_0x069d('0x2a')]({'plain':!![]});if(!_0x1c0aca)throw new Error(_0x069d('0x4c'));if(_0x1c0aca[_0x069d('0x4d')]===_0x069d('0x4e')){var _0x508356=_0xb0d594[_0x069d('0x2a')]({'plain':!![]});var _0x5b5577=_0x069d('0x4f');return db['UserProfileSection'][_0x069d('0x50')]({'where':{'name':_0x5b5577,'userProfileId':_0x1c0aca[_0x069d('0x51')]},'raw':!![]})[_0x069d('0x29')](function(_0x13e5da){if(_0x13e5da&&_0x13e5da['autoAssociation']===0x0){return db[_0x069d('0x52')][_0x069d('0x4a')]({'name':_0x508356['name'],'resourceId':_0x508356['id'],'type':_0x13e5da[_0x069d('0x2e')],'sectionId':_0x13e5da['id']},{})[_0x069d('0x29')](function(){return _0xb0d594;});}else{return _0xb0d594;}})['catch'](function(_0x172a86){logger[_0x069d('0x2c')](_0x069d('0x53'),_0x172a86);throw _0x172a86;});}return _0xb0d594;})[_0x069d('0x29')](respondWithResult(_0x4fe2dd,0xc9))[_0x069d('0x45')](handleError(_0x4fe2dd,null));};exports[_0x069d('0x28')]=function(_0x156319,_0xf91d0a){if(_0x156319[_0x069d('0x4b')]['id']){delete _0x156319[_0x069d('0x4b')]['id'];}return db[_0x069d('0x42')][_0x069d('0x50')]({'where':{'id':_0x156319['params']['id']}})[_0x069d('0x29')](handleEntityNotFound(_0xf91d0a,null))[_0x069d('0x29')](saveUpdates(_0x156319[_0x069d('0x4b')],null))[_0x069d('0x29')](respondWithResult(_0xf91d0a,null))['catch'](handleError(_0xf91d0a,null));};exports[_0x069d('0x54')]=function(_0x30b304,_0x529517){return db['Trigger'][_0x069d('0x50')]({'where':{'id':_0x30b304[_0x069d('0x47')]['id']}})[_0x069d('0x29')](handleEntityNotFound(_0x529517,null))[_0x069d('0x29')](removeEntity(_0x529517,null))[_0x069d('0x45')](handleError(_0x529517,null));};exports[_0x069d('0x55')]=function(_0x3e5799,_0x298920,_0x18bec9){if(_0x3e5799['body']['id']){delete _0x3e5799[_0x069d('0x4b')]['id'];}return db[_0x069d('0x42')][_0x069d('0x50')]({'where':{'id':_0x3e5799[_0x069d('0x47')]['id']}})[_0x069d('0x29')](handleEntityNotFound(_0x298920,null))['then'](function(_0x3a4687){if(_0x3a4687){_0x3e5799[_0x069d('0x4b')]['TriggerAllId']=_0x3a4687['id'];return db[_0x069d('0x56')]['create'](_0x3e5799['body']);}})[_0x069d('0x29')](respondWithResult(_0x298920,null))[_0x069d('0x45')](handleError(_0x298920,null));};exports[_0x069d('0x57')]=function(_0x518c7f,_0x2a771a,_0x540d95){if(_0x518c7f[_0x069d('0x4b')]['id']){delete _0x518c7f[_0x069d('0x4b')]['id'];}return db[_0x069d('0x42')]['find']({'where':{'id':_0x518c7f[_0x069d('0x47')]['id']}})[_0x069d('0x29')](handleEntityNotFound(_0x2a771a,null))[_0x069d('0x29')](function(_0x463785){if(_0x463785){_0x518c7f['body']['TriggerAnyId']=_0x463785['id'];return db[_0x069d('0x56')]['create'](_0x518c7f[_0x069d('0x4b')]);}})[_0x069d('0x29')](respondWithResult(_0x2a771a,null))['catch'](handleError(_0x2a771a,null));};exports[_0x069d('0x58')]=function(_0x20bb8f,_0xa4b4ea,_0x1557b5){var _0x26b748={};var _0x3488ce={};var _0x6740ca;var _0x140954;return db['Trigger']['findOne']({'where':{'id':_0x20bb8f['params']['id']}})[_0x069d('0x29')](handleEntityNotFound(_0xa4b4ea,null))[_0x069d('0x29')](function(_0x4447d2){if(_0x4447d2){_0x6740ca=_0x4447d2;_0x3488ce[_0x069d('0x33')]=_[_0x069d('0x36')](db[_0x069d('0x56')][_0x069d('0x48')]);_0x3488ce['query']=_[_0x069d('0x36')](_0x20bb8f[_0x069d('0x35')]);_0x3488ce[_0x069d('0x37')]=_['intersection'](_0x3488ce['model'],_0x3488ce[_0x069d('0x35')]);_0x26b748[_0x069d('0x39')]=_['intersection'](_0x3488ce[_0x069d('0x33')],qs['fields'](_0x20bb8f[_0x069d('0x35')][_0x069d('0x3a')]));_0x26b748[_0x069d('0x39')]=_0x26b748[_0x069d('0x39')]['length']?_0x26b748[_0x069d('0x39')]:_0x3488ce[_0x069d('0x33')];_0x26b748[_0x069d('0x59')]=qs[_0x069d('0x3b')](_0x20bb8f[_0x069d('0x35')][_0x069d('0x3b')]);_0x26b748[_0x069d('0x3c')]=qs[_0x069d('0x37')](_[_0x069d('0x3d')](_0x20bb8f['query'],_0x3488ce['filters']));if(_0x20bb8f[_0x069d('0x35')]['filter']){_0x26b748[_0x069d('0x3c')]=_[_0x069d('0x40')](_0x26b748[_0x069d('0x3c')],{'$or':_[_0x069d('0x34')](_0x26b748[_0x069d('0x39')],function(_0x15a674){var _0x231685={};_0x231685[_0x15a674]={'$like':'%'+_0x20bb8f['query']['filter']+'%'};return _0x231685;})});}_0x26b748=_[_0x069d('0x40')]({},_0x26b748,_0x20bb8f[_0x069d('0x41')]);return _0x6740ca[_0x069d('0x58')](_0x26b748);}})[_0x069d('0x29')](function(_0x498482){if(_0x498482){_0x140954=_0x498482['length'];if(!_0x20bb8f[_0x069d('0x35')][_0x069d('0x5a')](_0x069d('0x5b'))){_0x26b748['limit']=qs[_0x069d('0x22')](_0x20bb8f['query'][_0x069d('0x22')]);_0x26b748[_0x069d('0x20')]=qs[_0x069d('0x20')](_0x20bb8f[_0x069d('0x35')]['offset']);}return _0x6740ca[_0x069d('0x58')](_0x26b748);}})['then'](function(_0x22f960){if(_0x22f960){return _0x22f960?{'count':_0x140954,'rows':_0x22f960}:null;}})['then'](respondWithResult(_0xa4b4ea,null))[_0x069d('0x45')](handleError(_0xa4b4ea,null));};exports[_0x069d('0x5c')]=function(_0x55ab82,_0x1d4544,_0x4a02ec){var _0x3cca4a={};var _0x547d9a={};var _0x5dca4a;var _0x80ba7b;return db[_0x069d('0x42')]['findOne']({'where':{'id':_0x55ab82['params']['id']}})[_0x069d('0x29')](handleEntityNotFound(_0x1d4544,null))[_0x069d('0x29')](function(_0x2ead53){if(_0x2ead53){_0x5dca4a=_0x2ead53;_0x547d9a['model']=_['keys'](db['Condition'][_0x069d('0x48')]);_0x547d9a[_0x069d('0x35')]=_[_0x069d('0x36')](_0x55ab82[_0x069d('0x35')]);_0x547d9a[_0x069d('0x37')]=_[_0x069d('0x38')](_0x547d9a['model'],_0x547d9a[_0x069d('0x35')]);_0x3cca4a[_0x069d('0x39')]=_['intersection'](_0x547d9a[_0x069d('0x33')],qs['fields'](_0x55ab82[_0x069d('0x35')][_0x069d('0x3a')]));_0x3cca4a[_0x069d('0x39')]=_0x3cca4a[_0x069d('0x39')][_0x069d('0x49')]?_0x3cca4a[_0x069d('0x39')]:_0x547d9a['model'];_0x3cca4a[_0x069d('0x59')]=qs[_0x069d('0x3b')](_0x55ab82[_0x069d('0x35')][_0x069d('0x3b')]);_0x3cca4a[_0x069d('0x3c')]=qs[_0x069d('0x37')](_[_0x069d('0x3d')](_0x55ab82[_0x069d('0x35')],_0x547d9a['filters']));if(_0x55ab82[_0x069d('0x35')][_0x069d('0x3f')]){_0x3cca4a['where']=_[_0x069d('0x40')](_0x3cca4a[_0x069d('0x3c')],{'$or':_['map'](_0x3cca4a[_0x069d('0x39')],function(_0x3df2a6){var _0x177a20={};_0x177a20[_0x3df2a6]={'$like':'%'+_0x55ab82['query'][_0x069d('0x3f')]+'%'};return _0x177a20;})});}_0x3cca4a=_[_0x069d('0x40')]({},_0x3cca4a,_0x55ab82[_0x069d('0x41')]);return _0x5dca4a[_0x069d('0x5c')](_0x3cca4a);}})[_0x069d('0x29')](function(_0x34990a){if(_0x34990a){_0x80ba7b=_0x34990a[_0x069d('0x49')];if(!_0x55ab82[_0x069d('0x35')][_0x069d('0x5a')](_0x069d('0x5b'))){_0x3cca4a['limit']=qs['limit'](_0x55ab82[_0x069d('0x35')]['limit']);_0x3cca4a[_0x069d('0x20')]=qs[_0x069d('0x20')](_0x55ab82[_0x069d('0x35')][_0x069d('0x20')]);}return _0x5dca4a['getAnyConditions'](_0x3cca4a);}})[_0x069d('0x29')](function(_0x2af86d){if(_0x2af86d){return _0x2af86d?{'count':_0x80ba7b,'rows':_0x2af86d}:null;}})[_0x069d('0x29')](respondWithResult(_0x1d4544,null))['catch'](handleError(_0x1d4544,null));};exports['addAction']=function(_0x13140e,_0x1c488e,_0x400c53){if(_0x13140e[_0x069d('0x4b')]['id']){delete _0x13140e[_0x069d('0x4b')]['id'];}return db[_0x069d('0x42')]['find']({'where':{'id':_0x13140e[_0x069d('0x47')]['id']}})[_0x069d('0x29')](handleEntityNotFound(_0x1c488e,null))[_0x069d('0x29')](function(_0x2829b2){if(_0x2829b2){_0x13140e[_0x069d('0x4b')]['TriggerId']=_0x2829b2['id'];return db[_0x069d('0x5d')]['create'](_0x13140e['body']);}})[_0x069d('0x29')](respondWithResult(_0x1c488e,null))[_0x069d('0x45')](handleError(_0x1c488e,null));};exports['getActions']=function(_0x4ad90c,_0x428d58,_0x280eb4){var _0xcd6897={};var _0x56aa75={};var _0x1040cf;var _0x1e6eec;return db[_0x069d('0x42')]['findOne']({'where':{'id':_0x4ad90c[_0x069d('0x47')]['id']}})[_0x069d('0x29')](handleEntityNotFound(_0x428d58,null))['then'](function(_0x5d31cd){if(_0x5d31cd){_0x1040cf=_0x5d31cd;_0x56aa75[_0x069d('0x33')]=_['keys'](db[_0x069d('0x5d')][_0x069d('0x48')]);_0x56aa75[_0x069d('0x35')]=_[_0x069d('0x36')](_0x4ad90c['query']);_0x56aa75['filters']=_['intersection'](_0x56aa75[_0x069d('0x33')],_0x56aa75['query']);_0xcd6897['attributes']=_['intersection'](_0x56aa75['model'],qs['fields'](_0x4ad90c[_0x069d('0x35')][_0x069d('0x3a')]));_0xcd6897['attributes']=_0xcd6897[_0x069d('0x39')]['length']?_0xcd6897[_0x069d('0x39')]:_0x56aa75[_0x069d('0x33')];_0xcd6897[_0x069d('0x59')]=qs[_0x069d('0x3b')](_0x4ad90c[_0x069d('0x35')][_0x069d('0x3b')]);_0xcd6897[_0x069d('0x3c')]=qs[_0x069d('0x37')](_[_0x069d('0x3d')](_0x4ad90c[_0x069d('0x35')],_0x56aa75[_0x069d('0x37')]));if(_0x4ad90c[_0x069d('0x35')][_0x069d('0x3f')]){_0xcd6897[_0x069d('0x3c')]=_[_0x069d('0x40')](_0xcd6897[_0x069d('0x3c')],{'$or':_['map'](_0xcd6897['attributes'],function(_0x2fb8a2){var _0x1d7634={};_0x1d7634[_0x2fb8a2]={'$like':'%'+_0x4ad90c[_0x069d('0x35')][_0x069d('0x3f')]+'%'};return _0x1d7634;})});}_0xcd6897=_[_0x069d('0x40')]({},_0xcd6897,_0x4ad90c[_0x069d('0x41')]);return _0x1040cf[_0x069d('0x5e')](_0xcd6897);}})[_0x069d('0x29')](function(_0x2d2cb0){if(_0x2d2cb0){_0x1e6eec=_0x2d2cb0['length'];if(!_0x4ad90c[_0x069d('0x35')][_0x069d('0x5a')](_0x069d('0x5b'))){_0xcd6897['limit']=qs[_0x069d('0x22')](_0x4ad90c[_0x069d('0x35')]['limit']);_0xcd6897[_0x069d('0x20')]=qs['offset'](_0x4ad90c[_0x069d('0x35')][_0x069d('0x20')]);}return _0x1040cf['getActions'](_0xcd6897);}})['then'](function(_0x14136d){if(_0x14136d){return _0x14136d?{'count':_0x1e6eec,'rows':_0x14136d}:null;}})[_0x069d('0x29')](respondWithResult(_0x428d58,null))[_0x069d('0x45')](handleError(_0x428d58,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 2bb6425..7db3d03 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 _0xa25a=['rimraf','exports','define','Trigger','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x17ee35,_0x5f2792){var _0x334457=function(_0x2876bb){while(--_0x2876bb){_0x17ee35['push'](_0x17ee35['shift']());}};_0x334457(++_0x5f2792);}(_0xa25a,0x160));var _0xaa25=function(_0x25fe0b,_0x199b5a){_0x25fe0b=_0x25fe0b-0x0;var _0x1368bc=_0xa25a[_0x25fe0b];return _0x1368bc;};'use strict';var _=require(_0xaa25('0x0'));var util=require(_0xaa25('0x1'));var logger=require(_0xaa25('0x2'))(_0xaa25('0x3'));var moment=require(_0xaa25('0x4'));var BPromise=require(_0xaa25('0x5'));var rp=require(_0xaa25('0x6'));var fs=require('fs');var path=require(_0xaa25('0x7'));var rimraf=require(_0xaa25('0x8'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0xaa25('0x9')]=function(_0x866fa1,_0x51ce9a){return _0x866fa1[_0xaa25('0xa')](_0xaa25('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x616c=['moment','bluebird','request-promise','path','./trigger.attributes','exports','define','Trigger','util','../../config/logger'];(function(_0x299c2c,_0x1ad813){var _0x3b0c21=function(_0x2b8a69){while(--_0x2b8a69){_0x299c2c['push'](_0x299c2c['shift']());}};_0x3b0c21(++_0x1ad813);}(_0x616c,0x1b6));var _0xc616=function(_0x449964,_0x6b702c){_0x449964=_0x449964-0x0;var _0x397fed=_0x616c[_0x449964];return _0x397fed;};'use strict';var _=require('lodash');var util=require(_0xc616('0x0'));var logger=require(_0xc616('0x1'))('api');var moment=require(_0xc616('0x2'));var BPromise=require(_0xc616('0x3'));var rp=require(_0xc616('0x4'));var fs=require('fs');var path=require(_0xc616('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc616('0x6'));module[_0xc616('0x7')]=function(_0x1772f5,_0x15f809){return _0x1772f5[_0xc616('0x8')](_0xc616('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 eee997f..52351e6 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 _0x8fe0=['limit','include','map','model','attributes','find','raw','ShowTrigger','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','where'];(function(_0x4f996a,_0x5d07ae){var _0x9dd3fa=function(_0x596cb4){while(--_0x596cb4){_0x4f996a['push'](_0x4f996a['shift']());}};_0x9dd3fa(++_0x5d07ae);}(_0x8fe0,0xec));var _0x08fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fe0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x08fe('0x0'));var util=require('util');var moment=require(_0x08fe('0x1'));var BPromise=require(_0x08fe('0x2'));var rs=require(_0x08fe('0x3'));var fs=require('fs');var Redis=require(_0x08fe('0x4'));var db=require(_0x08fe('0x5'))['db'];var utils=require(_0x08fe('0x6'));var logger=require(_0x08fe('0x7'))(_0x08fe('0x8'));var config=require('../../config/environment');var jayson=require(_0x08fe('0x9'));var client=jayson[_0x08fe('0xa')][_0x08fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2928e5,_0xdab886,_0x1e442d){return new BPromise(function(_0x2ad20e,_0x18b2d3){return client[_0x08fe('0xc')](_0x2928e5,_0x1e442d)[_0x08fe('0xd')](function(_0x9555d7){logger[_0x08fe('0xe')](_0x08fe('0xf'),_0xdab886,_0x08fe('0x10'));logger[_0x08fe('0x11')](_0x08fe('0x12'),_0xdab886,_0x08fe('0x10'),JSON[_0x08fe('0x13')](_0x9555d7));if(_0x9555d7[_0x08fe('0x14')]){if(_0x9555d7[_0x08fe('0x14')][_0x08fe('0x15')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0xdab886,_0x9555d7['error'][_0x08fe('0x16')]);return _0x18b2d3(_0x9555d7[_0x08fe('0x14')][_0x08fe('0x16')]);}logger[_0x08fe('0x14')](_0x08fe('0xf'),_0xdab886,_0x9555d7['error'][_0x08fe('0x16')]);return _0x2ad20e(_0x9555d7[_0x08fe('0x14')][_0x08fe('0x16')]);}else{logger[_0x08fe('0xe')](_0x08fe('0xf'),_0xdab886,_0x08fe('0x10'));_0x2ad20e(_0x9555d7[_0x08fe('0x17')]['message']);}})[_0x08fe('0x18')](function(_0xaa9b13){logger[_0x08fe('0x14')](_0x08fe('0xf'),_0xdab886,_0xaa9b13);_0x18b2d3(_0xaa9b13);});});}exports[_0x08fe('0x19')]=function(_0x3ab316){var _0x3ad30f=this;return new Promise(function(_0x38cc3b,_0x41cf32){return db[_0x08fe('0x1a')][_0x08fe('0x1b')]({'raw':_0x3ab316[_0x08fe('0x1c')]?_0x3ab316[_0x08fe('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3ab316[_0x08fe('0x1c')]?_0x3ab316[_0x08fe('0x1c')][_0x08fe('0x1d')]||null:null,'attributes':_0x3ab316[_0x08fe('0x1c')]?_0x3ab316['options']['attributes']||null:null,'limit':_0x3ab316['options']?_0x3ab316[_0x08fe('0x1c')][_0x08fe('0x1e')]||null:null,'include':_0x3ab316[_0x08fe('0x1c')]?_0x3ab316['options'][_0x08fe('0x1f')]?_[_0x08fe('0x20')](_0x3ab316[_0x08fe('0x1c')]['include'],function(_0x421ae8){return{'model':db[_0x421ae8[_0x08fe('0x21')]],'as':_0x421ae8['as'],'attributes':_0x421ae8['attributes'],'include':_0x421ae8['include']?_['map'](_0x421ae8['include'],function(_0x79c708){return{'model':db[_0x79c708[_0x08fe('0x21')]],'as':_0x79c708['as'],'attributes':_0x79c708[_0x08fe('0x22')],'include':_0x79c708[_0x08fe('0x1f')]?_[_0x08fe('0x20')](_0x79c708['include'],function(_0x1f561c){return{'model':db[_0x1f561c[_0x08fe('0x21')]],'as':_0x1f561c['as'],'attributes':_0x1f561c[_0x08fe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x08fe('0xd')](function(_0x594f91){logger['info'](_0x08fe('0x19'),_0x3ab316);logger[_0x08fe('0x11')]('GetTrigger',_0x3ab316,JSON[_0x08fe('0x13')](_0x594f91));_0x38cc3b(_0x594f91);})['catch'](function(_0x1ae9df){logger[_0x08fe('0x14')](_0x08fe('0x19'),_0x1ae9df['message'],_0x3ab316);_0x41cf32(_0x3ad30f[_0x08fe('0x14')](0x1f4,_0x1ae9df[_0x08fe('0x16')]));});});};exports['ShowTrigger']=function(_0x24eae9){var _0x272ef0=this;return new Promise(function(_0x20feba,_0x2834e5){return db['Trigger'][_0x08fe('0x23')]({'raw':_0x24eae9['options']?_0x24eae9[_0x08fe('0x1c')][_0x08fe('0x24')]===undefined?!![]:![]:!![],'where':_0x24eae9['options']?_0x24eae9[_0x08fe('0x1c')][_0x08fe('0x1d')]||null:null,'attributes':_0x24eae9[_0x08fe('0x1c')]?_0x24eae9['options'][_0x08fe('0x22')]||null:null,'include':_0x24eae9[_0x08fe('0x1c')]?_0x24eae9[_0x08fe('0x1c')]['include']?_[_0x08fe('0x20')](_0x24eae9['options']['include'],function(_0x5b9574){return{'model':db[_0x5b9574[_0x08fe('0x21')]],'as':_0x5b9574['as'],'attributes':_0x5b9574['attributes'],'include':_0x5b9574[_0x08fe('0x1f')]?_[_0x08fe('0x20')](_0x5b9574['include'],function(_0x40315a){return{'model':db[_0x40315a[_0x08fe('0x21')]],'as':_0x40315a['as'],'attributes':_0x40315a['attributes'],'include':_0x40315a['include']?_[_0x08fe('0x20')](_0x40315a[_0x08fe('0x1f')],function(_0x149f26){return{'model':db[_0x149f26[_0x08fe('0x21')]],'as':_0x149f26['as'],'attributes':_0x149f26[_0x08fe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x08fe('0xd')](function(_0xc8f7d0){logger['info'](_0x08fe('0x25'),_0x24eae9);logger['debug']('ShowTrigger',_0x24eae9,JSON[_0x08fe('0x13')](_0xc8f7d0));_0x20feba(_0xc8f7d0);})['catch'](function(_0x30dcaa){logger[_0x08fe('0x14')]('ShowTrigger',_0x30dcaa['message'],_0x24eae9);_0x2834e5(_0x272ef0[_0x08fe('0x14')](0x1f4,_0x30dcaa[_0x08fe('0x16')]));});});}; \ No newline at end of file +var _0xf7bc=['code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','map','include','model','info','find','ShowTrigger','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0xf7bc,0x1e6));var _0xcf7b=function(_0x2e98c8,_0x5db434){_0x2e98c8=_0x2e98c8-0x0;var _0xd25076=_0xf7bc[_0x2e98c8];return _0xd25076;};'use strict';var _=require('lodash');var util=require(_0xcf7b('0x0'));var moment=require(_0xcf7b('0x1'));var BPromise=require(_0xcf7b('0x2'));var rs=require(_0xcf7b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf7b('0x4'))['db'];var utils=require(_0xcf7b('0x5'));var logger=require(_0xcf7b('0x6'))(_0xcf7b('0x7'));var config=require(_0xcf7b('0x8'));var jayson=require(_0xcf7b('0x9'));var client=jayson[_0xcf7b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd5d664,_0x214e77,_0x3d5e2e){return new BPromise(function(_0x3f79c4,_0x34815d){return client[_0xcf7b('0xb')](_0xd5d664,_0x3d5e2e)[_0xcf7b('0xc')](function(_0xf813ce){logger['info']('Trigger,\x20%s,\x20%s',_0x214e77,_0xcf7b('0xd'));logger[_0xcf7b('0xe')](_0xcf7b('0xf'),_0x214e77,_0xcf7b('0xd'),JSON[_0xcf7b('0x10')](_0xf813ce));if(_0xf813ce['error']){if(_0xf813ce[_0xcf7b('0x11')][_0xcf7b('0x12')]===0x1f4){logger['error'](_0xcf7b('0x13'),_0x214e77,_0xf813ce['error'][_0xcf7b('0x14')]);return _0x34815d(_0xf813ce[_0xcf7b('0x11')]['message']);}logger[_0xcf7b('0x11')](_0xcf7b('0x13'),_0x214e77,_0xf813ce[_0xcf7b('0x11')][_0xcf7b('0x14')]);return _0x3f79c4(_0xf813ce[_0xcf7b('0x11')]['message']);}else{logger['info'](_0xcf7b('0x13'),_0x214e77,_0xcf7b('0xd'));_0x3f79c4(_0xf813ce[_0xcf7b('0x15')]['message']);}})[_0xcf7b('0x16')](function(_0x210dfc){logger[_0xcf7b('0x11')](_0xcf7b('0x13'),_0x214e77,_0x210dfc);_0x34815d(_0x210dfc);});});}exports[_0xcf7b('0x17')]=function(_0x16f170){var _0x3c0b14=this;return new Promise(function(_0x44175c,_0x30bb86){return db[_0xcf7b('0x18')]['findAll']({'raw':_0x16f170[_0xcf7b('0x19')]?_0x16f170[_0xcf7b('0x19')][_0xcf7b('0x1a')]===undefined?!![]:![]:!![],'where':_0x16f170[_0xcf7b('0x19')]?_0x16f170['options'][_0xcf7b('0x1b')]||null:null,'attributes':_0x16f170[_0xcf7b('0x19')]?_0x16f170[_0xcf7b('0x19')][_0xcf7b('0x1c')]||null:null,'limit':_0x16f170['options']?_0x16f170[_0xcf7b('0x19')][_0xcf7b('0x1d')]||null:null,'include':_0x16f170[_0xcf7b('0x19')]?_0x16f170[_0xcf7b('0x19')]['include']?_[_0xcf7b('0x1e')](_0x16f170[_0xcf7b('0x19')][_0xcf7b('0x1f')],function(_0xf79250){return{'model':db[_0xf79250['model']],'as':_0xf79250['as'],'attributes':_0xf79250[_0xcf7b('0x1c')],'include':_0xf79250['include']?_[_0xcf7b('0x1e')](_0xf79250[_0xcf7b('0x1f')],function(_0x3c9d17){return{'model':db[_0x3c9d17[_0xcf7b('0x20')]],'as':_0x3c9d17['as'],'attributes':_0x3c9d17[_0xcf7b('0x1c')],'include':_0x3c9d17[_0xcf7b('0x1f')]?_['map'](_0x3c9d17['include'],function(_0x84efec){return{'model':db[_0x84efec['model']],'as':_0x84efec['as'],'attributes':_0x84efec[_0xcf7b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcf7b('0xc')](function(_0x1d8a1b){logger[_0xcf7b('0x21')](_0xcf7b('0x17'),_0x16f170);logger[_0xcf7b('0xe')]('GetTrigger',_0x16f170,JSON[_0xcf7b('0x10')](_0x1d8a1b));_0x44175c(_0x1d8a1b);})['catch'](function(_0x5aca56){logger[_0xcf7b('0x11')](_0xcf7b('0x17'),_0x5aca56[_0xcf7b('0x14')],_0x16f170);_0x30bb86(_0x3c0b14[_0xcf7b('0x11')](0x1f4,_0x5aca56[_0xcf7b('0x14')]));});});};exports['ShowTrigger']=function(_0x55e502){var _0x2cadd6=this;return new Promise(function(_0x2ce66d,_0x2a9602){return db[_0xcf7b('0x18')][_0xcf7b('0x22')]({'raw':_0x55e502['options']?_0x55e502[_0xcf7b('0x19')][_0xcf7b('0x1a')]===undefined?!![]:![]:!![],'where':_0x55e502['options']?_0x55e502[_0xcf7b('0x19')][_0xcf7b('0x1b')]||null:null,'attributes':_0x55e502[_0xcf7b('0x19')]?_0x55e502[_0xcf7b('0x19')][_0xcf7b('0x1c')]||null:null,'include':_0x55e502['options']?_0x55e502[_0xcf7b('0x19')][_0xcf7b('0x1f')]?_[_0xcf7b('0x1e')](_0x55e502[_0xcf7b('0x19')]['include'],function(_0xad0dad){return{'model':db[_0xad0dad[_0xcf7b('0x20')]],'as':_0xad0dad['as'],'attributes':_0xad0dad[_0xcf7b('0x1c')],'include':_0xad0dad['include']?_[_0xcf7b('0x1e')](_0xad0dad[_0xcf7b('0x1f')],function(_0x3543bc){return{'model':db[_0x3543bc[_0xcf7b('0x20')]],'as':_0x3543bc['as'],'attributes':_0x3543bc[_0xcf7b('0x1c')],'include':_0x3543bc[_0xcf7b('0x1f')]?_[_0xcf7b('0x1e')](_0x3543bc['include'],function(_0x3d9706){return{'model':db[_0x3d9706[_0xcf7b('0x20')]],'as':_0x3d9706['as'],'attributes':_0x3d9706[_0xcf7b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcf7b('0xc')](function(_0x56de12){logger[_0xcf7b('0x21')](_0xcf7b('0x23'),_0x55e502);logger[_0xcf7b('0xe')](_0xcf7b('0x23'),_0x55e502,JSON['stringify'](_0x56de12));_0x2ce66d(_0x56de12);})[_0xcf7b('0x16')](function(_0x1a3615){logger[_0xcf7b('0x11')](_0xcf7b('0x23'),_0x1a3615[_0xcf7b('0x14')],_0x55e502);_0x2a9602(_0x2cadd6[_0xcf7b('0x11')](0x1f4,_0x1a3615[_0xcf7b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index dcb3e06..90bf60d 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 _0x2c2e=['put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create'];(function(_0x285ca5,_0x1f3401){var _0x2113ee=function(_0x20f3b6){while(--_0x20f3b6){_0x285ca5['push'](_0x285ca5['shift']());}};_0x2113ee(++_0x1f3401);}(_0x2c2e,0xad));var _0xe2c2=function(_0x221f58,_0x5e2237){_0x221f58=_0x221f58-0x0;var _0x13d0d5=_0x2c2e[_0x221f58];return _0x13d0d5;};'use strict';var multer=require('multer');var util=require(_0xe2c2('0x0'));var path=require(_0xe2c2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe2c2('0x2')]();var fs_extra=require(_0xe2c2('0x3'));var auth=require(_0xe2c2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe2c2('0x5'));var controller=require(_0xe2c2('0x6'));router[_0xe2c2('0x7')]('/',auth[_0xe2c2('0x8')](),controller[_0xe2c2('0x9')]);router[_0xe2c2('0x7')](_0xe2c2('0xa'),auth[_0xe2c2('0x8')](),controller[_0xe2c2('0xb')]);router[_0xe2c2('0xc')](_0xe2c2('0xd'),auth[_0xe2c2('0x8')](),controller[_0xe2c2('0xe')]);router[_0xe2c2('0xc')]('/',auth['isAuthenticated'](),controller[_0xe2c2('0xf')]);router[_0xe2c2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe2c2('0x11')]);router[_0xe2c2('0x12')](_0xe2c2('0xa'),auth[_0xe2c2('0x8')](),controller[_0xe2c2('0x13')]);module[_0xe2c2('0x14')]=router; \ No newline at end of file +var _0xfcc3=['multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','clone','post','create','update','exports'];(function(_0x313e47,_0x4f5bb6){var _0x70d03a=function(_0x1c111e){while(--_0x1c111e){_0x313e47['push'](_0x313e47['shift']());}};_0x70d03a(++_0x4f5bb6);}(_0xfcc3,0x66));var _0x3fcc=function(_0x37728b,_0x389a17){_0x37728b=_0x37728b-0x0;var _0x5df72a=_0xfcc3[_0x37728b];return _0x5df72a;};'use strict';var multer=require(_0x3fcc('0x0'));var util=require(_0x3fcc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3fcc('0x2')]();var fs_extra=require(_0x3fcc('0x3'));var auth=require(_0x3fcc('0x4'));var interaction=require(_0x3fcc('0x5'));var config=require(_0x3fcc('0x6'));var controller=require(_0x3fcc('0x7'));router[_0x3fcc('0x8')]('/',auth[_0x3fcc('0x9')](),controller[_0x3fcc('0xa')]);router['get'](_0x3fcc('0xb'),auth[_0x3fcc('0x9')](),controller['show']);router['post']('/:id/clone',auth[_0x3fcc('0x9')](),controller[_0x3fcc('0xc')]);router[_0x3fcc('0xd')]('/',auth['isAuthenticated'](),controller[_0x3fcc('0xe')]);router['put'](_0x3fcc('0xb'),auth[_0x3fcc('0x9')](),controller[_0x3fcc('0xf')]);router['delete']('/:id',auth[_0x3fcc('0x9')](),controller['destroy']);module[_0x3fcc('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index e0b8812..18da7fc 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 _0x4bde=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue'];(function(_0x3e3221,_0x392851){var _0x190da4=function(_0x13d601){while(--_0x13d601){_0x3e3221['push'](_0x3e3221['shift']());}};_0x190da4(++_0x392851);}(_0x4bde,0x153));var _0xe4bd=function(_0x485f70,_0x3b56c6){_0x485f70=_0x485f70-0x0;var _0x5e04c2=_0x4bde[_0x485f70];return _0x5e04c2;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'name':{'type':Sequelize[_0xe4bd('0x2')],'allowNull':![],'unique':_0xe4bd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe4bd('0x4')]('friend',_0xe4bd('0x5'),_0xe4bd('0x6')),'allowNull':![],'defaultValue':_0xe4bd('0x7')},'context':{'type':Sequelize[_0xe4bd('0x2')],'allowNull':![],'defaultValue':_0xe4bd('0x8')},'callingpres':{'type':Sequelize[_0xe4bd('0x4')]('ALLOWED_NOT_SCREENED',_0xe4bd('0x9'),_0xe4bd('0xa'),_0xe4bd('0xb'),'PROHIB_NOT_SCREENED',_0xe4bd('0xc'),'PROHIB_FAILED_SCREEN',_0xe4bd('0xd'))},'deny':{'type':Sequelize[_0xe4bd('0x2')]},'permit':{'type':Sequelize[_0xe4bd('0x2')]},'secret':{'type':Sequelize[_0xe4bd('0x2')]},'md5secret':{'type':Sequelize[_0xe4bd('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x3a7e70){this[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x3a7e70?_0x3a7e70[_0xe4bd('0x10')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xe4bd('0x11')](_0xe4bd('0xf'))['split'](','):null;},'comment':_0xe4bd('0x12')},'dtmfmode':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x13'),_0xe4bd('0x14'),_0xe4bd('0x15'),_0xe4bd('0x16'),_0xe4bd('0x17')),'defaultValue':_0xe4bd('0x13')},'directmedia':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no',_0xe4bd('0x19'),_0xe4bd('0x1a'),_0xe4bd('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x3af8df){this['setDataValue'](_0xe4bd('0x1c'),_0x3af8df?_0x3af8df[_0xe4bd('0x10')](','):null);},'get':function(){return this[_0xe4bd('0x11')](_0xe4bd('0x1c'))?this[_0xe4bd('0x11')](_0xe4bd('0x1c'))[_0xe4bd('0x1d')](','):null;},'comment':_0xe4bd('0x1e')},'callgroup':{'type':Sequelize[_0xe4bd('0x2')]},'namedcallgroup':{'type':Sequelize[_0xe4bd('0x2')]},'pickupgroup':{'type':Sequelize[_0xe4bd('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xe4bd('0x2')]},'language':{'type':Sequelize[_0xe4bd('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe4bd('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xe4bd('0x2')],'defaultValue':_0xe4bd('0x1f')},'allow':{'type':Sequelize[_0xe4bd('0x2')],'allowNull':![],'defaultValue':_0xe4bd('0x20'),'set':function(_0x2ca146){this['setDataValue'](_0xe4bd('0x21'),_0x2ca146?_0x2ca146[_0xe4bd('0x10')](';'):_0xe4bd('0x20'));},'get':function(){return this[_0xe4bd('0x11')](_0xe4bd('0x21'))?this[_0xe4bd('0x11')](_0xe4bd('0x21'))[_0xe4bd('0x1d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe4bd('0x4')]('yes','no')},'insecure':{'type':Sequelize[_0xe4bd('0x2')],'defaultValue':_0xe4bd('0x22'),'set':function(_0x30c0b1){this[_0xe4bd('0xe')](_0xe4bd('0x23'),_0x30c0b1?_0x30c0b1[_0xe4bd('0x10')](','):null);},'get':function(){return this[_0xe4bd('0x11')]('insecure')?this[_0xe4bd('0x11')]('insecure')[_0xe4bd('0x1d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no',_0xe4bd('0x24'))},'promiscredir':{'type':Sequelize[_0xe4bd('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no')},'accountcode':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe4bd('0x2')],'defaultValue':_0xe4bd('0x26')},'amaflags':{'type':Sequelize[_0xe4bd('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no'),'defaultValue':_0xe4bd('0x18')},'busylevel':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xe4bd('0x2')]},'template':{'type':Sequelize[_0xe4bd('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no',_0xe4bd('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x28'),_0xe4bd('0x29'),_0xe4bd('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x2b'),_0xe4bd('0x2c')),'defaultValue':_0xe4bd('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xe4bd('0x2')]},'regexten':{'type':Sequelize[_0xe4bd('0x2')]},'fromdomain':{'type':Sequelize[_0xe4bd('0x2')]},'fromuser':{'type':Sequelize[_0xe4bd('0x2')]},'port':{'type':Sequelize[_0xe4bd('0x25')](0x5)},'qualify':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no'),'defaultValue':_0xe4bd('0x18')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xe4bd('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe4bd('0x2')]},'callbackextension':{'type':Sequelize[_0xe4bd('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xe4bd('0x2')]},'contactdeny':{'type':Sequelize[_0xe4bd('0x2')]},'contactacl':{'type':Sequelize[_0xe4bd('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xe4bd('0x2')]},'use_q850_reason':{'type':Sequelize[_0xe4bd('0x2')]},'maxforwards':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'encryption':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no')},'icesupport':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xe4bd('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xe4bd('0x4')]('yes','no',_0xe4bd('0x2d'),_0xe4bd('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xe4bd('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xe4bd('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xe4bd('0x2')]},'dtlscapath':{'type':Sequelize[_0xe4bd('0x2')]},'dtlssetup':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x2f'),'passive',_0xe4bd('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe4bd('0x2')]},'recordofffeature':{'type':Sequelize[_0xe4bd('0x2')]},'call_limit':{'type':Sequelize[_0xe4bd('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no')},'vmexten':{'type':Sequelize[_0xe4bd('0x2')]},'mohinterpret':{'type':Sequelize[_0xe4bd('0x2')]},'mohsuggest':{'type':Sequelize[_0xe4bd('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe4bd('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xe4bd('0x4')](_0xe4bd('0x18'),'no',_0xe4bd('0x19'),'update',_0xe4bd('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe4bd('0x2')]},'otherFields':{'type':Sequelize[_0xe4bd('0x2')]},'active':{'type':Sequelize[_0xe4bd('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x9e3e=['peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER','always','accept','uac','uas','pai','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user'];(function(_0x2c35ae,_0x391527){var _0x41987e=function(_0x5bd5ca){while(--_0x5bd5ca){_0x2c35ae['push'](_0x2c35ae['shift']());}};_0x41987e(++_0x391527);}(_0x9e3e,0x1c4));var _0xe9e3=function(_0x343168,_0x265708){_0x343168=_0x343168-0x0;var _0x34152e=_0x9e3e[_0x343168];return _0x34152e;};'use strict';var Sequelize=require(_0xe9e3('0x0'));module[_0xe9e3('0x1')]={'name':{'type':Sequelize[_0xe9e3('0x2')],'allowNull':![],'unique':_0xe9e3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x5'),_0xe9e3('0x6'),_0xe9e3('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xe9e3('0x2')],'allowNull':![],'defaultValue':_0xe9e3('0x8')},'callingpres':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x9'),_0xe9e3('0xa'),_0xe9e3('0xb'),_0xe9e3('0xc'),_0xe9e3('0xd'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xe9e3('0xe'))},'deny':{'type':Sequelize[_0xe9e3('0x2')]},'permit':{'type':Sequelize[_0xe9e3('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xe9e3('0x2')]},'remotesecret':{'type':Sequelize[_0xe9e3('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xe9e3('0xf'),'set':function(_0xb01229){this[_0xe9e3('0x10')](_0xe9e3('0x11'),_0xb01229?_0xb01229[_0xe9e3('0x12')](','):null);},'get':function(){return this[_0xe9e3('0x13')]('transport')?this[_0xe9e3('0x13')](_0xe9e3('0x11'))[_0xe9e3('0x14')](','):null;},'comment':_0xe9e3('0x15')},'dtmfmode':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x16'),_0xe9e3('0x17'),'shortinfo',_0xe9e3('0x18'),_0xe9e3('0x19')),'defaultValue':_0xe9e3('0x16')},'directmedia':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no',_0xe9e3('0x1b'),_0xe9e3('0x1c'),_0xe9e3('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xe9e3('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x55488d){this[_0xe9e3('0x10')](_0xe9e3('0x1e'),_0x55488d?_0x55488d[_0xe9e3('0x12')](','):null);},'get':function(){return this[_0xe9e3('0x13')](_0xe9e3('0x1e'))?this[_0xe9e3('0x13')](_0xe9e3('0x1e'))[_0xe9e3('0x14')](','):null;},'comment':_0xe9e3('0x1f')},'callgroup':{'type':Sequelize[_0xe9e3('0x2')]},'namedcallgroup':{'type':Sequelize[_0xe9e3('0x2')]},'pickupgroup':{'type':Sequelize[_0xe9e3('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xe9e3('0x2')]},'language':{'type':Sequelize[_0xe9e3('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xe9e3('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe9e3('0x20'),'set':function(_0x357c5e){this[_0xe9e3('0x10')](_0xe9e3('0x21'),_0x357c5e?_0x357c5e[_0xe9e3('0x12')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xe9e3('0x21'))?this['getDataValue'](_0xe9e3('0x21'))[_0xe9e3('0x14')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xe9e3('0x1a'),'no')},'insecure':{'type':Sequelize[_0xe9e3('0x2')],'defaultValue':_0xe9e3('0x22'),'set':function(_0x47c1b2){this[_0xe9e3('0x10')](_0xe9e3('0x23'),_0x47c1b2?_0x47c1b2[_0xe9e3('0x12')](','):null);},'get':function(){return this[_0xe9e3('0x13')](_0xe9e3('0x23'))?this[_0xe9e3('0x13')]('insecure')[_0xe9e3('0x14')](','):null;},'comment':_0xe9e3('0x24')},'trustrpid':{'type':Sequelize[_0xe9e3('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no','never')},'promiscredir':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xe9e3('0x25')},'amaflags':{'type':Sequelize[_0xe9e3('0x2')]},'callcounter':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no'),'defaultValue':_0xe9e3('0x1a')},'busylevel':{'type':Sequelize[_0xe9e3('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xe9e3('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xe9e3('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xe9e3('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no',_0xe9e3('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'mailbox':{'type':Sequelize[_0xe9e3('0x2')]},'session_timers':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x28'),'refuse','originate')},'session_expires':{'type':Sequelize[_0xe9e3('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xe9e3('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x29'),_0xe9e3('0x2a')),'defaultValue':_0xe9e3('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xe9e3('0x2')]},'regexten':{'type':Sequelize[_0xe9e3('0x2')]},'fromdomain':{'type':Sequelize[_0xe9e3('0x2')]},'fromuser':{'type':Sequelize[_0xe9e3('0x2')]},'port':{'type':Sequelize[_0xe9e3('0x26')](0x5)},'qualify':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no'),'defaultValue':_0xe9e3('0x1a')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xe9e3('0x2')]},'defaultuser':{'type':Sequelize[_0xe9e3('0x2')]},'rtptimeout':{'type':Sequelize[_0xe9e3('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe9e3('0x26')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xe9e3('0x1a'),'no',_0xe9e3('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe9e3('0x2')]},'callbackextension':{'type':Sequelize[_0xe9e3('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xe9e3('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xe9e3('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xe9e3('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xe9e3('0x2')]},'maxforwards':{'type':Sequelize[_0xe9e3('0x26')](0xb)},'encryption':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xe9e3('0x1a'),'no','fingerprint',_0xe9e3('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xe9e3('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xe9e3('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xe9e3('0x2')]},'dtlscipher':{'type':Sequelize[_0xe9e3('0x2')]},'dtlscafile':{'type':Sequelize[_0xe9e3('0x2')]},'dtlscapath':{'type':Sequelize[_0xe9e3('0x2')]},'dtlssetup':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x2d'),_0xe9e3('0x2e'),_0xe9e3('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe9e3('0x2')]},'usereqphone':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe9e3('0x2')]},'recordofffeature':{'type':Sequelize[_0xe9e3('0x2')]},'call_limit':{'type':Sequelize[_0xe9e3('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xe9e3('0x4')](_0xe9e3('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xe9e3('0x2')]},'mohinterpret':{'type':Sequelize[_0xe9e3('0x2')]},'mohsuggest':{'type':Sequelize[_0xe9e3('0x2')]},'parkinglot':{'type':Sequelize[_0xe9e3('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe9e3('0x2')],'defaultValue':_0xe9e3('0x30')},'canreinvite':{'type':Sequelize[_0xe9e3('0x4')]('yes','no','nonat',_0xe9e3('0x1c'),_0xe9e3('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xe9e3('0x2')]},'active':{'type':Sequelize[_0xe9e3('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe9e3('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index dd60464..3951f1d 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 _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0xa9d6ab,_0x522307){var _0x556205=function(_0x4e6a73){while(--_0x4e6a73){_0xa9d6ab['push'](_0xa9d6ab['shift']());}};_0x556205(++_0x522307);}(_0xe14d,0x1ee));var _0xde14=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xe14d[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x3cc4aa,_0x10565d){var _0x27b32d=function(_0x281b9e){while(--_0x281b9e){_0x3cc4aa['push'](_0x3cc4aa['shift']());}};_0x27b32d(++_0x10565d);}(_0x98a8,0x12c));var _0x898a=function(_0x359a85,_0x177652){_0x359a85=_0x359a85-0x0;var _0x3965d8=_0x98a8[_0x359a85];return _0x3965d8;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 87f9e7c..b13ad7a 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 _0x744b=['Trunk','lodash','util','../../config/logger','api','moment','path','rimraf','./trunk.attributes','exports','define'];(function(_0x5bebee,_0x3f73ae){var _0x304b5a=function(_0x7589c7){while(--_0x7589c7){_0x5bebee['push'](_0x5bebee['shift']());}};_0x304b5a(++_0x3f73ae);}(_0x744b,0x16c));var _0xb744=function(_0xf4f985,_0x21a7f4){_0xf4f985=_0xf4f985-0x0;var _0x56d65a=_0x744b[_0xf4f985];return _0x56d65a;};'use strict';var _=require(_0xb744('0x0'));var util=require(_0xb744('0x1'));var logger=require(_0xb744('0x2'))(_0xb744('0x3'));var moment=require(_0xb744('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb744('0x5'));var rimraf=require(_0xb744('0x6'));var config=require('../../config/environment');var attributes=require(_0xb744('0x7'));module[_0xb744('0x8')]=function(_0x2924b4,_0x1d03b5){return _0x2924b4[_0xb744('0x9')](_0xb744('0xa'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x239d=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','../../config/logger','moment','request-promise'];(function(_0x24f66d,_0x261e88){var _0x147cdb=function(_0x137ea5){while(--_0x137ea5){_0x24f66d['push'](_0x24f66d['shift']());}};_0x147cdb(++_0x261e88);}(_0x239d,0x16e));var _0xd239=function(_0x455440,_0x502034){_0x455440=_0x455440-0x0;var _0x159d24=_0x239d[_0x455440];return _0x159d24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd239('0x0'))('api');var moment=require(_0xd239('0x1'));var BPromise=require('bluebird');var rp=require(_0xd239('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd239('0x3'));var attributes=require(_0xd239('0x4'));module[_0xd239('0x5')]=function(_0x186097,_0x37090e){return _0x186097[_0xd239('0x6')](_0xd239('0x7'),attributes,{'tableName':_0xd239('0x8'),'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 cec8281..f1f409c 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 _0xc0bd=['Trunk','options','where','limit','map','model','attributes','include','stringify','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetTrunk'];(function(_0xb2717e,_0x5f3ba5){var _0xbe3f06=function(_0x1c84b1){while(--_0x1c84b1){_0xb2717e['push'](_0xb2717e['shift']());}};_0xbe3f06(++_0x5f3ba5);}(_0xc0bd,0x18c));var _0xdc0b=function(_0x1a04d2,_0x333082){_0x1a04d2=_0x1a04d2-0x0;var _0x434ec6=_0xc0bd[_0x1a04d2];return _0x434ec6;};'use strict';var _=require(_0xdc0b('0x0'));var util=require(_0xdc0b('0x1'));var moment=require(_0xdc0b('0x2'));var BPromise=require(_0xdc0b('0x3'));var rs=require(_0xdc0b('0x4'));var fs=require('fs');var Redis=require(_0xdc0b('0x5'));var db=require(_0xdc0b('0x6'))['db'];var utils=require(_0xdc0b('0x7'));var logger=require(_0xdc0b('0x8'))(_0xdc0b('0x9'));var config=require('../../config/environment');var jayson=require(_0xdc0b('0xa'));var client=jayson['client'][_0xdc0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cc61d,_0x13ff2f,_0x17ba91){return new BPromise(function(_0x1f23b5,_0x5015bc){return client[_0xdc0b('0xc')](_0x2cc61d,_0x17ba91)[_0xdc0b('0xd')](function(_0xf712a5){logger[_0xdc0b('0xe')](_0xdc0b('0xf'),_0x13ff2f,_0xdc0b('0x10'));logger[_0xdc0b('0x11')](_0xdc0b('0x12'),_0x13ff2f,_0xdc0b('0x10'),JSON['stringify'](_0xf712a5));if(_0xf712a5[_0xdc0b('0x13')]){if(_0xf712a5[_0xdc0b('0x13')]['code']===0x1f4){logger['error'](_0xdc0b('0xf'),_0x13ff2f,_0xf712a5[_0xdc0b('0x13')][_0xdc0b('0x14')]);return _0x5015bc(_0xf712a5['error'][_0xdc0b('0x14')]);}logger[_0xdc0b('0x13')](_0xdc0b('0xf'),_0x13ff2f,_0xf712a5[_0xdc0b('0x13')][_0xdc0b('0x14')]);return _0x1f23b5(_0xf712a5['error'][_0xdc0b('0x14')]);}else{logger[_0xdc0b('0xe')](_0xdc0b('0xf'),_0x13ff2f,_0xdc0b('0x10'));_0x1f23b5(_0xf712a5[_0xdc0b('0x15')]['message']);}})[_0xdc0b('0x16')](function(_0x1a8799){logger[_0xdc0b('0x13')](_0xdc0b('0xf'),_0x13ff2f,_0x1a8799);_0x5015bc(_0x1a8799);});});}exports[_0xdc0b('0x17')]=function(_0x462930){var _0x1696b1=this;return new Promise(function(_0x3fce5d,_0x1eedf9){return db[_0xdc0b('0x18')]['findAll']({'raw':_0x462930[_0xdc0b('0x19')]?_0x462930[_0xdc0b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x462930[_0xdc0b('0x19')]?_0x462930[_0xdc0b('0x19')][_0xdc0b('0x1a')]||null:null,'attributes':_0x462930[_0xdc0b('0x19')]?_0x462930[_0xdc0b('0x19')]['attributes']||null:null,'limit':_0x462930[_0xdc0b('0x19')]?_0x462930[_0xdc0b('0x19')][_0xdc0b('0x1b')]||null:null,'include':_0x462930[_0xdc0b('0x19')]?_0x462930[_0xdc0b('0x19')]['include']?_[_0xdc0b('0x1c')](_0x462930[_0xdc0b('0x19')]['include'],function(_0x42861c){return{'model':db[_0x42861c[_0xdc0b('0x1d')]],'as':_0x42861c['as'],'attributes':_0x42861c[_0xdc0b('0x1e')],'include':_0x42861c['include']?_['map'](_0x42861c[_0xdc0b('0x1f')],function(_0x2385ee){return{'model':db[_0x2385ee[_0xdc0b('0x1d')]],'as':_0x2385ee['as'],'attributes':_0x2385ee['attributes'],'include':_0x2385ee[_0xdc0b('0x1f')]?_['map'](_0x2385ee[_0xdc0b('0x1f')],function(_0x53fb5c){return{'model':db[_0x53fb5c[_0xdc0b('0x1d')]],'as':_0x53fb5c['as'],'attributes':_0x53fb5c[_0xdc0b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdc0b('0xd')](function(_0x12a9ab){logger[_0xdc0b('0xe')](_0xdc0b('0x17'),_0x462930);logger[_0xdc0b('0x11')](_0xdc0b('0x17'),_0x462930,JSON[_0xdc0b('0x20')](_0x12a9ab));_0x3fce5d(_0x12a9ab);})[_0xdc0b('0x16')](function(_0x516b6a){logger[_0xdc0b('0x13')](_0xdc0b('0x17'),_0x516b6a[_0xdc0b('0x14')],_0x462930);_0x1eedf9(_0x1696b1[_0xdc0b('0x13')](0x1f4,_0x516b6a[_0xdc0b('0x14')]));});});};exports[_0xdc0b('0x21')]=function(_0x20ef3e){var _0x12e14c=this;return new Promise(function(_0x15613e,_0x22e97b){return db[_0xdc0b('0x18')][_0xdc0b('0x22')]({'raw':_0x20ef3e[_0xdc0b('0x19')]?_0x20ef3e[_0xdc0b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x20ef3e[_0xdc0b('0x19')]?_0x20ef3e[_0xdc0b('0x19')]['where']||null:null,'attributes':_0x20ef3e[_0xdc0b('0x19')]?_0x20ef3e[_0xdc0b('0x19')]['attributes']||null:null,'include':_0x20ef3e[_0xdc0b('0x19')]?_0x20ef3e[_0xdc0b('0x19')][_0xdc0b('0x1f')]?_[_0xdc0b('0x1c')](_0x20ef3e[_0xdc0b('0x19')][_0xdc0b('0x1f')],function(_0x48c47c){return{'model':db[_0x48c47c[_0xdc0b('0x1d')]],'as':_0x48c47c['as'],'attributes':_0x48c47c[_0xdc0b('0x1e')],'include':_0x48c47c[_0xdc0b('0x1f')]?_[_0xdc0b('0x1c')](_0x48c47c[_0xdc0b('0x1f')],function(_0x101488){return{'model':db[_0x101488['model']],'as':_0x101488['as'],'attributes':_0x101488[_0xdc0b('0x1e')],'include':_0x101488[_0xdc0b('0x1f')]?_[_0xdc0b('0x1c')](_0x101488['include'],function(_0x21d80d){return{'model':db[_0x21d80d['model']],'as':_0x21d80d['as'],'attributes':_0x21d80d[_0xdc0b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cacd5){logger['info'](_0xdc0b('0x21'),_0x20ef3e);logger[_0xdc0b('0x11')]('ShowTrunk',_0x20ef3e,JSON[_0xdc0b('0x20')](_0x5cacd5));_0x15613e(_0x5cacd5);})[_0xdc0b('0x16')](function(_0x3bf244){logger[_0xdc0b('0x13')](_0xdc0b('0x21'),_0x3bf244[_0xdc0b('0x14')],_0x20ef3e);_0x22e97b(_0x12e14c[_0xdc0b('0x13')](0x1f4,_0x3bf244['message']));});});}; \ No newline at end of file +var _0x65e4=['Trunk','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrunk','findAll','options','raw','attributes','include','model','map','debug','stringify','catch','ShowTrunk'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x65e4,0x1cb));var _0x465e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x65e4[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x465e('0x0'));var util=require(_0x465e('0x1'));var moment=require(_0x465e('0x2'));var BPromise=require('bluebird');var rs=require(_0x465e('0x3'));var fs=require('fs');var Redis=require(_0x465e('0x4'));var db=require(_0x465e('0x5'))['db'];var utils=require(_0x465e('0x6'));var logger=require(_0x465e('0x7'))(_0x465e('0x8'));var config=require(_0x465e('0x9'));var jayson=require(_0x465e('0xa'));var client=jayson[_0x465e('0xb')][_0x465e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1726e5,_0x15cc77,_0x2db463){return new BPromise(function(_0x54b83f,_0x38b90a){return client[_0x465e('0xd')](_0x1726e5,_0x2db463)[_0x465e('0xe')](function(_0xcd16cf){logger[_0x465e('0xf')](_0x465e('0x10'),_0x15cc77,_0x465e('0x11'));logger['debug'](_0x465e('0x12'),_0x15cc77,_0x465e('0x11'),JSON['stringify'](_0xcd16cf));if(_0xcd16cf[_0x465e('0x13')]){if(_0xcd16cf[_0x465e('0x13')][_0x465e('0x14')]===0x1f4){logger[_0x465e('0x13')](_0x465e('0x10'),_0x15cc77,_0xcd16cf[_0x465e('0x13')][_0x465e('0x15')]);return _0x38b90a(_0xcd16cf[_0x465e('0x13')]['message']);}logger[_0x465e('0x13')](_0x465e('0x10'),_0x15cc77,_0xcd16cf[_0x465e('0x13')][_0x465e('0x15')]);return _0x54b83f(_0xcd16cf[_0x465e('0x13')][_0x465e('0x15')]);}else{logger[_0x465e('0xf')](_0x465e('0x10'),_0x15cc77,_0x465e('0x11'));_0x54b83f(_0xcd16cf[_0x465e('0x16')][_0x465e('0x15')]);}})['catch'](function(_0x1db2c3){logger[_0x465e('0x13')](_0x465e('0x10'),_0x15cc77,_0x1db2c3);_0x38b90a(_0x1db2c3);});});}exports[_0x465e('0x17')]=function(_0x532e56){var _0x28d171=this;return new Promise(function(_0x4582e8,_0x2dd2a8){return db['Trunk'][_0x465e('0x18')]({'raw':_0x532e56['options']?_0x532e56[_0x465e('0x19')][_0x465e('0x1a')]===undefined?!![]:![]:!![],'where':_0x532e56[_0x465e('0x19')]?_0x532e56[_0x465e('0x19')]['where']||null:null,'attributes':_0x532e56[_0x465e('0x19')]?_0x532e56[_0x465e('0x19')][_0x465e('0x1b')]||null:null,'limit':_0x532e56[_0x465e('0x19')]?_0x532e56[_0x465e('0x19')]['limit']||null:null,'include':_0x532e56[_0x465e('0x19')]?_0x532e56[_0x465e('0x19')][_0x465e('0x1c')]?_['map'](_0x532e56[_0x465e('0x19')][_0x465e('0x1c')],function(_0x174a6a){return{'model':db[_0x174a6a[_0x465e('0x1d')]],'as':_0x174a6a['as'],'attributes':_0x174a6a[_0x465e('0x1b')],'include':_0x174a6a[_0x465e('0x1c')]?_['map'](_0x174a6a[_0x465e('0x1c')],function(_0x2a8003){return{'model':db[_0x2a8003['model']],'as':_0x2a8003['as'],'attributes':_0x2a8003[_0x465e('0x1b')],'include':_0x2a8003['include']?_[_0x465e('0x1e')](_0x2a8003[_0x465e('0x1c')],function(_0x1927d0){return{'model':db[_0x1927d0['model']],'as':_0x1927d0['as'],'attributes':_0x1927d0[_0x465e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x465e('0xe')](function(_0x119285){logger[_0x465e('0xf')](_0x465e('0x17'),_0x532e56);logger[_0x465e('0x1f')](_0x465e('0x17'),_0x532e56,JSON[_0x465e('0x20')](_0x119285));_0x4582e8(_0x119285);})[_0x465e('0x21')](function(_0x16c0ee){logger['error'](_0x465e('0x17'),_0x16c0ee[_0x465e('0x15')],_0x532e56);_0x2dd2a8(_0x28d171[_0x465e('0x13')](0x1f4,_0x16c0ee[_0x465e('0x15')]));});});};exports[_0x465e('0x22')]=function(_0x54b979){var _0x2d6b3d=this;return new Promise(function(_0x2c9719,_0x31932f){return db[_0x465e('0x23')][_0x465e('0x24')]({'raw':_0x54b979[_0x465e('0x19')]?_0x54b979['options']['raw']===undefined?!![]:![]:!![],'where':_0x54b979[_0x465e('0x19')]?_0x54b979['options'][_0x465e('0x25')]||null:null,'attributes':_0x54b979['options']?_0x54b979[_0x465e('0x19')][_0x465e('0x1b')]||null:null,'include':_0x54b979[_0x465e('0x19')]?_0x54b979[_0x465e('0x19')]['include']?_[_0x465e('0x1e')](_0x54b979[_0x465e('0x19')][_0x465e('0x1c')],function(_0x3d8696){return{'model':db[_0x3d8696[_0x465e('0x1d')]],'as':_0x3d8696['as'],'attributes':_0x3d8696[_0x465e('0x1b')],'include':_0x3d8696[_0x465e('0x1c')]?_['map'](_0x3d8696[_0x465e('0x1c')],function(_0x3e8e93){return{'model':db[_0x3e8e93[_0x465e('0x1d')]],'as':_0x3e8e93['as'],'attributes':_0x3e8e93[_0x465e('0x1b')],'include':_0x3e8e93[_0x465e('0x1c')]?_[_0x465e('0x1e')](_0x3e8e93[_0x465e('0x1c')],function(_0x301cad){return{'model':db[_0x301cad[_0x465e('0x1d')]],'as':_0x301cad['as'],'attributes':_0x301cad[_0x465e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x465e('0xe')](function(_0x2edbdc){logger[_0x465e('0xf')]('ShowTrunk',_0x54b979);logger[_0x465e('0x1f')]('ShowTrunk',_0x54b979,JSON['stringify'](_0x2edbdc));_0x2c9719(_0x2edbdc);})[_0x465e('0x21')](function(_0x59dd4f){logger['error'](_0x465e('0x22'),_0x59dd4f[_0x465e('0x15')],_0x54b979);_0x31932f(_0x2d6b3d[_0x465e('0x13')](0x1f4,_0x59dd4f[_0x465e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index da2eb13..46d2e83 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 _0x278e=['isAuthenticated','update','exports','express','Router','./user-setting.controller','/:id'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x278e,0x1ae));var _0xe278=function(_0x346f68,_0xb45d9d){_0x346f68=_0x346f68-0x0;var _0x2d1803=_0x278e[_0x346f68];return _0x2d1803;};'use strict';var express=require(_0xe278('0x0'));var router=express[_0xe278('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xe278('0x2'));router['put'](_0xe278('0x3'),auth[_0xe278('0x4')](),controller[_0xe278('0x5')]);module[_0xe278('0x6')]=router; \ No newline at end of file +var _0x74b1=['put','/:id','isAuthenticated','update','exports','express','Router','./user-setting.controller'];(function(_0x519ab1,_0x7862af){var _0x371dae=function(_0x363148){while(--_0x363148){_0x519ab1['push'](_0x519ab1['shift']());}};_0x371dae(++_0x7862af);}(_0x74b1,0x1dd));var _0x174b=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0x74b1[_0x146837];return _0x3d7e60;};'use strict';var express=require(_0x174b('0x0'));var router=express[_0x174b('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x174b('0x2'));router[_0x174b('0x3')](_0x174b('0x4'),auth[_0x174b('0x5')](),controller[_0x174b('0x6')]);module[_0x174b('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index b4e4aa6..f81932e 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 _0x7b21=['DATE','INTEGER','error','warning','ENUM','TEXT'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0x7b21,0xda));var _0x17b2=function(_0xb3ccad,_0x41f121){_0xb3ccad=_0xb3ccad-0x0;var _0x5bcba9=_0x7b21[_0xb3ccad];return _0x5bcba9;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x17b2('0x0'),_0x17b2('0x1'),'info','debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x17b2('0x2')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x17b2('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x17b2('0x3')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x17b2('0x4')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x17b2('0x5')],'unique':'UserId'}}; \ No newline at end of file +var _0x9799=['exports','ENUM','error','BOOLEAN','TEXT','DATE','INTEGER','UserId','warning','debug'];(function(_0x329dd0,_0x47e04f){var _0x4f5b90=function(_0x7d2728){while(--_0x7d2728){_0x329dd0['push'](_0x329dd0['shift']());}};_0x4f5b90(++_0x47e04f);}(_0x9799,0x148));var _0x9979=function(_0x222c3a,_0x4e3add){_0x222c3a=_0x222c3a-0x0;var _0x421f2e=_0x9799[_0x222c3a];return _0x421f2e;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error',_0x9979('0x0'),'info',_0x9979('0x1')];module[_0x9979('0x2')]={'clientSideLoggingLevel':{'type':Sequelize[_0x9979('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x9979('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x9979('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x9979('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x9979('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x9979('0x8')],'unique':_0x9979('0x9')}}; \ 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 5d4faeb..e421b6d 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 _0xb38e=['ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','defaults','redis','localhost','status','json','update','then','sendStatus','stack','name','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','lodash'];(function(_0x51f7f0,_0x241265){var _0x7e82a5=function(_0x379e8a){while(--_0x379e8a){_0x51f7f0['push'](_0x51f7f0['shift']());}};_0x7e82a5(++_0x241265);}(_0xb38e,0xa7));var _0xeb38=function(_0x3a3e2a,_0x427f7f){_0x3a3e2a=_0x3a3e2a-0x0;var _0x254588=_0xb38e[_0x3a3e2a];return _0x254588;};'use strict';var _=require(_0xeb38('0x0'));var Redis=require(_0xeb38('0x1'));var logger=require(_0xeb38('0x2'))(_0xeb38('0x3'));var config=require(_0xeb38('0x4'));var db=require(_0xeb38('0x5'))['db'];var socket=require(_0xeb38('0x6'))(new Redis(config['redis']));require(_0xeb38('0x7'))[_0xeb38('0x8')](socket);config['redis']=_[_0xeb38('0x9')](config[_0xeb38('0xa')],{'host':_0xeb38('0xb'),'port':0x18eb});function respondWithResult(_0x31db8c,_0x4cfa4d){_0x4cfa4d=_0x4cfa4d||0xc8;return function(_0x3003aa){if(_0x3003aa){return _0x31db8c[_0xeb38('0xc')](_0x4cfa4d)[_0xeb38('0xd')](_0x3003aa);}};}function saveUpdates(_0x35dec7){return function(_0x4c3a7d){if(_0x4c3a7d){return _0x4c3a7d[_0xeb38('0xe')](_0x35dec7)[_0xeb38('0xf')](function(_0x8a6144){return _0x8a6144;});}return null;};}function handleEntityNotFound(_0xa54e19){return function(_0xfbd120){if(!_0xfbd120){_0xa54e19[_0xeb38('0x10')](0x194);}return _0xfbd120;};}function handleError(_0x16edc9,_0x5838cd){_0x5838cd=_0x5838cd||0x1f4;return function(_0x170e47){logger['error'](_0x170e47[_0xeb38('0x11')]);if(_0x170e47[_0xeb38('0x12')]){delete _0x170e47['name'];}_0x16edc9[_0xeb38('0xc')](_0x5838cd)[_0xeb38('0x13')](_0x170e47);};}exports[_0xeb38('0xe')]=function(_0x398ca9,_0x6bc43d){if(_0x398ca9[_0xeb38('0x14')]['role']!==_0xeb38('0x15'))throw new Error(_0xeb38('0x16'));if(isNaN(Number(_0x398ca9[_0xeb38('0x17')]['id'])))throw new Error(_0xeb38('0x18'));return db[_0xeb38('0x19')][_0xeb38('0x1a')]({'where':{'id':_0x398ca9[_0xeb38('0x17')]['id']}})['then'](handleEntityNotFound(_0x6bc43d,null))[_0xeb38('0xf')](saveUpdates(_0x398ca9[_0xeb38('0x1b')],null))[_0xeb38('0xf')](respondWithResult(_0x6bc43d,null))['catch'](handleError(_0x6bc43d,null));}; \ No newline at end of file +var _0x48ea=['error','stack','name','send','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','body','catch','lodash','../../config/logger','api','../../config/environment','redis','register','defaults','localhost','status','json','update','then'];(function(_0x22dd93,_0x324026){var _0x31ffd3=function(_0xf98e2f){while(--_0xf98e2f){_0x22dd93['push'](_0x22dd93['shift']());}};_0x31ffd3(++_0x324026);}(_0x48ea,0x9c));var _0xa48e=function(_0x151721,_0x5e1f7b){_0x151721=_0x151721-0x0;var _0x483b84=_0x48ea[_0x151721];return _0x483b84;};'use strict';var _=require(_0xa48e('0x0'));var Redis=require('ioredis');var logger=require(_0xa48e('0x1'))(_0xa48e('0x2'));var config=require(_0xa48e('0x3'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xa48e('0x4')]));require('./user-setting.socket')[_0xa48e('0x5')](socket);config[_0xa48e('0x4')]=_[_0xa48e('0x6')](config[_0xa48e('0x4')],{'host':_0xa48e('0x7'),'port':0x18eb});function respondWithResult(_0x405033,_0x5213e5){_0x5213e5=_0x5213e5||0xc8;return function(_0x143004){if(_0x143004){return _0x405033[_0xa48e('0x8')](_0x5213e5)[_0xa48e('0x9')](_0x143004);}};}function saveUpdates(_0x3585a6){return function(_0x3e6305){if(_0x3e6305){return _0x3e6305[_0xa48e('0xa')](_0x3585a6)[_0xa48e('0xb')](function(_0xf9436a){return _0xf9436a;});}return null;};}function handleEntityNotFound(_0x4daad7){return function(_0x2d19a5){if(!_0x2d19a5){_0x4daad7['sendStatus'](0x194);}return _0x2d19a5;};}function handleError(_0x54c516,_0x5bb5c0){_0x5bb5c0=_0x5bb5c0||0x1f4;return function(_0x284f29){logger[_0xa48e('0xc')](_0x284f29[_0xa48e('0xd')]);if(_0x284f29[_0xa48e('0xe')]){delete _0x284f29['name'];}_0x54c516[_0xa48e('0x8')](_0x5bb5c0)[_0xa48e('0xf')](_0x284f29);};}exports[_0xa48e('0xa')]=function(_0x29b285,_0x2eeef3){if(_0x29b285[_0xa48e('0x10')][_0xa48e('0x11')]!=='admin')throw new Error(_0xa48e('0x12'));if(isNaN(Number(_0x29b285[_0xa48e('0x13')]['id'])))throw new Error(_0xa48e('0x14'));return db[_0xa48e('0x15')]['find']({'where':{'id':_0x29b285[_0xa48e('0x13')]['id']}})[_0xa48e('0xb')](handleEntityNotFound(_0x2eeef3,null))[_0xa48e('0xb')](saveUpdates(_0x29b285[_0xa48e('0x16')],null))[_0xa48e('0xb')](respondWithResult(_0x2eeef3,null))[_0xa48e('0x17')](handleError(_0x2eeef3,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 17be8c2..6452cc3 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 _0x5f6f=['events','UserSetting','remove','hasOwnProperty','hook','exports'];(function(_0xea3b5a,_0x16998f){var _0x257186=function(_0x19063){while(--_0x19063){_0xea3b5a['push'](_0xea3b5a['shift']());}};_0x257186(++_0x16998f);}(_0x5f6f,0xf0));var _0xf5f6=function(_0x50d6d6,_0x189c68){_0x50d6d6=_0x50d6d6-0x0;var _0x5d9bb4=_0x5f6f[_0x50d6d6];return _0x5d9bb4;};'use strict';var EventEmitter=require(_0xf5f6('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xf5f6('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf5f6('0x2')};function emitEvent(_0x2f665a){return function(_0x3571a7,_0x1ad4ca,_0x5c7043){UserSettingEvents['emit'](_0x2f665a+':'+_0x3571a7['id'],_0x3571a7);UserSettingEvents['emit'](_0x2f665a,_0x3571a7);_0x5c7043(null);};}for(var e in events){if(events[_0xf5f6('0x3')](e)){var event=events[e];UserSetting[_0xf5f6('0x4')](e,emitEvent(event));}}module[_0xf5f6('0x5')]=UserSettingEvents; \ No newline at end of file +var _0xa7f4=['update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1e422b,_0x2a7b35){var _0x5a38c9=function(_0x5838c4){while(--_0x5838c4){_0x1e422b['push'](_0x1e422b['shift']());}};_0x5a38c9(++_0x2a7b35);}(_0xa7f4,0xca));var _0x4a7f=function(_0x24e6d1,_0x2c6c43){_0x24e6d1=_0x24e6d1-0x0;var _0x1c0ff3=_0xa7f4[_0x24e6d1];return _0x1c0ff3;};'use strict';var EventEmitter=require(_0x4a7f('0x0'));var UserSetting=require(_0x4a7f('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a7f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x17305a){return function(_0x298de0,_0x59f085,_0x151fc7){UserSettingEvents[_0x4a7f('0x3')](_0x17305a+':'+_0x298de0['id'],_0x298de0);UserSettingEvents[_0x4a7f('0x3')](_0x17305a,_0x298de0);_0x151fc7(null);};}for(var e in events){if(events[_0x4a7f('0x4')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x4a7f('0x5')]=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 979bc26..ee7b414 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 _0x55f1=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x318e0f,_0x3e953b){var _0x259c69=function(_0x2350de){while(--_0x2350de){_0x318e0f['push'](_0x318e0f['shift']());}};_0x259c69(++_0x3e953b);}(_0x55f1,0x9b));var _0x155f=function(_0xefe535,_0x39551a){_0xefe535=_0xefe535-0x0;var _0x54c45a=_0x55f1[_0xefe535];return _0x54c45a;};'use strict';var attributes=require(_0x155f('0x0'));module['exports']=function(_0x9fa58a){return _0x9fa58a[_0x155f('0x1')](_0x155f('0x2'),attributes,{'tableName':_0x155f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53478b){if(!_0x53478b[_0x155f('0x4')])_0x53478b[_0x155f('0x5')]=null;else if(_0x53478b['clientSideLoggingEnabledSince']===null)_0x53478b['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x6146=['./user-setting.attributes','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x6146,0xba));var _0x6614=function(_0x23b817,_0x5768d3){_0x23b817=_0x23b817-0x0;var _0xdabf81=_0x6146[_0x23b817];return _0xdabf81;};'use strict';var attributes=require(_0x6614('0x0'));module['exports']=function(_0x31b3b4){return _0x31b3b4[_0x6614('0x1')](_0x6614('0x2'),attributes,{'tableName':_0x6614('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x296d09){if(!_0x296d09[_0x6614('0x4')])_0x296d09[_0x6614('0x5')]=null;else if(_0x296d09['clientSideLoggingEnabledSince']===null)_0x296d09[_0x6614('0x5')]=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 6e460f6..42df9a3 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 _0x63ad=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update'];(function(_0x1611b8,_0x52e90e){var _0x5e72a0=function(_0x44b86d){while(--_0x44b86d){_0x1611b8['push'](_0x1611b8['shift']());}};_0x5e72a0(++_0x52e90e);}(_0x63ad,0x102));var _0xd63a=function(_0x5227c6,_0x52a88a){_0x5227c6=_0x5227c6-0x0;var _0x5f1242=_0x63ad[_0x5227c6];return _0x5f1242;};'use strict';var UserSettingEvents=require(_0xd63a('0x0'));var events=[_0xd63a('0x1'),_0xd63a('0x2'),_0xd63a('0x3')];function createListener(_0x368470,_0x5b64ea){return function(_0x4e2828){_0x5b64ea[_0xd63a('0x4')](_0x368470,_0x4e2828);if(_0x368470===_0xd63a('0x5')){_0x5b64ea[_0xd63a('0x4')](_0xd63a('0x6')+_0x4e2828[_0xd63a('0x7')],_0x4e2828);}};}exports[_0xd63a('0x8')]=function(_0x111784){for(var _0x4da004=0x0,_0x32b118=events[_0xd63a('0x9')];_0x4da004<_0x32b118;_0x4da004++){var _0x49a149=events[_0x4da004];var _0x14f52b=createListener(_0xd63a('0xa')+_0x49a149,_0x111784);UserSettingEvents['on'](_0x49a149,_0x14f52b);}}; \ No newline at end of file +var _0x4f17=['update','user-setting:update','emit','UserId','register','length','user-setting:','./user-setting.events','save','remove'];(function(_0x3a001b,_0x126d6e){var _0xfc18ae=function(_0x27c89b){while(--_0x27c89b){_0x3a001b['push'](_0x3a001b['shift']());}};_0xfc18ae(++_0x126d6e);}(_0x4f17,0xed));var _0x74f1=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x4f17[_0x16629d];return _0x56ccee;};'use strict';var UserSettingEvents=require(_0x74f1('0x0'));var events=[_0x74f1('0x1'),_0x74f1('0x2'),_0x74f1('0x3')];function createListener(_0x5cd5a2,_0x33975b){return function(_0x1f19d3){_0x33975b['emit'](_0x5cd5a2,_0x1f19d3);if(_0x5cd5a2===_0x74f1('0x4')){_0x33975b[_0x74f1('0x5')]('user-setting:update:user-'+_0x1f19d3[_0x74f1('0x6')],_0x1f19d3);}};}exports[_0x74f1('0x7')]=function(_0x49be75){for(var _0x2522b9=0x0,_0x1c6e28=events[_0x74f1('0x8')];_0x2522b9<_0x1c6e28;_0x2522b9++){var _0x1e2cc2=events[_0x2522b9];var _0x4459ca=createListener(_0x74f1('0x9')+_0x1e2cc2,_0x49be75);UserSettingEvents['on'](_0x1e2cc2,_0x4459ca);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index b5bf893..624cb11 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 _0x0500=['getFaxInteractions','/:id/teams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','login','/:id/logout','/:id/pause','pause','/:id/unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/openchannel_interactions','/:id/whatsapp_interactions','/:id/fax_accounts','addOpenchannelAccounts','/:id/chat_websites','addWhatsappAccounts','addSquareProjects','/:id/api_key','update','changePassword','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getGroups','/:id/recordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions'];(function(_0x5bef9e,_0x22b1a2){var _0x527faf=function(_0x779997){while(--_0x779997){_0x5bef9e['push'](_0x5bef9e['shift']());}};_0x527faf(++_0x22b1a2);}(_0x0500,0x110));var _0x0050=function(_0x4c6ff1,_0x39ada3){_0x4c6ff1=_0x4c6ff1-0x0;var _0x4f1df0=_0x0500[_0x4c6ff1];return _0x4f1df0;};'use strict';var multer=require(_0x0050('0x0'));var util=require(_0x0050('0x1'));var path=require(_0x0050('0x2'));var timeout=require(_0x0050('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0050('0x4'));var auth=require(_0x0050('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0050('0x6'));var controller=require(_0x0050('0x7'));router[_0x0050('0x8')]('/',auth[_0x0050('0x9')](),controller['index']);router[_0x0050('0x8')](_0x0050('0xa'),auth[_0x0050('0x9')](),controller[_0x0050('0xb')]);router['get'](_0x0050('0xc'),auth[_0x0050('0x9')](),controller[_0x0050('0xd')]);router['get'](_0x0050('0xe'),auth[_0x0050('0x9')](),controller[_0x0050('0xf')]);router['get'](_0x0050('0x10'),auth[_0x0050('0x9')](),controller['show']);router[_0x0050('0x8')](_0x0050('0x11'),controller['getAvatar']);router[_0x0050('0x8')]('/:id/open_tabs',auth[_0x0050('0x9')](),controller[_0x0050('0x12')]);router['get'](_0x0050('0x13'),auth[_0x0050('0x9')](),controller[_0x0050('0x14')]);router[_0x0050('0x8')](_0x0050('0x15'),auth['isAuthenticated'](),controller[_0x0050('0x16')]);router[_0x0050('0x8')](_0x0050('0x17'),auth[_0x0050('0x9')](),controller['getVoiceQueuesRt']);router[_0x0050('0x8')]('/:id/groups',auth[_0x0050('0x9')](),controller[_0x0050('0x18')]);router[_0x0050('0x8')](_0x0050('0x19'),auth[_0x0050('0x9')](),controller['getRecordings']);router['get']('/:id/screen_recordings',auth[_0x0050('0x9')](),controller['getScreenRecordings']);router[_0x0050('0x8')](_0x0050('0x1a'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x0050('0x8')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x0050('0x1b')]);router[_0x0050('0x8')]('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x0050('0x8')](_0x0050('0x1c'),auth[_0x0050('0x9')](),controller[_0x0050('0x1d')]);router[_0x0050('0x8')](_0x0050('0x1e'),auth[_0x0050('0x9')](),controller[_0x0050('0x1f')]);router[_0x0050('0x8')]('/:id/whatsapp/interactions',auth[_0x0050('0x9')](),controller['getWhatsappInteractions']);router[_0x0050('0x8')](_0x0050('0x20'),auth[_0x0050('0x9')](),controller['getTeams']);router[_0x0050('0x8')](_0x0050('0x21'),auth[_0x0050('0x9')](),controller['getLists']);router[_0x0050('0x8')](_0x0050('0x22'),auth[_0x0050('0x9')](),controller[_0x0050('0x23')]);router[_0x0050('0x8')](_0x0050('0x24'),auth[_0x0050('0x9')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x0050('0x25')]);router['get'](_0x0050('0x26'),auth[_0x0050('0x9')](),controller[_0x0050('0x27')]);router[_0x0050('0x8')](_0x0050('0x28'),auth['isAuthenticated'](),controller[_0x0050('0x29')]);router['get'](_0x0050('0x2a'),auth[_0x0050('0x9')](),controller[_0x0050('0x2b')]);router[_0x0050('0x8')]('/:id/chat_websites',auth[_0x0050('0x9')](),controller[_0x0050('0x2c')]);router['get'](_0x0050('0x2d'),auth[_0x0050('0x9')](),controller['getWhatsappAccounts']);router[_0x0050('0x8')](_0x0050('0x2e'),auth[_0x0050('0x9')](),controller[_0x0050('0x2f')]);router[_0x0050('0x8')](_0x0050('0x30'),auth[_0x0050('0x9')](),controller['getScheduledCalls']);router[_0x0050('0x8')]('/:id/api_key',auth[_0x0050('0x9')](),controller[_0x0050('0x31')]);router[_0x0050('0x32')]('/:id/contacts',auth[_0x0050('0x9')](),controller[_0x0050('0x33')]);router[_0x0050('0x32')]('/',auth['isAuthenticated'](),controller[_0x0050('0x34')]);router[_0x0050('0x32')]('/create_many',auth['isAuthenticated'](),controller[_0x0050('0x35')]);router['post'](_0x0050('0x15'),auth[_0x0050('0x9')](),controller[_0x0050('0x36')]);var upload=multer({'storage':multer[_0x0050('0x37')]({'destination':function(_0x44e6b7,_0x36c0bb,_0x3b7cae){_0x3b7cae(null,path[_0x0050('0x38')](config[_0x0050('0x39')],_0x0050('0x3a')));},'filename':function(_0x3be973,_0x2624de,_0x168636){_0x168636(null,util[_0x0050('0x3b')](_0x0050('0x3c'),Date[_0x0050('0x3d')](),_0x2624de[_0x0050('0x3e')]));}})});router[_0x0050('0x32')](_0x0050('0x11'),upload[_0x0050('0x3f')](_0x0050('0x40')),controller[_0x0050('0x41')]);router[_0x0050('0x32')]('/:id/login',auth[_0x0050('0x9')](),controller[_0x0050('0x42')]);router[_0x0050('0x32')](_0x0050('0x43'),auth[_0x0050('0x9')](),controller['logout']);router[_0x0050('0x32')](_0x0050('0x44'),auth[_0x0050('0x9')](),controller[_0x0050('0x45')]);router[_0x0050('0x32')](_0x0050('0x46'),auth['isAuthenticated'](),controller['unpause']);router[_0x0050('0x32')](_0x0050('0x20'),auth[_0x0050('0x9')](),controller['addTeams']);router[_0x0050('0x32')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x0050('0x47')]);router[_0x0050('0x32')](_0x0050('0x48'),auth[_0x0050('0x9')](),controller[_0x0050('0x49')]);router[_0x0050('0x32')](_0x0050('0x4a'),auth[_0x0050('0x9')](),controller['addFaxInteractions']);router[_0x0050('0x32')]('/:id/sms_interactions',auth[_0x0050('0x9')](),controller['addSmsInteractions']);router[_0x0050('0x32')](_0x0050('0x4b'),auth[_0x0050('0x9')](),controller['addOpenchannelInteractions']);router[_0x0050('0x32')](_0x0050('0x4c'),auth[_0x0050('0x9')](),controller['addWhatsappInteractions']);router[_0x0050('0x32')](_0x0050('0x4d'),auth[_0x0050('0x9')](),controller['addFaxAccounts']);router[_0x0050('0x32')](_0x0050('0x26'),auth[_0x0050('0x9')](),controller['addMailAccounts']);router[_0x0050('0x32')]('/:id/openchannel_accounts',auth[_0x0050('0x9')](),controller[_0x0050('0x4e')]);router['post'](_0x0050('0x2a'),auth[_0x0050('0x9')](),controller['addSmsAccounts']);router[_0x0050('0x32')](_0x0050('0x4f'),auth[_0x0050('0x9')](),controller['addChatWebsites']);router[_0x0050('0x32')](_0x0050('0x2d'),auth[_0x0050('0x9')](),controller[_0x0050('0x50')]);router['post'](_0x0050('0x2e'),auth[_0x0050('0x9')](),controller[_0x0050('0x51')]);router[_0x0050('0x32')](_0x0050('0x52'),auth[_0x0050('0x9')](),controller['createApiKey']);router['put'](_0x0050('0x10'),auth['isAuthenticated'](),controller[_0x0050('0x53')]);router['put']('/:id/password',auth[_0x0050('0x9')](),controller[_0x0050('0x54')]);router['delete'](_0x0050('0x15'),auth[_0x0050('0x9')](),controller[_0x0050('0x55')]);router[_0x0050('0x56')](_0x0050('0x20'),auth[_0x0050('0x9')](),controller[_0x0050('0x57')]);router[_0x0050('0x56')](_0x0050('0x10'),auth[_0x0050('0x9')](),controller[_0x0050('0x58')]);router[_0x0050('0x56')](_0x0050('0x59'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x0050('0x56')](_0x0050('0x48'),auth['isAuthenticated'](),controller[_0x0050('0x5a')]);router['delete'](_0x0050('0x4a'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x0050('0x56')](_0x0050('0x5b'),auth['isAuthenticated'](),controller[_0x0050('0x5c')]);router[_0x0050('0x56')](_0x0050('0x4b'),auth['isAuthenticated'](),controller[_0x0050('0x5d')]);router[_0x0050('0x56')]('/:id/whatsapp_interactions',auth[_0x0050('0x9')](),controller[_0x0050('0x5e')]);router[_0x0050('0x56')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x0050('0x56')](_0x0050('0x26'),auth[_0x0050('0x9')](),controller['removeMailAccounts']);router[_0x0050('0x56')](_0x0050('0x28'),auth[_0x0050('0x9')](),controller[_0x0050('0x5f')]);router[_0x0050('0x56')](_0x0050('0x2a'),auth[_0x0050('0x9')](),controller[_0x0050('0x60')]);router[_0x0050('0x56')](_0x0050('0x4f'),auth['isAuthenticated'](),controller[_0x0050('0x61')]);router[_0x0050('0x56')](_0x0050('0x2d'),auth[_0x0050('0x9')](),controller[_0x0050('0x62')]);router[_0x0050('0x56')](_0x0050('0x2e'),auth[_0x0050('0x9')](),controller[_0x0050('0x63')]);router[_0x0050('0x56')](_0x0050('0x52'),auth[_0x0050('0x9')](),controller[_0x0050('0x64')]);module['exports']=router; \ No newline at end of file +var _0x5de1=['/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id','/:id/password','delete','removeQueues','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','originalname','single','addAvatar'];(function(_0x5d6d0a,_0x146b7d){var _0x9c5dd4=function(_0x289ff5){while(--_0x289ff5){_0x5d6d0a['push'](_0x5d6d0a['shift']());}};_0x9c5dd4(++_0x146b7d);}(_0x5de1,0xa2));var _0x15de=function(_0x476920,_0x3d64a1){_0x476920=_0x476920-0x0;var _0x143bb8=_0x5de1[_0x476920];return _0x143bb8;};'use strict';var multer=require(_0x15de('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x15de('0x1')]();var fs_extra=require(_0x15de('0x2'));var auth=require(_0x15de('0x3'));var interaction=require(_0x15de('0x4'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0x15de('0x5')]('/',auth[_0x15de('0x6')](),controller[_0x15de('0x7')]);router[_0x15de('0x5')]('/describe',auth[_0x15de('0x6')](),controller[_0x15de('0x8')]);router['get'](_0x15de('0x9'),auth[_0x15de('0x6')](),controller[_0x15de('0xa')]);router[_0x15de('0x5')](_0x15de('0xb'),auth['isAuthenticated'](),controller[_0x15de('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x15de('0xd')]);router[_0x15de('0x5')](_0x15de('0xe'),controller[_0x15de('0xf')]);router[_0x15de('0x5')](_0x15de('0x10'),auth[_0x15de('0x6')](),controller[_0x15de('0x11')]);router['get'](_0x15de('0x12'),auth[_0x15de('0x6')](),controller[_0x15de('0x13')]);router[_0x15de('0x5')](_0x15de('0x14'),auth[_0x15de('0x6')](),controller[_0x15de('0x15')]);router[_0x15de('0x5')](_0x15de('0x16'),auth['isAuthenticated'](),controller[_0x15de('0x17')]);router[_0x15de('0x5')]('/:id/groups',auth[_0x15de('0x6')](),controller['getGroups']);router[_0x15de('0x5')](_0x15de('0x18'),auth['isAuthenticated'](),controller[_0x15de('0x19')]);router[_0x15de('0x5')](_0x15de('0x1a'),auth[_0x15de('0x6')](),controller[_0x15de('0x1b')]);router[_0x15de('0x5')]('/:id/chat/interactions',auth[_0x15de('0x6')](),controller[_0x15de('0x1c')]);router['get'](_0x15de('0x1d'),auth[_0x15de('0x6')](),controller[_0x15de('0x1e')]);router[_0x15de('0x5')]('/:id/mail/interactions',auth[_0x15de('0x6')](),controller[_0x15de('0x1f')]);router['get']('/:id/sms/interactions',auth[_0x15de('0x6')](),controller[_0x15de('0x20')]);router[_0x15de('0x5')](_0x15de('0x21'),auth['isAuthenticated'](),controller[_0x15de('0x22')]);router[_0x15de('0x5')]('/:id/whatsapp/interactions',auth[_0x15de('0x6')](),controller['getWhatsappInteractions']);router['get'](_0x15de('0x23'),auth[_0x15de('0x6')](),controller[_0x15de('0x24')]);router[_0x15de('0x5')](_0x15de('0x25'),auth[_0x15de('0x6')](),controller[_0x15de('0x26')]);router['get']('/:id/agents',auth[_0x15de('0x6')](),controller[_0x15de('0x27')]);router[_0x15de('0x5')](_0x15de('0x28'),auth[_0x15de('0x6')](),controller[_0x15de('0x29')]);router[_0x15de('0x5')](_0x15de('0x2a'),auth[_0x15de('0x6')](),controller[_0x15de('0x2b')]);router['get'](_0x15de('0x2c'),auth[_0x15de('0x6')](),controller[_0x15de('0x2d')]);router[_0x15de('0x5')](_0x15de('0x2e'),auth['isAuthenticated'](),controller[_0x15de('0x2f')]);router[_0x15de('0x5')](_0x15de('0x30'),auth[_0x15de('0x6')](),controller[_0x15de('0x31')]);router[_0x15de('0x5')](_0x15de('0x32'),auth['isAuthenticated'](),controller[_0x15de('0x33')]);router['get']('/:id/whatsapp_accounts',auth[_0x15de('0x6')](),controller[_0x15de('0x34')]);router['get'](_0x15de('0x35'),auth[_0x15de('0x6')](),controller[_0x15de('0x36')]);router['get']('/:id/scheduled_calls',auth[_0x15de('0x6')](),controller[_0x15de('0x37')]);router['get'](_0x15de('0x38'),auth[_0x15de('0x6')](),controller[_0x15de('0x39')]);router[_0x15de('0x3a')](_0x15de('0x12'),auth[_0x15de('0x6')](),controller[_0x15de('0x3b')]);router[_0x15de('0x3a')]('/',auth[_0x15de('0x6')](),controller[_0x15de('0x3c')]);router[_0x15de('0x3a')](_0x15de('0x3d'),auth[_0x15de('0x6')](),controller[_0x15de('0x3e')]);router['post'](_0x15de('0x14'),auth[_0x15de('0x6')](),controller[_0x15de('0x3f')]);var upload=multer({'storage':multer[_0x15de('0x40')]({'destination':function(_0x3609c9,_0x52c1f1,_0x388cb1){_0x388cb1(null,path[_0x15de('0x41')](config['root'],_0x15de('0x42')));},'filename':function(_0x17f8dd,_0x5cbf57,_0xc2bee2){_0xc2bee2(null,util[_0x15de('0x43')](_0x15de('0x44'),Date['now'](),_0x5cbf57[_0x15de('0x45')]));}})});router[_0x15de('0x3a')](_0x15de('0xe'),upload[_0x15de('0x46')]('file'),controller[_0x15de('0x47')]);router[_0x15de('0x3a')](_0x15de('0x48'),auth[_0x15de('0x6')](),controller[_0x15de('0x49')]);router[_0x15de('0x3a')](_0x15de('0x4a'),auth[_0x15de('0x6')](),controller[_0x15de('0x4b')]);router[_0x15de('0x3a')](_0x15de('0x4c'),auth['isAuthenticated'](),controller[_0x15de('0x4d')]);router[_0x15de('0x3a')](_0x15de('0x4e'),auth[_0x15de('0x6')](),controller[_0x15de('0x4f')]);router[_0x15de('0x3a')](_0x15de('0x23'),auth[_0x15de('0x6')](),controller[_0x15de('0x50')]);router[_0x15de('0x3a')]('/:id/chat_interactions',auth[_0x15de('0x6')](),controller[_0x15de('0x51')]);router[_0x15de('0x3a')](_0x15de('0x52'),auth[_0x15de('0x6')](),controller[_0x15de('0x53')]);router[_0x15de('0x3a')](_0x15de('0x54'),auth['isAuthenticated'](),controller[_0x15de('0x55')]);router[_0x15de('0x3a')](_0x15de('0x56'),auth[_0x15de('0x6')](),controller[_0x15de('0x57')]);router[_0x15de('0x3a')](_0x15de('0x58'),auth['isAuthenticated'](),controller[_0x15de('0x59')]);router[_0x15de('0x3a')](_0x15de('0x5a'),auth[_0x15de('0x6')](),controller['addWhatsappInteractions']);router[_0x15de('0x3a')](_0x15de('0x2a'),auth[_0x15de('0x6')](),controller[_0x15de('0x5b')]);router['post'](_0x15de('0x2c'),auth[_0x15de('0x6')](),controller[_0x15de('0x5c')]);router[_0x15de('0x3a')](_0x15de('0x2e'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0x15de('0x3a')](_0x15de('0x30'),auth['isAuthenticated'](),controller[_0x15de('0x5d')]);router[_0x15de('0x3a')](_0x15de('0x32'),auth[_0x15de('0x6')](),controller[_0x15de('0x5e')]);router[_0x15de('0x3a')](_0x15de('0x5f'),auth[_0x15de('0x6')](),controller[_0x15de('0x60')]);router['post'](_0x15de('0x35'),auth[_0x15de('0x6')](),controller[_0x15de('0x61')]);router[_0x15de('0x3a')]('/:id/api_key',auth[_0x15de('0x6')](),controller[_0x15de('0x62')]);router[_0x15de('0x63')](_0x15de('0x64'),auth['isAuthenticated'](),controller['update']);router[_0x15de('0x63')](_0x15de('0x65'),auth[_0x15de('0x6')](),controller['changePassword']);router[_0x15de('0x66')](_0x15de('0x14'),auth['isAuthenticated'](),controller[_0x15de('0x67')]);router[_0x15de('0x66')]('/:id/teams',auth[_0x15de('0x6')](),controller['removeTeams']);router[_0x15de('0x66')](_0x15de('0x64'),auth['isAuthenticated'](),controller['destroy']);router[_0x15de('0x66')](_0x15de('0x68'),auth[_0x15de('0x6')](),controller['removeChatInteractions']);router[_0x15de('0x66')](_0x15de('0x52'),auth['isAuthenticated'](),controller[_0x15de('0x69')]);router[_0x15de('0x66')](_0x15de('0x54'),auth[_0x15de('0x6')](),controller[_0x15de('0x6a')]);router[_0x15de('0x66')](_0x15de('0x56'),auth[_0x15de('0x6')](),controller[_0x15de('0x6b')]);router[_0x15de('0x66')](_0x15de('0x58'),auth[_0x15de('0x6')](),controller[_0x15de('0x6c')]);router[_0x15de('0x66')](_0x15de('0x5a'),auth[_0x15de('0x6')](),controller['removeWhatsappInteractions']);router['delete'](_0x15de('0x2a'),auth[_0x15de('0x6')](),controller['removeFaxAccounts']);router[_0x15de('0x66')](_0x15de('0x2c'),auth[_0x15de('0x6')](),controller[_0x15de('0x6d')]);router[_0x15de('0x66')]('/:id/openchannel_accounts',auth[_0x15de('0x6')](),controller[_0x15de('0x6e')]);router[_0x15de('0x66')](_0x15de('0x30'),auth['isAuthenticated'](),controller[_0x15de('0x6f')]);router[_0x15de('0x66')](_0x15de('0x32'),auth[_0x15de('0x6')](),controller[_0x15de('0x70')]);router[_0x15de('0x66')](_0x15de('0x5f'),auth['isAuthenticated'](),controller[_0x15de('0x71')]);router[_0x15de('0x66')](_0x15de('0x35'),auth[_0x15de('0x6')](),controller[_0x15de('0x72')]);router['delete'](_0x15de('0x38'),auth[_0x15de('0x6')](),controller[_0x15de('0x73')]);module[_0x15de('0x74')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 768b170..1aecd52 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(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x2e5db3,_0x421780){var _0x4f7c28=function(_0x3b9eba){while(--_0x3b9eba){_0x2e5db3['push'](_0x2e5db3['shift']());}};_0x4f7c28(++_0x421780);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0xcb91[_0x4d08b8];return _0x70214a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'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 5b6ca60..1571a1a 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 _0x7ea2=['defaults','client','http','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','offset','undefined','limit','Content-Range','json','update','emit','destroy','get','Users','user','Agents','agent','Telephones','filter','ignore','map','value','includes','role','find','name','UserProfileResource','stack','index','fieldName','type','key','password','salt','where','User','count','query','includeAll','true','include','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','sms','fax','dataValues','mail','openchannel','whatsapp','all','show','model','differenceBy','keys','filters','intersection','fields','userSetting','merge','options','body','addContacts','params','ids','internal','Setting','securePassword','validatePasswordPattern','max','min_internal','isNil','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','email','permissions','101','102','113','104','105','106','107','108','109','111','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','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','telephone','UserProfileSection','isEmpty','compact','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','penalty','toLowerCase','voice','VoiceQueue','upsert','removeQueues','remove','isArray','QueueId','Queue:remove','UserVoiceQueueRt','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','pick','hasOwnProperty','CmList','Tag','color','tag','nolimit','getQueues','findOne','rawAttributes','sort','Queue','getVoiceQueuesRt','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','LOGININPAUSE','concat','resolve','logout','QueuePause','pause','PAUSE','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','getTeams','addTeams','User\x20with\x20id\x20%s\x20not\x20found','transaction','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Team','removeAgent','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$eq','$between','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','createApiKey','iat','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','flatten','lower','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','toString','moment','util','lodash','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register'];(function(_0x2978e1,_0x26b3f5){var _0xca0ea8=function(_0x289c2e){while(--_0x289c2e){_0x2978e1['push'](_0x2978e1['shift']());}};_0xca0ea8(++_0x26b3f5);}(_0x7ea2,0x182));var _0x27ea=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0x7ea2[_0x32f26d];return _0x5d9ddc;};'use strict';var moment=require(_0x27ea('0x0'));var util=require(_0x27ea('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x27ea('0x2'));var squel=require('squel');var jayson=require('jayson/promise');var Redis=require(_0x27ea('0x3'));var authService=require(_0x27ea('0x4'));var qs=require(_0x27ea('0x5'));var logger=require(_0x27ea('0x6'))('api');var utils=require(_0x27ea('0x7'));var config=require('../../config/environment');var licenseUtil=require(_0x27ea('0x8'));var APIBadRequestError=require(_0x27ea('0x9'))[_0x27ea('0xa')];var APINotFoundError=require(_0x27ea('0x9'))[_0x27ea('0xb')];var APIHandleError=require(_0x27ea('0x9'))[_0x27ea('0xc')];var db=require(_0x27ea('0xd'))['db'];var socket=require(_0x27ea('0xe'))(new Redis(config[_0x27ea('0xf')]));require(_0x27ea('0x10'))[_0x27ea('0x11')](socket);config['redis']=_[_0x27ea('0x12')](config[_0x27ea('0xf')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0x27ea('0x13')][_0x27ea('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x398e28,_0x3e1229,_0x2c07d9,_0x4e6231){return new Promise(function(_0x538231,_0x5cdd7a){var _0x4f7182=_0x4e6231||amiClient;return _0x4f7182[_0x27ea('0x15')](_0x398e28,_0x2c07d9)[_0x27ea('0x16')](function(_0x1baabb){logger[_0x27ea('0x17')](_0x27ea('0x18'),_0x3e1229,'request\x20sent');logger[_0x27ea('0x19')](_0x27ea('0x1a'),_0x3e1229,'request\x20sent',JSON[_0x27ea('0x1b')](_0x1baabb));if(_0x1baabb[_0x27ea('0x1c')]){if(_0x1baabb[_0x27ea('0x1c')][_0x27ea('0x1d')]===0x1f4){logger[_0x27ea('0x1c')]('User,\x20%s,\x20%s',_0x3e1229,_0x1baabb['error']['message']);return _0x5cdd7a(_0x1baabb['error']['message']);}logger[_0x27ea('0x1c')](_0x27ea('0x18'),_0x3e1229,_0x1baabb[_0x27ea('0x1c')]['message']);return _0x538231(_0x1baabb[_0x27ea('0x1c')][_0x27ea('0x1e')]);}else{logger[_0x27ea('0x17')](_0x27ea('0x18'),_0x3e1229,_0x27ea('0x1f'));_0x538231(_0x1baabb[_0x27ea('0x20')][_0x27ea('0x1e')]);}})[_0x27ea('0x21')](function(_0x1dcdb3){logger[_0x27ea('0x1c')](_0x27ea('0x18'),_0x3e1229,_0x1dcdb3);_0x5cdd7a(_0x1dcdb3);});});}function respondWithStatusCode(_0x11aa41,_0x4a53f2){_0x4a53f2=_0x4a53f2||0xcc;return function(_0xaf10c6){if(_0xaf10c6){return _0x11aa41[_0x27ea('0x22')](_0x4a53f2);}return _0x11aa41[_0x27ea('0x23')](_0x4a53f2)[_0x27ea('0x24')]();};}function respondWithResult(_0x4acd6e,_0x3ee542){_0x3ee542=_0x3ee542||0xc8;return function(_0x393f5d){if(_0x393f5d){return _0x4acd6e['status'](_0x3ee542)['json'](_0x393f5d);}};}function respondWithFilteredResult(_0x1ef8df,_0x4953fb){return function(_0x2e2c1f){if(_0x2e2c1f){var _0x5d30d4=typeof _0x4953fb[_0x27ea('0x25')]===_0x27ea('0x26')&&typeof _0x4953fb[_0x27ea('0x27')]===_0x27ea('0x26');var _0x56b4be=_0x2e2c1f['count'];var _0x3cf1e7=_0x5d30d4?0x0:_0x4953fb[_0x27ea('0x25')];var _0x4364fc=_0x5d30d4?_0x2e2c1f['count']:_0x4953fb[_0x27ea('0x25')]+_0x4953fb[_0x27ea('0x27')];var _0x27ef57;if(_0x4364fc>=_0x56b4be){_0x4364fc=_0x56b4be;_0x27ef57=0xc8;}else{_0x27ef57=0xce;}_0x1ef8df[_0x27ea('0x23')](_0x27ef57);return _0x1ef8df['set'](_0x27ea('0x28'),_0x3cf1e7+'-'+_0x4364fc+'/'+_0x56b4be)[_0x27ea('0x29')](_0x2e2c1f);}return null;};}function saveUpdates(_0x211090){return function(_0x3013ba){if(_0x3013ba){return _0x3013ba[_0x27ea('0x2a')](_0x211090)[_0x27ea('0x16')](function(_0x5ee221){socket[_0x27ea('0x2b')]('userNotification:recalc:'+_0x5ee221['id'],{});return _0x5ee221;});}return null;};}function removeEntity(_0x4f7ed3){return function(_0x31746c){if(_0x31746c){return _0x31746c[_0x27ea('0x2c')]()[_0x27ea('0x16')](function(){var _0x1d0662=_0x31746c[_0x27ea('0x2d')]({'plain':!![]});if(_0x1d0662['role']==='admin')return;var _0x15e1ce=[{'name':_0x27ea('0x2e'),'value':_0x27ea('0x2f'),'ignore':!![]},{'name':_0x27ea('0x30'),'value':_0x27ea('0x31'),'ignore':![]},{'name':_0x27ea('0x32'),'value':'telephone','ignore':![]}];var _0x528ab0=_(_0x15e1ce)[_0x27ea('0x33')](_0x27ea('0x34'))[_0x27ea('0x35')](_0x27ea('0x36'))[_0x27ea('0x36')]();if(_[_0x27ea('0x37')](_0x528ab0,_0x1d0662[_0x27ea('0x38')])){return;}var _0x4f0638=_[_0x27ea('0x39')](_0x15e1ce,[_0x27ea('0x36'),_0x1d0662[_0x27ea('0x38')]])[_0x27ea('0x3a')];return db[_0x27ea('0x3b')][_0x27ea('0x2c')]({'where':{'type':_0x4f0638,'resourceId':_0x1d0662['id']}})['then'](function(){return _0x31746c;});})['then'](function(){_0x4f7ed3['status'](0xcc)[_0x27ea('0x24')]();});}};}function handleEntityNotFound(_0x2ab5a0){return function(_0x5c947a){if(!_0x5c947a){_0x2ab5a0[_0x27ea('0x22')](0x194);}return _0x5c947a;};}function handleError(_0x1357a7,_0x40ff5f){_0x40ff5f=_0x40ff5f||0x1f4;return function(_0x2d09de){logger['error'](_0x2d09de[_0x27ea('0x3c')]);if(_0x2d09de[_0x27ea('0x3a')]){delete _0x2d09de['name'];}_0x1357a7[_0x27ea('0x23')](_0x40ff5f)['send'](_0x2d09de);};}exports[_0x27ea('0x3d')]=function(_0x95eaf1,_0x275d87){var _0x5e85e0={},_0x4c1e2f={'count':0x0,'rows':[]};var _0x2f60cd=_(db['User']['rawAttributes'])[_0x27ea('0x35')](function(_0x2d0a19){return{'name':_0x2d0a19[_0x27ea('0x3e')],'type':_0x2d0a19[_0x27ea('0x3f')][_0x27ea('0x40')]};})[_0x27ea('0x33')](function(_0x4b93fd){return!_[_0x27ea('0x37')]([_0x27ea('0x41'),_0x27ea('0x42')],_0x4b93fd[_0x27ea('0x3a')]);})[_0x27ea('0x36')]();_0x5e85e0=qs['getOptions'](_0x2f60cd,_0x95eaf1);var _0x11f021={'where':_0x5e85e0[_0x27ea('0x43')]};return db[_0x27ea('0x44')][_0x27ea('0x45')](_0x11f021)[_0x27ea('0x16')](function(_0x12abd8){_0x4c1e2f['count']=_0x12abd8;if(_0x95eaf1[_0x27ea('0x46')][_0x27ea('0x47')]){_0x5e85e0['include']=[{'all':!![]}];}if(_0x95eaf1[_0x27ea('0x46')]['userSetting']===_0x27ea('0x48')){_0x5e85e0[_0x27ea('0x49')]=[{'model':db[_0x27ea('0x4a')],'as':'userSetting'}];}if(!_['includes'](_0x5e85e0[_0x27ea('0x4b')],'id')){_0x5e85e0[_0x27ea('0x4b')][_0x27ea('0x4c')]('id');}return db['User'][_0x27ea('0x4d')](_0x5e85e0);})[_0x27ea('0x16')](function(_0x9421e6){_0x4c1e2f[_0x27ea('0x4e')]=_0x9421e6;if(_0x95eaf1['query'][_0x27ea('0x4f')]==='true'){var _0x1aef62=[];for(var _0x36aef3=0x0;_0x36aef3<_0x4c1e2f[_0x27ea('0x4e')][_0x27ea('0x50')];_0x36aef3++){_0x1aef62[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x51'),_0x4c1e2f[_0x27ea('0x4e')][_0x36aef3]['dataValues']));_0x1aef62[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x52'),_0x4c1e2f['rows'][_0x36aef3]['dataValues']));_0x1aef62[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x53'),_0x4c1e2f[_0x27ea('0x4e')][_0x36aef3][_0x27ea('0x54')]));_0x1aef62[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x55'),_0x4c1e2f[_0x27ea('0x4e')][_0x36aef3]['dataValues']));_0x1aef62[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x56'),_0x4c1e2f[_0x27ea('0x4e')][_0x36aef3]['dataValues']));_0x1aef62[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x57'),_0x4c1e2f[_0x27ea('0x4e')][_0x36aef3][_0x27ea('0x54')]));}return Promise[_0x27ea('0x58')](_0x1aef62)[_0x27ea('0x16')](function(){return _0x4c1e2f;});}else{return _0x4c1e2f;}})['then'](respondWithFilteredResult(_0x275d87,_0x5e85e0))['catch'](handleError(_0x275d87,null));};exports[_0x27ea('0x59')]=function(_0x1b7d3f,_0xe82dce){var _0x6d750b={'raw':![],'where':{'id':_0x1b7d3f['params']['id']}},_0x56526f={};_0x56526f[_0x27ea('0x5a')]=_[_0x27ea('0x5b')](_[_0x27ea('0x5c')](db[_0x27ea('0x44')]['rawAttributes']),[_0x27ea('0x41'),'salt']);_0x56526f['query']=_[_0x27ea('0x5c')](_0x1b7d3f[_0x27ea('0x46')]);_0x56526f[_0x27ea('0x5d')]=_['intersection'](_0x56526f[_0x27ea('0x5a')],_0x56526f[_0x27ea('0x46')]);_0x6d750b[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x56526f[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x1b7d3f[_0x27ea('0x46')][_0x27ea('0x5f')]));_0x6d750b[_0x27ea('0x4b')]=_0x6d750b[_0x27ea('0x4b')]['length']?_0x6d750b['attributes']:_0x56526f[_0x27ea('0x5a')];if(_0x1b7d3f['query'][_0x27ea('0x47')]){_0x6d750b[_0x27ea('0x49')]=[{'all':!![]}];}if(_0x1b7d3f[_0x27ea('0x46')][_0x27ea('0x60')]===_0x27ea('0x48')){_0x6d750b[_0x27ea('0x49')]=[{'model':db[_0x27ea('0x4a')],'as':_0x27ea('0x60')}];}_0x6d750b=_[_0x27ea('0x61')]({},_0x6d750b,_0x1b7d3f[_0x27ea('0x62')]);if(!_[_0x27ea('0x37')](_0x6d750b[_0x27ea('0x4b')],'id')){_0x6d750b['attributes']['push']('id');}return db['User'][_0x27ea('0x39')](_0x6d750b)[_0x27ea('0x16')](handleEntityNotFound(_0xe82dce,null))[_0x27ea('0x16')](function(_0x17aa9f){var _0x317d0a=[];values=_0x17aa9f;if(_0x1b7d3f['query'][_0x27ea('0x4f')]===_0x27ea('0x48')){_0x317d0a['push'](get_open_tabs(_0x27ea('0x51'),_0x17aa9f['dataValues']));_0x317d0a[_0x27ea('0x4c')](get_open_tabs('sms',_0x17aa9f[_0x27ea('0x54')]));_0x317d0a[_0x27ea('0x4c')](get_open_tabs('openchannel',_0x17aa9f[_0x27ea('0x54')]));_0x317d0a[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x57'),_0x17aa9f['dataValues']));_0x317d0a[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x53'),_0x17aa9f[_0x27ea('0x54')]));_0x317d0a[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x55'),_0x17aa9f[_0x27ea('0x54')]));return Promise[_0x27ea('0x58')](_0x317d0a);}else{return values;}})[_0x27ea('0x16')](function(){return values;})[_0x27ea('0x16')](respondWithResult(_0xe82dce,null))[_0x27ea('0x21')](handleError(_0xe82dce,null));};exports[_0x27ea('0x2a')]=function(_0x4e9dfb,_0x4c7514){if(_0x4e9dfb['body']['id']){delete _0x4e9dfb['body']['id'];}delete _0x4e9dfb[_0x27ea('0x63')]['role'];return db['User'][_0x27ea('0x39')]({'where':{'id':_0x4e9dfb['params']['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x4c7514,null))[_0x27ea('0x16')](saveUpdates(_0x4e9dfb[_0x27ea('0x63')],null))['then'](respondWithResult(_0x4c7514,null))[_0x27ea('0x21')](handleError(_0x4c7514,null));};exports['describe']=function(_0x3ba1bc,_0x5808cf){return db[_0x27ea('0x44')]['describe']()[_0x27ea('0x16')](respondWithResult(_0x5808cf,null))['catch'](handleError(_0x5808cf,null));};exports[_0x27ea('0x64')]=function(_0x3ba139,_0x5716d7){return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x3ba139[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x5716d7,null))['then'](function(_0x47ef52){if(_0x47ef52){return _0x47ef52['addContacts'](_0x3ba139[_0x27ea('0x63')][_0x27ea('0x66')],_['omit'](_0x3ba139[_0x27ea('0x63')],[_0x27ea('0x66'),'id'])||{});}})[_0x27ea('0x16')](respondWithResult(_0x5716d7,null))[_0x27ea('0x21')](handleError(_0x5716d7,null));};function validateUser(_0x3b4e0c){return new Promise(function(_0x4230e4,_0x57f886){if(_0x3b4e0c[_0x27ea('0x67')])return _0x4230e4(_0x3b4e0c);return db[_0x27ea('0x68')]['findById'](0x1)[_0x27ea('0x16')](function(_0xbf8a86){if(_0xbf8a86[_0x27ea('0x69')])authService[_0x27ea('0x6a')](_0x3b4e0c[_0x27ea('0x41')]);db['User'][_0x27ea('0x6b')](_0x27ea('0x67'))['then'](function(_0x49613e){if(_['isNil'](_0x49613e)){_0x3b4e0c[_0x27ea('0x67')]=_0xbf8a86[_0x27ea('0x6c')]||0x1;return;}if(_[_0x27ea('0x6d')](_0xbf8a86[_0x27ea('0x6c')])||_0xbf8a86[_0x27ea('0x6c')]===_0x49613e){_0x3b4e0c[_0x27ea('0x67')]=_0x49613e+0x1;return;}if(_0xbf8a86[_0x27ea('0x6c')]>_0x49613e){_0x3b4e0c[_0x27ea('0x67')]=_0xbf8a86[_0x27ea('0x6c')];return;}return db[_0x27ea('0x6e')][_0x27ea('0x46')](_0x27ea('0x6f'),{'type':db[_0x27ea('0x6e')][_0x27ea('0x70')][_0x27ea('0x71')]})[_0x27ea('0x16')](function(_0x3087ee){if(_0x3087ee&&_0x3087ee[_0x27ea('0x50')]){for(var _0x11eb67=0x0,_0x6d44b9=_0x3087ee[_0x27ea('0x50')];_0x11eb67<_0x6d44b9&&_[_0x27ea('0x6d')](_0x3b4e0c['internal']);_0x11eb67++){if(_0xbf8a86[_0x27ea('0x6c')]<=_0x3087ee[_0x11eb67]['from']){_0x3b4e0c['internal']=_0x3087ee[_0x11eb67][_0x27ea('0x72')];}else if(_0xbf8a86[_0x27ea('0x6c')]>_0x3087ee[_0x11eb67]['from']&&_0xbf8a86[_0x27ea('0x6c')]<=_0x3087ee[_0x11eb67]['to']){_0x3b4e0c[_0x27ea('0x67')]=_0xbf8a86['min_internal'];}}}if(_[_0x27ea('0x6d')](_0x3b4e0c[_0x27ea('0x67')])){_0x3b4e0c['internal']=_0x49613e+0x1;}return _0x4230e4(_0x3b4e0c);});});})['catch'](function(_0x3df1cd){_0x57f886(_0x3df1cd);});});}function updateUser(_0x404bb9){return new Promise(function(_0x3085ad,_0x105dfc){try{if(_0x404bb9[_0x27ea('0x73')]){_0x404bb9[_0x27ea('0x74')]=_0x404bb9[_0x27ea('0x67')];_0x404bb9[_0x27ea('0x75')]={'mailbox':_0x404bb9['internal'],'password':_0x404bb9[_0x27ea('0x41')],'fullname':_0x404bb9['fullname'],'email':_0x404bb9[_0x27ea('0x76')]};}if(_0x404bb9[_0x27ea('0x38')]==='agent'){if(!_0x404bb9[_0x27ea('0x77')])_0x404bb9['permissions']=[_0x27ea('0x78'),_0x27ea('0x79'),'103',_0x27ea('0x7a'),'110',_0x27ea('0x7b'),_0x27ea('0x7c'),_0x27ea('0x7d'),_0x27ea('0x7e'),_0x27ea('0x7f'),_0x27ea('0x80'),'100',_0x27ea('0x81'),_0x27ea('0x82'),_0x27ea('0x83')];}_0x3085ad(_0x404bb9);}catch(_0x55b04c){_0x105dfc(_0x55b04c);}});}exports['create']=function(_0x37b903,_0x382a06){if(_0x37b903[_0x27ea('0x2f')]['role']===_0x27ea('0x31'))throw new Error(_0x27ea('0x84'));if(_0x37b903[_0x27ea('0x63')]['role']==='user'&&_0x37b903[_0x27ea('0x2f')][_0x27ea('0x38')]!=='admin'){throw new Error(_0x27ea('0x85'));}if(_0x37b903['body']['role']==='admin'&&_0x37b903[_0x27ea('0x2f')][_0x27ea('0x38')]!==_0x27ea('0x86')){throw new Error(_0x27ea('0x87'));}return licenseUtil[_0x27ea('0x88')]([_0x37b903['body']])[_0x27ea('0x16')](function(){return validateUser(_0x37b903['body']);})[_0x27ea('0x16')](function(_0x591ef2){return updateUser(_0x591ef2)[_0x27ea('0x16')](function(_0x4c27c1){if(_0x4c27c1[_0x27ea('0x38')]===_0x27ea('0x86')){_0x4c27c1[_0x27ea('0x89')]=_0x37b903[_0x27ea('0x2f')][_0x27ea('0x89')];delete _0x4c27c1[_0x27ea('0x8a')];}return _0x4c27c1;});})['then'](function(_0x4a3a95){return db[_0x27ea('0x44')][_0x27ea('0x8b')](_0x4a3a95,{'include':[{'model':db[_0x27ea('0x75')],'as':_0x27ea('0x75')}]});})[_0x27ea('0x16')](function(_0x236000){if(_0x37b903['body']['role']===_0x27ea('0x2f'))return _0x236000;if(_0x37b903['user'][_0x27ea('0x38')]!==_0x27ea('0x2f'))return _0x236000;return db['UserProfileSection'][_0x27ea('0x39')]({'where':{'name':_0x236000[_0x27ea('0x38')]==='agent'?_0x27ea('0x30'):_0x27ea('0x32'),'userProfileId':_0x37b903[_0x27ea('0x2f')][_0x27ea('0x8a')]},'raw':!![]})[_0x27ea('0x16')](function(_0x1ac4a4){if(!_0x1ac4a4||_0x1ac4a4[_0x27ea('0x8c')]!=0x0)return _0x236000;return db['UserProfileResource'][_0x27ea('0x8b')]({'name':_0x236000['name'],'resourceId':_0x236000['id'],'type':_0x1ac4a4[_0x27ea('0x3a')],'sectionId':_0x1ac4a4['id']},{})[_0x27ea('0x16')](function(){return _0x236000;});})[_0x27ea('0x21')](function(_0x3fc5ed){logger[_0x27ea('0x1c')](_0x27ea('0x8d'),_0x3fc5ed);throw _0x3fc5ed;});})[_0x27ea('0x16')](respondWithResult(_0x382a06,0xc9))[_0x27ea('0x21')](handleError(_0x382a06,null));};exports[_0x27ea('0x8e')]=function(_0x16b1ae,_0x462a30){var _0x4d52ad=_0x16b1ae['body'];var _0x54e152=[];if(_0x16b1ae[_0x27ea('0x2f')][_0x27ea('0x38')]===_0x27ea('0x31'))throw new Error('Unauthorized');if(_[_0x27ea('0x8f')](_0x4d52ad,[_0x27ea('0x38'),'user'])&&_0x16b1ae[_0x27ea('0x2f')][_0x27ea('0x38')]!==_0x27ea('0x86')){throw new Error(_0x27ea('0x85'));}if(_[_0x27ea('0x8f')](_0x4d52ad,['role',_0x27ea('0x86')])&&_0x16b1ae[_0x27ea('0x2f')][_0x27ea('0x38')]!=='admin'){throw new Error(_0x27ea('0x90'));}return licenseUtil[_0x27ea('0x88')](_0x4d52ad)[_0x27ea('0x16')](function(){return validateUser(_0x4d52ad[0x0]);})[_0x27ea('0x16')](function(){for(var _0x4152e1=0x1;_0x4152e1<_0x4d52ad[_0x27ea('0x50')];_0x4152e1++){var _0xaac1bd=_0x4d52ad[_0x4152e1-0x1][_0x27ea('0x67')];if(!_0x4d52ad[_0x4152e1][_0x27ea('0x67')])_0x4d52ad[_0x4152e1][_0x27ea('0x67')]=_0xaac1bd+0x1;_0x54e152[_0x27ea('0x4c')](validateUser(_0x4d52ad[_0x4152e1]));}return Promise[_0x27ea('0x58')](_0x54e152);})[_0x27ea('0x16')](function(){_0x54e152=[];for(var _0x3dd842=0x0;_0x3dd842<_0x4d52ad['length'];_0x3dd842++){_0x54e152['push'](updateUser(_0x4d52ad[_0x3dd842]));}return Promise['all'](_0x54e152);})[_0x27ea('0x16')](function(){_0x54e152=_0x4d52ad[_0x27ea('0x35')](function(_0x47475a){return db[_0x27ea('0x44')][_0x27ea('0x8b')](_0x47475a,{'include':[{'model':db['VoiceMail'],'as':_0x27ea('0x75')}]})[_0x27ea('0x16')](function(_0x3e4538){_0x47475a['id']=_0x3e4538['id'];return _0x47475a;});});return Promise[_0x27ea('0x58')](_0x54e152);})[_0x27ea('0x16')](function(_0x38114d){if(_0x16b1ae['body']['role']===_0x27ea('0x2f'))return _0x38114d;if(_0x16b1ae[_0x27ea('0x2f')]['role']!==_0x27ea('0x2f'))return _0x38114d;var _0x5a667b=_[_0x27ea('0x8f')](_0x38114d,function(_0x2ff962){return _0x2ff962[_0x27ea('0x38')]==='agent'||_0x2ff962[_0x27ea('0x38')]===_0x27ea('0x91');});if(!_0x5a667b)return _0x38114d;return db[_0x27ea('0x92')]['findAll']({'where':{'name':{'$or':[_0x27ea('0x30'),_0x27ea('0x32')]},'userProfileId':_0x16b1ae['user'][_0x27ea('0x8a')]},'raw':!![]})['then'](function(_0x4b5427){if(_[_0x27ea('0x93')](_0x4b5427)||!_[_0x27ea('0x8f')](_0x4b5427,['autoAssociation',0x0]))return _0x38114d;_0x54e152=[];var _0x54ceca=_(_0x4b5427)[_0x27ea('0x35')](function(_0x4d6205){if(_0x4d6205[_0x27ea('0x8c')]===0x1)return;return _0x4d6205['name']===_0x27ea('0x30')?_0x27ea('0x31'):'telephone';})[_0x27ea('0x94')]()[_0x27ea('0x36')]();for(var _0x6e40bd=0x0;_0x6e40bd<_0x38114d[_0x27ea('0x50')];_0x6e40bd++){if(!_[_0x27ea('0x37')](_0x54ceca,_0x38114d[_0x6e40bd][_0x27ea('0x38')]))return;var _0x52b3e7=_0x38114d[_0x6e40bd][_0x27ea('0x38')]===_0x27ea('0x31')?_0x27ea('0x30'):'Telephones';_0x54e152['push'](db['UserProfileResource'][_0x27ea('0x8b')]({'name':_0x38114d[_0x6e40bd][_0x27ea('0x3a')],'resourceId':_0x38114d[_0x6e40bd]['id'],'type':_0x52b3e7,'sectionId':_[_0x27ea('0x39')](_0x4b5427,['name',_0x52b3e7])['id']},{}));}return Promise[_0x27ea('0x58')](_0x54e152);});})[_0x27ea('0x16')](respondWithResult(_0x462a30,0xc9))[_0x27ea('0x21')](handleError(_0x462a30,null));};exports['changePassword']=function(_0x168c49,_0x1efa7f){if(_0x168c49[_0x27ea('0x63')]['id']){delete _0x168c49[_0x27ea('0x63')]['id'];}return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x168c49[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](function(_0x4b2504){if(!_0x4b2504)return null;if(_0x4b2504['id']===_0x168c49[_0x27ea('0x2f')]['id']){if(!_0x168c49[_0x27ea('0x63')]['oldPassword']||!_0x168c49[_0x27ea('0x63')][_0x27ea('0x95')]){throw new db[(_0x27ea('0x96'))]['ValidationError'](_0x27ea('0x97'));}if(!_0x4b2504['authenticate'](_0x168c49[_0x27ea('0x63')][_0x27ea('0x98')])){throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))]('Wrong\x20credentials');}if(_0x168c49[_0x27ea('0x63')]['oldPassword']===_0x168c49[_0x27ea('0x63')][_0x27ea('0x95')]){throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))](_0x27ea('0x9a'));}}else if(_0x168c49[_0x27ea('0x2f')][_0x27ea('0x38')]===_0x27ea('0x86')){if(!_0x168c49['body']['newPassword']){throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))](_0x27ea('0x9b'));}}else if(_0x168c49['user']['role']===_0x27ea('0x2f')){if(!_0x168c49[_0x27ea('0x63')][_0x27ea('0x95')]){throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))](_0x27ea('0x9b'));}if(_0x4b2504[_0x27ea('0x38')]!==_0x27ea('0x31')){throw new db['Sequelize'][(_0x27ea('0x99'))](_0x27ea('0x84'));}}else{throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))](_0x27ea('0x84'));}return _0x4b2504;})[_0x27ea('0x16')](handleEntityNotFound(_0x1efa7f,null))['then'](function(_0x3655dd){return db['Setting']['findOne']({'attributes':['id',_0x27ea('0x69'),_0x27ea('0x9c'),_0x27ea('0x9d')]})[_0x27ea('0x16')](function(_0x2abb14){if(_0x2abb14[_0x27ea('0x69')])authService[_0x27ea('0x6a')](_0x168c49[_0x27ea('0x63')][_0x27ea('0x95')]);if(!_0x2abb14[_0x27ea('0x9c')]||!_0x3655dd[_0x27ea('0x9e')])return _0x3655dd;authService[_0x27ea('0x9f')](_0x168c49['body'][_0x27ea('0x95')],_0x3655dd[_0x27ea('0x9e')],_0x2abb14[_0x27ea('0x9d')]);return _0x3655dd;})[_0x27ea('0x16')](saveUpdates({'password':_0x168c49[_0x27ea('0x63')]['newPassword'],'passwordResetAt':_0x168c49[_0x27ea('0x2f')]['id']==_0x168c49[_0x27ea('0x65')]['id']?moment():null,'previousPasswords':authService[_0x27ea('0xa0')](_0x168c49['body'][_0x27ea('0x95')],_0x3655dd[_0x27ea('0x9e')])},null));})[_0x27ea('0x16')](respondWithResult(_0x1efa7f,null))['catch'](handleError(_0x1efa7f,null));};exports[_0x27ea('0xa1')]=function(_0x16db0f,_0x7bfe48){var _0x222e26=_0x16db0f[_0x27ea('0x63')][_0x27ea('0xa2')];return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x16db0f[_0x27ea('0x65')]['id']},'attributes':['id',_0x27ea('0x3a'),'role',_0x27ea('0xa3'),_0x27ea('0xa4'),_0x27ea('0xa5'),_0x27ea('0xa6')]})[_0x27ea('0x16')](handleEntityNotFound(_0x7bfe48,null))[_0x27ea('0x16')](function(_0x278e40){if(_0x278e40){if(!utils[_0x27ea('0xa7')](_0x222e26)){throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))](_0x27ea('0xa8'));}return _0x278e40[_0x27ea('0xa9')+_[_0x27ea('0xaa')](_0x222e26['toLowerCase']())+_0x27ea('0xab')](_0x16db0f[_0x27ea('0x63')][_0x27ea('0x66')],{'penalty':_0x16db0f[_0x27ea('0x63')][_0x27ea('0xac')]||0x0})['spread'](function(_0x1204da){for(var _0x30f4e0=0x0;_0x30f4e0<_0x16db0f['body']['ids'][_0x27ea('0x50')];_0x30f4e0+=0x1){var _0x3df7f7={'UserId':Number(_0x16db0f[_0x27ea('0x65')]['id'])};_0x3df7f7[_[_0x27ea('0xaa')](_0x222e26[_0x27ea('0xad')]())+'QueueId']=Number(_0x16db0f[_0x27ea('0x63')][_0x27ea('0x66')][_0x30f4e0]);socket[_0x27ea('0x2b')](_0x27ea('0x2f')+_['capitalize'](_0x222e26[_0x27ea('0xad')]())+'Queue:save',_0x3df7f7);}return _0x1204da;})[_0x27ea('0x16')](function(){if(_0x222e26===_0x27ea('0xae')){return db[_0x27ea('0xaf')][_0x27ea('0x4d')]({'where':{'id':_0x16db0f[_0x27ea('0x63')][_0x27ea('0x66')]||[]},'raw':!![],'attributes':['id',_0x27ea('0x3a')]});}})[_0x27ea('0x16')](function(_0x5e9006){var _0x132758=_0x278e40['get']({'plain':!![]});var _0x43cb5c=[];if(_0x222e26==='voice'&&_0x132758['role']==='agent'&&_0x132758['online']){for(let _0x46477e=0x0;_0x46477e<_0x5e9006[_0x27ea('0x50')];_0x46477e+=0x1){_0x43cb5c[_0x27ea('0x4c')]({'membername':_0x132758[_0x27ea('0x3a')],'UserId':_0x132758['id'],'queue_name':_0x5e9006[_0x46477e][_0x27ea('0x3a')],'VoiceQueueId':_0x5e9006[_0x46477e]['id'],'interface':_[_0x27ea('0x6d')](_0x132758['interface'])?util['format']('SIP/%s',_0x132758['name']):_0x132758[_0x27ea('0xa6')],'paused':_0x132758['voicePause']||![],'penalty':_0x16db0f[_0x27ea('0x63')][_0x27ea('0xac')]||0x0});}return Promise[_0x27ea('0x58')](_0x43cb5c[_0x27ea('0x35')](function(_0x5dd363){return db['UserVoiceQueueRt'][_0x27ea('0xb0')](_0x5dd363);}));}return _0x278e40;});}})[_0x27ea('0x16')](respondWithStatusCode(_0x7bfe48,null))[_0x27ea('0x21')](handleError(_0x7bfe48,null));};exports[_0x27ea('0xb1')]=function(_0x71d212,_0x5a31ec){var _0x5a2210,_0x4c6ec3;return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x71d212[_0x27ea('0x65')]['id']},'attributes':['id',_0x27ea('0x3a'),_0x27ea('0x38')]})['then'](handleEntityNotFound(_0x5a31ec,null))[_0x27ea('0x16')](function(_0xc83ff7){if(_0xc83ff7){_0x5a2210=_0xc83ff7;if(!_0x71d212[_0x27ea('0x46')][_0x27ea('0xa2')]||!utils[_0x27ea('0xa7')](_0x71d212[_0x27ea('0x46')][_0x27ea('0xa2')])){throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))](_0x27ea('0xa8'));}return _0xc83ff7[_0x27ea('0xb2')+_[_0x27ea('0xaa')](_0x71d212[_0x27ea('0x46')][_0x27ea('0xa2')][_0x27ea('0xad')]())+_0x27ea('0xab')](_0x71d212[_0x27ea('0x46')]['ids']);}})[_0x27ea('0x16')](function(_0x287571){if(_[_0x27ea('0xb3')](_0x71d212[_0x27ea('0x46')][_0x27ea('0x66')])){for(var _0x41c3fe=0x0;_0x41c3fe<_0x71d212['query'][_0x27ea('0x66')][_0x27ea('0x50')];_0x41c3fe+=0x1){_0x4c6ec3={'UserId':Number(_0x71d212[_0x27ea('0x65')]['id'])};_0x4c6ec3[_['capitalize'](_0x71d212[_0x27ea('0x46')][_0x27ea('0xa2')][_0x27ea('0xad')]())+_0x27ea('0xb4')]=Number(_0x71d212[_0x27ea('0x46')][_0x27ea('0x66')][_0x41c3fe]);socket[_0x27ea('0x2b')](_0x27ea('0x2f')+_['capitalize'](_0x71d212[_0x27ea('0x46')][_0x27ea('0xa2')][_0x27ea('0xad')]())+'Queue:remove',_0x4c6ec3);}}else{_0x4c6ec3={'UserId':Number(_0x71d212['params']['id'])};_0x4c6ec3[_[_0x27ea('0xaa')](_0x71d212[_0x27ea('0x46')][_0x27ea('0xa2')]['toLowerCase']())+_0x27ea('0xb4')]=Number(_0x71d212[_0x27ea('0x46')][_0x27ea('0x66')]);socket['emit'](_0x27ea('0x2f')+_[_0x27ea('0xaa')](_0x71d212[_0x27ea('0x46')][_0x27ea('0xa2')][_0x27ea('0xad')]())+_0x27ea('0xb5'),_0x4c6ec3);}return _0x287571;})['then'](function(){if(_0x71d212[_0x27ea('0x46')][_0x27ea('0xa2')]==='voice'){return db[_0x27ea('0xb6')][_0x27ea('0x2c')]({'where':{'UserId':_0x71d212[_0x27ea('0x65')]['id'],'VoiceQueueId':_0x71d212[_0x27ea('0x46')][_0x27ea('0x66')]},'individualHooks':!![]})['then'](function(){return _0x5a2210;});}return _0x5a2210;})['then'](respondWithStatusCode(_0x5a31ec,null))['catch'](handleError(_0x5a31ec,null));};exports['addAvatar']=function(_0x341acb,_0x27a9d2){_0x341acb[_0x27ea('0x63')][_0x27ea('0xb7')]=_0x341acb[_0x27ea('0xb8')][_0x27ea('0xb9')];return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x341acb[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x27a9d2,null))[_0x27ea('0x16')](saveUpdates(_0x341acb[_0x27ea('0x63')],null))[_0x27ea('0x16')](respondWithResult(_0x27a9d2,null))[_0x27ea('0x21')](handleError(_0x27a9d2,null));};exports[_0x27ea('0xba')]=function(_0x2dc3aa,_0x238e3d){var _0x28e911=path[_0x27ea('0xbb')](config[_0x27ea('0xbc')],_0x27ea('0xbd'));return db['User'][_0x27ea('0x39')]({'where':{'id':_0x2dc3aa[_0x27ea('0x65')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x27ea('0x16')](handleEntityNotFound(_0x238e3d,null))[_0x27ea('0x16')](function(_0x4ba393){if(_0x4ba393){if(_['isNil'](_0x4ba393['userpic'])){return _0x238e3d[_0x27ea('0xbe')](_0x28e911);}else{if(!fs[_0x27ea('0xbf')](path[_0x27ea('0xbb')](config[_0x27ea('0xbc')],_0x27ea('0xc0'),_0x4ba393[_0x27ea('0xb7')]))){return _0x238e3d[_0x27ea('0xbe')](_0x28e911);}return _0x238e3d['download'](path[_0x27ea('0xbb')](config['root'],_0x27ea('0xc0'),_0x4ba393[_0x27ea('0xb7')]));}}})[_0x27ea('0x21')](handleError(_0x238e3d,null));};exports[_0x27ea('0xc1')]=function(_0x6da27e,_0x269def){return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x6da27e[_0x27ea('0x65')]['id']},'attributes':['id']})[_0x27ea('0x16')](handleEntityNotFound(_0x269def,null))[_0x27ea('0x16')](function(_0x8fcb09){var _0x544130=[];values=_0x8fcb09[_0x27ea('0x54')];_0x544130[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x51'),_0x8fcb09[_0x27ea('0x54')]));_0x544130[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x52'),_0x8fcb09[_0x27ea('0x54')]));_0x544130[_0x27ea('0x4c')](get_open_tabs('openchannel',_0x8fcb09['dataValues']));_0x544130[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x57'),_0x8fcb09[_0x27ea('0x54')]));_0x544130[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x53'),_0x8fcb09[_0x27ea('0x54')]));_0x544130[_0x27ea('0x4c')](get_open_tabs(_0x27ea('0x55'),_0x8fcb09['dataValues']));return Promise[_0x27ea('0x58')](_0x544130);})[_0x27ea('0x16')](function(_0xe67d30){if(_0xe67d30){var _0x4a977b=_[_0x27ea('0x35')](values[_0x27ea('0xc2')],function(_0x283626){return{'channel':_0x27ea('0xc3'),'id':_0x283626['id'],'createdAt':_0x283626[_0x27ea('0xc4')]};});var _0x242210=_['map'](values[_0x27ea('0xc5')],function(_0x3abf2a){return{'channel':_0x27ea('0xc6'),'id':_0x3abf2a['id'],'createdAt':_0x3abf2a[_0x27ea('0xc4')]};});var _0x170e42=_[_0x27ea('0x35')](values['OpenchannelOpenTabs'],function(_0x284faf){return{'channel':_0x27ea('0xc7'),'id':_0x284faf['id'],'createdAt':_0x284faf[_0x27ea('0xc4')]};});var _0x4e0659=_[_0x27ea('0x35')](values[_0x27ea('0xc8')],function(_0x205845){return{'channel':'MAIL','id':_0x205845['id'],'createdAt':_0x205845[_0x27ea('0xc4')]};});var _0x2e0571=_[_0x27ea('0x35')](values[_0x27ea('0xc9')],function(_0xe3110d){return{'channel':'SMS','id':_0xe3110d['id'],'createdAt':_0xe3110d[_0x27ea('0xc4')]};});var _0x486866=_[_0x27ea('0x35')](values[_0x27ea('0xca')],function(_0x56ca37){return{'channel':_0x27ea('0xcb'),'id':_0x56ca37['id'],'createdAt':_0x56ca37['createdAt']};});var _0x15f4c9=_['concat'](_0x4a977b,_0x242210,_0x170e42,_0x4e0659,_0x2e0571,_0x486866);var _0x2a7251={'count':_0x15f4c9[_0x27ea('0x50')],'rows':_0x15f4c9};return _0x2a7251;}else return null;})[_0x27ea('0x16')](respondWithResult(_0x269def,null))['catch'](handleError(_0x269def,null));};exports[_0x27ea('0xcc')]=function(_0x5dbf0f,_0x5c8766){var _0x784072={};var _0x1d7813={};var _0x18d1e7;var _0xb4ee43;return db[_0x27ea('0x44')]['findOne']({'where':{'id':_0x5dbf0f[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x5c8766,null))[_0x27ea('0x16')](function(_0x4cec64){if(_0x4cec64){_0x18d1e7=_0x4cec64;_0x1d7813[_0x27ea('0x5a')]=_[_0x27ea('0x5c')](db[_0x27ea('0xcd')]['rawAttributes']);_0x1d7813[_0x27ea('0x46')]=_[_0x27ea('0x5c')](_0x5dbf0f[_0x27ea('0x46')]);_0x1d7813[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x1d7813[_0x27ea('0x5a')],_0x1d7813[_0x27ea('0x46')]);_0x784072[_0x27ea('0x4b')]=_['intersection'](_0x1d7813[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x5dbf0f['query'][_0x27ea('0x5f')]));_0x784072[_0x27ea('0x4b')]=_0x784072[_0x27ea('0x4b')][_0x27ea('0x50')]?_0x784072[_0x27ea('0x4b')]:_0x1d7813[_0x27ea('0x5a')];_0x784072[_0x27ea('0xce')]=qs['sort'](_0x5dbf0f[_0x27ea('0x46')]['sort']);_0x784072[_0x27ea('0x43')]=qs['filters'](_[_0x27ea('0xcf')](_0x5dbf0f[_0x27ea('0x46')],_0x1d7813[_0x27ea('0x5d')]));if(_0x5dbf0f[_0x27ea('0x46')][_0x27ea('0x33')]){_0x784072['where']=_[_0x27ea('0x61')](_0x784072['where'],{'$or':_['map'](_0x784072[_0x27ea('0x4b')],function(_0x5a34ee){var _0x535b7d={};_0x535b7d[_0x5a34ee]={'$like':'%'+_0x5dbf0f['query']['filter']+'%'};return _0x535b7d;})});}_0x784072=_['merge']({},_0x784072,_0x5dbf0f[_0x27ea('0x62')]);return _0x18d1e7[_0x27ea('0xcc')](_0x784072);}})[_0x27ea('0x16')](function(_0x2cc8b1){if(_0x2cc8b1){_0xb4ee43=_0x2cc8b1[_0x27ea('0x50')];if(_0x5dbf0f['query'][_0x27ea('0xd0')](_0x27ea('0x47'))){_0x784072[_0x27ea('0x49')]=[{'model':db[_0x27ea('0xd1')],'as':'List','required':![]},{'model':db[_0x27ea('0xd2')],'as':'Tags','attributes':['id','name',_0x27ea('0xd3')],'where':_0x5dbf0f['query'][_0x27ea('0xd4')]?{'id':_0x5dbf0f[_0x27ea('0x46')][_0x27ea('0xd4')]}:undefined,'required':_0x5dbf0f[_0x27ea('0x46')][_0x27ea('0xd4')]?!![]:![]}];}if(!_0x5dbf0f[_0x27ea('0x46')]['hasOwnProperty'](_0x27ea('0xd5'))){_0x784072[_0x27ea('0x27')]=qs['limit'](_0x5dbf0f[_0x27ea('0x46')][_0x27ea('0x27')]);_0x784072[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x5dbf0f[_0x27ea('0x46')][_0x27ea('0x25')]);}return _0x18d1e7['getContacts'](_0x784072);}})[_0x27ea('0x16')](function(_0x406925){if(_0x406925){return _0x406925?{'count':_0xb4ee43,'rows':_0x406925}:null;}})[_0x27ea('0x16')](respondWithResult(_0x5c8766,null))[_0x27ea('0x21')](handleError(_0x5c8766,null));};exports[_0x27ea('0xd6')]=function(_0x2cd5d5,_0x3ac84e){var _0x166a36;var _0x1bd6d2={};var _0x464b6b;return db['User'][_0x27ea('0xd7')]({'where':{'id':_0x2cd5d5['params']['id']},'attributes':['id',_0x27ea('0x3a'),_0x27ea('0x38')]})['then'](handleEntityNotFound(_0x3ac84e,null))[_0x27ea('0x16')](function(_0x232166){if(!utils[_0x27ea('0xa7')](_0x2cd5d5[_0x27ea('0x46')][_0x27ea('0xa2')])){throw new db['Sequelize']['ValidationError'](_0x27ea('0xa8'));}_0x166a36=_0x232166;var _0x2a428c={};_0x2a428c['model']=_['keys'](db[_[_0x27ea('0xaa')](_0x2cd5d5[_0x27ea('0x46')][_0x27ea('0xa2')])+'Queue'][_0x27ea('0xd8')]);_0x2a428c[_0x27ea('0x46')]=_[_0x27ea('0x5c')](_0x2cd5d5['query']);_0x2a428c[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x2a428c[_0x27ea('0x5a')],_0x2a428c['query']);_0x1bd6d2[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x2a428c[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x2cd5d5[_0x27ea('0x46')]['fields']));_0x1bd6d2['attributes']=_0x1bd6d2[_0x27ea('0x4b')][_0x27ea('0x50')]?_0x1bd6d2[_0x27ea('0x4b')]:_0x2a428c['model'];_0x1bd6d2[_0x27ea('0xce')]=qs[_0x27ea('0xd9')](_0x2cd5d5['query'][_0x27ea('0xd9')]);_0x1bd6d2['where']=qs['filters'](_[_0x27ea('0xcf')](_0x2cd5d5[_0x27ea('0x46')],_0x2a428c[_0x27ea('0x5d')]));if(_0x2cd5d5[_0x27ea('0x46')][_0x27ea('0x33')]){_0x1bd6d2['where']=_[_0x27ea('0x61')](_0x1bd6d2[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0x1bd6d2[_0x27ea('0x4b')],function(_0x18bfe7){var _0x5a7e2c={};_0x5a7e2c[_0x18bfe7]={'$like':'%'+_0x2cd5d5['query'][_0x27ea('0x33')]+'%'};return _0x5a7e2c;})});}_0x1bd6d2=_[_0x27ea('0x61')]({},_0x1bd6d2,_0x2cd5d5[_0x27ea('0x62')]);switch(_0x166a36['role']){case _0x27ea('0x86'):return db[_[_0x27ea('0xaa')](_0x2cd5d5[_0x27ea('0x46')][_0x27ea('0xa2')])+_0x27ea('0xda')][_0x27ea('0x4d')](_0x1bd6d2);case _0x27ea('0x2f'):case'agent':return _0x166a36['get'+_[_0x27ea('0xaa')](_0x2cd5d5[_0x27ea('0x46')][_0x27ea('0xa2')])+_0x27ea('0xab')](_0x1bd6d2);default:throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))]('Unknown\x20role');}})[_0x27ea('0x16')](function(_0x36279f){_0x464b6b=_0x36279f[_0x27ea('0x50')];if(!_0x2cd5d5['query'][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0x1bd6d2[_0x27ea('0x27')]=qs['limit'](_0x2cd5d5['query']['limit']);_0x1bd6d2[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x2cd5d5[_0x27ea('0x46')][_0x27ea('0x25')]);}switch(_0x166a36[_0x27ea('0x38')]){case'admin':return db[_['capitalize'](_0x2cd5d5['query'][_0x27ea('0xa2')])+_0x27ea('0xda')][_0x27ea('0x4d')](_0x1bd6d2);case'user':case'agent':return _0x166a36[_0x27ea('0x2d')+_['capitalize'](_0x2cd5d5[_0x27ea('0x46')][_0x27ea('0xa2')])+_0x27ea('0xab')](_0x1bd6d2);}})[_0x27ea('0x16')](function(_0x2bc259){return{'count':_0x464b6b,'rows':_0x2bc259};})[_0x27ea('0x16')](respondWithResult(_0x3ac84e,null))[_0x27ea('0x21')](handleError(_0x3ac84e,null));};exports[_0x27ea('0xdb')]=function(_0x3a825d,_0x377377){var _0x1f0ac8={};var _0x95f244={};var _0x4e5932;var _0x4d79cf;return db[_0x27ea('0x44')][_0x27ea('0xd7')]({'where':{'id':_0x3a825d[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x377377,null))[_0x27ea('0x16')](function(_0x13e504){if(_0x13e504){_0x4e5932=_0x13e504;_0x95f244[_0x27ea('0x5a')]=_['keys'](db[_0x27ea('0xb6')][_0x27ea('0xd8')]);_0x95f244['query']=_['keys'](_0x3a825d['query']);_0x95f244[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x95f244[_0x27ea('0x5a')],_0x95f244['query']);_0x1f0ac8[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x95f244[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x3a825d['query']['fields']));_0x1f0ac8[_0x27ea('0x4b')]=_0x1f0ac8['attributes']['length']?_0x1f0ac8['attributes']:_0x95f244['model'];_0x1f0ac8[_0x27ea('0xce')]=qs['sort'](_0x3a825d[_0x27ea('0x46')][_0x27ea('0xd9')]);_0x1f0ac8[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x3a825d[_0x27ea('0x46')],_0x95f244[_0x27ea('0x5d')]));if(_0x3a825d[_0x27ea('0x46')][_0x27ea('0x33')]){_0x1f0ac8[_0x27ea('0x43')]=_[_0x27ea('0x61')](_0x1f0ac8[_0x27ea('0x43')],{'$or':_['map'](_0x1f0ac8[_0x27ea('0x4b')],function(_0x394f5a){var _0x47f88d={};_0x47f88d[_0x394f5a]={'$like':'%'+_0x3a825d[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x47f88d;})});}_0x1f0ac8=_[_0x27ea('0x61')]({},_0x1f0ac8,_0x3a825d[_0x27ea('0x62')]);return _0x4e5932['getVoiceQueuesRt'](_0x1f0ac8);}})[_0x27ea('0x16')](function(_0x2bf676){if(_0x2bf676){_0x4d79cf=_0x2bf676[_0x27ea('0x50')];if(!_0x3a825d[_0x27ea('0x46')][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0x1f0ac8[_0x27ea('0x27')]=qs[_0x27ea('0x27')](_0x3a825d[_0x27ea('0x46')][_0x27ea('0x27')]);_0x1f0ac8[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x3a825d[_0x27ea('0x46')][_0x27ea('0x25')]);}return _0x4e5932[_0x27ea('0xdb')](_0x1f0ac8);}})[_0x27ea('0x16')](function(_0x3002b3){if(_0x3002b3){return _0x3002b3?{'count':_0x4d79cf,'rows':_0x3002b3}:null;}})['then'](respondWithResult(_0x377377,null))[_0x27ea('0x21')](handleError(_0x377377,null));};exports[_0x27ea('0xdc')]=function(_0x4e0c6a,_0x958955){var _0x374431={};var _0x3a099c={};var _0x2fa338;var _0x1b6480;return db[_0x27ea('0x44')][_0x27ea('0xd7')]({'where':{'id':_0x4e0c6a[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x958955,null))['then'](function(_0x2f4dea){if(_0x2f4dea){_0x2fa338=_0x2f4dea;_0x3a099c[_0x27ea('0x5a')]=_[_0x27ea('0x5c')](db['ChatGroup']['rawAttributes']);_0x3a099c[_0x27ea('0x46')]=_[_0x27ea('0x5c')](_0x4e0c6a[_0x27ea('0x46')]);_0x3a099c[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x3a099c[_0x27ea('0x5a')],_0x3a099c[_0x27ea('0x46')]);_0x374431[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x3a099c['model'],qs[_0x27ea('0x5f')](_0x4e0c6a[_0x27ea('0x46')]['fields']));_0x374431[_0x27ea('0x4b')]=_0x374431[_0x27ea('0x4b')][_0x27ea('0x50')]?_0x374431[_0x27ea('0x4b')]:_0x3a099c['model'];_0x374431[_0x27ea('0xce')]=qs['sort'](_0x4e0c6a['query'][_0x27ea('0xd9')]);_0x374431['where']=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x4e0c6a[_0x27ea('0x46')],_0x3a099c['filters']));if(_0x4e0c6a['query']['filter']){_0x374431['where']=_['merge'](_0x374431[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0x374431['attributes'],function(_0x518122){var _0x5a7c93={};_0x5a7c93[_0x518122]={'$like':'%'+_0x4e0c6a['query']['filter']+'%'};return _0x5a7c93;})});}_0x374431=_[_0x27ea('0x61')]({},_0x374431,_0x4e0c6a[_0x27ea('0x62')]);return _0x2fa338[_0x27ea('0xdc')](_0x374431);}})[_0x27ea('0x16')](function(_0x54ee69){if(_0x54ee69){_0x1b6480=_0x54ee69[_0x27ea('0x50')];if(!_0x4e0c6a[_0x27ea('0x46')][_0x27ea('0xd0')]('nolimit')){_0x374431[_0x27ea('0x27')]=qs[_0x27ea('0x27')](_0x4e0c6a['query'][_0x27ea('0x27')]);_0x374431['offset']=qs[_0x27ea('0x25')](_0x4e0c6a[_0x27ea('0x46')]['offset']);}return _0x2fa338[_0x27ea('0xdc')](_0x374431);}})[_0x27ea('0x16')](function(_0x5c6deb){if(_0x5c6deb){return _0x5c6deb?{'count':_0x1b6480,'rows':_0x5c6deb}:null;}})[_0x27ea('0x16')](respondWithResult(_0x958955,null))[_0x27ea('0x21')](handleError(_0x958955,null));};exports['getRecordings']=function(_0x399ade,_0x316fe3){var _0x1ca989={'raw':!![],'where':{}};var _0x579c2d={};var _0x242fa2={'count':0x0,'rows':[]};return db[_0x27ea('0x44')]['findOne']({'where':{'id':_0x399ade[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x316fe3,null))[_0x27ea('0x16')](function(_0x2686e6){if(_0x2686e6){_0x579c2d['model']=_['keys'](db[_0x27ea('0xdd')][_0x27ea('0xd8')]);_0x579c2d['query']=_[_0x27ea('0x5c')](_0x399ade[_0x27ea('0x46')]);_0x579c2d[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x579c2d[_0x27ea('0x5a')],_0x579c2d[_0x27ea('0x46')]);_0x1ca989[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x579c2d[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x399ade['query'][_0x27ea('0x5f')]));_0x1ca989[_0x27ea('0x4b')]=_0x1ca989[_0x27ea('0x4b')]['length']?_0x1ca989['attributes']:_0x579c2d[_0x27ea('0x5a')];if(!_0x399ade[_0x27ea('0x46')][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0x1ca989['limit']=qs[_0x27ea('0x27')](_0x399ade[_0x27ea('0x46')][_0x27ea('0x27')]);_0x1ca989[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x399ade[_0x27ea('0x46')]['offset']);}_0x1ca989[_0x27ea('0xce')]=qs[_0x27ea('0xd9')](_0x399ade['query'][_0x27ea('0xd9')]);_0x1ca989[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_['pick'](_0x399ade['query'],_0x579c2d['filters']));_0x1ca989[_0x27ea('0x43')][_0x27ea('0xde')]=_0x2686e6['id'];if(_0x399ade[_0x27ea('0x46')]['filter']){_0x1ca989[_0x27ea('0x43')]=_[_0x27ea('0x61')](_0x1ca989[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0x1ca989[_0x27ea('0x4b')],function(_0x225a9e){var _0x1eb5a6={};_0x1eb5a6[_0x225a9e]={'$like':'%'+_0x399ade[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x1eb5a6;})});}_0x1ca989=_[_0x27ea('0x61')]({},_0x1ca989,_0x399ade[_0x27ea('0x62')]);return db[_0x27ea('0xdd')][_0x27ea('0x45')]({'where':_0x1ca989['where']})['then'](function(_0x42e2ae){_0x242fa2['count']=_0x42e2ae;if(_0x399ade[_0x27ea('0x46')]['includeAll']){_0x1ca989[_0x27ea('0x49')]=[{'all':!![]}];}return db[_0x27ea('0xdd')][_0x27ea('0x4d')](_0x1ca989);})[_0x27ea('0x16')](function(_0x36e448){_0x242fa2[_0x27ea('0x4e')]=_0x36e448;return _0x242fa2;});}})[_0x27ea('0x16')](respondWithFilteredResult(_0x316fe3,_0x1ca989))[_0x27ea('0x21')](handleError(_0x316fe3,null));};exports[_0x27ea('0xdf')]=function(_0x36fd0f,_0x53463b){var _0x46de25={'raw':!![],'where':{}};var _0x535e0c={};var _0x219513={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x36fd0f[_0x27ea('0x65')]['id']}})['then'](handleEntityNotFound(_0x53463b,null))[_0x27ea('0x16')](function(_0xf6e042){if(_0xf6e042){_0x535e0c[_0x27ea('0x5a')]=_['keys'](db[_0x27ea('0xe0')][_0x27ea('0xd8')]);_0x535e0c[_0x27ea('0x46')]=_[_0x27ea('0x5c')](_0x36fd0f[_0x27ea('0x46')]);_0x535e0c[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x535e0c[_0x27ea('0x5a')],_0x535e0c[_0x27ea('0x46')]);_0x46de25[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x535e0c[_0x27ea('0x5a')],qs['fields'](_0x36fd0f[_0x27ea('0x46')][_0x27ea('0x5f')]));_0x46de25[_0x27ea('0x4b')]=_0x46de25[_0x27ea('0x4b')][_0x27ea('0x50')]?_0x46de25[_0x27ea('0x4b')]:_0x535e0c[_0x27ea('0x5a')];if(!_0x36fd0f[_0x27ea('0x46')][_0x27ea('0xd0')]('nolimit')){_0x46de25[_0x27ea('0x27')]=qs[_0x27ea('0x27')](_0x36fd0f['query'][_0x27ea('0x27')]);_0x46de25[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x36fd0f[_0x27ea('0x46')][_0x27ea('0x25')]);}_0x46de25['order']=qs[_0x27ea('0xd9')](_0x36fd0f[_0x27ea('0x46')][_0x27ea('0xd9')]);_0x46de25[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x36fd0f[_0x27ea('0x46')],_0x535e0c[_0x27ea('0x5d')]));_0x46de25[_0x27ea('0x43')][_0x27ea('0xde')]=_0xf6e042['id'];if(_0x36fd0f['query']['filter']){_0x46de25[_0x27ea('0x43')]=_['merge'](_0x46de25[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0x46de25['attributes'],function(_0x2d81c9){var _0x167b3d={};_0x167b3d[_0x2d81c9]={'$like':'%'+_0x36fd0f[_0x27ea('0x46')]['filter']+'%'};return _0x167b3d;})});}_0x46de25=_[_0x27ea('0x61')]({},_0x46de25,_0x36fd0f[_0x27ea('0x62')]);return db['ScreenRecording'][_0x27ea('0x45')]({'where':_0x46de25[_0x27ea('0x43')]})[_0x27ea('0x16')](function(_0x18d3fe){_0x219513[_0x27ea('0x45')]=_0x18d3fe;if(_0x36fd0f[_0x27ea('0x46')]['includeAll']){_0x46de25['include']=[{'all':!![]}];}return db[_0x27ea('0xe0')][_0x27ea('0x4d')](_0x46de25);})[_0x27ea('0x16')](function(_0x2f9301){_0x219513['rows']=_0x2f9301;return _0x219513;});}})[_0x27ea('0x16')](respondWithFilteredResult(_0x53463b,_0x46de25))[_0x27ea('0x21')](handleError(_0x53463b,null));};exports[_0x27ea('0xe1')]=function(_0x5c6c2c,_0x10ee6a){var _0x4613dd={};var _0x14c1e2={};var _0x3cec91;var _0x25ca5f;return db[_0x27ea('0x44')]['findOne']({'where':{'id':_0x5c6c2c[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x10ee6a,null))[_0x27ea('0x16')](function(_0x42e4e6){if(_0x42e4e6){_0x3cec91=_0x42e4e6;_0x14c1e2[_0x27ea('0x5a')]=_[_0x27ea('0x5c')](db[_0x27ea('0xe2')][_0x27ea('0xd8')]);_0x14c1e2[_0x27ea('0x46')]=_[_0x27ea('0x5c')](_0x5c6c2c[_0x27ea('0x46')]);_0x14c1e2[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x14c1e2[_0x27ea('0x5a')],_0x14c1e2[_0x27ea('0x46')]);_0x4613dd[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x14c1e2[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x5c6c2c[_0x27ea('0x46')][_0x27ea('0x5f')]));_0x4613dd[_0x27ea('0x4b')]=_0x4613dd[_0x27ea('0x4b')][_0x27ea('0x50')]?_0x4613dd[_0x27ea('0x4b')]:_0x14c1e2['model'];_0x4613dd[_0x27ea('0xce')]=qs[_0x27ea('0xd9')](_0x5c6c2c['query']['sort']);_0x4613dd[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x5c6c2c[_0x27ea('0x46')],_0x14c1e2['filters']));if(_0x5c6c2c[_0x27ea('0x46')][_0x27ea('0x33')]){_0x4613dd[_0x27ea('0x43')]=_[_0x27ea('0x61')](_0x4613dd[_0x27ea('0x43')],{'$or':_['map'](_0x4613dd[_0x27ea('0x4b')],function(_0x5e7bf0){var _0x35ebcc={};_0x35ebcc[_0x5e7bf0]={'$like':'%'+_0x5c6c2c[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x35ebcc;})});}_0x4613dd=_[_0x27ea('0x61')]({},_0x4613dd,_0x5c6c2c['options']);return _0x3cec91[_0x27ea('0xe1')](_0x4613dd);}})[_0x27ea('0x16')](function(_0x5ec2f7){if(_0x5ec2f7){_0x25ca5f=_0x5ec2f7[_0x27ea('0x50')];if(!_0x5c6c2c['query'][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0x4613dd[_0x27ea('0x27')]=qs[_0x27ea('0x27')](_0x5c6c2c[_0x27ea('0x46')]['limit']);_0x4613dd[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x5c6c2c[_0x27ea('0x46')][_0x27ea('0x25')]);}return _0x3cec91[_0x27ea('0xe1')](_0x4613dd);}})['then'](function(_0x404ddb){if(_0x404ddb){return _0x404ddb?{'count':_0x25ca5f,'rows':_0x404ddb}:null;}})[_0x27ea('0x16')](respondWithResult(_0x10ee6a,null))['catch'](handleError(_0x10ee6a,null));};exports[_0x27ea('0xe3')]=function(_0x2d8e5d,_0x58cd09){var _0x19a94d={};var _0x52d008={};var _0x56300e;var _0x30f6ba;return db[_0x27ea('0x44')][_0x27ea('0xd7')]({'where':{'id':_0x2d8e5d['params']['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x58cd09,null))[_0x27ea('0x16')](function(_0x2fbbcd){if(_0x2fbbcd){_0x56300e=_0x2fbbcd;_0x52d008[_0x27ea('0x5a')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x52d008[_0x27ea('0x46')]=_['keys'](_0x2d8e5d[_0x27ea('0x46')]);_0x52d008[_0x27ea('0x5d')]=_['intersection'](_0x52d008[_0x27ea('0x5a')],_0x52d008[_0x27ea('0x46')]);_0x19a94d[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x52d008[_0x27ea('0x5a')],qs['fields'](_0x2d8e5d[_0x27ea('0x46')][_0x27ea('0x5f')]));_0x19a94d['attributes']=_0x19a94d['attributes'][_0x27ea('0x50')]?_0x19a94d[_0x27ea('0x4b')]:_0x52d008['model'];_0x19a94d[_0x27ea('0xce')]=qs[_0x27ea('0xd9')](_0x2d8e5d[_0x27ea('0x46')]['sort']);_0x19a94d[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_['pick'](_0x2d8e5d['query'],_0x52d008['filters']));if(_0x2d8e5d[_0x27ea('0x46')][_0x27ea('0x33')]){_0x19a94d['where']=_[_0x27ea('0x61')](_0x19a94d[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0x19a94d['attributes'],function(_0x621d36){var _0x2a4b99={};_0x2a4b99[_0x621d36]={'$like':'%'+_0x2d8e5d[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x2a4b99;})});}_0x19a94d=_[_0x27ea('0x61')]({},_0x19a94d,_0x2d8e5d[_0x27ea('0x62')]);return _0x56300e[_0x27ea('0xe3')](_0x19a94d);}})[_0x27ea('0x16')](function(_0x3ba794){if(_0x3ba794){_0x30f6ba=_0x3ba794[_0x27ea('0x50')];if(!_0x2d8e5d[_0x27ea('0x46')][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0x19a94d['limit']=qs[_0x27ea('0x27')](_0x2d8e5d[_0x27ea('0x46')][_0x27ea('0x27')]);_0x19a94d[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x2d8e5d[_0x27ea('0x46')][_0x27ea('0x25')]);}return _0x56300e[_0x27ea('0xe3')](_0x19a94d);}})['then'](function(_0x2deb4b){if(_0x2deb4b){return _0x2deb4b?{'count':_0x30f6ba,'rows':_0x2deb4b}:null;}})[_0x27ea('0x16')](respondWithResult(_0x58cd09,null))['catch'](handleError(_0x58cd09,null));};exports['getMailInteractions']=function(_0x27fe57,_0x1787c0){var _0x26b354={'raw':!![],'where':{}};var _0x16cb6c={};var _0x4cfd8b={'count':0x0,'rows':[]};return db[_0x27ea('0x44')][_0x27ea('0xd7')]({'where':{'id':_0x27fe57[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x1787c0,null))[_0x27ea('0x16')](function(_0x3ac067){if(_0x3ac067){_0x16cb6c[_0x27ea('0x5a')]=_[_0x27ea('0x5c')](db[_0x27ea('0xe4')][_0x27ea('0xd8')]);_0x16cb6c[_0x27ea('0x46')]=_['keys'](_0x27fe57[_0x27ea('0x46')]);_0x16cb6c[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x16cb6c[_0x27ea('0x5a')],_0x16cb6c[_0x27ea('0x46')]);_0x26b354[_0x27ea('0x4b')]=_['intersection'](_0x16cb6c['model'],qs[_0x27ea('0x5f')](_0x27fe57['query'][_0x27ea('0x5f')]));_0x26b354[_0x27ea('0x4b')]=_0x26b354[_0x27ea('0x4b')][_0x27ea('0x50')]?_0x26b354['attributes']:_0x16cb6c[_0x27ea('0x5a')];if(!_0x27fe57[_0x27ea('0x46')][_0x27ea('0xd0')]('nolimit')){_0x26b354['limit']=qs[_0x27ea('0x27')](_0x27fe57[_0x27ea('0x46')]['limit']);_0x26b354[_0x27ea('0x25')]=qs['offset'](_0x27fe57[_0x27ea('0x46')][_0x27ea('0x25')]);}_0x26b354[_0x27ea('0xce')]=qs[_0x27ea('0xd9')](_0x27fe57[_0x27ea('0x46')][_0x27ea('0xd9')]);_0x26b354[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x27fe57[_0x27ea('0x46')],_0x16cb6c[_0x27ea('0x5d')]));_0x26b354[_0x27ea('0x43')][_0x27ea('0xde')]=_0x3ac067['id'];if(_0x27fe57[_0x27ea('0x46')][_0x27ea('0x33')]){_0x26b354[_0x27ea('0x43')]=_[_0x27ea('0x61')](_0x26b354['where'],{'$or':_[_0x27ea('0x35')](_0x26b354[_0x27ea('0x4b')],function(_0x49f1db){var _0x414372={};_0x414372[_0x49f1db]={'$like':'%'+_0x27fe57[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x414372;})});}_0x26b354=_[_0x27ea('0x61')]({},_0x26b354,_0x27fe57[_0x27ea('0x62')]);return db[_0x27ea('0xe4')][_0x27ea('0x45')]({'where':_0x26b354[_0x27ea('0x43')]})[_0x27ea('0x16')](function(_0x12ea95){_0x4cfd8b['count']=_0x12ea95;if(_0x27fe57[_0x27ea('0x46')][_0x27ea('0x47')]){_0x26b354[_0x27ea('0x49')]=[{'all':!![]}];}return db['MailInteraction'][_0x27ea('0x4d')](_0x26b354);})['then'](function(_0x337bc1){_0x4cfd8b[_0x27ea('0x4e')]=_0x337bc1;return _0x4cfd8b;});}})[_0x27ea('0x16')](respondWithFilteredResult(_0x1787c0,_0x26b354))[_0x27ea('0x21')](handleError(_0x1787c0,null));};exports[_0x27ea('0xe5')]=function(_0x5b8aa4,_0x1bb07f){var _0x38ad98={};var _0x3259b8={};var _0x500b5a;var _0x4b36b3;return db[_0x27ea('0x44')]['findOne']({'where':{'id':_0x5b8aa4['params']['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x1bb07f,null))[_0x27ea('0x16')](function(_0x5c5cee){if(_0x5c5cee){_0x500b5a=_0x5c5cee;_0x3259b8[_0x27ea('0x5a')]=_[_0x27ea('0x5c')](db[_0x27ea('0xe6')][_0x27ea('0xd8')]);_0x3259b8[_0x27ea('0x46')]=_['keys'](_0x5b8aa4['query']);_0x3259b8[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x3259b8[_0x27ea('0x5a')],_0x3259b8[_0x27ea('0x46')]);_0x38ad98[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x3259b8[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x5b8aa4[_0x27ea('0x46')]['fields']));_0x38ad98[_0x27ea('0x4b')]=_0x38ad98[_0x27ea('0x4b')]['length']?_0x38ad98[_0x27ea('0x4b')]:_0x3259b8[_0x27ea('0x5a')];_0x38ad98['order']=qs['sort'](_0x5b8aa4[_0x27ea('0x46')][_0x27ea('0xd9')]);_0x38ad98['where']=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x5b8aa4[_0x27ea('0x46')],_0x3259b8[_0x27ea('0x5d')]));if(_0x5b8aa4[_0x27ea('0x46')][_0x27ea('0x33')]){_0x38ad98[_0x27ea('0x43')]=_[_0x27ea('0x61')](_0x38ad98['where'],{'$or':_[_0x27ea('0x35')](_0x38ad98[_0x27ea('0x4b')],function(_0x4af6d0){var _0x1b2228={};_0x1b2228[_0x4af6d0]={'$like':'%'+_0x5b8aa4['query']['filter']+'%'};return _0x1b2228;})});}_0x38ad98=_[_0x27ea('0x61')]({},_0x38ad98,_0x5b8aa4[_0x27ea('0x62')]);return _0x500b5a[_0x27ea('0xe5')](_0x38ad98);}})['then'](function(_0xbd73cc){if(_0xbd73cc){_0x4b36b3=_0xbd73cc[_0x27ea('0x50')];if(!_0x5b8aa4[_0x27ea('0x46')][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0x38ad98[_0x27ea('0x27')]=qs[_0x27ea('0x27')](_0x5b8aa4[_0x27ea('0x46')][_0x27ea('0x27')]);_0x38ad98[_0x27ea('0x25')]=qs['offset'](_0x5b8aa4[_0x27ea('0x46')][_0x27ea('0x25')]);}return _0x500b5a[_0x27ea('0xe5')](_0x38ad98);}})[_0x27ea('0x16')](function(_0x2eca26){if(_0x2eca26){return _0x2eca26?{'count':_0x4b36b3,'rows':_0x2eca26}:null;}})[_0x27ea('0x16')](respondWithResult(_0x1bb07f,null))[_0x27ea('0x21')](handleError(_0x1bb07f,null));};exports['getFaxInteractions']=function(_0x3cd7ed,_0x45840f){var _0xda8334={};var _0x51eb7c={};var _0x105766;var _0x34faa2;return db[_0x27ea('0x44')][_0x27ea('0xd7')]({'where':{'id':_0x3cd7ed[_0x27ea('0x65')]['id']}})['then'](handleEntityNotFound(_0x45840f,null))[_0x27ea('0x16')](function(_0x3fe98c){if(_0x3fe98c){_0x105766=_0x3fe98c;_0x51eb7c[_0x27ea('0x5a')]=_[_0x27ea('0x5c')](db[_0x27ea('0xe7')][_0x27ea('0xd8')]);_0x51eb7c['query']=_['keys'](_0x3cd7ed[_0x27ea('0x46')]);_0x51eb7c[_0x27ea('0x5d')]=_['intersection'](_0x51eb7c[_0x27ea('0x5a')],_0x51eb7c[_0x27ea('0x46')]);_0xda8334[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x51eb7c[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x3cd7ed[_0x27ea('0x46')]['fields']));_0xda8334[_0x27ea('0x4b')]=_0xda8334[_0x27ea('0x4b')]['length']?_0xda8334[_0x27ea('0x4b')]:_0x51eb7c[_0x27ea('0x5a')];_0xda8334['order']=qs[_0x27ea('0xd9')](_0x3cd7ed[_0x27ea('0x46')][_0x27ea('0xd9')]);_0xda8334[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_['pick'](_0x3cd7ed[_0x27ea('0x46')],_0x51eb7c[_0x27ea('0x5d')]));if(_0x3cd7ed[_0x27ea('0x46')][_0x27ea('0x33')]){_0xda8334[_0x27ea('0x43')]=_[_0x27ea('0x61')](_0xda8334['where'],{'$or':_[_0x27ea('0x35')](_0xda8334[_0x27ea('0x4b')],function(_0x39ffdb){var _0x856bd5={};_0x856bd5[_0x39ffdb]={'$like':'%'+_0x3cd7ed[_0x27ea('0x46')]['filter']+'%'};return _0x856bd5;})});}_0xda8334=_[_0x27ea('0x61')]({},_0xda8334,_0x3cd7ed[_0x27ea('0x62')]);return _0x105766[_0x27ea('0xe8')](_0xda8334);}})['then'](function(_0x4142c3){if(_0x4142c3){_0x34faa2=_0x4142c3[_0x27ea('0x50')];if(!_0x3cd7ed[_0x27ea('0x46')][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0xda8334[_0x27ea('0x27')]=qs['limit'](_0x3cd7ed['query'][_0x27ea('0x27')]);_0xda8334[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x3cd7ed[_0x27ea('0x46')][_0x27ea('0x25')]);}return _0x105766[_0x27ea('0xe8')](_0xda8334);}})[_0x27ea('0x16')](function(_0x33f34c){if(_0x33f34c){return _0x33f34c?{'count':_0x34faa2,'rows':_0x33f34c}:null;}})[_0x27ea('0x16')](respondWithResult(_0x45840f,null))['catch'](handleError(_0x45840f,null));};exports[_0x27ea('0xe9')]=function(_0x49b093,_0x460625){var _0x318caf={};var _0x19035f={};var _0x58506d;var _0x3509cd;return db[_0x27ea('0x44')][_0x27ea('0xd7')]({'where':{'id':_0x49b093[_0x27ea('0x65')]['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x460625,null))[_0x27ea('0x16')](function(_0x21b2a2){if(_0x21b2a2){_0x58506d=_0x21b2a2;_0x19035f[_0x27ea('0x5a')]=_['keys'](db[_0x27ea('0xea')]['rawAttributes']);_0x19035f[_0x27ea('0x46')]=_[_0x27ea('0x5c')](_0x49b093['query']);_0x19035f[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x19035f['model'],_0x19035f[_0x27ea('0x46')]);_0x318caf[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x19035f[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x49b093[_0x27ea('0x46')][_0x27ea('0x5f')]));_0x318caf[_0x27ea('0x4b')]=_0x318caf['attributes'][_0x27ea('0x50')]?_0x318caf[_0x27ea('0x4b')]:_0x19035f[_0x27ea('0x5a')];_0x318caf['order']=qs[_0x27ea('0xd9')](_0x49b093[_0x27ea('0x46')]['sort']);_0x318caf[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x49b093['query'],_0x19035f[_0x27ea('0x5d')]));if(_0x49b093[_0x27ea('0x46')][_0x27ea('0x33')]){_0x318caf[_0x27ea('0x43')]=_['merge'](_0x318caf[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0x318caf[_0x27ea('0x4b')],function(_0x5231a9){var _0x4e23fe={};_0x4e23fe[_0x5231a9]={'$like':'%'+_0x49b093[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x4e23fe;})});}_0x318caf=_[_0x27ea('0x61')]({},_0x318caf,_0x49b093['options']);return _0x58506d['getWhatsappInteractions'](_0x318caf);}})[_0x27ea('0x16')](function(_0x37e22f){if(_0x37e22f){_0x3509cd=_0x37e22f[_0x27ea('0x50')];if(!_0x49b093[_0x27ea('0x46')][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0x318caf[_0x27ea('0x27')]=qs[_0x27ea('0x27')](_0x49b093[_0x27ea('0x46')][_0x27ea('0x27')]);_0x318caf[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x49b093[_0x27ea('0x46')][_0x27ea('0x25')]);}return _0x58506d['getWhatsappInteractions'](_0x318caf);}})[_0x27ea('0x16')](function(_0x468885){if(_0x468885){return _0x468885?{'count':_0x3509cd,'rows':_0x468885}:null;}})[_0x27ea('0x16')](respondWithResult(_0x460625,null))[_0x27ea('0x21')](handleError(_0x460625,null));};exports['login']=function(_0x33e441,_0x12a5ee,_0x30c8ca){var _0x588e9c;var _0xb902c;var _0x30345f;var _0x185de3=!_[_0x27ea('0x6d')](_0x33e441[_0x27ea('0x65')]['id'])?_0x33e441[_0x27ea('0x65')]['id']:!_[_0x27ea('0x6d')](_0x33e441[_0x27ea('0x2f')]['id'])?_0x33e441['user']['id']:null;return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x185de3,'role':{'$or':[_0x27ea('0x86'),'user','agent']}},'attributes':['id',_0x27ea('0x3a'),_0x27ea('0xeb'),_0x27ea('0xec'),_0x27ea('0x38'),_0x27ea('0x67'),_0x27ea('0xa4')]})[_0x27ea('0x16')](function(_0x4dfeb6){if(_0x4dfeb6){if(_0x4dfeb6[_0x27ea('0x38')]===_0x27ea('0x31')){_0x588e9c=_0x4dfeb6;if(_0x33e441[_0x27ea('0x63')][_0x27ea('0xa6')]){_0x30345f=util[_0x27ea('0xed')](_0x27ea('0xee'),_0x588e9c[_0x33e441[_0x27ea('0x63')][_0x27ea('0xa6')]]);}else if(_0x33e441['body'][_0x27ea('0xef')]){_0x30345f=util[_0x27ea('0xed')](_0x27ea('0xf0'),_0x33e441['body'][_0x27ea('0xef')]);}else{_0x30345f=util['format'](_0x27ea('0xf0'),_0x588e9c[_0x27ea('0x3a')]);}socket['to'](util['format'](_0x27ea('0xf1'),_0x588e9c[_0x27ea('0x3a')]))['emit'](_0x27ea('0xf2'),{'user':{'id':_0x588e9c['id'],'name':_0x588e9c[_0x27ea('0x3a')]},'ip':_0x33e441[_0x27ea('0xf3')][_0x27ea('0xf4')]||_0x33e441[_0x27ea('0xf5')][_0x27ea('0xf6')]||_0x33e441[_0x27ea('0xf7')][_0x27ea('0xf6')]||_0x33e441[_0x27ea('0xf5')][_0x27ea('0xf7')][_0x27ea('0xf6')]});return db[_0x27ea('0xb6')][_0x27ea('0x2c')]({'where':{'membername':_0x588e9c['name']},'individualHooks':!![]});}}else{throw new db[(_0x27ea('0x96'))][(_0x27ea('0x99'))](_0x27ea('0xf8'));}})['then'](function(){if(_0x588e9c){return _0x588e9c[_0x27ea('0xf9')]({'raw':!![]});}})[_0x27ea('0x16')](function(_0x3e4b86){if(_0x588e9c){if(_0x3e4b86){_0xb902c=_0x3e4b86;if(_0xb902c[_0x27ea('0x50')]){var _0x33373c=_0xb902c[_0x27ea('0x35')](function(_0x4f7660){var _0x254484={'membername':_0x588e9c[_0x27ea('0x3a')],'UserId':_0x588e9c['id'],'queue_name':_0x4f7660[_0x27ea('0x3a')],'VoiceQueueId':_0x4f7660['id'],'interface':_0x30345f,'paused':_0x588e9c[_0x27ea('0xa4')]||![],'penalty':_0x4f7660[_0x27ea('0xfa')]||0x0};return db[_0x27ea('0xb6')]['upsert'](_0x254484);});return Promise['all'](_0x33373c);}}}})[_0x27ea('0x16')](function(){if(_0x588e9c){return db[_0x27ea('0xfb')][_0x27ea('0x4d')]({'where':{'membername':_0x588e9c['name'],'exitAt':null}});}})['then'](function(_0x572305){if(_0x588e9c){var _0x15dc04=[];_0x572305[_0x27ea('0xfc')](function(_0x5f93cd){_0x15dc04[_0x27ea('0x4c')](_0x5f93cd[_0x27ea('0x2a')]({'exitAt':moment()[_0x27ea('0xed')](_0x27ea('0xfd'))}));});return Promise[_0x27ea('0x58')](_0x15dc04);}})[_0x27ea('0x16')](function(){if(_0x588e9c){var _0x5c4263=[];var _0x4a5a8d=[];var _0x29a70b=utils[_0x27ea('0xfe')]();var _0x1e027f={'membername':_0x588e9c[_0x27ea('0x3a')],'interface':_0x30345f,'enterAt':moment()['format'](_0x27ea('0xfd')),'role':_0x588e9c[_0x27ea('0x38')],'internal':_0x588e9c['internal']};_0x29a70b[_0x27ea('0xfc')](function(_0x2799df){_0x5c4263[_0x27ea('0x4c')](_[_0x27ea('0x61')]({'channel':_0x2799df,'type':_0x27ea('0xff'),'data1':_0x33e441['body']['device'],'data2':_0x30345f},_0x1e027f));if(_0x588e9c[_0x27ea('0xa4')]){_0x4a5a8d[_0x27ea('0x4c')](_['merge']({'channel':_0x2799df,'type':'PAUSE','data1':_0x27ea('0x100')},_0x1e027f));}});return db[_0x27ea('0xfb')][_0x27ea('0x8e')](_0x5c4263[_0x27ea('0x101')](_0x4a5a8d),{'individualHooks':!![]});}})[_0x27ea('0x16')](function(){if(_0x588e9c){return _0x588e9c[_0x27ea('0x2a')]({'online':!![],'lastLoginAt':moment()['format'](_0x27ea('0xfd')),'voicePause':_0x588e9c[_0x27ea('0xa4')]||![],'mailPause':_0x588e9c[_0x27ea('0xa4')]||![],'chatPause':_0x588e9c[_0x27ea('0xa4')]||![],'faxPause':_0x588e9c[_0x27ea('0xa4')]||![],'smsPause':_0x588e9c[_0x27ea('0xa4')]||![],'openchannelPause':_0x588e9c[_0x27ea('0xa4')]||![],'whatsappPause':_0x588e9c[_0x27ea('0xa4')]||![],'pauseType':_0x588e9c[_0x27ea('0xa4')]?_0x27ea('0x100'):null,'interface':_0x30345f,'lastPauseAt':moment()[_0x27ea('0xed')](_0x27ea('0xfd'))});}})[_0x27ea('0x16')](function(_0x3f054b){if(_0x33e441['isMiddleware']){return _0x30c8ca();}else{return Promise[_0x27ea('0x102')](_0x3f054b)[_0x27ea('0x16')](respondWithResult(_0x12a5ee,null));}})[_0x27ea('0x21')](handleError(_0x12a5ee,null));};exports[_0x27ea('0x103')]=function(_0x7029fb,_0x16b741){var _0x4412d9;return db['User'][_0x27ea('0x39')]({'where':{'id':_0x7029fb[_0x27ea('0x65')]['id'],'role':_0x27ea('0x31')},'attributes':['id',_0x27ea('0x3a'),_0x27ea('0x38')]})[_0x27ea('0x16')](handleEntityNotFound(_0x16b741,null))[_0x27ea('0x16')](function(_0x3c1e7d){if(_0x3c1e7d){_0x4412d9=_0x3c1e7d;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x4412d9[_0x27ea('0x3a')]},'individualHooks':!![]});}})[_0x27ea('0x16')](function(){return db[_0x27ea('0xfb')][_0x27ea('0x4d')]({'where':{'membername':_0x4412d9[_0x27ea('0x3a')],'exitAt':null}});})[_0x27ea('0x16')](function(_0x68a2a4){var _0x19b1be=[];_0x68a2a4[_0x27ea('0xfc')](function(_0x4d1d54){_0x19b1be[_0x27ea('0x4c')](_0x4d1d54[_0x27ea('0x2a')]({'exitAt':moment()['format'](_0x27ea('0xfd'))}));});return Promise[_0x27ea('0x58')](_0x19b1be);})[_0x27ea('0x16')](function(){return _0x4412d9[_0x27ea('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x16b741,null))[_0x27ea('0x21')](handleError(_0x16b741,null));};exports['pause']=function(_0x2a5e38,_0x24bca0){var _0x70c83f;return db[_0x27ea('0xb6')]['update']({'paused':0x1},{'where':{'UserId':_0x2a5e38[_0x27ea('0x65')]['id']},'individualHooks':!![]})[_0x27ea('0x16')](function(){return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x2a5e38[_0x27ea('0x65')]['id'],'role':'agent'},'attributes':['id','name',_0x27ea('0x38'),_0x27ea('0x67'),'interface',_0x27ea('0xa3')]});})[_0x27ea('0x16')](handleEntityNotFound(_0x24bca0,null))[_0x27ea('0x16')](function(_0x5f1887){if(_0x5f1887){_0x70c83f=_0x5f1887;return respondWithRpcPromise(_0x27ea('0x104'),_0x27ea('0x105'),{'id':_0x70c83f['id'],'name':_0x70c83f['name'],'pause':!![]});}})[_0x27ea('0x16')](function(){if(_0x70c83f){return db[_0x27ea('0xfb')]['findAll']({'where':{'membername':_0x70c83f['name'],'type':_0x27ea('0x106'),'exitAt':null}});}})[_0x27ea('0x16')](function(_0x35e733){if(_0x35e733[_0x27ea('0x50')]){var _0x10b291=moment()[_0x27ea('0xed')](_0x27ea('0xfd'));for(var _0x4b8f3e=0x0,_0x411194=_0x35e733[_0x27ea('0x50')];_0x4b8f3e<_0x411194;_0x4b8f3e++){_0x35e733[_0x4b8f3e]['updateAttributes']({'exitAt':_0x10b291});}}})[_0x27ea('0x16')](function(){var _0x30e5dc=[];var _0xc6986a=utils[_0x27ea('0xfe')]();_0xc6986a[_0x27ea('0xfc')](function(_0x50fcab){_0x30e5dc[_0x27ea('0x4c')]({'channel':_0x50fcab,'membername':_0x70c83f[_0x27ea('0x3a')],'interface':_['isNil'](_0x70c83f['interface'])?util[_0x27ea('0xed')](_0x27ea('0xf0'),_0x70c83f[_0x27ea('0x3a')]):_0x70c83f[_0x27ea('0xa6')],'type':_0x27ea('0x106'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2a5e38[_0x27ea('0x63')][_0x27ea('0x3f')]||_0x27ea('0x107'),'role':_0x70c83f['role'],'internal':_0x70c83f[_0x27ea('0x67')]});});return db[_0x27ea('0xfb')][_0x27ea('0x8e')](_0x30e5dc,{'individualHooks':!![]});})[_0x27ea('0x16')](function(){return _0x70c83f[_0x27ea('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2a5e38[_0x27ea('0x63')][_0x27ea('0x3f')]||_0x27ea('0x107'),'lastPauseAt':moment()[_0x27ea('0xed')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x24bca0,null))['catch'](handleError(_0x24bca0,null));};exports[_0x27ea('0x108')]=function(_0x2e1a6b,_0x585e2b){if(_0x2e1a6b[_0x27ea('0x63')][_0x27ea('0xa2')]&&!utils[_0x27ea('0xa7')](_0x2e1a6b['body'][_0x27ea('0xa2')])){throw new APIBadRequestError(util[_0x27ea('0xed')](_0x27ea('0x109'),_0x2e1a6b[_0x27ea('0x63')][_0x27ea('0xa2')]));}return db[_0x27ea('0x44')][_0x27ea('0x39')]({'where':{'id':_0x2e1a6b['params']['id']},'attributes':['id',_0x27ea('0x3a'),_0x27ea('0x38'),_0x27ea('0x67'),_0x27ea('0xa6'),_0x27ea('0xa3'),'voicePause',_0x27ea('0x10a'),'chatPause',_0x27ea('0x10b'),_0x27ea('0x10c'),_0x27ea('0x10d'),_0x27ea('0x10e'),_0x27ea('0x10f'),_0x27ea('0x110')]})[_0x27ea('0x16')](function(_0x6a8dfc){if(!_0x6a8dfc){throw new APINotFoundError(util[_0x27ea('0xed')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2e1a6b['params']['id']));}return _0x6a8dfc['unpause'](_0x2e1a6b['body'][_0x27ea('0xa2')]);})[_0x27ea('0x16')](respondWithResult(_0x585e2b,null))[_0x27ea('0x21')](APIHandleError(_0x585e2b));};exports['getTeams']=function(_0x4f47d2,_0x324869){var _0xcc007d={};var _0x5fe2dd={};var _0x4d3f8b;var _0x2eef82;return db[_0x27ea('0x44')]['findOne']({'where':{'id':_0x4f47d2['params']['id']}})[_0x27ea('0x16')](handleEntityNotFound(_0x324869,null))[_0x27ea('0x16')](function(_0x1e5a71){if(_0x1e5a71){_0x4d3f8b=_0x1e5a71;_0x5fe2dd['model']=_['keys'](db['Team']['rawAttributes']);_0x5fe2dd['query']=_[_0x27ea('0x5c')](_0x4f47d2[_0x27ea('0x46')]);_0x5fe2dd[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x5fe2dd[_0x27ea('0x5a')],_0x5fe2dd[_0x27ea('0x46')]);_0xcc007d['attributes']=_[_0x27ea('0x5e')](_0x5fe2dd[_0x27ea('0x5a')],qs['fields'](_0x4f47d2[_0x27ea('0x46')]['fields']));_0xcc007d['attributes']=_0xcc007d['attributes'][_0x27ea('0x50')]?_0xcc007d[_0x27ea('0x4b')]:_0x5fe2dd[_0x27ea('0x5a')];_0xcc007d[_0x27ea('0xce')]=qs['sort'](_0x4f47d2['query'][_0x27ea('0xd9')]);_0xcc007d[_0x27ea('0x43')]=qs['filters'](_['pick'](_0x4f47d2[_0x27ea('0x46')],_0x5fe2dd[_0x27ea('0x5d')]));if(_0x4f47d2[_0x27ea('0x46')][_0x27ea('0x33')]){_0xcc007d['where']=_[_0x27ea('0x61')](_0xcc007d[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0xcc007d[_0x27ea('0x4b')],function(_0x5619a3){var _0x1ae8b8={};_0x1ae8b8[_0x5619a3]={'$like':'%'+_0x4f47d2[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x1ae8b8;})});}_0xcc007d=_[_0x27ea('0x61')]({},_0xcc007d,_0x4f47d2[_0x27ea('0x62')]);return _0x4d3f8b[_0x27ea('0x111')](_0xcc007d);}})[_0x27ea('0x16')](function(_0x57250b){if(_0x57250b){_0x2eef82=_0x57250b[_0x27ea('0x50')];if(!_0x4f47d2['query'][_0x27ea('0xd0')](_0x27ea('0xd5'))){_0xcc007d[_0x27ea('0x27')]=qs[_0x27ea('0x27')](_0x4f47d2['query'][_0x27ea('0x27')]);_0xcc007d[_0x27ea('0x25')]=qs['offset'](_0x4f47d2[_0x27ea('0x46')]['offset']);}return _0x4d3f8b[_0x27ea('0x111')](_0xcc007d);}})[_0x27ea('0x16')](function(_0x15d45e){if(_0x15d45e){return _0x15d45e?{'count':_0x2eef82,'rows':_0x15d45e}:null;}})[_0x27ea('0x16')](respondWithResult(_0x324869,null))[_0x27ea('0x21')](handleError(_0x324869,null));};exports[_0x27ea('0x112')]=function(_0x12304e,_0x4e8626){var _0x539df8=_0x12304e[_0x27ea('0x65')]['id'];var _0x1e7656=_0x12304e[_0x27ea('0x63')]?_0x12304e[_0x27ea('0x63')]['ids']:null;var _0x4b3ddc=[];return Promise[_0x27ea('0x102')]()[_0x27ea('0x16')](function(){if(!_0x1e7656)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x27ea('0x16')](function(){return db[_0x27ea('0x44')][_0x27ea('0xd7')]({'where':{'id':_0x539df8}});})[_0x27ea('0x16')](function(_0x2d440d){if(!_0x2d440d)throw new APINotFoundError(util[_0x27ea('0xed')](_0x27ea('0x113'),_0x12304e[_0x27ea('0x65')]['id']));return db[_0x27ea('0x6e')][_0x27ea('0x114')](function(_0x31f6f0){return _0x2d440d[_0x27ea('0x112')](_0x1e7656,{'transaction':_0x31f6f0})['then'](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x1e7656}}});})[_0x27ea('0x16')](function(_0x33b5e8){var _0x5768f5=_[_0x27ea('0x35')](_0x33b5e8,function(_0x4e0b6c){return _0x4e0b6c[_0x27ea('0x115')]();});return Promise[_0x27ea('0x58')](_0x5768f5);})[_0x27ea('0x16')](function(_0x5a93e6){_0x4b3ddc=_[_0x27ea('0x116')](_0x5a93e6);var _0x163485=_[_0x27ea('0x35')](_0x4b3ddc,function(_0x16d2de){return _0x16d2de[_0x27ea('0x117')](_0x2d440d['id'],{'transaction':_0x31f6f0});});return Promise['all'](_0x163485);})['then'](function(){if(!_0x2d440d[_0x27ea('0xa3')])return;var _0x48f5a5=_['filter'](_0x4b3ddc,function(_0x103279){return _0x103279[_0x27ea('0x118')]('channel')===_0x27ea('0x119');});var _0x29ec8e=_['map'](_0x48f5a5,function(_0x2bb744){return db[_0x27ea('0xb6')][_0x27ea('0xb0')]({'membername':_0x2d440d[_0x27ea('0x3a')],'UserId':_0x2d440d['id'],'queue_name':_0x2bb744[_0x27ea('0x3a')],'VoiceQueueId':_0x2bb744['id'],'interface':_['isNil'](_0x2d440d[_0x27ea('0xa6')])?util[_0x27ea('0xed')](_0x27ea('0xf0'),_0x2d440d[_0x27ea('0x3a')]):_0x2d440d['interface'],'paused':_0x2d440d['voicePause']||![],'penalty':_0x2d440d[_0x27ea('0xac')]},{'transaction':_0x31f6f0});});return Promise['all'](_0x29ec8e);})[_0x27ea('0x16')](function(){return db[_0x27ea('0x11a')]['findAll']({'where':{'teamId':{'$in':_0x1e7656}}});})['then'](function(_0x4b72a0){var _0x1f0b1f=_['map'](_0x4b72a0,function(_0x4bfc64){return db[_0x27ea('0x11b')][_0x27ea('0x8b')]({'UserId':_0x2d440d['id'],'VoicePrefixId':_0x4bfc64[_0x27ea('0x11c')]},{'transaction':_0x31f6f0});});return Promise['all'](_0x1f0b1f);});});})[_0x27ea('0x16')](function(){for(var _0x407648=0x0;_0x407648<_0x4b3ddc['length'];_0x407648++){var _0x36b6ee=_0x4b3ddc[_0x407648][_0x27ea('0x118')](_0x27ea('0xa2'));var _0x3aa161=_0x36b6ee+_0x27ea('0xb4');socket[_0x27ea('0x2b')](_0x27ea('0x2f')+_0x36b6ee+'Queue:save',{'UserId':_0x539df8,['queueField']:_0x4b3ddc[_0x407648]['id']});}})[_0x27ea('0x16')](respondWithStatusCode(_0x4e8626,null))[_0x27ea('0x21')](APIHandleError(_0x4e8626));};exports['removeTeams']=function(_0x2ab206,_0x1d7e28){var _0x4784c5=_0x2ab206['params']['id'];var _0x6313a0=null;if(_0x2ab206[_0x27ea('0x46')][_0x27ea('0x66')]){_0x6313a0=_[_0x27ea('0xb3')](_0x2ab206[_0x27ea('0x46')]['ids'])?_0x2ab206[_0x27ea('0x46')]['ids']:[_0x2ab206[_0x27ea('0x46')][_0x27ea('0x66')]];}var _0x423f3a=[];return Promise['resolve']()[_0x27ea('0x16')](function(){if(!_0x6313a0)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x27ea('0x16')](function(){return db['User'][_0x27ea('0xd7')]({'where':{'id':_0x4784c5}});})[_0x27ea('0x16')](function(_0x100ac3){if(!_0x100ac3)throw new APINotFoundError(util[_0x27ea('0xed')](_0x27ea('0x113'),_0x2ab206[_0x27ea('0x65')]['id']));return db['sequelize'][_0x27ea('0x114')](function(_0x4b385f){return _0x100ac3[_0x27ea('0x11d')](_0x6313a0,{'transaction':_0x4b385f})[_0x27ea('0x16')](function(){return db[_0x27ea('0x11e')]['findAll']({'where':{'id':{'$in':_0x6313a0}}});})[_0x27ea('0x16')](function(_0x2174e5){var _0x2bd0e9=_['map'](_0x2174e5,function(_0x482c8a){return _0x482c8a[_0x27ea('0x115')]();});return Promise[_0x27ea('0x58')](_0x2bd0e9);})[_0x27ea('0x16')](function(_0x12b7f6){_0x423f3a=_['flattenDeep'](_0x12b7f6);var _0x47fbee=_[_0x27ea('0x35')](_0x423f3a,function(_0x10c102){return _0x10c102[_0x27ea('0x11f')](_0x100ac3['id'],{'transaction':_0x4b385f});});return Promise[_0x27ea('0x58')](_0x47fbee);})[_0x27ea('0x16')](function(){if(!_0x100ac3[_0x27ea('0xa3')])return;var _0xfeb3ea=_[_0x27ea('0x33')](_0x423f3a,function(_0x2c1107){return _0x2c1107[_0x27ea('0x118')]('channel')===_0x27ea('0x119');});var _0x53fee8=_[_0x27ea('0x35')](_0xfeb3ea,function(_0x147a0b){return db[_0x27ea('0xb6')]['destroy']({'where':{'VoiceQueueId':_0x147a0b['id'],'UserId':_0x100ac3['id']},'transaction':_0x4b385f});});return Promise[_0x27ea('0x58')](_0x53fee8);})[_0x27ea('0x16')](function(){return db[_0x27ea('0x11a')][_0x27ea('0x4d')]({'where':{'teamId':{'$in':_0x6313a0}}});})[_0x27ea('0x16')](function(_0x2886f3){var _0x2073c0=_[_0x27ea('0x35')](_0x2886f3,function(_0x1b4b98){return db[_0x27ea('0x11b')]['destroy']({'where':{'UserId':_0x100ac3['id'],'VoicePrefixId':_0x1b4b98[_0x27ea('0x11c')]}},{'transaction':_0x4b385f});});return Promise[_0x27ea('0x58')](_0x2073c0);});});})['then'](function(){for(var _0x4e7807=0x0;_0x4e7807<_0x423f3a[_0x27ea('0x50')];_0x4e7807++){var _0x31e8fc=_0x423f3a[_0x4e7807][_0x27ea('0x118')](_0x27ea('0xa2'));var _0x5fb44b=_0x31e8fc+_0x27ea('0xb4');socket[_0x27ea('0x2b')](_0x27ea('0x2f')+_0x31e8fc+_0x27ea('0xb5'),{'UserId':_0x4784c5,['queueField']:_0x423f3a[_0x4e7807]['id']});}})[_0x27ea('0x16')](respondWithStatusCode(_0x1d7e28,null))[_0x27ea('0x21')](APIHandleError(_0x1d7e28));};exports[_0x27ea('0x120')]=function(_0x30024f,_0x51f847){var _0xcfda99={};var _0x1f749a={};var _0x822255;var _0x2d4222;return db['User']['findOne']({'where':{'id':_0x30024f[_0x27ea('0x65')]['id']}})['then'](handleEntityNotFound(_0x51f847,null))['then'](function(_0x4bc340){if(_0x4bc340){_0x822255=_0x4bc340;_0x1f749a[_0x27ea('0x5a')]=_[_0x27ea('0x5c')](db[_0x27ea('0xd1')][_0x27ea('0xd8')]);_0x1f749a[_0x27ea('0x46')]=_['keys'](_0x30024f['query']);_0x1f749a[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x1f749a[_0x27ea('0x5a')],_0x1f749a['query']);_0xcfda99[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x1f749a[_0x27ea('0x5a')],qs['fields'](_0x30024f[_0x27ea('0x46')][_0x27ea('0x5f')]));_0xcfda99[_0x27ea('0x4b')]=_0xcfda99[_0x27ea('0x4b')][_0x27ea('0x50')]?_0xcfda99[_0x27ea('0x4b')]:_0x1f749a[_0x27ea('0x5a')];_0xcfda99[_0x27ea('0xce')]=qs[_0x27ea('0xd9')](_0x30024f[_0x27ea('0x46')]['sort']);_0xcfda99['where']=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x30024f[_0x27ea('0x46')],_0x1f749a['filters']));if(_0x30024f['query'][_0x27ea('0x33')]){_0xcfda99[_0x27ea('0x43')]=_[_0x27ea('0x61')](_0xcfda99[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0xcfda99['attributes'],function(_0xaecbc6){var _0x4300b2={};_0x4300b2[_0xaecbc6]={'$like':'%'+_0x30024f[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x4300b2;})});}_0xcfda99=_[_0x27ea('0x61')]({},_0xcfda99,_0x30024f[_0x27ea('0x62')]);return _0x822255[_0x27ea('0x120')](_0xcfda99);}})[_0x27ea('0x16')](function(_0x2dc808){if(_0x2dc808){_0x2d4222=_0x2dc808[_0x27ea('0x50')];if(!_0x30024f[_0x27ea('0x46')][_0x27ea('0xd0')]('nolimit')){_0xcfda99[_0x27ea('0x27')]=qs[_0x27ea('0x27')](_0x30024f[_0x27ea('0x46')]['limit']);_0xcfda99[_0x27ea('0x25')]=qs[_0x27ea('0x25')](_0x30024f['query'][_0x27ea('0x25')]);}return _0x822255[_0x27ea('0x120')](_0xcfda99);}})[_0x27ea('0x16')](function(_0x45cfb2){if(_0x45cfb2){return _0x45cfb2?{'count':_0x2d4222,'rows':_0x45cfb2}:null;}})[_0x27ea('0x16')](respondWithResult(_0x51f847,null))[_0x27ea('0x21')](handleError(_0x51f847,null));};exports[_0x27ea('0x121')]=function(_0x3ba5d3,_0x2a48bb){var _0x3daf77={};var _0x3e8e6f={};var _0x27eb07;return db[_0x27ea('0x44')][_0x27ea('0xd7')]({'where':{'id':_0x3ba5d3[_0x27ea('0x65')]['id']}})['then'](handleEntityNotFound(_0x2a48bb,null))[_0x27ea('0x16')](function(_0x464d91){if(_0x464d91){_0x27eb07=_0x464d91;_0x3e8e6f[_0x27ea('0x5a')]=_['keys'](db['User'][_0x27ea('0xd8')]);_0x3e8e6f[_0x27ea('0x46')]=_[_0x27ea('0x5c')](_0x3ba5d3[_0x27ea('0x46')]);_0x3e8e6f[_0x27ea('0x5d')]=_[_0x27ea('0x5e')](_0x3e8e6f[_0x27ea('0x5a')],_0x3e8e6f[_0x27ea('0x46')]);_0x3daf77[_0x27ea('0x4b')]=_[_0x27ea('0x5e')](_0x3e8e6f[_0x27ea('0x5a')],qs[_0x27ea('0x5f')](_0x3ba5d3['query'][_0x27ea('0x5f')]));_0x3daf77[_0x27ea('0x4b')]=_0x3daf77[_0x27ea('0x4b')]['length']?_0x3daf77['attributes']:_0x3e8e6f['model'];_0x3daf77['order']=qs[_0x27ea('0xd9')](_0x3ba5d3['query'][_0x27ea('0xd9')]);_0x3daf77[_0x27ea('0x43')]=qs[_0x27ea('0x5d')](_[_0x27ea('0xcf')](_0x3ba5d3['query'],_0x3e8e6f[_0x27ea('0x5d')]));if(_0x3ba5d3[_0x27ea('0x46')][_0x27ea('0x33')]){_0x3daf77[_0x27ea('0x43')]=_[_0x27ea('0x61')](_0x3daf77[_0x27ea('0x43')],{'$or':_[_0x27ea('0x35')](_0x3daf77[_0x27ea('0x4b')],function(_0x388eb9){var _0x52c8b4={};_0x52c8b4[_0x388eb9]={'$like':'%'+_0x3ba5d3[_0x27ea('0x46')][_0x27ea('0x33')]+'%'};return _0x52c8b4;})});}_0x3daf77[_0x27ea('0x5a')]=db[_0x27ea('0x44')];_0x3daf77['as']=_0x27ea('0x30');_0x3daf77=_[_0x27ea('0x61')]({},_0x3daf77,_0x3ba5d3[_0x27ea('0x62')]);return _0x27eb07[_0x27ea('0xf9')]({'include':[_0x3daf77]});}})[_0x27ea('0x16')](function(_0x2cd53){if(_0x2cd53){var _0x52f719={},_0x35d181=[];for(var _0x56c0ec=0x0;_0x56c0ec<_0x2cd53[_0x27ea('0x50')];_0x56c0ec+=0x1){for(var _0x3f7b2e=0x0,_0x23b9de;_0x3f7b2e<_0x2cd53[_0x56c0ec]['Agents']['length'];_0x3f7b2e+=0x1){_0x23b9de=_0x2cd53[_0x56c0ec][_0x27ea('0x30')][_0x3f7b2e][_0x27ea('0x2d')]({'plain':!![]});_0x52f719[_0x23b9de['id']]=_0x23b9de;}}_0x52f719=_[_0x27ea('0x122')](_0x52f719);for(var _0x561bdc=qs[_0x27ea('0x25')](_0x3ba5d3[_0x27ea('0x46')][_0x27ea('0x25')]);_0x561bdc<_0x52f719['length']&&_0x35d181[_0x27ea('0x50')]=_0x3e6cd3){_0xec2a09=_0x3e6cd3;_0x218d19=0xc8;}else{_0x218d19=0xce;}_0x22e620['status'](_0x218d19);return _0x22e620[_0xe989('0x27')](_0xe989('0x28'),_0x3b98b0+'-'+_0xec2a09+'/'+_0x3e6cd3)[_0xe989('0x29')](_0x20c87e);}return null;};}function saveUpdates(_0x5418be){return function(_0x5d1b89){if(_0x5d1b89){return _0x5d1b89['update'](_0x5418be)[_0xe989('0x18')](function(_0x3b3890){socket[_0xe989('0x2a')](_0xe989('0x2b')+_0x3b3890['id'],{});return _0x3b3890;});}return null;};}function removeEntity(_0x578e32){return function(_0x32a69a){if(_0x32a69a){return _0x32a69a[_0xe989('0x2c')]()[_0xe989('0x18')](function(){var _0x252b3d=_0x32a69a['get']({'plain':!![]});if(_0x252b3d[_0xe989('0x2d')]===_0xe989('0x2e'))return;var _0x77f37=[{'name':_0xe989('0x2f'),'value':_0xe989('0x30'),'ignore':!![]},{'name':'Agents','value':_0xe989('0x31'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x4c8b42=_(_0x77f37)['filter'](_0xe989('0x32'))[_0xe989('0x33')](_0xe989('0x34'))['value']();if(_['includes'](_0x4c8b42,_0x252b3d[_0xe989('0x2d')])){return;}var _0x45bec8=_[_0xe989('0x35')](_0x77f37,['value',_0x252b3d['role']])[_0xe989('0x36')];return db[_0xe989('0x37')][_0xe989('0x2c')]({'where':{'type':_0x45bec8,'resourceId':_0x252b3d['id']}})[_0xe989('0x18')](function(){return _0x32a69a;});})[_0xe989('0x18')](function(){_0x578e32[_0xe989('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b74eb){return function(_0x563b05){if(!_0x563b05){_0x4b74eb[_0xe989('0x20')](0x194);}return _0x563b05;};}function handleError(_0x2224a2,_0x373513){_0x373513=_0x373513||0x1f4;return function(_0xfecba4){logger[_0xe989('0x1c')](_0xfecba4[_0xe989('0x38')]);if(_0xfecba4['name']){delete _0xfecba4[_0xe989('0x36')];}_0x2224a2['status'](_0x373513)[_0xe989('0x39')](_0xfecba4);};}exports[_0xe989('0x3a')]=function(_0x529b71,_0x2907e2){var _0x5d55df={},_0x3e84e8={'count':0x0,'rows':[]};var _0x4d0153=_(db['User'][_0xe989('0x3b')])[_0xe989('0x33')](function(_0x54718b){return{'name':_0x54718b[_0xe989('0x3c')],'type':_0x54718b[_0xe989('0x3d')]['key']};})[_0xe989('0x3e')](function(_0x21f872){return!_['includes']([_0xe989('0x3f'),_0xe989('0x40')],_0x21f872[_0xe989('0x36')]);})['value']();_0x5d55df=qs[_0xe989('0x41')](_0x4d0153,_0x529b71);var _0xca4289={'where':_0x5d55df[_0xe989('0x42')]};return db[_0xe989('0x43')]['count'](_0xca4289)[_0xe989('0x18')](function(_0x289374){_0x3e84e8['count']=_0x289374;if(_0x529b71[_0xe989('0x44')][_0xe989('0x45')]){_0x5d55df['include']=[{'all':!![]}];}if(_0x529b71['query'][_0xe989('0x46')]===_0xe989('0x47')){_0x5d55df[_0xe989('0x48')]=[{'model':db[_0xe989('0x49')],'as':_0xe989('0x46')}];}if(!_[_0xe989('0x4a')](_0x5d55df[_0xe989('0x4b')],'id')){_0x5d55df[_0xe989('0x4b')][_0xe989('0x4c')]('id');}return db['User'][_0xe989('0x4d')](_0x5d55df);})[_0xe989('0x18')](function(_0x4a7eef){_0x3e84e8[_0xe989('0x4e')]=_0x4a7eef;if(_0x529b71[_0xe989('0x44')][_0xe989('0x4f')]===_0xe989('0x47')){var _0x2d4582=[];for(var _0x414ea7=0x0;_0x414ea7<_0x3e84e8['rows'][_0xe989('0x50')];_0x414ea7++){_0x2d4582[_0xe989('0x4c')](get_open_tabs('chat',_0x3e84e8[_0xe989('0x4e')][_0x414ea7][_0xe989('0x51')]));_0x2d4582[_0xe989('0x4c')](get_open_tabs('sms',_0x3e84e8[_0xe989('0x4e')][_0x414ea7]['dataValues']));_0x2d4582[_0xe989('0x4c')](get_open_tabs(_0xe989('0x52'),_0x3e84e8[_0xe989('0x4e')][_0x414ea7]['dataValues']));_0x2d4582[_0xe989('0x4c')](get_open_tabs('mail',_0x3e84e8[_0xe989('0x4e')][_0x414ea7][_0xe989('0x51')]));_0x2d4582['push'](get_open_tabs('openchannel',_0x3e84e8['rows'][_0x414ea7][_0xe989('0x51')]));_0x2d4582['push'](get_open_tabs(_0xe989('0x53'),_0x3e84e8[_0xe989('0x4e')][_0x414ea7][_0xe989('0x51')]));}return Promise['all'](_0x2d4582)[_0xe989('0x18')](function(){return _0x3e84e8;});}else{return _0x3e84e8;}})[_0xe989('0x18')](respondWithFilteredResult(_0x2907e2,_0x5d55df))[_0xe989('0x54')](handleError(_0x2907e2,null));};exports[_0xe989('0x55')]=function(_0x34cbb3,_0x355d3c){var _0x4b0422={'raw':![],'where':{'id':_0x34cbb3[_0xe989('0x56')]['id']}},_0x84890e={};_0x84890e[_0xe989('0x57')]=_[_0xe989('0x58')](_[_0xe989('0x59')](db['User'][_0xe989('0x3b')]),[_0xe989('0x3f'),_0xe989('0x40')]);_0x84890e[_0xe989('0x44')]=_['keys'](_0x34cbb3[_0xe989('0x44')]);_0x84890e['filters']=_[_0xe989('0x5a')](_0x84890e[_0xe989('0x57')],_0x84890e[_0xe989('0x44')]);_0x4b0422[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x84890e[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x34cbb3[_0xe989('0x44')][_0xe989('0x5b')]));_0x4b0422[_0xe989('0x4b')]=_0x4b0422[_0xe989('0x4b')][_0xe989('0x50')]?_0x4b0422[_0xe989('0x4b')]:_0x84890e[_0xe989('0x57')];if(_0x34cbb3[_0xe989('0x44')][_0xe989('0x45')]){_0x4b0422[_0xe989('0x48')]=[{'all':!![]}];}if(_0x34cbb3['query']['userSetting']==='true'){_0x4b0422['include']=[{'model':db[_0xe989('0x49')],'as':_0xe989('0x46')}];}_0x4b0422=_['merge']({},_0x4b0422,_0x34cbb3[_0xe989('0x5c')]);if(!_[_0xe989('0x4a')](_0x4b0422[_0xe989('0x4b')],'id')){_0x4b0422[_0xe989('0x4b')][_0xe989('0x4c')]('id');}return db['User'][_0xe989('0x35')](_0x4b0422)[_0xe989('0x18')](handleEntityNotFound(_0x355d3c,null))[_0xe989('0x18')](function(_0x34f911){var _0x2a2b68=[];values=_0x34f911;if(_0x34cbb3['query'][_0xe989('0x4f')]===_0xe989('0x47')){_0x2a2b68[_0xe989('0x4c')](get_open_tabs(_0xe989('0x5d'),_0x34f911[_0xe989('0x51')]));_0x2a2b68[_0xe989('0x4c')](get_open_tabs(_0xe989('0x5e'),_0x34f911[_0xe989('0x51')]));_0x2a2b68['push'](get_open_tabs(_0xe989('0x5f'),_0x34f911[_0xe989('0x51')]));_0x2a2b68['push'](get_open_tabs(_0xe989('0x53'),_0x34f911[_0xe989('0x51')]));_0x2a2b68[_0xe989('0x4c')](get_open_tabs(_0xe989('0x52'),_0x34f911[_0xe989('0x51')]));_0x2a2b68[_0xe989('0x4c')](get_open_tabs(_0xe989('0x60'),_0x34f911[_0xe989('0x51')]));return Promise[_0xe989('0x61')](_0x2a2b68);}else{return values;}})[_0xe989('0x18')](function(){return values;})[_0xe989('0x18')](respondWithResult(_0x355d3c,null))[_0xe989('0x54')](handleError(_0x355d3c,null));};exports['update']=function(_0x198434,_0x2e1013){if(_0x198434[_0xe989('0x62')]['id']){delete _0x198434[_0xe989('0x62')]['id'];}delete _0x198434[_0xe989('0x62')]['role'];return db[_0xe989('0x43')]['find']({'where':{'id':_0x198434[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x2e1013,null))['then'](saveUpdates(_0x198434[_0xe989('0x62')],null))[_0xe989('0x18')](respondWithResult(_0x2e1013,null))[_0xe989('0x54')](handleError(_0x2e1013,null));};exports[_0xe989('0x63')]=function(_0x398155,_0x433141){return db[_0xe989('0x43')][_0xe989('0x63')]()[_0xe989('0x18')](respondWithResult(_0x433141,null))[_0xe989('0x54')](handleError(_0x433141,null));};exports[_0xe989('0x64')]=function(_0x586b4b,_0x4a9043){return db[_0xe989('0x43')][_0xe989('0x35')]({'where':{'id':_0x586b4b[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x4a9043,null))[_0xe989('0x18')](function(_0x18967c){if(_0x18967c){return _0x18967c[_0xe989('0x64')](_0x586b4b[_0xe989('0x62')]['ids'],_['omit'](_0x586b4b[_0xe989('0x62')],[_0xe989('0x65'),'id'])||{});}})[_0xe989('0x18')](respondWithResult(_0x4a9043,null))[_0xe989('0x54')](handleError(_0x4a9043,null));};function validateUser(_0x2395be){return new Promise(function(_0x1dce5d,_0x21e5a6){if(_0x2395be[_0xe989('0x66')])return _0x1dce5d(_0x2395be);return db[_0xe989('0x67')][_0xe989('0x68')](0x1)[_0xe989('0x18')](function(_0x47b860){if(_0x47b860[_0xe989('0x69')])authService['validatePasswordPattern'](_0x2395be[_0xe989('0x3f')]);db[_0xe989('0x43')]['max'](_0xe989('0x66'))[_0xe989('0x18')](function(_0x3fd2df){if(_[_0xe989('0x6a')](_0x3fd2df)){_0x2395be['internal']=_0x47b860[_0xe989('0x6b')]||0x1;return;}if(_[_0xe989('0x6a')](_0x47b860[_0xe989('0x6b')])||_0x47b860['min_internal']===_0x3fd2df){_0x2395be[_0xe989('0x66')]=_0x3fd2df+0x1;return;}if(_0x47b860[_0xe989('0x6b')]>_0x3fd2df){_0x2395be[_0xe989('0x66')]=_0x47b860[_0xe989('0x6b')];return;}return db['sequelize'][_0xe989('0x44')](_0xe989('0x6c'),{'type':db[_0xe989('0x6d')]['QueryTypes'][_0xe989('0x6e')]})['then'](function(_0x1bc186){if(_0x1bc186&&_0x1bc186[_0xe989('0x50')]){for(var _0x39b58d=0x0,_0x4250dc=_0x1bc186['length'];_0x39b58d<_0x4250dc&&_['isNil'](_0x2395be[_0xe989('0x66')]);_0x39b58d++){if(_0x47b860['min_internal']<=_0x1bc186[_0x39b58d][_0xe989('0x6f')]){_0x2395be[_0xe989('0x66')]=_0x1bc186[_0x39b58d][_0xe989('0x6f')];}else if(_0x47b860[_0xe989('0x6b')]>_0x1bc186[_0x39b58d][_0xe989('0x6f')]&&_0x47b860[_0xe989('0x6b')]<=_0x1bc186[_0x39b58d]['to']){_0x2395be[_0xe989('0x66')]=_0x47b860[_0xe989('0x6b')];}}}if(_[_0xe989('0x6a')](_0x2395be[_0xe989('0x66')])){_0x2395be[_0xe989('0x66')]=_0x3fd2df+0x1;}return _0x1dce5d(_0x2395be);});});})[_0xe989('0x54')](function(_0x5be107){_0x21e5a6(_0x5be107);});});}function updateUser(_0x26cdad){return new Promise(function(_0x39777c,_0x40d2f1){try{if(_0x26cdad[_0xe989('0x70')]){_0x26cdad[_0xe989('0x71')]=_0x26cdad[_0xe989('0x66')];_0x26cdad[_0xe989('0x72')]={'mailbox':_0x26cdad[_0xe989('0x66')],'password':_0x26cdad[_0xe989('0x3f')],'fullname':_0x26cdad[_0xe989('0x73')],'email':_0x26cdad['email']};}if(_0x26cdad['role']===_0xe989('0x31')){if(!_0x26cdad[_0xe989('0x74')])_0x26cdad[_0xe989('0x74')]=[_0xe989('0x75'),'102',_0xe989('0x76'),_0xe989('0x77'),'110',_0xe989('0x78'),_0xe989('0x79'),_0xe989('0x7a'),'107',_0xe989('0x7b'),_0xe989('0x7c'),_0xe989('0x7d'),_0xe989('0x7e'),_0xe989('0x7f'),_0xe989('0x80')];}_0x39777c(_0x26cdad);}catch(_0x31a7cc){_0x40d2f1(_0x31a7cc);}});}exports['create']=function(_0x1e0997,_0x21aed0){if(_0x1e0997[_0xe989('0x30')][_0xe989('0x2d')]==='agent')throw new Error('Unauthorized');if(_0x1e0997[_0xe989('0x62')]['role']===_0xe989('0x30')&&_0x1e0997[_0xe989('0x30')][_0xe989('0x2d')]!==_0xe989('0x2e')){throw new Error(_0xe989('0x81'));}if(_0x1e0997['body'][_0xe989('0x2d')]===_0xe989('0x2e')&&_0x1e0997[_0xe989('0x30')]['role']!==_0xe989('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xe989('0x82')]([_0x1e0997['body']])[_0xe989('0x18')](function(){return validateUser(_0x1e0997[_0xe989('0x62')]);})[_0xe989('0x18')](function(_0xde61ce){return updateUser(_0xde61ce)[_0xe989('0x18')](function(_0x230832){if(_0x230832[_0xe989('0x2d')]===_0xe989('0x2e')){_0x230832[_0xe989('0x83')]=_0x1e0997['user'][_0xe989('0x83')];delete _0x230832[_0xe989('0x84')];}return _0x230832;});})[_0xe989('0x18')](function(_0x297178){return db['User']['create'](_0x297178,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0xe989('0x18')](function(_0x1541c0){if(_0x1e0997[_0xe989('0x62')][_0xe989('0x2d')]===_0xe989('0x30'))return _0x1541c0;if(_0x1e0997[_0xe989('0x30')][_0xe989('0x2d')]!=='user')return _0x1541c0;return db[_0xe989('0x85')][_0xe989('0x35')]({'where':{'name':_0x1541c0[_0xe989('0x2d')]===_0xe989('0x31')?'Agents':_0xe989('0x86'),'userProfileId':_0x1e0997[_0xe989('0x30')]['userProfileId']},'raw':!![]})['then'](function(_0x4536d3){if(!_0x4536d3||_0x4536d3[_0xe989('0x87')]!=0x0)return _0x1541c0;return db[_0xe989('0x37')][_0xe989('0x88')]({'name':_0x1541c0[_0xe989('0x36')],'resourceId':_0x1541c0['id'],'type':_0x4536d3['name'],'sectionId':_0x4536d3['id']},{})['then'](function(){return _0x1541c0;});})[_0xe989('0x54')](function(_0x24d753){logger[_0xe989('0x1c')](_0xe989('0x89'),_0x24d753);throw _0x24d753;});})[_0xe989('0x18')](respondWithResult(_0x21aed0,0xc9))[_0xe989('0x54')](handleError(_0x21aed0,null));};exports[_0xe989('0x8a')]=function(_0x8a168d,_0x3fde3c){var _0x5afeb3=_0x8a168d[_0xe989('0x62')];var _0x527547=[];if(_0x8a168d['user']['role']===_0xe989('0x31'))throw new Error(_0xe989('0x8b'));if(_[_0xe989('0x8c')](_0x5afeb3,[_0xe989('0x2d'),_0xe989('0x30')])&&_0x8a168d['user']['role']!==_0xe989('0x2e')){throw new Error(_0xe989('0x81'));}if(_['some'](_0x5afeb3,['role','admin'])&&_0x8a168d[_0xe989('0x30')][_0xe989('0x2d')]!==_0xe989('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xe989('0x82')](_0x5afeb3)[_0xe989('0x18')](function(){return validateUser(_0x5afeb3[0x0]);})[_0xe989('0x18')](function(){for(var _0x21efde=0x1;_0x21efde<_0x5afeb3[_0xe989('0x50')];_0x21efde++){var _0x5daf19=_0x5afeb3[_0x21efde-0x1][_0xe989('0x66')];if(!_0x5afeb3[_0x21efde][_0xe989('0x66')])_0x5afeb3[_0x21efde][_0xe989('0x66')]=_0x5daf19+0x1;_0x527547[_0xe989('0x4c')](validateUser(_0x5afeb3[_0x21efde]));}return Promise[_0xe989('0x61')](_0x527547);})[_0xe989('0x18')](function(){_0x527547=[];for(var _0x201443=0x0;_0x201443<_0x5afeb3['length'];_0x201443++){_0x527547[_0xe989('0x4c')](updateUser(_0x5afeb3[_0x201443]));}return Promise[_0xe989('0x61')](_0x527547);})[_0xe989('0x18')](function(){_0x527547=_0x5afeb3[_0xe989('0x33')](function(_0x1773cb){return db[_0xe989('0x43')][_0xe989('0x88')](_0x1773cb,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0xe989('0x18')](function(_0x3c6a11){_0x1773cb['id']=_0x3c6a11['id'];return _0x1773cb;});});return Promise['all'](_0x527547);})[_0xe989('0x18')](function(_0x101736){if(_0x8a168d[_0xe989('0x62')]['role']===_0xe989('0x30'))return _0x101736;if(_0x8a168d[_0xe989('0x30')][_0xe989('0x2d')]!=='user')return _0x101736;var _0x93eed6=_[_0xe989('0x8c')](_0x101736,function(_0xe8af00){return _0xe8af00[_0xe989('0x2d')]===_0xe989('0x31')||_0xe8af00['role']===_0xe989('0x8d');});if(!_0x93eed6)return _0x101736;return db[_0xe989('0x85')]['findAll']({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x8a168d[_0xe989('0x30')][_0xe989('0x84')]},'raw':!![]})['then'](function(_0x6a32bf){if(_[_0xe989('0x8e')](_0x6a32bf)||!_[_0xe989('0x8c')](_0x6a32bf,[_0xe989('0x87'),0x0]))return _0x101736;_0x527547=[];var _0xad0db3=_(_0x6a32bf)[_0xe989('0x33')](function(_0x1b42f1){if(_0x1b42f1[_0xe989('0x87')]===0x1)return;return _0x1b42f1['name']===_0xe989('0x8f')?_0xe989('0x31'):_0xe989('0x8d');})[_0xe989('0x90')]()[_0xe989('0x34')]();for(var _0x1fa92f=0x0;_0x1fa92f<_0x101736[_0xe989('0x50')];_0x1fa92f++){if(!_['includes'](_0xad0db3,_0x101736[_0x1fa92f][_0xe989('0x2d')]))return;var _0x447f8b=_0x101736[_0x1fa92f][_0xe989('0x2d')]==='agent'?'Agents':_0xe989('0x86');_0x527547[_0xe989('0x4c')](db['UserProfileResource'][_0xe989('0x88')]({'name':_0x101736[_0x1fa92f][_0xe989('0x36')],'resourceId':_0x101736[_0x1fa92f]['id'],'type':_0x447f8b,'sectionId':_[_0xe989('0x35')](_0x6a32bf,[_0xe989('0x36'),_0x447f8b])['id']},{}));}return Promise['all'](_0x527547);});})[_0xe989('0x18')](respondWithResult(_0x3fde3c,0xc9))[_0xe989('0x54')](handleError(_0x3fde3c,null));};exports[_0xe989('0x91')]=function(_0x557544,_0x2df167){if(_0x557544[_0xe989('0x62')]['id']){delete _0x557544['body']['id'];}return db['User'][_0xe989('0x35')]({'where':{'id':_0x557544[_0xe989('0x56')]['id']}})[_0xe989('0x18')](function(_0x24c144){if(!_0x24c144)return null;if(_0x24c144['id']===_0x557544[_0xe989('0x30')]['id']){if(!_0x557544[_0xe989('0x62')]['oldPassword']||!_0x557544[_0xe989('0x62')][_0xe989('0x92')]){throw new db[(_0xe989('0x93'))][(_0xe989('0x94'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x24c144[_0xe989('0x95')](_0x557544[_0xe989('0x62')][_0xe989('0x96')])){throw new db[(_0xe989('0x93'))][(_0xe989('0x94'))](_0xe989('0x97'));}if(_0x557544[_0xe989('0x62')]['oldPassword']===_0x557544[_0xe989('0x62')]['newPassword']){throw new db[(_0xe989('0x93'))]['ValidationError'](_0xe989('0x98'));}}else if(_0x557544[_0xe989('0x30')][_0xe989('0x2d')]==='admin'){if(!_0x557544[_0xe989('0x62')][_0xe989('0x92')]){throw new db[(_0xe989('0x93'))][(_0xe989('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x557544[_0xe989('0x30')]['role']===_0xe989('0x30')){if(!_0x557544[_0xe989('0x62')][_0xe989('0x92')]){throw new db[(_0xe989('0x93'))]['ValidationError'](_0xe989('0x99'));}if(_0x24c144['role']!=='agent'){throw new db[(_0xe989('0x93'))][(_0xe989('0x94'))](_0xe989('0x8b'));}}else{throw new db[(_0xe989('0x93'))][(_0xe989('0x94'))](_0xe989('0x8b'));}return _0x24c144;})[_0xe989('0x18')](handleEntityNotFound(_0x2df167,null))[_0xe989('0x18')](function(_0x136ce9){return db[_0xe989('0x67')]['findOne']({'attributes':['id',_0xe989('0x69'),_0xe989('0x9a'),_0xe989('0x9b')]})['then'](function(_0x53bd3c){if(_0x53bd3c[_0xe989('0x69')])authService[_0xe989('0x9c')](_0x557544[_0xe989('0x62')][_0xe989('0x92')]);if(!_0x53bd3c[_0xe989('0x9a')]||!_0x136ce9[_0xe989('0x9d')])return _0x136ce9;authService[_0xe989('0x9e')](_0x557544['body'][_0xe989('0x92')],_0x136ce9[_0xe989('0x9d')],_0x53bd3c[_0xe989('0x9b')]);return _0x136ce9;})[_0xe989('0x18')](saveUpdates({'password':_0x557544[_0xe989('0x62')]['newPassword'],'passwordResetAt':_0x557544[_0xe989('0x30')]['id']==_0x557544['params']['id']?moment():null,'previousPasswords':authService[_0xe989('0x9f')](_0x557544[_0xe989('0x62')]['newPassword'],_0x136ce9[_0xe989('0x9d')])},null));})[_0xe989('0x18')](respondWithResult(_0x2df167,null))[_0xe989('0x54')](handleError(_0x2df167,null));};exports[_0xe989('0xa0')]=function(_0x47e268,_0x4c4b50){var _0x1142ad=_0x47e268[_0xe989('0x62')][_0xe989('0xa1')];return db[_0xe989('0x43')]['find']({'where':{'id':_0x47e268[_0xe989('0x56')]['id']},'attributes':['id','name','role',_0xe989('0xa2'),_0xe989('0xa3'),_0xe989('0xa4'),_0xe989('0xa5')]})[_0xe989('0x18')](handleEntityNotFound(_0x4c4b50,null))[_0xe989('0x18')](function(_0x3851a4){if(_0x3851a4){if(!utils['isValidChannel'](_0x1142ad)){throw new db[(_0xe989('0x93'))][(_0xe989('0x94'))](_0xe989('0xa6'));}return _0x3851a4[_0xe989('0xa7')+_[_0xe989('0xa8')](_0x1142ad[_0xe989('0xa9')]())+_0xe989('0xaa')](_0x47e268[_0xe989('0x62')]['ids'],{'penalty':_0x47e268[_0xe989('0x62')][_0xe989('0xab')]||0x0})[_0xe989('0xac')](function(_0x5147a5){for(var _0x2f13de=0x0;_0x2f13de<_0x47e268[_0xe989('0x62')][_0xe989('0x65')][_0xe989('0x50')];_0x2f13de+=0x1){var _0x59a86f={'UserId':Number(_0x47e268[_0xe989('0x56')]['id'])};_0x59a86f[_[_0xe989('0xa8')](_0x1142ad[_0xe989('0xa9')]())+_0xe989('0xad')]=Number(_0x47e268[_0xe989('0x62')]['ids'][_0x2f13de]);socket[_0xe989('0x2a')](_0xe989('0x30')+_['capitalize'](_0x1142ad['toLowerCase']())+_0xe989('0xae'),_0x59a86f);}return _0x5147a5;})[_0xe989('0x18')](function(){if(_0x1142ad===_0xe989('0xaf')){return db['VoiceQueue'][_0xe989('0x4d')]({'where':{'id':_0x47e268['body'][_0xe989('0x65')]||[]},'raw':!![],'attributes':['id',_0xe989('0x36')]});}})[_0xe989('0x18')](function(_0x4efcf2){var _0x2c0a55=_0x3851a4[_0xe989('0xb0')]({'plain':!![]});var _0xf2da9c=[];if(_0x1142ad===_0xe989('0xaf')&&_0x2c0a55[_0xe989('0x2d')]===_0xe989('0x31')&&_0x2c0a55[_0xe989('0xa2')]){for(let _0x5e9f9d=0x0;_0x5e9f9d<_0x4efcf2['length'];_0x5e9f9d+=0x1){_0xf2da9c[_0xe989('0x4c')]({'membername':_0x2c0a55['name'],'UserId':_0x2c0a55['id'],'queue_name':_0x4efcf2[_0x5e9f9d][_0xe989('0x36')],'VoiceQueueId':_0x4efcf2[_0x5e9f9d]['id'],'interface':_['isNil'](_0x2c0a55['interface'])?util[_0xe989('0xb1')]('SIP/%s',_0x2c0a55[_0xe989('0x36')]):_0x2c0a55[_0xe989('0xa5')],'paused':_0x2c0a55[_0xe989('0xa4')]||![],'penalty':_0x47e268[_0xe989('0x62')]['penalty']||0x0});}return Promise[_0xe989('0x61')](_0xf2da9c['map'](function(_0x2af721){return db[_0xe989('0xb2')]['upsert'](_0x2af721);}));}return _0x3851a4;});}})['then'](respondWithStatusCode(_0x4c4b50,null))['catch'](handleError(_0x4c4b50,null));};exports[_0xe989('0xb3')]=function(_0x3de3a5,_0x14aa34){var _0x240029,_0x20f618;return db[_0xe989('0x43')][_0xe989('0x35')]({'where':{'id':_0x3de3a5[_0xe989('0x56')]['id']},'attributes':['id',_0xe989('0x36'),_0xe989('0x2d')]})['then'](handleEntityNotFound(_0x14aa34,null))['then'](function(_0x4cee69){if(_0x4cee69){_0x240029=_0x4cee69;if(!_0x3de3a5[_0xe989('0x44')][_0xe989('0xa1')]||!utils[_0xe989('0xb4')](_0x3de3a5[_0xe989('0x44')][_0xe989('0xa1')])){throw new db[(_0xe989('0x93'))][(_0xe989('0x94'))](_0xe989('0xa6'));}return _0x4cee69['remove'+_[_0xe989('0xa8')](_0x3de3a5[_0xe989('0x44')]['channel'][_0xe989('0xa9')]())+_0xe989('0xaa')](_0x3de3a5[_0xe989('0x44')][_0xe989('0x65')]);}})[_0xe989('0x18')](function(_0x3dbc23){if(_[_0xe989('0xb5')](_0x3de3a5['query'][_0xe989('0x65')])){for(var _0x1648b8=0x0;_0x1648b8<_0x3de3a5[_0xe989('0x44')][_0xe989('0x65')][_0xe989('0x50')];_0x1648b8+=0x1){_0x20f618={'UserId':Number(_0x3de3a5[_0xe989('0x56')]['id'])};_0x20f618[_['capitalize'](_0x3de3a5[_0xe989('0x44')]['channel']['toLowerCase']())+'QueueId']=Number(_0x3de3a5[_0xe989('0x44')]['ids'][_0x1648b8]);socket[_0xe989('0x2a')](_0xe989('0x30')+_[_0xe989('0xa8')](_0x3de3a5[_0xe989('0x44')][_0xe989('0xa1')][_0xe989('0xa9')]())+'Queue:remove',_0x20f618);}}else{_0x20f618={'UserId':Number(_0x3de3a5['params']['id'])};_0x20f618[_['capitalize'](_0x3de3a5[_0xe989('0x44')][_0xe989('0xa1')][_0xe989('0xa9')]())+'QueueId']=Number(_0x3de3a5[_0xe989('0x44')]['ids']);socket[_0xe989('0x2a')]('user'+_[_0xe989('0xa8')](_0x3de3a5['query'][_0xe989('0xa1')][_0xe989('0xa9')]())+'Queue:remove',_0x20f618);}return _0x3dbc23;})[_0xe989('0x18')](function(){if(_0x3de3a5[_0xe989('0x44')]['channel']===_0xe989('0xaf')){return db[_0xe989('0xb2')][_0xe989('0x2c')]({'where':{'UserId':_0x3de3a5[_0xe989('0x56')]['id'],'VoiceQueueId':_0x3de3a5[_0xe989('0x44')][_0xe989('0x65')]},'individualHooks':!![]})['then'](function(){return _0x240029;});}return _0x240029;})[_0xe989('0x18')](respondWithStatusCode(_0x14aa34,null))[_0xe989('0x54')](handleError(_0x14aa34,null));};exports[_0xe989('0xb6')]=function(_0x2d753d,_0x178f0d){_0x2d753d[_0xe989('0x62')][_0xe989('0xb7')]=_0x2d753d[_0xe989('0xb8')][_0xe989('0xb9')];return db[_0xe989('0x43')][_0xe989('0x35')]({'where':{'id':_0x2d753d[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x178f0d,null))[_0xe989('0x18')](saveUpdates(_0x2d753d[_0xe989('0x62')],null))[_0xe989('0x18')](respondWithResult(_0x178f0d,null))['catch'](handleError(_0x178f0d,null));};exports[_0xe989('0xba')]=function(_0x2cb054,_0x4fff80){var _0x2354f0=path['join'](config[_0xe989('0xbb')],'server/files/images/logos/default_profile.png');return db['User'][_0xe989('0x35')]({'where':{'id':_0x2cb054[_0xe989('0x56')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xe989('0x18')](handleEntityNotFound(_0x4fff80,null))[_0xe989('0x18')](function(_0x962117){if(_0x962117){if(_[_0xe989('0x6a')](_0x962117[_0xe989('0xb7')])){return _0x4fff80[_0xe989('0xbc')](_0x2354f0);}else{if(!fs[_0xe989('0xbd')](path[_0xe989('0xbe')](config['root'],_0xe989('0xbf'),_0x962117[_0xe989('0xb7')]))){return _0x4fff80[_0xe989('0xbc')](_0x2354f0);}return _0x4fff80[_0xe989('0xbc')](path[_0xe989('0xbe')](config[_0xe989('0xbb')],'server/files/images/',_0x962117['userpic']));}}})[_0xe989('0x54')](handleError(_0x4fff80,null));};exports['getOpenTabs']=function(_0x55a40f,_0x456b48){return db[_0xe989('0x43')][_0xe989('0x35')]({'where':{'id':_0x55a40f[_0xe989('0x56')]['id']},'attributes':['id']})[_0xe989('0x18')](handleEntityNotFound(_0x456b48,null))[_0xe989('0x18')](function(_0x59b680){var _0x51112f=[];values=_0x59b680['dataValues'];_0x51112f[_0xe989('0x4c')](get_open_tabs(_0xe989('0x5d'),_0x59b680[_0xe989('0x51')]));_0x51112f['push'](get_open_tabs('sms',_0x59b680['dataValues']));_0x51112f[_0xe989('0x4c')](get_open_tabs(_0xe989('0x5f'),_0x59b680[_0xe989('0x51')]));_0x51112f[_0xe989('0x4c')](get_open_tabs('whatsapp',_0x59b680['dataValues']));_0x51112f[_0xe989('0x4c')](get_open_tabs('fax',_0x59b680[_0xe989('0x51')]));_0x51112f[_0xe989('0x4c')](get_open_tabs(_0xe989('0x60'),_0x59b680['dataValues']));return Promise[_0xe989('0x61')](_0x51112f);})[_0xe989('0x18')](function(_0x27fbba){if(_0x27fbba){var _0x71262d=_['map'](values[_0xe989('0xc0')],function(_0x363436){return{'channel':_0xe989('0xc1'),'id':_0x363436['id'],'createdAt':_0x363436[_0xe989('0xc2')]};});var _0xf36fdd=_[_0xe989('0x33')](values[_0xe989('0xc3')],function(_0x3c1deb){return{'channel':_0xe989('0xc4'),'id':_0x3c1deb['id'],'createdAt':_0x3c1deb[_0xe989('0xc2')]};});var _0x18c514=_[_0xe989('0x33')](values[_0xe989('0xc5')],function(_0xda04fd){return{'channel':_0xe989('0xc6'),'id':_0xda04fd['id'],'createdAt':_0xda04fd[_0xe989('0xc2')]};});var _0x3e7082=_[_0xe989('0x33')](values['MailOpenTabs'],function(_0x4c387a){return{'channel':'MAIL','id':_0x4c387a['id'],'createdAt':_0x4c387a[_0xe989('0xc2')]};});var _0x41140f=_['map'](values['SmsOpenTabs'],function(_0x59c077){return{'channel':_0xe989('0xc7'),'id':_0x59c077['id'],'createdAt':_0x59c077[_0xe989('0xc2')]};});var _0x466255=_[_0xe989('0x33')](values[_0xe989('0xc8')],function(_0x5d566d){return{'channel':_0xe989('0xc9'),'id':_0x5d566d['id'],'createdAt':_0x5d566d[_0xe989('0xc2')]};});var _0x2e38ab=_[_0xe989('0xca')](_0x71262d,_0xf36fdd,_0x18c514,_0x3e7082,_0x41140f,_0x466255);var _0x3645c0={'count':_0x2e38ab['length'],'rows':_0x2e38ab};return _0x3645c0;}else return null;})['then'](respondWithResult(_0x456b48,null))[_0xe989('0x54')](handleError(_0x456b48,null));};exports[_0xe989('0xcb')]=function(_0x4f3760,_0x5efc0f){var _0x52ecb9={};var _0xcc103a={};var _0x2c6aed;var _0x2d4b87;return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x4f3760[_0xe989('0x56')]['id']}})['then'](handleEntityNotFound(_0x5efc0f,null))[_0xe989('0x18')](function(_0x3018e2){if(_0x3018e2){_0x2c6aed=_0x3018e2;_0xcc103a[_0xe989('0x57')]=_[_0xe989('0x59')](db[_0xe989('0xcd')][_0xe989('0x3b')]);_0xcc103a[_0xe989('0x44')]=_['keys'](_0x4f3760[_0xe989('0x44')]);_0xcc103a['filters']=_['intersection'](_0xcc103a['model'],_0xcc103a[_0xe989('0x44')]);_0x52ecb9[_0xe989('0x4b')]=_['intersection'](_0xcc103a['model'],qs[_0xe989('0x5b')](_0x4f3760['query'][_0xe989('0x5b')]));_0x52ecb9[_0xe989('0x4b')]=_0x52ecb9['attributes'][_0xe989('0x50')]?_0x52ecb9[_0xe989('0x4b')]:_0xcc103a[_0xe989('0x57')];_0x52ecb9[_0xe989('0xce')]=qs['sort'](_0x4f3760[_0xe989('0x44')][_0xe989('0xcf')]);_0x52ecb9['where']=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x4f3760[_0xe989('0x44')],_0xcc103a[_0xe989('0xd0')]));if(_0x4f3760['query'][_0xe989('0x3e')]){_0x52ecb9['where']=_['merge'](_0x52ecb9['where'],{'$or':_[_0xe989('0x33')](_0x52ecb9[_0xe989('0x4b')],function(_0x18b33f){var _0x3b3c90={};_0x3b3c90[_0x18b33f]={'$like':'%'+_0x4f3760[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0x3b3c90;})});}_0x52ecb9=_['merge']({},_0x52ecb9,_0x4f3760['options']);return _0x2c6aed[_0xe989('0xcb')](_0x52ecb9);}})['then'](function(_0x26162c){if(_0x26162c){_0x2d4b87=_0x26162c[_0xe989('0x50')];if(_0x4f3760[_0xe989('0x44')][_0xe989('0xd2')](_0xe989('0x45'))){_0x52ecb9['include']=[{'model':db[_0xe989('0xd3')],'as':_0xe989('0xd4'),'required':![]},{'model':db[_0xe989('0xd5')],'as':_0xe989('0xd6'),'attributes':['id',_0xe989('0x36'),'color'],'where':_0x4f3760[_0xe989('0x44')]['tag']?{'id':_0x4f3760[_0xe989('0x44')][_0xe989('0xd7')]}:undefined,'required':_0x4f3760[_0xe989('0x44')][_0xe989('0xd7')]?!![]:![]}];}if(!_0x4f3760[_0xe989('0x44')][_0xe989('0xd2')]('nolimit')){_0x52ecb9['limit']=qs['limit'](_0x4f3760[_0xe989('0x44')]['limit']);_0x52ecb9[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x4f3760[_0xe989('0x44')]['offset']);}return _0x2c6aed[_0xe989('0xcb')](_0x52ecb9);}})[_0xe989('0x18')](function(_0xb748df){if(_0xb748df){return _0xb748df?{'count':_0x2d4b87,'rows':_0xb748df}:null;}})[_0xe989('0x18')](respondWithResult(_0x5efc0f,null))[_0xe989('0x54')](handleError(_0x5efc0f,null));};exports[_0xe989('0xd8')]=function(_0x1af876,_0x5ece09){var _0x561e88;var _0x474f83={};var _0x45ba77;return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x1af876[_0xe989('0x56')]['id']},'attributes':['id',_0xe989('0x36'),'role']})[_0xe989('0x18')](handleEntityNotFound(_0x5ece09,null))[_0xe989('0x18')](function(_0x50fac5){if(!utils[_0xe989('0xb4')](_0x1af876[_0xe989('0x44')][_0xe989('0xa1')])){throw new db['Sequelize'][(_0xe989('0x94'))](_0xe989('0xa6'));}_0x561e88=_0x50fac5;var _0x482254={};_0x482254[_0xe989('0x57')]=_[_0xe989('0x59')](db[_[_0xe989('0xa8')](_0x1af876[_0xe989('0x44')][_0xe989('0xa1')])+_0xe989('0xd9')][_0xe989('0x3b')]);_0x482254['query']=_[_0xe989('0x59')](_0x1af876[_0xe989('0x44')]);_0x482254[_0xe989('0xd0')]=_[_0xe989('0x5a')](_0x482254[_0xe989('0x57')],_0x482254['query']);_0x474f83['attributes']=_[_0xe989('0x5a')](_0x482254[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x1af876[_0xe989('0x44')]['fields']));_0x474f83[_0xe989('0x4b')]=_0x474f83[_0xe989('0x4b')]['length']?_0x474f83['attributes']:_0x482254[_0xe989('0x57')];_0x474f83['order']=qs[_0xe989('0xcf')](_0x1af876[_0xe989('0x44')]['sort']);_0x474f83[_0xe989('0x42')]=qs['filters'](_['pick'](_0x1af876[_0xe989('0x44')],_0x482254[_0xe989('0xd0')]));if(_0x1af876[_0xe989('0x44')]['filter']){_0x474f83[_0xe989('0x42')]=_['merge'](_0x474f83[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0x474f83[_0xe989('0x4b')],function(_0x50fcde){var _0x1c07af={};_0x1c07af[_0x50fcde]={'$like':'%'+_0x1af876[_0xe989('0x44')]['filter']+'%'};return _0x1c07af;})});}_0x474f83=_['merge']({},_0x474f83,_0x1af876[_0xe989('0x5c')]);switch(_0x561e88['role']){case _0xe989('0x2e'):return db[_['capitalize'](_0x1af876[_0xe989('0x44')]['channel'])+_0xe989('0xd9')][_0xe989('0x4d')](_0x474f83);case _0xe989('0x30'):case'agent':return _0x561e88[_0xe989('0xb0')+_[_0xe989('0xa8')](_0x1af876['query'][_0xe989('0xa1')])+_0xe989('0xaa')](_0x474f83);default:throw new db[(_0xe989('0x93'))][(_0xe989('0x94'))](_0xe989('0xda'));}})['then'](function(_0x724611){_0x45ba77=_0x724611[_0xe989('0x50')];if(!_0x1af876[_0xe989('0x44')][_0xe989('0xd2')]('nolimit')){_0x474f83[_0xe989('0x25')]=qs[_0xe989('0x25')](_0x1af876['query'][_0xe989('0x25')]);_0x474f83[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x1af876[_0xe989('0x44')][_0xe989('0x23')]);}switch(_0x561e88[_0xe989('0x2d')]){case _0xe989('0x2e'):return db[_[_0xe989('0xa8')](_0x1af876[_0xe989('0x44')]['channel'])+'Queue'][_0xe989('0x4d')](_0x474f83);case'user':case'agent':return _0x561e88[_0xe989('0xb0')+_['capitalize'](_0x1af876[_0xe989('0x44')][_0xe989('0xa1')])+'Queues'](_0x474f83);}})[_0xe989('0x18')](function(_0xf693c9){return{'count':_0x45ba77,'rows':_0xf693c9};})['then'](respondWithResult(_0x5ece09,null))[_0xe989('0x54')](handleError(_0x5ece09,null));};exports['getVoiceQueuesRt']=function(_0x466e66,_0x1c8132){var _0x172f6f={};var _0x56f55a={};var _0x400491;var _0x148a9b;return db[_0xe989('0x43')]['findOne']({'where':{'id':_0x466e66['params']['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x1c8132,null))['then'](function(_0x570f2a){if(_0x570f2a){_0x400491=_0x570f2a;_0x56f55a[_0xe989('0x57')]=_[_0xe989('0x59')](db[_0xe989('0xb2')]['rawAttributes']);_0x56f55a[_0xe989('0x44')]=_[_0xe989('0x59')](_0x466e66[_0xe989('0x44')]);_0x56f55a[_0xe989('0xd0')]=_['intersection'](_0x56f55a[_0xe989('0x57')],_0x56f55a[_0xe989('0x44')]);_0x172f6f[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x56f55a['model'],qs[_0xe989('0x5b')](_0x466e66[_0xe989('0x44')][_0xe989('0x5b')]));_0x172f6f[_0xe989('0x4b')]=_0x172f6f[_0xe989('0x4b')][_0xe989('0x50')]?_0x172f6f[_0xe989('0x4b')]:_0x56f55a[_0xe989('0x57')];_0x172f6f['order']=qs['sort'](_0x466e66[_0xe989('0x44')][_0xe989('0xcf')]);_0x172f6f[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x466e66['query'],_0x56f55a[_0xe989('0xd0')]));if(_0x466e66[_0xe989('0x44')]['filter']){_0x172f6f[_0xe989('0x42')]=_[_0xe989('0xdb')](_0x172f6f[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0x172f6f['attributes'],function(_0xbf7d68){var _0x439cbe={};_0x439cbe[_0xbf7d68]={'$like':'%'+_0x466e66[_0xe989('0x44')]['filter']+'%'};return _0x439cbe;})});}_0x172f6f=_['merge']({},_0x172f6f,_0x466e66[_0xe989('0x5c')]);return _0x400491[_0xe989('0xdc')](_0x172f6f);}})[_0xe989('0x18')](function(_0x17c2fb){if(_0x17c2fb){_0x148a9b=_0x17c2fb[_0xe989('0x50')];if(!_0x466e66['query'][_0xe989('0xd2')](_0xe989('0xdd'))){_0x172f6f[_0xe989('0x25')]=qs[_0xe989('0x25')](_0x466e66['query']['limit']);_0x172f6f[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x466e66[_0xe989('0x44')]['offset']);}return _0x400491['getVoiceQueuesRt'](_0x172f6f);}})['then'](function(_0x485a39){if(_0x485a39){return _0x485a39?{'count':_0x148a9b,'rows':_0x485a39}:null;}})[_0xe989('0x18')](respondWithResult(_0x1c8132,null))[_0xe989('0x54')](handleError(_0x1c8132,null));};exports[_0xe989('0xde')]=function(_0x201b6a,_0x36b17b){var _0x3e0bf2={};var _0x68518f={};var _0x50cb0f;var _0xf83466;return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x201b6a['params']['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x36b17b,null))[_0xe989('0x18')](function(_0xd6b9fa){if(_0xd6b9fa){_0x50cb0f=_0xd6b9fa;_0x68518f['model']=_[_0xe989('0x59')](db[_0xe989('0xdf')][_0xe989('0x3b')]);_0x68518f['query']=_[_0xe989('0x59')](_0x201b6a[_0xe989('0x44')]);_0x68518f[_0xe989('0xd0')]=_['intersection'](_0x68518f['model'],_0x68518f[_0xe989('0x44')]);_0x3e0bf2[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x68518f['model'],qs['fields'](_0x201b6a[_0xe989('0x44')][_0xe989('0x5b')]));_0x3e0bf2['attributes']=_0x3e0bf2[_0xe989('0x4b')]['length']?_0x3e0bf2[_0xe989('0x4b')]:_0x68518f[_0xe989('0x57')];_0x3e0bf2[_0xe989('0xce')]=qs['sort'](_0x201b6a[_0xe989('0x44')]['sort']);_0x3e0bf2[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x201b6a[_0xe989('0x44')],_0x68518f['filters']));if(_0x201b6a[_0xe989('0x44')]['filter']){_0x3e0bf2[_0xe989('0x42')]=_[_0xe989('0xdb')](_0x3e0bf2[_0xe989('0x42')],{'$or':_['map'](_0x3e0bf2[_0xe989('0x4b')],function(_0x1dc173){var _0x3d4030={};_0x3d4030[_0x1dc173]={'$like':'%'+_0x201b6a[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0x3d4030;})});}_0x3e0bf2=_[_0xe989('0xdb')]({},_0x3e0bf2,_0x201b6a['options']);return _0x50cb0f['getGroups'](_0x3e0bf2);}})[_0xe989('0x18')](function(_0x1f29d7){if(_0x1f29d7){_0xf83466=_0x1f29d7[_0xe989('0x50')];if(!_0x201b6a['query'][_0xe989('0xd2')](_0xe989('0xdd'))){_0x3e0bf2[_0xe989('0x25')]=qs[_0xe989('0x25')](_0x201b6a[_0xe989('0x44')][_0xe989('0x25')]);_0x3e0bf2[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x201b6a[_0xe989('0x44')]['offset']);}return _0x50cb0f['getGroups'](_0x3e0bf2);}})['then'](function(_0x312c92){if(_0x312c92){return _0x312c92?{'count':_0xf83466,'rows':_0x312c92}:null;}})[_0xe989('0x18')](respondWithResult(_0x36b17b,null))[_0xe989('0x54')](handleError(_0x36b17b,null));};exports[_0xe989('0xe0')]=function(_0x1033ec,_0x15f4a0){var _0x4fa886={'raw':!![],'where':{}};var _0x4009a8={};var _0x2314e9={'count':0x0,'rows':[]};return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x1033ec[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x15f4a0,null))[_0xe989('0x18')](function(_0x5630df){if(_0x5630df){_0x4009a8[_0xe989('0x57')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x4009a8[_0xe989('0x44')]=_['keys'](_0x1033ec[_0xe989('0x44')]);_0x4009a8[_0xe989('0xd0')]=_['intersection'](_0x4009a8[_0xe989('0x57')],_0x4009a8[_0xe989('0x44')]);_0x4fa886['attributes']=_['intersection'](_0x4009a8[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x1033ec['query'][_0xe989('0x5b')]));_0x4fa886[_0xe989('0x4b')]=_0x4fa886[_0xe989('0x4b')][_0xe989('0x50')]?_0x4fa886[_0xe989('0x4b')]:_0x4009a8[_0xe989('0x57')];if(!_0x1033ec[_0xe989('0x44')][_0xe989('0xd2')]('nolimit')){_0x4fa886['limit']=qs[_0xe989('0x25')](_0x1033ec[_0xe989('0x44')][_0xe989('0x25')]);_0x4fa886['offset']=qs[_0xe989('0x23')](_0x1033ec['query'][_0xe989('0x23')]);}_0x4fa886[_0xe989('0xce')]=qs[_0xe989('0xcf')](_0x1033ec['query'][_0xe989('0xcf')]);_0x4fa886[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x1033ec[_0xe989('0x44')],_0x4009a8['filters']));_0x4fa886[_0xe989('0x42')][_0xe989('0xe1')]=_0x5630df['id'];if(_0x1033ec[_0xe989('0x44')][_0xe989('0x3e')]){_0x4fa886[_0xe989('0x42')]=_[_0xe989('0xdb')](_0x4fa886['where'],{'$or':_['map'](_0x4fa886[_0xe989('0x4b')],function(_0x3ef1e7){var _0x1d3deb={};_0x1d3deb[_0x3ef1e7]={'$like':'%'+_0x1033ec[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0x1d3deb;})});}_0x4fa886=_[_0xe989('0xdb')]({},_0x4fa886,_0x1033ec[_0xe989('0x5c')]);return db[_0xe989('0xe2')][_0xe989('0x26')]({'where':_0x4fa886['where']})['then'](function(_0x215bbc){_0x2314e9[_0xe989('0x26')]=_0x215bbc;if(_0x1033ec['query']['includeAll']){_0x4fa886['include']=[{'all':!![]}];}return db[_0xe989('0xe2')][_0xe989('0x4d')](_0x4fa886);})[_0xe989('0x18')](function(_0x3064ee){_0x2314e9[_0xe989('0x4e')]=_0x3064ee;return _0x2314e9;});}})[_0xe989('0x18')](respondWithFilteredResult(_0x15f4a0,_0x4fa886))[_0xe989('0x54')](handleError(_0x15f4a0,null));};exports[_0xe989('0xe3')]=function(_0x2fddee,_0x3b176c){var _0x364535={'raw':!![],'where':{}};var _0x50349e={};var _0x4d66b3={'count':0x0,'rows':[]};return db[_0xe989('0x43')]['findOne']({'where':{'id':_0x2fddee[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x3b176c,null))['then'](function(_0x16a232){if(_0x16a232){_0x50349e[_0xe989('0x57')]=_[_0xe989('0x59')](db[_0xe989('0xe4')][_0xe989('0x3b')]);_0x50349e[_0xe989('0x44')]=_[_0xe989('0x59')](_0x2fddee['query']);_0x50349e['filters']=_[_0xe989('0x5a')](_0x50349e['model'],_0x50349e['query']);_0x364535[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x50349e['model'],qs['fields'](_0x2fddee['query'][_0xe989('0x5b')]));_0x364535['attributes']=_0x364535[_0xe989('0x4b')][_0xe989('0x50')]?_0x364535['attributes']:_0x50349e[_0xe989('0x57')];if(!_0x2fddee[_0xe989('0x44')]['hasOwnProperty'](_0xe989('0xdd'))){_0x364535[_0xe989('0x25')]=qs[_0xe989('0x25')](_0x2fddee[_0xe989('0x44')]['limit']);_0x364535['offset']=qs['offset'](_0x2fddee[_0xe989('0x44')][_0xe989('0x23')]);}_0x364535[_0xe989('0xce')]=qs[_0xe989('0xcf')](_0x2fddee[_0xe989('0x44')][_0xe989('0xcf')]);_0x364535[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x2fddee['query'],_0x50349e[_0xe989('0xd0')]));_0x364535[_0xe989('0x42')][_0xe989('0xe1')]=_0x16a232['id'];if(_0x2fddee['query'][_0xe989('0x3e')]){_0x364535[_0xe989('0x42')]=_[_0xe989('0xdb')](_0x364535[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0x364535['attributes'],function(_0x3d7c83){var _0x7eca9={};_0x7eca9[_0x3d7c83]={'$like':'%'+_0x2fddee[_0xe989('0x44')]['filter']+'%'};return _0x7eca9;})});}_0x364535=_[_0xe989('0xdb')]({},_0x364535,_0x2fddee['options']);return db['ScreenRecording'][_0xe989('0x26')]({'where':_0x364535[_0xe989('0x42')]})[_0xe989('0x18')](function(_0x2f3ea1){_0x4d66b3[_0xe989('0x26')]=_0x2f3ea1;if(_0x2fddee[_0xe989('0x44')][_0xe989('0x45')]){_0x364535['include']=[{'all':!![]}];}return db[_0xe989('0xe4')][_0xe989('0x4d')](_0x364535);})[_0xe989('0x18')](function(_0x5be590){_0x4d66b3[_0xe989('0x4e')]=_0x5be590;return _0x4d66b3;});}})[_0xe989('0x18')](respondWithFilteredResult(_0x3b176c,_0x364535))[_0xe989('0x54')](handleError(_0x3b176c,null));};exports[_0xe989('0xe5')]=function(_0x2c2aa3,_0x15a205){var _0x444e4f={};var _0x2020b2={};var _0x1d4c21;var _0x253ad5;return db['User']['findOne']({'where':{'id':_0x2c2aa3[_0xe989('0x56')]['id']}})['then'](handleEntityNotFound(_0x15a205,null))[_0xe989('0x18')](function(_0x435469){if(_0x435469){_0x1d4c21=_0x435469;_0x2020b2[_0xe989('0x57')]=_['keys'](db[_0xe989('0xe6')][_0xe989('0x3b')]);_0x2020b2['query']=_[_0xe989('0x59')](_0x2c2aa3[_0xe989('0x44')]);_0x2020b2['filters']=_[_0xe989('0x5a')](_0x2020b2[_0xe989('0x57')],_0x2020b2['query']);_0x444e4f[_0xe989('0x4b')]=_['intersection'](_0x2020b2[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x2c2aa3[_0xe989('0x44')]['fields']));_0x444e4f[_0xe989('0x4b')]=_0x444e4f[_0xe989('0x4b')][_0xe989('0x50')]?_0x444e4f['attributes']:_0x2020b2[_0xe989('0x57')];_0x444e4f[_0xe989('0xce')]=qs[_0xe989('0xcf')](_0x2c2aa3[_0xe989('0x44')][_0xe989('0xcf')]);_0x444e4f[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x2c2aa3[_0xe989('0x44')],_0x2020b2['filters']));if(_0x2c2aa3['query'][_0xe989('0x3e')]){_0x444e4f['where']=_[_0xe989('0xdb')](_0x444e4f['where'],{'$or':_[_0xe989('0x33')](_0x444e4f['attributes'],function(_0x4706d2){var _0xc0a99f={};_0xc0a99f[_0x4706d2]={'$like':'%'+_0x2c2aa3[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0xc0a99f;})});}_0x444e4f=_[_0xe989('0xdb')]({},_0x444e4f,_0x2c2aa3[_0xe989('0x5c')]);return _0x1d4c21[_0xe989('0xe5')](_0x444e4f);}})[_0xe989('0x18')](function(_0x5de33d){if(_0x5de33d){_0x253ad5=_0x5de33d[_0xe989('0x50')];if(!_0x2c2aa3['query'][_0xe989('0xd2')](_0xe989('0xdd'))){_0x444e4f['limit']=qs[_0xe989('0x25')](_0x2c2aa3['query']['limit']);_0x444e4f[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x2c2aa3[_0xe989('0x44')]['offset']);}return _0x1d4c21[_0xe989('0xe5')](_0x444e4f);}})[_0xe989('0x18')](function(_0x15b79d){if(_0x15b79d){return _0x15b79d?{'count':_0x253ad5,'rows':_0x15b79d}:null;}})[_0xe989('0x18')](respondWithResult(_0x15a205,null))[_0xe989('0x54')](handleError(_0x15a205,null));};exports[_0xe989('0xe7')]=function(_0xdb4e84,_0x6e71b7){var _0xd07763={};var _0x55d97e={};var _0x4949a0;var _0x2d98da;return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0xdb4e84[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x6e71b7,null))['then'](function(_0x2e2a98){if(_0x2e2a98){_0x4949a0=_0x2e2a98;_0x55d97e[_0xe989('0x57')]=_[_0xe989('0x59')](db[_0xe989('0xe8')][_0xe989('0x3b')]);_0x55d97e[_0xe989('0x44')]=_[_0xe989('0x59')](_0xdb4e84['query']);_0x55d97e[_0xe989('0xd0')]=_['intersection'](_0x55d97e['model'],_0x55d97e['query']);_0xd07763[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x55d97e[_0xe989('0x57')],qs['fields'](_0xdb4e84[_0xe989('0x44')]['fields']));_0xd07763[_0xe989('0x4b')]=_0xd07763[_0xe989('0x4b')]['length']?_0xd07763[_0xe989('0x4b')]:_0x55d97e[_0xe989('0x57')];_0xd07763[_0xe989('0xce')]=qs['sort'](_0xdb4e84[_0xe989('0x44')][_0xe989('0xcf')]);_0xd07763['where']=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0xdb4e84['query'],_0x55d97e[_0xe989('0xd0')]));if(_0xdb4e84['query'][_0xe989('0x3e')]){_0xd07763[_0xe989('0x42')]=_[_0xe989('0xdb')](_0xd07763[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0xd07763[_0xe989('0x4b')],function(_0x2d589c){var _0xdf4911={};_0xdf4911[_0x2d589c]={'$like':'%'+_0xdb4e84[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0xdf4911;})});}_0xd07763=_[_0xe989('0xdb')]({},_0xd07763,_0xdb4e84[_0xe989('0x5c')]);return _0x4949a0[_0xe989('0xe7')](_0xd07763);}})[_0xe989('0x18')](function(_0x2b2554){if(_0x2b2554){_0x2d98da=_0x2b2554['length'];if(!_0xdb4e84[_0xe989('0x44')][_0xe989('0xd2')]('nolimit')){_0xd07763[_0xe989('0x25')]=qs['limit'](_0xdb4e84[_0xe989('0x44')][_0xe989('0x25')]);_0xd07763['offset']=qs['offset'](_0xdb4e84[_0xe989('0x44')][_0xe989('0x23')]);}return _0x4949a0[_0xe989('0xe7')](_0xd07763);}})[_0xe989('0x18')](function(_0x2fc537){if(_0x2fc537){return _0x2fc537?{'count':_0x2d98da,'rows':_0x2fc537}:null;}})[_0xe989('0x18')](respondWithResult(_0x6e71b7,null))[_0xe989('0x54')](handleError(_0x6e71b7,null));};exports[_0xe989('0xe9')]=function(_0x27c0de,_0x58b72e){var _0x17ef8a={'raw':!![],'where':{}};var _0x240018={};var _0x5d3426={'count':0x0,'rows':[]};return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x27c0de[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x58b72e,null))[_0xe989('0x18')](function(_0x290291){if(_0x290291){_0x240018[_0xe989('0x57')]=_[_0xe989('0x59')](db['MailInteraction']['rawAttributes']);_0x240018[_0xe989('0x44')]=_[_0xe989('0x59')](_0x27c0de[_0xe989('0x44')]);_0x240018[_0xe989('0xd0')]=_[_0xe989('0x5a')](_0x240018[_0xe989('0x57')],_0x240018['query']);_0x17ef8a['attributes']=_[_0xe989('0x5a')](_0x240018[_0xe989('0x57')],qs['fields'](_0x27c0de[_0xe989('0x44')][_0xe989('0x5b')]));_0x17ef8a[_0xe989('0x4b')]=_0x17ef8a[_0xe989('0x4b')]['length']?_0x17ef8a['attributes']:_0x240018[_0xe989('0x57')];if(!_0x27c0de[_0xe989('0x44')][_0xe989('0xd2')](_0xe989('0xdd'))){_0x17ef8a['limit']=qs[_0xe989('0x25')](_0x27c0de[_0xe989('0x44')]['limit']);_0x17ef8a['offset']=qs[_0xe989('0x23')](_0x27c0de[_0xe989('0x44')][_0xe989('0x23')]);}_0x17ef8a[_0xe989('0xce')]=qs['sort'](_0x27c0de['query'][_0xe989('0xcf')]);_0x17ef8a[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x27c0de[_0xe989('0x44')],_0x240018['filters']));_0x17ef8a[_0xe989('0x42')][_0xe989('0xe1')]=_0x290291['id'];if(_0x27c0de[_0xe989('0x44')]['filter']){_0x17ef8a[_0xe989('0x42')]=_['merge'](_0x17ef8a[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0x17ef8a[_0xe989('0x4b')],function(_0x4b8275){var _0x11eee0={};_0x11eee0[_0x4b8275]={'$like':'%'+_0x27c0de[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0x11eee0;})});}_0x17ef8a=_['merge']({},_0x17ef8a,_0x27c0de[_0xe989('0x5c')]);return db[_0xe989('0xea')][_0xe989('0x26')]({'where':_0x17ef8a['where']})[_0xe989('0x18')](function(_0x13a787){_0x5d3426[_0xe989('0x26')]=_0x13a787;if(_0x27c0de[_0xe989('0x44')]['includeAll']){_0x17ef8a['include']=[{'all':!![]}];}return db[_0xe989('0xea')][_0xe989('0x4d')](_0x17ef8a);})[_0xe989('0x18')](function(_0x1e33b6){_0x5d3426[_0xe989('0x4e')]=_0x1e33b6;return _0x5d3426;});}})[_0xe989('0x18')](respondWithFilteredResult(_0x58b72e,_0x17ef8a))['catch'](handleError(_0x58b72e,null));};exports['getSmsInteractions']=function(_0x3e4933,_0x1e6682){var _0x4047f7={};var _0x2fab3e={};var _0x5186af;var _0x5680ea;return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x3e4933[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x1e6682,null))['then'](function(_0x4a5f68){if(_0x4a5f68){_0x5186af=_0x4a5f68;_0x2fab3e[_0xe989('0x57')]=_[_0xe989('0x59')](db['SmsInteraction']['rawAttributes']);_0x2fab3e[_0xe989('0x44')]=_['keys'](_0x3e4933[_0xe989('0x44')]);_0x2fab3e[_0xe989('0xd0')]=_[_0xe989('0x5a')](_0x2fab3e[_0xe989('0x57')],_0x2fab3e['query']);_0x4047f7[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x2fab3e[_0xe989('0x57')],qs['fields'](_0x3e4933['query'][_0xe989('0x5b')]));_0x4047f7[_0xe989('0x4b')]=_0x4047f7[_0xe989('0x4b')][_0xe989('0x50')]?_0x4047f7[_0xe989('0x4b')]:_0x2fab3e['model'];_0x4047f7[_0xe989('0xce')]=qs['sort'](_0x3e4933[_0xe989('0x44')]['sort']);_0x4047f7['where']=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x3e4933[_0xe989('0x44')],_0x2fab3e['filters']));if(_0x3e4933[_0xe989('0x44')][_0xe989('0x3e')]){_0x4047f7['where']=_[_0xe989('0xdb')](_0x4047f7[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0x4047f7[_0xe989('0x4b')],function(_0x285c05){var _0x5386e4={};_0x5386e4[_0x285c05]={'$like':'%'+_0x3e4933[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0x5386e4;})});}_0x4047f7=_[_0xe989('0xdb')]({},_0x4047f7,_0x3e4933[_0xe989('0x5c')]);return _0x5186af[_0xe989('0xeb')](_0x4047f7);}})[_0xe989('0x18')](function(_0x47ec08){if(_0x47ec08){_0x5680ea=_0x47ec08['length'];if(!_0x3e4933[_0xe989('0x44')][_0xe989('0xd2')]('nolimit')){_0x4047f7['limit']=qs['limit'](_0x3e4933['query'][_0xe989('0x25')]);_0x4047f7[_0xe989('0x23')]=qs['offset'](_0x3e4933[_0xe989('0x44')][_0xe989('0x23')]);}return _0x5186af[_0xe989('0xeb')](_0x4047f7);}})[_0xe989('0x18')](function(_0x5593aa){if(_0x5593aa){return _0x5593aa?{'count':_0x5680ea,'rows':_0x5593aa}:null;}})[_0xe989('0x18')](respondWithResult(_0x1e6682,null))[_0xe989('0x54')](handleError(_0x1e6682,null));};exports[_0xe989('0xec')]=function(_0x4c191e,_0xe47f76){var _0x3e9fe={};var _0x5e5c6d={};var _0x56afcc;var _0x59e17e;return db['User']['findOne']({'where':{'id':_0x4c191e[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0xe47f76,null))[_0xe989('0x18')](function(_0x6f7a36){if(_0x6f7a36){_0x56afcc=_0x6f7a36;_0x5e5c6d[_0xe989('0x57')]=_[_0xe989('0x59')](db[_0xe989('0xed')][_0xe989('0x3b')]);_0x5e5c6d['query']=_['keys'](_0x4c191e[_0xe989('0x44')]);_0x5e5c6d[_0xe989('0xd0')]=_['intersection'](_0x5e5c6d['model'],_0x5e5c6d[_0xe989('0x44')]);_0x3e9fe['attributes']=_[_0xe989('0x5a')](_0x5e5c6d[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x4c191e[_0xe989('0x44')][_0xe989('0x5b')]));_0x3e9fe[_0xe989('0x4b')]=_0x3e9fe[_0xe989('0x4b')][_0xe989('0x50')]?_0x3e9fe['attributes']:_0x5e5c6d['model'];_0x3e9fe['order']=qs[_0xe989('0xcf')](_0x4c191e['query'][_0xe989('0xcf')]);_0x3e9fe[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x4c191e[_0xe989('0x44')],_0x5e5c6d[_0xe989('0xd0')]));if(_0x4c191e[_0xe989('0x44')][_0xe989('0x3e')]){_0x3e9fe[_0xe989('0x42')]=_['merge'](_0x3e9fe[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0x3e9fe[_0xe989('0x4b')],function(_0x105130){var _0x399cd9={};_0x399cd9[_0x105130]={'$like':'%'+_0x4c191e[_0xe989('0x44')]['filter']+'%'};return _0x399cd9;})});}_0x3e9fe=_[_0xe989('0xdb')]({},_0x3e9fe,_0x4c191e[_0xe989('0x5c')]);return _0x56afcc[_0xe989('0xec')](_0x3e9fe);}})[_0xe989('0x18')](function(_0x2e295b){if(_0x2e295b){_0x59e17e=_0x2e295b[_0xe989('0x50')];if(!_0x4c191e[_0xe989('0x44')]['hasOwnProperty']('nolimit')){_0x3e9fe[_0xe989('0x25')]=qs[_0xe989('0x25')](_0x4c191e[_0xe989('0x44')][_0xe989('0x25')]);_0x3e9fe[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x4c191e[_0xe989('0x44')][_0xe989('0x23')]);}return _0x56afcc[_0xe989('0xec')](_0x3e9fe);}})[_0xe989('0x18')](function(_0x4c5093){if(_0x4c5093){return _0x4c5093?{'count':_0x59e17e,'rows':_0x4c5093}:null;}})['then'](respondWithResult(_0xe47f76,null))[_0xe989('0x54')](handleError(_0xe47f76,null));};exports[_0xe989('0xee')]=function(_0x4dfd63,_0x2edb23){var _0x27fe89={};var _0x204ae3={};var _0x13457a;var _0x6029f5;return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x4dfd63[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x2edb23,null))[_0xe989('0x18')](function(_0x30557c){if(_0x30557c){_0x13457a=_0x30557c;_0x204ae3[_0xe989('0x57')]=_[_0xe989('0x59')](db[_0xe989('0xef')][_0xe989('0x3b')]);_0x204ae3['query']=_[_0xe989('0x59')](_0x4dfd63['query']);_0x204ae3['filters']=_[_0xe989('0x5a')](_0x204ae3[_0xe989('0x57')],_0x204ae3[_0xe989('0x44')]);_0x27fe89[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x204ae3[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x4dfd63[_0xe989('0x44')]['fields']));_0x27fe89['attributes']=_0x27fe89[_0xe989('0x4b')][_0xe989('0x50')]?_0x27fe89[_0xe989('0x4b')]:_0x204ae3['model'];_0x27fe89[_0xe989('0xce')]=qs[_0xe989('0xcf')](_0x4dfd63[_0xe989('0x44')][_0xe989('0xcf')]);_0x27fe89[_0xe989('0x42')]=qs[_0xe989('0xd0')](_['pick'](_0x4dfd63[_0xe989('0x44')],_0x204ae3['filters']));if(_0x4dfd63[_0xe989('0x44')][_0xe989('0x3e')]){_0x27fe89[_0xe989('0x42')]=_[_0xe989('0xdb')](_0x27fe89[_0xe989('0x42')],{'$or':_['map'](_0x27fe89[_0xe989('0x4b')],function(_0x31661e){var _0x27bd14={};_0x27bd14[_0x31661e]={'$like':'%'+_0x4dfd63[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0x27bd14;})});}_0x27fe89=_[_0xe989('0xdb')]({},_0x27fe89,_0x4dfd63[_0xe989('0x5c')]);return _0x13457a['getWhatsappInteractions'](_0x27fe89);}})[_0xe989('0x18')](function(_0x3c9946){if(_0x3c9946){_0x6029f5=_0x3c9946[_0xe989('0x50')];if(!_0x4dfd63[_0xe989('0x44')][_0xe989('0xd2')](_0xe989('0xdd'))){_0x27fe89[_0xe989('0x25')]=qs[_0xe989('0x25')](_0x4dfd63[_0xe989('0x44')][_0xe989('0x25')]);_0x27fe89[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x4dfd63[_0xe989('0x44')][_0xe989('0x23')]);}return _0x13457a[_0xe989('0xee')](_0x27fe89);}})[_0xe989('0x18')](function(_0x5c5be2){if(_0x5c5be2){return _0x5c5be2?{'count':_0x6029f5,'rows':_0x5c5be2}:null;}})[_0xe989('0x18')](respondWithResult(_0x2edb23,null))['catch'](handleError(_0x2edb23,null));};exports[_0xe989('0xf0')]=function(_0x40a979,_0x186972,_0x41e7c9){var _0x410267;var _0x579ffb;var _0x5daa9d;var _0x2525d5=!_[_0xe989('0x6a')](_0x40a979['params']['id'])?_0x40a979[_0xe989('0x56')]['id']:!_[_0xe989('0x6a')](_0x40a979[_0xe989('0x30')]['id'])?_0x40a979[_0xe989('0x30')]['id']:null;return db[_0xe989('0x43')][_0xe989('0x35')]({'where':{'id':_0x2525d5,'role':{'$or':[_0xe989('0x2e'),'user',_0xe989('0x31')]}},'attributes':['id',_0xe989('0x36'),'phone','mobile',_0xe989('0x2d'),'internal','loginInPause']})['then'](function(_0x54ad92){if(_0x54ad92){if(_0x54ad92['role']==='agent'){_0x410267=_0x54ad92;if(_0x40a979['body']['interface']){_0x5daa9d=util[_0xe989('0xb1')](_0xe989('0xf1'),_0x410267[_0x40a979[_0xe989('0x62')][_0xe989('0xa5')]]);}else if(_0x40a979[_0xe989('0x62')][_0xe989('0xf2')]){_0x5daa9d=util[_0xe989('0xb1')](_0xe989('0xf3'),_0x40a979[_0xe989('0x62')][_0xe989('0xf2')]);}else{_0x5daa9d=util[_0xe989('0xb1')]('SIP/%s',_0x410267['name']);}socket['to'](util[_0xe989('0xb1')](_0xe989('0xf4'),_0x410267['name']))[_0xe989('0x2a')]('user:forcelogout',{'user':{'id':_0x410267['id'],'name':_0x410267[_0xe989('0x36')]},'ip':_0x40a979[_0xe989('0xf5')][_0xe989('0xf6')]||_0x40a979[_0xe989('0xf7')][_0xe989('0xf8')]||_0x40a979[_0xe989('0xf9')]['remoteAddress']||_0x40a979[_0xe989('0xf7')]['socket'][_0xe989('0xf8')]});return db[_0xe989('0xb2')][_0xe989('0x2c')]({'where':{'membername':_0x410267[_0xe989('0x36')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError'](_0xe989('0xfa'));}})[_0xe989('0x18')](function(){if(_0x410267){return _0x410267[_0xe989('0xfb')]({'raw':!![]});}})[_0xe989('0x18')](function(_0x42b4ae){if(_0x410267){if(_0x42b4ae){_0x579ffb=_0x42b4ae;if(_0x579ffb[_0xe989('0x50')]){var _0xc917b8=_0x579ffb[_0xe989('0x33')](function(_0x3aa670){var _0x47e1c2={'membername':_0x410267[_0xe989('0x36')],'UserId':_0x410267['id'],'queue_name':_0x3aa670['name'],'VoiceQueueId':_0x3aa670['id'],'interface':_0x5daa9d,'paused':_0x410267['loginInPause']||![],'penalty':_0x3aa670[_0xe989('0xfc')]||0x0};return db[_0xe989('0xb2')][_0xe989('0xfd')](_0x47e1c2);});return Promise[_0xe989('0x61')](_0xc917b8);}}}})[_0xe989('0x18')](function(){if(_0x410267){return db[_0xe989('0xfe')][_0xe989('0x4d')]({'where':{'membername':_0x410267[_0xe989('0x36')],'exitAt':null}});}})[_0xe989('0x18')](function(_0xed90e1){if(_0x410267){var _0x260906=[];_0xed90e1['forEach'](function(_0x585fdf){_0x260906[_0xe989('0x4c')](_0x585fdf[_0xe989('0xff')]({'exitAt':moment()[_0xe989('0xb1')](_0xe989('0x100'))}));});return Promise[_0xe989('0x61')](_0x260906);}})[_0xe989('0x18')](function(){if(_0x410267){var _0x43f86d=[];var _0xae7a6d=[];var _0x32c501=utils[_0xe989('0x101')]();var _0x499aa1={'membername':_0x410267['name'],'interface':_0x5daa9d,'enterAt':moment()[_0xe989('0xb1')](_0xe989('0x100')),'role':_0x410267['role'],'internal':_0x410267[_0xe989('0x66')]};_0x32c501[_0xe989('0x102')](function(_0x452dae){_0x43f86d[_0xe989('0x4c')](_[_0xe989('0xdb')]({'channel':_0x452dae,'type':_0xe989('0x103'),'data1':_0x40a979[_0xe989('0x62')]['device'],'data2':_0x5daa9d},_0x499aa1));if(_0x410267['loginInPause']){_0xae7a6d[_0xe989('0x4c')](_[_0xe989('0xdb')]({'channel':_0x452dae,'type':_0xe989('0x104'),'data1':'LOGININPAUSE'},_0x499aa1));}});return db[_0xe989('0xfe')]['bulkCreate'](_0x43f86d[_0xe989('0xca')](_0xae7a6d),{'individualHooks':!![]});}})['then'](function(){if(_0x410267){return _0x410267[_0xe989('0xff')]({'online':!![],'lastLoginAt':moment()['format'](_0xe989('0x100')),'voicePause':_0x410267[_0xe989('0xa3')]||![],'mailPause':_0x410267[_0xe989('0xa3')]||![],'chatPause':_0x410267[_0xe989('0xa3')]||![],'faxPause':_0x410267['loginInPause']||![],'smsPause':_0x410267[_0xe989('0xa3')]||![],'openchannelPause':_0x410267['loginInPause']||![],'whatsappPause':_0x410267[_0xe989('0xa3')]||![],'pauseType':_0x410267[_0xe989('0xa3')]?_0xe989('0x105'):null,'interface':_0x5daa9d,'lastPauseAt':moment()['format'](_0xe989('0x100'))});}})[_0xe989('0x18')](function(_0x2c3b2a){if(_0x40a979[_0xe989('0x106')]){return _0x41e7c9();}else{return Promise['resolve'](_0x2c3b2a)['then'](respondWithResult(_0x186972,null));}})[_0xe989('0x54')](handleError(_0x186972,null));};exports[_0xe989('0x107')]=function(_0x137003,_0x592144){var _0x445f5f;return db[_0xe989('0x43')]['find']({'where':{'id':_0x137003[_0xe989('0x56')]['id'],'role':_0xe989('0x31')},'attributes':['id',_0xe989('0x36'),_0xe989('0x2d')]})[_0xe989('0x18')](handleEntityNotFound(_0x592144,null))[_0xe989('0x18')](function(_0x2898fa){if(_0x2898fa){_0x445f5f=_0x2898fa;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x445f5f[_0xe989('0x36')]},'individualHooks':!![]});}})[_0xe989('0x18')](function(){return db[_0xe989('0xfe')]['findAll']({'where':{'membername':_0x445f5f[_0xe989('0x36')],'exitAt':null}});})['then'](function(_0x7f7beb){var _0x1b4d3e=[];_0x7f7beb['forEach'](function(_0x4ad1f9){_0x1b4d3e[_0xe989('0x4c')](_0x4ad1f9[_0xe989('0xff')]({'exitAt':moment()[_0xe989('0xb1')](_0xe989('0x100'))}));});return Promise[_0xe989('0x61')](_0x1b4d3e);})[_0xe989('0x18')](function(){return _0x445f5f[_0xe989('0xff')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xe989('0x18')](respondWithResult(_0x592144,null))[_0xe989('0x54')](handleError(_0x592144,null));};exports['pause']=function(_0x4f5f93,_0x47dd68){var _0x5f8fca;return db[_0xe989('0xb2')][_0xe989('0xff')]({'paused':0x1},{'where':{'UserId':_0x4f5f93['params']['id']},'individualHooks':!![]})[_0xe989('0x18')](function(){return db[_0xe989('0x43')][_0xe989('0x35')]({'where':{'id':_0x4f5f93['params']['id'],'role':_0xe989('0x31')},'attributes':['id',_0xe989('0x36'),_0xe989('0x2d'),_0xe989('0x66'),'interface',_0xe989('0xa2')]});})['then'](handleEntityNotFound(_0x47dd68,null))['then'](function(_0x4c5414){if(_0x4c5414){_0x5f8fca=_0x4c5414;return respondWithRpcPromise(_0xe989('0x108'),_0xe989('0x109'),{'id':_0x5f8fca['id'],'name':_0x5f8fca['name'],'pause':!![]});}})[_0xe989('0x18')](function(){if(_0x5f8fca){return db[_0xe989('0xfe')][_0xe989('0x4d')]({'where':{'membername':_0x5f8fca[_0xe989('0x36')],'type':_0xe989('0x104'),'exitAt':null}});}})[_0xe989('0x18')](function(_0xd9335f){if(_0xd9335f[_0xe989('0x50')]){var _0x404453=moment()[_0xe989('0xb1')](_0xe989('0x100'));for(var _0x228094=0x0,_0x569cc4=_0xd9335f[_0xe989('0x50')];_0x228094<_0x569cc4;_0x228094++){_0xd9335f[_0x228094][_0xe989('0x10a')]({'exitAt':_0x404453});}}})['then'](function(){var _0x431b4d=[];var _0x16e160=utils[_0xe989('0x101')]();_0x16e160[_0xe989('0x102')](function(_0x18789f){_0x431b4d[_0xe989('0x4c')]({'channel':_0x18789f,'membername':_0x5f8fca[_0xe989('0x36')],'interface':_[_0xe989('0x6a')](_0x5f8fca['interface'])?util[_0xe989('0xb1')](_0xe989('0xf3'),_0x5f8fca[_0xe989('0x36')]):_0x5f8fca['interface'],'type':_0xe989('0x104'),'enterAt':moment()[_0xe989('0xb1')](_0xe989('0x100')),'data1':_0x4f5f93[_0xe989('0x62')]['type']||_0xe989('0x10b'),'role':_0x5f8fca[_0xe989('0x2d')],'internal':_0x5f8fca[_0xe989('0x66')]});});return db[_0xe989('0xfe')][_0xe989('0x8a')](_0x431b4d,{'individualHooks':!![]});})['then'](function(){return _0x5f8fca[_0xe989('0xff')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4f5f93[_0xe989('0x62')][_0xe989('0x3d')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xe989('0xb1')](_0xe989('0x100'))});})[_0xe989('0x18')](respondWithResult(_0x47dd68,null))[_0xe989('0x54')](handleError(_0x47dd68,null));};exports['unpause']=function(_0xd98b36,_0xc25499){if(_0xd98b36[_0xe989('0x62')][_0xe989('0xa1')]&&!utils[_0xe989('0xb4')](_0xd98b36[_0xe989('0x62')][_0xe989('0xa1')])){throw new APIBadRequestError(util[_0xe989('0xb1')](_0xe989('0x10c'),_0xd98b36[_0xe989('0x62')][_0xe989('0xa1')]));}return db['User'][_0xe989('0x35')]({'where':{'id':_0xd98b36[_0xe989('0x56')]['id']},'attributes':['id','name',_0xe989('0x2d'),_0xe989('0x66'),_0xe989('0xa5'),_0xe989('0xa2'),_0xe989('0xa4'),_0xe989('0x10d'),_0xe989('0x10e'),_0xe989('0x10f'),_0xe989('0x110'),_0xe989('0x111'),_0xe989('0x112'),_0xe989('0x113'),'lastPauseAt']})[_0xe989('0x18')](function(_0x26d90a){if(!_0x26d90a){throw new APINotFoundError(util[_0xe989('0xb1')](_0xe989('0x114'),_0xd98b36['params']['id']));}return _0x26d90a[_0xe989('0x115')](_0xd98b36[_0xe989('0x62')][_0xe989('0xa1')]);})[_0xe989('0x18')](respondWithResult(_0xc25499,null))[_0xe989('0x54')](APIHandleError(_0xc25499));};exports[_0xe989('0x116')]=function(_0x285ee7,_0x46af81){var _0x1b34ff={};var _0x70cbc3={};var _0x1500ef;var _0x30a95c;return db['User'][_0xe989('0xcc')]({'where':{'id':_0x285ee7[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x46af81,null))[_0xe989('0x18')](function(_0x566d97){if(_0x566d97){_0x1500ef=_0x566d97;_0x70cbc3[_0xe989('0x57')]=_[_0xe989('0x59')](db[_0xe989('0x117')]['rawAttributes']);_0x70cbc3[_0xe989('0x44')]=_['keys'](_0x285ee7['query']);_0x70cbc3[_0xe989('0xd0')]=_[_0xe989('0x5a')](_0x70cbc3[_0xe989('0x57')],_0x70cbc3[_0xe989('0x44')]);_0x1b34ff[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x70cbc3[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x285ee7[_0xe989('0x44')][_0xe989('0x5b')]));_0x1b34ff[_0xe989('0x4b')]=_0x1b34ff[_0xe989('0x4b')][_0xe989('0x50')]?_0x1b34ff['attributes']:_0x70cbc3[_0xe989('0x57')];_0x1b34ff[_0xe989('0xce')]=qs[_0xe989('0xcf')](_0x285ee7['query'][_0xe989('0xcf')]);_0x1b34ff[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x285ee7[_0xe989('0x44')],_0x70cbc3['filters']));if(_0x285ee7[_0xe989('0x44')][_0xe989('0x3e')]){_0x1b34ff[_0xe989('0x42')]=_[_0xe989('0xdb')](_0x1b34ff[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0x1b34ff[_0xe989('0x4b')],function(_0x24d106){var _0x840bff={};_0x840bff[_0x24d106]={'$like':'%'+_0x285ee7['query'][_0xe989('0x3e')]+'%'};return _0x840bff;})});}_0x1b34ff=_[_0xe989('0xdb')]({},_0x1b34ff,_0x285ee7['options']);return _0x1500ef[_0xe989('0x116')](_0x1b34ff);}})['then'](function(_0x3796b8){if(_0x3796b8){_0x30a95c=_0x3796b8[_0xe989('0x50')];if(!_0x285ee7['query'][_0xe989('0xd2')]('nolimit')){_0x1b34ff[_0xe989('0x25')]=qs[_0xe989('0x25')](_0x285ee7[_0xe989('0x44')][_0xe989('0x25')]);_0x1b34ff[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x285ee7[_0xe989('0x44')][_0xe989('0x23')]);}return _0x1500ef['getTeams'](_0x1b34ff);}})[_0xe989('0x18')](function(_0x574f32){if(_0x574f32){return _0x574f32?{'count':_0x30a95c,'rows':_0x574f32}:null;}})[_0xe989('0x18')](respondWithResult(_0x46af81,null))[_0xe989('0x54')](handleError(_0x46af81,null));};exports[_0xe989('0x118')]=function(_0x39f33a,_0x5288c6){var _0x5e06a4=_0x39f33a['params']['id'];var _0x3a0526=_0x39f33a[_0xe989('0x62')]?_0x39f33a[_0xe989('0x62')][_0xe989('0x65')]:null;var _0x564b31=[];return Promise[_0xe989('0x119')]()['then'](function(){if(!_0x3a0526)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xe989('0x18')](function(){return db[_0xe989('0x43')]['findOne']({'where':{'id':_0x5e06a4}});})[_0xe989('0x18')](function(_0x643027){if(!_0x643027)throw new APINotFoundError(util[_0xe989('0xb1')]('User\x20with\x20id\x20%s\x20not\x20found',_0x39f33a[_0xe989('0x56')]['id']));return db['sequelize'][_0xe989('0x11a')](function(_0x35959a){return _0x643027[_0xe989('0x118')](_0x3a0526,{'transaction':_0x35959a})[_0xe989('0x18')](function(){return db[_0xe989('0x117')][_0xe989('0x4d')]({'where':{'id':{'$in':_0x3a0526}}});})['then'](function(_0xeb6aab){var _0x44a3b2=_[_0xe989('0x33')](_0xeb6aab,function(_0x354c12){return _0x354c12['getAssociatedQueues']();});return Promise[_0xe989('0x61')](_0x44a3b2);})['then'](function(_0xee0f96){_0x564b31=_[_0xe989('0x11b')](_0xee0f96);var _0x24aa29=_[_0xe989('0x33')](_0x564b31,function(_0x2bbe18){return _0x2bbe18[_0xe989('0x11c')](_0x643027['id'],{'transaction':_0x35959a});});return Promise[_0xe989('0x61')](_0x24aa29);})[_0xe989('0x18')](function(){if(!_0x643027[_0xe989('0xa2')])return;var _0x3d91cd=_[_0xe989('0x3e')](_0x564b31,function(_0x1b3801){return _0x1b3801[_0xe989('0x11d')](_0xe989('0xa1'))===_0xe989('0x11e');});var _0x59f2e5=_[_0xe989('0x33')](_0x3d91cd,function(_0x474054){return db[_0xe989('0xb2')]['upsert']({'membername':_0x643027[_0xe989('0x36')],'UserId':_0x643027['id'],'queue_name':_0x474054[_0xe989('0x36')],'VoiceQueueId':_0x474054['id'],'interface':_[_0xe989('0x6a')](_0x643027[_0xe989('0xa5')])?util['format'](_0xe989('0xf3'),_0x643027['name']):_0x643027['interface'],'paused':_0x643027[_0xe989('0xa4')]||![],'penalty':_0x643027['penalty']},{'transaction':_0x35959a});});return Promise[_0xe989('0x61')](_0x59f2e5);})[_0xe989('0x18')](function(){return db[_0xe989('0x11f')]['findAll']({'where':{'teamId':{'$in':_0x3a0526}}});})[_0xe989('0x18')](function(_0x1dd5e3){var _0x2eb60c=_[_0xe989('0x33')](_0x1dd5e3,function(_0x1f4c09){return db[_0xe989('0x120')][_0xe989('0x88')]({'UserId':_0x643027['id'],'VoicePrefixId':_0x1f4c09['VoicePrefixId']},{'transaction':_0x35959a});});return Promise[_0xe989('0x61')](_0x2eb60c);});});})[_0xe989('0x18')](function(){for(var _0x3d9594=0x0;_0x3d9594<_0x564b31['length'];_0x3d9594++){var _0x21f834=_0x564b31[_0x3d9594][_0xe989('0x11d')](_0xe989('0xa1'));var _0x3bd1dd=_0x21f834+'QueueId';socket[_0xe989('0x2a')]('user'+_0x21f834+_0xe989('0xae'),{'UserId':_0x5e06a4,['queueField']:_0x564b31[_0x3d9594]['id']});}})[_0xe989('0x18')](respondWithStatusCode(_0x5288c6,null))[_0xe989('0x54')](APIHandleError(_0x5288c6));};exports[_0xe989('0x121')]=function(_0xd7e325,_0x397a47){var _0x5847d0=_0xd7e325[_0xe989('0x56')]['id'];var _0x2f243f=null;if(_0xd7e325[_0xe989('0x44')][_0xe989('0x65')]){_0x2f243f=_[_0xe989('0xb5')](_0xd7e325[_0xe989('0x44')]['ids'])?_0xd7e325[_0xe989('0x44')][_0xe989('0x65')]:[_0xd7e325[_0xe989('0x44')]['ids']];}var _0x13fe11=[];return Promise['resolve']()[_0xe989('0x18')](function(){if(!_0x2f243f)throw new APIBadRequestError(_0xe989('0x122'));})[_0xe989('0x18')](function(){return db['User'][_0xe989('0xcc')]({'where':{'id':_0x5847d0}});})[_0xe989('0x18')](function(_0x797fa4){if(!_0x797fa4)throw new APINotFoundError(util[_0xe989('0xb1')](_0xe989('0x114'),_0xd7e325[_0xe989('0x56')]['id']));return db['sequelize']['transaction'](function(_0x341701){return _0x797fa4[_0xe989('0x121')](_0x2f243f,{'transaction':_0x341701})[_0xe989('0x18')](function(){return db[_0xe989('0x117')]['findAll']({'where':{'id':{'$in':_0x2f243f}}});})['then'](function(_0x3d8666){var _0x3b7064=_[_0xe989('0x33')](_0x3d8666,function(_0x24e933){return _0x24e933[_0xe989('0x123')]();});return Promise[_0xe989('0x61')](_0x3b7064);})['then'](function(_0x219159){_0x13fe11=_['flattenDeep'](_0x219159);var _0x4ccf2b=_[_0xe989('0x33')](_0x13fe11,function(_0x55cc5e){return _0x55cc5e[_0xe989('0x124')](_0x797fa4['id'],{'transaction':_0x341701});});return Promise[_0xe989('0x61')](_0x4ccf2b);})[_0xe989('0x18')](function(){if(!_0x797fa4[_0xe989('0xa2')])return;var _0x4fa086=_[_0xe989('0x3e')](_0x13fe11,function(_0x54bd55){return _0x54bd55[_0xe989('0x11d')]('channel')===_0xe989('0x11e');});var _0x135a47=_[_0xe989('0x33')](_0x4fa086,function(_0x51b4a4){return db[_0xe989('0xb2')][_0xe989('0x2c')]({'where':{'VoiceQueueId':_0x51b4a4['id'],'UserId':_0x797fa4['id']},'transaction':_0x341701});});return Promise[_0xe989('0x61')](_0x135a47);})['then'](function(){return db[_0xe989('0x11f')][_0xe989('0x4d')]({'where':{'teamId':{'$in':_0x2f243f}}});})[_0xe989('0x18')](function(_0x25bfbb){var _0x3cf64f=_['map'](_0x25bfbb,function(_0x4f6d70){return db[_0xe989('0x120')][_0xe989('0x2c')]({'where':{'UserId':_0x797fa4['id'],'VoicePrefixId':_0x4f6d70[_0xe989('0x125')]}},{'transaction':_0x341701});});return Promise['all'](_0x3cf64f);});});})[_0xe989('0x18')](function(){for(var _0x1d7f32=0x0;_0x1d7f32<_0x13fe11['length'];_0x1d7f32++){var _0x9ea3af=_0x13fe11[_0x1d7f32][_0xe989('0x11d')](_0xe989('0xa1'));var _0x5f00d4=_0x9ea3af+_0xe989('0xad');socket['emit'](_0xe989('0x30')+_0x9ea3af+_0xe989('0x126'),{'UserId':_0x5847d0,['queueField']:_0x13fe11[_0x1d7f32]['id']});}})['then'](respondWithStatusCode(_0x397a47,null))['catch'](APIHandleError(_0x397a47));};exports[_0xe989('0x127')]=function(_0x2ab825,_0x3edb5b){var _0x5a2050={};var _0x1a3151={};var _0x5d3c73;var _0x18215f;return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x2ab825[_0xe989('0x56')]['id']}})['then'](handleEntityNotFound(_0x3edb5b,null))[_0xe989('0x18')](function(_0x3eba94){if(_0x3eba94){_0x5d3c73=_0x3eba94;_0x1a3151[_0xe989('0x57')]=_[_0xe989('0x59')](db[_0xe989('0xd3')][_0xe989('0x3b')]);_0x1a3151[_0xe989('0x44')]=_[_0xe989('0x59')](_0x2ab825['query']);_0x1a3151[_0xe989('0xd0')]=_['intersection'](_0x1a3151['model'],_0x1a3151[_0xe989('0x44')]);_0x5a2050[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x1a3151[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x2ab825[_0xe989('0x44')]['fields']));_0x5a2050[_0xe989('0x4b')]=_0x5a2050['attributes'][_0xe989('0x50')]?_0x5a2050[_0xe989('0x4b')]:_0x1a3151[_0xe989('0x57')];_0x5a2050['order']=qs[_0xe989('0xcf')](_0x2ab825[_0xe989('0x44')][_0xe989('0xcf')]);_0x5a2050[_0xe989('0x42')]=qs[_0xe989('0xd0')](_[_0xe989('0xd1')](_0x2ab825['query'],_0x1a3151[_0xe989('0xd0')]));if(_0x2ab825['query'][_0xe989('0x3e')]){_0x5a2050[_0xe989('0x42')]=_[_0xe989('0xdb')](_0x5a2050['where'],{'$or':_[_0xe989('0x33')](_0x5a2050[_0xe989('0x4b')],function(_0x3b6485){var _0xd1c432={};_0xd1c432[_0x3b6485]={'$like':'%'+_0x2ab825[_0xe989('0x44')][_0xe989('0x3e')]+'%'};return _0xd1c432;})});}_0x5a2050=_[_0xe989('0xdb')]({},_0x5a2050,_0x2ab825[_0xe989('0x5c')]);return _0x5d3c73[_0xe989('0x127')](_0x5a2050);}})[_0xe989('0x18')](function(_0x1092a1){if(_0x1092a1){_0x18215f=_0x1092a1[_0xe989('0x50')];if(!_0x2ab825[_0xe989('0x44')][_0xe989('0xd2')](_0xe989('0xdd'))){_0x5a2050[_0xe989('0x25')]=qs[_0xe989('0x25')](_0x2ab825['query']['limit']);_0x5a2050[_0xe989('0x23')]=qs[_0xe989('0x23')](_0x2ab825[_0xe989('0x44')][_0xe989('0x23')]);}return _0x5d3c73[_0xe989('0x127')](_0x5a2050);}})[_0xe989('0x18')](function(_0x3374a4){if(_0x3374a4){return _0x3374a4?{'count':_0x18215f,'rows':_0x3374a4}:null;}})[_0xe989('0x18')](respondWithResult(_0x3edb5b,null))['catch'](handleError(_0x3edb5b,null));};exports[_0xe989('0x128')]=function(_0x2d7234,_0x46e3f0){var _0x5783a5={};var _0x416fb0={};var _0x35bd6b;return db[_0xe989('0x43')][_0xe989('0xcc')]({'where':{'id':_0x2d7234[_0xe989('0x56')]['id']}})[_0xe989('0x18')](handleEntityNotFound(_0x46e3f0,null))[_0xe989('0x18')](function(_0x139937){if(_0x139937){_0x35bd6b=_0x139937;_0x416fb0['model']=_['keys'](db[_0xe989('0x43')][_0xe989('0x3b')]);_0x416fb0[_0xe989('0x44')]=_['keys'](_0x2d7234[_0xe989('0x44')]);_0x416fb0[_0xe989('0xd0')]=_[_0xe989('0x5a')](_0x416fb0[_0xe989('0x57')],_0x416fb0['query']);_0x5783a5[_0xe989('0x4b')]=_[_0xe989('0x5a')](_0x416fb0[_0xe989('0x57')],qs[_0xe989('0x5b')](_0x2d7234[_0xe989('0x44')][_0xe989('0x5b')]));_0x5783a5[_0xe989('0x4b')]=_0x5783a5[_0xe989('0x4b')][_0xe989('0x50')]?_0x5783a5[_0xe989('0x4b')]:_0x416fb0['model'];_0x5783a5[_0xe989('0xce')]=qs[_0xe989('0xcf')](_0x2d7234[_0xe989('0x44')][_0xe989('0xcf')]);_0x5783a5['where']=qs[_0xe989('0xd0')](_['pick'](_0x2d7234[_0xe989('0x44')],_0x416fb0['filters']));if(_0x2d7234['query']['filter']){_0x5783a5['where']=_[_0xe989('0xdb')](_0x5783a5[_0xe989('0x42')],{'$or':_[_0xe989('0x33')](_0x5783a5['attributes'],function(_0x923051){var _0x5dce02={};_0x5dce02[_0x923051]={'$like':'%'+_0x2d7234['query'][_0xe989('0x3e')]+'%'};return _0x5dce02;})});}_0x5783a5[_0xe989('0x57')]=db['User'];_0x5783a5['as']='Agents';_0x5783a5=_[_0xe989('0xdb')]({},_0x5783a5,_0x2d7234[_0xe989('0x5c')]);return _0x35bd6b[_0xe989('0xfb')]({'include':[_0x5783a5]});}})[_0xe989('0x18')](function(_0x5d913d){if(_0x5d913d){var _0x93ec1c={},_0x100d1b=[];for(var _0x1307bd=0x0;_0x1307bd<_0x5d913d[_0xe989('0x50')];_0x1307bd+=0x1){for(var _0x269636=0x0,_0x49d6c0;_0x269636<_0x5d913d[_0x1307bd][_0xe989('0x8f')]['length'];_0x269636+=0x1){_0x49d6c0=_0x5d913d[_0x1307bd][_0xe989('0x8f')][_0x269636]['get']({'plain':!![]});_0x93ec1c[_0x49d6c0['id']]=_0x49d6c0;}}_0x93ec1c=_[_0xe989('0x129')](_0x93ec1c);for(var _0x5ec30b=qs['offset'](_0x2d7234['query'][_0xe989('0x23')]);_0x5ec30b<_0x93ec1c[_0xe989('0x50')]&&_0x100d1b[_0xe989('0x50')]=_0xa109ed[_0x1da9('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x1da9('0x1e')](function(){if(_0x5f3f2a){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x5f3f2a[_0x1da9('0x2c')]},'individualHooks':!![]});}})[_0x1da9('0x1e')](function(){if(_0x5f3f2a){return _0x5f3f2a[_0x1da9('0x4d')]({'raw':!![]});}})['then'](function(_0x5b38ad){if(_0x5f3f2a){if(_0x5b38ad){var _0x1f1dbe=[];_0x438a66=_0x5b38ad;if(_0x438a66[_0x1da9('0x26')]){for(var _0x2175d3=0x0;_0x2175d3<_0x438a66[_0x1da9('0x26')];_0x2175d3++){_0x1f1dbe['push'](db[_0x1da9('0x23')][_0x1da9('0x4e')]({'membername':_0x5f3f2a['name'],'UserId':_0x5f3f2a['id'],'queue_name':_0x438a66[_0x2175d3]['name'],'VoiceQueueId':_0x438a66[_0x2175d3]['id'],'interface':_0x2edcb3,'paused':_0x5f3f2a[_0x1da9('0x49')]||![],'penalty':_0x438a66[_0x2175d3][_0x1da9('0x4f')]||0x0}));}return BPromise[_0x1da9('0x46')](_0x1f1dbe);}}}})[_0x1da9('0x1e')](function(){if(_0x5f3f2a){return db['MemberReport']['findAll']({'where':{'membername':_0x5f3f2a[_0x1da9('0x2c')],'exitAt':null}});}})[_0x1da9('0x1e')](function(_0x597be9){if(_0x5f3f2a){if(_0x597be9&&_0x597be9['length']){var _0x12b553=[];_0x597be9['forEach'](function(_0x5757a3){_0x12b553[_0x1da9('0x2b')](_0x5757a3[_0x1da9('0x36')]({'exitAt':moment()[_0x1da9('0x2e')](_0x1da9('0x27'))}));});return BPromise[_0x1da9('0x46')](_0x12b553);}}})[_0x1da9('0x1e')](function(){if(_0x5f3f2a){var _0x2f7b53=[];var _0x5620f8=[];var _0x56253f=utils[_0x1da9('0x29')]();var _0x5be646={'membername':_0x5f3f2a[_0x1da9('0x2c')],'interface':_0x2edcb3,'enterAt':moment()[_0x1da9('0x2e')](_0x1da9('0x27')),'role':_0x5f3f2a['role'],'internal':_0x5f3f2a['internal']};_0x56253f[_0x1da9('0x2a')](function(_0x70db79){_0x2f7b53['push'](_[_0x1da9('0x50')]({'channel':_0x70db79,'type':_0x1da9('0x51'),'data1':_0x1da9('0x52'),'data2':_0x2edcb3},_0x5be646));if(_0x5f3f2a[_0x1da9('0x49')]){_0x5620f8[_0x1da9('0x2b')](_[_0x1da9('0x50')]({'channel':_0x70db79,'type':_0x1da9('0x25'),'data1':_0x1da9('0x53')},_0x5be646));}});return db['MemberReport'][_0x1da9('0x35')](_0x2f7b53[_0x1da9('0x54')](_0x5620f8),{'individualHooks':!![]});}})['then'](function(){if(_0x5f3f2a){return _0x5f3f2a[_0x1da9('0x36')]({'online':!![],'lastLoginAt':moment()[_0x1da9('0x2e')](_0x1da9('0x27')),'voicePause':_0x5f3f2a['loginInPause']||![],'mailPause':_0x5f3f2a[_0x1da9('0x49')]||![],'chatPause':_0x5f3f2a['loginInPause']||![],'faxPause':_0x5f3f2a['loginInPause']||![],'smsPause':_0x5f3f2a[_0x1da9('0x49')]||![],'openchannelPause':_0x5f3f2a[_0x1da9('0x49')]||![],'pauseType':_0x5f3f2a[_0x1da9('0x49')]?_0x1da9('0x53'):null,'lastPauseAt':moment()[_0x1da9('0x2e')](_0x1da9('0x27')),'interface':_0x2edcb3});}})[_0x1da9('0x1e')](function(_0x4bdb79){_0x496273(_0x4bdb79);})[_0x1da9('0x1a')](function(_0x3c2f0d){_0x27619f(_0xfbd9aa[_0x1da9('0x1c')](0x1f4,_0x3c2f0d['message']));});});}; \ No newline at end of file +var _0x62eb=['Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','mailPause','chatPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','unpause','LogoutUser','forEach','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','agents','getVoiceQueues','UserVoiceQueueRt','upsert','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','User','findAll','options','raw','limit','include','map','model','attributes','then','info','GetUser','catch','error','message','ShowUser','find','where','debug','stringify','name','role','internal','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','push','isNil','interface','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','channel'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x62eb,0x165));var _0xb62e=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x62eb[_0x4b73a2];return _0x383c66;};'use strict';var _=require('lodash');var util=require(_0xb62e('0x0'));var moment=require('moment');var BPromise=require(_0xb62e('0x1'));var Redis=require(_0xb62e('0x2'));var db=require(_0xb62e('0x3'))['db'];var utils=require(_0xb62e('0x4'));var logger=require(_0xb62e('0x5'))(_0xb62e('0x6'));var config=require(_0xb62e('0x7'));config[_0xb62e('0x8')]=_[_0xb62e('0x9')](config['redis'],{'host':_0xb62e('0xa'),'port':0x18eb});var socket=require(_0xb62e('0xb'))(new Redis(config[_0xb62e('0x8')]));require('./user.socket')[_0xb62e('0xc')](socket);exports['GetUser']=function(_0x3ecf7a){var _0x33006f=this;return new Promise(function(_0x4ae24b,_0x6fb08d){return db[_0xb62e('0xd')][_0xb62e('0xe')]({'raw':_0x3ecf7a['options']?_0x3ecf7a[_0xb62e('0xf')][_0xb62e('0x10')]===undefined?!![]:![]:!![],'where':_0x3ecf7a[_0xb62e('0xf')]?_0x3ecf7a[_0xb62e('0xf')]['where']||null:null,'attributes':_0x3ecf7a[_0xb62e('0xf')]?_0x3ecf7a['options']['attributes']||null:null,'limit':_0x3ecf7a[_0xb62e('0xf')]?_0x3ecf7a[_0xb62e('0xf')][_0xb62e('0x11')]||null:null,'include':_0x3ecf7a['options']?_0x3ecf7a['options'][_0xb62e('0x12')]?_[_0xb62e('0x13')](_0x3ecf7a[_0xb62e('0xf')][_0xb62e('0x12')],function(_0x5cc33b){return{'model':db[_0x5cc33b[_0xb62e('0x14')]],'as':_0x5cc33b['as'],'attributes':_0x5cc33b[_0xb62e('0x15')],'include':_0x5cc33b[_0xb62e('0x12')]?_[_0xb62e('0x13')](_0x5cc33b[_0xb62e('0x12')],function(_0x2fa86a){return{'model':db[_0x2fa86a[_0xb62e('0x14')]],'as':_0x2fa86a['as'],'attributes':_0x2fa86a[_0xb62e('0x15')],'include':_0x2fa86a['include']?_['map'](_0x2fa86a['include'],function(_0xad5855){return{'model':db[_0xad5855['model']],'as':_0xad5855['as'],'attributes':_0xad5855[_0xb62e('0x15')]};}):[]};}):[]};}):[]:[]})[_0xb62e('0x16')](function(_0x584b6c){logger[_0xb62e('0x17')](_0xb62e('0x18'),_0x3ecf7a);logger['debug'](_0xb62e('0x18'),_0x3ecf7a,JSON['stringify'](_0x584b6c));_0x4ae24b(_0x584b6c);})[_0xb62e('0x19')](function(_0x1b4bb5){logger[_0xb62e('0x1a')]('GetUser',_0x1b4bb5[_0xb62e('0x1b')],_0x3ecf7a);_0x6fb08d(_0x33006f[_0xb62e('0x1a')](0x1f4,_0x1b4bb5[_0xb62e('0x1b')]));});});};exports[_0xb62e('0x1c')]=function(_0x57dd13){var _0x24dcc7=this;return new Promise(function(_0x1cd58a,_0x5b2d58){return db[_0xb62e('0xd')][_0xb62e('0x1d')]({'raw':_0x57dd13[_0xb62e('0xf')]?_0x57dd13['options'][_0xb62e('0x10')]===undefined?!![]:![]:!![],'where':_0x57dd13[_0xb62e('0xf')]?_0x57dd13[_0xb62e('0xf')][_0xb62e('0x1e')]||null:null,'attributes':_0x57dd13['options']?_0x57dd13['options'][_0xb62e('0x15')]||null:null,'include':_0x57dd13[_0xb62e('0xf')]?_0x57dd13[_0xb62e('0xf')][_0xb62e('0x12')]?_['map'](_0x57dd13[_0xb62e('0xf')]['include'],function(_0x24ea8c){return{'model':db[_0x24ea8c[_0xb62e('0x14')]],'as':_0x24ea8c['as'],'attributes':_0x24ea8c[_0xb62e('0x15')],'include':_0x24ea8c['include']?_[_0xb62e('0x13')](_0x24ea8c[_0xb62e('0x12')],function(_0x126b1d){return{'model':db[_0x126b1d[_0xb62e('0x14')]],'as':_0x126b1d['as'],'attributes':_0x126b1d[_0xb62e('0x15')],'include':_0x126b1d[_0xb62e('0x12')]?_[_0xb62e('0x13')](_0x126b1d[_0xb62e('0x12')],function(_0x3cc0a){return{'model':db[_0x3cc0a[_0xb62e('0x14')]],'as':_0x3cc0a['as'],'attributes':_0x3cc0a[_0xb62e('0x15')]};}):[]};}):[]};}):[]:[]})[_0xb62e('0x16')](function(_0x18c260){logger[_0xb62e('0x17')]('ShowUser',_0x57dd13);logger[_0xb62e('0x1f')]('ShowUser',_0x57dd13,JSON[_0xb62e('0x20')](_0x18c260));_0x1cd58a(_0x18c260);})[_0xb62e('0x19')](function(_0x1bead9){logger['error']('ShowUser',_0x1bead9[_0xb62e('0x1b')],_0x57dd13);_0x5b2d58(_0x24dcc7[_0xb62e('0x1a')](0x1f4,_0x1bead9[_0xb62e('0x1b')]));});});};exports['PauseUser']=function(_0x2e8acf){var _0x3067a8=this;return new Promise(function(_0x4b41f0,_0x353be1){var _0x3d67cf;return db[_0xb62e('0xd')][_0xb62e('0x1d')]({'where':_0x2e8acf[_0xb62e('0xf')][_0xb62e('0x1e')]||{},'attributes':['id',_0xb62e('0x21'),_0xb62e('0x22'),_0xb62e('0x23'),'interface']})[_0xb62e('0x16')](function(_0x38eb80){if(_0x38eb80){_0x3d67cf=_0x38eb80;return db['UserVoiceQueueRt'][_0xb62e('0x24')]({'paused':0x1},{'where':{'UserId':_0x3d67cf['id']},'individualHooks':!![]});}})[_0xb62e('0x16')](function(){if(_0x3d67cf){return db[_0xb62e('0x25')]['findAll']({'where':{'membername':_0x3d67cf['name'],'type':_0xb62e('0x26'),'exitAt':null}});}})['then'](function(_0x2de6d2){if(_0x3d67cf){if(_0x2de6d2&&_0x2de6d2[_0xb62e('0x27')]){var _0x46c368=moment()[_0xb62e('0x28')](_0xb62e('0x29'));for(var _0x8e18e9=0x0,_0x927228=_0x2de6d2['length'];_0x8e18e9<_0x927228;_0x8e18e9++){_0x2de6d2[_0x8e18e9]['updateAttributes']({'exitAt':_0x46c368});}}}})[_0xb62e('0x16')](function(){if(_0x3d67cf){var _0x1b9860=[];var _0x54a7c5=utils[_0xb62e('0x2a')]();_0x54a7c5['forEach'](function(_0x10dd45){_0x1b9860[_0xb62e('0x2b')]({'channel':_0x10dd45,'membername':_0x3d67cf[_0xb62e('0x21')],'interface':_[_0xb62e('0x2c')](_0x3d67cf[_0xb62e('0x2d')])?util[_0xb62e('0x28')]('SIP/%s',_0x3d67cf[_0xb62e('0x21')]):_0x3d67cf[_0xb62e('0x2d')],'type':'PAUSE','enterAt':moment()[_0xb62e('0x28')](_0xb62e('0x29')),'data1':_0x2e8acf[_0xb62e('0x2e')][_0xb62e('0x2f')]||'DEFAULT\x20PAUSE','role':_0x3d67cf[_0xb62e('0x22')],'internal':_0x3d67cf[_0xb62e('0x23')],'uniqueid':_0x2e8acf[_0xb62e('0x2e')][_0xb62e('0x30')]||null});});return db[_0xb62e('0x25')][_0xb62e('0x31')](_0x1b9860,{'individualHooks':!![]});}})[_0xb62e('0x16')](function(){if(_0x3d67cf){return _0x3d67cf['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2e8acf[_0xb62e('0x2e')][_0xb62e('0x2f')]||_0xb62e('0x32'),'lastPauseAt':moment()[_0xb62e('0x28')](_0xb62e('0x29'))});}})[_0xb62e('0x16')](function(_0x5f4172){_0x4b41f0(_0x5f4172);})['catch'](function(_0x2689e1){_0x353be1(_0x3067a8[_0xb62e('0x1a')](0x1f4,_0x2689e1[_0xb62e('0x1b')]));});});};exports[_0xb62e('0x33')]=function(_0x226eb7){var _0x41c5be=this;return new Promise(function(_0x2c3042,_0x315aa1){if(_0x226eb7[_0xb62e('0x2e')]['channel']&&!utils['isValidChannel'](_0x226eb7[_0xb62e('0x2e')][_0xb62e('0x34')])){throw new Error(util[_0xb62e('0x28')](_0xb62e('0x35'),_0x226eb7[_0xb62e('0x2e')][_0xb62e('0x34')]));}return db[_0xb62e('0xd')][_0xb62e('0x36')]({'where':_0x226eb7[_0xb62e('0xf')][_0xb62e('0x1e')]||{},'attributes':['id',_0xb62e('0x21'),'role',_0xb62e('0x23'),_0xb62e('0x2d'),_0xb62e('0x37'),'voicePause',_0xb62e('0x38'),_0xb62e('0x39'),'faxPause','openchannelPause','smsPause',_0xb62e('0x3a'),_0xb62e('0x3b'),'lastPauseAt']})[_0xb62e('0x16')](function(_0x5a10d8){if(!_0x5a10d8){throw new Error(util[_0xb62e('0x28')](_0xb62e('0x3c'),_0x226eb7['params']['id']));}return _0x5a10d8[_0xb62e('0x3d')](_0x226eb7[_0xb62e('0x2e')][_0xb62e('0x34')],'system');})['then'](function(_0x37cbc1){_0x2c3042(_0x37cbc1);})[_0xb62e('0x19')](function(_0x2a853b){_0x315aa1(_0x41c5be[_0xb62e('0x1a')](0x1f4,_0x2a853b['message']));});});};exports[_0xb62e('0x3e')]=function(_0x28e3a9){var _0x1ae442=this;return new Promise(function(_0x3423b6,_0x151818){var _0x5e362f;return db[_0xb62e('0xd')][_0xb62e('0x36')]({'where':_0x28e3a9[_0xb62e('0xf')]['where']||{},'attributes':['id',_0xb62e('0x21')]})[_0xb62e('0x16')](function(_0x4d5acf){if(_0x4d5acf){_0x5e362f=_0x4d5acf;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x5e362f['name']},'individualHooks':!![]});}})[_0xb62e('0x16')](function(){if(_0x5e362f){return db['MemberReport'][_0xb62e('0xe')]({'where':{'membername':_0x5e362f[_0xb62e('0x21')],'exitAt':null}});}})[_0xb62e('0x16')](function(_0x3e920a){if(_0x5e362f){if(_0x3e920a&&_0x3e920a[_0xb62e('0x27')]){var _0x58ab5c=[];_0x3e920a[_0xb62e('0x3f')](function(_0x48bc22){_0x58ab5c['push'](_0x48bc22[_0xb62e('0x24')]({'exitAt':moment()[_0xb62e('0x28')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xb62e('0x40')](_0x58ab5c);}}})[_0xb62e('0x16')](function(){if(_0x5e362f){return _0x5e362f['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xb62e('0x16')](function(_0x522029){_0x3423b6(_0x522029);})['catch'](function(_0x2a7db5){_0x151818(_0x1ae442[_0xb62e('0x1a')](0x1f4,_0x2a7db5[_0xb62e('0x1b')]));});});};exports[_0xb62e('0x41')]=function(_0x31fb9a){var _0x5a09b5=this;return new Promise(function(_0x29f6f0,_0xd7820d){var _0x4eb56d;var _0x3c147b;var _0x370038;var _0x58585e;return db[_0xb62e('0xd')]['findOne']({'where':_0x31fb9a[_0xb62e('0xf')]['where']||{},'attributes':['id','name','role',_0xb62e('0x42'),_0xb62e('0x43'),'internal',_0xb62e('0x44'),_0xb62e('0x2d')]})[_0xb62e('0x16')](function(_0x4b2fe1){if(_0x4b2fe1){_0x4eb56d=_0x4b2fe1;_0x58585e=_0x31fb9a[_0xb62e('0x2e')][_0xb62e('0x2d')]?_0x31fb9a[_0xb62e('0x2e')][_0xb62e('0x2d')]:util[_0xb62e('0x28')](_0xb62e('0x45'),_0x4eb56d[_0xb62e('0x21')]);return db['User'][_0xb62e('0x46')]({'where':{'role':_0xb62e('0x47'),'online':!![],'id':{'$ne':_0x4eb56d['id']}}});}})[_0xb62e('0x16')](function(_0x3761a7){if(_0x3761a7){_0x370038=_0x3761a7;return require(_0xb62e('0x48'))['getLicense']();}})[_0xb62e('0x16')](function(_0x215ab1){if(_0x215ab1&&_0x215ab1[_0xb62e('0x49')]&&_0x370038>=_0x215ab1[_0xb62e('0x49')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x4eb56d){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x4eb56d['name']},'individualHooks':!![]});}})[_0xb62e('0x16')](function(){if(_0x4eb56d){return _0x4eb56d[_0xb62e('0x4a')]({'raw':!![]});}})['then'](function(_0x530ab6){if(_0x4eb56d){if(_0x530ab6){var _0x5c1ac3=[];_0x3c147b=_0x530ab6;if(_0x3c147b[_0xb62e('0x27')]){for(var _0x449413=0x0;_0x449413<_0x3c147b[_0xb62e('0x27')];_0x449413++){_0x5c1ac3['push'](db[_0xb62e('0x4b')][_0xb62e('0x4c')]({'membername':_0x4eb56d['name'],'UserId':_0x4eb56d['id'],'queue_name':_0x3c147b[_0x449413]['name'],'VoiceQueueId':_0x3c147b[_0x449413]['id'],'interface':_0x58585e,'paused':_0x4eb56d[_0xb62e('0x44')]||![],'penalty':_0x3c147b[_0x449413][_0xb62e('0x4d')]||0x0}));}return BPromise['all'](_0x5c1ac3);}}}})[_0xb62e('0x16')](function(){if(_0x4eb56d){return db[_0xb62e('0x25')][_0xb62e('0xe')]({'where':{'membername':_0x4eb56d[_0xb62e('0x21')],'exitAt':null}});}})[_0xb62e('0x16')](function(_0x363ecb){if(_0x4eb56d){if(_0x363ecb&&_0x363ecb[_0xb62e('0x27')]){var _0x31ea38=[];_0x363ecb[_0xb62e('0x3f')](function(_0x577599){_0x31ea38[_0xb62e('0x2b')](_0x577599[_0xb62e('0x24')]({'exitAt':moment()[_0xb62e('0x28')](_0xb62e('0x29'))}));});return BPromise[_0xb62e('0x40')](_0x31ea38);}}})[_0xb62e('0x16')](function(){if(_0x4eb56d){var _0x47b444=[];var _0xc53128=[];var _0x305666=utils[_0xb62e('0x2a')]();var _0x3ce1ea={'membername':_0x4eb56d[_0xb62e('0x21')],'interface':_0x58585e,'enterAt':moment()[_0xb62e('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4eb56d[_0xb62e('0x22')],'internal':_0x4eb56d[_0xb62e('0x23')]};_0x305666[_0xb62e('0x3f')](function(_0xf61212){_0x47b444[_0xb62e('0x2b')](_[_0xb62e('0x4e')]({'channel':_0xf61212,'type':_0xb62e('0x4f'),'data1':'callysquare','data2':_0x58585e},_0x3ce1ea));if(_0x4eb56d['loginInPause']){_0xc53128['push'](_['merge']({'channel':_0xf61212,'type':'PAUSE','data1':_0xb62e('0x50')},_0x3ce1ea));}});return db[_0xb62e('0x25')][_0xb62e('0x31')](_0x47b444[_0xb62e('0x51')](_0xc53128),{'individualHooks':!![]});}})[_0xb62e('0x16')](function(){if(_0x4eb56d){return _0x4eb56d[_0xb62e('0x24')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4eb56d[_0xb62e('0x44')]||![],'mailPause':_0x4eb56d[_0xb62e('0x44')]||![],'chatPause':_0x4eb56d['loginInPause']||![],'faxPause':_0x4eb56d[_0xb62e('0x44')]||![],'smsPause':_0x4eb56d[_0xb62e('0x44')]||![],'openchannelPause':_0x4eb56d[_0xb62e('0x44')]||![],'pauseType':_0x4eb56d['loginInPause']?_0xb62e('0x50'):null,'lastPauseAt':moment()[_0xb62e('0x28')](_0xb62e('0x29')),'interface':_0x58585e});}})['then'](function(_0x1804df){_0x29f6f0(_0x1804df);})[_0xb62e('0x19')](function(_0x55eb62){_0xd7820d(_0x5a09b5[_0xb62e('0x1a')](0x1f4,_0x55eb62[_0xb62e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 714feab..873a8fd 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 _0xd6b0=['./user.events','emit','removeListener','length','user:'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd6b0,0xd2));var _0x0d6b=function(_0xeba69a,_0x30b201){_0xeba69a=_0xeba69a-0x0;var _0x261689=_0xd6b0[_0xeba69a];return _0x261689;};'use strict';var UserEvents=require(_0x0d6b('0x0'));var events=['save','remove','update'];function createListener(_0x482dd7,_0x441d66){return function(_0x5b433e){_0x441d66[_0x0d6b('0x1')](_0x482dd7,_0x5b433e);};}function removeListener(_0x2643f4,_0x3e934f){return function(){UserEvents[_0x0d6b('0x2')](_0x2643f4,_0x3e934f);};}exports['register']=function(_0x4cfe4e){for(var _0x54d671=0x0,_0x37ef93=events[_0x0d6b('0x3')];_0x54d671<_0x37ef93;_0x54d671++){var _0x280e69=events[_0x54d671];var _0x2edebe=createListener(_0x0d6b('0x4')+_0x280e69,_0x4cfe4e);UserEvents['on'](_0x280e69,_0x2edebe);}}; \ No newline at end of file +var _0x56db=['user:','./user.events','save','remove','update','emit','register','length'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0x56db,0xf9));var _0xb56d=function(_0x530a58,_0x141d0a){_0x530a58=_0x530a58-0x0;var _0x46efd4=_0x56db[_0x530a58];return _0x46efd4;};'use strict';var UserEvents=require(_0xb56d('0x0'));var events=[_0xb56d('0x1'),_0xb56d('0x2'),_0xb56d('0x3')];function createListener(_0x274570,_0x2c61bd){return function(_0x290b16){_0x2c61bd[_0xb56d('0x4')](_0x274570,_0x290b16);};}function removeListener(_0x2497c0,_0x3e76e0){return function(){UserEvents['removeListener'](_0x2497c0,_0x3e76e0);};}exports[_0xb56d('0x5')]=function(_0x4dc44f){for(var _0x3f2b6b=0x0,_0x5193a3=events[_0xb56d('0x6')];_0x3f2b6b<_0x5193a3;_0x3f2b6b++){var _0x437b8a=events[_0x3f2b6b];var _0x2905aa=createListener(_0xb56d('0x7')+_0x437b8a,_0x4dc44f);UserEvents['on'](_0x437b8a,_0x2905aa);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 78b41c7..664f520 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x579bdc,_0x262928){var _0x474b69=function(_0x5301ff){while(--_0x5301ff){_0x579bdc['push'](_0x579bdc['shift']());}};_0x474b69(++_0x262928);}(_0xe706,0xa3));var _0x6e70=function(_0x828160,_0x26d5be){_0x828160=_0x828160-0x0;var _0x296b5f=_0xe706[_0x828160];return _0x296b5f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6eaee5,_0xabd1b8){var _0x57a467=function(_0x6dfba2){while(--_0x6dfba2){_0x6eaee5['push'](_0x6eaee5['shift']());}};_0x57a467(++_0xabd1b8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 3d610f6..72237a6 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 _0xe8ac=['sequelize','exports','INTEGER'];(function(_0x2b8e76,_0x3e34d7){var _0x21271b=function(_0x287c22){while(--_0x287c22){_0x2b8e76['push'](_0x2b8e76['shift']());}};_0x21271b(++_0x3e34d7);}(_0xe8ac,0xea));var _0xce8a=function(_0x586f64,_0x3462f4){_0x586f64=_0x586f64-0x0;var _0x1ec56d=_0xe8ac[_0x586f64];return _0x1ec56d;};'use strict';var Sequelize=require(_0xce8a('0x0'));module[_0xce8a('0x1')]={'penalty':{'type':Sequelize[_0xce8a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd88b=['INTEGER','sequelize'];(function(_0x5f41c9,_0x43e8c6){var _0x43f419=function(_0x2b965e){while(--_0x2b965e){_0x5f41c9['push'](_0x5f41c9['shift']());}};_0x43f419(++_0x43e8c6);}(_0xd88b,0xa7));var _0xbd88=function(_0x316e5c,_0x18f42a){_0x316e5c=_0x316e5c-0x0;var _0x1f3162=_0xd88b[_0x316e5c];return _0x1f3162;};'use strict';var Sequelize=require(_0xbd88('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbd88('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 20ee8fc..e1dcc17 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 _0x4c73=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x32ee50,_0x564493){var _0x12a1b3=function(_0x3d6bc8){while(--_0x3d6bc8){_0x32ee50['push'](_0x32ee50['shift']());}};_0x12a1b3(++_0x564493);}(_0x4c73,0x174));var _0x34c7=function(_0xdb3843,_0x5c06bd){_0xdb3843=_0xdb3843-0x0;var _0x44a51e=_0x4c73[_0xdb3843];return _0x44a51e;};'use strict';var _=require(_0x34c7('0x0'));var util=require('util');var logger=require(_0x34c7('0x1'))('api');var moment=require(_0x34c7('0x2'));var BPromise=require(_0x34c7('0x3'));var rp=require(_0x34c7('0x4'));var fs=require('fs');var path=require(_0x34c7('0x5'));var rimraf=require('rimraf');var config=require(_0x34c7('0x6'));var attributes=require(_0x34c7('0x7'));module[_0x34c7('0x8')]=function(_0x1919eb,_0x2bef19){return _0x1919eb[_0x34c7('0x9')](_0x34c7('0xa'),attributes,{'tableName':_0x34c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45d3=['user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','define'];(function(_0x52f195,_0x1a9101){var _0x351105=function(_0x1180eb){while(--_0x1180eb){_0x52f195['push'](_0x52f195['shift']());}};_0x351105(++_0x1a9101);}(_0x45d3,0x12d));var _0x345d=function(_0x2f74df,_0x31667a){_0x2f74df=_0x2f74df-0x0;var _0x207892=_0x45d3[_0x2f74df];return _0x207892;};'use strict';var _=require(_0x345d('0x0'));var util=require(_0x345d('0x1'));var logger=require(_0x345d('0x2'))(_0x345d('0x3'));var moment=require(_0x345d('0x4'));var BPromise=require(_0x345d('0x5'));var rp=require(_0x345d('0x6'));var fs=require('fs');var path=require(_0x345d('0x7'));var rimraf=require(_0x345d('0x8'));var config=require('../../config/environment');var attributes=require(_0x345d('0x9'));module['exports']=function(_0x31a099,_0x33dd32){return _0x31a099[_0x345d('0xa')]('UserChatQueue',attributes,{'tableName':_0x345d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 580e653..74cd305 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 _0x2723=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2723,0x108));var _0x3272=function(_0x34c0a7,_0xd888bf){_0x34c0a7=_0x34c0a7-0x0;var _0x4654fe=_0x2723[_0x34c0a7];return _0x4654fe;};'use strict';var _=require(_0x3272('0x0'));var util=require('util');var moment=require(_0x3272('0x1'));var BPromise=require(_0x3272('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3272('0x3'));var db=require(_0x3272('0x4'))['db'];var utils=require(_0x3272('0x5'));var logger=require('../../config/logger')(_0x3272('0x6'));var config=require(_0x3272('0x7'));var jayson=require(_0x3272('0x8'));var client=jayson[_0x3272('0x9')][_0x3272('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51eb6e,_0x34df08,_0x568be7){return new BPromise(function(_0x401f46,_0x4e28a1){return client[_0x3272('0xb')](_0x51eb6e,_0x568be7)[_0x3272('0xc')](function(_0x3021d9){logger[_0x3272('0xd')](_0x3272('0xe'),_0x34df08,_0x3272('0xf'));logger[_0x3272('0x10')](_0x3272('0x11'),_0x34df08,_0x3272('0xf'),JSON[_0x3272('0x12')](_0x3021d9));if(_0x3021d9[_0x3272('0x13')]){if(_0x3021d9[_0x3272('0x13')][_0x3272('0x14')]===0x1f4){logger[_0x3272('0x13')](_0x3272('0xe'),_0x34df08,_0x3021d9[_0x3272('0x13')][_0x3272('0x15')]);return _0x4e28a1(_0x3021d9['error'][_0x3272('0x15')]);}logger[_0x3272('0x13')](_0x3272('0xe'),_0x34df08,_0x3021d9['error']['message']);return _0x401f46(_0x3021d9['error'][_0x3272('0x15')]);}else{logger[_0x3272('0xd')](_0x3272('0xe'),_0x34df08,_0x3272('0xf'));_0x401f46(_0x3021d9['result'][_0x3272('0x15')]);}})['catch'](function(_0x45b815){logger['error'](_0x3272('0xe'),_0x34df08,_0x45b815);_0x4e28a1(_0x45b815);});});} \ No newline at end of file +var _0xc602=['request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s'];(function(_0xe26bb8,_0x4c7683){var _0x1af4ec=function(_0x143879){while(--_0x143879){_0xe26bb8['push'](_0xe26bb8['shift']());}};_0x1af4ec(++_0x4c7683);}(_0xc602,0x10a));var _0x2c60=function(_0x160cb8,_0x27d7d9){_0x160cb8=_0x160cb8-0x0;var _0x2a2b93=_0xc602[_0x160cb8];return _0x2a2b93;};'use strict';var _=require(_0x2c60('0x0'));var util=require(_0x2c60('0x1'));var moment=require('moment');var BPromise=require(_0x2c60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c60('0x3'));var db=require(_0x2c60('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2c60('0x5'))(_0x2c60('0x6'));var config=require(_0x2c60('0x7'));var jayson=require(_0x2c60('0x8'));var client=jayson[_0x2c60('0x9')][_0x2c60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55c5b0,_0x2fd6fa,_0x868f){return new BPromise(function(_0x4cd583,_0x214517){return client[_0x2c60('0xb')](_0x55c5b0,_0x868f)['then'](function(_0x45cab0){logger[_0x2c60('0xc')](_0x2c60('0xd'),_0x2fd6fa,_0x2c60('0xe'));logger[_0x2c60('0xf')](_0x2c60('0x10'),_0x2fd6fa,'request\x20sent',JSON[_0x2c60('0x11')](_0x45cab0));if(_0x45cab0['error']){if(_0x45cab0[_0x2c60('0x12')]['code']===0x1f4){logger['error'](_0x2c60('0xd'),_0x2fd6fa,_0x45cab0[_0x2c60('0x12')][_0x2c60('0x13')]);return _0x214517(_0x45cab0[_0x2c60('0x12')][_0x2c60('0x13')]);}logger[_0x2c60('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x2fd6fa,_0x45cab0[_0x2c60('0x12')][_0x2c60('0x13')]);return _0x4cd583(_0x45cab0[_0x2c60('0x12')][_0x2c60('0x13')]);}else{logger['info'](_0x2c60('0xd'),_0x2fd6fa,_0x2c60('0xe'));_0x4cd583(_0x45cab0['result'][_0x2c60('0x13')]);}})['catch'](function(_0x47aa2d){logger[_0x2c60('0x12')](_0x2c60('0xd'),_0x2fd6fa,_0x47aa2d);_0x214517(_0x47aa2d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 8c9f2b0..be1a7a3 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xd93cbe,_0x11202e){var _0xe0bb40=function(_0x50f4cc){while(--_0x50f4cc){_0xd93cbe['push'](_0xd93cbe['shift']());}};_0xe0bb40(++_0x11202e);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xf64500,_0x410815){var _0x58a6e0=function(_0x1fee17){while(--_0x1fee17){_0xf64500['push'](_0xf64500['shift']());}};_0x58a6e0(++_0x410815);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 4873ece..5b96e99 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 _0x1120=['exports','INTEGER','STRING','sequelize'];(function(_0x1fc25b,_0x593674){var _0x46d52b=function(_0x5a6e8b){while(--_0x5a6e8b){_0x1fc25b['push'](_0x1fc25b['shift']());}};_0x46d52b(++_0x593674);}(_0x1120,0x18b));var _0x0112=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x1120[_0x44268d];return _0x4be92d;};'use strict';var Sequelize=require(_0x0112('0x0'));module[_0x0112('0x1')]={'penalty':{'type':Sequelize[_0x0112('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0112('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0112('0x3')]}}; \ No newline at end of file +var _0x0c64=['exports','INTEGER','sequelize'];(function(_0x32ed66,_0x3c2265){var _0x166ead=function(_0xb92856){while(--_0xb92856){_0x32ed66['push'](_0x32ed66['shift']());}};_0x166ead(++_0x3c2265);}(_0x0c64,0x110));var _0x40c6=function(_0x3d9b19,_0x5c9b8e){_0x3d9b19=_0x3d9b19-0x0;var _0x1c1b96=_0x0c64[_0x3d9b19];return _0x1c1b96;};'use strict';var Sequelize=require(_0x40c6('0x0'));module[_0x40c6('0x1')]={'penalty':{'type':Sequelize[_0x40c6('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x40c6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index ac48e8f..f257d60 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 _0x167e=['define','user_has_fax_queues','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x43606b,_0x2f2292){var _0xbfd21a=function(_0x2f28fa){while(--_0x2f28fa){_0x43606b['push'](_0x43606b['shift']());}};_0xbfd21a(++_0x2f2292);}(_0x167e,0x1d6));var _0xe167=function(_0x3f6456,_0x3e254d){_0x3f6456=_0x3f6456-0x0;var _0x34d923=_0x167e[_0x3f6456];return _0x34d923;};'use strict';var _=require('lodash');var util=require(_0xe167('0x0'));var logger=require('../../config/logger')(_0xe167('0x1'));var moment=require('moment');var BPromise=require(_0xe167('0x2'));var rp=require(_0xe167('0x3'));var fs=require('fs');var path=require(_0xe167('0x4'));var rimraf=require(_0xe167('0x5'));var config=require(_0xe167('0x6'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0xec7fc6,_0x34176b){return _0xec7fc6[_0xe167('0x7')]('UserFaxQueue',attributes,{'tableName':_0xe167('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf748=['define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x399ac1,_0x4baee1){var _0x46ed4b=function(_0xc36df7){while(--_0xc36df7){_0x399ac1['push'](_0x399ac1['shift']());}};_0x46ed4b(++_0x4baee1);}(_0xf748,0xe7));var _0x8f74=function(_0x37ace5,_0x5546de){_0x37ace5=_0x37ace5-0x0;var _0x235299=_0xf748[_0x37ace5];return _0x235299;};'use strict';var _=require(_0x8f74('0x0'));var util=require(_0x8f74('0x1'));var logger=require(_0x8f74('0x2'))(_0x8f74('0x3'));var moment=require(_0x8f74('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f74('0x5'));var rimraf=require(_0x8f74('0x6'));var config=require(_0x8f74('0x7'));var attributes=require(_0x8f74('0x8'));module['exports']=function(_0x2b9724,_0x14e5d0){return _0x2b9724[_0x8f74('0x9')](_0x8f74('0xa'),attributes,{'tableName':_0x8f74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 48fe3c0..69f1f71 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 _0x32cb=['request\x20sent','debug','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x266da1,_0x357901){var _0x40c6fe=function(_0x4af66a){while(--_0x4af66a){_0x266da1['push'](_0x266da1['shift']());}};_0x40c6fe(++_0x357901);}(_0x32cb,0x1d3));var _0xb32c=function(_0x3b0c00,_0x31b49e){_0x3b0c00=_0x3b0c00-0x0;var _0x34d184=_0x32cb[_0x3b0c00];return _0x34d184;};'use strict';var _=require(_0xb32c('0x0'));var util=require(_0xb32c('0x1'));var moment=require('moment');var BPromise=require(_0xb32c('0x2'));var rs=require(_0xb32c('0x3'));var fs=require('fs');var Redis=require(_0xb32c('0x4'));var db=require(_0xb32c('0x5'))['db'];var utils=require(_0xb32c('0x6'));var logger=require(_0xb32c('0x7'))(_0xb32c('0x8'));var config=require(_0xb32c('0x9'));var jayson=require(_0xb32c('0xa'));var client=jayson[_0xb32c('0xb')][_0xb32c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x586d0a,_0x480859,_0x201d20){return new BPromise(function(_0x48a213,_0x30dbe9){return client[_0xb32c('0xd')](_0x586d0a,_0x201d20)[_0xb32c('0xe')](function(_0x4ed9bb){logger[_0xb32c('0xf')](_0xb32c('0x10'),_0x480859,_0xb32c('0x11'));logger[_0xb32c('0x12')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x480859,_0xb32c('0x11'),JSON['stringify'](_0x4ed9bb));if(_0x4ed9bb[_0xb32c('0x13')]){if(_0x4ed9bb['error']['code']===0x1f4){logger['error'](_0xb32c('0x10'),_0x480859,_0x4ed9bb['error']['message']);return _0x30dbe9(_0x4ed9bb[_0xb32c('0x13')][_0xb32c('0x14')]);}logger[_0xb32c('0x13')](_0xb32c('0x10'),_0x480859,_0x4ed9bb['error'][_0xb32c('0x14')]);return _0x48a213(_0x4ed9bb[_0xb32c('0x13')]['message']);}else{logger[_0xb32c('0xf')](_0xb32c('0x10'),_0x480859,_0xb32c('0x11'));_0x48a213(_0x4ed9bb[_0xb32c('0x15')]['message']);}})['catch'](function(_0x467b2c){logger[_0xb32c('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x480859,_0x467b2c);_0x30dbe9(_0x467b2c);});});} \ No newline at end of file +var _0x57bc=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x548345,_0x4b14a2){var _0x506b1d=function(_0x1de232){while(--_0x1de232){_0x548345['push'](_0x548345['shift']());}};_0x506b1d(++_0x4b14a2);}(_0x57bc,0x11b));var _0xc57b=function(_0x18bc80,_0x1f179f){_0x18bc80=_0x18bc80-0x0;var _0x21a7a9=_0x57bc[_0x18bc80];return _0x21a7a9;};'use strict';var _=require(_0xc57b('0x0'));var util=require(_0xc57b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc57b('0x2'));var fs=require('fs');var Redis=require(_0xc57b('0x3'));var db=require(_0xc57b('0x4'))['db'];var utils=require(_0xc57b('0x5'));var logger=require(_0xc57b('0x6'))(_0xc57b('0x7'));var config=require(_0xc57b('0x8'));var jayson=require(_0xc57b('0x9'));var client=jayson[_0xc57b('0xa')][_0xc57b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e8710,_0xc9a371,_0x171d93){return new BPromise(function(_0x53a397,_0x44414d){return client[_0xc57b('0xc')](_0x2e8710,_0x171d93)[_0xc57b('0xd')](function(_0x4174e1){logger[_0xc57b('0xe')](_0xc57b('0xf'),_0xc9a371,_0xc57b('0x10'));logger[_0xc57b('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xc9a371,'request\x20sent',JSON[_0xc57b('0x12')](_0x4174e1));if(_0x4174e1[_0xc57b('0x13')]){if(_0x4174e1[_0xc57b('0x13')][_0xc57b('0x14')]===0x1f4){logger[_0xc57b('0x13')](_0xc57b('0xf'),_0xc9a371,_0x4174e1[_0xc57b('0x13')][_0xc57b('0x15')]);return _0x44414d(_0x4174e1[_0xc57b('0x13')][_0xc57b('0x15')]);}logger['error'](_0xc57b('0xf'),_0xc9a371,_0x4174e1['error'][_0xc57b('0x15')]);return _0x53a397(_0x4174e1[_0xc57b('0x13')][_0xc57b('0x15')]);}else{logger[_0xc57b('0xe')](_0xc57b('0xf'),_0xc9a371,_0xc57b('0x10'));_0x53a397(_0x4174e1[_0xc57b('0x16')][_0xc57b('0x15')]);}})['catch'](function(_0x1d70c4){logger[_0xc57b('0x13')](_0xc57b('0xf'),_0xc9a371,_0x1d70c4);_0x44414d(_0x1d70c4);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 5ee7656..ac8f58b 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3a3041,_0x2e6118){var _0x136988=function(_0x2b501c){while(--_0x2b501c){_0x3a3041['push'](_0x3a3041['shift']());}};_0x136988(++_0x2e6118);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x26659f,_0x32f426){var _0x42667f=function(_0xdc0b71){while(--_0xdc0b71){_0x26659f['push'](_0x26659f['shift']());}};_0x42667f(++_0x32f426);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index d1294cd..6fed6f7 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 _0xb33c=['sequelize','exports','INTEGER'];(function(_0x1692ce,_0x596641){var _0x5c2a63=function(_0x25161f){while(--_0x25161f){_0x1692ce['push'](_0x1692ce['shift']());}};_0x5c2a63(++_0x596641);}(_0xb33c,0x12c));var _0xcb33=function(_0x3a25d7,_0xac4e81){_0x3a25d7=_0x3a25d7-0x0;var _0x4d0c41=_0xb33c[_0x3a25d7];return _0x4d0c41;};'use strict';var Sequelize=require(_0xcb33('0x0'));module[_0xcb33('0x1')]={'penalty':{'type':Sequelize[_0xcb33('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4337=['exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4337,0x16e));var _0x7433=function(_0x775c8,_0x170e26){_0x775c8=_0x775c8-0x0;var _0x1cdbfe=_0x4337[_0x775c8];return _0x1cdbfe;};'use strict';var Sequelize=require('sequelize');module[_0x7433('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index a73d2cb..b16b0a3 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 _0xc920=['define','UserMailQueue','user_has_mail_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x52f3a3,_0x736637){var _0x37865b=function(_0x3a3344){while(--_0x3a3344){_0x52f3a3['push'](_0x52f3a3['shift']());}};_0x37865b(++_0x736637);}(_0xc920,0xe0));var _0x0c92=function(_0x4fa08c,_0x30cac4){_0x4fa08c=_0x4fa08c-0x0;var _0x7a920a=_0xc920[_0x4fa08c];return _0x7a920a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c92('0x0'))(_0x0c92('0x1'));var moment=require(_0x0c92('0x2'));var BPromise=require(_0x0c92('0x3'));var rp=require(_0x0c92('0x4'));var fs=require('fs');var path=require(_0x0c92('0x5'));var rimraf=require(_0x0c92('0x6'));var config=require(_0x0c92('0x7'));var attributes=require(_0x0c92('0x8'));module[_0x0c92('0x9')]=function(_0x2896ff,_0x3f55dd){return _0x2896ff[_0x0c92('0xa')](_0x0c92('0xb'),attributes,{'tableName':_0x0c92('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc703=['rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1a8d28,_0x273169){var _0x1ceee2=function(_0x346f7e){while(--_0x346f7e){_0x1a8d28['push'](_0x1a8d28['shift']());}};_0x1ceee2(++_0x273169);}(_0xc703,0x6e));var _0x3c70=function(_0x259a42,_0x2b4483){_0x259a42=_0x259a42-0x0;var _0x548d68=_0xc703[_0x259a42];return _0x548d68;};'use strict';var _=require(_0x3c70('0x0'));var util=require(_0x3c70('0x1'));var logger=require(_0x3c70('0x2'))(_0x3c70('0x3'));var moment=require(_0x3c70('0x4'));var BPromise=require(_0x3c70('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c70('0x6'));var rimraf=require(_0x3c70('0x7'));var config=require('../../config/environment');var attributes=require(_0x3c70('0x8'));module[_0x3c70('0x9')]=function(_0x5c7787,_0xe00773){return _0x5c7787[_0x3c70('0xa')](_0x3c70('0xb'),attributes,{'tableName':_0x3c70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index e1594ea..1a70c41 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x1cb9,0x14e));var _0x91cb=function(_0x527088,_0x2479be){_0x527088=_0x527088-0x0;var _0x29e7b9=_0x1cb9[_0x527088];return _0x29e7b9;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5c95d3,_0x380434){_0x5c95d3=_0x5c95d3-0x0;var _0x290f19=_0x1cb9[_0x5c95d3];return _0x290f19;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index bf574bf..635ebe1 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 _0x72fa=['../../components/interaction/service','./userNotification.controller','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4811fc,_0x462867){var _0x17ae26=function(_0x15055f){while(--_0x15055f){_0x4811fc['push'](_0x4811fc['shift']());}};_0x17ae26(++_0x462867);}(_0x72fa,0x122));var _0xa72f=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0x72fa[_0x2d2e85];return _0x3e9f5e;};'use strict';var multer=require(_0xa72f('0x0'));var util=require(_0xa72f('0x1'));var path=require(_0xa72f('0x2'));var timeout=require(_0xa72f('0x3'));var express=require(_0xa72f('0x4'));var router=express[_0xa72f('0x5')]();var fs_extra=require(_0xa72f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa72f('0x7'));var config=require('../../config/environment');var controller=require(_0xa72f('0x8'));router['post']('/',auth['isAuthenticated'](),controller[_0xa72f('0x9')]);module[_0xa72f('0xa')]=router; \ No newline at end of file +var _0xadd0=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout'];(function(_0x4d6a4d,_0x3c9aaf){var _0x5d06cc=function(_0x1c5ec3){while(--_0x1c5ec3){_0x4d6a4d['push'](_0x4d6a4d['shift']());}};_0x5d06cc(++_0x3c9aaf);}(_0xadd0,0x88));var _0x0add=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xadd0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0add('0x0'));var util=require(_0x0add('0x1'));var path=require(_0x0add('0x2'));var timeout=require(_0x0add('0x3'));var express=require(_0x0add('0x4'));var router=express['Router']();var fs_extra=require(_0x0add('0x5'));var auth=require(_0x0add('0x6'));var interaction=require(_0x0add('0x7'));var config=require(_0x0add('0x8'));var controller=require(_0x0add('0x9'));router[_0x0add('0xa')]('/',auth[_0x0add('0xb')](),controller[_0x0add('0xc')]);module[_0x0add('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 1a48a2e..b531c0a 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 _0xc2cd=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1e6f66,_0x21424d){var _0x21893c=function(_0x5de055){while(--_0x5de055){_0x1e6f66['push'](_0x1e6f66['shift']());}};_0x21893c(++_0x21424d);}(_0xc2cd,0x1a8));var _0xdc2c=function(_0x4d124d,_0x24db6c){_0x4d124d=_0x4d124d-0x0;var _0x9a237c=_0xc2cd[_0x4d124d];return _0x9a237c;};'use strict';var Sequelize=require(_0xdc2c('0x0'));module[_0xdc2c('0x1')]={'body':{'type':Sequelize[_0xdc2c('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xdc2c('0x2')]},'recipientsDescription':{'type':Sequelize[_0xdc2c('0x3')]},'beep':{'type':Sequelize[_0xdc2c('0x4')]}}; \ No newline at end of file +var _0xe366=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x2d3206,_0x434cf5){var _0x18702d=function(_0x4e0735){while(--_0x4e0735){_0x2d3206['push'](_0x2d3206['shift']());}};_0x18702d(++_0x434cf5);}(_0xe366,0xf5));var _0x6e36=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xe366[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x6e36('0x0'));module[_0x6e36('0x1')]={'body':{'type':Sequelize[_0x6e36('0x2')]},'senderName':{'type':Sequelize[_0x6e36('0x3')]},'recipientsId':{'type':Sequelize[_0x6e36('0x2')]},'recipientsDescription':{'type':Sequelize[_0x6e36('0x3')]},'beep':{'type':Sequelize[_0x6e36('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 1c8d010..d7bda26 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 _0x5f88=['ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','senderName','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','replace','queue','Queue','ids','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x5f88,0x134));var _0x85f8=function(_0x216dcb,_0x19bb51){_0x216dcb=_0x216dcb-0x0;var _0x594a83=_0x5f88[_0x216dcb];return _0x594a83;};'use strict';var emlformat=require(_0x85f8('0x0'));var rimraf=require(_0x85f8('0x1'));var zipdir=require(_0x85f8('0x2'));var jsonpatch=require(_0x85f8('0x3'));var rp=require('request-promise');var moment=require(_0x85f8('0x4'));var BPromise=require(_0x85f8('0x5'));var Mustache=require(_0x85f8('0x6'));var util=require(_0x85f8('0x7'));var path=require(_0x85f8('0x8'));var sox=require(_0x85f8('0x9'));var csv=require('to-csv');var ejs=require(_0x85f8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85f8('0xb'));var squel=require('squel');var crypto=require(_0x85f8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x85f8('0xd'));var toCsv=require(_0x85f8('0xe'));var querystring=require(_0x85f8('0xf'));var Papa=require(_0x85f8('0x10'));var Redis=require(_0x85f8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x85f8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85f8('0x13'));var logger=require(_0x85f8('0x14'))(_0x85f8('0x15'));var utils=require(_0x85f8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x85f8('0x17'))['db'];config[_0x85f8('0x18')]=_[_0x85f8('0x19')](config[_0x85f8('0x18')],{'host':_0x85f8('0x1a'),'port':0x18eb});var socket=require(_0x85f8('0x1b'))(new Redis(config[_0x85f8('0x18')]));require('./userNotification.socket')[_0x85f8('0x1c')](socket);function respondWithStatusCode(_0x11b71a,_0x3ec1c1){_0x3ec1c1=_0x3ec1c1||0xcc;return function(_0x368eb1){if(_0x368eb1){return _0x11b71a[_0x85f8('0x1d')](_0x3ec1c1);}return _0x11b71a['status'](_0x3ec1c1)['end']();};}function respondWithResult(_0x36298f,_0x78ad10){_0x78ad10=_0x78ad10||0xc8;return function(_0x10efa8){if(_0x10efa8){return _0x36298f[_0x85f8('0x1e')](_0x78ad10)[_0x85f8('0x1f')](_0x10efa8);}};}function respondWithFilteredResult(_0x2e9bc2,_0x2c3b64){return function(_0x479643){if(_0x479643){var _0x455a7f=typeof _0x2c3b64['offset']===_0x85f8('0x20')&&typeof _0x2c3b64[_0x85f8('0x21')]===_0x85f8('0x20');var _0x20f5ba=_0x479643[_0x85f8('0x22')];var _0x17e431=_0x455a7f?0x0:_0x2c3b64['offset'];var _0x3b68cb=_0x455a7f?_0x479643[_0x85f8('0x22')]:_0x2c3b64['offset']+_0x2c3b64[_0x85f8('0x21')];var _0xeb7a09;if(_0x3b68cb>=_0x20f5ba){_0x3b68cb=_0x20f5ba;_0xeb7a09=0xc8;}else{_0xeb7a09=0xce;}_0x2e9bc2[_0x85f8('0x1e')](_0xeb7a09);return _0x2e9bc2[_0x85f8('0x23')](_0x85f8('0x24'),_0x17e431+'-'+_0x3b68cb+'/'+_0x20f5ba)['json'](_0x479643);}return null;};}function patchUpdates(_0x144e29){return function(_0x39b4c2){try{jsonpatch[_0x85f8('0x25')](_0x39b4c2,_0x144e29,!![]);}catch(_0x3a6de1){return BPromise[_0x85f8('0x26')](_0x3a6de1);}return _0x39b4c2[_0x85f8('0x27')]();};}function saveUpdates(_0x477d45,_0x1d4b56){return function(_0x39c62f){if(_0x39c62f){return _0x39c62f[_0x85f8('0x28')](_0x477d45)[_0x85f8('0x29')](function(_0x2a21e5){return _0x2a21e5;});}return null;};}function removeEntity(_0x2c7aaa,_0x3f687d){return function(_0x13347e){if(_0x13347e){return _0x13347e[_0x85f8('0x2a')]()[_0x85f8('0x29')](function(){_0x2c7aaa[_0x85f8('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5616b7,_0x833b46){return function(_0x46abdf){if(!_0x46abdf){_0x5616b7[_0x85f8('0x1d')](0x194);}return _0x46abdf;};}function handleError(_0x31c8f4,_0x5918b0){_0x5918b0=_0x5918b0||0x1f4;return function(_0x45d123){logger[_0x85f8('0x2b')](_0x45d123[_0x85f8('0x2c')]);if(_0x45d123[_0x85f8('0x2d')]){delete _0x45d123[_0x85f8('0x2d')];}_0x31c8f4[_0x85f8('0x1e')](_0x5918b0)[_0x85f8('0x2e')](_0x45d123);};}exports[_0x85f8('0x2f')]=function(_0x4c96d1,_0x226af6,_0xb1b3b8){if(!_0x4c96d1[_0x85f8('0x30')]['hasOwnProperty']('text')&&!_0x4c96d1['body'][_0x85f8('0x31')](_0x85f8('0x32'))){throw new db[(_0x85f8('0x33'))][(_0x85f8('0x34'))](_0x85f8('0x35'));}else{if(_0x4c96d1[_0x85f8('0x30')][_0x85f8('0x31')](_0x85f8('0x32'))&&!_0x4c96d1[_0x85f8('0x30')][_0x85f8('0x31')](_0x85f8('0x36'))){throw new db['Sequelize'][(_0x85f8('0x34'))](_0x85f8('0x37'));}if(!_0x4c96d1['body'][_0x85f8('0x31')](_0x85f8('0x38'))){throw new db[(_0x85f8('0x33'))][(_0x85f8('0x34'))](_0x85f8('0x39'));}else{try{var _0x4ab778=JSON[_0x85f8('0x3a')](_0x4c96d1[_0x85f8('0x30')][_0x85f8('0x38')]);}catch(_0x299f57){logger['error'](_0x299f57);throw new db[(_0x85f8('0x33'))][(_0x85f8('0x34'))](_0x85f8('0x3b'));}var _0x223f80=[_0x85f8('0x3c'),_0x85f8('0x3d'),_0x85f8('0x3e'),'openchannelqueue',_0x85f8('0x3f'),'voicequeue','whatsappqueue',_0x85f8('0x40'),_0x85f8('0x41')];if(_[_0x85f8('0x42')](_0x4ab778,function(_0x373412){return!_[_0x85f8('0x43')](_0x223f80,_0x373412[_0x85f8('0x44')][_0x85f8('0x45')]());})){throw new db[(_0x85f8('0x33'))][(_0x85f8('0x34'))](_0x85f8('0x46'));}}}var _0x7996b5={};_0x7996b5['senderName']=_0x4c96d1[_0x85f8('0x30')][_0x85f8('0x31')]('senderName')?_0x4c96d1[_0x85f8('0x30')]['senderName']:_0x4c96d1[_0x85f8('0x41')]['fullname'];_0x7996b5[_0x85f8('0x47')]=_[_0x85f8('0x48')](_0x4c96d1[_0x85f8('0x30')][_0x85f8('0x47')])?null:_0x4c96d1['body'][_0x85f8('0x47')];_0x7996b5[_0x85f8('0x49')]=_0x4c96d1[_0x85f8('0x30')][_0x85f8('0x49')]||![];_0x7996b5[_0x85f8('0x4a')]=_0x4c96d1['user']['id'];return getContent(_0x4c96d1['body'])['then'](function(_0x28ea91){_0x7996b5[_0x85f8('0x30')]=_0x28ea91;return getRecipients(_0x4ab778);})[_0x85f8('0x29')](function(_0x165280){_0x7996b5[_0x85f8('0x4b')]=_[_0x85f8('0x4c')](_0x165280)[_0x85f8('0x4d')](',');return db[_0x85f8('0x4e')][_0x85f8('0x4f')](function(_0x34b674){return db[_0x85f8('0x50')][_0x85f8('0x51')](_0x7996b5,{'raw':!![],'transaction':_0x34b674})[_0x85f8('0x29')](function(_0x5a5099){var _0x4c54a2={'sender':_0x7996b5[_0x85f8('0x52')],'description':_0x7996b5['recipientsDescription'],'content':_0x7996b5[_0x85f8('0x30')],'beep':_0x7996b5['beep']};_0x165280[_0x85f8('0x53')](function(_0x22632c){_0x4c54a2[_0x85f8('0x54')]=_0x22632c;socket[_0x85f8('0x55')](_0x85f8('0x56'),_0x4c54a2);});return _0x5a5099;});});})[_0x85f8('0x29')](respondWithResult(_0x226af6,0xc9))[_0x85f8('0x57')](handleError(_0x226af6,null));};function getContent(_0x402528){return new BPromise(function(_0x55e1c3,_0x1c8429){if(_0x402528[_0x85f8('0x58')]){_0x55e1c3(_0x402528[_0x85f8('0x58')]);return;}return db[_0x85f8('0x59')][_0x85f8('0x5a')]({'attributes':['html'],'where':{'id':_0x402528['TemplateId']},'raw':!![]})['then'](function(_0x21c961){if(!_0x21c961)throw new db[(_0x85f8('0x33'))][(_0x85f8('0x34'))](_0x85f8('0x5b'));var _0x3287af=Mustache[_0x85f8('0x5c')](_0x21c961[_0x85f8('0x5d')],_0x402528[_0x85f8('0x36')]);_0x55e1c3(_0x3287af);})[_0x85f8('0x57')](function(_0x29eb8a){_0x1c8429(_0x29eb8a);});});}function getRecipients(_0x475632){return new BPromise(function(_0xc5a303,_0x5acecf){var _0x5c244c=[];var _0x2bb22a=[];_0x475632[_0x85f8('0x53')](function(_0x39f92b){var _0xc11dc0=_[_0x85f8('0x5e')](_0x39f92b[_0x85f8('0x44')][_0x85f8('0x45')]());if(_0xc11dc0===_0x85f8('0x5f')){_0x5c244c=_[_0x85f8('0x60')](_0x5c244c,_0x39f92b['ids']);}else{if(_[_0x85f8('0x43')](_0xc11dc0,'queue'))_0xc11dc0=_0xc11dc0[_0x85f8('0x61')](_0x85f8('0x62'),_0x85f8('0x63'));_0x39f92b[_0x85f8('0x64')][_0x85f8('0x53')](function(_0x2afbec){_0x2bb22a[_0x85f8('0x65')](getAgents(_0xc11dc0,_0x2afbec));});}});return BPromise[_0x85f8('0x66')](_0x2bb22a)[_0x85f8('0x29')](function(_0xd551ce){_0x5c244c=_[_0x85f8('0x60')](_0x5c244c,_[_0x85f8('0x67')](_0xd551ce));_0xc5a303(_0x5c244c);})[_0x85f8('0x57')](function(_0x58b4a4){_0x5acecf(_0x58b4a4);});});}function getAgents(_0x3c070a,_0x516d44){return new BPromise(function(_0x22d181,_0x376d47){return db[_0x3c070a][_0x85f8('0x5a')]({'where':{'id':_0x516d44}})[_0x85f8('0x29')](function(_0x125dc9){return _0x125dc9[_0x85f8('0x68')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2e53c0){var _0x3065ce=_[_0x85f8('0x69')](_0x2e53c0,'id');_0x22d181(_0x3065ce);});})[_0x85f8('0x57')](function(_0x167537){_0x376d47(_0x167537);});});} \ No newline at end of file +var _0x6a08=['toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','ids','queue','replace','Queue','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','destroy','then','error','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model'];(function(_0x4927e6,_0x5b739e){var _0x24b633=function(_0x2d642a){while(--_0x2d642a){_0x4927e6['push'](_0x4927e6['shift']());}};_0x24b633(++_0x5b739e);}(_0x6a08,0xe4));var _0x86a0=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0x6a08[_0x41cfd4];return _0x190f48;};'use strict';var emlformat=require(_0x86a0('0x0'));var rimraf=require(_0x86a0('0x1'));var zipdir=require(_0x86a0('0x2'));var jsonpatch=require(_0x86a0('0x3'));var rp=require(_0x86a0('0x4'));var moment=require(_0x86a0('0x5'));var BPromise=require(_0x86a0('0x6'));var Mustache=require(_0x86a0('0x7'));var util=require(_0x86a0('0x8'));var path=require(_0x86a0('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x86a0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86a0('0xb'));var squel=require('squel');var crypto=require(_0x86a0('0xc'));var jsforce=require(_0x86a0('0xd'));var deskjs=require(_0x86a0('0xe'));var toCsv=require(_0x86a0('0xf'));var querystring=require(_0x86a0('0x10'));var Papa=require(_0x86a0('0x11'));var Redis=require(_0x86a0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x86a0('0x13'));var as=require(_0x86a0('0x14'));var hardwareService=require(_0x86a0('0x15'));var logger=require(_0x86a0('0x16'))(_0x86a0('0x17'));var utils=require(_0x86a0('0x18'));var config=require(_0x86a0('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x86a0('0x1a')]=_[_0x86a0('0x1b')](config['redis'],{'host':_0x86a0('0x1c'),'port':0x18eb});var socket=require(_0x86a0('0x1d'))(new Redis(config['redis']));require('./userNotification.socket')[_0x86a0('0x1e')](socket);function respondWithStatusCode(_0x294ca1,_0x5297f7){_0x5297f7=_0x5297f7||0xcc;return function(_0xf5fb92){if(_0xf5fb92){return _0x294ca1[_0x86a0('0x1f')](_0x5297f7);}return _0x294ca1[_0x86a0('0x20')](_0x5297f7)[_0x86a0('0x21')]();};}function respondWithResult(_0x1206a0,_0x14630b){_0x14630b=_0x14630b||0xc8;return function(_0x4e7716){if(_0x4e7716){return _0x1206a0[_0x86a0('0x20')](_0x14630b)[_0x86a0('0x22')](_0x4e7716);}};}function respondWithFilteredResult(_0x115d51,_0x43ccdf){return function(_0x4a1af5){if(_0x4a1af5){var _0x5469db=typeof _0x43ccdf['offset']===_0x86a0('0x23')&&typeof _0x43ccdf[_0x86a0('0x24')]===_0x86a0('0x23');var _0x4dc729=_0x4a1af5[_0x86a0('0x25')];var _0x51d8fa=_0x5469db?0x0:_0x43ccdf[_0x86a0('0x26')];var _0x2e379f=_0x5469db?_0x4a1af5[_0x86a0('0x25')]:_0x43ccdf['offset']+_0x43ccdf[_0x86a0('0x24')];var _0x3f01d3;if(_0x2e379f>=_0x4dc729){_0x2e379f=_0x4dc729;_0x3f01d3=0xc8;}else{_0x3f01d3=0xce;}_0x115d51['status'](_0x3f01d3);return _0x115d51['set']('Content-Range',_0x51d8fa+'-'+_0x2e379f+'/'+_0x4dc729)[_0x86a0('0x22')](_0x4a1af5);}return null;};}function patchUpdates(_0x496f0e){return function(_0x529cad){try{jsonpatch[_0x86a0('0x27')](_0x529cad,_0x496f0e,!![]);}catch(_0x46e079){return BPromise['reject'](_0x46e079);}return _0x529cad[_0x86a0('0x28')]();};}function saveUpdates(_0x29257e,_0x502ee3){return function(_0x3afb21){if(_0x3afb21){return _0x3afb21['update'](_0x29257e)['then'](function(_0x5a2f89){return _0x5a2f89;});}return null;};}function removeEntity(_0x1f6e05,_0x52d739){return function(_0x1ee8e7){if(_0x1ee8e7){return _0x1ee8e7[_0x86a0('0x29')]()[_0x86a0('0x2a')](function(){_0x1f6e05[_0x86a0('0x20')](0xcc)[_0x86a0('0x21')]();});}};}function handleEntityNotFound(_0x12068e,_0x48b5e8){return function(_0x54aaa6){if(!_0x54aaa6){_0x12068e[_0x86a0('0x1f')](0x194);}return _0x54aaa6;};}function handleError(_0x2b54ac,_0x4941d1){_0x4941d1=_0x4941d1||0x1f4;return function(_0x108e92){logger[_0x86a0('0x2b')](_0x108e92[_0x86a0('0x2c')]);if(_0x108e92['name']){delete _0x108e92[_0x86a0('0x2d')];}_0x2b54ac[_0x86a0('0x20')](_0x4941d1)[_0x86a0('0x2e')](_0x108e92);};}exports['sendUserNotification']=function(_0xfcb1a,_0x2ca92c,_0x12f472){if(!_0xfcb1a[_0x86a0('0x2f')][_0x86a0('0x30')](_0x86a0('0x31'))&&!_0xfcb1a['body'][_0x86a0('0x30')](_0x86a0('0x32'))){throw new db[(_0x86a0('0x33'))][(_0x86a0('0x34'))](_0x86a0('0x35'));}else{if(_0xfcb1a[_0x86a0('0x2f')]['hasOwnProperty'](_0x86a0('0x32'))&&!_0xfcb1a['body'][_0x86a0('0x30')](_0x86a0('0x36'))){throw new db[(_0x86a0('0x33'))][(_0x86a0('0x34'))](_0x86a0('0x37'));}if(!_0xfcb1a['body'][_0x86a0('0x30')](_0x86a0('0x38'))){throw new db[(_0x86a0('0x33'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x7b84a0=JSON[_0x86a0('0x39')](_0xfcb1a[_0x86a0('0x2f')][_0x86a0('0x38')]);}catch(_0x50faf6){logger[_0x86a0('0x2b')](_0x50faf6);throw new db['Sequelize'][(_0x86a0('0x34'))](_0x86a0('0x3a'));}var _0x4591eb=[_0x86a0('0x3b'),_0x86a0('0x3c'),'mailqueue',_0x86a0('0x3d'),_0x86a0('0x3e'),_0x86a0('0x3f'),_0x86a0('0x40'),'team',_0x86a0('0x41')];if(_[_0x86a0('0x42')](_0x7b84a0,function(_0x39ffdf){return!_[_0x86a0('0x43')](_0x4591eb,_0x39ffdf[_0x86a0('0x44')][_0x86a0('0x45')]());})){throw new db[(_0x86a0('0x33'))][(_0x86a0('0x34'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0xbf6e8e={};_0xbf6e8e[_0x86a0('0x46')]=_0xfcb1a[_0x86a0('0x2f')][_0x86a0('0x30')](_0x86a0('0x46'))?_0xfcb1a[_0x86a0('0x2f')]['senderName']:_0xfcb1a['user'][_0x86a0('0x47')];_0xbf6e8e[_0x86a0('0x48')]=_[_0x86a0('0x49')](_0xfcb1a['body']['recipientsDescription'])?null:_0xfcb1a['body'][_0x86a0('0x48')];_0xbf6e8e[_0x86a0('0x4a')]=_0xfcb1a['body'][_0x86a0('0x4a')]||![];_0xbf6e8e[_0x86a0('0x4b')]=_0xfcb1a[_0x86a0('0x41')]['id'];return getContent(_0xfcb1a[_0x86a0('0x2f')])[_0x86a0('0x2a')](function(_0x388f50){_0xbf6e8e[_0x86a0('0x2f')]=_0x388f50;return getRecipients(_0x7b84a0);})[_0x86a0('0x2a')](function(_0x1b6b96){_0xbf6e8e[_0x86a0('0x4c')]=_[_0x86a0('0x4d')](_0x1b6b96)[_0x86a0('0x4e')](',');return db['sequelize'][_0x86a0('0x4f')](function(_0x45e9b6){return db[_0x86a0('0x50')][_0x86a0('0x51')](_0xbf6e8e,{'raw':!![],'transaction':_0x45e9b6})['then'](function(_0x215ffa){var _0x264848={'sender':_0xbf6e8e['senderName'],'description':_0xbf6e8e['recipientsDescription'],'content':_0xbf6e8e[_0x86a0('0x2f')],'beep':_0xbf6e8e[_0x86a0('0x4a')]};_0x1b6b96[_0x86a0('0x52')](function(_0x4293c4){_0x264848['recipient']=_0x4293c4;socket[_0x86a0('0x53')]('userNotification:send',_0x264848);});return _0x215ffa;});});})[_0x86a0('0x2a')](respondWithResult(_0x2ca92c,0xc9))[_0x86a0('0x54')](handleError(_0x2ca92c,null));};function getContent(_0x48fe6d){return new BPromise(function(_0x2f02e6,_0x4e23bc){if(_0x48fe6d[_0x86a0('0x31')]){_0x2f02e6(_0x48fe6d[_0x86a0('0x31')]);return;}return db[_0x86a0('0x55')][_0x86a0('0x56')]({'attributes':[_0x86a0('0x57')],'where':{'id':_0x48fe6d[_0x86a0('0x32')]},'raw':!![]})[_0x86a0('0x2a')](function(_0x523512){if(!_0x523512)throw new db[(_0x86a0('0x33'))]['ValidationError'](_0x86a0('0x58'));var _0x30eb40=Mustache['render'](_0x523512[_0x86a0('0x57')],_0x48fe6d[_0x86a0('0x36')]);_0x2f02e6(_0x30eb40);})[_0x86a0('0x54')](function(_0x54f94e){_0x4e23bc(_0x54f94e);});});}function getRecipients(_0x23d699){return new BPromise(function(_0x3eb779,_0x318cc3){var _0x4cb0a0=[];var _0x2bab99=[];_0x23d699[_0x86a0('0x52')](function(_0x5dde4b){var _0x1a1b9e=_[_0x86a0('0x59')](_0x5dde4b[_0x86a0('0x44')][_0x86a0('0x45')]());if(_0x1a1b9e===_0x86a0('0x5a')){_0x4cb0a0=_[_0x86a0('0x5b')](_0x4cb0a0,_0x5dde4b[_0x86a0('0x5c')]);}else{if(_[_0x86a0('0x43')](_0x1a1b9e,_0x86a0('0x5d')))_0x1a1b9e=_0x1a1b9e[_0x86a0('0x5e')](_0x86a0('0x5d'),_0x86a0('0x5f'));_0x5dde4b['ids'][_0x86a0('0x52')](function(_0x33bbf7){_0x2bab99['push'](getAgents(_0x1a1b9e,_0x33bbf7));});}});return BPromise['all'](_0x2bab99)[_0x86a0('0x2a')](function(_0x3b57c6){_0x4cb0a0=_[_0x86a0('0x5b')](_0x4cb0a0,_[_0x86a0('0x60')](_0x3b57c6));_0x3eb779(_0x4cb0a0);})[_0x86a0('0x54')](function(_0x4f7085){_0x318cc3(_0x4f7085);});});}function getAgents(_0x9c1d82,_0x24a4e5){return new BPromise(function(_0x25e09f,_0x2dbf6f){return db[_0x9c1d82][_0x86a0('0x56')]({'where':{'id':_0x24a4e5}})['then'](function(_0x195e3d){return _0x195e3d[_0x86a0('0x61')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2eb25b){var _0x38f44e=_[_0x86a0('0x62')](_0x2eb25b,'id');_0x25e09f(_0x38f44e);});})[_0x86a0('0x54')](function(_0x34f2be){_0x2dbf6f(_0x34f2be);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 95e3aa8..0fdcd8b 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 _0x4d7a=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x435f2d,_0x1843f9){var _0x5992a7=function(_0x42d25e){while(--_0x42d25e){_0x435f2d['push'](_0x435f2d['shift']());}};_0x5992a7(++_0x1843f9);}(_0x4d7a,0x91));var _0xa4d7=function(_0x5d87e8,_0x1e853f){_0x5d87e8=_0x5d87e8-0x0;var _0x443394=_0x4d7a[_0x5d87e8];return _0x443394;};'use strict';var EventEmitter=require(_0xa4d7('0x0'));var UserNotification=require(_0xa4d7('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa4d7('0x2')](0x0);var events={'afterCreate':_0xa4d7('0x3'),'afterUpdate':_0xa4d7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x406e48){return function(_0x5d84c2,_0x180d49,_0x330361){UserNotificationEvents['emit'](_0x406e48+':'+_0x5d84c2['id'],_0x5d84c2);UserNotificationEvents[_0xa4d7('0x5')](_0x406e48,_0x5d84c2);_0x330361(null);};}for(var e in events){if(events[_0xa4d7('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xa4d7('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x78b6=['events','../../mysqldb','UserNotification','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x263607,_0x5c67f6){var _0x5d26a5=function(_0x22bf00){while(--_0x22bf00){_0x263607['push'](_0x263607['shift']());}};_0x5d26a5(++_0x5c67f6);}(_0x78b6,0x15f));var _0x678b=function(_0x2df523,_0x11b09e){_0x2df523=_0x2df523-0x0;var _0x43f919=_0x78b6[_0x2df523];return _0x43f919;};'use strict';var EventEmitter=require(_0x678b('0x0'));var UserNotification=require(_0x678b('0x1'))['db'][_0x678b('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x678b('0x3'),'afterUpdate':'update','afterDestroy':_0x678b('0x4')};function emitEvent(_0x527a05){return function(_0x3a5ef9,_0x3dc42e,_0xe03d8){UserNotificationEvents[_0x678b('0x5')](_0x527a05+':'+_0x3a5ef9['id'],_0x3a5ef9);UserNotificationEvents[_0x678b('0x5')](_0x527a05,_0x3a5ef9);_0xe03d8(null);};}for(var e in events){if(events[_0x678b('0x6')](e)){var event=events[e];UserNotification[_0x678b('0x7')](e,emitEvent(event));}}module[_0x678b('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 87f0df0..7f8874e 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 _0xf69c=['./userNotification.attributes','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x330470,_0x6bc6a2){var _0xce74b9=function(_0x95ea9a){while(--_0x95ea9a){_0x330470['push'](_0x330470['shift']());}};_0xce74b9(++_0x6bc6a2);}(_0xf69c,0x1e2));var _0xcf69=function(_0x491ff4,_0x1c83fd){_0x491ff4=_0x491ff4-0x0;var _0x223621=_0xf69c[_0x491ff4];return _0x223621;};'use strict';var _=require(_0xcf69('0x0'));var util=require(_0xcf69('0x1'));var logger=require(_0xcf69('0x2'))(_0xcf69('0x3'));var moment=require('moment');var BPromise=require(_0xcf69('0x4'));var rp=require(_0xcf69('0x5'));var fs=require('fs');var path=require(_0xcf69('0x6'));var rimraf=require('rimraf');var config=require(_0xcf69('0x7'));var attributes=require(_0xcf69('0x8'));module[_0xcf69('0x9')]=function(_0x2e8d3,_0x2ec528){return _0x2e8d3[_0xcf69('0xa')](_0xcf69('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcf69('0xc'),'collate':_0xcf69('0xd')});}; \ No newline at end of file +var _0x45d0=['api','moment','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x45d0,0x176));var _0x045d=function(_0x57f161,_0x421dce){_0x57f161=_0x57f161-0x0;var _0x17339e=_0x45d0[_0x57f161];return _0x17339e;};'use strict';var _=require(_0x045d('0x0'));var util=require(_0x045d('0x1'));var logger=require(_0x045d('0x2'))(_0x045d('0x3'));var moment=require(_0x045d('0x4'));var BPromise=require('bluebird');var rp=require(_0x045d('0x5'));var fs=require('fs');var path=require(_0x045d('0x6'));var rimraf=require(_0x045d('0x7'));var config=require(_0x045d('0x8'));var attributes=require(_0x045d('0x9'));module[_0x045d('0xa')]=function(_0x34d505,_0x22ba0c){return _0x34d505[_0x045d('0xb')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x045d('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 6d0432a..3ad4333 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 _0x0196=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults','redis','socket.io-emitter','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','code','error','message','result','util','moment','bluebird'];(function(_0x1f87a3,_0x3799c5){var _0x17ebae=function(_0x55b076){while(--_0x55b076){_0x1f87a3['push'](_0x1f87a3['shift']());}};_0x17ebae(++_0x3799c5);}(_0x0196,0x184));var _0x6019=function(_0x416541,_0xc1193a){_0x416541=_0x416541-0x0;var _0x1206c9=_0x0196[_0x416541];return _0x1206c9;};'use strict';var _=require('lodash');var util=require(_0x6019('0x0'));var moment=require(_0x6019('0x1'));var BPromise=require(_0x6019('0x2'));var rs=require(_0x6019('0x3'));var fs=require('fs');var Redis=require(_0x6019('0x4'));var db=require(_0x6019('0x5'))['db'];var utils=require(_0x6019('0x6'));var logger=require(_0x6019('0x7'))(_0x6019('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6019('0x9')]({'port':0x232a});config['redis']=_[_0x6019('0xa')](config[_0x6019('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6019('0xc'))(new Redis(config[_0x6019('0xb')]));require('./userNotification.socket')[_0x6019('0xd')](socket);function respondWithRpcPromise(_0x32900c,_0x1e01b6,_0x571e7e){return new BPromise(function(_0x3761b9,_0x1ed186){return client[_0x6019('0xe')](_0x32900c,_0x571e7e)[_0x6019('0xf')](function(_0x32ff61){logger[_0x6019('0x10')](_0x6019('0x11'),_0x1e01b6,_0x6019('0x12'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x1e01b6,'request\x20sent',JSON['stringify'](_0x32ff61));if(_0x32ff61['error']){if(_0x32ff61['error'][_0x6019('0x13')]===0x1f4){logger[_0x6019('0x14')](_0x6019('0x11'),_0x1e01b6,_0x32ff61['error'][_0x6019('0x15')]);return _0x1ed186(_0x32ff61[_0x6019('0x14')]['message']);}logger[_0x6019('0x14')](_0x6019('0x11'),_0x1e01b6,_0x32ff61[_0x6019('0x14')]['message']);return _0x3761b9(_0x32ff61[_0x6019('0x14')]['message']);}else{logger[_0x6019('0x10')](_0x6019('0x11'),_0x1e01b6,_0x6019('0x12'));_0x3761b9(_0x32ff61[_0x6019('0x16')][_0x6019('0x15')]);}})['catch'](function(_0x5c6eb8){logger[_0x6019('0x14')]('UserNotification,\x20%s,\x20%s',_0x1e01b6,_0x5c6eb8);_0x1ed186(_0x5c6eb8);});});} \ No newline at end of file +var _0x6a1c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x6a1c,0x132));var _0xc6a1=function(_0xe9cf2f,_0x219ab1){_0xe9cf2f=_0xe9cf2f-0x0;var _0x2c03b0=_0x6a1c[_0xe9cf2f];return _0x2c03b0;};'use strict';var _=require(_0xc6a1('0x0'));var util=require(_0xc6a1('0x1'));var moment=require(_0xc6a1('0x2'));var BPromise=require(_0xc6a1('0x3'));var rs=require(_0xc6a1('0x4'));var fs=require('fs');var Redis=require(_0xc6a1('0x5'));var db=require(_0xc6a1('0x6'))['db'];var utils=require(_0xc6a1('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc6a1('0x8'));var client=jayson[_0xc6a1('0x9')][_0xc6a1('0xa')]({'port':0x232a});config[_0xc6a1('0xb')]=_[_0xc6a1('0xc')](config['redis'],{'host':_0xc6a1('0xd'),'port':0x18eb});var socket=require(_0xc6a1('0xe'))(new Redis(config[_0xc6a1('0xb')]));require('./userNotification.socket')[_0xc6a1('0xf')](socket);function respondWithRpcPromise(_0x1a5c77,_0x541cb5,_0x34b3e3){return new BPromise(function(_0x4a2027,_0x4a729d){return client[_0xc6a1('0x10')](_0x1a5c77,_0x34b3e3)[_0xc6a1('0x11')](function(_0x2744c7){logger[_0xc6a1('0x12')](_0xc6a1('0x13'),_0x541cb5,_0xc6a1('0x14'));logger[_0xc6a1('0x15')](_0xc6a1('0x16'),_0x541cb5,'request\x20sent',JSON[_0xc6a1('0x17')](_0x2744c7));if(_0x2744c7[_0xc6a1('0x18')]){if(_0x2744c7[_0xc6a1('0x18')]['code']===0x1f4){logger[_0xc6a1('0x18')](_0xc6a1('0x13'),_0x541cb5,_0x2744c7[_0xc6a1('0x18')][_0xc6a1('0x19')]);return _0x4a729d(_0x2744c7['error'][_0xc6a1('0x19')]);}logger[_0xc6a1('0x18')](_0xc6a1('0x13'),_0x541cb5,_0x2744c7[_0xc6a1('0x18')]['message']);return _0x4a2027(_0x2744c7['error']['message']);}else{logger[_0xc6a1('0x12')](_0xc6a1('0x13'),_0x541cb5,'request\x20sent');_0x4a2027(_0x2744c7[_0xc6a1('0x1a')]['message']);}})[_0xc6a1('0x1b')](function(_0x1f032c){logger[_0xc6a1('0x18')](_0xc6a1('0x13'),_0x541cb5,_0x1f032c);_0x4a729d(_0x1f032c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 5e60963..0398636 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 _0x8807=['removeListener','register','userNotification:','./userNotification.events','remove','update'];(function(_0x1317f1,_0x4f3ee8){var _0x25b45f=function(_0x2c3178){while(--_0x2c3178){_0x1317f1['push'](_0x1317f1['shift']());}};_0x25b45f(++_0x4f3ee8);}(_0x8807,0x195));var _0x7880=function(_0x3bbd6b,_0x498df1){_0x3bbd6b=_0x3bbd6b-0x0;var _0x1d27fc=_0x8807[_0x3bbd6b];return _0x1d27fc;};'use strict';var UserNotificationEvents=require(_0x7880('0x0'));var events=['save',_0x7880('0x1'),_0x7880('0x2')];function createListener(_0x5c04cb,_0x4dceeb){return function(_0x20c684){_0x4dceeb['emit'](_0x5c04cb,_0x20c684);};}function removeListener(_0x59a0d7,_0x136c1c){return function(){UserNotificationEvents[_0x7880('0x3')](_0x59a0d7,_0x136c1c);};}exports[_0x7880('0x4')]=function(_0x2fa2a2){for(var _0x333433=0x0,_0x3b7682=events['length'];_0x333433<_0x3b7682;_0x333433++){var _0xb25893=events[_0x333433];var _0x49411b=createListener(_0x7880('0x5')+_0xb25893,_0x2fa2a2);UserNotificationEvents['on'](_0xb25893,_0x49411b);}}; \ No newline at end of file +var _0x7c3a=['register','userNotification:','./userNotification.events','save','update','removeListener'];(function(_0x25bf5f,_0x62ae16){var _0x13af75=function(_0x5d7986){while(--_0x5d7986){_0x25bf5f['push'](_0x25bf5f['shift']());}};_0x13af75(++_0x62ae16);}(_0x7c3a,0x7a));var _0xa7c3=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0x7c3a[_0x2d2258];return _0x18e155;};'use strict';var UserNotificationEvents=require(_0xa7c3('0x0'));var events=[_0xa7c3('0x1'),'remove',_0xa7c3('0x2')];function createListener(_0x355cf4,_0x265159){return function(_0xf6b18b){_0x265159['emit'](_0x355cf4,_0xf6b18b);};}function removeListener(_0x12bac2,_0x54b657){return function(){UserNotificationEvents[_0xa7c3('0x3')](_0x12bac2,_0x54b657);};}exports[_0xa7c3('0x4')]=function(_0x401f3a){for(var _0x2c6bf9=0x0,_0x35d65e=events['length'];_0x2c6bf9<_0x35d65e;_0x2c6bf9++){var _0x109cbe=events[_0x2c6bf9];var _0x16edd=createListener(_0xa7c3('0x5')+_0x109cbe,_0x401f3a);UserNotificationEvents['on'](_0x109cbe,_0x16edd);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index baa6707..ffc621d 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(_0x47e5f3,_0x164472){var _0x5d07e3=function(_0x373821){while(--_0x373821){_0x47e5f3['push'](_0x47e5f3['shift']());}};_0x5d07e3(++_0x164472);}(_0xedd9,0xfc));var _0x9edd=function(_0x162c30,_0x39448c){_0x162c30=_0x162c30-0x0;var _0x274e63=_0xedd9[_0x162c30];return _0x274e63;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x323b24,_0x4da787){var _0x223158=function(_0x10ca1d){while(--_0x10ca1d){_0x323b24['push'](_0x323b24['shift']());}};_0x223158(++_0x4da787);}(_0x70e0,0x17b));var _0x070e=function(_0x4afb39,_0x482d57){_0x4afb39=_0x4afb39-0x0;var _0x41c2de=_0x70e0[_0x4afb39];return _0x41c2de;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 84e3c88..9f370d6 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 _0xc884=['sequelize','INTEGER'];(function(_0x53e973,_0x20c33b){var _0x18458f=function(_0x4c6b05){while(--_0x4c6b05){_0x53e973['push'](_0x53e973['shift']());}};_0x18458f(++_0x20c33b);}(_0xc884,0x130));var _0x4c88=function(_0x3ef854,_0x1ac8d5){_0x3ef854=_0x3ef854-0x0;var _0x36d0ed=_0xc884[_0x3ef854];return _0x36d0ed;};'use strict';var Sequelize=require(_0x4c88('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4c88('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc777=['exports','sequelize'];(function(_0x39dc8d,_0x23f653){var _0x5894b8=function(_0x51acfc){while(--_0x51acfc){_0x39dc8d['push'](_0x39dc8d['shift']());}};_0x5894b8(++_0x23f653);}(_0xc777,0x1b7));var _0x7c77=function(_0x22422c,_0x8af9ea){_0x22422c=_0x22422c-0x0;var _0x53ed06=_0xc777[_0x22422c];return _0x53ed06;};'use strict';var Sequelize=require(_0x7c77('0x0'));module[_0x7c77('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 627d8c4..b31654c 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 _0xdcb0=['moment','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api'];(function(_0x54861c,_0x8756fc){var _0x4786d6=function(_0x2c151b){while(--_0x2c151b){_0x54861c['push'](_0x54861c['shift']());}};_0x4786d6(++_0x8756fc);}(_0xdcb0,0x19d));var _0x0dcb=function(_0x241cf4,_0x3c2f10){_0x241cf4=_0x241cf4-0x0;var _0x1a8b6d=_0xdcb0[_0x241cf4];return _0x1a8b6d;};'use strict';var _=require('lodash');var util=require(_0x0dcb('0x0'));var logger=require(_0x0dcb('0x1'))(_0x0dcb('0x2'));var moment=require(_0x0dcb('0x3'));var BPromise=require('bluebird');var rp=require(_0x0dcb('0x4'));var fs=require('fs');var path=require(_0x0dcb('0x5'));var rimraf=require(_0x0dcb('0x6'));var config=require(_0x0dcb('0x7'));var attributes=require(_0x0dcb('0x8'));module[_0x0dcb('0x9')]=function(_0x576c73,_0x29d957){return _0x576c73[_0x0dcb('0xa')](_0x0dcb('0xb'),attributes,{'tableName':_0x0dcb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20e6=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x16c974,_0x3186f6){var _0x53bc4b=function(_0x1c2ebc){while(--_0x1c2ebc){_0x16c974['push'](_0x16c974['shift']());}};_0x53bc4b(++_0x3186f6);}(_0x20e6,0x19e));var _0x620e=function(_0xc77296,_0x1de8ef){_0xc77296=_0xc77296-0x0;var _0x514f79=_0x20e6[_0xc77296];return _0x514f79;};'use strict';var _=require(_0x620e('0x0'));var util=require(_0x620e('0x1'));var logger=require(_0x620e('0x2'))(_0x620e('0x3'));var moment=require(_0x620e('0x4'));var BPromise=require('bluebird');var rp=require(_0x620e('0x5'));var fs=require('fs');var path=require(_0x620e('0x6'));var rimraf=require(_0x620e('0x7'));var config=require(_0x620e('0x8'));var attributes=require(_0x620e('0x9'));module[_0x620e('0xa')]=function(_0x37cbc3,_0x5383ed){return _0x37cbc3[_0x620e('0xb')](_0x620e('0xc'),attributes,{'tableName':_0x620e('0xd'),'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 1a0e826..44072db 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 _0x8b3a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment'];(function(_0x5f002d,_0x1b9dc8){var _0x544598=function(_0x929264){while(--_0x929264){_0x5f002d['push'](_0x5f002d['shift']());}};_0x544598(++_0x1b9dc8);}(_0x8b3a,0x1b2));var _0xa8b3=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0x8b3a[_0xef4ef0];return _0x39b60b;};'use strict';var _=require(_0xa8b3('0x0'));var util=require(_0xa8b3('0x1'));var moment=require(_0xa8b3('0x2'));var BPromise=require(_0xa8b3('0x3'));var rs=require(_0xa8b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8b3('0x5'))['db'];var utils=require(_0xa8b3('0x6'));var logger=require(_0xa8b3('0x7'))(_0xa8b3('0x8'));var config=require(_0xa8b3('0x9'));var jayson=require(_0xa8b3('0xa'));var client=jayson['client'][_0xa8b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20eebe,_0x442d70,_0x40b790){return new BPromise(function(_0x274fe5,_0x241146){return client[_0xa8b3('0xc')](_0x20eebe,_0x40b790)[_0xa8b3('0xd')](function(_0x2192de){logger[_0xa8b3('0xe')](_0xa8b3('0xf'),_0x442d70,'request\x20sent');logger[_0xa8b3('0x10')](_0xa8b3('0x11'),_0x442d70,_0xa8b3('0x12'),JSON[_0xa8b3('0x13')](_0x2192de));if(_0x2192de[_0xa8b3('0x14')]){if(_0x2192de[_0xa8b3('0x14')]['code']===0x1f4){logger[_0xa8b3('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x442d70,_0x2192de[_0xa8b3('0x14')]['message']);return _0x241146(_0x2192de[_0xa8b3('0x14')][_0xa8b3('0x15')]);}logger[_0xa8b3('0x14')](_0xa8b3('0xf'),_0x442d70,_0x2192de[_0xa8b3('0x14')][_0xa8b3('0x15')]);return _0x274fe5(_0x2192de['error'][_0xa8b3('0x15')]);}else{logger['info'](_0xa8b3('0xf'),_0x442d70,_0xa8b3('0x12'));_0x274fe5(_0x2192de['result']['message']);}})[_0xa8b3('0x16')](function(_0x37f909){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x442d70,_0x37f909);_0x241146(_0x37f909);});});} \ No newline at end of file +var _0x27ee=['message','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x225ad1,_0x45414f){var _0x5c2e6f=function(_0x4e443f){while(--_0x4e443f){_0x225ad1['push'](_0x225ad1['shift']());}};_0x5c2e6f(++_0x45414f);}(_0x27ee,0x16c));var _0xe27e=function(_0x2f69f7,_0x289493){_0x2f69f7=_0x2f69f7-0x0;var _0x2f925b=_0x27ee[_0x2f69f7];return _0x2f925b;};'use strict';var _=require(_0xe27e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe27e('0x1'));var rs=require(_0xe27e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe27e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe27e('0x4'));var config=require(_0xe27e('0x5'));var jayson=require(_0xe27e('0x6'));var client=jayson[_0xe27e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c20a9,_0x5d06bd,_0x354bff){return new BPromise(function(_0x13eec0,_0x1a06c3){return client['request'](_0x1c20a9,_0x354bff)[_0xe27e('0x8')](function(_0x2e6503){logger[_0xe27e('0x9')](_0xe27e('0xa'),_0x5d06bd,'request\x20sent');logger[_0xe27e('0xb')](_0xe27e('0xc'),_0x5d06bd,'request\x20sent',JSON[_0xe27e('0xd')](_0x2e6503));if(_0x2e6503['error']){if(_0x2e6503['error'][_0xe27e('0xe')]===0x1f4){logger[_0xe27e('0xf')](_0xe27e('0xa'),_0x5d06bd,_0x2e6503[_0xe27e('0xf')][_0xe27e('0x10')]);return _0x1a06c3(_0x2e6503['error'][_0xe27e('0x10')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x5d06bd,_0x2e6503[_0xe27e('0xf')]['message']);return _0x13eec0(_0x2e6503[_0xe27e('0xf')][_0xe27e('0x10')]);}else{logger[_0xe27e('0x9')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5d06bd,_0xe27e('0x11'));_0x13eec0(_0x2e6503[_0xe27e('0x12')][_0xe27e('0x10')]);}})[_0xe27e('0x13')](function(_0x320293){logger[_0xe27e('0xf')](_0xe27e('0xa'),_0x5d06bd,_0x320293);_0x1a06c3(_0x320293);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 9ca090a..d812fdb 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 _0x29f7=['../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/resources','create','post','/:id/clone','/:id/sections','addSections','addResources','put','update','delete','removeSections','removeResources','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x30e02c,_0x10fc99){var _0x4bdfcd=function(_0x58ae43){while(--_0x58ae43){_0x30e02c['push'](_0x30e02c['shift']());}};_0x4bdfcd(++_0x10fc99);}(_0x29f7,0xca));var _0x729f=function(_0x1dd897,_0x52f40c){_0x1dd897=_0x1dd897-0x0;var _0x4cd22d=_0x29f7[_0x1dd897];return _0x4cd22d;};'use strict';var multer=require(_0x729f('0x0'));var util=require(_0x729f('0x1'));var path=require(_0x729f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x729f('0x3'));var auth=require(_0x729f('0x4'));var interaction=require(_0x729f('0x5'));var config=require(_0x729f('0x6'));var controller=require(_0x729f('0x7'));router[_0x729f('0x8')]('/',auth[_0x729f('0x9')](),controller[_0x729f('0xa')]);router[_0x729f('0x8')](_0x729f('0xb'),auth[_0x729f('0x9')](),controller[_0x729f('0xc')]);router[_0x729f('0x8')](_0x729f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x729f('0x8')]('/:id/sections',auth['isAuthenticated'](),controller['getSections']);router[_0x729f('0x8')](_0x729f('0xe'),auth[_0x729f('0x9')](),controller['getResources']);router['post']('/',auth[_0x729f('0x9')](),controller[_0x729f('0xf')]);router[_0x729f('0x10')](_0x729f('0x11'),auth[_0x729f('0x9')](),controller['clone']);router[_0x729f('0x10')](_0x729f('0x12'),auth[_0x729f('0x9')](),controller[_0x729f('0x13')]);router[_0x729f('0x10')](_0x729f('0xe'),auth[_0x729f('0x9')](),controller[_0x729f('0x14')]);router[_0x729f('0x15')](_0x729f('0xd'),auth[_0x729f('0x9')](),controller[_0x729f('0x16')]);router[_0x729f('0x17')](_0x729f('0xd'),auth[_0x729f('0x9')](),controller['destroy']);router[_0x729f('0x17')](_0x729f('0x12'),auth['isAuthenticated'](),controller[_0x729f('0x18')]);router[_0x729f('0x17')](_0x729f('0xe'),auth['isAuthenticated'](),controller[_0x729f('0x19')]);module['exports']=router; \ No newline at end of file +var _0xca26=['describe','show','getSections','getResources','create','post','/:id/clone','/:id/sections','addSections','addResources','/:id','update','destroy','delete','/:id/resources','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated'];(function(_0x57666e,_0x221937){var _0x5cafe4=function(_0x5ccdc6){while(--_0x5ccdc6){_0x57666e['push'](_0x57666e['shift']());}};_0x5cafe4(++_0x221937);}(_0xca26,0x1bf));var _0x6ca2=function(_0x2bc8bf,_0x361d1c){_0x2bc8bf=_0x2bc8bf-0x0;var _0x398393=_0xca26[_0x2bc8bf];return _0x398393;};'use strict';var multer=require(_0x6ca2('0x0'));var util=require(_0x6ca2('0x1'));var path=require(_0x6ca2('0x2'));var timeout=require(_0x6ca2('0x3'));var express=require('express');var router=express[_0x6ca2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca2('0x6'));var controller=require(_0x6ca2('0x7'));router[_0x6ca2('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ca2('0x9')]);router[_0x6ca2('0x8')](_0x6ca2('0xa'),auth[_0x6ca2('0xb')](),controller[_0x6ca2('0xc')]);router[_0x6ca2('0x8')]('/:id',auth[_0x6ca2('0xb')](),controller[_0x6ca2('0xd')]);router['get']('/:id/sections',auth[_0x6ca2('0xb')](),controller[_0x6ca2('0xe')]);router['get']('/:id/resources',auth[_0x6ca2('0xb')](),controller[_0x6ca2('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6ca2('0x10')]);router[_0x6ca2('0x11')](_0x6ca2('0x12'),auth[_0x6ca2('0xb')](),controller['clone']);router['post'](_0x6ca2('0x13'),auth[_0x6ca2('0xb')](),controller[_0x6ca2('0x14')]);router[_0x6ca2('0x11')]('/:id/resources',auth['isAuthenticated'](),controller[_0x6ca2('0x15')]);router['put'](_0x6ca2('0x16'),auth[_0x6ca2('0xb')](),controller[_0x6ca2('0x17')]);router['delete'](_0x6ca2('0x16'),auth[_0x6ca2('0xb')](),controller[_0x6ca2('0x18')]);router[_0x6ca2('0x19')](_0x6ca2('0x13'),auth[_0x6ca2('0xb')](),controller['removeSections']);router[_0x6ca2('0x19')](_0x6ca2('0x1a'),auth[_0x6ca2('0xb')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index aa43b46..9fd4ce4 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 _0x6ecb=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions','join'];(function(_0x1b0b9c,_0x202b29){var _0x11adcf=function(_0x391b41){while(--_0x391b41){_0x1b0b9c['push'](_0x1b0b9c['shift']());}};_0x11adcf(++_0x202b29);}(_0x6ecb,0x12c));var _0xb6ec=function(_0x5f4a33,_0x5a9b58){_0x5f4a33=_0x5f4a33-0x0;var _0x3f19b6=_0x6ecb[_0x5f4a33];return _0x3f19b6;};'use strict';var Sequelize=require(_0xb6ec('0x0'));module[_0xb6ec('0x1')]={'name':{'type':Sequelize[_0xb6ec('0x2')],'allowNull':![],'unique':_0xb6ec('0x3')},'crudPermissions':{'type':Sequelize[_0xb6ec('0x2')],'set':function(_0x53520e){this['setDataValue'](_0xb6ec('0x4'),_0x53520e?_0x53520e[_0xb6ec('0x5')](''):[]);},'get':function(){return this[_0xb6ec('0x6')](_0xb6ec('0x4'))?this[_0xb6ec('0x6')](_0xb6ec('0x4'))[_0xb6ec('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb6ec('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xb6ec('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xb6ec('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb6ec('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb6ec('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb6ec('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xc56e=['setDataValue','join','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x482686,_0xc895d8){var _0x1334fc=function(_0x43ffaa){while(--_0x43ffaa){_0x482686['push'](_0x482686['shift']());}};_0x1334fc(++_0xc895d8);}(_0xc56e,0x7a));var _0xec56=function(_0xd95f4a,_0x3c9c5b){_0xd95f4a=_0xd95f4a-0x0;var _0x2dce62=_0xc56e[_0xd95f4a];return _0x2dce62;};'use strict';var Sequelize=require(_0xec56('0x0'));module[_0xec56('0x1')]={'name':{'type':Sequelize[_0xec56('0x2')],'allowNull':![],'unique':_0xec56('0x3')},'crudPermissions':{'type':Sequelize[_0xec56('0x2')],'set':function(_0x54ab03){this[_0xec56('0x4')]('crudPermissions',_0x54ab03?_0x54ab03[_0xec56('0x5')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xec56('0x6'))[_0xec56('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xec56('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xec56('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xec56('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xec56('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xec56('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xec56('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xec56('0x8')],'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 7f17480..7189799 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 _0xe2cf=['to-csv','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','register','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','show','params','keys','catch','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','UserProfileSection','each','autoAssociation','sectionId','Resources','UserProfileResource','describe','addSections','transaction','userProfileId','push','getSections','enabled','isEmpty','includes','subsections','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox'];(function(_0x3f9d05,_0x4706b4){var _0x1c3f12=function(_0x273e34){while(--_0x273e34){_0x3f9d05['push'](_0x3f9d05['shift']());}};_0x1c3f12(++_0x4706b4);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x3ecf3f,_0x1709c9){_0x3ecf3f=_0x3ecf3f-0x0;var _0x1c6c85=_0xe2cf[_0x3ecf3f];return _0x1c6c85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe2c('0x1'));var rp=require('request-promise');var moment=require(_0xfe2c('0x2'));var BPromise=require(_0xfe2c('0x3'));var Mustache=require(_0xfe2c('0x4'));var util=require(_0xfe2c('0x5'));var path=require('path');var sox=require(_0xfe2c('0x6'));var csv=require(_0xfe2c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe2c('0x8'));var squel=require(_0xfe2c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe2c('0xa'));var toCsv=require(_0xfe2c('0x7'));var querystring=require(_0xfe2c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe2c('0xc'));var qs=require(_0xfe2c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe2c('0xe'));var logger=require(_0xfe2c('0xf'))(_0xfe2c('0x10'));var utils=require(_0xfe2c('0x11'));var config=require(_0xfe2c('0x12'));var licenseUtil=require(_0xfe2c('0x13'));var db=require(_0xfe2c('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe2c('0x15'))(new Redis(config['redis']));require('./userProfile.socket')[_0xfe2c('0x16')](socket);function respondWithStatusCode(_0x4d0a10,_0x2aa7df){_0x2aa7df=_0x2aa7df||0xcc;return function(_0x12e4c4){if(_0x12e4c4){return _0x4d0a10['sendStatus'](_0x2aa7df);}return _0x4d0a10['status'](_0x2aa7df)[_0xfe2c('0x17')]();};}function respondWithResult(_0x3b3ebd,_0x1dbed4){_0x1dbed4=_0x1dbed4||0xc8;return function(_0x56cebc){if(_0x56cebc){return _0x3b3ebd['status'](_0x1dbed4)[_0xfe2c('0x18')](_0x56cebc);}};}function respondWithFilteredResult(_0x96a3a3,_0x135436){return function(_0x23242b){if(_0x23242b){var _0x36aeec=typeof _0x135436[_0xfe2c('0x19')]==='undefined'&&typeof _0x135436[_0xfe2c('0x1a')]===_0xfe2c('0x1b');var _0x1d7852=_0x23242b[_0xfe2c('0x1c')];var _0x55f751=_0x36aeec?0x0:_0x135436[_0xfe2c('0x19')];var _0x59bdeb=_0x36aeec?_0x23242b['count']:_0x135436[_0xfe2c('0x19')]+_0x135436[_0xfe2c('0x1a')];var _0x4bf7c0;if(_0x59bdeb>=_0x1d7852){_0x59bdeb=_0x1d7852;_0x4bf7c0=0xc8;}else{_0x4bf7c0=0xce;}_0x96a3a3[_0xfe2c('0x1d')](_0x4bf7c0);return _0x96a3a3[_0xfe2c('0x1e')]('Content-Range',_0x55f751+'-'+_0x59bdeb+'/'+_0x1d7852)[_0xfe2c('0x18')](_0x23242b);}return null;};}function patchUpdates(_0x5dd54b){return function(_0x4481ff){try{jsonpatch[_0xfe2c('0x1f')](_0x4481ff,_0x5dd54b,!![]);}catch(_0x8b5c0d){return BPromise[_0xfe2c('0x20')](_0x8b5c0d);}return _0x4481ff[_0xfe2c('0x21')]();};}function saveUpdates(_0x2ee3b3,_0x57cd6d){return function(_0x41a545){if(_0x41a545){return _0x41a545[_0xfe2c('0x22')](_0x2ee3b3)[_0xfe2c('0x23')](function(_0x26448c){return _0x26448c;});}return null;};}function removeEntity(_0x3486b5,_0x10afde){return function(_0x53bab0){if(_0x53bab0){return _0x53bab0[_0xfe2c('0x24')]()['then'](function(){_0x3486b5[_0xfe2c('0x1d')](0xcc)[_0xfe2c('0x17')]();});}};}function handleEntityNotFound(_0x1c35d3,_0x54e356){return function(_0x377cc5){if(!_0x377cc5){_0x1c35d3[_0xfe2c('0x25')](0x194);}return _0x377cc5;};}function handleError(_0x59094a,_0x3d7e1f){_0x3d7e1f=_0x3d7e1f||0x1f4;return function(_0x1b6eb7){logger[_0xfe2c('0x26')](_0x1b6eb7[_0xfe2c('0x27')]);if(_0x1b6eb7[_0xfe2c('0x28')]){delete _0x1b6eb7[_0xfe2c('0x28')];}_0x59094a['status'](_0x3d7e1f)['send'](_0x1b6eb7);};}exports[_0xfe2c('0x29')]=function(_0x13e9a9,_0x1a5e15){var _0xe940fe={},_0xf4495b={},_0x4bd059={'count':0x0,'rows':[]};var _0x1f8ea7=_[_0xfe2c('0x2a')](db[_0xfe2c('0x2b')][_0xfe2c('0x2c')],function(_0x2843a5){return{'name':_0x2843a5[_0xfe2c('0x2d')],'type':_0x2843a5[_0xfe2c('0x2e')][_0xfe2c('0x2f')]};});_0xf4495b[_0xfe2c('0x30')]=_[_0xfe2c('0x2a')](_0x1f8ea7,_0xfe2c('0x28'));_0xf4495b[_0xfe2c('0x31')]=_['keys'](_0x13e9a9[_0xfe2c('0x31')]);_0xf4495b[_0xfe2c('0x32')]=_[_0xfe2c('0x33')](_0xf4495b['model'],_0xf4495b[_0xfe2c('0x31')]);_0xe940fe[_0xfe2c('0x34')]=_['intersection'](_0xf4495b[_0xfe2c('0x30')],qs[_0xfe2c('0x35')](_0x13e9a9[_0xfe2c('0x31')]['fields']));_0xe940fe[_0xfe2c('0x34')]=_0xe940fe[_0xfe2c('0x34')][_0xfe2c('0x36')]?_0xe940fe[_0xfe2c('0x34')]:_0xf4495b[_0xfe2c('0x30')];if(!_0x13e9a9[_0xfe2c('0x31')][_0xfe2c('0x37')]('nolimit')){_0xe940fe['limit']=qs[_0xfe2c('0x1a')](_0x13e9a9[_0xfe2c('0x31')][_0xfe2c('0x1a')]);_0xe940fe[_0xfe2c('0x19')]=qs['offset'](_0x13e9a9[_0xfe2c('0x31')]['offset']);}_0xe940fe[_0xfe2c('0x38')]=qs[_0xfe2c('0x39')](_0x13e9a9['query'][_0xfe2c('0x39')]);_0xe940fe['where']=qs['filters'](_[_0xfe2c('0x3a')](_0x13e9a9[_0xfe2c('0x31')],_0xf4495b[_0xfe2c('0x32')]),_0x1f8ea7);if(_0x13e9a9[_0xfe2c('0x31')][_0xfe2c('0x3b')]){_0xe940fe[_0xfe2c('0x3c')]=_[_0xfe2c('0x3d')](_0xe940fe[_0xfe2c('0x3c')],{'$or':_[_0xfe2c('0x2a')](_0x1f8ea7,function(_0x46cc5f){if(_0x46cc5f[_0xfe2c('0x2e')]!=='VIRTUAL'){var _0x39e1a0={};_0x39e1a0[_0x46cc5f[_0xfe2c('0x28')]]={'$like':'%'+_0x13e9a9[_0xfe2c('0x31')]['filter']+'%'};return _0x39e1a0;}})});}_0xe940fe=_['merge']({},_0xe940fe,_0x13e9a9['options']);var _0xc97c16={'where':_0xe940fe[_0xfe2c('0x3c')]};return db[_0xfe2c('0x2b')][_0xfe2c('0x1c')](_0xc97c16)['then'](function(_0x1ed30b){_0x4bd059[_0xfe2c('0x1c')]=_0x1ed30b;if(_0x13e9a9[_0xfe2c('0x31')][_0xfe2c('0x3e')]){_0xe940fe[_0xfe2c('0x3f')]=[{'all':!![]}];}return db['UserProfile'][_0xfe2c('0x40')](_0xe940fe);})[_0xfe2c('0x23')](function(_0x6055dd){_0x4bd059[_0xfe2c('0x41')]=_0x6055dd;return _0x4bd059;})['then'](respondWithFilteredResult(_0x1a5e15,_0xe940fe))['catch'](handleError(_0x1a5e15,null));};exports[_0xfe2c('0x42')]=function(_0x1f64cc,_0x4c9aaa){var _0x3c2004={'raw':![],'where':{'id':_0x1f64cc[_0xfe2c('0x43')]['id']}},_0x27862d={};_0x27862d[_0xfe2c('0x30')]=_['keys'](db[_0xfe2c('0x2b')][_0xfe2c('0x2c')]);_0x27862d[_0xfe2c('0x31')]=_[_0xfe2c('0x44')](_0x1f64cc[_0xfe2c('0x31')]);_0x27862d[_0xfe2c('0x32')]=_[_0xfe2c('0x33')](_0x27862d[_0xfe2c('0x30')],_0x27862d['query']);_0x3c2004[_0xfe2c('0x34')]=_['intersection'](_0x27862d[_0xfe2c('0x30')],qs[_0xfe2c('0x35')](_0x1f64cc[_0xfe2c('0x31')][_0xfe2c('0x35')]));_0x3c2004['attributes']=_0x3c2004['attributes']['length']?_0x3c2004['attributes']:_0x27862d['model'];if(_0x1f64cc[_0xfe2c('0x31')]['includeAll']){_0x3c2004['include']=[{'all':!![]}];}_0x3c2004=_[_0xfe2c('0x3d')]({},_0x3c2004,_0x1f64cc['options']);return db[_0xfe2c('0x2b')]['find'](_0x3c2004)[_0xfe2c('0x23')](handleEntityNotFound(_0x4c9aaa,null))[_0xfe2c('0x23')](respondWithResult(_0x4c9aaa,null))[_0xfe2c('0x45')](handleError(_0x4c9aaa,null));};exports[_0xfe2c('0x46')]=function(_0x3cfda2,_0x57ad76){return db[_0xfe2c('0x2b')][_0xfe2c('0x46')](_0x3cfda2[_0xfe2c('0x47')],{})['then'](respondWithResult(_0x57ad76,0xc9))[_0xfe2c('0x45')](handleError(_0x57ad76,null));};exports[_0xfe2c('0x48')]=function(_0x579b6b,_0x56f716){var _0x5255db={'where':{'id':_0x579b6b[_0xfe2c('0x43')]['id']}},_0x3c3e58={};_0x3c3e58[_0xfe2c('0x30')]=_[_0xfe2c('0x44')](db[_0xfe2c('0x2b')]['rawAttributes']);_0x5255db[_0xfe2c('0x34')]=_[_0xfe2c('0x33')](_0x3c3e58[_0xfe2c('0x30')],qs['fields'](_0x579b6b['query'][_0xfe2c('0x35')]));_0x5255db[_0xfe2c('0x34')]=_0x5255db[_0xfe2c('0x34')][_0xfe2c('0x36')]?_0x5255db[_0xfe2c('0x34')]:_0x3c3e58[_0xfe2c('0x30')];if(_0x579b6b[_0xfe2c('0x31')][_0xfe2c('0x3e')]){_0x5255db[_0xfe2c('0x3f')]=[{'all':!![]}];}_0x5255db=_[_0xfe2c('0x3d')]({},_0x5255db,_0x579b6b['options']);return db[_0xfe2c('0x2b')][_0xfe2c('0x49')](_0x5255db)[_0xfe2c('0x23')](handleEntityNotFound(_0x56f716,null))[_0xfe2c('0x23')](function(_0x1ee7f1){if(_0x1ee7f1){var _0x32e987=_0x1ee7f1[_0xfe2c('0x4a')]({'plain':!![]});_0x32e987=qs[_0xfe2c('0x4b')](_0x32e987,['id',_0xfe2c('0x4c'),_0xfe2c('0x4d'),_0xfe2c('0x4e')]);_0x579b6b['body']=_[_0xfe2c('0x4b')](_0x579b6b['body'],['id',_0xfe2c('0x4c'),'updatedAt']);return db['sequelize']['transaction'](function(_0x13499b){return db['UserProfile'][_0xfe2c('0x46')](_['merge'](_0x32e987,_0x579b6b[_0xfe2c('0x47')]),{'include':_0x579b6b[_0xfe2c('0x31')][_0xfe2c('0x3e')]?[{'all':!![]}]:undefined,'transaction':_0x13499b})[_0xfe2c('0x23')](function(_0x1e03d0){var _0xf68850=_0x1e03d0[_0xfe2c('0x4a')]({'plain':!![]});return db[_0xfe2c('0x4f')][_0xfe2c('0x40')]({'where':{'userProfileId':_0x579b6b['params']['id']},'raw':!![]})[_0xfe2c('0x23')](function(_0x1b4ab9){if(_0x1b4ab9){return BPromise[_0xfe2c('0x50')](_0x1b4ab9,function(_0x385c21){return new BPromise(function(_0x366687,_0x5e6d96){if(_0x385c21[_0xfe2c('0x51')]===null||_0x385c21[_0xfe2c('0x51')]===0x1)_0x366687(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x385c21['id']},'raw':!![]})[_0xfe2c('0x23')](function(_0x20514f){var _0xa22dca=_[_0xfe2c('0x2a')](_0x20514f,function(_0x16be1b){return qs[_0xfe2c('0x4b')](_0x16be1b,['id',_0xfe2c('0x4c'),'updatedAt',_0xfe2c('0x52')]);});_0x366687(_0xa22dca);})[_0xfe2c('0x45')](function(_0x4679){_0x5e6d96(_0x4679);});})[_0xfe2c('0x23')](function(_0x1e010e){var _0x320842=qs[_0xfe2c('0x4b')](_0x385c21,['id','createdAt',_0xfe2c('0x4d')]);_0x320842['userProfileId']=_0xf68850['id'];if(_0x1e010e)_0x320842[_0xfe2c('0x53')]=_0x1e010e;return _0x320842;})[_0xfe2c('0x23')](function(_0x4cede1){return db[_0xfe2c('0x4f')]['create'](_0x4cede1,{'include':[{'model':db[_0xfe2c('0x54')],'as':_0xfe2c('0x53')}],'raw':!![],'transaction':_0x13499b});});})['then'](function(){return _0xf68850;});}});});});}})[_0xfe2c('0x23')](respondWithResult(_0x56f716,0xc9))['catch'](handleError(_0x56f716,null));};exports[_0xfe2c('0x22')]=function(_0x5231ae,_0x23827b){if(_0x5231ae[_0xfe2c('0x47')]['id']){delete _0x5231ae['body']['id'];}return db[_0xfe2c('0x2b')][_0xfe2c('0x49')]({'where':{'id':_0x5231ae[_0xfe2c('0x43')]['id']}})[_0xfe2c('0x23')](handleEntityNotFound(_0x23827b,null))[_0xfe2c('0x23')](saveUpdates(_0x5231ae['body'],null))[_0xfe2c('0x23')](respondWithResult(_0x23827b,null))[_0xfe2c('0x45')](handleError(_0x23827b,null));};exports[_0xfe2c('0x24')]=function(_0x264af9,_0x516237){return db[_0xfe2c('0x2b')]['find']({'where':{'id':_0x264af9[_0xfe2c('0x43')]['id']}})['then'](handleEntityNotFound(_0x516237,null))[_0xfe2c('0x23')](removeEntity(_0x516237,null))[_0xfe2c('0x45')](handleError(_0x516237,null));};exports[_0xfe2c('0x55')]=function(_0x281213,_0x2733a7){return db[_0xfe2c('0x2b')][_0xfe2c('0x55')]()[_0xfe2c('0x23')](respondWithResult(_0x2733a7,null))[_0xfe2c('0x45')](handleError(_0x2733a7,null));};exports[_0xfe2c('0x56')]=function(_0x3da347,_0x2fcb15){var _0x2b855e=_0x3da347[_0xfe2c('0x47')];return db[_0xfe2c('0x2b')][_0xfe2c('0x49')]({'where':{'id':_0x3da347['params']['id']}})[_0xfe2c('0x23')](handleEntityNotFound(_0x2fcb15,null))['then'](function(_0xdafb46){if(_0xdafb46){return db['sequelize'][_0xfe2c('0x57')](function(_0x500e9a){return db['UserProfileSection'][_0xfe2c('0x24')]({'where':{'userProfileId':_0x3da347[_0xfe2c('0x43')]['id'],'sectionId':_[_0xfe2c('0x2a')](_0x2b855e,function(_0x40124f){return _0x40124f[_0xfe2c('0x52')];})},'transaction':_0x500e9a})['then'](function(){var _0x313d80=_[_0xfe2c('0x2a')](_0x2b855e,function(_0x4e973f){_0x4e973f[_0xfe2c('0x58')]=_0x3da347[_0xfe2c('0x43')]['id'];return _0x4e973f;});var _0x517401=[];return BPromise['each'](_0x313d80,function(_0x58165d){return db[_0xfe2c('0x4f')][_0xfe2c('0x46')](_0x58165d,{'include':[{'model':db[_0xfe2c('0x54')],'as':'Resources'}],'raw':!![],'transaction':_0x500e9a})['then'](function(_0x3ec7be){_0x517401[_0xfe2c('0x59')](_0x3ec7be['get']({'plain':!![]}));});})[_0xfe2c('0x23')](function(){return _0x517401;});});});}})[_0xfe2c('0x23')](function(_0x5ac774){return _0x5ac774;})[_0xfe2c('0x23')](respondWithResult(_0x2fcb15,null))['catch'](handleError(_0x2fcb15,null));};exports['removeSections']=function(_0x43504d,_0x414b87){var _0x4a233d;return db[_0xfe2c('0x2b')][_0xfe2c('0x49')]({'where':{'id':_0x43504d['params']['id']},'attributes':['id',_0xfe2c('0x28')]})['then'](handleEntityNotFound(_0x414b87,null))['then'](function(_0x1f5190){if(_0x1f5190){_0x4a233d=_0x1f5190;return db[_0xfe2c('0x4f')]['destroy']({'where':{'userProfileId':_0x43504d[_0xfe2c('0x43')]['id'],'sectionId':_0x43504d[_0xfe2c('0x31')]['ids']}});}})[_0xfe2c('0x23')](function(){return _0x4a233d;})['then'](respondWithStatusCode(_0x414b87,null))[_0xfe2c('0x45')](handleError(_0x414b87,null));};exports[_0xfe2c('0x5a')]=function(_0x20f799,_0x45a272){var _0x57bfe3=[];var _0x10e0a0=[];return db[_0xfe2c('0x4f')]['findAll']({'where':{'userProfileId':_0x20f799[_0xfe2c('0x43')]['id']},'raw':!![]})['then'](function(_0x373006){_0x57bfe3=_['filter'](_0x373006,function(_0x16529c){return _0x16529c[_0xfe2c('0x5b')]===0x1||_['includes']([0x3eb,0x709],_0x16529c[_0xfe2c('0x52')]);});if(!_[_0xfe2c('0x5c')](_0x57bfe3)){return _[_0xfe2c('0x2a')](_0x57bfe3,function(_0x21ea78){return _0x21ea78[_0xfe2c('0x52')];});}else{return;}})[_0xfe2c('0x23')](function(_0x52627b){if(_0x52627b)_0x10e0a0=_0x52627b;if(_[_0xfe2c('0x5d')](_0x10e0a0,0x64)){var _0x524fac=_['find'](_0x57bfe3,{'sectionId':0x64});return hasDefaultDashboard(_0x524fac)[_0xfe2c('0x23')](function(_0xa260cf){return _[_0xfe2c('0x2a')](_0x57bfe3,function(_0xb2ad67){if(_0xb2ad67[_0xfe2c('0x52')]===0x64){_0xb2ad67[_0xfe2c('0x5e')]=_0xa260cf;}return _0xb2ad67;});});}else{return;}})['then'](function(_0x890225){if(_0x890225)_0x57bfe3=_0x890225;if(_[_0xfe2c('0x5d')](_0x10e0a0,0x3eb)){var _0x1a4f1c=_[_0xfe2c('0x49')](_0x57bfe3,{'sectionId':0x3eb});return getCustomDashboards(_0x1a4f1c)['then'](function(_0x376de3){return _[_0xfe2c('0x2a')](_0x57bfe3,function(_0x392232){if(_0x1a4f1c[_0xfe2c('0x5b')]){if(_0x392232['sectionId']===0x3eb){_0x392232[_0xfe2c('0x5e')]=_0x376de3;}}else{if(_0x392232['sectionId']===0x64){_0x392232['subsections']=_0x376de3;}}return _0x392232;});});}else{return;}})['then'](function(_0x447feb){if(_0x447feb)_0x57bfe3=_0x447feb;if(_[_0xfe2c('0x5d')](_0x10e0a0,0x709)){var _0x3d4c3e=_[_0xfe2c('0x49')](_0x57bfe3,{'sectionId':0x709});return getPlugins(_0x3d4c3e)[_0xfe2c('0x23')](function(_0x37d2b0){if(_0x3d4c3e[_0xfe2c('0x5b')]){return _[_0xfe2c('0x2a')](_0x57bfe3,function(_0x3a4409){if(_0x3a4409['sectionId']===0x709){_0x3a4409['subsections']=_0x37d2b0;}return _0x3a4409;});}else{var _0x1552fb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x37d2b0};var _0x156d2d=_[_0xfe2c('0x2a')](_0x57bfe3);_0x156d2d[_0xfe2c('0x59')](_0x1552fb);return _0x156d2d;}});}else{return;}})[_0xfe2c('0x23')](function(_0x206d24){if(_0x206d24)_0x57bfe3=_0x206d24;return _['filter'](_0x57bfe3,[_0xfe2c('0x5b'),0x1]);})[_0xfe2c('0x23')](respondWithResult(_0x45a272,null))[_0xfe2c('0x45')](handleError(_0x45a272,null));};function hasDefaultDashboard(_0x40465e){var _0x2549fc=[0x65];return new BPromise(function(_0x20ea78,_0x21cdf3){try{if(_0x40465e[_0xfe2c('0x51')]){_0x20ea78(_0x2549fc);}else{return db[_0xfe2c('0x54')]['findOne']({'where':{'sectionId':_0x40465e['id']},'raw':!![]})[_0xfe2c('0x23')](function(_0x245bc1){_0x245bc1?_0x20ea78(_0x2549fc):_0x20ea78();});}}catch(_0x49863d){_0x21cdf3(_0x49863d);}});}function getCustomDashboards(_0xaedb60){var _0x5ededc=[];return new BPromise(function(_0x78a54c,_0x575784){try{if(_0xaedb60[_0xfe2c('0x51')]){return db[_0xfe2c('0x5f')][_0xfe2c('0x40')]({'raw':!![]})[_0xfe2c('0x23')](function(_0x57453e){_0x57453e['forEach'](function(_0x306cc4){_0x5ededc[_0xfe2c('0x59')](_0x306cc4['id']+0x1869f);});_0x78a54c(_0x5ededc);});}else{return db[_0xfe2c('0x54')]['findAll']({'where':{'sectionId':_0xaedb60['id']},'raw':!![]})[_0xfe2c('0x23')](function(_0x29e622){_0x29e622[_0xfe2c('0x60')](function(_0x5dd213){_0x5ededc[_0xfe2c('0x59')](_0x5dd213[_0xfe2c('0x61')]+0x1869f);});_0x78a54c(_0x5ededc);});}}catch(_0x1193c2){_0x575784(_0x1193c2);}});}function getPlugins(_0xc86d1b){var _0x12ee7d=[];return new BPromise(function(_0x2fa25c,_0x11493d){try{if(_0xc86d1b[_0xfe2c('0x51')]){return db[_0xfe2c('0x62')]['findAll']({'raw':!![]})[_0xfe2c('0x23')](function(_0x539cfa){_0x539cfa[_0xfe2c('0x60')](function(_0x3222da){_0x12ee7d[_0xfe2c('0x59')](_0x3222da['id']+0x15b38);});_0x2fa25c(_0x12ee7d);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0xc86d1b['id']},'raw':!![]})['then'](function(_0x313d48){_0x313d48[_0xfe2c('0x60')](function(_0x111bee){_0x12ee7d[_0xfe2c('0x59')](_0x111bee[_0xfe2c('0x61')]+0x15b38);});_0x2fa25c(_0x12ee7d);});}}catch(_0x27d025){_0x11493d(_0x27d025);}});}exports[_0xfe2c('0x63')]=function(_0x14ebf0,_0x20c22a){return db[_0xfe2c('0x2b')][_0xfe2c('0x49')]({'where':{'id':_0x14ebf0[_0xfe2c('0x43')]['id']}})[_0xfe2c('0x23')](handleEntityNotFound(_0x20c22a,null))['then'](function(_0x2c8880){if(_0x2c8880){return db['sequelize'][_0xfe2c('0x57')](function(_0x3f4bfd){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x14ebf0['params']['id']},'attributes':['id'],'raw':!![]})[_0xfe2c('0x23')](function(_0x38cfeb){if(_0x38cfeb){return db[_0xfe2c('0x4f')][_0xfe2c('0x24')]({'where':{'userProfileId':_0x14ebf0[_0xfe2c('0x43')]['id'],'id':_[_0xfe2c('0x2a')](_0x38cfeb,function(_0x4d9d8a){return _0x4d9d8a['id'];})},'transaction':_0x3f4bfd});}})['then'](function(_0x18639f){var _0x3c4ee8=_[_0xfe2c('0x2a')](_0x14ebf0['body'],function(_0x4104b3){_0x4104b3['userProfileId']=_0x14ebf0[_0xfe2c('0x43')]['id'];return _0x4104b3;});return db[_0xfe2c('0x4f')][_0xfe2c('0x64')](_0x3c4ee8,{'raw':!![],'transaction':_0x3f4bfd});})[_0xfe2c('0x23')](function(_0x5e3cc7){var _0x433fd2=_[_0xfe2c('0x3b')](_[_0xfe2c('0x2a')](_0x5e3cc7,function(_0x29b4f4){return _0x29b4f4[_0xfe2c('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x433fd2){return db['UserProfileSection'][_0xfe2c('0x40')]({'where':{'userProfileId':_0x14ebf0[_0xfe2c('0x43')]['id'],'sectionId':_['map'](_0x433fd2,function(_0xcf75b9){return _0xcf75b9[_0xfe2c('0x52')];})},'attributes':['id',_0xfe2c('0x52')],'raw':!![]})[_0xfe2c('0x23')](function(_0x3b3b5b){var _0x50f27e=_[_0xfe2c('0x2a')](_0x14ebf0[_0xfe2c('0x47')],function(_0x41ecea){_0x41ecea[_0xfe2c('0x58')]=_0x14ebf0[_0xfe2c('0x43')]['id'];return _0x41ecea;});return db[_0xfe2c('0x54')][_0xfe2c('0x64')](_0x50f27e,{'raw':!![],'transaction':_0x3f4bfd});});}})[_0xfe2c('0x45')](handleError(_0x20c22a,null));});}})['then'](function(_0x50976f){var _0xa20354=_[_0xfe2c('0x2a')](_0x50976f,function(_0x288669){return _0x288669[_0xfe2c('0x4a')]({'plain':!![]});});})[_0xfe2c('0x23')](respondWithResult(_0x20c22a,null))[_0xfe2c('0x45')](handleError(_0x20c22a,null));};exports['removeResources']=function(_0x51f905,_0x56479d,_0x2e2987){return db[_0xfe2c('0x2b')][_0xfe2c('0x49')]({'where':{'id':_0x51f905[_0xfe2c('0x43')]['id']}})[_0xfe2c('0x23')](handleEntityNotFound(_0x56479d,null))[_0xfe2c('0x23')](function(_0x3cd58f){if(_0x3cd58f){return _0x3cd58f[_0xfe2c('0x65')](_0x51f905[_0xfe2c('0x31')][_0xfe2c('0x66')]);}})['then'](respondWithStatusCode(_0x56479d,null))[_0xfe2c('0x45')](handleError(_0x56479d,null));};exports[_0xfe2c('0x67')]=function(_0x14631f,_0x5686e3){var _0x26946e={};if(!_0x14631f[_0xfe2c('0x31')][_0xfe2c('0x68')])throw new Error(_0xfe2c('0x69'));if(!_0x14631f[_0xfe2c('0x31')][_0xfe2c('0x37')]('nolimit')){_0x26946e['limit']=qs['limit'](_0x14631f[_0xfe2c('0x31')][_0xfe2c('0x1a')]);_0x26946e[_0xfe2c('0x19')]=qs[_0xfe2c('0x19')](_0x14631f[_0xfe2c('0x31')][_0xfe2c('0x19')]);}return db['UserProfile'][_0xfe2c('0x49')]({'where':{'id':_0x14631f['params']['id']}})[_0xfe2c('0x23')](function(_0x552cd3){if(!_0x552cd3)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x14631f[_0xfe2c('0x43')]['id']);return db[_0xfe2c('0x2b')][_0xfe2c('0x67')](_0x14631f);})['then'](respondWithFilteredResult(_0x5686e3,_0x26946e))[_0xfe2c('0x45')](handleError(_0x5686e3,null));}; \ No newline at end of file +var _0xfece=['../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','UserProfile','includeAll','include','rows','catch','show','params','fields','create','find','get','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','body','findAll','autoAssociation','userProfileId','UserProfileSection','UserProfileResource','Resources','describe','addSections','sectionId','push','ids','getSections','includes','isEmpty','subsections','enabled','filter','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','moment','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x50702f,_0x4f509a){var _0x38cc6a=function(_0x36e905){while(--_0x36e905){_0x50702f['push'](_0x50702f['shift']());}};_0x38cc6a(++_0x4f509a);}(_0xfece,0x19e));var _0xefec=function(_0x4ce712,_0x272d3a){_0x4ce712=_0x4ce712-0x0;var _0x1bf789=_0xfece[_0x4ce712];return _0x1bf789;};'use strict';var emlformat=require(_0xefec('0x0'));var rimraf=require(_0xefec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xefec('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xefec('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xefec('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xefec('0x5'));var squel=require(_0xefec('0x6'));var crypto=require(_0xefec('0x7'));var jsforce=require(_0xefec('0x8'));var deskjs=require(_0xefec('0x9'));var toCsv=require(_0xefec('0xa'));var querystring=require('querystring');var Papa=require(_0xefec('0xb'));var Redis=require(_0xefec('0xc'));var authService=require(_0xefec('0xd'));var qs=require(_0xefec('0xe'));var as=require(_0xefec('0xf'));var hardwareService=require(_0xefec('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xefec('0x11'));var config=require(_0xefec('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xefec('0x13'))['db'];config['redis']=_[_0xefec('0x14')](config[_0xefec('0x15')],{'host':_0xefec('0x16'),'port':0x18eb});var socket=require(_0xefec('0x17'))(new Redis(config[_0xefec('0x15')]));require('./userProfile.socket')[_0xefec('0x18')](socket);function respondWithStatusCode(_0xf3e25,_0x8024af){_0x8024af=_0x8024af||0xcc;return function(_0x165003){if(_0x165003){return _0xf3e25[_0xefec('0x19')](_0x8024af);}return _0xf3e25['status'](_0x8024af)[_0xefec('0x1a')]();};}function respondWithResult(_0x40397a,_0x16a657){_0x16a657=_0x16a657||0xc8;return function(_0x334441){if(_0x334441){return _0x40397a[_0xefec('0x1b')](_0x16a657)[_0xefec('0x1c')](_0x334441);}};}function respondWithFilteredResult(_0xbad60f,_0x25ade6){return function(_0x2bf27e){if(_0x2bf27e){var _0x5beee4=typeof _0x25ade6[_0xefec('0x1d')]===_0xefec('0x1e')&&typeof _0x25ade6[_0xefec('0x1f')]==='undefined';var _0x343b5b=_0x2bf27e['count'];var _0x21bd60=_0x5beee4?0x0:_0x25ade6[_0xefec('0x1d')];var _0x4aabb9=_0x5beee4?_0x2bf27e[_0xefec('0x20')]:_0x25ade6[_0xefec('0x1d')]+_0x25ade6[_0xefec('0x1f')];var _0x21ff56;if(_0x4aabb9>=_0x343b5b){_0x4aabb9=_0x343b5b;_0x21ff56=0xc8;}else{_0x21ff56=0xce;}_0xbad60f[_0xefec('0x1b')](_0x21ff56);return _0xbad60f['set']('Content-Range',_0x21bd60+'-'+_0x4aabb9+'/'+_0x343b5b)[_0xefec('0x1c')](_0x2bf27e);}return null;};}function patchUpdates(_0x20735c){return function(_0x59b2e9){try{jsonpatch[_0xefec('0x21')](_0x59b2e9,_0x20735c,!![]);}catch(_0x1e697d){return BPromise[_0xefec('0x22')](_0x1e697d);}return _0x59b2e9['save']();};}function saveUpdates(_0x19f4fe,_0x54d70f){return function(_0x3194e3){if(_0x3194e3){return _0x3194e3[_0xefec('0x23')](_0x19f4fe)[_0xefec('0x24')](function(_0x594702){return _0x594702;});}return null;};}function removeEntity(_0x24f47b,_0x26e169){return function(_0x4a030b){if(_0x4a030b){return _0x4a030b[_0xefec('0x25')]()[_0xefec('0x24')](function(){_0x24f47b[_0xefec('0x1b')](0xcc)[_0xefec('0x1a')]();});}};}function handleEntityNotFound(_0x3f3a12,_0x593fc3){return function(_0x281b00){if(!_0x281b00){_0x3f3a12[_0xefec('0x19')](0x194);}return _0x281b00;};}function handleError(_0x1a544f,_0x3044d8){_0x3044d8=_0x3044d8||0x1f4;return function(_0x5939eb){logger[_0xefec('0x26')](_0x5939eb[_0xefec('0x27')]);if(_0x5939eb[_0xefec('0x28')]){delete _0x5939eb[_0xefec('0x28')];}_0x1a544f[_0xefec('0x1b')](_0x3044d8)[_0xefec('0x29')](_0x5939eb);};}exports['index']=function(_0xfdb54d,_0x38cd90){var _0xff266a={},_0x34047c={},_0x1dc5fe={'count':0x0,'rows':[]};var _0x5891a5=_['map'](db['UserProfile'][_0xefec('0x2a')],function(_0x89bb98){return{'name':_0x89bb98[_0xefec('0x2b')],'type':_0x89bb98['type'][_0xefec('0x2c')]};});_0x34047c['model']=_[_0xefec('0x2d')](_0x5891a5,_0xefec('0x28'));_0x34047c[_0xefec('0x2e')]=_[_0xefec('0x2f')](_0xfdb54d[_0xefec('0x2e')]);_0x34047c[_0xefec('0x30')]=_[_0xefec('0x31')](_0x34047c[_0xefec('0x32')],_0x34047c[_0xefec('0x2e')]);_0xff266a[_0xefec('0x33')]=_[_0xefec('0x31')](_0x34047c[_0xefec('0x32')],qs['fields'](_0xfdb54d[_0xefec('0x2e')]['fields']));_0xff266a['attributes']=_0xff266a[_0xefec('0x33')][_0xefec('0x34')]?_0xff266a[_0xefec('0x33')]:_0x34047c['model'];if(!_0xfdb54d['query']['hasOwnProperty'](_0xefec('0x35'))){_0xff266a[_0xefec('0x1f')]=qs[_0xefec('0x1f')](_0xfdb54d['query']['limit']);_0xff266a['offset']=qs['offset'](_0xfdb54d[_0xefec('0x2e')][_0xefec('0x1d')]);}_0xff266a[_0xefec('0x36')]=qs[_0xefec('0x37')](_0xfdb54d[_0xefec('0x2e')][_0xefec('0x37')]);_0xff266a['where']=qs['filters'](_[_0xefec('0x38')](_0xfdb54d[_0xefec('0x2e')],_0x34047c[_0xefec('0x30')]),_0x5891a5);if(_0xfdb54d[_0xefec('0x2e')]['filter']){_0xff266a[_0xefec('0x39')]=_[_0xefec('0x3a')](_0xff266a[_0xefec('0x39')],{'$or':_[_0xefec('0x2d')](_0x5891a5,function(_0x5bd8bf){if(_0x5bd8bf[_0xefec('0x3b')]!==_0xefec('0x3c')){var _0x53a1fb={};_0x53a1fb[_0x5bd8bf[_0xefec('0x28')]]={'$like':'%'+_0xfdb54d['query']['filter']+'%'};return _0x53a1fb;}})});}_0xff266a=_[_0xefec('0x3a')]({},_0xff266a,_0xfdb54d[_0xefec('0x3d')]);var _0x144e4a={'where':_0xff266a['where']};return db[_0xefec('0x3e')]['count'](_0x144e4a)[_0xefec('0x24')](function(_0x405683){_0x1dc5fe[_0xefec('0x20')]=_0x405683;if(_0xfdb54d[_0xefec('0x2e')][_0xefec('0x3f')]){_0xff266a[_0xefec('0x40')]=[{'all':!![]}];}return db[_0xefec('0x3e')]['findAll'](_0xff266a);})[_0xefec('0x24')](function(_0x3afdc6){_0x1dc5fe[_0xefec('0x41')]=_0x3afdc6;return _0x1dc5fe;})[_0xefec('0x24')](respondWithFilteredResult(_0x38cd90,_0xff266a))[_0xefec('0x42')](handleError(_0x38cd90,null));};exports[_0xefec('0x43')]=function(_0x48466a,_0x3a2341){var _0x24fd30={'raw':![],'where':{'id':_0x48466a[_0xefec('0x44')]['id']}},_0x11e268={};_0x11e268['model']=_[_0xefec('0x2f')](db[_0xefec('0x3e')][_0xefec('0x2a')]);_0x11e268[_0xefec('0x2e')]=_['keys'](_0x48466a[_0xefec('0x2e')]);_0x11e268['filters']=_['intersection'](_0x11e268[_0xefec('0x32')],_0x11e268[_0xefec('0x2e')]);_0x24fd30[_0xefec('0x33')]=_[_0xefec('0x31')](_0x11e268[_0xefec('0x32')],qs[_0xefec('0x45')](_0x48466a[_0xefec('0x2e')]['fields']));_0x24fd30['attributes']=_0x24fd30[_0xefec('0x33')][_0xefec('0x34')]?_0x24fd30[_0xefec('0x33')]:_0x11e268[_0xefec('0x32')];if(_0x48466a[_0xefec('0x2e')][_0xefec('0x3f')]){_0x24fd30['include']=[{'all':!![]}];}_0x24fd30=_[_0xefec('0x3a')]({},_0x24fd30,_0x48466a[_0xefec('0x3d')]);return db[_0xefec('0x3e')]['find'](_0x24fd30)[_0xefec('0x24')](handleEntityNotFound(_0x3a2341,null))[_0xefec('0x24')](respondWithResult(_0x3a2341,null))[_0xefec('0x42')](handleError(_0x3a2341,null));};exports[_0xefec('0x46')]=function(_0x373dd9,_0x3fbc46){return db[_0xefec('0x3e')]['create'](_0x373dd9['body'],{})[_0xefec('0x24')](respondWithResult(_0x3fbc46,0xc9))[_0xefec('0x42')](handleError(_0x3fbc46,null));};exports['clone']=function(_0x1d2180,_0x269eb6){var _0x43cebc={'where':{'id':_0x1d2180[_0xefec('0x44')]['id']}},_0x377845={};_0x377845[_0xefec('0x32')]=_['keys'](db[_0xefec('0x3e')][_0xefec('0x2a')]);_0x43cebc[_0xefec('0x33')]=_[_0xefec('0x31')](_0x377845['model'],qs['fields'](_0x1d2180[_0xefec('0x2e')][_0xefec('0x45')]));_0x43cebc[_0xefec('0x33')]=_0x43cebc[_0xefec('0x33')]['length']?_0x43cebc[_0xefec('0x33')]:_0x377845['model'];if(_0x1d2180[_0xefec('0x2e')]['includeAll']){_0x43cebc[_0xefec('0x40')]=[{'all':!![]}];}_0x43cebc=_['merge']({},_0x43cebc,_0x1d2180[_0xefec('0x3d')]);return db[_0xefec('0x3e')][_0xefec('0x47')](_0x43cebc)[_0xefec('0x24')](handleEntityNotFound(_0x269eb6,null))[_0xefec('0x24')](function(_0x43c39e){if(_0x43c39e){var _0x1130d6=_0x43c39e[_0xefec('0x48')]({'plain':!![]});_0x1130d6=qs[_0xefec('0x49')](_0x1130d6,['id',_0xefec('0x4a'),'updatedAt',_0xefec('0x4b')]);_0x1d2180['body']=_[_0xefec('0x49')](_0x1d2180['body'],['id',_0xefec('0x4a'),_0xefec('0x4c')]);return db[_0xefec('0x4d')][_0xefec('0x4e')](function(_0x4829d2){return db[_0xefec('0x3e')][_0xefec('0x46')](_[_0xefec('0x3a')](_0x1130d6,_0x1d2180[_0xefec('0x4f')]),{'include':_0x1d2180['query'][_0xefec('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x4829d2})[_0xefec('0x24')](function(_0x28fff6){var _0x5d08f7=_0x28fff6[_0xefec('0x48')]({'plain':!![]});return db['UserProfileSection'][_0xefec('0x50')]({'where':{'userProfileId':_0x1d2180[_0xefec('0x44')]['id']},'raw':!![]})[_0xefec('0x24')](function(_0x4c7ab2){if(_0x4c7ab2){return BPromise['each'](_0x4c7ab2,function(_0xcbdb04){return new BPromise(function(_0x5db146,_0x2a5090){if(_0xcbdb04[_0xefec('0x51')]===null||_0xcbdb04[_0xefec('0x51')]===0x1)_0x5db146(null);return db['UserProfileResource'][_0xefec('0x50')]({'where':{'sectionId':_0xcbdb04['id']},'raw':!![]})[_0xefec('0x24')](function(_0x521327){var _0x505bf1=_['map'](_0x521327,function(_0x2b4684){return qs[_0xefec('0x49')](_0x2b4684,['id','createdAt','updatedAt','sectionId']);});_0x5db146(_0x505bf1);})[_0xefec('0x42')](function(_0x598055){_0x2a5090(_0x598055);});})['then'](function(_0x451bf0){var _0x26974d=qs[_0xefec('0x49')](_0xcbdb04,['id',_0xefec('0x4a'),_0xefec('0x4c')]);_0x26974d[_0xefec('0x52')]=_0x5d08f7['id'];if(_0x451bf0)_0x26974d['Resources']=_0x451bf0;return _0x26974d;})[_0xefec('0x24')](function(_0x41b8ae){return db[_0xefec('0x53')][_0xefec('0x46')](_0x41b8ae,{'include':[{'model':db[_0xefec('0x54')],'as':_0xefec('0x55')}],'raw':!![],'transaction':_0x4829d2});});})[_0xefec('0x24')](function(){return _0x5d08f7;});}});});});}})[_0xefec('0x24')](respondWithResult(_0x269eb6,0xc9))[_0xefec('0x42')](handleError(_0x269eb6,null));};exports[_0xefec('0x23')]=function(_0x2fb61f,_0x441d63){if(_0x2fb61f[_0xefec('0x4f')]['id']){delete _0x2fb61f[_0xefec('0x4f')]['id'];}return db[_0xefec('0x3e')][_0xefec('0x47')]({'where':{'id':_0x2fb61f['params']['id']}})['then'](handleEntityNotFound(_0x441d63,null))[_0xefec('0x24')](saveUpdates(_0x2fb61f['body'],null))[_0xefec('0x24')](respondWithResult(_0x441d63,null))[_0xefec('0x42')](handleError(_0x441d63,null));};exports[_0xefec('0x25')]=function(_0x50741a,_0x1b7f94){return db['UserProfile']['find']({'where':{'id':_0x50741a[_0xefec('0x44')]['id']}})[_0xefec('0x24')](handleEntityNotFound(_0x1b7f94,null))[_0xefec('0x24')](removeEntity(_0x1b7f94,null))[_0xefec('0x42')](handleError(_0x1b7f94,null));};exports[_0xefec('0x56')]=function(_0x5ba930,_0x5e5775){return db['UserProfile']['describe']()['then'](respondWithResult(_0x5e5775,null))['catch'](handleError(_0x5e5775,null));};exports[_0xefec('0x57')]=function(_0x4a72bc,_0x58495a){var _0x192350=_0x4a72bc[_0xefec('0x4f')];return db[_0xefec('0x3e')]['find']({'where':{'id':_0x4a72bc[_0xefec('0x44')]['id']}})[_0xefec('0x24')](handleEntityNotFound(_0x58495a,null))[_0xefec('0x24')](function(_0x37ddd6){if(_0x37ddd6){return db[_0xefec('0x4d')][_0xefec('0x4e')](function(_0x19c5ea){return db['UserProfileSection'][_0xefec('0x25')]({'where':{'userProfileId':_0x4a72bc[_0xefec('0x44')]['id'],'sectionId':_['map'](_0x192350,function(_0x202261){return _0x202261[_0xefec('0x58')];})},'transaction':_0x19c5ea})[_0xefec('0x24')](function(){var _0xf8a751=_['map'](_0x192350,function(_0xd74114){_0xd74114['userProfileId']=_0x4a72bc[_0xefec('0x44')]['id'];return _0xd74114;});var _0x254062=[];return BPromise['each'](_0xf8a751,function(_0x28cbeb){return db[_0xefec('0x53')]['create'](_0x28cbeb,{'include':[{'model':db['UserProfileResource'],'as':_0xefec('0x55')}],'raw':!![],'transaction':_0x19c5ea})[_0xefec('0x24')](function(_0x2c2124){_0x254062[_0xefec('0x59')](_0x2c2124[_0xefec('0x48')]({'plain':!![]}));});})[_0xefec('0x24')](function(){return _0x254062;});});});}})['then'](function(_0x2dcc3a){return _0x2dcc3a;})['then'](respondWithResult(_0x58495a,null))['catch'](handleError(_0x58495a,null));};exports['removeSections']=function(_0xbeb070,_0x5bf05f){var _0x26e507;return db[_0xefec('0x3e')][_0xefec('0x47')]({'where':{'id':_0xbeb070['params']['id']},'attributes':['id',_0xefec('0x28')]})[_0xefec('0x24')](handleEntityNotFound(_0x5bf05f,null))[_0xefec('0x24')](function(_0x100f36){if(_0x100f36){_0x26e507=_0x100f36;return db['UserProfileSection'][_0xefec('0x25')]({'where':{'userProfileId':_0xbeb070[_0xefec('0x44')]['id'],'sectionId':_0xbeb070[_0xefec('0x2e')][_0xefec('0x5a')]}});}})[_0xefec('0x24')](function(){return _0x26e507;})[_0xefec('0x24')](respondWithStatusCode(_0x5bf05f,null))[_0xefec('0x42')](handleError(_0x5bf05f,null));};exports[_0xefec('0x5b')]=function(_0x2aeb4f,_0x4dfd29){var _0x3921a3=[];var _0x30faac=[];return db[_0xefec('0x53')][_0xefec('0x50')]({'where':{'userProfileId':_0x2aeb4f['params']['id']},'raw':!![]})[_0xefec('0x24')](function(_0x362149){_0x3921a3=_['filter'](_0x362149,function(_0x3952a9){return _0x3952a9['enabled']===0x1||_[_0xefec('0x5c')]([0x3eb,0x709],_0x3952a9[_0xefec('0x58')]);});if(!_[_0xefec('0x5d')](_0x3921a3)){return _['map'](_0x3921a3,function(_0x573ef4){return _0x573ef4[_0xefec('0x58')];});}else{return;}})['then'](function(_0x400fdf){if(_0x400fdf)_0x30faac=_0x400fdf;if(_['includes'](_0x30faac,0x64)){var _0x33da6f=_[_0xefec('0x47')](_0x3921a3,{'sectionId':0x64});return hasDefaultDashboard(_0x33da6f)['then'](function(_0x4a2100){return _[_0xefec('0x2d')](_0x3921a3,function(_0x2c6c42){if(_0x2c6c42[_0xefec('0x58')]===0x64){_0x2c6c42[_0xefec('0x5e')]=_0x4a2100;}return _0x2c6c42;});});}else{return;}})[_0xefec('0x24')](function(_0x31d7e4){if(_0x31d7e4)_0x3921a3=_0x31d7e4;if(_[_0xefec('0x5c')](_0x30faac,0x3eb)){var _0x3b747f=_[_0xefec('0x47')](_0x3921a3,{'sectionId':0x3eb});return getCustomDashboards(_0x3b747f)[_0xefec('0x24')](function(_0x15f70d){return _[_0xefec('0x2d')](_0x3921a3,function(_0x143497){if(_0x3b747f[_0xefec('0x5f')]){if(_0x143497[_0xefec('0x58')]===0x3eb){_0x143497[_0xefec('0x5e')]=_0x15f70d;}}else{if(_0x143497[_0xefec('0x58')]===0x64){_0x143497['subsections']=_0x15f70d;}}return _0x143497;});});}else{return;}})[_0xefec('0x24')](function(_0x1a8a4a){if(_0x1a8a4a)_0x3921a3=_0x1a8a4a;if(_[_0xefec('0x5c')](_0x30faac,0x709)){var _0x1407c6=_[_0xefec('0x47')](_0x3921a3,{'sectionId':0x709});return getPlugins(_0x1407c6)[_0xefec('0x24')](function(_0x36c6dd){if(_0x1407c6[_0xefec('0x5f')]){return _[_0xefec('0x2d')](_0x3921a3,function(_0x3fdc9e){if(_0x3fdc9e[_0xefec('0x58')]===0x709){_0x3fdc9e['subsections']=_0x36c6dd;}return _0x3fdc9e;});}else{var _0x178575={'sectionId':0x76c,'enabled':0x1,'subsections':_0x36c6dd};var _0x2e5fd4=_[_0xefec('0x2d')](_0x3921a3);_0x2e5fd4[_0xefec('0x59')](_0x178575);return _0x2e5fd4;}});}else{return;}})[_0xefec('0x24')](function(_0x349a7c){if(_0x349a7c)_0x3921a3=_0x349a7c;return _[_0xefec('0x60')](_0x3921a3,[_0xefec('0x5f'),0x1]);})[_0xefec('0x24')](respondWithResult(_0x4dfd29,null))['catch'](handleError(_0x4dfd29,null));};function hasDefaultDashboard(_0x19a9cb){var _0x4f7f4e=[0x65];return new BPromise(function(_0x3082d0,_0x3ded3e){try{if(_0x19a9cb[_0xefec('0x51')]){_0x3082d0(_0x4f7f4e);}else{return db[_0xefec('0x54')][_0xefec('0x61')]({'where':{'sectionId':_0x19a9cb['id']},'raw':!![]})[_0xefec('0x24')](function(_0x4d29ce){_0x4d29ce?_0x3082d0(_0x4f7f4e):_0x3082d0();});}}catch(_0xf93117){_0x3ded3e(_0xf93117);}});}function getCustomDashboards(_0x484b77){var _0x124988=[];return new BPromise(function(_0x6e80d1,_0x37b126){try{if(_0x484b77[_0xefec('0x51')]){return db['Dashboard']['findAll']({'raw':!![]})[_0xefec('0x24')](function(_0x2e4645){_0x2e4645[_0xefec('0x62')](function(_0x51c4a9){_0x124988[_0xefec('0x59')](_0x51c4a9['id']+0x1869f);});_0x6e80d1(_0x124988);});}else{return db[_0xefec('0x54')][_0xefec('0x50')]({'where':{'sectionId':_0x484b77['id']},'raw':!![]})['then'](function(_0x1037b0){_0x1037b0['forEach'](function(_0x42acc3){_0x124988['push'](_0x42acc3[_0xefec('0x63')]+0x1869f);});_0x6e80d1(_0x124988);});}}catch(_0x3635d4){_0x37b126(_0x3635d4);}});}function getPlugins(_0x230630){var _0x4dbf2b=[];return new BPromise(function(_0x3d01a5,_0x1869bf){try{if(_0x230630['autoAssociation']){return db[_0xefec('0x64')][_0xefec('0x50')]({'raw':!![]})[_0xefec('0x24')](function(_0x1e9203){_0x1e9203[_0xefec('0x62')](function(_0x1bf584){_0x4dbf2b[_0xefec('0x59')](_0x1bf584['id']+0x15b38);});_0x3d01a5(_0x4dbf2b);});}else{return db[_0xefec('0x54')][_0xefec('0x50')]({'where':{'sectionId':_0x230630['id']},'raw':!![]})[_0xefec('0x24')](function(_0xc36786){_0xc36786[_0xefec('0x62')](function(_0x309a79){_0x4dbf2b[_0xefec('0x59')](_0x309a79[_0xefec('0x63')]+0x15b38);});_0x3d01a5(_0x4dbf2b);});}}catch(_0x56a622){_0x1869bf(_0x56a622);}});}exports['addResources']=function(_0x126ea6,_0x7a0382){return db[_0xefec('0x3e')][_0xefec('0x47')]({'where':{'id':_0x126ea6[_0xefec('0x44')]['id']}})[_0xefec('0x24')](handleEntityNotFound(_0x7a0382,null))['then'](function(_0x1566a3){if(_0x1566a3){return db[_0xefec('0x4d')][_0xefec('0x4e')](function(_0x5d12e5){return db[_0xefec('0x53')][_0xefec('0x50')]({'where':{'userProfileId':_0x126ea6[_0xefec('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0xefec('0x24')](function(_0x26ce90){if(_0x26ce90){return db[_0xefec('0x53')][_0xefec('0x25')]({'where':{'userProfileId':_0x126ea6['params']['id'],'id':_['map'](_0x26ce90,function(_0x55e40d){return _0x55e40d['id'];})},'transaction':_0x5d12e5});}})['then'](function(_0x204b0f){var _0x318f3e=_[_0xefec('0x2d')](_0x126ea6[_0xefec('0x4f')],function(_0x42cad0){_0x42cad0[_0xefec('0x52')]=_0x126ea6[_0xefec('0x44')]['id'];return _0x42cad0;});return db['UserProfileSection'][_0xefec('0x65')](_0x318f3e,{'raw':!![],'transaction':_0x5d12e5});})[_0xefec('0x24')](function(_0x575940){var _0x47aa03=_[_0xefec('0x60')](_['map'](_0x575940,function(_0x275bec){return _0x275bec[_0xefec('0x48')]({'plain':!![]});}),{'includeAll':![]});if(_0x47aa03){return db['UserProfileSection'][_0xefec('0x50')]({'where':{'userProfileId':_0x126ea6[_0xefec('0x44')]['id'],'sectionId':_[_0xefec('0x2d')](_0x47aa03,function(_0x44d59a){return _0x44d59a[_0xefec('0x58')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xefec('0x24')](function(_0x133ccb){var _0x581348=_[_0xefec('0x2d')](_0x126ea6[_0xefec('0x4f')],function(_0x548ef2){_0x548ef2[_0xefec('0x52')]=_0x126ea6[_0xefec('0x44')]['id'];return _0x548ef2;});return db[_0xefec('0x54')]['bulkCreate'](_0x581348,{'raw':!![],'transaction':_0x5d12e5});});}})[_0xefec('0x42')](handleError(_0x7a0382,null));});}})[_0xefec('0x24')](function(_0x12e11b){var _0x4fe3d7=_['map'](_0x12e11b,function(_0x4c952f){return _0x4c952f[_0xefec('0x48')]({'plain':!![]});});})['then'](respondWithResult(_0x7a0382,null))[_0xefec('0x42')](handleError(_0x7a0382,null));};exports[_0xefec('0x66')]=function(_0x309936,_0xc3da2e,_0x17aebe){return db[_0xefec('0x3e')]['find']({'where':{'id':_0x309936[_0xefec('0x44')]['id']}})[_0xefec('0x24')](handleEntityNotFound(_0xc3da2e,null))['then'](function(_0x1bf0e3){if(_0x1bf0e3){return _0x1bf0e3[_0xefec('0x66')](_0x309936['query'][_0xefec('0x5a')]);}})[_0xefec('0x24')](respondWithStatusCode(_0xc3da2e,null))[_0xefec('0x42')](handleError(_0xc3da2e,null));};exports[_0xefec('0x67')]=function(_0x2614b6,_0x586a87){var _0x63ceaf={};if(!_0x2614b6[_0xefec('0x2e')][_0xefec('0x68')])throw new Error(_0xefec('0x69'));if(!_0x2614b6['query'][_0xefec('0x6a')](_0xefec('0x35'))){_0x63ceaf[_0xefec('0x1f')]=qs[_0xefec('0x1f')](_0x2614b6[_0xefec('0x2e')][_0xefec('0x1f')]);_0x63ceaf['offset']=qs[_0xefec('0x1d')](_0x2614b6[_0xefec('0x2e')][_0xefec('0x1d')]);}return db[_0xefec('0x3e')][_0xefec('0x47')]({'where':{'id':_0x2614b6['params']['id']}})[_0xefec('0x24')](function(_0x5beeeb){if(!_0x5beeeb)throw new Error(_0xefec('0x6b')+_0x2614b6[_0xefec('0x44')]['id']);return db[_0xefec('0x3e')][_0xefec('0x67')](_0x2614b6);})[_0xefec('0x24')](respondWithFilteredResult(_0x586a87,_0x63ceaf))[_0xefec('0x42')](handleError(_0x586a87,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 62a41b6..e11d0d3 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 _0x5226=['exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x21005c,_0x38870c){var _0x483795=function(_0x116d4b){while(--_0x116d4b){_0x21005c['push'](_0x21005c['shift']());}};_0x483795(++_0x38870c);}(_0x5226,0x137));var _0x6522=function(_0x8f327b,_0x448380){_0x8f327b=_0x8f327b-0x0;var _0xf1eed9=_0x5226[_0x8f327b];return _0xf1eed9;};'use strict';var EventEmitter=require(_0x6522('0x0'));var UserProfile=require(_0x6522('0x1'))['db'][_0x6522('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6522('0x3')](0x0);var events={'afterCreate':_0x6522('0x4'),'afterUpdate':'update','afterDestroy':_0x6522('0x5')};function emitEvent(_0x43f913){return function(_0x12dffe,_0x48d4db,_0x228009){UserProfileEvents['emit'](_0x43f913+':'+_0x12dffe['id'],_0x12dffe);UserProfileEvents[_0x6522('0x6')](_0x43f913,_0x12dffe);_0x228009(null);};}for(var e in events){if(events[_0x6522('0x7')](e)){var event=events[e];UserProfile[_0x6522('0x8')](e,emitEvent(event));}}module[_0x6522('0x9')]=UserProfileEvents; \ No newline at end of file +var _0xc359=['save','update','emit','../../mysqldb','setMaxListeners'];(function(_0xa042eb,_0x43fd9e){var _0x29ac43=function(_0x50f672){while(--_0x50f672){_0xa042eb['push'](_0xa042eb['shift']());}};_0x29ac43(++_0x43fd9e);}(_0xc359,0x1d9));var _0x9c35=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xc359[_0x207811];return _0x170d56;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x9c35('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9c35('0x1')](0x0);var events={'afterCreate':_0x9c35('0x2'),'afterUpdate':_0x9c35('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cfffd){return function(_0x53a490,_0x1540b4,_0x5d4ee8){UserProfileEvents[_0x9c35('0x4')](_0x3cfffd+':'+_0x53a490['id'],_0x53a490);UserProfileEvents['emit'](_0x3cfffd,_0x53a490);_0x5d4ee8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 50614a6..a585c18 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 _0x77e1=['then','field','resourceId','type','squareprojects','childModel','odbc','squarerecordings','SquareRecording','parentSections','name','projectName','projects','JscriptyProject','CmContact','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','role','Telephones','membername','User','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','intervals','pauses','Pause','scheduler','Schedule','Sound','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','AnalyticExtractedReport','Reports','reportId','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','Invalid\x20section\x20\x27','isEmpty','length','params','ignore','union','find','push','autoAssociation','rawAttributes','model','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','ids','customSorting','extraQueryConditions','count','color','tag','Tag','ThroughTags','openTabs','rows','chat','sms','fax','dataValues','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','value','findAll','associatedResources','map','catch','resolve'];(function(_0x538595,_0x400814){var _0x35a0ec=function(_0x55b59f){while(--_0x55b59f){_0x538595['push'](_0x538595['shift']());}};_0x35a0ec(++_0x400814);}(_0x77e1,0xb4));var _0x177e=function(_0x10730d,_0x426e76){_0x10730d=_0x10730d-0x0;var _0x5b59a6=_0x77e1[_0x10730d];return _0x5b59a6;};'use strict';var _=require(_0x177e('0x0'));var attributes=require(_0x177e('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x177e('0x2'));module[_0x177e('0x3')]=function(_0x13bc55){var _0x3ad1c2=_0x13bc55[_0x177e('0x4')];function _0x12c5fb(_0x4bff37,_0x3f6df3){return new Promise(function(_0x929b3b,_0x20f53d){if(!_0x3f6df3)return _0x929b3b(null);var _0x46be4f=_0x3f6df3[_0x177e('0x5')]?{[_0x3f6df3[_0x177e('0x5')]['field']]:_0x3f6df3[_0x177e('0x5')][_0x177e('0x6')]}:undefined;return _0x3ad1c2[_0x4bff37][_0x177e('0x7')]({'where':_0x46be4f,'raw':!![]})['then'](function(_0x358bb0){_0x3f6df3[_0x177e('0x8')]=_[_0x177e('0x9')](_0x358bb0,'id');_0x929b3b(_0x3f6df3);})[_0x177e('0xa')](function(_0x5628f4){_0x20f53d(_0x5628f4);});});}function _0x2a6713(_0x31aab5,_0x21034b){return new Promise(function(_0x4a4ea9,_0xca00de){var _0x54a952=_0x31aab5[_0x177e('0x5')]?{[_0x31aab5[_0x177e('0x5')]['field']]:_0x31aab5[_0x177e('0x5')][_0x177e('0x6')]}:undefined;return _0x3ad1c2[_0x31aab5['model']]['findAll']({'where':_0x54a952,'raw':!![]})['then'](function(_0x4d0eb9){_0x21034b[_0x177e('0x8')]=_[_0x177e('0x9')](_0x4d0eb9,function(_0x13cf49){return _0x13cf49['name'];});_0x4a4ea9(_0x21034b);})[_0x177e('0xa')](function(_0x986d37){_0xca00de(_0x986d37);});});}function _0x2b9c5e(_0x1179b6,_0x57c265,_0x36dffd){if(!_0x57c265)return Promise[_0x177e('0xb')](null);return new Promise(function(_0x2018ed,_0x1f669c){return _0x3ad1c2['UserProfileResource']['findAll']({'where':{'sectionId':_0x57c265['id']},'raw':!![]})[_0x177e('0xc')](function(_0x502c08){if(_0x1179b6['field']&&_0x1179b6['field']!=='id'){_0x57c265[_0x177e('0x8')]=_[_0x177e('0x9')](_0x502c08,function(_0x509fe8){return _0x509fe8[_0x1179b6[_0x177e('0xd')]];});}else{if(_0x36dffd==='AnalyticExtractedReport'){_0x57c265[_0x177e('0x8')]=_[_0x177e('0x9')](_0x502c08,function(_0x4c831c){return{'id':_0x4c831c[_0x177e('0xe')],'type':_0x4c831c[_0x177e('0xf')]};});}else{_0x57c265[_0x177e('0x8')]=_[_0x177e('0x9')](_0x502c08,function(_0x1ce132){return _0x1ce132[_0x177e('0xe')];});}}_0x2018ed(_0x57c265);})[_0x177e('0xa')](function(_0x46d2e6){_0x1f669c(_0x46d2e6);});});}function _0x52f783(_0x32704c,_0x43df82){var _0x519dad={'parentSections':[]};switch(_0x32704c['toLowerCase']()){case _0x177e('0x10'):_0x519dad[_0x177e('0x11')]='SquareProject';break;case _0x177e('0x12'):_0x519dad['childModel']='SquareOdbc';break;case _0x177e('0x13'):_0x519dad['childModel']=_0x177e('0x14');_0x519dad[_0x177e('0x15')]=[{'name':'SquareProjects','field':_0x177e('0x16'),'foreignKey':_0x177e('0x17')}];break;case _0x177e('0x18'):_0x519dad[_0x177e('0x11')]=_0x177e('0x19');break;case'contacts':_0x519dad[_0x177e('0x11')]=_0x177e('0x1a');_0x519dad[_0x177e('0x15')]=[{'name':'Lists','field':'id','foreignKey':_0x177e('0x1b')}];break;case _0x177e('0x1c'):_0x519dad[_0x177e('0x11')]=_0x177e('0x1d');break;case'companies':_0x519dad[_0x177e('0x11')]=_0x177e('0x1e');break;case _0x177e('0x1f'):_0x519dad[_0x177e('0x11')]=_0x177e('0x20');break;case _0x177e('0x21'):_0x519dad[_0x177e('0x11')]=_0x177e('0x22');break;case _0x177e('0x23'):_0x519dad[_0x177e('0x11')]=_0x177e('0x24');break;case _0x177e('0x25'):_0x519dad[_0x177e('0x11')]=_0x177e('0x26');break;case _0x177e('0x27'):_0x519dad[_0x177e('0x11')]=_0x177e('0x28');break;case _0x177e('0x29'):case _0x177e('0x2a'):case'outboundroutes':_0x519dad[_0x177e('0x11')]=_0x177e('0x2b');break;case _0x177e('0x2c'):_0x519dad['childModel']=_0x177e('0x2d');break;case _0x177e('0x2e'):_0x519dad[_0x177e('0x11')]=_0x177e('0x2f');break;case _0x177e('0x30'):_0x519dad[_0x177e('0x11')]=_0x177e('0x31');_0x519dad[_0x177e('0x15')]=[{'name':'Agents','field':'name','foreignKey':'membername','model':'User','filter':{'field':_0x177e('0x32'),'value':['agent']}},{'name':_0x177e('0x33'),'field':_0x177e('0x16'),'foreignKey':_0x177e('0x34'),'model':_0x177e('0x35'),'filter':{'field':_0x177e('0x32'),'value':[_0x177e('0x36')]}},{'name':_0x177e('0x37'),'field':_0x177e('0x16'),'foreignKey':_0x177e('0x38'),'model':'VoiceQueue','filter':{'field':_0x177e('0xf'),'value':[_0x177e('0x39')]}},{'name':_0x177e('0x3a'),'field':_0x177e('0x16'),'foreignKey':'queue','model':_0x177e('0x3b'),'filter':{'field':_0x177e('0xf'),'value':[_0x177e('0x3c')]}}];break;case _0x177e('0x3d'):_0x519dad['childModel']=_0x177e('0x3e');break;case'chanspies':_0x519dad[_0x177e('0x11')]=_0x177e('0x3f');break;case _0x177e('0x40'):_0x519dad[_0x177e('0x11')]='VoicePrefix';break;case _0x177e('0x41'):_0x519dad['childModel']=_0x177e('0x42');break;case'mailqueues':_0x519dad[_0x177e('0x11')]='MailQueue';break;case'mailaccounts':_0x519dad[_0x177e('0x11')]=_0x177e('0x43');break;case _0x177e('0x44'):_0x519dad['childModel']=_0x177e('0x45');break;case _0x177e('0x46'):_0x519dad[_0x177e('0x11')]=_0x177e('0x47');break;case _0x177e('0x48'):_0x519dad[_0x177e('0x11')]=_0x177e('0x49');break;case _0x177e('0x4a'):_0x519dad[_0x177e('0x11')]=_0x177e('0x4b');break;case _0x177e('0x4c'):_0x519dad[_0x177e('0x11')]='SmsAccount';break;case'whatsappqueues':_0x519dad[_0x177e('0x11')]=_0x177e('0x4d');break;case _0x177e('0x4e'):_0x519dad[_0x177e('0x11')]=_0x177e('0x4f');break;case'teams':_0x519dad[_0x177e('0x11')]=_0x177e('0x50');break;case _0x177e('0x51'):case'queuecampaigns':_0x519dad[_0x177e('0x11')]=_0x177e('0x3b');if(_0x43df82){_0x519dad[_0x177e('0x15')]=[{'name':_0x177e('0x37')},{'name':_0x177e('0x3a')}];}break;case _0x177e('0x52'):case _0x177e('0x53'):case _0x177e('0x54'):_0x519dad[_0x177e('0x11')]=_0x177e('0x35');if(_0x43df82){_0x519dad['parentSections']=[{'name':_0x177e('0x55'),'filter':{'field':_0x177e('0x32'),'value':[_0x177e('0x56'),_0x177e('0x57')]},'ignore':!![]},{'name':_0x177e('0x58')},{'name':_0x177e('0x33')}];}break;case _0x177e('0x59'):_0x519dad[_0x177e('0x11')]=_0x177e('0x5a');break;case _0x177e('0x5b'):_0x519dad[_0x177e('0x11')]=_0x177e('0x5c');break;case _0x177e('0x5d'):_0x519dad[_0x177e('0x11')]=_0x177e('0x5e');break;case _0x177e('0x5f'):_0x519dad[_0x177e('0x11')]=_0x177e('0x60');break;case'deskaccounts':_0x519dad[_0x177e('0x11')]=_0x177e('0x61');break;case'zohoaccounts':_0x519dad[_0x177e('0x11')]=_0x177e('0x62');break;case _0x177e('0x63'):_0x519dad[_0x177e('0x11')]=_0x177e('0x35');break;case _0x177e('0x64'):_0x519dad[_0x177e('0x11')]=_0x177e('0x65');break;case _0x177e('0x66'):_0x519dad[_0x177e('0x11')]='Disposition';break;case _0x177e('0x67'):_0x519dad['childModel']='Dashboard';break;case _0x177e('0x68'):_0x519dad[_0x177e('0x11')]='Interval';break;case _0x177e('0x69'):_0x519dad[_0x177e('0x11')]=_0x177e('0x6a');break;case _0x177e('0x6b'):_0x519dad['childModel']=_0x177e('0x6c');break;case'sounds':_0x519dad[_0x177e('0x11')]=_0x177e('0x6d');break;case'tags':_0x519dad[_0x177e('0x11')]='Tag';break;case _0x177e('0x6e'):_0x519dad['childModel']=_0x177e('0x6f');break;case _0x177e('0x70'):_0x519dad[_0x177e('0x11')]=_0x177e('0x71');break;case _0x177e('0x72'):_0x519dad[_0x177e('0x11')]=_0x177e('0x73');break;case _0x177e('0x74'):_0x519dad['childModel']='Variable';break;case _0x177e('0x75'):_0x519dad['childModel']=_0x177e('0x76');break;case'extractedreports':_0x519dad['childModel']=_0x177e('0x77');_0x519dad[_0x177e('0x15')]=[{'name':_0x177e('0x78'),'field':'id','foreignKey':_0x177e('0x79')}];break;case'metrics':_0x519dad[_0x177e('0x11')]='AnalyticMetric';break;}return _0x519dad;}function _0x577b51(_0x4ef116,_0x2507d){var _0x21cfd1=_0x4ef116[_0x177e('0x7a')](0x0)[_0x177e('0x7b')]()+_0x4ef116[_0x177e('0x7c')](0x1);var _0x1f98a2={'type':_0x3ad1c2[_0x177e('0x7d')]['QueryTypes'][_0x177e('0x7e')],'raw':!![]};return new Promise(function(_0x590db5,_0xfcc671){var _0x42fc20=squel[_0x177e('0x7f')]()[_0x177e('0xd')](_0x177e('0x80')+_0x21cfd1+_0x177e('0x81'),'id')['field'](_0x177e('0x82'))['from'](_0x177e('0x83')+_0x4ef116+'_interactions','ui')[_0x177e('0x84')](_0x177e('0x85'),_0x2507d['id']);return _0x3ad1c2[_0x177e('0x86')][_0x177e('0x87')](_0x42fc20[_0x177e('0x88')](),_0x1f98a2)[_0x177e('0xc')](function(_0x3528e2){_0x2507d[_0x21cfd1+_0x177e('0x89')]=_0x3528e2;_0x590db5(_0x3528e2);})['catch'](function(_0x2875bd){_0xfcc671(_0x2875bd);});});}return _0x13bc55[_0x177e('0x8a')](_0x177e('0x8b'),attributes,{'tableName':_0x177e('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1bdafe){var _0x2f5dbd={'raw':_0x1bdafe[_0x177e('0x87')][_0x177e('0x8d')],'where':{}};var _0x40aeac={};var _0x4aeeb5={'count':0x0,'rows':[]};var _0xe0df3=_0x1bdafe[_0x177e('0x87')][_0x177e('0x8e')];var _0x2cb52c=_0x1bdafe[_0x177e('0x87')]['mergeResources']||![];var _0x32e2f1=_0x52f783(_0xe0df3,_0x2cb52c);if(!_0x32e2f1['childModel'])throw new Error(_0x177e('0x8f')+_0xe0df3+'\x27');var _0x1f76e7=[{'name':_0xe0df3}];if(!_[_0x177e('0x90')](_0x32e2f1[_0x177e('0x15')]))_0x1f76e7=_0x32e2f1[_0x177e('0x15')];var _0x50e619=[];for(var _0x56554d=0x0;_0x56554d<_0x1f76e7[_0x177e('0x91')];_0x56554d++){_0x50e619['push'](_0x3ad1c2['UserProfileSection']['find']({'where':{'userProfileId':_0x1bdafe[_0x177e('0x92')]['id'],'name':_0x1f76e7[_0x56554d]['name']},'raw':!![]}));}return Promise['all'](_0x50e619)[_0x177e('0xc')](function(_0x48eaa1){var _0x8f2d11=_[_0x177e('0x5')](_0x48eaa1,function(_0x12ebc6){return _0x12ebc6?_0x12ebc6:undefined;});var _0x16a5be=_[_0x177e('0x5')](_0x1f76e7,[_0x177e('0x93'),!![]]);var _0x185921=_[_0x177e('0x90')](_0x8f2d11)&&_['isEmpty'](_0x16a5be)?null:_[_0x177e('0x94')](_0x16a5be,_0x8f2d11);if(!_0x185921)return null;var _0x37c25b=[];for(var _0x45c8c9=0x0;_0x45c8c9<_0x185921['length'];_0x45c8c9++){var _0x2777c3=_[_0x177e('0x95')](_0x1f76e7,function(_0x3dc4af){return _0x185921[_0x45c8c9]?_0x3dc4af[_0x177e('0x16')]===_0x185921[_0x45c8c9][_0x177e('0x16')]:null;});if(_0x2777c3){if(_0x185921[_0x45c8c9][_0x177e('0x93')]){_0x37c25b[_0x177e('0x96')](_0x12c5fb(_0x32e2f1[_0x177e('0x11')],_0x185921[_0x45c8c9]));}else{if(!_0x185921[_0x45c8c9][_0x177e('0x97')]){_0x37c25b[_0x177e('0x96')](_0x2b9c5e(_0x2777c3,_0x185921[_0x45c8c9],_0x32e2f1[_0x177e('0x11')]));}else{if(_0x2777c3['model']){_0x37c25b['push'](_0x2a6713(_0x2777c3,_0x185921[_0x45c8c9]));}}}}}return Promise['all'](_0x37c25b);})[_0x177e('0xc')](function(_0x2c0fac){var _0x314eda=_0x2c0fac;var _0x3cc7cf=null;if(_0x314eda){_0x3cc7cf=_0x314eda[_0x177e('0x91')]===0x1?_0x314eda[0x0]:null;}if(!_0x3cc7cf&&!_0x314eda)return _0x4aeeb5;var _0x2e3528=_0x3ad1c2[_0x32e2f1[_0x177e('0x11')]][_0x177e('0x98')];_0x40aeac[_0x177e('0x99')]=_['keys'](_0x2e3528);_0x40aeac[_0x177e('0x87')]=_[_0x177e('0x9a')](_0x1bdafe[_0x177e('0x87')]);_0x40aeac[_0x177e('0x9b')]=_[_0x177e('0x9c')](_0x40aeac[_0x177e('0x99')],_0x40aeac[_0x177e('0x87')]);_0x2f5dbd['attributes']=_[_0x177e('0x9c')](_0x40aeac[_0x177e('0x99')],qs['fields'](_0x1bdafe[_0x177e('0x87')][_0x177e('0x9d')]));_0x2f5dbd['attributes']=_0x2f5dbd[_0x177e('0x9e')][_0x177e('0x91')]?_0x2f5dbd['attributes']:_0x40aeac[_0x177e('0x99')];if(!_0x1bdafe[_0x177e('0x87')][_0x177e('0x9f')](_0x177e('0xa0'))){_0x2f5dbd[_0x177e('0xa1')]=qs[_0x177e('0xa1')](_0x1bdafe[_0x177e('0x87')][_0x177e('0xa1')]);_0x2f5dbd['offset']=qs[_0x177e('0xa2')](_0x1bdafe[_0x177e('0x87')]['offset']);}_0x2f5dbd[_0x177e('0xa3')]=qs[_0x177e('0xa4')](_0x1bdafe[_0x177e('0x87')][_0x177e('0xa4')]);_0x2f5dbd['where']=qs['filters'](_['pick'](_0x1bdafe[_0x177e('0x87')],_0x40aeac[_0x177e('0x9b')]));if(_0x1bdafe[_0x177e('0x87')][_0x177e('0x5')]){_0x2f5dbd[_0x177e('0x84')]=_[_0x177e('0xa5')](_0x2f5dbd[_0x177e('0x84')],{'$or':_['map'](_0x2e3528,function(_0x443bba){if(_0x443bba[_0x177e('0xf')][_0x177e('0xa6')]!==_0x177e('0xa7')){var _0x23aa72={};_0x23aa72[_0x443bba['field']]={'$like':'%'+_0x1bdafe[_0x177e('0x87')][_0x177e('0x5')]+'%'};return _0x23aa72;}})});}var _0xe23c42=[];var _0x278024=null;var _0xbe0fbc={};if(_0x3cc7cf){_0x278024=_[_0x177e('0x95')](_0x1f76e7,[_0x177e('0x16'),_0x3cc7cf[_0x177e('0x16')]]);if(_0x278024[_0x177e('0xd')]){_0xbe0fbc={};if(_0x32e2f1[_0x177e('0x11')]===_0x177e('0x77')){_0xbe0fbc[_0x278024[_0x177e('0xa8')]]=_[_0x177e('0x9')](_0x3cc7cf[_0x177e('0x8')],'id');}else{_0xbe0fbc[_0x278024[_0x177e('0xa8')]]=_0x3cc7cf['associatedResources'];}_0xe23c42['push'](_0xbe0fbc);}else{_0x2f5dbd[_0x177e('0x84')]['id']=_0x3cc7cf[_0x177e('0x8')];}}else{for(var _0x323e31=0x0;_0x323e31<_0x314eda['length'];_0x323e31++){_0x278024=_[_0x177e('0x95')](_0x1f76e7,[_0x177e('0x16'),_0x314eda[_0x323e31][_0x177e('0x16')]]);if(_0x278024[_0x177e('0xd')]){_0xbe0fbc={};_0xbe0fbc[_0x278024['foreignKey']]=_0x314eda[_0x323e31]['associatedResources'];_0xe23c42['push'](_0xbe0fbc);}else{if(!_0x2f5dbd[_0x177e('0x84')]['id'])_0x2f5dbd['where']['id']=[];_0x314eda[_0x323e31][_0x177e('0x8')][_0x177e('0xa9')](function(_0x1dabbe){_0x2f5dbd[_0x177e('0x84')]['id'][_0x177e('0x96')](_0x1dabbe);});}}}if(!_[_0x177e('0x90')](_0xe23c42)){_0x2f5dbd[_0x177e('0x84')]=_[_0x177e('0xa5')](_0x2f5dbd[_0x177e('0x84')],{'$and':{'$or':_0xe23c42}});}_0x2f5dbd=_['merge']({},_0x2f5dbd,_0x1bdafe['options']);if(_0x3cc7cf&&!_0x3cc7cf[_0x177e('0x97')]&&_0x32e2f1[_0x177e('0x11')]===_0x177e('0x77')){if(_0x1bdafe[_0x177e('0x87')][_0x177e('0xaa')]){_0x2f5dbd[_0x177e('0xab')]=[{'all':!![]}];}return _0x3ad1c2[_0x32e2f1[_0x177e('0x11')]]['findAll'](_0x2f5dbd)[_0x177e('0xc')](function(_0x2811de){var _0x1bb3a9=[];_0x2811de[_0x177e('0xa9')](function(_0x2bc1bc){var _0x12cab4;switch(_0x2bc1bc[_0x177e('0xac')]){case _0x177e('0xad'):_0x12cab4=_[_0x177e('0x95')](_0x3cc7cf[_0x177e('0x8')],function(_0x4da013){return _0x4da013['id']===_0x2bc1bc[_0x177e('0x79')]&&_0x4da013[_0x177e('0xf')]===_0x177e('0xae');});break;case _0x177e('0xaf'):_0x12cab4=_[_0x177e('0x95')](_0x3cc7cf[_0x177e('0x8')],function(_0x5adf1e){return _0x5adf1e['id']===_0x2bc1bc[_0x177e('0x79')]&&_0x5adf1e[_0x177e('0xf')]===_0x177e('0xb0');});break;}if(_0x12cab4)_0x1bb3a9['push'](_0x2bc1bc);});_0x4aeeb5['count']=_0x1bb3a9[_0x177e('0x91')];_0x4aeeb5['rows']=_0x1bb3a9;return _0x4aeeb5;});}else{if(!_[_0x177e('0x90')](_0x1bdafe['query'][_0x177e('0xb1')])){_0x2f5dbd['where']['id']=_0x2f5dbd[_0x177e('0x84')]['id']?_[_0x177e('0x9c')](_0x2f5dbd[_0x177e('0x84')]['id'],_0x1bdafe[_0x177e('0x87')][_0x177e('0xb1')]):_0x1bdafe['query'][_0x177e('0xb1')];if(_0x1bdafe[_0x177e('0x87')]['customSorting']){_0x2f5dbd[_0x177e('0xa3')]=_0x1bdafe['query'][_0x177e('0xb2')];}}if(_0x1bdafe['query'][_0x177e('0xb3')]){_0x2f5dbd[_0x177e('0x84')]=_['merge'](_0x2f5dbd['where'],{'$and':_0x1bdafe[_0x177e('0x87')]['extraQueryConditions']});}return _0x3ad1c2[_0x32e2f1['childModel']][_0x177e('0xb4')]({'where':_0x2f5dbd[_0x177e('0x84')]})[_0x177e('0xc')](function(_0x1fb02a){_0x4aeeb5['count']=_0x1fb02a;if(_0x1bdafe[_0x177e('0x87')]['includeAll']){if(_0x32e2f1[_0x177e('0x11')]==='CmContact'){_0x2f5dbd[_0x177e('0xab')]=[{'model':_0x3ad1c2['Tag'],'as':'Tags','attributes':['id','name',_0x177e('0xb5')],'required':_0x1bdafe[_0x177e('0x87')][_0x177e('0xb6')]?!![]:![]},{'model':_0x3ad1c2[_0x177e('0xb7')],'as':_0x177e('0xb8'),'attributes':['id','name',_0x177e('0xb5')],'through':_0x1bdafe[_0x177e('0x87')][_0x177e('0xb6')]?{'attributes':[],'where':{'TagId':_0x1bdafe[_0x177e('0x87')][_0x177e('0xb6')]||undefined}}:{},'required':_0x1bdafe[_0x177e('0x87')][_0x177e('0xb6')]?!![]:![]}];}else{_0x2f5dbd['include']=[{'all':!![]}];}}return _0x3ad1c2[_0x32e2f1['childModel']][_0x177e('0x7')](_0x2f5dbd);})[_0x177e('0xc')](function(_0x2b5a2e){_0x4aeeb5['rows']=_0x2b5a2e;if(_0xe0df3===_0x177e('0x58')&&_0x1bdafe['query'][_0x177e('0xb9')]==='true'){var _0x454152=[];for(var _0x47f02b=0x0;_0x47f02b<_0x4aeeb5[_0x177e('0xba')]['length'];_0x47f02b++){_0x454152[_0x177e('0x96')](_0x577b51(_0x177e('0xbb'),_0x4aeeb5[_0x177e('0xba')][_0x47f02b]['dataValues']));_0x454152[_0x177e('0x96')](_0x577b51(_0x177e('0xbc'),_0x4aeeb5['rows'][_0x47f02b]['dataValues']));_0x454152[_0x177e('0x96')](_0x577b51(_0x177e('0xbd'),_0x4aeeb5[_0x177e('0xba')][_0x47f02b][_0x177e('0xbe')]));_0x454152[_0x177e('0x96')](_0x577b51('mail',_0x4aeeb5[_0x177e('0xba')][_0x47f02b][_0x177e('0xbe')]));_0x454152[_0x177e('0x96')](_0x577b51('openchannel',_0x4aeeb5[_0x177e('0xba')][_0x47f02b][_0x177e('0xbe')]));_0x454152[_0x177e('0x96')](_0x577b51(_0x177e('0xbf'),_0x4aeeb5[_0x177e('0xba')][_0x47f02b][_0x177e('0xbe')]));}return Promise['all'](_0x454152)[_0x177e('0xc')](function(){return _0x4aeeb5;});}return _0x4aeeb5;});}});}}});}; \ No newline at end of file +var _0xbb25=['UserProfileResource','AnalyticExtractedReport','resourceId','type','catch','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxAccount','VoiceExtension','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','name','membername','role','Telephones','User','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','whatsappaccounts','teams','Team','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','scheduler','Schedule','sounds','Sound','tags','Tag','templates','trunks','Trunk','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','ignore','autoAssociation','model','all','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','VIRTUAL','foreignKey','options','includeAll','forEach','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','tag','ThroughTags','color','true','dataValues','fax','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','models','filter','field','findAll','then','associatedResources','map','value','resolve'];(function(_0x38de33,_0x4361bb){var _0x40f16d=function(_0x25975c){while(--_0x25975c){_0x38de33['push'](_0x38de33['shift']());}};_0x40f16d(++_0x4361bb);}(_0xbb25,0x17e));var _0x5bb2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb25[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5bb2('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x5bb2('0x1'));var squel=require(_0x5bb2('0x2'));module['exports']=function(_0xb6e080){var _0x58a4dc=_0xb6e080[_0x5bb2('0x3')];function _0x496c40(_0x527181,_0x2317ce){return new Promise(function(_0x1da45f,_0x5283fd){if(!_0x2317ce)return _0x1da45f(null);var _0x480f59=_0x2317ce['filter']?{[_0x2317ce[_0x5bb2('0x4')][_0x5bb2('0x5')]]:_0x2317ce[_0x5bb2('0x4')]['value']}:undefined;return _0x58a4dc[_0x527181][_0x5bb2('0x6')]({'where':_0x480f59,'raw':!![]})[_0x5bb2('0x7')](function(_0x483c0a){_0x2317ce[_0x5bb2('0x8')]=_[_0x5bb2('0x9')](_0x483c0a,'id');_0x1da45f(_0x2317ce);})['catch'](function(_0x3d317a){_0x5283fd(_0x3d317a);});});}function _0x3017f4(_0x36fc8a,_0x293bff){return new Promise(function(_0x4d83db,_0xf808f7){var _0x3be8df=_0x36fc8a[_0x5bb2('0x4')]?{[_0x36fc8a[_0x5bb2('0x4')]['field']]:_0x36fc8a[_0x5bb2('0x4')][_0x5bb2('0xa')]}:undefined;return _0x58a4dc[_0x36fc8a['model']]['findAll']({'where':_0x3be8df,'raw':!![]})[_0x5bb2('0x7')](function(_0x5bcb70){_0x293bff[_0x5bb2('0x8')]=_[_0x5bb2('0x9')](_0x5bcb70,function(_0x195378){return _0x195378['name'];});_0x4d83db(_0x293bff);})['catch'](function(_0x48ccae){_0xf808f7(_0x48ccae);});});}function _0xc0bd41(_0x6a01ff,_0x8c268a,_0x143615){if(!_0x8c268a)return Promise[_0x5bb2('0xb')](null);return new Promise(function(_0x5d3a6a,_0x5807ed){return _0x58a4dc[_0x5bb2('0xc')][_0x5bb2('0x6')]({'where':{'sectionId':_0x8c268a['id']},'raw':!![]})['then'](function(_0x250ec0){if(_0x6a01ff[_0x5bb2('0x5')]&&_0x6a01ff['field']!=='id'){_0x8c268a[_0x5bb2('0x8')]=_[_0x5bb2('0x9')](_0x250ec0,function(_0x369323){return _0x369323[_0x6a01ff[_0x5bb2('0x5')]];});}else{if(_0x143615===_0x5bb2('0xd')){_0x8c268a[_0x5bb2('0x8')]=_[_0x5bb2('0x9')](_0x250ec0,function(_0x2382d9){return{'id':_0x2382d9[_0x5bb2('0xe')],'type':_0x2382d9[_0x5bb2('0xf')]};});}else{_0x8c268a[_0x5bb2('0x8')]=_[_0x5bb2('0x9')](_0x250ec0,function(_0x494acd){return _0x494acd[_0x5bb2('0xe')];});}}_0x5d3a6a(_0x8c268a);})[_0x5bb2('0x10')](function(_0x3c547e){_0x5807ed(_0x3c547e);});});}function _0x4e1575(_0x16e811,_0x2dcb40){var _0x6437f7={'parentSections':[]};switch(_0x16e811[_0x5bb2('0x11')]()){case _0x5bb2('0x12'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x14');break;case _0x5bb2('0x15'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x16');break;case _0x5bb2('0x17'):_0x6437f7[_0x5bb2('0x13')]='SquareRecording';_0x6437f7[_0x5bb2('0x18')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x5bb2('0x19')}];break;case _0x5bb2('0x1a'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x1b');break;case _0x5bb2('0x1c'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x1d');_0x6437f7[_0x5bb2('0x18')]=[{'name':_0x5bb2('0x1e'),'field':'id','foreignKey':_0x5bb2('0x1f')}];break;case _0x5bb2('0x20'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x21');break;case _0x5bb2('0x22'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x23');break;case _0x5bb2('0x24'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x25');break;case _0x5bb2('0x26'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x27');break;case _0x5bb2('0x28'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x29');break;case _0x5bb2('0x2a'):_0x6437f7[_0x5bb2('0x13')]='FaxQueue';break;case'faxaccounts':_0x6437f7['childModel']=_0x5bb2('0x2b');break;case'inboundroutes':case'internalroutes':case'outboundroutes':_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x2c');break;case'contexts':_0x6437f7['childModel']='VoiceContext';break;case _0x5bb2('0x2d'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x2e');break;case _0x5bb2('0x2f'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x30');_0x6437f7[_0x5bb2('0x18')]=[{'name':_0x5bb2('0x31'),'field':_0x5bb2('0x32'),'foreignKey':_0x5bb2('0x33'),'model':'User','filter':{'field':_0x5bb2('0x34'),'value':['agent']}},{'name':_0x5bb2('0x35'),'field':'name','foreignKey':_0x5bb2('0x33'),'model':_0x5bb2('0x36'),'filter':{'field':_0x5bb2('0x34'),'value':['telephone']}},{'name':_0x5bb2('0x37'),'field':_0x5bb2('0x32'),'foreignKey':_0x5bb2('0x38'),'model':'VoiceQueue','filter':{'field':_0x5bb2('0xf'),'value':[_0x5bb2('0x39')]}},{'name':_0x5bb2('0x3a'),'field':_0x5bb2('0x32'),'foreignKey':_0x5bb2('0x38'),'model':_0x5bb2('0x3b'),'filter':{'field':_0x5bb2('0xf'),'value':[_0x5bb2('0x3c')]}}];break;case _0x5bb2('0x3d'):_0x6437f7[_0x5bb2('0x13')]='VoiceMusicOnHold';break;case _0x5bb2('0x3e'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x3f');break;case _0x5bb2('0x40'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x41');break;case'ivrcampaigns':_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x42');break;case _0x5bb2('0x43'):_0x6437f7[_0x5bb2('0x13')]='MailQueue';break;case _0x5bb2('0x44'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x45');break;case'mailsubstatuses':_0x6437f7['childModel']=_0x5bb2('0x46');break;case _0x5bb2('0x47'):_0x6437f7[_0x5bb2('0x13')]='OpenchannelQueue';break;case _0x5bb2('0x48'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x49');break;case _0x5bb2('0x4a'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x4b');break;case _0x5bb2('0x4c'):_0x6437f7[_0x5bb2('0x13')]='SmsAccount';break;case _0x5bb2('0x4d'):_0x6437f7['childModel']='WhatsappQueue';break;case _0x5bb2('0x4e'):_0x6437f7[_0x5bb2('0x13')]='WhatsappAccount';break;case _0x5bb2('0x4f'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x50');break;case'voicequeues':case _0x5bb2('0x51'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x3b');if(_0x2dcb40){_0x6437f7['parentSections']=[{'name':'VoiceQueues'},{'name':_0x5bb2('0x3a')}];}break;case _0x5bb2('0x52'):case _0x5bb2('0x53'):case _0x5bb2('0x54'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x36');if(_0x2dcb40){_0x6437f7[_0x5bb2('0x18')]=[{'name':_0x5bb2('0x55'),'filter':{'field':_0x5bb2('0x34'),'value':[_0x5bb2('0x56'),_0x5bb2('0x57')]},'ignore':!![]},{'name':'Agents'},{'name':_0x5bb2('0x35')}];}break;case _0x5bb2('0x58'):_0x6437f7['childModel']='ZendeskAccount';break;case _0x5bb2('0x59'):_0x6437f7['childModel']=_0x5bb2('0x5a');break;case _0x5bb2('0x5b'):_0x6437f7['childModel']=_0x5bb2('0x5c');break;case _0x5bb2('0x5d'):_0x6437f7[_0x5bb2('0x13')]='SugarcrmAccount';break;case _0x5bb2('0x5e'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x5f');break;case _0x5bb2('0x60'):_0x6437f7['childModel']=_0x5bb2('0x61');break;case _0x5bb2('0x62'):_0x6437f7[_0x5bb2('0x13')]='User';break;case _0x5bb2('0x63'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x64');break;case'dispositions':_0x6437f7['childModel']=_0x5bb2('0x65');break;case _0x5bb2('0x66'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x67');break;case _0x5bb2('0x68'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x69');break;case'pauses':_0x6437f7[_0x5bb2('0x13')]='Pause';break;case _0x5bb2('0x6a'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x6b');break;case _0x5bb2('0x6c'):_0x6437f7['childModel']=_0x5bb2('0x6d');break;case _0x5bb2('0x6e'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x6f');break;case _0x5bb2('0x70'):_0x6437f7[_0x5bb2('0x13')]='Template';break;case'triggers':_0x6437f7[_0x5bb2('0x13')]='Trigger';break;case _0x5bb2('0x71'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x72');break;case'variables':_0x6437f7['childModel']=_0x5bb2('0x73');break;case _0x5bb2('0x74'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x75');break;case _0x5bb2('0x76'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0xd');_0x6437f7[_0x5bb2('0x18')]=[{'name':_0x5bb2('0x77'),'field':'id','foreignKey':_0x5bb2('0x78')}];break;case _0x5bb2('0x79'):_0x6437f7[_0x5bb2('0x13')]=_0x5bb2('0x7a');break;}return _0x6437f7;}function _0x4fb6ae(_0x159195,_0x52fd36){var _0x5aaaa9=_0x159195[_0x5bb2('0x7b')](0x0)[_0x5bb2('0x7c')]()+_0x159195[_0x5bb2('0x7d')](0x1);var _0x2369f8={'type':_0x58a4dc[_0x5bb2('0x7e')][_0x5bb2('0x7f')][_0x5bb2('0x80')],'raw':!![]};return new Promise(function(_0x1cf4bf,_0x23f713){var _0x1c1b1b=squel[_0x5bb2('0x81')]()[_0x5bb2('0x5')](_0x5bb2('0x82')+_0x5aaaa9+_0x5bb2('0x83'),'id')[_0x5bb2('0x5')](_0x5bb2('0x84'))[_0x5bb2('0x85')](_0x5bb2('0x86')+_0x159195+_0x5bb2('0x87'),'ui')[_0x5bb2('0x88')](_0x5bb2('0x89'),_0x52fd36['id']);return _0x58a4dc[_0x5bb2('0x8a')][_0x5bb2('0x8b')](_0x1c1b1b[_0x5bb2('0x8c')](),_0x2369f8)['then'](function(_0x1c7bdf){_0x52fd36[_0x5aaaa9+_0x5bb2('0x8d')]=_0x1c7bdf;_0x1cf4bf(_0x1c7bdf);})[_0x5bb2('0x10')](function(_0x1ed669){_0x23f713(_0x1ed669);});});}return _0xb6e080[_0x5bb2('0x8e')](_0x5bb2('0x8f'),attributes,{'tableName':_0x5bb2('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x81f947){var _0x3cd58c={'raw':_0x81f947['query'][_0x5bb2('0x91')],'where':{}};var _0xd880c5={};var _0xa8fd69={'count':0x0,'rows':[]};var _0x83ecbb=_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0x92')];var _0x1e207d=_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0x93')]||![];var _0x49a0d0=_0x4e1575(_0x83ecbb,_0x1e207d);if(!_0x49a0d0['childModel'])throw new Error(_0x5bb2('0x94')+_0x83ecbb+'\x27');var _0x4aa49d=[{'name':_0x83ecbb}];if(!_[_0x5bb2('0x95')](_0x49a0d0[_0x5bb2('0x18')]))_0x4aa49d=_0x49a0d0[_0x5bb2('0x18')];var _0xf32095=[];for(var _0x1b9193=0x0;_0x1b9193<_0x4aa49d[_0x5bb2('0x96')];_0x1b9193++){_0xf32095[_0x5bb2('0x97')](_0x58a4dc['UserProfileSection'][_0x5bb2('0x98')]({'where':{'userProfileId':_0x81f947[_0x5bb2('0x99')]['id'],'name':_0x4aa49d[_0x1b9193]['name']},'raw':!![]}));}return Promise['all'](_0xf32095)['then'](function(_0x5b1d56){var _0x16e7d2=_[_0x5bb2('0x4')](_0x5b1d56,function(_0xf6b0ad){return _0xf6b0ad?_0xf6b0ad:undefined;});var _0x541b51=_[_0x5bb2('0x4')](_0x4aa49d,['ignore',!![]]);var _0x56403c=_['isEmpty'](_0x16e7d2)&&_[_0x5bb2('0x95')](_0x541b51)?null:_['union'](_0x541b51,_0x16e7d2);if(!_0x56403c)return null;var _0x1dbe28=[];for(var _0x1a9a3b=0x0;_0x1a9a3b<_0x56403c[_0x5bb2('0x96')];_0x1a9a3b++){var _0x1fb2f6=_['find'](_0x4aa49d,function(_0x404f5a){return _0x56403c[_0x1a9a3b]?_0x404f5a[_0x5bb2('0x32')]===_0x56403c[_0x1a9a3b][_0x5bb2('0x32')]:null;});if(_0x1fb2f6){if(_0x56403c[_0x1a9a3b][_0x5bb2('0x9a')]){_0x1dbe28['push'](_0x496c40(_0x49a0d0[_0x5bb2('0x13')],_0x56403c[_0x1a9a3b]));}else{if(!_0x56403c[_0x1a9a3b][_0x5bb2('0x9b')]){_0x1dbe28[_0x5bb2('0x97')](_0xc0bd41(_0x1fb2f6,_0x56403c[_0x1a9a3b],_0x49a0d0[_0x5bb2('0x13')]));}else{if(_0x1fb2f6[_0x5bb2('0x9c')]){_0x1dbe28[_0x5bb2('0x97')](_0x3017f4(_0x1fb2f6,_0x56403c[_0x1a9a3b]));}}}}}return Promise[_0x5bb2('0x9d')](_0x1dbe28);})[_0x5bb2('0x7')](function(_0x367fb5){var _0x3bec7b=_0x367fb5;var _0xa099bb=null;if(_0x3bec7b){_0xa099bb=_0x3bec7b[_0x5bb2('0x96')]===0x1?_0x3bec7b[0x0]:null;}if(!_0xa099bb&&!_0x3bec7b)return _0xa8fd69;var _0x594485=_0x58a4dc[_0x49a0d0[_0x5bb2('0x13')]][_0x5bb2('0x9e')];_0xd880c5[_0x5bb2('0x9c')]=_[_0x5bb2('0x9f')](_0x594485);_0xd880c5['query']=_[_0x5bb2('0x9f')](_0x81f947['query']);_0xd880c5[_0x5bb2('0xa0')]=_[_0x5bb2('0xa1')](_0xd880c5[_0x5bb2('0x9c')],_0xd880c5[_0x5bb2('0x8b')]);_0x3cd58c['attributes']=_[_0x5bb2('0xa1')](_0xd880c5[_0x5bb2('0x9c')],qs[_0x5bb2('0xa2')](_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0xa2')]));_0x3cd58c['attributes']=_0x3cd58c[_0x5bb2('0xa3')]['length']?_0x3cd58c[_0x5bb2('0xa3')]:_0xd880c5[_0x5bb2('0x9c')];if(!_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0xa4')](_0x5bb2('0xa5'))){_0x3cd58c[_0x5bb2('0xa6')]=qs[_0x5bb2('0xa6')](_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0xa6')]);_0x3cd58c[_0x5bb2('0xa7')]=qs['offset'](_0x81f947[_0x5bb2('0x8b')]['offset']);}_0x3cd58c[_0x5bb2('0xa8')]=qs[_0x5bb2('0xa9')](_0x81f947['query'][_0x5bb2('0xa9')]);_0x3cd58c['where']=qs['filters'](_[_0x5bb2('0xaa')](_0x81f947[_0x5bb2('0x8b')],_0xd880c5[_0x5bb2('0xa0')]));if(_0x81f947[_0x5bb2('0x8b')]['filter']){_0x3cd58c[_0x5bb2('0x88')]=_[_0x5bb2('0xab')](_0x3cd58c[_0x5bb2('0x88')],{'$or':_[_0x5bb2('0x9')](_0x594485,function(_0x3cc7b8){if(_0x3cc7b8[_0x5bb2('0xf')]['key']!==_0x5bb2('0xac')){var _0x3bd270={};_0x3bd270[_0x3cc7b8[_0x5bb2('0x5')]]={'$like':'%'+_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0x4')]+'%'};return _0x3bd270;}})});}var _0x2e0066=[];var _0x3e2208=null;var _0x2fa6ec={};if(_0xa099bb){_0x3e2208=_['find'](_0x4aa49d,[_0x5bb2('0x32'),_0xa099bb[_0x5bb2('0x32')]]);if(_0x3e2208[_0x5bb2('0x5')]){_0x2fa6ec={};if(_0x49a0d0[_0x5bb2('0x13')]===_0x5bb2('0xd')){_0x2fa6ec[_0x3e2208['foreignKey']]=_[_0x5bb2('0x9')](_0xa099bb['associatedResources'],'id');}else{_0x2fa6ec[_0x3e2208[_0x5bb2('0xad')]]=_0xa099bb[_0x5bb2('0x8')];}_0x2e0066[_0x5bb2('0x97')](_0x2fa6ec);}else{_0x3cd58c[_0x5bb2('0x88')]['id']=_0xa099bb['associatedResources'];}}else{for(var _0x25783c=0x0;_0x25783c<_0x3bec7b['length'];_0x25783c++){_0x3e2208=_[_0x5bb2('0x98')](_0x4aa49d,['name',_0x3bec7b[_0x25783c][_0x5bb2('0x32')]]);if(_0x3e2208['field']){_0x2fa6ec={};_0x2fa6ec[_0x3e2208[_0x5bb2('0xad')]]=_0x3bec7b[_0x25783c]['associatedResources'];_0x2e0066[_0x5bb2('0x97')](_0x2fa6ec);}else{if(!_0x3cd58c[_0x5bb2('0x88')]['id'])_0x3cd58c[_0x5bb2('0x88')]['id']=[];_0x3bec7b[_0x25783c]['associatedResources']['forEach'](function(_0x981a43){_0x3cd58c[_0x5bb2('0x88')]['id'][_0x5bb2('0x97')](_0x981a43);});}}}if(!_['isEmpty'](_0x2e0066)){_0x3cd58c[_0x5bb2('0x88')]=_[_0x5bb2('0xab')](_0x3cd58c[_0x5bb2('0x88')],{'$and':{'$or':_0x2e0066}});}_0x3cd58c=_[_0x5bb2('0xab')]({},_0x3cd58c,_0x81f947[_0x5bb2('0xae')]);if(_0xa099bb&&!_0xa099bb[_0x5bb2('0x9b')]&&_0x49a0d0['childModel']===_0x5bb2('0xd')){if(_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0xaf')]){_0x3cd58c['include']=[{'all':!![]}];}return _0x58a4dc[_0x49a0d0[_0x5bb2('0x13')]]['findAll'](_0x3cd58c)['then'](function(_0x9ba639){var _0x192b09=[];_0x9ba639[_0x5bb2('0xb0')](function(_0x2997ee){var _0x2612cd;switch(_0x2997ee[_0x5bb2('0xb1')]){case _0x5bb2('0xb2'):_0x2612cd=_[_0x5bb2('0x98')](_0xa099bb[_0x5bb2('0x8')],function(_0x4fd9b6){return _0x4fd9b6['id']===_0x2997ee['reportId']&&_0x4fd9b6[_0x5bb2('0xf')]===_0x5bb2('0xb3');});break;case _0x5bb2('0xb4'):_0x2612cd=_[_0x5bb2('0x98')](_0xa099bb[_0x5bb2('0x8')],function(_0x485eba){return _0x485eba['id']===_0x2997ee[_0x5bb2('0x78')]&&_0x485eba['type']===_0x5bb2('0xb5');});break;}if(_0x2612cd)_0x192b09[_0x5bb2('0x97')](_0x2997ee);});_0xa8fd69[_0x5bb2('0xb6')]=_0x192b09[_0x5bb2('0x96')];_0xa8fd69[_0x5bb2('0xb7')]=_0x192b09;return _0xa8fd69;});}else{if(!_[_0x5bb2('0x95')](_0x81f947['query'][_0x5bb2('0xb8')])){_0x3cd58c[_0x5bb2('0x88')]['id']=_0x3cd58c['where']['id']?_[_0x5bb2('0xa1')](_0x3cd58c[_0x5bb2('0x88')]['id'],_0x81f947['query'][_0x5bb2('0xb8')]):_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0xb8')];if(_0x81f947['query']['customSorting']){_0x3cd58c[_0x5bb2('0xa8')]=_0x81f947['query'][_0x5bb2('0xb9')];}}if(_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0xba')]){_0x3cd58c[_0x5bb2('0x88')]=_[_0x5bb2('0xab')](_0x3cd58c['where'],{'$and':_0x81f947['query'][_0x5bb2('0xba')]});}return _0x58a4dc[_0x49a0d0['childModel']][_0x5bb2('0xb6')]({'where':_0x3cd58c[_0x5bb2('0x88')]})[_0x5bb2('0x7')](function(_0x2d6a94){_0xa8fd69[_0x5bb2('0xb6')]=_0x2d6a94;if(_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0xaf')]){if(_0x49a0d0[_0x5bb2('0x13')]===_0x5bb2('0x1d')){_0x3cd58c['include']=[{'model':_0x58a4dc[_0x5bb2('0x6f')],'as':_0x5bb2('0xbb'),'attributes':['id',_0x5bb2('0x32'),'color'],'required':_0x81f947['query'][_0x5bb2('0xbc')]?!![]:![]},{'model':_0x58a4dc['Tag'],'as':_0x5bb2('0xbd'),'attributes':['id',_0x5bb2('0x32'),_0x5bb2('0xbe')],'through':_0x81f947[_0x5bb2('0x8b')][_0x5bb2('0xbc')]?{'attributes':[],'where':{'TagId':_0x81f947['query'][_0x5bb2('0xbc')]||undefined}}:{},'required':_0x81f947[_0x5bb2('0x8b')]['tag']?!![]:![]}];}else{_0x3cd58c['include']=[{'all':!![]}];}}return _0x58a4dc[_0x49a0d0['childModel']][_0x5bb2('0x6')](_0x3cd58c);})['then'](function(_0x40d80f){_0xa8fd69[_0x5bb2('0xb7')]=_0x40d80f;if(_0x83ecbb===_0x5bb2('0x31')&&_0x81f947[_0x5bb2('0x8b')]['openTabs']===_0x5bb2('0xbf')){var _0x39c361=[];for(var _0x2959cd=0x0;_0x2959cd<_0xa8fd69[_0x5bb2('0xb7')][_0x5bb2('0x96')];_0x2959cd++){_0x39c361[_0x5bb2('0x97')](_0x4fb6ae('chat',_0xa8fd69[_0x5bb2('0xb7')][_0x2959cd][_0x5bb2('0xc0')]));_0x39c361[_0x5bb2('0x97')](_0x4fb6ae('sms',_0xa8fd69['rows'][_0x2959cd]['dataValues']));_0x39c361[_0x5bb2('0x97')](_0x4fb6ae(_0x5bb2('0xc1'),_0xa8fd69[_0x5bb2('0xb7')][_0x2959cd]['dataValues']));_0x39c361[_0x5bb2('0x97')](_0x4fb6ae(_0x5bb2('0xc2'),_0xa8fd69[_0x5bb2('0xb7')][_0x2959cd][_0x5bb2('0xc0')]));_0x39c361['push'](_0x4fb6ae(_0x5bb2('0xc3'),_0xa8fd69[_0x5bb2('0xb7')][_0x2959cd]['dataValues']));_0x39c361['push'](_0x4fb6ae(_0x5bb2('0xc4'),_0xa8fd69[_0x5bb2('0xb7')][_0x2959cd][_0x5bb2('0xc0')]));}return Promise['all'](_0x39c361)['then'](function(){return _0xa8fd69;});}return _0xa8fd69;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 4361376..329bc1a 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 _0x74af=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x4b213f,_0x4ed769){var _0x2fe02e=function(_0x23097e){while(--_0x23097e){_0x4b213f['push'](_0x4b213f['shift']());}};_0x2fe02e(++_0x4ed769);}(_0x74af,0x178));var _0xf74a=function(_0x544ba2,_0x4de1f2){_0x544ba2=_0x544ba2-0x0;var _0x261b89=_0x74af[_0x544ba2];return _0x261b89;};'use strict';var _=require(_0xf74a('0x0'));var util=require(_0xf74a('0x1'));var moment=require(_0xf74a('0x2'));var BPromise=require(_0xf74a('0x3'));var rs=require(_0xf74a('0x4'));var fs=require('fs');var Redis=require(_0xf74a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf74a('0x6'));var logger=require(_0xf74a('0x7'))(_0xf74a('0x8'));var config=require(_0xf74a('0x9'));var jayson=require(_0xf74a('0xa'));var client=jayson[_0xf74a('0xb')][_0xf74a('0xc')]({'port':0x232a});config['redis']=_[_0xf74a('0xd')](config[_0xf74a('0xe')],{'host':_0xf74a('0xf'),'port':0x18eb});var socket=require(_0xf74a('0x10'))(new Redis(config[_0xf74a('0xe')]));require(_0xf74a('0x11'))[_0xf74a('0x12')](socket);function respondWithRpcPromise(_0x78bbd9,_0x206db9,_0x15c591){return new BPromise(function(_0xd6896f,_0xd79080){return client[_0xf74a('0x13')](_0x78bbd9,_0x15c591)[_0xf74a('0x14')](function(_0x15f94b){logger['info'](_0xf74a('0x15'),_0x206db9,'request\x20sent');logger[_0xf74a('0x16')](_0xf74a('0x17'),_0x206db9,_0xf74a('0x18'),JSON[_0xf74a('0x19')](_0x15f94b));if(_0x15f94b[_0xf74a('0x1a')]){if(_0x15f94b[_0xf74a('0x1a')]['code']===0x1f4){logger[_0xf74a('0x1a')]('UserProfile,\x20%s,\x20%s',_0x206db9,_0x15f94b[_0xf74a('0x1a')][_0xf74a('0x1b')]);return _0xd79080(_0x15f94b['error'][_0xf74a('0x1b')]);}logger[_0xf74a('0x1a')](_0xf74a('0x15'),_0x206db9,_0x15f94b[_0xf74a('0x1a')]['message']);return _0xd6896f(_0x15f94b[_0xf74a('0x1a')]['message']);}else{logger['info'](_0xf74a('0x15'),_0x206db9,_0xf74a('0x18'));_0xd6896f(_0x15f94b[_0xf74a('0x1c')]['message']);}})['catch'](function(_0x56f11a){logger[_0xf74a('0x1a')](_0xf74a('0x15'),_0x206db9,_0x56f11a);_0xd79080(_0x56f11a);});});} \ No newline at end of file +var _0x0650=['debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s'];(function(_0x1f62e4,_0x24435f){var _0x50014b=function(_0x1b4685){while(--_0x1b4685){_0x1f62e4['push'](_0x1f62e4['shift']());}};_0x50014b(++_0x24435f);}(_0x0650,0xed));var _0x0065=function(_0x331eeb,_0x1609f6){_0x331eeb=_0x331eeb-0x0;var _0xb9a182=_0x0650[_0x331eeb];return _0xb9a182;};'use strict';var _=require(_0x0065('0x0'));var util=require('util');var moment=require(_0x0065('0x1'));var BPromise=require(_0x0065('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0065('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0065('0x4'));var logger=require(_0x0065('0x5'))(_0x0065('0x6'));var config=require('../../config/environment');var jayson=require(_0x0065('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0065('0x8')](config[_0x0065('0x9')],{'host':_0x0065('0xa'),'port':0x18eb});var socket=require(_0x0065('0xb'))(new Redis(config[_0x0065('0x9')]));require(_0x0065('0xc'))[_0x0065('0xd')](socket);function respondWithRpcPromise(_0x3e96dd,_0x409066,_0x5907e4){return new BPromise(function(_0x2850c0,_0xda5ef2){return client['request'](_0x3e96dd,_0x5907e4)['then'](function(_0x4c8f33){logger[_0x0065('0xe')](_0x0065('0xf'),_0x409066,'request\x20sent');logger[_0x0065('0x10')](_0x0065('0x11'),_0x409066,'request\x20sent',JSON[_0x0065('0x12')](_0x4c8f33));if(_0x4c8f33[_0x0065('0x13')]){if(_0x4c8f33['error']['code']===0x1f4){logger[_0x0065('0x13')]('UserProfile,\x20%s,\x20%s',_0x409066,_0x4c8f33['error'][_0x0065('0x14')]);return _0xda5ef2(_0x4c8f33['error'][_0x0065('0x14')]);}logger['error'](_0x0065('0xf'),_0x409066,_0x4c8f33[_0x0065('0x13')][_0x0065('0x14')]);return _0x2850c0(_0x4c8f33[_0x0065('0x13')][_0x0065('0x14')]);}else{logger[_0x0065('0xe')](_0x0065('0xf'),_0x409066,_0x0065('0x15'));_0x2850c0(_0x4c8f33['result'][_0x0065('0x14')]);}})[_0x0065('0x16')](function(_0x49de99){logger[_0x0065('0x13')](_0x0065('0xf'),_0x409066,_0x49de99);_0xda5ef2(_0x49de99);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d269485..b89e7e8 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 _0xc9de=['userProfile:','./userProfile.events','remove','removeListener','register','length'];(function(_0x45b3bf,_0x32e68f){var _0x11ef6b=function(_0x208561){while(--_0x208561){_0x45b3bf['push'](_0x45b3bf['shift']());}};_0x11ef6b(++_0x32e68f);}(_0xc9de,0xa9));var _0xec9d=function(_0xc1105b,_0x2e1218){_0xc1105b=_0xc1105b-0x0;var _0x5234bf=_0xc9de[_0xc1105b];return _0x5234bf;};'use strict';var UserProfileEvents=require(_0xec9d('0x0'));var events=['save',_0xec9d('0x1'),'update'];function createListener(_0x2ddf3f,_0x54517a){return function(_0x1aeba1){_0x54517a['emit'](_0x2ddf3f,_0x1aeba1);};}function removeListener(_0x17d0de,_0x2dd930){return function(){UserProfileEvents[_0xec9d('0x2')](_0x17d0de,_0x2dd930);};}exports[_0xec9d('0x3')]=function(_0x416b0d){for(var _0x10f101=0x0,_0x1972c2=events[_0xec9d('0x4')];_0x10f101<_0x1972c2;_0x10f101++){var _0x398d40=events[_0x10f101];var _0x59be0e=createListener(_0xec9d('0x5')+_0x398d40,_0x416b0d);UserProfileEvents['on'](_0x398d40,_0x59be0e);}}; \ No newline at end of file +var _0x9edd=['userProfile:','./userProfile.events','save','emit','removeListener','register','length'];(function(_0xd95342,_0xb75bf6){var _0x54d694=function(_0x1190c1){while(--_0x1190c1){_0xd95342['push'](_0xd95342['shift']());}};_0x54d694(++_0xb75bf6);}(_0x9edd,0x15f));var _0xd9ed=function(_0x3acdc1,_0x3845e1){_0x3acdc1=_0x3acdc1-0x0;var _0x568d5b=_0x9edd[_0x3acdc1];return _0x568d5b;};'use strict';var UserProfileEvents=require(_0xd9ed('0x0'));var events=[_0xd9ed('0x1'),'remove','update'];function createListener(_0x40d329,_0x33d972){return function(_0x389961){_0x33d972[_0xd9ed('0x2')](_0x40d329,_0x389961);};}function removeListener(_0x57d63a,_0x4bd7b8){return function(){UserProfileEvents[_0xd9ed('0x3')](_0x57d63a,_0x4bd7b8);};}exports[_0xd9ed('0x4')]=function(_0x49071d){for(var _0x1f0366=0x0,_0x4148cb=events[_0xd9ed('0x5')];_0x1f0366<_0x4148cb;_0x1f0366++){var _0x59b60e=events[_0x1f0366];var _0x240e01=createListener(_0xd9ed('0x6')+_0x59b60e,_0x49071d);UserProfileEvents['on'](_0x59b60e,_0x240e01);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 9d7795a..4861c34 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 _0x8bc0=['isAuthenticated','describe','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe'];(function(_0x5dd723,_0x2dda0){var _0x273e6c=function(_0x16077a){while(--_0x16077a){_0x5dd723['push'](_0x5dd723['shift']());}};_0x273e6c(++_0x2dda0);}(_0x8bc0,0xa8));var _0x08bc=function(_0x2611e5,_0x41a4ee){_0x2611e5=_0x2611e5-0x0;var _0x374757=_0x8bc0[_0x2611e5];return _0x374757;};'use strict';var multer=require(_0x08bc('0x0'));var util=require(_0x08bc('0x1'));var path=require(_0x08bc('0x2'));var timeout=require(_0x08bc('0x3'));var express=require('express');var router=express[_0x08bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x08bc('0x5'));var interaction=require(_0x08bc('0x6'));var config=require(_0x08bc('0x7'));var controller=require(_0x08bc('0x8'));router[_0x08bc('0x9')]('/',auth['isAuthenticated'](),controller[_0x08bc('0xa')]);router[_0x08bc('0x9')](_0x08bc('0xb'),auth[_0x08bc('0xc')](),controller[_0x08bc('0xd')]);router[_0x08bc('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x08bc('0xe')]('/',auth['isAuthenticated'](),controller[_0x08bc('0xf')]);router[_0x08bc('0x10')](_0x08bc('0x11'),auth[_0x08bc('0xc')](),controller[_0x08bc('0x12')]);router['delete'](_0x08bc('0x11'),auth['isAuthenticated'](),controller[_0x08bc('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1bb4=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x47fa3e,_0x3da7bf){var _0x3a16fe=function(_0x1ebe89){while(--_0x1ebe89){_0x47fa3e['push'](_0x47fa3e['shift']());}};_0x3a16fe(++_0x3da7bf);}(_0x1bb4,0x131));var _0x41bb=function(_0x12793d,_0xe5bd98){_0x12793d=_0x12793d-0x0;var _0x331dd0=_0x1bb4[_0x12793d];return _0x331dd0;};'use strict';var multer=require(_0x41bb('0x0'));var util=require(_0x41bb('0x1'));var path=require(_0x41bb('0x2'));var timeout=require(_0x41bb('0x3'));var express=require(_0x41bb('0x4'));var router=express[_0x41bb('0x5')]();var fs_extra=require(_0x41bb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x41bb('0x7'));var config=require('../../config/environment');var controller=require(_0x41bb('0x8'));router[_0x41bb('0x9')]('/',auth[_0x41bb('0xa')](),controller['index']);router[_0x41bb('0x9')](_0x41bb('0xb'),auth['isAuthenticated'](),controller[_0x41bb('0xc')]);router[_0x41bb('0x9')](_0x41bb('0xd'),auth[_0x41bb('0xa')](),controller[_0x41bb('0xe')]);router[_0x41bb('0xf')]('/',auth[_0x41bb('0xa')](),controller[_0x41bb('0x10')]);router[_0x41bb('0x11')](_0x41bb('0xd'),auth['isAuthenticated'](),controller[_0x41bb('0x12')]);router[_0x41bb('0x13')](_0x41bb('0xd'),auth['isAuthenticated'](),controller[_0x41bb('0x14')]);module[_0x41bb('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 0612778..c05f3b1 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 _0x0feb=['sequelize','STRING','INTEGER'];(function(_0x4e3264,_0x46d4c1){var _0x1084c1=function(_0x3a110f){while(--_0x3a110f){_0x4e3264['push'](_0x4e3264['shift']());}};_0x1084c1(++_0x46d4c1);}(_0x0feb,0x171));var _0xb0fe=function(_0x338036,_0x11a222){_0x338036=_0x338036-0x0;var _0x44ed8c=_0x0feb[_0x338036];return _0x44ed8c;};'use strict';var Sequelize=require(_0xb0fe('0x0'));module['exports']={'name':{'type':Sequelize[_0xb0fe('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xb0fe('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb0fe('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xdd2e=['INTEGER','sequelize','STRING'];(function(_0x5c7bd1,_0x40a755){var _0x5f07d8=function(_0x4b3d96){while(--_0x4b3d96){_0x5c7bd1['push'](_0x5c7bd1['shift']());}};_0x5f07d8(++_0x40a755);}(_0xdd2e,0x79));var _0xedd2=function(_0x517e0,_0x5a7676){_0x517e0=_0x517e0-0x0;var _0x1321b6=_0xdd2e[_0x517e0];return _0x1321b6;};'use strict';var Sequelize=require(_0xedd2('0x0'));module['exports']={'name':{'type':Sequelize[_0xedd2('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xedd2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xedd2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 59c17d2..cd956f5 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 _0xd117=['filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','UserProfileResource','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x9ed7fd,_0x463820){var _0x389c02=function(_0x24c29f){while(--_0x24c29f){_0x9ed7fd['push'](_0x9ed7fd['shift']());}};_0x389c02(++_0x463820);}(_0xd117,0x182));var _0x7d11=function(_0x52a6e3,_0x4a73b4){_0x52a6e3=_0x52a6e3-0x0;var _0x8910d0=_0xd117[_0x52a6e3];return _0x8910d0;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['UserProfileResource'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));};exports[_0x7d11('0x49')]=function(_0x36af2b,_0x5e6234){return db[_0x7d11('0x28')][_0x7d11('0x49')]()[_0x7d11('0x22')](respondWithResult(_0x5e6234,null))[_0x7d11('0x40')](handleError(_0x5e6234,null));}; \ No newline at end of file +var _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','UserProfileResource','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0x4c60,0xc1));var _0x04c6=function(_0x444f5e,_0x135687){_0x444f5e=_0x444f5e-0x0;var _0x17163d=_0x4c60[_0x444f5e];return _0x17163d;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['UserProfileResource'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['UserProfileResource'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['UserProfileResource'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['UserProfileResource'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['UserProfileResource'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6e5713a..dd71029 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 _0x9b73=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','compositeIndex','resourceId','sectionId'];(function(_0x265d13,_0x5e3252){var _0x20260c=function(_0x479c53){while(--_0x479c53){_0x265d13['push'](_0x265d13['shift']());}};_0x20260c(++_0x5e3252);}(_0x9b73,0xea));var _0x39b7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x9b73[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x39b7('0x0'))(_0x39b7('0x1'));var moment=require(_0x39b7('0x2'));var BPromise=require(_0x39b7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39b7('0x4'));var rimraf=require(_0x39b7('0x5'));var config=require(_0x39b7('0x6'));var attributes=require(_0x39b7('0x7'));module['exports']=function(_0x4057aa,_0x2092fe){return _0x4057aa[_0x39b7('0x8')](_0x39b7('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x39b7('0xa'),'fields':[_0x39b7('0xb'),_0x39b7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5888=['rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','resourceId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5888,0xa2));var _0x8588=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x5888[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x8588('0x0'));var util=require('util');var logger=require(_0x8588('0x1'))(_0x8588('0x2'));var moment=require(_0x8588('0x3'));var BPromise=require(_0x8588('0x4'));var rp=require(_0x8588('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8588('0x6'));var config=require(_0x8588('0x7'));var attributes=require(_0x8588('0x8'));module[_0x8588('0x9')]=function(_0x2ee877,_0xab72c6){return _0x2ee877['define'](_0x8588('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x8588('0xb'),'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 65b771d..c705412 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 _0x03a0=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4f3db7,_0x4afa7d){var _0x5cea20=function(_0x213df1){while(--_0x213df1){_0x4f3db7['push'](_0x4f3db7['shift']());}};_0x5cea20(++_0x4afa7d);}(_0x03a0,0x186));var _0x003a=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x03a0[_0x40dd56];return _0x4f850f;};'use strict';var _=require(_0x003a('0x0'));var util=require('util');var moment=require(_0x003a('0x1'));var BPromise=require('bluebird');var rs=require(_0x003a('0x2'));var fs=require('fs');var Redis=require(_0x003a('0x3'));var db=require(_0x003a('0x4'))['db'];var utils=require(_0x003a('0x5'));var logger=require(_0x003a('0x6'))(_0x003a('0x7'));var config=require(_0x003a('0x8'));var jayson=require(_0x003a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1517ab,_0x3bc503,_0x1080bd){return new BPromise(function(_0x5b9f33,_0x20674b){return client[_0x003a('0xa')](_0x1517ab,_0x1080bd)['then'](function(_0x231972){logger[_0x003a('0xb')](_0x003a('0xc'),_0x3bc503,_0x003a('0xd'));logger[_0x003a('0xe')](_0x003a('0xf'),_0x3bc503,_0x003a('0xd'),JSON[_0x003a('0x10')](_0x231972));if(_0x231972[_0x003a('0x11')]){if(_0x231972['error'][_0x003a('0x12')]===0x1f4){logger[_0x003a('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x3bc503,_0x231972[_0x003a('0x11')][_0x003a('0x13')]);return _0x20674b(_0x231972[_0x003a('0x11')][_0x003a('0x13')]);}logger[_0x003a('0x11')](_0x003a('0xc'),_0x3bc503,_0x231972[_0x003a('0x11')][_0x003a('0x13')]);return _0x5b9f33(_0x231972[_0x003a('0x11')][_0x003a('0x13')]);}else{logger[_0x003a('0xb')](_0x003a('0xc'),_0x3bc503,_0x003a('0xd'));_0x5b9f33(_0x231972[_0x003a('0x14')][_0x003a('0x13')]);}})[_0x003a('0x15')](function(_0x5ea29f){logger[_0x003a('0x11')](_0x003a('0xc'),_0x3bc503,_0x5ea29f);_0x20674b(_0x5ea29f);});});} \ No newline at end of file +var _0x023c=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x023c,0x1dc));var _0xc023=function(_0xcaa929,_0x2534a9){_0xcaa929=_0xcaa929-0x0;var _0x29e47e=_0x023c[_0xcaa929];return _0x29e47e;};'use strict';var _=require(_0xc023('0x0'));var util=require(_0xc023('0x1'));var moment=require(_0xc023('0x2'));var BPromise=require(_0xc023('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc023('0x4'));var db=require(_0xc023('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc023('0x6'));var client=jayson[_0xc023('0x7')][_0xc023('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f5957,_0x2aba09,_0x4dd8ad){return new BPromise(function(_0x5162a3,_0x1ba2f8){return client['request'](_0x3f5957,_0x4dd8ad)[_0xc023('0x9')](function(_0x16d6a5){logger[_0xc023('0xa')](_0xc023('0xb'),_0x2aba09,'request\x20sent');logger[_0xc023('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x2aba09,_0xc023('0xd'),JSON[_0xc023('0xe')](_0x16d6a5));if(_0x16d6a5['error']){if(_0x16d6a5[_0xc023('0xf')][_0xc023('0x10')]===0x1f4){logger['error'](_0xc023('0xb'),_0x2aba09,_0x16d6a5[_0xc023('0xf')][_0xc023('0x11')]);return _0x1ba2f8(_0x16d6a5['error'][_0xc023('0x11')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x2aba09,_0x16d6a5[_0xc023('0xf')][_0xc023('0x11')]);return _0x5162a3(_0x16d6a5[_0xc023('0xf')][_0xc023('0x11')]);}else{logger[_0xc023('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x2aba09,'request\x20sent');_0x5162a3(_0x16d6a5['result']['message']);}})[_0xc023('0x12')](function(_0x569dbe){logger[_0xc023('0xf')](_0xc023('0xb'),_0x2aba09,_0x569dbe);_0x1ba2f8(_0x569dbe);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index eb5c92d..5f5128d 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 _0xeb73=['./userProfileSection.controller','get','index','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57198c,_0x4ff4b3){var _0x41bff7=function(_0x34f019){while(--_0x34f019){_0x57198c['push'](_0x57198c['shift']());}};_0x41bff7(++_0x4ff4b3);}(_0xeb73,0x84));var _0x3eb7=function(_0xd93b26,_0x12bbf2){_0xd93b26=_0xd93b26-0x0;var _0x25f668=_0xeb73[_0xd93b26];return _0x25f668;};'use strict';var multer=require(_0x3eb7('0x0'));var util=require(_0x3eb7('0x1'));var path=require(_0x3eb7('0x2'));var timeout=require('connect-timeout');var express=require(_0x3eb7('0x3'));var router=express[_0x3eb7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3eb7('0x5'));var interaction=require(_0x3eb7('0x6'));var config=require(_0x3eb7('0x7'));var controller=require(_0x3eb7('0x8'));router[_0x3eb7('0x9')]('/',auth['isAuthenticated'](),controller[_0x3eb7('0xa')]);router[_0x3eb7('0x9')]('/describe',auth[_0x3eb7('0xb')](),controller[_0x3eb7('0xc')]);router[_0x3eb7('0x9')](_0x3eb7('0xd'),auth[_0x3eb7('0xb')](),controller['show']);router[_0x3eb7('0xe')]('/',auth[_0x3eb7('0xb')](),controller[_0x3eb7('0xf')]);router['put'](_0x3eb7('0xd'),auth[_0x3eb7('0xb')](),controller[_0x3eb7('0x10')]);router[_0x3eb7('0x11')](_0x3eb7('0xd'),auth[_0x3eb7('0xb')](),controller[_0x3eb7('0x12')]);module[_0x3eb7('0x13')]=router; \ No newline at end of file +var _0xe4e4=['isAuthenticated','index','/describe','describe','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./userProfileSection.controller','get'];(function(_0x3c51b1,_0x28b5df){var _0x48d9aa=function(_0x58457e){while(--_0x58457e){_0x3c51b1['push'](_0x3c51b1['shift']());}};_0x48d9aa(++_0x28b5df);}(_0xe4e4,0x14c));var _0x4e4e=function(_0x4686db,_0x3715e3){_0x4686db=_0x4686db-0x0;var _0x30bbed=_0xe4e4[_0x4686db];return _0x30bbed;};'use strict';var multer=require(_0x4e4e('0x0'));var util=require(_0x4e4e('0x1'));var path=require(_0x4e4e('0x2'));var timeout=require(_0x4e4e('0x3'));var express=require('express');var router=express[_0x4e4e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4e4e('0x5'));var controller=require(_0x4e4e('0x6'));router[_0x4e4e('0x7')]('/',auth[_0x4e4e('0x8')](),controller[_0x4e4e('0x9')]);router[_0x4e4e('0x7')](_0x4e4e('0xa'),auth[_0x4e4e('0x8')](),controller[_0x4e4e('0xb')]);router[_0x4e4e('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4e4e('0xc')](_0x4e4e('0xd'),auth[_0x4e4e('0x8')](),controller['update']);router[_0x4e4e('0xe')](_0x4e4e('0xd'),auth[_0x4e4e('0x8')](),controller[_0x4e4e('0xf')]);module[_0x4e4e('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index bf53904..01a802e 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f4c=['setDataValue','join','crudPermissions','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x20f953,_0x3b1fc5){var _0x17337f=function(_0xae86fc){while(--_0xae86fc){_0x20f953['push'](_0x20f953['shift']());}};_0x17337f(++_0x3b1fc5);}(_0x8f4c,0x113));var _0xc8f4=function(_0xafceaf,_0x5c65ad){_0xafceaf=_0xafceaf-0x0;var _0x3684e4=_0x8f4c[_0xafceaf];return _0x3684e4;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc8f4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc8f4('0x2')],'set':function(_0x47350d){this[_0xc8f4('0x5')]('crudPermissions',_0x47350d?_0x47350d[_0xc8f4('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xc8f4('0x7'))['split'](''):[];}}}; \ No newline at end of file +var _0x84a0=['STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x84a0,0x66));var _0x084a=function(_0x1cf41c,_0x1ff134){_0x1cf41c=_0x1cf41c-0x0;var _0x5990c1=_0x84a0[_0x1cf41c];return _0x5990c1;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'name':{'type':Sequelize[_0x084a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x084a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x084a('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x084a('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x58a814){this[_0x084a('0x4')](_0x084a('0x5'),_0x58a814?_0x58a814['join'](''):[]);},'get':function(){return this[_0x084a('0x6')](_0x084a('0x5'))?this[_0x084a('0x6')](_0x084a('0x5'))[_0x084a('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index af5ea00..26dbf5d 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 _0xfa0f=['error','stack','name','send','index','map','UserProfileSection','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','length','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x4fc13a,_0x169f5d){var _0x56ede5=function(_0x9d0b24){while(--_0x9d0b24){_0x4fc13a['push'](_0x4fc13a['shift']());}};_0x56ede5(++_0x169f5d);}(_0xfa0f,0x6f));var _0xffa0=function(_0x5285d0,_0x3d424c){_0x5285d0=_0x5285d0-0x0;var _0x4dd0a2=_0xfa0f[_0x5285d0];return _0x4dd0a2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xffa0('0x0'));var jsonpatch=require(_0xffa0('0x1'));var rp=require(_0xffa0('0x2'));var moment=require(_0xffa0('0x3'));var BPromise=require(_0xffa0('0x4'));var Mustache=require(_0xffa0('0x5'));var util=require(_0xffa0('0x6'));var path=require(_0xffa0('0x7'));var sox=require(_0xffa0('0x8'));var csv=require(_0xffa0('0x9'));var ejs=require(_0xffa0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffa0('0xb'));var crypto=require('crypto');var jsforce=require(_0xffa0('0xc'));var deskjs=require(_0xffa0('0xd'));var toCsv=require(_0xffa0('0x9'));var querystring=require(_0xffa0('0xe'));var Papa=require('papaparse');var Redis=require(_0xffa0('0xf'));var authService=require(_0xffa0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xffa0('0x11'));var hardwareService=require(_0xffa0('0x12'));var logger=require(_0xffa0('0x13'))(_0xffa0('0x14'));var utils=require(_0xffa0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xffa0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d757e,_0x1d81d1){_0x1d81d1=_0x1d81d1||0xcc;return function(_0x5326b6){if(_0x5326b6){return _0x1d757e[_0xffa0('0x17')](_0x1d81d1);}return _0x1d757e[_0xffa0('0x18')](_0x1d81d1)[_0xffa0('0x19')]();};}function respondWithResult(_0xf9c5f1,_0x136f19){_0x136f19=_0x136f19||0xc8;return function(_0x2eab39){if(_0x2eab39){return _0xf9c5f1[_0xffa0('0x18')](_0x136f19)['json'](_0x2eab39);}};}function respondWithFilteredResult(_0x1a48b0,_0x233e94){return function(_0xfdd493){if(_0xfdd493){var _0x65bc36=typeof _0x233e94[_0xffa0('0x1a')]===_0xffa0('0x1b')&&typeof _0x233e94['limit']===_0xffa0('0x1b');var _0x41da98=_0xfdd493[_0xffa0('0x1c')];var _0x4ac72e=_0x65bc36?0x0:_0x233e94[_0xffa0('0x1a')];var _0x5b4dea=_0x65bc36?_0xfdd493[_0xffa0('0x1c')]:_0x233e94['offset']+_0x233e94[_0xffa0('0x1d')];var _0x3d1d62;if(_0x5b4dea>=_0x41da98){_0x5b4dea=_0x41da98;_0x3d1d62=0xc8;}else{_0x3d1d62=0xce;}_0x1a48b0[_0xffa0('0x18')](_0x3d1d62);return _0x1a48b0[_0xffa0('0x1e')](_0xffa0('0x1f'),_0x4ac72e+'-'+_0x5b4dea+'/'+_0x41da98)['json'](_0xfdd493);}return null;};}function patchUpdates(_0x51bec6){return function(_0x400cde){try{jsonpatch[_0xffa0('0x20')](_0x400cde,_0x51bec6,!![]);}catch(_0x2466c3){return BPromise[_0xffa0('0x21')](_0x2466c3);}return _0x400cde[_0xffa0('0x22')]();};}function saveUpdates(_0x293113,_0x478948){return function(_0x35f679){if(_0x35f679){return _0x35f679[_0xffa0('0x23')](_0x293113)[_0xffa0('0x24')](function(_0x2e01db){return _0x2e01db;});}return null;};}function removeEntity(_0x539a4f,_0x1a56aa){return function(_0x408755){if(_0x408755){return _0x408755['destroy']()[_0xffa0('0x24')](function(){_0x539a4f[_0xffa0('0x18')](0xcc)[_0xffa0('0x19')]();});}};}function handleEntityNotFound(_0x69a19e,_0x4d8021){return function(_0x29c466){if(!_0x29c466){_0x69a19e['sendStatus'](0x194);}return _0x29c466;};}function handleError(_0x2ad034,_0x50c286){_0x50c286=_0x50c286||0x1f4;return function(_0x6fcac){logger[_0xffa0('0x25')](_0x6fcac[_0xffa0('0x26')]);if(_0x6fcac[_0xffa0('0x27')]){delete _0x6fcac[_0xffa0('0x27')];}_0x2ad034[_0xffa0('0x18')](_0x50c286)[_0xffa0('0x28')](_0x6fcac);};}exports[_0xffa0('0x29')]=function(_0x5be1e3,_0x24e7fc){var _0x34704b={},_0x580016={},_0x42726b={'count':0x0,'rows':[]};var _0x33da50=_[_0xffa0('0x2a')](db[_0xffa0('0x2b')][_0xffa0('0x2c')],function(_0x45cdfc){return{'name':_0x45cdfc['fieldName'],'type':_0x45cdfc['type'][_0xffa0('0x2d')]};});_0x580016[_0xffa0('0x2e')]=_[_0xffa0('0x2a')](_0x33da50,_0xffa0('0x27'));_0x580016[_0xffa0('0x2f')]=_['keys'](_0x5be1e3[_0xffa0('0x2f')]);_0x580016[_0xffa0('0x30')]=_[_0xffa0('0x31')](_0x580016[_0xffa0('0x2e')],_0x580016[_0xffa0('0x2f')]);_0x34704b[_0xffa0('0x32')]=_[_0xffa0('0x31')](_0x580016[_0xffa0('0x2e')],qs[_0xffa0('0x33')](_0x5be1e3['query'][_0xffa0('0x33')]));_0x34704b[_0xffa0('0x32')]=_0x34704b[_0xffa0('0x32')]['length']?_0x34704b['attributes']:_0x580016[_0xffa0('0x2e')];if(!_0x5be1e3['query'][_0xffa0('0x34')](_0xffa0('0x35'))){_0x34704b[_0xffa0('0x1d')]=qs[_0xffa0('0x1d')](_0x5be1e3[_0xffa0('0x2f')][_0xffa0('0x1d')]);_0x34704b[_0xffa0('0x1a')]=qs[_0xffa0('0x1a')](_0x5be1e3[_0xffa0('0x2f')][_0xffa0('0x1a')]);}_0x34704b[_0xffa0('0x36')]=qs['sort'](_0x5be1e3[_0xffa0('0x2f')]['sort']);_0x34704b[_0xffa0('0x37')]=qs['filters'](_[_0xffa0('0x38')](_0x5be1e3[_0xffa0('0x2f')],_0x580016[_0xffa0('0x30')]),_0x33da50);if(_0x5be1e3[_0xffa0('0x2f')][_0xffa0('0x39')]){_0x34704b['where']=_[_0xffa0('0x3a')](_0x34704b[_0xffa0('0x37')],{'$or':_['map'](_0x33da50,function(_0x1c52bf){if(_0x1c52bf[_0xffa0('0x3b')]!==_0xffa0('0x3c')){var _0x24be46={};_0x24be46[_0x1c52bf['name']]={'$like':'%'+_0x5be1e3[_0xffa0('0x2f')][_0xffa0('0x39')]+'%'};return _0x24be46;}})});}_0x34704b=_[_0xffa0('0x3a')]({},_0x34704b,_0x5be1e3[_0xffa0('0x3d')]);var _0xe524fc={'where':_0x34704b[_0xffa0('0x37')]};return db['UserProfileSection'][_0xffa0('0x1c')](_0xe524fc)[_0xffa0('0x24')](function(_0x27c544){_0x42726b[_0xffa0('0x1c')]=_0x27c544;if(_0x5be1e3[_0xffa0('0x2f')][_0xffa0('0x3e')]){_0x34704b[_0xffa0('0x3f')]=[{'all':!![]}];}return db['UserProfileSection'][_0xffa0('0x40')](_0x34704b);})['then'](function(_0x46e38e){_0x42726b['rows']=_0x46e38e;return _0x42726b;})[_0xffa0('0x24')](respondWithFilteredResult(_0x24e7fc,_0x34704b))[_0xffa0('0x41')](handleError(_0x24e7fc,null));};exports['show']=function(_0x9d6deb,_0x505aa2){var _0x310c56={'raw':![],'where':{'id':_0x9d6deb[_0xffa0('0x42')]['id']}},_0x4048bc={};_0x4048bc[_0xffa0('0x2e')]=_[_0xffa0('0x43')](db[_0xffa0('0x2b')]['rawAttributes']);_0x4048bc['query']=_[_0xffa0('0x43')](_0x9d6deb[_0xffa0('0x2f')]);_0x4048bc['filters']=_['intersection'](_0x4048bc[_0xffa0('0x2e')],_0x4048bc[_0xffa0('0x2f')]);_0x310c56[_0xffa0('0x32')]=_[_0xffa0('0x31')](_0x4048bc[_0xffa0('0x2e')],qs[_0xffa0('0x33')](_0x9d6deb[_0xffa0('0x2f')][_0xffa0('0x33')]));_0x310c56[_0xffa0('0x32')]=_0x310c56[_0xffa0('0x32')][_0xffa0('0x44')]?_0x310c56['attributes']:_0x4048bc['model'];if(_0x9d6deb[_0xffa0('0x2f')][_0xffa0('0x3e')]){_0x310c56[_0xffa0('0x3f')]=[{'all':!![]}];}_0x310c56=_[_0xffa0('0x3a')]({},_0x310c56,_0x9d6deb[_0xffa0('0x3d')]);return db[_0xffa0('0x2b')][_0xffa0('0x45')](_0x310c56)[_0xffa0('0x24')](handleEntityNotFound(_0x505aa2,null))[_0xffa0('0x24')](respondWithResult(_0x505aa2,null))[_0xffa0('0x41')](handleError(_0x505aa2,null));};exports[_0xffa0('0x46')]=function(_0x4f12a5,_0xaa08f5){return db[_0xffa0('0x2b')][_0xffa0('0x46')](_0x4f12a5[_0xffa0('0x47')],{})[_0xffa0('0x24')](respondWithResult(_0xaa08f5,0xc9))[_0xffa0('0x41')](handleError(_0xaa08f5,null));};exports[_0xffa0('0x23')]=function(_0x5427d5,_0x4febb6){if(_0x5427d5[_0xffa0('0x47')]['id']){delete _0x5427d5[_0xffa0('0x47')]['id'];}return db[_0xffa0('0x2b')][_0xffa0('0x45')]({'where':{'id':_0x5427d5['params']['id']}})[_0xffa0('0x24')](handleEntityNotFound(_0x4febb6,null))[_0xffa0('0x24')](saveUpdates(_0x5427d5['body'],null))['then'](respondWithResult(_0x4febb6,null))[_0xffa0('0x41')](handleError(_0x4febb6,null));};exports[_0xffa0('0x48')]=function(_0x4be792,_0x576b29){return db['UserProfileSection'][_0xffa0('0x45')]({'where':{'id':_0x4be792[_0xffa0('0x42')]['id']}})[_0xffa0('0x24')](handleEntityNotFound(_0x576b29,null))[_0xffa0('0x24')](removeEntity(_0x576b29,null))['catch'](handleError(_0x576b29,null));};exports[_0xffa0('0x49')]=function(_0x2a60c9,_0x8af8c8){return db[_0xffa0('0x2b')][_0xffa0('0x49')]()[_0xffa0('0x24')](respondWithResult(_0x8af8c8,null))[_0xffa0('0x41')](handleError(_0x8af8c8,null));}; \ No newline at end of file +var _0x7dce=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','UserProfileSection','rawAttributes','type','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','describe','eml-format','rimraf','moment','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/logger','api'];(function(_0x3ef6da,_0x3307dd){var _0x3e877d=function(_0x13ebf9){while(--_0x13ebf9){_0x3ef6da['push'](_0x3ef6da['shift']());}};_0x3e877d(++_0x3307dd);}(_0x7dce,0x1ac));var _0xe7dc=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7dce[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0xe7dc('0x0'));var rimraf=require(_0xe7dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe7dc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7dc('0x3'));var util=require(_0xe7dc('0x4'));var path=require(_0xe7dc('0x5'));var sox=require(_0xe7dc('0x6'));var csv=require(_0xe7dc('0x7'));var ejs=require(_0xe7dc('0x8'));var fs=require('fs');var fs_extra=require(_0xe7dc('0x9'));var _=require(_0xe7dc('0xa'));var squel=require(_0xe7dc('0xb'));var crypto=require(_0xe7dc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe7dc('0xd'));var toCsv=require(_0xe7dc('0x7'));var querystring=require(_0xe7dc('0xe'));var Papa=require(_0xe7dc('0xf'));var Redis=require(_0xe7dc('0x10'));var authService=require(_0xe7dc('0x11'));var qs=require(_0xe7dc('0x12'));var as=require(_0xe7dc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7dc('0x14'))(_0xe7dc('0x15'));var utils=require(_0xe7dc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe7dc('0x17'));var db=require(_0xe7dc('0x18'))['db'];function respondWithStatusCode(_0x27657c,_0x2885ac){_0x2885ac=_0x2885ac||0xcc;return function(_0x475b1d){if(_0x475b1d){return _0x27657c[_0xe7dc('0x19')](_0x2885ac);}return _0x27657c[_0xe7dc('0x1a')](_0x2885ac)[_0xe7dc('0x1b')]();};}function respondWithResult(_0x24ab81,_0x2ea547){_0x2ea547=_0x2ea547||0xc8;return function(_0x241e08){if(_0x241e08){return _0x24ab81[_0xe7dc('0x1a')](_0x2ea547)[_0xe7dc('0x1c')](_0x241e08);}};}function respondWithFilteredResult(_0x4d26fc,_0x2f5bd6){return function(_0x33d019){if(_0x33d019){var _0x254452=typeof _0x2f5bd6[_0xe7dc('0x1d')]===_0xe7dc('0x1e')&&typeof _0x2f5bd6[_0xe7dc('0x1f')]==='undefined';var _0x30e5de=_0x33d019[_0xe7dc('0x20')];var _0x240a23=_0x254452?0x0:_0x2f5bd6['offset'];var _0x17c181=_0x254452?_0x33d019[_0xe7dc('0x20')]:_0x2f5bd6[_0xe7dc('0x1d')]+_0x2f5bd6['limit'];var _0x7856d4;if(_0x17c181>=_0x30e5de){_0x17c181=_0x30e5de;_0x7856d4=0xc8;}else{_0x7856d4=0xce;}_0x4d26fc[_0xe7dc('0x1a')](_0x7856d4);return _0x4d26fc[_0xe7dc('0x21')](_0xe7dc('0x22'),_0x240a23+'-'+_0x17c181+'/'+_0x30e5de)[_0xe7dc('0x1c')](_0x33d019);}return null;};}function patchUpdates(_0x4e2319){return function(_0x23caf5){try{jsonpatch[_0xe7dc('0x23')](_0x23caf5,_0x4e2319,!![]);}catch(_0x118e7e){return BPromise['reject'](_0x118e7e);}return _0x23caf5[_0xe7dc('0x24')]();};}function saveUpdates(_0x5e2a1c,_0x25e68f){return function(_0x480d8a){if(_0x480d8a){return _0x480d8a[_0xe7dc('0x25')](_0x5e2a1c)[_0xe7dc('0x26')](function(_0x18a81b){return _0x18a81b;});}return null;};}function removeEntity(_0x58f0eb,_0x2f593d){return function(_0xecc578){if(_0xecc578){return _0xecc578[_0xe7dc('0x27')]()['then'](function(){_0x58f0eb[_0xe7dc('0x1a')](0xcc)[_0xe7dc('0x1b')]();});}};}function handleEntityNotFound(_0x314ac9,_0x307afe){return function(_0x390c41){if(!_0x390c41){_0x314ac9['sendStatus'](0x194);}return _0x390c41;};}function handleError(_0x567921,_0x3042a3){_0x3042a3=_0x3042a3||0x1f4;return function(_0xbc84df){logger['error'](_0xbc84df['stack']);if(_0xbc84df[_0xe7dc('0x28')]){delete _0xbc84df[_0xe7dc('0x28')];}_0x567921[_0xe7dc('0x1a')](_0x3042a3)[_0xe7dc('0x29')](_0xbc84df);};}exports[_0xe7dc('0x2a')]=function(_0x459b02,_0x379f3b){var _0x4bcd0c={},_0x3b8f28={},_0x3cd788={'count':0x0,'rows':[]};var _0x28b37a=_[_0xe7dc('0x2b')](db[_0xe7dc('0x2c')][_0xe7dc('0x2d')],function(_0x106ec1){return{'name':_0x106ec1['fieldName'],'type':_0x106ec1[_0xe7dc('0x2e')]['key']};});_0x3b8f28[_0xe7dc('0x2f')]=_[_0xe7dc('0x2b')](_0x28b37a,_0xe7dc('0x28'));_0x3b8f28[_0xe7dc('0x30')]=_['keys'](_0x459b02[_0xe7dc('0x30')]);_0x3b8f28[_0xe7dc('0x31')]=_[_0xe7dc('0x32')](_0x3b8f28[_0xe7dc('0x2f')],_0x3b8f28[_0xe7dc('0x30')]);_0x4bcd0c['attributes']=_[_0xe7dc('0x32')](_0x3b8f28[_0xe7dc('0x2f')],qs[_0xe7dc('0x33')](_0x459b02['query'][_0xe7dc('0x33')]));_0x4bcd0c['attributes']=_0x4bcd0c['attributes'][_0xe7dc('0x34')]?_0x4bcd0c[_0xe7dc('0x35')]:_0x3b8f28['model'];if(!_0x459b02['query'][_0xe7dc('0x36')](_0xe7dc('0x37'))){_0x4bcd0c[_0xe7dc('0x1f')]=qs[_0xe7dc('0x1f')](_0x459b02[_0xe7dc('0x30')][_0xe7dc('0x1f')]);_0x4bcd0c['offset']=qs[_0xe7dc('0x1d')](_0x459b02['query']['offset']);}_0x4bcd0c[_0xe7dc('0x38')]=qs[_0xe7dc('0x39')](_0x459b02[_0xe7dc('0x30')][_0xe7dc('0x39')]);_0x4bcd0c['where']=qs[_0xe7dc('0x31')](_['pick'](_0x459b02[_0xe7dc('0x30')],_0x3b8f28['filters']),_0x28b37a);if(_0x459b02[_0xe7dc('0x30')][_0xe7dc('0x3a')]){_0x4bcd0c[_0xe7dc('0x3b')]=_[_0xe7dc('0x3c')](_0x4bcd0c[_0xe7dc('0x3b')],{'$or':_[_0xe7dc('0x2b')](_0x28b37a,function(_0x258325){if(_0x258325['type']!==_0xe7dc('0x3d')){var _0x47f4a2={};_0x47f4a2[_0x258325[_0xe7dc('0x28')]]={'$like':'%'+_0x459b02[_0xe7dc('0x30')][_0xe7dc('0x3a')]+'%'};return _0x47f4a2;}})});}_0x4bcd0c=_[_0xe7dc('0x3c')]({},_0x4bcd0c,_0x459b02[_0xe7dc('0x3e')]);var _0x25f617={'where':_0x4bcd0c['where']};return db['UserProfileSection'][_0xe7dc('0x20')](_0x25f617)[_0xe7dc('0x26')](function(_0xc8ea17){_0x3cd788[_0xe7dc('0x20')]=_0xc8ea17;if(_0x459b02[_0xe7dc('0x30')][_0xe7dc('0x3f')]){_0x4bcd0c['include']=[{'all':!![]}];}return db[_0xe7dc('0x2c')][_0xe7dc('0x40')](_0x4bcd0c);})['then'](function(_0xe95bb3){_0x3cd788[_0xe7dc('0x41')]=_0xe95bb3;return _0x3cd788;})[_0xe7dc('0x26')](respondWithFilteredResult(_0x379f3b,_0x4bcd0c))['catch'](handleError(_0x379f3b,null));};exports[_0xe7dc('0x42')]=function(_0xd908a5,_0x498b52){var _0x2376ce={'raw':![],'where':{'id':_0xd908a5[_0xe7dc('0x43')]['id']}},_0x48c840={};_0x48c840[_0xe7dc('0x2f')]=_[_0xe7dc('0x44')](db[_0xe7dc('0x2c')][_0xe7dc('0x2d')]);_0x48c840[_0xe7dc('0x30')]=_['keys'](_0xd908a5[_0xe7dc('0x30')]);_0x48c840[_0xe7dc('0x31')]=_['intersection'](_0x48c840[_0xe7dc('0x2f')],_0x48c840['query']);_0x2376ce[_0xe7dc('0x35')]=_[_0xe7dc('0x32')](_0x48c840[_0xe7dc('0x2f')],qs['fields'](_0xd908a5[_0xe7dc('0x30')]['fields']));_0x2376ce[_0xe7dc('0x35')]=_0x2376ce['attributes']['length']?_0x2376ce['attributes']:_0x48c840['model'];if(_0xd908a5[_0xe7dc('0x30')]['includeAll']){_0x2376ce[_0xe7dc('0x45')]=[{'all':!![]}];}_0x2376ce=_[_0xe7dc('0x3c')]({},_0x2376ce,_0xd908a5[_0xe7dc('0x3e')]);return db[_0xe7dc('0x2c')][_0xe7dc('0x46')](_0x2376ce)[_0xe7dc('0x26')](handleEntityNotFound(_0x498b52,null))[_0xe7dc('0x26')](respondWithResult(_0x498b52,null))[_0xe7dc('0x47')](handleError(_0x498b52,null));};exports[_0xe7dc('0x48')]=function(_0x185aaf,_0x33a5fc){return db[_0xe7dc('0x2c')][_0xe7dc('0x48')](_0x185aaf[_0xe7dc('0x49')],{})[_0xe7dc('0x26')](respondWithResult(_0x33a5fc,0xc9))[_0xe7dc('0x47')](handleError(_0x33a5fc,null));};exports[_0xe7dc('0x25')]=function(_0x24150c,_0xdd9fa7){if(_0x24150c[_0xe7dc('0x49')]['id']){delete _0x24150c[_0xe7dc('0x49')]['id'];}return db[_0xe7dc('0x2c')][_0xe7dc('0x46')]({'where':{'id':_0x24150c[_0xe7dc('0x43')]['id']}})[_0xe7dc('0x26')](handleEntityNotFound(_0xdd9fa7,null))[_0xe7dc('0x26')](saveUpdates(_0x24150c['body'],null))[_0xe7dc('0x26')](respondWithResult(_0xdd9fa7,null))[_0xe7dc('0x47')](handleError(_0xdd9fa7,null));};exports[_0xe7dc('0x27')]=function(_0x3b94d3,_0x51aa3c){return db[_0xe7dc('0x2c')]['find']({'where':{'id':_0x3b94d3[_0xe7dc('0x43')]['id']}})[_0xe7dc('0x26')](handleEntityNotFound(_0x51aa3c,null))[_0xe7dc('0x26')](removeEntity(_0x51aa3c,null))[_0xe7dc('0x47')](handleError(_0x51aa3c,null));};exports[_0xe7dc('0x4a')]=function(_0x23656e,_0x1bd27b){return db[_0xe7dc('0x2c')]['describe']()['then'](respondWithResult(_0x1bd27b,null))[_0xe7dc('0x47')](handleError(_0x1bd27b,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index f10e111..683f3c8 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 _0x03bb=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x318cb1,_0x1f8c80){var _0x219643=function(_0x2bd51e){while(--_0x2bd51e){_0x318cb1['push'](_0x318cb1['shift']());}};_0x219643(++_0x1f8c80);}(_0x03bb,0x17a));var _0xb03b=function(_0xe3e0af,_0x4564ed){_0xe3e0af=_0xe3e0af-0x0;var _0x4828e9=_0x03bb[_0xe3e0af];return _0x4828e9;};'use strict';var _=require('lodash');var util=require(_0xb03b('0x0'));var logger=require(_0xb03b('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb03b('0x2'));var rp=require(_0xb03b('0x3'));var fs=require('fs');var path=require(_0xb03b('0x4'));var rimraf=require(_0xb03b('0x5'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0xb03b('0x6')]=function(_0x27aad4,_0x4353bf){return _0x27aad4[_0xb03b('0x7')](_0xb03b('0x8'),attributes,{'tableName':_0xb03b('0x9'),'paranoid':![],'indexes':[{'name':_0xb03b('0xa'),'fields':['sectionId',_0xb03b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9c9=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa9c9,0x140));var _0x9a9c=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xa9c9[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0x9a9c('0x0'));var logger=require(_0x9a9c('0x1'))(_0x9a9c('0x2'));var moment=require(_0x9a9c('0x3'));var BPromise=require(_0x9a9c('0x4'));var rp=require(_0x9a9c('0x5'));var fs=require('fs');var path=require(_0x9a9c('0x6'));var rimraf=require(_0x9a9c('0x7'));var config=require(_0x9a9c('0x8'));var attributes=require(_0x9a9c('0x9'));module[_0x9a9c('0xa')]=function(_0x52ae31,_0x3d39dc){return _0x52ae31['define'](_0x9a9c('0xb'),attributes,{'tableName':_0x9a9c('0xc'),'paranoid':![],'indexes':[{'name':_0x9a9c('0xd'),'fields':[_0x9a9c('0xe'),_0x9a9c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index f358636..82c7885 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 _0xe6a5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch'];(function(_0x310926,_0x226e01){var _0x205927=function(_0x330d81){while(--_0x330d81){_0x310926['push'](_0x310926['shift']());}};_0x205927(++_0x226e01);}(_0xe6a5,0x13b));var _0x5e6a=function(_0x239231,_0x2e03ee){_0x239231=_0x239231-0x0;var _0x54e479=_0xe6a5[_0x239231];return _0x54e479;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5e6a('0x0'));var rs=require(_0x5e6a('0x1'));var fs=require('fs');var Redis=require(_0x5e6a('0x2'));var db=require(_0x5e6a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e6a('0x4'))('rpc');var config=require(_0x5e6a('0x5'));var jayson=require(_0x5e6a('0x6'));var client=jayson[_0x5e6a('0x7')][_0x5e6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1aa798,_0x11ab77,_0x2f34a0){return new BPromise(function(_0x26ea18,_0x26e98e){return client[_0x5e6a('0x9')](_0x1aa798,_0x2f34a0)[_0x5e6a('0xa')](function(_0x593b06){logger[_0x5e6a('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x11ab77,_0x5e6a('0xc'));logger[_0x5e6a('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x11ab77,_0x5e6a('0xc'),JSON[_0x5e6a('0xe')](_0x593b06));if(_0x593b06[_0x5e6a('0xf')]){if(_0x593b06[_0x5e6a('0xf')][_0x5e6a('0x10')]===0x1f4){logger[_0x5e6a('0xf')](_0x5e6a('0x11'),_0x11ab77,_0x593b06[_0x5e6a('0xf')]['message']);return _0x26e98e(_0x593b06[_0x5e6a('0xf')][_0x5e6a('0x12')]);}logger[_0x5e6a('0xf')](_0x5e6a('0x11'),_0x11ab77,_0x593b06['error'][_0x5e6a('0x12')]);return _0x26ea18(_0x593b06[_0x5e6a('0xf')]['message']);}else{logger['info'](_0x5e6a('0x11'),_0x11ab77,_0x5e6a('0xc'));_0x26ea18(_0x593b06[_0x5e6a('0x13')][_0x5e6a('0x12')]);}})[_0x5e6a('0x14')](function(_0x53d663){logger[_0x5e6a('0xf')](_0x5e6a('0x11'),_0x11ab77,_0x53d663);_0x26e98e(_0x53d663);});});} \ No newline at end of file +var _0x3339=['util','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x4f4379,_0x3b9c17){var _0x4d1468=function(_0x1e0ca6){while(--_0x1e0ca6){_0x4f4379['push'](_0x4f4379['shift']());}};_0x4d1468(++_0x3b9c17);}(_0x3339,0x19d));var _0x9333=function(_0x5332fe,_0x206164){_0x5332fe=_0x5332fe-0x0;var _0x38a9cf=_0x3339[_0x5332fe];return _0x38a9cf;};'use strict';var _=require(_0x9333('0x0'));var util=require(_0x9333('0x1'));var moment=require(_0x9333('0x2'));var BPromise=require(_0x9333('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9333('0x4'))['db'];var utils=require(_0x9333('0x5'));var logger=require('../../config/logger')(_0x9333('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9333('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fbf96,_0x54b0d8,_0x3fe466){return new BPromise(function(_0x51e0c8,_0x2455bf){return client[_0x9333('0x8')](_0x2fbf96,_0x3fe466)['then'](function(_0x4b0818){logger[_0x9333('0x9')](_0x9333('0xa'),_0x54b0d8,_0x9333('0xb'));logger['debug'](_0x9333('0xc'),_0x54b0d8,'request\x20sent',JSON[_0x9333('0xd')](_0x4b0818));if(_0x4b0818[_0x9333('0xe')]){if(_0x4b0818[_0x9333('0xe')]['code']===0x1f4){logger[_0x9333('0xe')](_0x9333('0xa'),_0x54b0d8,_0x4b0818[_0x9333('0xe')][_0x9333('0xf')]);return _0x2455bf(_0x4b0818['error'][_0x9333('0xf')]);}logger['error'](_0x9333('0xa'),_0x54b0d8,_0x4b0818[_0x9333('0xe')][_0x9333('0xf')]);return _0x51e0c8(_0x4b0818[_0x9333('0xe')]['message']);}else{logger[_0x9333('0x9')](_0x9333('0xa'),_0x54b0d8,_0x9333('0xb'));_0x51e0c8(_0x4b0818[_0x9333('0x10')]['message']);}})[_0x9333('0x11')](function(_0x341df7){logger[_0x9333('0xe')](_0x9333('0xa'),_0x54b0d8,_0x341df7);_0x2455bf(_0x341df7);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 192c883..a92f4c1 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4d2752,_0x16f0c5){var _0x3d2e74=function(_0x50d2d6){while(--_0x50d2d6){_0x4d2752['push'](_0x4d2752['shift']());}};_0x3d2e74(++_0x16f0c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5e6544,_0x3217a8){var _0x351a22=function(_0x1ae7cb){while(--_0x1ae7cb){_0x5e6544['push'](_0x5e6544['shift']());}};_0x351a22(++_0x3217a8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 313c19a..a3f59dd 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 _0xcd63=['exports','INTEGER','sequelize'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0xcd63,0xfe));var _0x3cd6=function(_0x2169c5,_0x330ade){_0x2169c5=_0x2169c5-0x0;var _0x401328=_0xcd63[_0x2169c5];return _0x401328;};'use strict';var Sequelize=require(_0x3cd6('0x0'));module[_0x3cd6('0x1')]={'penalty':{'type':Sequelize[_0x3cd6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x68c3=['INTEGER','sequelize','exports'];(function(_0x175db1,_0x36b367){var _0x438037=function(_0x32466e){while(--_0x32466e){_0x175db1['push'](_0x175db1['shift']());}};_0x438037(++_0x36b367);}(_0x68c3,0xdc));var _0x368c=function(_0x397f34,_0x3ac328){_0x397f34=_0x397f34-0x0;var _0x272cda=_0x68c3[_0x397f34];return _0x272cda;};'use strict';var Sequelize=require(_0x368c('0x0'));module[_0x368c('0x1')]={'penalty':{'type':Sequelize[_0x368c('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 5667730..b2baf72 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 _0x1b65=['UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0xa4d003,_0x3d9dbd){var _0x319ad9=function(_0x2b42f0){while(--_0x2b42f0){_0xa4d003['push'](_0xa4d003['shift']());}};_0x319ad9(++_0x3d9dbd);}(_0x1b65,0x1b4));var _0x51b6=function(_0x2c2a8e,_0x1dfe39){_0x2c2a8e=_0x2c2a8e-0x0;var _0x3b9e38=_0x1b65[_0x2c2a8e];return _0x3b9e38;};'use strict';var _=require(_0x51b6('0x0'));var util=require(_0x51b6('0x1'));var logger=require(_0x51b6('0x2'))(_0x51b6('0x3'));var moment=require('moment');var BPromise=require(_0x51b6('0x4'));var rp=require(_0x51b6('0x5'));var fs=require('fs');var path=require(_0x51b6('0x6'));var rimraf=require(_0x51b6('0x7'));var config=require(_0x51b6('0x8'));var attributes=require(_0x51b6('0x9'));module[_0x51b6('0xa')]=function(_0x578b6a,_0x466a60){return _0x578b6a[_0x51b6('0xb')](_0x51b6('0xc'),attributes,{'tableName':_0x51b6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0f4=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','util','moment','bluebird','path'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xf0f4,0x182));var _0x4f0f=function(_0xbede7c,_0x4a5cfe){_0xbede7c=_0xbede7c-0x0;var _0x1b6f88=_0xf0f4[_0xbede7c];return _0x1b6f88;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4f0f('0x1'));var BPromise=require(_0x4f0f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f0f('0x3'));var rimraf=require(_0x4f0f('0x4'));var config=require(_0x4f0f('0x5'));var attributes=require(_0x4f0f('0x6'));module[_0x4f0f('0x7')]=function(_0x15e6cd,_0x3285cd){return _0x15e6cd['define'](_0x4f0f('0x8'),attributes,{'tableName':_0x4f0f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 7c0a640..b8629fe 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 _0x27e0=['request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x27e0,0xf2));var _0x027e=function(_0x116f7d,_0xe30646){_0x116f7d=_0x116f7d-0x0;var _0x1a63bd=_0x27e0[_0x116f7d];return _0x1a63bd;};'use strict';var _=require(_0x027e('0x0'));var util=require(_0x027e('0x1'));var moment=require(_0x027e('0x2'));var BPromise=require(_0x027e('0x3'));var rs=require(_0x027e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x027e('0x5'))['db'];var utils=require(_0x027e('0x6'));var logger=require(_0x027e('0x7'))('rpc');var config=require(_0x027e('0x8'));var jayson=require(_0x027e('0x9'));var client=jayson[_0x027e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x473d5a,_0x322240,_0x10cdb6){return new BPromise(function(_0x473d91,_0x307d61){return client[_0x027e('0xb')](_0x473d5a,_0x10cdb6)[_0x027e('0xc')](function(_0x1e47c8){logger['info'](_0x027e('0xd'),_0x322240,_0x027e('0xe'));logger['debug'](_0x027e('0xf'),_0x322240,_0x027e('0xe'),JSON[_0x027e('0x10')](_0x1e47c8));if(_0x1e47c8[_0x027e('0x11')]){if(_0x1e47c8['error'][_0x027e('0x12')]===0x1f4){logger[_0x027e('0x11')](_0x027e('0xd'),_0x322240,_0x1e47c8[_0x027e('0x11')][_0x027e('0x13')]);return _0x307d61(_0x1e47c8['error'][_0x027e('0x13')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x322240,_0x1e47c8[_0x027e('0x11')][_0x027e('0x13')]);return _0x473d91(_0x1e47c8[_0x027e('0x11')][_0x027e('0x13')]);}else{logger[_0x027e('0x14')](_0x027e('0xd'),_0x322240,_0x027e('0xe'));_0x473d91(_0x1e47c8[_0x027e('0x15')][_0x027e('0x13')]);}})[_0x027e('0x16')](function(_0x235023){logger[_0x027e('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x322240,_0x235023);_0x307d61(_0x235023);});});} \ No newline at end of file +var _0x4da4=['http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x4da4,0xfd));var _0x44da=function(_0x40eec9,_0x817a67){_0x40eec9=_0x40eec9-0x0;var _0xfee890=_0x4da4[_0x40eec9];return _0xfee890;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x44da('0x0'));var BPromise=require('bluebird');var rs=require(_0x44da('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44da('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x44da('0x3'))(_0x44da('0x4'));var config=require(_0x44da('0x5'));var jayson=require(_0x44da('0x6'));var client=jayson['client'][_0x44da('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x498687,_0x214e29,_0x5e50aa){return new BPromise(function(_0x5907c8,_0x44b3f9){return client[_0x44da('0x8')](_0x498687,_0x5e50aa)[_0x44da('0x9')](function(_0x310ca6){logger[_0x44da('0xa')](_0x44da('0xb'),_0x214e29,_0x44da('0xc'));logger[_0x44da('0xd')](_0x44da('0xe'),_0x214e29,_0x44da('0xc'),JSON[_0x44da('0xf')](_0x310ca6));if(_0x310ca6[_0x44da('0x10')]){if(_0x310ca6[_0x44da('0x10')][_0x44da('0x11')]===0x1f4){logger['error'](_0x44da('0xb'),_0x214e29,_0x310ca6[_0x44da('0x10')][_0x44da('0x12')]);return _0x44b3f9(_0x310ca6['error']['message']);}logger[_0x44da('0x10')](_0x44da('0xb'),_0x214e29,_0x310ca6[_0x44da('0x10')][_0x44da('0x12')]);return _0x5907c8(_0x310ca6[_0x44da('0x10')][_0x44da('0x12')]);}else{logger[_0x44da('0xa')](_0x44da('0xb'),_0x214e29,_0x44da('0xc'));_0x5907c8(_0x310ca6[_0x44da('0x13')][_0x44da('0x12')]);}})['catch'](function(_0x4c6342){logger[_0x44da('0x10')](_0x44da('0xb'),_0x214e29,_0x4c6342);_0x44b3f9(_0x4c6342);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index c36c721..48cead1 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 _0x7e1d=['INTEGER'];(function(_0x38fa84,_0x44395f){var _0x547889=function(_0x4f8779){while(--_0x4f8779){_0x38fa84['push'](_0x38fa84['shift']());}};_0x547889(++_0x44395f);}(_0x7e1d,0x116));var _0xd7e1=function(_0x2f1c1f,_0x178ef8){_0x2f1c1f=_0x2f1c1f-0x0;var _0x197323=_0x7e1d[_0x2f1c1f];return _0x197323;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0xd7e1('0x0')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbbed=['exports','INTEGER','sequelize'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0xbbed,0x1cd));var _0xdbbe=function(_0x4c1052,_0x57d02d){_0x4c1052=_0x4c1052-0x0;var _0x6cfab7=_0xbbed[_0x4c1052];return _0x6cfab7;};'use strict';var Sequelize=require(_0xdbbe('0x0'));module[_0xdbbe('0x1')]={'UserId':{'type':Sequelize[_0xdbbe('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xdbbe('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a1e0512..a4937b1 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(_0x449972,_0x20482b){var _0x1a77d1=function(_0x5af064){while(--_0x5af064){_0x449972['push'](_0x449972['shift']());}};_0x1a77d1(++_0x20482b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x41527f,_0x2e2cbf){var _0x3f84d5=function(_0x5c962d){while(--_0x5c962d){_0x41527f['push'](_0x41527f['shift']());}};_0x3f84d5(++_0x2e2cbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 f761944..66527d0 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(_0x93feb2,_0x569f20){var _0x5117d5=function(_0xb443c9){while(--_0xb443c9){_0x93feb2['push'](_0x93feb2['shift']());}};_0x5117d5(++_0x569f20);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0xcb91[_0x52b7b9];return _0x5b5d30;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2e7ace,_0x553d1e){var _0x3f3327=function(_0x13b750){while(--_0x13b750){_0x2e7ace['push'](_0x2e7ace['shift']());}};_0x3f3327(++_0x553d1e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0xcb91[_0x1778e1];return _0x2bc4c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 40e86c1..feb08cf 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 _0xf7f0=['sequelize','INTEGER'];(function(_0x2f8cb4,_0x2958d5){var _0x16dd55=function(_0x12405b){while(--_0x12405b){_0x2f8cb4['push'](_0x2f8cb4['shift']());}};_0x16dd55(++_0x2958d5);}(_0xf7f0,0xa4));var _0x0f7f=function(_0x6cf3b6,_0x4b7560){_0x6cf3b6=_0x6cf3b6-0x0;var _0xdbe948=_0xf7f0[_0x6cf3b6];return _0xdbe948;};'use strict';var Sequelize=require(_0x0f7f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0f7f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfc5b=['sequelize','exports'];(function(_0x43b768,_0x35d34b){var _0x10605e=function(_0x5c86ae){while(--_0x5c86ae){_0x43b768['push'](_0x43b768['shift']());}};_0x10605e(++_0x35d34b);}(_0xfc5b,0xda));var _0xbfc5=function(_0x54992d,_0x305033){_0x54992d=_0x54992d-0x0;var _0x11c615=_0xfc5b[_0x54992d];return _0x11c615;};'use strict';var Sequelize=require(_0xbfc5('0x0'));module[_0xbfc5('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 6578113..124f653 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 _0x1073=['exports','UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d37db,_0x1e7783){var _0x14e51b=function(_0x4298bd){while(--_0x4298bd){_0x5d37db['push'](_0x5d37db['shift']());}};_0x14e51b(++_0x1e7783);}(_0x1073,0x10b));var _0x3107=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x1073[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x3107('0x0'));var util=require(_0x3107('0x1'));var logger=require('../../config/logger')(_0x3107('0x2'));var moment=require(_0x3107('0x3'));var BPromise=require(_0x3107('0x4'));var rp=require(_0x3107('0x5'));var fs=require('fs');var path=require(_0x3107('0x6'));var rimraf=require(_0x3107('0x7'));var config=require(_0x3107('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x3107('0x9')]=function(_0x2ed01a,_0x33a8da){return _0x2ed01a['define'](_0x3107('0xa'),attributes,{'tableName':_0x3107('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3a8=['rimraf','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x4b980d,_0x32fc6a){var _0x5c7974=function(_0x3b7af4){while(--_0x3b7af4){_0x4b980d['push'](_0x4b980d['shift']());}};_0x5c7974(++_0x32fc6a);}(_0xd3a8,0x135));var _0x8d3a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xd3a8[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x8d3a('0x0'));var util=require('util');var logger=require(_0x8d3a('0x1'))(_0x8d3a('0x2'));var moment=require(_0x8d3a('0x3'));var BPromise=require(_0x8d3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d3a('0x5'));var rimraf=require(_0x8d3a('0x6'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x457b90,_0x59893d){return _0x457b90['define'](_0x8d3a('0x7'),attributes,{'tableName':_0x8d3a('0x8'),'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 0edeb7b..188833b 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 _0xddcd=['request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1365a8,_0x34edea){var _0x9e46e8=function(_0x5886fb){while(--_0x5886fb){_0x1365a8['push'](_0x1365a8['shift']());}};_0x9e46e8(++_0x34edea);}(_0xddcd,0x16c));var _0xdddc=function(_0x336966,_0x3dd901){_0x336966=_0x336966-0x0;var _0x3d0cc5=_0xddcd[_0x336966];return _0x3d0cc5;};'use strict';var _=require(_0xdddc('0x0'));var util=require('util');var moment=require(_0xdddc('0x1'));var BPromise=require(_0xdddc('0x2'));var rs=require(_0xdddc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdddc('0x4'))(_0xdddc('0x5'));var config=require(_0xdddc('0x6'));var jayson=require(_0xdddc('0x7'));var client=jayson[_0xdddc('0x8')][_0xdddc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c6f60,_0x270886,_0x224cc7){return new BPromise(function(_0x539480,_0x170cb4){return client[_0xdddc('0xa')](_0x4c6f60,_0x224cc7)[_0xdddc('0xb')](function(_0x241daf){logger[_0xdddc('0xc')](_0xdddc('0xd'),_0x270886,_0xdddc('0xe'));logger[_0xdddc('0xf')](_0xdddc('0x10'),_0x270886,_0xdddc('0xe'),JSON[_0xdddc('0x11')](_0x241daf));if(_0x241daf[_0xdddc('0x12')]){if(_0x241daf['error'][_0xdddc('0x13')]===0x1f4){logger[_0xdddc('0x12')](_0xdddc('0xd'),_0x270886,_0x241daf[_0xdddc('0x12')][_0xdddc('0x14')]);return _0x170cb4(_0x241daf[_0xdddc('0x12')][_0xdddc('0x14')]);}logger[_0xdddc('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x270886,_0x241daf['error']['message']);return _0x539480(_0x241daf[_0xdddc('0x12')][_0xdddc('0x14')]);}else{logger[_0xdddc('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x270886,_0xdddc('0xe'));_0x539480(_0x241daf['result'][_0xdddc('0x14')]);}})[_0xdddc('0x15')](function(_0x5067ac){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x270886,_0x5067ac);_0x170cb4(_0x5067ac);});});} \ No newline at end of file +var _0xa5d2=['code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x516745,_0x477841){var _0x247ceb=function(_0x480e68){while(--_0x480e68){_0x516745['push'](_0x516745['shift']());}};_0x247ceb(++_0x477841);}(_0xa5d2,0x12f));var _0x2a5d=function(_0x3e29fe,_0x259931){_0x3e29fe=_0x3e29fe-0x0;var _0x36501d=_0xa5d2[_0x3e29fe];return _0x36501d;};'use strict';var _=require(_0x2a5d('0x0'));var util=require(_0x2a5d('0x1'));var moment=require(_0x2a5d('0x2'));var BPromise=require(_0x2a5d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a5d('0x5'));var logger=require(_0x2a5d('0x6'))('rpc');var config=require(_0x2a5d('0x7'));var jayson=require(_0x2a5d('0x8'));var client=jayson[_0x2a5d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122156,_0x20b56a,_0x416bbf){return new BPromise(function(_0x46486f,_0x43a96e){return client[_0x2a5d('0xa')](_0x122156,_0x416bbf)['then'](function(_0x52f8d1){logger['info'](_0x2a5d('0xb'),_0x20b56a,'request\x20sent');logger[_0x2a5d('0xc')](_0x2a5d('0xd'),_0x20b56a,_0x2a5d('0xe'),JSON[_0x2a5d('0xf')](_0x52f8d1));if(_0x52f8d1[_0x2a5d('0x10')]){if(_0x52f8d1[_0x2a5d('0x10')][_0x2a5d('0x11')]===0x1f4){logger['error'](_0x2a5d('0xb'),_0x20b56a,_0x52f8d1['error'][_0x2a5d('0x12')]);return _0x43a96e(_0x52f8d1[_0x2a5d('0x10')][_0x2a5d('0x12')]);}logger[_0x2a5d('0x10')](_0x2a5d('0xb'),_0x20b56a,_0x52f8d1[_0x2a5d('0x10')][_0x2a5d('0x12')]);return _0x46486f(_0x52f8d1['error'][_0x2a5d('0x12')]);}else{logger['info'](_0x2a5d('0xb'),_0x20b56a,'request\x20sent');_0x46486f(_0x52f8d1[_0x2a5d('0x13')]['message']);}})['catch'](function(_0x2c356a){logger[_0x2a5d('0x10')](_0x2a5d('0xb'),_0x20b56a,_0x2c356a);_0x43a96e(_0x2c356a);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index fc71de9..c5c11d2 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(_0x1e35de,_0x1939d8){var _0x5e5600=function(_0x38badb){while(--_0x38badb){_0x1e35de['push'](_0x1e35de['shift']());}};_0x5e5600(++_0x1939d8);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3b68d7,_0x54593f){var _0x3070be=function(_0x4403d2){while(--_0x4403d2){_0x3b68d7['push'](_0x3b68d7['shift']());}};_0x3070be(++_0x54593f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xcb91[_0x3b231a];return _0x18d67a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 9c0217e..a3588d6 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 _0x4ec5=['exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x35e97,_0x20fac6){var _0xc0a3d4=function(_0x133886){while(--_0x133886){_0x35e97['push'](_0x35e97['shift']());}};_0xc0a3d4(++_0x20fac6);}(_0x4ec5,0x1eb));var _0x54ec=function(_0x188170,_0x42bae7){_0x188170=_0x188170-0x0;var _0x2d1136=_0x4ec5[_0x188170];return _0x2d1136;};'use strict';var Sequelize=require(_0x54ec('0x0'));module[_0x54ec('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x54ec('0x2')},'membername':{'type':Sequelize[_0x54ec('0x3')],'allowNull':![],'comment':_0x54ec('0x2')},'UserId':{'type':Sequelize[_0x54ec('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x54ec('0x5'),'comment':_0x54ec('0x2')},'VoiceQueueId':{'type':Sequelize[_0x54ec('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x54ec('0x5'),'comment':_0x54ec('0x2')},'penalty':{'type':Sequelize[_0x54ec('0x4')](0xb),'defaultValue':0x0,'comment':_0x54ec('0x2')},'paused':{'type':Sequelize[_0x54ec('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x02b9=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x02b9,0x115));var _0x902b=function(_0x4c2f6b,_0x5b84bd){_0x4c2f6b=_0x4c2f6b-0x0;var _0x706633=_0x02b9[_0x4c2f6b];return _0x706633;};'use strict';var Sequelize=require(_0x902b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x902b('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x902b('0x2')},'membername':{'type':Sequelize[_0x902b('0x3')],'allowNull':![],'comment':_0x902b('0x2')},'UserId':{'type':Sequelize[_0x902b('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x902b('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x902b('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x902b('0x3')],'allowNull':![],'unique':_0x902b('0x4'),'comment':_0x902b('0x2')},'penalty':{'type':Sequelize[_0x902b('0x1')](0xb),'defaultValue':0x0,'comment':_0x902b('0x2')},'paused':{'type':Sequelize[_0x902b('0x1')](0xb),'defaultValue':0x0,'comment':_0x902b('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 3d192fd..6b953d2 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 _0xbdbf=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','hasOwnProperty'];(function(_0x2aadce,_0xd4b8f4){var _0x2615e6=function(_0x63b4cf){while(--_0x63b4cf){_0x2aadce['push'](_0x2aadce['shift']());}};_0x2615e6(++_0xd4b8f4);}(_0xbdbf,0x102));var _0xfbdb=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xbdbf[_0x86b219];return _0x1f320c;};'use strict';var EventEmitter=require(_0xfbdb('0x0'));var UserVoiceQueueRt=require(_0xfbdb('0x1'))['db'][_0xfbdb('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xfbdb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfbdb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4bcb6b){return function(_0x3ccf2c,_0x56eea5,_0x43fab2){UserVoiceQueueRtEvents['emit'](_0x4bcb6b+':'+_0x3ccf2c['id'],_0x3ccf2c);UserVoiceQueueRtEvents['emit'](_0x4bcb6b,_0x3ccf2c);_0x43fab2(null);};}for(var e in events){if(events[_0xfbdb('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xfbdb('0x6')](e,emitEvent(event));}}module[_0xfbdb('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xb1de=['hook','exports','UserVoiceQueueRt','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x2bae51,_0x751a7f){var _0x55c25a=function(_0x1637e4){while(--_0x1637e4){_0x2bae51['push'](_0x2bae51['shift']());}};_0x55c25a(++_0x751a7f);}(_0xb1de,0x1d0));var _0xeb1d=function(_0x12ca56,_0xd8ad6f){_0x12ca56=_0x12ca56-0x0;var _0x2ef8d6=_0xb1de[_0x12ca56];return _0x2ef8d6;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xeb1d('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xeb1d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeb1d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x287c82){return function(_0x1f250f,_0x52ceea,_0x2ec46d){UserVoiceQueueRtEvents[_0xeb1d('0x3')](_0x287c82+':'+_0x1f250f['id'],_0x1f250f);UserVoiceQueueRtEvents['emit'](_0x287c82,_0x1f250f);_0x2ec46d(null);};}for(var e in events){if(events[_0xeb1d('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0xeb1d('0x5')](e,emitEvent(event));}}module[_0xeb1d('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c6662fb..24e0c0a 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 _0x6a2e=['UserVoiceQueueRt','../../config/logger','request-promise','path','../../config/environment','define'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x6a2e,0xf1));var _0xe6a2=function(_0x5d5552,_0x10a3ce){_0x5d5552=_0x5d5552-0x0;var _0x527431=_0x6a2e[_0x5d5552];return _0x527431;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe6a2('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe6a2('0x1'));var fs=require('fs');var path=require(_0xe6a2('0x2'));var rimraf=require('rimraf');var config=require(_0xe6a2('0x3'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x52e373,_0x263f9f){return _0x52e373[_0xe6a2('0x4')](_0xe6a2('0x5'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x547e=['api','moment','bluebird','request-promise','path','rimraf','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger'];(function(_0x4a40ad,_0x22b20d){var _0x5774a6=function(_0xc50119){while(--_0xc50119){_0x4a40ad['push'](_0x4a40ad['shift']());}};_0x5774a6(++_0x22b20d);}(_0x547e,0x136));var _0xe547=function(_0x5d9498,_0x56266e){_0x5d9498=_0x5d9498-0x0;var _0x23d20e=_0x547e[_0x5d9498];return _0x23d20e;};'use strict';var _=require(_0xe547('0x0'));var util=require('util');var logger=require(_0xe547('0x1'))(_0xe547('0x2'));var moment=require(_0xe547('0x3'));var BPromise=require(_0xe547('0x4'));var rp=require(_0xe547('0x5'));var fs=require('fs');var path=require(_0xe547('0x6'));var rimraf=require(_0xe547('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0xe547('0x8')]=function(_0x235119,_0x2234ce){return _0x235119[_0xe547('0x9')](_0xe547('0xa'),attributes,{'tableName':_0xe547('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 24bd5e8..d55f254 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 _0xc294=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','register','request','then','debug','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','info','request\x20sent','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null'];(function(_0x320c39,_0x1ffc73){var _0x39d47b=function(_0x4791b3){while(--_0x4791b3){_0x320c39['push'](_0x320c39['shift']());}};_0x39d47b(++_0x1ffc73);}(_0xc294,0x88));var _0x4c29=function(_0x9c5512,_0x5651f1){_0x9c5512=_0x9c5512-0x0;var _0x5c4f5d=_0xc294[_0x9c5512];return _0x5c4f5d;};'use strict';var _=require(_0x4c29('0x0'));var util=require(_0x4c29('0x1'));var moment=require(_0x4c29('0x2'));var BPromise=require(_0x4c29('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c29('0x4'))['db'];var utils=require(_0x4c29('0x5'));var logger=require('../../config/logger')(_0x4c29('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c29('0x7'));var client=jayson[_0x4c29('0x8')]['http']({'port':0x232a});config[_0x4c29('0x9')]=_[_0x4c29('0xa')](config[_0x4c29('0x9')],{'host':_0x4c29('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x4c29('0xc')](socket);function respondWithRpcPromise(_0x14e395,_0x32feec,_0x1811ff){return new BPromise(function(_0x55154f,_0x24ba62){return client[_0x4c29('0xd')](_0x14e395,_0x1811ff)[_0x4c29('0xe')](function(_0x2e555c){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x32feec,'request\x20sent');logger[_0x4c29('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x32feec,'request\x20sent',JSON[_0x4c29('0x10')](_0x2e555c));if(_0x2e555c[_0x4c29('0x11')]){if(_0x2e555c[_0x4c29('0x11')][_0x4c29('0x12')]===0x1f4){logger[_0x4c29('0x11')](_0x4c29('0x13'),_0x32feec,_0x2e555c['error'][_0x4c29('0x14')]);return _0x24ba62(_0x2e555c[_0x4c29('0x11')]['message']);}logger[_0x4c29('0x11')](_0x4c29('0x13'),_0x32feec,_0x2e555c[_0x4c29('0x11')][_0x4c29('0x14')]);return _0x55154f(_0x2e555c[_0x4c29('0x11')][_0x4c29('0x14')]);}else{logger[_0x4c29('0x15')](_0x4c29('0x13'),_0x32feec,_0x4c29('0x16'));_0x55154f(_0x2e555c[_0x4c29('0x17')][_0x4c29('0x14')]);}})[_0x4c29('0x18')](function(_0x4b5684){logger['error'](_0x4c29('0x13'),_0x32feec,_0x4b5684);_0x24ba62(_0x4b5684);});});}exports[_0x4c29('0x19')]=function(_0x308ced){var _0x510046=this;return new Promise(function(_0x130486,_0x3f8b2c){return db[_0x4c29('0x1a')][_0x4c29('0x1b')]({'raw':_0x308ced[_0x4c29('0x1c')]?_0x308ced['options'][_0x4c29('0x1d')]===undefined?!![]:![]:!![],'where':_0x308ced[_0x4c29('0x1c')]?_0x308ced['options']['where']||null:null,'attributes':[[db[_0x4c29('0x1e')]['fn'](_0x4c29('0x1f'),db[_0x4c29('0x1e')]['fn']('IF',db[_0x4c29('0x1e')][_0x4c29('0x20')](_0x4c29('0x21')))),'outboundQueuePauses']]})['then'](function(_0x25cc02){logger['info']('GetVoiceQueueRtPauses',_0x308ced);logger[_0x4c29('0xf')](_0x4c29('0x19'),_0x308ced,JSON[_0x4c29('0x10')](_0x25cc02));_0x130486(_0x25cc02);})[_0x4c29('0x18')](function(_0x546da4){logger[_0x4c29('0x11')]('GetVoiceQueueRtPauses',_0x546da4[_0x4c29('0x14')],_0x308ced);_0x3f8b2c(_0x510046[_0x4c29('0x11')](0x1f4,_0x546da4[_0x4c29('0x14')]));});});}; \ No newline at end of file +var _0x3bda=['options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll'];(function(_0x20500c,_0xe09892){var _0x27279b=function(_0x315816){while(--_0x315816){_0x20500c['push'](_0x20500c['shift']());}};_0x27279b(++_0xe09892);}(_0x3bda,0x67));var _0xa3bd=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x3bda[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require('lodash');var util=require(_0xa3bd('0x0'));var moment=require(_0xa3bd('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(_0xa3bd('0x2'));var logger=require(_0xa3bd('0x3'))('rpc');var config=require(_0xa3bd('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa3bd('0x5')]({'port':0x232a});config[_0xa3bd('0x6')]=_[_0xa3bd('0x7')](config['redis'],{'host':_0xa3bd('0x8'),'port':0x18eb});var socket=require(_0xa3bd('0x9'))(new Redis(config[_0xa3bd('0x6')]));require(_0xa3bd('0xa'))[_0xa3bd('0xb')](socket);function respondWithRpcPromise(_0x55a5b5,_0xb1a471,_0x1a0afb){return new BPromise(function(_0x3add37,_0x38aa63){return client['request'](_0x55a5b5,_0x1a0afb)[_0xa3bd('0xc')](function(_0xaef9c3){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0xb1a471,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0xb1a471,_0xa3bd('0xd'),JSON[_0xa3bd('0xe')](_0xaef9c3));if(_0xaef9c3[_0xa3bd('0xf')]){if(_0xaef9c3[_0xa3bd('0xf')][_0xa3bd('0x10')]===0x1f4){logger['error'](_0xa3bd('0x11'),_0xb1a471,_0xaef9c3[_0xa3bd('0xf')]['message']);return _0x38aa63(_0xaef9c3['error']['message']);}logger[_0xa3bd('0xf')](_0xa3bd('0x11'),_0xb1a471,_0xaef9c3[_0xa3bd('0xf')][_0xa3bd('0x12')]);return _0x3add37(_0xaef9c3['error'][_0xa3bd('0x12')]);}else{logger[_0xa3bd('0x13')](_0xa3bd('0x11'),_0xb1a471,_0xa3bd('0xd'));_0x3add37(_0xaef9c3[_0xa3bd('0x14')][_0xa3bd('0x12')]);}})[_0xa3bd('0x15')](function(_0x1ee21d){logger[_0xa3bd('0xf')](_0xa3bd('0x11'),_0xb1a471,_0x1ee21d);_0x38aa63(_0x1ee21d);});});}exports[_0xa3bd('0x16')]=function(_0xab7cb5){var _0x346648=this;return new Promise(function(_0x137be2,_0x83186){return db[_0xa3bd('0x17')][_0xa3bd('0x18')]({'raw':_0xab7cb5['options']?_0xab7cb5[_0xa3bd('0x19')][_0xa3bd('0x1a')]===undefined?!![]:![]:!![],'where':_0xab7cb5[_0xa3bd('0x19')]?_0xab7cb5[_0xa3bd('0x19')]['where']||null:null,'attributes':[[db[_0xa3bd('0x1b')]['fn'](_0xa3bd('0x1c'),db[_0xa3bd('0x1b')]['fn']('IF',db[_0xa3bd('0x1b')][_0xa3bd('0x1d')](_0xa3bd('0x1e')))),_0xa3bd('0x1f')]]})[_0xa3bd('0xc')](function(_0x55d6df){logger['info'](_0xa3bd('0x16'),_0xab7cb5);logger['debug'](_0xa3bd('0x16'),_0xab7cb5,JSON[_0xa3bd('0xe')](_0x55d6df));_0x137be2(_0x55d6df);})[_0xa3bd('0x15')](function(_0x284dd7){logger['error'](_0xa3bd('0x16'),_0x284dd7['message'],_0xab7cb5);_0x83186(_0x346648[_0xa3bd('0xf')](0x1f4,_0x284dd7['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 04768f8..5f78152 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 _0x1b20=['removeListener','register','length','userVoiceQueueRt:','save','remove','emit'];(function(_0x48c9b3,_0x1fb678){var _0x4c782f=function(_0x4b3842){while(--_0x4b3842){_0x48c9b3['push'](_0x48c9b3['shift']());}};_0x4c782f(++_0x1fb678);}(_0x1b20,0x66));var _0x01b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b20[_0x59ee6f];return _0x4c0979;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x01b2('0x0'),_0x01b2('0x1'),'update'];function createListener(_0x54eccf,_0x27a406){return function(_0x18e3ff){_0x27a406[_0x01b2('0x2')](_0x54eccf,_0x18e3ff);};}function removeListener(_0x1150fc,_0x1cf757){return function(){UserVoiceQueueRtEvents[_0x01b2('0x3')](_0x1150fc,_0x1cf757);};}exports[_0x01b2('0x4')]=function(_0x28de4a){for(var _0x46e745=0x0,_0xa64ad1=events[_0x01b2('0x5')];_0x46e745<_0xa64ad1;_0x46e745++){var _0x323470=events[_0x46e745];var _0x508add=createListener(_0x01b2('0x6')+_0x323470,_0x28de4a);UserVoiceQueueRtEvents['on'](_0x323470,_0x508add);}}; \ No newline at end of file +var _0xaaee=['register','length','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0xaaee,0x132));var _0xeaae=function(_0xc1125c,_0x258eea){_0xc1125c=_0xc1125c-0x0;var _0x2d411f=_0xaaee[_0xc1125c];return _0x2d411f;};'use strict';var UserVoiceQueueRtEvents=require(_0xeaae('0x0'));var events=[_0xeaae('0x1'),_0xeaae('0x2'),_0xeaae('0x3')];function createListener(_0xcd5fe6,_0x4af037){return function(_0x21b928){_0x4af037[_0xeaae('0x4')](_0xcd5fe6,_0x21b928);};}function removeListener(_0x2e683a,_0xdbaacc){return function(){UserVoiceQueueRtEvents[_0xeaae('0x5')](_0x2e683a,_0xdbaacc);};}exports[_0xeaae('0x6')]=function(_0xb5ad89){for(var _0x491e4=0x0,_0x113fa9=events[_0xeaae('0x7')];_0x491e4<_0x113fa9;_0x491e4++){var _0x33afb9=events[_0x491e4];var _0x1ad467=createListener('userVoiceQueueRt:'+_0x33afb9,_0xb5ad89);UserVoiceQueueRtEvents['on'](_0x33afb9,_0x1ad467);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index ed93b26..ae26820 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x568228,_0x2c03e6){var _0x519d89=function(_0x102972){while(--_0x102972){_0x568228['push'](_0x568228['shift']());}};_0x519d89(++_0x2c03e6);}(_0xe706,0xa3));var _0x6e70=function(_0x503d48,_0x42e5a9){_0x503d48=_0x503d48-0x0;var _0x59743e=_0xe706[_0x503d48];return _0x59743e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x18cdc6,_0x3efd9f){var _0x4c642f=function(_0x520e1c){while(--_0x520e1c){_0x18cdc6['push'](_0x18cdc6['shift']());}};_0x4c642f(++_0x3efd9f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index af0eff6..eb0501f 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 _0x18fe=['exports','INTEGER','sequelize'];(function(_0x38a792,_0x5a21a5){var _0x2cee7b=function(_0x3e9555){while(--_0x3e9555){_0x38a792['push'](_0x38a792['shift']());}};_0x2cee7b(++_0x5a21a5);}(_0x18fe,0x13a));var _0xe18f=function(_0x416817,_0x20607f){_0x416817=_0x416817-0x0;var _0x1beae4=_0x18fe[_0x416817];return _0x1beae4;};'use strict';var Sequelize=require(_0xe18f('0x0'));module[_0xe18f('0x1')]={'penalty':{'type':Sequelize[_0xe18f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf583=['exports','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf583,0x111));var _0x3f58=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xf583[_0x2b5513];return _0x578fd2;};'use strict';var Sequelize=require(_0x3f58('0x0'));module[_0x3f58('0x1')]={'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 05c0338..78cb934 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 _0xded6=['lodash','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x488d0f,_0x41bc6e){var _0x19ca8b=function(_0x560e7f){while(--_0x560e7f){_0x488d0f['push'](_0x488d0f['shift']());}};_0x19ca8b(++_0x41bc6e);}(_0xded6,0x78));var _0x6ded=function(_0x55d7c2,_0x4ce6fb){_0x55d7c2=_0x55d7c2-0x0;var _0x1755ef=_0xded6[_0x55d7c2];return _0x1755ef;};'use strict';var _=require(_0x6ded('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6ded('0x1'));var BPromise=require(_0x6ded('0x2'));var rp=require(_0x6ded('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ded('0x4'));var config=require(_0x6ded('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0x6ded('0x6')]=function(_0x25e739,_0x5e60d7){return _0x25e739[_0x6ded('0x7')](_0x6ded('0x8'),attributes,{'tableName':_0x6ded('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x867f=['define','UserWhatsappQueue','lodash','../../config/logger','api','bluebird','request-promise','rimraf','./userWhatsappQueue.attributes'];(function(_0x112419,_0xbb21b1){var _0x308ec8=function(_0xdb6149){while(--_0xdb6149){_0x112419['push'](_0x112419['shift']());}};_0x308ec8(++_0xbb21b1);}(_0x867f,0x161));var _0xf867=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x867f[_0x2d8d69];return _0x39ae22;};'use strict';var _=require(_0xf867('0x0'));var util=require('util');var logger=require(_0xf867('0x1'))(_0xf867('0x2'));var moment=require('moment');var BPromise=require(_0xf867('0x3'));var rp=require(_0xf867('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf867('0x5'));var config=require('../../config/environment');var attributes=require(_0xf867('0x6'));module['exports']=function(_0x44a0e2,_0x193a59){return _0x44a0e2[_0xf867('0x7')](_0xf867('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index c37ef38..1368efa 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 _0xb4a9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x1f6bd8,_0x487c65){var _0x240c82=function(_0x2a9edc){while(--_0x2a9edc){_0x1f6bd8['push'](_0x1f6bd8['shift']());}};_0x240c82(++_0x487c65);}(_0xb4a9,0x164));var _0x9b4a=function(_0x4ea9f5,_0x44a57b){_0x4ea9f5=_0x4ea9f5-0x0;var _0x9b6ed2=_0xb4a9[_0x4ea9f5];return _0x9b6ed2;};'use strict';var _=require(_0x9b4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b4a('0x2'));var db=require(_0x9b4a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b4a('0x4'))(_0x9b4a('0x5'));var config=require(_0x9b4a('0x6'));var jayson=require(_0x9b4a('0x7'));var client=jayson[_0x9b4a('0x8')][_0x9b4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e6fe2,_0x179952,_0x434c98){return new BPromise(function(_0x51a932,_0x38d991){return client['request'](_0x5e6fe2,_0x434c98)[_0x9b4a('0xa')](function(_0x54c7d6){logger[_0x9b4a('0xb')](_0x9b4a('0xc'),_0x179952,'request\x20sent');logger[_0x9b4a('0xd')](_0x9b4a('0xe'),_0x179952,'request\x20sent',JSON['stringify'](_0x54c7d6));if(_0x54c7d6[_0x9b4a('0xf')]){if(_0x54c7d6['error']['code']===0x1f4){logger[_0x9b4a('0xf')](_0x9b4a('0xc'),_0x179952,_0x54c7d6[_0x9b4a('0xf')][_0x9b4a('0x10')]);return _0x38d991(_0x54c7d6[_0x9b4a('0xf')][_0x9b4a('0x10')]);}logger[_0x9b4a('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x179952,_0x54c7d6['error'][_0x9b4a('0x10')]);return _0x51a932(_0x54c7d6[_0x9b4a('0xf')][_0x9b4a('0x10')]);}else{logger['info'](_0x9b4a('0xc'),_0x179952,_0x9b4a('0x11'));_0x51a932(_0x54c7d6[_0x9b4a('0x12')][_0x9b4a('0x10')]);}})[_0x9b4a('0x13')](function(_0x3f61e1){logger['error'](_0x9b4a('0xc'),_0x179952,_0x3f61e1);_0x38d991(_0x3f61e1);});});} \ No newline at end of file +var _0x878f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash'];(function(_0x1f94b0,_0x58c657){var _0x5cba72=function(_0x313c4a){while(--_0x313c4a){_0x1f94b0['push'](_0x1f94b0['shift']());}};_0x5cba72(++_0x58c657);}(_0x878f,0x113));var _0xf878=function(_0x340e27,_0x1ac536){_0x340e27=_0x340e27-0x0;var _0x2f51d6=_0x878f[_0x340e27];return _0x2f51d6;};'use strict';var _=require(_0xf878('0x0'));var util=require(_0xf878('0x1'));var moment=require(_0xf878('0x2'));var BPromise=require(_0xf878('0x3'));var rs=require(_0xf878('0x4'));var fs=require('fs');var Redis=require(_0xf878('0x5'));var db=require(_0xf878('0x6'))['db'];var utils=require(_0xf878('0x7'));var logger=require(_0xf878('0x8'))(_0xf878('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf878('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c615a,_0x5918ce,_0x493b42){return new BPromise(function(_0x3a5f80,_0x2293d5){return client['request'](_0x5c615a,_0x493b42)[_0xf878('0xb')](function(_0x1a7039){logger[_0xf878('0xc')](_0xf878('0xd'),_0x5918ce,_0xf878('0xe'));logger[_0xf878('0xf')](_0xf878('0x10'),_0x5918ce,_0xf878('0xe'),JSON[_0xf878('0x11')](_0x1a7039));if(_0x1a7039['error']){if(_0x1a7039['error'][_0xf878('0x12')]===0x1f4){logger[_0xf878('0x13')](_0xf878('0xd'),_0x5918ce,_0x1a7039['error'][_0xf878('0x14')]);return _0x2293d5(_0x1a7039[_0xf878('0x13')][_0xf878('0x14')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x5918ce,_0x1a7039['error'][_0xf878('0x14')]);return _0x3a5f80(_0x1a7039[_0xf878('0x13')][_0xf878('0x14')]);}else{logger[_0xf878('0xc')](_0xf878('0xd'),_0x5918ce,'request\x20sent');_0x3a5f80(_0x1a7039[_0xf878('0x15')][_0xf878('0x14')]);}})[_0xf878('0x16')](function(_0x9b00a3){logger[_0xf878('0x13')](_0xf878('0xd'),_0x5918ce,_0x9b00a3);_0x2293d5(_0x9b00a3);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 27892fa..7e68788 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 _0xc818=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','post','create','put'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc818,0x1e3));var _0x8c81=function(_0x5a89b9,_0x29d3fe){_0x5a89b9=_0x5a89b9-0x0;var _0x5a4bb9=_0xc818[_0x5a89b9];return _0x5a4bb9;};'use strict';var multer=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var path=require(_0x8c81('0x2'));var timeout=require(_0x8c81('0x3'));var express=require('express');var router=express[_0x8c81('0x4')]();var fs_extra=require(_0x8c81('0x5'));var auth=require(_0x8c81('0x6'));var interaction=require(_0x8c81('0x7'));var config=require(_0x8c81('0x8'));var controller=require(_0x8c81('0x9'));router[_0x8c81('0xa')]('/',auth['isAuthenticated'](),controller[_0x8c81('0xb')]);router[_0x8c81('0xa')](_0x8c81('0xc'),auth[_0x8c81('0xd')](),controller['show']);router[_0x8c81('0xe')]('/',auth[_0x8c81('0xd')](),controller[_0x8c81('0xf')]);router[_0x8c81('0x10')](_0x8c81('0xc'),auth[_0x8c81('0xd')](),controller[_0x8c81('0x11')]);router['delete'](_0x8c81('0xc'),auth[_0x8c81('0xd')](),controller[_0x8c81('0x12')]);module[_0x8c81('0x13')]=router; \ No newline at end of file +var _0x949d=['../../config/environment','./variable.controller','isAuthenticated','index','get','show','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x5301be,_0x560818){var _0x2e4cc4=function(_0x2cf63e){while(--_0x2cf63e){_0x5301be['push'](_0x5301be['shift']());}};_0x2e4cc4(++_0x560818);}(_0x949d,0x162));var _0xd949=function(_0x339793,_0x30fc3b){_0x339793=_0x339793-0x0;var _0x5b975a=_0x949d[_0x339793];return _0x5b975a;};'use strict';var multer=require(_0xd949('0x0'));var util=require(_0xd949('0x1'));var path=require(_0xd949('0x2'));var timeout=require(_0xd949('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd949('0x4'));var auth=require(_0xd949('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd949('0x6'));var controller=require(_0xd949('0x7'));router['get']('/',auth[_0xd949('0x8')](),controller[_0xd949('0x9')]);router[_0xd949('0xa')]('/:id',auth[_0xd949('0x8')](),controller[_0xd949('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd949('0xc')]);router[_0xd949('0xd')](_0xd949('0xe'),auth[_0xd949('0x8')](),controller[_0xd949('0xf')]);router['delete']('/:id',auth[_0xd949('0x8')](),controller[_0xd949('0x10')]);module[_0xd949('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index f624d33..9a422d9 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 _0x3584=['STRING','name'];(function(_0x35640e,_0x174d83){var _0x5632cf=function(_0x57b0aa){while(--_0x57b0aa){_0x35640e['push'](_0x35640e['shift']());}};_0x5632cf(++_0x174d83);}(_0x3584,0xba));var _0x4358=function(_0x39d66a,_0x2fb73c){_0x39d66a=_0x39d66a-0x0;var _0xdc677b=_0x3584[_0x39d66a];return _0xdc677b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4358('0x0')],'unique':_0x4358('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4358('0x0')]}}; \ No newline at end of file +var _0xd3fd=['exports','STRING','sequelize'];(function(_0x4d2b4a,_0x3411c1){var _0x485ba5=function(_0x5962c4){while(--_0x5962c4){_0x4d2b4a['push'](_0x4d2b4a['shift']());}};_0x485ba5(++_0x3411c1);}(_0xd3fd,0x10a));var _0xdd3f=function(_0xc84828,_0x1b63db){_0xc84828=_0xc84828-0x0;var _0x1b880f=_0xd3fd[_0xc84828];return _0x1b880f;};'use strict';var Sequelize=require(_0xdd3f('0x0'));module[_0xdd3f('0x1')]={'name':{'type':Sequelize[_0xdd3f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdd3f('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index a614b53..e16c626 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 _0x0c70=['apply','save','then','destroy','end','error','stack','name','send','index','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Variables','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0c70,0x132));var _0x00c7=function(_0x528166,_0x31dd49){_0x528166=_0x528166-0x0;var _0x502b7f=_0x0c70[_0x528166];return _0x502b7f;};'use strict';var emlformat=require(_0x00c7('0x0'));var rimraf=require(_0x00c7('0x1'));var zipdir=require(_0x00c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00c7('0x3'));var moment=require(_0x00c7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x00c7('0x5'));var path=require('path');var sox=require(_0x00c7('0x6'));var csv=require(_0x00c7('0x7'));var ejs=require(_0x00c7('0x8'));var fs=require('fs');var fs_extra=require(_0x00c7('0x9'));var _=require(_0x00c7('0xa'));var squel=require(_0x00c7('0xb'));var crypto=require(_0x00c7('0xc'));var jsforce=require(_0x00c7('0xd'));var deskjs=require(_0x00c7('0xe'));var toCsv=require(_0x00c7('0x7'));var querystring=require(_0x00c7('0xf'));var Papa=require('papaparse');var Redis=require(_0x00c7('0x10'));var authService=require(_0x00c7('0x11'));var qs=require(_0x00c7('0x12'));var as=require(_0x00c7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00c7('0x14'))('api');var utils=require(_0x00c7('0x15'));var config=require(_0x00c7('0x16'));var licenseUtil=require(_0x00c7('0x17'));var db=require(_0x00c7('0x18'))['db'];function respondWithStatusCode(_0x34e213,_0x333a19){_0x333a19=_0x333a19||0xcc;return function(_0x5278b4){if(_0x5278b4){return _0x34e213[_0x00c7('0x19')](_0x333a19);}return _0x34e213[_0x00c7('0x1a')](_0x333a19)['end']();};}function respondWithResult(_0x2b041c,_0x35e960){_0x35e960=_0x35e960||0xc8;return function(_0x5ada4c){if(_0x5ada4c){return _0x2b041c[_0x00c7('0x1a')](_0x35e960)[_0x00c7('0x1b')](_0x5ada4c);}};}function respondWithFilteredResult(_0x20551d,_0x828cca){return function(_0x4e8d6e){if(_0x4e8d6e){var _0x5aa561=typeof _0x828cca[_0x00c7('0x1c')]===_0x00c7('0x1d')&&typeof _0x828cca['limit']===_0x00c7('0x1d');var _0x51a4a7=_0x4e8d6e[_0x00c7('0x1e')];var _0x4aa076=_0x5aa561?0x0:_0x828cca[_0x00c7('0x1c')];var _0x1d3ed0=_0x5aa561?_0x4e8d6e[_0x00c7('0x1e')]:_0x828cca[_0x00c7('0x1c')]+_0x828cca[_0x00c7('0x1f')];var _0x124f2b;if(_0x1d3ed0>=_0x51a4a7){_0x1d3ed0=_0x51a4a7;_0x124f2b=0xc8;}else{_0x124f2b=0xce;}_0x20551d[_0x00c7('0x1a')](_0x124f2b);return _0x20551d[_0x00c7('0x20')](_0x00c7('0x21'),_0x4aa076+'-'+_0x1d3ed0+'/'+_0x51a4a7)['json'](_0x4e8d6e);}return null;};}function patchUpdates(_0x15b7b9){return function(_0x2feaa3){try{jsonpatch[_0x00c7('0x22')](_0x2feaa3,_0x15b7b9,!![]);}catch(_0x588623){return BPromise['reject'](_0x588623);}return _0x2feaa3[_0x00c7('0x23')]();};}function saveUpdates(_0x3a2766,_0x5f320c){return function(_0x1181e8){if(_0x1181e8){return _0x1181e8['update'](_0x3a2766)[_0x00c7('0x24')](function(_0x313e77){return _0x313e77;});}return null;};}function removeEntity(_0x3364c0,_0x6359c1){return function(_0x5b44ec){if(_0x5b44ec){return _0x5b44ec['destroy']()[_0x00c7('0x24')](function(){var _0x9abf86=_0x5b44ec['get']({'plain':!![]});var _0x5e0ec9='Variables';return db['UserProfileResource'][_0x00c7('0x25')]({'where':{'type':_0x5e0ec9,'resourceId':_0x9abf86['id']}})[_0x00c7('0x24')](function(){return _0x5b44ec;});})['then'](function(){_0x3364c0['status'](0xcc)[_0x00c7('0x26')]();});}};}function handleEntityNotFound(_0x59bf71,_0x5821e6){return function(_0x106e6d){if(!_0x106e6d){_0x59bf71[_0x00c7('0x19')](0x194);}return _0x106e6d;};}function handleError(_0x2c05eb,_0x4df5d1){_0x4df5d1=_0x4df5d1||0x1f4;return function(_0x1b59ba){logger[_0x00c7('0x27')](_0x1b59ba[_0x00c7('0x28')]);if(_0x1b59ba[_0x00c7('0x29')]){delete _0x1b59ba[_0x00c7('0x29')];}_0x2c05eb[_0x00c7('0x1a')](_0x4df5d1)[_0x00c7('0x2a')](_0x1b59ba);};}exports[_0x00c7('0x2b')]=function(_0x26c99b,_0x5e9229){var _0x21a8e1={},_0x138638={},_0x5ba045={'count':0x0,'rows':[]};var _0x3d1136=_[_0x00c7('0x2c')](db[_0x00c7('0x2d')]['rawAttributes'],function(_0x2925d4){return{'name':_0x2925d4[_0x00c7('0x2e')],'type':_0x2925d4[_0x00c7('0x2f')][_0x00c7('0x30')]};});_0x138638[_0x00c7('0x31')]=_['map'](_0x3d1136,_0x00c7('0x29'));_0x138638[_0x00c7('0x32')]=_[_0x00c7('0x33')](_0x26c99b[_0x00c7('0x32')]);_0x138638[_0x00c7('0x34')]=_[_0x00c7('0x35')](_0x138638[_0x00c7('0x31')],_0x138638[_0x00c7('0x32')]);_0x21a8e1[_0x00c7('0x36')]=_[_0x00c7('0x35')](_0x138638[_0x00c7('0x31')],qs['fields'](_0x26c99b[_0x00c7('0x32')][_0x00c7('0x37')]));_0x21a8e1[_0x00c7('0x36')]=_0x21a8e1['attributes'][_0x00c7('0x38')]?_0x21a8e1[_0x00c7('0x36')]:_0x138638[_0x00c7('0x31')];if(!_0x26c99b[_0x00c7('0x32')][_0x00c7('0x39')]('nolimit')){_0x21a8e1['limit']=qs[_0x00c7('0x1f')](_0x26c99b[_0x00c7('0x32')][_0x00c7('0x1f')]);_0x21a8e1[_0x00c7('0x1c')]=qs[_0x00c7('0x1c')](_0x26c99b['query']['offset']);}_0x21a8e1[_0x00c7('0x3a')]=qs['sort'](_0x26c99b[_0x00c7('0x32')]['sort']);_0x21a8e1[_0x00c7('0x3b')]=qs[_0x00c7('0x34')](_['pick'](_0x26c99b['query'],_0x138638[_0x00c7('0x34')]),_0x3d1136);if(_0x26c99b['query'][_0x00c7('0x3c')]){_0x21a8e1['where']=_[_0x00c7('0x3d')](_0x21a8e1[_0x00c7('0x3b')],{'$or':_[_0x00c7('0x2c')](_0x3d1136,function(_0x3b7d0b){if(_0x3b7d0b[_0x00c7('0x2f')]!==_0x00c7('0x3e')){var _0x37f313={};_0x37f313[_0x3b7d0b[_0x00c7('0x29')]]={'$like':'%'+_0x26c99b[_0x00c7('0x32')]['filter']+'%'};return _0x37f313;}})});}_0x21a8e1=_[_0x00c7('0x3d')]({},_0x21a8e1,_0x26c99b[_0x00c7('0x3f')]);var _0x35ae36={'where':_0x21a8e1[_0x00c7('0x3b')]};return db[_0x00c7('0x2d')][_0x00c7('0x1e')](_0x35ae36)[_0x00c7('0x24')](function(_0x1bb1f8){_0x5ba045[_0x00c7('0x1e')]=_0x1bb1f8;if(_0x26c99b['query'][_0x00c7('0x40')]){_0x21a8e1[_0x00c7('0x41')]=[{'all':!![]}];}return db[_0x00c7('0x2d')][_0x00c7('0x42')](_0x21a8e1);})[_0x00c7('0x24')](function(_0x27b377){_0x5ba045[_0x00c7('0x43')]=_0x27b377;return _0x5ba045;})[_0x00c7('0x24')](respondWithFilteredResult(_0x5e9229,_0x21a8e1))['catch'](handleError(_0x5e9229,null));};exports[_0x00c7('0x44')]=function(_0x4f2882,_0x34605a){var _0x42486a={'raw':!![],'where':{'id':_0x4f2882['params']['id']}},_0xb49e71={};_0xb49e71[_0x00c7('0x31')]=_['keys'](db[_0x00c7('0x2d')][_0x00c7('0x45')]);_0xb49e71[_0x00c7('0x32')]=_[_0x00c7('0x33')](_0x4f2882['query']);_0xb49e71[_0x00c7('0x34')]=_[_0x00c7('0x35')](_0xb49e71[_0x00c7('0x31')],_0xb49e71[_0x00c7('0x32')]);_0x42486a[_0x00c7('0x36')]=_[_0x00c7('0x35')](_0xb49e71[_0x00c7('0x31')],qs[_0x00c7('0x37')](_0x4f2882[_0x00c7('0x32')]['fields']));_0x42486a['attributes']=_0x42486a[_0x00c7('0x36')]['length']?_0x42486a[_0x00c7('0x36')]:_0xb49e71[_0x00c7('0x31')];if(_0x4f2882[_0x00c7('0x32')][_0x00c7('0x40')]){_0x42486a[_0x00c7('0x41')]=[{'all':!![]}];}_0x42486a=_[_0x00c7('0x3d')]({},_0x42486a,_0x4f2882[_0x00c7('0x3f')]);return db['Variable'][_0x00c7('0x46')](_0x42486a)[_0x00c7('0x24')](handleEntityNotFound(_0x34605a,null))[_0x00c7('0x24')](respondWithResult(_0x34605a,null))[_0x00c7('0x47')](handleError(_0x34605a,null));};exports[_0x00c7('0x48')]=function(_0xed720f,_0x24bb4a){return db[_0x00c7('0x2d')][_0x00c7('0x48')](_0xed720f['body'],{})[_0x00c7('0x24')](function(_0x3833dc){var _0x4522fe=_0xed720f[_0x00c7('0x49')]['get']({'plain':!![]});if(!_0x4522fe)throw new Error(_0x00c7('0x4a'));if(_0x4522fe[_0x00c7('0x4b')]==='user'){var _0x4838b2=_0x3833dc[_0x00c7('0x4c')]({'plain':!![]});var _0x24d244=_0x00c7('0x4d');return db[_0x00c7('0x4e')][_0x00c7('0x46')]({'where':{'name':_0x24d244,'userProfileId':_0x4522fe[_0x00c7('0x4f')]},'raw':!![]})[_0x00c7('0x24')](function(_0x41e4ac){if(_0x41e4ac&&_0x41e4ac['autoAssociation']===0x0){return db[_0x00c7('0x50')][_0x00c7('0x48')]({'name':_0x4838b2['name'],'resourceId':_0x4838b2['id'],'type':_0x41e4ac['name'],'sectionId':_0x41e4ac['id']},{})[_0x00c7('0x24')](function(){return _0x3833dc;});}else{return _0x3833dc;}})[_0x00c7('0x47')](function(_0x4843da){logger[_0x00c7('0x27')](_0x00c7('0x51'),_0x4843da);throw _0x4843da;});}return _0x3833dc;})[_0x00c7('0x24')](respondWithResult(_0x24bb4a,0xc9))['catch'](handleError(_0x24bb4a,null));};exports[_0x00c7('0x52')]=function(_0x193dac,_0x5da85c){if(_0x193dac['body']['id']){delete _0x193dac['body']['id'];}return db['Variable'][_0x00c7('0x46')]({'where':{'id':_0x193dac['params']['id']}})['then'](handleEntityNotFound(_0x5da85c,null))[_0x00c7('0x24')](saveUpdates(_0x193dac[_0x00c7('0x53')],null))[_0x00c7('0x24')](respondWithResult(_0x5da85c,null))['catch'](handleError(_0x5da85c,null));};exports[_0x00c7('0x25')]=function(_0x220ae0,_0x2c129d){return db['Variable'][_0x00c7('0x46')]({'where':{'id':_0x220ae0[_0x00c7('0x54')]['id']}})[_0x00c7('0x24')](handleEntityNotFound(_0x2c129d,null))[_0x00c7('0x24')](removeEntity(_0x2c129d,null))[_0x00c7('0x47')](handleError(_0x2c129d,null));}; \ No newline at end of file +var _0x04ef=['find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','get','Variables','UserProfileResource','destroy','error','name','send','index','map','Variable','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll'];(function(_0x180c5b,_0x14c64c){var _0x213db0=function(_0xca51de){while(--_0xca51de){_0x180c5b['push'](_0x180c5b['shift']());}};_0x213db0(++_0x14c64c);}(_0x04ef,0xb6));var _0xf04e=function(_0x33d9ae,_0x251e14){_0x33d9ae=_0x33d9ae-0x0;var _0x166f99=_0x04ef[_0x33d9ae];return _0x166f99;};'use strict';var emlformat=require(_0xf04e('0x0'));var rimraf=require(_0xf04e('0x1'));var zipdir=require(_0xf04e('0x2'));var jsonpatch=require(_0xf04e('0x3'));var rp=require('request-promise');var moment=require(_0xf04e('0x4'));var BPromise=require(_0xf04e('0x5'));var Mustache=require(_0xf04e('0x6'));var util=require(_0xf04e('0x7'));var path=require(_0xf04e('0x8'));var sox=require(_0xf04e('0x9'));var csv=require(_0xf04e('0xa'));var ejs=require(_0xf04e('0xb'));var fs=require('fs');var fs_extra=require(_0xf04e('0xc'));var _=require('lodash');var squel=require(_0xf04e('0xd'));var crypto=require(_0xf04e('0xe'));var jsforce=require(_0xf04e('0xf'));var deskjs=require(_0xf04e('0x10'));var toCsv=require(_0xf04e('0xa'));var querystring=require(_0xf04e('0x11'));var Papa=require('papaparse');var Redis=require(_0xf04e('0x12'));var authService=require(_0xf04e('0x13'));var qs=require(_0xf04e('0x14'));var as=require(_0xf04e('0x15'));var hardwareService=require(_0xf04e('0x16'));var logger=require(_0xf04e('0x17'))(_0xf04e('0x18'));var utils=require('../../config/utils');var config=require(_0xf04e('0x19'));var licenseUtil=require(_0xf04e('0x1a'));var db=require(_0xf04e('0x1b'))['db'];function respondWithStatusCode(_0x3780c7,_0x1ae0c1){_0x1ae0c1=_0x1ae0c1||0xcc;return function(_0xed294a){if(_0xed294a){return _0x3780c7['sendStatus'](_0x1ae0c1);}return _0x3780c7[_0xf04e('0x1c')](_0x1ae0c1)[_0xf04e('0x1d')]();};}function respondWithResult(_0x13c398,_0x203040){_0x203040=_0x203040||0xc8;return function(_0x3ae562){if(_0x3ae562){return _0x13c398[_0xf04e('0x1c')](_0x203040)[_0xf04e('0x1e')](_0x3ae562);}};}function respondWithFilteredResult(_0x25204e,_0x245543){return function(_0x4fc41c){if(_0x4fc41c){var _0xd46f8d=typeof _0x245543[_0xf04e('0x1f')]===_0xf04e('0x20')&&typeof _0x245543['limit']===_0xf04e('0x20');var _0x1b4fe5=_0x4fc41c[_0xf04e('0x21')];var _0x4b5bc7=_0xd46f8d?0x0:_0x245543[_0xf04e('0x1f')];var _0x180b3a=_0xd46f8d?_0x4fc41c[_0xf04e('0x21')]:_0x245543[_0xf04e('0x1f')]+_0x245543[_0xf04e('0x22')];var _0x3bb241;if(_0x180b3a>=_0x1b4fe5){_0x180b3a=_0x1b4fe5;_0x3bb241=0xc8;}else{_0x3bb241=0xce;}_0x25204e[_0xf04e('0x1c')](_0x3bb241);return _0x25204e['set'](_0xf04e('0x23'),_0x4b5bc7+'-'+_0x180b3a+'/'+_0x1b4fe5)[_0xf04e('0x1e')](_0x4fc41c);}return null;};}function patchUpdates(_0x313875){return function(_0x775365){try{jsonpatch['apply'](_0x775365,_0x313875,!![]);}catch(_0x4b169a){return BPromise[_0xf04e('0x24')](_0x4b169a);}return _0x775365[_0xf04e('0x25')]();};}function saveUpdates(_0x390878,_0x2e4fb4){return function(_0x21995f){if(_0x21995f){return _0x21995f[_0xf04e('0x26')](_0x390878)[_0xf04e('0x27')](function(_0x27fe1c){return _0x27fe1c;});}return null;};}function removeEntity(_0x738718,_0x84e50f){return function(_0x2b042b){if(_0x2b042b){return _0x2b042b['destroy']()[_0xf04e('0x27')](function(){var _0x37ceec=_0x2b042b[_0xf04e('0x28')]({'plain':!![]});var _0x3e92e4=_0xf04e('0x29');return db[_0xf04e('0x2a')][_0xf04e('0x2b')]({'where':{'type':_0x3e92e4,'resourceId':_0x37ceec['id']}})[_0xf04e('0x27')](function(){return _0x2b042b;});})[_0xf04e('0x27')](function(){_0x738718[_0xf04e('0x1c')](0xcc)[_0xf04e('0x1d')]();});}};}function handleEntityNotFound(_0x51e7e5,_0x1b2aa2){return function(_0x4ebc8f){if(!_0x4ebc8f){_0x51e7e5['sendStatus'](0x194);}return _0x4ebc8f;};}function handleError(_0x45118e,_0x132c52){_0x132c52=_0x132c52||0x1f4;return function(_0x20cd7f){logger[_0xf04e('0x2c')](_0x20cd7f['stack']);if(_0x20cd7f['name']){delete _0x20cd7f[_0xf04e('0x2d')];}_0x45118e[_0xf04e('0x1c')](_0x132c52)[_0xf04e('0x2e')](_0x20cd7f);};}exports[_0xf04e('0x2f')]=function(_0x442f52,_0x1efe53){var _0x2d4e8f={},_0x4b756e={},_0x585a40={'count':0x0,'rows':[]};var _0x570e5c=_[_0xf04e('0x30')](db[_0xf04e('0x31')]['rawAttributes'],function(_0x998d4e){return{'name':_0x998d4e[_0xf04e('0x32')],'type':_0x998d4e['type'][_0xf04e('0x33')]};});_0x4b756e[_0xf04e('0x34')]=_['map'](_0x570e5c,_0xf04e('0x2d'));_0x4b756e[_0xf04e('0x35')]=_['keys'](_0x442f52[_0xf04e('0x35')]);_0x4b756e[_0xf04e('0x36')]=_[_0xf04e('0x37')](_0x4b756e[_0xf04e('0x34')],_0x4b756e[_0xf04e('0x35')]);_0x2d4e8f[_0xf04e('0x38')]=_[_0xf04e('0x37')](_0x4b756e['model'],qs[_0xf04e('0x39')](_0x442f52[_0xf04e('0x35')][_0xf04e('0x39')]));_0x2d4e8f[_0xf04e('0x38')]=_0x2d4e8f[_0xf04e('0x38')][_0xf04e('0x3a')]?_0x2d4e8f['attributes']:_0x4b756e['model'];if(!_0x442f52[_0xf04e('0x35')][_0xf04e('0x3b')]('nolimit')){_0x2d4e8f[_0xf04e('0x22')]=qs[_0xf04e('0x22')](_0x442f52[_0xf04e('0x35')][_0xf04e('0x22')]);_0x2d4e8f[_0xf04e('0x1f')]=qs[_0xf04e('0x1f')](_0x442f52[_0xf04e('0x35')][_0xf04e('0x1f')]);}_0x2d4e8f[_0xf04e('0x3c')]=qs['sort'](_0x442f52[_0xf04e('0x35')][_0xf04e('0x3d')]);_0x2d4e8f[_0xf04e('0x3e')]=qs[_0xf04e('0x36')](_[_0xf04e('0x3f')](_0x442f52[_0xf04e('0x35')],_0x4b756e[_0xf04e('0x36')]),_0x570e5c);if(_0x442f52[_0xf04e('0x35')][_0xf04e('0x40')]){_0x2d4e8f[_0xf04e('0x3e')]=_[_0xf04e('0x41')](_0x2d4e8f[_0xf04e('0x3e')],{'$or':_[_0xf04e('0x30')](_0x570e5c,function(_0x128fe7){if(_0x128fe7[_0xf04e('0x42')]!==_0xf04e('0x43')){var _0x54e47e={};_0x54e47e[_0x128fe7[_0xf04e('0x2d')]]={'$like':'%'+_0x442f52[_0xf04e('0x35')][_0xf04e('0x40')]+'%'};return _0x54e47e;}})});}_0x2d4e8f=_[_0xf04e('0x41')]({},_0x2d4e8f,_0x442f52[_0xf04e('0x44')]);var _0x2dc49b={'where':_0x2d4e8f['where']};return db[_0xf04e('0x31')]['count'](_0x2dc49b)['then'](function(_0x599694){_0x585a40[_0xf04e('0x21')]=_0x599694;if(_0x442f52[_0xf04e('0x35')]['includeAll']){_0x2d4e8f[_0xf04e('0x45')]=[{'all':!![]}];}return db[_0xf04e('0x31')][_0xf04e('0x46')](_0x2d4e8f);})[_0xf04e('0x27')](function(_0x402b52){_0x585a40[_0xf04e('0x47')]=_0x402b52;return _0x585a40;})['then'](respondWithFilteredResult(_0x1efe53,_0x2d4e8f))['catch'](handleError(_0x1efe53,null));};exports[_0xf04e('0x48')]=function(_0x1590f1,_0x59a218){var _0x1075c0={'raw':!![],'where':{'id':_0x1590f1[_0xf04e('0x49')]['id']}},_0x23c86e={};_0x23c86e[_0xf04e('0x34')]=_[_0xf04e('0x4a')](db[_0xf04e('0x31')]['rawAttributes']);_0x23c86e[_0xf04e('0x35')]=_['keys'](_0x1590f1[_0xf04e('0x35')]);_0x23c86e[_0xf04e('0x36')]=_[_0xf04e('0x37')](_0x23c86e[_0xf04e('0x34')],_0x23c86e[_0xf04e('0x35')]);_0x1075c0[_0xf04e('0x38')]=_[_0xf04e('0x37')](_0x23c86e[_0xf04e('0x34')],qs[_0xf04e('0x39')](_0x1590f1[_0xf04e('0x35')][_0xf04e('0x39')]));_0x1075c0[_0xf04e('0x38')]=_0x1075c0[_0xf04e('0x38')][_0xf04e('0x3a')]?_0x1075c0['attributes']:_0x23c86e[_0xf04e('0x34')];if(_0x1590f1[_0xf04e('0x35')][_0xf04e('0x4b')]){_0x1075c0[_0xf04e('0x45')]=[{'all':!![]}];}_0x1075c0=_['merge']({},_0x1075c0,_0x1590f1[_0xf04e('0x44')]);return db[_0xf04e('0x31')][_0xf04e('0x4c')](_0x1075c0)['then'](handleEntityNotFound(_0x59a218,null))[_0xf04e('0x27')](respondWithResult(_0x59a218,null))[_0xf04e('0x4d')](handleError(_0x59a218,null));};exports[_0xf04e('0x4e')]=function(_0x1df22d,_0x147c2a){return db[_0xf04e('0x31')][_0xf04e('0x4e')](_0x1df22d[_0xf04e('0x4f')],{})[_0xf04e('0x27')](function(_0x5b7880){var _0x4aa154=_0x1df22d[_0xf04e('0x50')][_0xf04e('0x28')]({'plain':!![]});if(!_0x4aa154)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aa154[_0xf04e('0x51')]==='user'){var _0x5f2865=_0x5b7880[_0xf04e('0x28')]({'plain':!![]});var _0x5a3782=_0xf04e('0x29');return db[_0xf04e('0x52')][_0xf04e('0x4c')]({'where':{'name':_0x5a3782,'userProfileId':_0x4aa154[_0xf04e('0x53')]},'raw':!![]})[_0xf04e('0x27')](function(_0x243653){if(_0x243653&&_0x243653[_0xf04e('0x54')]===0x0){return db[_0xf04e('0x2a')]['create']({'name':_0x5f2865[_0xf04e('0x2d')],'resourceId':_0x5f2865['id'],'type':_0x243653['name'],'sectionId':_0x243653['id']},{})[_0xf04e('0x27')](function(){return _0x5b7880;});}else{return _0x5b7880;}})[_0xf04e('0x4d')](function(_0x5ec413){logger[_0xf04e('0x2c')](_0xf04e('0x55'),_0x5ec413);throw _0x5ec413;});}return _0x5b7880;})[_0xf04e('0x27')](respondWithResult(_0x147c2a,0xc9))[_0xf04e('0x4d')](handleError(_0x147c2a,null));};exports[_0xf04e('0x26')]=function(_0x582bda,_0x16f353){if(_0x582bda[_0xf04e('0x4f')]['id']){delete _0x582bda[_0xf04e('0x4f')]['id'];}return db[_0xf04e('0x31')][_0xf04e('0x4c')]({'where':{'id':_0x582bda['params']['id']}})['then'](handleEntityNotFound(_0x16f353,null))[_0xf04e('0x27')](saveUpdates(_0x582bda[_0xf04e('0x4f')],null))[_0xf04e('0x27')](respondWithResult(_0x16f353,null))[_0xf04e('0x4d')](handleError(_0x16f353,null));};exports[_0xf04e('0x2b')]=function(_0x2da270,_0x181024){return db['Variable'][_0xf04e('0x4c')]({'where':{'id':_0x2da270[_0xf04e('0x49')]['id']}})['then'](handleEntityNotFound(_0x181024,null))['then'](removeEntity(_0x181024,null))[_0xf04e('0x4d')](handleError(_0x181024,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 4d7b386..4a34490 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 _0xc265=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables'];(function(_0x103f3b,_0x3c865c){var _0x50218c=function(_0x1138d0){while(--_0x1138d0){_0x103f3b['push'](_0x103f3b['shift']());}};_0x50218c(++_0x3c865c);}(_0xc265,0x1d4));var _0x5c26=function(_0x3180a4,_0x5a4219){_0x3180a4=_0x3180a4-0x0;var _0x4feac4=_0xc265[_0x3180a4];return _0x4feac4;};'use strict';var _=require(_0x5c26('0x0'));var util=require(_0x5c26('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5c26('0x2'));var BPromise=require(_0x5c26('0x3'));var rp=require(_0x5c26('0x4'));var fs=require('fs');var path=require(_0x5c26('0x5'));var rimraf=require(_0x5c26('0x6'));var config=require(_0x5c26('0x7'));var attributes=require(_0x5c26('0x8'));module[_0x5c26('0x9')]=function(_0x395ffc,_0x1eec6c){return _0x395ffc[_0x5c26('0xa')](_0x5c26('0xb'),attributes,{'tableName':_0x5c26('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02ba=['tools_variables','lodash','../../config/logger','api','bluebird','request-promise','./variable.attributes','exports','define','Variable'];(function(_0x1bea17,_0x3e470e){var _0x26a200=function(_0x12273c){while(--_0x12273c){_0x1bea17['push'](_0x1bea17['shift']());}};_0x26a200(++_0x3e470e);}(_0x02ba,0x123));var _0xa02b=function(_0x417c77,_0x19f557){_0x417c77=_0x417c77-0x0;var _0x13e354=_0x02ba[_0x417c77];return _0x13e354;};'use strict';var _=require(_0xa02b('0x0'));var util=require('util');var logger=require(_0xa02b('0x1'))(_0xa02b('0x2'));var moment=require('moment');var BPromise=require(_0xa02b('0x3'));var rp=require(_0xa02b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa02b('0x5'));module[_0xa02b('0x6')]=function(_0x219b25,_0x321dda){return _0x219b25[_0xa02b('0x7')](_0xa02b('0x8'),attributes,{'tableName':_0xa02b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 5d083eb..d76d87d 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x449235,_0x567736){var _0x2446ad=function(_0x36d60c){while(--_0x36d60c){_0x449235['push'](_0x449235['shift']());}};_0x2446ad(++_0x567736);}(_0x55ca,0x126));var _0xa55c=function(_0x152c9d,_0x371656){_0x152c9d=_0x152c9d-0x0;var _0x462f34=_0x55ca[_0x152c9d];return _0x462f34;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa41a,0x6b));var _0xaa41=function(_0x42888e,_0x9a2bac){_0x42888e=_0x42888e-0x0;var _0x1a87b8=_0xa41a[_0x42888e];return _0x1a87b8;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 5b59830..27e427e 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 _0x3c3c=['reset','isAuthenticated','pull','/restart','restart','/migrations','migrations','exports','express','./version.controller','get','index','/fetch','canUpdate','fetch','/reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c3c,0x178));var _0xc3c3=function(_0x2a498b,_0x4a7306){_0x2a498b=_0x2a498b-0x0;var _0x25b090=_0x3c3c[_0x2a498b];return _0x25b090;};'use strict';var express=require(_0xc3c3('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xc3c3('0x1'));router[_0xc3c3('0x2')]('/',controller[_0xc3c3('0x3')]);router[_0xc3c3('0x2')](_0xc3c3('0x4'),auth['isAuthenticated'](),auth[_0xc3c3('0x5')](),controller[_0xc3c3('0x6')]);router[_0xc3c3('0x2')](_0xc3c3('0x7'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xc3c3('0x8')]);router[_0xc3c3('0x2')]('/pull',auth[_0xc3c3('0x9')](),auth[_0xc3c3('0x5')](),controller[_0xc3c3('0xa')]);router[_0xc3c3('0x2')](_0xc3c3('0xb'),auth[_0xc3c3('0x9')](),controller[_0xc3c3('0xc')]);router[_0xc3c3('0x2')](_0xc3c3('0xd'),controller[_0xc3c3('0xe')]);module[_0xc3c3('0xf')]=router; \ No newline at end of file +var _0x8295=['pull','restart','/migrations','express','Router','../../components/auth/service','./version.controller','get','isAuthenticated','canUpdate','fetch','/reset','/pull'];(function(_0x20d648,_0x26df1a){var _0x4c2fbc=function(_0x74bcb){while(--_0x74bcb){_0x20d648['push'](_0x20d648['shift']());}};_0x4c2fbc(++_0x26df1a);}(_0x8295,0x155));var _0x5829=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x8295[_0x46efd7];return _0x5637e4;};'use strict';var express=require(_0x5829('0x0'));var router=express[_0x5829('0x1')]();var auth=require(_0x5829('0x2'));var controller=require(_0x5829('0x3'));router[_0x5829('0x4')]('/',controller['index']);router['get']('/fetch',auth[_0x5829('0x5')](),auth[_0x5829('0x6')](),controller[_0x5829('0x7')]);router['get'](_0x5829('0x8'),auth[_0x5829('0x5')](),auth[_0x5829('0x6')](),controller['reset']);router['get'](_0x5829('0x9'),auth[_0x5829('0x5')](),auth['canUpdate'](),controller[_0x5829('0xa')]);router[_0x5829('0x4')]('/restart',auth['isAuthenticated'](),controller[_0x5829('0xb')]);router['get'](_0x5829('0xc'),controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index d2cbf85..69d1078 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 _0x3cc1=['path','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','2.0.0','status','json','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','server','length','push','sort','Migration','sequelize','getQueryInterface','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','join','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x3cc1,0x164));var _0x13cc=function(_0x243e17,_0x59cca0){_0x243e17=_0x243e17-0x0;var _0x517bf1=_0x3cc1[_0x243e17];return _0x517bf1;};'use strict';var Umzug=require(_0x13cc('0x0'));var path=require(_0x13cc('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x13cc('0x2'))(module,_0x13cc('0x3'));var compareVersions=require(_0x13cc('0x4'));var exec=require(_0x13cc('0x5'))['exec'];var db=require(_0x13cc('0x6'))['db'];var config=require(_0x13cc('0x7'));var pm2=require(_0x13cc('0x8'));var logger=require('../../config/logger')(_0x13cc('0x9'));var git=require(_0x13cc('0xa'))(config[_0x13cc('0xb')]);exports[_0x13cc('0xc')]=function(_0xd551dd,_0x18094f){var _0x2b75a7={'current':module[_0x13cc('0xd')]['version'],'phonebar':0x2};if(_0xd551dd[_0x13cc('0xe')]&&_0xd551dd[_0x13cc('0xe')][_0x13cc('0xf')]){return git[_0x13cc('0x10')]()['tags'](function(_0x23c1d9,_0xd2d63d){_0x2b75a7[_0x13cc('0xf')]=(_0x23c1d9?module[_0x13cc('0xd')][_0x13cc('0x3')]:_0xd2d63d[_0x13cc('0xf')])||_0x13cc('0x11');return _0x18094f['status'](0xc8)['json'](_0x2b75a7);});}else{return _0x18094f[_0x13cc('0x12')](0xc8)[_0x13cc('0x13')](_0x2b75a7);}};exports[_0x13cc('0x10')]=function(_0x36aa63,_0x128c29){return git[_0x13cc('0x10')](['origin',_0x13cc('0x14')],function(_0xf47c2c){if(_0xf47c2c){logger[_0x13cc('0x15')](_0xf47c2c);return _0x128c29[_0x13cc('0x12')](0x1f4)[_0x13cc('0x13')](_0xf47c2c);}logger[_0x13cc('0x16')]('git\x20fetch');return _0x128c29[_0x13cc('0x12')](0xc8)[_0x13cc('0x13')]({'output':_0x13cc('0x17')});});};exports[_0x13cc('0x18')]=function(_0x57741d,_0x16afd4){return git[_0x13cc('0x18')]([_0x13cc('0x19'),_0x13cc('0x1a')],function(_0x59daee){if(_0x59daee){logger['error'](_0x59daee);return _0x16afd4[_0x13cc('0x12')](0x1f4)[_0x13cc('0x13')](_0x59daee);}logger[_0x13cc('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x16afd4['status'](0xc8)['json']({'output':_0x13cc('0x1b')});});};exports[_0x13cc('0x1c')]=function(_0x39b9c9,_0x1dde1a){exec(_0x13cc('0x1d'),function(_0x4f2957,_0x1ad6f4,_0x52a6fe){logger[_0x13cc('0x16')](_0x1ad6f4);logger['info'](_0x52a6fe);if(_0x4f2957){logger['error'](_0x4f2957);return _0x1dde1a[_0x13cc('0x12')](0x1f4)[_0x13cc('0x13')](_0x4f2957);}return _0x1dde1a[_0x13cc('0x12')](0xc8)['json']({'output':_0x1ad6f4});});};exports[_0x13cc('0x1e')]=function(_0x402239,_0x52d39a){return pm2[_0x13cc('0x1e')]('motion2')[_0x13cc('0x1f')](function(_0xf361b6){logger[_0x13cc('0x16')](_0x13cc('0x20'),_0xf361b6);return _0x52d39a[_0x13cc('0x12')](0xc8)[_0x13cc('0x13')]({'output':_0x13cc('0x21')});})['catch'](function(_0x3d537a){logger['error'](_0x3d537a);return _0x52d39a[_0x13cc('0x12')](0x1f4)['json'](_0x3d537a);});};exports[_0x13cc('0x22')]=function(_0x22993b,_0x4881cd){var _0x19a371=fs[_0x13cc('0x23')](path['join'](config[_0x13cc('0xb')],_0x13cc('0x24'),_0x13cc('0x22')));var _0x1ccb1e=[];for(var _0x2d8656=0x0;_0x2d8656<_0x19a371[_0x13cc('0x25')];_0x2d8656++){var _0x341de3=_0x19a371[_0x2d8656]['replace']('.js','');if(compareVersions(module[_0x13cc('0xd')][_0x13cc('0x3')],_0x341de3)===-0x1){_0x1ccb1e[_0x13cc('0x26')](_0x341de3);}}if(_0x1ccb1e[_0x13cc('0x25')]){var _0x3020d3=_0x1ccb1e[_0x13cc('0x27')](compareVersions);var _0x54484c=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x13cc('0x28'),'columnName':_0x13cc('0x3')},'migrations':{'params':[db[_0x13cc('0x29')][_0x13cc('0x2a')](),db[_0x13cc('0x29')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config['root'],_0x13cc('0x24'),_0x13cc('0x22')),'pattern':/\.js$/}});_0x54484c['up']({'migrations':_[_0x13cc('0x2b')](_0x3020d3,function(_0x409ba8){return _0x409ba8+_0x13cc('0x2c');})})[_0x13cc('0x1f')](function(){return _0x4881cd[_0x13cc('0x12')](0xc8)['json']({'output':_0x13cc('0x2d')+module[_0x13cc('0xd')][_0x13cc('0x3')]+'\x20to\x20'+_[_0x13cc('0x2e')](_0x3020d3),'migrations':_[_0x13cc('0x2f')](_0x3020d3)});})[_0x13cc('0x30')](function(_0x153f8c){if(_0x153f8c instanceof db[_0x13cc('0x29')][_0x13cc('0x31')]){return _0x4881cd[_0x13cc('0x12')](0xc8)[_0x13cc('0x13')]({'output':_0x13cc('0x32')});}else{return _0x4881cd[_0x13cc('0x12')](0x1f4)[_0x13cc('0x13')](_0x153f8c);}});}else{return _0x4881cd[_0x13cc('0x12')](0xc8)[_0x13cc('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xe10c=['--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','replace','.js','exports','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','query','latest','fetch','tags','2.0.0','status','origin','master','error','json','info','reset'];(function(_0x43ef9b,_0x5ecb6d){var _0x5abccf=function(_0x32bd1){while(--_0x32bd1){_0x43ef9b['push'](_0x43ef9b['shift']());}};_0x5abccf(++_0x5ecb6d);}(_0xe10c,0x88));var _0xce10=function(_0x5c1e84,_0x55e7cd){_0x5c1e84=_0x5c1e84-0x0;var _0x1a2878=_0xe10c[_0x5c1e84];return _0x1a2878;};'use strict';var Umzug=require(_0xce10('0x0'));var path=require(_0xce10('0x1'));var fs=require('fs');var _=require(_0xce10('0x2'));var pkginfo=require('pkginfo')(module,_0xce10('0x3'));var compareVersions=require(_0xce10('0x4'));var exec=require(_0xce10('0x5'))[_0xce10('0x6')];var db=require(_0xce10('0x7'))['db'];var config=require(_0xce10('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xce10('0x9'))(_0xce10('0xa'));var git=require(_0xce10('0xb'))(config[_0xce10('0xc')]);exports[_0xce10('0xd')]=function(_0x39846a,_0x5ae14c){var _0x8b309e={'current':module['exports'][_0xce10('0x3')],'phonebar':0x2};if(_0x39846a[_0xce10('0xe')]&&_0x39846a['query'][_0xce10('0xf')]){return git[_0xce10('0x10')]()[_0xce10('0x11')](function(_0x5e1892,_0x28adf1){_0x8b309e[_0xce10('0xf')]=(_0x5e1892?module['exports'][_0xce10('0x3')]:_0x28adf1['latest'])||_0xce10('0x12');return _0x5ae14c[_0xce10('0x13')](0xc8)['json'](_0x8b309e);});}else{return _0x5ae14c[_0xce10('0x13')](0xc8)['json'](_0x8b309e);}};exports['fetch']=function(_0x5ef612,_0xcdbe7f){return git[_0xce10('0x10')]([_0xce10('0x14'),_0xce10('0x15')],function(_0x4ab29d){if(_0x4ab29d){logger[_0xce10('0x16')](_0x4ab29d);return _0xcdbe7f[_0xce10('0x13')](0x1f4)[_0xce10('0x17')](_0x4ab29d);}logger[_0xce10('0x18')]('git\x20fetch');return _0xcdbe7f[_0xce10('0x13')](0xc8)[_0xce10('0x17')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xce10('0x19')]=function(_0x3ea195,_0x74e373){return git[_0xce10('0x19')]([_0xce10('0x1a'),_0xce10('0x1b')],function(_0x3ac4a8){if(_0x3ac4a8){logger[_0xce10('0x16')](_0x3ac4a8);return _0x74e373[_0xce10('0x13')](0x1f4)[_0xce10('0x17')](_0x3ac4a8);}logger[_0xce10('0x18')](_0xce10('0x1c'));return _0x74e373[_0xce10('0x13')](0xc8)[_0xce10('0x17')]({'output':'git\x20reset\x20--hard'});});};exports[_0xce10('0x1d')]=function(_0x1ecf81,_0x304049){exec('npm\x20install\x20--production',function(_0x4c3b2d,_0x4664af,_0x204887){logger[_0xce10('0x18')](_0x4664af);logger['info'](_0x204887);if(_0x4c3b2d){logger[_0xce10('0x16')](_0x4c3b2d);return _0x304049[_0xce10('0x13')](0x1f4)[_0xce10('0x17')](_0x4c3b2d);}return _0x304049[_0xce10('0x13')](0xc8)['json']({'output':_0x4664af});});};exports[_0xce10('0x1e')]=function(_0x404e2f,_0x283727){return pm2[_0xce10('0x1e')](_0xce10('0x1f'))['then'](function(_0x2b4ddc){logger[_0xce10('0x18')]('pm2\x20restart\x20motion\x20%s',_0x2b4ddc);return _0x283727['status'](0xc8)['json']({'output':_0xce10('0x20')});})[_0xce10('0x21')](function(_0x494bcf){logger[_0xce10('0x16')](_0x494bcf);return _0x283727[_0xce10('0x13')](0x1f4)[_0xce10('0x17')](_0x494bcf);});};exports[_0xce10('0x22')]=function(_0x3e6559,_0x689b45){var _0x1c85d7=fs[_0xce10('0x23')](path['join'](config[_0xce10('0xc')],_0xce10('0x24'),_0xce10('0x22')));var _0x13ce24=[];for(var _0x1267aa=0x0;_0x1267aa<_0x1c85d7['length'];_0x1267aa++){var _0xedc6c0=_0x1c85d7[_0x1267aa][_0xce10('0x25')](_0xce10('0x26'),'');if(compareVersions(module[_0xce10('0x27')][_0xce10('0x3')],_0xedc6c0)===-0x1){_0x13ce24[_0xce10('0x28')](_0xedc6c0);}}if(_0x13ce24[_0xce10('0x29')]){var _0x1838bc=_0x13ce24[_0xce10('0x2a')](compareVersions);var _0x5a9872=new Umzug({'storage':_0xce10('0x2b'),'storageOptions':{'model':db[_0xce10('0x2c')],'modelName':_0xce10('0x2c'),'columnName':_0xce10('0x3')},'migrations':{'params':[db[_0xce10('0x2b')][_0xce10('0x2d')](),db[_0xce10('0x2b')][_0xce10('0x2e')],function(){throw new Error(_0xce10('0x2f'));}],'path':path['join'](config['root'],_0xce10('0x24'),'migrations'),'pattern':/\.js$/}});_0x5a9872['up']({'migrations':_[_0xce10('0x30')](_0x1838bc,function(_0x4e035b){return _0x4e035b+_0xce10('0x26');})})['then'](function(){return _0x689b45[_0xce10('0x13')](0xc8)['json']({'output':_0xce10('0x31')+module[_0xce10('0x27')][_0xce10('0x3')]+_0xce10('0x32')+_['last'](_0x1838bc),'migrations':_[_0xce10('0x33')](_0x1838bc)});})[_0xce10('0x21')](function(_0x3ff5ca){if(_0x3ff5ca instanceof db['sequelize'][_0xce10('0x34')]){return _0x689b45[_0xce10('0x13')](0xc8)[_0xce10('0x17')]({'output':_0xce10('0x35')});}else{return _0x689b45[_0xce10('0x13')](0x1f4)[_0xce10('0x17')](_0x3ff5ca);}});}else{return _0x689b45[_0xce10('0x13')](0xc8)[_0xce10('0x17')]({'output':_0xce10('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index cfca5b3..567d432 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 _0xc198=['Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x2e2b8d,_0x4fa0d1){var _0x446d85=function(_0x2a1e67){while(--_0x2a1e67){_0x2e2b8d['push'](_0x2e2b8d['shift']());}};_0x446d85(++_0x4fa0d1);}(_0xc198,0x1e3));var _0x8c19=function(_0x2abcbe,_0x1ce8c3){_0x2abcbe=_0x2abcbe-0x0;var _0x1e097f=_0xc198[_0x2abcbe];return _0x1e097f;};'use strict';var multer=require(_0x8c19('0x0'));var util=require(_0x8c19('0x1'));var path=require(_0x8c19('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c19('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8c19('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x8c19('0x5')]('/',auth[_0x8c19('0x6')](),controller[_0x8c19('0x7')]);router['get'](_0x8c19('0x8'),auth[_0x8c19('0x6')](),controller[_0x8c19('0x9')]);router[_0x8c19('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x8c19('0xa')]);router[_0x8c19('0xb')]('/',auth[_0x8c19('0x6')](),controller[_0x8c19('0xc')]);router[_0x8c19('0xd')](_0x8c19('0xe'),auth[_0x8c19('0x6')](),controller[_0x8c19('0xf')]);router[_0x8c19('0x10')](_0x8c19('0xe'),auth[_0x8c19('0x6')](),controller[_0x8c19('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfd39=['../../components/auth/service','get','isAuthenticated','describe','show','post','/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1f86cd,_0x291a23){var _0xb7b59a=function(_0xda22cf){while(--_0xda22cf){_0x1f86cd['push'](_0x1f86cd['shift']());}};_0xb7b59a(++_0x291a23);}(_0xfd39,0x153));var _0x9fd3=function(_0x182184,_0x1801a8){_0x182184=_0x182184-0x0;var _0x184451=_0xfd39[_0x182184];return _0x184451;};'use strict';var multer=require(_0x9fd3('0x0'));var util=require('util');var path=require(_0x9fd3('0x1'));var timeout=require(_0x9fd3('0x2'));var express=require(_0x9fd3('0x3'));var router=express[_0x9fd3('0x4')]();var fs_extra=require(_0x9fd3('0x5'));var auth=require(_0x9fd3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x9fd3('0x7')]('/',auth[_0x9fd3('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9fd3('0x9')]);router[_0x9fd3('0x7')]('/:id',auth[_0x9fd3('0x8')](),controller[_0x9fd3('0xa')]);router[_0x9fd3('0xb')]('/',auth[_0x9fd3('0x8')](),controller['create']);router['put'](_0x9fd3('0xc'),auth[_0x9fd3('0x8')](),controller[_0x9fd3('0xd')]);router['delete'](_0x9fd3('0xc'),auth[_0x9fd3('0x8')](),controller[_0x9fd3('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 197b66d..2351d92 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 _0x777d=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x2b786d,_0x3c542e){var _0x6accfc=function(_0x326dd9){while(--_0x326dd9){_0x2b786d['push'](_0x2b786d['shift']());}};_0x6accfc(++_0x3c542e);}(_0x777d,0xe9));var _0xd777=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x777d[_0xfcbcb8];return _0x1b1f97;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'type':{'type':Sequelize[_0xd777('0x1')]},'uniqueid':{'type':Sequelize[_0xd777('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd777('0x1')]},'queue':{'type':Sequelize[_0xd777('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd777('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xd777('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xd777('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd777('0x3')]},'agentacw':{'type':Sequelize[_0xd777('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd777('0x3')]},'reason':{'type':Sequelize[_0xd777('0x1')]},'lastevent':{'type':Sequelize[_0xd777('0x1')]},'channel':{'type':Sequelize[_0xd777('0x1')]},'channelstate':{'type':Sequelize[_0xd777('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd777('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd777('0x1')]},'connectedlinename':{'type':Sequelize[_0xd777('0x1')]},'language':{'type':Sequelize[_0xd777('0x1')]},'accountcode':{'type':Sequelize[_0xd777('0x1')]},'context':{'type':Sequelize[_0xd777('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd777('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd777('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd777('0x1')]},'destcalleridname':{'type':Sequelize[_0xd777('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd777('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd777('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xd777('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd777('0x1')]},'destpriority':{'type':Sequelize[_0xd777('0x1')]},'destuniqueid':{'type':Sequelize[_0xd777('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd777('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd777('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd777('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd777('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xd777('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdc9b=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x59aaff,_0x275686){var _0x1cb0a9=function(_0x32ad42){while(--_0x32ad42){_0x59aaff['push'](_0x59aaff['shift']());}};_0x1cb0a9(++_0x275686);}(_0xdc9b,0x70));var _0xbdc9=function(_0x486523,_0x391f72){_0x486523=_0x486523-0x0;var _0x2099d7=_0xdc9b[_0x486523];return _0x2099d7;};'use strict';var Sequelize=require(_0xbdc9('0x0'));module[_0xbdc9('0x1')]={'type':{'type':Sequelize[_0xbdc9('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbdc9('0x2')]},'calleridname':{'type':Sequelize[_0xbdc9('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xbdc9('0x2')]},'agentcalledAt':{'type':Sequelize[_0xbdc9('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xbdc9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xbdc9('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xbdc9('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xbdc9('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xbdc9('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xbdc9('0x4')]},'agentacw':{'type':Sequelize[_0xbdc9('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbdc9('0x4')]},'reason':{'type':Sequelize[_0xbdc9('0x2')]},'lastevent':{'type':Sequelize[_0xbdc9('0x2')]},'channel':{'type':Sequelize[_0xbdc9('0x2')]},'channelstate':{'type':Sequelize[_0xbdc9('0x4')]},'channelstatedesc':{'type':Sequelize[_0xbdc9('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbdc9('0x2')]},'connectedlinename':{'type':Sequelize[_0xbdc9('0x2')]},'language':{'type':Sequelize[_0xbdc9('0x2')]},'accountcode':{'type':Sequelize[_0xbdc9('0x2')]},'context':{'type':Sequelize[_0xbdc9('0x2')]},'exten':{'type':Sequelize[_0xbdc9('0x2')]},'priority':{'type':Sequelize[_0xbdc9('0x2')]},'destchannel':{'type':Sequelize[_0xbdc9('0x2')]},'destchannelstate':{'type':Sequelize[_0xbdc9('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xbdc9('0x2')]},'destcalleridnum':{'type':Sequelize[_0xbdc9('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xbdc9('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xbdc9('0x2')]},'destcontext':{'type':Sequelize[_0xbdc9('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xbdc9('0x2')]},'destuniqueid':{'type':Sequelize[_0xbdc9('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xbdc9('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xbdc9('0x2')]},'transfer':{'type':Sequelize[_0xbdc9('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbdc9('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xbdc9('0x2')]},'agententerreason':{'type':Sequelize[_0xbdc9('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 0c4f668..867ef69 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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 db85211..5fede8c 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 _0x06f4=['api','moment','path','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','util'];(function(_0x206cbd,_0x2068c1){var _0x27a307=function(_0x13df8f){while(--_0x13df8f){_0x206cbd['push'](_0x206cbd['shift']());}};_0x27a307(++_0x2068c1);}(_0x06f4,0x136));var _0x406f=function(_0x239276,_0x40ba23){_0x239276=_0x239276-0x0;var _0x58dd3e=_0x06f4[_0x239276];return _0x58dd3e;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var logger=require('../../config/logger')(_0x406f('0x2'));var moment=require(_0x406f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x406f('0x4'));var rimraf=require('rimraf');var config=require(_0x406f('0x5'));var attributes=require(_0x406f('0x6'));module[_0x406f('0x7')]=function(_0x32b2bd,_0x59821c){return _0x32b2bd[_0x406f('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x406f('0x9'),'paranoid':![],'indexes':[{'fields':[_0x406f('0xa'),_0x406f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ab=['moment','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1d13c8,_0x1554e6){var _0x3a3b03=function(_0x3d488d){while(--_0x3d488d){_0x1d13c8['push'](_0x1d13c8['shift']());}};_0x3a3b03(++_0x1554e6);}(_0xc6ab,0x96));var _0xbc6a=function(_0x44823a,_0x2f3404){_0x44823a=_0x44823a-0x0;var _0x17920c=_0xc6ab[_0x44823a];return _0x17920c;};'use strict';var _=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var logger=require(_0xbc6a('0x2'))(_0xbc6a('0x3'));var moment=require(_0xbc6a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc6a('0x5'));var rimraf=require(_0xbc6a('0x6'));var config=require(_0xbc6a('0x7'));var attributes=require(_0xbc6a('0x8'));module[_0xbc6a('0x9')]=function(_0x4ccd07,_0x45ed96){return _0x4ccd07[_0xbc6a('0xa')](_0xbc6a('0xb'),attributes,{'tableName':_0xbc6a('0xc'),'paranoid':![],'indexes':[{'fields':[_0xbc6a('0xd'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 5d3e2f6..ecc7e2b 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 _0x036a=['util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','body','raw','catch','update','options','where','attributes','limit','UpdateVoiceAgentReport'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x036a,0xf0));var _0xa036=function(_0x38f789,_0x33c8f5){_0x38f789=_0x38f789-0x0;var _0x285033=_0x036a[_0x38f789];return _0x285033;};'use strict';var _=require('lodash');var util=require(_0xa036('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa036('0x1'));var fs=require('fs');var Redis=require(_0xa036('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa036('0x3'));var logger=require(_0xa036('0x4'))(_0xa036('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa036('0x6')][_0xa036('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d8424,_0x9ff675,_0x319467){return new BPromise(function(_0x5a4b4c,_0x2e735b){return client[_0xa036('0x8')](_0x4d8424,_0x319467)[_0xa036('0x9')](function(_0x405aa0){logger[_0xa036('0xa')](_0xa036('0xb'),_0x9ff675,'request\x20sent');logger[_0xa036('0xc')](_0xa036('0xd'),_0x9ff675,'request\x20sent',JSON[_0xa036('0xe')](_0x405aa0));if(_0x405aa0[_0xa036('0xf')]){if(_0x405aa0[_0xa036('0xf')][_0xa036('0x10')]===0x1f4){logger['error'](_0xa036('0xb'),_0x9ff675,_0x405aa0['error'][_0xa036('0x11')]);return _0x2e735b(_0x405aa0[_0xa036('0xf')]['message']);}logger['error'](_0xa036('0xb'),_0x9ff675,_0x405aa0[_0xa036('0xf')][_0xa036('0x11')]);return _0x5a4b4c(_0x405aa0['error']['message']);}else{logger[_0xa036('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x9ff675,'request\x20sent');_0x5a4b4c(_0x405aa0[_0xa036('0x12')][_0xa036('0x11')]);}})['catch'](function(_0x1e7818){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x9ff675,_0x1e7818);_0x2e735b(_0x1e7818);});});}exports[_0xa036('0x13')]=function(_0xc8114e){var _0x4b8254=this;return new Promise(function(_0x124722,_0x51dcb6){return db[_0xa036('0x14')]['create'](_0xc8114e[_0xa036('0x15')],{'raw':_0xc8114e['options']?_0xc8114e['options'][_0xa036('0x16')]===undefined?!![]:![]:!![]})[_0xa036('0x9')](function(_0x29bf84){logger[_0xa036('0xa')](_0xa036('0x13'),_0xc8114e);logger[_0xa036('0xc')]('CreateVoiceAgentReport',_0xc8114e,JSON[_0xa036('0xe')](_0x29bf84));_0x124722(_0x29bf84);})[_0xa036('0x17')](function(_0x814697){logger['error'](_0xa036('0x13'),_0x814697[_0xa036('0x11')],_0xc8114e);_0x51dcb6(_0x4b8254['error'](0x1f4,_0x814697['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x350535){var _0x4d6ff8=this;return new Promise(function(_0x40438d,_0x491322){return db[_0xa036('0x14')][_0xa036('0x18')](_0x350535[_0xa036('0x15')],{'raw':_0x350535[_0xa036('0x19')]?_0x350535['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x350535[_0xa036('0x19')]?_0x350535[_0xa036('0x19')][_0xa036('0x1a')]||null:null,'attributes':_0x350535[_0xa036('0x19')]?_0x350535[_0xa036('0x19')][_0xa036('0x1b')]||null:null,'limit':_0x350535[_0xa036('0x19')]?_0x350535[_0xa036('0x19')][_0xa036('0x1c')]||null:null})[_0xa036('0x9')](function(_0x38a5a2){logger[_0xa036('0xa')](_0xa036('0x1d'),_0x350535);logger[_0xa036('0xc')]('UpdateVoiceAgentReport',_0x350535,JSON[_0xa036('0xe')](_0x38a5a2));_0x40438d(_0x38a5a2);})['catch'](function(_0x3d9441){logger[_0xa036('0xf')](_0xa036('0x1d'),_0x3d9441[_0xa036('0x11')],_0x350535);_0x491322(_0x4d6ff8[_0xa036('0xf')](0x1f4,_0x3d9441[_0xa036('0x11')]));});});}; \ No newline at end of file +var _0xe2af=['update','attributes','limit','UpdateVoiceAgentReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','VoiceAgentReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw'];(function(_0x255036,_0xf94145){var _0x3c4c56=function(_0x50a35c){while(--_0x50a35c){_0x255036['push'](_0x255036['shift']());}};_0x3c4c56(++_0xf94145);}(_0xe2af,0xc4));var _0xfe2a=function(_0x5aa24e,_0x195c5d){_0x5aa24e=_0x5aa24e-0x0;var _0x5f4e73=_0xe2af[_0x5aa24e];return _0x5f4e73;};'use strict';var _=require('lodash');var util=require(_0xfe2a('0x0'));var moment=require(_0xfe2a('0x1'));var BPromise=require(_0xfe2a('0x2'));var rs=require(_0xfe2a('0x3'));var fs=require('fs');var Redis=require(_0xfe2a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe2a('0x5'));var logger=require(_0xfe2a('0x6'))(_0xfe2a('0x7'));var config=require('../../config/environment');var jayson=require(_0xfe2a('0x8'));var client=jayson[_0xfe2a('0x9')][_0xfe2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a2684,_0x206c9a,_0x569c47){return new BPromise(function(_0x4f8edd,_0x32c3ef){return client[_0xfe2a('0xb')](_0x5a2684,_0x569c47)[_0xfe2a('0xc')](function(_0x59f2e5){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x206c9a,_0xfe2a('0xd'));logger[_0xfe2a('0xe')](_0xfe2a('0xf'),_0x206c9a,_0xfe2a('0xd'),JSON['stringify'](_0x59f2e5));if(_0x59f2e5[_0xfe2a('0x10')]){if(_0x59f2e5[_0xfe2a('0x10')][_0xfe2a('0x11')]===0x1f4){logger[_0xfe2a('0x10')](_0xfe2a('0x12'),_0x206c9a,_0x59f2e5[_0xfe2a('0x10')][_0xfe2a('0x13')]);return _0x32c3ef(_0x59f2e5['error'][_0xfe2a('0x13')]);}logger[_0xfe2a('0x10')](_0xfe2a('0x12'),_0x206c9a,_0x59f2e5[_0xfe2a('0x10')][_0xfe2a('0x13')]);return _0x4f8edd(_0x59f2e5['error']['message']);}else{logger[_0xfe2a('0x14')](_0xfe2a('0x12'),_0x206c9a,_0xfe2a('0xd'));_0x4f8edd(_0x59f2e5[_0xfe2a('0x15')][_0xfe2a('0x13')]);}})[_0xfe2a('0x16')](function(_0x22f8ac){logger[_0xfe2a('0x10')](_0xfe2a('0x12'),_0x206c9a,_0x22f8ac);_0x32c3ef(_0x22f8ac);});});}exports[_0xfe2a('0x17')]=function(_0x3c760d){var _0x17c45b=this;return new Promise(function(_0xc48615,_0x4453c6){return db[_0xfe2a('0x18')]['create'](_0x3c760d[_0xfe2a('0x19')],{'raw':_0x3c760d['options']?_0x3c760d[_0xfe2a('0x1a')][_0xfe2a('0x1b')]===undefined?!![]:![]:!![]})[_0xfe2a('0xc')](function(_0x1f0b2a){logger[_0xfe2a('0x14')](_0xfe2a('0x17'),_0x3c760d);logger['debug'](_0xfe2a('0x17'),_0x3c760d,JSON['stringify'](_0x1f0b2a));_0xc48615(_0x1f0b2a);})['catch'](function(_0x51dd4e){logger[_0xfe2a('0x10')]('CreateVoiceAgentReport',_0x51dd4e[_0xfe2a('0x13')],_0x3c760d);_0x4453c6(_0x17c45b[_0xfe2a('0x10')](0x1f4,_0x51dd4e[_0xfe2a('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x411172){var _0x2865a2=this;return new Promise(function(_0x1bb348,_0x29a174){return db[_0xfe2a('0x18')][_0xfe2a('0x1c')](_0x411172[_0xfe2a('0x19')],{'raw':_0x411172[_0xfe2a('0x1a')]?_0x411172[_0xfe2a('0x1a')][_0xfe2a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x411172[_0xfe2a('0x1a')]?_0x411172['options']['where']||null:null,'attributes':_0x411172[_0xfe2a('0x1a')]?_0x411172[_0xfe2a('0x1a')][_0xfe2a('0x1d')]||null:null,'limit':_0x411172[_0xfe2a('0x1a')]?_0x411172['options'][_0xfe2a('0x1e')]||null:null})[_0xfe2a('0xc')](function(_0x26ba0e){logger[_0xfe2a('0x14')](_0xfe2a('0x1f'),_0x411172);logger['debug'](_0xfe2a('0x1f'),_0x411172,JSON['stringify'](_0x26ba0e));_0x1bb348(_0x26ba0e);})[_0xfe2a('0x16')](function(_0x2b8b0c){logger[_0xfe2a('0x10')](_0xfe2a('0x1f'),_0x2b8b0c[_0xfe2a('0x13')],_0x411172);_0x29a174(_0x2865a2[_0xfe2a('0x10')](0x1f4,_0x2b8b0c[_0xfe2a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 3ddf6de..ab93745 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 _0x9b67=['../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x188089,_0x43b0cf){var _0x157570=function(_0x4c1f5f){while(--_0x4c1f5f){_0x188089['push'](_0x188089['shift']());}};_0x157570(++_0x43b0cf);}(_0x9b67,0xf6));var _0x79b6=function(_0x221673,_0x1f46e5){_0x221673=_0x221673-0x0;var _0x1c0023=_0x9b67[_0x221673];return _0x1c0023;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),auth[_0x79b6('0x9')](),controller['describe']);router[_0x79b6('0x8')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xd')]);router[_0x79b6('0xe')]('/',auth['isAuthenticated'](),controller[_0x79b6('0xf')]);router[_0x79b6('0x10')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller['update']);router['delete'](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5fd1=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x32f01a,_0x2fc2c6){var _0x475db5=function(_0x46dded){while(--_0x46dded){_0x32f01a['push'](_0x32f01a['shift']());}};_0x475db5(++_0x2fc2c6);}(_0x5fd1,0x155));var _0x15fd=function(_0x2b1334,_0x22e93a){_0x2b1334=_0x2b1334-0x0;var _0x8c8a9=_0x5fd1[_0x2b1334];return _0x8c8a9;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./voiceCallReport.controller');router[_0x15fd('0x7')]('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0x9')]);router[_0x15fd('0x7')](_0x15fd('0xa'),auth['isAuthenticated'](),controller[_0x15fd('0xb')]);router[_0x15fd('0x7')](_0x15fd('0xc'),auth['isAuthenticated'](),controller[_0x15fd('0xd')]);router['post']('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xf')]);router[_0x15fd('0x10')](_0x15fd('0xc'),auth[_0x15fd('0x8')](),controller[_0x15fd('0x11')]);module[_0x15fd('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index c1af8a4..7d35679 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 _0x94df=['internal','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x94df,0xa3));var _0xf94d=function(_0x418df4,_0x32ff0e){_0x418df4=_0x418df4-0x0;var _0x5b85d8=_0x94df[_0x418df4];return _0x5b85d8;};'use strict';var Sequelize=require(_0xf94d('0x0'));module[_0xf94d('0x1')]={'uniqueid':{'type':Sequelize[_0xf94d('0x2')]},'type':{'type':Sequelize[_0xf94d('0x3')](_0xf94d('0x4'),_0xf94d('0x5'),'outbound',_0xf94d('0x6'),_0xf94d('0x7'),_0xf94d('0x8'))},'tag':{'type':Sequelize[_0xf94d('0x2')]},'accountcode':{'type':Sequelize[_0xf94d('0x2')]},'source':{'type':Sequelize[_0xf94d('0x2')]},'destination':{'type':Sequelize[_0xf94d('0x2')]},'destinationcontext':{'type':Sequelize[_0xf94d('0x2')]},'callerid':{'type':Sequelize[_0xf94d('0x2')]},'channel':{'type':Sequelize[_0xf94d('0x2')]},'destinationchannel':{'type':Sequelize[_0xf94d('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf94d('0x9')]},'starttime':{'type':Sequelize[_0xf94d('0xa')]},'systemanswertime':{'type':Sequelize[_0xf94d('0xa')]},'answertime':{'type':Sequelize[_0xf94d('0xa')]},'endtime':{'type':Sequelize[_0xf94d('0xa')]},'duration':{'type':Sequelize[_0xf94d('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xf94d('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf94d('0x2')]},'amaflags':{'type':Sequelize[_0xf94d('0x2')]},'userfield':{'type':Sequelize[_0xf94d('0x2')]},'userDisposition':{'type':Sequelize[_0xf94d('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf94d('0x2')]},'prefix':{'type':Sequelize[_0xf94d('0x2')]},'routeid':{'type':Sequelize[_0xf94d('0xb')]},'sipcallid':{'type':Sequelize[_0xf94d('0x2')]}}; \ No newline at end of file +var _0xacf7=['outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','inbound-fax'];(function(_0xbc8107,_0x30b575){var _0x2cfd3b=function(_0x317441){while(--_0x317441){_0xbc8107['push'](_0xbc8107['shift']());}};_0x2cfd3b(++_0x30b575);}(_0xacf7,0x1bd));var _0x7acf=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xacf7[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x7acf('0x0'));module[_0x7acf('0x1')]={'uniqueid':{'type':Sequelize[_0x7acf('0x2')]},'type':{'type':Sequelize[_0x7acf('0x3')](_0x7acf('0x4'),'internal','outbound',_0x7acf('0x5'),_0x7acf('0x6'),_0x7acf('0x7'))},'tag':{'type':Sequelize[_0x7acf('0x2')]},'accountcode':{'type':Sequelize[_0x7acf('0x2')]},'source':{'type':Sequelize[_0x7acf('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x7acf('0x2')]},'callerid':{'type':Sequelize[_0x7acf('0x2')]},'channel':{'type':Sequelize[_0x7acf('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x7acf('0x2')]},'lastdata':{'type':Sequelize[_0x7acf('0x8')]},'starttime':{'type':Sequelize[_0x7acf('0x9')]},'systemanswertime':{'type':Sequelize[_0x7acf('0x9')]},'answertime':{'type':Sequelize[_0x7acf('0x9')]},'endtime':{'type':Sequelize[_0x7acf('0x9')]},'duration':{'type':Sequelize[_0x7acf('0xa')]},'billableseconds':{'type':Sequelize[_0x7acf('0xa')]},'mohtime':{'type':Sequelize[_0x7acf('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7acf('0x2')]},'amaflags':{'type':Sequelize[_0x7acf('0x2')]},'userfield':{'type':Sequelize[_0x7acf('0x2')]},'userDisposition':{'type':Sequelize[_0x7acf('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x7acf('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x7acf('0x2')]},'note':{'type':Sequelize[_0x7acf('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x7acf('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ccd6ac4..eb3c59a 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(_0x22814f,_0x3b4afc){var _0x523be1=function(_0x582395){while(--_0x582395){_0x22814f['push'](_0x22814f['shift']());}};_0x523be1(++_0x3b4afc);}(_0x0b0e,0x187));var _0xe0b0=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0x0b0e[_0x368587];return _0x42d33c;};'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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x237dd0,_0x1ca7b4){var _0x1d6280=function(_0x509b7c){while(--_0x509b7c){_0x237dd0['push'](_0x237dd0['shift']());}};_0x1d6280(++_0x1ca7b4);}(_0xdb28,0x106));var _0x8db2=function(_0x1bfade,_0x27e2ec){_0x1bfade=_0x1bfade-0x0;var _0x27f624=_0xdb28[_0x1bfade];return _0x27f624;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 63e3744..737f5f3 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 _0xcc73=['util','../../config/logger','bluebird','path','./voiceCallReport.attributes','exports','define','report_call','uniqueid'];(function(_0x498b9e,_0x46ae26){var _0x29dd57=function(_0x56f191){while(--_0x56f191){_0x498b9e['push'](_0x498b9e['shift']());}};_0x29dd57(++_0x46ae26);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xcc73[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var logger=require(_0x3cc7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3cc7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cc7('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3cc7('0x4'));module[_0x3cc7('0x5')]=function(_0x1ccad1,_0x10d0f9){return _0x1ccad1[_0x3cc7('0x6')]('VoiceCallReport',attributes,{'tableName':_0x3cc7('0x7'),'paranoid':![],'indexes':[{'fields':[_0x3cc7('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba50=['bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceCallReport','report_call','lodash','util','../../config/logger','api','moment'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xba50,0x15a));var _0x0ba5=function(_0x19f1cc,_0x36b541){_0x19f1cc=_0x19f1cc-0x0;var _0x1f38cc=_0xba50[_0x19f1cc];return _0x1f38cc;};'use strict';var _=require(_0x0ba5('0x0'));var util=require(_0x0ba5('0x1'));var logger=require(_0x0ba5('0x2'))(_0x0ba5('0x3'));var moment=require(_0x0ba5('0x4'));var BPromise=require(_0x0ba5('0x5'));var rp=require(_0x0ba5('0x6'));var fs=require('fs');var path=require(_0x0ba5('0x7'));var rimraf=require(_0x0ba5('0x8'));var config=require(_0x0ba5('0x9'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x441c35,_0x4f0471){return _0x441c35[_0x0ba5('0xa')](_0x0ba5('0xb'),attributes,{'tableName':_0x0ba5('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 067367d..d226a75 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 _0x7ac0=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceCallReport','findAll','options','raw','where','attributes','include','map','model','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','limit','catch'];(function(_0x4635c9,_0x54cd69){var _0x2901e0=function(_0x5d500a){while(--_0x5d500a){_0x4635c9['push'](_0x4635c9['shift']());}};_0x2901e0(++_0x54cd69);}(_0x7ac0,0x98));var _0x07ac=function(_0xf48dea,_0x44a2c7){_0xf48dea=_0xf48dea-0x0;var _0x1ca3e3=_0x7ac0[_0xf48dea];return _0x1ca3e3;};'use strict';var _=require(_0x07ac('0x0'));var util=require(_0x07ac('0x1'));var moment=require(_0x07ac('0x2'));var BPromise=require(_0x07ac('0x3'));var rs=require(_0x07ac('0x4'));var fs=require('fs');var Redis=require(_0x07ac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x07ac('0x6'));var logger=require(_0x07ac('0x7'))('rpc');var config=require(_0x07ac('0x8'));var jayson=require(_0x07ac('0x9'));var client=jayson[_0x07ac('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20ddf5,_0x4ef76a,_0x1ba662){return new BPromise(function(_0x376ddd,_0x569925){return client['request'](_0x20ddf5,_0x1ba662)[_0x07ac('0xb')](function(_0x593531){logger['info'](_0x07ac('0xc'),_0x4ef76a,_0x07ac('0xd'));logger[_0x07ac('0xe')](_0x07ac('0xf'),_0x4ef76a,_0x07ac('0xd'),JSON[_0x07ac('0x10')](_0x593531));if(_0x593531[_0x07ac('0x11')]){if(_0x593531[_0x07ac('0x11')][_0x07ac('0x12')]===0x1f4){logger['error'](_0x07ac('0xc'),_0x4ef76a,_0x593531[_0x07ac('0x11')]['message']);return _0x569925(_0x593531['error'][_0x07ac('0x13')]);}logger[_0x07ac('0x11')](_0x07ac('0xc'),_0x4ef76a,_0x593531[_0x07ac('0x11')][_0x07ac('0x13')]);return _0x376ddd(_0x593531[_0x07ac('0x11')]['message']);}else{logger[_0x07ac('0x14')](_0x07ac('0xc'),_0x4ef76a,'request\x20sent');_0x376ddd(_0x593531[_0x07ac('0x15')][_0x07ac('0x13')]);}})['catch'](function(_0x56251c){logger['error'](_0x07ac('0xc'),_0x4ef76a,_0x56251c);_0x569925(_0x56251c);});});}exports[_0x07ac('0x16')]=function(_0x5f598d){var _0x4a6dfd=this;return new Promise(function(_0x5f4acd,_0x25378a){return db['VoiceCallReport'][_0x07ac('0x17')]({'raw':_0x5f598d['options']?_0x5f598d[_0x07ac('0x18')][_0x07ac('0x19')]===undefined?!![]:![]:!![],'where':_0x5f598d[_0x07ac('0x18')]?_0x5f598d[_0x07ac('0x18')][_0x07ac('0x1a')]||null:null,'attributes':_0x5f598d[_0x07ac('0x18')]?_0x5f598d[_0x07ac('0x18')][_0x07ac('0x1b')]||null:null,'limit':_0x5f598d[_0x07ac('0x18')]?_0x5f598d['options']['limit']||null:null,'include':_0x5f598d[_0x07ac('0x18')]?_0x5f598d['options'][_0x07ac('0x1c')]?_[_0x07ac('0x1d')](_0x5f598d[_0x07ac('0x18')][_0x07ac('0x1c')],function(_0xe2469a){return{'model':db[_0xe2469a['model']],'as':_0xe2469a['as'],'attributes':_0xe2469a['attributes'],'include':_0xe2469a[_0x07ac('0x1c')]?_[_0x07ac('0x1d')](_0xe2469a['include'],function(_0x71a091){return{'model':db[_0x71a091[_0x07ac('0x1e')]],'as':_0x71a091['as'],'attributes':_0x71a091['attributes'],'include':_0x71a091['include']?_[_0x07ac('0x1d')](_0x71a091[_0x07ac('0x1c')],function(_0x3ab8b7){return{'model':db[_0x3ab8b7[_0x07ac('0x1e')]],'as':_0x3ab8b7['as'],'attributes':_0x3ab8b7[_0x07ac('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15d9e2){logger['info'](_0x07ac('0x16'),_0x5f598d);logger[_0x07ac('0xe')](_0x07ac('0x16'),_0x5f598d,JSON[_0x07ac('0x10')](_0x15d9e2));_0x5f4acd(_0x15d9e2);})['catch'](function(_0x98f02c){logger[_0x07ac('0x11')]('GetVoiceCallReport',_0x98f02c[_0x07ac('0x13')],_0x5f598d);_0x25378a(_0x4a6dfd['error'](0x1f4,_0x98f02c[_0x07ac('0x13')]));});});};exports[_0x07ac('0x1f')]=function(_0x596867){var _0x28c2dd=this;return new Promise(function(_0x3d8300,_0x30abc4){return db[_0x07ac('0x20')][_0x07ac('0x21')](_0x596867[_0x07ac('0x22')],{'raw':_0x596867[_0x07ac('0x18')]?_0x596867[_0x07ac('0x18')][_0x07ac('0x19')]===undefined?!![]:![]:!![]})[_0x07ac('0xb')](function(_0xf1716c){logger[_0x07ac('0x14')](_0x07ac('0x1f'),_0x596867);logger['debug'](_0x07ac('0x1f'),_0x596867,JSON['stringify'](_0xf1716c));_0x3d8300(_0xf1716c);})['catch'](function(_0x15a536){logger[_0x07ac('0x11')](_0x07ac('0x1f'),_0x15a536[_0x07ac('0x13')],_0x596867);_0x30abc4(_0x28c2dd[_0x07ac('0x11')](0x1f4,_0x15a536[_0x07ac('0x13')]));});});};exports[_0x07ac('0x23')]=function(_0x3b7e40){var _0x1438a7=this;return new Promise(function(_0x2d89cb,_0x4d3cc6){return db[_0x07ac('0x20')]['update'](_0x3b7e40[_0x07ac('0x22')],{'raw':_0x3b7e40[_0x07ac('0x18')]?_0x3b7e40[_0x07ac('0x18')][_0x07ac('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b7e40[_0x07ac('0x18')]?_0x3b7e40['options'][_0x07ac('0x1a')]||null:null,'attributes':_0x3b7e40[_0x07ac('0x18')]?_0x3b7e40[_0x07ac('0x18')][_0x07ac('0x1b')]||null:null,'limit':_0x3b7e40[_0x07ac('0x18')]?_0x3b7e40[_0x07ac('0x18')][_0x07ac('0x24')]||null:null})[_0x07ac('0xb')](function(_0x18faa7){logger[_0x07ac('0x14')](_0x07ac('0x23'),_0x3b7e40);logger['debug']('UpdateVoiceCallReport',_0x3b7e40,JSON[_0x07ac('0x10')](_0x18faa7));_0x2d89cb(_0x18faa7);})[_0x07ac('0x25')](function(_0x38fb59){logger[_0x07ac('0x11')](_0x07ac('0x23'),_0x38fb59[_0x07ac('0x13')],_0x3b7e40);_0x4d3cc6(_0x1438a7[_0x07ac('0x11')](0x1f4,_0x38fb59[_0x07ac('0x13')]));});});}; \ No newline at end of file +var _0x7227=['message','result','catch','VoiceCallReport','findAll','options','where','include','map','model','attributes','GetVoiceCallReport','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x422bd4,_0x18d068){var _0x486bd7=function(_0x53418d){while(--_0x53418d){_0x422bd4['push'](_0x422bd4['shift']());}};_0x486bd7(++_0x18d068);}(_0x7227,0x8e));var _0x7722=function(_0x49e065,_0x1cf4bf){_0x49e065=_0x49e065-0x0;var _0x1dd607=_0x7227[_0x49e065];return _0x1dd607;};'use strict';var _=require(_0x7722('0x0'));var util=require(_0x7722('0x1'));var moment=require(_0x7722('0x2'));var BPromise=require('bluebird');var rs=require(_0x7722('0x3'));var fs=require('fs');var Redis=require(_0x7722('0x4'));var db=require(_0x7722('0x5'))['db'];var utils=require(_0x7722('0x6'));var logger=require(_0x7722('0x7'))(_0x7722('0x8'));var config=require(_0x7722('0x9'));var jayson=require(_0x7722('0xa'));var client=jayson['client'][_0x7722('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41fcdc,_0x8b631e,_0xee8903){return new BPromise(function(_0x556af8,_0x158000){return client[_0x7722('0xc')](_0x41fcdc,_0xee8903)[_0x7722('0xd')](function(_0x1a820e){logger[_0x7722('0xe')](_0x7722('0xf'),_0x8b631e,_0x7722('0x10'));logger[_0x7722('0x11')](_0x7722('0x12'),_0x8b631e,_0x7722('0x10'),JSON[_0x7722('0x13')](_0x1a820e));if(_0x1a820e[_0x7722('0x14')]){if(_0x1a820e['error'][_0x7722('0x15')]===0x1f4){logger[_0x7722('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x8b631e,_0x1a820e[_0x7722('0x14')][_0x7722('0x16')]);return _0x158000(_0x1a820e[_0x7722('0x14')][_0x7722('0x16')]);}logger[_0x7722('0x14')](_0x7722('0xf'),_0x8b631e,_0x1a820e[_0x7722('0x14')][_0x7722('0x16')]);return _0x556af8(_0x1a820e[_0x7722('0x14')][_0x7722('0x16')]);}else{logger['info'](_0x7722('0xf'),_0x8b631e,_0x7722('0x10'));_0x556af8(_0x1a820e[_0x7722('0x17')][_0x7722('0x16')]);}})[_0x7722('0x18')](function(_0x361100){logger[_0x7722('0x14')](_0x7722('0xf'),_0x8b631e,_0x361100);_0x158000(_0x361100);});});}exports['GetVoiceCallReport']=function(_0x34cda1){var _0x56be61=this;return new Promise(function(_0x497f0c,_0x37acf1){return db[_0x7722('0x19')][_0x7722('0x1a')]({'raw':_0x34cda1[_0x7722('0x1b')]?_0x34cda1[_0x7722('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x34cda1[_0x7722('0x1b')]?_0x34cda1[_0x7722('0x1b')][_0x7722('0x1c')]||null:null,'attributes':_0x34cda1[_0x7722('0x1b')]?_0x34cda1['options']['attributes']||null:null,'limit':_0x34cda1[_0x7722('0x1b')]?_0x34cda1[_0x7722('0x1b')]['limit']||null:null,'include':_0x34cda1[_0x7722('0x1b')]?_0x34cda1['options'][_0x7722('0x1d')]?_[_0x7722('0x1e')](_0x34cda1[_0x7722('0x1b')][_0x7722('0x1d')],function(_0x37ab20){return{'model':db[_0x37ab20[_0x7722('0x1f')]],'as':_0x37ab20['as'],'attributes':_0x37ab20[_0x7722('0x20')],'include':_0x37ab20['include']?_[_0x7722('0x1e')](_0x37ab20['include'],function(_0x38ed08){return{'model':db[_0x38ed08[_0x7722('0x1f')]],'as':_0x38ed08['as'],'attributes':_0x38ed08['attributes'],'include':_0x38ed08[_0x7722('0x1d')]?_[_0x7722('0x1e')](_0x38ed08[_0x7722('0x1d')],function(_0x2c5fa6){return{'model':db[_0x2c5fa6[_0x7722('0x1f')]],'as':_0x2c5fa6['as'],'attributes':_0x2c5fa6[_0x7722('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7722('0xd')](function(_0x1c67b2){logger[_0x7722('0xe')](_0x7722('0x21'),_0x34cda1);logger[_0x7722('0x11')]('GetVoiceCallReport',_0x34cda1,JSON[_0x7722('0x13')](_0x1c67b2));_0x497f0c(_0x1c67b2);})[_0x7722('0x18')](function(_0x25679d){logger['error'](_0x7722('0x21'),_0x25679d[_0x7722('0x16')],_0x34cda1);_0x37acf1(_0x56be61[_0x7722('0x14')](0x1f4,_0x25679d[_0x7722('0x16')]));});});};exports[_0x7722('0x22')]=function(_0x255b07){var _0xffc54a=this;return new Promise(function(_0x488d1f,_0x1038a2){return db[_0x7722('0x19')][_0x7722('0x23')](_0x255b07[_0x7722('0x24')],{'raw':_0x255b07[_0x7722('0x1b')]?_0x255b07['options'][_0x7722('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x5d6b9f){logger['info'](_0x7722('0x22'),_0x255b07);logger['debug'](_0x7722('0x22'),_0x255b07,JSON[_0x7722('0x13')](_0x5d6b9f));_0x488d1f(_0x5d6b9f);})[_0x7722('0x18')](function(_0x52b177){logger[_0x7722('0x14')](_0x7722('0x22'),_0x52b177[_0x7722('0x16')],_0x255b07);_0x1038a2(_0xffc54a['error'](0x1f4,_0x52b177[_0x7722('0x16')]));});});};exports[_0x7722('0x26')]=function(_0xc55600){var _0x97bfea=this;return new Promise(function(_0x17342f,_0x10a599){return db[_0x7722('0x19')][_0x7722('0x27')](_0xc55600[_0x7722('0x24')],{'raw':_0xc55600[_0x7722('0x1b')]?_0xc55600[_0x7722('0x1b')][_0x7722('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc55600[_0x7722('0x1b')]?_0xc55600['options'][_0x7722('0x1c')]||null:null,'attributes':_0xc55600[_0x7722('0x1b')]?_0xc55600[_0x7722('0x1b')][_0x7722('0x20')]||null:null,'limit':_0xc55600[_0x7722('0x1b')]?_0xc55600[_0x7722('0x1b')][_0x7722('0x28')]||null:null})[_0x7722('0xd')](function(_0x16eb96){logger['info'](_0x7722('0x26'),_0xc55600);logger['debug'](_0x7722('0x26'),_0xc55600,JSON['stringify'](_0x16eb96));_0x17342f(_0x16eb96);})[_0x7722('0x18')](function(_0x359520){logger['error']('UpdateVoiceCallReport',_0x359520['message'],_0xc55600);_0x10a599(_0x97bfea[_0x7722('0x14')](0x1f4,_0x359520[_0x7722('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 6a6aa00..cb37315 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 _0xa236=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','index','/:id','isAuthenticated','show','post','create','update'];(function(_0x9c9d03,_0xe3d333){var _0x38ffe8=function(_0x57af2f){while(--_0x57af2f){_0x9c9d03['push'](_0x9c9d03['shift']());}};_0x38ffe8(++_0xe3d333);}(_0xa236,0xec));var _0x6a23=function(_0x5a4302,_0x2f8cc8){_0x5a4302=_0x5a4302-0x0;var _0x312b6e=_0xa236[_0x5a4302];return _0x312b6e;};'use strict';var multer=require('multer');var util=require(_0x6a23('0x0'));var path=require(_0x6a23('0x1'));var timeout=require(_0x6a23('0x2'));var express=require(_0x6a23('0x3'));var router=express[_0x6a23('0x4')]();var fs_extra=require(_0x6a23('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a23('0x6'));var config=require(_0x6a23('0x7'));var controller=require(_0x6a23('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6a23('0x9')]);router['get'](_0x6a23('0xa'),auth[_0x6a23('0xb')](),controller[_0x6a23('0xc')]);router[_0x6a23('0xd')]('/',auth[_0x6a23('0xb')](),controller[_0x6a23('0xe')]);router['put'](_0x6a23('0xa'),auth[_0x6a23('0xb')](),controller[_0x6a23('0xf')]);router['delete'](_0x6a23('0xa'),auth[_0x6a23('0xb')](),controller[_0x6a23('0x10')]);module[_0x6a23('0x11')]=router; \ No newline at end of file +var _0x1fa3=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x1fa3,0xc9));var _0x31fa=function(_0x1fe99e,_0x4b6ad8){_0x1fe99e=_0x1fe99e-0x0;var _0x8b030c=_0x1fa3[_0x1fe99e];return _0x8b030c;};'use strict';var multer=require('multer');var util=require(_0x31fa('0x0'));var path=require(_0x31fa('0x1'));var timeout=require(_0x31fa('0x2'));var express=require(_0x31fa('0x3'));var router=express['Router']();var fs_extra=require(_0x31fa('0x4'));var auth=require(_0x31fa('0x5'));var interaction=require(_0x31fa('0x6'));var config=require(_0x31fa('0x7'));var controller=require(_0x31fa('0x8'));router[_0x31fa('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x31fa('0x9')](_0x31fa('0xa'),auth[_0x31fa('0xb')](),controller[_0x31fa('0xc')]);router[_0x31fa('0xd')]('/',auth[_0x31fa('0xb')](),controller[_0x31fa('0xe')]);router[_0x31fa('0xf')](_0x31fa('0xa'),auth[_0x31fa('0xb')](),controller[_0x31fa('0x10')]);router[_0x31fa('0x11')]('/:id',auth[_0x31fa('0xb')](),controller[_0x31fa('0x12')]);module[_0x31fa('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index d7077e5..d9d08c1 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 _0x2f01=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f01,0xc9));var _0x12f0=function(_0xcf4c8,_0x52a7d2){_0xcf4c8=_0xcf4c8-0x0;var _0x2a285f=_0x2f01[_0xcf4c8];return _0x2a285f;};'use strict';var Sequelize=require(_0x12f0('0x0'));module[_0x12f0('0x1')]={'name':{'type':Sequelize[_0x12f0('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x12f0('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x12f0('0x2')],'set':function(_0x3b2ca5){this[_0x12f0('0x4')](_0x12f0('0x5'),_0x3b2ca5?_0x3b2ca5[_0x12f0('0x6')](''):[]);},'get':function(){return this[_0x12f0('0x7')]('options')?this[_0x12f0('0x7')](_0x12f0('0x5'))[_0x12f0('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x12f0('0x2')]},'record':{'type':Sequelize[_0x12f0('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x12f0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdb31=['setDataValue','join','getDataValue','options','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0xdb31,0xf9));var _0x1db3=function(_0xe27035,_0x1f4876){_0xe27035=_0xe27035-0x0;var _0x3745bc=_0xdb31[_0xe27035];return _0x3745bc;};'use strict';var Sequelize=require(_0x1db3('0x0'));module[_0x1db3('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x1db3('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x1db3('0x2')],'set':function(_0x35b1a1){this[_0x1db3('0x3')]('options',_0x35b1a1?_0x35b1a1[_0x1db3('0x4')](''):[]);},'get':function(){return this[_0x1db3('0x5')](_0x1db3('0x6'))?this[_0x1db3('0x5')](_0x1db3('0x6'))[_0x1db3('0x7')](''):[];}},'auth':{'type':Sequelize[_0x1db3('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x1db3('0x2')]},'record':{'type':Sequelize[_0x1db3('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1db3('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 22c2c6c..852d961 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 _0x7834=['create','body','user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','name','send','index','VoiceChanSpy','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','rawAttributes','catch'];(function(_0x4e9a22,_0x65e645){var _0x364420=function(_0x4ecb09){while(--_0x4ecb09){_0x4e9a22['push'](_0x4e9a22['shift']());}};_0x364420(++_0x65e645);}(_0x7834,0x13f));var _0x4783=function(_0x4e04a8,_0x2f2d6a){_0x4e04a8=_0x4e04a8-0x0;var _0x6c3e6f=_0x7834[_0x4e04a8];return _0x6c3e6f;};'use strict';var emlformat=require(_0x4783('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4783('0x1'));var rp=require('request-promise');var moment=require(_0x4783('0x2'));var BPromise=require(_0x4783('0x3'));var Mustache=require(_0x4783('0x4'));var util=require(_0x4783('0x5'));var path=require(_0x4783('0x6'));var sox=require(_0x4783('0x7'));var csv=require(_0x4783('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4783('0x9'));var _=require(_0x4783('0xa'));var squel=require('squel');var crypto=require(_0x4783('0xb'));var jsforce=require(_0x4783('0xc'));var deskjs=require(_0x4783('0xd'));var toCsv=require(_0x4783('0x8'));var querystring=require(_0x4783('0xe'));var Papa=require(_0x4783('0xf'));var Redis=require('ioredis');var authService=require(_0x4783('0x10'));var qs=require(_0x4783('0x11'));var as=require(_0x4783('0x12'));var hardwareService=require(_0x4783('0x13'));var logger=require(_0x4783('0x14'))(_0x4783('0x15'));var utils=require(_0x4783('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4783('0x17'))['db'];function respondWithStatusCode(_0x85087d,_0x4ce944){_0x4ce944=_0x4ce944||0xcc;return function(_0x2afbdc){if(_0x2afbdc){return _0x85087d['sendStatus'](_0x4ce944);}return _0x85087d[_0x4783('0x18')](_0x4ce944)[_0x4783('0x19')]();};}function respondWithResult(_0x41d853,_0xecb9f9){_0xecb9f9=_0xecb9f9||0xc8;return function(_0x230ae6){if(_0x230ae6){return _0x41d853['status'](_0xecb9f9)[_0x4783('0x1a')](_0x230ae6);}};}function respondWithFilteredResult(_0x225443,_0x11e996){return function(_0x20788f){if(_0x20788f){var _0x3cb485=typeof _0x11e996[_0x4783('0x1b')]===_0x4783('0x1c')&&typeof _0x11e996[_0x4783('0x1d')]===_0x4783('0x1c');var _0x28c979=_0x20788f[_0x4783('0x1e')];var _0x323a90=_0x3cb485?0x0:_0x11e996['offset'];var _0x465ed7=_0x3cb485?_0x20788f[_0x4783('0x1e')]:_0x11e996['offset']+_0x11e996[_0x4783('0x1d')];var _0x4a9dc8;if(_0x465ed7>=_0x28c979){_0x465ed7=_0x28c979;_0x4a9dc8=0xc8;}else{_0x4a9dc8=0xce;}_0x225443[_0x4783('0x18')](_0x4a9dc8);return _0x225443[_0x4783('0x1f')](_0x4783('0x20'),_0x323a90+'-'+_0x465ed7+'/'+_0x28c979)[_0x4783('0x1a')](_0x20788f);}return null;};}function patchUpdates(_0x1b5e90){return function(_0x2772b3){try{jsonpatch[_0x4783('0x21')](_0x2772b3,_0x1b5e90,!![]);}catch(_0x4e15d7){return BPromise[_0x4783('0x22')](_0x4e15d7);}return _0x2772b3['save']();};}function saveUpdates(_0x429801,_0x2d592f){return function(_0x46ada4){if(_0x46ada4){return _0x46ada4[_0x4783('0x23')](_0x429801)[_0x4783('0x24')](function(_0x54529d){return _0x54529d;});}return null;};}function removeEntity(_0x2633e6,_0x16ee3a){return function(_0xba686e){if(_0xba686e){return _0xba686e[_0x4783('0x25')]()[_0x4783('0x24')](function(){var _0x1c7ebf=_0xba686e[_0x4783('0x26')]({'plain':!![]});var _0x48da76=_0x4783('0x27');return db[_0x4783('0x28')]['destroy']({'where':{'type':_0x48da76,'resourceId':_0x1c7ebf['id']}})['then'](function(){return _0xba686e;});})[_0x4783('0x24')](function(){_0x2633e6[_0x4783('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x106b09,_0x532961){return function(_0x5c5a6a){if(!_0x5c5a6a){_0x106b09['sendStatus'](0x194);}return _0x5c5a6a;};}function handleError(_0x575f15,_0x4bb091){_0x4bb091=_0x4bb091||0x1f4;return function(_0x59e49b){logger[_0x4783('0x29')](_0x59e49b['stack']);if(_0x59e49b[_0x4783('0x2a')]){delete _0x59e49b[_0x4783('0x2a')];}_0x575f15[_0x4783('0x18')](_0x4bb091)[_0x4783('0x2b')](_0x59e49b);};}exports[_0x4783('0x2c')]=function(_0x52b18f,_0x1e23f4){var _0x2e8ede={},_0x54d5da={},_0x1020ac={'count':0x0,'rows':[]};var _0x54ed15=_['map'](db[_0x4783('0x2d')]['rawAttributes'],function(_0x299660){return{'name':_0x299660['fieldName'],'type':_0x299660[_0x4783('0x2e')][_0x4783('0x2f')]};});_0x54d5da['model']=_[_0x4783('0x30')](_0x54ed15,_0x4783('0x2a'));_0x54d5da[_0x4783('0x31')]=_[_0x4783('0x32')](_0x52b18f['query']);_0x54d5da[_0x4783('0x33')]=_[_0x4783('0x34')](_0x54d5da[_0x4783('0x35')],_0x54d5da[_0x4783('0x31')]);_0x2e8ede['attributes']=_[_0x4783('0x34')](_0x54d5da[_0x4783('0x35')],qs['fields'](_0x52b18f[_0x4783('0x31')][_0x4783('0x36')]));_0x2e8ede[_0x4783('0x37')]=_0x2e8ede[_0x4783('0x37')][_0x4783('0x38')]?_0x2e8ede['attributes']:_0x54d5da[_0x4783('0x35')];if(!_0x52b18f['query']['hasOwnProperty'](_0x4783('0x39'))){_0x2e8ede[_0x4783('0x1d')]=qs[_0x4783('0x1d')](_0x52b18f['query'][_0x4783('0x1d')]);_0x2e8ede['offset']=qs[_0x4783('0x1b')](_0x52b18f['query'][_0x4783('0x1b')]);}_0x2e8ede[_0x4783('0x3a')]=qs[_0x4783('0x3b')](_0x52b18f['query'][_0x4783('0x3b')]);_0x2e8ede['where']=qs[_0x4783('0x33')](_[_0x4783('0x3c')](_0x52b18f[_0x4783('0x31')],_0x54d5da[_0x4783('0x33')]),_0x54ed15);if(_0x52b18f['query'][_0x4783('0x3d')]){_0x2e8ede[_0x4783('0x3e')]=_[_0x4783('0x3f')](_0x2e8ede['where'],{'$or':_[_0x4783('0x30')](_0x54ed15,function(_0x379fad){if(_0x379fad[_0x4783('0x2e')]!=='VIRTUAL'){var _0x49adfd={};_0x49adfd[_0x379fad[_0x4783('0x2a')]]={'$like':'%'+_0x52b18f[_0x4783('0x31')][_0x4783('0x3d')]+'%'};return _0x49adfd;}})});}_0x2e8ede=_[_0x4783('0x3f')]({},_0x2e8ede,_0x52b18f[_0x4783('0x40')]);var _0x158fc8={'where':_0x2e8ede[_0x4783('0x3e')]};return db[_0x4783('0x2d')][_0x4783('0x1e')](_0x158fc8)['then'](function(_0x49e41a){_0x1020ac[_0x4783('0x1e')]=_0x49e41a;if(_0x52b18f['query'][_0x4783('0x41')]){_0x2e8ede[_0x4783('0x42')]=[{'all':!![]}];}return db[_0x4783('0x2d')][_0x4783('0x43')](_0x2e8ede);})['then'](function(_0x409ac6){_0x1020ac[_0x4783('0x44')]=_0x409ac6;return _0x1020ac;})[_0x4783('0x24')](respondWithFilteredResult(_0x1e23f4,_0x2e8ede))['catch'](handleError(_0x1e23f4,null));};exports['show']=function(_0x1b6b69,_0x2bcb38){var _0x560490={'raw':![],'where':{'id':_0x1b6b69['params']['id']}},_0x378c0e={};_0x378c0e[_0x4783('0x35')]=_[_0x4783('0x32')](db[_0x4783('0x2d')][_0x4783('0x45')]);_0x378c0e[_0x4783('0x31')]=_[_0x4783('0x32')](_0x1b6b69[_0x4783('0x31')]);_0x378c0e[_0x4783('0x33')]=_['intersection'](_0x378c0e['model'],_0x378c0e[_0x4783('0x31')]);_0x560490['attributes']=_[_0x4783('0x34')](_0x378c0e[_0x4783('0x35')],qs[_0x4783('0x36')](_0x1b6b69[_0x4783('0x31')][_0x4783('0x36')]));_0x560490[_0x4783('0x37')]=_0x560490[_0x4783('0x37')][_0x4783('0x38')]?_0x560490[_0x4783('0x37')]:_0x378c0e[_0x4783('0x35')];if(_0x1b6b69[_0x4783('0x31')][_0x4783('0x41')]){_0x560490['include']=[{'all':!![]}];}_0x560490=_['merge']({},_0x560490,_0x1b6b69[_0x4783('0x40')]);return db[_0x4783('0x2d')]['find'](_0x560490)['then'](handleEntityNotFound(_0x2bcb38,null))[_0x4783('0x24')](respondWithResult(_0x2bcb38,null))[_0x4783('0x46')](handleError(_0x2bcb38,null));};exports[_0x4783('0x47')]=function(_0x5b248f,_0x3dbd65){return db['VoiceChanSpy'][_0x4783('0x47')](_0x5b248f[_0x4783('0x48')],{})['then'](function(_0x5bd97f){var _0x58c570=_0x5b248f[_0x4783('0x49')][_0x4783('0x26')]({'plain':!![]});if(!_0x58c570)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58c570[_0x4783('0x4a')]===_0x4783('0x49')){var _0x51a14f=_0x5bd97f[_0x4783('0x26')]({'plain':!![]});var _0x4c2b3a=_0x4783('0x27');return db['UserProfileSection'][_0x4783('0x4b')]({'where':{'name':_0x4c2b3a,'userProfileId':_0x58c570['userProfileId']},'raw':!![]})[_0x4783('0x24')](function(_0x4974f6){if(_0x4974f6&&_0x4974f6['autoAssociation']===0x0){return db['UserProfileResource'][_0x4783('0x47')]({'name':_0x51a14f['name'],'resourceId':_0x51a14f['id'],'type':_0x4974f6[_0x4783('0x2a')],'sectionId':_0x4974f6['id']},{})[_0x4783('0x24')](function(){return _0x5bd97f;});}else{return _0x5bd97f;}})[_0x4783('0x46')](function(_0xac3410){logger[_0x4783('0x29')](_0x4783('0x4c'),_0xac3410);throw _0xac3410;});}return _0x5bd97f;})['then'](respondWithResult(_0x3dbd65,0xc9))['catch'](handleError(_0x3dbd65,null));};exports[_0x4783('0x23')]=function(_0x366a80,_0x911ce4){if(_0x366a80[_0x4783('0x48')]['id']){delete _0x366a80['body']['id'];}return db[_0x4783('0x2d')][_0x4783('0x4b')]({'where':{'id':_0x366a80[_0x4783('0x4d')]['id']}})[_0x4783('0x24')](handleEntityNotFound(_0x911ce4,null))[_0x4783('0x24')](saveUpdates(_0x366a80[_0x4783('0x48')],null))[_0x4783('0x24')](respondWithResult(_0x911ce4,null))['catch'](handleError(_0x911ce4,null));};exports['destroy']=function(_0x2099f9,_0x74b4ce){return db[_0x4783('0x2d')][_0x4783('0x4b')]({'where':{'id':_0x2099f9[_0x4783('0x4d')]['id']}})[_0x4783('0x24')](handleEntityNotFound(_0x74b4ce,null))[_0x4783('0x24')](removeEntity(_0x74b4ce,null))[_0x4783('0x46')](handleError(_0x74b4ce,null));}; \ No newline at end of file +var _0x9649=['set','json','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','params','intersection','find','create','user','role','UserProfileSection','autoAssociation','error','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit'];(function(_0x45f5b2,_0x1bb1b8){var _0x4ced05=function(_0x272fb0){while(--_0x272fb0){_0x45f5b2['push'](_0x45f5b2['shift']());}};_0x4ced05(++_0x1bb1b8);}(_0x9649,0x118));var _0x9964=function(_0x2907de,_0x16824d){_0x2907de=_0x2907de-0x0;var _0x2e51db=_0x9649[_0x2907de];return _0x2e51db;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9964('0x2'));var rp=require(_0x9964('0x3'));var moment=require(_0x9964('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9964('0x5'));var util=require(_0x9964('0x6'));var path=require(_0x9964('0x7'));var sox=require(_0x9964('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9964('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9964('0xa'));var jsforce=require(_0x9964('0xb'));var deskjs=require(_0x9964('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9964('0xd'));var Papa=require(_0x9964('0xe'));var Redis=require(_0x9964('0xf'));var authService=require(_0x9964('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9964('0x12'))(_0x9964('0x13'));var utils=require('../../config/utils');var config=require(_0x9964('0x14'));var licenseUtil=require(_0x9964('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd6ff,_0x4ef5c5){_0x4ef5c5=_0x4ef5c5||0xcc;return function(_0x1b8afa){if(_0x1b8afa){return _0x2bd6ff[_0x9964('0x16')](_0x4ef5c5);}return _0x2bd6ff[_0x9964('0x17')](_0x4ef5c5)[_0x9964('0x18')]();};}function respondWithResult(_0x22f5ce,_0x360a02){_0x360a02=_0x360a02||0xc8;return function(_0x44ce20){if(_0x44ce20){return _0x22f5ce['status'](_0x360a02)['json'](_0x44ce20);}};}function respondWithFilteredResult(_0x37f137,_0x2be683){return function(_0x561571){if(_0x561571){var _0x416340=typeof _0x2be683[_0x9964('0x19')]===_0x9964('0x1a')&&typeof _0x2be683[_0x9964('0x1b')]===_0x9964('0x1a');var _0x2c12f8=_0x561571['count'];var _0x2a7a61=_0x416340?0x0:_0x2be683[_0x9964('0x19')];var _0x58f157=_0x416340?_0x561571['count']:_0x2be683['offset']+_0x2be683[_0x9964('0x1b')];var _0xc4c0fe;if(_0x58f157>=_0x2c12f8){_0x58f157=_0x2c12f8;_0xc4c0fe=0xc8;}else{_0xc4c0fe=0xce;}_0x37f137[_0x9964('0x17')](_0xc4c0fe);return _0x37f137[_0x9964('0x1c')]('Content-Range',_0x2a7a61+'-'+_0x58f157+'/'+_0x2c12f8)[_0x9964('0x1d')](_0x561571);}return null;};}function patchUpdates(_0x5f2bbd){return function(_0x470a8d){try{jsonpatch[_0x9964('0x1e')](_0x470a8d,_0x5f2bbd,!![]);}catch(_0x209929){return BPromise[_0x9964('0x1f')](_0x209929);}return _0x470a8d[_0x9964('0x20')]();};}function saveUpdates(_0xea9fc2,_0x4053ad){return function(_0x341c56){if(_0x341c56){return _0x341c56['update'](_0xea9fc2)[_0x9964('0x21')](function(_0x3069d7){return _0x3069d7;});}return null;};}function removeEntity(_0x1629f9,_0x30ccf7){return function(_0x5b2689){if(_0x5b2689){return _0x5b2689[_0x9964('0x22')]()[_0x9964('0x21')](function(){var _0x3b3793=_0x5b2689[_0x9964('0x23')]({'plain':!![]});var _0x4be822=_0x9964('0x24');return db[_0x9964('0x25')][_0x9964('0x22')]({'where':{'type':_0x4be822,'resourceId':_0x3b3793['id']}})[_0x9964('0x21')](function(){return _0x5b2689;});})[_0x9964('0x21')](function(){_0x1629f9[_0x9964('0x17')](0xcc)[_0x9964('0x18')]();});}};}function handleEntityNotFound(_0x33be7b,_0x4f9a8b){return function(_0x524564){if(!_0x524564){_0x33be7b[_0x9964('0x16')](0x194);}return _0x524564;};}function handleError(_0x2c1fad,_0x108c0a){_0x108c0a=_0x108c0a||0x1f4;return function(_0x16ec83){logger['error'](_0x16ec83[_0x9964('0x26')]);if(_0x16ec83[_0x9964('0x27')]){delete _0x16ec83[_0x9964('0x27')];}_0x2c1fad[_0x9964('0x17')](_0x108c0a)[_0x9964('0x28')](_0x16ec83);};}exports['index']=function(_0x4c04ce,_0x2f013f){var _0x34ae09={},_0x52dbd4={},_0x48ac65={'count':0x0,'rows':[]};var _0x4ff4c9=_[_0x9964('0x29')](db[_0x9964('0x2a')][_0x9964('0x2b')],function(_0x4cc9a1){return{'name':_0x4cc9a1[_0x9964('0x2c')],'type':_0x4cc9a1[_0x9964('0x2d')][_0x9964('0x2e')]};});_0x52dbd4[_0x9964('0x2f')]=_[_0x9964('0x29')](_0x4ff4c9,_0x9964('0x27'));_0x52dbd4['query']=_[_0x9964('0x30')](_0x4c04ce[_0x9964('0x31')]);_0x52dbd4[_0x9964('0x32')]=_['intersection'](_0x52dbd4[_0x9964('0x2f')],_0x52dbd4[_0x9964('0x31')]);_0x34ae09[_0x9964('0x33')]=_['intersection'](_0x52dbd4[_0x9964('0x2f')],qs[_0x9964('0x34')](_0x4c04ce[_0x9964('0x31')][_0x9964('0x34')]));_0x34ae09[_0x9964('0x33')]=_0x34ae09[_0x9964('0x33')][_0x9964('0x35')]?_0x34ae09[_0x9964('0x33')]:_0x52dbd4[_0x9964('0x2f')];if(!_0x4c04ce[_0x9964('0x31')][_0x9964('0x36')](_0x9964('0x37'))){_0x34ae09[_0x9964('0x1b')]=qs[_0x9964('0x1b')](_0x4c04ce[_0x9964('0x31')][_0x9964('0x1b')]);_0x34ae09[_0x9964('0x19')]=qs[_0x9964('0x19')](_0x4c04ce['query'][_0x9964('0x19')]);}_0x34ae09['order']=qs[_0x9964('0x38')](_0x4c04ce[_0x9964('0x31')]['sort']);_0x34ae09[_0x9964('0x39')]=qs['filters'](_[_0x9964('0x3a')](_0x4c04ce[_0x9964('0x31')],_0x52dbd4[_0x9964('0x32')]),_0x4ff4c9);if(_0x4c04ce[_0x9964('0x31')][_0x9964('0x3b')]){_0x34ae09[_0x9964('0x39')]=_['merge'](_0x34ae09[_0x9964('0x39')],{'$or':_[_0x9964('0x29')](_0x4ff4c9,function(_0xcf49d2){if(_0xcf49d2[_0x9964('0x2d')]!=='VIRTUAL'){var _0x1b3cbe={};_0x1b3cbe[_0xcf49d2['name']]={'$like':'%'+_0x4c04ce[_0x9964('0x31')][_0x9964('0x3b')]+'%'};return _0x1b3cbe;}})});}_0x34ae09=_[_0x9964('0x3c')]({},_0x34ae09,_0x4c04ce[_0x9964('0x3d')]);var _0x3a82d3={'where':_0x34ae09[_0x9964('0x39')]};return db[_0x9964('0x2a')][_0x9964('0x3e')](_0x3a82d3)[_0x9964('0x21')](function(_0x47227d){_0x48ac65[_0x9964('0x3e')]=_0x47227d;if(_0x4c04ce['query'][_0x9964('0x3f')]){_0x34ae09[_0x9964('0x40')]=[{'all':!![]}];}return db[_0x9964('0x2a')][_0x9964('0x41')](_0x34ae09);})['then'](function(_0x138a3a){_0x48ac65['rows']=_0x138a3a;return _0x48ac65;})['then'](respondWithFilteredResult(_0x2f013f,_0x34ae09))[_0x9964('0x42')](handleError(_0x2f013f,null));};exports['show']=function(_0x77191f,_0x5949b4){var _0x12cd80={'raw':![],'where':{'id':_0x77191f[_0x9964('0x43')]['id']}},_0x246fab={};_0x246fab['model']=_['keys'](db['VoiceChanSpy'][_0x9964('0x2b')]);_0x246fab[_0x9964('0x31')]=_['keys'](_0x77191f[_0x9964('0x31')]);_0x246fab[_0x9964('0x32')]=_[_0x9964('0x44')](_0x246fab['model'],_0x246fab[_0x9964('0x31')]);_0x12cd80[_0x9964('0x33')]=_[_0x9964('0x44')](_0x246fab[_0x9964('0x2f')],qs['fields'](_0x77191f[_0x9964('0x31')][_0x9964('0x34')]));_0x12cd80[_0x9964('0x33')]=_0x12cd80[_0x9964('0x33')][_0x9964('0x35')]?_0x12cd80['attributes']:_0x246fab[_0x9964('0x2f')];if(_0x77191f[_0x9964('0x31')]['includeAll']){_0x12cd80[_0x9964('0x40')]=[{'all':!![]}];}_0x12cd80=_[_0x9964('0x3c')]({},_0x12cd80,_0x77191f[_0x9964('0x3d')]);return db['VoiceChanSpy'][_0x9964('0x45')](_0x12cd80)[_0x9964('0x21')](handleEntityNotFound(_0x5949b4,null))[_0x9964('0x21')](respondWithResult(_0x5949b4,null))[_0x9964('0x42')](handleError(_0x5949b4,null));};exports['create']=function(_0x14d611,_0x139a9e){return db[_0x9964('0x2a')][_0x9964('0x46')](_0x14d611['body'],{})[_0x9964('0x21')](function(_0x17aa8f){var _0x276bd=_0x14d611[_0x9964('0x47')][_0x9964('0x23')]({'plain':!![]});if(!_0x276bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x276bd[_0x9964('0x48')]===_0x9964('0x47')){var _0x2eadb4=_0x17aa8f[_0x9964('0x23')]({'plain':!![]});var _0x9e5962=_0x9964('0x24');return db[_0x9964('0x49')][_0x9964('0x45')]({'where':{'name':_0x9e5962,'userProfileId':_0x276bd['userProfileId']},'raw':!![]})[_0x9964('0x21')](function(_0x307d44){if(_0x307d44&&_0x307d44[_0x9964('0x4a')]===0x0){return db[_0x9964('0x25')][_0x9964('0x46')]({'name':_0x2eadb4[_0x9964('0x27')],'resourceId':_0x2eadb4['id'],'type':_0x307d44[_0x9964('0x27')],'sectionId':_0x307d44['id']},{})[_0x9964('0x21')](function(){return _0x17aa8f;});}else{return _0x17aa8f;}})['catch'](function(_0x25faa5){logger[_0x9964('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25faa5);throw _0x25faa5;});}return _0x17aa8f;})[_0x9964('0x21')](respondWithResult(_0x139a9e,0xc9))[_0x9964('0x42')](handleError(_0x139a9e,null));};exports['update']=function(_0x2b2535,_0x49fcd4){if(_0x2b2535['body']['id']){delete _0x2b2535[_0x9964('0x4c')]['id'];}return db[_0x9964('0x2a')][_0x9964('0x45')]({'where':{'id':_0x2b2535[_0x9964('0x43')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0x49fcd4,null))[_0x9964('0x21')](saveUpdates(_0x2b2535[_0x9964('0x4c')],null))[_0x9964('0x21')](respondWithResult(_0x49fcd4,null))[_0x9964('0x42')](handleError(_0x49fcd4,null));};exports['destroy']=function(_0x2ca871,_0xe67a50){return db[_0x9964('0x2a')][_0x9964('0x45')]({'where':{'id':_0x2ca871[_0x9964('0x43')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0xe67a50,null))['then'](removeEntity(_0xe67a50,null))[_0x9964('0x42')](handleError(_0xe67a50,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 111827b..218b23c 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 _0x1e6f=['format','prefix','merge','Set','CDR(type)=%s','chanspy','record','push','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','./voiceChanSpy.attributes','context','from-sip'];(function(_0x3a0863,_0x4cd5ef){var _0x85c557=function(_0x3011cb){while(--_0x3011cb){_0x3a0863['push'](_0x3a0863['shift']());}};_0x85c557(++_0x4cd5ef);}(_0x1e6f,0xe0));var _0xf1e6=function(_0x470790,_0x27a250){_0x470790=_0x470790-0x0;var _0x2a6cab=_0x1e6f[_0x470790];return _0x2a6cab;};'use strict';var _=require(_0xf1e6('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require(_0xf1e6('0x1'));var getUserApplications=function(_0x2dff4f,_0x5c3c14,_0x48f7d3){var _0x1e38df=0x1;var _0x446123=[];var _0x2f9c3b={'context':_0x5c3c14[_0xf1e6('0x2')]||_0xf1e6('0x3'),'exten':util[_0xf1e6('0x4')]('%s%s',_0x2dff4f[_0xf1e6('0x5')],_0x48f7d3),'type':'system','isApp':![],'ChanSpyId':_0x2dff4f['id'],'UserId':_0x5c3c14['id']};_0x446123['push'](_[_0xf1e6('0x6')]({'app':_0xf1e6('0x7'),'appdata':util[_0xf1e6('0x4')](_0xf1e6('0x8'),_0xf1e6('0x9')),'priority':_0x1e38df++},_0x2f9c3b));if(_0x2dff4f[_0xf1e6('0xa')]){_0x446123[_0xf1e6('0xb')](_[_0xf1e6('0x6')]({'app':'MixMonitor','appdata':util['format'](_0xf1e6('0xc'),_0x2dff4f[_0xf1e6('0xd')]),'priority':_0x1e38df++},_0x2f9c3b));}if(_0x2dff4f[_0xf1e6('0xe')]){_0x446123[_0xf1e6('0xb')](_['merge']({'app':_0xf1e6('0xf'),'appdata':_0x2dff4f[_0xf1e6('0x10')],'priority':_0x1e38df++},_0x2f9c3b));}_0x446123[_0xf1e6('0xb')](_[_0xf1e6('0x6')]({'app':_0xf1e6('0x11'),'appdata':util[_0xf1e6('0x4')](_0xf1e6('0x12'),_0x5c3c14[_0xf1e6('0x13')],_0x2dff4f['options']?_0x2dff4f[_0xf1e6('0x14')][_0xf1e6('0x15')](''):''),'priority':_0x1e38df++},_0x2f9c3b));if(_0x2dff4f[_0xf1e6('0xa')]){_0x446123['push'](_['merge']({'app':'StopMixMonitor','priority':_0x1e38df++},_0x2f9c3b));}return _0x446123;};var getChanSpyApplications=function(_0x5c4153,_0x1e8ee4){var _0x105215=[];for(var _0x1bca28=0x0,_0x563b75=0x1;_0x1bca28<_0x1e8ee4[_0xf1e6('0x16')];_0x1bca28++,_0x563b75=0x1){_0x105215=_0x105215[_0xf1e6('0x17')](getUserApplications(_0x5c4153,_0x1e8ee4[_0x1bca28],_0x1e8ee4[_0x1bca28]['internal']));if(_0x1e8ee4[_0x1bca28][_0xf1e6('0x18')]!=_0x1e8ee4[_0x1bca28][_0xf1e6('0x13')]){_0x105215=_0x105215[_0xf1e6('0x17')](getUserApplications(_0x5c4153,_0x1e8ee4[_0x1bca28],_0x1e8ee4[_0x1bca28]['name']));}}return _0x105215;};var getChanSpyPromise=function(_0x3fc6c9,_0x2353f3){return new BPromise(function(_0x56e3af,_0x4fc2f5){return _0x3fc6c9[_0xf1e6('0x19')][_0xf1e6('0x1a')]({'attributes':['id',_0xf1e6('0x13'),_0xf1e6('0x18')],'where':{'role':_0xf1e6('0x1b'),'chanspy':!![]},'raw':!![]})[_0xf1e6('0x1c')](function(_0x208b91){if(_0x208b91){return _0x56e3af(getChanSpyApplications(_0x2353f3,_0x208b91));}return _0x56e3af([]);})[_0xf1e6('0x1d')](function(_0x4379de){_0x4fc2f5(_0x4379de);});});};module[_0xf1e6('0x1e')]=function(_0x4eaf25,_0x21fe5a){var _0x54f20c=_0x4eaf25[_0xf1e6('0x1f')];return _0x4eaf25[_0xf1e6('0x20')](_0xf1e6('0x21'),attributes,{'tableName':_0xf1e6('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x7725c2,_0x3d8fba,_0x140422){return getChanSpyPromise(_0x54f20c,_0x7725c2)[_0xf1e6('0x1c')](function(_0x30ca47){if(_0x30ca47&&_0x30ca47[_0xf1e6('0x16')]){return _0x54f20c[_0xf1e6('0x23')][_0xf1e6('0x24')](_0x30ca47);}})['then'](function(){_0x140422();})[_0xf1e6('0x1d')](function(_0x50b09f){_0x140422(_0x50b09f);});},'afterUpdate':function(_0xdc42f7,_0x4b4b15,_0x2de13b){return _0x54f20c[_0xf1e6('0x23')][_0xf1e6('0x25')]({'where':{'ChanSpyId':_0xdc42f7['id']}})[_0xf1e6('0x1c')](function(){return getChanSpyPromise(_0x54f20c,_0xdc42f7);})[_0xf1e6('0x1c')](function(_0x4f7971){if(_0x4f7971&&_0x4f7971[_0xf1e6('0x16')]){return _0x54f20c[_0xf1e6('0x23')][_0xf1e6('0x24')](_0x4f7971);}})[_0xf1e6('0x1c')](function(){_0x2de13b();})['catch'](function(_0x43fe52){_0x2de13b(_0x43fe52);});},'afterDestroy':function(_0x12340d,_0x2696da,_0x500dc4){return _0x54f20c[_0xf1e6('0x23')][_0xf1e6('0x25')]({'where':{'ChanSpyId':_0x12340d['id']}})[_0xf1e6('0x1c')](function(){_0x500dc4();})[_0xf1e6('0x1d')](function(_0x171f71){_0x500dc4(_0x171f71);});}}});}; \ No newline at end of file +var _0x92ea=['record','merge','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','catch','VoiceExtension','destroy','util','bluebird','context','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy'];(function(_0x46398a,_0x2e7a89){var _0x3b1455=function(_0x584f7e){while(--_0x584f7e){_0x46398a['push'](_0x46398a['shift']());}};_0x3b1455(++_0x2e7a89);}(_0x92ea,0x90));var _0xa92e=function(_0x2929ba,_0x506aa6){_0x2929ba=_0x2929ba-0x0;var _0x365e6e=_0x92ea[_0x2929ba];return _0x365e6e;};'use strict';var _=require('lodash');var util=require(_0xa92e('0x0'));var BPromise=require(_0xa92e('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x30087a,_0x1ec851,_0x24afe2){var _0x28dde5=0x1;var _0x580d20=[];var _0x43edf4={'context':_0x1ec851[_0xa92e('0x2')]||_0xa92e('0x3'),'exten':util[_0xa92e('0x4')](_0xa92e('0x5'),_0x30087a[_0xa92e('0x6')],_0x24afe2),'type':_0xa92e('0x7'),'isApp':![],'ChanSpyId':_0x30087a['id'],'UserId':_0x1ec851['id']};_0x580d20[_0xa92e('0x8')](_['merge']({'app':_0xa92e('0x9'),'appdata':util[_0xa92e('0x4')](_0xa92e('0xa'),_0xa92e('0xb')),'priority':_0x28dde5++},_0x43edf4));if(_0x30087a[_0xa92e('0xc')]){_0x580d20[_0xa92e('0x8')](_[_0xa92e('0xd')]({'app':_0xa92e('0xe'),'appdata':util['format'](_0xa92e('0xf'),_0x30087a['recordingFormat']),'priority':_0x28dde5++},_0x43edf4));}if(_0x30087a[_0xa92e('0x10')]){_0x580d20[_0xa92e('0x8')](_[_0xa92e('0xd')]({'app':_0xa92e('0x11'),'appdata':_0x30087a[_0xa92e('0x12')],'priority':_0x28dde5++},_0x43edf4));}_0x580d20[_0xa92e('0x8')](_[_0xa92e('0xd')]({'app':'ChanSpy','appdata':util[_0xa92e('0x4')]('SIP/%s,%s',_0x1ec851[_0xa92e('0x13')],_0x30087a[_0xa92e('0x14')]?_0x30087a[_0xa92e('0x14')][_0xa92e('0x15')](''):''),'priority':_0x28dde5++},_0x43edf4));if(_0x30087a['record']){_0x580d20[_0xa92e('0x8')](_[_0xa92e('0xd')]({'app':_0xa92e('0x16'),'priority':_0x28dde5++},_0x43edf4));}return _0x580d20;};var getChanSpyApplications=function(_0x2aae6b,_0x5107d5){var _0x3fbdd7=[];for(var _0x4c3e47=0x0,_0x59198f=0x1;_0x4c3e47<_0x5107d5[_0xa92e('0x17')];_0x4c3e47++,_0x59198f=0x1){_0x3fbdd7=_0x3fbdd7[_0xa92e('0x18')](getUserApplications(_0x2aae6b,_0x5107d5[_0x4c3e47],_0x5107d5[_0x4c3e47][_0xa92e('0x19')]));if(_0x5107d5[_0x4c3e47][_0xa92e('0x19')]!=_0x5107d5[_0x4c3e47]['name']){_0x3fbdd7=_0x3fbdd7[_0xa92e('0x18')](getUserApplications(_0x2aae6b,_0x5107d5[_0x4c3e47],_0x5107d5[_0x4c3e47][_0xa92e('0x13')]));}}return _0x3fbdd7;};var getChanSpyPromise=function(_0x1327a6,_0x557f04){return new BPromise(function(_0x3e80b8,_0x2c0eb2){return _0x1327a6[_0xa92e('0x1a')][_0xa92e('0x1b')]({'attributes':['id','name',_0xa92e('0x19')],'where':{'role':_0xa92e('0x1c'),'chanspy':!![]},'raw':!![]})[_0xa92e('0x1d')](function(_0x3d6831){if(_0x3d6831){return _0x3e80b8(getChanSpyApplications(_0x557f04,_0x3d6831));}return _0x3e80b8([]);})['catch'](function(_0x1bda59){_0x2c0eb2(_0x1bda59);});});};module[_0xa92e('0x1e')]=function(_0x411ee3,_0x52f813){var _0x5c4b28=_0x411ee3[_0xa92e('0x1f')];return _0x411ee3[_0xa92e('0x20')](_0xa92e('0x21'),attributes,{'tableName':_0xa92e('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3518a3,_0x2bc537,_0x3d4b2b){return getChanSpyPromise(_0x5c4b28,_0x3518a3)[_0xa92e('0x1d')](function(_0x2b5991){if(_0x2b5991&&_0x2b5991[_0xa92e('0x17')]){return _0x5c4b28['VoiceExtension'][_0xa92e('0x23')](_0x2b5991);}})[_0xa92e('0x1d')](function(){_0x3d4b2b();})[_0xa92e('0x24')](function(_0x5a8f8a){_0x3d4b2b(_0x5a8f8a);});},'afterUpdate':function(_0x487d93,_0x31599e,_0x2bf77d){return _0x5c4b28[_0xa92e('0x25')][_0xa92e('0x26')]({'where':{'ChanSpyId':_0x487d93['id']}})[_0xa92e('0x1d')](function(){return getChanSpyPromise(_0x5c4b28,_0x487d93);})[_0xa92e('0x1d')](function(_0x25c567){if(_0x25c567&&_0x25c567[_0xa92e('0x17')]){return _0x5c4b28[_0xa92e('0x25')]['bulkCreate'](_0x25c567);}})['then'](function(){_0x2bf77d();})[_0xa92e('0x24')](function(_0x45da70){_0x2bf77d(_0x45da70);});},'afterDestroy':function(_0x1be3cc,_0x5f2b50,_0x24bd46){return _0x5c4b28[_0xa92e('0x25')]['destroy']({'where':{'ChanSpyId':_0x1be3cc['id']}})['then'](function(){_0x24bd46();})[_0xa92e('0x24')](function(_0x1f6574){_0x24bd46(_0x1f6574);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 405e7b8..d3c519a 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 _0x6f0d=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x51ed11,_0x1721d4){var _0xe436ed=function(_0x2eb689){while(--_0x2eb689){_0x51ed11['push'](_0x51ed11['shift']());}};_0xe436ed(++_0x1721d4);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2396c0,_0x5d771f){_0x2396c0=_0x2396c0-0x0;var _0x3a9104=_0x6f0d[_0x2396c0];return _0x3a9104;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file +var _0xc368=['client','request','then','request\x20sent','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x359c40,_0x5af7c1){var _0x885558=function(_0x5ea2a4){while(--_0x5ea2a4){_0x359c40['push'](_0x359c40['shift']());}};_0x885558(++_0x5af7c1);}(_0xc368,0x7b));var _0x8c36=function(_0x33c099,_0x3eb152){_0x33c099=_0x33c099-0x0;var _0x59905b=_0xc368[_0x33c099];return _0x59905b;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var moment=require('moment');var BPromise=require(_0x8c36('0x1'));var rs=require(_0x8c36('0x2'));var fs=require('fs');var Redis=require(_0x8c36('0x3'));var db=require(_0x8c36('0x4'))['db'];var utils=require(_0x8c36('0x5'));var logger=require('../../config/logger')(_0x8c36('0x6'));var config=require(_0x8c36('0x7'));var jayson=require(_0x8c36('0x8'));var client=jayson[_0x8c36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554022,_0x8ed437,_0x384867){return new BPromise(function(_0x3e76be,_0x26bad1){return client[_0x8c36('0xa')](_0x554022,_0x384867)[_0x8c36('0xb')](function(_0x569f29){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'),JSON[_0x8c36('0xe')](_0x569f29));if(_0x569f29[_0x8c36('0xf')]){if(_0x569f29[_0x8c36('0xf')][_0x8c36('0x10')]===0x1f4){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);return _0x26bad1(_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);}logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')]['message']);return _0x3e76be(_0x569f29[_0x8c36('0xf')]['message']);}else{logger[_0x8c36('0x13')](_0x8c36('0x11'),_0x8ed437,_0x8c36('0xc'));_0x3e76be(_0x569f29[_0x8c36('0x14')][_0x8c36('0x12')]);}})[_0x8c36('0x15')](function(_0x3c10eb){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x3c10eb);_0x26bad1(_0x3c10eb);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index db9078e..8371fff 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 _0x90cd=['fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','post','update','delete','exports','util','path','express','Router'];(function(_0x4f3e6a,_0x2aa2da){var _0x41827d=function(_0x364653){while(--_0x364653){_0x4f3e6a['push'](_0x4f3e6a['shift']());}};_0x41827d(++_0x2aa2da);}(_0x90cd,0xf8));var _0xd90c=function(_0x25792f,_0x392e1b){_0x25792f=_0x25792f-0x0;var _0xccd992=_0x90cd[_0x25792f];return _0xccd992;};'use strict';var multer=require('multer');var util=require(_0xd90c('0x0'));var path=require(_0xd90c('0x1'));var timeout=require('connect-timeout');var express=require(_0xd90c('0x2'));var router=express[_0xd90c('0x3')]();var fs_extra=require(_0xd90c('0x4'));var auth=require(_0xd90c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd90c('0x6'));var controller=require(_0xd90c('0x7'));router[_0xd90c('0x8')]('/',auth[_0xd90c('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd90c('0xa')]('/',auth[_0xd90c('0x9')](),controller['create']);router['put']('/:id',auth[_0xd90c('0x9')](),controller[_0xd90c('0xb')]);router[_0xd90c('0xc')]('/:id',auth[_0xd90c('0x9')](),controller['destroy']);module[_0xd90c('0xd')]=router; \ No newline at end of file +var _0x4665=['index','show','post','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x4665,0x196));var _0x5466=function(_0x56b559,_0x4b8e09){_0x56b559=_0x56b559-0x0;var _0xc176e6=_0x4665[_0x56b559];return _0xc176e6;};'use strict';var multer=require(_0x5466('0x0'));var util=require(_0x5466('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5466('0x2'));var router=express[_0x5466('0x3')]();var fs_extra=require(_0x5466('0x4'));var auth=require(_0x5466('0x5'));var interaction=require(_0x5466('0x6'));var config=require(_0x5466('0x7'));var controller=require('./voiceContext.controller');router[_0x5466('0x8')]('/',auth[_0x5466('0x9')](),controller[_0x5466('0xa')]);router[_0x5466('0x8')]('/:id',auth[_0x5466('0x9')](),controller[_0x5466('0xb')]);router[_0x5466('0xc')]('/',auth[_0x5466('0x9')](),controller['create']);router['put'](_0x5466('0xd'),auth[_0x5466('0x9')](),controller['update']);router['delete'](_0x5466('0xd'),auth[_0x5466('0x9')](),controller[_0x5466('0xe')]);module[_0x5466('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index ae9b6eb..4b76313 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 _0x36f2=['STRING','name','BOOLEAN','sequelize'];(function(_0xbe48c2,_0x3db103){var _0x39a679=function(_0x195d37){while(--_0x195d37){_0xbe48c2['push'](_0xbe48c2['shift']());}};_0x39a679(++_0x3db103);}(_0x36f2,0x123));var _0x236f=function(_0x315d20,_0x36f53f){_0x315d20=_0x315d20-0x0;var _0x43dc75=_0x36f2[_0x315d20];return _0x43dc75;};'use strict';var Sequelize=require(_0x236f('0x0'));module['exports']={'name':{'type':Sequelize[_0x236f('0x1')],'unique':_0x236f('0x2')},'description':{'type':Sequelize[_0x236f('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x236f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9746=['sequelize','STRING','name'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9746,0x144));var _0x6974=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x9746[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0x6974('0x0'));module['exports']={'name':{'type':Sequelize[_0x6974('0x1')],'unique':_0x6974('0x2')},'description':{'type':Sequelize[_0x6974('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 a8420c8..c084dfa 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 _0x5faa=['length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','keys','create','body','readFileSync','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','Contexts','userProfileId','autoAssociation','UserProfileResource','params','join','root','writeFileSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','get','destroy','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x458140,_0x20964a){var _0x5e4ba1=function(_0x240ca4){while(--_0x240ca4){_0x458140['push'](_0x458140['shift']());}};_0x5e4ba1(++_0x20964a);}(_0x5faa,0x1c4));var _0xa5fa=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x5faa[_0x5a95fa];return _0x1a61b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5fa('0x0'));var zipdir=require(_0xa5fa('0x1'));var jsonpatch=require(_0xa5fa('0x2'));var rp=require(_0xa5fa('0x3'));var moment=require(_0xa5fa('0x4'));var BPromise=require(_0xa5fa('0x5'));var Mustache=require(_0xa5fa('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa5fa('0x7'));var csv=require(_0xa5fa('0x8'));var ejs=require(_0xa5fa('0x9'));var fs=require('fs');var fs_extra=require(_0xa5fa('0xa'));var _=require(_0xa5fa('0xb'));var squel=require(_0xa5fa('0xc'));var crypto=require(_0xa5fa('0xd'));var jsforce=require(_0xa5fa('0xe'));var deskjs=require(_0xa5fa('0xf'));var toCsv=require(_0xa5fa('0x8'));var querystring=require('querystring');var Papa=require(_0xa5fa('0x10'));var Redis=require(_0xa5fa('0x11'));var authService=require(_0xa5fa('0x12'));var qs=require(_0xa5fa('0x13'));var as=require(_0xa5fa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa5fa('0x15'));var utils=require('../../config/utils');var config=require(_0xa5fa('0x16'));var licenseUtil=require(_0xa5fa('0x17'));var db=require(_0xa5fa('0x18'))['db'];var jayson=require(_0xa5fa('0x19'));var client=jayson[_0xa5fa('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x321f9e,_0x4eed81,_0x151ffa,_0x895827){return new BPromise(function(_0xec430a,_0x5222f3){var _0x38bdcf=_0x895827||client;return _0x38bdcf[_0xa5fa('0x1b')](_0x321f9e,_0x151ffa)[_0xa5fa('0x1c')](function(_0x90cfef){logger['info'](_0xa5fa('0x1d'),_0x4eed81,'request\x20sent');logger[_0xa5fa('0x1e')](_0xa5fa('0x1f'),_0x4eed81,_0xa5fa('0x20'),JSON['stringify'](_0x90cfef));if(_0x90cfef[_0xa5fa('0x21')]){if(_0x90cfef[_0xa5fa('0x21')][_0xa5fa('0x22')]===0x1f4){logger[_0xa5fa('0x21')](_0xa5fa('0x1d'),_0x4eed81,_0x90cfef[_0xa5fa('0x21')][_0xa5fa('0x23')]);return _0x5222f3(_0x90cfef[_0xa5fa('0x21')]['message']);}logger[_0xa5fa('0x21')](_0xa5fa('0x1d'),_0x4eed81,_0x90cfef['error']['message']);return _0xec430a(_0x90cfef[_0xa5fa('0x21')][_0xa5fa('0x23')]);}else{logger[_0xa5fa('0x24')]('VoiceContext,\x20%s,\x20%s',_0x4eed81,'request\x20sent');_0xec430a(_0x90cfef[_0xa5fa('0x25')][_0xa5fa('0x23')]);}})[_0xa5fa('0x26')](function(_0x39252){logger[_0xa5fa('0x21')](_0xa5fa('0x1d'),_0x4eed81,_0x39252);_0x5222f3(_0x39252);});});}function respondWithStatusCode(_0x29a9e7,_0x4f00f5){_0x4f00f5=_0x4f00f5||0xcc;return function(_0x3d16e7){if(_0x3d16e7){return _0x29a9e7[_0xa5fa('0x27')](_0x4f00f5);}return _0x29a9e7[_0xa5fa('0x28')](_0x4f00f5)[_0xa5fa('0x29')]();};}function respondWithResult(_0x45cdc5,_0x221e71){_0x221e71=_0x221e71||0xc8;return function(_0x39a030){if(_0x39a030){return _0x45cdc5[_0xa5fa('0x28')](_0x221e71)[_0xa5fa('0x2a')](_0x39a030);}};}function respondWithFilteredResult(_0x514b77,_0x1f895d){return function(_0x49e63f){if(_0x49e63f){var _0x266507=typeof _0x1f895d[_0xa5fa('0x2b')]===_0xa5fa('0x2c')&&typeof _0x1f895d['limit']===_0xa5fa('0x2c');var _0x2b1ff2=_0x49e63f[_0xa5fa('0x2d')];var _0x2fb944=_0x266507?0x0:_0x1f895d[_0xa5fa('0x2b')];var _0x5d3ba9=_0x266507?_0x49e63f[_0xa5fa('0x2d')]:_0x1f895d['offset']+_0x1f895d['limit'];var _0x2c67bf;if(_0x5d3ba9>=_0x2b1ff2){_0x5d3ba9=_0x2b1ff2;_0x2c67bf=0xc8;}else{_0x2c67bf=0xce;}_0x514b77[_0xa5fa('0x28')](_0x2c67bf);return _0x514b77[_0xa5fa('0x2e')](_0xa5fa('0x2f'),_0x2fb944+'-'+_0x5d3ba9+'/'+_0x2b1ff2)[_0xa5fa('0x2a')](_0x49e63f);}return null;};}function patchUpdates(_0x536c8d){return function(_0x472b68){try{jsonpatch[_0xa5fa('0x30')](_0x472b68,_0x536c8d,!![]);}catch(_0x4dcb0c){return BPromise[_0xa5fa('0x31')](_0x4dcb0c);}return _0x472b68['save']();};}function saveUpdates(_0xc89dc5,_0x1b0465){return function(_0x189f04){if(_0x189f04){return _0x189f04[_0xa5fa('0x32')](_0xc89dc5)[_0xa5fa('0x1c')](function(_0xf39354){return _0xf39354;});}return null;};}function removeEntity(_0x179443,_0x44beec){return function(_0x22701d){if(_0x22701d){return _0x22701d['destroy']()[_0xa5fa('0x1c')](function(){var _0x299609=_0x22701d[_0xa5fa('0x33')]({'plain':!![]});var _0x333bfd='Contexts';return db['UserProfileResource'][_0xa5fa('0x34')]({'where':{'type':_0x333bfd,'resourceId':_0x299609['id']}})[_0xa5fa('0x1c')](function(){return _0x22701d;});})[_0xa5fa('0x1c')](function(){_0x179443['status'](0xcc)[_0xa5fa('0x29')]();});}};}function handleEntityNotFound(_0x541fb7,_0x424b1c){return function(_0x418eb1){if(!_0x418eb1){_0x541fb7['sendStatus'](0x194);}return _0x418eb1;};}function handleError(_0x50cacd,_0x282ba4){_0x282ba4=_0x282ba4||0x1f4;return function(_0x1072f5){logger['error'](_0x1072f5[_0xa5fa('0x35')]);if(_0x1072f5[_0xa5fa('0x36')]){delete _0x1072f5[_0xa5fa('0x36')];}_0x50cacd[_0xa5fa('0x28')](_0x282ba4)[_0xa5fa('0x37')](_0x1072f5);};}exports[_0xa5fa('0x38')]=function(_0x3fa4d9,_0x40f92d){var _0x13d12f={},_0x3a6171={},_0x26cfb0={'count':0x0,'rows':[]};var _0x4a200c=_[_0xa5fa('0x39')](db[_0xa5fa('0x3a')]['rawAttributes'],function(_0x42e8c9){return{'name':_0x42e8c9[_0xa5fa('0x3b')],'type':_0x42e8c9[_0xa5fa('0x3c')][_0xa5fa('0x3d')]};});_0x3a6171[_0xa5fa('0x3e')]=_[_0xa5fa('0x39')](_0x4a200c,_0xa5fa('0x36'));_0x3a6171[_0xa5fa('0x3f')]=_['keys'](_0x3fa4d9[_0xa5fa('0x3f')]);_0x3a6171[_0xa5fa('0x40')]=_[_0xa5fa('0x41')](_0x3a6171[_0xa5fa('0x3e')],_0x3a6171[_0xa5fa('0x3f')]);_0x13d12f[_0xa5fa('0x42')]=_[_0xa5fa('0x41')](_0x3a6171[_0xa5fa('0x3e')],qs[_0xa5fa('0x43')](_0x3fa4d9[_0xa5fa('0x3f')][_0xa5fa('0x43')]));_0x13d12f[_0xa5fa('0x42')]=_0x13d12f[_0xa5fa('0x42')][_0xa5fa('0x44')]?_0x13d12f['attributes']:_0x3a6171[_0xa5fa('0x3e')];if(!_0x3fa4d9[_0xa5fa('0x3f')][_0xa5fa('0x45')]('nolimit')){_0x13d12f[_0xa5fa('0x46')]=qs[_0xa5fa('0x46')](_0x3fa4d9[_0xa5fa('0x3f')][_0xa5fa('0x46')]);_0x13d12f['offset']=qs[_0xa5fa('0x2b')](_0x3fa4d9[_0xa5fa('0x3f')][_0xa5fa('0x2b')]);}_0x13d12f['order']=qs[_0xa5fa('0x47')](_0x3fa4d9[_0xa5fa('0x3f')][_0xa5fa('0x47')]);_0x13d12f[_0xa5fa('0x48')]=qs[_0xa5fa('0x40')](_[_0xa5fa('0x49')](_0x3fa4d9[_0xa5fa('0x3f')],_0x3a6171['filters']),_0x4a200c);if(_0x3fa4d9[_0xa5fa('0x3f')][_0xa5fa('0x4a')]){_0x13d12f[_0xa5fa('0x48')]=_['merge'](_0x13d12f[_0xa5fa('0x48')],{'$or':_[_0xa5fa('0x39')](_0x4a200c,function(_0x16a08b){if(_0x16a08b[_0xa5fa('0x3c')]!==_0xa5fa('0x4b')){var _0xe84f1a={};_0xe84f1a[_0x16a08b[_0xa5fa('0x36')]]={'$like':'%'+_0x3fa4d9[_0xa5fa('0x3f')]['filter']+'%'};return _0xe84f1a;}})});}_0x13d12f=_[_0xa5fa('0x4c')]({},_0x13d12f,_0x3fa4d9['options']);var _0x242aab={'where':_0x13d12f[_0xa5fa('0x48')]};return db[_0xa5fa('0x3a')][_0xa5fa('0x2d')](_0x242aab)[_0xa5fa('0x1c')](function(_0x14cffe){_0x26cfb0[_0xa5fa('0x2d')]=_0x14cffe;if(_0x3fa4d9[_0xa5fa('0x3f')][_0xa5fa('0x4d')]){_0x13d12f[_0xa5fa('0x4e')]=[{'all':!![]}];}return db['VoiceContext'][_0xa5fa('0x4f')](_0x13d12f);})[_0xa5fa('0x1c')](function(_0x35c277){_0x26cfb0[_0xa5fa('0x50')]=_0x35c277;return _0x26cfb0;})[_0xa5fa('0x1c')](respondWithFilteredResult(_0x40f92d,_0x13d12f))[_0xa5fa('0x26')](handleError(_0x40f92d,null));};exports[_0xa5fa('0x51')]=function(_0x46368a,_0x389310){var _0x36826c={'raw':![],'where':{'id':_0x46368a['params']['id']}},_0x13462a={};_0x13462a['model']=_[_0xa5fa('0x52')](db[_0xa5fa('0x3a')]['rawAttributes']);_0x13462a[_0xa5fa('0x3f')]=_['keys'](_0x46368a[_0xa5fa('0x3f')]);_0x13462a[_0xa5fa('0x40')]=_['intersection'](_0x13462a[_0xa5fa('0x3e')],_0x13462a[_0xa5fa('0x3f')]);_0x36826c[_0xa5fa('0x42')]=_['intersection'](_0x13462a[_0xa5fa('0x3e')],qs[_0xa5fa('0x43')](_0x46368a['query'][_0xa5fa('0x43')]));_0x36826c[_0xa5fa('0x42')]=_0x36826c[_0xa5fa('0x42')][_0xa5fa('0x44')]?_0x36826c['attributes']:_0x13462a[_0xa5fa('0x3e')];if(_0x46368a[_0xa5fa('0x3f')][_0xa5fa('0x4d')]){_0x36826c[_0xa5fa('0x4e')]=[{'all':!![]}];}_0x36826c=_[_0xa5fa('0x4c')]({},_0x36826c,_0x46368a['options']);return db[_0xa5fa('0x3a')]['find'](_0x36826c)['then'](handleEntityNotFound(_0x389310,null))[_0xa5fa('0x1c')](respondWithResult(_0x389310,null))[_0xa5fa('0x26')](handleError(_0x389310,null));};exports[_0xa5fa('0x53')]=function(_0x4b8d70,_0x1461a8,_0x2dc187){var _0x5244d9;return db[_0xa5fa('0x3a')][_0xa5fa('0x53')](_0x4b8d70[_0xa5fa('0x54')],{'raw':!![]})['then'](function(_0x44f285){_0x5244d9=_0x44f285;return db[_0xa5fa('0x3a')][_0xa5fa('0x4f')]({'raw':!![]});})[_0xa5fa('0x1c')](function(_0x4ab664){var _0x112307=fs[_0xa5fa('0x55')](path['join'](config['root'],_0xa5fa('0x56')),_0xa5fa('0x57'));var _0x3ef3cc=ejs[_0xa5fa('0x58')](_0x112307,{'contexts':_0x4ab664||[]});fs['writeFileSync'](_0xa5fa('0x59'),_0x3ef3cc);})['then'](function(){return respondWithRpcPromise(_0xa5fa('0x5a'),_0xa5fa('0x53'),{'module':_0xa5fa('0x5b')});})['then'](function(){var _0x498f56=_0x4b8d70['user']['get']({'plain':!![]});if(!_0x498f56)throw new Error(_0xa5fa('0x5c'));if(_0x498f56['role']===_0xa5fa('0x5d')){var _0x310174=_0x5244d9[_0xa5fa('0x33')]({'plain':!![]});return db[_0xa5fa('0x5e')][_0xa5fa('0x5f')]({'where':{'name':_0xa5fa('0x60'),'userProfileId':_0x498f56[_0xa5fa('0x61')]},'raw':!![]})[_0xa5fa('0x1c')](function(_0x2a9215){if(_0x2a9215&&_0x2a9215[_0xa5fa('0x62')]===0x0){return db[_0xa5fa('0x63')][_0xa5fa('0x53')]({'name':_0x310174[_0xa5fa('0x36')],'resourceId':_0x310174['id'],'type':_0x2a9215[_0xa5fa('0x36')],'sectionId':_0x2a9215['id']},{})[_0xa5fa('0x1c')](function(){return _0x5244d9;});}else{return _0x5244d9;}})[_0xa5fa('0x26')](function(_0x5a8d1f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a8d1f);throw _0x5a8d1f;});}return _0x5244d9;})[_0xa5fa('0x1c')](respondWithResult(_0x1461a8,0xc9))[_0xa5fa('0x26')](handleError(_0x1461a8,null));};exports[_0xa5fa('0x32')]=function(_0x2d3907,_0x1058cf,_0x34a187){var _0x27749e;return db[_0xa5fa('0x3a')][_0xa5fa('0x5f')]({'where':{'id':_0x2d3907[_0xa5fa('0x64')]['id']}})[_0xa5fa('0x1c')](handleEntityNotFound(_0x1058cf,null))[_0xa5fa('0x1c')](saveUpdates(_0x2d3907[_0xa5fa('0x54')],null))[_0xa5fa('0x1c')](function(_0x5075b5){if(_0x5075b5){_0x27749e=_0x5075b5;return db[_0xa5fa('0x3a')][_0xa5fa('0x4f')]({'raw':!![]});}})['then'](function(_0x439f64){var _0x2ea25c=fs[_0xa5fa('0x55')](path[_0xa5fa('0x65')](config[_0xa5fa('0x66')],_0xa5fa('0x56')),_0xa5fa('0x57'));var _0x27ed40=ejs['render'](_0x2ea25c,{'contexts':_0x439f64||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x27ed40);})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0xa5fa('0x5b')});})[_0xa5fa('0x1c')](function(){return _0x27749e;})['then'](respondWithResult(_0x1058cf,null))['catch'](handleError(_0x1058cf,null));};exports[_0xa5fa('0x34')]=function(_0x4aa4f3,_0x51b637,_0x58fa0b){var _0x2b78e9;return db['VoiceContext'][_0xa5fa('0x5f')]({'where':{'id':_0x4aa4f3[_0xa5fa('0x64')]['id']}})['then'](handleEntityNotFound(_0x51b637,null))[_0xa5fa('0x1c')](removeEntity(_0x51b637,null))['then'](function(){return db[_0xa5fa('0x3a')][_0xa5fa('0x4f')]({'raw':!![]});})['then'](function(_0x3df8b1){var _0x208a54=fs['readFileSync'](path[_0xa5fa('0x65')](config[_0xa5fa('0x66')],_0xa5fa('0x56')),'utf8');var _0x23a074=ejs[_0xa5fa('0x58')](_0x208a54,{'contexts':_0x3df8b1});fs[_0xa5fa('0x67')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x23a074);return respondWithRpcPromise(_0xa5fa('0x5a'),_0xa5fa('0x34'),{'module':_0xa5fa('0x5b')});})[_0xa5fa('0x26')](handleError(_0x51b637,null));}; \ No newline at end of file +var _0x533f=['destroy','sendStatus','stack','name','index','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','options','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','render','writeFileSync','chan_sip.so','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','get','Contexts','UserProfileResource'];(function(_0x26f7e2,_0x1277f5){var _0x3c871b=function(_0x3f9bcf){while(--_0x3f9bcf){_0x26f7e2['push'](_0x26f7e2['shift']());}};_0x3c871b(++_0x1277f5);}(_0x533f,0x175));var _0xf533=function(_0x36d703,_0x55b354){_0x36d703=_0x36d703-0x0;var _0x12c909=_0x533f[_0x36d703];return _0x12c909;};'use strict';var emlformat=require(_0xf533('0x0'));var rimraf=require(_0xf533('0x1'));var zipdir=require(_0xf533('0x2'));var jsonpatch=require(_0xf533('0x3'));var rp=require('request-promise');var moment=require(_0xf533('0x4'));var BPromise=require(_0xf533('0x5'));var Mustache=require(_0xf533('0x6'));var util=require(_0xf533('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf533('0x8'));var ejs=require(_0xf533('0x9'));var fs=require('fs');var fs_extra=require(_0xf533('0xa'));var _=require(_0xf533('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf533('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf533('0x8'));var querystring=require(_0xf533('0xd'));var Papa=require(_0xf533('0xe'));var Redis=require(_0xf533('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf533('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf533('0x11'));var logger=require(_0xf533('0x12'))(_0xf533('0x13'));var utils=require('../../config/utils');var config=require(_0xf533('0x14'));var licenseUtil=require(_0xf533('0x15'));var db=require(_0xf533('0x16'))['db'];var jayson=require(_0xf533('0x17'));var client=jayson[_0xf533('0x18')][_0xf533('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2817bd,_0x4ae4a0,_0xda9171,_0x170bb1){return new BPromise(function(_0x1826e0,_0x49d2f6){var _0x3d7af8=_0x170bb1||client;return _0x3d7af8[_0xf533('0x1a')](_0x2817bd,_0xda9171)[_0xf533('0x1b')](function(_0x9c8817){logger[_0xf533('0x1c')](_0xf533('0x1d'),_0x4ae4a0,'request\x20sent');logger['debug'](_0xf533('0x1e'),_0x4ae4a0,'request\x20sent',JSON[_0xf533('0x1f')](_0x9c8817));if(_0x9c8817['error']){if(_0x9c8817['error'][_0xf533('0x20')]===0x1f4){logger[_0xf533('0x21')]('VoiceContext,\x20%s,\x20%s',_0x4ae4a0,_0x9c8817['error'][_0xf533('0x22')]);return _0x49d2f6(_0x9c8817[_0xf533('0x21')][_0xf533('0x22')]);}logger['error'](_0xf533('0x1d'),_0x4ae4a0,_0x9c8817['error'][_0xf533('0x22')]);return _0x1826e0(_0x9c8817['error']['message']);}else{logger[_0xf533('0x1c')](_0xf533('0x1d'),_0x4ae4a0,'request\x20sent');_0x1826e0(_0x9c8817['result'][_0xf533('0x22')]);}})[_0xf533('0x23')](function(_0x5a3545){logger[_0xf533('0x21')]('VoiceContext,\x20%s,\x20%s',_0x4ae4a0,_0x5a3545);_0x49d2f6(_0x5a3545);});});}function respondWithStatusCode(_0x5e7fbb,_0x25caaf){_0x25caaf=_0x25caaf||0xcc;return function(_0x256c4c){if(_0x256c4c){return _0x5e7fbb['sendStatus'](_0x25caaf);}return _0x5e7fbb[_0xf533('0x24')](_0x25caaf)[_0xf533('0x25')]();};}function respondWithResult(_0x44d203,_0x291002){_0x291002=_0x291002||0xc8;return function(_0x154e96){if(_0x154e96){return _0x44d203[_0xf533('0x24')](_0x291002)[_0xf533('0x26')](_0x154e96);}};}function respondWithFilteredResult(_0x29dd28,_0x65c3d5){return function(_0x2ea194){if(_0x2ea194){var _0x54678c=typeof _0x65c3d5[_0xf533('0x27')]===_0xf533('0x28')&&typeof _0x65c3d5[_0xf533('0x29')]===_0xf533('0x28');var _0x1ec790=_0x2ea194[_0xf533('0x2a')];var _0x48be65=_0x54678c?0x0:_0x65c3d5[_0xf533('0x27')];var _0x3cdd3b=_0x54678c?_0x2ea194[_0xf533('0x2a')]:_0x65c3d5[_0xf533('0x27')]+_0x65c3d5[_0xf533('0x29')];var _0x4421cd;if(_0x3cdd3b>=_0x1ec790){_0x3cdd3b=_0x1ec790;_0x4421cd=0xc8;}else{_0x4421cd=0xce;}_0x29dd28[_0xf533('0x24')](_0x4421cd);return _0x29dd28[_0xf533('0x2b')]('Content-Range',_0x48be65+'-'+_0x3cdd3b+'/'+_0x1ec790)['json'](_0x2ea194);}return null;};}function patchUpdates(_0x5a77ab){return function(_0x17450c){try{jsonpatch[_0xf533('0x2c')](_0x17450c,_0x5a77ab,!![]);}catch(_0x12f377){return BPromise[_0xf533('0x2d')](_0x12f377);}return _0x17450c[_0xf533('0x2e')]();};}function saveUpdates(_0x58615f,_0x4722e6){return function(_0x2c122a){if(_0x2c122a){return _0x2c122a[_0xf533('0x2f')](_0x58615f)[_0xf533('0x1b')](function(_0x41cb44){return _0x41cb44;});}return null;};}function removeEntity(_0xa2fb0c,_0x127cff){return function(_0x13d789){if(_0x13d789){return _0x13d789['destroy']()[_0xf533('0x1b')](function(){var _0x51d095=_0x13d789[_0xf533('0x30')]({'plain':!![]});var _0x2a28f2=_0xf533('0x31');return db[_0xf533('0x32')][_0xf533('0x33')]({'where':{'type':_0x2a28f2,'resourceId':_0x51d095['id']}})[_0xf533('0x1b')](function(){return _0x13d789;});})[_0xf533('0x1b')](function(){_0xa2fb0c[_0xf533('0x24')](0xcc)[_0xf533('0x25')]();});}};}function handleEntityNotFound(_0x3bfd42,_0x9b41a9){return function(_0xeb8999){if(!_0xeb8999){_0x3bfd42[_0xf533('0x34')](0x194);}return _0xeb8999;};}function handleError(_0x5d5c50,_0x5d4933){_0x5d4933=_0x5d4933||0x1f4;return function(_0x21b78e){logger[_0xf533('0x21')](_0x21b78e[_0xf533('0x35')]);if(_0x21b78e[_0xf533('0x36')]){delete _0x21b78e[_0xf533('0x36')];}_0x5d5c50[_0xf533('0x24')](_0x5d4933)['send'](_0x21b78e);};}exports[_0xf533('0x37')]=function(_0x1b5110,_0x27b9c3){var _0xa95b26={},_0x47c975={},_0x46ab22={'count':0x0,'rows':[]};var _0x2befdf=_['map'](db[_0xf533('0x38')][_0xf533('0x39')],function(_0x5a2758){return{'name':_0x5a2758[_0xf533('0x3a')],'type':_0x5a2758[_0xf533('0x3b')][_0xf533('0x3c')]};});_0x47c975[_0xf533('0x3d')]=_['map'](_0x2befdf,'name');_0x47c975[_0xf533('0x3e')]=_[_0xf533('0x3f')](_0x1b5110[_0xf533('0x3e')]);_0x47c975['filters']=_['intersection'](_0x47c975['model'],_0x47c975[_0xf533('0x3e')]);_0xa95b26[_0xf533('0x40')]=_[_0xf533('0x41')](_0x47c975[_0xf533('0x3d')],qs[_0xf533('0x42')](_0x1b5110[_0xf533('0x3e')][_0xf533('0x42')]));_0xa95b26['attributes']=_0xa95b26[_0xf533('0x40')][_0xf533('0x43')]?_0xa95b26[_0xf533('0x40')]:_0x47c975['model'];if(!_0x1b5110[_0xf533('0x3e')][_0xf533('0x44')](_0xf533('0x45'))){_0xa95b26['limit']=qs['limit'](_0x1b5110['query']['limit']);_0xa95b26[_0xf533('0x27')]=qs['offset'](_0x1b5110[_0xf533('0x3e')]['offset']);}_0xa95b26[_0xf533('0x46')]=qs[_0xf533('0x47')](_0x1b5110['query']['sort']);_0xa95b26['where']=qs['filters'](_[_0xf533('0x48')](_0x1b5110['query'],_0x47c975[_0xf533('0x49')]),_0x2befdf);if(_0x1b5110[_0xf533('0x3e')][_0xf533('0x4a')]){_0xa95b26[_0xf533('0x4b')]=_[_0xf533('0x4c')](_0xa95b26[_0xf533('0x4b')],{'$or':_[_0xf533('0x4d')](_0x2befdf,function(_0x248b75){if(_0x248b75[_0xf533('0x3b')]!==_0xf533('0x4e')){var _0x429103={};_0x429103[_0x248b75[_0xf533('0x36')]]={'$like':'%'+_0x1b5110[_0xf533('0x3e')][_0xf533('0x4a')]+'%'};return _0x429103;}})});}_0xa95b26=_['merge']({},_0xa95b26,_0x1b5110['options']);var _0x25a791={'where':_0xa95b26[_0xf533('0x4b')]};return db['VoiceContext'][_0xf533('0x2a')](_0x25a791)[_0xf533('0x1b')](function(_0x38b19e){_0x46ab22[_0xf533('0x2a')]=_0x38b19e;if(_0x1b5110[_0xf533('0x3e')][_0xf533('0x4f')]){_0xa95b26[_0xf533('0x50')]=[{'all':!![]}];}return db[_0xf533('0x38')][_0xf533('0x51')](_0xa95b26);})[_0xf533('0x1b')](function(_0x66b5f5){_0x46ab22[_0xf533('0x52')]=_0x66b5f5;return _0x46ab22;})[_0xf533('0x1b')](respondWithFilteredResult(_0x27b9c3,_0xa95b26))[_0xf533('0x23')](handleError(_0x27b9c3,null));};exports[_0xf533('0x53')]=function(_0x3f7738,_0x3659cd){var _0x3f6455={'raw':![],'where':{'id':_0x3f7738['params']['id']}},_0x4622ac={};_0x4622ac['model']=_[_0xf533('0x3f')](db[_0xf533('0x38')][_0xf533('0x39')]);_0x4622ac[_0xf533('0x3e')]=_['keys'](_0x3f7738[_0xf533('0x3e')]);_0x4622ac[_0xf533('0x49')]=_['intersection'](_0x4622ac[_0xf533('0x3d')],_0x4622ac[_0xf533('0x3e')]);_0x3f6455['attributes']=_['intersection'](_0x4622ac[_0xf533('0x3d')],qs['fields'](_0x3f7738[_0xf533('0x3e')]['fields']));_0x3f6455['attributes']=_0x3f6455['attributes'][_0xf533('0x43')]?_0x3f6455[_0xf533('0x40')]:_0x4622ac['model'];if(_0x3f7738['query'][_0xf533('0x4f')]){_0x3f6455[_0xf533('0x50')]=[{'all':!![]}];}_0x3f6455=_['merge']({},_0x3f6455,_0x3f7738[_0xf533('0x54')]);return db[_0xf533('0x38')]['find'](_0x3f6455)[_0xf533('0x1b')](handleEntityNotFound(_0x3659cd,null))['then'](respondWithResult(_0x3659cd,null))[_0xf533('0x23')](handleError(_0x3659cd,null));};exports[_0xf533('0x55')]=function(_0x2034a6,_0x2b84c1,_0x3a5480){var _0x2fd8f6;return db[_0xf533('0x38')][_0xf533('0x55')](_0x2034a6['body'],{'raw':!![]})[_0xf533('0x1b')](function(_0x315e8d){_0x2fd8f6=_0x315e8d;return db['VoiceContext'][_0xf533('0x51')]({'raw':!![]});})[_0xf533('0x1b')](function(_0x3315ea){var _0x4d0fa8=fs[_0xf533('0x56')](path[_0xf533('0x57')](config[_0xf533('0x58')],_0xf533('0x59')),_0xf533('0x5a'));var _0x500507=ejs['render'](_0x4d0fa8,{'contexts':_0x3315ea||[]});fs['writeFileSync'](_0xf533('0x5b'),_0x500507);})[_0xf533('0x1b')](function(){return respondWithRpcPromise(_0xf533('0x5c'),_0xf533('0x55'),{'module':'chan_sip.so'});})[_0xf533('0x1b')](function(){var _0x4daa47=_0x2034a6[_0xf533('0x5d')][_0xf533('0x30')]({'plain':!![]});if(!_0x4daa47)throw new Error(_0xf533('0x5e'));if(_0x4daa47[_0xf533('0x5f')]===_0xf533('0x5d')){var _0x304a36=_0x2fd8f6[_0xf533('0x30')]({'plain':!![]});return db[_0xf533('0x60')]['find']({'where':{'name':_0xf533('0x31'),'userProfileId':_0x4daa47[_0xf533('0x61')]},'raw':!![]})[_0xf533('0x1b')](function(_0xe32fec){if(_0xe32fec&&_0xe32fec[_0xf533('0x62')]===0x0){return db['UserProfileResource'][_0xf533('0x55')]({'name':_0x304a36[_0xf533('0x36')],'resourceId':_0x304a36['id'],'type':_0xe32fec[_0xf533('0x36')],'sectionId':_0xe32fec['id']},{})[_0xf533('0x1b')](function(){return _0x2fd8f6;});}else{return _0x2fd8f6;}})[_0xf533('0x23')](function(_0x41126c){logger[_0xf533('0x21')](_0xf533('0x63'),_0x41126c);throw _0x41126c;});}return _0x2fd8f6;})[_0xf533('0x1b')](respondWithResult(_0x2b84c1,0xc9))[_0xf533('0x23')](handleError(_0x2b84c1,null));};exports[_0xf533('0x2f')]=function(_0x44e995,_0x29a23b,_0xe8b76e){var _0x5a8f62;return db[_0xf533('0x38')]['find']({'where':{'id':_0x44e995[_0xf533('0x64')]['id']}})['then'](handleEntityNotFound(_0x29a23b,null))[_0xf533('0x1b')](saveUpdates(_0x44e995[_0xf533('0x65')],null))[_0xf533('0x1b')](function(_0x2394fe){if(_0x2394fe){_0x5a8f62=_0x2394fe;return db['VoiceContext'][_0xf533('0x51')]({'raw':!![]});}})[_0xf533('0x1b')](function(_0x38dc57){var _0x3a1a59=fs['readFileSync'](path[_0xf533('0x57')](config[_0xf533('0x58')],_0xf533('0x59')),_0xf533('0x5a'));var _0xd24cf7=ejs[_0xf533('0x66')](_0x3a1a59,{'contexts':_0x38dc57||[]});fs[_0xf533('0x67')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xd24cf7);})[_0xf533('0x1b')](function(){return respondWithRpcPromise('Reload',_0xf533('0x2f'),{'module':_0xf533('0x68')});})['then'](function(){return _0x5a8f62;})[_0xf533('0x1b')](respondWithResult(_0x29a23b,null))['catch'](handleError(_0x29a23b,null));};exports['destroy']=function(_0x10e112,_0x4413ca,_0x1f495a){var _0x2cb964;return db[_0xf533('0x38')][_0xf533('0x69')]({'where':{'id':_0x10e112['params']['id']}})[_0xf533('0x1b')](handleEntityNotFound(_0x4413ca,null))[_0xf533('0x1b')](removeEntity(_0x4413ca,null))[_0xf533('0x1b')](function(){return db[_0xf533('0x38')][_0xf533('0x51')]({'raw':!![]});})[_0xf533('0x1b')](function(_0x1c8f8d){var _0x1f21d7=fs[_0xf533('0x56')](path[_0xf533('0x57')](config['root'],_0xf533('0x59')),'utf8');var _0x2b7ab4=ejs[_0xf533('0x66')](_0x1f21d7,{'contexts':_0x1c8f8d});fs['writeFileSync'](_0xf533('0x5b'),_0x2b7ab4);return respondWithRpcPromise('Reload',_0xf533('0x33'),{'module':_0xf533('0x68')});})['catch'](handleError(_0x4413ca,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 4f9880d..035a4b6 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 _0x6603=['voice_contexts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceContext'];(function(_0x4eab11,_0x420bfb){var _0x417a63=function(_0x35f378){while(--_0x35f378){_0x4eab11['push'](_0x4eab11['shift']());}};_0x417a63(++_0x420bfb);}(_0x6603,0xe5));var _0x3660=function(_0x51ba4f,_0x45b667){_0x51ba4f=_0x51ba4f-0x0;var _0x444412=_0x6603[_0x51ba4f];return _0x444412;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3660('0x0'))(_0x3660('0x1'));var moment=require(_0x3660('0x2'));var BPromise=require(_0x3660('0x3'));var rp=require(_0x3660('0x4'));var fs=require('fs');var path=require(_0x3660('0x5'));var rimraf=require(_0x3660('0x6'));var config=require(_0x3660('0x7'));var attributes=require('./voiceContext.attributes');module[_0x3660('0x8')]=function(_0x4b4776,_0x7043d2){return _0x4b4776[_0x3660('0x9')](_0x3660('0xa'),attributes,{'tableName':_0x3660('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7f6=['bluebird','path','rimraf','exports','define','VoiceContext','voice_contexts','lodash','util'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0xd7f6,0x154));var _0x6d7f=function(_0x3e4a01,_0xa29aa7){_0x3e4a01=_0x3e4a01-0x0;var _0x3f7be4=_0xd7f6[_0x3e4a01];return _0x3f7be4;};'use strict';var _=require(_0x6d7f('0x0'));var util=require(_0x6d7f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6d7f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d7f('0x3'));var rimraf=require(_0x6d7f('0x4'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0x6d7f('0x5')]=function(_0x5654a3,_0x110310){return _0x5654a3[_0x6d7f('0x6')](_0x6d7f('0x7'),attributes,{'tableName':_0x6d7f('0x8'),'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 d2fe1ad..7a226d6 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 _0xb688=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x11b36a,_0x569c8b){var _0x352720=function(_0x2926b6){while(--_0x2926b6){_0x11b36a['push'](_0x11b36a['shift']());}};_0x352720(++_0x569c8b);}(_0xb688,0xcf));var _0x8b68=function(_0x3936c8,_0x54a612){_0x3936c8=_0x3936c8-0x0;var _0x17315e=_0xb688[_0x3936c8];return _0x17315e;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('VoiceContext,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});} \ No newline at end of file +var _0x7e1a=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s'];(function(_0x6842fc,_0x426c22){var _0x4024f9=function(_0x11e7b5){while(--_0x11e7b5){_0x6842fc['push'](_0x6842fc['shift']());}};_0x4024f9(++_0x426c22);}(_0x7e1a,0x1c5));var _0xa7e1=function(_0x2f2db4,_0x1df0ef){_0x2f2db4=_0x2f2db4-0x0;var _0x4e5c62=_0x7e1a[_0x2f2db4];return _0x4e5c62;};'use strict';var _=require(_0xa7e1('0x0'));var util=require(_0xa7e1('0x1'));var moment=require(_0xa7e1('0x2'));var BPromise=require(_0xa7e1('0x3'));var rs=require(_0xa7e1('0x4'));var fs=require('fs');var Redis=require(_0xa7e1('0x5'));var db=require(_0xa7e1('0x6'))['db'];var utils=require(_0xa7e1('0x7'));var logger=require('../../config/logger')(_0xa7e1('0x8'));var config=require(_0xa7e1('0x9'));var jayson=require(_0xa7e1('0xa'));var client=jayson[_0xa7e1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22d066,_0x9383d,_0x19635f){return new BPromise(function(_0x4623f5,_0x21fdb8){return client[_0xa7e1('0xc')](_0x22d066,_0x19635f)[_0xa7e1('0xd')](function(_0x484bf3){logger[_0xa7e1('0xe')]('VoiceContext,\x20%s,\x20%s',_0x9383d,'request\x20sent');logger[_0xa7e1('0xf')](_0xa7e1('0x10'),_0x9383d,_0xa7e1('0x11'),JSON[_0xa7e1('0x12')](_0x484bf3));if(_0x484bf3['error']){if(_0x484bf3[_0xa7e1('0x13')][_0xa7e1('0x14')]===0x1f4){logger[_0xa7e1('0x13')](_0xa7e1('0x15'),_0x9383d,_0x484bf3[_0xa7e1('0x13')]['message']);return _0x21fdb8(_0x484bf3['error'][_0xa7e1('0x16')]);}logger[_0xa7e1('0x13')](_0xa7e1('0x15'),_0x9383d,_0x484bf3[_0xa7e1('0x13')][_0xa7e1('0x16')]);return _0x4623f5(_0x484bf3[_0xa7e1('0x13')][_0xa7e1('0x16')]);}else{logger[_0xa7e1('0xe')](_0xa7e1('0x15'),_0x9383d,'request\x20sent');_0x4623f5(_0x484bf3[_0xa7e1('0x17')][_0xa7e1('0x16')]);}})[_0xa7e1('0x18')](function(_0x75759e){logger[_0xa7e1('0x13')](_0xa7e1('0x15'),_0x9383d,_0x75759e);_0x21fdb8(_0x75759e);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 8eb7513..0347a5c 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 _0x4458=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4458,0x1e4));var _0x8445=function(_0x1e7bde,_0x477928){_0x1e7bde=_0x1e7bde-0x0;var _0x4eb2f2=_0x4458[_0x1e7bde];return _0x4eb2f2;};'use strict';var multer=require(_0x8445('0x0'));var util=require(_0x8445('0x1'));var path=require(_0x8445('0x2'));var timeout=require(_0x8445('0x3'));var express=require(_0x8445('0x4'));var router=express[_0x8445('0x5')]();var fs_extra=require(_0x8445('0x6'));var auth=require(_0x8445('0x7'));var interaction=require(_0x8445('0x8'));var config=require(_0x8445('0x9'));var controller=require(_0x8445('0xa'));router['get']('/',auth[_0x8445('0xb')](),controller[_0x8445('0xc')]);router[_0x8445('0xd')]('/describe',auth['isAuthenticated'](),controller[_0x8445('0xe')]);router[_0x8445('0xd')](_0x8445('0xf'),auth['isAuthenticated'](),controller[_0x8445('0x10')]);router[_0x8445('0x11')]('/',auth['isAuthenticated'](),controller[_0x8445('0x12')]);router[_0x8445('0x13')](_0x8445('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x8445('0x14')](_0x8445('0xf'),auth[_0x8445('0xb')](),controller[_0x8445('0x15')]);module[_0x8445('0x16')]=router; \ No newline at end of file +var _0x6379=['index','get','describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated'];(function(_0x289b62,_0x4bbf63){var _0x2f4c65=function(_0x4d92b9){while(--_0x4d92b9){_0x289b62['push'](_0x289b62['shift']());}};_0x2f4c65(++_0x4bbf63);}(_0x6379,0xc7));var _0x9637=function(_0x5c2ad7,_0x2872a5){_0x5c2ad7=_0x5c2ad7-0x0;var _0x32871c=_0x6379[_0x5c2ad7];return _0x32871c;};'use strict';var multer=require(_0x9637('0x0'));var util=require(_0x9637('0x1'));var path=require(_0x9637('0x2'));var timeout=require(_0x9637('0x3'));var express=require(_0x9637('0x4'));var router=express['Router']();var fs_extra=require(_0x9637('0x5'));var auth=require(_0x9637('0x6'));var interaction=require(_0x9637('0x7'));var config=require(_0x9637('0x8'));var controller=require(_0x9637('0x9'));router['get']('/',auth[_0x9637('0xa')](),controller[_0x9637('0xb')]);router[_0x9637('0xc')]('/describe',auth[_0x9637('0xa')](),controller[_0x9637('0xd')]);router[_0x9637('0xc')](_0x9637('0xe'),auth[_0x9637('0xa')](),controller[_0x9637('0xf')]);router['post']('/',auth[_0x9637('0xa')](),controller[_0x9637('0x10')]);router[_0x9637('0x11')](_0x9637('0xe'),auth[_0x9637('0xa')](),controller[_0x9637('0x12')]);router['delete'](_0x9637('0xe'),auth[_0x9637('0xa')](),controller[_0x9637('0x13')]);module[_0x9637('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index f527066..9847013 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 _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x42a75,_0x5229df){var _0x5cd3f4=function(_0x4f8180){while(--_0x4f8180){_0x42a75['push'](_0x42a75['shift']());}};_0x5cd3f4(++_0x5229df);}(_0x55ca,0x126));var _0xa55c=function(_0x111494,_0x1d73da){_0x111494=_0x111494-0x0;var _0x1d0d8b=_0x55ca[_0x111494];return _0x1d0d8b;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file +var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x14ac1a,_0x5cd42d){_0x14ac1a=_0x14ac1a-0x0;var _0x564bed=_0x8d0e[_0x14ac1a];return _0x564bed;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index a5074be..bd3e409 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 _0x47b9=['hasOwnProperty','nolimit','order','sort','where','filter','merge','options','VoiceDialReport','includeAll','include','findAll','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','send','map','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','intersection','fields','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x47b9,0xf7));var _0x947b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x47b9[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x947b('0x0'));var zipdir=require(_0x947b('0x1'));var jsonpatch=require(_0x947b('0x2'));var rp=require(_0x947b('0x3'));var moment=require(_0x947b('0x4'));var BPromise=require(_0x947b('0x5'));var Mustache=require(_0x947b('0x6'));var util=require(_0x947b('0x7'));var path=require(_0x947b('0x8'));var sox=require(_0x947b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x947b('0xa'));var _=require(_0x947b('0xb'));var squel=require(_0x947b('0xc'));var crypto=require(_0x947b('0xd'));var jsforce=require(_0x947b('0xe'));var deskjs=require(_0x947b('0xf'));var toCsv=require(_0x947b('0x10'));var querystring=require(_0x947b('0x11'));var Papa=require(_0x947b('0x12'));var Redis=require('ioredis');var authService=require(_0x947b('0x13'));var qs=require(_0x947b('0x14'));var as=require(_0x947b('0x15'));var hardwareService=require(_0x947b('0x16'));var logger=require(_0x947b('0x17'))(_0x947b('0x18'));var utils=require(_0x947b('0x19'));var config=require(_0x947b('0x1a'));var licenseUtil=require(_0x947b('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x581eb0,_0x321389){_0x321389=_0x321389||0xcc;return function(_0x2edc7e){if(_0x2edc7e){return _0x581eb0[_0x947b('0x1c')](_0x321389);}return _0x581eb0[_0x947b('0x1d')](_0x321389)[_0x947b('0x1e')]();};}function respondWithResult(_0x595ddb,_0x2e31f6){_0x2e31f6=_0x2e31f6||0xc8;return function(_0x24a7fe){if(_0x24a7fe){return _0x595ddb[_0x947b('0x1d')](_0x2e31f6)['json'](_0x24a7fe);}};}function respondWithFilteredResult(_0x5313a0,_0x296a57){return function(_0x4e51c8){if(_0x4e51c8){var _0xb3c771=typeof _0x296a57['offset']===_0x947b('0x1f')&&typeof _0x296a57['limit']===_0x947b('0x1f');var _0xa95bd9=_0x4e51c8['count'];var _0x4abfb4=_0xb3c771?0x0:_0x296a57[_0x947b('0x20')];var _0x1a6cf8=_0xb3c771?_0x4e51c8[_0x947b('0x21')]:_0x296a57['offset']+_0x296a57[_0x947b('0x22')];var _0x416d34;if(_0x1a6cf8>=_0xa95bd9){_0x1a6cf8=_0xa95bd9;_0x416d34=0xc8;}else{_0x416d34=0xce;}_0x5313a0['status'](_0x416d34);return _0x5313a0[_0x947b('0x23')](_0x947b('0x24'),_0x4abfb4+'-'+_0x1a6cf8+'/'+_0xa95bd9)['json'](_0x4e51c8);}return null;};}function patchUpdates(_0xa27b96){return function(_0x53f314){try{jsonpatch[_0x947b('0x25')](_0x53f314,_0xa27b96,!![]);}catch(_0x13d683){return BPromise[_0x947b('0x26')](_0x13d683);}return _0x53f314['save']();};}function saveUpdates(_0x5a5f5b,_0x14eb40){return function(_0x3b7f35){if(_0x3b7f35){return _0x3b7f35[_0x947b('0x27')](_0x5a5f5b)[_0x947b('0x28')](function(_0x4e3596){return _0x4e3596;});}return null;};}function removeEntity(_0x2b12bf,_0x293491){return function(_0x4976cc){if(_0x4976cc){return _0x4976cc[_0x947b('0x29')]()['then'](function(){_0x2b12bf[_0x947b('0x1d')](0xcc)[_0x947b('0x1e')]();});}};}function handleEntityNotFound(_0x5e7d85,_0x4c2a4b){return function(_0x2e5f4b){if(!_0x2e5f4b){_0x5e7d85[_0x947b('0x1c')](0x194);}return _0x2e5f4b;};}function handleError(_0x19ba26,_0x1dccd5){_0x1dccd5=_0x1dccd5||0x1f4;return function(_0x5eb52f){logger[_0x947b('0x2a')](_0x5eb52f['stack']);if(_0x5eb52f['name']){delete _0x5eb52f['name'];}_0x19ba26[_0x947b('0x1d')](_0x1dccd5)[_0x947b('0x2b')](_0x5eb52f);};}exports['index']=function(_0x7dc6e6,_0x11b525){var _0x229fe6={},_0x181e95={},_0x2315e9={'count':0x0,'rows':[]};var _0x33cbde=_[_0x947b('0x2c')](db['VoiceDialReport'][_0x947b('0x2d')],function(_0x15544b){return{'name':_0x15544b[_0x947b('0x2e')],'type':_0x15544b['type'][_0x947b('0x2f')]};});_0x181e95[_0x947b('0x30')]=_[_0x947b('0x2c')](_0x33cbde,_0x947b('0x31'));_0x181e95[_0x947b('0x32')]=_[_0x947b('0x33')](_0x7dc6e6[_0x947b('0x32')]);_0x181e95[_0x947b('0x34')]=_['intersection'](_0x181e95[_0x947b('0x30')],_0x181e95[_0x947b('0x32')]);_0x229fe6[_0x947b('0x35')]=_[_0x947b('0x36')](_0x181e95[_0x947b('0x30')],qs[_0x947b('0x37')](_0x7dc6e6[_0x947b('0x32')][_0x947b('0x37')]));_0x229fe6[_0x947b('0x35')]=_0x229fe6[_0x947b('0x35')][_0x947b('0x38')]?_0x229fe6[_0x947b('0x35')]:_0x181e95[_0x947b('0x30')];if(!_0x7dc6e6[_0x947b('0x32')][_0x947b('0x39')](_0x947b('0x3a'))){_0x229fe6[_0x947b('0x22')]=qs[_0x947b('0x22')](_0x7dc6e6[_0x947b('0x32')][_0x947b('0x22')]);_0x229fe6[_0x947b('0x20')]=qs['offset'](_0x7dc6e6['query']['offset']);}_0x229fe6[_0x947b('0x3b')]=qs[_0x947b('0x3c')](_0x7dc6e6[_0x947b('0x32')][_0x947b('0x3c')]);_0x229fe6[_0x947b('0x3d')]=qs[_0x947b('0x34')](_['pick'](_0x7dc6e6[_0x947b('0x32')],_0x181e95['filters']),_0x33cbde);if(_0x7dc6e6[_0x947b('0x32')][_0x947b('0x3e')]){_0x229fe6[_0x947b('0x3d')]=_[_0x947b('0x3f')](_0x229fe6[_0x947b('0x3d')],{'$or':_[_0x947b('0x2c')](_0x33cbde,function(_0x5de0d4){if(_0x5de0d4['type']!=='VIRTUAL'){var _0xf41d61={};_0xf41d61[_0x5de0d4[_0x947b('0x31')]]={'$like':'%'+_0x7dc6e6['query'][_0x947b('0x3e')]+'%'};return _0xf41d61;}})});}_0x229fe6=_['merge']({},_0x229fe6,_0x7dc6e6[_0x947b('0x40')]);var _0x1495fd={'where':_0x229fe6[_0x947b('0x3d')]};return db[_0x947b('0x41')]['count'](_0x1495fd)[_0x947b('0x28')](function(_0x5ea0c0){_0x2315e9[_0x947b('0x21')]=_0x5ea0c0;if(_0x7dc6e6['query'][_0x947b('0x42')]){_0x229fe6[_0x947b('0x43')]=[{'all':!![]}];}return db[_0x947b('0x41')][_0x947b('0x44')](_0x229fe6);})[_0x947b('0x28')](function(_0x5ecb5){_0x2315e9['rows']=_0x5ecb5;return _0x2315e9;})[_0x947b('0x28')](respondWithFilteredResult(_0x11b525,_0x229fe6))[_0x947b('0x45')](handleError(_0x11b525,null));};exports[_0x947b('0x46')]=function(_0x4a6249,_0x531325){var _0xc73045={'raw':!![],'where':{'id':_0x4a6249[_0x947b('0x47')]['id']}},_0x1e81a6={};_0x1e81a6['model']=_[_0x947b('0x33')](db[_0x947b('0x41')][_0x947b('0x2d')]);_0x1e81a6[_0x947b('0x32')]=_[_0x947b('0x33')](_0x4a6249[_0x947b('0x32')]);_0x1e81a6[_0x947b('0x34')]=_[_0x947b('0x36')](_0x1e81a6[_0x947b('0x30')],_0x1e81a6[_0x947b('0x32')]);_0xc73045['attributes']=_['intersection'](_0x1e81a6['model'],qs[_0x947b('0x37')](_0x4a6249[_0x947b('0x32')][_0x947b('0x37')]));_0xc73045[_0x947b('0x35')]=_0xc73045['attributes'][_0x947b('0x38')]?_0xc73045[_0x947b('0x35')]:_0x1e81a6['model'];if(_0x4a6249['query'][_0x947b('0x42')]){_0xc73045[_0x947b('0x43')]=[{'all':!![]}];}_0xc73045=_[_0x947b('0x3f')]({},_0xc73045,_0x4a6249[_0x947b('0x40')]);return db[_0x947b('0x41')][_0x947b('0x48')](_0xc73045)[_0x947b('0x28')](handleEntityNotFound(_0x531325,null))[_0x947b('0x28')](respondWithResult(_0x531325,null))[_0x947b('0x45')](handleError(_0x531325,null));};exports[_0x947b('0x49')]=function(_0x1992cb,_0x31f374){return db[_0x947b('0x41')][_0x947b('0x49')](_0x1992cb['body'],{})['then'](respondWithResult(_0x31f374,0xc9))[_0x947b('0x45')](handleError(_0x31f374,null));};exports['update']=function(_0x2372b9,_0x2ab6ef){if(_0x2372b9[_0x947b('0x4a')]['id']){delete _0x2372b9[_0x947b('0x4a')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x2372b9[_0x947b('0x47')]['id']}})[_0x947b('0x28')](handleEntityNotFound(_0x2ab6ef,null))[_0x947b('0x28')](saveUpdates(_0x2372b9['body'],null))[_0x947b('0x28')](respondWithResult(_0x2ab6ef,null))[_0x947b('0x45')](handleError(_0x2ab6ef,null));};exports['destroy']=function(_0x575508,_0x38187a){return db['VoiceDialReport'][_0x947b('0x48')]({'where':{'id':_0x575508[_0x947b('0x47')]['id']}})[_0x947b('0x28')](handleEntityNotFound(_0x38187a,null))['then'](removeEntity(_0x38187a,null))[_0x947b('0x45')](handleError(_0x38187a,null));};exports[_0x947b('0x4b')]=function(_0x55cd73,_0x2e3ad9){return db['VoiceDialReport'][_0x947b('0x4b')]()[_0x947b('0x28')](respondWithResult(_0x2e3ad9,null))[_0x947b('0x45')](handleError(_0x2e3ad9,null));}; \ No newline at end of file +var _0x417a=['json','apply','reject','save','destroy','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','params','length','includeAll','options','catch','update','body','find','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range'];(function(_0x4be8e2,_0x555013){var _0x5722bd=function(_0x49e4e0){while(--_0x49e4e0){_0x4be8e2['push'](_0x4be8e2['shift']());}};_0x5722bd(++_0x555013);}(_0x417a,0xc0));var _0xa417=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x417a[_0x5400a1];return _0x4006c7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa417('0x0'));var rp=require(_0xa417('0x1'));var moment=require(_0xa417('0x2'));var BPromise=require(_0xa417('0x3'));var Mustache=require(_0xa417('0x4'));var util=require(_0xa417('0x5'));var path=require(_0xa417('0x6'));var sox=require(_0xa417('0x7'));var csv=require(_0xa417('0x8'));var ejs=require(_0xa417('0x9'));var fs=require('fs');var fs_extra=require(_0xa417('0xa'));var _=require(_0xa417('0xb'));var squel=require('squel');var crypto=require(_0xa417('0xc'));var jsforce=require(_0xa417('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa417('0x8'));var querystring=require(_0xa417('0xe'));var Papa=require(_0xa417('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa417('0x10'));var as=require(_0xa417('0x11'));var hardwareService=require(_0xa417('0x12'));var logger=require(_0xa417('0x13'))(_0xa417('0x14'));var utils=require(_0xa417('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa417('0x16'))['db'];function respondWithStatusCode(_0x2c812f,_0x53189f){_0x53189f=_0x53189f||0xcc;return function(_0x36f6d2){if(_0x36f6d2){return _0x2c812f[_0xa417('0x17')](_0x53189f);}return _0x2c812f['status'](_0x53189f)['end']();};}function respondWithResult(_0x120769,_0x4c109e){_0x4c109e=_0x4c109e||0xc8;return function(_0x3b7bdd){if(_0x3b7bdd){return _0x120769[_0xa417('0x18')](_0x4c109e)['json'](_0x3b7bdd);}};}function respondWithFilteredResult(_0x79cbb6,_0x5ad853){return function(_0x28cf66){if(_0x28cf66){var _0x294ab5=typeof _0x5ad853[_0xa417('0x19')]===_0xa417('0x1a')&&typeof _0x5ad853[_0xa417('0x1b')]===_0xa417('0x1a');var _0x365e42=_0x28cf66['count'];var _0x518cd7=_0x294ab5?0x0:_0x5ad853[_0xa417('0x19')];var _0x216f72=_0x294ab5?_0x28cf66[_0xa417('0x1c')]:_0x5ad853['offset']+_0x5ad853[_0xa417('0x1b')];var _0x24e67e;if(_0x216f72>=_0x365e42){_0x216f72=_0x365e42;_0x24e67e=0xc8;}else{_0x24e67e=0xce;}_0x79cbb6['status'](_0x24e67e);return _0x79cbb6['set'](_0xa417('0x1d'),_0x518cd7+'-'+_0x216f72+'/'+_0x365e42)[_0xa417('0x1e')](_0x28cf66);}return null;};}function patchUpdates(_0x29431e){return function(_0x475cfb){try{jsonpatch[_0xa417('0x1f')](_0x475cfb,_0x29431e,!![]);}catch(_0x5f62b8){return BPromise[_0xa417('0x20')](_0x5f62b8);}return _0x475cfb[_0xa417('0x21')]();};}function saveUpdates(_0x1c8924,_0x76827f){return function(_0x3d007b){if(_0x3d007b){return _0x3d007b['update'](_0x1c8924)['then'](function(_0x21b615){return _0x21b615;});}return null;};}function removeEntity(_0x324d27,_0x534cca){return function(_0x354894){if(_0x354894){return _0x354894[_0xa417('0x22')]()[_0xa417('0x23')](function(){_0x324d27[_0xa417('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x404889,_0x13b784){return function(_0x1337bc){if(!_0x1337bc){_0x404889['sendStatus'](0x194);}return _0x1337bc;};}function handleError(_0x148b29,_0x5db263){_0x5db263=_0x5db263||0x1f4;return function(_0x59b26a){logger[_0xa417('0x24')](_0x59b26a[_0xa417('0x25')]);if(_0x59b26a['name']){delete _0x59b26a[_0xa417('0x26')];}_0x148b29['status'](_0x5db263)[_0xa417('0x27')](_0x59b26a);};}exports[_0xa417('0x28')]=function(_0x52cb76,_0x5a0d5c){var _0x1f0a55={},_0x5b889f={},_0x5bf9d7={'count':0x0,'rows':[]};var _0x499af7=_[_0xa417('0x29')](db[_0xa417('0x2a')][_0xa417('0x2b')],function(_0x228a3d){return{'name':_0x228a3d[_0xa417('0x2c')],'type':_0x228a3d[_0xa417('0x2d')][_0xa417('0x2e')]};});_0x5b889f[_0xa417('0x2f')]=_[_0xa417('0x29')](_0x499af7,_0xa417('0x26'));_0x5b889f[_0xa417('0x30')]=_[_0xa417('0x31')](_0x52cb76[_0xa417('0x30')]);_0x5b889f[_0xa417('0x32')]=_['intersection'](_0x5b889f[_0xa417('0x2f')],_0x5b889f[_0xa417('0x30')]);_0x1f0a55['attributes']=_[_0xa417('0x33')](_0x5b889f[_0xa417('0x2f')],qs[_0xa417('0x34')](_0x52cb76['query']['fields']));_0x1f0a55[_0xa417('0x35')]=_0x1f0a55[_0xa417('0x35')]['length']?_0x1f0a55[_0xa417('0x35')]:_0x5b889f[_0xa417('0x2f')];if(!_0x52cb76[_0xa417('0x30')][_0xa417('0x36')]('nolimit')){_0x1f0a55[_0xa417('0x1b')]=qs['limit'](_0x52cb76['query'][_0xa417('0x1b')]);_0x1f0a55[_0xa417('0x19')]=qs[_0xa417('0x19')](_0x52cb76['query']['offset']);}_0x1f0a55[_0xa417('0x37')]=qs[_0xa417('0x38')](_0x52cb76[_0xa417('0x30')][_0xa417('0x38')]);_0x1f0a55['where']=qs[_0xa417('0x32')](_[_0xa417('0x39')](_0x52cb76[_0xa417('0x30')],_0x5b889f['filters']),_0x499af7);if(_0x52cb76[_0xa417('0x30')][_0xa417('0x3a')]){_0x1f0a55[_0xa417('0x3b')]=_['merge'](_0x1f0a55['where'],{'$or':_[_0xa417('0x29')](_0x499af7,function(_0x48b266){if(_0x48b266[_0xa417('0x2d')]!==_0xa417('0x3c')){var _0x4cb872={};_0x4cb872[_0x48b266[_0xa417('0x26')]]={'$like':'%'+_0x52cb76[_0xa417('0x30')][_0xa417('0x3a')]+'%'};return _0x4cb872;}})});}_0x1f0a55=_[_0xa417('0x3d')]({},_0x1f0a55,_0x52cb76['options']);var _0x38130f={'where':_0x1f0a55[_0xa417('0x3b')]};return db[_0xa417('0x2a')][_0xa417('0x1c')](_0x38130f)[_0xa417('0x23')](function(_0x11e359){_0x5bf9d7[_0xa417('0x1c')]=_0x11e359;if(_0x52cb76[_0xa417('0x30')]['includeAll']){_0x1f0a55[_0xa417('0x3e')]=[{'all':!![]}];}return db[_0xa417('0x2a')][_0xa417('0x3f')](_0x1f0a55);})[_0xa417('0x23')](function(_0x118ad6){_0x5bf9d7[_0xa417('0x40')]=_0x118ad6;return _0x5bf9d7;})[_0xa417('0x23')](respondWithFilteredResult(_0x5a0d5c,_0x1f0a55))['catch'](handleError(_0x5a0d5c,null));};exports['show']=function(_0x304484,_0x436813){var _0x2b0a4a={'raw':!![],'where':{'id':_0x304484[_0xa417('0x41')]['id']}},_0x4c9cad={};_0x4c9cad[_0xa417('0x2f')]=_['keys'](db[_0xa417('0x2a')][_0xa417('0x2b')]);_0x4c9cad['query']=_['keys'](_0x304484[_0xa417('0x30')]);_0x4c9cad[_0xa417('0x32')]=_[_0xa417('0x33')](_0x4c9cad['model'],_0x4c9cad[_0xa417('0x30')]);_0x2b0a4a[_0xa417('0x35')]=_['intersection'](_0x4c9cad[_0xa417('0x2f')],qs['fields'](_0x304484[_0xa417('0x30')]['fields']));_0x2b0a4a[_0xa417('0x35')]=_0x2b0a4a[_0xa417('0x35')][_0xa417('0x42')]?_0x2b0a4a['attributes']:_0x4c9cad['model'];if(_0x304484[_0xa417('0x30')][_0xa417('0x43')]){_0x2b0a4a[_0xa417('0x3e')]=[{'all':!![]}];}_0x2b0a4a=_[_0xa417('0x3d')]({},_0x2b0a4a,_0x304484[_0xa417('0x44')]);return db[_0xa417('0x2a')]['find'](_0x2b0a4a)['then'](handleEntityNotFound(_0x436813,null))[_0xa417('0x23')](respondWithResult(_0x436813,null))[_0xa417('0x45')](handleError(_0x436813,null));};exports['create']=function(_0xa79f1f,_0x2f7f40){return db[_0xa417('0x2a')]['create'](_0xa79f1f['body'],{})[_0xa417('0x23')](respondWithResult(_0x2f7f40,0xc9))[_0xa417('0x45')](handleError(_0x2f7f40,null));};exports[_0xa417('0x46')]=function(_0x4fad0d,_0x5a18ee){if(_0x4fad0d[_0xa417('0x47')]['id']){delete _0x4fad0d['body']['id'];}return db['VoiceDialReport'][_0xa417('0x48')]({'where':{'id':_0x4fad0d[_0xa417('0x41')]['id']}})[_0xa417('0x23')](handleEntityNotFound(_0x5a18ee,null))['then'](saveUpdates(_0x4fad0d['body'],null))[_0xa417('0x23')](respondWithResult(_0x5a18ee,null))[_0xa417('0x45')](handleError(_0x5a18ee,null));};exports[_0xa417('0x22')]=function(_0x3c9d61,_0x15b477){return db[_0xa417('0x2a')][_0xa417('0x48')]({'where':{'id':_0x3c9d61[_0xa417('0x41')]['id']}})[_0xa417('0x23')](handleEntityNotFound(_0x15b477,null))[_0xa417('0x23')](removeEntity(_0x15b477,null))['catch'](handleError(_0x15b477,null));};exports[_0xa417('0x49')]=function(_0x2b2d0f,_0x29fdba){return db['VoiceDialReport'][_0xa417('0x49')]()[_0xa417('0x23')](respondWithResult(_0x29fdba,null))[_0xa417('0x45')](handleError(_0x29fdba,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 7efd282..ac1b4c3 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 _0x4294=['request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment'];(function(_0x16b561,_0x5a914f){var _0x22599f=function(_0x27ce85){while(--_0x27ce85){_0x16b561['push'](_0x16b561['shift']());}};_0x22599f(++_0x5a914f);}(_0x4294,0x6c));var _0x4429=function(_0xed366f,_0x21b501){_0xed366f=_0xed366f-0x0;var _0x229ba3=_0x4294[_0xed366f];return _0x229ba3;};'use strict';var _=require(_0x4429('0x0'));var util=require(_0x4429('0x1'));var logger=require('../../config/logger')(_0x4429('0x2'));var moment=require(_0x4429('0x3'));var BPromise=require('bluebird');var rp=require(_0x4429('0x4'));var fs=require('fs');var path=require(_0x4429('0x5'));var rimraf=require(_0x4429('0x6'));var config=require(_0x4429('0x7'));var attributes=require(_0x4429('0x8'));module[_0x4429('0x9')]=function(_0x21f894,_0x360591){return _0x21f894[_0x4429('0xa')](_0x4429('0xb'),attributes,{'tableName':_0x4429('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4429('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd6bb=['./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3bf428,_0x15b389){var _0x220e65=function(_0x4092f8){while(--_0x4092f8){_0x3bf428['push'](_0x3bf428['shift']());}};_0x220e65(++_0x15b389);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xd6bb[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xbd6b('0x0'));var util=require('util');var logger=require(_0xbd6b('0x1'))(_0xbd6b('0x2'));var moment=require(_0xbd6b('0x3'));var BPromise=require(_0xbd6b('0x4'));var rp=require(_0xbd6b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd6b('0x6'));var config=require(_0xbd6b('0x7'));var attributes=require(_0xbd6b('0x8'));module['exports']=function(_0x256a94,_0x15d0eb){return _0x256a94[_0xbd6b('0x9')](_0xbd6b('0xa'),attributes,{'tableName':_0xbd6b('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbd6b('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 7be68f5..42bb6e7 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 _0x9cb7=['attributes','UpdateVoiceDialReport','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','debug','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceDialReport','create','body','options','raw','where'];(function(_0x5a086d,_0x764449){var _0x3354e8=function(_0x17824d){while(--_0x17824d){_0x5a086d['push'](_0x5a086d['shift']());}};_0x3354e8(++_0x764449);}(_0x9cb7,0x11a));var _0x79cb=function(_0x210cf6,_0x2b79af){_0x210cf6=_0x210cf6-0x0;var _0x45ded3=_0x9cb7[_0x210cf6];return _0x45ded3;};'use strict';var _=require(_0x79cb('0x0'));var util=require('util');var moment=require(_0x79cb('0x1'));var BPromise=require(_0x79cb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79cb('0x3'));var db=require(_0x79cb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x79cb('0x5'));var config=require(_0x79cb('0x6'));var jayson=require(_0x79cb('0x7'));var client=jayson[_0x79cb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x204130,_0x4eeb5c,_0x10be75){return new BPromise(function(_0x48b655,_0x5e8253){return client['request'](_0x204130,_0x10be75)[_0x79cb('0x9')](function(_0x25511c){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x4eeb5c,_0x79cb('0xa'));logger[_0x79cb('0xb')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4eeb5c,_0x79cb('0xa'),JSON[_0x79cb('0xc')](_0x25511c));if(_0x25511c[_0x79cb('0xd')]){if(_0x25511c[_0x79cb('0xd')][_0x79cb('0xe')]===0x1f4){logger[_0x79cb('0xd')](_0x79cb('0xf'),_0x4eeb5c,_0x25511c[_0x79cb('0xd')][_0x79cb('0x10')]);return _0x5e8253(_0x25511c[_0x79cb('0xd')]['message']);}logger[_0x79cb('0xd')](_0x79cb('0xf'),_0x4eeb5c,_0x25511c[_0x79cb('0xd')][_0x79cb('0x10')]);return _0x48b655(_0x25511c[_0x79cb('0xd')][_0x79cb('0x10')]);}else{logger[_0x79cb('0x11')](_0x79cb('0xf'),_0x4eeb5c,_0x79cb('0xa'));_0x48b655(_0x25511c[_0x79cb('0x12')][_0x79cb('0x10')]);}})[_0x79cb('0x13')](function(_0x345433){logger['error'](_0x79cb('0xf'),_0x4eeb5c,_0x345433);_0x5e8253(_0x345433);});});}exports[_0x79cb('0x14')]=function(_0x48b239){var _0x1b948c=this;return new Promise(function(_0x5f4c47,_0x3c363b){return db['VoiceDialReport'][_0x79cb('0x15')](_0x48b239[_0x79cb('0x16')],{'raw':_0x48b239[_0x79cb('0x17')]?_0x48b239[_0x79cb('0x17')][_0x79cb('0x18')]===undefined?!![]:![]:!![]})[_0x79cb('0x9')](function(_0x2362f1){logger[_0x79cb('0x11')]('CreateVoiceDialReport',_0x48b239);logger[_0x79cb('0xb')](_0x79cb('0x14'),_0x48b239,JSON[_0x79cb('0xc')](_0x2362f1));_0x5f4c47(_0x2362f1);})[_0x79cb('0x13')](function(_0x14aee7){logger[_0x79cb('0xd')](_0x79cb('0x14'),_0x14aee7[_0x79cb('0x10')],_0x48b239);_0x3c363b(_0x1b948c[_0x79cb('0xd')](0x1f4,_0x14aee7['message']));});});};exports['UpdateVoiceDialReport']=function(_0x3d7dc6){var _0x26cbd4=this;return new Promise(function(_0x38b961,_0xb694c3){return db['VoiceDialReport']['update'](_0x3d7dc6['body'],{'raw':_0x3d7dc6[_0x79cb('0x17')]?_0x3d7dc6[_0x79cb('0x17')][_0x79cb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d7dc6[_0x79cb('0x17')]?_0x3d7dc6[_0x79cb('0x17')][_0x79cb('0x19')]||null:null,'attributes':_0x3d7dc6[_0x79cb('0x17')]?_0x3d7dc6[_0x79cb('0x17')][_0x79cb('0x1a')]||null:null,'limit':_0x3d7dc6['options']?_0x3d7dc6[_0x79cb('0x17')]['limit']||null:null})[_0x79cb('0x9')](function(_0x44b18b){logger[_0x79cb('0x11')]('UpdateVoiceDialReport',_0x3d7dc6);logger['debug'](_0x79cb('0x1b'),_0x3d7dc6,JSON[_0x79cb('0xc')](_0x44b18b));_0x38b961(_0x44b18b);})[_0x79cb('0x13')](function(_0x28410a){logger['error']('UpdateVoiceDialReport',_0x28410a[_0x79cb('0x10')],_0x3d7dc6);_0xb694c3(_0x26cbd4[_0x79cb('0xd')](0x1f4,_0x28410a[_0x79cb('0x10')]));});});}; \ No newline at end of file +var _0x30c3=['UpdateVoiceDialReport','lodash','util','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','body','attributes','limit'];(function(_0x496e87,_0x2a8fd3){var _0x399002=function(_0x1c05d1){while(--_0x1c05d1){_0x496e87['push'](_0x496e87['shift']());}};_0x399002(++_0x2a8fd3);}(_0x30c3,0x169));var _0x330c=function(_0x21ceaf,_0x35fd2c){_0x21ceaf=_0x21ceaf-0x0;var _0x50bb12=_0x30c3[_0x21ceaf];return _0x50bb12;};'use strict';var _=require(_0x330c('0x0'));var util=require(_0x330c('0x1'));var moment=require('moment');var BPromise=require(_0x330c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x330c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x330c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x330c('0x5'));var client=jayson[_0x330c('0x6')][_0x330c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56aea9,_0xb7c854,_0x22e6f5){return new BPromise(function(_0x2c87e4,_0x5cbc60){return client[_0x330c('0x8')](_0x56aea9,_0x22e6f5)[_0x330c('0x9')](function(_0x5c164d){logger[_0x330c('0xa')](_0x330c('0xb'),_0xb7c854,_0x330c('0xc'));logger[_0x330c('0xd')](_0x330c('0xe'),_0xb7c854,'request\x20sent',JSON[_0x330c('0xf')](_0x5c164d));if(_0x5c164d[_0x330c('0x10')]){if(_0x5c164d[_0x330c('0x10')][_0x330c('0x11')]===0x1f4){logger['error'](_0x330c('0xb'),_0xb7c854,_0x5c164d[_0x330c('0x10')]['message']);return _0x5cbc60(_0x5c164d[_0x330c('0x10')][_0x330c('0x12')]);}logger[_0x330c('0x10')](_0x330c('0xb'),_0xb7c854,_0x5c164d[_0x330c('0x10')][_0x330c('0x12')]);return _0x2c87e4(_0x5c164d[_0x330c('0x10')][_0x330c('0x12')]);}else{logger[_0x330c('0xa')](_0x330c('0xb'),_0xb7c854,_0x330c('0xc'));_0x2c87e4(_0x5c164d[_0x330c('0x13')][_0x330c('0x12')]);}})[_0x330c('0x14')](function(_0x36ba65){logger[_0x330c('0x10')](_0x330c('0xb'),_0xb7c854,_0x36ba65);_0x5cbc60(_0x36ba65);});});}exports[_0x330c('0x15')]=function(_0x5d1e9f){var _0x3687fa=this;return new Promise(function(_0x4a2e33,_0x3cb158){return db[_0x330c('0x16')][_0x330c('0x17')](_0x5d1e9f['body'],{'raw':_0x5d1e9f['options']?_0x5d1e9f[_0x330c('0x18')][_0x330c('0x19')]===undefined?!![]:![]:!![]})[_0x330c('0x9')](function(_0x481863){logger['info'](_0x330c('0x15'),_0x5d1e9f);logger[_0x330c('0xd')](_0x330c('0x15'),_0x5d1e9f,JSON[_0x330c('0xf')](_0x481863));_0x4a2e33(_0x481863);})[_0x330c('0x14')](function(_0x56800a){logger[_0x330c('0x10')](_0x330c('0x15'),_0x56800a[_0x330c('0x12')],_0x5d1e9f);_0x3cb158(_0x3687fa[_0x330c('0x10')](0x1f4,_0x56800a['message']));});});};exports['UpdateVoiceDialReport']=function(_0x4d5f53){var _0x599ea4=this;return new Promise(function(_0x72aa2e,_0x353951){return db[_0x330c('0x16')]['update'](_0x4d5f53[_0x330c('0x1a')],{'raw':_0x4d5f53[_0x330c('0x18')]?_0x4d5f53[_0x330c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d5f53[_0x330c('0x18')]?_0x4d5f53[_0x330c('0x18')]['where']||null:null,'attributes':_0x4d5f53['options']?_0x4d5f53[_0x330c('0x18')][_0x330c('0x1b')]||null:null,'limit':_0x4d5f53[_0x330c('0x18')]?_0x4d5f53[_0x330c('0x18')][_0x330c('0x1c')]||null:null})[_0x330c('0x9')](function(_0x3e408e){logger[_0x330c('0xa')](_0x330c('0x1d'),_0x4d5f53);logger[_0x330c('0xd')](_0x330c('0x1d'),_0x4d5f53,JSON['stringify'](_0x3e408e));_0x72aa2e(_0x3e408e);})[_0x330c('0x14')](function(_0x830a13){logger[_0x330c('0x10')](_0x330c('0x1d'),_0x830a13['message'],_0x4d5f53);_0x353951(_0x599ea4[_0x330c('0x10')](0x1f4,_0x830a13[_0x330c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index abeb9c8..39e2ab2 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 _0x6c57=['show','post','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id'];(function(_0xb7ed68,_0x2195dd){var _0x1e9f79=function(_0x4ff8c0){while(--_0x4ff8c0){_0xb7ed68['push'](_0xb7ed68['shift']());}};_0x1e9f79(++_0x2195dd);}(_0x6c57,0xe5));var _0x76c5=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0x6c57[_0x5466ab];return _0x40751a;};'use strict';var multer=require(_0x76c5('0x0'));var util=require(_0x76c5('0x1'));var path=require(_0x76c5('0x2'));var timeout=require('connect-timeout');var express=require(_0x76c5('0x3'));var router=express['Router']();var fs_extra=require(_0x76c5('0x4'));var auth=require(_0x76c5('0x5'));var interaction=require(_0x76c5('0x6'));var config=require(_0x76c5('0x7'));var controller=require(_0x76c5('0x8'));router[_0x76c5('0x9')]('/',auth[_0x76c5('0xa')](),controller[_0x76c5('0xb')]);router[_0x76c5('0x9')](_0x76c5('0xc'),auth[_0x76c5('0xa')](),controller[_0x76c5('0xd')]);router['post']('/',auth[_0x76c5('0xa')](),controller['create']);router[_0x76c5('0xe')](_0x76c5('0xf'),auth[_0x76c5('0xa')](),controller[_0x76c5('0x10')]);router[_0x76c5('0x11')](_0x76c5('0xc'),auth[_0x76c5('0xa')](),controller[_0x76c5('0x12')]);router[_0x76c5('0x13')](_0x76c5('0xc'),auth['isAuthenticated'](),controller[_0x76c5('0x14')]);module[_0x76c5('0x15')]=router; \ No newline at end of file +var _0x720d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','create','post','/:id/applications','addApplications','delete','destroy','path','connect-timeout','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x720d,0x1be));var _0xd720=function(_0x4f356a,_0x4053af){_0x4f356a=_0x4f356a-0x0;var _0x4f8bfd=_0x720d[_0x4f356a];return _0x4f8bfd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd720('0x0'));var timeout=require(_0xd720('0x1'));var express=require('express');var router=express[_0xd720('0x2')]();var fs_extra=require(_0xd720('0x3'));var auth=require(_0xd720('0x4'));var interaction=require(_0xd720('0x5'));var config=require(_0xd720('0x6'));var controller=require(_0xd720('0x7'));router[_0xd720('0x8')]('/',auth['isAuthenticated'](),controller[_0xd720('0x9')]);router[_0xd720('0x8')](_0xd720('0xa'),auth[_0xd720('0xb')](),controller['show']);router['post']('/',auth[_0xd720('0xb')](),controller[_0xd720('0xc')]);router[_0xd720('0xd')](_0xd720('0xe'),auth[_0xd720('0xb')](),controller[_0xd720('0xf')]);router['put']('/:id',auth[_0xd720('0xb')](),controller['update']);router[_0xd720('0x10')]('/:id',auth[_0xd720('0xb')](),controller[_0xd720('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index cf1738a..1c0ebaa 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 _0x3a5e=['system','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax'];(function(_0x154f21,_0x3c7f37){var _0x5ae16f=function(_0x214498){while(--_0x214498){_0x154f21['push'](_0x154f21['shift']());}};_0x5ae16f(++_0x3c7f37);}(_0x3a5e,0x17e));var _0xe3a5=function(_0x4fe95a,_0x2d8ade){_0x4fe95a=_0x4fe95a-0x0;var _0x52e515=_0x3a5e[_0x4fe95a];return _0x52e515;};'use strict';var Sequelize=require(_0xe3a5('0x0'));module['exports']={'context':{'type':Sequelize[_0xe3a5('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe3a5('0x1')],'allowNull':![],'unique':_0xe3a5('0x2')},'priority':{'type':Sequelize[_0xe3a5('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe3a5('0x1')],'allowNull':![],'defaultValue':_0xe3a5('0x3')},'appdata':{'type':Sequelize[_0xe3a5('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe3a5('0x4')]('inbound',_0xe3a5('0x5'),_0xe3a5('0x6'),_0xe3a5('0x7'),_0xe3a5('0x8'),_0xe3a5('0x9'),_0xe3a5('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xe3a5('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe3a5('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe3a5('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xe3a5('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xe3a5('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe3a5('0xd')]},'recordingFormat':{'type':Sequelize[_0xe3a5('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xe3a5('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe3a5('0xe')],'get':function(_0x2722a1){return this[_0xe3a5('0xf')](_0xe3a5('0x10'));}},'alias':{'type':Sequelize[_0xe3a5('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xf45e=['wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','outbound-fax','system','any','BOOLEAN'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0xf45e,0xe4));var _0xef45=function(_0x235bbd,_0xc8be07){_0x235bbd=_0x235bbd-0x0;var _0x346963=_0xf45e[_0x235bbd];return _0x346963;};'use strict';var Sequelize=require(_0xef45('0x0'));module[_0xef45('0x1')]={'context':{'type':Sequelize[_0xef45('0x2')],'allowNull':![],'unique':_0xef45('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xef45('0x3')},'priority':{'type':Sequelize[_0xef45('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xef45('0x3')},'tag':{'type':Sequelize[_0xef45('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xef45('0x2')],'allowNull':![],'defaultValue':_0xef45('0x4')},'appdata':{'type':Sequelize[_0xef45('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xef45('0x5'),_0xef45('0x6'),_0xef45('0x7'),'inbound-fax',_0xef45('0x8'),_0xef45('0x9'),_0xef45('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xef45('0x2')]},'interval':{'type':Sequelize[_0xef45('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xef45('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xef45('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xef45('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xef45('0x2')],'defaultValue':_0xef45('0xc')},'answer':{'type':Sequelize[_0xef45('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xef45('0xd')],'get':function(_0x405238){return this[_0xef45('0xe')](_0xef45('0xf'));}},'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 bd26a65..e728319 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 _0x010c=['findAll','rows','catch','show','params','includeAll','find','create','body','startsWith','exten','concat','user','role','internal','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','mandatoryDisposition','addApplications','sequelize','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','undefined','limit','offset','count','set','json','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','ignore','value','type','UserProfileResource','destroy','error','stack','name','send','map','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include'];(function(_0x2e9b5b,_0x3e1332){var _0x734c46=function(_0x260a7b){while(--_0x260a7b){_0x2e9b5b['push'](_0x2e9b5b['shift']());}};_0x734c46(++_0x3e1332);}(_0x010c,0x12f));var _0xc010=function(_0x3962df,_0x533854){_0x3962df=_0x3962df-0x0;var _0x5ae774=_0x010c[_0x3962df];return _0x5ae774;};'use strict';var _=require('lodash');var Redis=require(_0xc010('0x0'));var qs=require(_0xc010('0x1'));var logger=require(_0xc010('0x2'))(_0xc010('0x3'));var config=require(_0xc010('0x4'));var db=require('../../mysqldb')['db'];config[_0xc010('0x5')]=_[_0xc010('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc010('0x7'))(new Redis(config[_0xc010('0x5')]));require(_0xc010('0x8'))['register'](socket);function respondWithStatusCode(_0x402a4d,_0x5311fa){_0x5311fa=_0x5311fa||0xcc;return function(_0x495549){if(_0x495549){return _0x402a4d[_0xc010('0x9')](_0x5311fa);}return _0x402a4d[_0xc010('0xa')](_0x5311fa)[_0xc010('0xb')]();};}function respondWithResult(_0x5c2ee1,_0x693b8e){_0x693b8e=_0x693b8e||0xc8;return function(_0x441cb0){if(_0x441cb0){return _0x5c2ee1[_0xc010('0xa')](_0x693b8e)['json'](_0x441cb0);}};}function respondWithFilteredResult(_0x208573,_0x3476c8){return function(_0x29c364){if(_0x29c364){var _0x684da6=typeof _0x3476c8['offset']===_0xc010('0xc')&&typeof _0x3476c8[_0xc010('0xd')]==='undefined';var _0xb379b5=_0x29c364['count'];var _0x17b527=_0x684da6?0x0:_0x3476c8[_0xc010('0xe')];var _0x572fc7=_0x684da6?_0x29c364[_0xc010('0xf')]:_0x3476c8[_0xc010('0xe')]+_0x3476c8[_0xc010('0xd')];var _0x1ec033;if(_0x572fc7>=_0xb379b5){_0x572fc7=_0xb379b5;_0x1ec033=0xc8;}else{_0x1ec033=0xce;}_0x208573[_0xc010('0xa')](_0x1ec033);return _0x208573[_0xc010('0x10')]('Content-Range',_0x17b527+'-'+_0x572fc7+'/'+_0xb379b5)[_0xc010('0x11')](_0x29c364);}return null;};}function removeEntity(_0x4cefe9){return function(_0x49b789){if(_0x49b789){return _0x49b789['destroy']()[_0xc010('0x12')](function(){var _0x5bf026=_0x49b789[_0xc010('0x13')]({'plain':!![]});var _0x33083b=[{'name':_0xc010('0x14'),'value':_0xc010('0x15'),'ignore':![]},{'name':_0xc010('0x16'),'value':_0xc010('0x17'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x1aa041=_(_0x33083b)['filter'](_0xc010('0x18'))['map'](_0xc010('0x19'))[_0xc010('0x19')]();if(_['includes'](_0x1aa041,_0x5bf026['type'])){return;}var _0xaec53b=_['find'](_0x33083b,[_0xc010('0x19'),_0x5bf026[_0xc010('0x1a')]])['name'];return db[_0xc010('0x1b')][_0xc010('0x1c')]({'where':{'type':_0xaec53b,'resourceId':_0x5bf026['id']}})['then'](function(){return _0x49b789;});})[_0xc010('0x12')](function(){_0x4cefe9[_0xc010('0xa')](0xcc)[_0xc010('0xb')]();});}};}function handleEntityNotFound(_0x495c13){return function(_0x1c5078){if(!_0x1c5078){_0x495c13[_0xc010('0x9')](0x194);}return _0x1c5078;};}function handleError(_0x400e23,_0x157efc){_0x157efc=_0x157efc||0x1f4;return function(_0x50553f){logger[_0xc010('0x1d')](_0x50553f[_0xc010('0x1e')]);if(_0x50553f[_0xc010('0x1f')]){delete _0x50553f[_0xc010('0x1f')];}_0x400e23[_0xc010('0xa')](_0x157efc)[_0xc010('0x20')](_0x50553f);};}exports['index']=function(_0x1b4569,_0x29e6a5){var _0x25b905={},_0x411b31={},_0xa72549={'count':0x0,'rows':[]};var _0x484829=_[_0xc010('0x21')](db[_0xc010('0x22')][_0xc010('0x23')],function(_0x56661e){return{'name':_0x56661e[_0xc010('0x24')],'type':_0x56661e[_0xc010('0x1a')][_0xc010('0x25')]};});_0x411b31[_0xc010('0x26')]=_['map'](_0x484829,'name');_0x411b31['query']=_[_0xc010('0x27')](_0x1b4569[_0xc010('0x28')]);_0x411b31[_0xc010('0x29')]=_[_0xc010('0x2a')](_0x411b31[_0xc010('0x26')],_0x411b31[_0xc010('0x28')]);_0x25b905[_0xc010('0x2b')]=_[_0xc010('0x2a')](_0x411b31[_0xc010('0x26')],qs[_0xc010('0x2c')](_0x1b4569[_0xc010('0x28')][_0xc010('0x2c')]));_0x25b905[_0xc010('0x2b')]=_0x25b905[_0xc010('0x2b')][_0xc010('0x2d')]?_0x25b905[_0xc010('0x2b')]:_0x411b31[_0xc010('0x26')];if(!_0x1b4569[_0xc010('0x28')][_0xc010('0x2e')](_0xc010('0x2f'))){_0x25b905['limit']=qs[_0xc010('0xd')](_0x1b4569[_0xc010('0x28')][_0xc010('0xd')]);_0x25b905[_0xc010('0xe')]=qs[_0xc010('0xe')](_0x1b4569[_0xc010('0x28')][_0xc010('0xe')]);}_0x25b905[_0xc010('0x30')]=qs['sort'](_0x1b4569[_0xc010('0x28')][_0xc010('0x31')]);_0x25b905[_0xc010('0x32')]=qs['filters'](_[_0xc010('0x33')](_0x1b4569[_0xc010('0x28')],_0x411b31[_0xc010('0x29')]),_0x484829);if(_0x1b4569['query'][_0xc010('0x34')]){_0x25b905[_0xc010('0x32')]=_[_0xc010('0x35')](_0x25b905['where'],{'$or':_[_0xc010('0x21')](_0x484829,function(_0x47db3c){if(_0x47db3c['type']!==_0xc010('0x36')){var _0x5034d6={};_0x5034d6[_0x47db3c[_0xc010('0x1f')]]={'$like':'%'+_0x1b4569['query']['filter']+'%'};return _0x5034d6;}})});}_0x25b905=_[_0xc010('0x35')]({},_0x25b905,_0x1b4569[_0xc010('0x37')]);var _0x33bb01={'where':_0x25b905[_0xc010('0x32')]};return db[_0xc010('0x22')][_0xc010('0xf')](_0x33bb01)[_0xc010('0x12')](function(_0x4253f2){_0xa72549[_0xc010('0xf')]=_0x4253f2;if(_0x1b4569[_0xc010('0x28')]['includeAll']){_0x25b905[_0xc010('0x38')]=[{'all':!![]}];}return db[_0xc010('0x22')][_0xc010('0x39')](_0x25b905);})[_0xc010('0x12')](function(_0x7d5b4d){_0xa72549[_0xc010('0x3a')]=_0x7d5b4d;return _0xa72549;})['then'](respondWithFilteredResult(_0x29e6a5,_0x25b905))[_0xc010('0x3b')](handleError(_0x29e6a5,null));};exports[_0xc010('0x3c')]=function(_0x1f4925,_0x25c623){var _0x5a34c5={'raw':![],'where':{'id':_0x1f4925[_0xc010('0x3d')]['id']}},_0x3195ba={};_0x3195ba[_0xc010('0x26')]=_[_0xc010('0x27')](db[_0xc010('0x22')][_0xc010('0x23')]);_0x3195ba[_0xc010('0x28')]=_[_0xc010('0x27')](_0x1f4925[_0xc010('0x28')]);_0x3195ba[_0xc010('0x29')]=_['intersection'](_0x3195ba[_0xc010('0x26')],_0x3195ba[_0xc010('0x28')]);_0x5a34c5[_0xc010('0x2b')]=_[_0xc010('0x2a')](_0x3195ba['model'],qs[_0xc010('0x2c')](_0x1f4925[_0xc010('0x28')][_0xc010('0x2c')]));_0x5a34c5[_0xc010('0x2b')]=_0x5a34c5[_0xc010('0x2b')][_0xc010('0x2d')]?_0x5a34c5['attributes']:_0x3195ba[_0xc010('0x26')];if(_0x1f4925[_0xc010('0x28')][_0xc010('0x3e')]){_0x5a34c5[_0xc010('0x38')]=[{'all':!![]}];}_0x5a34c5=_[_0xc010('0x35')]({},_0x5a34c5,_0x1f4925[_0xc010('0x37')]);return db[_0xc010('0x22')][_0xc010('0x3f')](_0x5a34c5)[_0xc010('0x12')](handleEntityNotFound(_0x25c623,null))[_0xc010('0x12')](respondWithResult(_0x25c623,null))[_0xc010('0x3b')](handleError(_0x25c623,null));};exports[_0xc010('0x1c')]=function(_0x5ebbf3,_0x1364c1){return db[_0xc010('0x22')][_0xc010('0x3f')]({'where':{'id':_0x5ebbf3['params']['id']}})[_0xc010('0x12')](handleEntityNotFound(_0x1364c1,null))[_0xc010('0x12')](removeEntity(_0x1364c1,null))[_0xc010('0x3b')](handleError(_0x1364c1,null));};exports[_0xc010('0x40')]=function(_0x4f03f4,_0xc1b9a0){if(_0x4f03f4[_0xc010('0x41')][_0xc010('0x1a')]==='outbound'&&!_[_0xc010('0x42')](_0x4f03f4[_0xc010('0x41')][_0xc010('0x43')],'_')){_0x4f03f4[_0xc010('0x41')][_0xc010('0x43')]='_'[_0xc010('0x44')](_0x4f03f4[_0xc010('0x41')][_0xc010('0x43')]);}return db[_0xc010('0x22')]['create'](_0x4f03f4[_0xc010('0x41')],{'raw':![]})[_0xc010('0x12')](function(_0x47e0ea){var _0x5b7137=_0x4f03f4[_0xc010('0x45')]['get']({'plain':!![]});if(!_0x5b7137)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b7137[_0xc010('0x46')]===_0xc010('0x45')){var _0x91ccd3=_0x47e0ea['get']({'plain':!![]});var _0x24f568=[{'name':_0xc010('0x14'),'value':_0xc010('0x15')},{'name':_0xc010('0x16'),'value':'outbound'},{'name':'InternalRoutes','value':_0xc010('0x47')}];var _0x51bf1b=_[_0xc010('0x3f')](_0x24f568,[_0xc010('0x19'),_0x91ccd3['type']])[_0xc010('0x1f')];return db['UserProfileSection']['find']({'where':{'name':_0x51bf1b,'userProfileId':_0x5b7137['userProfileId']},'raw':!![]})[_0xc010('0x12')](function(_0x332334){if(_0x332334&&_0x332334[_0xc010('0x48')]===0x0){return db[_0xc010('0x1b')][_0xc010('0x40')]({'name':_0x91ccd3['name'],'resourceId':_0x91ccd3['id'],'type':_0x332334[_0xc010('0x1f')],'sectionId':_0x332334['id']},{})[_0xc010('0x12')](function(){return _0x47e0ea;});}else{return _0x47e0ea;}})[_0xc010('0x3b')](function(_0x2fc5a8){logger[_0xc010('0x1d')](_0xc010('0x49'),_0x2fc5a8);throw _0x2fc5a8;});}return _0x47e0ea;})[_0xc010('0x12')](respondWithResult(_0xc1b9a0,0xc9))[_0xc010('0x3b')](handleError(_0xc1b9a0,null));};exports[_0xc010('0x4a')]=function(_0x261d66,_0x37cbe9){if(_0x261d66['body']['id']){delete _0x261d66[_0xc010('0x41')]['id'];}return db[_0xc010('0x22')][_0xc010('0x3f')]({'where':{'id':_0x261d66['params']['id']}})[_0xc010('0x12')](handleEntityNotFound(_0x37cbe9,null))['then'](function(_0x162e67){if(_0x162e67){return db['VoiceExtension']['update'](_[_0xc010('0x33')](_0x261d66[_0xc010('0x41')],[_0xc010('0x43'),_0xc010('0x4b'),_0xc010('0x4c'),'recordingFormat','cutdigits',_0xc010('0x4d'),'alias']),{'where':{'context':_0x162e67[_0xc010('0x4b')],'exten':_0x162e67['exten']},'individualHooks':!![]})[_0xc010('0x12')](function(_0x581cca){return _0x581cca;});}return null;})['then'](respondWithStatusCode(_0x37cbe9,null))[_0xc010('0x3b')](handleError(_0x37cbe9,null));};exports[_0xc010('0x4e')]=function(_0x175fdc,_0x53ee59){var _0x255da0=_0x175fdc[_0xc010('0x3d')]['id'];var _0x24a12a=_0x175fdc[_0xc010('0x41')];var _0x5268ee=0xc8;var _0x4a705c=null;return db[_0xc010('0x4f')]['transaction']({'isolationLevel':db[_0xc010('0x4f')][_0xc010('0x50')][_0xc010('0x51')]['READ_COMMITTED']},function(_0x1d6690){return db[_0xc010('0x22')][_0xc010('0x52')]({'where':{'id':_0x255da0},'transaction':_0x1d6690})['then'](function(_0x540094){if(_0x540094){return db[_0xc010('0x22')][_0xc010('0x1c')]({'where':{'VoiceExtensionId':_0x255da0},'transaction':_0x1d6690})['then'](function(){var _0x38e60d=_[_0xc010('0x21')](_0x24a12a,function(_0x4ba109){_0x4ba109[_0xc010('0x53')]=_0x255da0;_0x4ba109[_0xc010('0x54')]=!![];return _0x4ba109;});return _0x540094[_0xc010('0x55')](_0x38e60d);})['then'](function(_0x940c6e){return db[_0xc010('0x22')][_0xc010('0x56')](_0x940c6e,{'transaction':_0x1d6690});});}else{_0x5268ee=0x194;_0x4a705c=[];}});})[_0xc010('0x12')](function(){if(_0x5268ee!==0x194){return db[_0xc010('0x22')][_0xc010('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x255da0},'order':_0xc010('0x58')})[_0xc010('0x12')](function(_0x5bbf0b){_0x4a705c=_0x5bbf0b;});}})[_0xc010('0x3b')](function(_0xbb1925){_0x5268ee=0x1f4;logger[_0xc010('0x1d')](_0xbb1925[_0xc010('0x1e')]);if(_0xbb1925[_0xc010('0x1f')]){delete _0xbb1925['name'];}_0x4a705c=_0xbb1925;})[_0xc010('0x59')](function(){if(_0x4a705c===null){_0x53ee59['sendStatus'](_0x5268ee);}else{if(_0x5268ee===0x1f4){_0x53ee59[_0xc010('0xa')](_0x5268ee)[_0xc010('0x20')](_0x4a705c);}else{_0x53ee59[_0xc010('0xa')](_0x5268ee)[_0xc010('0x11')](_0x4a705c);}}});}; \ No newline at end of file +var _0x4490=['send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','VoiceExtension','includeAll','include','findAll','rows','catch','params','options','create','startsWith','exten','concat','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','createRouting','bulkCreate','finally','lodash','ioredis','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','inbound','value','includes','find','type','name','UserProfileResource','destroy','error','stack'];(function(_0x4953bc,_0xe3b2a2){var _0x782225=function(_0x40689a){while(--_0x40689a){_0x4953bc['push'](_0x4953bc['shift']());}};_0x782225(++_0xe3b2a2);}(_0x4490,0x1c1));var _0x0449=function(_0x412979,_0x997664){_0x412979=_0x412979-0x0;var _0x43bce0=_0x4490[_0x412979];return _0x43bce0;};'use strict';var _=require(_0x0449('0x0'));var Redis=require(_0x0449('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x0449('0x2'));var db=require(_0x0449('0x3'))['db'];config[_0x0449('0x4')]=_[_0x0449('0x5')](config[_0x0449('0x4')],{'host':_0x0449('0x6'),'port':0x18eb});var socket=require(_0x0449('0x7'))(new Redis(config[_0x0449('0x4')]));require(_0x0449('0x8'))[_0x0449('0x9')](socket);function respondWithStatusCode(_0x5dfae3,_0xcefae5){_0xcefae5=_0xcefae5||0xcc;return function(_0x59921b){if(_0x59921b){return _0x5dfae3[_0x0449('0xa')](_0xcefae5);}return _0x5dfae3[_0x0449('0xb')](_0xcefae5)[_0x0449('0xc')]();};}function respondWithResult(_0x8bdd1e,_0x3f9d00){_0x3f9d00=_0x3f9d00||0xc8;return function(_0x3502b6){if(_0x3502b6){return _0x8bdd1e[_0x0449('0xb')](_0x3f9d00)[_0x0449('0xd')](_0x3502b6);}};}function respondWithFilteredResult(_0x51f5d4,_0x3e2ce1){return function(_0x5e5261){if(_0x5e5261){var _0x16b4cc=typeof _0x3e2ce1[_0x0449('0xe')]===_0x0449('0xf')&&typeof _0x3e2ce1[_0x0449('0x10')]===_0x0449('0xf');var _0x12ba3d=_0x5e5261[_0x0449('0x11')];var _0x573246=_0x16b4cc?0x0:_0x3e2ce1[_0x0449('0xe')];var _0x42a5d8=_0x16b4cc?_0x5e5261[_0x0449('0x11')]:_0x3e2ce1[_0x0449('0xe')]+_0x3e2ce1[_0x0449('0x10')];var _0x4404b4;if(_0x42a5d8>=_0x12ba3d){_0x42a5d8=_0x12ba3d;_0x4404b4=0xc8;}else{_0x4404b4=0xce;}_0x51f5d4[_0x0449('0xb')](_0x4404b4);return _0x51f5d4[_0x0449('0x12')](_0x0449('0x13'),_0x573246+'-'+_0x42a5d8+'/'+_0x12ba3d)[_0x0449('0xd')](_0x5e5261);}return null;};}function removeEntity(_0x25156f){return function(_0x230ffd){if(_0x230ffd){return _0x230ffd['destroy']()[_0x0449('0x14')](function(){var _0x273b1f=_0x230ffd['get']({'plain':!![]});var _0xd12fd0=[{'name':'InboundRoutes','value':_0x0449('0x15'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x343b48=_(_0xd12fd0)['filter']('ignore')['map'](_0x0449('0x16'))[_0x0449('0x16')]();if(_[_0x0449('0x17')](_0x343b48,_0x273b1f['type'])){return;}var _0x3b78c8=_[_0x0449('0x18')](_0xd12fd0,[_0x0449('0x16'),_0x273b1f[_0x0449('0x19')]])[_0x0449('0x1a')];return db[_0x0449('0x1b')][_0x0449('0x1c')]({'where':{'type':_0x3b78c8,'resourceId':_0x273b1f['id']}})[_0x0449('0x14')](function(){return _0x230ffd;});})[_0x0449('0x14')](function(){_0x25156f[_0x0449('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35a650){return function(_0x385db9){if(!_0x385db9){_0x35a650[_0x0449('0xa')](0x194);}return _0x385db9;};}function handleError(_0x1b2389,_0x466888){_0x466888=_0x466888||0x1f4;return function(_0x37e46c){logger[_0x0449('0x1d')](_0x37e46c[_0x0449('0x1e')]);if(_0x37e46c[_0x0449('0x1a')]){delete _0x37e46c[_0x0449('0x1a')];}_0x1b2389[_0x0449('0xb')](_0x466888)[_0x0449('0x1f')](_0x37e46c);};}exports[_0x0449('0x20')]=function(_0x5196a9,_0x377dde){var _0x3275d4={},_0x448740={},_0x3a678a={'count':0x0,'rows':[]};var _0x4c2ebe=_[_0x0449('0x21')](db['VoiceExtension'][_0x0449('0x22')],function(_0x9d27b2){return{'name':_0x9d27b2[_0x0449('0x23')],'type':_0x9d27b2[_0x0449('0x19')][_0x0449('0x24')]};});_0x448740[_0x0449('0x25')]=_[_0x0449('0x21')](_0x4c2ebe,_0x0449('0x1a'));_0x448740[_0x0449('0x26')]=_[_0x0449('0x27')](_0x5196a9[_0x0449('0x26')]);_0x448740[_0x0449('0x28')]=_[_0x0449('0x29')](_0x448740[_0x0449('0x25')],_0x448740[_0x0449('0x26')]);_0x3275d4[_0x0449('0x2a')]=_[_0x0449('0x29')](_0x448740['model'],qs['fields'](_0x5196a9[_0x0449('0x26')][_0x0449('0x2b')]));_0x3275d4[_0x0449('0x2a')]=_0x3275d4['attributes'][_0x0449('0x2c')]?_0x3275d4['attributes']:_0x448740[_0x0449('0x25')];if(!_0x5196a9['query'][_0x0449('0x2d')](_0x0449('0x2e'))){_0x3275d4[_0x0449('0x10')]=qs[_0x0449('0x10')](_0x5196a9[_0x0449('0x26')][_0x0449('0x10')]);_0x3275d4[_0x0449('0xe')]=qs[_0x0449('0xe')](_0x5196a9['query']['offset']);}_0x3275d4['order']=qs[_0x0449('0x2f')](_0x5196a9['query'][_0x0449('0x2f')]);_0x3275d4[_0x0449('0x30')]=qs['filters'](_[_0x0449('0x31')](_0x5196a9[_0x0449('0x26')],_0x448740[_0x0449('0x28')]),_0x4c2ebe);if(_0x5196a9[_0x0449('0x26')]['filter']){_0x3275d4[_0x0449('0x30')]=_[_0x0449('0x32')](_0x3275d4[_0x0449('0x30')],{'$or':_[_0x0449('0x21')](_0x4c2ebe,function(_0x118313){if(_0x118313['type']!==_0x0449('0x33')){var _0x3b8e8f={};_0x3b8e8f[_0x118313['name']]={'$like':'%'+_0x5196a9['query'][_0x0449('0x34')]+'%'};return _0x3b8e8f;}})});}_0x3275d4=_['merge']({},_0x3275d4,_0x5196a9['options']);var _0x250acd={'where':_0x3275d4[_0x0449('0x30')]};return db[_0x0449('0x35')][_0x0449('0x11')](_0x250acd)[_0x0449('0x14')](function(_0x5bbab3){_0x3a678a['count']=_0x5bbab3;if(_0x5196a9[_0x0449('0x26')][_0x0449('0x36')]){_0x3275d4[_0x0449('0x37')]=[{'all':!![]}];}return db[_0x0449('0x35')][_0x0449('0x38')](_0x3275d4);})[_0x0449('0x14')](function(_0x5d262a){_0x3a678a[_0x0449('0x39')]=_0x5d262a;return _0x3a678a;})[_0x0449('0x14')](respondWithFilteredResult(_0x377dde,_0x3275d4))[_0x0449('0x3a')](handleError(_0x377dde,null));};exports['show']=function(_0x54694d,_0x947b85){var _0x12ce98={'raw':![],'where':{'id':_0x54694d[_0x0449('0x3b')]['id']}},_0x4a3034={};_0x4a3034[_0x0449('0x25')]=_[_0x0449('0x27')](db[_0x0449('0x35')][_0x0449('0x22')]);_0x4a3034['query']=_['keys'](_0x54694d[_0x0449('0x26')]);_0x4a3034[_0x0449('0x28')]=_[_0x0449('0x29')](_0x4a3034[_0x0449('0x25')],_0x4a3034[_0x0449('0x26')]);_0x12ce98[_0x0449('0x2a')]=_[_0x0449('0x29')](_0x4a3034[_0x0449('0x25')],qs[_0x0449('0x2b')](_0x54694d[_0x0449('0x26')][_0x0449('0x2b')]));_0x12ce98[_0x0449('0x2a')]=_0x12ce98[_0x0449('0x2a')]['length']?_0x12ce98[_0x0449('0x2a')]:_0x4a3034[_0x0449('0x25')];if(_0x54694d[_0x0449('0x26')]['includeAll']){_0x12ce98[_0x0449('0x37')]=[{'all':!![]}];}_0x12ce98=_[_0x0449('0x32')]({},_0x12ce98,_0x54694d[_0x0449('0x3c')]);return db[_0x0449('0x35')][_0x0449('0x18')](_0x12ce98)[_0x0449('0x14')](handleEntityNotFound(_0x947b85,null))[_0x0449('0x14')](respondWithResult(_0x947b85,null))['catch'](handleError(_0x947b85,null));};exports[_0x0449('0x1c')]=function(_0x148e99,_0x41cf4f){return db[_0x0449('0x35')]['find']({'where':{'id':_0x148e99[_0x0449('0x3b')]['id']}})[_0x0449('0x14')](handleEntityNotFound(_0x41cf4f,null))[_0x0449('0x14')](removeEntity(_0x41cf4f,null))[_0x0449('0x3a')](handleError(_0x41cf4f,null));};exports[_0x0449('0x3d')]=function(_0x3e14f2,_0x1a5c1d){if(_0x3e14f2['body'][_0x0449('0x19')]==='outbound'&&!_[_0x0449('0x3e')](_0x3e14f2['body'][_0x0449('0x3f')],'_')){_0x3e14f2['body'][_0x0449('0x3f')]='_'[_0x0449('0x40')](_0x3e14f2[_0x0449('0x41')][_0x0449('0x3f')]);}return db[_0x0449('0x35')][_0x0449('0x3d')](_0x3e14f2[_0x0449('0x41')],{'raw':![]})[_0x0449('0x14')](function(_0x548b76){var _0x1daccf=_0x3e14f2[_0x0449('0x42')][_0x0449('0x43')]({'plain':!![]});if(!_0x1daccf)throw new Error(_0x0449('0x44'));if(_0x1daccf[_0x0449('0x45')]===_0x0449('0x42')){var _0x40121b=_0x548b76[_0x0449('0x43')]({'plain':!![]});var _0x59f79a=[{'name':_0x0449('0x46'),'value':_0x0449('0x15')},{'name':_0x0449('0x47'),'value':_0x0449('0x48')},{'name':_0x0449('0x49'),'value':_0x0449('0x4a')}];var _0x47d975=_['find'](_0x59f79a,[_0x0449('0x16'),_0x40121b['type']])[_0x0449('0x1a')];return db[_0x0449('0x4b')]['find']({'where':{'name':_0x47d975,'userProfileId':_0x1daccf[_0x0449('0x4c')]},'raw':!![]})[_0x0449('0x14')](function(_0x5c83e9){if(_0x5c83e9&&_0x5c83e9[_0x0449('0x4d')]===0x0){return db[_0x0449('0x1b')][_0x0449('0x3d')]({'name':_0x40121b[_0x0449('0x1a')],'resourceId':_0x40121b['id'],'type':_0x5c83e9[_0x0449('0x1a')],'sectionId':_0x5c83e9['id']},{})[_0x0449('0x14')](function(){return _0x548b76;});}else{return _0x548b76;}})[_0x0449('0x3a')](function(_0x16b9e3){logger['error'](_0x0449('0x4e'),_0x16b9e3);throw _0x16b9e3;});}return _0x548b76;})[_0x0449('0x14')](respondWithResult(_0x1a5c1d,0xc9))[_0x0449('0x3a')](handleError(_0x1a5c1d,null));};exports['update']=function(_0x68c41c,_0x1ea62b){if(_0x68c41c[_0x0449('0x41')]['id']){delete _0x68c41c['body']['id'];}return db[_0x0449('0x35')]['find']({'where':{'id':_0x68c41c[_0x0449('0x3b')]['id']}})[_0x0449('0x14')](handleEntityNotFound(_0x1ea62b,null))[_0x0449('0x14')](function(_0x1014ed){if(_0x1014ed){return db[_0x0449('0x35')][_0x0449('0x4f')](_[_0x0449('0x31')](_0x68c41c[_0x0449('0x41')],[_0x0449('0x3f'),_0x0449('0x50'),_0x0449('0x51'),_0x0449('0x52'),_0x0449('0x53'),_0x0449('0x54'),_0x0449('0x55')]),{'where':{'context':_0x1014ed[_0x0449('0x50')],'exten':_0x1014ed[_0x0449('0x3f')]},'individualHooks':!![]})['then'](function(_0x267eb4){return _0x267eb4;});}return null;})[_0x0449('0x14')](respondWithStatusCode(_0x1ea62b,null))['catch'](handleError(_0x1ea62b,null));};exports[_0x0449('0x56')]=function(_0x4ceb4c,_0x5e9173){var _0x1bb762=_0x4ceb4c[_0x0449('0x3b')]['id'];var _0x345984=_0x4ceb4c[_0x0449('0x41')];var _0x26e743=0xc8;var _0x4a2013=null;return db[_0x0449('0x57')][_0x0449('0x58')]({'isolationLevel':db[_0x0449('0x57')][_0x0449('0x59')][_0x0449('0x5a')][_0x0449('0x5b')]},function(_0x158e75){return db[_0x0449('0x35')]['findOne']({'where':{'id':_0x1bb762},'transaction':_0x158e75})[_0x0449('0x14')](function(_0x2c00ce){if(_0x2c00ce){return db[_0x0449('0x35')][_0x0449('0x1c')]({'where':{'VoiceExtensionId':_0x1bb762},'transaction':_0x158e75})[_0x0449('0x14')](function(){var _0x6498f1=_[_0x0449('0x21')](_0x345984,function(_0x15505a){_0x15505a[_0x0449('0x5c')]=_0x1bb762;_0x15505a['isApp']=!![];return _0x15505a;});return _0x2c00ce[_0x0449('0x5d')](_0x6498f1);})[_0x0449('0x14')](function(_0x4d3ccc){return db[_0x0449('0x35')][_0x0449('0x5e')](_0x4d3ccc,{'transaction':_0x158e75});});}else{_0x26e743=0x194;_0x4a2013=[];}});})[_0x0449('0x14')](function(){if(_0x26e743!==0x194){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x1bb762},'order':'cast(priority\x20as\x20unsigned)'})[_0x0449('0x14')](function(_0x36ab8d){_0x4a2013=_0x36ab8d;});}})['catch'](function(_0x2186bd){_0x26e743=0x1f4;logger[_0x0449('0x1d')](_0x2186bd[_0x0449('0x1e')]);if(_0x2186bd[_0x0449('0x1a')]){delete _0x2186bd[_0x0449('0x1a')];}_0x4a2013=_0x2186bd;})[_0x0449('0x5f')](function(){if(_0x4a2013===null){_0x5e9173[_0x0449('0xa')](_0x26e743);}else{if(_0x26e743===0x1f4){_0x5e9173[_0x0449('0xb')](_0x26e743)['send'](_0x4a2013);}else{_0x5e9173[_0x0449('0xb')](_0x26e743)[_0x0449('0xd')](_0x4a2013);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 1558d86..9bd03f1 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 _0x14ab=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','save','update','remove'];(function(_0x3a62b0,_0x4ee605){var _0x374522=function(_0x1c18a5){while(--_0x1c18a5){_0x3a62b0['push'](_0x3a62b0['shift']());}};_0x374522(++_0x4ee605);}(_0x14ab,0x144));var _0xb14a=function(_0x155276,_0x430d9f){_0x155276=_0x155276-0x0;var _0x431285=_0x14ab[_0x155276];return _0x431285;};'use strict';var EventEmitter=require(_0xb14a('0x0'));var VoiceExtension=require(_0xb14a('0x1'))['db'][_0xb14a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb14a('0x3'),'afterUpdate':_0xb14a('0x4'),'afterDestroy':_0xb14a('0x5')};function emitEvent(_0xd31283){return function(_0x1315eb,_0x20dfbd,_0x322d0e){VoiceExtensionEvents[_0xb14a('0x6')](_0xd31283+':'+_0x1315eb['id'],_0x1315eb);VoiceExtensionEvents[_0xb14a('0x6')](_0xd31283,_0x1315eb);_0x322d0e(null);};}for(var e in events){if(events[_0xb14a('0x7')](e)){var event=events[e];VoiceExtension[_0xb14a('0x8')](e,emitEvent(event));}}module[_0xb14a('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x843f=['emit','hook','exports','setMaxListeners','update','remove'];(function(_0x4c4abb,_0x39bae7){var _0x29ce07=function(_0x215186){while(--_0x215186){_0x4c4abb['push'](_0x4c4abb['shift']());}};_0x29ce07(++_0x39bae7);}(_0x843f,0x1a7));var _0xf843=function(_0x38c888,_0xc4f9e1){_0x38c888=_0x38c888-0x0;var _0x4a4a7b=_0x843f[_0x38c888];return _0x4a4a7b;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf843('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf843('0x1'),'afterDestroy':_0xf843('0x2')};function emitEvent(_0x195b14){return function(_0x49c7f4,_0x302df4,_0x55c41f){VoiceExtensionEvents['emit'](_0x195b14+':'+_0x49c7f4['id'],_0x49c7f4);VoiceExtensionEvents[_0xf843('0x3')](_0x195b14,_0x49c7f4);_0x55c41f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xf843('0x4')](e,emitEvent(event));}}module[_0xf843('0x5')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 162adf2..6cdf8cc 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 _0x4c7b=['push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','length','param','split','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','playback','appType','custom','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','VoiceExtension','voice_extensions','Hangup','lodash','exports','models','type','Set','CDR(type)=','context','exten','CDR(routeAlias)=','alias','No\x20alias\x20set','inbound'];(function(_0x13519e,_0x5d4e71){var _0x20a50c=function(_0x40abb6){while(--_0x40abb6){_0x13519e['push'](_0x13519e['shift']());}};_0x20a50c(++_0x5d4e71);}(_0x4c7b,0x128));var _0xb4c7=function(_0x27d0e4,_0x45ef82){_0x27d0e4=_0x27d0e4-0x0;var _0x4039e3=_0x4c7b[_0x27d0e4];return _0x4039e3;};'use strict';var _=require(_0xb4c7('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xb4c7('0x1')]=function(_0x546014){var _0x10a056=_0x546014[_0xb4c7('0x2')];function _0x536f4d(_0x197e5e){var _0x47912f=0x2;var _0x319e4d=[{'type':_0x197e5e[_0xb4c7('0x3')],'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x5')+_0x197e5e[_0xb4c7('0x3')],'context':_0x197e5e[_0xb4c7('0x6')],'exten':_0x197e5e[_0xb4c7('0x7')],'priority':_0x47912f++,'VoiceExtensionId':_0x197e5e['id']},{'type':_0x197e5e['type'],'app':_0x197e5e['alias']?'Set':'NoOp','appdata':_0x197e5e['alias']?_0xb4c7('0x8')+_0x197e5e[_0xb4c7('0x9')]:_0xb4c7('0xa'),'context':_0x197e5e[_0xb4c7('0x6')],'exten':_0x197e5e[_0xb4c7('0x7')],'priority':_0x47912f++,'VoiceExtensionId':_0x197e5e['id']}];if(_0x197e5e[_0xb4c7('0x3')]===_0xb4c7('0xb')){_0x319e4d[_0xb4c7('0xc')]({'type':_0xb4c7('0xb'),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0xd')+_0x197e5e['id'],'context':_0x197e5e[_0xb4c7('0x6')],'exten':_0x197e5e['exten'],'priority':_0x47912f++,'VoiceExtensionId':_0x197e5e['id']});}_0x319e4d['push']({'type':_0x197e5e[_0xb4c7('0x3')],'app':_0xb4c7('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x197e5e[_0xb4c7('0x6')],'exten':_0x197e5e[_0xb4c7('0x7')],'priority':_0x47912f++,'VoiceExtensionId':_0x197e5e['id']},{'type':_0x197e5e[_0xb4c7('0x3')],'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0xe'),'context':_0x197e5e[_0xb4c7('0x6')],'exten':_0x197e5e[_0xb4c7('0x7')],'priority':_0x47912f++,'VoiceExtensionId':_0x197e5e['id']},{'type':_0x197e5e[_0xb4c7('0x3')],'app':_0xb4c7('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x197e5e[_0xb4c7('0x6')],'exten':_0x197e5e[_0xb4c7('0x7')],'priority':_0x47912f++,'VoiceExtensionId':_0x197e5e['id']});return _0x319e4d;}function _0x3fbb35(_0x409de7){var _0x5884bb=0x2;var _0x4dcd6b=[{'type':_0xb4c7('0xf'),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x10'),'context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':_0xb4c7('0xf'),'app':_0x409de7['alias']?'Set':'NoOp','appdata':_0x409de7[_0xb4c7('0x9')]?_0xb4c7('0x8')+_0x409de7[_0xb4c7('0x9')]:'No\x20alias\x20set','context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':_0xb4c7('0xf'),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x11')+(_0x409de7['cutdigits']?_0xb4c7('0x12')+_0x409de7['cutdigits']+'}':'${EXTEN}'),'context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':_0xb4c7('0xf'),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0xd')+_0x409de7['id'],'context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':_0xb4c7('0xf'),'app':'ExecIf','appdata':_0xb4c7('0x13')+(_0x5884bb+0x2)+_0xb4c7('0x14')+(_0x5884bb+0x1)+')','context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':_0xb4c7('0xf'),'app':'Set','appdata':_0x409de7[_0xb4c7('0x15')]?'CDR(prefix)=${EXTEN:0:'+_0x409de7[_0xb4c7('0x15')]+'}':_0xb4c7('0x16'),'context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7['exten'],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':'outbound','app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x17'),'context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':_0xb4c7('0xf'),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0xe'),'context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':_0xb4c7('0xf'),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x18'),'context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7['exten'],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':_0xb4c7('0xf'),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x19')+_0x409de7['id'],'context':_0x409de7['context'],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']}];if(_0x409de7['hasOwnProperty'](_0xb4c7('0x1a'))&&_0x409de7[_0xb4c7('0x1a')]!==_0xb4c7('0x1b')){_0x4dcd6b[_0xb4c7('0xc')]({'type':_0xb4c7('0xf'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']},{'type':'outbound','app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x1c')+_0x409de7['recordingFormat']||'wav','context':_0x409de7[_0xb4c7('0x6')],'exten':_0x409de7[_0xb4c7('0x7')],'priority':_0x5884bb++,'VoiceExtensionId':_0x409de7['id']});}return _0x4dcd6b;}function _0x4a7376(_0x19dae3,_0x46958e){var _0x5b4f55=[{'name':_0xb4c7('0x1d'),'param':0x0},{'name':_0xb4c7('0x1e'),'param':0x1},{'name':_0xb4c7('0x1f'),'param':0x2},{'name':_0xb4c7('0x20'),'param':0x3}];var _0x2056db={};var _0x35cfab=_0x46958e['split'](',');var _0x18a2b6=[];for(var _0x47b642=0x0;_0x47b642<_0x5b4f55[_0xb4c7('0x21')];_0x47b642++){switch(_0x5b4f55[_0x47b642]['name']){case _0xb4c7('0x1d'):_0x2056db[_0xb4c7('0x1d')]=_0x35cfab[_0x5b4f55[_0x47b642][_0xb4c7('0x22')]][_0xb4c7('0x23')]('/')[0x1];_0x2056db[_0xb4c7('0x24')]=_0x35cfab[_0x5b4f55[_0x47b642][_0xb4c7('0x22')]][_0xb4c7('0x23')]('/')[0x2];_0x2056db[_0xb4c7('0x25')]=_0x2056db[_0xb4c7('0x24')]?_0x2056db[_0xb4c7('0x24')][_0xb4c7('0x23')]('$')[0x0]:undefined;_0x2056db[_0xb4c7('0x24')]=_0x19dae3['cutdigits']?(_0x2056db[_0xb4c7('0x25')]||'')+_0xb4c7('0x12')+_0x19dae3[_0xb4c7('0x15')]+'}':(_0x2056db['prefix']||'')+'${EXTEN}';_0x18a2b6[_0x5b4f55[_0x47b642][_0xb4c7('0x22')]]=[_0xb4c7('0x26'),_0x2056db[_0xb4c7('0x1d')],_0x2056db['phone']]['join']('/');break;case _0xb4c7('0x1f'):_0x2056db['options']=_0x35cfab[_0x5b4f55[_0x47b642][_0xb4c7('0x22')]];if(_0x19dae3[_0xb4c7('0x1a')]!==_0xb4c7('0x1b')){if(_0x2056db[_0xb4c7('0x1f')][_0xb4c7('0x27')](_0xb4c7('0x28'))<0x0){_0x2056db[_0xb4c7('0x1f')]+='U(xcally-mixmonitor-context)';}}else{_0x2056db[_0xb4c7('0x1f')]=_0x2056db['options'][_0xb4c7('0x29')](_0xb4c7('0x28'),'');}_0x18a2b6[_0x5b4f55[_0x47b642][_0xb4c7('0x22')]]=_0x2056db['options'];break;default:_0x18a2b6[_0x5b4f55[_0x47b642]['param']]=_0x35cfab[_0x5b4f55[_0x47b642][_0xb4c7('0x22')]];}}return _0x18a2b6[_0xb4c7('0x2a')](',');}function _0x22ead3(_0x4d2a45,_0x19de9b,_0x2be547){return new Promise(function(_0x3d2c49,_0x37b413){var _0x2c8ce6=[];if(_[_0xb4c7('0x2b')](_0x19de9b))return _0x3d2c49(_0x2c8ce6);_0x10a056['Interval']['findAll']({'attributes':['id',_0xb4c7('0x2c'),_0xb4c7('0x2d')],'raw':!![]})[_0xb4c7('0x2e')](function(_0x23520d){for(var _0x86d0c8=0x0,_0x1bbb21=0x0;_0x86d0c8<_0x19de9b[_0xb4c7('0x21')];_0x86d0c8++,_0x1bbb21=0x0){var _0x2ead40=_0x19de9b[_0x86d0c8];var _0x49cd40=[];var _0xb1ee1c=[];delete _0x2ead40['id'];if(_0x2ead40[_0xb4c7('0x2c')]!==_0xb4c7('0x2f')){_0x2ead40['intervals']=[_0x2ead40[_0xb4c7('0x2c')]];}else{_0x2ead40[_0xb4c7('0x30')]=_0x2ead40[_0xb4c7('0x2d')]?_[_0xb4c7('0x31')](_[_0xb4c7('0x32')](_0x23520d,{'IntervalId':_0x2ead40[_0xb4c7('0x2d')]}),_0xb4c7('0x2c')):[];}_0x2ead40[_0xb4c7('0x6')]=_0x4d2a45[_0xb4c7('0x6')];_0x2ead40['exten']=_0x4d2a45['exten'];if(_0x2ead40[_0xb4c7('0x3')])_0x2ead40[_0xb4c7('0x3')]=_0x2ead40[_0xb4c7('0x3')][_0xb4c7('0x33')]();if(_0x4d2a45[_0xb4c7('0x3')]===_0xb4c7('0xf')){if(_0x2ead40[_0xb4c7('0x34')](_0xb4c7('0x35'))&&_0x2ead40['tag']&&_0x2ead40[_0xb4c7('0x35')]!=='--'){_0x49cd40[_0xb4c7('0xc')]({'type':_0x2ead40[_0xb4c7('0x3')]['toLowerCase'](),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x36')+_0x2ead40[_0xb4c7('0x35')],'context':_0x4d2a45[_0xb4c7('0x6')],'exten':_0x4d2a45['exten'],'priority':_0x2ead40[_0xb4c7('0x30')][_0xb4c7('0x21')]+_0x2be547+_0x1bbb21++,'VoiceExtensionId':_0x4d2a45['id']});}_0x49cd40[_0xb4c7('0xc')]({'type':_0x2ead40[_0xb4c7('0x3')][_0xb4c7('0x33')](),'app':'ExecIf','appdata':_0xb4c7('0x37')+(_0x2ead40['callerID']?'Set(CALLERID(all)='+_0x2ead40[_0xb4c7('0x38')]+')':_0xb4c7('0x39')),'context':_0x4d2a45['context'],'exten':_0x4d2a45[_0xb4c7('0x7')],'priority':_0x2ead40[_0xb4c7('0x30')][_0xb4c7('0x21')]+_0x2be547+_0x1bbb21++,'VoiceExtensionId':_0x4d2a45['id']});}else{if(_0x2ead40['hasOwnProperty'](_0xb4c7('0x3a'))){if(['queue',_0xb4c7('0x3b')]['includes'](_0x2ead40['app'][_0xb4c7('0x33')]())&&_0x2ead40[_0xb4c7('0x3c')]!==_0xb4c7('0x3d')){if(_0x2ead40[_0xb4c7('0x3a')]){_0x49cd40['push']({'type':_0x2ead40['type'][_0xb4c7('0x33')](),'app':_0xb4c7('0x3e'),'appdata':_0xb4c7('0x3f'),'context':_0x4d2a45[_0xb4c7('0x6')],'exten':_0x4d2a45['exten'],'priority':_0x2ead40[_0xb4c7('0x30')][_0xb4c7('0x21')]+_0x2be547+_0x1bbb21++,'VoiceExtensionId':_0x4d2a45['id']});_0x49cd40[_0xb4c7('0xc')]({'type':_0x2ead40['type'][_0xb4c7('0x33')](),'app':_0xb4c7('0x4'),'appdata':_0xb4c7('0x40'),'context':_0x4d2a45[_0xb4c7('0x6')],'exten':_0x4d2a45[_0xb4c7('0x7')],'priority':_0x2ead40[_0xb4c7('0x30')][_0xb4c7('0x21')]+_0x2be547+_0x1bbb21++,'VoiceExtensionId':_0x4d2a45['id']});}else{_0x49cd40['push']({'type':_0x2ead40[_0xb4c7('0x3')][_0xb4c7('0x33')](),'app':_0xb4c7('0x3e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4d2a45[_0xb4c7('0x6')],'exten':_0x4d2a45[_0xb4c7('0x7')],'priority':_0x2ead40['intervals']['length']+_0x2be547+_0x1bbb21++,'VoiceExtensionId':_0x4d2a45['id']});_0x49cd40[_0xb4c7('0xc')]({'type':_0x2ead40[_0xb4c7('0x3')][_0xb4c7('0x33')](),'app':'Set','appdata':_0xb4c7('0x41'),'context':_0x4d2a45['context'],'exten':_0x4d2a45[_0xb4c7('0x7')],'priority':_0x2ead40['intervals'][_0xb4c7('0x21')]+_0x2be547+_0x1bbb21++,'VoiceExtensionId':_0x4d2a45['id']});}}}}for(var _0x1279da=0x0;_0x1279da<_0x2ead40[_0xb4c7('0x30')][_0xb4c7('0x21')];_0x1279da++){var _0x1f27f6=_0x2be547+_0x2ead40['intervals'][_0xb4c7('0x21')];var _0x367f0a=_0x1279da===_0x2ead40[_0xb4c7('0x30')]['length']-0x1?_0x2be547+_0x49cd40[_0xb4c7('0x21')]+_0xb1ee1c['length']+0x2:_0x2be547+_0x1279da+0x1;_0x49cd40[_0xb4c7('0x42')](_0x1279da,0x0,{'type':_0x4d2a45['type'],'app':_0xb4c7('0x43'),'appdata':_0x2ead40[_0xb4c7('0x30')][_0x1279da]+'?'+_0x4d2a45[_0xb4c7('0x6')]+_0xb4c7('0x44')+_0x1f27f6+':'+_0x4d2a45[_0xb4c7('0x6')]+_0xb4c7('0x44')+_0x367f0a,'exten':_0x4d2a45[_0xb4c7('0x7')],'context':_0x4d2a45[_0xb4c7('0x6')],'priority':_0x2be547+_0x1279da,'VoiceExtensionId':_0x4d2a45['id']});}if(_0x2ead40[_0xb4c7('0x3c')]===_0xb4c7('0x45'))_0x2ead40[_0xb4c7('0x46')]=_0x4a7376(_0x4d2a45,_0x2ead40[_0xb4c7('0x46')]);_0x2ead40[_0xb4c7('0x47')]=_0x49cd40['length']?_[_0xb4c7('0x48')](_0x49cd40)[_0xb4c7('0x47')]+0x1:_0x2be547;_0x2c8ce6=_[_0xb4c7('0x49')](_0x2c8ce6,_0x49cd40,[_0x2ead40],_0xb1ee1c);_0x2be547=_[_0xb4c7('0x48')](_0x2c8ce6)[_0xb4c7('0x47')]+0x1;}return _0x3d2c49(_0x2c8ce6);})['catch'](function(_0x5f052b){_0x37b413(_0x5f052b);});});}return _0x546014['define'](_0xb4c7('0x4a'),attributes,{'tableName':_0xb4c7('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4bcfc3){var _0x59ed44=this['get']({'plain':!![]});var _0x17c503=_0x59ed44[_0xb4c7('0x3')]===_0xb4c7('0xf')?_0x3fbb35(_0x59ed44):_0x536f4d(_0x59ed44);return _0x22ead3(_0x59ed44,_0x4bcfc3,_[_0xb4c7('0x48')](_0x17c503)[_0xb4c7('0x47')]+0x1)[_0xb4c7('0x2e')](function(_0x342bfe){var _0x1a5f2f=_['concat'](_0x17c503,_0x342bfe);_0x1a5f2f['push']({'type':_0x59ed44[_0xb4c7('0x3')],'app':_0xb4c7('0x4c'),'exten':_0x59ed44['exten'],'context':_0x59ed44[_0xb4c7('0x6')],'priority':_['last'](_0x1a5f2f)['priority']+0x1,'VoiceExtensionId':_0x59ed44['id']});return _0x1a5f2f;});}}});}; \ No newline at end of file +var _0x91f8=['CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','url','split','length','name','phone','param','prefix','${EXTEN}','join','options','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','IntervalId','then','interval','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','concat','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','alias','CDR(routeAlias)=','exten','push','inbound'];(function(_0x49870c,_0x4d2e2b){var _0x2c98f5=function(_0x32d62b){while(--_0x32d62b){_0x49870c['push'](_0x49870c['shift']());}};_0x2c98f5(++_0x4d2e2b);}(_0x91f8,0x13f));var _0x891f=function(_0x573ea2,_0x1517e4){_0x573ea2=_0x573ea2-0x0;var _0x2dc6ab=_0x91f8[_0x573ea2];return _0x2dc6ab;};'use strict';var _=require(_0x891f('0x0'));var attributes=require(_0x891f('0x1'));module[_0x891f('0x2')]=function(_0x2b1966){var _0x3ce937=_0x2b1966[_0x891f('0x3')];function _0x40b516(_0x1cc86c){var _0x535a84=0x2;var _0x381674=[{'type':_0x1cc86c[_0x891f('0x4')],'app':_0x891f('0x5'),'appdata':_0x891f('0x6')+_0x1cc86c['type'],'context':_0x1cc86c[_0x891f('0x7')],'exten':_0x1cc86c['exten'],'priority':_0x535a84++,'VoiceExtensionId':_0x1cc86c['id']},{'type':_0x1cc86c[_0x891f('0x4')],'app':_0x1cc86c[_0x891f('0x8')]?_0x891f('0x5'):'NoOp','appdata':_0x1cc86c['alias']?_0x891f('0x9')+_0x1cc86c[_0x891f('0x8')]:'No\x20alias\x20set','context':_0x1cc86c[_0x891f('0x7')],'exten':_0x1cc86c[_0x891f('0xa')],'priority':_0x535a84++,'VoiceExtensionId':_0x1cc86c['id']}];if(_0x1cc86c[_0x891f('0x4')]==='inbound'){_0x381674[_0x891f('0xb')]({'type':_0x891f('0xc'),'app':'Set','appdata':_0x891f('0xd')+_0x1cc86c['id'],'context':_0x1cc86c['context'],'exten':_0x1cc86c[_0x891f('0xa')],'priority':_0x535a84++,'VoiceExtensionId':_0x1cc86c['id']});}_0x381674[_0x891f('0xb')]({'type':_0x1cc86c[_0x891f('0x4')],'app':_0x891f('0x5'),'appdata':_0x891f('0xe'),'context':_0x1cc86c[_0x891f('0x7')],'exten':_0x1cc86c[_0x891f('0xa')],'priority':_0x535a84++,'VoiceExtensionId':_0x1cc86c['id']},{'type':_0x1cc86c[_0x891f('0x4')],'app':_0x891f('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1cc86c[_0x891f('0x7')],'exten':_0x1cc86c[_0x891f('0xa')],'priority':_0x535a84++,'VoiceExtensionId':_0x1cc86c['id']},{'type':_0x1cc86c[_0x891f('0x4')],'app':_0x891f('0x5'),'appdata':_0x891f('0xf'),'context':_0x1cc86c[_0x891f('0x7')],'exten':_0x1cc86c[_0x891f('0xa')],'priority':_0x535a84++,'VoiceExtensionId':_0x1cc86c['id']});return _0x381674;}function _0xf4c091(_0x33d65d){var _0x123313=0x2;var _0x4cb3e1=[{'type':_0x891f('0x10'),'app':_0x891f('0x5'),'appdata':_0x891f('0x11'),'context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':'outbound','app':_0x33d65d[_0x891f('0x8')]?_0x891f('0x5'):_0x891f('0x12'),'appdata':_0x33d65d[_0x891f('0x8')]?_0x891f('0x9')+_0x33d65d[_0x891f('0x8')]:_0x891f('0x13'),'context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d['exten'],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':_0x891f('0x10'),'app':_0x891f('0x5'),'appdata':_0x891f('0x14')+(_0x33d65d[_0x891f('0x15')]?_0x891f('0x16')+_0x33d65d['cutdigits']+'}':'${EXTEN}'),'context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':'outbound','app':_0x891f('0x5'),'appdata':_0x891f('0xd')+_0x33d65d['id'],'context':_0x33d65d['context'],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':'outbound','app':_0x891f('0x17'),'appdata':_0x891f('0x18')+(_0x123313+0x2)+_0x891f('0x19')+(_0x123313+0x1)+')','context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':'outbound','app':_0x891f('0x5'),'appdata':_0x33d65d[_0x891f('0x15')]?_0x891f('0x1a')+_0x33d65d['cutdigits']+'}':_0x891f('0x1b'),'context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':_0x891f('0x10'),'app':_0x891f('0x5'),'appdata':_0x891f('0xe'),'context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d['exten'],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':_0x891f('0x10'),'app':_0x891f('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x33d65d['context'],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':_0x891f('0x10'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':'outbound','app':_0x891f('0x5'),'appdata':_0x891f('0x1c')+_0x33d65d['id'],'context':_0x33d65d['context'],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']}];if(_0x33d65d[_0x891f('0x1d')](_0x891f('0x1e'))&&_0x33d65d[_0x891f('0x1e')]!==_0x891f('0x1f')){_0x4cb3e1[_0x891f('0xb')]({'type':'outbound','app':_0x891f('0x5'),'appdata':_0x891f('0x20'),'context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']},{'type':'outbound','app':_0x891f('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x33d65d[_0x891f('0x1e')]||_0x891f('0x21'),'context':_0x33d65d[_0x891f('0x7')],'exten':_0x33d65d[_0x891f('0xa')],'priority':_0x123313++,'VoiceExtensionId':_0x33d65d['id']});}return _0x4cb3e1;}function _0x480951(_0x2f2bc2,_0x4cee51){var _0x426814=[{'name':_0x891f('0x22'),'param':0x0},{'name':_0x891f('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0x891f('0x24'),'param':0x3}];var _0x400444={};var _0x3df840=_0x4cee51[_0x891f('0x25')](',');var _0x5ca57e=[];for(var _0x72eb9e=0x0;_0x72eb9e<_0x426814[_0x891f('0x26')];_0x72eb9e++){switch(_0x426814[_0x72eb9e][_0x891f('0x27')]){case _0x891f('0x22'):_0x400444[_0x891f('0x22')]=_0x3df840[_0x426814[_0x72eb9e]['param']]['split']('/')[0x1];_0x400444[_0x891f('0x28')]=_0x3df840[_0x426814[_0x72eb9e][_0x891f('0x29')]][_0x891f('0x25')]('/')[0x2];_0x400444[_0x891f('0x2a')]=_0x400444[_0x891f('0x28')]?_0x400444[_0x891f('0x28')][_0x891f('0x25')]('$')[0x0]:undefined;_0x400444['phone']=_0x2f2bc2[_0x891f('0x15')]?(_0x400444[_0x891f('0x2a')]||'')+_0x891f('0x16')+_0x2f2bc2[_0x891f('0x15')]+'}':(_0x400444[_0x891f('0x2a')]||'')+_0x891f('0x2b');_0x5ca57e[_0x426814[_0x72eb9e][_0x891f('0x29')]]=['SIP',_0x400444[_0x891f('0x22')],_0x400444[_0x891f('0x28')]][_0x891f('0x2c')]('/');break;case _0x891f('0x2d'):_0x400444[_0x891f('0x2d')]=_0x3df840[_0x426814[_0x72eb9e][_0x891f('0x29')]];if(_0x2f2bc2['recordingFormat']!==_0x891f('0x1f')){if(_0x400444[_0x891f('0x2d')]['indexOf'](_0x891f('0x2e'))<0x0){_0x400444[_0x891f('0x2d')]+=_0x891f('0x2e');}}else{_0x400444[_0x891f('0x2d')]=_0x400444[_0x891f('0x2d')][_0x891f('0x2f')](_0x891f('0x2e'),'');}_0x5ca57e[_0x426814[_0x72eb9e][_0x891f('0x29')]]=_0x400444[_0x891f('0x2d')];break;default:_0x5ca57e[_0x426814[_0x72eb9e][_0x891f('0x29')]]=_0x3df840[_0x426814[_0x72eb9e]['param']];}}return _0x5ca57e[_0x891f('0x2c')](',');}function _0xcbef34(_0x245680,_0x5780f5,_0x70a119){return new Promise(function(_0x2d1ed4,_0xf56e2c){var _0x5194fb=[];if(_[_0x891f('0x30')](_0x5780f5))return _0x2d1ed4(_0x5194fb);_0x3ce937['Interval'][_0x891f('0x31')]({'attributes':['id','interval',_0x891f('0x32')],'raw':!![]})[_0x891f('0x33')](function(_0x594cfc){for(var _0x168145=0x0,_0x405b0a=0x0;_0x168145<_0x5780f5[_0x891f('0x26')];_0x168145++,_0x405b0a=0x0){var _0x1ee244=_0x5780f5[_0x168145];var _0x578b4b=[];var _0x12b2dc=[];delete _0x1ee244['id'];if(_0x1ee244[_0x891f('0x34')]!=='*,*,*,*'){_0x1ee244[_0x891f('0x35')]=[_0x1ee244['interval']];}else{_0x1ee244[_0x891f('0x35')]=_0x1ee244[_0x891f('0x32')]?_[_0x891f('0x36')](_[_0x891f('0x37')](_0x594cfc,{'IntervalId':_0x1ee244[_0x891f('0x32')]}),_0x891f('0x34')):[];}_0x1ee244[_0x891f('0x7')]=_0x245680[_0x891f('0x7')];_0x1ee244[_0x891f('0xa')]=_0x245680[_0x891f('0xa')];if(_0x1ee244['type'])_0x1ee244[_0x891f('0x4')]=_0x1ee244['type'][_0x891f('0x38')]();if(_0x245680[_0x891f('0x4')]==='outbound'){if(_0x1ee244[_0x891f('0x1d')](_0x891f('0x39'))&&_0x1ee244[_0x891f('0x39')]&&_0x1ee244[_0x891f('0x39')]!=='--'){_0x578b4b['push']({'type':_0x1ee244[_0x891f('0x4')][_0x891f('0x38')](),'app':_0x891f('0x5'),'appdata':'CDR(tag)='+_0x1ee244[_0x891f('0x39')],'context':_0x245680[_0x891f('0x7')],'exten':_0x245680[_0x891f('0xa')],'priority':_0x1ee244[_0x891f('0x35')][_0x891f('0x26')]+_0x70a119+_0x405b0a++,'VoiceExtensionId':_0x245680['id']});}_0x578b4b[_0x891f('0xb')]({'type':_0x1ee244[_0x891f('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0x891f('0x3a')+(_0x1ee244[_0x891f('0x3b')]?_0x891f('0x3c')+_0x1ee244[_0x891f('0x3b')]+')':_0x891f('0x3d')),'context':_0x245680[_0x891f('0x7')],'exten':_0x245680[_0x891f('0xa')],'priority':_0x1ee244[_0x891f('0x35')][_0x891f('0x26')]+_0x70a119+_0x405b0a++,'VoiceExtensionId':_0x245680['id']});}else{if(_0x1ee244[_0x891f('0x1d')](_0x891f('0x3e'))){if([_0x891f('0x3f'),_0x891f('0x40')]['includes'](_0x1ee244[_0x891f('0x41')][_0x891f('0x38')]())&&_0x1ee244[_0x891f('0x42')]!==_0x891f('0x43')){if(_0x1ee244[_0x891f('0x3e')]){_0x578b4b[_0x891f('0xb')]({'type':_0x1ee244[_0x891f('0x4')][_0x891f('0x38')](),'app':'ExecIf','appdata':_0x891f('0x44'),'context':_0x245680[_0x891f('0x7')],'exten':_0x245680[_0x891f('0xa')],'priority':_0x1ee244[_0x891f('0x35')][_0x891f('0x26')]+_0x70a119+_0x405b0a++,'VoiceExtensionId':_0x245680['id']});_0x578b4b[_0x891f('0xb')]({'type':_0x1ee244[_0x891f('0x4')]['toLowerCase'](),'app':_0x891f('0x5'),'appdata':_0x891f('0x45'),'context':_0x245680['context'],'exten':_0x245680[_0x891f('0xa')],'priority':_0x1ee244[_0x891f('0x35')][_0x891f('0x26')]+_0x70a119+_0x405b0a++,'VoiceExtensionId':_0x245680['id']});}else{_0x578b4b[_0x891f('0xb')]({'type':_0x1ee244[_0x891f('0x4')]['toLowerCase'](),'app':_0x891f('0x17'),'appdata':_0x891f('0x46'),'context':_0x245680[_0x891f('0x7')],'exten':_0x245680[_0x891f('0xa')],'priority':_0x1ee244[_0x891f('0x35')][_0x891f('0x26')]+_0x70a119+_0x405b0a++,'VoiceExtensionId':_0x245680['id']});_0x578b4b[_0x891f('0xb')]({'type':_0x1ee244[_0x891f('0x4')][_0x891f('0x38')](),'app':'Set','appdata':_0x891f('0x47'),'context':_0x245680['context'],'exten':_0x245680[_0x891f('0xa')],'priority':_0x1ee244[_0x891f('0x35')]['length']+_0x70a119+_0x405b0a++,'VoiceExtensionId':_0x245680['id']});}}}}for(var _0x5964ba=0x0;_0x5964ba<_0x1ee244[_0x891f('0x35')]['length'];_0x5964ba++){var _0x46d0ad=_0x70a119+_0x1ee244[_0x891f('0x35')][_0x891f('0x26')];var _0x5f2e7a=_0x5964ba===_0x1ee244[_0x891f('0x35')][_0x891f('0x26')]-0x1?_0x70a119+_0x578b4b[_0x891f('0x26')]+_0x12b2dc[_0x891f('0x26')]+0x2:_0x70a119+_0x5964ba+0x1;_0x578b4b[_0x891f('0x48')](_0x5964ba,0x0,{'type':_0x245680[_0x891f('0x4')],'app':_0x891f('0x49'),'appdata':_0x1ee244[_0x891f('0x35')][_0x5964ba]+'?'+_0x245680[_0x891f('0x7')]+',${EXTEN},'+_0x46d0ad+':'+_0x245680[_0x891f('0x7')]+',${EXTEN},'+_0x5f2e7a,'exten':_0x245680[_0x891f('0xa')],'context':_0x245680['context'],'priority':_0x70a119+_0x5964ba,'VoiceExtensionId':_0x245680['id']});}if(_0x1ee244['appType']==='outboundDial')_0x1ee244[_0x891f('0x4a')]=_0x480951(_0x245680,_0x1ee244[_0x891f('0x4a')]);_0x1ee244[_0x891f('0x4b')]=_0x578b4b[_0x891f('0x26')]?_[_0x891f('0x4c')](_0x578b4b)[_0x891f('0x4b')]+0x1:_0x70a119;_0x5194fb=_['concat'](_0x5194fb,_0x578b4b,[_0x1ee244],_0x12b2dc);_0x70a119=_[_0x891f('0x4c')](_0x5194fb)['priority']+0x1;}return _0x2d1ed4(_0x5194fb);})[_0x891f('0x4d')](function(_0x2ade8a){_0xf56e2c(_0x2ade8a);});});}return _0x2b1966[_0x891f('0x4e')](_0x891f('0x4f'),attributes,{'tableName':_0x891f('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x43dfae){var _0x54ecf5=this[_0x891f('0x51')]({'plain':!![]});var _0xeca93b=_0x54ecf5['type']===_0x891f('0x10')?_0xf4c091(_0x54ecf5):_0x40b516(_0x54ecf5);return _0xcbef34(_0x54ecf5,_0x43dfae,_['last'](_0xeca93b)[_0x891f('0x4b')]+0x1)[_0x891f('0x33')](function(_0x319882){var _0x5a5b84=_[_0x891f('0x52')](_0xeca93b,_0x319882);_0x5a5b84['push']({'type':_0x54ecf5[_0x891f('0x4')],'app':'Hangup','exten':_0x54ecf5[_0x891f('0xa')],'context':_0x54ecf5[_0x891f('0x7')],'priority':_['last'](_0x5a5b84)[_0x891f('0x4b')]+0x1,'VoiceExtensionId':_0x54ecf5['id']});return _0x5a5b84;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 9f87f1f..ac11185 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 _0xf360=['then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','catch','VoiceExtension','options','raw','attributes','include','model','map','GetVoiceExtension','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request'];(function(_0x340543,_0xbf721d){var _0x14feef=function(_0x53d038){while(--_0x53d038){_0x340543['push'](_0x340543['shift']());}};_0x14feef(++_0xbf721d);}(_0xf360,0x9e));var _0x0f36=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf360[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x0f36('0x0'));var util=require(_0x0f36('0x1'));var moment=require(_0x0f36('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f36('0x4'))['db'];var utils=require(_0x0f36('0x5'));var logger=require(_0x0f36('0x6'))('rpc');var config=require(_0x0f36('0x7'));var jayson=require(_0x0f36('0x8'));var client=jayson[_0x0f36('0x9')][_0x0f36('0xa')]({'port':0x232a});config[_0x0f36('0xb')]=_[_0x0f36('0xc')](config[_0x0f36('0xb')],{'host':_0x0f36('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f36('0xb')]));require(_0x0f36('0xe'))[_0x0f36('0xf')](socket);function respondWithRpcPromise(_0x4036b5,_0x146814,_0x4015fc){return new BPromise(function(_0x4963fb,_0x35d5ee){return client[_0x0f36('0x10')](_0x4036b5,_0x4015fc)[_0x0f36('0x11')](function(_0x5044af){logger[_0x0f36('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x146814,'request\x20sent');logger[_0x0f36('0x13')](_0x0f36('0x14'),_0x146814,'request\x20sent',JSON[_0x0f36('0x15')](_0x5044af));if(_0x5044af[_0x0f36('0x16')]){if(_0x5044af[_0x0f36('0x16')][_0x0f36('0x17')]===0x1f4){logger['error'](_0x0f36('0x18'),_0x146814,_0x5044af['error'][_0x0f36('0x19')]);return _0x35d5ee(_0x5044af[_0x0f36('0x16')][_0x0f36('0x19')]);}logger[_0x0f36('0x16')](_0x0f36('0x18'),_0x146814,_0x5044af[_0x0f36('0x16')][_0x0f36('0x19')]);return _0x4963fb(_0x5044af['error']['message']);}else{logger[_0x0f36('0x12')](_0x0f36('0x18'),_0x146814,'request\x20sent');_0x4963fb(_0x5044af['result'][_0x0f36('0x19')]);}})[_0x0f36('0x1a')](function(_0x523c43){logger[_0x0f36('0x16')](_0x0f36('0x18'),_0x146814,_0x523c43);_0x35d5ee(_0x523c43);});});}exports['GetVoiceExtension']=function(_0x3349c8){var _0x59b76f=this;return new Promise(function(_0x4ebd0b,_0x2f7972){return db[_0x0f36('0x1b')]['findAll']({'raw':_0x3349c8['options']?_0x3349c8[_0x0f36('0x1c')][_0x0f36('0x1d')]===undefined?!![]:![]:!![],'where':_0x3349c8['options']?_0x3349c8[_0x0f36('0x1c')]['where']||null:null,'attributes':_0x3349c8[_0x0f36('0x1c')]?_0x3349c8['options'][_0x0f36('0x1e')]||null:null,'limit':_0x3349c8[_0x0f36('0x1c')]?_0x3349c8[_0x0f36('0x1c')]['limit']||null:null,'include':_0x3349c8[_0x0f36('0x1c')]?_0x3349c8[_0x0f36('0x1c')][_0x0f36('0x1f')]?_['map'](_0x3349c8[_0x0f36('0x1c')][_0x0f36('0x1f')],function(_0x264639){return{'model':db[_0x264639[_0x0f36('0x20')]],'as':_0x264639['as'],'attributes':_0x264639['attributes'],'include':_0x264639[_0x0f36('0x1f')]?_['map'](_0x264639[_0x0f36('0x1f')],function(_0x481492){return{'model':db[_0x481492[_0x0f36('0x20')]],'as':_0x481492['as'],'attributes':_0x481492[_0x0f36('0x1e')],'include':_0x481492[_0x0f36('0x1f')]?_[_0x0f36('0x21')](_0x481492['include'],function(_0x398dcd){return{'model':db[_0x398dcd['model']],'as':_0x398dcd['as'],'attributes':_0x398dcd[_0x0f36('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0f36('0x11')](function(_0xc7772d){logger[_0x0f36('0x12')](_0x0f36('0x22'),_0x3349c8);logger['debug'](_0x0f36('0x22'),_0x3349c8,JSON[_0x0f36('0x15')](_0xc7772d));_0x4ebd0b(_0xc7772d);})[_0x0f36('0x1a')](function(_0x161e11){logger[_0x0f36('0x16')]('GetVoiceExtension',_0x161e11['message'],_0x3349c8);_0x2f7972(_0x59b76f[_0x0f36('0x16')](0x1f4,_0x161e11[_0x0f36('0x19')]));});});}; \ No newline at end of file +var _0xdced=['result','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','debug','GetVoiceExtension','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceExtension,\x20%s,\x20%s'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xdced,0xcb));var _0xddce=function(_0x25aea6,_0x34632d){_0x25aea6=_0x25aea6-0x0;var _0x2e314c=_0xdced[_0x25aea6];return _0x2e314c;};'use strict';var _=require('lodash');var util=require(_0xddce('0x0'));var moment=require(_0xddce('0x1'));var BPromise=require(_0xddce('0x2'));var rs=require(_0xddce('0x3'));var fs=require('fs');var Redis=require(_0xddce('0x4'));var db=require(_0xddce('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xddce('0x6'))('rpc');var config=require(_0xddce('0x7'));var jayson=require(_0xddce('0x8'));var client=jayson['client'][_0xddce('0x9')]({'port':0x232a});config['redis']=_[_0xddce('0xa')](config[_0xddce('0xb')],{'host':_0xddce('0xc'),'port':0x18eb});var socket=require(_0xddce('0xd'))(new Redis(config['redis']));require(_0xddce('0xe'))[_0xddce('0xf')](socket);function respondWithRpcPromise(_0x2186ba,_0x4fe75a,_0x49642c){return new BPromise(function(_0x3cb231,_0xe69047){return client['request'](_0x2186ba,_0x49642c)[_0xddce('0x10')](function(_0x362144){logger[_0xddce('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x4fe75a,_0xddce('0x12'));logger['debug'](_0xddce('0x13'),_0x4fe75a,_0xddce('0x12'),JSON[_0xddce('0x14')](_0x362144));if(_0x362144[_0xddce('0x15')]){if(_0x362144[_0xddce('0x15')][_0xddce('0x16')]===0x1f4){logger[_0xddce('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x4fe75a,_0x362144['error'][_0xddce('0x17')]);return _0xe69047(_0x362144[_0xddce('0x15')]['message']);}logger[_0xddce('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x4fe75a,_0x362144[_0xddce('0x15')]['message']);return _0x3cb231(_0x362144[_0xddce('0x15')][_0xddce('0x17')]);}else{logger['info'](_0xddce('0x18'),_0x4fe75a,_0xddce('0x12'));_0x3cb231(_0x362144[_0xddce('0x19')][_0xddce('0x17')]);}})['catch'](function(_0x3b44ad){logger[_0xddce('0x15')](_0xddce('0x18'),_0x4fe75a,_0x3b44ad);_0xe69047(_0x3b44ad);});});}exports['GetVoiceExtension']=function(_0x452c15){var _0x4d5465=this;return new Promise(function(_0x14ab09,_0x5cb4ba){return db[_0xddce('0x1a')][_0xddce('0x1b')]({'raw':_0x452c15[_0xddce('0x1c')]?_0x452c15['options'][_0xddce('0x1d')]===undefined?!![]:![]:!![],'where':_0x452c15[_0xddce('0x1c')]?_0x452c15[_0xddce('0x1c')][_0xddce('0x1e')]||null:null,'attributes':_0x452c15[_0xddce('0x1c')]?_0x452c15[_0xddce('0x1c')][_0xddce('0x1f')]||null:null,'limit':_0x452c15[_0xddce('0x1c')]?_0x452c15['options'][_0xddce('0x20')]||null:null,'include':_0x452c15[_0xddce('0x1c')]?_0x452c15[_0xddce('0x1c')][_0xddce('0x21')]?_['map'](_0x452c15[_0xddce('0x1c')][_0xddce('0x21')],function(_0x5036fa){return{'model':db[_0x5036fa[_0xddce('0x22')]],'as':_0x5036fa['as'],'attributes':_0x5036fa[_0xddce('0x1f')],'include':_0x5036fa[_0xddce('0x21')]?_[_0xddce('0x23')](_0x5036fa[_0xddce('0x21')],function(_0x3a7d40){return{'model':db[_0x3a7d40[_0xddce('0x22')]],'as':_0x3a7d40['as'],'attributes':_0x3a7d40['attributes'],'include':_0x3a7d40['include']?_['map'](_0x3a7d40[_0xddce('0x21')],function(_0x2cac62){return{'model':db[_0x2cac62[_0xddce('0x22')]],'as':_0x2cac62['as'],'attributes':_0x2cac62[_0xddce('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xddce('0x10')](function(_0x1c6c18){logger[_0xddce('0x11')]('GetVoiceExtension',_0x452c15);logger[_0xddce('0x24')](_0xddce('0x25'),_0x452c15,JSON[_0xddce('0x14')](_0x1c6c18));_0x14ab09(_0x1c6c18);})['catch'](function(_0x5bee5a){logger[_0xddce('0x15')](_0xddce('0x25'),_0x5bee5a[_0xddce('0x17')],_0x452c15);_0x5cb4ba(_0x4d5465['error'](0x1f4,_0x5bee5a[_0xddce('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b72b2b0..b2839b3 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x814b,0x1a2));var _0xb814=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x814b[_0x74892f];return _0x10ee61;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x36c5be,_0x4f494d){var _0x182175=function(_0x2f3b23){while(--_0x2f3b23){_0x36c5be['push'](_0x36c5be['shift']());}};_0x182175(++_0x4f494d);}(_0x326f,0xd1));var _0xf326=function(_0x5badad,_0x2dd8a2){_0x5badad=_0x5badad-0x0;var _0x2cb734=_0x326f[_0x5badad];return _0x2cb734;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 7fd1082..9852fe0 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 _0x187d=['/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show'];(function(_0x18172e,_0x512f30){var _0x48e63f=function(_0x4edd4d){while(--_0x4edd4d){_0x18172e['push'](_0x18172e['shift']());}};_0x48e63f(++_0x512f30);}(_0x187d,0x93));var _0xd187=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x187d[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xc'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router; \ No newline at end of file +var _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','/:id/messages','create','update','destroy','exports','util'];(function(_0x33f17f,_0xc708d4){var _0x4f27b2=function(_0x41bee8){while(--_0x41bee8){_0x33f17f['push'](_0x33f17f['shift']());}};_0x4f27b2(++_0xc708d4);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6d38[_0x4154a6];return _0x3b2786;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['getMessages']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xa'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a85726e..f3d9d1b 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 _0x8390=['contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','STRING','from-voicemail'];(function(_0x26c68f,_0x2a9107){var _0x516c08=function(_0x437ea0){while(--_0x437ea0){_0x26c68f['push'](_0x26c68f['shift']());}};_0x516c08(++_0x2a9107);}(_0x8390,0x67));var _0x0839=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x8390[_0x441563];return _0x2369ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x0839('0x0')]},'context':{'type':Sequelize[_0x0839('0x0')],'defaultValue':_0x0839('0x1'),'unique':_0x0839('0x2')},'mailbox':{'type':Sequelize[_0x0839('0x0')],'defaultValue':'','allowNull':![],'unique':_0x0839('0x2')},'password':{'type':Sequelize[_0x0839('0x0')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0839('0x0')],'validate':{'isEmail':!![]},'set':function(_0x352eb5){this[_0x0839('0x3')](_0x0839('0x4'),typeof _0x352eb5===_0x0839('0x5')&&_0x352eb5[_0x0839('0x6')]()?_0x352eb5['trim']():null);}},'pager':{'type':Sequelize[_0x0839('0x0')]},'tz':{'type':Sequelize[_0x0839('0x0')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x0839('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x0839('0x7')](_0x0839('0x8'),'no'),'defaultValue':_0x0839('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x0839('0x0')]},'review':{'type':Sequelize[_0x0839('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0839('0x7')](_0x0839('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0839('0x7')](_0x0839('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0839('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0839('0x7')](_0x0839('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0839('0x7')](_0x0839('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0839('0x7')](_0x0839('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x0839('0x7')](_0x0839('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0839('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x0839('0x8'),'no'),'defaultValue':_0x0839('0x8'),'allowNull':![]},'stamp':{'type':_0x0839('0x9')},'emailsubject':{'type':Sequelize[_0x0839('0x0')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0839('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0839('0xb')],'get':function(){return this[_0x0839('0xc')](_0x0839('0xd'))+'\x20-\x20'+this[_0x0839('0xc')](_0x0839('0xe'));}}}; \ No newline at end of file +var _0x27b2=['from-voicemail','contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','getDataValue','fullname','mailbox','exports','STRING'];(function(_0x5d9343,_0x4fe96c){var _0x51c08e=function(_0x54e235){while(--_0x54e235){_0x5d9343['push'](_0x5d9343['shift']());}};_0x51c08e(++_0x4fe96c);}(_0x27b2,0x98));var _0x227b=function(_0x330fde,_0x29f3cb){_0x330fde=_0x330fde-0x0;var _0x349caa=_0x27b2[_0x330fde];return _0x349caa;};'use strict';var Sequelize=require('sequelize');module[_0x227b('0x0')]={'customer_id':{'type':Sequelize[_0x227b('0x1')]},'context':{'type':Sequelize[_0x227b('0x1')],'defaultValue':_0x227b('0x2'),'unique':_0x227b('0x3')},'mailbox':{'type':Sequelize[_0x227b('0x1')],'defaultValue':'','allowNull':![],'unique':_0x227b('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x227b('0x1')]},'email':{'type':Sequelize[_0x227b('0x1')],'validate':{'isEmail':!![]},'set':function(_0x526974){this['setDataValue']('email',typeof _0x526974===_0x227b('0x4')&&_0x526974[_0x227b('0x5')]()?_0x526974[_0x227b('0x5')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x227b('0x1')],'defaultValue':_0x227b('0x6')},'attach':{'type':Sequelize[_0x227b('0x7')](_0x227b('0x8'),'no'),'defaultValue':_0x227b('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x227b('0x8'),'no'),'defaultValue':_0x227b('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x227b('0x1')]},'callback':{'type':Sequelize[_0x227b('0x1')]},'review':{'type':Sequelize[_0x227b('0x7')](_0x227b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x227b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x227b('0x7')](_0x227b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x227b('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x227b('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x227b('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x227b('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x227b('0x7')](_0x227b('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x227b('0x7')](_0x227b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x227b('0x7')](_0x227b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x227b('0x7')](_0x227b('0x8'),'no'),'defaultValue':_0x227b('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x227b('0x1')]},'maxsecs':{'type':Sequelize[_0x227b('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x227b('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x227b('0xb')](_0x227b('0xc'))+'\x20-\x20'+this['getDataValue'](_0x227b('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 4d635cb..55c3ba8 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 _0x6324=['then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','map','VoiceMail','fieldName','type','keys','query','filters','intersection','model','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','fields','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','rawAttributes','hasOwnProperty','pick','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x55af86,_0x5c8ff6){var _0x58df3b=function(_0x2ddd94){while(--_0x2ddd94){_0x55af86['push'](_0x55af86['shift']());}};_0x58df3b(++_0x5c8ff6);}(_0x6324,0x142));var _0x4632=function(_0x7cacf9,_0x6dac99){_0x7cacf9=_0x7cacf9-0x0;var _0xde6456=_0x6324[_0x7cacf9];return _0xde6456;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){var _0x3b0823=_0x1e1b86[_0x4632('0x28')]({'plain':!![]});var _0xb074d=_0x4632('0x29');return db[_0x4632('0x2a')][_0x4632('0x27')]({'where':{'type':_0xb074d,'resourceId':_0x3b0823['id']}})[_0x4632('0x26')](function(){return _0x1e1b86;});})[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0x438354,_0x4d9098){return function(_0x57798a){if(!_0x57798a){_0x438354[_0x4632('0x18')](0x194);}return _0x57798a;};}function handleError(_0x244743,_0x2f6656){_0x2f6656=_0x2f6656||0x1f4;return function(_0x35a533){logger[_0x4632('0x2b')](_0x35a533[_0x4632('0x2c')]);if(_0x35a533[_0x4632('0x2d')]){delete _0x35a533['name'];}_0x244743[_0x4632('0x19')](_0x2f6656)[_0x4632('0x2e')](_0x35a533);};}exports['index']=function(_0x216119,_0x5316f7){var _0x6599ad={},_0x4cb661={},_0x4fda35={'count':0x0,'rows':[]};var _0x1973eb=_[_0x4632('0x2f')](db[_0x4632('0x30')]['rawAttributes'],function(_0x5ed4d6){return{'name':_0x5ed4d6[_0x4632('0x31')],'type':_0x5ed4d6[_0x4632('0x32')]['key']};});_0x4cb661['model']=_[_0x4632('0x2f')](_0x1973eb,_0x4632('0x2d'));_0x4cb661['query']=_[_0x4632('0x33')](_0x216119[_0x4632('0x34')]);_0x4cb661[_0x4632('0x35')]=_[_0x4632('0x36')](_0x4cb661[_0x4632('0x37')],_0x4cb661['query']);_0x6599ad[_0x4632('0x38')]=_[_0x4632('0x36')](_0x4cb661['model'],qs['fields'](_0x216119[_0x4632('0x34')]['fields']));_0x6599ad['attributes']=_0x6599ad[_0x4632('0x38')]['length']?_0x6599ad[_0x4632('0x38')]:_0x4cb661[_0x4632('0x37')];if(!_0x216119[_0x4632('0x34')]['hasOwnProperty'](_0x4632('0x39'))){_0x6599ad[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x216119[_0x4632('0x34')][_0x4632('0x1e')]);_0x6599ad['offset']=qs['offset'](_0x216119[_0x4632('0x34')][_0x4632('0x1c')]);}_0x6599ad[_0x4632('0x3a')]=qs['sort'](_0x216119['query']['sort']);_0x6599ad[_0x4632('0x3b')]=qs[_0x4632('0x35')](_['pick'](_0x216119[_0x4632('0x34')],_0x4cb661[_0x4632('0x35')]),_0x1973eb);if(_0x216119[_0x4632('0x34')][_0x4632('0x3c')]){_0x6599ad[_0x4632('0x3b')]=_[_0x4632('0x3d')](_0x6599ad[_0x4632('0x3b')],{'$or':_[_0x4632('0x2f')](_0x1973eb,function(_0x21c6a5){if(_0x21c6a5[_0x4632('0x32')]!==_0x4632('0x3e')){var _0x3b6258={};_0x3b6258[_0x21c6a5['name']]={'$like':'%'+_0x216119[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x3b6258;}})});}_0x6599ad=_['merge']({},_0x6599ad,_0x216119[_0x4632('0x3f')]);var _0x1c39bc={'where':_0x6599ad['where']};return db[_0x4632('0x30')]['count'](_0x1c39bc)[_0x4632('0x26')](function(_0x28df3b){_0x4fda35[_0x4632('0x1f')]=_0x28df3b;if(_0x216119[_0x4632('0x34')]['includeAll']){_0x6599ad[_0x4632('0x40')]=[{'all':!![]}];}return db[_0x4632('0x30')][_0x4632('0x41')](_0x6599ad);})[_0x4632('0x26')](function(_0x5cc716){_0x4fda35['rows']=_0x5cc716;return _0x4fda35;})[_0x4632('0x26')](respondWithFilteredResult(_0x5316f7,_0x6599ad))[_0x4632('0x42')](handleError(_0x5316f7,null));};exports[_0x4632('0x43')]=function(_0x512db1,_0x330f21){var _0x1467c8={'raw':!![],'where':{'id':_0x512db1[_0x4632('0x44')]['id']}},_0x66598d={};_0x66598d[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x30')]['rawAttributes']);_0x66598d[_0x4632('0x34')]=_[_0x4632('0x33')](_0x512db1[_0x4632('0x34')]);_0x66598d[_0x4632('0x35')]=_[_0x4632('0x36')](_0x66598d['model'],_0x66598d['query']);_0x1467c8[_0x4632('0x38')]=_[_0x4632('0x36')](_0x66598d[_0x4632('0x37')],qs[_0x4632('0x45')](_0x512db1['query'][_0x4632('0x45')]));_0x1467c8[_0x4632('0x38')]=_0x1467c8[_0x4632('0x38')][_0x4632('0x46')]?_0x1467c8[_0x4632('0x38')]:_0x66598d['model'];if(_0x512db1[_0x4632('0x34')][_0x4632('0x47')]){_0x1467c8[_0x4632('0x40')]=[{'all':!![]}];}_0x1467c8=_[_0x4632('0x3d')]({},_0x1467c8,_0x512db1[_0x4632('0x3f')]);return db[_0x4632('0x30')][_0x4632('0x48')](_0x1467c8)[_0x4632('0x26')](handleEntityNotFound(_0x330f21,null))[_0x4632('0x26')](respondWithResult(_0x330f21,null))[_0x4632('0x42')](handleError(_0x330f21,null));};exports[_0x4632('0x49')]=function(_0x517584,_0xc3ffd0){return db[_0x4632('0x30')][_0x4632('0x49')](_0x517584['body'],{})[_0x4632('0x26')](function(_0x5f4fb5){var _0x1309aa=_0x517584[_0x4632('0x4a')][_0x4632('0x28')]({'plain':!![]});if(!_0x1309aa)throw new Error(_0x4632('0x4b'));if(_0x1309aa[_0x4632('0x4c')]===_0x4632('0x4a')){var _0x1f43b6=_0x5f4fb5[_0x4632('0x28')]({'plain':!![]});var _0x4e89e3=_0x4632('0x29');return db[_0x4632('0x4d')]['find']({'where':{'name':_0x4e89e3,'userProfileId':_0x1309aa[_0x4632('0x4e')]},'raw':!![]})[_0x4632('0x26')](function(_0x18cc47){if(_0x18cc47&&_0x18cc47[_0x4632('0x4f')]===0x0){return db[_0x4632('0x2a')][_0x4632('0x49')]({'name':_0x1f43b6[_0x4632('0x2d')],'resourceId':_0x1f43b6['id'],'type':_0x18cc47[_0x4632('0x2d')],'sectionId':_0x18cc47['id']},{})[_0x4632('0x26')](function(){return _0x5f4fb5;});}else{return _0x5f4fb5;}})[_0x4632('0x42')](function(_0x3e66d8){logger[_0x4632('0x2b')](_0x4632('0x50'),_0x3e66d8);throw _0x3e66d8;});}return _0x5f4fb5;})[_0x4632('0x26')](respondWithResult(_0xc3ffd0,0xc9))[_0x4632('0x42')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x25')]=function(_0x32cd35,_0x6c2864){if(_0x32cd35[_0x4632('0x51')]['id']){delete _0x32cd35[_0x4632('0x51')]['id'];}return db['VoiceMail'][_0x4632('0x48')]({'where':{'id':_0x32cd35[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x6c2864,null))[_0x4632('0x26')](saveUpdates(_0x32cd35[_0x4632('0x51')],null))[_0x4632('0x26')](respondWithResult(_0x6c2864,null))['catch'](handleError(_0x6c2864,null));};exports[_0x4632('0x27')]=function(_0x433fea,_0x41409d){return db['VoiceMail'][_0x4632('0x48')]({'where':{'id':_0x433fea[_0x4632('0x44')]['id']}})['then'](handleEntityNotFound(_0x41409d,null))[_0x4632('0x26')](removeEntity(_0x41409d,null))[_0x4632('0x42')](handleError(_0x41409d,null));};exports[_0x4632('0x52')]=function(_0x4b91cf,_0x3aeefd,_0x334a8e){return db[_0x4632('0x30')][_0x4632('0x53')]({'where':{'id':_0x4b91cf[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x3aeefd,null))[_0x4632('0x26')](function(_0x4658de){var _0x2965df;var _0x3abcbf={},_0x58d39a={};_0x58d39a[_0x4632('0x37')]=_[_0x4632('0x33')](db['VoiceMailMessage'][_0x4632('0x54')]);_0x58d39a['query']=_['keys'](_0x4b91cf[_0x4632('0x34')]);_0x58d39a[_0x4632('0x35')]=_[_0x4632('0x36')](_0x58d39a[_0x4632('0x37')],_0x58d39a[_0x4632('0x34')]);_0x3abcbf[_0x4632('0x38')]=_[_0x4632('0x36')](_0x58d39a[_0x4632('0x37')],qs[_0x4632('0x45')](_0x4b91cf[_0x4632('0x34')][_0x4632('0x45')]));_0x3abcbf[_0x4632('0x38')]=_0x3abcbf[_0x4632('0x38')][_0x4632('0x46')]?_0x3abcbf['attributes']:_0x58d39a['model'];if(!_0x4b91cf[_0x4632('0x34')][_0x4632('0x55')](_0x4632('0x39'))){_0x3abcbf[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x4b91cf[_0x4632('0x34')]['limit']);_0x3abcbf[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x4b91cf[_0x4632('0x34')][_0x4632('0x1c')]);}_0x3abcbf['order']=qs['sort'](_0x4b91cf[_0x4632('0x34')]['sort']);_0x3abcbf[_0x4632('0x3b')]=qs[_0x4632('0x35')](_[_0x4632('0x56')](_0x4b91cf[_0x4632('0x34')],_0x58d39a[_0x4632('0x35')]));if(_0x4b91cf['query'][_0x4632('0x3c')]){_0x3abcbf[_0x4632('0x3b')]=_['merge'](_0x3abcbf['where'],{'$or':_[_0x4632('0x2f')](_0x3abcbf[_0x4632('0x38')],function(_0x47391f){var _0x3090d6={};_0x3090d6[_0x47391f]={'$like':'%'+_0x4b91cf['query']['filter']+'%'};return _0x3090d6;})});}_0x3abcbf['where']=_[_0x4632('0x3d')](_0x3abcbf['where'],{'mailboxuser':_0x4658de[_0x4632('0x57')]});_0x3abcbf=_[_0x4632('0x3d')]({},_0x3abcbf,_0x4b91cf[_0x4632('0x3f')]);return db[_0x4632('0x58')][_0x4632('0x59')](_0x3abcbf)[_0x4632('0x26')](respondWithFilteredResult(_0x3aeefd,_0x3abcbf));})[_0x4632('0x42')](handleError(_0x3aeefd,null));}; \ No newline at end of file +var _0x9ffd=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','params','find','create','user','get','Voicemails','UserProfileSection','userProfileId','autoAssociation','body','destroy','getMessages','findOne','VoiceMailMessage','order','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise'];(function(_0xa40f2,_0x210550){var _0x57e809=function(_0x569274){while(--_0x569274){_0xa40f2['push'](_0xa40f2['shift']());}};_0x57e809(++_0x210550);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4ad87b,_0x2c4c2e){_0x4ad87b=_0x4ad87b-0x0;var _0x50c4d7=_0x9ffd[_0x4ad87b];return _0x50c4d7;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x47d842,_0x47b0d7){_0x47b0d7=_0x47b0d7||0xcc;return function(_0xaaf7af){if(_0xaaf7af){return _0x47d842[_0xd9ff('0x1a')](_0x47b0d7);}return _0x47d842[_0xd9ff('0x1b')](_0x47b0d7)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xc8;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1b')](_0x556aa4)['json'](_0x2f78c1);}};}function respondWithFilteredResult(_0xf14c9f,_0x5db010){return function(_0x4ffe54){if(_0x4ffe54){var _0x547e28=typeof _0x5db010['offset']===_0xd9ff('0x1d')&&typeof _0x5db010['limit']===_0xd9ff('0x1d');var _0xa30fd2=_0x4ffe54[_0xd9ff('0x1e')];var _0x3afd19=_0x547e28?0x0:_0x5db010[_0xd9ff('0x1f')];var _0x2d4df1=_0x547e28?_0x4ffe54[_0xd9ff('0x1e')]:_0x5db010[_0xd9ff('0x1f')]+_0x5db010[_0xd9ff('0x20')];var _0x1f028f;if(_0x2d4df1>=_0xa30fd2){_0x2d4df1=_0xa30fd2;_0x1f028f=0xc8;}else{_0x1f028f=0xce;}_0xf14c9f[_0xd9ff('0x1b')](_0x1f028f);return _0xf14c9f[_0xd9ff('0x21')](_0xd9ff('0x22'),_0x3afd19+'-'+_0x2d4df1+'/'+_0xa30fd2)['json'](_0x4ffe54);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x23')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x24')](_0x4b1477)[_0xd9ff('0x25')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){var _0x1136e9=_0x42a828['get']({'plain':!![]});var _0x3ca906='Voicemails';return db[_0xd9ff('0x26')]['destroy']({'where':{'type':_0x3ca906,'resourceId':_0x1136e9['id']}})[_0xd9ff('0x25')](function(){return _0x42a828;});})[_0xd9ff('0x25')](function(){_0x9f074e[_0xd9ff('0x1b')](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x5d685e,_0x11a17b){return function(_0xe11f88){if(!_0xe11f88){_0x5d685e[_0xd9ff('0x1a')](0x194);}return _0xe11f88;};}function handleError(_0x4390f7,_0x5c1c1f){_0x5c1c1f=_0x5c1c1f||0x1f4;return function(_0x1d3684){logger[_0xd9ff('0x27')](_0x1d3684[_0xd9ff('0x28')]);if(_0x1d3684[_0xd9ff('0x29')]){delete _0x1d3684[_0xd9ff('0x29')];}_0x4390f7[_0xd9ff('0x1b')](_0x5c1c1f)[_0xd9ff('0x2a')](_0x1d3684);};}exports[_0xd9ff('0x2b')]=function(_0x3dc443,_0x5706cf){var _0xcea5db={},_0x4ba2be={},_0x1d55fd={'count':0x0,'rows':[]};var _0x29c532=_[_0xd9ff('0x2c')](db['VoiceMail'][_0xd9ff('0x2d')],function(_0x3b26da){return{'name':_0x3b26da[_0xd9ff('0x2e')],'type':_0x3b26da[_0xd9ff('0x2f')]['key']};});_0x4ba2be[_0xd9ff('0x30')]=_['map'](_0x29c532,_0xd9ff('0x29'));_0x4ba2be[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0x3dc443[_0xd9ff('0x31')]);_0x4ba2be[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x4ba2be[_0xd9ff('0x30')],_0x4ba2be[_0xd9ff('0x31')]);_0xcea5db[_0xd9ff('0x35')]=_[_0xd9ff('0x34')](_0x4ba2be[_0xd9ff('0x30')],qs[_0xd9ff('0x36')](_0x3dc443[_0xd9ff('0x31')][_0xd9ff('0x36')]));_0xcea5db['attributes']=_0xcea5db[_0xd9ff('0x35')][_0xd9ff('0x37')]?_0xcea5db[_0xd9ff('0x35')]:_0x4ba2be['model'];if(!_0x3dc443[_0xd9ff('0x31')]['hasOwnProperty'](_0xd9ff('0x38'))){_0xcea5db['limit']=qs[_0xd9ff('0x20')](_0x3dc443['query'][_0xd9ff('0x20')]);_0xcea5db[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3dc443['query']['offset']);}_0xcea5db['order']=qs[_0xd9ff('0x39')](_0x3dc443[_0xd9ff('0x31')][_0xd9ff('0x39')]);_0xcea5db[_0xd9ff('0x3a')]=qs[_0xd9ff('0x33')](_[_0xd9ff('0x3b')](_0x3dc443['query'],_0x4ba2be['filters']),_0x29c532);if(_0x3dc443['query'][_0xd9ff('0x3c')]){_0xcea5db[_0xd9ff('0x3a')]=_[_0xd9ff('0x3d')](_0xcea5db[_0xd9ff('0x3a')],{'$or':_['map'](_0x29c532,function(_0x2692c0){if(_0x2692c0['type']!==_0xd9ff('0x3e')){var _0x3e2beb={};_0x3e2beb[_0x2692c0[_0xd9ff('0x29')]]={'$like':'%'+_0x3dc443[_0xd9ff('0x31')]['filter']+'%'};return _0x3e2beb;}})});}_0xcea5db=_[_0xd9ff('0x3d')]({},_0xcea5db,_0x3dc443[_0xd9ff('0x3f')]);var _0x4961a7={'where':_0xcea5db[_0xd9ff('0x3a')]};return db[_0xd9ff('0x40')][_0xd9ff('0x1e')](_0x4961a7)[_0xd9ff('0x25')](function(_0x1fe44d){_0x1d55fd[_0xd9ff('0x1e')]=_0x1fe44d;if(_0x3dc443['query'][_0xd9ff('0x41')]){_0xcea5db[_0xd9ff('0x42')]=[{'all':!![]}];}return db[_0xd9ff('0x40')][_0xd9ff('0x43')](_0xcea5db);})[_0xd9ff('0x25')](function(_0x52aab8){_0x1d55fd[_0xd9ff('0x44')]=_0x52aab8;return _0x1d55fd;})[_0xd9ff('0x25')](respondWithFilteredResult(_0x5706cf,_0xcea5db))[_0xd9ff('0x45')](handleError(_0x5706cf,null));};exports['show']=function(_0x5d06dd,_0x36843b){var _0x7eb1a={'raw':!![],'where':{'id':_0x5d06dd[_0xd9ff('0x46')]['id']}},_0x18d1c4={};_0x18d1c4[_0xd9ff('0x30')]=_[_0xd9ff('0x32')](db['VoiceMail'][_0xd9ff('0x2d')]);_0x18d1c4[_0xd9ff('0x31')]=_['keys'](_0x5d06dd[_0xd9ff('0x31')]);_0x18d1c4[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x18d1c4[_0xd9ff('0x30')],_0x18d1c4[_0xd9ff('0x31')]);_0x7eb1a['attributes']=_['intersection'](_0x18d1c4['model'],qs[_0xd9ff('0x36')](_0x5d06dd['query'][_0xd9ff('0x36')]));_0x7eb1a[_0xd9ff('0x35')]=_0x7eb1a[_0xd9ff('0x35')]['length']?_0x7eb1a[_0xd9ff('0x35')]:_0x18d1c4[_0xd9ff('0x30')];if(_0x5d06dd['query'][_0xd9ff('0x41')]){_0x7eb1a[_0xd9ff('0x42')]=[{'all':!![]}];}_0x7eb1a=_[_0xd9ff('0x3d')]({},_0x7eb1a,_0x5d06dd[_0xd9ff('0x3f')]);return db['VoiceMail'][_0xd9ff('0x47')](_0x7eb1a)['then'](handleEntityNotFound(_0x36843b,null))[_0xd9ff('0x25')](respondWithResult(_0x36843b,null))['catch'](handleError(_0x36843b,null));};exports[_0xd9ff('0x48')]=function(_0x3d91e6,_0x2bf37a){return db[_0xd9ff('0x40')][_0xd9ff('0x48')](_0x3d91e6['body'],{})[_0xd9ff('0x25')](function(_0x3d6f11){var _0x2fbe53=_0x3d91e6[_0xd9ff('0x49')]['get']({'plain':!![]});if(!_0x2fbe53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fbe53['role']===_0xd9ff('0x49')){var _0x40be56=_0x3d6f11[_0xd9ff('0x4a')]({'plain':!![]});var _0x572618=_0xd9ff('0x4b');return db[_0xd9ff('0x4c')][_0xd9ff('0x47')]({'where':{'name':_0x572618,'userProfileId':_0x2fbe53[_0xd9ff('0x4d')]},'raw':!![]})[_0xd9ff('0x25')](function(_0x40d391){if(_0x40d391&&_0x40d391[_0xd9ff('0x4e')]===0x0){return db[_0xd9ff('0x26')][_0xd9ff('0x48')]({'name':_0x40be56[_0xd9ff('0x29')],'resourceId':_0x40be56['id'],'type':_0x40d391[_0xd9ff('0x29')],'sectionId':_0x40d391['id']},{})[_0xd9ff('0x25')](function(){return _0x3d6f11;});}else{return _0x3d6f11;}})[_0xd9ff('0x45')](function(_0x487b07){logger[_0xd9ff('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x487b07);throw _0x487b07;});}return _0x3d6f11;})[_0xd9ff('0x25')](respondWithResult(_0x2bf37a,0xc9))['catch'](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x24')]=function(_0x49623d,_0xc82610){if(_0x49623d['body']['id']){delete _0x49623d[_0xd9ff('0x4f')]['id'];}return db['VoiceMail'][_0xd9ff('0x47')]({'where':{'id':_0x49623d['params']['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0xc82610,null))['then'](saveUpdates(_0x49623d[_0xd9ff('0x4f')],null))[_0xd9ff('0x25')](respondWithResult(_0xc82610,null))[_0xd9ff('0x45')](handleError(_0xc82610,null));};exports[_0xd9ff('0x50')]=function(_0x4df17b,_0x8c136b){return db[_0xd9ff('0x40')][_0xd9ff('0x47')]({'where':{'id':_0x4df17b['params']['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x8c136b,null))[_0xd9ff('0x25')](removeEntity(_0x8c136b,null))[_0xd9ff('0x45')](handleError(_0x8c136b,null));};exports[_0xd9ff('0x51')]=function(_0x11dd0c,_0x56e8e8,_0x27cc9e){return db[_0xd9ff('0x40')][_0xd9ff('0x52')]({'where':{'id':_0x11dd0c[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x56e8e8,null))[_0xd9ff('0x25')](function(_0x458fd4){var _0x5bac6f;var _0x3be850={},_0x11251f={};_0x11251f['model']=_[_0xd9ff('0x32')](db[_0xd9ff('0x53')]['rawAttributes']);_0x11251f[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0x11dd0c[_0xd9ff('0x31')]);_0x11251f['filters']=_['intersection'](_0x11251f[_0xd9ff('0x30')],_0x11251f['query']);_0x3be850[_0xd9ff('0x35')]=_[_0xd9ff('0x34')](_0x11251f[_0xd9ff('0x30')],qs[_0xd9ff('0x36')](_0x11dd0c['query']['fields']));_0x3be850['attributes']=_0x3be850[_0xd9ff('0x35')][_0xd9ff('0x37')]?_0x3be850[_0xd9ff('0x35')]:_0x11251f[_0xd9ff('0x30')];if(!_0x11dd0c[_0xd9ff('0x31')]['hasOwnProperty'](_0xd9ff('0x38'))){_0x3be850['limit']=qs[_0xd9ff('0x20')](_0x11dd0c[_0xd9ff('0x31')][_0xd9ff('0x20')]);_0x3be850[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x11dd0c[_0xd9ff('0x31')][_0xd9ff('0x1f')]);}_0x3be850[_0xd9ff('0x54')]=qs['sort'](_0x11dd0c[_0xd9ff('0x31')][_0xd9ff('0x39')]);_0x3be850['where']=qs['filters'](_[_0xd9ff('0x3b')](_0x11dd0c['query'],_0x11251f[_0xd9ff('0x33')]));if(_0x11dd0c[_0xd9ff('0x31')]['filter']){_0x3be850[_0xd9ff('0x3a')]=_[_0xd9ff('0x3d')](_0x3be850[_0xd9ff('0x3a')],{'$or':_[_0xd9ff('0x2c')](_0x3be850[_0xd9ff('0x35')],function(_0x49c5fa){var _0x12a8d7={};_0x12a8d7[_0x49c5fa]={'$like':'%'+_0x11dd0c['query']['filter']+'%'};return _0x12a8d7;})});}_0x3be850[_0xd9ff('0x3a')]=_[_0xd9ff('0x3d')](_0x3be850[_0xd9ff('0x3a')],{'mailboxuser':_0x458fd4[_0xd9ff('0x55')]});_0x3be850=_['merge']({},_0x3be850,_0x11dd0c[_0xd9ff('0x3f')]);return db[_0xd9ff('0x53')][_0xd9ff('0x56')](_0x3be850)[_0xd9ff('0x25')](respondWithFilteredResult(_0x56e8e8,_0x3be850));})[_0xd9ff('0x45')](handleError(_0x56e8e8,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 14a823a..425ae25 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 _0xfa93=['../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x26e289,_0x59f5eb){var _0x3a1163=function(_0x1794b7){while(--_0x1794b7){_0x26e289['push'](_0x26e289['shift']());}};_0x3a1163(++_0x59f5eb);}(_0xfa93,0x7f));var _0x3fa9=function(_0x277101,_0x298036){_0x277101=_0x277101-0x0;var _0x36da74=_0xfa93[_0x277101];return _0x36da74;};'use strict';var _=require(_0x3fa9('0x0'));var util=require(_0x3fa9('0x1'));var logger=require(_0x3fa9('0x2'))('api');var moment=require(_0x3fa9('0x3'));var BPromise=require(_0x3fa9('0x4'));var rp=require(_0x3fa9('0x5'));var fs=require('fs');var path=require(_0x3fa9('0x6'));var rimraf=require(_0x3fa9('0x7'));var config=require(_0x3fa9('0x8'));var attributes=require('./voiceMail.attributes');module[_0x3fa9('0x9')]=function(_0x30798f,_0x4d3c25){return _0x30798f[_0x3fa9('0xa')](_0x3fa9('0xb'),attributes,{'tableName':_0x3fa9('0xc'),'paranoid':![],'indexes':[{'name':_0x3fa9('0xd'),'fields':['mailbox',_0x3fa9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6ac=['path','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa6ac,0x1ac));var _0xca6a=function(_0x3b949e,_0x2e6f3e){_0x3b949e=_0x3b949e-0x0;var _0x3f725f=_0xa6ac[_0x3b949e];return _0x3f725f;};'use strict';var _=require(_0xca6a('0x0'));var util=require(_0xca6a('0x1'));var logger=require(_0xca6a('0x2'))(_0xca6a('0x3'));var moment=require('moment');var BPromise=require(_0xca6a('0x4'));var rp=require(_0xca6a('0x5'));var fs=require('fs');var path=require(_0xca6a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca6a('0x7'));module[_0xca6a('0x8')]=function(_0x4a2e04,_0x280597){return _0x4a2e04[_0xca6a('0x9')](_0xca6a('0xa'),attributes,{'tableName':_0xca6a('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xca6a('0xc'),_0xca6a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 3e48399..decc1e5 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 _0x3ee1=['rpc','../../config/environment','jayson/promise','client','request','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47572b,_0x442f2e){var _0x4c8e8d=function(_0x573a02){while(--_0x573a02){_0x47572b['push'](_0x47572b['shift']());}};_0x4c8e8d(++_0x442f2e);}(_0x3ee1,0x101));var _0x13ee=function(_0x3d332b,_0x2b398d){_0x3d332b=_0x3d332b-0x0;var _0x17628b=_0x3ee1[_0x3d332b];return _0x17628b;};'use strict';var _=require('lodash');var util=require(_0x13ee('0x0'));var moment=require(_0x13ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x13ee('0x2'));var fs=require('fs');var Redis=require(_0x13ee('0x3'));var db=require(_0x13ee('0x4'))['db'];var utils=require(_0x13ee('0x5'));var logger=require(_0x13ee('0x6'))(_0x13ee('0x7'));var config=require(_0x13ee('0x8'));var jayson=require(_0x13ee('0x9'));var client=jayson[_0x13ee('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45dd11,_0x26a5f9,_0x7da227){return new BPromise(function(_0x545fc6,_0x142682){return client[_0x13ee('0xb')](_0x45dd11,_0x7da227)['then'](function(_0x42d1da){logger[_0x13ee('0xc')](_0x13ee('0xd'),_0x26a5f9,'request\x20sent');logger[_0x13ee('0xe')](_0x13ee('0xf'),_0x26a5f9,_0x13ee('0x10'),JSON[_0x13ee('0x11')](_0x42d1da));if(_0x42d1da['error']){if(_0x42d1da['error'][_0x13ee('0x12')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x26a5f9,_0x42d1da[_0x13ee('0x13')]['message']);return _0x142682(_0x42d1da[_0x13ee('0x13')][_0x13ee('0x14')]);}logger[_0x13ee('0x13')]('VoiceMail,\x20%s,\x20%s',_0x26a5f9,_0x42d1da[_0x13ee('0x13')][_0x13ee('0x14')]);return _0x545fc6(_0x42d1da[_0x13ee('0x13')][_0x13ee('0x14')]);}else{logger[_0x13ee('0xc')]('VoiceMail,\x20%s,\x20%s',_0x26a5f9,'request\x20sent');_0x545fc6(_0x42d1da['result'][_0x13ee('0x14')]);}})[_0x13ee('0x15')](function(_0x347164){logger[_0x13ee('0x13')](_0x13ee('0xd'),_0x26a5f9,_0x347164);_0x142682(_0x347164);});});} \ No newline at end of file +var _0x0dfe=['request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x5a5aca,_0x368fbb){var _0x1cb523=function(_0x43f690){while(--_0x43f690){_0x5a5aca['push'](_0x5a5aca['shift']());}};_0x1cb523(++_0x368fbb);}(_0x0dfe,0x125));var _0xe0df=function(_0x117fd6,_0x180ac0){_0x117fd6=_0x117fd6-0x0;var _0x47725f=_0x0dfe[_0x117fd6];return _0x47725f;};'use strict';var _=require(_0xe0df('0x0'));var util=require(_0xe0df('0x1'));var moment=require(_0xe0df('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0df('0x3'));var db=require(_0xe0df('0x4'))['db'];var utils=require(_0xe0df('0x5'));var logger=require(_0xe0df('0x6'))(_0xe0df('0x7'));var config=require('../../config/environment');var jayson=require(_0xe0df('0x8'));var client=jayson[_0xe0df('0x9')][_0xe0df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23942b,_0x4dd03a,_0x1784ff){return new BPromise(function(_0x7351ac,_0x377681){return client[_0xe0df('0xb')](_0x23942b,_0x1784ff)[_0xe0df('0xc')](function(_0x45c841){logger[_0xe0df('0xd')](_0xe0df('0xe'),_0x4dd03a,_0xe0df('0xf'));logger[_0xe0df('0x10')](_0xe0df('0x11'),_0x4dd03a,_0xe0df('0xf'),JSON['stringify'](_0x45c841));if(_0x45c841[_0xe0df('0x12')]){if(_0x45c841[_0xe0df('0x12')][_0xe0df('0x13')]===0x1f4){logger[_0xe0df('0x12')]('VoiceMail,\x20%s,\x20%s',_0x4dd03a,_0x45c841[_0xe0df('0x12')][_0xe0df('0x14')]);return _0x377681(_0x45c841[_0xe0df('0x12')][_0xe0df('0x14')]);}logger['error'](_0xe0df('0xe'),_0x4dd03a,_0x45c841['error'][_0xe0df('0x14')]);return _0x7351ac(_0x45c841[_0xe0df('0x12')][_0xe0df('0x14')]);}else{logger[_0xe0df('0xd')]('VoiceMail,\x20%s,\x20%s',_0x4dd03a,_0xe0df('0xf'));_0x7351ac(_0x45c841['result']['message']);}})[_0xe0df('0x15')](function(_0x4b5320){logger['error']('VoiceMail,\x20%s,\x20%s',_0x4dd03a,_0x4b5320);_0x377681(_0x4b5320);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9946cbc..9f5d356 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 _0x2ca5=['delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update'];(function(_0x291a83,_0x1af3c3){var _0x200cf9=function(_0x31b55a){while(--_0x31b55a){_0x291a83['push'](_0x291a83['shift']());}};_0x200cf9(++_0x1af3c3);}(_0x2ca5,0x71));var _0x52ca=function(_0x723288,_0x361804){_0x723288=_0x723288-0x0;var _0x45fecf=_0x2ca5[_0x723288];return _0x45fecf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x52ca('0x0'));var timeout=require('connect-timeout');var express=require(_0x52ca('0x1'));var router=express[_0x52ca('0x2')]();var fs_extra=require(_0x52ca('0x3'));var auth=require(_0x52ca('0x4'));var interaction=require(_0x52ca('0x5'));var config=require(_0x52ca('0x6'));var controller=require(_0x52ca('0x7'));router[_0x52ca('0x8')]('/',auth['isAuthenticated'](),controller[_0x52ca('0x9')]);router[_0x52ca('0x8')](_0x52ca('0xa'),auth[_0x52ca('0xb')](),controller[_0x52ca('0xc')]);router[_0x52ca('0x8')](_0x52ca('0xd'),auth[_0x52ca('0xb')](),controller[_0x52ca('0xe')]);router[_0x52ca('0xf')]('/',auth[_0x52ca('0xb')](),controller[_0x52ca('0x10')]);router[_0x52ca('0x11')](_0x52ca('0xa'),auth['isAuthenticated'](),controller[_0x52ca('0x12')]);router[_0x52ca('0x13')](_0x52ca('0xa'),auth[_0x52ca('0xb')](),controller[_0x52ca('0x14')]);module[_0x52ca('0x15')]=router; \ No newline at end of file +var _0xa708=['../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','/:id','show','get','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x36fcb6,_0x183896){var _0x240d5a=function(_0x2dcce4){while(--_0x2dcce4){_0x36fcb6['push'](_0x36fcb6['shift']());}};_0x240d5a(++_0x183896);}(_0xa708,0x197));var _0x8a70=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa708[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8a70('0x0'));var util=require(_0x8a70('0x1'));var path=require(_0x8a70('0x2'));var timeout=require(_0x8a70('0x3'));var express=require('express');var router=express[_0x8a70('0x4')]();var fs_extra=require(_0x8a70('0x5'));var auth=require(_0x8a70('0x6'));var interaction=require(_0x8a70('0x7'));var config=require('../../config/environment');var controller=require(_0x8a70('0x8'));router['get']('/',auth[_0x8a70('0x9')](),controller['index']);router['get'](_0x8a70('0xa'),auth[_0x8a70('0x9')](),controller[_0x8a70('0xb')]);router[_0x8a70('0xc')]('/:id/download',auth[_0x8a70('0x9')](),controller['download']);router[_0x8a70('0xd')]('/',auth[_0x8a70('0x9')](),controller['create']);router[_0x8a70('0xe')](_0x8a70('0xa'),auth[_0x8a70('0x9')](),controller['update']);router[_0x8a70('0xf')](_0x8a70('0xa'),auth['isAuthenticated'](),controller[_0x8a70('0x10')]);module[_0x8a70('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 2b2fc1d..456686c 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 _0x50c8=['STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x10a4d0,_0x7c7d6a){var _0x59426e=function(_0x2c47c8){while(--_0x2c47c8){_0x10a4d0['push'](_0x10a4d0['shift']());}};_0x59426e(++_0x7c7d6a);}(_0x50c8,0x195));var _0x850c=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x50c8[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x850c('0x0'));module[_0x850c('0x1')]={'name':{'type':Sequelize[_0x850c('0x2')],'get':function(_0x5406b1){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x850c('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x850c('0x3')],'defaultValue':''},'stamp':{'type':_0x850c('0x5'),'defaultValue':Sequelize[_0x850c('0x6')](_0x850c('0x7'))}}; \ No newline at end of file +var _0x82b0=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','TIMESTAMP'];(function(_0x19e9c2,_0x467251){var _0x29d5d5=function(_0x1c59c9){while(--_0x1c59c9){_0x19e9c2['push'](_0x19e9c2['shift']());}};_0x29d5d5(++_0x467251);}(_0x82b0,0xf5));var _0x082b=function(_0x1a16f4,_0x433a8f){_0x1a16f4=_0x1a16f4-0x0;var _0x3ebad0=_0x82b0[_0x1a16f4];return _0x3ebad0;};'use strict';var Sequelize=require(_0x082b('0x0'));module[_0x082b('0x1')]={'name':{'type':Sequelize[_0x082b('0x2')],'get':function(_0x23feb4){return this[_0x082b('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x082b('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x082b('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x082b('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x082b('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x082b('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x082b('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x082b('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x082b('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x082b('0x4')],'defaultValue':''},'stamp':{'type':_0x082b('0x6'),'defaultValue':Sequelize[_0x082b('0x7')](_0x082b('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 198db4d..0574cbc 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 _0x4e2e=['nolimit','order','where','pick','filter','merge','VIRTUAL','options','VoiceMailMessage','includeAll','include','rows','params','keys','catch','create','body','update','find','download','recording','msg_id','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','set','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','model','differenceBy','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x404515,_0x58eb7d){var _0x5d05dc=function(_0x180dc6){while(--_0x180dc6){_0x404515['push'](_0x404515['shift']());}};_0x5d05dc(++_0x58eb7d);}(_0x4e2e,0x72));var _0xe4e2=function(_0xd1b2d9,_0x394303){_0xd1b2d9=_0xd1b2d9-0x0;var _0x56fff8=_0x4e2e[_0xd1b2d9];return _0x56fff8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe4e2('0x5'));var path=require(_0xe4e2('0x6'));var sox=require(_0xe4e2('0x7'));var csv=require(_0xe4e2('0x8'));var ejs=require(_0xe4e2('0x9'));var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x8'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe4e2('0x12'));var as=require(_0xe4e2('0x13'));var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require(_0xe4e2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa52be9,_0xf4111e){_0xf4111e=_0xf4111e||0xcc;return function(_0x4bf167){if(_0x4bf167){return _0xa52be9['sendStatus'](_0xf4111e);}return _0xa52be9['status'](_0xf4111e)[_0xe4e2('0x1a')]();};}function respondWithResult(_0x6712b3,_0x5ae6f3){_0x5ae6f3=_0x5ae6f3||0xc8;return function(_0x552a61){if(_0x552a61){return _0x6712b3[_0xe4e2('0x1b')](_0x5ae6f3)[_0xe4e2('0x1c')](_0x552a61);}};}function respondWithFilteredResult(_0x1cbf67,_0x4b1f21){return function(_0x2e2186){if(_0x2e2186){var _0x411e74=typeof _0x4b1f21[_0xe4e2('0x1d')]===_0xe4e2('0x1e')&&typeof _0x4b1f21[_0xe4e2('0x1f')]===_0xe4e2('0x1e');var _0x4ff49c=_0x2e2186[_0xe4e2('0x20')];var _0x27a239=_0x411e74?0x0:_0x4b1f21[_0xe4e2('0x1d')];var _0x6c3694=_0x411e74?_0x2e2186[_0xe4e2('0x20')]:_0x4b1f21[_0xe4e2('0x1d')]+_0x4b1f21['limit'];var _0x2c38c0;if(_0x6c3694>=_0x4ff49c){_0x6c3694=_0x4ff49c;_0x2c38c0=0xc8;}else{_0x2c38c0=0xce;}_0x1cbf67[_0xe4e2('0x1b')](_0x2c38c0);return _0x1cbf67['set'](_0xe4e2('0x21'),_0x27a239+'-'+_0x6c3694+'/'+_0x4ff49c)['json'](_0x2e2186);}return null;};}function patchUpdates(_0x24b2d6){return function(_0x3145bf){try{jsonpatch[_0xe4e2('0x22')](_0x3145bf,_0x24b2d6,!![]);}catch(_0x4bd8e3){return BPromise[_0xe4e2('0x23')](_0x4bd8e3);}return _0x3145bf[_0xe4e2('0x24')]();};}function saveUpdates(_0x467076,_0x4f5c46){return function(_0x3b84b0){if(_0x3b84b0){return _0x3b84b0['update'](_0x467076)[_0xe4e2('0x25')](function(_0x468297){return _0x468297;});}return null;};}function removeEntity(_0x52b075,_0x2bcaaf){return function(_0x28bfe2){if(_0x28bfe2){return _0x28bfe2[_0xe4e2('0x26')]()['then'](function(){_0x52b075[_0xe4e2('0x1b')](0xcc)[_0xe4e2('0x1a')]();});}};}function handleEntityNotFound(_0x17560f,_0x2c3cc9){return function(_0x5efd4f){if(!_0x5efd4f){_0x17560f[_0xe4e2('0x27')](0x194);}return _0x5efd4f;};}function handleError(_0x17e161,_0x4a2432){_0x4a2432=_0x4a2432||0x1f4;return function(_0x45c151){logger[_0xe4e2('0x28')](_0x45c151[_0xe4e2('0x29')]);if(_0x45c151[_0xe4e2('0x2a')]){delete _0x45c151[_0xe4e2('0x2a')];}_0x17e161[_0xe4e2('0x1b')](_0x4a2432)['send'](_0x45c151);};}exports['index']=function(_0x4a1dc0,_0x53de81){var _0x11f89e={},_0x414320={},_0xbf291f={'count':0x0,'rows':[]};var _0x13ebc9=_[_0xe4e2('0x2b')](db['VoiceMailMessage'][_0xe4e2('0x2c')],function(_0x6e7ccc){return{'name':_0x6e7ccc[_0xe4e2('0x2d')],'type':_0x6e7ccc[_0xe4e2('0x2e')]['key']};});_0x414320[_0xe4e2('0x2f')]=_[_0xe4e2('0x30')](_[_0xe4e2('0x2b')](_0x13ebc9,_0xe4e2('0x2a')),[_0xe4e2('0x2a')]);_0x414320[_0xe4e2('0x31')]=_['keys'](_0x4a1dc0[_0xe4e2('0x31')]);_0x414320[_0xe4e2('0x32')]=_['intersection'](_0x414320[_0xe4e2('0x2f')],_0x414320[_0xe4e2('0x31')]);_0x11f89e[_0xe4e2('0x33')]=_[_0xe4e2('0x34')](_0x414320[_0xe4e2('0x2f')],qs[_0xe4e2('0x35')](_0x4a1dc0[_0xe4e2('0x31')]['fields']));_0x11f89e[_0xe4e2('0x33')]=_0x11f89e[_0xe4e2('0x33')][_0xe4e2('0x36')]?_0x11f89e[_0xe4e2('0x33')]:_0x414320['model'];if(!_0x4a1dc0['query'][_0xe4e2('0x37')](_0xe4e2('0x38'))){_0x11f89e[_0xe4e2('0x1f')]=qs[_0xe4e2('0x1f')](_0x4a1dc0['query'][_0xe4e2('0x1f')]);_0x11f89e[_0xe4e2('0x1d')]=qs['offset'](_0x4a1dc0[_0xe4e2('0x31')]['offset']);}_0x11f89e[_0xe4e2('0x39')]=qs['sort'](_0x4a1dc0[_0xe4e2('0x31')]['sort']);_0x11f89e[_0xe4e2('0x3a')]=qs[_0xe4e2('0x32')](_[_0xe4e2('0x3b')](_0x4a1dc0['query'],_0x414320[_0xe4e2('0x32')]),_0x13ebc9);if(_0x4a1dc0[_0xe4e2('0x31')][_0xe4e2('0x3c')]){_0x11f89e[_0xe4e2('0x3a')]=_[_0xe4e2('0x3d')](_0x11f89e[_0xe4e2('0x3a')],{'$or':_[_0xe4e2('0x2b')](_0x13ebc9,function(_0x9638ff){if(_0x9638ff[_0xe4e2('0x2e')]!==_0xe4e2('0x3e')){var _0x281048={};_0x281048[_0x9638ff['name']]={'$like':'%'+_0x4a1dc0['query'][_0xe4e2('0x3c')]+'%'};return _0x281048;}})});}_0x11f89e=_[_0xe4e2('0x3d')]({},_0x11f89e,_0x4a1dc0[_0xe4e2('0x3f')]);var _0x1cc7a4={'where':_0x11f89e[_0xe4e2('0x3a')]};return db[_0xe4e2('0x40')][_0xe4e2('0x20')](_0x1cc7a4)[_0xe4e2('0x25')](function(_0x53c9ea){_0xbf291f[_0xe4e2('0x20')]=_0x53c9ea;if(_0x4a1dc0[_0xe4e2('0x31')][_0xe4e2('0x41')]){_0x11f89e[_0xe4e2('0x42')]=[{'all':!![]}];}return db[_0xe4e2('0x40')]['findAll'](_0x11f89e);})[_0xe4e2('0x25')](function(_0x17eee0){_0xbf291f[_0xe4e2('0x43')]=_0x17eee0;return _0xbf291f;})['then'](respondWithFilteredResult(_0x53de81,_0x11f89e))['catch'](handleError(_0x53de81,null));};exports['show']=function(_0x2158ed,_0x479c2e){var _0x862622={'raw':!![],'where':{'id':_0x2158ed[_0xe4e2('0x44')]['id']}},_0x378f8a={};_0x378f8a[_0xe4e2('0x2f')]=_[_0xe4e2('0x45')](db[_0xe4e2('0x40')]['rawAttributes']);_0x378f8a[_0xe4e2('0x31')]=_[_0xe4e2('0x45')](_0x2158ed[_0xe4e2('0x31')]);_0x378f8a[_0xe4e2('0x32')]=_['intersection'](_0x378f8a[_0xe4e2('0x2f')],_0x378f8a['query']);_0x862622[_0xe4e2('0x33')]=_[_0xe4e2('0x34')](_0x378f8a[_0xe4e2('0x2f')],qs[_0xe4e2('0x35')](_0x2158ed[_0xe4e2('0x31')][_0xe4e2('0x35')]));_0x862622[_0xe4e2('0x33')]=_0x862622[_0xe4e2('0x33')][_0xe4e2('0x36')]?_0x862622['attributes']:_0x378f8a['model'];if(_0x2158ed['query'][_0xe4e2('0x41')]){_0x862622[_0xe4e2('0x42')]=[{'all':!![]}];}_0x862622=_[_0xe4e2('0x3d')]({},_0x862622,_0x2158ed['options']);return db[_0xe4e2('0x40')]['find'](_0x862622)[_0xe4e2('0x25')](handleEntityNotFound(_0x479c2e,null))[_0xe4e2('0x25')](respondWithResult(_0x479c2e,null))[_0xe4e2('0x46')](handleError(_0x479c2e,null));};exports[_0xe4e2('0x47')]=function(_0x4629ff,_0x89a602){return db[_0xe4e2('0x40')][_0xe4e2('0x47')](_0x4629ff[_0xe4e2('0x48')],{})[_0xe4e2('0x25')](respondWithResult(_0x89a602,0xc9))['catch'](handleError(_0x89a602,null));};exports[_0xe4e2('0x49')]=function(_0xf3ce90,_0x5798be){if(_0xf3ce90[_0xe4e2('0x48')]['id']){delete _0xf3ce90[_0xe4e2('0x48')]['id'];}return db[_0xe4e2('0x40')][_0xe4e2('0x4a')]({'where':{'id':_0xf3ce90[_0xe4e2('0x44')]['id']}})[_0xe4e2('0x25')](handleEntityNotFound(_0x5798be,null))[_0xe4e2('0x25')](saveUpdates(_0xf3ce90['body'],null))[_0xe4e2('0x25')](respondWithResult(_0x5798be,null))[_0xe4e2('0x46')](handleError(_0x5798be,null));};exports[_0xe4e2('0x26')]=function(_0x22b2b0,_0x2943d5){return db[_0xe4e2('0x40')][_0xe4e2('0x4a')]({'where':{'id':_0x22b2b0['params']['id']}})[_0xe4e2('0x25')](handleEntityNotFound(_0x2943d5,null))['then'](removeEntity(_0x2943d5,null))['catch'](handleError(_0x2943d5,null));};exports[_0xe4e2('0x4b')]=function(_0x204703,_0x568148,_0x78b04b){return db[_0xe4e2('0x40')]['find']({'where':{'id':_0x204703['params']['id']},'attributes':['id',_0xe4e2('0x4c'),_0xe4e2('0x4d')]})[_0xe4e2('0x25')](handleEntityNotFound(_0x568148,null))[_0xe4e2('0x25')](function(_0x3cd597){if(_0x3cd597){if(!_0x3cd597[_0xe4e2('0x4c')]){throw new db['Sequelize'][(_0xe4e2('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0xb71689={'Content-Type':_0xe4e2('0x4f'),'Content-Disposition':_0xe4e2('0x50')};if(_0x3cd597[_0xe4e2('0x4d')]){_0xb71689[_0xe4e2('0x51')]=_0xe4e2('0x52')+_0x3cd597[_0xe4e2('0x4d')]+'.wav\x22';}_0x568148[_0xe4e2('0x53')](_0xb71689);return _0x568148[_0xe4e2('0x54')](new Buffer(_0x3cd597[_0xe4e2('0x4c')]));}})[_0xe4e2('0x46')](handleError(_0x568148,null));}; \ No newline at end of file +var _0x903b=['name','send','index','VoiceMailMessage','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','find','create','body','params','destroy','catch','download','recording','Sequelize','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error'];(function(_0x2ed77a,_0x2db873){var _0x96234d=function(_0x316915){while(--_0x316915){_0x2ed77a['push'](_0x2ed77a['shift']());}};_0x96234d(++_0x2db873);}(_0x903b,0x191));var _0xb903=function(_0x5083ff,_0xe48002){_0x5083ff=_0x5083ff-0x0;var _0x4b926e=_0x903b[_0x5083ff];return _0x4b926e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb903('0x0'));var zipdir=require(_0xb903('0x1'));var jsonpatch=require(_0xb903('0x2'));var rp=require(_0xb903('0x3'));var moment=require(_0xb903('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb903('0x5'));var util=require(_0xb903('0x6'));var path=require(_0xb903('0x7'));var sox=require(_0xb903('0x8'));var csv=require(_0xb903('0x9'));var ejs=require(_0xb903('0xa'));var fs=require('fs');var fs_extra=require(_0xb903('0xb'));var _=require(_0xb903('0xc'));var squel=require(_0xb903('0xd'));var crypto=require(_0xb903('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb903('0xf'));var toCsv=require(_0xb903('0x9'));var querystring=require(_0xb903('0x10'));var Papa=require(_0xb903('0x11'));var Redis=require(_0xb903('0x12'));var authService=require(_0xb903('0x13'));var qs=require(_0xb903('0x14'));var as=require(_0xb903('0x15'));var hardwareService=require(_0xb903('0x16'));var logger=require(_0xb903('0x17'))(_0xb903('0x18'));var utils=require(_0xb903('0x19'));var config=require(_0xb903('0x1a'));var licenseUtil=require(_0xb903('0x1b'));var db=require(_0xb903('0x1c'))['db'];function respondWithStatusCode(_0x5dc974,_0x177f58){_0x177f58=_0x177f58||0xcc;return function(_0x32b15d){if(_0x32b15d){return _0x5dc974['sendStatus'](_0x177f58);}return _0x5dc974[_0xb903('0x1d')](_0x177f58)['end']();};}function respondWithResult(_0x1129bd,_0x2f54a7){_0x2f54a7=_0x2f54a7||0xc8;return function(_0x867f28){if(_0x867f28){return _0x1129bd['status'](_0x2f54a7)[_0xb903('0x1e')](_0x867f28);}};}function respondWithFilteredResult(_0x510754,_0x4442df){return function(_0x4aca0c){if(_0x4aca0c){var _0x40364b=typeof _0x4442df[_0xb903('0x1f')]===_0xb903('0x20')&&typeof _0x4442df[_0xb903('0x21')]===_0xb903('0x20');var _0x50d6b7=_0x4aca0c['count'];var _0x446efe=_0x40364b?0x0:_0x4442df[_0xb903('0x1f')];var _0x28c9eb=_0x40364b?_0x4aca0c[_0xb903('0x22')]:_0x4442df[_0xb903('0x1f')]+_0x4442df['limit'];var _0x53f4e0;if(_0x28c9eb>=_0x50d6b7){_0x28c9eb=_0x50d6b7;_0x53f4e0=0xc8;}else{_0x53f4e0=0xce;}_0x510754['status'](_0x53f4e0);return _0x510754[_0xb903('0x23')](_0xb903('0x24'),_0x446efe+'-'+_0x28c9eb+'/'+_0x50d6b7)['json'](_0x4aca0c);}return null;};}function patchUpdates(_0xe3ddde){return function(_0x5e9bb1){try{jsonpatch[_0xb903('0x25')](_0x5e9bb1,_0xe3ddde,!![]);}catch(_0x23c683){return BPromise[_0xb903('0x26')](_0x23c683);}return _0x5e9bb1[_0xb903('0x27')]();};}function saveUpdates(_0x5e4e9c,_0x2f4f00){return function(_0x53ee9d){if(_0x53ee9d){return _0x53ee9d[_0xb903('0x28')](_0x5e4e9c)[_0xb903('0x29')](function(_0x742832){return _0x742832;});}return null;};}function removeEntity(_0x55a3b7,_0x4fae87){return function(_0x576d00){if(_0x576d00){return _0x576d00['destroy']()[_0xb903('0x29')](function(){_0x55a3b7['status'](0xcc)[_0xb903('0x2a')]();});}};}function handleEntityNotFound(_0x202de5,_0x822111){return function(_0x2659ed){if(!_0x2659ed){_0x202de5['sendStatus'](0x194);}return _0x2659ed;};}function handleError(_0x3a4592,_0x12b129){_0x12b129=_0x12b129||0x1f4;return function(_0x3e468){logger[_0xb903('0x2b')](_0x3e468['stack']);if(_0x3e468[_0xb903('0x2c')]){delete _0x3e468[_0xb903('0x2c')];}_0x3a4592[_0xb903('0x1d')](_0x12b129)[_0xb903('0x2d')](_0x3e468);};}exports[_0xb903('0x2e')]=function(_0x1089bc,_0x5812c6){var _0x5f1eeb={},_0x3f7b14={},_0x40073d={'count':0x0,'rows':[]};var _0x314dcd=_['map'](db[_0xb903('0x2f')]['rawAttributes'],function(_0x2b6e93){return{'name':_0x2b6e93[_0xb903('0x30')],'type':_0x2b6e93[_0xb903('0x31')][_0xb903('0x32')]};});_0x3f7b14[_0xb903('0x33')]=_[_0xb903('0x34')](_[_0xb903('0x35')](_0x314dcd,_0xb903('0x2c')),['name']);_0x3f7b14[_0xb903('0x36')]=_[_0xb903('0x37')](_0x1089bc[_0xb903('0x36')]);_0x3f7b14[_0xb903('0x38')]=_[_0xb903('0x39')](_0x3f7b14[_0xb903('0x33')],_0x3f7b14[_0xb903('0x36')]);_0x5f1eeb[_0xb903('0x3a')]=_[_0xb903('0x39')](_0x3f7b14['model'],qs[_0xb903('0x3b')](_0x1089bc[_0xb903('0x36')][_0xb903('0x3b')]));_0x5f1eeb['attributes']=_0x5f1eeb[_0xb903('0x3a')][_0xb903('0x3c')]?_0x5f1eeb[_0xb903('0x3a')]:_0x3f7b14[_0xb903('0x33')];if(!_0x1089bc[_0xb903('0x36')][_0xb903('0x3d')](_0xb903('0x3e'))){_0x5f1eeb[_0xb903('0x21')]=qs[_0xb903('0x21')](_0x1089bc[_0xb903('0x36')][_0xb903('0x21')]);_0x5f1eeb['offset']=qs[_0xb903('0x1f')](_0x1089bc[_0xb903('0x36')]['offset']);}_0x5f1eeb[_0xb903('0x3f')]=qs[_0xb903('0x40')](_0x1089bc[_0xb903('0x36')]['sort']);_0x5f1eeb['where']=qs[_0xb903('0x38')](_[_0xb903('0x41')](_0x1089bc[_0xb903('0x36')],_0x3f7b14[_0xb903('0x38')]),_0x314dcd);if(_0x1089bc[_0xb903('0x36')][_0xb903('0x42')]){_0x5f1eeb[_0xb903('0x43')]=_[_0xb903('0x44')](_0x5f1eeb[_0xb903('0x43')],{'$or':_[_0xb903('0x35')](_0x314dcd,function(_0x4cba84){if(_0x4cba84[_0xb903('0x31')]!=='VIRTUAL'){var _0x5f5b22={};_0x5f5b22[_0x4cba84[_0xb903('0x2c')]]={'$like':'%'+_0x1089bc[_0xb903('0x36')][_0xb903('0x42')]+'%'};return _0x5f5b22;}})});}_0x5f1eeb=_[_0xb903('0x44')]({},_0x5f1eeb,_0x1089bc[_0xb903('0x45')]);var _0x293eb8={'where':_0x5f1eeb[_0xb903('0x43')]};return db[_0xb903('0x2f')][_0xb903('0x22')](_0x293eb8)[_0xb903('0x29')](function(_0x27cc4a){_0x40073d['count']=_0x27cc4a;if(_0x1089bc[_0xb903('0x36')][_0xb903('0x46')]){_0x5f1eeb[_0xb903('0x47')]=[{'all':!![]}];}return db[_0xb903('0x2f')][_0xb903('0x48')](_0x5f1eeb);})[_0xb903('0x29')](function(_0x3f5323){_0x40073d[_0xb903('0x49')]=_0x3f5323;return _0x40073d;})[_0xb903('0x29')](respondWithFilteredResult(_0x5812c6,_0x5f1eeb))['catch'](handleError(_0x5812c6,null));};exports[_0xb903('0x4a')]=function(_0x4cee02,_0x35e211){var _0x2322ec={'raw':!![],'where':{'id':_0x4cee02['params']['id']}},_0x572492={};_0x572492['model']=_[_0xb903('0x37')](db[_0xb903('0x2f')]['rawAttributes']);_0x572492[_0xb903('0x36')]=_[_0xb903('0x37')](_0x4cee02[_0xb903('0x36')]);_0x572492[_0xb903('0x38')]=_[_0xb903('0x39')](_0x572492[_0xb903('0x33')],_0x572492[_0xb903('0x36')]);_0x2322ec[_0xb903('0x3a')]=_[_0xb903('0x39')](_0x572492['model'],qs[_0xb903('0x3b')](_0x4cee02[_0xb903('0x36')]['fields']));_0x2322ec[_0xb903('0x3a')]=_0x2322ec[_0xb903('0x3a')]['length']?_0x2322ec['attributes']:_0x572492[_0xb903('0x33')];if(_0x4cee02[_0xb903('0x36')][_0xb903('0x46')]){_0x2322ec[_0xb903('0x47')]=[{'all':!![]}];}_0x2322ec=_[_0xb903('0x44')]({},_0x2322ec,_0x4cee02[_0xb903('0x45')]);return db['VoiceMailMessage'][_0xb903('0x4b')](_0x2322ec)[_0xb903('0x29')](handleEntityNotFound(_0x35e211,null))['then'](respondWithResult(_0x35e211,null))['catch'](handleError(_0x35e211,null));};exports[_0xb903('0x4c')]=function(_0x469212,_0x3e0175){return db[_0xb903('0x2f')][_0xb903('0x4c')](_0x469212[_0xb903('0x4d')],{})['then'](respondWithResult(_0x3e0175,0xc9))['catch'](handleError(_0x3e0175,null));};exports['update']=function(_0x1d462e,_0x32f01d){if(_0x1d462e[_0xb903('0x4d')]['id']){delete _0x1d462e[_0xb903('0x4d')]['id'];}return db[_0xb903('0x2f')]['find']({'where':{'id':_0x1d462e[_0xb903('0x4e')]['id']}})[_0xb903('0x29')](handleEntityNotFound(_0x32f01d,null))['then'](saveUpdates(_0x1d462e['body'],null))[_0xb903('0x29')](respondWithResult(_0x32f01d,null))['catch'](handleError(_0x32f01d,null));};exports[_0xb903('0x4f')]=function(_0x51ef0c,_0x528b1b){return db[_0xb903('0x2f')]['find']({'where':{'id':_0x51ef0c[_0xb903('0x4e')]['id']}})['then'](handleEntityNotFound(_0x528b1b,null))['then'](removeEntity(_0x528b1b,null))[_0xb903('0x50')](handleError(_0x528b1b,null));};exports[_0xb903('0x51')]=function(_0x2527f4,_0x5a6826,_0x257301){return db['VoiceMailMessage'][_0xb903('0x4b')]({'where':{'id':_0x2527f4['params']['id']},'attributes':['id',_0xb903('0x52'),'msg_id']})[_0xb903('0x29')](handleEntityNotFound(_0x5a6826,null))[_0xb903('0x29')](function(_0x2d50d6){if(_0x2d50d6){if(!_0x2d50d6['recording']){throw new db[(_0xb903('0x53'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0xa00b72={'Content-Type':_0xb903('0x54'),'Content-Disposition':'attachment'};if(_0x2d50d6[_0xb903('0x55')]){_0xa00b72[_0xb903('0x56')]=_0xb903('0x57')+_0x2d50d6[_0xb903('0x55')]+_0xb903('0x58');}_0x5a6826[_0xb903('0x23')](_0xa00b72);return _0x5a6826['send'](new Buffer(_0x2d50d6[_0xb903('0x52')]));}})[_0xb903('0x50')](handleError(_0x5a6826,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index ecd1324..1376dfe 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 _0x0625=['request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','bluebird'];(function(_0x72c194,_0x1a953a){var _0x1f4f68=function(_0x43bcdd){while(--_0x43bcdd){_0x72c194['push'](_0x72c194['shift']());}};_0x1f4f68(++_0x1a953a);}(_0x0625,0x6c));var _0x5062=function(_0x1fb53e,_0x393670){_0x1fb53e=_0x1fb53e-0x0;var _0x3623a2=_0x0625[_0x1fb53e];return _0x3623a2;};'use strict';var _=require(_0x5062('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5062('0x1'));var rp=require(_0x5062('0x2'));var fs=require('fs');var path=require(_0x5062('0x3'));var rimraf=require(_0x5062('0x4'));var config=require(_0x5062('0x5'));var attributes=require(_0x5062('0x6'));module[_0x5062('0x7')]=function(_0x2db7bd,_0x5e189c){return _0x2db7bd['define'](_0x5062('0x8'),attributes,{'tableName':_0x5062('0x9'),'paranoid':![],'indexes':[{'name':_0x5062('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xced3=['./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4c8fa9,_0x2a1337){var _0x192648=function(_0x6c8436){while(--_0x6c8436){_0x4c8fa9['push'](_0x4c8fa9['shift']());}};_0x192648(++_0x2a1337);}(_0xced3,0x170));var _0x3ced=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xced3[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x3ced('0x0'));var util=require(_0x3ced('0x1'));var logger=require(_0x3ced('0x2'))(_0x3ced('0x3'));var moment=require(_0x3ced('0x4'));var BPromise=require(_0x3ced('0x5'));var rp=require(_0x3ced('0x6'));var fs=require('fs');var path=require(_0x3ced('0x7'));var rimraf=require('rimraf');var config=require(_0x3ced('0x8'));var attributes=require(_0x3ced('0x9'));module['exports']=function(_0x708dbe,_0x212044){return _0x708dbe[_0x3ced('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x3ced('0xb'),'paranoid':![],'indexes':[{'name':_0x3ced('0xc'),'fields':[_0x3ced('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 490c028..c9560a6 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 _0x780d=['stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x50fc93,_0x3b3b27){var _0x40f130=function(_0x9270e3){while(--_0x9270e3){_0x50fc93['push'](_0x50fc93['shift']());}};_0x40f130(++_0x3b3b27);}(_0x780d,0x1bd));var _0xd780=function(_0x1819fc,_0x593338){_0x1819fc=_0x1819fc-0x0;var _0x4921c9=_0x780d[_0x1819fc];return _0x4921c9;};'use strict';var _=require(_0xd780('0x0'));var util=require('util');var moment=require(_0xd780('0x1'));var BPromise=require(_0xd780('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd780('0x3'));var db=require(_0xd780('0x4'))['db'];var utils=require(_0xd780('0x5'));var logger=require('../../config/logger')(_0xd780('0x6'));var config=require(_0xd780('0x7'));var jayson=require(_0xd780('0x8'));var client=jayson[_0xd780('0x9')][_0xd780('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21dc68,_0x1b1ce2,_0x2494f5){return new BPromise(function(_0x380d33,_0x2d6551){return client[_0xd780('0xb')](_0x21dc68,_0x2494f5)['then'](function(_0xa234e8){logger[_0xd780('0xc')](_0xd780('0xd'),_0x1b1ce2,_0xd780('0xe'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1b1ce2,'request\x20sent',JSON[_0xd780('0xf')](_0xa234e8));if(_0xa234e8[_0xd780('0x10')]){if(_0xa234e8[_0xd780('0x10')]['code']===0x1f4){logger[_0xd780('0x10')](_0xd780('0xd'),_0x1b1ce2,_0xa234e8[_0xd780('0x10')]['message']);return _0x2d6551(_0xa234e8[_0xd780('0x10')]['message']);}logger[_0xd780('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x1b1ce2,_0xa234e8['error']['message']);return _0x380d33(_0xa234e8['error'][_0xd780('0x11')]);}else{logger[_0xd780('0xc')](_0xd780('0xd'),_0x1b1ce2,_0xd780('0xe'));_0x380d33(_0xa234e8[_0xd780('0x12')][_0xd780('0x11')]);}})[_0xd780('0x13')](function(_0x325e29){logger[_0xd780('0x10')](_0xd780('0xd'),_0x1b1ce2,_0x325e29);_0x2d6551(_0x325e29);});});} \ No newline at end of file +var _0xd7c6=['then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x2af296,_0xcb2124){var _0x1dd628=function(_0x1ba5b2){while(--_0x1ba5b2){_0x2af296['push'](_0x2af296['shift']());}};_0x1dd628(++_0xcb2124);}(_0xd7c6,0x122));var _0x6d7c=function(_0x41e10,_0x17657d){_0x41e10=_0x41e10-0x0;var _0x4efe10=_0xd7c6[_0x41e10];return _0x4efe10;};'use strict';var _=require(_0x6d7c('0x0'));var util=require(_0x6d7c('0x1'));var moment=require('moment');var BPromise=require(_0x6d7c('0x2'));var rs=require(_0x6d7c('0x3'));var fs=require('fs');var Redis=require(_0x6d7c('0x4'));var db=require(_0x6d7c('0x5'))['db'];var utils=require(_0x6d7c('0x6'));var logger=require(_0x6d7c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6d7c('0x8'));var client=jayson['client'][_0x6d7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6142ab,_0x254a97,_0x35b45f){return new BPromise(function(_0x14c324,_0x49dcc9){return client['request'](_0x6142ab,_0x35b45f)[_0x6d7c('0xa')](function(_0x233f94){logger['info'](_0x6d7c('0xb'),_0x254a97,'request\x20sent');logger[_0x6d7c('0xc')](_0x6d7c('0xd'),_0x254a97,_0x6d7c('0xe'),JSON[_0x6d7c('0xf')](_0x233f94));if(_0x233f94[_0x6d7c('0x10')]){if(_0x233f94[_0x6d7c('0x10')][_0x6d7c('0x11')]===0x1f4){logger[_0x6d7c('0x10')](_0x6d7c('0xb'),_0x254a97,_0x233f94[_0x6d7c('0x10')][_0x6d7c('0x12')]);return _0x49dcc9(_0x233f94[_0x6d7c('0x10')][_0x6d7c('0x12')]);}logger[_0x6d7c('0x10')](_0x6d7c('0xb'),_0x254a97,_0x233f94[_0x6d7c('0x10')][_0x6d7c('0x12')]);return _0x14c324(_0x233f94[_0x6d7c('0x10')][_0x6d7c('0x12')]);}else{logger[_0x6d7c('0x13')](_0x6d7c('0xb'),_0x254a97,_0x6d7c('0xe'));_0x14c324(_0x233f94['result']['message']);}})['catch'](function(_0x5e8b17){logger[_0x6d7c('0x10')](_0x6d7c('0xb'),_0x254a97,_0x5e8b17);_0x49dcc9(_0x5e8b17);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index da0babc..56d706c 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 _0xa7eb=['get','isAuthenticated','index','/:id/sounds','getSounds','post','create','addSound','put','/:id','delete','destroy','/:id/sounds/:id2','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x2c4704,_0x325165){var _0x44ff1a=function(_0x3e2848){while(--_0x3e2848){_0x2c4704['push'](_0x2c4704['shift']());}};_0x44ff1a(++_0x325165);}(_0xa7eb,0x158));var _0xba7e=function(_0xb748ff,_0x1298d9){_0xb748ff=_0xb748ff-0x0;var _0x5dd153=_0xa7eb[_0xb748ff];return _0x5dd153;};'use strict';var multer=require(_0xba7e('0x0'));var util=require(_0xba7e('0x1'));var path=require('path');var timeout=require(_0xba7e('0x2'));var express=require(_0xba7e('0x3'));var router=express[_0xba7e('0x4')]();var fs_extra=require(_0xba7e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xba7e('0x6'));var controller=require(_0xba7e('0x7'));router[_0xba7e('0x8')]('/',auth[_0xba7e('0x9')](),controller[_0xba7e('0xa')]);router['get']('/:id',auth[_0xba7e('0x9')](),controller['show']);router[_0xba7e('0x8')](_0xba7e('0xb'),auth[_0xba7e('0x9')](),controller[_0xba7e('0xc')]);router[_0xba7e('0xd')]('/',auth[_0xba7e('0x9')](),controller[_0xba7e('0xe')]);router[_0xba7e('0xd')](_0xba7e('0xb'),auth[_0xba7e('0x9')](),controller[_0xba7e('0xf')]);router[_0xba7e('0x10')](_0xba7e('0x11'),auth[_0xba7e('0x9')](),controller['update']);router[_0xba7e('0x12')](_0xba7e('0x11'),auth[_0xba7e('0x9')](),controller[_0xba7e('0x13')]);router['delete'](_0xba7e('0x14'),auth[_0xba7e('0x9')](),controller['removeSound']);module[_0xba7e('0x15')]=router; \ No newline at end of file +var _0x21de=['get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','addSound','update','delete','destroy','/:id/sounds/:id2','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5477ea,_0x5c6ce0){var _0x338780=function(_0x3f7848){while(--_0x3f7848){_0x5477ea['push'](_0x5477ea['shift']());}};_0x338780(++_0x5c6ce0);}(_0x21de,0x92));var _0xe21d=function(_0x3dacc3,_0x3a475f){_0x3dacc3=_0x3dacc3-0x0;var _0x3ed9a5=_0x21de[_0x3dacc3];return _0x3ed9a5;};'use strict';var multer=require('multer');var util=require(_0xe21d('0x0'));var path=require('path');var timeout=require(_0xe21d('0x1'));var express=require(_0xe21d('0x2'));var router=express[_0xe21d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe21d('0x4'));var interaction=require(_0xe21d('0x5'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0xe21d('0x6')]('/',auth[_0xe21d('0x7')](),controller[_0xe21d('0x8')]);router[_0xe21d('0x6')](_0xe21d('0x9'),auth[_0xe21d('0x7')](),controller['show']);router[_0xe21d('0x6')](_0xe21d('0xa'),auth['isAuthenticated'](),controller[_0xe21d('0xb')]);router[_0xe21d('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe21d('0xc')](_0xe21d('0xa'),auth[_0xe21d('0x7')](),controller[_0xe21d('0xd')]);router['put'](_0xe21d('0x9'),auth[_0xe21d('0x7')](),controller[_0xe21d('0xe')]);router[_0xe21d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe21d('0x10')]);router['delete'](_0xe21d('0x11'),auth['isAuthenticated'](),controller['removeSound']);module[_0xe21d('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f5dc6c7..30304ce 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 _0xcfb1=['exports','STRING','name','custom','quietmp3nb','alpha','BOOLEAN','sequelize'];(function(_0x162a95,_0x9dfb1f){var _0x54cd40=function(_0x249ed1){while(--_0x249ed1){_0x162a95['push'](_0x162a95['shift']());}};_0x54cd40(++_0x9dfb1f);}(_0xcfb1,0xdf));var _0x1cfb=function(_0x144555,_0x5991f4){_0x144555=_0x144555-0x0;var _0x3a3096=_0xcfb1[_0x144555];return _0x3a3096;};'use strict';var Sequelize=require(_0x1cfb('0x0'));module[_0x1cfb('0x1')]={'name':{'type':Sequelize[_0x1cfb('0x2')],'allowNull':![],'unique':_0x1cfb('0x3')},'mode':{'type':Sequelize['ENUM'](_0x1cfb('0x4'),'files','mp3nb',_0x1cfb('0x5'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x1cfb('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x1cfb('0x2')],'allowNull':!![],'defaultValue':_0x1cfb('0x6')},'format':{'type':Sequelize[_0x1cfb('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x1cfb('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5f2b=['STRING','alpha','TIMESTAMP','exports','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x34e44e,_0x24ac3c){var _0x36f299=function(_0x18ca97){while(--_0x18ca97){_0x34e44e['push'](_0x34e44e['shift']());}};_0x36f299(++_0x24ac3c);}(_0x5f2b,0x1e7));var _0xb5f2=function(_0x4d3d59,_0x157a3e){_0x4d3d59=_0x4d3d59-0x0;var _0x379e44=_0x5f2b[_0x4d3d59];return _0x379e44;};'use strict';var Sequelize=require('sequelize');module[_0xb5f2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb5f2('0x1')},'mode':{'type':Sequelize[_0xb5f2('0x2')](_0xb5f2('0x3'),_0xb5f2('0x4'),_0xb5f2('0x5'),_0xb5f2('0x6'),_0xb5f2('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0xb5f2('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xb5f2('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb5f2('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb5f2('0x8')],'allowNull':!![],'defaultValue':_0xb5f2('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xb5f2('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 fbdec7d..e4498da 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 _0x9a23=['rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','root','server/files/sounds/converted','basename','extname','format','converted_format','symlinkSync','id2','createdAt','%s.%s','getSounds','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','error','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','keys','includeAll','options','find','catch','body','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync'];(function(_0x5059f8,_0x3ed44e){var _0x5695a5=function(_0x448ff6){while(--_0x448ff6){_0x5059f8['push'](_0x5059f8['shift']());}};_0x5695a5(++_0x3ed44e);}(_0x9a23,0xfe));var _0x39a2=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9a23[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39a2('0x0'));var zipdir=require(_0x39a2('0x1'));var jsonpatch=require(_0x39a2('0x2'));var rp=require(_0x39a2('0x3'));var moment=require(_0x39a2('0x4'));var BPromise=require(_0x39a2('0x5'));var Mustache=require(_0x39a2('0x6'));var util=require(_0x39a2('0x7'));var path=require(_0x39a2('0x8'));var sox=require(_0x39a2('0x9'));var csv=require('to-csv');var ejs=require(_0x39a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39a2('0xb'));var squel=require('squel');var crypto=require(_0x39a2('0xc'));var jsforce=require(_0x39a2('0xd'));var deskjs=require(_0x39a2('0xe'));var toCsv=require(_0x39a2('0xf'));var querystring=require('querystring');var Papa=require(_0x39a2('0x10'));var Redis=require(_0x39a2('0x11'));var authService=require(_0x39a2('0x12'));var qs=require(_0x39a2('0x13'));var as=require(_0x39a2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39a2('0x15'))(_0x39a2('0x16'));var utils=require(_0x39a2('0x17'));var config=require(_0x39a2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x39a2('0x19'))['db'];function respondWithStatusCode(_0x3baafe,_0x294300){_0x294300=_0x294300||0xcc;return function(_0x5c88be){if(_0x5c88be){return _0x3baafe[_0x39a2('0x1a')](_0x294300);}return _0x3baafe['status'](_0x294300)['end']();};}function respondWithResult(_0x29b33f,_0x305545){_0x305545=_0x305545||0xc8;return function(_0x143c4f){if(_0x143c4f){return _0x29b33f['status'](_0x305545)[_0x39a2('0x1b')](_0x143c4f);}};}function respondWithFilteredResult(_0x253365,_0x159ede){return function(_0x31a9ed){if(_0x31a9ed){var _0x4a8145=typeof _0x159ede[_0x39a2('0x1c')]===_0x39a2('0x1d')&&typeof _0x159ede['limit']===_0x39a2('0x1d');var _0x1b80e0=_0x31a9ed['count'];var _0x4a0850=_0x4a8145?0x0:_0x159ede[_0x39a2('0x1c')];var _0x22aacf=_0x4a8145?_0x31a9ed[_0x39a2('0x1e')]:_0x159ede[_0x39a2('0x1c')]+_0x159ede[_0x39a2('0x1f')];var _0x305f8c;if(_0x22aacf>=_0x1b80e0){_0x22aacf=_0x1b80e0;_0x305f8c=0xc8;}else{_0x305f8c=0xce;}_0x253365[_0x39a2('0x20')](_0x305f8c);return _0x253365[_0x39a2('0x21')](_0x39a2('0x22'),_0x4a0850+'-'+_0x22aacf+'/'+_0x1b80e0)[_0x39a2('0x1b')](_0x31a9ed);}return null;};}function patchUpdates(_0x221cde){return function(_0x46ecdf){try{jsonpatch[_0x39a2('0x23')](_0x46ecdf,_0x221cde,!![]);}catch(_0x54e614){return BPromise[_0x39a2('0x24')](_0x54e614);}return _0x46ecdf['save']();};}function saveUpdates(_0x4c9f42,_0x5a6d15){return function(_0x390cd9){if(_0x390cd9){return _0x390cd9[_0x39a2('0x25')](_0x4c9f42)[_0x39a2('0x26')](function(_0xea393){return _0xea393;});}return null;};}function removeEntity(_0x3f34ea,_0x29296b){return function(_0x3dd436){if(_0x3dd436){return _0x3dd436[_0x39a2('0x27')]()[_0x39a2('0x26')](function(){var _0x4e92c7=_0x3dd436[_0x39a2('0x28')]({'plain':!![]});var _0x11b3cb=_0x39a2('0x29');return db[_0x39a2('0x2a')]['destroy']({'where':{'type':_0x11b3cb,'resourceId':_0x4e92c7['id']}})[_0x39a2('0x26')](function(){return _0x3dd436;});})['then'](function(){_0x3f34ea[_0x39a2('0x20')](0xcc)[_0x39a2('0x2b')]();});}};}function handleEntityNotFound(_0xaa42b4,_0x192e59){return function(_0xf84d21){if(!_0xf84d21){_0xaa42b4[_0x39a2('0x1a')](0x194);}return _0xf84d21;};}function handleError(_0x19a9e3,_0x4d7e28){_0x4d7e28=_0x4d7e28||0x1f4;return function(_0x4ee687){logger[_0x39a2('0x2c')](_0x4ee687['stack']);if(_0x4ee687[_0x39a2('0x2d')]){delete _0x4ee687[_0x39a2('0x2d')];}_0x19a9e3[_0x39a2('0x20')](_0x4d7e28)['send'](_0x4ee687);};}exports[_0x39a2('0x2e')]=function(_0x9aeab2,_0xf7512e){var _0x2c99ed={},_0x1cc377={},_0x3f584b={'count':0x0,'rows':[]};var _0x219137=_['map'](db[_0x39a2('0x2f')][_0x39a2('0x30')],function(_0x58a68c){return{'name':_0x58a68c[_0x39a2('0x31')],'type':_0x58a68c[_0x39a2('0x32')][_0x39a2('0x33')]};});_0x1cc377[_0x39a2('0x34')]=_[_0x39a2('0x35')](_0x219137,'name');_0x1cc377['query']=_['keys'](_0x9aeab2[_0x39a2('0x36')]);_0x1cc377[_0x39a2('0x37')]=_['intersection'](_0x1cc377[_0x39a2('0x34')],_0x1cc377[_0x39a2('0x36')]);_0x2c99ed[_0x39a2('0x38')]=_[_0x39a2('0x39')](_0x1cc377[_0x39a2('0x34')],qs[_0x39a2('0x3a')](_0x9aeab2[_0x39a2('0x36')]['fields']));_0x2c99ed['attributes']=_0x2c99ed[_0x39a2('0x38')][_0x39a2('0x3b')]?_0x2c99ed[_0x39a2('0x38')]:_0x1cc377[_0x39a2('0x34')];if(!_0x9aeab2[_0x39a2('0x36')][_0x39a2('0x3c')](_0x39a2('0x3d'))){_0x2c99ed[_0x39a2('0x1f')]=qs[_0x39a2('0x1f')](_0x9aeab2['query'][_0x39a2('0x1f')]);_0x2c99ed['offset']=qs[_0x39a2('0x1c')](_0x9aeab2[_0x39a2('0x36')]['offset']);}_0x2c99ed['order']=qs[_0x39a2('0x3e')](_0x9aeab2[_0x39a2('0x36')][_0x39a2('0x3e')]);delete _0x9aeab2[_0x39a2('0x36')]['sort'];_0x2c99ed['where']=qs['filters'](_[_0x39a2('0x3f')](_0x9aeab2['query'],_0x1cc377[_0x39a2('0x37')]),_0x219137);if(_0x9aeab2[_0x39a2('0x36')][_0x39a2('0x40')]){_0x2c99ed[_0x39a2('0x41')]=_[_0x39a2('0x42')](_0x2c99ed['where'],{'$or':_[_0x39a2('0x35')](_0x219137,function(_0x2edcbb){if(_0x2edcbb['type']!==_0x39a2('0x43')){var _0x7ff00f={};_0x7ff00f[_0x2edcbb['name']]={'$like':'%'+_0x9aeab2[_0x39a2('0x36')][_0x39a2('0x40')]+'%'};return _0x7ff00f;}})});}_0x2c99ed=_['merge']({},_0x2c99ed,_0x9aeab2['options']);var _0x4653ef={'where':_0x2c99ed[_0x39a2('0x41')]};return db['VoiceMusicOnHold'][_0x39a2('0x1e')](_0x4653ef)[_0x39a2('0x26')](function(_0x765495){_0x3f584b['count']=_0x765495;if(_0x9aeab2[_0x39a2('0x36')]['includeAll']){_0x2c99ed[_0x39a2('0x44')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x39a2('0x45')](_0x2c99ed);})[_0x39a2('0x26')](function(_0x1ac944){_0x3f584b[_0x39a2('0x46')]=_0x1ac944;return _0x3f584b;})[_0x39a2('0x26')](respondWithFilteredResult(_0xf7512e,_0x2c99ed))['catch'](handleError(_0xf7512e,null));};exports[_0x39a2('0x47')]=function(_0x506f2c,_0x5dd688){var _0x555a31={'raw':![],'where':{'id':_0x506f2c[_0x39a2('0x48')]['id']}},_0x4d88c2={};_0x4d88c2[_0x39a2('0x34')]=_[_0x39a2('0x49')](db[_0x39a2('0x2f')][_0x39a2('0x30')]);_0x4d88c2[_0x39a2('0x36')]=_[_0x39a2('0x49')](_0x506f2c[_0x39a2('0x36')]);_0x4d88c2['filters']=_[_0x39a2('0x39')](_0x4d88c2[_0x39a2('0x34')],_0x4d88c2[_0x39a2('0x36')]);_0x555a31[_0x39a2('0x38')]=_[_0x39a2('0x39')](_0x4d88c2[_0x39a2('0x34')],qs[_0x39a2('0x3a')](_0x506f2c[_0x39a2('0x36')][_0x39a2('0x3a')]));_0x555a31[_0x39a2('0x38')]=_0x555a31[_0x39a2('0x38')][_0x39a2('0x3b')]?_0x555a31[_0x39a2('0x38')]:_0x4d88c2[_0x39a2('0x34')];if(_0x506f2c['query'][_0x39a2('0x4a')]){_0x555a31[_0x39a2('0x44')]=[{'all':!![]}];}_0x555a31=_[_0x39a2('0x42')]({},_0x555a31,_0x506f2c[_0x39a2('0x4b')]);return db['VoiceMusicOnHold'][_0x39a2('0x4c')](_0x555a31)[_0x39a2('0x26')](handleEntityNotFound(_0x5dd688,null))[_0x39a2('0x26')](respondWithResult(_0x5dd688,null))[_0x39a2('0x4d')](handleError(_0x5dd688,null));};exports[_0x39a2('0x25')]=function(_0x3a3a45,_0x24669d){if(_0x3a3a45[_0x39a2('0x4e')]['id']){delete _0x3a3a45[_0x39a2('0x4e')]['id'];}return db[_0x39a2('0x2f')][_0x39a2('0x4c')]({'where':{'id':_0x3a3a45['params']['id']}})[_0x39a2('0x26')](handleEntityNotFound(_0x24669d,null))[_0x39a2('0x26')](saveUpdates(_0x3a3a45[_0x39a2('0x4e')],null))[_0x39a2('0x26')](respondWithResult(_0x24669d,null))['catch'](handleError(_0x24669d,null));};exports[_0x39a2('0x4f')]=function(_0x3f5711,_0x24d0f1,_0x582d00){return db[_0x39a2('0x50')][_0x39a2('0x51')](function(_0x26a5f8){if(_0x3f5711[_0x39a2('0x4e')][_0x39a2('0x52')]===_0x39a2('0x53')){_0x3f5711[_0x39a2('0x4e')][_0x39a2('0x54')]=path[_0x39a2('0x55')](config['root'],_0x39a2('0x56'),_0x3f5711[_0x39a2('0x4e')][_0x39a2('0x2d')]);}return db['VoiceMusicOnHold'][_0x39a2('0x4f')](_0x3f5711[_0x39a2('0x4e')],{'transaction':_0x26a5f8})[_0x39a2('0x26')](function(_0xc76474){if(_0x3f5711[_0x39a2('0x4e')][_0x39a2('0x52')]===_0x39a2('0x53')){fs[_0x39a2('0x57')](_0xc76474[_0x39a2('0x54')],parseInt(_0x39a2('0x58'),0x8));}var _0x733ea7=_0x3f5711[_0x39a2('0x59')][_0x39a2('0x28')]({'plain':!![]});if(!_0x733ea7)throw new Error(_0x39a2('0x5a'));if(_0x733ea7[_0x39a2('0x5b')]==='user'){var _0x45d430=_0xc76474['get']({'plain':!![]});return db[_0x39a2('0x5c')][_0x39a2('0x4c')]({'where':{'name':'MusicOnHolds','userProfileId':_0x733ea7['userProfileId']},'raw':!![]})['then'](function(_0x562d5a){if(_0x562d5a&&_0x562d5a[_0x39a2('0x5d')]===0x0){return db[_0x39a2('0x2a')][_0x39a2('0x4f')]({'name':_0x45d430['name'],'resourceId':_0x45d430['id'],'type':_0x562d5a[_0x39a2('0x2d')],'sectionId':_0x562d5a['id']},{})['then'](function(){return _0xc76474;});}else{return _0xc76474;}})[_0x39a2('0x4d')](function(_0x2436ed){logger[_0x39a2('0x2c')](_0x39a2('0x5e'),_0x2436ed);});}return _0xc76474;});})['then'](respondWithResult(_0x24d0f1,0xc9))[_0x39a2('0x4d')](handleError(_0x24d0f1,null));};exports[_0x39a2('0x27')]=function(_0x2a0a7d,_0x4fee31,_0x2e99d4){var _0x4b81e8;return db[_0x39a2('0x2f')][_0x39a2('0x4c')]({'where':{'id':_0x2a0a7d[_0x39a2('0x48')]['id']}})[_0x39a2('0x26')](function(_0x29a0e8){if(_0x29a0e8){return db[_0x39a2('0x50')][_0x39a2('0x51')](function(_0x82ba7c){return _0x29a0e8['destroy']({'transaction':_0x82ba7c,'raw':!![]})[_0x39a2('0x26')](function(_0x308e50){if(_0x308e50[_0x39a2('0x54')]){fs[_0x39a2('0x5f')](_0x308e50[_0x39a2('0x54')])['forEach'](function(_0x138d4d){fs[_0x39a2('0x60')](path[_0x39a2('0x55')](_0x308e50[_0x39a2('0x54')],_0x138d4d));});fs[_0x39a2('0x61')](_0x308e50[_0x39a2('0x54')]);}return _0x308e50;});})[_0x39a2('0x4d')](function(_0x39cbf8){throw new db[(_0x39a2('0x62'))][(_0x39a2('0x63'))](_0x39cbf8[_0x39a2('0x64')]);});}})[_0x39a2('0x26')](handleEntityNotFound(_0x4fee31,null))['then'](removeEntity(_0x4fee31,null))[_0x39a2('0x4d')](handleError(_0x4fee31,null));};exports['addSound']=function(_0x5564ba,_0x3ac6a1,_0x2b281e){return db['sequelize'][_0x39a2('0x51')](function(_0x141e0d){var _0xe57ac5;return db[_0x39a2('0x2f')][_0x39a2('0x4c')]({'where':{'id':_0x5564ba['params']['id']}})[_0x39a2('0x26')](function(_0x461b16){if(_0x461b16){_0xe57ac5=_0x461b16;return _0x461b16[_0x39a2('0x65')](_0x5564ba['body']['id'],{'transaction':_0x141e0d});}})[_0x39a2('0x26')](function(_0x12ff73){if(_0x12ff73){return db[_0x39a2('0x66')][_0x39a2('0x67')]({'where':{'id':_0x5564ba[_0x39a2('0x4e')]['id']},'attributes':['id',_0x39a2('0x2d'),_0x39a2('0x68'),'converted_format','createdAt'],'raw':!![]});}})[_0x39a2('0x26')](function(_0xd246f6){if(_0xd246f6){var _0x491dc4=path[_0x39a2('0x55')](config[_0x39a2('0x69')],_0x39a2('0x6a'),util['format']('%s.%s',path[_0x39a2('0x6b')](_0xd246f6[_0x39a2('0x68')],path[_0x39a2('0x6c')](_0xd246f6[_0x39a2('0x68')])),_0xd246f6['converted_format']));var _0x156975=path['join'](config[_0x39a2('0x69')],_0x39a2('0x56'),_0xe57ac5['name'],util[_0x39a2('0x6d')]('%s.%s',_0xd246f6[_0x39a2('0x2d')],_0xd246f6[_0x39a2('0x6e')]));fs[_0x39a2('0x6f')](_0x491dc4,_0x156975);return _0xd246f6;}})[_0x39a2('0x4d')](function(_0x110df2){throw new db[(_0x39a2('0x62'))]['ValidationError'](_0x110df2[_0x39a2('0x64')]);});})[_0x39a2('0x26')](handleEntityNotFound(_0x3ac6a1,null))[_0x39a2('0x26')](respondWithResult(_0x3ac6a1,0xc9))[_0x39a2('0x4d')](handleError(_0x3ac6a1,null));};exports['removeSound']=function(_0xcda190,_0x576c3a,_0x1adf1d){return db[_0x39a2('0x50')]['transaction'](function(_0xe50d3b){var _0x522308;return db['VoiceMusicOnHold'][_0x39a2('0x67')]({'where':{'id':_0xcda190[_0x39a2('0x48')]['id']}})[_0x39a2('0x26')](handleEntityNotFound(_0x576c3a,null))[_0x39a2('0x26')](function(_0xe91975){if(_0xe91975){_0x522308=_0xe91975;return _0xe91975['removeSound'](_0xcda190['params'][_0x39a2('0x70')]);}})[_0x39a2('0x26')](function(_0x2be543){if(_0x2be543){return db[_0x39a2('0x66')][_0x39a2('0x67')]({'where':{'id':_0xcda190['params']['id2']},'attributes':['id','name','save_name',_0x39a2('0x6e'),_0x39a2('0x71')],'raw':!![]});}})['then'](function(_0x5db9da){if(_0x5db9da){fs[_0x39a2('0x60')](path[_0x39a2('0x55')](_0x522308['directory'],util['format'](_0x39a2('0x72'),_0x5db9da[_0x39a2('0x2d')],_0x5db9da['converted_format'])));return _0x5db9da;}})['catch'](function(_0x598e7f){throw new db[(_0x39a2('0x62'))][(_0x39a2('0x63'))](_0x598e7f[_0x39a2('0x64')]);});})[_0x39a2('0x26')](handleEntityNotFound(_0x576c3a,null))[_0x39a2('0x26')](respondWithStatusCode(_0x576c3a,0xcc))[_0x39a2('0x4d')](handleError(_0x576c3a,null));};exports[_0x39a2('0x73')]=function(_0x4d29d5,_0xa821d1,_0x31c32f){var _0x474b1d={};var _0xc3d159={};var _0x1bde8d;var _0x569638;return db[_0x39a2('0x2f')]['findOne']({'where':{'id':_0x4d29d5[_0x39a2('0x48')]['id']}})[_0x39a2('0x26')](handleEntityNotFound(_0xa821d1,null))[_0x39a2('0x26')](function(_0x35aa47){if(_0x35aa47){_0x1bde8d=_0x35aa47;_0xc3d159['model']=_['keys'](db[_0x39a2('0x66')][_0x39a2('0x30')]);_0xc3d159[_0x39a2('0x36')]=_[_0x39a2('0x49')](_0x4d29d5['query']);_0xc3d159[_0x39a2('0x37')]=_['intersection'](_0xc3d159[_0x39a2('0x34')],_0xc3d159[_0x39a2('0x36')]);_0x474b1d['attributes']=_[_0x39a2('0x39')](_0xc3d159['model'],qs['fields'](_0x4d29d5[_0x39a2('0x36')][_0x39a2('0x3a')]));_0x474b1d[_0x39a2('0x38')]=_0x474b1d[_0x39a2('0x38')]['length']?_0x474b1d[_0x39a2('0x38')]:_0xc3d159[_0x39a2('0x34')];_0x474b1d[_0x39a2('0x74')]=qs[_0x39a2('0x3e')](_0x4d29d5['query'][_0x39a2('0x3e')]);_0x474b1d[_0x39a2('0x41')]=qs[_0x39a2('0x37')](_['pick'](_0x4d29d5[_0x39a2('0x36')],_0xc3d159[_0x39a2('0x37')]));if(_0x4d29d5[_0x39a2('0x36')]['filter']){_0x474b1d[_0x39a2('0x41')]=_[_0x39a2('0x42')](_0x474b1d['where'],{'$or':_[_0x39a2('0x35')](_0x474b1d['attributes'],function(_0x48fba7){var _0x4d6c63={};_0x4d6c63[_0x48fba7]={'$like':'%'+_0x4d29d5[_0x39a2('0x36')][_0x39a2('0x40')]+'%'};return _0x4d6c63;})});}_0x474b1d=_['merge']({},_0x474b1d,_0x4d29d5[_0x39a2('0x4b')]);return _0x1bde8d['getSounds'](_0x474b1d);}})[_0x39a2('0x26')](function(_0x5b5a0d){if(_0x5b5a0d){_0x569638=_0x5b5a0d[_0x39a2('0x3b')];if(!_0x4d29d5['query'][_0x39a2('0x3c')](_0x39a2('0x3d'))){_0x474b1d[_0x39a2('0x1f')]=qs[_0x39a2('0x1f')](_0x4d29d5['query'][_0x39a2('0x1f')]);_0x474b1d[_0x39a2('0x1c')]=qs[_0x39a2('0x1c')](_0x4d29d5[_0x39a2('0x36')][_0x39a2('0x1c')]);}return _0x1bde8d[_0x39a2('0x73')](_0x474b1d);}})[_0x39a2('0x26')](function(_0xfe9f4c){if(_0xfe9f4c){return _0xfe9f4c?{'count':_0x569638,'rows':_0xfe9f4c}:null;}})[_0x39a2('0x26')](respondWithResult(_0xa821d1,null))[_0x39a2('0x4d')](handleError(_0xa821d1,null));}; \ No newline at end of file +var _0xbe20=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','keys','filters','intersection','query','attributes','model','fields','order','sort','filter','merge','where','VIRTUAL','includeAll','findAll','catch','show','params','length','include','options','find','body','create','sequelize','transaction','mode','files','directory','root','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','join','server/files/sounds/converted','basename','extname','server/files/moh','format','%s.%s','symlinkSync','message','removeSound','id2','createdAt','getSounds','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto'];(function(_0x60adb2,_0x45d26f){var _0x1c1d67=function(_0x78b0e7){while(--_0x78b0e7){_0x60adb2['push'](_0x60adb2['shift']());}};_0x1c1d67(++_0x45d26f);}(_0xbe20,0x1c0));var _0x0be2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbe20[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x0be2('0x0'));var rimraf=require(_0x0be2('0x1'));var zipdir=require(_0x0be2('0x2'));var jsonpatch=require(_0x0be2('0x3'));var rp=require('request-promise');var moment=require(_0x0be2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0be2('0x5'));var util=require('util');var path=require(_0x0be2('0x6'));var sox=require(_0x0be2('0x7'));var csv=require('to-csv');var ejs=require(_0x0be2('0x8'));var fs=require('fs');var fs_extra=require(_0x0be2('0x9'));var _=require('lodash');var squel=require(_0x0be2('0xa'));var crypto=require(_0x0be2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0be2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0be2('0xd'));var Redis=require(_0x0be2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0be2('0xf'));var as=require(_0x0be2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0be2('0x11'))(_0x0be2('0x12'));var utils=require(_0x0be2('0x13'));var config=require(_0x0be2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0be2('0x15'))['db'];function respondWithStatusCode(_0x4a8162,_0x1c9fd1){_0x1c9fd1=_0x1c9fd1||0xcc;return function(_0x5bbb82){if(_0x5bbb82){return _0x4a8162[_0x0be2('0x16')](_0x1c9fd1);}return _0x4a8162['status'](_0x1c9fd1)[_0x0be2('0x17')]();};}function respondWithResult(_0x3590db,_0x2da12e){_0x2da12e=_0x2da12e||0xc8;return function(_0x24ad9d){if(_0x24ad9d){return _0x3590db['status'](_0x2da12e)[_0x0be2('0x18')](_0x24ad9d);}};}function respondWithFilteredResult(_0x1a2204,_0x561325){return function(_0x5eba2f){if(_0x5eba2f){var _0x304303=typeof _0x561325['offset']===_0x0be2('0x19')&&typeof _0x561325[_0x0be2('0x1a')]===_0x0be2('0x19');var _0x49e0a1=_0x5eba2f[_0x0be2('0x1b')];var _0x1164e=_0x304303?0x0:_0x561325[_0x0be2('0x1c')];var _0x116615=_0x304303?_0x5eba2f[_0x0be2('0x1b')]:_0x561325[_0x0be2('0x1c')]+_0x561325[_0x0be2('0x1a')];var _0x5891b9;if(_0x116615>=_0x49e0a1){_0x116615=_0x49e0a1;_0x5891b9=0xc8;}else{_0x5891b9=0xce;}_0x1a2204[_0x0be2('0x1d')](_0x5891b9);return _0x1a2204[_0x0be2('0x1e')](_0x0be2('0x1f'),_0x1164e+'-'+_0x116615+'/'+_0x49e0a1)[_0x0be2('0x18')](_0x5eba2f);}return null;};}function patchUpdates(_0x432691){return function(_0x1db5bf){try{jsonpatch[_0x0be2('0x20')](_0x1db5bf,_0x432691,!![]);}catch(_0x1a1cc9){return BPromise[_0x0be2('0x21')](_0x1a1cc9);}return _0x1db5bf[_0x0be2('0x22')]();};}function saveUpdates(_0x5abf05,_0x266dfc){return function(_0x5be011){if(_0x5be011){return _0x5be011[_0x0be2('0x23')](_0x5abf05)[_0x0be2('0x24')](function(_0x46fe52){return _0x46fe52;});}return null;};}function removeEntity(_0x1626bc,_0x38d821){return function(_0x10a6d9){if(_0x10a6d9){return _0x10a6d9[_0x0be2('0x25')]()['then'](function(){var _0x11787b=_0x10a6d9[_0x0be2('0x26')]({'plain':!![]});var _0x1c8123=_0x0be2('0x27');return db[_0x0be2('0x28')]['destroy']({'where':{'type':_0x1c8123,'resourceId':_0x11787b['id']}})[_0x0be2('0x24')](function(){return _0x10a6d9;});})[_0x0be2('0x24')](function(){_0x1626bc[_0x0be2('0x1d')](0xcc)[_0x0be2('0x17')]();});}};}function handleEntityNotFound(_0x1ab176,_0x45ad93){return function(_0x1aae94){if(!_0x1aae94){_0x1ab176[_0x0be2('0x16')](0x194);}return _0x1aae94;};}function handleError(_0x361841,_0x5b36f1){_0x5b36f1=_0x5b36f1||0x1f4;return function(_0x109763){logger[_0x0be2('0x29')](_0x109763[_0x0be2('0x2a')]);if(_0x109763[_0x0be2('0x2b')]){delete _0x109763[_0x0be2('0x2b')];}_0x361841[_0x0be2('0x1d')](_0x5b36f1)[_0x0be2('0x2c')](_0x109763);};}exports[_0x0be2('0x2d')]=function(_0x3e0534,_0x173991){var _0x28fc93={},_0x1e90fc={},_0x5cea9e={'count':0x0,'rows':[]};var _0x549473=_[_0x0be2('0x2e')](db[_0x0be2('0x2f')][_0x0be2('0x30')],function(_0x3cd293){return{'name':_0x3cd293['fieldName'],'type':_0x3cd293[_0x0be2('0x31')][_0x0be2('0x32')]};});_0x1e90fc['model']=_[_0x0be2('0x2e')](_0x549473,_0x0be2('0x2b'));_0x1e90fc['query']=_[_0x0be2('0x33')](_0x3e0534['query']);_0x1e90fc[_0x0be2('0x34')]=_[_0x0be2('0x35')](_0x1e90fc['model'],_0x1e90fc[_0x0be2('0x36')]);_0x28fc93[_0x0be2('0x37')]=_['intersection'](_0x1e90fc[_0x0be2('0x38')],qs[_0x0be2('0x39')](_0x3e0534[_0x0be2('0x36')][_0x0be2('0x39')]));_0x28fc93[_0x0be2('0x37')]=_0x28fc93[_0x0be2('0x37')]['length']?_0x28fc93[_0x0be2('0x37')]:_0x1e90fc[_0x0be2('0x38')];if(!_0x3e0534[_0x0be2('0x36')]['hasOwnProperty']('nolimit')){_0x28fc93['limit']=qs[_0x0be2('0x1a')](_0x3e0534[_0x0be2('0x36')][_0x0be2('0x1a')]);_0x28fc93[_0x0be2('0x1c')]=qs[_0x0be2('0x1c')](_0x3e0534[_0x0be2('0x36')][_0x0be2('0x1c')]);}_0x28fc93[_0x0be2('0x3a')]=qs['sort'](_0x3e0534[_0x0be2('0x36')][_0x0be2('0x3b')]);delete _0x3e0534[_0x0be2('0x36')][_0x0be2('0x3b')];_0x28fc93['where']=qs['filters'](_['pick'](_0x3e0534[_0x0be2('0x36')],_0x1e90fc[_0x0be2('0x34')]),_0x549473);if(_0x3e0534[_0x0be2('0x36')][_0x0be2('0x3c')]){_0x28fc93['where']=_[_0x0be2('0x3d')](_0x28fc93[_0x0be2('0x3e')],{'$or':_[_0x0be2('0x2e')](_0x549473,function(_0x4ae6d8){if(_0x4ae6d8[_0x0be2('0x31')]!==_0x0be2('0x3f')){var _0x542a12={};_0x542a12[_0x4ae6d8[_0x0be2('0x2b')]]={'$like':'%'+_0x3e0534[_0x0be2('0x36')][_0x0be2('0x3c')]+'%'};return _0x542a12;}})});}_0x28fc93=_[_0x0be2('0x3d')]({},_0x28fc93,_0x3e0534['options']);var _0x46033f={'where':_0x28fc93['where']};return db[_0x0be2('0x2f')][_0x0be2('0x1b')](_0x46033f)[_0x0be2('0x24')](function(_0x1b1c97){_0x5cea9e['count']=_0x1b1c97;if(_0x3e0534[_0x0be2('0x36')][_0x0be2('0x40')]){_0x28fc93['include']=[{'all':!![]}];}return db[_0x0be2('0x2f')][_0x0be2('0x41')](_0x28fc93);})[_0x0be2('0x24')](function(_0x4b2931){_0x5cea9e['rows']=_0x4b2931;return _0x5cea9e;})[_0x0be2('0x24')](respondWithFilteredResult(_0x173991,_0x28fc93))[_0x0be2('0x42')](handleError(_0x173991,null));};exports[_0x0be2('0x43')]=function(_0x3d33d0,_0x53b4d2){var _0x5bc22b={'raw':![],'where':{'id':_0x3d33d0[_0x0be2('0x44')]['id']}},_0x5c16d0={};_0x5c16d0[_0x0be2('0x38')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x5c16d0[_0x0be2('0x36')]=_[_0x0be2('0x33')](_0x3d33d0[_0x0be2('0x36')]);_0x5c16d0['filters']=_['intersection'](_0x5c16d0[_0x0be2('0x38')],_0x5c16d0['query']);_0x5bc22b[_0x0be2('0x37')]=_['intersection'](_0x5c16d0[_0x0be2('0x38')],qs['fields'](_0x3d33d0['query'][_0x0be2('0x39')]));_0x5bc22b['attributes']=_0x5bc22b[_0x0be2('0x37')][_0x0be2('0x45')]?_0x5bc22b[_0x0be2('0x37')]:_0x5c16d0[_0x0be2('0x38')];if(_0x3d33d0[_0x0be2('0x36')]['includeAll']){_0x5bc22b[_0x0be2('0x46')]=[{'all':!![]}];}_0x5bc22b=_['merge']({},_0x5bc22b,_0x3d33d0[_0x0be2('0x47')]);return db[_0x0be2('0x2f')][_0x0be2('0x48')](_0x5bc22b)[_0x0be2('0x24')](handleEntityNotFound(_0x53b4d2,null))[_0x0be2('0x24')](respondWithResult(_0x53b4d2,null))[_0x0be2('0x42')](handleError(_0x53b4d2,null));};exports[_0x0be2('0x23')]=function(_0x2257f5,_0x13850e){if(_0x2257f5['body']['id']){delete _0x2257f5['body']['id'];}return db[_0x0be2('0x2f')][_0x0be2('0x48')]({'where':{'id':_0x2257f5[_0x0be2('0x44')]['id']}})[_0x0be2('0x24')](handleEntityNotFound(_0x13850e,null))['then'](saveUpdates(_0x2257f5[_0x0be2('0x49')],null))['then'](respondWithResult(_0x13850e,null))[_0x0be2('0x42')](handleError(_0x13850e,null));};exports[_0x0be2('0x4a')]=function(_0x24d91a,_0x42168a,_0x177a7d){return db[_0x0be2('0x4b')][_0x0be2('0x4c')](function(_0x39dbe5){if(_0x24d91a[_0x0be2('0x49')][_0x0be2('0x4d')]===_0x0be2('0x4e')){_0x24d91a['body'][_0x0be2('0x4f')]=path['join'](config[_0x0be2('0x50')],'server/files/moh',_0x24d91a['body']['name']);}return db['VoiceMusicOnHold'][_0x0be2('0x4a')](_0x24d91a['body'],{'transaction':_0x39dbe5})[_0x0be2('0x24')](function(_0x2ad9a9){if(_0x24d91a[_0x0be2('0x49')][_0x0be2('0x4d')]===_0x0be2('0x4e')){fs[_0x0be2('0x51')](_0x2ad9a9['directory'],parseInt(_0x0be2('0x52'),0x8));}var _0x236ebe=_0x24d91a[_0x0be2('0x53')][_0x0be2('0x26')]({'plain':!![]});if(!_0x236ebe)throw new Error(_0x0be2('0x54'));if(_0x236ebe[_0x0be2('0x55')]===_0x0be2('0x53')){var _0x2478a3=_0x2ad9a9[_0x0be2('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x0be2('0x48')]({'where':{'name':_0x0be2('0x27'),'userProfileId':_0x236ebe[_0x0be2('0x56')]},'raw':!![]})[_0x0be2('0x24')](function(_0x3a1408){if(_0x3a1408&&_0x3a1408[_0x0be2('0x57')]===0x0){return db[_0x0be2('0x28')]['create']({'name':_0x2478a3[_0x0be2('0x2b')],'resourceId':_0x2478a3['id'],'type':_0x3a1408[_0x0be2('0x2b')],'sectionId':_0x3a1408['id']},{})[_0x0be2('0x24')](function(){return _0x2ad9a9;});}else{return _0x2ad9a9;}})[_0x0be2('0x42')](function(_0x522e99){logger['error'](_0x0be2('0x58'),_0x522e99);});}return _0x2ad9a9;});})[_0x0be2('0x24')](respondWithResult(_0x42168a,0xc9))['catch'](handleError(_0x42168a,null));};exports[_0x0be2('0x25')]=function(_0x365904,_0x2ec706,_0x2aae80){var _0x2cb11b;return db[_0x0be2('0x2f')][_0x0be2('0x48')]({'where':{'id':_0x365904[_0x0be2('0x44')]['id']}})['then'](function(_0x7cac29){if(_0x7cac29){return db[_0x0be2('0x4b')][_0x0be2('0x4c')](function(_0x1e5ddc){return _0x7cac29['destroy']({'transaction':_0x1e5ddc,'raw':!![]})[_0x0be2('0x24')](function(_0x37e70e){if(_0x37e70e[_0x0be2('0x4f')]){fs[_0x0be2('0x59')](_0x37e70e[_0x0be2('0x4f')])[_0x0be2('0x5a')](function(_0x33ea21){fs[_0x0be2('0x5b')](path['join'](_0x37e70e[_0x0be2('0x4f')],_0x33ea21));});fs[_0x0be2('0x5c')](_0x37e70e[_0x0be2('0x4f')]);}return _0x37e70e;});})[_0x0be2('0x42')](function(_0x5bf849){throw new db[(_0x0be2('0x5d'))][(_0x0be2('0x5e'))](_0x5bf849['message']);});}})['then'](handleEntityNotFound(_0x2ec706,null))['then'](removeEntity(_0x2ec706,null))[_0x0be2('0x42')](handleError(_0x2ec706,null));};exports[_0x0be2('0x5f')]=function(_0xc88365,_0x5400bc,_0x3fc6f8){return db[_0x0be2('0x4b')][_0x0be2('0x4c')](function(_0x3f3275){var _0x34ed4e;return db['VoiceMusicOnHold']['find']({'where':{'id':_0xc88365['params']['id']}})['then'](function(_0xefe79a){if(_0xefe79a){_0x34ed4e=_0xefe79a;return _0xefe79a[_0x0be2('0x5f')](_0xc88365[_0x0be2('0x49')]['id'],{'transaction':_0x3f3275});}})[_0x0be2('0x24')](function(_0x2796be){if(_0x2796be){return db[_0x0be2('0x60')][_0x0be2('0x61')]({'where':{'id':_0xc88365[_0x0be2('0x49')]['id']},'attributes':['id','name',_0x0be2('0x62'),_0x0be2('0x63'),'createdAt'],'raw':!![]});}})[_0x0be2('0x24')](function(_0x4c712a){if(_0x4c712a){var _0x4b95a4=path[_0x0be2('0x64')](config[_0x0be2('0x50')],_0x0be2('0x65'),util['format']('%s.%s',path[_0x0be2('0x66')](_0x4c712a[_0x0be2('0x62')],path[_0x0be2('0x67')](_0x4c712a[_0x0be2('0x62')])),_0x4c712a[_0x0be2('0x63')]));var _0x3522d0=path[_0x0be2('0x64')](config[_0x0be2('0x50')],_0x0be2('0x68'),_0x34ed4e['name'],util[_0x0be2('0x69')](_0x0be2('0x6a'),_0x4c712a[_0x0be2('0x2b')],_0x4c712a[_0x0be2('0x63')]));fs[_0x0be2('0x6b')](_0x4b95a4,_0x3522d0);return _0x4c712a;}})[_0x0be2('0x42')](function(_0x58c917){throw new db[(_0x0be2('0x5d'))][(_0x0be2('0x5e'))](_0x58c917[_0x0be2('0x6c')]);});})[_0x0be2('0x24')](handleEntityNotFound(_0x5400bc,null))[_0x0be2('0x24')](respondWithResult(_0x5400bc,0xc9))[_0x0be2('0x42')](handleError(_0x5400bc,null));};exports[_0x0be2('0x6d')]=function(_0x58961d,_0x2781a7,_0x45fd41){return db['sequelize'][_0x0be2('0x4c')](function(_0x10efe2){var _0x1bcdf2;return db[_0x0be2('0x2f')]['findOne']({'where':{'id':_0x58961d['params']['id']}})['then'](handleEntityNotFound(_0x2781a7,null))[_0x0be2('0x24')](function(_0x1d8f5c){if(_0x1d8f5c){_0x1bcdf2=_0x1d8f5c;return _0x1d8f5c[_0x0be2('0x6d')](_0x58961d['params'][_0x0be2('0x6e')]);}})[_0x0be2('0x24')](function(_0x3b51aa){if(_0x3b51aa){return db[_0x0be2('0x60')]['findOne']({'where':{'id':_0x58961d[_0x0be2('0x44')][_0x0be2('0x6e')]},'attributes':['id',_0x0be2('0x2b'),_0x0be2('0x62'),_0x0be2('0x63'),_0x0be2('0x6f')],'raw':!![]});}})[_0x0be2('0x24')](function(_0x2951e9){if(_0x2951e9){fs['unlinkSync'](path[_0x0be2('0x64')](_0x1bcdf2[_0x0be2('0x4f')],util[_0x0be2('0x69')]('%s.%s',_0x2951e9[_0x0be2('0x2b')],_0x2951e9['converted_format'])));return _0x2951e9;}})['catch'](function(_0x1f29d4){throw new db[(_0x0be2('0x5d'))][(_0x0be2('0x5e'))](_0x1f29d4['message']);});})[_0x0be2('0x24')](handleEntityNotFound(_0x2781a7,null))[_0x0be2('0x24')](respondWithStatusCode(_0x2781a7,0xcc))[_0x0be2('0x42')](handleError(_0x2781a7,null));};exports[_0x0be2('0x70')]=function(_0x4fbca4,_0xddc8e0,_0x1f64de){var _0xa582a8={};var _0x30fe5e={};var _0x1a92a9;var _0x5c3af4;return db[_0x0be2('0x2f')][_0x0be2('0x61')]({'where':{'id':_0x4fbca4['params']['id']}})[_0x0be2('0x24')](handleEntityNotFound(_0xddc8e0,null))[_0x0be2('0x24')](function(_0x2cefd1){if(_0x2cefd1){_0x1a92a9=_0x2cefd1;_0x30fe5e[_0x0be2('0x38')]=_[_0x0be2('0x33')](db['Sound']['rawAttributes']);_0x30fe5e[_0x0be2('0x36')]=_['keys'](_0x4fbca4[_0x0be2('0x36')]);_0x30fe5e['filters']=_[_0x0be2('0x35')](_0x30fe5e[_0x0be2('0x38')],_0x30fe5e[_0x0be2('0x36')]);_0xa582a8['attributes']=_['intersection'](_0x30fe5e['model'],qs[_0x0be2('0x39')](_0x4fbca4['query'][_0x0be2('0x39')]));_0xa582a8[_0x0be2('0x37')]=_0xa582a8['attributes'][_0x0be2('0x45')]?_0xa582a8[_0x0be2('0x37')]:_0x30fe5e[_0x0be2('0x38')];_0xa582a8[_0x0be2('0x3a')]=qs[_0x0be2('0x3b')](_0x4fbca4['query'][_0x0be2('0x3b')]);_0xa582a8[_0x0be2('0x3e')]=qs[_0x0be2('0x34')](_['pick'](_0x4fbca4[_0x0be2('0x36')],_0x30fe5e['filters']));if(_0x4fbca4['query'][_0x0be2('0x3c')]){_0xa582a8[_0x0be2('0x3e')]=_[_0x0be2('0x3d')](_0xa582a8[_0x0be2('0x3e')],{'$or':_[_0x0be2('0x2e')](_0xa582a8[_0x0be2('0x37')],function(_0x9017b6){var _0x3e2056={};_0x3e2056[_0x9017b6]={'$like':'%'+_0x4fbca4[_0x0be2('0x36')][_0x0be2('0x3c')]+'%'};return _0x3e2056;})});}_0xa582a8=_[_0x0be2('0x3d')]({},_0xa582a8,_0x4fbca4[_0x0be2('0x47')]);return _0x1a92a9['getSounds'](_0xa582a8);}})['then'](function(_0x3ed3ad){if(_0x3ed3ad){_0x5c3af4=_0x3ed3ad[_0x0be2('0x45')];if(!_0x4fbca4[_0x0be2('0x36')][_0x0be2('0x71')](_0x0be2('0x72'))){_0xa582a8['limit']=qs[_0x0be2('0x1a')](_0x4fbca4['query']['limit']);_0xa582a8[_0x0be2('0x1c')]=qs['offset'](_0x4fbca4[_0x0be2('0x36')][_0x0be2('0x1c')]);}return _0x1a92a9['getSounds'](_0xa582a8);}})['then'](function(_0x2ee4de){if(_0x2ee4de){return _0x2ee4de?{'count':_0x5c3af4,'rows':_0x2ee4de}:null;}})['then'](respondWithResult(_0xddc8e0,null))[_0x0be2('0x42')](handleError(_0xddc8e0,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 2d9a69a..7784306 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 _0x041d=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x041d,0xce));var _0xd041=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x041d[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0xd041('0x0'));var util=require('util');var logger=require(_0xd041('0x1'))('api');var moment=require(_0xd041('0x2'));var BPromise=require('bluebird');var rp=require(_0xd041('0x3'));var fs=require('fs');var path=require(_0xd041('0x4'));var rimraf=require(_0xd041('0x5'));var config=require(_0xd041('0x6'));var attributes=require(_0xd041('0x7'));module['exports']=function(_0x3cefa7,_0x1acf89){return _0x3cefa7[_0xd041('0x8')](_0xd041('0x9'),attributes,{'tableName':_0xd041('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc232=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1f2bf2,_0x11e6bc){var _0x666b30=function(_0x44d0d8){while(--_0x44d0d8){_0x1f2bf2['push'](_0x1f2bf2['shift']());}};_0x666b30(++_0x11e6bc);}(_0xc232,0xd8));var _0x2c23=function(_0x55f6e5,_0x3ab6f6){_0x55f6e5=_0x55f6e5-0x0;var _0x6255ff=_0xc232[_0x55f6e5];return _0x6255ff;};'use strict';var _=require(_0x2c23('0x0'));var util=require(_0x2c23('0x1'));var logger=require(_0x2c23('0x2'))('api');var moment=require(_0x2c23('0x3'));var BPromise=require(_0x2c23('0x4'));var rp=require(_0x2c23('0x5'));var fs=require('fs');var path=require(_0x2c23('0x6'));var rimraf=require(_0x2c23('0x7'));var config=require(_0x2c23('0x8'));var attributes=require(_0x2c23('0x9'));module[_0x2c23('0xa')]=function(_0x5a7fff,_0x3f509b){return _0x5a7fff[_0x2c23('0xb')](_0x2c23('0xc'),attributes,{'tableName':_0x2c23('0xd'),'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 948862d..13bffee 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(_0x3ef942,_0xdd102b){var _0x45dd14=function(_0xfd1e91){while(--_0xfd1e91){_0x3ef942['push'](_0x3ef942['shift']());}};_0x45dd14(++_0xdd102b);}(_0xe706,0xa3));var _0x6e70=function(_0x2808d0,_0x221a9f){_0x2808d0=_0x2808d0-0x0;var _0x3aef7c=_0xe706[_0x2808d0];return _0x3aef7c;};'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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x495fe8,_0x43cbe6){var _0x420ce5=function(_0xd60133){while(--_0xd60133){_0x495fe8['push'](_0x495fe8['shift']());}};_0x420ce5(++_0x43cbe6);}(_0x34e8,0x12c));var _0x834e=function(_0x3805e0,_0x370e92){_0x3805e0=_0x3805e0-0x0;var _0x321bbc=_0x34e8[_0x3805e0];return _0x321bbc;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index cf34cea..7bfd413 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 _0xe5d5=['index','/describe','describe','/:id','show','/:id/users','getAgents','getTeams','post','/:id/teams','addTeams','put','delete','destroy','removeAgents','removeTeams','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x1035ab,_0x2f9249){var _0x451ef1=function(_0x179cbb){while(--_0x179cbb){_0x1035ab['push'](_0x1035ab['shift']());}};_0x451ef1(++_0x2f9249);}(_0xe5d5,0x156));var _0x5e5d=function(_0x108812,_0xb6d16c){_0x108812=_0x108812-0x0;var _0x2d8133=_0xe5d5[_0x108812];return _0x2d8133;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e5d('0x0'));var timeout=require('connect-timeout');var express=require(_0x5e5d('0x1'));var router=express['Router']();var fs_extra=require(_0x5e5d('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5e5d('0x3'));var config=require(_0x5e5d('0x4'));var controller=require(_0x5e5d('0x5'));router[_0x5e5d('0x6')]('/',auth[_0x5e5d('0x7')](),controller[_0x5e5d('0x8')]);router[_0x5e5d('0x6')](_0x5e5d('0x9'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0xa')]);router[_0x5e5d('0x6')](_0x5e5d('0xb'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0xc')]);router['get'](_0x5e5d('0xd'),auth['isAuthenticated'](),controller[_0x5e5d('0xe')]);router[_0x5e5d('0x6')]('/:id/teams',auth[_0x5e5d('0x7')](),controller[_0x5e5d('0xf')]);router[_0x5e5d('0x10')]('/',auth[_0x5e5d('0x7')](),controller['create']);router['post'](_0x5e5d('0xd'),auth[_0x5e5d('0x7')](),controller['addAgents']);router[_0x5e5d('0x10')](_0x5e5d('0x11'),auth['isAuthenticated'](),controller[_0x5e5d('0x12')]);router[_0x5e5d('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5e5d('0x14')](_0x5e5d('0xb'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0x15')]);router['delete'](_0x5e5d('0xd'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0x16')]);router[_0x5e5d('0x14')](_0x5e5d('0x11'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0x17')]);module[_0x5e5d('0x18')]=router; \ No newline at end of file +var _0x25fa=['removeTeams','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','post','addAgents','addTeams','put','update','delete','removeAgents'];(function(_0x247902,_0x26d9ca){var _0x4f8697=function(_0x4d2dec){while(--_0x4d2dec){_0x247902['push'](_0x247902['shift']());}};_0x4f8697(++_0x26d9ca);}(_0x25fa,0x109));var _0xa25f=function(_0x4bd2c2,_0x1a9192){_0x4bd2c2=_0x4bd2c2-0x0;var _0x5252a4=_0x25fa[_0x4bd2c2];return _0x5252a4;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var fs_extra=require(_0xa25f('0x4'));var auth=require(_0xa25f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa25f('0x6'));router['get']('/',auth[_0xa25f('0x7')](),controller[_0xa25f('0x8')]);router[_0xa25f('0x9')](_0xa25f('0xa'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xb')]);router[_0xa25f('0x9')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['show']);router[_0xa25f('0x9')](_0xa25f('0xd'),auth['isAuthenticated'](),controller[_0xa25f('0xe')]);router[_0xa25f('0x9')](_0xa25f('0xf'),auth[_0xa25f('0x7')](),controller['getTeams']);router[_0xa25f('0x10')]('/',auth[_0xa25f('0x7')](),controller['create']);router[_0xa25f('0x10')](_0xa25f('0xd'),auth['isAuthenticated'](),controller[_0xa25f('0x11')]);router[_0xa25f('0x10')](_0xa25f('0xf'),auth[_0xa25f('0x7')](),controller[_0xa25f('0x12')]);router[_0xa25f('0x13')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller[_0xa25f('0x14')]);router[_0xa25f('0x15')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['destroy']);router[_0xa25f('0x15')](_0xa25f('0xd'),auth[_0xa25f('0x7')](),controller[_0xa25f('0x16')]);router[_0xa25f('0x15')](_0xa25f('0xf'),auth['isAuthenticated'](),controller[_0xa25f('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a8a00de..b14a4d5 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 _0x383c=['name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x383c,0x1a5));var _0xc383=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x383c[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xc383('0x0'));module[_0xc383('0x1')]={'name':{'type':Sequelize[_0xc383('0x2')],'allowNull':![],'unique':_0xc383('0x3')},'prefix':{'type':Sequelize[_0xc383('0x4')],'get':function(_0x51622b){return _0xc383('0x5')+this[_0xc383('0x6')](_0xc383('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xc383('0x7')]}}; \ No newline at end of file +var _0x6e05=['getDataValue','sequelize','STRING','name','VIRTUAL'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x6e05,0xf6));var _0x56e0=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x6e05[_0x2cd1fb];return _0x48fd2b;};'use strict';var Sequelize=require(_0x56e0('0x0'));module['exports']={'name':{'type':Sequelize[_0x56e0('0x1')],'allowNull':![],'unique':_0x56e0('0x2')},'prefix':{'type':Sequelize[_0x56e0('0x3')],'get':function(_0x35c4a8){return'system-'+this[_0x56e0('0x4')](_0x56e0('0x2'))+'-';}},'description':{'type':Sequelize[_0x56e0('0x1')]},'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 746fb59..26dac8e 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 _0x34b7=['fieldName','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','catch','fields','includeAll','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','order','getTeams','Team','addTeams','findAll','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','SELECT','every','TeamId','all','compact','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','index','map','VoicePrefix','rawAttributes'];(function(_0x5ed173,_0x278773){var _0x5ac8db=function(_0x4ef201){while(--_0x4ef201){_0x5ed173['push'](_0x5ed173['shift']());}};_0x5ac8db(++_0x278773);}(_0x34b7,0x196));var _0x734b=function(_0x1b24eb,_0x39029e){_0x1b24eb=_0x1b24eb-0x0;var _0x157b17=_0x34b7[_0x1b24eb];return _0x157b17;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];config[_0x734b('0x18')]=_[_0x734b('0x19')](config[_0x734b('0x18')],{'host':_0x734b('0x1a'),'port':0x18eb});var socket=require(_0x734b('0x1b'))(new Redis(config['redis']));require(_0x734b('0x1c'))[_0x734b('0x1d')](socket);function respondWithStatusCode(_0x47791c,_0xd1ab2a){_0xd1ab2a=_0xd1ab2a||0xcc;return function(_0x19f427){if(_0x19f427){return _0x47791c[_0x734b('0x1e')](_0xd1ab2a);}return _0x47791c[_0x734b('0x1f')](_0xd1ab2a)[_0x734b('0x20')]();};}function respondWithResult(_0xa6d111,_0x4b8c63){_0x4b8c63=_0x4b8c63||0xc8;return function(_0x42407a){if(_0x42407a){return _0xa6d111['status'](_0x4b8c63)[_0x734b('0x21')](_0x42407a);}};}function respondWithFilteredResult(_0x2ee290,_0xfb661a){return function(_0x5edbe9){if(_0x5edbe9){var _0x4d3b9c=typeof _0xfb661a['offset']===_0x734b('0x22')&&typeof _0xfb661a[_0x734b('0x23')]===_0x734b('0x22');var _0x41ba87=_0x5edbe9[_0x734b('0x24')];var _0xfe567d=_0x4d3b9c?0x0:_0xfb661a[_0x734b('0x25')];var _0x6572ee=_0x4d3b9c?_0x5edbe9[_0x734b('0x24')]:_0xfb661a[_0x734b('0x25')]+_0xfb661a[_0x734b('0x23')];var _0x3d0ffd;if(_0x6572ee>=_0x41ba87){_0x6572ee=_0x41ba87;_0x3d0ffd=0xc8;}else{_0x3d0ffd=0xce;}_0x2ee290[_0x734b('0x1f')](_0x3d0ffd);return _0x2ee290[_0x734b('0x26')]('Content-Range',_0xfe567d+'-'+_0x6572ee+'/'+_0x41ba87)[_0x734b('0x21')](_0x5edbe9);}return null;};}function patchUpdates(_0x7856d7){return function(_0x4f98a7){try{jsonpatch[_0x734b('0x27')](_0x4f98a7,_0x7856d7,!![]);}catch(_0x1f81de){return BPromise[_0x734b('0x28')](_0x1f81de);}return _0x4f98a7[_0x734b('0x29')]();};}function saveUpdates(_0x46d432,_0x26d118){return function(_0x26eccf){if(_0x26eccf){return _0x26eccf[_0x734b('0x2a')](_0x46d432)[_0x734b('0x2b')](function(_0x3abbe6){return _0x3abbe6;});}return null;};}function removeEntity(_0x44ffa9,_0x148abe){return function(_0x3bb651){if(_0x3bb651){return _0x3bb651['destroy']()['then'](function(){var _0x13cc5a=_0x3bb651[_0x734b('0x2c')]({'plain':!![]});var _0x47a0a9=_0x734b('0x2d');return db[_0x734b('0x2e')][_0x734b('0x2f')]({'where':{'type':_0x47a0a9,'resourceId':_0x13cc5a['id']}})[_0x734b('0x2b')](function(){return _0x3bb651;});})[_0x734b('0x2b')](function(){_0x44ffa9[_0x734b('0x1f')](0xcc)[_0x734b('0x20')]();});}};}function handleEntityNotFound(_0x5c6c5d,_0x1f3652){return function(_0x436efe){if(!_0x436efe){_0x5c6c5d[_0x734b('0x1e')](0x194);}return _0x436efe;};}function handleError(_0x241c89,_0x729431){_0x729431=_0x729431||0x1f4;return function(_0x427c36){logger[_0x734b('0x30')](_0x427c36[_0x734b('0x31')]);if(_0x427c36[_0x734b('0x32')]){delete _0x427c36[_0x734b('0x32')];}_0x241c89['status'](_0x729431)[_0x734b('0x33')](_0x427c36);};}exports[_0x734b('0x34')]=function(_0x57f792,_0xbbe037){var _0x3cfce2={},_0xf4ef21={},_0x2fe7d5={'count':0x0,'rows':[]};var _0x21cb04=_[_0x734b('0x35')](db[_0x734b('0x36')][_0x734b('0x37')],function(_0x1e53fb){return{'name':_0x1e53fb[_0x734b('0x38')],'type':_0x1e53fb[_0x734b('0x39')][_0x734b('0x3a')]};});_0xf4ef21[_0x734b('0x3b')]=_[_0x734b('0x35')](_0x21cb04,_0x734b('0x32'));_0xf4ef21['query']=_[_0x734b('0x3c')](_0x57f792['query']);_0xf4ef21[_0x734b('0x3d')]=_[_0x734b('0x3e')](_0xf4ef21[_0x734b('0x3b')],_0xf4ef21[_0x734b('0x3f')]);_0x3cfce2[_0x734b('0x40')]=_[_0x734b('0x3e')](_0xf4ef21['model'],qs['fields'](_0x57f792[_0x734b('0x3f')]['fields']));_0x3cfce2[_0x734b('0x40')]=_0x3cfce2['attributes'][_0x734b('0x41')]?_0x3cfce2['attributes']:_0xf4ef21[_0x734b('0x3b')];if(!_0x57f792['query'][_0x734b('0x42')](_0x734b('0x43'))){_0x3cfce2[_0x734b('0x23')]=qs[_0x734b('0x23')](_0x57f792[_0x734b('0x3f')][_0x734b('0x23')]);_0x3cfce2[_0x734b('0x25')]=qs['offset'](_0x57f792[_0x734b('0x3f')][_0x734b('0x25')]);}_0x3cfce2['order']=qs[_0x734b('0x44')](_0x57f792[_0x734b('0x3f')][_0x734b('0x44')]);_0x3cfce2[_0x734b('0x45')]=qs['filters'](_[_0x734b('0x46')](_0x57f792[_0x734b('0x3f')],_0xf4ef21['filters']),_0x21cb04);if(_0x57f792[_0x734b('0x3f')][_0x734b('0x47')]){_0x3cfce2['where']=_[_0x734b('0x48')](_0x3cfce2[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x21cb04,function(_0x300aaa){if(_0x300aaa['type']!=='VIRTUAL'){var _0x2f6cee={};_0x2f6cee[_0x300aaa['name']]={'$like':'%'+_0x57f792['query'][_0x734b('0x47')]+'%'};return _0x2f6cee;}})});}_0x3cfce2=_['merge']({},_0x3cfce2,_0x57f792[_0x734b('0x49')]);var _0x4d77f0={'where':_0x3cfce2[_0x734b('0x45')]};return db[_0x734b('0x36')][_0x734b('0x24')](_0x4d77f0)['then'](function(_0x5cf3a0){_0x2fe7d5[_0x734b('0x24')]=_0x5cf3a0;if(_0x57f792['query']['includeAll']){_0x3cfce2[_0x734b('0x4a')]=[{'all':!![]}];}return db[_0x734b('0x36')]['findAll'](_0x3cfce2);})[_0x734b('0x2b')](function(_0x513f07){_0x2fe7d5[_0x734b('0x4b')]=_0x513f07;return _0x2fe7d5;})[_0x734b('0x2b')](respondWithFilteredResult(_0xbbe037,_0x3cfce2))[_0x734b('0x4c')](handleError(_0xbbe037,null));};exports['show']=function(_0xe8b116,_0x2455b9){var _0x3bca7e={'raw':![],'where':{'id':_0xe8b116['params']['id']}},_0x439139={};_0x439139['model']=_['keys'](db[_0x734b('0x36')]['rawAttributes']);_0x439139['query']=_[_0x734b('0x3c')](_0xe8b116['query']);_0x439139[_0x734b('0x3d')]=_[_0x734b('0x3e')](_0x439139[_0x734b('0x3b')],_0x439139[_0x734b('0x3f')]);_0x3bca7e['attributes']=_[_0x734b('0x3e')](_0x439139['model'],qs[_0x734b('0x4d')](_0xe8b116[_0x734b('0x3f')][_0x734b('0x4d')]));_0x3bca7e['attributes']=_0x3bca7e[_0x734b('0x40')]['length']?_0x3bca7e[_0x734b('0x40')]:_0x439139[_0x734b('0x3b')];if(_0xe8b116['query'][_0x734b('0x4e')]){_0x3bca7e[_0x734b('0x4a')]=[{'all':!![]}];}_0x3bca7e=_[_0x734b('0x48')]({},_0x3bca7e,_0xe8b116[_0x734b('0x49')]);return db[_0x734b('0x36')]['find'](_0x3bca7e)[_0x734b('0x2b')](handleEntityNotFound(_0x2455b9,null))['then'](respondWithResult(_0x2455b9,null))[_0x734b('0x4c')](handleError(_0x2455b9,null));};exports['destroy']=function(_0xd3c688,_0xa2fd9d){return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0xd3c688[_0x734b('0x50')]['id']}})['then'](handleEntityNotFound(_0xa2fd9d,null))['then'](removeEntity(_0xa2fd9d,null))['catch'](handleError(_0xa2fd9d,null));};exports[_0x734b('0x51')]=function(_0x1901a8,_0x541991){return db[_0x734b('0x36')][_0x734b('0x51')]()['then'](respondWithResult(_0x541991,null))[_0x734b('0x4c')](handleError(_0x541991,null));};exports[_0x734b('0x52')]=function(_0x44e6d2,_0x4d6501){var _0x2e95aa;return db[_0x734b('0x53')][_0x734b('0x54')](function(_0xe605be){return db['VoicePrefix'][_0x734b('0x52')](_0x44e6d2[_0x734b('0x55')],{'transaction':_0xe605be})[_0x734b('0x2b')](function(_0x432a96){_0x2e95aa=_0x432a96['get']({'plain':!![]});return db[_0x734b('0x56')]['find']({'where':{'id':_0x2e95aa[_0x734b('0x57')]},'raw':!![]})[_0x734b('0x2b')](function(_0x1f3594){return createVoicePrefixExtensions(_0x2e95aa,_0x1f3594,_0xe605be);});});})[_0x734b('0x2b')](function(){var _0x58d665=_0x44e6d2[_0x734b('0x58')][_0x734b('0x2c')]({'plain':!![]});if(!_0x58d665)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58d665['role']===_0x734b('0x58')){var _0x577735=_0x2e95aa;return db[_0x734b('0x59')][_0x734b('0x4f')]({'where':{'name':_0x734b('0x2d'),'userProfileId':_0x58d665['userProfileId']},'raw':!![]})[_0x734b('0x2b')](function(_0x588cd8){if(_0x588cd8&&_0x588cd8[_0x734b('0x5a')]===0x0){return db[_0x734b('0x2e')][_0x734b('0x52')]({'name':_0x577735[_0x734b('0x32')],'resourceId':_0x577735['id'],'type':_0x588cd8['name'],'sectionId':_0x588cd8['id']},{})[_0x734b('0x2b')](function(){return _0x2e95aa;});}else{return _0x2e95aa;}})['catch'](function(_0x6b198c){logger[_0x734b('0x30')](_0x734b('0x5b'),_0x6b198c);throw _0x6b198c;});}return _0x2e95aa;})['then'](respondWithResult(_0x4d6501,null))[_0x734b('0x4c')](handleError(_0x4d6501,null));};function Extension(_0x55c699,_0x2c81a1,_0x17a217,_0x3ec705){this[_0x734b('0x5c')]='from-sip';this[_0x734b('0x5d')]=_0x55c699;this['app']=_0x17a217;this[_0x734b('0x39')]=_0x734b('0x5e');this[_0x734b('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x734b('0x60')]=_0x2c81a1;this[_0x734b('0x61')]=_0x3ec705;}function createVoicePrefixExtensions(_0x366379,_0x3b16bb,_0x228f85){return new BPromise(function(_0x262244,_0x164c81){var _0x506407=new Extension(formatPrefixName(_0x366379[_0x734b('0x62')]),0x1,_0x734b('0x63'),_0x734b('0x64'));_0x506407['VoicePrefixId']=_0x366379['id'];return db['VoiceExtension'][_0x734b('0x52')](_0x506407,{'transaction':_0x228f85})[_0x734b('0x2b')](function(_0x391c04){var _0x1eec8e=_0x391c04['get']({'plain':!![]});var _0x565a2e=_['map'](addVoicePrefixExtensions(_0x366379,_0x3b16bb),function(_0x1bd023){_0x1bd023[_0x734b('0x57')]=_0x1eec8e['id'];_0x1bd023[_0x734b('0x65')]=_0x366379['id'];return _0x1bd023;});return db[_0x734b('0x56')][_0x734b('0x66')](_0x565a2e,{'transaction':_0x228f85})[_0x734b('0x2b')](function(_0x113931){if(!_0x113931){return _0x164c81(_0x734b('0x67'));}else{return _0x262244(_0x113931);}})[_0x734b('0x4c')](function(_0x459788){return _0x164c81(_0x459788);});});;});};function addVoicePrefixExtensions(_0xc5a114,_0x69b605){var _0x43951a=[];var _0x467b1=formatPrefixName(_0xc5a114[_0x734b('0x62')]);_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x2,_0x734b('0x69'),_0x734b('0x6a')+_0xc5a114[_0x734b('0x32')]));if(_0xc5a114[_0x734b('0x6b')]){_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x3,'Set',_0x734b('0x6c')+_0xc5a114[_0x734b('0x6b')]));}else{_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x3,_0x734b('0x63'),_0x734b('0x6d')));}_0x43951a['push'](new Extension(_0x467b1,0x4,_0x734b('0x6e'),_0x69b605[_0x734b('0x5c')]+','+_0x734b('0x6f')+(0x8+_0xc5a114[_0x734b('0x32')][_0x734b('0x41')])+'}'+','+0x1));return _0x43951a;}function formatPrefixName(_0x5d785d){var _0x594df0='_';for(var _0x479ee2=0x0;_0x479ee2<_0x5d785d['length'];_0x479ee2++){if(_0x5d785d['charAt'](_0x479ee2)=='-'){_0x594df0+=_0x5d785d['charAt'](_0x479ee2);}else{_0x594df0+='['+_0x5d785d[_0x734b('0x70')](_0x479ee2)+']';}}_0x594df0+='.';return _0x594df0;}exports[_0x734b('0x2a')]=function(_0x16c9d2,_0xb23b61,_0x496070){var _0x4f79a9=_0x16c9d2[_0x734b('0x55')];_0x4f79a9[_0x734b('0x62')]=_0x734b('0x71')+_0x4f79a9[_0x734b('0x32')]+'-';return db['sequelize'][_0x734b('0x54')](function(_0x24ab5c){return db[_0x734b('0x36')][_0x734b('0x2a')](_0x4f79a9,{'where':{'id':_0x4f79a9['id']},'transaction':_0x24ab5c})['then'](function(){return db[_0x734b('0x56')]['destroy']({'where':{'VoicePrefixId':_0x4f79a9['id']},'transaction':_0x24ab5c})[_0x734b('0x2b')](function(){return db[_0x734b('0x56')][_0x734b('0x4f')]({'where':{'id':_0x4f79a9[_0x734b('0x57')]},'raw':!![]})[_0x734b('0x2b')](function(_0x4e43c3){return createVoicePrefixExtensions(_0x4f79a9,_0x4e43c3,_0x24ab5c);});});});})[_0x734b('0x2b')](function(){return db[_0x734b('0x36')][_0x734b('0x72')](_0x4f79a9['id']);})[_0x734b('0x2b')](respondWithResult(_0xb23b61,null))[_0x734b('0x4c')](handleError(_0xb23b61,null));};exports['addAgents']=function(_0x475ecd,_0x2dcb30,_0x1316ae){return db[_0x734b('0x36')]['find']({'where':{'id':_0x475ecd[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x2dcb30,null))[_0x734b('0x2b')](function(_0x407006){if(_0x407006){return _0x407006[_0x734b('0x73')](_0x475ecd['body'][_0x734b('0x74')],_['omit'](_0x475ecd[_0x734b('0x55')],[_0x734b('0x74'),'id'])||{})[_0x734b('0x75')](function(_0x27fd22){for(var _0x4624c7=0x0;_0x4624c7<_0x475ecd[_0x734b('0x55')]['ids']['length'];_0x4624c7+=0x1){socket['emit'](_0x734b('0x76'),{'UserId':Number(_0x475ecd['body'][_0x734b('0x74')][_0x4624c7]),'VoicePrefixId':Number(_0x475ecd[_0x734b('0x50')]['id'])});}return _0x27fd22;});}})['then'](respondWithResult(_0x2dcb30,null))[_0x734b('0x4c')](handleError(_0x2dcb30,null));};exports[_0x734b('0x77')]=function(_0x17749f,_0x2a3c8d,_0x1d0bfb){return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0x17749f[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x2a3c8d,null))[_0x734b('0x2b')](function(_0x5de89a){if(_0x5de89a){return _0x5de89a[_0x734b('0x77')](_0x17749f[_0x734b('0x3f')][_0x734b('0x74')])['then'](function(){if(_[_0x734b('0x78')](_0x17749f[_0x734b('0x3f')][_0x734b('0x74')])){for(var _0x13f1fd=0x0;_0x13f1fd<_0x17749f[_0x734b('0x3f')][_0x734b('0x74')][_0x734b('0x41')];_0x13f1fd+=0x1){socket[_0x734b('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x17749f[_0x734b('0x3f')][_0x734b('0x74')][_0x13f1fd]),'VoicePrefixId':Number(_0x17749f[_0x734b('0x50')]['id'])});}}else{socket[_0x734b('0x79')](_0x734b('0x7a'),{'UserId':Number(_0x17749f[_0x734b('0x3f')][_0x734b('0x74')]),'VoicePrefixId':Number(_0x17749f[_0x734b('0x50')]['id'])});}});}})[_0x734b('0x2b')](respondWithStatusCode(_0x2a3c8d,null))['catch'](handleError(_0x2a3c8d,null));};exports[_0x734b('0x7b')]=function(_0x13f4e8,_0x41eca7,_0x500ebf){var _0x31e1ec={};var _0x2fde66={};var _0x24fb9d;var _0x3f3511;return db[_0x734b('0x36')][_0x734b('0x7c')]({'where':{'id':_0x13f4e8['params']['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x41eca7,null))['then'](function(_0x504a7f){if(_0x504a7f){_0x24fb9d=_0x504a7f;_0x2fde66['model']=_['keys'](db[_0x734b('0x7d')][_0x734b('0x37')]);_0x2fde66[_0x734b('0x3f')]=_[_0x734b('0x3c')](_0x13f4e8['query']);_0x2fde66['filters']=_[_0x734b('0x3e')](_0x2fde66['model'],_0x2fde66[_0x734b('0x3f')]);_0x31e1ec[_0x734b('0x40')]=_['intersection'](_0x2fde66[_0x734b('0x3b')],qs['fields'](_0x13f4e8['query']['fields']));_0x31e1ec[_0x734b('0x40')]=_0x31e1ec[_0x734b('0x40')][_0x734b('0x41')]?_0x31e1ec[_0x734b('0x40')]:_0x2fde66['model'];_0x31e1ec[_0x734b('0x7e')]=qs[_0x734b('0x44')](_0x13f4e8['query'][_0x734b('0x44')]);_0x31e1ec[_0x734b('0x45')]=qs['filters'](_[_0x734b('0x46')](_0x13f4e8['query'],_0x2fde66[_0x734b('0x3d')]));if(_0x13f4e8[_0x734b('0x3f')][_0x734b('0x47')]){_0x31e1ec[_0x734b('0x45')]=_[_0x734b('0x48')](_0x31e1ec[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x31e1ec['attributes'],function(_0x5be5f2){var _0x57f20a={};_0x57f20a[_0x5be5f2]={'$like':'%'+_0x13f4e8[_0x734b('0x3f')][_0x734b('0x47')]+'%'};return _0x57f20a;})});}_0x31e1ec=_['merge']({},_0x31e1ec,_0x13f4e8[_0x734b('0x49')]);return _0x24fb9d[_0x734b('0x7b')](_0x31e1ec);}})[_0x734b('0x2b')](function(_0x48b0e1){if(_0x48b0e1){_0x3f3511=_0x48b0e1[_0x734b('0x41')];if(!_0x13f4e8[_0x734b('0x3f')][_0x734b('0x42')]('nolimit')){_0x31e1ec[_0x734b('0x23')]=qs[_0x734b('0x23')](_0x13f4e8[_0x734b('0x3f')]['limit']);_0x31e1ec['offset']=qs['offset'](_0x13f4e8[_0x734b('0x3f')]['offset']);}return _0x24fb9d[_0x734b('0x7b')](_0x31e1ec);}})[_0x734b('0x2b')](function(_0x2a5aa9){if(_0x2a5aa9){return _0x2a5aa9?{'count':_0x3f3511,'rows':_0x2a5aa9}:null;}})['then'](respondWithResult(_0x41eca7,null))['catch'](handleError(_0x41eca7,null));};exports[_0x734b('0x7f')]=function(_0xa9bb2a,_0x4f3a90,_0x72d3ad){var _0x548206={};var _0x4a809a={};var _0x52890d;var _0xbb8121;return db[_0x734b('0x36')][_0x734b('0x7c')]({'where':{'id':_0xa9bb2a[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x4f3a90,null))[_0x734b('0x2b')](function(_0x18cb9){if(_0x18cb9){_0x52890d=_0x18cb9;_0x4a809a['model']=_[_0x734b('0x3c')](db[_0x734b('0x80')][_0x734b('0x37')]);_0x4a809a[_0x734b('0x3f')]=_['keys'](_0xa9bb2a['query']);_0x4a809a['filters']=_[_0x734b('0x3e')](_0x4a809a[_0x734b('0x3b')],_0x4a809a[_0x734b('0x3f')]);_0x548206[_0x734b('0x40')]=_[_0x734b('0x3e')](_0x4a809a[_0x734b('0x3b')],qs[_0x734b('0x4d')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x4d')]));_0x548206[_0x734b('0x40')]=_0x548206[_0x734b('0x40')][_0x734b('0x41')]?_0x548206[_0x734b('0x40')]:_0x4a809a['model'];_0x548206['order']=qs[_0x734b('0x44')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x44')]);_0x548206['where']=qs[_0x734b('0x3d')](_[_0x734b('0x46')](_0xa9bb2a[_0x734b('0x3f')],_0x4a809a[_0x734b('0x3d')]));if(_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x47')]){_0x548206[_0x734b('0x45')]=_[_0x734b('0x48')](_0x548206[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x548206[_0x734b('0x40')],function(_0x30dff6){var _0x5ac65f={};_0x5ac65f[_0x30dff6]={'$like':'%'+_0xa9bb2a[_0x734b('0x3f')]['filter']+'%'};return _0x5ac65f;})});}_0x548206=_[_0x734b('0x48')]({},_0x548206,_0xa9bb2a[_0x734b('0x49')]);return _0x52890d[_0x734b('0x7f')](_0x548206);}})[_0x734b('0x2b')](function(_0x1bedc4){if(_0x1bedc4){_0xbb8121=_0x1bedc4['length'];if(!_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x42')]('nolimit')){_0x548206[_0x734b('0x23')]=qs[_0x734b('0x23')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x23')]);_0x548206['offset']=qs['offset'](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x25')]);}return _0x52890d['getTeams'](_0x548206);}})[_0x734b('0x2b')](function(_0x19a54a){if(_0x19a54a){return _0x19a54a?{'count':_0xbb8121,'rows':_0x19a54a}:null;}})[_0x734b('0x2b')](respondWithResult(_0x4f3a90,null))[_0x734b('0x4c')](handleError(_0x4f3a90,null));};exports[_0x734b('0x81')]=function(_0x4e46a2,_0x5d0a69,_0x303257){var _0x1bac04=_0x4e46a2[_0x734b('0x55')]['ids'];var _0x200182;return db[_0x734b('0x80')][_0x734b('0x82')]({'where':{'id':_0x1bac04},'attributes':['id'],'include':[{'model':db[_0x734b('0x7d')],'as':_0x734b('0x83'),'attributes':['id',_0x734b('0x32'),_0x734b('0x84'),_0x734b('0x85'),_0x734b('0x86')],'raw':!![]}]})[_0x734b('0x2b')](function(_0x48fbb3){if(_0x48fbb3){_0x200182=_0x48fbb3;var _0x564dda=_[_0x734b('0x87')](_0x48fbb3,function(_0x26af1f){var _0x1ba633=_0x26af1f[_0x734b('0x2c')]({'plain':!![]});return _0x1ba633[_0x734b('0x83')];});return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0x4e46a2[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](function(_0xc74aeb){return db[_0x734b('0x53')]['transaction'](function(_0x288109){return _0xc74aeb[_0x734b('0x81')](_0x1bac04,{'transaction':_0x288109})['then'](function(){return BPromise['each'](_0x200182,function(_0x255fca){return db[_0x734b('0x88')][_0x734b('0x89')]({'TeamId':_0x255fca['id'],'VoicePrefixId':_0x4e46a2[_0x734b('0x50')]['id']},{'transaction':_0x288109});});})['then'](function(){return BPromise[_0x734b('0x8a')](_0x564dda,function(_0x1c9a1e){return db['UserVoicePrefix'][_0x734b('0x8b')]({'where':{'UserId':_0x1c9a1e['id'],'VoicePrefixId':_0x4e46a2[_0x734b('0x50')]['id']},'transaction':_0x288109});});})[_0x734b('0x2b')](function(){_0x564dda[_0x734b('0x8c')](function(_0x189e6d){socket[_0x734b('0x79')](_0x734b('0x76'),{'UserId':_0x189e6d['id'],'VoicePrefixId':_0xc74aeb['id']});});});});});}})[_0x734b('0x2b')](respondWithStatusCode(_0x5d0a69,null))['catch'](handleError(_0x5d0a69,null));};exports[_0x734b('0x8d')]=function(_0x31468d,_0x45a160,_0x16451a){return db[_0x734b('0x80')]['findAll']({'where':{'id':_0x31468d['query'][_0x734b('0x74')]},'attributes':['id'],'include':[{'model':db[_0x734b('0x7d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x734b('0x2b')](handleEntityNotFound(_0x45a160,null))['then'](function(_0x19cf27){var _0x1237cf=_[_0x734b('0x35')](_0x19cf27,'id');var _0x42038a=[];var _0x3e61f1=[];var _0x22e919=squel[_0x734b('0x8e')]();_0x22e919['field']('tq.TeamId')[_0x734b('0x8f')](_0x734b('0x90'),'tq')[_0x734b('0x91')]('user_has_teams','ut',_0x734b('0x92'))[_0x734b('0x45')](_0x734b('0x93'),_0x31468d['params']['id']);for(var _0x1fcc17=0x0;_0x1fcc17<_0x19cf27[_0x734b('0x41')];_0x1fcc17+=0x1){let _0x39a46e=_0x19cf27[_0x1fcc17];for(var _0x2a8f17=0x0;_0x2a8f17<_0x39a46e['Agents']['length'];_0x2a8f17+=0x1){let _0x9cfb2f=_0x39a46e[_0x734b('0x83')][_0x2a8f17];var _0x326783=_0x22e919['clone']();_0x326783[_0x734b('0x45')]('ut.UserId\x20=\x20?',_0x9cfb2f['id']);_0x3e61f1[_0x734b('0x68')](db[_0x734b('0x53')][_0x734b('0x3f')](_0x326783[_0x734b('0x94')](),{'type':db[_0x734b('0x53')]['QueryTypes'][_0x734b('0x95')]})[_0x734b('0x2b')](function(_0x5ddf23){if(_0x5ddf23['length']===0x1){return _0x9cfb2f['id'];}else{var _0x967ccc=_[_0x734b('0x96')](_['map'](_0x5ddf23,_0x734b('0x97')),function(_0x23be49){return _['includes'](_0x1237cf,_0x23be49);});if(_0x967ccc){return _0x9cfb2f['id'];}}}));}}return BPromise[_0x734b('0x98')](_0x3e61f1)['then'](function(_0x4d75bc){_0x42038a=_(_0x42038a)['union'](_0x4d75bc)[_0x734b('0x99')]()['value']();return db[_0x734b('0x36')]['find']({'where':{'id':_0x31468d[_0x734b('0x50')]['id']}})['then'](function(_0xf43253){return db[_0x734b('0x53')][_0x734b('0x54')](function(_0x483d0a){return _0xf43253[_0x734b('0x8d')](_0x31468d[_0x734b('0x3f')]['ids'],{'transaction':_0x483d0a})[_0x734b('0x2b')](function(){if(!_['isEmpty'](_0x42038a)){return _0xf43253[_0x734b('0x77')](_0x42038a,{'transaction':_0x483d0a});}})[_0x734b('0x2b')](function(){_0x42038a['forEach'](function(_0x1f00b3){socket[_0x734b('0x79')](_0x734b('0x7a'),{'UserId':_0x1f00b3,'VoicePrefixId':_0xf43253['id']});});});});});});})[_0x734b('0x2b')](respondWithStatusCode(_0x45a160,null))['catch'](handleError(_0x45a160,null));}; \ No newline at end of file +var _0x1c9a=['sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','VoicePrefixes','UserProfileResource','error','stack','send','index','map','VoicePrefix','rawAttributes','fieldName','type','model','name','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','find','params','describe','sequelize','create','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','VoiceExtension','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','body','system-','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','User','filter','getAgents','getTeams','findOne','addTeams','Team','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','union','compact','isEmpty','eml-format','zip-dir','request-promise','moment','bluebird','util','path'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1c9a,0x98));var _0xa1c9=function(_0x3a0e46,_0x5b0458){_0x3a0e46=_0x3a0e46-0x0;var _0x135e7f=_0x1c9a[_0x3a0e46];return _0x135e7f;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];config[_0xa1c9('0x19')]=_['defaults'](config[_0xa1c9('0x19')],{'host':_0xa1c9('0x1a'),'port':0x18eb});var socket=require(_0xa1c9('0x1b'))(new Redis(config[_0xa1c9('0x19')]));require(_0xa1c9('0x1c'))['register'](socket);function respondWithStatusCode(_0x335dda,_0x4b2fa5){_0x4b2fa5=_0x4b2fa5||0xcc;return function(_0x2cba13){if(_0x2cba13){return _0x335dda[_0xa1c9('0x1d')](_0x4b2fa5);}return _0x335dda[_0xa1c9('0x1e')](_0x4b2fa5)[_0xa1c9('0x1f')]();};}function respondWithResult(_0x44ab5b,_0x3b51f5){_0x3b51f5=_0x3b51f5||0xc8;return function(_0x1f6d26){if(_0x1f6d26){return _0x44ab5b[_0xa1c9('0x1e')](_0x3b51f5)['json'](_0x1f6d26);}};}function respondWithFilteredResult(_0x11ca10,_0x1084d2){return function(_0x224ae4){if(_0x224ae4){var _0x50db9b=typeof _0x1084d2[_0xa1c9('0x20')]==='undefined'&&typeof _0x1084d2[_0xa1c9('0x21')]===_0xa1c9('0x22');var _0x204d54=_0x224ae4['count'];var _0x3a1110=_0x50db9b?0x0:_0x1084d2[_0xa1c9('0x20')];var _0x128732=_0x50db9b?_0x224ae4['count']:_0x1084d2[_0xa1c9('0x20')]+_0x1084d2[_0xa1c9('0x21')];var _0x4c6dbb;if(_0x128732>=_0x204d54){_0x128732=_0x204d54;_0x4c6dbb=0xc8;}else{_0x4c6dbb=0xce;}_0x11ca10[_0xa1c9('0x1e')](_0x4c6dbb);return _0x11ca10[_0xa1c9('0x23')](_0xa1c9('0x24'),_0x3a1110+'-'+_0x128732+'/'+_0x204d54)['json'](_0x224ae4);}return null;};}function patchUpdates(_0x29f1b1){return function(_0x3dcec5){try{jsonpatch[_0xa1c9('0x25')](_0x3dcec5,_0x29f1b1,!![]);}catch(_0x23a461){return BPromise[_0xa1c9('0x26')](_0x23a461);}return _0x3dcec5['save']();};}function saveUpdates(_0x50b16b,_0x200749){return function(_0x50b16d){if(_0x50b16d){return _0x50b16d[_0xa1c9('0x27')](_0x50b16b)[_0xa1c9('0x28')](function(_0x1c6f37){return _0x1c6f37;});}return null;};}function removeEntity(_0x3059eb,_0x339ed1){return function(_0x522dc0){if(_0x522dc0){return _0x522dc0[_0xa1c9('0x29')]()[_0xa1c9('0x28')](function(){var _0x20cbe1=_0x522dc0['get']({'plain':!![]});var _0x133f80=_0xa1c9('0x2a');return db[_0xa1c9('0x2b')]['destroy']({'where':{'type':_0x133f80,'resourceId':_0x20cbe1['id']}})[_0xa1c9('0x28')](function(){return _0x522dc0;});})[_0xa1c9('0x28')](function(){_0x3059eb['status'](0xcc)[_0xa1c9('0x1f')]();});}};}function handleEntityNotFound(_0x48ce34,_0xdf6d0c){return function(_0x2404c3){if(!_0x2404c3){_0x48ce34[_0xa1c9('0x1d')](0x194);}return _0x2404c3;};}function handleError(_0x254b13,_0x40b9d5){_0x40b9d5=_0x40b9d5||0x1f4;return function(_0xe8523b){logger[_0xa1c9('0x2c')](_0xe8523b[_0xa1c9('0x2d')]);if(_0xe8523b['name']){delete _0xe8523b['name'];}_0x254b13[_0xa1c9('0x1e')](_0x40b9d5)[_0xa1c9('0x2e')](_0xe8523b);};}exports[_0xa1c9('0x2f')]=function(_0xf419d0,_0x3161b0){var _0x5b67c3={},_0x53f325={},_0x5aecd7={'count':0x0,'rows':[]};var _0x259ac3=_[_0xa1c9('0x30')](db[_0xa1c9('0x31')][_0xa1c9('0x32')],function(_0x39cf81){return{'name':_0x39cf81[_0xa1c9('0x33')],'type':_0x39cf81[_0xa1c9('0x34')]['key']};});_0x53f325[_0xa1c9('0x35')]=_['map'](_0x259ac3,_0xa1c9('0x36'));_0x53f325['query']=_[_0xa1c9('0x37')](_0xf419d0[_0xa1c9('0x38')]);_0x53f325[_0xa1c9('0x39')]=_['intersection'](_0x53f325[_0xa1c9('0x35')],_0x53f325[_0xa1c9('0x38')]);_0x5b67c3[_0xa1c9('0x3a')]=_[_0xa1c9('0x3b')](_0x53f325['model'],qs['fields'](_0xf419d0[_0xa1c9('0x38')][_0xa1c9('0x3c')]));_0x5b67c3[_0xa1c9('0x3a')]=_0x5b67c3[_0xa1c9('0x3a')][_0xa1c9('0x3d')]?_0x5b67c3[_0xa1c9('0x3a')]:_0x53f325[_0xa1c9('0x35')];if(!_0xf419d0[_0xa1c9('0x38')][_0xa1c9('0x3e')](_0xa1c9('0x3f'))){_0x5b67c3['limit']=qs[_0xa1c9('0x21')](_0xf419d0[_0xa1c9('0x38')][_0xa1c9('0x21')]);_0x5b67c3[_0xa1c9('0x20')]=qs[_0xa1c9('0x20')](_0xf419d0[_0xa1c9('0x38')]['offset']);}_0x5b67c3[_0xa1c9('0x40')]=qs[_0xa1c9('0x41')](_0xf419d0[_0xa1c9('0x38')]['sort']);_0x5b67c3[_0xa1c9('0x42')]=qs[_0xa1c9('0x39')](_['pick'](_0xf419d0[_0xa1c9('0x38')],_0x53f325[_0xa1c9('0x39')]),_0x259ac3);if(_0xf419d0['query']['filter']){_0x5b67c3[_0xa1c9('0x42')]=_[_0xa1c9('0x43')](_0x5b67c3[_0xa1c9('0x42')],{'$or':_[_0xa1c9('0x30')](_0x259ac3,function(_0xd9e67){if(_0xd9e67[_0xa1c9('0x34')]!==_0xa1c9('0x44')){var _0x146e47={};_0x146e47[_0xd9e67[_0xa1c9('0x36')]]={'$like':'%'+_0xf419d0[_0xa1c9('0x38')]['filter']+'%'};return _0x146e47;}})});}_0x5b67c3=_['merge']({},_0x5b67c3,_0xf419d0[_0xa1c9('0x45')]);var _0x46920c={'where':_0x5b67c3['where']};return db[_0xa1c9('0x31')][_0xa1c9('0x46')](_0x46920c)[_0xa1c9('0x28')](function(_0x36c846){_0x5aecd7[_0xa1c9('0x46')]=_0x36c846;if(_0xf419d0[_0xa1c9('0x38')][_0xa1c9('0x47')]){_0x5b67c3[_0xa1c9('0x48')]=[{'all':!![]}];}return db[_0xa1c9('0x31')][_0xa1c9('0x49')](_0x5b67c3);})[_0xa1c9('0x28')](function(_0x50cc27){_0x5aecd7[_0xa1c9('0x4a')]=_0x50cc27;return _0x5aecd7;})['then'](respondWithFilteredResult(_0x3161b0,_0x5b67c3))[_0xa1c9('0x4b')](handleError(_0x3161b0,null));};exports['show']=function(_0x42be67,_0x4a9e02){var _0x43598b={'raw':![],'where':{'id':_0x42be67['params']['id']}},_0x18bb43={};_0x18bb43[_0xa1c9('0x35')]=_[_0xa1c9('0x37')](db['VoicePrefix'][_0xa1c9('0x32')]);_0x18bb43[_0xa1c9('0x38')]=_[_0xa1c9('0x37')](_0x42be67[_0xa1c9('0x38')]);_0x18bb43[_0xa1c9('0x39')]=_[_0xa1c9('0x3b')](_0x18bb43['model'],_0x18bb43[_0xa1c9('0x38')]);_0x43598b[_0xa1c9('0x3a')]=_[_0xa1c9('0x3b')](_0x18bb43[_0xa1c9('0x35')],qs[_0xa1c9('0x3c')](_0x42be67['query']['fields']));_0x43598b['attributes']=_0x43598b[_0xa1c9('0x3a')][_0xa1c9('0x3d')]?_0x43598b[_0xa1c9('0x3a')]:_0x18bb43['model'];if(_0x42be67[_0xa1c9('0x38')][_0xa1c9('0x47')]){_0x43598b['include']=[{'all':!![]}];}_0x43598b=_[_0xa1c9('0x43')]({},_0x43598b,_0x42be67['options']);return db['VoicePrefix'][_0xa1c9('0x4c')](_0x43598b)[_0xa1c9('0x28')](handleEntityNotFound(_0x4a9e02,null))[_0xa1c9('0x28')](respondWithResult(_0x4a9e02,null))[_0xa1c9('0x4b')](handleError(_0x4a9e02,null));};exports[_0xa1c9('0x29')]=function(_0x31fbb8,_0x18aa46){return db[_0xa1c9('0x31')][_0xa1c9('0x4c')]({'where':{'id':_0x31fbb8[_0xa1c9('0x4d')]['id']}})[_0xa1c9('0x28')](handleEntityNotFound(_0x18aa46,null))[_0xa1c9('0x28')](removeEntity(_0x18aa46,null))[_0xa1c9('0x4b')](handleError(_0x18aa46,null));};exports[_0xa1c9('0x4e')]=function(_0x149450,_0x112f82){return db[_0xa1c9('0x31')][_0xa1c9('0x4e')]()[_0xa1c9('0x28')](respondWithResult(_0x112f82,null))['catch'](handleError(_0x112f82,null));};exports['create']=function(_0x12118e,_0x6160fc){var _0x66a5eb;return db[_0xa1c9('0x4f')]['transaction'](function(_0x449e85){return db[_0xa1c9('0x31')][_0xa1c9('0x50')](_0x12118e['body'],{'transaction':_0x449e85})[_0xa1c9('0x28')](function(_0x3f650a){_0x66a5eb=_0x3f650a['get']({'plain':!![]});return db['VoiceExtension'][_0xa1c9('0x4c')]({'where':{'id':_0x66a5eb['VoiceExtensionId']},'raw':!![]})[_0xa1c9('0x28')](function(_0x1bd5c7){return createVoicePrefixExtensions(_0x66a5eb,_0x1bd5c7,_0x449e85);});});})[_0xa1c9('0x28')](function(){var _0x4c1165=_0x12118e['user'][_0xa1c9('0x51')]({'plain':!![]});if(!_0x4c1165)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c1165[_0xa1c9('0x52')]==='user'){var _0x3334ad=_0x66a5eb;return db[_0xa1c9('0x53')][_0xa1c9('0x4c')]({'where':{'name':_0xa1c9('0x2a'),'userProfileId':_0x4c1165[_0xa1c9('0x54')]},'raw':!![]})[_0xa1c9('0x28')](function(_0x3917ed){if(_0x3917ed&&_0x3917ed['autoAssociation']===0x0){return db[_0xa1c9('0x2b')][_0xa1c9('0x50')]({'name':_0x3334ad['name'],'resourceId':_0x3334ad['id'],'type':_0x3917ed['name'],'sectionId':_0x3917ed['id']},{})['then'](function(){return _0x66a5eb;});}else{return _0x66a5eb;}})[_0xa1c9('0x4b')](function(_0x55fe87){logger[_0xa1c9('0x2c')](_0xa1c9('0x55'),_0x55fe87);throw _0x55fe87;});}return _0x66a5eb;})[_0xa1c9('0x28')](respondWithResult(_0x6160fc,null))[_0xa1c9('0x4b')](handleError(_0x6160fc,null));};function Extension(_0x2f0c80,_0x5b81f4,_0x4bf711,_0x48950c){this['context']=_0xa1c9('0x56');this[_0xa1c9('0x57')]=_0x2f0c80;this[_0xa1c9('0x58')]=_0x4bf711;this[_0xa1c9('0x34')]=_0xa1c9('0x59');this[_0xa1c9('0x5a')]=_0xa1c9('0x5b');this[_0xa1c9('0x5c')]=_0x5b81f4;this[_0xa1c9('0x5d')]=_0x48950c;}function createVoicePrefixExtensions(_0x317799,_0x4639cf,_0xef5d24){return new BPromise(function(_0x288267,_0x29d833){var _0x51f675=new Extension(formatPrefixName(_0x317799[_0xa1c9('0x5e')]),0x1,_0xa1c9('0x5f'),_0xa1c9('0x60'));_0x51f675[_0xa1c9('0x61')]=_0x317799['id'];return db['VoiceExtension'][_0xa1c9('0x50')](_0x51f675,{'transaction':_0xef5d24})[_0xa1c9('0x28')](function(_0x1b2cff){var _0x39ffed=_0x1b2cff['get']({'plain':!![]});var _0x4b9aa8=_[_0xa1c9('0x30')](addVoicePrefixExtensions(_0x317799,_0x4639cf),function(_0x2a89d2){_0x2a89d2[_0xa1c9('0x62')]=_0x39ffed['id'];_0x2a89d2[_0xa1c9('0x61')]=_0x317799['id'];return _0x2a89d2;});return db[_0xa1c9('0x63')]['bulkCreate'](_0x4b9aa8,{'transaction':_0xef5d24})[_0xa1c9('0x28')](function(_0x21abdf){if(!_0x21abdf){return _0x29d833(_0xa1c9('0x64'));}else{return _0x288267(_0x21abdf);}})[_0xa1c9('0x4b')](function(_0x5ba7aa){return _0x29d833(_0x5ba7aa);});});;});};function addVoicePrefixExtensions(_0x37613f,_0x17d848){var _0xa18fa4=[];var _0x5a5c65=formatPrefixName(_0x37613f[_0xa1c9('0x5e')]);_0xa18fa4[_0xa1c9('0x65')](new Extension(_0x5a5c65,0x2,'Set',_0xa1c9('0x66')+_0x37613f[_0xa1c9('0x36')]));if(_0x37613f[_0xa1c9('0x67')]){_0xa18fa4[_0xa1c9('0x65')](new Extension(_0x5a5c65,0x3,_0xa1c9('0x68'),_0xa1c9('0x69')+_0x37613f[_0xa1c9('0x67')]));}else{_0xa18fa4[_0xa1c9('0x65')](new Extension(_0x5a5c65,0x3,_0xa1c9('0x5f'),_0xa1c9('0x6a')));}_0xa18fa4[_0xa1c9('0x65')](new Extension(_0x5a5c65,0x4,'goto',_0x17d848[_0xa1c9('0x6b')]+','+_0xa1c9('0x6c')+(0x8+_0x37613f[_0xa1c9('0x36')][_0xa1c9('0x3d')])+'}'+','+0x1));return _0xa18fa4;}function formatPrefixName(_0x5961aa){var _0x358481='_';for(var _0xdbc56a=0x0;_0xdbc56a<_0x5961aa[_0xa1c9('0x3d')];_0xdbc56a++){if(_0x5961aa[_0xa1c9('0x6d')](_0xdbc56a)=='-'){_0x358481+=_0x5961aa[_0xa1c9('0x6d')](_0xdbc56a);}else{_0x358481+='['+_0x5961aa[_0xa1c9('0x6d')](_0xdbc56a)+']';}}_0x358481+='.';return _0x358481;}exports[_0xa1c9('0x27')]=function(_0x27048c,_0xb24e0b,_0x178e47){var _0x1fec82=_0x27048c[_0xa1c9('0x6e')];_0x1fec82[_0xa1c9('0x5e')]=_0xa1c9('0x6f')+_0x1fec82['name']+'-';return db[_0xa1c9('0x4f')][_0xa1c9('0x70')](function(_0x1f219d){return db[_0xa1c9('0x31')][_0xa1c9('0x27')](_0x1fec82,{'where':{'id':_0x1fec82['id']},'transaction':_0x1f219d})[_0xa1c9('0x28')](function(){return db[_0xa1c9('0x63')]['destroy']({'where':{'VoicePrefixId':_0x1fec82['id']},'transaction':_0x1f219d})[_0xa1c9('0x28')](function(){return db[_0xa1c9('0x63')]['find']({'where':{'id':_0x1fec82[_0xa1c9('0x62')]},'raw':!![]})[_0xa1c9('0x28')](function(_0x150d76){return createVoicePrefixExtensions(_0x1fec82,_0x150d76,_0x1f219d);});});});})[_0xa1c9('0x28')](function(){return db['VoicePrefix'][_0xa1c9('0x71')](_0x1fec82['id']);})['then'](respondWithResult(_0xb24e0b,null))['catch'](handleError(_0xb24e0b,null));};exports[_0xa1c9('0x72')]=function(_0x134d3f,_0x40f420,_0x423c58){return db['VoicePrefix'][_0xa1c9('0x4c')]({'where':{'id':_0x134d3f[_0xa1c9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x40f420,null))[_0xa1c9('0x28')](function(_0x464da9){if(_0x464da9){return _0x464da9[_0xa1c9('0x72')](_0x134d3f[_0xa1c9('0x6e')][_0xa1c9('0x73')],_[_0xa1c9('0x74')](_0x134d3f['body'],['ids','id'])||{})[_0xa1c9('0x75')](function(_0x52e78b){for(var _0x3de2c7=0x0;_0x3de2c7<_0x134d3f[_0xa1c9('0x6e')][_0xa1c9('0x73')][_0xa1c9('0x3d')];_0x3de2c7+=0x1){socket[_0xa1c9('0x76')](_0xa1c9('0x77'),{'UserId':Number(_0x134d3f[_0xa1c9('0x6e')][_0xa1c9('0x73')][_0x3de2c7]),'VoicePrefixId':Number(_0x134d3f[_0xa1c9('0x4d')]['id'])});}return _0x52e78b;});}})['then'](respondWithResult(_0x40f420,null))[_0xa1c9('0x4b')](handleError(_0x40f420,null));};exports['removeAgents']=function(_0x4a8841,_0x8bc83d,_0x518811){return db[_0xa1c9('0x31')][_0xa1c9('0x4c')]({'where':{'id':_0x4a8841[_0xa1c9('0x4d')]['id']}})[_0xa1c9('0x28')](handleEntityNotFound(_0x8bc83d,null))[_0xa1c9('0x28')](function(_0x2a17b7){if(_0x2a17b7){return _0x2a17b7[_0xa1c9('0x78')](_0x4a8841['query'][_0xa1c9('0x73')])[_0xa1c9('0x28')](function(){if(_[_0xa1c9('0x79')](_0x4a8841['query']['ids'])){for(var _0x3f4f76=0x0;_0x3f4f76<_0x4a8841['query'][_0xa1c9('0x73')][_0xa1c9('0x3d')];_0x3f4f76+=0x1){socket[_0xa1c9('0x76')](_0xa1c9('0x7a'),{'UserId':Number(_0x4a8841['query'][_0xa1c9('0x73')][_0x3f4f76]),'VoicePrefixId':Number(_0x4a8841[_0xa1c9('0x4d')]['id'])});}}else{socket[_0xa1c9('0x76')](_0xa1c9('0x7a'),{'UserId':Number(_0x4a8841[_0xa1c9('0x38')]['ids']),'VoicePrefixId':Number(_0x4a8841[_0xa1c9('0x4d')]['id'])});}});}})[_0xa1c9('0x28')](respondWithStatusCode(_0x8bc83d,null))[_0xa1c9('0x4b')](handleError(_0x8bc83d,null));};exports['getAgents']=function(_0x3936cb,_0x175662,_0x134935){var _0x197721={};var _0x7281bd={};var _0x35a356;var _0x53ea3b;return db[_0xa1c9('0x31')]['findOne']({'where':{'id':_0x3936cb[_0xa1c9('0x4d')]['id']}})[_0xa1c9('0x28')](handleEntityNotFound(_0x175662,null))['then'](function(_0x28d323){if(_0x28d323){_0x35a356=_0x28d323;_0x7281bd['model']=_[_0xa1c9('0x37')](db[_0xa1c9('0x7b')][_0xa1c9('0x32')]);_0x7281bd[_0xa1c9('0x38')]=_[_0xa1c9('0x37')](_0x3936cb[_0xa1c9('0x38')]);_0x7281bd[_0xa1c9('0x39')]=_[_0xa1c9('0x3b')](_0x7281bd[_0xa1c9('0x35')],_0x7281bd[_0xa1c9('0x38')]);_0x197721[_0xa1c9('0x3a')]=_[_0xa1c9('0x3b')](_0x7281bd[_0xa1c9('0x35')],qs[_0xa1c9('0x3c')](_0x3936cb[_0xa1c9('0x38')][_0xa1c9('0x3c')]));_0x197721['attributes']=_0x197721['attributes'][_0xa1c9('0x3d')]?_0x197721[_0xa1c9('0x3a')]:_0x7281bd[_0xa1c9('0x35')];_0x197721['order']=qs[_0xa1c9('0x41')](_0x3936cb['query']['sort']);_0x197721[_0xa1c9('0x42')]=qs[_0xa1c9('0x39')](_['pick'](_0x3936cb[_0xa1c9('0x38')],_0x7281bd['filters']));if(_0x3936cb['query'][_0xa1c9('0x7c')]){_0x197721['where']=_[_0xa1c9('0x43')](_0x197721[_0xa1c9('0x42')],{'$or':_['map'](_0x197721[_0xa1c9('0x3a')],function(_0x1277eb){var _0x88cb2c={};_0x88cb2c[_0x1277eb]={'$like':'%'+_0x3936cb[_0xa1c9('0x38')]['filter']+'%'};return _0x88cb2c;})});}_0x197721=_[_0xa1c9('0x43')]({},_0x197721,_0x3936cb[_0xa1c9('0x45')]);return _0x35a356[_0xa1c9('0x7d')](_0x197721);}})[_0xa1c9('0x28')](function(_0x465162){if(_0x465162){_0x53ea3b=_0x465162[_0xa1c9('0x3d')];if(!_0x3936cb['query'][_0xa1c9('0x3e')](_0xa1c9('0x3f'))){_0x197721['limit']=qs['limit'](_0x3936cb[_0xa1c9('0x38')][_0xa1c9('0x21')]);_0x197721[_0xa1c9('0x20')]=qs[_0xa1c9('0x20')](_0x3936cb[_0xa1c9('0x38')][_0xa1c9('0x20')]);}return _0x35a356['getAgents'](_0x197721);}})[_0xa1c9('0x28')](function(_0x4deadc){if(_0x4deadc){return _0x4deadc?{'count':_0x53ea3b,'rows':_0x4deadc}:null;}})[_0xa1c9('0x28')](respondWithResult(_0x175662,null))[_0xa1c9('0x4b')](handleError(_0x175662,null));};exports[_0xa1c9('0x7e')]=function(_0x59bc9f,_0x1c8a80,_0x2780b7){var _0x26f241={};var _0x537f48={};var _0x4e1e2f;var _0x46d8d1;return db['VoicePrefix'][_0xa1c9('0x7f')]({'where':{'id':_0x59bc9f['params']['id']}})[_0xa1c9('0x28')](handleEntityNotFound(_0x1c8a80,null))[_0xa1c9('0x28')](function(_0x2d2374){if(_0x2d2374){_0x4e1e2f=_0x2d2374;_0x537f48['model']=_['keys'](db['Team'][_0xa1c9('0x32')]);_0x537f48[_0xa1c9('0x38')]=_[_0xa1c9('0x37')](_0x59bc9f[_0xa1c9('0x38')]);_0x537f48['filters']=_['intersection'](_0x537f48[_0xa1c9('0x35')],_0x537f48['query']);_0x26f241[_0xa1c9('0x3a')]=_[_0xa1c9('0x3b')](_0x537f48[_0xa1c9('0x35')],qs['fields'](_0x59bc9f[_0xa1c9('0x38')][_0xa1c9('0x3c')]));_0x26f241[_0xa1c9('0x3a')]=_0x26f241[_0xa1c9('0x3a')][_0xa1c9('0x3d')]?_0x26f241[_0xa1c9('0x3a')]:_0x537f48[_0xa1c9('0x35')];_0x26f241[_0xa1c9('0x40')]=qs[_0xa1c9('0x41')](_0x59bc9f[_0xa1c9('0x38')]['sort']);_0x26f241[_0xa1c9('0x42')]=qs[_0xa1c9('0x39')](_['pick'](_0x59bc9f[_0xa1c9('0x38')],_0x537f48[_0xa1c9('0x39')]));if(_0x59bc9f[_0xa1c9('0x38')][_0xa1c9('0x7c')]){_0x26f241[_0xa1c9('0x42')]=_['merge'](_0x26f241[_0xa1c9('0x42')],{'$or':_['map'](_0x26f241[_0xa1c9('0x3a')],function(_0x2c04c5){var _0x137a58={};_0x137a58[_0x2c04c5]={'$like':'%'+_0x59bc9f['query'][_0xa1c9('0x7c')]+'%'};return _0x137a58;})});}_0x26f241=_[_0xa1c9('0x43')]({},_0x26f241,_0x59bc9f[_0xa1c9('0x45')]);return _0x4e1e2f[_0xa1c9('0x7e')](_0x26f241);}})[_0xa1c9('0x28')](function(_0x328fa7){if(_0x328fa7){_0x46d8d1=_0x328fa7[_0xa1c9('0x3d')];if(!_0x59bc9f['query'][_0xa1c9('0x3e')](_0xa1c9('0x3f'))){_0x26f241[_0xa1c9('0x21')]=qs['limit'](_0x59bc9f[_0xa1c9('0x38')][_0xa1c9('0x21')]);_0x26f241['offset']=qs[_0xa1c9('0x20')](_0x59bc9f['query'][_0xa1c9('0x20')]);}return _0x4e1e2f[_0xa1c9('0x7e')](_0x26f241);}})[_0xa1c9('0x28')](function(_0x3e5016){if(_0x3e5016){return _0x3e5016?{'count':_0x46d8d1,'rows':_0x3e5016}:null;}})[_0xa1c9('0x28')](respondWithResult(_0x1c8a80,null))['catch'](handleError(_0x1c8a80,null));};exports[_0xa1c9('0x80')]=function(_0xabacf1,_0x38a7fc,_0x2a3082){var _0x276c98=_0xabacf1[_0xa1c9('0x6e')][_0xa1c9('0x73')];var _0x48520d;return db[_0xa1c9('0x81')][_0xa1c9('0x49')]({'where':{'id':_0x276c98},'attributes':['id'],'include':[{'model':db[_0xa1c9('0x7b')],'as':_0xa1c9('0x82'),'attributes':['id','name',_0xa1c9('0x83'),_0xa1c9('0x84'),'interface'],'raw':!![]}]})[_0xa1c9('0x28')](function(_0x2a82fd){if(_0x2a82fd){_0x48520d=_0x2a82fd;var _0x419cf2=_[_0xa1c9('0x85')](_0x2a82fd,function(_0x51884d){var _0x52360b=_0x51884d[_0xa1c9('0x51')]({'plain':!![]});return _0x52360b['Agents'];});return db[_0xa1c9('0x31')]['find']({'where':{'id':_0xabacf1['params']['id']}})[_0xa1c9('0x28')](function(_0x507b2a){return db[_0xa1c9('0x4f')][_0xa1c9('0x70')](function(_0x296607){return _0x507b2a[_0xa1c9('0x80')](_0x276c98,{'transaction':_0x296607})[_0xa1c9('0x28')](function(){return BPromise[_0xa1c9('0x86')](_0x48520d,function(_0x531c20){return db[_0xa1c9('0x87')]['upsert']({'TeamId':_0x531c20['id'],'VoicePrefixId':_0xabacf1[_0xa1c9('0x4d')]['id']},{'transaction':_0x296607});});})[_0xa1c9('0x28')](function(){return BPromise['each'](_0x419cf2,function(_0x110617){return db[_0xa1c9('0x88')][_0xa1c9('0x89')]({'where':{'UserId':_0x110617['id'],'VoicePrefixId':_0xabacf1[_0xa1c9('0x4d')]['id']},'transaction':_0x296607});});})[_0xa1c9('0x28')](function(){_0x419cf2[_0xa1c9('0x8a')](function(_0x5640bb){socket[_0xa1c9('0x76')](_0xa1c9('0x77'),{'UserId':_0x5640bb['id'],'VoicePrefixId':_0x507b2a['id']});});});});});}})[_0xa1c9('0x28')](respondWithStatusCode(_0x38a7fc,null))['catch'](handleError(_0x38a7fc,null));};exports[_0xa1c9('0x8b')]=function(_0x4c8c5e,_0x3cb7d4,_0x5c504c){return db['Team'][_0xa1c9('0x49')]({'where':{'id':_0x4c8c5e['query'][_0xa1c9('0x73')]},'attributes':['id'],'include':[{'model':db[_0xa1c9('0x7b')],'as':_0xa1c9('0x82'),'attributes':['id'],'raw':!![]}]})[_0xa1c9('0x28')](handleEntityNotFound(_0x3cb7d4,null))['then'](function(_0x4423e8){var _0x2c75e6=_['map'](_0x4423e8,'id');var _0x163589=[];var _0x5f3e31=[];var _0x6e0efe=squel[_0xa1c9('0x8c')]();_0x6e0efe[_0xa1c9('0x8d')](_0xa1c9('0x8e'))[_0xa1c9('0x8f')](_0xa1c9('0x90'),'tq')[_0xa1c9('0x91')](_0xa1c9('0x92'),'ut',_0xa1c9('0x93'))[_0xa1c9('0x42')](_0xa1c9('0x94'),_0x4c8c5e[_0xa1c9('0x4d')]['id']);for(var _0x2953bd=0x0;_0x2953bd<_0x4423e8['length'];_0x2953bd+=0x1){let _0x28050b=_0x4423e8[_0x2953bd];for(var _0x3f998a=0x0;_0x3f998a<_0x28050b['Agents'][_0xa1c9('0x3d')];_0x3f998a+=0x1){let _0x12cdd5=_0x28050b[_0xa1c9('0x82')][_0x3f998a];var _0x1c5baa=_0x6e0efe[_0xa1c9('0x95')]();_0x1c5baa[_0xa1c9('0x42')](_0xa1c9('0x96'),_0x12cdd5['id']);_0x5f3e31[_0xa1c9('0x65')](db['sequelize']['query'](_0x1c5baa[_0xa1c9('0x97')](),{'type':db[_0xa1c9('0x4f')]['QueryTypes']['SELECT']})['then'](function(_0x5c9f06){if(_0x5c9f06['length']===0x1){return _0x12cdd5['id'];}else{var _0x4d6b40=_[_0xa1c9('0x98')](_[_0xa1c9('0x30')](_0x5c9f06,_0xa1c9('0x99')),function(_0x20c454){return _[_0xa1c9('0x9a')](_0x2c75e6,_0x20c454);});if(_0x4d6b40){return _0x12cdd5['id'];}}}));}}return BPromise[_0xa1c9('0x9b')](_0x5f3e31)['then'](function(_0x22fde9){_0x163589=_(_0x163589)[_0xa1c9('0x9c')](_0x22fde9)[_0xa1c9('0x9d')]()['value']();return db[_0xa1c9('0x31')]['find']({'where':{'id':_0x4c8c5e['params']['id']}})[_0xa1c9('0x28')](function(_0x3e67f4){return db[_0xa1c9('0x4f')][_0xa1c9('0x70')](function(_0x52905a){return _0x3e67f4[_0xa1c9('0x8b')](_0x4c8c5e[_0xa1c9('0x38')][_0xa1c9('0x73')],{'transaction':_0x52905a})[_0xa1c9('0x28')](function(){if(!_[_0xa1c9('0x9e')](_0x163589)){return _0x3e67f4['removeAgents'](_0x163589,{'transaction':_0x52905a});}})[_0xa1c9('0x28')](function(){_0x163589['forEach'](function(_0x424be7){socket[_0xa1c9('0x76')]('userVoicePrefix:remove',{'UserId':_0x424be7,'VoicePrefixId':_0x3e67f4['id']});});});});});});})[_0xa1c9('0x28')](respondWithStatusCode(_0x3cb7d4,null))[_0xa1c9('0x4b')](handleError(_0x3cb7d4,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 75d19d1..6754245 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 _0x1e4e=['events','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x2a9542,_0x21589a){var _0x1515ad=function(_0x1d8e4f){while(--_0x1d8e4f){_0x2a9542['push'](_0x2a9542['shift']());}};_0x1515ad(++_0x21589a);}(_0x1e4e,0x1ce));var _0xe1e4=function(_0x60fea4,_0x1b6e82){_0x60fea4=_0x60fea4-0x0;var _0x1c76dc=_0x1e4e[_0x60fea4];return _0x1c76dc;};'use strict';var EventEmitter=require(_0xe1e4('0x0'));var VoicePrefix=require(_0xe1e4('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe1e4('0x2'),'afterDestroy':_0xe1e4('0x3')};function emitEvent(_0x5ede28){return function(_0x1a474e,_0x231a6f,_0x5a4810){VoicePrefixEvents['emit'](_0x5ede28+':'+_0x1a474e['id'],_0x1a474e);VoicePrefixEvents[_0xe1e4('0x4')](_0x5ede28,_0x1a474e);_0x5a4810(null);};}for(var e in events){if(events[_0xe1e4('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x8811=['events','VoicePrefix','setMaxListeners','save','update','remove','emit','hook'];(function(_0x80ea62,_0x152606){var _0x5764fa=function(_0x99984b){while(--_0x99984b){_0x80ea62['push'](_0x80ea62['shift']());}};_0x5764fa(++_0x152606);}(_0x8811,0x90));var _0x1881=function(_0x5db1de,_0x3c03d5){_0x5db1de=_0x5db1de-0x0;var _0x1e01ae=_0x8811[_0x5db1de];return _0x1e01ae;};'use strict';var EventEmitter=require(_0x1881('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x1881('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1881('0x2')](0x0);var events={'afterCreate':_0x1881('0x3'),'afterUpdate':_0x1881('0x4'),'afterDestroy':_0x1881('0x5')};function emitEvent(_0x1e8524){return function(_0x57a388,_0x2a7120,_0x428bb1){VoicePrefixEvents[_0x1881('0x6')](_0x1e8524+':'+_0x57a388['id'],_0x57a388);VoicePrefixEvents[_0x1881('0x6')](_0x1e8524,_0x57a388);_0x428bb1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x1881('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index d22708b..5f6954c 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 _0x2d23=['exports','define','VoicePrefix','voice_prefixes','lodash','api','moment','request-promise','path','rimraf','./voicePrefix.attributes'];(function(_0x4032f9,_0x2f0dd8){var _0x7b68fe=function(_0x1d1a98){while(--_0x1d1a98){_0x4032f9['push'](_0x4032f9['shift']());}};_0x7b68fe(++_0x2f0dd8);}(_0x2d23,0x143));var _0x32d2=function(_0x11fdf8,_0x78c1cb){_0x11fdf8=_0x11fdf8-0x0;var _0x452e17=_0x2d23[_0x11fdf8];return _0x452e17;};'use strict';var _=require(_0x32d2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x32d2('0x1'));var moment=require(_0x32d2('0x2'));var BPromise=require('bluebird');var rp=require(_0x32d2('0x3'));var fs=require('fs');var path=require(_0x32d2('0x4'));var rimraf=require(_0x32d2('0x5'));var config=require('../../config/environment');var attributes=require(_0x32d2('0x6'));module[_0x32d2('0x7')]=function(_0x39549a,_0x4b07e3){return _0x39549a[_0x32d2('0x8')](_0x32d2('0x9'),attributes,{'tableName':_0x32d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb161=['moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x7460d8,_0x2fc1a1){var _0x338f82=function(_0x1cec50){while(--_0x1cec50){_0x7460d8['push'](_0x7460d8['shift']());}};_0x338f82(++_0x2fc1a1);}(_0xb161,0x100));var _0x1b16=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xb161[_0x3cb30b];return _0x2ca717;};'use strict';var _=require(_0x1b16('0x0'));var util=require(_0x1b16('0x1'));var logger=require(_0x1b16('0x2'))(_0x1b16('0x3'));var moment=require(_0x1b16('0x4'));var BPromise=require(_0x1b16('0x5'));var rp=require(_0x1b16('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b16('0x7'));var config=require(_0x1b16('0x8'));var attributes=require(_0x1b16('0x9'));module['exports']=function(_0x496792,_0x23ce22){return _0x496792[_0x1b16('0xa')](_0x1b16('0xb'),attributes,{'tableName':_0x1b16('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 1005c5f..6be68c6 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 _0x3c8e=['register','request','then','info','request\x20sent','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x602b1,_0x17c697){var _0x27519f=function(_0x181625){while(--_0x181625){_0x602b1['push'](_0x602b1['shift']());}};_0x27519f(++_0x17c697);}(_0x3c8e,0x89));var _0xe3c8=function(_0x4ff322,_0x125431){_0x4ff322=_0x4ff322-0x0;var _0x441b32=_0x3c8e[_0x4ff322];return _0x441b32;};'use strict';var _=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe3c8('0x2'));var fs=require('fs');var Redis=require(_0xe3c8('0x3'));var db=require(_0xe3c8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3c8('0x5'))(_0xe3c8('0x6'));var config=require(_0xe3c8('0x7'));var jayson=require(_0xe3c8('0x8'));var client=jayson['client'][_0xe3c8('0x9')]({'port':0x232a});config[_0xe3c8('0xa')]=_[_0xe3c8('0xb')](config[_0xe3c8('0xa')],{'host':_0xe3c8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3c8('0xa')]));require('./voicePrefix.socket')[_0xe3c8('0xd')](socket);function respondWithRpcPromise(_0x24b28f,_0x1ec873,_0x21bda1){return new BPromise(function(_0x50e959,_0x2eb76d){return client[_0xe3c8('0xe')](_0x24b28f,_0x21bda1)[_0xe3c8('0xf')](function(_0x4c24b6){logger[_0xe3c8('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x1ec873,_0xe3c8('0x11'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1ec873,_0xe3c8('0x11'),JSON[_0xe3c8('0x12')](_0x4c24b6));if(_0x4c24b6[_0xe3c8('0x13')]){if(_0x4c24b6['error'][_0xe3c8('0x14')]===0x1f4){logger[_0xe3c8('0x13')](_0xe3c8('0x15'),_0x1ec873,_0x4c24b6[_0xe3c8('0x13')][_0xe3c8('0x16')]);return _0x2eb76d(_0x4c24b6[_0xe3c8('0x13')]['message']);}logger[_0xe3c8('0x13')](_0xe3c8('0x15'),_0x1ec873,_0x4c24b6['error'][_0xe3c8('0x16')]);return _0x50e959(_0x4c24b6[_0xe3c8('0x13')][_0xe3c8('0x16')]);}else{logger['info'](_0xe3c8('0x15'),_0x1ec873,_0xe3c8('0x11'));_0x50e959(_0x4c24b6[_0xe3c8('0x17')][_0xe3c8('0x16')]);}})[_0xe3c8('0x18')](function(_0x1136d1){logger[_0xe3c8('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x1ec873,_0x1136d1);_0x2eb76d(_0x1136d1);});});} \ No newline at end of file +var _0x49fe=['socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x306f69,_0x24b7bb){var _0x36bfaa=function(_0x3c73c0){while(--_0x3c73c0){_0x306f69['push'](_0x306f69['shift']());}};_0x36bfaa(++_0x24b7bb);}(_0x49fe,0x75));var _0xe49f=function(_0x89f6f,_0x3b1984){_0x89f6f=_0x89f6f-0x0;var _0x15f30c=_0x49fe[_0x89f6f];return _0x15f30c;};'use strict';var _=require(_0xe49f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe49f('0x1'));var fs=require('fs');var Redis=require(_0xe49f('0x2'));var db=require(_0xe49f('0x3'))['db'];var utils=require(_0xe49f('0x4'));var logger=require(_0xe49f('0x5'))(_0xe49f('0x6'));var config=require(_0xe49f('0x7'));var jayson=require(_0xe49f('0x8'));var client=jayson[_0xe49f('0x9')][_0xe49f('0xa')]({'port':0x232a});config[_0xe49f('0xb')]=_[_0xe49f('0xc')](config[_0xe49f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe49f('0xd'))(new Redis(config[_0xe49f('0xb')]));require('./voicePrefix.socket')[_0xe49f('0xe')](socket);function respondWithRpcPromise(_0x50c474,_0x710895,_0x26e7f5){return new BPromise(function(_0x55c98f,_0x8a5642){return client[_0xe49f('0xf')](_0x50c474,_0x26e7f5)[_0xe49f('0x10')](function(_0xa266b4){logger[_0xe49f('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x710895,_0xe49f('0x12'));logger[_0xe49f('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x710895,_0xe49f('0x12'),JSON[_0xe49f('0x14')](_0xa266b4));if(_0xa266b4[_0xe49f('0x15')]){if(_0xa266b4[_0xe49f('0x15')][_0xe49f('0x16')]===0x1f4){logger['error'](_0xe49f('0x17'),_0x710895,_0xa266b4[_0xe49f('0x15')]['message']);return _0x8a5642(_0xa266b4['error'][_0xe49f('0x18')]);}logger[_0xe49f('0x15')](_0xe49f('0x17'),_0x710895,_0xa266b4[_0xe49f('0x15')][_0xe49f('0x18')]);return _0x55c98f(_0xa266b4[_0xe49f('0x15')]['message']);}else{logger[_0xe49f('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x710895,_0xe49f('0x12'));_0x55c98f(_0xa266b4['result']['message']);}})[_0xe49f('0x19')](function(_0x2ebac7){logger['error'](_0xe49f('0x17'),_0x710895,_0x2ebac7);_0x8a5642(_0x2ebac7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 7964828..643e134 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 _0x136c=['emit','removeListener','register','length','./voicePrefix.events','save','update'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x136c,0x1d2));var _0xc136=function(_0x505a1d,_0x1136e8){_0x505a1d=_0x505a1d-0x0;var _0x114138=_0x136c[_0x505a1d];return _0x114138;};'use strict';var VoicePrefixEvents=require(_0xc136('0x0'));var events=[_0xc136('0x1'),'remove',_0xc136('0x2')];function createListener(_0x3b4cbd,_0x34c789){return function(_0x15181c){_0x34c789[_0xc136('0x3')](_0x3b4cbd,_0x15181c);};}function removeListener(_0x9e2e9d,_0x19565a){return function(){VoicePrefixEvents[_0xc136('0x4')](_0x9e2e9d,_0x19565a);};}exports[_0xc136('0x5')]=function(_0x586570){for(var _0x1ac41b=0x0,_0x594112=events[_0xc136('0x6')];_0x1ac41b<_0x594112;_0x1ac41b++){var _0x3993f2=events[_0x1ac41b];var _0x1804c1=createListener('voicePrefix:'+_0x3993f2,_0x586570);VoicePrefixEvents['on'](_0x3993f2,_0x1804c1);}}; \ No newline at end of file +var _0xc964=['update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x3315cf,_0x4e5340){var _0xadbb47=function(_0x5ed797){while(--_0x5ed797){_0x3315cf['push'](_0x3315cf['shift']());}};_0xadbb47(++_0x4e5340);}(_0xc964,0x7e));var _0x4c96=function(_0x5a0610,_0x24efa2){_0x5a0610=_0x5a0610-0x0;var _0x21b846=_0xc964[_0x5a0610];return _0x21b846;};'use strict';var VoicePrefixEvents=require(_0x4c96('0x0'));var events=[_0x4c96('0x1'),'remove',_0x4c96('0x2')];function createListener(_0x8d390f,_0x90fbb1){return function(_0x591daa){_0x90fbb1[_0x4c96('0x3')](_0x8d390f,_0x591daa);};}function removeListener(_0x491d1e,_0x1b0a58){return function(){VoicePrefixEvents[_0x4c96('0x4')](_0x491d1e,_0x1b0a58);};}exports[_0x4c96('0x5')]=function(_0x2f6461){for(var _0x45bb27=0x0,_0x1fa8a0=events[_0x4c96('0x6')];_0x45bb27<_0x1fa8a0;_0x45bb27++){var _0x493618=events[_0x45bb27];var _0x19ed76=createListener(_0x4c96('0x7')+_0x493618,_0x2f6461);VoicePrefixEvents['on'](_0x493618,_0x19ed76);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index ec540f2..1e0f322 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x445d92,_0x22c321){var _0x2bac4d=function(_0xe6f1a1){while(--_0xe6f1a1){_0x445d92['push'](_0x445d92['shift']());}};_0x2bac4d(++_0x22c321);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _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(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b0aa3,_0x198647){_0x4b0aa3=_0x4b0aa3-0x0;var _0x126ad5=_0xb10b[_0x4b0aa3];return _0x126ad5;};'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 fb7705c..781f6e7 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 _0x0fce=['power','INTEGER','yes','ENUM','once','TEXT','periodic_announce','split','join','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING','outbound','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive'];(function(_0x54b5da,_0x7a8714){var _0x2d016f=function(_0x56ccd5){while(--_0x56ccd5){_0x54b5da['push'](_0x54b5da['shift']());}};_0x2d016f(++_0x7a8714);}(_0x0fce,0x178));var _0xe0fc=function(_0x5dae6e,_0x41b791){_0x5dae6e=_0x5dae6e-0x0;var _0x4b8419=_0x0fce[_0x5dae6e];return _0x4b8419;};'use strict';var Sequelize=require(_0xe0fc('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0fc('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xe0fc('0x2')),'allowNull':![],'defaultValue':_0xe0fc('0x3')},'musiconhold':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':_0xe0fc('0x4')},'announce':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xe0fc('0x5'),_0xe0fc('0x6'),_0xe0fc('0x7'),_0xe0fc('0x8'),_0xe0fc('0x9'),'linear','wrandom',_0xe0fc('0xa')),'allowNull':![],'defaultValue':_0xe0fc('0x5'),'set':function(_0x5adb7b){this[_0xe0fc('0xb')](_0xe0fc('0xc'),_0x5adb7b?_0x5adb7b:'rrmemory');},'get':function(){var _0x39a7a0=this[_0xe0fc('0xd')](_0xe0fc('0xe'));var _0xd2e6b0=this[_0xe0fc('0xd')](_0xe0fc('0xf'));var _0xfbea90=this[_0xe0fc('0xd')]('strategy');if(_0x39a7a0===_0xe0fc('0x3')){return _0xfbea90;}if(_0xd2e6b0===_0xe0fc('0x10')&&_0xfbea90===_0xe0fc('0x9')||_0xd2e6b0==='booked'&&_0xfbea90===_0xe0fc('0x11')){return _0xfbea90;}if(_0xd2e6b0===_0xe0fc('0x12')||_0xd2e6b0==='predictive'||_0xd2e6b0===_0xe0fc('0x13')){return _0xfbea90;}return null;}},'servicelevel':{'type':Sequelize[_0xe0fc('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xe0fc('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe0fc('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe0fc('0x1')]},'weight':{'type':Sequelize[_0xe0fc('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe0fc('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xe0fc('0x15'),'no'),'defaultValue':_0xe0fc('0x15')},'autopause':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe0fc('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe0fc('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe0fc('0x16')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe0fc('0x16')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xe0fc('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe0fc('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe0fc('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xe0fc('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe0fc('0x16')]('yes','no'),'defaultValue':_0xe0fc('0x15')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xe0fc('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe0fc('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe0fc('0x1')]},'queue_youarenext':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe0fc('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xe0fc('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xe0fc('0x1')]},'periodic_announce':{'type':Sequelize[_0xe0fc('0x18')],'set':function(_0x197ee0){this[_0xe0fc('0xb')](_0xe0fc('0x19'),_0x197ee0?_0x197ee0['join'](','):[]);},'get':function(){return this[_0xe0fc('0xd')](_0xe0fc('0x19'))?this[_0xe0fc('0xd')](_0xe0fc('0x19'))[_0xe0fc('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':'yes','set':function(_0x195daa){this[_0xe0fc('0xb')]('joinempty',_0x195daa?_0x195daa[_0xe0fc('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0xe0fc('0x1c'))?this[_0xe0fc('0xd')](_0xe0fc('0x1c'))[_0xe0fc('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':'no','set':function(_0x44cd40){this[_0xe0fc('0xb')](_0xe0fc('0x1d'),_0x44cd40?_0x44cd40[_0xe0fc('0x1b')](','):undefined);},'get':function(){return this[_0xe0fc('0xd')](_0xe0fc('0x1d'))?this[_0xe0fc('0xd')]('leavewhenempty')[_0xe0fc('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe0fc('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xe0fc('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe0fc('0x1')]},'description':{'type':Sequelize[_0xe0fc('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x17c011){this[_0xe0fc('0xb')](_0xe0fc('0x1e'),_0x17c011);if(_0x17c011){if(this['getDataValue'](_0xe0fc('0x1f'))<0x2){this[_0xe0fc('0xb')](_0xe0fc('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe0fc('0x20')],'defaultValue':0x0,'comment':_0xe0fc('0x21')},'dialMethod':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x22'),_0xe0fc('0x12'),_0xe0fc('0x13'),_0xe0fc('0x23'),_0xe0fc('0x10')),'defaultValue':_0xe0fc('0x12'),'comment':_0xe0fc('0x24')},'dialLimitChannel':{'type':Sequelize[_0xe0fc('0x14')](0x4)[_0xe0fc('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xe0fc('0x14')](0x4)[_0xe0fc('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe0fc('0x26')},'dialPowerLevel':{'type':Sequelize[_0xe0fc('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe0fc('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x29'),_0xe0fc('0x2a')),'defaultValue':_0xe0fc('0x2a'),'comment':_0xe0fc('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe0fc('0x27')](0x2)[_0xe0fc('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe0fc('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe0fc('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe0fc('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe0fc('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0fc('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':_0xe0fc('0x2e'),'comment':_0xe0fc('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xe0fc('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0fc('0x30')},'dialQueueProject':{'type':Sequelize[_0xe0fc('0x1')],'comment':_0xe0fc('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0fc('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe0fc('0x14')](0x5)[_0xe0fc('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xe0fc('0x14')](0x5)[_0xe0fc('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0fc('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe0fc('0x25')],'defaultValue':0x3,'comment':_0xe0fc('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe0fc('0x14')](0x5)[_0xe0fc('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0fc('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe0fc('0x36')},'dialTimezone':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':_0xe0fc('0x37')},'dialPrefix':{'type':Sequelize[_0xe0fc('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x38'),_0xe0fc('0x39'),_0xe0fc('0x3a')),'defaultValue':_0xe0fc('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe0fc('0x3b')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe0fc('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe0fc('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xe0fc('0x14')](0x9)[_0xe0fc('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe0fc('0x14')](0x9)[_0xe0fc('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe0fc('0x14')](0x9)[_0xe0fc('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe0fc('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe0fc('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe0fc('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe0fc('0x14')](0x9)[_0xe0fc('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe0fc('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe0fc('0x14')](0x9)[_0xe0fc('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe0fc('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe0fc('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe0fc('0x14')](0x9)[_0xe0fc('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe0fc('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xe0fc('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xe0fc('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xe0fc('0x16')](_0xe0fc('0x43'),_0xe0fc('0x44')),'defaultValue':_0xe0fc('0x43')},'dialQueueProject2':{'type':Sequelize[_0xe0fc('0x1')],'comment':_0xe0fc('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe0fc('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe0fc('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe0fc('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0fc('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe0fc('0x14')](0x5)[_0xe0fc('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xe0fc('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0fc('0x47')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe0fc('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0fc('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe0fc('0x14')](0x5)[_0xe0fc('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0fc('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0xe0fc('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0fc('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe0fc('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0fc('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe0fc('0x14')](0x5)[_0xe0fc('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe0fc('0x14')],'allowNull':!![],'comment':_0xe0fc('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0xe0fc('0x20')],'defaultValue':![],'comment':_0xe0fc('0x4d'),'set':function(_0xbdc1f){if(!_0xbdc1f)this[_0xe0fc('0xb')]('mandatoryDispositionPauseId',null);this[_0xe0fc('0xb')](_0xe0fc('0x4e'),_0xbdc1f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe0fc('0x14')](0x3)[_0xe0fc('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xe0fc('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xe0fc('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7875=['leastrecent','fewestcalls','rrmemory','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','power','INTEGER','yes','all','once','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','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\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall'];(function(_0x7a4ac9,_0x1c18c0){var _0x4a5a31=function(_0x53e87a){while(--_0x53e87a){_0x7a4ac9['push'](_0x7a4ac9['shift']());}};_0x4a5a31(++_0x1c18c0);}(_0x7875,0xe7));var _0x5787=function(_0xf89f09,_0x366784){_0xf89f09=_0xf89f09-0x0;var _0x4db4aa=_0x7875[_0xf89f09];return _0x4db4aa;};'use strict';var Sequelize=require(_0x5787('0x0'));module[_0x5787('0x1')]={'name':{'type':Sequelize[_0x5787('0x2')],'allowNull':![],'unique':_0x5787('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x5'),_0x5787('0x6')),'allowNull':![],'defaultValue':_0x5787('0x5')},'musiconhold':{'type':Sequelize[_0x5787('0x2')],'defaultValue':_0x5787('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x5787('0x4')]('rr',_0x5787('0x8'),_0x5787('0x9'),_0x5787('0xa'),'random',_0x5787('0xb'),'linear',_0x5787('0xc'),_0x5787('0xd')),'allowNull':![],'defaultValue':_0x5787('0x8'),'set':function(_0x1990c8){this[_0x5787('0xe')]('strategy',_0x1990c8?_0x1990c8:_0x5787('0xb'));},'get':function(){var _0x32332c=this[_0x5787('0xf')](_0x5787('0x10'));var _0x540297=this[_0x5787('0xf')](_0x5787('0x11'));var _0x2acae5=this[_0x5787('0xf')](_0x5787('0x12'));if(_0x32332c==='inbound'){return _0x2acae5;}if(_0x540297===_0x5787('0x13')&&_0x2acae5==='rrmemory'||_0x540297===_0x5787('0x13')&&_0x2acae5===_0x5787('0x14')){return _0x2acae5;}if(_0x540297==='progressive'||_0x540297==='predictive'||_0x540297===_0x5787('0x15')){return _0x2acae5;}return null;}},'servicelevel':{'type':Sequelize[_0x5787('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5787('0x16')](0xb)},'timeout':{'type':Sequelize[_0x5787('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5787('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5787('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5787('0x4')]('yes','no'),'defaultValue':_0x5787('0x17')},'autopause':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x17'),'no',_0x5787('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5787('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5787('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x5787('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5787('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5787('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5787('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5787('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x17'),'no'),'defaultValue':_0x5787('0x17')},'announce_holdtime':{'type':Sequelize[_0x5787('0x4')]('yes','no',_0x5787('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5787('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5787('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5787('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x5787('0x2')]},'queue_youarenext':{'type':Sequelize[_0x5787('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5787('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5787('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5787('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5787('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5787('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5787('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x5787('0x2')]},'queue_quantity2':{'type':Sequelize[_0x5787('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x5787('0x2')]},'queue_less_than':{'type':Sequelize[_0x5787('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x25ef6e){this[_0x5787('0xe')](_0x5787('0x1a'),_0x25ef6e?_0x25ef6e['join'](','):[]);},'get':function(){return this[_0x5787('0xf')](_0x5787('0x1a'))?this[_0x5787('0xf')](_0x5787('0x1a'))[_0x5787('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x5787('0x2')],'defaultValue':_0x5787('0x17'),'set':function(_0x1c46f5){this[_0x5787('0xe')](_0x5787('0x1c'),_0x1c46f5?_0x1c46f5[_0x5787('0x1d')](','):undefined);},'get':function(){return this[_0x5787('0xf')](_0x5787('0x1c'))?this['getDataValue'](_0x5787('0x1c'))[_0x5787('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x310c2e){this[_0x5787('0xe')]('leavewhenempty',_0x310c2e?_0x310c2e['join'](','):undefined);},'get':function(){return this[_0x5787('0xf')](_0x5787('0x1e'))?this[_0x5787('0xf')](_0x5787('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x5787('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5787('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x5787('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5787('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x5787('0x1f')],'defaultValue':0x0,'set':function(_0x35a20f){this[_0x5787('0xe')](_0x5787('0x20'),_0x35a20f);if(_0x35a20f){if(this[_0x5787('0xf')](_0x5787('0x21'))<0x2){this[_0x5787('0xe')](_0x5787('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5787('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5787('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x22'),_0x5787('0x23'),_0x5787('0x15'),'predictive',_0x5787('0x13')),'defaultValue':_0x5787('0x23'),'comment':_0x5787('0x24')},'dialLimitChannel':{'type':Sequelize[_0x5787('0x16')](0x4)[_0x5787('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x5787('0x16')](0x4)[_0x5787('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5787('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x5787('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x5787('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x28'),_0x5787('0x29')),'defaultValue':_0x5787('0x29'),'comment':_0x5787('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5787('0x2b')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5787('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5787('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5787('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5787('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x5787('0x2')],'defaultValue':_0x5787('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x5787('0x2')],'comment':_0x5787('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5787('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5787('0x16')](0x5)[_0x5787('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5787('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5787('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5787('0x16')](0x5)[_0x5787('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5787('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x5787('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5787('0x16')](0x5)[_0x5787('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5787('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5787('0x35')},'dialTimezone':{'type':Sequelize[_0x5787('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x5787('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x36'),_0x5787('0x37'),'onlyIfOpen'),'defaultValue':_0x5787('0x36')},'dialAMDActive':{'type':Sequelize[_0x5787('0x1f')],'defaultValue':0x0,'comment':_0x5787('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x5787('0x16')](0x9)[_0x5787('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5787('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x5787('0x16')](0x9)[_0x5787('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5787('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5787('0x16')](0x9)[_0x5787('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5787('0x16')](0x9)[_0x5787('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5787('0x16')](0x9)[_0x5787('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5787('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5787('0x16')](0x9)[_0x5787('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5787('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5787('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5787('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5787('0x16')](0x9)[_0x5787('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5787('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x5787('0x16')](0x5)[_0x5787('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5787('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x5787('0x1f')],'defaultValue':0x0,'comment':_0x5787('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5787('0x4')](_0x5787('0x41'),_0x5787('0x42')),'defaultValue':_0x5787('0x41')},'dialQueueProject2':{'type':Sequelize[_0x5787('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5787('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5787('0x43')},'dialCutDigit':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5787('0x16')](0x5)[_0x5787('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5787('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5787('0x45')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5787('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5787('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5787('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5787('0x48')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5787('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5787('0x16')](0x5)[_0x5787('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5787('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5787('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5787('0x16')](0x5)[_0x5787('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5787('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5787('0x16')],'allowNull':!![],'comment':_0x5787('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x5787('0x1f')],'defaultValue':![],'comment':_0x5787('0x4e'),'set':function(_0x15ee2c){if(!_0x15ee2c)this[_0x5787('0xe')]('mandatoryDispositionPauseId',null);this[_0x5787('0xe')](_0x5787('0x4f'),_0x15ee2c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5787('0x16')](0x3)[_0x5787('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x5787('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x5787('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x5787('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index bbccf96..e997866 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 _0x8c46=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueue.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource','then','end','sendStatus','error','send','index','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','userProfileId','autoAssociation','findOne','CmHopper','order','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','transaction','each','upsert','findOrCreate','isNil','format','SIP/%s','voicePause','emit','Team','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','union','compact','removeTeams','ids','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','push','all','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x1e1650,_0x442152){var _0x32554a=function(_0x299d70){while(--_0x299d70){_0x1e1650['push'](_0x1e1650['shift']());}};_0x32554a(++_0x442152);}(_0x8c46,0x171));var _0x68c4=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x8c46[_0x57014b];return _0x2b258a;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];config['redis']=_[_0x68c4('0x16')](config[_0x68c4('0x17')],{'host':_0x68c4('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68c4('0x17')]));require(_0x68c4('0x19'))[_0x68c4('0x1a')](socket);function respondWithStatusCode(_0x52f031,_0x211793){_0x211793=_0x211793||0xcc;return function(_0x38fd57){if(_0x38fd57){return _0x52f031['sendStatus'](_0x211793);}return _0x52f031[_0x68c4('0x1b')](_0x211793)['end']();};}function respondWithResult(_0x1a7045,_0x556aa6){_0x556aa6=_0x556aa6||0xc8;return function(_0x5497bf){if(_0x5497bf){return _0x1a7045[_0x68c4('0x1b')](_0x556aa6)[_0x68c4('0x1c')](_0x5497bf);}};}function respondWithFilteredResult(_0x4f4797,_0x2d6c1b){return function(_0x1d757c){if(_0x1d757c){var _0x38ac38=typeof _0x2d6c1b[_0x68c4('0x1d')]===_0x68c4('0x1e')&&typeof _0x2d6c1b[_0x68c4('0x1f')]===_0x68c4('0x1e');var _0x415ef2=_0x1d757c[_0x68c4('0x20')];var _0x3befda=_0x38ac38?0x0:_0x2d6c1b[_0x68c4('0x1d')];var _0x58f87d=_0x38ac38?_0x1d757c[_0x68c4('0x20')]:_0x2d6c1b['offset']+_0x2d6c1b['limit'];var _0x34d3a6;if(_0x58f87d>=_0x415ef2){_0x58f87d=_0x415ef2;_0x34d3a6=0xc8;}else{_0x34d3a6=0xce;}_0x4f4797[_0x68c4('0x1b')](_0x34d3a6);return _0x4f4797[_0x68c4('0x21')](_0x68c4('0x22'),_0x3befda+'-'+_0x58f87d+'/'+_0x415ef2)['json'](_0x1d757c);}return null;};}function patchUpdates(_0x35e865){return function(_0x310bc6){try{jsonpatch['apply'](_0x310bc6,_0x35e865,!![]);}catch(_0x201742){return BPromise[_0x68c4('0x23')](_0x201742);}return _0x310bc6[_0x68c4('0x24')]();};}function saveUpdates(_0x10278e,_0x12ecd1){return function(_0x20e78b){if(_0x20e78b){return _0x20e78b[_0x68c4('0x25')](_0x10278e)['then'](function(_0x2ff4a5){return _0x2ff4a5;});}return null;};}function removeEntity(_0x55355d,_0xf16a78){return function(_0x10c67e){if(_0x10c67e){return _0x10c67e[_0x68c4('0x26')]()['then'](function(){var _0x1e14db=_0x10c67e[_0x68c4('0x27')]({'plain':!![]});var _0x496f4d=[{'name':_0x68c4('0x28'),'value':_0x68c4('0x29'),'ignore':![]},{'name':_0x68c4('0x2a'),'value':_0x68c4('0x2b'),'ignore':![]}];var _0x5589d6=_(_0x496f4d)[_0x68c4('0x2c')]('ignore')[_0x68c4('0x2d')](_0x68c4('0x2e'))['value']();if(_[_0x68c4('0x2f')](_0x5589d6,_0x1e14db[_0x68c4('0x30')])){return;}var _0x48e4bd=_[_0x68c4('0x31')](_0x496f4d,[_0x68c4('0x2e'),_0x1e14db[_0x68c4('0x30')]])[_0x68c4('0x32')];return db[_0x68c4('0x33')][_0x68c4('0x26')]({'where':{'type':_0x48e4bd,'resourceId':_0x1e14db['id']}})[_0x68c4('0x34')](function(){return _0x10c67e;});})[_0x68c4('0x34')](function(){_0x55355d[_0x68c4('0x1b')](0xcc)[_0x68c4('0x35')]();});}};}function handleEntityNotFound(_0x19bc4a,_0x925289){return function(_0x302237){if(!_0x302237){_0x19bc4a[_0x68c4('0x36')](0x194);}return _0x302237;};}function handleError(_0x3ce082,_0x3a3a75){_0x3a3a75=_0x3a3a75||0x1f4;return function(_0x33fcc7){logger[_0x68c4('0x37')](_0x33fcc7['stack']);if(_0x33fcc7[_0x68c4('0x32')]){delete _0x33fcc7[_0x68c4('0x32')];}_0x3ce082[_0x68c4('0x1b')](_0x3a3a75)[_0x68c4('0x38')](_0x33fcc7);};}exports[_0x68c4('0x39')]=function(_0x5a4e0c,_0x32fef0){var _0x4f4672={},_0x586e9c={},_0x4dcd5b={'count':0x0,'rows':[]};var _0xb86553=_[_0x68c4('0x2d')](db[_0x68c4('0x3a')][_0x68c4('0x3b')],function(_0x5953cc){return{'name':_0x5953cc[_0x68c4('0x3c')],'type':_0x5953cc[_0x68c4('0x30')][_0x68c4('0x3d')]};});_0x586e9c['model']=_[_0x68c4('0x2d')](_0xb86553,_0x68c4('0x32'));_0x586e9c[_0x68c4('0x3e')]=_[_0x68c4('0x3f')](_0x5a4e0c[_0x68c4('0x3e')]);_0x586e9c[_0x68c4('0x40')]=_[_0x68c4('0x41')](_0x586e9c[_0x68c4('0x42')],_0x586e9c[_0x68c4('0x3e')]);_0x4f4672[_0x68c4('0x43')]=_['intersection'](_0x586e9c['model'],qs[_0x68c4('0x44')](_0x5a4e0c[_0x68c4('0x3e')][_0x68c4('0x44')]));_0x4f4672[_0x68c4('0x43')]=_0x4f4672[_0x68c4('0x43')][_0x68c4('0x45')]?_0x4f4672[_0x68c4('0x43')]:_0x586e9c[_0x68c4('0x42')];if(!_0x5a4e0c[_0x68c4('0x3e')][_0x68c4('0x46')](_0x68c4('0x47'))){_0x4f4672[_0x68c4('0x1f')]=qs[_0x68c4('0x1f')](_0x5a4e0c['query']['limit']);_0x4f4672[_0x68c4('0x1d')]=qs[_0x68c4('0x1d')](_0x5a4e0c[_0x68c4('0x3e')][_0x68c4('0x1d')]);}_0x4f4672['order']=qs[_0x68c4('0x48')](_0x5a4e0c[_0x68c4('0x3e')]['sort']);_0x4f4672['where']=qs['filters'](_[_0x68c4('0x49')](_0x5a4e0c['query'],_0x586e9c[_0x68c4('0x40')]),_0xb86553);if(_0x5a4e0c['query'][_0x68c4('0x2c')]){_0x4f4672[_0x68c4('0x4a')]=_[_0x68c4('0x4b')](_0x4f4672[_0x68c4('0x4a')],{'$or':_['map'](_0xb86553,function(_0x3d82be){if(_0x3d82be[_0x68c4('0x30')]!==_0x68c4('0x4c')){var _0x10cf85={};_0x10cf85[_0x3d82be['name']]={'$like':'%'+_0x5a4e0c[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0x10cf85;}})});}_0x4f4672=_[_0x68c4('0x4b')]({},_0x4f4672,_0x5a4e0c[_0x68c4('0x4d')]);var _0x215183={'where':_0x4f4672['where']};return db['VoiceQueue']['count'](_0x215183)[_0x68c4('0x34')](function(_0x268bf4){_0x4dcd5b[_0x68c4('0x20')]=_0x268bf4;if(_0x5a4e0c[_0x68c4('0x3e')]['includeAll']){_0x4f4672[_0x68c4('0x4e')]=[{'all':!![]}];}return db[_0x68c4('0x3a')][_0x68c4('0x4f')](_0x4f4672);})[_0x68c4('0x34')](function(_0x25be7a){_0x4dcd5b[_0x68c4('0x50')]=_0x25be7a;return _0x4dcd5b;})[_0x68c4('0x34')](respondWithFilteredResult(_0x32fef0,_0x4f4672))[_0x68c4('0x51')](handleError(_0x32fef0,null));};exports[_0x68c4('0x52')]=function(_0x9d03e6,_0x1ba892){var _0x4eb9bb={'raw':![],'where':{'id':_0x9d03e6['params']['id']}},_0x1c5206={};_0x1c5206[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db[_0x68c4('0x3a')][_0x68c4('0x3b')]);_0x1c5206['query']=_[_0x68c4('0x3f')](_0x9d03e6['query']);_0x1c5206[_0x68c4('0x40')]=_[_0x68c4('0x41')](_0x1c5206['model'],_0x1c5206[_0x68c4('0x3e')]);_0x4eb9bb[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0x1c5206[_0x68c4('0x42')],qs[_0x68c4('0x44')](_0x9d03e6[_0x68c4('0x3e')]['fields']));_0x4eb9bb[_0x68c4('0x43')]=_0x4eb9bb[_0x68c4('0x43')][_0x68c4('0x45')]?_0x4eb9bb[_0x68c4('0x43')]:_0x1c5206['model'];if(_0x9d03e6[_0x68c4('0x3e')][_0x68c4('0x53')]){_0x4eb9bb[_0x68c4('0x4e')]=[{'all':!![]}];}_0x4eb9bb=_[_0x68c4('0x4b')]({},_0x4eb9bb,_0x9d03e6[_0x68c4('0x4d')]);return db[_0x68c4('0x3a')]['find'](_0x4eb9bb)[_0x68c4('0x34')](handleEntityNotFound(_0x1ba892,null))[_0x68c4('0x34')](respondWithResult(_0x1ba892,null))[_0x68c4('0x51')](handleError(_0x1ba892,null));};exports['create']=function(_0x354035,_0x2e98b0){return db['VoiceQueue']['create'](_0x354035[_0x68c4('0x54')],{})[_0x68c4('0x34')](function(_0xa727fc){var _0x31eda2=_0x354035[_0x68c4('0x55')][_0x68c4('0x27')]({'plain':!![]});if(!_0x31eda2)throw new Error(_0x68c4('0x56'));if(_0x31eda2[_0x68c4('0x57')]==='user'){var _0xb62438=_0xa727fc['get']({'plain':!![]});var _0x59157e=[{'name':'VoiceQueues','value':_0x68c4('0x29')},{'name':_0x68c4('0x2a'),'value':_0x68c4('0x2b')}];var _0x50d030=_[_0x68c4('0x31')](_0x59157e,[_0x68c4('0x2e'),_0xb62438['type']])[_0x68c4('0x32')];return db['UserProfileSection'][_0x68c4('0x31')]({'where':{'name':_0x50d030,'userProfileId':_0x31eda2['userProfileId']},'raw':!![]})[_0x68c4('0x34')](function(_0x21bfb8){if(_0x21bfb8&&_0x21bfb8['autoAssociation']===0x0){return db[_0x68c4('0x33')][_0x68c4('0x58')]({'name':_0xb62438['name'],'resourceId':_0xb62438['id'],'type':_0x21bfb8[_0x68c4('0x32')],'sectionId':_0x21bfb8['id']},{})[_0x68c4('0x34')](function(){return _0xa727fc;});}else{return _0xa727fc;}})['catch'](function(_0x1511f0){logger[_0x68c4('0x37')](_0x68c4('0x59'),_0x1511f0);throw _0x1511f0;});}return _0xa727fc;})[_0x68c4('0x34')](respondWithResult(_0x2e98b0,0xc9))[_0x68c4('0x51')](handleError(_0x2e98b0,null));};exports[_0x68c4('0x5a')]=function(_0x1a2ede,_0x22424b){var _0x24bb5d={'where':{'id':_0x1a2ede[_0x68c4('0x5b')]['id']}},_0x52aa52={};_0x52aa52[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db[_0x68c4('0x3a')][_0x68c4('0x3b')]);_0x24bb5d[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0x52aa52['model'],qs['fields'](_0x1a2ede[_0x68c4('0x3e')][_0x68c4('0x44')]));_0x24bb5d['attributes']=_0x24bb5d[_0x68c4('0x43')][_0x68c4('0x45')]?_0x24bb5d[_0x68c4('0x43')]:_0x52aa52[_0x68c4('0x42')];if(_0x1a2ede[_0x68c4('0x3e')][_0x68c4('0x53')]){_0x24bb5d['include']=[{'all':!![]}];}_0x24bb5d=_[_0x68c4('0x4b')]({},_0x24bb5d,_0x1a2ede[_0x68c4('0x4d')]);return db[_0x68c4('0x3a')][_0x68c4('0x31')](_0x24bb5d)[_0x68c4('0x34')](handleEntityNotFound(_0x22424b,null))['then'](function(_0x4bb60c){if(_0x4bb60c){var _0x200dba=_0x4bb60c[_0x68c4('0x27')]({'plain':!![]});_0x200dba=qs[_0x68c4('0x5c')](_0x200dba,['id',_0x68c4('0x5d'),_0x68c4('0x5e')]);_0x1a2ede['body']=_[_0x68c4('0x5c')](_0x1a2ede[_0x68c4('0x54')],['id',_0x68c4('0x5d'),_0x68c4('0x5e')]);return db[_0x68c4('0x3a')][_0x68c4('0x58')](_[_0x68c4('0x4b')](_0x200dba,_0x1a2ede[_0x68c4('0x54')]),{'include':_0x1a2ede[_0x68c4('0x3e')][_0x68c4('0x53')]?[{'all':!![]}]:undefined})['then'](function(_0x418647){var _0x482e3e=_0x1a2ede[_0x68c4('0x55')][_0x68c4('0x27')]({'plain':!![]});if(!_0x482e3e)throw new Error(_0x68c4('0x56'));if(_0x482e3e['role']===_0x68c4('0x55')){var _0x4fa64d=_0x418647[_0x68c4('0x27')]({'plain':!![]});var _0x1a6594=[{'name':_0x68c4('0x28'),'value':_0x68c4('0x29')},{'name':_0x68c4('0x2a'),'value':'outbound'}];var _0x3882ca=_[_0x68c4('0x31')](_0x1a6594,[_0x68c4('0x2e'),_0x4fa64d[_0x68c4('0x30')]])[_0x68c4('0x32')];return db['UserProfileSection'][_0x68c4('0x31')]({'where':{'name':_0x3882ca,'userProfileId':_0x482e3e[_0x68c4('0x5f')]},'raw':!![]})[_0x68c4('0x34')](function(_0x550ed2){if(_0x550ed2&&_0x550ed2[_0x68c4('0x60')]===0x0){return db[_0x68c4('0x33')][_0x68c4('0x58')]({'name':_0x4fa64d['name'],'resourceId':_0x4fa64d['id'],'type':_0x550ed2[_0x68c4('0x32')],'sectionId':_0x550ed2['id']},{})['then'](function(){return _0x418647;});}else{return _0x418647;}})['catch'](function(_0x43af21){logger[_0x68c4('0x37')](_0x68c4('0x59'),_0x43af21);throw _0x43af21;});}return _0x418647;});}})['then'](respondWithResult(_0x22424b,0xc9))['catch'](handleError(_0x22424b,null));};exports[_0x68c4('0x25')]=function(_0x1ead72,_0x4b0788){if(_0x1ead72[_0x68c4('0x54')]['id']){delete _0x1ead72[_0x68c4('0x54')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x1ead72[_0x68c4('0x5b')]['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x4b0788,null))[_0x68c4('0x34')](saveUpdates(_0x1ead72[_0x68c4('0x54')],null))['then'](respondWithResult(_0x4b0788,null))[_0x68c4('0x51')](handleError(_0x4b0788,null));};exports['destroy']=function(_0x220ac8,_0x4208a4){return db[_0x68c4('0x3a')][_0x68c4('0x31')]({'where':{'id':_0x220ac8[_0x68c4('0x5b')]['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x4208a4,null))[_0x68c4('0x34')](removeEntity(_0x4208a4,null))[_0x68c4('0x51')](handleError(_0x4208a4,null));};exports['getHoppers']=function(_0x2d4c32,_0x4a0f4e,_0x60af6f){var _0x2314b2={'raw':![],'where':{}};var _0xce0b25={};var _0x242b48={'count':0x0,'rows':[]};return db[_0x68c4('0x3a')][_0x68c4('0x61')]({'where':{'id':_0x2d4c32[_0x68c4('0x5b')]['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x4a0f4e,null))[_0x68c4('0x34')](function(_0x227358){if(_0x227358){_0xce0b25[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db[_0x68c4('0x62')][_0x68c4('0x3b')]);_0xce0b25[_0x68c4('0x3e')]=_[_0x68c4('0x3f')](_0x2d4c32[_0x68c4('0x3e')]);_0xce0b25[_0x68c4('0x40')]=_[_0x68c4('0x41')](_0xce0b25[_0x68c4('0x42')],_0xce0b25[_0x68c4('0x3e')]);_0x2314b2[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0xce0b25[_0x68c4('0x42')],qs[_0x68c4('0x44')](_0x2d4c32['query'][_0x68c4('0x44')]));_0x2314b2[_0x68c4('0x43')]=_0x2314b2['attributes'][_0x68c4('0x45')]?_0x2314b2[_0x68c4('0x43')]:_0xce0b25['model'];if(!_0x2d4c32[_0x68c4('0x3e')][_0x68c4('0x46')](_0x68c4('0x47'))){_0x2314b2[_0x68c4('0x1f')]=qs[_0x68c4('0x1f')](_0x2d4c32[_0x68c4('0x3e')][_0x68c4('0x1f')]);_0x2314b2['offset']=qs[_0x68c4('0x1d')](_0x2d4c32[_0x68c4('0x3e')][_0x68c4('0x1d')]);}_0x2314b2[_0x68c4('0x63')]=qs[_0x68c4('0x48')](_0x2d4c32['query']['sort']);_0x2314b2[_0x68c4('0x4a')]=qs[_0x68c4('0x40')](_[_0x68c4('0x49')](_0x2d4c32[_0x68c4('0x3e')],_0xce0b25[_0x68c4('0x40')]));_0x2314b2[_0x68c4('0x4a')]['VoiceQueueId']=_0x227358['id'];if(_0x2d4c32[_0x68c4('0x3e')][_0x68c4('0x2c')]){_0x2314b2['where']=_[_0x68c4('0x4b')](_0x2314b2[_0x68c4('0x4a')],{'$or':_[_0x68c4('0x2d')](_0x2314b2[_0x68c4('0x43')],function(_0x4645e9){var _0x3aebef={};_0x3aebef[_0x4645e9]={'$like':'%'+_0x2d4c32[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0x3aebef;})});}_0x2314b2=_[_0x68c4('0x4b')]({},_0x2314b2,_0x2d4c32[_0x68c4('0x4d')]);return db[_0x68c4('0x62')][_0x68c4('0x20')]({'where':_0x2314b2[_0x68c4('0x4a')]})[_0x68c4('0x34')](function(_0x562722){_0x242b48['count']=_0x562722;if(_0x2d4c32[_0x68c4('0x3e')][_0x68c4('0x53')]){_0x2314b2[_0x68c4('0x4e')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2314b2);})[_0x68c4('0x34')](function(_0x2ec0af){_0x242b48['rows']=_0x2ec0af;return _0x242b48;});}})[_0x68c4('0x34')](respondWithFilteredResult(_0x4a0f4e,_0x2314b2))[_0x68c4('0x51')](handleError(_0x4a0f4e,null));};exports[_0x68c4('0x64')]=function(_0x141acd,_0x59f44a,_0x2a5570){var _0x3172dd={'raw':!![],'where':{}};var _0x281a26={};var _0x36e5dc={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x68c4('0x61')]({'where':{'id':_0x141acd[_0x68c4('0x5b')]['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x59f44a,null))[_0x68c4('0x34')](function(_0x2cbfad){if(_0x2cbfad){_0x281a26[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db[_0x68c4('0x65')]['rawAttributes']);_0x281a26['query']=_[_0x68c4('0x3f')](_0x141acd[_0x68c4('0x3e')]);_0x281a26[_0x68c4('0x40')]=_[_0x68c4('0x41')](_0x281a26[_0x68c4('0x42')],_0x281a26[_0x68c4('0x3e')]);_0x3172dd[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0x281a26[_0x68c4('0x42')],qs[_0x68c4('0x44')](_0x141acd['query'][_0x68c4('0x44')]));_0x3172dd[_0x68c4('0x43')]=_0x3172dd['attributes'][_0x68c4('0x45')]?_0x3172dd[_0x68c4('0x43')]:_0x281a26[_0x68c4('0x42')];if(!_0x141acd['query'][_0x68c4('0x46')](_0x68c4('0x47'))){_0x3172dd['limit']=qs[_0x68c4('0x1f')](_0x141acd[_0x68c4('0x3e')][_0x68c4('0x1f')]);_0x3172dd[_0x68c4('0x1d')]=qs[_0x68c4('0x1d')](_0x141acd[_0x68c4('0x3e')][_0x68c4('0x1d')]);}_0x3172dd['order']=qs[_0x68c4('0x48')](_0x141acd['query'][_0x68c4('0x48')]);_0x3172dd[_0x68c4('0x4a')]=qs[_0x68c4('0x40')](_['pick'](_0x141acd[_0x68c4('0x3e')],_0x281a26[_0x68c4('0x40')]));_0x3172dd['where'][_0x68c4('0x66')]=_0x2cbfad['id'];if(_0x141acd[_0x68c4('0x3e')][_0x68c4('0x2c')]){_0x3172dd[_0x68c4('0x4a')]=_[_0x68c4('0x4b')](_0x3172dd['where'],{'$or':_[_0x68c4('0x2d')](_0x3172dd[_0x68c4('0x43')],function(_0x580c01){var _0x27f038={};_0x27f038[_0x580c01]={'$like':'%'+_0x141acd[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0x27f038;})});}_0x3172dd=_[_0x68c4('0x4b')]({},_0x3172dd,_0x141acd[_0x68c4('0x4d')]);return db['CmHopperHistory'][_0x68c4('0x20')]({'where':_0x3172dd[_0x68c4('0x4a')]})[_0x68c4('0x34')](function(_0x14f058){_0x36e5dc[_0x68c4('0x20')]=_0x14f058;if(_0x141acd['query']['includeAll']){_0x3172dd[_0x68c4('0x4e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x68c4('0x4f')](_0x3172dd);})[_0x68c4('0x34')](function(_0x34e3a2){_0x36e5dc[_0x68c4('0x50')]=_0x34e3a2;return _0x36e5dc;});}})[_0x68c4('0x34')](respondWithFilteredResult(_0x59f44a,_0x3172dd))[_0x68c4('0x51')](handleError(_0x59f44a,null));};exports[_0x68c4('0x67')]=function(_0xf08f80,_0x2f671c,_0x51d2dd){var _0x340634={'raw':!![],'where':{}};var _0x2313a2={};var _0x33c4fb={'count':0x0,'rows':[]};return db[_0x68c4('0x3a')][_0x68c4('0x61')]({'where':{'id':_0xf08f80['params']['id']}})['then'](handleEntityNotFound(_0x2f671c,null))[_0x68c4('0x34')](function(_0x3154da){if(_0x3154da){_0x2313a2[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db[_0x68c4('0x68')][_0x68c4('0x3b')]);_0x2313a2[_0x68c4('0x3e')]=_[_0x68c4('0x3f')](_0xf08f80[_0x68c4('0x3e')]);_0x2313a2['filters']=_[_0x68c4('0x41')](_0x2313a2[_0x68c4('0x42')],_0x2313a2[_0x68c4('0x3e')]);_0x340634[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0x2313a2[_0x68c4('0x42')],qs['fields'](_0xf08f80[_0x68c4('0x3e')][_0x68c4('0x44')]));_0x340634[_0x68c4('0x43')]=_0x340634[_0x68c4('0x43')][_0x68c4('0x45')]?_0x340634[_0x68c4('0x43')]:_0x2313a2[_0x68c4('0x42')];if(!_0xf08f80[_0x68c4('0x3e')][_0x68c4('0x46')](_0x68c4('0x47'))){_0x340634[_0x68c4('0x1f')]=qs[_0x68c4('0x1f')](_0xf08f80['query'][_0x68c4('0x1f')]);_0x340634[_0x68c4('0x1d')]=qs[_0x68c4('0x1d')](_0xf08f80[_0x68c4('0x3e')][_0x68c4('0x1d')]);}_0x340634[_0x68c4('0x63')]=qs[_0x68c4('0x48')](_0xf08f80[_0x68c4('0x3e')][_0x68c4('0x48')]);_0x340634[_0x68c4('0x4a')]=qs[_0x68c4('0x40')](_[_0x68c4('0x49')](_0xf08f80[_0x68c4('0x3e')],_0x2313a2['filters']));_0x340634[_0x68c4('0x4a')][_0x68c4('0x66')]=_0x3154da['id'];if(_0xf08f80['query'][_0x68c4('0x2c')]){_0x340634[_0x68c4('0x4a')]=_[_0x68c4('0x4b')](_0x340634[_0x68c4('0x4a')],{'$or':_[_0x68c4('0x2d')](_0x340634[_0x68c4('0x43')],function(_0x10686a){var _0x25508e={};_0x25508e[_0x10686a]={'$like':'%'+_0xf08f80['query'][_0x68c4('0x2c')]+'%'};return _0x25508e;})});}_0x340634=_['merge']({},_0x340634,_0xf08f80[_0x68c4('0x4d')]);return db[_0x68c4('0x68')][_0x68c4('0x20')]({'where':_0x340634['where']})[_0x68c4('0x34')](function(_0x1419fb){_0x33c4fb[_0x68c4('0x20')]=_0x1419fb;if(_0xf08f80['query'][_0x68c4('0x53')]){_0x340634['include']=[{'all':!![]}];}return db[_0x68c4('0x68')][_0x68c4('0x4f')](_0x340634);})[_0x68c4('0x34')](function(_0x567979){_0x33c4fb[_0x68c4('0x50')]=_0x567979;return _0x33c4fb;});}})[_0x68c4('0x34')](respondWithFilteredResult(_0x2f671c,_0x340634))[_0x68c4('0x51')](handleError(_0x2f671c,null));};exports[_0x68c4('0x69')]=function(_0x28839e,_0x1c545c,_0x57b5cd){var _0x643ed4={'raw':!![],'where':{}};var _0x52d4e3={};var _0x442171={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x68c4('0x61')]({'where':{'id':_0x28839e['params']['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x1c545c,null))['then'](function(_0x92fe39){if(_0x92fe39){_0x52d4e3[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db['CmHopperBlack'][_0x68c4('0x3b')]);_0x52d4e3[_0x68c4('0x3e')]=_[_0x68c4('0x3f')](_0x28839e[_0x68c4('0x3e')]);_0x52d4e3['filters']=_[_0x68c4('0x41')](_0x52d4e3[_0x68c4('0x42')],_0x52d4e3[_0x68c4('0x3e')]);_0x643ed4[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0x52d4e3[_0x68c4('0x42')],qs[_0x68c4('0x44')](_0x28839e['query'][_0x68c4('0x44')]));_0x643ed4['attributes']=_0x643ed4[_0x68c4('0x43')][_0x68c4('0x45')]?_0x643ed4['attributes']:_0x52d4e3[_0x68c4('0x42')];if(!_0x28839e[_0x68c4('0x3e')][_0x68c4('0x46')](_0x68c4('0x47'))){_0x643ed4[_0x68c4('0x1f')]=qs[_0x68c4('0x1f')](_0x28839e['query'][_0x68c4('0x1f')]);_0x643ed4['offset']=qs[_0x68c4('0x1d')](_0x28839e[_0x68c4('0x3e')]['offset']);}_0x643ed4[_0x68c4('0x63')]=qs[_0x68c4('0x48')](_0x28839e[_0x68c4('0x3e')][_0x68c4('0x48')]);_0x643ed4[_0x68c4('0x4a')]=qs[_0x68c4('0x40')](_['pick'](_0x28839e[_0x68c4('0x3e')],_0x52d4e3[_0x68c4('0x40')]));_0x643ed4[_0x68c4('0x4a')][_0x68c4('0x66')]=_0x92fe39['id'];if(_0x28839e[_0x68c4('0x3e')][_0x68c4('0x2c')]){_0x643ed4[_0x68c4('0x4a')]=_['merge'](_0x643ed4[_0x68c4('0x4a')],{'$or':_[_0x68c4('0x2d')](_0x643ed4[_0x68c4('0x43')],function(_0x23b1fa){var _0x4194ed={};_0x4194ed[_0x23b1fa]={'$like':'%'+_0x28839e[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0x4194ed;})});}_0x643ed4=_[_0x68c4('0x4b')]({},_0x643ed4,_0x28839e[_0x68c4('0x4d')]);return db[_0x68c4('0x6a')][_0x68c4('0x20')]({'where':_0x643ed4[_0x68c4('0x4a')]})[_0x68c4('0x34')](function(_0x2d7f6b){_0x442171[_0x68c4('0x20')]=_0x2d7f6b;if(_0x28839e[_0x68c4('0x3e')][_0x68c4('0x53')]){_0x643ed4[_0x68c4('0x4e')]=[{'all':!![]}];}return db[_0x68c4('0x6a')][_0x68c4('0x4f')](_0x643ed4);})[_0x68c4('0x34')](function(_0x2337c5){_0x442171[_0x68c4('0x50')]=_0x2337c5;return _0x442171;});}})[_0x68c4('0x34')](respondWithFilteredResult(_0x1c545c,_0x643ed4))['catch'](handleError(_0x1c545c,null));};exports[_0x68c4('0x6b')]=function(_0xcfff56,_0x5a4431,_0x1b2d21){var _0x28d484={};var _0x5f5c87={};var _0x224b46;var _0x54f69a;return db[_0x68c4('0x3a')][_0x68c4('0x61')]({'where':{'id':_0xcfff56[_0x68c4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5a4431,null))['then'](function(_0x45332b){if(_0x45332b){_0x224b46=_0x45332b;_0x5f5c87[_0x68c4('0x42')]=_['keys'](db['Team'][_0x68c4('0x3b')]);_0x5f5c87[_0x68c4('0x3e')]=_['keys'](_0xcfff56[_0x68c4('0x3e')]);_0x5f5c87[_0x68c4('0x40')]=_[_0x68c4('0x41')](_0x5f5c87[_0x68c4('0x42')],_0x5f5c87[_0x68c4('0x3e')]);_0x28d484[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0x5f5c87['model'],qs['fields'](_0xcfff56['query']['fields']));_0x28d484[_0x68c4('0x43')]=_0x28d484[_0x68c4('0x43')][_0x68c4('0x45')]?_0x28d484[_0x68c4('0x43')]:_0x5f5c87[_0x68c4('0x42')];_0x28d484[_0x68c4('0x63')]=qs[_0x68c4('0x48')](_0xcfff56[_0x68c4('0x3e')][_0x68c4('0x48')]);_0x28d484['where']=qs[_0x68c4('0x40')](_['pick'](_0xcfff56[_0x68c4('0x3e')],_0x5f5c87[_0x68c4('0x40')]));if(_0xcfff56[_0x68c4('0x3e')][_0x68c4('0x2c')]){_0x28d484[_0x68c4('0x4a')]=_['merge'](_0x28d484[_0x68c4('0x4a')],{'$or':_['map'](_0x28d484[_0x68c4('0x43')],function(_0x4b7d22){var _0x11b33e={};_0x11b33e[_0x4b7d22]={'$like':'%'+_0xcfff56[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0x11b33e;})});}_0x28d484=_['merge']({},_0x28d484,_0xcfff56['options']);return _0x224b46['getTeams'](_0x28d484);}})[_0x68c4('0x34')](function(_0x5abcc4){if(_0x5abcc4){_0x54f69a=_0x5abcc4[_0x68c4('0x45')];if(!_0xcfff56[_0x68c4('0x3e')][_0x68c4('0x46')](_0x68c4('0x47'))){_0x28d484[_0x68c4('0x1f')]=qs[_0x68c4('0x1f')](_0xcfff56[_0x68c4('0x3e')][_0x68c4('0x1f')]);_0x28d484[_0x68c4('0x1d')]=qs['offset'](_0xcfff56[_0x68c4('0x3e')][_0x68c4('0x1d')]);}return _0x224b46[_0x68c4('0x6b')](_0x28d484);}})['then'](function(_0x563f64){if(_0x563f64){return _0x563f64?{'count':_0x54f69a,'rows':_0x563f64}:null;}})[_0x68c4('0x34')](respondWithResult(_0x5a4431,null))[_0x68c4('0x51')](handleError(_0x5a4431,null));};exports['addTeams']=function(_0x47551d,_0x69c698,_0x58ec57){var _0x321c91=_0x47551d['body'][_0x68c4('0x6c')];var _0x18a99e=_[_0x68c4('0x2d')](_0x321c91,'id');return db['Team'][_0x68c4('0x4f')]({'where':{'id':_0x18a99e},'attributes':['id'],'include':[{'model':db[_0x68c4('0x6d')],'as':_0x68c4('0x6e'),'attributes':['id',_0x68c4('0x32'),_0x68c4('0x6f'),'voicePause',_0x68c4('0x70')],'raw':!![]}]})['then'](function(_0x317d54){if(_0x317d54){var _0xb218aa=_[_0x68c4('0x71')](_0x317d54,function(_0x366836){var _0x32b8ec=_0x366836['get']({'plain':!![]});_0x32b8ec['Agents'][_0x68c4('0x72')](function(_0x3a9b30){_0x3a9b30[_0x68c4('0x73')]=_[_0x68c4('0x31')](_0x321c91,{'id':_0x32b8ec['id']})[_0x68c4('0x73')];});return _0x32b8ec['Agents'];});return db['VoiceQueue'][_0x68c4('0x31')]({'where':{'id':_0x47551d['params']['id']}})['then'](function(_0x1f64bb){return db['sequelize'][_0x68c4('0x74')](function(_0xdd470){return _0x1f64bb['addTeams'](_0x18a99e,{'transaction':_0xdd470})[_0x68c4('0x34')](function(){return BPromise[_0x68c4('0x75')](_0x321c91,function(_0x13cf3a){return db['TeamVoiceQueue'][_0x68c4('0x76')]({'TeamId':_0x13cf3a['id'],'VoiceQueueId':_0x47551d[_0x68c4('0x5b')]['id'],'penalty':_0x13cf3a[_0x68c4('0x73')]},{'transaction':_0xdd470});});})[_0x68c4('0x34')](function(){return BPromise[_0x68c4('0x75')](_0xb218aa,function(_0x23d953){return db['UserVoiceQueue'][_0x68c4('0x77')]({'where':{'UserId':_0x23d953['id'],'VoiceQueueId':_0x47551d[_0x68c4('0x5b')]['id']},'defaults':{'penalty':_0x23d953[_0x68c4('0x73')]},'transaction':_0xdd470});});})[_0x68c4('0x34')](function(){return BPromise[_0x68c4('0x75')](_[_0x68c4('0x2c')](_0xb218aa,{'online':!![]}),function(_0x424b09){return db['UserVoiceQueueRt'][_0x68c4('0x76')]({'membername':_0x424b09[_0x68c4('0x32')],'UserId':_0x424b09['id'],'queue_name':_0x1f64bb[_0x68c4('0x32')],'VoiceQueueId':_0x1f64bb['id'],'interface':_[_0x68c4('0x78')](_0x424b09[_0x68c4('0x70')])?util[_0x68c4('0x79')](_0x68c4('0x7a'),_0x424b09[_0x68c4('0x32')]):_0x424b09[_0x68c4('0x70')],'paused':_0x424b09[_0x68c4('0x7b')]||![],'penalty':_0x424b09[_0x68c4('0x73')]},{'transaction':_0xdd470});});})['then'](function(){_0xb218aa[_0x68c4('0x72')](function(_0x2622d5){socket[_0x68c4('0x7c')]('userVoiceQueue:save',{'UserId':_0x2622d5['id'],'VoiceQueueId':_0x1f64bb['id']});});});});});}})[_0x68c4('0x34')](respondWithStatusCode(_0x69c698,null))[_0x68c4('0x51')](handleError(_0x69c698,null));};exports['removeTeams']=function(_0xb5cc8,_0x44ed2d,_0x31d3ce){return db[_0x68c4('0x7d')][_0x68c4('0x4f')]({'where':{'id':_0xb5cc8[_0x68c4('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0x68c4('0x6d')],'as':_0x68c4('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x44ed2d,null))['then'](function(_0x28dcc4){var _0xffc880=_[_0x68c4('0x2d')](_0x28dcc4,'id');var _0x367bf5=[];var _0x5758bd=[];var _0x5e338a=squel['select']();_0x5e338a[_0x68c4('0x7e')]('tq.TeamId')[_0x68c4('0x7f')](_0x68c4('0x80'),'tq')[_0x68c4('0x81')](_0x68c4('0x82'),'ut',_0x68c4('0x83'))['where'](_0x68c4('0x84'),_0xb5cc8[_0x68c4('0x5b')]['id']);for(var _0x324b7b=0x0;_0x324b7b<_0x28dcc4['length'];_0x324b7b+=0x1){let _0x299cb2=_0x28dcc4[_0x324b7b];for(var _0xf58301=0x0;_0xf58301<_0x299cb2[_0x68c4('0x6e')][_0x68c4('0x45')];_0xf58301+=0x1){let _0x433d01=_0x299cb2[_0x68c4('0x6e')][_0xf58301];var _0x15e67c=_0x5e338a[_0x68c4('0x5a')]();_0x15e67c[_0x68c4('0x4a')](_0x68c4('0x85'),_0x433d01['id']);_0x5758bd['push'](db[_0x68c4('0x86')][_0x68c4('0x3e')](_0x15e67c['toString'](),{'type':db['sequelize'][_0x68c4('0x87')][_0x68c4('0x88')]})['then'](function(_0x1697bb){if(_0x1697bb[_0x68c4('0x45')]===0x1){return _0x433d01['id'];}else{var _0x575880=_[_0x68c4('0x89')](_[_0x68c4('0x2d')](_0x1697bb,_0x68c4('0x8a')),function(_0x2501eb){return _['includes'](_0xffc880,_0x2501eb);});if(_0x575880){return _0x433d01['id'];}}}));}}return BPromise['all'](_0x5758bd)['then'](function(_0x52a09c){_0x367bf5=_(_0x367bf5)[_0x68c4('0x8b')](_0x52a09c)[_0x68c4('0x8c')]()[_0x68c4('0x2e')]();return db[_0x68c4('0x3a')][_0x68c4('0x31')]({'where':{'id':_0xb5cc8[_0x68c4('0x5b')]['id']}})['then'](function(_0x27a611){return db[_0x68c4('0x86')][_0x68c4('0x74')](function(_0x522239){return _0x27a611[_0x68c4('0x8d')](_0xb5cc8[_0x68c4('0x3e')][_0x68c4('0x8e')],{'transaction':_0x522239})[_0x68c4('0x34')](function(){if(!_[_0x68c4('0x8f')](_0x367bf5)){return _0x27a611[_0x68c4('0x90')](_0x367bf5,{'transaction':_0x522239})[_0x68c4('0x34')](function(){return db[_0x68c4('0x91')][_0x68c4('0x26')]({'where':{'VoiceQueueId':_0xb5cc8['params']['id'],'UserId':_0x367bf5},'transaction':_0x522239});});}})['then'](function(){_0x367bf5[_0x68c4('0x72')](function(_0x3eb8fe){socket[_0x68c4('0x7c')](_0x68c4('0x92'),{'UserId':_0x3eb8fe,'VoiceQueueId':_0x27a611['id']});});});});});});})['then'](respondWithStatusCode(_0x44ed2d,null))[_0x68c4('0x51')](handleError(_0x44ed2d,null));};exports[_0x68c4('0x93')]=function(_0x1a7057,_0x2d6c9a,_0x5a75fd){var _0x51d63d,_0x22276a;return db[_0x68c4('0x3a')][_0x68c4('0x31')]({'where':{'id':_0x1a7057[_0x68c4('0x5b')]['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x2d6c9a,null))['then'](function(_0x3eae09){if(_0x3eae09){_0x22276a=_0x3eae09;return _0x3eae09[_0x68c4('0x93')](_0x1a7057[_0x68c4('0x54')][_0x68c4('0x8e')],_[_0x68c4('0x5c')](_0x1a7057['body'],[_0x68c4('0x8e'),'id'])||{})['spread'](function(_0x5343f1){for(var _0x2a515a=0x0;_0x2a515a<_0x1a7057[_0x68c4('0x54')]['ids'][_0x68c4('0x45')];_0x2a515a+=0x1){socket[_0x68c4('0x7c')]('userVoiceQueue:save',{'UserId':Number(_0x1a7057[_0x68c4('0x54')]['ids'][_0x2a515a]),'VoiceQueueId':Number(_0x1a7057[_0x68c4('0x5b')]['id'])});}return _0x5343f1;});}})[_0x68c4('0x34')](function(_0x4769d0){_0x51d63d=_0x4769d0||[];if(_0x22276a){return db[_0x68c4('0x6d')][_0x68c4('0x4f')]({'where':{'id':_0x1a7057[_0x68c4('0x54')]['ids']},'attributes':['id',_0x68c4('0x32'),_0x68c4('0x6f'),_0x68c4('0x7b'),_0x68c4('0x70')],'raw':!![]});}})['then'](function(_0x525c3f){if(!_[_0x68c4('0x8f')](_0x525c3f)){var _0x38ff95=[];for(var _0x4db93c=0x0;_0x4db93c<_0x525c3f['length'];_0x4db93c++){if(_0x525c3f[_0x4db93c]['online']){_0x38ff95[_0x68c4('0x94')](db['UserVoiceQueueRt'][_0x68c4('0x76')]({'membername':_0x525c3f[_0x4db93c][_0x68c4('0x32')],'UserId':_0x525c3f[_0x4db93c]['id'],'queue_name':_0x22276a[_0x68c4('0x32')],'VoiceQueueId':_0x22276a['id'],'interface':_['isNil'](_0x525c3f[_0x4db93c]['interface'])?util[_0x68c4('0x79')](_0x68c4('0x7a'),_0x525c3f[_0x4db93c][_0x68c4('0x32')]):_0x525c3f[_0x4db93c][_0x68c4('0x70')],'paused':_0x525c3f[_0x4db93c][_0x68c4('0x7b')]||![],'penalty':_0x1a7057[_0x68c4('0x54')][_0x68c4('0x73')]||0x0}));}}return BPromise[_0x68c4('0x95')](_0x38ff95);}})['then'](function(){return _0x51d63d;})[_0x68c4('0x34')](respondWithResult(_0x2d6c9a,null))[_0x68c4('0x51')](handleError(_0x2d6c9a,null));};exports[_0x68c4('0x90')]=function(_0x5afc0a,_0x47f307,_0x2cc6ae){return db[_0x68c4('0x3a')][_0x68c4('0x31')]({'where':{'id':_0x5afc0a['params']['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x47f307,null))[_0x68c4('0x34')](function(_0x32a565){if(_0x32a565){return _0x32a565[_0x68c4('0x90')](_0x5afc0a[_0x68c4('0x3e')][_0x68c4('0x8e')])[_0x68c4('0x34')](function(){if(_['isArray'](_0x5afc0a[_0x68c4('0x3e')]['ids'])){for(var _0x410973=0x0;_0x410973<_0x5afc0a[_0x68c4('0x3e')][_0x68c4('0x8e')][_0x68c4('0x45')];_0x410973+=0x1){socket[_0x68c4('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x5afc0a[_0x68c4('0x3e')][_0x68c4('0x8e')][_0x410973]),'VoiceQueueId':Number(_0x5afc0a[_0x68c4('0x5b')]['id'])});}}else{socket['emit'](_0x68c4('0x92'),{'UserId':Number(_0x5afc0a[_0x68c4('0x3e')][_0x68c4('0x8e')]),'VoiceQueueId':Number(_0x5afc0a[_0x68c4('0x5b')]['id'])});}});}})[_0x68c4('0x34')](function(_0x3f4c7b){return db['UserVoiceQueueRt'][_0x68c4('0x26')]({'where':{'VoiceQueueId':_0x5afc0a[_0x68c4('0x5b')]['id'],'UserId':_0x5afc0a[_0x68c4('0x3e')]['ids']}})[_0x68c4('0x34')](function(){return _0x3f4c7b;});})[_0x68c4('0x34')](respondWithStatusCode(_0x47f307,null))['catch'](handleError(_0x47f307,null));};exports['getAgents']=function(_0x53e78d,_0x2bde6f,_0x297f5a){var _0x792f08={};var _0x754694={};var _0x4843cb;var _0x5cb555;return db['VoiceQueue'][_0x68c4('0x61')]({'where':{'id':_0x53e78d[_0x68c4('0x5b')]['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x2bde6f,null))[_0x68c4('0x34')](function(_0x42c0ab){if(_0x42c0ab){_0x4843cb=_0x42c0ab;_0x754694[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db['User'][_0x68c4('0x3b')]);_0x754694[_0x68c4('0x3e')]=_[_0x68c4('0x3f')](_0x53e78d[_0x68c4('0x3e')]);_0x754694[_0x68c4('0x40')]=_[_0x68c4('0x41')](_0x754694[_0x68c4('0x42')],_0x754694[_0x68c4('0x3e')]);_0x792f08[_0x68c4('0x43')]=_['intersection'](_0x754694[_0x68c4('0x42')],qs[_0x68c4('0x44')](_0x53e78d[_0x68c4('0x3e')][_0x68c4('0x44')]));_0x792f08[_0x68c4('0x43')]=_0x792f08[_0x68c4('0x43')][_0x68c4('0x45')]?_0x792f08[_0x68c4('0x43')]:_0x754694[_0x68c4('0x42')];_0x792f08[_0x68c4('0x63')]=qs[_0x68c4('0x48')](_0x53e78d[_0x68c4('0x3e')][_0x68c4('0x48')]);_0x792f08[_0x68c4('0x4a')]=qs[_0x68c4('0x40')](_['pick'](_0x53e78d['query'],_0x754694[_0x68c4('0x40')]));if(_0x53e78d[_0x68c4('0x3e')][_0x68c4('0x2c')]){_0x792f08[_0x68c4('0x4a')]=_[_0x68c4('0x4b')](_0x792f08['where'],{'$or':_['map'](_0x792f08[_0x68c4('0x43')],function(_0x525839){var _0x4285b1={};_0x4285b1[_0x525839]={'$like':'%'+_0x53e78d[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0x4285b1;})});}_0x792f08=_[_0x68c4('0x4b')]({},_0x792f08,_0x53e78d[_0x68c4('0x4d')]);return _0x4843cb[_0x68c4('0x96')](_0x792f08);}})['then'](function(_0x3c008a){if(_0x3c008a){_0x5cb555=_0x3c008a['length'];if(!_0x53e78d[_0x68c4('0x3e')][_0x68c4('0x46')](_0x68c4('0x47'))){_0x792f08[_0x68c4('0x1f')]=qs['limit'](_0x53e78d[_0x68c4('0x3e')][_0x68c4('0x1f')]);_0x792f08[_0x68c4('0x1d')]=qs[_0x68c4('0x1d')](_0x53e78d[_0x68c4('0x3e')][_0x68c4('0x1d')]);}return _0x4843cb['getAgents'](_0x792f08);}})['then'](function(_0x44f028){if(_0x44f028){return _0x44f028?{'count':_0x5cb555,'rows':_0x44f028}:null;}})['then'](respondWithResult(_0x2bde6f,null))[_0x68c4('0x51')](handleError(_0x2bde6f,null));};exports[_0x68c4('0x97')]=function(_0x536262,_0x761be5,_0x14f02f){var _0x574f30={};var _0x16e4a1={};var _0x5ace9e;var _0x29f9dd;return db[_0x68c4('0x3a')]['findOne']({'where':{'id':_0x536262['params']['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x761be5,null))['then'](function(_0x26a719){if(_0x26a719){_0x5ace9e=_0x26a719;_0x16e4a1[_0x68c4('0x42')]=_['keys'](db['UserVoiceQueueRt'][_0x68c4('0x3b')]);_0x16e4a1[_0x68c4('0x3e')]=_[_0x68c4('0x3f')](_0x536262[_0x68c4('0x3e')]);_0x16e4a1[_0x68c4('0x40')]=_[_0x68c4('0x41')](_0x16e4a1['model'],_0x16e4a1[_0x68c4('0x3e')]);_0x574f30[_0x68c4('0x43')]=_['intersection'](_0x16e4a1[_0x68c4('0x42')],qs[_0x68c4('0x44')](_0x536262[_0x68c4('0x3e')][_0x68c4('0x44')]));_0x574f30[_0x68c4('0x43')]=_0x574f30[_0x68c4('0x43')]['length']?_0x574f30[_0x68c4('0x43')]:_0x16e4a1[_0x68c4('0x42')];_0x574f30[_0x68c4('0x63')]=qs[_0x68c4('0x48')](_0x536262[_0x68c4('0x3e')][_0x68c4('0x48')]);_0x574f30[_0x68c4('0x4a')]=qs[_0x68c4('0x40')](_[_0x68c4('0x49')](_0x536262[_0x68c4('0x3e')],_0x16e4a1['filters']));if(_0x536262['query']['filter']){_0x574f30[_0x68c4('0x4a')]=_[_0x68c4('0x4b')](_0x574f30['where'],{'$or':_[_0x68c4('0x2d')](_0x574f30['attributes'],function(_0x450986){var _0xe4914b={};_0xe4914b[_0x450986]={'$like':'%'+_0x536262[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0xe4914b;})});}_0x574f30=_[_0x68c4('0x4b')]({},_0x574f30,_0x536262['options']);return _0x5ace9e[_0x68c4('0x97')](_0x574f30);}})['then'](function(_0x8e4a98){if(_0x8e4a98){_0x29f9dd=_0x8e4a98[_0x68c4('0x45')];if(!_0x536262[_0x68c4('0x3e')][_0x68c4('0x46')](_0x68c4('0x47'))){_0x574f30[_0x68c4('0x1f')]=qs[_0x68c4('0x1f')](_0x536262['query'][_0x68c4('0x1f')]);_0x574f30['offset']=qs[_0x68c4('0x1d')](_0x536262[_0x68c4('0x3e')][_0x68c4('0x1d')]);}return _0x5ace9e[_0x68c4('0x97')](_0x574f30);}})[_0x68c4('0x34')](function(_0x6150c6){return _0x6150c6?{'count':_0x29f9dd,'rows':_0x6150c6}:null;})[_0x68c4('0x34')](respondWithResult(_0x761be5,null))[_0x68c4('0x51')](handleError(_0x761be5,null));};exports[_0x68c4('0x98')]=function(_0x32cfa8,_0x5be923,_0x3e07fa){var _0x4b6321={};var _0x3c982a={};var _0x1f91b7;var _0x3f5d06;return db['VoiceQueue']['findOne']({'where':{'id':_0x32cfa8[_0x68c4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5be923,null))[_0x68c4('0x34')](function(_0x1abafa){if(_0x1abafa){_0x1f91b7=_0x1abafa;_0x3c982a[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db[_0x68c4('0x99')][_0x68c4('0x3b')]);_0x3c982a[_0x68c4('0x3e')]=_['keys'](_0x32cfa8['query']);_0x3c982a['filters']=_[_0x68c4('0x41')](_0x3c982a[_0x68c4('0x42')],_0x3c982a['query']);_0x4b6321[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0x3c982a[_0x68c4('0x42')],qs[_0x68c4('0x44')](_0x32cfa8[_0x68c4('0x3e')][_0x68c4('0x44')]));_0x4b6321[_0x68c4('0x43')]=_0x4b6321[_0x68c4('0x43')][_0x68c4('0x45')]?_0x4b6321[_0x68c4('0x43')]:_0x3c982a['model'];_0x4b6321[_0x68c4('0x63')]=qs[_0x68c4('0x48')](_0x32cfa8[_0x68c4('0x3e')][_0x68c4('0x48')]);_0x4b6321['where']=qs[_0x68c4('0x40')](_[_0x68c4('0x49')](_0x32cfa8[_0x68c4('0x3e')],_0x3c982a[_0x68c4('0x40')]));if(_0x32cfa8[_0x68c4('0x3e')][_0x68c4('0x2c')]){_0x4b6321[_0x68c4('0x4a')]=_['merge'](_0x4b6321[_0x68c4('0x4a')],{'$or':_['map'](_0x4b6321[_0x68c4('0x43')],function(_0x462b58){var _0x2de851={};_0x2de851[_0x462b58]={'$like':'%'+_0x32cfa8[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0x2de851;})});}_0x4b6321=_[_0x68c4('0x4b')]({},_0x4b6321,_0x32cfa8[_0x68c4('0x4d')]);return _0x1f91b7[_0x68c4('0x98')](_0x4b6321);}})['then'](function(_0x3f45be){if(_0x3f45be){_0x3f5d06=_0x3f45be['length'];if(!_0x32cfa8[_0x68c4('0x3e')][_0x68c4('0x46')]('nolimit')){_0x4b6321['limit']=qs[_0x68c4('0x1f')](_0x32cfa8[_0x68c4('0x3e')][_0x68c4('0x1f')]);_0x4b6321[_0x68c4('0x1d')]=qs[_0x68c4('0x1d')](_0x32cfa8['query'][_0x68c4('0x1d')]);}return _0x1f91b7[_0x68c4('0x98')](_0x4b6321);}})[_0x68c4('0x34')](function(_0x5ed4c0){if(_0x5ed4c0){return _0x5ed4c0?{'count':_0x3f5d06,'rows':_0x5ed4c0}:null;}})[_0x68c4('0x34')](respondWithResult(_0x5be923,null))['catch'](handleError(_0x5be923,null));};exports[_0x68c4('0x9a')]=function(_0x14538e,_0x44ff59,_0x2d3def){var _0x35e37a=moment()[_0x68c4('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x76cd3,_0x24fab4;return db[_0x68c4('0x3a')][_0x68c4('0x31')]({'where':{'id':_0x14538e[_0x68c4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x44ff59,null))[_0x68c4('0x34')](function(_0x4e4ffa){if(_0x4e4ffa){_0x24fab4=_0x4e4ffa;return _0x4e4ffa['addLists'](_0x14538e[_0x68c4('0x54')][_0x68c4('0x8e')],_[_0x68c4('0x5c')](_0x14538e[_0x68c4('0x54')],[_0x68c4('0x8e'),'id'])||{});}return null;})[_0x68c4('0x9b')](function(_0x136782){var _0x2782c5;_0x76cd3=_0x136782||[];var _0x204e20=[];if(_0x136782){for(var _0x5cd266=0x0;_0x5cd266<_0x136782[_0x68c4('0x45')];_0x5cd266+=0x1){var _0x3757ea=_0x136782[_0x5cd266]['get']({'plain':!![]});_0x24fab4[_0x68c4('0x9c')]=_0x14538e['body']['dialCheckDuplicateType']?_0x14538e[_0x68c4('0x54')][_0x68c4('0x9c')]:_0x24fab4[_0x68c4('0x9c')];switch(_0x24fab4[_0x68c4('0x9c')]){case'always':_0x2782c5=squel[_0x68c4('0x9d')]()[_0x68c4('0x9e')](_0x68c4('0x9f'))[_0x68c4('0xa0')]([_0x68c4('0xa1'),_0x68c4('0xa2'),_0x68c4('0xa3'),_0x68c4('0xa4'),_0x68c4('0x66'),_0x68c4('0x5d'),'updatedAt'],squel[_0x68c4('0xa5')]()[_0x68c4('0x7e')](_0x68c4('0xa1'),_0x68c4('0xa1'))[_0x68c4('0x7e')]('\x27'+_0x35e37a+'\x27',_0x68c4('0xa2'))[_0x68c4('0x7e')]('id',_0x68c4('0xa3'))[_0x68c4('0x7e')](_0x3757ea[_0x68c4('0xa6')][_0x68c4('0xa7')](),'ListId')[_0x68c4('0x7e')](_0x14538e[_0x68c4('0x5b')]['id']['toString'](),_0x68c4('0x66'))[_0x68c4('0x7e')]('\x27'+_0x35e37a+'\x27',_0x68c4('0x5d'))['field']('\x27'+_0x35e37a+'\x27',_0x68c4('0x5e'))[_0x68c4('0x7f')](_0x68c4('0xa8'))[_0x68c4('0x4a')](_0x68c4('0xa9'))[_0x68c4('0x4a')]('ListId\x20=\x20?',_0x3757ea[_0x68c4('0xa6')]['toString']())['where'](_0x68c4('0xaa'))[_0x68c4('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x68c4('0xa5')]()[_0x68c4('0x7e')](_0x68c4('0xab'))[_0x68c4('0x7f')](_0x68c4('0xac'))['where'](_0x68c4('0x84'),_0x14538e['params']['id'][_0x68c4('0xa7')]()))['where'](_0x68c4('0xad'),squel[_0x68c4('0xa5')]()[_0x68c4('0x7e')]('COALESCE(phone,\x27\x27)')[_0x68c4('0x7f')](_0x68c4('0x9f'))[_0x68c4('0x4a')](_0x68c4('0x84'),_0x14538e[_0x68c4('0x5b')]['id'][_0x68c4('0xa7')]())))['toString']();break;case _0x68c4('0xae'):_0x2782c5=squel['insert']()[_0x68c4('0x9e')]('cm_hopper')['fromQuery']([_0x68c4('0xa1'),_0x68c4('0xa2'),'ContactId',_0x68c4('0xa4'),'VoiceQueueId',_0x68c4('0x5d'),'updatedAt'],squel['select']()[_0x68c4('0x7e')](_0x68c4('0xa1'),_0x68c4('0xa1'))['field']('\x27'+_0x35e37a+'\x27','scheduledAt')[_0x68c4('0x7e')]('id',_0x68c4('0xa3'))[_0x68c4('0x7e')](_0x3757ea[_0x68c4('0xa6')][_0x68c4('0xa7')](),_0x68c4('0xa4'))[_0x68c4('0x7e')](_0x14538e['params']['id']['toString'](),_0x68c4('0x66'))[_0x68c4('0x7e')]('\x27'+_0x35e37a+'\x27','createdAt')[_0x68c4('0x7e')]('\x27'+_0x35e37a+'\x27',_0x68c4('0x5e'))[_0x68c4('0x7f')]('cm_contacts')[_0x68c4('0x4a')](_0x68c4('0xa9'))[_0x68c4('0x4a')](_0x68c4('0xaf'),_0x3757ea[_0x68c4('0xa6')][_0x68c4('0xa7')]())['where'](_0x68c4('0xaa'))[_0x68c4('0x4a')](_0x68c4('0xad'),squel[_0x68c4('0xa5')]()[_0x68c4('0x7e')](_0x68c4('0xb0'))[_0x68c4('0x7f')](_0x68c4('0x9f'))[_0x68c4('0x4a')]('VoiceQueueId\x20=\x20?',_0x14538e[_0x68c4('0x5b')]['id'][_0x68c4('0xa7')]())))[_0x68c4('0xa7')]();break;default:_0x2782c5=squel[_0x68c4('0x9d')]()[_0x68c4('0x9e')](_0x68c4('0x9f'))[_0x68c4('0xa0')]([_0x68c4('0xa1'),_0x68c4('0xa2'),_0x68c4('0xa3'),_0x68c4('0xa4'),_0x68c4('0x66'),_0x68c4('0x5d'),_0x68c4('0x5e')],squel[_0x68c4('0xa5')]()[_0x68c4('0x7e')](_0x68c4('0xa1'),_0x68c4('0xa1'))[_0x68c4('0x7e')]('\x27'+_0x35e37a+'\x27','scheduledAt')['field']('id',_0x68c4('0xa3'))['field'](_0x3757ea[_0x68c4('0xa6')][_0x68c4('0xa7')](),'ListId')[_0x68c4('0x7e')](_0x14538e['params']['id'][_0x68c4('0xa7')](),_0x68c4('0x66'))[_0x68c4('0x7e')]('\x27'+_0x35e37a+'\x27',_0x68c4('0x5d'))[_0x68c4('0x7e')]('\x27'+_0x35e37a+'\x27','updatedAt')[_0x68c4('0x7f')](_0x68c4('0xa8'))['where'](_0x68c4('0xa9'))[_0x68c4('0x4a')]('ListId\x20=\x20?',_0x3757ea[_0x68c4('0xa6')]['toString']())['where'](_0x68c4('0xaa')))['toString']();}_0x204e20[_0x68c4('0x94')](db['sequelize'][_0x68c4('0x3e')](_0x2782c5));}return BPromise['all'](_0x204e20);}})['then'](function(){var _0x131281=[];var _0xa46915=squel['insert']()[_0x68c4('0x9e')]('cm_hopper_additional_phones')[_0x68c4('0xa0')](['CmHopperId',_0x68c4('0xa1'),_0x68c4('0xb1'),_0x68c4('0x5d'),_0x68c4('0x5e')],squel['select']()[_0x68c4('0x7e')](_0x68c4('0xb2'))[_0x68c4('0x7e')](_0x68c4('0xb3'))[_0x68c4('0x7e')](_0x68c4('0xb4'))['field']('\x27'+_0x35e37a+'\x27',_0x68c4('0x5d'))[_0x68c4('0x7e')]('\x27'+_0x35e37a+'\x27',_0x68c4('0x5e'))[_0x68c4('0x7f')](_0x68c4('0xb5'),'ci')['join'](_0x68c4('0x9f'),'h',_0x68c4('0xb6'))[_0x68c4('0x4a')](_0x68c4('0xb7'),_0x35e37a)[_0x68c4('0x4a')](_0x68c4('0xb8'),_0x68c4('0xb9')))['toString']();_0x131281[_0x68c4('0x94')](db[_0x68c4('0x86')][_0x68c4('0x3e')](_0xa46915));return BPromise[_0x68c4('0x95')](_0x131281);})['then'](function(){return _0x76cd3;})[_0x68c4('0x34')](respondWithResult(_0x44ff59,null))[_0x68c4('0x51')](handleError(_0x44ff59,null));};exports[_0x68c4('0xba')]=function(_0x209ae8,_0x421a7b,_0x5430b1){return db[_0x68c4('0x3a')]['find']({'where':{'id':_0x209ae8['params']['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x421a7b,null))[_0x68c4('0x34')](function(_0x45f198){if(_0x45f198){return _0x45f198[_0x68c4('0xba')](_0x209ae8[_0x68c4('0x3e')][_0x68c4('0x8e')]);}})[_0x68c4('0x34')](function(_0x18236e){if(_0x18236e){return db['CmHopper'][_0x68c4('0x26')]({'where':{'ListId':_0x209ae8[_0x68c4('0x3e')][_0x68c4('0x8e')],'VoiceQueueId':_0x209ae8['params']['id']}})['then'](function(){return _0x18236e;});}})['then'](respondWithStatusCode(_0x421a7b,null))['catch'](handleError(_0x421a7b,null));};exports[_0x68c4('0xbb')]=function(_0x4191fe,_0x5d1d0,_0x2682e6){var _0x5e1014={};var _0x2ed260={};var _0x2cbb90;var _0x5c09ef;return db['VoiceQueue'][_0x68c4('0x61')]({'where':{'id':_0x4191fe['params']['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x5d1d0,null))[_0x68c4('0x34')](function(_0x16d537){if(_0x16d537){_0x2cbb90=_0x16d537;_0x2ed260[_0x68c4('0x42')]=_[_0x68c4('0x3f')](db[_0x68c4('0x99')][_0x68c4('0x3b')]);_0x2ed260['query']=_[_0x68c4('0x3f')](_0x4191fe[_0x68c4('0x3e')]);_0x2ed260[_0x68c4('0x40')]=_[_0x68c4('0x41')](_0x2ed260['model'],_0x2ed260[_0x68c4('0x3e')]);_0x5e1014[_0x68c4('0x43')]=_[_0x68c4('0x41')](_0x2ed260[_0x68c4('0x42')],qs[_0x68c4('0x44')](_0x4191fe[_0x68c4('0x3e')][_0x68c4('0x44')]));_0x5e1014['attributes']=_0x5e1014[_0x68c4('0x43')][_0x68c4('0x45')]?_0x5e1014['attributes']:_0x2ed260[_0x68c4('0x42')];_0x5e1014['order']=qs[_0x68c4('0x48')](_0x4191fe['query'][_0x68c4('0x48')]);_0x5e1014[_0x68c4('0x4a')]=qs[_0x68c4('0x40')](_[_0x68c4('0x49')](_0x4191fe['query'],_0x2ed260[_0x68c4('0x40')]));if(_0x4191fe[_0x68c4('0x3e')][_0x68c4('0x2c')]){_0x5e1014['where']=_[_0x68c4('0x4b')](_0x5e1014[_0x68c4('0x4a')],{'$or':_[_0x68c4('0x2d')](_0x5e1014[_0x68c4('0x43')],function(_0x16869a){var _0xadc66d={};_0xadc66d[_0x16869a]={'$like':'%'+_0x4191fe[_0x68c4('0x3e')][_0x68c4('0x2c')]+'%'};return _0xadc66d;})});}_0x5e1014=_[_0x68c4('0x4b')]({},_0x5e1014,_0x4191fe[_0x68c4('0x4d')]);return _0x2cbb90[_0x68c4('0xbb')](_0x5e1014);}})[_0x68c4('0x34')](function(_0x3244d8){if(_0x3244d8){_0x5c09ef=_0x3244d8[_0x68c4('0x45')];if(!_0x4191fe[_0x68c4('0x3e')]['hasOwnProperty'](_0x68c4('0x47'))){_0x5e1014[_0x68c4('0x1f')]=qs[_0x68c4('0x1f')](_0x4191fe[_0x68c4('0x3e')][_0x68c4('0x1f')]);_0x5e1014[_0x68c4('0x1d')]=qs[_0x68c4('0x1d')](_0x4191fe[_0x68c4('0x3e')][_0x68c4('0x1d')]);}return _0x2cbb90[_0x68c4('0xbb')](_0x5e1014);}})[_0x68c4('0x34')](function(_0x41e6c4){if(_0x41e6c4){return _0x41e6c4?{'count':_0x5c09ef,'rows':_0x41e6c4}:null;}})[_0x68c4('0x34')](respondWithResult(_0x5d1d0,null))[_0x68c4('0x51')](handleError(_0x5d1d0,null));};exports['addBlackLists']=function(_0x3d155a,_0x8e3fd9,_0x1b3554){var _0x28e0c4,_0x12c06a;return db[_0x68c4('0x3a')][_0x68c4('0x31')]({'where':{'id':_0x3d155a['params']['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x8e3fd9,null))[_0x68c4('0x34')](function(_0x35ad90){if(_0x35ad90){_0x12c06a=_0x35ad90;return _0x35ad90[_0x68c4('0xbc')](_0x3d155a[_0x68c4('0x54')][_0x68c4('0x8e')],_['omit'](_0x3d155a[_0x68c4('0x54')],[_0x68c4('0x8e'),'id'])||{});}return null;})[_0x68c4('0x9b')](function(_0x14555a){var _0xe8c33f;_0x28e0c4=_0x14555a||[];var _0x27a10c=[];if(_0x14555a){for(var _0x4e1bc5=0x0;_0x4e1bc5<_0x14555a[_0x68c4('0x45')];_0x4e1bc5+=0x1){var _0x8fc106=_0x14555a[_0x4e1bc5][_0x68c4('0x27')]({'plain':!![]});_0xe8c33f=squel[_0x68c4('0x9d')]()['into'](_0x68c4('0xbd'))[_0x68c4('0xa0')]([_0x68c4('0xa1'),_0x68c4('0xa3'),_0x68c4('0xa4'),_0x68c4('0x66'),_0x68c4('0x5d'),_0x68c4('0x5e')],squel[_0x68c4('0xa5')]()[_0x68c4('0x7e')](_0x68c4('0xa1'),'phone')[_0x68c4('0x7e')]('id','ContactId')['field'](_0x8fc106[_0x68c4('0xa6')][_0x68c4('0xa7')](),'ListId')[_0x68c4('0x7e')](_0x3d155a[_0x68c4('0x5b')]['id'][_0x68c4('0xa7')](),_0x68c4('0x66'))[_0x68c4('0x7e')]('NOW()',_0x68c4('0x5d'))['field'](_0x68c4('0xbe'),_0x68c4('0x5e'))[_0x68c4('0x7f')](_0x68c4('0xa8'))[_0x68c4('0x4a')]('deletedAt\x20IS\x20NULL')[_0x68c4('0x4a')](_0x68c4('0xaf'),_0x8fc106['CmListId'][_0x68c4('0xa7')]())[_0x68c4('0x4a')](_0x68c4('0xaa')))[_0x68c4('0xa7')]();_0x27a10c[_0x68c4('0x94')](db[_0x68c4('0x86')][_0x68c4('0x3e')](_0xe8c33f));}return BPromise['all'](_0x27a10c);}})[_0x68c4('0x34')](function(){return _0x28e0c4;})[_0x68c4('0x34')](respondWithResult(_0x8e3fd9,null))['catch'](handleError(_0x8e3fd9,null));};exports[_0x68c4('0xbf')]=function(_0x4647cd,_0x58cc75,_0xc4f30){return db[_0x68c4('0x3a')]['find']({'where':{'id':_0x4647cd['params']['id']}})[_0x68c4('0x34')](handleEntityNotFound(_0x58cc75,null))[_0x68c4('0x34')](function(_0x20e00f){if(_0x20e00f){return _0x20e00f[_0x68c4('0xbf')](_0x4647cd[_0x68c4('0x3e')]['ids']);}})[_0x68c4('0x34')](function(_0x349564){if(_0x349564){return db['CmHopperBlack'][_0x68c4('0x26')]({'where':{'ListId':_0x4647cd[_0x68c4('0x3e')][_0x68c4('0x8e')],'VoiceQueueId':_0x4647cd['params']['id']}})[_0x68c4('0x34')](function(){return _0x349564;});}})[_0x68c4('0x34')](respondWithStatusCode(_0x58cc75,null))[_0x68c4('0x51')](handleError(_0x58cc75,null));}; \ No newline at end of file +var _0x323f=['updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','SIP/%s','emit','removeTeams','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','SELECT','every','all','union','ids','isEmpty','addAgents','spread','userVoiceQueue:save','format','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','ci.ItemClass=?','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','find','UserProfileResource','destroy','error','stack','name','index','rawAttributes','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VoiceQueue','includeAll','include','rows','catch','show','params','intersection','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt'];(function(_0x5415e9,_0x9a53d8){var _0x1f695f=function(_0x29f0a2){while(--_0x29f0a2){_0x5415e9['push'](_0x5415e9['shift']());}};_0x1f695f(++_0x9a53d8);}(_0x323f,0x1ee));var _0xf323=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x323f[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf323('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf323('0x1'));var rp=require(_0xf323('0x2'));var moment=require(_0xf323('0x3'));var BPromise=require(_0xf323('0x4'));var Mustache=require(_0xf323('0x5'));var util=require(_0xf323('0x6'));var path=require(_0xf323('0x7'));var sox=require(_0xf323('0x8'));var csv=require(_0xf323('0x9'));var ejs=require(_0xf323('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf323('0xb'));var squel=require(_0xf323('0xc'));var crypto=require(_0xf323('0xd'));var jsforce=require(_0xf323('0xe'));var deskjs=require(_0xf323('0xf'));var toCsv=require(_0xf323('0x9'));var querystring=require(_0xf323('0x10'));var Papa=require(_0xf323('0x11'));var Redis=require(_0xf323('0x12'));var authService=require(_0xf323('0x13'));var qs=require(_0xf323('0x14'));var as=require(_0xf323('0x15'));var hardwareService=require(_0xf323('0x16'));var logger=require(_0xf323('0x17'))(_0xf323('0x18'));var utils=require(_0xf323('0x19'));var config=require(_0xf323('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf323('0x1b'))['db'];config[_0xf323('0x1c')]=_[_0xf323('0x1d')](config['redis'],{'host':_0xf323('0x1e'),'port':0x18eb});var socket=require(_0xf323('0x1f'))(new Redis(config[_0xf323('0x1c')]));require(_0xf323('0x20'))[_0xf323('0x21')](socket);function respondWithStatusCode(_0x144db9,_0x59ffbc){_0x59ffbc=_0x59ffbc||0xcc;return function(_0x4cc3ce){if(_0x4cc3ce){return _0x144db9[_0xf323('0x22')](_0x59ffbc);}return _0x144db9[_0xf323('0x23')](_0x59ffbc)[_0xf323('0x24')]();};}function respondWithResult(_0x3858ee,_0x3db58a){_0x3db58a=_0x3db58a||0xc8;return function(_0x55d87d){if(_0x55d87d){return _0x3858ee[_0xf323('0x23')](_0x3db58a)[_0xf323('0x25')](_0x55d87d);}};}function respondWithFilteredResult(_0xb9859f,_0x44671c){return function(_0x49b115){if(_0x49b115){var _0x2db977=typeof _0x44671c[_0xf323('0x26')]===_0xf323('0x27')&&typeof _0x44671c[_0xf323('0x28')]==='undefined';var _0x409b16=_0x49b115[_0xf323('0x29')];var _0x5baab2=_0x2db977?0x0:_0x44671c[_0xf323('0x26')];var _0x44378e=_0x2db977?_0x49b115[_0xf323('0x29')]:_0x44671c[_0xf323('0x26')]+_0x44671c['limit'];var _0xdc7891;if(_0x44378e>=_0x409b16){_0x44378e=_0x409b16;_0xdc7891=0xc8;}else{_0xdc7891=0xce;}_0xb9859f[_0xf323('0x23')](_0xdc7891);return _0xb9859f[_0xf323('0x2a')]('Content-Range',_0x5baab2+'-'+_0x44378e+'/'+_0x409b16)[_0xf323('0x25')](_0x49b115);}return null;};}function patchUpdates(_0x375473){return function(_0x3e1c49){try{jsonpatch[_0xf323('0x2b')](_0x3e1c49,_0x375473,!![]);}catch(_0x13ec1f){return BPromise[_0xf323('0x2c')](_0x13ec1f);}return _0x3e1c49[_0xf323('0x2d')]();};}function saveUpdates(_0x43bc05,_0x44d324){return function(_0x47fb15){if(_0x47fb15){return _0x47fb15[_0xf323('0x2e')](_0x43bc05)[_0xf323('0x2f')](function(_0x33dc52){return _0x33dc52;});}return null;};}function removeEntity(_0x292ce0,_0x87ec45){return function(_0x1027a7){if(_0x1027a7){return _0x1027a7['destroy']()[_0xf323('0x2f')](function(){var _0x56ce33=_0x1027a7[_0xf323('0x30')]({'plain':!![]});var _0x3902eb=[{'name':'VoiceQueues','value':_0xf323('0x31'),'ignore':![]},{'name':_0xf323('0x32'),'value':_0xf323('0x33'),'ignore':![]}];var _0x3dcf65=_(_0x3902eb)[_0xf323('0x34')]('ignore')[_0xf323('0x35')](_0xf323('0x36'))[_0xf323('0x36')]();if(_[_0xf323('0x37')](_0x3dcf65,_0x56ce33[_0xf323('0x38')])){return;}var _0x36bd3f=_[_0xf323('0x39')](_0x3902eb,[_0xf323('0x36'),_0x56ce33[_0xf323('0x38')]])['name'];return db[_0xf323('0x3a')][_0xf323('0x3b')]({'where':{'type':_0x36bd3f,'resourceId':_0x56ce33['id']}})[_0xf323('0x2f')](function(){return _0x1027a7;});})[_0xf323('0x2f')](function(){_0x292ce0[_0xf323('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9bd304,_0x41bc31){return function(_0x2c9b8f){if(!_0x2c9b8f){_0x9bd304[_0xf323('0x22')](0x194);}return _0x2c9b8f;};}function handleError(_0x3c849a,_0x485cbf){_0x485cbf=_0x485cbf||0x1f4;return function(_0x33487c){logger[_0xf323('0x3c')](_0x33487c[_0xf323('0x3d')]);if(_0x33487c[_0xf323('0x3e')]){delete _0x33487c['name'];}_0x3c849a[_0xf323('0x23')](_0x485cbf)['send'](_0x33487c);};}exports[_0xf323('0x3f')]=function(_0x14f9fd,_0x4ff3c1){var _0x3dcac7={},_0x47ba23={},_0x3c6a07={'count':0x0,'rows':[]};var _0x4a49d2=_[_0xf323('0x35')](db['VoiceQueue'][_0xf323('0x40')],function(_0x82a6ca){return{'name':_0x82a6ca['fieldName'],'type':_0x82a6ca['type']['key']};});_0x47ba23[_0xf323('0x41')]=_[_0xf323('0x35')](_0x4a49d2,_0xf323('0x3e'));_0x47ba23[_0xf323('0x42')]=_[_0xf323('0x43')](_0x14f9fd['query']);_0x47ba23['filters']=_['intersection'](_0x47ba23[_0xf323('0x41')],_0x47ba23['query']);_0x3dcac7[_0xf323('0x44')]=_['intersection'](_0x47ba23[_0xf323('0x41')],qs[_0xf323('0x45')](_0x14f9fd[_0xf323('0x42')][_0xf323('0x45')]));_0x3dcac7[_0xf323('0x44')]=_0x3dcac7['attributes'][_0xf323('0x46')]?_0x3dcac7[_0xf323('0x44')]:_0x47ba23[_0xf323('0x41')];if(!_0x14f9fd[_0xf323('0x42')][_0xf323('0x47')](_0xf323('0x48'))){_0x3dcac7[_0xf323('0x28')]=qs[_0xf323('0x28')](_0x14f9fd[_0xf323('0x42')][_0xf323('0x28')]);_0x3dcac7[_0xf323('0x26')]=qs[_0xf323('0x26')](_0x14f9fd[_0xf323('0x42')][_0xf323('0x26')]);}_0x3dcac7[_0xf323('0x49')]=qs[_0xf323('0x4a')](_0x14f9fd['query']['sort']);_0x3dcac7[_0xf323('0x4b')]=qs[_0xf323('0x4c')](_[_0xf323('0x4d')](_0x14f9fd[_0xf323('0x42')],_0x47ba23[_0xf323('0x4c')]),_0x4a49d2);if(_0x14f9fd[_0xf323('0x42')][_0xf323('0x34')]){_0x3dcac7[_0xf323('0x4b')]=_[_0xf323('0x4e')](_0x3dcac7[_0xf323('0x4b')],{'$or':_[_0xf323('0x35')](_0x4a49d2,function(_0x247149){if(_0x247149[_0xf323('0x38')]!=='VIRTUAL'){var _0x3cc1bb={};_0x3cc1bb[_0x247149['name']]={'$like':'%'+_0x14f9fd['query'][_0xf323('0x34')]+'%'};return _0x3cc1bb;}})});}_0x3dcac7=_['merge']({},_0x3dcac7,_0x14f9fd['options']);var _0xa5910e={'where':_0x3dcac7[_0xf323('0x4b')]};return db[_0xf323('0x4f')][_0xf323('0x29')](_0xa5910e)[_0xf323('0x2f')](function(_0x19b5d4){_0x3c6a07[_0xf323('0x29')]=_0x19b5d4;if(_0x14f9fd[_0xf323('0x42')][_0xf323('0x50')]){_0x3dcac7[_0xf323('0x51')]=[{'all':!![]}];}return db[_0xf323('0x4f')]['findAll'](_0x3dcac7);})[_0xf323('0x2f')](function(_0x5e61d9){_0x3c6a07[_0xf323('0x52')]=_0x5e61d9;return _0x3c6a07;})[_0xf323('0x2f')](respondWithFilteredResult(_0x4ff3c1,_0x3dcac7))[_0xf323('0x53')](handleError(_0x4ff3c1,null));};exports[_0xf323('0x54')]=function(_0x542205,_0x57dbe2){var _0x36b688={'raw':![],'where':{'id':_0x542205[_0xf323('0x55')]['id']}},_0x5e284f={};_0x5e284f['model']=_[_0xf323('0x43')](db[_0xf323('0x4f')]['rawAttributes']);_0x5e284f[_0xf323('0x42')]=_[_0xf323('0x43')](_0x542205[_0xf323('0x42')]);_0x5e284f[_0xf323('0x4c')]=_[_0xf323('0x56')](_0x5e284f[_0xf323('0x41')],_0x5e284f[_0xf323('0x42')]);_0x36b688[_0xf323('0x44')]=_[_0xf323('0x56')](_0x5e284f[_0xf323('0x41')],qs[_0xf323('0x45')](_0x542205[_0xf323('0x42')][_0xf323('0x45')]));_0x36b688['attributes']=_0x36b688[_0xf323('0x44')][_0xf323('0x46')]?_0x36b688[_0xf323('0x44')]:_0x5e284f[_0xf323('0x41')];if(_0x542205[_0xf323('0x42')][_0xf323('0x50')]){_0x36b688['include']=[{'all':!![]}];}_0x36b688=_[_0xf323('0x4e')]({},_0x36b688,_0x542205[_0xf323('0x57')]);return db['VoiceQueue'][_0xf323('0x39')](_0x36b688)[_0xf323('0x2f')](handleEntityNotFound(_0x57dbe2,null))['then'](respondWithResult(_0x57dbe2,null))['catch'](handleError(_0x57dbe2,null));};exports[_0xf323('0x58')]=function(_0x3178e0,_0x227d1b){return db[_0xf323('0x4f')][_0xf323('0x58')](_0x3178e0[_0xf323('0x59')],{})[_0xf323('0x2f')](function(_0x4a5e99){var _0x54b0a5=_0x3178e0[_0xf323('0x5a')][_0xf323('0x30')]({'plain':!![]});if(!_0x54b0a5)throw new Error(_0xf323('0x5b'));if(_0x54b0a5[_0xf323('0x5c')]===_0xf323('0x5a')){var _0x146b7e=_0x4a5e99[_0xf323('0x30')]({'plain':!![]});var _0x55943f=[{'name':_0xf323('0x5d'),'value':_0xf323('0x31')},{'name':_0xf323('0x32'),'value':_0xf323('0x33')}];var _0x12c1db=_[_0xf323('0x39')](_0x55943f,[_0xf323('0x36'),_0x146b7e[_0xf323('0x38')]])[_0xf323('0x3e')];return db['UserProfileSection'][_0xf323('0x39')]({'where':{'name':_0x12c1db,'userProfileId':_0x54b0a5[_0xf323('0x5e')]},'raw':!![]})[_0xf323('0x2f')](function(_0x56021b){if(_0x56021b&&_0x56021b[_0xf323('0x5f')]===0x0){return db[_0xf323('0x3a')]['create']({'name':_0x146b7e[_0xf323('0x3e')],'resourceId':_0x146b7e['id'],'type':_0x56021b[_0xf323('0x3e')],'sectionId':_0x56021b['id']},{})['then'](function(){return _0x4a5e99;});}else{return _0x4a5e99;}})[_0xf323('0x53')](function(_0x912b86){logger['error'](_0xf323('0x60'),_0x912b86);throw _0x912b86;});}return _0x4a5e99;})[_0xf323('0x2f')](respondWithResult(_0x227d1b,0xc9))[_0xf323('0x53')](handleError(_0x227d1b,null));};exports[_0xf323('0x61')]=function(_0x129a44,_0x291e36){var _0x7d45f7={'where':{'id':_0x129a44[_0xf323('0x55')]['id']}},_0x5538d5={};_0x5538d5['model']=_[_0xf323('0x43')](db[_0xf323('0x4f')]['rawAttributes']);_0x7d45f7[_0xf323('0x44')]=_[_0xf323('0x56')](_0x5538d5['model'],qs[_0xf323('0x45')](_0x129a44[_0xf323('0x42')][_0xf323('0x45')]));_0x7d45f7[_0xf323('0x44')]=_0x7d45f7['attributes'][_0xf323('0x46')]?_0x7d45f7[_0xf323('0x44')]:_0x5538d5[_0xf323('0x41')];if(_0x129a44[_0xf323('0x42')]['includeAll']){_0x7d45f7[_0xf323('0x51')]=[{'all':!![]}];}_0x7d45f7=_[_0xf323('0x4e')]({},_0x7d45f7,_0x129a44[_0xf323('0x57')]);return db[_0xf323('0x4f')][_0xf323('0x39')](_0x7d45f7)[_0xf323('0x2f')](handleEntityNotFound(_0x291e36,null))[_0xf323('0x2f')](function(_0x1a91c8){if(_0x1a91c8){var _0x4907f4=_0x1a91c8[_0xf323('0x30')]({'plain':!![]});_0x4907f4=qs[_0xf323('0x62')](_0x4907f4,['id',_0xf323('0x63'),_0xf323('0x64')]);_0x129a44[_0xf323('0x59')]=_[_0xf323('0x62')](_0x129a44['body'],['id','createdAt',_0xf323('0x64')]);return db[_0xf323('0x4f')][_0xf323('0x58')](_[_0xf323('0x4e')](_0x4907f4,_0x129a44[_0xf323('0x59')]),{'include':_0x129a44[_0xf323('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0xf323('0x2f')](function(_0x642320){var _0x3c103e=_0x129a44[_0xf323('0x5a')]['get']({'plain':!![]});if(!_0x3c103e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c103e[_0xf323('0x5c')]===_0xf323('0x5a')){var _0x456e25=_0x642320[_0xf323('0x30')]({'plain':!![]});var _0x36c5d1=[{'name':_0xf323('0x5d'),'value':_0xf323('0x31')},{'name':'QueueCampaigns','value':'outbound'}];var _0x2f9d4a=_[_0xf323('0x39')](_0x36c5d1,[_0xf323('0x36'),_0x456e25[_0xf323('0x38')]])[_0xf323('0x3e')];return db[_0xf323('0x65')]['find']({'where':{'name':_0x2f9d4a,'userProfileId':_0x3c103e[_0xf323('0x5e')]},'raw':!![]})[_0xf323('0x2f')](function(_0x4fa221){if(_0x4fa221&&_0x4fa221['autoAssociation']===0x0){return db[_0xf323('0x3a')][_0xf323('0x58')]({'name':_0x456e25['name'],'resourceId':_0x456e25['id'],'type':_0x4fa221[_0xf323('0x3e')],'sectionId':_0x4fa221['id']},{})[_0xf323('0x2f')](function(){return _0x642320;});}else{return _0x642320;}})[_0xf323('0x53')](function(_0x53b408){logger[_0xf323('0x3c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53b408);throw _0x53b408;});}return _0x642320;});}})['then'](respondWithResult(_0x291e36,0xc9))[_0xf323('0x53')](handleError(_0x291e36,null));};exports[_0xf323('0x2e')]=function(_0x3163f7,_0x38d407){if(_0x3163f7[_0xf323('0x59')]['id']){delete _0x3163f7['body']['id'];}return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0x3163f7[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x38d407,null))['then'](saveUpdates(_0x3163f7[_0xf323('0x59')],null))[_0xf323('0x2f')](respondWithResult(_0x38d407,null))[_0xf323('0x53')](handleError(_0x38d407,null));};exports[_0xf323('0x3b')]=function(_0x4b8408,_0x223dfa){return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0x4b8408[_0xf323('0x55')]['id']}})['then'](handleEntityNotFound(_0x223dfa,null))[_0xf323('0x2f')](removeEntity(_0x223dfa,null))[_0xf323('0x53')](handleError(_0x223dfa,null));};exports[_0xf323('0x66')]=function(_0x4bc057,_0x4b1b9c,_0x391ebe){var _0x49bd06={'raw':![],'where':{}};var _0x47546c={};var _0x11327e={'count':0x0,'rows':[]};return db[_0xf323('0x4f')][_0xf323('0x67')]({'where':{'id':_0x4bc057['params']['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x4b1b9c,null))[_0xf323('0x2f')](function(_0xf14d38){if(_0xf14d38){_0x47546c[_0xf323('0x41')]=_[_0xf323('0x43')](db['CmHopper'][_0xf323('0x40')]);_0x47546c[_0xf323('0x42')]=_[_0xf323('0x43')](_0x4bc057[_0xf323('0x42')]);_0x47546c['filters']=_['intersection'](_0x47546c[_0xf323('0x41')],_0x47546c[_0xf323('0x42')]);_0x49bd06['attributes']=_[_0xf323('0x56')](_0x47546c['model'],qs[_0xf323('0x45')](_0x4bc057[_0xf323('0x42')][_0xf323('0x45')]));_0x49bd06['attributes']=_0x49bd06[_0xf323('0x44')][_0xf323('0x46')]?_0x49bd06['attributes']:_0x47546c[_0xf323('0x41')];if(!_0x4bc057[_0xf323('0x42')][_0xf323('0x47')](_0xf323('0x48'))){_0x49bd06[_0xf323('0x28')]=qs['limit'](_0x4bc057[_0xf323('0x42')][_0xf323('0x28')]);_0x49bd06[_0xf323('0x26')]=qs[_0xf323('0x26')](_0x4bc057[_0xf323('0x42')]['offset']);}_0x49bd06[_0xf323('0x49')]=qs['sort'](_0x4bc057['query']['sort']);_0x49bd06[_0xf323('0x4b')]=qs[_0xf323('0x4c')](_[_0xf323('0x4d')](_0x4bc057['query'],_0x47546c[_0xf323('0x4c')]));_0x49bd06[_0xf323('0x4b')]['VoiceQueueId']=_0xf14d38['id'];if(_0x4bc057[_0xf323('0x42')][_0xf323('0x34')]){_0x49bd06[_0xf323('0x4b')]=_[_0xf323('0x4e')](_0x49bd06[_0xf323('0x4b')],{'$or':_[_0xf323('0x35')](_0x49bd06[_0xf323('0x44')],function(_0xc3f4d7){var _0x5d1a2d={};_0x5d1a2d[_0xc3f4d7]={'$like':'%'+_0x4bc057[_0xf323('0x42')][_0xf323('0x34')]+'%'};return _0x5d1a2d;})});}_0x49bd06=_[_0xf323('0x4e')]({},_0x49bd06,_0x4bc057['options']);return db['CmHopper'][_0xf323('0x29')]({'where':_0x49bd06[_0xf323('0x4b')]})[_0xf323('0x2f')](function(_0x373402){_0x11327e[_0xf323('0x29')]=_0x373402;if(_0x4bc057['query']['includeAll']){_0x49bd06[_0xf323('0x51')]=[{'all':!![]}];}return db[_0xf323('0x68')]['findAll'](_0x49bd06);})[_0xf323('0x2f')](function(_0x127b10){_0x11327e['rows']=_0x127b10;return _0x11327e;});}})[_0xf323('0x2f')](respondWithFilteredResult(_0x4b1b9c,_0x49bd06))[_0xf323('0x53')](handleError(_0x4b1b9c,null));};exports[_0xf323('0x69')]=function(_0x9e6dda,_0x5ed509,_0x1dbc0a){var _0xe6b523={'raw':!![],'where':{}};var _0x2e71e9={};var _0x4c551f={'count':0x0,'rows':[]};return db[_0xf323('0x4f')][_0xf323('0x67')]({'where':{'id':_0x9e6dda[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x5ed509,null))[_0xf323('0x2f')](function(_0x4c1229){if(_0x4c1229){_0x2e71e9[_0xf323('0x41')]=_[_0xf323('0x43')](db[_0xf323('0x6a')]['rawAttributes']);_0x2e71e9[_0xf323('0x42')]=_[_0xf323('0x43')](_0x9e6dda['query']);_0x2e71e9['filters']=_[_0xf323('0x56')](_0x2e71e9[_0xf323('0x41')],_0x2e71e9[_0xf323('0x42')]);_0xe6b523['attributes']=_['intersection'](_0x2e71e9[_0xf323('0x41')],qs['fields'](_0x9e6dda[_0xf323('0x42')][_0xf323('0x45')]));_0xe6b523[_0xf323('0x44')]=_0xe6b523[_0xf323('0x44')]['length']?_0xe6b523[_0xf323('0x44')]:_0x2e71e9['model'];if(!_0x9e6dda[_0xf323('0x42')][_0xf323('0x47')]('nolimit')){_0xe6b523[_0xf323('0x28')]=qs[_0xf323('0x28')](_0x9e6dda['query'][_0xf323('0x28')]);_0xe6b523['offset']=qs['offset'](_0x9e6dda['query'][_0xf323('0x26')]);}_0xe6b523[_0xf323('0x49')]=qs[_0xf323('0x4a')](_0x9e6dda[_0xf323('0x42')][_0xf323('0x4a')]);_0xe6b523['where']=qs[_0xf323('0x4c')](_[_0xf323('0x4d')](_0x9e6dda[_0xf323('0x42')],_0x2e71e9[_0xf323('0x4c')]));_0xe6b523[_0xf323('0x4b')][_0xf323('0x6b')]=_0x4c1229['id'];if(_0x9e6dda[_0xf323('0x42')][_0xf323('0x34')]){_0xe6b523['where']=_[_0xf323('0x4e')](_0xe6b523[_0xf323('0x4b')],{'$or':_[_0xf323('0x35')](_0xe6b523['attributes'],function(_0x53615b){var _0x49540a={};_0x49540a[_0x53615b]={'$like':'%'+_0x9e6dda[_0xf323('0x42')][_0xf323('0x34')]+'%'};return _0x49540a;})});}_0xe6b523=_[_0xf323('0x4e')]({},_0xe6b523,_0x9e6dda[_0xf323('0x57')]);return db[_0xf323('0x6a')][_0xf323('0x29')]({'where':_0xe6b523[_0xf323('0x4b')]})[_0xf323('0x2f')](function(_0x53947b){_0x4c551f[_0xf323('0x29')]=_0x53947b;if(_0x9e6dda[_0xf323('0x42')][_0xf323('0x50')]){_0xe6b523[_0xf323('0x51')]=[{'all':!![]}];}return db[_0xf323('0x6a')][_0xf323('0x6c')](_0xe6b523);})[_0xf323('0x2f')](function(_0x43b679){_0x4c551f[_0xf323('0x52')]=_0x43b679;return _0x4c551f;});}})['then'](respondWithFilteredResult(_0x5ed509,_0xe6b523))[_0xf323('0x53')](handleError(_0x5ed509,null));};exports[_0xf323('0x6d')]=function(_0x729f45,_0x132c22,_0x3e61a0){var _0x476e1c={'raw':!![],'where':{}};var _0x46c286={};var _0x55bfa8={'count':0x0,'rows':[]};return db[_0xf323('0x4f')][_0xf323('0x67')]({'where':{'id':_0x729f45[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x132c22,null))[_0xf323('0x2f')](function(_0x42f4d3){if(_0x42f4d3){_0x46c286[_0xf323('0x41')]=_[_0xf323('0x43')](db['CmHopperFinal']['rawAttributes']);_0x46c286[_0xf323('0x42')]=_[_0xf323('0x43')](_0x729f45[_0xf323('0x42')]);_0x46c286[_0xf323('0x4c')]=_['intersection'](_0x46c286['model'],_0x46c286[_0xf323('0x42')]);_0x476e1c[_0xf323('0x44')]=_[_0xf323('0x56')](_0x46c286[_0xf323('0x41')],qs[_0xf323('0x45')](_0x729f45[_0xf323('0x42')][_0xf323('0x45')]));_0x476e1c['attributes']=_0x476e1c['attributes']['length']?_0x476e1c['attributes']:_0x46c286[_0xf323('0x41')];if(!_0x729f45['query'][_0xf323('0x47')](_0xf323('0x48'))){_0x476e1c[_0xf323('0x28')]=qs[_0xf323('0x28')](_0x729f45[_0xf323('0x42')]['limit']);_0x476e1c[_0xf323('0x26')]=qs[_0xf323('0x26')](_0x729f45['query']['offset']);}_0x476e1c[_0xf323('0x49')]=qs[_0xf323('0x4a')](_0x729f45[_0xf323('0x42')][_0xf323('0x4a')]);_0x476e1c[_0xf323('0x4b')]=qs[_0xf323('0x4c')](_[_0xf323('0x4d')](_0x729f45[_0xf323('0x42')],_0x46c286['filters']));_0x476e1c['where'][_0xf323('0x6b')]=_0x42f4d3['id'];if(_0x729f45[_0xf323('0x42')][_0xf323('0x34')]){_0x476e1c['where']=_[_0xf323('0x4e')](_0x476e1c['where'],{'$or':_['map'](_0x476e1c[_0xf323('0x44')],function(_0x1a391d){var _0xc8f953={};_0xc8f953[_0x1a391d]={'$like':'%'+_0x729f45[_0xf323('0x42')]['filter']+'%'};return _0xc8f953;})});}_0x476e1c=_[_0xf323('0x4e')]({},_0x476e1c,_0x729f45[_0xf323('0x57')]);return db[_0xf323('0x6e')][_0xf323('0x29')]({'where':_0x476e1c[_0xf323('0x4b')]})[_0xf323('0x2f')](function(_0x47a35f){_0x55bfa8[_0xf323('0x29')]=_0x47a35f;if(_0x729f45[_0xf323('0x42')][_0xf323('0x50')]){_0x476e1c[_0xf323('0x51')]=[{'all':!![]}];}return db[_0xf323('0x6e')][_0xf323('0x6c')](_0x476e1c);})[_0xf323('0x2f')](function(_0x463755){_0x55bfa8[_0xf323('0x52')]=_0x463755;return _0x55bfa8;});}})['then'](respondWithFilteredResult(_0x132c22,_0x476e1c))[_0xf323('0x53')](handleError(_0x132c22,null));};exports[_0xf323('0x6f')]=function(_0x1e59c1,_0xcf3ca1,_0x2f99d9){var _0x4b9814={'raw':!![],'where':{}};var _0x3ec3fd={};var _0x1eafa8={'count':0x0,'rows':[]};return db[_0xf323('0x4f')][_0xf323('0x67')]({'where':{'id':_0x1e59c1[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0xcf3ca1,null))[_0xf323('0x2f')](function(_0x3f105b){if(_0x3f105b){_0x3ec3fd['model']=_[_0xf323('0x43')](db[_0xf323('0x70')][_0xf323('0x40')]);_0x3ec3fd[_0xf323('0x42')]=_[_0xf323('0x43')](_0x1e59c1[_0xf323('0x42')]);_0x3ec3fd[_0xf323('0x4c')]=_[_0xf323('0x56')](_0x3ec3fd[_0xf323('0x41')],_0x3ec3fd[_0xf323('0x42')]);_0x4b9814['attributes']=_[_0xf323('0x56')](_0x3ec3fd[_0xf323('0x41')],qs['fields'](_0x1e59c1[_0xf323('0x42')][_0xf323('0x45')]));_0x4b9814[_0xf323('0x44')]=_0x4b9814[_0xf323('0x44')][_0xf323('0x46')]?_0x4b9814[_0xf323('0x44')]:_0x3ec3fd['model'];if(!_0x1e59c1['query']['hasOwnProperty'](_0xf323('0x48'))){_0x4b9814[_0xf323('0x28')]=qs[_0xf323('0x28')](_0x1e59c1[_0xf323('0x42')]['limit']);_0x4b9814[_0xf323('0x26')]=qs[_0xf323('0x26')](_0x1e59c1['query'][_0xf323('0x26')]);}_0x4b9814[_0xf323('0x49')]=qs['sort'](_0x1e59c1[_0xf323('0x42')][_0xf323('0x4a')]);_0x4b9814[_0xf323('0x4b')]=qs[_0xf323('0x4c')](_['pick'](_0x1e59c1[_0xf323('0x42')],_0x3ec3fd[_0xf323('0x4c')]));_0x4b9814[_0xf323('0x4b')][_0xf323('0x6b')]=_0x3f105b['id'];if(_0x1e59c1[_0xf323('0x42')]['filter']){_0x4b9814[_0xf323('0x4b')]=_[_0xf323('0x4e')](_0x4b9814[_0xf323('0x4b')],{'$or':_[_0xf323('0x35')](_0x4b9814[_0xf323('0x44')],function(_0x1b7b36){var _0x43208b={};_0x43208b[_0x1b7b36]={'$like':'%'+_0x1e59c1['query'][_0xf323('0x34')]+'%'};return _0x43208b;})});}_0x4b9814=_[_0xf323('0x4e')]({},_0x4b9814,_0x1e59c1[_0xf323('0x57')]);return db[_0xf323('0x70')][_0xf323('0x29')]({'where':_0x4b9814[_0xf323('0x4b')]})['then'](function(_0x3cc855){_0x1eafa8['count']=_0x3cc855;if(_0x1e59c1[_0xf323('0x42')][_0xf323('0x50')]){_0x4b9814['include']=[{'all':!![]}];}return db[_0xf323('0x70')][_0xf323('0x6c')](_0x4b9814);})['then'](function(_0x52a6f5){_0x1eafa8[_0xf323('0x52')]=_0x52a6f5;return _0x1eafa8;});}})[_0xf323('0x2f')](respondWithFilteredResult(_0xcf3ca1,_0x4b9814))[_0xf323('0x53')](handleError(_0xcf3ca1,null));};exports[_0xf323('0x71')]=function(_0x43db55,_0x2ced8a,_0x245ed2){var _0x3d162a={};var _0x371733={};var _0x2ac195;var _0x5766f6;return db[_0xf323('0x4f')][_0xf323('0x67')]({'where':{'id':_0x43db55['params']['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x2ced8a,null))['then'](function(_0x3a1aeb){if(_0x3a1aeb){_0x2ac195=_0x3a1aeb;_0x371733[_0xf323('0x41')]=_[_0xf323('0x43')](db[_0xf323('0x72')][_0xf323('0x40')]);_0x371733[_0xf323('0x42')]=_[_0xf323('0x43')](_0x43db55[_0xf323('0x42')]);_0x371733[_0xf323('0x4c')]=_['intersection'](_0x371733[_0xf323('0x41')],_0x371733[_0xf323('0x42')]);_0x3d162a[_0xf323('0x44')]=_[_0xf323('0x56')](_0x371733[_0xf323('0x41')],qs[_0xf323('0x45')](_0x43db55[_0xf323('0x42')][_0xf323('0x45')]));_0x3d162a[_0xf323('0x44')]=_0x3d162a[_0xf323('0x44')][_0xf323('0x46')]?_0x3d162a['attributes']:_0x371733['model'];_0x3d162a[_0xf323('0x49')]=qs[_0xf323('0x4a')](_0x43db55[_0xf323('0x42')][_0xf323('0x4a')]);_0x3d162a['where']=qs['filters'](_['pick'](_0x43db55['query'],_0x371733[_0xf323('0x4c')]));if(_0x43db55[_0xf323('0x42')][_0xf323('0x34')]){_0x3d162a[_0xf323('0x4b')]=_[_0xf323('0x4e')](_0x3d162a[_0xf323('0x4b')],{'$or':_['map'](_0x3d162a[_0xf323('0x44')],function(_0x37fe12){var _0x522e53={};_0x522e53[_0x37fe12]={'$like':'%'+_0x43db55['query'][_0xf323('0x34')]+'%'};return _0x522e53;})});}_0x3d162a=_[_0xf323('0x4e')]({},_0x3d162a,_0x43db55[_0xf323('0x57')]);return _0x2ac195[_0xf323('0x71')](_0x3d162a);}})[_0xf323('0x2f')](function(_0xde6b01){if(_0xde6b01){_0x5766f6=_0xde6b01['length'];if(!_0x43db55[_0xf323('0x42')]['hasOwnProperty']('nolimit')){_0x3d162a[_0xf323('0x28')]=qs[_0xf323('0x28')](_0x43db55[_0xf323('0x42')][_0xf323('0x28')]);_0x3d162a[_0xf323('0x26')]=qs['offset'](_0x43db55[_0xf323('0x42')][_0xf323('0x26')]);}return _0x2ac195['getTeams'](_0x3d162a);}})[_0xf323('0x2f')](function(_0x4df668){if(_0x4df668){return _0x4df668?{'count':_0x5766f6,'rows':_0x4df668}:null;}})['then'](respondWithResult(_0x2ced8a,null))[_0xf323('0x53')](handleError(_0x2ced8a,null));};exports['addTeams']=function(_0x2c69cd,_0x13ff5b,_0x21bfb0){var _0x47f9b9=_0x2c69cd[_0xf323('0x59')][_0xf323('0x73')];var _0x521100=_[_0xf323('0x35')](_0x47f9b9,'id');return db['Team'][_0xf323('0x6c')]({'where':{'id':_0x521100},'attributes':['id'],'include':[{'model':db[_0xf323('0x74')],'as':_0xf323('0x75'),'attributes':['id',_0xf323('0x3e'),_0xf323('0x76'),_0xf323('0x77'),_0xf323('0x78')],'raw':!![]}]})[_0xf323('0x2f')](function(_0x79e727){if(_0x79e727){var _0x4a4ed4=_[_0xf323('0x79')](_0x79e727,function(_0x2a005b){var _0x24f4c2=_0x2a005b[_0xf323('0x30')]({'plain':!![]});_0x24f4c2['Agents'][_0xf323('0x7a')](function(_0x3665f3){_0x3665f3[_0xf323('0x7b')]=_[_0xf323('0x39')](_0x47f9b9,{'id':_0x24f4c2['id']})['penalty'];});return _0x24f4c2[_0xf323('0x75')];});return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0x2c69cd[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](function(_0x3ea121){return db[_0xf323('0x7c')][_0xf323('0x7d')](function(_0x402e46){return _0x3ea121[_0xf323('0x7e')](_0x521100,{'transaction':_0x402e46})[_0xf323('0x2f')](function(){return BPromise[_0xf323('0x7f')](_0x47f9b9,function(_0x5b8eaa){return db[_0xf323('0x80')][_0xf323('0x81')]({'TeamId':_0x5b8eaa['id'],'VoiceQueueId':_0x2c69cd[_0xf323('0x55')]['id'],'penalty':_0x5b8eaa[_0xf323('0x7b')]},{'transaction':_0x402e46});});})['then'](function(){return BPromise[_0xf323('0x7f')](_0x4a4ed4,function(_0x46a324){return db[_0xf323('0x82')]['findOrCreate']({'where':{'UserId':_0x46a324['id'],'VoiceQueueId':_0x2c69cd[_0xf323('0x55')]['id']},'defaults':{'penalty':_0x46a324[_0xf323('0x7b')]},'transaction':_0x402e46});});})[_0xf323('0x2f')](function(){return BPromise['each'](_[_0xf323('0x34')](_0x4a4ed4,{'online':!![]}),function(_0x5b17a7){return db[_0xf323('0x83')][_0xf323('0x81')]({'membername':_0x5b17a7[_0xf323('0x3e')],'UserId':_0x5b17a7['id'],'queue_name':_0x3ea121[_0xf323('0x3e')],'VoiceQueueId':_0x3ea121['id'],'interface':_[_0xf323('0x84')](_0x5b17a7[_0xf323('0x78')])?util['format'](_0xf323('0x85'),_0x5b17a7[_0xf323('0x3e')]):_0x5b17a7[_0xf323('0x78')],'paused':_0x5b17a7[_0xf323('0x77')]||![],'penalty':_0x5b17a7[_0xf323('0x7b')]},{'transaction':_0x402e46});});})[_0xf323('0x2f')](function(){_0x4a4ed4[_0xf323('0x7a')](function(_0x5af161){socket[_0xf323('0x86')]('userVoiceQueue:save',{'UserId':_0x5af161['id'],'VoiceQueueId':_0x3ea121['id']});});});});});}})[_0xf323('0x2f')](respondWithStatusCode(_0x13ff5b,null))[_0xf323('0x53')](handleError(_0x13ff5b,null));};exports[_0xf323('0x87')]=function(_0x333f1a,_0x1c96cc,_0x3d9976){return db[_0xf323('0x72')]['findAll']({'where':{'id':_0x333f1a['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xf323('0x74')],'as':_0xf323('0x75'),'attributes':['id'],'raw':!![]}]})[_0xf323('0x2f')](handleEntityNotFound(_0x1c96cc,null))['then'](function(_0x5a35cd){var _0x1836a5=_['map'](_0x5a35cd,'id');var _0xec1be8=[];var _0x3e5a8c=[];var _0x17c5d5=squel[_0xf323('0x88')]();_0x17c5d5[_0xf323('0x89')](_0xf323('0x8a'))[_0xf323('0x8b')](_0xf323('0x8c'),'tq')[_0xf323('0x8d')](_0xf323('0x8e'),'ut',_0xf323('0x8f'))[_0xf323('0x4b')](_0xf323('0x90'),_0x333f1a[_0xf323('0x55')]['id']);for(var _0x3422ca=0x0;_0x3422ca<_0x5a35cd[_0xf323('0x46')];_0x3422ca+=0x1){let _0x5c0a1a=_0x5a35cd[_0x3422ca];for(var _0x3a1933=0x0;_0x3a1933<_0x5c0a1a[_0xf323('0x75')]['length'];_0x3a1933+=0x1){let _0x4c32c0=_0x5c0a1a[_0xf323('0x75')][_0x3a1933];var _0x4aa1b6=_0x17c5d5[_0xf323('0x61')]();_0x4aa1b6[_0xf323('0x4b')]('ut.UserId\x20=\x20?',_0x4c32c0['id']);_0x3e5a8c[_0xf323('0x91')](db[_0xf323('0x7c')][_0xf323('0x42')](_0x4aa1b6['toString'](),{'type':db[_0xf323('0x7c')]['QueryTypes'][_0xf323('0x92')]})[_0xf323('0x2f')](function(_0x13646b){if(_0x13646b[_0xf323('0x46')]===0x1){return _0x4c32c0['id'];}else{var _0x113ef8=_[_0xf323('0x93')](_[_0xf323('0x35')](_0x13646b,'TeamId'),function(_0x355b19){return _[_0xf323('0x37')](_0x1836a5,_0x355b19);});if(_0x113ef8){return _0x4c32c0['id'];}}}));}}return BPromise[_0xf323('0x94')](_0x3e5a8c)[_0xf323('0x2f')](function(_0x28d50f){_0xec1be8=_(_0xec1be8)[_0xf323('0x95')](_0x28d50f)['compact']()[_0xf323('0x36')]();return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0x333f1a[_0xf323('0x55')]['id']}})['then'](function(_0x339327){return db[_0xf323('0x7c')]['transaction'](function(_0x58e0d3){return _0x339327['removeTeams'](_0x333f1a[_0xf323('0x42')][_0xf323('0x96')],{'transaction':_0x58e0d3})[_0xf323('0x2f')](function(){if(!_[_0xf323('0x97')](_0xec1be8)){return _0x339327['removeAgents'](_0xec1be8,{'transaction':_0x58e0d3})[_0xf323('0x2f')](function(){return db[_0xf323('0x83')][_0xf323('0x3b')]({'where':{'VoiceQueueId':_0x333f1a['params']['id'],'UserId':_0xec1be8},'transaction':_0x58e0d3});});}})[_0xf323('0x2f')](function(){_0xec1be8['forEach'](function(_0x22b50f){socket[_0xf323('0x86')]('userVoiceQueue:remove',{'UserId':_0x22b50f,'VoiceQueueId':_0x339327['id']});});});});});});})[_0xf323('0x2f')](respondWithStatusCode(_0x1c96cc,null))[_0xf323('0x53')](handleError(_0x1c96cc,null));};exports[_0xf323('0x98')]=function(_0x14eb9f,_0x2e8b6b,_0x389e83){var _0x298a30,_0x35d71b;return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0x14eb9f[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x2e8b6b,null))[_0xf323('0x2f')](function(_0x43d43b){if(_0x43d43b){_0x35d71b=_0x43d43b;return _0x43d43b[_0xf323('0x98')](_0x14eb9f['body']['ids'],_[_0xf323('0x62')](_0x14eb9f[_0xf323('0x59')],['ids','id'])||{})[_0xf323('0x99')](function(_0x49aaf9){for(var _0x1fccc3=0x0;_0x1fccc3<_0x14eb9f['body'][_0xf323('0x96')][_0xf323('0x46')];_0x1fccc3+=0x1){socket['emit'](_0xf323('0x9a'),{'UserId':Number(_0x14eb9f[_0xf323('0x59')]['ids'][_0x1fccc3]),'VoiceQueueId':Number(_0x14eb9f['params']['id'])});}return _0x49aaf9;});}})[_0xf323('0x2f')](function(_0x195afe){_0x298a30=_0x195afe||[];if(_0x35d71b){return db[_0xf323('0x74')][_0xf323('0x6c')]({'where':{'id':_0x14eb9f[_0xf323('0x59')][_0xf323('0x96')]},'attributes':['id',_0xf323('0x3e'),'online',_0xf323('0x77'),_0xf323('0x78')],'raw':!![]});}})[_0xf323('0x2f')](function(_0x3c0d1c){if(!_[_0xf323('0x97')](_0x3c0d1c)){var _0xba12a=[];for(var _0x5377e1=0x0;_0x5377e1<_0x3c0d1c[_0xf323('0x46')];_0x5377e1++){if(_0x3c0d1c[_0x5377e1][_0xf323('0x76')]){_0xba12a[_0xf323('0x91')](db[_0xf323('0x83')][_0xf323('0x81')]({'membername':_0x3c0d1c[_0x5377e1][_0xf323('0x3e')],'UserId':_0x3c0d1c[_0x5377e1]['id'],'queue_name':_0x35d71b[_0xf323('0x3e')],'VoiceQueueId':_0x35d71b['id'],'interface':_[_0xf323('0x84')](_0x3c0d1c[_0x5377e1][_0xf323('0x78')])?util[_0xf323('0x9b')](_0xf323('0x85'),_0x3c0d1c[_0x5377e1][_0xf323('0x3e')]):_0x3c0d1c[_0x5377e1][_0xf323('0x78')],'paused':_0x3c0d1c[_0x5377e1]['voicePause']||![],'penalty':_0x14eb9f[_0xf323('0x59')][_0xf323('0x7b')]||0x0}));}}return BPromise['all'](_0xba12a);}})[_0xf323('0x2f')](function(){return _0x298a30;})[_0xf323('0x2f')](respondWithResult(_0x2e8b6b,null))[_0xf323('0x53')](handleError(_0x2e8b6b,null));};exports['removeAgents']=function(_0x3f5e8b,_0x781539,_0x8bc3ad){return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0x3f5e8b['params']['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x781539,null))['then'](function(_0x29a5fa){if(_0x29a5fa){return _0x29a5fa[_0xf323('0x9c')](_0x3f5e8b[_0xf323('0x42')]['ids'])[_0xf323('0x2f')](function(){if(_[_0xf323('0x9d')](_0x3f5e8b[_0xf323('0x42')][_0xf323('0x96')])){for(var _0x181fd6=0x0;_0x181fd6<_0x3f5e8b['query']['ids'][_0xf323('0x46')];_0x181fd6+=0x1){socket[_0xf323('0x86')]('userVoiceQueue:remove',{'UserId':Number(_0x3f5e8b[_0xf323('0x42')][_0xf323('0x96')][_0x181fd6]),'VoiceQueueId':Number(_0x3f5e8b[_0xf323('0x55')]['id'])});}}else{socket['emit'](_0xf323('0x9e'),{'UserId':Number(_0x3f5e8b[_0xf323('0x42')]['ids']),'VoiceQueueId':Number(_0x3f5e8b[_0xf323('0x55')]['id'])});}});}})['then'](function(_0x5aec46){return db[_0xf323('0x83')][_0xf323('0x3b')]({'where':{'VoiceQueueId':_0x3f5e8b[_0xf323('0x55')]['id'],'UserId':_0x3f5e8b['query'][_0xf323('0x96')]}})['then'](function(){return _0x5aec46;});})[_0xf323('0x2f')](respondWithStatusCode(_0x781539,null))[_0xf323('0x53')](handleError(_0x781539,null));};exports[_0xf323('0x9f')]=function(_0x522ac1,_0x45ade3,_0x501710){var _0x55aeae={};var _0x5a1c68={};var _0x16c217;var _0x435c42;return db[_0xf323('0x4f')]['findOne']({'where':{'id':_0x522ac1['params']['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x45ade3,null))['then'](function(_0x4afcdf){if(_0x4afcdf){_0x16c217=_0x4afcdf;_0x5a1c68[_0xf323('0x41')]=_['keys'](db[_0xf323('0x74')][_0xf323('0x40')]);_0x5a1c68[_0xf323('0x42')]=_[_0xf323('0x43')](_0x522ac1[_0xf323('0x42')]);_0x5a1c68[_0xf323('0x4c')]=_[_0xf323('0x56')](_0x5a1c68[_0xf323('0x41')],_0x5a1c68[_0xf323('0x42')]);_0x55aeae['attributes']=_[_0xf323('0x56')](_0x5a1c68[_0xf323('0x41')],qs['fields'](_0x522ac1[_0xf323('0x42')][_0xf323('0x45')]));_0x55aeae['attributes']=_0x55aeae[_0xf323('0x44')][_0xf323('0x46')]?_0x55aeae[_0xf323('0x44')]:_0x5a1c68[_0xf323('0x41')];_0x55aeae[_0xf323('0x49')]=qs[_0xf323('0x4a')](_0x522ac1[_0xf323('0x42')][_0xf323('0x4a')]);_0x55aeae[_0xf323('0x4b')]=qs[_0xf323('0x4c')](_[_0xf323('0x4d')](_0x522ac1[_0xf323('0x42')],_0x5a1c68[_0xf323('0x4c')]));if(_0x522ac1[_0xf323('0x42')][_0xf323('0x34')]){_0x55aeae[_0xf323('0x4b')]=_[_0xf323('0x4e')](_0x55aeae[_0xf323('0x4b')],{'$or':_[_0xf323('0x35')](_0x55aeae[_0xf323('0x44')],function(_0x54c5bc){var _0x5eb090={};_0x5eb090[_0x54c5bc]={'$like':'%'+_0x522ac1['query'][_0xf323('0x34')]+'%'};return _0x5eb090;})});}_0x55aeae=_['merge']({},_0x55aeae,_0x522ac1[_0xf323('0x57')]);return _0x16c217[_0xf323('0x9f')](_0x55aeae);}})[_0xf323('0x2f')](function(_0x1653cc){if(_0x1653cc){_0x435c42=_0x1653cc[_0xf323('0x46')];if(!_0x522ac1[_0xf323('0x42')][_0xf323('0x47')]('nolimit')){_0x55aeae[_0xf323('0x28')]=qs['limit'](_0x522ac1[_0xf323('0x42')][_0xf323('0x28')]);_0x55aeae['offset']=qs[_0xf323('0x26')](_0x522ac1[_0xf323('0x42')][_0xf323('0x26')]);}return _0x16c217[_0xf323('0x9f')](_0x55aeae);}})[_0xf323('0x2f')](function(_0xeb3641){if(_0xeb3641){return _0xeb3641?{'count':_0x435c42,'rows':_0xeb3641}:null;}})[_0xf323('0x2f')](respondWithResult(_0x45ade3,null))[_0xf323('0x53')](handleError(_0x45ade3,null));};exports[_0xf323('0xa0')]=function(_0x19e0e2,_0x1ea2bc,_0x2bc841){var _0xede2f5={};var _0x1d1737={};var _0x4e9a8a;var _0x39e8a3;return db[_0xf323('0x4f')][_0xf323('0x67')]({'where':{'id':_0x19e0e2[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x1ea2bc,null))['then'](function(_0x3508b9){if(_0x3508b9){_0x4e9a8a=_0x3508b9;_0x1d1737[_0xf323('0x41')]=_[_0xf323('0x43')](db[_0xf323('0x83')][_0xf323('0x40')]);_0x1d1737[_0xf323('0x42')]=_['keys'](_0x19e0e2[_0xf323('0x42')]);_0x1d1737[_0xf323('0x4c')]=_[_0xf323('0x56')](_0x1d1737[_0xf323('0x41')],_0x1d1737[_0xf323('0x42')]);_0xede2f5[_0xf323('0x44')]=_[_0xf323('0x56')](_0x1d1737['model'],qs[_0xf323('0x45')](_0x19e0e2[_0xf323('0x42')][_0xf323('0x45')]));_0xede2f5['attributes']=_0xede2f5[_0xf323('0x44')]['length']?_0xede2f5[_0xf323('0x44')]:_0x1d1737[_0xf323('0x41')];_0xede2f5['order']=qs[_0xf323('0x4a')](_0x19e0e2[_0xf323('0x42')]['sort']);_0xede2f5[_0xf323('0x4b')]=qs[_0xf323('0x4c')](_[_0xf323('0x4d')](_0x19e0e2[_0xf323('0x42')],_0x1d1737[_0xf323('0x4c')]));if(_0x19e0e2['query'][_0xf323('0x34')]){_0xede2f5[_0xf323('0x4b')]=_[_0xf323('0x4e')](_0xede2f5['where'],{'$or':_[_0xf323('0x35')](_0xede2f5[_0xf323('0x44')],function(_0x1a418c){var _0x45f6ea={};_0x45f6ea[_0x1a418c]={'$like':'%'+_0x19e0e2['query']['filter']+'%'};return _0x45f6ea;})});}_0xede2f5=_['merge']({},_0xede2f5,_0x19e0e2['options']);return _0x4e9a8a[_0xf323('0xa0')](_0xede2f5);}})[_0xf323('0x2f')](function(_0x39fc11){if(_0x39fc11){_0x39e8a3=_0x39fc11['length'];if(!_0x19e0e2[_0xf323('0x42')]['hasOwnProperty']('nolimit')){_0xede2f5[_0xf323('0x28')]=qs[_0xf323('0x28')](_0x19e0e2[_0xf323('0x42')][_0xf323('0x28')]);_0xede2f5[_0xf323('0x26')]=qs['offset'](_0x19e0e2['query']['offset']);}return _0x4e9a8a['getMembers'](_0xede2f5);}})[_0xf323('0x2f')](function(_0x137e10){return _0x137e10?{'count':_0x39e8a3,'rows':_0x137e10}:null;})[_0xf323('0x2f')](respondWithResult(_0x1ea2bc,null))['catch'](handleError(_0x1ea2bc,null));};exports['getLists']=function(_0x29d406,_0x342c6a,_0x2df85f){var _0x5b8499={};var _0x34a7b7={};var _0x2379b1;var _0x906460;return db[_0xf323('0x4f')][_0xf323('0x67')]({'where':{'id':_0x29d406[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x342c6a,null))[_0xf323('0x2f')](function(_0x5b6cfe){if(_0x5b6cfe){_0x2379b1=_0x5b6cfe;_0x34a7b7[_0xf323('0x41')]=_['keys'](db['CmList'][_0xf323('0x40')]);_0x34a7b7[_0xf323('0x42')]=_[_0xf323('0x43')](_0x29d406[_0xf323('0x42')]);_0x34a7b7[_0xf323('0x4c')]=_['intersection'](_0x34a7b7[_0xf323('0x41')],_0x34a7b7['query']);_0x5b8499['attributes']=_['intersection'](_0x34a7b7[_0xf323('0x41')],qs['fields'](_0x29d406[_0xf323('0x42')][_0xf323('0x45')]));_0x5b8499[_0xf323('0x44')]=_0x5b8499[_0xf323('0x44')]['length']?_0x5b8499[_0xf323('0x44')]:_0x34a7b7[_0xf323('0x41')];_0x5b8499[_0xf323('0x49')]=qs[_0xf323('0x4a')](_0x29d406['query'][_0xf323('0x4a')]);_0x5b8499[_0xf323('0x4b')]=qs[_0xf323('0x4c')](_[_0xf323('0x4d')](_0x29d406[_0xf323('0x42')],_0x34a7b7[_0xf323('0x4c')]));if(_0x29d406[_0xf323('0x42')]['filter']){_0x5b8499['where']=_[_0xf323('0x4e')](_0x5b8499[_0xf323('0x4b')],{'$or':_['map'](_0x5b8499[_0xf323('0x44')],function(_0x641deb){var _0x1a6d71={};_0x1a6d71[_0x641deb]={'$like':'%'+_0x29d406['query'][_0xf323('0x34')]+'%'};return _0x1a6d71;})});}_0x5b8499=_['merge']({},_0x5b8499,_0x29d406[_0xf323('0x57')]);return _0x2379b1[_0xf323('0xa1')](_0x5b8499);}})['then'](function(_0x2ba317){if(_0x2ba317){_0x906460=_0x2ba317[_0xf323('0x46')];if(!_0x29d406[_0xf323('0x42')][_0xf323('0x47')]('nolimit')){_0x5b8499['limit']=qs[_0xf323('0x28')](_0x29d406['query'][_0xf323('0x28')]);_0x5b8499[_0xf323('0x26')]=qs[_0xf323('0x26')](_0x29d406[_0xf323('0x42')][_0xf323('0x26')]);}return _0x2379b1[_0xf323('0xa1')](_0x5b8499);}})[_0xf323('0x2f')](function(_0x3ea1a7){if(_0x3ea1a7){return _0x3ea1a7?{'count':_0x906460,'rows':_0x3ea1a7}:null;}})[_0xf323('0x2f')](respondWithResult(_0x342c6a,null))[_0xf323('0x53')](handleError(_0x342c6a,null));};exports['addLists']=function(_0xdec264,_0xde8510,_0x3656b2){var _0x52d295=moment()[_0xf323('0x9b')]('YYYY-MM-DD\x20HH:mm:ss');var _0x26f00b,_0x4690a9;return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0xdec264['params']['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0xde8510,null))['then'](function(_0xe5e761){if(_0xe5e761){_0x4690a9=_0xe5e761;return _0xe5e761[_0xf323('0xa2')](_0xdec264[_0xf323('0x59')][_0xf323('0x96')],_['omit'](_0xdec264[_0xf323('0x59')],[_0xf323('0x96'),'id'])||{});}return null;})['spread'](function(_0x2bc699){var _0x30bacb;_0x26f00b=_0x2bc699||[];var _0x2a6cc5=[];if(_0x2bc699){for(var _0x13709f=0x0;_0x13709f<_0x2bc699[_0xf323('0x46')];_0x13709f+=0x1){var _0x1af941=_0x2bc699[_0x13709f]['get']({'plain':!![]});_0x4690a9[_0xf323('0xa3')]=_0xdec264[_0xf323('0x59')]['dialCheckDuplicateType']?_0xdec264['body'][_0xf323('0xa3')]:_0x4690a9[_0xf323('0xa3')];switch(_0x4690a9['dialCheckDuplicateType']){case'always':_0x30bacb=squel[_0xf323('0xa4')]()[_0xf323('0xa5')]('cm_hopper')[_0xf323('0xa6')]([_0xf323('0xa7'),'scheduledAt',_0xf323('0xa8'),_0xf323('0xa9'),_0xf323('0x6b'),_0xf323('0x63'),_0xf323('0x64')],squel[_0xf323('0x88')]()[_0xf323('0x89')]('phone','phone')['field']('\x27'+_0x52d295+'\x27',_0xf323('0xaa'))[_0xf323('0x89')]('id',_0xf323('0xa8'))[_0xf323('0x89')](_0x1af941[_0xf323('0xab')][_0xf323('0xac')](),'ListId')[_0xf323('0x89')](_0xdec264[_0xf323('0x55')]['id'][_0xf323('0xac')](),'VoiceQueueId')[_0xf323('0x89')]('\x27'+_0x52d295+'\x27',_0xf323('0x63'))[_0xf323('0x89')]('\x27'+_0x52d295+'\x27',_0xf323('0x64'))[_0xf323('0x8b')](_0xf323('0xad'))['where'](_0xf323('0xae'))[_0xf323('0x4b')]('ListId\x20=\x20?',_0x1af941[_0xf323('0xab')][_0xf323('0xac')]())[_0xf323('0x4b')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xf323('0x88')]()[_0xf323('0x89')](_0xf323('0xaf'))['from'](_0xf323('0xb0'))[_0xf323('0x4b')](_0xf323('0x90'),_0xdec264[_0xf323('0x55')]['id'][_0xf323('0xac')]()))[_0xf323('0x4b')](_0xf323('0xb1'),squel['select']()[_0xf323('0x89')](_0xf323('0xb2'))['from'](_0xf323('0xb3'))[_0xf323('0x4b')]('VoiceQueueId\x20=\x20?',_0xdec264[_0xf323('0x55')]['id'][_0xf323('0xac')]())))[_0xf323('0xac')]();break;case _0xf323('0xb4'):_0x30bacb=squel[_0xf323('0xa4')]()[_0xf323('0xa5')]('cm_hopper')[_0xf323('0xa6')]([_0xf323('0xa7'),_0xf323('0xaa'),_0xf323('0xa8'),_0xf323('0xa9'),_0xf323('0x6b'),_0xf323('0x63'),'updatedAt'],squel['select']()[_0xf323('0x89')](_0xf323('0xa7'),'phone')[_0xf323('0x89')]('\x27'+_0x52d295+'\x27','scheduledAt')['field']('id',_0xf323('0xa8'))['field'](_0x1af941[_0xf323('0xab')][_0xf323('0xac')](),_0xf323('0xa9'))['field'](_0xdec264[_0xf323('0x55')]['id'][_0xf323('0xac')](),_0xf323('0x6b'))[_0xf323('0x89')]('\x27'+_0x52d295+'\x27',_0xf323('0x63'))['field']('\x27'+_0x52d295+'\x27',_0xf323('0x64'))[_0xf323('0x8b')](_0xf323('0xad'))[_0xf323('0x4b')](_0xf323('0xae'))['where'](_0xf323('0xb5'),_0x1af941[_0xf323('0xab')]['toString']())[_0xf323('0x4b')](_0xf323('0xb6'))['where'](_0xf323('0xb1'),squel[_0xf323('0x88')]()['field'](_0xf323('0xb2'))[_0xf323('0x8b')](_0xf323('0xb3'))[_0xf323('0x4b')]('VoiceQueueId\x20=\x20?',_0xdec264[_0xf323('0x55')]['id']['toString']())))['toString']();break;default:_0x30bacb=squel['insert']()[_0xf323('0xa5')](_0xf323('0xb3'))[_0xf323('0xa6')](['phone','scheduledAt',_0xf323('0xa8'),_0xf323('0xa9'),'VoiceQueueId','createdAt','updatedAt'],squel[_0xf323('0x88')]()['field'](_0xf323('0xa7'),_0xf323('0xa7'))[_0xf323('0x89')]('\x27'+_0x52d295+'\x27','scheduledAt')[_0xf323('0x89')]('id',_0xf323('0xa8'))[_0xf323('0x89')](_0x1af941['CmListId'][_0xf323('0xac')](),_0xf323('0xa9'))['field'](_0xdec264['params']['id'][_0xf323('0xac')](),_0xf323('0x6b'))['field']('\x27'+_0x52d295+'\x27',_0xf323('0x63'))[_0xf323('0x89')]('\x27'+_0x52d295+'\x27',_0xf323('0x64'))[_0xf323('0x8b')](_0xf323('0xad'))[_0xf323('0x4b')](_0xf323('0xae'))[_0xf323('0x4b')]('ListId\x20=\x20?',_0x1af941[_0xf323('0xab')][_0xf323('0xac')]())[_0xf323('0x4b')](_0xf323('0xb6')))[_0xf323('0xac')]();}_0x2a6cc5['push'](db[_0xf323('0x7c')][_0xf323('0x42')](_0x30bacb));}return BPromise[_0xf323('0x94')](_0x2a6cc5);}})[_0xf323('0x2f')](function(){var _0x42e04b=[];var _0x481bc4=squel[_0xf323('0xa4')]()[_0xf323('0xa5')](_0xf323('0xb7'))[_0xf323('0xa6')]([_0xf323('0xb8'),_0xf323('0xa7'),_0xf323('0xb9'),_0xf323('0x63'),'updatedAt'],squel[_0xf323('0x88')]()[_0xf323('0x89')](_0xf323('0xba'))[_0xf323('0x89')](_0xf323('0xbb'))['field'](_0xf323('0xbc'))['field']('\x27'+_0x52d295+'\x27',_0xf323('0x63'))[_0xf323('0x89')]('\x27'+_0x52d295+'\x27',_0xf323('0x64'))['from']('cm_contact_has_items','ci')[_0xf323('0x8d')](_0xf323('0xb3'),'h',_0xf323('0xbd'))['where']('h.scheduledat=?',_0x52d295)[_0xf323('0x4b')](_0xf323('0xbe'),'PHONE'))[_0xf323('0xac')]();_0x42e04b[_0xf323('0x91')](db[_0xf323('0x7c')][_0xf323('0x42')](_0x481bc4));return BPromise[_0xf323('0x94')](_0x42e04b);})[_0xf323('0x2f')](function(){return _0x26f00b;})[_0xf323('0x2f')](respondWithResult(_0xde8510,null))[_0xf323('0x53')](handleError(_0xde8510,null));};exports[_0xf323('0xbf')]=function(_0x3ebbbe,_0x547578,_0x52eca6){return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0x3ebbbe[_0xf323('0x55')]['id']}})['then'](handleEntityNotFound(_0x547578,null))[_0xf323('0x2f')](function(_0x2f1951){if(_0x2f1951){return _0x2f1951['removeLists'](_0x3ebbbe[_0xf323('0x42')][_0xf323('0x96')]);}})[_0xf323('0x2f')](function(_0x2ba06e){if(_0x2ba06e){return db['CmHopper']['destroy']({'where':{'ListId':_0x3ebbbe['query'][_0xf323('0x96')],'VoiceQueueId':_0x3ebbbe[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](function(){return _0x2ba06e;});}})[_0xf323('0x2f')](respondWithStatusCode(_0x547578,null))[_0xf323('0x53')](handleError(_0x547578,null));};exports['getBlackLists']=function(_0x28c270,_0xc52c58,_0x479085){var _0x2fd3cb={};var _0x4ed838={};var _0x259801;var _0x3bbebd;return db[_0xf323('0x4f')][_0xf323('0x67')]({'where':{'id':_0x28c270[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0xc52c58,null))[_0xf323('0x2f')](function(_0x3348a3){if(_0x3348a3){_0x259801=_0x3348a3;_0x4ed838[_0xf323('0x41')]=_[_0xf323('0x43')](db[_0xf323('0xc0')][_0xf323('0x40')]);_0x4ed838[_0xf323('0x42')]=_[_0xf323('0x43')](_0x28c270['query']);_0x4ed838[_0xf323('0x4c')]=_[_0xf323('0x56')](_0x4ed838[_0xf323('0x41')],_0x4ed838[_0xf323('0x42')]);_0x2fd3cb[_0xf323('0x44')]=_[_0xf323('0x56')](_0x4ed838[_0xf323('0x41')],qs[_0xf323('0x45')](_0x28c270[_0xf323('0x42')][_0xf323('0x45')]));_0x2fd3cb[_0xf323('0x44')]=_0x2fd3cb[_0xf323('0x44')][_0xf323('0x46')]?_0x2fd3cb[_0xf323('0x44')]:_0x4ed838[_0xf323('0x41')];_0x2fd3cb[_0xf323('0x49')]=qs[_0xf323('0x4a')](_0x28c270[_0xf323('0x42')][_0xf323('0x4a')]);_0x2fd3cb[_0xf323('0x4b')]=qs[_0xf323('0x4c')](_[_0xf323('0x4d')](_0x28c270[_0xf323('0x42')],_0x4ed838[_0xf323('0x4c')]));if(_0x28c270[_0xf323('0x42')][_0xf323('0x34')]){_0x2fd3cb[_0xf323('0x4b')]=_[_0xf323('0x4e')](_0x2fd3cb[_0xf323('0x4b')],{'$or':_[_0xf323('0x35')](_0x2fd3cb[_0xf323('0x44')],function(_0x359465){var _0x1bd323={};_0x1bd323[_0x359465]={'$like':'%'+_0x28c270['query'][_0xf323('0x34')]+'%'};return _0x1bd323;})});}_0x2fd3cb=_[_0xf323('0x4e')]({},_0x2fd3cb,_0x28c270[_0xf323('0x57')]);return _0x259801[_0xf323('0xc1')](_0x2fd3cb);}})['then'](function(_0x112d86){if(_0x112d86){_0x3bbebd=_0x112d86[_0xf323('0x46')];if(!_0x28c270['query'][_0xf323('0x47')](_0xf323('0x48'))){_0x2fd3cb['limit']=qs[_0xf323('0x28')](_0x28c270['query'][_0xf323('0x28')]);_0x2fd3cb[_0xf323('0x26')]=qs[_0xf323('0x26')](_0x28c270[_0xf323('0x42')][_0xf323('0x26')]);}return _0x259801[_0xf323('0xc1')](_0x2fd3cb);}})['then'](function(_0x5e82bd){if(_0x5e82bd){return _0x5e82bd?{'count':_0x3bbebd,'rows':_0x5e82bd}:null;}})['then'](respondWithResult(_0xc52c58,null))[_0xf323('0x53')](handleError(_0xc52c58,null));};exports['addBlackLists']=function(_0x1ab82c,_0x5a464e,_0x1ff7c4){var _0x458f75,_0xe7cf03;return db[_0xf323('0x4f')][_0xf323('0x39')]({'where':{'id':_0x1ab82c[_0xf323('0x55')]['id']}})[_0xf323('0x2f')](handleEntityNotFound(_0x5a464e,null))[_0xf323('0x2f')](function(_0x140342){if(_0x140342){_0xe7cf03=_0x140342;return _0x140342[_0xf323('0xc2')](_0x1ab82c[_0xf323('0x59')][_0xf323('0x96')],_['omit'](_0x1ab82c['body'],[_0xf323('0x96'),'id'])||{});}return null;})[_0xf323('0x99')](function(_0x14a87d){var _0x20b25d;_0x458f75=_0x14a87d||[];var _0x4e899e=[];if(_0x14a87d){for(var _0xc03362=0x0;_0xc03362<_0x14a87d[_0xf323('0x46')];_0xc03362+=0x1){var _0x440991=_0x14a87d[_0xc03362][_0xf323('0x30')]({'plain':!![]});_0x20b25d=squel[_0xf323('0xa4')]()[_0xf323('0xa5')](_0xf323('0xc3'))[_0xf323('0xa6')](['phone',_0xf323('0xa8'),_0xf323('0xa9'),_0xf323('0x6b'),_0xf323('0x63'),_0xf323('0x64')],squel[_0xf323('0x88')]()['field'](_0xf323('0xa7'),_0xf323('0xa7'))[_0xf323('0x89')]('id',_0xf323('0xa8'))[_0xf323('0x89')](_0x440991[_0xf323('0xab')][_0xf323('0xac')](),_0xf323('0xa9'))['field'](_0x1ab82c[_0xf323('0x55')]['id'][_0xf323('0xac')](),_0xf323('0x6b'))[_0xf323('0x89')]('NOW()','createdAt')[_0xf323('0x89')](_0xf323('0xc4'),_0xf323('0x64'))['from'](_0xf323('0xad'))[_0xf323('0x4b')](_0xf323('0xae'))[_0xf323('0x4b')](_0xf323('0xb5'),_0x440991[_0xf323('0xab')][_0xf323('0xac')]())['where'](_0xf323('0xb6')))[_0xf323('0xac')]();_0x4e899e[_0xf323('0x91')](db[_0xf323('0x7c')][_0xf323('0x42')](_0x20b25d));}return BPromise['all'](_0x4e899e);}})['then'](function(){return _0x458f75;})[_0xf323('0x2f')](respondWithResult(_0x5a464e,null))[_0xf323('0x53')](handleError(_0x5a464e,null));};exports[_0xf323('0xc5')]=function(_0x432a26,_0x5e8e8a,_0x58a69f){return db[_0xf323('0x4f')]['find']({'where':{'id':_0x432a26[_0xf323('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e8e8a,null))[_0xf323('0x2f')](function(_0x2a9375){if(_0x2a9375){return _0x2a9375['removeBlackLists'](_0x432a26['query'][_0xf323('0x96')]);}})['then'](function(_0x26db41){if(_0x26db41){return db['CmHopperBlack'][_0xf323('0x3b')]({'where':{'ListId':_0x432a26[_0xf323('0x42')]['ids'],'VoiceQueueId':_0x432a26[_0xf323('0x55')]['id']}})['then'](function(){return _0x26db41;});}})[_0xf323('0x2f')](respondWithStatusCode(_0x5e8e8a,null))['catch'](handleError(_0x5e8e8a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 22f055f..344ace9 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 _0xed99=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xed99,0xbe));var _0x9ed9=function(_0x596c69,_0x552fba){_0x596c69=_0x596c69-0x0;var _0x57ee18=_0xed99[_0x596c69];return _0x57ee18;};'use strict';var EventEmitter=require(_0x9ed9('0x0'));var VoiceQueue=require(_0x9ed9('0x1'))['db'][_0x9ed9('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9ed9('0x3')](0x0);var events={'afterCreate':_0x9ed9('0x4'),'afterUpdate':_0x9ed9('0x5'),'afterDestroy':_0x9ed9('0x6')};function emitEvent(_0x3569e1){return function(_0x3d47c0,_0x48bc1d,_0x16639b){VoiceQueueEvents[_0x9ed9('0x7')](_0x3569e1+':'+_0x3d47c0['id'],_0x3d47c0);VoiceQueueEvents[_0x9ed9('0x7')](_0x3569e1,_0x3d47c0);_0x16639b(null);};}for(var e in events){if(events[_0x9ed9('0x8')](e)){var event=events[e];VoiceQueue[_0x9ed9('0x9')](e,emitEvent(event));}}module[_0x9ed9('0xa')]=VoiceQueueEvents; \ No newline at end of file +var _0xe241=['remove','emit','hook','save'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0xe241,0x113));var _0x1e24=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xe241[_0x101e7b];return _0x4995c0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1e24('0x0'),'afterUpdate':'update','afterDestroy':_0x1e24('0x1')};function emitEvent(_0x5edd5b){return function(_0x2a46e1,_0x4b47c7,_0x2e1570){VoiceQueueEvents['emit'](_0x5edd5b+':'+_0x2a46e1['id'],_0x2a46e1);VoiceQueueEvents[_0x1e24('0x2')](_0x5edd5b,_0x2a46e1);_0x2e1570(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1e24('0x3')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 1aaa7ec..e0e6bf0 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3366fe,_0x38176d){var _0x17c365=function(_0x553fee){while(--_0x553fee){_0x3366fe['push'](_0x3366fe['shift']());}};_0x17c365(++_0x38176d);}(_0x34e8,0x12c));var _0x834e=function(_0x3643bc,_0x73dec3){_0x3643bc=_0x3643bc-0x0;var _0x5ddc8f=_0x34e8[_0x3643bc];return _0x5ddc8f;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x4880b9,_0x384c39){var _0x200e1a=function(_0x57e72f){while(--_0x57e72f){_0x4880b9['push'](_0x4880b9['shift']());}};_0x200e1a(++_0x384c39);}(_0xedd9,0xfc));var _0x9edd=function(_0x34e9d2,_0x5288ad){_0x34e9d2=_0x34e9d2-0x0;var _0x575965=_0xedd9[_0x34e9d2];return _0x575965;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','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 fb4a184..4b4b305 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 _0x7b6a=['defaults','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','VoiceQueue','findAll','options','raw','where','include','model','attributes','map','GetVoiceQueue','catch','ShowVoiceQueue','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x35d9fd,_0xe4358e){var _0x232ab4=function(_0x3cc5e5){while(--_0x3cc5e5){_0x35d9fd['push'](_0x35d9fd['shift']());}};_0x232ab4(++_0xe4358e);}(_0x7b6a,0x164));var _0xa7b6=function(_0x4f4344,_0x389530){_0x4f4344=_0x4f4344-0x0;var _0x4af79b=_0x7b6a[_0x4f4344];return _0x4af79b;};'use strict';var _=require(_0xa7b6('0x0'));var util=require(_0xa7b6('0x1'));var moment=require('moment');var BPromise=require(_0xa7b6('0x2'));var rs=require(_0xa7b6('0x3'));var fs=require('fs');var Redis=require(_0xa7b6('0x4'));var db=require(_0xa7b6('0x5'))['db'];var utils=require(_0xa7b6('0x6'));var logger=require(_0xa7b6('0x7'))(_0xa7b6('0x8'));var config=require(_0xa7b6('0x9'));var jayson=require(_0xa7b6('0xa'));var client=jayson[_0xa7b6('0xb')]['http']({'port':0x232a});config[_0xa7b6('0xc')]=_[_0xa7b6('0xd')](config[_0xa7b6('0xc')],{'host':_0xa7b6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7b6('0xc')]));require(_0xa7b6('0xf'))[_0xa7b6('0x10')](socket);function respondWithRpcPromise(_0x26f55a,_0xc5c070,_0x1e44da){return new BPromise(function(_0x326411,_0x51174a){return client[_0xa7b6('0x11')](_0x26f55a,_0x1e44da)[_0xa7b6('0x12')](function(_0x3f1e4c){logger[_0xa7b6('0x13')](_0xa7b6('0x14'),_0xc5c070,_0xa7b6('0x15'));logger[_0xa7b6('0x16')](_0xa7b6('0x17'),_0xc5c070,'request\x20sent',JSON['stringify'](_0x3f1e4c));if(_0x3f1e4c['error']){if(_0x3f1e4c['error'][_0xa7b6('0x18')]===0x1f4){logger[_0xa7b6('0x19')](_0xa7b6('0x14'),_0xc5c070,_0x3f1e4c[_0xa7b6('0x19')]['message']);return _0x51174a(_0x3f1e4c[_0xa7b6('0x19')][_0xa7b6('0x1a')]);}logger[_0xa7b6('0x19')](_0xa7b6('0x14'),_0xc5c070,_0x3f1e4c[_0xa7b6('0x19')][_0xa7b6('0x1a')]);return _0x326411(_0x3f1e4c[_0xa7b6('0x19')][_0xa7b6('0x1a')]);}else{logger[_0xa7b6('0x13')]('VoiceQueue,\x20%s,\x20%s',_0xc5c070,_0xa7b6('0x15'));_0x326411(_0x3f1e4c[_0xa7b6('0x1b')][_0xa7b6('0x1a')]);}})['catch'](function(_0x4b69c6){logger[_0xa7b6('0x19')](_0xa7b6('0x14'),_0xc5c070,_0x4b69c6);_0x51174a(_0x4b69c6);});});}exports['GetVoiceQueue']=function(_0x54df7a){var _0x2e2651=this;return new Promise(function(_0x39e5ab,_0x1ba819){return db[_0xa7b6('0x1c')][_0xa7b6('0x1d')]({'raw':_0x54df7a[_0xa7b6('0x1e')]?_0x54df7a[_0xa7b6('0x1e')][_0xa7b6('0x1f')]===undefined?!![]:![]:!![],'where':_0x54df7a[_0xa7b6('0x1e')]?_0x54df7a[_0xa7b6('0x1e')][_0xa7b6('0x20')]||null:null,'attributes':_0x54df7a[_0xa7b6('0x1e')]?_0x54df7a[_0xa7b6('0x1e')]['attributes']||null:null,'limit':_0x54df7a[_0xa7b6('0x1e')]?_0x54df7a[_0xa7b6('0x1e')]['limit']||null:null,'include':_0x54df7a[_0xa7b6('0x1e')]?_0x54df7a[_0xa7b6('0x1e')][_0xa7b6('0x21')]?_['map'](_0x54df7a['options'][_0xa7b6('0x21')],function(_0x3f81a1){return{'model':db[_0x3f81a1[_0xa7b6('0x22')]],'as':_0x3f81a1['as'],'attributes':_0x3f81a1[_0xa7b6('0x23')],'include':_0x3f81a1[_0xa7b6('0x21')]?_[_0xa7b6('0x24')](_0x3f81a1[_0xa7b6('0x21')],function(_0x4f095f){return{'model':db[_0x4f095f[_0xa7b6('0x22')]],'as':_0x4f095f['as'],'attributes':_0x4f095f['attributes'],'include':_0x4f095f[_0xa7b6('0x21')]?_[_0xa7b6('0x24')](_0x4f095f['include'],function(_0x1e4899){return{'model':db[_0x1e4899[_0xa7b6('0x22')]],'as':_0x1e4899['as'],'attributes':_0x1e4899['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x155e29){logger['info'](_0xa7b6('0x25'),_0x54df7a);logger[_0xa7b6('0x16')](_0xa7b6('0x25'),_0x54df7a,JSON['stringify'](_0x155e29));_0x39e5ab(_0x155e29);})[_0xa7b6('0x26')](function(_0x2d129d){logger[_0xa7b6('0x19')]('GetVoiceQueue',_0x2d129d['message'],_0x54df7a);_0x1ba819(_0x2e2651[_0xa7b6('0x19')](0x1f4,_0x2d129d[_0xa7b6('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x28edf5){var _0x5799a2=this;return new Promise(function(_0x2e1856,_0x2e1937){return db[_0xa7b6('0x1c')]['find']({'raw':_0x28edf5[_0xa7b6('0x1e')]?_0x28edf5[_0xa7b6('0x1e')][_0xa7b6('0x1f')]===undefined?!![]:![]:!![],'where':_0x28edf5[_0xa7b6('0x1e')]?_0x28edf5[_0xa7b6('0x1e')][_0xa7b6('0x20')]||null:null,'attributes':_0x28edf5[_0xa7b6('0x1e')]?_0x28edf5[_0xa7b6('0x1e')]['attributes']||null:null,'include':_0x28edf5[_0xa7b6('0x1e')]?_0x28edf5[_0xa7b6('0x1e')][_0xa7b6('0x21')]?_[_0xa7b6('0x24')](_0x28edf5[_0xa7b6('0x1e')][_0xa7b6('0x21')],function(_0x51131f){return{'model':db[_0x51131f[_0xa7b6('0x22')]],'as':_0x51131f['as'],'attributes':_0x51131f[_0xa7b6('0x23')],'include':_0x51131f[_0xa7b6('0x21')]?_['map'](_0x51131f[_0xa7b6('0x21')],function(_0x3933b5){return{'model':db[_0x3933b5['model']],'as':_0x3933b5['as'],'attributes':_0x3933b5[_0xa7b6('0x23')],'include':_0x3933b5[_0xa7b6('0x21')]?_[_0xa7b6('0x24')](_0x3933b5[_0xa7b6('0x21')],function(_0x5160e9){return{'model':db[_0x5160e9[_0xa7b6('0x22')]],'as':_0x5160e9['as'],'attributes':_0x5160e9[_0xa7b6('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa7b6('0x12')](function(_0x2ab2a7){logger['info'](_0xa7b6('0x27'),_0x28edf5);logger[_0xa7b6('0x16')](_0xa7b6('0x27'),_0x28edf5,JSON[_0xa7b6('0x28')](_0x2ab2a7));_0x2e1856(_0x2ab2a7);})[_0xa7b6('0x26')](function(_0x3dcba1){logger[_0xa7b6('0x19')](_0xa7b6('0x27'),_0x3dcba1[_0xa7b6('0x1a')],_0x28edf5);_0x2e1937(_0x5799a2[_0xa7b6('0x19')](0x1f4,_0x3dcba1['message']));});});}; \ No newline at end of file +var _0xf8ad=['GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','map','include','model','find','where','ShowVoiceQueue','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5327fe,_0x47484a){var _0x31957a=function(_0x4077aa){while(--_0x4077aa){_0x5327fe['push'](_0x5327fe['shift']());}};_0x31957a(++_0x47484a);}(_0xf8ad,0x163));var _0xdf8a=function(_0xe64f66,_0xe7386a){_0xe64f66=_0xe64f66-0x0;var _0x39a151=_0xf8ad[_0xe64f66];return _0x39a151;};'use strict';var _=require('lodash');var util=require(_0xdf8a('0x0'));var moment=require('moment');var BPromise=require(_0xdf8a('0x1'));var rs=require(_0xdf8a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf8a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf8a('0x4'))('rpc');var config=require(_0xdf8a('0x5'));var jayson=require(_0xdf8a('0x6'));var client=jayson[_0xdf8a('0x7')]['http']({'port':0x232a});config[_0xdf8a('0x8')]=_[_0xdf8a('0x9')](config['redis'],{'host':_0xdf8a('0xa'),'port':0x18eb});var socket=require(_0xdf8a('0xb'))(new Redis(config[_0xdf8a('0x8')]));require('./voiceQueue.socket')[_0xdf8a('0xc')](socket);function respondWithRpcPromise(_0x1089bd,_0x5b114f,_0x42474d){return new BPromise(function(_0x3010a0,_0x5ea2c6){return client['request'](_0x1089bd,_0x42474d)[_0xdf8a('0xd')](function(_0x8b7ebf){logger[_0xdf8a('0xe')](_0xdf8a('0xf'),_0x5b114f,'request\x20sent');logger[_0xdf8a('0x10')](_0xdf8a('0x11'),_0x5b114f,_0xdf8a('0x12'),JSON[_0xdf8a('0x13')](_0x8b7ebf));if(_0x8b7ebf[_0xdf8a('0x14')]){if(_0x8b7ebf[_0xdf8a('0x14')][_0xdf8a('0x15')]===0x1f4){logger[_0xdf8a('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x5b114f,_0x8b7ebf['error']['message']);return _0x5ea2c6(_0x8b7ebf[_0xdf8a('0x14')][_0xdf8a('0x16')]);}logger['error'](_0xdf8a('0xf'),_0x5b114f,_0x8b7ebf[_0xdf8a('0x14')][_0xdf8a('0x16')]);return _0x3010a0(_0x8b7ebf['error'][_0xdf8a('0x16')]);}else{logger[_0xdf8a('0xe')]('VoiceQueue,\x20%s,\x20%s',_0x5b114f,_0xdf8a('0x12'));_0x3010a0(_0x8b7ebf[_0xdf8a('0x17')][_0xdf8a('0x16')]);}})[_0xdf8a('0x18')](function(_0x21671e){logger[_0xdf8a('0x14')](_0xdf8a('0xf'),_0x5b114f,_0x21671e);_0x5ea2c6(_0x21671e);});});}exports[_0xdf8a('0x19')]=function(_0x78f50b){var _0x16a9d8=this;return new Promise(function(_0x1e91cd,_0x3f1fe9){return db[_0xdf8a('0x1a')][_0xdf8a('0x1b')]({'raw':_0x78f50b[_0xdf8a('0x1c')]?_0x78f50b['options'][_0xdf8a('0x1d')]===undefined?!![]:![]:!![],'where':_0x78f50b[_0xdf8a('0x1c')]?_0x78f50b['options']['where']||null:null,'attributes':_0x78f50b[_0xdf8a('0x1c')]?_0x78f50b['options'][_0xdf8a('0x1e')]||null:null,'limit':_0x78f50b[_0xdf8a('0x1c')]?_0x78f50b[_0xdf8a('0x1c')][_0xdf8a('0x1f')]||null:null,'include':_0x78f50b[_0xdf8a('0x1c')]?_0x78f50b['options']['include']?_[_0xdf8a('0x20')](_0x78f50b[_0xdf8a('0x1c')][_0xdf8a('0x21')],function(_0x61c2fc){return{'model':db[_0x61c2fc[_0xdf8a('0x22')]],'as':_0x61c2fc['as'],'attributes':_0x61c2fc['attributes'],'include':_0x61c2fc[_0xdf8a('0x21')]?_[_0xdf8a('0x20')](_0x61c2fc[_0xdf8a('0x21')],function(_0x2dfe2d){return{'model':db[_0x2dfe2d['model']],'as':_0x2dfe2d['as'],'attributes':_0x2dfe2d[_0xdf8a('0x1e')],'include':_0x2dfe2d['include']?_[_0xdf8a('0x20')](_0x2dfe2d[_0xdf8a('0x21')],function(_0x4fd54e){return{'model':db[_0x4fd54e[_0xdf8a('0x22')]],'as':_0x4fd54e['as'],'attributes':_0x4fd54e[_0xdf8a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf8a('0xd')](function(_0x27e3af){logger[_0xdf8a('0xe')](_0xdf8a('0x19'),_0x78f50b);logger[_0xdf8a('0x10')]('GetVoiceQueue',_0x78f50b,JSON[_0xdf8a('0x13')](_0x27e3af));_0x1e91cd(_0x27e3af);})[_0xdf8a('0x18')](function(_0x108efd){logger[_0xdf8a('0x14')]('GetVoiceQueue',_0x108efd['message'],_0x78f50b);_0x3f1fe9(_0x16a9d8[_0xdf8a('0x14')](0x1f4,_0x108efd['message']));});});};exports['ShowVoiceQueue']=function(_0x1b09bf){var _0x1bea1e=this;return new Promise(function(_0x478302,_0x3249fd){return db[_0xdf8a('0x1a')][_0xdf8a('0x23')]({'raw':_0x1b09bf[_0xdf8a('0x1c')]?_0x1b09bf['options'][_0xdf8a('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b09bf['options']?_0x1b09bf['options'][_0xdf8a('0x24')]||null:null,'attributes':_0x1b09bf[_0xdf8a('0x1c')]?_0x1b09bf[_0xdf8a('0x1c')][_0xdf8a('0x1e')]||null:null,'include':_0x1b09bf[_0xdf8a('0x1c')]?_0x1b09bf[_0xdf8a('0x1c')]['include']?_[_0xdf8a('0x20')](_0x1b09bf['options']['include'],function(_0x41d2cc){return{'model':db[_0x41d2cc[_0xdf8a('0x22')]],'as':_0x41d2cc['as'],'attributes':_0x41d2cc[_0xdf8a('0x1e')],'include':_0x41d2cc[_0xdf8a('0x21')]?_['map'](_0x41d2cc['include'],function(_0x2c208f){return{'model':db[_0x2c208f[_0xdf8a('0x22')]],'as':_0x2c208f['as'],'attributes':_0x2c208f['attributes'],'include':_0x2c208f[_0xdf8a('0x21')]?_[_0xdf8a('0x20')](_0x2c208f[_0xdf8a('0x21')],function(_0x4a8ecd){return{'model':db[_0x4a8ecd['model']],'as':_0x4a8ecd['as'],'attributes':_0x4a8ecd[_0xdf8a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf8a('0xd')](function(_0x1f5c14){logger[_0xdf8a('0xe')](_0xdf8a('0x25'),_0x1b09bf);logger[_0xdf8a('0x10')](_0xdf8a('0x25'),_0x1b09bf,JSON[_0xdf8a('0x13')](_0x1f5c14));_0x478302(_0x1f5c14);})[_0xdf8a('0x18')](function(_0xeeb877){logger[_0xdf8a('0x14')](_0xdf8a('0x25'),_0xeeb877[_0xdf8a('0x16')],_0x1b09bf);_0x3249fd(_0x1bea1e[_0xdf8a('0x14')](0x1f4,_0xeeb877[_0xdf8a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 6579364..332b8d4 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 _0xdc35=['./voiceQueue.events','save','removeListener','length','voiceQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc35,0x1e0));var _0x5dc3=function(_0x487460,_0x57bf7b){_0x487460=_0x487460-0x0;var _0x5117c8=_0xdc35[_0x487460];return _0x5117c8;};'use strict';var VoiceQueueEvents=require(_0x5dc3('0x0'));var events=[_0x5dc3('0x1'),'remove','update'];function createListener(_0x352916,_0x1dd8da){return function(_0x4724ce){_0x1dd8da['emit'](_0x352916,_0x4724ce);};}function removeListener(_0x2e6d19,_0x44f129){return function(){VoiceQueueEvents[_0x5dc3('0x2')](_0x2e6d19,_0x44f129);};}exports['register']=function(_0x1fdb3d){for(var _0x9db608=0x0,_0x58500a=events[_0x5dc3('0x3')];_0x9db608<_0x58500a;_0x9db608++){var _0x48e2f1=events[_0x9db608];var _0x35e44e=createListener(_0x5dc3('0x4')+_0x48e2f1,_0x1fdb3d);VoiceQueueEvents['on'](_0x48e2f1,_0x35e44e);}}; \ No newline at end of file +var _0xbd32=['voiceQueue:','./voiceQueue.events','remove','update','emit','removeListener','register','length'];(function(_0x500f24,_0x1eb0d2){var _0xf6787f=function(_0x33e134){while(--_0x33e134){_0x500f24['push'](_0x500f24['shift']());}};_0xf6787f(++_0x1eb0d2);}(_0xbd32,0x181));var _0x2bd3=function(_0x2d9823,_0x420f05){_0x2d9823=_0x2d9823-0x0;var _0x3fa2e5=_0xbd32[_0x2d9823];return _0x3fa2e5;};'use strict';var VoiceQueueEvents=require(_0x2bd3('0x0'));var events=['save',_0x2bd3('0x1'),_0x2bd3('0x2')];function createListener(_0x352b55,_0x58853e){return function(_0x2bd9bd){_0x58853e[_0x2bd3('0x3')](_0x352b55,_0x2bd9bd);};}function removeListener(_0x17cc48,_0x37b05b){return function(){VoiceQueueEvents[_0x2bd3('0x4')](_0x17cc48,_0x37b05b);};}exports[_0x2bd3('0x5')]=function(_0x2689a4){for(var _0x3acc73=0x0,_0x9257ff=events[_0x2bd3('0x6')];_0x3acc73<_0x9257ff;_0x3acc73++){var _0x111d58=events[_0x3acc73];var _0x41ab60=createListener(_0x2bd3('0x7')+_0x111d58,_0x2689a4);VoiceQueueEvents['on'](_0x111d58,_0x41ab60);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index e207eab..da90849 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 _0x905b=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x4989d2,_0x3e849d){var _0x28f763=function(_0x197c4d){while(--_0x197c4d){_0x4989d2['push'](_0x4989d2['shift']());}};_0x28f763(++_0x3e849d);}(_0x905b,0x87));var _0xb905=function(_0x10f62c,_0x347b25){_0x10f62c=_0x10f62c-0x0;var _0x33c8c5=_0x905b[_0x10f62c];return _0x33c8c5;};'use strict';var multer=require(_0xb905('0x0'));var util=require(_0xb905('0x1'));var path=require(_0xb905('0x2'));var timeout=require(_0xb905('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb905('0x4'));var auth=require(_0xb905('0x5'));var interaction=require(_0xb905('0x6'));var config=require(_0xb905('0x7'));var controller=require('./voiceQueueReport.controller');router[_0xb905('0x8')]('/',auth[_0xb905('0x9')](),controller['index']);router['get']('/describe',auth[_0xb905('0x9')](),controller[_0xb905('0xa')]);router[_0xb905('0x8')](_0xb905('0xb'),auth[_0xb905('0x9')](),controller[_0xb905('0xc')]);router[_0xb905('0x8')](_0xb905('0xd'),auth['isAuthenticated'](),controller[_0xb905('0xe')]);router[_0xb905('0xf')]('/',auth[_0xb905('0x9')](),controller['create']);router[_0xb905('0x10')](_0xb905('0xd'),auth[_0xb905('0x9')](),controller['update']);router[_0xb905('0x11')]('/:id',auth[_0xb905('0x9')](),controller[_0xb905('0x12')]);module[_0xb905('0x13')]=router; \ No newline at end of file +var _0xc50b=['exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','isAuthenticated','getVoiceQueuesReport','/:id','show','create','put','update'];(function(_0x308ddd,_0x3a8401){var _0x3224c3=function(_0x230424){while(--_0x230424){_0x308ddd['push'](_0x308ddd['shift']());}};_0x3224c3(++_0x3a8401);}(_0xc50b,0x151));var _0xbc50=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0xc50b[_0x277fa3];return _0x2e4520;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc50('0x0'));var timeout=require(_0xbc50('0x1'));var express=require(_0xbc50('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbc50('0x3'));var config=require(_0xbc50('0x4'));var controller=require(_0xbc50('0x5'));router[_0xbc50('0x6')]('/',auth['isAuthenticated'](),controller[_0xbc50('0x7')]);router[_0xbc50('0x6')]('/describe',auth[_0xbc50('0x8')](),controller['describe']);router[_0xbc50('0x6')]('/index',auth[_0xbc50('0x8')](),controller[_0xbc50('0x9')]);router['get'](_0xbc50('0xa'),auth[_0xbc50('0x8')](),controller[_0xbc50('0xb')]);router['post']('/',auth[_0xbc50('0x8')](),controller[_0xbc50('0xc')]);router[_0xbc50('0xd')](_0xbc50('0xa'),auth[_0xbc50('0x8')](),controller[_0xbc50('0xe')]);router['delete'](_0xbc50('0xa'),auth[_0xbc50('0x8')](),controller['destroy']);module[_0xbc50('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 82e2a32..6f79067 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 _0x3369=['YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format'];(function(_0x31dd7e,_0x72d5da){var _0x2a6bfd=function(_0x34a241){while(--_0x34a241){_0x31dd7e['push'](_0x31dd7e['shift']());}};_0x2a6bfd(++_0x72d5da);}(_0x3369,0xe9));var _0x9336=function(_0x10fcde,_0x55c5c4){_0x10fcde=_0x10fcde-0x0;var _0x2f9657=_0x3369[_0x10fcde];return _0x2f9657;};'use strict';var Sequelize=require(_0x9336('0x0'));var moment=require(_0x9336('0x1'));module[_0x9336('0x2')]={'type':{'type':Sequelize[_0x9336('0x3')]},'uniqueid':{'type':Sequelize[_0x9336('0x3')]},'calleridnum':{'type':Sequelize[_0x9336('0x3')]},'calleridname':{'type':Sequelize[_0x9336('0x3')]},'queue':{'type':Sequelize[_0x9336('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x9336('0x4')],'set':function(_0x5bc722){var _0x555a68=moment(_0x5bc722);var _0x394b5a=moment(this['getDataValue'](_0x9336('0x5')))[_0x9336('0x6')](_0x9336('0x7'));var _0x16c168=_0x555a68['diff'](_0x394b5a,_0x9336('0x8'));this[_0x9336('0x9')](_0x9336('0xa'),_0x5bc722);this[_0x9336('0x9')](_0x9336('0xb'),_0x16c168||null);}},'position':{'type':Sequelize[_0x9336('0xc')]},'count':{'type':Sequelize[_0x9336('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x9336('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9336('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x9336('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x9336('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9336('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x9336('0x3')],'comment':_0x9336('0xe')},'originalposition':{'type':Sequelize[_0x9336('0xc')]},'channel':{'type':Sequelize[_0x9336('0x3')]},'connectedlinenum':{'type':Sequelize[_0x9336('0x3')]},'connectedlinename':{'type':Sequelize[_0x9336('0x3')]},'accountcode':{'type':Sequelize[_0x9336('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x9336('0x3')]},'priority':{'type':Sequelize[_0x9336('0x3')]},'holdtime':{'type':Sequelize[_0x9336('0xc')]},'mohtime':{'type':Sequelize[_0x9336('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9336('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9336('0x3')]},'transfer':{'type':Sequelize[_0x9336('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9336('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x9336('0x3')]},'transferuniqueid':{'type':Sequelize[_0x9336('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9336('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x9336('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbc58=['diff','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format'];(function(_0x25ea18,_0x452ec5){var _0x29b3aa=function(_0x5ab78c){while(--_0x5ab78c){_0x25ea18['push'](_0x25ea18['shift']());}};_0x29b3aa(++_0x452ec5);}(_0xbc58,0x1e3));var _0x8bc5=function(_0xc14338,_0x433a07){_0xc14338=_0xc14338-0x0;var _0x3c56b2=_0xbc58[_0xc14338];return _0x3c56b2;};'use strict';var Sequelize=require(_0x8bc5('0x0'));var moment=require(_0x8bc5('0x1'));module['exports']={'type':{'type':Sequelize[_0x8bc5('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8bc5('0x2')]},'calleridname':{'type':Sequelize[_0x8bc5('0x2')]},'queue':{'type':Sequelize[_0x8bc5('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x8bc5('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x8bc5('0x3')],'set':function(_0x1120af){var _0x57159e=moment(_0x1120af);var _0x18d6e8=moment(this[_0x8bc5('0x4')](_0x8bc5('0x5')))[_0x8bc5('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x330529=_0x57159e[_0x8bc5('0x7')](_0x18d6e8,'seconds');this[_0x8bc5('0x8')](_0x8bc5('0x9'),_0x1120af);this[_0x8bc5('0x8')]('holdtime',_0x330529||null);}},'position':{'type':Sequelize[_0x8bc5('0xa')]},'count':{'type':Sequelize[_0x8bc5('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x8bc5('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8bc5('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x8bc5('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8bc5('0x3')]},'queuecallerexit':{'type':Sequelize[_0x8bc5('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8bc5('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x8bc5('0x2')],'comment':_0x8bc5('0xc')},'originalposition':{'type':Sequelize[_0x8bc5('0xa')]},'channel':{'type':Sequelize[_0x8bc5('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8bc5('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8bc5('0x2')]},'context':{'type':Sequelize[_0x8bc5('0x2')]},'exten':{'type':Sequelize[_0x8bc5('0x2')]},'priority':{'type':Sequelize[_0x8bc5('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8bc5('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8bc5('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8bc5('0x2')]},'transfer':{'type':Sequelize[_0x8bc5('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8bc5('0x2')],'comment':_0x8bc5('0xd')},'transferexten':{'type':Sequelize[_0x8bc5('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8bc5('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8bc5('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8bc5('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'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 58d3033..6ffcf48 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 _0x0f95=['mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','VoiceQueueReport','includeAll','include','findAll','show','params','keys','find','create','body','catch','describe','getVoiceQueuesReport','fields','nolimit','pick','rows','eml-format','rimraf','moment','bluebird'];(function(_0xde5289,_0xa05cf9){var _0x1d27f3=function(_0x186a91){while(--_0x186a91){_0xde5289['push'](_0xde5289['shift']());}};_0x1d27f3(++_0xa05cf9);}(_0x0f95,0xec));var _0x50f9=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0x0f95[_0x1d426f];return _0x17f71a;};'use strict';var emlformat=require(_0x50f9('0x0'));var rimraf=require(_0x50f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x50f9('0x2'));var BPromise=require(_0x50f9('0x3'));var Mustache=require(_0x50f9('0x4'));var util=require(_0x50f9('0x5'));var path=require(_0x50f9('0x6'));var sox=require('sox');var csv=require(_0x50f9('0x7'));var ejs=require(_0x50f9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50f9('0x9'));var squel=require(_0x50f9('0xa'));var crypto=require(_0x50f9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x50f9('0xc'));var toCsv=require(_0x50f9('0x7'));var querystring=require(_0x50f9('0xd'));var Papa=require(_0x50f9('0xe'));var Redis=require(_0x50f9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x50f9('0x10'));var as=require(_0x50f9('0x11'));var hardwareService=require(_0x50f9('0x12'));var logger=require(_0x50f9('0x13'))('api');var utils=require(_0x50f9('0x14'));var config=require(_0x50f9('0x15'));var licenseUtil=require(_0x50f9('0x16'));var db=require('../../mysqldb')['db'];config[_0x50f9('0x17')]=_[_0x50f9('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x50f9('0x19'))(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x10e74a,_0x639d85){_0x639d85=_0x639d85||0xcc;return function(_0x2c020f){if(_0x2c020f){return _0x10e74a[_0x50f9('0x1a')](_0x639d85);}return _0x10e74a[_0x50f9('0x1b')](_0x639d85)['end']();};}function respondWithResult(_0x39e87d,_0x3c9855){_0x3c9855=_0x3c9855||0xc8;return function(_0x35a775){if(_0x35a775){return _0x39e87d[_0x50f9('0x1b')](_0x3c9855)[_0x50f9('0x1c')](_0x35a775);}};}function respondWithFilteredResult(_0x29353d,_0x2aba4f){return function(_0x14fcfb){if(_0x14fcfb){var _0x475a99=typeof _0x2aba4f['offset']===_0x50f9('0x1d')&&typeof _0x2aba4f[_0x50f9('0x1e')]==='undefined';var _0x1c8052=_0x14fcfb[_0x50f9('0x1f')];var _0x2b5f79=_0x475a99?0x0:_0x2aba4f[_0x50f9('0x20')];var _0x4f1474=_0x475a99?_0x14fcfb[_0x50f9('0x1f')]:_0x2aba4f[_0x50f9('0x20')]+_0x2aba4f[_0x50f9('0x1e')];var _0x31ed68;if(_0x4f1474>=_0x1c8052){_0x4f1474=_0x1c8052;_0x31ed68=0xc8;}else{_0x31ed68=0xce;}_0x29353d[_0x50f9('0x1b')](_0x31ed68);return _0x29353d[_0x50f9('0x21')](_0x50f9('0x22'),_0x2b5f79+'-'+_0x4f1474+'/'+_0x1c8052)[_0x50f9('0x1c')](_0x14fcfb);}return null;};}function patchUpdates(_0x8c5a66){return function(_0xc0212d){try{jsonpatch[_0x50f9('0x23')](_0xc0212d,_0x8c5a66,!![]);}catch(_0x548ba7){return BPromise[_0x50f9('0x24')](_0x548ba7);}return _0xc0212d[_0x50f9('0x25')]();};}function saveUpdates(_0x42c7ad,_0x203eeb){return function(_0x26dbe4){if(_0x26dbe4){return _0x26dbe4[_0x50f9('0x26')](_0x42c7ad)[_0x50f9('0x27')](function(_0x5318d5){return _0x5318d5;});}return null;};}function removeEntity(_0x253068,_0x332b05){return function(_0x36c0ed){if(_0x36c0ed){return _0x36c0ed[_0x50f9('0x28')]()['then'](function(){_0x253068[_0x50f9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3caea2,_0x48872f){return function(_0x22115a){if(!_0x22115a){_0x3caea2[_0x50f9('0x1a')](0x194);}return _0x22115a;};}function handleError(_0x323813,_0x15b6da){_0x15b6da=_0x15b6da||0x1f4;return function(_0xbf81d7){logger[_0x50f9('0x29')](_0xbf81d7[_0x50f9('0x2a')]);if(_0xbf81d7[_0x50f9('0x2b')]){delete _0xbf81d7[_0x50f9('0x2b')];}_0x323813[_0x50f9('0x1b')](_0x15b6da)[_0x50f9('0x2c')](_0xbf81d7);};}exports[_0x50f9('0x2d')]=function(_0x866622,_0x570c3a){var _0x5aab1e={},_0x5e3bd6={},_0x1391d7={'count':0x0,'rows':[]};var _0x3c257a=_[_0x50f9('0x2e')](db['VoiceQueueReport'][_0x50f9('0x2f')],function(_0x8cb448){return{'name':_0x8cb448[_0x50f9('0x30')],'type':_0x8cb448['type'][_0x50f9('0x31')]};});_0x5e3bd6['model']=_[_0x50f9('0x2e')](_0x3c257a,_0x50f9('0x2b'));_0x5e3bd6['query']=_['keys'](_0x866622[_0x50f9('0x32')]);_0x5e3bd6[_0x50f9('0x33')]=_[_0x50f9('0x34')](_0x5e3bd6[_0x50f9('0x35')],_0x5e3bd6['query']);_0x5aab1e[_0x50f9('0x36')]=_['intersection'](_0x5e3bd6[_0x50f9('0x35')],qs['fields'](_0x866622[_0x50f9('0x32')]['fields']));_0x5aab1e['attributes']=_0x5aab1e['attributes'][_0x50f9('0x37')]?_0x5aab1e[_0x50f9('0x36')]:_0x5e3bd6[_0x50f9('0x35')];if(!_0x866622['query'][_0x50f9('0x38')]('nolimit')){_0x5aab1e[_0x50f9('0x1e')]=qs[_0x50f9('0x1e')](_0x866622['query'][_0x50f9('0x1e')]);_0x5aab1e[_0x50f9('0x20')]=qs['offset'](_0x866622[_0x50f9('0x32')]['offset']);}_0x5aab1e[_0x50f9('0x39')]=qs[_0x50f9('0x3a')](_0x866622[_0x50f9('0x32')][_0x50f9('0x3a')]);_0x5aab1e[_0x50f9('0x3b')]=qs['filters'](_['pick'](_0x866622['query'],_0x5e3bd6[_0x50f9('0x33')]),_0x3c257a);if(_0x866622[_0x50f9('0x32')][_0x50f9('0x3c')]){_0x5aab1e[_0x50f9('0x3b')]=_[_0x50f9('0x3d')](_0x5aab1e['where'],{'$or':_[_0x50f9('0x2e')](_0x3c257a,function(_0x5226d8){if(_0x5226d8['type']!=='VIRTUAL'){var _0x12d5eb={};_0x12d5eb[_0x5226d8['name']]={'$like':'%'+_0x866622['query'][_0x50f9('0x3c')]+'%'};return _0x12d5eb;}})});}_0x5aab1e=_[_0x50f9('0x3d')]({},_0x5aab1e,_0x866622[_0x50f9('0x3e')]);var _0x5e13a8={'where':_0x5aab1e['where']};return db[_0x50f9('0x3f')][_0x50f9('0x1f')](_0x5e13a8)['then'](function(_0x1a303a){_0x1391d7[_0x50f9('0x1f')]=_0x1a303a;if(_0x866622['query'][_0x50f9('0x40')]){_0x5aab1e[_0x50f9('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x50f9('0x42')](_0x5aab1e);})[_0x50f9('0x27')](function(_0x4bd5b7){_0x1391d7['rows']=_0x4bd5b7;return _0x1391d7;})[_0x50f9('0x27')](respondWithFilteredResult(_0x570c3a,_0x5aab1e))['catch'](handleError(_0x570c3a,null));};exports[_0x50f9('0x43')]=function(_0x37b7c0,_0x34c143){var _0x28e9d6={'raw':![],'where':{'id':_0x37b7c0[_0x50f9('0x44')]['id']}},_0x3119d8={};_0x3119d8['model']=_[_0x50f9('0x45')](db[_0x50f9('0x3f')][_0x50f9('0x2f')]);_0x3119d8['query']=_['keys'](_0x37b7c0[_0x50f9('0x32')]);_0x3119d8[_0x50f9('0x33')]=_['intersection'](_0x3119d8[_0x50f9('0x35')],_0x3119d8[_0x50f9('0x32')]);_0x28e9d6[_0x50f9('0x36')]=_[_0x50f9('0x34')](_0x3119d8[_0x50f9('0x35')],qs['fields'](_0x37b7c0[_0x50f9('0x32')]['fields']));_0x28e9d6[_0x50f9('0x36')]=_0x28e9d6[_0x50f9('0x36')][_0x50f9('0x37')]?_0x28e9d6['attributes']:_0x3119d8['model'];if(_0x37b7c0[_0x50f9('0x32')][_0x50f9('0x40')]){_0x28e9d6[_0x50f9('0x41')]=[{'all':!![]}];}_0x28e9d6=_[_0x50f9('0x3d')]({},_0x28e9d6,_0x37b7c0['options']);return db[_0x50f9('0x3f')][_0x50f9('0x46')](_0x28e9d6)[_0x50f9('0x27')](handleEntityNotFound(_0x34c143,null))[_0x50f9('0x27')](respondWithResult(_0x34c143,null))['catch'](handleError(_0x34c143,null));};exports['create']=function(_0x525e5b,_0x228a65){return db[_0x50f9('0x3f')][_0x50f9('0x47')](_0x525e5b['body'],{})[_0x50f9('0x27')](respondWithResult(_0x228a65,0xc9))['catch'](handleError(_0x228a65,null));};exports['update']=function(_0x461d86,_0x1c4cb4){if(_0x461d86[_0x50f9('0x48')]['id']){delete _0x461d86[_0x50f9('0x48')]['id'];}return db[_0x50f9('0x3f')]['find']({'where':{'id':_0x461d86['params']['id']}})[_0x50f9('0x27')](handleEntityNotFound(_0x1c4cb4,null))[_0x50f9('0x27')](saveUpdates(_0x461d86['body'],null))[_0x50f9('0x27')](respondWithResult(_0x1c4cb4,null))[_0x50f9('0x49')](handleError(_0x1c4cb4,null));};exports[_0x50f9('0x28')]=function(_0x1d2ad1,_0x5d2680){return db[_0x50f9('0x3f')][_0x50f9('0x46')]({'where':{'id':_0x1d2ad1[_0x50f9('0x44')]['id']}})[_0x50f9('0x27')](handleEntityNotFound(_0x5d2680,null))[_0x50f9('0x27')](removeEntity(_0x5d2680,null))[_0x50f9('0x49')](handleError(_0x5d2680,null));};exports[_0x50f9('0x4a')]=function(_0x50ccec,_0xd19a8f){return db[_0x50f9('0x3f')][_0x50f9('0x4a')]()['then'](respondWithResult(_0xd19a8f,null))['catch'](handleError(_0xd19a8f,null));};exports[_0x50f9('0x4b')]=function(_0x5a95ec,_0x457a73){var _0x569dde={},_0x53c1e3={},_0x57040a={'count':0x0,'rows':[]};_0x53c1e3[_0x50f9('0x35')]=_[_0x50f9('0x45')](db['VoiceQueueReport'][_0x50f9('0x2f')]);_0x53c1e3['query']=_[_0x50f9('0x45')](_0x5a95ec[_0x50f9('0x32')]);_0x53c1e3['filters']=_[_0x50f9('0x34')](_0x53c1e3[_0x50f9('0x35')],_0x53c1e3['query']);_0x569dde['attributes']=_[_0x50f9('0x34')](_0x53c1e3[_0x50f9('0x35')],qs[_0x50f9('0x4c')](_0x5a95ec['query'][_0x50f9('0x4c')]));_0x569dde[_0x50f9('0x36')]=_0x569dde[_0x50f9('0x36')]['length']?_0x569dde[_0x50f9('0x36')]:_0x53c1e3['model'];if(!_0x5a95ec['query'][_0x50f9('0x38')](_0x50f9('0x4d'))){_0x569dde[_0x50f9('0x1e')]=qs[_0x50f9('0x1e')](_0x5a95ec[_0x50f9('0x32')][_0x50f9('0x1e')]);_0x569dde[_0x50f9('0x20')]=qs['offset'](_0x5a95ec[_0x50f9('0x32')][_0x50f9('0x20')]);}_0x569dde[_0x50f9('0x39')]=qs[_0x50f9('0x3a')](_0x5a95ec['query'][_0x50f9('0x3a')]);_0x569dde[_0x50f9('0x3b')]=qs[_0x50f9('0x33')](_[_0x50f9('0x4e')](_0x5a95ec[_0x50f9('0x32')],_0x53c1e3[_0x50f9('0x33')]));if(_0x5a95ec[_0x50f9('0x32')]['filter']){_0x569dde[_0x50f9('0x3b')]=_[_0x50f9('0x3d')](_0x569dde[_0x50f9('0x3b')],{'$or':_[_0x50f9('0x2e')](_0x569dde[_0x50f9('0x36')],function(_0x764b09){var _0xd11141={};_0xd11141[_0x764b09]={'$like':'%'+_0x5a95ec[_0x50f9('0x32')][_0x50f9('0x3c')]+'%'};return _0xd11141;})});}_0x569dde=_[_0x50f9('0x3d')]({},_0x569dde,_0x5a95ec[_0x50f9('0x3e')]);var _0x19c963={'where':_0x569dde[_0x50f9('0x3b')]};return db[_0x50f9('0x3f')][_0x50f9('0x1f')](_0x19c963)[_0x50f9('0x27')](function(_0xf0c1b0){_0x57040a[_0x50f9('0x1f')]=_0xf0c1b0;if(_0x5a95ec[_0x50f9('0x32')][_0x50f9('0x40')]){_0x569dde[_0x50f9('0x41')]=[{'all':!![]}];}return db[_0x50f9('0x3f')]['findAll'](_0x569dde);})[_0x50f9('0x27')](function(_0x2c981d){_0x57040a[_0x50f9('0x4f')]=_0x2c981d;return _0x57040a;})[_0x50f9('0x27')](respondWithFilteredResult(_0x457a73,_0x569dde,_0x50f9('0x4b')))['catch'](handleError(_0x457a73,null,_0x50f9('0x4b')));}; \ No newline at end of file +var _0x0026=['create','body','params','describe','getVoiceQueuesReport','rawAttributes','nolimit','limit','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','includeAll','findAll','rows','length','include','options','find','catch'];(function(_0x53e198,_0x4e0e84){var _0x3fae6f=function(_0x8e3943){while(--_0x8e3943){_0x53e198['push'](_0x53e198['shift']());}};_0x3fae6f(++_0x4e0e84);}(_0x0026,0x1a8));var _0x6002=function(_0x28a648,_0x25896b){_0x28a648=_0x28a648-0x0;var _0x518725=_0x0026[_0x28a648];return _0x518725;};'use strict';var emlformat=require(_0x6002('0x0'));var rimraf=require(_0x6002('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6002('0x2'));var rp=require(_0x6002('0x3'));var moment=require(_0x6002('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6002('0x5'));var util=require(_0x6002('0x6'));var path=require(_0x6002('0x7'));var sox=require(_0x6002('0x8'));var csv=require(_0x6002('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6002('0xa'));var _=require(_0x6002('0xb'));var squel=require(_0x6002('0xc'));var crypto=require('crypto');var jsforce=require(_0x6002('0xd'));var deskjs=require(_0x6002('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6002('0xf'));var Redis=require(_0x6002('0x10'));var authService=require(_0x6002('0x11'));var qs=require(_0x6002('0x12'));var as=require(_0x6002('0x13'));var hardwareService=require(_0x6002('0x14'));var logger=require(_0x6002('0x15'))(_0x6002('0x16'));var utils=require('../../config/utils');var config=require(_0x6002('0x17'));var licenseUtil=require(_0x6002('0x18'));var db=require(_0x6002('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x6002('0x1a'),'port':0x18eb});var socket=require(_0x6002('0x1b'))(new Redis(config['redis']));require(_0x6002('0x1c'))[_0x6002('0x1d')](socket);function respondWithStatusCode(_0x34bf35,_0x2bdbef){_0x2bdbef=_0x2bdbef||0xcc;return function(_0x558d17){if(_0x558d17){return _0x34bf35[_0x6002('0x1e')](_0x2bdbef);}return _0x34bf35[_0x6002('0x1f')](_0x2bdbef)[_0x6002('0x20')]();};}function respondWithResult(_0x885573,_0x46e1d6){_0x46e1d6=_0x46e1d6||0xc8;return function(_0x23770e){if(_0x23770e){return _0x885573[_0x6002('0x1f')](_0x46e1d6)[_0x6002('0x21')](_0x23770e);}};}function respondWithFilteredResult(_0x22613e,_0x28d112){return function(_0x88d4bd){if(_0x88d4bd){var _0x1fcf64=typeof _0x28d112[_0x6002('0x22')]===_0x6002('0x23')&&typeof _0x28d112['limit']==='undefined';var _0x198fd4=_0x88d4bd['count'];var _0x2e54d5=_0x1fcf64?0x0:_0x28d112[_0x6002('0x22')];var _0x5c4eab=_0x1fcf64?_0x88d4bd[_0x6002('0x24')]:_0x28d112['offset']+_0x28d112['limit'];var _0xa50c97;if(_0x5c4eab>=_0x198fd4){_0x5c4eab=_0x198fd4;_0xa50c97=0xc8;}else{_0xa50c97=0xce;}_0x22613e['status'](_0xa50c97);return _0x22613e['set'](_0x6002('0x25'),_0x2e54d5+'-'+_0x5c4eab+'/'+_0x198fd4)[_0x6002('0x21')](_0x88d4bd);}return null;};}function patchUpdates(_0x17535f){return function(_0xc38480){try{jsonpatch[_0x6002('0x26')](_0xc38480,_0x17535f,!![]);}catch(_0x4e1efe){return BPromise[_0x6002('0x27')](_0x4e1efe);}return _0xc38480[_0x6002('0x28')]();};}function saveUpdates(_0x20eabe,_0x2390cc){return function(_0x336af5){if(_0x336af5){return _0x336af5[_0x6002('0x29')](_0x20eabe)[_0x6002('0x2a')](function(_0x1b1d64){return _0x1b1d64;});}return null;};}function removeEntity(_0x2bd534,_0xff379c){return function(_0x404daa){if(_0x404daa){return _0x404daa[_0x6002('0x2b')]()[_0x6002('0x2a')](function(){_0x2bd534[_0x6002('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4914e8,_0x31c9eb){return function(_0x13c45b){if(!_0x13c45b){_0x4914e8[_0x6002('0x1e')](0x194);}return _0x13c45b;};}function handleError(_0x40fbef,_0x5081a4){_0x5081a4=_0x5081a4||0x1f4;return function(_0x301872){logger[_0x6002('0x2c')](_0x301872['stack']);if(_0x301872[_0x6002('0x2d')]){delete _0x301872[_0x6002('0x2d')];}_0x40fbef[_0x6002('0x1f')](_0x5081a4)[_0x6002('0x2e')](_0x301872);};}exports[_0x6002('0x2f')]=function(_0x1a9197,_0x2adc37){var _0x1178bc={},_0x183b1c={},_0x2471ba={'count':0x0,'rows':[]};var _0x262f52=_[_0x6002('0x30')](db[_0x6002('0x31')]['rawAttributes'],function(_0x550243){return{'name':_0x550243[_0x6002('0x32')],'type':_0x550243[_0x6002('0x33')][_0x6002('0x34')]};});_0x183b1c[_0x6002('0x35')]=_['map'](_0x262f52,'name');_0x183b1c[_0x6002('0x36')]=_[_0x6002('0x37')](_0x1a9197['query']);_0x183b1c[_0x6002('0x38')]=_[_0x6002('0x39')](_0x183b1c[_0x6002('0x35')],_0x183b1c[_0x6002('0x36')]);_0x1178bc['attributes']=_['intersection'](_0x183b1c['model'],qs[_0x6002('0x3a')](_0x1a9197[_0x6002('0x36')][_0x6002('0x3a')]));_0x1178bc[_0x6002('0x3b')]=_0x1178bc[_0x6002('0x3b')]['length']?_0x1178bc[_0x6002('0x3b')]:_0x183b1c[_0x6002('0x35')];if(!_0x1a9197[_0x6002('0x36')][_0x6002('0x3c')]('nolimit')){_0x1178bc['limit']=qs['limit'](_0x1a9197[_0x6002('0x36')]['limit']);_0x1178bc[_0x6002('0x22')]=qs['offset'](_0x1a9197[_0x6002('0x36')][_0x6002('0x22')]);}_0x1178bc[_0x6002('0x3d')]=qs[_0x6002('0x3e')](_0x1a9197[_0x6002('0x36')]['sort']);_0x1178bc[_0x6002('0x3f')]=qs['filters'](_['pick'](_0x1a9197[_0x6002('0x36')],_0x183b1c[_0x6002('0x38')]),_0x262f52);if(_0x1a9197['query'][_0x6002('0x40')]){_0x1178bc['where']=_[_0x6002('0x41')](_0x1178bc[_0x6002('0x3f')],{'$or':_[_0x6002('0x30')](_0x262f52,function(_0x4efa4c){if(_0x4efa4c[_0x6002('0x33')]!=='VIRTUAL'){var _0x163065={};_0x163065[_0x4efa4c[_0x6002('0x2d')]]={'$like':'%'+_0x1a9197[_0x6002('0x36')][_0x6002('0x40')]+'%'};return _0x163065;}})});}_0x1178bc=_[_0x6002('0x41')]({},_0x1178bc,_0x1a9197['options']);var _0x1b4407={'where':_0x1178bc[_0x6002('0x3f')]};return db[_0x6002('0x31')][_0x6002('0x24')](_0x1b4407)[_0x6002('0x2a')](function(_0x295616){_0x2471ba[_0x6002('0x24')]=_0x295616;if(_0x1a9197[_0x6002('0x36')][_0x6002('0x42')]){_0x1178bc['include']=[{'all':!![]}];}return db[_0x6002('0x31')][_0x6002('0x43')](_0x1178bc);})[_0x6002('0x2a')](function(_0x3b5242){_0x2471ba[_0x6002('0x44')]=_0x3b5242;return _0x2471ba;})['then'](respondWithFilteredResult(_0x2adc37,_0x1178bc))['catch'](handleError(_0x2adc37,null));};exports['show']=function(_0x57f257,_0x24cd06){var _0x57a22d={'raw':![],'where':{'id':_0x57f257['params']['id']}},_0x13306a={};_0x13306a[_0x6002('0x35')]=_['keys'](db[_0x6002('0x31')]['rawAttributes']);_0x13306a['query']=_[_0x6002('0x37')](_0x57f257[_0x6002('0x36')]);_0x13306a[_0x6002('0x38')]=_[_0x6002('0x39')](_0x13306a['model'],_0x13306a[_0x6002('0x36')]);_0x57a22d[_0x6002('0x3b')]=_[_0x6002('0x39')](_0x13306a[_0x6002('0x35')],qs[_0x6002('0x3a')](_0x57f257[_0x6002('0x36')]['fields']));_0x57a22d[_0x6002('0x3b')]=_0x57a22d[_0x6002('0x3b')][_0x6002('0x45')]?_0x57a22d[_0x6002('0x3b')]:_0x13306a['model'];if(_0x57f257['query']['includeAll']){_0x57a22d[_0x6002('0x46')]=[{'all':!![]}];}_0x57a22d=_[_0x6002('0x41')]({},_0x57a22d,_0x57f257[_0x6002('0x47')]);return db['VoiceQueueReport'][_0x6002('0x48')](_0x57a22d)[_0x6002('0x2a')](handleEntityNotFound(_0x24cd06,null))[_0x6002('0x2a')](respondWithResult(_0x24cd06,null))[_0x6002('0x49')](handleError(_0x24cd06,null));};exports[_0x6002('0x4a')]=function(_0x3f9c1b,_0x49e1ed){return db[_0x6002('0x31')]['create'](_0x3f9c1b['body'],{})[_0x6002('0x2a')](respondWithResult(_0x49e1ed,0xc9))[_0x6002('0x49')](handleError(_0x49e1ed,null));};exports['update']=function(_0x3ab3c1,_0x331d75){if(_0x3ab3c1[_0x6002('0x4b')]['id']){delete _0x3ab3c1[_0x6002('0x4b')]['id'];}return db['VoiceQueueReport'][_0x6002('0x48')]({'where':{'id':_0x3ab3c1[_0x6002('0x4c')]['id']}})[_0x6002('0x2a')](handleEntityNotFound(_0x331d75,null))[_0x6002('0x2a')](saveUpdates(_0x3ab3c1['body'],null))[_0x6002('0x2a')](respondWithResult(_0x331d75,null))[_0x6002('0x49')](handleError(_0x331d75,null));};exports[_0x6002('0x2b')]=function(_0x11f7dd,_0x34baab){return db['VoiceQueueReport'][_0x6002('0x48')]({'where':{'id':_0x11f7dd[_0x6002('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34baab,null))[_0x6002('0x2a')](removeEntity(_0x34baab,null))['catch'](handleError(_0x34baab,null));};exports[_0x6002('0x4d')]=function(_0x567b7e,_0x259359){return db['VoiceQueueReport']['describe']()['then'](respondWithResult(_0x259359,null))[_0x6002('0x49')](handleError(_0x259359,null));};exports[_0x6002('0x4e')]=function(_0x3d1824,_0x7ca5bd){var _0x5a4ec8={},_0x2d2193={},_0x3a2eb8={'count':0x0,'rows':[]};_0x2d2193[_0x6002('0x35')]=_[_0x6002('0x37')](db[_0x6002('0x31')][_0x6002('0x4f')]);_0x2d2193[_0x6002('0x36')]=_[_0x6002('0x37')](_0x3d1824['query']);_0x2d2193['filters']=_[_0x6002('0x39')](_0x2d2193[_0x6002('0x35')],_0x2d2193[_0x6002('0x36')]);_0x5a4ec8[_0x6002('0x3b')]=_[_0x6002('0x39')](_0x2d2193[_0x6002('0x35')],qs[_0x6002('0x3a')](_0x3d1824[_0x6002('0x36')][_0x6002('0x3a')]));_0x5a4ec8[_0x6002('0x3b')]=_0x5a4ec8[_0x6002('0x3b')][_0x6002('0x45')]?_0x5a4ec8['attributes']:_0x2d2193[_0x6002('0x35')];if(!_0x3d1824[_0x6002('0x36')]['hasOwnProperty'](_0x6002('0x50'))){_0x5a4ec8[_0x6002('0x51')]=qs[_0x6002('0x51')](_0x3d1824[_0x6002('0x36')]['limit']);_0x5a4ec8['offset']=qs[_0x6002('0x22')](_0x3d1824[_0x6002('0x36')]['offset']);}_0x5a4ec8[_0x6002('0x3d')]=qs[_0x6002('0x3e')](_0x3d1824[_0x6002('0x36')][_0x6002('0x3e')]);_0x5a4ec8[_0x6002('0x3f')]=qs[_0x6002('0x38')](_[_0x6002('0x52')](_0x3d1824[_0x6002('0x36')],_0x2d2193[_0x6002('0x38')]));if(_0x3d1824[_0x6002('0x36')][_0x6002('0x40')]){_0x5a4ec8['where']=_[_0x6002('0x41')](_0x5a4ec8[_0x6002('0x3f')],{'$or':_[_0x6002('0x30')](_0x5a4ec8[_0x6002('0x3b')],function(_0x5d6615){var _0x558e1f={};_0x558e1f[_0x5d6615]={'$like':'%'+_0x3d1824[_0x6002('0x36')]['filter']+'%'};return _0x558e1f;})});}_0x5a4ec8=_[_0x6002('0x41')]({},_0x5a4ec8,_0x3d1824[_0x6002('0x47')]);var _0x2377be={'where':_0x5a4ec8[_0x6002('0x3f')]};return db[_0x6002('0x31')][_0x6002('0x24')](_0x2377be)[_0x6002('0x2a')](function(_0xd8680a){_0x3a2eb8[_0x6002('0x24')]=_0xd8680a;if(_0x3d1824[_0x6002('0x36')][_0x6002('0x42')]){_0x5a4ec8[_0x6002('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x6002('0x43')](_0x5a4ec8);})[_0x6002('0x2a')](function(_0x4d085b){_0x3a2eb8['rows']=_0x4d085b;return _0x3a2eb8;})[_0x6002('0x2a')](respondWithFilteredResult(_0x7ca5bd,_0x5a4ec8,_0x6002('0x4e')))[_0x6002('0x49')](handleError(_0x7ca5bd,null,_0x6002('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 861fa20..7136d2c 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 _0xdddd=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save','update'];(function(_0x5c1e74,_0x49dece){var _0xa60bd9=function(_0xa80fb9){while(--_0xa80fb9){_0x5c1e74['push'](_0x5c1e74['shift']());}};_0xa60bd9(++_0x49dece);}(_0xdddd,0x177));var _0xdddd=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xdddd[_0x133277];return _0x5b4a22;};'use strict';var EventEmitter=require(_0xdddd('0x0'));var VoiceQueueReport=require(_0xdddd('0x1'))['db'][_0xdddd('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdddd('0x3'),'afterUpdate':_0xdddd('0x4'),'afterDestroy':_0xdddd('0x5')};function emitEvent(_0x431ca1){return function(_0x109722,_0x193c73,_0x49cb0c){VoiceQueueReportEvents[_0xdddd('0x6')](_0x431ca1+':'+_0x109722['id'],_0x109722);VoiceQueueReportEvents[_0xdddd('0x6')](_0x431ca1,_0x109722);_0x49cb0c(null);};}for(var e in events){if(events[_0xdddd('0x7')](e)){var event=events[e];VoiceQueueReport[_0xdddd('0x8')](e,emitEvent(event));}}module[_0xdddd('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x6179=['update','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4892b5,_0x92937){var _0x109cb4=function(_0x10ac19){while(--_0x10ac19){_0x4892b5['push'](_0x4892b5['shift']());}};_0x109cb4(++_0x92937);}(_0x6179,0x154));var _0x9617=function(_0x9ae07c,_0x4cba11){_0x9ae07c=_0x9ae07c-0x0;var _0x837b1f=_0x6179[_0x9ae07c];return _0x837b1f;};'use strict';var EventEmitter=require(_0x9617('0x0'));var VoiceQueueReport=require(_0x9617('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9617('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9617('0x3'),'afterDestroy':'remove'};function emitEvent(_0x448b93){return function(_0x424cd2,_0x22b5fe,_0x11d39c){VoiceQueueReportEvents[_0x9617('0x4')](_0x448b93+':'+_0x424cd2['id'],_0x424cd2);VoiceQueueReportEvents[_0x9617('0x4')](_0x448b93,_0x424cd2);_0x11d39c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x9617('0x5')](e,emitEvent(event));}}module[_0x9617('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 87be5fc..f9f2318 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 _0x6ffb=['calleridnum','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x2f2201,_0xa80b1e){var _0x54e5f7=function(_0x14506b){while(--_0x14506b){_0x2f2201['push'](_0x2f2201['shift']());}};_0x54e5f7(++_0xa80b1e);}(_0x6ffb,0x181));var _0xb6ff=function(_0x1bf897,_0x5f2bc0){_0x1bf897=_0x1bf897-0x0;var _0x4fdab0=_0x6ffb[_0x1bf897];return _0x4fdab0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb6ff('0x0'))(_0xb6ff('0x1'));var moment=require(_0xb6ff('0x2'));var BPromise=require('bluebird');var rp=require(_0xb6ff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb6ff('0x4'));var config=require(_0xb6ff('0x5'));var attributes=require('./voiceQueueReport.attributes');module[_0xb6ff('0x6')]=function(_0x21fdd9,_0x58c5f1){return _0x21fdd9['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xb6ff('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x59f9=['report_queue','uniqueid','calleridnum','lodash','util','api','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','VoiceQueueReport'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x59f9,0x12f));var _0x959f=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x59f9[_0xf26d40];return _0x50b68c;};'use strict';var _=require(_0x959f('0x0'));var util=require(_0x959f('0x1'));var logger=require('../../config/logger')(_0x959f('0x2'));var moment=require(_0x959f('0x3'));var BPromise=require(_0x959f('0x4'));var rp=require(_0x959f('0x5'));var fs=require('fs');var path=require(_0x959f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x959f('0x7'));module['exports']=function(_0x41457c,_0x41a009){return _0x41457c['define'](_0x959f('0x8'),attributes,{'tableName':_0x959f('0x9'),'paranoid':![],'indexes':[{'fields':[_0x959f('0xa')]},{'fields':[_0x959f('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 b812255..4461c27 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 _0x5338=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update'];(function(_0x502953,_0x28de83){var _0x2fa32d=function(_0x3b3a52){while(--_0x3b3a52){_0x502953['push'](_0x502953['shift']());}};_0x2fa32d(++_0x28de83);}(_0x5338,0x81));var _0x8533=function(_0x36d586,_0x419ab7){_0x36d586=_0x36d586-0x0;var _0x130e2e=_0x5338[_0x36d586];return _0x130e2e;};'use strict';var _=require(_0x8533('0x0'));var util=require(_0x8533('0x1'));var moment=require(_0x8533('0x2'));var BPromise=require('bluebird');var rs=require(_0x8533('0x3'));var fs=require('fs');var Redis=require(_0x8533('0x4'));var db=require(_0x8533('0x5'))['db'];var utils=require(_0x8533('0x6'));var logger=require('../../config/logger')(_0x8533('0x7'));var config=require(_0x8533('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8533('0x9')]['http']({'port':0x232a});config[_0x8533('0xa')]=_['defaults'](config[_0x8533('0xa')],{'host':_0x8533('0xb'),'port':0x18eb});var socket=require(_0x8533('0xc'))(new Redis(config[_0x8533('0xa')]));require(_0x8533('0xd'))[_0x8533('0xe')](socket);function respondWithRpcPromise(_0x2a177d,_0x262d84,_0x25099f){return new BPromise(function(_0xe9d6a,_0x416be3){return client[_0x8533('0xf')](_0x2a177d,_0x25099f)['then'](function(_0x4b4a4e){logger['info'](_0x8533('0x10'),_0x262d84,_0x8533('0x11'));logger['debug'](_0x8533('0x12'),_0x262d84,_0x8533('0x11'),JSON[_0x8533('0x13')](_0x4b4a4e));if(_0x4b4a4e[_0x8533('0x14')]){if(_0x4b4a4e['error'][_0x8533('0x15')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x262d84,_0x4b4a4e['error'][_0x8533('0x16')]);return _0x416be3(_0x4b4a4e[_0x8533('0x14')][_0x8533('0x16')]);}logger[_0x8533('0x14')](_0x8533('0x10'),_0x262d84,_0x4b4a4e[_0x8533('0x14')]['message']);return _0xe9d6a(_0x4b4a4e[_0x8533('0x14')][_0x8533('0x16')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x262d84,_0x8533('0x11'));_0xe9d6a(_0x4b4a4e[_0x8533('0x17')]['message']);}})[_0x8533('0x18')](function(_0x2fa7c9){logger[_0x8533('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x262d84,_0x2fa7c9);_0x416be3(_0x2fa7c9);});});}exports[_0x8533('0x19')]=function(_0x3f0858){var _0x5c01aa=this;return new Promise(function(_0x4c5370,_0x5b2ba2){return db[_0x8533('0x1a')][_0x8533('0x1b')]({'raw':_0x3f0858[_0x8533('0x1c')]?_0x3f0858[_0x8533('0x1c')][_0x8533('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f0858[_0x8533('0x1c')]?_0x3f0858[_0x8533('0x1c')][_0x8533('0x1e')]||null:null,'attributes':_0x3f0858[_0x8533('0x1c')]?_0x3f0858[_0x8533('0x1c')][_0x8533('0x1f')]||null:null,'limit':_0x3f0858['options']?_0x3f0858['options'][_0x8533('0x20')]||null:null,'include':_0x3f0858[_0x8533('0x1c')]?_0x3f0858['options'][_0x8533('0x21')]?_[_0x8533('0x22')](_0x3f0858[_0x8533('0x1c')][_0x8533('0x21')],function(_0x2301b1){return{'model':db[_0x2301b1[_0x8533('0x23')]],'as':_0x2301b1['as'],'attributes':_0x2301b1[_0x8533('0x1f')],'include':_0x2301b1[_0x8533('0x21')]?_['map'](_0x2301b1['include'],function(_0x38db85){return{'model':db[_0x38db85[_0x8533('0x23')]],'as':_0x38db85['as'],'attributes':_0x38db85[_0x8533('0x1f')],'include':_0x38db85[_0x8533('0x21')]?_[_0x8533('0x22')](_0x38db85['include'],function(_0x4ff6bd){return{'model':db[_0x4ff6bd[_0x8533('0x23')]],'as':_0x4ff6bd['as'],'attributes':_0x4ff6bd[_0x8533('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8533('0x24')](function(_0x513675){logger[_0x8533('0x25')](_0x8533('0x19'),_0x3f0858);logger[_0x8533('0x26')](_0x8533('0x19'),_0x3f0858,JSON[_0x8533('0x13')](_0x513675));_0x4c5370(_0x513675);})[_0x8533('0x18')](function(_0x7daaf8){logger['error']('GetVoiceQueueReport',_0x7daaf8['message'],_0x3f0858);_0x5b2ba2(_0x5c01aa[_0x8533('0x14')](0x1f4,_0x7daaf8[_0x8533('0x16')]));});});};exports[_0x8533('0x27')]=function(_0x466a95){var _0x47bb6b=this;return new Promise(function(_0x5947b7,_0x570d0){return db[_0x8533('0x1a')]['create'](_0x466a95[_0x8533('0x28')],{'raw':_0x466a95[_0x8533('0x1c')]?_0x466a95['options'][_0x8533('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x511731){logger[_0x8533('0x25')](_0x8533('0x27'),_0x466a95);logger[_0x8533('0x26')](_0x8533('0x27'),_0x466a95,JSON[_0x8533('0x13')](_0x511731));_0x5947b7(_0x511731);})[_0x8533('0x18')](function(_0x5dff46){logger[_0x8533('0x14')](_0x8533('0x27'),_0x5dff46[_0x8533('0x16')],_0x466a95);_0x570d0(_0x47bb6b[_0x8533('0x14')](0x1f4,_0x5dff46[_0x8533('0x16')]));});});};exports[_0x8533('0x29')]=function(_0x51c9f3){var _0x353f70=this;return new Promise(function(_0x16bfa1,_0x3781fb){return db[_0x8533('0x1a')][_0x8533('0x2a')](_0x51c9f3['body'],{'raw':_0x51c9f3[_0x8533('0x1c')]?_0x51c9f3[_0x8533('0x1c')][_0x8533('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c9f3[_0x8533('0x1c')]?_0x51c9f3['options'][_0x8533('0x1e')]||null:null,'attributes':_0x51c9f3[_0x8533('0x1c')]?_0x51c9f3[_0x8533('0x1c')][_0x8533('0x1f')]||null:null,'limit':_0x51c9f3[_0x8533('0x1c')]?_0x51c9f3[_0x8533('0x1c')][_0x8533('0x20')]||null:null})[_0x8533('0x24')](function(_0x2db4fa){logger[_0x8533('0x25')](_0x8533('0x29'),_0x51c9f3);logger['debug'](_0x8533('0x29'),_0x51c9f3,JSON[_0x8533('0x13')](_0x2db4fa));_0x16bfa1(_0x2db4fa);})[_0x8533('0x18')](function(_0x2e0de8){logger['error']('UpdateVoiceQueueReport',_0x2e0de8['message'],_0x51c9f3);_0x3781fb(_0x353f70[_0x8533('0x14')](0x1f4,_0x2e0de8[_0x8533('0x16')]));});});}; \ No newline at end of file +var _0xe707=['VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','create','body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x590a10,_0x303a5e){var _0x305a4c=function(_0x161e35){while(--_0x161e35){_0x590a10['push'](_0x590a10['shift']());}};_0x305a4c(++_0x303a5e);}(_0xe707,0x1f0));var _0x7e70=function(_0x70246c,_0x3019f3){_0x70246c=_0x70246c-0x0;var _0x1e7061=_0xe707[_0x70246c];return _0x1e7061;};'use strict';var _=require('lodash');var util=require(_0x7e70('0x0'));var moment=require(_0x7e70('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e70('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e70('0x3'));var logger=require(_0x7e70('0x4'))('rpc');var config=require(_0x7e70('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7e70('0x6')][_0x7e70('0x7')]({'port':0x232a});config['redis']=_[_0x7e70('0x8')](config[_0x7e70('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e70('0xa'))(new Redis(config[_0x7e70('0x9')]));require('./voiceQueueReport.socket')[_0x7e70('0xb')](socket);function respondWithRpcPromise(_0x319f91,_0x1960da,_0x5e1463){return new BPromise(function(_0x61e5d3,_0x1f0dda){return client[_0x7e70('0xc')](_0x319f91,_0x5e1463)[_0x7e70('0xd')](function(_0x5740c4){logger[_0x7e70('0xe')](_0x7e70('0xf'),_0x1960da,'request\x20sent');logger[_0x7e70('0x10')](_0x7e70('0x11'),_0x1960da,_0x7e70('0x12'),JSON[_0x7e70('0x13')](_0x5740c4));if(_0x5740c4[_0x7e70('0x14')]){if(_0x5740c4[_0x7e70('0x14')][_0x7e70('0x15')]===0x1f4){logger[_0x7e70('0x14')](_0x7e70('0xf'),_0x1960da,_0x5740c4[_0x7e70('0x14')]['message']);return _0x1f0dda(_0x5740c4[_0x7e70('0x14')]['message']);}logger[_0x7e70('0x14')](_0x7e70('0xf'),_0x1960da,_0x5740c4[_0x7e70('0x14')]['message']);return _0x61e5d3(_0x5740c4['error'][_0x7e70('0x16')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x1960da,_0x7e70('0x12'));_0x61e5d3(_0x5740c4['result'][_0x7e70('0x16')]);}})[_0x7e70('0x17')](function(_0x29741a){logger[_0x7e70('0x14')](_0x7e70('0xf'),_0x1960da,_0x29741a);_0x1f0dda(_0x29741a);});});}exports['GetVoiceQueueReport']=function(_0x3544ee){var _0x16f844=this;return new Promise(function(_0x1adc90,_0x427e04){return db[_0x7e70('0x18')][_0x7e70('0x19')]({'raw':_0x3544ee['options']?_0x3544ee[_0x7e70('0x1a')][_0x7e70('0x1b')]===undefined?!![]:![]:!![],'where':_0x3544ee[_0x7e70('0x1a')]?_0x3544ee[_0x7e70('0x1a')][_0x7e70('0x1c')]||null:null,'attributes':_0x3544ee[_0x7e70('0x1a')]?_0x3544ee['options'][_0x7e70('0x1d')]||null:null,'limit':_0x3544ee[_0x7e70('0x1a')]?_0x3544ee[_0x7e70('0x1a')][_0x7e70('0x1e')]||null:null,'include':_0x3544ee[_0x7e70('0x1a')]?_0x3544ee[_0x7e70('0x1a')][_0x7e70('0x1f')]?_[_0x7e70('0x20')](_0x3544ee['options'][_0x7e70('0x1f')],function(_0x3e74ab){return{'model':db[_0x3e74ab[_0x7e70('0x21')]],'as':_0x3e74ab['as'],'attributes':_0x3e74ab[_0x7e70('0x1d')],'include':_0x3e74ab[_0x7e70('0x1f')]?_[_0x7e70('0x20')](_0x3e74ab[_0x7e70('0x1f')],function(_0x5e54bc){return{'model':db[_0x5e54bc[_0x7e70('0x21')]],'as':_0x5e54bc['as'],'attributes':_0x5e54bc[_0x7e70('0x1d')],'include':_0x5e54bc[_0x7e70('0x1f')]?_[_0x7e70('0x20')](_0x5e54bc['include'],function(_0x4fb0ee){return{'model':db[_0x4fb0ee[_0x7e70('0x21')]],'as':_0x4fb0ee['as'],'attributes':_0x4fb0ee[_0x7e70('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7e70('0xd')](function(_0x2b78d1){logger[_0x7e70('0xe')](_0x7e70('0x22'),_0x3544ee);logger[_0x7e70('0x10')](_0x7e70('0x22'),_0x3544ee,JSON[_0x7e70('0x13')](_0x2b78d1));_0x1adc90(_0x2b78d1);})[_0x7e70('0x17')](function(_0x4d6fe5){logger[_0x7e70('0x14')]('GetVoiceQueueReport',_0x4d6fe5[_0x7e70('0x16')],_0x3544ee);_0x427e04(_0x16f844['error'](0x1f4,_0x4d6fe5[_0x7e70('0x16')]));});});};exports['CreateVoiceQueueReport']=function(_0x1113c8){var _0x4567eb=this;return new Promise(function(_0x99774e,_0x340529){return db['VoiceQueueReport'][_0x7e70('0x23')](_0x1113c8[_0x7e70('0x24')],{'raw':_0x1113c8[_0x7e70('0x1a')]?_0x1113c8['options'][_0x7e70('0x1b')]===undefined?!![]:![]:!![]})[_0x7e70('0xd')](function(_0x41899c){logger['info'](_0x7e70('0x25'),_0x1113c8);logger['debug'](_0x7e70('0x25'),_0x1113c8,JSON['stringify'](_0x41899c));_0x99774e(_0x41899c);})[_0x7e70('0x17')](function(_0x3f8e1b){logger[_0x7e70('0x14')]('CreateVoiceQueueReport',_0x3f8e1b[_0x7e70('0x16')],_0x1113c8);_0x340529(_0x4567eb[_0x7e70('0x14')](0x1f4,_0x3f8e1b[_0x7e70('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x36626d){var _0x15135f=this;return new Promise(function(_0x2a9e38,_0x51894c){return db['VoiceQueueReport'][_0x7e70('0x26')](_0x36626d[_0x7e70('0x24')],{'raw':_0x36626d[_0x7e70('0x1a')]?_0x36626d[_0x7e70('0x1a')][_0x7e70('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36626d[_0x7e70('0x1a')]?_0x36626d[_0x7e70('0x1a')][_0x7e70('0x1c')]||null:null,'attributes':_0x36626d[_0x7e70('0x1a')]?_0x36626d['options'][_0x7e70('0x1d')]||null:null,'limit':_0x36626d[_0x7e70('0x1a')]?_0x36626d[_0x7e70('0x1a')][_0x7e70('0x1e')]||null:null})[_0x7e70('0xd')](function(_0x2f5d13){logger[_0x7e70('0xe')](_0x7e70('0x27'),_0x36626d);logger[_0x7e70('0x10')]('UpdateVoiceQueueReport',_0x36626d,JSON['stringify'](_0x2f5d13));_0x2a9e38(_0x2f5d13);})[_0x7e70('0x17')](function(_0x54183f){logger[_0x7e70('0x14')]('UpdateVoiceQueueReport',_0x54183f[_0x7e70('0x16')],_0x36626d);_0x51894c(_0x15135f[_0x7e70('0x14')](0x1f4,_0x54183f[_0x7e70('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index aaaf938..1a0e641 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 _0xc0a4=['update','emit','register','length','voiceQueueReport:','save','remove'];(function(_0x237226,_0xe3b3b1){var _0x173884=function(_0x204489){while(--_0x204489){_0x237226['push'](_0x237226['shift']());}};_0x173884(++_0xe3b3b1);}(_0xc0a4,0x147));var _0x4c0a=function(_0x22fc32,_0x4aa409){_0x22fc32=_0x22fc32-0x0;var _0x1c0680=_0xc0a4[_0x22fc32];return _0x1c0680;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x4c0a('0x0'),_0x4c0a('0x1'),_0x4c0a('0x2')];function createListener(_0x489d78,_0x1afa7c){return function(_0x4727a9){_0x1afa7c[_0x4c0a('0x3')](_0x489d78,_0x4727a9);};}function removeListener(_0x23a18d,_0x44b0e7){return function(){VoiceQueueReportEvents['removeListener'](_0x23a18d,_0x44b0e7);};}exports[_0x4c0a('0x4')]=function(_0x1a78a1){for(var _0x12af4b=0x0,_0x457ef9=events[_0x4c0a('0x5')];_0x12af4b<_0x457ef9;_0x12af4b++){var _0x1a64e7=events[_0x12af4b];var _0x4093d5=createListener(_0x4c0a('0x6')+_0x1a64e7,_0x1a78a1);VoiceQueueReportEvents['on'](_0x1a64e7,_0x4093d5);}}; \ No newline at end of file +var _0x4f29=['emit','removeListener','register','length','voiceQueueReport:','save','remove','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4f29,0xfd));var _0x94f2=function(_0x4e60f5,_0xd33c72){_0x4e60f5=_0x4e60f5-0x0;var _0x2ad2a6=_0x4f29[_0x4e60f5];return _0x2ad2a6;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x94f2('0x0'),_0x94f2('0x1'),_0x94f2('0x2')];function createListener(_0x2a6804,_0xc16ee3){return function(_0x36e06e){_0xc16ee3[_0x94f2('0x3')](_0x2a6804,_0x36e06e);};}function removeListener(_0x2a6535,_0x106798){return function(){VoiceQueueReportEvents[_0x94f2('0x4')](_0x2a6535,_0x106798);};}exports[_0x94f2('0x5')]=function(_0x493302){for(var _0x5e9216=0x0,_0xe14ba5=events[_0x94f2('0x6')];_0x5e9216<_0xe14ba5;_0x5e9216++){var _0x1d1910=events[_0x5e9216];var _0x224a93=createListener(_0x94f2('0x7')+_0x1d1910,_0x493302);VoiceQueueReportEvents['on'](_0x1d1910,_0x224a93);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 8610e2a..ca06d8a 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 _0x481a=['isAuthenticated','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id'];(function(_0x1f7a55,_0x352d22){var _0x2a291b=function(_0xc9d9f6){while(--_0xc9d9f6){_0x1f7a55['push'](_0x1f7a55['shift']());}};_0x2a291b(++_0x352d22);}(_0x481a,0xbb));var _0xa481=function(_0x3bc72d,_0x5aaa33){_0x3bc72d=_0x3bc72d-0x0;var _0x3b7fbf=_0x481a[_0x3bc72d];return _0x3b7fbf;};'use strict';var multer=require(_0xa481('0x0'));var util=require(_0xa481('0x1'));var path=require(_0xa481('0x2'));var timeout=require(_0xa481('0x3'));var express=require(_0xa481('0x4'));var router=express['Router']();var fs_extra=require(_0xa481('0x5'));var auth=require(_0xa481('0x6'));var interaction=require(_0xa481('0x7'));var config=require(_0xa481('0x8'));var controller=require(_0xa481('0x9'));router[_0xa481('0xa')]('/',auth['isAuthenticated'](),controller[_0xa481('0xb')]);router[_0xa481('0xa')](_0xa481('0xc'),auth[_0xa481('0xd')](),controller[_0xa481('0xe')]);router[_0xa481('0xf')]('/',auth[_0xa481('0xd')](),controller[_0xa481('0x10')]);router['put'](_0xa481('0xc'),auth[_0xa481('0xd')](),controller[_0xa481('0x11')]);router['delete'](_0xa481('0xc'),auth[_0xa481('0xd')](),controller[_0xa481('0x12')]);module[_0xa481('0x13')]=router; \ No newline at end of file +var _0x9004=['index','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0x9004,0x1eb));var _0x4900=function(_0x42cc72,_0x2f61d8){_0x42cc72=_0x42cc72-0x0;var _0x5a7521=_0x9004[_0x42cc72];return _0x5a7521;};'use strict';var multer=require(_0x4900('0x0'));var util=require(_0x4900('0x1'));var path=require(_0x4900('0x2'));var timeout=require(_0x4900('0x3'));var express=require(_0x4900('0x4'));var router=express[_0x4900('0x5')]();var fs_extra=require(_0x4900('0x6'));var auth=require(_0x4900('0x7'));var interaction=require(_0x4900('0x8'));var config=require(_0x4900('0x9'));var controller=require(_0x4900('0xa'));router[_0x4900('0xb')]('/',auth[_0x4900('0xc')](),controller[_0x4900('0xd')]);router[_0x4900('0xb')](_0x4900('0xe'),auth['isAuthenticated'](),controller[_0x4900('0xf')]);router['post']('/',auth[_0x4900('0xc')](),controller['create']);router[_0x4900('0x10')](_0x4900('0xe'),auth['isAuthenticated'](),controller[_0x4900('0x11')]);router[_0x4900('0x12')]('/:id',auth[_0x4900('0xc')](),controller[_0x4900('0x13')]);module[_0x4900('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 4e5131a..29c2e56 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 _0x9e3e=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x495f4b,_0x185442){var _0x412c0e=function(_0x339ef0){while(--_0x339ef0){_0x495f4b['push'](_0x495f4b['shift']());}};_0x412c0e(++_0x185442);}(_0x9e3e,0x1c6));var _0xe9e3=function(_0x1fd155,_0x340af9){_0x1fd155=_0x1fd155-0x0;var _0x250e2f=_0x9e3e[_0x1fd155];return _0x250e2f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe9e3('0x0'));module['exports']={'time':{'type':Sequelize[_0xe9e3('0x1')]},'callid':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe9e3('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe9e3('0x2')],'allowNull':![],'defaultValue':moment()[_0xe9e3('0x3')](_0xe9e3('0x4'))}}; \ No newline at end of file +var _0xef66=['format','sequelize','moment','exports','STRING','DATE'];(function(_0x5cc30e,_0x2646b6){var _0x208c6d=function(_0x1abc53){while(--_0x1abc53){_0x5cc30e['push'](_0x5cc30e['shift']());}};_0x208c6d(++_0x2646b6);}(_0xef66,0x1db));var _0x6ef6=function(_0x124aca,_0x48cbd2){_0x124aca=_0x124aca-0x0;var _0x37eaf1=_0xef66[_0x124aca];return _0x37eaf1;};'use strict';var Sequelize=require(_0x6ef6('0x0'));var moment=require(_0x6ef6('0x1'));module[_0x6ef6('0x2')]={'time':{'type':Sequelize[_0x6ef6('0x3')]},'callid':{'type':Sequelize[_0x6ef6('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x6ef6('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6ef6('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6ef6('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x6ef6('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x6ef6('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6ef6('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6ef6('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6ef6('0x4')],'allowNull':![],'defaultValue':moment()[_0x6ef6('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 5361777..9fa74fa 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 _0x5e72=['filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','merge','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','then','destroy','error','stack','name','send','map','VoiceQueuesLog','fieldName','type','model','query'];(function(_0x32a9da,_0xd7a4bc){var _0x3b3998=function(_0x3a8d48){while(--_0x3a8d48){_0x32a9da['push'](_0x32a9da['shift']());}};_0x3b3998(++_0xd7a4bc);}(_0x5e72,0x136));var _0x25e7=function(_0x36e1a8,_0x3cfec8){_0x36e1a8=_0x36e1a8-0x0;var _0x9585d2=_0x5e72[_0x36e1a8];return _0x9585d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25e7('0x0'));var zipdir=require(_0x25e7('0x1'));var jsonpatch=require(_0x25e7('0x2'));var rp=require(_0x25e7('0x3'));var moment=require(_0x25e7('0x4'));var BPromise=require(_0x25e7('0x5'));var Mustache=require(_0x25e7('0x6'));var util=require('util');var path=require(_0x25e7('0x7'));var sox=require('sox');var csv=require(_0x25e7('0x8'));var ejs=require(_0x25e7('0x9'));var fs=require('fs');var fs_extra=require(_0x25e7('0xa'));var _=require(_0x25e7('0xb'));var squel=require('squel');var crypto=require(_0x25e7('0xc'));var jsforce=require(_0x25e7('0xd'));var deskjs=require(_0x25e7('0xe'));var toCsv=require(_0x25e7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x25e7('0xf'));var authService=require(_0x25e7('0x10'));var qs=require(_0x25e7('0x11'));var as=require(_0x25e7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25e7('0x13'))(_0x25e7('0x14'));var utils=require('../../config/utils');var config=require(_0x25e7('0x15'));var licenseUtil=require(_0x25e7('0x16'));var db=require(_0x25e7('0x17'))['db'];function respondWithStatusCode(_0x4a39b0,_0x559bbc){_0x559bbc=_0x559bbc||0xcc;return function(_0x56e0b5){if(_0x56e0b5){return _0x4a39b0[_0x25e7('0x18')](_0x559bbc);}return _0x4a39b0[_0x25e7('0x19')](_0x559bbc)[_0x25e7('0x1a')]();};}function respondWithResult(_0x4db28c,_0x1a84de){_0x1a84de=_0x1a84de||0xc8;return function(_0x294a6d){if(_0x294a6d){return _0x4db28c[_0x25e7('0x19')](_0x1a84de)[_0x25e7('0x1b')](_0x294a6d);}};}function respondWithFilteredResult(_0x5ab6ce,_0x268f05){return function(_0x5b1582){if(_0x5b1582){var _0x4acf05=typeof _0x268f05['offset']===_0x25e7('0x1c')&&typeof _0x268f05['limit']==='undefined';var _0x190195=_0x5b1582[_0x25e7('0x1d')];var _0x591e6a=_0x4acf05?0x0:_0x268f05[_0x25e7('0x1e')];var _0x339309=_0x4acf05?_0x5b1582[_0x25e7('0x1d')]:_0x268f05[_0x25e7('0x1e')]+_0x268f05['limit'];var _0x1fe152;if(_0x339309>=_0x190195){_0x339309=_0x190195;_0x1fe152=0xc8;}else{_0x1fe152=0xce;}_0x5ab6ce['status'](_0x1fe152);return _0x5ab6ce[_0x25e7('0x1f')]('Content-Range',_0x591e6a+'-'+_0x339309+'/'+_0x190195)[_0x25e7('0x1b')](_0x5b1582);}return null;};}function patchUpdates(_0x350d67){return function(_0x3c14d2){try{jsonpatch[_0x25e7('0x20')](_0x3c14d2,_0x350d67,!![]);}catch(_0x2344e1){return BPromise['reject'](_0x2344e1);}return _0x3c14d2['save']();};}function saveUpdates(_0x4a1789,_0x63d75e){return function(_0x46827d){if(_0x46827d){return _0x46827d['update'](_0x4a1789)[_0x25e7('0x21')](function(_0x488f34){return _0x488f34;});}return null;};}function removeEntity(_0x2eff18,_0x409097){return function(_0x579f2e){if(_0x579f2e){return _0x579f2e[_0x25e7('0x22')]()['then'](function(){_0x2eff18[_0x25e7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53323f,_0x303bdf){return function(_0x158217){if(!_0x158217){_0x53323f[_0x25e7('0x18')](0x194);}return _0x158217;};}function handleError(_0x5dc51c,_0x50d1c0){_0x50d1c0=_0x50d1c0||0x1f4;return function(_0x2d32ab){logger[_0x25e7('0x23')](_0x2d32ab[_0x25e7('0x24')]);if(_0x2d32ab[_0x25e7('0x25')]){delete _0x2d32ab[_0x25e7('0x25')];}_0x5dc51c[_0x25e7('0x19')](_0x50d1c0)[_0x25e7('0x26')](_0x2d32ab);};}exports['index']=function(_0x73a2fa,_0xcf7462){var _0x524afd={},_0x5565bd={},_0x3a915d={'count':0x0,'rows':[]};var _0x94f040=_[_0x25e7('0x27')](db[_0x25e7('0x28')]['rawAttributes'],function(_0x390e2e){return{'name':_0x390e2e[_0x25e7('0x29')],'type':_0x390e2e[_0x25e7('0x2a')]['key']};});_0x5565bd[_0x25e7('0x2b')]=_[_0x25e7('0x27')](_0x94f040,_0x25e7('0x25'));_0x5565bd[_0x25e7('0x2c')]=_['keys'](_0x73a2fa['query']);_0x5565bd[_0x25e7('0x2d')]=_['intersection'](_0x5565bd[_0x25e7('0x2b')],_0x5565bd[_0x25e7('0x2c')]);_0x524afd[_0x25e7('0x2e')]=_[_0x25e7('0x2f')](_0x5565bd[_0x25e7('0x2b')],qs[_0x25e7('0x30')](_0x73a2fa[_0x25e7('0x2c')][_0x25e7('0x30')]));_0x524afd[_0x25e7('0x2e')]=_0x524afd[_0x25e7('0x2e')][_0x25e7('0x31')]?_0x524afd[_0x25e7('0x2e')]:_0x5565bd['model'];if(!_0x73a2fa['query'][_0x25e7('0x32')]('nolimit')){_0x524afd[_0x25e7('0x33')]=qs[_0x25e7('0x33')](_0x73a2fa[_0x25e7('0x2c')][_0x25e7('0x33')]);_0x524afd[_0x25e7('0x1e')]=qs[_0x25e7('0x1e')](_0x73a2fa[_0x25e7('0x2c')][_0x25e7('0x1e')]);}_0x524afd[_0x25e7('0x34')]=qs[_0x25e7('0x35')](_0x73a2fa[_0x25e7('0x2c')][_0x25e7('0x35')]);_0x524afd[_0x25e7('0x36')]=qs[_0x25e7('0x2d')](_[_0x25e7('0x37')](_0x73a2fa[_0x25e7('0x2c')],_0x5565bd[_0x25e7('0x2d')]),_0x94f040);if(_0x73a2fa[_0x25e7('0x2c')]['filter']){_0x524afd['where']=_['merge'](_0x524afd['where'],{'$or':_[_0x25e7('0x27')](_0x94f040,function(_0x58b22b){if(_0x58b22b[_0x25e7('0x2a')]!==_0x25e7('0x38')){var _0x385639={};_0x385639[_0x58b22b['name']]={'$like':'%'+_0x73a2fa[_0x25e7('0x2c')][_0x25e7('0x39')]+'%'};return _0x385639;}})});}_0x524afd=_['merge']({},_0x524afd,_0x73a2fa[_0x25e7('0x3a')]);var _0x126e00={'where':_0x524afd['where']};return db[_0x25e7('0x28')]['count'](_0x126e00)[_0x25e7('0x21')](function(_0x7c8634){_0x3a915d['count']=_0x7c8634;if(_0x73a2fa['query'][_0x25e7('0x3b')]){_0x524afd[_0x25e7('0x3c')]=[{'all':!![]}];}return db[_0x25e7('0x28')][_0x25e7('0x3d')](_0x524afd);})['then'](function(_0x1bf5ad){_0x3a915d[_0x25e7('0x3e')]=_0x1bf5ad;return _0x3a915d;})[_0x25e7('0x21')](respondWithFilteredResult(_0xcf7462,_0x524afd))['catch'](handleError(_0xcf7462,null));};exports[_0x25e7('0x3f')]=function(_0x46d4c5,_0x55aaa8){var _0x2b7d95={'raw':!![],'where':{'id':_0x46d4c5[_0x25e7('0x40')]['id']}},_0x4dc71d={};_0x4dc71d[_0x25e7('0x2b')]=_[_0x25e7('0x41')](db[_0x25e7('0x28')]['rawAttributes']);_0x4dc71d[_0x25e7('0x2c')]=_[_0x25e7('0x41')](_0x46d4c5['query']);_0x4dc71d[_0x25e7('0x2d')]=_[_0x25e7('0x2f')](_0x4dc71d[_0x25e7('0x2b')],_0x4dc71d['query']);_0x2b7d95[_0x25e7('0x2e')]=_[_0x25e7('0x2f')](_0x4dc71d[_0x25e7('0x2b')],qs[_0x25e7('0x30')](_0x46d4c5['query'][_0x25e7('0x30')]));_0x2b7d95[_0x25e7('0x2e')]=_0x2b7d95[_0x25e7('0x2e')][_0x25e7('0x31')]?_0x2b7d95[_0x25e7('0x2e')]:_0x4dc71d[_0x25e7('0x2b')];if(_0x46d4c5[_0x25e7('0x2c')][_0x25e7('0x3b')]){_0x2b7d95[_0x25e7('0x3c')]=[{'all':!![]}];}_0x2b7d95=_[_0x25e7('0x42')]({},_0x2b7d95,_0x46d4c5[_0x25e7('0x3a')]);return db[_0x25e7('0x28')]['find'](_0x2b7d95)['then'](handleEntityNotFound(_0x55aaa8,null))['then'](respondWithResult(_0x55aaa8,null))[_0x25e7('0x43')](handleError(_0x55aaa8,null));};exports[_0x25e7('0x44')]=function(_0x1ea944,_0x36f7d9){return db[_0x25e7('0x28')][_0x25e7('0x44')](_0x1ea944[_0x25e7('0x45')],{})[_0x25e7('0x21')](respondWithResult(_0x36f7d9,0xc9))[_0x25e7('0x43')](handleError(_0x36f7d9,null));};exports['update']=function(_0x3a098a,_0x5c2d15){if(_0x3a098a[_0x25e7('0x45')]['id']){delete _0x3a098a['body']['id'];}return db[_0x25e7('0x28')][_0x25e7('0x46')]({'where':{'id':_0x3a098a[_0x25e7('0x40')]['id']}})[_0x25e7('0x21')](handleEntityNotFound(_0x5c2d15,null))[_0x25e7('0x21')](saveUpdates(_0x3a098a[_0x25e7('0x45')],null))['then'](respondWithResult(_0x5c2d15,null))['catch'](handleError(_0x5c2d15,null));};exports['destroy']=function(_0x197765,_0x17fdb4){return db['VoiceQueuesLog'][_0x25e7('0x46')]({'where':{'id':_0x197765['params']['id']}})['then'](handleEntityNotFound(_0x17fdb4,null))[_0x25e7('0x21')](removeEntity(_0x17fdb4,null))[_0x25e7('0x43')](handleError(_0x17fdb4,null));}; \ No newline at end of file +var _0x354f=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','update','then','destroy','error','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x354f,0xfb));var _0xf354=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x354f[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require(_0xf354('0x0'));var rimraf=require(_0xf354('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf354('0x2'));var BPromise=require(_0xf354('0x3'));var Mustache=require(_0xf354('0x4'));var util=require(_0xf354('0x5'));var path=require(_0xf354('0x6'));var sox=require(_0xf354('0x7'));var csv=require(_0xf354('0x8'));var ejs=require(_0xf354('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf354('0xa'));var squel=require(_0xf354('0xb'));var crypto=require(_0xf354('0xc'));var jsforce=require(_0xf354('0xd'));var deskjs=require(_0xf354('0xe'));var toCsv=require(_0xf354('0x8'));var querystring=require(_0xf354('0xf'));var Papa=require(_0xf354('0x10'));var Redis=require(_0xf354('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf354('0x12'));var as=require(_0xf354('0x13'));var hardwareService=require(_0xf354('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf354('0x15'));var config=require(_0xf354('0x16'));var licenseUtil=require(_0xf354('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3da079,_0x140476){_0x140476=_0x140476||0xcc;return function(_0x1086ff){if(_0x1086ff){return _0x3da079[_0xf354('0x18')](_0x140476);}return _0x3da079[_0xf354('0x19')](_0x140476)[_0xf354('0x1a')]();};}function respondWithResult(_0x1f0197,_0x440e16){_0x440e16=_0x440e16||0xc8;return function(_0x2319eb){if(_0x2319eb){return _0x1f0197[_0xf354('0x19')](_0x440e16)[_0xf354('0x1b')](_0x2319eb);}};}function respondWithFilteredResult(_0x3679ca,_0x1b8b55){return function(_0x4435c0){if(_0x4435c0){var _0x328387=typeof _0x1b8b55[_0xf354('0x1c')]===_0xf354('0x1d')&&typeof _0x1b8b55['limit']===_0xf354('0x1d');var _0x1b5e55=_0x4435c0[_0xf354('0x1e')];var _0x56b3dd=_0x328387?0x0:_0x1b8b55[_0xf354('0x1c')];var _0x524d32=_0x328387?_0x4435c0[_0xf354('0x1e')]:_0x1b8b55[_0xf354('0x1c')]+_0x1b8b55['limit'];var _0x213f35;if(_0x524d32>=_0x1b5e55){_0x524d32=_0x1b5e55;_0x213f35=0xc8;}else{_0x213f35=0xce;}_0x3679ca[_0xf354('0x19')](_0x213f35);return _0x3679ca['set'](_0xf354('0x1f'),_0x56b3dd+'-'+_0x524d32+'/'+_0x1b5e55)[_0xf354('0x1b')](_0x4435c0);}return null;};}function patchUpdates(_0x2f2c6a){return function(_0x2dc488){try{jsonpatch['apply'](_0x2dc488,_0x2f2c6a,!![]);}catch(_0x545ddd){return BPromise[_0xf354('0x20')](_0x545ddd);}return _0x2dc488['save']();};}function saveUpdates(_0x821a6a,_0x43a57d){return function(_0x168396){if(_0x168396){return _0x168396[_0xf354('0x21')](_0x821a6a)[_0xf354('0x22')](function(_0x10465d){return _0x10465d;});}return null;};}function removeEntity(_0xdd6ced,_0x483a49){return function(_0x1f38c9){if(_0x1f38c9){return _0x1f38c9[_0xf354('0x23')]()[_0xf354('0x22')](function(){_0xdd6ced[_0xf354('0x19')](0xcc)[_0xf354('0x1a')]();});}};}function handleEntityNotFound(_0x4c12e2,_0x621a03){return function(_0x3b2ae0){if(!_0x3b2ae0){_0x4c12e2['sendStatus'](0x194);}return _0x3b2ae0;};}function handleError(_0xe017ce,_0x59e3b5){_0x59e3b5=_0x59e3b5||0x1f4;return function(_0x5b63b1){logger[_0xf354('0x24')](_0x5b63b1['stack']);if(_0x5b63b1[_0xf354('0x25')]){delete _0x5b63b1['name'];}_0xe017ce['status'](_0x59e3b5)[_0xf354('0x26')](_0x5b63b1);};}exports[_0xf354('0x27')]=function(_0x2f54c0,_0x3f2d0a){var _0xd861ff={},_0x4d58ce={},_0x26e05f={'count':0x0,'rows':[]};var _0x3d8fd8=_['map'](db[_0xf354('0x28')][_0xf354('0x29')],function(_0x4d40e4){return{'name':_0x4d40e4[_0xf354('0x2a')],'type':_0x4d40e4[_0xf354('0x2b')][_0xf354('0x2c')]};});_0x4d58ce[_0xf354('0x2d')]=_[_0xf354('0x2e')](_0x3d8fd8,_0xf354('0x25'));_0x4d58ce[_0xf354('0x2f')]=_['keys'](_0x2f54c0[_0xf354('0x2f')]);_0x4d58ce[_0xf354('0x30')]=_[_0xf354('0x31')](_0x4d58ce[_0xf354('0x2d')],_0x4d58ce['query']);_0xd861ff[_0xf354('0x32')]=_['intersection'](_0x4d58ce['model'],qs[_0xf354('0x33')](_0x2f54c0['query'][_0xf354('0x33')]));_0xd861ff[_0xf354('0x32')]=_0xd861ff[_0xf354('0x32')][_0xf354('0x34')]?_0xd861ff[_0xf354('0x32')]:_0x4d58ce['model'];if(!_0x2f54c0['query'][_0xf354('0x35')](_0xf354('0x36'))){_0xd861ff[_0xf354('0x37')]=qs['limit'](_0x2f54c0[_0xf354('0x2f')][_0xf354('0x37')]);_0xd861ff[_0xf354('0x1c')]=qs[_0xf354('0x1c')](_0x2f54c0['query'][_0xf354('0x1c')]);}_0xd861ff['order']=qs[_0xf354('0x38')](_0x2f54c0[_0xf354('0x2f')][_0xf354('0x38')]);_0xd861ff['where']=qs[_0xf354('0x30')](_[_0xf354('0x39')](_0x2f54c0[_0xf354('0x2f')],_0x4d58ce[_0xf354('0x30')]),_0x3d8fd8);if(_0x2f54c0[_0xf354('0x2f')][_0xf354('0x3a')]){_0xd861ff[_0xf354('0x3b')]=_[_0xf354('0x3c')](_0xd861ff['where'],{'$or':_[_0xf354('0x2e')](_0x3d8fd8,function(_0x11fc2d){if(_0x11fc2d[_0xf354('0x2b')]!==_0xf354('0x3d')){var _0x3da534={};_0x3da534[_0x11fc2d['name']]={'$like':'%'+_0x2f54c0[_0xf354('0x2f')][_0xf354('0x3a')]+'%'};return _0x3da534;}})});}_0xd861ff=_[_0xf354('0x3c')]({},_0xd861ff,_0x2f54c0[_0xf354('0x3e')]);var _0x17e1ff={'where':_0xd861ff['where']};return db['VoiceQueuesLog'][_0xf354('0x1e')](_0x17e1ff)[_0xf354('0x22')](function(_0x3e452a){_0x26e05f[_0xf354('0x1e')]=_0x3e452a;if(_0x2f54c0['query'][_0xf354('0x3f')]){_0xd861ff[_0xf354('0x40')]=[{'all':!![]}];}return db[_0xf354('0x28')][_0xf354('0x41')](_0xd861ff);})[_0xf354('0x22')](function(_0x4c3b4d){_0x26e05f[_0xf354('0x42')]=_0x4c3b4d;return _0x26e05f;})['then'](respondWithFilteredResult(_0x3f2d0a,_0xd861ff))[_0xf354('0x43')](handleError(_0x3f2d0a,null));};exports[_0xf354('0x44')]=function(_0xa041c,_0x3e9fd3){var _0x380056={'raw':!![],'where':{'id':_0xa041c[_0xf354('0x45')]['id']}},_0x52662a={};_0x52662a[_0xf354('0x2d')]=_[_0xf354('0x46')](db['VoiceQueuesLog'][_0xf354('0x29')]);_0x52662a[_0xf354('0x2f')]=_['keys'](_0xa041c['query']);_0x52662a['filters']=_[_0xf354('0x31')](_0x52662a[_0xf354('0x2d')],_0x52662a[_0xf354('0x2f')]);_0x380056[_0xf354('0x32')]=_['intersection'](_0x52662a[_0xf354('0x2d')],qs[_0xf354('0x33')](_0xa041c[_0xf354('0x2f')][_0xf354('0x33')]));_0x380056[_0xf354('0x32')]=_0x380056[_0xf354('0x32')][_0xf354('0x34')]?_0x380056[_0xf354('0x32')]:_0x52662a[_0xf354('0x2d')];if(_0xa041c[_0xf354('0x2f')][_0xf354('0x3f')]){_0x380056[_0xf354('0x40')]=[{'all':!![]}];}_0x380056=_[_0xf354('0x3c')]({},_0x380056,_0xa041c[_0xf354('0x3e')]);return db['VoiceQueuesLog']['find'](_0x380056)['then'](handleEntityNotFound(_0x3e9fd3,null))[_0xf354('0x22')](respondWithResult(_0x3e9fd3,null))[_0xf354('0x43')](handleError(_0x3e9fd3,null));};exports[_0xf354('0x47')]=function(_0x272ffd,_0x1d82b5){return db[_0xf354('0x28')][_0xf354('0x47')](_0x272ffd[_0xf354('0x48')],{})[_0xf354('0x22')](respondWithResult(_0x1d82b5,0xc9))[_0xf354('0x43')](handleError(_0x1d82b5,null));};exports[_0xf354('0x21')]=function(_0x374c3f,_0x25aa3a){if(_0x374c3f[_0xf354('0x48')]['id']){delete _0x374c3f[_0xf354('0x48')]['id'];}return db[_0xf354('0x28')][_0xf354('0x49')]({'where':{'id':_0x374c3f['params']['id']}})['then'](handleEntityNotFound(_0x25aa3a,null))['then'](saveUpdates(_0x374c3f[_0xf354('0x48')],null))[_0xf354('0x22')](respondWithResult(_0x25aa3a,null))[_0xf354('0x43')](handleError(_0x25aa3a,null));};exports['destroy']=function(_0x58d101,_0x32868b){return db[_0xf354('0x28')][_0xf354('0x49')]({'where':{'id':_0x58d101['params']['id']}})['then'](handleEntityNotFound(_0x32868b,null))[_0xf354('0x22')](removeEntity(_0x32868b,null))[_0xf354('0x43')](handleError(_0x32868b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 3a4e6a8..0c1f972 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 _0x0a73=['lodash','util','api','moment','bluebird','path','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x279645,_0x2ed6c5){var _0x1b6272=function(_0x5ec356){while(--_0x5ec356){_0x279645['push'](_0x279645['shift']());}};_0x1b6272(++_0x2ed6c5);}(_0x0a73,0x1e0));var _0x30a7=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x0a73[_0x54ccd7];return _0x4e667b;};'use strict';var _=require(_0x30a7('0x0'));var util=require(_0x30a7('0x1'));var logger=require('../../config/logger')(_0x30a7('0x2'));var moment=require(_0x30a7('0x3'));var BPromise=require(_0x30a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30a7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x30a7('0x6'));module['exports']=function(_0xd84788,_0xe4e5ca){return _0xd84788[_0x30a7('0x7')](_0x30a7('0x8'),attributes,{'tableName':_0x30a7('0x9'),'paranoid':![],'indexes':[{'name':_0x30a7('0xa'),'fields':[_0x30a7('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x5686=['./voiceQueuesLog.attributes','define','VoiceQueuesLog','event_dtm','event','dtm','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x35c4ca,_0x28850a){var _0x3013e4=function(_0x5b56b7){while(--_0x5b56b7){_0x35c4ca['push'](_0x35c4ca['shift']());}};_0x3013e4(++_0x28850a);}(_0x5686,0xbc));var _0x6568=function(_0x4c11f7,_0x5a0447){_0x4c11f7=_0x4c11f7-0x0;var _0x587d6b=_0x5686[_0x4c11f7];return _0x587d6b;};'use strict';var _=require('lodash');var util=require(_0x6568('0x0'));var logger=require(_0x6568('0x1'))('api');var moment=require(_0x6568('0x2'));var BPromise=require(_0x6568('0x3'));var rp=require(_0x6568('0x4'));var fs=require('fs');var path=require(_0x6568('0x5'));var rimraf=require(_0x6568('0x6'));var config=require(_0x6568('0x7'));var attributes=require(_0x6568('0x8'));module['exports']=function(_0x1253a6,_0x535c7b){return _0x1253a6[_0x6568('0x9')](_0x6568('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x6568('0xb'),'fields':[_0x6568('0xc'),_0x6568('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 89bd38b..f363ea6 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 _0xb887=['../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../config/logger','rpc'];(function(_0x4dab93,_0x5b8463){var _0xad632b=function(_0x23150b){while(--_0x23150b){_0x4dab93['push'](_0x4dab93['shift']());}};_0xad632b(++_0x5b8463);}(_0xb887,0xaf));var _0x7b88=function(_0x2be367,_0x4504d2){_0x2be367=_0x2be367-0x0;var _0x3589fd=_0xb887[_0x2be367];return _0x3589fd;};'use strict';var _=require(_0x7b88('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7b88('0x1'));var rs=require(_0x7b88('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7b88('0x3'))(_0x7b88('0x4'));var config=require(_0x7b88('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7b88('0x6')][_0x7b88('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57f8a6,_0x35e94f,_0x4b356f){return new BPromise(function(_0x2f4ca0,_0x1add10){return client[_0x7b88('0x8')](_0x57f8a6,_0x4b356f)[_0x7b88('0x9')](function(_0x3d0452){logger[_0x7b88('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x35e94f,'request\x20sent');logger['debug'](_0x7b88('0xb'),_0x35e94f,_0x7b88('0xc'),JSON[_0x7b88('0xd')](_0x3d0452));if(_0x3d0452['error']){if(_0x3d0452['error'][_0x7b88('0xe')]===0x1f4){logger[_0x7b88('0xf')](_0x7b88('0x10'),_0x35e94f,_0x3d0452['error'][_0x7b88('0x11')]);return _0x1add10(_0x3d0452[_0x7b88('0xf')][_0x7b88('0x11')]);}logger[_0x7b88('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x35e94f,_0x3d0452[_0x7b88('0xf')][_0x7b88('0x11')]);return _0x2f4ca0(_0x3d0452[_0x7b88('0xf')][_0x7b88('0x11')]);}else{logger[_0x7b88('0xa')](_0x7b88('0x10'),_0x35e94f,'request\x20sent');_0x2f4ca0(_0x3d0452[_0x7b88('0x12')][_0x7b88('0x11')]);}})[_0x7b88('0x13')](function(_0x4c3e58){logger['error'](_0x7b88('0x10'),_0x35e94f,_0x4c3e58);_0x1add10(_0x4c3e58);});});} \ No newline at end of file +var _0x90db=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x90db,0x1c0));var _0xb90d=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x90db[_0x5447fd];return _0x15b28a;};'use strict';var _=require('lodash');var util=require(_0xb90d('0x0'));var moment=require(_0xb90d('0x1'));var BPromise=require(_0xb90d('0x2'));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')(_0xb90d('0x3'));var config=require(_0xb90d('0x4'));var jayson=require(_0xb90d('0x5'));var client=jayson[_0xb90d('0x6')][_0xb90d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d8398,_0x180781,_0x126e17){return new BPromise(function(_0x2ef5e6,_0x108b88){return client[_0xb90d('0x8')](_0x2d8398,_0x126e17)[_0xb90d('0x9')](function(_0x48c4f6){logger[_0xb90d('0xa')](_0xb90d('0xb'),_0x180781,_0xb90d('0xc'));logger['debug'](_0xb90d('0xd'),_0x180781,_0xb90d('0xc'),JSON[_0xb90d('0xe')](_0x48c4f6));if(_0x48c4f6[_0xb90d('0xf')]){if(_0x48c4f6[_0xb90d('0xf')]['code']===0x1f4){logger[_0xb90d('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x180781,_0x48c4f6[_0xb90d('0xf')][_0xb90d('0x10')]);return _0x108b88(_0x48c4f6[_0xb90d('0xf')][_0xb90d('0x10')]);}logger[_0xb90d('0xf')](_0xb90d('0xb'),_0x180781,_0x48c4f6[_0xb90d('0xf')]['message']);return _0x2ef5e6(_0x48c4f6[_0xb90d('0xf')]['message']);}else{logger[_0xb90d('0xa')](_0xb90d('0xb'),_0x180781,'request\x20sent');_0x2ef5e6(_0x48c4f6[_0xb90d('0x11')]['message']);}})[_0xb90d('0x12')](function(_0x396f3f){logger[_0xb90d('0xf')](_0xb90d('0xb'),_0x180781,_0x396f3f);_0x108b88(_0x396f3f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 066c963..e48b3b1 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 _0x7057=['runTranscribe','put','/:id','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create'];(function(_0x49a0bf,_0x3a2db9){var _0x47d5ed=function(_0xcb6025){while(--_0xcb6025){_0x49a0bf['push'](_0x49a0bf['shift']());}};_0x47d5ed(++_0x3a2db9);}(_0x7057,0xc3));var _0x7705=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x7057[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7705('0x0'));var timeout=require(_0x7705('0x1'));var express=require(_0x7705('0x2'));var router=express[_0x7705('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7705('0x4'));var interaction=require(_0x7705('0x5'));var config=require(_0x7705('0x6'));var controller=require(_0x7705('0x7'));router[_0x7705('0x8')]('/',auth['isAuthenticated'](),controller[_0x7705('0x9')]);router[_0x7705('0x8')](_0x7705('0xa'),auth[_0x7705('0xb')](),controller[_0x7705('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7705('0xd')]);router[_0x7705('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x7705('0xe')]);router[_0x7705('0x8')](_0x7705('0xf'),controller[_0x7705('0x10')]);router[_0x7705('0x8')](_0x7705('0x11'),auth['isAuthenticated'](),controller[_0x7705('0x12')]);router[_0x7705('0x13')]('/',auth[_0x7705('0xb')](),controller[_0x7705('0x14')]);router[_0x7705('0x13')](_0x7705('0x11'),auth[_0x7705('0xb')](),controller[_0x7705('0x15')]);router[_0x7705('0x16')](_0x7705('0x17'),auth[_0x7705('0xb')](),controller['update']);router[_0x7705('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x7705('0x19')]);module[_0x7705('0x1a')]=router; \ No newline at end of file +var _0xbb53=['download','/:id/downloads','downloads','/:id/transcribe','runTranscribe','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','/describe','describe','show','get','/:id/download'];(function(_0x219008,_0x16ac04){var _0x481fbf=function(_0x47115c){while(--_0x47115c){_0x219008['push'](_0x219008['shift']());}};_0x481fbf(++_0x16ac04);}(_0xbb53,0x133));var _0x3bb5=function(_0x2fb149,_0x5646a6){_0x2fb149=_0x2fb149-0x0;var _0x1589ca=_0xbb53[_0x2fb149];return _0x1589ca;};'use strict';var multer=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var path=require(_0x3bb5('0x2'));var timeout=require(_0x3bb5('0x3'));var express=require('express');var router=express[_0x3bb5('0x4')]();var fs_extra=require(_0x3bb5('0x5'));var auth=require(_0x3bb5('0x6'));var interaction=require(_0x3bb5('0x7'));var config=require(_0x3bb5('0x8'));var controller=require(_0x3bb5('0x9'));router['get']('/',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xb')]);router['get'](_0x3bb5('0xc'),auth['isAuthenticated'](),controller[_0x3bb5('0xd')]);router['get']('/:id',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xe')]);router[_0x3bb5('0xf')](_0x3bb5('0x10'),auth['isAuthenticated'](),controller[_0x3bb5('0x11')]);router[_0x3bb5('0xf')](_0x3bb5('0x12'),controller[_0x3bb5('0x13')]);router[_0x3bb5('0xf')](_0x3bb5('0x14'),auth['isAuthenticated'](),controller['downloadTranscribe']);router['post']('/',auth[_0x3bb5('0xa')](),controller['create']);router['post'](_0x3bb5('0x14'),auth['isAuthenticated'](),controller[_0x3bb5('0x15')]);router[_0x3bb5('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0x17')]);router[_0x3bb5('0x18')]('/:id',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x19')]);module[_0x3bb5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a0de9fa..6eade1f 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(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 c76e3fc..ae21f2a 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 _0xb805=['data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','runSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','format','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','MD5','sequelize','col','token','$and','push','VoiceRecording\x20not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','listBuckets','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','data1'];(function(_0x5eb154,_0x1c851e){var _0x1ec3b6=function(_0x4069f1){while(--_0x4069f1){_0x5eb154['push'](_0x5eb154['shift']());}};_0x1ec3b6(++_0x1c851e);}(_0xb805,0xa2));var _0x5b80=function(_0x1b08c9,_0x1f0f3e){_0x1b08c9=_0x1b08c9-0x0;var _0x1b09d6=_0xb805[_0x1b08c9];return _0x1b09d6;};'use strict';var emlformat=require(_0x5b80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b80('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b80('0x2'));var moment=require(_0x5b80('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5b80('0x4'));var util=require(_0x5b80('0x5'));var path=require(_0x5b80('0x6'));var sox=require(_0x5b80('0x7'));var csv=require(_0x5b80('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b80('0x9'));var _=require(_0x5b80('0xa'));var squel=require(_0x5b80('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b80('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5b80('0xd'));var Papa=require(_0x5b80('0xe'));var AWS=require(_0x5b80('0xf'));var uuidv4=require(_0x5b80('0x10'));var Redis=require('ioredis');var authService=require(_0x5b80('0x11'));var qs=require(_0x5b80('0x12'));var as=require(_0x5b80('0x13'));var hardwareService=require(_0x5b80('0x14'));var logger=require(_0x5b80('0x15'))(_0x5b80('0x16'));var utils=require(_0x5b80('0x17'));var config=require(_0x5b80('0x18'));var licenseUtil=require(_0x5b80('0x19'));var db=require(_0x5b80('0x1a'))['db'];function respondWithStatusCode(_0x4b3fb9,_0x2b50d1){_0x2b50d1=_0x2b50d1||0xcc;return function(_0x17d2ee){if(_0x17d2ee){return _0x4b3fb9[_0x5b80('0x1b')](_0x2b50d1);}return _0x4b3fb9[_0x5b80('0x1c')](_0x2b50d1)['end']();};}function respondWithResult(_0x5630be,_0x1448ec){_0x1448ec=_0x1448ec||0xc8;return function(_0x2b9126){if(_0x2b9126){return _0x5630be['status'](_0x1448ec)['json'](_0x2b9126);}};}function respondWithFilteredResult(_0x20b1e4,_0x1a92c6){return function(_0xbd7d2e){if(_0xbd7d2e){var _0x57f296=typeof _0x1a92c6[_0x5b80('0x1d')]===_0x5b80('0x1e')&&typeof _0x1a92c6['limit']===_0x5b80('0x1e');var _0x71ab4a=_0xbd7d2e[_0x5b80('0x1f')];var _0x2802b0=_0x57f296?0x0:_0x1a92c6[_0x5b80('0x1d')];var _0x46b34b=_0x57f296?_0xbd7d2e[_0x5b80('0x1f')]:_0x1a92c6[_0x5b80('0x1d')]+_0x1a92c6[_0x5b80('0x20')];var _0x2b8541;if(_0x46b34b>=_0x71ab4a){_0x46b34b=_0x71ab4a;_0x2b8541=0xc8;}else{_0x2b8541=0xce;}_0x20b1e4['status'](_0x2b8541);return _0x20b1e4['set'](_0x5b80('0x21'),_0x2802b0+'-'+_0x46b34b+'/'+_0x71ab4a)[_0x5b80('0x22')](_0xbd7d2e);}return null;};}function patchUpdates(_0x47a048){return function(_0x9ca52e){try{jsonpatch[_0x5b80('0x23')](_0x9ca52e,_0x47a048,!![]);}catch(_0x2b8994){return BPromise[_0x5b80('0x24')](_0x2b8994);}return _0x9ca52e['save']();};}function saveUpdates(_0x1691cc,_0x3f0da1){return function(_0x3c738a){if(_0x3c738a){return _0x3c738a['update'](_0x1691cc)[_0x5b80('0x25')](function(_0x105863){return _0x105863;});}return null;};}function removeEntity(_0xf0c044,_0x49afa4){return function(_0x27b268){if(_0x27b268){return _0x27b268[_0x5b80('0x26')]()['then'](function(){_0xf0c044[_0x5b80('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x220b88,_0x19faab){return function(_0x526f5d){if(!_0x526f5d){_0x220b88[_0x5b80('0x1b')](0x194);}return _0x526f5d;};}function handleError(_0x96086a,_0x106a93){_0x106a93=_0x106a93||0x1f4;return function(_0x53e52b){logger[_0x5b80('0x27')](_0x53e52b[_0x5b80('0x28')]);if(_0x53e52b[_0x5b80('0x29')]){delete _0x53e52b['name'];}_0x96086a['status'](_0x106a93)[_0x5b80('0x2a')](_0x53e52b);};}exports['index']=function(_0x2b9c98,_0x2c15e5){var _0x2970f0={},_0x47c871={},_0x122d6c={'count':0x0,'rows':[]};var _0x273fa6=_[_0x5b80('0x2b')](db[_0x5b80('0x2c')][_0x5b80('0x2d')],function(_0x11fd8b){return{'name':_0x11fd8b[_0x5b80('0x2e')],'type':_0x11fd8b[_0x5b80('0x2f')][_0x5b80('0x30')]};});_0x47c871[_0x5b80('0x31')]=_['differenceBy'](_[_0x5b80('0x2b')](_0x273fa6,_0x5b80('0x29')),[_0x5b80('0x32')]);_0x47c871['query']=_[_0x5b80('0x33')](_0x2b9c98[_0x5b80('0x34')]);_0x47c871[_0x5b80('0x35')]=_['intersection'](_0x47c871[_0x5b80('0x31')],_0x47c871[_0x5b80('0x34')]);_0x2970f0[_0x5b80('0x36')]=_['intersection'](_0x47c871[_0x5b80('0x31')],qs['fields'](_0x2b9c98[_0x5b80('0x34')][_0x5b80('0x37')]));_0x2970f0[_0x5b80('0x36')]=_0x2970f0[_0x5b80('0x36')][_0x5b80('0x38')]?_0x2970f0[_0x5b80('0x36')]:_0x47c871[_0x5b80('0x31')];if(!_0x2b9c98[_0x5b80('0x34')][_0x5b80('0x39')](_0x5b80('0x3a'))){_0x2970f0['limit']=qs[_0x5b80('0x20')](_0x2b9c98[_0x5b80('0x34')]['limit']);_0x2970f0[_0x5b80('0x1d')]=qs[_0x5b80('0x1d')](_0x2b9c98[_0x5b80('0x34')][_0x5b80('0x1d')]);}_0x2970f0['order']=qs['sort'](_0x2b9c98[_0x5b80('0x34')][_0x5b80('0x3b')]);_0x2970f0[_0x5b80('0x3c')]=qs[_0x5b80('0x35')](_[_0x5b80('0x3d')](_0x2b9c98[_0x5b80('0x34')],_0x47c871[_0x5b80('0x35')]),_0x273fa6);if(_0x2b9c98['query'][_0x5b80('0x3e')]){_0x2970f0['where']=_[_0x5b80('0x3f')](_0x2970f0['where'],{'$or':_[_0x5b80('0x2b')](_0x273fa6,function(_0x3a09bc){if(_0x3a09bc[_0x5b80('0x2f')]!==_0x5b80('0x40')){var _0x978def={};_0x978def[_0x3a09bc[_0x5b80('0x29')]]={'$like':'%'+_0x2b9c98[_0x5b80('0x34')][_0x5b80('0x3e')]+'%'};return _0x978def;}})});}_0x2970f0=_[_0x5b80('0x3f')]({},_0x2970f0,_0x2b9c98[_0x5b80('0x41')]);var _0x2c0088={'where':_0x2970f0[_0x5b80('0x3c')]};return db[_0x5b80('0x2c')][_0x5b80('0x1f')](_0x2c0088)[_0x5b80('0x25')](function(_0x319684){_0x122d6c[_0x5b80('0x1f')]=_0x319684;if(_0x2b9c98['query']['includeAll']){_0x2970f0['include']=[{'all':!![]}];}return db[_0x5b80('0x2c')][_0x5b80('0x42')](_0x2970f0);})[_0x5b80('0x25')](function(_0x1b07ae){_0x122d6c[_0x5b80('0x43')]=_0x1b07ae;return _0x122d6c;})[_0x5b80('0x25')](respondWithFilteredResult(_0x2c15e5,_0x2970f0))[_0x5b80('0x44')](handleError(_0x2c15e5,null));};exports[_0x5b80('0x45')]=function(_0x4973d5,_0x499388){var _0x21fc50={'raw':![],'where':{'id':_0x4973d5[_0x5b80('0x46')]['id']}},_0x10e9b0={};_0x10e9b0[_0x5b80('0x31')]=_[_0x5b80('0x33')](db[_0x5b80('0x2c')]['rawAttributes']);_0x10e9b0['query']=_['keys'](_0x4973d5['query']);_0x10e9b0[_0x5b80('0x35')]=_[_0x5b80('0x47')](_0x10e9b0['model'],_0x10e9b0[_0x5b80('0x34')]);_0x21fc50[_0x5b80('0x36')]=_[_0x5b80('0x47')](_0x10e9b0['model'],qs[_0x5b80('0x37')](_0x4973d5['query']['fields']));_0x21fc50[_0x5b80('0x36')]=_0x21fc50[_0x5b80('0x36')]['length']?_0x21fc50['attributes']:_0x10e9b0[_0x5b80('0x31')];if(_0x4973d5[_0x5b80('0x34')][_0x5b80('0x48')]){_0x21fc50[_0x5b80('0x49')]=[{'all':!![]}];}_0x21fc50=_[_0x5b80('0x3f')]({},_0x21fc50,_0x4973d5[_0x5b80('0x41')]);return db[_0x5b80('0x2c')][_0x5b80('0x4a')](_0x21fc50)[_0x5b80('0x25')](handleEntityNotFound(_0x499388,null))['then'](respondWithResult(_0x499388,null))[_0x5b80('0x44')](handleError(_0x499388,null));};exports[_0x5b80('0x4b')]=function(_0x3cedbb,_0x4b262b){return db['VoiceRecording']['create'](_0x3cedbb[_0x5b80('0x4c')],{})[_0x5b80('0x25')](respondWithResult(_0x4b262b,0xc9))[_0x5b80('0x44')](handleError(_0x4b262b,null));};exports['update']=function(_0x1ed037,_0x382a0f){if(_0x1ed037['body']['id']){delete _0x1ed037['body']['id'];}return db[_0x5b80('0x2c')][_0x5b80('0x4a')]({'where':{'id':_0x1ed037[_0x5b80('0x46')]['id']}})[_0x5b80('0x25')](handleEntityNotFound(_0x382a0f,null))[_0x5b80('0x25')](saveUpdates(_0x1ed037[_0x5b80('0x4c')],null))[_0x5b80('0x25')](respondWithResult(_0x382a0f,null))[_0x5b80('0x44')](handleError(_0x382a0f,null));};exports['describe']=function(_0x2b3a1c,_0x5b3701){return db['VoiceRecording'][_0x5b80('0x4d')]()[_0x5b80('0x25')](respondWithResult(_0x5b3701,null))[_0x5b80('0x44')](handleError(_0x5b3701,null));};exports[_0x5b80('0x4e')]=function(_0x286d09,_0x1c804a,_0x2dc8a1){var _0x463023=require(_0x5b80('0x4f'));var _0x2c958b=![];var _0x596cb3={};if(_0x286d09[_0x5b80('0x34')][_0x5b80('0x2f')]&&_0x286d09[_0x5b80('0x34')][_0x5b80('0x2f')]===_0x5b80('0x50')){_0x596cb3[_0x5b80('0x50')]=_0x286d09[_0x5b80('0x46')]['id'];}else{_0x596cb3['id']=_0x286d09[_0x5b80('0x46')]['id'];}return db[_0x5b80('0x2c')][_0x5b80('0x4a')]({'where':_0x596cb3,'attributes':['id',_0x5b80('0x51')],'raw':!![]})[_0x5b80('0x25')](handleEntityNotFound(_0x1c804a,null))[_0x5b80('0x25')](function(_0x49c43e){if(_0x49c43e){var _0x337e54=_0x49c43e[_0x5b80('0x51')];var _0x170abb=util[_0x5b80('0x32')](_0x5b80('0x52'),_0x337e54);if(fs['existsSync'](_0x170abb)){_0x2c958b=!![];return _0x463023[_0x5b80('0x53')](_0x170abb,_0x337e54,config[_0x5b80('0x54')][_0x5b80('0x55')])[_0x5b80('0x25')](function(){return _0x49c43e;});}return _0x49c43e;}})['then'](function(_0x233320){if(_0x233320){var _0x2d3616=_0x233320[_0x5b80('0x51')];if(!fs[_0x5b80('0x56')](_0x2d3616)){throw new db[(_0x5b80('0x57'))][(_0x5b80('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x233320[_0x5b80('0x59')]){return _0x1c804a['download'](_0x2d3616,_0x233320[_0x5b80('0x59')]+path[_0x5b80('0x5a')](_0x2d3616),function(){if(_0x2c958b){fs['unlink'](_0x2d3616);}});}else{return _0x1c804a[_0x5b80('0x4e')](_0x2d3616,function(_0x1b3585){if(_0x2c958b){fs[_0x5b80('0x5b')](_0x2d3616);}});}}})[_0x5b80('0x44')](function(_0x513aa0){if(_0x513aa0[_0x5b80('0x5c')]==='VoiceRecording\x20not\x20found'){_0x1c804a['status'](0x194)[_0x5b80('0x2a')]('Not\x20found');}else{return handleError(_0x1c804a,null);}});};exports['downloads']=function(_0x2f4dc5,_0x2ce7a8,_0x380a33){var _0x3fe378=require('../../components/encryptor');var _0x30aaba=![];var _0x2982f2={'$and':[db['sequelize'][_0x5b80('0x3c')](db['sequelize']['fn'](_0x5b80('0x5d'),db[_0x5b80('0x5e')][_0x5b80('0x5f')](_0x5b80('0x50'))),_0x2f4dc5[_0x5b80('0x34')][_0x5b80('0x60')])]};if(_0x2f4dc5['query'][_0x5b80('0x2f')]&&_0x2f4dc5['query'][_0x5b80('0x2f')]==='uniqueid'){_0x2982f2[_0x5b80('0x61')]['push']({'uniqueid':_0x2f4dc5[_0x5b80('0x46')]['id']});}else{_0x2982f2['$and'][_0x5b80('0x62')]({'id':_0x2f4dc5[_0x5b80('0x46')]['id']});}return db[_0x5b80('0x2c')][_0x5b80('0x4a')]({'where':_0x2982f2,'attributes':['id','value'],'raw':!![]})[_0x5b80('0x25')](handleEntityNotFound(_0x2ce7a8,null))[_0x5b80('0x25')](function(_0xc62f5c){if(_0xc62f5c){var _0x2e8ddf=util[_0x5b80('0x32')](_0x5b80('0x52'),_0xc62f5c[_0x5b80('0x51')]);if(fs[_0x5b80('0x56')](_0x2e8ddf)){_0x30aaba=!![];return _0x3fe378[_0x5b80('0x53')](_0x2e8ddf,_0xc62f5c[_0x5b80('0x51')],config[_0x5b80('0x54')][_0x5b80('0x55')])[_0x5b80('0x25')](function(){return _0xc62f5c;});}return _0xc62f5c;}})[_0x5b80('0x25')](function(_0x37bf24){if(_0x37bf24){if(!fs[_0x5b80('0x56')](_0x37bf24[_0x5b80('0x51')])){throw new db['Sequelize'][(_0x5b80('0x58'))](_0x5b80('0x63'));}if(_0x37bf24['filename']){return _0x2ce7a8[_0x5b80('0x4e')](_0x37bf24[_0x5b80('0x51')],_0x37bf24[_0x5b80('0x59')]+path[_0x5b80('0x5a')](_0x37bf24[_0x5b80('0x51')]),function(){if(_0x30aaba){fs[_0x5b80('0x5b')](_0x37bf24[_0x5b80('0x51')]);}});}else{return _0x2ce7a8['download'](_0x37bf24[_0x5b80('0x51')],function(_0x4d5a94){if(_0x30aaba){fs['unlink'](_0x37bf24['value']);}});}}})[_0x5b80('0x44')](handleError(_0x2ce7a8,null));};exports[_0x5b80('0x26')]=function(_0x365018,_0x435076){return db[_0x5b80('0x2c')]['find']({'where':{'id':_0x365018[_0x5b80('0x46')]['id']}})[_0x5b80('0x25')](function(_0x5f3dba){if(_[_0x5b80('0x64')](_0x5f3dba)){throw new ReferenceError(_0x5b80('0x65'));}return _0x5f3dba;})[_0x5b80('0x25')](function(_0x2f3c2f){var _0x4b26f4=_0x2f3c2f[_0x5b80('0x51')];logger['info'](_0x5b80('0x66'),_0x4b26f4);if(!_[_0x5b80('0x64')](_0x2f3c2f[_0x5b80('0x51')])&&fs[_0x5b80('0x56')](_0x4b26f4)){logger[_0x5b80('0x67')](_0x5b80('0x68')+_0x4b26f4+_0x5b80('0x69'));fs[_0x5b80('0x6a')](_0x4b26f4);}_0x4b26f4=_0x4b26f4+_0x5b80('0x6b');if(!_['isNil'](_0x2f3c2f['value'])&&fs[_0x5b80('0x56')](_0x4b26f4)){logger[_0x5b80('0x67')](_0x5b80('0x68')+_0x4b26f4+_0x5b80('0x69'));fs[_0x5b80('0x6a')](_0x4b26f4);}return _0x2f3c2f;})[_0x5b80('0x25')](function(_0x1b0eb0){if(!_0x1b0eb0)throw new InternalError();return _0x1b0eb0[_0x5b80('0x26')]();})['then'](function(){_0x435076[_0x5b80('0x1c')](0xcc)[_0x5b80('0x6c')]();})[_0x5b80('0x44')](handleError(_0x435076,null));};function getBucketslist(_0x6a2543,_0x54d122,_0x3dc282){return new Promise(function(_0x2f60a1,_0x103345){var _0x4ad326=new AWS['S3']({'accessKeyId':_0x54d122,'secretAccessKey':_0x6a2543,'region':_0x3dc282});_0x4ad326[_0x5b80('0x6d')]({},function(_0x9b7b88,_0x271a29){if(_0x9b7b88){return _0x103345(_0x9b7b88);}else{return _0x2f60a1(_0x271a29);}});});}function createBucket(_0xfe979,_0x151c76,_0x177430,_0x1717fd){return new Promise(function(_0x27bf2a,_0x473f1c){var _0x52c04c=new AWS['S3']({'accessKeyId':_0x151c76,'secretAccessKey':_0xfe979,'region':_0x177430});_0x52c04c['createBucket']({'Bucket':_0x1717fd},function(_0x48ad9d,_0x41ca75){if(_0x48ad9d){return _0x473f1c(_0x48ad9d);}else{return _0x27bf2a(_0x41ca75);}});});}function uploadFile(_0x13eee6,_0x1d9719,_0x41430a,_0x2b7940,_0x3b5c99,_0x54123b){return new Promise(function(_0x4fe95d,_0x4fb4e3){var _0x325a88=new AWS['S3']({'accessKeyId':_0x1d9719,'secretAccessKey':_0x13eee6,'region':_0x41430a});_0x325a88['upload']({'Bucket':_0x2b7940,'Key':_0x3b5c99,'Body':_0x54123b},function(_0x1ae290,_0x5c80a6){if(_0x1ae290){return _0x4fb4e3(_0x1ae290);}else{return _0x4fe95d(_0x5c80a6);}});});}function startTranscribe(_0x268d3f,_0x22081d,_0x51e367,_0x3af85d,_0x25a112,_0x11b6dd){return new Promise(function(_0x5c503a,_0x3e7252){var _0xc27c36=new AWS[(_0x5b80('0x6e'))]({'accessKeyId':_0x22081d,'secretAccessKey':_0x268d3f,'region':_0x51e367});_0xc27c36['startTranscriptionJob']({'TranscriptionJobName':_0x3af85d,'LanguageCode':_0x25a112,'Media':{'MediaFileUri':_0x11b6dd}},function(_0x1bc020,_0x547d53){if(_0x1bc020){return _0x3e7252(_0x1bc020);}else{return _0x5c503a(_0x547d53);}});});}function transcribe(_0x4c256f,_0x386992,_0x24115b,_0x5033fc,_0xc3512a,_0x5b0af1,_0x2b425d){return new Promise(function(_0x380126,_0xa1524e){var _0x10b8fb={};logger[_0x5b80('0x67')](util[_0x5b80('0x32')](_0x5b80('0x6f'),_0x4c256f,_0xc3512a));return uploadFile(_0x386992,_0x24115b,_0x5033fc,_0xc3512a,path[_0x5b80('0x70')](_0x5b0af1),fs[_0x5b80('0x71')](_0x5b0af1))['then'](function(_0x31e2e1){logger[_0x5b80('0x67')](util[_0x5b80('0x32')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x4c256f,_0xc3512a,_0x31e2e1['Location']));_0x10b8fb[_0x5b80('0x72')]=_0x31e2e1['Bucket'];_0x10b8fb['location']=_0x31e2e1[_0x5b80('0x73')];logger[_0x5b80('0x67')](util['format'](_0x5b80('0x74'),_0x4c256f));return startTranscribe(_0x386992,_0x24115b,_0x5033fc,uuidv4(),_0x2b425d,_0x31e2e1['Location']);})[_0x5b80('0x25')](function(_0x10f959){logger[_0x5b80('0x67')](util[_0x5b80('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x4c256f,_0x10f959[_0x5b80('0x75')]['TranscriptionJobName']));_0x10b8fb[_0x5b80('0x76')]=_0x10f959[_0x5b80('0x75')][_0x5b80('0x77')];_0x10b8fb[_0x5b80('0x78')]=_0x10f959[_0x5b80('0x75')][_0x5b80('0x79')];return _0x380126(_0x10b8fb);})['catch'](function(_0x382b19){return _0xa1524e(_0x382b19);});});}exports[_0x5b80('0x7a')]=function(_0x1d5580,_0x55cb39,_0x5e9648){var _0x278b2f;var _0x49452f;var _0x5a338c;var _0x1f6647=require(_0x5b80('0x4f'));return db[_0x5b80('0x2c')][_0x5b80('0x7b')]({'where':{'id':_0x1d5580['params']['id']}})[_0x5b80('0x25')](function(_0x16ca0d){if(_0x16ca0d){var _0x1e1226=util[_0x5b80('0x32')]('%s.cypher',_0x16ca0d[_0x5b80('0x51')]);if(fs[_0x5b80('0x56')](_0x1e1226)){cypher=!![];return _0x1f6647['decryptFile'](_0x1e1226,_0x16ca0d[_0x5b80('0x51')],config[_0x5b80('0x54')][_0x5b80('0x55')])[_0x5b80('0x25')](function(){return _0x16ca0d;});}return _0x16ca0d;}})[_0x5b80('0x25')](function(_0x1be572){if(!_0x1be572){throw new db[(_0x5b80('0x57'))][(_0x5b80('0x58'))](_0x5b80('0x7c'));}_0x49452f=_0x1be572;return db[_0x5b80('0x7d')][_0x5b80('0x7b')]({'where':{'id':0x1}});})[_0x5b80('0x25')](handleEntityNotFound(_0x55cb39,null))['then'](function(_0x397d34){if(_0x397d34){_0x278b2f=_0x397d34;if(!_0x278b2f['transcribe']||!_0x278b2f['transcribeAccountId']||!_0x278b2f[_0x5b80('0x7e')]||!_0x278b2f[_0x5b80('0x7f')]||!_0x278b2f['bucket']){throw new db[(_0x5b80('0x57'))][(_0x5b80('0x58'))](_0x5b80('0x80'));}if(_0x1d5580['body']['runSentiment']&&(!_0x278b2f[_0x5b80('0x81')]||!_0x278b2f[_0x5b80('0x82')]||!_0x278b2f[_0x5b80('0x83')]||!_0x278b2f['language']||!_0x278b2f[_0x5b80('0x72')])){throw new db[(_0x5b80('0x57'))]['ValidationError'](_0x5b80('0x84'));}return db[_0x5b80('0x85')][_0x5b80('0x7b')]({'where':{'id':_0x278b2f[_0x5b80('0x86')]}});}})[_0x5b80('0x25')](function(_0x777fe1){if(!_0x777fe1){throw new db[(_0x5b80('0x57'))][(_0x5b80('0x58'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x777fe1[_0x5b80('0x87')]||!_0x777fe1[_0x5b80('0x88')]){throw new db[(_0x5b80('0x57'))][(_0x5b80('0x58'))](_0x5b80('0x89'));}_0x5a338c=_0x777fe1;return getBucketslist(_0x5a338c[_0x5b80('0x87')],_0x5a338c['data2'],_0x278b2f['transcribeRegion']);})['then'](function(_0x9841aa){if(_0x9841aa&&_0x9841aa[_0x5b80('0x8a')]){var _0x4acfa1=_[_0x5b80('0x4a')](_0x9841aa[_0x5b80('0x8a')],function(_0x37dc8d){return _0x37dc8d[_0x5b80('0x8b')]===_0x278b2f[_0x5b80('0x72')];});if(!_0x4acfa1){logger[_0x5b80('0x67')](util[_0x5b80('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x1d5580['params']['id'],_0x278b2f[_0x5b80('0x72')]));return createBucket(_0x5a338c[_0x5b80('0x87')],_0x5a338c['data2'],_0x278b2f[_0x5b80('0x7e')],_0x278b2f[_0x5b80('0x72')]);}logger[_0x5b80('0x67')](util['format'](_0x5b80('0x8c'),_0x1d5580['params']['id'],_0x278b2f[_0x5b80('0x72')]));return;}})[_0x5b80('0x25')](function(_0x511db6){if(_0x49452f[_0x5b80('0x78')]===_0x5b80('0x8d')){return transcribe(_0x1d5580[_0x5b80('0x46')]['id'],_0x5a338c[_0x5b80('0x87')],_0x5a338c[_0x5b80('0x88')],_0x278b2f[_0x5b80('0x7e')],_0x278b2f['bucket'],_0x49452f[_0x5b80('0x51')],_0x278b2f[_0x5b80('0x7f')]);}else{logger[_0x5b80('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x1d5580[_0x5b80('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x5b80('0x25')](function(_0x4771f2){if(_0x4771f2){_0x4771f2['tempSentiment']=_0x1d5580[_0x5b80('0x4c')][_0x5b80('0x8e')];return _0x49452f['updateAttributes'](_0x4771f2);}})[_0x5b80('0x25')](respondWithResult(_0x55cb39,null))[_0x5b80('0x44')](handleError(_0x55cb39,null));};function writeFile(_0x36d39a,_0x4dc069){return new Promise(function(_0x4c4c8f,_0x1bfb4d){fs[_0x5b80('0x8f')](_0x4dc069,_0x36d39a,function(_0x26a9bc,_0x137efc){if(_0x26a9bc){return _0x1bfb4d(_0x26a9bc);}else{return _0x4c4c8f(_0x137efc);}});});}exports[_0x5b80('0x90')]=function(_0xd46079,_0x3e703b,_0x2aaee2){return db[_0x5b80('0x2c')]['findOne']({'where':{'id':_0xd46079[_0x5b80('0x46')]['id']}})[_0x5b80('0x25')](handleEntityNotFound(_0x3e703b))[_0x5b80('0x25')](function(_0x4e2d88){if(_0x4e2d88&&_0x4e2d88[_0x5b80('0x91')]){var _0x18fe58=_0x4e2d88[_0x5b80('0x91')];var _0x13442b=config[_0x5b80('0x92')]+_0x5b80('0x93')+_0x4e2d88['id']+'.txt';if(fs[_0x5b80('0x56')](_0x13442b)){return _0x13442b;}return writeFile(_0x18fe58,_0x13442b)['then'](function(){return _0x13442b;});}else{throw new db['Sequelize'][(_0x5b80('0x58'))](_0x5b80('0x94'));}})[_0x5b80('0x25')](function(_0x50619b){return _0x3e703b[_0x5b80('0x4e')](_0x50619b);})[_0x5b80('0x44')](handleError(_0x3e703b));}; \ No newline at end of file +var _0x0f66=['querystring','papaparse','aws-sdk','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','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','download','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJob','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x37c29e,_0x50387e){var _0x405bd3=function(_0x322dfa){while(--_0x322dfa){_0x37c29e['push'](_0x37c29e['shift']());}};_0x405bd3(++_0x50387e);}(_0x0f66,0x12a));var _0x60f6=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x0f66[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0x60f6('0x0'));var rimraf=require(_0x60f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x60f6('0x2'));var moment=require(_0x60f6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x60f6('0x4'));var util=require(_0x60f6('0x5'));var path=require(_0x60f6('0x6'));var sox=require(_0x60f6('0x7'));var csv=require(_0x60f6('0x8'));var ejs=require(_0x60f6('0x9'));var fs=require('fs');var fs_extra=require(_0x60f6('0xa'));var _=require(_0x60f6('0xb'));var squel=require(_0x60f6('0xc'));var crypto=require(_0x60f6('0xd'));var jsforce=require(_0x60f6('0xe'));var deskjs=require(_0x60f6('0xf'));var toCsv=require(_0x60f6('0x8'));var querystring=require(_0x60f6('0x10'));var Papa=require(_0x60f6('0x11'));var AWS=require(_0x60f6('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0x60f6('0x13'));var authService=require(_0x60f6('0x14'));var qs=require(_0x60f6('0x15'));var as=require(_0x60f6('0x16'));var hardwareService=require(_0x60f6('0x17'));var logger=require(_0x60f6('0x18'))(_0x60f6('0x19'));var utils=require(_0x60f6('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x60f6('0x1b'));var db=require(_0x60f6('0x1c'))['db'];function respondWithStatusCode(_0x5be15e,_0x4df458){_0x4df458=_0x4df458||0xcc;return function(_0x2bb4da){if(_0x2bb4da){return _0x5be15e[_0x60f6('0x1d')](_0x4df458);}return _0x5be15e[_0x60f6('0x1e')](_0x4df458)[_0x60f6('0x1f')]();};}function respondWithResult(_0x3fd103,_0x3ef0c8){_0x3ef0c8=_0x3ef0c8||0xc8;return function(_0xd5b26f){if(_0xd5b26f){return _0x3fd103[_0x60f6('0x1e')](_0x3ef0c8)['json'](_0xd5b26f);}};}function respondWithFilteredResult(_0x34f803,_0x1929b2){return function(_0xc67cd6){if(_0xc67cd6){var _0x7846c6=typeof _0x1929b2['offset']===_0x60f6('0x20')&&typeof _0x1929b2[_0x60f6('0x21')]==='undefined';var _0x1e1185=_0xc67cd6[_0x60f6('0x22')];var _0x597e34=_0x7846c6?0x0:_0x1929b2[_0x60f6('0x23')];var _0x571b24=_0x7846c6?_0xc67cd6[_0x60f6('0x22')]:_0x1929b2[_0x60f6('0x23')]+_0x1929b2[_0x60f6('0x21')];var _0x4750f9;if(_0x571b24>=_0x1e1185){_0x571b24=_0x1e1185;_0x4750f9=0xc8;}else{_0x4750f9=0xce;}_0x34f803['status'](_0x4750f9);return _0x34f803[_0x60f6('0x24')](_0x60f6('0x25'),_0x597e34+'-'+_0x571b24+'/'+_0x1e1185)[_0x60f6('0x26')](_0xc67cd6);}return null;};}function patchUpdates(_0x5e5377){return function(_0x14445e){try{jsonpatch[_0x60f6('0x27')](_0x14445e,_0x5e5377,!![]);}catch(_0x1fb3f8){return BPromise['reject'](_0x1fb3f8);}return _0x14445e[_0x60f6('0x28')]();};}function saveUpdates(_0x5c2146,_0x56e7bd){return function(_0x304e7b){if(_0x304e7b){return _0x304e7b[_0x60f6('0x29')](_0x5c2146)[_0x60f6('0x2a')](function(_0xbd3555){return _0xbd3555;});}return null;};}function removeEntity(_0x1fb3c6,_0xb35a04){return function(_0x3e8cc4){if(_0x3e8cc4){return _0x3e8cc4[_0x60f6('0x2b')]()[_0x60f6('0x2a')](function(){_0x1fb3c6[_0x60f6('0x1e')](0xcc)[_0x60f6('0x1f')]();});}};}function handleEntityNotFound(_0x364cbe,_0x4c0aa5){return function(_0x5138fe){if(!_0x5138fe){_0x364cbe['sendStatus'](0x194);}return _0x5138fe;};}function handleError(_0xd39134,_0x3d6563){_0x3d6563=_0x3d6563||0x1f4;return function(_0x527747){logger[_0x60f6('0x2c')](_0x527747[_0x60f6('0x2d')]);if(_0x527747[_0x60f6('0x2e')]){delete _0x527747[_0x60f6('0x2e')];}_0xd39134[_0x60f6('0x1e')](_0x3d6563)['send'](_0x527747);};}exports[_0x60f6('0x2f')]=function(_0x2f41ce,_0x42e118){var _0x3774ab={},_0x81866f={},_0x28e61a={'count':0x0,'rows':[]};var _0x519d9e=_[_0x60f6('0x30')](db[_0x60f6('0x31')][_0x60f6('0x32')],function(_0x20d57a){return{'name':_0x20d57a[_0x60f6('0x33')],'type':_0x20d57a[_0x60f6('0x34')][_0x60f6('0x35')]};});_0x81866f[_0x60f6('0x36')]=_['differenceBy'](_['map'](_0x519d9e,_0x60f6('0x2e')),[_0x60f6('0x37')]);_0x81866f['query']=_[_0x60f6('0x38')](_0x2f41ce[_0x60f6('0x39')]);_0x81866f[_0x60f6('0x3a')]=_[_0x60f6('0x3b')](_0x81866f[_0x60f6('0x36')],_0x81866f[_0x60f6('0x39')]);_0x3774ab[_0x60f6('0x3c')]=_[_0x60f6('0x3b')](_0x81866f[_0x60f6('0x36')],qs[_0x60f6('0x3d')](_0x2f41ce[_0x60f6('0x39')]['fields']));_0x3774ab[_0x60f6('0x3c')]=_0x3774ab[_0x60f6('0x3c')][_0x60f6('0x3e')]?_0x3774ab[_0x60f6('0x3c')]:_0x81866f['model'];if(!_0x2f41ce['query'][_0x60f6('0x3f')]('nolimit')){_0x3774ab[_0x60f6('0x21')]=qs[_0x60f6('0x21')](_0x2f41ce[_0x60f6('0x39')]['limit']);_0x3774ab[_0x60f6('0x23')]=qs[_0x60f6('0x23')](_0x2f41ce[_0x60f6('0x39')][_0x60f6('0x23')]);}_0x3774ab[_0x60f6('0x40')]=qs['sort'](_0x2f41ce[_0x60f6('0x39')][_0x60f6('0x41')]);_0x3774ab[_0x60f6('0x42')]=qs[_0x60f6('0x3a')](_[_0x60f6('0x43')](_0x2f41ce[_0x60f6('0x39')],_0x81866f[_0x60f6('0x3a')]),_0x519d9e);if(_0x2f41ce[_0x60f6('0x39')][_0x60f6('0x44')]){_0x3774ab[_0x60f6('0x42')]=_[_0x60f6('0x45')](_0x3774ab['where'],{'$or':_['map'](_0x519d9e,function(_0x4a3ab7){if(_0x4a3ab7[_0x60f6('0x34')]!==_0x60f6('0x46')){var _0x22b3f7={};_0x22b3f7[_0x4a3ab7[_0x60f6('0x2e')]]={'$like':'%'+_0x2f41ce[_0x60f6('0x39')][_0x60f6('0x44')]+'%'};return _0x22b3f7;}})});}_0x3774ab=_[_0x60f6('0x45')]({},_0x3774ab,_0x2f41ce[_0x60f6('0x47')]);var _0x3b4e03={'where':_0x3774ab[_0x60f6('0x42')]};return db[_0x60f6('0x31')]['count'](_0x3b4e03)[_0x60f6('0x2a')](function(_0x2097cb){_0x28e61a[_0x60f6('0x22')]=_0x2097cb;if(_0x2f41ce[_0x60f6('0x39')]['includeAll']){_0x3774ab[_0x60f6('0x48')]=[{'all':!![]}];}return db[_0x60f6('0x31')][_0x60f6('0x49')](_0x3774ab);})['then'](function(_0x1d7ae9){_0x28e61a[_0x60f6('0x4a')]=_0x1d7ae9;return _0x28e61a;})['then'](respondWithFilteredResult(_0x42e118,_0x3774ab))[_0x60f6('0x4b')](handleError(_0x42e118,null));};exports[_0x60f6('0x4c')]=function(_0xbdd7e2,_0x5647f6){var _0x5444f7={'raw':![],'where':{'id':_0xbdd7e2[_0x60f6('0x4d')]['id']}},_0x7cb312={};_0x7cb312[_0x60f6('0x36')]=_['keys'](db[_0x60f6('0x31')][_0x60f6('0x32')]);_0x7cb312[_0x60f6('0x39')]=_[_0x60f6('0x38')](_0xbdd7e2[_0x60f6('0x39')]);_0x7cb312[_0x60f6('0x3a')]=_['intersection'](_0x7cb312['model'],_0x7cb312[_0x60f6('0x39')]);_0x5444f7[_0x60f6('0x3c')]=_['intersection'](_0x7cb312[_0x60f6('0x36')],qs['fields'](_0xbdd7e2[_0x60f6('0x39')][_0x60f6('0x3d')]));_0x5444f7['attributes']=_0x5444f7[_0x60f6('0x3c')][_0x60f6('0x3e')]?_0x5444f7[_0x60f6('0x3c')]:_0x7cb312[_0x60f6('0x36')];if(_0xbdd7e2[_0x60f6('0x39')][_0x60f6('0x4e')]){_0x5444f7[_0x60f6('0x48')]=[{'all':!![]}];}_0x5444f7=_[_0x60f6('0x45')]({},_0x5444f7,_0xbdd7e2[_0x60f6('0x47')]);return db[_0x60f6('0x31')][_0x60f6('0x4f')](_0x5444f7)[_0x60f6('0x2a')](handleEntityNotFound(_0x5647f6,null))[_0x60f6('0x2a')](respondWithResult(_0x5647f6,null))[_0x60f6('0x4b')](handleError(_0x5647f6,null));};exports[_0x60f6('0x50')]=function(_0x197067,_0x227dc5){return db[_0x60f6('0x31')][_0x60f6('0x50')](_0x197067[_0x60f6('0x51')],{})[_0x60f6('0x2a')](respondWithResult(_0x227dc5,0xc9))[_0x60f6('0x4b')](handleError(_0x227dc5,null));};exports[_0x60f6('0x29')]=function(_0x2522cb,_0x46c60e){if(_0x2522cb[_0x60f6('0x51')]['id']){delete _0x2522cb['body']['id'];}return db[_0x60f6('0x31')][_0x60f6('0x4f')]({'where':{'id':_0x2522cb[_0x60f6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x46c60e,null))['then'](saveUpdates(_0x2522cb[_0x60f6('0x51')],null))['then'](respondWithResult(_0x46c60e,null))['catch'](handleError(_0x46c60e,null));};exports[_0x60f6('0x52')]=function(_0x5b8fca,_0x4120a0){return db[_0x60f6('0x31')][_0x60f6('0x52')]()[_0x60f6('0x2a')](respondWithResult(_0x4120a0,null))[_0x60f6('0x4b')](handleError(_0x4120a0,null));};exports[_0x60f6('0x53')]=function(_0x50f401,_0x265831,_0x33cff5){var _0x5791e7=require('../../components/encryptor');var _0x4dbbb5=![];var _0x7eeb0f={};if(_0x50f401[_0x60f6('0x39')]['type']&&_0x50f401[_0x60f6('0x39')][_0x60f6('0x34')]==='uniqueid'){_0x7eeb0f[_0x60f6('0x54')]=_0x50f401[_0x60f6('0x4d')]['id'];}else{_0x7eeb0f['id']=_0x50f401[_0x60f6('0x4d')]['id'];}return db[_0x60f6('0x31')]['find']({'where':_0x7eeb0f,'attributes':['id',_0x60f6('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x265831,null))[_0x60f6('0x2a')](function(_0x5df18b){if(_0x5df18b){var _0x24c91d=_0x5df18b[_0x60f6('0x55')];var _0x1ebf79=util[_0x60f6('0x37')](_0x60f6('0x56'),_0x24c91d);if(fs['existsSync'](_0x1ebf79)){_0x4dbbb5=!![];return _0x5791e7[_0x60f6('0x57')](_0x1ebf79,_0x24c91d,config[_0x60f6('0x58')][_0x60f6('0x59')])[_0x60f6('0x2a')](function(){return _0x5df18b;});}return _0x5df18b;}})['then'](function(_0x3a581e){if(_0x3a581e){var _0xe056ee=_0x3a581e['value'];if(!fs[_0x60f6('0x5a')](_0xe056ee)){throw new db[(_0x60f6('0x5b'))][(_0x60f6('0x5c'))](_0x60f6('0x5d'));}if(_0x3a581e[_0x60f6('0x5e')]){return _0x265831[_0x60f6('0x53')](_0xe056ee,_0x3a581e['filename']+path['extname'](_0xe056ee),function(){if(_0x4dbbb5){fs['unlink'](_0xe056ee);}});}else{return _0x265831[_0x60f6('0x53')](_0xe056ee,function(_0x8a9e90){if(_0x4dbbb5){fs[_0x60f6('0x5f')](_0xe056ee);}});}}})[_0x60f6('0x4b')](function(_0xc79659){if(_0xc79659['message']==='VoiceRecording\x20not\x20found'){_0x265831[_0x60f6('0x1e')](0x194)[_0x60f6('0x60')](_0x60f6('0x61'));}else{return handleError(_0x265831,null);}});};exports[_0x60f6('0x62')]=function(_0x1cb708,_0x3fca89,_0x472f4e){var _0xc03410=require(_0x60f6('0x63'));var _0x2ec4e1=![];var _0x45259f={'$and':[db[_0x60f6('0x64')][_0x60f6('0x42')](db[_0x60f6('0x64')]['fn'](_0x60f6('0x65'),db['sequelize'][_0x60f6('0x66')](_0x60f6('0x54'))),_0x1cb708[_0x60f6('0x39')][_0x60f6('0x67')])]};if(_0x1cb708[_0x60f6('0x39')][_0x60f6('0x34')]&&_0x1cb708[_0x60f6('0x39')][_0x60f6('0x34')]===_0x60f6('0x54')){_0x45259f[_0x60f6('0x68')][_0x60f6('0x69')]({'uniqueid':_0x1cb708['params']['id']});}else{_0x45259f[_0x60f6('0x68')]['push']({'id':_0x1cb708['params']['id']});}return db['VoiceRecording'][_0x60f6('0x4f')]({'where':_0x45259f,'attributes':['id',_0x60f6('0x55')],'raw':!![]})[_0x60f6('0x2a')](handleEntityNotFound(_0x3fca89,null))[_0x60f6('0x2a')](function(_0x2b0886){if(_0x2b0886){var _0x43911d=util[_0x60f6('0x37')](_0x60f6('0x56'),_0x2b0886[_0x60f6('0x55')]);if(fs[_0x60f6('0x5a')](_0x43911d)){_0x2ec4e1=!![];return _0xc03410['decryptFile'](_0x43911d,_0x2b0886['value'],config[_0x60f6('0x58')][_0x60f6('0x59')])['then'](function(){return _0x2b0886;});}return _0x2b0886;}})[_0x60f6('0x2a')](function(_0x76902d){if(_0x76902d){if(!fs[_0x60f6('0x5a')](_0x76902d[_0x60f6('0x55')])){throw new db['Sequelize'][(_0x60f6('0x5c'))](_0x60f6('0x5d'));}if(_0x76902d['filename']){return _0x3fca89['download'](_0x76902d[_0x60f6('0x55')],_0x76902d[_0x60f6('0x5e')]+path['extname'](_0x76902d[_0x60f6('0x55')]),function(){if(_0x2ec4e1){fs[_0x60f6('0x5f')](_0x76902d[_0x60f6('0x55')]);}});}else{return _0x3fca89[_0x60f6('0x53')](_0x76902d[_0x60f6('0x55')],function(_0x50335a){if(_0x2ec4e1){fs[_0x60f6('0x5f')](_0x76902d['value']);}});}}})[_0x60f6('0x4b')](handleError(_0x3fca89,null));};exports[_0x60f6('0x2b')]=function(_0x29365c,_0x29ebb3){return db[_0x60f6('0x31')][_0x60f6('0x4f')]({'where':{'id':_0x29365c[_0x60f6('0x4d')]['id']}})[_0x60f6('0x2a')](function(_0x382ecd){if(_['isNil'](_0x382ecd)){throw new ReferenceError(_0x60f6('0x6a'));}return _0x382ecd;})['then'](function(_0x3434e5){var _0x4a3f77=_0x3434e5[_0x60f6('0x55')];logger[_0x60f6('0x6b')](_0x60f6('0x6c'),_0x4a3f77);if(!_[_0x60f6('0x6d')](_0x3434e5['value'])&&fs[_0x60f6('0x5a')](_0x4a3f77)){logger[_0x60f6('0x6b')](_0x60f6('0x6e')+_0x4a3f77+_0x60f6('0x6f'));fs[_0x60f6('0x70')](_0x4a3f77);}_0x4a3f77=_0x4a3f77+_0x60f6('0x71');if(!_[_0x60f6('0x6d')](_0x3434e5[_0x60f6('0x55')])&&fs[_0x60f6('0x5a')](_0x4a3f77)){logger[_0x60f6('0x6b')]('File:\x20\x22'+_0x4a3f77+_0x60f6('0x6f'));fs[_0x60f6('0x70')](_0x4a3f77);}return _0x3434e5;})[_0x60f6('0x2a')](function(_0x37463e){if(!_0x37463e)throw new InternalError();return _0x37463e[_0x60f6('0x2b')]();})['then'](function(){_0x29ebb3[_0x60f6('0x1e')](0xcc)[_0x60f6('0x1f')]();})['catch'](handleError(_0x29ebb3,null));};function getBucketslist(_0x27b611,_0x211518,_0x150709){return new Promise(function(_0x2f4b01,_0x3804ab){var _0x58ae63=new AWS['S3']({'accessKeyId':_0x211518,'secretAccessKey':_0x27b611,'region':_0x150709});_0x58ae63[_0x60f6('0x72')]({},function(_0x49c499,_0x3d5967){if(_0x49c499){return _0x3804ab(_0x49c499);}else{return _0x2f4b01(_0x3d5967);}});});}function createBucket(_0x25784c,_0x4b30fe,_0x589a8d,_0x6df9a2){return new Promise(function(_0x17697e,_0x4e830a){var _0x4552ba=new AWS['S3']({'accessKeyId':_0x4b30fe,'secretAccessKey':_0x25784c,'region':_0x589a8d});_0x4552ba[_0x60f6('0x73')]({'Bucket':_0x6df9a2},function(_0x460c26,_0x31e19d){if(_0x460c26){return _0x4e830a(_0x460c26);}else{return _0x17697e(_0x31e19d);}});});}function uploadFile(_0x3c12b5,_0x50dc17,_0x3c385f,_0x339964,_0x4c4751,_0x19df17){return new Promise(function(_0x2d4efc,_0x54ba89){var _0x1a1097=new AWS['S3']({'accessKeyId':_0x50dc17,'secretAccessKey':_0x3c12b5,'region':_0x3c385f});_0x1a1097['upload']({'Bucket':_0x339964,'Key':_0x4c4751,'Body':_0x19df17},function(_0x1f6ae5,_0x1af1c6){if(_0x1f6ae5){return _0x54ba89(_0x1f6ae5);}else{return _0x2d4efc(_0x1af1c6);}});});}function startTranscribe(_0xd722db,_0x1f497d,_0x1bb1b9,_0x3bd468,_0x14d73c,_0x1026be){return new Promise(function(_0x28a027,_0x47cf3a){var _0x373521=new AWS[(_0x60f6('0x74'))]({'accessKeyId':_0x1f497d,'secretAccessKey':_0xd722db,'region':_0x1bb1b9});_0x373521['startTranscriptionJob']({'TranscriptionJobName':_0x3bd468,'LanguageCode':_0x14d73c,'Media':{'MediaFileUri':_0x1026be}},function(_0x824fa7,_0x4509a3){if(_0x824fa7){return _0x47cf3a(_0x824fa7);}else{return _0x28a027(_0x4509a3);}});});}function transcribe(_0x3c62af,_0x24b844,_0x28a730,_0x5e1493,_0x3e2fb7,_0x39f55f,_0x3469d7){return new Promise(function(_0x4c0d60,_0x416949){var _0x2cd406={};logger[_0x60f6('0x6b')](util[_0x60f6('0x37')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x3c62af,_0x3e2fb7));return uploadFile(_0x24b844,_0x28a730,_0x5e1493,_0x3e2fb7,path[_0x60f6('0x75')](_0x39f55f),fs['readFileSync'](_0x39f55f))[_0x60f6('0x2a')](function(_0x84163a){logger[_0x60f6('0x6b')](util[_0x60f6('0x37')](_0x60f6('0x76'),_0x3c62af,_0x3e2fb7,_0x84163a[_0x60f6('0x77')]));_0x2cd406[_0x60f6('0x78')]=_0x84163a['Bucket'];_0x2cd406[_0x60f6('0x79')]=_0x84163a[_0x60f6('0x77')];logger[_0x60f6('0x6b')](util['format'](_0x60f6('0x7a'),_0x3c62af));return startTranscribe(_0x24b844,_0x28a730,_0x5e1493,uuidv4(),_0x3469d7,_0x84163a[_0x60f6('0x77')]);})['then'](function(_0x44bf01){logger[_0x60f6('0x6b')](util[_0x60f6('0x37')](_0x60f6('0x7b'),_0x3c62af,_0x44bf01['TranscriptionJob']['TranscriptionJobName']));_0x2cd406[_0x60f6('0x7c')]=_0x44bf01['TranscriptionJob']['TranscriptionJobName'];_0x2cd406['transcribeStatus']=_0x44bf01[_0x60f6('0x7d')]['TranscriptionJobStatus'];return _0x4c0d60(_0x2cd406);})[_0x60f6('0x4b')](function(_0x2ea0b1){return _0x416949(_0x2ea0b1);});});}exports['runTranscribe']=function(_0x297851,_0x3f6a3c,_0x3ab86c){var _0x2cae91;var _0x577753;var _0x2dd8b2;var _0x21d99b=require(_0x60f6('0x63'));return db[_0x60f6('0x31')][_0x60f6('0x7e')]({'where':{'id':_0x297851[_0x60f6('0x4d')]['id']}})[_0x60f6('0x2a')](function(_0x3fc45a){if(_0x3fc45a){var _0x523190=util[_0x60f6('0x37')](_0x60f6('0x56'),_0x3fc45a[_0x60f6('0x55')]);if(fs['existsSync'](_0x523190)){cypher=!![];return _0x21d99b[_0x60f6('0x57')](_0x523190,_0x3fc45a[_0x60f6('0x55')],config[_0x60f6('0x58')][_0x60f6('0x59')])[_0x60f6('0x2a')](function(){return _0x3fc45a;});}return _0x3fc45a;}})['then'](function(_0x2c4d52){if(!_0x2c4d52){throw new db[(_0x60f6('0x5b'))][(_0x60f6('0x5c'))]('Voice\x20Recording\x20not\x20found');}_0x577753=_0x2c4d52;return db['Setting'][_0x60f6('0x7e')]({'where':{'id':0x1}});})[_0x60f6('0x2a')](handleEntityNotFound(_0x3f6a3c,null))[_0x60f6('0x2a')](function(_0xc485ab){if(_0xc485ab){_0x2cae91=_0xc485ab;if(!_0x2cae91[_0x60f6('0x7f')]||!_0x2cae91[_0x60f6('0x80')]||!_0x2cae91[_0x60f6('0x81')]||!_0x2cae91[_0x60f6('0x82')]||!_0x2cae91[_0x60f6('0x78')]){throw new db[(_0x60f6('0x5b'))]['ValidationError'](_0x60f6('0x83'));}if(_0x297851['body']['runSentiment']&&(!_0x2cae91[_0x60f6('0x84')]||!_0x2cae91[_0x60f6('0x85')]||!_0x2cae91[_0x60f6('0x86')]||!_0x2cae91[_0x60f6('0x82')]||!_0x2cae91['bucket'])){throw new db[(_0x60f6('0x5b'))]['ValidationError'](_0x60f6('0x87'));}return db[_0x60f6('0x88')][_0x60f6('0x7e')]({'where':{'id':_0x2cae91[_0x60f6('0x80')]}});}})[_0x60f6('0x2a')](function(_0x317060){if(!_0x317060){throw new db[(_0x60f6('0x5b'))][(_0x60f6('0x5c'))](_0x60f6('0x89'));}if(!_0x317060[_0x60f6('0x8a')]||!_0x317060['data2']){throw new db[(_0x60f6('0x5b'))]['ValidationError'](_0x60f6('0x8b'));}_0x2dd8b2=_0x317060;return getBucketslist(_0x2dd8b2['data1'],_0x2dd8b2[_0x60f6('0x8c')],_0x2cae91[_0x60f6('0x81')]);})[_0x60f6('0x2a')](function(_0x18c9ab){if(_0x18c9ab&&_0x18c9ab[_0x60f6('0x8d')]){var _0x3da428=_[_0x60f6('0x4f')](_0x18c9ab[_0x60f6('0x8d')],function(_0x4b3e07){return _0x4b3e07[_0x60f6('0x8e')]===_0x2cae91[_0x60f6('0x78')];});if(!_0x3da428){logger[_0x60f6('0x6b')](util['format'](_0x60f6('0x8f'),_0x297851[_0x60f6('0x4d')]['id'],_0x2cae91['bucket']));return createBucket(_0x2dd8b2[_0x60f6('0x8a')],_0x2dd8b2[_0x60f6('0x8c')],_0x2cae91[_0x60f6('0x81')],_0x2cae91[_0x60f6('0x78')]);}logger[_0x60f6('0x6b')](util[_0x60f6('0x37')](_0x60f6('0x90'),_0x297851[_0x60f6('0x4d')]['id'],_0x2cae91[_0x60f6('0x78')]));return;}})[_0x60f6('0x2a')](function(_0x15feb6){if(_0x577753['transcribeStatus']===_0x60f6('0x91')){return transcribe(_0x297851[_0x60f6('0x4d')]['id'],_0x2dd8b2[_0x60f6('0x8a')],_0x2dd8b2[_0x60f6('0x8c')],_0x2cae91[_0x60f6('0x81')],_0x2cae91['bucket'],_0x577753[_0x60f6('0x55')],_0x2cae91[_0x60f6('0x82')]);}else{logger[_0x60f6('0x6b')](util['format'](_0x60f6('0x92'),_0x297851[_0x60f6('0x4d')]['id']));return{'transcribeStatus':_0x60f6('0x93')};}})[_0x60f6('0x2a')](function(_0x18b5f7){if(_0x18b5f7){_0x18b5f7[_0x60f6('0x94')]=_0x297851[_0x60f6('0x51')][_0x60f6('0x95')];return _0x577753[_0x60f6('0x96')](_0x18b5f7);}})[_0x60f6('0x2a')](respondWithResult(_0x3f6a3c,null))['catch'](handleError(_0x3f6a3c,null));};function writeFile(_0x4cad2f,_0xe067f6){return new Promise(function(_0xbeab3e,_0x24947b){fs[_0x60f6('0x97')](_0xe067f6,_0x4cad2f,function(_0xd8c624,_0x4d60fb){if(_0xd8c624){return _0x24947b(_0xd8c624);}else{return _0xbeab3e(_0x4d60fb);}});});}exports[_0x60f6('0x98')]=function(_0x513308,_0x3a7388,_0x3c2d92){return db[_0x60f6('0x31')]['findOne']({'where':{'id':_0x513308[_0x60f6('0x4d')]['id']}})[_0x60f6('0x2a')](handleEntityNotFound(_0x3a7388))[_0x60f6('0x2a')](function(_0x4f2a7d){if(_0x4f2a7d&&_0x4f2a7d[_0x60f6('0x99')]){var _0x36a4a4=_0x4f2a7d['fileText'];var _0x32b337=config[_0x60f6('0x9a')]+_0x60f6('0x9b')+_0x4f2a7d['id']+'.txt';if(fs['existsSync'](_0x32b337)){return _0x32b337;}return writeFile(_0x36a4a4,_0x32b337)[_0x60f6('0x2a')](function(){return _0x32b337;});}else{throw new db['Sequelize'][(_0x60f6('0x5c'))](_0x60f6('0x9c'));}})[_0x60f6('0x2a')](function(_0xbe1320){return _0x3a7388[_0x60f6('0x53')](_0xbe1320);})['catch'](handleError(_0x3a7388));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8d7e69e..4fdad71 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 _0x50c1=['transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x581160,_0x4b5a6a){var _0x28941c=function(_0x18b860){while(--_0x18b860){_0x581160['push'](_0x581160['shift']());}};_0x28941c(++_0x4b5a6a);}(_0x50c1,0x1a5));var _0x150c=function(_0xa75988,_0x38016c){_0xa75988=_0xa75988-0x0;var _0x504698=_0x50c1[_0xa75988];return _0x504698;};'use strict';var attributes=require(_0x150c('0x0'));module['exports']=function(_0x47d48d,_0x33d11f){return _0x47d48d[_0x150c('0x1')](_0x150c('0x2'),attributes,{'tableName':_0x150c('0x3'),'paranoid':![],'indexes':[{'name':_0x150c('0x4'),'fields':[_0x150c('0x4')]},{'name':_0x150c('0x5'),'fields':[_0x150c('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2cb=['uniqueid','exports','VoiceRecording'];(function(_0x1b954b,_0x5441d3){var _0x32abd3=function(_0x2bee19){while(--_0x2bee19){_0x1b954b['push'](_0x1b954b['shift']());}};_0x32abd3(++_0x5441d3);}(_0xf2cb,0x130));var _0xbf2c=function(_0x80c3ab,_0x3eaf75){_0x80c3ab=_0x80c3ab-0x0;var _0x112dfa=_0xf2cb[_0x80c3ab];return _0x112dfa;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xbf2c('0x0')]=function(_0x5e5c76,_0x15aa19){return _0x5e5c76['define'](_0xbf2c('0x1'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xbf2c('0x2'),'fields':[_0xbf2c('0x2')]},{'name':'transcribeStatus','fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 49eaad2..0d7b260 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 _0xcaf2=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','recording','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','stringify','catch'];(function(_0xac87ee,_0x1c5811){var _0xc42431=function(_0xd5fb42){while(--_0xd5fb42){_0xac87ee['push'](_0xac87ee['shift']());}};_0xc42431(++_0x1c5811);}(_0xcaf2,0x8a));var _0x2caf=function(_0x1d13c8,_0x1554e6){_0x1d13c8=_0x1d13c8-0x0;var _0x3a3b03=_0xcaf2[_0x1d13c8];return _0x3a3b03;};'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);});});}exports['UpdateVoiceRecording']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['update'](_0x4a33fc[_0x2caf('0x15')],{'raw':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc['options'][_0x2caf('0x18')]||null:null,'attributes':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x19')]||null:null,'limit':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x1a')]||null:null})[_0x2caf('0xa')](function(_0x3332b1){logger[_0x2caf('0xb')](_0x2caf('0x1b'),_0x4a33fc);logger['debug'](_0x2caf('0x1b'),_0x4a33fc,JSON[_0x2caf('0x1c')](_0x3332b1));_0x58047b(_0x3332b1);})[_0x2caf('0x1d')](function(_0x401ea2){logger[_0x2caf('0x10')](_0x2caf('0x1b'),_0x401ea2[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x401ea2[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1e')]=function(_0x5ad211){var _0x6a32ac=this;return new Promise(function(_0x325eda,_0xbefce6){var _0x37b08f=require(_0x2caf('0x1f'));var _0x17d3c6;return db[_0x2caf('0x20')][_0x2caf('0x21')]({'attributes':['id',_0x2caf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x2caf('0xa')](function(_0x30da75){_0x17d3c6=_0x30da75;return db[_0x2caf('0x14')][_0x2caf('0x23')](_0x5ad211['body']);})[_0x2caf('0xa')](function(_0xda0ec5){if(_0x17d3c6[_0x2caf('0x22')]&&fs[_0x2caf('0x24')](_0xda0ec5[_0x2caf('0x25')])){var _0x1f52bf=util[_0x2caf('0x26')]('%s.cypher',_0xda0ec5[_0x2caf('0x25')]);return _0x37b08f[_0x2caf('0x27')](_0xda0ec5['value'],_0x1f52bf,config[_0x2caf('0x28')][_0x2caf('0x29')])[_0x2caf('0xa')](function(){fs['unlink'](_0xda0ec5[_0x2caf('0x25')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0xda0ec5;});}return _0xda0ec5;})[_0x2caf('0xa')](function(_0x28b715){logger[_0x2caf('0xb')](_0x2caf('0x1e'),_0x5ad211);logger[_0x2caf('0xe')](_0x2caf('0x1e'),_0x5ad211,JSON[_0x2caf('0x1c')](_0x28b715));_0x325eda(_0x28b715);})[_0x2caf('0x1d')](function(_0x20818e){logger['error'](_0x2caf('0x1e'),_0x20818e[_0x2caf('0x12')],_0x5ad211);_0xbefce6(_0x6a32ac[_0x2caf('0x10')](0x1f4,_0x20818e[_0x2caf('0x12')]));});});}; \ No newline at end of file +var _0xfcbb=['VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','recording','unlink','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x8dd419,_0x58acff){var _0x4fadf8=function(_0x47a697){while(--_0x47a697){_0x8dd419['push'](_0x8dd419['shift']());}};_0x4fadf8(++_0x58acff);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x23bb42,_0x5c0a10){_0x23bb42=_0x23bb42-0x0;var _0x3355c2=_0xfcbb[_0x23bb42];return _0x3355c2;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['where']||null:null,'attributes':_0xba1d6['options']?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1a')]||null:null,'limit':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1b')]||null:null})['then'](function(_0x365d6c){logger[_0xbfcb('0xb')](_0xbfcb('0x16'),_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x365d6c));_0x3404aa(_0x365d6c);})[_0xbfcb('0x15')](function(_0x14e43c){logger[_0xbfcb('0x10')](_0xbfcb('0x16'),_0x14e43c[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x14e43c[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x1c')]=function(_0x3e954d){var _0x2a1272=this;return new Promise(function(_0x5cd703,_0x3465f5){var _0x2881f8=require('../../components/encryptor');var _0x64a69;return db[_0xbfcb('0x1d')][_0xbfcb('0x1e')]({'attributes':['id',_0xbfcb('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xbfcb('0xa')](function(_0x3542e9){_0x64a69=_0x3542e9;return db[_0xbfcb('0x17')][_0xbfcb('0x20')](_0x3e954d[_0xbfcb('0x21')]);})[_0xbfcb('0xa')](function(_0x59719b){if(_0x64a69[_0xbfcb('0x1f')]&&fs[_0xbfcb('0x22')](_0x59719b[_0xbfcb('0x23')])){var _0x43de3c=util[_0xbfcb('0x24')](_0xbfcb('0x25'),_0x59719b[_0xbfcb('0x23')]);return _0x2881f8[_0xbfcb('0x26')](_0x59719b[_0xbfcb('0x23')],_0x43de3c,config['secrets'][_0xbfcb('0x27')])[_0xbfcb('0xa')](function(){fs[_0xbfcb('0x28')](_0x59719b[_0xbfcb('0x23')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x59719b;});}return _0x59719b;})[_0xbfcb('0xa')](function(_0x35925b){logger[_0xbfcb('0xb')](_0xbfcb('0x1c'),_0x3e954d);logger[_0xbfcb('0xd')](_0xbfcb('0x1c'),_0x3e954d,JSON[_0xbfcb('0xf')](_0x35925b));_0x5cd703(_0x35925b);})['catch'](function(_0x504d81){logger['error'](_0xbfcb('0x1c'),_0x504d81['message'],_0x3e954d);_0x3465f5(_0x2a1272[_0xbfcb('0x10')](0x1f4,_0x504d81[_0xbfcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e2aff2e..350b28a 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 _0x48b8=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x1f8f97,_0x1c8de4){var _0x59871e=function(_0x4513ad){while(--_0x4513ad){_0x1f8f97['push'](_0x1f8f97['shift']());}};_0x59871e(++_0x1c8de4);}(_0x48b8,0x1ab));var _0x848b=function(_0x11c50d,_0x318b9d){_0x11c50d=_0x11c50d-0x0;var _0x5cce3c=_0x48b8[_0x11c50d];return _0x5cce3c;};'use strict';var multer=require(_0x848b('0x0'));var util=require('util');var path=require(_0x848b('0x1'));var timeout=require(_0x848b('0x2'));var express=require(_0x848b('0x3'));var router=express['Router']();var fs_extra=require(_0x848b('0x4'));var auth=require(_0x848b('0x5'));var interaction=require(_0x848b('0x6'));var config=require(_0x848b('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x848b('0x8')]('/',auth[_0x848b('0x9')](),controller[_0x848b('0xa')]);router['get']('/describe',auth[_0x848b('0x9')](),controller[_0x848b('0xb')]);router[_0x848b('0x8')](_0x848b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x848b('0xd')]('/',auth['isAuthenticated'](),controller[_0x848b('0xe')]);router[_0x848b('0xf')](_0x848b('0xc'),auth['isAuthenticated'](),controller[_0x848b('0x10')]);router[_0x848b('0x11')]('/:id',auth[_0x848b('0x9')](),controller[_0x848b('0x12')]);module[_0x848b('0x13')]=router; \ No newline at end of file +var _0xcb40=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xcb40,0x113));var _0x0cb4=function(_0x334db7,_0x597e55){_0x334db7=_0x334db7-0x0;var _0x1cb354=_0xcb40[_0x334db7];return _0x1cb354;};'use strict';var multer=require(_0x0cb4('0x0'));var util=require('util');var path=require(_0x0cb4('0x1'));var timeout=require(_0x0cb4('0x2'));var express=require('express');var router=express[_0x0cb4('0x3')]();var fs_extra=require(_0x0cb4('0x4'));var auth=require(_0x0cb4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0cb4('0x6'));var controller=require(_0x0cb4('0x7'));router[_0x0cb4('0x8')]('/',auth[_0x0cb4('0x9')](),controller[_0x0cb4('0xa')]);router[_0x0cb4('0x8')](_0x0cb4('0xb'),auth['isAuthenticated'](),controller[_0x0cb4('0xc')]);router['get'](_0x0cb4('0xd'),auth[_0x0cb4('0x9')](),controller[_0x0cb4('0xe')]);router[_0x0cb4('0xf')]('/',auth[_0x0cb4('0x9')](),controller[_0x0cb4('0x10')]);router[_0x0cb4('0x11')](_0x0cb4('0xd'),auth[_0x0cb4('0x9')](),controller[_0x0cb4('0x12')]);router['delete'](_0x0cb4('0xd'),auth[_0x0cb4('0x9')](),controller[_0x0cb4('0x13')]);module[_0x0cb4('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index c021362..06124f8 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 _0xd511=['exports','blind','attended','STRING','Yes'];(function(_0x350b50,_0x11b5bf){var _0x5f589b=function(_0x215adf){while(--_0x215adf){_0x350b50['push'](_0x350b50['shift']());}};_0x5f589b(++_0x11b5bf);}(_0xd511,0x1ef));var _0x1d51=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd511[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1d51('0x0')]={'type':{'type':Sequelize['ENUM'](_0x1d51('0x1'),_0x1d51('0x2'))},'result':{'type':Sequelize[_0x1d51('0x3')]},'transfererchannel':{'type':Sequelize[_0x1d51('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x1d51('0x3')]},'transferercalleridname':{'type':Sequelize[_0x1d51('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1d51('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x1d51('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x1d51('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x1d51('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x1d51('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1d51('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x1d51('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1d51('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x1d51('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x1d51('0x4'),'No')},'context':{'type':Sequelize[_0x1d51('0x3')]},'extension':{'type':Sequelize[_0x1d51('0x3')]}}; \ No newline at end of file +var _0x6d9f=['STRING','Yes','sequelize','moment','exports','ENUM','attended'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x6d9f,0x72));var _0xf6d9=function(_0x1222f3,_0x4c9b6f){_0x1222f3=_0x1222f3-0x0;var _0x279c05=_0x6d9f[_0x1222f3];return _0x279c05;};'use strict';var Sequelize=require(_0xf6d9('0x0'));var moment=require(_0xf6d9('0x1'));module[_0xf6d9('0x2')]={'type':{'type':Sequelize[_0xf6d9('0x3')]('blind',_0xf6d9('0x4'))},'result':{'type':Sequelize[_0xf6d9('0x5')]},'transfererchannel':{'type':Sequelize[_0xf6d9('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xf6d9('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xf6d9('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xf6d9('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xf6d9('0x5')]},'transfererexten':{'type':Sequelize[_0xf6d9('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xf6d9('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf6d9('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xf6d9('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf6d9('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xf6d9('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xf6d9('0x5')]},'transfereeexten':{'type':Sequelize[_0xf6d9('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf6d9('0x5')]},'isexternal':{'type':Sequelize[_0xf6d9('0x3')](_0xf6d9('0x6'),'No')},'context':{'type':Sequelize[_0xf6d9('0x5')]},'extension':{'type':Sequelize[_0xf6d9('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index fac7e1e..a666584 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 _0x5de5=['Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','params','keys','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x41ca41,_0x2a2e62){var _0x22a2f0=function(_0x5bfcdb){while(--_0x5bfcdb){_0x41ca41['push'](_0x41ca41['shift']());}};_0x22a2f0(++_0x2a2e62);}(_0x5de5,0x1b5));var _0x55de=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5de5[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x55de('0x0'));var rimraf=require(_0x55de('0x1'));var zipdir=require(_0x55de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x55de('0x3'));var moment=require(_0x55de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x55de('0x5'));var util=require(_0x55de('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x55de('0x7'));var ejs=require(_0x55de('0x8'));var fs=require('fs');var fs_extra=require(_0x55de('0x9'));var _=require('lodash');var squel=require(_0x55de('0xa'));var crypto=require(_0x55de('0xb'));var jsforce=require(_0x55de('0xc'));var deskjs=require(_0x55de('0xd'));var toCsv=require(_0x55de('0x7'));var querystring=require(_0x55de('0xe'));var Papa=require(_0x55de('0xf'));var Redis=require(_0x55de('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x55de('0x11'));var as=require(_0x55de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55de('0x13'))(_0x55de('0x14'));var utils=require(_0x55de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x55de('0x16'));var db=require(_0x55de('0x17'))['db'];function respondWithStatusCode(_0x19c20c,_0x28ccfe){_0x28ccfe=_0x28ccfe||0xcc;return function(_0x1fd077){if(_0x1fd077){return _0x19c20c[_0x55de('0x18')](_0x28ccfe);}return _0x19c20c[_0x55de('0x19')](_0x28ccfe)['end']();};}function respondWithResult(_0x25e322,_0x155c87){_0x155c87=_0x155c87||0xc8;return function(_0x2c0f3b){if(_0x2c0f3b){return _0x25e322['status'](_0x155c87)['json'](_0x2c0f3b);}};}function respondWithFilteredResult(_0x5abbb5,_0x9b7532){return function(_0x376a55){if(_0x376a55){var _0x1d9476=typeof _0x9b7532[_0x55de('0x1a')]===_0x55de('0x1b')&&typeof _0x9b7532[_0x55de('0x1c')]===_0x55de('0x1b');var _0x5f2eb5=_0x376a55[_0x55de('0x1d')];var _0x5867ea=_0x1d9476?0x0:_0x9b7532[_0x55de('0x1a')];var _0x290ea6=_0x1d9476?_0x376a55[_0x55de('0x1d')]:_0x9b7532['offset']+_0x9b7532[_0x55de('0x1c')];var _0x4136f0;if(_0x290ea6>=_0x5f2eb5){_0x290ea6=_0x5f2eb5;_0x4136f0=0xc8;}else{_0x4136f0=0xce;}_0x5abbb5['status'](_0x4136f0);return _0x5abbb5[_0x55de('0x1e')](_0x55de('0x1f'),_0x5867ea+'-'+_0x290ea6+'/'+_0x5f2eb5)[_0x55de('0x20')](_0x376a55);}return null;};}function patchUpdates(_0x536ee6){return function(_0x177a20){try{jsonpatch[_0x55de('0x21')](_0x177a20,_0x536ee6,!![]);}catch(_0x55fad1){return BPromise[_0x55de('0x22')](_0x55fad1);}return _0x177a20[_0x55de('0x23')]();};}function saveUpdates(_0x13dfb1,_0x35711d){return function(_0x3f79ae){if(_0x3f79ae){return _0x3f79ae[_0x55de('0x24')](_0x13dfb1)[_0x55de('0x25')](function(_0x78189b){return _0x78189b;});}return null;};}function removeEntity(_0x2da065,_0x146526){return function(_0x2b3b38){if(_0x2b3b38){return _0x2b3b38[_0x55de('0x26')]()[_0x55de('0x25')](function(){_0x2da065['status'](0xcc)[_0x55de('0x27')]();});}};}function handleEntityNotFound(_0x54372f,_0x5b55c7){return function(_0x3ba0bc){if(!_0x3ba0bc){_0x54372f[_0x55de('0x18')](0x194);}return _0x3ba0bc;};}function handleError(_0x341f61,_0x13df0f){_0x13df0f=_0x13df0f||0x1f4;return function(_0x55eb1d){logger[_0x55de('0x28')](_0x55eb1d[_0x55de('0x29')]);if(_0x55eb1d[_0x55de('0x2a')]){delete _0x55eb1d[_0x55de('0x2a')];}_0x341f61[_0x55de('0x19')](_0x13df0f)[_0x55de('0x2b')](_0x55eb1d);};}exports[_0x55de('0x2c')]=function(_0xf4ab91,_0x1ab25c){var _0x186a15={},_0x5b4af5={},_0x2d8334={'count':0x0,'rows':[]};var _0x2fec69=_[_0x55de('0x2d')](db[_0x55de('0x2e')][_0x55de('0x2f')],function(_0xe949d1){return{'name':_0xe949d1[_0x55de('0x30')],'type':_0xe949d1[_0x55de('0x31')][_0x55de('0x32')]};});_0x5b4af5[_0x55de('0x33')]=_[_0x55de('0x2d')](_0x2fec69,'name');_0x5b4af5['query']=_['keys'](_0xf4ab91[_0x55de('0x34')]);_0x5b4af5[_0x55de('0x35')]=_[_0x55de('0x36')](_0x5b4af5[_0x55de('0x33')],_0x5b4af5['query']);_0x186a15[_0x55de('0x37')]=_['intersection'](_0x5b4af5['model'],qs[_0x55de('0x38')](_0xf4ab91[_0x55de('0x34')][_0x55de('0x38')]));_0x186a15[_0x55de('0x37')]=_0x186a15[_0x55de('0x37')][_0x55de('0x39')]?_0x186a15['attributes']:_0x5b4af5[_0x55de('0x33')];if(!_0xf4ab91[_0x55de('0x34')][_0x55de('0x3a')](_0x55de('0x3b'))){_0x186a15[_0x55de('0x1c')]=qs[_0x55de('0x1c')](_0xf4ab91[_0x55de('0x34')][_0x55de('0x1c')]);_0x186a15['offset']=qs['offset'](_0xf4ab91['query'][_0x55de('0x1a')]);}_0x186a15[_0x55de('0x3c')]=qs[_0x55de('0x3d')](_0xf4ab91[_0x55de('0x34')]['sort']);_0x186a15[_0x55de('0x3e')]=qs[_0x55de('0x35')](_[_0x55de('0x3f')](_0xf4ab91[_0x55de('0x34')],_0x5b4af5[_0x55de('0x35')]),_0x2fec69);if(_0xf4ab91['query']['filter']){_0x186a15['where']=_[_0x55de('0x40')](_0x186a15[_0x55de('0x3e')],{'$or':_[_0x55de('0x2d')](_0x2fec69,function(_0x3fa160){if(_0x3fa160[_0x55de('0x31')]!==_0x55de('0x41')){var _0x3d3d81={};_0x3d3d81[_0x3fa160[_0x55de('0x2a')]]={'$like':'%'+_0xf4ab91['query'][_0x55de('0x42')]+'%'};return _0x3d3d81;}})});}_0x186a15=_[_0x55de('0x40')]({},_0x186a15,_0xf4ab91['options']);var _0xc4fb29={'where':_0x186a15[_0x55de('0x3e')]};return db[_0x55de('0x2e')]['count'](_0xc4fb29)[_0x55de('0x25')](function(_0x368c03){_0x2d8334['count']=_0x368c03;if(_0xf4ab91[_0x55de('0x34')][_0x55de('0x43')]){_0x186a15[_0x55de('0x44')]=[{'all':!![]}];}return db[_0x55de('0x2e')][_0x55de('0x45')](_0x186a15);})[_0x55de('0x25')](function(_0x50dcda){_0x2d8334['rows']=_0x50dcda;return _0x2d8334;})[_0x55de('0x25')](respondWithFilteredResult(_0x1ab25c,_0x186a15))[_0x55de('0x46')](handleError(_0x1ab25c,null));};exports['show']=function(_0x2da375,_0x385128){var _0x404062={'raw':!![],'where':{'id':_0x2da375[_0x55de('0x47')]['id']}},_0x12ee8c={};_0x12ee8c['model']=_[_0x55de('0x48')](db[_0x55de('0x2e')][_0x55de('0x2f')]);_0x12ee8c[_0x55de('0x34')]=_[_0x55de('0x48')](_0x2da375['query']);_0x12ee8c['filters']=_['intersection'](_0x12ee8c[_0x55de('0x33')],_0x12ee8c[_0x55de('0x34')]);_0x404062[_0x55de('0x37')]=_['intersection'](_0x12ee8c[_0x55de('0x33')],qs[_0x55de('0x38')](_0x2da375[_0x55de('0x34')][_0x55de('0x38')]));_0x404062[_0x55de('0x37')]=_0x404062[_0x55de('0x37')]['length']?_0x404062[_0x55de('0x37')]:_0x12ee8c[_0x55de('0x33')];if(_0x2da375[_0x55de('0x34')][_0x55de('0x43')]){_0x404062[_0x55de('0x44')]=[{'all':!![]}];}_0x404062=_[_0x55de('0x40')]({},_0x404062,_0x2da375[_0x55de('0x49')]);return db[_0x55de('0x2e')][_0x55de('0x4a')](_0x404062)['then'](handleEntityNotFound(_0x385128,null))[_0x55de('0x25')](respondWithResult(_0x385128,null))['catch'](handleError(_0x385128,null));};exports[_0x55de('0x4b')]=function(_0x1a19d7,_0x231029){return db[_0x55de('0x2e')][_0x55de('0x4b')](_0x1a19d7[_0x55de('0x4c')],{})['then'](respondWithResult(_0x231029,0xc9))[_0x55de('0x46')](handleError(_0x231029,null));};exports[_0x55de('0x24')]=function(_0x21e60e,_0x27b1ad){if(_0x21e60e['body']['id']){delete _0x21e60e[_0x55de('0x4c')]['id'];}return db[_0x55de('0x2e')][_0x55de('0x4a')]({'where':{'id':_0x21e60e[_0x55de('0x47')]['id']}})[_0x55de('0x25')](handleEntityNotFound(_0x27b1ad,null))[_0x55de('0x25')](saveUpdates(_0x21e60e[_0x55de('0x4c')],null))[_0x55de('0x25')](respondWithResult(_0x27b1ad,null))[_0x55de('0x46')](handleError(_0x27b1ad,null));};exports['destroy']=function(_0x415466,_0x42f4b9){return db[_0x55de('0x2e')][_0x55de('0x4a')]({'where':{'id':_0x415466[_0x55de('0x47')]['id']}})['then'](handleEntityNotFound(_0x42f4b9,null))['then'](removeEntity(_0x42f4b9,null))[_0x55de('0x46')](handleError(_0x42f4b9,null));};exports[_0x55de('0x4d')]=function(_0x19ba0f,_0xde0ae2){return db[_0x55de('0x2e')][_0x55de('0x4d')]()[_0x55de('0x25')](respondWithResult(_0xde0ae2,null))[_0x55de('0x46')](handleError(_0xde0ae2,null));}; \ No newline at end of file +var _0xde51=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','options','VoiceTransferReport','includeAll','findAll','rows','catch','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','stack','name','send','index','map','rawAttributes'];(function(_0x5532c0,_0x583d6b){var _0x1766cb=function(_0x16467c){while(--_0x16467c){_0x5532c0['push'](_0x5532c0['shift']());}};_0x1766cb(++_0x583d6b);}(_0xde51,0x17f));var _0x1de5=function(_0x5deda9,_0xb06c05){_0x5deda9=_0x5deda9-0x0;var _0x453001=_0xde51[_0x5deda9];return _0x453001;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1de5('0x0'));var jsonpatch=require(_0x1de5('0x1'));var rp=require('request-promise');var moment=require(_0x1de5('0x2'));var BPromise=require(_0x1de5('0x3'));var Mustache=require(_0x1de5('0x4'));var util=require(_0x1de5('0x5'));var path=require(_0x1de5('0x6'));var sox=require(_0x1de5('0x7'));var csv=require(_0x1de5('0x8'));var ejs=require(_0x1de5('0x9'));var fs=require('fs');var fs_extra=require(_0x1de5('0xa'));var _=require('lodash');var squel=require(_0x1de5('0xb'));var crypto=require('crypto');var jsforce=require(_0x1de5('0xc'));var deskjs=require(_0x1de5('0xd'));var toCsv=require(_0x1de5('0x8'));var querystring=require('querystring');var Papa=require(_0x1de5('0xe'));var Redis=require(_0x1de5('0xf'));var authService=require(_0x1de5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1de5('0x11'));var hardwareService=require(_0x1de5('0x12'));var logger=require(_0x1de5('0x13'))(_0x1de5('0x14'));var utils=require(_0x1de5('0x15'));var config=require(_0x1de5('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x244010,_0xf2a780){_0xf2a780=_0xf2a780||0xcc;return function(_0x4a6aa4){if(_0x4a6aa4){return _0x244010[_0x1de5('0x17')](_0xf2a780);}return _0x244010[_0x1de5('0x18')](_0xf2a780)[_0x1de5('0x19')]();};}function respondWithResult(_0x50eedc,_0x124b63){_0x124b63=_0x124b63||0xc8;return function(_0x142885){if(_0x142885){return _0x50eedc[_0x1de5('0x18')](_0x124b63)[_0x1de5('0x1a')](_0x142885);}};}function respondWithFilteredResult(_0x3daae5,_0xf0858f){return function(_0x187d33){if(_0x187d33){var _0x562c94=typeof _0xf0858f[_0x1de5('0x1b')]===_0x1de5('0x1c')&&typeof _0xf0858f['limit']==='undefined';var _0x4e5b92=_0x187d33[_0x1de5('0x1d')];var _0x3764d7=_0x562c94?0x0:_0xf0858f[_0x1de5('0x1b')];var _0x1db7c5=_0x562c94?_0x187d33[_0x1de5('0x1d')]:_0xf0858f[_0x1de5('0x1b')]+_0xf0858f[_0x1de5('0x1e')];var _0x583a7c;if(_0x1db7c5>=_0x4e5b92){_0x1db7c5=_0x4e5b92;_0x583a7c=0xc8;}else{_0x583a7c=0xce;}_0x3daae5[_0x1de5('0x18')](_0x583a7c);return _0x3daae5[_0x1de5('0x1f')](_0x1de5('0x20'),_0x3764d7+'-'+_0x1db7c5+'/'+_0x4e5b92)[_0x1de5('0x1a')](_0x187d33);}return null;};}function patchUpdates(_0x426e02){return function(_0x38d595){try{jsonpatch['apply'](_0x38d595,_0x426e02,!![]);}catch(_0x1322ea){return BPromise[_0x1de5('0x21')](_0x1322ea);}return _0x38d595['save']();};}function saveUpdates(_0x21f980,_0x59e19c){return function(_0x2d8719){if(_0x2d8719){return _0x2d8719[_0x1de5('0x22')](_0x21f980)['then'](function(_0x3ae6c6){return _0x3ae6c6;});}return null;};}function removeEntity(_0x2b99e2,_0x70d9a9){return function(_0x215e35){if(_0x215e35){return _0x215e35[_0x1de5('0x23')]()[_0x1de5('0x24')](function(){_0x2b99e2[_0x1de5('0x18')](0xcc)[_0x1de5('0x19')]();});}};}function handleEntityNotFound(_0x1356ba,_0x5ae18d){return function(_0x4d426d){if(!_0x4d426d){_0x1356ba[_0x1de5('0x17')](0x194);}return _0x4d426d;};}function handleError(_0x4d57f9,_0x10727e){_0x10727e=_0x10727e||0x1f4;return function(_0x5148a5){logger['error'](_0x5148a5[_0x1de5('0x25')]);if(_0x5148a5[_0x1de5('0x26')]){delete _0x5148a5[_0x1de5('0x26')];}_0x4d57f9['status'](_0x10727e)[_0x1de5('0x27')](_0x5148a5);};}exports[_0x1de5('0x28')]=function(_0x5561ab,_0x227454){var _0x32769d={},_0x12acf6={},_0x41c785={'count':0x0,'rows':[]};var _0x487873=_[_0x1de5('0x29')](db['VoiceTransferReport'][_0x1de5('0x2a')],function(_0x4a09a3){return{'name':_0x4a09a3[_0x1de5('0x2b')],'type':_0x4a09a3[_0x1de5('0x2c')][_0x1de5('0x2d')]};});_0x12acf6[_0x1de5('0x2e')]=_[_0x1de5('0x29')](_0x487873,_0x1de5('0x26'));_0x12acf6[_0x1de5('0x2f')]=_[_0x1de5('0x30')](_0x5561ab[_0x1de5('0x2f')]);_0x12acf6[_0x1de5('0x31')]=_[_0x1de5('0x32')](_0x12acf6[_0x1de5('0x2e')],_0x12acf6[_0x1de5('0x2f')]);_0x32769d[_0x1de5('0x33')]=_[_0x1de5('0x32')](_0x12acf6[_0x1de5('0x2e')],qs[_0x1de5('0x34')](_0x5561ab['query'][_0x1de5('0x34')]));_0x32769d['attributes']=_0x32769d[_0x1de5('0x33')][_0x1de5('0x35')]?_0x32769d[_0x1de5('0x33')]:_0x12acf6[_0x1de5('0x2e')];if(!_0x5561ab[_0x1de5('0x2f')][_0x1de5('0x36')](_0x1de5('0x37'))){_0x32769d[_0x1de5('0x1e')]=qs[_0x1de5('0x1e')](_0x5561ab[_0x1de5('0x2f')][_0x1de5('0x1e')]);_0x32769d[_0x1de5('0x1b')]=qs['offset'](_0x5561ab['query'][_0x1de5('0x1b')]);}_0x32769d[_0x1de5('0x38')]=qs[_0x1de5('0x39')](_0x5561ab[_0x1de5('0x2f')][_0x1de5('0x39')]);_0x32769d['where']=qs[_0x1de5('0x31')](_[_0x1de5('0x3a')](_0x5561ab[_0x1de5('0x2f')],_0x12acf6[_0x1de5('0x31')]),_0x487873);if(_0x5561ab[_0x1de5('0x2f')][_0x1de5('0x3b')]){_0x32769d['where']=_['merge'](_0x32769d['where'],{'$or':_[_0x1de5('0x29')](_0x487873,function(_0x19fc7c){if(_0x19fc7c[_0x1de5('0x2c')]!=='VIRTUAL'){var _0x1953d9={};_0x1953d9[_0x19fc7c[_0x1de5('0x26')]]={'$like':'%'+_0x5561ab['query']['filter']+'%'};return _0x1953d9;}})});}_0x32769d=_['merge']({},_0x32769d,_0x5561ab[_0x1de5('0x3c')]);var _0x22f3b6={'where':_0x32769d['where']};return db[_0x1de5('0x3d')][_0x1de5('0x1d')](_0x22f3b6)[_0x1de5('0x24')](function(_0x47d759){_0x41c785[_0x1de5('0x1d')]=_0x47d759;if(_0x5561ab['query'][_0x1de5('0x3e')]){_0x32769d['include']=[{'all':!![]}];}return db[_0x1de5('0x3d')][_0x1de5('0x3f')](_0x32769d);})[_0x1de5('0x24')](function(_0x13d2fb){_0x41c785[_0x1de5('0x40')]=_0x13d2fb;return _0x41c785;})['then'](respondWithFilteredResult(_0x227454,_0x32769d))[_0x1de5('0x41')](handleError(_0x227454,null));};exports['show']=function(_0x291bf7,_0x2c4b48){var _0x56d097={'raw':!![],'where':{'id':_0x291bf7[_0x1de5('0x42')]['id']}},_0x283041={};_0x283041['model']=_[_0x1de5('0x30')](db[_0x1de5('0x3d')][_0x1de5('0x2a')]);_0x283041[_0x1de5('0x2f')]=_[_0x1de5('0x30')](_0x291bf7[_0x1de5('0x2f')]);_0x283041[_0x1de5('0x31')]=_[_0x1de5('0x32')](_0x283041[_0x1de5('0x2e')],_0x283041[_0x1de5('0x2f')]);_0x56d097[_0x1de5('0x33')]=_['intersection'](_0x283041['model'],qs[_0x1de5('0x34')](_0x291bf7[_0x1de5('0x2f')][_0x1de5('0x34')]));_0x56d097[_0x1de5('0x33')]=_0x56d097['attributes'][_0x1de5('0x35')]?_0x56d097[_0x1de5('0x33')]:_0x283041[_0x1de5('0x2e')];if(_0x291bf7[_0x1de5('0x2f')][_0x1de5('0x3e')]){_0x56d097['include']=[{'all':!![]}];}_0x56d097=_['merge']({},_0x56d097,_0x291bf7[_0x1de5('0x3c')]);return db[_0x1de5('0x3d')][_0x1de5('0x43')](_0x56d097)[_0x1de5('0x24')](handleEntityNotFound(_0x2c4b48,null))['then'](respondWithResult(_0x2c4b48,null))['catch'](handleError(_0x2c4b48,null));};exports[_0x1de5('0x44')]=function(_0x2d5716,_0x137073){return db['VoiceTransferReport'][_0x1de5('0x44')](_0x2d5716[_0x1de5('0x45')],{})['then'](respondWithResult(_0x137073,0xc9))[_0x1de5('0x41')](handleError(_0x137073,null));};exports[_0x1de5('0x22')]=function(_0x4f979e,_0x4bd8ab){if(_0x4f979e['body']['id']){delete _0x4f979e[_0x1de5('0x45')]['id'];}return db[_0x1de5('0x3d')][_0x1de5('0x43')]({'where':{'id':_0x4f979e[_0x1de5('0x42')]['id']}})['then'](handleEntityNotFound(_0x4bd8ab,null))['then'](saveUpdates(_0x4f979e[_0x1de5('0x45')],null))[_0x1de5('0x24')](respondWithResult(_0x4bd8ab,null))['catch'](handleError(_0x4bd8ab,null));};exports[_0x1de5('0x23')]=function(_0xfc9ed1,_0x496cb2){return db[_0x1de5('0x3d')]['find']({'where':{'id':_0xfc9ed1[_0x1de5('0x42')]['id']}})[_0x1de5('0x24')](handleEntityNotFound(_0x496cb2,null))['then'](removeEntity(_0x496cb2,null))[_0x1de5('0x41')](handleError(_0x496cb2,null));};exports[_0x1de5('0x46')]=function(_0x6157d2,_0x1989d6){return db[_0x1de5('0x3d')][_0x1de5('0x46')]()[_0x1de5('0x24')](respondWithResult(_0x1989d6,null))[_0x1de5('0x41')](handleError(_0x1989d6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 3d034a2..847f4bc 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 _0x3130=['VoiceTransferReport','report_call_transfer','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x24af3e,_0x33622f){var _0x1f775d=function(_0x4e00b8){while(--_0x4e00b8){_0x24af3e['push'](_0x24af3e['shift']());}};_0x1f775d(++_0x33622f);}(_0x3130,0x1ee));var _0x0313=function(_0x2734e7,_0x51bf0d){_0x2734e7=_0x2734e7-0x0;var _0x253864=_0x3130[_0x2734e7];return _0x253864;};'use strict';var _=require('lodash');var util=require(_0x0313('0x0'));var logger=require(_0x0313('0x1'))(_0x0313('0x2'));var moment=require(_0x0313('0x3'));var BPromise=require(_0x0313('0x4'));var rp=require(_0x0313('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0313('0x6'));var config=require(_0x0313('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x0313('0x8')]=function(_0x5b539d,_0x3d2843){return _0x5b539d[_0x0313('0x9')](_0x0313('0xa'),attributes,{'tableName':_0x0313('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccdf=['util','rimraf','../../config/environment','exports','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x30c7c5,_0x168208){var _0x29e24e=function(_0x427d3e){while(--_0x427d3e){_0x30c7c5['push'](_0x30c7c5['shift']());}};_0x29e24e(++_0x168208);}(_0xccdf,0x109));var _0xfccd=function(_0x3a1e46,_0x2bee6d){_0x3a1e46=_0x3a1e46-0x0;var _0x3ebbba=_0xccdf[_0x3a1e46];return _0x3ebbba;};'use strict';var _=require(_0xfccd('0x0'));var util=require(_0xfccd('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('path');var rimraf=require(_0xfccd('0x2'));var config=require(_0xfccd('0x3'));var attributes=require('./voiceTransferReport.attributes');module[_0xfccd('0x4')]=function(_0x11de25,_0x3898d8){return _0x11de25['define'](_0xfccd('0x5'),attributes,{'tableName':_0xfccd('0x6'),'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 4f550a2..42e7d44 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 _0x8bb1=['create','body','options','raw','debug','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceTransferReport'];(function(_0x42730e,_0x624c6a){var _0x1472e3=function(_0x71b562){while(--_0x71b562){_0x42730e['push'](_0x42730e['shift']());}};_0x1472e3(++_0x624c6a);}(_0x8bb1,0x1b6));var _0x18bb=function(_0x3b407e,_0xb256f4){_0x3b407e=_0x3b407e-0x0;var _0xcbba9f=_0x8bb1[_0x3b407e];return _0xcbba9f;};'use strict';var _=require(_0x18bb('0x0'));var util=require(_0x18bb('0x1'));var moment=require(_0x18bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x18bb('0x3'));var fs=require('fs');var Redis=require(_0x18bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x18bb('0x5'));var logger=require('../../config/logger')(_0x18bb('0x6'));var config=require('../../config/environment');var jayson=require(_0x18bb('0x7'));var client=jayson[_0x18bb('0x8')][_0x18bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f65e2,_0xf49083,_0x2788b6){return new BPromise(function(_0x18ce76,_0x1a5970){return client[_0x18bb('0xa')](_0x4f65e2,_0x2788b6)[_0x18bb('0xb')](function(_0xdc4eeb){logger[_0x18bb('0xc')](_0x18bb('0xd'),_0xf49083,_0x18bb('0xe'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xf49083,_0x18bb('0xe'),JSON['stringify'](_0xdc4eeb));if(_0xdc4eeb[_0x18bb('0xf')]){if(_0xdc4eeb['error'][_0x18bb('0x10')]===0x1f4){logger[_0x18bb('0xf')](_0x18bb('0xd'),_0xf49083,_0xdc4eeb[_0x18bb('0xf')]['message']);return _0x1a5970(_0xdc4eeb[_0x18bb('0xf')][_0x18bb('0x11')]);}logger[_0x18bb('0xf')](_0x18bb('0xd'),_0xf49083,_0xdc4eeb[_0x18bb('0xf')][_0x18bb('0x11')]);return _0x18ce76(_0xdc4eeb['error'][_0x18bb('0x11')]);}else{logger[_0x18bb('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0xf49083,'request\x20sent');_0x18ce76(_0xdc4eeb[_0x18bb('0x12')][_0x18bb('0x11')]);}})[_0x18bb('0x13')](function(_0x1e9f2c){logger[_0x18bb('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0xf49083,_0x1e9f2c);_0x1a5970(_0x1e9f2c);});});}exports[_0x18bb('0x14')]=function(_0x327ee5){var _0x5153f9=this;return new Promise(function(_0x2db5e0,_0x47e6e4){return db['VoiceTransferReport'][_0x18bb('0x15')](_0x327ee5[_0x18bb('0x16')],{'raw':_0x327ee5[_0x18bb('0x17')]?_0x327ee5[_0x18bb('0x17')][_0x18bb('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4cde16){logger[_0x18bb('0xc')](_0x18bb('0x14'),_0x327ee5);logger[_0x18bb('0x19')](_0x18bb('0x14'),_0x327ee5,JSON[_0x18bb('0x1a')](_0x4cde16));_0x2db5e0(_0x4cde16);})[_0x18bb('0x13')](function(_0x1c6d2e){logger['error'](_0x18bb('0x14'),_0x1c6d2e[_0x18bb('0x11')],_0x327ee5);_0x47e6e4(_0x5153f9[_0x18bb('0xf')](0x1f4,_0x1c6d2e[_0x18bb('0x11')]));});});}; \ No newline at end of file +var _0xfbf1=['../../config/environment','jayson/promise','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x206e59,_0x204450){var _0x5f0aef=function(_0x26a54d){while(--_0x26a54d){_0x206e59['push'](_0x206e59['shift']());}};_0x5f0aef(++_0x204450);}(_0xfbf1,0x116));var _0x1fbf=function(_0x183ffc,_0x459298){_0x183ffc=_0x183ffc-0x0;var _0x1f41e7=_0xfbf1[_0x183ffc];return _0x1f41e7;};'use strict';var _=require(_0x1fbf('0x0'));var util=require(_0x1fbf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1fbf('0x2'));var fs=require('fs');var Redis=require(_0x1fbf('0x3'));var db=require(_0x1fbf('0x4'))['db'];var utils=require(_0x1fbf('0x5'));var logger=require(_0x1fbf('0x6'))(_0x1fbf('0x7'));var config=require(_0x1fbf('0x8'));var jayson=require(_0x1fbf('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e5772,_0x74248b,_0x1c5bef){return new BPromise(function(_0x4a460c,_0x2315ba){return client['request'](_0x4e5772,_0x1c5bef)['then'](function(_0x18e259){logger[_0x1fbf('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x74248b,'request\x20sent');logger[_0x1fbf('0xb')](_0x1fbf('0xc'),_0x74248b,'request\x20sent',JSON[_0x1fbf('0xd')](_0x18e259));if(_0x18e259[_0x1fbf('0xe')]){if(_0x18e259[_0x1fbf('0xe')][_0x1fbf('0xf')]===0x1f4){logger['error'](_0x1fbf('0x10'),_0x74248b,_0x18e259[_0x1fbf('0xe')][_0x1fbf('0x11')]);return _0x2315ba(_0x18e259[_0x1fbf('0xe')]['message']);}logger[_0x1fbf('0xe')](_0x1fbf('0x10'),_0x74248b,_0x18e259[_0x1fbf('0xe')]['message']);return _0x4a460c(_0x18e259[_0x1fbf('0xe')]['message']);}else{logger[_0x1fbf('0xa')](_0x1fbf('0x10'),_0x74248b,'request\x20sent');_0x4a460c(_0x18e259[_0x1fbf('0x12')][_0x1fbf('0x11')]);}})['catch'](function(_0x2094df){logger[_0x1fbf('0xe')](_0x1fbf('0x10'),_0x74248b,_0x2094df);_0x2315ba(_0x2094df);});});}exports[_0x1fbf('0x13')]=function(_0x45d483){var _0x4b3a0a=this;return new Promise(function(_0x5c3238,_0x388df1){return db[_0x1fbf('0x14')][_0x1fbf('0x15')](_0x45d483['body'],{'raw':_0x45d483['options']?_0x45d483[_0x1fbf('0x16')][_0x1fbf('0x17')]===undefined?!![]:![]:!![]})[_0x1fbf('0x18')](function(_0x280951){logger[_0x1fbf('0xa')]('CreateVoiceTransferReport',_0x45d483);logger[_0x1fbf('0xb')](_0x1fbf('0x13'),_0x45d483,JSON[_0x1fbf('0xd')](_0x280951));_0x5c3238(_0x280951);})[_0x1fbf('0x19')](function(_0x9432ee){logger['error'](_0x1fbf('0x13'),_0x9432ee['message'],_0x45d483);_0x388df1(_0x4b3a0a[_0x1fbf('0xe')](0x1f4,_0x9432ee['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c250e77..15ec6c7 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 _0x91a7=['/originate','isWebrtcLicence','/hangup','isAuthenticated','hangup','/answer','answer','post','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller'];(function(_0x1c6f8,_0x18af22){var _0xc47f94=function(_0x280668){while(--_0x280668){_0x1c6f8['push'](_0x1c6f8['shift']());}};_0xc47f94(++_0x18af22);}(_0x91a7,0xe7));var _0x791a=function(_0x2b4d26,_0x279b45){_0x2b4d26=_0x2b4d26-0x0;var _0x1b5a40=_0x91a7[_0x2b4d26];return _0x1b5a40;};'use strict';var express=require('express');var router=express[_0x791a('0x0')]();var auth=require(_0x791a('0x1'));var controller=require(_0x791a('0x2'));router['post'](_0x791a('0x3'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller['originate']);router['post'](_0x791a('0x5'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x7')]);router['post'](_0x791a('0x8'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x9')]);router[_0x791a('0xa')](_0x791a('0xb'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['hold']);router[_0x791a('0xa')](_0x791a('0xc'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller[_0x791a('0xd')]);router[_0x791a('0xa')](_0x791a('0xe'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['calls']);router['post'](_0x791a('0xf'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x10')]);module[_0x791a('0x11')]=router; \ No newline at end of file +var _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0x53a0ac,_0x2cd0a8){var _0x53c13b=function(_0x1f16e1){while(--_0x1f16e1){_0x53a0ac['push'](_0x53a0ac['shift']());}};_0x53c13b(++_0x2cd0a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('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 d758896..ffb5681 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 _0x0a9a=['hold\x20executed!','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','body','length','status','json','userId','callNumber','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','answer','format','webbar:answer','answer\x20executed!','hold','hold\x20fired:'];(function(_0x4d9988,_0x457f30){var _0x32bf83=function(_0x3c53cc){while(--_0x3c53cc){_0x4d9988['push'](_0x4d9988['shift']());}};_0x32bf83(++_0x457f30);}(_0x0a9a,0x183));var _0xa0a9=function(_0x5daae7,_0x7edb4e){_0x5daae7=_0x5daae7-0x0;var _0x5ad5dd=_0x0a9a[_0x5daae7];return _0x5ad5dd;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xa0a9('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xa0a9('0x1'));var util=require(_0xa0a9('0x2'));var BPromise=require(_0xa0a9('0x3'));var jayson=require(_0xa0a9('0x4'));var amiClient=jayson['client'][_0xa0a9('0x5')]({'port':0x232a});var logger=require(_0xa0a9('0x6'))('webbarapi');var Redis=require(_0xa0a9('0x7'));config[_0xa0a9('0x8')]=_[_0xa0a9('0x9')](config[_0xa0a9('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa0a9('0xa'))(new Redis(config['redis']));var Schema=require(_0xa0a9('0xb'));var originateValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'callNumber':{'type':_0xa0a9('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xa0a9('0xe')},'callbackUrl':{'type':_0xa0a9('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':'string','required':[!![],_0xa0a9('0xf')]},'transferNumber':{'type':_0xa0a9('0xe'),'required':[!![],_0xa0a9('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x176faa,_0x48c315,_0x4a57dd){logger[_0xa0a9('0x11')](_0x176faa,_0x48c315,JSON[_0xa0a9('0x12')](_0x4a57dd));io['to'](_0x176faa)[_0xa0a9('0x13')](_0x48c315,_0x4a57dd);}function handleError(_0x16c3e3){return function(_0x568409){console[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x568409,_0x568409 instanceof RangeError);logger[_0xa0a9('0x16')](_0x568409[_0xa0a9('0x17')]);if(_0x568409 instanceof RangeError){if(_0x568409[_0xa0a9('0x18')]){delete _0x568409[_0xa0a9('0x18')];}_0x16c3e3['status'](0x194)[_0xa0a9('0x19')](_0x568409);}else{if(_0x568409[_0xa0a9('0x18')]){delete _0x568409['name'];}_0x16c3e3['status'](0x1f4)[_0xa0a9('0x19')](_0x568409);}};}function checkError(){return function(_0x1f6955){if(!_0x1f6955){throw new RangeError(_0xa0a9('0x1a'));}return _0x1f6955;};}function respondWithRpcPromise(_0x54a9a9,_0x307d7e){return new BPromise(function(_0x4e6f4c,_0x1fb36b){var _0x5e6148=amiClient;return _0x5e6148[_0xa0a9('0x1b')](_0x54a9a9,_0x307d7e)[_0xa0a9('0x1c')](function(_0x2f0b14){if(_0x2f0b14[_0xa0a9('0x16')]){if(_0x2f0b14['error'][_0xa0a9('0x1d')]===0x1f4){return _0x1fb36b(_0x2f0b14['error'][_0xa0a9('0x1e')]);}return _0x4e6f4c(_0x2f0b14[_0xa0a9('0x16')][_0xa0a9('0x1e')]);}else{_0x4e6f4c(_0x2f0b14[_0xa0a9('0x1f')]);}})['catch'](function(_0x7c1502){_0x1fb36b(_0x7c1502);});});}function getAgent(_0xe49d3b){return db[_0xa0a9('0x20')][_0xa0a9('0x21')]({'where':{'id':_0xe49d3b,'role':'agent'}})[_0xa0a9('0x1c')](checkError());}function getAgentCheckSession(_0x38e454,_0x2eae30){return new BPromise(function(_0x5c446e,_0x54125d){var _0x2b3cbb=respondWithRpcPromise(_0xa0a9('0x22'));var _0x10bbfd=getAgent(_0x38e454);Promise[_0xa0a9('0x23')]([_0x2b3cbb,_0x10bbfd])[_0xa0a9('0x1c')](function(_0xe218ff){var _0x2386c9=_0xe218ff[0x0];var _0x24e744=_0xe218ff[0x1];var _0xc6a4=_[_0xa0a9('0x24')](_0x2386c9[_0xa0a9('0x25')],function(_0x554191){return _0x554191[_0xa0a9('0x26')]==_0x24e744['id']&&_0x554191[_0xa0a9('0x27')]==_0x2eae30;});if(_0xc6a4['length']==0x1){_0x5c446e(_0x24e744);}else{_0x54125d(new RangeError(_0xa0a9('0x28')+_0x2eae30+_0xa0a9('0x29')));}});});}exports['originate']=function(_0x47c19b,_0x45374e){logger['info']('originate\x20fired:',_0x47c19b[_0xa0a9('0x2a')]);var _0x104936=originateValidation[_0xa0a9('0xb')](_0x47c19b[_0xa0a9('0x2a')]);if(_0x104936[_0xa0a9('0x2b')]>0x0){return _0x45374e[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x104936);}var _0x4bbcc2=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x539807=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x2f')];var _0x2363e6=_0x47c19b['body']['callerId'];var _0x3b1a11=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x30')];return getAgent(_0x4bbcc2)[_0xa0a9('0x1c')](function(_0x520817){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x520817[_0xa0a9('0x18')]);emit(util['format'](_0xa0a9('0x32'),_0x520817[_0xa0a9('0x18')]),_0xa0a9('0x33'),{'callNumber':_0x539807,'callerId':_0x2363e6,'callbackUrl':_0x3b1a11});return _0x45374e['status'](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x34')});})[_0xa0a9('0x35')](handleError(_0x45374e));};exports[_0xa0a9('0x36')]=function(_0x2e11dc,_0x1d6bae){logger[_0xa0a9('0x11')](_0xa0a9('0x37'),_0x2e11dc[_0xa0a9('0x2a')]);var _0x2ea301=hangupValidation[_0xa0a9('0xb')](_0x2e11dc[_0xa0a9('0x2a')]);if(_0x2ea301[_0xa0a9('0x2b')]>0x0){return _0x1d6bae[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x2ea301);}var _0x1b1aff=_0x2e11dc[_0xa0a9('0x2a')]['userId'];var _0x3f1e4f=_0x2e11dc[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x1b1aff)['then'](function(_0x757e10){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x757e10[_0xa0a9('0x18')]);emit(util['format'](_0xa0a9('0x32'),_0x757e10[_0xa0a9('0x18')]),_0xa0a9('0x38'),{'sessionId':_0x3f1e4f});return _0x1d6bae[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':'hangup\x20executed!'});})[_0xa0a9('0x35')](handleError(_0x1d6bae));};exports[_0xa0a9('0x39')]=function(_0x39c02a,_0x32d926){logger[_0xa0a9('0x11')]('answer\x20fired:',_0x39c02a[_0xa0a9('0x2a')]);var _0x11c130=answerValidation[_0xa0a9('0xb')](_0x39c02a[_0xa0a9('0x2a')]);if(_0x11c130[_0xa0a9('0x2b')]>0x0){return _0x32d926['status'](0x190)[_0xa0a9('0x2d')](_0x11c130);}var _0x1c8760=_0x39c02a['body']['userId'];var _0x41cd22=_0x39c02a[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x1c8760)[_0xa0a9('0x1c')](function(_0x4a128f){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x4a128f[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x4a128f[_0xa0a9('0x18')]),_0xa0a9('0x3b'),{'sessionId':_0x41cd22});return _0x32d926[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x3c')});})[_0xa0a9('0x35')](handleError(_0x32d926));};exports[_0xa0a9('0x3d')]=function(_0x2fcc76,_0x3bb0fb){logger[_0xa0a9('0x11')](_0xa0a9('0x3e'),_0x2fcc76[_0xa0a9('0x2a')]);var _0x54e917=holdValidation[_0xa0a9('0xb')](_0x2fcc76['body']);if(_0x54e917[_0xa0a9('0x2b')]>0x0){return _0x3bb0fb[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x54e917);}var _0x132eca=_0x2fcc76[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x38cb0d=_0x2fcc76[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x132eca)['then'](function(_0x5d4162){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x5d4162['name']);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x5d4162[_0xa0a9('0x18')]),'webbar:hold',{'sessionId':_0x38cb0d});return _0x3bb0fb[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x3f')});})[_0xa0a9('0x35')](handleError(_0x3bb0fb));};exports['unhold']=function(_0x398501,_0x45db88){logger[_0xa0a9('0x11')](_0xa0a9('0x40'),_0x398501[_0xa0a9('0x2a')]);var _0x41128b=unholdValidation[_0xa0a9('0xb')](_0x398501['body']);if(_0x41128b[_0xa0a9('0x2b')]>0x0){return _0x45db88[_0xa0a9('0x2c')](0x190)['json'](_0x41128b);}var _0x2cbd5e=_0x398501[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x506168=_0x398501['body'][_0xa0a9('0x27')];return getAgent(_0x2cbd5e)[_0xa0a9('0x1c')](function(_0x3f67ac){logger[_0xa0a9('0x11')]('entityFound:',_0x3f67ac['name']);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x3f67ac['name']),'webbar:unhold',{'sessionId':_0x506168});return _0x45db88[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x41')});})[_0xa0a9('0x35')](handleError(_0x45db88));};exports[_0xa0a9('0x42')]=function(_0x361bf1,_0x24af09){logger[_0xa0a9('0x11')](_0xa0a9('0x43'),_0x24af09[_0xa0a9('0x2a')]);var _0x2da124=callsValidation['validate'](_0x361bf1[_0xa0a9('0x2a')]);if(_0x2da124[_0xa0a9('0x2b')]>0x0){return _0x24af09[_0xa0a9('0x2c')](0x190)['json'](_0x2da124);}var _0x426ddc=_0x361bf1[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x4a1912=respondWithRpcPromise(_0xa0a9('0x22'));var _0x18893f=getAgent(_0x426ddc);return Promise[_0xa0a9('0x23')]([_0x4a1912,_0x18893f])[_0xa0a9('0x1c')](function(_0x3d47b3){var _0x47107f=_0x3d47b3[0x0];var _0x12f97d=_0x3d47b3[0x1];var _0x577c1f=_[_0xa0a9('0x24')](_0x47107f[_0xa0a9('0x25')],function(_0x3f6ef4){return _0x3f6ef4[_0xa0a9('0x26')]==_0x12f97d['id'];});return _0x24af09[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'count':_0x577c1f[_0xa0a9('0x2b')],'rows':_0x577c1f});})['catch'](handleError(_0x24af09));};exports['conference']=function(_0x4a2307,_0x40d0f5){logger['info'](_0xa0a9('0x44'),_0x4a2307['body']);var _0x349f1b=conferenceValidation[_0xa0a9('0xb')](_0x4a2307[_0xa0a9('0x2a')]);if(_0x349f1b[_0xa0a9('0x2b')]>0x0){return _0x40d0f5[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x349f1b);}var _0x1c7191=_0x4a2307[_0xa0a9('0x2a')]['userId'];return getAgent(_0x1c7191)['then'](function(_0x471e1a){logger['info'](_0xa0a9('0x31'),_0x471e1a[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')]('user:%s',_0x471e1a[_0xa0a9('0x18')]),'webbar:conference');return _0x40d0f5[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x45')});})['catch'](handleError(_0x40d0f5));};exports[_0xa0a9('0x46')]=function(_0x478b4e,_0x2648e4){logger['info'](_0xa0a9('0x47'),_0x478b4e['body']);var _0x662a0=transferValidation[_0xa0a9('0xb')](_0x478b4e[_0xa0a9('0x2a')]);if(_0x662a0[_0xa0a9('0x2b')]>0x0){return _0x2648e4[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x662a0);}var _0x4cc06d=_0x478b4e[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x2e6d3f=_0x478b4e['body'][_0xa0a9('0x27')];var _0x184b0e=_0x478b4e[_0xa0a9('0x2a')][_0xa0a9('0x48')];return getAgent(_0x4cc06d)[_0xa0a9('0x1c')](function(_0x5581c7){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x5581c7[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x5581c7[_0xa0a9('0x18')]),_0xa0a9('0x49'),{'sessionId':_0x2e6d3f,'transferNumber':_0x184b0e});return _0x2648e4[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x4a')});})['catch'](handleError(_0x2648e4));}; \ No newline at end of file +var _0xde2c=['name','send','status','request','error','code','message','result','catch','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','userId','callNumber','callerId','callbackUrl','format','user:%s','json','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','hold','hold\x20fired:','entityFound:','hold\x20executed!','unhold','webbar:unhold','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack'];(function(_0x236578,_0x406a18){var _0x1e41f0=function(_0x538963){while(--_0x538963){_0x236578['push'](_0x236578['shift']());}};_0x1e41f0(++_0x406a18);}(_0xde2c,0x7f));var _0xcde2=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xde2c[_0x457b64];return _0x437111;};'use strict';var path=require(_0xcde2('0x0'));var fs=require('fs');var _=require(_0xcde2('0x1'));var db=require(_0xcde2('0x2'))['db'];var config=require(_0xcde2('0x3'));var util=require(_0xcde2('0x4'));var BPromise=require(_0xcde2('0x5'));var jayson=require(_0xcde2('0x6'));var amiClient=jayson[_0xcde2('0x7')]['http']({'port':0x232a});var logger=require(_0xcde2('0x8'))(_0xcde2('0x9'));var Redis=require(_0xcde2('0xa'));config[_0xcde2('0xb')]=_[_0xcde2('0xc')](config['redis'],{'host':_0xcde2('0xd'),'port':0x18eb});var io=require(_0xcde2('0xe'))(new Redis(config[_0xcde2('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'callNumber':{'type':_0xcde2('0x10'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xcde2('0x10')},'callbackUrl':{'type':_0xcde2('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':[!![],_0xcde2('0x12')]},'transferNumber':{'type':'string','required':[!![],_0xcde2('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcde2('0xf')]},'sessionId':{'type':_0xcde2('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],_0xcde2('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0xcde2('0x11'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x39b023,_0x4c558b,_0x31b4a7){logger[_0xcde2('0x14')](_0x39b023,_0x4c558b,JSON[_0xcde2('0x15')](_0x31b4a7));io['to'](_0x39b023)[_0xcde2('0x16')](_0x4c558b,_0x31b4a7);}function handleError(_0x5223f1){return function(_0x4fd5aa){console['log'](_0xcde2('0x17'),_0x4fd5aa,_0x4fd5aa instanceof RangeError);logger['error'](_0x4fd5aa[_0xcde2('0x18')]);if(_0x4fd5aa instanceof RangeError){if(_0x4fd5aa[_0xcde2('0x19')]){delete _0x4fd5aa[_0xcde2('0x19')];}_0x5223f1['status'](0x194)[_0xcde2('0x1a')](_0x4fd5aa);}else{if(_0x4fd5aa[_0xcde2('0x19')]){delete _0x4fd5aa[_0xcde2('0x19')];}_0x5223f1[_0xcde2('0x1b')](0x1f4)[_0xcde2('0x1a')](_0x4fd5aa);}};}function checkError(){return function(_0x57210d){if(!_0x57210d){throw new RangeError('NotFound');}return _0x57210d;};}function respondWithRpcPromise(_0x5a92b9,_0xb96dc0){return new BPromise(function(_0x3e5170,_0x2c9562){var _0x4063d4=amiClient;return _0x4063d4[_0xcde2('0x1c')](_0x5a92b9,_0xb96dc0)['then'](function(_0x1104b8){if(_0x1104b8['error']){if(_0x1104b8[_0xcde2('0x1d')][_0xcde2('0x1e')]===0x1f4){return _0x2c9562(_0x1104b8[_0xcde2('0x1d')]['message']);}return _0x3e5170(_0x1104b8['error'][_0xcde2('0x1f')]);}else{_0x3e5170(_0x1104b8[_0xcde2('0x20')]);}})[_0xcde2('0x21')](function(_0x217ec9){_0x2c9562(_0x217ec9);});});}function getAgent(_0xcadb2){return db['User'][_0xcde2('0x22')]({'where':{'id':_0xcadb2,'role':_0xcde2('0x23')}})[_0xcde2('0x24')](checkError());}function getAgentCheckSession(_0x513965,_0x2487eb){return new BPromise(function(_0x348ca1,_0x8e1655){var _0x40309d=respondWithRpcPromise(_0xcde2('0x25'));var _0x5b2b7=getAgent(_0x513965);Promise[_0xcde2('0x26')]([_0x40309d,_0x5b2b7])[_0xcde2('0x24')](function(_0x5bf1e6){var _0x3c3c01=_0x5bf1e6[0x0];var _0x4a0826=_0x5bf1e6[0x1];var _0x141072=_[_0xcde2('0x27')](_0x3c3c01[_0xcde2('0x28')],function(_0x49cb58){return _0x49cb58[_0xcde2('0x29')]==_0x4a0826['id']&&_0x49cb58[_0xcde2('0x2a')]==_0x2487eb;});if(_0x141072['length']==0x1){_0x348ca1(_0x4a0826);}else{_0x8e1655(new RangeError(_0xcde2('0x2b')+_0x2487eb+_0xcde2('0x2c')));}});});}exports[_0xcde2('0x2d')]=function(_0x2b2ea1,_0x14f784){logger[_0xcde2('0x14')](_0xcde2('0x2e'),_0x2b2ea1[_0xcde2('0x2f')]);var _0x5c08f0=originateValidation[_0xcde2('0x30')](_0x2b2ea1[_0xcde2('0x2f')]);if(_0x5c08f0[_0xcde2('0x31')]>0x0){return _0x14f784[_0xcde2('0x1b')](0x190)['json'](_0x5c08f0);}var _0x2ae8e0=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x32')];var _0x2fec6e=_0x2b2ea1['body'][_0xcde2('0x33')];var _0x452816=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x34')];var _0x54ae78=_0x2b2ea1[_0xcde2('0x2f')][_0xcde2('0x35')];return getAgent(_0x2ae8e0)[_0xcde2('0x24')](function(_0x3090b6){logger[_0xcde2('0x14')]('entityFound:',_0x3090b6[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x3090b6[_0xcde2('0x19')]),'webbar:originate',{'callNumber':_0x2fec6e,'callerId':_0x452816,'callbackUrl':_0x54ae78});return _0x14f784['status'](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x39')});})[_0xcde2('0x21')](handleError(_0x14f784));};exports[_0xcde2('0x3a')]=function(_0x10c494,_0x45af6e){logger[_0xcde2('0x14')](_0xcde2('0x3b'),_0x10c494[_0xcde2('0x2f')]);var _0x5d02b3=hangupValidation[_0xcde2('0x30')](_0x10c494[_0xcde2('0x2f')]);if(_0x5d02b3[_0xcde2('0x31')]>0x0){return _0x45af6e[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5d02b3);}var _0x47b6ee=_0x10c494['body'][_0xcde2('0x32')];var _0xc8e8a4=_0x10c494[_0xcde2('0x2f')][_0xcde2('0x2a')];return getAgent(_0x47b6ee)[_0xcde2('0x24')](function(_0x1939a0){logger['info']('entityFound:',_0x1939a0['name']);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x1939a0[_0xcde2('0x19')]),_0xcde2('0x3c'),{'sessionId':_0xc8e8a4});return _0x45af6e[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x3d')});})['catch'](handleError(_0x45af6e));};exports['answer']=function(_0x6f60d5,_0x578bf1){logger[_0xcde2('0x14')]('answer\x20fired:',_0x6f60d5[_0xcde2('0x2f')]);var _0x3239a0=answerValidation[_0xcde2('0x30')](_0x6f60d5['body']);if(_0x3239a0[_0xcde2('0x31')]>0x0){return _0x578bf1['status'](0x190)[_0xcde2('0x38')](_0x3239a0);}var _0x24a46a=_0x6f60d5[_0xcde2('0x2f')][_0xcde2('0x32')];var _0xcafd7=_0x6f60d5[_0xcde2('0x2f')]['sessionId'];return getAgent(_0x24a46a)['then'](function(_0x22084e){logger['info']('entityFound:',_0x22084e[_0xcde2('0x19')]);emit(util['format'](_0xcde2('0x37'),_0x22084e[_0xcde2('0x19')]),'webbar:answer',{'sessionId':_0xcafd7});return _0x578bf1[_0xcde2('0x1b')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0xcde2('0x21')](handleError(_0x578bf1));};exports[_0xcde2('0x3e')]=function(_0x4fc9d5,_0x1e05a4){logger['info'](_0xcde2('0x3f'),_0x4fc9d5[_0xcde2('0x2f')]);var _0x2d7b55=holdValidation[_0xcde2('0x30')](_0x4fc9d5[_0xcde2('0x2f')]);if(_0x2d7b55['length']>0x0){return _0x1e05a4[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x2d7b55);}var _0x40d14b=_0x4fc9d5[_0xcde2('0x2f')]['userId'];var _0x58ded4=_0x4fc9d5[_0xcde2('0x2f')]['sessionId'];return getAgent(_0x40d14b)[_0xcde2('0x24')](function(_0x3e9e79){logger[_0xcde2('0x14')](_0xcde2('0x40'),_0x3e9e79[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')]('user:%s',_0x3e9e79[_0xcde2('0x19')]),'webbar:hold',{'sessionId':_0x58ded4});return _0x1e05a4[_0xcde2('0x1b')](0xc8)['json']({'error':![],'message':_0xcde2('0x41')});})[_0xcde2('0x21')](handleError(_0x1e05a4));};exports[_0xcde2('0x42')]=function(_0x16cddb,_0x446cf0){logger[_0xcde2('0x14')]('unhold\x20fired:',_0x16cddb[_0xcde2('0x2f')]);var _0x5aa54f=unholdValidation[_0xcde2('0x30')](_0x16cddb[_0xcde2('0x2f')]);if(_0x5aa54f[_0xcde2('0x31')]>0x0){return _0x446cf0[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5aa54f);}var _0x9067c8=_0x16cddb[_0xcde2('0x2f')][_0xcde2('0x32')];var _0x373cdc=_0x16cddb[_0xcde2('0x2f')][_0xcde2('0x2a')];return getAgent(_0x9067c8)[_0xcde2('0x24')](function(_0x5d777d){logger['info']('entityFound:',_0x5d777d[_0xcde2('0x19')]);emit(util['format'](_0xcde2('0x37'),_0x5d777d[_0xcde2('0x19')]),_0xcde2('0x43'),{'sessionId':_0x373cdc});return _0x446cf0['status'](0xc8)[_0xcde2('0x38')]({'error':![],'message':'unhold\x20executed!'});})[_0xcde2('0x21')](handleError(_0x446cf0));};exports['calls']=function(_0x1085d2,_0x10d6ab){logger['info'](_0xcde2('0x44'),_0x10d6ab['body']);var _0x5e6fd3=callsValidation[_0xcde2('0x30')](_0x1085d2[_0xcde2('0x2f')]);if(_0x5e6fd3[_0xcde2('0x31')]>0x0){return _0x10d6ab[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x5e6fd3);}var _0x3787b5=_0x1085d2['body'][_0xcde2('0x32')];var _0x44b3fb=respondWithRpcPromise(_0xcde2('0x25'));var _0x145b4a=getAgent(_0x3787b5);return Promise[_0xcde2('0x26')]([_0x44b3fb,_0x145b4a])[_0xcde2('0x24')](function(_0x50892c){var _0x5775bb=_0x50892c[0x0];var _0x30dee3=_0x50892c[0x1];var _0x35c6e5=_[_0xcde2('0x27')](_0x5775bb[_0xcde2('0x28')],function(_0x4c298b){return _0x4c298b[_0xcde2('0x29')]==_0x30dee3['id'];});return _0x10d6ab[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'count':_0x35c6e5[_0xcde2('0x31')],'rows':_0x35c6e5});})[_0xcde2('0x21')](handleError(_0x10d6ab));};exports[_0xcde2('0x45')]=function(_0x50a1db,_0x1bea12){logger[_0xcde2('0x14')]('conference\x20fired:',_0x50a1db[_0xcde2('0x2f')]);var _0x4544bd=conferenceValidation[_0xcde2('0x30')](_0x50a1db[_0xcde2('0x2f')]);if(_0x4544bd[_0xcde2('0x31')]>0x0){return _0x1bea12[_0xcde2('0x1b')](0x190)[_0xcde2('0x38')](_0x4544bd);}var _0x2541e0=_0x50a1db[_0xcde2('0x2f')][_0xcde2('0x32')];return getAgent(_0x2541e0)['then'](function(_0x223cb0){logger[_0xcde2('0x14')]('entityFound:',_0x223cb0[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x223cb0['name']),_0xcde2('0x46'));return _0x1bea12[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x47')});})[_0xcde2('0x21')](handleError(_0x1bea12));};exports[_0xcde2('0x48')]=function(_0x21cd07,_0x45bd76){logger[_0xcde2('0x14')](_0xcde2('0x49'),_0x21cd07[_0xcde2('0x2f')]);var _0x5d42f8=transferValidation['validate'](_0x21cd07[_0xcde2('0x2f')]);if(_0x5d42f8[_0xcde2('0x31')]>0x0){return _0x45bd76[_0xcde2('0x1b')](0x190)['json'](_0x5d42f8);}var _0x485a79=_0x21cd07['body'][_0xcde2('0x32')];var _0x367bad=_0x21cd07[_0xcde2('0x2f')][_0xcde2('0x2a')];var _0x325b51=_0x21cd07[_0xcde2('0x2f')]['transferNumber'];return getAgent(_0x485a79)['then'](function(_0x165ec4){logger[_0xcde2('0x14')](_0xcde2('0x40'),_0x165ec4[_0xcde2('0x19')]);emit(util[_0xcde2('0x36')](_0xcde2('0x37'),_0x165ec4[_0xcde2('0x19')]),_0xcde2('0x4a'),{'sessionId':_0x367bad,'transferNumber':_0x325b51});return _0x45bd76[_0xcde2('0x1b')](0xc8)[_0xcde2('0x38')]({'error':![],'message':_0xcde2('0x4b')});})[_0xcde2('0x21')](handleError(_0x45bd76));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 56312fd..c57e2c7 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 _0x7708=['../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','../../components/interaction/service'];(function(_0x17edf9,_0x7f2c1f){var _0x38a53e=function(_0x2e8a3d){while(--_0x2e8a3d){_0x17edf9['push'](_0x17edf9['shift']());}};_0x38a53e(++_0x7f2c1f);}(_0x7708,0x188));var _0x8770=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x7708[_0x8e8ca7];return _0x561381;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./whatsappAccount.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['getAnswers']);router[_0x8770('0x5')](_0x8770('0xf'),auth[_0x8770('0x8')](),controller['getAgents']);router[_0x8770('0x5')](_0x8770('0x10'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0x12')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x13')]);router[_0x8770('0x12')]('/:id/dispositions',auth[_0x8770('0x8')](),controller[_0x8770('0x14')]);router['post'](_0x8770('0xe'),auth['isAuthenticated'](),controller[_0x8770('0x15')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x8770('0x16')]);router[_0x8770('0x12')](_0x8770('0x10'),auth[_0x8770('0x8')](),controller['addApplications']);router['post'](_0x8770('0x17'),controller[_0x8770('0x18')]);router[_0x8770('0x12')](_0x8770('0x19'),auth[_0x8770('0x8')](),controller['send']);router[_0x8770('0x1a')](_0x8770('0xa'),auth[_0x8770('0x8')](),controller[_0x8770('0x1b')]);router['delete']('/:id',auth[_0x8770('0x8')](),controller[_0x8770('0x1c')]);router[_0x8770('0x1d')](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x1e')]);router['delete'](_0x8770('0xe'),auth[_0x8770('0x8')](),controller[_0x8770('0x1f')]);router[_0x8770('0x1d')]('/:id/users',auth[_0x8770('0x8')](),controller['removeAgents']);module[_0x8770('0x20')]=router; \ No newline at end of file +var _0x0295=['addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','/:id/applications','addApplications','/:id/notify','notify','put','/:id','update','delete','removeDispositions','removeAnswers','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','getDispositions','getAnswers','getAgents','post','create','/:id/dispositions'];(function(_0x3e233b,_0x3902c8){var _0x2ba88c=function(_0x3da111){while(--_0x3da111){_0x3e233b['push'](_0x3e233b['shift']());}};_0x2ba88c(++_0x3902c8);}(_0x0295,0x1f0));var _0x5029=function(_0x36921f,_0x3d8888){_0x36921f=_0x36921f-0x0;var _0x2a20bb=_0x0295[_0x36921f];return _0x2a20bb;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0x7')]('/:id/dispositions',auth[_0x5029('0x8')](),controller[_0x5029('0xa')]);router[_0x5029('0x7')]('/:id/canned_answers',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0x7')]('/:id/users',auth[_0x5029('0x8')](),controller[_0x5029('0xc')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x5029('0xd')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0xe')]);router[_0x5029('0xd')](_0x5029('0xf'),auth[_0x5029('0x8')](),controller[_0x5029('0x10')]);router[_0x5029('0xd')](_0x5029('0x11'),auth[_0x5029('0x8')](),controller[_0x5029('0x12')]);router[_0x5029('0xd')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x14')]);router['post'](_0x5029('0x15'),auth[_0x5029('0x8')](),controller[_0x5029('0x16')]);router[_0x5029('0xd')](_0x5029('0x17'),controller[_0x5029('0x18')]);router[_0x5029('0xd')]('/:id/send',auth[_0x5029('0x8')](),controller['send']);router[_0x5029('0x19')](_0x5029('0x1a'),auth[_0x5029('0x8')](),controller[_0x5029('0x1b')]);router['delete']('/:id',auth[_0x5029('0x8')](),controller['destroy']);router[_0x5029('0x1c')](_0x5029('0xf'),auth[_0x5029('0x8')](),controller[_0x5029('0x1d')]);router[_0x5029('0x1c')](_0x5029('0x11'),auth[_0x5029('0x8')](),controller[_0x5029('0x1e')]);router[_0x5029('0x1c')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x5029('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 3a07705..3793e1c 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 _0x1b22=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x1b22,0x9d));var _0x21b2=function(_0x3c02e0,_0x49fbc5){_0x3c02e0=_0x3c02e0-0x0;var _0x344759=_0x1b22[_0x3c02e0];return _0x344759;};'use strict';var Sequelize=require(_0x21b2('0x0'));var rs=require(_0x21b2('0x1'));module[_0x21b2('0x2')]={'name':{'type':Sequelize[_0x21b2('0x3')],'unique':_0x21b2('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x21b2('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x21b2('0x3')],'defaultValue':function(){return rs[_0x21b2('0x5')]();}},'phone':{'type':Sequelize[_0x21b2('0x3')]},'type':{'type':Sequelize[_0x21b2('0x6')](_0x21b2('0x7'),_0x21b2('0x8'))},'accountSid':{'type':Sequelize[_0x21b2('0x3')]},'baseUrl':{'type':Sequelize[_0x21b2('0x3')]},'authToken':{'type':Sequelize[_0x21b2('0x3')]},'notificationTemplate':{'type':Sequelize[_0x21b2('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x21b2('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x21b2('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x21b2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x21b2('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x21b2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x21b2('0xb')],'comment':_0x21b2('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x21b2('0xa')],'defaultValue':![],'comment':_0x21b2('0xd'),'set':function(_0x5c6509){if(!_0x5c6509){this[_0x21b2('0xe')](_0x21b2('0xf'),null);}this[_0x21b2('0xe')](_0x21b2('0x10'),_0x5c6509);}},'description':{'type':Sequelize[_0x21b2('0x3')]}}; \ No newline at end of file +var _0x18ac=['exports','name','STRING','generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring'];(function(_0x2767fc,_0x243641){var _0x2b5189=function(_0x5d81dd){while(--_0x5d81dd){_0x2767fc['push'](_0x2767fc['shift']());}};_0x2b5189(++_0x243641);}(_0x18ac,0xd0));var _0xc18a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x18ac[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc18a('0x0'));var rs=require(_0xc18a('0x1'));module[_0xc18a('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xc18a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc18a('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xc18a('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xc18a('0x4')],'defaultValue':function(){return rs[_0xc18a('0x5')]();}},'phone':{'type':Sequelize[_0xc18a('0x4')]},'type':{'type':Sequelize[_0xc18a('0x6')](_0xc18a('0x7'),_0xc18a('0x8'))},'accountSid':{'type':Sequelize[_0xc18a('0x4')]},'baseUrl':{'type':Sequelize[_0xc18a('0x4')]},'authToken':{'type':Sequelize[_0xc18a('0x4')]},'notificationTemplate':{'type':Sequelize[_0xc18a('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc18a('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xc18a('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc18a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc18a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc18a('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc18a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc18a('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xc18a('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x21b511){if(!_0x21b511){this[_0xc18a('0xd')](_0xc18a('0xe'),null);}this['setDataValue']('mandatoryDisposition',_0x21b511);}},'description':{'type':Sequelize[_0xc18a('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 00e3b8c..02b7fd3 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 _0x0f55=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','include','rows','params','Pause','includeAll','create','WhatsappAccount','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','filter','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','statuses','WhatsappMessage','timestamp','applications','orderBy','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','From','whatsapp:','Body','MessageSid','sinch','from','notifications','messageId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','defaults','contact','WhatsappInteraction','interaction','created','autoclose','close','*,*,*,*','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x4fabbe,_0xc514f3){var _0x5510dd=function(_0x1e7d23){while(--_0x1e7d23){_0x4fabbe['push'](_0x4fabbe['shift']());}};_0x5510dd(++_0xc514f3);}(_0x0f55,0x170));var _0x50f5=function(_0x8b1a5e,_0x2744eb){_0x8b1a5e=_0x8b1a5e-0x0;var _0x1146b1=_0x0f55[_0x8b1a5e];return _0x1146b1;};'use strict';var emlformat=require(_0x50f5('0x0'));var rimraf=require(_0x50f5('0x1'));var zipdir=require(_0x50f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50f5('0x3'));var moment=require(_0x50f5('0x4'));var BPromise=require(_0x50f5('0x5'));var Mustache=require(_0x50f5('0x6'));var util=require(_0x50f5('0x7'));var path=require(_0x50f5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x50f5('0x9'));var fs=require('fs');var fs_extra=require(_0x50f5('0xa'));var _=require('lodash');var squel=require(_0x50f5('0xb'));var crypto=require('crypto');var jsforce=require(_0x50f5('0xc'));var deskjs=require(_0x50f5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x50f5('0xe'));var Papa=require(_0x50f5('0xf'));var Redis=require('ioredis');var authService=require(_0x50f5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x50f5('0x11'));var hardwareService=require(_0x50f5('0x12'));var logger=require(_0x50f5('0x13'))(_0x50f5('0x14'));var utils=require('../../config/utils');var config=require(_0x50f5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x50f5('0x16'))['db'];config['redis']=_['defaults'](config[_0x50f5('0x17')],{'host':_0x50f5('0x18'),'port':0x18eb});var socket=require(_0x50f5('0x19'))(new Redis(config['redis']));require(_0x50f5('0x1a'))[_0x50f5('0x1b')](socket);var jayson=require(_0x50f5('0x1c'));var client=jayson[_0x50f5('0x1d')][_0x50f5('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4c99d4,_0x2ce7f7,_0x5e185d,_0xde47c6){return new BPromise(function(_0x506e46,_0x78d6f4){var _0x369ce5=_0xde47c6||client;return _0x369ce5[_0x50f5('0x1f')](_0x4c99d4,_0x5e185d)[_0x50f5('0x20')](function(_0x2ac2a8){logger[_0x50f5('0x21')](_0x50f5('0x22'),_0x2ce7f7,_0x50f5('0x23'));logger['debug'](_0x50f5('0x24'),_0x2ce7f7,'request\x20sent',JSON[_0x50f5('0x25')](_0x2ac2a8));if(_0x2ac2a8[_0x50f5('0x26')]){if(_0x2ac2a8[_0x50f5('0x26')]['code']===0x1f4){logger[_0x50f5('0x26')](_0x50f5('0x22'),_0x2ce7f7,_0x2ac2a8[_0x50f5('0x26')]['message']);return _0x78d6f4(_0x2ac2a8['error'][_0x50f5('0x27')]);}logger['error'](_0x50f5('0x22'),_0x2ce7f7,_0x2ac2a8[_0x50f5('0x26')][_0x50f5('0x27')]);return _0x506e46(_0x2ac2a8[_0x50f5('0x26')][_0x50f5('0x27')]);}else{logger['info'](_0x50f5('0x22'),_0x2ce7f7,'request\x20sent');_0x506e46(_0x2ac2a8[_0x50f5('0x28')][_0x50f5('0x27')]);}})[_0x50f5('0x29')](function(_0x2a3d90){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x2ce7f7,_0x2a3d90);_0x78d6f4(_0x2a3d90);});});}function respondWithStatusCode(_0x4a65d4,_0x2de7fa){_0x2de7fa=_0x2de7fa||0xcc;return function(_0x28e6d1){if(_0x28e6d1){return _0x4a65d4[_0x50f5('0x2a')](_0x2de7fa);}return _0x4a65d4['status'](_0x2de7fa)[_0x50f5('0x2b')]();};}function respondWithResult(_0x2fa2c1,_0x16acb9){_0x16acb9=_0x16acb9||0xc8;return function(_0x4081be){if(_0x4081be){return _0x2fa2c1[_0x50f5('0x2c')](_0x16acb9)[_0x50f5('0x2d')](_0x4081be);}};}function respondWithFilteredResult(_0x511564,_0x3a5a3a){return function(_0x3d37c1){if(_0x3d37c1){var _0x48b45c=typeof _0x3a5a3a[_0x50f5('0x2e')]===_0x50f5('0x2f')&&typeof _0x3a5a3a['limit']===_0x50f5('0x2f');var _0x18680a=_0x3d37c1['count'];var _0x4b39a8=_0x48b45c?0x0:_0x3a5a3a[_0x50f5('0x2e')];var _0x28e6b0=_0x48b45c?_0x3d37c1[_0x50f5('0x30')]:_0x3a5a3a[_0x50f5('0x2e')]+_0x3a5a3a[_0x50f5('0x31')];var _0x5cf25b;if(_0x28e6b0>=_0x18680a){_0x28e6b0=_0x18680a;_0x5cf25b=0xc8;}else{_0x5cf25b=0xce;}_0x511564[_0x50f5('0x2c')](_0x5cf25b);return _0x511564[_0x50f5('0x32')]('Content-Range',_0x4b39a8+'-'+_0x28e6b0+'/'+_0x18680a)[_0x50f5('0x2d')](_0x3d37c1);}return null;};}function patchUpdates(_0x315cc2){return function(_0x5abdff){try{jsonpatch[_0x50f5('0x33')](_0x5abdff,_0x315cc2,!![]);}catch(_0x13408f){return BPromise[_0x50f5('0x34')](_0x13408f);}return _0x5abdff[_0x50f5('0x35')]();};}function saveUpdates(_0x454058,_0x3d2ce2){return function(_0x324790){if(_0x324790){return _0x324790[_0x50f5('0x36')](_0x454058)[_0x50f5('0x20')](function(_0x2b7076){return _0x2b7076;});}return null;};}function removeEntity(_0x1571b2,_0x304863){return function(_0x1bfd8e){if(_0x1bfd8e){return _0x1bfd8e[_0x50f5('0x37')]()[_0x50f5('0x20')](function(){var _0x457ecd=_0x1bfd8e[_0x50f5('0x38')]({'plain':!![]});var _0x1b120f=_0x50f5('0x39');return db[_0x50f5('0x3a')][_0x50f5('0x37')]({'where':{'type':_0x1b120f,'resourceId':_0x457ecd['id']}})[_0x50f5('0x20')](function(){return _0x1bfd8e;});})[_0x50f5('0x20')](function(){_0x1571b2[_0x50f5('0x2c')](0xcc)[_0x50f5('0x2b')]();});}};}function handleEntityNotFound(_0x34d37e,_0x3389f4){return function(_0x4fe1d6){if(!_0x4fe1d6){_0x34d37e[_0x50f5('0x2a')](0x194);}return _0x4fe1d6;};}function handleError(_0x3a923f,_0x24d11f){_0x24d11f=_0x24d11f||0x1f4;return function(_0xb674aa){logger[_0x50f5('0x26')](_0xb674aa[_0x50f5('0x3b')]);if(_0xb674aa[_0x50f5('0x3c')]){delete _0xb674aa['name'];}_0x3a923f['status'](_0x24d11f)[_0x50f5('0x3d')](_0xb674aa);};}exports['index']=function(_0xf184cb,_0x5801c9){var _0x3b3d15={'include':[{'model':db['Pause'],'as':_0x50f5('0x3e')}]},_0x47939e={},_0x44def0={'count':0x0,'rows':[]};var _0x5e5e60=_[_0x50f5('0x3f')](db['WhatsappAccount'][_0x50f5('0x40')],function(_0x311434){return{'name':_0x311434[_0x50f5('0x41')],'type':_0x311434[_0x50f5('0x42')]['key']};});_0x47939e[_0x50f5('0x43')]=_[_0x50f5('0x3f')](_0x5e5e60,_0x50f5('0x3c'));_0x47939e[_0x50f5('0x44')]=_[_0x50f5('0x45')](_0xf184cb['query']);_0x47939e['filters']=_[_0x50f5('0x46')](_0x47939e['model'],_0x47939e[_0x50f5('0x44')]);_0x3b3d15[_0x50f5('0x47')]=_[_0x50f5('0x46')](_0x47939e[_0x50f5('0x43')],qs[_0x50f5('0x48')](_0xf184cb['query'][_0x50f5('0x48')]));_0x3b3d15[_0x50f5('0x47')]=_0x3b3d15['attributes'][_0x50f5('0x49')]?_0x3b3d15[_0x50f5('0x47')]:_0x47939e[_0x50f5('0x43')];if(!_0xf184cb[_0x50f5('0x44')][_0x50f5('0x4a')](_0x50f5('0x4b'))){_0x3b3d15[_0x50f5('0x31')]=qs[_0x50f5('0x31')](_0xf184cb[_0x50f5('0x44')][_0x50f5('0x31')]);_0x3b3d15['offset']=qs[_0x50f5('0x2e')](_0xf184cb[_0x50f5('0x44')][_0x50f5('0x2e')]);}_0x3b3d15[_0x50f5('0x4c')]=qs['sort'](_0xf184cb['query'][_0x50f5('0x4d')]);_0x3b3d15[_0x50f5('0x4e')]=qs['filters'](_[_0x50f5('0x4f')](_0xf184cb['query'],_0x47939e[_0x50f5('0x50')]),_0x5e5e60);if(_0xf184cb['query']['filter']){_0x3b3d15['where']=_[_0x50f5('0x51')](_0x3b3d15['where'],{'$or':_[_0x50f5('0x3f')](_0x5e5e60,function(_0x56cc6c){if(_0x56cc6c[_0x50f5('0x42')]!==_0x50f5('0x52')){var _0x27b092={};_0x27b092[_0x56cc6c[_0x50f5('0x3c')]]={'$like':'%'+_0xf184cb[_0x50f5('0x44')]['filter']+'%'};return _0x27b092;}})});}_0x3b3d15=_[_0x50f5('0x51')]({},_0x3b3d15,_0xf184cb[_0x50f5('0x53')]);var _0x2b6650={'where':_0x3b3d15[_0x50f5('0x4e')]};return db['WhatsappAccount']['count'](_0x2b6650)[_0x50f5('0x20')](function(_0x4f5cae){_0x44def0[_0x50f5('0x30')]=_0x4f5cae;if(_0xf184cb[_0x50f5('0x44')]['includeAll']){_0x3b3d15[_0x50f5('0x54')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x3b3d15);})[_0x50f5('0x20')](function(_0x2d892b){_0x44def0[_0x50f5('0x55')]=_0x2d892b;return _0x44def0;})[_0x50f5('0x20')](respondWithFilteredResult(_0x5801c9,_0x3b3d15))[_0x50f5('0x29')](handleError(_0x5801c9,null));};exports['show']=function(_0x5ed2ab,_0x21ce0b){var _0x22a462={'raw':![],'where':{'id':_0x5ed2ab[_0x50f5('0x56')]['id']},'include':[{'model':db[_0x50f5('0x57')],'as':_0x50f5('0x3e')}]},_0x55fb09={};_0x55fb09[_0x50f5('0x43')]=_[_0x50f5('0x45')](db['WhatsappAccount'][_0x50f5('0x40')]);_0x55fb09[_0x50f5('0x44')]=_[_0x50f5('0x45')](_0x5ed2ab[_0x50f5('0x44')]);_0x55fb09['filters']=_[_0x50f5('0x46')](_0x55fb09['model'],_0x55fb09[_0x50f5('0x44')]);_0x22a462['attributes']=_[_0x50f5('0x46')](_0x55fb09['model'],qs[_0x50f5('0x48')](_0x5ed2ab[_0x50f5('0x44')]['fields']));_0x22a462[_0x50f5('0x47')]=_0x22a462['attributes'][_0x50f5('0x49')]?_0x22a462['attributes']:_0x55fb09[_0x50f5('0x43')];if(_0x5ed2ab[_0x50f5('0x44')][_0x50f5('0x58')]){_0x22a462[_0x50f5('0x54')]=[{'all':!![]}];}_0x22a462=_[_0x50f5('0x51')]({},_0x22a462,_0x5ed2ab[_0x50f5('0x53')]);return db['WhatsappAccount']['find'](_0x22a462)[_0x50f5('0x20')](handleEntityNotFound(_0x21ce0b,null))[_0x50f5('0x20')](respondWithResult(_0x21ce0b,null))[_0x50f5('0x29')](handleError(_0x21ce0b,null));};exports[_0x50f5('0x59')]=function(_0x1debfa,_0x5500a0){return db[_0x50f5('0x5a')][_0x50f5('0x59')](_0x1debfa['body'],{})[_0x50f5('0x20')](function(_0x432392){var _0x45b4fe=_0x1debfa[_0x50f5('0x5b')][_0x50f5('0x38')]({'plain':!![]});if(!_0x45b4fe)throw new Error(_0x50f5('0x5c'));if(_0x45b4fe[_0x50f5('0x5d')]===_0x50f5('0x5b')){var _0x57ca19=_0x432392[_0x50f5('0x38')]({'plain':!![]});var _0x5abfda=_0x50f5('0x39');return db['UserProfileSection'][_0x50f5('0x5e')]({'where':{'name':_0x5abfda,'userProfileId':_0x45b4fe['userProfileId']},'raw':!![]})[_0x50f5('0x20')](function(_0x517527){if(_0x517527&&_0x517527[_0x50f5('0x5f')]===0x0){return db[_0x50f5('0x3a')][_0x50f5('0x59')]({'name':_0x57ca19[_0x50f5('0x3c')],'resourceId':_0x57ca19['id'],'type':_0x517527['name'],'sectionId':_0x517527['id']},{})[_0x50f5('0x20')](function(){return _0x432392;});}else{return _0x432392;}})['catch'](function(_0x32cfd7){logger[_0x50f5('0x26')](_0x50f5('0x60'),_0x32cfd7);throw _0x32cfd7;});}return _0x432392;})[_0x50f5('0x20')](respondWithResult(_0x5500a0,0xc9))['catch'](handleError(_0x5500a0,null));};exports['update']=function(_0xf7a498,_0x2f7e24){if(_0xf7a498['body']['id']){delete _0xf7a498[_0x50f5('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0xf7a498['params']['id']},'include':[{'model':db[_0x50f5('0x57')],'as':'mandatoryDispositionPause'}]})[_0x50f5('0x20')](handleEntityNotFound(_0x2f7e24,null))[_0x50f5('0x20')](saveUpdates(_0xf7a498['body'],null))[_0x50f5('0x20')](respondWithResult(_0x2f7e24,null))[_0x50f5('0x29')](handleError(_0x2f7e24,null));};exports[_0x50f5('0x37')]=function(_0x364267,_0x1519bd){return db[_0x50f5('0x5a')]['find']({'where':{'id':_0x364267[_0x50f5('0x56')]['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x1519bd,null))[_0x50f5('0x20')](removeEntity(_0x1519bd,null))[_0x50f5('0x29')](handleError(_0x1519bd,null));};exports['describe']=function(_0x1fcbaf,_0x477ba3){return db[_0x50f5('0x5a')][_0x50f5('0x62')]()[_0x50f5('0x20')](respondWithResult(_0x477ba3,null))[_0x50f5('0x29')](handleError(_0x477ba3,null));};exports[_0x50f5('0x63')]=function(_0x3912e4,_0x2aba15,_0x3349bd){if(_0x3912e4[_0x50f5('0x61')]['id']){delete _0x3912e4[_0x50f5('0x61')]['id'];}return db[_0x50f5('0x5a')][_0x50f5('0x5e')]({'where':{'id':_0x3912e4[_0x50f5('0x56')]['id']}})['then'](handleEntityNotFound(_0x2aba15,null))[_0x50f5('0x20')](function(_0x1d8a85){if(_0x1d8a85){_0x3912e4[_0x50f5('0x61')][_0x50f5('0x64')]=_0x1d8a85['id'];return db[_0x50f5('0x65')][_0x50f5('0x59')](_0x3912e4[_0x50f5('0x61')]);}})['then'](respondWithResult(_0x2aba15,null))['catch'](handleError(_0x2aba15,null));};exports[_0x50f5('0x66')]=function(_0x42858b,_0x4e76ed,_0x1d5813){var _0x57ba70={'raw':![],'where':{}};var _0x328977={};var _0x180403={'count':0x0,'rows':[]};return db[_0x50f5('0x5a')][_0x50f5('0x67')]({'where':{'id':_0x42858b[_0x50f5('0x56')]['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x4e76ed,null))[_0x50f5('0x20')](function(_0x45002d){if(_0x45002d){_0x328977['model']=_[_0x50f5('0x45')](db[_0x50f5('0x65')][_0x50f5('0x40')]);_0x328977[_0x50f5('0x44')]=_[_0x50f5('0x45')](_0x42858b[_0x50f5('0x44')]);_0x328977[_0x50f5('0x50')]=_[_0x50f5('0x46')](_0x328977[_0x50f5('0x43')],_0x328977[_0x50f5('0x44')]);_0x57ba70[_0x50f5('0x47')]=_[_0x50f5('0x46')](_0x328977[_0x50f5('0x43')],qs[_0x50f5('0x48')](_0x42858b[_0x50f5('0x44')]['fields']));_0x57ba70[_0x50f5('0x47')]=_0x57ba70[_0x50f5('0x47')][_0x50f5('0x49')]?_0x57ba70[_0x50f5('0x47')]:_0x328977[_0x50f5('0x43')];if(!_0x42858b[_0x50f5('0x44')][_0x50f5('0x4a')](_0x50f5('0x4b'))){_0x57ba70['limit']=qs['limit'](_0x42858b[_0x50f5('0x44')][_0x50f5('0x31')]);_0x57ba70[_0x50f5('0x2e')]=qs[_0x50f5('0x2e')](_0x42858b['query'][_0x50f5('0x2e')]);}_0x57ba70[_0x50f5('0x4c')]=qs[_0x50f5('0x4d')](_0x42858b['query'][_0x50f5('0x4d')]);_0x57ba70[_0x50f5('0x4e')]=qs['filters'](_[_0x50f5('0x4f')](_0x42858b['query'],_0x328977['filters']));_0x57ba70[_0x50f5('0x4e')][_0x50f5('0x64')]=_0x45002d['id'];if(_0x42858b[_0x50f5('0x44')][_0x50f5('0x68')]){_0x57ba70[_0x50f5('0x4e')]=_[_0x50f5('0x51')](_0x57ba70[_0x50f5('0x4e')],{'$or':_[_0x50f5('0x3f')](_0x57ba70[_0x50f5('0x47')],function(_0x5c32c4){var _0x1aa080={};_0x1aa080[_0x5c32c4]={'$like':'%'+_0x42858b[_0x50f5('0x44')][_0x50f5('0x68')]+'%'};return _0x1aa080;})});}_0x57ba70=_[_0x50f5('0x51')]({},_0x57ba70,_0x42858b[_0x50f5('0x53')]);return db[_0x50f5('0x65')][_0x50f5('0x30')]({'where':_0x57ba70[_0x50f5('0x4e')]})[_0x50f5('0x20')](function(_0x9073ad){_0x180403['count']=_0x9073ad;if(_0x42858b[_0x50f5('0x44')][_0x50f5('0x58')]){_0x57ba70['include']=[{'all':!![]}];}return db['Disposition'][_0x50f5('0x69')](_0x57ba70);})['then'](function(_0x5bfef2){_0x180403[_0x50f5('0x55')]=_0x5bfef2;return _0x180403;});}})['then'](respondWithFilteredResult(_0x4e76ed,_0x57ba70))[_0x50f5('0x29')](handleError(_0x4e76ed,null));};exports[_0x50f5('0x6a')]=function(_0x472c39,_0x409989,_0x194aef){return db[_0x50f5('0x5a')][_0x50f5('0x5e')]({'where':{'id':_0x472c39[_0x50f5('0x56')]['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x409989,null))[_0x50f5('0x20')](function(_0x144071){if(_0x144071){return _0x144071[_0x50f5('0x6a')](_0x472c39[_0x50f5('0x44')][_0x50f5('0x6b')]);}})['then'](respondWithStatusCode(_0x409989,null))['catch'](handleError(_0x409989,null));};exports[_0x50f5('0x6c')]=function(_0xe0d135,_0xd48c6d,_0x59eb5f){if(_0xe0d135[_0x50f5('0x61')]['id']){delete _0xe0d135[_0x50f5('0x61')]['id'];}return db[_0x50f5('0x5a')]['find']({'where':{'id':_0xe0d135[_0x50f5('0x56')]['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0xd48c6d,null))[_0x50f5('0x20')](function(_0x4c50d2){if(_0x4c50d2){_0xe0d135['body'][_0x50f5('0x64')]=_0x4c50d2['id'];return db['CannedAnswer'][_0x50f5('0x59')](_0xe0d135[_0x50f5('0x61')]);}})[_0x50f5('0x20')](respondWithResult(_0xd48c6d,null))[_0x50f5('0x29')](handleError(_0xd48c6d,null));};exports[_0x50f5('0x6d')]=function(_0x4dad3a,_0x541dc0,_0xe1272a){var _0x584154={'raw':![],'where':{}};var _0x20e25c={};var _0x7f20a8={'count':0x0,'rows':[]};return db[_0x50f5('0x5a')]['findOne']({'where':{'id':_0x4dad3a[_0x50f5('0x56')]['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x541dc0,null))['then'](function(_0x267586){if(_0x267586){_0x20e25c[_0x50f5('0x43')]=_['keys'](db[_0x50f5('0x6e')][_0x50f5('0x40')]);_0x20e25c[_0x50f5('0x44')]=_[_0x50f5('0x45')](_0x4dad3a[_0x50f5('0x44')]);_0x20e25c[_0x50f5('0x50')]=_[_0x50f5('0x46')](_0x20e25c[_0x50f5('0x43')],_0x20e25c[_0x50f5('0x44')]);_0x584154['attributes']=_[_0x50f5('0x46')](_0x20e25c[_0x50f5('0x43')],qs[_0x50f5('0x48')](_0x4dad3a[_0x50f5('0x44')][_0x50f5('0x48')]));_0x584154[_0x50f5('0x47')]=_0x584154[_0x50f5('0x47')][_0x50f5('0x49')]?_0x584154[_0x50f5('0x47')]:_0x20e25c['model'];if(!_0x4dad3a[_0x50f5('0x44')][_0x50f5('0x4a')](_0x50f5('0x4b'))){_0x584154[_0x50f5('0x31')]=qs['limit'](_0x4dad3a[_0x50f5('0x44')][_0x50f5('0x31')]);_0x584154[_0x50f5('0x2e')]=qs[_0x50f5('0x2e')](_0x4dad3a[_0x50f5('0x44')]['offset']);}_0x584154['order']=qs['sort'](_0x4dad3a[_0x50f5('0x44')]['sort']);_0x584154['where']=qs[_0x50f5('0x50')](_[_0x50f5('0x4f')](_0x4dad3a[_0x50f5('0x44')],_0x20e25c[_0x50f5('0x50')]));_0x584154[_0x50f5('0x4e')][_0x50f5('0x64')]=_0x267586['id'];if(_0x4dad3a[_0x50f5('0x44')][_0x50f5('0x68')]){_0x584154['where']=_[_0x50f5('0x51')](_0x584154[_0x50f5('0x4e')],{'$or':_['map'](_0x584154[_0x50f5('0x47')],function(_0x4633bc){var _0x5d0511={};_0x5d0511[_0x4633bc]={'$like':'%'+_0x4dad3a[_0x50f5('0x44')][_0x50f5('0x68')]+'%'};return _0x5d0511;})});}_0x584154=_['merge']({},_0x584154,_0x4dad3a[_0x50f5('0x53')]);return db['CannedAnswer'][_0x50f5('0x30')]({'where':_0x584154[_0x50f5('0x4e')]})['then'](function(_0xc28357){_0x7f20a8[_0x50f5('0x30')]=_0xc28357;if(_0x4dad3a[_0x50f5('0x44')][_0x50f5('0x58')]){_0x584154[_0x50f5('0x54')]=[{'all':!![]}];}return db[_0x50f5('0x6e')][_0x50f5('0x69')](_0x584154);})[_0x50f5('0x20')](function(_0x23ba44){_0x7f20a8[_0x50f5('0x55')]=_0x23ba44;return _0x7f20a8;});}})[_0x50f5('0x20')](respondWithFilteredResult(_0x541dc0,_0x584154))['catch'](handleError(_0x541dc0,null));};exports['removeAnswers']=function(_0x41dc07,_0x4a5d76,_0x10233a){return db[_0x50f5('0x5a')][_0x50f5('0x5e')]({'where':{'id':_0x41dc07['params']['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x4a5d76,null))[_0x50f5('0x20')](function(_0x34aa14){if(_0x34aa14){return _0x34aa14[_0x50f5('0x6f')](_0x41dc07[_0x50f5('0x44')]['ids']);}})[_0x50f5('0x20')](respondWithStatusCode(_0x4a5d76,null))['catch'](handleError(_0x4a5d76,null));};exports['addAgents']=function(_0x27e4cd,_0x282516,_0x103e41){return db[_0x50f5('0x5a')][_0x50f5('0x5e')]({'where':{'id':_0x27e4cd['params']['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x282516,null))['then'](function(_0x3463af){if(_0x3463af){return _0x3463af[_0x50f5('0x70')](_0x27e4cd['body'][_0x50f5('0x6b')],_[_0x50f5('0x71')](_0x27e4cd[_0x50f5('0x61')],[_0x50f5('0x6b'),'id'])||{})[_0x50f5('0x72')](function(_0xcfa34b){for(var _0xe0ddd7=0x0;_0xe0ddd7<_0x27e4cd[_0x50f5('0x61')]['ids'][_0x50f5('0x49')];_0xe0ddd7+=0x1){socket[_0x50f5('0x73')]('userWhatsappAccount:save',{'UserId':Number(_0x27e4cd[_0x50f5('0x61')][_0x50f5('0x6b')][_0xe0ddd7]),'WhatsappAccountId':Number(_0x27e4cd['params']['id'])});}return _0xcfa34b;});}})[_0x50f5('0x20')](respondWithResult(_0x282516,null))['catch'](handleError(_0x282516,null));};exports[_0x50f5('0x74')]=function(_0x2eaa71,_0x19fb2a,_0x49def7){return db[_0x50f5('0x5a')]['find']({'where':{'id':_0x2eaa71['params']['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x19fb2a,null))[_0x50f5('0x20')](function(_0x552969){if(_0x552969){return _0x552969[_0x50f5('0x74')](_0x2eaa71['query']['ids'])['then'](function(){if(_[_0x50f5('0x75')](_0x2eaa71[_0x50f5('0x44')]['ids'])){for(var _0x50f349=0x0;_0x50f349<_0x2eaa71['query'][_0x50f5('0x6b')][_0x50f5('0x49')];_0x50f349+=0x1){socket[_0x50f5('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x2eaa71[_0x50f5('0x44')][_0x50f5('0x6b')][_0x50f349]),'WhatsappAccountId':Number(_0x2eaa71[_0x50f5('0x56')]['id'])});}}else{socket[_0x50f5('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x2eaa71[_0x50f5('0x44')][_0x50f5('0x6b')]),'WhatsappAccountId':Number(_0x2eaa71[_0x50f5('0x56')]['id'])});}});}})[_0x50f5('0x20')](respondWithStatusCode(_0x19fb2a,null))[_0x50f5('0x29')](handleError(_0x19fb2a,null));};exports[_0x50f5('0x76')]=function(_0x2d3107,_0x2ce244,_0x652e39){var _0x5c4b38={};var _0x1a34ae={};var _0x55f253;var _0xef540;return db[_0x50f5('0x5a')]['findOne']({'where':{'id':_0x2d3107[_0x50f5('0x56')]['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x2ce244,null))[_0x50f5('0x20')](function(_0x5b5d3b){if(_0x5b5d3b){_0x55f253=_0x5b5d3b;_0x1a34ae[_0x50f5('0x43')]=_[_0x50f5('0x45')](db[_0x50f5('0x77')][_0x50f5('0x40')]);_0x1a34ae[_0x50f5('0x44')]=_['keys'](_0x2d3107[_0x50f5('0x44')]);_0x1a34ae[_0x50f5('0x50')]=_[_0x50f5('0x46')](_0x1a34ae['model'],_0x1a34ae[_0x50f5('0x44')]);_0x5c4b38[_0x50f5('0x47')]=_[_0x50f5('0x46')](_0x1a34ae[_0x50f5('0x43')],qs[_0x50f5('0x48')](_0x2d3107[_0x50f5('0x44')]['fields']));_0x5c4b38[_0x50f5('0x47')]=_0x5c4b38[_0x50f5('0x47')][_0x50f5('0x49')]?_0x5c4b38['attributes']:_0x1a34ae['model'];_0x5c4b38['order']=qs[_0x50f5('0x4d')](_0x2d3107[_0x50f5('0x44')]['sort']);_0x5c4b38[_0x50f5('0x4e')]=qs[_0x50f5('0x50')](_['pick'](_0x2d3107[_0x50f5('0x44')],_0x1a34ae[_0x50f5('0x50')]));if(_0x2d3107[_0x50f5('0x44')][_0x50f5('0x68')]){_0x5c4b38[_0x50f5('0x4e')]=_[_0x50f5('0x51')](_0x5c4b38[_0x50f5('0x4e')],{'$or':_[_0x50f5('0x3f')](_0x5c4b38[_0x50f5('0x47')],function(_0x1b4228){var _0x28a682={};_0x28a682[_0x1b4228]={'$like':'%'+_0x2d3107[_0x50f5('0x44')][_0x50f5('0x68')]+'%'};return _0x28a682;})});}_0x5c4b38=_[_0x50f5('0x51')]({},_0x5c4b38,_0x2d3107[_0x50f5('0x53')]);return _0x55f253['getAgents'](_0x5c4b38);}})[_0x50f5('0x20')](function(_0xc44c00){if(_0xc44c00){_0xef540=_0xc44c00[_0x50f5('0x49')];if(!_0x2d3107[_0x50f5('0x44')][_0x50f5('0x4a')]('nolimit')){_0x5c4b38[_0x50f5('0x31')]=qs[_0x50f5('0x31')](_0x2d3107[_0x50f5('0x44')]['limit']);_0x5c4b38[_0x50f5('0x2e')]=qs[_0x50f5('0x2e')](_0x2d3107[_0x50f5('0x44')]['offset']);}return _0x55f253[_0x50f5('0x76')](_0x5c4b38);}})[_0x50f5('0x20')](function(_0xacf8f4){if(_0xacf8f4){return _0xacf8f4?{'count':_0xef540,'rows':_0xacf8f4}:null;}})['then'](respondWithResult(_0x2ce244,null))[_0x50f5('0x29')](handleError(_0x2ce244,null));};exports[_0x50f5('0x78')]=function(_0x5239d0,_0x31ca4a){var _0x402ea9=_0x5239d0[_0x50f5('0x56')]['id'];var _0x18d4f5=_0x5239d0[_0x50f5('0x61')];var _0x19dc86=0xc8;var _0x476edd=null;return db[_0x50f5('0x79')][_0x50f5('0x7a')]({'isolationLevel':db[_0x50f5('0x79')][_0x50f5('0x7b')][_0x50f5('0x7c')][_0x50f5('0x7d')]},function(_0x68477d){return db[_0x50f5('0x5a')]['findOne']({'where':{'id':_0x402ea9},'transaction':_0x68477d})[_0x50f5('0x20')](function(_0x5c3672){if(_0x5c3672){return db[_0x50f5('0x7e')][_0x50f5('0x37')]({'where':{'WhatsappAccountId':_0x402ea9},'transaction':_0x68477d})['then'](function(){var _0x152746=_[_0x50f5('0x3f')](_0x18d4f5,function(_0x3c9b9b){_0x3c9b9b[_0x50f5('0x64')]=_0x402ea9;return _0x3c9b9b;});return db[_0x50f5('0x7e')][_0x50f5('0x7f')](_0x152746,{'transaction':_0x68477d});});}else{_0x19dc86=0x194;_0x476edd=[];}});})[_0x50f5('0x20')](function(){if(_0x19dc86!==0x194){return db[_0x50f5('0x7e')][_0x50f5('0x80')]({'where':{'WhatsappAccountId':_0x402ea9},'order':_0x50f5('0x81')})['then'](function(_0x164213){_0x476edd=_0x164213;});}})['catch'](function(_0x4c68e4){_0x19dc86=0x1f4;logger[_0x50f5('0x26')](_0x4c68e4['stack']);if(_0x4c68e4[_0x50f5('0x3c')]){delete _0x4c68e4[_0x50f5('0x3c')];}_0x476edd=_0x4c68e4;})['finally'](function(){if(_0x476edd===null){_0x31ca4a[_0x50f5('0x2a')](_0x19dc86);}else{if(_0x19dc86===0x1f4){_0x31ca4a[_0x50f5('0x2c')](_0x19dc86)[_0x50f5('0x3d')](_0x476edd);}else{_0x31ca4a[_0x50f5('0x2c')](_0x19dc86)[_0x50f5('0x2d')](_0x476edd);}}});};exports['getApplications']=function(_0x366809,_0x5dfef3,_0xcc77d){var _0x3774ce={};var _0x573874={};var _0x45f7d5;var _0x21982a;return db[_0x50f5('0x5a')][_0x50f5('0x67')]({'where':{'id':_0x366809[_0x50f5('0x56')]['id']}})[_0x50f5('0x20')](handleEntityNotFound(_0x5dfef3,null))[_0x50f5('0x20')](function(_0x6e425c){if(_0x6e425c){_0x45f7d5=_0x6e425c;_0x573874['model']=_['keys'](db['WhatsappApplication'][_0x50f5('0x40')]);_0x573874[_0x50f5('0x44')]=_[_0x50f5('0x45')](_0x366809[_0x50f5('0x44')]);_0x573874['filters']=_['intersection'](_0x573874['model'],_0x573874[_0x50f5('0x44')]);_0x3774ce[_0x50f5('0x47')]=_[_0x50f5('0x46')](_0x573874['model'],qs[_0x50f5('0x48')](_0x366809[_0x50f5('0x44')][_0x50f5('0x48')]));_0x3774ce[_0x50f5('0x47')]=_0x3774ce[_0x50f5('0x47')][_0x50f5('0x49')]?_0x3774ce[_0x50f5('0x47')]:_0x573874[_0x50f5('0x43')];_0x3774ce[_0x50f5('0x4c')]=qs[_0x50f5('0x4d')](_0x366809[_0x50f5('0x44')]['sort']);_0x3774ce[_0x50f5('0x4e')]=qs[_0x50f5('0x50')](_[_0x50f5('0x4f')](_0x366809[_0x50f5('0x44')],_0x573874[_0x50f5('0x50')]));if(_0x366809[_0x50f5('0x44')][_0x50f5('0x68')]){_0x3774ce[_0x50f5('0x4e')]=_[_0x50f5('0x51')](_0x3774ce[_0x50f5('0x4e')],{'$or':_['map'](_0x3774ce[_0x50f5('0x47')],function(_0x3b1a9d){var _0x4bfdf6={};_0x4bfdf6[_0x3b1a9d]={'$like':'%'+_0x366809[_0x50f5('0x44')][_0x50f5('0x68')]+'%'};return _0x4bfdf6;})});}_0x3774ce=_[_0x50f5('0x51')]({},_0x3774ce,_0x366809['options']);return _0x45f7d5['getApplications'](_0x3774ce);}})[_0x50f5('0x20')](function(_0x1326f8){if(_0x1326f8){_0x21982a=_0x1326f8[_0x50f5('0x49')];if(!_0x366809[_0x50f5('0x44')][_0x50f5('0x4a')]('nolimit')){_0x3774ce[_0x50f5('0x31')]=qs[_0x50f5('0x31')](_0x366809[_0x50f5('0x44')][_0x50f5('0x31')]);_0x3774ce[_0x50f5('0x2e')]=qs[_0x50f5('0x2e')](_0x366809[_0x50f5('0x44')][_0x50f5('0x2e')]);}return _0x45f7d5[_0x50f5('0x82')](_0x3774ce);}})[_0x50f5('0x20')](function(_0xd639d1){if(_0xd639d1){return _0xd639d1?{'count':_0x21982a,'rows':_0xd639d1}:null;}})[_0x50f5('0x20')](respondWithResult(_0x5dfef3,null))['catch'](handleError(_0x5dfef3,null));};exports[_0x50f5('0x83')]=function(_0x416f28,_0x539498,_0x158bcc){var _0x3f8ff5={'channel':'whatsapp'};var _0x104801=[];var _0x2a463b=[];var _0x2ed8c1={};return db[_0x50f5('0x5a')][_0x50f5('0x5e')]({'where':{'id':_0x416f28[_0x50f5('0x56')]['id']},'include':[{'model':db[_0x50f5('0x7e')],'as':_0x50f5('0x84')}]})[_0x50f5('0x20')](handleEntityNotFound(_0x539498,null))['then'](function(_0x42095a){_0x3f8ff5['account']=_0x42095a;if(_0x3f8ff5['account']&&_0x3f8ff5[_0x50f5('0x85')][_0x50f5('0x42')]==='sinch'&&_0x416f28[_0x50f5('0x61')][_0x50f5('0x86')]){if(_0x416f28['body'][_0x50f5('0x86')]['length']===0x0)return;if(_0x416f28[_0x50f5('0x61')][_0x50f5('0x86')][0x0]['state']!=='read')return;return db[_0x50f5('0x87')]['update']({'read':!![],'readAt':_0x416f28['body'][_0x50f5('0x86')][0x0][_0x50f5('0x88')]},{'where':{'messageId':_0x416f28[_0x50f5('0x61')][_0x50f5('0x86')][0x0]['message_id']},'individualHooks':!![]})[_0x50f5('0x20')](function(_0x19b1d8){return _0x539498[_0x50f5('0x2c')](0xc8)[_0x50f5('0x2d')](_0x19b1d8);});}_0x3f8ff5[_0x50f5('0x89')]=_[_0x50f5('0x8a')](_0x42095a[_0x50f5('0x84')],['priority'],['asc']);if(_0x3f8ff5[_0x50f5('0x85')][_0x50f5('0x84')]){delete _0x3f8ff5[_0x50f5('0x85')][_0x50f5('0x84')];}return db[_0x50f5('0x8b')][_0x50f5('0x62')]()[_0x50f5('0x20')](function(_0x25d9b0){if(!_0x25d9b0){throw new db['Sequelize'][(_0x50f5('0x8c'))](_0x50f5('0x8d'));}_0x104801=_[_0x50f5('0x8e')](_[_0x50f5('0x45')](_0x25d9b0),[_0x50f5('0x8f'),_0x50f5('0x90')]);_0x2a463b=_[_0x50f5('0x8e')](_['keys'](_0x25d9b0),[_0x50f5('0x8f'),_0x50f5('0x90'),'CompanyId',_0x50f5('0x91')]);_0x3f8ff5['body']={'mapKey':_0x50f5('0x92')};if(_0x3f8ff5['account']&&_0x3f8ff5[_0x50f5('0x85')][_0x50f5('0x42')]==='twilio'){_0x3f8ff5[_0x50f5('0x61')]['from']=_0x416f28[_0x50f5('0x61')][_0x50f5('0x93')]['replace'](_0x50f5('0x94'),'');_0x3f8ff5[_0x50f5('0x61')]['body']=_0x416f28['body'][_0x50f5('0x95')];_0x3f8ff5[_0x50f5('0x61')]['messageId']=_0x416f28[_0x50f5('0x61')][_0x50f5('0x96')];}if(_0x3f8ff5[_0x50f5('0x85')]&&_0x3f8ff5[_0x50f5('0x85')][_0x50f5('0x42')]===_0x50f5('0x97')){_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x98')]=_0x416f28[_0x50f5('0x61')][_0x50f5('0x99')][0x0][_0x50f5('0x98')];_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x61')]=_0x416f28[_0x50f5('0x61')][_0x50f5('0x99')][0x0][_0x50f5('0x27')]['body'];_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x9a')]=_0x416f28['body'][_0x50f5('0x99')][0x0]['message_id'];}if(_0x3f8ff5[_0x50f5('0x61')]['id']){delete _0x3f8ff5[_0x50f5('0x61')]['id'];}if(_[_0x50f5('0x9b')](_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x98')])){throw new db[(_0x50f5('0x9c'))][(_0x50f5('0x8c'))](_0x50f5('0x9d'));}if(_[_0x50f5('0x9b')](_0x3f8ff5[_0x50f5('0x61')]['body'])||_0x3f8ff5['body'][_0x50f5('0x61')]===''){throw new db[(_0x50f5('0x9c'))]['ValidationError'](_0x50f5('0x9e'));}if(_[_0x50f5('0x9b')](_0x3f8ff5[_0x50f5('0x61')]['mapKey'])){throw new db[(_0x50f5('0x9c'))][(_0x50f5('0x8c'))](_0x50f5('0x9f')+_0x2a463b);}if(!_['includes'](_0x2a463b,_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0xa0')])){throw new db['Sequelize'][(_0x50f5('0x8c'))](_0x50f5('0xa1')+_0x2a463b);}_0x2ed8c1[_0x3f8ff5['body'][_0x50f5('0xa0')]]=_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x98')];return db[_0x50f5('0xa2')][_0x50f5('0x5e')]({'where':{'id':_0x3f8ff5[_0x50f5('0x85')][_0x50f5('0x91')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2ed8c1,'limit':0x1,'order':[[_0x50f5('0x90'),'DESC']]}]});})[_0x50f5('0x20')](handleEntityNotFound(_0x539498,null))[_0x50f5('0x20')](function(_0x46505c){if(_0x46505c){_0x3f8ff5['list']=_[_0x50f5('0x71')](_0x46505c,['Contacts']);if(_0x46505c[_0x50f5('0xa3')]['length']){return _0x46505c[_0x50f5('0xa3')][0x0];}var _0x579629=_[_0x50f5('0xa4')](_0x3f8ff5['body'],{'firstName':_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x98')],'ListId':_0x46505c['id']});_0x579629[_0x3f8ff5[_0x50f5('0x61')]['mapKey']]=_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x98')];return db['CmContact'][_0x50f5('0x59')](_0x579629,{'fields':_0x104801,'raw':!![]});}})[_0x50f5('0x20')](handleEntityNotFound(_0x539498,null))[_0x50f5('0x20')](function(_0x21602a){if(_0x21602a){_0x3f8ff5[_0x50f5('0xa5')]=_0x21602a;var _0x44e598={'ContactId':_0x21602a['id'],'phone':_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x98')],'WhatsappAccountId':_0x416f28[_0x50f5('0x56')]['id']};var _0x51cf5b={'ContactId':_0x21602a['id'],'WhatsappAccountId':_0x416f28[_0x50f5('0x56')]['id'],'closed':![]};return db[_0x50f5('0xa6')][_0x50f5('0x5e')]({'where':_0x51cf5b})[_0x50f5('0x20')](function(_0x2fc965){if(_0x2fc965){return[_0x2fc965,![]];}return db[_0x50f5('0xa6')]['create'](_0x44e598)[_0x50f5('0x20')](function(_0x50bb91){return[_0x50bb91,!![]];});});}})[_0x50f5('0x72')](function(_0x44cda5,_0x460e7d){_0x3f8ff5[_0x50f5('0xa7')]=_0x44cda5['get']({'plain':!![]});_0x3f8ff5[_0x50f5('0xa7')][_0x50f5('0xa8')]=![];if(_0x460e7d){if(_0x3f8ff5[_0x50f5('0x85')][_0x50f5('0xa9')]){_0x3f8ff5[_0x50f5('0x89')]['push']({'id':0x0,'priority':_0x3f8ff5['applications'][_0x50f5('0x49')]+0x1,'app':_0x50f5('0xaa'),'appdata':'unmanaged','interval':_0x50f5('0xab')});}_0x3f8ff5[_0x50f5('0xa7')][_0x50f5('0xa8')]=!![];}return db[_0x50f5('0x87')][_0x50f5('0x59')]({'phone':_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x98')],'messageId':_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x9a')],'body':_0x3f8ff5[_0x50f5('0x61')][_0x50f5('0x61')],'WhatsappAccountId':_0x416f28[_0x50f5('0x56')]['id'],'WhatsappInteractionId':_0x44cda5['id'],'direction':'in','ContactId':_0x44cda5[_0x50f5('0xac')],'AttachmentId':_0x3f8ff5[_0x50f5('0x61')]['AttachmentId']});})['then'](function(_0x44a78d){_0x3f8ff5[_0x50f5('0x27')]=_0x44a78d;if(_0x3f8ff5['interaction'][_0x50f5('0xad')]){return db['User'][_0x50f5('0x5e')]({'attributes':['id',_0x50f5('0x3c')],'where':{'id':_0x3f8ff5['interaction'][_0x50f5('0xad')]}})[_0x50f5('0x20')](function(_0x6d696b){if(_0x6d696b){_0x3f8ff5[_0x50f5('0x89')][_0x50f5('0xae')]({'id':0x0,'priority':0x0,'app':_0x50f5('0xaf'),'appdata':_0x6d696b[_0x50f5('0x3c')]+','+(_0x3f8ff5[_0x50f5('0x85')][_0x50f5('0xb0')]||0xa),'interval':_0x50f5('0xab')});}return respondWithRpcPromise(_0x50f5('0xb1'),_0x50f5('0xb2'),_0x3f8ff5);});}return respondWithRpcPromise('Start',_0x50f5('0xb2'),_0x3f8ff5);})[_0x50f5('0x20')](function(_0xa3fe8e){if(_0xa3fe8e){var _0x40a1d7=0xc8;var _0x133940=_0x50f5('0xb3');logger[_0x50f5('0x21')](_0x50f5('0x24'),_0x133940,_0x40a1d7,_0x50f5('0xb4'));logger['debug'](_0x50f5('0xb5'),_0x133940,_0x40a1d7,'entity\x20found',JSON[_0x50f5('0x25')](_0xa3fe8e));if(_0x3f8ff5[_0x50f5('0x85')][_0x50f5('0x42')]===_0x50f5('0xb6')){return _0x539498['status'](_0x40a1d7)[_0x50f5('0x32')](_0x50f5('0xb7'),_0x50f5('0xb8'))[_0x50f5('0x3d')](_0x50f5('0xb9'));}else{return _0x539498[_0x50f5('0x2c')](_0x40a1d7)['json'](_0xa3fe8e);}}});})[_0x50f5('0x29')](handleError(_0x539498,null));};exports[_0x50f5('0x3d')]=function(_0x16e5f1,_0x41a0c3,_0x29783c){var _0x18dd60,_0x335bd8,_0x1e862c;if(_[_0x50f5('0x9b')](_0x16e5f1[_0x50f5('0x61')][_0x50f5('0x61')])||_0x16e5f1['body'][_0x50f5('0x61')]===''){throw new db[(_0x50f5('0x9c'))]['ValidationError'](_0x50f5('0x9e'));}if(_['isNil'](_0x16e5f1[_0x50f5('0x61')]['to'])){throw new db[(_0x50f5('0x9c'))][(_0x50f5('0x8c'))](_0x50f5('0xba'));}_0x18dd60=_0x16e5f1[_0x50f5('0x61')]['to'];return db[_0x50f5('0x5a')][_0x50f5('0x5e')]({'where':{'id':_0x16e5f1[_0x50f5('0x56')]['id']},'include':[{'model':db[_0x50f5('0xa2')],'as':_0x50f5('0xbb'),'include':[{'model':db[_0x50f5('0x8b')],'as':_0x50f5('0xa3'),'where':{'mobile':_0x18dd60},'limit':0x1,'order':[[_0x50f5('0x90'),'DESC']]}]}]})[_0x50f5('0x20')](handleEntityNotFound(_0x41a0c3,null))[_0x50f5('0x20')](function(_0x3828f6){if(_0x3828f6&&_0x3828f6[_0x50f5('0xbb')]){_0x335bd8=_0x3828f6[_0x50f5('0x38')]({'plain':!![]});if(_0x335bd8[_0x50f5('0xbb')]&&_0x335bd8['List'][_0x50f5('0xa3')]['length']){return _0x335bd8['List'][_0x50f5('0xa3')][0x0];}return db[_0x50f5('0x8b')][_0x50f5('0x59')](_[_0x50f5('0xa4')](_0x16e5f1[_0x50f5('0x61')],{'firstName':_0x18dd60,'mobile':_0x18dd60,'phone':_0x18dd60,'ListId':_0x335bd8[_0x50f5('0x91')]}));}})[_0x50f5('0x20')](handleEntityNotFound(_0x41a0c3,null))[_0x50f5('0x20')](function(_0x2dff74){if(_0x2dff74){_0x1e862c=_0x2dff74;return db[_0x50f5('0xa6')][_0x50f5('0x5e')]({'where':{'ContactId':_0x1e862c['id'],'closed':![],'WhatsappAccountId':_0x335bd8['id']}})[_0x50f5('0x20')](function(_0x22cbd7){if(_0x22cbd7){return[_0x22cbd7,![]];}return db[_0x50f5('0xa6')][_0x50f5('0x59')]({'UserId':_0x16e5f1['user']['id'],'ContactId':_0x1e862c['id'],'WhatsappAccountId':_0x335bd8['id'],'phone':_0x18dd60,'firstMsgDirection':_0x50f5('0xbc'),'Messages':[_[_0x50f5('0x51')](_0x16e5f1[_0x50f5('0x61')],{'read':![],'body':_0x16e5f1['body'][_0x50f5('0x61')],'phone':_0x18dd60,'WhatsappAccountId':_0x335bd8['id'],'UserId':_0x16e5f1['user']['id'],'ContactId':_0x1e862c['id']})]},{'include':[{'model':db[_0x50f5('0x87')],'as':_0x50f5('0xbd')}]})[_0x50f5('0x20')](function(_0x3402f7){return[_0x3402f7,!![]];});});}})[_0x50f5('0x72')](function(_0x53642a,_0x559214){if(_0x559214){return _0x53642a;}return db[_0x50f5('0x87')][_0x50f5('0x59')](_[_0x50f5('0x51')](_0x16e5f1['body'],{'read':![],'body':_0x16e5f1['body'][_0x50f5('0x61')],'phone':_0x18dd60,'WhatsappAccountId':_0x335bd8['id'],'WhatsappInteractionId':_0x53642a['id'],'UserId':_0x16e5f1[_0x50f5('0x5b')]['id'],'ContactId':_0x1e862c['id']}))[_0x50f5('0x20')](function(_0x20538f){_0x53642a[_0x50f5('0xbe')][_0x50f5('0xbd')]=[];_0x53642a[_0x50f5('0xbe')]['Messages'][_0x50f5('0xbf')](_0x20538f[_0x50f5('0xbe')]);return _0x53642a;});})['then'](respondWithResult(_0x41a0c3,null))['catch'](handleError(_0x41a0c3,null));}; \ No newline at end of file +var _0xf95e=['get','role','autoAssociation','find','params','describe','addDisposition','WhatsappAccountId','findOne','Disposition','ids','addAnswer','CannedAnswer','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','timestamp','message_id','applications','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','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','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','defaults','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','debug','entity\x20found','stringify','text/xml','\x0a','to\x20is\x20mandatory','List','DESC','out','Messages','WhatsappMessage','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','code','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','options','include','findAll','rows','show','mandatoryDispositionPause','includeAll','create','body','user'];(function(_0x2cdc08,_0x43d728){var _0x449a6a=function(_0x902741){while(--_0x902741){_0x2cdc08['push'](_0x2cdc08['shift']());}};_0x449a6a(++_0x43d728);}(_0xf95e,0x1ec));var _0xef95=function(_0x4fe17c,_0x46e5f8){_0x4fe17c=_0x4fe17c-0x0;var _0x29b8c6=_0xf95e[_0x4fe17c];return _0x29b8c6;};'use strict';var emlformat=require(_0xef95('0x0'));var rimraf=require(_0xef95('0x1'));var zipdir=require(_0xef95('0x2'));var jsonpatch=require(_0xef95('0x3'));var rp=require('request-promise');var moment=require(_0xef95('0x4'));var BPromise=require(_0xef95('0x5'));var Mustache=require(_0xef95('0x6'));var util=require(_0xef95('0x7'));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(_0xef95('0x8'));var squel=require(_0xef95('0x9'));var crypto=require(_0xef95('0xa'));var jsforce=require(_0xef95('0xb'));var deskjs=require(_0xef95('0xc'));var toCsv=require(_0xef95('0xd'));var querystring=require(_0xef95('0xe'));var Papa=require(_0xef95('0xf'));var Redis=require('ioredis');var authService=require(_0xef95('0x10'));var qs=require(_0xef95('0x11'));var as=require(_0xef95('0x12'));var hardwareService=require(_0xef95('0x13'));var logger=require(_0xef95('0x14'))(_0xef95('0x15'));var utils=require(_0xef95('0x16'));var config=require(_0xef95('0x17'));var licenseUtil=require(_0xef95('0x18'));var db=require('../../mysqldb')['db'];config[_0xef95('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xef95('0x1a'))(new Redis(config['redis']));require(_0xef95('0x1b'))[_0xef95('0x1c')](socket);var jayson=require(_0xef95('0x1d'));var client=jayson[_0xef95('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4ef018,_0x13eee7,_0x4c0db8,_0x389677){return new BPromise(function(_0x14a9c7,_0x32a400){var _0x1c4575=_0x389677||client;return _0x1c4575['request'](_0x4ef018,_0x4c0db8)['then'](function(_0x43c347){logger[_0xef95('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x13eee7,_0xef95('0x20'));logger['debug'](_0xef95('0x21'),_0x13eee7,_0xef95('0x20'),JSON['stringify'](_0x43c347));if(_0x43c347['error']){if(_0x43c347['error'][_0xef95('0x22')]===0x1f4){logger[_0xef95('0x23')](_0xef95('0x24'),_0x13eee7,_0x43c347[_0xef95('0x23')][_0xef95('0x25')]);return _0x32a400(_0x43c347[_0xef95('0x23')][_0xef95('0x25')]);}logger['error'](_0xef95('0x24'),_0x13eee7,_0x43c347[_0xef95('0x23')]['message']);return _0x14a9c7(_0x43c347[_0xef95('0x23')][_0xef95('0x25')]);}else{logger[_0xef95('0x1f')](_0xef95('0x24'),_0x13eee7,_0xef95('0x20'));_0x14a9c7(_0x43c347[_0xef95('0x26')]['message']);}})[_0xef95('0x27')](function(_0x3d4f76){logger[_0xef95('0x23')](_0xef95('0x24'),_0x13eee7,_0x3d4f76);_0x32a400(_0x3d4f76);});});}function respondWithStatusCode(_0x47f420,_0x4041c6){_0x4041c6=_0x4041c6||0xcc;return function(_0x3d18ad){if(_0x3d18ad){return _0x47f420[_0xef95('0x28')](_0x4041c6);}return _0x47f420[_0xef95('0x29')](_0x4041c6)['end']();};}function respondWithResult(_0x39507a,_0xfc94ff){_0xfc94ff=_0xfc94ff||0xc8;return function(_0x5dca07){if(_0x5dca07){return _0x39507a[_0xef95('0x29')](_0xfc94ff)['json'](_0x5dca07);}};}function respondWithFilteredResult(_0x1d9810,_0x527c98){return function(_0x103af9){if(_0x103af9){var _0x36772f=typeof _0x527c98['offset']===_0xef95('0x2a')&&typeof _0x527c98['limit']===_0xef95('0x2a');var _0x57cd33=_0x103af9[_0xef95('0x2b')];var _0x3d1a54=_0x36772f?0x0:_0x527c98[_0xef95('0x2c')];var _0xec52df=_0x36772f?_0x103af9['count']:_0x527c98[_0xef95('0x2c')]+_0x527c98[_0xef95('0x2d')];var _0x147387;if(_0xec52df>=_0x57cd33){_0xec52df=_0x57cd33;_0x147387=0xc8;}else{_0x147387=0xce;}_0x1d9810['status'](_0x147387);return _0x1d9810[_0xef95('0x2e')](_0xef95('0x2f'),_0x3d1a54+'-'+_0xec52df+'/'+_0x57cd33)[_0xef95('0x30')](_0x103af9);}return null;};}function patchUpdates(_0x445a06){return function(_0x178d6f){try{jsonpatch[_0xef95('0x31')](_0x178d6f,_0x445a06,!![]);}catch(_0x76bb8d){return BPromise[_0xef95('0x32')](_0x76bb8d);}return _0x178d6f[_0xef95('0x33')]();};}function saveUpdates(_0x5c96df,_0x2bb3ef){return function(_0x2f9ff3){if(_0x2f9ff3){return _0x2f9ff3[_0xef95('0x34')](_0x5c96df)[_0xef95('0x35')](function(_0xef9b23){return _0xef9b23;});}return null;};}function removeEntity(_0x1cba84,_0x3445dc){return function(_0x4ba249){if(_0x4ba249){return _0x4ba249[_0xef95('0x36')]()[_0xef95('0x35')](function(){var _0x54a0d8=_0x4ba249['get']({'plain':!![]});var _0x175a5d=_0xef95('0x37');return db[_0xef95('0x38')][_0xef95('0x36')]({'where':{'type':_0x175a5d,'resourceId':_0x54a0d8['id']}})[_0xef95('0x35')](function(){return _0x4ba249;});})['then'](function(){_0x1cba84[_0xef95('0x29')](0xcc)[_0xef95('0x39')]();});}};}function handleEntityNotFound(_0x5493ae,_0x3012c0){return function(_0x59c7d7){if(!_0x59c7d7){_0x5493ae[_0xef95('0x28')](0x194);}return _0x59c7d7;};}function handleError(_0x4fc7ce,_0x41451e){_0x41451e=_0x41451e||0x1f4;return function(_0x49106d){logger[_0xef95('0x23')](_0x49106d[_0xef95('0x3a')]);if(_0x49106d[_0xef95('0x3b')]){delete _0x49106d[_0xef95('0x3b')];}_0x4fc7ce['status'](_0x41451e)[_0xef95('0x3c')](_0x49106d);};}exports[_0xef95('0x3d')]=function(_0x1b1e3d,_0x4bc3d7){var _0x1001de={'include':[{'model':db[_0xef95('0x3e')],'as':'mandatoryDispositionPause'}]},_0x550e10={},_0x3e4fba={'count':0x0,'rows':[]};var _0x12ea28=_[_0xef95('0x3f')](db[_0xef95('0x40')][_0xef95('0x41')],function(_0x43c402){return{'name':_0x43c402[_0xef95('0x42')],'type':_0x43c402['type'][_0xef95('0x43')]};});_0x550e10[_0xef95('0x44')]=_[_0xef95('0x3f')](_0x12ea28,'name');_0x550e10['query']=_[_0xef95('0x45')](_0x1b1e3d['query']);_0x550e10[_0xef95('0x46')]=_[_0xef95('0x47')](_0x550e10['model'],_0x550e10['query']);_0x1001de[_0xef95('0x48')]=_[_0xef95('0x47')](_0x550e10['model'],qs['fields'](_0x1b1e3d[_0xef95('0x49')][_0xef95('0x4a')]));_0x1001de[_0xef95('0x48')]=_0x1001de[_0xef95('0x48')][_0xef95('0x4b')]?_0x1001de[_0xef95('0x48')]:_0x550e10[_0xef95('0x44')];if(!_0x1b1e3d[_0xef95('0x49')][_0xef95('0x4c')](_0xef95('0x4d'))){_0x1001de[_0xef95('0x2d')]=qs[_0xef95('0x2d')](_0x1b1e3d[_0xef95('0x49')][_0xef95('0x2d')]);_0x1001de[_0xef95('0x2c')]=qs['offset'](_0x1b1e3d['query'][_0xef95('0x2c')]);}_0x1001de[_0xef95('0x4e')]=qs[_0xef95('0x4f')](_0x1b1e3d[_0xef95('0x49')][_0xef95('0x4f')]);_0x1001de['where']=qs[_0xef95('0x46')](_[_0xef95('0x50')](_0x1b1e3d[_0xef95('0x49')],_0x550e10[_0xef95('0x46')]),_0x12ea28);if(_0x1b1e3d[_0xef95('0x49')]['filter']){_0x1001de['where']=_[_0xef95('0x51')](_0x1001de[_0xef95('0x52')],{'$or':_[_0xef95('0x3f')](_0x12ea28,function(_0x2d3a99){if(_0x2d3a99[_0xef95('0x53')]!==_0xef95('0x54')){var _0x294acc={};_0x294acc[_0x2d3a99[_0xef95('0x3b')]]={'$like':'%'+_0x1b1e3d[_0xef95('0x49')][_0xef95('0x55')]+'%'};return _0x294acc;}})});}_0x1001de=_[_0xef95('0x51')]({},_0x1001de,_0x1b1e3d[_0xef95('0x56')]);var _0x1af89b={'where':_0x1001de[_0xef95('0x52')]};return db[_0xef95('0x40')][_0xef95('0x2b')](_0x1af89b)[_0xef95('0x35')](function(_0x23cf41){_0x3e4fba[_0xef95('0x2b')]=_0x23cf41;if(_0x1b1e3d[_0xef95('0x49')]['includeAll']){_0x1001de[_0xef95('0x57')]=[{'all':!![]}];}return db[_0xef95('0x40')][_0xef95('0x58')](_0x1001de);})[_0xef95('0x35')](function(_0x5a4a57){_0x3e4fba[_0xef95('0x59')]=_0x5a4a57;return _0x3e4fba;})[_0xef95('0x35')](respondWithFilteredResult(_0x4bc3d7,_0x1001de))['catch'](handleError(_0x4bc3d7,null));};exports[_0xef95('0x5a')]=function(_0x65c7a6,_0xdc7a6b){var _0x8a4422={'raw':![],'where':{'id':_0x65c7a6['params']['id']},'include':[{'model':db['Pause'],'as':_0xef95('0x5b')}]},_0x245257={};_0x245257[_0xef95('0x44')]=_[_0xef95('0x45')](db['WhatsappAccount'][_0xef95('0x41')]);_0x245257[_0xef95('0x49')]=_[_0xef95('0x45')](_0x65c7a6[_0xef95('0x49')]);_0x245257[_0xef95('0x46')]=_[_0xef95('0x47')](_0x245257['model'],_0x245257['query']);_0x8a4422[_0xef95('0x48')]=_[_0xef95('0x47')](_0x245257[_0xef95('0x44')],qs['fields'](_0x65c7a6['query']['fields']));_0x8a4422[_0xef95('0x48')]=_0x8a4422[_0xef95('0x48')][_0xef95('0x4b')]?_0x8a4422[_0xef95('0x48')]:_0x245257[_0xef95('0x44')];if(_0x65c7a6[_0xef95('0x49')][_0xef95('0x5c')]){_0x8a4422[_0xef95('0x57')]=[{'all':!![]}];}_0x8a4422=_[_0xef95('0x51')]({},_0x8a4422,_0x65c7a6['options']);return db['WhatsappAccount']['find'](_0x8a4422)[_0xef95('0x35')](handleEntityNotFound(_0xdc7a6b,null))[_0xef95('0x35')](respondWithResult(_0xdc7a6b,null))[_0xef95('0x27')](handleError(_0xdc7a6b,null));};exports[_0xef95('0x5d')]=function(_0x5bbba8,_0x13341f){return db['WhatsappAccount'][_0xef95('0x5d')](_0x5bbba8[_0xef95('0x5e')],{})[_0xef95('0x35')](function(_0x1b7556){var _0x46095c=_0x5bbba8[_0xef95('0x5f')][_0xef95('0x60')]({'plain':!![]});if(!_0x46095c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46095c[_0xef95('0x61')]===_0xef95('0x5f')){var _0x152c8f=_0x1b7556['get']({'plain':!![]});var _0x3bc81b='WhatsappAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x3bc81b,'userProfileId':_0x46095c['userProfileId']},'raw':!![]})[_0xef95('0x35')](function(_0x4da27d){if(_0x4da27d&&_0x4da27d[_0xef95('0x62')]===0x0){return db[_0xef95('0x38')][_0xef95('0x5d')]({'name':_0x152c8f[_0xef95('0x3b')],'resourceId':_0x152c8f['id'],'type':_0x4da27d[_0xef95('0x3b')],'sectionId':_0x4da27d['id']},{})['then'](function(){return _0x1b7556;});}else{return _0x1b7556;}})[_0xef95('0x27')](function(_0x1c4ac2){logger[_0xef95('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c4ac2);throw _0x1c4ac2;});}return _0x1b7556;})[_0xef95('0x35')](respondWithResult(_0x13341f,0xc9))[_0xef95('0x27')](handleError(_0x13341f,null));};exports['update']=function(_0x12e3d1,_0x327458){if(_0x12e3d1['body']['id']){delete _0x12e3d1['body']['id'];}return db[_0xef95('0x40')][_0xef95('0x63')]({'where':{'id':_0x12e3d1[_0xef95('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0xef95('0x5b')}]})[_0xef95('0x35')](handleEntityNotFound(_0x327458,null))[_0xef95('0x35')](saveUpdates(_0x12e3d1['body'],null))[_0xef95('0x35')](respondWithResult(_0x327458,null))[_0xef95('0x27')](handleError(_0x327458,null));};exports[_0xef95('0x36')]=function(_0xd1bb4,_0x535650){return db[_0xef95('0x40')][_0xef95('0x63')]({'where':{'id':_0xd1bb4[_0xef95('0x64')]['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x535650,null))['then'](removeEntity(_0x535650,null))[_0xef95('0x27')](handleError(_0x535650,null));};exports[_0xef95('0x65')]=function(_0x5d667e,_0x139b71){return db[_0xef95('0x40')][_0xef95('0x65')]()[_0xef95('0x35')](respondWithResult(_0x139b71,null))['catch'](handleError(_0x139b71,null));};exports[_0xef95('0x66')]=function(_0xebef2e,_0x381496,_0x2e14e5){if(_0xebef2e['body']['id']){delete _0xebef2e[_0xef95('0x5e')]['id'];}return db[_0xef95('0x40')][_0xef95('0x63')]({'where':{'id':_0xebef2e[_0xef95('0x64')]['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x381496,null))['then'](function(_0x998940){if(_0x998940){_0xebef2e[_0xef95('0x5e')][_0xef95('0x67')]=_0x998940['id'];return db['Disposition'][_0xef95('0x5d')](_0xebef2e['body']);}})[_0xef95('0x35')](respondWithResult(_0x381496,null))['catch'](handleError(_0x381496,null));};exports['getDispositions']=function(_0x5abc60,_0x5b5d99,_0x3f2f91){var _0x1f612a={'raw':![],'where':{}};var _0x4cd141={};var _0x5db01e={'count':0x0,'rows':[]};return db[_0xef95('0x40')][_0xef95('0x68')]({'where':{'id':_0x5abc60[_0xef95('0x64')]['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x5b5d99,null))[_0xef95('0x35')](function(_0x13ec12){if(_0x13ec12){_0x4cd141['model']=_[_0xef95('0x45')](db[_0xef95('0x69')][_0xef95('0x41')]);_0x4cd141[_0xef95('0x49')]=_[_0xef95('0x45')](_0x5abc60[_0xef95('0x49')]);_0x4cd141[_0xef95('0x46')]=_[_0xef95('0x47')](_0x4cd141[_0xef95('0x44')],_0x4cd141['query']);_0x1f612a[_0xef95('0x48')]=_[_0xef95('0x47')](_0x4cd141[_0xef95('0x44')],qs[_0xef95('0x4a')](_0x5abc60['query'][_0xef95('0x4a')]));_0x1f612a['attributes']=_0x1f612a[_0xef95('0x48')]['length']?_0x1f612a[_0xef95('0x48')]:_0x4cd141[_0xef95('0x44')];if(!_0x5abc60[_0xef95('0x49')][_0xef95('0x4c')](_0xef95('0x4d'))){_0x1f612a['limit']=qs['limit'](_0x5abc60[_0xef95('0x49')][_0xef95('0x2d')]);_0x1f612a[_0xef95('0x2c')]=qs[_0xef95('0x2c')](_0x5abc60[_0xef95('0x49')][_0xef95('0x2c')]);}_0x1f612a['order']=qs[_0xef95('0x4f')](_0x5abc60['query'][_0xef95('0x4f')]);_0x1f612a[_0xef95('0x52')]=qs['filters'](_[_0xef95('0x50')](_0x5abc60['query'],_0x4cd141[_0xef95('0x46')]));_0x1f612a[_0xef95('0x52')][_0xef95('0x67')]=_0x13ec12['id'];if(_0x5abc60[_0xef95('0x49')]['filter']){_0x1f612a[_0xef95('0x52')]=_['merge'](_0x1f612a[_0xef95('0x52')],{'$or':_[_0xef95('0x3f')](_0x1f612a[_0xef95('0x48')],function(_0x2aa8a1){var _0x3919b5={};_0x3919b5[_0x2aa8a1]={'$like':'%'+_0x5abc60[_0xef95('0x49')][_0xef95('0x55')]+'%'};return _0x3919b5;})});}_0x1f612a=_['merge']({},_0x1f612a,_0x5abc60[_0xef95('0x56')]);return db[_0xef95('0x69')][_0xef95('0x2b')]({'where':_0x1f612a[_0xef95('0x52')]})[_0xef95('0x35')](function(_0x23da5b){_0x5db01e['count']=_0x23da5b;if(_0x5abc60[_0xef95('0x49')][_0xef95('0x5c')]){_0x1f612a[_0xef95('0x57')]=[{'all':!![]}];}return db[_0xef95('0x69')][_0xef95('0x58')](_0x1f612a);})[_0xef95('0x35')](function(_0x12b512){_0x5db01e[_0xef95('0x59')]=_0x12b512;return _0x5db01e;});}})[_0xef95('0x35')](respondWithFilteredResult(_0x5b5d99,_0x1f612a))['catch'](handleError(_0x5b5d99,null));};exports['removeDispositions']=function(_0x4c17c8,_0x1afcdd,_0x290d37){return db[_0xef95('0x40')][_0xef95('0x63')]({'where':{'id':_0x4c17c8['params']['id']}})['then'](handleEntityNotFound(_0x1afcdd,null))[_0xef95('0x35')](function(_0x4b6e49){if(_0x4b6e49){return _0x4b6e49['removeDispositions'](_0x4c17c8[_0xef95('0x49')][_0xef95('0x6a')]);}})[_0xef95('0x35')](respondWithStatusCode(_0x1afcdd,null))['catch'](handleError(_0x1afcdd,null));};exports[_0xef95('0x6b')]=function(_0x522866,_0x4160ed,_0x316689){if(_0x522866[_0xef95('0x5e')]['id']){delete _0x522866[_0xef95('0x5e')]['id'];}return db[_0xef95('0x40')][_0xef95('0x63')]({'where':{'id':_0x522866[_0xef95('0x64')]['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x4160ed,null))[_0xef95('0x35')](function(_0x32bfbc){if(_0x32bfbc){_0x522866['body'][_0xef95('0x67')]=_0x32bfbc['id'];return db['CannedAnswer'][_0xef95('0x5d')](_0x522866[_0xef95('0x5e')]);}})[_0xef95('0x35')](respondWithResult(_0x4160ed,null))[_0xef95('0x27')](handleError(_0x4160ed,null));};exports['getAnswers']=function(_0x3b52eb,_0x35cad9,_0x25bb1a){var _0x3b9a2c={'raw':![],'where':{}};var _0x162b40={};var _0x383eb8={'count':0x0,'rows':[]};return db[_0xef95('0x40')][_0xef95('0x68')]({'where':{'id':_0x3b52eb[_0xef95('0x64')]['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x35cad9,null))[_0xef95('0x35')](function(_0x3a77a3){if(_0x3a77a3){_0x162b40[_0xef95('0x44')]=_['keys'](db['CannedAnswer'][_0xef95('0x41')]);_0x162b40[_0xef95('0x49')]=_[_0xef95('0x45')](_0x3b52eb[_0xef95('0x49')]);_0x162b40[_0xef95('0x46')]=_[_0xef95('0x47')](_0x162b40['model'],_0x162b40['query']);_0x3b9a2c[_0xef95('0x48')]=_[_0xef95('0x47')](_0x162b40[_0xef95('0x44')],qs[_0xef95('0x4a')](_0x3b52eb[_0xef95('0x49')][_0xef95('0x4a')]));_0x3b9a2c[_0xef95('0x48')]=_0x3b9a2c['attributes']['length']?_0x3b9a2c['attributes']:_0x162b40[_0xef95('0x44')];if(!_0x3b52eb[_0xef95('0x49')][_0xef95('0x4c')]('nolimit')){_0x3b9a2c['limit']=qs[_0xef95('0x2d')](_0x3b52eb['query']['limit']);_0x3b9a2c[_0xef95('0x2c')]=qs['offset'](_0x3b52eb[_0xef95('0x49')][_0xef95('0x2c')]);}_0x3b9a2c['order']=qs[_0xef95('0x4f')](_0x3b52eb[_0xef95('0x49')]['sort']);_0x3b9a2c[_0xef95('0x52')]=qs[_0xef95('0x46')](_[_0xef95('0x50')](_0x3b52eb[_0xef95('0x49')],_0x162b40[_0xef95('0x46')]));_0x3b9a2c[_0xef95('0x52')][_0xef95('0x67')]=_0x3a77a3['id'];if(_0x3b52eb[_0xef95('0x49')][_0xef95('0x55')]){_0x3b9a2c[_0xef95('0x52')]=_[_0xef95('0x51')](_0x3b9a2c['where'],{'$or':_[_0xef95('0x3f')](_0x3b9a2c[_0xef95('0x48')],function(_0x4bac16){var _0x2bdf6e={};_0x2bdf6e[_0x4bac16]={'$like':'%'+_0x3b52eb[_0xef95('0x49')]['filter']+'%'};return _0x2bdf6e;})});}_0x3b9a2c=_[_0xef95('0x51')]({},_0x3b9a2c,_0x3b52eb[_0xef95('0x56')]);return db[_0xef95('0x6c')][_0xef95('0x2b')]({'where':_0x3b9a2c[_0xef95('0x52')]})[_0xef95('0x35')](function(_0x12e6dc){_0x383eb8[_0xef95('0x2b')]=_0x12e6dc;if(_0x3b52eb['query']['includeAll']){_0x3b9a2c[_0xef95('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0xef95('0x58')](_0x3b9a2c);})[_0xef95('0x35')](function(_0xbbb4c0){_0x383eb8[_0xef95('0x59')]=_0xbbb4c0;return _0x383eb8;});}})['then'](respondWithFilteredResult(_0x35cad9,_0x3b9a2c))[_0xef95('0x27')](handleError(_0x35cad9,null));};exports['removeAnswers']=function(_0x50c077,_0x26ce1f,_0x2bf165){return db[_0xef95('0x40')][_0xef95('0x63')]({'where':{'id':_0x50c077['params']['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x26ce1f,null))[_0xef95('0x35')](function(_0x2c4188){if(_0x2c4188){return _0x2c4188['removeAnswers'](_0x50c077[_0xef95('0x49')][_0xef95('0x6a')]);}})[_0xef95('0x35')](respondWithStatusCode(_0x26ce1f,null))[_0xef95('0x27')](handleError(_0x26ce1f,null));};exports['addAgents']=function(_0x1ec20b,_0x5cc552,_0x332f0c){return db['WhatsappAccount'][_0xef95('0x63')]({'where':{'id':_0x1ec20b[_0xef95('0x64')]['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x5cc552,null))[_0xef95('0x35')](function(_0x1a5010){if(_0x1a5010){return _0x1a5010[_0xef95('0x6d')](_0x1ec20b['body'][_0xef95('0x6a')],_[_0xef95('0x6e')](_0x1ec20b[_0xef95('0x5e')],[_0xef95('0x6a'),'id'])||{})[_0xef95('0x6f')](function(_0x5e0fac){for(var _0x3c2f2c=0x0;_0x3c2f2c<_0x1ec20b[_0xef95('0x5e')][_0xef95('0x6a')][_0xef95('0x4b')];_0x3c2f2c+=0x1){socket[_0xef95('0x70')](_0xef95('0x71'),{'UserId':Number(_0x1ec20b['body']['ids'][_0x3c2f2c]),'WhatsappAccountId':Number(_0x1ec20b[_0xef95('0x64')]['id'])});}return _0x5e0fac;});}})['then'](respondWithResult(_0x5cc552,null))[_0xef95('0x27')](handleError(_0x5cc552,null));};exports[_0xef95('0x72')]=function(_0x479771,_0x44a9dc,_0x37963){return db[_0xef95('0x40')][_0xef95('0x63')]({'where':{'id':_0x479771[_0xef95('0x64')]['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x44a9dc,null))[_0xef95('0x35')](function(_0x24add2){if(_0x24add2){return _0x24add2[_0xef95('0x72')](_0x479771[_0xef95('0x49')][_0xef95('0x6a')])[_0xef95('0x35')](function(){if(_[_0xef95('0x73')](_0x479771['query']['ids'])){for(var _0x245028=0x0;_0x245028<_0x479771[_0xef95('0x49')][_0xef95('0x6a')]['length'];_0x245028+=0x1){socket[_0xef95('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x479771['query'][_0xef95('0x6a')][_0x245028]),'WhatsappAccountId':Number(_0x479771['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x479771[_0xef95('0x49')]['ids']),'WhatsappAccountId':Number(_0x479771[_0xef95('0x64')]['id'])});}});}})[_0xef95('0x35')](respondWithStatusCode(_0x44a9dc,null))[_0xef95('0x27')](handleError(_0x44a9dc,null));};exports[_0xef95('0x74')]=function(_0x19837a,_0x23aab2,_0x343789){var _0x20bd7d={};var _0x5530c2={};var _0x449fc9;var _0x2c116b;return db[_0xef95('0x40')][_0xef95('0x68')]({'where':{'id':_0x19837a['params']['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x23aab2,null))[_0xef95('0x35')](function(_0x9f229b){if(_0x9f229b){_0x449fc9=_0x9f229b;_0x5530c2[_0xef95('0x44')]=_[_0xef95('0x45')](db['User']['rawAttributes']);_0x5530c2['query']=_[_0xef95('0x45')](_0x19837a[_0xef95('0x49')]);_0x5530c2[_0xef95('0x46')]=_[_0xef95('0x47')](_0x5530c2[_0xef95('0x44')],_0x5530c2[_0xef95('0x49')]);_0x20bd7d[_0xef95('0x48')]=_[_0xef95('0x47')](_0x5530c2[_0xef95('0x44')],qs['fields'](_0x19837a['query'][_0xef95('0x4a')]));_0x20bd7d[_0xef95('0x48')]=_0x20bd7d[_0xef95('0x48')][_0xef95('0x4b')]?_0x20bd7d[_0xef95('0x48')]:_0x5530c2[_0xef95('0x44')];_0x20bd7d['order']=qs['sort'](_0x19837a[_0xef95('0x49')]['sort']);_0x20bd7d[_0xef95('0x52')]=qs['filters'](_[_0xef95('0x50')](_0x19837a[_0xef95('0x49')],_0x5530c2[_0xef95('0x46')]));if(_0x19837a[_0xef95('0x49')]['filter']){_0x20bd7d['where']=_[_0xef95('0x51')](_0x20bd7d['where'],{'$or':_[_0xef95('0x3f')](_0x20bd7d[_0xef95('0x48')],function(_0x1608cd){var _0x596db3={};_0x596db3[_0x1608cd]={'$like':'%'+_0x19837a[_0xef95('0x49')]['filter']+'%'};return _0x596db3;})});}_0x20bd7d=_[_0xef95('0x51')]({},_0x20bd7d,_0x19837a[_0xef95('0x56')]);return _0x449fc9['getAgents'](_0x20bd7d);}})[_0xef95('0x35')](function(_0x390e2c){if(_0x390e2c){_0x2c116b=_0x390e2c['length'];if(!_0x19837a[_0xef95('0x49')]['hasOwnProperty'](_0xef95('0x4d'))){_0x20bd7d[_0xef95('0x2d')]=qs[_0xef95('0x2d')](_0x19837a[_0xef95('0x49')]['limit']);_0x20bd7d[_0xef95('0x2c')]=qs[_0xef95('0x2c')](_0x19837a['query'][_0xef95('0x2c')]);}return _0x449fc9[_0xef95('0x74')](_0x20bd7d);}})['then'](function(_0x1334da){if(_0x1334da){return _0x1334da?{'count':_0x2c116b,'rows':_0x1334da}:null;}})[_0xef95('0x35')](respondWithResult(_0x23aab2,null))[_0xef95('0x27')](handleError(_0x23aab2,null));};exports[_0xef95('0x75')]=function(_0x1aad9f,_0x6b098f){var _0x19d010=_0x1aad9f[_0xef95('0x64')]['id'];var _0x35fdca=_0x1aad9f['body'];var _0x2d5348=0xc8;var _0x4c8ec5=null;return db[_0xef95('0x76')][_0xef95('0x77')]({'isolationLevel':db[_0xef95('0x76')][_0xef95('0x78')]['ISOLATION_LEVELS'][_0xef95('0x79')]},function(_0x2e4ac6){return db[_0xef95('0x40')][_0xef95('0x68')]({'where':{'id':_0x19d010},'transaction':_0x2e4ac6})[_0xef95('0x35')](function(_0x3f2266){if(_0x3f2266){return db[_0xef95('0x7a')][_0xef95('0x36')]({'where':{'WhatsappAccountId':_0x19d010},'transaction':_0x2e4ac6})[_0xef95('0x35')](function(){var _0x92dc58=_[_0xef95('0x3f')](_0x35fdca,function(_0x508a69){_0x508a69[_0xef95('0x67')]=_0x19d010;return _0x508a69;});return db[_0xef95('0x7a')][_0xef95('0x7b')](_0x92dc58,{'transaction':_0x2e4ac6});});}else{_0x2d5348=0x194;_0x4c8ec5=[];}});})[_0xef95('0x35')](function(){if(_0x2d5348!==0x194){return db[_0xef95('0x7a')][_0xef95('0x7c')]({'where':{'WhatsappAccountId':_0x19d010},'order':'priority'})[_0xef95('0x35')](function(_0x2ee80b){_0x4c8ec5=_0x2ee80b;});}})['catch'](function(_0x394f32){_0x2d5348=0x1f4;logger['error'](_0x394f32[_0xef95('0x3a')]);if(_0x394f32['name']){delete _0x394f32[_0xef95('0x3b')];}_0x4c8ec5=_0x394f32;})[_0xef95('0x7d')](function(){if(_0x4c8ec5===null){_0x6b098f[_0xef95('0x28')](_0x2d5348);}else{if(_0x2d5348===0x1f4){_0x6b098f[_0xef95('0x29')](_0x2d5348)[_0xef95('0x3c')](_0x4c8ec5);}else{_0x6b098f[_0xef95('0x29')](_0x2d5348)[_0xef95('0x30')](_0x4c8ec5);}}});};exports[_0xef95('0x7e')]=function(_0x5212e2,_0x3adaec,_0x40a4a1){var _0x4ca486={};var _0xc338e4={};var _0x2f6fb3;var _0x4dc8db;return db[_0xef95('0x40')][_0xef95('0x68')]({'where':{'id':_0x5212e2[_0xef95('0x64')]['id']}})[_0xef95('0x35')](handleEntityNotFound(_0x3adaec,null))[_0xef95('0x35')](function(_0x3f2ec5){if(_0x3f2ec5){_0x2f6fb3=_0x3f2ec5;_0xc338e4[_0xef95('0x44')]=_['keys'](db['WhatsappApplication'][_0xef95('0x41')]);_0xc338e4['query']=_[_0xef95('0x45')](_0x5212e2[_0xef95('0x49')]);_0xc338e4[_0xef95('0x46')]=_[_0xef95('0x47')](_0xc338e4[_0xef95('0x44')],_0xc338e4['query']);_0x4ca486[_0xef95('0x48')]=_[_0xef95('0x47')](_0xc338e4[_0xef95('0x44')],qs[_0xef95('0x4a')](_0x5212e2['query'][_0xef95('0x4a')]));_0x4ca486['attributes']=_0x4ca486[_0xef95('0x48')][_0xef95('0x4b')]?_0x4ca486[_0xef95('0x48')]:_0xc338e4[_0xef95('0x44')];_0x4ca486['order']=qs[_0xef95('0x4f')](_0x5212e2[_0xef95('0x49')]['sort']);_0x4ca486['where']=qs[_0xef95('0x46')](_[_0xef95('0x50')](_0x5212e2['query'],_0xc338e4[_0xef95('0x46')]));if(_0x5212e2[_0xef95('0x49')][_0xef95('0x55')]){_0x4ca486[_0xef95('0x52')]=_[_0xef95('0x51')](_0x4ca486['where'],{'$or':_[_0xef95('0x3f')](_0x4ca486[_0xef95('0x48')],function(_0x3e85f8){var _0x111b05={};_0x111b05[_0x3e85f8]={'$like':'%'+_0x5212e2[_0xef95('0x49')]['filter']+'%'};return _0x111b05;})});}_0x4ca486=_['merge']({},_0x4ca486,_0x5212e2[_0xef95('0x56')]);return _0x2f6fb3[_0xef95('0x7e')](_0x4ca486);}})[_0xef95('0x35')](function(_0xaf241a){if(_0xaf241a){_0x4dc8db=_0xaf241a[_0xef95('0x4b')];if(!_0x5212e2[_0xef95('0x49')][_0xef95('0x4c')](_0xef95('0x4d'))){_0x4ca486[_0xef95('0x2d')]=qs[_0xef95('0x2d')](_0x5212e2['query'][_0xef95('0x2d')]);_0x4ca486[_0xef95('0x2c')]=qs[_0xef95('0x2c')](_0x5212e2[_0xef95('0x49')][_0xef95('0x2c')]);}return _0x2f6fb3[_0xef95('0x7e')](_0x4ca486);}})[_0xef95('0x35')](function(_0x2ed536){if(_0x2ed536){return _0x2ed536?{'count':_0x4dc8db,'rows':_0x2ed536}:null;}})['then'](respondWithResult(_0x3adaec,null))[_0xef95('0x27')](handleError(_0x3adaec,null));};exports[_0xef95('0x7f')]=function(_0x26404b,_0x3ac4ed,_0x394d6e){var _0x350d0={'channel':_0xef95('0x80')};var _0x181972=[];var _0x50932d=[];var _0x2edd12={};return db[_0xef95('0x40')][_0xef95('0x63')]({'where':{'id':_0x26404b[_0xef95('0x64')]['id']},'include':[{'model':db[_0xef95('0x7a')],'as':_0xef95('0x81')}]})['then'](handleEntityNotFound(_0x3ac4ed,null))['then'](function(_0x438c24){_0x350d0[_0xef95('0x82')]=_0x438c24;if(_0x350d0[_0xef95('0x82')]&&_0x350d0[_0xef95('0x82')][_0xef95('0x53')]===_0xef95('0x83')&&_0x26404b[_0xef95('0x5e')][_0xef95('0x84')]){if(_0x26404b[_0xef95('0x5e')]['statuses'][_0xef95('0x4b')]===0x0)return;if(_0x26404b[_0xef95('0x5e')]['statuses'][0x0][_0xef95('0x85')]!=='read')return;return db['WhatsappMessage'][_0xef95('0x34')]({'read':!![],'readAt':_0x26404b[_0xef95('0x5e')]['statuses'][0x0][_0xef95('0x86')]},{'where':{'messageId':_0x26404b[_0xef95('0x5e')][_0xef95('0x84')][0x0][_0xef95('0x87')]},'individualHooks':!![]})[_0xef95('0x35')](function(_0xae785c){return _0x3ac4ed[_0xef95('0x29')](0xc8)[_0xef95('0x30')](_0xae785c);});}_0x350d0[_0xef95('0x88')]=_['orderBy'](_0x438c24[_0xef95('0x81')],[_0xef95('0x89')],[_0xef95('0x8a')]);if(_0x350d0['account'][_0xef95('0x81')]){delete _0x350d0[_0xef95('0x82')][_0xef95('0x81')];}return db[_0xef95('0x8b')][_0xef95('0x65')]()[_0xef95('0x35')](function(_0x48c281){if(!_0x48c281){throw new db['Sequelize'][(_0xef95('0x8c'))](_0xef95('0x8d'));}_0x181972=_[_0xef95('0x8e')](_[_0xef95('0x45')](_0x48c281),['createdAt',_0xef95('0x8f')]);_0x50932d=_[_0xef95('0x8e')](_[_0xef95('0x45')](_0x48c281),[_0xef95('0x90'),_0xef95('0x8f'),_0xef95('0x91'),_0xef95('0x92')]);_0x350d0[_0xef95('0x5e')]={'mapKey':_0xef95('0x93')};if(_0x350d0[_0xef95('0x82')]&&_0x350d0[_0xef95('0x82')][_0xef95('0x53')]===_0xef95('0x94')){_0x350d0[_0xef95('0x5e')][_0xef95('0x95')]=_0x26404b['body'][_0xef95('0x96')]['replace'](_0xef95('0x97'),'');_0x350d0[_0xef95('0x5e')][_0xef95('0x5e')]=_0x26404b[_0xef95('0x5e')][_0xef95('0x98')];_0x350d0[_0xef95('0x5e')][_0xef95('0x99')]=_0x26404b[_0xef95('0x5e')][_0xef95('0x9a')];}if(_0x350d0['account']&&_0x350d0[_0xef95('0x82')][_0xef95('0x53')]===_0xef95('0x83')){_0x350d0['body'][_0xef95('0x95')]=_0x26404b['body'][_0xef95('0x9b')][0x0][_0xef95('0x95')];_0x350d0[_0xef95('0x5e')][_0xef95('0x5e')]=_0x26404b[_0xef95('0x5e')][_0xef95('0x9b')][0x0][_0xef95('0x25')][_0xef95('0x5e')];_0x350d0['body'][_0xef95('0x99')]=_0x26404b[_0xef95('0x5e')][_0xef95('0x9b')][0x0][_0xef95('0x87')];}if(_0x350d0[_0xef95('0x5e')]['id']){delete _0x350d0[_0xef95('0x5e')]['id'];}if(_[_0xef95('0x9c')](_0x350d0[_0xef95('0x5e')][_0xef95('0x95')])){throw new db[(_0xef95('0x9d'))][(_0xef95('0x8c'))](_0xef95('0x9e'));}if(_[_0xef95('0x9c')](_0x350d0[_0xef95('0x5e')]['body'])||_0x350d0[_0xef95('0x5e')][_0xef95('0x5e')]===''){throw new db[(_0xef95('0x9d'))]['ValidationError'](_0xef95('0x9f'));}if(_[_0xef95('0x9c')](_0x350d0['body'][_0xef95('0xa0')])){throw new db[(_0xef95('0x9d'))][(_0xef95('0x8c'))](_0xef95('0xa1')+_0x50932d);}if(!_[_0xef95('0xa2')](_0x50932d,_0x350d0[_0xef95('0x5e')][_0xef95('0xa0')])){throw new db['Sequelize']['ValidationError'](_0xef95('0xa3')+_0x50932d);}_0x2edd12[_0x350d0['body'][_0xef95('0xa0')]]=_0x350d0[_0xef95('0x5e')][_0xef95('0x95')];return db[_0xef95('0xa4')][_0xef95('0x63')]({'where':{'id':_0x350d0[_0xef95('0x82')][_0xef95('0x92')]},'include':[{'model':db[_0xef95('0x8b')],'as':_0xef95('0xa5'),'where':_0x2edd12,'limit':0x1,'order':[[_0xef95('0x8f'),'DESC']]}]});})[_0xef95('0x35')](handleEntityNotFound(_0x3ac4ed,null))['then'](function(_0x4fabb0){if(_0x4fabb0){_0x350d0[_0xef95('0xa6')]=_[_0xef95('0x6e')](_0x4fabb0,['Contacts']);if(_0x4fabb0['Contacts'][_0xef95('0x4b')]){return _0x4fabb0[_0xef95('0xa5')][0x0];}var _0x1a05c8=_[_0xef95('0xa7')](_0x350d0[_0xef95('0x5e')],{'firstName':_0x350d0[_0xef95('0x5e')]['from'],'ListId':_0x4fabb0['id']});_0x1a05c8[_0x350d0[_0xef95('0x5e')][_0xef95('0xa0')]]=_0x350d0['body'][_0xef95('0x95')];return db['CmContact']['create'](_0x1a05c8,{'fields':_0x181972,'raw':!![]});}})[_0xef95('0x35')](handleEntityNotFound(_0x3ac4ed,null))['then'](function(_0x3a46a4){if(_0x3a46a4){_0x350d0[_0xef95('0xa8')]=_0x3a46a4;var _0x4d17cd={'ContactId':_0x3a46a4['id'],'phone':_0x350d0[_0xef95('0x5e')][_0xef95('0x95')],'WhatsappAccountId':_0x26404b[_0xef95('0x64')]['id']};var _0x3dffc9={'ContactId':_0x3a46a4['id'],'WhatsappAccountId':_0x26404b['params']['id'],'closed':![]};return db[_0xef95('0xa9')][_0xef95('0x63')]({'where':_0x3dffc9})[_0xef95('0x35')](function(_0x304ecb){if(_0x304ecb){return[_0x304ecb,![]];}return db['WhatsappInteraction']['create'](_0x4d17cd)[_0xef95('0x35')](function(_0x19118e){return[_0x19118e,!![]];});});}})[_0xef95('0x6f')](function(_0x249637,_0x14e13f){_0x350d0[_0xef95('0xaa')]=_0x249637[_0xef95('0x60')]({'plain':!![]});_0x350d0[_0xef95('0xaa')][_0xef95('0xab')]=![];if(_0x14e13f){if(_0x350d0[_0xef95('0x82')][_0xef95('0xac')]){_0x350d0[_0xef95('0x88')][_0xef95('0xad')]({'id':0x0,'priority':_0x350d0[_0xef95('0x88')][_0xef95('0x4b')]+0x1,'app':_0xef95('0xae'),'appdata':_0xef95('0xaf'),'interval':_0xef95('0xb0')});}_0x350d0['interaction']['created']=!![];}return db['WhatsappMessage'][_0xef95('0x5d')]({'phone':_0x350d0[_0xef95('0x5e')][_0xef95('0x95')],'messageId':_0x350d0['body'][_0xef95('0x99')],'body':_0x350d0[_0xef95('0x5e')][_0xef95('0x5e')],'WhatsappAccountId':_0x26404b[_0xef95('0x64')]['id'],'WhatsappInteractionId':_0x249637['id'],'direction':'in','ContactId':_0x249637['ContactId'],'AttachmentId':_0x350d0[_0xef95('0x5e')][_0xef95('0xb1')]});})[_0xef95('0x35')](function(_0x3c2a26){_0x350d0['message']=_0x3c2a26;if(_0x350d0[_0xef95('0xaa')][_0xef95('0xb2')]){return db[_0xef95('0xb3')][_0xef95('0x63')]({'attributes':['id','name'],'where':{'id':_0x350d0['interaction'][_0xef95('0xb2')]}})['then'](function(_0x82ecf1){if(_0x82ecf1){_0x350d0[_0xef95('0x88')][_0xef95('0xb4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x82ecf1[_0xef95('0x3b')]+','+(_0x350d0[_0xef95('0x82')][_0xef95('0xb5')]||0xa),'interval':_0xef95('0xb0')});}return respondWithRpcPromise(_0xef95('0xb6'),_0xef95('0xb7'),_0x350d0);});}return respondWithRpcPromise(_0xef95('0xb6'),_0xef95('0xb7'),_0x350d0);})[_0xef95('0x35')](function(_0x16b8bf){if(_0x16b8bf){var _0x2a339b=0xc8;var _0x587102='receiveMessage';logger[_0xef95('0x1f')](_0xef95('0x21'),_0x587102,_0x2a339b,'entity\x20found');logger[_0xef95('0xb8')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x587102,_0x2a339b,_0xef95('0xb9'),JSON[_0xef95('0xba')](_0x16b8bf));if(_0x350d0[_0xef95('0x82')][_0xef95('0x53')]===_0xef95('0x94')){return _0x3ac4ed['status'](_0x2a339b)[_0xef95('0x2e')]('Content-Type',_0xef95('0xbb'))[_0xef95('0x3c')](_0xef95('0xbc'));}else{return _0x3ac4ed[_0xef95('0x29')](_0x2a339b)['json'](_0x16b8bf);}}});})[_0xef95('0x27')](handleError(_0x3ac4ed,null));};exports[_0xef95('0x3c')]=function(_0x98b29,_0x112f2e,_0x28728d){var _0xb3b9c7,_0x152c77,_0xc2ebb0;if(_[_0xef95('0x9c')](_0x98b29[_0xef95('0x5e')][_0xef95('0x5e')])||_0x98b29[_0xef95('0x5e')][_0xef95('0x5e')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xef95('0x9c')](_0x98b29[_0xef95('0x5e')]['to'])){throw new db['Sequelize'][(_0xef95('0x8c'))](_0xef95('0xbd'));}_0xb3b9c7=_0x98b29[_0xef95('0x5e')]['to'];return db['WhatsappAccount'][_0xef95('0x63')]({'where':{'id':_0x98b29[_0xef95('0x64')]['id']},'include':[{'model':db[_0xef95('0xa4')],'as':_0xef95('0xbe'),'include':[{'model':db[_0xef95('0x8b')],'as':_0xef95('0xa5'),'where':{'mobile':_0xb3b9c7},'limit':0x1,'order':[[_0xef95('0x8f'),_0xef95('0xbf')]]}]}]})[_0xef95('0x35')](handleEntityNotFound(_0x112f2e,null))['then'](function(_0x1c8c9a){if(_0x1c8c9a&&_0x1c8c9a['List']){_0x152c77=_0x1c8c9a[_0xef95('0x60')]({'plain':!![]});if(_0x152c77[_0xef95('0xbe')]&&_0x152c77[_0xef95('0xbe')]['Contacts'][_0xef95('0x4b')]){return _0x152c77[_0xef95('0xbe')][_0xef95('0xa5')][0x0];}return db[_0xef95('0x8b')][_0xef95('0x5d')](_[_0xef95('0xa7')](_0x98b29[_0xef95('0x5e')],{'firstName':_0xb3b9c7,'mobile':_0xb3b9c7,'phone':_0xb3b9c7,'ListId':_0x152c77['ListId']}));}})['then'](handleEntityNotFound(_0x112f2e,null))[_0xef95('0x35')](function(_0x26cfb6){if(_0x26cfb6){_0xc2ebb0=_0x26cfb6;return db[_0xef95('0xa9')]['find']({'where':{'ContactId':_0xc2ebb0['id'],'closed':![],'WhatsappAccountId':_0x152c77['id']}})[_0xef95('0x35')](function(_0x24142e){if(_0x24142e){return[_0x24142e,![]];}return db[_0xef95('0xa9')]['create']({'UserId':_0x98b29[_0xef95('0x5f')]['id'],'ContactId':_0xc2ebb0['id'],'WhatsappAccountId':_0x152c77['id'],'phone':_0xb3b9c7,'firstMsgDirection':_0xef95('0xc0'),'Messages':[_['merge'](_0x98b29[_0xef95('0x5e')],{'read':![],'body':_0x98b29[_0xef95('0x5e')][_0xef95('0x5e')],'phone':_0xb3b9c7,'WhatsappAccountId':_0x152c77['id'],'UserId':_0x98b29[_0xef95('0x5f')]['id'],'ContactId':_0xc2ebb0['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xef95('0xc1')}]})['then'](function(_0x58af88){return[_0x58af88,!![]];});});}})['spread'](function(_0x48eb32,_0x105341){if(_0x105341){return _0x48eb32;}return db[_0xef95('0xc2')][_0xef95('0x5d')](_[_0xef95('0x51')](_0x98b29[_0xef95('0x5e')],{'read':![],'body':_0x98b29[_0xef95('0x5e')]['body'],'phone':_0xb3b9c7,'WhatsappAccountId':_0x152c77['id'],'WhatsappInteractionId':_0x48eb32['id'],'UserId':_0x98b29[_0xef95('0x5f')]['id'],'ContactId':_0xc2ebb0['id']}))['then'](function(_0x589a50){_0x48eb32['dataValues']['Messages']=[];_0x48eb32[_0xef95('0xc3')][_0xef95('0xc1')][_0xef95('0xad')](_0x589a50[_0xef95('0xc3')]);return _0x48eb32;});})[_0xef95('0x35')](respondWithResult(_0x112f2e,null))[_0xef95('0x27')](handleError(_0x112f2e,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index ad18f9d..343250f 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 _0xda72=['exports','WhatsappAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x394200,_0x41c5b9){var _0x3c08b3=function(_0x4fee64){while(--_0x4fee64){_0x394200['push'](_0x394200['shift']());}};_0x3c08b3(++_0x41c5b9);}(_0xda72,0x197));var _0x2da7=function(_0x13b5c0,_0x5f3fdf){_0x13b5c0=_0x13b5c0-0x0;var _0x34341f=_0xda72[_0x13b5c0];return _0x34341f;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x2da7('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2da7('0x1'),'afterUpdate':_0x2da7('0x2'),'afterDestroy':_0x2da7('0x3')};function emitEvent(_0x435624){return function(_0x29084e,_0xaf7b2a,_0x5d01d){WhatsappAccountEvents[_0x2da7('0x4')](_0x435624+':'+_0x29084e['id'],_0x29084e);WhatsappAccountEvents[_0x2da7('0x4')](_0x435624,_0x29084e);_0x5d01d(null);};}for(var e in events){if(events[_0x2da7('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x2da7('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x3ddc=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x10b92e,_0x51da0f){var _0x146dd2=function(_0x4e7243){while(--_0x4e7243){_0x10b92e['push'](_0x10b92e['shift']());}};_0x146dd2(++_0x51da0f);}(_0x3ddc,0x113));var _0xc3dd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3ddc[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xc3dd('0x0'))['db'][_0xc3dd('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc3dd('0x2')](0x0);var events={'afterCreate':_0xc3dd('0x3'),'afterUpdate':_0xc3dd('0x4'),'afterDestroy':_0xc3dd('0x5')};function emitEvent(_0x35687b){return function(_0x2ac624,_0x16176d,_0x53a344){WhatsappAccountEvents[_0xc3dd('0x6')](_0x35687b+':'+_0x2ac624['id'],_0x2ac624);WhatsappAccountEvents[_0xc3dd('0x6')](_0x35687b,_0x2ac624);_0x53a344(null);};}for(var e in events){if(events[_0xc3dd('0x7')](e)){var event=events[e];WhatsappAccount[_0xc3dd('0x8')](e,emitEvent(event));}}module[_0xc3dd('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 56717b3..550fa7d 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 _0x61e4=['path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','bluebird'];(function(_0x345517,_0x52222e){var _0x23d441=function(_0x2df73c){while(--_0x2df73c){_0x345517['push'](_0x345517['shift']());}};_0x23d441(++_0x52222e);}(_0x61e4,0x147));var _0x461e=function(_0x4aec3f,_0x2de89f){_0x4aec3f=_0x4aec3f-0x0;var _0x4f10cc=_0x61e4[_0x4aec3f];return _0x4f10cc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x461e('0x0'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x461e('0x1'));var rimraf=require('rimraf');var config=require(_0x461e('0x2'));var attributes=require(_0x461e('0x3'));module[_0x461e('0x4')]=function(_0x3ba700,_0x1bd771){return _0x3ba700[_0x461e('0x5')](_0x461e('0x6'),attributes,{'tableName':_0x461e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc54e=['moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger'];(function(_0x2d58bb,_0xa1e76e){var _0x3515e6=function(_0x4ed92b){while(--_0x4ed92b){_0x2d58bb['push'](_0x2d58bb['shift']());}};_0x3515e6(++_0xa1e76e);}(_0xc54e,0x127));var _0xec54=function(_0x42322d,_0x5567b8){_0x42322d=_0x42322d-0x0;var _0x409906=_0xc54e[_0x42322d];return _0x409906;};'use strict';var _=require(_0xec54('0x0'));var util=require('util');var logger=require(_0xec54('0x1'))('api');var moment=require(_0xec54('0x2'));var BPromise=require(_0xec54('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec54('0x4'));var rimraf=require(_0xec54('0x5'));var config=require(_0xec54('0x6'));var attributes=require(_0xec54('0x7'));module[_0xec54('0x8')]=function(_0x362241,_0x290be6){return _0x362241['define'](_0xec54('0x9'),attributes,{'tableName':_0xec54('0xa'),'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 c29c3e0..8873a3b 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 _0x4171=['stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','debug','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x4171,0xcf));var _0x1417=function(_0x59b4d3,_0x90b95e){_0x59b4d3=_0x59b4d3-0x0;var _0x21f4ce=_0x4171[_0x59b4d3];return _0x21f4ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1417('0x0'));var BPromise=require('bluebird');var rs=require(_0x1417('0x1'));var fs=require('fs');var Redis=require(_0x1417('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1417('0x3'));var logger=require(_0x1417('0x4'))(_0x1417('0x5'));var config=require(_0x1417('0x6'));var jayson=require(_0x1417('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x1417('0x8')]=_[_0x1417('0x9')](config[_0x1417('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x1417('0xa'))(new Redis(config[_0x1417('0x8')]));require('./whatsappAccount.socket')[_0x1417('0xb')](socket);function respondWithRpcPromise(_0x4d1a9e,_0x486e65,_0x1dcdbe){return new BPromise(function(_0x575599,_0x1fa0b){return client[_0x1417('0xc')](_0x4d1a9e,_0x1dcdbe)[_0x1417('0xd')](function(_0x1a2a84){logger[_0x1417('0xe')](_0x1417('0xf'),_0x486e65,_0x1417('0x10'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x486e65,_0x1417('0x10'),JSON[_0x1417('0x11')](_0x1a2a84));if(_0x1a2a84[_0x1417('0x12')]){if(_0x1a2a84[_0x1417('0x12')]['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x486e65,_0x1a2a84[_0x1417('0x12')][_0x1417('0x13')]);return _0x1fa0b(_0x1a2a84[_0x1417('0x12')][_0x1417('0x13')]);}logger[_0x1417('0x12')](_0x1417('0xf'),_0x486e65,_0x1a2a84[_0x1417('0x12')][_0x1417('0x13')]);return _0x575599(_0x1a2a84['error'][_0x1417('0x13')]);}else{logger[_0x1417('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x486e65,_0x1417('0x10'));_0x575599(_0x1a2a84[_0x1417('0x14')][_0x1417('0x13')]);}})[_0x1417('0x15')](function(_0x3a9755){logger[_0x1417('0x12')](_0x1417('0xf'),_0x486e65,_0x3a9755);_0x1fa0b(_0x3a9755);});});}exports[_0x1417('0x16')]=function(_0x5c4896){var _0x3868e1=this;return new Promise(function(_0x3e54ea,_0x442dc8){return db[_0x1417('0x17')]['find']({'raw':_0x5c4896['options']?_0x5c4896[_0x1417('0x18')][_0x1417('0x19')]===undefined?!![]:![]:!![],'where':_0x5c4896[_0x1417('0x18')]?_0x5c4896[_0x1417('0x18')][_0x1417('0x1a')]||null:null,'attributes':_0x5c4896[_0x1417('0x18')]?_0x5c4896[_0x1417('0x18')][_0x1417('0x1b')]||null:null,'include':_0x5c4896['options']?_0x5c4896[_0x1417('0x18')][_0x1417('0x1c')]?_[_0x1417('0x1d')](_0x5c4896['options'][_0x1417('0x1c')],function(_0x42e209){return{'model':db[_0x42e209[_0x1417('0x1e')]],'as':_0x42e209['as'],'attributes':_0x42e209['attributes'],'include':_0x42e209[_0x1417('0x1c')]?_['map'](_0x42e209[_0x1417('0x1c')],function(_0x1b7e7b){return{'model':db[_0x1b7e7b['model']],'as':_0x1b7e7b['as'],'attributes':_0x1b7e7b[_0x1417('0x1b')],'include':_0x1b7e7b[_0x1417('0x1c')]?_['map'](_0x1b7e7b[_0x1417('0x1c')],function(_0x3d3847){return{'model':db[_0x3d3847[_0x1417('0x1e')]],'as':_0x3d3847['as'],'attributes':_0x3d3847[_0x1417('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1417('0xd')](function(_0x2018ec){logger[_0x1417('0xe')](_0x1417('0x16'),_0x5c4896);logger[_0x1417('0x1f')]('ShowWhatsappAccount',_0x5c4896,JSON[_0x1417('0x11')](_0x2018ec));_0x3e54ea(_0x2018ec);})[_0x1417('0x15')](function(_0x336878){logger[_0x1417('0x12')](_0x1417('0x16'),_0x336878['message'],_0x5c4896);_0x442dc8(_0x3868e1[_0x1417('0x12')](0x1f4,_0x336878['message']));});});}; \ No newline at end of file +var _0xbe58=['raw','where','attributes','include','map','model','then','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options'];(function(_0x26c530,_0x3a9512){var _0x58bfff=function(_0x4ea4af){while(--_0x4ea4af){_0x26c530['push'](_0x26c530['shift']());}};_0x58bfff(++_0x3a9512);}(_0xbe58,0x19f));var _0x8be5=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xbe58[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8be5('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8be5('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8be5('0x2'));var logger=require(_0x8be5('0x3'))(_0x8be5('0x4'));var config=require(_0x8be5('0x5'));var jayson=require(_0x8be5('0x6'));var client=jayson[_0x8be5('0x7')]['http']({'port':0x232a});config['redis']=_[_0x8be5('0x8')](config[_0x8be5('0x9')],{'host':_0x8be5('0xa'),'port':0x18eb});var socket=require(_0x8be5('0xb'))(new Redis(config[_0x8be5('0x9')]));require('./whatsappAccount.socket')[_0x8be5('0xc')](socket);function respondWithRpcPromise(_0x38195c,_0x15c6e8,_0x124ea9){return new BPromise(function(_0x4e74bb,_0x554308){return client[_0x8be5('0xd')](_0x38195c,_0x124ea9)['then'](function(_0x44cc12){logger[_0x8be5('0xe')](_0x8be5('0xf'),_0x15c6e8,_0x8be5('0x10'));logger[_0x8be5('0x11')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x15c6e8,_0x8be5('0x10'),JSON[_0x8be5('0x12')](_0x44cc12));if(_0x44cc12['error']){if(_0x44cc12[_0x8be5('0x13')][_0x8be5('0x14')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x15c6e8,_0x44cc12['error'][_0x8be5('0x15')]);return _0x554308(_0x44cc12[_0x8be5('0x13')][_0x8be5('0x15')]);}logger[_0x8be5('0x13')](_0x8be5('0xf'),_0x15c6e8,_0x44cc12[_0x8be5('0x13')][_0x8be5('0x15')]);return _0x4e74bb(_0x44cc12[_0x8be5('0x13')]['message']);}else{logger[_0x8be5('0xe')](_0x8be5('0xf'),_0x15c6e8,'request\x20sent');_0x4e74bb(_0x44cc12['result'][_0x8be5('0x15')]);}})[_0x8be5('0x16')](function(_0x312acc){logger[_0x8be5('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x15c6e8,_0x312acc);_0x554308(_0x312acc);});});}exports[_0x8be5('0x17')]=function(_0x2af2a8){var _0x577efe=this;return new Promise(function(_0x3471d0,_0x2af8ed){return db[_0x8be5('0x18')][_0x8be5('0x19')]({'raw':_0x2af2a8[_0x8be5('0x1a')]?_0x2af2a8[_0x8be5('0x1a')][_0x8be5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2af2a8[_0x8be5('0x1a')]?_0x2af2a8[_0x8be5('0x1a')][_0x8be5('0x1c')]||null:null,'attributes':_0x2af2a8[_0x8be5('0x1a')]?_0x2af2a8[_0x8be5('0x1a')][_0x8be5('0x1d')]||null:null,'include':_0x2af2a8[_0x8be5('0x1a')]?_0x2af2a8[_0x8be5('0x1a')][_0x8be5('0x1e')]?_[_0x8be5('0x1f')](_0x2af2a8[_0x8be5('0x1a')]['include'],function(_0x31070a){return{'model':db[_0x31070a[_0x8be5('0x20')]],'as':_0x31070a['as'],'attributes':_0x31070a[_0x8be5('0x1d')],'include':_0x31070a[_0x8be5('0x1e')]?_[_0x8be5('0x1f')](_0x31070a[_0x8be5('0x1e')],function(_0xafe46c){return{'model':db[_0xafe46c[_0x8be5('0x20')]],'as':_0xafe46c['as'],'attributes':_0xafe46c['attributes'],'include':_0xafe46c[_0x8be5('0x1e')]?_['map'](_0xafe46c['include'],function(_0x592bd5){return{'model':db[_0x592bd5[_0x8be5('0x20')]],'as':_0x592bd5['as'],'attributes':_0x592bd5[_0x8be5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8be5('0x21')](function(_0x3ea4ec){logger[_0x8be5('0xe')](_0x8be5('0x17'),_0x2af2a8);logger[_0x8be5('0x11')](_0x8be5('0x17'),_0x2af2a8,JSON[_0x8be5('0x12')](_0x3ea4ec));_0x3471d0(_0x3ea4ec);})[_0x8be5('0x16')](function(_0x5a0902){logger[_0x8be5('0x13')](_0x8be5('0x17'),_0x5a0902[_0x8be5('0x15')],_0x2af2a8);_0x2af8ed(_0x577efe[_0x8be5('0x13')](0x1f4,_0x5a0902[_0x8be5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 900d890..768353d 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 _0x5b5b=['removeListener','register','whatsappAccount:','remove','emit'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5b5b,0x102));var _0xb5b5=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x5b5b[_0x50e593];return _0x3821d0;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0xb5b5('0x0'),'update'];function createListener(_0xd42807,_0x17e6a3){return function(_0x471332){_0x17e6a3[_0xb5b5('0x1')](_0xd42807,_0x471332);};}function removeListener(_0x298535,_0x1fcc76){return function(){WhatsappAccountEvents[_0xb5b5('0x2')](_0x298535,_0x1fcc76);};}exports[_0xb5b5('0x3')]=function(_0x48993e){for(var _0x3f21c3=0x0,_0x4983bc=events['length'];_0x3f21c3<_0x4983bc;_0x3f21c3++){var _0x443267=events[_0x3f21c3];var _0x6d28c5=createListener(_0xb5b5('0x4')+_0x443267,_0x48993e);WhatsappAccountEvents['on'](_0x443267,_0x6d28c5);}}; \ No newline at end of file +var _0xc33d=['register','length','./whatsappAccount.events','save','update','removeListener'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0xc33d,0x1c4));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0xdc33('0x0'));var events=[_0xdc33('0x1'),'remove',_0xdc33('0x2')];function createListener(_0x35c8af,_0x77b5b8){return function(_0x16989c){_0x77b5b8['emit'](_0x35c8af,_0x16989c);};}function removeListener(_0xd46cc7,_0x38fd01){return function(){WhatsappAccountEvents[_0xdc33('0x3')](_0xd46cc7,_0x38fd01);};}exports[_0xdc33('0x4')]=function(_0x41b1df){for(var _0x5e58f7=0x0,_0x3e9c1b=events[_0xdc33('0x5')];_0x5e58f7<_0x3e9c1b;_0x5e58f7++){var _0x13cec8=events[_0x5e58f7];var _0x49996d=createListener('whatsappAccount:'+_0x13cec8,_0x41b1df);WhatsappAccountEvents['on'](_0x13cec8,_0x49996d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index aebd68f..e1850e6 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 _0xea72=['destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xea72,0xc7));var _0x2ea7=function(_0xb041f9,_0x4f2970){_0xb041f9=_0xb041f9-0x0;var _0x69399d=_0xea72[_0xb041f9];return _0x69399d;};'use strict';var multer=require(_0x2ea7('0x0'));var util=require('util');var path=require(_0x2ea7('0x1'));var timeout=require('connect-timeout');var express=require(_0x2ea7('0x2'));var router=express[_0x2ea7('0x3')]();var fs_extra=require(_0x2ea7('0x4'));var auth=require(_0x2ea7('0x5'));var interaction=require(_0x2ea7('0x6'));var config=require('../../config/environment');var controller=require(_0x2ea7('0x7'));router[_0x2ea7('0x8')]('/',auth[_0x2ea7('0x9')](),controller[_0x2ea7('0xa')]);router[_0x2ea7('0x8')](_0x2ea7('0xb'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0xc')]);router[_0x2ea7('0xd')]('/',auth[_0x2ea7('0x9')](),controller[_0x2ea7('0xe')]);router[_0x2ea7('0xf')](_0x2ea7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2ea7('0x10')](_0x2ea7('0xb'),auth[_0x2ea7('0x9')](),controller[_0x2ea7('0x11')]);module['exports']=router; \ No newline at end of file +var _0x27f6=['show','create','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x41ac1d,_0x38aff9){var _0x3e9aec=function(_0x33aef0){while(--_0x33aef0){_0x41ac1d['push'](_0x41ac1d['shift']());}};_0x3e9aec(++_0x38aff9);}(_0x27f6,0xae));var _0x627f=function(_0x4acf7f,_0x2dad2f){_0x4acf7f=_0x4acf7f-0x0;var _0x373b11=_0x27f6[_0x4acf7f];return _0x373b11;};'use strict';var multer=require(_0x627f('0x0'));var util=require('util');var path=require(_0x627f('0x1'));var timeout=require(_0x627f('0x2'));var express=require(_0x627f('0x3'));var router=express[_0x627f('0x4')]();var fs_extra=require(_0x627f('0x5'));var auth=require(_0x627f('0x6'));var interaction=require(_0x627f('0x7'));var config=require(_0x627f('0x8'));var controller=require('./whatsappApplication.controller');router[_0x627f('0x9')]('/',auth[_0x627f('0xa')](),controller[_0x627f('0xb')]);router[_0x627f('0x9')](_0x627f('0xc'),auth[_0x627f('0xa')](),controller[_0x627f('0xd')]);router['post']('/',auth[_0x627f('0xa')](),controller[_0x627f('0xe')]);router[_0x627f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x627f('0x10')]);router['delete'](_0x627f('0xc'),auth[_0x627f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 102af27..1700472 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 _0xbc76=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4d830e,_0x4bb30e){var _0x4c0515=function(_0x2ec963){while(--_0x2ec963){_0x4d830e['push'](_0x4d830e['shift']());}};_0x4c0515(++_0x4bb30e);}(_0xbc76,0xbd));var _0x6bc7=function(_0x269a5e,_0x232106){_0x269a5e=_0x269a5e-0x0;var _0x9ef8ee=_0xbc76[_0x269a5e];return _0x9ef8ee;};'use strict';var Sequelize=require(_0x6bc7('0x0'));module[_0x6bc7('0x1')]={'priority':{'type':Sequelize[_0x6bc7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6bc7('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6bc7('0x4')]()},'description':{'type':Sequelize[_0x6bc7('0x3')]},'interval':{'type':Sequelize[_0x6bc7('0x3')],'defaultValue':_0x6bc7('0x5')}}; \ No newline at end of file +var _0xec32=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x1e06cc,_0x2c9b24){var _0x291857=function(_0x4cdc2c){while(--_0x4cdc2c){_0x1e06cc['push'](_0x1e06cc['shift']());}};_0x291857(++_0x2c9b24);}(_0xec32,0x19f));var _0x2ec3=function(_0x60710,_0x22fa62){_0x60710=_0x60710-0x0;var _0x56a174=_0xec32[_0x60710];return _0x56a174;};'use strict';var Sequelize=require(_0x2ec3('0x0'));module[_0x2ec3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2ec3('0x2')},'appdata':{'type':Sequelize[_0x2ec3('0x3')]()},'description':{'type':Sequelize[_0x2ec3('0x4')]},'interval':{'type':Sequelize[_0x2ec3('0x4')],'defaultValue':_0x2ec3('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index a96a145..1b35feb 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 _0xb7f0=['type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xb7f0[_0x2d9535];return _0xb4e710;};'use strict';var emlformat=require(_0x0b7f('0x0'));var rimraf=require(_0x0b7f('0x1'));var zipdir=require(_0x0b7f('0x2'));var jsonpatch=require(_0x0b7f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0b7f('0x4'));var Mustache=require(_0x0b7f('0x5'));var util=require(_0x0b7f('0x6'));var path=require(_0x0b7f('0x7'));var sox=require(_0x0b7f('0x8'));var csv=require(_0x0b7f('0x9'));var ejs=require(_0x0b7f('0xa'));var fs=require('fs');var fs_extra=require(_0x0b7f('0xb'));var _=require(_0x0b7f('0xc'));var squel=require(_0x0b7f('0xd'));var crypto=require('crypto');var jsforce=require(_0x0b7f('0xe'));var deskjs=require(_0x0b7f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0b7f('0x10'));var Papa=require(_0x0b7f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b7f('0x12'));var hardwareService=require(_0x0b7f('0x13'));var logger=require(_0x0b7f('0x14'))(_0x0b7f('0x15'));var utils=require(_0x0b7f('0x16'));var config=require(_0x0b7f('0x17'));var licenseUtil=require(_0x0b7f('0x18'));var db=require(_0x0b7f('0x19'))['db'];function respondWithStatusCode(_0x1af907,_0x34121a){_0x34121a=_0x34121a||0xcc;return function(_0x930432){if(_0x930432){return _0x1af907['sendStatus'](_0x34121a);}return _0x1af907[_0x0b7f('0x1a')](_0x34121a)[_0x0b7f('0x1b')]();};}function respondWithResult(_0x1e3f86,_0x19ddf2){_0x19ddf2=_0x19ddf2||0xc8;return function(_0x294db5){if(_0x294db5){return _0x1e3f86[_0x0b7f('0x1a')](_0x19ddf2)[_0x0b7f('0x1c')](_0x294db5);}};}function respondWithFilteredResult(_0x18069a,_0x5a2b0b){return function(_0x20e15d){if(_0x20e15d){var _0x1d223f=typeof _0x5a2b0b[_0x0b7f('0x1d')]===_0x0b7f('0x1e')&&typeof _0x5a2b0b['limit']===_0x0b7f('0x1e');var _0x3f6463=_0x20e15d[_0x0b7f('0x1f')];var _0x168e7e=_0x1d223f?0x0:_0x5a2b0b[_0x0b7f('0x1d')];var _0x50cee2=_0x1d223f?_0x20e15d[_0x0b7f('0x1f')]:_0x5a2b0b['offset']+_0x5a2b0b['limit'];var _0x36a619;if(_0x50cee2>=_0x3f6463){_0x50cee2=_0x3f6463;_0x36a619=0xc8;}else{_0x36a619=0xce;}_0x18069a[_0x0b7f('0x1a')](_0x36a619);return _0x18069a[_0x0b7f('0x20')](_0x0b7f('0x21'),_0x168e7e+'-'+_0x50cee2+'/'+_0x3f6463)[_0x0b7f('0x1c')](_0x20e15d);}return null;};}function patchUpdates(_0x52abc6){return function(_0x55362c){try{jsonpatch[_0x0b7f('0x22')](_0x55362c,_0x52abc6,!![]);}catch(_0x3ca024){return BPromise[_0x0b7f('0x23')](_0x3ca024);}return _0x55362c['save']();};}function saveUpdates(_0xb130f0,_0x1ec1d3){return function(_0x26f974){if(_0x26f974){return _0x26f974[_0x0b7f('0x24')](_0xb130f0)[_0x0b7f('0x25')](function(_0x44a0ae){return _0x44a0ae;});}return null;};}function removeEntity(_0x459389,_0x45ab0e){return function(_0xc74a5d){if(_0xc74a5d){return _0xc74a5d['destroy']()[_0x0b7f('0x25')](function(){_0x459389[_0x0b7f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50776a,_0x4a2841){return function(_0x37a5e5){if(!_0x37a5e5){_0x50776a[_0x0b7f('0x26')](0x194);}return _0x37a5e5;};}function handleError(_0x4e61be,_0xd3cb99){_0xd3cb99=_0xd3cb99||0x1f4;return function(_0x3cda59){logger[_0x0b7f('0x27')](_0x3cda59[_0x0b7f('0x28')]);if(_0x3cda59[_0x0b7f('0x29')]){delete _0x3cda59[_0x0b7f('0x29')];}_0x4e61be[_0x0b7f('0x1a')](_0xd3cb99)[_0x0b7f('0x2a')](_0x3cda59);};}exports[_0x0b7f('0x2b')]=function(_0x4ae467,_0x599bae){var _0x4ada58={},_0x3ea675={},_0x4f7e74={'count':0x0,'rows':[]};var _0x34b54c=_[_0x0b7f('0x2c')](db[_0x0b7f('0x2d')][_0x0b7f('0x2e')],function(_0x2d4727){return{'name':_0x2d4727[_0x0b7f('0x2f')],'type':_0x2d4727[_0x0b7f('0x30')]['key']};});_0x3ea675['model']=_[_0x0b7f('0x2c')](_0x34b54c,'name');_0x3ea675[_0x0b7f('0x31')]=_[_0x0b7f('0x32')](_0x4ae467[_0x0b7f('0x31')]);_0x3ea675[_0x0b7f('0x33')]=_[_0x0b7f('0x34')](_0x3ea675[_0x0b7f('0x35')],_0x3ea675[_0x0b7f('0x31')]);_0x4ada58[_0x0b7f('0x36')]=_[_0x0b7f('0x34')](_0x3ea675['model'],qs['fields'](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x37')]));_0x4ada58[_0x0b7f('0x36')]=_0x4ada58[_0x0b7f('0x36')][_0x0b7f('0x38')]?_0x4ada58[_0x0b7f('0x36')]:_0x3ea675[_0x0b7f('0x35')];if(!_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x39')]('nolimit')){_0x4ada58['limit']=qs[_0x0b7f('0x3a')](_0x4ae467['query'][_0x0b7f('0x3a')]);_0x4ada58['offset']=qs[_0x0b7f('0x1d')](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x1d')]);}_0x4ada58[_0x0b7f('0x3b')]=qs[_0x0b7f('0x3c')](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x3c')]);_0x4ada58[_0x0b7f('0x3d')]=qs[_0x0b7f('0x33')](_['pick'](_0x4ae467['query'],_0x3ea675['filters']),_0x34b54c);if(_0x4ae467[_0x0b7f('0x31')]['filter']){_0x4ada58[_0x0b7f('0x3d')]=_[_0x0b7f('0x3e')](_0x4ada58[_0x0b7f('0x3d')],{'$or':_[_0x0b7f('0x2c')](_0x34b54c,function(_0x1e2f6c){if(_0x1e2f6c['type']!==_0x0b7f('0x3f')){var _0x2eafb6={};_0x2eafb6[_0x1e2f6c[_0x0b7f('0x29')]]={'$like':'%'+_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x40')]+'%'};return _0x2eafb6;}})});}_0x4ada58=_['merge']({},_0x4ada58,_0x4ae467[_0x0b7f('0x41')]);var _0x2f5351={'where':_0x4ada58[_0x0b7f('0x3d')]};return db[_0x0b7f('0x2d')][_0x0b7f('0x1f')](_0x2f5351)[_0x0b7f('0x25')](function(_0x40b1c5){_0x4f7e74[_0x0b7f('0x1f')]=_0x40b1c5;if(_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x42')]){_0x4ada58[_0x0b7f('0x43')]=[{'all':!![]}];}return db[_0x0b7f('0x2d')][_0x0b7f('0x44')](_0x4ada58);})['then'](function(_0x4aaf15){_0x4f7e74[_0x0b7f('0x45')]=_0x4aaf15;return _0x4f7e74;})[_0x0b7f('0x25')](respondWithFilteredResult(_0x599bae,_0x4ada58))[_0x0b7f('0x46')](handleError(_0x599bae,null));};exports[_0x0b7f('0x47')]=function(_0x2c25fc,_0x230c6b){var _0x57c147={'raw':!![],'where':{'id':_0x2c25fc[_0x0b7f('0x48')]['id']}},_0x2176c6={};_0x2176c6[_0x0b7f('0x35')]=_[_0x0b7f('0x32')](db['WhatsappApplication'][_0x0b7f('0x2e')]);_0x2176c6['query']=_[_0x0b7f('0x32')](_0x2c25fc[_0x0b7f('0x31')]);_0x2176c6[_0x0b7f('0x33')]=_[_0x0b7f('0x34')](_0x2176c6[_0x0b7f('0x35')],_0x2176c6['query']);_0x57c147[_0x0b7f('0x36')]=_[_0x0b7f('0x34')](_0x2176c6[_0x0b7f('0x35')],qs[_0x0b7f('0x37')](_0x2c25fc[_0x0b7f('0x31')][_0x0b7f('0x37')]));_0x57c147[_0x0b7f('0x36')]=_0x57c147[_0x0b7f('0x36')][_0x0b7f('0x38')]?_0x57c147[_0x0b7f('0x36')]:_0x2176c6[_0x0b7f('0x35')];if(_0x2c25fc[_0x0b7f('0x31')][_0x0b7f('0x42')]){_0x57c147['include']=[{'all':!![]}];}_0x57c147=_[_0x0b7f('0x3e')]({},_0x57c147,_0x2c25fc[_0x0b7f('0x41')]);return db[_0x0b7f('0x2d')][_0x0b7f('0x49')](_0x57c147)[_0x0b7f('0x25')](handleEntityNotFound(_0x230c6b,null))[_0x0b7f('0x25')](respondWithResult(_0x230c6b,null))[_0x0b7f('0x46')](handleError(_0x230c6b,null));};exports['create']=function(_0x4d432b,_0x562843){return db[_0x0b7f('0x2d')][_0x0b7f('0x4a')](_0x4d432b['body'],{})[_0x0b7f('0x25')](respondWithResult(_0x562843,0xc9))[_0x0b7f('0x46')](handleError(_0x562843,null));};exports['update']=function(_0x2469e2,_0x4a825c){if(_0x2469e2[_0x0b7f('0x4b')]['id']){delete _0x2469e2['body']['id'];}return db[_0x0b7f('0x2d')][_0x0b7f('0x49')]({'where':{'id':_0x2469e2[_0x0b7f('0x48')]['id']}})[_0x0b7f('0x25')](handleEntityNotFound(_0x4a825c,null))[_0x0b7f('0x25')](saveUpdates(_0x2469e2[_0x0b7f('0x4b')],null))[_0x0b7f('0x25')](respondWithResult(_0x4a825c,null))[_0x0b7f('0x46')](handleError(_0x4a825c,null));};exports[_0x0b7f('0x4c')]=function(_0x3cfa81,_0x23e3ef){return db[_0x0b7f('0x2d')][_0x0b7f('0x49')]({'where':{'id':_0x3cfa81[_0x0b7f('0x48')]['id']}})['then'](handleEntityNotFound(_0x23e3ef,null))[_0x0b7f('0x25')](removeEntity(_0x23e3ef,null))[_0x0b7f('0x46')](handleError(_0x23e3ef,null));}; \ No newline at end of file +var _0xb7ae=['include','find','create','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show'];(function(_0x1bd54a,_0x5edb0a){var _0xd4f512=function(_0x4a1671){while(--_0x4a1671){_0x1bd54a['push'](_0x1bd54a['shift']());}};_0xd4f512(++_0x5edb0a);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x5792e5,_0x23d61a){_0x5792e5=_0x5792e5-0x0;var _0x3fabc3=_0xb7ae[_0x5792e5];return _0x3fabc3;};'use strict';var emlformat=require(_0xeb7a('0x0'));var rimraf=require(_0xeb7a('0x1'));var zipdir=require(_0xeb7a('0x2'));var jsonpatch=require(_0xeb7a('0x3'));var rp=require(_0xeb7a('0x4'));var moment=require('moment');var BPromise=require(_0xeb7a('0x5'));var Mustache=require(_0xeb7a('0x6'));var util=require(_0xeb7a('0x7'));var path=require('path');var sox=require(_0xeb7a('0x8'));var csv=require(_0xeb7a('0x9'));var ejs=require(_0xeb7a('0xa'));var fs=require('fs');var fs_extra=require(_0xeb7a('0xb'));var _=require(_0xeb7a('0xc'));var squel=require('squel');var crypto=require(_0xeb7a('0xd'));var jsforce=require(_0xeb7a('0xe'));var deskjs=require(_0xeb7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb7a('0x10'));var Papa=require(_0xeb7a('0x11'));var Redis=require(_0xeb7a('0x12'));var authService=require(_0xeb7a('0x13'));var qs=require(_0xeb7a('0x14'));var as=require(_0xeb7a('0x15'));var hardwareService=require(_0xeb7a('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xeb7a('0x17'));var config=require(_0xeb7a('0x18'));var licenseUtil=require(_0xeb7a('0x19'));var db=require(_0xeb7a('0x1a'))['db'];function respondWithStatusCode(_0x13bcf4,_0x203723){_0x203723=_0x203723||0xcc;return function(_0x166e4d){if(_0x166e4d){return _0x13bcf4['sendStatus'](_0x203723);}return _0x13bcf4[_0xeb7a('0x1b')](_0x203723)[_0xeb7a('0x1c')]();};}function respondWithResult(_0x4e86a7,_0x110acb){_0x110acb=_0x110acb||0xc8;return function(_0x186ea3){if(_0x186ea3){return _0x4e86a7['status'](_0x110acb)[_0xeb7a('0x1d')](_0x186ea3);}};}function respondWithFilteredResult(_0x5db84f,_0x5d953f){return function(_0x388666){if(_0x388666){var _0x5e6256=typeof _0x5d953f['offset']===_0xeb7a('0x1e')&&typeof _0x5d953f[_0xeb7a('0x1f')]===_0xeb7a('0x1e');var _0x2d92c7=_0x388666['count'];var _0x4be13e=_0x5e6256?0x0:_0x5d953f[_0xeb7a('0x20')];var _0x26bd85=_0x5e6256?_0x388666['count']:_0x5d953f['offset']+_0x5d953f[_0xeb7a('0x1f')];var _0x25a399;if(_0x26bd85>=_0x2d92c7){_0x26bd85=_0x2d92c7;_0x25a399=0xc8;}else{_0x25a399=0xce;}_0x5db84f[_0xeb7a('0x1b')](_0x25a399);return _0x5db84f[_0xeb7a('0x21')](_0xeb7a('0x22'),_0x4be13e+'-'+_0x26bd85+'/'+_0x2d92c7)[_0xeb7a('0x1d')](_0x388666);}return null;};}function patchUpdates(_0x29fa3f){return function(_0x120128){try{jsonpatch['apply'](_0x120128,_0x29fa3f,!![]);}catch(_0x431d4a){return BPromise[_0xeb7a('0x23')](_0x431d4a);}return _0x120128['save']();};}function saveUpdates(_0x5af915,_0xeab362){return function(_0x434aac){if(_0x434aac){return _0x434aac[_0xeb7a('0x24')](_0x5af915)[_0xeb7a('0x25')](function(_0x29db91){return _0x29db91;});}return null;};}function removeEntity(_0x44cefc,_0xfb62a5){return function(_0x4c4816){if(_0x4c4816){return _0x4c4816[_0xeb7a('0x26')]()[_0xeb7a('0x25')](function(){_0x44cefc[_0xeb7a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10b7d3,_0x1cf8f6){return function(_0x182335){if(!_0x182335){_0x10b7d3[_0xeb7a('0x27')](0x194);}return _0x182335;};}function handleError(_0x53ade4,_0x15199a){_0x15199a=_0x15199a||0x1f4;return function(_0x52e882){logger[_0xeb7a('0x28')](_0x52e882[_0xeb7a('0x29')]);if(_0x52e882[_0xeb7a('0x2a')]){delete _0x52e882[_0xeb7a('0x2a')];}_0x53ade4[_0xeb7a('0x1b')](_0x15199a)[_0xeb7a('0x2b')](_0x52e882);};}exports[_0xeb7a('0x2c')]=function(_0x3917eb,_0x2a492f){var _0x20a197={},_0x2d2f9f={},_0x567bbe={'count':0x0,'rows':[]};var _0x34b88b=_[_0xeb7a('0x2d')](db[_0xeb7a('0x2e')][_0xeb7a('0x2f')],function(_0x14e2e1){return{'name':_0x14e2e1[_0xeb7a('0x30')],'type':_0x14e2e1[_0xeb7a('0x31')][_0xeb7a('0x32')]};});_0x2d2f9f[_0xeb7a('0x33')]=_[_0xeb7a('0x2d')](_0x34b88b,_0xeb7a('0x2a'));_0x2d2f9f['query']=_[_0xeb7a('0x34')](_0x3917eb[_0xeb7a('0x35')]);_0x2d2f9f[_0xeb7a('0x36')]=_[_0xeb7a('0x37')](_0x2d2f9f['model'],_0x2d2f9f[_0xeb7a('0x35')]);_0x20a197[_0xeb7a('0x38')]=_[_0xeb7a('0x37')](_0x2d2f9f[_0xeb7a('0x33')],qs[_0xeb7a('0x39')](_0x3917eb[_0xeb7a('0x35')]['fields']));_0x20a197[_0xeb7a('0x38')]=_0x20a197[_0xeb7a('0x38')][_0xeb7a('0x3a')]?_0x20a197[_0xeb7a('0x38')]:_0x2d2f9f[_0xeb7a('0x33')];if(!_0x3917eb[_0xeb7a('0x35')]['hasOwnProperty'](_0xeb7a('0x3b'))){_0x20a197['limit']=qs[_0xeb7a('0x1f')](_0x3917eb[_0xeb7a('0x35')]['limit']);_0x20a197[_0xeb7a('0x20')]=qs[_0xeb7a('0x20')](_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x20')]);}_0x20a197[_0xeb7a('0x3c')]=qs[_0xeb7a('0x3d')](_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3d')]);_0x20a197['where']=qs[_0xeb7a('0x36')](_[_0xeb7a('0x3e')](_0x3917eb['query'],_0x2d2f9f[_0xeb7a('0x36')]),_0x34b88b);if(_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3f')]){_0x20a197[_0xeb7a('0x40')]=_[_0xeb7a('0x41')](_0x20a197[_0xeb7a('0x40')],{'$or':_[_0xeb7a('0x2d')](_0x34b88b,function(_0x573e30){if(_0x573e30[_0xeb7a('0x31')]!==_0xeb7a('0x42')){var _0x308a2e={};_0x308a2e[_0x573e30[_0xeb7a('0x2a')]]={'$like':'%'+_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3f')]+'%'};return _0x308a2e;}})});}_0x20a197=_[_0xeb7a('0x41')]({},_0x20a197,_0x3917eb[_0xeb7a('0x43')]);var _0x414580={'where':_0x20a197[_0xeb7a('0x40')]};return db[_0xeb7a('0x2e')][_0xeb7a('0x44')](_0x414580)['then'](function(_0x2d3d4d){_0x567bbe[_0xeb7a('0x44')]=_0x2d3d4d;if(_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x45')]){_0x20a197['include']=[{'all':!![]}];}return db[_0xeb7a('0x2e')][_0xeb7a('0x46')](_0x20a197);})[_0xeb7a('0x25')](function(_0x1803d6){_0x567bbe[_0xeb7a('0x47')]=_0x1803d6;return _0x567bbe;})[_0xeb7a('0x25')](respondWithFilteredResult(_0x2a492f,_0x20a197))['catch'](handleError(_0x2a492f,null));};exports[_0xeb7a('0x48')]=function(_0x1b1575,_0x48d620){var _0x436346={'raw':!![],'where':{'id':_0x1b1575['params']['id']}},_0x58c004={};_0x58c004['model']=_[_0xeb7a('0x34')](db[_0xeb7a('0x2e')][_0xeb7a('0x2f')]);_0x58c004[_0xeb7a('0x35')]=_[_0xeb7a('0x34')](_0x1b1575[_0xeb7a('0x35')]);_0x58c004['filters']=_['intersection'](_0x58c004[_0xeb7a('0x33')],_0x58c004['query']);_0x436346[_0xeb7a('0x38')]=_[_0xeb7a('0x37')](_0x58c004[_0xeb7a('0x33')],qs[_0xeb7a('0x39')](_0x1b1575['query'][_0xeb7a('0x39')]));_0x436346[_0xeb7a('0x38')]=_0x436346[_0xeb7a('0x38')][_0xeb7a('0x3a')]?_0x436346['attributes']:_0x58c004[_0xeb7a('0x33')];if(_0x1b1575['query'][_0xeb7a('0x45')]){_0x436346[_0xeb7a('0x49')]=[{'all':!![]}];}_0x436346=_[_0xeb7a('0x41')]({},_0x436346,_0x1b1575[_0xeb7a('0x43')]);return db[_0xeb7a('0x2e')][_0xeb7a('0x4a')](_0x436346)[_0xeb7a('0x25')](handleEntityNotFound(_0x48d620,null))['then'](respondWithResult(_0x48d620,null))['catch'](handleError(_0x48d620,null));};exports[_0xeb7a('0x4b')]=function(_0x3d48c8,_0x18c60f){return db[_0xeb7a('0x2e')][_0xeb7a('0x4b')](_0x3d48c8['body'],{})['then'](respondWithResult(_0x18c60f,0xc9))[_0xeb7a('0x4c')](handleError(_0x18c60f,null));};exports['update']=function(_0x202753,_0x5846bc){if(_0x202753[_0xeb7a('0x4d')]['id']){delete _0x202753[_0xeb7a('0x4d')]['id'];}return db[_0xeb7a('0x2e')][_0xeb7a('0x4a')]({'where':{'id':_0x202753[_0xeb7a('0x4e')]['id']}})[_0xeb7a('0x25')](handleEntityNotFound(_0x5846bc,null))[_0xeb7a('0x25')](saveUpdates(_0x202753[_0xeb7a('0x4d')],null))[_0xeb7a('0x25')](respondWithResult(_0x5846bc,null))[_0xeb7a('0x4c')](handleError(_0x5846bc,null));};exports[_0xeb7a('0x26')]=function(_0x466a2f,_0x55eb50){return db[_0xeb7a('0x2e')][_0xeb7a('0x4a')]({'where':{'id':_0x466a2f[_0xeb7a('0x4e')]['id']}})[_0xeb7a('0x25')](handleEntityNotFound(_0x55eb50,null))[_0xeb7a('0x25')](removeEntity(_0x55eb50,null))[_0xeb7a('0x4c')](handleError(_0x55eb50,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 5e7fecc..9a7e8b6 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 _0x885e=['lodash','util','api','moment','bluebird','request-promise','path','./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x10c842,_0x347cbc){var _0x4af982=function(_0x1a0308){while(--_0x1a0308){_0x10c842['push'](_0x10c842['shift']());}};_0x4af982(++_0x347cbc);}(_0x885e,0xe4));var _0xe885=function(_0x3db084,_0x21a397){_0x3db084=_0x3db084-0x0;var _0x400818=_0x885e[_0x3db084];return _0x400818;};'use strict';var _=require(_0xe885('0x0'));var util=require(_0xe885('0x1'));var logger=require('../../config/logger')(_0xe885('0x2'));var moment=require(_0xe885('0x3'));var BPromise=require(_0xe885('0x4'));var rp=require(_0xe885('0x5'));var fs=require('fs');var path=require(_0xe885('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe885('0x7'));module[_0xe885('0x8')]=function(_0x33286a,_0x1a5fd6){return _0x33286a['define'](_0xe885('0x9'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe885('0xa'),'collate':_0xe885('0xb')});}; \ No newline at end of file +var _0xb0b9=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x409c8d,_0x168a1a){var _0x423ba2=function(_0x80619f){while(--_0x80619f){_0x409c8d['push'](_0x409c8d['shift']());}};_0x423ba2(++_0x168a1a);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x3eadb8,_0x97c00d){_0x3eadb8=_0x3eadb8-0x0;var _0x4369bb=_0xb0b9[_0x3eadb8];return _0x4369bb;};'use strict';var _=require(_0x9b0b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9b0b('0x1'));var moment=require(_0x9b0b('0x2'));var BPromise=require(_0x9b0b('0x3'));var rp=require(_0x9b0b('0x4'));var fs=require('fs');var path=require(_0x9b0b('0x5'));var rimraf=require(_0x9b0b('0x6'));var config=require(_0x9b0b('0x7'));var attributes=require(_0x9b0b('0x8'));module[_0x9b0b('0x9')]=function(_0x24d4a9,_0x2c3d97){return _0x24d4a9[_0x9b0b('0xa')](_0x9b0b('0xb'),attributes,{'tableName':_0x9b0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 14c37ee..0a5d2b0 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 _0xed1f=['request','then','info','WhatsappApplication,\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(_0xdc5668,_0x153111){var _0x2561a7=function(_0x3bbcba){while(--_0x3bbcba){_0xdc5668['push'](_0xdc5668['shift']());}};_0x2561a7(++_0x153111);}(_0xed1f,0x6a));var _0xfed1=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xed1f[_0xe73080];return _0x12cbc4;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3d2d4c,_0x4abd98){var _0x177f01=function(_0x3f43ea){while(--_0x3f43ea){_0x3d2d4c['push'](_0x3d2d4c['shift']());}};_0x177f01(++_0x4abd98);}(_0x70e0,0x17b));var _0x070e=function(_0x2e2509,_0x45f9d4){_0x2e2509=_0x2e2509-0x0;var _0x10687f=_0x70e0[_0x2e2509];return _0x10687f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 51fe3c0..2dca6d2 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 _0x5d58=['create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post'];(function(_0x54abda,_0x49b261){var _0xeea0e6=function(_0x39f701){while(--_0x39f701){_0x54abda['push'](_0x54abda['shift']());}};_0xeea0e6(++_0x49b261);}(_0x5d58,0x187));var _0x85d5=function(_0x133c32,_0x487339){_0x133c32=_0x133c32-0x0;var _0x23d797=_0x5d58[_0x133c32];return _0x23d797;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./whatsappInteraction.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/describe',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0x4')](_0x85d5('0xa'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xc')]);router[_0x85d5('0xd')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);router[_0x85d5('0xd')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x85d5('0xd')](_0x85d5('0xf'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x12')),controller[_0x85d5('0x13')]);router['put'](_0x85d5('0x8'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x14')),controller[_0x85d5('0x15')]);router[_0x85d5('0x16')](_0x85d5('0x8'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x17')),controller[_0x85d5('0x18')]);router[_0x85d5('0x16')](_0x85d5('0xf'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x19')]);module[_0x85d5('0x1a')]=router; \ No newline at end of file +var _0xf006=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','path','connect-timeout','Router','../../components/auth/service','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x39b8a1,_0x203243){var _0x25a78e=function(_0x1eae5f){while(--_0x1eae5f){_0x39b8a1['push'](_0x39b8a1['shift']());}};_0x25a78e(++_0x203243);}(_0xf006,0x146));var _0x6f00=function(_0x54f19f,_0x5762a3){_0x54f19f=_0x54f19f-0x0;var _0x1729f8=_0xf006[_0x54f19f];return _0x1729f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0x5')](_0x6f00('0xa'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0x5')](_0x6f00('0xc'),auth[_0x6f00('0x6')](),controller['download']);router[_0x6f00('0xd')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);router[_0x6f00('0xd')](_0x6f00('0xa'),auth['isAuthenticated'](),controller[_0x6f00('0xf')]);router['post'](_0x6f00('0x10'),auth['isAuthenticated'](),interaction[_0x6f00('0x11')](_0x6f00('0x12'),_0x6f00('0x13')),controller[_0x6f00('0x14')]);router[_0x6f00('0x15')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),interaction[_0x6f00('0x11')](_0x6f00('0x12'),'whatsappinteraction:update'),controller[_0x6f00('0x16')]);router['delete']('/:id',auth[_0x6f00('0x6')](),interaction[_0x6f00('0x11')](_0x6f00('0x12'),_0x6f00('0x17')),controller[_0x6f00('0x18')]);router[_0x6f00('0x19')](_0x6f00('0x10'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x1a')]);module[_0x6f00('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 92fbd21..7c00f87 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 _0xf8b2=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x12b650,_0x22418f){_0x12b650=_0x12b650-0x0;var _0x39c3d5=_0xf8b2[_0x12b650];return _0x39c3d5;};'use strict';var Sequelize=require(_0x2f8b('0x0'));var moment=require(_0x2f8b('0x1'));module[_0x2f8b('0x2')]={'closed':{'type':Sequelize[_0x2f8b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2f8b('0x4')]},'disposition':{'type':Sequelize[_0x2f8b('0x5')]},'secondDisposition':{'type':Sequelize[_0x2f8b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2f8b('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2f8b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2f8b('0x6')]('in',_0x2f8b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2f8b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2f8b('0x6')]('in',_0x2f8b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2f8b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9829=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0x9829,0xc4));var _0x9982=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x9829[_0x27beea];return _0x122645;};'use strict';var Sequelize=require(_0x9982('0x0'));var moment=require(_0x9982('0x1'));module[_0x9982('0x2')]={'closed':{'type':Sequelize[_0x9982('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9982('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9982('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9982('0x5')]},'note':{'type':Sequelize[_0x9982('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9982('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9982('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9982('0x6')]('in',_0x9982('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 88c64b0..22fc12e 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 _0xc759=['unix','toString','join','server','root','files','transcript-%d-%s.zip','push','User','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','read','Account','Owner','fullname','get','mkdirSync','Whatsapp','closed','closedAt','disposition','existsSync','basename','out','Contact','secret','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','destroy','then','error','name','index','map','WhatsappInteraction','fieldName','type','key','whatsapp','query','user','show','params','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags'];(function(_0x349bdf,_0x33136){var _0x1fb731=function(_0x26d361){while(--_0x26d361){_0x349bdf['push'](_0x349bdf['shift']());}};_0x1fb731(++_0x33136);}(_0xc759,0xa0));var _0x9c75=function(_0x479498,_0x3d069c){_0x479498=_0x479498-0x0;var _0x28129d=_0xc759[_0x479498];return _0x28129d;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x9c75('0x0'));var moment=require(_0x9c75('0x1'));var BPromise=require(_0x9c75('0x2'));var util=require(_0x9c75('0x3'));var path=require('path');var ejs=require(_0x9c75('0x4'));var fs=require('fs');var _=require(_0x9c75('0x5'));var Redis=require(_0x9c75('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x9c75('0x7'));var logger=require(_0x9c75('0x8'))('api');var config=require(_0x9c75('0x9'));var db=require(_0x9c75('0xa'))['db'];config[_0x9c75('0xb')]=_['defaults'](config[_0x9c75('0xb')],{'host':_0x9c75('0xc'),'port':0x18eb});var socket=require(_0x9c75('0xd'))(new Redis(config['redis']));require(_0x9c75('0xe'))[_0x9c75('0xf')](socket);function respondWithStatusCode(_0x37cf93,_0x487ec8){_0x487ec8=_0x487ec8||0xcc;return function(_0xbbda45){if(_0xbbda45){return _0x37cf93[_0x9c75('0x10')](_0x487ec8);}return _0x37cf93[_0x9c75('0x11')](_0x487ec8)[_0x9c75('0x12')]();};}function respondWithResult(_0x24e834,_0x187cd1){_0x187cd1=_0x187cd1||0xc8;return function(_0x207464){if(_0x207464){return _0x24e834[_0x9c75('0x11')](_0x187cd1)[_0x9c75('0x13')](_0x207464);}};}function respondWithFilteredResult(_0x5b06f9,_0x40a55c){return function(_0x3b9356){if(_0x3b9356){var _0x396a00=typeof _0x40a55c['offset']===_0x9c75('0x14')&&typeof _0x40a55c[_0x9c75('0x15')]==='undefined';var _0x45c7f7=_0x3b9356[_0x9c75('0x16')];var _0x133b60=_0x396a00?0x0:_0x40a55c[_0x9c75('0x17')];var _0xd79dcd=_0x396a00?_0x3b9356[_0x9c75('0x16')]:_0x40a55c[_0x9c75('0x17')]+_0x40a55c[_0x9c75('0x15')];var _0x244549;if(_0xd79dcd>=_0x45c7f7){_0xd79dcd=_0x45c7f7;_0x244549=0xc8;}else{_0x244549=0xce;}_0x5b06f9[_0x9c75('0x11')](_0x244549);return _0x5b06f9['set'](_0x9c75('0x18'),_0x133b60+'-'+_0xd79dcd+'/'+_0x45c7f7)[_0x9c75('0x13')](_0x3b9356);}return null;};}function saveUpdates(_0x4cc6a1){return function(_0x545977){if(_0x545977){return _0x545977[_0x9c75('0x19')](_0x4cc6a1)['then'](function(_0x429ecb){return _0x429ecb;});}return null;};}function removeEntity(_0x2df2a2){return function(_0x7dd3ef){if(_0x7dd3ef){return _0x7dd3ef[_0x9c75('0x1a')]()[_0x9c75('0x1b')](function(){_0x2df2a2[_0x9c75('0x11')](0xcc)[_0x9c75('0x12')]();});}};}function handleEntityNotFound(_0x23368d){return function(_0x60e278){if(!_0x60e278){_0x23368d['sendStatus'](0x194);}return _0x60e278;};}function handleError(_0x25c331,_0x38d1d9){_0x38d1d9=_0x38d1d9||0x1f4;return function(_0x507b9d){logger[_0x9c75('0x1c')](_0x507b9d['stack']);if(_0x507b9d[_0x9c75('0x1d')]){delete _0x507b9d['name'];}_0x25c331[_0x9c75('0x11')](_0x38d1d9)['send'](_0x507b9d);};}exports[_0x9c75('0x1e')]=function(_0x51673a,_0x307f8a){var _0x17ea5a={};var _0x5331b9=_[_0x9c75('0x1f')](db[_0x9c75('0x20')]['rawAttributes'],function(_0x147079){return{'name':_0x147079[_0x9c75('0x21')],'type':_0x147079[_0x9c75('0x22')][_0x9c75('0x23')]};});_0x17ea5a=qs['getOptions'](_0x5331b9,_0x51673a);return interaction['findAll'](_0x9c75('0x24'),_0x51673a[_0x9c75('0x25')],_0x51673a[_0x9c75('0x26')],_0x17ea5a,_0x5331b9)['then'](respondWithFilteredResult(_0x307f8a,_0x17ea5a))['catch'](handleError(_0x307f8a,null));};exports[_0x9c75('0x27')]=function(_0x34fe89,_0xfff582){var _0x5b4dee={'raw':![],'where':{'id':_0x34fe89[_0x9c75('0x28')]['id']}},_0x8ec01c={};_0x8ec01c[_0x9c75('0x29')]=_[_0x9c75('0x2a')](db[_0x9c75('0x20')][_0x9c75('0x2b')]);_0x8ec01c[_0x9c75('0x25')]=_[_0x9c75('0x2a')](_0x34fe89[_0x9c75('0x25')]);_0x8ec01c[_0x9c75('0x2c')]=_[_0x9c75('0x2d')](_0x8ec01c[_0x9c75('0x29')],_0x8ec01c[_0x9c75('0x25')]);_0x5b4dee['attributes']=_[_0x9c75('0x2d')](_0x8ec01c[_0x9c75('0x29')],qs[_0x9c75('0x2e')](_0x34fe89['query'][_0x9c75('0x2e')]));_0x5b4dee[_0x9c75('0x2f')]=_0x5b4dee[_0x9c75('0x2f')][_0x9c75('0x30')]?_0x5b4dee['attributes']:_0x8ec01c[_0x9c75('0x29')];if(_0x34fe89[_0x9c75('0x25')][_0x9c75('0x31')]){_0x5b4dee[_0x9c75('0x32')]=[{'all':!![]}];}_0x5b4dee=_[_0x9c75('0x33')]({},_0x5b4dee,_0x34fe89[_0x9c75('0x34')]);return db['WhatsappInteraction'][_0x9c75('0x35')](_0x5b4dee)[_0x9c75('0x1b')](handleEntityNotFound(_0xfff582,null))[_0x9c75('0x1b')](respondWithResult(_0xfff582,null))[_0x9c75('0x36')](handleError(_0xfff582,null));};exports[_0x9c75('0x37')]=function(_0xd3a66f,_0x3c8ca7){return db[_0x9c75('0x20')][_0x9c75('0x37')](_0xd3a66f[_0x9c75('0x38')],{})[_0x9c75('0x1b')](respondWithResult(_0x3c8ca7,0xc9))[_0x9c75('0x36')](handleError(_0x3c8ca7,null));};exports[_0x9c75('0x19')]=function(_0x1a7c18,_0x5ccf7e){if(_0x1a7c18[_0x9c75('0x38')]['id']){delete _0x1a7c18['body']['id'];}return db[_0x9c75('0x20')][_0x9c75('0x35')]({'where':{'id':_0x1a7c18['params']['id']}})[_0x9c75('0x1b')](handleEntityNotFound(_0x5ccf7e,null))[_0x9c75('0x1b')](saveUpdates(_0x1a7c18[_0x9c75('0x38')],null))[_0x9c75('0x1b')](respondWithResult(_0x5ccf7e,null))[_0x9c75('0x36')](handleError(_0x5ccf7e,null));};exports[_0x9c75('0x1a')]=function(_0x224c3b,_0x1e3b34){return db[_0x9c75('0x20')][_0x9c75('0x35')]({'where':{'id':_0x224c3b['params']['id']}})['then'](handleEntityNotFound(_0x1e3b34,null))[_0x9c75('0x1b')](removeEntity(_0x1e3b34,null))[_0x9c75('0x36')](handleError(_0x1e3b34,null));};exports[_0x9c75('0x39')]=function(_0x2a06d1,_0x5f3479){return db[_0x9c75('0x20')][_0x9c75('0x39')]()[_0x9c75('0x1b')](respondWithResult(_0x5f3479,null))[_0x9c75('0x36')](handleError(_0x5f3479,null));};exports[_0x9c75('0x3a')]=function(_0x2f7570,_0x563b35){return db[_0x9c75('0x3b')][_0x9c75('0x35')]({'where':{'id':_0x2f7570[_0x9c75('0x28')]['id']}})[_0x9c75('0x1b')](handleEntityNotFound(_0x563b35,null))[_0x9c75('0x1b')](function(_0x153a3a){if(_0x153a3a){return _0x153a3a['addMessage'](_0x2f7570[_0x9c75('0x38')][_0x9c75('0x3c')],_[_0x9c75('0x3d')](_0x2f7570[_0x9c75('0x38')],[_0x9c75('0x3c'),'id'])||{});}})[_0x9c75('0x1b')](respondWithResult(_0x563b35,null))[_0x9c75('0x36')](handleError(_0x563b35,null));};exports[_0x9c75('0x3e')]=function(_0x184dcd,_0x871a92){var _0x6dad39={'raw':![],'where':{}};var _0x1cc7d6={};var _0x2a5874={'count':0x0,'rows':[]};return db[_0x9c75('0x20')][_0x9c75('0x3f')]({'where':{'id':_0x184dcd[_0x9c75('0x28')]['id']}})['then'](handleEntityNotFound(_0x871a92,null))[_0x9c75('0x1b')](function(_0x278537){if(_0x278537){_0x1cc7d6[_0x9c75('0x29')]=_[_0x9c75('0x2a')](db[_0x9c75('0x3b')][_0x9c75('0x2b')]);_0x1cc7d6[_0x9c75('0x25')]=_['keys'](_0x184dcd['query']);_0x1cc7d6[_0x9c75('0x2c')]=_[_0x9c75('0x2d')](_0x1cc7d6[_0x9c75('0x29')],_0x1cc7d6[_0x9c75('0x25')]);_0x6dad39[_0x9c75('0x2f')]=_[_0x9c75('0x2d')](_0x1cc7d6[_0x9c75('0x29')],qs[_0x9c75('0x2e')](_0x184dcd['query']['fields']));_0x6dad39[_0x9c75('0x2f')]=_0x6dad39[_0x9c75('0x2f')][_0x9c75('0x30')]?_0x6dad39[_0x9c75('0x2f')]:_0x1cc7d6['model'];if(!_0x184dcd[_0x9c75('0x25')][_0x9c75('0x40')](_0x9c75('0x41'))){_0x6dad39['limit']=qs[_0x9c75('0x15')](_0x184dcd[_0x9c75('0x25')][_0x9c75('0x15')]);_0x6dad39[_0x9c75('0x17')]=qs['offset'](_0x184dcd[_0x9c75('0x25')][_0x9c75('0x17')]);}_0x6dad39[_0x9c75('0x42')]=qs[_0x9c75('0x43')](_0x184dcd[_0x9c75('0x25')]['sort']);_0x6dad39['where']=qs['filters'](_[_0x9c75('0x44')](_0x184dcd[_0x9c75('0x25')],_0x1cc7d6[_0x9c75('0x2c')]));_0x6dad39[_0x9c75('0x45')][_0x9c75('0x46')]=_0x278537['id'];if(_0x184dcd[_0x9c75('0x25')][_0x9c75('0x47')]){_0x6dad39[_0x9c75('0x45')]=_[_0x9c75('0x33')](_0x6dad39[_0x9c75('0x45')],{'$or':_[_0x9c75('0x1f')](_0x6dad39[_0x9c75('0x2f')],function(_0x2b22c2){var _0x384b3b={};_0x384b3b[_0x2b22c2]={'$like':'%'+_0x184dcd[_0x9c75('0x25')][_0x9c75('0x47')]+'%'};return _0x384b3b;})});}if(_0x184dcd[_0x9c75('0x25')][_0x9c75('0x48')]){var _0x4f01ee=_0x184dcd['query']['$gte']['split'](',');var _0x2534f8={};_0x2534f8[_0x4f01ee[0x0]]={'$gte':moment(_0x4f01ee[0x1])[_0x9c75('0x49')](_0x9c75('0x4a'))};_0x6dad39['where']=_[_0x9c75('0x33')](_0x6dad39[_0x9c75('0x45')],_0x2534f8);}_0x6dad39=_[_0x9c75('0x33')]({},_0x6dad39,_0x184dcd['options']);return db[_0x9c75('0x3b')][_0x9c75('0x16')]({'where':_0x6dad39[_0x9c75('0x45')]})[_0x9c75('0x1b')](function(_0x12d799){_0x2a5874['count']=_0x12d799;if(_0x184dcd[_0x9c75('0x25')][_0x9c75('0x31')]){_0x6dad39[_0x9c75('0x32')]=[{'all':!![]}];}return db[_0x9c75('0x3b')][_0x9c75('0x4b')](_0x6dad39);})['then'](function(_0x534704){_0x2a5874[_0x9c75('0x4c')]=_0x534704;return _0x2a5874;});}})['then'](respondWithFilteredResult(_0x871a92,_0x6dad39))[_0x9c75('0x36')](handleError(_0x871a92,null));};exports['addTags']=function(_0x262166,_0xfc3e9a){return db[_0x9c75('0x20')][_0x9c75('0x35')]({'where':{'id':_0x262166[_0x9c75('0x28')]['id']}})['then'](handleEntityNotFound(_0xfc3e9a,null))[_0x9c75('0x1b')](function(_0x44fde2){if(_0x44fde2){return _0x44fde2[_0x9c75('0x4d')](_0x262166[_0x9c75('0x38')][_0x9c75('0x3c')],_[_0x9c75('0x3d')](_0x262166[_0x9c75('0x38')],['ids','id'])||{})[_0x9c75('0x4e')](function(){return db[_0x9c75('0x4f')]['findAll']({'attributes':['id','name',_0x9c75('0x50')],'where':{'id':_0x262166['body'][_0x9c75('0x3c')]}});})['then'](function(_0x41a817){socket[_0x9c75('0x51')](_0x9c75('0x52'),{'id':Number(_0x262166[_0x9c75('0x28')]['id']),'tags':_0x41a817||[]});return{'id':Number(_0x262166[_0x9c75('0x28')]['id']),'tags':_0x41a817||[]};});}})[_0x9c75('0x1b')](respondWithResult(_0xfc3e9a,null))[_0x9c75('0x36')](handleError(_0xfc3e9a,null));};exports[_0x9c75('0x53')]=function(_0x4ad22a,_0xe7c16d){return db['WhatsappInteraction'][_0x9c75('0x35')]({'where':{'id':_0x4ad22a[_0x9c75('0x28')]['id']}})[_0x9c75('0x1b')](handleEntityNotFound(_0xe7c16d,null))['then'](function(_0x448c22){if(_0x448c22){return _0x448c22[_0x9c75('0x53')](_0x4ad22a[_0x9c75('0x25')][_0x9c75('0x3c')]);}})[_0x9c75('0x1b')](respondWithStatusCode(_0xe7c16d,null))['catch'](handleError(_0xe7c16d,null));};exports['download']=function(_0x17425e,_0x4ce8c9){var _0x64d198=moment()[_0x9c75('0x54')]()[_0x9c75('0x55')]();var _0x590154=path[_0x9c75('0x56')](config['root'],_0x9c75('0x57'),'files','tmp');var _0x5ce2db=path[_0x9c75('0x56')](config[_0x9c75('0x58')],_0x9c75('0x57'),_0x9c75('0x59'),'attachments');var _0x5542ef=path[_0x9c75('0x56')](_0x590154,_0x64d198);var _0x4c399e=util[_0x9c75('0x49')](_0x9c75('0x5a'),_0x17425e[_0x9c75('0x28')]['id'],_0x64d198);var _0x30742f=path[_0x9c75('0x56')](_0x590154,_0x4c399e);var _0x5c06e1=[];_0x5c06e1[_0x9c75('0x5b')]({'model':db[_0x9c75('0x5c')],'as':_0x9c75('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x5c06e1['push']({'model':db[_0x9c75('0x5d')],'as':'Contact','attributes':['id',_0x9c75('0x5e'),_0x9c75('0x5f')],'raw':!![]});if(_0x17425e[_0x9c75('0x25')][_0x9c75('0x60')]){_0x5c06e1['push']({'model':db[_0x9c75('0x61')],'as':'Attachment','raw':!![]});}var _0x416414=[{'model':db['WhatsappMessage'],'as':_0x9c75('0x62'),'attributes':['id',_0x9c75('0x38'),_0x9c75('0x63'),_0x9c75('0x64'),'secret',_0x9c75('0x65')],'include':_0x5c06e1}];_0x416414['push']({'model':db['WhatsappAccount'],'as':_0x9c75('0x66'),'attributes':['id',_0x9c75('0x1d')]});_0x416414[_0x9c75('0x5b')]({'model':db[_0x9c75('0x5c')],'as':_0x9c75('0x67'),'attributes':['id',_0x9c75('0x68')]});return db['WhatsappInteraction'][_0x9c75('0x35')]({'where':{'id':_0x17425e[_0x9c75('0x28')]['id']},'include':_0x416414})[_0x9c75('0x1b')](handleEntityNotFound(_0x4ce8c9,null))[_0x9c75('0x1b')](function(_0x569af2){if(_0x569af2){var _0x48ab3f=_0x569af2[_0x9c75('0x69')]({'plain':!![]});fs[_0x9c75('0x6a')](_0x5542ef);var _0x3f7913={'channel':_0x9c75('0x6b'),'account':_0x48ab3f[_0x9c75('0x66')][_0x9c75('0x1d')],'agent':_0x48ab3f['Owner']?_0x48ab3f[_0x9c75('0x67')][_0x9c75('0x68')]:'N.A.','createdAt':moment(_0x48ab3f[_0x9c75('0x63')])[_0x9c75('0x49')](_0x9c75('0x4a'))[_0x9c75('0x55')](),'closedAt':_0x48ab3f[_0x9c75('0x6c')]?moment(_0x48ab3f[_0x9c75('0x6d')])['format'](_0x9c75('0x4a'))['toString']():'','disposition':_0x48ab3f[_0x9c75('0x6e')],'messages':_(_0x48ab3f['Messages'])[_0x9c75('0x47')]({'secret':![]})[_0x9c75('0x1f')](function(_0x1775fd){if(_0x1775fd['Attachment']){var _0x8bacc=path[_0x9c75('0x56')](_0x5ce2db,_0x1775fd[_0x9c75('0x61')]['basename']);if(fs[_0x9c75('0x6f')](_0x8bacc)){fs['createReadStream'](_0x8bacc)['pipe'](fs['createWriteStream'](path[_0x9c75('0x56')](_0x5542ef,_0x1775fd[_0x9c75('0x61')][_0x9c75('0x70')])));}}return{'date':moment(_0x1775fd[_0x9c75('0x63')])['format'](_0x9c75('0x4a'))[_0x9c75('0x55')](),'sender':_0x1775fd[_0x9c75('0x64')]===_0x9c75('0x71')?_0x1775fd['User']?_0x1775fd[_0x9c75('0x5c')][_0x9c75('0x68')]:'System':_0x1775fd[_0x9c75('0x72')][_0x9c75('0x5e')]+(_0x1775fd[_0x9c75('0x72')][_0x9c75('0x5f')]?'\x20'+_0x1775fd['Contact']['lastName']:''),'body':_0x1775fd['Attachment']?_0x1775fd[_0x9c75('0x61')][_0x9c75('0x70')]:_0x1775fd[_0x9c75('0x38')],'direction':_0x1775fd[_0x9c75('0x64')]==='out'?'A':'C','secret':_0x1775fd[_0x9c75('0x73')],'read':_0x1775fd['read'],'attachment':_0x1775fd['Attachment']};})[_0x9c75('0x74')]()};return ejs[_0x9c75('0x75')](path[_0x9c75('0x56')](config['root'],'server',_0x9c75('0x76'),_0x9c75('0x77')),{'interaction':_0x3f7913})[_0x9c75('0x1b')](function(_0x139f9e){var _0x2a9c49=path['join'](_0x5542ef,'transcript-'+_0x48ab3f['id']+'-'+_0x64d198+'.pdf');var _0x2a6819={'path':_0x2a9c49,'channel':_0x9c75('0x6b'),'interactionId':_0x48ab3f['id']};return pdf[_0x9c75('0x78')](_0x139f9e,_0x2a6819);})[_0x9c75('0x1b')](function(){return new BPromise(function(_0x26f3d7,_0x4ff023){zipdir(_0x5542ef,{'saveTo':_0x30742f},function(_0x4718b7,_0x54cb01){if(_0x4718b7)return _0x4ff023(_0x4718b7);return _0x26f3d7(_0x54cb01);});})[_0x9c75('0x1b')](function(){return new BPromise(function(_0x2112ba,_0x328cb3){rimraf(_0x5542ef,function(_0x301796){if(_0x301796)_0x328cb3(_0x301796);return _0x2112ba();});});})['then'](function(){return _0x4ce8c9['download'](_0x30742f,_0x4c399e,function(_0x4e9545){if(_0x4e9545){console[_0x9c75('0x79')]('err',_0x4e9545);}else{fs['unlinkSync'](_0x30742f);}});});});}else{return _0x4ce8c9[_0x9c75('0x10')](0xc8);}})[_0x9c75('0x36')](handleError(_0x4ce8c9,null));}; \ No newline at end of file +var _0xb44f=['show','keys','WhatsappInteraction','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','catch','create','body','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','fullname','get','mkdirSync','Whatsapp','Account','Owner','N.A.','closed','closedAt','disposition','basename','pipe','out','System','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','whatsapp','query','user'];(function(_0x4e2b12,_0x428f2f){var _0x2ec98f=function(_0x10e868){while(--_0x10e868){_0x4e2b12['push'](_0x4e2b12['shift']());}};_0x2ec98f(++_0x428f2f);}(_0xb44f,0x165));var _0xfb44=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb44f[_0x2d7f0e];return _0x110b07;};'use strict';var rimraf=require(_0xfb44('0x0'));var zipdir=require(_0xfb44('0x1'));var moment=require(_0xfb44('0x2'));var BPromise=require(_0xfb44('0x3'));var util=require(_0xfb44('0x4'));var path=require(_0xfb44('0x5'));var ejs=require(_0xfb44('0x6'));var fs=require('fs');var _=require(_0xfb44('0x7'));var Redis=require(_0xfb44('0x8'));var interaction=require(_0xfb44('0x9'));var qs=require(_0xfb44('0xa'));var pdf=require('../../components/export/pdf');var logger=require(_0xfb44('0xb'))('api');var config=require(_0xfb44('0xc'));var db=require(_0xfb44('0xd'))['db'];config[_0xfb44('0xe')]=_[_0xfb44('0xf')](config[_0xfb44('0xe')],{'host':_0xfb44('0x10'),'port':0x18eb});var socket=require(_0xfb44('0x11'))(new Redis(config[_0xfb44('0xe')]));require(_0xfb44('0x12'))[_0xfb44('0x13')](socket);function respondWithStatusCode(_0x950fad,_0x5df744){_0x5df744=_0x5df744||0xcc;return function(_0x56fa4a){if(_0x56fa4a){return _0x950fad[_0xfb44('0x14')](_0x5df744);}return _0x950fad[_0xfb44('0x15')](_0x5df744)[_0xfb44('0x16')]();};}function respondWithResult(_0x1617bd,_0x3bb67a){_0x3bb67a=_0x3bb67a||0xc8;return function(_0x303be4){if(_0x303be4){return _0x1617bd[_0xfb44('0x15')](_0x3bb67a)[_0xfb44('0x17')](_0x303be4);}};}function respondWithFilteredResult(_0x3479f1,_0x2da887){return function(_0x50a2fd){if(_0x50a2fd){var _0x5260b6=typeof _0x2da887[_0xfb44('0x18')]==='undefined'&&typeof _0x2da887[_0xfb44('0x19')]===_0xfb44('0x1a');var _0x5c98c1=_0x50a2fd[_0xfb44('0x1b')];var _0x4ea838=_0x5260b6?0x0:_0x2da887['offset'];var _0x281289=_0x5260b6?_0x50a2fd[_0xfb44('0x1b')]:_0x2da887['offset']+_0x2da887[_0xfb44('0x19')];var _0x51f363;if(_0x281289>=_0x5c98c1){_0x281289=_0x5c98c1;_0x51f363=0xc8;}else{_0x51f363=0xce;}_0x3479f1[_0xfb44('0x15')](_0x51f363);return _0x3479f1[_0xfb44('0x1c')](_0xfb44('0x1d'),_0x4ea838+'-'+_0x281289+'/'+_0x5c98c1)[_0xfb44('0x17')](_0x50a2fd);}return null;};}function saveUpdates(_0x202362){return function(_0x2a78f2){if(_0x2a78f2){return _0x2a78f2[_0xfb44('0x1e')](_0x202362)[_0xfb44('0x1f')](function(_0x2ea50b){return _0x2ea50b;});}return null;};}function removeEntity(_0x2f9a2f){return function(_0x104f53){if(_0x104f53){return _0x104f53[_0xfb44('0x20')]()[_0xfb44('0x1f')](function(){_0x2f9a2f[_0xfb44('0x15')](0xcc)[_0xfb44('0x16')]();});}};}function handleEntityNotFound(_0x99fd93){return function(_0x27428c){if(!_0x27428c){_0x99fd93[_0xfb44('0x14')](0x194);}return _0x27428c;};}function handleError(_0x7c5457,_0x53857a){_0x53857a=_0x53857a||0x1f4;return function(_0x114230){logger[_0xfb44('0x21')](_0x114230[_0xfb44('0x22')]);if(_0x114230[_0xfb44('0x23')]){delete _0x114230[_0xfb44('0x23')];}_0x7c5457[_0xfb44('0x15')](_0x53857a)[_0xfb44('0x24')](_0x114230);};}exports[_0xfb44('0x25')]=function(_0x22b8fb,_0x514ebe){var _0x2da8c7={};var _0x15c33b=_[_0xfb44('0x26')](db['WhatsappInteraction'][_0xfb44('0x27')],function(_0x5b6222){return{'name':_0x5b6222['fieldName'],'type':_0x5b6222[_0xfb44('0x28')][_0xfb44('0x29')]};});_0x2da8c7=qs['getOptions'](_0x15c33b,_0x22b8fb);return interaction['findAll'](_0xfb44('0x2a'),_0x22b8fb[_0xfb44('0x2b')],_0x22b8fb[_0xfb44('0x2c')],_0x2da8c7,_0x15c33b)['then'](respondWithFilteredResult(_0x514ebe,_0x2da8c7))['catch'](handleError(_0x514ebe,null));};exports[_0xfb44('0x2d')]=function(_0x9b8f1d,_0x2f055c){var _0x3e8e4e={'raw':![],'where':{'id':_0x9b8f1d['params']['id']}},_0x49c25e={};_0x49c25e['model']=_[_0xfb44('0x2e')](db[_0xfb44('0x2f')][_0xfb44('0x27')]);_0x49c25e['query']=_[_0xfb44('0x2e')](_0x9b8f1d['query']);_0x49c25e[_0xfb44('0x30')]=_[_0xfb44('0x31')](_0x49c25e[_0xfb44('0x32')],_0x49c25e[_0xfb44('0x2b')]);_0x3e8e4e['attributes']=_[_0xfb44('0x31')](_0x49c25e[_0xfb44('0x32')],qs[_0xfb44('0x33')](_0x9b8f1d[_0xfb44('0x2b')]['fields']));_0x3e8e4e[_0xfb44('0x34')]=_0x3e8e4e[_0xfb44('0x34')][_0xfb44('0x35')]?_0x3e8e4e[_0xfb44('0x34')]:_0x49c25e[_0xfb44('0x32')];if(_0x9b8f1d[_0xfb44('0x2b')][_0xfb44('0x36')]){_0x3e8e4e[_0xfb44('0x37')]=[{'all':!![]}];}_0x3e8e4e=_['merge']({},_0x3e8e4e,_0x9b8f1d[_0xfb44('0x38')]);return db[_0xfb44('0x2f')][_0xfb44('0x39')](_0x3e8e4e)[_0xfb44('0x1f')](handleEntityNotFound(_0x2f055c,null))['then'](respondWithResult(_0x2f055c,null))[_0xfb44('0x3a')](handleError(_0x2f055c,null));};exports[_0xfb44('0x3b')]=function(_0x4dda1f,_0x4ee583){return db[_0xfb44('0x2f')][_0xfb44('0x3b')](_0x4dda1f['body'],{})[_0xfb44('0x1f')](respondWithResult(_0x4ee583,0xc9))[_0xfb44('0x3a')](handleError(_0x4ee583,null));};exports['update']=function(_0x555a51,_0x41b3cb){if(_0x555a51['body']['id']){delete _0x555a51[_0xfb44('0x3c')]['id'];}return db['WhatsappInteraction'][_0xfb44('0x39')]({'where':{'id':_0x555a51[_0xfb44('0x3d')]['id']}})['then'](handleEntityNotFound(_0x41b3cb,null))['then'](saveUpdates(_0x555a51[_0xfb44('0x3c')],null))[_0xfb44('0x1f')](respondWithResult(_0x41b3cb,null))[_0xfb44('0x3a')](handleError(_0x41b3cb,null));};exports[_0xfb44('0x20')]=function(_0x5986c5,_0x21a28f){return db['WhatsappInteraction'][_0xfb44('0x39')]({'where':{'id':_0x5986c5[_0xfb44('0x3d')]['id']}})[_0xfb44('0x1f')](handleEntityNotFound(_0x21a28f,null))[_0xfb44('0x1f')](removeEntity(_0x21a28f,null))[_0xfb44('0x3a')](handleError(_0x21a28f,null));};exports[_0xfb44('0x3e')]=function(_0x4a50ff,_0x565552){return db[_0xfb44('0x2f')]['describe']()[_0xfb44('0x1f')](respondWithResult(_0x565552,null))[_0xfb44('0x3a')](handleError(_0x565552,null));};exports[_0xfb44('0x3f')]=function(_0x26cdc4,_0x17a63b){return db[_0xfb44('0x40')]['find']({'where':{'id':_0x26cdc4[_0xfb44('0x3d')]['id']}})[_0xfb44('0x1f')](handleEntityNotFound(_0x17a63b,null))[_0xfb44('0x1f')](function(_0xaedecc){if(_0xaedecc){return _0xaedecc['addMessage'](_0x26cdc4['body'][_0xfb44('0x41')],_[_0xfb44('0x42')](_0x26cdc4[_0xfb44('0x3c')],[_0xfb44('0x41'),'id'])||{});}})[_0xfb44('0x1f')](respondWithResult(_0x17a63b,null))['catch'](handleError(_0x17a63b,null));};exports[_0xfb44('0x43')]=function(_0x4722ae,_0x981aac){var _0x9bea1d={'raw':![],'where':{}};var _0x113059={};var _0x54e6bf={'count':0x0,'rows':[]};return db[_0xfb44('0x2f')]['findOne']({'where':{'id':_0x4722ae[_0xfb44('0x3d')]['id']}})[_0xfb44('0x1f')](handleEntityNotFound(_0x981aac,null))['then'](function(_0x297aa6){if(_0x297aa6){_0x113059['model']=_[_0xfb44('0x2e')](db['WhatsappMessage']['rawAttributes']);_0x113059[_0xfb44('0x2b')]=_[_0xfb44('0x2e')](_0x4722ae['query']);_0x113059[_0xfb44('0x30')]=_[_0xfb44('0x31')](_0x113059['model'],_0x113059[_0xfb44('0x2b')]);_0x9bea1d['attributes']=_[_0xfb44('0x31')](_0x113059[_0xfb44('0x32')],qs['fields'](_0x4722ae[_0xfb44('0x2b')][_0xfb44('0x33')]));_0x9bea1d[_0xfb44('0x34')]=_0x9bea1d['attributes'][_0xfb44('0x35')]?_0x9bea1d[_0xfb44('0x34')]:_0x113059['model'];if(!_0x4722ae[_0xfb44('0x2b')]['hasOwnProperty'](_0xfb44('0x44'))){_0x9bea1d['limit']=qs[_0xfb44('0x19')](_0x4722ae[_0xfb44('0x2b')][_0xfb44('0x19')]);_0x9bea1d[_0xfb44('0x18')]=qs[_0xfb44('0x18')](_0x4722ae['query'][_0xfb44('0x18')]);}_0x9bea1d[_0xfb44('0x45')]=qs[_0xfb44('0x46')](_0x4722ae[_0xfb44('0x2b')][_0xfb44('0x46')]);_0x9bea1d[_0xfb44('0x47')]=qs[_0xfb44('0x30')](_[_0xfb44('0x48')](_0x4722ae[_0xfb44('0x2b')],_0x113059[_0xfb44('0x30')]));_0x9bea1d[_0xfb44('0x47')][_0xfb44('0x49')]=_0x297aa6['id'];if(_0x4722ae[_0xfb44('0x2b')][_0xfb44('0x4a')]){_0x9bea1d['where']=_[_0xfb44('0x4b')](_0x9bea1d[_0xfb44('0x47')],{'$or':_['map'](_0x9bea1d[_0xfb44('0x34')],function(_0x465313){var _0x329883={};_0x329883[_0x465313]={'$like':'%'+_0x4722ae[_0xfb44('0x2b')][_0xfb44('0x4a')]+'%'};return _0x329883;})});}if(_0x4722ae['query'][_0xfb44('0x4c')]){var _0x1579b8=_0x4722ae[_0xfb44('0x2b')][_0xfb44('0x4c')][_0xfb44('0x4d')](',');var _0x1ddca2={};_0x1ddca2[_0x1579b8[0x0]]={'$gte':moment(_0x1579b8[0x1])[_0xfb44('0x4e')](_0xfb44('0x4f'))};_0x9bea1d['where']=_['merge'](_0x9bea1d[_0xfb44('0x47')],_0x1ddca2);}_0x9bea1d=_[_0xfb44('0x4b')]({},_0x9bea1d,_0x4722ae[_0xfb44('0x38')]);return db[_0xfb44('0x40')][_0xfb44('0x1b')]({'where':_0x9bea1d[_0xfb44('0x47')]})[_0xfb44('0x1f')](function(_0x1d4904){_0x54e6bf['count']=_0x1d4904;if(_0x4722ae[_0xfb44('0x2b')][_0xfb44('0x36')]){_0x9bea1d[_0xfb44('0x37')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xfb44('0x50')](_0x9bea1d);})['then'](function(_0x5f483b){_0x54e6bf['rows']=_0x5f483b;return _0x54e6bf;});}})['then'](respondWithFilteredResult(_0x981aac,_0x9bea1d))[_0xfb44('0x3a')](handleError(_0x981aac,null));};exports[_0xfb44('0x51')]=function(_0x430328,_0x2b3d8f){return db[_0xfb44('0x2f')][_0xfb44('0x39')]({'where':{'id':_0x430328[_0xfb44('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2b3d8f,null))[_0xfb44('0x1f')](function(_0x668b6e){if(_0x668b6e){return _0x668b6e[_0xfb44('0x52')](_0x430328[_0xfb44('0x3c')][_0xfb44('0x41')],_[_0xfb44('0x42')](_0x430328[_0xfb44('0x3c')],['ids','id'])||{})[_0xfb44('0x53')](function(){return db[_0xfb44('0x54')][_0xfb44('0x50')]({'attributes':['id',_0xfb44('0x23'),_0xfb44('0x55')],'where':{'id':_0x430328[_0xfb44('0x3c')][_0xfb44('0x41')]}});})['then'](function(_0x250e2c){socket[_0xfb44('0x56')]('whatsappInteractionTags:save',{'id':Number(_0x430328[_0xfb44('0x3d')]['id']),'tags':_0x250e2c||[]});return{'id':Number(_0x430328['params']['id']),'tags':_0x250e2c||[]};});}})[_0xfb44('0x1f')](respondWithResult(_0x2b3d8f,null))[_0xfb44('0x3a')](handleError(_0x2b3d8f,null));};exports['removeTags']=function(_0x3be2b1,_0x592564){return db[_0xfb44('0x2f')][_0xfb44('0x39')]({'where':{'id':_0x3be2b1[_0xfb44('0x3d')]['id']}})[_0xfb44('0x1f')](handleEntityNotFound(_0x592564,null))[_0xfb44('0x1f')](function(_0x493397){if(_0x493397){return _0x493397[_0xfb44('0x57')](_0x3be2b1[_0xfb44('0x2b')][_0xfb44('0x41')]);}})[_0xfb44('0x1f')](respondWithStatusCode(_0x592564,null))['catch'](handleError(_0x592564,null));};exports['download']=function(_0x3caf8c,_0x194f0d){var _0xdfdec9=moment()[_0xfb44('0x58')]()[_0xfb44('0x59')]();var _0x5160f7=path['join'](config[_0xfb44('0x5a')],_0xfb44('0x5b'),_0xfb44('0x5c'),_0xfb44('0x5d'));var _0x5623b4=path[_0xfb44('0x5e')](config['root'],_0xfb44('0x5b'),_0xfb44('0x5c'),_0xfb44('0x5f'));var _0x164a65=path['join'](_0x5160f7,_0xdfdec9);var _0x53db98=util[_0xfb44('0x4e')](_0xfb44('0x60'),_0x3caf8c[_0xfb44('0x3d')]['id'],_0xdfdec9);var _0x42280d=path[_0xfb44('0x5e')](_0x5160f7,_0x53db98);var _0x2698eb=[];_0x2698eb[_0xfb44('0x61')]({'model':db[_0xfb44('0x62')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2698eb[_0xfb44('0x61')]({'model':db[_0xfb44('0x63')],'as':_0xfb44('0x64'),'attributes':['id',_0xfb44('0x65'),_0xfb44('0x66')],'raw':!![]});if(_0x3caf8c['query'][_0xfb44('0x5f')]){_0x2698eb[_0xfb44('0x61')]({'model':db[_0xfb44('0x67')],'as':_0xfb44('0x67'),'raw':!![]});}var _0x367323=[{'model':db[_0xfb44('0x40')],'as':_0xfb44('0x68'),'attributes':['id',_0xfb44('0x3c'),_0xfb44('0x69'),_0xfb44('0x6a'),'secret',_0xfb44('0x6b')],'include':_0x2698eb}];_0x367323[_0xfb44('0x61')]({'model':db[_0xfb44('0x6c')],'as':'Account','attributes':['id',_0xfb44('0x23')]});_0x367323[_0xfb44('0x61')]({'model':db['User'],'as':'Owner','attributes':['id',_0xfb44('0x6d')]});return db[_0xfb44('0x2f')][_0xfb44('0x39')]({'where':{'id':_0x3caf8c['params']['id']},'include':_0x367323})[_0xfb44('0x1f')](handleEntityNotFound(_0x194f0d,null))[_0xfb44('0x1f')](function(_0x5184e5){if(_0x5184e5){var _0x2e5bb4=_0x5184e5[_0xfb44('0x6e')]({'plain':!![]});fs[_0xfb44('0x6f')](_0x164a65);var _0x342543={'channel':_0xfb44('0x70'),'account':_0x2e5bb4[_0xfb44('0x71')]['name'],'agent':_0x2e5bb4[_0xfb44('0x72')]?_0x2e5bb4['Owner']['fullname']:_0xfb44('0x73'),'createdAt':moment(_0x2e5bb4[_0xfb44('0x69')])[_0xfb44('0x4e')](_0xfb44('0x4f'))[_0xfb44('0x59')](),'closedAt':_0x2e5bb4[_0xfb44('0x74')]?moment(_0x2e5bb4[_0xfb44('0x75')])['format'](_0xfb44('0x4f'))[_0xfb44('0x59')]():'','disposition':_0x2e5bb4[_0xfb44('0x76')],'messages':_(_0x2e5bb4[_0xfb44('0x68')])[_0xfb44('0x4a')]({'secret':![]})[_0xfb44('0x26')](function(_0x3d57ba){if(_0x3d57ba['Attachment']){var _0x1f9210=path[_0xfb44('0x5e')](_0x5623b4,_0x3d57ba['Attachment'][_0xfb44('0x77')]);if(fs['existsSync'](_0x1f9210)){fs['createReadStream'](_0x1f9210)[_0xfb44('0x78')](fs['createWriteStream'](path[_0xfb44('0x5e')](_0x164a65,_0x3d57ba['Attachment']['basename'])));}}return{'date':moment(_0x3d57ba[_0xfb44('0x69')])[_0xfb44('0x4e')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3d57ba[_0xfb44('0x6a')]===_0xfb44('0x79')?_0x3d57ba[_0xfb44('0x62')]?_0x3d57ba[_0xfb44('0x62')][_0xfb44('0x6d')]:_0xfb44('0x7a'):_0x3d57ba['Contact'][_0xfb44('0x65')]+(_0x3d57ba[_0xfb44('0x64')]['lastName']?'\x20'+_0x3d57ba[_0xfb44('0x64')][_0xfb44('0x66')]:''),'body':_0x3d57ba[_0xfb44('0x67')]?_0x3d57ba['Attachment'][_0xfb44('0x77')]:_0x3d57ba[_0xfb44('0x3c')],'direction':_0x3d57ba[_0xfb44('0x6a')]===_0xfb44('0x79')?'A':'C','secret':_0x3d57ba[_0xfb44('0x7b')],'read':_0x3d57ba[_0xfb44('0x6b')],'attachment':_0x3d57ba[_0xfb44('0x67')]};})[_0xfb44('0x7c')]()};return ejs[_0xfb44('0x7d')](path[_0xfb44('0x5e')](config[_0xfb44('0x5a')],_0xfb44('0x5b'),_0xfb44('0x7e'),_0xfb44('0x7f')),{'interaction':_0x342543})['then'](function(_0x20d7f6){var _0x26f4e3=path[_0xfb44('0x5e')](_0x164a65,_0xfb44('0x80')+_0x2e5bb4['id']+'-'+_0xdfdec9+_0xfb44('0x81'));var _0x5aba70={'path':_0x26f4e3,'channel':'Whatsapp','interactionId':_0x2e5bb4['id']};return pdf['createPdfFromHTML'](_0x20d7f6,_0x5aba70);})['then'](function(){return new BPromise(function(_0x3fb47d,_0x1992b2){zipdir(_0x164a65,{'saveTo':_0x42280d},function(_0x58b936,_0x6ec617){if(_0x58b936)return _0x1992b2(_0x58b936);return _0x3fb47d(_0x6ec617);});})[_0xfb44('0x1f')](function(){return new BPromise(function(_0x365c3f,_0x4e3c4c){rimraf(_0x164a65,function(_0xadb63a){if(_0xadb63a)_0x4e3c4c(_0xadb63a);return _0x365c3f();});});})[_0xfb44('0x1f')](function(){return _0x194f0d[_0xfb44('0x82')](_0x42280d,_0x53db98,function(_0x52700e){if(_0x52700e){console[_0xfb44('0x83')](_0xfb44('0x84'),_0x52700e);}else{fs[_0xfb44('0x85')](_0x42280d);}});});});}else{return _0x194f0d[_0xfb44('0x14')](0xc8);}})[_0xfb44('0x3a')](handleError(_0x194f0d,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 9a2e5e3..cf1619e 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 _0xcab6=['Users','map','then','unreadMessages','length','emit','catch','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','getUsers','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcab6,0xd4));var _0x6cab=function(_0x53aa8e,_0x4bf1a1){_0x53aa8e=_0x53aa8e-0x0;var _0x4bbc78=_0xcab6[_0x53aa8e];return _0x4bbc78;};'use strict';var EventEmitter=require(_0x6cab('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x6cab('0x1')];var WhatsappMessage=require(_0x6cab('0x2'))['db'][_0x6cab('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x6cab('0x4')](0x0);var events={'afterCreate':_0x6cab('0x5'),'afterUpdate':_0x6cab('0x6'),'afterDestroy':'remove'};function emitEvent(_0xa8b534){return function(_0x4c79f1,_0xb84505,_0x1953cd){_0x4c79f1[_0x6cab('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xdcd26b){_0x4c79f1[_0x6cab('0x8')](_0x6cab('0x9'),_0xdcd26b[_0x6cab('0xa')](function(_0x58d0ee){return{'id':_0x58d0ee['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4c79f1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6cab('0xb')](function(_0x37f00d){_0x4c79f1[_0x6cab('0x8')](_0x6cab('0xc'),_0x37f00d[_0x6cab('0xd')]);WhatsappInteractionEvents[_0x6cab('0xe')](_0xa8b534+':'+_0x4c79f1['id'],_0x4c79f1);WhatsappInteractionEvents['emit'](_0xa8b534,_0x4c79f1);_0x1953cd(null);})[_0x6cab('0xf')](_0x1953cd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x6cab('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x3a79=['WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction'];(function(_0x1385dc,_0x2c7fd7){var _0x2f6469=function(_0x47ed8a){while(--_0x47ed8a){_0x1385dc['push'](_0x1385dc['shift']());}};_0x2f6469(++_0x2c7fd7);}(_0x3a79,0xca));var _0x93a7=function(_0x1f49b0,_0x4b88c6){_0x1f49b0=_0x1f49b0-0x0;var _0x22b0e5=_0x3a79[_0x1f49b0];return _0x22b0e5;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x93a7('0x0'))['db'][_0x93a7('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x93a7('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x93a7('0x3')](0x0);var events={'afterCreate':_0x93a7('0x4'),'afterUpdate':_0x93a7('0x5'),'afterDestroy':_0x93a7('0x6')};function emitEvent(_0x1e43e0){return function(_0x2f969a,_0x58f697,_0x2976b2){_0x2f969a['getUsers']({'attributes':['id'],'raw':!![]})[_0x93a7('0x7')](function(_0x4690bb){_0x2f969a[_0x93a7('0x8')](_0x93a7('0x9'),_0x4690bb[_0x93a7('0xa')](function(_0x30f781){return{'id':_0x30f781['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x2f969a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x93a7('0x7')](function(_0x5e0abe){_0x2f969a['setDataValue'](_0x93a7('0xb'),_0x5e0abe[_0x93a7('0xc')]);WhatsappInteractionEvents[_0x93a7('0xd')](_0x1e43e0+':'+_0x2f969a['id'],_0x2f969a);WhatsappInteractionEvents['emit'](_0x1e43e0,_0x2f969a);_0x2976b2(null);})['catch'](_0x2976b2(null));};}for(var e in events){if(events[_0x93a7('0xe')](e)){var event=events[e];WhatsappInteraction[_0x93a7('0xf')](e,emitEvent(event));}}module[_0x93a7('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 0b950d8..960ca26 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 _0x8277=['WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','define'];(function(_0x5b7e20,_0x17cfec){var _0x57eddf=function(_0x486ca0){while(--_0x486ca0){_0x5b7e20['push'](_0x5b7e20['shift']());}};_0x57eddf(++_0x17cfec);}(_0x8277,0x1d4));var _0x7827=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0x8277[_0x1c3370];return _0xa9b358;};'use strict';var _=require(_0x7827('0x0'));var util=require(_0x7827('0x1'));var logger=require(_0x7827('0x2'))(_0x7827('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7827('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7827('0x5'));var config=require(_0x7827('0x6'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x1c04b6,_0x1386b1){return _0x1c04b6[_0x7827('0x7')](_0x7827('0x8'),attributes,{'tableName':_0x7827('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1620b3,_0x14da38,_0x198152){if(_0x1620b3[_0x7827('0xa')](_0x7827('0xb'))){_0x1620b3['closedAt']=moment()[_0x7827('0xc')](_0x7827('0xd'));}_0x198152(null,_0x1620b3);}}});}; \ No newline at end of file +var _0xec0d=['util','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0xec0d,0xc2));var _0xdec0=function(_0x244b18,_0x3e8f78){_0x244b18=_0x244b18-0x0;var _0xf3bf67=_0xec0d[_0x244b18];return _0xf3bf67;};'use strict';var _=require(_0xdec0('0x0'));var util=require(_0xdec0('0x1'));var logger=require(_0xdec0('0x2'))(_0xdec0('0x3'));var moment=require(_0xdec0('0x4'));var BPromise=require(_0xdec0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdec0('0x6'));var rimraf=require(_0xdec0('0x7'));var config=require('../../config/environment');var attributes=require(_0xdec0('0x8'));module[_0xdec0('0x9')]=function(_0x267754,_0x246636){return _0x267754['define'](_0xdec0('0xa'),attributes,{'tableName':_0xdec0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a8b21,_0x577207,_0x178037){if(_0x1a8b21[_0xdec0('0xc')]('closed')){_0x1a8b21['closedAt']=moment()[_0xdec0('0xd')](_0xdec0('0xe'));}_0x178037(null,_0x1a8b21);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 3f1d312..9980b8e 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 _0xe079=['redis','localhost','./whatsappInteraction.socket','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xe079,0x13f));var _0x9e07=function(_0x70b15e,_0x5321a0){_0x70b15e=_0x70b15e-0x0;var _0x12010f=_0xe079[_0x70b15e];return _0x12010f;};'use strict';var _=require(_0x9e07('0x0'));var util=require('util');var moment=require(_0x9e07('0x1'));var BPromise=require(_0x9e07('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e07('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e07('0x4'));var config=require(_0x9e07('0x5'));var jayson=require(_0x9e07('0x6'));var client=jayson[_0x9e07('0x7')][_0x9e07('0x8')]({'port':0x232a});config[_0x9e07('0x9')]=_['defaults'](config[_0x9e07('0x9')],{'host':_0x9e07('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e07('0x9')]));require(_0x9e07('0xb'))['register'](socket);function respondWithRpcPromise(_0x205bc9,_0x340411,_0x2e9323){return new BPromise(function(_0x342ae9,_0x589c8d){return client[_0x9e07('0xc')](_0x205bc9,_0x2e9323)[_0x9e07('0xd')](function(_0x2225fb){logger[_0x9e07('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0x340411,_0x9e07('0xf'));logger[_0x9e07('0x10')](_0x9e07('0x11'),_0x340411,_0x9e07('0xf'),JSON['stringify'](_0x2225fb));if(_0x2225fb[_0x9e07('0x12')]){if(_0x2225fb['error'][_0x9e07('0x13')]===0x1f4){logger[_0x9e07('0x12')](_0x9e07('0x14'),_0x340411,_0x2225fb['error'][_0x9e07('0x15')]);return _0x589c8d(_0x2225fb['error'][_0x9e07('0x15')]);}logger[_0x9e07('0x12')](_0x9e07('0x14'),_0x340411,_0x2225fb['error'][_0x9e07('0x15')]);return _0x342ae9(_0x2225fb[_0x9e07('0x12')][_0x9e07('0x15')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x340411,'request\x20sent');_0x342ae9(_0x2225fb[_0x9e07('0x16')][_0x9e07('0x15')]);}})[_0x9e07('0x17')](function(_0x179945){logger['error'](_0x9e07('0x14'),_0x340411,_0x179945);_0x589c8d(_0x179945);});});}exports[_0x9e07('0x18')]=function(_0x590a0c){var _0x43140f=this;return new Promise(function(_0x2e4f96,_0x403315){return db[_0x9e07('0x19')][_0x9e07('0x1a')](_0x590a0c['body'],{'raw':_0x590a0c[_0x9e07('0x1b')]?_0x590a0c[_0x9e07('0x1b')][_0x9e07('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x590a0c[_0x9e07('0x1b')]?_0x590a0c[_0x9e07('0x1b')][_0x9e07('0x1d')]||null:null,'attributes':_0x590a0c[_0x9e07('0x1b')]?_0x590a0c[_0x9e07('0x1b')][_0x9e07('0x1e')]||null:null,'limit':_0x590a0c[_0x9e07('0x1b')]?_0x590a0c[_0x9e07('0x1b')][_0x9e07('0x1f')]||null:null})[_0x9e07('0xd')](function(_0x304bc4){logger[_0x9e07('0xe')](_0x9e07('0x18'),_0x590a0c);logger['debug'](_0x9e07('0x18'),_0x590a0c,JSON[_0x9e07('0x20')](_0x304bc4));_0x2e4f96(_0x304bc4);})[_0x9e07('0x17')](function(_0x42ca73){logger['error'](_0x9e07('0x18'),_0x42ca73[_0x9e07('0x15')],_0x590a0c);_0x403315(_0x43140f[_0x9e07('0x12')](0x1f4,_0x42ca73[_0x9e07('0x15')]));});});};exports[_0x9e07('0x21')]=function(_0x1eefb6){return new Promise(function(_0x1ea421,_0x3ebd96){return db[_0x9e07('0x19')][_0x9e07('0x22')]({'where':_0x1eefb6[_0x9e07('0x1b')]?_0x1eefb6[_0x9e07('0x1b')][_0x9e07('0x1d')]||null:null})[_0x9e07('0xd')](function(_0x260f97){if(_0x260f97){return _0x260f97[_0x9e07('0x23')](_0x1eefb6[_0x9e07('0x24')][_0x9e07('0x25')],_[_0x9e07('0x26')](_0x1eefb6['body'],[_0x9e07('0x25'),'id'])||{});}})[_0x9e07('0x27')](function(_0x250ff1){logger[_0x9e07('0xe')](_0x9e07('0x28'),_0x1eefb6);logger[_0x9e07('0x10')](_0x9e07('0x28'),_0x1eefb6,JSON['stringify'](_0x250ff1));_0x1ea421(_0x250ff1);})['catch'](function(_0x50d1a2){logger[_0x9e07('0x12')](_0x9e07('0x28'),_0x50d1a2['message'],_0x1eefb6);_0x3ebd96(_this[_0x9e07('0x12')](0x1f4,_0x50d1a2[_0x9e07('0x15')]));});});}; \ No newline at end of file +var _0xf3a6=['redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateWhatsappInteraction','body','options','raw','attributes','limit','catch','WhatsappInteraction','find','where','addTags','ids','AddTags','debug','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xf3a6,0x12e));var _0x6f3a=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xf3a6[_0x487ab4];return _0x3bef77;};'use strict';var _=require(_0x6f3a('0x0'));var util=require(_0x6f3a('0x1'));var moment=require(_0x6f3a('0x2'));var BPromise=require(_0x6f3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f3a('0x4'));var db=require(_0x6f3a('0x5'))['db'];var utils=require(_0x6f3a('0x6'));var logger=require(_0x6f3a('0x7'))('rpc');var config=require(_0x6f3a('0x8'));var jayson=require(_0x6f3a('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x6f3a('0xa')]=_[_0x6f3a('0xb')](config[_0x6f3a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f3a('0xc'))(new Redis(config[_0x6f3a('0xa')]));require(_0x6f3a('0xd'))[_0x6f3a('0xe')](socket);function respondWithRpcPromise(_0x17ef1b,_0x2a9138,_0xaceece){return new BPromise(function(_0x443fcb,_0x4a9fcd){return client[_0x6f3a('0xf')](_0x17ef1b,_0xaceece)[_0x6f3a('0x10')](function(_0x455535){logger[_0x6f3a('0x11')](_0x6f3a('0x12'),_0x2a9138,_0x6f3a('0x13'));logger['debug'](_0x6f3a('0x14'),_0x2a9138,_0x6f3a('0x13'),JSON['stringify'](_0x455535));if(_0x455535['error']){if(_0x455535[_0x6f3a('0x15')]['code']===0x1f4){logger[_0x6f3a('0x15')](_0x6f3a('0x12'),_0x2a9138,_0x455535['error'][_0x6f3a('0x16')]);return _0x4a9fcd(_0x455535[_0x6f3a('0x15')][_0x6f3a('0x16')]);}logger[_0x6f3a('0x15')](_0x6f3a('0x12'),_0x2a9138,_0x455535[_0x6f3a('0x15')][_0x6f3a('0x16')]);return _0x443fcb(_0x455535[_0x6f3a('0x15')]['message']);}else{logger[_0x6f3a('0x11')](_0x6f3a('0x12'),_0x2a9138,_0x6f3a('0x13'));_0x443fcb(_0x455535[_0x6f3a('0x17')][_0x6f3a('0x16')]);}})['catch'](function(_0x5e9185){logger['error'](_0x6f3a('0x12'),_0x2a9138,_0x5e9185);_0x4a9fcd(_0x5e9185);});});}exports[_0x6f3a('0x18')]=function(_0x2af813){var _0x1c741b=this;return new Promise(function(_0x3bfa87,_0x5a2683){return db['WhatsappInteraction']['update'](_0x2af813[_0x6f3a('0x19')],{'raw':_0x2af813['options']?_0x2af813[_0x6f3a('0x1a')][_0x6f3a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af813['options']?_0x2af813[_0x6f3a('0x1a')]['where']||null:null,'attributes':_0x2af813[_0x6f3a('0x1a')]?_0x2af813[_0x6f3a('0x1a')][_0x6f3a('0x1c')]||null:null,'limit':_0x2af813[_0x6f3a('0x1a')]?_0x2af813[_0x6f3a('0x1a')][_0x6f3a('0x1d')]||null:null})[_0x6f3a('0x10')](function(_0x2b256d){logger[_0x6f3a('0x11')](_0x6f3a('0x18'),_0x2af813);logger['debug'](_0x6f3a('0x18'),_0x2af813,JSON['stringify'](_0x2b256d));_0x3bfa87(_0x2b256d);})[_0x6f3a('0x1e')](function(_0x212d96){logger['error'](_0x6f3a('0x18'),_0x212d96[_0x6f3a('0x16')],_0x2af813);_0x5a2683(_0x1c741b[_0x6f3a('0x15')](0x1f4,_0x212d96[_0x6f3a('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x50b6dd){return new Promise(function(_0x4395b1,_0x3e8d43){return db[_0x6f3a('0x1f')][_0x6f3a('0x20')]({'where':_0x50b6dd[_0x6f3a('0x1a')]?_0x50b6dd[_0x6f3a('0x1a')][_0x6f3a('0x21')]||null:null})[_0x6f3a('0x10')](function(_0x3af45e){if(_0x3af45e){return _0x3af45e[_0x6f3a('0x22')](_0x50b6dd[_0x6f3a('0x19')][_0x6f3a('0x23')],_['omit'](_0x50b6dd['body'],[_0x6f3a('0x23'),'id'])||{});}})['spread'](function(_0x3a1b32){logger[_0x6f3a('0x11')](_0x6f3a('0x24'),_0x50b6dd);logger[_0x6f3a('0x25')]('AddTags',_0x50b6dd,JSON[_0x6f3a('0x26')](_0x3a1b32));_0x4395b1(_0x3a1b32);})[_0x6f3a('0x1e')](function(_0x25a416){logger[_0x6f3a('0x15')]('AddTags',_0x25a416['message'],_0x50b6dd);_0x3e8d43(_this[_0x6f3a('0x15')](0x1f4,_0x25a416[_0x6f3a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 7081e74..8835714 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 _0x5013=['save','remove','update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x19365f,_0xfb856c){var _0x394e62=function(_0x258f06){while(--_0x258f06){_0x19365f['push'](_0x19365f['shift']());}};_0x394e62(++_0xfb856c);}(_0x5013,0x1dc));var _0x3501=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x5013[_0x3ce3c];return _0x55a2c9;};'use strict';var WhatsappInteractionEvents=require(_0x3501('0x0'));var events=[_0x3501('0x1'),_0x3501('0x2'),_0x3501('0x3')];function createListener(_0x54f2ae,_0x5f3802){return function(_0x5dae06){_0x5f3802[_0x3501('0x4')](_0x54f2ae,_0x5dae06);};}function removeListener(_0x1a5dd8,_0x563b8b){return function(){WhatsappInteractionEvents[_0x3501('0x5')](_0x1a5dd8,_0x563b8b);};}exports[_0x3501('0x6')]=function(_0x2e66b0){for(var _0x4c5dd9=0x0,_0x45da3c=events[_0x3501('0x7')];_0x4c5dd9<_0x45da3c;_0x4c5dd9++){var _0x3be614=events[_0x4c5dd9];var _0x851425=createListener(_0x3501('0x8')+_0x3be614,_0x2e66b0);WhatsappInteractionEvents['on'](_0x3be614,_0x851425);}}; \ No newline at end of file +var _0x4743=['./whatsappInteraction.events','save','remove','update','emit','removeListener','length','whatsappInteraction:'];(function(_0x358b62,_0x3adcf1){var _0x5525d3=function(_0x577028){while(--_0x577028){_0x358b62['push'](_0x358b62['shift']());}};_0x5525d3(++_0x3adcf1);}(_0x4743,0x1b8));var _0x3474=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x4743[_0x19dd7a];return _0x3feb6a;};'use strict';var WhatsappInteractionEvents=require(_0x3474('0x0'));var events=[_0x3474('0x1'),_0x3474('0x2'),_0x3474('0x3')];function createListener(_0x206b9f,_0x1215ce){return function(_0xc8ec02){_0x1215ce[_0x3474('0x4')](_0x206b9f,_0xc8ec02);};}function removeListener(_0xc562e,_0x229da3){return function(){WhatsappInteractionEvents[_0x3474('0x5')](_0xc562e,_0x229da3);};}exports['register']=function(_0x421a8b){for(var _0x2dbbce=0x0,_0x16eaeb=events[_0x3474('0x6')];_0x2dbbce<_0x16eaeb;_0x2dbbce++){var _0x4d4e34=events[_0x2dbbce];var _0x3b4a32=createListener(_0x3474('0x7')+_0x4d4e34,_0x421a8b);WhatsappInteractionEvents['on'](_0x4d4e34,_0x3b4a32);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index eaeea8e..156ddb9 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 _0x1185=['isAuthenticated','describe','/:id','show','whatsapp','whatsappmessage:create','put','accept','/:id/reject','reject','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','index','get','/describe'];(function(_0xb8e886,_0x2766b5){var _0x3e404e=function(_0x198513){while(--_0x198513){_0xb8e886['push'](_0xb8e886['shift']());}};_0x3e404e(++_0x2766b5);}(_0x1185,0x6c));var _0x5118=function(_0x15e7ca,_0x218215){_0x15e7ca=_0x15e7ca-0x0;var _0x5565d6=_0x1185[_0x15e7ca];return _0x5565d6;};'use strict';var multer=require(_0x5118('0x0'));var util=require(_0x5118('0x1'));var path=require(_0x5118('0x2'));var timeout=require('connect-timeout');var express=require(_0x5118('0x3'));var router=express[_0x5118('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5118('0x5'));var interaction=require(_0x5118('0x6'));var config=require(_0x5118('0x7'));var controller=require(_0x5118('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5118('0x9')]);router[_0x5118('0xa')](_0x5118('0xb'),auth[_0x5118('0xc')](),controller[_0x5118('0xd')]);router[_0x5118('0xa')](_0x5118('0xe'),auth[_0x5118('0xc')](),controller[_0x5118('0xf')]);router['post']('/',auth[_0x5118('0xc')](),interaction['tracked'](_0x5118('0x10'),_0x5118('0x11')),controller['create']);router['post']('/:id/status',controller['status']);router[_0x5118('0x12')](_0x5118('0xe'),auth[_0x5118('0xc')](),controller['update']);router[_0x5118('0x12')]('/:id/accept',auth[_0x5118('0xc')](),controller[_0x5118('0x13')]);router[_0x5118('0x12')](_0x5118('0x14'),auth['isAuthenticated'](),controller[_0x5118('0x15')]);router['delete'](_0x5118('0xe'),auth['isAuthenticated'](),controller[_0x5118('0x16')]);module[_0x5118('0x17')]=router; \ No newline at end of file +var _0x54d2=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update'];(function(_0x1dd175,_0x590a7b){var _0x53539a=function(_0x24501b){while(--_0x24501b){_0x1dd175['push'](_0x1dd175['shift']());}};_0x53539a(++_0x590a7b);}(_0x54d2,0xa2));var _0x254d=function(_0x506ac5,_0x3fec2a){_0x506ac5=_0x506ac5-0x0;var _0x3afcc1=_0x54d2[_0x506ac5];return _0x3afcc1;};'use strict';var multer=require(_0x254d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x254d('0x1'));var express=require(_0x254d('0x2'));var router=express[_0x254d('0x3')]();var fs_extra=require(_0x254d('0x4'));var auth=require(_0x254d('0x5'));var interaction=require(_0x254d('0x6'));var config=require('../../config/environment');var controller=require(_0x254d('0x7'));router[_0x254d('0x8')]('/',auth['isAuthenticated'](),controller[_0x254d('0x9')]);router[_0x254d('0x8')](_0x254d('0xa'),auth[_0x254d('0xb')](),controller[_0x254d('0xc')]);router[_0x254d('0x8')](_0x254d('0xd'),auth['isAuthenticated'](),controller[_0x254d('0xe')]);router[_0x254d('0xf')]('/',auth[_0x254d('0xb')](),interaction[_0x254d('0x10')](_0x254d('0x11'),_0x254d('0x12')),controller[_0x254d('0x13')]);router[_0x254d('0xf')](_0x254d('0x14'),controller[_0x254d('0x15')]);router[_0x254d('0x16')](_0x254d('0xd'),auth[_0x254d('0xb')](),controller[_0x254d('0x17')]);router['put'](_0x254d('0x18'),auth['isAuthenticated'](),controller[_0x254d('0x19')]);router[_0x254d('0x16')](_0x254d('0x1a'),auth['isAuthenticated'](),controller[_0x254d('0x1b')]);router[_0x254d('0x1c')](_0x254d('0xd'),auth['isAuthenticated'](),controller[_0x254d('0x1d')]);module[_0x254d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index bcd0f15..ca370e3 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 _0x4c85=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT','medium'];(function(_0x4cfc34,_0x2cd11e){var _0x8e6a43=function(_0x52a49f){while(--_0x52a49f){_0x4cfc34['push'](_0x4cfc34['shift']());}};_0x8e6a43(++_0x2cd11e);}(_0x4c85,0xa5));var _0x54c8=function(_0x30d624,_0x160d06){_0x30d624=_0x30d624-0x0;var _0x16f949=_0x4c85[_0x30d624];return _0x16f949;};'use strict';var Sequelize=require(_0x54c8('0x0'));module['exports']={'body':{'type':Sequelize[_0x54c8('0x1')](_0x54c8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x54c8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x54c8('0x4')]('in',_0x54c8('0x5')),'defaultValue':_0x54c8('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x54c8('0x6')](0xbe)},'phone':{'type':Sequelize[_0x54c8('0x6')]},'readAt':{'type':Sequelize[_0x54c8('0x7')]},'secret':{'type':Sequelize[_0x54c8('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3d59=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d59,0x117));var _0x93d5=function(_0xcd2be2,_0x155d0d){_0xcd2be2=_0xcd2be2-0x0;var _0x2d14dc=_0x3d59[_0xcd2be2];return _0x2d14dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x93d5('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x93d5('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x93d5('0x2')]('in',_0x93d5('0x3')),'defaultValue':_0x93d5('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x93d5('0x4')](0xbe)},'phone':{'type':Sequelize[_0x93d5('0x4')]},'readAt':{'type':Sequelize[_0x93d5('0x5')]},'secret':{'type':Sequelize[_0x93d5('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x93d5('0x4')]},'providerResponse':{'type':Sequelize[_0x93d5('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index a177832..04a96bd 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 _0xf523=['sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','create','body','find','params','describe','whatsapp-interactions','accept','whatsapp','read','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','QueryTypes','SELECT','User','fullname','internal','manual','interface','SIP/%s','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','channel','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x153800,_0x545190){var _0xc7d350=function(_0x5e5744){while(--_0x5e5744){_0x153800['push'](_0x153800['shift']());}};_0xc7d350(++_0x545190);}(_0xf523,0xd4));var _0x3f52=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf523[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x3f52('0x0'));var rimraf=require(_0x3f52('0x1'));var zipdir=require(_0x3f52('0x2'));var jsonpatch=require(_0x3f52('0x3'));var rp=require(_0x3f52('0x4'));var moment=require('moment');var BPromise=require(_0x3f52('0x5'));var Mustache=require('mustache');var util=require(_0x3f52('0x6'));var path=require(_0x3f52('0x7'));var sox=require(_0x3f52('0x8'));var csv=require(_0x3f52('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f52('0xa'));var _=require(_0x3f52('0xb'));var squel=require(_0x3f52('0xc'));var crypto=require(_0x3f52('0xd'));var jsforce=require(_0x3f52('0xe'));var deskjs=require(_0x3f52('0xf'));var toCsv=require(_0x3f52('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f52('0x10'));var authService=require(_0x3f52('0x11'));var qs=require(_0x3f52('0x12'));var as=require(_0x3f52('0x13'));var hardwareService=require(_0x3f52('0x14'));var logger=require(_0x3f52('0x15'))(_0x3f52('0x16'));var utils=require('../../config/utils');var config=require(_0x3f52('0x17'));var licenseUtil=require(_0x3f52('0x18'));var db=require(_0x3f52('0x19'))['db'];config[_0x3f52('0x1a')]=_[_0x3f52('0x1b')](config[_0x3f52('0x1a')],{'host':_0x3f52('0x1c'),'port':0x18eb});var socket=require(_0x3f52('0x1d'))(new Redis(config[_0x3f52('0x1a')]));require(_0x3f52('0x1e'))[_0x3f52('0x1f')](socket);var jayson=require(_0x3f52('0x20'));var client=jayson[_0x3f52('0x21')][_0x3f52('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x3f52('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x11b277,_0x3c0978,_0x3e5c59,_0x4f6d4e){return new BPromise(function(_0x5cdb3c,_0x36ad13){var _0xb84222=_0x4f6d4e||client;return _0xb84222[_0x3f52('0x23')](_0x11b277,_0x3e5c59)[_0x3f52('0x24')](function(_0x1e3af4){logger[_0x3f52('0x25')](_0x3f52('0x26'),_0x3c0978,_0x3f52('0x27'));logger[_0x3f52('0x28')](_0x3f52('0x29'),_0x3c0978,_0x3f52('0x27'),JSON[_0x3f52('0x2a')](_0x1e3af4));if(_0x1e3af4['error']){if(_0x1e3af4[_0x3f52('0x2b')][_0x3f52('0x2c')]===0x1f4){logger['error'](_0x3f52('0x26'),_0x3c0978,_0x1e3af4['error'][_0x3f52('0x2d')]);return _0x36ad13(_0x1e3af4['error']['message']);}logger[_0x3f52('0x2b')](_0x3f52('0x26'),_0x3c0978,_0x1e3af4[_0x3f52('0x2b')][_0x3f52('0x2d')]);return _0x5cdb3c(_0x1e3af4['error']['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3c0978,_0x3f52('0x27'));_0x5cdb3c(_0x1e3af4[_0x3f52('0x2e')][_0x3f52('0x2d')]);}})[_0x3f52('0x2f')](function(_0x141858){logger[_0x3f52('0x2b')](_0x3f52('0x26'),_0x3c0978,_0x141858);_0x36ad13(_0x141858);});});}function respondWithStatusCode(_0x21f814,_0x522b99){_0x522b99=_0x522b99||0xcc;return function(_0x41d597){if(_0x41d597){return _0x21f814[_0x3f52('0x30')](_0x522b99);}return _0x21f814[_0x3f52('0x31')](_0x522b99)[_0x3f52('0x32')]();};}function respondWithResult(_0x134c28,_0x1dfb23){_0x1dfb23=_0x1dfb23||0xc8;return function(_0x18099c){if(_0x18099c){return _0x134c28[_0x3f52('0x31')](_0x1dfb23)['json'](_0x18099c);}};}function respondWithFilteredResult(_0x31c9f2,_0x5e38c8){return function(_0x42a937){if(_0x42a937){var _0x36bb5d=typeof _0x5e38c8[_0x3f52('0x33')]===_0x3f52('0x34')&&typeof _0x5e38c8['limit']==='undefined';var _0x4b4ad6=_0x42a937[_0x3f52('0x35')];var _0x18a21e=_0x36bb5d?0x0:_0x5e38c8['offset'];var _0xf67c7e=_0x36bb5d?_0x42a937[_0x3f52('0x35')]:_0x5e38c8[_0x3f52('0x33')]+_0x5e38c8['limit'];var _0x4dee14;if(_0xf67c7e>=_0x4b4ad6){_0xf67c7e=_0x4b4ad6;_0x4dee14=0xc8;}else{_0x4dee14=0xce;}_0x31c9f2[_0x3f52('0x31')](_0x4dee14);return _0x31c9f2[_0x3f52('0x36')](_0x3f52('0x37'),_0x18a21e+'-'+_0xf67c7e+'/'+_0x4b4ad6)[_0x3f52('0x38')](_0x42a937);}return null;};}function patchUpdates(_0xefd560){return function(_0x2f4ae6){try{jsonpatch[_0x3f52('0x39')](_0x2f4ae6,_0xefd560,!![]);}catch(_0x438e9f){return BPromise[_0x3f52('0x3a')](_0x438e9f);}return _0x2f4ae6[_0x3f52('0x3b')]();};}function saveUpdates(_0x4fef5d,_0x35ec7f){return function(_0x3afaac){if(_0x3afaac){return _0x3afaac[_0x3f52('0x3c')](_0x4fef5d)['then'](function(_0x4e57e0){return _0x4e57e0;});}return null;};}function removeEntity(_0x578337,_0x5e8463){return function(_0x3e8309){if(_0x3e8309){return _0x3e8309[_0x3f52('0x3d')]()[_0x3f52('0x24')](function(){_0x578337['status'](0xcc)[_0x3f52('0x32')]();});}};}function handleEntityNotFound(_0x462709,_0x609fc6){return function(_0x4c601a){if(!_0x4c601a){_0x462709[_0x3f52('0x30')](0x194);}return _0x4c601a;};}function handleError(_0x306839,_0x59a50){_0x59a50=_0x59a50||0x1f4;return function(_0x228244){logger[_0x3f52('0x2b')](_0x228244[_0x3f52('0x3e')]);if(_0x228244[_0x3f52('0x3f')]){delete _0x228244[_0x3f52('0x3f')];}_0x306839[_0x3f52('0x31')](_0x59a50)['send'](_0x228244);};}exports[_0x3f52('0x40')]=function(_0x490428,_0x11325a){var _0x4fee96={},_0x137aee={},_0x25c44a={'count':0x0,'rows':[]};var _0x25dc08=_['map'](db[_0x3f52('0x41')][_0x3f52('0x42')],function(_0x401b47){return{'name':_0x401b47[_0x3f52('0x43')],'type':_0x401b47[_0x3f52('0x44')][_0x3f52('0x45')]};});_0x137aee[_0x3f52('0x46')]=_[_0x3f52('0x47')](_0x25dc08,_0x3f52('0x3f'));_0x137aee[_0x3f52('0x48')]=_[_0x3f52('0x49')](_0x490428[_0x3f52('0x48')]);_0x137aee['filters']=_[_0x3f52('0x4a')](_0x137aee['model'],_0x137aee[_0x3f52('0x48')]);_0x4fee96[_0x3f52('0x4b')]=_[_0x3f52('0x4a')](_0x137aee[_0x3f52('0x46')],qs[_0x3f52('0x4c')](_0x490428[_0x3f52('0x48')][_0x3f52('0x4c')]));_0x4fee96[_0x3f52('0x4b')]=_0x4fee96['attributes'][_0x3f52('0x4d')]?_0x4fee96['attributes']:_0x137aee[_0x3f52('0x46')];if(!_0x490428['query'][_0x3f52('0x4e')](_0x3f52('0x4f'))){_0x4fee96[_0x3f52('0x50')]=qs[_0x3f52('0x50')](_0x490428['query'][_0x3f52('0x50')]);_0x4fee96['offset']=qs['offset'](_0x490428[_0x3f52('0x48')][_0x3f52('0x33')]);}_0x4fee96[_0x3f52('0x51')]=qs[_0x3f52('0x52')](_0x490428[_0x3f52('0x48')][_0x3f52('0x52')]);_0x4fee96[_0x3f52('0x53')]=qs[_0x3f52('0x54')](_[_0x3f52('0x55')](_0x490428[_0x3f52('0x48')],_0x137aee[_0x3f52('0x54')]),_0x25dc08);if(_0x490428[_0x3f52('0x48')][_0x3f52('0x56')]){_0x4fee96['where']=_[_0x3f52('0x57')](_0x4fee96['where'],{'$or':_[_0x3f52('0x47')](_0x25dc08,function(_0x35fc2c){if(_0x35fc2c['type']!==_0x3f52('0x58')){var _0x568939={};_0x568939[_0x35fc2c['name']]={'$like':'%'+_0x490428[_0x3f52('0x48')][_0x3f52('0x56')]+'%'};return _0x568939;}})});}_0x4fee96=_[_0x3f52('0x57')]({},_0x4fee96,_0x490428[_0x3f52('0x59')]);var _0x2a0bfd={'where':_0x4fee96['where']};return db['WhatsappMessage'][_0x3f52('0x35')](_0x2a0bfd)['then'](function(_0x71fb3a){_0x25c44a[_0x3f52('0x35')]=_0x71fb3a;if(_0x490428[_0x3f52('0x48')][_0x3f52('0x5a')]){_0x4fee96['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x3f52('0x5b')](_0x4fee96);})[_0x3f52('0x24')](function(_0x37a4e9){_0x25c44a[_0x3f52('0x5c')]=_0x37a4e9;return _0x25c44a;})[_0x3f52('0x24')](respondWithFilteredResult(_0x11325a,_0x4fee96))[_0x3f52('0x2f')](handleError(_0x11325a,null));};exports[_0x3f52('0x5d')]=function(_0x3ebe24,_0x49fc85){var _0x13e3f4={'raw':!![],'where':{'id':_0x3ebe24['params']['id']}},_0x36bae2={};_0x36bae2[_0x3f52('0x46')]=_[_0x3f52('0x49')](db[_0x3f52('0x41')][_0x3f52('0x42')]);_0x36bae2[_0x3f52('0x48')]=_[_0x3f52('0x49')](_0x3ebe24[_0x3f52('0x48')]);_0x36bae2['filters']=_['intersection'](_0x36bae2[_0x3f52('0x46')],_0x36bae2[_0x3f52('0x48')]);_0x13e3f4['attributes']=_[_0x3f52('0x4a')](_0x36bae2[_0x3f52('0x46')],qs['fields'](_0x3ebe24[_0x3f52('0x48')][_0x3f52('0x4c')]));_0x13e3f4[_0x3f52('0x4b')]=_0x13e3f4[_0x3f52('0x4b')][_0x3f52('0x4d')]?_0x13e3f4[_0x3f52('0x4b')]:_0x36bae2[_0x3f52('0x46')];if(_0x3ebe24[_0x3f52('0x48')][_0x3f52('0x5a')]){_0x13e3f4[_0x3f52('0x5e')]=[{'all':!![]}];}_0x13e3f4=_[_0x3f52('0x57')]({},_0x13e3f4,_0x3ebe24[_0x3f52('0x59')]);return db[_0x3f52('0x41')]['find'](_0x13e3f4)['then'](handleEntityNotFound(_0x49fc85,null))[_0x3f52('0x24')](respondWithResult(_0x49fc85,null))['catch'](handleError(_0x49fc85,null));};exports[_0x3f52('0x5f')]=function(_0x32eff2,_0x486664){return db[_0x3f52('0x41')][_0x3f52('0x5f')](_0x32eff2[_0x3f52('0x60')],{})[_0x3f52('0x24')](respondWithResult(_0x486664,0xc9))['catch'](handleError(_0x486664,null));};exports['update']=function(_0x426003,_0x101ee0){if(_0x426003[_0x3f52('0x60')]['id']){delete _0x426003[_0x3f52('0x60')]['id'];}return db[_0x3f52('0x41')][_0x3f52('0x61')]({'where':{'id':_0x426003[_0x3f52('0x62')]['id']}})['then'](handleEntityNotFound(_0x101ee0,null))[_0x3f52('0x24')](saveUpdates(_0x426003[_0x3f52('0x60')],null))[_0x3f52('0x24')](respondWithResult(_0x101ee0,null))[_0x3f52('0x2f')](handleError(_0x101ee0,null));};exports[_0x3f52('0x3d')]=function(_0x307e2b,_0x4c5e86){return db[_0x3f52('0x41')][_0x3f52('0x61')]({'where':{'id':_0x307e2b['params']['id']}})[_0x3f52('0x24')](handleEntityNotFound(_0x4c5e86,null))[_0x3f52('0x24')](removeEntity(_0x4c5e86,null))[_0x3f52('0x2f')](handleError(_0x4c5e86,null));};exports[_0x3f52('0x63')]=function(_0x86a7f5,_0x46d429){return db['WhatsappMessage'][_0x3f52('0x63')]()['then'](respondWithResult(_0x46d429,null))['catch'](handleError(_0x46d429,null));};var interaction_log=require('../../config/logger')(_0x3f52('0x64'));exports[_0x3f52('0x65')]=function(_0x4f29f6,_0x4ce432,_0x513682){var _0x447ddc={'agent':{},'channel':_0x3f52('0x66')};if(_0x4f29f6['body']['id']){delete _0x4f29f6[_0x3f52('0x60')]['id'];}_0x4f29f6[_0x3f52('0x60')][_0x3f52('0x67')]=!![];_0x4f29f6[_0x3f52('0x60')]['readAt']=moment()[_0x3f52('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f29f6['body'][_0x3f52('0x69')]=_0x4f29f6[_0x3f52('0x60')][_0x3f52('0x69')]||_0x4f29f6[_0x3f52('0x6a')]['id'];_0x447ddc[_0x3f52('0x6b')]['id']=_0x4f29f6[_0x3f52('0x60')][_0x3f52('0x69')];return db['WhatsappMessage'][_0x3f52('0x61')]({'where':{'id':_0x4f29f6[_0x3f52('0x62')]['id'],'UserId':null}})[_0x3f52('0x24')](handleEntityNotFound(_0x4ce432,null))[_0x3f52('0x24')](saveUpdates(_0x4f29f6[_0x3f52('0x60')],null))['then'](function(_0xa33cbf){if(_0xa33cbf){_0x447ddc[_0x3f52('0x2d')]=_0xa33cbf[_0x3f52('0x6c')]({'plain':!![]});return db[_0x3f52('0x6d')][_0x3f52('0x61')]({'where':{'id':_0xa33cbf[_0x3f52('0x6e')]}});}return null;})['then'](handleEntityNotFound(_0x4ce432,null))[_0x3f52('0x24')](function(_0x3e9d80){if(_0x3e9d80){return _0x3e9d80[_0x3f52('0x3c')]({'UserId':_0x4f29f6[_0x3f52('0x60')][_0x3f52('0x69')],'read1stAt':_[_0x3f52('0x6f')](_0x3e9d80[_0x3f52('0x70')])?moment()[_0x3f52('0x68')](_0x3f52('0x71')):undefined});}return null;})[_0x3f52('0x24')](function(_0x17014b){if(_0x17014b){_0x447ddc[_0x3f52('0x72')]=_0x17014b['get']({'plain':!![]});interaction_log[_0x3f52('0x25')](_0x3f52('0x73'),_0x4f29f6['user']['id'],_0x4f29f6[_0x3f52('0x6a')][_0x3f52('0x3f')],_0x4f29f6[_0x3f52('0x6a')][_0x3f52('0x74')],_0x447ddc[_0x3f52('0x72')]['id'],_0x4f29f6[_0x3f52('0x60')]?JSON[_0x3f52('0x2a')](_0x4f29f6[_0x3f52('0x60')]):_0x3f52('0x75'));return respondWithRpcPromise('AcceptMessage',_0x3f52('0x76'),_0x447ddc);}return null;})[_0x3f52('0x24')](function(_0x4d5573){var _0x1ffde7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d5573['message'][_0x3f52('0x77')];return db['sequelize'][_0x3f52('0x48')](_0x1ffde7,{'type':db['Sequelize'][_0x3f52('0x78')][_0x3f52('0x79')],'raw':!![]})[_0x3f52('0x24')](function(_0x315c5a){return _0x315c5a;});})['then'](function(_0x3788df){if(_0x3788df){_0x447ddc[_0x3f52('0x2d')]['contact']=_0x3788df[0x0];if(!_0x4f29f6[_0x3f52('0x60')][_0x3f52('0x69')])return;return db[_0x3f52('0x7a')]['find']({'where':{'id':_0x4f29f6[_0x3f52('0x60')]['UserId'],'role':'agent'},'attributes':['id',_0x3f52('0x3f'),_0x3f52('0x7b'),'email',_0x3f52('0x7c')],'raw':!![]});}return null;})[_0x3f52('0x24')](function(_0x313f69){if(!_0x313f69)return null;_0x447ddc['message']['agent']=_0x313f69;return _0x447ddc;})[_0x3f52('0x24')](function(_0x5db8ec){if(_0x5db8ec){if(_0x4f29f6['body'][_0x3f52('0x7d')]){_0x447ddc['message'][_0x3f52('0x7e')]=util[_0x3f52('0x68')](_0x3f52('0x7f'),_0x4f29f6[_0x3f52('0x6a')][_0x3f52('0x3f')]);_0x447ddc[_0x3f52('0x2d')]['channel']=_0x447ddc['channel'];_0x447ddc[_0x3f52('0x2d')]['motionChannel']=_0x447ddc['channel'];_0x447ddc[_0x3f52('0x2d')]['event']=_0x3f52('0x65');return respondWithRpcPromise(_0x3f52('0x80'),_0x3f52('0x80'),{'event':'acceptmessage','message':_0x447ddc[_0x3f52('0x2d')]},client9002)[_0x3f52('0x24')](function(){return _0x447ddc;});}return _0x447ddc;}return null;})[_0x3f52('0x24')](respondWithResult(_0x4ce432,null))['catch'](handleError(_0x4ce432,null));};var interaction_log=require(_0x3f52('0x15'))(_0x3f52('0x64'));exports[_0x3f52('0x3a')]=function(_0x1f45df,_0x301ad9,_0x281a17){var _0x2f7c15={'agent':{},'channel':_0x3f52('0x66')};if(_0x1f45df['body']['id']){delete _0x1f45df['body']['id'];}_0x1f45df[_0x3f52('0x60')][_0x3f52('0x69')]=_0x1f45df[_0x3f52('0x60')][_0x3f52('0x69')]||_0x1f45df[_0x3f52('0x6a')]['id'];_0x2f7c15['agent']['id']=_0x1f45df[_0x3f52('0x60')][_0x3f52('0x69')];return db['WhatsappMessage'][_0x3f52('0x61')]({'where':{'id':_0x1f45df['params']['id'],'UserId':null}})[_0x3f52('0x24')](handleEntityNotFound(_0x301ad9,null))['then'](function(_0x2ffe9e){if(_0x2ffe9e){_0x2f7c15['message']=_0x2ffe9e[_0x3f52('0x6c')]({'plain':!![]});return db[_0x3f52('0x6d')][_0x3f52('0x61')]({'where':{'id':_0x2ffe9e[_0x3f52('0x6e')]}});}return null;})[_0x3f52('0x24')](handleEntityNotFound(_0x301ad9,null))[_0x3f52('0x24')](function(_0x8cebd6){if(_0x8cebd6){_0x2f7c15['interaction']=_0x8cebd6[_0x3f52('0x6c')]({'plain':!![]});interaction_log[_0x3f52('0x25')](_0x3f52('0x81'),_0x1f45df[_0x3f52('0x6a')]['id'],_0x1f45df[_0x3f52('0x6a')][_0x3f52('0x3f')],_0x1f45df[_0x3f52('0x6a')][_0x3f52('0x74')],_0x2f7c15[_0x3f52('0x72')]['id'],_0x1f45df[_0x3f52('0x60')]?JSON[_0x3f52('0x2a')](_0x1f45df[_0x3f52('0x60')]):_0x3f52('0x75'));return respondWithRpcPromise(_0x3f52('0x82'),_0x3f52('0x83'),_0x2f7c15);}return null;})[_0x3f52('0x24')](function(_0x1dd71f){var _0x103115=_0x3f52('0x84')+_0x1dd71f[_0x3f52('0x2d')][_0x3f52('0x77')];return db[_0x3f52('0x85')][_0x3f52('0x48')](_0x103115,{'type':db[_0x3f52('0x86')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3f52('0x24')](function(_0x2fd785){return _0x2fd785;});})[_0x3f52('0x24')](function(_0x2c1c48){if(_0x2c1c48){_0x2f7c15[_0x3f52('0x2d')][_0x3f52('0x87')]=_0x2c1c48[0x0];if(!_0x1f45df['body']['UserId'])return;return db[_0x3f52('0x7a')][_0x3f52('0x61')]({'where':{'id':_0x1f45df[_0x3f52('0x60')]['UserId'],'role':_0x3f52('0x6b')},'attributes':['id',_0x3f52('0x3f'),'fullname','email',_0x3f52('0x7c')],'raw':!![]});}return null;})[_0x3f52('0x24')](function(_0x512352){if(!_0x512352)return null;_0x2f7c15[_0x3f52('0x2d')]['agent']=_0x512352;return _0x2f7c15;})['then'](function(_0x48cb93){if(_0x48cb93){_0x48cb93['message'][_0x3f52('0x7e')]=util[_0x3f52('0x68')](_0x3f52('0x7f'),_0x1f45df[_0x3f52('0x6a')][_0x3f52('0x3f')]);_0x48cb93[_0x3f52('0x2d')][_0x3f52('0x88')]=_0x2f7c15[_0x3f52('0x88')];_0x48cb93[_0x3f52('0x2d')]['motionChannel']=_0x2f7c15[_0x3f52('0x88')];_0x48cb93['message'][_0x3f52('0x89')]='reject';respondWithRpcPromise('EventManager',_0x3f52('0x80'),{'event':_0x3f52('0x8a'),'message':_0x48cb93[_0x3f52('0x2d')]},client9002);return _0x2f7c15;}return null;})['then'](respondWithResult(_0x301ad9,null))['catch'](handleError(_0x301ad9,null));};exports[_0x3f52('0x31')]=function(_0x23f1cf,_0x11b177,_0x4104df){if(_0x23f1cf[_0x3f52('0x60')]['id']){delete _0x23f1cf['body']['id'];}var _0xf1eef4;return db[_0x3f52('0x41')][_0x3f52('0x61')]({'where':{'id':_0x23f1cf[_0x3f52('0x62')]['id']}})[_0x3f52('0x24')](handleEntityNotFound(_0x11b177,null))[_0x3f52('0x24')](function(_0x137f9d){if(_0x137f9d){_0xf1eef4=_0x137f9d;return db[_0x3f52('0x8b')][_0x3f52('0x61')]({'where':{'id':_0x137f9d[_0x3f52('0x8c')]}});}})[_0x3f52('0x24')](handleEntityNotFound(_0x11b177,null))[_0x3f52('0x24')](function(_0x3ae85d){if(_0x3ae85d){logger[_0x3f52('0x28')](_0x3f52('0x8d'),'status',_0x3f52('0x8e'),_0x3ae85d[_0x3f52('0x44')],util[_0x3f52('0x8f')](_0x23f1cf[_0x3f52('0x60')],{'showHidden':![],'depth':null}));switch(_0x3ae85d[_0x3f52('0x44')]){case'twilio':if(_0x23f1cf[_0x3f52('0x60')]['MessageSid']&&_0x23f1cf[_0x3f52('0x60')]['MessageSid']===_0xf1eef4['messageId']&&_0x23f1cf[_0x3f52('0x60')][_0x3f52('0x90')]&&_0x23f1cf[_0x3f52('0x60')][_0x3f52('0x90')]==='read'){return _0xf1eef4['update']({'read':!![]});}else{logger['error'](_0x3f52('0x91'),'status',_0x3f52('0x92'),util[_0x3f52('0x8f')](_0x23f1cf[_0x3f52('0x60')],{'showHidden':![],'depth':null}));}break;}return _0xf1eef4;}})[_0x3f52('0x24')](respondWithResult(_0x11b177,null))['catch'](handleError(_0x11b177,null));}; \ No newline at end of file +var _0xe504=['reject','save','update','stack','name','send','index','WhatsappMessage','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','show','keys','rawAttributes','options','body','params','find','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE: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','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','interface','event','rejectmessage','WhatsappAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xe504,0xe1));var _0x4e50=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe504[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x4e50('0x0'));var rimraf=require(_0x4e50('0x1'));var zipdir=require(_0x4e50('0x2'));var jsonpatch=require(_0x4e50('0x3'));var rp=require('request-promise');var moment=require(_0x4e50('0x4'));var BPromise=require(_0x4e50('0x5'));var Mustache=require(_0x4e50('0x6'));var util=require('util');var path=require(_0x4e50('0x7'));var sox=require(_0x4e50('0x8'));var csv=require(_0x4e50('0x9'));var ejs=require(_0x4e50('0xa'));var fs=require('fs');var fs_extra=require(_0x4e50('0xb'));var _=require(_0x4e50('0xc'));var squel=require(_0x4e50('0xd'));var crypto=require(_0x4e50('0xe'));var jsforce=require(_0x4e50('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4e50('0x9'));var querystring=require(_0x4e50('0x10'));var Papa=require(_0x4e50('0x11'));var Redis=require(_0x4e50('0x12'));var authService=require(_0x4e50('0x13'));var qs=require(_0x4e50('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e50('0x15'));var logger=require(_0x4e50('0x16'))(_0x4e50('0x17'));var utils=require('../../config/utils');var config=require(_0x4e50('0x18'));var licenseUtil=require(_0x4e50('0x19'));var db=require(_0x4e50('0x1a'))['db'];config[_0x4e50('0x1b')]=_[_0x4e50('0x1c')](config['redis'],{'host':_0x4e50('0x1d'),'port':0x18eb});var socket=require(_0x4e50('0x1e'))(new Redis(config[_0x4e50('0x1b')]));require(_0x4e50('0x1f'))[_0x4e50('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4e50('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x4e50('0x21')][_0x4e50('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x46b787,_0x1b38e9,_0x31105d,_0xb73ed4){return new BPromise(function(_0x26a4de,_0x388c14){var _0x95ec5f=_0xb73ed4||client;return _0x95ec5f['request'](_0x46b787,_0x31105d)[_0x4e50('0x23')](function(_0x1ddc42){logger[_0x4e50('0x24')](_0x4e50('0x25'),_0x1b38e9,_0x4e50('0x26'));logger[_0x4e50('0x27')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1b38e9,_0x4e50('0x26'),JSON[_0x4e50('0x28')](_0x1ddc42));if(_0x1ddc42[_0x4e50('0x29')]){if(_0x1ddc42[_0x4e50('0x29')][_0x4e50('0x2a')]===0x1f4){logger[_0x4e50('0x29')](_0x4e50('0x25'),_0x1b38e9,_0x1ddc42[_0x4e50('0x29')][_0x4e50('0x2b')]);return _0x388c14(_0x1ddc42['error']['message']);}logger['error'](_0x4e50('0x25'),_0x1b38e9,_0x1ddc42[_0x4e50('0x29')][_0x4e50('0x2b')]);return _0x26a4de(_0x1ddc42[_0x4e50('0x29')][_0x4e50('0x2b')]);}else{logger[_0x4e50('0x24')](_0x4e50('0x25'),_0x1b38e9,'request\x20sent');_0x26a4de(_0x1ddc42[_0x4e50('0x2c')]['message']);}})[_0x4e50('0x2d')](function(_0x1fe7be){logger[_0x4e50('0x29')](_0x4e50('0x25'),_0x1b38e9,_0x1fe7be);_0x388c14(_0x1fe7be);});});}function respondWithStatusCode(_0x53877d,_0x384809){_0x384809=_0x384809||0xcc;return function(_0x27f46a){if(_0x27f46a){return _0x53877d[_0x4e50('0x2e')](_0x384809);}return _0x53877d[_0x4e50('0x2f')](_0x384809)['end']();};}function respondWithResult(_0x2f14fe,_0x29201b){_0x29201b=_0x29201b||0xc8;return function(_0x563269){if(_0x563269){return _0x2f14fe[_0x4e50('0x2f')](_0x29201b)[_0x4e50('0x30')](_0x563269);}};}function respondWithFilteredResult(_0x263075,_0x488d0a){return function(_0x43b2c6){if(_0x43b2c6){var _0x56480d=typeof _0x488d0a[_0x4e50('0x31')]===_0x4e50('0x32')&&typeof _0x488d0a[_0x4e50('0x33')]==='undefined';var _0x566ee1=_0x43b2c6['count'];var _0x4f9ad6=_0x56480d?0x0:_0x488d0a[_0x4e50('0x31')];var _0x5cfb9e=_0x56480d?_0x43b2c6[_0x4e50('0x34')]:_0x488d0a[_0x4e50('0x31')]+_0x488d0a[_0x4e50('0x33')];var _0x5eb1d7;if(_0x5cfb9e>=_0x566ee1){_0x5cfb9e=_0x566ee1;_0x5eb1d7=0xc8;}else{_0x5eb1d7=0xce;}_0x263075[_0x4e50('0x2f')](_0x5eb1d7);return _0x263075[_0x4e50('0x35')]('Content-Range',_0x4f9ad6+'-'+_0x5cfb9e+'/'+_0x566ee1)[_0x4e50('0x30')](_0x43b2c6);}return null;};}function patchUpdates(_0x40b6d2){return function(_0x178e5d){try{jsonpatch[_0x4e50('0x36')](_0x178e5d,_0x40b6d2,!![]);}catch(_0x18a589){return BPromise[_0x4e50('0x37')](_0x18a589);}return _0x178e5d[_0x4e50('0x38')]();};}function saveUpdates(_0x49b5ab,_0x57a3dc){return function(_0xce9a04){if(_0xce9a04){return _0xce9a04[_0x4e50('0x39')](_0x49b5ab)['then'](function(_0x57d2ae){return _0x57d2ae;});}return null;};}function removeEntity(_0x189742,_0x210988){return function(_0x36cdc6){if(_0x36cdc6){return _0x36cdc6['destroy']()[_0x4e50('0x23')](function(){_0x189742['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2822,_0xb13153){return function(_0x36bebb){if(!_0x36bebb){_0x5a2822[_0x4e50('0x2e')](0x194);}return _0x36bebb;};}function handleError(_0x58d256,_0x573cdf){_0x573cdf=_0x573cdf||0x1f4;return function(_0x3c1fbb){logger[_0x4e50('0x29')](_0x3c1fbb[_0x4e50('0x3a')]);if(_0x3c1fbb[_0x4e50('0x3b')]){delete _0x3c1fbb['name'];}_0x58d256[_0x4e50('0x2f')](_0x573cdf)[_0x4e50('0x3c')](_0x3c1fbb);};}exports[_0x4e50('0x3d')]=function(_0x35799c,_0x47d20a){var _0x3a4860={},_0x5c73a8={},_0xffa2dd={'count':0x0,'rows':[]};var _0x185dda=_['map'](db[_0x4e50('0x3e')]['rawAttributes'],function(_0x44c3a5){return{'name':_0x44c3a5[_0x4e50('0x3f')],'type':_0x44c3a5[_0x4e50('0x40')][_0x4e50('0x41')]};});_0x5c73a8['model']=_['map'](_0x185dda,_0x4e50('0x3b'));_0x5c73a8['query']=_['keys'](_0x35799c[_0x4e50('0x42')]);_0x5c73a8[_0x4e50('0x43')]=_[_0x4e50('0x44')](_0x5c73a8[_0x4e50('0x45')],_0x5c73a8['query']);_0x3a4860[_0x4e50('0x46')]=_[_0x4e50('0x44')](_0x5c73a8[_0x4e50('0x45')],qs['fields'](_0x35799c[_0x4e50('0x42')][_0x4e50('0x47')]));_0x3a4860[_0x4e50('0x46')]=_0x3a4860[_0x4e50('0x46')][_0x4e50('0x48')]?_0x3a4860[_0x4e50('0x46')]:_0x5c73a8[_0x4e50('0x45')];if(!_0x35799c[_0x4e50('0x42')]['hasOwnProperty'](_0x4e50('0x49'))){_0x3a4860['limit']=qs[_0x4e50('0x33')](_0x35799c[_0x4e50('0x42')][_0x4e50('0x33')]);_0x3a4860[_0x4e50('0x31')]=qs['offset'](_0x35799c['query'][_0x4e50('0x31')]);}_0x3a4860['order']=qs[_0x4e50('0x4a')](_0x35799c['query'][_0x4e50('0x4a')]);_0x3a4860[_0x4e50('0x4b')]=qs[_0x4e50('0x43')](_[_0x4e50('0x4c')](_0x35799c[_0x4e50('0x42')],_0x5c73a8[_0x4e50('0x43')]),_0x185dda);if(_0x35799c[_0x4e50('0x42')][_0x4e50('0x4d')]){_0x3a4860[_0x4e50('0x4b')]=_['merge'](_0x3a4860['where'],{'$or':_['map'](_0x185dda,function(_0x1bc182){if(_0x1bc182[_0x4e50('0x40')]!==_0x4e50('0x4e')){var _0x2cdee9={};_0x2cdee9[_0x1bc182[_0x4e50('0x3b')]]={'$like':'%'+_0x35799c[_0x4e50('0x42')][_0x4e50('0x4d')]+'%'};return _0x2cdee9;}})});}_0x3a4860=_[_0x4e50('0x4f')]({},_0x3a4860,_0x35799c['options']);var _0xca6a84={'where':_0x3a4860[_0x4e50('0x4b')]};return db['WhatsappMessage'][_0x4e50('0x34')](_0xca6a84)['then'](function(_0x4a8caf){_0xffa2dd['count']=_0x4a8caf;if(_0x35799c[_0x4e50('0x42')][_0x4e50('0x50')]){_0x3a4860[_0x4e50('0x51')]=[{'all':!![]}];}return db[_0x4e50('0x3e')]['findAll'](_0x3a4860);})[_0x4e50('0x23')](function(_0x2546a){_0xffa2dd[_0x4e50('0x52')]=_0x2546a;return _0xffa2dd;})[_0x4e50('0x23')](respondWithFilteredResult(_0x47d20a,_0x3a4860))['catch'](handleError(_0x47d20a,null));};exports[_0x4e50('0x53')]=function(_0x49e2e0,_0x22afcf){var _0x46a4db={'raw':!![],'where':{'id':_0x49e2e0['params']['id']}},_0x502679={};_0x502679[_0x4e50('0x45')]=_[_0x4e50('0x54')](db['WhatsappMessage'][_0x4e50('0x55')]);_0x502679[_0x4e50('0x42')]=_['keys'](_0x49e2e0['query']);_0x502679[_0x4e50('0x43')]=_[_0x4e50('0x44')](_0x502679[_0x4e50('0x45')],_0x502679[_0x4e50('0x42')]);_0x46a4db[_0x4e50('0x46')]=_[_0x4e50('0x44')](_0x502679[_0x4e50('0x45')],qs[_0x4e50('0x47')](_0x49e2e0[_0x4e50('0x42')][_0x4e50('0x47')]));_0x46a4db[_0x4e50('0x46')]=_0x46a4db[_0x4e50('0x46')][_0x4e50('0x48')]?_0x46a4db[_0x4e50('0x46')]:_0x502679[_0x4e50('0x45')];if(_0x49e2e0['query'][_0x4e50('0x50')]){_0x46a4db[_0x4e50('0x51')]=[{'all':!![]}];}_0x46a4db=_[_0x4e50('0x4f')]({},_0x46a4db,_0x49e2e0[_0x4e50('0x56')]);return db['WhatsappMessage']['find'](_0x46a4db)[_0x4e50('0x23')](handleEntityNotFound(_0x22afcf,null))[_0x4e50('0x23')](respondWithResult(_0x22afcf,null))[_0x4e50('0x2d')](handleError(_0x22afcf,null));};exports['create']=function(_0x4300eb,_0x28d0b3){return db[_0x4e50('0x3e')]['create'](_0x4300eb[_0x4e50('0x57')],{})[_0x4e50('0x23')](respondWithResult(_0x28d0b3,0xc9))[_0x4e50('0x2d')](handleError(_0x28d0b3,null));};exports[_0x4e50('0x39')]=function(_0x58242e,_0xf31b92){if(_0x58242e[_0x4e50('0x57')]['id']){delete _0x58242e[_0x4e50('0x57')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x58242e[_0x4e50('0x58')]['id']}})[_0x4e50('0x23')](handleEntityNotFound(_0xf31b92,null))[_0x4e50('0x23')](saveUpdates(_0x58242e['body'],null))[_0x4e50('0x23')](respondWithResult(_0xf31b92,null))[_0x4e50('0x2d')](handleError(_0xf31b92,null));};exports['destroy']=function(_0x35a83a,_0x81c689){return db[_0x4e50('0x3e')][_0x4e50('0x59')]({'where':{'id':_0x35a83a[_0x4e50('0x58')]['id']}})[_0x4e50('0x23')](handleEntityNotFound(_0x81c689,null))[_0x4e50('0x23')](removeEntity(_0x81c689,null))[_0x4e50('0x2d')](handleError(_0x81c689,null));};exports[_0x4e50('0x5a')]=function(_0x2227c2,_0x520c0f){return db[_0x4e50('0x3e')]['describe']()[_0x4e50('0x23')](respondWithResult(_0x520c0f,null))['catch'](handleError(_0x520c0f,null));};var interaction_log=require(_0x4e50('0x16'))(_0x4e50('0x5b'));exports[_0x4e50('0x5c')]=function(_0x325c4b,_0x46bcd4,_0x3ebe17){var _0x1e39d8={'agent':{},'channel':_0x4e50('0x5d')};if(_0x325c4b['body']['id']){delete _0x325c4b[_0x4e50('0x57')]['id'];}_0x325c4b['body'][_0x4e50('0x5e')]=!![];_0x325c4b[_0x4e50('0x57')]['readAt']=moment()[_0x4e50('0x5f')](_0x4e50('0x60'));_0x325c4b[_0x4e50('0x57')][_0x4e50('0x61')]=_0x325c4b['body']['UserId']||_0x325c4b[_0x4e50('0x62')]['id'];_0x1e39d8[_0x4e50('0x63')]['id']=_0x325c4b[_0x4e50('0x57')]['UserId'];return db['WhatsappMessage'][_0x4e50('0x59')]({'where':{'id':_0x325c4b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x46bcd4,null))[_0x4e50('0x23')](saveUpdates(_0x325c4b[_0x4e50('0x57')],null))[_0x4e50('0x23')](function(_0x22dc76){if(_0x22dc76){_0x1e39d8[_0x4e50('0x2b')]=_0x22dc76[_0x4e50('0x64')]({'plain':!![]});return db[_0x4e50('0x65')][_0x4e50('0x59')]({'where':{'id':_0x22dc76[_0x4e50('0x66')]}});}return null;})[_0x4e50('0x23')](handleEntityNotFound(_0x46bcd4,null))[_0x4e50('0x23')](function(_0x10833d){if(_0x10833d){return _0x10833d[_0x4e50('0x39')]({'UserId':_0x325c4b[_0x4e50('0x57')][_0x4e50('0x61')],'read1stAt':_[_0x4e50('0x67')](_0x10833d[_0x4e50('0x68')])?moment()[_0x4e50('0x5f')](_0x4e50('0x60')):undefined});}return null;})[_0x4e50('0x23')](function(_0x3005b3){if(_0x3005b3){_0x1e39d8['interaction']=_0x3005b3[_0x4e50('0x64')]({'plain':!![]});interaction_log[_0x4e50('0x24')](_0x4e50('0x69'),_0x325c4b[_0x4e50('0x62')]['id'],_0x325c4b[_0x4e50('0x62')][_0x4e50('0x3b')],_0x325c4b[_0x4e50('0x62')][_0x4e50('0x6a')],_0x1e39d8[_0x4e50('0x6b')]['id'],_0x325c4b[_0x4e50('0x57')]?JSON[_0x4e50('0x28')](_0x325c4b[_0x4e50('0x57')]):_0x4e50('0x6c'));return respondWithRpcPromise(_0x4e50('0x6d'),_0x4e50('0x6e'),_0x1e39d8);}return null;})['then'](function(_0x444ff4){var _0x4c6997=_0x4e50('0x6f')+_0x444ff4['message'][_0x4e50('0x70')];return db[_0x4e50('0x71')][_0x4e50('0x42')](_0x4c6997,{'type':db[_0x4e50('0x72')][_0x4e50('0x73')][_0x4e50('0x74')],'raw':!![]})[_0x4e50('0x23')](function(_0x5ec5dd){return _0x5ec5dd;});})[_0x4e50('0x23')](function(_0x531433){if(_0x531433){_0x1e39d8['message'][_0x4e50('0x75')]=_0x531433[0x0];if(!_0x325c4b[_0x4e50('0x57')]['UserId'])return;return db[_0x4e50('0x76')]['find']({'where':{'id':_0x325c4b['body'][_0x4e50('0x61')],'role':_0x4e50('0x63')},'attributes':['id',_0x4e50('0x3b'),_0x4e50('0x77'),_0x4e50('0x78'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3e65c2){if(!_0x3e65c2)return null;_0x1e39d8['message']['agent']=_0x3e65c2;return _0x1e39d8;})['then'](function(_0x815522){if(_0x815522){if(_0x325c4b[_0x4e50('0x57')][_0x4e50('0x79')]){_0x1e39d8[_0x4e50('0x2b')]['interface']=util[_0x4e50('0x5f')](_0x4e50('0x7a'),_0x325c4b['user'][_0x4e50('0x3b')]);_0x1e39d8[_0x4e50('0x2b')][_0x4e50('0x7b')]=_0x1e39d8[_0x4e50('0x7b')];_0x1e39d8[_0x4e50('0x2b')][_0x4e50('0x7c')]=_0x1e39d8[_0x4e50('0x7b')];_0x1e39d8['message']['event']='accept';return respondWithRpcPromise(_0x4e50('0x7d'),_0x4e50('0x7d'),{'event':'acceptmessage','message':_0x1e39d8[_0x4e50('0x2b')]},client9002)[_0x4e50('0x23')](function(){return _0x1e39d8;});}return _0x1e39d8;}return null;})[_0x4e50('0x23')](respondWithResult(_0x46bcd4,null))[_0x4e50('0x2d')](handleError(_0x46bcd4,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports['reject']=function(_0x3d54ed,_0x37e561,_0x20f5ac){var _0x1e48cc={'agent':{},'channel':'whatsapp'};if(_0x3d54ed[_0x4e50('0x57')]['id']){delete _0x3d54ed['body']['id'];}_0x3d54ed['body']['UserId']=_0x3d54ed[_0x4e50('0x57')][_0x4e50('0x61')]||_0x3d54ed[_0x4e50('0x62')]['id'];_0x1e48cc[_0x4e50('0x63')]['id']=_0x3d54ed[_0x4e50('0x57')]['UserId'];return db[_0x4e50('0x3e')][_0x4e50('0x59')]({'where':{'id':_0x3d54ed[_0x4e50('0x58')]['id'],'UserId':null}})[_0x4e50('0x23')](handleEntityNotFound(_0x37e561,null))[_0x4e50('0x23')](function(_0x431571){if(_0x431571){_0x1e48cc[_0x4e50('0x2b')]=_0x431571[_0x4e50('0x64')]({'plain':!![]});return db[_0x4e50('0x65')][_0x4e50('0x59')]({'where':{'id':_0x431571[_0x4e50('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x37e561,null))[_0x4e50('0x23')](function(_0xeb87df){if(_0xeb87df){_0x1e48cc[_0x4e50('0x6b')]=_0xeb87df['get']({'plain':!![]});interaction_log[_0x4e50('0x24')](_0x4e50('0x7e'),_0x3d54ed[_0x4e50('0x62')]['id'],_0x3d54ed[_0x4e50('0x62')][_0x4e50('0x3b')],_0x3d54ed[_0x4e50('0x62')][_0x4e50('0x6a')],_0x1e48cc[_0x4e50('0x6b')]['id'],_0x3d54ed[_0x4e50('0x57')]?JSON[_0x4e50('0x28')](_0x3d54ed['body']):_0x4e50('0x6c'));return respondWithRpcPromise(_0x4e50('0x7f'),_0x4e50('0x80'),_0x1e48cc);}return null;})[_0x4e50('0x23')](function(_0x3ca67b){var _0x29dfc1=_0x4e50('0x6f')+_0x3ca67b[_0x4e50('0x2b')][_0x4e50('0x70')];return db[_0x4e50('0x71')][_0x4e50('0x42')](_0x29dfc1,{'type':db[_0x4e50('0x72')]['QueryTypes'][_0x4e50('0x74')],'raw':!![]})[_0x4e50('0x23')](function(_0x50f2c8){return _0x50f2c8;});})[_0x4e50('0x23')](function(_0x1b6247){if(_0x1b6247){_0x1e48cc[_0x4e50('0x2b')][_0x4e50('0x75')]=_0x1b6247[0x0];if(!_0x3d54ed[_0x4e50('0x57')][_0x4e50('0x61')])return;return db[_0x4e50('0x76')][_0x4e50('0x59')]({'where':{'id':_0x3d54ed[_0x4e50('0x57')]['UserId'],'role':'agent'},'attributes':['id','name',_0x4e50('0x77'),'email',_0x4e50('0x81')],'raw':!![]});}return null;})[_0x4e50('0x23')](function(_0x455ce5){if(!_0x455ce5)return null;_0x1e48cc[_0x4e50('0x2b')][_0x4e50('0x63')]=_0x455ce5;return _0x1e48cc;})[_0x4e50('0x23')](function(_0x4671ba){if(_0x4671ba){_0x4671ba[_0x4e50('0x2b')][_0x4e50('0x82')]=util[_0x4e50('0x5f')](_0x4e50('0x7a'),_0x3d54ed[_0x4e50('0x62')][_0x4e50('0x3b')]);_0x4671ba['message']['channel']=_0x1e48cc[_0x4e50('0x7b')];_0x4671ba[_0x4e50('0x2b')][_0x4e50('0x7c')]=_0x1e48cc[_0x4e50('0x7b')];_0x4671ba['message'][_0x4e50('0x83')]='reject';respondWithRpcPromise(_0x4e50('0x7d'),_0x4e50('0x7d'),{'event':_0x4e50('0x84'),'message':_0x4671ba[_0x4e50('0x2b')]},client9002);return _0x1e48cc;}return null;})[_0x4e50('0x23')](respondWithResult(_0x37e561,null))['catch'](handleError(_0x37e561,null));};exports[_0x4e50('0x2f')]=function(_0x2a3ee5,_0x16152f,_0x4d299c){if(_0x2a3ee5[_0x4e50('0x57')]['id']){delete _0x2a3ee5[_0x4e50('0x57')]['id'];}var _0xbdb91d;return db[_0x4e50('0x3e')][_0x4e50('0x59')]({'where':{'id':_0x2a3ee5[_0x4e50('0x58')]['id']}})[_0x4e50('0x23')](handleEntityNotFound(_0x16152f,null))[_0x4e50('0x23')](function(_0x2f2d1d){if(_0x2f2d1d){_0xbdb91d=_0x2f2d1d;return db[_0x4e50('0x85')][_0x4e50('0x59')]({'where':{'id':_0x2f2d1d['WhatsappAccountId']}});}})[_0x4e50('0x23')](handleEntityNotFound(_0x16152f,null))[_0x4e50('0x23')](function(_0xa30698){if(_0xa30698){logger[_0x4e50('0x27')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x4e50('0x2f'),_0x4e50('0x86'),_0xa30698['type'],util[_0x4e50('0x87')](_0x2a3ee5['body'],{'showHidden':![],'depth':null}));switch(_0xa30698[_0x4e50('0x40')]){case _0x4e50('0x88'):if(_0x2a3ee5[_0x4e50('0x57')][_0x4e50('0x89')]&&_0x2a3ee5[_0x4e50('0x57')]['MessageSid']===_0xbdb91d[_0x4e50('0x8a')]&&_0x2a3ee5['body'][_0x4e50('0x8b')]&&_0x2a3ee5['body']['MessageStatus']==='read'){return _0xbdb91d['update']({'read':!![]});}else{logger[_0x4e50('0x29')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4e50('0x2f'),_0x4e50('0x88'),util['inspect'](_0x2a3ee5['body'],{'showHidden':![],'depth':null}));}break;}return _0xbdb91d;}})[_0x4e50('0x23')](respondWithResult(_0x16152f,null))[_0x4e50('0x2d')](handleError(_0x16152f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 7156e9d..7f590fe 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 _0x16d2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x37ea15,_0x5a0470){var _0x453798=function(_0x47b5f9){while(--_0x47b5f9){_0x37ea15['push'](_0x37ea15['shift']());}};_0x453798(++_0x5a0470);}(_0x16d2,0x123));var _0x216d=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x16d2[_0x47e7cb];return _0x2a8874;};'use strict';var EventEmitter=require(_0x216d('0x0'));var WhatsappMessage=require(_0x216d('0x1'))['db'][_0x216d('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x216d('0x3')](0x0);var events={'afterCreate':_0x216d('0x4'),'afterUpdate':_0x216d('0x5'),'afterDestroy':_0x216d('0x6')};function emitEvent(_0x239b49){return function(_0xfd7306,_0x593bb0,_0x2c662d){WhatsappMessageEvents[_0x216d('0x7')](_0x239b49+':'+_0xfd7306['id'],_0xfd7306);WhatsappMessageEvents[_0x216d('0x7')](_0x239b49,_0xfd7306);_0x2c662d(null);};}for(var e in events){if(events[_0x216d('0x8')](e)){var event=events[e];WhatsappMessage[_0x216d('0x9')](e,emitEvent(event));}}module[_0x216d('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0xb58b=['exports','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x73b352,_0xc65afb){var _0x2bc41e=function(_0x16b58b){while(--_0x16b58b){_0x73b352['push'](_0x73b352['shift']());}};_0x2bc41e(++_0xc65afb);}(_0xb58b,0x1f1));var _0xbb58=function(_0x5405cc,_0x4fa564){_0x5405cc=_0x5405cc-0x0;var _0x367541=_0xb58b[_0x5405cc];return _0x367541;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xbb58('0x0'))['db'][_0xbb58('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbb58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb58('0x3'),'afterDestroy':_0xbb58('0x4')};function emitEvent(_0x5c9ec5){return function(_0x226363,_0x546510,_0x2edb10){WhatsappMessageEvents[_0xbb58('0x5')](_0x5c9ec5+':'+_0x226363['id'],_0x226363);WhatsappMessageEvents[_0xbb58('0x5')](_0x5c9ec5,_0x226363);_0x2edb10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xbb58('0x6')](e,emitEvent(event));}}module[_0xbb58('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index b4996e3..253c4a3 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 _0x182e=['lodash','util','../../config/logger','api','moment','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','text','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0x182e,0x1d0));var _0xe182=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x182e[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0xe182('0x0'));var util=require(_0xe182('0x1'));var logger=require(_0xe182('0x2'))(_0xe182('0x3'));var moment=require(_0xe182('0x4'));var BPromise=require('bluebird');var rp=require(_0xe182('0x5'));var fetch=require(_0xe182('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe182('0x7'));var config=require(_0xe182('0x8'));var attributes=require(_0xe182('0x9'));module[_0xe182('0xa')]=function(_0x1cebfb,_0x536fc5){return _0x1cebfb[_0xe182('0xb')]('WhatsappMessage',attributes,{'tableName':_0xe182('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0xe182('0xd')],'type':_0xe182('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbac502,_0x1d5672,_0x3014d2){var _0x463319=_0x1cebfb[_0xe182('0xf')];var _0x383419=_0xbac502[_0xe182('0x10')]({'plain':!![]});if(_0x383419[_0xe182('0x11')][_0xe182('0x12')]()==='in'||_0x383419['direction'][_0xe182('0x12')]()===_0xe182('0x13')&&!_0x383419['secret']&&!_[_0xe182('0x14')](_0x383419['UserId'])){_0x463319[_0xe182('0x15')][_0xe182('0x16')]({'where':{'id':_0x383419[_0xe182('0x17')]}})[_0xe182('0x18')](function(_0x10e3e0){if(_0x10e3e0){_0x10e3e0[_0xe182('0x19')]({'lastMsgAt':_0x383419['createdAt'],'lastMsgDirection':_0x383419[_0xe182('0x11')][_0xe182('0x12')]()});}})[_0xe182('0x1a')](function(_0x29f023){console['error'](_0x29f023);});}if(_0x383419[_0xe182('0x11')]===_0xe182('0x13')&&!_0x383419[_0xe182('0x1b')]){var _0x204160;_0x463319[_0xe182('0x1c')][_0xe182('0x1d')]({'where':{'id':_0x383419[_0xe182('0x1e')]},'raw':!![]})[_0xe182('0x18')](function(_0x4edaf3){_0x204160=_0x4edaf3;if(_0x204160&&_0x204160[_0xe182('0x1f')]){switch(_0x204160[_0xe182('0x1f')]){case _0xe182('0x20'):var _0x24a337=require(_0xe182('0x20'));if(_0x204160[_0xe182('0x21')]&&_0x204160[_0xe182('0x22')]&&_0x204160[_0xe182('0x23')]){var _0x4cb8b1=new _0x24a337(_0x204160[_0xe182('0x21')],_0x204160[_0xe182('0x22')]);_0x4cb8b1['messages'][_0xe182('0x24')]({'body':_0x383419[_0xe182('0xd')],'to':'whatsapp:'+_0x383419['phone'],'from':_0xe182('0x25')+_0x204160[_0xe182('0x23')],'statusCallback':_0x204160[_0xe182('0x26')]+_0xe182('0x27')+_0x383419['id']+_0xe182('0x28')+_0x204160[_0xe182('0x29')]})[_0xe182('0x18')](function(_0x227606){if(_0x227606[_0xe182('0x2a')]){return _0xbac502[_0xe182('0x19')]({'messageId':_0x227606['sid']});}})[_0xe182('0x1a')](function(_0x522627){logger['error'](_0xe182('0x2b'),'afterCreate','twilio',util[_0xe182('0x2c')](_0x522627,{'showHidden':![],'depth':null}));});}else{logger[_0xe182('0x2d')](_0xe182('0x2b'),'afterCreate',_0xe182('0x20'),_0xe182('0x2e'));}break;case _0xe182('0x2f'):var _0x2e9e1c=_0x204160[_0xe182('0x21')];var _0x5087b8=_0x204160[_0xe182('0x22')];var _0x497e83=_0x204160['baseUrl']+_0xe182('0x30')+_0x2e9e1c+'/messages/';var _0x1dcbbc={'to':[_0x383419[_0xe182('0x23')]],'message':{'type':_0xe182('0x31'),'text':_0x383419[_0xe182('0xd')]}};var _0x5aeacc={'method':'POST','uri':_0x497e83,'headers':{'Authorization':_0xe182('0x32')+_0x5087b8,'Content-Type':_0xe182('0x33')},'body':_0x1dcbbc,'json':!![]};rp(_0x5aeacc)[_0xe182('0x18')](function(_0x2bd633){if(_0x2bd633[_0xe182('0x34')][0x0][_0xe182('0x35')]){return _0xbac502[_0xe182('0x19')]({'messageId':_0x2bd633['statuses'][0x0][_0xe182('0x35')]});}})[_0xe182('0x1a')](function(_0x1d214f){logger[_0xe182('0x36')](_0xe182('0x37'),_0x1d214f);});break;}}})[_0xe182('0x38')](function(){_0x3014d2();});}else{_0x3014d2();}}},'charset':_0xe182('0x39'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbfcf=['then','update','error','WhatsappAccount','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','application/json','statuses','message_id','utf8mb4_unicode_ci','lodash','moment','request-promise','node-fetch','path','rimraf','../../config/environment','exports','WhatsappMessage','whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xbfcf,0x183));var _0xfbfc=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0xbfcf[_0x590a38];return _0xf36626;};'use strict';var _=require(_0xfbfc('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfbfc('0x1'));var BPromise=require('bluebird');var rp=require(_0xfbfc('0x2'));var fetch=require(_0xfbfc('0x3'));var fs=require('fs');var path=require(_0xfbfc('0x4'));var rimraf=require(_0xfbfc('0x5'));var config=require(_0xfbfc('0x6'));var attributes=require('./whatsappMessage.attributes');module[_0xfbfc('0x7')]=function(_0x1b63e8,_0x5e596e){return _0x1b63e8['define'](_0xfbfc('0x8'),attributes,{'tableName':_0xfbfc('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0xfbfc('0xa')],'type':_0xfbfc('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x26b069,_0x21394f,_0x418741){var _0x10ebcd=_0x1b63e8['models'];var _0x40f4fc=_0x26b069[_0xfbfc('0xc')]({'plain':!![]});if(_0x40f4fc[_0xfbfc('0xd')]['toLowerCase']()==='in'||_0x40f4fc[_0xfbfc('0xd')][_0xfbfc('0xe')]()==='out'&&!_0x40f4fc[_0xfbfc('0xf')]&&!_[_0xfbfc('0x10')](_0x40f4fc[_0xfbfc('0x11')])){_0x10ebcd[_0xfbfc('0x12')][_0xfbfc('0x13')]({'where':{'id':_0x40f4fc[_0xfbfc('0x14')]}})[_0xfbfc('0x15')](function(_0x496fa5){if(_0x496fa5){_0x496fa5[_0xfbfc('0x16')]({'lastMsgAt':_0x40f4fc['createdAt'],'lastMsgDirection':_0x40f4fc[_0xfbfc('0xd')][_0xfbfc('0xe')]()});}})['catch'](function(_0x499412){console[_0xfbfc('0x17')](_0x499412);});}if(_0x40f4fc[_0xfbfc('0xd')]==='out'&&!_0x40f4fc[_0xfbfc('0xf')]){var _0x34aae5;_0x10ebcd[_0xfbfc('0x18')]['find']({'where':{'id':_0x40f4fc['WhatsappAccountId']},'raw':!![]})['then'](function(_0x1c98f7){_0x34aae5=_0x1c98f7;if(_0x34aae5&&_0x34aae5[_0xfbfc('0x19')]){switch(_0x34aae5['type']){case _0xfbfc('0x1a'):var _0x104ae7=require(_0xfbfc('0x1a'));if(_0x34aae5[_0xfbfc('0x1b')]&&_0x34aae5[_0xfbfc('0x1c')]&&_0x34aae5[_0xfbfc('0x1d')]){var _0x3827ad=new _0x104ae7(_0x34aae5[_0xfbfc('0x1b')],_0x34aae5[_0xfbfc('0x1c')]);_0x3827ad[_0xfbfc('0x1e')][_0xfbfc('0x1f')]({'body':_0x40f4fc[_0xfbfc('0xa')],'to':_0xfbfc('0x20')+_0x40f4fc[_0xfbfc('0x1d')],'from':_0xfbfc('0x20')+_0x34aae5['phone'],'statusCallback':_0x34aae5[_0xfbfc('0x21')]+_0xfbfc('0x22')+_0x40f4fc['id']+_0xfbfc('0x23')+_0x34aae5[_0xfbfc('0x24')]})[_0xfbfc('0x15')](function(_0x2ee183){if(_0x2ee183[_0xfbfc('0x25')]){return _0x26b069[_0xfbfc('0x16')]({'messageId':_0x2ee183[_0xfbfc('0x25')]});}})[_0xfbfc('0x26')](function(_0x222286){logger[_0xfbfc('0x17')](_0xfbfc('0x27'),_0xfbfc('0x28'),_0xfbfc('0x1a'),util[_0xfbfc('0x29')](_0x222286,{'showHidden':![],'depth':null}));});}else{logger[_0xfbfc('0x17')](_0xfbfc('0x27'),_0xfbfc('0x28'),_0xfbfc('0x1a'),_0xfbfc('0x2a'));}break;case _0xfbfc('0x2b'):var _0x389419=_0x34aae5[_0xfbfc('0x1b')];var _0x47a568=_0x34aae5[_0xfbfc('0x1c')];var _0x28bba9=_0x34aae5[_0xfbfc('0x2c')]+_0xfbfc('0x2d')+_0x389419+_0xfbfc('0x2e');var _0x359668={'to':[_0x40f4fc[_0xfbfc('0x1d')]],'message':{'type':'text','text':_0x40f4fc[_0xfbfc('0xa')]}};var _0x56ec80={'method':'POST','uri':_0x28bba9,'headers':{'Authorization':'Bearer\x20'+_0x47a568,'Content-Type':_0xfbfc('0x2f')},'body':_0x359668,'json':!![]};rp(_0x56ec80)[_0xfbfc('0x15')](function(_0x44e5fb){if(_0x44e5fb[_0xfbfc('0x30')][0x0][_0xfbfc('0x31')]){return _0x26b069[_0xfbfc('0x16')]({'messageId':_0x44e5fb[_0xfbfc('0x30')][0x0][_0xfbfc('0x31')]});}})[_0xfbfc('0x26')](function(_0x42d03d){logger['err']('WhatsappMessage,\x20%s',_0x42d03d);});break;}}})['finally'](function(){_0x418741();});}else{_0x418741();}}},'charset':'utf8mb4','collate':_0xfbfc('0x32')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 72d0e8b..d11468e 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 _0x9ba4=['catch','WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x12f9e3,_0x3fadc1){var _0x2de0c8=function(_0x31b5c5){while(--_0x31b5c5){_0x12f9e3['push'](_0x12f9e3['shift']());}};_0x2de0c8(++_0x3fadc1);}(_0x9ba4,0x130));var _0x49ba=function(_0x5e6260,_0x5cdea0){_0x5e6260=_0x5e6260-0x0;var _0x436ae2=_0x9ba4[_0x5e6260];return _0x436ae2;};'use strict';var _=require(_0x49ba('0x0'));var util=require('util');var moment=require(_0x49ba('0x1'));var BPromise=require(_0x49ba('0x2'));var rs=require(_0x49ba('0x3'));var fs=require('fs');var Redis=require(_0x49ba('0x4'));var db=require(_0x49ba('0x5'))['db'];var utils=require(_0x49ba('0x6'));var logger=require(_0x49ba('0x7'))(_0x49ba('0x8'));var config=require(_0x49ba('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x49ba('0xa')][_0x49ba('0xb')]({'port':0x232a});config[_0x49ba('0xc')]=_[_0x49ba('0xd')](config[_0x49ba('0xc')],{'host':_0x49ba('0xe'),'port':0x18eb});var socket=require(_0x49ba('0xf'))(new Redis(config[_0x49ba('0xc')]));require(_0x49ba('0x10'))[_0x49ba('0x11')](socket);function respondWithRpcPromise(_0x2a50cc,_0x4b3918,_0x2b89b9){return new BPromise(function(_0x364c90,_0x3df454){return client[_0x49ba('0x12')](_0x2a50cc,_0x2b89b9)[_0x49ba('0x13')](function(_0x31a182){logger[_0x49ba('0x14')](_0x49ba('0x15'),_0x4b3918,_0x49ba('0x16'));logger['debug'](_0x49ba('0x17'),_0x4b3918,_0x49ba('0x16'),JSON[_0x49ba('0x18')](_0x31a182));if(_0x31a182['error']){if(_0x31a182[_0x49ba('0x19')][_0x49ba('0x1a')]===0x1f4){logger['error'](_0x49ba('0x15'),_0x4b3918,_0x31a182['error'][_0x49ba('0x1b')]);return _0x3df454(_0x31a182['error'][_0x49ba('0x1b')]);}logger['error'](_0x49ba('0x15'),_0x4b3918,_0x31a182[_0x49ba('0x19')][_0x49ba('0x1b')]);return _0x364c90(_0x31a182['error'][_0x49ba('0x1b')]);}else{logger[_0x49ba('0x14')](_0x49ba('0x15'),_0x4b3918,_0x49ba('0x16'));_0x364c90(_0x31a182[_0x49ba('0x1c')][_0x49ba('0x1b')]);}})[_0x49ba('0x1d')](function(_0x4c286d){logger[_0x49ba('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x4b3918,_0x4c286d);_0x3df454(_0x4c286d);});});}exports['CreateWhatsappMessage']=function(_0x5974f8){var _0x58f0f9=this;return new Promise(function(_0x2fe38f,_0x19749d){return db[_0x49ba('0x1e')][_0x49ba('0x1f')](_0x5974f8[_0x49ba('0x20')],{'raw':_0x5974f8['options']?_0x5974f8[_0x49ba('0x21')][_0x49ba('0x22')]===undefined?!![]:![]:!![]})[_0x49ba('0x13')](function(_0x171637){logger[_0x49ba('0x14')](_0x49ba('0x23'),_0x5974f8);logger[_0x49ba('0x24')](_0x49ba('0x23'),_0x5974f8,JSON[_0x49ba('0x18')](_0x171637));_0x2fe38f(_0x171637);})[_0x49ba('0x1d')](function(_0x34390b){logger[_0x49ba('0x19')](_0x49ba('0x23'),_0x34390b['message'],_0x5974f8);_0x19749d(_0x58f0f9[_0x49ba('0x19')](0x1f4,_0x34390b[_0x49ba('0x1b')]));});});}; \ No newline at end of file +var _0x3948=['result','create','body','options','raw','CreateWhatsappMessage','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','request\x20sent','debug','stringify','error','code','message','info','WhatsappMessage,\x20%s,\x20%s'];(function(_0x148aa9,_0x421ae3){var _0x530a22=function(_0x458499){while(--_0x458499){_0x148aa9['push'](_0x148aa9['shift']());}};_0x530a22(++_0x421ae3);}(_0x3948,0x18d));var _0x8394=function(_0x9e1df5,_0x28b7dd){_0x9e1df5=_0x9e1df5-0x0;var _0x6b59ed=_0x3948[_0x9e1df5];return _0x6b59ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8394('0x0'));var fs=require('fs');var Redis=require(_0x8394('0x1'));var db=require(_0x8394('0x2'))['db'];var utils=require(_0x8394('0x3'));var logger=require(_0x8394('0x4'))(_0x8394('0x5'));var config=require('../../config/environment');var jayson=require(_0x8394('0x6'));var client=jayson['client'][_0x8394('0x7')]({'port':0x232a});config['redis']=_[_0x8394('0x8')](config[_0x8394('0x9')],{'host':_0x8394('0xa'),'port':0x18eb});var socket=require(_0x8394('0xb'))(new Redis(config[_0x8394('0x9')]));require(_0x8394('0xc'))[_0x8394('0xd')](socket);function respondWithRpcPromise(_0x370ffb,_0x3ff11a,_0x4dcd82){return new BPromise(function(_0x29207b,_0xfbdb5f){return client['request'](_0x370ffb,_0x4dcd82)[_0x8394('0xe')](function(_0x12c78d){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3ff11a,_0x8394('0xf'));logger[_0x8394('0x10')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3ff11a,'request\x20sent',JSON[_0x8394('0x11')](_0x12c78d));if(_0x12c78d[_0x8394('0x12')]){if(_0x12c78d[_0x8394('0x12')][_0x8394('0x13')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3ff11a,_0x12c78d[_0x8394('0x12')][_0x8394('0x14')]);return _0xfbdb5f(_0x12c78d['error']['message']);}logger[_0x8394('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x3ff11a,_0x12c78d[_0x8394('0x12')][_0x8394('0x14')]);return _0x29207b(_0x12c78d[_0x8394('0x12')][_0x8394('0x14')]);}else{logger[_0x8394('0x15')](_0x8394('0x16'),_0x3ff11a,_0x8394('0xf'));_0x29207b(_0x12c78d[_0x8394('0x17')][_0x8394('0x14')]);}})['catch'](function(_0x2c88e2){logger[_0x8394('0x12')](_0x8394('0x16'),_0x3ff11a,_0x2c88e2);_0xfbdb5f(_0x2c88e2);});});}exports['CreateWhatsappMessage']=function(_0x2dccdf){var _0x2e1425=this;return new Promise(function(_0x275a83,_0x430628){return db['WhatsappMessage'][_0x8394('0x18')](_0x2dccdf[_0x8394('0x19')],{'raw':_0x2dccdf[_0x8394('0x1a')]?_0x2dccdf['options'][_0x8394('0x1b')]===undefined?!![]:![]:!![]})[_0x8394('0xe')](function(_0x536d74){logger['info'](_0x8394('0x1c'),_0x2dccdf);logger['debug'](_0x8394('0x1c'),_0x2dccdf,JSON[_0x8394('0x11')](_0x536d74));_0x275a83(_0x536d74);})[_0x8394('0x1d')](function(_0x5e9985){logger['error'](_0x8394('0x1c'),_0x5e9985['message'],_0x2dccdf);_0x430628(_0x2e1425[_0x8394('0x12')](0x1f4,_0x5e9985[_0x8394('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index aea9bf6..d5c7e8f 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 _0x642c=['emit','removeListener','whatsappMessage:','save'];(function(_0x43fb7a,_0x3807f1){var _0x1be693=function(_0x4e12f8){while(--_0x4e12f8){_0x43fb7a['push'](_0x43fb7a['shift']());}};_0x1be693(++_0x3807f1);}(_0x642c,0xa3));var _0xc642=function(_0x1bfea2,_0x57755c){_0x1bfea2=_0x1bfea2-0x0;var _0x163d77=_0x642c[_0x1bfea2];return _0x163d77;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xc642('0x0'),'remove','update'];function createListener(_0x5b1d05,_0x4d65d9){return function(_0x55114e){_0x4d65d9[_0xc642('0x1')](_0x5b1d05,_0x55114e);};}function removeListener(_0x26849f,_0x57b472){return function(){WhatsappMessageEvents[_0xc642('0x2')](_0x26849f,_0x57b472);};}exports['register']=function(_0x4d1562){for(var _0xdb5adc=0x0,_0x47fcf3=events['length'];_0xdb5adc<_0x47fcf3;_0xdb5adc++){var _0x535202=events[_0xdb5adc];var _0x2fe331=createListener(_0xc642('0x3')+_0x535202,_0x4d1562);WhatsappMessageEvents['on'](_0x535202,_0x2fe331);}}; \ No newline at end of file +var _0x702e=['register','length','whatsappMessage:','remove','update','emit','removeListener'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x702e,0x199));var _0xe702=function(_0x553286,_0x43adf4){_0x553286=_0x553286-0x0;var _0x55465d=_0x702e[_0x553286];return _0x55465d;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0xe702('0x0'),_0xe702('0x1')];function createListener(_0x21df7d,_0x143644){return function(_0xa9cfea){_0x143644[_0xe702('0x2')](_0x21df7d,_0xa9cfea);};}function removeListener(_0x9c723,_0xa8d79d){return function(){WhatsappMessageEvents[_0xe702('0x3')](_0x9c723,_0xa8d79d);};}exports[_0xe702('0x4')]=function(_0x153303){for(var _0x38dbc5=0x0,_0x30427c=events[_0xe702('0x5')];_0x38dbc5<_0x30427c;_0x38dbc5++){var _0x1f9981=events[_0x38dbc5];var _0x5bab9e=createListener(_0xe702('0x6')+_0x1f9981,_0x153303);WhatsappMessageEvents['on'](_0x1f9981,_0x5bab9e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 3c6132e..ef8d0f3 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 _0x6d4b=['destroy','removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','/:id','show','/:id/members','getMembers','getTeams','/:id/users','create','post','addTeams','addAgents','put','delete'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x6d4b,0xc3));var _0xb6d4=function(_0x1ab020,_0x154ce0){_0x1ab020=_0x1ab020-0x0;var _0x145fd6=_0x6d4b[_0x1ab020];return _0x145fd6;};'use strict';var multer=require('multer');var util=require(_0xb6d4('0x0'));var path=require('path');var timeout=require(_0xb6d4('0x1'));var express=require('express');var router=express[_0xb6d4('0x2')]();var fs_extra=require(_0xb6d4('0x3'));var auth=require(_0xb6d4('0x4'));var interaction=require(_0xb6d4('0x5'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0xb6d4('0x6')]('/',auth['isAuthenticated'](),controller[_0xb6d4('0x7')]);router[_0xb6d4('0x6')]('/describe',auth[_0xb6d4('0x8')](),controller['describe']);router[_0xb6d4('0x6')](_0xb6d4('0x9'),auth['isAuthenticated'](),controller[_0xb6d4('0xa')]);router['get'](_0xb6d4('0xb'),auth[_0xb6d4('0x8')](),controller[_0xb6d4('0xc')]);router[_0xb6d4('0x6')]('/:id/teams',auth[_0xb6d4('0x8')](),controller[_0xb6d4('0xd')]);router[_0xb6d4('0x6')](_0xb6d4('0xe'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xb6d4('0x8')](),controller[_0xb6d4('0xf')]);router[_0xb6d4('0x10')]('/:id/teams',auth[_0xb6d4('0x8')](),controller[_0xb6d4('0x11')]);router[_0xb6d4('0x10')](_0xb6d4('0xe'),auth[_0xb6d4('0x8')](),controller[_0xb6d4('0x12')]);router[_0xb6d4('0x13')](_0xb6d4('0x9'),auth[_0xb6d4('0x8')](),controller['update']);router[_0xb6d4('0x14')](_0xb6d4('0x9'),auth[_0xb6d4('0x8')](),controller[_0xb6d4('0x15')]);router['delete']('/:id/teams',auth[_0xb6d4('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xb6d4('0x8')](),controller[_0xb6d4('0x16')]);module[_0xb6d4('0x17')]=router; \ No newline at end of file +var _0x1282=['describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','./whatsappQueue.controller','get','isAuthenticated'];(function(_0x1f45a2,_0xb7f26a){var _0x31fccb=function(_0x4f7584){while(--_0x4f7584){_0x1f45a2['push'](_0x1f45a2['shift']());}};_0x31fccb(++_0xb7f26a);}(_0x1282,0x1f2));var _0x2128=function(_0x305a3c,_0x520f89){_0x305a3c=_0x305a3c-0x0;var _0xfbd851=_0x1282[_0x305a3c];return _0xfbd851;};'use strict';var multer=require(_0x2128('0x0'));var util=require(_0x2128('0x1'));var path=require('path');var timeout=require(_0x2128('0x2'));var express=require('express');var router=express[_0x2128('0x3')]();var fs_extra=require(_0x2128('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2128('0x5'));router[_0x2128('0x6')]('/',auth[_0x2128('0x7')](),controller['index']);router[_0x2128('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x2128('0x8')]);router[_0x2128('0x6')](_0x2128('0x9'),auth[_0x2128('0x7')](),controller[_0x2128('0xa')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x2128('0xb')]);router[_0x2128('0x6')](_0x2128('0xc'),auth[_0x2128('0x7')](),controller['getTeams']);router[_0x2128('0x6')](_0x2128('0xd'),auth[_0x2128('0x7')](),controller[_0x2128('0xe')]);router[_0x2128('0xf')]('/',auth[_0x2128('0x7')](),controller[_0x2128('0x10')]);router['post'](_0x2128('0xc'),auth[_0x2128('0x7')](),controller[_0x2128('0x11')]);router[_0x2128('0xf')](_0x2128('0xd'),auth[_0x2128('0x7')](),controller['addAgents']);router[_0x2128('0x12')](_0x2128('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x2128('0x13')]('/:id',auth[_0x2128('0x7')](),controller[_0x2128('0x14')]);router['delete'](_0x2128('0xc'),auth[_0x2128('0x7')](),controller['removeTeams']);router[_0x2128('0x13')]('/:id/users',auth[_0x2128('0x7')](),controller[_0x2128('0x15')]);module[_0x2128('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 751b67c..86d2f4b 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 _0xa98d=['roundrobin','sequelize','STRING','INTEGER','ENUM','beepall'];(function(_0x3ec873,_0x49b01e){var _0x44c08e=function(_0x3006ec){while(--_0x3006ec){_0x3ec873['push'](_0x3ec873['shift']());}};_0x44c08e(++_0x49b01e);}(_0xa98d,0xa3));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xda98('0x0'));module['exports']={'name':{'type':Sequelize[_0xda98('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xda98('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xda98('0x3')]('rrmemory',_0xda98('0x4'),_0xda98('0x5'))},'description':{'type':Sequelize[_0xda98('0x1')]}}; \ No newline at end of file +var _0x803f=['beepall','roundrobin','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x4472fc,_0x232a7d){var _0x2bcd0e=function(_0x56649e){while(--_0x56649e){_0x4472fc['push'](_0x4472fc['shift']());}};_0x2bcd0e(++_0x232a7d);}(_0x803f,0x64));var _0xf803=function(_0x43221e,_0x201b96){_0x43221e=_0x43221e-0x0;var _0x210800=_0x803f[_0x43221e];return _0x210800;};'use strict';var Sequelize=require(_0xf803('0x0'));module['exports']={'name':{'type':Sequelize[_0xf803('0x1')],'unique':_0xf803('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf803('0x3')](_0xf803('0x4'),_0xf803('0x5'),_0xf803('0x6'))},'description':{'type':Sequelize[_0xf803('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index a38a142..c14d49b 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 _0xf52d=['sort','pick','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','keys','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','Team','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','includes','all','value','isEmpty','removeAgents','addAgents','spread','isArray','userWhatsappQueue:remove','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','limit'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0xf52d,0x1e9));var _0xdf52=function(_0x4b73b9,_0x1dea25){_0x4b73b9=_0x4b73b9-0x0;var _0x5caf19=_0xf52d[_0x4b73b9];return _0x5caf19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf52('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf52('0x1'));var rp=require('request-promise');var moment=require(_0xdf52('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xdf52('0x3'));var util=require('util');var path=require(_0xdf52('0x4'));var sox=require(_0xdf52('0x5'));var csv=require(_0xdf52('0x6'));var ejs=require(_0xdf52('0x7'));var fs=require('fs');var fs_extra=require(_0xdf52('0x8'));var _=require(_0xdf52('0x9'));var squel=require(_0xdf52('0xa'));var crypto=require(_0xdf52('0xb'));var jsforce=require(_0xdf52('0xc'));var deskjs=require(_0xdf52('0xd'));var toCsv=require(_0xdf52('0x6'));var querystring=require(_0xdf52('0xe'));var Papa=require(_0xdf52('0xf'));var Redis=require(_0xdf52('0x10'));var authService=require(_0xdf52('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf52('0x12'));var logger=require(_0xdf52('0x13'))(_0xdf52('0x14'));var utils=require(_0xdf52('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdf52('0x16'));var db=require(_0xdf52('0x17'))['db'];config[_0xdf52('0x18')]=_[_0xdf52('0x19')](config[_0xdf52('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf52('0x1a'))(new Redis(config[_0xdf52('0x18')]));require(_0xdf52('0x1b'))[_0xdf52('0x1c')](socket);function respondWithStatusCode(_0x4510db,_0x31c5a8){_0x31c5a8=_0x31c5a8||0xcc;return function(_0x30d870){if(_0x30d870){return _0x4510db[_0xdf52('0x1d')](_0x31c5a8);}return _0x4510db['status'](_0x31c5a8)['end']();};}function respondWithResult(_0x4745b7,_0x1d9ea4){_0x1d9ea4=_0x1d9ea4||0xc8;return function(_0x4d02e9){if(_0x4d02e9){return _0x4745b7[_0xdf52('0x1e')](_0x1d9ea4)[_0xdf52('0x1f')](_0x4d02e9);}};}function respondWithFilteredResult(_0x3c54c8,_0x350b62){return function(_0x389c46){if(_0x389c46){var _0x143bca=typeof _0x350b62['offset']===_0xdf52('0x20')&&typeof _0x350b62['limit']==='undefined';var _0x5e2456=_0x389c46['count'];var _0x2086dd=_0x143bca?0x0:_0x350b62[_0xdf52('0x21')];var _0xdc5571=_0x143bca?_0x389c46[_0xdf52('0x22')]:_0x350b62[_0xdf52('0x21')]+_0x350b62['limit'];var _0x3f184f;if(_0xdc5571>=_0x5e2456){_0xdc5571=_0x5e2456;_0x3f184f=0xc8;}else{_0x3f184f=0xce;}_0x3c54c8[_0xdf52('0x1e')](_0x3f184f);return _0x3c54c8[_0xdf52('0x23')](_0xdf52('0x24'),_0x2086dd+'-'+_0xdc5571+'/'+_0x5e2456)['json'](_0x389c46);}return null;};}function patchUpdates(_0x2f3c7f){return function(_0x416e78){try{jsonpatch['apply'](_0x416e78,_0x2f3c7f,!![]);}catch(_0x24c340){return BPromise[_0xdf52('0x25')](_0x24c340);}return _0x416e78[_0xdf52('0x26')]();};}function saveUpdates(_0x96edac,_0x417724){return function(_0x11671c){if(_0x11671c){return _0x11671c[_0xdf52('0x27')](_0x96edac)[_0xdf52('0x28')](function(_0x4d665e){return _0x4d665e;});}return null;};}function removeEntity(_0x45cea4,_0x4390ff){return function(_0x5b458e){if(_0x5b458e){return _0x5b458e[_0xdf52('0x29')]()[_0xdf52('0x28')](function(){var _0x22f3d2=_0x5b458e[_0xdf52('0x2a')]({'plain':!![]});var _0x37d28d=_0xdf52('0x2b');return db['UserProfileResource'][_0xdf52('0x29')]({'where':{'type':_0x37d28d,'resourceId':_0x22f3d2['id']}})[_0xdf52('0x28')](function(){return _0x5b458e;});})[_0xdf52('0x28')](function(){_0x45cea4[_0xdf52('0x1e')](0xcc)[_0xdf52('0x2c')]();});}};}function handleEntityNotFound(_0x2ccce8,_0x4df699){return function(_0x38ec18){if(!_0x38ec18){_0x2ccce8[_0xdf52('0x1d')](0x194);}return _0x38ec18;};}function handleError(_0x50b4b2,_0x59ba7d){_0x59ba7d=_0x59ba7d||0x1f4;return function(_0x40d6b4){logger[_0xdf52('0x2d')](_0x40d6b4[_0xdf52('0x2e')]);if(_0x40d6b4[_0xdf52('0x2f')]){delete _0x40d6b4[_0xdf52('0x2f')];}_0x50b4b2[_0xdf52('0x1e')](_0x59ba7d)[_0xdf52('0x30')](_0x40d6b4);};}exports[_0xdf52('0x31')]=function(_0x1ea229,_0x1da614){var _0x52c528={},_0x159006={},_0x1022c6={'count':0x0,'rows':[]};var _0x77ad4f=_[_0xdf52('0x32')](db[_0xdf52('0x33')][_0xdf52('0x34')],function(_0x3fbdab){return{'name':_0x3fbdab[_0xdf52('0x35')],'type':_0x3fbdab['type'][_0xdf52('0x36')]};});_0x159006[_0xdf52('0x37')]=_[_0xdf52('0x32')](_0x77ad4f,_0xdf52('0x2f'));_0x159006[_0xdf52('0x38')]=_['keys'](_0x1ea229['query']);_0x159006[_0xdf52('0x39')]=_[_0xdf52('0x3a')](_0x159006[_0xdf52('0x37')],_0x159006[_0xdf52('0x38')]);_0x52c528[_0xdf52('0x3b')]=_[_0xdf52('0x3a')](_0x159006[_0xdf52('0x37')],qs[_0xdf52('0x3c')](_0x1ea229[_0xdf52('0x38')]['fields']));_0x52c528[_0xdf52('0x3b')]=_0x52c528['attributes'][_0xdf52('0x3d')]?_0x52c528['attributes']:_0x159006['model'];if(!_0x1ea229[_0xdf52('0x38')]['hasOwnProperty']('nolimit')){_0x52c528[_0xdf52('0x3e')]=qs[_0xdf52('0x3e')](_0x1ea229[_0xdf52('0x38')][_0xdf52('0x3e')]);_0x52c528['offset']=qs[_0xdf52('0x21')](_0x1ea229[_0xdf52('0x38')]['offset']);}_0x52c528['order']=qs[_0xdf52('0x3f')](_0x1ea229[_0xdf52('0x38')][_0xdf52('0x3f')]);_0x52c528['where']=qs[_0xdf52('0x39')](_[_0xdf52('0x40')](_0x1ea229[_0xdf52('0x38')],_0x159006['filters']),_0x77ad4f);if(_0x1ea229[_0xdf52('0x38')]['filter']){_0x52c528[_0xdf52('0x41')]=_[_0xdf52('0x42')](_0x52c528[_0xdf52('0x41')],{'$or':_[_0xdf52('0x32')](_0x77ad4f,function(_0x27e3f8){if(_0x27e3f8['type']!==_0xdf52('0x43')){var _0x5aa160={};_0x5aa160[_0x27e3f8[_0xdf52('0x2f')]]={'$like':'%'+_0x1ea229[_0xdf52('0x38')][_0xdf52('0x44')]+'%'};return _0x5aa160;}})});}_0x52c528=_[_0xdf52('0x42')]({},_0x52c528,_0x1ea229[_0xdf52('0x45')]);var _0xd7f896={'where':_0x52c528[_0xdf52('0x41')]};return db['WhatsappQueue']['count'](_0xd7f896)[_0xdf52('0x28')](function(_0x40a98d){_0x1022c6['count']=_0x40a98d;if(_0x1ea229[_0xdf52('0x38')]['includeAll']){_0x52c528['include']=[{'all':!![]}];}return db[_0xdf52('0x33')][_0xdf52('0x46')](_0x52c528);})[_0xdf52('0x28')](function(_0x1663b){_0x1022c6[_0xdf52('0x47')]=_0x1663b;return _0x1022c6;})[_0xdf52('0x28')](respondWithFilteredResult(_0x1da614,_0x52c528))[_0xdf52('0x48')](handleError(_0x1da614,null));};exports[_0xdf52('0x49')]=function(_0x2b909d,_0x18381a){var _0x17461f={'raw':!![],'where':{'id':_0x2b909d[_0xdf52('0x4a')]['id']}},_0xe7c5ad={};_0xe7c5ad['model']=_[_0xdf52('0x4b')](db['WhatsappQueue'][_0xdf52('0x34')]);_0xe7c5ad[_0xdf52('0x38')]=_[_0xdf52('0x4b')](_0x2b909d[_0xdf52('0x38')]);_0xe7c5ad['filters']=_[_0xdf52('0x3a')](_0xe7c5ad[_0xdf52('0x37')],_0xe7c5ad[_0xdf52('0x38')]);_0x17461f['attributes']=_['intersection'](_0xe7c5ad['model'],qs[_0xdf52('0x3c')](_0x2b909d[_0xdf52('0x38')][_0xdf52('0x3c')]));_0x17461f['attributes']=_0x17461f['attributes'][_0xdf52('0x3d')]?_0x17461f[_0xdf52('0x3b')]:_0xe7c5ad[_0xdf52('0x37')];if(_0x2b909d[_0xdf52('0x38')][_0xdf52('0x4c')]){_0x17461f['include']=[{'all':!![]}];}_0x17461f=_[_0xdf52('0x42')]({},_0x17461f,_0x2b909d[_0xdf52('0x45')]);return db[_0xdf52('0x33')][_0xdf52('0x4d')](_0x17461f)[_0xdf52('0x28')](handleEntityNotFound(_0x18381a,null))[_0xdf52('0x28')](respondWithResult(_0x18381a,null))['catch'](handleError(_0x18381a,null));};exports['create']=function(_0x32901c,_0x4eb777){return db[_0xdf52('0x33')]['create'](_0x32901c[_0xdf52('0x4e')],{})[_0xdf52('0x28')](function(_0x361f42){var _0x56a60f=_0x32901c[_0xdf52('0x4f')][_0xdf52('0x2a')]({'plain':!![]});if(!_0x56a60f)throw new Error(_0xdf52('0x50'));if(_0x56a60f[_0xdf52('0x51')]===_0xdf52('0x4f')){var _0x2b8329=_0x361f42[_0xdf52('0x2a')]({'plain':!![]});var _0x1c0f58='WhatsappQueues';return db[_0xdf52('0x52')][_0xdf52('0x4d')]({'where':{'name':_0x1c0f58,'userProfileId':_0x56a60f['userProfileId']},'raw':!![]})[_0xdf52('0x28')](function(_0x2b9b15){if(_0x2b9b15&&_0x2b9b15[_0xdf52('0x53')]===0x0){return db[_0xdf52('0x54')][_0xdf52('0x55')]({'name':_0x2b8329[_0xdf52('0x2f')],'resourceId':_0x2b8329['id'],'type':_0x2b9b15[_0xdf52('0x2f')],'sectionId':_0x2b9b15['id']},{})[_0xdf52('0x28')](function(){return _0x361f42;});}else{return _0x361f42;}})[_0xdf52('0x48')](function(_0x76513f){logger[_0xdf52('0x2d')](_0xdf52('0x56'),_0x76513f);throw _0x76513f;});}return _0x361f42;})[_0xdf52('0x28')](respondWithResult(_0x4eb777,0xc9))[_0xdf52('0x48')](handleError(_0x4eb777,null));};exports['update']=function(_0x3f3b15,_0x368343){if(_0x3f3b15[_0xdf52('0x4e')]['id']){delete _0x3f3b15['body']['id'];}return db[_0xdf52('0x33')]['find']({'where':{'id':_0x3f3b15[_0xdf52('0x4a')]['id']}})['then'](handleEntityNotFound(_0x368343,null))['then'](saveUpdates(_0x3f3b15[_0xdf52('0x4e')],null))['then'](respondWithResult(_0x368343,null))[_0xdf52('0x48')](handleError(_0x368343,null));};exports[_0xdf52('0x29')]=function(_0x371682,_0x437855){return db[_0xdf52('0x33')][_0xdf52('0x4d')]({'where':{'id':_0x371682[_0xdf52('0x4a')]['id']}})[_0xdf52('0x28')](handleEntityNotFound(_0x437855,null))[_0xdf52('0x28')](removeEntity(_0x437855,null))['catch'](handleError(_0x437855,null));};exports['describe']=function(_0x23f2e6,_0xee625d){return db[_0xdf52('0x33')][_0xdf52('0x57')]()[_0xdf52('0x28')](respondWithResult(_0xee625d,null))[_0xdf52('0x48')](handleError(_0xee625d,null));};exports[_0xdf52('0x58')]=function(_0x27c668,_0x4113a7,_0x579372){var _0xe627f7={'raw':!![],'where':{}},_0x53a86c={},_0x81a6a1;return db[_0xdf52('0x33')][_0xdf52('0x59')]({'where':{'id':_0x27c668[_0xdf52('0x4a')]['id']}})[_0xdf52('0x28')](handleEntityNotFound(_0x4113a7,null))['then'](function(_0x50a505){if(_0x50a505){_0x81a6a1=_0x50a505['get']({'plain':!![]});_0x53a86c[_0xdf52('0x37')]=_[_0xdf52('0x4b')](db[_0xdf52('0x5a')]['rawAttributes']);_0x53a86c[_0xdf52('0x38')]=_[_0xdf52('0x4b')](_0x27c668[_0xdf52('0x38')]);_0x53a86c[_0xdf52('0x39')]=_['intersection'](_0x53a86c['model'],_0x53a86c[_0xdf52('0x38')]);_0xe627f7[_0xdf52('0x3b')]=_[_0xdf52('0x3a')](_0x53a86c[_0xdf52('0x37')],qs['fields'](_0x27c668[_0xdf52('0x38')]['fields']));_0xe627f7[_0xdf52('0x3b')]=_0xe627f7[_0xdf52('0x3b')][_0xdf52('0x3d')]?_0xe627f7[_0xdf52('0x3b')]:_0x53a86c[_0xdf52('0x37')];if(!_0x27c668['query'][_0xdf52('0x5b')](_0xdf52('0x5c'))){_0xe627f7['limit']=qs[_0xdf52('0x3e')](_0x27c668['query']['limit']);_0xe627f7['offset']=qs[_0xdf52('0x21')](_0x27c668[_0xdf52('0x38')][_0xdf52('0x21')]);}_0xe627f7[_0xdf52('0x5d')]=qs[_0xdf52('0x3f')](_0x27c668[_0xdf52('0x38')][_0xdf52('0x3f')]);_0xe627f7['where']=qs[_0xdf52('0x39')](_['pick'](_0x27c668[_0xdf52('0x38')],_0x53a86c[_0xdf52('0x39')]));_0xe627f7[_0xdf52('0x41')][_0xdf52('0x5e')]=_0x50a505['id'];if(_0x27c668[_0xdf52('0x38')][_0xdf52('0x44')]){_0xe627f7['where']=_[_0xdf52('0x42')](_0xe627f7[_0xdf52('0x41')],{'$or':_[_0xdf52('0x32')](_0xe627f7[_0xdf52('0x3b')],function(_0x35e404){var _0x1782e9={};_0x1782e9[_0x35e404]={'$like':'%'+_0x27c668[_0xdf52('0x38')][_0xdf52('0x44')]+'%'};return _0x1782e9;})});}_0xe627f7=_[_0xdf52('0x42')]({},_0xe627f7,_0x27c668['options']);return db['UserWhatsappQueue'][_0xdf52('0x46')](_0xe627f7);}})['then'](function(_0x1daa2e){if(_0x1daa2e){return db[_0xdf52('0x5f')][_0xdf52('0x60')]({'where':{'id':_['map'](_0x1daa2e,_0xdf52('0x61')),'role':'agent'},'attributes':['id',_0xdf52('0x2f'),_0xdf52('0x62'),_0xdf52('0x63'),_0xdf52('0x64')]});}})[_0xdf52('0x28')](function(_0x209b3e){if(_0x209b3e){return{'count':_0x209b3e[_0xdf52('0x22')],'rows':_['map'](_0x209b3e[_0xdf52('0x47')],function(_0x1ef851){return{'membername':_0x1ef851[_0xdf52('0x2f')],'UserId':_0x1ef851['id'],'queue_name':_0x81a6a1[_0xdf52('0x2f')],'WhatsappQueueId':_0x81a6a1['id'],'interface':util['format'](_0xdf52('0x65'),_0xdf52('0x66'),_0x1ef851[_0xdf52('0x2f')]),'penalty':0x0,'paused':_0x1ef851[_0xdf52('0x62')],'createdAt':_0x1ef851['createdAt'],'updatedAt':_0x1ef851['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdf52('0x28')](respondWithFilteredResult(_0x4113a7,_0xe627f7))[_0xdf52('0x48')](handleError(_0x4113a7,null));};exports[_0xdf52('0x67')]=function(_0x22be5d,_0x17107d,_0x51a5b5){var _0x2fe32c={};var _0x263be3={};var _0x5b08de;var _0x55452e;return db['WhatsappQueue'][_0xdf52('0x59')]({'where':{'id':_0x22be5d[_0xdf52('0x4a')]['id']}})[_0xdf52('0x28')](handleEntityNotFound(_0x17107d,null))[_0xdf52('0x28')](function(_0x72b09b){if(_0x72b09b){_0x5b08de=_0x72b09b;_0x263be3['model']=_[_0xdf52('0x4b')](db['Team'][_0xdf52('0x34')]);_0x263be3['query']=_[_0xdf52('0x4b')](_0x22be5d['query']);_0x263be3['filters']=_[_0xdf52('0x3a')](_0x263be3[_0xdf52('0x37')],_0x263be3[_0xdf52('0x38')]);_0x2fe32c[_0xdf52('0x3b')]=_[_0xdf52('0x3a')](_0x263be3[_0xdf52('0x37')],qs[_0xdf52('0x3c')](_0x22be5d['query'][_0xdf52('0x3c')]));_0x2fe32c['attributes']=_0x2fe32c[_0xdf52('0x3b')][_0xdf52('0x3d')]?_0x2fe32c[_0xdf52('0x3b')]:_0x263be3[_0xdf52('0x37')];_0x2fe32c[_0xdf52('0x5d')]=qs['sort'](_0x22be5d[_0xdf52('0x38')]['sort']);_0x2fe32c[_0xdf52('0x41')]=qs[_0xdf52('0x39')](_[_0xdf52('0x40')](_0x22be5d[_0xdf52('0x38')],_0x263be3['filters']));if(_0x22be5d[_0xdf52('0x38')][_0xdf52('0x44')]){_0x2fe32c[_0xdf52('0x41')]=_[_0xdf52('0x42')](_0x2fe32c[_0xdf52('0x41')],{'$or':_[_0xdf52('0x32')](_0x2fe32c[_0xdf52('0x3b')],function(_0x4eb964){var _0x3bcae9={};_0x3bcae9[_0x4eb964]={'$like':'%'+_0x22be5d[_0xdf52('0x38')][_0xdf52('0x44')]+'%'};return _0x3bcae9;})});}_0x2fe32c=_[_0xdf52('0x42')]({},_0x2fe32c,_0x22be5d[_0xdf52('0x45')]);return _0x5b08de['getTeams'](_0x2fe32c);}})[_0xdf52('0x28')](function(_0x445691){if(_0x445691){_0x55452e=_0x445691[_0xdf52('0x3d')];if(!_0x22be5d[_0xdf52('0x38')][_0xdf52('0x5b')]('nolimit')){_0x2fe32c['limit']=qs[_0xdf52('0x3e')](_0x22be5d[_0xdf52('0x38')][_0xdf52('0x3e')]);_0x2fe32c[_0xdf52('0x21')]=qs['offset'](_0x22be5d[_0xdf52('0x38')][_0xdf52('0x21')]);}return _0x5b08de[_0xdf52('0x67')](_0x2fe32c);}})[_0xdf52('0x28')](function(_0x454fba){if(_0x454fba){return _0x454fba?{'count':_0x55452e,'rows':_0x454fba}:null;}})[_0xdf52('0x28')](respondWithResult(_0x17107d,null))[_0xdf52('0x48')](handleError(_0x17107d,null));};exports[_0xdf52('0x68')]=function(_0x5d918e,_0x46f080,_0x32b9a9){var _0x3e804c=_0x5d918e['body'][_0xdf52('0x69')];return db['Team']['findAll']({'where':{'id':_0x3e804c},'attributes':['id'],'include':[{'model':db[_0xdf52('0x5f')],'as':_0xdf52('0x6a'),'attributes':['id','name',_0xdf52('0x6b'),_0xdf52('0x6c'),'interface'],'raw':!![]}]})[_0xdf52('0x28')](function(_0x322138){if(_0x322138){var _0xb0b257=_[_0xdf52('0x6d')](_0x322138,function(_0x1608fb){var _0x1ab5c1=_0x1608fb[_0xdf52('0x2a')]({'plain':!![]});return _0x1ab5c1[_0xdf52('0x6a')];});return db[_0xdf52('0x33')]['find']({'where':{'id':_0x5d918e[_0xdf52('0x4a')]['id']}})[_0xdf52('0x28')](function(_0x480e36){return db[_0xdf52('0x6e')][_0xdf52('0x6f')](function(_0x22736f){return _0x480e36[_0xdf52('0x68')](_0x3e804c,{'transaction':_0x22736f})[_0xdf52('0x28')](function(){return BPromise['each'](_0xb0b257,function(_0x5e6884){return db['UserWhatsappQueue'][_0xdf52('0x70')]({'where':{'UserId':_0x5e6884['id'],'WhatsappQueueId':_0x5d918e[_0xdf52('0x4a')]['id']},'transaction':_0x22736f});});})[_0xdf52('0x28')](function(){_0xb0b257[_0xdf52('0x71')](function(_0x1bd1db){socket[_0xdf52('0x72')](_0xdf52('0x73'),{'UserId':_0x1bd1db['id'],'WhatsappQueueId':_0x480e36['id']});});});});});}})[_0xdf52('0x28')](respondWithStatusCode(_0x46f080,null))['catch'](handleError(_0x46f080,null));};exports[_0xdf52('0x74')]=function(_0x1fb0b5,_0x1fa31e,_0x432598){return db[_0xdf52('0x75')][_0xdf52('0x46')]({'where':{'id':_0x1fb0b5[_0xdf52('0x38')][_0xdf52('0x69')]},'attributes':['id'],'include':[{'model':db[_0xdf52('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdf52('0x28')](handleEntityNotFound(_0x1fa31e,null))['then'](function(_0x35edf0){var _0x3bb340=_[_0xdf52('0x32')](_0x35edf0,'id');var _0x3130e2=[];var _0x18e403=[];var _0x36ed27=squel['select']();_0x36ed27['field'](_0xdf52('0x76'))[_0xdf52('0x77')]('team_has_whatsapp_queues','tq')[_0xdf52('0x78')](_0xdf52('0x79'),'ut',_0xdf52('0x7a'))['where'](_0xdf52('0x7b'),_0x1fb0b5[_0xdf52('0x4a')]['id']);for(var _0x1644b4=0x0;_0x1644b4<_0x35edf0[_0xdf52('0x3d')];_0x1644b4+=0x1){let _0x17001a=_0x35edf0[_0x1644b4];for(var _0x2ea252=0x0;_0x2ea252<_0x17001a[_0xdf52('0x6a')][_0xdf52('0x3d')];_0x2ea252+=0x1){let _0x132657=_0x17001a[_0xdf52('0x6a')][_0x2ea252];var _0x1acab2=_0x36ed27[_0xdf52('0x7c')]();_0x1acab2['where'](_0xdf52('0x7d'),_0x132657['id']);_0x18e403[_0xdf52('0x7e')](db[_0xdf52('0x6e')][_0xdf52('0x38')](_0x1acab2[_0xdf52('0x7f')](),{'type':db[_0xdf52('0x6e')]['QueryTypes']['SELECT']})['then'](function(_0xe09b74){if(_0xe09b74['length']===0x1){return _0x132657['id'];}else{var _0x23ad44=_[_0xdf52('0x80')](_[_0xdf52('0x32')](_0xe09b74,'TeamId'),function(_0x15a3f6){return _[_0xdf52('0x81')](_0x3bb340,_0x15a3f6);});if(_0x23ad44){return _0x132657['id'];}}}));}}return BPromise[_0xdf52('0x82')](_0x18e403)[_0xdf52('0x28')](function(_0x5170ed){_0x3130e2=_(_0x3130e2)['union'](_0x5170ed)['compact']()[_0xdf52('0x83')]();return db['WhatsappQueue'][_0xdf52('0x4d')]({'where':{'id':_0x1fb0b5[_0xdf52('0x4a')]['id']}})[_0xdf52('0x28')](function(_0x1c978a){return db[_0xdf52('0x6e')][_0xdf52('0x6f')](function(_0x536835){return _0x1c978a[_0xdf52('0x74')](_0x1fb0b5[_0xdf52('0x38')][_0xdf52('0x69')],{'transaction':_0x536835})['then'](function(){if(!_[_0xdf52('0x84')](_0x3130e2)){return _0x1c978a[_0xdf52('0x85')](_0x3130e2,{'transaction':_0x536835});}})['then'](function(){_0x3130e2[_0xdf52('0x71')](function(_0x4b8ceb){socket[_0xdf52('0x72')]('userWhatsappQueue:remove',{'UserId':_0x4b8ceb,'WhatsappQueueId':_0x1c978a['id']});});});});});});})[_0xdf52('0x28')](respondWithStatusCode(_0x1fa31e,null))[_0xdf52('0x48')](handleError(_0x1fa31e,null));};exports[_0xdf52('0x86')]=function(_0x4c7bff,_0x4069fe,_0x1d7d3e){return db['WhatsappQueue'][_0xdf52('0x4d')]({'where':{'id':_0x4c7bff[_0xdf52('0x4a')]['id']}})[_0xdf52('0x28')](handleEntityNotFound(_0x4069fe,null))[_0xdf52('0x28')](function(_0x31f666){if(_0x31f666){return _0x31f666[_0xdf52('0x86')](_0x4c7bff[_0xdf52('0x4e')][_0xdf52('0x69')],_['omit'](_0x4c7bff[_0xdf52('0x4e')],[_0xdf52('0x69'),'id'])||{})[_0xdf52('0x87')](function(_0x5f3d77){for(var _0x46d34e=0x0;_0x46d34e<_0x4c7bff[_0xdf52('0x4e')][_0xdf52('0x69')][_0xdf52('0x3d')];_0x46d34e+=0x1){socket[_0xdf52('0x72')](_0xdf52('0x73'),{'UserId':Number(_0x4c7bff[_0xdf52('0x4e')][_0xdf52('0x69')][_0x46d34e]),'WhatsappQueueId':Number(_0x4c7bff[_0xdf52('0x4a')]['id'])});}return _0x5f3d77;});}})[_0xdf52('0x28')](respondWithResult(_0x4069fe,null))[_0xdf52('0x48')](handleError(_0x4069fe,null));};exports[_0xdf52('0x85')]=function(_0x4fb43c,_0x3812e3,_0x25a7c3){return db[_0xdf52('0x33')]['find']({'where':{'id':_0x4fb43c['params']['id']}})[_0xdf52('0x28')](handleEntityNotFound(_0x3812e3,null))['then'](function(_0x58d18f){if(_0x58d18f){return _0x58d18f[_0xdf52('0x85')](_0x4fb43c[_0xdf52('0x38')][_0xdf52('0x69')])['then'](function(){if(_[_0xdf52('0x88')](_0x4fb43c[_0xdf52('0x38')][_0xdf52('0x69')])){for(var _0x518a2e=0x0;_0x518a2e<_0x4fb43c[_0xdf52('0x38')][_0xdf52('0x69')][_0xdf52('0x3d')];_0x518a2e+=0x1){socket[_0xdf52('0x72')](_0xdf52('0x89'),{'UserId':Number(_0x4fb43c[_0xdf52('0x38')][_0xdf52('0x69')][_0x518a2e]),'WhatsappQueueId':Number(_0x4fb43c['params']['id'])});}}else{socket[_0xdf52('0x72')]('userWhatsappQueue:remove',{'UserId':Number(_0x4fb43c[_0xdf52('0x38')][_0xdf52('0x69')]),'WhatsappQueueId':Number(_0x4fb43c[_0xdf52('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3812e3,null))[_0xdf52('0x48')](handleError(_0x3812e3,null));};exports['getAgents']=function(_0x34908f,_0x10c483,_0x533fb5){var _0x58de70={};var _0x13235a={};var _0x2825ec;var _0x4fb6b8;return db[_0xdf52('0x33')]['findOne']({'where':{'id':_0x34908f['params']['id']}})[_0xdf52('0x28')](handleEntityNotFound(_0x10c483,null))[_0xdf52('0x28')](function(_0x43eb4b){if(_0x43eb4b){_0x2825ec=_0x43eb4b;_0x13235a['model']=_[_0xdf52('0x4b')](db[_0xdf52('0x5f')][_0xdf52('0x34')]);_0x13235a['query']=_['keys'](_0x34908f[_0xdf52('0x38')]);_0x13235a[_0xdf52('0x39')]=_[_0xdf52('0x3a')](_0x13235a[_0xdf52('0x37')],_0x13235a['query']);_0x58de70[_0xdf52('0x3b')]=_[_0xdf52('0x3a')](_0x13235a[_0xdf52('0x37')],qs[_0xdf52('0x3c')](_0x34908f[_0xdf52('0x38')][_0xdf52('0x3c')]));_0x58de70['attributes']=_0x58de70[_0xdf52('0x3b')]['length']?_0x58de70['attributes']:_0x13235a[_0xdf52('0x37')];_0x58de70[_0xdf52('0x5d')]=qs['sort'](_0x34908f[_0xdf52('0x38')][_0xdf52('0x3f')]);_0x58de70[_0xdf52('0x41')]=qs['filters'](_[_0xdf52('0x40')](_0x34908f[_0xdf52('0x38')],_0x13235a[_0xdf52('0x39')]));if(_0x34908f[_0xdf52('0x38')][_0xdf52('0x44')]){_0x58de70[_0xdf52('0x41')]=_[_0xdf52('0x42')](_0x58de70[_0xdf52('0x41')],{'$or':_[_0xdf52('0x32')](_0x58de70[_0xdf52('0x3b')],function(_0x65b03e){var _0x5e267a={};_0x5e267a[_0x65b03e]={'$like':'%'+_0x34908f[_0xdf52('0x38')][_0xdf52('0x44')]+'%'};return _0x5e267a;})});}_0x58de70=_[_0xdf52('0x42')]({},_0x58de70,_0x34908f[_0xdf52('0x45')]);return _0x2825ec['getAgents'](_0x58de70);}})['then'](function(_0x5a15cf){if(_0x5a15cf){_0x4fb6b8=_0x5a15cf[_0xdf52('0x3d')];if(!_0x34908f[_0xdf52('0x38')][_0xdf52('0x5b')](_0xdf52('0x5c'))){_0x58de70[_0xdf52('0x3e')]=qs['limit'](_0x34908f[_0xdf52('0x38')][_0xdf52('0x3e')]);_0x58de70[_0xdf52('0x21')]=qs[_0xdf52('0x21')](_0x34908f['query'][_0xdf52('0x21')]);}return _0x2825ec['getAgents'](_0x58de70);}})[_0xdf52('0x28')](function(_0x5552da){if(_0x5552da){return _0x5552da?{'count':_0x4fb6b8,'rows':_0x5552da}:null;}})[_0xdf52('0x28')](respondWithResult(_0x10c483,null))[_0xdf52('0x48')](handleError(_0x10c483,null));}; \ No newline at end of file +var _0x676a=['Team','ids','Agents','online','interface','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','from','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','every','includes','all','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','userWhatsappQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','WhatsappQueues','sendStatus','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','params','UserWhatsappQueue','User','findAndCountAll','agent','createdAt','rows','format','%s/%s','SIP','whatsappPause','getTeams'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x676a,0x12d));var _0xa676=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x676a[_0x3ce3c];return _0x55a2c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa676('0x0'));var zipdir=require(_0xa676('0x1'));var jsonpatch=require(_0xa676('0x2'));var rp=require(_0xa676('0x3'));var moment=require(_0xa676('0x4'));var BPromise=require(_0xa676('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa676('0x6'));var sox=require(_0xa676('0x7'));var csv=require(_0xa676('0x8'));var ejs=require(_0xa676('0x9'));var fs=require('fs');var fs_extra=require(_0xa676('0xa'));var _=require(_0xa676('0xb'));var squel=require(_0xa676('0xc'));var crypto=require(_0xa676('0xd'));var jsforce=require(_0xa676('0xe'));var deskjs=require(_0xa676('0xf'));var toCsv=require(_0xa676('0x8'));var querystring=require(_0xa676('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa676('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa676('0x12'));var hardwareService=require(_0xa676('0x13'));var logger=require(_0xa676('0x14'))('api');var utils=require(_0xa676('0x15'));var config=require(_0xa676('0x16'));var licenseUtil=require(_0xa676('0x17'));var db=require('../../mysqldb')['db'];config[_0xa676('0x18')]=_[_0xa676('0x19')](config[_0xa676('0x18')],{'host':_0xa676('0x1a'),'port':0x18eb});var socket=require(_0xa676('0x1b'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xa676('0x1c')](socket);function respondWithStatusCode(_0x41d6a5,_0x51f07d){_0x51f07d=_0x51f07d||0xcc;return function(_0x5b60db){if(_0x5b60db){return _0x41d6a5['sendStatus'](_0x51f07d);}return _0x41d6a5['status'](_0x51f07d)[_0xa676('0x1d')]();};}function respondWithResult(_0x3396f7,_0x5caae8){_0x5caae8=_0x5caae8||0xc8;return function(_0x4361a4){if(_0x4361a4){return _0x3396f7[_0xa676('0x1e')](_0x5caae8)[_0xa676('0x1f')](_0x4361a4);}};}function respondWithFilteredResult(_0x3b64fb,_0x2886d3){return function(_0x3e7058){if(_0x3e7058){var _0x5a254d=typeof _0x2886d3[_0xa676('0x20')]==='undefined'&&typeof _0x2886d3[_0xa676('0x21')]===_0xa676('0x22');var _0x156161=_0x3e7058['count'];var _0x34b466=_0x5a254d?0x0:_0x2886d3['offset'];var _0x3cf339=_0x5a254d?_0x3e7058[_0xa676('0x23')]:_0x2886d3[_0xa676('0x20')]+_0x2886d3[_0xa676('0x21')];var _0xcc09e9;if(_0x3cf339>=_0x156161){_0x3cf339=_0x156161;_0xcc09e9=0xc8;}else{_0xcc09e9=0xce;}_0x3b64fb[_0xa676('0x1e')](_0xcc09e9);return _0x3b64fb[_0xa676('0x24')](_0xa676('0x25'),_0x34b466+'-'+_0x3cf339+'/'+_0x156161)[_0xa676('0x1f')](_0x3e7058);}return null;};}function patchUpdates(_0x1084eb){return function(_0x5cf3c4){try{jsonpatch[_0xa676('0x26')](_0x5cf3c4,_0x1084eb,!![]);}catch(_0x570f04){return BPromise['reject'](_0x570f04);}return _0x5cf3c4[_0xa676('0x27')]();};}function saveUpdates(_0x45ea09,_0x5b91cb){return function(_0xd5e424){if(_0xd5e424){return _0xd5e424[_0xa676('0x28')](_0x45ea09)[_0xa676('0x29')](function(_0x42141e){return _0x42141e;});}return null;};}function removeEntity(_0x1b97ed,_0x35c172){return function(_0x295497){if(_0x295497){return _0x295497[_0xa676('0x2a')]()[_0xa676('0x29')](function(){var _0x4c9f05=_0x295497[_0xa676('0x2b')]({'plain':!![]});var _0x367424=_0xa676('0x2c');return db['UserProfileResource'][_0xa676('0x2a')]({'where':{'type':_0x367424,'resourceId':_0x4c9f05['id']}})[_0xa676('0x29')](function(){return _0x295497;});})['then'](function(){_0x1b97ed['status'](0xcc)[_0xa676('0x1d')]();});}};}function handleEntityNotFound(_0x2f4c8b,_0x4a8288){return function(_0x1bc54b){if(!_0x1bc54b){_0x2f4c8b[_0xa676('0x2d')](0x194);}return _0x1bc54b;};}function handleError(_0x433ab6,_0x434cc5){_0x434cc5=_0x434cc5||0x1f4;return function(_0x4cbf03){logger['error'](_0x4cbf03[_0xa676('0x2e')]);if(_0x4cbf03[_0xa676('0x2f')]){delete _0x4cbf03[_0xa676('0x2f')];}_0x433ab6['status'](_0x434cc5)[_0xa676('0x30')](_0x4cbf03);};}exports['index']=function(_0x52160e,_0x2234c3){var _0x4b2c6d={},_0x504db0={},_0x12279b={'count':0x0,'rows':[]};var _0x6bc98b=_[_0xa676('0x31')](db[_0xa676('0x32')][_0xa676('0x33')],function(_0x3f4222){return{'name':_0x3f4222[_0xa676('0x34')],'type':_0x3f4222[_0xa676('0x35')][_0xa676('0x36')]};});_0x504db0[_0xa676('0x37')]=_[_0xa676('0x31')](_0x6bc98b,'name');_0x504db0[_0xa676('0x38')]=_['keys'](_0x52160e['query']);_0x504db0['filters']=_['intersection'](_0x504db0[_0xa676('0x37')],_0x504db0[_0xa676('0x38')]);_0x4b2c6d[_0xa676('0x39')]=_[_0xa676('0x3a')](_0x504db0['model'],qs[_0xa676('0x3b')](_0x52160e[_0xa676('0x38')][_0xa676('0x3b')]));_0x4b2c6d[_0xa676('0x39')]=_0x4b2c6d[_0xa676('0x39')][_0xa676('0x3c')]?_0x4b2c6d[_0xa676('0x39')]:_0x504db0[_0xa676('0x37')];if(!_0x52160e[_0xa676('0x38')][_0xa676('0x3d')](_0xa676('0x3e'))){_0x4b2c6d[_0xa676('0x21')]=qs[_0xa676('0x21')](_0x52160e[_0xa676('0x38')][_0xa676('0x21')]);_0x4b2c6d['offset']=qs[_0xa676('0x20')](_0x52160e[_0xa676('0x38')]['offset']);}_0x4b2c6d[_0xa676('0x3f')]=qs['sort'](_0x52160e['query'][_0xa676('0x40')]);_0x4b2c6d['where']=qs[_0xa676('0x41')](_[_0xa676('0x42')](_0x52160e[_0xa676('0x38')],_0x504db0[_0xa676('0x41')]),_0x6bc98b);if(_0x52160e['query'][_0xa676('0x43')]){_0x4b2c6d['where']=_['merge'](_0x4b2c6d[_0xa676('0x44')],{'$or':_[_0xa676('0x31')](_0x6bc98b,function(_0x16192a){if(_0x16192a[_0xa676('0x35')]!=='VIRTUAL'){var _0x1609a8={};_0x1609a8[_0x16192a[_0xa676('0x2f')]]={'$like':'%'+_0x52160e[_0xa676('0x38')][_0xa676('0x43')]+'%'};return _0x1609a8;}})});}_0x4b2c6d=_[_0xa676('0x45')]({},_0x4b2c6d,_0x52160e[_0xa676('0x46')]);var _0x32ba7d={'where':_0x4b2c6d['where']};return db[_0xa676('0x32')][_0xa676('0x23')](_0x32ba7d)[_0xa676('0x29')](function(_0x26ef5b){_0x12279b[_0xa676('0x23')]=_0x26ef5b;if(_0x52160e['query'][_0xa676('0x47')]){_0x4b2c6d['include']=[{'all':!![]}];}return db[_0xa676('0x32')][_0xa676('0x48')](_0x4b2c6d);})[_0xa676('0x29')](function(_0x48e358){_0x12279b['rows']=_0x48e358;return _0x12279b;})[_0xa676('0x29')](respondWithFilteredResult(_0x2234c3,_0x4b2c6d))[_0xa676('0x49')](handleError(_0x2234c3,null));};exports[_0xa676('0x4a')]=function(_0x311420,_0x47178e){var _0x52b791={'raw':!![],'where':{'id':_0x311420['params']['id']}},_0x5b4c22={};_0x5b4c22['model']=_[_0xa676('0x4b')](db['WhatsappQueue'][_0xa676('0x33')]);_0x5b4c22[_0xa676('0x38')]=_[_0xa676('0x4b')](_0x311420['query']);_0x5b4c22[_0xa676('0x41')]=_[_0xa676('0x3a')](_0x5b4c22['model'],_0x5b4c22[_0xa676('0x38')]);_0x52b791[_0xa676('0x39')]=_['intersection'](_0x5b4c22[_0xa676('0x37')],qs[_0xa676('0x3b')](_0x311420[_0xa676('0x38')][_0xa676('0x3b')]));_0x52b791[_0xa676('0x39')]=_0x52b791[_0xa676('0x39')][_0xa676('0x3c')]?_0x52b791[_0xa676('0x39')]:_0x5b4c22['model'];if(_0x311420[_0xa676('0x38')][_0xa676('0x47')]){_0x52b791['include']=[{'all':!![]}];}_0x52b791=_['merge']({},_0x52b791,_0x311420[_0xa676('0x46')]);return db['WhatsappQueue']['find'](_0x52b791)['then'](handleEntityNotFound(_0x47178e,null))[_0xa676('0x29')](respondWithResult(_0x47178e,null))[_0xa676('0x49')](handleError(_0x47178e,null));};exports[_0xa676('0x4c')]=function(_0x313f5b,_0x266e1e){return db[_0xa676('0x32')][_0xa676('0x4c')](_0x313f5b[_0xa676('0x4d')],{})[_0xa676('0x29')](function(_0x1a6264){var _0x4f8337=_0x313f5b[_0xa676('0x4e')][_0xa676('0x2b')]({'plain':!![]});if(!_0x4f8337)throw new Error(_0xa676('0x4f'));if(_0x4f8337[_0xa676('0x50')]===_0xa676('0x4e')){var _0x391bce=_0x1a6264[_0xa676('0x2b')]({'plain':!![]});var _0x4593c0=_0xa676('0x2c');return db[_0xa676('0x51')][_0xa676('0x52')]({'where':{'name':_0x4593c0,'userProfileId':_0x4f8337[_0xa676('0x53')]},'raw':!![]})[_0xa676('0x29')](function(_0x572ba0){if(_0x572ba0&&_0x572ba0['autoAssociation']===0x0){return db[_0xa676('0x54')][_0xa676('0x4c')]({'name':_0x391bce[_0xa676('0x2f')],'resourceId':_0x391bce['id'],'type':_0x572ba0[_0xa676('0x2f')],'sectionId':_0x572ba0['id']},{})['then'](function(){return _0x1a6264;});}else{return _0x1a6264;}})['catch'](function(_0x360822){logger['error'](_0xa676('0x55'),_0x360822);throw _0x360822;});}return _0x1a6264;})[_0xa676('0x29')](respondWithResult(_0x266e1e,0xc9))[_0xa676('0x49')](handleError(_0x266e1e,null));};exports['update']=function(_0x519ee9,_0x3313b8){if(_0x519ee9[_0xa676('0x4d')]['id']){delete _0x519ee9[_0xa676('0x4d')]['id'];}return db[_0xa676('0x32')][_0xa676('0x52')]({'where':{'id':_0x519ee9['params']['id']}})[_0xa676('0x29')](handleEntityNotFound(_0x3313b8,null))[_0xa676('0x29')](saveUpdates(_0x519ee9[_0xa676('0x4d')],null))[_0xa676('0x29')](respondWithResult(_0x3313b8,null))['catch'](handleError(_0x3313b8,null));};exports['destroy']=function(_0x11a0e0,_0x49967b){return db[_0xa676('0x32')][_0xa676('0x52')]({'where':{'id':_0x11a0e0['params']['id']}})[_0xa676('0x29')](handleEntityNotFound(_0x49967b,null))[_0xa676('0x29')](removeEntity(_0x49967b,null))[_0xa676('0x49')](handleError(_0x49967b,null));};exports[_0xa676('0x56')]=function(_0xdbf7f5,_0x3fa660){return db[_0xa676('0x32')][_0xa676('0x56')]()['then'](respondWithResult(_0x3fa660,null))[_0xa676('0x49')](handleError(_0x3fa660,null));};exports[_0xa676('0x57')]=function(_0x90660a,_0x27bab1,_0x3acb72){var _0x32d5d8={'raw':!![],'where':{}},_0x333730={},_0x3262c2;return db[_0xa676('0x32')][_0xa676('0x58')]({'where':{'id':_0x90660a[_0xa676('0x59')]['id']}})['then'](handleEntityNotFound(_0x27bab1,null))[_0xa676('0x29')](function(_0x469077){if(_0x469077){_0x3262c2=_0x469077[_0xa676('0x2b')]({'plain':!![]});_0x333730[_0xa676('0x37')]=_[_0xa676('0x4b')](db[_0xa676('0x5a')]['rawAttributes']);_0x333730[_0xa676('0x38')]=_[_0xa676('0x4b')](_0x90660a['query']);_0x333730[_0xa676('0x41')]=_[_0xa676('0x3a')](_0x333730[_0xa676('0x37')],_0x333730[_0xa676('0x38')]);_0x32d5d8[_0xa676('0x39')]=_[_0xa676('0x3a')](_0x333730[_0xa676('0x37')],qs[_0xa676('0x3b')](_0x90660a[_0xa676('0x38')][_0xa676('0x3b')]));_0x32d5d8['attributes']=_0x32d5d8['attributes'][_0xa676('0x3c')]?_0x32d5d8[_0xa676('0x39')]:_0x333730['model'];if(!_0x90660a[_0xa676('0x38')]['hasOwnProperty'](_0xa676('0x3e'))){_0x32d5d8[_0xa676('0x21')]=qs['limit'](_0x90660a[_0xa676('0x38')][_0xa676('0x21')]);_0x32d5d8[_0xa676('0x20')]=qs[_0xa676('0x20')](_0x90660a['query']['offset']);}_0x32d5d8[_0xa676('0x3f')]=qs[_0xa676('0x40')](_0x90660a[_0xa676('0x38')][_0xa676('0x40')]);_0x32d5d8[_0xa676('0x44')]=qs[_0xa676('0x41')](_['pick'](_0x90660a['query'],_0x333730[_0xa676('0x41')]));_0x32d5d8[_0xa676('0x44')]['WhatsappQueueId']=_0x469077['id'];if(_0x90660a[_0xa676('0x38')][_0xa676('0x43')]){_0x32d5d8[_0xa676('0x44')]=_['merge'](_0x32d5d8['where'],{'$or':_[_0xa676('0x31')](_0x32d5d8['attributes'],function(_0x281847){var _0x1e43cc={};_0x1e43cc[_0x281847]={'$like':'%'+_0x90660a['query'][_0xa676('0x43')]+'%'};return _0x1e43cc;})});}_0x32d5d8=_[_0xa676('0x45')]({},_0x32d5d8,_0x90660a[_0xa676('0x46')]);return db[_0xa676('0x5a')][_0xa676('0x48')](_0x32d5d8);}})[_0xa676('0x29')](function(_0x45fe36){if(_0x45fe36){return db[_0xa676('0x5b')][_0xa676('0x5c')]({'where':{'id':_[_0xa676('0x31')](_0x45fe36,'UserId'),'role':_0xa676('0x5d')},'attributes':['id',_0xa676('0x2f'),'whatsappPause','updatedAt',_0xa676('0x5e')]});}})[_0xa676('0x29')](function(_0x5c43ea){if(_0x5c43ea){return{'count':_0x5c43ea['count'],'rows':_[_0xa676('0x31')](_0x5c43ea[_0xa676('0x5f')],function(_0x1aa857){return{'membername':_0x1aa857[_0xa676('0x2f')],'UserId':_0x1aa857['id'],'queue_name':_0x3262c2[_0xa676('0x2f')],'WhatsappQueueId':_0x3262c2['id'],'interface':util[_0xa676('0x60')](_0xa676('0x61'),_0xa676('0x62'),_0x1aa857[_0xa676('0x2f')]),'penalty':0x0,'paused':_0x1aa857[_0xa676('0x63')],'createdAt':_0x1aa857['createdAt'],'updatedAt':_0x1aa857['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa676('0x29')](respondWithFilteredResult(_0x27bab1,_0x32d5d8))['catch'](handleError(_0x27bab1,null));};exports[_0xa676('0x64')]=function(_0xd5e55a,_0x946d88,_0xef285f){var _0x53dd2f={};var _0x580fe9={};var _0x27ef6e;var _0x483d91;return db[_0xa676('0x32')]['findOne']({'where':{'id':_0xd5e55a['params']['id']}})[_0xa676('0x29')](handleEntityNotFound(_0x946d88,null))[_0xa676('0x29')](function(_0x13daef){if(_0x13daef){_0x27ef6e=_0x13daef;_0x580fe9['model']=_[_0xa676('0x4b')](db[_0xa676('0x65')][_0xa676('0x33')]);_0x580fe9[_0xa676('0x38')]=_['keys'](_0xd5e55a[_0xa676('0x38')]);_0x580fe9[_0xa676('0x41')]=_[_0xa676('0x3a')](_0x580fe9[_0xa676('0x37')],_0x580fe9['query']);_0x53dd2f[_0xa676('0x39')]=_['intersection'](_0x580fe9['model'],qs[_0xa676('0x3b')](_0xd5e55a['query'][_0xa676('0x3b')]));_0x53dd2f[_0xa676('0x39')]=_0x53dd2f['attributes']['length']?_0x53dd2f[_0xa676('0x39')]:_0x580fe9['model'];_0x53dd2f[_0xa676('0x3f')]=qs['sort'](_0xd5e55a['query'][_0xa676('0x40')]);_0x53dd2f['where']=qs['filters'](_['pick'](_0xd5e55a[_0xa676('0x38')],_0x580fe9[_0xa676('0x41')]));if(_0xd5e55a[_0xa676('0x38')][_0xa676('0x43')]){_0x53dd2f['where']=_['merge'](_0x53dd2f[_0xa676('0x44')],{'$or':_[_0xa676('0x31')](_0x53dd2f[_0xa676('0x39')],function(_0x24de70){var _0x3bc037={};_0x3bc037[_0x24de70]={'$like':'%'+_0xd5e55a[_0xa676('0x38')][_0xa676('0x43')]+'%'};return _0x3bc037;})});}_0x53dd2f=_[_0xa676('0x45')]({},_0x53dd2f,_0xd5e55a[_0xa676('0x46')]);return _0x27ef6e[_0xa676('0x64')](_0x53dd2f);}})[_0xa676('0x29')](function(_0x2ffedb){if(_0x2ffedb){_0x483d91=_0x2ffedb[_0xa676('0x3c')];if(!_0xd5e55a[_0xa676('0x38')][_0xa676('0x3d')](_0xa676('0x3e'))){_0x53dd2f['limit']=qs[_0xa676('0x21')](_0xd5e55a['query'][_0xa676('0x21')]);_0x53dd2f['offset']=qs[_0xa676('0x20')](_0xd5e55a[_0xa676('0x38')]['offset']);}return _0x27ef6e[_0xa676('0x64')](_0x53dd2f);}})[_0xa676('0x29')](function(_0x1c59d9){if(_0x1c59d9){return _0x1c59d9?{'count':_0x483d91,'rows':_0x1c59d9}:null;}})[_0xa676('0x29')](respondWithResult(_0x946d88,null))[_0xa676('0x49')](handleError(_0x946d88,null));};exports['addTeams']=function(_0x3e507a,_0x2c9b6e,_0x27835e){var _0xfeb0eb=_0x3e507a[_0xa676('0x4d')][_0xa676('0x66')];return db[_0xa676('0x65')][_0xa676('0x48')]({'where':{'id':_0xfeb0eb},'attributes':['id'],'include':[{'model':db[_0xa676('0x5b')],'as':_0xa676('0x67'),'attributes':['id',_0xa676('0x2f'),_0xa676('0x68'),'voicePause',_0xa676('0x69')],'raw':!![]}]})[_0xa676('0x29')](function(_0x258080){if(_0x258080){var _0x5161ab=_['flatMap'](_0x258080,function(_0x2a5b7a){var _0x16d306=_0x2a5b7a[_0xa676('0x2b')]({'plain':!![]});return _0x16d306[_0xa676('0x67')];});return db[_0xa676('0x32')][_0xa676('0x52')]({'where':{'id':_0x3e507a[_0xa676('0x59')]['id']}})['then'](function(_0x3cd235){return db['sequelize'][_0xa676('0x6a')](function(_0x1e3949){return _0x3cd235[_0xa676('0x6b')](_0xfeb0eb,{'transaction':_0x1e3949})[_0xa676('0x29')](function(){return BPromise[_0xa676('0x6c')](_0x5161ab,function(_0x5f5690){return db[_0xa676('0x5a')][_0xa676('0x6d')]({'where':{'UserId':_0x5f5690['id'],'WhatsappQueueId':_0x3e507a[_0xa676('0x59')]['id']},'transaction':_0x1e3949});});})[_0xa676('0x29')](function(){_0x5161ab[_0xa676('0x6e')](function(_0x34a170){socket[_0xa676('0x6f')]('userWhatsappQueue:save',{'UserId':_0x34a170['id'],'WhatsappQueueId':_0x3cd235['id']});});});});});}})[_0xa676('0x29')](respondWithStatusCode(_0x2c9b6e,null))[_0xa676('0x49')](handleError(_0x2c9b6e,null));};exports[_0xa676('0x70')]=function(_0x344745,_0x4a0509,_0x1ea2e1){return db[_0xa676('0x65')][_0xa676('0x48')]({'where':{'id':_0x344745[_0xa676('0x38')][_0xa676('0x66')]},'attributes':['id'],'include':[{'model':db[_0xa676('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4a0509,null))[_0xa676('0x29')](function(_0x5361cb){var _0x26ffea=_[_0xa676('0x31')](_0x5361cb,'id');var _0x50c4ed=[];var _0x32b606=[];var _0x260bb5=squel[_0xa676('0x71')]();_0x260bb5[_0xa676('0x72')]('tq.TeamId')[_0xa676('0x73')]('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut',_0xa676('0x74'))[_0xa676('0x44')](_0xa676('0x75'),_0x344745[_0xa676('0x59')]['id']);for(var _0x46aa03=0x0;_0x46aa03<_0x5361cb[_0xa676('0x3c')];_0x46aa03+=0x1){let _0x3cb176=_0x5361cb[_0x46aa03];for(var _0x416313=0x0;_0x416313<_0x3cb176[_0xa676('0x67')]['length'];_0x416313+=0x1){let _0x56e0e0=_0x3cb176[_0xa676('0x67')][_0x416313];var _0x293268=_0x260bb5['clone']();_0x293268[_0xa676('0x44')]('ut.UserId\x20=\x20?',_0x56e0e0['id']);_0x32b606[_0xa676('0x76')](db[_0xa676('0x77')][_0xa676('0x38')](_0x293268[_0xa676('0x78')](),{'type':db[_0xa676('0x77')][_0xa676('0x79')]['SELECT']})['then'](function(_0x1d641b){if(_0x1d641b['length']===0x1){return _0x56e0e0['id'];}else{var _0x9c572a=_[_0xa676('0x7a')](_[_0xa676('0x31')](_0x1d641b,'TeamId'),function(_0x8183d6){return _[_0xa676('0x7b')](_0x26ffea,_0x8183d6);});if(_0x9c572a){return _0x56e0e0['id'];}}}));}}return BPromise[_0xa676('0x7c')](_0x32b606)['then'](function(_0x1abe65){_0x50c4ed=_(_0x50c4ed)[_0xa676('0x7d')](_0x1abe65)[_0xa676('0x7e')]()[_0xa676('0x7f')]();return db[_0xa676('0x32')][_0xa676('0x52')]({'where':{'id':_0x344745[_0xa676('0x59')]['id']}})[_0xa676('0x29')](function(_0x145d3c){return db[_0xa676('0x77')][_0xa676('0x6a')](function(_0x48dfe0){return _0x145d3c[_0xa676('0x70')](_0x344745[_0xa676('0x38')][_0xa676('0x66')],{'transaction':_0x48dfe0})[_0xa676('0x29')](function(){if(!_['isEmpty'](_0x50c4ed)){return _0x145d3c[_0xa676('0x80')](_0x50c4ed,{'transaction':_0x48dfe0});}})[_0xa676('0x29')](function(){_0x50c4ed[_0xa676('0x6e')](function(_0x2f5c48){socket[_0xa676('0x6f')](_0xa676('0x81'),{'UserId':_0x2f5c48,'WhatsappQueueId':_0x145d3c['id']});});});});});});})[_0xa676('0x29')](respondWithStatusCode(_0x4a0509,null))['catch'](handleError(_0x4a0509,null));};exports[_0xa676('0x82')]=function(_0x1578d6,_0x2782f6,_0x246298){return db[_0xa676('0x32')][_0xa676('0x52')]({'where':{'id':_0x1578d6['params']['id']}})[_0xa676('0x29')](handleEntityNotFound(_0x2782f6,null))['then'](function(_0x47f302){if(_0x47f302){return _0x47f302[_0xa676('0x82')](_0x1578d6[_0xa676('0x4d')]['ids'],_['omit'](_0x1578d6[_0xa676('0x4d')],[_0xa676('0x66'),'id'])||{})['spread'](function(_0x2511b7){for(var _0x449544=0x0;_0x449544<_0x1578d6['body'][_0xa676('0x66')][_0xa676('0x3c')];_0x449544+=0x1){socket[_0xa676('0x6f')](_0xa676('0x83'),{'UserId':Number(_0x1578d6[_0xa676('0x4d')][_0xa676('0x66')][_0x449544]),'WhatsappQueueId':Number(_0x1578d6[_0xa676('0x59')]['id'])});}return _0x2511b7;});}})['then'](respondWithResult(_0x2782f6,null))['catch'](handleError(_0x2782f6,null));};exports[_0xa676('0x80')]=function(_0x16be5e,_0x448428,_0xd63890){return db[_0xa676('0x32')]['find']({'where':{'id':_0x16be5e[_0xa676('0x59')]['id']}})['then'](handleEntityNotFound(_0x448428,null))[_0xa676('0x29')](function(_0x3bbde5){if(_0x3bbde5){return _0x3bbde5[_0xa676('0x80')](_0x16be5e[_0xa676('0x38')][_0xa676('0x66')])[_0xa676('0x29')](function(){if(_[_0xa676('0x84')](_0x16be5e['query'][_0xa676('0x66')])){for(var _0x3341c6=0x0;_0x3341c6<_0x16be5e[_0xa676('0x38')][_0xa676('0x66')]['length'];_0x3341c6+=0x1){socket[_0xa676('0x6f')]('userWhatsappQueue:remove',{'UserId':Number(_0x16be5e['query'][_0xa676('0x66')][_0x3341c6]),'WhatsappQueueId':Number(_0x16be5e[_0xa676('0x59')]['id'])});}}else{socket[_0xa676('0x6f')](_0xa676('0x81'),{'UserId':Number(_0x16be5e[_0xa676('0x38')]['ids']),'WhatsappQueueId':Number(_0x16be5e[_0xa676('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x448428,null))[_0xa676('0x49')](handleError(_0x448428,null));};exports[_0xa676('0x85')]=function(_0x1fa3f3,_0x1f2eef,_0x2fc3fe){var _0x4b23a6={};var _0x34ad57={};var _0x25b4f1;var _0x9f426b;return db[_0xa676('0x32')][_0xa676('0x58')]({'where':{'id':_0x1fa3f3[_0xa676('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f2eef,null))[_0xa676('0x29')](function(_0x215563){if(_0x215563){_0x25b4f1=_0x215563;_0x34ad57[_0xa676('0x37')]=_[_0xa676('0x4b')](db[_0xa676('0x5b')][_0xa676('0x33')]);_0x34ad57['query']=_[_0xa676('0x4b')](_0x1fa3f3[_0xa676('0x38')]);_0x34ad57['filters']=_['intersection'](_0x34ad57[_0xa676('0x37')],_0x34ad57[_0xa676('0x38')]);_0x4b23a6[_0xa676('0x39')]=_[_0xa676('0x3a')](_0x34ad57[_0xa676('0x37')],qs[_0xa676('0x3b')](_0x1fa3f3[_0xa676('0x38')][_0xa676('0x3b')]));_0x4b23a6[_0xa676('0x39')]=_0x4b23a6[_0xa676('0x39')][_0xa676('0x3c')]?_0x4b23a6[_0xa676('0x39')]:_0x34ad57[_0xa676('0x37')];_0x4b23a6['order']=qs['sort'](_0x1fa3f3[_0xa676('0x38')][_0xa676('0x40')]);_0x4b23a6[_0xa676('0x44')]=qs['filters'](_[_0xa676('0x42')](_0x1fa3f3[_0xa676('0x38')],_0x34ad57['filters']));if(_0x1fa3f3[_0xa676('0x38')]['filter']){_0x4b23a6[_0xa676('0x44')]=_[_0xa676('0x45')](_0x4b23a6[_0xa676('0x44')],{'$or':_[_0xa676('0x31')](_0x4b23a6[_0xa676('0x39')],function(_0x49fe69){var _0x422d02={};_0x422d02[_0x49fe69]={'$like':'%'+_0x1fa3f3[_0xa676('0x38')][_0xa676('0x43')]+'%'};return _0x422d02;})});}_0x4b23a6=_[_0xa676('0x45')]({},_0x4b23a6,_0x1fa3f3[_0xa676('0x46')]);return _0x25b4f1['getAgents'](_0x4b23a6);}})[_0xa676('0x29')](function(_0x389caf){if(_0x389caf){_0x9f426b=_0x389caf[_0xa676('0x3c')];if(!_0x1fa3f3[_0xa676('0x38')][_0xa676('0x3d')](_0xa676('0x3e'))){_0x4b23a6[_0xa676('0x21')]=qs[_0xa676('0x21')](_0x1fa3f3[_0xa676('0x38')][_0xa676('0x21')]);_0x4b23a6[_0xa676('0x20')]=qs[_0xa676('0x20')](_0x1fa3f3[_0xa676('0x38')][_0xa676('0x20')]);}return _0x25b4f1[_0xa676('0x85')](_0x4b23a6);}})[_0xa676('0x29')](function(_0x1d97dc){if(_0x1d97dc){return _0x1d97dc?{'count':_0x9f426b,'rows':_0x1d97dc}:null;}})['then'](respondWithResult(_0x1f2eef,null))[_0xa676('0x49')](handleError(_0x1f2eef,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 666f135..c7d9090 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 _0xa2bb=['WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b8b2b,_0x5baf28){var _0x1a9408=function(_0x567920){while(--_0x567920){_0x4b8b2b['push'](_0x4b8b2b['shift']());}};_0x1a9408(++_0x5baf28);}(_0xa2bb,0x17a));var _0xba2b=function(_0x5c133e,_0x237af1){_0x5c133e=_0x5c133e-0x0;var _0x43056d=_0xa2bb[_0x5c133e];return _0x43056d;};'use strict';var EventEmitter=require(_0xba2b('0x0'));var WhatsappQueue=require(_0xba2b('0x1'))['db'][_0xba2b('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xba2b('0x3')](0x0);var events={'afterCreate':_0xba2b('0x4'),'afterUpdate':_0xba2b('0x5'),'afterDestroy':'remove'};function emitEvent(_0xbb8827){return function(_0x4b29e3,_0x1df5aa,_0x34f6a7){WhatsappQueueEvents[_0xba2b('0x6')](_0xbb8827+':'+_0x4b29e3['id'],_0x4b29e3);WhatsappQueueEvents[_0xba2b('0x6')](_0xbb8827,_0x4b29e3);_0x34f6a7(null);};}for(var e in events){if(events[_0xba2b('0x7')](e)){var event=events[e];WhatsappQueue[_0xba2b('0x8')](e,emitEvent(event));}}module[_0xba2b('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xcc6c=['emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue','update','remove'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xcc6c,0x106));var _0xccc6=function(_0x200a27,_0x3c2a2c){_0x200a27=_0x200a27-0x0;var _0x46749b=_0xcc6c[_0x200a27];return _0x46749b;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xccc6('0x0'))['db'][_0xccc6('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xccc6('0x2'),'afterDestroy':_0xccc6('0x3')};function emitEvent(_0x35aa0d){return function(_0x5ae5f8,_0x322b56,_0xb14582){WhatsappQueueEvents['emit'](_0x35aa0d+':'+_0x5ae5f8['id'],_0x5ae5f8);WhatsappQueueEvents[_0xccc6('0x4')](_0x35aa0d,_0x5ae5f8);_0xb14582(null);};}for(var e in events){if(events[_0xccc6('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xccc6('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 831ba6f..4bd0604 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 _0xe95a=['path','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b506f,_0x36349a){var _0x350cfa=function(_0x4a8012){while(--_0x4a8012){_0x1b506f['push'](_0x1b506f['shift']());}};_0x350cfa(++_0x36349a);}(_0xe95a,0x149));var _0xae95=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xe95a[_0xa8883];return _0x479426;};'use strict';var _=require(_0xae95('0x0'));var util=require(_0xae95('0x1'));var logger=require(_0xae95('0x2'))(_0xae95('0x3'));var moment=require(_0xae95('0x4'));var BPromise=require(_0xae95('0x5'));var rp=require(_0xae95('0x6'));var fs=require('fs');var path=require(_0xae95('0x7'));var rimraf=require(_0xae95('0x8'));var config=require(_0xae95('0x9'));var attributes=require('./whatsappQueue.attributes');module[_0xae95('0xa')]=function(_0x541c53,_0x65f722){return _0x541c53[_0xae95('0xb')](_0xae95('0xc'),attributes,{'tableName':_0xae95('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe18=['../../config/environment','./whatsappQueue.attributes','exports','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x15419d,_0x948be4){var _0x1af53d=function(_0x51fe07){while(--_0x51fe07){_0x15419d['push'](_0x15419d['shift']());}};_0x1af53d(++_0x948be4);}(_0xfe18,0x101));var _0x8fe1=function(_0xd89bb6,_0x296bc9){_0xd89bb6=_0xd89bb6-0x0;var _0x15b345=_0xfe18[_0xd89bb6];return _0x15b345;};'use strict';var _=require(_0x8fe1('0x0'));var util=require(_0x8fe1('0x1'));var logger=require(_0x8fe1('0x2'))('api');var moment=require(_0x8fe1('0x3'));var BPromise=require(_0x8fe1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fe1('0x5'));var rimraf=require(_0x8fe1('0x6'));var config=require(_0x8fe1('0x7'));var attributes=require(_0x8fe1('0x8'));module[_0x8fe1('0x9')]=function(_0x6effb8,_0x18cc14){return _0x6effb8['define']('WhatsappQueue',attributes,{'tableName':_0x8fe1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index c823369..dec3301 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 _0x5938=['WhatsappQueue','options','where','attributes','limit','include','map','model','debug','ShowWhatsappQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue'];(function(_0x562faf,_0x102bcc){var _0x22c1f6=function(_0x2cd3b8){while(--_0x2cd3b8){_0x562faf['push'](_0x562faf['shift']());}};_0x22c1f6(++_0x102bcc);}(_0x5938,0x172));var _0x8593=function(_0x2dc044,_0x4bdf2d){_0x2dc044=_0x2dc044-0x0;var _0x2398cf=_0x5938[_0x2dc044];return _0x2398cf;};'use strict';var _=require(_0x8593('0x0'));var util=require('util');var moment=require(_0x8593('0x1'));var BPromise=require(_0x8593('0x2'));var rs=require(_0x8593('0x3'));var fs=require('fs');var Redis=require(_0x8593('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8593('0x5'))(_0x8593('0x6'));var config=require(_0x8593('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8593('0x8')]({'port':0x232a});config[_0x8593('0x9')]=_[_0x8593('0xa')](config[_0x8593('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8593('0xb'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x8593('0xc')](socket);function respondWithRpcPromise(_0x238f60,_0x4238b4,_0x233544){return new BPromise(function(_0x17f614,_0x5735af){return client[_0x8593('0xd')](_0x238f60,_0x233544)[_0x8593('0xe')](function(_0x89a934){logger[_0x8593('0xf')](_0x8593('0x10'),_0x4238b4,'request\x20sent');logger['debug'](_0x8593('0x11'),_0x4238b4,_0x8593('0x12'),JSON[_0x8593('0x13')](_0x89a934));if(_0x89a934[_0x8593('0x14')]){if(_0x89a934[_0x8593('0x14')][_0x8593('0x15')]===0x1f4){logger[_0x8593('0x14')](_0x8593('0x10'),_0x4238b4,_0x89a934['error'][_0x8593('0x16')]);return _0x5735af(_0x89a934[_0x8593('0x14')]['message']);}logger[_0x8593('0x14')](_0x8593('0x10'),_0x4238b4,_0x89a934[_0x8593('0x14')][_0x8593('0x16')]);return _0x17f614(_0x89a934[_0x8593('0x14')][_0x8593('0x16')]);}else{logger[_0x8593('0xf')](_0x8593('0x10'),_0x4238b4,_0x8593('0x12'));_0x17f614(_0x89a934[_0x8593('0x17')][_0x8593('0x16')]);}})[_0x8593('0x18')](function(_0x269d3f){logger[_0x8593('0x14')](_0x8593('0x10'),_0x4238b4,_0x269d3f);_0x5735af(_0x269d3f);});});}exports[_0x8593('0x19')]=function(_0x5a1bbe){var _0x509f1f=this;return new Promise(function(_0x11ae47,_0x6e0750){return db[_0x8593('0x1a')]['findAll']({'raw':_0x5a1bbe[_0x8593('0x1b')]?_0x5a1bbe[_0x8593('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5a1bbe['options']?_0x5a1bbe[_0x8593('0x1b')][_0x8593('0x1c')]||null:null,'attributes':_0x5a1bbe[_0x8593('0x1b')]?_0x5a1bbe[_0x8593('0x1b')][_0x8593('0x1d')]||null:null,'limit':_0x5a1bbe[_0x8593('0x1b')]?_0x5a1bbe['options'][_0x8593('0x1e')]||null:null,'include':_0x5a1bbe['options']?_0x5a1bbe[_0x8593('0x1b')][_0x8593('0x1f')]?_[_0x8593('0x20')](_0x5a1bbe['options'][_0x8593('0x1f')],function(_0x1f7566){return{'model':db[_0x1f7566['model']],'as':_0x1f7566['as'],'attributes':_0x1f7566[_0x8593('0x1d')],'include':_0x1f7566[_0x8593('0x1f')]?_[_0x8593('0x20')](_0x1f7566[_0x8593('0x1f')],function(_0x2a2f25){return{'model':db[_0x2a2f25[_0x8593('0x21')]],'as':_0x2a2f25['as'],'attributes':_0x2a2f25[_0x8593('0x1d')],'include':_0x2a2f25[_0x8593('0x1f')]?_[_0x8593('0x20')](_0x2a2f25[_0x8593('0x1f')],function(_0x553b22){return{'model':db[_0x553b22[_0x8593('0x21')]],'as':_0x553b22['as'],'attributes':_0x553b22[_0x8593('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8593('0xe')](function(_0x2371a8){logger['info'](_0x8593('0x19'),_0x5a1bbe);logger[_0x8593('0x22')](_0x8593('0x19'),_0x5a1bbe,JSON[_0x8593('0x13')](_0x2371a8));_0x11ae47(_0x2371a8);})[_0x8593('0x18')](function(_0x1b2ff1){logger['error'](_0x8593('0x19'),_0x1b2ff1[_0x8593('0x16')],_0x5a1bbe);_0x6e0750(_0x509f1f['error'](0x1f4,_0x1b2ff1[_0x8593('0x16')]));});});};exports[_0x8593('0x23')]=function(_0x27e8b6){var _0xa50cb0=this;return new Promise(function(_0x34c187,_0x2d7754){return db['WhatsappQueue']['find']({'raw':_0x27e8b6[_0x8593('0x1b')]?_0x27e8b6[_0x8593('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x27e8b6[_0x8593('0x1b')]?_0x27e8b6[_0x8593('0x1b')][_0x8593('0x1c')]||null:null,'attributes':_0x27e8b6[_0x8593('0x1b')]?_0x27e8b6[_0x8593('0x1b')][_0x8593('0x1d')]||null:null,'include':_0x27e8b6[_0x8593('0x1b')]?_0x27e8b6[_0x8593('0x1b')][_0x8593('0x1f')]?_['map'](_0x27e8b6['options'][_0x8593('0x1f')],function(_0x47d77c){return{'model':db[_0x47d77c[_0x8593('0x21')]],'as':_0x47d77c['as'],'attributes':_0x47d77c[_0x8593('0x1d')],'include':_0x47d77c[_0x8593('0x1f')]?_['map'](_0x47d77c['include'],function(_0x596fc8){return{'model':db[_0x596fc8[_0x8593('0x21')]],'as':_0x596fc8['as'],'attributes':_0x596fc8[_0x8593('0x1d')],'include':_0x596fc8[_0x8593('0x1f')]?_['map'](_0x596fc8[_0x8593('0x1f')],function(_0x57dfba){return{'model':db[_0x57dfba[_0x8593('0x21')]],'as':_0x57dfba['as'],'attributes':_0x57dfba[_0x8593('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x336326){logger[_0x8593('0xf')](_0x8593('0x23'),_0x27e8b6);logger[_0x8593('0x22')](_0x8593('0x23'),_0x27e8b6,JSON[_0x8593('0x13')](_0x336326));_0x34c187(_0x336326);})[_0x8593('0x18')](function(_0x581e40){logger[_0x8593('0x14')](_0x8593('0x23'),_0x581e40[_0x8593('0x16')],_0x27e8b6);_0x2d7754(_0xa50cb0[_0x8593('0x14')](0x1f4,_0x581e40[_0x8593('0x16')]));});});}; \ No newline at end of file +var _0x65bd=['WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','model','map','ShowWhatsappQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x42a281,_0x1b15e2){var _0x49a7c7=function(_0x2cf0d3){while(--_0x2cf0d3){_0x42a281['push'](_0x42a281['shift']());}};_0x49a7c7(++_0x1b15e2);}(_0x65bd,0x11c));var _0xd65b=function(_0x414aa7,_0x49e107){_0x414aa7=_0x414aa7-0x0;var _0xfaa89c=_0x65bd[_0x414aa7];return _0xfaa89c;};'use strict';var _=require(_0xd65b('0x0'));var util=require(_0xd65b('0x1'));var moment=require(_0xd65b('0x2'));var BPromise=require(_0xd65b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd65b('0x4'));var db=require(_0xd65b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd65b('0x6'))(_0xd65b('0x7'));var config=require(_0xd65b('0x8'));var jayson=require(_0xd65b('0x9'));var client=jayson['client'][_0xd65b('0xa')]({'port':0x232a});config[_0xd65b('0xb')]=_[_0xd65b('0xc')](config[_0xd65b('0xb')],{'host':_0xd65b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd65b('0xb')]));require('./whatsappQueue.socket')[_0xd65b('0xe')](socket);function respondWithRpcPromise(_0x2a649a,_0x88713b,_0x1fbee8){return new BPromise(function(_0x3205c4,_0x1fdfec){return client[_0xd65b('0xf')](_0x2a649a,_0x1fbee8)[_0xd65b('0x10')](function(_0x47323a){logger[_0xd65b('0x11')](_0xd65b('0x12'),_0x88713b,_0xd65b('0x13'));logger['debug'](_0xd65b('0x14'),_0x88713b,_0xd65b('0x13'),JSON[_0xd65b('0x15')](_0x47323a));if(_0x47323a[_0xd65b('0x16')]){if(_0x47323a[_0xd65b('0x16')][_0xd65b('0x17')]===0x1f4){logger[_0xd65b('0x16')](_0xd65b('0x12'),_0x88713b,_0x47323a[_0xd65b('0x16')][_0xd65b('0x18')]);return _0x1fdfec(_0x47323a[_0xd65b('0x16')][_0xd65b('0x18')]);}logger[_0xd65b('0x16')](_0xd65b('0x12'),_0x88713b,_0x47323a['error'][_0xd65b('0x18')]);return _0x3205c4(_0x47323a['error'][_0xd65b('0x18')]);}else{logger['info'](_0xd65b('0x12'),_0x88713b,_0xd65b('0x13'));_0x3205c4(_0x47323a['result']['message']);}})[_0xd65b('0x19')](function(_0x5001d8){logger[_0xd65b('0x16')](_0xd65b('0x12'),_0x88713b,_0x5001d8);_0x1fdfec(_0x5001d8);});});}exports[_0xd65b('0x1a')]=function(_0x569829){var _0x300e1b=this;return new Promise(function(_0x2de703,_0x49f348){return db[_0xd65b('0x1b')]['findAll']({'raw':_0x569829[_0xd65b('0x1c')]?_0x569829['options'][_0xd65b('0x1d')]===undefined?!![]:![]:!![],'where':_0x569829['options']?_0x569829['options'][_0xd65b('0x1e')]||null:null,'attributes':_0x569829[_0xd65b('0x1c')]?_0x569829[_0xd65b('0x1c')][_0xd65b('0x1f')]||null:null,'limit':_0x569829[_0xd65b('0x1c')]?_0x569829['options'][_0xd65b('0x20')]||null:null,'include':_0x569829['options']?_0x569829[_0xd65b('0x1c')][_0xd65b('0x21')]?_['map'](_0x569829['options'][_0xd65b('0x21')],function(_0x59b8e4){return{'model':db[_0x59b8e4[_0xd65b('0x22')]],'as':_0x59b8e4['as'],'attributes':_0x59b8e4[_0xd65b('0x1f')],'include':_0x59b8e4[_0xd65b('0x21')]?_[_0xd65b('0x23')](_0x59b8e4['include'],function(_0x226178){return{'model':db[_0x226178[_0xd65b('0x22')]],'as':_0x226178['as'],'attributes':_0x226178['attributes'],'include':_0x226178[_0xd65b('0x21')]?_['map'](_0x226178[_0xd65b('0x21')],function(_0x4bf5dc){return{'model':db[_0x4bf5dc['model']],'as':_0x4bf5dc['as'],'attributes':_0x4bf5dc[_0xd65b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd65b('0x10')](function(_0x389895){logger[_0xd65b('0x11')]('GetWhatsappQueue',_0x569829);logger['debug'](_0xd65b('0x1a'),_0x569829,JSON[_0xd65b('0x15')](_0x389895));_0x2de703(_0x389895);})[_0xd65b('0x19')](function(_0x2d8986){logger['error'](_0xd65b('0x1a'),_0x2d8986[_0xd65b('0x18')],_0x569829);_0x49f348(_0x300e1b['error'](0x1f4,_0x2d8986[_0xd65b('0x18')]));});});};exports[_0xd65b('0x24')]=function(_0x1d5295){var _0x168a60=this;return new Promise(function(_0x9d59e7,_0x9e0426){return db[_0xd65b('0x1b')][_0xd65b('0x25')]({'raw':_0x1d5295[_0xd65b('0x1c')]?_0x1d5295[_0xd65b('0x1c')][_0xd65b('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d5295[_0xd65b('0x1c')]?_0x1d5295[_0xd65b('0x1c')][_0xd65b('0x1e')]||null:null,'attributes':_0x1d5295['options']?_0x1d5295[_0xd65b('0x1c')]['attributes']||null:null,'include':_0x1d5295[_0xd65b('0x1c')]?_0x1d5295['options'][_0xd65b('0x21')]?_['map'](_0x1d5295['options'][_0xd65b('0x21')],function(_0x38f1b8){return{'model':db[_0x38f1b8['model']],'as':_0x38f1b8['as'],'attributes':_0x38f1b8['attributes'],'include':_0x38f1b8[_0xd65b('0x21')]?_[_0xd65b('0x23')](_0x38f1b8['include'],function(_0x4ba3da){return{'model':db[_0x4ba3da[_0xd65b('0x22')]],'as':_0x4ba3da['as'],'attributes':_0x4ba3da[_0xd65b('0x1f')],'include':_0x4ba3da[_0xd65b('0x21')]?_[_0xd65b('0x23')](_0x4ba3da[_0xd65b('0x21')],function(_0x10250e){return{'model':db[_0x10250e[_0xd65b('0x22')]],'as':_0x10250e['as'],'attributes':_0x10250e[_0xd65b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd65b('0x10')](function(_0x3a6f1c){logger[_0xd65b('0x11')]('ShowWhatsappQueue',_0x1d5295);logger['debug'](_0xd65b('0x24'),_0x1d5295,JSON[_0xd65b('0x15')](_0x3a6f1c));_0x9d59e7(_0x3a6f1c);})['catch'](function(_0x47f1c2){logger[_0xd65b('0x16')](_0xd65b('0x24'),_0x47f1c2[_0xd65b('0x18')],_0x1d5295);_0x9e0426(_0x168a60[_0xd65b('0x16')](0x1f4,_0x47f1c2[_0xd65b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index dde46d6..8b89b58 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 _0x1c02=['register','length','whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener'];(function(_0x210e0f,_0x2e40f7){var _0x2fa362=function(_0x2e3e74){while(--_0x2e3e74){_0x210e0f['push'](_0x210e0f['shift']());}};_0x2fa362(++_0x2e40f7);}(_0x1c02,0x1e3));var _0x21c0=function(_0x1cd65c,_0x4fcead){_0x1cd65c=_0x1cd65c-0x0;var _0x59c529=_0x1c02[_0x1cd65c];return _0x59c529;};'use strict';var WhatsappQueueEvents=require(_0x21c0('0x0'));var events=['save',_0x21c0('0x1'),_0x21c0('0x2')];function createListener(_0x5674c9,_0x48616f){return function(_0x16152f){_0x48616f[_0x21c0('0x3')](_0x5674c9,_0x16152f);};}function removeListener(_0x34386e,_0x60aefc){return function(){WhatsappQueueEvents[_0x21c0('0x4')](_0x34386e,_0x60aefc);};}exports[_0x21c0('0x5')]=function(_0x4471aa){for(var _0x47b344=0x0,_0x474fd6=events[_0x21c0('0x6')];_0x47b344<_0x474fd6;_0x47b344++){var _0x5c14d2=events[_0x47b344];var _0x418d13=createListener(_0x21c0('0x7')+_0x5c14d2,_0x4471aa);WhatsappQueueEvents['on'](_0x5c14d2,_0x418d13);}}; \ No newline at end of file +var _0x10d9=['remove','update','emit','removeListener','register','save'];(function(_0x428711,_0x257da7){var _0x414110=function(_0x4335fa){while(--_0x4335fa){_0x428711['push'](_0x428711['shift']());}};_0x414110(++_0x257da7);}(_0x10d9,0xa7));var _0x910d=function(_0x81e8ea,_0x474dce){_0x81e8ea=_0x81e8ea-0x0;var _0x2c0444=_0x10d9[_0x81e8ea];return _0x2c0444;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x910d('0x0'),_0x910d('0x1'),_0x910d('0x2')];function createListener(_0x3857e5,_0x51e8fe){return function(_0xfd6d6b){_0x51e8fe[_0x910d('0x3')](_0x3857e5,_0xfd6d6b);};}function removeListener(_0x37de7d,_0x117dba){return function(){WhatsappQueueEvents[_0x910d('0x4')](_0x37de7d,_0x117dba);};}exports[_0x910d('0x5')]=function(_0x855ffc){for(var _0x3651fa=0x0,_0x3cf6e2=events['length'];_0x3651fa<_0x3cf6e2;_0x3651fa++){var _0x204de1=events[_0x3651fa];var _0x23fc81=createListener('whatsappQueue:'+_0x204de1,_0x855ffc);WhatsappQueueEvents['on'](_0x204de1,_0x23fc81);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 47b7477..f952521 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 _0x29a2=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','delete','destroy','util','connect-timeout'];(function(_0x3970e5,_0xfea9be){var _0x2c9616=function(_0x9e835a){while(--_0x9e835a){_0x3970e5['push'](_0x3970e5['shift']());}};_0x2c9616(++_0xfea9be);}(_0x29a2,0x18d));var _0x229a=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x29a2[_0x68ee8b];return _0x5148f7;};'use strict';var multer=require('multer');var util=require(_0x229a('0x0'));var path=require('path');var timeout=require(_0x229a('0x1'));var express=require(_0x229a('0x2'));var router=express[_0x229a('0x3')]();var fs_extra=require(_0x229a('0x4'));var auth=require(_0x229a('0x5'));var interaction=require(_0x229a('0x6'));var config=require('../../config/environment');var controller=require(_0x229a('0x7'));router[_0x229a('0x8')]('/',auth[_0x229a('0x9')](),controller[_0x229a('0xa')]);router[_0x229a('0x8')](_0x229a('0xb'),auth['isAuthenticated'](),controller[_0x229a('0xc')]);router[_0x229a('0x8')]('/:id',auth[_0x229a('0x9')](),controller[_0x229a('0xd')]);router[_0x229a('0xe')]('/',auth[_0x229a('0x9')](),controller['create']);router[_0x229a('0xf')](_0x229a('0x10'),auth[_0x229a('0x9')](),controller['update']);router[_0x229a('0x11')](_0x229a('0x10'),auth[_0x229a('0x9')](),controller[_0x229a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x32c0=['show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x3d1d30,_0x31f82a){var _0x2bb0c2=function(_0x25cdbe){while(--_0x25cdbe){_0x3d1d30['push'](_0x3d1d30['shift']());}};_0x2bb0c2(++_0x31f82a);}(_0x32c0,0xe3));var _0x032c=function(_0x1819ba,_0x489d90){_0x1819ba=_0x1819ba-0x0;var _0x46c406=_0x32c0[_0x1819ba];return _0x46c406;};'use strict';var multer=require(_0x032c('0x0'));var util=require(_0x032c('0x1'));var path=require(_0x032c('0x2'));var timeout=require('connect-timeout');var express=require(_0x032c('0x3'));var router=express[_0x032c('0x4')]();var fs_extra=require(_0x032c('0x5'));var auth=require(_0x032c('0x6'));var interaction=require(_0x032c('0x7'));var config=require(_0x032c('0x8'));var controller=require(_0x032c('0x9'));router[_0x032c('0xa')]('/',auth[_0x032c('0xb')](),controller['index']);router[_0x032c('0xa')](_0x032c('0xc'),auth[_0x032c('0xb')](),controller[_0x032c('0xd')]);router[_0x032c('0xa')](_0x032c('0xe'),auth[_0x032c('0xb')](),controller[_0x032c('0xf')]);router[_0x032c('0x10')]('/',auth[_0x032c('0xb')](),controller[_0x032c('0x11')]);router[_0x032c('0x12')]('/:id',auth[_0x032c('0xb')](),controller['update']);router[_0x032c('0x13')](_0x032c('0xe'),auth[_0x032c('0xb')](),controller[_0x032c('0x14')]);module[_0x032c('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index c873f73..1212155 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(_0x486171,_0x554e25){var _0x43d0f1=function(_0x10ccbc){while(--_0x10ccbc){_0x486171['push'](_0x486171['shift']());}};_0x43d0f1(++_0x554e25);}(_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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1413dd,_0x1bc4a4){var _0x703f46=function(_0x396511){while(--_0x396511){_0x1413dd['push'](_0x1413dd['shift']());}};_0x703f46(++_0x1bc4a4);}(_0x7a54,0x106));var _0x47a5=function(_0x4fbc77,_0x4da216){_0x4fbc77=_0x4fbc77-0x0;var _0x5b3e4a=_0x7a54[_0x4fbc77];return _0x5b3e4a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 1689325..5bff93b 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 _0xf4f4=['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','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','length','find','create','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x36cb4d,_0x2dc7aa){var _0x35ca7c=function(_0x3e8fbf){while(--_0x3e8fbf){_0x36cb4d['push'](_0x36cb4d['shift']());}};_0x35ca7c(++_0x2dc7aa);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x28635a,_0xa51d49){_0x28635a=_0x28635a-0x0;var _0x2e8c5b=_0xf4f4[_0x28635a];return _0x2e8c5b;};'use strict';var emlformat=require(_0x4f4f('0x0'));var rimraf=require(_0x4f4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f4f('0x2'));var rp=require(_0x4f4f('0x3'));var moment=require(_0x4f4f('0x4'));var BPromise=require(_0x4f4f('0x5'));var Mustache=require(_0x4f4f('0x6'));var util=require('util');var path=require(_0x4f4f('0x7'));var sox=require('sox');var csv=require(_0x4f4f('0x8'));var ejs=require(_0x4f4f('0x9'));var fs=require('fs');var fs_extra=require(_0x4f4f('0xa'));var _=require(_0x4f4f('0xb'));var squel=require(_0x4f4f('0xc'));var crypto=require(_0x4f4f('0xd'));var jsforce=require(_0x4f4f('0xe'));var deskjs=require(_0x4f4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f4f('0x10'));var Papa=require(_0x4f4f('0x11'));var Redis=require(_0x4f4f('0x12'));var authService=require(_0x4f4f('0x13'));var qs=require(_0x4f4f('0x14'));var as=require(_0x4f4f('0x15'));var hardwareService=require(_0x4f4f('0x16'));var logger=require(_0x4f4f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4f4f('0x18'));var licenseUtil=require(_0x4f4f('0x19'));var db=require(_0x4f4f('0x1a'))['db'];function respondWithStatusCode(_0x1b54b0,_0x282031){_0x282031=_0x282031||0xcc;return function(_0x1d7575){if(_0x1d7575){return _0x1b54b0['sendStatus'](_0x282031);}return _0x1b54b0[_0x4f4f('0x1b')](_0x282031)['end']();};}function respondWithResult(_0x216ba8,_0xe7c2d5){_0xe7c2d5=_0xe7c2d5||0xc8;return function(_0x3e16e9){if(_0x3e16e9){return _0x216ba8[_0x4f4f('0x1b')](_0xe7c2d5)['json'](_0x3e16e9);}};}function respondWithFilteredResult(_0x19f2fd,_0x4c68f4){return function(_0x47ab66){if(_0x47ab66){var _0x58de77=typeof _0x4c68f4[_0x4f4f('0x1c')]===_0x4f4f('0x1d')&&typeof _0x4c68f4[_0x4f4f('0x1e')]===_0x4f4f('0x1d');var _0x2d5e5d=_0x47ab66[_0x4f4f('0x1f')];var _0x1245c4=_0x58de77?0x0:_0x4c68f4[_0x4f4f('0x1c')];var _0x929a0b=_0x58de77?_0x47ab66[_0x4f4f('0x1f')]:_0x4c68f4[_0x4f4f('0x1c')]+_0x4c68f4[_0x4f4f('0x1e')];var _0x499277;if(_0x929a0b>=_0x2d5e5d){_0x929a0b=_0x2d5e5d;_0x499277=0xc8;}else{_0x499277=0xce;}_0x19f2fd[_0x4f4f('0x1b')](_0x499277);return _0x19f2fd[_0x4f4f('0x20')](_0x4f4f('0x21'),_0x1245c4+'-'+_0x929a0b+'/'+_0x2d5e5d)[_0x4f4f('0x22')](_0x47ab66);}return null;};}function patchUpdates(_0x302a79){return function(_0x460b4d){try{jsonpatch[_0x4f4f('0x23')](_0x460b4d,_0x302a79,!![]);}catch(_0x3e33d5){return BPromise[_0x4f4f('0x24')](_0x3e33d5);}return _0x460b4d[_0x4f4f('0x25')]();};}function saveUpdates(_0x469a1d,_0x17832f){return function(_0x17984d){if(_0x17984d){return _0x17984d[_0x4f4f('0x26')](_0x469a1d)['then'](function(_0x4f7261){return _0x4f7261;});}return null;};}function removeEntity(_0x525529,_0x272125){return function(_0x43e661){if(_0x43e661){return _0x43e661['destroy']()[_0x4f4f('0x27')](function(){_0x525529[_0x4f4f('0x1b')](0xcc)[_0x4f4f('0x28')]();});}};}function handleEntityNotFound(_0x2ec92a,_0x113ff7){return function(_0x31b30e){if(!_0x31b30e){_0x2ec92a[_0x4f4f('0x29')](0x194);}return _0x31b30e;};}function handleError(_0x50a8ce,_0x39fb9f){_0x39fb9f=_0x39fb9f||0x1f4;return function(_0x237cf9){logger[_0x4f4f('0x2a')](_0x237cf9[_0x4f4f('0x2b')]);if(_0x237cf9[_0x4f4f('0x2c')]){delete _0x237cf9['name'];}_0x50a8ce[_0x4f4f('0x1b')](_0x39fb9f)[_0x4f4f('0x2d')](_0x237cf9);};}exports[_0x4f4f('0x2e')]=function(_0x5deda9,_0x534075){var _0x4c2490={},_0x73b8bb={},_0x5b4f6a={'count':0x0,'rows':[]};var _0x354266=_[_0x4f4f('0x2f')](db[_0x4f4f('0x30')]['rawAttributes'],function(_0x460546){return{'name':_0x460546[_0x4f4f('0x31')],'type':_0x460546['type'][_0x4f4f('0x32')]};});_0x73b8bb[_0x4f4f('0x33')]=_[_0x4f4f('0x2f')](_0x354266,'name');_0x73b8bb[_0x4f4f('0x34')]=_[_0x4f4f('0x35')](_0x5deda9['query']);_0x73b8bb['filters']=_[_0x4f4f('0x36')](_0x73b8bb[_0x4f4f('0x33')],_0x73b8bb[_0x4f4f('0x34')]);_0x4c2490[_0x4f4f('0x37')]=_[_0x4f4f('0x36')](_0x73b8bb[_0x4f4f('0x33')],qs[_0x4f4f('0x38')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x38')]));_0x4c2490[_0x4f4f('0x37')]=_0x4c2490['attributes']['length']?_0x4c2490[_0x4f4f('0x37')]:_0x73b8bb['model'];if(!_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x39')](_0x4f4f('0x3a'))){_0x4c2490[_0x4f4f('0x1e')]=qs[_0x4f4f('0x1e')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x1e')]);_0x4c2490[_0x4f4f('0x1c')]=qs[_0x4f4f('0x1c')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x1c')]);}_0x4c2490[_0x4f4f('0x3b')]=qs['sort'](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x3c')]);_0x4c2490[_0x4f4f('0x3d')]=qs[_0x4f4f('0x3e')](_[_0x4f4f('0x3f')](_0x5deda9[_0x4f4f('0x34')],_0x73b8bb[_0x4f4f('0x3e')]),_0x354266);if(_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x40')]){_0x4c2490['where']=_[_0x4f4f('0x41')](_0x4c2490[_0x4f4f('0x3d')],{'$or':_[_0x4f4f('0x2f')](_0x354266,function(_0x5eb174){if(_0x5eb174['type']!==_0x4f4f('0x42')){var _0x95a296={};_0x95a296[_0x5eb174[_0x4f4f('0x2c')]]={'$like':'%'+_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x40')]+'%'};return _0x95a296;}})});}_0x4c2490=_[_0x4f4f('0x41')]({},_0x4c2490,_0x5deda9[_0x4f4f('0x43')]);var _0x1ff7f3={'where':_0x4c2490[_0x4f4f('0x3d')]};return db[_0x4f4f('0x30')][_0x4f4f('0x1f')](_0x1ff7f3)[_0x4f4f('0x27')](function(_0x4e352e){_0x5b4f6a[_0x4f4f('0x1f')]=_0x4e352e;if(_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x44')]){_0x4c2490[_0x4f4f('0x45')]=[{'all':!![]}];}return db[_0x4f4f('0x30')]['findAll'](_0x4c2490);})['then'](function(_0x134710){_0x5b4f6a[_0x4f4f('0x46')]=_0x134710;return _0x5b4f6a;})[_0x4f4f('0x27')](respondWithFilteredResult(_0x534075,_0x4c2490))[_0x4f4f('0x47')](handleError(_0x534075,null));};exports['show']=function(_0x1aaf2c,_0x480919){var _0x10de24={'raw':!![],'where':{'id':_0x1aaf2c['params']['id']}},_0x5a7c94={};_0x5a7c94[_0x4f4f('0x33')]=_['keys'](db[_0x4f4f('0x30')][_0x4f4f('0x48')]);_0x5a7c94['query']=_[_0x4f4f('0x35')](_0x1aaf2c[_0x4f4f('0x34')]);_0x5a7c94['filters']=_[_0x4f4f('0x36')](_0x5a7c94[_0x4f4f('0x33')],_0x5a7c94[_0x4f4f('0x34')]);_0x10de24[_0x4f4f('0x37')]=_[_0x4f4f('0x36')](_0x5a7c94[_0x4f4f('0x33')],qs[_0x4f4f('0x38')](_0x1aaf2c[_0x4f4f('0x34')][_0x4f4f('0x38')]));_0x10de24[_0x4f4f('0x37')]=_0x10de24[_0x4f4f('0x37')][_0x4f4f('0x49')]?_0x10de24[_0x4f4f('0x37')]:_0x5a7c94[_0x4f4f('0x33')];if(_0x1aaf2c[_0x4f4f('0x34')]['includeAll']){_0x10de24[_0x4f4f('0x45')]=[{'all':!![]}];}_0x10de24=_['merge']({},_0x10de24,_0x1aaf2c['options']);return db[_0x4f4f('0x30')][_0x4f4f('0x4a')](_0x10de24)['then'](handleEntityNotFound(_0x480919,null))[_0x4f4f('0x27')](respondWithResult(_0x480919,null))[_0x4f4f('0x47')](handleError(_0x480919,null));};exports[_0x4f4f('0x4b')]=function(_0x2721b5,_0x222511){return db['WhatsappQueueReport'][_0x4f4f('0x4b')](_0x2721b5[_0x4f4f('0x4c')],{})[_0x4f4f('0x27')](respondWithResult(_0x222511,0xc9))[_0x4f4f('0x47')](handleError(_0x222511,null));};exports[_0x4f4f('0x26')]=function(_0x433787,_0x29314b){if(_0x433787[_0x4f4f('0x4c')]['id']){delete _0x433787[_0x4f4f('0x4c')]['id'];}return db['WhatsappQueueReport'][_0x4f4f('0x4a')]({'where':{'id':_0x433787[_0x4f4f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29314b,null))['then'](saveUpdates(_0x433787['body'],null))[_0x4f4f('0x27')](respondWithResult(_0x29314b,null))[_0x4f4f('0x47')](handleError(_0x29314b,null));};exports[_0x4f4f('0x4e')]=function(_0x5c5077,_0x389ec6){return db['WhatsappQueueReport'][_0x4f4f('0x4a')]({'where':{'id':_0x5c5077[_0x4f4f('0x4d')]['id']}})[_0x4f4f('0x27')](handleEntityNotFound(_0x389ec6,null))[_0x4f4f('0x27')](removeEntity(_0x389ec6,null))[_0x4f4f('0x47')](handleError(_0x389ec6,null));};exports[_0x4f4f('0x4f')]=function(_0x21408b,_0x88054a){return db[_0x4f4f('0x30')]['describe']()['then'](respondWithResult(_0x88054a,null))[_0x4f4f('0x47')](handleError(_0x88054a,null));}; \ No newline at end of file +var _0xb10b=['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','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','WhatsappQueueReport','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir'];(function(_0x2c9c63,_0x3eb1ca){var _0xb6978e=function(_0x19c425){while(--_0x19c425){_0x2c9c63['push'](_0x2c9c63['shift']());}};_0xb6978e(++_0x3eb1ca);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ef11c,_0x387510){_0x4ef11c=_0x4ef11c-0x0;var _0x1c3026=_0xb10b[_0x4ef11c];return _0x1c3026;};'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['WhatsappQueueReport'][_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')]=[{'all':!![]}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x1c7fae){_0x2e0249[_0xbb10('0x43')]=_0x1c7fae;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x44')]=function(_0x331751,_0x23dc18){var _0x403beb={'raw':!![],'where':{'id':_0x331751[_0xbb10('0x45')]['id']}},_0x5e2cfa={};_0x5e2cfa[_0xbb10('0x2f')]=_['keys'](db['WhatsappQueueReport'][_0xbb10('0x2c')]);_0x5e2cfa['query']=_[_0xbb10('0x30')](_0x331751[_0xbb10('0x31')]);_0x5e2cfa['filters']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],_0x5e2cfa[_0xbb10('0x31')]);_0x403beb['attributes']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x331751[_0xbb10('0x31')][_0xbb10('0x34')]));_0x403beb[_0xbb10('0x33')]=_0x403beb[_0xbb10('0x33')][_0xbb10('0x35')]?_0x403beb[_0xbb10('0x33')]:_0x5e2cfa[_0xbb10('0x2f')];if(_0x331751[_0xbb10('0x31')][_0xbb10('0x41')]){_0x403beb['include']=[{'all':!![]}];}_0x403beb=_[_0xbb10('0x3e')]({},_0x403beb,_0x331751[_0xbb10('0x3f')]);return db['WhatsappQueueReport'][_0xbb10('0x46')](_0x403beb)[_0xbb10('0x23')](handleEntityNotFound(_0x23dc18,null))[_0xbb10('0x23')](respondWithResult(_0x23dc18,null))[_0xbb10('0x47')](handleError(_0x23dc18,null));};exports[_0xbb10('0x48')]=function(_0x39f0de,_0x3e06b0){return db['WhatsappQueueReport']['create'](_0x39f0de[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x3e06b0,0xc9))[_0xbb10('0x47')](handleError(_0x3e06b0,null));};exports['update']=function(_0x5f0c12,_0x3cd6f3){if(_0x5f0c12[_0xbb10('0x49')]['id']){delete _0x5f0c12[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x5f0c12[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x23')](saveUpdates(_0x5f0c12[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,null))['catch'](handleError(_0x3cd6f3,null));};exports['destroy']=function(_0x412e13,_0x467dba){return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x412e13[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x467dba,null))[_0xbb10('0x23')](removeEntity(_0x467dba,null))[_0xbb10('0x47')](handleError(_0x467dba,null));};exports[_0xbb10('0x4a')]=function(_0x1214f7,_0x19ca3e){return db[_0xbb10('0x40')][_0xbb10('0x4a')]()[_0xbb10('0x23')](respondWithResult(_0x19ca3e,null))[_0xbb10('0x47')](handleError(_0x19ca3e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 91a8c4c..7889337 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 _0xfe73=['moment','request-promise','rimraf','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x532aa1,_0x2bf907){var _0x929040=function(_0x3e5880){while(--_0x3e5880){_0x532aa1['push'](_0x532aa1['shift']());}};_0x929040(++_0x2bf907);}(_0xfe73,0x64));var _0x3fe7=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xfe73[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x3fe7('0x0'));var util=require(_0x3fe7('0x1'));var logger=require(_0x3fe7('0x2'))(_0x3fe7('0x3'));var moment=require(_0x3fe7('0x4'));var BPromise=require('bluebird');var rp=require(_0x3fe7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3fe7('0x6'));var config=require('../../config/environment');var attributes=require(_0x3fe7('0x7'));module[_0x3fe7('0x8')]=function(_0x100c9c,_0x589804){return _0x100c9c[_0x3fe7('0x9')](_0x3fe7('0xa'),attributes,{'tableName':_0x3fe7('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3fe7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d3e=['api','moment','bluebird','request-promise','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','uniqueid','lodash','util'];(function(_0x32bb12,_0x1baa09){var _0x1af866=function(_0x173d13){while(--_0x173d13){_0x32bb12['push'](_0x32bb12['shift']());}};_0x1af866(++_0x1baa09);}(_0x5d3e,0xbc));var _0xe5d3=function(_0x592189,_0x55342c){_0x592189=_0x592189-0x0;var _0x312aa8=_0x5d3e[_0x592189];return _0x312aa8;};'use strict';var _=require(_0xe5d3('0x0'));var util=require(_0xe5d3('0x1'));var logger=require('../../config/logger')(_0xe5d3('0x2'));var moment=require(_0xe5d3('0x3'));var BPromise=require(_0xe5d3('0x4'));var rp=require(_0xe5d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe5d3('0x6'));module[_0xe5d3('0x7')]=function(_0x4f829f,_0x316b45){return _0x4f829f['define'](_0xe5d3('0x8'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xe5d3('0x9'),'fields':[_0xe5d3('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 81e5cd0..bbc38a6 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 _0x6ce5=['jayson/promise','client','http','request','then','info','debug','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','request\x20sent','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x33be75,_0xe5379){var _0x11bbbc=function(_0x5456a8){while(--_0x5456a8){_0x33be75['push'](_0x33be75['shift']());}};_0x11bbbc(++_0xe5379);}(_0x6ce5,0xff));var _0x56ce=function(_0x2ebdc5,_0x3c111c){_0x2ebdc5=_0x2ebdc5-0x0;var _0x236fdc=_0x6ce5[_0x2ebdc5];return _0x236fdc;};'use strict';var _=require(_0x56ce('0x0'));var util=require(_0x56ce('0x1'));var moment=require(_0x56ce('0x2'));var BPromise=require('bluebird');var rs=require(_0x56ce('0x3'));var fs=require('fs');var Redis=require(_0x56ce('0x4'));var db=require(_0x56ce('0x5'))['db'];var utils=require(_0x56ce('0x6'));var logger=require('../../config/logger')(_0x56ce('0x7'));var config=require(_0x56ce('0x8'));var jayson=require(_0x56ce('0x9'));var client=jayson[_0x56ce('0xa')][_0x56ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4908c3,_0x167ef9,_0x15ae04){return new BPromise(function(_0x546c31,_0x3ff7ff){return client[_0x56ce('0xc')](_0x4908c3,_0x15ae04)[_0x56ce('0xd')](function(_0x56a82f){logger[_0x56ce('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x167ef9,'request\x20sent');logger[_0x56ce('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x167ef9,'request\x20sent',JSON[_0x56ce('0x10')](_0x56a82f));if(_0x56a82f[_0x56ce('0x11')]){if(_0x56a82f[_0x56ce('0x11')][_0x56ce('0x12')]===0x1f4){logger['error'](_0x56ce('0x13'),_0x167ef9,_0x56a82f[_0x56ce('0x11')]['message']);return _0x3ff7ff(_0x56a82f['error'][_0x56ce('0x14')]);}logger[_0x56ce('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x167ef9,_0x56a82f[_0x56ce('0x11')][_0x56ce('0x14')]);return _0x546c31(_0x56a82f[_0x56ce('0x11')]['message']);}else{logger[_0x56ce('0xe')](_0x56ce('0x13'),_0x167ef9,_0x56ce('0x15'));_0x546c31(_0x56a82f['result']['message']);}})[_0x56ce('0x16')](function(_0x10b0b2){logger[_0x56ce('0x11')](_0x56ce('0x13'),_0x167ef9,_0x10b0b2);_0x3ff7ff(_0x10b0b2);});});}exports['CreateWhatsappQueueReport']=function(_0x2c83f5){var _0x2cd352=this;return new Promise(function(_0x43d876,_0x365f99){return db[_0x56ce('0x17')][_0x56ce('0x18')](_0x2c83f5[_0x56ce('0x19')],{'raw':_0x2c83f5[_0x56ce('0x1a')]?_0x2c83f5[_0x56ce('0x1a')][_0x56ce('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5889ea){logger[_0x56ce('0xe')]('CreateWhatsappQueueReport',_0x2c83f5);logger[_0x56ce('0xf')]('CreateWhatsappQueueReport',_0x2c83f5,JSON[_0x56ce('0x10')](_0x5889ea));_0x43d876(_0x5889ea);})[_0x56ce('0x16')](function(_0x1fa213){logger[_0x56ce('0x11')](_0x56ce('0x1c'),_0x1fa213[_0x56ce('0x14')],_0x2c83f5);_0x365f99(_0x2cd352[_0x56ce('0x11')](0x1f4,_0x1fa213[_0x56ce('0x14')]));});});};exports[_0x56ce('0x1d')]=function(_0x347b4b){var _0x1c61f9=this;return new Promise(function(_0x2c45ba,_0x1b4637){return db['WhatsappQueueReport']['update'](_0x347b4b[_0x56ce('0x19')],{'raw':_0x347b4b['options']?_0x347b4b[_0x56ce('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x347b4b[_0x56ce('0x1a')]?_0x347b4b['options'][_0x56ce('0x1e')]||null:null,'attributes':_0x347b4b[_0x56ce('0x1a')]?_0x347b4b['options'][_0x56ce('0x1f')]||null:null,'limit':_0x347b4b[_0x56ce('0x1a')]?_0x347b4b['options'][_0x56ce('0x20')]||null:null})[_0x56ce('0xd')](function(_0x2b2a72){logger['info'](_0x56ce('0x1d'),_0x347b4b);logger[_0x56ce('0xf')](_0x56ce('0x1d'),_0x347b4b,JSON[_0x56ce('0x10')](_0x2b2a72));_0x2c45ba(_0x2b2a72);})[_0x56ce('0x16')](function(_0x694e5f){logger[_0x56ce('0x11')](_0x56ce('0x1d'),_0x694e5f['message'],_0x347b4b);_0x1b4637(_0x1c61f9[_0x56ce('0x11')](0x1f4,_0x694e5f[_0x56ce('0x14')]));});});}; \ No newline at end of file +var _0xe989=['options','CreateWhatsappQueueReport','stringify','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','error','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch','WhatsappQueueReport','create','body'];(function(_0x242baf,_0x29e5d9){var _0x43159e=function(_0x3d3bf3){while(--_0x3d3bf3){_0x242baf['push'](_0x242baf['shift']());}};_0x43159e(++_0x29e5d9);}(_0xe989,0x129));var _0x9e98=function(_0x341850,_0x227d13){_0x341850=_0x341850-0x0;var _0x550b31=_0xe989[_0x341850];return _0x550b31;};'use strict';var _=require(_0x9e98('0x0'));var util=require(_0x9e98('0x1'));var moment=require(_0x9e98('0x2'));var BPromise=require(_0x9e98('0x3'));var rs=require(_0x9e98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9e98('0x5'));var logger=require(_0x9e98('0x6'))(_0x9e98('0x7'));var config=require(_0x9e98('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9e98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d2813,_0x5d2807,_0x2ab9d5){return new BPromise(function(_0x12435d,_0x1e28e9){return client[_0x9e98('0xa')](_0x5d2813,_0x2ab9d5)[_0x9e98('0xb')](function(_0x1d2bf5){logger[_0x9e98('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5d2807,_0x9e98('0xd'));logger[_0x9e98('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5d2807,_0x9e98('0xd'),JSON['stringify'](_0x1d2bf5));if(_0x1d2bf5[_0x9e98('0xf')]){if(_0x1d2bf5[_0x9e98('0xf')]['code']===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x5d2807,_0x1d2bf5[_0x9e98('0xf')]['message']);return _0x1e28e9(_0x1d2bf5['error'][_0x9e98('0x10')]);}logger[_0x9e98('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5d2807,_0x1d2bf5[_0x9e98('0xf')][_0x9e98('0x10')]);return _0x12435d(_0x1d2bf5[_0x9e98('0xf')]['message']);}else{logger[_0x9e98('0xc')](_0x9e98('0x11'),_0x5d2807,_0x9e98('0xd'));_0x12435d(_0x1d2bf5[_0x9e98('0x12')]['message']);}})[_0x9e98('0x13')](function(_0xe94f4c){logger[_0x9e98('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5d2807,_0xe94f4c);_0x1e28e9(_0xe94f4c);});});}exports['CreateWhatsappQueueReport']=function(_0x5b2ded){var _0x25c754=this;return new Promise(function(_0x49234b,_0x42414b){return db[_0x9e98('0x14')][_0x9e98('0x15')](_0x5b2ded[_0x9e98('0x16')],{'raw':_0x5b2ded[_0x9e98('0x17')]?_0x5b2ded['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x288fd2){logger[_0x9e98('0xc')](_0x9e98('0x18'),_0x5b2ded);logger[_0x9e98('0xe')](_0x9e98('0x18'),_0x5b2ded,JSON[_0x9e98('0x19')](_0x288fd2));_0x49234b(_0x288fd2);})[_0x9e98('0x13')](function(_0x4ef897){logger[_0x9e98('0xf')](_0x9e98('0x18'),_0x4ef897[_0x9e98('0x10')],_0x5b2ded);_0x42414b(_0x25c754[_0x9e98('0xf')](0x1f4,_0x4ef897[_0x9e98('0x10')]));});});};exports[_0x9e98('0x1a')]=function(_0x426548){var _0xe1d43a=this;return new Promise(function(_0x4310e1,_0x5e69c9){return db[_0x9e98('0x14')][_0x9e98('0x1b')](_0x426548[_0x9e98('0x16')],{'raw':_0x426548[_0x9e98('0x17')]?_0x426548[_0x9e98('0x17')][_0x9e98('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x426548[_0x9e98('0x17')]?_0x426548['options'][_0x9e98('0x1d')]||null:null,'attributes':_0x426548[_0x9e98('0x17')]?_0x426548[_0x9e98('0x17')][_0x9e98('0x1e')]||null:null,'limit':_0x426548[_0x9e98('0x17')]?_0x426548['options'][_0x9e98('0x1f')]||null:null})[_0x9e98('0xb')](function(_0xa55176){logger[_0x9e98('0xc')](_0x9e98('0x1a'),_0x426548);logger[_0x9e98('0xe')]('UpdateWhatsappQueueReport',_0x426548,JSON[_0x9e98('0x19')](_0xa55176));_0x4310e1(_0xa55176);})[_0x9e98('0x13')](function(_0x3303bf){logger[_0x9e98('0xf')](_0x9e98('0x1a'),_0x3303bf[_0x9e98('0x10')],_0x426548);_0x5e69c9(_0xe1d43a[_0x9e98('0xf')](0x1f4,_0x3303bf[_0x9e98('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 19ccb45..b3d3a21 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 _0xa624=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xcf0add,_0x7d6f7){var _0x5479e9=function(_0x13ec62){while(--_0x13ec62){_0xcf0add['push'](_0xcf0add['shift']());}};_0x5479e9(++_0x7d6f7);}(_0xa624,0xab));var _0x4a62=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0xa624[_0x3cc9d9];return _0x1a425d;};'use strict';var multer=require(_0x4a62('0x0'));var util=require(_0x4a62('0x1'));var path=require(_0x4a62('0x2'));var timeout=require(_0x4a62('0x3'));var express=require(_0x4a62('0x4'));var router=express[_0x4a62('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4a62('0x6'));var interaction=require(_0x4a62('0x7'));var config=require(_0x4a62('0x8'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0x4a62('0x9')](),controller[_0x4a62('0xa')]);router[_0x4a62('0xb')]('/describe',auth[_0x4a62('0x9')](),controller['describe']);router[_0x4a62('0xb')](_0x4a62('0xc'),auth['isAuthenticated'](),controller[_0x4a62('0xd')]);router[_0x4a62('0xe')]('/',auth['isAuthenticated'](),controller[_0x4a62('0xf')]);router[_0x4a62('0x10')]('/:id',auth[_0x4a62('0x9')](),controller[_0x4a62('0x11')]);router[_0x4a62('0x12')](_0x4a62('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4a62('0x13')]=router; \ No newline at end of file +var _0x1d18=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','describe','get','/:id','post','put','delete'];(function(_0x5bd4f6,_0xf4e45c){var _0x33a165=function(_0x37eef6){while(--_0x37eef6){_0x5bd4f6['push'](_0x5bd4f6['shift']());}};_0x33a165(++_0xf4e45c);}(_0x1d18,0x17d));var _0x81d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d18[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x81d1('0x0'));var util=require(_0x81d1('0x1'));var path=require(_0x81d1('0x2'));var timeout=require(_0x81d1('0x3'));var express=require(_0x81d1('0x4'));var router=express[_0x81d1('0x5')]();var fs_extra=require(_0x81d1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x81d1('0x7'));var config=require(_0x81d1('0x8'));var controller=require(_0x81d1('0x9'));router['get']('/',auth[_0x81d1('0xa')](),controller[_0x81d1('0xb')]);router['get']('/describe',auth[_0x81d1('0xa')](),controller[_0x81d1('0xc')]);router[_0x81d1('0xd')](_0x81d1('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x81d1('0xf')]('/',auth[_0x81d1('0xa')](),controller['create']);router[_0x81d1('0x10')](_0x81d1('0xe'),auth[_0x81d1('0xa')](),controller['update']);router[_0x81d1('0x11')](_0x81d1('0xe'),auth[_0x81d1('0xa')](),controller[_0x81d1('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 3fd32aa..a957b11 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 _0x5f7b=['DATE','sequelize','exports','ENUM','account','agent','queue'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x5f7b[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0xb5f7('0x0'));module[_0xb5f7('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb5f7('0x2')](_0xb5f7('0x3'),_0xb5f7('0x4'),_0xb5f7('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xb5f7('0x6')]}}; \ No newline at end of file +var _0xbcff=['agent','queue','sequelize','exports','STRING','account'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0xbcff,0x12e));var _0xfbcf=function(_0x4672af,_0x194072){_0x4672af=_0x4672af-0x0;var _0x32707b=_0xbcff[_0x4672af];return _0x32707b;};'use strict';var Sequelize=require(_0xfbcf('0x0'));module[_0xfbcf('0x1')]={'uniqueid':{'type':Sequelize[_0xfbcf('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfbcf('0x3'),_0xfbcf('0x4'),_0xfbcf('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index e93681c..d62e793 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 _0x2fc0=['map','WhatsappTransferReport','rawAttributes','type','key','query','intersection','model','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','attributes','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','then','destroy','end','name','send','index'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x2fc0,0x192));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02fc('0x0'));var zipdir=require(_0x02fc('0x1'));var jsonpatch=require(_0x02fc('0x2'));var rp=require(_0x02fc('0x3'));var moment=require(_0x02fc('0x4'));var BPromise=require(_0x02fc('0x5'));var Mustache=require('mustache');var util=require(_0x02fc('0x6'));var path=require(_0x02fc('0x7'));var sox=require(_0x02fc('0x8'));var csv=require('to-csv');var ejs=require(_0x02fc('0x9'));var fs=require('fs');var fs_extra=require(_0x02fc('0xa'));var _=require(_0x02fc('0xb'));var squel=require(_0x02fc('0xc'));var crypto=require('crypto');var jsforce=require(_0x02fc('0xd'));var deskjs=require(_0x02fc('0xe'));var toCsv=require(_0x02fc('0xf'));var querystring=require(_0x02fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x02fc('0x11'));var authService=require(_0x02fc('0x12'));var qs=require(_0x02fc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02fc('0x14'));var logger=require(_0x02fc('0x15'))('api');var utils=require(_0x02fc('0x16'));var config=require(_0x02fc('0x17'));var licenseUtil=require(_0x02fc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56a057,_0x253327){_0x253327=_0x253327||0xcc;return function(_0x2326f0){if(_0x2326f0){return _0x56a057[_0x02fc('0x19')](_0x253327);}return _0x56a057[_0x02fc('0x1a')](_0x253327)['end']();};}function respondWithResult(_0xecc48d,_0x502309){_0x502309=_0x502309||0xc8;return function(_0x1760ee){if(_0x1760ee){return _0xecc48d[_0x02fc('0x1a')](_0x502309)['json'](_0x1760ee);}};}function respondWithFilteredResult(_0x35ebfe,_0x155bb7){return function(_0x3d48a9){if(_0x3d48a9){var _0x88e6be=typeof _0x155bb7['offset']==='undefined'&&typeof _0x155bb7[_0x02fc('0x1b')]===_0x02fc('0x1c');var _0x16c527=_0x3d48a9[_0x02fc('0x1d')];var _0x37f13a=_0x88e6be?0x0:_0x155bb7[_0x02fc('0x1e')];var _0x295ea1=_0x88e6be?_0x3d48a9[_0x02fc('0x1d')]:_0x155bb7['offset']+_0x155bb7[_0x02fc('0x1b')];var _0x182bb5;if(_0x295ea1>=_0x16c527){_0x295ea1=_0x16c527;_0x182bb5=0xc8;}else{_0x182bb5=0xce;}_0x35ebfe[_0x02fc('0x1a')](_0x182bb5);return _0x35ebfe[_0x02fc('0x1f')](_0x02fc('0x20'),_0x37f13a+'-'+_0x295ea1+'/'+_0x16c527)[_0x02fc('0x21')](_0x3d48a9);}return null;};}function patchUpdates(_0x1c892d){return function(_0x5949a0){try{jsonpatch['apply'](_0x5949a0,_0x1c892d,!![]);}catch(_0x2e2f2f){return BPromise[_0x02fc('0x22')](_0x2e2f2f);}return _0x5949a0[_0x02fc('0x23')]();};}function saveUpdates(_0x574e9e,_0x4d1408){return function(_0x58e3ba){if(_0x58e3ba){return _0x58e3ba['update'](_0x574e9e)[_0x02fc('0x24')](function(_0x1bd8cd){return _0x1bd8cd;});}return null;};}function removeEntity(_0x21ff43,_0x2661e8){return function(_0x56239b){if(_0x56239b){return _0x56239b[_0x02fc('0x25')]()[_0x02fc('0x24')](function(){_0x21ff43[_0x02fc('0x1a')](0xcc)[_0x02fc('0x26')]();});}};}function handleEntityNotFound(_0x582355,_0x82434e){return function(_0x3acfb6){if(!_0x3acfb6){_0x582355[_0x02fc('0x19')](0x194);}return _0x3acfb6;};}function handleError(_0x2234d7,_0x2e773c){_0x2e773c=_0x2e773c||0x1f4;return function(_0x1d5d4b){logger['error'](_0x1d5d4b['stack']);if(_0x1d5d4b[_0x02fc('0x27')]){delete _0x1d5d4b[_0x02fc('0x27')];}_0x2234d7['status'](_0x2e773c)[_0x02fc('0x28')](_0x1d5d4b);};}exports[_0x02fc('0x29')]=function(_0x8d821e,_0x515663){var _0x15f069={},_0x41fe7f={},_0xb21002={'count':0x0,'rows':[]};var _0x243b78=_[_0x02fc('0x2a')](db[_0x02fc('0x2b')][_0x02fc('0x2c')],function(_0x50b646){return{'name':_0x50b646['fieldName'],'type':_0x50b646[_0x02fc('0x2d')][_0x02fc('0x2e')]};});_0x41fe7f['model']=_[_0x02fc('0x2a')](_0x243b78,_0x02fc('0x27'));_0x41fe7f[_0x02fc('0x2f')]=_['keys'](_0x8d821e[_0x02fc('0x2f')]);_0x41fe7f['filters']=_[_0x02fc('0x30')](_0x41fe7f['model'],_0x41fe7f['query']);_0x15f069['attributes']=_['intersection'](_0x41fe7f[_0x02fc('0x31')],qs['fields'](_0x8d821e[_0x02fc('0x2f')][_0x02fc('0x32')]));_0x15f069['attributes']=_0x15f069['attributes'][_0x02fc('0x33')]?_0x15f069['attributes']:_0x41fe7f['model'];if(!_0x8d821e[_0x02fc('0x2f')]['hasOwnProperty'](_0x02fc('0x34'))){_0x15f069['limit']=qs[_0x02fc('0x1b')](_0x8d821e['query'][_0x02fc('0x1b')]);_0x15f069[_0x02fc('0x1e')]=qs['offset'](_0x8d821e[_0x02fc('0x2f')][_0x02fc('0x1e')]);}_0x15f069[_0x02fc('0x35')]=qs[_0x02fc('0x36')](_0x8d821e['query'][_0x02fc('0x36')]);_0x15f069[_0x02fc('0x37')]=qs[_0x02fc('0x38')](_['pick'](_0x8d821e[_0x02fc('0x2f')],_0x41fe7f[_0x02fc('0x38')]),_0x243b78);if(_0x8d821e[_0x02fc('0x2f')][_0x02fc('0x39')]){_0x15f069[_0x02fc('0x37')]=_[_0x02fc('0x3a')](_0x15f069['where'],{'$or':_['map'](_0x243b78,function(_0x49bf00){if(_0x49bf00[_0x02fc('0x2d')]!==_0x02fc('0x3b')){var _0x46fb84={};_0x46fb84[_0x49bf00[_0x02fc('0x27')]]={'$like':'%'+_0x8d821e['query']['filter']+'%'};return _0x46fb84;}})});}_0x15f069=_[_0x02fc('0x3a')]({},_0x15f069,_0x8d821e[_0x02fc('0x3c')]);var _0x1824c5={'where':_0x15f069[_0x02fc('0x37')]};return db['WhatsappTransferReport'][_0x02fc('0x1d')](_0x1824c5)['then'](function(_0x56f4dc){_0xb21002[_0x02fc('0x1d')]=_0x56f4dc;if(_0x8d821e['query'][_0x02fc('0x3d')]){_0x15f069[_0x02fc('0x3e')]=[{'all':!![]}];}return db[_0x02fc('0x2b')][_0x02fc('0x3f')](_0x15f069);})[_0x02fc('0x24')](function(_0x14e67f){_0xb21002[_0x02fc('0x40')]=_0x14e67f;return _0xb21002;})[_0x02fc('0x24')](respondWithFilteredResult(_0x515663,_0x15f069))[_0x02fc('0x41')](handleError(_0x515663,null));};exports['show']=function(_0x5e08a5,_0x5aee0e){var _0xe81961={'raw':!![],'where':{'id':_0x5e08a5[_0x02fc('0x42')]['id']}},_0x11133b={};_0x11133b[_0x02fc('0x31')]=_[_0x02fc('0x43')](db[_0x02fc('0x2b')][_0x02fc('0x2c')]);_0x11133b[_0x02fc('0x2f')]=_[_0x02fc('0x43')](_0x5e08a5[_0x02fc('0x2f')]);_0x11133b[_0x02fc('0x38')]=_[_0x02fc('0x30')](_0x11133b[_0x02fc('0x31')],_0x11133b[_0x02fc('0x2f')]);_0xe81961[_0x02fc('0x44')]=_[_0x02fc('0x30')](_0x11133b[_0x02fc('0x31')],qs[_0x02fc('0x32')](_0x5e08a5[_0x02fc('0x2f')][_0x02fc('0x32')]));_0xe81961[_0x02fc('0x44')]=_0xe81961[_0x02fc('0x44')][_0x02fc('0x33')]?_0xe81961[_0x02fc('0x44')]:_0x11133b['model'];if(_0x5e08a5[_0x02fc('0x2f')][_0x02fc('0x3d')]){_0xe81961[_0x02fc('0x3e')]=[{'all':!![]}];}_0xe81961=_[_0x02fc('0x3a')]({},_0xe81961,_0x5e08a5[_0x02fc('0x3c')]);return db[_0x02fc('0x2b')][_0x02fc('0x45')](_0xe81961)[_0x02fc('0x24')](handleEntityNotFound(_0x5aee0e,null))[_0x02fc('0x24')](respondWithResult(_0x5aee0e,null))[_0x02fc('0x41')](handleError(_0x5aee0e,null));};exports[_0x02fc('0x46')]=function(_0x2ec42c,_0x2ae925){return db['WhatsappTransferReport'][_0x02fc('0x46')](_0x2ec42c[_0x02fc('0x47')],{})['then'](respondWithResult(_0x2ae925,0xc9))[_0x02fc('0x41')](handleError(_0x2ae925,null));};exports[_0x02fc('0x48')]=function(_0x1d2f52,_0x53a4a3){if(_0x1d2f52[_0x02fc('0x47')]['id']){delete _0x1d2f52['body']['id'];}return db[_0x02fc('0x2b')]['find']({'where':{'id':_0x1d2f52[_0x02fc('0x42')]['id']}})[_0x02fc('0x24')](handleEntityNotFound(_0x53a4a3,null))[_0x02fc('0x24')](saveUpdates(_0x1d2f52[_0x02fc('0x47')],null))['then'](respondWithResult(_0x53a4a3,null))[_0x02fc('0x41')](handleError(_0x53a4a3,null));};exports[_0x02fc('0x25')]=function(_0x254cee,_0x3ac4fe){return db[_0x02fc('0x2b')]['find']({'where':{'id':_0x254cee[_0x02fc('0x42')]['id']}})[_0x02fc('0x24')](handleEntityNotFound(_0x3ac4fe,null))[_0x02fc('0x24')](removeEntity(_0x3ac4fe,null))['catch'](handleError(_0x3ac4fe,null));};exports[_0x02fc('0x49')]=function(_0x4df1a3,_0x264ede){return db['WhatsappTransferReport']['describe']()['then'](respondWithResult(_0x264ede,null))[_0x02fc('0x41')](handleError(_0x264ede,null));}; \ No newline at end of file +var _0x087a=['options','catch','create','body','find','describe','eml-format','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys'];(function(_0x397124,_0xaa3560){var _0x5cf767=function(_0x1c53d6){while(--_0x1c53d6){_0x397124['push'](_0x397124['shift']());}};_0x5cf767(++_0xaa3560);}(_0x087a,0x1b0));var _0xa087=function(_0x1f38a7,_0xe6cb51){_0x1f38a7=_0x1f38a7-0x0;var _0x48a4de=_0x087a[_0x1f38a7];return _0x48a4de;};'use strict';var emlformat=require(_0xa087('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa087('0x1'));var rp=require(_0xa087('0x2'));var moment=require('moment');var BPromise=require(_0xa087('0x3'));var Mustache=require('mustache');var util=require(_0xa087('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa087('0x5'));var ejs=require(_0xa087('0x6'));var fs=require('fs');var fs_extra=require(_0xa087('0x7'));var _=require('lodash');var squel=require(_0xa087('0x8'));var crypto=require(_0xa087('0x9'));var jsforce=require(_0xa087('0xa'));var deskjs=require(_0xa087('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa087('0xc'));var Redis=require(_0xa087('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa087('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa087('0xf'));var logger=require(_0xa087('0x10'))(_0xa087('0x11'));var utils=require(_0xa087('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa087('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf7aae2,_0x14c4de){_0x14c4de=_0x14c4de||0xcc;return function(_0x210ce0){if(_0x210ce0){return _0xf7aae2[_0xa087('0x14')](_0x14c4de);}return _0xf7aae2['status'](_0x14c4de)[_0xa087('0x15')]();};}function respondWithResult(_0x2b12e7,_0x4b80f9){_0x4b80f9=_0x4b80f9||0xc8;return function(_0x2fab5b){if(_0x2fab5b){return _0x2b12e7[_0xa087('0x16')](_0x4b80f9)[_0xa087('0x17')](_0x2fab5b);}};}function respondWithFilteredResult(_0x11077b,_0x299d98){return function(_0xbcfe7e){if(_0xbcfe7e){var _0x55d260=typeof _0x299d98[_0xa087('0x18')]===_0xa087('0x19')&&typeof _0x299d98[_0xa087('0x1a')]===_0xa087('0x19');var _0xa12904=_0xbcfe7e[_0xa087('0x1b')];var _0xdd396b=_0x55d260?0x0:_0x299d98[_0xa087('0x18')];var _0x57af0b=_0x55d260?_0xbcfe7e['count']:_0x299d98[_0xa087('0x18')]+_0x299d98['limit'];var _0x1cd240;if(_0x57af0b>=_0xa12904){_0x57af0b=_0xa12904;_0x1cd240=0xc8;}else{_0x1cd240=0xce;}_0x11077b[_0xa087('0x16')](_0x1cd240);return _0x11077b[_0xa087('0x1c')](_0xa087('0x1d'),_0xdd396b+'-'+_0x57af0b+'/'+_0xa12904)[_0xa087('0x17')](_0xbcfe7e);}return null;};}function patchUpdates(_0x1e0a42){return function(_0x335018){try{jsonpatch['apply'](_0x335018,_0x1e0a42,!![]);}catch(_0x442825){return BPromise[_0xa087('0x1e')](_0x442825);}return _0x335018['save']();};}function saveUpdates(_0x4db99b,_0x102034){return function(_0x5e0b95){if(_0x5e0b95){return _0x5e0b95[_0xa087('0x1f')](_0x4db99b)[_0xa087('0x20')](function(_0x20df58){return _0x20df58;});}return null;};}function removeEntity(_0x1dfacb,_0x2273be){return function(_0x17aee7){if(_0x17aee7){return _0x17aee7[_0xa087('0x21')]()[_0xa087('0x20')](function(){_0x1dfacb[_0xa087('0x16')](0xcc)[_0xa087('0x15')]();});}};}function handleEntityNotFound(_0xa4ae00,_0x3d3a8f){return function(_0x3cd376){if(!_0x3cd376){_0xa4ae00['sendStatus'](0x194);}return _0x3cd376;};}function handleError(_0x455395,_0x4d5bdf){_0x4d5bdf=_0x4d5bdf||0x1f4;return function(_0x109c13){logger[_0xa087('0x22')](_0x109c13[_0xa087('0x23')]);if(_0x109c13[_0xa087('0x24')]){delete _0x109c13[_0xa087('0x24')];}_0x455395['status'](_0x4d5bdf)[_0xa087('0x25')](_0x109c13);};}exports[_0xa087('0x26')]=function(_0x38fa94,_0x45c0a7){var _0x2d9738={},_0x5a3c04={},_0x3006ee={'count':0x0,'rows':[]};var _0xa3dedb=_[_0xa087('0x27')](db[_0xa087('0x28')][_0xa087('0x29')],function(_0x254fe6){return{'name':_0x254fe6[_0xa087('0x2a')],'type':_0x254fe6[_0xa087('0x2b')]['key']};});_0x5a3c04[_0xa087('0x2c')]=_[_0xa087('0x27')](_0xa3dedb,_0xa087('0x24'));_0x5a3c04[_0xa087('0x2d')]=_['keys'](_0x38fa94[_0xa087('0x2d')]);_0x5a3c04['filters']=_[_0xa087('0x2e')](_0x5a3c04[_0xa087('0x2c')],_0x5a3c04[_0xa087('0x2d')]);_0x2d9738[_0xa087('0x2f')]=_['intersection'](_0x5a3c04[_0xa087('0x2c')],qs[_0xa087('0x30')](_0x38fa94['query']['fields']));_0x2d9738['attributes']=_0x2d9738[_0xa087('0x2f')][_0xa087('0x31')]?_0x2d9738[_0xa087('0x2f')]:_0x5a3c04[_0xa087('0x2c')];if(!_0x38fa94[_0xa087('0x2d')]['hasOwnProperty'](_0xa087('0x32'))){_0x2d9738[_0xa087('0x1a')]=qs['limit'](_0x38fa94[_0xa087('0x2d')]['limit']);_0x2d9738[_0xa087('0x18')]=qs[_0xa087('0x18')](_0x38fa94[_0xa087('0x2d')][_0xa087('0x18')]);}_0x2d9738[_0xa087('0x33')]=qs['sort'](_0x38fa94[_0xa087('0x2d')][_0xa087('0x34')]);_0x2d9738[_0xa087('0x35')]=qs[_0xa087('0x36')](_[_0xa087('0x37')](_0x38fa94[_0xa087('0x2d')],_0x5a3c04[_0xa087('0x36')]),_0xa3dedb);if(_0x38fa94['query'][_0xa087('0x38')]){_0x2d9738[_0xa087('0x35')]=_[_0xa087('0x39')](_0x2d9738['where'],{'$or':_['map'](_0xa3dedb,function(_0x3017f9){if(_0x3017f9['type']!==_0xa087('0x3a')){var _0x3f4727={};_0x3f4727[_0x3017f9[_0xa087('0x24')]]={'$like':'%'+_0x38fa94['query'][_0xa087('0x38')]+'%'};return _0x3f4727;}})});}_0x2d9738=_[_0xa087('0x39')]({},_0x2d9738,_0x38fa94['options']);var _0x67c7fd={'where':_0x2d9738['where']};return db['WhatsappTransferReport'][_0xa087('0x1b')](_0x67c7fd)[_0xa087('0x20')](function(_0xd92aaa){_0x3006ee[_0xa087('0x1b')]=_0xd92aaa;if(_0x38fa94[_0xa087('0x2d')][_0xa087('0x3b')]){_0x2d9738[_0xa087('0x3c')]=[{'all':!![]}];}return db[_0xa087('0x28')]['findAll'](_0x2d9738);})[_0xa087('0x20')](function(_0x443a86){_0x3006ee[_0xa087('0x3d')]=_0x443a86;return _0x3006ee;})['then'](respondWithFilteredResult(_0x45c0a7,_0x2d9738))['catch'](handleError(_0x45c0a7,null));};exports[_0xa087('0x3e')]=function(_0x55596e,_0x3b369a){var _0x1fe5c0={'raw':!![],'where':{'id':_0x55596e[_0xa087('0x3f')]['id']}},_0x5840e9={};_0x5840e9[_0xa087('0x2c')]=_[_0xa087('0x40')](db['WhatsappTransferReport'][_0xa087('0x29')]);_0x5840e9[_0xa087('0x2d')]=_[_0xa087('0x40')](_0x55596e['query']);_0x5840e9[_0xa087('0x36')]=_[_0xa087('0x2e')](_0x5840e9['model'],_0x5840e9[_0xa087('0x2d')]);_0x1fe5c0[_0xa087('0x2f')]=_['intersection'](_0x5840e9[_0xa087('0x2c')],qs[_0xa087('0x30')](_0x55596e[_0xa087('0x2d')][_0xa087('0x30')]));_0x1fe5c0[_0xa087('0x2f')]=_0x1fe5c0[_0xa087('0x2f')][_0xa087('0x31')]?_0x1fe5c0[_0xa087('0x2f')]:_0x5840e9[_0xa087('0x2c')];if(_0x55596e[_0xa087('0x2d')][_0xa087('0x3b')]){_0x1fe5c0['include']=[{'all':!![]}];}_0x1fe5c0=_[_0xa087('0x39')]({},_0x1fe5c0,_0x55596e[_0xa087('0x41')]);return db['WhatsappTransferReport']['find'](_0x1fe5c0)[_0xa087('0x20')](handleEntityNotFound(_0x3b369a,null))['then'](respondWithResult(_0x3b369a,null))[_0xa087('0x42')](handleError(_0x3b369a,null));};exports['create']=function(_0x26065d,_0x52ed74){return db[_0xa087('0x28')][_0xa087('0x43')](_0x26065d[_0xa087('0x44')],{})['then'](respondWithResult(_0x52ed74,0xc9))[_0xa087('0x42')](handleError(_0x52ed74,null));};exports[_0xa087('0x1f')]=function(_0x29fd37,_0x290aee){if(_0x29fd37[_0xa087('0x44')]['id']){delete _0x29fd37['body']['id'];}return db['WhatsappTransferReport'][_0xa087('0x45')]({'where':{'id':_0x29fd37[_0xa087('0x3f')]['id']}})[_0xa087('0x20')](handleEntityNotFound(_0x290aee,null))[_0xa087('0x20')](saveUpdates(_0x29fd37[_0xa087('0x44')],null))[_0xa087('0x20')](respondWithResult(_0x290aee,null))[_0xa087('0x42')](handleError(_0x290aee,null));};exports[_0xa087('0x21')]=function(_0x267d36,_0x1509af){return db[_0xa087('0x28')][_0xa087('0x45')]({'where':{'id':_0x267d36[_0xa087('0x3f')]['id']}})[_0xa087('0x20')](handleEntityNotFound(_0x1509af,null))['then'](removeEntity(_0x1509af,null))[_0xa087('0x42')](handleError(_0x1509af,null));};exports[_0xa087('0x46')]=function(_0x13a99b,_0x5eac82){return db[_0xa087('0x28')][_0xa087('0x46')]()['then'](respondWithResult(_0x5eac82,null))[_0xa087('0x42')](handleError(_0x5eac82,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index f6d32b8..cc82740 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 _0xd8ec=['api','moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xd8ec,0x6e));var _0xcd8e=function(_0x261318,_0x47ca22){_0x261318=_0x261318-0x0;var _0x3a479b=_0xd8ec[_0x261318];return _0x3a479b;};'use strict';var _=require(_0xcd8e('0x0'));var util=require(_0xcd8e('0x1'));var logger=require('../../config/logger')(_0xcd8e('0x2'));var moment=require(_0xcd8e('0x3'));var BPromise=require(_0xcd8e('0x4'));var rp=require(_0xcd8e('0x5'));var fs=require('fs');var path=require(_0xcd8e('0x6'));var rimraf=require('rimraf');var config=require(_0xcd8e('0x7'));var attributes=require(_0xcd8e('0x8'));module[_0xcd8e('0x9')]=function(_0xc4f59b,_0x3be1b4){return _0xc4f59b[_0xcd8e('0xa')](_0xcd8e('0xb'),attributes,{'tableName':_0xcd8e('0xc'),'paranoid':![],'indexes':[{'name':_0xcd8e('0xd'),'fields':[_0xcd8e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x29eb=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x1051a2,_0x287670){var _0x105486=function(_0x1bc1bc){while(--_0x1bc1bc){_0x1051a2['push'](_0x1051a2['shift']());}};_0x105486(++_0x287670);}(_0x29eb,0x104));var _0xb29e=function(_0xc57c18,_0x3259fc){_0xc57c18=_0xc57c18-0x0;var _0x5daed9=_0x29eb[_0xc57c18];return _0x5daed9;};'use strict';var _=require(_0xb29e('0x0'));var util=require(_0xb29e('0x1'));var logger=require(_0xb29e('0x2'))(_0xb29e('0x3'));var moment=require(_0xb29e('0x4'));var BPromise=require('bluebird');var rp=require(_0xb29e('0x5'));var fs=require('fs');var path=require(_0xb29e('0x6'));var rimraf=require(_0xb29e('0x7'));var config=require(_0xb29e('0x8'));var attributes=require(_0xb29e('0x9'));module[_0xb29e('0xa')]=function(_0x247248,_0x17b0b4){return _0x247248[_0xb29e('0xb')](_0xb29e('0xc'),attributes,{'tableName':_0xb29e('0xd'),'paranoid':![],'indexes':[{'name':_0xb29e('0xe'),'fields':[_0xb29e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8f03520..5874637 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 _0x7e43=['error','code','WhatsappTransferReport,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x7e43,0x1bf));var _0x37e4=function(_0x4829a3,_0x39dd5f){_0x4829a3=_0x4829a3-0x0;var _0x59964f=_0x7e43[_0x4829a3];return _0x59964f;};'use strict';var _=require('lodash');var util=require(_0x37e4('0x0'));var moment=require(_0x37e4('0x1'));var BPromise=require(_0x37e4('0x2'));var rs=require(_0x37e4('0x3'));var fs=require('fs');var Redis=require(_0x37e4('0x4'));var db=require(_0x37e4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x37e4('0x6'))(_0x37e4('0x7'));var config=require(_0x37e4('0x8'));var jayson=require(_0x37e4('0x9'));var client=jayson[_0x37e4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d4e75,_0x1f6e59,_0x341702){return new BPromise(function(_0x31bf56,_0x4cc894){return client[_0x37e4('0xb')](_0x1d4e75,_0x341702)[_0x37e4('0xc')](function(_0x551308){logger[_0x37e4('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1f6e59,'request\x20sent');logger['debug'](_0x37e4('0xe'),_0x1f6e59,'request\x20sent',JSON['stringify'](_0x551308));if(_0x551308[_0x37e4('0xf')]){if(_0x551308[_0x37e4('0xf')][_0x37e4('0x10')]===0x1f4){logger[_0x37e4('0xf')](_0x37e4('0x11'),_0x1f6e59,_0x551308[_0x37e4('0xf')][_0x37e4('0x12')]);return _0x4cc894(_0x551308[_0x37e4('0xf')][_0x37e4('0x12')]);}logger[_0x37e4('0xf')](_0x37e4('0x11'),_0x1f6e59,_0x551308[_0x37e4('0xf')][_0x37e4('0x12')]);return _0x31bf56(_0x551308[_0x37e4('0xf')][_0x37e4('0x12')]);}else{logger[_0x37e4('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1f6e59,_0x37e4('0x13'));_0x31bf56(_0x551308['result']['message']);}})[_0x37e4('0x14')](function(_0x384d53){logger[_0x37e4('0xf')](_0x37e4('0x11'),_0x1f6e59,_0x384d53);_0x4cc894(_0x384d53);});});} \ No newline at end of file +var _0x93cc=['request','info','request\x20sent','debug','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x590b37,_0x1562c1){var _0x1b4768=function(_0xd073ce){while(--_0xd073ce){_0x590b37['push'](_0x590b37['shift']());}};_0x1b4768(++_0x1562c1);}(_0x93cc,0x1a3));var _0xc93c=function(_0x36011e,_0x17b43f){_0x36011e=_0x36011e-0x0;var _0x249d65=_0x93cc[_0x36011e];return _0x249d65;};'use strict';var _=require(_0xc93c('0x0'));var util=require(_0xc93c('0x1'));var moment=require(_0xc93c('0x2'));var BPromise=require(_0xc93c('0x3'));var rs=require(_0xc93c('0x4'));var fs=require('fs');var Redis=require(_0xc93c('0x5'));var db=require(_0xc93c('0x6'))['db'];var utils=require(_0xc93c('0x7'));var logger=require(_0xc93c('0x8'))(_0xc93c('0x9'));var config=require('../../config/environment');var jayson=require(_0xc93c('0xa'));var client=jayson[_0xc93c('0xb')][_0xc93c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3742fd,_0x58453e,_0x388997){return new BPromise(function(_0xa69704,_0x587520){return client[_0xc93c('0xd')](_0x3742fd,_0x388997)['then'](function(_0x4ead2d){logger[_0xc93c('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x58453e,_0xc93c('0xf'));logger[_0xc93c('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x58453e,'request\x20sent',JSON[_0xc93c('0x11')](_0x4ead2d));if(_0x4ead2d['error']){if(_0x4ead2d[_0xc93c('0x12')][_0xc93c('0x13')]===0x1f4){logger[_0xc93c('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x58453e,_0x4ead2d['error'][_0xc93c('0x14')]);return _0x587520(_0x4ead2d['error'][_0xc93c('0x14')]);}logger['error'](_0xc93c('0x15'),_0x58453e,_0x4ead2d[_0xc93c('0x12')]['message']);return _0xa69704(_0x4ead2d[_0xc93c('0x12')]['message']);}else{logger[_0xc93c('0xe')](_0xc93c('0x15'),_0x58453e,_0xc93c('0xf'));_0xa69704(_0x4ead2d[_0xc93c('0x16')]['message']);}})[_0xc93c('0x17')](function(_0x4b144b){logger[_0xc93c('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x58453e,_0x4b144b);_0x587520(_0x4b144b);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 98b1fce..c2b2eee 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81bd=['join','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','then','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online'];(function(_0x311fd4,_0x2fc056){var _0x2a7835=function(_0x4945e7){while(--_0x4945e7){_0x311fd4['push'](_0x311fd4['shift']());}};_0x2a7835(++_0x2fc056);}(_0x81bd,0x7c));var _0xd81b=function(_0x4e77c6,_0x4c359c){_0x4e77c6=_0x4e77c6-0x0;var _0x3e326c=_0x81bd[_0x4e77c6];return _0x3e326c;};'use strict';var _=require(_0xd81b('0x0'));var db=require(_0xd81b('0x1'))['db'];var seedDb=require(_0xd81b('0x2'));var checkLicense=require(_0xd81b('0x3'));var rpc=require(_0xd81b('0x4'));var config=require(_0xd81b('0x5'));var logger=require(_0xd81b('0x6'))('app');var pm2=require(_0xd81b('0x7'));var pm2Config=require(_0xd81b('0x8'));var schedule=require(_0xd81b('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xd81b('0xa'));var transcribe=require(_0xd81b('0xb'));var provider=require(_0xd81b('0xc'));function main(){return db['sequelize']['sync']()[_0xd81b('0xd')](function(){if(config['seedDB']){return seedDb[_0xd81b('0xe')]();}})[_0xd81b('0xd')](function(){return checkLicense[_0xd81b('0xe')]();})[_0xd81b('0xd')](function(){return rpc[_0xd81b('0xf')]();})[_0xd81b('0xd')](function(_0x4391be){logger[_0xd81b('0x10')](_0x4391be);return chat[_0xd81b('0x11')]();})[_0xd81b('0xd')](function(){return whatsapp[_0xd81b('0x11')]();})[_0xd81b('0xd')](function(){return schedule[_0xd81b('0x11')]();})['then'](function(){return transcribe[_0xd81b('0x11')]();})['then'](function(){return provider[_0xd81b('0x11')]();})[_0xd81b('0xd')](function(_0x5f0b6b){logger[_0xd81b('0x10')](_0x5f0b6b);return pm2['start'](pm2Config);})[_0xd81b('0xd')](function(_0x41bf7a){var _0x6c6041=_0x41bf7a[_0xd81b('0x12')](function(_0x128162){return typeof _0x128162['exitCode']===_0xd81b('0x13')&&_0x128162[_0xd81b('0x14')]>=0x0;});if(_0x6c6041['length']>0x0){throw new Error(_0x6c6041[_0xd81b('0x15')]+_0xd81b('0x16')+_[_0xd81b('0x17')](_0x6c6041,function(_0x15e860){return'\x22'+_0x15e860[_0xd81b('0x18')][_0xd81b('0x19')]+'\x22';}));}logger[_0xd81b('0x10')](_0xd81b('0x1a'),_[_0xd81b('0x17')](_[_0xd81b('0x12')](_0x41bf7a,{'status':_0xd81b('0x1b')}),_0xd81b('0x19'))[_0xd81b('0x1c')]());logger[_0xd81b('0x10')](_0xd81b('0x1d'),_[_0xd81b('0x17')](_['filter'](_0x41bf7a,function(_0x4d566e){return _0x4d566e[_0xd81b('0x1e')]!==_0xd81b('0x1b');}),_0xd81b('0x19'))['join']()||_0xd81b('0x1f'));console[_0xd81b('0x20')]('App\x20Ready!');})[_0xd81b('0x21')](function(_0x13d687){console[_0xd81b('0x20')](_0xd81b('0x22'),_0x13d687);logger[_0xd81b('0x23')](_0xd81b('0x24'),_0x13d687);process[_0xd81b('0x25')](0x1);});}main(); \ No newline at end of file +var _0x535d=['length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','filter','join','Offline\x20apps:','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','sync','seedDB','then','default','listen','info','start','exitCode','number'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x535d,0xe8));var _0xd535=function(_0x37786d,_0x5d5cd2){_0x37786d=_0x37786d-0x0;var _0x388854=_0x535d[_0x37786d];return _0x388854;};'use strict';var _=require(_0xd535('0x0'));var db=require(_0xd535('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xd535('0x2'));var rpc=require(_0xd535('0x3'));var config=require('./config/environment');var logger=require('./config/logger')(_0xd535('0x4'));var pm2=require(_0xd535('0x5'));var pm2Config=require(_0xd535('0x6'));var schedule=require(_0xd535('0x7'));var chat=require(_0xd535('0x8'));var whatsapp=require(_0xd535('0x9'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xd535('0xa')][_0xd535('0xb')]()['then'](function(){if(config[_0xd535('0xc')]){return seedDb['default']();}})[_0xd535('0xd')](function(){return checkLicense[_0xd535('0xe')]();})[_0xd535('0xd')](function(){return rpc[_0xd535('0xf')]();})['then'](function(_0x3f34c4){logger[_0xd535('0x10')](_0x3f34c4);return chat[_0xd535('0x11')]();})[_0xd535('0xd')](function(){return whatsapp['start']();})[_0xd535('0xd')](function(){return schedule[_0xd535('0x11')]();})[_0xd535('0xd')](function(){return transcribe[_0xd535('0x11')]();})[_0xd535('0xd')](function(){return provider[_0xd535('0x11')]();})[_0xd535('0xd')](function(_0x5c178f){logger[_0xd535('0x10')](_0x5c178f);return pm2['start'](pm2Config);})['then'](function(_0x2b3e1b){var _0x2bf442=_0x2b3e1b['filter'](function(_0x2078ad){return typeof _0x2078ad[_0xd535('0x12')]===_0xd535('0x13')&&_0x2078ad[_0xd535('0x12')]>=0x0;});if(_0x2bf442['length']>0x0){throw new Error(_0x2bf442[_0xd535('0x14')]+_0xd535('0x15')+_[_0xd535('0x16')](_0x2bf442,function(_0xb3cc32){return'\x22'+_0xb3cc32['pm2_env'][_0xd535('0x17')]+'\x22';}));}logger['info'](_0xd535('0x18'),_['map'](_[_0xd535('0x19')](_0x2b3e1b,{'status':'online'}),_0xd535('0x17'))[_0xd535('0x1a')]());logger[_0xd535('0x10')](_0xd535('0x1b'),_['map'](_['filter'](_0x2b3e1b,function(_0x185966){return _0x185966['status']!=='online';}),_0xd535('0x17'))[_0xd535('0x1a')]()||_0xd535('0x1c'));console[_0xd535('0x1d')](_0xd535('0x1e'));})[_0xd535('0x1f')](function(_0x5e1231){console[_0xd535('0x1d')](_0xd535('0x20'),_0x5e1231);logger[_0xd535('0x21')](_0xd535('0x22'),_0x5e1231);process[_0xd535('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 5577a83..3643807 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 _0xa9e0=['role','redirect','/dashboards/general','send','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','apiKeyNonce','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','validatePasswordHistory','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.','Sequelize','decryptString','length','unshift','encryptString','promisify','payload','options','verify','randomBytes','toString','hex','now','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','name','userpic','permissions','md5secret','voicePause','chatPause','mailPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','use','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','catch','isAuthenticated','headers','startsWith','authorization','Basic','User','find','authenticate','pass','status','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'];(function(_0x29964c,_0x2decf9){var _0xb80e17=function(_0xdb3088){while(--_0xdb3088){_0x29964c['push'](_0x29964c['shift']());}};_0xb80e17(++_0x2decf9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var db=require(_0x0a9e('0x0'))['db'];var config=require(_0x0a9e('0x1'));var hardwareConf=require(_0x0a9e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x0a9e('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x0a9e('0x4'));var compose=require(_0x0a9e('0x5'));var basicAuth=require(_0x0a9e('0x6'));var crypto=require(_0x0a9e('0x7'));var BPromise=require(_0x0a9e('0x8'));var util=require('util');var moment=require(_0x0a9e('0x9'));var validateJwt=expressJwt({'secret':config[_0x0a9e('0xa')][_0x0a9e('0xb')]});var userAttributes=['id','role','fullname',_0x0a9e('0xc'),'internal','email',_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),_0x0a9e('0x11'),_0x0a9e('0x12'),'faxPause','smsPause','openchannelPause','pauseType',_0x0a9e('0x13'),_0x0a9e('0x14'),_0x0a9e('0x15'),_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),'alias',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'phoneBarExpires',_0x0a9e('0x1f'),'phoneBarRemoteControl',_0x0a9e('0x20'),'hotdesk',_0x0a9e('0x21'),_0x0a9e('0x22'),'privacyEnabled',_0x0a9e('0x23'),'wssPort',_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28'),_0x0a9e('0x29'),_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x0a9e('0x2c'),_0x0a9e('0x2d'),_0x0a9e('0x2e'),_0x0a9e('0x2f'),'openchannelAutoanswerDelay',_0x0a9e('0x30'),_0x0a9e('0x31'),'whatsappAutoanswer',_0x0a9e('0x32')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x0a9e('0x33')](function(_0x432e56,_0x38e7c4,_0x30bae6){if(_0x432e56['user']){_0x30bae6();}else{return db[_0x0a9e('0x34')][_0x0a9e('0x35')]({'where':{'id':_0x432e56[_0x0a9e('0x36')]['id']},'attributes':['id',_0x0a9e('0x37'),_0x0a9e('0x38')],'raw':!![]})[_0x0a9e('0x39')](function(_0x16b1ca){if(_0x16b1ca&&_0x16b1ca['closed']){return _0x38e7c4['status'](_0x16b1ca[_0x0a9e('0x38')]===_0x0a9e('0x3a')?0x195:0x193)[_0x0a9e('0x3b')]({'message':_0x16b1ca[_0x0a9e('0x38')]==='unmanaged'?_0x0a9e('0x3c'):'Forbidden.'});}else{_0x30bae6();}})[_0x0a9e('0x3d')](function(_0x5bfb33){_0x30bae6(_0x5bfb33);});}});};exports[_0x0a9e('0x3e')]=function isAuthenticated(_0x34dc65){return compose()[_0x0a9e('0x33')](function(_0x14433c,_0x140511,_0x1538a4){var _0x11c3b6;if(_0x14433c[_0x0a9e('0x3f')]['authorization']){if(_[_0x0a9e('0x40')](_0x14433c[_0x0a9e('0x3f')][_0x0a9e('0x41')],_0x0a9e('0x42'))){var _0x5c877d=basicAuth(_0x14433c);db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'name':_0x5c877d[_0x0a9e('0xc')]}})[_0x0a9e('0x39')](function(_0x58b06f){if(!_0x58b06f||!_0x58b06f[_0x0a9e('0x45')](_0x5c877d[_0x0a9e('0x46')])){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':'Wrong\x20credentials.'});}_0x14433c[_0x0a9e('0x48')]={'id':_0x58b06f['id']};_0x1538a4();})['catch'](function(_0x2407f9){_0x1538a4(_0x2407f9);});}else if(_[_0x0a9e('0x40')](_0x14433c[_0x0a9e('0x3f')][_0x0a9e('0x41')],_0x0a9e('0x49'))){validateJwt(_0x14433c,_0x140511,_0x1538a4);}else{if(_0x34dc65){_0x1538a4();}else{return _0x140511['status'](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x4a')});}}}else if(_0x14433c[_0x0a9e('0x4b')][_0x0a9e('0x4c')]){try{var _0x2b45ea={'audience':hardwareConf[_0x0a9e('0x4d')](),'issuer':hardwareConf[_0x0a9e('0x4d')]()};verifyJwt(_0x14433c[_0x0a9e('0x4b')]['apikey'],_0x2b45ea)[_0x0a9e('0x39')](function(_0x5e7238){return db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'id':_0x5e7238[_0x0a9e('0x4e')]}})[_0x0a9e('0x39')](function(_0x567193){_0x11c3b6=_0x567193;return db[_0x0a9e('0x4f')][_0x0a9e('0x35')]({'where':{'id':0x1},'attributes':[_0x0a9e('0x50'),_0x0a9e('0x51')],'raw':!![]});})['then'](function(_0x54135e){if(!_0x11c3b6||!_[_0x0a9e('0x52')](_0x11c3b6['apiKeyNonce'],_0x5e7238[_0x0a9e('0x53')])){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x54')});}if(_0x11c3b6['disabled']){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});}if(_0x11c3b6['blocked']){if(_0x54135e[_0x0a9e('0x51')]>0x0){if(moment(_0x11c3b6[_0x0a9e('0x56')])[_0x0a9e('0x57')](_0x54135e['blockDuration'],'minutes')>moment()){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});}}_0x14433c[_0x0a9e('0x48')]={'id':_0x11c3b6['id']};_0x1538a4();});})['catch'](function(){return _0x140511['status'](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});});}catch(_0x53f3ee){_0x1538a4(_0x53f3ee);}}else if(_0x34dc65){_0x1538a4();}else{return _0x140511[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x4a')});}})['use'](function(_0x316c8f,_0x2cfea9,_0x274e8e){if(_0x316c8f[_0x0a9e('0x48')]){db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'id':_0x316c8f[_0x0a9e('0x48')]['id']},'attributes':userAttributes})[_0x0a9e('0x39')](function(_0x23b089){if(!_0x23b089){return _0x2cfea9[_0x0a9e('0x47')](0x194)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x58')});}_0x316c8f[_0x0a9e('0x48')]=_0x23b089;_0x274e8e();})[_0x0a9e('0x3d')](function(_0x37f6cc){_0x274e8e(_0x37f6cc);});}else if(_0x34dc65){_0x274e8e();}else{return _0x2cfea9['status'](0x194)['json']({'message':_0x0a9e('0x59')});}});};exports[_0x0a9e('0x5a')]=function canUpdate(){return compose()[_0x0a9e('0x33')](function(_0x315881,_0x1a69dd,_0xc9a702){return licenseUtil[_0x0a9e('0x5b')]()[_0x0a9e('0x39')](function(_0x432fcc){if(_0x432fcc[_0x0a9e('0x5c')]){_0xc9a702();}else{return _0x1a69dd[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':'Forbidden'});}})[_0x0a9e('0x3d')](function(_0x138b8b){_0xc9a702(_0x138b8b);});});};exports[_0x0a9e('0x5d')]=function isWebrtcLicence(){return compose()[_0x0a9e('0x33')](function(_0x2e8caf,_0xbe9d19,_0x21eb86){return licenseUtil[_0x0a9e('0x5b')]()['then'](function(_0x2e9d90){if(_0x2e9d90['webrtc']){_0x21eb86();}else{return _0xbe9d19[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x5e')});}})['catch'](function(_0x14bec2){_0x21eb86(_0x14bec2);});});};exports[_0x0a9e('0x5f')]=function(_0x4774f4,_0x34aa5a,_0x45c845){_0x4774f4[_0x0a9e('0x5f')]=!![];return _0x45c845();};exports[_0x0a9e('0x60')]=function signToken(_0x5bbcde){return signJwt(_0x5bbcde);};exports[_0x0a9e('0x61')]=function(_0x1bde3c,_0x1b5e80){if(!_0x1bde3c[_0x0a9e('0x48')]){return _0x1b5e80[_0x0a9e('0x47')](0x194)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x62')});}var _0x19383e={'payload':{'id':_0x1bde3c[_0x0a9e('0x48')]['id'],'role':_0x1bde3c['user'][_0x0a9e('0x63')]},'options':{'expiresIn':0x15180}};return signJwt(_0x19383e)[_0x0a9e('0x39')](function(_0x4f7240){_0x1b5e80['cookie']('motion.token',_0x4f7240);_0x1b5e80[_0x0a9e('0x64')](_0x0a9e('0x65'));})[_0x0a9e('0x3d')](function(_0x11545a){return _0x1b5e80[_0x0a9e('0x47')](0x1f4)[_0x0a9e('0x66')](_0x11545a);});};exports[_0x0a9e('0x67')]=function(_0x375c18){if(_['isNil'](_0x375c18['apiKeyNonce'])||_['isNil'](_0x375c18[_0x0a9e('0x68')])){return null;}else{return createJwt(_0x375c18);}};exports[_0x0a9e('0x69')]=function(_0x14d602){_0x14d602['apiKeyNonce']=generateNonce();_0x14d602[_0x0a9e('0x68')]=generateIssuedAt();return createJwt(_0x14d602);};exports[_0x0a9e('0x6a')]=function(_0x53d113,_0x5a88da){var _0x2ef381=_0x53d113['query'][_0x0a9e('0x4c')];if(_0x2ef381){var _0x4c3845={'nonce':_0x5a88da[_0x0a9e('0x6b')],'iat':_0x5a88da[_0x0a9e('0x68')],'audience':hardwareConf[_0x0a9e('0x4d')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x2ef381,_0x4c3845)[_0x0a9e('0x39')](function(){return generateApiKey(_0x5a88da);});}else{throw{'message':_0x0a9e('0x6c')};}};exports['validatePasswordPattern']=function(_0x50f687){var _0x128aa6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x128aa6[_0x0a9e('0x6d')](_0x50f687))throw new db['Sequelize'][(_0x0a9e('0x6e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x0a9e('0x6f')]=function(_0x523cd2,_0xe22ccc,_0x4a6deb){var _0x5da27d=encryptor['decryptString'](_0xe22ccc)[_0x0a9e('0x70')](',');for(var _0x47de4c=0x0;_0x47de4c<_0x4a6deb;_0x47de4c++){if(!_0x5da27d[_0x47de4c])break;if(_0x523cd2[_0x0a9e('0x71')]()===_0x5da27d[_0x47de4c][_0x0a9e('0x71')]()){var _0x3cfd00=util[_0x0a9e('0x72')](_0x0a9e('0x73'),_0x4a6deb);if(_0x4a6deb===0x1){_0x3cfd00=_0x0a9e('0x74');}throw new db[(_0x0a9e('0x75'))][(_0x0a9e('0x6e'))](_0x3cfd00);}}return;};exports['updatePasswordsHistory']=function(_0x1c693e,_0x121cef){var _0x2642bb=_0x121cef?encryptor[_0x0a9e('0x76')](_0x121cef)[_0x0a9e('0x70')](','):[];if(_0x2642bb[_0x0a9e('0x77')]===0x5){_0x2642bb['splice'](-0x1,0x1);}_0x2642bb[_0x0a9e('0x78')](_0x1c693e);return encryptor[_0x0a9e('0x79')](_0x2642bb['join'](','));};function signJwt(_0x3649cc){var _0x5cc8fb=BPromise[_0x0a9e('0x7a')](jwt['sign'],{'context':jwt});var _0x4b3c1a=_0x3649cc['secret']||config[_0x0a9e('0xa')]['session'];return new BPromise(function(_0x2244d6,_0x1fc70e){_0x5cc8fb(_0x3649cc[_0x0a9e('0x7b')],_0x4b3c1a,_0x3649cc[_0x0a9e('0x7c')])[_0x0a9e('0x39')](function(_0x26d7db){_0x2244d6(_0x26d7db);})['catch'](function(_0x1627a7){_0x1fc70e(_0x1627a7);});});}function verifyJwt(_0x5854cc,_0xca4ade,_0x1f07cb){var _0x51aaf7=BPromise['promisify'](jwt[_0x0a9e('0x7d')],{'context':jwt});var _0x156f1c=_0x1f07cb||config[_0x0a9e('0xa')][_0x0a9e('0xb')];return new BPromise(function(_0x497d91,_0x1d0dc8){_0x51aaf7(_0x5854cc,_0x156f1c,_0xca4ade)[_0x0a9e('0x39')](function(_0x54327c){_0x497d91(_0x54327c);})[_0x0a9e('0x3d')](function(_0x17e88c){_0x1d0dc8(_0x17e88c);});});}function generateNonce(){return crypto[_0x0a9e('0x7e')](0x10)[_0x0a9e('0x7f')](_0x0a9e('0x80'));}function generateIssuedAt(){return Math['floor'](Date[_0x0a9e('0x81')]()/0x3e8)[_0x0a9e('0x7f')]();}function createJwt(_0x281c7d){var _0x47bb43={'payload':{'iat':_0x281c7d[_0x0a9e('0x68')],'nonce':_0x281c7d['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x281c7d['id'][_0x0a9e('0x7f')](),'issuer':hardwareConf[_0x0a9e('0x4d')](),'audience':hardwareConf[_0x0a9e('0x4d')]()}};return signJwt(_0x47bb43)[_0x0a9e('0x39')](function(_0x186f39){return{'iat':_0x281c7d[_0x0a9e('0x68')],'nonce':_0x281c7d[_0x0a9e('0x6b')],'token':_0x186f39};});} \ No newline at end of file +var _0xf3cd=['role','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','authorization','startsWith','Basic','User','authenticate','catch','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session'];(function(_0x3a9a68,_0x4aab79){var _0x4e4f74=function(_0x3c8a0c){while(--_0x3c8a0c){_0x3a9a68['push'](_0x3a9a68['shift']());}};_0x4e4f74(++_0x4aab79);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x56989c,_0x6781f0){_0x56989c=_0x56989c-0x0;var _0x22ab27=_0xf3cd[_0x56989c];return _0x22ab27;};'use strict';var db=require(_0xdf3c('0x0'))['db'];var config=require(_0xdf3c('0x1'));var hardwareConf=require(_0xdf3c('0x2'));var licenseUtil=require(_0xdf3c('0x3'));var encryptor=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdf3c('0x6'));var compose=require(_0xdf3c('0x7'));var basicAuth=require(_0xdf3c('0x8'));var crypto=require('crypto');var BPromise=require(_0xdf3c('0x9'));var util=require(_0xdf3c('0xa'));var moment=require(_0xdf3c('0xb'));var validateJwt=expressJwt({'secret':config[_0xdf3c('0xc')][_0xdf3c('0xd')]});var userAttributes=['id',_0xdf3c('0xe'),'fullname',_0xdf3c('0xf'),'internal','email',_0xdf3c('0x10'),_0xdf3c('0x11'),'md5secret',_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14'),_0xdf3c('0x15'),_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),_0xdf3c('0x19'),'lastLoginAt',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),'alias',_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20'),'phoneBarEnableRecording',_0xdf3c('0x21'),_0xdf3c('0x22'),_0xdf3c('0x23'),_0xdf3c('0x24'),_0xdf3c('0x25'),_0xdf3c('0x26'),_0xdf3c('0x27'),_0xdf3c('0x28'),_0xdf3c('0x29'),_0xdf3c('0x2a'),'settingsEnabled',_0xdf3c('0x2b'),_0xdf3c('0x2c'),_0xdf3c('0x2d'),_0xdf3c('0x2e'),_0xdf3c('0x2f'),_0xdf3c('0x30'),_0xdf3c('0x31'),_0xdf3c('0x32'),_0xdf3c('0x33'),_0xdf3c('0x34'),_0xdf3c('0x35'),_0xdf3c('0x36'),_0xdf3c('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xdf3c('0x38'),'whatsappAutoanswer',_0xdf3c('0x39')];exports[_0xdf3c('0x3a')]=function(){return this[_0xdf3c('0x3b')](!![])[_0xdf3c('0x3c')](function(_0x33652f,_0x36ba1c,_0x50d8ca){if(_0x33652f[_0xdf3c('0x3d')]){_0x50d8ca();}else{return db[_0xdf3c('0x3e')][_0xdf3c('0x3f')]({'where':{'id':_0x33652f[_0xdf3c('0x40')]['id']},'attributes':['id',_0xdf3c('0x41'),_0xdf3c('0x42')],'raw':!![]})[_0xdf3c('0x43')](function(_0x155f54){if(_0x155f54&&_0x155f54[_0xdf3c('0x41')]){return _0x36ba1c[_0xdf3c('0x44')](_0x155f54['disposition']===_0xdf3c('0x45')?0x195:0x193)[_0xdf3c('0x46')]({'message':_0x155f54['disposition']===_0xdf3c('0x45')?'Unmanaged.':'Forbidden.'});}else{_0x50d8ca();}})['catch'](function(_0x14aac9){_0x50d8ca(_0x14aac9);});}});};exports[_0xdf3c('0x3b')]=function isAuthenticated(_0x52b8f6){return compose()['use'](function(_0x37ecfd,_0x1f2ce4,_0xd3cfcb){var _0x1ccdd4;if(_0x37ecfd['headers'][_0xdf3c('0x47')]){if(_[_0xdf3c('0x48')](_0x37ecfd['headers']['authorization'],_0xdf3c('0x49'))){var _0x46f0e3=basicAuth(_0x37ecfd);db[_0xdf3c('0x4a')]['find']({'where':{'name':_0x46f0e3[_0xdf3c('0xf')]}})[_0xdf3c('0x43')](function(_0x21e7b8){if(!_0x21e7b8||!_0x21e7b8[_0xdf3c('0x4b')](_0x46f0e3['pass'])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':'Wrong\x20credentials.'});}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x21e7b8['id']};_0xd3cfcb();})[_0xdf3c('0x4c')](function(_0x217a65){_0xd3cfcb(_0x217a65);});}else if(_[_0xdf3c('0x48')](_0x37ecfd['headers'][_0xdf3c('0x47')],_0xdf3c('0x4d'))){validateJwt(_0x37ecfd,_0x1f2ce4,_0xd3cfcb);}else{if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4[_0xdf3c('0x44')](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37ecfd[_0xdf3c('0x4e')][_0xdf3c('0x4f')]){try{var _0x5ddd21={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};verifyJwt(_0x37ecfd['query'][_0xdf3c('0x4f')],_0x5ddd21)['then'](function(_0x57faba){return db['User'][_0xdf3c('0x51')]({'where':{'id':_0x57faba[_0xdf3c('0x52')]}})[_0xdf3c('0x43')](function(_0x29b5b7){_0x1ccdd4=_0x29b5b7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdf3c('0x53'),'blockDuration'],'raw':!![]});})[_0xdf3c('0x43')](function(_0x17b502){if(!_0x1ccdd4||!_[_0xdf3c('0x54')](_0x1ccdd4[_0xdf3c('0x55')],_0x57faba[_0xdf3c('0x56')])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x57')});}if(_0x1ccdd4[_0xdf3c('0x58')]){return _0x1f2ce4['status'](0x191)[_0xdf3c('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1ccdd4['blocked']){if(_0x17b502[_0xdf3c('0x59')]>0x0){if(moment(_0x1ccdd4['blockedAt'])[_0xdf3c('0x5a')](_0x17b502['blockDuration'],_0xdf3c('0x5b'))>moment()){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}else{return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x1ccdd4['id']};_0xd3cfcb();});})[_0xdf3c('0x4c')](function(){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});});}catch(_0x57e0ab){_0xd3cfcb(_0x57e0ab);}}else if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4['status'](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xdf3c('0x3c')](function(_0x14d8e1,_0x46194d,_0x328b18){if(_0x14d8e1['user']){db['User'][_0xdf3c('0x51')]({'where':{'id':_0x14d8e1[_0xdf3c('0x3d')]['id']},'attributes':userAttributes})[_0xdf3c('0x43')](function(_0x4c59ef){if(!_0x4c59ef){return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5d')});}_0x14d8e1[_0xdf3c('0x3d')]=_0x4c59ef;_0x328b18();})['catch'](function(_0x127685){_0x328b18(_0x127685);});}else if(_0x52b8f6){_0x328b18();}else{return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5e')});}});};exports[_0xdf3c('0x5f')]=function canUpdate(){return compose()['use'](function(_0x410aaf,_0x286b72,_0x437443){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x344f1e){if(_0x344f1e['update']){_0x437443();}else{return _0x286b72['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})['catch'](function(_0x5c9885){_0x437443(_0x5c9885);});});};exports[_0xdf3c('0x62')]=function isWebrtcLicence(){return compose()[_0xdf3c('0x3c')](function(_0x46b2bd,_0x2aeb29,_0xaae4bc){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x84c5c2){if(_0x84c5c2[_0xdf3c('0x63')]){_0xaae4bc();}else{return _0x2aeb29['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})[_0xdf3c('0x4c')](function(_0xe760dd){_0xaae4bc(_0xe760dd);});});};exports[_0xdf3c('0x64')]=function(_0x385824,_0x28a468,_0x553f70){_0x385824[_0xdf3c('0x64')]=!![];return _0x553f70();};exports['signToken']=function signToken(_0xa4e137){return signJwt(_0xa4e137);};exports['setTokenCookie']=function(_0x41b78c,_0x28144f){if(!_0x41b78c[_0xdf3c('0x3d')]){return _0x28144f[_0xdf3c('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4a068a={'payload':{'id':_0x41b78c[_0xdf3c('0x3d')]['id'],'role':_0x41b78c['user'][_0xdf3c('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a068a)[_0xdf3c('0x43')](function(_0x446713){_0x28144f[_0xdf3c('0x65')](_0xdf3c('0x66'),_0x446713);_0x28144f['redirect']('/dashboards/general');})[_0xdf3c('0x4c')](function(_0x27a541){return _0x28144f['status'](0x1f4)[_0xdf3c('0x67')](_0x27a541);});};exports[_0xdf3c('0x68')]=function(_0x168eaf){if(_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x55')])||_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x6a')])){return null;}else{return createJwt(_0x168eaf);}};exports['generateApiKey']=function(_0x4c98dc){_0x4c98dc[_0xdf3c('0x55')]=generateNonce();_0x4c98dc[_0xdf3c('0x6a')]=generateIssuedAt();return createJwt(_0x4c98dc);};exports[_0xdf3c('0x6b')]=function(_0x1ad771,_0x22de6c){var _0x39f38f=_0x1ad771[_0xdf3c('0x4e')][_0xdf3c('0x4f')];if(_0x39f38f){var _0x143d01={'nonce':_0x22de6c[_0xdf3c('0x55')],'iat':_0x22de6c[_0xdf3c('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};return verifyJwt(_0x39f38f,_0x143d01)['then'](function(){return generateApiKey(_0x22de6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x58fcbf){var _0x541c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x541c57[_0xdf3c('0x6c')](_0x58fcbf))throw new db[(_0xdf3c('0x6d'))]['ValidationError'](_0xdf3c('0x6e'));return;};exports[_0xdf3c('0x6f')]=function(_0x51f8dd,_0xa8dddb,_0x28f935){var _0x10e9d5=encryptor[_0xdf3c('0x70')](_0xa8dddb)[_0xdf3c('0x71')](',');for(var _0x28f387=0x0;_0x28f387<_0x28f935;_0x28f387++){if(!_0x10e9d5[_0x28f387])break;if(_0x51f8dd[_0xdf3c('0x72')]()===_0x10e9d5[_0x28f387][_0xdf3c('0x72')]()){var _0x42efa2=util[_0xdf3c('0x73')](_0xdf3c('0x74'),_0x28f935);if(_0x28f935===0x1){_0x42efa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xdf3c('0x6d'))][(_0xdf3c('0x75'))](_0x42efa2);}}return;};exports[_0xdf3c('0x76')]=function(_0x5a3d63,_0x245c68){var _0x3e327e=_0x245c68?encryptor[_0xdf3c('0x70')](_0x245c68)['split'](','):[];if(_0x3e327e[_0xdf3c('0x77')]===0x5){_0x3e327e[_0xdf3c('0x78')](-0x1,0x1);}_0x3e327e['unshift'](_0x5a3d63);return encryptor[_0xdf3c('0x79')](_0x3e327e['join'](','));};function signJwt(_0x28c296){var _0x1b03e7=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7b')],{'context':jwt});var _0xed2a78=_0x28c296[_0xdf3c('0x7c')]||config[_0xdf3c('0xc')][_0xdf3c('0xd')];return new BPromise(function(_0x2922d8,_0x330730){_0x1b03e7(_0x28c296[_0xdf3c('0x7d')],_0xed2a78,_0x28c296[_0xdf3c('0x7e')])[_0xdf3c('0x43')](function(_0x206a18){_0x2922d8(_0x206a18);})[_0xdf3c('0x4c')](function(_0xe42432){_0x330730(_0xe42432);});});}function verifyJwt(_0xd7fb2d,_0x510538,_0x4dade5){var _0x2e8511=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7f')],{'context':jwt});var _0x596282=_0x4dade5||config[_0xdf3c('0xc')]['session'];return new BPromise(function(_0x574852,_0x184952){_0x2e8511(_0xd7fb2d,_0x596282,_0x510538)[_0xdf3c('0x43')](function(_0x1121b9){_0x574852(_0x1121b9);})[_0xdf3c('0x4c')](function(_0x68f487){_0x184952(_0x68f487);});});}function generateNonce(){return crypto[_0xdf3c('0x80')](0x10)[_0xdf3c('0x81')](_0xdf3c('0x82'));}function generateIssuedAt(){return Math[_0xdf3c('0x83')](Date[_0xdf3c('0x84')]()/0x3e8)[_0xdf3c('0x81')]();}function createJwt(_0x5a2dad){var _0x34000c={'payload':{'iat':_0x5a2dad['apiKeyIat'],'nonce':_0x5a2dad[_0xdf3c('0x55')]},'options':{'algorithm':_0xdf3c('0x85'),'subject':_0x5a2dad['id'][_0xdf3c('0x81')](),'issuer':hardwareConf[_0xdf3c('0x50')](),'audience':hardwareConf[_0xdf3c('0x50')]()}};return signJwt(_0x34000c)['then'](function(_0x18bf4f){return{'iat':_0x5a2dad[_0xdf3c('0x6a')],'nonce':_0x5a2dad[_0xdf3c('0x55')],'token':_0x18bf4f};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index b9e9c87..c030788 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x422bd6,_0x235eb0){var _0x294032=function(_0x2af909){while(--_0x2af909){_0x422bd6['push'](_0x422bd6['shift']());}};_0x294032(++_0x235eb0);}(_0xb10b,0x12a));var _0xbb10=function(_0x50a864,_0x3303e2){_0x50a864=_0x50a864-0x0;var _0x2fb82f=_0xb10b[_0x50a864];return _0x2fb82f;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file +var _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x26e9bf,_0x5a6f17){var _0xb779c=function(_0x1064bf){while(--_0x1064bf){_0x26e9bf['push'](_0x26e9bf['shift']());}};_0xb779c(++_0x5a6f17);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0x0b0e[_0x45c981];return _0x4f62c8;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 1026a32..974adad 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b29=['autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','phone','mobile','fax','createdAt','updatedAt','deletedAt','TagIds','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','length','name','dateOfBirth','castTo','DATE','buildExpression','type','default','value','start','end','Tag','split','map','tags','ids','User','user','clause','uc.UserId\x20=\x20?','skip','keys','Contact','push','and','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','fields','tag','filter','agent','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','group','c.id','limit','offset','having','order','DESC','subqry.','findAll','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','COUNT(*)','QueryTypes','exports','lodash','../parsers/advancedSearch','../parsers/qs','role','search','ListId'];(function(_0x65f140,_0x45cbc7){var _0x18fbda=function(_0x26fb39){while(--_0x26fb39){_0x65f140['push'](_0x65f140['shift']());}};_0x18fbda(++_0x45cbc7);}(_0x8b29,0xbe));var _0x98b2=function(_0x94a3c8,_0x17ffe5){_0x94a3c8=_0x94a3c8-0x0;var _0x3e3949=_0x8b29[_0x94a3c8];return _0x3e3949;};'use strict';var _=require(_0x98b2('0x0'));var squel=require('squel');var as=require(_0x98b2('0x1'));var qs=require(_0x98b2('0x2'));var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x2363fe,_0x20afa9){var _0x5bf7df=![];if(_0x2363fe[_0x98b2('0x3')]==='agent'&&!_0x20afa9[_0x98b2('0x4')]&&!_0x20afa9[_0x98b2('0x5')]&&_0x20afa9[_0x98b2('0x6')]!==_0x98b2('0x7')){_0x5bf7df=!![];}return _0x5bf7df;}function getContactsSubquery(){return squel[_0x98b2('0x8')]()[_0x98b2('0x9')](_0x98b2('0xa'),'c')[_0x98b2('0xb')](_0x98b2('0xc'));}function applyJoinClauses(_0x4481b3,_0x501b51){var _0x48a17e=_0x501b51?'c':_0x98b2('0xd');_0x4481b3[_0x98b2('0xe')](_0x98b2('0xf'),'uc',_0x98b2('0x10')+_0x48a17e+_0x98b2('0x11'))[_0x98b2('0xe')]('cm_contact_has_tags','ct',_0x98b2('0x12')+_0x48a17e+_0x98b2('0x11'))['left_join'](_0x98b2('0x13'),'t',_0x98b2('0x14'));return _0x4481b3;}function addFieldsToQuery(_0x2a6337,_0x4b869a,_0x525889,_0x2d19ee,_0x56bcbd){var _0x2966e2=_0x56bcbd?'c':'subqry';if(!_0x4b869a){_0x4b869a=['id','firstName','lastName',_0x98b2('0x15'),_0x98b2('0x16'),_0x98b2('0x17'),'email','ListId','CompanyId',_0x98b2('0x18'),_0x98b2('0x19'),_0x98b2('0x1a'),_0x98b2('0x1b')];}var _0x4b9f2c=_0x525889&&_0x56bcbd||!_0x525889&&!_0x56bcbd;if(_0x2d19ee){_0x4b9f2c=_0x2d19ee&&_0x56bcbd||!_0x2d19ee&&!_0x56bcbd;}_0x4b869a[_0x98b2('0x1c')](function(_0x588837){if(_0x588837===_0x98b2('0x1b')){if(_0x4b9f2c){_0x2a6337['field'](_0x98b2('0x1d'),_0x588837);}else if(_0x525889||_0x2d19ee){_0x2a6337[_0x98b2('0x1e')](_0x2966e2+'.'+_0x588837);}}else{_0x2a6337[_0x98b2('0x1e')](_0x2966e2+'.'+_0x588837);}});return _0x2a6337;}function getSqlClauses(){var _0x16f5c1={'default':squel['expr'](),'fields':squel[_0x98b2('0x1f')](),'filter':squel[_0x98b2('0x1f')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x16f5c1;}function parseTagParameter(_0x5d6b38){var _0xf45da9=squel['expr']();if(_0x5d6b38){var _0x4ddded=utils[_0x98b2('0x20')](_0x5d6b38);_0x4ddded[_0x98b2('0x1c')](function(_0x4bb825){_0xf45da9['or'](_0x98b2('0x21'),'%,'+_0x4bb825+',%');});}return _0xf45da9;}function parseSearchFilter(_0x13d149){var _0xfae112=squel['expr']();if(_0x13d149){var _0x2a5587=_0x13d149['replace']('\x5c','\x5c\x5c')[_0x98b2('0x22')](/'/g,'\x27\x27');if(_0x2a5587['split']('\x20')['length']>0x1){_0xfae112['or'](_0x98b2('0x23'),qs[_0x98b2('0x24')](_0x2a5587),null);}else{if(qs[_0x98b2('0x25')](_0x2a5587)){_0xfae112['or']('c.id\x20LIKE\x20?',_0x2a5587+'%');_0xfae112['or']('c.phone\x20LIKE\x20?',_0x2a5587+'%');_0xfae112['or']('c.mobile\x20LIKE\x20?',_0x2a5587+'%');_0xfae112['or'](_0x98b2('0x26'),_0x2a5587+'%');}else if(qs[_0x98b2('0x27')](_0x2a5587)){_0xfae112['or']('c.email\x20LIKE\x20?',_0x2a5587+'%');}else{_0xfae112['or'](_0x98b2('0x28'),'%'+_0x2a5587+'%');_0xfae112['or'](_0x98b2('0x29'),'%'+_0x2a5587+'%');_0xfae112['or'](_0x98b2('0x2a'),'%'+_0x2a5587+'%');}}}return _0xfae112;}function parseAdvancedSearchFilter(_0x56efb6,_0x2e1ea4){var _0x1dee11=getSqlClauses();var _0x1f1c55=as[_0x98b2('0x2b')](_0x56efb6);var _0x25393d=_0x1f1c55['sqlOperator'];for(var _0x23883f=0x0;_0x23883f<_0x1f1c55['conditions'][_0x98b2('0x2c')];_0x23883f++){var _0x1aa42a=_0x1f1c55['conditions'][_0x23883f];var _0x2f5156='c';var _0x363174=_['find'](_0x2e1ea4,[_0x98b2('0x2d'),_0x1aa42a[_0x98b2('0x1e')]]);if(_0x363174){if(_0x1aa42a[_0x98b2('0x1e')]===_0x98b2('0x2e')||_0x363174['fieldType']==='datetime'){_0x1aa42a[_0x98b2('0x2f')]=_0x98b2('0x30');}var _0x22b52c=as[_0x98b2('0x31')](_0x2f5156,_0x363174[_0x98b2('0x32')],_0x1aa42a);_0x1dee11[_0x98b2('0x33')][_0x25393d](_0x22b52c['text'],_0x22b52c[_0x98b2('0x34')][_0x98b2('0x35')],_0x22b52c[_0x98b2('0x34')][_0x98b2('0x36')]);}else{if(_0x1aa42a[_0x98b2('0x1e')]===_0x98b2('0x37')){var _0x449fca=_0x1aa42a[_0x98b2('0x34')][_0x98b2('0x38')](',')[_0x98b2('0x39')](function(_0x226b19){return Number(_0x226b19);});var _0x3c470c=parseTagParameter(_0x449fca);_0x1dee11[_0x98b2('0x3a')]['clause']['and'](_0x3c470c);_0x1dee11[_0x98b2('0x3a')][_0x98b2('0x3b')]=_0x449fca;}else if(_0x1aa42a[_0x98b2('0x1e')]===_0x98b2('0x3c')){_0x1dee11[_0x98b2('0x3d')][_0x98b2('0x3e')]['and'](_0x98b2('0x3f'),_0x1aa42a[_0x98b2('0x34')]);_0x1dee11[_0x98b2('0x3d')][_0x98b2('0x40')]=!![];}}}return _0x1dee11;}function parseModelFields(_0x4b9c32,_0x13fe8b){var _0x193d40=squel[_0x98b2('0x1f')]();var _0x178ad1=_(_0x4b9c32)[_0x98b2('0x41')]()[_0x98b2('0x39')](function(_0x3b2808){return _['some'](_0x13fe8b,[_0x98b2('0x2d'),_0x3b2808])?_0x3b2808:undefined;})['compact']()[_0x98b2('0x34')]();if(_0x4b9c32[_0x98b2('0x42')]){_0x178ad1[_0x98b2('0x43')](_0x98b2('0x42'));}if(_0x178ad1['length']>0x0){_0x178ad1['forEach'](function(_0x3d8bc7){if(_0x3d8bc7===_0x98b2('0x5')){_0x193d40[_0x98b2('0x44')]('c.ListId\x20IN\x20?',[][_0x98b2('0x45')](_0x4b9c32[_0x3d8bc7]));}else if(_0x3d8bc7===_0x98b2('0x42')){var _0xeea095='%'+_0x4b9c32[_0x3d8bc7]+'%';_0x193d40[_0x98b2('0x44')](_0x98b2('0x46'),_0xeea095);}else{_0x193d40[_0x98b2('0x44')]('c.'+_0x3d8bc7+'\x20=\x20?',_0x4b9c32[_0x3d8bc7]);}});}return _0x193d40;}function parseQueryParameters(_0xcc7826,_0xbee228){var _0x197749=getSqlClauses();return Promise['resolve']()[_0x98b2('0x47')](function(){return parseModelFields(_0xcc7826,_0xbee228);})[_0x98b2('0x47')](function(_0x3ec182){_0x197749[_0x98b2('0x48')][_0x98b2('0x44')](_0x3ec182);return parseTagParameter(_0xcc7826[_0x98b2('0x49')]);})['then'](function(_0x869644){_0x197749['tags'][_0x98b2('0x3e')][_0x98b2('0x44')](_0x869644);return parseSearchFilter(_0xcc7826[_0x98b2('0x4a')]);})[_0x98b2('0x47')](function(_0x44d858){_0x197749[_0x98b2('0x4a')]=_0x44d858;return _0x197749;});}function checkListsRestrictions(_0x28a742,_0x14f45d,_0x439b5d){var _0x53508e=squel[_0x98b2('0x1f')]();return Promise['resolve']()[_0x98b2('0x47')](function(){if(_0x14f45d[_0x98b2('0x4')]&&_0x28a742[_0x98b2('0x3')]===_0x98b2('0x4b')&&!_0x439b5d){return _0x28a742[_0x98b2('0x4c')]({'attributes':['id'],'raw':!![]});}})[_0x98b2('0x47')](function(_0x53f148){if(_0x53f148){if(_0x53f148[_0x98b2('0x2c')]===0x0){_0x53508e[_0x98b2('0x44')](_0x98b2('0x4d'));}else{_0x53508e[_0x98b2('0x44')](_0x98b2('0x4e'),_['map'](_0x53f148,'id'));}}})['then'](function(){return _0x53508e;});}function buildContactsQuery(_0x133753,_0x3f902e,_0x54f8b7,_0x389581,_0x598bbc,_0x483111){if(_0x3f902e){_0x3f902e=_0x54f8b7['attributes'];}_0x133753=addFieldsToQuery(_0x133753,_0x3f902e,_0x389581,_0x483111,!![]);var _0xea5f5d=squel[_0x98b2('0x8')]();_0xea5f5d=addFieldsToQuery(_0xea5f5d,_0x3f902e,_0x389581,_0x483111,![]);if(_0x389581||_0x483111){_0x133753=applyJoinClauses(_0x133753,!![]);_0x133753[_0x98b2('0x4f')](_0x98b2('0x50'));if(_0x54f8b7[_0x98b2('0x51')]){_0xea5f5d[_0x98b2('0x51')](_0x54f8b7[_0x98b2('0x51')]);}if(_0x54f8b7[_0x98b2('0x52')]){_0xea5f5d[_0x98b2('0x52')](_0x54f8b7['offset']);}}else{_0xea5f5d=applyJoinClauses(_0xea5f5d,![]);_0xea5f5d[_0x98b2('0x4f')]('subqry.id');if(_0x54f8b7[_0x98b2('0x51')]){_0x133753[_0x98b2('0x51')](_0x54f8b7[_0x98b2('0x51')]);}if(_0x54f8b7[_0x98b2('0x52')]){_0x133753['offset'](_0x54f8b7[_0x98b2('0x52')]);}}_0xea5f5d[_0x98b2('0x53')](_0x598bbc);if(_0x54f8b7[_0x98b2('0x54')]){_0x54f8b7[_0x98b2('0x54')][_0x98b2('0x1c')](function(_0x54f7ba){_0x133753[_0x98b2('0x54')]('c.'+_0x54f7ba[0x0],_0x54f7ba[0x1]===_0x98b2('0x55')?![]:!![]);_0xea5f5d[_0x98b2('0x54')](_0x98b2('0x56')+_0x54f7ba[0x0],_0x54f7ba[0x1]===_0x98b2('0x55')?![]:!![]);});}_0xea5f5d[_0x98b2('0x9')](_0x133753,_0x98b2('0xd'));return _0xea5f5d;}function getFilteredContacts(_0x144b62){var _0x175a1b=[];return db[_0x98b2('0x37')][_0x98b2('0x57')]({'attributes':['id',_0x98b2('0x2d'),'color'],'raw':!![]})[_0x98b2('0x47')](function(_0x1cb110){_0x175a1b=_['keyBy'](_0x1cb110,'id');var _0x5116d5={'type':db[_0x98b2('0x58')]['QueryTypes'][_0x98b2('0x59')],'model':db[_0x98b2('0x5a')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x98b2('0x5b')][_0x98b2('0x5c')](_0x144b62[_0x98b2('0x5d')](),_0x5116d5);})[_0x98b2('0x47')](function(_0x5e1272){_0x5e1272[_0x98b2('0x1c')](function(_0x54ab16){if(_0x54ab16['TagIds']){_0x54ab16[_0x98b2('0x5e')]=[];_0x54ab16[_0x98b2('0x1b')]['split'](',')[_0x98b2('0x1c')](function(_0x1253e2){_0x54ab16['Tags'][_0x98b2('0x43')](_0x175a1b[_0x1253e2]);});}delete _0x54ab16[_0x98b2('0x1b')];});return _0x5e1272;});}function countFilteredContacts(_0x14327e,_0x1c9533){var _0x48ed1d=_0x14327e['clone']();_0x48ed1d[_0x98b2('0x1e')](_0x98b2('0x5f'));_0x48ed1d=applyJoinClauses(_0x48ed1d,!![]);_0x14327e[_0x98b2('0x4f')](_0x98b2('0x50'));var _0x3aceb2=utils['getSelectedTags'](_0x1c9533);if(!_['isEmpty'](_0x3aceb2)){_0x48ed1d[_0x98b2('0xb')]('t.id\x20IN\x20?',_0x3aceb2);}var _0x357b04={'type':db[_0x98b2('0x58')][_0x98b2('0x60')][_0x98b2('0x59')],'raw':!![]};return db[_0x98b2('0x5b')][_0x98b2('0x5c')](_0x48ed1d['toString'](),_0x357b04)[_0x98b2('0x47')](function(_0x2663be){return _0x2663be[0x0][_0x98b2('0x5f')];});}module[_0x98b2('0x61')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x688a=['cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','lastName','mobile','email','CompanyId','createdAt','updatedAt','deletedAt','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','value','start','split','map','clause','and','tags','ids','uc.UserId\x20=\x20?','user','skip','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','fields','tag','filter','c.ListId\x20IS\x20NULL','select','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry','Tag','findAll','SELECT','CmContact','sequelize','toString','TagIds','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','QueryTypes','query','lodash','squel','../parsers/advancedSearch','../interaction/utils','role','agent','search','ListId','autocomplete','true','cm_contacts','where','c.deletedAt\x20IS\x20NULL','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join'];(function(_0x5673c6,_0xc302ec){var _0x130bd9=function(_0x1653f5){while(--_0x1653f5){_0x5673c6['push'](_0x5673c6['shift']());}};_0x130bd9(++_0xc302ec);}(_0x688a,0x124));var _0xa688=function(_0x2ea041,_0x473383){_0x2ea041=_0x2ea041-0x0;var _0x4a9680=_0x688a[_0x2ea041];return _0x4a9680;};'use strict';var _=require(_0xa688('0x0'));var squel=require(_0xa688('0x1'));var as=require(_0xa688('0x2'));var qs=require('../parsers/qs');var utils=require(_0xa688('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x27bb04,_0x7a3442){var _0x517509=![];if(_0x27bb04[_0xa688('0x4')]===_0xa688('0x5')&&!_0x7a3442[_0xa688('0x6')]&&!_0x7a3442[_0xa688('0x7')]&&_0x7a3442[_0xa688('0x8')]!==_0xa688('0x9')){_0x517509=!![];}return _0x517509;}function getContactsSubquery(){return squel['select']()['from'](_0xa688('0xa'),'c')[_0xa688('0xb')](_0xa688('0xc'));}function applyJoinClauses(_0x5c3bc6,_0x4d3b92){var _0x42b94e=_0x4d3b92?'c':'subqry';_0x5c3bc6['left_join'](_0xa688('0xd'),'uc',_0xa688('0xe')+_0x42b94e+_0xa688('0xf'))[_0xa688('0x10')](_0xa688('0x11'),'ct',_0xa688('0x12')+_0x42b94e+'.id')['left_join']('tools_tags','t',_0xa688('0x13'));return _0x5c3bc6;}function addFieldsToQuery(_0x33eed4,_0x4cb55d,_0x2a4ecc,_0x5044c7,_0x10c371){var _0x43159e=_0x10c371?'c':'subqry';if(!_0x4cb55d){_0x4cb55d=['id','firstName',_0xa688('0x14'),'phone',_0xa688('0x15'),'fax',_0xa688('0x16'),_0xa688('0x7'),_0xa688('0x17'),_0xa688('0x18'),_0xa688('0x19'),_0xa688('0x1a'),'TagIds'];}var _0x59e392=_0x2a4ecc&&_0x10c371||!_0x2a4ecc&&!_0x10c371;if(_0x5044c7){_0x59e392=_0x5044c7&&_0x10c371||!_0x5044c7&&!_0x10c371;}_0x4cb55d[_0xa688('0x1b')](function(_0x1330d5){if(_0x1330d5==='TagIds'){if(_0x59e392){_0x33eed4['field'](_0xa688('0x1c'),_0x1330d5);}else if(_0x2a4ecc||_0x5044c7){_0x33eed4[_0xa688('0x1d')](_0x43159e+'.'+_0x1330d5);}}else{_0x33eed4['field'](_0x43159e+'.'+_0x1330d5);}});return _0x33eed4;}function getSqlClauses(){var _0x37e9af={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0xa688('0x1e')](),'tags':{'clause':squel[_0xa688('0x1e')](),'ids':null},'user':{'clause':squel[_0xa688('0x1e')](),'skip':![]}};return _0x37e9af;}function parseTagParameter(_0x27f12e){var _0xcccd78=squel[_0xa688('0x1e')]();if(_0x27f12e){var _0x7d9036=utils[_0xa688('0x1f')](_0x27f12e);_0x7d9036[_0xa688('0x1b')](function(_0x1a7bf2){_0xcccd78['or'](_0xa688('0x20'),'%,'+_0x1a7bf2+',%');});}return _0xcccd78;}function parseSearchFilter(_0x301560){var _0x42643=squel[_0xa688('0x1e')]();if(_0x301560){var _0x48cb17=_0x301560[_0xa688('0x21')]('\x5c','\x5c\x5c')[_0xa688('0x21')](/'/g,'\x27\x27');if(_0x48cb17['split']('\x20')[_0xa688('0x22')]>0x1){_0x42643['or'](_0xa688('0x23'),qs['getFullTextValue'](_0x48cb17),null);}else{if(qs[_0xa688('0x24')](_0x48cb17)){_0x42643['or'](_0xa688('0x25'),_0x48cb17+'%');_0x42643['or'](_0xa688('0x26'),_0x48cb17+'%');_0x42643['or'](_0xa688('0x27'),_0x48cb17+'%');_0x42643['or'](_0xa688('0x28'),_0x48cb17+'%');}else if(qs[_0xa688('0x29')](_0x48cb17)){_0x42643['or'](_0xa688('0x2a'),_0x48cb17+'%');}else{_0x42643['or'](_0xa688('0x2b'),'%'+_0x48cb17+'%');_0x42643['or'](_0xa688('0x2c'),'%'+_0x48cb17+'%');_0x42643['or'](_0xa688('0x2a'),'%'+_0x48cb17+'%');}}}return _0x42643;}function parseAdvancedSearchFilter(_0x3ab038,_0x161741){var _0x3c7245=getSqlClauses();var _0x12a35a=as[_0xa688('0x2d')](_0x3ab038);var _0x5d1657=_0x12a35a[_0xa688('0x2e')];for(var _0x1bdd8e=0x0;_0x1bdd8e<_0x12a35a[_0xa688('0x2f')][_0xa688('0x22')];_0x1bdd8e++){var _0x3d52fc=_0x12a35a[_0xa688('0x2f')][_0x1bdd8e];var _0x49e148='c';var _0x5b0527=_['find'](_0x161741,[_0xa688('0x30'),_0x3d52fc['field']]);if(_0x5b0527){if(_0x3d52fc[_0xa688('0x1d')]===_0xa688('0x31')||_0x5b0527[_0xa688('0x32')]===_0xa688('0x33')){_0x3d52fc[_0xa688('0x34')]=_0xa688('0x35');}var _0x357d21=as['buildExpression'](_0x49e148,_0x5b0527['type'],_0x3d52fc);_0x3c7245['default'][_0x5d1657](_0x357d21['text'],_0x357d21[_0xa688('0x36')][_0xa688('0x37')],_0x357d21[_0xa688('0x36')]['end']);}else{if(_0x3d52fc[_0xa688('0x1d')]==='Tag'){var _0x59f645=_0x3d52fc['value'][_0xa688('0x38')](',')[_0xa688('0x39')](function(_0x42677b){return Number(_0x42677b);});var _0x5c8b2f=parseTagParameter(_0x59f645);_0x3c7245['tags'][_0xa688('0x3a')][_0xa688('0x3b')](_0x5c8b2f);_0x3c7245[_0xa688('0x3c')][_0xa688('0x3d')]=_0x59f645;}else if(_0x3d52fc[_0xa688('0x1d')]==='User'){_0x3c7245['user'][_0xa688('0x3a')]['and'](_0xa688('0x3e'),_0x3d52fc[_0xa688('0x36')]);_0x3c7245[_0xa688('0x3f')][_0xa688('0x40')]=!![];}}}return _0x3c7245;}function parseModelFields(_0x5a8074,_0x1a17ab){var _0x5cf64d=squel['expr']();var _0x423918=_(_0x5a8074)['keys']()[_0xa688('0x39')](function(_0x5bb763){return _[_0xa688('0x41')](_0x1a17ab,[_0xa688('0x30'),_0x5bb763])?_0x5bb763:undefined;})[_0xa688('0x42')]()['value']();if(_0x5a8074[_0xa688('0x43')]){_0x423918[_0xa688('0x44')](_0xa688('0x43'));}if(_0x423918[_0xa688('0x22')]>0x0){_0x423918[_0xa688('0x1b')](function(_0x20c815){if(_0x20c815===_0xa688('0x7')){_0x5cf64d[_0xa688('0x3b')](_0xa688('0x45'),[][_0xa688('0x46')](_0x5a8074[_0x20c815]));}else if(_0x20c815===_0xa688('0x43')){var _0x4fe5b1='%'+_0x5a8074[_0x20c815]+'%';_0x5cf64d[_0xa688('0x3b')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x4fe5b1);}else{_0x5cf64d[_0xa688('0x3b')]('c.'+_0x20c815+_0xa688('0x47'),_0x5a8074[_0x20c815]);}});}return _0x5cf64d;}function parseQueryParameters(_0x1b901d,_0x3242fd){var _0x56a5e5=getSqlClauses();return Promise[_0xa688('0x48')]()[_0xa688('0x49')](function(){return parseModelFields(_0x1b901d,_0x3242fd);})['then'](function(_0x1eb805){_0x56a5e5[_0xa688('0x4a')][_0xa688('0x3b')](_0x1eb805);return parseTagParameter(_0x1b901d[_0xa688('0x4b')]);})[_0xa688('0x49')](function(_0x1f9ce6){_0x56a5e5[_0xa688('0x3c')][_0xa688('0x3a')][_0xa688('0x3b')](_0x1f9ce6);return parseSearchFilter(_0x1b901d['filter']);})[_0xa688('0x49')](function(_0x2c0b03){_0x56a5e5[_0xa688('0x4c')]=_0x2c0b03;return _0x56a5e5;});}function checkListsRestrictions(_0xe541e0,_0x394ae1,_0x35050c){var _0x451da8=squel[_0xa688('0x1e')]();return Promise['resolve']()[_0xa688('0x49')](function(){if(_0x394ae1[_0xa688('0x6')]&&_0xe541e0[_0xa688('0x4')]===_0xa688('0x5')&&!_0x35050c){return _0xe541e0['getLists']({'attributes':['id'],'raw':!![]});}})[_0xa688('0x49')](function(_0x243147){if(_0x243147){if(_0x243147['length']===0x0){_0x451da8[_0xa688('0x3b')](_0xa688('0x4d'));}else{_0x451da8[_0xa688('0x3b')](_0xa688('0x45'),_[_0xa688('0x39')](_0x243147,'id'));}}})[_0xa688('0x49')](function(){return _0x451da8;});}function buildContactsQuery(_0x542370,_0x900203,_0x21ed29,_0x2f4621,_0x4d9f53,_0x1bcb64){if(_0x900203){_0x900203=_0x21ed29['attributes'];}_0x542370=addFieldsToQuery(_0x542370,_0x900203,_0x2f4621,_0x1bcb64,!![]);var _0x49b3e0=squel[_0xa688('0x4e')]();_0x49b3e0=addFieldsToQuery(_0x49b3e0,_0x900203,_0x2f4621,_0x1bcb64,![]);if(_0x2f4621||_0x1bcb64){_0x542370=applyJoinClauses(_0x542370,!![]);_0x542370[_0xa688('0x4f')](_0xa688('0x50'));if(_0x21ed29[_0xa688('0x51')]){_0x49b3e0[_0xa688('0x51')](_0x21ed29['limit']);}if(_0x21ed29[_0xa688('0x52')]){_0x49b3e0[_0xa688('0x52')](_0x21ed29[_0xa688('0x52')]);}}else{_0x49b3e0=applyJoinClauses(_0x49b3e0,![]);_0x49b3e0[_0xa688('0x4f')](_0xa688('0x53'));if(_0x21ed29[_0xa688('0x51')]){_0x542370[_0xa688('0x51')](_0x21ed29['limit']);}if(_0x21ed29[_0xa688('0x52')]){_0x542370[_0xa688('0x52')](_0x21ed29[_0xa688('0x52')]);}}_0x49b3e0[_0xa688('0x54')](_0x4d9f53);if(_0x21ed29['order']){_0x21ed29[_0xa688('0x55')][_0xa688('0x1b')](function(_0x416bfd){_0x542370[_0xa688('0x55')]('c.'+_0x416bfd[0x0],_0x416bfd[0x1]===_0xa688('0x56')?![]:!![]);_0x49b3e0[_0xa688('0x55')]('subqry.'+_0x416bfd[0x0],_0x416bfd[0x1]===_0xa688('0x56')?![]:!![]);});}_0x49b3e0['from'](_0x542370,_0xa688('0x57'));return _0x49b3e0;}function getFilteredContacts(_0x58753e){var _0x5e1235=[];return db[_0xa688('0x58')][_0xa688('0x59')]({'attributes':['id',_0xa688('0x30'),'color'],'raw':!![]})[_0xa688('0x49')](function(_0x4cdd25){_0x5e1235=_['keyBy'](_0x4cdd25,'id');var _0x522947={'type':db['Sequelize']['QueryTypes'][_0xa688('0x5a')],'model':db[_0xa688('0x5b')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xa688('0x5c')]['query'](_0x58753e[_0xa688('0x5d')](),_0x522947);})['then'](function(_0x268ebc){_0x268ebc[_0xa688('0x1b')](function(_0x3adf43){if(_0x3adf43[_0xa688('0x5e')]){_0x3adf43[_0xa688('0x5f')]=[];_0x3adf43[_0xa688('0x5e')][_0xa688('0x38')](',')[_0xa688('0x1b')](function(_0x2571be){_0x3adf43[_0xa688('0x5f')]['push'](_0x5e1235[_0x2571be]);});}delete _0x3adf43['TagIds'];});return _0x268ebc;});}function countFilteredContacts(_0x537ea6,_0x4bdb86){var _0x26efbb=_0x537ea6[_0xa688('0x60')]();_0x26efbb[_0xa688('0x1d')](_0xa688('0x61'));_0x26efbb=applyJoinClauses(_0x26efbb,!![]);_0x537ea6[_0xa688('0x4f')](_0xa688('0x50'));var _0x2dc105=utils[_0xa688('0x1f')](_0x4bdb86);if(!_[_0xa688('0x62')](_0x2dc105)){_0x26efbb[_0xa688('0xb')](_0xa688('0x63'),_0x2dc105);}var _0x3377ac={'type':db[_0xa688('0x64')][_0xa688('0x65')]['SELECT'],'raw':!![]};return db['sequelize'][_0xa688('0x66')](_0x26efbb['toString'](),_0x3377ac)['then'](function(_0x10bd5f){return _0x10bd5f[0x0][_0xa688('0x61')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 55ec8d5..3cefed5 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 _0x16ab=['encryptFile','createReadStream','createWriteStream','createCipher','binary','end','final','write','close','createDecipher','encryptString','update','base64','decryptString','secret','utf8','crypto','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x16ab,0x6d));var _0xb16a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x16ab[_0x11005e];return _0x29338f;};'use strict';var crypto=require(_0xb16a('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xb16a('0x1'));var config=require(_0xb16a('0x2'));var logger=require(_0xb16a('0x3'))(_0xb16a('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0xb16a('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0xb16a('0x6')]&&config[_0xb16a('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xb16a('0x6')][_0xb16a('0x7')]);if(isSupported){fileOptions[_0xb16a('0x7')]=config['encrypt'][_0xb16a('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xb16a('0x8')](config[_0xb16a('0x6')]['algorithm'],_0xb16a('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x1dc0bd){return AES_SUPPORTED_RX[_0xb16a('0xa')](_0x1dc0bd);}function getSupportedCiphers(){return crypto[_0xb16a('0xb')]()[_0xb16a('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x3cdf23){return getSupportedCiphers()[_0xb16a('0xd')](_0x3cdf23)>-0x1;}function combineOptions(_0x497225){var _0x384561={};for(var _0x35d2c6 in fileOptions){if(fileOptions['hasOwnProperty'](_0x35d2c6)){_0x384561[_0x35d2c6]=fileOptions[_0x35d2c6];}}if(_0x497225){for(var _0x1bdbe1 in _0x497225){if(_0x497225[_0xb16a('0xe')](_0x1bdbe1)){_0x384561[_0x1bdbe1]=_0x497225[_0x1bdbe1];}}}return _0x384561;}exports[_0xb16a('0xf')]=function(_0x511a93,_0x18e8fe,_0x437ed4,_0x2ffa71){return new BPromise(function(_0x5d4186,_0x45e502){_0x2ffa71=combineOptions(_0x2ffa71);var _0x154e29=new Buffer(_0x437ed4);var _0x572600=fs[_0xb16a('0x10')](_0x511a93);var _0x5727d5=fs[_0xb16a('0x11')](_0x18e8fe);var _0x1a8974=crypto[_0xb16a('0x12')](_0x2ffa71[_0xb16a('0x7')],_0x154e29);_0x572600['on']('data',function(_0x1c78bb){var _0x4abf6f=new Buffer(_0x1a8974['update'](_0x1c78bb),_0xb16a('0x13'));_0x5727d5['write'](_0x4abf6f);});_0x572600['on'](_0xb16a('0x14'),function(){try{var _0x2fd916=new Buffer(_0x1a8974[_0xb16a('0x15')](_0xb16a('0x13')),'binary');_0x5727d5[_0xb16a('0x16')](_0x2fd916);_0x5727d5['end']();_0x5727d5['on'](_0xb16a('0x17'),function(){return _0x5d4186(_0x18e8fe);});}catch(_0x313c39){fs['unlink'](_0x18e8fe);return _0x45e502(_0x313c39);}});});};exports['decryptFile']=function(_0x2de5df,_0xd225e6,_0x4d6618,_0x5d0386){return new BPromise(function(_0x4781e2,_0x12ab49){_0x5d0386=combineOptions(_0x5d0386);var _0x8c63f2=new Buffer(_0x4d6618);var _0x2e46d3=fs[_0xb16a('0x10')](_0x2de5df);var _0x5cda06=fs['createWriteStream'](_0xd225e6);var _0x1867b5=crypto[_0xb16a('0x18')](_0x5d0386[_0xb16a('0x7')],_0x8c63f2);_0x2e46d3['on']('data',function(_0x3e3125){var _0x3b0232=new Buffer(_0x1867b5['update'](_0x3e3125),_0xb16a('0x13'));_0x5cda06['write'](_0x3b0232);});_0x2e46d3['on']('end',function(){try{var _0x1eb81f=new Buffer(_0x1867b5[_0xb16a('0x15')](_0xb16a('0x13')),'binary');_0x5cda06[_0xb16a('0x16')](_0x1eb81f);_0x5cda06[_0xb16a('0x14')]();_0x5cda06['on'](_0xb16a('0x17'),function(){return _0x4781e2(_0xd225e6);});}catch(_0x5b6745){fs['unlink'](_0xd225e6);return _0x12ab49(_0x5b6745);}});});};exports[_0xb16a('0x19')]=function(_0x1754d9,_0x1d3aae,_0xbe4bb){var _0x7066bc=_0xbe4bb||stringOptions[_0xb16a('0x7')];var _0x4ee673=_0x1d3aae||stringOptions['secret'];var _0x40bc28=crypto[_0xb16a('0x12')](_0x7066bc,_0x4ee673);var _0x22985f=_0x40bc28[_0xb16a('0x1a')](_0x1754d9,'utf8',_0xb16a('0x1b'));_0x22985f+=_0x40bc28[_0xb16a('0x15')](_0xb16a('0x1b'));return _0x22985f;};exports[_0xb16a('0x1c')]=function(_0x4f6f32,_0x35a333,_0x3c3e27){var _0x55fb06=_0x3c3e27||stringOptions[_0xb16a('0x7')];var _0x335634=_0x35a333||stringOptions[_0xb16a('0x1d')];var _0x42337e=crypto[_0xb16a('0x18')](_0x55fb06,_0x335634);var _0x315cfa=_0x42337e[_0xb16a('0x1a')](_0x4f6f32,'base64',_0xb16a('0x1e'));_0x315cfa+=_0x42337e[_0xb16a('0x15')]('utf8');return _0x315cfa;}; \ No newline at end of file +var _0x815b=['final','binary','close','unlink','decryptFile','createDecipher','data','secret','utf8','base64','decryptString','crypto','lodash','../../config/environment','app','secrets','session','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','write','end'];(function(_0x18eba0,_0x324dcb){var _0x8b825b=function(_0x5e631f){while(--_0x5e631f){_0x18eba0['push'](_0x18eba0['shift']());}};_0x8b825b(++_0x324dcb);}(_0x815b,0x16b));var _0xb815=function(_0x5c0150,_0x35ce78){_0x5c0150=_0x5c0150-0x0;var _0x4be130=_0x815b[_0x5c0150];return _0x4be130;};'use strict';var crypto=require(_0xb815('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xb815('0x1'));var config=require(_0xb815('0x2'));var logger=require('../../config/logger')(_0xb815('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb815('0x4')][_0xb815('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0xb815('0x6')]&&config[_0xb815('0x6')][_0xb815('0x7')]){var isSupported=isAlgorithmSupported(config[_0xb815('0x6')][_0xb815('0x7')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0xb815('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb815('0x8')](',\x20');logger[_0xb815('0x9')](config['encrypt'][_0xb815('0x7')],_0xb815('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x4daf76){return AES_SUPPORTED_RX[_0xb815('0xb')](_0x4daf76);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x2a505d){return getSupportedCiphers()[_0xb815('0xc')](_0x2a505d)>-0x1;}function combineOptions(_0x10c13a){var _0x21f052={};for(var _0xbf6719 in fileOptions){if(fileOptions[_0xb815('0xd')](_0xbf6719)){_0x21f052[_0xbf6719]=fileOptions[_0xbf6719];}}if(_0x10c13a){for(var _0x530b81 in _0x10c13a){if(_0x10c13a[_0xb815('0xd')](_0x530b81)){_0x21f052[_0x530b81]=_0x10c13a[_0x530b81];}}}return _0x21f052;}exports[_0xb815('0xe')]=function(_0x87db36,_0x4e9f74,_0xf9109,_0x1a1615){return new BPromise(function(_0x5158b7,_0x879642){_0x1a1615=combineOptions(_0x1a1615);var _0x5d377e=new Buffer(_0xf9109);var _0x36b154=fs[_0xb815('0xf')](_0x87db36);var _0x5c734f=fs[_0xb815('0x10')](_0x4e9f74);var _0x191b83=crypto[_0xb815('0x11')](_0x1a1615['algorithm'],_0x5d377e);_0x36b154['on']('data',function(_0x2ebbff){var _0x7f0ca4=new Buffer(_0x191b83[_0xb815('0x12')](_0x2ebbff),'binary');_0x5c734f[_0xb815('0x13')](_0x7f0ca4);});_0x36b154['on'](_0xb815('0x14'),function(){try{var _0xc2e51f=new Buffer(_0x191b83[_0xb815('0x15')](_0xb815('0x16')),_0xb815('0x16'));_0x5c734f['write'](_0xc2e51f);_0x5c734f[_0xb815('0x14')]();_0x5c734f['on'](_0xb815('0x17'),function(){return _0x5158b7(_0x4e9f74);});}catch(_0x1dbe8e){fs[_0xb815('0x18')](_0x4e9f74);return _0x879642(_0x1dbe8e);}});});};exports[_0xb815('0x19')]=function(_0x24bdda,_0x28fadc,_0x1d4f2c,_0x48813c){return new BPromise(function(_0x52d349,_0x8ca705){_0x48813c=combineOptions(_0x48813c);var _0x542199=new Buffer(_0x1d4f2c);var _0x30587f=fs[_0xb815('0xf')](_0x24bdda);var _0x413edf=fs['createWriteStream'](_0x28fadc);var _0x3da396=crypto[_0xb815('0x1a')](_0x48813c[_0xb815('0x7')],_0x542199);_0x30587f['on'](_0xb815('0x1b'),function(_0x2db398){var _0x54364c=new Buffer(_0x3da396[_0xb815('0x12')](_0x2db398),'binary');_0x413edf[_0xb815('0x13')](_0x54364c);});_0x30587f['on'](_0xb815('0x14'),function(){try{var _0x2808b1=new Buffer(_0x3da396[_0xb815('0x15')](_0xb815('0x16')),_0xb815('0x16'));_0x413edf[_0xb815('0x13')](_0x2808b1);_0x413edf[_0xb815('0x14')]();_0x413edf['on'](_0xb815('0x17'),function(){return _0x52d349(_0x28fadc);});}catch(_0x150e06){fs[_0xb815('0x18')](_0x28fadc);return _0x8ca705(_0x150e06);}});});};exports['encryptString']=function(_0x173b75,_0x41c672,_0x451a5c){var _0x11ee40=_0x451a5c||stringOptions[_0xb815('0x7')];var _0x34718c=_0x41c672||stringOptions[_0xb815('0x1c')];var _0x1a795d=crypto['createCipher'](_0x11ee40,_0x34718c);var _0x5ec8fa=_0x1a795d['update'](_0x173b75,_0xb815('0x1d'),_0xb815('0x1e'));_0x5ec8fa+=_0x1a795d[_0xb815('0x15')](_0xb815('0x1e'));return _0x5ec8fa;};exports[_0xb815('0x1f')]=function(_0x54b16d,_0x22f78c,_0xc116f0){var _0x2b2583=_0xc116f0||stringOptions[_0xb815('0x7')];var _0x57e61f=_0x22f78c||stringOptions[_0xb815('0x1c')];var _0x4d2b09=crypto[_0xb815('0x1a')](_0x2b2583,_0x57e61f);var _0x1f131b=_0x4d2b09[_0xb815('0x12')](_0x54b16d,'base64',_0xb815('0x1d'));_0x1f131b+=_0x4d2b09['final'](_0xb815('0x1d'));return _0x1f131b;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 22f5dc9..12b47d8 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 _0x7bf5=['splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','mkdirSync','join','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','Failed','finally','exit','util','path','lodash','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find'];(function(_0x105aaa,_0x358e95){var _0xe4b1fa=function(_0x52b5aa){while(--_0x52b5aa){_0x105aaa['push'](_0x105aaa['shift']());}};_0xe4b1fa(++_0x358e95);}(_0x7bf5,0x167));var _0x57bf=function(_0xf17965,_0x31747d){_0xf17965=_0xf17965-0x0;var _0x398a12=_0x7bf5[_0xf17965];return _0x398a12;};'use strict';var util=require(_0x57bf('0x0'));var path=require(_0x57bf('0x1'));var _=require(_0x57bf('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x57bf('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x57bf('0x4'));var db=require(_0x57bf('0x5'))['db'];var dbH=require('../../mysqldb')[_0x57bf('0x6')];var logger=require(_0x57bf('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x57bf('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x57bf('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2331f0,_0x19fabe){var _0x1c6c0d={'status':_0x2331f0};var _0x284e67={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x19fabe){_0x1c6c0d[_0x57bf('0x9')]=_0x19fabe;}return db[_0x57bf('0xa')][_0x57bf('0xb')](_0x1c6c0d,_0x284e67);}function main(){var _0x1a1766=0x1388;var _0x4f687e;logger[_0x57bf('0xc')](util[_0x57bf('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x57bf('0xe')));return db[_0x57bf('0xf')][_0x57bf('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x57bf('0x11')]})[_0x57bf('0x12')](function(_0x18b677){if(_0x18b677){_0x4f687e=_0x18b677;_0x1a1766=_0x4f687e[_0x57bf('0x11')]||0x1388;}})[_0x57bf('0x12')](function(){return dbH[_0x57bf('0x13')][_0x57bf('0x14')](util['format'](_0x57bf('0x15'),QUERY),{'type':dbH[_0x57bf('0x13')][_0x57bf('0x16')][_0x57bf('0x17')]});})['then'](function(_0x3903cd){if(!_0x3903cd[0x0][_0x57bf('0x18')]){return analyticExtractedReport(_0x57bf('0x19'));}var _0x412aa6=[];var _0x357233=0x0;if(_0x4f687e[_0x57bf('0x1a')]){if(_0x3903cd&&_0x3903cd[_0x57bf('0x1b')]){var _0x272ef4=_['range'](_0x3903cd[0x0][_0x57bf('0x18')]/_0x1a1766);var _0x30b714=Number['isInteger'](_0x3903cd[0x0][_0x57bf('0x18')]/_0x1a1766)?_0x3903cd[0x0][_0x57bf('0x18')]%_0x1a1766:0x0;_0x272ef4[_0x57bf('0x1c')](function(_0x609879){if(_0x609879>0x0){_0x357233+=_0x1a1766;}_0x412aa6['push'](dbH[_0x57bf('0x13')]['query'](util['format'](_0x57bf('0x1d'),QUERY,_0x1a1766,_0x357233),{'type':dbH[_0x57bf('0x13')][_0x57bf('0x16')][_0x57bf('0x17')]}));});if(_0x30b714>0x0){_0x357233+=_0x1a1766;_0x412aa6[_0x57bf('0x1e')](dbH[_0x57bf('0x13')]['query'](util[_0x57bf('0xd')](_0x57bf('0x1d'),QUERY,_0x30b714,_0x357233),{'type':dbH['sequelize'][_0x57bf('0x16')][_0x57bf('0x17')]}));}}}else{_0x412aa6[_0x57bf('0x1e')](dbH[_0x57bf('0x13')][_0x57bf('0x14')](QUERY,{'type':dbH['sequelize'][_0x57bf('0x16')][_0x57bf('0x17')]}));}var _0xf312a=path[_0x57bf('0x1f')](PATH);var _0x4726bd=path[_0x57bf('0x20')](PATH,_0x57bf('0x21'));var _0x3c05f1=_0x4f687e['split']&&_0x412aa6[_0x57bf('0x1b')]>0x1;var _0x2338da=[];if(!fs['existsSync'](path['join'](_0xf312a,_0x4726bd))&&_0x3c05f1){fs[_0x57bf('0x22')](path[_0x57bf('0x23')](_0xf312a,_0x4726bd));}return BPromise[_0x57bf('0x24')](_0x412aa6,function(_0x51851e){_0x2338da[_0x57bf('0x1e')](_0x51851e);})[_0x57bf('0x12')](function(){for(var _0x3f6bc3=0x0;_0x3f6bc3<_0x2338da[_0x57bf('0x1b')];_0x3f6bc3+=0x1){var _0x4a76fa;var _0x23b332=_0x2338da[_0x3f6bc3];if(_0x3c05f1){_0x4a76fa=path['join'](_0xf312a,_0x4726bd,util[_0x57bf('0xd')](_0x57bf('0x25'),_0x4726bd,_0x3f6bc3,_0x57bf('0x26')));}else{_0x4a76fa=path[_0x57bf('0x23')](_0xf312a,util[_0x57bf('0xd')](_0x57bf('0x27'),_0x4726bd,_0x57bf('0x26')));}fs['writeFileSync'](_0x4a76fa,csv(_0x23b332));}})[_0x57bf('0x12')](function(){if(_0x3c05f1){return new Promise(function(_0x13c2f0){zipdir(path[_0x57bf('0x23')](_0xf312a,_0x4726bd),{'saveTo':path[_0x57bf('0x23')](_0xf312a,util[_0x57bf('0xd')](_0x57bf('0x27'),_0x4726bd,_0x57bf('0x28')))},function(_0x519dc9,_0x585f46){rimraf(path[_0x57bf('0x23')](_0xf312a,_0x4726bd),function(){});_0x13c2f0('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0x57bf('0xd')](_0x57bf('0x29'),EXTRACTED_REPORT_ID,_0x57bf('0xe')));return analyticExtractedReport('Completed',_0x3c05f1?util[_0x57bf('0xd')](_0x57bf('0x27'),_0x4726bd,_0x3c05f1?_0x57bf('0x28'):_0x57bf('0x26')):null);});})[_0x57bf('0x2a')](function(_0x4b689d){logger['info'](util[_0x57bf('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x57bf('0xe')),util[_0x57bf('0x2b')](_0x4b689d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x57bf('0x2c'));})[_0x57bf('0x2d')](function(){process[_0x57bf('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4208=['Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','mkdirSync','join','%s%d.%s','csv','%s.%s','writeFileSync','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','Failed','finally','exit','util','lodash','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num'];(function(_0x2e5b6b,_0x37df25){var _0xfc3568=function(_0x214a2f){while(--_0x214a2f){_0x2e5b6b['push'](_0x2e5b6b['shift']());}};_0xfc3568(++_0x37df25);}(_0x4208,0x145));var _0x8420=function(_0x2ec5b9,_0x56e0a3){_0x2ec5b9=_0x2ec5b9-0x0;var _0x10dcea=_0x4208[_0x2ec5b9];return _0x10dcea;};'use strict';var util=require(_0x8420('0x0'));var path=require('path');var _=require(_0x8420('0x1'));var csv=require(_0x8420('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x8420('0x3'));var rimraf=require(_0x8420('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8420('0x5'))['dbH'];var logger=require(_0x8420('0x6'))(_0x8420('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x8420('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x8420('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3dac01,_0x360f16){var _0x461dbc={'status':_0x3dac01};var _0x1ab67e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x360f16){_0x461dbc[_0x8420('0x9')]=_0x360f16;}return db[_0x8420('0xa')]['update'](_0x461dbc,_0x1ab67e);}function main(){var _0x265a48=0x1388;var _0x1a423e;logger['info'](util[_0x8420('0xb')](_0x8420('0xc'),EXTRACTED_REPORT_ID,_0x8420('0xd')));return db[_0x8420('0xe')][_0x8420('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8420('0x10'),'splitSizeCsv']})[_0x8420('0x11')](function(_0x22411e){if(_0x22411e){_0x1a423e=_0x22411e;_0x265a48=_0x1a423e[_0x8420('0x12')]||0x1388;}})[_0x8420('0x11')](function(){return dbH[_0x8420('0x13')][_0x8420('0x14')](util[_0x8420('0xb')](_0x8420('0x15'),QUERY),{'type':dbH['sequelize'][_0x8420('0x16')][_0x8420('0x17')]});})[_0x8420('0x11')](function(_0x53938a){if(!_0x53938a[0x0][_0x8420('0x18')]){return analyticExtractedReport(_0x8420('0x19'));}var _0x89f852=[];var _0x354c4b=0x0;if(_0x1a423e['split']){if(_0x53938a&&_0x53938a[_0x8420('0x1a')]){var _0x5242a4=_['range'](_0x53938a[0x0][_0x8420('0x18')]/_0x265a48);var _0x4b356b=Number['isInteger'](_0x53938a[0x0][_0x8420('0x18')]/_0x265a48)?_0x53938a[0x0]['num']%_0x265a48:0x0;_0x5242a4['forEach'](function(_0x1a58c5){if(_0x1a58c5>0x0){_0x354c4b+=_0x265a48;}_0x89f852[_0x8420('0x1b')](dbH[_0x8420('0x13')][_0x8420('0x14')](util[_0x8420('0xb')](_0x8420('0x1c'),QUERY,_0x265a48,_0x354c4b),{'type':dbH[_0x8420('0x13')][_0x8420('0x16')][_0x8420('0x17')]}));});if(_0x4b356b>0x0){_0x354c4b+=_0x265a48;_0x89f852[_0x8420('0x1b')](dbH['sequelize']['query'](util[_0x8420('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4b356b,_0x354c4b),{'type':dbH[_0x8420('0x13')][_0x8420('0x16')][_0x8420('0x17')]}));}}}else{_0x89f852[_0x8420('0x1b')](dbH[_0x8420('0x13')][_0x8420('0x14')](QUERY,{'type':dbH[_0x8420('0x13')]['QueryTypes']['SELECT']}));}var _0x17f5d8=path[_0x8420('0x1d')](PATH);var _0x32bc97=path[_0x8420('0x1e')](PATH,_0x8420('0x1f'));var _0x2e21bc=_0x1a423e['split']&&_0x89f852[_0x8420('0x1a')]>0x1;var _0x498369=[];if(!fs[_0x8420('0x20')](path['join'](_0x17f5d8,_0x32bc97))&&_0x2e21bc){fs[_0x8420('0x21')](path['join'](_0x17f5d8,_0x32bc97));}return BPromise['each'](_0x89f852,function(_0x5254ac){_0x498369[_0x8420('0x1b')](_0x5254ac);})[_0x8420('0x11')](function(){for(var _0x3f5dff=0x0;_0x3f5dff<_0x498369[_0x8420('0x1a')];_0x3f5dff+=0x1){var _0x3f150a;var _0x380030=_0x498369[_0x3f5dff];if(_0x2e21bc){_0x3f150a=path[_0x8420('0x22')](_0x17f5d8,_0x32bc97,util[_0x8420('0xb')](_0x8420('0x23'),_0x32bc97,_0x3f5dff,_0x8420('0x24')));}else{_0x3f150a=path['join'](_0x17f5d8,util[_0x8420('0xb')](_0x8420('0x25'),_0x32bc97,'csv'));}fs[_0x8420('0x26')](_0x3f150a,csv(_0x380030));}})[_0x8420('0x11')](function(){if(_0x2e21bc){return new Promise(function(_0x4da53b){zipdir(path[_0x8420('0x22')](_0x17f5d8,_0x32bc97),{'saveTo':path['join'](_0x17f5d8,util[_0x8420('0xb')](_0x8420('0x25'),_0x32bc97,_0x8420('0x27')))},function(_0x13ee8f,_0x23a079){rimraf(path[_0x8420('0x22')](_0x17f5d8,_0x32bc97),function(){});_0x4da53b(_0x8420('0x28'));});});}})[_0x8420('0x11')](function(){logger[_0x8420('0x29')](util[_0x8420('0xb')](_0x8420('0x2a'),EXTRACTED_REPORT_ID,_0x8420('0xd')));return analyticExtractedReport(_0x8420('0x2b'),_0x2e21bc?util[_0x8420('0xb')](_0x8420('0x25'),_0x32bc97,_0x2e21bc?_0x8420('0x27'):_0x8420('0x24')):null);});})[_0x8420('0x2c')](function(_0x5dd5bd){logger[_0x8420('0x29')](util[_0x8420('0xb')](_0x8420('0x2d'),EXTRACTED_REPORT_ID,_0x8420('0xd')),util[_0x8420('0x2e')](_0x5dd5bd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8420('0x2f'));})[_0x8420('0x30')](function(){process[_0x8420('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index f5f8c1a..a9b47bb 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 _0xb07e=['isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','basename','.pdf','join','mkdirSync','each','createPdfKitDocument','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','toString','value','fill','length','auto','body','concat','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','pageBreak','before','landscape','\x20/\x20','Arial','black','right','Setting','find','split','splitSizePdf','then','range','num'];(function(_0x20f574,_0x225472){var _0x2048ed=function(_0x33d888){while(--_0x33d888){_0x20f574['push'](_0x20f574['shift']());}};_0x2048ed(++_0x225472);}(_0xb07e,0x83));var _0xeb07=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xb07e[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xeb07('0x0'));var fs=require('fs');var util=require(_0xeb07('0x1'));var path=require(_0xeb07('0x2'));var moment=require(_0xeb07('0x3'));var htmlToPdfmake=require(_0xeb07('0x4'));var PdfPrinter=require(_0xeb07('0x5'));var zipdir=require(_0xeb07('0x6'));var rimraf=require(_0xeb07('0x7'));var JSDOM=require(_0xeb07('0x8'))['JSDOM'];var window=new JSDOM('')[_0xeb07('0x9')];var BPromise=require(_0xeb07('0xa'));var db=require(_0xeb07('0xb'))['db'];var dbH=require(_0xeb07('0xb'))['dbH'];var logger=require(_0xeb07('0xc'))(_0xeb07('0xd'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xeb07('0xe')][0x3];var PATH=process[_0xeb07('0xe')][0x4];var NAME=process[_0xeb07('0xe')][0x5];var FORMAT=_0xeb07('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e4615,_0x45e05c){var _0x3b5a8f={'status':_0x2e4615};var _0x24cdfa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45e05c){_0x3b5a8f[_0xeb07('0x10')]=_0x45e05c;}return db[_0xeb07('0x11')]['update'](_0x3b5a8f,_0x24cdfa);}function getHeaders(_0x3debfd){return _[_0xeb07('0x12')](_0x3debfd,function(_0x3c3896){return{'text':_0x3c3896,'style':'tableHeader'};});}function getRows(_0x4dab7f,_0x5f27c1){return _['map'](_0x5f27c1,function(_0x12c285){return _(_0x12c285)['pick'](_0x4dab7f)['map'](function(_0x30d05c){return _0x30d05c?_[_0xeb07('0x13')](_0x30d05c):'';})[_0xeb07('0x14')]();});}function createTable(_0x1125e8,_0x1803aa){var _0x532294={'widths':_[_0xeb07('0x15')](Array(_0x1125e8[_0xeb07('0x16')]),0x91),'heights':function(_0x4ea475){return _0x4ea475===0x0?_0xeb07('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x58ba82=getHeaders(_0x1125e8);_0x532294[_0xeb07('0x18')]['push'](_0x58ba82);var _0x18fb37=getRows(_0x1125e8,_0x1803aa);_0x532294['body']=_0x532294[_0xeb07('0x18')][_0xeb07('0x19')](_0x18fb37);return _0x532294;}function createTables(_0x515072){var _0xbec7a1=[];var _0x44689a=_['chunk'](Object['keys'](_0x515072[0x0]),0x5);_0x44689a[_0xeb07('0x1a')](function(_0x20f371){_0xbec7a1[_0xeb07('0x1b')](createTable(_0x20f371,_0x515072));});return _0xbec7a1;}function getPDFDocDefinition(_0x196b9){var _0x53f3a6=util[_0xeb07('0x1c')](_0xeb07('0x1d'),NAME,EXTRACTED_REPORT[_0xeb07('0x1e')],moment(EXTRACTED_REPORT[_0xeb07('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xeb07('0x1c')](FORMAT));var _0x282de6=[];for(var _0x4fb5b2=0x0;_0x4fb5b2<_0x196b9[_0xeb07('0x16')];_0x4fb5b2++){var _0x384d2f=[];if(_0x4fb5b2===0x0){_0x384d2f[_0xeb07('0x1b')]({'text':_0x53f3a6,'style':_0xeb07('0x20')});}var _0x242f42={'table':_0x196b9[_0x4fb5b2]};if(_0x4fb5b2>0x0){_0x242f42[_0xeb07('0x21')]=_0xeb07('0x22');_0x242f42['margin']=[0x0,0x46,0x0,0x0];}_0x384d2f['push'](_0x242f42);_0x282de6[_0xeb07('0x1b')](_0x384d2f);}return{'pageSize':'A4','pageOrientation':_0xeb07('0x23'),'content':_0x282de6,'footer':function(_0x357109,_0x2f1d29){return{'text':_0x357109[_0xeb07('0x13')]()+_0xeb07('0x24')+_0x2f1d29,'style':'footer'};},'defaultStyle':{'font':_0xeb07('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xeb07('0x26')},'footer':{'alignment':_0xeb07('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4f4f80){var _0x1f28fa=0x1388;var _0x2767e0;if(!_0x4f4f80[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0xeb07('0x28')][_0xeb07('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeb07('0x2a'),_0xeb07('0x2b')]})[_0xeb07('0x2c')](function(_0x395258){if(_0x395258){_0x2767e0=_0x395258;_0x1f28fa=_0x2767e0[_0xeb07('0x2b')]||0x3e8;}})[_0xeb07('0x2c')](function(){var _0x56aeb7=[];var _0x433e4b=0x0;if(_0x2767e0[_0xeb07('0x2a')]){if(_0x4f4f80&&_0x4f4f80[_0xeb07('0x16')]){var _0x58c123=_[_0xeb07('0x2d')](_0x4f4f80[0x0][_0xeb07('0x2e')]/_0x1f28fa);var _0x2b674f=Number[_0xeb07('0x2f')](_0x4f4f80[0x0][_0xeb07('0x2e')]/_0x1f28fa)?_0x4f4f80[0x0]['num']%_0x1f28fa:0x0;_0x58c123[_0xeb07('0x1a')](function(_0x5d1063){if(_0x5d1063>0x0){_0x433e4b+=_0x1f28fa;}_0x56aeb7[_0xeb07('0x1b')](dbH[_0xeb07('0x30')][_0xeb07('0x31')](util[_0xeb07('0x1c')](_0xeb07('0x32'),QUERY,_0x1f28fa,_0x433e4b),{'type':dbH[_0xeb07('0x30')]['QueryTypes'][_0xeb07('0x33')]}));});if(_0x2b674f>0x0){_0x433e4b+=_0x1f28fa;_0x56aeb7['push'](dbH[_0xeb07('0x30')][_0xeb07('0x31')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2b674f,_0x433e4b),{'type':dbH['sequelize'][_0xeb07('0x34')][_0xeb07('0x33')]}));}}}else{_0x56aeb7[_0xeb07('0x1b')](dbH[_0xeb07('0x30')][_0xeb07('0x31')](QUERY,{'type':dbH[_0xeb07('0x30')][_0xeb07('0x34')][_0xeb07('0x33')]}));}var _0x5b3b59=path['dirname'](PATH);var _0x4e6fc3=path[_0xeb07('0x35')](PATH,_0xeb07('0x36'));var _0x3f82b9=_0x2767e0['split']&&_0x56aeb7[_0xeb07('0x16')]>0x1;var _0x670fbf=[];if(!fs['existsSync'](path[_0xeb07('0x37')](_0x5b3b59,_0x4e6fc3))&&_0x3f82b9){fs[_0xeb07('0x38')](path[_0xeb07('0x37')](_0x5b3b59,_0x4e6fc3));}return BPromise[_0xeb07('0x39')](_0x56aeb7,function(_0x179485){_0x670fbf['push'](_0x179485);})['then'](function(){var _0x53003e=[];for(var _0x52301a=0x0;_0x52301a<_0x670fbf[_0xeb07('0x16')];_0x52301a+=0x1){var _0x183135=_0x670fbf[_0x52301a];var _0x3da5be=createTables(_['flatten'](_0x183135));var _0x544372;var _0x2715ec=getPDFDocDefinition(_0x3da5be);var _0x2a7dde=getPDFPrinter();var _0x339c2a=_0x2a7dde[_0xeb07('0x3a')](_0x2715ec);if(_0x3f82b9){_0x544372=path[_0xeb07('0x37')](_0x5b3b59,_0x4e6fc3,util[_0xeb07('0x1c')]('%s%d.%s',_0x4e6fc3,_0x52301a,_0xeb07('0x3b')));}else{_0x544372=path[_0xeb07('0x37')](_0x5b3b59,util['format']('%s.%s',_0x4e6fc3,'pdf'));}_0x53003e[_0xeb07('0x1b')](writePDFDocument(_0x339c2a,_0x544372));}return Promise[_0xeb07('0x3c')](_0x53003e);})[_0xeb07('0x2c')](function(){if(_0x3f82b9){return new Promise(function(_0x5cfa4b){zipdir(path[_0xeb07('0x37')](_0x5b3b59,_0x4e6fc3),{'saveTo':path[_0xeb07('0x37')](_0x5b3b59,util[_0xeb07('0x1c')](_0xeb07('0x3d'),_0x4e6fc3,_0xeb07('0x3e')))},function(){rimraf(path[_0xeb07('0x37')](_0x5b3b59,_0x4e6fc3),function(){});_0x5cfa4b(_0xeb07('0x3f'));});});}})[_0xeb07('0x2c')](function(){if(!_0x3f82b9)return;rimraf(path[_0xeb07('0x37')](_0x5b3b59,_0x4e6fc3),function(){});})[_0xeb07('0x2c')](function(){logger[_0xeb07('0x40')](util[_0xeb07('0x1c')](_0xeb07('0x41'),EXTRACTED_REPORT_ID,_0xeb07('0x42')));return analyticExtractedReport(_0xeb07('0x43'),_0x3f82b9?util[_0xeb07('0x1c')](_0xeb07('0x3d'),_0x4e6fc3,_0x3f82b9?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xeb07('0x1c')](_0xeb07('0x44'),EXTRACTED_REPORT_ID,_0xeb07('0x42')));return db[_0xeb07('0x11')][_0xeb07('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xeb07('0x2c')](function(_0x5e456c){EXTRACTED_REPORT=_0x5e456c;return dbH[_0xeb07('0x30')]['query'](util['format'](_0xeb07('0x46'),QUERY),{'type':dbH[_0xeb07('0x30')][_0xeb07('0x34')][_0xeb07('0x33')]});})[_0xeb07('0x2c')](extractReport)[_0xeb07('0x47')](function(_0xa19ba6){logger[_0xeb07('0x40')](util[_0xeb07('0x1c')](_0xeb07('0x48'),EXTRACTED_REPORT_ID,_0xeb07('0x42')),util[_0xeb07('0x49')](_0xa19ba6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xeb07('0x4a'));})['finally'](function(){process[_0xeb07('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x134eba=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xeb07('0x4c'),'italics':__dirname+_0xeb07('0x4d'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x134eba;}function getPDFDocDefinitionFromHTML(_0x314b4e,_0x47f8f8){var _0x191475=util[_0xeb07('0x1c')](_0xeb07('0x4e'),_0x47f8f8[_0xeb07('0x4f')],_0x47f8f8['interactionId']);var _0x391474=moment()['format']('YYYY-MM-DD')[_0xeb07('0x13')]();var _0x1c58d5=htmlToPdfmake(_0x314b4e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1c58d5],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xeb07('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xeb07('0x50')}},'header':function(){return[{'text':_0xeb07('0x51'),'style':_0xeb07('0x20')}];},'footer':function(_0xeb91fe,_0x5a3878){return[{'text':util['format'](_0xeb07('0x52'),_0x191475,_0xeb91fe,_0x5a3878,_0x391474),'style':_0xeb07('0x53')}];}};}function writePDFDocument(_0x4888f6,_0xfa237e){return new Promise(function(_0x5a9387,_0x34401f){var _0x4b624f=_0x4888f6['pipe'](fs[_0xeb07('0x54')](_0xfa237e));_0x4b624f['on']('finish',function(){_0x5a9387(_0xeb07('0x55'));});_0x4b624f['on'](_0xeb07('0x56'),function(_0x51a24a){_0x34401f(_0x51a24a);});_0x4888f6[_0xeb07('0x57')]();});}exports[_0xeb07('0x58')]=function(_0x592fac,_0xa5a229){var _0x981fbd=getPDFPrinter();var _0x46dfbc=getPDFDocDefinitionFromHTML(_0x592fac,_0xa5a229);var _0x1f9be4=_0x981fbd[_0xeb07('0x3a')](_0x46dfbc);return writePDFDocument(_0x1f9be4,_0xa5a229[_0xeb07('0x2')])[_0xeb07('0x47')](function(_0xf2f2a8){throw _0xf2f2a8;});}; \ No newline at end of file +var _0xcebb=['push','concat','chunk','keys','forEach','format','name','length','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','num','Empty','find','split','then','splitSizePdf','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','.pdf','existsSync','mkdirSync','each','flatten','createPdfKitDocument','join','%s.%s','all','zip','zip\x20finished','info','PDF','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','catch','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','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','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','auto','body'];(function(_0x59f84d,_0x231296){var _0x11f8c3=function(_0x5a777c){while(--_0x5a777c){_0x59f84d['push'](_0x59f84d['shift']());}};_0x11f8c3(++_0x231296);}(_0xcebb,0x1f2));var _0xbceb=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xcebb[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xbceb('0x0'));var path=require(_0xbceb('0x1'));var moment=require(_0xbceb('0x2'));var htmlToPdfmake=require(_0xbceb('0x3'));var PdfPrinter=require(_0xbceb('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xbceb('0x5'));var JSDOM=require(_0xbceb('0x6'))['JSDOM'];var window=new JSDOM('')[_0xbceb('0x7')];var BPromise=require(_0xbceb('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0xbceb('0x9'))[_0xbceb('0xa')];var logger=require(_0xbceb('0xb'))(_0xbceb('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xbceb('0xd')][0x2]);var QUERY=process[_0xbceb('0xd')][0x3];var PATH=process[_0xbceb('0xd')][0x4];var NAME=process[_0xbceb('0xd')][0x5];var FORMAT=_0xbceb('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ce147,_0x24fe96){var _0x50915a={'status':_0x3ce147};var _0x19fc65={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x24fe96){_0x50915a['savename']=_0x24fe96;}return db[_0xbceb('0xf')]['update'](_0x50915a,_0x19fc65);}function getHeaders(_0x9d89a3){return _[_0xbceb('0x10')](_0x9d89a3,function(_0x719760){return{'text':_0x719760,'style':_0xbceb('0x11')};});}function getRows(_0x467111,_0x2b9eee){return _[_0xbceb('0x10')](_0x2b9eee,function(_0x2ec6b6){return _(_0x2ec6b6)[_0xbceb('0x12')](_0x467111)[_0xbceb('0x10')](function(_0x35a1ee){return _0x35a1ee?_[_0xbceb('0x13')](_0x35a1ee):'';})[_0xbceb('0x14')]();});}function createTable(_0x466d9a,_0x4c10fe){var _0x24736c={'widths':_[_0xbceb('0x15')](Array(_0x466d9a['length']),0x91),'heights':function(_0x3a022a){return _0x3a022a===0x0?_0xbceb('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x26f1ac=getHeaders(_0x466d9a);_0x24736c[_0xbceb('0x17')][_0xbceb('0x18')](_0x26f1ac);var _0x3f4182=getRows(_0x466d9a,_0x4c10fe);_0x24736c['body']=_0x24736c[_0xbceb('0x17')][_0xbceb('0x19')](_0x3f4182);return _0x24736c;}function createTables(_0x43dc1d){var _0x1f6e97=[];var _0x47021c=_[_0xbceb('0x1a')](Object[_0xbceb('0x1b')](_0x43dc1d[0x0]),0x5);_0x47021c[_0xbceb('0x1c')](function(_0x252db5){_0x1f6e97[_0xbceb('0x18')](createTable(_0x252db5,_0x43dc1d));});return _0x1f6e97;}function getPDFDocDefinition(_0x287b70){var _0x4ebc73=util[_0xbceb('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xbceb('0x1e')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xbceb('0x1d')](FORMAT));var _0x558e57=[];for(var _0x54f39a=0x0;_0x54f39a<_0x287b70[_0xbceb('0x1f')];_0x54f39a++){var _0x23f2f6=[];if(_0x54f39a===0x0){_0x23f2f6['push']({'text':_0x4ebc73,'style':_0xbceb('0x20')});}var _0x5a63dd={'table':_0x287b70[_0x54f39a]};if(_0x54f39a>0x0){_0x5a63dd[_0xbceb('0x21')]='before';_0x5a63dd[_0xbceb('0x22')]=[0x0,0x46,0x0,0x0];}_0x23f2f6[_0xbceb('0x18')](_0x5a63dd);_0x558e57[_0xbceb('0x18')](_0x23f2f6);}return{'pageSize':'A4','pageOrientation':_0xbceb('0x23'),'content':_0x558e57,'footer':function(_0x161019,_0x7e217e){return{'text':_0x161019[_0xbceb('0x13')]()+_0xbceb('0x24')+_0x7e217e,'style':_0xbceb('0x25')};},'defaultStyle':{'font':_0xbceb('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbceb('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xbb824){var _0x53465d=0x1388;var _0x283dcd;if(!_0xbb824[0x0][_0xbceb('0x28')]){return analyticExtractedReport(_0xbceb('0x29'));}return db['Setting'][_0xbceb('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbceb('0x2b'),'splitSizePdf']})[_0xbceb('0x2c')](function(_0x35f339){if(_0x35f339){_0x283dcd=_0x35f339;_0x53465d=_0x283dcd[_0xbceb('0x2d')]||0x3e8;}})[_0xbceb('0x2c')](function(){var _0x403b2b=[];var _0xd823e8=0x0;if(_0x283dcd[_0xbceb('0x2b')]){if(_0xbb824&&_0xbb824[_0xbceb('0x1f')]){var _0x2c49ac=_[_0xbceb('0x2e')](_0xbb824[0x0][_0xbceb('0x28')]/_0x53465d);var _0x4d9a50=Number['isInteger'](_0xbb824[0x0][_0xbceb('0x28')]/_0x53465d)?_0xbb824[0x0]['num']%_0x53465d:0x0;_0x2c49ac[_0xbceb('0x1c')](function(_0x666071){if(_0x666071>0x0){_0xd823e8+=_0x53465d;}_0x403b2b['push'](dbH[_0xbceb('0x2f')][_0xbceb('0x30')](util['format'](_0xbceb('0x31'),QUERY,_0x53465d,_0xd823e8),{'type':dbH[_0xbceb('0x2f')][_0xbceb('0x32')]['SELECT']}));});if(_0x4d9a50>0x0){_0xd823e8+=_0x53465d;_0x403b2b[_0xbceb('0x18')](dbH[_0xbceb('0x2f')][_0xbceb('0x30')](util[_0xbceb('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4d9a50,_0xd823e8),{'type':dbH['sequelize'][_0xbceb('0x32')]['SELECT']}));}}}else{_0x403b2b[_0xbceb('0x18')](dbH[_0xbceb('0x2f')][_0xbceb('0x30')](QUERY,{'type':dbH[_0xbceb('0x2f')][_0xbceb('0x32')]['SELECT']}));}var _0x50a871=path['dirname'](PATH);var _0x52c870=path['basename'](PATH,_0xbceb('0x33'));var _0x5676fb=_0x283dcd['split']&&_0x403b2b[_0xbceb('0x1f')]>0x1;var _0xc9ea3f=[];if(!fs[_0xbceb('0x34')](path['join'](_0x50a871,_0x52c870))&&_0x5676fb){fs[_0xbceb('0x35')](path['join'](_0x50a871,_0x52c870));}return BPromise[_0xbceb('0x36')](_0x403b2b,function(_0x1b7e74){_0xc9ea3f[_0xbceb('0x18')](_0x1b7e74);})[_0xbceb('0x2c')](function(){var _0x229e3e=[];for(var _0x2f71fe=0x0;_0x2f71fe<_0xc9ea3f[_0xbceb('0x1f')];_0x2f71fe+=0x1){var _0x3fb2e6=_0xc9ea3f[_0x2f71fe];var _0x5c7d07=createTables(_[_0xbceb('0x37')](_0x3fb2e6));var _0x290bdc;var _0x2e9609=getPDFDocDefinition(_0x5c7d07);var _0x1d4ca4=getPDFPrinter();var _0x49185b=_0x1d4ca4[_0xbceb('0x38')](_0x2e9609);if(_0x5676fb){_0x290bdc=path[_0xbceb('0x39')](_0x50a871,_0x52c870,util['format']('%s%d.%s',_0x52c870,_0x2f71fe,'pdf'));}else{_0x290bdc=path[_0xbceb('0x39')](_0x50a871,util[_0xbceb('0x1d')](_0xbceb('0x3a'),_0x52c870,'pdf'));}_0x229e3e[_0xbceb('0x18')](writePDFDocument(_0x49185b,_0x290bdc));}return Promise[_0xbceb('0x3b')](_0x229e3e);})[_0xbceb('0x2c')](function(){if(_0x5676fb){return new Promise(function(_0x517163){zipdir(path[_0xbceb('0x39')](_0x50a871,_0x52c870),{'saveTo':path[_0xbceb('0x39')](_0x50a871,util['format'](_0xbceb('0x3a'),_0x52c870,_0xbceb('0x3c')))},function(){rimraf(path[_0xbceb('0x39')](_0x50a871,_0x52c870),function(){});_0x517163(_0xbceb('0x3d'));});});}})[_0xbceb('0x2c')](function(){if(!_0x5676fb)return;rimraf(path['join'](_0x50a871,_0x52c870),function(){});})[_0xbceb('0x2c')](function(){logger[_0xbceb('0x3e')](util[_0xbceb('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xbceb('0x3f')));return analyticExtractedReport('Completed',_0x5676fb?util[_0xbceb('0x1d')](_0xbceb('0x3a'),_0x52c870,_0x5676fb?_0xbceb('0x3c'):_0xbceb('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbceb('0x3e')](util[_0xbceb('0x1d')](_0xbceb('0x41'),EXTRACTED_REPORT_ID,_0xbceb('0x3f')));return db[_0xbceb('0xf')][_0xbceb('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbceb('0x2c')](function(_0x16694f){EXTRACTED_REPORT=_0x16694f;return dbH[_0xbceb('0x2f')][_0xbceb('0x30')](util[_0xbceb('0x1d')](_0xbceb('0x43'),QUERY),{'type':dbH[_0xbceb('0x2f')]['QueryTypes'][_0xbceb('0x44')]});})[_0xbceb('0x2c')](extractReport)[_0xbceb('0x45')](function(_0x1f295c){logger[_0xbceb('0x3e')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbceb('0x3f')),util[_0xbceb('0x46')](_0x1f295c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbceb('0x47'));})[_0xbceb('0x48')](function(){process[_0xbceb('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x56bcd5=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xbceb('0x4a'),'italics':__dirname+_0xbceb('0x4b'),'bolditalics':__dirname+_0xbceb('0x4c')}});return _0x56bcd5;}function getPDFDocDefinitionFromHTML(_0x550828,_0x44578c){var _0x3ffcc1=util['format']('%s\x20#%d',_0x44578c['channel'],_0x44578c[_0xbceb('0x4d')]);var _0x58bcee=moment()[_0xbceb('0x1d')](_0xbceb('0x4e'))['toString']();var _0x33a761=htmlToPdfmake(_0x550828,{'window':window,'tableAutoSize':!![]});return{'content':[_0x33a761],'defaultStyle':{'font':_0xbceb('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xbceb('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xbceb('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xbceb('0x4f')}},'header':function(){return[{'text':_0xbceb('0x50'),'style':_0xbceb('0x20')}];},'footer':function(_0x379553,_0x219b93){return[{'text':util[_0xbceb('0x1d')](_0xbceb('0x51'),_0x3ffcc1,_0x379553,_0x219b93,_0x58bcee),'style':_0xbceb('0x25')}];}};}function writePDFDocument(_0x518321,_0x31ae3e){return new Promise(function(_0x1dc2bf,_0x1bb4cf){var _0x1d4e50=_0x518321[_0xbceb('0x52')](fs[_0xbceb('0x53')](_0x31ae3e));_0x1d4e50['on']('finish',function(){_0x1dc2bf(_0xbceb('0x54'));});_0x1d4e50['on'](_0xbceb('0x55'),function(_0x3c901f){_0x1bb4cf(_0x3c901f);});_0x518321[_0xbceb('0x56')]();});}exports['createPdfFromHTML']=function(_0x2fde90,_0x911606){var _0x1709cc=getPDFPrinter();var _0x1bcf2a=getPDFDocDefinitionFromHTML(_0x2fde90,_0x911606);var _0x2be7c8=_0x1709cc[_0xbceb('0x38')](_0x1bcf2a);return writePDFDocument(_0x2be7c8,_0x911606[_0xbceb('0x1')])[_0xbceb('0x45')](function(_0x44f61b){throw _0x44f61b;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 571f5f1..f203995 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 _0xf9d7=['analytics','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','forEach','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','join','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','inspect','Failed','finally','exit','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','../../config/logger'];(function(_0x35ba43,_0x551bfc){var _0x53c96a=function(_0x3f58ef){while(--_0x3f58ef){_0x35ba43['push'](_0x35ba43['shift']());}};_0x53c96a(++_0x551bfc);}(_0xf9d7,0xe4));var _0x7f9d=function(_0x34ab65,_0x356d84){_0x34ab65=_0x34ab65-0x0;var _0x31532c=_0xf9d7[_0x34ab65];return _0x31532c;};'use strict';var util=require('util');var path=require(_0x7f9d('0x0'));var _=require(_0x7f9d('0x1'));var fs=require('fs');var json2xls=require(_0x7f9d('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x7f9d('0x3'));var rimraf=require(_0x7f9d('0x4'));var db=require(_0x7f9d('0x5'))['db'];var dbH=require(_0x7f9d('0x5'))['dbH'];var logger=require(_0x7f9d('0x6'))(_0x7f9d('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2dfd4b,_0x2398da){var _0x67afd5={'status':_0x2dfd4b};var _0x15ae2b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2398da){_0x67afd5[_0x7f9d('0x8')]=_0x2398da;}return db[_0x7f9d('0x9')][_0x7f9d('0xa')](_0x67afd5,_0x15ae2b);}function main(){var _0x30bd7e=0x1388;var _0x3a65d2;logger[_0x7f9d('0xb')](util['format'](_0x7f9d('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x7f9d('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7f9d('0xe'),'splitSizeXlsx']})[_0x7f9d('0xf')](function(_0x451dfd){if(_0x451dfd){_0x3a65d2=_0x451dfd;_0x30bd7e=_0x3a65d2[_0x7f9d('0x10')]||0x1388;}})['then'](function(){return dbH[_0x7f9d('0x11')][_0x7f9d('0x12')](util['format'](_0x7f9d('0x13'),QUERY),{'type':dbH[_0x7f9d('0x11')][_0x7f9d('0x14')]['SELECT']});})[_0x7f9d('0xf')](function(_0x33c658){if(!_0x33c658[0x0][_0x7f9d('0x15')]){return analyticExtractedReport(_0x7f9d('0x16'));}var _0x23f8d4=[];var _0x4fe549=0x0;if(_0x3a65d2[_0x7f9d('0xe')]){if(_0x33c658&&_0x33c658[_0x7f9d('0x17')]){var _0x80e9de=_[_0x7f9d('0x18')](_0x33c658[0x0][_0x7f9d('0x15')]/_0x30bd7e);var _0x2c67f1=Number['isInteger'](_0x33c658[0x0][_0x7f9d('0x15')]/_0x30bd7e)?_0x33c658[0x0][_0x7f9d('0x15')]%_0x30bd7e:0x0;_0x80e9de[_0x7f9d('0x19')](function(_0x512fa9){if(_0x512fa9>0x0){_0x4fe549+=_0x30bd7e;}_0x23f8d4['push'](dbH[_0x7f9d('0x11')]['query'](util[_0x7f9d('0x1a')](_0x7f9d('0x1b'),QUERY,_0x30bd7e,_0x4fe549),{'type':dbH[_0x7f9d('0x11')][_0x7f9d('0x14')][_0x7f9d('0x1c')]}));});if(_0x2c67f1>0x0){_0x4fe549+=_0x30bd7e;_0x23f8d4[_0x7f9d('0x1d')](dbH[_0x7f9d('0x11')][_0x7f9d('0x12')](util[_0x7f9d('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2c67f1,_0x4fe549),{'type':dbH['sequelize'][_0x7f9d('0x14')]['SELECT']}));}}}else{_0x23f8d4[_0x7f9d('0x1d')](dbH[_0x7f9d('0x11')][_0x7f9d('0x12')](QUERY,{'type':dbH[_0x7f9d('0x11')][_0x7f9d('0x14')][_0x7f9d('0x1c')]}));}var _0x38b92a=path[_0x7f9d('0x1e')](PATH);var _0x50729e=path[_0x7f9d('0x1f')](PATH,'.xlsx');var _0x575951=_0x3a65d2[_0x7f9d('0xe')]&&_0x23f8d4['length']>0x1;var _0x40ac2e=[];if(!fs['existsSync'](path[_0x7f9d('0x20')](_0x38b92a,_0x50729e))&&_0x575951){fs['mkdirSync'](path[_0x7f9d('0x20')](_0x38b92a,_0x50729e));}return BPromise[_0x7f9d('0x21')](_0x23f8d4,function(_0x4f2b6b){_0x40ac2e[_0x7f9d('0x1d')](_0x4f2b6b);})['then'](function(){for(var _0x3a5e13=0x0;_0x3a5e13<_0x40ac2e[_0x7f9d('0x17')];_0x3a5e13+=0x1){var _0x77dec5;var _0x1c5829=_0x40ac2e[_0x3a5e13];if(_0x575951){_0x77dec5=path[_0x7f9d('0x20')](_0x38b92a,_0x50729e,util[_0x7f9d('0x1a')](_0x7f9d('0x22'),_0x50729e,_0x3a5e13,'xlsx'));}else{_0x77dec5=path[_0x7f9d('0x20')](_0x38b92a,util['format'](_0x7f9d('0x23'),_0x50729e,_0x7f9d('0x24')));}fs[_0x7f9d('0x25')](_0x77dec5,json2xls(_0x1c5829),_0x7f9d('0x26'));}})['then'](function(){if(_0x575951){return new Promise(function(_0x3792aa){zipdir(path[_0x7f9d('0x20')](_0x38b92a,_0x50729e),{'saveTo':path[_0x7f9d('0x20')](_0x38b92a,util[_0x7f9d('0x1a')](_0x7f9d('0x23'),_0x50729e,'zip'))},function(_0x1167f0,_0x3efa48){rimraf(path[_0x7f9d('0x20')](_0x38b92a,_0x50729e),function(){});_0x3792aa(_0x7f9d('0x27'));});});}})['then'](function(){logger['info'](util[_0x7f9d('0x1a')](_0x7f9d('0x28'),EXTRACTED_REPORT_ID,_0x7f9d('0x29')));return analyticExtractedReport(_0x7f9d('0x2a'),_0x575951?util['format'](_0x7f9d('0x23'),_0x50729e,_0x575951?'zip':'xlsx'):null);});})['catch'](function(_0x1c06db){logger['info'](util[_0x7f9d('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7f9d('0x29')),util[_0x7f9d('0x2b')](_0x1c06db,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7f9d('0x2c'));})[_0x7f9d('0x2d')](function(){process[_0x7f9d('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8c7a=['../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','split','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','json2xls','zip-dir','rimraf'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x464b4f,_0x136517){_0x464b4f=_0x464b4f-0x0;var _0xf83d8e=_0x8c7a[_0x464b4f];return _0xf83d8e;};'use strict';var util=require(_0xa8c7('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0xa8c7('0x1'));var BPromise=require('bluebird');var zipdir=require(_0xa8c7('0x2'));var rimraf=require(_0xa8c7('0x3'));var db=require(_0xa8c7('0x4'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xa8c7('0x5'))(_0xa8c7('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xa8c7('0x7')][0x2]);var QUERY=process[_0xa8c7('0x7')][0x3];var PATH=process[_0xa8c7('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4ce345,_0x37d743){var _0x5b85e2={'status':_0x4ce345};var _0x1338c6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x37d743){_0x5b85e2[_0xa8c7('0x8')]=_0x37d743;}return db[_0xa8c7('0x9')][_0xa8c7('0xa')](_0x5b85e2,_0x1338c6);}function main(){var _0x15e0a1=0x1388;var _0x57bd28;logger[_0xa8c7('0xb')](util[_0xa8c7('0xc')](_0xa8c7('0xd'),EXTRACTED_REPORT_ID,_0xa8c7('0xe')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xa8c7('0xf')]})[_0xa8c7('0x10')](function(_0x441533){if(_0x441533){_0x57bd28=_0x441533;_0x15e0a1=_0x57bd28[_0xa8c7('0xf')]||0x1388;}})[_0xa8c7('0x10')](function(){return dbH[_0xa8c7('0x11')][_0xa8c7('0x12')](util[_0xa8c7('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa8c7('0x11')][_0xa8c7('0x13')][_0xa8c7('0x14')]});})[_0xa8c7('0x10')](function(_0x221b39){if(!_0x221b39[0x0][_0xa8c7('0x15')]){return analyticExtractedReport(_0xa8c7('0x16'));}var _0x256c04=[];var _0x2f815e=0x0;if(_0x57bd28[_0xa8c7('0x17')]){if(_0x221b39&&_0x221b39[_0xa8c7('0x18')]){var _0x45ed68=_['range'](_0x221b39[0x0][_0xa8c7('0x15')]/_0x15e0a1);var _0x313733=Number[_0xa8c7('0x19')](_0x221b39[0x0][_0xa8c7('0x15')]/_0x15e0a1)?_0x221b39[0x0][_0xa8c7('0x15')]%_0x15e0a1:0x0;_0x45ed68[_0xa8c7('0x1a')](function(_0x5622fa){if(_0x5622fa>0x0){_0x2f815e+=_0x15e0a1;}_0x256c04[_0xa8c7('0x1b')](dbH[_0xa8c7('0x11')][_0xa8c7('0x12')](util[_0xa8c7('0xc')](_0xa8c7('0x1c'),QUERY,_0x15e0a1,_0x2f815e),{'type':dbH[_0xa8c7('0x11')][_0xa8c7('0x13')][_0xa8c7('0x14')]}));});if(_0x313733>0x0){_0x2f815e+=_0x15e0a1;_0x256c04[_0xa8c7('0x1b')](dbH['sequelize']['query'](util[_0xa8c7('0xc')](_0xa8c7('0x1c'),QUERY,_0x313733,_0x2f815e),{'type':dbH[_0xa8c7('0x11')][_0xa8c7('0x13')][_0xa8c7('0x14')]}));}}}else{_0x256c04[_0xa8c7('0x1b')](dbH[_0xa8c7('0x11')][_0xa8c7('0x12')](QUERY,{'type':dbH[_0xa8c7('0x11')][_0xa8c7('0x13')][_0xa8c7('0x14')]}));}var _0x4ea629=path[_0xa8c7('0x1d')](PATH);var _0x24f4a4=path['basename'](PATH,_0xa8c7('0x1e'));var _0xe1db98=_0x57bd28['split']&&_0x256c04[_0xa8c7('0x18')]>0x1;var _0x57bd0c=[];if(!fs[_0xa8c7('0x1f')](path[_0xa8c7('0x20')](_0x4ea629,_0x24f4a4))&&_0xe1db98){fs['mkdirSync'](path[_0xa8c7('0x20')](_0x4ea629,_0x24f4a4));}return BPromise[_0xa8c7('0x21')](_0x256c04,function(_0x230f36){_0x57bd0c['push'](_0x230f36);})[_0xa8c7('0x10')](function(){for(var _0x413ef4=0x0;_0x413ef4<_0x57bd0c['length'];_0x413ef4+=0x1){var _0x4a632c;var _0x5c36f2=_0x57bd0c[_0x413ef4];if(_0xe1db98){_0x4a632c=path['join'](_0x4ea629,_0x24f4a4,util[_0xa8c7('0xc')](_0xa8c7('0x22'),_0x24f4a4,_0x413ef4,_0xa8c7('0x23')));}else{_0x4a632c=path[_0xa8c7('0x20')](_0x4ea629,util[_0xa8c7('0xc')](_0xa8c7('0x24'),_0x24f4a4,_0xa8c7('0x23')));}fs[_0xa8c7('0x25')](_0x4a632c,json2xls(_0x5c36f2),_0xa8c7('0x26'));}})[_0xa8c7('0x10')](function(){if(_0xe1db98){return new Promise(function(_0x19ae36){zipdir(path['join'](_0x4ea629,_0x24f4a4),{'saveTo':path[_0xa8c7('0x20')](_0x4ea629,util[_0xa8c7('0xc')](_0xa8c7('0x24'),_0x24f4a4,_0xa8c7('0x27')))},function(_0x53298c,_0xa33693){rimraf(path[_0xa8c7('0x20')](_0x4ea629,_0x24f4a4),function(){});_0x19ae36(_0xa8c7('0x28'));});});}})[_0xa8c7('0x10')](function(){logger[_0xa8c7('0xb')](util[_0xa8c7('0xc')](_0xa8c7('0x29'),EXTRACTED_REPORT_ID,_0xa8c7('0xe')));return analyticExtractedReport(_0xa8c7('0x2a'),_0xe1db98?util[_0xa8c7('0xc')](_0xa8c7('0x24'),_0x24f4a4,_0xe1db98?_0xa8c7('0x27'):_0xa8c7('0x23')):null);});})[_0xa8c7('0x2b')](function(_0x4c761a){logger[_0xa8c7('0xb')](util[_0xa8c7('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa8c7('0xe')),util[_0xa8c7('0x2c')](_0x4c761a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa8c7('0x2d'));})[_0xa8c7('0x2e')](function(){process[_0xa8c7('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 965a191..85aa9e6 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 _0xe7ca=[',${EXTEN},','last','Hangup','concat','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','CDR(type)=%s','VoiceExtensionId','inbound','Set','CDR(routeid)=','cutdigits','${EXTEN:','${EXTEN}','context','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','toLowerCase','*,*,*,*','interval','tag','length','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime'];(function(_0x517ef4,_0x2592d1){var _0x26f4d3=function(_0x1267e6){while(--_0x1267e6){_0x517ef4['push'](_0x517ef4['shift']());}};_0x26f4d3(++_0x2592d1);}(_0xe7ca,0x172));var _0xae7c=function(_0x18bcc0,_0x3613db){_0x18bcc0=_0x18bcc0-0x0;var _0x40bdcb=_0xe7ca[_0x18bcc0];return _0x40bdcb;};'use strict';var _=require(_0xae7c('0x0'));var util=require(_0xae7c('0x1'));function rewrite(_0x5ae80b,_0x2e5fce){var _0x267454=this;return _0x5ae80b[_0xae7c('0x2')][_0xae7c('0x3')][_0xae7c('0x4')]({'raw':!![]})[_0xae7c('0x5')](function(_0x57395d){_0x267454['intervals']=_0x57395d;return _0x5ae80b[_0xae7c('0x2')][_0xae7c('0x6')][_0xae7c('0x4')]({'where':{'IntervalId':_0x2e5fce[_0xae7c('0x7')]},'raw':!![]});})[_0xae7c('0x5')](function(_0x23f417){return _0x5ae80b[_0xae7c('0x2')]['VoiceExtension'][_0xae7c('0x4')]({'where':{'exten':{'$in':_[_0xae7c('0x8')](_[_0xae7c('0x9')](_0x23f417,'exten'))}},'order':[{'raw':_0xae7c('0xa')}],'raw':!![]});})[_0xae7c('0x5')](function(_0x3f1d14){var _0xf5582=_[_0xae7c('0xb')](_0x3f1d14,{'priority':'1'});var _0x27a7a5=_['filter'](_0x3f1d14,{'isApp':0x1});var _0x3c73ac=_[_0xae7c('0xc')](_0x27a7a5,_0xae7c('0xd'));var _0x346b85=[_0xae7c('0xe'),_0xae7c('0xf')];var _0x5f1b19=[];var _0x40d508=[];for(var _0x5662d5 in _0x3c73ac){if(_0x3c73ac[_0xae7c('0x10')](_0x5662d5)){_0x267454[_0xae7c('0x11')]=0x2;_0x267454[_0xae7c('0x12')]=[];_0x267454[_0xae7c('0x13')]=_[_0xae7c('0x14')](_0xf5582,{'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')]});_0x267454[_0xae7c('0x12')][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':'Set','appdata':util[_0xae7c('0x17')](_0xae7c('0x18'),_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')]),'context':_0x3c73ac[_0x5662d5][0x0]['context'],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});if(_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')]===_0xae7c('0x1a')){_0x267454['extensions'][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':_0xae7c('0x1b'),'appdata':_0xae7c('0x1c')+_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')],'context':_0x3c73ac[_0x5662d5][0x0]['context'],'exten':_0x3c73ac[_0x5662d5][0x0]['exten'],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});}else if(_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')]==='outbound'){if(_0x267454[_0xae7c('0x13')]){_0x267454[_0xae7c('0x12')][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':'Set','appdata':'CDR(destination)='+(_0x267454[_0xae7c('0x13')][_0xae7c('0x1d')]?_0xae7c('0x1e')+_0x267454['extension'][_0xae7c('0x1d')]+'}':_0xae7c('0x1f')),'context':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x20')],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});}_0x267454['extensions'][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':'Set','appdata':_0xae7c('0x1c')+_0x3c73ac[_0x5662d5][0x0]['VoiceExtensionId'],'context':_0x3c73ac[_0x5662d5][0x0]['context'],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});var _0x48a23d=_0x267454[_0xae7c('0x11')]++;_0x267454[_0xae7c('0x12')][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':_0xae7c('0x21'),'appdata':_0xae7c('0x22')+(_0x48a23d+0x2)+'):Goto('+(_0x48a23d+0x1)+')','context':_0x3c73ac[_0x5662d5][0x0]['context'],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x48a23d,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});if(_0x267454[_0xae7c('0x13')]){_0x267454['extensions'][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':_0xae7c('0x1b'),'appdata':_0x267454[_0xae7c('0x13')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x267454[_0xae7c('0x13')]['cutdigits']+'}':_0xae7c('0x23'),'context':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x20')],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});}_0x267454[_0xae7c('0x12')][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':_0xae7c('0x1b'),'appdata':_0xae7c('0x24')+_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')],'context':_0x3c73ac[_0x5662d5][0x0]['context'],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454['priority']++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});if(_0x267454[_0xae7c('0x13')]&&_0x267454['extension']['hasOwnProperty'](_0xae7c('0x25'))&&_0x267454[_0xae7c('0x13')][_0xae7c('0x25')]!==_0xae7c('0x26')){_0x267454[_0xae7c('0x12')][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0]['type'],'app':_0xae7c('0x1b'),'appdata':_0xae7c('0x27'),'context':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x20')],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0]['VoiceExtensionId']});_0x267454[_0xae7c('0x12')][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0]['type'],'app':'Set','appdata':_0xae7c('0x28')+_0x267454[_0xae7c('0x13')][_0xae7c('0x25')]||_0xae7c('0x29'),'context':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x20')],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});}}_0x267454[_0xae7c('0x12')][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':_0xae7c('0x1b'),'appdata':_0xae7c('0x2a'),'context':_0x3c73ac[_0x5662d5][0x0]['context'],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});_0x267454[_0xae7c('0x12')]['push']({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':_0xae7c('0x1b'),'appdata':_0xae7c('0x2b'),'context':_0x3c73ac[_0x5662d5][0x0]['context'],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});_0x267454['extensions'][_0xae7c('0x15')]({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':_0xae7c('0x1b'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x20')],'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'priority':_0x267454[_0xae7c('0x11')]++,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});for(var _0x59a932=0x0,_0x21935a=0x0;_0x59a932<_0x3c73ac[_0x5662d5]['length'];_0x59a932+=0x1,_0x21935a=0x0){var _0x5bb63a=_0x3c73ac[_0x5662d5][_0x59a932];if(_0x5bb63a['type']){_0x5bb63a['type']=_0x5bb63a[_0xae7c('0x16')][_0xae7c('0x2c')]();}var _0x3981a4=[];var _0x1de0b8=[];delete _0x5bb63a['id'];delete _0x5bb63a['createdAt'];delete _0x5bb63a['updatedAt'];var _0x12d7b3=_0x5bb63a['interval']!==_0xae7c('0x2d')?[_0x5bb63a[_0xae7c('0x2e')]]:_0x5bb63a[_0xae7c('0x7')]?_[_0xae7c('0x9')](_[_0xae7c('0xb')](_0x267454['intervals'],{'IntervalId':_0x5bb63a[_0xae7c('0x7')]}),'interval'):[];if(_0x5bb63a[_0xae7c('0x10')]('tag')){if(_0x5bb63a[_0xae7c('0x2f')]&&_0x5bb63a['tag']!=='--'){_0x3981a4[_0xae7c('0x15')]({'type':_0x5bb63a['type'],'app':'Set','appdata':'CDR(tag)='+_0x5bb63a[_0xae7c('0x2f')],'context':_0x5bb63a[_0xae7c('0x20')],'exten':_0x5bb63a[_0xae7c('0xd')],'priority':_0x12d7b3[_0xae7c('0x30')]+_0x267454[_0xae7c('0x11')]+_0x21935a++,'VoiceExtensionId':_0x5bb63a[_0xae7c('0x19')]});}}if(_0x5bb63a['type']===_0xae7c('0x31')&&_0x5bb63a[_0xae7c('0x10')](_0xae7c('0x32'))){if(_0x5bb63a['callerID']){_0x3981a4[_0xae7c('0x15')]({'type':_0x5bb63a[_0xae7c('0x16')],'app':_0xae7c('0x21'),'appdata':_0xae7c('0x33')+_0x5bb63a[_0xae7c('0x32')]+')','context':_0x5bb63a[_0xae7c('0x20')],'exten':_0x5bb63a[_0xae7c('0xd')],'priority':_0x12d7b3[_0xae7c('0x30')]+_0x267454[_0xae7c('0x11')]+_0x21935a++,'VoiceExtensionId':_0x5bb63a[_0xae7c('0x19')]});}else{_0x3981a4[_0xae7c('0x15')]({'type':_0x5bb63a[_0xae7c('0x16')],'app':'ExecIf','appdata':_0xae7c('0x34'),'context':_0x5bb63a[_0xae7c('0x20')],'exten':_0x5bb63a[_0xae7c('0xd')],'priority':_0x12d7b3[_0xae7c('0x30')]+_0x267454[_0xae7c('0x11')]+_0x21935a++,'VoiceExtensionId':_0x5bb63a[_0xae7c('0x19')]});}}if(_0x5bb63a[_0xae7c('0x10')]('answer')){if(_0x346b85[_0xae7c('0x35')](_0x5bb63a[_0xae7c('0x36')]['toLowerCase']())>=0x0&&_0x5bb63a[_0xae7c('0x37')]!==_0xae7c('0x38')){if(_0x5bb63a[_0xae7c('0x39')]){_0x3981a4[_0xae7c('0x15')]({'type':_0x5bb63a[_0xae7c('0x16')],'app':_0xae7c('0x21'),'appdata':_0xae7c('0x3a'),'context':_0x5bb63a[_0xae7c('0x20')],'exten':_0x5bb63a['exten'],'priority':_0x12d7b3[_0xae7c('0x30')]+_0x267454['priority']+_0x21935a++,'VoiceExtensionId':_0x5bb63a['VoiceExtensionId']});_0x3981a4[_0xae7c('0x15')]({'type':_0x5bb63a['type'],'app':_0xae7c('0x1b'),'appdata':_0xae7c('0x3b'),'context':_0x5bb63a[_0xae7c('0x20')],'exten':_0x5bb63a[_0xae7c('0xd')],'priority':_0x12d7b3[_0xae7c('0x30')]+_0x267454[_0xae7c('0x11')]+_0x21935a++,'VoiceExtensionId':_0x5bb63a['VoiceExtensionId']});}else{_0x3981a4[_0xae7c('0x15')]({'type':_0x5bb63a[_0xae7c('0x16')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5bb63a['context'],'exten':_0x5bb63a[_0xae7c('0xd')],'priority':_0x12d7b3['length']+_0x267454[_0xae7c('0x11')]+_0x21935a++,'VoiceExtensionId':_0x5bb63a[_0xae7c('0x19')]});_0x3981a4['push']({'type':_0x5bb63a[_0xae7c('0x16')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5bb63a[_0xae7c('0x20')],'exten':_0x5bb63a[_0xae7c('0xd')],'priority':_0x12d7b3[_0xae7c('0x30')]+_0x267454['priority']+_0x21935a++,'VoiceExtensionId':_0x5bb63a['VoiceExtensionId']});}}}for(var _0x4da959=0x0;_0x4da959<_0x12d7b3[_0xae7c('0x30')];_0x4da959+=0x1){var _0x17724f=_0x267454[_0xae7c('0x11')]+_0x12d7b3[_0xae7c('0x30')];var _0x51cb59=_0x4da959===_0x12d7b3[_0xae7c('0x30')]-0x1?_0x267454[_0xae7c('0x11')]+_0x3981a4[_0xae7c('0x30')]+_0x1de0b8[_0xae7c('0x30')]+0x2:_0x267454[_0xae7c('0x11')]+_0x4da959+0x1;_0x3981a4[_0xae7c('0x3c')](_0x4da959,0x0,{'type':_0x5bb63a[_0xae7c('0x16')],'app':_0xae7c('0x3d'),'appdata':_0x12d7b3[_0x4da959]+'?'+_0x5bb63a['context']+_0xae7c('0x3e')+_0x17724f+':'+_0x5bb63a[_0xae7c('0x20')]+_0xae7c('0x3e')+_0x51cb59,'exten':_0x5bb63a['exten'],'context':_0x5bb63a[_0xae7c('0x20')],'priority':_0x267454[_0xae7c('0x11')]+_0x4da959,'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0]['VoiceExtensionId']});}_0x5bb63a['priority']=_0x3981a4[_0xae7c('0x30')]?_['last'](_0x3981a4)[_0xae7c('0x11')]+0x1:_0x267454[_0xae7c('0x11')];_0x267454[_0xae7c('0x11')]=(_0x1de0b8[_0xae7c('0x30')]?_[_0xae7c('0x3f')](_0x1de0b8)['priority']:_0x5bb63a[_0xae7c('0x11')])+0x1;_0x267454[_0xae7c('0x12')]=_['concat'](_0x267454[_0xae7c('0x12')],_0x3981a4,[_0x5bb63a],_0x1de0b8);}_0x267454['extensions']['push']({'type':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x16')],'app':_0xae7c('0x40'),'exten':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0xd')],'context':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x20')],'priority':_0x267454[_0xae7c('0x11')],'VoiceExtensionId':_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]});_0x5f1b19[_0xae7c('0x15')](_0x3c73ac[_0x5662d5][0x0][_0xae7c('0x19')]);_0x40d508=_[_0xae7c('0x41')](_0x40d508,_0x267454[_0xae7c('0x12')]);}}return _0x5ae80b[_0xae7c('0x42')](function(_0x2378ac){return _0x5ae80b[_0xae7c('0x2')][_0xae7c('0x6')][_0xae7c('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x5f1b19}},'transaction':_0x2378ac})[_0xae7c('0x5')](function(_0x24067d){return _0x5ae80b['models'][_0xae7c('0x6')]['bulkCreate'](_[_0xae7c('0x44')](_0x40d508,_0xae7c('0x11')),{'transaction':_0x2378ac});});});})[_0xae7c('0x45')](function(_0x7cd8e7){console[_0xae7c('0x46')](_0x7cd8e7);});}exports[_0xae7c('0x47')]=rewrite; \ No newline at end of file +var _0xbbf6=['Set','format','CDR(type)=%s','priority','VoiceExtensionId','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','extensions','extension','find','push','type'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0xbbf6,0x1dd));var _0x6bbf=function(_0x33830d,_0x393370){_0x33830d=_0x33830d-0x0;var _0x3e1d50=_0xbbf6[_0x33830d];return _0x3e1d50;};'use strict';var _=require(_0x6bbf('0x0'));var util=require(_0x6bbf('0x1'));function rewrite(_0x2b47a4,_0x560721){var _0x335b2e=this;return _0x2b47a4[_0x6bbf('0x2')][_0x6bbf('0x3')][_0x6bbf('0x4')]({'raw':!![]})[_0x6bbf('0x5')](function(_0x34dccc){_0x335b2e[_0x6bbf('0x6')]=_0x34dccc;return _0x2b47a4[_0x6bbf('0x2')][_0x6bbf('0x7')]['findAll']({'where':{'IntervalId':_0x560721['IntervalId']},'raw':!![]});})['then'](function(_0x19eb96){return _0x2b47a4['models']['VoiceExtension'][_0x6bbf('0x4')]({'where':{'exten':{'$in':_[_0x6bbf('0x8')](_[_0x6bbf('0x9')](_0x19eb96,_0x6bbf('0xa')))}},'order':[{'raw':_0x6bbf('0xb')}],'raw':!![]});})[_0x6bbf('0x5')](function(_0x1863ec){var _0x112b4d=_[_0x6bbf('0xc')](_0x1863ec,{'priority':'1'});var _0x6a88dc=_[_0x6bbf('0xc')](_0x1863ec,{'isApp':0x1});var _0x1767c8=_['groupBy'](_0x6a88dc,'exten');var _0x4a5937=[_0x6bbf('0xd'),_0x6bbf('0xe')];var _0x7f808d=[];var _0x1e00c3=[];for(var _0x3f17e2 in _0x1767c8){if(_0x1767c8['hasOwnProperty'](_0x3f17e2)){_0x335b2e['priority']=0x2;_0x335b2e[_0x6bbf('0xf')]=[];_0x335b2e[_0x6bbf('0x10')]=_[_0x6bbf('0x11')](_0x112b4d,{'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')]});_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':util[_0x6bbf('0x15')](_0x6bbf('0x16'),_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')]),'context':_0x1767c8[_0x3f17e2][0x0]['context'],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});if(_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')]==='inbound'){_0x335b2e['extensions'][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':_0x6bbf('0x19')+_0x1767c8[_0x3f17e2][0x0]['VoiceExtensionId'],'context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e['priority']++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});}else if(_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')]===_0x6bbf('0x1b')){if(_0x335b2e[_0x6bbf('0x10')]){_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':_0x6bbf('0x1c')+(_0x335b2e['extension'][_0x6bbf('0x1d')]?_0x6bbf('0x1e')+_0x335b2e[_0x6bbf('0x10')][_0x6bbf('0x1d')]+'}':_0x6bbf('0x1f')),'context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});}_0x335b2e[_0x6bbf('0xf')]['push']({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':_0x6bbf('0x19')+_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')],'context':_0x1767c8[_0x3f17e2][0x0]['context'],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});var _0x2f7c56=_0x335b2e[_0x6bbf('0x17')]++;_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x20'),'appdata':_0x6bbf('0x21')+(_0x2f7c56+0x2)+'):Goto('+(_0x2f7c56+0x1)+')','context':_0x1767c8[_0x3f17e2][0x0]['context'],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x2f7c56,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});if(_0x335b2e[_0x6bbf('0x10')]){_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':_0x335b2e[_0x6bbf('0x10')][_0x6bbf('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x335b2e[_0x6bbf('0x10')][_0x6bbf('0x1d')]+'}':_0x6bbf('0x22'),'context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});}_0x335b2e[_0x6bbf('0xf')]['push']({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':_0x6bbf('0x23')+_0x1767c8[_0x3f17e2][0x0]['VoiceExtensionId'],'context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});if(_0x335b2e[_0x6bbf('0x10')]&&_0x335b2e[_0x6bbf('0x10')][_0x6bbf('0x24')](_0x6bbf('0x25'))&&_0x335b2e[_0x6bbf('0x10')][_0x6bbf('0x25')]!==_0x6bbf('0x26')){_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':_0x6bbf('0x27'),'context':_0x1767c8[_0x3f17e2][0x0]['context'],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':_0x6bbf('0x28')+_0x335b2e[_0x6bbf('0x10')][_0x6bbf('0x25')]||_0x6bbf('0x29'),'context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'exten':_0x1767c8[_0x3f17e2][0x0]['exten'],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});}}_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0]['type'],'app':_0x6bbf('0x14'),'appdata':_0x6bbf('0x2a'),'context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0]['VoiceExtensionId']});_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x13')],'app':'Set','appdata':_0x6bbf('0x2b'),'context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});_0x335b2e['extensions'][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0]['type'],'app':_0x6bbf('0x14'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'priority':_0x335b2e[_0x6bbf('0x17')]++,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});for(var _0xbc46dc=0x0,_0x546e21=0x0;_0xbc46dc<_0x1767c8[_0x3f17e2][_0x6bbf('0x2c')];_0xbc46dc+=0x1,_0x546e21=0x0){var _0xf03b22=_0x1767c8[_0x3f17e2][_0xbc46dc];if(_0xf03b22[_0x6bbf('0x13')]){_0xf03b22[_0x6bbf('0x13')]=_0xf03b22[_0x6bbf('0x13')][_0x6bbf('0x2d')]();}var _0x212f5c=[];var _0x1543a3=[];delete _0xf03b22['id'];delete _0xf03b22['createdAt'];delete _0xf03b22[_0x6bbf('0x2e')];var _0xb590fd=_0xf03b22[_0x6bbf('0x2f')]!==_0x6bbf('0x30')?[_0xf03b22[_0x6bbf('0x2f')]]:_0xf03b22['IntervalId']?_['map'](_[_0x6bbf('0xc')](_0x335b2e[_0x6bbf('0x6')],{'IntervalId':_0xf03b22['IntervalId']}),_0x6bbf('0x2f')):[];if(_0xf03b22[_0x6bbf('0x24')]('tag')){if(_0xf03b22[_0x6bbf('0x31')]&&_0xf03b22[_0x6bbf('0x31')]!=='--'){_0x212f5c['push']({'type':_0xf03b22['type'],'app':'Set','appdata':_0x6bbf('0x32')+_0xf03b22[_0x6bbf('0x31')],'context':_0xf03b22[_0x6bbf('0x1a')],'exten':_0xf03b22['exten'],'priority':_0xb590fd[_0x6bbf('0x2c')]+_0x335b2e['priority']+_0x546e21++,'VoiceExtensionId':_0xf03b22['VoiceExtensionId']});}}if(_0xf03b22[_0x6bbf('0x13')]===_0x6bbf('0x1b')&&_0xf03b22['hasOwnProperty'](_0x6bbf('0x33'))){if(_0xf03b22[_0x6bbf('0x33')]){_0x212f5c['push']({'type':_0xf03b22[_0x6bbf('0x13')],'app':_0x6bbf('0x20'),'appdata':_0x6bbf('0x34')+_0xf03b22['callerID']+')','context':_0xf03b22[_0x6bbf('0x1a')],'exten':_0xf03b22[_0x6bbf('0xa')],'priority':_0xb590fd[_0x6bbf('0x2c')]+_0x335b2e[_0x6bbf('0x17')]+_0x546e21++,'VoiceExtensionId':_0xf03b22['VoiceExtensionId']});}else{_0x212f5c[_0x6bbf('0x12')]({'type':_0xf03b22[_0x6bbf('0x13')],'app':_0x6bbf('0x20'),'appdata':_0x6bbf('0x35'),'context':_0xf03b22[_0x6bbf('0x1a')],'exten':_0xf03b22['exten'],'priority':_0xb590fd[_0x6bbf('0x2c')]+_0x335b2e[_0x6bbf('0x17')]+_0x546e21++,'VoiceExtensionId':_0xf03b22[_0x6bbf('0x18')]});}}if(_0xf03b22['hasOwnProperty']('answer')){if(_0x4a5937[_0x6bbf('0x36')](_0xf03b22[_0x6bbf('0x37')][_0x6bbf('0x2d')]())>=0x0&&_0xf03b22['appType']!==_0x6bbf('0x38')){if(_0xf03b22[_0x6bbf('0x39')]){_0x212f5c[_0x6bbf('0x12')]({'type':_0xf03b22[_0x6bbf('0x13')],'app':'ExecIf','appdata':_0x6bbf('0x3a'),'context':_0xf03b22[_0x6bbf('0x1a')],'exten':_0xf03b22[_0x6bbf('0xa')],'priority':_0xb590fd[_0x6bbf('0x2c')]+_0x335b2e[_0x6bbf('0x17')]+_0x546e21++,'VoiceExtensionId':_0xf03b22[_0x6bbf('0x18')]});_0x212f5c['push']({'type':_0xf03b22[_0x6bbf('0x13')],'app':_0x6bbf('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0xf03b22[_0x6bbf('0x1a')],'exten':_0xf03b22[_0x6bbf('0xa')],'priority':_0xb590fd[_0x6bbf('0x2c')]+_0x335b2e['priority']+_0x546e21++,'VoiceExtensionId':_0xf03b22['VoiceExtensionId']});}else{_0x212f5c[_0x6bbf('0x12')]({'type':_0xf03b22[_0x6bbf('0x13')],'app':'ExecIf','appdata':_0x6bbf('0x3b'),'context':_0xf03b22[_0x6bbf('0x1a')],'exten':_0xf03b22[_0x6bbf('0xa')],'priority':_0xb590fd[_0x6bbf('0x2c')]+_0x335b2e[_0x6bbf('0x17')]+_0x546e21++,'VoiceExtensionId':_0xf03b22[_0x6bbf('0x18')]});_0x212f5c[_0x6bbf('0x12')]({'type':_0xf03b22[_0x6bbf('0x13')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0xf03b22[_0x6bbf('0x1a')],'exten':_0xf03b22['exten'],'priority':_0xb590fd[_0x6bbf('0x2c')]+_0x335b2e[_0x6bbf('0x17')]+_0x546e21++,'VoiceExtensionId':_0xf03b22[_0x6bbf('0x18')]});}}}for(var _0x2328c4=0x0;_0x2328c4<_0xb590fd['length'];_0x2328c4+=0x1){var _0x372cce=_0x335b2e[_0x6bbf('0x17')]+_0xb590fd[_0x6bbf('0x2c')];var _0x4c8773=_0x2328c4===_0xb590fd[_0x6bbf('0x2c')]-0x1?_0x335b2e[_0x6bbf('0x17')]+_0x212f5c[_0x6bbf('0x2c')]+_0x1543a3['length']+0x2:_0x335b2e[_0x6bbf('0x17')]+_0x2328c4+0x1;_0x212f5c[_0x6bbf('0x3c')](_0x2328c4,0x0,{'type':_0xf03b22[_0x6bbf('0x13')],'app':_0x6bbf('0x3d'),'appdata':_0xb590fd[_0x2328c4]+'?'+_0xf03b22[_0x6bbf('0x1a')]+_0x6bbf('0x3e')+_0x372cce+':'+_0xf03b22[_0x6bbf('0x1a')]+_0x6bbf('0x3e')+_0x4c8773,'exten':_0xf03b22['exten'],'context':_0xf03b22[_0x6bbf('0x1a')],'priority':_0x335b2e[_0x6bbf('0x17')]+_0x2328c4,'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]});}_0xf03b22[_0x6bbf('0x17')]=_0x212f5c[_0x6bbf('0x2c')]?_[_0x6bbf('0x3f')](_0x212f5c)[_0x6bbf('0x17')]+0x1:_0x335b2e[_0x6bbf('0x17')];_0x335b2e[_0x6bbf('0x17')]=(_0x1543a3[_0x6bbf('0x2c')]?_[_0x6bbf('0x3f')](_0x1543a3)[_0x6bbf('0x17')]:_0xf03b22[_0x6bbf('0x17')])+0x1;_0x335b2e['extensions']=_[_0x6bbf('0x40')](_0x335b2e[_0x6bbf('0xf')],_0x212f5c,[_0xf03b22],_0x1543a3);}_0x335b2e[_0x6bbf('0xf')][_0x6bbf('0x12')]({'type':_0x1767c8[_0x3f17e2][0x0]['type'],'app':_0x6bbf('0x41'),'exten':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0xa')],'context':_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x1a')],'priority':_0x335b2e['priority'],'VoiceExtensionId':_0x1767c8[_0x3f17e2][0x0]['VoiceExtensionId']});_0x7f808d[_0x6bbf('0x12')](_0x1767c8[_0x3f17e2][0x0][_0x6bbf('0x18')]);_0x1e00c3=_[_0x6bbf('0x40')](_0x1e00c3,_0x335b2e['extensions']);}}return _0x2b47a4[_0x6bbf('0x42')](function(_0x4322d9){return _0x2b47a4[_0x6bbf('0x2')][_0x6bbf('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x7f808d}},'transaction':_0x4322d9})[_0x6bbf('0x5')](function(_0x237153){return _0x2b47a4[_0x6bbf('0x2')][_0x6bbf('0x7')]['bulkCreate'](_[_0x6bbf('0x43')](_0x1e00c3,_0x6bbf('0x17')),{'transaction':_0x4322d9});});});})[_0x6bbf('0x44')](function(_0x29370a){console[_0x6bbf('0x45')](_0x29370a);});}exports[_0x6bbf('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index c883b6e..d330182 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 _0x2b0a=['CompanyId','length','find','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','ContactId','createdAt','updatedAt','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','select','id\x20IN\x20?','str','calleridnum','cm_hopper_final','fromQuery','cm_hopper_black','findAll','CmList','Lists','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','all','outbound','get','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','emit','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','lodash','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId'];(function(_0x2f01d6,_0x683f0e){var _0x31e1e6=function(_0x28e2d5){while(--_0x28e2d5){_0x2f01d6['push'](_0x2f01d6['shift']());}};_0x31e1e6(++_0x683f0e);}(_0x2b0a,0x193));var _0xa2b0=function(_0x14f4a2,_0x3bdb55){_0x14f4a2=_0x14f4a2-0x0;var _0x9cefa=_0x2b0a[_0x14f4a2];return _0x9cefa;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xa2b0('0x0'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xa2b0('0x1'));var Redis=require(_0xa2b0('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0xa2b0('0x3'));var logger=require(_0xa2b0('0x4'))(_0xa2b0('0x5'));config[_0xa2b0('0x6')]=_[_0xa2b0('0x7')](config[_0xa2b0('0x6')],{'host':_0xa2b0('0x8'),'port':0x18eb});var socket=require(_0xa2b0('0x9'))(new Redis(config[_0xa2b0('0x6')]));require(_0xa2b0('0xa'))[_0xa2b0('0xb')](socket);try{if(!process['argv'][0x2]||process[_0xa2b0('0xc')][0x2]===_0xa2b0('0xd')||process[_0xa2b0('0xc')][0x2]===_0xa2b0('0xe')){throw new Error(_0xa2b0('0xf'));}var FILEPATH=process[_0xa2b0('0xc')][0x2];if(!process[_0xa2b0('0xc')][0x3]||process[_0xa2b0('0xc')][0x3]===_0xa2b0('0xd')||process[_0xa2b0('0xc')][0x3]==='null'||!process['argv'][0x4]||process[_0xa2b0('0xc')][0x4]===_0xa2b0('0xd')||process[_0xa2b0('0xc')][0x4]===_0xa2b0('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xa2b0('0x10')](process[_0xa2b0('0xc')][0x3][_0xa2b0('0x11')](','),process['argv'][0x4][_0xa2b0('0x11')](','));if(!process[_0xa2b0('0xc')][0x5]||process['argv'][0x5]===_0xa2b0('0xd')||process['argv'][0x5]===_0xa2b0('0xe')){throw new Error(_0xa2b0('0x12'));}var LISTID=process[_0xa2b0('0xc')][0x5];var COMPANYID=process[_0xa2b0('0xc')][0x6]&&process['argv'][0x6]!==_0xa2b0('0xd')&&process[_0xa2b0('0xc')][0x6]!==_0xa2b0('0xe')?process[_0xa2b0('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xa2b0('0xc')][0x7]!==_0xa2b0('0xd')&&process['argv'][0x7]!==_0xa2b0('0xe')?process[_0xa2b0('0xc')][0x7]:null;if(!process[_0xa2b0('0xc')][0x8]||process[_0xa2b0('0xc')][0x8]==='undefined'||process[_0xa2b0('0xc')][0x8]==='null'){throw new Error(_0xa2b0('0x13'));}var SOCKET_TIMESTAMP=process[_0xa2b0('0xc')][0x8];}catch(_0x540988){logger[_0xa2b0('0x14')](_0x540988);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(_0x586353,_0x4e82e6,_0x5c7ecb,_0x46c355){var _0x396c03={'message':_0x4e82e6};_0x396c03[_0x586353]=!![];if(_0x5c7ecb){_0x396c03[_0xa2b0('0x15')]=_0x5c7ecb;}if(_0x46c355){_0x396c03[_0xa2b0('0x16')]=_0x46c355;}return _0x396c03;}function isEmail(_0x117454){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))*$/[_0xa2b0('0x17')](_0x117454);}function checkRow(_0x42469d,_0x15b13f,_0x4f9687){return new BPromise(function(_0x7cef73,_0x4346b4){if(_[_0xa2b0('0x18')](_0x42469d)){return _0x4346b4(handleCheckRowError(_0xa2b0('0x14'),_0xa2b0('0x19'),null,_0x4f9687));}if(_0x42469d[_0xa2b0('0x1a')]&&_0x42469d[_0xa2b0('0x1a')]['length']){var _0x18bbdb=_[_0xa2b0('0x1b')](_0x42469d[_0xa2b0('0x1a')],_0xa2b0('0x1c'))['join'](';');return _0x4346b4(handleCheckRowError('error',_0x18bbdb,null,_0x4f9687));}var _0x49cc9d={};for(var _0x561bc5 in FIELDS){if(FIELDS[_0xa2b0('0x1d')](_0x561bc5)&&FIELDS[_0x561bc5]){_0x49cc9d[_0x561bc5]=_0x42469d[_0xa2b0('0x1e')][0x0][FIELDS[_0x561bc5]]||_0x42469d[_0xa2b0('0x1e')][0x0]['\ufeff'+FIELDS[_0x561bc5]];}}if(!_0x49cc9d[_0xa2b0('0x1f')]){return _0x4346b4(handleCheckRowError('error',_0xa2b0('0x20'),null,_0x4f9687));}if(!_0x49cc9d[_0xa2b0('0x21')]){return _0x4346b4(handleCheckRowError(_0xa2b0('0x14'),_0xa2b0('0x22'),null,_0x4f9687));}if(_0x49cc9d[_0xa2b0('0x23')]){var _0x55e4aa=moment(_0x49cc9d['birthDate'],_0xa2b0('0x24'));if(!_0x55e4aa['isValid']()){return _0x4346b4(handleCheckRowError(_0xa2b0('0x14'),_0xa2b0('0x25'),null,_0x4f9687));}}if(_0x49cc9d[_0xa2b0('0x26')]){if(!isEmail(_0x49cc9d[_0xa2b0('0x26')])){return _0x4346b4(handleCheckRowError(_0xa2b0('0x14'),_0xa2b0('0x27'),null,_0x4f9687));}}_0x49cc9d[_0xa2b0('0x28')]=LISTID;_0x49cc9d[_0xa2b0('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x15b13f){var _0x1c4466={};for(var _0x358162=0x0,_0x2e4c42=DUPLICATES[_0xa2b0('0x2a')];_0x358162<_0x2e4c42;_0x358162+=0x1){_0x1c4466[DUPLICATES[_0x358162]]=_0x49cc9d[DUPLICATES[_0x358162]];}var _0x3b89d4=_[_0xa2b0('0x2b')](_0x15b13f,_0x1c4466);if(_0x3b89d4){return _0x4346b4(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x3b89d4,_0x4f9687));}}return db[_0xa2b0('0x2c')][_0xa2b0('0x2d')](_0x49cc9d,{'raw':!![],'hooks':![],'fields':_[_0xa2b0('0x2e')](_0x49cc9d)})[_0xa2b0('0x2f')](function(_0x444d6f){if(DUPLICATES&&DUPLICATES[_0xa2b0('0x2a')]&&_0x15b13f){_0x15b13f[_0xa2b0('0x30')](_[_0xa2b0('0x31')](_0x49cc9d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x444d6f['id'];return _0x7cef73();})[_0xa2b0('0x32')](function(_0x33f4d8){return _0x4346b4(handleCheckRowError('error',_0xa2b0('0x33')+(_0x33f4d8[_0xa2b0('0x1c')]||JSON['stringify'](_0x33f4d8)),null,_0x4f9687));});});}function checkHopper(){function _0x45c319(){return function(_0xe915e3){logger['error'](_0xa2b0('0x34'),_0xa2b0('0x35'),util[_0xa2b0('0x36')](_0xe915e3,{'showHidden':![],'depth':null}));};}var _0x437ae6=function(_0x47d64f,_0x49adce){var _0xb68cdd=squel[_0xa2b0('0x37')]()[_0xa2b0('0x38')](_0xa2b0('0x39'))['fromQuery'](['phone','scheduledAt',_0xa2b0('0x3a'),_0xa2b0('0x28'),_0x49adce,_0xa2b0('0x3b'),_0xa2b0('0x3c')],squel['select']()[_0xa2b0('0x3d')](_0xa2b0('0x21'),_0xa2b0('0x21'))['field'](_0xa2b0('0x3e'),_0xa2b0('0x3f'))['field']('id','ContactId')[_0xa2b0('0x3d')](LISTID[_0xa2b0('0x40')](),_0xa2b0('0x28'))[_0xa2b0('0x3d')](_0x47d64f['id'][_0xa2b0('0x40')](),_0x49adce)[_0xa2b0('0x3d')](_0xa2b0('0x3e'),'createdAt')[_0xa2b0('0x3d')](_0xa2b0('0x3e'),'updatedAt')[_0xa2b0('0x41')](_0xa2b0('0x42'))[_0xa2b0('0x43')](_0xa2b0('0x44'))['where'](_0xa2b0('0x45'),LISTID[_0xa2b0('0x40')]())[_0xa2b0('0x43')](_0xa2b0('0x46'))[_0xa2b0('0x43')](_0xa2b0('0x47'),squel['select']()['field']('phone')[_0xa2b0('0x41')](_0xa2b0('0x39'))[_0xa2b0('0x43')](_0x49adce+_0xa2b0('0x48'),_0x47d64f['id'][_0xa2b0('0x40')]())))['toString']();return _0xb68cdd;};var _0x564e6e=function(_0x28c193,_0x30c1de){var _0x5487a5=squel[_0xa2b0('0x37')]()[_0xa2b0('0x38')](_0xa2b0('0x39'))['fromQuery']([_0xa2b0('0x21'),'scheduledAt','ContactId','ListId',_0x30c1de,_0xa2b0('0x3b'),_0xa2b0('0x3c')],squel[_0xa2b0('0x49')]()['field']('phone','phone')['field'](_0xa2b0('0x3e'),'scheduledAt')['field']('id',_0xa2b0('0x3a'))[_0xa2b0('0x3d')](LISTID['toString'](),_0xa2b0('0x28'))[_0xa2b0('0x3d')](_0x28c193['id'][_0xa2b0('0x40')](),_0x30c1de)[_0xa2b0('0x3d')](_0xa2b0('0x3e'),_0xa2b0('0x3b'))[_0xa2b0('0x3d')](_0xa2b0('0x3e'),'updatedAt')[_0xa2b0('0x41')](_0xa2b0('0x42'))[_0xa2b0('0x43')](_0xa2b0('0x44'))[_0xa2b0('0x43')](_0xa2b0('0x45'),LISTID[_0xa2b0('0x40')]())[_0xa2b0('0x43')](_0xa2b0('0x4a'),squel[_0xa2b0('0x4b')](hopperContacts))[_0xa2b0('0x43')](_0xa2b0('0x46'))['where'](_0xa2b0('0x47'),squel[_0xa2b0('0x49')]()[_0xa2b0('0x3d')](_0xa2b0('0x4c'))['from'](_0xa2b0('0x4d'))[_0xa2b0('0x43')](_0x30c1de+_0xa2b0('0x48'),_0x28c193['id'][_0xa2b0('0x40')]()))[_0xa2b0('0x43')](_0xa2b0('0x47'),squel[_0xa2b0('0x49')]()['field']('phone')[_0xa2b0('0x41')]('cm_hopper')[_0xa2b0('0x43')](_0x30c1de+_0xa2b0('0x48'),_0x28c193['id'][_0xa2b0('0x40')]())))[_0xa2b0('0x40')]();return _0x5487a5;};function _0x5c0d91(_0xdc53d8,_0x467168){var _0x568a40=squel[_0xa2b0('0x37')]()['into'](_0xa2b0('0x39'))[_0xa2b0('0x4e')](['phone',_0xa2b0('0x3f'),_0xa2b0('0x3a'),_0xa2b0('0x28'),_0x467168,_0xa2b0('0x3b'),'updatedAt'],squel[_0xa2b0('0x49')]()[_0xa2b0('0x3d')]('phone',_0xa2b0('0x21'))[_0xa2b0('0x3d')](_0xa2b0('0x3e'),_0xa2b0('0x3f'))[_0xa2b0('0x3d')]('id',_0xa2b0('0x3a'))[_0xa2b0('0x3d')](LISTID[_0xa2b0('0x40')](),'ListId')['field'](_0xdc53d8['id'][_0xa2b0('0x40')](),_0x467168)[_0xa2b0('0x3d')]('NOW()',_0xa2b0('0x3b'))[_0xa2b0('0x3d')](_0xa2b0('0x3e'),_0xa2b0('0x3c'))[_0xa2b0('0x41')](_0xa2b0('0x42'))['where'](_0xa2b0('0x44'))[_0xa2b0('0x43')](_0xa2b0('0x45'),LISTID[_0xa2b0('0x40')]())[_0xa2b0('0x43')](_0xa2b0('0x4a'),squel['str'](hopperContacts))[_0xa2b0('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x568a40;}function _0x3bb8b2(_0x23886c,_0x20f091){var _0x202f5d=squel[_0xa2b0('0x37')]()[_0xa2b0('0x38')](_0xa2b0('0x4f'))[_0xa2b0('0x4e')]([_0xa2b0('0x21'),_0xa2b0('0x3a'),_0xa2b0('0x28'),_0x20f091,'createdAt',_0xa2b0('0x3c')],squel[_0xa2b0('0x49')]()[_0xa2b0('0x3d')](_0xa2b0('0x21'),_0xa2b0('0x21'))['field']('id',_0xa2b0('0x3a'))[_0xa2b0('0x3d')](LISTID[_0xa2b0('0x40')](),'ListId')['field'](_0x23886c['id'][_0xa2b0('0x40')](),_0x20f091)[_0xa2b0('0x3d')]('NOW()',_0xa2b0('0x3b'))[_0xa2b0('0x3d')](_0xa2b0('0x3e'),_0xa2b0('0x3c'))[_0xa2b0('0x41')](_0xa2b0('0x42'))[_0xa2b0('0x43')](_0xa2b0('0x44'))['where'](_0xa2b0('0x45'),LISTID['toString']())['where'](_0xa2b0('0x4a'),squel['str'](hopperContacts))[_0xa2b0('0x43')](_0xa2b0('0x46')))[_0xa2b0('0x40')]();return _0x202f5d;}return db['VoiceQueue'][_0xa2b0('0x50')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xa2b0('0x51')],'as':_0xa2b0('0x52'),'where':{'id':LISTID}}]})[_0xa2b0('0x2f')](function(_0x509f3f){var _0x35a164=[];if(_0x509f3f){var _0x3dcd51;for(var _0x580a64=0x0,_0x54eb0f;_0x580a64<_0x509f3f[_0xa2b0('0x2a')];_0x580a64+=0x1){_0x54eb0f=_0x509f3f[_0x580a64]['get']({'plain':!![]});switch(_0x54eb0f[_0xa2b0('0x53')]){case _0xa2b0('0x54'):_0x35a164['push'](db[_0xa2b0('0x55')][_0xa2b0('0x56')](_0x564e6e(_0x54eb0f,'VoiceQueueId'))[_0xa2b0('0x2f')](function(){})[_0xa2b0('0x32')](_0x45c319()));break;case'onlyIfOpen':_0x35a164[_0xa2b0('0x30')](db['sequelize'][_0xa2b0('0x56')](_0x437ae6(_0x54eb0f,_0xa2b0('0x57')))[_0xa2b0('0x2f')](function(){})[_0xa2b0('0x32')](_0x45c319()));break;default:_0x35a164['push'](db['sequelize'][_0xa2b0('0x56')](_0x5c0d91(_0x54eb0f,_0xa2b0('0x57')))[_0xa2b0('0x2f')](function(){})[_0xa2b0('0x32')](_0x45c319()));}}}return _0x35a164;})[_0xa2b0('0x58')]()[_0xa2b0('0x2f')](function(){return db['VoiceQueue'][_0xa2b0('0x50')]({'where':{'type':_0xa2b0('0x59')},'attributes':['id'],'include':[{'model':db[_0xa2b0('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xa2b0('0x2f')](function(_0x4e1363){var _0x357215=[];if(_0x4e1363){var _0x43e495;for(var _0x9b6476=0x0,_0x10fc77;_0x9b6476<_0x4e1363[_0xa2b0('0x2a')];_0x9b6476+=0x1){_0x10fc77=_0x4e1363[_0x9b6476][_0xa2b0('0x5a')]({'plain':!![]});_0x357215[_0xa2b0('0x30')](db[_0xa2b0('0x55')][_0xa2b0('0x56')](_0x3bb8b2(_0x10fc77,_0xa2b0('0x57')))[_0xa2b0('0x2f')](function(){})[_0xa2b0('0x32')](_0x45c319()));}}return _0x357215;})[_0xa2b0('0x58')]();})[_0xa2b0('0x2f')](function(){return db[_0xa2b0('0x5b')][_0xa2b0('0x50')]({'attributes':['id',_0xa2b0('0x53')],'include':[{'model':db[_0xa2b0('0x51')],'as':_0xa2b0('0x52'),'where':{'id':LISTID}}]})[_0xa2b0('0x2f')](function(_0x54f939){var _0x3666d0=[];if(_0x54f939){for(var _0x231e30=0x0,_0x10b38b;_0x231e30<_0x54f939[_0xa2b0('0x2a')];_0x231e30+=0x1){_0x10b38b=_0x54f939[_0x231e30][_0xa2b0('0x5a')]({'plain':!![]});switch(_0x10b38b[_0xa2b0('0x53')]){case _0xa2b0('0x54'):_0x3666d0[_0xa2b0('0x30')](db[_0xa2b0('0x55')][_0xa2b0('0x56')](_0x564e6e(_0x10b38b,_0xa2b0('0x5c')))[_0xa2b0('0x2f')](function(){})['catch'](_0x45c319()));break;case _0xa2b0('0x5d'):_0x3666d0['push'](db['sequelize'][_0xa2b0('0x56')](_0x437ae6(_0x10b38b,_0xa2b0('0x5c')))[_0xa2b0('0x2f')](function(){})[_0xa2b0('0x32')](_0x45c319()));break;default:_0x3666d0[_0xa2b0('0x30')](db['sequelize'][_0xa2b0('0x56')](_0x5c0d91(_0x10b38b,_0xa2b0('0x5c')))[_0xa2b0('0x2f')](function(){})[_0xa2b0('0x32')](_0x45c319()));}}}return _0x3666d0;})[_0xa2b0('0x58')]();})['then'](function(){return db[_0xa2b0('0x5b')][_0xa2b0('0x50')]({'attributes':['id'],'include':[{'model':db[_0xa2b0('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xa2b0('0x2f')](function(_0x2e8491){var _0x313c12=[];if(_0x2e8491){for(var _0x57990c=0x0,_0x523fa9;_0x57990c<_0x2e8491[_0xa2b0('0x2a')];_0x57990c+=0x1){_0x523fa9=_0x2e8491[_0x57990c][_0xa2b0('0x5a')]({'plain':!![]});_0x313c12[_0xa2b0('0x30')](db[_0xa2b0('0x55')]['query'](_0x3bb8b2(_0x523fa9,'CampaignId'))[_0xa2b0('0x2f')](function(){})[_0xa2b0('0x32')](_0x45c319()));}}return _0x313c12;})[_0xa2b0('0x58')]();})[_0xa2b0('0x32')](function(_0x4091f6){logger[_0xa2b0('0x14')](_0xa2b0('0x5e'),_0xa2b0('0x5f'),_0x4091f6[_0xa2b0('0x1c')]);});}var processPromises=function(_0x5e33dc){return BPromise[_0xa2b0('0x58')](promises)[_0xa2b0('0x2f')](function(_0x408fc6){})[_0xa2b0('0x32')](function(_0x3cb8be){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xa2b0('0x60')](_0x3cb8be));})['finally'](function(){socket[_0xa2b0('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5e33dc){return _0x5e33dc['resume']();}});};var endCsv=function(){return BPromise[_0xa2b0('0x62')]()[_0xa2b0('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0xa2b0('0x2f')](function(){socket[_0xa2b0('0x61')](_0xa2b0('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa2b0('0x64')](FILEPATH);}catch(_0x67e2e8){logger[_0xa2b0('0x14')](_0xa2b0('0x65'),JSON['stringify'](_0x67e2e8));}finally{process['exit'](0x0);}});};process['on'](_0xa2b0('0x66'),function(){logger['info'](_0xa2b0('0x67'));endCsv();});function main(){return BPromise[_0xa2b0('0x62')]()[_0xa2b0('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa2b0('0x11')](',');return db['CmContact'][_0xa2b0('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa2b0('0x2f')](function(_0x4d7498){var _0x366c6c=fs[_0xa2b0('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa2b0('0x69')](_0x366c6c,{'header':!![],'skipEmptyLines':!![],'step':function(_0x7ad87,_0x5118fc){total+=0x1;var _0x38bcc0=total;promises[_0xa2b0('0x30')](checkRow(_0x7ad87,_0x4d7498,_0x38bcc0)[_0xa2b0('0x2f')](function(){success+=0x1;})['catch'](function(_0x1fbdde){if(_0x1fbdde[_0xa2b0('0x14')]){errors+=0x1;delete _0x1fbdde['error'];}else if(_0x1fbdde[_0xa2b0('0x6a')]){duplicates+=0x1;delete _0x1fbdde[_0xa2b0('0x6a')];}rows[_0xa2b0('0x30')](_0x1fbdde);}));if(total%0xc8===0x0){_0x5118fc[_0xa2b0('0x6b')]();return processPromises(_0x5118fc);}},'complete':function(){return processPromises()['then'](function(){logger[_0xa2b0('0x6c')](_0xa2b0('0x6d'));endCsv();});},'error':function(_0x19f696,_0x47446a){logger[_0xa2b0('0x6c')](_0xa2b0('0x6e'),JSON[_0xa2b0('0x60')](_0x19f696));endCsv();}});})['catch'](function(_0x3e8c01){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x3e8c01));});}main(); \ No newline at end of file +var _0xc04c=['query','VoiceQueueId','catch','onlyIfOpen','findAll','BlackLists','Campaign','Lists','CampaignId','all','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','SIGINT','CSV\x20import\x20process\x20stopped!','pause','CSV\x20parsed\x20correctly!','info','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','updatedAt','select','field','NOW()','ContactId','toString','createdAt','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','get','always','sequelize'];(function(_0x56418e,_0x362812){var _0x5b160c=function(_0x5b44cb){while(--_0x5b44cb){_0x56418e['push'](_0x56418e['shift']());}};_0x5b160c(++_0x362812);}(_0xc04c,0x1cc));var _0xcc04=function(_0x1ec9d6,_0x3de772){_0x1ec9d6=_0x1ec9d6-0x0;var _0x9e7123=_0xc04c[_0x1ec9d6];return _0x9e7123;};'use strict';var BPromise=require(_0xcc04('0x0'));var util=require(_0xcc04('0x1'));var _=require(_0xcc04('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xcc04('0x3'));var Redis=require(_0xcc04('0x4'));var db=require(_0xcc04('0x5'))['db'];var config=require(_0xcc04('0x6'));var logger=require('../../../config/logger')(_0xcc04('0x7'));config[_0xcc04('0x8')]=_[_0xcc04('0x9')](config[_0xcc04('0x8')],{'host':_0xcc04('0xa'),'port':0x18eb});var socket=require(_0xcc04('0xb'))(new Redis(config['redis']));require(_0xcc04('0xc'))[_0xcc04('0xd')](socket);try{if(!process[_0xcc04('0xe')][0x2]||process[_0xcc04('0xe')][0x2]==='undefined'||process[_0xcc04('0xe')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0xcc04('0xe')][0x3]||process[_0xcc04('0xe')][0x3]===_0xcc04('0xf')||process['argv'][0x3]==='null'||!process[_0xcc04('0xe')][0x4]||process['argv'][0x4]===_0xcc04('0xf')||process[_0xcc04('0xe')][0x4]===_0xcc04('0x10')){throw new Error(_0xcc04('0x11'));}var FIELDS=_[_0xcc04('0x12')](process[_0xcc04('0xe')][0x3][_0xcc04('0x13')](','),process['argv'][0x4][_0xcc04('0x13')](','));if(!process[_0xcc04('0xe')][0x5]||process[_0xcc04('0xe')][0x5]===_0xcc04('0xf')||process[_0xcc04('0xe')][0x5]===_0xcc04('0x10')){throw new Error(_0xcc04('0x14'));}var LISTID=process[_0xcc04('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xcc04('0xe')][0x6]!==_0xcc04('0xf')&&process['argv'][0x6]!==_0xcc04('0x10')?process[_0xcc04('0xe')][0x6]:null;var DUPLICATES=process[_0xcc04('0xe')][0x7]&&process['argv'][0x7]!==_0xcc04('0xf')&&process[_0xcc04('0xe')][0x7]!==_0xcc04('0x10')?process[_0xcc04('0xe')][0x7]:null;if(!process[_0xcc04('0xe')][0x8]||process[_0xcc04('0xe')][0x8]===_0xcc04('0xf')||process['argv'][0x8]==='null'){throw new Error(_0xcc04('0x15'));}var SOCKET_TIMESTAMP=process[_0xcc04('0xe')][0x8];}catch(_0x835366){logger[_0xcc04('0x16')](_0x835366);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(_0xe328b8,_0x3de473,_0x12cffa,_0x1d7eea){var _0xd864e3={'message':_0x3de473};_0xd864e3[_0xe328b8]=!![];if(_0x12cffa){_0xd864e3[_0xcc04('0x17')]=_0x12cffa;}if(_0x1d7eea){_0xd864e3['index']=_0x1d7eea;}return _0xd864e3;}function isEmail(_0x46abda){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))*$/[_0xcc04('0x18')](_0x46abda);}function checkRow(_0x8db49f,_0x4f8038,_0x559a36){return new BPromise(function(_0x29fcda,_0x266e2f){if(_['isNil'](_0x8db49f)){return _0x266e2f(handleCheckRowError('error',_0xcc04('0x19'),null,_0x559a36));}if(_0x8db49f[_0xcc04('0x1a')]&&_0x8db49f[_0xcc04('0x1a')]['length']){var _0x299449=_[_0xcc04('0x1b')](_0x8db49f[_0xcc04('0x1a')],'message')[_0xcc04('0x1c')](';');return _0x266e2f(handleCheckRowError(_0xcc04('0x16'),_0x299449,null,_0x559a36));}var _0x36bd0b={};for(var _0x594315 in FIELDS){if(FIELDS[_0xcc04('0x1d')](_0x594315)&&FIELDS[_0x594315]){_0x36bd0b[_0x594315]=_0x8db49f[_0xcc04('0x1e')][0x0][FIELDS[_0x594315]]||_0x8db49f[_0xcc04('0x1e')][0x0]['\ufeff'+FIELDS[_0x594315]];}}if(!_0x36bd0b[_0xcc04('0x1f')]){return _0x266e2f(handleCheckRowError(_0xcc04('0x16'),_0xcc04('0x20'),null,_0x559a36));}if(!_0x36bd0b[_0xcc04('0x21')]){return _0x266e2f(handleCheckRowError(_0xcc04('0x16'),_0xcc04('0x22'),null,_0x559a36));}if(_0x36bd0b['birthDate']){var _0x8cdb80=moment(_0x36bd0b[_0xcc04('0x23')],'YYYY-MM-DD');if(!_0x8cdb80[_0xcc04('0x24')]()){return _0x266e2f(handleCheckRowError('error',_0xcc04('0x25'),null,_0x559a36));}}if(_0x36bd0b[_0xcc04('0x26')]){if(!isEmail(_0x36bd0b['email'])){return _0x266e2f(handleCheckRowError(_0xcc04('0x16'),_0xcc04('0x27'),null,_0x559a36));}}_0x36bd0b[_0xcc04('0x28')]=LISTID;_0x36bd0b['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x4f8038){var _0x110bab={};for(var _0x4cfba2=0x0,_0x396763=DUPLICATES[_0xcc04('0x29')];_0x4cfba2<_0x396763;_0x4cfba2+=0x1){_0x110bab[DUPLICATES[_0x4cfba2]]=_0x36bd0b[DUPLICATES[_0x4cfba2]];}var _0x3cb032=_[_0xcc04('0x2a')](_0x4f8038,_0x110bab);if(_0x3cb032){return _0x266e2f(handleCheckRowError(_0xcc04('0x2b'),_0xcc04('0x2c'),_0x3cb032,_0x559a36));}}return db[_0xcc04('0x2d')][_0xcc04('0x2e')](_0x36bd0b,{'raw':!![],'hooks':![],'fields':_[_0xcc04('0x2f')](_0x36bd0b)})[_0xcc04('0x30')](function(_0x51ba93){if(DUPLICATES&&DUPLICATES[_0xcc04('0x29')]&&_0x4f8038){_0x4f8038[_0xcc04('0x31')](_[_0xcc04('0x32')](_0x36bd0b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x51ba93['id'];return _0x29fcda();})['catch'](function(_0x21794f){return _0x266e2f(handleCheckRowError(_0xcc04('0x16'),_0xcc04('0x33')+(_0x21794f[_0xcc04('0x34')]||JSON[_0xcc04('0x35')](_0x21794f)),null,_0x559a36));});});}function checkHopper(){function _0x5d6c67(){return function(_0x49ded2){logger['error'](_0xcc04('0x36'),_0xcc04('0x37'),util['inspect'](_0x49ded2,{'showHidden':![],'depth':null}));};}var _0x2485e8=function(_0x166e4d,_0xf22d7){var _0x486786=squel[_0xcc04('0x38')]()[_0xcc04('0x39')](_0xcc04('0x3a'))[_0xcc04('0x3b')]([_0xcc04('0x21'),_0xcc04('0x3c'),'ContactId',_0xcc04('0x28'),_0xf22d7,'createdAt',_0xcc04('0x3d')],squel[_0xcc04('0x3e')]()[_0xcc04('0x3f')](_0xcc04('0x21'),'phone')[_0xcc04('0x3f')](_0xcc04('0x40'),_0xcc04('0x3c'))[_0xcc04('0x3f')]('id',_0xcc04('0x41'))[_0xcc04('0x3f')](LISTID['toString'](),_0xcc04('0x28'))['field'](_0x166e4d['id'][_0xcc04('0x42')](),_0xf22d7)['field'](_0xcc04('0x40'),_0xcc04('0x43'))[_0xcc04('0x3f')]('NOW()',_0xcc04('0x3d'))['from'](_0xcc04('0x44'))['where']('deletedAt\x20IS\x20NULL')[_0xcc04('0x45')]('ListId\x20=\x20?',LISTID['toString']())[_0xcc04('0x45')](_0xcc04('0x46'))[_0xcc04('0x45')](_0xcc04('0x47'),squel[_0xcc04('0x3e')]()['field'](_0xcc04('0x21'))['from']('cm_hopper')[_0xcc04('0x45')](_0xf22d7+'\x20=\x20?',_0x166e4d['id']['toString']())))[_0xcc04('0x42')]();return _0x486786;};var _0x26688c=function(_0x39ceba,_0x462092){var _0x433d9c=squel[_0xcc04('0x38')]()['into'](_0xcc04('0x3a'))[_0xcc04('0x3b')]([_0xcc04('0x21'),_0xcc04('0x3c'),_0xcc04('0x41'),_0xcc04('0x28'),_0x462092,_0xcc04('0x43'),_0xcc04('0x3d')],squel[_0xcc04('0x3e')]()[_0xcc04('0x3f')](_0xcc04('0x21'),'phone')[_0xcc04('0x3f')](_0xcc04('0x40'),_0xcc04('0x3c'))[_0xcc04('0x3f')]('id',_0xcc04('0x41'))[_0xcc04('0x3f')](LISTID[_0xcc04('0x42')](),'ListId')[_0xcc04('0x3f')](_0x39ceba['id'][_0xcc04('0x42')](),_0x462092)['field'](_0xcc04('0x40'),'createdAt')[_0xcc04('0x3f')]('NOW()',_0xcc04('0x3d'))[_0xcc04('0x48')]('cm_contacts')[_0xcc04('0x45')](_0xcc04('0x49'))[_0xcc04('0x45')](_0xcc04('0x4a'),LISTID[_0xcc04('0x42')]())[_0xcc04('0x45')](_0xcc04('0x4b'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xcc04('0x45')](_0xcc04('0x47'),squel[_0xcc04('0x3e')]()[_0xcc04('0x3f')]('calleridnum')[_0xcc04('0x48')]('cm_hopper_final')['where'](_0x462092+'\x20=\x20?',_0x39ceba['id'][_0xcc04('0x42')]()))['where'](_0xcc04('0x47'),squel['select']()['field'](_0xcc04('0x21'))['from'](_0xcc04('0x3a'))[_0xcc04('0x45')](_0x462092+'\x20=\x20?',_0x39ceba['id'][_0xcc04('0x42')]())))[_0xcc04('0x42')]();return _0x433d9c;};function _0x41d697(_0x36196b,_0x30663c){var _0x36120b=squel['insert']()[_0xcc04('0x39')](_0xcc04('0x3a'))[_0xcc04('0x3b')]([_0xcc04('0x21'),'scheduledAt','ContactId',_0xcc04('0x28'),_0x30663c,_0xcc04('0x43'),_0xcc04('0x3d')],squel[_0xcc04('0x3e')]()['field']('phone',_0xcc04('0x21'))[_0xcc04('0x3f')](_0xcc04('0x40'),_0xcc04('0x3c'))[_0xcc04('0x3f')]('id',_0xcc04('0x41'))['field'](LISTID[_0xcc04('0x42')](),_0xcc04('0x28'))[_0xcc04('0x3f')](_0x36196b['id'][_0xcc04('0x42')](),_0x30663c)[_0xcc04('0x3f')](_0xcc04('0x40'),_0xcc04('0x43'))[_0xcc04('0x3f')]('NOW()',_0xcc04('0x3d'))[_0xcc04('0x48')](_0xcc04('0x44'))[_0xcc04('0x45')](_0xcc04('0x49'))[_0xcc04('0x45')](_0xcc04('0x4a'),LISTID[_0xcc04('0x42')]())[_0xcc04('0x45')](_0xcc04('0x4b'),squel[_0xcc04('0x4c')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xcc04('0x42')]();return _0x36120b;}function _0x385194(_0x25d66f,_0x14384b){var _0x2a5664=squel['insert']()[_0xcc04('0x39')](_0xcc04('0x4d'))[_0xcc04('0x3b')]([_0xcc04('0x21'),'ContactId','ListId',_0x14384b,_0xcc04('0x43'),_0xcc04('0x3d')],squel[_0xcc04('0x3e')]()['field'](_0xcc04('0x21'),'phone')['field']('id',_0xcc04('0x41'))[_0xcc04('0x3f')](LISTID[_0xcc04('0x42')](),_0xcc04('0x28'))['field'](_0x25d66f['id']['toString'](),_0x14384b)[_0xcc04('0x3f')]('NOW()',_0xcc04('0x43'))[_0xcc04('0x3f')](_0xcc04('0x40'),'updatedAt')['from'](_0xcc04('0x44'))[_0xcc04('0x45')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0xcc04('0x42')]())[_0xcc04('0x45')](_0xcc04('0x4b'),squel[_0xcc04('0x4c')](hopperContacts))[_0xcc04('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xcc04('0x42')]();return _0x2a5664;}return db[_0xcc04('0x4e')]['findAll']({'where':{'type':_0xcc04('0x4f')},'attributes':['id',_0xcc04('0x50')],'include':[{'model':db[_0xcc04('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0xcc04('0x30')](function(_0x33f8a8){var _0x1aded4=[];if(_0x33f8a8){var _0xd84aca;for(var _0x53c663=0x0,_0x339caf;_0x53c663<_0x33f8a8['length'];_0x53c663+=0x1){_0x339caf=_0x33f8a8[_0x53c663][_0xcc04('0x52')]({'plain':!![]});switch(_0x339caf[_0xcc04('0x50')]){case _0xcc04('0x53'):_0x1aded4[_0xcc04('0x31')](db[_0xcc04('0x54')][_0xcc04('0x55')](_0x26688c(_0x339caf,_0xcc04('0x56')))[_0xcc04('0x30')](function(){})[_0xcc04('0x57')](_0x5d6c67()));break;case _0xcc04('0x58'):_0x1aded4[_0xcc04('0x31')](db[_0xcc04('0x54')]['query'](_0x2485e8(_0x339caf,_0xcc04('0x56')))['then'](function(){})['catch'](_0x5d6c67()));break;default:_0x1aded4['push'](db[_0xcc04('0x54')]['query'](_0x41d697(_0x339caf,_0xcc04('0x56')))[_0xcc04('0x30')](function(){})[_0xcc04('0x57')](_0x5d6c67()));}}}return _0x1aded4;})['all']()[_0xcc04('0x30')](function(){return db[_0xcc04('0x4e')][_0xcc04('0x59')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xcc04('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x2552fb){var _0x1193f0=[];if(_0x2552fb){var _0xe2006f;for(var _0x54fe52=0x0,_0x3ae8ac;_0x54fe52<_0x2552fb[_0xcc04('0x29')];_0x54fe52+=0x1){_0x3ae8ac=_0x2552fb[_0x54fe52][_0xcc04('0x52')]({'plain':!![]});_0x1193f0['push'](db[_0xcc04('0x54')][_0xcc04('0x55')](_0x385194(_0x3ae8ac,'VoiceQueueId'))['then'](function(){})[_0xcc04('0x57')](_0x5d6c67()));}}return _0x1193f0;})['all']();})['then'](function(){return db[_0xcc04('0x5b')][_0xcc04('0x59')]({'attributes':['id',_0xcc04('0x50')],'include':[{'model':db[_0xcc04('0x51')],'as':_0xcc04('0x5c'),'where':{'id':LISTID}}]})[_0xcc04('0x30')](function(_0x5d8099){var _0x2f7b43=[];if(_0x5d8099){for(var _0x172cfc=0x0,_0x5de261;_0x172cfc<_0x5d8099[_0xcc04('0x29')];_0x172cfc+=0x1){_0x5de261=_0x5d8099[_0x172cfc][_0xcc04('0x52')]({'plain':!![]});switch(_0x5de261[_0xcc04('0x50')]){case _0xcc04('0x53'):_0x2f7b43[_0xcc04('0x31')](db[_0xcc04('0x54')][_0xcc04('0x55')](_0x26688c(_0x5de261,'CampaignId'))[_0xcc04('0x30')](function(){})[_0xcc04('0x57')](_0x5d6c67()));break;case _0xcc04('0x58'):_0x2f7b43[_0xcc04('0x31')](db['sequelize']['query'](_0x2485e8(_0x5de261,_0xcc04('0x5d')))[_0xcc04('0x30')](function(){})[_0xcc04('0x57')](_0x5d6c67()));break;default:_0x2f7b43[_0xcc04('0x31')](db[_0xcc04('0x54')][_0xcc04('0x55')](_0x41d697(_0x5de261,_0xcc04('0x5d')))[_0xcc04('0x30')](function(){})[_0xcc04('0x57')](_0x5d6c67()));}}}return _0x2f7b43;})[_0xcc04('0x5e')]();})[_0xcc04('0x30')](function(){return db[_0xcc04('0x5b')][_0xcc04('0x59')]({'attributes':['id'],'include':[{'model':db[_0xcc04('0x51')],'as':_0xcc04('0x5a'),'where':{'id':LISTID}}]})[_0xcc04('0x30')](function(_0x6ef5ab){var _0x46d164=[];if(_0x6ef5ab){for(var _0x14945f=0x0,_0x29b0a1;_0x14945f<_0x6ef5ab[_0xcc04('0x29')];_0x14945f+=0x1){_0x29b0a1=_0x6ef5ab[_0x14945f][_0xcc04('0x52')]({'plain':!![]});_0x46d164[_0xcc04('0x31')](db['sequelize']['query'](_0x385194(_0x29b0a1,'CampaignId'))[_0xcc04('0x30')](function(){})[_0xcc04('0x57')](_0x5d6c67()));}}return _0x46d164;})['all']();})[_0xcc04('0x57')](function(_0x39ee15){logger[_0xcc04('0x16')](_0xcc04('0x5f'),_0xcc04('0x60'),_0x39ee15[_0xcc04('0x34')]);});}var processPromises=function(_0x8c7ddb){return BPromise[_0xcc04('0x5e')](promises)[_0xcc04('0x30')](function(_0x25bfc9){})['catch'](function(_0x148f30){logger[_0xcc04('0x16')]('Error\x20processing\x20rows\x20block:',JSON[_0xcc04('0x35')](_0x148f30));})[_0xcc04('0x61')](function(){socket[_0xcc04('0x62')](_0xcc04('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x8c7ddb){return _0x8c7ddb[_0xcc04('0x64')]();}});};var endCsv=function(){return BPromise[_0xcc04('0x65')]()[_0xcc04('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0xcc04('0x30')](function(){socket[_0xcc04('0x62')](_0xcc04('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcc04('0x66')](FILEPATH);}catch(_0x27f8c7){logger[_0xcc04('0x16')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xcc04('0x35')](_0x27f8c7));}finally{process['exit'](0x0);}});};process['on'](_0xcc04('0x67'),function(){logger['info'](_0xcc04('0x68'));endCsv();});function main(){return BPromise[_0xcc04('0x65')]()[_0xcc04('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcc04('0x13')](',');return db[_0xcc04('0x2d')][_0xcc04('0x59')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcc04('0x30')](function(_0x23ca9a){var _0x4cb220=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x4cb220,{'header':!![],'skipEmptyLines':!![],'step':function(_0xd8a3eb,_0x135966){total+=0x1;var _0x3b46ab=total;promises['push'](checkRow(_0xd8a3eb,_0x23ca9a,_0x3b46ab)[_0xcc04('0x30')](function(){success+=0x1;})[_0xcc04('0x57')](function(_0x3c9666){if(_0x3c9666[_0xcc04('0x16')]){errors+=0x1;delete _0x3c9666[_0xcc04('0x16')];}else if(_0x3c9666[_0xcc04('0x2b')]){duplicates+=0x1;delete _0x3c9666[_0xcc04('0x2b')];}rows[_0xcc04('0x31')](_0x3c9666);}));if(total%0xc8===0x0){_0x135966[_0xcc04('0x69')]();return processPromises(_0x135966);}},'complete':function(){return processPromises()[_0xcc04('0x30')](function(){logger['info'](_0xcc04('0x6a'));endCsv();});},'error':function(_0x1193d2,_0x5bd09b){logger[_0xcc04('0x6b')]('CSV\x20parse\x20error',JSON['stringify'](_0x1193d2));endCsv();}});})[_0xcc04('0x57')](function(_0x54bd33){logger[_0xcc04('0x16')](_0xcc04('0x6c'),JSON['stringify'](_0x54bd33));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index fc8d1d4..279b73d 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 _0xe452=['select','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','findAll','then','push','all','AdditionalPhones','split','length','isNil','filter','findOne','update','updated','CmContactHasItem','create','inserted','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.createdAt','ListId','from','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','field','cm_hopper_black','ListId\x20=\x20?','cm_contacts.phone','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','errors','info','query','spread','catch','campaigns.id','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','dialTimezone','utcOffset','set','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','rows','data','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','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','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','campaigns_has_cm_lists','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','uncaughtException','path','bluebird','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test'];(function(_0x1f76d2,_0x25dd22){var _0xee6ccb=function(_0x21c316){while(--_0x21c316){_0x1f76d2['push'](_0x1f76d2['shift']());}};_0xee6ccb(++_0x25dd22);}(_0xe452,0x159));var _0x2e45=function(_0x385fd6,_0x36adfd){_0x385fd6=_0x385fd6-0x0;var _0x3145c1=_0xe452[_0x385fd6];return _0x3145c1;};'use strict';var fs=require('fs');var path=require(_0x2e45('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x2e45('0x1'));var moment=require('moment');var squel=require(_0x2e45('0x2'));var Redis=require('ioredis');var db=require(_0x2e45('0x3'))['db'];var config=require(_0x2e45('0x4'));var shared=require(_0x2e45('0x5'));var logger=require('../../../config/logger')(_0x2e45('0x6'));config[_0x2e45('0x7')]=_['defaults'](config[_0x2e45('0x7')],{'host':_0x2e45('0x8'),'port':0x18eb});var socket=require(_0x2e45('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x2e45('0xa')](_0x2e45('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x2e45('0xa')](_0x2e45('0xb'));function isEmail(_0x15f512){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))*$/[_0x2e45('0xc')](_0x15f512);}function selectNotIn(_0x33406d,_0x4afa6c,_0xa23f0a,_0xf51b3b,_0xf3f2c5){return squel[_0x2e45('0xd')]()['field']('phone')['from'](_0xf51b3b)[_0x2e45('0xe')](_0x4afa6c,null,_0x4afa6c+_0x2e45('0xf')+_0xf51b3b+'.'+_0xa23f0a)['where'](_0xf51b3b+'.'+_0xa23f0a+_0x2e45('0x10')+_0x33406d+'.'+_0xa23f0a)[_0x2e45('0x11')](_0x4afa6c+_0x2e45('0x12')+_0xf3f2c5[_0x2e45('0xe')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4643ae,_0x1e2052){promisesAdditionalPhones=[];return db['CmContact'][_0x2e45('0x13')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x2e45('0x14')](function(_0x2b0b1d){if(_0x2b0b1d!==null){var _0x8b1d1e=[];for(var _0x38bfa6=0x0;_0x38bfa6<_0x2b0b1d['length'];_0x38bfa6++){var _0x19c0ca=_0x2b0b1d[_0x38bfa6];_0x8b1d1e[_0x2e45('0x15')](insertAdditionalPhones(_0x19c0ca));}}Promise[_0x2e45('0x16')](_0x8b1d1e)[_0x2e45('0x14')](function(){_0x4643ae({'val':0x1});});});});}function insertAdditionalPhones(_0x57e915){return new Promise(function(_0x1c65aa,_0x59f3d5){var _0x525d2e=_0x57e915[_0x2e45('0x17')];var _0x12b2ef=_0x525d2e[_0x2e45('0x18')](';');var _0x5dc116=[];orderBy=0x0;for(var _0x2ce185=0x0;_0x2ce185<_0x12b2ef[_0x2e45('0x19')];_0x2ce185++){_0x5dc116[_0x2e45('0x15')](splitAdditionalPhone(_0x57e915['id'],_0x12b2ef[_0x2ce185]));}Promise[_0x2e45('0x16')](_0x5dc116)[_0x2e45('0x14')](function(){_0x1c65aa({'val':_0x12b2ef[_0x2e45('0x19')]});});});}function splitAdditionalPhone(_0x259f42,_0x2427ea){return new Promise(function(_0x2a8ee6,_0x172bdf){var _0x45c737=_0x2427ea['split'](':');var _0xa1af81=_0x45c737[0x0];var _0x3f66b7=_0x45c737[0x1];if(!_[_0x2e45('0x1a')](_0x3f66b7)){var _0x3df923=_0x3f66b7[_0x2e45('0x18')]('|');var _0xcfdb0b=[];for(var _0x5a9d0c=0x0;_0x5a9d0c<_0x3df923[_0x2e45('0x19')];_0x5a9d0c++){if(_0x3df923[_0x5a9d0c]!==''){var _0x4e59cd=_[_0x2e45('0x1b')](promisesAdditionalPhones,{'contactId':_0x259f42,'phone':_0x3df923[_0x5a9d0c]});if(_0x4e59cd['length']==0x0){orderBy++;promisesAdditionalPhones[_0x2e45('0x15')]({'contactId':_0x259f42,'contactTypeId':_0xa1af81,'phone':_0x3df923[_0x5a9d0c],'orderBy':orderBy});}}}_0x2a8ee6({'ok':0x1});}else _0x2a8ee6({'res':0x0});});}function createAdditionalPhone(_0x137b35,_0x1facb8,_0x1a3c7b,_0x1ba471){var _0x58d224='';var _0x36169f='';var _0x1eef6c=_0x1a3c7b[_0x2e45('0x18')]('§');_0x58d224=_0x1eef6c[0x0];if(_0x1eef6c['length']==0x2)_0x36169f=_0x1eef6c[0x1];return new Promise(function(_0x320d73,_0x4c968f){return db['CmContactHasItem'][_0x2e45('0x1c')]({'where':{'CmContactId':_0x137b35,'item':_0x58d224}})[_0x2e45('0x14')](function(_0x21b33d){if(_0x21b33d){return db['CmContactHasItem'][_0x2e45('0x1d')]({'ItemTypeId':_0x1facb8,'description':_0x36169f,'OrderBy':_0x1ba471},{'where':{'CmContactId':_0x137b35,'item':_0x58d224}})[_0x2e45('0x14')](function(_0x1e15a0){_0x320d73({'res':_0x2e45('0x1e')});});}else{return db[_0x2e45('0x1f')][_0x2e45('0x20')]({'CmContactId':_0x137b35,'item':_0x58d224,'description':_0x36169f,'ItemTypeId':_0x1facb8,'OrderBy':_0x1ba471,'ItemClass':'PHONE'})['then'](function(_0x79ab8a){_0x320d73({'res':_0x2e45('0x21')});});}});});}function insertCmHopper(_0x569d73,_0x385a4b,_0x5a5934,_0x4e8960,_0x25c4c7){var _0x4c6116=['cm_contacts.phone','cm_contacts.scheduledat',_0x2e45('0x22'),_0x2e45('0x23'),_0x385a4b+'.'+_0x4e8960,'cm_contacts.createdAt',_0x2e45('0x24'),_0x2e45('0x25'),'cm_contacts.UserId','\x22'+_0x25c4c7+'\x22'];return squel[_0x2e45('0x26')]()[_0x2e45('0x27')](_0x2e45('0x28'))[_0x2e45('0x29')]([_0x2e45('0x2a'),_0x2e45('0x2b'),_0x2e45('0x2c'),'ListId',_0x4e8960,_0x2e45('0x2d'),_0x2e45('0x2e'),_0x2e45('0x2f'),_0x2e45('0x30'),_0x2e45('0x31')],squel[_0x2e45('0xd')]()[_0x2e45('0x32')](_0x4c6116)['from'](_0x385a4b)[_0x2e45('0xe')](_0x2e45('0x33'),null,'cm_contacts.ListId\x20=\x20'+_0x385a4b+'.CmListId')[_0x2e45('0xe')](_0x5a5934,null,_0x5a5934+_0x2e45('0xf')+_0x385a4b+'.'+_0x4e8960)[_0x2e45('0x11')](_0x385a4b+_0x2e45('0x34'),_0x569d73)[_0x2e45('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x2e45('0x35'),selectNotIn(_0x385a4b,_0x5a5934,_0x4e8960,'cm_hopper',['\x22always\x22',_0x2e45('0x36')]))[_0x2e45('0x11')](_0x2e45('0x35'),selectNotIn(_0x385a4b,_0x5a5934,_0x4e8960,_0x2e45('0x28'),[_0x2e45('0x37')])))[_0x2e45('0x38')]();}function insertCmHopperBlack(_0x40aae7,_0x178133,_0x5f48c6,_0x25bb95){var _0x4fc7bd=['cm_contacts.phone',_0x2e45('0x22'),'cm_contacts.ListId',_0x178133+'.'+_0x25bb95,_0x2e45('0x39'),_0x2e45('0x24')];return squel[_0x2e45('0x26')]()[_0x2e45('0x27')]('cm_hopper_black')[_0x2e45('0x29')]([_0x2e45('0x2a'),'ContactId',_0x2e45('0x3a'),_0x25bb95,'createdAt',_0x2e45('0x2e')],squel['select']()[_0x2e45('0x32')](_0x4fc7bd)[_0x2e45('0x3b')](_0x178133)[_0x2e45('0xe')](_0x2e45('0x33'),null,_0x2e45('0x3c')+_0x178133+_0x2e45('0x3d'))[_0x2e45('0xe')](_0x5f48c6,null,_0x5f48c6+_0x2e45('0xf')+_0x178133+'.'+_0x25bb95)[_0x2e45('0x11')](_0x178133+_0x2e45('0x34'),_0x40aae7)[_0x2e45('0x11')](_0x2e45('0x3e'),NOW)['where'](_0x2e45('0x35'),squel[_0x2e45('0xd')]()[_0x2e45('0x3f')](_0x2e45('0x2a'))[_0x2e45('0x3b')](_0x2e45('0x40'))[_0x2e45('0x11')](_0x2e45('0x41'),_0x40aae7)['where'](_0x25bb95+_0x2e45('0x10')+_0x178133+'.'+_0x25bb95)))[_0x2e45('0x38')]();}function insertTzCmHopper(_0x4dbee9,_0x3fd39d,_0x59bf29,_0x15a2e0,_0x57bea9,_0x474c62){var _0x22d891=[_0x2e45('0x42'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x474c62+_0x2e45('0x43'),_0x2e45('0x22'),'cm_contacts.ListId',_0x3fd39d+'.'+_0x15a2e0,'cm_contacts.createdAt',_0x2e45('0x24'),_0x2e45('0x25'),_0x2e45('0x44'),'\x22'+_0x57bea9+'\x22'];var _0x79fd6b=squel[_0x2e45('0x26')]()[_0x2e45('0x27')](_0x2e45('0x28'))['fromQuery']([_0x2e45('0x2a'),_0x2e45('0x2b'),_0x2e45('0x2c'),_0x2e45('0x3a'),_0x15a2e0,_0x2e45('0x2d'),'updatedAt',_0x2e45('0x2f'),_0x2e45('0x30'),'recallme'],squel[_0x2e45('0xd')]()['fields'](_0x22d891)[_0x2e45('0x3b')](_0x3fd39d)[_0x2e45('0xe')](_0x2e45('0x33'),null,_0x2e45('0x3c')+_0x3fd39d+_0x2e45('0x3d'))[_0x2e45('0xe')](_0x59bf29,null,_0x59bf29+_0x2e45('0xf')+_0x3fd39d+'.'+_0x15a2e0)[_0x2e45('0xe')](_0x474c62,null,_0x474c62+_0x2e45('0xf')+_0x3fd39d+'.'+_0x15a2e0)[_0x2e45('0x11')](_0x3fd39d+_0x2e45('0x34'),_0x4dbee9)[_0x2e45('0x11')](_0x2e45('0x3e'),NOW)[_0x2e45('0x11')](_0x2e45('0x35'),selectNotIn(_0x3fd39d,_0x59bf29,_0x15a2e0,_0x2e45('0x28'),[_0x2e45('0x37'),_0x2e45('0x36')]))[_0x2e45('0x11')](_0x2e45('0x35'),selectNotIn(_0x3fd39d,_0x59bf29,_0x15a2e0,_0x2e45('0x28'),[_0x2e45('0x37')])))['toString']();return _0x79fd6b;}function insertTzCmHopperBlack(_0x422bc3,_0x4ddb04,_0x118be0,_0x1b5c48){var _0x4e1f3d=[_0x2e45('0x42'),_0x2e45('0x22'),_0x2e45('0x23'),_0x4ddb04+'.'+_0x1b5c48,_0x2e45('0x39'),_0x2e45('0x24')];return squel[_0x2e45('0x26')]()[_0x2e45('0x27')](_0x2e45('0x40'))[_0x2e45('0x29')]([_0x2e45('0x2a'),'ContactId','ListId',_0x1b5c48,'createdAt','updatedAt'],squel[_0x2e45('0xd')]()['fields'](_0x4e1f3d)[_0x2e45('0x3b')](_0x4ddb04)[_0x2e45('0xe')](_0x2e45('0x33'),null,'cm_contacts.ListId\x20=\x20'+_0x4ddb04+_0x2e45('0x3d'))[_0x2e45('0xe')](_0x118be0,null,_0x118be0+_0x2e45('0xf')+_0x4ddb04+'.'+_0x1b5c48)['where'](_0x4ddb04+_0x2e45('0x34'),_0x422bc3)[_0x2e45('0x11')](_0x2e45('0x3e'),NOW)[_0x2e45('0x11')](_0x2e45('0x35'),squel[_0x2e45('0xd')]()[_0x2e45('0x3f')](_0x2e45('0x2a'))[_0x2e45('0x3b')](_0x2e45('0x40'))[_0x2e45('0x11')](_0x2e45('0x41'),_0x422bc3)[_0x2e45('0x11')](_0x1b5c48+_0x2e45('0x10')+_0x4ddb04+'.'+_0x1b5c48)))[_0x2e45('0x38')]();}function insertCmHopperAdditionalPhones(_0x32dc61){var _0x142ef3=[_0x2e45('0x45'),_0x2e45('0x46'),'cm_contact_has_items.OrderBy',_0x2e45('0x47'),_0x2e45('0x48')];return squel[_0x2e45('0x26')]()[_0x2e45('0x27')]('cm_hopper_additional_phones')[_0x2e45('0x29')]([_0x2e45('0x49'),_0x2e45('0x2a'),_0x2e45('0x4a'),'createdAt',_0x2e45('0x2e')],squel[_0x2e45('0xd')]()[_0x2e45('0x32')](_0x142ef3)[_0x2e45('0x3b')](_0x2e45('0x28'))['join'](_0x2e45('0x33'),null,_0x2e45('0x4b'))[_0x2e45('0xe')](_0x2e45('0x4c'),null,_0x2e45('0x4d'))[_0x2e45('0x11')](_0x2e45('0x4e'),_0x32dc61)[_0x2e45('0x11')](_0x2e45('0x3e'),NOW))[_0x2e45('0x38')]();}function insertCmContact(_0x1fe5b4,_0x593fb3,_0x24905d,_0x43f051){var _0x3a883a=_[_0x2e45('0x4f')](_[_0x2e45('0x50')](_0x43f051),[_0x2e45('0x3a'),_0x2e45('0x51'),'createdAt',_0x2e45('0x2e')]);return squel[_0x2e45('0x26')]()[_0x2e45('0x27')]('cm_contacts')['fromQuery'](_0x3a883a,squel[_0x2e45('0xd')]()['fields'](_0x3a883a)[_0x2e45('0x3b')](_0x593fb3)[_0x2e45('0x11')]('('+_0x24905d['join'](',')+_0x2e45('0x52'),squel[_0x2e45('0xd')]()[_0x2e45('0x32')](_0x24905d)[_0x2e45('0x3b')](_0x2e45('0x33'))[_0x2e45('0x11')](_0x2e45('0x41'),_0x1fe5b4)[_0x2e45('0x11')]('deletedAt\x20IS\x20NULL'))[_0x2e45('0x11')](_0x2e45('0x53'),squel['select']()[_0x2e45('0x3f')](_0x2e45('0x54'),_0x2e45('0x55'))[_0x2e45('0x3b')](_0x593fb3)[_0x2e45('0x56')](_0x24905d[_0x2e45('0xe')](','))))[_0x2e45('0x38')]();}function handleStop(){logger['info'](_0x2e45('0x57'));stopped=!![];}function handleUncaughtException(_0x10f08b){logger[_0x2e45('0x58')](_0x10f08b[_0x2e45('0x59')]);process[_0x2e45('0x5a')](0x1);}function handleError(_0x164eba,_0xb2d6c6){stats[_0x2e45('0x5b')]['push']({'name':_0xb2d6c6['code'],'message':_0xb2d6c6[_0x2e45('0x59')],'row':_0x164eba});}function handleQuery(_0x2a356a){logger[_0x2e45('0x5c')](_0x2a356a);return db['sequelize'][_0x2e45('0x5d')](_0x2a356a)[_0x2e45('0x5e')](function(_0x181730){results[_0x2e45('0x15')](_0x181730);})[_0x2e45('0x5f')](function(_0x23ca56){logger[_0x2e45('0x58')](_0x23ca56[_0x2e45('0x59')]);});}function updateTzCampaigns(_0x418d62){return new Promise(function(_0x22e728,_0x342f1d){var _0x335159=squel[_0x2e45('0xd')]()[_0x2e45('0x32')]([_0x2e45('0x60'),'campaigns.dialTimezone'])[_0x2e45('0x3b')]('campaigns')[_0x2e45('0xe')]('campaigns_has_cm_lists',null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x2e45('0x11')](_0x2e45('0x61')+_0x418d62);db[_0x2e45('0x62')][_0x2e45('0x5d')](_0x335159[_0x2e45('0x38')]())['spread'](function(_0x331d2e){var _0x2f961f=[];for(var _0x59ace5=0x0;_0x59ace5<_0x331d2e[_0x2e45('0x19')];_0x59ace5++){_0x2f961f[_0x2e45('0x15')](getTimezoneData(_0x331d2e[_0x59ace5],tmp_campaigns));}BPromise[_0x2e45('0x16')](_0x2f961f)[_0x2e45('0x14')](function(){_0x22e728({'val':0x1});});})[_0x2e45('0x5f')](function(_0x5d93d2){logger['error'](_0x5d93d2['message']);_0x22e728({'val':0x0});});});}function updateTzVoiceQueues(_0x27500b){return new Promise(function(_0x56344b,_0x18649f){var _0x5def9d=squel[_0x2e45('0xd')]()[_0x2e45('0x32')]([_0x2e45('0x63'),_0x2e45('0x64')])['from'](_0x2e45('0x65'))['join'](_0x2e45('0x66'),null,_0x2e45('0x67'))['where']('voice_queues_has_cm_lists.CmListId='+_0x27500b);db[_0x2e45('0x62')][_0x2e45('0x5d')](_0x5def9d[_0x2e45('0x38')]())[_0x2e45('0x5e')](function(_0x35258c){var _0x4af175=[];for(var _0x5eff00=0x0;_0x5eff00<_0x35258c[_0x2e45('0x19')];_0x5eff00++){_0x4af175[_0x2e45('0x15')](getTimezoneData(_0x35258c[_0x5eff00],tmp_voice_queues));}BPromise[_0x2e45('0x16')](_0x4af175)[_0x2e45('0x14')](function(){_0x56344b({'val':0x1});});})[_0x2e45('0x5f')](function(_0x3a776d){logger['error'](_0x3a776d[_0x2e45('0x59')]);_0x56344b({'val':0x0});});});}function getTimezoneData(_0x1a83ca,_0x5a2f82){return new Promise(function(_0x20dbc2,_0x23533f){var _0x5aa163=shared[_0x2e45('0x68')];var _0x41b00e=_0x5aa163[_0x1a83ca[_0x2e45('0x69')]];if(_['isNil'](_0x41b00e)){_0x20dbc2({'ret':0x1});}else{var _0x2eb7a7=_0x41b00e[_0x2e45('0x6a')];var _0x4bd3b9=squel[_0x2e45('0x26')]()['into'](_0x5a2f82)[_0x2e45('0x6b')]('id',_0x1a83ca['id'])['set']('offset',_0x2eb7a7)[_0x2e45('0x6b')](_0x2e45('0x69'),_0x1a83ca[_0x2e45('0x69')])[_0x2e45('0x38')]();return db['sequelize'][_0x2e45('0x5d')](_0x4bd3b9)[_0x2e45('0x5e')](function(_0x5b039a){_0x20dbc2({'ret':0x1});})[_0x2e45('0x5f')](function(_0xd1ee53){logger[_0x2e45('0x58')](_0xd1ee53['message']);_0x23533f({'ret':0x1});});}});}function handleTZQuery(_0x2f5699){logger['info'](_0x2f5699);return db[_0x2e45('0x62')][_0x2e45('0x5d')](_0x2f5699)[_0x2e45('0x5e')](function(_0x45fadf){})[_0x2e45('0x5f')](function(_0x3e9390){logger['error'](_0x3e9390[_0x2e45('0x59')]);});}function main(_0x3f830a,_0x34e977,_0x3cbc08,_0x2d1f83){logger['info'](_0x2e45('0x6c'),_0x3f830a,JSON[_0x2e45('0x6d')](_0x34e977));process[_0x2e45('0x6e')](_0x2e45('0x6f'));var _0x42b427=_0x34e977[_0x2e45('0x70')];var _0x5d3bc8=_[_0x2e45('0x71')](_0x42b427);var _0x298595=_0x34e977[_0x2e45('0x72')];var _0x374c0e=path[_0x2e45('0xe')](config[_0x2e45('0x73')],_0x2e45('0x74'),_0x298595+_0x2e45('0x75'));hasTZ=_[_0x2e45('0x50')](_0x42b427)[_0x2e45('0x76')](_0x2e45('0x69'));var _0x44f113=_['keys'](_0x42b427)[_0x2e45('0xe')]();logger[_0x2e45('0x5c')](_0x2e45('0x77'),_0x44f113);db[_0x2e45('0x78')][_0x2e45('0x13')]({'raw':!![],'attributes':['id','name']})[_0x2e45('0x14')](function(_0x27372c){for(var _0x4b8a23=0x0;_0x4b8a23<_0x27372c[_0x2e45('0x19')];_0x4b8a23++){if(_0x27372c[_0x4b8a23][_0x2e45('0x79')]in _0x42b427){contactItemTypes[_0x2e45('0x15')](_0x27372c[_0x4b8a23]);delete _0x5d3bc8[_0x27372c[_0x4b8a23][_0x2e45('0x79')]];hasAdditionalPhones=!![];}for(var _0x16e41c in _0x42b427){if(_0x27372c[_0x4b8a23][_0x2e45('0x79')]+_0x2e45('0x7a')===_0x16e41c){phoneDescriptions[_0x2e45('0x15')]({'itemTypeId':_0x27372c[_0x4b8a23]['id'],'description':_0x16e41c});delete _0x5d3bc8[_0x16e41c];}}}if(hasAdditionalPhones)_0x5d3bc8[_0x2e45('0x17')]='';var _0x2048bc=_[_0x2e45('0x50')](_0x5d3bc8)[_0x2e45('0xe')]();logger['info'](_0x2e45('0x77'),_0x2048bc);fs[_0x2e45('0x7b')](_0x374c0e,_0x2048bc+'\x0a');Papa[_0x2e45('0x7c')](fs[_0x2e45('0x7d')](_0x3f830a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x205c6a,_0x13c075){try{for(var _0x3848d3=0x0,_0x503248=[];_0x3848d3<_0x205c6a['data'][_0x2e45('0x19')];_0x3848d3++){stats[_0x2e45('0x7e')]+=0x1;if(_0x205c6a[_0x2e45('0x5b')][_0x3848d3]){handleError(_0x205c6a[_0x2e45('0x7f')][_0x3848d3],_0x205c6a['errors'][_0x3848d3]);}else{var _0x35e33f=[];var _0x5c97d6=[];var _0x4c1f02={};for(var _0x4f05e9 in _0x42b427){let _0x380cf2=contactItemTypes[_0x2e45('0x80')](_0x287f04=>_0x287f04[_0x2e45('0x79')]===_0x4f05e9);let _0x4c695d=contactItemTypes[_0x2e45('0x80')](_0x5f08f8=>_0x5f08f8[_0x2e45('0x79')]+_0x2e45('0x7a')===_0x4f05e9);if(_[_0x2e45('0x1a')](_0x380cf2)&&_[_0x2e45('0x1a')](_0x4c695d)){if(_0x42b427[_0x2e45('0x81')](_0x4f05e9)){if(_0x205c6a[_0x2e45('0x7f')][_0x3848d3][_0x42b427[_0x4f05e9]]){var _0x34ecf6=_[_0x2e45('0x82')](_0x205c6a[_0x2e45('0x7f')][_0x3848d3][_0x42b427[_0x4f05e9]][_0x2e45('0x83')](/"/g,'\x27'));switch(_0x4f05e9){case _0x2e45('0x2b'):var _0xe0bfec=moment(_0x34ecf6,_0x2e45('0xb'),!![]);if(_0xe0bfec[_0x2e45('0x84')]()){_0x503248[_0x2e45('0x15')]('\x22'+_0x34ecf6+'\x22');}else{_0x35e33f['push'](_0x2e45('0x85'));}break;case _0x2e45('0x2f'):var _0x11f339=parseInt(_0x34ecf6);_0x34ecf6=_['isNaN'](_0x11f339)||_0x11f339<0x0||_0x11f339>0x4?_0x2d1f83?0x3:0x2:_0x11f339;_0x503248[_0x2e45('0x15')]('\x22'+_0x34ecf6+'\x22');break;case _0x2e45('0x30'):var _0x33566c=parseInt(_0x34ecf6);if(_[_0x2e45('0x86')](_0x33566c)&&_[_0x2e45('0x76')](_0x3cbc08,_0x33566c)){_0x503248[_0x2e45('0x15')]('\x22'+_0x33566c+'\x22');}else{_0x35e33f[_0x2e45('0x15')]('agent\x20not\x20exists');}break;case _0x2e45('0x87'):if(isEmail(_0x34ecf6)){_0x503248[_0x2e45('0x15')]('\x22'+_0x34ecf6+'\x22');}else{_0x35e33f['push'](_0x2e45('0x88'));}break;case _0x2e45('0x89'):var _0x1e7d34=moment(_0x34ecf6,_0x2e45('0x8a'),!![]);if(_0x1e7d34[_0x2e45('0x84')]()){_0x503248['push']('\x22'+_0x34ecf6+'\x22');}else{_0x35e33f[_0x2e45('0x15')](_0x2e45('0x8b'));}break;case _0x2e45('0x69'):var _0x54e5c8=shared[_0x2e45('0x68')];var _0x19db14=_0x54e5c8[_0x34ecf6];if(!_['isNil'](_0x19db14)){var _0x2391c6=_0x19db14[_0x2e45('0x6a')];_0x503248[_0x2e45('0x15')]('\x22'+_0x34ecf6+'\x22');_0x503248[_0x2e45('0x15')]('\x22'+_0x2391c6+'\x22');}break;default:_0x503248[_0x2e45('0x15')]('\x22'+_0x34ecf6+'\x22');}}else{switch(_0x4f05e9){case _0x2e45('0x8c'):case _0x2e45('0x2a'):_0x35e33f[_0x2e45('0x15')](_0x4f05e9+_0x2e45('0x8d'));break;default:_0x503248[_0x2e45('0x15')]('\x22\x22');}}}}else{var _0x5270d0='';if(!_[_0x2e45('0x1a')](_0x380cf2)){if(!_0x4c1f02[_0x2e45('0x81')](_0x380cf2['id'])){if(!_['isNil'](_0x205c6a[_0x2e45('0x7f')][_0x3848d3][_0x42b427[_0x4f05e9]])){var _0x34ecf6=_[_0x2e45('0x82')](_0x205c6a['data'][_0x3848d3][_0x42b427[_0x4f05e9]]['replace'](/"/g,'\x27'));var _0x2907ae=phoneDescriptions[_0x2e45('0x80')](_0x31fc84=>_0x31fc84['itemTypeId']===_0x380cf2['id']);if(!_['isNil'](_0x2907ae)){var _0x24ca5d=_[_0x2e45('0x82')](_0x205c6a['data'][_0x3848d3][_0x42b427[_0x2907ae['description']]][_0x2e45('0x83')](/"/g,'\x27'));if(!_[_0x2e45('0x1a')](_0x24ca5d))_0x34ecf6=_0x34ecf6+'§'+_0x24ca5d;}if(_0x5270d0=='')_0x5270d0=_0x34ecf6;else _0x5270d0+='|'+_0x34ecf6;}_0x5c97d6[_0x2e45('0x15')](_0x380cf2['id']+':'+_0x5270d0);_0x4c1f02[_0x380cf2['id']]=0x1;}}}}if(hasAdditionalPhones){_0x503248[_0x2e45('0x15')]('\x22'+_0x5c97d6['join'](';')+'\x22');}if(_0x35e33f[_0x2e45('0x19')]){handleError(_0x205c6a[_0x2e45('0x7f')][_0x3848d3],{'code':'SystemRow','message':_0x35e33f[_0x2e45('0xe')]()});}else{fs[_0x2e45('0x8e')](_0x374c0e,_0x503248[_0x2e45('0xe')]()+'\x0a');}_0x503248=[];}if(!(stats['rows']%0xc8)){socket[_0x2e45('0x8f')](_0x2e45('0x90')+_0x298595,stats);stats[_0x2e45('0x5b')]=[];}}if(stopped){logger[_0x2e45('0x5c')](_0x2e45('0x91'));_0x13c075[_0x2e45('0x92')]();}}catch(_0x141ecc){handleError(_0x205c6a[_0x2e45('0x7f')][_0x3848d3],{'code':_0x2e45('0x93'),'message':_0x141ecc[_0x2e45('0x59')]});logger[_0x2e45('0x58')](_0x2e45('0x94'),_0x141ecc[_0x2e45('0x59')]);}},'complete':function(){try{var _0xa779fd=[];var _0x2fc3de=[];var _0x156691=_0x2e45('0x33');if(_0x34e977['duplicates']&&_0x34e977[_0x2e45('0x95')][_0x2e45('0x19')]){_0x156691=_0x2e45('0x96')+_0x298595;_0xa779fd['push'](_0x2e45('0x97')+_0x156691+'\x20LIKE\x20cm_contacts;');}tmp_campaigns='campaigns_'+_0x298595;tmp_voice_queues='voice_queues_'+_0x298595;_0x2fc3de[_0x2e45('0x15')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x2e45('0x98'));_0x2fc3de[_0x2e45('0x15')](_0x2e45('0x97')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x2e45('0x99')](_0x2fc3de,handleTZQuery)['then'](function(_0x319d1e){updateTzCampaigns(_0x34e977[_0x2e45('0x3a')])[_0x2e45('0x14')](function(_0x1897db){updateTzVoiceQueues(_0x34e977[_0x2e45('0x3a')])['then'](function(_0x37d82a){if(hasTZ)_0x2048bc=_0x2048bc['replace'](_0x2e45('0x69'),_0x2e45('0x9a'));var _0x240e67=util[_0x2e45('0xa')](_0x2e45('0x9b'),_0x374c0e,_0x156691,_0x2048bc,_0x34e977[_0x2e45('0x3a')],_0x34e977[_0x2e45('0x51')]||null,NOW,NOW);if(_[_0x2e45('0x1a')](_0x42b427[_0x2e45('0x2b')])){_0x240e67+=_0x2e45('0x9c');}_0xa779fd[_0x2e45('0x15')](_0x240e67);if(_0x34e977[_0x2e45('0x95')]&&_0x34e977['duplicates'][_0x2e45('0x19')]){_0xa779fd['push'](insertCmContact(_0x34e977[_0x2e45('0x3a')],_0x156691,_0x34e977[_0x2e45('0x95')],_0x42b427));_0xa779fd[_0x2e45('0x15')](_0x2e45('0x9d')+_0x156691+';');}BPromise[_0x2e45('0x99')](_0xa779fd,handleQuery)[_0x2e45('0x14')](function(_0x264966){BPromise[_0x2e45('0x16')]([handleAdditionalPhones()])[_0x2e45('0x14')](function(){_0xa779fd=[];for(var _0x11a12b=0x0;_0x11a12b\x20\x20','parse','binding\x20doesn\x27t\x20exists','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','push','all','then','length','split','filter','CmContactHasItem','findOne','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','fromQuery','phone','ListId','from','cm_contacts','.CmListId','.id\x20=\x20','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','\x20=\x20','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','error','message','errors','code','query','spread','catch','campaigns.id','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x1f0e,0xe7));var _0xe1f0=function(_0x2ee363,_0x138146){_0x2ee363=_0x2ee363-0x0;var _0xb80bfc=_0x1f0e[_0x2ee363];return _0xb80bfc;};'use strict';var fs=require('fs');var path=require(_0xe1f0('0x0'));var _=require('lodash');var Papa=require(_0xe1f0('0x1'));var util=require(_0xe1f0('0x2'));var BPromise=require(_0xe1f0('0x3'));var moment=require(_0xe1f0('0x4'));var squel=require('squel');var Redis=require(_0xe1f0('0x5'));var db=require(_0xe1f0('0x6'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0xe1f0('0x7'));config[_0xe1f0('0x8')]=_[_0xe1f0('0x9')](config[_0xe1f0('0x8')],{'host':_0xe1f0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1f0('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xe1f0('0xb')](_0xe1f0('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xe1f0('0xb')](_0xe1f0('0xc'));function isEmail(_0x254cbd){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))*$/[_0xe1f0('0xd')](_0x254cbd);}function selectNotIn(_0x158c68,_0x2d8b36,_0x1fc61b,_0x4eee6,_0x438b41){return squel[_0xe1f0('0xe')]()[_0xe1f0('0xf')]('phone')['from'](_0x4eee6)[_0xe1f0('0x10')](_0x2d8b36,null,_0x2d8b36+'.id\x20=\x20'+_0x4eee6+'.'+_0x1fc61b)[_0xe1f0('0x11')](_0x4eee6+'.'+_0x1fc61b+'\x20=\x20'+_0x158c68+'.'+_0x1fc61b)['where'](_0x2d8b36+_0xe1f0('0x12')+_0x438b41[_0xe1f0('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x201466,_0x20c162){promisesAdditionalPhones=[];return db[_0xe1f0('0x13')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x1dda94){if(_0x1dda94!==null){var _0x110642=[];for(var _0x3075a3=0x0;_0x3075a3<_0x1dda94['length'];_0x3075a3++){var _0x3cbf41=_0x1dda94[_0x3075a3];_0x110642[_0xe1f0('0x14')](insertAdditionalPhones(_0x3cbf41));}}Promise[_0xe1f0('0x15')](_0x110642)[_0xe1f0('0x16')](function(){_0x201466({'val':0x1});});});});}function insertAdditionalPhones(_0x1fce05){return new Promise(function(_0x5b5610,_0x12fb24){var _0x4368e4=_0x1fce05['AdditionalPhones'];var _0x4a669d=_0x4368e4['split'](';');var _0x1bd387=[];orderBy=0x0;for(var _0xde495d=0x0;_0xde495d<_0x4a669d[_0xe1f0('0x17')];_0xde495d++){_0x1bd387[_0xe1f0('0x14')](splitAdditionalPhone(_0x1fce05['id'],_0x4a669d[_0xde495d]));}Promise[_0xe1f0('0x15')](_0x1bd387)[_0xe1f0('0x16')](function(){_0x5b5610({'val':_0x4a669d[_0xe1f0('0x17')]});});});}function splitAdditionalPhone(_0x4367aa,_0x4cc41f){return new Promise(function(_0x302f7c,_0x577c00){var _0x32c970=_0x4cc41f[_0xe1f0('0x18')](':');var _0x3b35eb=_0x32c970[0x0];var _0x4ee80d=_0x32c970[0x1];if(!_['isNil'](_0x4ee80d)){var _0xd8d7cf=_0x4ee80d['split']('|');var _0x152bb0=[];for(var _0x535f70=0x0;_0x535f70<_0xd8d7cf['length'];_0x535f70++){if(_0xd8d7cf[_0x535f70]!==''){var _0x50d3c5=_[_0xe1f0('0x19')](promisesAdditionalPhones,{'contactId':_0x4367aa,'phone':_0xd8d7cf[_0x535f70]});if(_0x50d3c5[_0xe1f0('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0xe1f0('0x14')]({'contactId':_0x4367aa,'contactTypeId':_0x3b35eb,'phone':_0xd8d7cf[_0x535f70],'orderBy':orderBy});}}}_0x302f7c({'ok':0x1});}else _0x302f7c({'res':0x0});});}function createAdditionalPhone(_0xc535c4,_0xf94864,_0x131d45,_0x44d033){var _0x264ab7='';var _0x313855='';var _0x3800f6=_0x131d45[_0xe1f0('0x18')]('§');_0x264ab7=_0x3800f6[0x0];if(_0x3800f6[_0xe1f0('0x17')]==0x2)_0x313855=_0x3800f6[0x1];return new Promise(function(_0x1475a2,_0x1c11c9){return db[_0xe1f0('0x1a')][_0xe1f0('0x1b')]({'where':{'CmContactId':_0xc535c4,'item':_0x264ab7}})['then'](function(_0x48024f){if(_0x48024f){return db['CmContactHasItem']['update']({'ItemTypeId':_0xf94864,'description':_0x313855,'OrderBy':_0x44d033},{'where':{'CmContactId':_0xc535c4,'item':_0x264ab7}})[_0xe1f0('0x16')](function(_0x5cd89e){_0x1475a2({'res':'updated'});});}else{return db['CmContactHasItem'][_0xe1f0('0x1c')]({'CmContactId':_0xc535c4,'item':_0x264ab7,'description':_0x313855,'ItemTypeId':_0xf94864,'OrderBy':_0x44d033,'ItemClass':_0xe1f0('0x1d')})[_0xe1f0('0x16')](function(_0x290199){_0x1475a2({'res':_0xe1f0('0x1e')});});}});});}function insertCmHopper(_0x3844b3,_0x448b36,_0x18d833,_0x1c5303,_0x550ad1){var _0x2ef89d=[_0xe1f0('0x1f'),_0xe1f0('0x20'),_0xe1f0('0x21'),_0xe1f0('0x22'),_0x448b36+'.'+_0x1c5303,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0xe1f0('0x23'),'\x22'+_0x550ad1+'\x22'];return squel[_0xe1f0('0x24')]()[_0xe1f0('0x25')](_0xe1f0('0x26'))['fromQuery'](['phone',_0xe1f0('0x27'),_0xe1f0('0x28'),'ListId',_0x1c5303,_0xe1f0('0x29'),_0xe1f0('0x2a'),_0xe1f0('0x2b'),_0xe1f0('0x2c'),_0xe1f0('0x2d')],squel[_0xe1f0('0xe')]()[_0xe1f0('0x2e')](_0x2ef89d)['from'](_0x448b36)[_0xe1f0('0x10')]('cm_contacts',null,_0xe1f0('0x2f')+_0x448b36+'.CmListId')[_0xe1f0('0x10')](_0x18d833,null,_0x18d833+'.id\x20=\x20'+_0x448b36+'.'+_0x1c5303)[_0xe1f0('0x11')](_0x448b36+_0xe1f0('0x30'),_0x3844b3)[_0xe1f0('0x11')](_0xe1f0('0x31'),NOW)[_0xe1f0('0x11')](_0xe1f0('0x32'),selectNotIn(_0x448b36,_0x18d833,_0x1c5303,_0xe1f0('0x26'),[_0xe1f0('0x33'),_0xe1f0('0x34')]))[_0xe1f0('0x11')](_0xe1f0('0x32'),selectNotIn(_0x448b36,_0x18d833,_0x1c5303,_0xe1f0('0x26'),['\x22always\x22'])))[_0xe1f0('0x35')]();}function insertCmHopperBlack(_0x281666,_0x17297b,_0x42a089,_0x2af4ca){var _0x41deff=[_0xe1f0('0x1f'),_0xe1f0('0x21'),_0xe1f0('0x22'),_0x17297b+'.'+_0x2af4ca,_0xe1f0('0x36'),_0xe1f0('0x37')];return squel[_0xe1f0('0x24')]()['into'](_0xe1f0('0x38'))[_0xe1f0('0x39')]([_0xe1f0('0x3a'),_0xe1f0('0x28'),_0xe1f0('0x3b'),_0x2af4ca,_0xe1f0('0x29'),_0xe1f0('0x2a')],squel[_0xe1f0('0xe')]()[_0xe1f0('0x2e')](_0x41deff)[_0xe1f0('0x3c')](_0x17297b)[_0xe1f0('0x10')](_0xe1f0('0x3d'),null,_0xe1f0('0x2f')+_0x17297b+_0xe1f0('0x3e'))[_0xe1f0('0x10')](_0x42a089,null,_0x42a089+_0xe1f0('0x3f')+_0x17297b+'.'+_0x2af4ca)[_0xe1f0('0x11')](_0x17297b+_0xe1f0('0x30'),_0x281666)[_0xe1f0('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe1f0('0x11')](_0xe1f0('0x32'),squel['select']()[_0xe1f0('0xf')](_0xe1f0('0x3a'))[_0xe1f0('0x3c')]('cm_hopper_black')['where'](_0xe1f0('0x40'),_0x281666)[_0xe1f0('0x11')](_0x2af4ca+'\x20=\x20'+_0x17297b+'.'+_0x2af4ca)))[_0xe1f0('0x35')]();}function insertTzCmHopper(_0x47317b,_0x491e49,_0x50996a,_0x4c390e,_0x4c6d1a,_0x253176){var _0x5ba93e=['cm_contacts.phone',_0xe1f0('0x41')+_0x253176+_0xe1f0('0x42'),_0xe1f0('0x21'),_0xe1f0('0x22'),_0x491e49+'.'+_0x4c390e,_0xe1f0('0x36'),'cm_contacts.updatedAt',_0xe1f0('0x43'),'cm_contacts.UserId','\x22'+_0x4c6d1a+'\x22'];var _0xb9dfef=squel[_0xe1f0('0x24')]()[_0xe1f0('0x25')](_0xe1f0('0x26'))[_0xe1f0('0x39')]([_0xe1f0('0x3a'),'scheduledat',_0xe1f0('0x28'),'ListId',_0x4c390e,_0xe1f0('0x29'),_0xe1f0('0x2a'),_0xe1f0('0x2b'),_0xe1f0('0x2c'),'recallme'],squel[_0xe1f0('0xe')]()[_0xe1f0('0x2e')](_0x5ba93e)[_0xe1f0('0x3c')](_0x491e49)[_0xe1f0('0x10')](_0xe1f0('0x3d'),null,_0xe1f0('0x2f')+_0x491e49+'.CmListId')['join'](_0x50996a,null,_0x50996a+_0xe1f0('0x3f')+_0x491e49+'.'+_0x4c390e)[_0xe1f0('0x10')](_0x253176,null,_0x253176+_0xe1f0('0x3f')+_0x491e49+'.'+_0x4c390e)[_0xe1f0('0x11')](_0x491e49+_0xe1f0('0x30'),_0x47317b)[_0xe1f0('0x11')](_0xe1f0('0x31'),NOW)[_0xe1f0('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x491e49,_0x50996a,_0x4c390e,_0xe1f0('0x26'),[_0xe1f0('0x33'),_0xe1f0('0x34')]))['where'](_0xe1f0('0x32'),selectNotIn(_0x491e49,_0x50996a,_0x4c390e,_0xe1f0('0x26'),[_0xe1f0('0x33')])))[_0xe1f0('0x35')]();return _0xb9dfef;}function insertTzCmHopperBlack(_0x50aa95,_0x426f18,_0x2dc945,_0xbd5a28){var _0x55edee=[_0xe1f0('0x1f'),_0xe1f0('0x21'),'cm_contacts.ListId',_0x426f18+'.'+_0xbd5a28,'cm_contacts.createdAt',_0xe1f0('0x37')];return squel[_0xe1f0('0x24')]()[_0xe1f0('0x25')](_0xe1f0('0x38'))[_0xe1f0('0x39')]([_0xe1f0('0x3a'),_0xe1f0('0x28'),_0xe1f0('0x3b'),_0xbd5a28,_0xe1f0('0x29'),_0xe1f0('0x2a')],squel[_0xe1f0('0xe')]()[_0xe1f0('0x2e')](_0x55edee)[_0xe1f0('0x3c')](_0x426f18)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x426f18+_0xe1f0('0x3e'))[_0xe1f0('0x10')](_0x2dc945,null,_0x2dc945+_0xe1f0('0x3f')+_0x426f18+'.'+_0xbd5a28)[_0xe1f0('0x11')](_0x426f18+_0xe1f0('0x30'),_0x50aa95)[_0xe1f0('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe1f0('0x11')](_0xe1f0('0x32'),squel[_0xe1f0('0xe')]()[_0xe1f0('0xf')](_0xe1f0('0x3a'))[_0xe1f0('0x3c')](_0xe1f0('0x38'))['where'](_0xe1f0('0x40'),_0x50aa95)[_0xe1f0('0x11')](_0xbd5a28+_0xe1f0('0x44')+_0x426f18+'.'+_0xbd5a28)))[_0xe1f0('0x35')]();}function insertCmHopperAdditionalPhones(_0x133c2a){var _0x5a1504=[_0xe1f0('0x45'),_0xe1f0('0x46'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0xe1f0('0x47')];return squel['insert']()[_0xe1f0('0x25')]('cm_hopper_additional_phones')[_0xe1f0('0x39')](['CmHopperId',_0xe1f0('0x3a'),_0xe1f0('0x48'),_0xe1f0('0x29'),_0xe1f0('0x2a')],squel[_0xe1f0('0xe')]()['fields'](_0x5a1504)[_0xe1f0('0x3c')](_0xe1f0('0x26'))[_0xe1f0('0x10')]('cm_contacts',null,_0xe1f0('0x49'))['join']('cm_contact_has_items',null,_0xe1f0('0x4a'))[_0xe1f0('0x11')]('cm_hopper.ListId\x20=\x20?',_0x133c2a)['where'](_0xe1f0('0x31'),NOW))[_0xe1f0('0x35')]();}function insertCmContact(_0x44c4ca,_0x4c6ec1,_0x201b00,_0x18ebc9){var _0x5dd420=_['concat'](_[_0xe1f0('0x4b')](_0x18ebc9),[_0xe1f0('0x3b'),'CompanyId','createdAt','updatedAt']);return squel[_0xe1f0('0x24')]()[_0xe1f0('0x25')](_0xe1f0('0x3d'))['fromQuery'](_0x5dd420,squel['select']()[_0xe1f0('0x2e')](_0x5dd420)[_0xe1f0('0x3c')](_0x4c6ec1)[_0xe1f0('0x11')]('('+_0x201b00[_0xe1f0('0x10')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xe1f0('0x2e')](_0x201b00)[_0xe1f0('0x3c')]('cm_contacts')[_0xe1f0('0x11')]('ListId\x20=\x20?',_0x44c4ca)[_0xe1f0('0x11')](_0xe1f0('0x4c')))[_0xe1f0('0x11')](_0xe1f0('0x4d'),squel[_0xe1f0('0xe')]()[_0xe1f0('0xf')](_0xe1f0('0x4e'),'min_id')[_0xe1f0('0x3c')](_0x4c6ec1)['group'](_0x201b00[_0xe1f0('0x10')](','))))[_0xe1f0('0x35')]();}function handleStop(){logger[_0xe1f0('0x4f')](_0xe1f0('0x50'));stopped=!![];}function handleUncaughtException(_0x1606ad){logger[_0xe1f0('0x51')](_0x1606ad[_0xe1f0('0x52')]);process['exit'](0x1);}function handleError(_0x4c8330,_0x23e0e2){stats[_0xe1f0('0x53')][_0xe1f0('0x14')]({'name':_0x23e0e2[_0xe1f0('0x54')],'message':_0x23e0e2[_0xe1f0('0x52')],'row':_0x4c8330});}function handleQuery(_0x2e596e){logger[_0xe1f0('0x4f')](_0x2e596e);return db['sequelize'][_0xe1f0('0x55')](_0x2e596e)[_0xe1f0('0x56')](function(_0x407338){results[_0xe1f0('0x14')](_0x407338);})[_0xe1f0('0x57')](function(_0x581d75){logger['error'](_0x581d75[_0xe1f0('0x52')]);});}function updateTzCampaigns(_0xea4008){return new Promise(function(_0x491872,_0x5d63f2){var _0x4c502b=squel[_0xe1f0('0xe')]()['fields']([_0xe1f0('0x58'),'campaigns.dialTimezone'])['from'](_0xe1f0('0x59'))[_0xe1f0('0x10')]('campaigns_has_cm_lists',null,_0xe1f0('0x5a'))[_0xe1f0('0x11')](_0xe1f0('0x5b')+_0xea4008);db[_0xe1f0('0x5c')][_0xe1f0('0x55')](_0x4c502b['toString']())[_0xe1f0('0x56')](function(_0x596b57){var _0x483cad=[];for(var _0x1b4401=0x0;_0x1b4401<_0x596b57[_0xe1f0('0x17')];_0x1b4401++){_0x483cad[_0xe1f0('0x14')](getTimezoneData(_0x596b57[_0x1b4401],tmp_campaigns));}BPromise[_0xe1f0('0x15')](_0x483cad)[_0xe1f0('0x16')](function(){_0x491872({'val':0x1});});})[_0xe1f0('0x57')](function(_0x4b4f46){logger[_0xe1f0('0x51')](_0x4b4f46[_0xe1f0('0x52')]);_0x491872({'val':0x0});});});}function updateTzVoiceQueues(_0x195f6e){return new Promise(function(_0x419564,_0x2d4d42){var _0x45a634=squel[_0xe1f0('0xe')]()[_0xe1f0('0x2e')](['voice_queues.id',_0xe1f0('0x5d')])[_0xe1f0('0x3c')]('voice_queues')[_0xe1f0('0x10')](_0xe1f0('0x5e'),null,_0xe1f0('0x5f'))['where'](_0xe1f0('0x60')+_0x195f6e);db[_0xe1f0('0x5c')][_0xe1f0('0x55')](_0x45a634[_0xe1f0('0x35')]())['spread'](function(_0x3a3ea3){var _0x56cf19=[];for(var _0xee61a4=0x0;_0xee61a4<_0x3a3ea3['length'];_0xee61a4++){_0x56cf19[_0xe1f0('0x14')](getTimezoneData(_0x3a3ea3[_0xee61a4],tmp_voice_queues));}BPromise['all'](_0x56cf19)[_0xe1f0('0x16')](function(){_0x419564({'val':0x1});});})[_0xe1f0('0x57')](function(_0xa8bec8){logger[_0xe1f0('0x51')](_0xa8bec8[_0xe1f0('0x52')]);_0x419564({'val':0x0});});});}function getTimezoneData(_0x34be36,_0x1fc9a6){return new Promise(function(_0x4ba9fe,_0xf5fdc4){var _0x7cd209=shared['timezones'];var _0x1d2f8c=_0x7cd209[_0x34be36[_0xe1f0('0x61')]];if(_['isNil'](_0x1d2f8c)){_0x4ba9fe({'ret':0x1});}else{var _0x58ada9=_0x1d2f8c['utcOffset'];var _0xf9a8e1=squel[_0xe1f0('0x24')]()[_0xe1f0('0x25')](_0x1fc9a6)[_0xe1f0('0x62')]('id',_0x34be36['id'])[_0xe1f0('0x62')](_0xe1f0('0x63'),_0x58ada9)[_0xe1f0('0x62')](_0xe1f0('0x61'),_0x34be36[_0xe1f0('0x61')])[_0xe1f0('0x35')]();return db['sequelize'][_0xe1f0('0x55')](_0xf9a8e1)['spread'](function(_0x5988cd){_0x4ba9fe({'ret':0x1});})[_0xe1f0('0x57')](function(_0x1b472a){logger[_0xe1f0('0x51')](_0x1b472a[_0xe1f0('0x52')]);_0xf5fdc4({'ret':0x1});});}});}function handleTZQuery(_0xba40c2){logger[_0xe1f0('0x4f')](_0xba40c2);return db[_0xe1f0('0x5c')][_0xe1f0('0x55')](_0xba40c2)[_0xe1f0('0x56')](function(_0x5c462a){})[_0xe1f0('0x57')](function(_0x104990){logger[_0xe1f0('0x51')](_0x104990[_0xe1f0('0x52')]);});}function main(_0x3bdf81,_0x48a83d,_0x1ac929,_0xbb62d6){logger[_0xe1f0('0x4f')](_0xe1f0('0x64'),_0x3bdf81,JSON[_0xe1f0('0x65')](_0x48a83d));process[_0xe1f0('0x66')](_0xe1f0('0x67'));var _0x4d3e2a=_0x48a83d[_0xe1f0('0x68')];var _0x212df6=_['clone'](_0x4d3e2a);var _0x217a77=_0x48a83d[_0xe1f0('0x69')];var _0x4a4c50=path[_0xe1f0('0x10')](config[_0xe1f0('0x6a')],_0xe1f0('0x6b'),_0x217a77+_0xe1f0('0x6c'));hasTZ=_[_0xe1f0('0x4b')](_0x4d3e2a)[_0xe1f0('0x6d')](_0xe1f0('0x61'));var _0x216560=_[_0xe1f0('0x4b')](_0x4d3e2a)[_0xe1f0('0x10')]();logger[_0xe1f0('0x4f')]('header',_0x216560);db['ContactItemType'][_0xe1f0('0x6e')]({'raw':!![],'attributes':['id',_0xe1f0('0x6f')]})[_0xe1f0('0x16')](function(_0x33b921){for(var _0x616acf=0x0;_0x616acf<_0x33b921[_0xe1f0('0x17')];_0x616acf++){if(_0x33b921[_0x616acf][_0xe1f0('0x6f')]in _0x4d3e2a){contactItemTypes[_0xe1f0('0x14')](_0x33b921[_0x616acf]);delete _0x212df6[_0x33b921[_0x616acf]['name']];hasAdditionalPhones=!![];}for(var _0x16a16a in _0x4d3e2a){if(_0x33b921[_0x616acf][_0xe1f0('0x6f')]+_0xe1f0('0x70')===_0x16a16a){phoneDescriptions[_0xe1f0('0x14')]({'itemTypeId':_0x33b921[_0x616acf]['id'],'description':_0x16a16a});delete _0x212df6[_0x16a16a];}}}if(hasAdditionalPhones)_0x212df6['AdditionalPhones']='';var _0x53ff86=_[_0xe1f0('0x4b')](_0x212df6)[_0xe1f0('0x10')]();logger[_0xe1f0('0x4f')]('header',_0x53ff86);fs[_0xe1f0('0x71')](_0x4a4c50,_0x53ff86+'\x0a');Papa['parse'](fs[_0xe1f0('0x72')](_0x3bdf81),{'header':!![],'skipEmptyLines':!![],'step':function(_0x14d032,_0x3a5e90){try{for(var _0x1d9a09=0x0,_0x3130af=[];_0x1d9a09<_0x14d032[_0xe1f0('0x73')]['length'];_0x1d9a09++){stats[_0xe1f0('0x74')]+=0x1;if(_0x14d032[_0xe1f0('0x53')][_0x1d9a09]){handleError(_0x14d032[_0xe1f0('0x73')][_0x1d9a09],_0x14d032['errors'][_0x1d9a09]);}else{var _0x4fc2b3=[];var _0x3de206=[];var _0x459a7d={};for(var _0x4a72a1 in _0x4d3e2a){let _0x41b38b=contactItemTypes[_0xe1f0('0x75')](_0x3f1394=>_0x3f1394[_0xe1f0('0x6f')]===_0x4a72a1);let _0x568f79=contactItemTypes[_0xe1f0('0x75')](_0x44fc22=>_0x44fc22['name']+_0xe1f0('0x70')===_0x4a72a1);if(_[_0xe1f0('0x76')](_0x41b38b)&&_[_0xe1f0('0x76')](_0x568f79)){if(_0x4d3e2a[_0xe1f0('0x77')](_0x4a72a1)){if(_0x14d032['data'][_0x1d9a09][_0x4d3e2a[_0x4a72a1]]){var _0xeb2124=_[_0xe1f0('0x78')](_0x14d032[_0xe1f0('0x73')][_0x1d9a09][_0x4d3e2a[_0x4a72a1]][_0xe1f0('0x79')](/"/g,'\x27'));switch(_0x4a72a1){case'scheduledat':var _0x548da7=moment(_0xeb2124,_0xe1f0('0xc'),!![]);if(_0x548da7[_0xe1f0('0x7a')]()){_0x3130af['push']('\x22'+_0xeb2124+'\x22');}else{_0x4fc2b3['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xe1f0('0x2b'):var _0x4c6a13=parseInt(_0xeb2124);_0xeb2124=_[_0xe1f0('0x7b')](_0x4c6a13)||_0x4c6a13<0x0||_0x4c6a13>0x4?_0xbb62d6?0x3:0x2:_0x4c6a13;_0x3130af[_0xe1f0('0x14')]('\x22'+_0xeb2124+'\x22');break;case'UserId':var _0x39b450=parseInt(_0xeb2124);if(_[_0xe1f0('0x7c')](_0x39b450)&&_[_0xe1f0('0x6d')](_0x1ac929,_0x39b450)){_0x3130af['push']('\x22'+_0x39b450+'\x22');}else{_0x4fc2b3[_0xe1f0('0x14')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0xeb2124)){_0x3130af['push']('\x22'+_0xeb2124+'\x22');}else{_0x4fc2b3[_0xe1f0('0x14')]('email\x20wrong\x20format');}break;case _0xe1f0('0x7d'):var _0x27d297=moment(_0xeb2124,_0xe1f0('0x7e'),!![]);if(_0x27d297[_0xe1f0('0x7a')]()){_0x3130af['push']('\x22'+_0xeb2124+'\x22');}else{_0x4fc2b3[_0xe1f0('0x14')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x4d009b=shared[_0xe1f0('0x7f')];var _0x1240cb=_0x4d009b[_0xeb2124];if(!_[_0xe1f0('0x76')](_0x1240cb)){var _0x2b5893=_0x1240cb[_0xe1f0('0x80')];_0x3130af[_0xe1f0('0x14')]('\x22'+_0xeb2124+'\x22');_0x3130af[_0xe1f0('0x14')]('\x22'+_0x2b5893+'\x22');}break;default:_0x3130af['push']('\x22'+_0xeb2124+'\x22');}}else{switch(_0x4a72a1){case'firstName':case'phone':_0x4fc2b3[_0xe1f0('0x14')](_0x4a72a1+_0xe1f0('0x81'));break;default:_0x3130af[_0xe1f0('0x14')]('\x22\x22');}}}}else{var _0x20352c='';if(!_['isNil'](_0x41b38b)){if(!_0x459a7d[_0xe1f0('0x77')](_0x41b38b['id'])){if(!_['isNil'](_0x14d032[_0xe1f0('0x73')][_0x1d9a09][_0x4d3e2a[_0x4a72a1]])){var _0xeb2124=_[_0xe1f0('0x78')](_0x14d032['data'][_0x1d9a09][_0x4d3e2a[_0x4a72a1]][_0xe1f0('0x79')](/"/g,'\x27'));var _0x13c72b=phoneDescriptions[_0xe1f0('0x75')](_0x40c12b=>_0x40c12b[_0xe1f0('0x82')]===_0x41b38b['id']);if(!_[_0xe1f0('0x76')](_0x13c72b)){var _0x4bcc8f=_['trim'](_0x14d032[_0xe1f0('0x73')][_0x1d9a09][_0x4d3e2a[_0x13c72b[_0xe1f0('0x83')]]][_0xe1f0('0x79')](/"/g,'\x27'));if(!_[_0xe1f0('0x76')](_0x4bcc8f))_0xeb2124=_0xeb2124+'§'+_0x4bcc8f;}if(_0x20352c=='')_0x20352c=_0xeb2124;else _0x20352c+='|'+_0xeb2124;}_0x3de206[_0xe1f0('0x14')](_0x41b38b['id']+':'+_0x20352c);_0x459a7d[_0x41b38b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3130af['push']('\x22'+_0x3de206[_0xe1f0('0x10')](';')+'\x22');}if(_0x4fc2b3[_0xe1f0('0x17')]){handleError(_0x14d032[_0xe1f0('0x73')][_0x1d9a09],{'code':_0xe1f0('0x84'),'message':_0x4fc2b3[_0xe1f0('0x10')]()});}else{fs['appendFileSync'](_0x4a4c50,_0x3130af[_0xe1f0('0x10')]()+'\x0a');}_0x3130af=[];}if(!(stats[_0xe1f0('0x74')]%0xc8)){socket['emit'](_0xe1f0('0x85')+_0x217a77,stats);stats[_0xe1f0('0x53')]=[];}}if(stopped){logger[_0xe1f0('0x4f')]('Abort\x20parser');_0x3a5e90[_0xe1f0('0x86')]();}}catch(_0xd85de5){handleError(_0x14d032[_0xe1f0('0x73')][_0x1d9a09],{'code':_0xe1f0('0x87'),'message':_0xd85de5[_0xe1f0('0x52')]});logger['error']('step',_0xd85de5[_0xe1f0('0x52')]);}},'complete':function(){try{var _0x21014e=[];var _0x23ec6f=[];var _0x303d17=_0xe1f0('0x3d');if(_0x48a83d[_0xe1f0('0x88')]&&_0x48a83d[_0xe1f0('0x88')]['length']){_0x303d17=_0xe1f0('0x89')+_0x217a77;_0x21014e[_0xe1f0('0x14')](_0xe1f0('0x8a')+_0x303d17+_0xe1f0('0x8b'));}tmp_campaigns='campaigns_'+_0x217a77;tmp_voice_queues='voice_queues_'+_0x217a77;_0x23ec6f[_0xe1f0('0x14')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xe1f0('0x8c'));_0x23ec6f['push'](_0xe1f0('0x8a')+tmp_voice_queues+_0xe1f0('0x8c'));BPromise[_0xe1f0('0x8d')](_0x23ec6f,handleTZQuery)[_0xe1f0('0x16')](function(_0x402555){updateTzCampaigns(_0x48a83d[_0xe1f0('0x3b')])[_0xe1f0('0x16')](function(_0x2d3edd){updateTzVoiceQueues(_0x48a83d['ListId'])[_0xe1f0('0x16')](function(_0x5ec7c5){if(hasTZ)_0x53ff86=_0x53ff86[_0xe1f0('0x79')](_0xe1f0('0x61'),_0xe1f0('0x8e'));var _0x3d4db7=util[_0xe1f0('0xb')](_0xe1f0('0x8f'),_0x4a4c50,_0x303d17,_0x53ff86,_0x48a83d[_0xe1f0('0x3b')],_0x48a83d[_0xe1f0('0x90')]||null,NOW,NOW);if(_[_0xe1f0('0x76')](_0x4d3e2a[_0xe1f0('0x27')])){_0x3d4db7+=',\x20scheduledAt\x20=\x20NOW()';}_0x21014e[_0xe1f0('0x14')](_0x3d4db7);if(_0x48a83d[_0xe1f0('0x88')]&&_0x48a83d[_0xe1f0('0x88')][_0xe1f0('0x17')]){_0x21014e[_0xe1f0('0x14')](insertCmContact(_0x48a83d['ListId'],_0x303d17,_0x48a83d['duplicates'],_0x4d3e2a));_0x21014e[_0xe1f0('0x14')](_0xe1f0('0x91')+_0x303d17+';');}BPromise['each'](_0x21014e,handleQuery)['then'](function(_0x39dc5d){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x21014e=[];for(var _0x16b4d0=0x0;_0x16b4d0\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','cm_contacts_temp_','test','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','isNil','AdditionalPhones','push','all','catch','error','split','then','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','CmContact','phone','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','priority'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x6eb2,0x10a));var _0x26eb=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x6eb2[_0x2a558d];return _0xa7bc9c;};'use strict';var fs=require('fs');var path=require(_0x26eb('0x0'));var _=require('lodash');var Papa=require(_0x26eb('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x26eb('0x2'));var squel=require(_0x26eb('0x3'));var Redis=require(_0x26eb('0x4'));var db=require(_0x26eb('0x5'))['db'];var config=require(_0x26eb('0x6'));var logger=require(_0x26eb('0x7'))(_0x26eb('0x8'));config['redis']=_[_0x26eb('0x9')](config[_0x26eb('0xa')],{'host':_0x26eb('0xb'),'port':0x18eb});var socket=require(_0x26eb('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x26eb('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x26eb('0xe')+moment()[_0x26eb('0xd')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x3d010f){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))*$/[_0x26eb('0xf')](_0x3d010f);}function selectNotIn(_0x14d022,_0x5db75f,_0x32404e,_0xe45bc6,_0x26ead1){return squel['select']()['field']('phone')[_0x26eb('0x10')](_0xe45bc6)[_0x26eb('0x11')](_0x5db75f,null,_0x5db75f+_0x26eb('0x12')+_0xe45bc6+'.'+_0x32404e)[_0x26eb('0x13')](_0xe45bc6+'.'+_0x32404e+_0x26eb('0x14')+_0x14d022+'.'+_0x32404e)[_0x26eb('0x13')](_0x5db75f+_0x26eb('0x15')+_0x26ead1[_0x26eb('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x59b877,_0x22f874){promisesAdditionalPhones=[];promisesContact=[];return db[_0x26eb('0x16')][_0x26eb('0x17')]('select\x20*\x20from\x20'+tempTableName)[_0x26eb('0x18')](function(_0x361085){if(_0x361085!==null){var _0x3898f5=[];for(var _0x450bf9=0x0;_0x450bf9<_0x361085[_0x26eb('0x19')];_0x450bf9++){var _0x258fff=_0x361085[_0x450bf9];if(!_[_0x26eb('0x1a')](_0x258fff['phone'])){if(!_['isNil'](_0x258fff[_0x26eb('0x1b')]))_0x3898f5['push'](insertAdditionalPhones(_0x258fff));promisesContact[_0x26eb('0x1c')]({'contact':_0x258fff});}}}Promise[_0x26eb('0x1d')](_0x3898f5)['then'](function(){_0x59b877({'val':0x1});});})[_0x26eb('0x1e')](function(_0x370c66){logger[_0x26eb('0x1f')](_0x370c66['message']);});});}function insertAdditionalPhones(_0x185dff){return new Promise(function(_0x3eb486,_0x320bbe){var _0x3a894d=_0x185dff['AdditionalPhones'];if(_[_0x26eb('0x1a')](_0x3a894d))_0x320bbe({'val':0x0});else{var _0x29c01a=_0x3a894d[_0x26eb('0x20')](';');var _0x1c34b3=[];orderBy=0x0;for(var _0x4daf8e=0x0;_0x4daf8e<_0x29c01a[_0x26eb('0x19')];_0x4daf8e++){_0x1c34b3[_0x26eb('0x1c')](splitAdditionalPhone(_0x185dff['id'],_0x29c01a[_0x4daf8e]));}Promise[_0x26eb('0x1d')](_0x1c34b3)[_0x26eb('0x21')](function(){_0x3eb486({'val':_0x29c01a[_0x26eb('0x19')]});});}});}function splitAdditionalPhone(_0x18ddc4,_0x31127e){return new Promise(function(_0x317e16,_0xc5adb6){var _0x2c41c8=_0x31127e[_0x26eb('0x20')](':');var _0x4a3e03=_0x2c41c8[0x0];var _0xa93eaf=_0x2c41c8[0x1];if(_0xa93eaf!==''){var _0x521c4b=_0xa93eaf[_0x26eb('0x20')]('|');var _0x317928=[];for(var _0x575f61=0x0;_0x575f61<_0x521c4b[_0x26eb('0x19')];_0x575f61++){if(_0x521c4b[_0x575f61]!==''){var _0x457c8f=_[_0x26eb('0x22')](promisesAdditionalPhones,{'contactId':_0x18ddc4,'phone':_0x521c4b[_0x575f61]});if(_0x457c8f[_0x26eb('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x26eb('0x1c')]({'contactId':_0x18ddc4,'contactTypeId':_0x4a3e03,'phone':_0x521c4b[_0x575f61],'orderBy':orderBy});}}}_0x317e16({'ok':0x1});}else _0x317e16({'res':0x0});});}function createAdditionalPhone(_0x352e16,_0x45ca23,_0x4925f0,_0x3091d6){var _0x5b180f='';var _0x44b90e='';var _0x52473d=_0x4925f0[_0x26eb('0x20')]('§');_0x5b180f=_0x52473d[0x0];if(_0x52473d[_0x26eb('0x19')]==0x2)_0x44b90e=_0x52473d[0x1];return new Promise(function(_0x231949,_0x40fbf2){return db[_0x26eb('0x23')][_0x26eb('0x24')]({'where':{'CmContactId':_0x352e16,'item':_0x5b180f}})['then'](function(_0x123a65){if(_0x123a65){return db[_0x26eb('0x23')][_0x26eb('0x25')]({'ItemTypeId':_0x45ca23,'description':_0x44b90e,'OrderBy':_0x3091d6},{'where':{'CmContactId':_0x352e16,'item':_0x5b180f}})[_0x26eb('0x21')](function(_0x23c774){_0x231949({'res':'updated'});});}else{return db['CmContactHasItem'][_0x26eb('0x26')]({'CmContactId':_0x352e16,'item':_0x5b180f,'ItemTypeId':_0x45ca23,'description':_0x44b90e,'OrderBy':_0x3091d6,'ItemClass':_0x26eb('0x27')})['then'](function(_0x950e2b){_0x231949({'res':_0x26eb('0x28')});});}});});}function updateContact(_0x53e0ed){return new Promise(function(_0x48eb14,_0x3d3ded){var _0x4d9b46=_0x53e0ed['id'];delete _0x53e0ed['id'];return db[_0x26eb('0x29')][_0x26eb('0x25')](_0x53e0ed,{'where':{'id':_0x4d9b46}})[_0x26eb('0x21')](function(_0x3b0b5f){updatedRows+=0x1;return db['CmHopper'][_0x26eb('0x25')]({'phone':_0x53e0ed[_0x26eb('0x2a')]},{'where':{'ContactId':_0x4d9b46}})[_0x26eb('0x21')](function(_0x57105f){_0x48eb14({'ret':'OK'});});});});}function insertCmHopper(_0x7f2963,_0x24df8e,_0x22e1f8,_0x574f74,_0x25f6e6){var _0x5b169e=[_0x26eb('0x2b'),_0x26eb('0x2c'),_0x26eb('0x2d'),_0x26eb('0x2e'),_0x24df8e+'.'+_0x574f74,_0x26eb('0x2f'),'cm_contacts.updatedAt',_0x26eb('0x30'),'cm_contacts.UserId','\x22'+_0x25f6e6+'\x22'];return squel[_0x26eb('0x31')]()['into'](_0x26eb('0x32'))[_0x26eb('0x33')](['phone',_0x26eb('0x34'),_0x26eb('0x35'),_0x26eb('0x36'),_0x574f74,'createdAt','updatedAt',_0x26eb('0x37'),_0x26eb('0x38'),_0x26eb('0x39')],squel[_0x26eb('0x3a')]()[_0x26eb('0x3b')](_0x5b169e)[_0x26eb('0x10')](_0x24df8e)[_0x26eb('0x11')](_0x26eb('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x24df8e+_0x26eb('0x3d'))['join'](_0x22e1f8,null,_0x22e1f8+_0x26eb('0x12')+_0x24df8e+'.'+_0x574f74)[_0x26eb('0x13')](_0x24df8e+_0x26eb('0x3e'),_0x7f2963)[_0x26eb('0x13')](_0x26eb('0x3f'),NOW)['where'](_0x26eb('0x40'),selectNotIn(_0x24df8e,_0x22e1f8,_0x574f74,'cm_hopper',[_0x26eb('0x41'),_0x26eb('0x42')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x24df8e,_0x22e1f8,_0x574f74,_0x26eb('0x32'),[_0x26eb('0x41')])))['toString']();}function insertCmHopperBlack(_0x3c9211,_0x37a2cf,_0x331ad0,_0x10b40b){var _0x2938fe=[_0x26eb('0x2b'),'cm_contacts.id',_0x26eb('0x2e'),_0x37a2cf+'.'+_0x10b40b,'cm_contacts.createdAt',_0x26eb('0x43')];return squel[_0x26eb('0x31')]()[_0x26eb('0x44')](_0x26eb('0x45'))[_0x26eb('0x33')]([_0x26eb('0x2a'),'ContactId',_0x26eb('0x36'),_0x10b40b,_0x26eb('0x46'),'updatedAt'],squel['select']()[_0x26eb('0x3b')](_0x2938fe)[_0x26eb('0x10')](_0x37a2cf)['join'](_0x26eb('0x3c'),null,_0x26eb('0x47')+_0x37a2cf+'.CmListId')[_0x26eb('0x11')](_0x331ad0,null,_0x331ad0+'.id\x20=\x20'+_0x37a2cf+'.'+_0x10b40b)[_0x26eb('0x13')](_0x37a2cf+'.CmListId\x20=\x20?',_0x3c9211)[_0x26eb('0x13')](_0x26eb('0x3f'),NOW)[_0x26eb('0x13')](_0x26eb('0x40'),squel['select']()[_0x26eb('0x48')]('phone')[_0x26eb('0x10')](_0x26eb('0x45'))['where']('ListId\x20=\x20?',_0x3c9211)[_0x26eb('0x13')](_0x10b40b+_0x26eb('0x49'),_0x37a2cf+'.'+_0x10b40b)))[_0x26eb('0x4a')]();}function insertCmHopperAdditionalPhones(_0x36dbe0){var _0x3245c5=[_0x26eb('0x4b'),_0x26eb('0x4c'),_0x26eb('0x4d'),_0x26eb('0x4e'),_0x26eb('0x4f')];return squel[_0x26eb('0x31')]()[_0x26eb('0x44')](_0x26eb('0x50'))[_0x26eb('0x33')](['CmHopperId',_0x26eb('0x2a'),_0x26eb('0x51'),_0x26eb('0x46'),_0x26eb('0x52')],squel[_0x26eb('0x3a')]()[_0x26eb('0x3b')](_0x3245c5)['from'](_0x26eb('0x32'))['join'](_0x26eb('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x26eb('0x11')](_0x26eb('0x53'),null,_0x26eb('0x54'))['where'](_0x26eb('0x55'),_0x36dbe0)[_0x26eb('0x13')](_0x26eb('0x3f'),NOW))['toString']();}function insertCmContact(_0x343458,_0x396fc1,_0xe531b4,_0x38f53b){var _0x394ac4=_[_0x26eb('0x56')](_[_0x26eb('0x57')](_0x38f53b),[_0x26eb('0x36'),_0x26eb('0x58'),'createdAt',_0x26eb('0x52')]);return squel[_0x26eb('0x31')]()['into']('cm_contacts')['fromQuery'](_0x394ac4,squel[_0x26eb('0x3a')]()[_0x26eb('0x3b')](_0x394ac4)[_0x26eb('0x10')](_0x396fc1)[_0x26eb('0x13')]('('+_0xe531b4['join'](',')+_0x26eb('0x59'),squel[_0x26eb('0x3a')]()['fields'](_0xe531b4)[_0x26eb('0x10')](_0x26eb('0x3c'))[_0x26eb('0x13')]('ListId\x20=\x20?',_0x343458))[_0x26eb('0x13')](_0x26eb('0x5a'),squel[_0x26eb('0x3a')]()[_0x26eb('0x48')](_0x26eb('0x5b'),'min_id')[_0x26eb('0x10')](_0x396fc1)['group'](_0xe531b4['join'](','))))['toString']();}function handleStop(){logger[_0x26eb('0x5c')](_0x26eb('0x5d'));stopped=!![];}function handleUncaughtException(_0x3108b6){logger[_0x26eb('0x1f')](_0x3108b6[_0x26eb('0x5e')]);process['exit'](0x1);}function handleError(_0x3cda1a,_0x20f065){stats[_0x26eb('0x5f')][_0x26eb('0x1c')]({'name':_0x20f065[_0x26eb('0x60')],'message':_0x20f065[_0x26eb('0x5e')],'row':_0x3cda1a});}function handleQuery(_0x237218){logger[_0x26eb('0x5c')](_0x237218);return db[_0x26eb('0x16')][_0x26eb('0x17')](_0x237218)[_0x26eb('0x18')](function(_0x408e4f){results[_0x26eb('0x1c')](_0x408e4f);})[_0x26eb('0x1e')](function(_0x163977){logger[_0x26eb('0x1f')](_0x163977['message']);});}function main(_0x37b74b,_0x22b535,_0x3fcc66,_0x19558f){logger[_0x26eb('0x5c')](_0x26eb('0x61'),_0x37b74b,JSON[_0x26eb('0x62')](_0x22b535));process['send'](_0x26eb('0x63'));var _0x3c6516=_0x22b535['binding'];var _0x42789e=_[_0x26eb('0x64')](_0x3c6516);var _0x22ecaf=_0x22b535[_0x26eb('0x65')];var _0x2c1845=path['join'](config[_0x26eb('0x66')],_0x26eb('0x67'),_0x22ecaf+'.csv');logger['info']('body',_0x22b535);db[_0x26eb('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x26eb('0x69')]})[_0x26eb('0x21')](function(_0x1bc29c){for(var _0x46f944=0x0;_0x46f944<_0x1bc29c[_0x26eb('0x19')];_0x46f944++){if(_0x1bc29c[_0x46f944]['name']in _0x3c6516){contactItemTypes[_0x26eb('0x1c')](_0x1bc29c[_0x46f944]);delete _0x42789e[_0x1bc29c[_0x46f944][_0x26eb('0x69')]];hasAdditionalPhones=!![];}for(var _0x5b7bbd in _0x3c6516){if(_0x1bc29c[_0x46f944]['name']+_0x26eb('0x6a')===_0x5b7bbd){phoneDescriptions[_0x26eb('0x1c')]({'itemTypeId':_0x1bc29c[_0x46f944]['id'],'description':_0x5b7bbd});delete _0x42789e[_0x5b7bbd];}}}if(hasAdditionalPhones)_0x42789e[_0x26eb('0x1b')]='';var _0x27402c=_[_0x26eb('0x57')](_0x42789e)[_0x26eb('0x11')]();logger[_0x26eb('0x5c')](_0x26eb('0x6b'),_0x27402c);fs[_0x26eb('0x6c')](_0x2c1845,_0x27402c+'\x0a');Papa['parse'](fs[_0x26eb('0x6d')](_0x37b74b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x31cac2,_0x33a77a){try{for(var _0x21c7ec=0x0,_0x37cea3=[];_0x21c7ec<_0x31cac2[_0x26eb('0x6e')][_0x26eb('0x19')];_0x21c7ec++){stats[_0x26eb('0x6f')]+=0x1;if(_0x31cac2['errors'][_0x21c7ec]){handleError(_0x31cac2[_0x26eb('0x6e')][_0x21c7ec],_0x31cac2[_0x26eb('0x5f')][_0x21c7ec]);}else{var _0xd1650e=[];var _0x1182b2=[];var _0xa9e20b={};for(var _0x5ef666 in _0x3c6516){let _0xa5c61=contactItemTypes[_0x26eb('0x70')](_0x1d4e0c=>_0x1d4e0c[_0x26eb('0x69')]===_0x5ef666);let _0x27b09f=contactItemTypes[_0x26eb('0x70')](_0x171f88=>_0x171f88['name']+_0x26eb('0x6a')===_0x5ef666);if(_[_0x26eb('0x1a')](_0xa5c61)&&_[_0x26eb('0x1a')](_0x27b09f)){if(_0x3c6516[_0x26eb('0x71')](_0x5ef666)){if(_0x31cac2[_0x26eb('0x6e')][_0x21c7ec][_0x3c6516[_0x5ef666]]){var _0x49f0e6=_['trim'](_0x31cac2[_0x26eb('0x6e')][_0x21c7ec][_0x3c6516[_0x5ef666]][_0x26eb('0x72')](/"/g,'\x27'));switch(_0x5ef666){case _0x26eb('0x34'):var _0x3bffaf=moment(_0x49f0e6,_0x26eb('0x73'),!![]);if(_0x3bffaf[_0x26eb('0x74')]()){_0x37cea3['push']('\x22'+_0x49f0e6+'\x22');}else{_0xd1650e['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x26eb('0x37'):var _0x22b874=parseInt(_0x49f0e6);_0x49f0e6=_['isNaN'](_0x22b874)||_0x22b874<0x0||_0x22b874>0x4?_0x19558f?0x3:0x2:_0x22b874;_0x37cea3['push']('\x22'+_0x49f0e6+'\x22');break;case _0x26eb('0x38'):var _0x4ab41b=parseInt(_0x49f0e6);if(_[_0x26eb('0x75')](_0x4ab41b)&&_['includes'](_0x3fcc66,_0x4ab41b)){_0x37cea3[_0x26eb('0x1c')]('\x22'+_0x4ab41b+'\x22');}else{_0xd1650e[_0x26eb('0x1c')](_0x26eb('0x76'));}break;case _0x26eb('0x77'):if(isEmail(_0x49f0e6)){_0x37cea3[_0x26eb('0x1c')]('\x22'+_0x49f0e6+'\x22');}else{_0xd1650e[_0x26eb('0x1c')](_0x26eb('0x78'));}break;case'dateOfBirth':var _0x439129=moment(_0x49f0e6,_0x26eb('0x79'),!![]);if(_0x439129[_0x26eb('0x74')]()){_0x37cea3[_0x26eb('0x1c')]('\x22'+_0x49f0e6+'\x22');}else{_0xd1650e[_0x26eb('0x1c')](_0x26eb('0x7a'));}break;default:_0x37cea3[_0x26eb('0x1c')]('\x22'+_0x49f0e6+'\x22');}}else{switch(_0x5ef666){case _0x26eb('0x7b'):case'phone':_0xd1650e[_0x26eb('0x1c')](_0x5ef666+_0x26eb('0x7c'));break;default:_0x37cea3[_0x26eb('0x1c')]('\x22\x22');}}}}else{var _0x32e9d3='';if(!_['isNil'](_0xa5c61)){if(!_0xa9e20b[_0x26eb('0x71')](_0xa5c61['id'])){for(var _0x4c7d44=0x0;_0x4c7d44<_0x3c6516[_0x5ef666][_0x26eb('0x19')];_0x4c7d44++){var _0x49f0e6=_[_0x26eb('0x7d')](_0x31cac2[_0x26eb('0x6e')][_0x21c7ec][_0x3c6516[_0x5ef666][_0x4c7d44]]['replace'](/"/g,'\x27'));var _0x41a063=phoneDescriptions['find'](_0x31a341=>_0x31a341[_0x26eb('0x7e')]===_0xa5c61['id']);if(!_[_0x26eb('0x1a')](_0x41a063)){var _0x41c7eb=_[_0x26eb('0x7d')](_0x31cac2['data'][_0x21c7ec][_0x3c6516[_0x41a063[_0x26eb('0x7f')]][0x0]][_0x26eb('0x72')](/"/g,'\x27'));if(!_['isNil'](_0x41c7eb))_0x49f0e6=_0x49f0e6+'§'+_0x41c7eb;}if(_0x32e9d3=='')_0x32e9d3=_0x49f0e6;else _0x32e9d3+='|'+_0x49f0e6;}_0x1182b2[_0x26eb('0x1c')](_0xa5c61['id']+':'+_0x32e9d3);_0xa9e20b[_0xa5c61['id']]=0x1;}}}}if(hasAdditionalPhones){_0x37cea3[_0x26eb('0x1c')]('\x22'+_0x1182b2[_0x26eb('0x11')](';')+'\x22');}if(_0xd1650e[_0x26eb('0x19')]){handleError(_0x31cac2['data'][_0x21c7ec],{'code':_0x26eb('0x80'),'message':_0xd1650e[_0x26eb('0x11')]()});}else{fs[_0x26eb('0x81')](_0x2c1845,_0x37cea3[_0x26eb('0x11')]()+'\x0a');}_0x37cea3=[];}if(!(stats[_0x26eb('0x6f')]%0xc8)){socket[_0x26eb('0x82')](_0x26eb('0x83')+_0x22ecaf,stats);stats['errors']=[];}}if(stopped){logger[_0x26eb('0x5c')](_0x26eb('0x84'));_0x33a77a[_0x26eb('0x85')]();}}catch(_0x3b0ed1){handleError(_0x31cac2['data'][_0x21c7ec],{'code':'SystemError','message':_0x3b0ed1[_0x26eb('0x5e')]});logger[_0x26eb('0x1f')](_0x26eb('0x86'),_0x3b0ed1[_0x26eb('0x5e')]);}},'complete':function(){try{var _0x14a822=[];var _0x497ad9=tempTableName;_0x14a822['push'](_0x26eb('0x87')+_0x497ad9+_0x26eb('0x88'));logger['info'](_0x26eb('0x89'),contactItemTypes['length']);var _0x24aaf8=util['format'](_0x26eb('0x8a'),_0x2c1845,_0x497ad9,_0x27402c,_0x22b535[_0x26eb('0x36')],_0x22b535['CompanyId']||null,NOW,NOW);if(_[_0x26eb('0x1a')](_0x3c6516[_0x26eb('0x34')])){_0x24aaf8+=',\x20scheduledAt\x20=\x20NOW()';}_0x14a822[_0x26eb('0x1c')](_0x24aaf8);BPromise[_0x26eb('0x8b')](_0x14a822,handleQuery)[_0x26eb('0x21')](function(_0x21be1f){BPromise[_0x26eb('0x1d')]([handleAdditionalPhones()])[_0x26eb('0x21')](function(){_0x14a822=[];for(var _0x613c1=0x0;_0x613c1\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','No\x20agent\x20available','SIGINT','uncaughtException','papaparse','util','moment','squel','ioredis','../../../config/logger','import','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','CmContactHasItem','updated','create','PHONE','inserted','CmContact','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery'];(function(_0x390199,_0x4c7cb4){var _0x4e7669=function(_0x4dd337){while(--_0x4dd337){_0x390199['push'](_0x390199['shift']());}};_0x4e7669(++_0x4c7cb4);}(_0x3eae,0x66));var _0xe3ea=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0x3eae[_0x3337b6];return _0x568270;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xe3ea('0x0'));var util=require(_0xe3ea('0x1'));var BPromise=require('bluebird');var moment=require(_0xe3ea('0x2'));var squel=require(_0xe3ea('0x3'));var Redis=require(_0xe3ea('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xe3ea('0x5'))(_0xe3ea('0x6'));config['redis']=_[_0xe3ea('0x7')](config[_0xe3ea('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3ea('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xe3ea('0xa')](_0xe3ea('0xb'));var tempTableName=_0xe3ea('0xc')+moment()['format'](_0xe3ea('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1b6707){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))*$/[_0xe3ea('0xe')](_0x1b6707);}function selectNotIn(_0x31a966,_0x3175e0,_0x1a7d07,_0x2380a1,_0x2eae0d){return squel['select']()['field'](_0xe3ea('0xf'))[_0xe3ea('0x10')](_0x2380a1)[_0xe3ea('0x11')](_0x3175e0,null,_0x3175e0+_0xe3ea('0x12')+_0x2380a1+'.'+_0x1a7d07)[_0xe3ea('0x13')](_0x2380a1+'.'+_0x1a7d07+_0xe3ea('0x14')+_0x31a966+'.'+_0x1a7d07)[_0xe3ea('0x13')](_0x3175e0+_0xe3ea('0x15')+_0x2eae0d[_0xe3ea('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x11f560,_0x2bc281){promisesAdditionalPhones=[];promisesContact=[];return db[_0xe3ea('0x16')][_0xe3ea('0x17')]('select\x20*\x20from\x20'+tempTableName)[_0xe3ea('0x18')](function(_0x2a086a){if(_0x2a086a!==null){var _0x1d686c=[];for(var _0x6f5ab2=0x0;_0x6f5ab2<_0x2a086a[_0xe3ea('0x19')];_0x6f5ab2++){var _0x33e6ae=_0x2a086a[_0x6f5ab2];if(!_[_0xe3ea('0x1a')](_0x33e6ae[_0xe3ea('0xf')])){if(!_[_0xe3ea('0x1a')](_0x33e6ae[_0xe3ea('0x1b')]))_0x1d686c[_0xe3ea('0x1c')](insertAdditionalPhones(_0x33e6ae));promisesContact[_0xe3ea('0x1c')]({'contact':_0x33e6ae});}}}Promise[_0xe3ea('0x1d')](_0x1d686c)[_0xe3ea('0x1e')](function(){_0x11f560({'val':0x1});});})[_0xe3ea('0x1f')](function(_0x280adb){logger[_0xe3ea('0x20')](_0x280adb[_0xe3ea('0x21')]);});});}function insertAdditionalPhones(_0x1f28ca){return new Promise(function(_0x29e32e,_0xd61c1c){var _0x339d08=_0x1f28ca[_0xe3ea('0x1b')];if(_[_0xe3ea('0x1a')](_0x339d08))_0xd61c1c({'val':0x0});else{var _0x2462c4=_0x339d08['split'](';');var _0x5ed42a=[];orderBy=0x0;for(var _0x4f0e9e=0x0;_0x4f0e9e<_0x2462c4[_0xe3ea('0x19')];_0x4f0e9e++){_0x5ed42a['push'](splitAdditionalPhone(_0x1f28ca['id'],_0x2462c4[_0x4f0e9e]));}Promise['all'](_0x5ed42a)[_0xe3ea('0x1e')](function(){_0x29e32e({'val':_0x2462c4[_0xe3ea('0x19')]});});}});}function splitAdditionalPhone(_0x4cda82,_0x3766eb){return new Promise(function(_0x44cafc,_0x594ba1){var _0xd023cc=_0x3766eb['split'](':');var _0x4e9ed1=_0xd023cc[0x0];var _0x3255ad=_0xd023cc[0x1];if(_0x3255ad!==''){var _0x99e84a=_0x3255ad['split']('|');var _0x197466=[];for(var _0x3491d7=0x0;_0x3491d7<_0x99e84a['length'];_0x3491d7++){if(_0x99e84a[_0x3491d7]!==''){var _0x522a3f=_['filter'](promisesAdditionalPhones,{'contactId':_0x4cda82,'phone':_0x99e84a[_0x3491d7]});if(_0x522a3f['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4cda82,'contactTypeId':_0x4e9ed1,'phone':_0x99e84a[_0x3491d7],'orderBy':orderBy});}}}_0x44cafc({'ok':0x1});}else _0x44cafc({'res':0x0});});}function createAdditionalPhone(_0x5f1eff,_0x3accb1,_0x3e7c9f,_0x42d889){var _0x26704f='';var _0x5395fa='';var _0x48a6a1=_0x3e7c9f[_0xe3ea('0x22')]('§');_0x26704f=_0x48a6a1[0x0];if(_0x48a6a1['length']==0x2)_0x5395fa=_0x48a6a1[0x1];return new Promise(function(_0x21c65d,_0x2b1c07){return db[_0xe3ea('0x23')]['findOne']({'where':{'CmContactId':_0x5f1eff,'item':_0x26704f}})['then'](function(_0x7b9638){if(_0x7b9638){return db[_0xe3ea('0x23')]['update']({'ItemTypeId':_0x3accb1,'description':_0x5395fa,'OrderBy':_0x42d889},{'where':{'CmContactId':_0x5f1eff,'item':_0x26704f}})[_0xe3ea('0x1e')](function(_0x11e012){_0x21c65d({'res':_0xe3ea('0x24')});});}else{return db['CmContactHasItem'][_0xe3ea('0x25')]({'CmContactId':_0x5f1eff,'item':_0x26704f,'ItemTypeId':_0x3accb1,'description':_0x5395fa,'OrderBy':_0x42d889,'ItemClass':_0xe3ea('0x26')})['then'](function(_0x1d77c5){_0x21c65d({'res':_0xe3ea('0x27')});});}});});}function updateContact(_0x47736a){return new Promise(function(_0x17e996,_0x21db7d){var _0x473d92=_0x47736a['id'];delete _0x47736a['id'];return db[_0xe3ea('0x28')][_0xe3ea('0x29')](_0x47736a,{'where':{'id':_0x473d92}})[_0xe3ea('0x1e')](function(_0x505208){updatedRows+=0x1;return db['CmHopper'][_0xe3ea('0x29')]({'phone':_0x47736a[_0xe3ea('0xf')]},{'where':{'ContactId':_0x473d92}})[_0xe3ea('0x1e')](function(_0x3d08f4){_0x17e996({'ret':'OK'});});});});}function insertCmHopper(_0x327168,_0xb14e14,_0x588595,_0x52df51,_0x3568fa){var _0x3cb983=[_0xe3ea('0x2a'),_0xe3ea('0x2b'),_0xe3ea('0x2c'),_0xe3ea('0x2d'),_0xb14e14+'.'+_0x52df51,_0xe3ea('0x2e'),_0xe3ea('0x2f'),_0xe3ea('0x30'),_0xe3ea('0x31'),'\x22'+_0x3568fa+'\x22'];return squel['insert']()[_0xe3ea('0x32')](_0xe3ea('0x33'))[_0xe3ea('0x34')](['phone','scheduledat','ContactId',_0xe3ea('0x35'),_0x52df51,_0xe3ea('0x36'),'updatedAt',_0xe3ea('0x37'),_0xe3ea('0x38'),_0xe3ea('0x39')],squel['select']()[_0xe3ea('0x3a')](_0x3cb983)[_0xe3ea('0x10')](_0xb14e14)[_0xe3ea('0x11')](_0xe3ea('0x3b'),null,'cm_contacts.ListId\x20=\x20'+_0xb14e14+_0xe3ea('0x3c'))[_0xe3ea('0x11')](_0x588595,null,_0x588595+_0xe3ea('0x12')+_0xb14e14+'.'+_0x52df51)['where'](_0xb14e14+_0xe3ea('0x3d'),_0x327168)[_0xe3ea('0x13')](_0xe3ea('0x3e'),NOW)[_0xe3ea('0x13')](_0xe3ea('0x3f'),selectNotIn(_0xb14e14,_0x588595,_0x52df51,_0xe3ea('0x33'),['\x22always\x22',_0xe3ea('0x40')]))['where'](_0xe3ea('0x3f'),selectNotIn(_0xb14e14,_0x588595,_0x52df51,_0xe3ea('0x33'),[_0xe3ea('0x41')])))['toString']();}function insertCmHopperBlack(_0xaeb6d9,_0x4eba6c,_0x14c1aa,_0x142057){var _0x14e405=['cm_contacts.phone','cm_contacts.id',_0xe3ea('0x2d'),_0x4eba6c+'.'+_0x142057,'cm_contacts.createdAt',_0xe3ea('0x2f')];return squel['insert']()[_0xe3ea('0x32')](_0xe3ea('0x42'))[_0xe3ea('0x34')]([_0xe3ea('0xf'),_0xe3ea('0x43'),_0xe3ea('0x35'),_0x142057,'createdAt',_0xe3ea('0x44')],squel[_0xe3ea('0x45')]()[_0xe3ea('0x3a')](_0x14e405)[_0xe3ea('0x10')](_0x4eba6c)[_0xe3ea('0x11')]('cm_contacts',null,_0xe3ea('0x46')+_0x4eba6c+_0xe3ea('0x3c'))[_0xe3ea('0x11')](_0x14c1aa,null,_0x14c1aa+_0xe3ea('0x12')+_0x4eba6c+'.'+_0x142057)[_0xe3ea('0x13')](_0x4eba6c+'.CmListId\x20=\x20?',_0xaeb6d9)[_0xe3ea('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe3ea('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xe3ea('0x45')]()[_0xe3ea('0x47')]('phone')['from'](_0xe3ea('0x42'))['where']('ListId\x20=\x20?',_0xaeb6d9)['where'](_0x142057+_0xe3ea('0x48'),_0x4eba6c+'.'+_0x142057)))[_0xe3ea('0x49')]();}function insertCmHopperAdditionalPhones(_0x3abc5b){var _0x4fb0ba=[_0xe3ea('0x4a'),_0xe3ea('0x4b'),_0xe3ea('0x4c'),'cm_contact_has_items.createdAt',_0xe3ea('0x4d')];return squel['insert']()[_0xe3ea('0x32')](_0xe3ea('0x4e'))[_0xe3ea('0x34')]([_0xe3ea('0x4f'),'phone',_0xe3ea('0x50'),_0xe3ea('0x36'),_0xe3ea('0x44')],squel[_0xe3ea('0x45')]()['fields'](_0x4fb0ba)[_0xe3ea('0x10')](_0xe3ea('0x33'))[_0xe3ea('0x11')](_0xe3ea('0x3b'),null,_0xe3ea('0x51'))['join'](_0xe3ea('0x52'),null,_0xe3ea('0x53'))[_0xe3ea('0x13')]('cm_hopper.ListId\x20=\x20?',_0x3abc5b)['where'](_0xe3ea('0x3e'),NOW))['toString']();}function insertCmContact(_0x237c74,_0x51ea9a,_0x5d7e71,_0xe2772d){var _0x17acb1=_['concat'](_[_0xe3ea('0x54')](_0xe2772d),[_0xe3ea('0x35'),_0xe3ea('0x55'),_0xe3ea('0x36'),_0xe3ea('0x44')]);return squel[_0xe3ea('0x56')]()[_0xe3ea('0x32')](_0xe3ea('0x3b'))[_0xe3ea('0x34')](_0x17acb1,squel[_0xe3ea('0x45')]()[_0xe3ea('0x3a')](_0x17acb1)[_0xe3ea('0x10')](_0x51ea9a)[_0xe3ea('0x13')]('('+_0x5d7e71[_0xe3ea('0x11')](',')+_0xe3ea('0x57'),squel[_0xe3ea('0x45')]()[_0xe3ea('0x3a')](_0x5d7e71)[_0xe3ea('0x10')]('cm_contacts')[_0xe3ea('0x13')]('ListId\x20=\x20?',_0x237c74))[_0xe3ea('0x13')](_0xe3ea('0x58'),squel[_0xe3ea('0x45')]()[_0xe3ea('0x47')](_0xe3ea('0x59'),'min_id')[_0xe3ea('0x10')](_0x51ea9a)[_0xe3ea('0x5a')](_0x5d7e71[_0xe3ea('0x11')](','))))[_0xe3ea('0x49')]();}function handleStop(){logger['info'](_0xe3ea('0x5b'));stopped=!![];}function handleUncaughtException(_0x5278f9){logger[_0xe3ea('0x20')](_0x5278f9['message']);process['exit'](0x1);}function handleError(_0xffbfa3,_0x13668e){stats[_0xe3ea('0x5c')]['push']({'name':_0x13668e[_0xe3ea('0x5d')],'message':_0x13668e[_0xe3ea('0x21')],'row':_0xffbfa3});}function handleQuery(_0x15276){logger[_0xe3ea('0x5e')](_0x15276);return db['sequelize'][_0xe3ea('0x17')](_0x15276)[_0xe3ea('0x18')](function(_0x4cc0bf){results['push'](_0x4cc0bf);})[_0xe3ea('0x1f')](function(_0x21ef96){logger[_0xe3ea('0x20')](_0x21ef96[_0xe3ea('0x21')]);});}function main(_0xcc3a95,_0x243ce2,_0x1a2936,_0x286866){logger[_0xe3ea('0x5e')](_0xe3ea('0x5f'),_0xcc3a95,JSON[_0xe3ea('0x60')](_0x243ce2));process[_0xe3ea('0x61')](_0xe3ea('0x62'));var _0x4ad4b7=_0x243ce2[_0xe3ea('0x63')];var _0x461f5a=_[_0xe3ea('0x64')](_0x4ad4b7);var _0x5eeb43=_0x243ce2['socket_timestamp'];var _0x574329=path[_0xe3ea('0x11')](config['root'],_0xe3ea('0x65'),_0x5eeb43+_0xe3ea('0x66'));logger['info'](_0xe3ea('0x67'),_0x243ce2);db['ContactItemType'][_0xe3ea('0x68')]({'raw':!![],'attributes':['id','name']})[_0xe3ea('0x1e')](function(_0x5bb6f1){for(var _0x4d390a=0x0;_0x4d390a<_0x5bb6f1[_0xe3ea('0x19')];_0x4d390a++){if(_0x5bb6f1[_0x4d390a][_0xe3ea('0x69')]in _0x4ad4b7){contactItemTypes[_0xe3ea('0x1c')](_0x5bb6f1[_0x4d390a]);delete _0x461f5a[_0x5bb6f1[_0x4d390a][_0xe3ea('0x69')]];hasAdditionalPhones=!![];}for(var _0x1b044a in _0x4ad4b7){if(_0x5bb6f1[_0x4d390a][_0xe3ea('0x69')]+_0xe3ea('0x6a')===_0x1b044a){phoneDescriptions[_0xe3ea('0x1c')]({'itemTypeId':_0x5bb6f1[_0x4d390a]['id'],'description':_0x1b044a});delete _0x461f5a[_0x1b044a];}}}if(hasAdditionalPhones)_0x461f5a[_0xe3ea('0x1b')]='';var _0x16800a=_[_0xe3ea('0x54')](_0x461f5a)[_0xe3ea('0x11')]();logger[_0xe3ea('0x5e')](_0xe3ea('0x6b'),_0x16800a);fs[_0xe3ea('0x6c')](_0x574329,_0x16800a+'\x0a');Papa[_0xe3ea('0x6d')](fs[_0xe3ea('0x6e')](_0xcc3a95),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2612e8,_0x26ee66){try{for(var _0x4d6179=0x0,_0x3efc1f=[];_0x4d6179<_0x2612e8[_0xe3ea('0x6f')][_0xe3ea('0x19')];_0x4d6179++){stats['rows']+=0x1;if(_0x2612e8[_0xe3ea('0x5c')][_0x4d6179]){handleError(_0x2612e8[_0xe3ea('0x6f')][_0x4d6179],_0x2612e8[_0xe3ea('0x5c')][_0x4d6179]);}else{var _0x333d39=[];var _0x180eb7=[];var _0x84cd14={};for(var _0x272f9a in _0x4ad4b7){let _0x50bae2=contactItemTypes[_0xe3ea('0x70')](_0x4056e9=>_0x4056e9['name']===_0x272f9a);let _0x2e4ba7=contactItemTypes['find'](_0x18ac19=>_0x18ac19[_0xe3ea('0x69')]+_0xe3ea('0x6a')===_0x272f9a);if(_[_0xe3ea('0x1a')](_0x50bae2)&&_[_0xe3ea('0x1a')](_0x2e4ba7)){if(_0x4ad4b7[_0xe3ea('0x71')](_0x272f9a)){if(_0x2612e8['data'][_0x4d6179][_0x4ad4b7[_0x272f9a]]){var _0x3bf10b=_['trim'](_0x2612e8[_0xe3ea('0x6f')][_0x4d6179][_0x4ad4b7[_0x272f9a]]['replace'](/"/g,'\x27'));switch(_0x272f9a){case'scheduledat':var _0xf8f656=moment(_0x3bf10b,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xf8f656['isValid']()){_0x3efc1f[_0xe3ea('0x1c')]('\x22'+_0x3bf10b+'\x22');}else{_0x333d39['push'](_0xe3ea('0x72'));}break;case'priority':var _0x576c79=parseInt(_0x3bf10b);_0x3bf10b=_[_0xe3ea('0x73')](_0x576c79)||_0x576c79<0x0||_0x576c79>0x4?_0x286866?0x3:0x2:_0x576c79;_0x3efc1f[_0xe3ea('0x1c')]('\x22'+_0x3bf10b+'\x22');break;case _0xe3ea('0x38'):var _0x46a650=parseInt(_0x3bf10b);if(_['isNumber'](_0x46a650)&&_[_0xe3ea('0x74')](_0x1a2936,_0x46a650)){_0x3efc1f[_0xe3ea('0x1c')]('\x22'+_0x46a650+'\x22');}else{_0x333d39['push'](_0xe3ea('0x75'));}break;case _0xe3ea('0x76'):if(isEmail(_0x3bf10b)){_0x3efc1f[_0xe3ea('0x1c')]('\x22'+_0x3bf10b+'\x22');}else{_0x333d39['push'](_0xe3ea('0x77'));}break;case _0xe3ea('0x78'):var _0xa48103=moment(_0x3bf10b,'YYYY-MM-DD',!![]);if(_0xa48103[_0xe3ea('0x79')]()){_0x3efc1f[_0xe3ea('0x1c')]('\x22'+_0x3bf10b+'\x22');}else{_0x333d39[_0xe3ea('0x1c')](_0xe3ea('0x7a'));}break;default:_0x3efc1f['push']('\x22'+_0x3bf10b+'\x22');}}else{switch(_0x272f9a){case _0xe3ea('0x7b'):case _0xe3ea('0xf'):_0x333d39[_0xe3ea('0x1c')](_0x272f9a+_0xe3ea('0x7c'));break;default:_0x3efc1f['push']('\x22\x22');}}}}else{var _0x5c153a='';if(!_[_0xe3ea('0x1a')](_0x50bae2)){if(!_0x84cd14[_0xe3ea('0x71')](_0x50bae2['id'])){for(var _0x153846=0x0;_0x153846<_0x4ad4b7[_0x272f9a][_0xe3ea('0x19')];_0x153846++){var _0x3bf10b=_[_0xe3ea('0x7d')](_0x2612e8[_0xe3ea('0x6f')][_0x4d6179][_0x4ad4b7[_0x272f9a][_0x153846]][_0xe3ea('0x7e')](/"/g,'\x27'));var _0x39684d=phoneDescriptions[_0xe3ea('0x70')](_0x577d0c=>_0x577d0c['itemTypeId']===_0x50bae2['id']);if(!_[_0xe3ea('0x1a')](_0x39684d)){var _0x4b84c2=_[_0xe3ea('0x7d')](_0x2612e8[_0xe3ea('0x6f')][_0x4d6179][_0x4ad4b7[_0x39684d[_0xe3ea('0x7f')]][0x0]][_0xe3ea('0x7e')](/"/g,'\x27'));if(!_[_0xe3ea('0x1a')](_0x4b84c2))_0x3bf10b=_0x3bf10b+'§'+_0x4b84c2;}if(_0x5c153a=='')_0x5c153a=_0x3bf10b;else _0x5c153a+='|'+_0x3bf10b;}_0x180eb7[_0xe3ea('0x1c')](_0x50bae2['id']+':'+_0x5c153a);_0x84cd14[_0x50bae2['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3efc1f[_0xe3ea('0x1c')]('\x22'+_0x180eb7[_0xe3ea('0x11')](';')+'\x22');}if(_0x333d39[_0xe3ea('0x19')]){handleError(_0x2612e8[_0xe3ea('0x6f')][_0x4d6179],{'code':_0xe3ea('0x80'),'message':_0x333d39[_0xe3ea('0x11')]()});}else{fs[_0xe3ea('0x81')](_0x574329,_0x3efc1f[_0xe3ea('0x11')]()+'\x0a');}_0x3efc1f=[];}if(!(stats['rows']%0xc8)){socket[_0xe3ea('0x82')](_0xe3ea('0x83')+_0x5eeb43,stats);stats['errors']=[];}}if(stopped){logger[_0xe3ea('0x5e')]('Abort\x20parser');_0x26ee66[_0xe3ea('0x84')]();}}catch(_0x4e9f65){handleError(_0x2612e8['data'][_0x4d6179],{'code':_0xe3ea('0x85'),'message':_0x4e9f65[_0xe3ea('0x21')]});logger['error']('step',_0x4e9f65[_0xe3ea('0x21')]);}},'complete':function(){try{var _0x34f9a7=[];var _0x45ab31=tempTableName;_0x34f9a7['push'](_0xe3ea('0x86')+_0x45ab31+_0xe3ea('0x87'));logger['info']('CIS\x20len',contactItemTypes[_0xe3ea('0x19')]);var _0x23debc=util[_0xe3ea('0xa')](_0xe3ea('0x88'),_0x574329,_0x45ab31,_0x16800a,_0x243ce2[_0xe3ea('0x35')],_0x243ce2[_0xe3ea('0x55')]||null,NOW,NOW);if(_[_0xe3ea('0x1a')](_0x4ad4b7[_0xe3ea('0x89')])){_0x23debc+=',\x20scheduledAt\x20=\x20NOW()';}_0x34f9a7[_0xe3ea('0x1c')](_0x23debc);BPromise[_0xe3ea('0x8a')](_0x34f9a7,handleQuery)[_0xe3ea('0x1e')](function(_0x56e21a){BPromise['all']([handleAdditionalPhones()])[_0xe3ea('0x1e')](function(){_0x34f9a7=[];for(var _0x49d2b9=0x0;_0x49d2b9\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','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','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','lodash','../parsers/advancedSearch','./update-interaction','./utils','getAccountFK','role','agent','select','field','color','from','tools_tags','getInteractionFK','user_has_','u.id','u.fullname','ui.','left_join','users','length','map','getInteractionsTables','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.','messages','interactionsTags','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','mail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','buildExpression','type','default','text','start','value','end','unreadMessages','read','Contact','operator','$substring','split','contact','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','clause','and','tags','ids','User','UserId','plainBody','body','some','compact','\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','then','fields','tag','filter','get','capitalize','Websites','search','\x20IS\x20NOT\x20NULL','i.secondDisposition','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction'];(function(_0x3e7627,_0x123b27){var _0x5be59b=function(_0x172575){while(--_0x172575){_0x3e7627['push'](_0x3e7627['shift']());}};_0x5be59b(++_0x123b27);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x458a20,_0x206f85){_0x458a20=_0x458a20-0x0;var _0x3cce8a=_0xc6d8[_0x458a20];return _0x3cce8a;};'use strict';var _=require(_0x8c6d('0x0'));var squel=require('squel');var as=require(_0x8c6d('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x8c6d('0x2'))['updateInteraction'];var utils=require(_0x8c6d('0x3'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x5b6b04,_0x352b8c,_0xdff6f){var _0x17781d=![];var _0x4f5e8f=utils[_0x8c6d('0x4')](_0x5b6b04);if(_0x352b8c[_0x8c6d('0x5')]===_0x8c6d('0x6')&&!_0xdff6f['search']&&!_0xdff6f[_0x4f5e8f]){_0x17781d=!![];}return _0x17781d;}function getTagsQuery(){return squel[_0x8c6d('0x7')]()[_0x8c6d('0x8')]('id')[_0x8c6d('0x8')]('name')[_0x8c6d('0x8')](_0x8c6d('0x9'))[_0x8c6d('0xa')](_0x8c6d('0xb'));}function getUsersQuery(_0x426a82,_0x43a7ab){var _0x60cd5c=utils[_0x8c6d('0xc')](_0x426a82);var _0x50af75=_0x8c6d('0xd')+_0x426a82+'_interactions';var _0x4c0878=squel[_0x8c6d('0x7')]()[_0x8c6d('0x8')](_0x8c6d('0xe'))[_0x8c6d('0x8')](_0x8c6d('0xf'))[_0x8c6d('0x8')](_0x8c6d('0x10')+_0x60cd5c)[_0x8c6d('0xa')](_0x50af75,'ui')[_0x8c6d('0x11')](_0x8c6d('0x12'),'u','u.id\x20=\x20ui.UserId');if(_0x43a7ab[_0x8c6d('0x13')]>0x0){_0x4c0878['where'](_0x8c6d('0x10')+_0x60cd5c+'\x20IN\x20?',_[_0x8c6d('0x14')](_0x43a7ab,'id'));}return _0x4c0878;}function getInteractionsQuery(_0x3d95a6){var _0x52ed7b=utils[_0x8c6d('0x15')](_0x3d95a6);var _0x2b8a26=utils['getAccountFK'](_0x3d95a6);var _0x3e5495=utils['getInteractionFK'](_0x3d95a6);return squel['select']()[_0x8c6d('0xa')](_0x52ed7b['interactions'],'i')[_0x8c6d('0x11')](_0x8c6d('0x16'),'c',_0x8c6d('0x17'))[_0x8c6d('0x11')](_0x8c6d('0x12'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x52ed7b['accounts'],'a',_0x8c6d('0x18')+_0x2b8a26)['left_join'](_0x52ed7b[_0x8c6d('0x19')],'me','me.'+_0x3e5495+'\x20=\x20i.id')[_0x8c6d('0x11')](_0x52ed7b[_0x8c6d('0x1a')],'it','it.'+_0x3e5495+'\x20=\x20i.id')['left_join']('tools_tags','t',_0x8c6d('0x1b'));}function getSqlClauses(){var _0xd16c91={'body':squel[_0x8c6d('0x1c')](),'contact':squel['expr'](),'default':squel[_0x8c6d('0x1c')](),'fields':squel['expr'](),'filter':squel[_0x8c6d('0x1c')](),'read':squel['expr'](),'tags':{'clause':squel[_0x8c6d('0x1c')](),'ids':null},'user':squel[_0x8c6d('0x1c')]()};return _0xd16c91;}function parseTagParameter(_0x353ba5){var _0x2b6d18=squel[_0x8c6d('0x1c')]();if(_0x353ba5){var _0x3e3cd3=utils[_0x8c6d('0x1d')](_0x353ba5);_0x3e3cd3[_0x8c6d('0x1e')](function(_0x3eab38){_0x2b6d18['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3eab38+',%');});}return _0x2b6d18;}function parseReadParameter(_0x544143){var _0x342d8e='';if(_0x544143){_0x342d8e=_0x8c6d('0x1f');if(_0x544143==='1'){_0x342d8e=_0x342d8e[_0x8c6d('0x20')](_0x8c6d('0x21'),'=');}else{_0x342d8e=_0x342d8e[_0x8c6d('0x20')](_0x8c6d('0x21'),'>');}}return _0x342d8e;}function parseSearchFilter(_0x2bc94a,_0x2d028f){var _0x407234=squel[_0x8c6d('0x1c')]();if(_0x2d028f){var _0x3375dd=_0x2d028f[_0x8c6d('0x20')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8c6d('0x22')](_0x3375dd)){_0x407234['or'](_0x8c6d('0x23'),_0x3375dd+'%');if([_0x8c6d('0x24'),_0x8c6d('0x25')][_0x8c6d('0x26')](_0x2bc94a)){_0x407234['or'](_0x8c6d('0x27'),_0x3375dd+'%');}else if(_0x2bc94a===_0x8c6d('0x28')){_0x407234['or'](_0x8c6d('0x29'),_0x3375dd+'%');}else if(_0x2bc94a===_0x8c6d('0x2a')){_0x407234['or']('i.from\x20LIKE\x20?',_0x3375dd+'%');}}else if(_0x2bc94a===_0x8c6d('0x2b')&&qs['isEmail'](_0x3375dd)){_0x407234['or'](_0x8c6d('0x2c'),_0x3375dd+'%');}else{if(_0x2bc94a===_0x8c6d('0x2b')){_0x407234['or'](_0x8c6d('0x2d'),qs[_0x8c6d('0x2e')](_0x3375dd))['or'](_0x8c6d('0x2f'),qs[_0x8c6d('0x2e')](_0x3375dd));}else{if(_0x2bc94a!=='fax'){_0x407234['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8c6d('0x2e')](_0x3375dd));}_0x407234['or'](_0x8c6d('0x30'),_0x3375dd+'%');}}}return _0x407234;}function parseAdvancedSearchFilter(_0x3df42f,_0x8b4562){var _0x5638f4=getSqlClauses();var _0x2818fa=as[_0x8c6d('0x31')](_0x3df42f);var _0xdc33f5=_0x2818fa[_0x8c6d('0x32')];for(var _0x42a92e=0x0;_0x42a92e<_0x2818fa[_0x8c6d('0x33')]['length'];_0x42a92e++){var _0x3c16d3=_0x2818fa[_0x8c6d('0x33')][_0x42a92e];var _0x1349be='i';var _0x2ef932=_[_0x8c6d('0x34')](_0x8b4562,[_0x8c6d('0x35'),_0x3c16d3[_0x8c6d('0x8')]]);if(_0x2ef932){var _0x301332=as[_0x8c6d('0x36')](_0x1349be,_0x2ef932[_0x8c6d('0x37')],_0x3c16d3);_0x5638f4[_0x8c6d('0x38')][_0xdc33f5](_0x301332[_0x8c6d('0x39')],_0x301332['value'][_0x8c6d('0x3a')],_0x301332[_0x8c6d('0x3b')][_0x8c6d('0x3c')]);}else{switch(_0x3c16d3[_0x8c6d('0x8')]){case _0x8c6d('0x3d'):var _0x4e7cb7=parseReadParameter(_0x3c16d3[_0x8c6d('0x3b')]);_0x5638f4[_0x8c6d('0x3e')]['and'](_0x4e7cb7);break;case _0x8c6d('0x3f'):if(_0x3c16d3[_0x8c6d('0x40')]===_0x8c6d('0x41')){if(_0x3c16d3['value'][_0x8c6d('0x42')]('\x20')[_0x8c6d('0x13')]>0x1){_0x5638f4[_0x8c6d('0x43')][_0xdc33f5](_0x8c6d('0x44'),qs[_0x8c6d('0x2e')](_0x3c16d3[_0x8c6d('0x3b')]),null);}else{var _0x305910='%'+_0x3c16d3[_0x8c6d('0x3b')]+'%';_0x5638f4[_0x8c6d('0x43')][_0xdc33f5](_0x8c6d('0x45'),_0x305910,_0x305910,_0x305910);}}else{_0x2ef932=_[_0x8c6d('0x34')](_0x8b4562,['name','ContactId']);_0x3c16d3['field']=_0x8c6d('0x46');_0x301332=as[_0x8c6d('0x36')](_0x1349be,_0x2ef932[_0x8c6d('0x37')],_0x3c16d3);_0x5638f4[_0x8c6d('0x43')][_0xdc33f5](_0x301332[_0x8c6d('0x39')],_0x301332['value'][_0x8c6d('0x3a')],_0x301332[_0x8c6d('0x3b')][_0x8c6d('0x3c')]);}break;case'Tag':var _0xf8d466=_0x3c16d3[_0x8c6d('0x3b')]['split'](',')['map'](function(_0x4bd626){return Number(_0x4bd626);});var _0x5d598d=parseTagParameter(_0xf8d466);_0x5638f4['tags'][_0x8c6d('0x47')][_0x8c6d('0x48')](_0x5d598d);_0x5638f4[_0x8c6d('0x49')][_0x8c6d('0x4a')]=_0xf8d466;break;case _0x8c6d('0x4b'):if(_0x3c16d3['operator']==='$substring'){_0x5638f4['user'][_0xdc33f5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3c16d3[_0x8c6d('0x3b')]+'%',null);}else{_0x2ef932=_['find'](_0x8b4562,[_0x8c6d('0x35'),_0x8c6d('0x4c')]);_0x3c16d3[_0x8c6d('0x8')]=_0x8c6d('0x4c');_0x301332=as[_0x8c6d('0x36')](_0x1349be,_0x2ef932[_0x8c6d('0x37')],_0x3c16d3);_0x5638f4['user'][_0xdc33f5](_0x301332[_0x8c6d('0x39')],_0x301332[_0x8c6d('0x3b')]['start'],_0x301332[_0x8c6d('0x3b')][_0x8c6d('0x3c')]);}break;case'body':case _0x8c6d('0x4d'):_0x301332=as[_0x8c6d('0x36')]('me',null,_0x3c16d3);_0x5638f4[_0x8c6d('0x4e')][_0xdc33f5](_0x301332[_0x8c6d('0x39')],_0x301332[_0x8c6d('0x3b')][_0x8c6d('0x3a')],_0x301332[_0x8c6d('0x3b')][_0x8c6d('0x3c')]);break;}}}return _0x5638f4;}function parseModelFields(_0x1f1609,_0x1d6c29,_0x361956){var _0x23792d=utils[_0x8c6d('0x4')](_0x1f1609);var _0x10bfad=squel[_0x8c6d('0x1c')]();var _0x337e37=_(_0x1d6c29)['keys']()['map'](function(_0x5be031){return _[_0x8c6d('0x4f')](_0x361956,[_0x8c6d('0x35'),_0x5be031])?_0x5be031:undefined;})[_0x8c6d('0x50')]()[_0x8c6d('0x3b')]();if(_0x337e37['length']>0x0){_0x337e37[_0x8c6d('0x1e')](function(_0x5972db){if(_0x5972db===_0x23792d){_0x10bfad[_0x8c6d('0x48')]('i.'+_0x23792d+_0x8c6d('0x51'),[][_0x8c6d('0x52')](_0x1d6c29[_0x5972db]));}else if(_0x5972db==='createdAt'){var _0xc4e1a0=JSON['parse'](_0x1d6c29[_0x5972db])[_0x8c6d('0x53')];var _0x4c4ad1=JSON[_0x8c6d('0x54')](_0x1d6c29[_0x5972db])[_0x8c6d('0x55')];_0x10bfad[_0x8c6d('0x48')](_0x8c6d('0x56'),_0xc4e1a0,_0x4c4ad1);}else{if(_0x1d6c29[_0x5972db]==='null'){_0x10bfad[_0x8c6d('0x48')]('i.'+_0x5972db+_0x8c6d('0x57'));}else{_0x10bfad[_0x8c6d('0x48')]('i.'+_0x5972db+_0x8c6d('0x58'),_0x1d6c29[_0x5972db]);}}});}return _0x10bfad;}function parseQueryParameters(_0x309396,_0x219a8b,_0x159d36){var _0x11a87b=getSqlClauses();return Promise['resolve']()[_0x8c6d('0x59')](function(){return parseModelFields(_0x309396,_0x219a8b,_0x159d36);})[_0x8c6d('0x59')](function(_0x82aab){_0x11a87b[_0x8c6d('0x5a')]['and'](_0x82aab);return parseReadParameter(_0x219a8b[_0x8c6d('0x3e')]);})['then'](function(_0x5c8550){_0x11a87b[_0x8c6d('0x3e')][_0x8c6d('0x48')](_0x5c8550);return parseTagParameter(_0x219a8b[_0x8c6d('0x5b')]);})[_0x8c6d('0x59')](function(_0xbbd13c){_0x11a87b[_0x8c6d('0x49')][_0x8c6d('0x47')]['and'](_0xbbd13c);return parseSearchFilter(_0x309396,_0x219a8b[_0x8c6d('0x5c')]);})[_0x8c6d('0x59')](function(_0x3af565){_0x11a87b['filter']=_0x3af565;return _0x11a87b;});}function checkAccountsRestrictions(_0x445d56,_0x2b9717,_0x30e32f){var _0x26bb3c=utils[_0x8c6d('0x4')](_0x445d56);var _0x53a333=_0x8c6d('0x5d')+_[_0x8c6d('0x5e')](_0x445d56)+(_0x445d56==='chat'?_0x8c6d('0x5f'):'Accounts');var _0x3d7071=squel['expr']();return Promise['resolve']()[_0x8c6d('0x59')](function(){if(_0x30e32f[_0x8c6d('0x60')]&&_0x2b9717[_0x8c6d('0x5')]===_0x8c6d('0x6')){return _0x2b9717[_0x53a333]({'attributes':['id'],'raw':!![]});}})[_0x8c6d('0x59')](function(_0x3090a9){if(_0x3090a9){if(_0x3090a9[_0x8c6d('0x13')]===0x0){_0x3d7071[_0x8c6d('0x48')]('i.'+_0x26bb3c+_0x8c6d('0x57'));}else{_0x3d7071[_0x8c6d('0x48')]('i.'+_0x26bb3c+_0x8c6d('0x51'),_['map'](_0x3090a9,'id'));}}else if(!_0x30e32f[_0x26bb3c]){_0x3d7071[_0x8c6d('0x48')]('i.'+_0x26bb3c+_0x8c6d('0x61'));}})[_0x8c6d('0x59')](function(){return _0x3d7071;});}function getClosedOrderClause(_0x4c7e3a,_0x334b8e){var _0x1695b3='';var _0x19d781=['i.thirdDisposition',_0x8c6d('0x62'),'i.disposition'];if(_0x4c7e3a===_0x8c6d('0x2b')){_0x19d781['unshift']('i.substatus');}if(_0x334b8e[_0x8c6d('0x63')]==='0'&&_0x4c7e3a===_0x8c6d('0x2b')){_0x1695b3='i.substatus';}else{if(_0x334b8e['closed']==='1'){_0x19d781['shift']();}_0x1695b3=_0x8c6d('0x64')+_0x19d781[_0x8c6d('0x65')](',\x20')+')';}return _0x1695b3;}function getFilteredInteractions(_0x2d9750,_0x194ffc,_0x5e44d7,_0x5d48b8){var _0x3d6804=utils[_0x8c6d('0xc')](_0x2d9750);var _0x276e89=_[_0x8c6d('0x5e')](_0x2d9750)+_0x8c6d('0x66');var _0x455a6d=[];var _0x2d3dd3=getTagsQuery();var _0x3c6a3c={'type':db['Sequelize'][_0x8c6d('0x67')][_0x8c6d('0x68')],'raw':!![]};var _0x1d7be0=[];var _0x361c40=[];return db['sequelize'][_0x8c6d('0x69')](_0x2d3dd3[_0x8c6d('0x6a')](),_0x3c6a3c)['then'](function(_0x2608ac){_0x455a6d=_[_0x8c6d('0x6b')](_0x2608ac,'id');_0x3c6a3c=_[_0x8c6d('0x6c')](_0x3c6a3c,{'model':db[_0x276e89],'mapToModel':!![],'nest':!![]});if(_0x5e44d7['fields']){_0x5d48b8[_0x8c6d('0x6d')][_0x8c6d('0x1e')](function(_0x4861ec){_0x194ffc[_0x8c6d('0x8')]('i.'+_0x4861ec);});}else{_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x6e'),_0x8c6d('0x3d'));_0x194ffc[_0x8c6d('0x8')]('a.key','Account.key');_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x6f'),_0x8c6d('0x70'));if(_0x2d9750===_0x8c6d('0x2b')){_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x71'),_0x8c6d('0x72'));_0x194ffc['field'](_0x8c6d('0x73'),_0x8c6d('0x74'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x75'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x76'));_0x194ffc[_0x8c6d('0x8')]('i.updatedAt');_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x77'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x78'));_0x194ffc['field'](_0x8c6d('0x79'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x7a'));_0x194ffc[_0x8c6d('0x8')]('i.lastMsgDirection');_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x7b'));_0x194ffc['field'](_0x8c6d('0x7c'));_0x194ffc[_0x8c6d('0x8')]('i.secondDisposition');_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x7d'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x7e'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x7f'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x80'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x81'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x82'));}else if(_0x2d9750===_0x8c6d('0x2a')){_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x83'),_0x8c6d('0x74'));}else{_0x194ffc[_0x8c6d('0x8')]('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',_0x8c6d('0x74'));}if(_0x2d9750!==_0x8c6d('0x2b')){_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x84'));}_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x85'),_0x8c6d('0x86'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x87'),_0x8c6d('0x88'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x89'),_0x8c6d('0x8a'));_0x194ffc['field'](_0x8c6d('0x8b'),_0x8c6d('0x8c'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x8d'),'Contact.mobile');_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x8e'),_0x8c6d('0x8f'));_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x90'),'Owner.fullname');_0x194ffc[_0x8c6d('0x8')](_0x8c6d('0x91'),'Owner.internal');_0x194ffc['field'](_0x8c6d('0x92'),_0x8c6d('0x93'));}if(_0x5d48b8[_0x8c6d('0x94')]){_0x194ffc[_0x8c6d('0x94')](_0x5d48b8[_0x8c6d('0x94')]);}if(_0x5d48b8[_0x8c6d('0x95')]){_0x194ffc[_0x8c6d('0x95')](_0x5d48b8[_0x8c6d('0x95')]);}return db[_0x8c6d('0x96')][_0x8c6d('0x69')](_0x194ffc[_0x8c6d('0x6a')](),_0x3c6a3c);})['then'](function(_0x5589ff){_0x1d7be0=_0x5589ff;var _0x59b5f8=getUsersQuery(_0x2d9750,_0x1d7be0);return db[_0x8c6d('0x96')][_0x8c6d('0x69')](_0x59b5f8['toString'](),_0x3c6a3c);})[_0x8c6d('0x59')](function(_0x55e00e){_0x361c40=_[_0x8c6d('0x97')](_0x55e00e,_0x3d6804);if(_0x2d9750===_0x8c6d('0x2b')){return db[_0x8c6d('0x98')][_0x8c6d('0x99')]({'attributes':[_0x8c6d('0x9a')],'raw':!![]});}})[_0x8c6d('0x59')](function(_0xc233cb){var _0x5d7717=_0xc233cb?_0xc233cb['enableEmailPreview']:undefined;var _0xc683a3=_0x1d7be0[_0x8c6d('0x14')](function(_0x255b97){return updateInteraction(_0x255b97,_0x455a6d,_0x361c40,_0x5d7717);});return Promise[_0x8c6d('0x9b')](_0xc683a3);});}function countFilteredInteractions(_0x299507,_0x2b9d6b){var _0x2929b5=_0x299507[_0x8c6d('0x9c')]();_0x2929b5[_0x8c6d('0x8')](_0x8c6d('0x9d'));_0x2929b5['field'](_0x8c6d('0x6e'),_0x8c6d('0x3d'));var _0x281ee5=utils[_0x8c6d('0x1d')](_0x2b9d6b);if(!_[_0x8c6d('0x9e')](_0x281ee5)){_0x2929b5['where']('t.id\x20IN\x20?',_0x281ee5);}var _0x39b47c={'type':db['Sequelize']['QueryTypes'][_0x8c6d('0x68')],'raw':!![]};return db[_0x8c6d('0x96')][_0x8c6d('0x69')](_0x2929b5[_0x8c6d('0x6a')](),_0x39b47c);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xa588=['unshift','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Sequelize','QueryTypes','SELECT','sequelize','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.MailAccountId','i.UserId','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','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','unreadMessages','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','u.id','u.fullname','left_join','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','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)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','conditions','find','buildExpression','type','text','value','start','end','read','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','Tag','clause','and','tags','ids','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','then','fields','tag','filter','get','capitalize','Websites','resolve','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa588,0xe1));var _0x8a58=function(_0x3b0866,_0x454edd){_0x3b0866=_0x3b0866-0x0;var _0x323008=_0xa588[_0x3b0866];return _0x323008;};'use strict';var _=require('lodash');var squel=require(_0x8a58('0x0'));var as=require(_0x8a58('0x1'));var qs=require(_0x8a58('0x2'));var updateInteraction=require(_0x8a58('0x3'))[_0x8a58('0x4')];var utils=require(_0x8a58('0x5'));var db=require(_0x8a58('0x6'))['db'];function skipInteractionsQuery(_0x88d792,_0x40b4f0,_0x499c17){var _0x30f66b=![];var _0x408a4a=utils[_0x8a58('0x7')](_0x88d792);if(_0x40b4f0[_0x8a58('0x8')]===_0x8a58('0x9')&&!_0x499c17[_0x8a58('0xa')]&&!_0x499c17[_0x408a4a]){_0x30f66b=!![];}return _0x30f66b;}function getTagsQuery(){return squel[_0x8a58('0xb')]()[_0x8a58('0xc')]('id')['field'](_0x8a58('0xd'))[_0x8a58('0xc')](_0x8a58('0xe'))[_0x8a58('0xf')](_0x8a58('0x10'));}function getUsersQuery(_0x4eab6a,_0x2efcb2){var _0x469d66=utils[_0x8a58('0x11')](_0x4eab6a);var _0x290c17='user_has_'+_0x4eab6a+'_interactions';var _0x256bbd=squel['select']()[_0x8a58('0xc')](_0x8a58('0x12'))['field'](_0x8a58('0x13'))[_0x8a58('0xc')]('ui.'+_0x469d66)[_0x8a58('0xf')](_0x290c17,'ui')[_0x8a58('0x14')]('users','u',_0x8a58('0x15'));if(_0x2efcb2[_0x8a58('0x16')]>0x0){_0x256bbd[_0x8a58('0x17')](_0x8a58('0x18')+_0x469d66+_0x8a58('0x19'),_[_0x8a58('0x1a')](_0x2efcb2,'id'));}return _0x256bbd;}function getInteractionsQuery(_0xddfaae){var _0x49ee0e=utils['getInteractionsTables'](_0xddfaae);var _0x31de8d=utils[_0x8a58('0x7')](_0xddfaae);var _0x18a14d=utils['getInteractionFK'](_0xddfaae);return squel[_0x8a58('0xb')]()[_0x8a58('0xf')](_0x49ee0e['interactions'],'i')[_0x8a58('0x14')](_0x8a58('0x1b'),'c',_0x8a58('0x1c'))[_0x8a58('0x14')](_0x8a58('0x1d'),'o',_0x8a58('0x1e'))[_0x8a58('0x14')](_0x49ee0e[_0x8a58('0x1f')],'a',_0x8a58('0x20')+_0x31de8d)[_0x8a58('0x14')](_0x49ee0e[_0x8a58('0x21')],'me',_0x8a58('0x22')+_0x18a14d+_0x8a58('0x23'))[_0x8a58('0x14')](_0x49ee0e['interactionsTags'],'it',_0x8a58('0x24')+_0x18a14d+_0x8a58('0x23'))[_0x8a58('0x14')](_0x8a58('0x10'),'t',_0x8a58('0x25'));}function getSqlClauses(){var _0x415946={'body':squel[_0x8a58('0x26')](),'contact':squel['expr'](),'default':squel[_0x8a58('0x26')](),'fields':squel[_0x8a58('0x26')](),'filter':squel[_0x8a58('0x26')](),'read':squel[_0x8a58('0x26')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x8a58('0x26')]()};return _0x415946;}function parseTagParameter(_0x6b5cbf){var _0x231dae=squel['expr']();if(_0x6b5cbf){var _0x96fc89=utils[_0x8a58('0x27')](_0x6b5cbf);_0x96fc89[_0x8a58('0x28')](function(_0x27d7c8){_0x231dae['or'](_0x8a58('0x29'),'%,'+_0x27d7c8+',%');});}return _0x231dae;}function parseReadParameter(_0x3e317f){var _0x1a411a='';if(_0x3e317f){_0x1a411a='unreadMessages\x20{OPERATOR}\x200';if(_0x3e317f==='1'){_0x1a411a=_0x1a411a[_0x8a58('0x2a')]('{OPERATOR}','=');}else{_0x1a411a=_0x1a411a['replace']('{OPERATOR}','>');}}return _0x1a411a;}function parseSearchFilter(_0x4cfc96,_0x5a9c53){var _0x2f367f=squel[_0x8a58('0x26')]();if(_0x5a9c53){var _0x1b2d9e=_0x5a9c53[_0x8a58('0x2a')]('\x5c','\x5c\x5c')[_0x8a58('0x2a')](/'/g,'\x27\x27');if(qs[_0x8a58('0x2b')](_0x1b2d9e)){_0x2f367f['or'](_0x8a58('0x2c'),_0x1b2d9e+'%');if([_0x8a58('0x2d'),_0x8a58('0x2e')][_0x8a58('0x2f')](_0x4cfc96)){_0x2f367f['or'](_0x8a58('0x30'),_0x1b2d9e+'%');}else if(_0x4cfc96===_0x8a58('0x31')){_0x2f367f['or'](_0x8a58('0x32'),_0x1b2d9e+'%');}else if(_0x4cfc96==='openchannel'){_0x2f367f['or'](_0x8a58('0x33'),_0x1b2d9e+'%');}}else if(_0x4cfc96===_0x8a58('0x34')&&qs[_0x8a58('0x35')](_0x1b2d9e)){_0x2f367f['or'](_0x8a58('0x36'),_0x1b2d9e+'%');}else{if(_0x4cfc96===_0x8a58('0x34')){_0x2f367f['or'](_0x8a58('0x37'),qs['getFullTextValue'](_0x1b2d9e))['or'](_0x8a58('0x38'),qs[_0x8a58('0x39')](_0x1b2d9e));}else{if(_0x4cfc96!==_0x8a58('0x31')){_0x2f367f['or'](_0x8a58('0x3a'),qs[_0x8a58('0x39')](_0x1b2d9e));}_0x2f367f['or'](_0x8a58('0x3b'),_0x1b2d9e+'%');}}}return _0x2f367f;}function parseAdvancedSearchFilter(_0x2505ae,_0x547b51){var _0x3d1fb0=getSqlClauses();var _0x1692ef=as[_0x8a58('0x3c')](_0x2505ae);var _0x496295=_0x1692ef['sqlOperator'];for(var _0x5b634e=0x0;_0x5b634e<_0x1692ef[_0x8a58('0x3d')][_0x8a58('0x16')];_0x5b634e++){var _0x12f7f8=_0x1692ef[_0x8a58('0x3d')][_0x5b634e];var _0x542b4c='i';var _0x559f67=_[_0x8a58('0x3e')](_0x547b51,[_0x8a58('0xd'),_0x12f7f8[_0x8a58('0xc')]]);if(_0x559f67){var _0x4a436b=as[_0x8a58('0x3f')](_0x542b4c,_0x559f67[_0x8a58('0x40')],_0x12f7f8);_0x3d1fb0['default'][_0x496295](_0x4a436b[_0x8a58('0x41')],_0x4a436b[_0x8a58('0x42')][_0x8a58('0x43')],_0x4a436b[_0x8a58('0x42')][_0x8a58('0x44')]);}else{switch(_0x12f7f8[_0x8a58('0xc')]){case'unreadMessages':var _0x59bc79=parseReadParameter(_0x12f7f8[_0x8a58('0x42')]);_0x3d1fb0[_0x8a58('0x45')]['and'](_0x59bc79);break;case _0x8a58('0x46'):if(_0x12f7f8[_0x8a58('0x47')]===_0x8a58('0x48')){if(_0x12f7f8[_0x8a58('0x42')][_0x8a58('0x49')]('\x20')['length']>0x1){_0x3d1fb0[_0x8a58('0x4a')][_0x496295]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8a58('0x39')](_0x12f7f8[_0x8a58('0x42')]),null);}else{var _0x251d16='%'+_0x12f7f8[_0x8a58('0x42')]+'%';_0x3d1fb0[_0x8a58('0x4a')][_0x496295](_0x8a58('0x4b'),_0x251d16,_0x251d16,_0x251d16);}}else{_0x559f67=_[_0x8a58('0x3e')](_0x547b51,['name','ContactId']);_0x12f7f8[_0x8a58('0xc')]='ContactId';_0x4a436b=as['buildExpression'](_0x542b4c,_0x559f67[_0x8a58('0x40')],_0x12f7f8);_0x3d1fb0[_0x8a58('0x4a')][_0x496295](_0x4a436b[_0x8a58('0x41')],_0x4a436b['value']['start'],_0x4a436b[_0x8a58('0x42')]['end']);}break;case _0x8a58('0x4c'):var _0xb3ccc5=_0x12f7f8[_0x8a58('0x42')][_0x8a58('0x49')](',')['map'](function(_0x417951){return Number(_0x417951);});var _0x42c89e=parseTagParameter(_0xb3ccc5);_0x3d1fb0['tags'][_0x8a58('0x4d')][_0x8a58('0x4e')](_0x42c89e);_0x3d1fb0[_0x8a58('0x4f')][_0x8a58('0x50')]=_0xb3ccc5;break;case'User':if(_0x12f7f8[_0x8a58('0x47')]==='$substring'){_0x3d1fb0[_0x8a58('0x51')][_0x496295](_0x8a58('0x52'),'%'+_0x12f7f8['value']+'%',null);}else{_0x559f67=_[_0x8a58('0x3e')](_0x547b51,['name','UserId']);_0x12f7f8[_0x8a58('0xc')]=_0x8a58('0x53');_0x4a436b=as[_0x8a58('0x3f')](_0x542b4c,_0x559f67[_0x8a58('0x40')],_0x12f7f8);_0x3d1fb0[_0x8a58('0x51')][_0x496295](_0x4a436b[_0x8a58('0x41')],_0x4a436b['value']['start'],_0x4a436b[_0x8a58('0x42')][_0x8a58('0x44')]);}break;case _0x8a58('0x54'):case _0x8a58('0x55'):_0x4a436b=as[_0x8a58('0x3f')]('me',null,_0x12f7f8);_0x3d1fb0[_0x8a58('0x54')][_0x496295](_0x4a436b[_0x8a58('0x41')],_0x4a436b[_0x8a58('0x42')][_0x8a58('0x43')],_0x4a436b[_0x8a58('0x42')][_0x8a58('0x44')]);break;}}}return _0x3d1fb0;}function parseModelFields(_0x392c32,_0x1ea824,_0x3c97dc){var _0x523be7=utils[_0x8a58('0x7')](_0x392c32);var _0x6606f6=squel[_0x8a58('0x26')]();var _0x409f9e=_(_0x1ea824)[_0x8a58('0x56')]()[_0x8a58('0x1a')](function(_0x2d8810){return _['some'](_0x3c97dc,['name',_0x2d8810])?_0x2d8810:undefined;})['compact']()[_0x8a58('0x42')]();if(_0x409f9e[_0x8a58('0x16')]>0x0){_0x409f9e[_0x8a58('0x28')](function(_0x47a740){if(_0x47a740===_0x523be7){_0x6606f6[_0x8a58('0x4e')]('i.'+_0x523be7+_0x8a58('0x19'),[][_0x8a58('0x57')](_0x1ea824[_0x47a740]));}else if(_0x47a740===_0x8a58('0x58')){var _0x3f493c=JSON[_0x8a58('0x59')](_0x1ea824[_0x47a740])[_0x8a58('0x5a')];var _0x3a193f=JSON[_0x8a58('0x59')](_0x1ea824[_0x47a740])[_0x8a58('0x5b')];_0x6606f6[_0x8a58('0x4e')](_0x8a58('0x5c'),_0x3f493c,_0x3a193f);}else{if(_0x1ea824[_0x47a740]==='null'){_0x6606f6[_0x8a58('0x4e')]('i.'+_0x47a740+_0x8a58('0x5d'));}else{_0x6606f6['and']('i.'+_0x47a740+_0x8a58('0x5e'),_0x1ea824[_0x47a740]);}}});}return _0x6606f6;}function parseQueryParameters(_0xfab1e4,_0x1ce5e0,_0x5f3126){var _0xefbd77=getSqlClauses();return Promise['resolve']()[_0x8a58('0x5f')](function(){return parseModelFields(_0xfab1e4,_0x1ce5e0,_0x5f3126);})[_0x8a58('0x5f')](function(_0x3557fe){_0xefbd77[_0x8a58('0x60')][_0x8a58('0x4e')](_0x3557fe);return parseReadParameter(_0x1ce5e0[_0x8a58('0x45')]);})[_0x8a58('0x5f')](function(_0xc6a60c){_0xefbd77[_0x8a58('0x45')]['and'](_0xc6a60c);return parseTagParameter(_0x1ce5e0[_0x8a58('0x61')]);})[_0x8a58('0x5f')](function(_0x38bb4e){_0xefbd77[_0x8a58('0x4f')][_0x8a58('0x4d')]['and'](_0x38bb4e);return parseSearchFilter(_0xfab1e4,_0x1ce5e0[_0x8a58('0x62')]);})[_0x8a58('0x5f')](function(_0xa01a37){_0xefbd77[_0x8a58('0x62')]=_0xa01a37;return _0xefbd77;});}function checkAccountsRestrictions(_0x1022d5,_0x30a0b0,_0x454a3c){var _0x38e435=utils['getAccountFK'](_0x1022d5);var _0x415dea=_0x8a58('0x63')+_[_0x8a58('0x64')](_0x1022d5)+(_0x1022d5==='chat'?_0x8a58('0x65'):'Accounts');var _0x36d651=squel[_0x8a58('0x26')]();return Promise[_0x8a58('0x66')]()[_0x8a58('0x5f')](function(){if(_0x454a3c[_0x8a58('0xa')]&&_0x30a0b0[_0x8a58('0x8')]===_0x8a58('0x9')){return _0x30a0b0[_0x415dea]({'attributes':['id'],'raw':!![]});}})[_0x8a58('0x5f')](function(_0x5a32c9){if(_0x5a32c9){if(_0x5a32c9['length']===0x0){_0x36d651[_0x8a58('0x4e')]('i.'+_0x38e435+_0x8a58('0x5d'));}else{_0x36d651[_0x8a58('0x4e')]('i.'+_0x38e435+_0x8a58('0x19'),_[_0x8a58('0x1a')](_0x5a32c9,'id'));}}else if(!_0x454a3c[_0x38e435]){_0x36d651[_0x8a58('0x4e')]('i.'+_0x38e435+_0x8a58('0x67'));}})['then'](function(){return _0x36d651;});}function getClosedOrderClause(_0x3a62c6,_0x1cd962){var _0x493ccd='';var _0x153678=[_0x8a58('0x68'),_0x8a58('0x69'),_0x8a58('0x6a')];if(_0x3a62c6===_0x8a58('0x34')){_0x153678[_0x8a58('0x6b')]('i.substatus');}if(_0x1cd962[_0x8a58('0x6c')]==='0'&&_0x3a62c6===_0x8a58('0x34')){_0x493ccd='i.substatus';}else{if(_0x1cd962[_0x8a58('0x6c')]==='1'){_0x153678[_0x8a58('0x6d')]();}_0x493ccd=_0x8a58('0x6e')+_0x153678[_0x8a58('0x6f')](',\x20')+')';}return _0x493ccd;}function getFilteredInteractions(_0x47e32e,_0x4d8e8e,_0x19c527,_0x5ce699){var _0x24b5f3=utils[_0x8a58('0x11')](_0x47e32e);var _0x218369=_[_0x8a58('0x64')](_0x47e32e)+'Interaction';var _0xb0b5da=[];var _0x29c951=getTagsQuery();var _0x27e6c5={'type':db[_0x8a58('0x70')][_0x8a58('0x71')][_0x8a58('0x72')],'raw':!![]};var _0x9046f1=[];var _0x46b5fd=[];return db[_0x8a58('0x73')][_0x8a58('0x74')](_0x29c951[_0x8a58('0x75')](),_0x27e6c5)[_0x8a58('0x5f')](function(_0xf3dcf1){_0xb0b5da=_['keyBy'](_0xf3dcf1,'id');_0x27e6c5=_[_0x8a58('0x76')](_0x27e6c5,{'model':db[_0x218369],'mapToModel':!![],'nest':!![]});if(_0x19c527[_0x8a58('0x60')]){_0x5ce699[_0x8a58('0x77')][_0x8a58('0x28')](function(_0x29aaa9){_0x4d8e8e[_0x8a58('0xc')]('i.'+_0x29aaa9);});}else{_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x78'),'unreadMessages');_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x79'),'Account.key');_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x7a'),_0x8a58('0x7b'));if(_0x47e32e===_0x8a58('0x34')){_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x7c'),_0x8a58('0x7d'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x7e'),_0x8a58('0x7f'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x80'));_0x4d8e8e[_0x8a58('0xc')]('i.createdAt');_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x81'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x82'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x83'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x84'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x85'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x86'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x87'));_0x4d8e8e[_0x8a58('0xc')]('i.disposition');_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x69'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x68'));_0x4d8e8e[_0x8a58('0xc')]('i.substatus');_0x4d8e8e['field'](_0x8a58('0x88'));_0x4d8e8e[_0x8a58('0xc')]('i.ContactId');_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x89'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x8a'));}else if(_0x47e32e==='openchannel'){_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x8b'),_0x8a58('0x7f'));}else{_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x8c'),_0x8a58('0x7f'));}if(_0x47e32e!=='mail'){_0x4d8e8e['field'](_0x8a58('0x8d'));}_0x4d8e8e['field']('c.firstName','Contact.firstName');_0x4d8e8e[_0x8a58('0xc')]('c.lastName',_0x8a58('0x8e'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x8f'),_0x8a58('0x90'));_0x4d8e8e['field'](_0x8a58('0x91'),'Contact.phone');_0x4d8e8e[_0x8a58('0xc')]('c.mobile',_0x8a58('0x92'));_0x4d8e8e['field'](_0x8a58('0x93'),_0x8a58('0x94'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x95'),_0x8a58('0x96'));_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x97'),'Owner.internal');_0x4d8e8e[_0x8a58('0xc')](_0x8a58('0x98'),_0x8a58('0x99'));}if(_0x5ce699[_0x8a58('0x9a')]){_0x4d8e8e['limit'](_0x5ce699[_0x8a58('0x9a')]);}if(_0x5ce699[_0x8a58('0x9b')]){_0x4d8e8e['offset'](_0x5ce699[_0x8a58('0x9b')]);}return db[_0x8a58('0x73')][_0x8a58('0x74')](_0x4d8e8e['toString'](),_0x27e6c5);})['then'](function(_0x228ad0){_0x9046f1=_0x228ad0;var _0x1f00e2=getUsersQuery(_0x47e32e,_0x9046f1);return db[_0x8a58('0x73')][_0x8a58('0x74')](_0x1f00e2['toString'](),_0x27e6c5);})[_0x8a58('0x5f')](function(_0x2ca980){_0x46b5fd=_[_0x8a58('0x9c')](_0x2ca980,_0x24b5f3);if(_0x47e32e===_0x8a58('0x34')){return db[_0x8a58('0x9d')][_0x8a58('0x9e')]({'attributes':[_0x8a58('0x9f')],'raw':!![]});}})[_0x8a58('0x5f')](function(_0x45db9c){var _0x36212e=_0x45db9c?_0x45db9c['enableEmailPreview']:undefined;var _0x56079a=_0x9046f1[_0x8a58('0x1a')](function(_0x2850c5){return updateInteraction(_0x2850c5,_0xb0b5da,_0x46b5fd,_0x36212e);});return Promise[_0x8a58('0xa0')](_0x56079a);});}function countFilteredInteractions(_0x2235c2,_0x311b64){var _0x488232=_0x2235c2[_0x8a58('0xa1')]();_0x488232[_0x8a58('0xc')]('COUNT(*)');_0x488232[_0x8a58('0xc')](_0x8a58('0x78'),_0x8a58('0xa2'));var _0x499565=utils[_0x8a58('0x27')](_0x311b64);if(!_[_0x8a58('0xa3')](_0x499565)){_0x488232[_0x8a58('0x17')](_0x8a58('0xa4'),_0x499565);}var _0xe9aef9={'type':db[_0x8a58('0x70')][_0x8a58('0x71')]['SELECT'],'raw':!![]};return db[_0x8a58('0x73')][_0x8a58('0x74')](_0x488232[_0x8a58('0x75')](),_0xe9aef9);}module[_0x8a58('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 5a12341..ef3f1b3 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbe2=['Tags','TagIds','../../mysqldb','map','fullname','split','forEach','waiting','talking','unmanaged','closed','disposition','abandoned','UserId','MailMessage','findOne','out','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','Users'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xcbe2,0xc2));var _0x2cbe=function(_0x1b6b8d,_0x59e58b){_0x1b6b8d=_0x1b6b8d-0x0;var _0xf49704=_0xcbe2[_0x1b6b8d];return _0xf49704;};'use strict';var _=require('lodash');var db=require(_0x2cbe('0x0'))['db'];function getInteractionUsers(_0x3af566,_0x558d8d){return new Promise(function(_0x560aa9,_0x29d5af){try{var _0x296616=[];if(_0x558d8d[_0x3af566]){_0x296616=_0x558d8d[_0x3af566][_0x2cbe('0x1')](function(_0x5d77c3){return{'id':_0x5d77c3['id'],'fullname':_0x5d77c3[_0x2cbe('0x2')]};});}return _0x560aa9(_0x296616);}catch(_0x17d2fe){_0x29d5af(_0x17d2fe);}});}function getInteractionTags(_0x1b08c9,_0x579c64){var _0x24a5fb=[];if(_0x1b08c9){_0x1b08c9[_0x2cbe('0x3')](',')[_0x2cbe('0x4')](function(_0x5b6b7e){_0x24a5fb['push'](_0x579c64[_0x5b6b7e]);});}return _0x24a5fb;}function updateWaitingCounter(_0x39b883){if(_0x39b883[_0x2cbe('0x5')]){_0x39b883[_0x2cbe('0x5')]-=0x1;}}function updateInteractionCounters(_0x14dd4b){_0x14dd4b['waiting']=0x0;_0x14dd4b[_0x2cbe('0x6')]=0x0;_0x14dd4b['answered']=0x0;_0x14dd4b[_0x2cbe('0x7')]=0x0;_0x14dd4b['abandoned']=0x0;_0x14dd4b['total']=0x0;if(_0x14dd4b[_0x2cbe('0x8')]){if(_0x14dd4b[_0x2cbe('0x9')]===_0x2cbe('0xa')){_0x14dd4b[_0x2cbe('0xa')]+=0x1;updateWaitingCounter(_0x14dd4b);}if(_0x14dd4b[_0x2cbe('0xb')]){_0x14dd4b['answered']+=0x1;if(_0x14dd4b['talking']){_0x14dd4b[_0x2cbe('0x6')]-=0x1;}}else{if(_0x14dd4b['disposition']){_0x14dd4b[_0x2cbe('0x7')]+=0x1;updateWaitingCounter(_0x14dd4b);}}}else{if(!_0x14dd4b[_0x2cbe('0xb')]){_0x14dd4b['waiting']+=0x1;}if(_0x14dd4b[_0x2cbe('0xb')]){_0x14dd4b[_0x2cbe('0x6')]+=0x1;updateWaitingCounter(_0x14dd4b);}}_0x14dd4b['total']+=0x1;return _0x14dd4b;}function getLastMessageText(_0x28ec65){return db[_0x2cbe('0xc')][_0x2cbe('0xd')]({'where':{'$and':[{'MailInteractionId':_0x28ec65['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2cbe('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2cbe('0xf')],'order':'-id','raw':!![]})[_0x2cbe('0x10')](function(_0x33d2db){if(_0x33d2db&&_0x33d2db[_0x2cbe('0xf')]){_0x28ec65[_0x2cbe('0x11')]=_[_0x2cbe('0x12')](_0x33d2db['plainBody']);}return _0x28ec65;})[_0x2cbe('0x13')](function(_0x687ebb){throw _0x687ebb;});}exports[_0x2cbe('0x14')]=function(_0x379dd5,_0x39dc45,_0x3d0135,_0x48f97d){return new Promise(function(_0x4b4f2b,_0x4dd56d){return getInteractionUsers(_0x379dd5['id'],_0x3d0135)[_0x2cbe('0x10')](function(_0x3b0f55){_0x379dd5[_0x2cbe('0x15')]=_0x3b0f55;return getInteractionTags(_0x379dd5['TagIds'],_0x39dc45);})[_0x2cbe('0x10')](function(_0x233a57){_0x379dd5[_0x2cbe('0x16')]=_0x233a57;delete _0x379dd5[_0x2cbe('0x17')];return updateInteractionCounters(_0x379dd5);})['then'](function(_0x4ad0c4){if(_0x48f97d){return getLastMessageText(_0x4ad0c4);}else{return _0x4ad0c4;}})[_0x2cbe('0x10')](function(_0x5324de){_0x4b4f2b(_0x5324de);})[_0x2cbe('0x13')](function(_0x224647){_0x4dd56d(_0x224647);});});}; \ No newline at end of file +var _0xccd8=['plainBody','-id','then','trimStart','catch','updateInteraction','Users','TagIds','map','fullname','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','disposition','findOne','out'];(function(_0x492e2e,_0x5ce525){var _0x5344ec=function(_0x12dec9){while(--_0x12dec9){_0x492e2e['push'](_0x492e2e['shift']());}};_0x5344ec(++_0x5ce525);}(_0xccd8,0xee));var _0x8ccd=function(_0x2b0e17,_0x23d155){_0x2b0e17=_0x2b0e17-0x0;var _0x20430f=_0xccd8[_0x2b0e17];return _0x20430f;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x527f41,_0x3fcc6b){return new Promise(function(_0x4fbea5,_0x45abf1){try{var _0x2df349=[];if(_0x3fcc6b[_0x527f41]){_0x2df349=_0x3fcc6b[_0x527f41][_0x8ccd('0x0')](function(_0x4375df){return{'id':_0x4375df['id'],'fullname':_0x4375df[_0x8ccd('0x1')]};});}return _0x4fbea5(_0x2df349);}catch(_0x404a27){_0x45abf1(_0x404a27);}});}function getInteractionTags(_0x9a84ed,_0x2e39e0){var _0x21701b=[];if(_0x9a84ed){_0x9a84ed['split'](',')[_0x8ccd('0x2')](function(_0x50e850){_0x21701b[_0x8ccd('0x3')](_0x2e39e0[_0x50e850]);});}return _0x21701b;}function updateWaitingCounter(_0x1fb240){if(_0x1fb240[_0x8ccd('0x4')]){_0x1fb240[_0x8ccd('0x4')]-=0x1;}}function updateInteractionCounters(_0x457673){_0x457673['waiting']=0x0;_0x457673[_0x8ccd('0x5')]=0x0;_0x457673[_0x8ccd('0x6')]=0x0;_0x457673[_0x8ccd('0x7')]=0x0;_0x457673[_0x8ccd('0x8')]=0x0;_0x457673[_0x8ccd('0x9')]=0x0;if(_0x457673[_0x8ccd('0xa')]){if(_0x457673['disposition']==='abandoned'){_0x457673['abandoned']+=0x1;updateWaitingCounter(_0x457673);}if(_0x457673[_0x8ccd('0xb')]){_0x457673[_0x8ccd('0x6')]+=0x1;if(_0x457673[_0x8ccd('0x5')]){_0x457673['talking']-=0x1;}}else{if(_0x457673[_0x8ccd('0xc')]){_0x457673[_0x8ccd('0x7')]+=0x1;updateWaitingCounter(_0x457673);}}}else{if(!_0x457673[_0x8ccd('0xb')]){_0x457673[_0x8ccd('0x4')]+=0x1;}if(_0x457673['UserId']){_0x457673['talking']+=0x1;updateWaitingCounter(_0x457673);}}_0x457673[_0x8ccd('0x9')]+=0x1;return _0x457673;}function getLastMessageText(_0x114455){return db['MailMessage'][_0x8ccd('0xd')]({'where':{'$and':[{'MailInteractionId':_0x114455['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x8ccd('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8ccd('0xf')],'order':_0x8ccd('0x10'),'raw':!![]})[_0x8ccd('0x11')](function(_0x5c4ef1){if(_0x5c4ef1&&_0x5c4ef1[_0x8ccd('0xf')]){_0x114455['lastMsgText']=_[_0x8ccd('0x12')](_0x5c4ef1['plainBody']);}return _0x114455;})[_0x8ccd('0x13')](function(_0x5706ea){throw _0x5706ea;});}exports[_0x8ccd('0x14')]=function(_0xf11001,_0x33df28,_0x2c8767,_0x40070f){return new Promise(function(_0x5bcb48,_0x215ce3){return getInteractionUsers(_0xf11001['id'],_0x2c8767)[_0x8ccd('0x11')](function(_0x224265){_0xf11001[_0x8ccd('0x15')]=_0x224265;return getInteractionTags(_0xf11001[_0x8ccd('0x16')],_0x33df28);})[_0x8ccd('0x11')](function(_0x4a7834){_0xf11001['Tags']=_0x4a7834;delete _0xf11001['TagIds'];return updateInteractionCounters(_0xf11001);})['then'](function(_0x43b797){if(_0x40070f){return getLastMessageText(_0x43b797);}else{return _0x43b797;}})[_0x8ccd('0x11')](function(_0x49685d){_0x5bcb48(_0x49685d);})[_0x8ccd('0x13')](function(_0x16b66a){_0x215ce3(_0x16b66a);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index ed42cf2..f5bf033 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35d9=['chat-interactions','capitalize','chat','Account','InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','Interaction','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions'];(function(_0x545396,_0x301e2e){var _0x4e3a04=function(_0x4338d8){while(--_0x4338d8){_0x545396['push'](_0x545396['shift']());}};_0x4e3a04(++_0x301e2e);}(_0x35d9,0xae));var _0x935d=function(_0x591695,_0x1d60b4){_0x591695=_0x591695-0x0;var _0x155dc2=_0x35d9[_0x591695];return _0x155dc2;};'use strict';var _=require(_0x935d('0x0'));var db=require(_0x935d('0x1'))['db'];var loggers={'openchannel':require(_0x935d('0x2'))(_0x935d('0x3')),'mail':require(_0x935d('0x2'))(_0x935d('0x4')),'fax':require(_0x935d('0x2'))(_0x935d('0x5')),'sms':require(_0x935d('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x935d('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x11c663){return _[_0x935d('0x7')](_0x11c663)+(_0x11c663===_0x935d('0x8')?'Website':_0x935d('0x9'))+'Id';}function getInteractionFK(_0x3f691d){return _[_0x935d('0x7')](_0x3f691d)+_0x935d('0xa');}function getInteractionId(_0x2e2230,_0x260354,_0x3f1696){if(_0x2e2230&&_0x2e2230[_[_0x935d('0xb')](_0x3f1696)+'InteractionId']){return _0x2e2230[_[_0x935d('0xb')](_0x3f1696)+'InteractionId'];}else if(_0x2e2230&&_0x2e2230['id']){return _0x2e2230['id'];}else if(_0x260354&&_0x260354['id']){return _0x260354['id'];}else{return _0x935d('0xc');}}function getInteractionsTables(_0xfb6517){return{'accounts':_0xfb6517+'_'+(_0xfb6517==='chat'?'websites':_0x935d('0xd')),'interactions':_0xfb6517+_0x935d('0xe'),'interactionsTags':_0xfb6517+_0x935d('0xf'),'messages':_0xfb6517+_0x935d('0x10'),'userInteractions':_0x935d('0x11')+_0xfb6517+'_interactions'};}function getSelectedTags(_0xa46a){var _0x50cabc=[];if(_0xa46a){_0x50cabc=Array[_0x935d('0x12')](_0xa46a)?_0xa46a:[_0xa46a];}return _0x50cabc;}function log(_0x4f70ec,_0x1e0059,_0x693bb2,_0xf9cffb,_0x2f85a3,_0x566dad){loggers[_0x2f85a3['toLowerCase']()][_0x4f70ec](_0x935d('0x13'),_0x566dad[_0x935d('0x14')](),_0x1e0059?_0x1e0059['id']:null,_0x1e0059?_0x1e0059[_0x935d('0x15')]:null,_0x1e0059?_0x1e0059[_0x935d('0x16')]:null,getInteractionId(_0x693bb2,_0xf9cffb,_0x2f85a3),_0x693bb2?JSON['stringify'](_0x693bb2):'null');}function updateUser(_0x194c03,_0x36b13b,_0x34b814,_0x29d616,_0x3c75b4){db[_[_0x935d('0xb')](_0x29d616)+_0x935d('0x17')]['findOne']({'where':{'id':getInteractionId(_0x36b13b,_0x34b814,_0x29d616)}})[_0x935d('0x18')](function(_0x1a35f3){if(_0x1a35f3){return _0x1a35f3[_0x935d('0x19')]({'UserId':_0x194c03?_0x194c03['id']:null});}})[_0x935d('0x18')](function(_0x445f79){if(_0x445f79){log(_0x935d('0x1a'),_0x194c03,_0x36b13b,_0x34b814,_0x29d616,_0x3c75b4);}})[_0x935d('0x1b')](function(){log(_0x935d('0x1c'),_0x194c03,_0x36b13b,_0x34b814,_0x29d616,_0x3c75b4);});}module[_0x935d('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xe1f6=['lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','upperFirst','InteractionId','unknown','_interactions','_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','Interaction','findOne','then','update','info','catch','error','exports'];(function(_0x1871d4,_0x3ea462){var _0x476835=function(_0x3a4e43){while(--_0x3a4e43){_0x1871d4['push'](_0x1871d4['shift']());}};_0x476835(++_0x3ea462);}(_0xe1f6,0x1c0));var _0x6e1f=function(_0xd902ad,_0x34a4db){_0xd902ad=_0xd902ad-0x0;var _0x2dda06=_0xe1f6[_0xd902ad];return _0x2dda06;};'use strict';var _=require(_0x6e1f('0x0'));var db=require(_0x6e1f('0x1'))['db'];var loggers={'openchannel':require(_0x6e1f('0x2'))(_0x6e1f('0x3')),'mail':require(_0x6e1f('0x2'))(_0x6e1f('0x4')),'fax':require(_0x6e1f('0x2'))(_0x6e1f('0x5')),'sms':require(_0x6e1f('0x2'))(_0x6e1f('0x6')),'chat':require(_0x6e1f('0x2'))(_0x6e1f('0x7')),'whatsapp':require(_0x6e1f('0x2'))(_0x6e1f('0x8'))};function getAccountFK(_0x32fbe4){return _[_0x6e1f('0x9')](_0x32fbe4)+(_0x32fbe4===_0x6e1f('0xa')?_0x6e1f('0xb'):_0x6e1f('0xc'))+'Id';}function getInteractionFK(_0x4acc64){return _[_0x6e1f('0x9')](_0x4acc64)+'InteractionId';}function getInteractionId(_0x3a8349,_0x4deac4,_0x21b29a){if(_0x3a8349&&_0x3a8349[_[_0x6e1f('0xd')](_0x21b29a)+_0x6e1f('0xe')]){return _0x3a8349[_['upperFirst'](_0x21b29a)+_0x6e1f('0xe')];}else if(_0x3a8349&&_0x3a8349['id']){return _0x3a8349['id'];}else if(_0x4deac4&&_0x4deac4['id']){return _0x4deac4['id'];}else{return _0x6e1f('0xf');}}function getInteractionsTables(_0x3b61e3){return{'accounts':_0x3b61e3+'_'+(_0x3b61e3===_0x6e1f('0xa')?'websites':'accounts'),'interactions':_0x3b61e3+_0x6e1f('0x10'),'interactionsTags':_0x3b61e3+_0x6e1f('0x11'),'messages':_0x3b61e3+_0x6e1f('0x12'),'userInteractions':_0x6e1f('0x13')+_0x3b61e3+_0x6e1f('0x10')};}function getSelectedTags(_0x2f659e){var _0x597362=[];if(_0x2f659e){_0x597362=Array[_0x6e1f('0x14')](_0x2f659e)?_0x2f659e:[_0x2f659e];}return _0x597362;}function log(_0x9613d,_0x33b080,_0xdcd724,_0x2fe89e,_0x5c1f37,_0x3cefde){loggers[_0x5c1f37['toLowerCase']()][_0x9613d](_0x6e1f('0x15'),_0x3cefde['toUpperCase'](),_0x33b080?_0x33b080['id']:null,_0x33b080?_0x33b080['name']:null,_0x33b080?_0x33b080['role']:null,getInteractionId(_0xdcd724,_0x2fe89e,_0x5c1f37),_0xdcd724?JSON[_0x6e1f('0x16')](_0xdcd724):_0x6e1f('0x17'));}function updateUser(_0x5f0418,_0x26d48b,_0x2e20a9,_0x5e63b9,_0x5db781){db[_[_0x6e1f('0xd')](_0x5e63b9)+_0x6e1f('0x18')][_0x6e1f('0x19')]({'where':{'id':getInteractionId(_0x26d48b,_0x2e20a9,_0x5e63b9)}})[_0x6e1f('0x1a')](function(_0x138e17){if(_0x138e17){return _0x138e17[_0x6e1f('0x1b')]({'UserId':_0x5f0418?_0x5f0418['id']:null});}})[_0x6e1f('0x1a')](function(_0x313e9b){if(_0x313e9b){log(_0x6e1f('0x1c'),_0x5f0418,_0x26d48b,_0x2e20a9,_0x5e63b9,_0x5db781);}})[_0x6e1f('0x1d')](function(){log(_0x6e1f('0x1e'),_0x5f0418,_0x26d48b,_0x2e20a9,_0x5e63b9,_0x5db781);});}module[_0x6e1f('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 286f40d..3c1e819 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 _0x00ea=['final','utf8','parse','hasOwnProperty','use','License','findOne','then','status','catch','users','User','admin','user','crypto','util','../../mysqldb','../../config/environment','data1','license','format','%s:%s:%s','update','base64'];(function(_0x52a887,_0x4dbc2c){var _0x267daa=function(_0x4bd395){while(--_0x4bd395){_0x52a887['push'](_0x52a887['shift']());}};_0x267daa(++_0x4dbc2c);}(_0x00ea,0x176));var _0xa00e=function(_0x22bb05,_0xeb6156){_0x22bb05=_0x22bb05-0x0;var _0x4a5631=_0x00ea[_0x22bb05];return _0x4a5631;};'use strict';var crypto=require(_0xa00e('0x0'));var util=require(_0xa00e('0x1'));var compose=require('composable-middleware');var db=require(_0xa00e('0x2'))['db'];var config=require(_0xa00e('0x3'));function getValueFromLicense(_0x18b624,_0x297454){if(_0x18b624&&_0x297454){if(_0x297454[_0xa00e('0x4')]&&_0x297454[_0xa00e('0x5')]){var _0x44d271=_0x297454[_0xa00e('0x4')];var _0x11047e=_0x297454[_0xa00e('0x5')];var _0x578ce1=_0x44d271['split']('-')[0x4];var _0x1750c3=_0x44d271['split']('-')[0x0];var _0x23dd58=crypto['createDecipher']('aes-256-ctr',util[_0xa00e('0x6')](_0xa00e('0x7'),_0x578ce1,_0x44d271,_0x1750c3));var _0x58002f=_0x23dd58[_0xa00e('0x8')](_0x11047e,_0xa00e('0x9'),'utf8');_0x58002f+=_0x23dd58[_0xa00e('0xa')](_0xa00e('0xb'));var _0x2eccb1=JSON[_0xa00e('0xc')](_0x58002f);return _0x2eccb1[_0xa00e('0xd')](_0x18b624)?_0x2eccb1[_0x18b624]:null;}}return null;}function isLimit(_0x1a11dd,_0x1cf28b,_0x1771f4,_0x51b55b){var _0x3db871=_0x1cf28b;return compose()[_0xa00e('0xe')](function(_0x70b731,_0x2a2587,_0x4040fa){return db[_0xa00e('0xf')][_0xa00e('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xa00e('0x11')](function(_0x297576){var _0x5ce80c=getValueFromLicense(_0x1a11dd,_0x297576);return _0x5ce80c?_0x5ce80c:_0x3db871;})[_0xa00e('0x11')](function(_0x30c64b){_0x3db871=_0x30c64b;return _0x1771f4['count'](_0x51b55b);})[_0xa00e('0x11')](function(_0x37de74){if(_0x37de74>=_0x3db871){return _0x2a2587[_0xa00e('0x12')](0x193)['json']({'message':util[_0xa00e('0x6')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1a11dd)});}_0x4040fa();})[_0xa00e('0x13')](function(_0xe5af81){_0x4040fa(_0xe5af81);});});}function isUserLimit(){return isLimit(_0xa00e('0x14'),0x1,db[_0xa00e('0x15')],{'where':{'$or':[{'role':_0xa00e('0x16')},{'role':_0xa00e('0x17')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xe2fa=['split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','then','count','catch','users','User','isUserLimit','composable-middleware','../../config/environment','data1','license'];(function(_0x1505e5,_0x5cc291){var _0x5b1dcd=function(_0x18bfe5){while(--_0x18bfe5){_0x1505e5['push'](_0x1505e5['shift']());}};_0x5b1dcd(++_0x5cc291);}(_0xe2fa,0x1e0));var _0xae2f=function(_0x4fad1a,_0x5977ea){_0x4fad1a=_0x4fad1a-0x0;var _0x89b4d1=_0xe2fa[_0x4fad1a];return _0x89b4d1;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0xae2f('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xae2f('0x1'));function getValueFromLicense(_0xec568a,_0x4005c4){if(_0xec568a&&_0x4005c4){if(_0x4005c4[_0xae2f('0x2')]&&_0x4005c4['license']){var _0x317bf2=_0x4005c4[_0xae2f('0x2')];var _0x214d18=_0x4005c4[_0xae2f('0x3')];var _0x58833e=_0x317bf2[_0xae2f('0x4')]('-')[0x4];var _0x3f533c=_0x317bf2['split']('-')[0x0];var _0x533e91=crypto[_0xae2f('0x5')](_0xae2f('0x6'),util[_0xae2f('0x7')](_0xae2f('0x8'),_0x58833e,_0x317bf2,_0x3f533c));var _0x409a34=_0x533e91[_0xae2f('0x9')](_0x214d18,_0xae2f('0xa'),_0xae2f('0xb'));_0x409a34+=_0x533e91['final'](_0xae2f('0xb'));var _0x4126d4=JSON[_0xae2f('0xc')](_0x409a34);return _0x4126d4[_0xae2f('0xd')](_0xec568a)?_0x4126d4[_0xec568a]:null;}}return null;}function isLimit(_0x2c3712,_0x4a6dd9,_0x14fbb9,_0x44ec37){var _0x57a4ea=_0x4a6dd9;return compose()[_0xae2f('0xe')](function(_0x44604e,_0x5bce7f,_0x2b1a0c){return db[_0xae2f('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xae2f('0x10')](function(_0xb0ff44){var _0x5e9586=getValueFromLicense(_0x2c3712,_0xb0ff44);return _0x5e9586?_0x5e9586:_0x57a4ea;})[_0xae2f('0x10')](function(_0x4c2a27){_0x57a4ea=_0x4c2a27;return _0x14fbb9[_0xae2f('0x11')](_0x44ec37);})[_0xae2f('0x10')](function(_0x4d4a8d){if(_0x4d4a8d>=_0x57a4ea){return _0x5bce7f['status'](0x193)['json']({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2c3712)});}_0x2b1a0c();})[_0xae2f('0x12')](function(_0x5216b8){_0x2b1a0c(_0x5216b8);});});}function isUserLimit(){return isLimit(_0xae2f('0x13'),0x1,db[_0xae2f('0x14')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xae2f('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fae382f..3667221 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 _0xe387=['add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','DATE','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','[$and]','split','slice','shift','match','forEach','filter','indexOf','map','conditions','buildExpression','operator','$eq','$between','value','includes','$gt','$lte'];(function(_0x247e84,_0x4e7ac0){var _0x370879=function(_0x1d45bb){while(--_0x1d45bb){_0x247e84['push'](_0x247e84['shift']());}};_0x370879(++_0x4e7ac0);}(_0xe387,0x12c));var _0x7e38=function(_0x587ed2,_0x5eb91d){_0x587ed2=_0x587ed2-0x0;var _0x55ea1c=_0xe387[_0x587ed2];return _0x55ea1c;};'use strict';var _=require(_0x7e38('0x0'));var moment=require(_0x7e38('0x1'));exports[_0x7e38('0x2')]=function(_0x18fef6){var _0xc1079d={'conditions':[]};_0xc1079d[_0x7e38('0x3')]=_['startsWith'](_0x18fef6,_0x7e38('0x4'))?'or':_0x7e38('0x5');var _0x2d876c=_0x18fef6['replace'](_0x7e38('0x6'),'')['replace']('[$or]','')[_0x7e38('0x7')]('||');for(var _0x2ad84d=0x0;_0x2ad84d<_0x2d876c['length'];_0x2ad84d++){var _0x143a52=_0x2d876c[_0x2ad84d][_0x7e38('0x7')](':=');var _0xf4b9f1=_0x143a52[0x0];var _0x5b1e9c=_0x143a52[_0x7e38('0x8')](0x1);_0x5b1e9c['forEach'](function(_0x4b532a){var _0x2858cc=_0x4b532a[_0x7e38('0x7')]('[')[_0x7e38('0x9')]();var _0x595942=_0x4b532a[_0x7e38('0xa')](/\[(.*?)\]/g);_0x595942[_0x7e38('0xb')](function(_0x14cb43){var _0x2785b1=_0x14cb43[_0x7e38('0x7')]('[')[_0x7e38('0xc')](function(_0x3aaab3){return _0x3aaab3[_0x7e38('0xd')](']')>-0x1;})[_0x7e38('0xe')](function(_0x4136df){return _0x4136df[_0x7e38('0x7')](']')[0x0];})[0x0];_0xc1079d[_0x7e38('0xf')]['push']({'field':_0xf4b9f1,'operator':_0x2858cc,'value':_0x2785b1});});});}return _0xc1079d;};exports[_0x7e38('0x10')]=function(_0x2f8072,_0x59e0c1,_0x4fc64){var _0x82dbca={};if(_0x59e0c1==='DATE'){if(_0x4fc64[_0x7e38('0x11')]===_0x7e38('0x12')){_0x4fc64['operator']=_0x7e38('0x13');_0x4fc64[_0x7e38('0x14')]+=','+_0x4fc64[_0x7e38('0x14')];}else if(_[_0x7e38('0x15')]([_0x7e38('0x16'),_0x7e38('0x17')],_0x4fc64[_0x7e38('0x11')])){_0x4fc64[_0x7e38('0x14')]=moment(_0x4fc64['value'])[_0x7e38('0x18')](0x1,_0x7e38('0x19'))[_0x7e38('0x1a')](_0x7e38('0x1b'));}}if(_0x4fc64['castTo']){_0x59e0c1=_0x4fc64[_0x7e38('0x1c')];_0x82dbca[_0x7e38('0x1d')]=_0x7e38('0x1e')+_0x2f8072+'.'+_0x4fc64[_0x7e38('0x1f')]+'\x20AS\x20'+_0x4fc64[_0x7e38('0x1c')]+')\x20'+parseOperator(_0x4fc64['operator']);}else{_0x82dbca[_0x7e38('0x1d')]=_0x2f8072+'.'+_0x4fc64[_0x7e38('0x1f')]+'\x20'+parseOperator(_0x4fc64[_0x7e38('0x11')]);}if(_[_0x7e38('0x15')](['$ne','$notIn'],_0x4fc64['operator']))_0x82dbca[_0x7e38('0x1d')]='('+_0x82dbca[_0x7e38('0x1d')]+'\x20OR\x20'+_0x2f8072+'.'+_0x4fc64[_0x7e38('0x1f')]+_0x7e38('0x20');_0x82dbca[_0x7e38('0x14')]=parseValue(_0x59e0c1,_0x4fc64[_0x7e38('0x11')],_0x4fc64['value']);return _0x82dbca;};function parseOperator(_0x46cfe5){var _0x315560;switch(_0x46cfe5){case'$in':_0x315560=_0x7e38('0x21');break;case _0x7e38('0x22'):_0x315560=_0x7e38('0x23');break;case'$eq':_0x315560=_0x7e38('0x24');break;case _0x7e38('0x25'):_0x315560=_0x7e38('0x26');break;case _0x7e38('0x27'):case _0x7e38('0x28'):case'$endsWith':_0x315560=_0x7e38('0x29');break;case _0x7e38('0x2a'):_0x315560='<\x20?';break;case _0x7e38('0x16'):_0x315560=_0x7e38('0x2b');break;case _0x7e38('0x17'):_0x315560='<=\x20?';break;case _0x7e38('0x2c'):_0x315560='>=\x20?';break;case _0x7e38('0x13'):_0x315560=_0x7e38('0x2d');break;}return _0x315560;}function parseValue(_0xd5807c,_0x2f01c8,_0x1c3930){var _0x1a9cf7={'start':undefined,'end':undefined};switch(_0x2f01c8){case'$in':case _0x7e38('0x22'):_0x1a9cf7[_0x7e38('0x2e')]=_0x1c3930[_0x7e38('0x7')](',');break;case _0x7e38('0x27'):_0x1a9cf7[_0x7e38('0x2e')]='%'+_0x1c3930+'%';break;case _0x7e38('0x28'):_0x1a9cf7['start']=_0x1c3930+'%';break;case _0x7e38('0x2f'):_0x1a9cf7[_0x7e38('0x2e')]='%'+_0x1c3930;break;case _0x7e38('0x13'):var _0x2cc20d=_0x1c3930[_0x7e38('0x7')](',');var _0x1c3930=_0x2cc20d[_0x7e38('0x9')]();var _0x16ef9b=_0x2cc20d[_0x7e38('0x30')]();if(_0xd5807c===_0x7e38('0x31')){_0x1c3930=moment(_0x1c3930)['utcOffset'](0x0,!![])['format']();_0x16ef9b=moment(_0x16ef9b)[_0x7e38('0x32')](0x0,!![])[_0x7e38('0x18')](0x17,_0x7e38('0x33'))[_0x7e38('0x18')](0x3b,_0x7e38('0x34'))[_0x7e38('0x18')](0x3b,_0x7e38('0x35'))[_0x7e38('0x1a')]();}_0x1a9cf7={'start':_0x1c3930,'end':_0x16ef9b};break;default:_0x1a9cf7['start']=_0x1c3930;break;}return _0x1a9cf7;} \ No newline at end of file +var _0x9a7f=['$gt','$lte','value','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$startsWith','$endsWith','utcOffset','minutes','seconds','moment','parseSearch','[$or]','and','[$and]','replace','split','length','slice','forEach','shift','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','$between','includes'];(function(_0x326b71,_0x49487f){var _0x59d08d=function(_0x174e72){while(--_0x174e72){_0x326b71['push'](_0x326b71['shift']());}};_0x59d08d(++_0x49487f);}(_0x9a7f,0xf9));var _0xf9a7=function(_0x250333,_0x25fe43){_0x250333=_0x250333-0x0;var _0x486c36=_0x9a7f[_0x250333];return _0x486c36;};'use strict';var _=require('lodash');var moment=require(_0xf9a7('0x0'));exports[_0xf9a7('0x1')]=function(_0x4a47c5){var _0x539455={'conditions':[]};_0x539455['sqlOperator']=_['startsWith'](_0x4a47c5,_0xf9a7('0x2'))?'or':_0xf9a7('0x3');var _0x7435a7=_0x4a47c5['replace'](_0xf9a7('0x4'),'')[_0xf9a7('0x5')](_0xf9a7('0x2'),'')[_0xf9a7('0x6')]('||');for(var _0x4e9a98=0x0;_0x4e9a98<_0x7435a7[_0xf9a7('0x7')];_0x4e9a98++){var _0x467de0=_0x7435a7[_0x4e9a98][_0xf9a7('0x6')](':=');var _0x5b0d79=_0x467de0[0x0];var _0x29cd31=_0x467de0[_0xf9a7('0x8')](0x1);_0x29cd31[_0xf9a7('0x9')](function(_0x11d1af){var _0x47336f=_0x11d1af[_0xf9a7('0x6')]('[')[_0xf9a7('0xa')]();var _0x4003d7=_0x11d1af['match'](/\[(.*?)\]/g);_0x4003d7[_0xf9a7('0x9')](function(_0x3c236b){var _0x2f9dc0=_0x3c236b[_0xf9a7('0x6')]('[')['filter'](function(_0x102f3c){return _0x102f3c[_0xf9a7('0xb')](']')>-0x1;})[_0xf9a7('0xc')](function(_0x189b2d){return _0x189b2d['split'](']')[0x0];})[0x0];_0x539455[_0xf9a7('0xd')][_0xf9a7('0xe')]({'field':_0x5b0d79,'operator':_0x47336f,'value':_0x2f9dc0});});});}return _0x539455;};exports[_0xf9a7('0xf')]=function(_0x1a6c7a,_0x2a22aa,_0x38c7a8){var _0xceda1d={};if(_0x2a22aa===_0xf9a7('0x10')){if(_0x38c7a8['operator']===_0xf9a7('0x11')){_0x38c7a8[_0xf9a7('0x12')]=_0xf9a7('0x13');_0x38c7a8['value']+=','+_0x38c7a8['value'];}else if(_[_0xf9a7('0x14')]([_0xf9a7('0x15'),_0xf9a7('0x16')],_0x38c7a8['operator'])){_0x38c7a8[_0xf9a7('0x17')]=moment(_0x38c7a8[_0xf9a7('0x17')])[_0xf9a7('0x18')](0x1,_0xf9a7('0x19'))[_0xf9a7('0x1a')]('YYYY-MM-DD');}}if(_0x38c7a8[_0xf9a7('0x1b')]){_0x2a22aa=_0x38c7a8['castTo'];_0xceda1d[_0xf9a7('0x1c')]=_0xf9a7('0x1d')+_0x1a6c7a+'.'+_0x38c7a8[_0xf9a7('0x1e')]+_0xf9a7('0x1f')+_0x38c7a8['castTo']+')\x20'+parseOperator(_0x38c7a8[_0xf9a7('0x12')]);}else{_0xceda1d[_0xf9a7('0x1c')]=_0x1a6c7a+'.'+_0x38c7a8[_0xf9a7('0x1e')]+'\x20'+parseOperator(_0x38c7a8[_0xf9a7('0x12')]);}if(_['includes']([_0xf9a7('0x20'),_0xf9a7('0x21')],_0x38c7a8[_0xf9a7('0x12')]))_0xceda1d[_0xf9a7('0x1c')]='('+_0xceda1d[_0xf9a7('0x1c')]+_0xf9a7('0x22')+_0x1a6c7a+'.'+_0x38c7a8[_0xf9a7('0x1e')]+_0xf9a7('0x23');_0xceda1d[_0xf9a7('0x17')]=parseValue(_0x2a22aa,_0x38c7a8[_0xf9a7('0x12')],_0x38c7a8['value']);return _0xceda1d;};function parseOperator(_0xc64b32){var _0xcdf3be;switch(_0xc64b32){case _0xf9a7('0x24'):_0xcdf3be=_0xf9a7('0x25');break;case _0xf9a7('0x21'):_0xcdf3be=_0xf9a7('0x26');break;case _0xf9a7('0x11'):_0xcdf3be='=\x20?';break;case _0xf9a7('0x20'):_0xcdf3be=_0xf9a7('0x27');break;case _0xf9a7('0x28'):case'$startsWith':case'$endsWith':_0xcdf3be=_0xf9a7('0x29');break;case _0xf9a7('0x2a'):_0xcdf3be=_0xf9a7('0x2b');break;case _0xf9a7('0x15'):_0xcdf3be=_0xf9a7('0x2c');break;case _0xf9a7('0x16'):_0xcdf3be=_0xf9a7('0x2d');break;case _0xf9a7('0x2e'):_0xcdf3be='>=\x20?';break;case _0xf9a7('0x13'):_0xcdf3be=_0xf9a7('0x2f');break;}return _0xcdf3be;}function parseValue(_0x3ba607,_0x28fba5,_0x228ed4){var _0x125d46={'start':undefined,'end':undefined};switch(_0x28fba5){case _0xf9a7('0x24'):case _0xf9a7('0x21'):_0x125d46[_0xf9a7('0x30')]=_0x228ed4[_0xf9a7('0x6')](',');break;case'$substring':_0x125d46['start']='%'+_0x228ed4+'%';break;case _0xf9a7('0x31'):_0x125d46[_0xf9a7('0x30')]=_0x228ed4+'%';break;case _0xf9a7('0x32'):_0x125d46[_0xf9a7('0x30')]='%'+_0x228ed4;break;case _0xf9a7('0x13'):var _0x50b8c0=_0x228ed4[_0xf9a7('0x6')](',');var _0x228ed4=_0x50b8c0[_0xf9a7('0xa')]();var _0x2dc05b=_0x50b8c0['pop']();if(_0x3ba607==='DATE'){_0x228ed4=moment(_0x228ed4)[_0xf9a7('0x33')](0x0,!![])['format']();_0x2dc05b=moment(_0x2dc05b)[_0xf9a7('0x33')](0x0,!![])[_0xf9a7('0x18')](0x17,'hours')[_0xf9a7('0x18')](0x3b,_0xf9a7('0x34'))['add'](0x3b,_0xf9a7('0x35'))[_0xf9a7('0x1a')]();}_0x125d46={'start':_0x228ed4,'end':_0x2dc05b};break;default:_0x125d46['start']=_0x228ed4;break;}return _0x125d46;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 98ba714..dc43943 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 _0x814b=['unset','hasOwnProperty','match','^[+]?[0-9]*$','replace','push','join','query','$id','model','attributes','offset','where','filter','object','VIRTUAL','lower','merge','options','lodash','sequelize','moment','keys','includes','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','cast','col','priority','unsigned','substr','DESC','ASC','omit','length','isObject','isString'];(function(_0x444c1c,_0x42db44){var _0x39ae49=function(_0x41a89f){while(--_0x41a89f){_0x444c1c['push'](_0x444c1c['shift']());}};_0x39ae49(++_0x42db44);}(_0x814b,0x1a2));var _0xb814=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x814b[_0xc5a279];return _0xc755d3;};'use strict';var _=require(_0xb814('0x0'));var sequelize=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2f4ece){var _0xfbb64b=['ne'];try{var _0x477725=JSON['parse'](_0x2f4ece);var _0x38c21a=Object[_0xb814('0x3')](_0x477725)[0x0];return _0xfbb64b[_0xb814('0x4')](_0x38c21a);}catch(_0x4237bc){return![];}}function getOperatorValue(_0x44931c){var _0x322a70=JSON['parse'](_0x44931c);var _0x3b0829=Object[_0xb814('0x3')](_0x322a70)[0x0];var _0x5c8539=_0x322a70[_0x3b0829];return{['$'+_0x3b0829]:_0x5c8539};}exports[_0xb814('0x5')]=function(_0x2913a6){var _0x186d5a=null;if(_0x2913a6){_0x186d5a=_0x2913a6[_0xb814('0x6')](',');}return _0x186d5a;};exports[_0xb814('0x7')]=function(_0x21d4a5,_0x1086f8){var _0x19aad8={};if(!_[_0xb814('0x8')](_0x21d4a5)){_[_0xb814('0x9')](_0x21d4a5,function(_0x10e4a6,_0x4b5f14){try{if(_0x1086f8){var _0x43dfe6=_['find'](_0x1086f8,{'name':_0x4b5f14})||{};if(hasSequelizeOperator(_0x10e4a6)){_0x19aad8[_0x4b5f14]=getOperatorValue(_0x10e4a6);}else if(_0x43dfe6[_0xb814('0xa')]===_0xb814('0xb')&&_[_0xb814('0xc')](_0x10e4a6)){var _0x2cc46b=JSON[_0xb814('0xd')](_0x10e4a6);var _0x3bde14={'$gte':moment(moment(_0x2cc46b[_0xb814('0xe')])[_0xb814('0xf')](_0xb814('0x10')))[_0xb814('0x11')]()[_0xb814('0xf')](),'$lte':moment(moment(_0x2cc46b[_0xb814('0x12')])[_0xb814('0xf')](_0xb814('0x10')))[_0xb814('0x11')]()[_0xb814('0x13')](0x1,'s')[_0xb814('0xf')]()};_0x19aad8[_0x4b5f14]=_0x3bde14;}else if(_0x43dfe6[_0xb814('0x14')]===_0xb814('0x15')){_0x19aad8[_0x4b5f14]=_0x10e4a6;}else{_0x19aad8[_0x4b5f14]=_[_0xb814('0x16')](_0x10e4a6)?_0x10e4a6:JSON[_0xb814('0xd')](_0x10e4a6);}}else{_0x19aad8[_0x4b5f14]=_['isArray'](_0x10e4a6)?_0x10e4a6:JSON[_0xb814('0xd')](_0x10e4a6);}}catch(_0x55ba16){_0x19aad8[_0x4b5f14]=_0x10e4a6[_0xb814('0x6')](',');}});}return _0x19aad8;};exports[_0xb814('0x17')]=function(_0x4c3007){_0x4c3007=parseInt(_0x4c3007,0xa);if(!_0x4c3007||_0x4c3007<0x0){_0x4c3007=LIMIT_VALUE;}return _0x4c3007;};exports['offset']=function(_0x55d63c){_0x55d63c=parseInt(_0x55d63c,0xa);if(!_0x55d63c||_0x55d63c<0x0){_0x55d63c=0x0;}return _0x55d63c;};exports[_0xb814('0x18')]=function(_0x4d5276){var _0x57c128,_0xb684ea=null;if(_0x4d5276){_0x57c128=_0x4d5276[_0xb814('0x6')](',');_0xb684ea=_[_0xb814('0x19')](_0x57c128,function(_0x4e139e){if(_0x4e139e[_0xb814('0x1a')]('-')===0x0){return[_0x4e139e==='priority'?sequelize[_0xb814('0x1b')](sequelize[_0xb814('0x1c')](_0xb814('0x1d')),_0xb814('0x1e')):_0x4e139e[_0xb814('0x1f')](0x1),_0xb814('0x20')];}else{return[_0x4e139e===_0xb814('0x1d')?sequelize['cast'](sequelize[_0xb814('0x1c')]('priority'),_0xb814('0x1e')):_0x4e139e,_0xb814('0x21')];}});}return _0xb684ea;};exports[_0xb814('0x22')]=function(_0x208927,_0x1c8a2e){if(_[_0xb814('0x8')](_0x208927)){return _0x208927;}if(_[_0xb814('0x16')](_0x208927)){for(var _0x5755ea=0x0;_0x5755ea<_0x208927[_0xb814('0x23')];_0x5755ea+=0x1){_0x208927[_0x5755ea]=this[_0xb814('0x22')](_0x208927[_0x5755ea],_0x1c8a2e);}return _0x208927;}if(!_[_0xb814('0x24')](_0x208927)){return _0x208927;}if(_[_0xb814('0x25')](_0x1c8a2e)){_0x1c8a2e=[_0x1c8a2e];}if(!_[_0xb814('0x16')](_0x1c8a2e)){return _0x208927;}for(var _0x1d5965=0x0;_0x1d5965<_0x1c8a2e[_0xb814('0x23')];_0x1d5965+=0x1){_[_0xb814('0x26')](_0x208927,_0x1c8a2e[_0x1d5965]);}for(var _0x5a6291 in _0x208927){if(_0x208927[_0xb814('0x27')](_0x5a6291)){_0x208927[_0x5a6291]=this[_0xb814('0x22')](_0x208927[_0x5a6291],_0x1c8a2e);}}return _0x208927;};exports['isNumeric']=function(_0x9008b2){return _0x9008b2[_0xb814('0x28')](RegExp(_0xb814('0x29')))?!![]:![];};exports['isEmail']=function(_0x20577b){return _0x20577b[_0xb814('0x28')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x338a28){var _0x526610=[];_0x338a28[_0xb814('0x6')](/[ ,]+/)['forEach'](function(_0x4cfc58){_0x4cfc58=_0x4cfc58[_0xb814('0x2a')](/([^:]")"+/g,'$1');_0x4cfc58='+'+_0x4cfc58+'*';var _0x4a4f27=/[ `!@#$%^&*()_\-?~]/;if(_0x4cfc58[_0xb814('0x28')](_0x4a4f27))_0x4cfc58='\x22'+_0x4cfc58+'\x22';_0x526610[_0xb814('0x2b')](_0x4cfc58);});return _0x526610[_0xb814('0x2c')]('\x20');};exports['getOptions']=function(_0x51d5ae,_0x26d3a9,_0x336e2b){var _0x523566={},_0x2c8943={};if(_0x26d3a9[_0xb814('0x2d')][_0xb814('0x2e')]){_0x26d3a9[_0xb814('0x2d')]['id']=_0x26d3a9[_0xb814('0x2d')][_0xb814('0x2e')];delete _0x26d3a9[_0xb814('0x2d')]['$id'];}_0x523566[_0xb814('0x2f')]=_[_0xb814('0x19')](_0x51d5ae,_0xb814('0x14'));_0x523566[_0xb814('0x2d')]=_[_0xb814('0x3')](_0x26d3a9['query']);_0x523566[_0xb814('0x7')]=_['intersection'](_0x523566[_0xb814('0x2f')],_0x523566[_0xb814('0x2d')]);_0x2c8943[_0xb814('0x30')]=_['intersection'](_0x523566[_0xb814('0x2f')],this[_0xb814('0x5')](_0x26d3a9['query'][_0xb814('0x5')]));_0x2c8943[_0xb814('0x30')]=_0x2c8943[_0xb814('0x30')][_0xb814('0x23')]?_0x2c8943[_0xb814('0x30')]:_0x523566[_0xb814('0x2f')];if(!_0x26d3a9['query'][_0xb814('0x27')]('nolimit')){_0x2c8943[_0xb814('0x17')]=this['limit'](_0x26d3a9[_0xb814('0x2d')]['limit']);_0x2c8943[_0xb814('0x31')]=this[_0xb814('0x31')](_0x26d3a9['query']['offset']);}_0x2c8943['order']=this['sort'](_0x26d3a9[_0xb814('0x2d')][_0xb814('0x18')]);_0x2c8943[_0xb814('0x32')]=this[_0xb814('0x7')](_['pick'](_0x26d3a9['query'],_0x523566[_0xb814('0x7')]),_0x51d5ae);if(_0x26d3a9['query'][_0xb814('0x33')]){var _0x1098eb=_0x51d5ae;var _0x178823=_0x26d3a9[_0xb814('0x2d')][_0xb814('0x33')];if(typeof _0x178823===_0xb814('0x34')){_0x1098eb=_[_0xb814('0x33')](_0x51d5ae,function(_0x28b2b4){return _[_0xb814('0x4')](_0x178823['columns'],_0x28b2b4['name']);});_0x178823=_0x178823['value'];}_0x2c8943[_0xb814('0x32')]=_['merge'](_0x2c8943[_0xb814('0x32')],{'$or':_['map'](_0x1098eb,function(_0x411723){if(_0x411723[_0xb814('0xa')]!==_0xb814('0x35')){if(_0x336e2b){return sequelize[_0xb814('0x32')](sequelize['fn']('lower',sequelize[_0xb814('0x1c')](_0x411723[_0xb814('0x14')])),{'$like':sequelize['fn'](_0xb814('0x36'),'%'+_0x26d3a9[_0xb814('0x2d')][_0xb814('0x33')]+'%')});}else{var _0x450a08={};_0x450a08[_0x411723['name']]={'$like':'%'+_0x26d3a9[_0xb814('0x2d')][_0xb814('0x33')]+'%'};return _0x450a08;}}})});}_0x2c8943=_[_0xb814('0x37')]({},_0x2c8943,_0x26d3a9[_0xb814('0x38')]);return _0x2c8943;}; \ No newline at end of file +var _0x207c=['forOwn','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','name','uniqueid','isArray','split','sort','map','indexOf','priority','cast','col','substr','unsigned','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','attributes','intersection','limit','offset','order','filter','object','columns','value','where','merge','type','VIRTUAL','lower','options','sequelize','moment','parse','includes','keys','fields','filters','isEmpty'];(function(_0x32c6a7,_0x74f931){var _0x305ebb=function(_0x29c38f){while(--_0x29c38f){_0x32c6a7['push'](_0x32c6a7['shift']());}};_0x305ebb(++_0x74f931);}(_0x207c,0x1e8));var _0xc207=function(_0x50d086,_0x4e96e0){_0x50d086=_0x50d086-0x0;var _0x2e9e27=_0x207c[_0x50d086];return _0x2e9e27;};'use strict';var _=require('lodash');var sequelize=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1a420a){var _0xaaba3d=['ne'];try{var _0x2b40be=JSON[_0xc207('0x2')](_0x1a420a);var _0x1dd107=Object['keys'](_0x2b40be)[0x0];return _0xaaba3d[_0xc207('0x3')](_0x1dd107);}catch(_0x59bc89){return![];}}function getOperatorValue(_0x5a727b){var _0x55023e=JSON[_0xc207('0x2')](_0x5a727b);var _0x314561=Object[_0xc207('0x4')](_0x55023e)[0x0];var _0x59ff6f=_0x55023e[_0x314561];return{['$'+_0x314561]:_0x59ff6f};}exports[_0xc207('0x5')]=function(_0xad159b){var _0x3c579f=null;if(_0xad159b){_0x3c579f=_0xad159b['split'](',');}return _0x3c579f;};exports[_0xc207('0x6')]=function(_0x817576,_0x216e14){var _0x13ec41={};if(!_[_0xc207('0x7')](_0x817576)){_[_0xc207('0x8')](_0x817576,function(_0x487d95,_0x574425){try{if(_0x216e14){var _0x5b556f=_[_0xc207('0x9')](_0x216e14,{'name':_0x574425})||{};if(hasSequelizeOperator(_0x487d95)){_0x13ec41[_0x574425]=getOperatorValue(_0x487d95);}else if(_0x5b556f['type']===_0xc207('0xa')&&_[_0xc207('0xb')](_0x487d95)){var _0x59d401=JSON[_0xc207('0x2')](_0x487d95);var _0xb86b06={'$gte':moment(moment(_0x59d401[_0xc207('0xc')])[_0xc207('0xd')](_0xc207('0xe')))['utc']()[_0xc207('0xd')](),'$lte':moment(moment(_0x59d401[_0xc207('0xf')])[_0xc207('0xd')](_0xc207('0xe')))['utc']()['subtract'](0x1,'s')['format']()};_0x13ec41[_0x574425]=_0xb86b06;}else if(_0x5b556f[_0xc207('0x10')]===_0xc207('0x11')){_0x13ec41[_0x574425]=_0x487d95;}else{_0x13ec41[_0x574425]=_[_0xc207('0x12')](_0x487d95)?_0x487d95:JSON[_0xc207('0x2')](_0x487d95);}}else{_0x13ec41[_0x574425]=_['isArray'](_0x487d95)?_0x487d95:JSON[_0xc207('0x2')](_0x487d95);}}catch(_0x282595){_0x13ec41[_0x574425]=_0x487d95[_0xc207('0x13')](',');}});}return _0x13ec41;};exports['limit']=function(_0x4129b8){_0x4129b8=parseInt(_0x4129b8,0xa);if(!_0x4129b8||_0x4129b8<0x0){_0x4129b8=LIMIT_VALUE;}return _0x4129b8;};exports['offset']=function(_0x42c8ba){_0x42c8ba=parseInt(_0x42c8ba,0xa);if(!_0x42c8ba||_0x42c8ba<0x0){_0x42c8ba=0x0;}return _0x42c8ba;};exports[_0xc207('0x14')]=function(_0x131dc8){var _0x461f6a,_0xce0770=null;if(_0x131dc8){_0x461f6a=_0x131dc8[_0xc207('0x13')](',');_0xce0770=_[_0xc207('0x15')](_0x461f6a,function(_0x464dea){if(_0x464dea[_0xc207('0x16')]('-')===0x0){return[_0x464dea===_0xc207('0x17')?sequelize[_0xc207('0x18')](sequelize[_0xc207('0x19')](_0xc207('0x17')),'unsigned'):_0x464dea[_0xc207('0x1a')](0x1),'DESC'];}else{return[_0x464dea===_0xc207('0x17')?sequelize[_0xc207('0x18')](sequelize[_0xc207('0x19')](_0xc207('0x17')),_0xc207('0x1b')):_0x464dea,_0xc207('0x1c')];}});}return _0xce0770;};exports[_0xc207('0x1d')]=function(_0x1493fb,_0xa52138){if(_[_0xc207('0x7')](_0x1493fb)){return _0x1493fb;}if(_[_0xc207('0x12')](_0x1493fb)){for(var _0x27df03=0x0;_0x27df03<_0x1493fb[_0xc207('0x1e')];_0x27df03+=0x1){_0x1493fb[_0x27df03]=this[_0xc207('0x1d')](_0x1493fb[_0x27df03],_0xa52138);}return _0x1493fb;}if(!_[_0xc207('0x1f')](_0x1493fb)){return _0x1493fb;}if(_['isString'](_0xa52138)){_0xa52138=[_0xa52138];}if(!_[_0xc207('0x12')](_0xa52138)){return _0x1493fb;}for(var _0x5e0bd1=0x0;_0x5e0bd1<_0xa52138['length'];_0x5e0bd1+=0x1){_[_0xc207('0x20')](_0x1493fb,_0xa52138[_0x5e0bd1]);}for(var _0x3a05f3 in _0x1493fb){if(_0x1493fb[_0xc207('0x21')](_0x3a05f3)){_0x1493fb[_0x3a05f3]=this[_0xc207('0x1d')](_0x1493fb[_0x3a05f3],_0xa52138);}}return _0x1493fb;};exports[_0xc207('0x22')]=function(_0x478af7){return _0x478af7[_0xc207('0x23')](RegExp(_0xc207('0x24')))?!![]:![];};exports[_0xc207('0x25')]=function(_0x1bec3f){return _0x1bec3f[_0xc207('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xc207('0x26')]=function(_0x2e6a3e){var _0x27bc72=[];_0x2e6a3e[_0xc207('0x13')](/[ ,]+/)[_0xc207('0x27')](function(_0x2043cf){_0x2043cf=_0x2043cf[_0xc207('0x28')](/([^:]")"+/g,'$1');_0x2043cf='+'+_0x2043cf+'*';var _0x3cd4b4=/[ `!@#$%^&*()_\-?~]/;if(_0x2043cf['match'](_0x3cd4b4))_0x2043cf='\x22'+_0x2043cf+'\x22';_0x27bc72[_0xc207('0x29')](_0x2043cf);});return _0x27bc72[_0xc207('0x2a')]('\x20');};exports[_0xc207('0x2b')]=function(_0x448df1,_0x24df00,_0x2ce133){var _0x47d4c9={},_0x18bf7e={};if(_0x24df00[_0xc207('0x2c')][_0xc207('0x2d')]){_0x24df00[_0xc207('0x2c')]['id']=_0x24df00['query'][_0xc207('0x2d')];delete _0x24df00[_0xc207('0x2c')][_0xc207('0x2d')];}_0x47d4c9[_0xc207('0x2e')]=_[_0xc207('0x15')](_0x448df1,_0xc207('0x10'));_0x47d4c9[_0xc207('0x2c')]=_[_0xc207('0x4')](_0x24df00[_0xc207('0x2c')]);_0x47d4c9['filters']=_['intersection'](_0x47d4c9[_0xc207('0x2e')],_0x47d4c9[_0xc207('0x2c')]);_0x18bf7e[_0xc207('0x2f')]=_[_0xc207('0x30')](_0x47d4c9['model'],this[_0xc207('0x5')](_0x24df00[_0xc207('0x2c')][_0xc207('0x5')]));_0x18bf7e[_0xc207('0x2f')]=_0x18bf7e[_0xc207('0x2f')]['length']?_0x18bf7e[_0xc207('0x2f')]:_0x47d4c9[_0xc207('0x2e')];if(!_0x24df00['query'][_0xc207('0x21')]('nolimit')){_0x18bf7e[_0xc207('0x31')]=this[_0xc207('0x31')](_0x24df00['query'][_0xc207('0x31')]);_0x18bf7e[_0xc207('0x32')]=this[_0xc207('0x32')](_0x24df00['query']['offset']);}_0x18bf7e[_0xc207('0x33')]=this[_0xc207('0x14')](_0x24df00[_0xc207('0x2c')][_0xc207('0x14')]);_0x18bf7e['where']=this[_0xc207('0x6')](_['pick'](_0x24df00['query'],_0x47d4c9['filters']),_0x448df1);if(_0x24df00['query'][_0xc207('0x34')]){var _0x370d0d=_0x448df1;var _0xdde267=_0x24df00['query'][_0xc207('0x34')];if(typeof _0xdde267===_0xc207('0x35')){_0x370d0d=_[_0xc207('0x34')](_0x448df1,function(_0x5ae1ab){return _['includes'](_0xdde267[_0xc207('0x36')],_0x5ae1ab[_0xc207('0x10')]);});_0xdde267=_0xdde267[_0xc207('0x37')];}_0x18bf7e[_0xc207('0x38')]=_[_0xc207('0x39')](_0x18bf7e['where'],{'$or':_[_0xc207('0x15')](_0x370d0d,function(_0x19a67d){if(_0x19a67d[_0xc207('0x3a')]!==_0xc207('0x3b')){if(_0x2ce133){return sequelize[_0xc207('0x38')](sequelize['fn'](_0xc207('0x3c'),sequelize[_0xc207('0x19')](_0x19a67d[_0xc207('0x10')])),{'$like':sequelize['fn'](_0xc207('0x3c'),'%'+_0x24df00['query'][_0xc207('0x34')]+'%')});}else{var _0x16ed4f={};_0x16ed4f[_0x19a67d['name']]={'$like':'%'+_0x24df00[_0xc207('0x2c')][_0xc207('0x34')]+'%'};return _0x16ed4f;}}})});}_0x18bf7e=_[_0xc207('0x39')]({},_0x18bf7e,_0x24df00[_0xc207('0x3d')]);return _0x18bf7e;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index f0d7e0b..d0fe6f1 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ea=['mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','lodash','client','http','chatPause','faxPause','mailPause','smsPause','whatsappPause','every','filter','length','idle','ringing','voicePause','voiceStatus','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','unknown','pause','getAgentStatus','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','busy','getAgentIdsByStatus','includes','User','fullname','openchannelPause','pauseType','find','globalStatus','split','startsWith','ASC','internal','substring','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','openchannelCurrentCapacity'];(function(_0x19382f,_0x1da665){var _0x4c0b4d=function(_0x514a85){while(--_0x514a85){_0x19382f['push'](_0x19382f['shift']());}};_0x4c0b4d(++_0x1da665);}(_0x02ea,0x1c4));var _0xa02e=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x02ea[_0x2ce6d5];return _0x32d272;};'use strict';var _=require(_0xa02e('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xa02e('0x1')]['http']({'port':0x232a});var routingClient=jayson[_0xa02e('0x1')][_0xa02e('0x2')]({'port':0x232c});function isAgentPaused(_0x4fe342,_0x4735e4){var _0x4355b6=[_0x4fe342[_0xa02e('0x3')],_0x4fe342[_0xa02e('0x4')],_0x4fe342[_0xa02e('0x5')],_0x4fe342['openchannelPause'],_0x4fe342[_0xa02e('0x6')],_0x4fe342['voicePause'],_0x4fe342[_0xa02e('0x7')]];if(!_0x4735e4)return _[_0xa02e('0x8')](_0x4355b6);var _0x130334=_[_0xa02e('0x9')](_0x4355b6);return _0x130334[_0xa02e('0xa')]>0x0&&_0x130334[_0xa02e('0xa')]<_0x4355b6[_0xa02e('0xa')]?!![]:![];}function isIdle(_0x487744){return _0x487744===_0xa02e('0xb')||_0x487744==='unknown'||_0x487744==='unavailable'||_0x487744===_0xa02e('0xc')||_['isNil'](_0x487744);}function isAgentIdle(_0x45c405){if(_0x45c405['voiceStatus']!=='idle'&&_0x45c405[_0xa02e('0xd')]){_0x45c405[_0xa02e('0xe')]='pause';return![];}return _[_0xa02e('0x8')]([_0x45c405[_0xa02e('0xf')],_0x45c405[_0xa02e('0x10')],_0x45c405[_0xa02e('0x11')],_0x45c405[_0xa02e('0x12')],_0x45c405[_0xa02e('0x13')],_0x45c405[_0xa02e('0xe')],_0x45c405[_0xa02e('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa02e('0x15')](_0xa02e('0x16'),{})[_0xa02e('0x17')](function(_0x5a027b){if(_0x5a027b[_0xa02e('0x18')]){throw new Error(_0xa02e('0x19'));}var _0xb7f613=_0x5a027b[_0xa02e('0x1a')];return routingClient['request'](_0xa02e('0x16'),{})[_0xa02e('0x17')](function(_0x9d6a0){if(_0x9d6a0[_0xa02e('0x18')]){throw new Error(_0xa02e('0x1b'));}var _0x4d59b9=_0x9d6a0[_0xa02e('0x1a')];return _[_0xa02e('0x1c')]({},_0xb7f613,_0x4d59b9);});})[_0xa02e('0x1d')](function(_0x469ba8){throw _0x469ba8;});}exports[_0xa02e('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x10345d){var _0x26b591=_0xa02e('0x1f');if(isAgentPaused(_0x10345d))_0x26b591=_0xa02e('0x20');else if(isAgentPaused(_0x10345d,!![]))_0x26b591='*pause';else if(isAgentIdle(_0x10345d))_0x26b591=_0xa02e('0xb');else _0x26b591='busy';return _0x26b591;}exports[_0xa02e('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x2875aa,_0x5807c1){var _0x6dc078=_['isArray'](_0x2875aa)?_0x2875aa:[_0x2875aa];var _0x3eb6e1=_['startCase'](_0x5807c1)+_0xa02e('0x22');var _0x226be4=_[_0xa02e('0x23')](_0x6dc078,function(_0x1ff788){return db[_0x3eb6e1][_0xa02e('0x24')]({'where':{'id':_0x1ff788}})[_0xa02e('0x17')](function(_0xee36bd){if(!_0xee36bd)return[];return _0xee36bd[_0xa02e('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa02e('0x26')](_0x226be4)[_0xa02e('0x17')](function(_0x26f94e){var _0x3b3d27=_(_0x26f94e)[_0xa02e('0x27')]()[_0xa02e('0x23')]('id')[_0xa02e('0x28')]()[_0xa02e('0x29')]();return _0x3b3d27;});}exports[_0xa02e('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x52fc9e,_0x51aef1,_0x404260){try{if(_0x51aef1[_0xa02e('0xa')]>0x0){_0x52fc9e=_0x52fc9e[_0xa02e('0x9')](function(_0x1c5d4d){return _0x51aef1['includes'](_0x1c5d4d['id']);});}var _0x5b1a53=_0x52fc9e[_0xa02e('0x9')](function(_0x353530){var _0x40c8a1=_0xa02e('0x2b');if(isAgentIdle(_0x353530)){_0x40c8a1=_0xa02e('0xb');}return _0x40c8a1===_0x404260;});return _[_0xa02e('0x23')](_0x5b1a53,'id');}catch(_0x3b7b69){throw _0x3b7b69;}}exports[_0xa02e('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x149a47,_0x5b91f8,_0x57f0d5){return Promise['resolve']()[_0xa02e('0x17')](function(){if(_0x5b91f8['length']>0x0){_0x149a47=_0x149a47[_0xa02e('0x9')](function(_0x1d9132){return _0x5b91f8[_0xa02e('0x2d')](_0x1d9132['id']);});}return _0x149a47;})[_0xa02e('0x17')](function(){return db[_0xa02e('0x2e')]['findAll']({'attributes':['id','name',_0xa02e('0x2f'),_0xa02e('0x3'),_0xa02e('0x4'),'mailPause',_0xa02e('0x30'),'smsPause',_0xa02e('0xd'),_0xa02e('0x7'),_0xa02e('0x31')],'where':{'id':{'$in':_[_0xa02e('0x23')](_0x149a47,'id')}},'raw':!![]});})[_0xa02e('0x17')](function(_0x349785){return _0x349785['map'](function(_0x2f120a){var _0x15b525=_[_0xa02e('0x32')](_0x149a47,['id',_0x2f120a['id']]);var _0x193f3f=filterAgentAttributes(_0x15b525);_['merge'](_0x2f120a,_0x193f3f);_0x2f120a[_0xa02e('0x33')]=getAgentStatus(_0x2f120a);return _0x2f120a;});})[_0xa02e('0x17')](function(_0x595071){var _0x3e02d3=sortAgentsByStatus(_0x595071,_0x57f0d5);return _[_0xa02e('0x23')](_0x3e02d3,'id');})['catch'](function(_0x30df98){throw _0x30df98;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3ced45){var _0xe3ad5e={'fields':[],'order':null};var _0xe08070=_0x3ced45[_0xa02e('0x34')](',');_0xe3ad5e['fields']=_['filter'](_0xe08070,function(_0x3aceed){if(!_0x3aceed[_0xa02e('0x2d')](_0xa02e('0x33'))){return!![];}_0xe3ad5e['order']=_[_0xa02e('0x35')](_0x3aceed,'-')?'DESC':_0xa02e('0x36');return![];});return _0xe3ad5e;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x4344b2){if(_0x4344b2['includes'](_0xa02e('0x2f'))&&!_0x4344b2[_0xa02e('0x2d')](_0xa02e('0x37'))){var _0x53327d=_0x4344b2[_0xa02e('0x38')](0x0,_0x4344b2['indexOf'](_0xa02e('0x2f')));_0x4344b2+=','+_0x53327d+_0xa02e('0x37');}return _0x4344b2;}exports[_0xa02e('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x232dcd,_0x5a643f){var _0x2e69c2=_0x232dcd[_0xa02e('0x3a')](function(_0x495fdf,_0x59489d){if(_0x495fdf['globalStatus']===_0x59489d[_0xa02e('0x33')]){if(_0x495fdf['globalStatus']==='pause'){if(_0x5a643f===_0xa02e('0x3b')){return(_0x495fdf['pauseType']||'')<(_0x59489d[_0xa02e('0x31')]||'')||_0x495fdf[_0xa02e('0x2f')][_0xa02e('0x3c')]()>_0x59489d[_0xa02e('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return(_0x495fdf[_0xa02e('0x31')]||'')<(_0x59489d[_0xa02e('0x31')]||'')||_0x495fdf['fullname'][_0xa02e('0x3c')]()>_0x59489d[_0xa02e('0x2f')][_0xa02e('0x3c')]()?-0x1:0x1;}}else{if(_0x5a643f===_0xa02e('0x3b')){return _0x495fdf[_0xa02e('0x2f')][_0xa02e('0x3c')]()<_0x59489d[_0xa02e('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return _0x495fdf[_0xa02e('0x2f')]['toLowerCase']()<_0x59489d[_0xa02e('0x2f')][_0xa02e('0x3c')]()?-0x1:0x1;}}}else{if(_0x5a643f==='DESC'){return _0x495fdf[_0xa02e('0x33')]<_0x59489d[_0xa02e('0x33')]?0x1:-0x1;}else{return _0x495fdf[_0xa02e('0x33')]<_0x59489d[_0xa02e('0x33')]?-0x1:0x1;}}});return _0x2e69c2;}exports[_0xa02e('0x3d')]=sortAgentsByStatus;function filterAgentAttributes(_0x29be86){var _0x5192fa=[_0xa02e('0x3e'),'online',_0xa02e('0x3f'),_0xa02e('0x40'),'pauseType',_0xa02e('0x40'),'internal','address',_0xa02e('0x3'),_0xa02e('0x30'),'mailPause',_0xa02e('0x6'),_0xa02e('0x7'),_0xa02e('0x4'),_0xa02e('0xd'),_0xa02e('0x41'),_0xa02e('0x42'),_0xa02e('0x43'),'smsCapacity','whatsappCapacity',_0xa02e('0x44'),'chatCurrentCapacity',_0xa02e('0x45'),_0xa02e('0x46'),_0xa02e('0x47'),_0xa02e('0x48'),_0xa02e('0x49'),'chatStatus',_0xa02e('0x12'),_0xa02e('0x11'),_0xa02e('0x13'),_0xa02e('0x14'),_0xa02e('0x10'),'voiceStatus',_0xa02e('0x4a'),_0xa02e('0x4b'),'mailStatusTime',_0xa02e('0x4c'),'whatsappStatusTime',_0xa02e('0x4d'),_0xa02e('0x4e'),_0xa02e('0x4f'),'destconnectedlinenum',_0xa02e('0x50'),_0xa02e('0x51'),_0xa02e('0x52'),_0xa02e('0x53')];var _0x1ea256=[_0xa02e('0x3'),_0xa02e('0x30'),_0xa02e('0x5'),_0xa02e('0x6'),_0xa02e('0x7'),_0xa02e('0x4'),_0xa02e('0xd'),_0xa02e('0x54')];var _0x12f95e=_(_0x29be86)[_0xa02e('0x55')](_0x1ea256)[_0xa02e('0x56')](_0x5192fa)[_0xa02e('0x29')]();return _0x12f95e;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x8d93=['indexOf','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','internal','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','filterAgentAttributes','lodash','jayson/promise','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','ringing','isNil','voiceStatus','pause','every','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','*pause','startCase','Queue','flatten','map','uniq','value','includes','getAgentIdsByStatus','resolve','User','name','fullname','openchannelPause','pauseType','find','globalStatus','split','fields','startsWith','ASC','substring'];(function(_0x4cb557,_0x1d326d){var _0xccd0c2=function(_0x53b1e6){while(--_0x53b1e6){_0x4cb557['push'](_0x4cb557['shift']());}};_0xccd0c2(++_0x1d326d);}(_0x8d93,0xd6));var _0x38d9=function(_0x2b3478,_0x58afd7){_0x2b3478=_0x2b3478-0x0;var _0x1c106f=_0x8d93[_0x2b3478];return _0x1c106f;};'use strict';var _=require(_0x38d9('0x0'));var jayson=require(_0x38d9('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x38d9('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0x38d9('0x2')][_0x38d9('0x3')]({'port':0x232c});function isAgentPaused(_0x1c8da9,_0x105167){var _0x41db35=[_0x1c8da9[_0x38d9('0x4')],_0x1c8da9[_0x38d9('0x5')],_0x1c8da9[_0x38d9('0x6')],_0x1c8da9['openchannelPause'],_0x1c8da9[_0x38d9('0x7')],_0x1c8da9[_0x38d9('0x8')],_0x1c8da9[_0x38d9('0x9')]];if(!_0x105167)return _['every'](_0x41db35);var _0x1069d9=_[_0x38d9('0xa')](_0x41db35);return _0x1069d9['length']>0x0&&_0x1069d9[_0x38d9('0xb')]<_0x41db35[_0x38d9('0xb')]?!![]:![];}function isIdle(_0xfe11d7){return _0xfe11d7===_0x38d9('0xc')||_0xfe11d7===_0x38d9('0xd')||_0xfe11d7==='unavailable'||_0xfe11d7===_0x38d9('0xe')||_[_0x38d9('0xf')](_0xfe11d7);}function isAgentIdle(_0x44ecf5){if(_0x44ecf5[_0x38d9('0x10')]!==_0x38d9('0xc')&&_0x44ecf5['voicePause']){_0x44ecf5[_0x38d9('0x10')]=_0x38d9('0x11');return![];}return _[_0x38d9('0x12')]([_0x44ecf5[_0x38d9('0x13')],_0x44ecf5['faxStatus'],_0x44ecf5[_0x38d9('0x14')],_0x44ecf5[_0x38d9('0x15')],_0x44ecf5[_0x38d9('0x16')],_0x44ecf5[_0x38d9('0x10')],_0x44ecf5[_0x38d9('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x38d9('0x18')]('Agents',{})[_0x38d9('0x19')](function(_0x537b1e){if(_0x537b1e[_0x38d9('0x1a')]){throw new Error(_0x38d9('0x1b'));}var _0x41fb87=_0x537b1e['result'];return routingClient[_0x38d9('0x18')](_0x38d9('0x1c'),{})[_0x38d9('0x19')](function(_0x27e1b8){if(_0x27e1b8[_0x38d9('0x1a')]){throw new Error(_0x38d9('0x1d'));}var _0xf17f7e=_0x27e1b8[_0x38d9('0x1e')];return _[_0x38d9('0x1f')]({},_0x41fb87,_0xf17f7e);});})[_0x38d9('0x20')](function(_0x4f23ab){throw _0x4f23ab;});}exports[_0x38d9('0x21')]=getRealtimeAgents;function getAgentStatus(_0x1cbf17){var _0x1b9b45=_0x38d9('0xd');if(isAgentPaused(_0x1cbf17))_0x1b9b45=_0x38d9('0x11');else if(isAgentPaused(_0x1cbf17,!![]))_0x1b9b45=_0x38d9('0x22');else if(isAgentIdle(_0x1cbf17))_0x1b9b45=_0x38d9('0xc');else _0x1b9b45='busy';return _0x1b9b45;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x14ff2e,_0x2cb16b){var _0x3cccf7=_['isArray'](_0x14ff2e)?_0x14ff2e:[_0x14ff2e];var _0xc30ea9=_[_0x38d9('0x23')](_0x2cb16b)+_0x38d9('0x24');var _0x1b651f=_['map'](_0x3cccf7,function(_0x51b942){return db[_0xc30ea9]['findOne']({'where':{'id':_0x51b942}})['then'](function(_0x41b62b){if(!_0x41b62b)return[];return _0x41b62b['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x1b651f)[_0x38d9('0x19')](function(_0x163c32){var _0x5342e8=_(_0x163c32)[_0x38d9('0x25')]()[_0x38d9('0x26')]('id')[_0x38d9('0x27')]()[_0x38d9('0x28')]();return _0x5342e8;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3ecccf,_0x1aabb0,_0x369dbe){try{if(_0x1aabb0[_0x38d9('0xb')]>0x0){_0x3ecccf=_0x3ecccf['filter'](function(_0x543484){return _0x1aabb0[_0x38d9('0x29')](_0x543484['id']);});}var _0x5d0565=_0x3ecccf['filter'](function(_0x40072a){var _0x128c80='busy';if(isAgentIdle(_0x40072a)){_0x128c80='idle';}return _0x128c80===_0x369dbe;});return _[_0x38d9('0x26')](_0x5d0565,'id');}catch(_0xe107f0){throw _0xe107f0;}}exports[_0x38d9('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x22960b,_0x5af11c,_0x593180){return Promise[_0x38d9('0x2b')]()[_0x38d9('0x19')](function(){if(_0x5af11c[_0x38d9('0xb')]>0x0){_0x22960b=_0x22960b[_0x38d9('0xa')](function(_0x4cb56e){return _0x5af11c[_0x38d9('0x29')](_0x4cb56e['id']);});}return _0x22960b;})[_0x38d9('0x19')](function(){return db[_0x38d9('0x2c')]['findAll']({'attributes':['id',_0x38d9('0x2d'),_0x38d9('0x2e'),_0x38d9('0x4'),_0x38d9('0x5'),_0x38d9('0x6'),_0x38d9('0x2f'),_0x38d9('0x7'),_0x38d9('0x8'),_0x38d9('0x9'),_0x38d9('0x30')],'where':{'id':{'$in':_[_0x38d9('0x26')](_0x22960b,'id')}},'raw':!![]});})['then'](function(_0x13cab3){return _0x13cab3[_0x38d9('0x26')](function(_0x9baf94){var _0x3dc704=_[_0x38d9('0x31')](_0x22960b,['id',_0x9baf94['id']]);var _0x488976=filterAgentAttributes(_0x3dc704);_[_0x38d9('0x1f')](_0x9baf94,_0x488976);_0x9baf94[_0x38d9('0x32')]=getAgentStatus(_0x9baf94);return _0x9baf94;});})[_0x38d9('0x19')](function(_0x1cc21e){var _0x2d15b4=sortAgentsByStatus(_0x1cc21e,_0x593180);return _[_0x38d9('0x26')](_0x2d15b4,'id');})[_0x38d9('0x20')](function(_0x2e9a1a){throw _0x2e9a1a;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3aef2d){var _0xb84373={'fields':[],'order':null};var _0x3f7dcf=_0x3aef2d[_0x38d9('0x33')](',');_0xb84373[_0x38d9('0x34')]=_[_0x38d9('0xa')](_0x3f7dcf,function(_0x3aeeb9){if(!_0x3aeeb9[_0x38d9('0x29')](_0x38d9('0x32'))){return!![];}_0xb84373['order']=_[_0x38d9('0x35')](_0x3aeeb9,'-')?'DESC':_0x38d9('0x36');return![];});return _0xb84373;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x103d3e){if(_0x103d3e[_0x38d9('0x29')](_0x38d9('0x2e'))&&!_0x103d3e[_0x38d9('0x29')]('internal')){var _0x2c14a4=_0x103d3e[_0x38d9('0x37')](0x0,_0x103d3e[_0x38d9('0x38')](_0x38d9('0x2e')));_0x103d3e+=','+_0x2c14a4+'internal';}return _0x103d3e;}exports[_0x38d9('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x12e44d,_0x3a6f64){var _0x581e21=_0x12e44d[_0x38d9('0x3a')](function(_0x44fc13,_0x50c31a){if(_0x44fc13['globalStatus']===_0x50c31a[_0x38d9('0x32')]){if(_0x44fc13[_0x38d9('0x32')]===_0x38d9('0x11')){if(_0x3a6f64===_0x38d9('0x3b')){return(_0x44fc13[_0x38d9('0x30')]||'')<(_0x50c31a[_0x38d9('0x30')]||'')||_0x44fc13[_0x38d9('0x2e')][_0x38d9('0x3c')]()>_0x50c31a[_0x38d9('0x2e')][_0x38d9('0x3c')]()?0x1:-0x1;}else{return(_0x44fc13[_0x38d9('0x30')]||'')<(_0x50c31a[_0x38d9('0x30')]||'')||_0x44fc13[_0x38d9('0x2e')]['toLowerCase']()>_0x50c31a[_0x38d9('0x2e')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x3a6f64===_0x38d9('0x3b')){return _0x44fc13[_0x38d9('0x2e')][_0x38d9('0x3c')]()<_0x50c31a[_0x38d9('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return _0x44fc13['fullname'][_0x38d9('0x3c')]()<_0x50c31a[_0x38d9('0x2e')][_0x38d9('0x3c')]()?-0x1:0x1;}}}else{if(_0x3a6f64==='DESC'){return _0x44fc13[_0x38d9('0x32')]<_0x50c31a['globalStatus']?0x1:-0x1;}else{return _0x44fc13[_0x38d9('0x32')]<_0x50c31a[_0x38d9('0x32')]?-0x1:0x1;}}});return _0x581e21;}exports[_0x38d9('0x3d')]=sortAgentsByStatus;function filterAgentAttributes(_0x12c03a){var _0xae9746=[_0x38d9('0x3e'),'online',_0x38d9('0x3f'),_0x38d9('0x40'),'pauseType',_0x38d9('0x40'),_0x38d9('0x41'),_0x38d9('0x42'),_0x38d9('0x4'),_0x38d9('0x2f'),'mailPause',_0x38d9('0x7'),_0x38d9('0x9'),_0x38d9('0x5'),_0x38d9('0x8'),_0x38d9('0x43'),'openchannelCapacity',_0x38d9('0x44'),_0x38d9('0x45'),_0x38d9('0x46'),_0x38d9('0x47'),_0x38d9('0x48'),_0x38d9('0x49'),_0x38d9('0x4a'),_0x38d9('0x4b'),_0x38d9('0x4c'),_0x38d9('0x4d'),_0x38d9('0x13'),_0x38d9('0x15'),_0x38d9('0x14'),_0x38d9('0x16'),_0x38d9('0x17'),'faxStatus',_0x38d9('0x10'),'chatStatusTime',_0x38d9('0x4e'),_0x38d9('0x4f'),'smsStatusTime','whatsappStatusTime',_0x38d9('0x50'),_0x38d9('0x51'),_0x38d9('0x52'),_0x38d9('0x53'),'screenrecording',_0x38d9('0x54'),_0x38d9('0x55'),_0x38d9('0x56')];var _0x5348a6=[_0x38d9('0x4'),'openchannelPause','mailPause',_0x38d9('0x7'),_0x38d9('0x9'),'faxPause',_0x38d9('0x8'),_0x38d9('0x57')];var _0x397a4b=_(_0x12c03a)[_0x38d9('0x58')](_0x5348a6)['pick'](_0xae9746)['value']();return _0x397a4b;}exports[_0x38d9('0x59')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 7ea9315..9d52292 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4f004f,_0x3ec1ca){var _0x3cd3bf=function(_0x3e7ad8){while(--_0x3e7ad8){_0x4f004f['push'](_0x4f004f['shift']());}};_0x3cd3bf(++_0x3ec1ca);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x599be2,_0x452992){var _0x9a9f96=function(_0x1e3316){while(--_0x1e3316){_0x599be2['push'](_0x599be2['shift']());}};_0x9a9f96(++_0x452992);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 54fc427..d70bc2f 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 _0x28e2=['filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','orderBy','cpus','map','model','createHash','md5','update','digest','hex','getUuid','licenseToken','win32','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','length'];(function(_0x53ceef,_0x38c0f0){var _0x257980=function(_0x2dd67d){while(--_0x2dd67d){_0x53ceef['push'](_0x53ceef['shift']());}};_0x257980(++_0x38c0f0);}(_0x28e2,0x143));var _0x228e=function(_0x470fad,_0x24e8ad){_0x470fad=_0x470fad-0x0;var _0x106d4f=_0x28e2[_0x470fad];return _0x106d4f;};'use strict';var _=require(_0x228e('0x0'));var os=require('os');var crypto=require(_0x228e('0x1'));var machine=require(_0x228e('0x2'));var exec=require(_0x228e('0x3'))['execSync'];var config=require(_0x228e('0x4'));function getInterfaces(){var _0x48e6df=[];var _0x267f3c=os[_0x228e('0x5')]();var _0x21e7f1=_['orderBy'](_['keys'](_0x267f3c));for(var _0x7102ac=0x0;_0x7102ac<_0x21e7f1[_0x228e('0x6')];_0x7102ac++){var _0x2b0778=_0x267f3c[_0x21e7f1[_0x7102ac]][_0x228e('0x7')](function(_0x59e0e7){return _0x59e0e7[_0x228e('0x8')]===_0x228e('0x9')&&_0x59e0e7[_0x228e('0xa')]===![];});_0x48e6df=_0x48e6df[_0x228e('0xb')](_0x2b0778);}return _0x48e6df;}function getFirstInterface(){var _0x5592f1=_['head'](getInterfaces());return{'macAddress':_0x5592f1&&_0x5592f1[_0x228e('0xc')]?_0x5592f1['mac']:_0x228e('0xd'),'ipAddress':_0x5592f1&&_0x5592f1[_0x228e('0xe')]?_0x5592f1[_0x228e('0xe')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x15d797=_[_0x228e('0xf')](os[_0x228e('0x10')]()[_0x228e('0x11')](function(_0x56ced7){return _0x56ced7[_0x228e('0x12')];}))['join'](':');return crypto[_0x228e('0x13')](_0x228e('0x14'))[_0x228e('0x15')](_0x15d797)[_0x228e('0x16')](_0x228e('0x17'));}exports[_0x228e('0x18')]=function(){var _0x374b69=os['platform']();var _0x57e63f=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x57e63f['test'](config[_0x228e('0x19')])){return config[_0x228e('0x19')];}else if(_0x374b69===_0x228e('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x228e('0x1b')})[_0x228e('0x1c')]('\x0d\x0a','');}else{var _0x5c6718=getFirstInterface();var _0xb09438=getCPUhash();var _0x1ecc39=_0xb09438+'|'+os[_0x228e('0x1d')]()+'|'+_0x5c6718[_0x228e('0x1e')]+'|'+_0x5c6718[_0x228e('0x1f')];var _0x47e4e8=crypto[_0x228e('0x13')](_0x228e('0x14'))[_0x228e('0x15')](_0x1ecc39)[_0x228e('0x16')](_0x228e('0x17'));return _0x47e4e8['substring'](0x0,0x8)+'-'+_0x47e4e8[_0x228e('0x20')](0x8,0xc)+'-'+_0x47e4e8[_0x228e('0x20')](0xc,0x10)+'-'+_0x47e4e8[_0x228e('0x20')](0x10,0x14)+'-'+_0x47e4e8[_0x228e('0x20')](0x14);}}; \ No newline at end of file +var _0xf6f0=['getUuid','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','length','filter','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','createHash','md5','update','digest','hex'];(function(_0x483f8b,_0x5c1e61){var _0x8730b0=function(_0x367e58){while(--_0x367e58){_0x483f8b['push'](_0x483f8b['shift']());}};_0x8730b0(++_0x5c1e61);}(_0xf6f0,0x13c));var _0x0f6f=function(_0x52d4ee,_0x64e207){_0x52d4ee=_0x52d4ee-0x0;var _0x51d053=_0xf6f0[_0x52d4ee];return _0x51d053;};'use strict';var _=require(_0x0f6f('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x0f6f('0x1'));var exec=require(_0x0f6f('0x2'))[_0x0f6f('0x3')];var config=require(_0x0f6f('0x4'));function getInterfaces(){var _0x27d7e4=[];var _0x37666e=os[_0x0f6f('0x5')]();var _0x1340f4=_['orderBy'](_[_0x0f6f('0x6')](_0x37666e));for(var _0x2a46cf=0x0;_0x2a46cf<_0x1340f4[_0x0f6f('0x7')];_0x2a46cf++){var _0x1a3c44=_0x37666e[_0x1340f4[_0x2a46cf]][_0x0f6f('0x8')](function(_0x45af93){return _0x45af93['family']===_0x0f6f('0x9')&&_0x45af93[_0x0f6f('0xa')]===![];});_0x27d7e4=_0x27d7e4['concat'](_0x1a3c44);}return _0x27d7e4;}function getFirstInterface(){var _0xad404c=_[_0x0f6f('0xb')](getInterfaces());return{'macAddress':_0xad404c&&_0xad404c[_0x0f6f('0xc')]?_0xad404c[_0x0f6f('0xc')]:_0x0f6f('0xd'),'ipAddress':_0xad404c&&_0xad404c['address']?_0xad404c[_0x0f6f('0xe')]:_0x0f6f('0xf')};}exports[_0x0f6f('0x10')]=getFirstInterface;function getCPUhash(){var _0x26cd7c=_['orderBy'](os[_0x0f6f('0x11')]()['map'](function(_0x5265c9){return _0x5265c9[_0x0f6f('0x12')];}))['join'](':');return crypto[_0x0f6f('0x13')](_0x0f6f('0x14'))[_0x0f6f('0x15')](_0x26cd7c)[_0x0f6f('0x16')](_0x0f6f('0x17'));}exports[_0x0f6f('0x18')]=function(){var _0x3aee7e=os['platform']();var _0x4295d4=/[0-9a-f-]{36}/;if(config[_0x0f6f('0x19')]&&_0x4295d4[_0x0f6f('0x1a')](config[_0x0f6f('0x19')])){return config[_0x0f6f('0x19')];}else if(_0x3aee7e===_0x0f6f('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x0f6f('0x1c')})[_0x0f6f('0x1d')]('\x0d\x0a','');}else{var _0x25480f=getFirstInterface();var _0x324178=getCPUhash();var _0x371dfb=_0x324178+'|'+os[_0x0f6f('0x1e')]()+'|'+_0x25480f[_0x0f6f('0x1f')]+'|'+_0x25480f[_0x0f6f('0x20')];var _0x14110d=crypto['createHash']('md5')['update'](_0x371dfb)['digest']('hex');return _0x14110d[_0x0f6f('0x21')](0x0,0x8)+'-'+_0x14110d[_0x0f6f('0x21')](0x8,0xc)+'-'+_0x14110d[_0x0f6f('0x21')](0xc,0x10)+'-'+_0x14110d[_0x0f6f('0x21')](0x10,0x14)+'-'+_0x14110d[_0x0f6f('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 3a78e79..867bc46 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 _0x6929=['./hardware','../logger','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','error','getUuid','License','spread','default','util','moment','request-promise','pkginfo','version','../../components/encryptor'];(function(_0x3086ee,_0x4634db){var _0x457fad=function(_0x227428){while(--_0x227428){_0x3086ee['push'](_0x3086ee['shift']());}};_0x457fad(++_0x4634db);}(_0x6929,0x150));var _0x9692=function(_0x235f4f,_0x349f61){_0x235f4f=_0x235f4f-0x0;var _0x44afdb=_0x6929[_0x235f4f];return _0x44afdb;};'use strict';var util=require(_0x9692('0x0'));var moment=require(_0x9692('0x1'));var rp=require(_0x9692('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x9692('0x3'))(module,_0x9692('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x9692('0x5'));var hardware=require(_0x9692('0x6'));var logger=require(_0x9692('0x7'))('license');var HOST=_0x9692('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x341bb1){return new BPromise(function(_0x1b6c70,_0x35e209){var _0x3f1f9d=util[_0x9692('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x341bb1,module[_0x9692('0xa')][_0x9692('0x4')]);if(oldToken){_0x3f1f9d=util[_0x9692('0x9')](_0x9692('0xb'),HOST,_0x341bb1,module[_0x9692('0xa')][_0x9692('0x4')],oldToken);}var _0x3dffff={'uri':_0x3f1f9d,'method':_0x9692('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3dffff)['then'](function(_0x7da5c2){_0x1b6c70(_0x7da5c2);})[_0x9692('0xd')](function(_0x579577){_0x35e209(_0x579577);});});}function manageLicense(_0x3578ab,_0x19b266){var _0x29f48b=_0x19b266[_0x9692('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x29f48b[_0x9692('0xf')]!==_0x3578ab&&!_0x29f48b[_0x9692('0x10')]){oldToken=_0x29f48b[_0x9692('0xf')];}httpRequest(_0x3578ab)[_0x9692('0x11')](function(_0x4dd502){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4dd502[_0x9692('0x12')]){isOldTokenSent=![];if(!_0x29f48b[_0x9692('0x13')]&&_0x29f48b[_0x9692('0x13')]!=_0x4dd502[_0x9692('0x13')]||_0x29f48b[_0x9692('0x13')]&&_0x29f48b[_0x9692('0x10')]){logger['info'](_0x9692('0x14'));}if(_0x29f48b[_0x9692('0x13')]&&!_0x29f48b[_0x9692('0x10')]&&_0x29f48b[_0x9692('0x13')]!=_0x4dd502[_0x9692('0x13')]){logger[_0x9692('0x15')](_0x9692('0x16'));}if(_0x29f48b[_0x9692('0x13')]&&!_0x29f48b['data2']&&_0x29f48b[_0x9692('0x13')]==_0x4dd502[_0x9692('0x13')]){return _0x19b266;}return _0x19b266[_0x9692('0x17')]({'data1':_0x3578ab,'data2':null,'license':_0x4dd502['license']});}else{if(_0x4dd502[_0x9692('0x13')]||_0x29f48b[_0x9692('0x13')]){if(!_0x29f48b[_0x9692('0x10')]){if(_0x29f48b[_0x9692('0xf')]==_0x3578ab){GRAY_PERIOD_REASON=_0x9692('0x18');logger[_0x9692('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x9692('0x19');logger[_0x9692('0x15')](_0x9692('0x1a'),_0x29f48b[_0x9692('0xf')],_0x3578ab);}logger[_0x9692('0x15')](_0x9692('0x1b'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x9692('0x9')](_0x9692('0x1c')));return _0x19b266['update']({'data2':encryptor[_0x9692('0x1d')](moment()[_0x9692('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x9692('0x1e')](encryptor[_0x9692('0x1f')](_0x29f48b[_0x9692('0x10')]),_0x9692('0x20'))>DAYS){logger[_0x9692('0x15')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x9692('0x1c')));isOldTokenSent=![];return _0x19b266[_0x9692('0x17')]({'data1':_0x3578ab,'data2':null,'license':null});}}}else{if(_0x29f48b['data1']!=_0x3578ab){logger[_0x9692('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x29f48b[_0x9692('0xf')],_0x3578ab);return _0x19b266[_0x9692('0x17')]({'data1':_0x3578ab,'data2':null,'license':null});}}}return _0x19b266;})[_0x9692('0x11')](function(_0x10faac){_0x19b266=_0x10faac;})['catch'](function(_0x44c588){logger[_0x9692('0x21')](_0x44c588['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x9692('0x22')](),_0x19b266);},TIME);});}function defaultLicense(){var _0x4fe3e6=hardware[_0x9692('0x22')]();if(_0x4fe3e6){return db[_0x9692('0x23')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x4fe3e6}})[_0x9692('0x24')](function(_0x31069c,_0x261001){logger[_0x9692('0x15')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x4fe3e6);manageLicense(_0x4fe3e6,_0x31069c);})[_0x9692('0xd')](function(_0x364af0){logger[_0x9692('0x21')](_0x364af0['message']);});}}exports[_0x9692('0x25')]=defaultLicense; \ No newline at end of file +var _0x6131=['version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','then','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','pkginfo','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format'];(function(_0x56a3c2,_0x58b15f){var _0x3fb708=function(_0x39730b){while(--_0x39730b){_0x56a3c2['push'](_0x56a3c2['shift']());}};_0x3fb708(++_0x58b15f);}(_0x6131,0x143));var _0x1613=function(_0x595f78,_0x84481f){_0x595f78=_0x595f78-0x0;var _0x3c404f=_0x6131[_0x595f78];return _0x3c404f;};'use strict';var util=require('util');var moment=require(_0x1613('0x0'));var rp=require(_0x1613('0x1'));var BPromise=require(_0x1613('0x2'));var pkginfo=require(_0x1613('0x3'))(module,'version');var db=require(_0x1613('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x1613('0x5'));var logger=require(_0x1613('0x6'))(_0x1613('0x7'));var HOST=_0x1613('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x207744){return new BPromise(function(_0x48de8a,_0xbbcb7d){var _0x3bdd10=util[_0x1613('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x207744,module['exports'][_0x1613('0xa')]);if(oldToken){_0x3bdd10=util[_0x1613('0x9')](_0x1613('0xb'),HOST,_0x207744,module['exports'][_0x1613('0xa')],oldToken);}var _0x333534={'uri':_0x3bdd10,'method':_0x1613('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x333534)['then'](function(_0x3b451d){_0x48de8a(_0x3b451d);})[_0x1613('0xd')](function(_0x1f9a97){_0xbbcb7d(_0x1f9a97);});});}function manageLicense(_0x483053,_0x3c2942){var _0x327735=_0x3c2942[_0x1613('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x327735[_0x1613('0xf')]!==_0x483053&&!_0x327735['data2']){oldToken=_0x327735[_0x1613('0xf')];}httpRequest(_0x483053)[_0x1613('0x10')](function(_0xa08672){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xa08672[_0x1613('0x11')]){isOldTokenSent=![];if(!_0x327735['license']&&_0x327735[_0x1613('0x7')]!=_0xa08672['license']||_0x327735[_0x1613('0x7')]&&_0x327735[_0x1613('0x12')]){logger[_0x1613('0x13')](_0x1613('0x14'));}if(_0x327735[_0x1613('0x7')]&&!_0x327735[_0x1613('0x12')]&&_0x327735[_0x1613('0x7')]!=_0xa08672['license']){logger['info'](_0x1613('0x15'));}if(_0x327735[_0x1613('0x7')]&&!_0x327735[_0x1613('0x12')]&&_0x327735[_0x1613('0x7')]==_0xa08672['license']){return _0x3c2942;}return _0x3c2942[_0x1613('0x16')]({'data1':_0x483053,'data2':null,'license':_0xa08672['license']});}else{if(_0xa08672['license']||_0x327735[_0x1613('0x7')]){if(!_0x327735['data2']){if(_0x327735[_0x1613('0xf')]==_0x483053){GRAY_PERIOD_REASON=_0x1613('0x17');logger[_0x1613('0x13')](_0x1613('0x18'));}else{GRAY_PERIOD_REASON=_0x1613('0x19');logger['info'](_0x1613('0x1a'),_0x327735['data1'],_0x483053);}logger['info'](_0x1613('0x1b'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x1613('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x3c2942[_0x1613('0x16')]({'data2':encryptor[_0x1613('0x1c')](moment()[_0x1613('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x1613('0x1d')](encryptor[_0x1613('0x1e')](_0x327735[_0x1613('0x12')]),_0x1613('0x1f'))>DAYS){logger[_0x1613('0x13')](_0x1613('0x20'),moment()[_0x1613('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x3c2942[_0x1613('0x16')]({'data1':_0x483053,'data2':null,'license':null});}}}else{if(_0x327735[_0x1613('0xf')]!=_0x483053){logger[_0x1613('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x327735['data1'],_0x483053);return _0x3c2942['update']({'data1':_0x483053,'data2':null,'license':null});}}}return _0x3c2942;})['then'](function(_0x1060c3){_0x3c2942=_0x1060c3;})[_0x1613('0xd')](function(_0x42419f){logger['error'](_0x42419f['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3c2942);},TIME);});}function defaultLicense(){var _0x9883ef=hardware['getUuid']();if(_0x9883ef){return db[_0x1613('0x21')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x9883ef}})[_0x1613('0x22')](function(_0x12c971,_0x572804){logger[_0x1613('0x13')](_0x1613('0x23'),_0x9883ef);manageLicense(_0x9883ef,_0x12c971);})['catch'](function(_0x4fca06){logger['error'](_0x4fca06['message']);});}}exports[_0x1613('0x24')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e50c66f..a72e71f 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 _0x814e=['Breaking\x20license','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','message','User','findAll','sequelize','COUNT','admin','user','telephone','telephones','forEach','role','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid'];(function(_0x2deb2b,_0x35f4e5){var _0x5836a0=function(_0x10d89b){while(--_0x10d89b){_0x2deb2b['push'](_0x2deb2b['shift']());}};_0x5836a0(++_0x35f4e5);}(_0x814e,0xb2));var _0xe814=function(_0x3db65a,_0x5b8b81){_0x3db65a=_0x3db65a-0x0;var _0x58e92b=_0x814e[_0x3db65a];return _0x58e92b;};'use strict';var util=require('util');var _=require(_0xe814('0x0'));var moment=require(_0xe814('0x1'));var BPromise=require('bluebird');var hardware=require(_0xe814('0x2'));var encryptor=require(_0xe814('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe814('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xe814('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe814('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe814('0x6'),'machineUuid':hardware[_0xe814('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4760ea){return new BPromise(function(_0x1f2c41,_0x4e85a1){return db['License'][_0xe814('0x7')](_[_0xe814('0x8')](_0x4760ea,{'raw':!![],'where':{'id':0x1}}))[_0xe814('0x9')](function(_0x5529dc){return checkLicense(_0x5529dc,null);})[_0xe814('0x9')](function(_0x544660){_0x1f2c41(_0x544660);return;})['catch'](function(_0x269a2c){_0x4e85a1(_0x269a2c);});});}function checkLicense(_0x437dff,_0x44b485){if(!_0x437dff){demoLicense[_0xe814('0xa')]=_0x437dff[_0xe814('0xb')];return demoLicense;}try{var _0x5e21e8=_0x44b485||_0x437dff[_0xe814('0xc')];if(_[_0xe814('0xd')](_0x5e21e8)){throw new Error(_0xe814('0xe'));}var _0x488f0a=_0x437dff['data1'];var _0x10548f=_0x437dff[_0xe814('0xf')];var _0x32811e=_0x488f0a[_0xe814('0x10')]('-')[0x4];var _0x46b6b9=_0x488f0a[_0xe814('0x10')]('-')[0x0];var _0x5c057d=encryptor[_0xe814('0x11')](_0x5e21e8,util[_0xe814('0x12')](_0xe814('0x13'),_0x32811e,_0x488f0a,_0x46b6b9));var _0x4cb9e5=JSON[_0xe814('0x14')](_0x5c057d);_0x4cb9e5[_0xe814('0x15')]=![];_0x4cb9e5[_0xe814('0xa')]=_0x488f0a;_0x4cb9e5[_0xe814('0x16')]=hardware[_0xe814('0x5')]();if(_0x10548f){var _0x22806a=encryptor[_0xe814('0x11')](_0x10548f);_0x4cb9e5[_0xe814('0x17')]=_0x22806a;_0x4cb9e5[_0xe814('0x18')]=moment(_0x22806a)[_0xe814('0x19')](0x7,_0xe814('0x1a'))[_0xe814('0x12')]();_0x4cb9e5[_0xe814('0x1b')]=_0x4cb9e5['uuid']!=_0x4cb9e5[_0xe814('0x16')]?_0xe814('0x1c'):'disabled';}return _0x4cb9e5;}catch(_0x5b3895){breakingLicense[_0xe814('0xa')]=_0x437dff[_0xe814('0xb')];breakingLicense[_0xe814('0x1d')]=_0x5b3895['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xdb7104,_0x43a738){getLicense()[_0xe814('0x9')](function(_0x583411){return db[_0xe814('0x1e')][_0xe814('0x1f')]({'attributes':['role',[db[_0xe814('0x20')]['fn'](_0xe814('0x21'),db['sequelize']['col']('role')),'count']],'group':'role','where':{'role':{'$or':[_0xe814('0x22'),_0xe814('0x23'),_0xe814('0x24')]}},'raw':!![]})[_0xe814('0x9')](function(_0x705d75){var _0x1c16ed={'user':_0x583411['users']||0x0,'telephone':_0x583411[_0xe814('0x25')]||0x0};_0x705d75[_0xe814('0x26')](function(_0x5457a9){var _0x269889=_0x5457a9[_0xe814('0x27')]===_0xe814('0x22')?'user':_0x5457a9[_0xe814('0x27')];_0x1c16ed[_0x269889]-=_0x5457a9['count'];if(_0x1c16ed[_0x269889]<0x0)_0x1c16ed[_0x269889]=0x0;});_0xdb7104(_0x1c16ed);return;});})[_0xe814('0x28')](function(_0x551522){_0x43a738(_0x551522);});});}function checkUserLimits(_0x47b5a1){return new BPromise(function(_0x4eb7e6,_0x189655){getLimits()['then'](function(_0x244325){var _0x9edca=_[_0xe814('0x29')](_[_0xe814('0x2a')](_0x47b5a1,_0xe814('0x27')),[_0xe814('0x22'),_0xe814('0x23'),_0xe814('0x24')]);var _0x41987d=(_0x9edca[_0xe814('0x22')]||0x0)+(_0x9edca[_0xe814('0x23')]||0x0);var _0x42b592=_0x9edca[_0xe814('0x24')]||0x0;if(_0x41987d>_0x244325['user'])return _0x189655(_0xe814('0x2b'));if(_0x42b592>_0x244325[_0xe814('0x24')])return _0x189655(_0xe814('0x2c'));return _0x4eb7e6();})[_0xe814('0x28')](function(_0x57967e){_0x189655(_0x57967e);});});}module[_0xe814('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x1dd7=['then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','count','admin','user','telephone','telephones','forEach','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults'];(function(_0x39a6a8,_0x220baa){var _0xfc5750=function(_0x5a29fc){while(--_0x5a29fc){_0x39a6a8['push'](_0x39a6a8['shift']());}};_0xfc5750(++_0x220baa);}(_0x1dd7,0x1a3));var _0x71dd=function(_0x285a14,_0x394a27){_0x285a14=_0x285a14-0x0;var _0x3430cc=_0x1dd7[_0x285a14];return _0x3430cc;};'use strict';var util=require(_0x71dd('0x0'));var _=require(_0x71dd('0x1'));var moment=require(_0x71dd('0x2'));var BPromise=require(_0x71dd('0x3'));var hardware=require(_0x71dd('0x4'));var encryptor=require(_0x71dd('0x5'));var db=require(_0x71dd('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x71dd('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x71dd('0x8'),'machineUuid':hardware[_0x71dd('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x71dd('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x71dd('0xa'),'machineUuid':hardware[_0x71dd('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4edcb9){return new BPromise(function(_0x344f34,_0x2d0709){return db[_0x71dd('0xb')]['find'](_[_0x71dd('0xc')](_0x4edcb9,{'raw':!![],'where':{'id':0x1}}))[_0x71dd('0xd')](function(_0x59b432){return checkLicense(_0x59b432,null);})[_0x71dd('0xd')](function(_0x514485){_0x344f34(_0x514485);return;})[_0x71dd('0xe')](function(_0x559544){_0x2d0709(_0x559544);});});}function checkLicense(_0x4559cd,_0x129eff){if(!_0x4559cd){demoLicense['uuid']=_0x4559cd[_0x71dd('0xf')];return demoLicense;}try{var _0x50ceba=_0x129eff||_0x4559cd[_0x71dd('0x10')];if(_[_0x71dd('0x11')](_0x50ceba)){throw new Error(_0x71dd('0x12'));}var _0x3babf4=_0x4559cd[_0x71dd('0xf')];var _0x265e14=_0x4559cd[_0x71dd('0x13')];var _0x2609f4=_0x3babf4[_0x71dd('0x14')]('-')[0x4];var _0x1fb85e=_0x3babf4[_0x71dd('0x14')]('-')[0x0];var _0x1071f6=encryptor[_0x71dd('0x15')](_0x50ceba,util[_0x71dd('0x16')](_0x71dd('0x17'),_0x2609f4,_0x3babf4,_0x1fb85e));var _0x3e5bf2=JSON[_0x71dd('0x18')](_0x1071f6);_0x3e5bf2[_0x71dd('0x19')]=![];_0x3e5bf2[_0x71dd('0x1a')]=_0x3babf4;_0x3e5bf2[_0x71dd('0x1b')]=hardware[_0x71dd('0x9')]();if(_0x265e14){var _0x247f18=encryptor[_0x71dd('0x15')](_0x265e14);_0x3e5bf2[_0x71dd('0x1c')]=_0x247f18;_0x3e5bf2['deadline']=moment(_0x247f18)['add'](0x7,_0x71dd('0x1d'))[_0x71dd('0x16')]();_0x3e5bf2[_0x71dd('0x1e')]=_0x3e5bf2[_0x71dd('0x1a')]!=_0x3e5bf2[_0x71dd('0x1b')]?'changed':_0x71dd('0x1f');}return _0x3e5bf2;}catch(_0x3030e7){breakingLicense[_0x71dd('0x1a')]=_0x4559cd['data1'];breakingLicense[_0x71dd('0x20')]=_0x3030e7[_0x71dd('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5327f9,_0x3d60c0){getLicense()[_0x71dd('0xd')](function(_0x3bb593){return db[_0x71dd('0x21')][_0x71dd('0x22')]({'attributes':[_0x71dd('0x23'),[db[_0x71dd('0x24')]['fn'](_0x71dd('0x25'),db[_0x71dd('0x24')]['col'](_0x71dd('0x23'))),_0x71dd('0x26')]],'group':_0x71dd('0x23'),'where':{'role':{'$or':[_0x71dd('0x27'),_0x71dd('0x28'),_0x71dd('0x29')]}},'raw':!![]})[_0x71dd('0xd')](function(_0x249f27){var _0xd32ee3={'user':_0x3bb593['users']||0x0,'telephone':_0x3bb593[_0x71dd('0x2a')]||0x0};_0x249f27[_0x71dd('0x2b')](function(_0x16d49a){var _0x277d14=_0x16d49a['role']==='admin'?'user':_0x16d49a[_0x71dd('0x23')];_0xd32ee3[_0x277d14]-=_0x16d49a['count'];if(_0xd32ee3[_0x277d14]<0x0)_0xd32ee3[_0x277d14]=0x0;});_0x5327f9(_0xd32ee3);return;});})[_0x71dd('0xe')](function(_0x2bf9b9){_0x3d60c0(_0x2bf9b9);});});}function checkUserLimits(_0x7ca655){return new BPromise(function(_0x59fa02,_0x3f9f7c){getLimits()[_0x71dd('0xd')](function(_0x23578b){var _0x23dff3=_[_0x71dd('0x2c')](_['countBy'](_0x7ca655,'role'),[_0x71dd('0x27'),_0x71dd('0x28'),_0x71dd('0x29')]);var _0xd0e03b=(_0x23dff3[_0x71dd('0x27')]||0x0)+(_0x23dff3[_0x71dd('0x28')]||0x0);var _0x7f3bb5=_0x23dff3[_0x71dd('0x29')]||0x0;if(_0xd0e03b>_0x23578b[_0x71dd('0x28')])return _0x3f9f7c(_0x71dd('0x2d'));if(_0x7f3bb5>_0x23578b[_0x71dd('0x29')])return _0x3f9f7c(_0x71dd('0x2e'));return _0x59fa02();})[_0x71dd('0xe')](function(_0x1e6b02){_0x3f9f7c(_0x1e6b02);});});}module[_0x71dd('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index f3acc98..a425bc1 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 _0x5c3c=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x5c3c,0x132));var _0xc5c3=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x5c3c[_0x5037ab];return _0x512adb;};'use strict';module[_0xc5c3('0x0')]={'DOMAIN':_0xc5c3('0x1'),'SESSION_SECRET':_0xc5c3('0x2'),'GOOGLE_ID':_0xc5c3('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x0abf=['app-id','exports','myappanuglar-secret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';module[_0xf0ab('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xf0ab('0x1'),'GOOGLE_ID':_0xf0ab('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ea1598a..f255ff6 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c2b=['../utils/loggers','fileLogger','exports'];(function(_0x30e248,_0x184cce){var _0x4deedd=function(_0x574a7d){while(--_0x574a7d){_0x30e248['push'](_0x30e248['shift']());}};_0x4deedd(++_0x184cce);}(_0x4c2b,0xed));var _0xb4c2=function(_0x23ea5f,_0x19658a){_0x23ea5f=_0x23ea5f-0x0;var _0x45a899=_0x4c2b[_0x23ea5f];return _0x45a899;};'use strict';var fileLogger=require(_0xb4c2('0x0'))[_0xb4c2('0x1')];module[_0xb4c2('0x2')]=fileLogger; \ No newline at end of file +var _0x6598=['../utils/loggers'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x6598,0x128));var _0x8659=function(_0x159f8e,_0x258d08){_0x159f8e=_0x159f8e-0x0;var _0x458e17=_0x6598[_0x159f8e];return _0x458e17;};'use strict';var fileLogger=require(_0x8659('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 5880709..b695382 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 _0x7f64=['../../services/express/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','path','join'];(function(_0x240984,_0xd35102){var _0x36f7a6=function(_0x115759){while(--_0x115759){_0x240984['push'](_0x240984['shift']());}};_0x36f7a6(++_0xd35102);}(_0x7f64,0x1b6));var _0x47f6=function(_0xf6aed6,_0x48a505){_0xf6aed6=_0xf6aed6-0x0;var _0x4834b7=_0x7f64[_0xf6aed6];return _0x4834b7;};'use strict';var path=require(_0x47f6('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x47f6('0x1')](__dirname,_0x47f6('0x2'))},{'name':'ami','script':path[_0x47f6('0x1')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x47f6('0x1')](__dirname,_0x47f6('0x3'))},{'name':_0x47f6('0x4'),'script':path[_0x47f6('0x1')](__dirname,_0x47f6('0x5'))},{'name':_0x47f6('0x6'),'script':path[_0x47f6('0x1')](__dirname,'../../services/routing/index.js')},{'name':_0x47f6('0x7'),'script':path[_0x47f6('0x1')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0x6409=['../../services/xdr/index.js','exports','path','express','join','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x4e5c68,_0x48bd24){var _0x433ff5=function(_0xb7b5bc){while(--_0xb7b5bc){_0x4e5c68['push'](_0x4e5c68['shift']());}};_0x433ff5(++_0x48bd24);}(_0x6409,0x1be));var _0x9640=function(_0x6665ad,_0x3b5140){_0x6665ad=_0x6665ad-0x0;var _0x380a83=_0x6409[_0x6665ad];return _0x380a83;};'use strict';var path=require(_0x9640('0x0'));var os=require('os');var config={'apps':[{'name':_0x9640('0x1'),'script':path[_0x9640('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x9640('0x3'),'script':path[_0x9640('0x2')](__dirname,_0x9640('0x4'))},{'name':'agi','script':path[_0x9640('0x2')](__dirname,_0x9640('0x5'))},{'name':_0x9640('0x6'),'script':path['join'](__dirname,_0x9640('0x7'))},{'name':_0x9640('0x8'),'script':path[_0x9640('0x2')](__dirname,_0x9640('0x9'))},{'name':'xdr','script':path[_0x9640('0x2')](__dirname,_0x9640('0xa'))}]};module[_0x9640('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index a1584e1..85a96db 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 _0xb589=['describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then','disconnect','stop','restart','list'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xb589,0x138));var _0x9b58=function(_0x510b08,_0x16cd04){_0x510b08=_0x510b08-0x0;var _0xbf9488=_0xb589[_0x510b08];return _0xbf9488;};'use strict';var pm2=require(_0x9b58('0x0'));var BPromise=require(_0x9b58('0x1'));var config=require(_0x9b58('0x2'));function connect(){return new BPromise(function(_0x3fa882,_0x2c2f91){return pm2['connect'](function(_0x5ab8c3){if(_0x5ab8c3){return _0x2c2f91(_0x5ab8c3);}return _0x3fa882(_0x9b58('0x3'));});});};exports[_0x9b58('0x4')]=function(_0x1dea6b){return connect()[_0x9b58('0x5')](function(){return new BPromise(function(_0x5325d0,_0x238bb2){return pm2[_0x9b58('0x4')](_0x1dea6b,function(_0xdd1cb5,_0x2d53b7){if(_0xdd1cb5){return _0x238bb2(_0xdd1cb5);}pm2[_0x9b58('0x6')]();return _0x5325d0(_0x2d53b7);});});});};exports['stop']=function(_0x2f5e4a){return connect()[_0x9b58('0x5')](function(){return new BPromise(function(_0x2e0a14,_0x8288e){return pm2[_0x9b58('0x7')](_0x2f5e4a,function(_0x525407,_0x366419){if(_0x525407){return _0x8288e(_0x525407);}pm2[_0x9b58('0x6')]();return _0x2e0a14(_0x366419);});});});};exports[_0x9b58('0x8')]=function(_0x57ee63){return connect()[_0x9b58('0x5')](function(){return new BPromise(function(_0xe2d315,_0x2a174c){return pm2[_0x9b58('0x8')](_0x57ee63,function(_0x2fd5d5,_0x3558ad){if(_0x2fd5d5){return _0x2a174c(_0x2fd5d5);}pm2[_0x9b58('0x6')]();return _0xe2d315(_0x3558ad);});});});};exports[_0x9b58('0x9')]=function(){return connect()[_0x9b58('0x5')](function(){return new BPromise(function(_0x391967,_0x50d4c9){return pm2['list'](function(_0x309683,_0x427c94){if(_0x309683){return _0x50d4c9(_0x309683);}pm2[_0x9b58('0x6')]();return _0x391967(_0x427c94);});});});};exports[_0x9b58('0xa')]=function(_0x2455c5){return connect()['then'](function(){return new BPromise(function(_0x396e15,_0x1233c4){return pm2[_0x9b58('0xa')](_0x2455c5,function(_0x48e18e,_0x44399a){if(_0x48e18e){return _0x1233c4(_0x48e18e);}pm2[_0x9b58('0x6')]();return _0x396e15(_0x44399a);});});});};exports[_0x9b58('0xb')]=function(_0x243989){return connect()[_0x9b58('0x5')](function(){return new BPromise(function(_0xb82260,_0x25e262){return pm2['delete'](_0x243989,function(_0x39f0ac,_0x21ba20){if(_0x39f0ac){return _0x25e262(_0x39f0ac);}pm2[_0x9b58('0x6')]();return _0xb82260(_0x21ba20);});});});};exports['dump']=function(){return connect()[_0x9b58('0x5')](function(){return new BPromise(function(_0x86e403,_0x3c8b50){return pm2[_0x9b58('0xc')](function(_0x8c2572){if(_0x8c2572){return _0x3c8b50(_0x8c2572);}return _0x86e403(_0x9b58('0xd'));});});});}; \ No newline at end of file +var _0x9618=['restart','list','describe','delete','dump','saved','./config','connect','connected','start','disconnect','stop','then'];(function(_0x4f9474,_0x56a8bd){var _0xdb7173=function(_0x1b55a1){while(--_0x1b55a1){_0x4f9474['push'](_0x4f9474['shift']());}};_0xdb7173(++_0x56a8bd);}(_0x9618,0x1e7));var _0x8961=function(_0x378988,_0x4e8821){_0x378988=_0x378988-0x0;var _0x453199=_0x9618[_0x378988];return _0x453199;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x8961('0x0'));function connect(){return new BPromise(function(_0x3e1f69,_0x1da6b6){return pm2[_0x8961('0x1')](function(_0x2e6828){if(_0x2e6828){return _0x1da6b6(_0x2e6828);}return _0x3e1f69(_0x8961('0x2'));});});};exports[_0x8961('0x3')]=function(_0x23ba4c){return connect()['then'](function(){return new BPromise(function(_0x306cd6,_0x31ad17){return pm2[_0x8961('0x3')](_0x23ba4c,function(_0x34bfd8,_0x26015c){if(_0x34bfd8){return _0x31ad17(_0x34bfd8);}pm2[_0x8961('0x4')]();return _0x306cd6(_0x26015c);});});});};exports[_0x8961('0x5')]=function(_0x462719){return connect()[_0x8961('0x6')](function(){return new BPromise(function(_0x3606fd,_0x521cbe){return pm2['stop'](_0x462719,function(_0x1df326,_0x5ac36d){if(_0x1df326){return _0x521cbe(_0x1df326);}pm2[_0x8961('0x4')]();return _0x3606fd(_0x5ac36d);});});});};exports[_0x8961('0x7')]=function(_0x3a31b6){return connect()['then'](function(){return new BPromise(function(_0x57f74d,_0x3792d4){return pm2[_0x8961('0x7')](_0x3a31b6,function(_0x510006,_0x2cfc7d){if(_0x510006){return _0x3792d4(_0x510006);}pm2[_0x8961('0x4')]();return _0x57f74d(_0x2cfc7d);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x3a48ec,_0x2b9d2a){return pm2[_0x8961('0x8')](function(_0x27250c,_0x12d720){if(_0x27250c){return _0x2b9d2a(_0x27250c);}pm2['disconnect']();return _0x3a48ec(_0x12d720);});});});};exports[_0x8961('0x9')]=function(_0x53a5fe){return connect()[_0x8961('0x6')](function(){return new BPromise(function(_0x3ad170,_0x8e3060){return pm2[_0x8961('0x9')](_0x53a5fe,function(_0x3a4872,_0x524834){if(_0x3a4872){return _0x8e3060(_0x3a4872);}pm2[_0x8961('0x4')]();return _0x3ad170(_0x524834);});});});};exports[_0x8961('0xa')]=function(_0x47e730){return connect()[_0x8961('0x6')](function(){return new BPromise(function(_0x8456a8,_0x579498){return pm2['delete'](_0x47e730,function(_0x10f241,_0x301c7d){if(_0x10f241){return _0x579498(_0x10f241);}pm2['disconnect']();return _0x8456a8(_0x301c7d);});});});};exports[_0x8961('0xb')]=function(){return connect()[_0x8961('0x6')](function(){return new BPromise(function(_0x2d1f94,_0xa883a){return pm2[_0x8961('0xb')](function(_0x833eb5){if(_0x833eb5){return _0xa883a(_0x833eb5);}return _0x2d1f94(_0x8961('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index fee1edb..b731df1 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 _0xf195=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','lodash','ioredis','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf195,0x95));var _0x5f19=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0xf195[_0x202d24];return _0x2b3a8e;};'use strict';var _=require(_0x5f19('0x0'));var moment=require('moment');var Redis=require(_0x5f19('0x1'));var util=require('util');var config=require('../../config/environment');var db=require(_0x5f19('0x2'))['db'];var logger=require(_0x5f19('0x3'))(_0x5f19('0x4'));config[_0x5f19('0x5')]=_[_0x5f19('0x6')](config[_0x5f19('0x5')],{'host':_0x5f19('0x7'),'port':0x18eb});var io=require(_0x5f19('0x8'))(new Redis(config[_0x5f19('0x5')]));function closeInteractions(){var _0x3a6801=0x0;var _0x43e1dd=[];return db[_0x5f19('0x9')][_0x5f19('0xa')]({'raw':!![],'attributes':['id',_0x5f19('0xb')],'where':{'id':0x1}})[_0x5f19('0xc')](function(_0x557218){_0x3a6801=_0x557218['chatTimeout'];if(_0x3a6801){return db[_0x5f19('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x5f19('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x557218[_0x5f19('0xb')],_0x5f19('0xf'))}}});}else{return[];}})[_0x5f19('0xc')](function(_0x2c8535){if(_0x2c8535&&_0x2c8535[_0x5f19('0x10')]){_0x43e1dd=_[_0x5f19('0x11')](_0x2c8535||[],'id');logger[_0x5f19('0x12')](_0x5f19('0x13'),_0x43e1dd[_0x5f19('0x14')]());return db['ChatInteraction'][_0x5f19('0x15')]({'closeReason':_0x5f19('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x5f19('0x17')](_0x5f19('0x18'))},{'where':{'id':_0x43e1dd}});}})[_0x5f19('0xc')](function(){if(_0x43e1dd&&_0x43e1dd[_0x5f19('0x10')]){logger[_0x5f19('0x12')](_0x5f19('0x19'),_0x43e1dd[_0x5f19('0x14')]());for(var _0x5b50de=0x0;_0x5b50de<_0x43e1dd['length'];_0x5b50de++){io['emit'](_0x5f19('0x1a'),{'id':_0x43e1dd[_0x5b50de],'closed':!![]});}}})[_0x5f19('0x1b')](function(_0x1eb1c4){logger[_0x5f19('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x1eb1c4?util['inspect'](_0x1eb1c4,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe891=['lodash','moment','ioredis','util','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','subtract','then','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0x4551d8,_0x4f35e4){var _0x6b2ba=function(_0xc421fb){while(--_0xc421fb){_0x4551d8['push'](_0x4551d8['shift']());}};_0x6b2ba(++_0x4f35e4);}(_0xe891,0x1ed));var _0x1e89=function(_0x5eaba1,_0x7186ee){_0x5eaba1=_0x5eaba1-0x0;var _0x2c6ff9=_0xe891[_0x5eaba1];return _0x2c6ff9;};'use strict';var _=require(_0x1e89('0x0'));var moment=require(_0x1e89('0x1'));var Redis=require(_0x1e89('0x2'));var util=require(_0x1e89('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x1e89('0x4'));config[_0x1e89('0x5')]=_[_0x1e89('0x6')](config[_0x1e89('0x5')],{'host':_0x1e89('0x7'),'port':0x18eb});var io=require(_0x1e89('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x3a7ebd=0x0;var _0x2b8310=[];return db['Setting'][_0x1e89('0x9')]({'raw':!![],'attributes':['id',_0x1e89('0xa')],'where':{'id':0x1}})['then'](function(_0x364b85){_0x3a7ebd=_0x364b85['chatTimeout'];if(_0x3a7ebd){return db[_0x1e89('0xb')][_0x1e89('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1e89('0xd')](_0x364b85[_0x1e89('0xa')],'minutes')}}});}else{return[];}})[_0x1e89('0xe')](function(_0x40f595){if(_0x40f595&&_0x40f595[_0x1e89('0xf')]){_0x2b8310=_[_0x1e89('0x10')](_0x40f595||[],'id');logger[_0x1e89('0x11')](_0x1e89('0x12'),_0x2b8310[_0x1e89('0x13')]());return db[_0x1e89('0xb')][_0x1e89('0x14')]({'closeReason':'system','disposition':_0x1e89('0x15'),'closed':!![],'closedAt':moment()['format'](_0x1e89('0x16'))},{'where':{'id':_0x2b8310}});}})['then'](function(){if(_0x2b8310&&_0x2b8310[_0x1e89('0xf')]){logger[_0x1e89('0x11')](_0x1e89('0x17'),_0x2b8310[_0x1e89('0x13')]());for(var _0xf18a1e=0x0;_0xf18a1e<_0x2b8310['length'];_0xf18a1e++){io['emit'](_0x1e89('0x18'),{'id':_0x2b8310[_0xf18a1e],'closed':!![]});}}})[_0x1e89('0x19')](function(_0x4f3624){logger[_0x1e89('0x1a')](_0x1e89('0x1b'),_0x4f3624?util[_0x1e89('0x1c')](_0x4f3624,{'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 2db98f4..b49d070 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 _0x2916=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x30b05a,_0x2ba28f){var _0x271b17=function(_0x21de41){while(--_0x21de41){_0x30b05a['push'](_0x30b05a['shift']());}};_0x271b17(++_0x2ba28f);}(_0x2916,0x18e));var _0x6291=function(_0x2efe86,_0x4b6c3f){_0x2efe86=_0x2efe86-0x0;var _0x48e01c=_0x2916[_0x2efe86];return _0x48e01c;};'use strict';function start(){var _0x4fdf7b=require(_0x6291('0x0'));return _0x4fdf7b['startAllRefreshIntervals']();}module[_0x6291('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x55c5=['startAllRefreshIntervals','exports'];(function(_0x167cdc,_0x29eeba){var _0x5c8089=function(_0x573f35){while(--_0x573f35){_0x167cdc['push'](_0x167cdc['shift']());}};_0x5c8089(++_0x29eeba);}(_0x55c5,0xa8));var _0x555c=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x55c5[_0x3c6ae2];return _0x4edda;};'use strict';function start(){var _0x4b1a5d=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x4b1a5d[_0x555c('0x0')]();}module[_0x555c('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 2fd1127..d192de8 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 _0x00ad=['resolve','run\x20job','active','startAt','endAt','cron','add\x20cron','deleteJob','stop\x20cron','isBetween','update','update\x20cron','run','start','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','format','%s.%s','basename','existsSync','status','Sent','message','text','stringify','attachments','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','stop','toRun','index'];(function(_0x52dde7,_0x5ab368){var _0xd3690b=function(_0x27e252){while(--_0x27e252){_0x52dde7['push'](_0x52dde7['shift']());}};_0xd3690b(++_0x5ab368);}(_0x00ad,0x65));var _0xd00a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x00ad[_0x4cf98e];return _0x1623ac;};'use strict';var fs=require('fs');var util=require(_0xd00a('0x0'));var path=require(_0xd00a('0x1'));var _=require('lodash');var moment=require(_0xd00a('0x2'));var CronJobManager=require(_0xd00a('0x3'));var jayson=require(_0xd00a('0x4'));var BPromise=require(_0xd00a('0x5'));var logger=require(_0xd00a('0x6'))('schedule');var db=require(_0xd00a('0x7'))['db'];var analyticCustomReportController=require(_0xd00a('0x8'));var analyticDefaultReportController=require(_0xd00a('0x9'));var client=jayson['client'][_0xd00a('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x885f6b,_0x2b980f){return function(){logger['info'](_0xd00a('0xb'),_0x885f6b[_0xd00a('0xc')]);var _0x2bb60c=!![];var _0x10572c=_0x885f6b[_0xd00a('0xd')][_0xd00a('0xe')]();var _0x4cd4d6={'account':_0x10572c,'message':{'from':util['format'](_0xd00a('0xf'),_0x885f6b[_0xd00a('0xd')][_0xd00a('0x10')],_0x885f6b[_0xd00a('0xd')][_0xd00a('0xc')]||_0x885f6b[_0xd00a('0xd')][_0xd00a('0x11')][_0xd00a('0x12')]),'to':_0x885f6b[_0xd00a('0xc')],'cc':_0x885f6b['cc'],'bcc':_0x885f6b[_0xd00a('0x13')],'subject':util['format'](_0xd00a('0x14'),_0x2b980f[_0xd00a('0x10')],_0x885f6b[_0xd00a('0x15')],_0x885f6b['subtractUnit'])}};var _0x233e4c=path[_0xd00a('0x16')](__dirname,_0xd00a('0x17'));var _0x962107=_0x2b980f[_0xd00a('0x18')];var _0x4a39fa=util[_0xd00a('0x19')](_0xd00a('0x1a'),path[_0xd00a('0x1b')](_0x2b980f[_0xd00a('0x18')],path['extname'](_0x2b980f[_0xd00a('0x18')])),'zip');var _0x27a38e=path[_0xd00a('0x16')](_0x233e4c,_0x962107);var _0xb877bd=path['join'](_0x233e4c,_0x4a39fa);if(fs[_0xd00a('0x1c')](_0x27a38e)){_0x2b980f[_0xd00a('0x1d')]=_0xd00a('0x1e');_0x4cd4d6[_0xd00a('0x1f')]['attachments']=[{'filename':_0x962107,'path':_0x27a38e}];_0x4cd4d6[_0xd00a('0x1f')][_0xd00a('0x20')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xd00a('0x21')](_0x2b980f,null,0x2));}else if(fs[_0xd00a('0x1c')](_0xb877bd)){_0x2b980f['status']=_0xd00a('0x1e');_0x4cd4d6[_0xd00a('0x1f')][_0xd00a('0x22')]=[{'filename':_0x4a39fa,'path':_0xb877bd}];}else{_0x4cd4d6[_0xd00a('0x1f')][_0xd00a('0x20')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x885f6b[_0xd00a('0x23')]){_0x2bb60c=![];logger[_0xd00a('0x24')](_0xd00a('0x25'));}}if(_0x2bb60c){return client[_0xd00a('0x26')]('SendMail',_0x4cd4d6)[_0xd00a('0x27')](function(_0x249722){if(_0x249722[_0xd00a('0x28')]){return logger[_0xd00a('0x28')](_0xd00a('0x29'),JSON[_0xd00a('0x21')](_0x249722));}return logger[_0xd00a('0x24')]('email\x20sent');})[_0xd00a('0x2a')](function(_0x3a5069){return logger[_0xd00a('0x28')](_0xd00a('0x29'),JSON[_0xd00a('0x21')](_0x3a5069));});}};}function handleError(){return function(_0x463cfb){return logger[_0xd00a('0x28')](JSON[_0xd00a('0x21')](_0x463cfb));};}function handleResult(_0x36437f){return function(_0x460922){logger[_0xd00a('0x24')](_0xd00a('0x2b'),JSON[_0xd00a('0x21')](_0x460922));if(_0x36437f[_0xd00a('0xd')]&&_0x36437f[_0xd00a('0xd')][_0xd00a('0x11')]&&!_['isNil'](_0x36437f[_0xd00a('0xc')])){setTimeout(handleSendEmail(_0x36437f,_0x460922),0x3c*0x3e8);}};}function handleJob(_0x2ab29a){return function(){try{if(_[_0xd00a('0x2c')](_0x2ab29a[_0xd00a('0x15')])){return logger['info'](_0xd00a('0x2d'));}if(_['isNil'](_0x2ab29a[_0xd00a('0x2e')])){return logger['info'](_0xd00a('0x2f'));}var _0x1522b8={'startDate':moment()[_0xd00a('0x30')](_0x2ab29a[_0xd00a('0x15')],_0x2ab29a[_0xd00a('0x2e')])[_0xd00a('0x19')](_0xd00a('0x31')),'endDate':moment()[_0xd00a('0x19')](_0xd00a('0x31')),'type':_0xd00a('0x32'),'output':_0x2ab29a[_0xd00a('0x33')],'name':_0x2ab29a[_0xd00a('0x10')]};if(!_['isNil'](_0x2ab29a['DefaultReportId'])){logger[_0xd00a('0x24')](_0xd00a('0x34'),_0x2ab29a[_0xd00a('0x35')]);return analyticDefaultReportController[_0xd00a('0x36')]({'id':_0x2ab29a[_0xd00a('0x35')]},_0x1522b8)[_0xd00a('0x27')](handleResult(_0x2ab29a))[_0xd00a('0x2a')](handleError());}if(!_[_0xd00a('0x2c')](_0x2ab29a[_0xd00a('0x37')])){logger[_0xd00a('0x24')](_0xd00a('0x38'),_0x2ab29a[_0xd00a('0x37')]);return analyticCustomReportController[_0xd00a('0x36')]({'id':_0x2ab29a[_0xd00a('0x37')]},_0x1522b8)[_0xd00a('0x27')](handleResult(_0x2ab29a))['catch'](handleError());}}catch(_0x733b02){logger['error'](JSON['stringify'](_0x733b02));}return logger[_0xd00a('0x24')]('no\x20report\x20id');};}function getJobs(_0x2ff463){var _0x73961={};if(_0x2ff463){_0x73961['id']=_0x2ff463;}return db[_0xd00a('0x39')][_0xd00a('0x3a')]({'where':_0x73961,'include':[{'model':db['MailAccount'],'attributes':['id',_0xd00a('0x10'),_0xd00a('0xc')],'include':[{'model':db[_0xd00a('0x3b')],'as':'Smtp','include':[{'model':db[_0xd00a('0x3c')],'as':'CloudProvider'}]}]}]})['then'](function(_0x4de524){var _0x339e2d=_[_0xd00a('0x3d')](manager[_0xd00a('0x3e')]);var _0x294f90=_[_0xd00a('0x3f')](_0x4de524,function(_0x160bcc){return _0x160bcc['id']['toString']();});var _0x59199d=_[_0xd00a('0x40')](_0x4de524,function(_0x165aa7){return _0x165aa7['id'][_0xd00a('0x41')]();});var _0x3db8f5=_0x2ff463?_0x294f90:_[_0xd00a('0x42')](_0x294f90,_0x339e2d);var _0x29b486=_[_0xd00a('0x43')](_0x294f90,_0x339e2d);var _0x3438b0=_[_0xd00a('0x42')](_0x339e2d,_0x294f90);var _0x154031;var _0x1a10e3;for(_0x154031=0x0;_0x154031<_0x3438b0[_0xd00a('0x44')]&&!_0x2ff463;_0x154031+=0x1){_0x1a10e3=_0x3438b0[_0x154031][_0xd00a('0x41')]();if(manager[_0xd00a('0x45')](_0x1a10e3)){manager[_0xd00a('0x46')](_0x1a10e3);manager['deleteJob'](_0x1a10e3);logger['info']('delete\x20cron',_0x1a10e3);}}logger[_0xd00a('0x24')](_0xd00a('0x47'),JSON[_0xd00a('0x21')](_0x3db8f5));for(_0x154031=0x0;_0x154031<_0x3db8f5[_0xd00a('0x44')];_0x154031+=0x1){_0x1a10e3=_0x3db8f5[_0x154031]['toString']();logger['info'](_0xd00a('0x48'),_0x1a10e3);if(_0x2ff463){logger[_0xd00a('0x24')]('my\x20id',_0x2ff463);logger['info'](JSON[_0xd00a('0x21')](_0x59199d[_0x1a10e3]));BPromise[_0xd00a('0x49')]()[_0xd00a('0x27')](handleJob(_0x59199d[_0x1a10e3]));logger[_0xd00a('0x24')](_0xd00a('0x4a'),_0x59199d[_0x1a10e3][_0xd00a('0x10')],_0x59199d[_0x1a10e3]['cron']);}else if(_0x59199d[_0x1a10e3]['cron']&&_0x59199d[_0x1a10e3][_0xd00a('0x4b')]&&moment()['isBetween'](_0x59199d[_0x1a10e3][_0xd00a('0x4c')],_0x59199d[_0x1a10e3][_0xd00a('0x4d')])){manager['add'](_0x1a10e3,_0x59199d[_0x1a10e3][_0xd00a('0x4e')],handleJob(_0x59199d[_0x1a10e3]));manager['start'](_0x1a10e3);logger[_0xd00a('0x24')](_0xd00a('0x4f'),_0x59199d[_0x1a10e3][_0xd00a('0x10')],_0x59199d[_0x1a10e3][_0xd00a('0x4e')]);}else if(manager[_0xd00a('0x45')](_0x1a10e3)){manager[_0xd00a('0x46')](_0x1a10e3);manager[_0xd00a('0x50')](_0x1a10e3);logger['info'](_0xd00a('0x51'),_0x59199d[_0x1a10e3][_0xd00a('0x10')],_0x59199d[_0x1a10e3][_0xd00a('0x4e')]);}}for(_0x154031=0x0,_0x1a10e3;_0x154031<_0x29b486[_0xd00a('0x44')]&&!_0x2ff463;_0x154031+=0x1){_0x1a10e3=_0x29b486[_0x154031][_0xd00a('0x41')]();if(manager['exists'](_0x1a10e3)){if(_0x59199d[_0x1a10e3]['cron']&&_0x59199d[_0x1a10e3][_0xd00a('0x4b')]&&moment()[_0xd00a('0x52')](_0x59199d[_0x1a10e3][_0xd00a('0x4c')],_0x59199d[_0x1a10e3][_0xd00a('0x4d')])){manager[_0xd00a('0x53')](_0x1a10e3,_0x59199d[_0x1a10e3][_0xd00a('0x4e')],handleJob(_0x59199d[_0x1a10e3]));logger['info'](_0xd00a('0x54'),_0x59199d[_0x1a10e3][_0xd00a('0x10')],_0x59199d[_0x1a10e3]['cron']);}else{manager['stop'](_0x1a10e3);manager[_0xd00a('0x50')](_0x1a10e3);logger[_0xd00a('0x24')](_0xd00a('0x51'),_0x59199d[_0x1a10e3][_0xd00a('0x10')],_0x59199d[_0x1a10e3][_0xd00a('0x4e')]);}}}})[_0xd00a('0x2a')](function(_0x167b5c){logger[_0xd00a('0x28')](JSON[_0xd00a('0x21')](_0x167b5c));});}exports[_0xd00a('0x55')]=function(_0x5adb25){return getJobs(_0x5adb25);};exports[_0xd00a('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xf56c=['start','stop\x20cron','update','update\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','extname','zip','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','SendMail','then','error\x20mail','stringify','email\x20sent','error','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt'];(function(_0xdecbed,_0x2e06eb){var _0x52dbd0=function(_0x305a71){while(--_0x305a71){_0xdecbed['push'](_0xdecbed['shift']());}};_0x52dbd0(++_0x2e06eb);}(_0xf56c,0x106));var _0xcf56=function(_0x52f15e,_0x23b9d0){_0x52f15e=_0x52f15e-0x0;var _0x5caabe=_0xf56c[_0x52f15e];return _0x5caabe;};'use strict';var fs=require('fs');var util=require(_0xcf56('0x0'));var path=require(_0xcf56('0x1'));var _=require(_0xcf56('0x2'));var moment=require(_0xcf56('0x3'));var CronJobManager=require(_0xcf56('0x4'));var jayson=require(_0xcf56('0x5'));var BPromise=require(_0xcf56('0x6'));var logger=require(_0xcf56('0x7'))(_0xcf56('0x8'));var db=require(_0xcf56('0x9'))['db'];var analyticCustomReportController=require(_0xcf56('0xa'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xcf56('0xb')][_0xcf56('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x553c6b,_0x21a2aa){return function(){logger['info'](_0xcf56('0xd'),_0x553c6b[_0xcf56('0xe')]);var _0x2178b2=!![];var _0x22399d=_0x553c6b[_0xcf56('0xf')]['getSmtpOptions']();var _0x31b2b4={'account':_0x22399d,'message':{'from':util[_0xcf56('0x10')]('\x22%s\x22\x20<%s>',_0x553c6b[_0xcf56('0xf')][_0xcf56('0x11')],_0x553c6b[_0xcf56('0xf')][_0xcf56('0xe')]||_0x553c6b[_0xcf56('0xf')][_0xcf56('0x12')][_0xcf56('0x13')]),'to':_0x553c6b[_0xcf56('0xe')],'cc':_0x553c6b['cc'],'bcc':_0x553c6b[_0xcf56('0x14')],'subject':util['format'](_0xcf56('0x15'),_0x21a2aa['name'],_0x553c6b[_0xcf56('0x16')],_0x553c6b[_0xcf56('0x17')])}};var _0x32b4d4=path[_0xcf56('0x18')](__dirname,_0xcf56('0x19'));var _0x4a106a=_0x21a2aa['savename'];var _0x4b9446=util[_0xcf56('0x10')]('%s.%s',path[_0xcf56('0x1a')](_0x21a2aa[_0xcf56('0x1b')],path[_0xcf56('0x1c')](_0x21a2aa['savename'])),_0xcf56('0x1d'));var _0x2d4a61=path[_0xcf56('0x18')](_0x32b4d4,_0x4a106a);var _0x32afb4=path[_0xcf56('0x18')](_0x32b4d4,_0x4b9446);if(fs[_0xcf56('0x1e')](_0x2d4a61)){_0x21a2aa[_0xcf56('0x1f')]=_0xcf56('0x20');_0x31b2b4[_0xcf56('0x21')][_0xcf56('0x22')]=[{'filename':_0x4a106a,'path':_0x2d4a61}];_0x31b2b4[_0xcf56('0x21')]['text']=util[_0xcf56('0x10')](_0xcf56('0x23'),JSON['stringify'](_0x21a2aa,null,0x2));}else if(fs[_0xcf56('0x1e')](_0x32afb4)){_0x21a2aa[_0xcf56('0x1f')]=_0xcf56('0x20');_0x31b2b4[_0xcf56('0x21')][_0xcf56('0x22')]=[{'filename':_0x4b9446,'path':_0x32afb4}];}else{_0x31b2b4[_0xcf56('0x21')][_0xcf56('0x24')]=_0xcf56('0x25');if(!_0x553c6b[_0xcf56('0x26')]){_0x2178b2=![];logger[_0xcf56('0x27')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x2178b2){return client['request'](_0xcf56('0x28'),_0x31b2b4)[_0xcf56('0x29')](function(_0x9fc3a5){if(_0x9fc3a5['error']){return logger['error'](_0xcf56('0x2a'),JSON[_0xcf56('0x2b')](_0x9fc3a5));}return logger[_0xcf56('0x27')](_0xcf56('0x2c'));})['catch'](function(_0x32737d){return logger[_0xcf56('0x2d')](_0xcf56('0x2a'),JSON['stringify'](_0x32737d));});}};}function handleError(){return function(_0x2d1129){return logger[_0xcf56('0x2d')](JSON['stringify'](_0x2d1129));};}function handleResult(_0x5820d2){return function(_0x53a429){logger[_0xcf56('0x27')](_0xcf56('0x2e'),JSON[_0xcf56('0x2b')](_0x53a429));if(_0x5820d2['MailAccount']&&_0x5820d2[_0xcf56('0xf')][_0xcf56('0x12')]&&!_['isNil'](_0x5820d2[_0xcf56('0xe')])){setTimeout(handleSendEmail(_0x5820d2,_0x53a429),0x3c*0x3e8);}};}function handleJob(_0x1862a2){return function(){try{if(_[_0xcf56('0x2f')](_0x1862a2[_0xcf56('0x16')])){return logger[_0xcf56('0x27')](_0xcf56('0x30'));}if(_[_0xcf56('0x2f')](_0x1862a2[_0xcf56('0x17')])){return logger[_0xcf56('0x27')](_0xcf56('0x31'));}var _0x20c9cb={'startDate':moment()['subtract'](_0x1862a2[_0xcf56('0x16')],_0x1862a2['subtractUnit'])['format'](_0xcf56('0x32')),'endDate':moment()[_0xcf56('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x1862a2[_0xcf56('0x33')],'name':_0x1862a2[_0xcf56('0x11')]};if(!_[_0xcf56('0x2f')](_0x1862a2[_0xcf56('0x34')])){logger[_0xcf56('0x27')](_0xcf56('0x35'),_0x1862a2[_0xcf56('0x34')]);return analyticDefaultReportController[_0xcf56('0x36')]({'id':_0x1862a2[_0xcf56('0x34')]},_0x20c9cb)[_0xcf56('0x29')](handleResult(_0x1862a2))[_0xcf56('0x37')](handleError());}if(!_['isNil'](_0x1862a2['CustomReportId'])){logger['info'](_0xcf56('0x38'),_0x1862a2[_0xcf56('0x39')]);return analyticCustomReportController[_0xcf56('0x36')]({'id':_0x1862a2[_0xcf56('0x39')]},_0x20c9cb)[_0xcf56('0x29')](handleResult(_0x1862a2))[_0xcf56('0x37')](handleError());}}catch(_0x2a43c4){logger[_0xcf56('0x2d')](JSON[_0xcf56('0x2b')](_0x2a43c4));}return logger[_0xcf56('0x27')](_0xcf56('0x3a'));};}function getJobs(_0x562c8d){var _0x15f9dd={};if(_0x562c8d){_0x15f9dd['id']=_0x562c8d;}return db['Schedule'][_0xcf56('0x3b')]({'where':_0x15f9dd,'include':[{'model':db[_0xcf56('0xf')],'attributes':['id',_0xcf56('0x11'),_0xcf56('0xe')],'include':[{'model':db[_0xcf56('0x3c')],'as':_0xcf56('0x12'),'include':[{'model':db[_0xcf56('0x3d')],'as':_0xcf56('0x3d')}]}]}]})[_0xcf56('0x29')](function(_0x5e3315){var _0x5118d9=_[_0xcf56('0x3e')](manager[_0xcf56('0x3f')]);var _0x39d6ff=_[_0xcf56('0x40')](_0x5e3315,function(_0x5ee666){return _0x5ee666['id'][_0xcf56('0x41')]();});var _0x2b8441=_[_0xcf56('0x42')](_0x5e3315,function(_0x57537f){return _0x57537f['id'][_0xcf56('0x41')]();});var _0x59271f=_0x562c8d?_0x39d6ff:_[_0xcf56('0x43')](_0x39d6ff,_0x5118d9);var _0x183238=_['intersection'](_0x39d6ff,_0x5118d9);var _0xd6ae8f=_[_0xcf56('0x43')](_0x5118d9,_0x39d6ff);var _0x3d39c3;var _0x5cfe5f;for(_0x3d39c3=0x0;_0x3d39c3<_0xd6ae8f[_0xcf56('0x44')]&&!_0x562c8d;_0x3d39c3+=0x1){_0x5cfe5f=_0xd6ae8f[_0x3d39c3][_0xcf56('0x41')]();if(manager[_0xcf56('0x45')](_0x5cfe5f)){manager[_0xcf56('0x46')](_0x5cfe5f);manager[_0xcf56('0x47')](_0x5cfe5f);logger[_0xcf56('0x27')](_0xcf56('0x48'),_0x5cfe5f);}}logger[_0xcf56('0x27')](_0xcf56('0x49'),JSON['stringify'](_0x59271f));for(_0x3d39c3=0x0;_0x3d39c3<_0x59271f[_0xcf56('0x44')];_0x3d39c3+=0x1){_0x5cfe5f=_0x59271f[_0x3d39c3][_0xcf56('0x41')]();logger[_0xcf56('0x27')](_0xcf56('0x4a'),_0x5cfe5f);if(_0x562c8d){logger[_0xcf56('0x27')](_0xcf56('0x4b'),_0x562c8d);logger[_0xcf56('0x27')](JSON['stringify'](_0x2b8441[_0x5cfe5f]));BPromise[_0xcf56('0x4c')]()[_0xcf56('0x29')](handleJob(_0x2b8441[_0x5cfe5f]));logger[_0xcf56('0x27')]('run\x20job',_0x2b8441[_0x5cfe5f][_0xcf56('0x11')],_0x2b8441[_0x5cfe5f][_0xcf56('0x4d')]);}else if(_0x2b8441[_0x5cfe5f][_0xcf56('0x4d')]&&_0x2b8441[_0x5cfe5f][_0xcf56('0x4e')]&&moment()[_0xcf56('0x4f')](_0x2b8441[_0x5cfe5f][_0xcf56('0x50')],_0x2b8441[_0x5cfe5f][_0xcf56('0x51')])){manager['add'](_0x5cfe5f,_0x2b8441[_0x5cfe5f][_0xcf56('0x4d')],handleJob(_0x2b8441[_0x5cfe5f]));manager[_0xcf56('0x52')](_0x5cfe5f);logger[_0xcf56('0x27')]('add\x20cron',_0x2b8441[_0x5cfe5f][_0xcf56('0x11')],_0x2b8441[_0x5cfe5f][_0xcf56('0x4d')]);}else if(manager[_0xcf56('0x45')](_0x5cfe5f)){manager[_0xcf56('0x46')](_0x5cfe5f);manager['deleteJob'](_0x5cfe5f);logger[_0xcf56('0x27')](_0xcf56('0x53'),_0x2b8441[_0x5cfe5f][_0xcf56('0x11')],_0x2b8441[_0x5cfe5f][_0xcf56('0x4d')]);}}for(_0x3d39c3=0x0,_0x5cfe5f;_0x3d39c3<_0x183238[_0xcf56('0x44')]&&!_0x562c8d;_0x3d39c3+=0x1){_0x5cfe5f=_0x183238[_0x3d39c3]['toString']();if(manager[_0xcf56('0x45')](_0x5cfe5f)){if(_0x2b8441[_0x5cfe5f]['cron']&&_0x2b8441[_0x5cfe5f][_0xcf56('0x4e')]&&moment()[_0xcf56('0x4f')](_0x2b8441[_0x5cfe5f][_0xcf56('0x50')],_0x2b8441[_0x5cfe5f]['endAt'])){manager[_0xcf56('0x54')](_0x5cfe5f,_0x2b8441[_0x5cfe5f][_0xcf56('0x4d')],handleJob(_0x2b8441[_0x5cfe5f]));logger[_0xcf56('0x27')](_0xcf56('0x55'),_0x2b8441[_0x5cfe5f][_0xcf56('0x11')],_0x2b8441[_0x5cfe5f][_0xcf56('0x4d')]);}else{manager[_0xcf56('0x46')](_0x5cfe5f);manager['deleteJob'](_0x5cfe5f);logger['info'](_0xcf56('0x53'),_0x2b8441[_0x5cfe5f][_0xcf56('0x11')],_0x2b8441[_0x5cfe5f][_0xcf56('0x4d')]);}}}})[_0xcf56('0x37')](function(_0x20eee2){logger['error'](JSON[_0xcf56('0x2b')](_0x20eee2));});}exports['run']=function(_0xeb2a19){return getJobs(_0xeb2a19);};exports[_0xcf56('0x52')]=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 0bb36e5..3593fcc 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 _0xcf66=['bucket','Transcript\x20not\x20available','CloudProvider','findOne','Sequelize','Cloud\x20Provider\x20not\x20available','ValidationError','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeName','then','format','[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','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion'];(function(_0x443edd,_0x13b85b){var _0x22ecfe=function(_0x15d7cc){while(--_0x15d7cc){_0x443edd['push'](_0x443edd['shift']());}};_0x22ecfe(++_0x13b85b);}(_0xcf66,0x71));var _0x6cf6=function(_0x3a2ffd,_0x1cf700){_0x3a2ffd=_0x3a2ffd-0x0;var _0x1979bc=_0xcf66[_0x3a2ffd];return _0x1979bc;};var _=require(_0x6cf6('0x0'));var AWS=require(_0x6cf6('0x1'));var rp=require(_0x6cf6('0x2'));var util=require('util');var BPromise=require(_0x6cf6('0x3'));var db=require(_0x6cf6('0x4'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x1c599d,_0x45d0d8,_0x57f22f,_0x39f1d6){return new Promise(function(_0x1fbedd,_0x2a573e){var _0x5eb082=new AWS[(_0x6cf6('0x5'))]({'accessKeyId':_0x45d0d8,'secretAccessKey':_0x1c599d,'region':_0x57f22f});_0x5eb082[_0x6cf6('0x6')]({'TranscriptionJobName':_0x39f1d6},function(_0x36b892,_0x748c93){if(_0x36b892){return _0x2a573e(_0x36b892);}else{return _0x1fbedd(_0x748c93);}});});}function sentiment(_0x175b18,_0x8a30f1,_0x5b3827,_0x58378c,_0x5b7f4e){return new Promise(function(_0x8e90e,_0x504c98){var _0x1fdf80=new AWS[(_0x6cf6('0x7'))]({'accessKeyId':_0x8a30f1,'secretAccessKey':_0x175b18,'region':_0x5b3827});_0x1fdf80[_0x6cf6('0x8')]({'Text':_0x58378c,'LanguageCode':_0x5b7f4e[_0x6cf6('0x9')](0x0,0x2)},function(_0x4c4732,_0x5455f3){if(_0x4c4732){return _0x504c98(_0x4c4732);}else{return _0x8e90e(_0x5455f3);}});});}function checkTranscribeJob(_0x5801a9,_0x3fdfea,_0x13b1ad){var _0x372d12;return new BPromise(function(_0x39e8c3,_0x3e62a7){logger[_0x6cf6('0xa')](util['format'](_0x6cf6('0xb'),_0x5801a9['id'],_0x5801a9['transcribeName']));return getTranscriptionJob(_0x13b1ad[_0x6cf6('0xc')],_0x13b1ad[_0x6cf6('0xd')],_0x3fdfea['transcribeRegion'],_0x5801a9[_0x6cf6('0xe')])[_0x6cf6('0xf')](function(_0x2d23ab){logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')](_0x6cf6('0x11'),_0x5801a9['id'],_0x5801a9[_0x6cf6('0xe')],_0x2d23ab[_0x6cf6('0x12')][_0x6cf6('0x13')]));if(!_0x5801a9[_0x6cf6('0x14')]){switch(_0x2d23ab['TranscriptionJob'][_0x6cf6('0x13')]){case _0x6cf6('0x15'):var _0x22ab0={'transcribeStatus':_0x2d23ab['TranscriptionJob'][_0x6cf6('0x13')],'fileUri':_0x2d23ab[_0x6cf6('0x12')][_0x6cf6('0x16')][_0x6cf6('0x17')]};logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')](_0x6cf6('0x18'),_0x5801a9['id']));return rp({'uri':_0x2d23ab['TranscriptionJob'][_0x6cf6('0x16')][_0x6cf6('0x17')],'json':!![]})[_0x6cf6('0xf')](function(_0x380a40){logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')](_0x6cf6('0x19'),_0x5801a9['id']));if(_0x380a40&&_0x380a40[_0x6cf6('0x1a')]&&_0x380a40['results']['transcripts']&&_0x380a40[_0x6cf6('0x1a')]['transcripts'][_0x6cf6('0x1b')]){_0x22ab0[_0x6cf6('0x14')]='';for(var _0x14ae3e=0x0;_0x14ae3e<_0x380a40[_0x6cf6('0x1a')][_0x6cf6('0x1c')][_0x6cf6('0x1b')];_0x14ae3e++){_0x22ab0[_0x6cf6('0x14')]+=_0x380a40['results'][_0x6cf6('0x1c')][_0x14ae3e][_0x6cf6('0x1d')]+'';}}return _0x5801a9[_0x6cf6('0x1e')](_0x22ab0);})['then'](function(){logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')](_0x6cf6('0x1f'),_0x5801a9['id']));if(!_0x5801a9[_0x6cf6('0x20')]){throw new db['Sequelize']['ValidationError'](_0x6cf6('0x21'));}if(!_0x3fdfea[_0x6cf6('0x22')]||!_0x3fdfea[_0x6cf6('0x23')]||!_0x3fdfea[_0x6cf6('0x24')]||!_0x3fdfea['language']||!_0x3fdfea[_0x6cf6('0x25')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x22ab0[_0x6cf6('0x14')]){throw new Error(_0x6cf6('0x26'));}if(_0x3fdfea[_0x6cf6('0x23')]===_0x13b1ad['id']){return _0x13b1ad;}else{return db[_0x6cf6('0x27')][_0x6cf6('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x6cf6('0xf')](function(_0x2ae422){if(!_0x2ae422){throw new db[(_0x6cf6('0x29'))]['ValidationError'](_0x6cf6('0x2a'));}if(!_0x2ae422[_0x6cf6('0xc')]||!_0x2ae422[_0x6cf6('0xd')]){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))](_0x6cf6('0x2c'));}_0x372d12=_0x2ae422;logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')](_0x6cf6('0x2d'),_0x5801a9['id']));return sentiment(_0x372d12[_0x6cf6('0xc')],_0x372d12[_0x6cf6('0xd')],_0x3fdfea[_0x6cf6('0x24')],_0x22ab0[_0x6cf6('0x14')],_0x3fdfea[_0x6cf6('0x2e')]);})[_0x6cf6('0xf')](function(_0x4351d9){logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5801a9['id']));return _0x5801a9[_0x6cf6('0x1e')]({'sentiment':_0x4351d9[_0x6cf6('0x2f')],'sPositive':_0x4351d9[_0x6cf6('0x30')][_0x6cf6('0x31')],'sNegative':_0x4351d9[_0x6cf6('0x30')][_0x6cf6('0x32')],'sMixed':_0x4351d9[_0x6cf6('0x30')][_0x6cf6('0x33')],'sNeutral':_0x4351d9[_0x6cf6('0x30')][_0x6cf6('0x34')]});})[_0x6cf6('0xf')](function(){logger['info'](util[_0x6cf6('0x10')](_0x6cf6('0x1f'),_0x5801a9['id']));_0x39e8c3();});case _0x6cf6('0x35'):return _0x5801a9[_0x6cf6('0x1e')]({'transcribeStatus':_0x6cf6('0x35'),'failureReason':_0x2d23ab[_0x6cf6('0x12')][_0x6cf6('0x36')]})[_0x6cf6('0xf')](function(){logger[_0x6cf6('0xa')](util['format'](_0x6cf6('0x1f'),_0x5801a9['id']));_0x39e8c3();});default:logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')](_0x6cf6('0x37'),_0x5801a9['id']));break;}}else{return BPromise[_0x6cf6('0x38')]()[_0x6cf6('0xf')](function(){if(!_0x5801a9[_0x6cf6('0x20')]){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3fdfea[_0x6cf6('0x22')]||!_0x3fdfea['sentimentAccountId']||!_0x3fdfea[_0x6cf6('0x24')]||!_0x3fdfea[_0x6cf6('0x2e')]||!_0x3fdfea[_0x6cf6('0x25')]){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))](_0x6cf6('0x39'));}if(!_0x5801a9[_0x6cf6('0x14')]){throw new Error(_0x6cf6('0x26'));}if(_0x3fdfea['sentimentAccountId']===_0x13b1ad['id']){return _0x13b1ad;}else{return db[_0x6cf6('0x27')][_0x6cf6('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x6cf6('0xf')](function(_0x41c16a){if(!_0x41c16a){throw new db[(_0x6cf6('0x29'))]['ValidationError'](_0x6cf6('0x2a'));}if(!_0x41c16a[_0x6cf6('0xc')]||!_0x41c16a['data2']){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))](_0x6cf6('0x2c'));}_0x372d12=_0x41c16a;logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')](_0x6cf6('0x2d'),_0x5801a9['id']));return sentiment(_0x372d12[_0x6cf6('0xc')],_0x372d12['data2'],_0x3fdfea[_0x6cf6('0x24')],_0x5801a9['fileText'],_0x3fdfea[_0x6cf6('0x2e')]);})[_0x6cf6('0xf')](function(_0x4927d4){logger[_0x6cf6('0xa')](util[_0x6cf6('0x10')](_0x6cf6('0x3a'),_0x5801a9['id']));return _0x5801a9[_0x6cf6('0x1e')]({'sentiment':_0x4927d4[_0x6cf6('0x2f')],'sPositive':_0x4927d4['SentimentScore'][_0x6cf6('0x31')],'sNegative':_0x4927d4[_0x6cf6('0x30')][_0x6cf6('0x32')],'sMixed':_0x4927d4['SentimentScore'][_0x6cf6('0x33')],'sNeutral':_0x4927d4[_0x6cf6('0x30')][_0x6cf6('0x34')],'transcribeStatus':'COMPLETED'});})[_0x6cf6('0xf')](function(){logger['info'](util['format'](_0x6cf6('0x1f'),_0x5801a9['id']));_0x39e8c3();});}})[_0x6cf6('0x3b')](function(_0x414418){if(_0x414418){if(!_0x414418[_0x6cf6('0x3c')]||_0x414418[_0x6cf6('0x3c')]!==_0x6cf6('0x3d')){logger[_0x6cf6('0x3e')](util[_0x6cf6('0x10')](_0x6cf6('0x3f'),_0x5801a9['id']),util[_0x6cf6('0x40')](_0x414418,{'showHidden':![],'depth':null}));}}_0x39e8c3();});});}function checkTranscribe(){var _0x280e3a;var _0x1ac2cd;var _0x3786d1;return db['VoiceRecording'][_0x6cf6('0x41')]({'where':{'transcribeStatus':_0x6cf6('0x42')}})['then'](function(_0x58c370){if(!_0x58c370||!_0x58c370[_0x6cf6('0x1b')]){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))](_0x6cf6('0x43'));}_0x280e3a=_0x58c370;return db[_0x6cf6('0x44')][_0x6cf6('0x28')]({'where':{'id':0x1}});})['then'](function(_0x115b9b){if(!_0x115b9b){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))]('Settings\x20not\x20available');}_0x1ac2cd=_0x115b9b;if(!_0x1ac2cd['transcribe']||!_0x1ac2cd[_0x6cf6('0x45')]||!_0x1ac2cd[_0x6cf6('0x46')]||!_0x1ac2cd[_0x6cf6('0x2e')]||!_0x1ac2cd[_0x6cf6('0x25')]){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))](_0x6cf6('0x47'));}return db[_0x6cf6('0x27')][_0x6cf6('0x28')]({'where':{'id':_0x1ac2cd[_0x6cf6('0x45')]}});})['then'](function(_0x217072){if(!_0x217072){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))](_0x6cf6('0x2a'));}if(!_0x217072[_0x6cf6('0xc')]||!_0x217072[_0x6cf6('0xd')]){throw new db[(_0x6cf6('0x29'))][(_0x6cf6('0x2b'))](_0x6cf6('0x2c'));}_0x3786d1=_0x217072;var _0x330919=[];_0x280e3a[_0x6cf6('0x48')](function(_0x4fb831){_0x330919[_0x6cf6('0x49')](checkTranscribeJob(_0x4fb831,_0x1ac2cd,_0x3786d1));});return BPromise['all'](_0x330919);})[_0x6cf6('0x3b')](function(_0xea457d){if(_0xea457d){if(!_0xea457d['name']||_0xea457d[_0x6cf6('0x3c')]!==_0x6cf6('0x3d')){logger[_0x6cf6('0x3e')](util[_0x6cf6('0x40')](_0xea457d,{'showHidden':![],'depth':null}));}}});}exports[_0x6cf6('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xd668=['detectSentiment','substring','info','format','data2','transcribeRegion','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','COMPLETED','catch','name','SequelizeValidationError','error','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','transcribe','TranscribeService','Comprehend'];(function(_0x5e1b45,_0x9aca66){var _0x3c14e6=function(_0x33abe8){while(--_0x33abe8){_0x5e1b45['push'](_0x5e1b45['shift']());}};_0x3c14e6(++_0x9aca66);}(_0xd668,0x108));var _0x8d66=function(_0x601cf7,_0x36e56d){_0x601cf7=_0x601cf7-0x0;var _0x4de216=_0xd668[_0x601cf7];return _0x4de216;};var _=require(_0x8d66('0x0'));var AWS=require(_0x8d66('0x1'));var rp=require(_0x8d66('0x2'));var util=require(_0x8d66('0x3'));var BPromise=require(_0x8d66('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x8d66('0x5'));function getTranscriptionJob(_0x1b25be,_0x41b1e2,_0x28df74,_0x486c9b){return new Promise(function(_0x5dc979,_0x1432e3){var _0x32c816=new AWS[(_0x8d66('0x6'))]({'accessKeyId':_0x41b1e2,'secretAccessKey':_0x1b25be,'region':_0x28df74});_0x32c816['getTranscriptionJob']({'TranscriptionJobName':_0x486c9b},function(_0x10e4cf,_0x34d28d){if(_0x10e4cf){return _0x1432e3(_0x10e4cf);}else{return _0x5dc979(_0x34d28d);}});});}function sentiment(_0x250844,_0x442c93,_0x5bc248,_0xf23bd5,_0x224af3){return new Promise(function(_0xdeb7dc,_0x354d88){var _0x5919a1=new AWS[(_0x8d66('0x7'))]({'accessKeyId':_0x442c93,'secretAccessKey':_0x250844,'region':_0x5bc248});_0x5919a1[_0x8d66('0x8')]({'Text':_0xf23bd5,'LanguageCode':_0x224af3[_0x8d66('0x9')](0x0,0x2)},function(_0x463ce7,_0x4ac289){if(_0x463ce7){return _0x354d88(_0x463ce7);}else{return _0xdeb7dc(_0x4ac289);}});});}function checkTranscribeJob(_0x2bedf8,_0x23709b,_0x414d03){var _0x5e1616;return new BPromise(function(_0x31f84f,_0x2f4863){logger[_0x8d66('0xa')](util[_0x8d66('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x2bedf8['id'],_0x2bedf8['transcribeName']));return getTranscriptionJob(_0x414d03['data1'],_0x414d03[_0x8d66('0xc')],_0x23709b[_0x8d66('0xd')],_0x2bedf8[_0x8d66('0xe')])[_0x8d66('0xf')](function(_0x542e11){logger[_0x8d66('0xa')](util[_0x8d66('0xb')](_0x8d66('0x10'),_0x2bedf8['id'],_0x2bedf8[_0x8d66('0xe')],_0x542e11['TranscriptionJob'][_0x8d66('0x11')]));if(!_0x2bedf8[_0x8d66('0x12')]){switch(_0x542e11['TranscriptionJob']['TranscriptionJobStatus']){case'COMPLETED':var _0x457f32={'transcribeStatus':_0x542e11[_0x8d66('0x13')][_0x8d66('0x11')],'fileUri':_0x542e11[_0x8d66('0x13')][_0x8d66('0x14')][_0x8d66('0x15')]};logger[_0x8d66('0xa')](util[_0x8d66('0xb')](_0x8d66('0x16'),_0x2bedf8['id']));return rp({'uri':_0x542e11[_0x8d66('0x13')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0x8d66('0xf')](function(_0x5f1a5f){logger[_0x8d66('0xa')](util[_0x8d66('0xb')](_0x8d66('0x17'),_0x2bedf8['id']));if(_0x5f1a5f&&_0x5f1a5f[_0x8d66('0x18')]&&_0x5f1a5f[_0x8d66('0x18')]['transcripts']&&_0x5f1a5f[_0x8d66('0x18')][_0x8d66('0x19')][_0x8d66('0x1a')]){_0x457f32[_0x8d66('0x12')]='';for(var _0x36443e=0x0;_0x36443e<_0x5f1a5f[_0x8d66('0x18')]['transcripts'][_0x8d66('0x1a')];_0x36443e++){_0x457f32[_0x8d66('0x12')]+=_0x5f1a5f[_0x8d66('0x18')][_0x8d66('0x19')][_0x36443e][_0x8d66('0x1b')]+'';}}return _0x2bedf8[_0x8d66('0x1c')](_0x457f32);})[_0x8d66('0xf')](function(){logger[_0x8d66('0xa')](util['format'](_0x8d66('0x1d'),_0x2bedf8['id']));if(!_0x2bedf8['tempSentiment']){throw new db[(_0x8d66('0x1e'))]['ValidationError'](_0x8d66('0x1f'));}if(!_0x23709b['sentiment']||!_0x23709b['sentimentAccountId']||!_0x23709b[_0x8d66('0x20')]||!_0x23709b[_0x8d66('0x21')]||!_0x23709b[_0x8d66('0x22')]){throw new db[(_0x8d66('0x1e'))][(_0x8d66('0x23'))](_0x8d66('0x24'));}if(!_0x457f32[_0x8d66('0x12')]){throw new Error(_0x8d66('0x25'));}if(_0x23709b[_0x8d66('0x26')]===_0x414d03['id']){return _0x414d03;}else{return db[_0x8d66('0x27')]['findOne']({'where':{'id':_settings[_0x8d66('0x26')]}});}})[_0x8d66('0xf')](function(_0x1fd203){if(!_0x1fd203){throw new db[(_0x8d66('0x1e'))][(_0x8d66('0x23'))](_0x8d66('0x28'));}if(!_0x1fd203[_0x8d66('0x29')]||!_0x1fd203['data2']){throw new db[(_0x8d66('0x1e'))][(_0x8d66('0x23'))](_0x8d66('0x2a'));}_0x5e1616=_0x1fd203;logger[_0x8d66('0xa')](util[_0x8d66('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2bedf8['id']));return sentiment(_0x5e1616[_0x8d66('0x29')],_0x5e1616[_0x8d66('0xc')],_0x23709b[_0x8d66('0x20')],_0x457f32['fileText'],_0x23709b[_0x8d66('0x21')]);})['then'](function(_0x14241f){logger[_0x8d66('0xa')](util[_0x8d66('0xb')](_0x8d66('0x2b'),_0x2bedf8['id']));return _0x2bedf8[_0x8d66('0x1c')]({'sentiment':_0x14241f[_0x8d66('0x2c')],'sPositive':_0x14241f[_0x8d66('0x2d')][_0x8d66('0x2e')],'sNegative':_0x14241f[_0x8d66('0x2d')]['Negative'],'sMixed':_0x14241f[_0x8d66('0x2d')]['Mixed'],'sNeutral':_0x14241f[_0x8d66('0x2d')]['Neutral']});})['then'](function(){logger[_0x8d66('0xa')](util['format'](_0x8d66('0x1d'),_0x2bedf8['id']));_0x31f84f();});case _0x8d66('0x2f'):return _0x2bedf8['update']({'transcribeStatus':_0x8d66('0x2f'),'failureReason':_0x542e11[_0x8d66('0x13')]['FailureReason']})[_0x8d66('0xf')](function(){logger[_0x8d66('0xa')](util[_0x8d66('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2bedf8['id']));_0x31f84f();});default:logger[_0x8d66('0xa')](util[_0x8d66('0xb')](_0x8d66('0x30'),_0x2bedf8['id']));break;}}else{return BPromise[_0x8d66('0x31')]()[_0x8d66('0xf')](function(){if(!_0x2bedf8[_0x8d66('0x32')]){throw new db[(_0x8d66('0x1e'))][(_0x8d66('0x23'))](_0x8d66('0x1f'));}if(!_0x23709b[_0x8d66('0x33')]||!_0x23709b['sentimentAccountId']||!_0x23709b[_0x8d66('0x20')]||!_0x23709b[_0x8d66('0x21')]||!_0x23709b[_0x8d66('0x22')]){throw new db[(_0x8d66('0x1e'))]['ValidationError'](_0x8d66('0x24'));}if(!_0x2bedf8['fileText']){throw new Error(_0x8d66('0x25'));}if(_0x23709b['sentimentAccountId']===_0x414d03['id']){return _0x414d03;}else{return db['CloudProvider'][_0x8d66('0x34')]({'where':{'id':_settings[_0x8d66('0x26')]}});}})[_0x8d66('0xf')](function(_0x4d658b){if(!_0x4d658b){throw new db['Sequelize']['ValidationError'](_0x8d66('0x28'));}if(!_0x4d658b[_0x8d66('0x29')]||!_0x4d658b['data2']){throw new db[(_0x8d66('0x1e'))][(_0x8d66('0x23'))](_0x8d66('0x2a'));}_0x5e1616=_0x4d658b;logger[_0x8d66('0xa')](util[_0x8d66('0xb')](_0x8d66('0x35'),_0x2bedf8['id']));return sentiment(_0x5e1616[_0x8d66('0x29')],_0x5e1616['data2'],_0x23709b['sentimentRegion'],_0x2bedf8[_0x8d66('0x12')],_0x23709b[_0x8d66('0x21')]);})[_0x8d66('0xf')](function(_0x335fd4){logger[_0x8d66('0xa')](util['format'](_0x8d66('0x2b'),_0x2bedf8['id']));return _0x2bedf8['update']({'sentiment':_0x335fd4[_0x8d66('0x2c')],'sPositive':_0x335fd4[_0x8d66('0x2d')][_0x8d66('0x2e')],'sNegative':_0x335fd4['SentimentScore']['Negative'],'sMixed':_0x335fd4[_0x8d66('0x2d')]['Mixed'],'sNeutral':_0x335fd4[_0x8d66('0x2d')]['Neutral'],'transcribeStatus':_0x8d66('0x36')});})['then'](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2bedf8['id']));_0x31f84f();});}})[_0x8d66('0x37')](function(_0x1e9e33){if(_0x1e9e33){if(!_0x1e9e33['name']||_0x1e9e33[_0x8d66('0x38')]!==_0x8d66('0x39')){logger[_0x8d66('0x3a')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2bedf8['id']),util['inspect'](_0x1e9e33,{'showHidden':![],'depth':null}));}}_0x31f84f();});});}function checkTranscribe(){var _0x5d29ee;var _0x4801cc;var _0x24d988;return db[_0x8d66('0x3b')][_0x8d66('0x3c')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x8d66('0xf')](function(_0x4ac1b0){if(!_0x4ac1b0||!_0x4ac1b0[_0x8d66('0x1a')]){throw new db[(_0x8d66('0x1e'))][(_0x8d66('0x23'))]('No\x20transcribe\x20job\x20to\x20check');}_0x5d29ee=_0x4ac1b0;return db[_0x8d66('0x3d')][_0x8d66('0x34')]({'where':{'id':0x1}});})[_0x8d66('0xf')](function(_0x3a631a){if(!_0x3a631a){throw new db[(_0x8d66('0x1e'))][(_0x8d66('0x23'))](_0x8d66('0x3e'));}_0x4801cc=_0x3a631a;if(!_0x4801cc[_0x8d66('0x5')]||!_0x4801cc['transcribeAccountId']||!_0x4801cc[_0x8d66('0xd')]||!_0x4801cc[_0x8d66('0x21')]||!_0x4801cc[_0x8d66('0x22')]){throw new db[(_0x8d66('0x1e'))][(_0x8d66('0x23'))]('Transcribe\x20not\x20configured');}return db[_0x8d66('0x27')][_0x8d66('0x34')]({'where':{'id':_0x4801cc[_0x8d66('0x3f')]}});})[_0x8d66('0xf')](function(_0x3378b5){if(!_0x3378b5){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3378b5[_0x8d66('0x29')]||!_0x3378b5[_0x8d66('0xc')]){throw new db[(_0x8d66('0x1e'))]['ValidationError'](_0x8d66('0x2a'));}_0x24d988=_0x3378b5;var _0x30260f=[];_0x5d29ee[_0x8d66('0x40')](function(_0x4daed6){_0x30260f[_0x8d66('0x41')](checkTranscribeJob(_0x4daed6,_0x4801cc,_0x24d988));});return BPromise['all'](_0x30260f);})['catch'](function(_0x24d86b){if(_0x24d86b){if(!_0x24d86b['name']||_0x24d86b[_0x8d66('0x38')]!==_0x8d66('0x39')){logger['error'](util[_0x8d66('0x42')](_0x24d86b,{'showHidden':![],'depth':null}));}}});}exports[_0x8d66('0x43')]=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 a62af07..c60b444 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 _0x6f75=['socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x1ccf3d,_0x461209){var _0x5345c1=function(_0x55c638){while(--_0x55c638){_0x1ccf3d['push'](_0x1ccf3d['shift']());}};_0x5345c1(++_0x461209);}(_0x6f75,0xf5));var _0x56f7=function(_0x167d6e,_0x405b4d){_0x167d6e=_0x167d6e-0x0;var _0x59bdfd=_0x6f75[_0x167d6e];return _0x59bdfd;};'use strict';var _=require(_0x56f7('0x0'));var moment=require(_0x56f7('0x1'));var Redis=require(_0x56f7('0x2'));var util=require(_0x56f7('0x3'));var config=require(_0x56f7('0x4'));var db=require(_0x56f7('0x5'))['db'];var logger=require(_0x56f7('0x6'))(_0x56f7('0x7'));config[_0x56f7('0x8')]=_[_0x56f7('0x9')](config[_0x56f7('0x8')],{'host':_0x56f7('0xa'),'port':0x18eb});var io=require(_0x56f7('0xb'))(new Redis(config[_0x56f7('0x8')]));function closeInteractions(){var _0x4e2e86=[];return db[_0x56f7('0xc')][_0x56f7('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x56f7('0xe')](0x18,_0x56f7('0xf'))}}})[_0x56f7('0x10')](function(_0x490e1a){if(_0x490e1a&&_0x490e1a[_0x56f7('0x11')]){_0x4e2e86=_[_0x56f7('0x12')](_0x490e1a||[],'id');logger[_0x56f7('0x13')](_0x56f7('0x14'),_0x4e2e86[_0x56f7('0x15')]());return db[_0x56f7('0xc')][_0x56f7('0x16')]({'closeReason':_0x56f7('0x17'),'disposition':_0x56f7('0x18'),'closed':!![],'closedAt':moment()[_0x56f7('0x19')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4e2e86}});}})['then'](function(){if(_0x4e2e86&&_0x4e2e86[_0x56f7('0x11')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x4e2e86[_0x56f7('0x15')]());for(var _0x392c7d=0x0;_0x392c7d<_0x4e2e86[_0x56f7('0x11')];_0x392c7d++){io['emit'](_0x56f7('0x1a'),{'id':_0x4e2e86[_0x392c7d],'closed':!![]});}}})[_0x56f7('0x1b')](function(_0x34b869){logger[_0x56f7('0x1c')](_0x56f7('0x1d'),_0x34b869?util[_0x56f7('0x1e')](_0x34b869,{'showHidden':![],'depth':null}):'');});}exports[_0x56f7('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1e44=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1314ac,_0x5c6efa){var _0x1e8899=function(_0x2a8da3){while(--_0x2a8da3){_0x1314ac['push'](_0x1314ac['shift']());}};_0x1e8899(++_0x5c6efa);}(_0x1e44,0xb3));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41e4('0x0'));var moment=require(_0x41e4('0x1'));var Redis=require(_0x41e4('0x2'));var util=require('util');var config=require(_0x41e4('0x3'));var db=require(_0x41e4('0x4'))['db'];var logger=require(_0x41e4('0x5'))(_0x41e4('0x6'));config['redis']=_[_0x41e4('0x7')](config[_0x41e4('0x8')],{'host':_0x41e4('0x9'),'port':0x18eb});var io=require(_0x41e4('0xa'))(new Redis(config[_0x41e4('0x8')]));function closeInteractions(){var _0x2e1640=[];return db[_0x41e4('0xb')][_0x41e4('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x41e4('0xd')](0x18,_0x41e4('0xe'))}}})[_0x41e4('0xf')](function(_0x20a924){if(_0x20a924&&_0x20a924[_0x41e4('0x10')]){_0x2e1640=_[_0x41e4('0x11')](_0x20a924||[],'id');logger[_0x41e4('0x12')](_0x41e4('0x13'),_0x2e1640['join']());return db['WhatsappInteraction'][_0x41e4('0x14')]({'closeReason':'system','disposition':_0x41e4('0x15'),'closed':!![],'closedAt':moment()[_0x41e4('0x16')](_0x41e4('0x17'))},{'where':{'id':_0x2e1640}});}})[_0x41e4('0xf')](function(){if(_0x2e1640&&_0x2e1640[_0x41e4('0x10')]){logger[_0x41e4('0x12')](_0x41e4('0x18'),_0x2e1640['join']());for(var _0x59c1b7=0x0;_0x59c1b7<_0x2e1640[_0x41e4('0x10')];_0x59c1b7++){io['emit'](_0x41e4('0x19'),{'id':_0x2e1640[_0x59c1b7],'closed':!![]});}}})['catch'](function(_0x23a442){logger[_0x41e4('0x1a')](_0x41e4('0x1b'),_0x23a442?util['inspect'](_0x23a442,{'showHidden':![],'depth':null}):'');});}exports[_0x41e4('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 86f3634..9810005 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe90d=['catch','util','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','destroy','CmContact','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2'];(function(_0x274c7c,_0x5d8c89){var _0x5f0a04=function(_0x15eff0){while(--_0x15eff0){_0x274c7c['push'](_0x274c7c['shift']());}};_0x5f0a04(++_0x5d8c89);}(_0xe90d,0x145));var _0xde90=function(_0x32521e,_0x32133f){_0x32521e=_0x32521e-0x0;var _0x531817=_0xe90d[_0x32521e];return _0x531817;};'use strict';var util=require(_0xde90('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xde90('0x1')+i,'lastName':_0xde90('0x2')+i,'phone':0xf879fb460+i,'email':_0xde90('0x3')+i+_0xde90('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xde90('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xde90('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xde90('0x6')](),'updatedAt':Date[_0xde90('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xde90('0x5')]({'id':i,'firstName':_0xde90('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xde90('0x3')+i+_0xde90('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xde90('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xde90('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xde90('0x6')](),'updatedAt':Date[_0xde90('0x6')]()});}db['CmContact'][_0xde90('0x7')]({'where':{}})['then'](function(){return db[_0xde90('0x8')][_0xde90('0x9')](contacts);})[_0xde90('0xa')](function(){console[_0xde90('0xb')](_0xde90('0xc'),_0xde90('0xd'));return db[_0xde90('0xe')][_0xde90('0x7')]({'where':{}});})[_0xde90('0xa')](function(){return db[_0xde90('0xe')][_0xde90('0x9')](hopper);})['then'](function(){console[_0xde90('0xb')](_0xde90('0xc'),_0xde90('0xf'));return db[_0xde90('0x8')]['bulkCreate'](contacts2);})[_0xde90('0xa')](function(){console['log'](_0xde90('0xc'),_0xde90('0x10'));return db['CmHopper'][_0xde90('0x9')](hopper2);})[_0xde90('0xa')](function(){console[_0xde90('0xb')](_0xde90('0xc'),'hopper2');})[_0xde90('0x11')](function(_0x4be5d2){console['log'](_0x4be5d2);}); \ No newline at end of file +var _0x2d7d=['bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','hopper2','util','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact'];(function(_0x3a5fc6,_0x56b37a){var _0x2aa006=function(_0x26e565){while(--_0x26e565){_0x3a5fc6['push'](_0x3a5fc6['shift']());}};_0x2aa006(++_0x56b37a);}(_0x2d7d,0x14e));var _0xd2d7=function(_0x5dc512,_0x3be383){_0x5dc512=_0x5dc512-0x0;var _0x362408=_0x2d7d[_0x5dc512];return _0x362408;};'use strict';var util=require(_0xd2d7('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd2d7('0x1')]({'id':i,'firstName':_0xd2d7('0x2')+i,'lastName':_0xd2d7('0x3')+i,'phone':0xf879fb460+i,'email':_0xd2d7('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xd2d7('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd2d7('0x5')](),'updatedAt':Date[_0xd2d7('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd2d7('0x1')]({'id':i,'firstName':_0xd2d7('0x2')+i,'lastName':_0xd2d7('0x3')+i,'phone':0xf879fb460+i,'email':_0xd2d7('0x4')+i+_0xd2d7('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd2d7('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xd2d7('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd2d7('0x5')](),'updatedAt':Date['now']()});}db[_0xd2d7('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0xd2d7('0x7')][_0xd2d7('0x8')](contacts);})[_0xd2d7('0x9')](function(){console[_0xd2d7('0xa')](_0xd2d7('0xb'),_0xd2d7('0xc'));return db[_0xd2d7('0xd')][_0xd2d7('0xe')]({'where':{}});})[_0xd2d7('0x9')](function(){return db['CmHopper'][_0xd2d7('0x8')](hopper);})[_0xd2d7('0x9')](function(){console['log'](_0xd2d7('0xb'),_0xd2d7('0xf'));return db[_0xd2d7('0x7')]['bulkCreate'](contacts2);})[_0xd2d7('0x9')](function(){console['log'](_0xd2d7('0xb'),_0xd2d7('0x10'));return db[_0xd2d7('0xd')][_0xd2d7('0x8')](hopper2);})['then'](function(){console['log']('finished\x20populating',_0xd2d7('0x11'));})['catch'](function(_0x20447a){console[_0xd2d7('0xa')](_0x20447a);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 703d366..d5c842b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4db8=['/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','then','log','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes'];(function(_0x271755,_0x518c8d){var _0x5b5b92=function(_0x2b0f20){while(--_0x2b0f20){_0x271755['push'](_0x271755['shift']());}};_0x5b5b92(++_0x518c8d);}(_0x4db8,0x6b));var _0x84db=function(_0x4dc5ca,_0x209e40){_0x4dc5ca=_0x4dc5ca-0x0;var _0x6ff6fb=_0x4db8[_0x4dc5ca];return _0x6ff6fb;};'use strict';var util=require(_0x84db('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x84db('0x1')]({'name':util[_0x84db('0x2')](_0x84db('0x3'),_0x84db('0x4'),i),'fullname':util[_0x84db('0x2')]('%s%s',_0x84db('0x4'),i),'email':util['format'](_0x84db('0x5'),_0x84db('0x4'),i),'role':_0x84db('0x4'),'password':_0x84db('0x6'),'internal':0xfa0+i,'type':_0x84db('0x7'),'transport':[_0x84db('0x8'),'ws',_0x84db('0x9')],'disallow':[_0x84db('0xa')],'allow':[_0x84db('0xb')],'defaultuser':util['format'](_0x84db('0x3'),_0x84db('0x4'),i),'encryption':'yes','avpf':_0x84db('0xc'),'force_avp':_0x84db('0xc'),'icesupport':_0x84db('0xc'),'dtlsenable':_0x84db('0xc'),'dtlsverify':'no','dtlscertfile':_0x84db('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x84db('0xe'),'callerid':util[_0x84db('0x2')](_0x84db('0xf'),util['format']('%s%s','agent',i),0xfa0+i)});}db[_0x84db('0x10')]['bulkCreate'](users)[_0x84db('0x11')](function(){console[_0x84db('0x12')]('add\x20user');})[_0x84db('0x13')](function(_0x59b88d){console['log'](_0x59b88d);}); \ No newline at end of file +var _0x123f=['util','push','format','%s%s','agent','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch'];(function(_0x5811df,_0x19c623){var _0x12b054=function(_0x2874c9){while(--_0x2874c9){_0x5811df['push'](_0x5811df['shift']());}};_0x12b054(++_0x19c623);}(_0x123f,0x17a));var _0xf123=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x123f[_0x26f702];return _0x11417d;};'use strict';var util=require(_0xf123('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf123('0x1')]({'name':util[_0xf123('0x2')](_0xf123('0x3'),_0xf123('0x4'),i),'fullname':util[_0xf123('0x2')](_0xf123('0x3'),'agent',i),'email':util['format']('%s%s@xcally.com','agent',i),'role':_0xf123('0x4'),'password':'password','internal':0xfa0+i,'type':_0xf123('0x5'),'transport':['udp','ws',_0xf123('0x6')],'disallow':['all'],'allow':[_0xf123('0x7')],'defaultuser':util[_0xf123('0x2')]('%s%s',_0xf123('0x4'),i),'encryption':_0xf123('0x8'),'avpf':_0xf123('0x8'),'force_avp':_0xf123('0x8'),'icesupport':_0xf123('0x8'),'dtlsenable':_0xf123('0x8'),'dtlsverify':'no','dtlscertfile':_0xf123('0x9'),'dtlsprivatekey':_0xf123('0xa'),'dtlssetup':_0xf123('0xb'),'callerid':util[_0xf123('0x2')]('\x22%s\x22\x20<%s>',util['format'](_0xf123('0x3'),_0xf123('0x4'),i),0xfa0+i)});}db[_0xf123('0xc')][_0xf123('0xd')](users)[_0xf123('0xe')](function(){console[_0xf123('0xf')](_0xf123('0x10'));})[_0xf123('0x11')](function(_0x4eed82){console['log'](_0x4eed82);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 97ed956..8a5051a 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14d8=['OpenchannelQueue','Trunks','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','voice','chat','sms','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','lodash','util','bluebird','../mysqldb','./environment','name','User','telephone','agent','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','where','role','Campaign','format','%s:queue:%s','Agents','length','query','find','userProfileId','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','voice:outbound','ChatQueue'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x14d8,0x87));var _0x814d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x14d8[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x814d('0x0'));var util=require(_0x814d('0x1'));var BPromise=require(_0x814d('0x2'));var db=require(_0x814d('0x3'))['db'];var config=require(_0x814d('0x4'));var queryQueues={'attributes':['id',_0x814d('0x5')],'include':[{'as':'Agents','model':db[_0x814d('0x6')],'attributes':['id','name','role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x814d('0x5')],'where':{'role':_0x814d('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x814d('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x814d('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x814d('0x5'),_0x814d('0x9')],'where':{'type':_0x814d('0xa')}};function getAssociatedResources(_0x3c176e,_0x94073c,_0x20b1a2){return db['UserProfileSection'][_0x814d('0xb')]({'where':{'name':_0x3c176e,'userProfileId':_0x94073c},'raw':!![]})[_0x814d('0xc')](function(_0x39ad3b){if(_0x39ad3b){if(_0x39ad3b[_0x814d('0xd')]){switch(_0x3c176e){case _0x814d('0xe'):case _0x814d('0xf'):case _0x814d('0x10'):case _0x814d('0x11'):case _0x814d('0x12'):case _0x814d('0x13'):case _0x814d('0x14'):return db[_0x20b1a2][_0x814d('0x15')](queryQueues);case _0x814d('0x16'):return db[_0x20b1a2][_0x814d('0x15')](queryTelephones);case'Trunks':return db[_0x20b1a2][_0x814d('0x15')](queryTrunks);case _0x814d('0x17'):return db[_0x20b1a2][_0x814d('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0x814d('0x15')]({'attributes':[_0x814d('0x18')],'where':{'sectionId':_0x39ad3b['id']},'raw':!![]})[_0x814d('0xc')](function(_0xd4e77b){if(_0xd4e77b){var _0x19ccd8={'where':{'id':_[_0x814d('0x19')](_0xd4e77b,'resourceId')},'raw':!![]};switch(_0x20b1a2){case _0x814d('0x6'):_0x19ccd8[_0x814d('0x1a')][_0x814d('0x1b')]='telephone';break;case _0x814d('0x1c'):_0x19ccd8[_0x814d('0x1a')]['type']=_0x814d('0xa');break;}return db[_0x20b1a2][_0x814d('0x15')](_0x19ccd8);}else{return[];}});}}else{return[];}})[_0x814d('0xc')](function(_0x55ac9c){return _0x55ac9c;});}function joinOrLeaveQueues(_0x3634fe,_0x2eed86,_0x1e6c16,_0x2703ce){_0x3634fe[_0x2eed86](util[_0x814d('0x1d')](_0x814d('0x1e'),_0x1e6c16,_0x2703ce[_0x814d('0x5')]));if(_0x2703ce['Agents']){for(var _0x1be432=0x0;_0x1be432<_0x2703ce[_0x814d('0x1f')][_0x814d('0x20')];_0x1be432+=0x1){_0x3634fe[_0x2eed86](util[_0x814d('0x1d')]('user:%s',_0x2703ce['Agents'][_0x1be432][_0x814d('0x5')]));}}}function joinOrLeave(_0x3469b4,_0x376c31,_0x26d998){var _0xfc1f7b;if(_0x3469b4['handshake'][_0x814d('0x21')]['id']){db[_0x814d('0x6')][_0x814d('0x22')]({'attributes':['id',_0x814d('0x5'),'role',_0x814d('0x23')],'where':{'id':_0x3469b4['handshake']['query']['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x814d('0x24')],'as':_0x814d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x814d('0x26')],'as':_0x814d('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x814d('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x814d('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x814d('0x2a')],'as':_0x814d('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x814d('0xc')](function(_0x1cf59b){if(_0x1cf59b){_0xfc1f7b=_0x1cf59b;_0x3469b4[_0x376c31](util[_0x814d('0x1d')](_0x814d('0x2c'),_0x1cf59b[_0x814d('0x5')]));var _0x113b51=[];switch(_0x1cf59b['role']){case _0x814d('0x2d'):_0x3469b4[_0x376c31](_0x814d('0x2e'));_0x3469b4[_0x376c31]('voice:outbound');if(queryQueues[_0x814d('0x2f')](_0x814d('0x30'))){delete queryQueues['include'];}_0x113b51['push'](db[_0x814d('0x31')][_0x814d('0x15')](queryQueues));_0x113b51['push'](db['ChatQueue'][_0x814d('0x15')](queryQueues));_0x113b51[_0x814d('0x32')](db[_0x814d('0x33')][_0x814d('0x15')](queryQueues));_0x113b51['push'](db[_0x814d('0x34')][_0x814d('0x15')](queryQueues));_0x113b51[_0x814d('0x32')](db[_0x814d('0x35')][_0x814d('0x15')](queryQueues));_0x113b51[_0x814d('0x32')](db['OpenchannelQueue']['findAll'](queryQueues));_0x113b51['push'](db[_0x814d('0x36')][_0x814d('0x15')](queryQueues));_0x113b51[_0x814d('0x32')](db[_0x814d('0x6')][_0x814d('0x15')](queryTelephones));_0x113b51[_0x814d('0x32')](db[_0x814d('0x37')][_0x814d('0x15')](queryTrunks));_0x113b51[_0x814d('0x32')](db[_0x814d('0x1c')][_0x814d('0x15')](queryCampaigns));_0x113b51[_0x814d('0x32')](db[_0x814d('0x6')][_0x814d('0x15')](queryAgents));break;case _0x814d('0x38'):_0x3469b4[_0x376c31]('voice:inbound');_0x3469b4[_0x376c31](_0x814d('0x39'));_0x113b51[_0x814d('0x32')](getAssociatedResources(_0x814d('0xe'),_0x1cf59b[_0x814d('0x23')],_0x814d('0x31')));_0x113b51[_0x814d('0x32')](getAssociatedResources(_0x814d('0xf'),_0x1cf59b[_0x814d('0x23')],_0x814d('0x3a')));_0x113b51[_0x814d('0x32')](getAssociatedResources(_0x814d('0x10'),_0x1cf59b[_0x814d('0x23')],_0x814d('0x33')));_0x113b51[_0x814d('0x32')](getAssociatedResources('SmsQueues',_0x1cf59b[_0x814d('0x23')],_0x814d('0x34')));_0x113b51[_0x814d('0x32')](getAssociatedResources('MailQueues',_0x1cf59b[_0x814d('0x23')],_0x814d('0x35')));_0x113b51[_0x814d('0x32')](getAssociatedResources('OpenchannelQueues',_0x1cf59b[_0x814d('0x23')],_0x814d('0x3b')));_0x113b51[_0x814d('0x32')](getAssociatedResources('WhatsappQueues',_0x1cf59b[_0x814d('0x23')],_0x814d('0x36')));_0x113b51['push'](getAssociatedResources(_0x814d('0x16'),_0x1cf59b[_0x814d('0x23')],'User'));_0x113b51[_0x814d('0x32')](getAssociatedResources(_0x814d('0x3c'),_0x1cf59b['userProfileId'],_0x814d('0x37')));_0x113b51[_0x814d('0x32')](getAssociatedResources(_0x814d('0x17'),_0x1cf59b[_0x814d('0x23')],_0x814d('0x1c')));_0x113b51['push'](db[_0x814d('0x6')][_0x814d('0x15')](queryAgents));break;case'agent':_0x3469b4[_0x376c31](_0x814d('0x2e'));_0x3469b4[_0x376c31](_0x814d('0x39'));_0x113b51[_0x814d('0x32')](_0x1cf59b['getVoiceQueues']({'attributes':['id',_0x814d('0x5')]}));_0x113b51['push'](_0x1cf59b[_0x814d('0x3d')]({'attributes':['id',_0x814d('0x5')]}));_0x113b51[_0x814d('0x32')](_0x1cf59b[_0x814d('0x3e')]({'attributes':['id',_0x814d('0x5')]}));_0x113b51[_0x814d('0x32')](_0x1cf59b[_0x814d('0x3f')]({'attributes':['id',_0x814d('0x5')]}));_0x113b51['push'](_0x1cf59b['getMailQueues']({'attributes':['id',_0x814d('0x5')]}));_0x113b51[_0x814d('0x32')](_0x1cf59b[_0x814d('0x40')]({'attributes':['id',_0x814d('0x5')]}));_0x113b51[_0x814d('0x32')](_0x1cf59b['getWhatsappQueues']({'attributes':['id',_0x814d('0x5')]}));break;}return BPromise[_0x814d('0x41')](_0x113b51);}})['then'](function(_0x58bdb7){if(_0x58bdb7&&_0x58bdb7['length']){for(var _0x11ab3c=0x0;_0x11ab3c<_0x58bdb7[_0x814d('0x20')];_0x11ab3c+=0x1){for(var _0x42dfff=0x0;_0x42dfff<_0x58bdb7[_0x11ab3c][_0x814d('0x20')];_0x42dfff+=0x1){switch(_0x11ab3c){case 0x0:joinOrLeaveQueues(_0x3469b4,_0x376c31,_0x814d('0x42'),_0x58bdb7[_0x11ab3c][_0x42dfff]);break;case 0x1:joinOrLeaveQueues(_0x3469b4,_0x376c31,_0x814d('0x43'),_0x58bdb7[_0x11ab3c][_0x42dfff]);break;case 0x2:joinOrLeaveQueues(_0x3469b4,_0x376c31,'fax',_0x58bdb7[_0x11ab3c][_0x42dfff]);break;case 0x3:joinOrLeaveQueues(_0x3469b4,_0x376c31,_0x814d('0x44'),_0x58bdb7[_0x11ab3c][_0x42dfff]);break;case 0x4:joinOrLeaveQueues(_0x3469b4,_0x376c31,'mail',_0x58bdb7[_0x11ab3c][_0x42dfff]);break;case 0x5:joinOrLeaveQueues(_0x3469b4,_0x376c31,_0x814d('0x45'),_0x58bdb7[_0x11ab3c][_0x42dfff]);break;case 0x6:joinOrLeaveQueues(_0x3469b4,_0x376c31,_0x814d('0x46'),_0x58bdb7[_0x11ab3c][_0x42dfff]);break;case 0x7:if(_0xfc1f7b['role']!==_0x814d('0x8'))_0x3469b4[_0x376c31](util[_0x814d('0x1d')](_0x814d('0x47'),_0x58bdb7[_0x11ab3c][_0x42dfff]['name']));break;case 0x8:if(_0xfc1f7b['role']!==_0x814d('0x8'))_0x3469b4[_0x376c31](util[_0x814d('0x1d')](_0x814d('0x48'),_0x58bdb7[_0x11ab3c][_0x42dfff]['name']));break;case 0x9:if(_0xfc1f7b['role']!==_0x814d('0x8'))_0x3469b4[_0x376c31](util[_0x814d('0x1d')]('campaign:%s:%s',_0x58bdb7[_0x11ab3c][_0x42dfff][_0x814d('0x9')],_0x58bdb7[_0x11ab3c][_0x42dfff][_0x814d('0x5')]));break;case 0xa:_0x3469b4[_0x376c31](util[_0x814d('0x1d')](_0x814d('0x2c'),_0x58bdb7[_0x11ab3c][_0x42dfff][_0x814d('0x5')]));break;}}}}})[_0x814d('0xc')](function(){if(_0x376c31===_0x814d('0x49')){var _0x50e17e=_[_0x814d('0x19')](_0xfc1f7b['ChatInteractions'],'id');return _0xfc1f7b[_0x814d('0x4a')](_0x50e17e)['then'](function(){for(var _0x213aaa=0x0;_0x213aaa<_0x50e17e[_0x814d('0x20')];_0x213aaa+=0x1){_0x26d998[_0x814d('0x4b')](_0x814d('0x4c'),{'ChatInteractionId':Number(_0x50e17e[_0x213aaa]),'UserId':Number(_0xfc1f7b['id'])});}});}})[_0x814d('0xc')](function(){if(_0x376c31===_0x814d('0x49')){var _0xc4a133=_[_0x814d('0x19')](_0xfc1f7b[_0x814d('0x25')],'id');return _0xfc1f7b[_0x814d('0x4d')](_0xc4a133)['then'](function(){for(var _0x4e5df3=0x0;_0x4e5df3<_0xc4a133['length'];_0x4e5df3+=0x1){_0x26d998[_0x814d('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xc4a133[_0x4e5df3]),'UserId':Number(_0xfc1f7b['id'])});}});}})[_0x814d('0xc')](function(){if(_0x376c31===_0x814d('0x49')){var _0x479fde=_[_0x814d('0x19')](_0xfc1f7b['FaxInteractions'],'id');return _0xfc1f7b[_0x814d('0x4e')](_0x479fde)['then'](function(){for(var _0x233aba=0x0;_0x233aba<_0x479fde[_0x814d('0x20')];_0x233aba+=0x1){_0x26d998[_0x814d('0x4b')](_0x814d('0x4f'),{'FaxInteractionId':Number(_0x479fde[_0x233aba]),'UserId':Number(_0xfc1f7b['id'])});}});}})[_0x814d('0xc')](function(){if(_0x376c31===_0x814d('0x49')){var _0x4bf2ef=_[_0x814d('0x19')](_0xfc1f7b[_0x814d('0x28')],'id');return _0xfc1f7b[_0x814d('0x50')](_0x4bf2ef)['then'](function(){for(var _0x4c60f7=0x0;_0x4c60f7<_0x4bf2ef[_0x814d('0x20')];_0x4c60f7+=0x1){_0x26d998[_0x814d('0x4b')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x4bf2ef[_0x4c60f7]),'UserId':Number(_0xfc1f7b['id'])});}});}})['then'](function(){if(_0x376c31==='leave'){var _0x5da0d1=_[_0x814d('0x19')](_0xfc1f7b[_0x814d('0x29')],'id');return _0xfc1f7b['removeOpenchannelInteractions'](_0x5da0d1)[_0x814d('0xc')](function(){for(var _0x482591=0x0;_0x482591<_0x5da0d1[_0x814d('0x20')];_0x482591+=0x1){_0x26d998[_0x814d('0x4b')](_0x814d('0x51'),{'OpenchannelInteractionId':Number(_0x5da0d1[_0x482591]),'UserId':Number(_0xfc1f7b['id'])});}});}})[_0x814d('0xc')](function(){if(_0x376c31==='leave'){var _0x56996a=_[_0x814d('0x19')](_0xfc1f7b[_0x814d('0x2b')],'id');return _0xfc1f7b[_0x814d('0x52')](_0x56996a)[_0x814d('0xc')](function(){for(var _0x1dae1e=0x0;_0x1dae1e<_0x56996a[_0x814d('0x20')];_0x1dae1e+=0x1){_0x26d998[_0x814d('0x4b')](_0x814d('0x53'),{'WhatsappInteractionId':Number(_0x56996a[_0x1dae1e]),'UserId':Number(_0xfc1f7b['id'])});}});}})[_0x814d('0x54')](function(_0xd06c1c){_0x3469b4[_0x814d('0x55')](_0xd06c1c);});}}function onDisconnect(_0x3e877a,_0x51d6b1){joinOrLeave(_0x3e877a,'leave',_0x51d6b1);}function onConnect(_0x5178d2){joinOrLeave(_0x5178d2,_0x814d('0x56'));}exports[_0x814d('0x57')]=function(_0x434808){_0x434808['on'](_0x814d('0x58'),function(_0x1434c2){_0x1434c2[_0x814d('0x59')](0x0);_0x1434c2[_0x814d('0x5a')]=_0x1434c2[_0x814d('0x5b')][_0x814d('0x58')][_0x814d('0x5c')]+':'+_0x1434c2[_0x814d('0x5b')][_0x814d('0x58')]['remotePort'];_0x1434c2[_0x814d('0x5d')]=new Date();_0x1434c2[_0x814d('0x55')]=function(_0xc3404c){console[_0x814d('0x55')](_0x814d('0x5e')+_0x1434c2[_0x814d('0x5f')][_0x814d('0x5')]+'['+_0x1434c2[_0x814d('0x5a')]+']',_0xc3404c);};_0x1434c2['on'](_0x814d('0x60'),function(){onDisconnect(_0x1434c2,_0x434808);_0x1434c2['log']('DISCONNECTED');});onConnect(_0x1434c2);_0x1434c2[_0x814d('0x55')]('CONNECTED');});}; \ No newline at end of file +var _0xafcd=['MailQueue','OpenchannelQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','mail','openchannel','telephone:%s','trunk:%s','user:%s','leave','user_has_chat_interactions:remove','removeMailInteractions','emit','FaxInteractions','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','address','request','remoteAddress','connectedAt','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Trunks','IvrCampaigns','UserProfileResource','findAll','resourceId','map','User','Campaign','where','format','%s:queue:%s','query','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','SmsQueue','WhatsappQueue','Trunk','user','VoiceQueues','ChatQueues','ChatQueue','FaxQueue'];(function(_0x82c804,_0xb02e7b){var _0xa45350=function(_0x52dac6){while(--_0x52dac6){_0x82c804['push'](_0x82c804['shift']());}};_0xa45350(++_0xb02e7b);}(_0xafcd,0x157));var _0xdafc=function(_0x22a409,_0x1e7083){_0x22a409=_0x22a409-0x0;var _0x4ffcf0=_0xafcd[_0x22a409];return _0x4ffcf0;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var BPromise=require(_0xdafc('0x2'));var db=require(_0xdafc('0x3'))['db'];var config=require(_0xdafc('0x4'));var queryQueues={'attributes':['id',_0xdafc('0x5')],'include':[{'as':_0xdafc('0x6'),'model':db['User'],'attributes':['id',_0xdafc('0x5'),_0xdafc('0x7')],'raw':!![],'where':{'role':_0xdafc('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xdafc('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xdafc('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xdafc('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xdafc('0x5'),_0xdafc('0xa')],'where':{'type':_0xdafc('0xb')}};function getAssociatedResources(_0x2592ed,_0x4571c6,_0x241787){return db[_0xdafc('0xc')][_0xdafc('0xd')]({'where':{'name':_0x2592ed,'userProfileId':_0x4571c6},'raw':!![]})[_0xdafc('0xe')](function(_0x2fdc39){if(_0x2fdc39){if(_0x2fdc39[_0xdafc('0xf')]){switch(_0x2592ed){case'VoiceQueues':case'ChatQueues':case _0xdafc('0x10'):case _0xdafc('0x11'):case _0xdafc('0x12'):case _0xdafc('0x13'):case _0xdafc('0x14'):return db[_0x241787]['findAll'](queryQueues);case'Telephones':return db[_0x241787]['findAll'](queryTelephones);case _0xdafc('0x15'):return db[_0x241787]['findAll'](queryTrunks);case _0xdafc('0x16'):return db[_0x241787]['findAll'](queryCampaigns);}}else{return db[_0xdafc('0x17')][_0xdafc('0x18')]({'attributes':[_0xdafc('0x19')],'where':{'sectionId':_0x2fdc39['id']},'raw':!![]})[_0xdafc('0xe')](function(_0x4b7158){if(_0x4b7158){var _0x540bf9={'where':{'id':_[_0xdafc('0x1a')](_0x4b7158,_0xdafc('0x19'))},'raw':!![]};switch(_0x241787){case _0xdafc('0x1b'):_0x540bf9['where']['role']=_0xdafc('0x9');break;case _0xdafc('0x1c'):_0x540bf9[_0xdafc('0x1d')][_0xdafc('0xa')]=_0xdafc('0xb');break;}return db[_0x241787][_0xdafc('0x18')](_0x540bf9);}else{return[];}});}}else{return[];}})[_0xdafc('0xe')](function(_0x1c962c){return _0x1c962c;});}function joinOrLeaveQueues(_0x58ca4d,_0x3d3dc5,_0x10258f,_0x5f4d1d){_0x58ca4d[_0x3d3dc5](util[_0xdafc('0x1e')](_0xdafc('0x1f'),_0x10258f,_0x5f4d1d[_0xdafc('0x5')]));if(_0x5f4d1d[_0xdafc('0x6')]){for(var _0x44f8f8=0x0;_0x44f8f8<_0x5f4d1d[_0xdafc('0x6')]['length'];_0x44f8f8+=0x1){_0x58ca4d[_0x3d3dc5](util['format']('user:%s',_0x5f4d1d[_0xdafc('0x6')][_0x44f8f8]['name']));}}}function joinOrLeave(_0x159d51,_0x2bf00a,_0x6c6e4c){var _0x17c2f6;if(_0x159d51['handshake'][_0xdafc('0x20')]['id']){db[_0xdafc('0x1b')]['find']({'attributes':['id',_0xdafc('0x5'),_0xdafc('0x7'),_0xdafc('0x21')],'where':{'id':_0x159d51[_0xdafc('0x22')][_0xdafc('0x20')]['id']},'include':[{'model':db[_0xdafc('0x23')],'as':_0xdafc('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xdafc('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xdafc('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xdafc('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xdafc('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xdafc('0x29'),'attributes':['id'],'raw':!![]}]})[_0xdafc('0xe')](function(_0x5d62e1){if(_0x5d62e1){_0x17c2f6=_0x5d62e1;_0x159d51[_0x2bf00a](util[_0xdafc('0x1e')]('user:%s',_0x5d62e1['name']));var _0x4ff3d9=[];switch(_0x5d62e1[_0xdafc('0x7')]){case _0xdafc('0x2a'):_0x159d51[_0x2bf00a](_0xdafc('0x2b'));_0x159d51[_0x2bf00a](_0xdafc('0x2c'));if(queryQueues[_0xdafc('0x2d')](_0xdafc('0x2e'))){delete queryQueues[_0xdafc('0x2e')];}_0x4ff3d9['push'](db[_0xdafc('0x2f')][_0xdafc('0x18')](queryQueues));_0x4ff3d9['push'](db['ChatQueue'][_0xdafc('0x18')](queryQueues));_0x4ff3d9[_0xdafc('0x30')](db['FaxQueue']['findAll'](queryQueues));_0x4ff3d9[_0xdafc('0x30')](db[_0xdafc('0x31')]['findAll'](queryQueues));_0x4ff3d9['push'](db['MailQueue']['findAll'](queryQueues));_0x4ff3d9[_0xdafc('0x30')](db['OpenchannelQueue'][_0xdafc('0x18')](queryQueues));_0x4ff3d9[_0xdafc('0x30')](db[_0xdafc('0x32')][_0xdafc('0x18')](queryQueues));_0x4ff3d9['push'](db[_0xdafc('0x1b')][_0xdafc('0x18')](queryTelephones));_0x4ff3d9[_0xdafc('0x30')](db[_0xdafc('0x33')][_0xdafc('0x18')](queryTrunks));_0x4ff3d9[_0xdafc('0x30')](db['Campaign'][_0xdafc('0x18')](queryCampaigns));_0x4ff3d9[_0xdafc('0x30')](db[_0xdafc('0x1b')]['findAll'](queryAgents));break;case _0xdafc('0x34'):_0x159d51[_0x2bf00a]('voice:inbound');_0x159d51[_0x2bf00a](_0xdafc('0x2c'));_0x4ff3d9['push'](getAssociatedResources(_0xdafc('0x35'),_0x5d62e1[_0xdafc('0x21')],_0xdafc('0x2f')));_0x4ff3d9[_0xdafc('0x30')](getAssociatedResources(_0xdafc('0x36'),_0x5d62e1[_0xdafc('0x21')],_0xdafc('0x37')));_0x4ff3d9['push'](getAssociatedResources(_0xdafc('0x10'),_0x5d62e1['userProfileId'],_0xdafc('0x38')));_0x4ff3d9[_0xdafc('0x30')](getAssociatedResources(_0xdafc('0x11'),_0x5d62e1['userProfileId'],'SmsQueue'));_0x4ff3d9[_0xdafc('0x30')](getAssociatedResources(_0xdafc('0x12'),_0x5d62e1['userProfileId'],_0xdafc('0x39')));_0x4ff3d9['push'](getAssociatedResources(_0xdafc('0x13'),_0x5d62e1[_0xdafc('0x21')],_0xdafc('0x3a')));_0x4ff3d9['push'](getAssociatedResources('WhatsappQueues',_0x5d62e1['userProfileId'],_0xdafc('0x32')));_0x4ff3d9[_0xdafc('0x30')](getAssociatedResources(_0xdafc('0x3b'),_0x5d62e1[_0xdafc('0x21')],'User'));_0x4ff3d9[_0xdafc('0x30')](getAssociatedResources(_0xdafc('0x15'),_0x5d62e1['userProfileId'],_0xdafc('0x33')));_0x4ff3d9['push'](getAssociatedResources('IvrCampaigns',_0x5d62e1[_0xdafc('0x21')],_0xdafc('0x1c')));_0x4ff3d9[_0xdafc('0x30')](db['User'][_0xdafc('0x18')](queryAgents));break;case _0xdafc('0x8'):_0x159d51[_0x2bf00a]('voice:inbound');_0x159d51[_0x2bf00a](_0xdafc('0x2c'));_0x4ff3d9[_0xdafc('0x30')](_0x5d62e1[_0xdafc('0x3c')]({'attributes':['id',_0xdafc('0x5')]}));_0x4ff3d9[_0xdafc('0x30')](_0x5d62e1[_0xdafc('0x3d')]({'attributes':['id',_0xdafc('0x5')]}));_0x4ff3d9[_0xdafc('0x30')](_0x5d62e1[_0xdafc('0x3e')]({'attributes':['id',_0xdafc('0x5')]}));_0x4ff3d9['push'](_0x5d62e1[_0xdafc('0x3f')]({'attributes':['id',_0xdafc('0x5')]}));_0x4ff3d9[_0xdafc('0x30')](_0x5d62e1[_0xdafc('0x40')]({'attributes':['id',_0xdafc('0x5')]}));_0x4ff3d9['push'](_0x5d62e1[_0xdafc('0x41')]({'attributes':['id',_0xdafc('0x5')]}));_0x4ff3d9['push'](_0x5d62e1[_0xdafc('0x42')]({'attributes':['id','name']}));break;}return BPromise[_0xdafc('0x43')](_0x4ff3d9);}})['then'](function(_0xf5b683){if(_0xf5b683&&_0xf5b683[_0xdafc('0x44')]){for(var _0x1c8ab7=0x0;_0x1c8ab7<_0xf5b683[_0xdafc('0x44')];_0x1c8ab7+=0x1){for(var _0x578a0b=0x0;_0x578a0b<_0xf5b683[_0x1c8ab7][_0xdafc('0x44')];_0x578a0b+=0x1){switch(_0x1c8ab7){case 0x0:joinOrLeaveQueues(_0x159d51,_0x2bf00a,_0xdafc('0x45'),_0xf5b683[_0x1c8ab7][_0x578a0b]);break;case 0x1:joinOrLeaveQueues(_0x159d51,_0x2bf00a,_0xdafc('0x46'),_0xf5b683[_0x1c8ab7][_0x578a0b]);break;case 0x2:joinOrLeaveQueues(_0x159d51,_0x2bf00a,_0xdafc('0x47'),_0xf5b683[_0x1c8ab7][_0x578a0b]);break;case 0x3:joinOrLeaveQueues(_0x159d51,_0x2bf00a,'sms',_0xf5b683[_0x1c8ab7][_0x578a0b]);break;case 0x4:joinOrLeaveQueues(_0x159d51,_0x2bf00a,_0xdafc('0x48'),_0xf5b683[_0x1c8ab7][_0x578a0b]);break;case 0x5:joinOrLeaveQueues(_0x159d51,_0x2bf00a,_0xdafc('0x49'),_0xf5b683[_0x1c8ab7][_0x578a0b]);break;case 0x6:joinOrLeaveQueues(_0x159d51,_0x2bf00a,'whatsapp',_0xf5b683[_0x1c8ab7][_0x578a0b]);break;case 0x7:if(_0x17c2f6['role']!==_0xdafc('0x8'))_0x159d51[_0x2bf00a](util[_0xdafc('0x1e')](_0xdafc('0x4a'),_0xf5b683[_0x1c8ab7][_0x578a0b][_0xdafc('0x5')]));break;case 0x8:if(_0x17c2f6['role']!==_0xdafc('0x8'))_0x159d51[_0x2bf00a](util['format'](_0xdafc('0x4b'),_0xf5b683[_0x1c8ab7][_0x578a0b]['name']));break;case 0x9:if(_0x17c2f6[_0xdafc('0x7')]!=='agent')_0x159d51[_0x2bf00a](util[_0xdafc('0x1e')]('campaign:%s:%s',_0xf5b683[_0x1c8ab7][_0x578a0b]['type'],_0xf5b683[_0x1c8ab7][_0x578a0b][_0xdafc('0x5')]));break;case 0xa:_0x159d51[_0x2bf00a](util[_0xdafc('0x1e')](_0xdafc('0x4c'),_0xf5b683[_0x1c8ab7][_0x578a0b][_0xdafc('0x5')]));break;}}}}})[_0xdafc('0xe')](function(){if(_0x2bf00a===_0xdafc('0x4d')){var _0x134b51=_[_0xdafc('0x1a')](_0x17c2f6[_0xdafc('0x24')],'id');return _0x17c2f6['removeChatInteractions'](_0x134b51)['then'](function(){for(var _0x4ce625=0x0;_0x4ce625<_0x134b51['length'];_0x4ce625+=0x1){_0x6c6e4c['emit'](_0xdafc('0x4e'),{'ChatInteractionId':Number(_0x134b51[_0x4ce625]),'UserId':Number(_0x17c2f6['id'])});}});}})[_0xdafc('0xe')](function(){if(_0x2bf00a===_0xdafc('0x4d')){var _0x727141=_[_0xdafc('0x1a')](_0x17c2f6[_0xdafc('0x25')],'id');return _0x17c2f6[_0xdafc('0x4f')](_0x727141)[_0xdafc('0xe')](function(){for(var _0xe260ff=0x0;_0xe260ff<_0x727141[_0xdafc('0x44')];_0xe260ff+=0x1){_0x6c6e4c[_0xdafc('0x50')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x727141[_0xe260ff]),'UserId':Number(_0x17c2f6['id'])});}});}})['then'](function(){if(_0x2bf00a==='leave'){var _0xc981fd=_[_0xdafc('0x1a')](_0x17c2f6[_0xdafc('0x51')],'id');return _0x17c2f6['removeFaxInteractions'](_0xc981fd)[_0xdafc('0xe')](function(){for(var _0x5edd4b=0x0;_0x5edd4b<_0xc981fd[_0xdafc('0x44')];_0x5edd4b+=0x1){_0x6c6e4c['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xc981fd[_0x5edd4b]),'UserId':Number(_0x17c2f6['id'])});}});}})[_0xdafc('0xe')](function(){if(_0x2bf00a===_0xdafc('0x4d')){var _0x3a4d2a=_['map'](_0x17c2f6[_0xdafc('0x52')],'id');return _0x17c2f6[_0xdafc('0x53')](_0x3a4d2a)[_0xdafc('0xe')](function(){for(var _0x7f6f60=0x0;_0x7f6f60<_0x3a4d2a[_0xdafc('0x44')];_0x7f6f60+=0x1){_0x6c6e4c[_0xdafc('0x50')](_0xdafc('0x54'),{'SmsInteractionId':Number(_0x3a4d2a[_0x7f6f60]),'UserId':Number(_0x17c2f6['id'])});}});}})[_0xdafc('0xe')](function(){if(_0x2bf00a===_0xdafc('0x4d')){var _0x376cc1=_[_0xdafc('0x1a')](_0x17c2f6[_0xdafc('0x28')],'id');return _0x17c2f6[_0xdafc('0x55')](_0x376cc1)[_0xdafc('0xe')](function(){for(var _0x1bd0c6=0x0;_0x1bd0c6<_0x376cc1[_0xdafc('0x44')];_0x1bd0c6+=0x1){_0x6c6e4c[_0xdafc('0x50')](_0xdafc('0x56'),{'OpenchannelInteractionId':Number(_0x376cc1[_0x1bd0c6]),'UserId':Number(_0x17c2f6['id'])});}});}})[_0xdafc('0xe')](function(){if(_0x2bf00a==='leave'){var _0x2c757f=_[_0xdafc('0x1a')](_0x17c2f6[_0xdafc('0x29')],'id');return _0x17c2f6[_0xdafc('0x57')](_0x2c757f)[_0xdafc('0xe')](function(){for(var _0xc399fb=0x0;_0xc399fb<_0x2c757f[_0xdafc('0x44')];_0xc399fb+=0x1){_0x6c6e4c['emit'](_0xdafc('0x58'),{'WhatsappInteractionId':Number(_0x2c757f[_0xc399fb]),'UserId':Number(_0x17c2f6['id'])});}});}})[_0xdafc('0x59')](function(_0x2d316c){_0x159d51[_0xdafc('0x5a')](_0x2d316c);});}}function onDisconnect(_0x3a308f,_0x47cbb6){joinOrLeave(_0x3a308f,_0xdafc('0x4d'),_0x47cbb6);}function onConnect(_0x5b5c5a){joinOrLeave(_0x5b5c5a,_0xdafc('0x5b'));}exports['default']=function(_0xa4b12b){_0xa4b12b['on'](_0xdafc('0x5c'),function(_0x1058bc){_0x1058bc[_0xdafc('0x5d')](0x0);_0x1058bc[_0xdafc('0x5e')]=_0x1058bc[_0xdafc('0x5f')][_0xdafc('0x5c')][_0xdafc('0x60')]+':'+_0x1058bc[_0xdafc('0x5f')]['connection']['remotePort'];_0x1058bc[_0xdafc('0x61')]=new Date();_0x1058bc[_0xdafc('0x5a')]=function(_0x48a855){console['log']('SocketIO\x20'+_0x1058bc['nsp'][_0xdafc('0x5')]+'['+_0x1058bc[_0xdafc('0x5e')]+']',_0x48a855);};_0x1058bc['on'](_0xdafc('0x62'),function(){onDisconnect(_0x1058bc,_0xa4b12b);_0x1058bc[_0xdafc('0x5a')](_0xdafc('0x63'));});onConnect(_0x1058bc);_0x1058bc[_0xdafc('0x5a')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index da370c7..0591e83 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 _0xdd3d=['QueryTypes','SELECT','contact','UserId','interface','SIP/%s','name','agent','incomingmessage','AfterCreateMessage','event','opened','sequelize','query','AfterCreate','changed','closed','substatus','format','AfterUpdate','fullname','internal','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','triggers','client','http','ChatInteraction','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','afterCreate','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','error','Trigger,\x20%s','catch','get','channel','motionChannel','direction','resolve','undefined','ContactId','Sequelize'];(function(_0x3ad67a,_0x1b6823){var _0x2975a0=function(_0x3def86){while(--_0x3def86){_0x3ad67a['push'](_0x3ad67a['shift']());}};_0x2975a0(++_0x1b6823);}(_0xdd3d,0x1c0));var _0xddd3=function(_0x2f398b,_0x2fae33){_0x2f398b=_0x2f398b-0x0;var _0x355ffa=_0xdd3d[_0x2f398b];return _0x355ffa;};'use strict';var util=require(_0xddd3('0x0'));var db=require(_0xddd3('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0xddd3('0x2'));var client=jayson[_0xddd3('0x3')][_0xddd3('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xddd3('0x5'),'event':'afterCreate','condition':_0xddd3('0x6'),'callback':afterCreate},{'channel':_0xddd3('0x7'),'model':_0xddd3('0x5'),'event':_0xddd3('0x8'),'condition':_0xddd3('0x9'),'callback':afterUpdate},{'channel':_0xddd3('0x7'),'model':_0xddd3('0xa'),'event':_0xddd3('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xddd3('0x7'),'model':_0xddd3('0xc'),'event':_0xddd3('0xb'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0xddd3('0xd'),'model':_0xddd3('0xe'),'event':_0xddd3('0xb'),'condition':_0xddd3('0x6'),'callback':afterCreate},{'channel':_0xddd3('0xd'),'model':_0xddd3('0xe'),'event':_0xddd3('0x8'),'condition':_0xddd3('0x9'),'callback':afterUpdate},{'channel':'Sms','model':_0xddd3('0xf'),'event':'afterCreate','condition':_0xddd3('0x10'),'callback':afterCreateMessage},{'channel':_0xddd3('0x11'),'model':_0xddd3('0x12'),'event':_0xddd3('0xb'),'condition':_0xddd3('0x6'),'callback':afterCreate},{'channel':_0xddd3('0x11'),'model':'WhatsappInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xddd3('0x11'),'model':_0xddd3('0x13'),'event':_0xddd3('0xb'),'condition':_0xddd3('0x10'),'callback':afterCreateMessage},{'channel':_0xddd3('0x14'),'model':'FaxInteraction','event':_0xddd3('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0xddd3('0x15'),'event':_0xddd3('0x8'),'condition':_0xddd3('0x9'),'callback':afterUpdate},{'channel':'Fax','model':_0xddd3('0x16'),'event':_0xddd3('0xb'),'condition':_0xddd3('0x10'),'callback':afterCreateMessage},{'channel':_0xddd3('0x17'),'model':_0xddd3('0x18'),'event':_0xddd3('0xb'),'condition':_0xddd3('0x6'),'callback':afterCreate},{'channel':'Mail','model':_0xddd3('0x18'),'event':_0xddd3('0x8'),'condition':_0xddd3('0x9'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0xddd3('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xddd3('0x19'),'model':'OpenchannelInteraction','event':_0xddd3('0xb'),'condition':_0xddd3('0x6'),'callback':afterCreate},{'channel':_0xddd3('0x19'),'model':_0xddd3('0x1a'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0xddd3('0x1b'),'event':'afterCreate','condition':_0xddd3('0x10'),'callback':afterCreateMessage}];function request(_0x10875b){return client['request'](_0xddd3('0x1c'),_0x10875b)[_0xddd3('0x1d')](function(_0x452f3c){logger[_0xddd3('0x1e')]('Trigger,\x20%s',_0xddd3('0x1c'),_0x452f3c);if(_0x452f3c['error']){if(_0x452f3c[_0xddd3('0x1f')]['code']===0x1f4){logger[_0xddd3('0x1f')](_0xddd3('0x20'),_0xddd3('0x1c'),_0x452f3c[_0xddd3('0x1f')]);}}})[_0xddd3('0x21')](function(_0x9aa435){logger[_0xddd3('0x1f')](_0xddd3('0x20'),'EventManager',_0x9aa435);});}function afterCreateMessage(_0x32ed01){return function(_0x38f641){_0x38f641=_0x38f641[_0xddd3('0x22')]({'plain':!![]});_0x38f641[_0xddd3('0x23')]=_0x32ed01;_0x38f641[_0xddd3('0x24')]=_0x32ed01;_0x38f641['event']=_0x38f641[_0xddd3('0x25')];Promise[_0xddd3('0x26')]()['then'](function(){if(typeof _0x38f641['ContactId']===_0xddd3('0x27'))return null;var _0x428058='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x38f641[_0xddd3('0x28')];return db['sequelize']['query'](_0x428058,{'type':db[_0xddd3('0x29')][_0xddd3('0x2a')][_0xddd3('0x2b')],'raw':!![]});})['then'](function(_0x231ce7){if(_0x231ce7){_0x38f641[_0xddd3('0x2c')]=_0x231ce7[0x0];}if(typeof _0x38f641['UserId']==='undefined')return;return getAgent(_0x38f641[_0xddd3('0x2d')]);})[_0xddd3('0x1d')](function(_0x262f4c){if(_0x262f4c){_0x38f641[_0xddd3('0x2e')]=util['format'](_0xddd3('0x2f'),_0x262f4c[_0xddd3('0x30')]);_0x38f641[_0xddd3('0x31')]=_0x262f4c;_0x38f641[_0xddd3('0x23')]=_0x32ed01;return request({'event':_0xddd3('0x32'),'message':_0x38f641});}else{return request({'event':'outgoingmessage','message':_0x38f641});}})[_0xddd3('0x21')](function(_0x5b6b85){logger[_0xddd3('0x1f')](_0xddd3('0x20'),_0xddd3('0x33'),_0x5b6b85);});};}function afterCreateOfflineMessage(_0x165922){return function(_0x3724e9){_0x3724e9=_0x3724e9[_0xddd3('0x22')]({'plain':!![]});_0x3724e9[_0xddd3('0x23')]=_0x165922;_0x3724e9[_0xddd3('0x24')]=_0x165922;_0x3724e9[_0xddd3('0x34')]='offlineMessage';return request({'event':_0x3724e9['event'],'message':_0x3724e9});};}function afterCreate(_0x529b1c,_0x4fa420){return function(_0x363ad1){_0x363ad1=_0x363ad1['get']({'plain':!![]});_0x363ad1[_0xddd3('0x23')]=_0x529b1c;_0x363ad1['motionChannel']=_0x529b1c;_0x363ad1[_0xddd3('0x34')]=_0xddd3('0x35');Promise[_0xddd3('0x26')]()[_0xddd3('0x1d')](function(){var _0x392075='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x363ad1['ContactId'];return db[_0xddd3('0x36')][_0xddd3('0x37')](_0x392075,{'type':db[_0xddd3('0x29')][_0xddd3('0x2a')][_0xddd3('0x2b')],'raw':!![]});})[_0xddd3('0x1d')](function(_0x169b3a){if(_0x169b3a){_0x363ad1[_0xddd3('0x2c')]=_0x169b3a[0x0];}if(typeof _0x363ad1[_0xddd3('0x2d')]===_0xddd3('0x27'))return;return getAgent(_0x363ad1[_0xddd3('0x2d')]);})['then'](function(_0x1dc7bf){if(_0x1dc7bf){_0x363ad1[_0xddd3('0x2e')]=util['format']('SIP/%s',_0x1dc7bf[_0xddd3('0x30')]);_0x363ad1[_0xddd3('0x31')]=_0x1dc7bf;}return request({'event':_0x4fa420,'message':_0x363ad1});})[_0xddd3('0x21')](function(_0x3ee9fb){logger[_0xddd3('0x1f')](_0xddd3('0x20'),_0xddd3('0x38'),_0x3ee9fb);});};}function afterUpdate(_0x1232e3){return function(_0x41d0d8){var _0xb107c9=_0x41d0d8[_0xddd3('0x39')](_0xddd3('0x3a'))&&_0x41d0d8[_0xddd3('0x3a')];var _0x2916b6=_0x41d0d8[_0xddd3('0x39')](_0xddd3('0x3b'));if(_0xb107c9||_0x2916b6){var _0x4a2d06=_0xb107c9?_0xddd3('0x9'):_0xddd3('0x3b');var _0x4acf07=_0x41d0d8[_0xddd3('0x22')]({'plain':!![]});_0x4acf07[_0xddd3('0x23')]=_0x1232e3;_0x4acf07[_0xddd3('0x24')]=_0x1232e3;_0x4acf07[_0xddd3('0x34')]=_0xb107c9?'closed':_0xddd3('0x3b');var _0x52d12b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4acf07['ContactId'];return db[_0xddd3('0x36')][_0xddd3('0x37')](_0x52d12b,{'type':db['Sequelize'][_0xddd3('0x2a')][_0xddd3('0x2b')],'raw':!![]})[_0xddd3('0x1d')](function(_0xa0581f){if(_0xa0581f){_0x4acf07[_0xddd3('0x2c')]=_0xa0581f[0x0];}if(typeof _0x4acf07['UserId']===_0xddd3('0x27'))return;return getAgent(_0x4acf07[_0xddd3('0x2d')]);})['then'](function(_0x10d004){if(_0x10d004){_0x4acf07['interface']=util[_0xddd3('0x3c')](_0xddd3('0x2f'),_0x10d004['name']);_0x4acf07[_0xddd3('0x31')]=_0x10d004;}return request({'event':_0x4a2d06,'message':_0x4acf07});})[_0xddd3('0x21')](function(_0x1815c4){logger[_0xddd3('0x1f')](_0xddd3('0x20'),_0xddd3('0x3d'),_0x1815c4);});}};}function getAgent(_0x1cda80){return db['User']['find']({'where':{'id':_0x1cda80},'attributes':['id',_0xddd3('0x30'),_0xddd3('0x3e'),'email',_0xddd3('0x3f')],'raw':!![]})['then'](function(_0x4699d1){return _0x4699d1;});}exports['default']=function(){for(var _0x2564f5=0x0;_0x2564f5=_0xd5bf22['agents']){throw Error(_0x7770('0x15'));}_0x342da0(_0x322129);})['catch'](function(_0x28849b){_0x2ce5a4(_0x28849b);});});}; \ No newline at end of file +var _0xc182=['isUndefined','updateAttributes','getLicense','role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser'];(function(_0x560b69,_0x4c2a39){var _0x423929=function(_0x236fe8){while(--_0x236fe8){_0x560b69['push'](_0x560b69['shift']());}};_0x423929(++_0x4c2a39);}(_0xc182,0x105));var _0x2c18=function(_0x2e8605,_0x4e4e0e){_0x2e8605=_0x2e8605-0x0;var _0x8b31b6=_0xc182[_0x2e8605];return _0x8b31b6;};'use strict';var _=require('lodash');var BPromise=require(_0x2c18('0x0'));var db=require(_0x2c18('0x1'))['db'];var util=require(_0x2c18('0x2'));var channels=[_0x2c18('0x3'),_0x2c18('0x4'),_0x2c18('0x5'),_0x2c18('0x6'),_0x2c18('0x7'),_0x2c18('0x8'),_0x2c18('0x9')];exports['getChannels']=function(){return channels;};exports[_0x2c18('0xa')]=function(_0x4add6f){_0x4add6f=_0x4add6f[_0x2c18('0xb')]();return _[_0x2c18('0xc')](channels,_0x4add6f);};exports[_0x2c18('0xd')]=function(_0x12c748,_0xd6616a,_0x29bf2a,_0x14d30b){var _0xc0fd15={'loginAttempts':_0xd6616a,'blocked':_0x29bf2a};if(!_[_0x2c18('0xe')](_0x14d30b)){_0xc0fd15['blockedAt']=_0x14d30b;}return _0x12c748[_0x2c18('0xf')](_0xc0fd15);};exports[_0x2c18('0x10')]=function(_0x12e643){return new BPromise(function(_0x2baf39,_0x2800e1){var _0x12052e=0x0;if(_0x12e643[_0x2c18('0x11')]!=='agent'){_0x2baf39(_0x12e643);}db[_0x2c18('0x12')][_0x2c18('0x13')]({'where':{'role':_0x2c18('0x14'),'online':!![],'id':{'$ne':_0x12e643['id']}}})[_0x2c18('0x15')](function(_0x4a565d){_0x12052e=_0x4a565d;return util[_0x2c18('0x10')]();})[_0x2c18('0x15')](function(_0x4cc5d5){if(_0x4cc5d5&&_0x4cc5d5[_0x2c18('0x16')]&&_0x12052e>=_0x4cc5d5[_0x2c18('0x16')]){throw Error(_0x2c18('0x17'));}_0x2baf39(_0x12e643);})[_0x2c18('0x18')](function(_0x2cd0d8){_0x2800e1(_0x2cd0d8);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 7e9d46a..caa9fdb 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['Error','Bad\x20Request','Entity\x20not\x20found','inherits','Forbidden','OutOfInterval','Not\x20Found','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name'];(function(_0x469a49,_0xfede47){var _0x29ff82=function(_0x4a173f){while(--_0x4a173f){_0x469a49['push'](_0x469a49['shift']());}};_0x29ff82(++_0xfede47);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2183cb,_0x4e2cf3){_0x2183cb=_0x2183cb-0x0;var _0x1d70bc=_0xbdb7[_0x2183cb];return _0x1d70bc;};'use strict';var util=require(_0x7bdb('0x0'));var logger=require(_0x7bdb('0x1'))(_0x7bdb('0x2'));var APIError=function(_0x2a2c1c,_0x23c326){this[_0x7bdb('0x3')]=_0x2a2c1c||_0x7bdb('0x4');this[_0x7bdb('0x5')]=_0x23c326||_0x7bdb('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x28542c){this['message']=_0x28542c||'Bad\x20Request';this[_0x7bdb('0x5')]=_0x7bdb('0x7');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x513cba){this[_0x7bdb('0x3')]=_0x513cba||_0x7bdb('0x8');this['name']='Not\x20Found';util[_0x7bdb('0x9')](APINotFoundError,APIError);};function getStatusCode(_0x1a6b61){switch(_0x1a6b61){case _0x7bdb('0x7'):return 0x190;case _0x7bdb('0xa'),_0x7bdb('0xb'):return 0x193;case _0x7bdb('0xc'):return 0x194;default:return 0x1f4;}}function handleError(_0x297724){return function(_0x258cc6){logger['error'](_0x258cc6['stack']);var _0x52b9b9=getStatusCode(_0x258cc6[_0x7bdb('0x5')]);if(_0x258cc6[_0x7bdb('0x5')])delete _0x258cc6['name'];return _0x297724[_0x7bdb('0xd')](_0x52b9b9)['send'](_0x258cc6);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xe5b5=['name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error'];(function(_0x1c1338,_0x1b9988){var _0x9fb67f=function(_0x51a351){while(--_0x51a351){_0x1c1338['push'](_0x1c1338['shift']());}};_0x9fb67f(++_0x1b9988);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0xe5b5[_0x277fa3];return _0x2e4520;};'use strict';var util=require(_0x5e5b('0x0'));var logger=require(_0x5e5b('0x1'))(_0x5e5b('0x2'));var APIError=function(_0x3b3efd,_0x208070){this[_0x5e5b('0x3')]=_0x3b3efd||_0x5e5b('0x4');this[_0x5e5b('0x5')]=_0x208070||_0x5e5b('0x6');util[_0x5e5b('0x7')](APIError,Error);};var APIBadRequestError=function(_0xdc6616){this[_0x5e5b('0x3')]=_0xdc6616||_0x5e5b('0x8');this[_0x5e5b('0x5')]=_0x5e5b('0x8');util[_0x5e5b('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xe089b1){this[_0x5e5b('0x3')]=_0xe089b1||_0x5e5b('0x9');this[_0x5e5b('0x5')]=_0x5e5b('0xa');util[_0x5e5b('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x3f8534){switch(_0x3f8534){case'Bad\x20Request':return 0x190;case _0x5e5b('0xb'),'OutOfInterval':return 0x193;case _0x5e5b('0xa'):return 0x194;default:return 0x1f4;}}function handleError(_0x58185){return function(_0x23e667){logger[_0x5e5b('0xc')](_0x23e667['stack']);var _0x4a1424=getStatusCode(_0x23e667['name']);if(_0x23e667[_0x5e5b('0x5')])delete _0x23e667[_0x5e5b('0x5')];return _0x58185[_0x5e5b('0xd')](_0x4a1424)[_0x5e5b('0xe')](_0x23e667);};}module[_0x5e5b('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index b9634f2..35e1fc2 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9809=['status','render','json','send','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9809,0x1b2));var _0x9980=function(_0x229ad9,_0x4c9583){_0x229ad9=_0x229ad9-0x0;var _0x3ed445=_0x9809[_0x229ad9];return _0x3ed445;};'use strict';module[_0x9980('0x0')][0x194]=function pageNotFound(_0x99482b,_0x2a8976){var _0xd2701b='404';var _0x65648c=0x194;var _0x1e537b={'status':_0x65648c};_0x2a8976['status'](_0x1e537b[_0x9980('0x1')]);_0x2a8976[_0x9980('0x2')](_0xd2701b,{},function(_0x8b3b5b,_0x5f1a0f){if(_0x8b3b5b){return _0x2a8976[_0x9980('0x1')](_0x1e537b[_0x9980('0x1')])[_0x9980('0x3')](_0x1e537b);}_0x2a8976[_0x9980('0x4')](_0x5f1a0f);});}; \ No newline at end of file +var _0x0f6d=['exports','404','render','status','json','send'];(function(_0x5544d5,_0x3d65ab){var _0x2926d3=function(_0x43e597){while(--_0x43e597){_0x5544d5['push'](_0x5544d5['shift']());}};_0x2926d3(++_0x3d65ab);}(_0x0f6d,0x180));var _0xd0f6=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x0f6d[_0x29a29f];return _0x443ea3;};'use strict';module[_0xd0f6('0x0')][0x194]=function pageNotFound(_0x475afe,_0xe28cc1){var _0x158328=_0xd0f6('0x1');var _0x3676d0=0x194;var _0x4b4bae={'status':_0x3676d0};_0xe28cc1['status'](_0x4b4bae['status']);_0xe28cc1[_0xd0f6('0x2')](_0x158328,{},function(_0x5e4246,_0x20b17d){if(_0x5e4246){return _0xe28cc1[_0xd0f6('0x3')](_0x4b4bae[_0xd0f6('0x3')])[_0xd0f6('0x4')](_0x4b4bae);}_0xe28cc1[_0xd0f6('0x5')](_0x20b17d);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 2dcb771..eb412f1 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1bb=['ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userNotification/userNotification.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','cascade','UserSetting','UserId','hasMany','Recordings','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotification','SenderId','belongsToMany','ChatGroup','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','ChatInteraction','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','CmList','user_has_chat_websites','user_has_fax_accounts','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','CmContact','Contact','ContactId','MailAccountId','CloudProvider','restrict','Imap','Answers','Interactions','List','ListId','Template','TemplateId','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatWebsiteId','ChatOfflineMessageId','TagId','DashboardItem','Items','Dispositions','FaxAccountId','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteraction','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','ChatApplication','ChatMessage','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','CompanyId','Phones','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','Automation','Condition','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','ParentId','Extensions','FaxApplications','Schedule','AnalyticCustomReport','Mohs','whatsapp_interaction_has_tags','ItemTypeId','CmContactId','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','CustomReportId','DefaultReportId','MetricId','Configurations','SalesforceField','Subjects','SubjectId','DescriptionId','FieldId','SalesforceAccount','AccountId','Description','Field','VariableId','SugarcrmAccount','Descriptions','Subject','DeskConfiguration','int_desk_configuration_has_tags','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','CloudProviderId','FreshsalesAccount','FromId','ToId','ProjectId','user_has_teams','VoiceQueues','team_has_mail_queues','team_has_whatsapp_queues','VoicePrefixes','HopperFinals','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToAccount','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','FaxTransferReport','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToAgent','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','WhatsappAccount','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','Smtp','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount'];(function(_0x1593e2,_0x29ac15){var _0x33d917=function(_0x577eca){while(--_0x577eca){_0x1593e2['push'](_0x1593e2['shift']());}};_0x33d917(++_0x29ac15);}(_0xe1bb,0x134));var _0xbe1b=function(_0x1414b3,_0x477031){_0x1414b3=_0x1414b3-0x0;var _0x5761ab=_0xe1bb[_0x1414b3];return _0x5761ab;};'use strict';var config=require(_0xbe1b('0x0'));var Sequelize=require(_0xbe1b('0x1'));var _=require(_0xbe1b('0x2'));var jstz=require(_0xbe1b('0x3'));var timezone=jstz['determine']();config[_0xbe1b('0x1')]=_[_0xbe1b('0x4')](config['sequelize'],{'database':_0xbe1b('0x5'),'username':'xcall','password':_0xbe1b('0x6'),'options':{'host':_0xbe1b('0x7'),'port':0xcea,'dialect':_0xbe1b('0x8'),'dialectOptions':{'charset':_0xbe1b('0x9')},'logging':![],'timezone':timezone[_0xbe1b('0xa')](),'define':{'charset':_0xbe1b('0xb'),'collate':_0xbe1b('0xc')}}});config[_0xbe1b('0xd')]=_[_0xbe1b('0x4')](config[_0xbe1b('0xd')],{'database':_0xbe1b('0x5'),'username':'xcall','password':_0xbe1b('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xbe1b('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xbe1b('0xa')](),'define':{'charset':_0xbe1b('0xb'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbe1b('0x1')][_0xbe1b('0xe')],config[_0xbe1b('0x1')]['username'],config[_0xbe1b('0x1')][_0xbe1b('0xf')],config[_0xbe1b('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xbe1b('0xe')],config[_0xbe1b('0xd')]['username'],config[_0xbe1b('0xd')][_0xbe1b('0xf')],config[_0xbe1b('0xd')][_0xbe1b('0x10')])};db[_0xbe1b('0x11')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x13'));db[_0xbe1b('0x14')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x15'));db[_0xbe1b('0x16')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x17'));db[_0xbe1b('0x18')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x19'));db[_0xbe1b('0x1a')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xbe1b('0x1b')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0xbe1b('0x1c')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x1d'));db[_0xbe1b('0x1e')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x1f'));db[_0xbe1b('0x20')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x21'));db['VoiceMailMessage']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x22'));db[_0xbe1b('0x23')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x24'));db['VoiceDialReport']=db[_0xbe1b('0x1')]['import']('../api/voiceDialReport/voiceDialReport.model');db[_0xbe1b('0x25')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xbe1b('0x26')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x27'));db[_0xbe1b('0x28')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x29'));db['Trunk']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x2a'));db['VoiceTransferReport']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x2b'));db[_0xbe1b('0x2c')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x2d'));db[_0xbe1b('0x2e')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xbe1b('0x2f')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x30'));db[_0xbe1b('0x31')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/userMailQueue/userMailQueue.model');db[_0xbe1b('0x32')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x33'));db[_0xbe1b('0x34')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x35'));db['UserOpenchannelQueue']=db['sequelize']['import'](_0xbe1b('0x36'));db[_0xbe1b('0x37')]=db[_0xbe1b('0x1')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xbe1b('0x38')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x39'));db[_0xbe1b('0x3a')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x3b'));db[_0xbe1b('0x3c')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x3d'));db[_0xbe1b('0x3e')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/mailQueue/mailQueue.model');db[_0xbe1b('0x3f')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/mailSubstatus/mailSubstatus.model');db[_0xbe1b('0x40')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x41'));db[_0xbe1b('0x42')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/mailMessage/mailMessage.model');db[_0xbe1b('0x43')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x44'));db[_0xbe1b('0x45')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x46'));db[_0xbe1b('0x47')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x48'));db['DashboardItem']=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x49'));db[_0xbe1b('0x4a')]=db[_0xbe1b('0x1')]['import']('../api/faxAccount/faxAccount.model');db[_0xbe1b('0x4b')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x4c'));db[_0xbe1b('0x4d')]=db['sequelize']['import'](_0xbe1b('0x4e'));db[_0xbe1b('0x4f')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x50'));db[_0xbe1b('0x51')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/faxQueue/faxQueue.model');db[_0xbe1b('0x52')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x53'));db[_0xbe1b('0x54')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/smsAccount/smsAccount.model');db[_0xbe1b('0x55')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x56'));db['SmsInteraction']=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/smsInteraction/smsInteraction.model');db[_0xbe1b('0x57')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/smsMessage/smsMessage.model');db[_0xbe1b('0x58')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x59'));db[_0xbe1b('0x5a')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/openchannelAccount/openchannelAccount.model');db[_0xbe1b('0x5b')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x5c'));db[_0xbe1b('0x5d')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x5e'));db[_0xbe1b('0x5f')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x60'));db[_0xbe1b('0x61')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/openchannelQueue/openchannelQueue.model');db[_0xbe1b('0x62')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/chatWebsite/chatWebsite.model');db[_0xbe1b('0x63')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x64'));db['ChatApplication']=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x65'));db['ChatInteraction']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x66'));db['ChatMessage']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x67'));db[_0xbe1b('0x68')]=db[_0xbe1b('0x1')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0xbe1b('0x1')]['import']('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x69'));db[_0xbe1b('0x6a')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xbe1b('0x6b')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x6c'));db['CmContact']=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x6d'));db[_0xbe1b('0x6e')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x6f'));db[_0xbe1b('0x70')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xbe1b('0x71')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x72'));db[_0xbe1b('0x73')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x74'));db[_0xbe1b('0x75')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xbe1b('0x76')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x77'));db[_0xbe1b('0x78')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x79'));db['Automation']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x7a'));db[_0xbe1b('0x7b')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x7c'));db[_0xbe1b('0x7d')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x7e'));db['Condition']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x7f'));db[_0xbe1b('0x80')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/interval/interval.model');db[_0xbe1b('0x81')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x82'));db[_0xbe1b('0x83')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x84'));db[_0xbe1b('0x85')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x86'));db['Schedule']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x87'));db[_0xbe1b('0x88')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x89'));db[_0xbe1b('0x8a')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x8b'));db[_0xbe1b('0x8c')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x8d'));db[_0xbe1b('0x8e')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0xbe1b('0x8f')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x90'));db['Template']=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x91'));db['Trigger']=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/trigger/trigger.model');db[_0xbe1b('0x92')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x93'));db[_0xbe1b('0x94')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x95'));db[_0xbe1b('0x96')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x97'));db[_0xbe1b('0x98')]=db[_0xbe1b('0x1')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xbe1b('0x99')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0x9a'));db[_0xbe1b('0x9b')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0xbe1b('0x9c')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x9d'));db[_0xbe1b('0x9e')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x9f'));db['SalesforceAccount']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xa0'));db[_0xbe1b('0xa1')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xa2'));db['SugarcrmAccount']=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0xa3'));db[_0xbe1b('0xa4')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xa5'));db[_0xbe1b('0xa6')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xa7'));db[_0xbe1b('0xa8')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0xa9'));db['DeskConfiguration']=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xaa'));db[_0xbe1b('0xab')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xac'));db[_0xbe1b('0xad')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/intZohoAccount/intZohoAccount.model');db[_0xbe1b('0xae')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xaf'));db[_0xbe1b('0xb0')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xb1'));db['ZendeskAccount']=db['sequelize']['import'](_0xbe1b('0xb2'));db[_0xbe1b('0xb3')]=db[_0xbe1b('0x1')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xb4'));db[_0xbe1b('0xb5')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xbe1b('0xb6')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xb7'));db[_0xbe1b('0xb8')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xbe1b('0xb9')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xba'));db[_0xbe1b('0xbb')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xbc'));db[_0xbe1b('0xbd')]=db['sequelize']['import'](_0xbe1b('0xbe'));db[_0xbe1b('0xbf')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xbe1b('0xc0')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xc1'));db[_0xbe1b('0xc2')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0xbe1b('0xc3')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xc4'));db[_0xbe1b('0xc5')]=db['sequelize']['import'](_0xbe1b('0xc6'));db[_0xbe1b('0xc7')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xc8'));db['FreshsalesAccount']=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0xc9'));db[_0xbe1b('0xca')]=db['sequelize'][_0xbe1b('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xbe1b('0xcb')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xcc'));db[_0xbe1b('0x94')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x95'));db['Network']=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/network/network.model');db[_0xbe1b('0xcd')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xce'));db['ChatInternalMessage']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xcf'));db[_0xbe1b('0xd0')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xd1'));db[_0xbe1b('0xd2')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xd3'));db[_0xbe1b('0xd4')]=db[_0xbe1b('0x1')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xbe1b('0xd5')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0xbe1b('0xd6')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xd7'));db[_0xbe1b('0xd8')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xd9'));db[_0xbe1b('0xda')]=db[_0xbe1b('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db[_0xbe1b('0xdb')]=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xdc'));db[_0xbe1b('0xdd')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xde'));db[_0xbe1b('0xdf')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xe0'));db['SquareRecording']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xe1'));db[_0xbe1b('0xe2')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xe3'));db[_0xbe1b('0xe4')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/team/team.model');db[_0xbe1b('0xe5')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xe6'));db[_0xbe1b('0xe7')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xe8'));db['Migration']=db['sequelize'][_0xbe1b('0x12')]('../api/migration/migration.model');db[_0xbe1b('0xe9')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/attachment/attachment.model');db['Plugin']=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0xea'));db[_0xbe1b('0xeb')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0xec'));db[_0xbe1b('0xed')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xee'));db['FaxTransferReport']=db['sequelize']['import'](_0xbe1b('0xef'));db['OpenchannelTransferReport']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xf0'));db[_0xbe1b('0xf1')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xf2'));db['CmList']=db[_0xbe1b('0x1')]['import'](_0xbe1b('0xf3'));db[_0xbe1b('0xf4')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xf5'));db[_0xbe1b('0xf6')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xf7'));db[_0xbe1b('0xf8')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xf9'));db[_0xbe1b('0xfa')]=db[_0xbe1b('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xfb'));db['WhatsappAccount']=db[_0xbe1b('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xfc'));db[_0xbe1b('0xfd')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0xfe'));db[_0xbe1b('0xff')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x100'));db[_0xbe1b('0x101')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x102'));db['WhatsappQueue']=db[_0xbe1b('0x1')][_0xbe1b('0x12')]('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db[_0xbe1b('0x1')]['import']('../api/cloudProvider/cloudProvider.model');db[_0xbe1b('0x103')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x104'));db[_0xbe1b('0x105')]=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x106'));db[_0xbe1b('0x107')]=db[_0xbe1b('0x1')][_0xbe1b('0x12')](_0xbe1b('0x108'));db['UserSetting']=db['sequelize'][_0xbe1b('0x12')](_0xbe1b('0x109'));db[_0xbe1b('0x11')][_0xbe1b('0x10a')](db[_0xbe1b('0x20')],{'as':_0xbe1b('0x20'),'onDelete':_0xbe1b('0x10b'),'foreignKey':'UserId'});db[_0xbe1b('0x11')]['hasOne'](db[_0xbe1b('0x10c')],{'as':'userSetting','onDelete':'cascade','foreignKey':_0xbe1b('0x10d')});db['User'][_0xbe1b('0x10e')](db[_0xbe1b('0x1c')],{'as':_0xbe1b('0x10f'),'foreignKey':_0xbe1b('0x10d')});db['User'][_0xbe1b('0x10e')](db[_0xbe1b('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x11')][_0xbe1b('0x10e')](db[_0xbe1b('0x18')],{'as':'Extensions','onDelete':_0xbe1b('0x10b'),'hooks':!![]});db[_0xbe1b('0x11')]['hasMany'](db[_0xbe1b('0x71')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0xbe1b('0x11')][_0xbe1b('0x10e')](db[_0xbe1b('0x73')],{'as':_0xbe1b('0x110'),'foreignKey':'UserId'});db[_0xbe1b('0x11')]['hasMany'](db[_0xbe1b('0x75')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0xbe1b('0x11')][_0xbe1b('0x10e')](db[_0xbe1b('0x5d')],{'as':_0xbe1b('0x111'),'foreignKey':'UserId'});db[_0xbe1b('0x11')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x11')][_0xbe1b('0x10e')](db['SmsInteraction'],{'as':_0xbe1b('0x112'),'foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x11')][_0xbe1b('0x10e')](db[_0xbe1b('0x4d')],{'as':_0xbe1b('0x113'),'foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x11')][_0xbe1b('0x10e')](db[_0xbe1b('0x40')],{'as':_0xbe1b('0x114'),'foreignKey':'UserId'});db[_0xbe1b('0x11')][_0xbe1b('0x10e')](db[_0xbe1b('0x115')],{'as':_0xbe1b('0x116'),'foreignKey':'UserId'});db['User'][_0xbe1b('0x10e')](db[_0xbe1b('0x117')],{'as':'UserNotifications','foreignKey':_0xbe1b('0x118')});db[_0xbe1b('0x11')]['belongsTo'](db[_0xbe1b('0xf6')],{'as':_0xbe1b('0xf6'),'foreignKey':'userProfileId'});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x11a')],{'as':'Groups','through':_0xbe1b('0x11b')});db['User'][_0xbe1b('0x119')](db['CmContact'],{'as':_0xbe1b('0x11c'),'through':_0xbe1b('0x11d')});db[_0xbe1b('0x11')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0xbe1b('0x11e')});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db['Team'],{'through':'user_has_teams'});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db['MailInteraction'],{'as':_0xbe1b('0x114'),'through':'user_has_mail_interactions'});db[_0xbe1b('0x11')]['belongsToMany'](db[_0xbe1b('0x11f')],{'as':_0xbe1b('0x120'),'through':_0xbe1b('0x121')});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db['FaxInteraction'],{'as':_0xbe1b('0x113'),'through':_0xbe1b('0x122')});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db['SmsInteraction'],{'as':_0xbe1b('0x112'),'through':_0xbe1b('0x123')});db[_0xbe1b('0x11')]['belongsToMany'](db[_0xbe1b('0x5d')],{'as':_0xbe1b('0x111'),'through':_0xbe1b('0x124')});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x115')],{'as':_0xbe1b('0x116'),'through':_0xbe1b('0x125')});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x1b')],{'as':'VoiceQueues','through':_0xbe1b('0x2e'),'required':![]});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0xbe1b('0x107'),'required':![]});db['User'][_0xbe1b('0x119')](db[_0xbe1b('0x3e')],{'as':_0xbe1b('0x126'),'through':_0xbe1b('0x31'),'required':![]});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x127')],{'as':_0xbe1b('0x128'),'through':_0xbe1b('0x2f'),'required':![],'hooks':!![]});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x51')],{'as':_0xbe1b('0x129'),'through':_0xbe1b('0x32'),'required':![]});db[_0xbe1b('0x11')]['belongsToMany'](db[_0xbe1b('0x58')],{'as':_0xbe1b('0x12a'),'through':'UserSmsQueue','required':![]});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x61')],{'as':_0xbe1b('0x12b'),'through':_0xbe1b('0x12c'),'required':![]});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x12d')],{'as':_0xbe1b('0x12e'),'through':_0xbe1b('0x37'),'required':![]});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x12f')],{'through':_0xbe1b('0x11e')});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x62')],{'as':'ChatWebsites','through':_0xbe1b('0x130')});db[_0xbe1b('0x11')]['belongsToMany'](db['FaxAccount'],{'as':'FaxAccounts','through':_0xbe1b('0x131')});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x3c')],{'as':'MailAccounts','through':_0xbe1b('0x132')});db['User'][_0xbe1b('0x119')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xbe1b('0x11')][_0xbe1b('0x119')](db[_0xbe1b('0x54')],{'as':_0xbe1b('0x133'),'through':_0xbe1b('0x134')});db['User'][_0xbe1b('0x119')](db['WhatsappAccount'],{'as':_0xbe1b('0x135'),'through':_0xbe1b('0x136')});db['User'][_0xbe1b('0x119')](db[_0xbe1b('0xdf')],{'as':'SquareProjects','through':_0xbe1b('0x137')});db[_0xbe1b('0x14')][_0xbe1b('0x10e')](db[_0xbe1b('0x18')],{'as':_0xbe1b('0x138'),'onDelete':'cascade','foreignKey':_0xbe1b('0x139')});db[_0xbe1b('0x16')][_0xbe1b('0x10e')](db[_0xbe1b('0x18')],{'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x18')][_0xbe1b('0x10e')](db['VoiceExtension'],{'as':_0xbe1b('0x13a'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x1a')][_0xbe1b('0x119')](db[_0xbe1b('0x88')],{'as':_0xbe1b('0x13b'),'through':_0xbe1b('0x13c')});db[_0xbe1b('0x1b')][_0xbe1b('0x10e')](db['UserVoiceQueueRt'],{'as':_0xbe1b('0x13d'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xbe1b('0x10e')](db[_0xbe1b('0x6e')],{'as':_0xbe1b('0x13e'),'foreignKey':_0xbe1b('0x13f')});db['VoiceQueue'][_0xbe1b('0x10e')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xbe1b('0x13f')});db[_0xbe1b('0x1b')][_0xbe1b('0x10e')](db[_0xbe1b('0x73')],{'as':_0xbe1b('0x140'),'foreignKey':'VoiceQueueId'});db[_0xbe1b('0x1b')][_0xbe1b('0x10e')](db['ReportAgentPreview'],{'as':_0xbe1b('0x75'),'foreignKey':'VoiceQueueId'});db[_0xbe1b('0x1b')][_0xbe1b('0x10e')](db[_0xbe1b('0x70')],{'as':_0xbe1b('0x141'),'foreignKey':_0xbe1b('0x13f')});db[_0xbe1b('0x1b')][_0xbe1b('0x10e')](db[_0xbe1b('0xd4')],{'as':_0xbe1b('0x142'),'foreignKey':_0xbe1b('0x13f')});db[_0xbe1b('0x1b')][_0xbe1b('0x143')](db[_0xbe1b('0x144')],{'as':_0xbe1b('0x144'),'foreignKey':_0xbe1b('0x145')});db['VoiceQueue'][_0xbe1b('0x143')](db[_0xbe1b('0x144')],{'as':_0xbe1b('0x146'),'foreignKey':_0xbe1b('0x147')});db[_0xbe1b('0x1b')][_0xbe1b('0x143')](db[_0xbe1b('0x80')],{'as':_0xbe1b('0x80'),'foreignKey':_0xbe1b('0x148')});db[_0xbe1b('0x1b')]['belongsTo'](db['Pause'],{'as':_0xbe1b('0x149'),'foreignKey':_0xbe1b('0x14a')});db[_0xbe1b('0x1b')][_0xbe1b('0x119')](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x14b'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':'UserVoiceQueue'});db[_0xbe1b('0x1b')]['belongsToMany'](db[_0xbe1b('0xe4')],{'as':_0xbe1b('0x14d'),'through':_0xbe1b('0x103')});db[_0xbe1b('0x1b')][_0xbe1b('0x119')](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x14e'),'through':_0xbe1b('0x14f')});db['VoiceRecording'][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x11'),'foreignKey':_0xbe1b('0x10d')});db['ScreenRecording']['belongsTo'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x11'),'foreignKey':'UserId'});db['VoiceMail'][_0xbe1b('0x10e')](db[_0xbe1b('0x150')],{'as':_0xbe1b('0x151'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x152'),'sourceKey':_0xbe1b('0x153')});db[_0xbe1b('0x150')][_0xbe1b('0x143')](db[_0xbe1b('0x20')],{'foreignKey':'mailboxuser','targetKey':_0xbe1b('0x153')});db[_0xbe1b('0x23')][_0xbe1b('0x10e')](db[_0xbe1b('0x26')],{'as':_0xbe1b('0x154'),'foreignKey':_0xbe1b('0x155'),'constraints':![]});db[_0xbe1b('0x23')][_0xbe1b('0x10e')](db[_0xbe1b('0x25')],{'as':_0xbe1b('0x156'),'foreignKey':_0xbe1b('0x155'),'constraints':![]});db[_0xbe1b('0x23')][_0xbe1b('0x143')](db['User'],{'as':'User','foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x23')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db['MailServerIn'][_0xbe1b('0x143')](db[_0xbe1b('0x3c')],{'as':_0xbe1b('0x3c'),'foreignKey':_0xbe1b('0x15a')});db[_0xbe1b('0x38')][_0xbe1b('0x143')](db[_0xbe1b('0x15b')],{'as':_0xbe1b('0x15b'),'foreignKey':'CloudProviderId','onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x3a')]['belongsTo'](db[_0xbe1b('0x3c')],{'as':_0xbe1b('0x3c'),'foreignKey':_0xbe1b('0x15a')});db[_0xbe1b('0x3a')][_0xbe1b('0x143')](db['CloudProvider'],{'as':_0xbe1b('0x15b'),'foreignKey':'CloudProviderId','onDelete':_0xbe1b('0x15c')});db['MailAccount'][_0xbe1b('0x10a')](db[_0xbe1b('0x38')],{'as':_0xbe1b('0x15d'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x3c')][_0xbe1b('0x10a')](db[_0xbe1b('0x3a')],{'as':'Smtp','onDelete':'cascade'});db[_0xbe1b('0x3c')][_0xbe1b('0x10e')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xbe1b('0x15a'),'onDelete':_0xbe1b('0x10b')});db['MailAccount'][_0xbe1b('0x10e')](db[_0xbe1b('0x7b')],{'as':_0xbe1b('0x15e'),'foreignKey':_0xbe1b('0x15a')});db['MailAccount']['hasMany'](db['MailMessage'],{'as':_0xbe1b('0x151'),'foreignKey':_0xbe1b('0x15a')});db['MailAccount']['hasMany'](db[_0xbe1b('0x40')],{'as':_0xbe1b('0x15f')});db[_0xbe1b('0x3c')][_0xbe1b('0x10e')](db[_0xbe1b('0x43')],{'as':'Applications'});db[_0xbe1b('0x3c')][_0xbe1b('0x143')](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0x3c')]['belongsTo'](db[_0xbe1b('0x162')],{'as':_0xbe1b('0x162'),'foreignKey':_0xbe1b('0x163')});db[_0xbe1b('0x3c')]['belongsTo'](db[_0xbe1b('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xbe1b('0x14a')});db[_0xbe1b('0x3c')][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x132')});db['MailQueue'][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':'Agents','through':_0xbe1b('0x31')});db[_0xbe1b('0x3e')][_0xbe1b('0x119')](db[_0xbe1b('0xe4')],{'through':'team_has_mail_queues','as':_0xbe1b('0x14d')});db[_0xbe1b('0x40')]['hasMany'](db[_0xbe1b('0x42')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xbe1b('0x164')});db[_0xbe1b('0x40')][_0xbe1b('0x143')](db[_0xbe1b('0x3c')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x15a')});db[_0xbe1b('0x40')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':'ContactId'});db[_0xbe1b('0x40')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x166'),'foreignKey':_0xbe1b('0x10d')});db['MailInteraction']['belongsToMany'](db[_0xbe1b('0x8a')],{'through':_0xbe1b('0x167'),'as':_0xbe1b('0x168')});db[_0xbe1b('0x40')]['belongsToMany'](db['Tag'],{'through':_0xbe1b('0x167'),'as':_0xbe1b('0x169')});db[_0xbe1b('0x40')]['belongsToMany'](db['User'],{'as':_0xbe1b('0x16a'),'through':'user_has_mail_interactions','foreignKey':_0xbe1b('0x164')});db[_0xbe1b('0x42')][_0xbe1b('0x10e')](db[_0xbe1b('0xe9')],{'as':_0xbe1b('0x16b'),'onDelete':'cascade'});db[_0xbe1b('0x42')]['belongsTo'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x11')});db[_0xbe1b('0x42')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'onDelete':_0xbe1b('0x10b'),'as':'Contact'});db[_0xbe1b('0x42')][_0xbe1b('0x143')](db[_0xbe1b('0x40')],{'as':'Interaction','foreignKey':_0xbe1b('0x164')});db[_0xbe1b('0x42')][_0xbe1b('0x143')](db[_0xbe1b('0x3c')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x15a')});db[_0xbe1b('0x42')][_0xbe1b('0x143')](db[_0xbe1b('0x62')],{'as':_0xbe1b('0x62'),'foreignKey':_0xbe1b('0x16c')});db[_0xbe1b('0x42')]['belongsTo'](db[_0xbe1b('0x68')],{'as':'ChatOfflineMessage','foreignKey':_0xbe1b('0x16d')});db[_0xbe1b('0x43')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'onDelete':_0xbe1b('0x15c')});db['MailApplication'][_0xbe1b('0x143')](db[_0xbe1b('0x3e')],{'onDelete':'restrict'});db[_0xbe1b('0x43')][_0xbe1b('0x143')](db[_0xbe1b('0x3c')],{'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x43')][_0xbe1b('0x143')](db[_0xbe1b('0x80')],{'onDelete':'restrict','foreignKey':_0xbe1b('0x148')});db['MailApplication'][_0xbe1b('0x143')](db[_0xbe1b('0x8a')],{'onDelete':_0xbe1b('0x15c'),'foreignKey':_0xbe1b('0x16e')});db[_0xbe1b('0x45')]['belongsTo'](db[_0xbe1b('0x3c')],{});db[_0xbe1b('0x45')]['belongsTo'](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x160'),'foreignKey':'ListId'});db['MailQueueReport']['belongsTo'](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':'ContactId'});db[_0xbe1b('0x45')][_0xbe1b('0x143')](db['MailInteraction'],{});db['MailQueueReport'][_0xbe1b('0x143')](db['MailMessage'],{});db[_0xbe1b('0x45')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{});db[_0xbe1b('0x45')][_0xbe1b('0x143')](db['MailQueue'],{});db[_0xbe1b('0x47')][_0xbe1b('0x10e')](db[_0xbe1b('0x16f')],{'as':_0xbe1b('0x170'),'onDelete':_0xbe1b('0x10b')});db['FaxAccount']['hasMany'](db['Disposition'],{'as':_0xbe1b('0x171'),'foreignKey':_0xbe1b('0x172'),'onDelete':_0xbe1b('0x10b')});db['FaxAccount'][_0xbe1b('0x10e')](db[_0xbe1b('0x7b')],{'as':_0xbe1b('0x15e'),'foreignKey':_0xbe1b('0x172')});db['FaxAccount']['hasMany'](db[_0xbe1b('0x4d')],{'as':_0xbe1b('0x15f')});db['FaxAccount'][_0xbe1b('0x10e')](db[_0xbe1b('0x4b')],{'as':_0xbe1b('0x13a')});db['FaxAccount'][_0xbe1b('0x10e')](db[_0xbe1b('0x18')],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount'][_0xbe1b('0x10e')](db[_0xbe1b('0x4f')],{'as':_0xbe1b('0x151')});db[_0xbe1b('0x4a')][_0xbe1b('0x143')](db[_0xbe1b('0x144')],{'as':'Trunk'});db[_0xbe1b('0x4a')][_0xbe1b('0x143')](db['CmList'],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0x4a')][_0xbe1b('0x143')](db[_0xbe1b('0x81')],{'as':_0xbe1b('0x149'),'foreignKey':_0xbe1b('0x14a')});db['FaxAccount'][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x131')});db[_0xbe1b('0x4b')]['belongsTo'](db['User'],{'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x4b')][_0xbe1b('0x143')](db[_0xbe1b('0x51')],{'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x4b')][_0xbe1b('0x143')](db['FaxAccount'],{'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x4b')]['belongsTo'](db['Tag'],{'onDelete':_0xbe1b('0x15c'),'foreignKey':_0xbe1b('0x16e')});db[_0xbe1b('0x4d')][_0xbe1b('0x10e')](db['FaxMessage'],{'as':'Messages','onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x173')});db['FaxInteraction'][_0xbe1b('0x143')](db[_0xbe1b('0x4a')],{'as':'Account','foreignKey':_0xbe1b('0x172')});db[_0xbe1b('0x4d')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0x4d')][_0xbe1b('0x143')](db['User'],{'as':_0xbe1b('0x166'),'foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x4d')]['belongsToMany'](db['Tag'],{'through':_0xbe1b('0x174'),'as':_0xbe1b('0x168')});db[_0xbe1b('0x4d')][_0xbe1b('0x119')](db[_0xbe1b('0x8a')],{'through':_0xbe1b('0x174'),'as':_0xbe1b('0x169')});db[_0xbe1b('0x4d')][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x16a'),'through':_0xbe1b('0x122'),'foreignKey':_0xbe1b('0x173')});db['FaxMessage'][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'onDelete':'cascade','as':_0xbe1b('0x11')});db[_0xbe1b('0x4f')][_0xbe1b('0x143')](db[_0xbe1b('0x4d')],{'as':_0xbe1b('0x175'),'foreignKey':_0xbe1b('0x173')});db['FaxMessage'][_0xbe1b('0x143')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db['FaxMessage'][_0xbe1b('0x143')](db[_0xbe1b('0xe9')],{'as':'Attachment','foreignKey':_0xbe1b('0x176')});db['FaxMessage'][_0xbe1b('0x143')](db[_0xbe1b('0x4a')],{'as':'Account','foreignKey':_0xbe1b('0x172')});db[_0xbe1b('0x51')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xbe1b('0x32')});db[_0xbe1b('0x51')][_0xbe1b('0x119')](db['Team'],{'through':_0xbe1b('0x177'),'as':_0xbe1b('0x14d')});db['FaxQueueReport'][_0xbe1b('0x143')](db[_0xbe1b('0x4a')],{});db[_0xbe1b('0x52')][_0xbe1b('0x143')](db['CmList'],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0x52')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0x52')][_0xbe1b('0x143')](db['FaxInteraction'],{});db[_0xbe1b('0x52')][_0xbe1b('0x143')](db[_0xbe1b('0x4f')],{});db[_0xbe1b('0x52')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{});db['FaxQueueReport'][_0xbe1b('0x143')](db['FaxQueue'],{});db[_0xbe1b('0x54')][_0xbe1b('0x10e')](db[_0xbe1b('0x7d')],{'as':_0xbe1b('0x171'),'foreignKey':_0xbe1b('0x178'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x54')]['hasMany'](db[_0xbe1b('0x7b')],{'as':_0xbe1b('0x15e'),'foreignKey':_0xbe1b('0x178')});db[_0xbe1b('0x54')][_0xbe1b('0x10e')](db[_0xbe1b('0x57')],{'as':_0xbe1b('0x151'),'foreignKey':_0xbe1b('0x178')});db[_0xbe1b('0x54')]['hasMany'](db[_0xbe1b('0x179')],{'as':_0xbe1b('0x15f')});db[_0xbe1b('0x54')]['hasMany'](db[_0xbe1b('0x55')],{'as':'Applications'});db[_0xbe1b('0x54')][_0xbe1b('0x143')](db[_0xbe1b('0x12f')],{'as':'List','foreignKey':_0xbe1b('0x161')});db['SmsAccount'][_0xbe1b('0x143')](db[_0xbe1b('0x81')],{'as':_0xbe1b('0x149'),'foreignKey':_0xbe1b('0x14a')});db['SmsAccount'][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x134')});db[_0xbe1b('0x55')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'onDelete':'restrict'});db['SmsApplication'][_0xbe1b('0x143')](db[_0xbe1b('0x58')],{'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x55')][_0xbe1b('0x143')](db[_0xbe1b('0x54')],{'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x55')][_0xbe1b('0x143')](db[_0xbe1b('0x80')],{'onDelete':'restrict','foreignKey':_0xbe1b('0x148')});db['SmsApplication'][_0xbe1b('0x143')](db[_0xbe1b('0x8a')],{'onDelete':_0xbe1b('0x15c'),'foreignKey':_0xbe1b('0x16e')});db[_0xbe1b('0x179')][_0xbe1b('0x10e')](db[_0xbe1b('0x57')],{'as':_0xbe1b('0x151'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x17a')});db['SmsInteraction'][_0xbe1b('0x143')](db[_0xbe1b('0x54')],{'as':_0xbe1b('0x165'),'foreignKey':'SmsAccountId'});db[_0xbe1b('0x179')]['belongsTo'](db[_0xbe1b('0x157')],{'as':'Contact','foreignKey':'ContactId'});db[_0xbe1b('0x179')]['belongsTo'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x166'),'foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x179')][_0xbe1b('0x119')](db[_0xbe1b('0x8a')],{'through':_0xbe1b('0x17b'),'as':_0xbe1b('0x168')});db['SmsInteraction'][_0xbe1b('0x119')](db['Tag'],{'through':_0xbe1b('0x17b'),'as':'ThroughTags'});db[_0xbe1b('0x179')][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x16a'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0xbe1b('0x57')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x11')});db[_0xbe1b('0x57')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'onDelete':_0xbe1b('0x10b'),'as':_0xbe1b('0x158')});db[_0xbe1b('0x57')][_0xbe1b('0x143')](db[_0xbe1b('0x179')],{'onDelete':'cascade','as':_0xbe1b('0x175'),'foreignKey':'SmsInteractionId'});db[_0xbe1b('0x57')][_0xbe1b('0x143')](db['SmsAccount'],{'as':_0xbe1b('0x165'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':'Agents','through':_0xbe1b('0x34'),'foreignKey':_0xbe1b('0x17c')});db[_0xbe1b('0x58')]['belongsToMany'](db[_0xbe1b('0xe4')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xbe1b('0x5a')][_0xbe1b('0x10e')](db[_0xbe1b('0x7d')],{'as':_0xbe1b('0x171'),'foreignKey':_0xbe1b('0x17d'),'onDelete':_0xbe1b('0x10b')});db['OpenchannelAccount'][_0xbe1b('0x10e')](db[_0xbe1b('0x7b')],{'as':_0xbe1b('0x15e'),'foreignKey':_0xbe1b('0x17d')});db[_0xbe1b('0x5a')][_0xbe1b('0x10e')](db[_0xbe1b('0x5d')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0xbe1b('0x5a')]['hasMany'](db[_0xbe1b('0x5f')],{'as':_0xbe1b('0x151'),'foreignKey':_0xbe1b('0x17d')});db[_0xbe1b('0x5a')]['hasMany'](db[_0xbe1b('0x5b')],{'as':_0xbe1b('0x13a'),'foreignKey':_0xbe1b('0x17d')});db[_0xbe1b('0x5a')][_0xbe1b('0x143')](db[_0xbe1b('0x12f')],{'as':'List','foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0x5a')]['belongsTo'](db[_0xbe1b('0x81')],{'as':_0xbe1b('0x149'),'foreignKey':_0xbe1b('0x14a')});db[_0xbe1b('0x5a')][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x17e')});db[_0xbe1b('0x5b')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'onDelete':_0xbe1b('0x15c')});db['OpenchannelApplication']['belongsTo'](db[_0xbe1b('0x61')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0xbe1b('0x143')](db[_0xbe1b('0x5a')],{'onDelete':_0xbe1b('0x15c'),'foreignKey':_0xbe1b('0x17d')});db[_0xbe1b('0x5b')]['belongsTo'](db[_0xbe1b('0x80')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xbe1b('0x5b')]['belongsTo'](db[_0xbe1b('0x8a')],{'onDelete':_0xbe1b('0x15c'),'foreignKey':_0xbe1b('0x16e')});db[_0xbe1b('0x5d')][_0xbe1b('0x10e')](db[_0xbe1b('0x5f')],{'as':'Messages','onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x17f')});db[_0xbe1b('0x5d')][_0xbe1b('0x143')](db[_0xbe1b('0x5a')],{'as':'Account','foreignKey':_0xbe1b('0x17d')});db[_0xbe1b('0x5d')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':'ContactId'});db[_0xbe1b('0x5d')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x166'),'foreignKey':_0xbe1b('0x10d')});db['OpenchannelInteraction'][_0xbe1b('0x119')](db[_0xbe1b('0x8a')],{'through':'openchannel_interaction_has_tags','as':_0xbe1b('0x168')});db[_0xbe1b('0x5d')][_0xbe1b('0x119')](db['Tag'],{'through':_0xbe1b('0x180'),'as':'ThroughTags'});db[_0xbe1b('0x5d')]['belongsToMany'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x16a'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0xbe1b('0x5f')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'onDelete':_0xbe1b('0x10b'),'as':_0xbe1b('0x11')});db['OpenchannelMessage']['belongsTo'](db[_0xbe1b('0x157')],{'onDelete':_0xbe1b('0x10b'),'as':_0xbe1b('0x158')});db['OpenchannelMessage']['belongsTo'](db[_0xbe1b('0x5d')],{'onDelete':_0xbe1b('0x10b'),'as':_0xbe1b('0x175'),'foreignKey':_0xbe1b('0x17f')});db[_0xbe1b('0x5f')]['belongsTo'](db[_0xbe1b('0xe9')],{'as':_0xbe1b('0xe9'),'foreignKey':'AttachmentId'});db[_0xbe1b('0x5f')][_0xbe1b('0x143')](db[_0xbe1b('0x5a')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x17d')});db[_0xbe1b('0x61')]['belongsToMany'](db['User'],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x12c'),'foreignKey':_0xbe1b('0x181')});db['OpenchannelQueue'][_0xbe1b('0x119')](db[_0xbe1b('0xe4')],{'through':_0xbe1b('0x182'),'as':'Teams'});db[_0xbe1b('0x62')][_0xbe1b('0x10e')](db[_0xbe1b('0x7d')],{'as':'Dispositions','foreignKey':_0xbe1b('0x16c'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x62')]['hasMany'](db['CannedAnswer'],{'as':_0xbe1b('0x15e'),'foreignKey':_0xbe1b('0x16c')});db[_0xbe1b('0x62')][_0xbe1b('0x10e')](db[_0xbe1b('0x6a')],{'as':_0xbe1b('0x183')});db[_0xbe1b('0x62')][_0xbe1b('0x10e')](db['ChatInteraction'],{'as':_0xbe1b('0x15f')});db['ChatWebsite'][_0xbe1b('0x10e')](db[_0xbe1b('0x184')],{'as':_0xbe1b('0x13a')});db[_0xbe1b('0x62')]['hasMany'](db[_0xbe1b('0x185')],{'as':'Messages'});db[_0xbe1b('0x62')][_0xbe1b('0x143')](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0x62')][_0xbe1b('0x143')](db['Interval'],{'as':'Interval','foreignKey':_0xbe1b('0x148')});db[_0xbe1b('0x62')][_0xbe1b('0x143')](db[_0xbe1b('0x3c')],{'as':'MailAccount','foreignKey':_0xbe1b('0x15a')});db[_0xbe1b('0x62')]['belongsTo'](db[_0xbe1b('0x81')],{'as':_0xbe1b('0x149'),'foreignKey':_0xbe1b('0x14a')});db[_0xbe1b('0x62')]['belongsToMany'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x130')});db[_0xbe1b('0x63')][_0xbe1b('0x143')](db[_0xbe1b('0x5a')],{});db[_0xbe1b('0x63')][_0xbe1b('0x143')](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0x63')][_0xbe1b('0x143')](db['CmContact'],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0x63')][_0xbe1b('0x143')](db['OpenchannelInteraction'],{});db[_0xbe1b('0x63')][_0xbe1b('0x143')](db[_0xbe1b('0x5f')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xbe1b('0x11')],{});db[_0xbe1b('0x63')][_0xbe1b('0x143')](db['OpenchannelQueue'],{});db[_0xbe1b('0x184')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0xbe1b('0x184')][_0xbe1b('0x143')](db['ChatQueue'],{'as':_0xbe1b('0x186'),'foreignKey':_0xbe1b('0x187'),'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x184')][_0xbe1b('0x143')](db['ChatWebsite'],{'as':_0xbe1b('0x188'),'foreignKey':'ChatWebsiteId','onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x184')]['belongsTo'](db[_0xbe1b('0x8a')],{'onDelete':_0xbe1b('0x15c'),'foreignKey':_0xbe1b('0x16e')});db[_0xbe1b('0x11f')][_0xbe1b('0x10e')](db[_0xbe1b('0x185')],{'as':_0xbe1b('0x151'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x189')});db[_0xbe1b('0x11f')][_0xbe1b('0x143')](db['ChatWebsite'],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x16c')});db[_0xbe1b('0x11f')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0x11f')]['belongsTo'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x166'),'foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x11f')]['belongsToMany'](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xbe1b('0x168')});db['ChatInteraction'][_0xbe1b('0x119')](db[_0xbe1b('0x8a')],{'through':_0xbe1b('0x18a'),'as':'ThroughTags'});db['ChatInteraction'][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x16a'),'through':_0xbe1b('0x121'),'foreignKey':_0xbe1b('0x189')});db[_0xbe1b('0x185')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'onDelete':_0xbe1b('0x10b'),'as':_0xbe1b('0x11')});db['ChatMessage']['belongsTo'](db[_0xbe1b('0x157')],{'onDelete':_0xbe1b('0x10b'),'as':'Contact','foreignKey':_0xbe1b('0x159')});db['ChatMessage'][_0xbe1b('0x143')](db[_0xbe1b('0x11f')],{'onDelete':'cascade','as':_0xbe1b('0x175'),'foreignKey':'ChatInteractionId'});db[_0xbe1b('0x185')][_0xbe1b('0x143')](db[_0xbe1b('0xe9')],{'as':'Attachment','foreignKey':_0xbe1b('0x176')});db[_0xbe1b('0x185')]['belongsTo'](db[_0xbe1b('0x62')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x16c')});db[_0xbe1b('0x68')]['hasMany'](db[_0xbe1b('0xe9')],{'as':_0xbe1b('0x16b'),'foreignKey':_0xbe1b('0x16d'),'onDelete':_0xbe1b('0x10b'),'hooks':!![]});db[_0xbe1b('0x68')]['belongsTo'](db[_0xbe1b('0x157')],{'onDelete':_0xbe1b('0x10b'),'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0x68')][_0xbe1b('0x143')](db[_0xbe1b('0x62')],{'as':_0xbe1b('0x165'),'foreignKey':'ChatWebsiteId'});db[_0xbe1b('0x127')][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x2f'),'hooks':!![]});db['ChatQueue'][_0xbe1b('0x119')](db[_0xbe1b('0xe4')],{'through':_0xbe1b('0x18b'),'as':_0xbe1b('0x14d')});db[_0xbe1b('0x11a')][_0xbe1b('0x10e')](db[_0xbe1b('0x18c')],{'as':_0xbe1b('0x151'),'foreignKey':'ChatGroupId','onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x11a')]['belongsToMany'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x13d'),'through':_0xbe1b('0x11b')});db[_0xbe1b('0x6a')][_0xbe1b('0x143')](db[_0xbe1b('0x62')],{'as':_0xbe1b('0x188'),'foreignKey':'ChatWebsiteId'});db[_0xbe1b('0x6b')][_0xbe1b('0x10e')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x11c'),'foreignKey':_0xbe1b('0x18d')});db[_0xbe1b('0x157')]['hasMany'](db[_0xbe1b('0x8e')],{'as':_0xbe1b('0x18e'),'foreignKey':'CmContactId'});db[_0xbe1b('0x157')][_0xbe1b('0x10e')](db[_0xbe1b('0x6e')],{'as':'Hoppers','foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0x157')][_0xbe1b('0x10e')](db[_0xbe1b('0x71')],{'as':'HopperFinals','foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0x157')][_0xbe1b('0x10e')](db[_0xbe1b('0x73')],{'as':_0xbe1b('0x140'),'foreignKey':'ContactId'});db[_0xbe1b('0x157')]['hasMany'](db[_0xbe1b('0x75')],{'as':'ReportAgentPreview','foreignKey':_0xbe1b('0x159')});db['CmContact']['hasMany'](db[_0xbe1b('0xd4')],{'as':_0xbe1b('0x142'),'foreignKey':'ContactId'});db[_0xbe1b('0x157')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xbe1b('0x111'),'foreignKey':_0xbe1b('0x159'),'onDelete':'restrict'});db[_0xbe1b('0x157')][_0xbe1b('0x10e')](db[_0xbe1b('0x11f')],{'as':_0xbe1b('0x120'),'foreignKey':'ContactId','onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x157')][_0xbe1b('0x10e')](db[_0xbe1b('0x179')],{'as':_0xbe1b('0x112'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xbe1b('0x157')][_0xbe1b('0x10e')](db[_0xbe1b('0x4d')],{'as':_0xbe1b('0x113'),'foreignKey':_0xbe1b('0x159'),'onDelete':_0xbe1b('0x15c')});db['CmContact'][_0xbe1b('0x10e')](db[_0xbe1b('0x40')],{'as':_0xbe1b('0x114'),'foreignKey':_0xbe1b('0x159'),'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x157')][_0xbe1b('0x143')](db[_0xbe1b('0x6b')],{'as':_0xbe1b('0x18f'),'foreignKey':_0xbe1b('0x18d')});db[_0xbe1b('0x157')]['belongsTo'](db['CmList'],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161'),'onDelete':'cascade'});db[_0xbe1b('0x157')][_0xbe1b('0x119')](db['User'],{'as':_0xbe1b('0x16a'),'through':_0xbe1b('0x11d')});db[_0xbe1b('0x157')][_0xbe1b('0x119')](db['Tag'],{'as':_0xbe1b('0x168'),'through':_0xbe1b('0x190')});db[_0xbe1b('0x157')][_0xbe1b('0x119')](db['Tag'],{'through':_0xbe1b('0x190'),'as':'ThroughTags'});db[_0xbe1b('0x6e')][_0xbe1b('0x10e')](db[_0xbe1b('0x8f')],{'as':_0xbe1b('0x191'),'foreignKey':_0xbe1b('0x192')});db['CmHopper'][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x6e')]['belongsTo'](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x6e')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':'Agent','foreignKey':'UserId'});db[_0xbe1b('0x6e')][_0xbe1b('0x143')](db[_0xbe1b('0x1b')],{'as':_0xbe1b('0x186'),'foreignKey':_0xbe1b('0x13f'),'onDelete':'cascade'});db['CmHopper'][_0xbe1b('0x143')](db[_0xbe1b('0xe7')],{'as':'Campaign','foreignKey':_0xbe1b('0x193'),'onDelete':_0xbe1b('0x10b')});db['CmHopper'][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x166'),'foreignKey':_0xbe1b('0x194')});db[_0xbe1b('0x70')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':'Contact','foreignKey':_0xbe1b('0x159'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x70')][_0xbe1b('0x143')](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x160'),'foreignKey':'ListId','onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x70')][_0xbe1b('0x143')](db[_0xbe1b('0x1b')],{'as':_0xbe1b('0x186'),'foreignKey':_0xbe1b('0x13f'),'onDelete':_0xbe1b('0x10b')});db['CmHopperBlack'][_0xbe1b('0x143')](db['Campaign'],{'as':_0xbe1b('0xe7'),'foreignKey':_0xbe1b('0x193'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x195')][_0xbe1b('0x10e')](db[_0xbe1b('0x196')],{'as':{'plural':_0xbe1b('0x197'),'singular':_0xbe1b('0x198')},'foreignKey':_0xbe1b('0x199'),'onDelete':_0xbe1b('0x10b'),'hooks':!![]});db[_0xbe1b('0x195')][_0xbe1b('0x10e')](db['Condition'],{'as':{'plural':_0xbe1b('0x19a'),'singular':_0xbe1b('0x19b')},'foreignKey':'AutomationAnyId','onDelete':_0xbe1b('0x10b'),'hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0xbe1b('0x19c'),'foreignKey':_0xbe1b('0x19d'),'onDelete':'cascade','hooks':!![]});db[_0xbe1b('0x7d')][_0xbe1b('0x10e')](db[_0xbe1b('0x7d')],{'as':_0xbe1b('0x171'),'foreignKey':_0xbe1b('0x19e'),'onDelete':'cascade'});db[_0xbe1b('0x80')][_0xbe1b('0x10e')](db[_0xbe1b('0x80')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xbe1b('0x10b'),'hooks':!![],'required':![]});db['Interval'][_0xbe1b('0x10e')](db[_0xbe1b('0x18')],{'as':_0xbe1b('0x19f'),'foreignKey':_0xbe1b('0x148'),'onDelete':'restrict'});db[_0xbe1b('0x80')][_0xbe1b('0x10e')](db[_0xbe1b('0x43')],{'as':'MailApplications','foreignKey':_0xbe1b('0x148')});db['Interval'][_0xbe1b('0x10e')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0xbe1b('0x80')][_0xbe1b('0x10e')](db['FaxApplication'],{'as':_0xbe1b('0x1a0'),'foreignKey':'IntervalId'});db[_0xbe1b('0x80')]['hasMany'](db[_0xbe1b('0x55')],{'as':'SmsApplications','foreignKey':_0xbe1b('0x148')});db[_0xbe1b('0x1a1')][_0xbe1b('0x143')](db[_0xbe1b('0x3c')],{});db[_0xbe1b('0x1a1')]['belongsTo'](db[_0xbe1b('0x98')],{'foreignKey':'DefaultReportId'});db['Schedule']['belongsTo'](db[_0xbe1b('0x1a2')],{'foreignKey':'CustomReportId'});db[_0xbe1b('0x88')]['belongsToMany'](db[_0xbe1b('0x1a')],{'as':_0xbe1b('0x1a3'),'through':_0xbe1b('0x13c'),'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x8a')][_0xbe1b('0x119')](db[_0xbe1b('0x157')],{'through':_0xbe1b('0x190')});db[_0xbe1b('0x8a')]['belongsToMany'](db['ChatInteraction'],{'through':_0xbe1b('0x18a')});db['Tag'][_0xbe1b('0x119')](db[_0xbe1b('0x40')],{'through':'mail_interaction_has_tags'});db[_0xbe1b('0x8a')][_0xbe1b('0x119')](db[_0xbe1b('0x179')],{'through':'sms_interaction_has_tags'});db[_0xbe1b('0x8a')]['belongsToMany'](db[_0xbe1b('0x4d')],{'through':_0xbe1b('0x174')});db[_0xbe1b('0x8a')][_0xbe1b('0x119')](db[_0xbe1b('0x5d')],{'through':_0xbe1b('0x180')});db['Tag'][_0xbe1b('0x119')](db[_0xbe1b('0x115')],{'through':_0xbe1b('0x1a4')});db[_0xbe1b('0x8e')][_0xbe1b('0x143')](db[_0xbe1b('0x8c')],{'as':'ItemType','foreignKey':_0xbe1b('0x1a5')});db[_0xbe1b('0x8f')][_0xbe1b('0x143')](db['CmHopper'],{'as':'Hopper','foreignKey':_0xbe1b('0x192')});db[_0xbe1b('0x8e')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x1a6')});db[_0xbe1b('0x1a7')]['hasMany'](db[_0xbe1b('0x196')],{'as':{'plural':_0xbe1b('0x1a8'),'singular':_0xbe1b('0x1a9')},'foreignKey':_0xbe1b('0x1aa'),'onDelete':'cascade','hooks':!![]});db[_0xbe1b('0x1a7')][_0xbe1b('0x10e')](db['Condition'],{'as':{'plural':_0xbe1b('0x1ab'),'singular':_0xbe1b('0x1ac')},'foreignKey':_0xbe1b('0x1ad'),'onDelete':'cascade','hooks':!![]});db[_0xbe1b('0x1a7')]['hasMany'](db[_0xbe1b('0x78')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xbe1b('0x10b'),'hooks':!![]});db[_0xbe1b('0x1a2')][_0xbe1b('0x10e')](db[_0xbe1b('0x9c')],{'as':_0xbe1b('0x1ae'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1af'),'hooks':!![]});db[_0xbe1b('0x98')]['hasMany'](db[_0xbe1b('0x9c')],{'as':_0xbe1b('0x1ae'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b0')});db['AnalyticMetric'][_0xbe1b('0x10e')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b1')});db[_0xbe1b('0x9c')][_0xbe1b('0x143')](db[_0xbe1b('0x9b')],{'foreignKey':_0xbe1b('0x1b1')});db['SalesforceAccount'][_0xbe1b('0x10e')](db['SalesforceConfiguration'],{'as':_0xbe1b('0x1b2'),'onDelete':_0xbe1b('0x10b'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db[_0xbe1b('0x1b3')],{'as':_0xbe1b('0x1b4'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xa1')]['hasMany'](db[_0xbe1b('0x1b3')],{'as':'Descriptions','onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0xa1')][_0xbe1b('0x10e')](db['SalesforceField'],{'as':_0xbe1b('0x1ae'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xa1')][_0xbe1b('0x143')](db[_0xbe1b('0x1b8')],{'as':'Account','foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0x1b3')]['hasMany'](db[_0xbe1b('0x1b3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xbe1b('0x1b3')][_0xbe1b('0x10e')](db[_0xbe1b('0x1b3')],{'as':_0xbe1b('0x1ba'),'foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0x1b3')]['hasMany'](db[_0xbe1b('0x1b3')],{'as':_0xbe1b('0x1bb'),'foreignKey':'FieldId'});db[_0xbe1b('0x1b3')][_0xbe1b('0x143')](db['Variable'],{'as':_0xbe1b('0x92'),'foreignKey':_0xbe1b('0x1bc')});db[_0xbe1b('0x1bd')][_0xbe1b('0x10e')](db[_0xbe1b('0xa4')],{'as':_0xbe1b('0x1b2'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b9')});db['SugarcrmConfiguration'][_0xbe1b('0x10e')](db['SugarcrmField'],{'as':_0xbe1b('0x1b4'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xa4')]['hasMany'](db[_0xbe1b('0xa6')],{'as':_0xbe1b('0x1be'),'onDelete':'cascade','foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0xa4')][_0xbe1b('0x10e')](db[_0xbe1b('0xa6')],{'as':_0xbe1b('0x1ae'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xa4')][_0xbe1b('0x143')](db[_0xbe1b('0x1bd')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xa6')][_0xbe1b('0x10e')](db[_0xbe1b('0xa6')],{'as':_0xbe1b('0x1bf'),'foreignKey':'SubjectId'});db[_0xbe1b('0xa6')][_0xbe1b('0x10e')](db[_0xbe1b('0xa6')],{'as':'Description','foreignKey':'DescriptionId'});db['SugarcrmField'][_0xbe1b('0x10e')](db['SugarcrmField'],{'as':_0xbe1b('0x1bb'),'foreignKey':_0xbe1b('0x1b7')});db['SugarcrmField']['belongsTo'](db[_0xbe1b('0x92')],{'as':_0xbe1b('0x92'),'foreignKey':_0xbe1b('0x1bc')});db[_0xbe1b('0xa8')][_0xbe1b('0x10e')](db[_0xbe1b('0x1c0')],{'as':_0xbe1b('0x1b2'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b9')});db['DeskConfiguration'][_0xbe1b('0x10e')](db[_0xbe1b('0xab')],{'as':_0xbe1b('0x1b4'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0x1c0')][_0xbe1b('0x10e')](db[_0xbe1b('0xab')],{'as':_0xbe1b('0x1be'),'onDelete':_0xbe1b('0x10b'),'foreignKey':'DescriptionId'});db[_0xbe1b('0x1c0')][_0xbe1b('0x10e')](db['DeskField'],{'as':_0xbe1b('0x1ae'),'onDelete':_0xbe1b('0x10b'),'foreignKey':'FieldId'});db[_0xbe1b('0x1c0')][_0xbe1b('0x143')](db[_0xbe1b('0xa8')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1b9')});db['DeskConfiguration'][_0xbe1b('0x119')](db[_0xbe1b('0x8a')],{'through':_0xbe1b('0x1c1')});db[_0xbe1b('0xab')][_0xbe1b('0x10e')](db[_0xbe1b('0xab')],{'as':_0xbe1b('0x1bf'),'foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xab')][_0xbe1b('0x10e')](db[_0xbe1b('0xab')],{'as':_0xbe1b('0x1ba'),'foreignKey':_0xbe1b('0x1b6')});db['DeskField'][_0xbe1b('0x10e')](db[_0xbe1b('0xab')],{'as':_0xbe1b('0x1bb'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xab')][_0xbe1b('0x143')](db['Variable'],{'as':_0xbe1b('0x92'),'foreignKey':_0xbe1b('0x1bc')});db['ZohoAccount']['hasMany'](db['ZohoConfiguration'],{'as':_0xbe1b('0x1b2'),'onDelete':_0xbe1b('0x10b'),'foreignKey':'AccountId'});db[_0xbe1b('0xae')]['hasMany'](db[_0xbe1b('0xb0')],{'as':_0xbe1b('0x1b4'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xae')][_0xbe1b('0x10e')](db[_0xbe1b('0xb0')],{'as':_0xbe1b('0x1be'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xbe1b('0xae')][_0xbe1b('0x10e')](db['ZohoField'],{'as':'Fields','onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xae')][_0xbe1b('0x143')](db[_0xbe1b('0xad')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xb0')][_0xbe1b('0x10e')](db[_0xbe1b('0xb0')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xbe1b('0xb0')][_0xbe1b('0x10e')](db[_0xbe1b('0xb0')],{'as':_0xbe1b('0x1ba'),'foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0xb0')][_0xbe1b('0x10e')](db['ZohoField'],{'as':_0xbe1b('0x1bb'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xb0')][_0xbe1b('0x143')](db[_0xbe1b('0x92')],{'as':_0xbe1b('0x92'),'foreignKey':_0xbe1b('0x1bc')});db[_0xbe1b('0x1c2')][_0xbe1b('0x10e')](db[_0xbe1b('0xb3')],{'as':'Configurations','onDelete':_0xbe1b('0x10b'),'foreignKey':'AccountId'});db[_0xbe1b('0xb3')][_0xbe1b('0x10e')](db[_0xbe1b('0x1c3')],{'as':_0xbe1b('0x1b4'),'foreignKey':_0xbe1b('0x1b5')});db['ZendeskConfiguration'][_0xbe1b('0x10e')](db[_0xbe1b('0x1c3')],{'as':_0xbe1b('0x1be'),'foreignKey':'DescriptionId'});db[_0xbe1b('0xb3')][_0xbe1b('0x10e')](db['ZendeskField'],{'as':_0xbe1b('0x1ae'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xb3')][_0xbe1b('0x143')](db['ZendeskAccount'],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1b9')});db['ZendeskConfiguration'][_0xbe1b('0x119')](db['Tag'],{'through':_0xbe1b('0x1c4')});db['ZendeskField'][_0xbe1b('0x10e')](db[_0xbe1b('0x1c3')],{'as':'Subject','foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0x1c3')]['hasMany'](db[_0xbe1b('0x1c3')],{'as':_0xbe1b('0x1ba'),'foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0x1c3')][_0xbe1b('0x10e')](db[_0xbe1b('0x1c3')],{'as':'Field','foreignKey':_0xbe1b('0x1b7')});db['ZendeskField'][_0xbe1b('0x143')](db[_0xbe1b('0x92')],{'as':_0xbe1b('0x92'),'foreignKey':'VariableId'});db[_0xbe1b('0xb5')]['hasMany'](db[_0xbe1b('0xb6')],{'as':'Configurations','onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xb6')]['hasMany'](db[_0xbe1b('0xb8')],{'as':_0xbe1b('0x1b4'),'onDelete':'cascade','foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xb6')][_0xbe1b('0x10e')](db['FreshdeskField'],{'as':_0xbe1b('0x1be'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0xb6')][_0xbe1b('0x10e')](db[_0xbe1b('0xb8')],{'as':_0xbe1b('0x1ae'),'onDelete':'cascade','foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xb6')][_0xbe1b('0x143')](db[_0xbe1b('0xb5')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xb6')][_0xbe1b('0x119')](db[_0xbe1b('0x8a')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xbe1b('0xb8')]['hasMany'](db[_0xbe1b('0xb8')],{'as':'Subject','foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xb8')][_0xbe1b('0x10e')](db[_0xbe1b('0xb8')],{'as':_0xbe1b('0x1ba'),'foreignKey':'DescriptionId'});db[_0xbe1b('0xb8')][_0xbe1b('0x10e')](db[_0xbe1b('0xb8')],{'as':_0xbe1b('0x1bb'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xb8')][_0xbe1b('0x143')](db[_0xbe1b('0x92')],{'as':_0xbe1b('0x92'),'foreignKey':'VariableId'});db[_0xbe1b('0xb9')][_0xbe1b('0x10e')](db['VtigerConfiguration'],{'as':_0xbe1b('0x1b2'),'onDelete':'cascade','foreignKey':_0xbe1b('0x1b9')});db['VtigerConfiguration']['hasMany'](db[_0xbe1b('0xbd')],{'as':_0xbe1b('0x1b4'),'foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xbb')]['hasMany'](db[_0xbe1b('0xbd')],{'as':_0xbe1b('0x1be'),'foreignKey':_0xbe1b('0x1b6')});db['VtigerConfiguration']['hasMany'](db[_0xbe1b('0xbd')],{'as':_0xbe1b('0x1ae'),'foreignKey':_0xbe1b('0x1b7')});db['VtigerConfiguration'][_0xbe1b('0x143')](db[_0xbe1b('0xb9')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xbd')][_0xbe1b('0x10e')](db[_0xbe1b('0xbd')],{'as':'Subject','foreignKey':_0xbe1b('0x1b5')});db['VtigerField'][_0xbe1b('0x10e')](db[_0xbe1b('0xbd')],{'as':'Description','foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0xbd')][_0xbe1b('0x10e')](db[_0xbe1b('0xbd')],{'as':_0xbe1b('0x1bb'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xbd')]['belongsTo'](db[_0xbe1b('0x92')],{'as':'Variable','foreignKey':'VariableId'});db[_0xbe1b('0xbf')]['hasMany'](db[_0xbe1b('0xc0')],{'as':_0xbe1b('0x1b2'),'onDelete':'cascade','foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xc0')]['hasMany'](db[_0xbe1b('0xc2')],{'as':_0xbe1b('0x1b4'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0xbe1b('0x10e')](db[_0xbe1b('0xc2')],{'as':_0xbe1b('0x1be'),'foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0xc0')][_0xbe1b('0x10e')](db[_0xbe1b('0xc2')],{'as':_0xbe1b('0x1ae'),'foreignKey':'FieldId'});db[_0xbe1b('0xc0')][_0xbe1b('0x143')](db[_0xbe1b('0xbf')],{'as':_0xbe1b('0x165'),'foreignKey':'AccountId'});db[_0xbe1b('0xc2')][_0xbe1b('0x10e')](db[_0xbe1b('0xc2')],{'as':'Subject','foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xc2')][_0xbe1b('0x10e')](db[_0xbe1b('0xc2')],{'as':_0xbe1b('0x1ba'),'foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0xc2')][_0xbe1b('0x10e')](db[_0xbe1b('0xc2')],{'as':_0xbe1b('0x1bb'),'foreignKey':_0xbe1b('0x1b7')});db['ServicenowField']['belongsTo'](db['Variable'],{'as':_0xbe1b('0x92'),'foreignKey':_0xbe1b('0x1bc')});db[_0xbe1b('0xc3')][_0xbe1b('0x10e')](db[_0xbe1b('0xc5')],{'as':_0xbe1b('0x1b2'),'onDelete':'cascade','foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xc3')][_0xbe1b('0x143')](db[_0xbe1b('0x15b')],{'as':_0xbe1b('0x15b'),'foreignKey':_0xbe1b('0x1c5')});db['Dynamics365Configuration']['hasMany'](db[_0xbe1b('0xc7')],{'as':'Subjects','onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xc5')][_0xbe1b('0x10e')](db[_0xbe1b('0xc7')],{'as':_0xbe1b('0x1be'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b6')});db[_0xbe1b('0xc5')][_0xbe1b('0x10e')](db[_0xbe1b('0xc7')],{'as':_0xbe1b('0x1ae'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xc5')][_0xbe1b('0x143')](db[_0xbe1b('0xc3')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xc7')][_0xbe1b('0x10e')](db[_0xbe1b('0xc7')],{'as':_0xbe1b('0x1bf'),'foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xc7')]['hasMany'](db[_0xbe1b('0xc7')],{'as':_0xbe1b('0x1ba'),'foreignKey':_0xbe1b('0x1b6')});db['Dynamics365Field'][_0xbe1b('0x10e')](db['Dynamics365Field'],{'as':_0xbe1b('0x1bb'),'foreignKey':_0xbe1b('0x1b7')});db[_0xbe1b('0xc7')][_0xbe1b('0x143')](db[_0xbe1b('0x92')],{'as':_0xbe1b('0x92'),'foreignKey':_0xbe1b('0x1bc')});db[_0xbe1b('0x1c6')][_0xbe1b('0x10e')](db[_0xbe1b('0xca')],{'as':_0xbe1b('0x1b2'),'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xca')][_0xbe1b('0x10e')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0xbe1b('0x1b5')});db['FreshsalesConfiguration'][_0xbe1b('0x10e')](db[_0xbe1b('0xcb')],{'as':_0xbe1b('0x1be'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration']['hasMany'](db[_0xbe1b('0xcb')],{'as':'Fields','foreignKey':_0xbe1b('0x1b7')});db['FreshsalesConfiguration'][_0xbe1b('0x143')](db[_0xbe1b('0x1c6')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1b9')});db[_0xbe1b('0xcb')][_0xbe1b('0x10e')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0xbe1b('0x1b5')});db[_0xbe1b('0xcb')][_0xbe1b('0x10e')](db[_0xbe1b('0xcb')],{'as':'Description','foreignKey':_0xbe1b('0x1b6')});db['FreshsalesField'][_0xbe1b('0x10e')](db[_0xbe1b('0xcb')],{'as':_0xbe1b('0x1bb'),'foreignKey':_0xbe1b('0x1b7')});db['FreshsalesField'][_0xbe1b('0x143')](db['Variable'],{'as':_0xbe1b('0x92'),'foreignKey':_0xbe1b('0x1bc')});db['ChatQueueReport'][_0xbe1b('0x143')](db[_0xbe1b('0x62')],{});db['ChatQueueReport']['belongsTo'](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161')});db['ChatQueueReport'][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0xcd')][_0xbe1b('0x143')](db['ChatInteraction'],{});db[_0xbe1b('0xcd')][_0xbe1b('0x143')](db[_0xbe1b('0x185')],{});db[_0xbe1b('0xcd')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{});db['ChatQueueReport'][_0xbe1b('0x143')](db['ChatQueue'],{});db[_0xbe1b('0x18c')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'onDelete':_0xbe1b('0x10b'),'foreignKey':_0xbe1b('0x1c7')});db[_0xbe1b('0x18c')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'onDelete':'cascade','foreignKey':_0xbe1b('0x1c8')});db['JscriptySessionReport']['hasMany'](db[_0xbe1b('0xd2')],{'foreignKey':'SessionId','onDelete':'cascade'});db['JscriptySessionReport'][_0xbe1b('0x10e')](db[_0xbe1b('0xd0')],{'foreignKey':'SessionId','onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0xd5')][_0xbe1b('0x143')](db[_0xbe1b('0x54')],{});db['SmsQueueReport'][_0xbe1b('0x143')](db[_0xbe1b('0x12f')],{'as':'List','foreignKey':'ListId'});db[_0xbe1b('0xd5')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0xd5')]['belongsTo'](db['SmsInteraction'],{});db[_0xbe1b('0xd5')][_0xbe1b('0x143')](db['SmsMessage'],{});db[_0xbe1b('0xd5')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{});db[_0xbe1b('0xd5')]['belongsTo'](db['SmsQueue'],{});db[_0xbe1b('0xda')][_0xbe1b('0x10e')](db[_0xbe1b('0xd4')],{'foreignKey':_0xbe1b('0x1c9')});db[_0xbe1b('0xda')][_0xbe1b('0x10e')](db[_0xbe1b('0xd2')],{'foreignKey':_0xbe1b('0x1c9')});db[_0xbe1b('0xda')]['hasMany'](db[_0xbe1b('0xd0')],{'foreignKey':_0xbe1b('0x1c9')});db[_0xbe1b('0xdf')][_0xbe1b('0x119')](db['User'],{'as':'Users','through':_0xbe1b('0x137')});db['Team']['belongsToMany'](db['User'],{'as':'Agents','through':_0xbe1b('0x1ca')});db['Team'][_0xbe1b('0x119')](db[_0xbe1b('0x1b')],{'through':_0xbe1b('0x103'),'as':_0xbe1b('0x1cb')});db['Team'][_0xbe1b('0x119')](db[_0xbe1b('0x3e')],{'through':_0xbe1b('0x1cc'),'as':'MailQueues'});db[_0xbe1b('0xe4')][_0xbe1b('0x119')](db[_0xbe1b('0x127')],{'through':_0xbe1b('0x18b'),'as':'ChatQueues'});db[_0xbe1b('0xe4')][_0xbe1b('0x119')](db['FaxQueue'],{'through':_0xbe1b('0x177'),'as':_0xbe1b('0x129')});db['Team'][_0xbe1b('0x119')](db[_0xbe1b('0x58')],{'through':'team_has_sms_queues','as':_0xbe1b('0x12a')});db['Team']['belongsToMany'](db[_0xbe1b('0x61')],{'through':_0xbe1b('0x182'),'as':'OpenchannelQueues'});db[_0xbe1b('0xe4')][_0xbe1b('0x119')](db[_0xbe1b('0x12d')],{'through':_0xbe1b('0x1cd'),'as':'WhatsappQueues'});db['Team'][_0xbe1b('0x119')](db[_0xbe1b('0xf4')],{'through':_0xbe1b('0x105'),'as':_0xbe1b('0x1ce')});db[_0xbe1b('0xe7')][_0xbe1b('0x10e')](db[_0xbe1b('0x6e')],{'as':_0xbe1b('0x13e'),'foreignKey':'CampaignId'});db[_0xbe1b('0xe7')]['hasMany'](db[_0xbe1b('0x71')],{'as':_0xbe1b('0x1cf'),'foreignKey':_0xbe1b('0x193')});db[_0xbe1b('0xe7')][_0xbe1b('0x10e')](db['CmHopperHistory'],{'as':_0xbe1b('0x140'),'foreignKey':_0xbe1b('0x193')});db[_0xbe1b('0xe7')][_0xbe1b('0x10e')](db['CmHopperBlack'],{'as':_0xbe1b('0x141'),'foreignKey':_0xbe1b('0x193')});db[_0xbe1b('0xe7')][_0xbe1b('0x143')](db[_0xbe1b('0x144')],{'as':_0xbe1b('0x144'),'foreignKey':_0xbe1b('0x145')});db['Campaign']['belongsTo'](db[_0xbe1b('0x144')],{'as':'TrunkBackup','foreignKey':_0xbe1b('0x147')});db[_0xbe1b('0xe7')][_0xbe1b('0x143')](db[_0xbe1b('0x80')],{'as':_0xbe1b('0x80'),'foreignKey':_0xbe1b('0x148')});db[_0xbe1b('0xe7')][_0xbe1b('0x143')](db[_0xbe1b('0xdf')],{'as':_0xbe1b('0xdf'),'foreignKey':_0xbe1b('0x1d0')});db['Campaign'][_0xbe1b('0x119')](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x14b'),'through':_0xbe1b('0x1d1')});db[_0xbe1b('0xe7')][_0xbe1b('0x119')](db[_0xbe1b('0x12f')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xbe1b('0xe9')][_0xbe1b('0x143')](db[_0xbe1b('0x68')],{'as':'ChatOfflineMessage','foreignKey':_0xbe1b('0x16d')});db[_0xbe1b('0xeb')][_0xbe1b('0x143')](db[_0xbe1b('0x42')],{});db['MailTransferReport'][_0xbe1b('0x143')](db[_0xbe1b('0x40')],{});db[_0xbe1b('0xeb')][_0xbe1b('0x143')](db[_0xbe1b('0x3c')],{'foreignKey':'FromMailAccountId','as':_0xbe1b('0x1d2')});db[_0xbe1b('0xeb')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'foreignKey':_0xbe1b('0x1d3'),'as':_0xbe1b('0x1d4')});db[_0xbe1b('0xeb')][_0xbe1b('0x143')](db['User'],{'foreignKey':_0xbe1b('0x1d5'),'as':'ToAgent'});db['MailTransferReport'][_0xbe1b('0x143')](db[_0xbe1b('0x3e')],{'foreignKey':_0xbe1b('0x1d6'),'as':'ToQueue'});db[_0xbe1b('0xeb')][_0xbe1b('0x143')](db[_0xbe1b('0x3c')],{'foreignKey':'ToMailAccountId','as':_0xbe1b('0x1d7')});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0xbe1b('0xed')][_0xbe1b('0x143')](db[_0xbe1b('0x11f')],{});db[_0xbe1b('0xed')][_0xbe1b('0x143')](db[_0xbe1b('0x62')],{'foreignKey':'FromChatWebsiteId','as':_0xbe1b('0x1d2')});db[_0xbe1b('0xed')]['belongsTo'](db[_0xbe1b('0x11')],{'foreignKey':'FromUserId','as':_0xbe1b('0x1d4')});db[_0xbe1b('0xed')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xbe1b('0xed')][_0xbe1b('0x143')](db[_0xbe1b('0x127')],{'foreignKey':_0xbe1b('0x1d8'),'as':_0xbe1b('0x1d9')});db[_0xbe1b('0xed')][_0xbe1b('0x143')](db[_0xbe1b('0x62')],{'foreignKey':_0xbe1b('0x1da'),'as':_0xbe1b('0x1d7')});db['FaxTransferReport'][_0xbe1b('0x143')](db[_0xbe1b('0x4f')],{});db['FaxTransferReport'][_0xbe1b('0x143')](db[_0xbe1b('0x4d')],{});db['FaxTransferReport'][_0xbe1b('0x143')](db['FaxAccount'],{'foreignKey':_0xbe1b('0x1db'),'as':_0xbe1b('0x1d2')});db[_0xbe1b('0x1dc')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'foreignKey':_0xbe1b('0x1d3'),'as':_0xbe1b('0x1d4')});db['FaxTransferReport']['belongsTo'](db[_0xbe1b('0x11')],{'foreignKey':_0xbe1b('0x1d5'),'as':'ToAgent'});db[_0xbe1b('0x1dc')][_0xbe1b('0x143')](db[_0xbe1b('0x51')],{'foreignKey':_0xbe1b('0x1dd'),'as':_0xbe1b('0x1d9')});db['FaxTransferReport']['belongsTo'](db[_0xbe1b('0x4a')],{'foreignKey':_0xbe1b('0x1de'),'as':_0xbe1b('0x1d7')});db[_0xbe1b('0x1df')][_0xbe1b('0x143')](db[_0xbe1b('0x5f')],{});db[_0xbe1b('0x1df')][_0xbe1b('0x143')](db[_0xbe1b('0x5d')],{});db[_0xbe1b('0x1df')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0xbe1b('0x1e0'),'as':_0xbe1b('0x1d2')});db[_0xbe1b('0x1df')][_0xbe1b('0x143')](db['User'],{'foreignKey':_0xbe1b('0x1d3'),'as':_0xbe1b('0x1d4')});db[_0xbe1b('0x1df')]['belongsTo'](db[_0xbe1b('0x11')],{'foreignKey':_0xbe1b('0x1d5'),'as':_0xbe1b('0x1e1')});db['OpenchannelTransferReport'][_0xbe1b('0x143')](db[_0xbe1b('0x61')],{'foreignKey':_0xbe1b('0x1e2'),'as':_0xbe1b('0x1d9')});db['OpenchannelTransferReport'][_0xbe1b('0x143')](db[_0xbe1b('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':_0xbe1b('0x1d7')});db[_0xbe1b('0xf1')][_0xbe1b('0x143')](db[_0xbe1b('0x57')],{});db['SmsTransferReport']['belongsTo'](db[_0xbe1b('0x179')],{});db[_0xbe1b('0xf1')][_0xbe1b('0x143')](db[_0xbe1b('0x54')],{'foreignKey':_0xbe1b('0x1e3'),'as':_0xbe1b('0x1d2')});db[_0xbe1b('0xf1')]['belongsTo'](db[_0xbe1b('0x11')],{'foreignKey':_0xbe1b('0x1d3'),'as':_0xbe1b('0x1d4')});db['SmsTransferReport'][_0xbe1b('0x143')](db['User'],{'foreignKey':_0xbe1b('0x1d5'),'as':_0xbe1b('0x1e1')});db[_0xbe1b('0xf1')][_0xbe1b('0x143')](db['SmsQueue'],{'foreignKey':_0xbe1b('0x1e4'),'as':_0xbe1b('0x1d9')});db[_0xbe1b('0xf1')][_0xbe1b('0x143')](db[_0xbe1b('0x54')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0xbe1b('0x7d')],{'as':_0xbe1b('0x171'),'foreignKey':'ListId','onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x12f')][_0xbe1b('0x10e')](db['CmCustomField'],{'as':_0xbe1b('0x1e5'),'foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0x12f')][_0xbe1b('0x10e')](db[_0xbe1b('0x157')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0x12f')][_0xbe1b('0x10e')](db[_0xbe1b('0x71')],{'as':_0xbe1b('0x1cf'),'foreignKey':'ListId'});db[_0xbe1b('0x12f')]['hasMany'](db['CmHopperHistory'],{'as':_0xbe1b('0x110'),'foreignKey':'ListId'});db[_0xbe1b('0x12f')][_0xbe1b('0x10e')](db[_0xbe1b('0x75')],{'as':_0xbe1b('0x75'),'foreignKey':_0xbe1b('0x161')});db['CmList'][_0xbe1b('0x119')](db[_0xbe1b('0x1b')],{'as':_0xbe1b('0x1e6'),'through':_0xbe1b('0x1e7')});db['CmList']['belongsToMany'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x11e')});db[_0xbe1b('0xf4')][_0xbe1b('0x10e')](db[_0xbe1b('0x18')],{'as':_0xbe1b('0x19f'),'onDelete':'cascade'});db[_0xbe1b('0xf4')][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x107')});db[_0xbe1b('0xf4')][_0xbe1b('0x119')](db[_0xbe1b('0xe4')],{'through':_0xbe1b('0x105'),'as':_0xbe1b('0x14d')});db[_0xbe1b('0xf6')][_0xbe1b('0x10e')](db['User'],{'as':'Users','foreignKey':_0xbe1b('0x1e8')});db[_0xbe1b('0xf6')]['hasMany'](db['UserProfileSection'],{'as':_0xbe1b('0x1e9'),'foreignKey':'userProfileId','onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0xf8')][_0xbe1b('0x10e')](db['UserProfileResource'],{'as':_0xbe1b('0x1ea'),'foreignKey':'sectionId','onDelete':'cascade'});db[_0xbe1b('0x1eb')][_0xbe1b('0x10e')](db[_0xbe1b('0x7d')],{'as':_0xbe1b('0x171'),'foreignKey':_0xbe1b('0x1ec'),'onDelete':_0xbe1b('0x10b')});db[_0xbe1b('0x1eb')][_0xbe1b('0x10e')](db[_0xbe1b('0x7b')],{'as':'Answers','foreignKey':_0xbe1b('0x1ec')});db[_0xbe1b('0x1eb')]['hasMany'](db[_0xbe1b('0xfd')],{'as':_0xbe1b('0x151'),'foreignKey':'WhatsappAccountId'});db[_0xbe1b('0x1eb')]['hasMany'](db[_0xbe1b('0x115')],{'as':_0xbe1b('0x15f')});db[_0xbe1b('0x1eb')][_0xbe1b('0x10e')](db['WhatsappApplication'],{'as':_0xbe1b('0x13a')});db[_0xbe1b('0x1eb')][_0xbe1b('0x143')](db[_0xbe1b('0x12f')],{'as':'List','foreignKey':'ListId'});db[_0xbe1b('0x1eb')]['belongsTo'](db[_0xbe1b('0x81')],{'as':_0xbe1b('0x149'),'foreignKey':_0xbe1b('0x14a')});db['WhatsappAccount'][_0xbe1b('0x119')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x136')});db[_0xbe1b('0x1ed')]['belongsTo'](db[_0xbe1b('0x11')],{'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x1ed')][_0xbe1b('0x143')](db[_0xbe1b('0x12d')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xbe1b('0x143')](db['WhatsappAccount'],{'onDelete':_0xbe1b('0x15c')});db['WhatsappApplication'][_0xbe1b('0x143')](db[_0xbe1b('0x80')],{'onDelete':_0xbe1b('0x15c'),'foreignKey':_0xbe1b('0x148')});db[_0xbe1b('0x1ed')][_0xbe1b('0x143')](db['Tag'],{'onDelete':_0xbe1b('0x15c'),'foreignKey':_0xbe1b('0x16e')});db['WhatsappInteraction'][_0xbe1b('0x10e')](db[_0xbe1b('0xfd')],{'as':_0xbe1b('0x151'),'onDelete':_0xbe1b('0x10b'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction']['belongsTo'](db[_0xbe1b('0x1eb')],{'as':_0xbe1b('0x165'),'foreignKey':'WhatsappAccountId'});db[_0xbe1b('0x115')]['belongsTo'](db[_0xbe1b('0x157')],{'as':'Contact','foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0x115')]['belongsTo'](db['User'],{'as':_0xbe1b('0x166'),'foreignKey':_0xbe1b('0x10d')});db[_0xbe1b('0x115')][_0xbe1b('0x119')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0xbe1b('0x168')});db['WhatsappInteraction'][_0xbe1b('0x119')](db[_0xbe1b('0x8a')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db['User'],{'as':_0xbe1b('0x16a'),'through':_0xbe1b('0x125'),'foreignKey':_0xbe1b('0x1ee')});db[_0xbe1b('0xfd')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x11')});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xbe1b('0x10b'),'as':_0xbe1b('0x158')});db['WhatsappMessage']['belongsTo'](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0xbe1b('0x175'),'foreignKey':'WhatsappInteractionId'});db[_0xbe1b('0xfd')]['belongsTo'](db[_0xbe1b('0x1eb')],{'as':_0xbe1b('0x165'),'foreignKey':_0xbe1b('0x1ec')});db[_0xbe1b('0xff')][_0xbe1b('0x143')](db[_0xbe1b('0x1eb')],{});db[_0xbe1b('0xff')]['belongsTo'](db[_0xbe1b('0x12f')],{'as':_0xbe1b('0x160'),'foreignKey':_0xbe1b('0x161')});db[_0xbe1b('0xff')][_0xbe1b('0x143')](db[_0xbe1b('0x157')],{'as':_0xbe1b('0x158'),'foreignKey':_0xbe1b('0x159')});db[_0xbe1b('0xff')]['belongsTo'](db[_0xbe1b('0x115')],{});db[_0xbe1b('0xff')][_0xbe1b('0x143')](db['WhatsappQueue'],{});db[_0xbe1b('0xff')][_0xbe1b('0x143')](db['WhatsappMessage'],{});db[_0xbe1b('0xff')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{});db[_0xbe1b('0x101')][_0xbe1b('0x143')](db[_0xbe1b('0xfd')],{});db[_0xbe1b('0x101')][_0xbe1b('0x143')](db[_0xbe1b('0x115')],{});db[_0xbe1b('0x101')][_0xbe1b('0x143')](db[_0xbe1b('0x1eb')],{'foreignKey':_0xbe1b('0x1ef'),'as':_0xbe1b('0x1d2')});db['WhatsappTransferReport'][_0xbe1b('0x143')](db[_0xbe1b('0x1eb')],{'foreignKey':_0xbe1b('0x1f0'),'as':_0xbe1b('0x1d7')});db['WhatsappTransferReport'][_0xbe1b('0x143')](db[_0xbe1b('0x12d')],{'foreignKey':'ToQueueId','as':_0xbe1b('0x1d9')});db[_0xbe1b('0x101')][_0xbe1b('0x143')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xbe1b('0x101')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xbe1b('0x12d')]['belongsToMany'](db[_0xbe1b('0x11')],{'as':_0xbe1b('0x14c'),'through':_0xbe1b('0x37'),'foreignKey':_0xbe1b('0x1f1')});db[_0xbe1b('0x12d')][_0xbe1b('0x119')](db['Team'],{'through':_0xbe1b('0x1cd'),'as':'Teams'});db[_0xbe1b('0x10c')][_0xbe1b('0x143')](db[_0xbe1b('0x11')],{'as':'user','foreignKey':_0xbe1b('0x10d'),'onDelete':'cascade','hooks':!![]});db[_0xbe1b('0x15b')][_0xbe1b('0x10a')](db['Dynamics365Account'],{'as':_0xbe1b('0xc3'),'onDelete':_0xbe1b('0x15c')});db[_0xbe1b('0x15b')][_0xbe1b('0x10a')](db[_0xbe1b('0x38')],{'as':_0xbe1b('0x15d'),'onDelete':'restrict'});db[_0xbe1b('0x15b')][_0xbe1b('0x10a')](db['MailServerOut'],{'as':_0xbe1b('0x1f2'),'onDelete':'restrict'});module[_0xbe1b('0x1f3')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xf71e=['FaxMessage','FaxInteractionId','fax_interaction_has_tags','ThroughTags','Users','user_has_fax_interactions','team_has_fax_queues','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','ChatApplication','ChatMessage','Agent','Queue','ChatQueueId','ChatInteractionId','user_has_chat_interactions','ChatGroupId','chat_group_has_users','Website','CmCompany','CompanyId','Phones','HopperHistories','OpenchannelInteractions','Company','cm_contact_has_tags','CmHopperId','CmHopper','OwnerId','CampaignId','All','AutomationAllId','Automation','Any','OneAny','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','chat_interaction_has_tags','ItemTypeId','CmHopperAdditionalPhone','Hopper','AllConditions','AllCondition','Trigger','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','SubjectId','Descriptions','DescriptionId','Subject','Description','Field','FieldId','Configurations','SugarcrmConfiguration','Subjects','VariableId','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskField','FreshsalesConfiguration','FreshsalesField','ChatQueueReport','FromId','SessionId','ProjectId','SquareProject','FaxQueues','team_has_whatsapp_queues','VoicePrefixes','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','HopperHistory','Queues','userProfileId','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappMessage','user_has_whatsapp_accounts','WhatsappApplication','WhatsappQueue','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','sequelize','determine','defaultsDeep','xC@LL1234','127.0.0.1','mysql','name','utf8_general_ci','sequelizeHistory','motion2','xcall','utf8mb4','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../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','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','VoiceExtension','Extensions','CmHopperFinal','HopperFinals','ChatInteractions','SmsInteractions','FaxInteraction','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','UserProfile','Groups','Contacts','cm_user_has_contacts','belongsToMany','Lists','cm_user_has_lists','Team','user_has_teams','FaxInteractions','user_has_sms_interactions','VoiceQueues','MailQueues','ChatQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccount','SmsAccounts','user_has_square_projects','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','ScreenRecording','VoiceMailMessage','Messages','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','Items','FaxAccountId','Exntensions'];(function(_0x126c14,_0x4790a8){var _0x5c53dc=function(_0x64c949){while(--_0x64c949){_0x126c14['push'](_0x126c14['shift']());}};_0x5c53dc(++_0x4790a8);}(_0xf71e,0x8c));var _0xef71=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xf71e[_0x3e112d];return _0x531c31;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xef71('0x0'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0xef71('0x1')]();config['sequelize']=_[_0xef71('0x2')](config[_0xef71('0x0')],{'database':'motion2','username':'xcall','password':_0xef71('0x3'),'options':{'host':_0xef71('0x4'),'port':0xcea,'dialect':_0xef71('0x5'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xef71('0x6')](),'define':{'charset':'utf8','collate':_0xef71('0x7')}}});config[_0xef71('0x8')]=_[_0xef71('0x2')](config[_0xef71('0x8')],{'database':_0xef71('0x9'),'username':_0xef71('0xa'),'password':_0xef71('0x3'),'options':{'host':_0xef71('0x4'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xef71('0xb')},'logging':![],'timezone':timezone[_0xef71('0x6')](),'define':{'charset':'utf8','collate':_0xef71('0x7')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xef71('0x0')][_0xef71('0xc')],config['sequelize'][_0xef71('0xd')],config[_0xef71('0x0')][_0xef71('0xe')],config[_0xef71('0x0')][_0xef71('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xef71('0x8')][_0xef71('0xc')],config[_0xef71('0x8')]['username'],config['sequelizeHistory'][_0xef71('0xe')],config['sequelizeHistory']['options'])};db['User']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x11'));db[_0xef71('0x12')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x13'));db[_0xef71('0x14')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x15'));db['VoiceExtension']=db['sequelize'][_0xef71('0x10')](_0xef71('0x16'));db['VoiceMusicOnHold']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x17'));db[_0xef71('0x18')]=db['sequelize']['import'](_0xef71('0x19'));db[_0xef71('0x1a')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db['sequelize'][_0xef71('0x10')](_0xef71('0x1b'));db[_0xef71('0x1c')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x1d'));db['VoiceMailMessage']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x1e'));db[_0xef71('0x1f')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x20'));db['VoiceDialReport']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x21'));db[_0xef71('0x22')]=db[_0xef71('0x0')]['import'](_0xef71('0x23'));db[_0xef71('0x24')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xef71('0x25')]=db['sequelize'][_0xef71('0x10')]('../api/memberReport/memberReport.model');db[_0xef71('0x26')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x27'));db[_0xef71('0x28')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x29'));db[_0xef71('0x2a')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x2b'));db[_0xef71('0x2c')]=db[_0xef71('0x0')]['import'](_0xef71('0x2d'));db[_0xef71('0x2e')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x2f'));db[_0xef71('0x30')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x31'));db[_0xef71('0x32')]=db[_0xef71('0x0')]['import'](_0xef71('0x33'));db['UserSmsQueue']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x34'));db[_0xef71('0x35')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xef71('0x36')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x37'));db[_0xef71('0x38')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x39'));db['MailServerOut']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x3a'));db[_0xef71('0x3b')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x3c'));db[_0xef71('0x3d')]=db[_0xef71('0x0')]['import'](_0xef71('0x3e'));db[_0xef71('0x3f')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x40'));db[_0xef71('0x41')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/mailInteraction/mailInteraction.model');db[_0xef71('0x42')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x43'));db[_0xef71('0x44')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x45'));db[_0xef71('0x46')]=db[_0xef71('0x0')]['import'](_0xef71('0x47'));db[_0xef71('0x48')]=db[_0xef71('0x0')]['import'](_0xef71('0x49'));db[_0xef71('0x4a')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x4b'));db['FaxAccount']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x4c'));db[_0xef71('0x4d')]=db['sequelize']['import'](_0xef71('0x4e'));db['FaxInteraction']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x4f'));db['FaxMessage']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x50'));db[_0xef71('0x51')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x52'));db[_0xef71('0x53')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x54'));db['SmsAccount']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x55'));db[_0xef71('0x56')]=db[_0xef71('0x0')]['import'](_0xef71('0x57'));db[_0xef71('0x58')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x59'));db['SmsMessage']=db['sequelize'][_0xef71('0x10')](_0xef71('0x5a'));db[_0xef71('0x5b')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x5c'));db['OpenchannelAccount']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x5d'));db['OpenchannelApplication']=db['sequelize'][_0xef71('0x10')](_0xef71('0x5e'));db[_0xef71('0x5f')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x60'));db[_0xef71('0x61')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x62'));db[_0xef71('0x63')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x64'));db[_0xef71('0x65')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/chatWebsite/chatWebsite.model');db[_0xef71('0x66')]=db[_0xef71('0x0')]['import'](_0xef71('0x67'));db['ChatApplication']=db['sequelize']['import'](_0xef71('0x68'));db[_0xef71('0x69')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x6a'));db['ChatOfflineMessage']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x6b'));db[_0xef71('0x6c')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x6d'));db[_0xef71('0x6e')]=db[_0xef71('0x0')]['import']('../api/chatGroup/chatGroup.model');db[_0xef71('0x6f')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db['sequelize'][_0xef71('0x10')](_0xef71('0x70'));db[_0xef71('0x71')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x72'));db['CmHopper']=db['sequelize'][_0xef71('0x10')](_0xef71('0x73'));db[_0xef71('0x74')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x75'));db['CmHopperFinal']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x76'));db[_0xef71('0x77')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x78'));db[_0xef71('0x79')]=db['sequelize']['import'](_0xef71('0x7a'));db[_0xef71('0x7b')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x7c'));db[_0xef71('0x7d')]=db['sequelize'][_0xef71('0x10')]('../api/action/action.model');db['Automation']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x7e'));db[_0xef71('0x7f')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x80'));db[_0xef71('0x81')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x82'));db[_0xef71('0x83')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x84'));db['Interval']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x85'));db[_0xef71('0x86')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x87'));db[_0xef71('0x88')]=db['sequelize'][_0xef71('0x10')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xef71('0x0')][_0xef71('0x10')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xef71('0x89')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x8a'));db[_0xef71('0x8b')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x8c'));db['Tag']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x8d'));db[_0xef71('0x8e')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x8f'));db[_0xef71('0x90')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x91'));db['CmHopperAdditionalPhone']=db['sequelize'][_0xef71('0x10')](_0xef71('0x92'));db['Template']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x93'));db['Trigger']=db[_0xef71('0x0')]['import'](_0xef71('0x94'));db[_0xef71('0x95')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x96'));db[_0xef71('0x97')]=db[_0xef71('0x0')]['import'](_0xef71('0x98'));db['IntegrationReport']=db['sequelize'][_0xef71('0x10')](_0xef71('0x99'));db[_0xef71('0x9a')]=db['sequelize']['import'](_0xef71('0x9b'));db[_0xef71('0x9c')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x9d'));db[_0xef71('0x9e')]=db[_0xef71('0x0')]['import'](_0xef71('0x9f'));db[_0xef71('0xa0')]=db['sequelize']['import'](_0xef71('0xa1'));db[_0xef71('0xa2')]=db['sequelize'][_0xef71('0x10')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xef71('0xa3')]=db['sequelize']['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0xef71('0xa4')]=db['sequelize'][_0xef71('0x10')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xef71('0xa5')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xef71('0xa6')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xa7'));db[_0xef71('0xa8')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xa9'));db['SugarcrmConfiguration']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xaa'));db[_0xef71('0xab')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xef71('0xac')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/intDeskAccount/intDeskAccount.model');db[_0xef71('0xad')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xae'));db[_0xef71('0xaf')]=db['sequelize'][_0xef71('0x10')](_0xef71('0xb0'));db[_0xef71('0xb1')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xb2'));db['ZohoConfiguration']=db[_0xef71('0x0')][_0xef71('0x10')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xef71('0xb3')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xef71('0x0')]['import'](_0xef71('0xb4'));db[_0xef71('0xb5')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xb6'));db[_0xef71('0xb7')]=db['sequelize'][_0xef71('0x10')](_0xef71('0xb8'));db[_0xef71('0xb9')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xba'));db[_0xef71('0xbb')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xbc'));db['FreshdeskField']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xbd'));db[_0xef71('0xbe')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xef71('0xbf')]=db['sequelize'][_0xef71('0x10')](_0xef71('0xc0'));db[_0xef71('0xc1')]=db[_0xef71('0x0')]['import'](_0xef71('0xc2'));db[_0xef71('0xc3')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xc4'));db[_0xef71('0xc5')]=db['sequelize'][_0xef71('0x10')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xef71('0xc6')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xc7'));db[_0xef71('0xc8')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xc9'));db[_0xef71('0xca')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xef71('0xcb')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xcc'));db[_0xef71('0xcd')]=db[_0xef71('0x0')]['import'](_0xef71('0xce'));db['FreshsalesConfiguration']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xcf'));db['FreshsalesField']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xd0'));db[_0xef71('0x97')]=db[_0xef71('0x0')]['import'](_0xef71('0x98'));db['Network']=db[_0xef71('0x0')]['import'](_0xef71('0xd1'));db['ChatQueueReport']=db['sequelize'][_0xef71('0x10')]('../api/chatQueueReport/chatQueueReport.model');db[_0xef71('0xd2')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xd3'));db[_0xef71('0xd4')]=db[_0xef71('0x0')][_0xef71('0x10')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xef71('0xd5')]=db['sequelize'][_0xef71('0x10')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xef71('0xd6')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xd7'));db[_0xef71('0xd8')]=db[_0xef71('0x0')]['import'](_0xef71('0xd9'));db[_0xef71('0xda')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xdb'));db[_0xef71('0xdc')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xdd'));db[_0xef71('0xde')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xdf'));db[_0xef71('0xe0')]=db[_0xef71('0x0')]['import'](_0xef71('0xe1'));db[_0xef71('0xe2')]=db['sequelize']['import'](_0xef71('0xe3'));db['SquareProject']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xe4'));db['SquareRecording']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xe5'));db[_0xef71('0xe6')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xe7'));db['Team']=db[_0xef71('0x0')]['import'](_0xef71('0xe8'));db[_0xef71('0xe9')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xea'));db[_0xef71('0xeb')]=db['sequelize']['import'](_0xef71('0xec'));db['Migration']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xed'));db[_0xef71('0xee')]=db['sequelize'][_0xef71('0x10')](_0xef71('0xef'));db['Plugin']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xf0'));db[_0xef71('0xf1')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xf2'));db['ChatTransferReport']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xf3'));db[_0xef71('0xf4')]=db[_0xef71('0x0')]['import'](_0xef71('0xf5'));db['OpenchannelTransferReport']=db['sequelize']['import'](_0xef71('0xf6'));db['SmsTransferReport']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xf7'));db[_0xef71('0xf8')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xf9'));db[_0xef71('0xfa')]=db[_0xef71('0x0')]['import'](_0xef71('0xfb'));db['UserProfile']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0xfc'));db[_0xef71('0xfd')]=db['sequelize']['import'](_0xef71('0xfe'));db['UserProfileResource']=db[_0xef71('0x0')][_0xef71('0x10')]('../api/userProfileResource/userProfileResource.model');db[_0xef71('0xff')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x100'));db[_0xef71('0x101')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x102'));db['WhatsappApplication']=db[_0xef71('0x0')][_0xef71('0x10')]('../api/whatsappApplication/whatsappApplication.model');db[_0xef71('0x103')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x104'));db['WhatsappMessage']=db['sequelize']['import'](_0xef71('0x105'));db[_0xef71('0x106')]=db[_0xef71('0x0')]['import'](_0xef71('0x107'));db[_0xef71('0x108')]=db['sequelize'][_0xef71('0x10')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x109'));db[_0xef71('0x10a')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x10b'));db[_0xef71('0x10c')]=db[_0xef71('0x0')][_0xef71('0x10')](_0xef71('0x10d'));db[_0xef71('0x10e')]=db[_0xef71('0x0')]['import'](_0xef71('0x10f'));db[_0xef71('0x110')]=db['sequelize']['import'](_0xef71('0x111'));db[_0xef71('0x112')]=db['sequelize'][_0xef71('0x10')](_0xef71('0x113'));db[_0xef71('0x114')][_0xef71('0x115')](db[_0xef71('0x1c')],{'as':_0xef71('0x1c'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x117')});db[_0xef71('0x114')]['hasOne'](db[_0xef71('0x112')],{'as':'userSetting','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x117')});db['User'][_0xef71('0x118')](db[_0xef71('0x1a')],{'as':'Recordings','foreignKey':_0xef71('0x117')});db[_0xef71('0x114')][_0xef71('0x118')](db['UserVoiceQueueRt'],{'as':_0xef71('0x119'),'foreignKey':_0xef71('0x117')});db[_0xef71('0x114')]['hasMany'](db[_0xef71('0x11a')],{'as':_0xef71('0x11b'),'onDelete':_0xef71('0x116'),'hooks':!![]});db[_0xef71('0x114')][_0xef71('0x118')](db[_0xef71('0x11c')],{'as':_0xef71('0x11d'),'foreignKey':_0xef71('0x117')});db[_0xef71('0x114')][_0xef71('0x118')](db[_0xef71('0x77')],{'as':'HopperHistory','foreignKey':_0xef71('0x117')});db[_0xef71('0x114')][_0xef71('0x118')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xef71('0x117')});db[_0xef71('0x114')][_0xef71('0x118')](db[_0xef71('0x5f')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0xef71('0x114')][_0xef71('0x118')](db[_0xef71('0x69')],{'as':_0xef71('0x11e'),'foreignKey':'UserId'});db[_0xef71('0x114')]['hasMany'](db['SmsInteraction'],{'as':_0xef71('0x11f'),'foreignKey':'UserId'});db[_0xef71('0x114')]['hasMany'](db[_0xef71('0x120')],{'as':'FaxInteractions','foreignKey':_0xef71('0x117')});db[_0xef71('0x114')][_0xef71('0x118')](db[_0xef71('0x41')],{'as':_0xef71('0x121'),'foreignKey':_0xef71('0x117')});db['User'][_0xef71('0x118')](db[_0xef71('0x103')],{'as':_0xef71('0x122'),'foreignKey':'UserId'});db[_0xef71('0x114')][_0xef71('0x118')](db[_0xef71('0xff')],{'as':_0xef71('0x123'),'foreignKey':'SenderId'});db[_0xef71('0x114')][_0xef71('0x124')](db[_0xef71('0x125')],{'as':_0xef71('0x125'),'foreignKey':'userProfileId'});db[_0xef71('0x114')]['belongsToMany'](db[_0xef71('0x6e')],{'as':_0xef71('0x126'),'through':'chat_group_has_users'});db[_0xef71('0x114')]['belongsToMany'](db[_0xef71('0x71')],{'as':_0xef71('0x127'),'through':_0xef71('0x128')});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0xf8')],{'as':_0xef71('0x12a'),'through':_0xef71('0x12b')});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x12c')],{'through':_0xef71('0x12d')});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x41')],{'as':_0xef71('0x121'),'through':'user_has_mail_interactions'});db['User'][_0xef71('0x129')](db[_0xef71('0x69')],{'as':_0xef71('0x11e'),'through':'user_has_chat_interactions'});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x120')],{'as':_0xef71('0x12e'),'through':'user_has_fax_interactions'});db['User'][_0xef71('0x129')](db['SmsInteraction'],{'as':_0xef71('0x11f'),'through':_0xef71('0x12f')});db[_0xef71('0x114')]['belongsToMany'](db[_0xef71('0x5f')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db['User'][_0xef71('0x129')](db[_0xef71('0x103')],{'as':_0xef71('0x122'),'through':'user_has_whatsapp_interactions'});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x18')],{'as':_0xef71('0x130'),'through':_0xef71('0x2c'),'required':![]});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0xfa')],{'as':'VoicePrefixes','through':_0xef71('0x110'),'required':![]});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x3d')],{'as':_0xef71('0x131'),'through':_0xef71('0x30'),'required':![]});db['User'][_0xef71('0x129')](db[_0xef71('0x6c')],{'as':_0xef71('0x132'),'through':_0xef71('0x2e'),'required':![],'hooks':!![]});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x51')],{'as':'FaxQueues','through':_0xef71('0x32'),'required':![]});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x5b')],{'as':_0xef71('0x133'),'through':_0xef71('0x134'),'required':![]});db['User'][_0xef71('0x129')](db[_0xef71('0x63')],{'as':_0xef71('0x135'),'through':_0xef71('0x35'),'required':![]});db['User'][_0xef71('0x129')](db['WhatsappQueue'],{'as':_0xef71('0x136'),'through':'UserWhatsappQueue','required':![]});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0xf8')],{'through':'cm_user_has_lists'});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x65')],{'as':_0xef71('0x137'),'through':_0xef71('0x138')});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x139')],{'as':_0xef71('0x13a'),'through':_0xef71('0x13b')});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x3b')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0xef71('0x114')][_0xef71('0x129')](db[_0xef71('0x13c')],{'as':_0xef71('0x13d'),'through':'user_has_openchannel_accounts'});db['User'][_0xef71('0x129')](db[_0xef71('0x13e')],{'as':_0xef71('0x13f'),'through':'user_has_sms_accounts'});db['User'][_0xef71('0x129')](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xef71('0x114')][_0xef71('0x129')](db['SquareProject'],{'as':'SquareProjects','through':_0xef71('0x140')});db[_0xef71('0x12')][_0xef71('0x118')](db[_0xef71('0x11a')],{'as':'SpiedAgents','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x141')});db[_0xef71('0x14')]['hasMany'](db[_0xef71('0x11a')],{'onDelete':'cascade'});db['VoiceExtension']['hasMany'](db[_0xef71('0x11a')],{'as':_0xef71('0x142'),'onDelete':'cascade'});db[_0xef71('0x143')][_0xef71('0x129')](db[_0xef71('0x8b')],{'as':_0xef71('0x144'),'through':_0xef71('0x145')});db[_0xef71('0x18')]['hasMany'](db[_0xef71('0x2a')],{'as':_0xef71('0x146'),'foreignKey':_0xef71('0x147')});db[_0xef71('0x18')][_0xef71('0x118')](db['CmHopper'],{'as':_0xef71('0x148'),'foreignKey':_0xef71('0x147')});db[_0xef71('0x18')]['hasMany'](db[_0xef71('0x11c')],{'as':_0xef71('0x11d'),'foreignKey':_0xef71('0x147')});db[_0xef71('0x18')][_0xef71('0x118')](db[_0xef71('0x77')],{'as':'HopperHistories','foreignKey':_0xef71('0x147')});db[_0xef71('0x18')]['hasMany'](db[_0xef71('0x79')],{'as':_0xef71('0x79'),'foreignKey':_0xef71('0x147')});db[_0xef71('0x18')][_0xef71('0x118')](db[_0xef71('0x74')],{'as':_0xef71('0x149'),'foreignKey':_0xef71('0x147')});db['VoiceQueue'][_0xef71('0x118')](db[_0xef71('0xd6')],{'as':_0xef71('0x14a'),'foreignKey':_0xef71('0x147')});db[_0xef71('0x18')][_0xef71('0x124')](db['Trunk'],{'as':_0xef71('0x26'),'foreignKey':_0xef71('0x14b')});db[_0xef71('0x18')][_0xef71('0x124')](db[_0xef71('0x26')],{'as':_0xef71('0x14c'),'foreignKey':_0xef71('0x14d')});db['VoiceQueue'][_0xef71('0x124')](db[_0xef71('0x14e')],{'as':_0xef71('0x14e'),'foreignKey':_0xef71('0x14f')});db['VoiceQueue'][_0xef71('0x124')](db['Pause'],{'as':_0xef71('0x150'),'foreignKey':_0xef71('0x151')});db[_0xef71('0x18')][_0xef71('0x129')](db['CmList'],{'as':_0xef71('0x12a'),'through':_0xef71('0x152')});db[_0xef71('0x18')][_0xef71('0x129')](db['User'],{'as':_0xef71('0x153'),'through':_0xef71('0x2c')});db[_0xef71('0x18')][_0xef71('0x129')](db[_0xef71('0x12c')],{'as':_0xef71('0x154'),'through':_0xef71('0x10c')});db[_0xef71('0x18')][_0xef71('0x129')](db['CmList'],{'as':_0xef71('0x155'),'through':'voice_queues_has_cm_blacklists'});db[_0xef71('0x1a')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x114'),'foreignKey':'UserId'});db[_0xef71('0x156')]['belongsTo'](db[_0xef71('0x114')],{'as':_0xef71('0x114'),'foreignKey':_0xef71('0x117')});db[_0xef71('0x1c')][_0xef71('0x118')](db[_0xef71('0x157')],{'as':_0xef71('0x158'),'onDelete':_0xef71('0x116'),'foreignKey':'mailboxuser','sourceKey':_0xef71('0x159')});db[_0xef71('0x157')][_0xef71('0x124')](db[_0xef71('0x1c')],{'foreignKey':'mailboxuser','targetKey':_0xef71('0x159')});db[_0xef71('0x1f')][_0xef71('0x118')](db['VoiceQueueReport'],{'as':_0xef71('0x15a'),'foreignKey':_0xef71('0x15b'),'constraints':![]});db[_0xef71('0x1f')][_0xef71('0x118')](db[_0xef71('0x22')],{'as':_0xef71('0x15c'),'foreignKey':_0xef71('0x15b'),'constraints':![]});db[_0xef71('0x1f')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x114'),'foreignKey':_0xef71('0x117')});db[_0xef71('0x1f')][_0xef71('0x124')](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':_0xef71('0x15e')});db['MailServerIn'][_0xef71('0x124')](db[_0xef71('0x3b')],{'as':'MailAccount','foreignKey':_0xef71('0x15f')});db[_0xef71('0x38')][_0xef71('0x124')](db[_0xef71('0x10a')],{'as':'CloudProvider','foreignKey':_0xef71('0x160'),'onDelete':_0xef71('0x161')});db['MailServerOut'][_0xef71('0x124')](db[_0xef71('0x3b')],{'as':_0xef71('0x3b'),'foreignKey':_0xef71('0x15f')});db[_0xef71('0x162')][_0xef71('0x124')](db[_0xef71('0x10a')],{'as':_0xef71('0x10a'),'foreignKey':_0xef71('0x160'),'onDelete':_0xef71('0x161')});db[_0xef71('0x3b')][_0xef71('0x115')](db[_0xef71('0x38')],{'as':_0xef71('0x163'),'onDelete':_0xef71('0x116')});db[_0xef71('0x3b')][_0xef71('0x115')](db[_0xef71('0x162')],{'as':_0xef71('0x164'),'onDelete':_0xef71('0x116')});db[_0xef71('0x3b')][_0xef71('0x118')](db[_0xef71('0x81')],{'as':_0xef71('0x165'),'foreignKey':_0xef71('0x15f'),'onDelete':'cascade'});db[_0xef71('0x3b')]['hasMany'](db[_0xef71('0x7f')],{'as':_0xef71('0x166'),'foreignKey':_0xef71('0x15f')});db[_0xef71('0x3b')][_0xef71('0x118')](db[_0xef71('0x42')],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0xef71('0x41')],{'as':_0xef71('0x167')});db['MailAccount'][_0xef71('0x118')](db[_0xef71('0x44')],{'as':_0xef71('0x142')});db['MailAccount'][_0xef71('0x124')](db['CmList'],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0x3b')]['belongsTo'](db['Template'],{'as':_0xef71('0x16a'),'foreignKey':_0xef71('0x16b')});db[_0xef71('0x3b')][_0xef71('0x124')](db[_0xef71('0x86')],{'as':_0xef71('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xef71('0x3b')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':_0xef71('0x30')});db[_0xef71('0x3d')][_0xef71('0x129')](db[_0xef71('0x12c')],{'through':_0xef71('0x16c'),'as':_0xef71('0x154')});db[_0xef71('0x41')][_0xef71('0x118')](db[_0xef71('0x42')],{'as':_0xef71('0x158'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x16d')});db[_0xef71('0x41')]['belongsTo'](db['MailAccount'],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x15f')});db[_0xef71('0x41')]['belongsTo'](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':'ContactId'});db['MailInteraction'][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x16f'),'foreignKey':_0xef71('0x117')});db[_0xef71('0x41')][_0xef71('0x129')](db[_0xef71('0x170')],{'through':_0xef71('0x171'),'as':_0xef71('0x172')});db[_0xef71('0x41')]['belongsToMany'](db[_0xef71('0x170')],{'through':_0xef71('0x171'),'as':'ThroughTags'});db[_0xef71('0x41')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':'Users','through':_0xef71('0x173'),'foreignKey':_0xef71('0x16d')});db[_0xef71('0x42')][_0xef71('0x118')](db[_0xef71('0xee')],{'as':_0xef71('0x174'),'onDelete':'cascade'});db[_0xef71('0x42')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':'User'});db[_0xef71('0x42')]['belongsTo'](db[_0xef71('0x71')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x15d')});db[_0xef71('0x42')][_0xef71('0x124')](db[_0xef71('0x41')],{'as':_0xef71('0x175'),'foreignKey':_0xef71('0x16d')});db[_0xef71('0x42')]['belongsTo'](db[_0xef71('0x3b')],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x15f')});db['MailMessage'][_0xef71('0x124')](db[_0xef71('0x65')],{'as':_0xef71('0x65'),'foreignKey':_0xef71('0x176')});db[_0xef71('0x42')][_0xef71('0x124')](db[_0xef71('0x177')],{'as':_0xef71('0x177'),'foreignKey':_0xef71('0x178')});db[_0xef71('0x44')][_0xef71('0x124')](db[_0xef71('0x114')],{'onDelete':_0xef71('0x161')});db[_0xef71('0x44')][_0xef71('0x124')](db['MailQueue'],{'onDelete':'restrict'});db[_0xef71('0x44')][_0xef71('0x124')](db[_0xef71('0x3b')],{'onDelete':_0xef71('0x161')});db['MailApplication'][_0xef71('0x124')](db[_0xef71('0x14e')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['MailApplication'][_0xef71('0x124')](db['Tag'],{'onDelete':_0xef71('0x161'),'foreignKey':_0xef71('0x179')});db[_0xef71('0x46')][_0xef71('0x124')](db['MailAccount'],{});db[_0xef71('0x46')]['belongsTo'](db[_0xef71('0xf8')],{'as':'List','foreignKey':_0xef71('0x169')});db[_0xef71('0x46')][_0xef71('0x124')](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0x46')][_0xef71('0x124')](db[_0xef71('0x41')],{});db[_0xef71('0x46')][_0xef71('0x124')](db[_0xef71('0x42')],{});db['MailQueueReport'][_0xef71('0x124')](db[_0xef71('0x114')],{});db[_0xef71('0x46')][_0xef71('0x124')](db[_0xef71('0x3d')],{});db[_0xef71('0x48')][_0xef71('0x118')](db['DashboardItem'],{'as':_0xef71('0x17a'),'onDelete':_0xef71('0x116')});db[_0xef71('0x139')][_0xef71('0x118')](db[_0xef71('0x81')],{'as':_0xef71('0x165'),'foreignKey':_0xef71('0x17b'),'onDelete':'cascade'});db[_0xef71('0x139')][_0xef71('0x118')](db[_0xef71('0x7f')],{'as':_0xef71('0x166'),'foreignKey':_0xef71('0x17b')});db[_0xef71('0x139')][_0xef71('0x118')](db['FaxInteraction'],{'as':'Interactions'});db['FaxAccount'][_0xef71('0x118')](db[_0xef71('0x4d')],{'as':_0xef71('0x142')});db[_0xef71('0x139')][_0xef71('0x118')](db['VoiceExtension'],{'as':_0xef71('0x17c'),'onDelete':_0xef71('0x116')});db[_0xef71('0x139')][_0xef71('0x118')](db[_0xef71('0x17d')],{'as':'Messages'});db[_0xef71('0x139')][_0xef71('0x124')](db[_0xef71('0x26')],{'as':_0xef71('0x26')});db[_0xef71('0x139')][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0x139')][_0xef71('0x124')](db[_0xef71('0x86')],{'as':_0xef71('0x150'),'foreignKey':_0xef71('0x151')});db[_0xef71('0x139')][_0xef71('0x129')](db['User'],{'as':_0xef71('0x153'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0xef71('0x124')](db[_0xef71('0x114')],{'onDelete':'restrict'});db[_0xef71('0x4d')]['belongsTo'](db[_0xef71('0x51')],{'onDelete':'restrict'});db['FaxApplication'][_0xef71('0x124')](db[_0xef71('0x139')],{'onDelete':_0xef71('0x161')});db[_0xef71('0x4d')][_0xef71('0x124')](db[_0xef71('0x170')],{'onDelete':_0xef71('0x161'),'foreignKey':_0xef71('0x179')});db[_0xef71('0x120')][_0xef71('0x118')](db[_0xef71('0x17d')],{'as':'Messages','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x17e')});db[_0xef71('0x120')][_0xef71('0x124')](db[_0xef71('0x139')],{'as':_0xef71('0x16e'),'foreignKey':'FaxAccountId'});db[_0xef71('0x120')][_0xef71('0x124')](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0x120')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x16f'),'foreignKey':_0xef71('0x117')});db['FaxInteraction'][_0xef71('0x129')](db[_0xef71('0x170')],{'through':_0xef71('0x17f'),'as':'Tags'});db[_0xef71('0x120')][_0xef71('0x129')](db[_0xef71('0x170')],{'through':_0xef71('0x17f'),'as':_0xef71('0x180')});db[_0xef71('0x120')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x181'),'through':_0xef71('0x182'),'foreignKey':'FaxInteractionId'});db[_0xef71('0x17d')][_0xef71('0x124')](db[_0xef71('0x114')],{'onDelete':_0xef71('0x116'),'as':'User'});db[_0xef71('0x17d')][_0xef71('0x124')](db[_0xef71('0x120')],{'as':_0xef71('0x175'),'foreignKey':_0xef71('0x17e')});db[_0xef71('0x17d')]['belongsTo'](db[_0xef71('0x71')],{'onDelete':'cascade','as':_0xef71('0x15d')});db[_0xef71('0x17d')][_0xef71('0x124')](db['Attachment'],{'as':_0xef71('0xee'),'foreignKey':'AttachmentId'});db[_0xef71('0x17d')][_0xef71('0x124')](db[_0xef71('0x139')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xef71('0x51')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':_0xef71('0x32')});db[_0xef71('0x51')][_0xef71('0x129')](db[_0xef71('0x12c')],{'through':_0xef71('0x183'),'as':_0xef71('0x154')});db['FaxQueueReport'][_0xef71('0x124')](db[_0xef71('0x139')],{});db[_0xef71('0x53')]['belongsTo'](db[_0xef71('0xf8')],{'as':'List','foreignKey':_0xef71('0x169')});db[_0xef71('0x53')][_0xef71('0x124')](db[_0xef71('0x71')],{'as':'Contact','foreignKey':_0xef71('0x15e')});db[_0xef71('0x53')][_0xef71('0x124')](db[_0xef71('0x120')],{});db[_0xef71('0x53')][_0xef71('0x124')](db[_0xef71('0x17d')],{});db[_0xef71('0x53')]['belongsTo'](db[_0xef71('0x114')],{});db[_0xef71('0x53')][_0xef71('0x124')](db[_0xef71('0x51')],{});db[_0xef71('0x13e')]['hasMany'](db[_0xef71('0x81')],{'as':_0xef71('0x165'),'foreignKey':_0xef71('0x184'),'onDelete':_0xef71('0x116')});db[_0xef71('0x13e')][_0xef71('0x118')](db[_0xef71('0x7f')],{'as':_0xef71('0x166'),'foreignKey':'SmsAccountId'});db[_0xef71('0x13e')][_0xef71('0x118')](db[_0xef71('0x185')],{'as':_0xef71('0x158'),'foreignKey':'SmsAccountId'});db[_0xef71('0x13e')][_0xef71('0x118')](db[_0xef71('0x58')],{'as':_0xef71('0x167')});db['SmsAccount'][_0xef71('0x118')](db[_0xef71('0x56')],{'as':_0xef71('0x142')});db['SmsAccount'][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0x13e')][_0xef71('0x124')](db[_0xef71('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xef71('0x151')});db[_0xef71('0x13e')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':_0xef71('0x186')});db[_0xef71('0x56')][_0xef71('0x124')](db[_0xef71('0x114')],{'onDelete':'restrict'});db[_0xef71('0x56')][_0xef71('0x124')](db[_0xef71('0x5b')],{'onDelete':_0xef71('0x161')});db[_0xef71('0x56')]['belongsTo'](db[_0xef71('0x13e')],{'onDelete':_0xef71('0x161')});db[_0xef71('0x56')]['belongsTo'](db[_0xef71('0x14e')],{'onDelete':_0xef71('0x161'),'foreignKey':'IntervalId'});db['SmsApplication'][_0xef71('0x124')](db['Tag'],{'onDelete':_0xef71('0x161'),'foreignKey':_0xef71('0x179')});db['SmsInteraction'][_0xef71('0x118')](db[_0xef71('0x185')],{'as':_0xef71('0x158'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x187')});db['SmsInteraction'][_0xef71('0x124')](db[_0xef71('0x13e')],{'as':'Account','foreignKey':_0xef71('0x184')});db[_0xef71('0x58')][_0xef71('0x124')](db['CmContact'],{'as':_0xef71('0x15d'),'foreignKey':'ContactId'});db[_0xef71('0x58')][_0xef71('0x124')](db['User'],{'as':_0xef71('0x16f'),'foreignKey':'UserId'});db[_0xef71('0x58')][_0xef71('0x129')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xef71('0x172')});db[_0xef71('0x58')]['belongsToMany'](db[_0xef71('0x170')],{'through':_0xef71('0x188'),'as':_0xef71('0x180')});db[_0xef71('0x58')]['belongsToMany'](db[_0xef71('0x114')],{'as':_0xef71('0x181'),'through':_0xef71('0x12f'),'foreignKey':'SmsInteractionId'});db[_0xef71('0x185')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':'User'});db[_0xef71('0x185')][_0xef71('0x124')](db[_0xef71('0x71')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x15d')});db['SmsMessage'][_0xef71('0x124')](db[_0xef71('0x58')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x175'),'foreignKey':_0xef71('0x187')});db[_0xef71('0x185')][_0xef71('0x124')](db[_0xef71('0x13e')],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x184')});db[_0xef71('0x5b')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':_0xef71('0x134'),'foreignKey':_0xef71('0x189')});db[_0xef71('0x5b')][_0xef71('0x129')](db['Team'],{'through':_0xef71('0x18a'),'as':_0xef71('0x154')});db['OpenchannelAccount']['hasMany'](db[_0xef71('0x81')],{'as':_0xef71('0x165'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0xef71('0x13c')][_0xef71('0x118')](db[_0xef71('0x7f')],{'as':_0xef71('0x166'),'foreignKey':_0xef71('0x18b')});db[_0xef71('0x13c')][_0xef71('0x118')](db['OpenchannelInteraction'],{'as':_0xef71('0x167'),'foreignKey':_0xef71('0x18b')});db[_0xef71('0x13c')]['hasMany'](db['OpenchannelMessage'],{'as':_0xef71('0x158'),'foreignKey':'OpenchannelAccountId'});db[_0xef71('0x13c')][_0xef71('0x118')](db[_0xef71('0x18c')],{'as':_0xef71('0x142'),'foreignKey':_0xef71('0x18b')});db[_0xef71('0x13c')][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0x13c')][_0xef71('0x124')](db[_0xef71('0x86')],{'as':_0xef71('0x150'),'foreignKey':_0xef71('0x151')});db[_0xef71('0x13c')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':'user_has_openchannel_accounts'});db[_0xef71('0x18c')][_0xef71('0x124')](db[_0xef71('0x114')],{'onDelete':_0xef71('0x161')});db[_0xef71('0x18c')][_0xef71('0x124')](db[_0xef71('0x63')],{'onDelete':'restrict','foreignKey':_0xef71('0x18d')});db[_0xef71('0x18c')][_0xef71('0x124')](db[_0xef71('0x13c')],{'onDelete':_0xef71('0x161'),'foreignKey':_0xef71('0x18b')});db[_0xef71('0x18c')]['belongsTo'](db['Interval'],{'onDelete':_0xef71('0x161'),'foreignKey':_0xef71('0x14f')});db['OpenchannelApplication'][_0xef71('0x124')](db[_0xef71('0x170')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xef71('0x5f')][_0xef71('0x118')](db[_0xef71('0x61')],{'as':_0xef71('0x158'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x18e')});db[_0xef71('0x5f')][_0xef71('0x124')](db['OpenchannelAccount'],{'as':_0xef71('0x16e'),'foreignKey':'OpenchannelAccountId'});db[_0xef71('0x5f')]['belongsTo'](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0x5f')][_0xef71('0x124')](db['User'],{'as':'Owner','foreignKey':_0xef71('0x117')});db[_0xef71('0x5f')]['belongsToMany'](db[_0xef71('0x170')],{'through':'openchannel_interaction_has_tags','as':_0xef71('0x172')});db['OpenchannelInteraction'][_0xef71('0x129')](db[_0xef71('0x170')],{'through':_0xef71('0x18f'),'as':_0xef71('0x180')});db[_0xef71('0x5f')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x181'),'through':_0xef71('0x190'),'foreignKey':_0xef71('0x18e')});db[_0xef71('0x61')][_0xef71('0x124')](db[_0xef71('0x114')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x114')});db[_0xef71('0x61')][_0xef71('0x124')](db[_0xef71('0x71')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x15d')});db[_0xef71('0x61')][_0xef71('0x124')](db[_0xef71('0x5f')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x175'),'foreignKey':_0xef71('0x18e')});db['OpenchannelMessage']['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0xef71('0x191')});db[_0xef71('0x61')][_0xef71('0x124')](db[_0xef71('0x13c')],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x18b')});db[_0xef71('0x63')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0xef71('0x63')][_0xef71('0x129')](db[_0xef71('0x12c')],{'through':'team_has_openchannel_queues','as':_0xef71('0x154')});db['ChatWebsite']['hasMany'](db[_0xef71('0x81')],{'as':_0xef71('0x165'),'foreignKey':_0xef71('0x176'),'onDelete':_0xef71('0x116')});db[_0xef71('0x65')]['hasMany'](db[_0xef71('0x7f')],{'as':_0xef71('0x166'),'foreignKey':'ChatWebsiteId'});db[_0xef71('0x65')][_0xef71('0x118')](db[_0xef71('0x6f')],{'as':'ProactiveActions'});db['ChatWebsite']['hasMany'](db[_0xef71('0x69')],{'as':'Interactions'});db[_0xef71('0x65')][_0xef71('0x118')](db[_0xef71('0x192')],{'as':_0xef71('0x142')});db[_0xef71('0x65')][_0xef71('0x118')](db[_0xef71('0x193')],{'as':'Messages'});db[_0xef71('0x65')][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0x65')][_0xef71('0x124')](db[_0xef71('0x14e')],{'as':'Interval','foreignKey':_0xef71('0x14f')});db[_0xef71('0x65')]['belongsTo'](db[_0xef71('0x3b')],{'as':_0xef71('0x3b'),'foreignKey':_0xef71('0x15f')});db[_0xef71('0x65')][_0xef71('0x124')](db[_0xef71('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xef71('0x151')});db[_0xef71('0x65')][_0xef71('0x129')](db['User'],{'as':'Agents','through':_0xef71('0x138')});db['OpenchannelQueueReport'][_0xef71('0x124')](db[_0xef71('0x13c')],{});db[_0xef71('0x66')][_0xef71('0x124')](db['CmList'],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0x66')][_0xef71('0x124')](db['CmContact'],{'as':_0xef71('0x15d'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0x66')]['belongsTo'](db[_0xef71('0x5f')],{});db['OpenchannelQueueReport'][_0xef71('0x124')](db[_0xef71('0x61')],{});db[_0xef71('0x66')][_0xef71('0x124')](db[_0xef71('0x114')],{});db['OpenchannelQueueReport'][_0xef71('0x124')](db['OpenchannelQueue'],{});db[_0xef71('0x192')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x194'),'foreignKey':_0xef71('0x117'),'onDelete':'restrict'});db[_0xef71('0x192')][_0xef71('0x124')](db['ChatQueue'],{'as':_0xef71('0x195'),'foreignKey':_0xef71('0x196'),'onDelete':_0xef71('0x161')});db[_0xef71('0x192')][_0xef71('0x124')](db['ChatWebsite'],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0xef71('0x161')});db[_0xef71('0x192')][_0xef71('0x124')](db[_0xef71('0x170')],{'onDelete':_0xef71('0x161'),'foreignKey':_0xef71('0x179')});db[_0xef71('0x69')][_0xef71('0x118')](db['ChatMessage'],{'as':_0xef71('0x158'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x197')});db[_0xef71('0x69')]['belongsTo'](db[_0xef71('0x65')],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x176')});db[_0xef71('0x69')]['belongsTo'](db['CmContact'],{'as':_0xef71('0x15d'),'foreignKey':'ContactId'});db[_0xef71('0x69')]['belongsTo'](db[_0xef71('0x114')],{'as':_0xef71('0x16f'),'foreignKey':_0xef71('0x117')});db['ChatInteraction'][_0xef71('0x129')](db[_0xef71('0x170')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xef71('0x69')][_0xef71('0x129')](db[_0xef71('0x170')],{'through':'chat_interaction_has_tags','as':_0xef71('0x180')});db[_0xef71('0x69')][_0xef71('0x129')](db['User'],{'as':_0xef71('0x181'),'through':_0xef71('0x198'),'foreignKey':_0xef71('0x197')});db[_0xef71('0x193')][_0xef71('0x124')](db['User'],{'onDelete':_0xef71('0x116'),'as':'User'});db['ChatMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x15d'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0x193')][_0xef71('0x124')](db['ChatInteraction'],{'onDelete':_0xef71('0x116'),'as':'Interaction','foreignKey':_0xef71('0x197')});db[_0xef71('0x193')][_0xef71('0x124')](db[_0xef71('0xee')],{'as':'Attachment','foreignKey':_0xef71('0x191')});db[_0xef71('0x193')][_0xef71('0x124')](db[_0xef71('0x65')],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x176')});db[_0xef71('0x177')][_0xef71('0x118')](db[_0xef71('0xee')],{'as':_0xef71('0x174'),'foreignKey':_0xef71('0x178'),'onDelete':_0xef71('0x116'),'hooks':!![]});db[_0xef71('0x177')][_0xef71('0x124')](db[_0xef71('0x71')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x15d'),'foreignKey':'ContactId'});db[_0xef71('0x177')]['belongsTo'](db[_0xef71('0x65')],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x176')});db['ChatQueue'][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':_0xef71('0x2e'),'hooks':!![]});db[_0xef71('0x6c')][_0xef71('0x129')](db[_0xef71('0x12c')],{'through':'team_has_chat_queues','as':_0xef71('0x154')});db[_0xef71('0x6e')][_0xef71('0x118')](db[_0xef71('0xd2')],{'as':_0xef71('0x158'),'foreignKey':_0xef71('0x199'),'onDelete':_0xef71('0x116')});db[_0xef71('0x6e')]['belongsToMany'](db[_0xef71('0x114')],{'as':_0xef71('0x146'),'through':_0xef71('0x19a')});db[_0xef71('0x6f')][_0xef71('0x124')](db[_0xef71('0x65')],{'as':_0xef71('0x19b'),'foreignKey':_0xef71('0x176')});db[_0xef71('0x19c')]['hasMany'](db[_0xef71('0x71')],{'as':'Contacts','foreignKey':_0xef71('0x19d')});db[_0xef71('0x71')][_0xef71('0x118')](db[_0xef71('0x90')],{'as':_0xef71('0x19e'),'foreignKey':'CmContactId'});db['CmContact'][_0xef71('0x118')](db['CmHopper'],{'as':_0xef71('0x148'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db['CmHopperFinal'],{'as':_0xef71('0x11d'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0x71')][_0xef71('0x118')](db[_0xef71('0x77')],{'as':_0xef71('0x19f'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0x71')]['hasMany'](db['ReportAgentPreview'],{'as':_0xef71('0x79'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0x71')]['hasMany'](db[_0xef71('0xd6')],{'as':_0xef71('0x14a'),'foreignKey':_0xef71('0x15e')});db['CmContact'][_0xef71('0x118')](db['OpenchannelInteraction'],{'as':_0xef71('0x1a0'),'foreignKey':_0xef71('0x15e'),'onDelete':'restrict'});db[_0xef71('0x71')][_0xef71('0x118')](db[_0xef71('0x69')],{'as':_0xef71('0x11e'),'foreignKey':_0xef71('0x15e'),'onDelete':'restrict'});db[_0xef71('0x71')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xef71('0x15e'),'onDelete':_0xef71('0x161')});db[_0xef71('0x71')][_0xef71('0x118')](db[_0xef71('0x120')],{'as':_0xef71('0x12e'),'foreignKey':_0xef71('0x15e'),'onDelete':_0xef71('0x161')});db[_0xef71('0x71')][_0xef71('0x118')](db['MailInteraction'],{'as':_0xef71('0x121'),'foreignKey':_0xef71('0x15e'),'onDelete':_0xef71('0x161')});db[_0xef71('0x71')][_0xef71('0x124')](db[_0xef71('0x19c')],{'as':_0xef71('0x1a1'),'foreignKey':'CompanyId'});db[_0xef71('0x71')][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':'List','foreignKey':_0xef71('0x169'),'onDelete':_0xef71('0x116')});db['CmContact'][_0xef71('0x129')](db['User'],{'as':'Users','through':_0xef71('0x128')});db[_0xef71('0x71')][_0xef71('0x129')](db[_0xef71('0x170')],{'as':_0xef71('0x172'),'through':_0xef71('0x1a2')});db[_0xef71('0x71')][_0xef71('0x129')](db[_0xef71('0x170')],{'through':_0xef71('0x1a2'),'as':_0xef71('0x180')});db['CmHopper'][_0xef71('0x118')](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':_0xef71('0x1a3')});db['CmHopper'][_0xef71('0x124')](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0xef71('0x1a4')][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169'),'onDelete':'cascade'});db[_0xef71('0x1a4')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x194'),'foreignKey':_0xef71('0x117')});db['CmHopper'][_0xef71('0x124')](db[_0xef71('0x18')],{'as':_0xef71('0x195'),'foreignKey':'VoiceQueueId','onDelete':_0xef71('0x116')});db[_0xef71('0x1a4')][_0xef71('0x124')](db[_0xef71('0xeb')],{'as':_0xef71('0xeb'),'foreignKey':'CampaignId','onDelete':_0xef71('0x116')});db[_0xef71('0x1a4')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x16f'),'foreignKey':_0xef71('0x1a5')});db[_0xef71('0x74')][_0xef71('0x124')](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':_0xef71('0x15e'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xef71('0x169'),'onDelete':'cascade'});db[_0xef71('0x74')][_0xef71('0x124')](db[_0xef71('0x18')],{'as':_0xef71('0x195'),'foreignKey':'VoiceQueueId','onDelete':_0xef71('0x116')});db[_0xef71('0x74')][_0xef71('0x124')](db[_0xef71('0xeb')],{'as':_0xef71('0xeb'),'foreignKey':_0xef71('0x1a6'),'onDelete':'cascade'});db['Automation'][_0xef71('0x118')](db[_0xef71('0x83')],{'as':{'plural':_0xef71('0x1a7'),'singular':'OneAll'},'foreignKey':_0xef71('0x1a8'),'onDelete':_0xef71('0x116'),'hooks':!![]});db[_0xef71('0x1a9')][_0xef71('0x118')](db[_0xef71('0x83')],{'as':{'plural':_0xef71('0x1aa'),'singular':_0xef71('0x1ab')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xef71('0x1a9')][_0xef71('0x118')](db[_0xef71('0x7d')],{'as':_0xef71('0x1ac'),'foreignKey':_0xef71('0x1ad'),'onDelete':_0xef71('0x116'),'hooks':!![]});db['Disposition'][_0xef71('0x118')](db[_0xef71('0x81')],{'as':_0xef71('0x165'),'foreignKey':_0xef71('0x1ae'),'onDelete':_0xef71('0x116')});db[_0xef71('0x14e')][_0xef71('0x118')](db[_0xef71('0x14e')],{'as':_0xef71('0x1af'),'foreignKey':_0xef71('0x14f'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0xef71('0x118')](db[_0xef71('0x11a')],{'as':_0xef71('0x11b'),'foreignKey':'IntervalId','onDelete':_0xef71('0x161')});db['Interval'][_0xef71('0x118')](db['MailApplication'],{'as':_0xef71('0x1b0'),'foreignKey':'IntervalId'});db[_0xef71('0x14e')][_0xef71('0x118')](db[_0xef71('0x192')],{'as':_0xef71('0x1b1'),'foreignKey':_0xef71('0x14f')});db[_0xef71('0x14e')][_0xef71('0x118')](db[_0xef71('0x4d')],{'as':_0xef71('0x1b2'),'foreignKey':_0xef71('0x14f')});db[_0xef71('0x14e')][_0xef71('0x118')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xef71('0x14f')});db[_0xef71('0x89')][_0xef71('0x124')](db[_0xef71('0x3b')],{});db[_0xef71('0x89')]['belongsTo'](db[_0xef71('0x9c')],{'foreignKey':_0xef71('0x1b3')});db[_0xef71('0x89')]['belongsTo'](db[_0xef71('0x9a')],{'foreignKey':_0xef71('0x1b4')});db[_0xef71('0x8b')][_0xef71('0x129')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xef71('0x145'),'onDelete':'restrict'});db[_0xef71('0x170')][_0xef71('0x129')](db[_0xef71('0x71')],{'through':_0xef71('0x1a2')});db[_0xef71('0x170')]['belongsToMany'](db[_0xef71('0x69')],{'through':_0xef71('0x1b5')});db[_0xef71('0x170')][_0xef71('0x129')](db[_0xef71('0x41')],{'through':_0xef71('0x171')});db[_0xef71('0x170')][_0xef71('0x129')](db[_0xef71('0x58')],{'through':_0xef71('0x188')});db[_0xef71('0x170')]['belongsToMany'](db[_0xef71('0x120')],{'through':_0xef71('0x17f')});db[_0xef71('0x170')][_0xef71('0x129')](db['OpenchannelInteraction'],{'through':_0xef71('0x18f')});db['Tag']['belongsToMany'](db[_0xef71('0x103')],{'through':'whatsapp_interaction_has_tags'});db[_0xef71('0x90')][_0xef71('0x124')](db[_0xef71('0x8e')],{'as':'ItemType','foreignKey':_0xef71('0x1b6')});db[_0xef71('0x1b7')][_0xef71('0x124')](db[_0xef71('0x1a4')],{'as':_0xef71('0x1b8'),'foreignKey':_0xef71('0x1a3')});db[_0xef71('0x90')][_0xef71('0x124')](db['CmContact'],{'as':_0xef71('0x15d'),'foreignKey':'CmContactId'});db['Trigger'][_0xef71('0x118')](db['Condition'],{'as':{'plural':_0xef71('0x1b9'),'singular':_0xef71('0x1ba')},'foreignKey':'TriggerAllId','onDelete':_0xef71('0x116'),'hooks':!![]});db[_0xef71('0x1bb')][_0xef71('0x118')](db[_0xef71('0x83')],{'as':{'plural':_0xef71('0x1bc'),'singular':_0xef71('0x1bd')},'foreignKey':_0xef71('0x1be'),'onDelete':_0xef71('0x116'),'hooks':!![]});db[_0xef71('0x1bb')][_0xef71('0x118')](db[_0xef71('0x7d')],{'as':'Actions','foreignKey':_0xef71('0x1bf'),'onDelete':_0xef71('0x116'),'hooks':!![]});db[_0xef71('0x9a')][_0xef71('0x118')](db[_0xef71('0xa2')],{'as':_0xef71('0x1c0'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1b4'),'hooks':!![]});db[_0xef71('0x9c')]['hasMany'](db[_0xef71('0xa2')],{'as':_0xef71('0x1c0'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1b3')});db[_0xef71('0xa0')][_0xef71('0x118')](db[_0xef71('0xa2')],{'as':_0xef71('0x1c0'),'onDelete':_0xef71('0x116'),'foreignKey':'MetricId'});db[_0xef71('0xa2')][_0xef71('0x124')](db[_0xef71('0xa0')],{'foreignKey':_0xef71('0x1c1')});db[_0xef71('0xa4')][_0xef71('0x118')](db[_0xef71('0xa5')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xef71('0x1c2')});db['SalesforceConfiguration'][_0xef71('0x118')](db['SalesforceField'],{'as':'Subjects','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0xa5')][_0xef71('0x118')](db[_0xef71('0xa6')],{'as':_0xef71('0x1c4'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c5')});db[_0xef71('0xa5')]['hasMany'](db[_0xef71('0xa6')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xef71('0xa5')][_0xef71('0x124')](db[_0xef71('0xa4')],{'as':_0xef71('0x16e'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0xef71('0x1c6'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0xa6')][_0xef71('0x118')](db['SalesforceField'],{'as':_0xef71('0x1c7'),'foreignKey':_0xef71('0x1c5')});db['SalesforceField'][_0xef71('0x118')](db[_0xef71('0xa6')],{'as':_0xef71('0x1c8'),'foreignKey':_0xef71('0x1c9')});db[_0xef71('0xa6')][_0xef71('0x124')](db[_0xef71('0x95')],{'as':_0xef71('0x95'),'foreignKey':'VariableId'});db['SugarcrmAccount']['hasMany'](db['SugarcrmConfiguration'],{'as':_0xef71('0x1ca'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c2')});db[_0xef71('0x1cb')][_0xef71('0x118')](db['SugarcrmField'],{'as':_0xef71('0x1cc'),'onDelete':'cascade','foreignKey':_0xef71('0x1c3')});db[_0xef71('0x1cb')][_0xef71('0x118')](db[_0xef71('0xab')],{'as':_0xef71('0x1c4'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c5')});db['SugarcrmConfiguration'][_0xef71('0x118')](db[_0xef71('0xab')],{'as':'Fields','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c9')});db[_0xef71('0x1cb')][_0xef71('0x124')](db['SugarcrmAccount'],{'as':_0xef71('0x16e'),'foreignKey':'AccountId'});db[_0xef71('0xab')]['hasMany'](db['SugarcrmField'],{'as':_0xef71('0x1c6'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0xab')][_0xef71('0x118')](db[_0xef71('0xab')],{'as':_0xef71('0x1c7'),'foreignKey':'DescriptionId'});db[_0xef71('0xab')][_0xef71('0x118')](db['SugarcrmField'],{'as':'Field','foreignKey':_0xef71('0x1c9')});db[_0xef71('0xab')]['belongsTo'](db[_0xef71('0x95')],{'as':_0xef71('0x95'),'foreignKey':_0xef71('0x1cd')});db['DeskAccount']['hasMany'](db[_0xef71('0xad')],{'as':_0xef71('0x1ca'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c2')});db[_0xef71('0xad')][_0xef71('0x118')](db[_0xef71('0xaf')],{'as':'Subjects','onDelete':_0xef71('0x116'),'foreignKey':'SubjectId'});db[_0xef71('0xad')][_0xef71('0x118')](db['DeskField'],{'as':_0xef71('0x1c4'),'onDelete':'cascade','foreignKey':_0xef71('0x1c5')});db[_0xef71('0xad')][_0xef71('0x118')](db[_0xef71('0xaf')],{'as':_0xef71('0x1c0'),'onDelete':_0xef71('0x116'),'foreignKey':'FieldId'});db[_0xef71('0xad')][_0xef71('0x124')](db['DeskAccount'],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x1c2')});db[_0xef71('0xad')][_0xef71('0x129')](db[_0xef71('0x170')],{'through':_0xef71('0x1ce')});db[_0xef71('0xaf')][_0xef71('0x118')](db[_0xef71('0xaf')],{'as':'Subject','foreignKey':_0xef71('0x1c3')});db[_0xef71('0xaf')][_0xef71('0x118')](db[_0xef71('0xaf')],{'as':'Description','foreignKey':_0xef71('0x1c5')});db[_0xef71('0xaf')][_0xef71('0x118')](db['DeskField'],{'as':'Field','foreignKey':_0xef71('0x1c9')});db[_0xef71('0xaf')]['belongsTo'](db[_0xef71('0x95')],{'as':_0xef71('0x95'),'foreignKey':_0xef71('0x1cd')});db[_0xef71('0xb1')][_0xef71('0x118')](db[_0xef71('0x1cf')],{'as':'Configurations','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c2')});db[_0xef71('0x1cf')][_0xef71('0x118')](db['ZohoField'],{'as':'Subjects','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0x1cf')][_0xef71('0x118')](db[_0xef71('0xb3')],{'as':_0xef71('0x1c4'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c5')});db[_0xef71('0x1cf')][_0xef71('0x118')](db[_0xef71('0xb3')],{'as':_0xef71('0x1c0'),'onDelete':_0xef71('0x116'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0xef71('0x124')](db['ZohoAccount'],{'as':_0xef71('0x16e'),'foreignKey':'AccountId'});db['ZohoField']['hasMany'](db[_0xef71('0xb3')],{'as':_0xef71('0x1c6'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0xb3')][_0xef71('0x118')](db[_0xef71('0xb3')],{'as':_0xef71('0x1c7'),'foreignKey':_0xef71('0x1c5')});db['ZohoField'][_0xef71('0x118')](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db[_0xef71('0xb3')][_0xef71('0x124')](db[_0xef71('0x95')],{'as':_0xef71('0x95'),'foreignKey':_0xef71('0x1cd')});db[_0xef71('0x1d0')][_0xef71('0x118')](db[_0xef71('0xb5')],{'as':'Configurations','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c2')});db['ZendeskConfiguration'][_0xef71('0x118')](db[_0xef71('0xb7')],{'as':_0xef71('0x1cc'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0xb5')]['hasMany'](db[_0xef71('0xb7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0xef71('0x118')](db[_0xef71('0xb7')],{'as':_0xef71('0x1c0'),'foreignKey':_0xef71('0x1c9')});db[_0xef71('0xb5')]['belongsTo'](db['ZendeskAccount'],{'as':'Account','foreignKey':_0xef71('0x1c2')});db[_0xef71('0xb5')][_0xef71('0x129')](db[_0xef71('0x170')],{'through':_0xef71('0x1d1')});db[_0xef71('0xb7')]['hasMany'](db[_0xef71('0xb7')],{'as':_0xef71('0x1c6'),'foreignKey':'SubjectId'});db[_0xef71('0xb7')][_0xef71('0x118')](db['ZendeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xef71('0xb7')][_0xef71('0x118')](db[_0xef71('0xb7')],{'as':_0xef71('0x1c8'),'foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db[_0xef71('0x95')],{'as':_0xef71('0x95'),'foreignKey':_0xef71('0x1cd')});db['FreshdeskAccount'][_0xef71('0x118')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c2')});db[_0xef71('0xbb')]['hasMany'](db[_0xef71('0x1d2')],{'as':_0xef71('0x1cc'),'onDelete':_0xef71('0x116'),'foreignKey':'SubjectId'});db[_0xef71('0xbb')][_0xef71('0x118')](db['FreshdeskField'],{'as':_0xef71('0x1c4'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c5')});db[_0xef71('0xbb')][_0xef71('0x118')](db[_0xef71('0x1d2')],{'as':_0xef71('0x1c0'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1c9')});db['FreshdeskConfiguration'][_0xef71('0x124')](db[_0xef71('0xb9')],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x1c2')});db[_0xef71('0xbb')][_0xef71('0x129')](db[_0xef71('0x170')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0xef71('0x118')](db[_0xef71('0x1d2')],{'as':'Subject','foreignKey':_0xef71('0x1c3')});db[_0xef71('0x1d2')][_0xef71('0x118')](db[_0xef71('0x1d2')],{'as':_0xef71('0x1c7'),'foreignKey':_0xef71('0x1c5')});db[_0xef71('0x1d2')][_0xef71('0x118')](db[_0xef71('0x1d2')],{'as':_0xef71('0x1c8'),'foreignKey':_0xef71('0x1c9')});db['FreshdeskField'][_0xef71('0x124')](db[_0xef71('0x95')],{'as':'Variable','foreignKey':_0xef71('0x1cd')});db[_0xef71('0xbe')][_0xef71('0x118')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xef71('0xbf')][_0xef71('0x118')](db[_0xef71('0xc1')],{'as':_0xef71('0x1cc'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0xbf')][_0xef71('0x118')](db[_0xef71('0xc1')],{'as':_0xef71('0x1c4'),'foreignKey':'DescriptionId'});db[_0xef71('0xbf')][_0xef71('0x118')](db[_0xef71('0xc1')],{'as':'Fields','foreignKey':_0xef71('0x1c9')});db[_0xef71('0xbf')][_0xef71('0x124')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xef71('0x1c2')});db[_0xef71('0xc1')][_0xef71('0x118')](db[_0xef71('0xc1')],{'as':_0xef71('0x1c6'),'foreignKey':_0xef71('0x1c3')});db['VtigerField'][_0xef71('0x118')](db[_0xef71('0xc1')],{'as':_0xef71('0x1c7'),'foreignKey':'DescriptionId'});db[_0xef71('0xc1')][_0xef71('0x118')](db['VtigerField'],{'as':_0xef71('0x1c8'),'foreignKey':_0xef71('0x1c9')});db[_0xef71('0xc1')][_0xef71('0x124')](db[_0xef71('0x95')],{'as':_0xef71('0x95'),'foreignKey':_0xef71('0x1cd')});db[_0xef71('0xc3')][_0xef71('0x118')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0xef71('0x116'),'foreignKey':'AccountId'});db[_0xef71('0xc5')][_0xef71('0x118')](db[_0xef71('0xc6')],{'as':_0xef71('0x1cc'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0xc5')][_0xef71('0x118')](db['ServicenowField'],{'as':_0xef71('0x1c4'),'foreignKey':'DescriptionId'});db[_0xef71('0xc5')][_0xef71('0x118')](db['ServicenowField'],{'as':'Fields','foreignKey':_0xef71('0x1c9')});db[_0xef71('0xc5')][_0xef71('0x124')](db['ServicenowAccount'],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x1c2')});db[_0xef71('0xc6')][_0xef71('0x118')](db[_0xef71('0xc6')],{'as':_0xef71('0x1c6'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0xc6')][_0xef71('0x118')](db['ServicenowField'],{'as':_0xef71('0x1c7'),'foreignKey':'DescriptionId'});db[_0xef71('0xc6')][_0xef71('0x118')](db[_0xef71('0xc6')],{'as':'Field','foreignKey':_0xef71('0x1c9')});db['ServicenowField'][_0xef71('0x124')](db['Variable'],{'as':_0xef71('0x95'),'foreignKey':_0xef71('0x1cd')});db[_0xef71('0xc8')][_0xef71('0x118')](db[_0xef71('0xca')],{'as':_0xef71('0x1ca'),'onDelete':'cascade','foreignKey':_0xef71('0x1c2')});db[_0xef71('0xc8')][_0xef71('0x124')](db['CloudProvider'],{'as':_0xef71('0x10a'),'foreignKey':_0xef71('0x160')});db[_0xef71('0xca')][_0xef71('0x118')](db[_0xef71('0xcb')],{'as':_0xef71('0x1cc'),'onDelete':_0xef71('0x116'),'foreignKey':'SubjectId'});db[_0xef71('0xca')][_0xef71('0x118')](db[_0xef71('0xcb')],{'as':_0xef71('0x1c4'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xef71('0xca')][_0xef71('0x118')](db[_0xef71('0xcb')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xef71('0x1c9')});db[_0xef71('0xca')]['belongsTo'](db['Dynamics365Account'],{'as':_0xef71('0x16e'),'foreignKey':'AccountId'});db[_0xef71('0xcb')][_0xef71('0x118')](db[_0xef71('0xcb')],{'as':_0xef71('0x1c6'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0xef71('0x118')](db[_0xef71('0xcb')],{'as':'Description','foreignKey':_0xef71('0x1c5')});db[_0xef71('0xcb')]['hasMany'](db[_0xef71('0xcb')],{'as':_0xef71('0x1c8'),'foreignKey':_0xef71('0x1c9')});db['Dynamics365Field'][_0xef71('0x124')](db[_0xef71('0x95')],{'as':'Variable','foreignKey':'VariableId'});db['FreshsalesAccount'][_0xef71('0x118')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xef71('0x1d3')][_0xef71('0x118')](db[_0xef71('0x1d4')],{'as':_0xef71('0x1cc'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0x1d3')][_0xef71('0x118')](db[_0xef71('0x1d4')],{'as':_0xef71('0x1c4'),'foreignKey':'DescriptionId'});db[_0xef71('0x1d3')][_0xef71('0x118')](db[_0xef71('0x1d4')],{'as':'Fields','foreignKey':_0xef71('0x1c9')});db[_0xef71('0x1d3')][_0xef71('0x124')](db['FreshsalesAccount'],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x1c2')});db[_0xef71('0x1d4')][_0xef71('0x118')](db[_0xef71('0x1d4')],{'as':_0xef71('0x1c6'),'foreignKey':_0xef71('0x1c3')});db[_0xef71('0x1d4')][_0xef71('0x118')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xef71('0x1c5')});db[_0xef71('0x1d4')][_0xef71('0x118')](db[_0xef71('0x1d4')],{'as':_0xef71('0x1c8'),'foreignKey':_0xef71('0x1c9')});db[_0xef71('0x1d4')][_0xef71('0x124')](db[_0xef71('0x95')],{'as':_0xef71('0x95'),'foreignKey':_0xef71('0x1cd')});db['ChatQueueReport'][_0xef71('0x124')](db['ChatWebsite'],{});db[_0xef71('0x1d5')][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0x1d5')][_0xef71('0x124')](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0xef71('0x124')](db[_0xef71('0x69')],{});db[_0xef71('0x1d5')][_0xef71('0x124')](db[_0xef71('0x193')],{});db[_0xef71('0x1d5')]['belongsTo'](db['User'],{});db[_0xef71('0x1d5')][_0xef71('0x124')](db[_0xef71('0x6c')],{});db['ChatInternalMessage'][_0xef71('0x124')](db[_0xef71('0x114')],{'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x1d6')});db[_0xef71('0xd2')][_0xef71('0x124')](db[_0xef71('0x114')],{'onDelete':_0xef71('0x116'),'foreignKey':'ToId'});db[_0xef71('0xd6')]['hasMany'](db[_0xef71('0xd5')],{'foreignKey':_0xef71('0x1d7'),'onDelete':_0xef71('0x116')});db['JscriptySessionReport'][_0xef71('0x118')](db[_0xef71('0xd4')],{'foreignKey':'SessionId','onDelete':_0xef71('0x116')});db[_0xef71('0xd8')][_0xef71('0x124')](db['SmsAccount'],{});db['SmsQueueReport']['belongsTo'](db[_0xef71('0xf8')],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0xd8')][_0xef71('0x124')](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':_0xef71('0x15e')});db[_0xef71('0xd8')][_0xef71('0x124')](db[_0xef71('0x58')],{});db['SmsQueueReport'][_0xef71('0x124')](db[_0xef71('0x185')],{});db[_0xef71('0xd8')][_0xef71('0x124')](db['User'],{});db['SmsQueueReport'][_0xef71('0x124')](db[_0xef71('0x5b')],{});db['JscriptyProject'][_0xef71('0x118')](db['JscriptySessionReport'],{'foreignKey':_0xef71('0x1d8')});db[_0xef71('0xde')][_0xef71('0x118')](db['JscriptyQuestionReport'],{'foreignKey':_0xef71('0x1d8')});db[_0xef71('0xde')][_0xef71('0x118')](db[_0xef71('0xd4')],{'foreignKey':_0xef71('0x1d8')});db[_0xef71('0x1d9')]['belongsToMany'](db[_0xef71('0x114')],{'as':_0xef71('0x181'),'through':_0xef71('0x140')});db[_0xef71('0x12c')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':_0xef71('0x12d')});db['Team'][_0xef71('0x129')](db[_0xef71('0x18')],{'through':_0xef71('0x10c'),'as':_0xef71('0x130')});db[_0xef71('0x12c')][_0xef71('0x129')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0xef71('0x131')});db['Team'][_0xef71('0x129')](db[_0xef71('0x6c')],{'through':'team_has_chat_queues','as':_0xef71('0x132')});db[_0xef71('0x12c')]['belongsToMany'](db[_0xef71('0x51')],{'through':_0xef71('0x183'),'as':_0xef71('0x1da')});db[_0xef71('0x12c')][_0xef71('0x129')](db[_0xef71('0x5b')],{'through':_0xef71('0x18a'),'as':_0xef71('0x133')});db['Team']['belongsToMany'](db[_0xef71('0x63')],{'through':'team_has_openchannel_queues','as':_0xef71('0x135')});db[_0xef71('0x12c')][_0xef71('0x129')](db['WhatsappQueue'],{'through':_0xef71('0x1db'),'as':_0xef71('0x136')});db['Team'][_0xef71('0x129')](db[_0xef71('0xfa')],{'through':_0xef71('0x10e'),'as':_0xef71('0x1dc')});db[_0xef71('0xeb')][_0xef71('0x118')](db[_0xef71('0x1a4')],{'as':'Hoppers','foreignKey':_0xef71('0x1a6')});db[_0xef71('0xeb')]['hasMany'](db['CmHopperFinal'],{'as':_0xef71('0x11d'),'foreignKey':_0xef71('0x1a6')});db['Campaign'][_0xef71('0x118')](db[_0xef71('0x77')],{'as':_0xef71('0x19f'),'foreignKey':_0xef71('0x1a6')});db[_0xef71('0xeb')][_0xef71('0x118')](db['CmHopperBlack'],{'as':_0xef71('0x149'),'foreignKey':_0xef71('0x1a6')});db[_0xef71('0xeb')][_0xef71('0x124')](db[_0xef71('0x26')],{'as':_0xef71('0x26'),'foreignKey':_0xef71('0x14b')});db[_0xef71('0xeb')][_0xef71('0x124')](db[_0xef71('0x26')],{'as':_0xef71('0x14c'),'foreignKey':'TrunkBackupId'});db[_0xef71('0xeb')][_0xef71('0x124')](db[_0xef71('0x14e')],{'as':_0xef71('0x14e'),'foreignKey':_0xef71('0x14f')});db[_0xef71('0xeb')][_0xef71('0x124')](db['SquareProject'],{'as':_0xef71('0x1d9'),'foreignKey':_0xef71('0x1dd')});db[_0xef71('0xeb')][_0xef71('0x129')](db[_0xef71('0xf8')],{'as':_0xef71('0x12a'),'through':_0xef71('0x1de')});db[_0xef71('0xeb')][_0xef71('0x129')](db['CmList'],{'as':_0xef71('0x155'),'through':'campaigns_has_cm_blacklists'});db[_0xef71('0xee')][_0xef71('0x124')](db[_0xef71('0x177')],{'as':_0xef71('0x177'),'foreignKey':_0xef71('0x178')});db[_0xef71('0xf1')][_0xef71('0x124')](db[_0xef71('0x42')],{});db['MailTransferReport'][_0xef71('0x124')](db[_0xef71('0x41')],{});db[_0xef71('0xf1')][_0xef71('0x124')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0xef71('0x1df')});db[_0xef71('0xf1')][_0xef71('0x124')](db[_0xef71('0x114')],{'foreignKey':_0xef71('0x1e0'),'as':_0xef71('0x1e1')});db['MailTransferReport'][_0xef71('0x124')](db[_0xef71('0x114')],{'foreignKey':_0xef71('0x1e2'),'as':_0xef71('0x1e3')});db[_0xef71('0xf1')][_0xef71('0x124')](db[_0xef71('0x3d')],{'foreignKey':_0xef71('0x1e4'),'as':_0xef71('0x1e5')});db['MailTransferReport'][_0xef71('0x124')](db[_0xef71('0x3b')],{'foreignKey':_0xef71('0x1e6'),'as':_0xef71('0x1e7')});db[_0xef71('0x1e8')][_0xef71('0x124')](db[_0xef71('0x193')],{});db['ChatTransferReport'][_0xef71('0x124')](db['ChatInteraction'],{});db['ChatTransferReport']['belongsTo'](db[_0xef71('0x65')],{'foreignKey':'FromChatWebsiteId','as':_0xef71('0x1df')});db[_0xef71('0x1e8')][_0xef71('0x124')](db['User'],{'foreignKey':'FromUserId','as':_0xef71('0x1e1')});db[_0xef71('0x1e8')][_0xef71('0x124')](db[_0xef71('0x114')],{'foreignKey':_0xef71('0x1e2'),'as':_0xef71('0x1e3')});db[_0xef71('0x1e8')]['belongsTo'](db[_0xef71('0x6c')],{'foreignKey':_0xef71('0x1e9'),'as':_0xef71('0x1e5')});db[_0xef71('0x1e8')]['belongsTo'](db[_0xef71('0x65')],{'foreignKey':_0xef71('0x1ea'),'as':_0xef71('0x1e7')});db[_0xef71('0xf4')][_0xef71('0x124')](db['FaxMessage'],{});db[_0xef71('0xf4')][_0xef71('0x124')](db[_0xef71('0x120')],{});db[_0xef71('0xf4')]['belongsTo'](db[_0xef71('0x139')],{'foreignKey':_0xef71('0x1eb'),'as':_0xef71('0x1df')});db[_0xef71('0xf4')][_0xef71('0x124')](db[_0xef71('0x114')],{'foreignKey':'FromUserId','as':_0xef71('0x1e1')});db[_0xef71('0xf4')]['belongsTo'](db[_0xef71('0x114')],{'foreignKey':_0xef71('0x1e2'),'as':_0xef71('0x1e3')});db[_0xef71('0xf4')][_0xef71('0x124')](db[_0xef71('0x51')],{'foreignKey':_0xef71('0x1ec'),'as':_0xef71('0x1e5')});db[_0xef71('0xf4')][_0xef71('0x124')](db[_0xef71('0x139')],{'foreignKey':_0xef71('0x1ed'),'as':_0xef71('0x1e7')});db[_0xef71('0x1ee')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xef71('0x1ee')]['belongsTo'](db[_0xef71('0x5f')],{});db[_0xef71('0x1ee')][_0xef71('0x124')](db[_0xef71('0x13c')],{'foreignKey':_0xef71('0x1ef'),'as':_0xef71('0x1df')});db[_0xef71('0x1ee')][_0xef71('0x124')](db['User'],{'foreignKey':_0xef71('0x1e0'),'as':_0xef71('0x1e1')});db['OpenchannelTransferReport'][_0xef71('0x124')](db[_0xef71('0x114')],{'foreignKey':_0xef71('0x1e2'),'as':'ToAgent'});db[_0xef71('0x1ee')]['belongsTo'](db[_0xef71('0x63')],{'foreignKey':_0xef71('0x1f0'),'as':_0xef71('0x1e5')});db[_0xef71('0x1ee')][_0xef71('0x124')](db['OpenchannelAccount'],{'foreignKey':_0xef71('0x1f1'),'as':'ToAccount'});db[_0xef71('0x1f2')]['belongsTo'](db[_0xef71('0x185')],{});db['SmsTransferReport'][_0xef71('0x124')](db[_0xef71('0x58')],{});db[_0xef71('0x1f2')][_0xef71('0x124')](db[_0xef71('0x13e')],{'foreignKey':_0xef71('0x1f3'),'as':'FromAccount'});db[_0xef71('0x1f2')][_0xef71('0x124')](db[_0xef71('0x114')],{'foreignKey':_0xef71('0x1e0'),'as':_0xef71('0x1e1')});db[_0xef71('0x1f2')][_0xef71('0x124')](db[_0xef71('0x114')],{'foreignKey':_0xef71('0x1e2'),'as':'ToAgent'});db[_0xef71('0x1f2')][_0xef71('0x124')](db[_0xef71('0x5b')],{'foreignKey':_0xef71('0x1f4'),'as':_0xef71('0x1e5')});db['SmsTransferReport'][_0xef71('0x124')](db[_0xef71('0x13e')],{'foreignKey':_0xef71('0x1f5'),'as':'ToAccount'});db[_0xef71('0xf8')][_0xef71('0x118')](db['Disposition'],{'as':_0xef71('0x165'),'foreignKey':_0xef71('0x169'),'onDelete':'cascade'});db['CmList'][_0xef71('0x118')](db[_0xef71('0x7b')],{'as':'CustomFields','foreignKey':_0xef71('0x169')});db[_0xef71('0xf8')][_0xef71('0x118')](db[_0xef71('0x71')],{'as':_0xef71('0x127'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x169')});db['CmList'][_0xef71('0x118')](db[_0xef71('0x11c')],{'as':_0xef71('0x11d'),'foreignKey':_0xef71('0x169')});db['CmList'][_0xef71('0x118')](db[_0xef71('0x77')],{'as':_0xef71('0x1f6'),'foreignKey':'ListId'});db[_0xef71('0xf8')]['hasMany'](db[_0xef71('0x79')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xef71('0xf8')]['belongsToMany'](db[_0xef71('0x18')],{'as':_0xef71('0x1f7'),'through':'voice_queues_has_cm_lists'});db[_0xef71('0xf8')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':_0xef71('0x12b')});db['VoicePrefix'][_0xef71('0x118')](db['VoiceExtension'],{'as':_0xef71('0x11b'),'onDelete':_0xef71('0x116')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':'Agents','through':_0xef71('0x110')});db[_0xef71('0xfa')]['belongsToMany'](db[_0xef71('0x12c')],{'through':_0xef71('0x10e'),'as':_0xef71('0x154')});db['UserProfile']['hasMany'](db[_0xef71('0x114')],{'as':_0xef71('0x181'),'foreignKey':_0xef71('0x1f8')});db[_0xef71('0x125')]['hasMany'](db[_0xef71('0xfd')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0xef71('0x116')});db[_0xef71('0xfd')][_0xef71('0x118')](db[_0xef71('0x1f9')],{'as':_0xef71('0x1fa'),'foreignKey':_0xef71('0x1fb'),'onDelete':_0xef71('0x116')});db[_0xef71('0x101')][_0xef71('0x118')](db['Disposition'],{'as':_0xef71('0x165'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xef71('0x101')][_0xef71('0x118')](db[_0xef71('0x7f')],{'as':_0xef71('0x166'),'foreignKey':_0xef71('0x1fc')});db[_0xef71('0x101')]['hasMany'](db[_0xef71('0x1fd')],{'as':_0xef71('0x158'),'foreignKey':_0xef71('0x1fc')});db['WhatsappAccount'][_0xef71('0x118')](db[_0xef71('0x103')],{'as':'Interactions'});db['WhatsappAccount'][_0xef71('0x118')](db['WhatsappApplication'],{'as':_0xef71('0x142')});db[_0xef71('0x101')][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':_0xef71('0x168'),'foreignKey':_0xef71('0x169')});db[_0xef71('0x101')][_0xef71('0x124')](db[_0xef71('0x86')],{'as':_0xef71('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':_0xef71('0x1fe')});db[_0xef71('0x1ff')][_0xef71('0x124')](db['User'],{'onDelete':_0xef71('0x161')});db[_0xef71('0x1ff')][_0xef71('0x124')](db[_0xef71('0x200')],{'onDelete':'restrict'});db[_0xef71('0x1ff')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0xef71('0x161')});db['WhatsappApplication'][_0xef71('0x124')](db[_0xef71('0x14e')],{'onDelete':_0xef71('0x161'),'foreignKey':_0xef71('0x14f')});db[_0xef71('0x1ff')][_0xef71('0x124')](db[_0xef71('0x170')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xef71('0x103')]['hasMany'](db[_0xef71('0x1fd')],{'as':_0xef71('0x158'),'onDelete':_0xef71('0x116'),'foreignKey':_0xef71('0x201')});db[_0xef71('0x103')][_0xef71('0x124')](db[_0xef71('0x101')],{'as':'Account','foreignKey':_0xef71('0x1fc')});db[_0xef71('0x103')]['belongsTo'](db[_0xef71('0x71')],{'as':_0xef71('0x15d'),'foreignKey':'ContactId'});db[_0xef71('0x103')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x16f'),'foreignKey':_0xef71('0x117')});db['WhatsappInteraction'][_0xef71('0x129')](db[_0xef71('0x170')],{'through':_0xef71('0x202'),'as':_0xef71('0x172')});db['WhatsappInteraction']['belongsToMany'](db[_0xef71('0x170')],{'through':'whatsapp_interaction_has_tags','as':_0xef71('0x180')});db[_0xef71('0x103')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x181'),'through':_0xef71('0x203'),'foreignKey':_0xef71('0x201')});db[_0xef71('0x1fd')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':_0xef71('0x114')});db['WhatsappMessage'][_0xef71('0x124')](db[_0xef71('0x71')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x15d')});db[_0xef71('0x1fd')]['belongsTo'](db[_0xef71('0x103')],{'onDelete':_0xef71('0x116'),'as':_0xef71('0x175'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xef71('0x124')](db[_0xef71('0x101')],{'as':_0xef71('0x16e'),'foreignKey':_0xef71('0x1fc')});db['WhatsappQueueReport']['belongsTo'](db['WhatsappAccount'],{});db[_0xef71('0x106')][_0xef71('0x124')](db[_0xef71('0xf8')],{'as':'List','foreignKey':_0xef71('0x169')});db['WhatsappQueueReport']['belongsTo'](db[_0xef71('0x71')],{'as':'Contact','foreignKey':_0xef71('0x15e')});db[_0xef71('0x106')][_0xef71('0x124')](db[_0xef71('0x103')],{});db[_0xef71('0x106')][_0xef71('0x124')](db['WhatsappQueue'],{});db[_0xef71('0x106')]['belongsTo'](db['WhatsappMessage'],{});db[_0xef71('0x106')][_0xef71('0x124')](db[_0xef71('0x114')],{});db[_0xef71('0x108')][_0xef71('0x124')](db[_0xef71('0x1fd')],{});db[_0xef71('0x108')][_0xef71('0x124')](db[_0xef71('0x103')],{});db[_0xef71('0x108')][_0xef71('0x124')](db['WhatsappAccount'],{'foreignKey':_0xef71('0x204'),'as':_0xef71('0x1df')});db[_0xef71('0x108')]['belongsTo'](db[_0xef71('0x101')],{'foreignKey':_0xef71('0x205'),'as':_0xef71('0x1e7')});db[_0xef71('0x108')][_0xef71('0x124')](db[_0xef71('0x200')],{'foreignKey':_0xef71('0x206'),'as':_0xef71('0x1e5')});db[_0xef71('0x108')]['belongsTo'](db[_0xef71('0x114')],{'foreignKey':_0xef71('0x1e0'),'as':_0xef71('0x1e1')});db[_0xef71('0x108')][_0xef71('0x124')](db['User'],{'foreignKey':_0xef71('0x1e2'),'as':_0xef71('0x1e3')});db[_0xef71('0x200')][_0xef71('0x129')](db[_0xef71('0x114')],{'as':_0xef71('0x153'),'through':'UserWhatsappQueue','foreignKey':_0xef71('0x207')});db[_0xef71('0x200')][_0xef71('0x129')](db[_0xef71('0x12c')],{'through':_0xef71('0x1db'),'as':_0xef71('0x154')});db[_0xef71('0x112')][_0xef71('0x124')](db[_0xef71('0x114')],{'as':'user','foreignKey':'UserId','onDelete':_0xef71('0x116'),'hooks':!![]});db['CloudProvider'][_0xef71('0x115')](db[_0xef71('0xc8')],{'as':_0xef71('0xc8'),'onDelete':_0xef71('0x161')});db[_0xef71('0x10a')][_0xef71('0x115')](db[_0xef71('0x38')],{'as':_0xef71('0x163'),'onDelete':_0xef71('0x161')});db['CloudProvider'][_0xef71('0x115')](db[_0xef71('0x162')],{'as':_0xef71('0x164'),'onDelete':_0xef71('0x161')});module[_0xef71('0x208')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 5e9e74b..2156295 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x778e=['./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./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/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','path','./errors','./utils/client-side-logger','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailSubstatus','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelQueue','/api/chat/websites','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports'];(function(_0x35aa46,_0x55ee04){var _0x226f0c=function(_0x479e6b){while(--_0x479e6b){_0x35aa46['push'](_0x35aa46['shift']());}};_0x226f0c(++_0x55ee04);}(_0x778e,0x8e));var _0xe778=function(_0x5c3000,_0x183f88){_0x5c3000=_0x5c3000-0x0;var _0x59ecef=_0x778e[_0x5c3000];return _0x59ecef;};'use strict';var path=require(_0xe778('0x0'));var express=require('express');var errors=require(_0xe778('0x1'));var config=require('./config/environment');var setupLoggers=require(_0xe778('0x2'))['setupLoggers'];var clientSideLogs=require(_0xe778('0x3'));exports[_0xe778('0x4')]=function(_0x5af2fc){return setupLoggers(_0x5af2fc)[_0xe778('0x5')](function(){_0x5af2fc[_0xe778('0x6')](_0xe778('0x7'),require(_0xe778('0x8')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x9'),require(_0xe778('0xa')));_0x5af2fc['use'](_0xe778('0xb'),require(_0xe778('0xc')));_0x5af2fc['use'](_0xe778('0xd'),require(_0xe778('0xe')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xf'),require(_0xe778('0x10')));_0x5af2fc['use']('/api/voice/queues',require('./api/voiceQueue'));_0x5af2fc[_0xe778('0x6')]('/api/voice/recordings',require(_0xe778('0x11')));_0x5af2fc[_0xe778('0x6')]('/api/screen/recordings',require(_0xe778('0x12')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x13'),require('./api/voiceMail'));_0x5af2fc['use'](_0xe778('0x14'),require(_0xe778('0x15')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x16'),require(_0xe778('0x17')));_0x5af2fc['use'](_0xe778('0x18'),require(_0xe778('0x19')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x1a'),require(_0xe778('0x1b')));_0x5af2fc['use']('/api/voice/queues/reports',require(_0xe778('0x1c')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x1d'),require(_0xe778('0x1e')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x1f'),require(_0xe778('0x20')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x21'),require(_0xe778('0x22')));_0x5af2fc[_0xe778('0x6')]('/api/mail/out_servers',require(_0xe778('0x23')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x24'),require('./api/mailAccount'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x25'),require('./api/mailQueue'));_0x5af2fc['use']('/api/mail/substatuses',require(_0xe778('0x26')));_0x5af2fc[_0xe778('0x6')]('/api/mail/interactions',require(_0xe778('0x27')));_0x5af2fc[_0xe778('0x6')]('/api/mail/messages',require(_0xe778('0x28')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x29'),require(_0xe778('0x2a')));_0x5af2fc['use'](_0xe778('0x2b'),require('./api/mailQueueReport'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x2c'),require(_0xe778('0x2d')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x2e'),require('./api/dashboardItem'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x2f'),require(_0xe778('0x30')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x31'),require(_0xe778('0x32')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x33'),require(_0xe778('0x34')));_0x5af2fc['use'](_0xe778('0x35'),require(_0xe778('0x36')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x37'),require(_0xe778('0x38')));_0x5af2fc[_0xe778('0x6')]('/api/fax/reports/queue',require(_0xe778('0x39')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x3a'),require(_0xe778('0x3b')));_0x5af2fc[_0xe778('0x6')]('/api/sms/applications',require(_0xe778('0x3c')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x3d'),require('./api/smsInteraction'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x3e'),require('./api/smsMessage'));_0x5af2fc['use'](_0xe778('0x3f'),require(_0xe778('0x40')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x41'),require(_0xe778('0x42')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x43'),require('./api/openchannelApplication'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x44'),require('./api/openchannelInteraction'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x45'),require('./api/openchannelMessage'));_0x5af2fc['use']('/api/openchannel/queues',require(_0xe778('0x46')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x47'),require('./api/chatWebsite'));_0x5af2fc[_0xe778('0x6')]('/api/openchannel/reports/queue',require(_0xe778('0x48')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x49'),require(_0xe778('0x4a')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x4b'),require('./api/chatInteraction'));_0x5af2fc[_0xe778('0x6')]('/api/chat/messages',require(_0xe778('0x4c')));_0x5af2fc[_0xe778('0x6')]('/api/chat/offline_messages',require(_0xe778('0x4d')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x4e'),require(_0xe778('0x4f')));_0x5af2fc['use'](_0xe778('0x50'),require(_0xe778('0x51')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x52'),require(_0xe778('0x53')));_0x5af2fc['use']('/api/cm/companies',require('./api/cmCompany'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x54'),require(_0xe778('0x55')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x56'),require(_0xe778('0x57')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x58'),require(_0xe778('0x59')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x5a'),require(_0xe778('0x5b')));_0x5af2fc[_0xe778('0x6')]('/api/cm/hopper_history',require(_0xe778('0x5c')));_0x5af2fc['use'](_0xe778('0x5d'),require(_0xe778('0x5e')));_0x5af2fc[_0xe778('0x6')]('/api/actions',require(_0xe778('0x5f')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x60'),require(_0xe778('0x61')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x62'),require(_0xe778('0x63')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x64'),require(_0xe778('0x65')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x66'),require(_0xe778('0x67')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x68'),require('./api/interval'));_0x5af2fc['use']('/api/pauses',require('./api/pause'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x69'),require('./api/cdr'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x6a'),require('./api/voiceQueuesLog'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x6b'),require('./api/schedule'));_0x5af2fc[_0xe778('0x6')](_0xe778('0x6c'),require('./api/sound'));_0x5af2fc[_0xe778('0x6')]('/api/tags',require(_0xe778('0x6d')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x6e'),require(_0xe778('0x6f')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x70'),require('./api/cmContactHasItem'));_0x5af2fc['use'](_0xe778('0x71'),require(_0xe778('0x72')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x73'),require(_0xe778('0x74')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x75'),require(_0xe778('0x76')));_0x5af2fc['use'](_0xe778('0x77'),require(_0xe778('0x78')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x79'),require(_0xe778('0x7a')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x7b'),require(_0xe778('0x7c')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x7d'),require('./api/analyticCustomReport'));_0x5af2fc[_0xe778('0x6')]('/api/analytics/default_reports',require(_0xe778('0x7e')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x7f'),require('./api/analyticExtractedReport'));_0x5af2fc['use'](_0xe778('0x80'),require(_0xe778('0x81')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x82'),require(_0xe778('0x83')));_0x5af2fc['use'](_0xe778('0x84'),require(_0xe778('0x85')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x86'),require(_0xe778('0x87')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x88'),require(_0xe778('0x89')));_0x5af2fc['use']('/api/integrations/salesforce/fields',require(_0xe778('0x8a')));_0x5af2fc[_0xe778('0x6')]('/api/integrations/sugarcrm/accounts',require(_0xe778('0x8b')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x8c'),require(_0xe778('0x8d')));_0x5af2fc['use'](_0xe778('0x8e'),require('./api/intSugarcrmField'));_0x5af2fc['use'](_0xe778('0x8f'),require(_0xe778('0x90')));_0x5af2fc[_0xe778('0x6')]('/api/integrations/desk/configurations',require(_0xe778('0x91')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x92'),require(_0xe778('0x93')));_0x5af2fc[_0xe778('0x6')]('/api/integrations/zoho/accounts',require(_0xe778('0x94')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x95'),require(_0xe778('0x96')));_0x5af2fc[_0xe778('0x6')]('/api/integrations/zoho/fields',require(_0xe778('0x97')));_0x5af2fc[_0xe778('0x6')]('/api/integrations/zendesk/accounts',require(_0xe778('0x98')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x99'),require('./api/intZendeskConfiguration'));_0x5af2fc[_0xe778('0x6')]('/api/integrations/zendesk/fields',require(_0xe778('0x9a')));_0x5af2fc[_0xe778('0x6')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x5af2fc['use'](_0xe778('0x9b'),require(_0xe778('0x9c')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x9d'),require(_0xe778('0x9e')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x9f'),require(_0xe778('0xa0')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xa1'),require(_0xe778('0xa2')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xa3'),require(_0xe778('0xa4')));_0x5af2fc['use'](_0xe778('0xa5'),require('./api/intServicenowAccount'));_0x5af2fc[_0xe778('0x6')](_0xe778('0xa6'),require(_0xe778('0xa7')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xa8'),require(_0xe778('0xa9')));_0x5af2fc[_0xe778('0x6')]('/api/integrations/dynamics365/accounts',require(_0xe778('0xaa')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xab'),require('./api/intDynamics365Configuration'));_0x5af2fc[_0xe778('0x6')](_0xe778('0xac'),require('./api/intDynamics365Field'));_0x5af2fc['use'](_0xe778('0xad'),require(_0xe778('0xae')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xaf'),require('./api/intFreshsalesConfiguration'));_0x5af2fc['use']('/api/integrations/freshsales/fields',require(_0xe778('0xb0')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xb1'),require('./api/network'));_0x5af2fc[_0xe778('0x6')]('/api/chat/reports/queue',require(_0xe778('0xb2')));_0x5af2fc[_0xe778('0x6')]('/api/chat/internal/messages',require(_0xe778('0xb3')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xb4'),require(_0xe778('0xb5')));_0x5af2fc['use'](_0xe778('0xb6'),require(_0xe778('0xb7')));_0x5af2fc['use'](_0xe778('0xb8'),require('./api/jscriptySessionReport'));_0x5af2fc[_0xe778('0x6')]('/api/sms/reports/queue',require(_0xe778('0xb9')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xba'),require('./api/squareReport'));_0x5af2fc[_0xe778('0x6')]('/api/square/details/reports',require(_0xe778('0xbb')));_0x5af2fc[_0xe778('0x6')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x5af2fc[_0xe778('0x6')]('/api/settings',require(_0xe778('0xbc')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xbd'),require(_0xe778('0xbe')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xbf'),require(_0xe778('0xc0')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xc1'),require(_0xe778('0xc2')));_0x5af2fc['use'](_0xe778('0xc3'),require('./api/squareMessage'));_0x5af2fc[_0xe778('0x6')](_0xe778('0xc4'),require(_0xe778('0xc5')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xc6'),require('./api/license'));_0x5af2fc[_0xe778('0x6')](_0xe778('0xc7'),require(_0xe778('0xc8')));_0x5af2fc['use']('/api/migrations',require(_0xe778('0xc9')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xca'),require(_0xe778('0xcb')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xcc'),require(_0xe778('0xcd')));_0x5af2fc['use'](_0xe778('0xce'),require(_0xe778('0xcf')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xd0'),require(_0xe778('0xd1')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xd2'),require(_0xe778('0xd3')));_0x5af2fc['use'](_0xe778('0xd4'),require(_0xe778('0xd5')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xd6'),require(_0xe778('0xd7')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xd8'),require('./api/cmList'));_0x5af2fc[_0xe778('0x6')](_0xe778('0xd9'),require(_0xe778('0xda')));_0x5af2fc['use'](_0xe778('0xdb'),require(_0xe778('0xdc')));_0x5af2fc['use']('/api/userProfile/sections',require(_0xe778('0xdd')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xde'),require(_0xe778('0xdf')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xe0'),require(_0xe778('0xe1')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xe2'),require('./api/whatsappAccount'));_0x5af2fc[_0xe778('0x6')](_0xe778('0xe3'),require('./api/whatsappApplication'));_0x5af2fc[_0xe778('0x6')]('/api/whatsapp/interactions',require(_0xe778('0xe4')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xe5'),require(_0xe778('0xe6')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xe7'),require(_0xe778('0xe8')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xe9'),require(_0xe778('0xea')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xeb'),require(_0xe778('0xec')));_0x5af2fc[_0xe778('0x6')]('/api/cloudProviders',require(_0xe778('0xed')));_0x5af2fc[_0xe778('0x6')]('/api/realtime',require(_0xe778('0xee')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xef'),require(_0xe778('0xf0')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xf1'),require(_0xe778('0xf2')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xf3'),require(_0xe778('0xf4')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xf5'),require(_0xe778('0xf6')));_0x5af2fc['use']('/api/jira',require(_0xe778('0xf7')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xf8'),require(_0xe778('0xf9')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xfa'),require(_0xe778('0xfb')));_0x5af2fc[_0xe778('0x6')](_0xe778('0xfc'),require('./api/system'));_0x5af2fc['use']('/api/pm2',require(_0xe778('0xfd')));_0x5af2fc['use'](_0xe778('0xfe'),require(_0xe778('0xff')));_0x5af2fc[_0xe778('0x6')](_0xe778('0x100'),clientSideLogs);_0x5af2fc[_0xe778('0x6')](_0xe778('0x101'),express[_0xe778('0x102')](path[_0xe778('0x103')](config[_0xe778('0x104')],_0xe778('0x101'))));_0x5af2fc[_0xe778('0x6')]('/www',express[_0xe778('0x102')](path[_0xe778('0x103')](config['root'],_0xe778('0x105'))));_0x5af2fc[_0xe778('0x6')](_0xe778('0x106'),express[_0xe778('0x102')](path[_0xe778('0x103')](config['root'],_0xe778('0x106'))));_0x5af2fc[_0xe778('0x6')]('/snippet',express['static'](path[_0xe778('0x103')](config[_0xe778('0x104')],_0xe778('0x107'),_0xe778('0x108'))));_0x5af2fc[_0xe778('0x6')](_0xe778('0x109'),express[_0xe778('0x102')](path['join'](config[_0xe778('0x104')],_0xe778('0x10a'))));_0x5af2fc['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x5af2fc[_0xe778('0x10b')]('/*')[_0xe778('0x10c')](function(_0x48d7bd,_0x26d86a){_0x26d86a[_0xe778('0x10d')](path[_0xe778('0x10e')](_0x5af2fc['get'](_0xe778('0x10f'))+_0xe778('0x110')));});return _0x5af2fc;});}; \ No newline at end of file +var _0xfc98=['./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','/apidoc','/www','/demo','root','/snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','path','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','/api/users','./api/user','use','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/triggers','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations'];(function(_0x2e5af3,_0x3b372e){var _0x585a37=function(_0x4728f9){while(--_0x4728f9){_0x2e5af3['push'](_0x2e5af3['shift']());}};_0x585a37(++_0x3b372e);}(_0xfc98,0x176));var _0x8fc9=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xfc98[_0x1b2ff7];return _0x31656a;};'use strict';var path=require(_0x8fc9('0x0'));var express=require('express');var errors=require(_0x8fc9('0x1'));var config=require(_0x8fc9('0x2'));var setupLoggers=require(_0x8fc9('0x3'))[_0x8fc9('0x4')];var clientSideLogs=require(_0x8fc9('0x5'));exports['default']=function(_0x236bd2){return setupLoggers(_0x236bd2)[_0x8fc9('0x6')](function(){_0x236bd2['use'](_0x8fc9('0x7'),require(_0x8fc9('0x8')));_0x236bd2[_0x8fc9('0x9')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x236bd2['use'](_0x8fc9('0xa'),require('./api/voiceContext'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xb'),require(_0x8fc9('0xc')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xd'),require(_0x8fc9('0xe')));_0x236bd2[_0x8fc9('0x9')]('/api/voice/queues',require('./api/voiceQueue'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xf'),require(_0x8fc9('0x10')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x11'),require('./api/screenRecording'));_0x236bd2['use'](_0x8fc9('0x12'),require(_0x8fc9('0x13')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x14'),require(_0x8fc9('0x15')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x16'),require(_0x8fc9('0x17')));_0x236bd2[_0x8fc9('0x9')]('/api/voice/dials/reports',require(_0x8fc9('0x18')));_0x236bd2['use'](_0x8fc9('0x19'),require(_0x8fc9('0x1a')));_0x236bd2[_0x8fc9('0x9')]('/api/voice/queues/reports',require(_0x8fc9('0x1b')));_0x236bd2['use'](_0x8fc9('0x1c'),require(_0x8fc9('0x1d')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x1e'),require('./api/trunk'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x1f'),require(_0x8fc9('0x20')));_0x236bd2['use'](_0x8fc9('0x21'),require(_0x8fc9('0x22')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x23'),require('./api/mailAccount'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x24'),require(_0x8fc9('0x25')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x26'),require(_0x8fc9('0x27')));_0x236bd2[_0x8fc9('0x9')]('/api/mail/interactions',require('./api/mailInteraction'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x28'),require(_0x8fc9('0x29')));_0x236bd2['use'](_0x8fc9('0x2a'),require(_0x8fc9('0x2b')));_0x236bd2[_0x8fc9('0x9')]('/api/mail/reports/queue',require(_0x8fc9('0x2c')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x2d'),require(_0x8fc9('0x2e')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x2f'),require(_0x8fc9('0x30')));_0x236bd2[_0x8fc9('0x9')]('/api/fax/accounts',require(_0x8fc9('0x31')));_0x236bd2['use']('/api/fax/applications',require(_0x8fc9('0x32')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x33'),require(_0x8fc9('0x34')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x35'),require(_0x8fc9('0x36')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x37'),require(_0x8fc9('0x38')));_0x236bd2[_0x8fc9('0x9')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x236bd2[_0x8fc9('0x9')]('/api/sms/accounts',require(_0x8fc9('0x39')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x3a'),require(_0x8fc9('0x3b')));_0x236bd2['use'](_0x8fc9('0x3c'),require(_0x8fc9('0x3d')));_0x236bd2[_0x8fc9('0x9')]('/api/sms/messages',require('./api/smsMessage'));_0x236bd2['use'](_0x8fc9('0x3e'),require(_0x8fc9('0x3f')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x40'),require(_0x8fc9('0x41')));_0x236bd2['use'](_0x8fc9('0x42'),require(_0x8fc9('0x43')));_0x236bd2[_0x8fc9('0x9')]('/api/openchannel/interactions',require(_0x8fc9('0x44')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x45'),require(_0x8fc9('0x46')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x47'),require(_0x8fc9('0x48')));_0x236bd2[_0x8fc9('0x9')]('/api/chat/websites',require(_0x8fc9('0x49')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x4a'),require(_0x8fc9('0x4b')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x4c'),require(_0x8fc9('0x4d')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x4e'),require(_0x8fc9('0x4f')));_0x236bd2['use'](_0x8fc9('0x50'),require(_0x8fc9('0x51')));_0x236bd2[_0x8fc9('0x9')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x236bd2[_0x8fc9('0x9')]('/api/chat/queues',require(_0x8fc9('0x52')));_0x236bd2['use']('/api/chat/groups',require(_0x8fc9('0x53')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x54'),require('./api/chatProactiveAction'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x55'),require('./api/cmCompany'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x56'),require('./api/cmContact'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x57'),require(_0x8fc9('0x58')));_0x236bd2[_0x8fc9('0x9')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x59'),require('./api/cmHopperFinal'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x5a'),require(_0x8fc9('0x5b')));_0x236bd2['use'](_0x8fc9('0x5c'),require('./api/cmCustomField'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x5d'),require('./api/action'));_0x236bd2[_0x8fc9('0x9')]('/api/automations',require(_0x8fc9('0x5e')));_0x236bd2['use'](_0x8fc9('0x5f'),require(_0x8fc9('0x60')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x61'),require(_0x8fc9('0x62')));_0x236bd2['use'](_0x8fc9('0x63'),require('./api/condition'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x64'),require(_0x8fc9('0x65')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x66'),require(_0x8fc9('0x67')));_0x236bd2['use'](_0x8fc9('0x68'),require(_0x8fc9('0x69')));_0x236bd2['use'](_0x8fc9('0x6a'),require(_0x8fc9('0x6b')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x6c'),require(_0x8fc9('0x6d')));_0x236bd2[_0x8fc9('0x9')]('/api/sounds',require(_0x8fc9('0x6e')));_0x236bd2['use'](_0x8fc9('0x6f'),require(_0x8fc9('0x70')));_0x236bd2['use']('/api/contact_item_types',require(_0x8fc9('0x71')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x72'),require(_0x8fc9('0x73')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x74'),require(_0x8fc9('0x75')));_0x236bd2['use']('/api/templates',require('./api/template'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x76'),require('./api/trigger'));_0x236bd2[_0x8fc9('0x9')]('/api/variables',require(_0x8fc9('0x77')));_0x236bd2[_0x8fc9('0x9')]('/api/integrations',require(_0x8fc9('0x78')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x79'),require(_0x8fc9('0x7a')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x7b'),require(_0x8fc9('0x7c')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x7d'),require(_0x8fc9('0x7e')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x7f'),require(_0x8fc9('0x80')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x81'),require(_0x8fc9('0x82')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x83'),require(_0x8fc9('0x84')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x85'),require(_0x8fc9('0x86')));_0x236bd2['use'](_0x8fc9('0x87'),require('./api/intSalesforceAccount'));_0x236bd2[_0x8fc9('0x9')]('/api/integrations/salesforce/configurations',require(_0x8fc9('0x88')));_0x236bd2['use']('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x89'),require(_0x8fc9('0x8a')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x8b'),require('./api/intSugarcrmConfiguration'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x8c'),require(_0x8fc9('0x8d')));_0x236bd2[_0x8fc9('0x9')]('/api/integrations/desk/accounts',require(_0x8fc9('0x8e')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x8f'),require(_0x8fc9('0x90')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x91'),require('./api/intDeskField'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x92'),require(_0x8fc9('0x93')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x94'),require(_0x8fc9('0x95')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x96'),require(_0x8fc9('0x97')));_0x236bd2['use'](_0x8fc9('0x98'),require(_0x8fc9('0x99')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x9a'),require(_0x8fc9('0x9b')));_0x236bd2[_0x8fc9('0x9')]('/api/integrations/zendesk/fields',require(_0x8fc9('0x9c')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x9d'),require(_0x8fc9('0x9e')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x9f'),require(_0x8fc9('0xa0')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xa1'),require(_0x8fc9('0xa2')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xa3'),require(_0x8fc9('0xa4')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xa5'),require(_0x8fc9('0xa6')));_0x236bd2['use'](_0x8fc9('0xa7'),require(_0x8fc9('0xa8')));_0x236bd2['use'](_0x8fc9('0xa9'),require(_0x8fc9('0xaa')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xab'),require(_0x8fc9('0xac')));_0x236bd2[_0x8fc9('0x9')]('/api/integrations/servicenow/fields',require(_0x8fc9('0xad')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xae'),require('./api/intDynamics365Account'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xaf'),require(_0x8fc9('0xb0')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xb1'),require(_0x8fc9('0xb2')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xb3'),require('./api/intFreshsalesAccount'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xb4'),require(_0x8fc9('0xb5')));_0x236bd2[_0x8fc9('0x9')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xb6'),require(_0x8fc9('0xb7')));_0x236bd2[_0x8fc9('0x9')]('/api/chat/reports/queue',require(_0x8fc9('0xb8')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xb9'),require('./api/chatInternalMessage'));_0x236bd2[_0x8fc9('0x9')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x236bd2['use'](_0x8fc9('0xba'),require(_0x8fc9('0xbb')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xbc'),require('./api/jscriptySessionReport'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xbd'),require(_0x8fc9('0xbe')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xbf'),require(_0x8fc9('0xc0')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xc1'),require(_0x8fc9('0xc2')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xc3'),require(_0x8fc9('0xc4')));_0x236bd2[_0x8fc9('0x9')]('/api/settings',require('./api/setting'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xc5'),require(_0x8fc9('0xc6')));_0x236bd2['use'](_0x8fc9('0xc7'),require(_0x8fc9('0xc8')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xc9'),require(_0x8fc9('0xca')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xcb'),require(_0x8fc9('0xcc')));_0x236bd2['use'](_0x8fc9('0xcd'),require('./api/team'));_0x236bd2[_0x8fc9('0x9')]('/api/license',require(_0x8fc9('0xce')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xcf'),require(_0x8fc9('0xd0')));_0x236bd2['use'](_0x8fc9('0xd1'),require('./api/migration'));_0x236bd2[_0x8fc9('0x9')]('/api/attachments',require(_0x8fc9('0xd2')));_0x236bd2[_0x8fc9('0x9')]('/api/plugins',require('./api/plugin'));_0x236bd2[_0x8fc9('0x9')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xd3'),require(_0x8fc9('0xd4')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xd5'),require(_0x8fc9('0xd6')));_0x236bd2['use'](_0x8fc9('0xd7'),require(_0x8fc9('0xd8')));_0x236bd2['use'](_0x8fc9('0xd9'),require(_0x8fc9('0xda')));_0x236bd2[_0x8fc9('0x9')]('/api/cm/lists',require(_0x8fc9('0xdb')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xdc'),require(_0x8fc9('0xdd')));_0x236bd2[_0x8fc9('0x9')]('/api/userProfiles',require(_0x8fc9('0xde')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xdf'),require(_0x8fc9('0xe0')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xe1'),require(_0x8fc9('0xe2')));_0x236bd2['use'](_0x8fc9('0xe3'),require(_0x8fc9('0xe4')));_0x236bd2['use'](_0x8fc9('0xe5'),require(_0x8fc9('0xe6')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xe7'),require(_0x8fc9('0xe8')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xe9'),require('./api/whatsappInteraction'));_0x236bd2[_0x8fc9('0x9')]('/api/whatsapp/messages',require(_0x8fc9('0xea')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xeb'),require(_0x8fc9('0xec')));_0x236bd2[_0x8fc9('0x9')]('/api/whatsapp/reports/transfer',require(_0x8fc9('0xed')));_0x236bd2[_0x8fc9('0x9')]('/api/whatsapp/queues',require(_0x8fc9('0xee')));_0x236bd2['use'](_0x8fc9('0xef'),require(_0x8fc9('0xf0')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xf1'),require(_0x8fc9('0xf2')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xf3'),require('./api/user-setting'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xf4'),require('./api/authLocal'));_0x236bd2['use'](_0x8fc9('0xf5'),require(_0x8fc9('0xf6')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xf7'),require(_0x8fc9('0xf8')));_0x236bd2['use'](_0x8fc9('0xf9'),require('./api/jira'));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xfa'),require('./api/rpc'));_0x236bd2['use'](_0x8fc9('0xfb'),require(_0x8fc9('0xfc')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xfd'),require(_0x8fc9('0xfe')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0xff'),require(_0x8fc9('0x100')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x101'),require(_0x8fc9('0x102')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x103'),clientSideLogs);_0x236bd2['use']('/apidoc',express[_0x8fc9('0x104')](path[_0x8fc9('0x105')](config['root'],_0x8fc9('0x106'))));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x107'),express[_0x8fc9('0x104')](path[_0x8fc9('0x105')](config['root'],'/www')));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x108'),express[_0x8fc9('0x104')](path[_0x8fc9('0x105')](config[_0x8fc9('0x109')],_0x8fc9('0x108'))));_0x236bd2['use'](_0x8fc9('0x10a'),express['static'](path[_0x8fc9('0x105')](config[_0x8fc9('0x109')],'snippet',_0x8fc9('0x10b'))));_0x236bd2[_0x8fc9('0x9')](_0x8fc9('0x10c'),express[_0x8fc9('0x104')](path['join'](config['root'],'/server/files/plugins')));_0x236bd2[_0x8fc9('0x10d')](_0x8fc9('0x10e'))[_0x8fc9('0x10f')](errors[0x194]);_0x236bd2[_0x8fc9('0x10d')]('/*')[_0x8fc9('0x10f')](function(_0x29e575,_0x253019){_0x253019[_0x8fc9('0x110')](path[_0x8fc9('0x111')](_0x236bd2['get'](_0x8fc9('0x112'))+'/index.html'));});return _0x236bd2;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b8b6e1a..abaf22b 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81c8=['listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.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/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment'];(function(_0x490d5f,_0x5c4074){var _0x1a9aae=function(_0x3ae930){while(--_0x3ae930){_0x490d5f['push'](_0x490d5f['shift']());}};_0x1a9aae(++_0x5c4074);}(_0x81c8,0x1dd));var _0x881c=function(_0x3f03c5,_0x177741){_0x3f03c5=_0x3f03c5-0x0;var _0x2b5c24=_0x81c8[_0x3f03c5];return _0x2b5c24;};'use strict';var jayson=require(_0x881c('0x0'));var _=require(_0x881c('0x1'));var config=require(_0x881c('0x2'));exports[_0x881c('0x3')]=function(){return new Promise(function(_0x5c16c5,_0x2568df){var _0x92bc82={};_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/user/user.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x5')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x6')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x7')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x8')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x9')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0xa')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0xb')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0xc')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/trunk/trunk.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0xd')));_0x92bc82=_['merge'](_0x92bc82,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0xe')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/mailAccount/mailAccount.rpc'));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0xf')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x10')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x11')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x12')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x13')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x14')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/faxApplication/faxApplication.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/faxInteraction/faxInteraction.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x15')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x16')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x17')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x18')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/smsInteraction/smsInteraction.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x19')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x1a')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x1b')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x1c')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x1d')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x1e')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x1f')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x20')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x21')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x22')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/cmContact/cmContact.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/cmHopper/cmHopper.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x23')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x24')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x25')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x26')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x27')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x28')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x29')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x2a')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x2b')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x2c')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x2d')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x2e')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x2f')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x30')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x31')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x32')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x33')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x34')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x35')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x36')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x37')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x38')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x39')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x3a')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require('../api/setting/setting.rpc'));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x3b')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x3c')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x3d')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x3e')));_0x92bc82=_['merge'](_0x92bc82,require(_0x881c('0x3f')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x40')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x41')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x42')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x43')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x44')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x45')));_0x92bc82=_[_0x881c('0x4')](_0x92bc82,require(_0x881c('0x46')));var _0x1ed929=jayson[_0x881c('0x47')](_0x92bc82)[_0x881c('0x48')]();var _0x3acb59=config['rpc'][_0x881c('0x49')]||config[_0x881c('0x49')]+0x1;var _0x2fc974=config[_0x881c('0x4a')]['ip']||'localhost';_0x1ed929['on'](_0x881c('0x4b'),function(_0x43fa8a){return _0x2568df(_0x43fa8a);});_0x1ed929[_0x881c('0x3')](_0x3acb59,_0x2fc974,function(){console[_0x881c('0x4c')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x2fc974,_0x3acb59);require(_0x881c('0x4d'))[_0x881c('0x4e')]();return _0x5c16c5(_0x881c('0x4f')+_0x2fc974+':'+_0x3acb59);});});}; \ No newline at end of file +var _0x5f4b=['../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.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','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','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/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc'];(function(_0x59c135,_0x2324ac){var _0x1603eb=function(_0x9319a4){while(--_0x9319a4){_0x59c135['push'](_0x59c135['shift']());}};_0x1603eb(++_0x2324ac);}(_0x5f4b,0x19a));var _0xb5f4=function(_0x53abca,_0x82ec03){_0x53abca=_0x53abca-0x0;var _0x3d815d=_0x5f4b[_0x53abca];return _0x3d815d;};'use strict';var jayson=require(_0xb5f4('0x0'));var _=require(_0xb5f4('0x1'));var config=require(_0xb5f4('0x2'));exports[_0xb5f4('0x3')]=function(){return new Promise(function(_0x3c6897,_0x2472d2){var _0x4e1a9d={};_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x5')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x6')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x7')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/voiceRecording/voiceRecording.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x8')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x9')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0xa')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0xb')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0xc')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/trunk/trunk.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0xd')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0xe')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0xf')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x10')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x11')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x12')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x13')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x14')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x15')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x16')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x17')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x18')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x19')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x1a')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x1b')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x1c')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x1d')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/smsQueue/smsQueue.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4e1a9d=_['merge'](_0x4e1a9d,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x1e')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x1f')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x20')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/chatInteraction/chatInteraction.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/chatMessage/chatMessage.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x21')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x22')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x23')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x24')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x25')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x26')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x27')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/pause/pause.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/sound/sound.rpc'));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x28')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x29')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x2a')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x2b')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x2c')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x2d')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x2e')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x2f')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x30')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x31')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x32')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x33')));_0x4e1a9d=_['merge'](_0x4e1a9d,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x34')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x35')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x36')));_0x4e1a9d=_['merge'](_0x4e1a9d,require('../api/squareOdbc/squareOdbc.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x37')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x38')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/squareMessage/squareMessage.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x39')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x3a')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x3b')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x3c')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require(_0xb5f4('0x3d')));_0x4e1a9d=_['merge'](_0x4e1a9d,require(_0xb5f4('0x3e')));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4e1a9d=_[_0xb5f4('0x4')](_0x4e1a9d,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x1a6fbf=jayson[_0xb5f4('0x3f')](_0x4e1a9d)[_0xb5f4('0x40')]();var _0x444033=config[_0xb5f4('0x41')][_0xb5f4('0x42')]||config[_0xb5f4('0x42')]+0x1;var _0x2dccff=config[_0xb5f4('0x41')]['ip']||_0xb5f4('0x43');_0x1a6fbf['on'](_0xb5f4('0x44'),function(_0x1861f1){return _0x2472d2(_0x1861f1);});_0x1a6fbf[_0xb5f4('0x3')](_0x444033,_0x2dccff,function(){console['log'](_0xb5f4('0x45'),_0x2dccff,_0x444033);require(_0xb5f4('0x46'))[_0xb5f4('0x47')]();return _0x3c6897(_0xb5f4('0x48')+_0x2dccff+':'+_0x444033);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 55b702e..4f03a51 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 _0x58d3=['replace','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','close','destroy','inherits','sendRequest','prototype','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','EventEmitter','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search'];(function(_0x5d9ae1,_0x5d431d){var _0x1e8d59=function(_0x1179c5){while(--_0x1179c5){_0x5d9ae1['push'](_0x5d9ae1['shift']());}};_0x1e8d59(++_0x5d431d);}(_0x58d3,0xd4));var _0x358d=function(_0x5e95c1,_0x38cbba){_0x5e95c1=_0x5e95c1-0x0;var _0x4a0676=_0x58d3[_0x5e95c1];return _0x4a0676;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require('events')[_0x358d('0x0')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x4cec6b){var _0x1d3e1f=this,_0x7d4862=new AGIReply(),_0x274886=![],_0x173912={};EventEmitter[_0x358d('0x1')](_0x1d3e1f);_0x4cec6b[_0x358d('0x2')](_0x358d('0x3'));_0x4cec6b[_0x358d('0x4')](0x8*0x3c*0x3c*0x3e8);_0x7d4862[_0x358d('0x2')](_0x358d('0x3'));_0x7d4862['on']('headers',function(_0x20180a){for(var _0x4dc0cf in _0x20180a){_0x1d3e1f[_0x4dc0cf]=_0x20180a[_0x4dc0cf];}_0x1d3e1f[_0x358d('0x5')](_0x358d('0x6'));});_0x7d4862['on'](_0x358d('0x7'),function(_0x3bda14){if(_0x3bda14[_0x358d('0x8')]()==_0x358d('0x9')){_0x1d3e1f[_0x358d('0x5')](_0x358d('0x9'));return;}if(_0x3bda14[_0x358d('0xa')](0x0,0xb)==_0x358d('0xb')){_0x274886=!![];}if(_0x274886){_0x173912['rx']+=_0x3bda14+'\x0a';if(_0x3bda14[_0x358d('0xc')]('520\x20End\x20of\x20proper')!=-0x1){_0x274886=![];}}else{_0x173912['rx']=_0x3bda14;}if(_0x274886){return;}if(typeof _0x173912['cb']=='function'){var _0xa3a0a2=_0x173912['rx']['substring'](0x0,0x3),_0x1cade7=null,_0x362b7f=null;_0xa3a0a2=parseInt(_0xa3a0a2);if(isNaN(_0xa3a0a2)){_0x173912['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xa3a0a2!=0xc8){_0x173912['cb'](null,{'code':_0xa3a0a2,'result':-0x1,'extra':'KO'});return;}_0x1cade7=_0x173912['rx']['substring'](0x4)[_0x358d('0xd')]('result=','');if(_0x1cade7['indexOf']('\x20')!=-0x1){_0x1cade7=_0x1cade7[_0x358d('0xe')](0x0,_0x1cade7[_0x358d('0xf')]('\x20'));}if(_[_0x358d('0x10')](_0x1cade7,'-1')){_0x1cade7=parseInt(_0x1cade7);}_0x362b7f=_0x173912['rx'][_0x358d('0x11')]('\x20');if(_0x362b7f[_0x358d('0x12')]==0x3){_0x362b7f=_0x362b7f[0x2][_0x358d('0xa')](0x1,_0x362b7f[0x2][_0x358d('0x12')]-0x1);}else if(_0x362b7f[_0x358d('0x12')]>0x3){var _0x51103a=/\((.+)\)/;var _0x19b014=_0x173912['rx'][_0x358d('0x13')](_0x51103a);if(_0x19b014){_0x362b7f=_0x19b014[0x1];}else{_0x362b7f=null;}}else{_0x362b7f=null;}_0x173912['cb'](null,{'code':_0xa3a0a2,'result':_0x1cade7,'extra':_0x362b7f});}});_0x4cec6b['on'](_0x358d('0x14'),function(_0x3105dd){_0x1d3e1f[_0x358d('0x5')](_0x358d('0x14'),new AGIError(_0x358d('0x15'),_0x3105dd[_0x358d('0x16')]));});_0x4cec6b['on']('close',function(){_0x1d3e1f[_0x358d('0x5')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4cec6b['on'](_0x358d('0x17'),function(){_0x1d3e1f[_0x358d('0x5')](_0x358d('0x17'),new AGIError(_0x358d('0x18')));_0x4cec6b['destroy']();});_0x4cec6b[_0x358d('0x19')](_0x7d4862);this[_0x358d('0x1a')]=function(_0x4cb257,_0x39e62a){var _0x4cb257=_0x4cb257||'',_0x39e62a=typeof _0x39e62a=='function'?_0x39e62a:new Function();_0x173912={'tx':_0x4cb257,'rx':'','cb':_0x39e62a};_0x4cec6b[_0x358d('0x1b')](_0x4cb257+'\x0a');},this[_0x358d('0x1c')]=function(){_0x4cec6b[_0x358d('0x1d')]();};}util[_0x358d('0x1e')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x358d('0x1f')]=function(_0x53ab5f){return this[_0x358d('0x1a')]['sync'](this,_0x53ab5f);};AGIChannel[_0x358d('0x20')][_0x358d('0x21')]=function(){return this['sendRequest'](_0x358d('0x22'));};AGIChannel[_0x358d('0x20')][_0x358d('0x23')]=function(_0x119585,_0x5e4e49,_0x2c4988){_0x119585=_0x119585===undefined?_0x358d('0x24'):_0x119585;_0x5e4e49=_0x5e4e49===undefined?'5':_0x5e4e49;_0x2c4988=_0x2c4988===undefined?'1':_0x2c4988;return this[_0x358d('0x1f')](util[_0x358d('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x119585,_0x5e4e49*0x3e8,_0x2c4988));};AGIChannel['prototype'][_0x358d('0x26')]=function(_0x9f9e9b){_0x9f9e9b=_0x9f9e9b||_0x358d('0x27');return this[_0x358d('0x1f')](util[_0x358d('0x25')]('VERBOSE\x20\x22%s\x22',_0x9f9e9b));};AGIChannel[_0x358d('0x20')][_0x358d('0x28')]=function(_0x12d76e,_0x3fd3b3){if(_[_0x358d('0x29')](_0x3fd3b3)){return this[_0x358d('0x1f')](util[_0x358d('0x25')](_0x358d('0x2a'),_0x12d76e,_0x3fd3b3[_0x358d('0x2b')](',')));}return this[_0x358d('0x1f')](util[_0x358d('0x25')](_0x358d('0x2a'),_0x12d76e,_0x3fd3b3));};AGIChannel[_0x358d('0x20')][_0x358d('0x2c')]=function(_0x11b1cc){return this['sendRequest'](util[_0x358d('0x25')]('SET\x20CONTEXT\x20%s',_0x11b1cc));};AGIChannel[_0x358d('0x20')][_0x358d('0x2d')]=function(_0x162c8d){return this['sendRequest'](util[_0x358d('0x25')](_0x358d('0x2e'),_0x162c8d));};AGIChannel[_0x358d('0x20')][_0x358d('0x2f')]=function(_0xa50ed2){return this[_0x358d('0x1f')](util[_0x358d('0x25')](_0x358d('0x30'),_0xa50ed2));};AGIChannel[_0x358d('0x20')][_0x358d('0x9')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x358d('0x20')][_0x358d('0x31')]=function(_0xd3b6e2,_0x1ae7cd){var _0x4c8e33=_[_0x358d('0x32')](_0x1ae7cd)||_['isNumber'](_0x1ae7cd)?_0x1ae7cd['toString']():_0x1ae7cd;return this[_0x358d('0x1f')](util['format'](_0x358d('0x33'),_0xd3b6e2,_0x4c8e33?_0x4c8e33[_0x358d('0x34')]()[_0x358d('0xd')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x358d('0x20')][_0x358d('0x35')]=function(_0x5082e3,_0x2d9c3b){return this['sendRequest'](util[_0x358d('0x25')](_0x358d('0x36'),_0x5082e3,_0x2d9c3b));};AGIChannel[_0x358d('0x20')][_0x358d('0x37')]=function(_0x311d2b,_0x505b41){return this[_0x358d('0x1f')](util['format'](_0x358d('0x38'),_0x311d2b,_0x505b41));};AGIChannel[_0x358d('0x20')][_0x358d('0x39')]=function(_0x414ac6,_0x12deaf){return this[_0x358d('0x1f')](util['format'](_0x358d('0x3a'),_0x414ac6,_0x12deaf));};AGIChannel[_0x358d('0x20')][_0x358d('0x3b')]=function(_0x21f4ce,_0x4019c4,_0x3dad01){_0x4019c4=_0x4019c4||this[_0x358d('0x3c')];_0x3dad01=_0x3dad01||0x1;this[_0x358d('0x2c')](_0x21f4ce);this[_0x358d('0x2d')](_0x4019c4);this[_0x358d('0x2f')](_0x3dad01);return this[_0x358d('0x26')](util['format'](_0x358d('0x3d'),_0x21f4ce,_0x4019c4,_0x3dad01));};AGIChannel[_0x358d('0x20')][_0x358d('0x3e')]=function(_0x150b72){return this[_0x358d('0x1f')](util[_0x358d('0x25')](_0x358d('0x3f'),_0x150b72));};AGIChannel[_0x358d('0x20')][_0x358d('0x40')]=function(_0x31a6fc,_0x302fa8,_0x529ec5,_0x36891d,_0xb52600,_0x5da9e6){_0x302fa8=_0x302fa8||_0x358d('0x41');_0x529ec5=_0x529ec5||'';_0x36891d=_0x36891d===undefined?-0x1:_0x36891d==='-1'?-0x1:_0x36891d*0x3e8;_0xb52600=_0xb52600===undefined?'':'s='+_0xb52600;_0x5da9e6=_0x5da9e6?_0x358d('0x42'):'';return this['sendRequest'](util[_0x358d('0x25')](_0x358d('0x43'),_0x31a6fc,_0x302fa8,_0x529ec5,_0x36891d,_0x5da9e6,_0xb52600));};AGIChannel[_0x358d('0x20')]['streamFile']=function(_0x4dd9d2,_0x158cd8){_0x158cd8=_0x158cd8||'';return this['sendRequest'](util['format'](_0x358d('0x44'),_0x4dd9d2,_0x158cd8));};AGIChannel[_0x358d('0x20')][_0x358d('0x45')]=function(_0x246107){return this[_0x358d('0x28')](_0x358d('0x46'),_0x246107);};AGIChannel[_0x358d('0x20')][_0x358d('0x47')]=function(_0x2623a7){return this['exec'](_0x358d('0x48'),_0x2623a7);};AGIChannel['prototype'][_0x358d('0x14')]=function(_0x79cb83,_0x86d83){this[_0x358d('0x26')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x79cb83['id'],_0x79cb83[_0x358d('0x49')],_0x86d83));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x358d('0x4a')]=AGIChannel; \ No newline at end of file +var _0xacf4=['WAIT','label','exports','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','line','toLowerCase','hangup','search','substring','no\x20code','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','write','destroy','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','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'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xacf4,0xe7));var _0x4acf=function(_0x328862,_0x38d3ff){_0x328862=_0x328862-0x0;var _0x2e6079=_0xacf4[_0x328862];return _0x2e6079;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x4acf('0x0'))[_0x4acf('0x1')];var AGIReply=require(_0x4acf('0x2'));var AGIError=require(_0x4acf('0x3'));function AGIChannel(_0x25709c){var _0x4138f0=this,_0x145264=new AGIReply(),_0x5cf22d=![],_0x380435={};EventEmitter[_0x4acf('0x4')](_0x4138f0);_0x25709c['setEncoding'](_0x4acf('0x5'));_0x25709c[_0x4acf('0x6')](0x8*0x3c*0x3c*0x3e8);_0x145264[_0x4acf('0x7')](_0x4acf('0x5'));_0x145264['on'](_0x4acf('0x8'),function(_0x50f5f4){for(var _0x55f61d in _0x50f5f4){_0x4138f0[_0x55f61d]=_0x50f5f4[_0x55f61d];}_0x4138f0[_0x4acf('0x9')]('ready');});_0x145264['on'](_0x4acf('0xa'),function(_0x2c2cb4){if(_0x2c2cb4[_0x4acf('0xb')]()=='hangup'){_0x4138f0[_0x4acf('0x9')](_0x4acf('0xc'));return;}if(_0x2c2cb4['substring'](0x0,0xb)=='520-Invalid'){_0x5cf22d=!![];}if(_0x5cf22d){_0x380435['rx']+=_0x2c2cb4+'\x0a';if(_0x2c2cb4[_0x4acf('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x5cf22d=![];}}else{_0x380435['rx']=_0x2c2cb4;}if(_0x5cf22d){return;}if(typeof _0x380435['cb']=='function'){var _0x1783d2=_0x380435['rx'][_0x4acf('0xe')](0x0,0x3),_0x979f49=null,_0x3734e1=null;_0x1783d2=parseInt(_0x1783d2);if(isNaN(_0x1783d2)){_0x380435['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4acf('0xf')});return;}if(_0x1783d2!=0xc8){_0x380435['cb'](null,{'code':_0x1783d2,'result':-0x1,'extra':'KO'});return;}_0x979f49=_0x380435['rx'][_0x4acf('0xe')](0x4)[_0x4acf('0x10')](_0x4acf('0x11'),'');if(_0x979f49[_0x4acf('0x12')]('\x20')!=-0x1){_0x979f49=_0x979f49[_0x4acf('0x13')](0x0,_0x979f49[_0x4acf('0x12')]('\x20'));}if(_['startsWith'](_0x979f49,'-1')){_0x979f49=parseInt(_0x979f49);}_0x3734e1=_0x380435['rx'][_0x4acf('0x14')]('\x20');if(_0x3734e1['length']==0x3){_0x3734e1=_0x3734e1[0x2][_0x4acf('0xe')](0x1,_0x3734e1[0x2][_0x4acf('0x15')]-0x1);}else if(_0x3734e1[_0x4acf('0x15')]>0x3){var _0x5d934a=/\((.+)\)/;var _0x5207e7=_0x380435['rx'][_0x4acf('0x16')](_0x5d934a);if(_0x5207e7){_0x3734e1=_0x5207e7[0x1];}else{_0x3734e1=null;}}else{_0x3734e1=null;}_0x380435['cb'](null,{'code':_0x1783d2,'result':_0x979f49,'extra':_0x3734e1});}});_0x25709c['on'](_0x4acf('0x17'),function(_0x240c00){_0x4138f0['emit'](_0x4acf('0x17'),new AGIError(_0x4acf('0x18'),_0x240c00[_0x4acf('0x19')]));});_0x25709c['on'](_0x4acf('0x1a'),function(){_0x4138f0[_0x4acf('0x9')](_0x4acf('0x1a'),new AGIError(_0x4acf('0x1b')));});_0x25709c['on'](_0x4acf('0x1c'),function(){_0x4138f0[_0x4acf('0x9')](_0x4acf('0x1c'),new AGIError(_0x4acf('0x1d')));_0x25709c['destroy']();});_0x25709c[_0x4acf('0x1e')](_0x145264);this[_0x4acf('0x1f')]=function(_0x57ea46,_0x41e5d2){var _0x57ea46=_0x57ea46||'',_0x41e5d2=typeof _0x41e5d2==_0x4acf('0x20')?_0x41e5d2:new Function();_0x380435={'tx':_0x57ea46,'rx':'','cb':_0x41e5d2};_0x25709c[_0x4acf('0x21')](_0x57ea46+'\x0a');},this[_0x4acf('0x1a')]=function(){_0x25709c[_0x4acf('0x22')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x4acf('0x23')][_0x4acf('0x24')]=function(_0x57e595){return this[_0x4acf('0x1f')][_0x4acf('0x25')](this,_0x57e595);};AGIChannel['prototype'][_0x4acf('0x26')]=function(){return this[_0x4acf('0x24')](_0x4acf('0x27'));};AGIChannel[_0x4acf('0x23')]['getData']=function(_0x50236d,_0x17a756,_0x3f548a){_0x50236d=_0x50236d===undefined?_0x4acf('0x28'):_0x50236d;_0x17a756=_0x17a756===undefined?'5':_0x17a756;_0x3f548a=_0x3f548a===undefined?'1':_0x3f548a;return this[_0x4acf('0x24')](util[_0x4acf('0x29')](_0x4acf('0x2a'),_0x50236d,_0x17a756*0x3e8,_0x3f548a));};AGIChannel[_0x4acf('0x23')][_0x4acf('0x2b')]=function(_0x382c41){_0x382c41=_0x382c41||_0x4acf('0x2c');return this['sendRequest'](util[_0x4acf('0x29')](_0x4acf('0x2d'),_0x382c41));};AGIChannel[_0x4acf('0x23')][_0x4acf('0x2e')]=function(_0x252cf1,_0x28570f){if(_[_0x4acf('0x2f')](_0x28570f)){return this['sendRequest'](util[_0x4acf('0x29')](_0x4acf('0x30'),_0x252cf1,_0x28570f[_0x4acf('0x31')](',')));}return this['sendRequest'](util[_0x4acf('0x29')](_0x4acf('0x30'),_0x252cf1,_0x28570f));};AGIChannel[_0x4acf('0x23')][_0x4acf('0x32')]=function(_0x53a4f3){return this[_0x4acf('0x24')](util[_0x4acf('0x29')](_0x4acf('0x33'),_0x53a4f3));};AGIChannel['prototype'][_0x4acf('0x34')]=function(_0x34e2ee){return this[_0x4acf('0x24')](util[_0x4acf('0x29')](_0x4acf('0x35'),_0x34e2ee));};AGIChannel[_0x4acf('0x23')]['setPriority']=function(_0x3f7e01){return this[_0x4acf('0x24')](util['format'](_0x4acf('0x36'),_0x3f7e01));};AGIChannel['prototype']['hangup']=function(){return this['sendRequest']('HANGUP');};AGIChannel['prototype']['setVariable']=function(_0x4a8b5a,_0x3364dd){var _0x1b45f6=_['isBoolean'](_0x3364dd)||_[_0x4acf('0x37')](_0x3364dd)?_0x3364dd[_0x4acf('0x38')]():_0x3364dd;return this[_0x4acf('0x24')](util[_0x4acf('0x29')](_0x4acf('0x39'),_0x4a8b5a,_0x1b45f6?_0x1b45f6[_0x4acf('0x38')]()[_0x4acf('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4acf('0x23')][_0x4acf('0x3a')]=function(_0x372bab,_0x4be786){return this['sendRequest'](util[_0x4acf('0x29')](_0x4acf('0x3b'),_0x372bab,_0x4be786));};AGIChannel['prototype'][_0x4acf('0x3c')]=function(_0x40455d,_0x43a2ea){return this[_0x4acf('0x24')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x40455d,_0x43a2ea));};AGIChannel[_0x4acf('0x23')][_0x4acf('0x3d')]=function(_0x3d5529,_0x44b567){return this['sendRequest'](util[_0x4acf('0x29')](_0x4acf('0x3e'),_0x3d5529,_0x44b567));};AGIChannel['prototype']['continueAt']=function(_0x55216a,_0x544fe9,_0x1e1f9c){_0x544fe9=_0x544fe9||this[_0x4acf('0x3f')];_0x1e1f9c=_0x1e1f9c||0x1;this[_0x4acf('0x32')](_0x55216a);this['setExtension'](_0x544fe9);this[_0x4acf('0x40')](_0x1e1f9c);return this[_0x4acf('0x2b')](util[_0x4acf('0x29')](_0x4acf('0x41'),_0x55216a,_0x544fe9,_0x1e1f9c));};AGIChannel[_0x4acf('0x23')][_0x4acf('0x42')]=function(_0x7cf2a){return this[_0x4acf('0x24')](util[_0x4acf('0x29')](_0x4acf('0x43'),_0x7cf2a));};AGIChannel[_0x4acf('0x23')]['recordFile']=function(_0x256145,_0x1fbf5f,_0x164872,_0x194592,_0xf5ebe3,_0x58bc5d){_0x1fbf5f=_0x1fbf5f||'wav';_0x164872=_0x164872||'';_0x194592=_0x194592===undefined?-0x1:_0x194592==='-1'?-0x1:_0x194592*0x3e8;_0xf5ebe3=_0xf5ebe3===undefined?'':'s='+_0xf5ebe3;_0x58bc5d=_0x58bc5d?_0x4acf('0x44'):'';return this[_0x4acf('0x24')](util[_0x4acf('0x29')](_0x4acf('0x45'),_0x256145,_0x1fbf5f,_0x164872,_0x194592,_0x58bc5d,_0xf5ebe3));};AGIChannel[_0x4acf('0x23')][_0x4acf('0x46')]=function(_0x52b411,_0x2e7128){_0x2e7128=_0x2e7128||'';return this['sendRequest'](util[_0x4acf('0x29')](_0x4acf('0x47'),_0x52b411,_0x2e7128));};AGIChannel['prototype']['agi']=function(_0x173dad){return this[_0x4acf('0x2e')](_0x4acf('0x48'),_0x173dad);};AGIChannel[_0x4acf('0x23')]['wait']=function(_0x2f1d23){return this[_0x4acf('0x2e')](_0x4acf('0x49'),_0x2f1d23);};AGIChannel[_0x4acf('0x23')][_0x4acf('0x17')]=function(_0x1afdab,_0x1bd7d0){this[_0x4acf('0x2b')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x1afdab['id'],_0x1afdab[_0x4acf('0x4a')],_0x1bd7d0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4acf('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index ef462b1..94e128b 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 _0x39fb=['format','apply','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','push'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x39fb,0x138));var _0xb39f=function(_0x5023cb,_0x5ae9a6){_0x5023cb=_0x5023cb-0x0;var _0x52c5d6=_0x39fb[_0x5023cb];return _0x52c5d6;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xb39f('0x0'),'E_AGI_ARGUMENT_PORT':_0xb39f('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xb39f('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xb39f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xb39f('0x4'),'E_AGI_SOCKET_ERROR':_0xb39f('0x5'),'E_AGI_SOCKET_CLOSE':_0xb39f('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xb39f('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xb39f('0x8')};function AGIError(_0x39129d){var _0x39129d=_0x39129d||null,_0x5d0b69=_0x5d0b69||[],_0x538f56=0x1,_0x791122='';if(!error[_0x39129d]){_0x39129d='E_AGI_UNDEFINED';}_0x5d0b69[_0xb39f('0x9')](error[_0x39129d]);while(arguments[_0x538f56]){_0x5d0b69['push'](arguments[_0x538f56]);_0x538f56++;}_0x791122=util[_0xb39f('0xa')][_0xb39f('0xb')](util,_0x5d0b69);this['message']=_0x791122;this[_0xb39f('0xc')]=_0x39129d;}module[_0xb39f('0xd')]=AGIError; \ No newline at end of file +var _0x0710=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x4b0f0e,_0x57d1f0){var _0x36acb4=function(_0x595704){while(--_0x595704){_0x4b0f0e['push'](_0x4b0f0e['shift']());}};_0x36acb4(++_0x57d1f0);}(_0x0710,0x8c));var _0x0071=function(_0x5a6d3b,_0x15a93b){_0x5a6d3b=_0x5a6d3b-0x0;var _0x3aaf17=_0x0710[_0x5a6d3b];return _0x3aaf17;};'use strict';var util=require(_0x0071('0x0'));var error={'E_AGI_UNDEFINED':_0x0071('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x0071('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x0071('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x0071('0x4'),'E_AGI_SOCKET_ERROR':_0x0071('0x5'),'E_AGI_SOCKET_CLOSE':_0x0071('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x0071('0x7'),'E_AGI_COMMAND_EMPTY':_0x0071('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0071('0x9'),'E_AGI_IVR_ENTRY':_0x0071('0xa')};function AGIError(_0xc25285){var _0xc25285=_0xc25285||null,_0x43dd86=_0x43dd86||[],_0x3029fb=0x1,_0x50822b='';if(!error[_0xc25285]){_0xc25285='E_AGI_UNDEFINED';}_0x43dd86['push'](error[_0xc25285]);while(arguments[_0x3029fb]){_0x43dd86[_0x0071('0xb')](arguments[_0x3029fb]);_0x3029fb++;}_0x50822b=util[_0x0071('0xc')][_0x0071('0xd')](util,_0x43dd86);this[_0x0071('0xe')]=_0x50822b;this[_0x0071('0xf')]=_0xc25285;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 3df8c1e..6d30bb7 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6333=['events','EventEmitter','ioredis','../../config/environment','redis','defaults','subscribe','agi','error','E_AGI_SERVER_ERROR','parse','emit','exports','lodash'];(function(_0x12e6e5,_0x39855b){var _0x4ef6ce=function(_0x3e06f3){while(--_0x3e06f3){_0x12e6e5['push'](_0x12e6e5['shift']());}};_0x4ef6ce(++_0x39855b);}(_0x6333,0x14f));var _0x3633=function(_0x46e036,_0x37750a){_0x46e036=_0x46e036-0x0;var _0x3144a3=_0x6333[_0x46e036];return _0x3144a3;};'use strict';var _=require(_0x3633('0x0'));var EventEmitter=require(_0x3633('0x1'))[_0x3633('0x2')];var Redis=require(_0x3633('0x3'));var AGIError=require('./error');var config=require(_0x3633('0x4'));config[_0x3633('0x5')]=_[_0x3633('0x6')](config[_0x3633('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x3633('0x5')]);sub[_0x3633('0x7')](_0x3633('0x8'),function(_0x4f2441){if(_0x4f2441)return eventEmitter['emit'](_0x3633('0x9'),new AGIError(_0x3633('0xa'),_0x4f2441));});sub['on']('message',function(_0x5cda91,_0x1c5f78){if(_0x5cda91!==_0x3633('0x8'))return;try{var _0x3f0162=JSON[_0x3633('0xb')](_0x1c5f78);eventEmitter[_0x3633('0xc')]('projectUpdate',_0x3f0162);}catch(_0x5bcbfd){eventEmitter[_0x3633('0xc')](_0x3633('0x9'),new AGIError(_0x3633('0xa'),_0x5bcbfd));}});module[_0x3633('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xa880=['agi','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate','exports','lodash','ioredis','./error','../../config/environment','defaults','redis','localhost','subscribe'];(function(_0x4c5b52,_0x1a945a){var _0x24fce3=function(_0x5be371){while(--_0x5be371){_0x4c5b52['push'](_0x4c5b52['shift']());}};_0x24fce3(++_0x1a945a);}(_0xa880,0x1d8));var _0x0a88=function(_0x19f727,_0x28224e){_0x19f727=_0x19f727-0x0;var _0x412836=_0xa880[_0x19f727];return _0x412836;};'use strict';var _=require(_0x0a88('0x0'));var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0x0a88('0x1'));var AGIError=require(_0x0a88('0x2'));var config=require(_0x0a88('0x3'));config['redis']=_[_0x0a88('0x4')](config[_0x0a88('0x5')],{'host':_0x0a88('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x0a88('0x5')]);sub[_0x0a88('0x7')](_0x0a88('0x8'),function(_0x14da75){if(_0x14da75)return eventEmitter[_0x0a88('0x9')](_0x0a88('0xa'),new AGIError(_0x0a88('0xb'),_0x14da75));});sub['on'](_0x0a88('0xc'),function(_0x1e3142,_0x2bd4de){if(_0x1e3142!==_0x0a88('0x8'))return;try{var _0x55236e=JSON['parse'](_0x2bd4de);eventEmitter[_0x0a88('0x9')](_0x0a88('0xd'),_0x55236e);}catch(_0x1c2892){eventEmitter[_0x0a88('0x9')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x1c2892));}});module[_0x0a88('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 509959d..4b75859 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 _0xd747=['target','invalid','traverseBFS','vswitch','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','agicommand'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0xd747,0x132));var _0x7d74=function(_0x235ccc,_0x3750cf){_0x235ccc=_0x235ccc-0x0;var _0x1f1ef3=_0xd747[_0x235ccc];return _0x1f1ef3;};'use strict';var _=require(_0x7d74('0x0'));var logger=require(_0x7d74('0x1'))(_0x7d74('0x2'));var verticesWithRetry=[_0x7d74('0x3'),'getdigits',_0x7d74('0x4')];var Graph=function(){this[_0x7d74('0x5')]={};this[_0x7d74('0x6')]={};this[_0x7d74('0x7')]=0x0;};Graph[_0x7d74('0x8')][_0x7d74('0x9')]=function(_0x143e95){this[_0x7d74('0x5')][_0x143e95['id']]=_0x143e95;this[_0x7d74('0x6')][_0x143e95['id']]=[];};Graph[_0x7d74('0x8')][_0x7d74('0xa')]=function(_0x3db1d6,_0x47dc46,_0xe89622){this['edges'][_0x3db1d6]['push']({'target':_0x47dc46,'condition':_0xe89622});this[_0x7d74('0x7')]+=0x1;};Graph['prototype']['size']=function(){return _['size'](this[_0x7d74('0x5')]);};Graph[_0x7d74('0x8')]['relations']=function(){return this[_0x7d74('0x7')];};Graph[_0x7d74('0x8')][_0x7d74('0xb')]=function(_0x540135){return this['vertices'][_0x540135];};Graph[_0x7d74('0x8')]['traverseBFS']=function(_0x1e9efd,_0x2ba222){if(!this[_0x7d74('0x5')][_0x1e9efd]){return logger[_0x7d74('0xc')](_0x7d74('0xd'));}var _0x3cf903=_0x2ba222(this[_0x7d74('0x5')][_0x1e9efd]);if(!_0x3cf903){return logger['info'](_0x7d74('0xe'));}if(this[_0x7d74('0x6')][_0x1e9efd][_0x7d74('0xf')]===0x0){return logger[_0x7d74('0xc')]('no\x20edge/s\x20available');}for(var _0x2bb7d5=0x0,_0x26230a=[],_0x459a7e=![];_0x2bb7d5\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','then','catch','indexOf','agi_','substring','variables','stringify','close','timeout','hangup','find','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','lodash','syncho','../../config/logger','agi','../../config/license/util','./events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa372,0x1f4));var _0x2a37=function(_0x31f216,_0x5ea0d3){_0x31f216=_0x31f216-0x0;var _0x4fcada=_0xa372[_0x31f216];return _0x4fcada;};'use strict';var _=require(_0x2a37('0x0'));var syncho=require(_0x2a37('0x1'));var util=require('util');var config=require('../../config/environment');var logger=require(_0x2a37('0x2'))(_0x2a37('0x3'));var utilLicense=require(_0x2a37('0x4'));var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require(_0x2a37('0x5'))['EventEmitter'];var projects=[];config[_0x2a37('0x3')]=_[_0x2a37('0x6')](config[_0x2a37('0x3')],{'ip':_0x2a37('0x7'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x5af98d){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x5af98d);agiHandler(_0x5af98d);}catch(_0x311619){logger[_0x2a37('0x8')](_0x311619[_0x2a37('0x9')]);}});});}function projectUpdateHandler(_0x2a9fc5){try{var _0x41ddaf=_[_0x2a37('0xa')](projects,['id',_0x2a9fc5['id']]);if(_0x41ddaf>-0x1){if(_0x2a9fc5[_0x2a37('0xb')]===!![]){projects['splice'](_0x41ddaf,0x1);}else{projects[_0x41ddaf]=_0x2a9fc5;}}else{projects['push'](_0x2a9fc5);}}catch(_0x30cccb){logger[_0x2a37('0x8')](_0x30cccb['stack']);}}function listeningHandler(){console['log'](_0x2a37('0xc'),config[_0x2a37('0x3')][_0x2a37('0xd')]);logger[_0x2a37('0xe')](util[_0x2a37('0xf')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x2a37('0x3')]['ip'],config[_0x2a37('0x3')][_0x2a37('0xd')]));}function errorHandler(_0x1c338e){if(_0x1c338e&&_0x1c338e[_0x2a37('0x10')]&&_0x1c338e['message']){logger[_0x2a37('0x8')](util['format'](_0x2a37('0x11'),_0x1c338e[_0x2a37('0x10')],_0x1c338e['message']));}else{logger[_0x2a37('0x8')](util['format'](_0x2a37('0x12'),_0x1c338e[_0x2a37('0x9')]));}}function closeHandler(){logger[_0x2a37('0xe')](util[_0x2a37('0xf')](_0x2a37('0x13'),this[_0x2a37('0x14')],this['calleridname'],this['callerid'],this[_0x2a37('0x15')],this[_0x2a37('0x16')]));try{createSquareReport(this);}catch(_0x50d23d){logger[_0x2a37('0x8')](_0x50d23d['stack']);}}function timeoutHandler(){logger[_0x2a37('0xe')](util[_0x2a37('0xf')](_0x2a37('0x17'),this[_0x2a37('0x14')],this['calleridname'],this['callerid'],this['dnid'],this['uniqueid']));}function hangupHandler(){logger['info'](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x2a37('0x14')],this[_0x2a37('0x18')],this[_0x2a37('0x19')],this['dnid'],this[_0x2a37('0x16')]));this['evtHangup']=!![];}function createSquareReport(_0xf1e876,_0x137538){rpc['createSquareReport'](_0xf1e876)[_0x2a37('0x1a')](function(_0x2a53cb){if(_0x137538){_0x137538(null,_0x2a53cb);}})[_0x2a37('0x1b')](function(_0x170eb5){if(_0x137538){_0x137538(null,_0x170eb5);}});}function setChannelVariables(_0xfbfc48){for(var _0x2bf850 in _0xfbfc48){if(_0xfbfc48['hasOwnProperty'](_0x2bf850)){if(_0x2bf850[_0x2a37('0x1c')](_0x2a37('0x1d'))===0x0){_0xfbfc48[_0x2bf850[_0x2a37('0x1e')](0x4)]=_0xfbfc48[_0x2bf850];delete _0xfbfc48[_0x2bf850];}}}}function agiHandler(_0x3da32b){logger['debug'](_0x2a37('0x1f'),JSON[_0x2a37('0x20')](_0x3da32b,null,0x2));logger[_0x2a37('0xe')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3da32b[_0x2a37('0x14')],_0x3da32b[_0x2a37('0x18')],_0x3da32b[_0x2a37('0x19')],_0x3da32b['dnid'],_0x3da32b[_0x2a37('0x16')]));_0x3da32b['on'](_0x2a37('0x8'),errorHandler);_0x3da32b['on'](_0x2a37('0x21'),closeHandler);_0x3da32b['on'](_0x2a37('0x22'),timeoutHandler);_0x3da32b['evtHangup']=![];_0x3da32b['on'](_0x2a37('0x23'),hangupHandler);var _0x41dcaa=_[_0x2a37('0x24')](projects,[_0x2a37('0x10'),_0x3da32b['arg_1']]);if(!_0x41dcaa)return Project['handleNotFound'](_0x3da32b);if(!_0x41dcaa[_0x2a37('0x25')])return Project[_0x2a37('0x26')](_0x3da32b);return Project[_0x2a37('0x27')](_0x41dcaa,_0x3da32b);}function main(){var _0x2c116d;return utilLicense[_0x2a37('0x28')]()[_0x2a37('0x1a')](function(_0x30d5bc){if(!_0x30d5bc)return;if(_0x30d5bc[_0x2a37('0x29')]){if(_0x30d5bc[_0x2a37('0x2a')]&&_0x30d5bc[_0x2a37('0x2a')]>0x0){logger[_0x2a37('0xe')](util[_0x2a37('0xf')](_0x2a37('0x2b'),_0x30d5bc['callysquare']));_0x2c116d=_0x30d5bc[_0x2a37('0x2a')];}else{logger[_0x2a37('0xe')](_0x2a37('0x2c'));}}else{logger[_0x2a37('0xe')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x2c116d=-0x1;}})[_0x2a37('0x1a')](function(){return Project['getAll']();})['then'](function(_0x51ef40){projects=_0x51ef40;return;})[_0x2a37('0x1b')](function(_0x154e8f){logger['error'](_0x2a37('0x2d'),_0x154e8f[_0x2a37('0x9')]);})['finally'](function(){var _0xeaba08=require('./server')(config[_0x2a37('0x3')]['port'],config[_0x2a37('0x3')]['ip'],_0x2c116d);_0xeaba08['on'](_0x2a37('0x8'),errorHandler);_0xeaba08['on']('listening',listeningHandler);_0xeaba08['on']('connection',connectionHandler);_0xeaba08['on'](_0x2a37('0x21'),closeHandler);});}main(); \ No newline at end of file +var _0x139b=['getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','finally','./server','listening','connection','syncho','util','../../config/environment','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','error','stack','deleted','splice','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','evtHangup','catch','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','handleUnpublished'];(function(_0xc86e47,_0x588023){var _0x262c1c=function(_0x570035){while(--_0x570035){_0xc86e47['push'](_0xc86e47['shift']());}};_0x262c1c(++_0x588023);}(_0x139b,0x161));var _0xb139=function(_0x1776a4,_0x54f0f5){_0x1776a4=_0x1776a4-0x0;var _0x52e83c=_0x139b[_0x1776a4];return _0x52e83c;};'use strict';var _=require('lodash');var syncho=require(_0xb139('0x0'));var util=require(_0xb139('0x1'));var config=require(_0xb139('0x2'));var logger=require('../../config/logger')(_0xb139('0x3'));var utilLicense=require(_0xb139('0x4'));var rpc=require(_0xb139('0x5'));var Project=require(_0xb139('0x6'));var AGIEmitter=require(_0xb139('0x7'))[_0xb139('0x8')];var projects=[];config[_0xb139('0x3')]=_[_0xb139('0x9')](config['agi'],{'ip':_0xb139('0xa'),'port':0x11dd});AGIEmitter['on'](_0xb139('0xb'),projectUpdateHandler);function connectionHandler(_0xf53837){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0xf53837);agiHandler(_0xf53837);}catch(_0x5de97f){logger[_0xb139('0xc')](_0x5de97f[_0xb139('0xd')]);}});});}function projectUpdateHandler(_0x5d3337){try{var _0x4be496=_['findIndex'](projects,['id',_0x5d3337['id']]);if(_0x4be496>-0x1){if(_0x5d3337[_0xb139('0xe')]===!![]){projects[_0xb139('0xf')](_0x4be496,0x1);}else{projects[_0x4be496]=_0x5d3337;}}else{projects['push'](_0x5d3337);}}catch(_0xfa8dd8){logger[_0xb139('0xc')](_0xfa8dd8[_0xb139('0xd')]);}}function listeningHandler(){console[_0xb139('0x10')](_0xb139('0x11'),config['agi'][_0xb139('0x12')]);logger[_0xb139('0x13')](util[_0xb139('0x14')](_0xb139('0x15'),config[_0xb139('0x3')]['ip'],config[_0xb139('0x3')][_0xb139('0x12')]));}function errorHandler(_0x322041){if(_0x322041&&_0x322041['name']&&_0x322041[_0xb139('0x16')]){logger['error'](util[_0xb139('0x14')](_0xb139('0x17'),_0x322041[_0xb139('0x18')],_0x322041[_0xb139('0x16')]));}else{logger['error'](util[_0xb139('0x14')]('[ERROR]\x20%s',_0x322041[_0xb139('0xd')]));}}function closeHandler(){logger[_0xb139('0x13')](util[_0xb139('0x14')](_0xb139('0x19'),this[_0xb139('0x1a')],this['calleridname'],this[_0xb139('0x1b')],this[_0xb139('0x1c')],this[_0xb139('0x1d')]));try{createSquareReport(this);}catch(_0xa4903c){logger[_0xb139('0xc')](_0xa4903c[_0xb139('0xd')]);}}function timeoutHandler(){logger[_0xb139('0x13')](util[_0xb139('0x14')](_0xb139('0x1e'),this[_0xb139('0x1a')],this[_0xb139('0x1f')],this[_0xb139('0x1b')],this[_0xb139('0x1c')],this[_0xb139('0x1d')]));}function hangupHandler(){logger[_0xb139('0x13')](util[_0xb139('0x14')]('[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['callerid'],this[_0xb139('0x1c')],this[_0xb139('0x1d')]));this[_0xb139('0x20')]=!![];}function createSquareReport(_0x5ea98a,_0x4bb7c2){rpc['createSquareReport'](_0x5ea98a)['then'](function(_0x4d3d4d){if(_0x4bb7c2){_0x4bb7c2(null,_0x4d3d4d);}})[_0xb139('0x21')](function(_0x3fa702){if(_0x4bb7c2){_0x4bb7c2(null,_0x3fa702);}});}function setChannelVariables(_0x328943){for(var _0x512065 in _0x328943){if(_0x328943['hasOwnProperty'](_0x512065)){if(_0x512065[_0xb139('0x22')]('agi_')===0x0){_0x328943[_0x512065[_0xb139('0x23')](0x4)]=_0x328943[_0x512065];delete _0x328943[_0x512065];}}}}function agiHandler(_0x1fabde){logger[_0xb139('0x24')](_0xb139('0x25'),JSON[_0xb139('0x26')](_0x1fabde,null,0x2));logger[_0xb139('0x13')](util['format'](_0xb139('0x27'),_0x1fabde[_0xb139('0x1a')],_0x1fabde[_0xb139('0x1f')],_0x1fabde[_0xb139('0x1b')],_0x1fabde[_0xb139('0x1c')],_0x1fabde[_0xb139('0x1d')]));_0x1fabde['on'](_0xb139('0xc'),errorHandler);_0x1fabde['on'](_0xb139('0x28'),closeHandler);_0x1fabde['on'](_0xb139('0x29'),timeoutHandler);_0x1fabde['evtHangup']=![];_0x1fabde['on'](_0xb139('0x2a'),hangupHandler);var _0x23adde=_[_0xb139('0x2b')](projects,[_0xb139('0x18'),_0x1fabde['arg_1']]);if(!_0x23adde)return Project[_0xb139('0x2c')](_0x1fabde);if(!_0x23adde['production'])return Project[_0xb139('0x2d')](_0x1fabde);return Project['initialize'](_0x23adde,_0x1fabde);}function main(){var _0x1a279b;return utilLicense[_0xb139('0x2e')]()[_0xb139('0x2f')](function(_0x36ae35){if(!_0x36ae35)return;if(_0x36ae35[_0xb139('0x30')]){if(_0x36ae35[_0xb139('0x31')]&&_0x36ae35[_0xb139('0x31')]>0x0){logger[_0xb139('0x13')](util[_0xb139('0x14')](_0xb139('0x32'),_0x36ae35[_0xb139('0x31')]));_0x1a279b=_0x36ae35[_0xb139('0x31')];}else{logger['info'](_0xb139('0x33'));}}else{logger[_0xb139('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1a279b=-0x1;}})[_0xb139('0x2f')](function(){return Project[_0xb139('0x34')]();})['then'](function(_0x45a7f2){projects=_0x45a7f2;return;})[_0xb139('0x21')](function(_0x34589d){logger[_0xb139('0xc')]('[LICENSE]',_0x34589d[_0xb139('0xd')]);})[_0xb139('0x35')](function(){var _0x3ae402=require(_0xb139('0x36'))(config[_0xb139('0x3')][_0xb139('0x12')],config[_0xb139('0x3')]['ip'],_0x1a279b);_0x3ae402['on'](_0xb139('0xc'),errorHandler);_0x3ae402['on'](_0xb139('0x37'),listeningHandler);_0x3ae402['on'](_0xb139('0x38'),connectionHandler);_0x3ae402['on'](_0xb139('0x28'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index c94642c..d25ae92 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 _0x003d=['catch','SendMail','bluebird','http','request','then','error','message','result'];(function(_0x3c601d,_0x1252ae){var _0x3da0e9=function(_0x3697ed){while(--_0x3697ed){_0x3c601d['push'](_0x3c601d['shift']());}};_0x3da0e9(++_0x1252ae);}(_0x003d,0x1a0));var _0xd003=function(_0x5f4ffb,_0x2cf3a9){_0x5f4ffb=_0x5f4ffb-0x0;var _0x1793e7=_0x003d[_0x5f4ffb];return _0x1793e7;};'use strict';var BPromise=require(_0xd003('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd003('0x1')]({'port':0x232b});function request(_0x511982,_0x1a236e){return new BPromise(function(_0xcbd135,_0x328659){return client[_0xd003('0x2')](_0x511982,_0x1a236e)[_0xd003('0x3')](function(_0x238f63){if(_0x238f63[_0xd003('0x4')]){return _0x328659(_0x238f63[_0xd003('0x4')][_0xd003('0x5')]);}else{return _0xcbd135(_0x238f63[_0xd003('0x6')]);}})[_0xd003('0x7')](function(_0x549f2a){return _0x328659(_0x549f2a);});});}exports['sendMailMessage']=function(_0x4fa4ed,_0x4f2a97){return request(_0xd003('0x8'),{'account':_0x4fa4ed,'message':_0x4f2a97});}; \ No newline at end of file +var _0x06af=['then','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','request'];(function(_0x46b3c2,_0x141c53){var _0x3f4d7c=function(_0x2c05a8){while(--_0x2c05a8){_0x46b3c2['push'](_0x46b3c2['shift']());}};_0x3f4d7c(++_0x141c53);}(_0x06af,0xef));var _0xf06a=function(_0x476b2d,_0x55dbd6){_0x476b2d=_0x476b2d-0x0;var _0x2f5083=_0x06af[_0x476b2d];return _0x2f5083;};'use strict';var BPromise=require(_0xf06a('0x0'));var jayson=require(_0xf06a('0x1'));var client=jayson['client'][_0xf06a('0x2')]({'port':0x232b});function request(_0x50732d,_0x1c29e3){return new BPromise(function(_0x332fa0,_0x22099f){return client[_0xf06a('0x3')](_0x50732d,_0x1c29e3)[_0xf06a('0x4')](function(_0x3fb2f2){if(_0x3fb2f2[_0xf06a('0x5')]){return _0x22099f(_0x3fb2f2['error']['message']);}else{return _0x332fa0(_0x3fb2f2['result']);}})[_0xf06a('0x6')](function(_0x2ab162){return _0x22099f(_0x2ab162);});});}exports[_0xf06a('0x7')]=function(_0x3f8073,_0x286841){return request(_0xf06a('0x8'),{'account':_0x3f8073,'message':_0x286841});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index c227c0d..07010ee 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 _0xc549=['arg_1','callerid','dnid','uniqueid','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','evtHangup','isUndefined','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','traverseBFS','clear','vertex','[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','extension','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','isArray','length','source','target','addEdge','inspect','debug','root','stringify','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc549,0x14a));var _0x9c54=function(_0x2e50c2,_0x32cd42){_0x2e50c2=_0x2e50c2-0x0;var _0x103160=_0xc549[_0x2e50c2];return _0x103160;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0x9c54('0x0'));var util=require(_0x9c54('0x1'));var logger=require(_0x9c54('0x2'))(_0x9c54('0x3'));var rpc=require(_0x9c54('0x4'));var mailRpc=require(_0x9c54('0x5'));var Graph=require('./graph');var Vertices=require(_0x9c54('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9c54('0x7')]()[_0x9c54('0x8')](function(_0x11237e){logger['error'](_0x9c54('0x9'),_0x11237e[_0x9c54('0xa')]);return[];});}function addVertex(_0x5b98ab,_0x514c43,_0x3a41d4){_0x514c43[_0x9c54('0xb')]=_0x3a41d4;if(_0x514c43[_0x9c54('0xc')]('retry')){_0x514c43[_0x9c54('0xd')]=parseInt(_0x514c43[_0x9c54('0xe')],0xa);}_0x5b98ab[_0x9c54('0xf')](_[_0x9c54('0x10')](_0x514c43,'mxCell'));}function initGraph(_0x5c6e56,_0x29bcf7){var _0x5a4bd0=new Graph();for(var _0x55e91d in _0x5c6e56){if(_0x5c6e56[_0x9c54('0xc')](_0x55e91d)){if(_[_0x9c54('0x11')](_0x5c6e56[_0x55e91d])){for(var _0x35cf4f=0x0;_0x35cf4f<_0x5c6e56[_0x55e91d][_0x9c54('0x12')];_0x35cf4f+=0x1){addVertex(_0x5a4bd0,_0x5c6e56[_0x55e91d][_0x35cf4f],_0x55e91d);}}else{addVertex(_0x5a4bd0,_0x5c6e56[_0x55e91d],_0x55e91d);}}}for(var _0x28d68f=0x0;_0x28d68f<_0x29bcf7['length'];_0x28d68f+=0x1){if(_0x29bcf7[_0x28d68f][_0x9c54('0x13')]&&_0x29bcf7[_0x28d68f][_0x9c54('0x14')]){_0x5a4bd0[_0x9c54('0x15')](_0x29bcf7[_0x28d68f][_0x9c54('0x13')],_0x29bcf7[_0x28d68f][_0x9c54('0x14')],_0x29bcf7[_0x28d68f]['value']);}}return _0x5a4bd0;}function getRoot(_0x2442e7){return parser['toJson'](_0x2442e7,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x1235fb){return util[_0x9c54('0x16')](_0x1235fb,{'showHidden':![],'depth':null});}function initialize(_0x505f0b,_0x1a030e){var _0x5e240f=getRoot(_0x505f0b['production']);if(!_0x5e240f||!_0x5e240f['start'])return;var _0x14817b,_0x2620dc,_0x5f0f2f;logger[_0x9c54('0x17')](_0x9c54('0x18'),JSON[_0x9c54('0x19')](_0x5e240f,null,0x2));_0x1a030e['joinAt']=moment()[_0x9c54('0x1a')](_0x9c54('0x1b'));_0x14817b=initGraph(_[_0x9c54('0x10')](_0x5e240f,_0x9c54('0x1c')),_0x5e240f[_0x9c54('0x1c')]);_0x2620dc=new Vertices(_0x1a030e,rpc,mailRpc);logger[_0x9c54('0x1d')](util[_0x9c54('0x1a')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1a030e[_0x9c54('0x1e')],_0x1a030e['calleridname'],_0x1a030e[_0x9c54('0x1f')],_0x1a030e[_0x9c54('0x20')],_0x1a030e[_0x9c54('0x21')]));_0x14817b['traverseBFS'](_0x5e240f['start']['id'],function(_0x14cbc1){try{_0x14cbc1=_0x2620dc['clear'](_0x14cbc1);logger[_0x9c54('0x17')]('vertex',JSON['stringify'](_0x14cbc1,null,0x2));if(_0x14cbc1[_0x9c54('0xb')]===_0x9c54('0x22')){logger['info'](_0x9c54('0x23'));_0x1a030e[_0x9c54('0x24')]=_0x14cbc1[_0x9c54('0x24')]||_0x1a030e[_0x9c54('0x24')];_0x1a030e['extension']=_0x14cbc1['extension'];_0x1a030e['priority']=_0x14cbc1[_0x9c54('0x25')]?_0x14cbc1['priority']-0x1:0x1;return null;}else if(_0x14cbc1&&_0x2620dc[_0x14cbc1[_0x9c54('0xb')]]){_0x5f0f2f=_0x2620dc[_0x14cbc1[_0x9c54('0xb')]](_0x14cbc1);logger[_0x9c54('0x1d')](_0x9c54('0x26'),JSON[_0x9c54('0x19')](_0x5f0f2f,null,0x2));if(_0x5f0f2f&&_0x5f0f2f[_0x9c54('0x27')]===AGI_CODE_SUCCESS&&_0x5f0f2f[_0x9c54('0x28')]!==AGI_RESULT_ERROR&&!_0x1a030e[_0x9c54('0x29')]){logger[_0x9c54('0x17')](_0x9c54('0x26'),inspect(_0x5f0f2f));return _[_0x9c54('0x2a')](_0x5f0f2f[_0x9c54('0x28')])?null:_0x5f0f2f[_0x9c54('0x28')][_0x9c54('0x2b')]();}else{logger[_0x9c54('0x2c')](_0x9c54('0x26'),inspect(_0x5f0f2f));return null;}}else{logger[_0x9c54('0x2c')](_0x9c54('0x2d'));return null;}}catch(_0xeeb626){logger[_0x9c54('0x2c')](_0xeeb626[_0x9c54('0xa')]);return null;}});if(_0x5e240f[_0x9c54('0x2e')]){logger[_0x9c54('0x1d')](util[_0x9c54('0x1a')](_0x9c54('0x2f'),_0x1a030e[_0x9c54('0x1e')],_0x1a030e[_0x9c54('0x30')],_0x1a030e[_0x9c54('0x1f')],_0x1a030e[_0x9c54('0x20')],_0x1a030e[_0x9c54('0x21')]));_0x14817b[_0x9c54('0x31')](_0x5e240f[_0x9c54('0x2e')]['id'],function(_0x43a06d){try{_0x43a06d=_0x2620dc[_0x9c54('0x32')](_0x43a06d);logger[_0x9c54('0x17')](_0x9c54('0x33'),JSON[_0x9c54('0x19')](_0x43a06d,null,0x2));if(_0x43a06d&&_0x2620dc[_0x43a06d[_0x9c54('0xb')]]){_0x5f0f2f=_0x2620dc[_0x43a06d['agicommand']](_0x43a06d);if(_0x5f0f2f){logger[_0x9c54('0x17')](_0x9c54('0x26'),inspect(_0x5f0f2f));return _['isUndefined'](_0x5f0f2f['result'])?null:_0x5f0f2f['result']['toString']();}else{logger[_0x9c54('0x2c')](_0x9c54('0x26'),inspect(_0x5f0f2f));return null;}}else{logger['error'](_0x9c54('0x2d'));return null;}}catch(_0x830954){logger[_0x9c54('0x2c')](_0x830954[_0x9c54('0xa')]);return null;}});}logger[_0x9c54('0x1d')](util[_0x9c54('0x1a')](_0x9c54('0x34'),_0x1a030e['arg_1'],_0x1a030e[_0x9c54('0x30')],_0x1a030e[_0x9c54('0x1f')],_0x1a030e[_0x9c54('0x20')],_0x1a030e[_0x9c54('0x21')]));logger[_0x9c54('0x1d')](util[_0x9c54('0x1a')](_0x9c54('0x35'),_0x1a030e[_0x9c54('0x24')],_0x1a030e[_0x9c54('0x36')],parseInt(_0x1a030e[_0x9c54('0x25')],0xa)+0x1));_0x1a030e[_0x9c54('0x37')](_0x1a030e[_0x9c54('0x24')],_0x1a030e[_0x9c54('0x36')],parseInt(_0x1a030e[_0x9c54('0x25')],0xa)+0x1);_0x1a030e[_0x9c54('0x38')]();}function handleNotFound(_0x2b020f){logger[_0x9c54('0x2c')](util[_0x9c54('0x1a')](_0x9c54('0x39'),_0x2b020f[_0x9c54('0x1e')]));_0x2b020f[_0x9c54('0x37')](_0x2b020f[_0x9c54('0x24')],_0x2b020f[_0x9c54('0x36')],parseInt(_0x2b020f[_0x9c54('0x25')],0xa)+0x1);_0x2b020f[_0x9c54('0x38')]();}function handleUnpublished(_0x6101e9){logger[_0x9c54('0x2c')](util[_0x9c54('0x1a')](_0x9c54('0x3a'),_0x6101e9[_0x9c54('0x1e')]));_0x6101e9[_0x9c54('0x37')](_0x6101e9['context'],_0x6101e9[_0x9c54('0x36')],parseInt(_0x6101e9[_0x9c54('0x25')],0xa)+0x1);_0x6101e9[_0x9c54('0x38')]();}module[_0x9c54('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xf875=['retry','maxRetry','addVertex','omit','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','format','mxCell','info','arg_1','uniqueid','traverseBFS','clear','vertex','stringify','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','isUndefined','result','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','xml2json','util','../../config/logger','agi','./mailRpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects'];(function(_0x3f4d7c,_0x2f1184){var _0x47bf26=function(_0x381cdf){while(--_0x381cdf){_0x3f4d7c['push'](_0x3f4d7c['shift']());}};_0x47bf26(++_0x2f1184);}(_0xf875,0x1e6));var _0x5f87=function(_0x260f07,_0x4f594f){_0x260f07=_0x260f07-0x0;var _0x38fc21=_0xf875[_0x260f07];return _0x38fc21;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0x5f87('0x0'));var util=require(_0x5f87('0x1'));var logger=require(_0x5f87('0x2'))(_0x5f87('0x3'));var rpc=require('./rpc');var mailRpc=require(_0x5f87('0x4'));var Graph=require('./graph');var Vertices=require(_0x5f87('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x5f87('0x6')]()[_0x5f87('0x7')](function(_0x42b3b2){logger[_0x5f87('0x8')](_0x5f87('0x9'),_0x42b3b2['stack']);return[];});}function addVertex(_0x280234,_0x30c9fd,_0x62af3a){_0x30c9fd['agicommand']=_0x62af3a;if(_0x30c9fd['hasOwnProperty'](_0x5f87('0xa'))){_0x30c9fd[_0x5f87('0xb')]=parseInt(_0x30c9fd[_0x5f87('0xa')],0xa);}_0x280234[_0x5f87('0xc')](_[_0x5f87('0xd')](_0x30c9fd,'mxCell'));}function initGraph(_0x29f75a,_0x5ef46e){var _0x14a4fb=new Graph();for(var _0x4056bc in _0x29f75a){if(_0x29f75a[_0x5f87('0xe')](_0x4056bc)){if(_[_0x5f87('0xf')](_0x29f75a[_0x4056bc])){for(var _0x8b40df=0x0;_0x8b40df<_0x29f75a[_0x4056bc][_0x5f87('0x10')];_0x8b40df+=0x1){addVertex(_0x14a4fb,_0x29f75a[_0x4056bc][_0x8b40df],_0x4056bc);}}else{addVertex(_0x14a4fb,_0x29f75a[_0x4056bc],_0x4056bc);}}}for(var _0xead7ab=0x0;_0xead7ab<_0x5ef46e[_0x5f87('0x10')];_0xead7ab+=0x1){if(_0x5ef46e[_0xead7ab][_0x5f87('0x11')]&&_0x5ef46e[_0xead7ab][_0x5f87('0x12')]){_0x14a4fb[_0x5f87('0x13')](_0x5ef46e[_0xead7ab][_0x5f87('0x11')],_0x5ef46e[_0xead7ab]['target'],_0x5ef46e[_0xead7ab][_0x5f87('0x14')]);}}return _0x14a4fb;}function getRoot(_0x1b5e43){return parser[_0x5f87('0x15')](_0x1b5e43,{'object':!![]})[_0x5f87('0x16')][_0x5f87('0x17')];}function inspect(_0x3fe5){return util[_0x5f87('0x18')](_0x3fe5,{'showHidden':![],'depth':null});}function initialize(_0x2f47f7,_0x2ff8e5){var _0x52bf48=getRoot(_0x2f47f7[_0x5f87('0x19')]);if(!_0x52bf48||!_0x52bf48[_0x5f87('0x1a')])return;var _0x31f676,_0x5c8351,_0x4673e7;logger[_0x5f87('0x1b')](_0x5f87('0x17'),JSON['stringify'](_0x52bf48,null,0x2));_0x2ff8e5[_0x5f87('0x1c')]=moment()[_0x5f87('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');_0x31f676=initGraph(_['omit'](_0x52bf48,_0x5f87('0x1e')),_0x52bf48[_0x5f87('0x1e')]);_0x5c8351=new Vertices(_0x2ff8e5,rpc,mailRpc);logger[_0x5f87('0x1f')](util[_0x5f87('0x1d')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2ff8e5[_0x5f87('0x20')],_0x2ff8e5['calleridname'],_0x2ff8e5['callerid'],_0x2ff8e5['dnid'],_0x2ff8e5[_0x5f87('0x21')]));_0x31f676[_0x5f87('0x22')](_0x52bf48[_0x5f87('0x1a')]['id'],function(_0x399625){try{_0x399625=_0x5c8351[_0x5f87('0x23')](_0x399625);logger[_0x5f87('0x1b')](_0x5f87('0x24'),JSON[_0x5f87('0x25')](_0x399625,null,0x2));if(_0x399625[_0x5f87('0x26')]===_0x5f87('0x27')){logger[_0x5f87('0x1f')](_0x5f87('0x28'));_0x2ff8e5['context']=_0x399625[_0x5f87('0x29')]||_0x2ff8e5[_0x5f87('0x29')];_0x2ff8e5[_0x5f87('0x2a')]=_0x399625[_0x5f87('0x2a')];_0x2ff8e5[_0x5f87('0x2b')]=_0x399625[_0x5f87('0x2b')]?_0x399625[_0x5f87('0x2b')]-0x1:0x1;return null;}else if(_0x399625&&_0x5c8351[_0x399625['agicommand']]){_0x4673e7=_0x5c8351[_0x399625['agicommand']](_0x399625);logger[_0x5f87('0x1f')](_0x5f87('0x2c'),JSON[_0x5f87('0x25')](_0x4673e7,null,0x2));if(_0x4673e7&&_0x4673e7[_0x5f87('0x2d')]===AGI_CODE_SUCCESS&&_0x4673e7['result']!==AGI_RESULT_ERROR&&!_0x2ff8e5[_0x5f87('0x2e')]){logger['debug'](_0x5f87('0x2c'),inspect(_0x4673e7));return _[_0x5f87('0x2f')](_0x4673e7[_0x5f87('0x30')])?null:_0x4673e7['result'][_0x5f87('0x31')]();}else{logger[_0x5f87('0x8')](_0x5f87('0x2c'),inspect(_0x4673e7));return null;}}else{logger['error'](_0x5f87('0x32'));return null;}}catch(_0x136366){logger[_0x5f87('0x8')](_0x136366[_0x5f87('0x33')]);return null;}});if(_0x52bf48[_0x5f87('0x34')]){logger['info'](util[_0x5f87('0x1d')](_0x5f87('0x35'),_0x2ff8e5[_0x5f87('0x20')],_0x2ff8e5[_0x5f87('0x36')],_0x2ff8e5[_0x5f87('0x37')],_0x2ff8e5[_0x5f87('0x38')],_0x2ff8e5[_0x5f87('0x21')]));_0x31f676[_0x5f87('0x22')](_0x52bf48[_0x5f87('0x34')]['id'],function(_0x155b0f){try{_0x155b0f=_0x5c8351['clear'](_0x155b0f);logger[_0x5f87('0x1b')](_0x5f87('0x24'),JSON[_0x5f87('0x25')](_0x155b0f,null,0x2));if(_0x155b0f&&_0x5c8351[_0x155b0f[_0x5f87('0x26')]]){_0x4673e7=_0x5c8351[_0x155b0f['agicommand']](_0x155b0f);if(_0x4673e7){logger[_0x5f87('0x1b')](_0x5f87('0x2c'),inspect(_0x4673e7));return _[_0x5f87('0x2f')](_0x4673e7[_0x5f87('0x30')])?null:_0x4673e7['result'][_0x5f87('0x31')]();}else{logger[_0x5f87('0x8')](_0x5f87('0x2c'),inspect(_0x4673e7));return null;}}else{logger[_0x5f87('0x8')](_0x5f87('0x32'));return null;}}catch(_0x450789){logger[_0x5f87('0x8')](_0x450789[_0x5f87('0x33')]);return null;}});}logger['info'](util[_0x5f87('0x1d')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2ff8e5[_0x5f87('0x20')],_0x2ff8e5[_0x5f87('0x36')],_0x2ff8e5[_0x5f87('0x37')],_0x2ff8e5['dnid'],_0x2ff8e5[_0x5f87('0x21')]));logger[_0x5f87('0x1f')](util[_0x5f87('0x1d')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x2ff8e5[_0x5f87('0x29')],_0x2ff8e5[_0x5f87('0x2a')],parseInt(_0x2ff8e5[_0x5f87('0x2b')],0xa)+0x1));_0x2ff8e5[_0x5f87('0x39')](_0x2ff8e5[_0x5f87('0x29')],_0x2ff8e5['extension'],parseInt(_0x2ff8e5[_0x5f87('0x2b')],0xa)+0x1);_0x2ff8e5[_0x5f87('0x3a')]();}function handleNotFound(_0x25a51b){logger[_0x5f87('0x8')](util[_0x5f87('0x1d')](_0x5f87('0x3b'),_0x25a51b[_0x5f87('0x20')]));_0x25a51b[_0x5f87('0x39')](_0x25a51b[_0x5f87('0x29')],_0x25a51b[_0x5f87('0x2a')],parseInt(_0x25a51b[_0x5f87('0x2b')],0xa)+0x1);_0x25a51b[_0x5f87('0x3a')]();}function handleUnpublished(_0x17d7c7){logger['error'](util[_0x5f87('0x1d')](_0x5f87('0x3c'),_0x17d7c7[_0x5f87('0x20')]));_0x17d7c7[_0x5f87('0x39')](_0x17d7c7[_0x5f87('0x29')],_0x17d7c7[_0x5f87('0x2a')],parseInt(_0x17d7c7['priority'],0xa)+0x1);_0x17d7c7['close']();}module[_0x5f87('0x3d')]={'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 17b30e7..0df0903 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 _0x744b=['util','stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','length','slice','headers','substring','emit','exports'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x744b,0xff));var _0xb744=function(_0x3de277,_0x45066){_0x3de277=_0x3de277-0x0;var _0x41938a=_0x744b[_0x3de277];return _0x41938a;};'use strict';var util=require(_0xb744('0x0'));var Transform=require(_0xb744('0x1'))[_0xb744('0x2')];function AGIReply(_0x4f3f33){Transform['call'](this,_0x4f3f33);this[_0xb744('0x3')]='';this[_0xb744('0x4')]=![];}util[_0xb744('0x5')](AGIReply,Transform);AGIReply[_0xb744('0x6')][_0xb744('0x7')]=function(_0x4680f9,_0x5478be,_0x17c7d5){var _0x28f40b='\x0a',_0x2f7b1f=['\x0a\x0a',_0xb744('0x8')],_0xd1dceb=-0x1,_0x1fb15a=-0x1,_0x25e4e3='',_0x4c55d8=0x0,_0x5dc296='',_0x39b915='';this[_0xb744('0x3')]+=_0x4680f9[_0xb744('0x9')]();_0x5dc296=this[_0xb744('0x3')];if(!this['_inBody']){_0x4c55d8=0x0;while(_0x2f7b1f[_0x4c55d8]){while((_0x1fb15a=_0x5dc296[_0xb744('0xa')](_0x2f7b1f[_0x4c55d8]))!=-0x1){_0x25e4e3=_0x2f7b1f[_0x4c55d8];_0x39b915=_0x5dc296['substring'](0x0,_0x1fb15a);_0x5dc296=_0x5dc296['substring'](_0x1fb15a+_0x25e4e3[_0xb744('0xb')]);var _0x5dabfb=_0x39b915['split'](_0x28f40b),_0x4bcdac=0x0,_0x4ae72b={},_0x5905e2='',_0x311c7c='',_0x3d658b=-0x1;while(_0x5dabfb[_0x4bcdac]){_0x3d658b=_0x5dabfb[_0x4bcdac]['indexOf'](':');if(_0x3d658b!=-0x1){_0x5905e2=_0x5dabfb[_0x4bcdac][_0xb744('0xc')](0x0,_0x3d658b)['trim']();_0x311c7c=_0x5dabfb[_0x4bcdac][_0xb744('0xc')](_0x3d658b+0x1)['trim']();if(_0x5905e2[_0xb744('0xb')]>0x0){_0x4ae72b[_0x5905e2]=_0x311c7c;}}else{}_0x4bcdac++;}this['emit'](_0xb744('0xd'),_0x4ae72b);this[_0xb744('0x4')]=!![];}_0x4c55d8++;}this[_0xb744('0x3')]=_0x5dc296;}else{while((_0xd1dceb=_0x5dc296[_0xb744('0xa')](_0x28f40b))!=-0x1){_0x39b915=_0x5dc296[_0xb744('0xe')](0x0,_0xd1dceb);this[_0xb744('0xf')]('line',_0x39b915);_0x5dc296=_0x5dc296[_0xb744('0xe')](_0xd1dceb+_0x28f40b[_0xb744('0xb')]);}this[_0xb744('0x3')]=_0x5dc296;}_0x17c7d5();};module[_0xb744('0x10')]=AGIReply; \ No newline at end of file +var _0x98e5=['emit','headers','line','call','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','length','trim','slice'];(function(_0x1b766d,_0x466c05){var _0x572823=function(_0x407ed4){while(--_0x407ed4){_0x1b766d['push'](_0x1b766d['shift']());}};_0x572823(++_0x466c05);}(_0x98e5,0x8a));var _0x598e=function(_0x9006ce,_0x4ef52e){_0x9006ce=_0x9006ce-0x0;var _0x1afc58=_0x98e5[_0x9006ce];return _0x1afc58;};'use strict';var util=require('util');var Transform=require('stream')['Transform'];function AGIReply(_0x3c1595){Transform[_0x598e('0x0')](this,_0x3c1595);this['_localBuffer']='';this[_0x598e('0x1')]=![];}util[_0x598e('0x2')](AGIReply,Transform);AGIReply['prototype'][_0x598e('0x3')]=function(_0x5a876c,_0x55025c,_0x154755){var _0x568749='\x0a',_0x4292c3=['\x0a\x0a',_0x598e('0x4')],_0x1fc8b5=-0x1,_0x10bf8e=-0x1,_0x3e0212='',_0x9dc046=0x0,_0x3e6e86='',_0x1d394c='';this[_0x598e('0x5')]+=_0x5a876c[_0x598e('0x6')]();_0x3e6e86=this[_0x598e('0x5')];if(!this['_inBody']){_0x9dc046=0x0;while(_0x4292c3[_0x9dc046]){while((_0x10bf8e=_0x3e6e86[_0x598e('0x7')](_0x4292c3[_0x9dc046]))!=-0x1){_0x3e0212=_0x4292c3[_0x9dc046];_0x1d394c=_0x3e6e86[_0x598e('0x8')](0x0,_0x10bf8e);_0x3e6e86=_0x3e6e86['substring'](_0x10bf8e+_0x3e0212[_0x598e('0x9')]);var _0x547579=_0x1d394c['split'](_0x568749),_0x3bcd08=0x0,_0x445d1d={},_0x2e3614='',_0xd29d12='',_0x3811b2=-0x1;while(_0x547579[_0x3bcd08]){_0x3811b2=_0x547579[_0x3bcd08][_0x598e('0x7')](':');if(_0x3811b2!=-0x1){_0x2e3614=_0x547579[_0x3bcd08]['slice'](0x0,_0x3811b2)[_0x598e('0xa')]();_0xd29d12=_0x547579[_0x3bcd08][_0x598e('0xb')](_0x3811b2+0x1)['trim']();if(_0x2e3614[_0x598e('0x9')]>0x0){_0x445d1d[_0x2e3614]=_0xd29d12;}}else{}_0x3bcd08++;}this[_0x598e('0xc')](_0x598e('0xd'),_0x445d1d);this[_0x598e('0x1')]=!![];}_0x9dc046++;}this[_0x598e('0x5')]=_0x3e6e86;}else{while((_0x1fc8b5=_0x3e6e86[_0x598e('0x7')](_0x568749))!=-0x1){_0x1d394c=_0x3e6e86[_0x598e('0x8')](0x0,_0x1fc8b5);this['emit'](_0x598e('0xe'),_0x1d394c);_0x3e6e86=_0x3e6e86[_0x598e('0x8')](_0x1fc8b5+_0x568749[_0x598e('0x9')]);}this[_0x598e('0x5')]=_0x3e6e86;}_0x154755();};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 e5a0075..1c8cbcb 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 _0xde6c=['ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','moment','client','http','request','then','error','catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xde6c,0x119));var _0xcde6=function(_0x185f7f,_0x42aa8b){_0x185f7f=_0x185f7f-0x0;var _0x15d436=_0xde6c[_0x185f7f];return _0x15d436;};'use strict';var _=require(_0xcde6('0x0'));var moment=require(_0xcde6('0x1'));var jayson=require('jayson/promise');var client=jayson[_0xcde6('0x2')][_0xcde6('0x3')]({'port':0x2329});function request(_0x22fa0d,_0x31ac8c){return new Promise(function(_0x494a32,_0x145150){return client[_0xcde6('0x4')](_0x22fa0d,_0x31ac8c)[_0xcde6('0x5')](function(_0x59bc91){if(_0x59bc91[_0xcde6('0x6')]){return _0x145150(_0x59bc91[_0xcde6('0x6')]['message']);}else{return _0x494a32(_0x59bc91['result']);}})[_0xcde6('0x7')](function(_0x4f07e8){return _0x145150(_0x4f07e8);});});}exports[_0xcde6('0x8')]=function(){return request(_0xcde6('0x9'),{'options':{'raw':![],'attributes':['id',_0xcde6('0xa'),_0xcde6('0xb')]}});};exports['getSquareProject']=function(_0x34eadd){return request(_0xcde6('0xc'),{'options':{'raw':![],'where':{'name':_0x34eadd},'attributes':['production']}});};exports[_0xcde6('0xd')]=function(_0x38e9ee){return request(_0xcde6('0xe'),{'options':{'raw':![],'where':{'id':_0x38e9ee},'include':[{'model':_0xcde6('0xf'),'as':_0xcde6('0x10'),'include':[{'model':_0xcde6('0x11'),'as':_0xcde6('0x11')}]}],'attributes':['id',_0xcde6('0xa'),_0xcde6('0x12')],'smtp':!![]}});};exports[_0xcde6('0x13')]=function(_0x548e08){return request(_0xcde6('0xc'),{'options':{'where':{'id':_0x548e08},'attributes':[_0xcde6('0xa')]}});};exports[_0xcde6('0x14')]=function(_0x33dbdb){return request(_0xcde6('0x15'),{'options':{'where':{'id':_0x33dbdb},'attributes':[_0xcde6('0xa')]}});};exports[_0xcde6('0x16')]=function(_0x43069a){return request(_0xcde6('0x17'),{'options':{'where':{'id':_0x43069a},'attributes':[_0xcde6('0xa')]}});};exports['getSquareOdbcById']=function(_0x1b8a49){return request(_0xcde6('0x18'),{'options':{'where':{'id':_0x1b8a49},'attributes':[_0xcde6('0x19')]}});};exports['getUserById']=function(_0x54e960){return request('ShowUser',{'options':{'where':{'id':_0x54e960},'attributes':[_0xcde6('0xa')]}});};exports['getContactByPhone']=function(_0x448b99){return request(_0xcde6('0x1a'),{'options':{'where':{'phone':_0x448b99['phone']},'attributes':['id']}});};exports[_0xcde6('0x1b')]=function(_0x50400e){return request(_0xcde6('0x1c'),{'options':{'where':{'id':_0x50400e},'attributes':[_0xcde6('0xa')]}});};exports[_0xcde6('0x1d')]=function(_0x1b79dd){return request(_0xcde6('0x1e'),{'options':{'where':{'id':_0x1b79dd},'attributes':[_0xcde6('0x1f')]}});};exports[_0xcde6('0x20')]=function(_0x32baed){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x32baed},'include':[{'model':_0xcde6('0x21'),'as':_0xcde6('0x22')}]}});};exports[_0xcde6('0x23')]=function(_0x49175a){return request(_0xcde6('0x24'),{'options':{'where':{'id':_0x49175a},'attributes':['id',_0xcde6('0xa')]}});};exports['createSmsMessage']=function(_0x1ae27e){return request(_0xcde6('0x25'),{'body':_0x1ae27e});};exports[_0xcde6('0x26')]=function(_0x3be6ac){return request(_0xcde6('0x27'),{'body':_0x3be6ac});};exports[_0xcde6('0x28')]=function(_0x3dd9b8){return request(_0xcde6('0x29'),{'body':_['merge'](_0x3dd9b8,{'project_name':_0x3dd9b8[_0xcde6('0x2a')],'prev_project_name':_0x3dd9b8['arg_2']||'','is_subproject':_0x3dd9b8[_0xcde6('0x2b')]?!![]:![],'leaveAt':moment()[_0xcde6('0x2c')](_0xcde6('0x2d'))})});};exports['createSquareRecording']=function(_0x53cfaf){return request('CreateSquareRecording',{'body':_0x53cfaf});};exports[_0xcde6('0x2e')]=function(_0x2a67fa){return request(_0xcde6('0x2f'),{'body':_0x2a67fa});};exports[_0xcde6('0x30')]=function(_0x2d66f5){return request(_0xcde6('0x31'),{'options':{'raw':![],'where':{'phone':_0x2d66f5['phone'],'ListId':_0x2d66f5['ListId']}}})[_0xcde6('0x5')](function(_0x469d5e){if(_0x469d5e){return _0x469d5e;}return request('CreateCmContact',{'body':_0x2d66f5});});};exports[_0xcde6('0x32')]=function(_0x35a4f0){return request(_0xcde6('0x33'),{'options':{'where':{'id':_0x35a4f0},'attributes':[_0xcde6('0xa')]}});};exports[_0xcde6('0x34')]=function(_0x5d8792,_0x397eae){return request(_0xcde6('0x35'),{'body':{'interface':_0x397eae},'options':{'where':_0x5d8792}});};exports[_0xcde6('0x36')]=function(_0x9308a0,_0x4015dd,_0x37e3f0){return request(_0xcde6('0x37'),{'body':{'type':_0x4015dd,'uniqueid':_0x37e3f0},'options':{'where':_0x9308a0}});};exports[_0xcde6('0x38')]=function(_0x50a6c1){return request('UnpauseUser',{'body':{},'options':{'where':_0x50a6c1}});};exports[_0xcde6('0x39')]=function(_0x16c08c){return request(_0xcde6('0x3a'),{'body':{},'options':{'where':_0x16c08c}});}; \ No newline at end of file +var _0xf430=['getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','lodash','moment','jayson/promise','http','request','then','error','message','catch','getSquareProjects','name','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','phone','ShowTrunk'];(function(_0x279869,_0x47834f){var _0x36eac9=function(_0xcd1293){while(--_0xcd1293){_0x279869['push'](_0x279869['shift']());}};_0x36eac9(++_0x47834f);}(_0xf430,0x1e4));var _0x0f43=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0xf430[_0x19f9e6];return _0x45c862;};'use strict';var _=require(_0x0f43('0x0'));var moment=require(_0x0f43('0x1'));var jayson=require(_0x0f43('0x2'));var client=jayson['client'][_0x0f43('0x3')]({'port':0x2329});function request(_0x7d24d9,_0x5f0981){return new Promise(function(_0x4e2851,_0x462c88){return client[_0x0f43('0x4')](_0x7d24d9,_0x5f0981)[_0x0f43('0x5')](function(_0x47926f){if(_0x47926f[_0x0f43('0x6')]){return _0x462c88(_0x47926f[_0x0f43('0x6')][_0x0f43('0x7')]);}else{return _0x4e2851(_0x47926f['result']);}})[_0x0f43('0x8')](function(_0x39bc4c){return _0x462c88(_0x39bc4c);});});}exports[_0x0f43('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x0f43('0xa'),'production']}});};exports[_0x0f43('0xb')]=function(_0x306095){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x306095},'attributes':['production']}});};exports[_0x0f43('0xc')]=function(_0x22dedf){return request(_0x0f43('0xd'),{'options':{'raw':![],'where':{'id':_0x22dedf},'include':[{'model':_0x0f43('0xe'),'as':_0x0f43('0xf'),'include':[{'model':'CloudProvider','as':_0x0f43('0x10')}]}],'attributes':['id',_0x0f43('0xa'),_0x0f43('0x11')],'smtp':!![]}});};exports[_0x0f43('0x12')]=function(_0x35ecc7){return request(_0x0f43('0x13'),{'options':{'where':{'id':_0x35ecc7},'attributes':[_0x0f43('0xa')]}});};exports[_0x0f43('0x14')]=function(_0x3d668f){return request(_0x0f43('0x15'),{'options':{'where':{'id':_0x3d668f},'attributes':[_0x0f43('0xa')]}});};exports['getVariableById']=function(_0xfad7d0){return request(_0x0f43('0x16'),{'options':{'where':{'id':_0xfad7d0},'attributes':['name']}});};exports[_0x0f43('0x17')]=function(_0x41e85e){return request(_0x0f43('0x18'),{'options':{'where':{'id':_0x41e85e},'attributes':['dsn']}});};exports[_0x0f43('0x19')]=function(_0x4f4e1d){return request(_0x0f43('0x1a'),{'options':{'where':{'id':_0x4f4e1d},'attributes':['name']}});};exports['getContactByPhone']=function(_0x3e25fa){return request('GetContactByPhone',{'options':{'where':{'phone':_0x3e25fa[_0x0f43('0x1b')]},'attributes':['id']}});};exports['getTrunkById']=function(_0xdbb20e){return request(_0x0f43('0x1c'),{'options':{'where':{'id':_0xdbb20e},'attributes':[_0x0f43('0xa')]}});};exports[_0x0f43('0x1d')]=function(_0x38ff8a){return request(_0x0f43('0x1e'),{'options':{'where':{'id':_0x38ff8a},'attributes':['save_name']}});};exports[_0x0f43('0x1f')]=function(_0x190920){return request(_0x0f43('0x20'),{'options':{'raw':![],'where':{'id':_0x190920},'include':[{'model':_0x0f43('0x21'),'as':_0x0f43('0x22')}]}});};exports[_0x0f43('0x23')]=function(_0x41e539){return request(_0x0f43('0x24'),{'options':{'where':{'id':_0x41e539},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x55fb75){return request('CreateSmsMessage',{'body':_0x55fb75});};exports[_0x0f43('0x25')]=function(_0xc9eeb0){return request(_0x0f43('0x26'),{'body':_0xc9eeb0});};exports[_0x0f43('0x27')]=function(_0x5e0f38){return request(_0x0f43('0x28'),{'body':_[_0x0f43('0x29')](_0x5e0f38,{'project_name':_0x5e0f38[_0x0f43('0x2a')],'prev_project_name':_0x5e0f38['arg_2']||'','is_subproject':_0x5e0f38['arg_2']?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x0f43('0x2b')]=function(_0xa44a52){return request(_0x0f43('0x2c'),{'body':_0xa44a52});};exports[_0x0f43('0x2d')]=function(_0x17696d){return request(_0x0f43('0x2e'),{'body':_0x17696d});};exports['createCmContact']=function(_0x417bd7){return request(_0x0f43('0x2f'),{'options':{'raw':![],'where':{'phone':_0x417bd7[_0x0f43('0x1b')],'ListId':_0x417bd7[_0x0f43('0x30')]}}})[_0x0f43('0x5')](function(_0x5e462a){if(_0x5e462a){return _0x5e462a;}return request(_0x0f43('0x31'),{'body':_0x417bd7});});};exports[_0x0f43('0x32')]=function(_0x16066e){return request(_0x0f43('0x33'),{'options':{'where':{'id':_0x16066e},'attributes':['name']}});};exports[_0x0f43('0x34')]=function(_0x37e5f7,_0x295a96){return request(_0x0f43('0x35'),{'body':{'interface':_0x295a96},'options':{'where':_0x37e5f7}});};exports['agentPause']=function(_0x472667,_0x3ab3cc,_0x5350b9){return request(_0x0f43('0x36'),{'body':{'type':_0x3ab3cc,'uniqueid':_0x5350b9},'options':{'where':_0x472667}});};exports[_0x0f43('0x37')]=function(_0x74ba5){return request(_0x0f43('0x38'),{'body':{},'options':{'where':_0x74ba5}});};exports['agentLogout']=function(_0x2fdfa1){return request('LogoutUser',{'body':{},'options':{'where':_0x2fdfa1}});}; \ 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 0de5e81..ab70c88 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 _0xeae8=['./polly','./lex','exports'];(function(_0x4d938e,_0x22771c){var _0x4f079a=function(_0x414a60){while(--_0x414a60){_0x4d938e['push'](_0x4d938e['shift']());}};_0x4f079a(++_0x22771c);}(_0xeae8,0x66));var _0x8eae=function(_0x498300,_0x756f5b){_0x498300=_0x498300-0x0;var _0x2aedaf=_0xeae8[_0x498300];return _0x2aedaf;};var polly=require(_0x8eae('0x0'));var lex=require(_0x8eae('0x1'));module[_0x8eae('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0689=['./lex'];(function(_0x4c508b,_0x1cb9f7){var _0x5088a2=function(_0xa8d4c6){while(--_0xa8d4c6){_0x4c508b['push'](_0x4c508b['shift']());}};_0x5088a2(++_0x1cb9f7);}(_0x0689,0x161));var _0x9068=function(_0x4c29e4,_0x5dc161){_0x4c29e4=_0x4c29e4-0x0;var _0x18206b=_0x0689[_0x4c29e4];return _0x18206b;};var polly=require('./polly');var lex=require(_0x9068('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index b67411f..ffe0ac5 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 _0xa9e0=['exports','./lib/api'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var lex=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]=function(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808){return lex(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808);}; \ No newline at end of file +var _0x6f7a=['./lib/api','exports'];(function(_0x1b36c3,_0x3ad7d8){var _0x52d0d0=function(_0x2a734f){while(--_0x2a734f){_0x1b36c3['push'](_0x1b36c3['shift']());}};_0x52d0d0(++_0x3ad7d8);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x41d0a3,_0x1589ce){_0x41d0a3=_0x41d0a3-0x0;var _0x293036=_0x6f7a[_0x41d0a3];return _0x293036;};'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 diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 3f194f6..995c171 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(_0x1b4057,_0x58212a){var _0x1d749a=function(_0x1fa30b){while(--_0x1fa30b){_0x1b4057['push'](_0x1b4057['shift']());}};_0x1d749a(++_0x58212a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x4cae02,_0x124c48){var _0x5a1b89=function(_0x1675bc){while(--_0x1675bc){_0x4cae02['push'](_0x4cae02['shift']());}};_0x5a1b89(++_0x124c48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 805e7e9..492634d 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 _0xcb5f=['./lib/api'];(function(_0x4ab166,_0x129a5c){var _0x366a79=function(_0x2f7ce4){while(--_0x2f7ce4){_0x4ab166['push'](_0x4ab166['shift']());}};_0x366a79(++_0x129a5c);}(_0xcb5f,0x195));var _0xfcb5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcb5f[_0x321bb2];return _0x9c12ed;};'use strict';var polly=require(_0xfcb5('0x0'));module['exports']=function(_0x26c86c,_0x27b44c,_0x5fc391,_0x251347,_0x12acd0,_0x587b06,_0x4e4efb){return polly(_0x26c86c,_0x27b44c,_0x5fc391,_0x251347,_0x12acd0,_0x587b06,_0x4e4efb);}; \ No newline at end of file +var _0xb239=['./lib/api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb239,0x8e));var _0x9b23=function(_0x54944c,_0x681170){_0x54944c=_0x54944c-0x0;var _0x55cd8f=_0xb239[_0x54944c];return _0x55cd8f;};'use strict';var polly=require(_0x9b23('0x0'));module['exports']=function(_0x7b11e2,_0x8b55b4,_0x281450,_0x3e18b9,_0x56ae29,_0x3423b5,_0x27646b){return polly(_0x7b11e2,_0x8b55b4,_0x281450,_0x3e18b9,_0x56ae29,_0x3423b5,_0x27646b);}; \ 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 e0b8dd5..1ae6d6b 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 _0x067b=['mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x249579,_0x27a727){var _0xed110e=function(_0x576e4f){while(--_0x576e4f){_0x249579['push'](_0x249579['shift']());}};_0xed110e(++_0x27a727);}(_0x067b,0x1e5));var _0xb067=function(_0xa52027,_0x3ed55a){_0xa52027=_0xa52027-0x0;var _0x3e4fe5=_0x067b[_0xa52027];return _0x3e4fe5;};'use strict';var fs=require('fs');var path=require(_0xb067('0x0'));var BPromise=require(_0xb067('0x1'));var rs=require(_0xb067('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x2f2802,_0x4a01c0,_0x179c50){return new BPromise(function(_0x1c9640,_0x28da0c){_0x2f2802[_0xb067('0x3')](_0x4a01c0,function(_0x54deb8,_0x45d6fe){if(_0x54deb8){_0x28da0c(_0x54deb8);}else if(_0x45d6fe){if(_0x45d6fe[_0xb067('0x4')]instanceof Buffer){fs[_0xb067('0x5')](_0x179c50,_0x45d6fe[_0xb067('0x4')],function(_0xc42270){if(_0xc42270){_0x28da0c(_0xc42270);}else{_0x1c9640();}});}else{_0x28da0c(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x28da0c(new Error(_0xb067('0x6')));}});});}module[_0xb067('0x7')]=function(_0x58a854,_0x42be36,_0x3f6b4b,_0x5ddded,_0x23c80a,_0x53e887,_0x4440d1){var _0x4af40d=new AWS[(_0xb067('0x8'))]({'accessKeyId':_0x58a854,'secretAccessKey':_0x42be36,'region':_0x3f6b4b});var _0x54f669={'Text':_0x23c80a,'TextType':_0x53e887||_0xb067('0x9'),'OutputFormat':_0xb067('0xa'),'VoiceId':_0x5ddded};return pollyResult(_0x4af40d,_0x54f669,_0x4440d1);}; \ No newline at end of file +var _0x4afd=['Polly','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x21d477,_0x109fc2){var _0x4c809d=function(_0xf2c651){while(--_0xf2c651){_0x21d477['push'](_0x21d477['shift']());}};_0x4c809d(++_0x109fc2);}(_0x4afd,0xdf));var _0xd4af=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4afd[_0x13d07a];return _0x5ee0ee;};'use strict';var fs=require('fs');var path=require(_0xd4af('0x0'));var BPromise=require(_0xd4af('0x1'));var rs=require('randomstring');var AWS=require(_0xd4af('0x2'));function pollyResult(_0x3e33c9,_0x232a11,_0x93fd64){return new BPromise(function(_0x49a3e3,_0x143c0b){_0x3e33c9[_0xd4af('0x3')](_0x232a11,function(_0xfd62cb,_0x367ae4){if(_0xfd62cb){_0x143c0b(_0xfd62cb);}else if(_0x367ae4){if(_0x367ae4[_0xd4af('0x4')]instanceof Buffer){fs['writeFile'](_0x93fd64,_0x367ae4[_0xd4af('0x4')],function(_0x2bea7c){if(_0x2bea7c){_0x143c0b(_0x2bea7c);}else{_0x49a3e3();}});}else{_0x143c0b(new Error(_0xd4af('0x5')));}}else{_0x143c0b(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xd4af('0x6')]=function(_0x1d0603,_0x4293cd,_0x4f0e62,_0x131354,_0x4051a2,_0x1a07bd,_0x39ed60){var _0x53df2b=new AWS[(_0xd4af('0x7'))]({'accessKeyId':_0x1d0603,'secretAccessKey':_0x4293cd,'region':_0x4f0e62});var _0x11624a={'Text':_0x4051a2,'TextType':_0x1a07bd||_0xd4af('0x8'),'OutputFormat':_0xd4af('0x9'),'VoiceId':_0x131354};return pollyResult(_0x53df2b,_0x11624a,_0x39ed60);}; \ 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 b2e0558..6535992 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x16dd6c,_0x5d2f27,_0xda411d,_0x1fc3b3){return asr(_0x16dd6c,_0x5d2f27,_0xda411d);}; \ No newline at end of file +var _0x6c15=['exports'];(function(_0x2c6b86,_0x2cb869){var _0x2051c2=function(_0x18b735){while(--_0x18b735){_0x2c6b86['push'](_0x2c6b86['shift']());}};_0x2051c2(++_0x2cb869);}(_0x6c15,0x135));var _0x56c1=function(_0x314db8,_0x5b2155){_0x314db8=_0x314db8-0x0;var _0x2dbabf=_0x6c15[_0x314db8];return _0x2dbabf;};'use strict';var asr=require('./lib/api');module[_0x56c1('0x0')]=function(_0x5af643,_0x40aaea,_0x4b2b31,_0x169ba7){return asr(_0x5af643,_0x40aaea,_0x4b2b31);}; \ 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 1d0f656..5c73a26 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 _0x19ea=['undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','8000','url','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string'];(function(_0xdafcbc,_0x33da73){var _0x3c5f88=function(_0x2b7815){while(--_0x2b7815){_0xdafcbc['push'](_0xdafcbc['shift']());}};_0x3c5f88(++_0x33da73);}(_0x19ea,0xfe));var _0xa19e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x19ea[_0x14add3];return _0x4a174f;};'use strict';var url=require(_0xa19e('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xa19e('0x1')]=function(_0x481228,_0x208e73,_0x12aefc){return new BPromise(function(_0x3593a5,_0x4d323a){var _0x4a6556;if(typeof _0x481228!==_0xa19e('0x2')||_0x481228[_0xa19e('0x3')]===0x0){return _0x4d323a(_0xa19e('0x4'));}if(typeof _0x208e73!==_0xa19e('0x2')||_0x208e73[_0xa19e('0x3')]===0x0){return _0x4d323a(_0xa19e('0x5'));}if(typeof _0x12aefc!==_0xa19e('0x6')&&(typeof _0x12aefc!==_0xa19e('0x2')||_0x12aefc[_0xa19e('0x3')]===0x0)){return _0x4d323a(_0xa19e('0x7'));}try{_0x4a6556=fs[_0xa19e('0x8')](_0x481228)['toString'](_0xa19e('0x9'));}catch(_0x3c8647){return _0x4d323a(_0x3c8647);}return _0x3593a5({'method':_0xa19e('0xa'),'uri':host+_0xa19e('0xb')+_0x208e73,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa19e('0xc'),'languageCode':_0x12aefc},'audio':{'content':_0x4a6556}},'json':!![]});});}; \ No newline at end of file +var _0x8f37=['base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','length','string','undefined','lang\x20should\x20be\x20a\x20string','toString'];(function(_0x4e8022,_0x53229d){var _0xf5e73f=function(_0x3a1309){while(--_0x3a1309){_0x4e8022['push'](_0x4e8022['shift']());}};_0xf5e73f(++_0x53229d);}(_0x8f37,0x190));var _0x78f3=function(_0x32b0e7,_0x4aa822){_0x32b0e7=_0x32b0e7-0x0;var _0x5cb86c=_0x8f37[_0x32b0e7];return _0x5cb86c;};'use strict';var url=require(_0x78f3('0x0'));var BPromise=require(_0x78f3('0x1'));var fs=require('fs');var host=_0x78f3('0x2');module['exports']=function(_0x542bc0,_0x2a7d93,_0x3c1fa6){return new BPromise(function(_0x3b0667,_0x539794){var _0x1d59a5;if(typeof _0x542bc0!=='string'||_0x542bc0[_0x78f3('0x3')]===0x0){return _0x539794('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a7d93!==_0x78f3('0x4')||_0x2a7d93[_0x78f3('0x3')]===0x0){return _0x539794('key\x20should\x20be\x20a\x20string');}if(typeof _0x3c1fa6!==_0x78f3('0x5')&&(typeof _0x3c1fa6!=='string'||_0x3c1fa6[_0x78f3('0x3')]===0x0)){return _0x539794(_0x78f3('0x6'));}try{_0x1d59a5=fs['readFileSync'](_0x542bc0)[_0x78f3('0x7')](_0x78f3('0x8'));}catch(_0x268525){return _0x539794(_0x268525);}return _0x3b0667({'method':_0x78f3('0x9'),'uri':host+_0x78f3('0xa')+_0x2a7d93,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x78f3('0xb'),'languageCode':_0x3c1fa6},'audio':{'content':_0x1d59a5}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index c406ae4..46e7934 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 _0xadfb=['exports'];(function(_0x5b7a0d,_0x1c0051){var _0x2d89eb=function(_0x3e62df){while(--_0x3e62df){_0x5b7a0d['push'](_0x5b7a0d['shift']());}};_0x2d89eb(++_0x1c0051);}(_0xadfb,0x118));var _0xbadf=function(_0x4288e4,_0x3f937a){_0x4288e4=_0x4288e4-0x0;var _0xe44ae4=_0xadfb[_0x4288e4];return _0xe44ae4;};var asr=require('./asr');module[_0xbadf('0x0')]={'asr':asr}; \ No newline at end of file +var _0xbd40=['./asr','exports'];(function(_0x38382f,_0x51183d){var _0x152e8b=function(_0x45dc28){while(--_0x45dc28){_0x38382f['push'](_0x38382f['shift']());}};_0x152e8b(++_0x51183d);}(_0xbd40,0x68));var _0x0bd4=function(_0x4929ea,_0x1a67fc){_0x4929ea=_0x4929ea-0x0;var _0x8c9d22=_0xbd40[_0x4929ea];return _0x8c9d22;};var asr=require(_0x0bd4('0x0'));module[_0x0bd4('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 7508bab..1db58a0 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 _0x9e82=['diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','displayName','languageCode','queryText','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','https','md5','path','querystring','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','unlink','download\x20error','pipe','end','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','googleCloudTTS\x20path','split','googleTTS','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','name','message','googleDialogflow','textRequest','source','result','action','actionIncomplete','speech','score','status','code','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent'];(function(_0xa970d1,_0x8e9f98){var _0x4c5a31=function(_0x1b715d){while(--_0x1b715d){_0xa970d1['push'](_0xa970d1['shift']());}};_0x4c5a31(++_0x8e9f98);}(_0x9e82,0x1a2));var _0x29e8=function(_0x430d55,_0x44c009){_0x430d55=_0x430d55-0x0;var _0x175803=_0x9e82[_0x430d55];return _0x175803;};'use strict';var apiai=require(_0x29e8('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x29e8('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x29e8('0x2'));var md5=require(_0x29e8('0x3'));var path=require(_0x29e8('0x4'));var querystring=require(_0x29e8('0x5'));var rp=require('request-promise');var rs=require(_0x29e8('0x6'));var sox=require(_0x29e8('0x7'));var tts=require(_0x29e8('0x8'));var urlParse=require('url')[_0x29e8('0x9')];var util=require(_0x29e8('0xa'));var aws=require(_0x29e8('0xb'));var google=require(_0x29e8('0xc'));var sestek=require(_0x29e8('0xd'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x29e8('0xe'));var ISPEECH_API=_0x29e8('0xf');function downloadFile(_0x5c0394,_0x4236d3){return new BPromise(function(_0x4a8aab,_0x5032e4){var _0x4cfd04=urlParse(_0x5c0394);var _0x4b63ca=_0x4cfd04['protocol']===_0x29e8('0x10')?https:http;var _0x1c5797={'host':_0x4cfd04[_0x29e8('0x11')],'path':_0x4cfd04[_0x29e8('0x4')],'headers':{'user-agent':_0x29e8('0x12')}};_0x4b63ca[_0x29e8('0x13')](_0x1c5797,function(_0x1f8ed9){if(_0x1f8ed9[_0x29e8('0x14')]!==0xc8){logger[_0x29e8('0x15')](_0x29e8('0x16')+_0x5c0394+_0x29e8('0x17')+_0x1f8ed9[_0x29e8('0x14')]+'\x20('+_0x1f8ed9['statusMessage']+')');_0x5032e4(new Error('request\x20to\x20'+_0x5c0394+_0x29e8('0x17')+_0x1f8ed9[_0x29e8('0x14')]+'\x20('+_0x1f8ed9[_0x29e8('0x18')]+')'));return;}var _0x34038c=fs[_0x29e8('0x19')](_0x4236d3);_0x34038c['on'](_0x29e8('0x1a'),function(){logger[_0x29e8('0x1b')]('finish\x20download\x20file');_0x34038c[_0x29e8('0x1c')](_0x4a8aab);});_0x34038c['on'](_0x29e8('0x15'),function(_0x31259d){fs[_0x29e8('0x1d')](_0x4236d3);logger[_0x29e8('0x15')](_0x29e8('0x1e'),_0x31259d);_0x5032e4(_0x31259d);});_0x1f8ed9[_0x29e8('0x1f')](_0x34038c);})['on'](_0x29e8('0x15'),function(_0x2632e6){logger['error'](_0x2632e6);_0x5032e4(_0x2632e6);})[_0x29e8('0x20')]();});}function uploadFile(_0xbb8204){return new BPromise(function(_0x2aebb1,_0xbd005b){var _0x94efe5=urlParse(_0xbb8204);var _0x3f8333=_0x94efe5['protocol']==='https:'?https:http;var _0x4ec761={'host':_0x94efe5[_0x29e8('0x11')],'path':_0x94efe5[_0x29e8('0x4')],'headers':{'user-agent':_0x29e8('0x12')}};_0x3f8333[_0x29e8('0x13')](_0x4ec761,function(_0x1c9c5e){if(_0x1c9c5e['statusCode']!==0xc8){_0xbd005b(new Error(_0x29e8('0x16')+_0xbb8204+_0x29e8('0x17')+_0x1c9c5e[_0x29e8('0x14')]+'\x20('+_0x1c9c5e['statusMessage']+')'));return;}var _0x3dc685='';_0x1c9c5e['on']('data',function(_0x4b5cd3){_0x3dc685+=_0x4b5cd3;});_0x1c9c5e['on'](_0x29e8('0x20'),function(){_0x2aebb1(_0x3dc685);});})['on'](_0x29e8('0x15'),function(_0x3f4842){_0xbd005b(_0x3f4842);})['end']();});}function convertFile(_0x38767d,_0x37d044){return new BPromise(function(_0x5475a9,_0x38b9fb){var _0x42a1f3=sox[_0x29e8('0x21')](_0x38767d,_0x37d044,{'sampleRate':0x1f40,'format':_0x29e8('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x42a1f3['on']('error',function(_0x2a0c90){logger[_0x29e8('0x15')](_0x29e8('0x23'),_0x2a0c90);_0x38b9fb(_0x2a0c90);});_0x42a1f3['on'](_0x29e8('0x20'),function(){logger['info'](_0x29e8('0x24'));_0x5475a9();});_0x42a1f3['start']();});}function base64Decode(_0x14c85d,_0x9de935){var _0x4ac8e8=path[_0x29e8('0x25')](__dirname,_0x29e8('0x26'),rs[_0x29e8('0x27')](0x4)+_0x29e8('0x28'));fs[_0x29e8('0x29')](_0x4ac8e8,_0x14c85d,_0x29e8('0x2a'));return convertFile(_0x4ac8e8,_0x9de935)[_0x29e8('0x2b')](function(){try{fs['unlink'](_0x4ac8e8);fs[_0x29e8('0x2c')](_0x9de935,_0x29e8('0x2d'));}catch(_0x1ae6b0){logger[_0x29e8('0x15')](_0x1ae6b0);}return _0x9de935['split']('.')[0x0];});}function base64Encode(_0x2cb84d){var _0x44775b=fs['readFileSync'](_0x2cb84d);return new Buffer(_0x44775b)['toString'](_0x29e8('0x2a'));}exports['googleCloudTTS']=function(_0x195903,_0x2bfd99,_0x5b38b0,_0x3b0c34,_0x435305,_0x56f722){var _0x206009,_0x352a6d;var _0x413384=_0x29e8('0x2e');var _0x34156b=_0x29e8('0x2f')+_0x195903;var _0x1b8aa6={};if(_0x2bfd99==='ssml'){_0x1b8aa6[_0x29e8('0x30')]={'ssml':_0x5b38b0};}else{_0x1b8aa6[_0x29e8('0x30')]={'text':_0x5b38b0};};_0x1b8aa6[_0x29e8('0x31')]={'languageCode':_0x3b0c34,'ssmlGender':_0x435305};_0x1b8aa6[_0x29e8('0x32')]={'audioEncoding':_0x29e8('0x33'),'sampleRateHertz':0x1f40};var _0x1fb917={'url':_0x413384+_0x29e8('0x34')+_0x34156b,'method':_0x29e8('0x35'),'json':!![],'body':_0x1b8aa6};return rp(_0x1fb917)[_0x29e8('0x2b')](function(_0x4e3569){return new BPromise(function(_0x510e3b,_0x54bd33){_0x206009=path[_0x29e8('0x25')](__dirname,_0x29e8('0x26'),rs['generate'](0x4)+_0x29e8('0x36'));var _0xb3292b=Buffer[_0x29e8('0x37')](_0x4e3569[_0x29e8('0x38')],'base64');return fs['writeFile'](_0x206009,_0xb3292b,function(_0x33ba0c){_0x54bd33(_0x33ba0c);},function(_0x3c1d83){fs[_0x29e8('0x2c')](_0x206009,'777');_0x510e3b(_0x3c1d83);});});})['then'](function(_0xf7bc19){_0x352a6d=path[_0x29e8('0x25')](__dirname,_0x29e8('0x26'),rs['generate'](0x4)+_0x29e8('0x28'));return convertFile(_0x206009,_0x352a6d);})[_0x29e8('0x2b')](function(){try{fs[_0x29e8('0x1d')](_0x206009);fs[_0x29e8('0x2c')](_0x352a6d,_0x29e8('0x2d'));}catch(_0x5caa3e){logger[_0x29e8('0x15')](_0x5caa3e);}logger[_0x29e8('0x1b')](_0x29e8('0x39'),_0x352a6d[_0x29e8('0x3a')]('.')[0x0]);return _0x352a6d['split']('.')[0x0];});};exports[_0x29e8('0x3b')]=function(_0xc5ee88,_0x11daa0){var _0x698e1a='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x31f5ff,_0x1c6bf7;var _0x3f8e1c;var _0x943c2a={'encoding':_0x29e8('0x3c'),'method':'POST','timeout':0x2710,'url':_0x698e1a,'headers':{'Content-Type':_0x29e8('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0x29e8('0x3e')]([[[_0x29e8('0x3f'),JSON[_0x29e8('0x3e')]([_0xc5ee88,_0x11daa0||'en',![],'null']),null,'generic']]]))};return rp(_0x943c2a)[_0x29e8('0x2b')](function(_0xde3a1b){try{_0x3f8e1c=eval(_0xde3a1b[_0x29e8('0x40')](0x5))[0x0][0x2];}catch(_0x52b94d){throw new Error(_0x29e8('0x41')+_0xde3a1b[_0x29e8('0x42')]);}if(!_0x3f8e1c){if(_0xc5ee88[_0x29e8('0x43')]>0xc8){throw new Error(_0x29e8('0x44'));}else{throw new Error('lang\x20\x22'+_0x11daa0+_0x29e8('0x45'));}}try{_0x3f8e1c=eval(_0x3f8e1c)[0x0];}catch(_0x2b7294){throw new Error(_0x29e8('0x41')+res[_0x29e8('0x42')]);}const _0x3ca2e2=_0x3f8e1c;_0x31f5ff=path['resolve'](__dirname,_0x29e8('0x26'),rs[_0x29e8('0x27')](0x4)+_0x29e8('0x36'));fs[_0x29e8('0x29')](_0x31f5ff,_0x3f8e1c,{'encoding':_0x29e8('0x2a')});_0x1c6bf7=path[_0x29e8('0x25')](__dirname,_0x29e8('0x26'),rs[_0x29e8('0x27')](0x4)+_0x29e8('0x28'));return convertFile(_0x31f5ff,_0x1c6bf7);})[_0x29e8('0x2b')](function(){try{fs['unlink'](_0x31f5ff);fs[_0x29e8('0x2c')](_0x1c6bf7,_0x29e8('0x2d'));}catch(_0x2f0226){logger[_0x29e8('0x15')](_0x2f0226);}logger[_0x29e8('0x1b')](_0x29e8('0x46'),_0x1c6bf7[_0x29e8('0x3a')]('.')[0x0]);return _0x1c6bf7[_0x29e8('0x3a')]('.')[0x0];});};exports[_0x29e8('0x47')]=function(_0x42ade0,_0x5d6bee,_0xb9ee3d){return google[_0x29e8('0x48')](_0x42ade0,_0x5d6bee,_0xb9ee3d)[_0x29e8('0x2b')](function(_0x288fc2){logger[_0x29e8('0x1b')](_0x288fc2[_0x29e8('0x49')]);return rp(_0x288fc2);})[_0x29e8('0x2b')](function(_0x3b399a){var _0x53c88c='';var _0x2fe4a1=0x0;try{fs[_0x29e8('0x1d')](_0x42ade0);}catch(_0x4923c9){logger['error'](_0x4923c9);}if(_0x3b399a&&_0x3b399a[_0x29e8('0x4a')]){_0x53c88c=_0x3b399a[_0x29e8('0x4a')][_0x29e8('0x4b')](function(_0x1f41ac){return _0x1f41ac&&_0x1f41ac[_0x29e8('0x4c')][0x0]&&_0x1f41ac['alternatives'][0x0][_0x29e8('0x4d')]?_0x1f41ac[_0x29e8('0x4c')][0x0][_0x29e8('0x4d')]:'';})[_0x29e8('0x4e')]('\x0a');_0x2fe4a1=_0x3b399a[_0x29e8('0x4a')][_0x29e8('0x4b')](function(_0x10bdc1){return _0x10bdc1&&_0x10bdc1[_0x29e8('0x4c')][0x0]&&_0x10bdc1['alternatives'][0x0][_0x29e8('0x4f')]?_0x10bdc1['alternatives'][0x0][_0x29e8('0x4f')]:0x0;})[_0x29e8('0x4e')]('\x0a');}logger[_0x29e8('0x1b')]('googleASR\x20transcription',_0x53c88c);logger[_0x29e8('0x1b')](_0x29e8('0x50'),_0x2fe4a1);return{'transcript':_0x53c88c,'confidence':_0x2fe4a1};})['catch'](function(_0x5c8fd1){logger['error']('[%s]\x20%s:%s',_0x5c8fd1['statusCode'],_0x5c8fd1[_0x29e8('0x51')],_0x5c8fd1[_0x29e8('0x52')]);});};exports[_0x29e8('0x53')]=function(_0x15d7d7,_0x25cf5b,_0x107499,_0x5bdca7){var _0x1092d5=apiai(_0x25cf5b,{'language':_0x5bdca7||'en'});return _0x1092d5[_0x29e8('0x54')](_0x107499,{'sessionId':md5(_0x15d7d7)})['then'](function(_0x26f555){logger['info'](JSON[_0x29e8('0x3e')](_0x26f555));return{'source':_0x26f555['result'][_0x29e8('0x55')],'resolvedQuery':_0x26f555[_0x29e8('0x56')]['resolvedQuery'],'action':_0x26f555[_0x29e8('0x56')][_0x29e8('0x57')],'actionIncomplete':_0x26f555[_0x29e8('0x56')][_0x29e8('0x58')],'speech':_0x26f555[_0x29e8('0x56')]['fulfillment'][_0x29e8('0x59')],'score':_0x26f555[_0x29e8('0x56')][_0x29e8('0x5a')],'statusCode':_0x26f555[_0x29e8('0x5b')][_0x29e8('0x5c')],'endConversation':_0x26f555[_0x29e8('0x56')]['metadata'][_0x29e8('0x5d')]||![],'isFallbackIntent':_0x26f555[_0x29e8('0x56')]['metadata'][_0x29e8('0x5e')]};});};exports[_0x29e8('0x5f')]=function(_0x490100,_0x3f832d,_0x51ce09,_0x5dd9f0,_0x14f85b,_0x7c91db){var _0x3a443b=_0x5dd9f0[_0x29e8('0x60')](/\\n/g,'\x0a');var _0x125a3c={'credentials':{'private_key':_0x3a443b,'client_email':_0x51ce09}};var _0x407f34=new dialogflow['SessionsClient'](_0x125a3c);var _0xe2e2db=_0x407f34[_0x29e8('0x61')](_0x3f832d,md5(_0x490100));var _0x52b703={'session':_0xe2e2db,'queryInput':{'text':{'text':_0x14f85b,'languageCode':_0x7c91db}}};return _0x407f34[_0x29e8('0x62')](_0x52b703)[_0x29e8('0x2b')](function(_0x544f46){if(_0x544f46&&_0x544f46[_0x29e8('0x43')]){logger['info'](_0x29e8('0x63'),JSON[_0x29e8('0x3e')](_0x544f46));var _0x232e5d=_0x544f46[0x0];if(_0x232e5d){var _0x3b9992={'action':_0x232e5d[_0x29e8('0x64')][_0x29e8('0x57')],'allRequiredParamsPresent':_0x232e5d['queryResult'][_0x29e8('0x65')],'endConversation':_0x232e5d['queryResult'][_0x29e8('0x66')]&&_0x232e5d['queryResult'][_0x29e8('0x66')][_0x29e8('0x67')]?_0x232e5d['queryResult'][_0x29e8('0x66')][_0x29e8('0x67')][_0x29e8('0x68')][_0x29e8('0x69')]:![],'fulfillmentText':_0x232e5d['queryResult'][_0x29e8('0x6a')],'intentName':_0x232e5d[_0x29e8('0x64')]['intent'][_0x29e8('0x51')],'intentDisplayName':_0x232e5d['queryResult']['intent'][_0x29e8('0x6b')],'isFallbackIntent':_0x232e5d[_0x29e8('0x64')]['intent']['isFallback'],'languageCode':_0x232e5d[_0x29e8('0x64')][_0x29e8('0x6c')],'queryText':_0x232e5d[_0x29e8('0x64')][_0x29e8('0x6d')],'responseId':_0x232e5d['responseId'],'score':_0x232e5d[_0x29e8('0x64')]['intentDetectionConfidence'],'speech':_0x232e5d[_0x29e8('0x64')][_0x29e8('0x6a')],'providerResponse':JSON[_0x29e8('0x3e')](_0x544f46)};return _0x3b9992;}}});};exports[_0x29e8('0x6e')]=function(_0x1350aa,_0x4abc5e,_0x582973,_0x5b2c91){return tilde[_0x29e8('0x48')](_0x1350aa,_0x4abc5e,_0x582973,_0x5b2c91)[_0x29e8('0x2b')](function(_0x4fe891){try{fs['unlink'](_0x1350aa);}catch(_0x244859){logger[_0x29e8('0x15')](_0x244859);}logger['info']('Tilde\x20ASR\x20transcription',_0x4fe891[_0x29e8('0x4d')]);logger['info'](_0x29e8('0x6f'),_0x4fe891[_0x29e8('0x4f')]);return _0x4fe891;});};exports[_0x29e8('0x70')]=function(_0xedf078,_0x33c96d,_0x237c6b,_0x57cadc,_0x165a4a,_0x1db74c){var _0x28cc9f=path[_0x29e8('0x25')](__dirname,_0x29e8('0x26'),rs['generate'](0x4)+'.mp3');var _0x223a6b;return aws['polly'](_0xedf078,_0x33c96d,_0x237c6b,_0x57cadc,_0x165a4a,_0x1db74c,_0x28cc9f)[_0x29e8('0x2b')](function(){_0x223a6b=path[_0x29e8('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0x29e8('0x28'));return convertFile(_0x28cc9f,_0x223a6b);})['then'](function(){try{fs[_0x29e8('0x1d')](_0x28cc9f);fs[_0x29e8('0x2c')](_0x223a6b,_0x29e8('0x2d'));}catch(_0x871214){logger[_0x29e8('0x15')](_0x871214);}return _0x223a6b[_0x29e8('0x3a')]('.')[0x0];});};exports[_0x29e8('0x71')]=function(_0x1923b1,_0xf30cda,_0x3f4fd3,_0x39eaab,_0x12d3f7,_0x4028d9){return aws[_0x29e8('0x72')](_0x1923b1,_0xf30cda,_0x3f4fd3,_0x39eaab,_0x12d3f7,_0x4028d9)[_0x29e8('0x2b')](function(_0x42f754){logger[_0x29e8('0x1b')](JSON[_0x29e8('0x3e')](_0x42f754));return _0x42f754;});};exports[_0x29e8('0x73')]=function(_0x3cac2f,_0x41677b,_0x20eebe,_0x484836){var _0x582b61=util[_0x29e8('0x74')](_0x29e8('0x75'),ISPEECH_API,_0x3cac2f,encodeURIComponent(_0x41677b),_0x20eebe,_0x484836);var _0x5eaa4a=path['resolve'](__dirname,_0x29e8('0x26'),rs[_0x29e8('0x27')](0x4)+_0x29e8('0x36'));var _0x2203b6;return downloadFile(_0x582b61,_0x5eaa4a)[_0x29e8('0x2b')](function(){_0x2203b6=path[_0x29e8('0x25')](__dirname,_0x29e8('0x26'),rs[_0x29e8('0x27')](0x4)+_0x29e8('0x28'));return convertFile(_0x5eaa4a,_0x2203b6);})[_0x29e8('0x2b')](function(){try{fs[_0x29e8('0x1d')](_0x5eaa4a);fs[_0x29e8('0x2c')](_0x2203b6,_0x29e8('0x2d'));}catch(_0x151a6e){logger[_0x29e8('0x15')](_0x151a6e);}return _0x2203b6['split']('.')[0x0];});};exports[_0x29e8('0x76')]=function(_0x2bbe6f,_0x4e0be3,_0x5c3eb8,_0x2048e5){var _0x1899bf=util['format'](_0x29e8('0x77'),ISPEECH_API,_0x4e0be3,_0x5c3eb8,base64Encode(_0x2bbe6f),_0x2048e5?util['format']('model=%s',encodeURIComponent(_0x2048e5)):_0x29e8('0x78'));return uploadFile(_0x1899bf)[_0x29e8('0x2b')](function(_0x5389a4){return querystring[_0x29e8('0x9')](_0x5389a4);});};exports[_0x29e8('0x79')]=function(_0x59f20a,_0x578e00){return sestek['nda'](_0x59f20a,_0x578e00)['then'](function(_0x1c0e81){logger[_0x29e8('0x1b')](JSON[_0x29e8('0x3e')](_0x1c0e81));var _0x143a1b={'speech':_0x1c0e81[_0x29e8('0x7a')],'action':_0x1c0e81[_0x29e8('0x7b')]?_0x1c0e81[_0x29e8('0x7b')][_0x29e8('0x7c')]:undefined,'actiondata':_0x1c0e81['channelData']?_0x1c0e81['channelData'][_0x29e8('0x7d')]:undefined};if(_0x1c0e81[_0x29e8('0x7b')]&&_0x1c0e81['channelData'][_0x29e8('0x7e')]){return base64Decode(_0x1c0e81['channelData'][_0x29e8('0x7e')][_0x29e8('0x7f')],path[_0x29e8('0x25')](__dirname,'tmp',rs[_0x29e8('0x27')](0x4)+'.wav'))['then'](function(_0x554d09){_0x143a1b[_0x29e8('0x80')]=_0x554d09;return _0x143a1b;});}return _0x143a1b;});};exports[_0x29e8('0x81')]=function(){return __dirname;}; \ No newline at end of file +var _0xadd2=['statusMessage','createWriteStream','finish','info','finish\x20download\x20file','unlink','pipe','end','https:','host','data','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','.mp3','from','audioContent','chmodSync','777','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','textRequest','result','source','action','actionIncomplete','fulfillment','speech','score','code','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','queryText','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','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','model=%s','freeform=3','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','md5','path','request-promise','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','protocol','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20'];(function(_0x56e3e4,_0x54ca3f){var _0x15f9e4=function(_0x1eed40){while(--_0x1eed40){_0x56e3e4['push'](_0x56e3e4['shift']());}};_0x15f9e4(++_0x54ca3f);}(_0xadd2,0x74));var _0x2add=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xadd2[_0x122ef9];return _0x42fba0;};'use strict';var apiai=require(_0x2add('0x0'));var BPromise=require(_0x2add('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x2add('0x2'));var https=require('https');var md5=require(_0x2add('0x3'));var path=require(_0x2add('0x4'));var querystring=require('querystring');var rp=require(_0x2add('0x5'));var rs=require('randomstring');var sox=require(_0x2add('0x6'));var tts=require(_0x2add('0x7'));var urlParse=require(_0x2add('0x8'))[_0x2add('0x9')];var util=require(_0x2add('0xa'));var aws=require(_0x2add('0xb'));var google=require('./google');var sestek=require(_0x2add('0xc'));var tilde=require(_0x2add('0xd'));var logger=require(_0x2add('0xe'))(_0x2add('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x5c6044,_0x1706b4){return new BPromise(function(_0x23cc55,_0x11932c){var _0x483ec9=urlParse(_0x5c6044);var _0x416897=_0x483ec9[_0x2add('0x10')]==='https:'?https:http;var _0x1bf579={'host':_0x483ec9['host'],'path':_0x483ec9[_0x2add('0x4')],'headers':{'user-agent':_0x2add('0x11')}};_0x416897[_0x2add('0x12')](_0x1bf579,function(_0x13917e){if(_0x13917e[_0x2add('0x13')]!==0xc8){logger[_0x2add('0x14')](_0x2add('0x15')+_0x5c6044+_0x2add('0x16')+_0x13917e[_0x2add('0x13')]+'\x20('+_0x13917e[_0x2add('0x17')]+')');_0x11932c(new Error(_0x2add('0x15')+_0x5c6044+_0x2add('0x16')+_0x13917e['statusCode']+'\x20('+_0x13917e['statusMessage']+')'));return;}var _0x242009=fs[_0x2add('0x18')](_0x1706b4);_0x242009['on'](_0x2add('0x19'),function(){logger[_0x2add('0x1a')](_0x2add('0x1b'));_0x242009['close'](_0x23cc55);});_0x242009['on'](_0x2add('0x14'),function(_0x2bf7a7){fs[_0x2add('0x1c')](_0x1706b4);logger['error']('download\x20error',_0x2bf7a7);_0x11932c(_0x2bf7a7);});_0x13917e[_0x2add('0x1d')](_0x242009);})['on']('error',function(_0x246b1b){logger[_0x2add('0x14')](_0x246b1b);_0x11932c(_0x246b1b);})[_0x2add('0x1e')]();});}function uploadFile(_0x1211a2){return new BPromise(function(_0x3d3315,_0x1a9a6a){var _0x135132=urlParse(_0x1211a2);var _0x276aab=_0x135132[_0x2add('0x10')]===_0x2add('0x1f')?https:http;var _0x277d41={'host':_0x135132[_0x2add('0x20')],'path':_0x135132[_0x2add('0x4')],'headers':{'user-agent':_0x2add('0x11')}};_0x276aab[_0x2add('0x12')](_0x277d41,function(_0xf220be){if(_0xf220be[_0x2add('0x13')]!==0xc8){_0x1a9a6a(new Error(_0x2add('0x15')+_0x1211a2+_0x2add('0x16')+_0xf220be[_0x2add('0x13')]+'\x20('+_0xf220be[_0x2add('0x17')]+')'));return;}var _0x588b29='';_0xf220be['on'](_0x2add('0x21'),function(_0x2bd3c6){_0x588b29+=_0x2bd3c6;});_0xf220be['on'](_0x2add('0x1e'),function(){_0x3d3315(_0x588b29);});})['on']('error',function(_0x24b397){_0x1a9a6a(_0x24b397);})['end']();});}function convertFile(_0x4bef0e,_0x39d1f2){return new BPromise(function(_0x2b5d3a,_0x590e2b){var _0x40ae3b=sox[_0x2add('0x22')](_0x4bef0e,_0x39d1f2,{'sampleRate':0x1f40,'format':_0x2add('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x40ae3b['on']('error',function(_0x5a7fa1){logger['error']('error\x20convert',_0x5a7fa1);_0x590e2b(_0x5a7fa1);});_0x40ae3b['on']('end',function(){logger['info'](_0x2add('0x24'));_0x2b5d3a();});_0x40ae3b[_0x2add('0x25')]();});}function base64Decode(_0x439908,_0x5e09df){var _0x40a93d=path[_0x2add('0x26')](__dirname,_0x2add('0x27'),rs[_0x2add('0x28')](0x4)+_0x2add('0x29'));fs[_0x2add('0x2a')](_0x40a93d,_0x439908,'base64');return convertFile(_0x40a93d,_0x5e09df)[_0x2add('0x2b')](function(){try{fs['unlink'](_0x40a93d);fs['chmodSync'](_0x5e09df,'777');}catch(_0xd6f043){logger[_0x2add('0x14')](_0xd6f043);}return _0x5e09df['split']('.')[0x0];});}function base64Encode(_0x55eee0){var _0x3ffa68=fs[_0x2add('0x2c')](_0x55eee0);return new Buffer(_0x3ffa68)[_0x2add('0x2d')](_0x2add('0x2e'));}exports[_0x2add('0x2f')]=function(_0x19755a,_0x42b763,_0xfe5661,_0x3c7eaa,_0x4b8b26,_0x38ef01){var _0x4e1fa1,_0x163ad9;var _0x350f21=_0x2add('0x30');var _0x5a18c1=_0x2add('0x31')+_0x19755a;var _0x20e3cb={};if(_0x42b763===_0x2add('0x32')){_0x20e3cb[_0x2add('0x33')]={'ssml':_0xfe5661};}else{_0x20e3cb['input']={'text':_0xfe5661};};_0x20e3cb['voice']={'languageCode':_0x3c7eaa,'ssmlGender':_0x4b8b26};_0x20e3cb[_0x2add('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2b0db9={'url':_0x350f21+_0x2add('0x35')+_0x5a18c1,'method':'POST','json':!![],'body':_0x20e3cb};return rp(_0x2b0db9)[_0x2add('0x2b')](function(_0x3589a9){return new BPromise(function(_0x749dee,_0x5630fe){_0x4e1fa1=path[_0x2add('0x26')](__dirname,_0x2add('0x27'),rs[_0x2add('0x28')](0x4)+_0x2add('0x36'));var _0x3a8a6f=Buffer[_0x2add('0x37')](_0x3589a9[_0x2add('0x38')],_0x2add('0x2e'));return fs['writeFile'](_0x4e1fa1,_0x3a8a6f,function(_0x401547){_0x5630fe(_0x401547);},function(_0x27d42e){fs[_0x2add('0x39')](_0x4e1fa1,'777');_0x749dee(_0x27d42e);});});})[_0x2add('0x2b')](function(_0x92ed5d){_0x163ad9=path[_0x2add('0x26')](__dirname,_0x2add('0x27'),rs['generate'](0x4)+_0x2add('0x29'));return convertFile(_0x4e1fa1,_0x163ad9);})[_0x2add('0x2b')](function(){try{fs['unlink'](_0x4e1fa1);fs[_0x2add('0x39')](_0x163ad9,_0x2add('0x3a'));}catch(_0x312738){logger[_0x2add('0x14')](_0x312738);}logger[_0x2add('0x1a')](_0x2add('0x3b'),_0x163ad9[_0x2add('0x3c')]('.')[0x0]);return _0x163ad9[_0x2add('0x3c')]('.')[0x0];});};exports[_0x2add('0x3d')]=function(_0x6256f7,_0x3748ee){var _0x5c9bb8=_0x2add('0x3e');var _0x431605,_0x2a5aa8;var _0x548cab;var _0x35a26a={'encoding':_0x2add('0x3f'),'method':_0x2add('0x40'),'timeout':0x2710,'url':_0x5c9bb8,'headers':{'Content-Type':_0x2add('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0x2add('0x42')]([[[_0x2add('0x43'),JSON[_0x2add('0x42')]([_0x6256f7,_0x3748ee||'en',![],_0x2add('0x44')]),null,_0x2add('0x45')]]]))};return rp(_0x35a26a)[_0x2add('0x2b')](function(_0x21ddd1){try{_0x548cab=eval(_0x21ddd1[_0x2add('0x46')](0x5))[0x0][0x2];}catch(_0x4323ce){throw new Error(_0x2add('0x47')+_0x21ddd1['data']);}if(!_0x548cab){if(_0x6256f7[_0x2add('0x48')]>0xc8){throw new Error(_0x2add('0x49'));}else{throw new Error(_0x2add('0x4a')+_0x3748ee+_0x2add('0x4b'));}}try{_0x548cab=eval(_0x548cab)[0x0];}catch(_0x55fcf8){throw new Error(_0x2add('0x47')+res[_0x2add('0x21')]);}const _0x842090=_0x548cab;_0x431605=path[_0x2add('0x26')](__dirname,'tmp',rs[_0x2add('0x28')](0x4)+'.mp3');fs[_0x2add('0x2a')](_0x431605,_0x548cab,{'encoding':_0x2add('0x2e')});_0x2a5aa8=path['resolve'](__dirname,_0x2add('0x27'),rs['generate'](0x4)+_0x2add('0x29'));return convertFile(_0x431605,_0x2a5aa8);})[_0x2add('0x2b')](function(){try{fs[_0x2add('0x1c')](_0x431605);fs['chmodSync'](_0x2a5aa8,_0x2add('0x3a'));}catch(_0x4d2785){logger['error'](_0x4d2785);}logger[_0x2add('0x1a')](_0x2add('0x4c'),_0x2a5aa8[_0x2add('0x3c')]('.')[0x0]);return _0x2a5aa8['split']('.')[0x0];});};exports['googleASR']=function(_0x44b314,_0x2b68c6,_0x2027e8){return google[_0x2add('0x4d')](_0x44b314,_0x2b68c6,_0x2027e8)[_0x2add('0x2b')](function(_0x18749a){logger[_0x2add('0x1a')](_0x18749a[_0x2add('0x4e')]);return rp(_0x18749a);})[_0x2add('0x2b')](function(_0x2361a3){var _0x3a3d32='';var _0x34ec35=0x0;try{fs['unlink'](_0x44b314);}catch(_0x267081){logger[_0x2add('0x14')](_0x267081);}if(_0x2361a3&&_0x2361a3['results']){_0x3a3d32=_0x2361a3[_0x2add('0x4f')][_0x2add('0x50')](function(_0x55b55b){return _0x55b55b&&_0x55b55b['alternatives'][0x0]&&_0x55b55b[_0x2add('0x51')][0x0][_0x2add('0x52')]?_0x55b55b[_0x2add('0x51')][0x0][_0x2add('0x52')]:'';})['join']('\x0a');_0x34ec35=_0x2361a3[_0x2add('0x4f')][_0x2add('0x50')](function(_0x6ccfe6){return _0x6ccfe6&&_0x6ccfe6[_0x2add('0x51')][0x0]&&_0x6ccfe6['alternatives'][0x0]['confidence']?_0x6ccfe6['alternatives'][0x0]['confidence']:0x0;})[_0x2add('0x53')]('\x0a');}logger[_0x2add('0x1a')](_0x2add('0x54'),_0x3a3d32);logger[_0x2add('0x1a')](_0x2add('0x55'),_0x34ec35);return{'transcript':_0x3a3d32,'confidence':_0x34ec35};})[_0x2add('0x56')](function(_0x3056f7){logger[_0x2add('0x14')]('[%s]\x20%s:%s',_0x3056f7[_0x2add('0x13')],_0x3056f7[_0x2add('0x57')],_0x3056f7[_0x2add('0x58')]);});};exports['googleDialogflow']=function(_0x369b21,_0x5ba806,_0x573216,_0x518069){var _0x277ab1=apiai(_0x5ba806,{'language':_0x518069||'en'});return _0x277ab1[_0x2add('0x59')](_0x573216,{'sessionId':md5(_0x369b21)})[_0x2add('0x2b')](function(_0x1d99b5){logger[_0x2add('0x1a')](JSON[_0x2add('0x42')](_0x1d99b5));return{'source':_0x1d99b5[_0x2add('0x5a')][_0x2add('0x5b')],'resolvedQuery':_0x1d99b5[_0x2add('0x5a')]['resolvedQuery'],'action':_0x1d99b5[_0x2add('0x5a')][_0x2add('0x5c')],'actionIncomplete':_0x1d99b5['result'][_0x2add('0x5d')],'speech':_0x1d99b5[_0x2add('0x5a')][_0x2add('0x5e')][_0x2add('0x5f')],'score':_0x1d99b5['result'][_0x2add('0x60')],'statusCode':_0x1d99b5['status'][_0x2add('0x61')],'endConversation':_0x1d99b5[_0x2add('0x5a')]['metadata'][_0x2add('0x62')]||![],'isFallbackIntent':_0x1d99b5['result']['metadata'][_0x2add('0x63')]};});};exports[_0x2add('0x64')]=function(_0x36bbb6,_0x3504ec,_0x1f2469,_0x455447,_0x3a0e72,_0x51ca82){var _0x25b920=_0x455447[_0x2add('0x65')](/\\n/g,'\x0a');var _0x4d8315={'credentials':{'private_key':_0x25b920,'client_email':_0x1f2469}};var _0x20139c=new dialogflow['SessionsClient'](_0x4d8315);var _0x2ff49e=_0x20139c[_0x2add('0x66')](_0x3504ec,md5(_0x36bbb6));var _0x4aa0fc={'session':_0x2ff49e,'queryInput':{'text':{'text':_0x3a0e72,'languageCode':_0x51ca82}}};return _0x20139c[_0x2add('0x67')](_0x4aa0fc)[_0x2add('0x2b')](function(_0x575366){if(_0x575366&&_0x575366[_0x2add('0x48')]){logger[_0x2add('0x1a')](_0x2add('0x68'),JSON[_0x2add('0x42')](_0x575366));var _0x1dd7d3=_0x575366[0x0];if(_0x1dd7d3){var _0x1c9173={'action':_0x1dd7d3[_0x2add('0x69')][_0x2add('0x5c')],'allRequiredParamsPresent':_0x1dd7d3[_0x2add('0x69')][_0x2add('0x6a')],'endConversation':_0x1dd7d3[_0x2add('0x69')][_0x2add('0x6b')]&&_0x1dd7d3[_0x2add('0x69')][_0x2add('0x6b')][_0x2add('0x6c')]?_0x1dd7d3[_0x2add('0x69')][_0x2add('0x6b')]['fields'][_0x2add('0x6d')][_0x2add('0x6e')]:![],'fulfillmentText':_0x1dd7d3[_0x2add('0x69')]['fulfillmentText'],'intentName':_0x1dd7d3[_0x2add('0x69')][_0x2add('0x6f')][_0x2add('0x57')],'intentDisplayName':_0x1dd7d3[_0x2add('0x69')]['intent'][_0x2add('0x70')],'isFallbackIntent':_0x1dd7d3[_0x2add('0x69')]['intent']['isFallback'],'languageCode':_0x1dd7d3['queryResult']['languageCode'],'queryText':_0x1dd7d3['queryResult'][_0x2add('0x71')],'responseId':_0x1dd7d3['responseId'],'score':_0x1dd7d3[_0x2add('0x69')][_0x2add('0x72')],'speech':_0x1dd7d3[_0x2add('0x69')][_0x2add('0x73')],'providerResponse':JSON[_0x2add('0x42')](_0x575366)};return _0x1c9173;}}});};exports[_0x2add('0x74')]=function(_0x3f0519,_0x4964b6,_0x45d582,_0x28ff07){return tilde[_0x2add('0x4d')](_0x3f0519,_0x4964b6,_0x45d582,_0x28ff07)['then'](function(_0x65e9ac){try{fs[_0x2add('0x1c')](_0x3f0519);}catch(_0x5b4d3c){logger[_0x2add('0x14')](_0x5b4d3c);}logger['info'](_0x2add('0x75'),_0x65e9ac[_0x2add('0x52')]);logger[_0x2add('0x1a')](_0x2add('0x76'),_0x65e9ac[_0x2add('0x77')]);return _0x65e9ac;});};exports[_0x2add('0x78')]=function(_0x3b024e,_0x3ce899,_0xc20565,_0x326646,_0x14a5e1,_0x2cbe8b){var _0x3b8d2b=path[_0x2add('0x26')](__dirname,_0x2add('0x27'),rs[_0x2add('0x28')](0x4)+_0x2add('0x36'));var _0x2ea89e;return aws[_0x2add('0x79')](_0x3b024e,_0x3ce899,_0xc20565,_0x326646,_0x14a5e1,_0x2cbe8b,_0x3b8d2b)[_0x2add('0x2b')](function(){_0x2ea89e=path[_0x2add('0x26')](__dirname,_0x2add('0x27'),rs[_0x2add('0x28')](0x4)+_0x2add('0x29'));return convertFile(_0x3b8d2b,_0x2ea89e);})[_0x2add('0x2b')](function(){try{fs[_0x2add('0x1c')](_0x3b8d2b);fs['chmodSync'](_0x2ea89e,_0x2add('0x3a'));}catch(_0x3e2bda){logger[_0x2add('0x14')](_0x3e2bda);}return _0x2ea89e[_0x2add('0x3c')]('.')[0x0];});};exports[_0x2add('0x7a')]=function(_0xb2c55,_0x1ca015,_0x58a32b,_0x4cc041,_0x210b73,_0x5ce0dc){return aws[_0x2add('0x7b')](_0xb2c55,_0x1ca015,_0x58a32b,_0x4cc041,_0x210b73,_0x5ce0dc)[_0x2add('0x2b')](function(_0x525dbe){logger['info'](JSON['stringify'](_0x525dbe));return _0x525dbe;});};exports[_0x2add('0x7c')]=function(_0x422426,_0x4c304c,_0x5b875d,_0x3229e9){var _0x1cd6b2=util[_0x2add('0x7d')](_0x2add('0x7e'),ISPEECH_API,_0x422426,encodeURIComponent(_0x4c304c),_0x5b875d,_0x3229e9);var _0x74f9e=path[_0x2add('0x26')](__dirname,_0x2add('0x27'),rs['generate'](0x4)+'.mp3');var _0x130a8b;return downloadFile(_0x1cd6b2,_0x74f9e)[_0x2add('0x2b')](function(){_0x130a8b=path[_0x2add('0x26')](__dirname,_0x2add('0x27'),rs[_0x2add('0x28')](0x4)+_0x2add('0x29'));return convertFile(_0x74f9e,_0x130a8b);})[_0x2add('0x2b')](function(){try{fs[_0x2add('0x1c')](_0x74f9e);fs['chmodSync'](_0x130a8b,'777');}catch(_0x4557aa){logger[_0x2add('0x14')](_0x4557aa);}return _0x130a8b[_0x2add('0x3c')]('.')[0x0];});};exports[_0x2add('0x7f')]=function(_0x16c0d3,_0x13ec65,_0x55b258,_0x32a649){var _0x303892=util[_0x2add('0x7d')](_0x2add('0x80'),ISPEECH_API,_0x13ec65,_0x55b258,base64Encode(_0x16c0d3),_0x32a649?util[_0x2add('0x7d')](_0x2add('0x81'),encodeURIComponent(_0x32a649)):_0x2add('0x82'));return uploadFile(_0x303892)[_0x2add('0x2b')](function(_0x3849fd){return querystring[_0x2add('0x9')](_0x3849fd);});};exports['sestekNDA']=function(_0x842e41,_0x330dbf){return sestek[_0x2add('0x83')](_0x842e41,_0x330dbf)[_0x2add('0x2b')](function(_0x50668e){logger['info'](JSON[_0x2add('0x42')](_0x50668e));var _0x13791f={'speech':_0x50668e[_0x2add('0x84')],'action':_0x50668e[_0x2add('0x85')]?_0x50668e[_0x2add('0x85')]['CustomAction']:undefined,'actiondata':_0x50668e[_0x2add('0x85')]?_0x50668e['channelData'][_0x2add('0x86')]:undefined};if(_0x50668e[_0x2add('0x85')]&&_0x50668e['channelData'][_0x2add('0x87')]){return base64Decode(_0x50668e['channelData'][_0x2add('0x87')][_0x2add('0x88')],path['resolve'](__dirname,_0x2add('0x27'),rs[_0x2add('0x28')](0x4)+_0x2add('0x29')))[_0x2add('0x2b')](function(_0x1828e9){_0x13791f[_0x2add('0x89')]=_0x1828e9;return _0x13791f;});}return _0x13791f;});};exports[_0x2add('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 6236ff5..f2ef7e2 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 _0xd8af=['./nda','exports'];(function(_0x379cb3,_0x36b828){var _0x29867f=function(_0x31f8b3){while(--_0x31f8b3){_0x379cb3['push'](_0x379cb3['shift']());}};_0x29867f(++_0x36b828);}(_0xd8af,0x162));var _0xfd8a=function(_0x2ef22d,_0x13ebc8){_0x2ef22d=_0x2ef22d-0x0;var _0x5dc1f7=_0xd8af[_0x2ef22d];return _0x5dc1f7;};var nda=require(_0xfd8a('0x0'));module[_0xfd8a('0x1')]={'nda':nda}; \ No newline at end of file +var _0x3a61=['./nda','exports'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0x3a61,0x140));var _0x13a6=function(_0x1f803d,_0x1c966e){_0x1f803d=_0x1f803d-0x0;var _0x549186=_0x3a61[_0x1f803d];return _0x549186;};var nda=require(_0x13a6('0x0'));module[_0x13a6('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index f31462d..2df8225 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 _0xf257=['extension','text','Bearer\x20','access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','ndaactivity_type','message','callerid','dnid'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf257,0x82));var _0x7f25=function(_0x2567b7,_0x10f946){_0x2567b7=_0x2567b7-0x0;var _0x3dcd65=_0xf257[_0x2567b7];return _0x3dcd65;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x7f25('0x0'))(_0x7f25('0x1'));module[_0x7f25('0x2')]=function(_0x22d4a9,_0x5c712c){var _0x159dd1={'method':_0x7f25('0x3'),'uri':url[_0x7f25('0x4')](_0x5c712c[_0x7f25('0x5')],_0x7f25('0x6')),'form':{'grant_type':_0x7f25('0x7'),'username':_0x5c712c[_0x7f25('0x8')],'password':_0x5c712c[_0x7f25('0x7')]},'json':!![]};return rp(_0x159dd1)[_0x7f25('0x9')](function(_0x16e278){var _0x31a5d8={'method':_0x7f25('0x3'),'uri':url[_0x7f25('0x4')](_0x5c712c[_0x7f25('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5c712c[_0x7f25('0xb')]||_0x7f25('0xc'),'channelId':'Nda','conversation':{'id':_0x22d4a9['uniqueid']},'from':{'id':_0x22d4a9[_0x7f25('0xd')],'name':_0x22d4a9['calleridname']},'recipient':{'id':_0x22d4a9[_0x7f25('0xe')],'name':_0x22d4a9[_0x7f25('0xf')]},'text':_0x5c712c[_0x7f25('0x10')],'channelData':{}},'headers':{'Authorization':_0x7f25('0x11')+_0x16e278[_0x7f25('0x12')]},'json':!![]};if(_0x5c712c[_0x7f25('0x13')]){_0x31a5d8[_0x7f25('0x14')]['channelData']['ProjectName']=_0x5c712c[_0x7f25('0x13')];}if(_0x5c712c['ndagenerate_audio']=='1'){_0x31a5d8[_0x7f25('0x14')][_0x7f25('0x15')][_0x7f25('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7f25('0x17')};}if(_0x5c712c[_0x7f25('0x18')]){_0x31a5d8['body']['channelData']['CustomAction']=_0x5c712c[_0x7f25('0x18')];if(_0x5c712c[_0x7f25('0x19')]){_0x31a5d8[_0x7f25('0x14')][_0x7f25('0x15')][_0x7f25('0x1a')]=_0x5c712c[_0x7f25('0x19')];}}logger[_0x7f25('0x1b')](JSON[_0x7f25('0x1c')](_0x31a5d8));return rp(_0x31a5d8);});}; \ No newline at end of file +var _0xac55=['password','then','ndassistant_url','message','Nda','callerid','calleridname','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token'];(function(_0x257b06,_0x46e8f6){var _0x2fc518=function(_0x477f9c){while(--_0x477f9c){_0x257b06['push'](_0x257b06['shift']());}};_0x2fc518(++_0x46e8f6);}(_0xac55,0x1c8));var _0x5ac5=function(_0x2f4eff,_0xabb247){_0x2f4eff=_0x2f4eff-0x0;var _0x1278b7=_0xac55[_0x2f4eff];return _0x1278b7;};'use strict';var rp=require(_0x5ac5('0x0'));var url=require(_0x5ac5('0x1'));var logger=require(_0x5ac5('0x2'))(_0x5ac5('0x3'));module['exports']=function(_0x17b1d9,_0x13fcc6){var _0x192f9d={'method':_0x5ac5('0x4'),'uri':url[_0x5ac5('0x5')](_0x13fcc6[_0x5ac5('0x6')],_0x5ac5('0x7')),'form':{'grant_type':'password','username':_0x13fcc6['username'],'password':_0x13fcc6[_0x5ac5('0x8')]},'json':!![]};return rp(_0x192f9d)[_0x5ac5('0x9')](function(_0x2bee03){var _0x42551a={'method':_0x5ac5('0x4'),'uri':url[_0x5ac5('0x5')](_0x13fcc6[_0x5ac5('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x13fcc6['ndaactivity_type']||_0x5ac5('0xb'),'channelId':_0x5ac5('0xc'),'conversation':{'id':_0x17b1d9['uniqueid']},'from':{'id':_0x17b1d9[_0x5ac5('0xd')],'name':_0x17b1d9[_0x5ac5('0xe')]},'recipient':{'id':_0x17b1d9['dnid'],'name':_0x17b1d9[_0x5ac5('0xf')]},'text':_0x13fcc6[_0x5ac5('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2bee03[_0x5ac5('0x11')]},'json':!![]};if(_0x13fcc6[_0x5ac5('0x12')]){_0x42551a[_0x5ac5('0x13')][_0x5ac5('0x14')][_0x5ac5('0x15')]=_0x13fcc6['project'];}if(_0x13fcc6[_0x5ac5('0x16')]=='1'){_0x42551a['body'][_0x5ac5('0x14')][_0x5ac5('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x13fcc6[_0x5ac5('0x18')]){_0x42551a['body'][_0x5ac5('0x14')][_0x5ac5('0x19')]=_0x13fcc6[_0x5ac5('0x18')];if(_0x13fcc6[_0x5ac5('0x1a')]){_0x42551a[_0x5ac5('0x13')][_0x5ac5('0x14')][_0x5ac5('0x1b')]=_0x13fcc6['custom_action_data'];}}logger[_0x5ac5('0x1c')](JSON['stringify'](_0x42551a));return rp(_0x42551a);});}; \ 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 28db710..18bcc2a 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 _0x4fe2=['./lib/api'];(function(_0x1a2b37,_0x4b95d9){var _0x3e82a5=function(_0x320174){while(--_0x320174){_0x1a2b37['push'](_0x1a2b37['shift']());}};_0x3e82a5(++_0x4b95d9);}(_0x4fe2,0x8e));var _0x24fe=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4fe2[_0x17d9e3];return _0x14192d;};'use strict';var asr=require(_0x24fe('0x0'));module['exports']=function(_0xdf4f8a,_0x32337d,_0x5cb558,_0x10e751){return asr(_0xdf4f8a,_0x32337d,_0x5cb558,_0x10e751);}; \ No newline at end of file +var _0x69f4=['exports','./lib/api'];(function(_0x48026f,_0xac5061){var _0x2990fe=function(_0x3e2183){while(--_0x3e2183){_0x48026f['push'](_0x48026f['shift']());}};_0x2990fe(++_0xac5061);}(_0x69f4,0x1b5));var _0x469f=function(_0xaef393,_0x3bb479){_0xaef393=_0xaef393-0x0;var _0x180e7e=_0x69f4[_0xaef393];return _0x180e7e;};'use strict';var asr=require(_0x469f('0x0'));module[_0x469f('0x1')]=function(_0x2248ba,_0x29c036,_0x3853f5,_0x9dd15a){return asr(_0x2248ba,_0x29c036,_0x3853f5,_0x9dd15a);}; \ 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 3162b2e..f91bcf7 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 _0x268b=['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','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','data','send','close','EOS','error','parse','status','result','final','hypotheses','transcript','likelihood','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info'];(function(_0x253f4c,_0x19d85f){var _0x15f4b7=function(_0xf12b5){while(--_0xf12b5){_0x253f4c['push'](_0x253f4c['shift']());}};_0x15f4b7(++_0x19d85f);}(_0x268b,0xc5));var _0xb268=function(_0x4bed75,_0x211cc7){_0x4bed75=_0x4bed75-0x0;var _0x2dd8e8=_0x268b[_0x4bed75];return _0x2dd8e8;};'use strict';var BPromise=require(_0xb268('0x0'));var _=require(_0xb268('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb268('0x2'));var crypto=require(_0xb268('0x3'));var logger=require(_0xb268('0x4'))(_0xb268('0x5'));module[_0xb268('0x6')]=function(_0x386204,_0x837b28,_0x69ca00,_0x492eef){return new BPromise(function(_0x57529e,_0x50c4dc){logger[_0xb268('0x7')]('Tilde\x20URI',_0x492eef||_0xb268('0x8'));var _0x55d87a=new WebSocket(_0x492eef||_0xb268('0x8'),{'perMessageDeflate':![]});var _0x4ef01e='';var _0x1a80fc='0';var _0x19cd8f='1';var _0x16e9dc=_0xb268('0x9');function _0x2ca45f(_0x356c06){var _0x872d23=crypto[_0xb268('0xa')](_0xb268('0xb'));_0x872d23[_0xb268('0xc')](_0x356c06);return _0x872d23[_0xb268('0xd')](_0xb268('0xe'));}function _0xaa30b7(){try{logger[_0xb268('0x7')](_0xb268('0xf'));var _0x4a6e64=moment()[_0xb268('0x10')]();var _0x187a8e=_0x2ca45f(_0x4a6e64+_0x837b28+_0x69ca00);_0x55d87a['send'](JSON[_0xb268('0x11')]({'appID':_0x837b28,'timestamp':_0x4a6e64,'appKey':_0x187a8e}));var _0x3ec65f=fs['createReadStream'](_0x386204);_0x3ec65f['on'](_0xb268('0x12'),function(_0x207592){_0x55d87a[_0xb268('0x13')](_0x207592);});_0x3ec65f['on'](_0xb268('0x14'),function(){_0x55d87a['send'](_0xb268('0x15'));});}catch(_0x3bcadc){logger[_0xb268('0x16')]('Tilde\x20ASR\x20send\x20error',JSON[_0xb268('0x11')](_0x3bcadc));_0x55d87a['terminate']();}}function _0x17763b(_0x58d59d){try{if(_0x58d59d){var _0x41114e=JSON[_0xb268('0x17')](_0x58d59d);switch(_0x41114e[_0xb268('0x18')]){case 0x0:if(_0x41114e['result']){if(_0x41114e[_0xb268('0x19')][_0xb268('0x1a')]){logger[_0xb268('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0xb268('0x11')](_0x41114e['result'][_0xb268('0x1b')]));_0x4ef01e=_0x41114e['result']['hypotheses'][0x0][_0xb268('0x1c')];_0x1a80fc=_0x41114e[_0xb268('0x19')][_0xb268('0x1b')][0x0][_0xb268('0x1d')];_0x19cd8f='0';_0x16e9dc='Success.';_0x55d87a[_0xb268('0x1e')]();}}break;case 0x1:logger[_0xb268('0x7')](_0xb268('0x9'));_0x19cd8f='1';_0x16e9dc='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xb268('0x7')](_0xb268('0x1f'));_0x19cd8f='2';_0x16e9dc=_0xb268('0x1f');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x19cd8f='9';_0x16e9dc=_0xb268('0x20');break;case 0xa:logger[_0xb268('0x7')](_0xb268('0x21'));_0x19cd8f='10';_0x16e9dc=_0xb268('0x21');break;case 0xb:logger[_0xb268('0x7')](_0xb268('0x22'));_0x19cd8f='11';_0x16e9dc=_0xb268('0x22');}}}catch(_0x46545e){logger[_0xb268('0x16')](_0xb268('0x23'),JSON[_0xb268('0x11')](_0x46545e));_0x55d87a[_0xb268('0x1e')]();}}function _0x2fe212(){logger[_0xb268('0x7')](_0xb268('0x24'));_0x57529e({'transcript':_0x4ef01e,'confidence':_0x1a80fc,'status':_0x19cd8f,'status_message':_0x16e9dc});}function _0x3a051c(_0x5419c5){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xb268('0x25')](_0x5419c5)){logger[_0xb268('0x16')](_[_0xb268('0x26')](_0x5419c5)?JSON['stringify'](_0x5419c5):_0x5419c5);}}_0x55d87a['on'](_0xb268('0x27'),_0xaa30b7);_0x55d87a['on'](_0xb268('0x28'),_0x17763b);_0x55d87a['on'](_0xb268('0x14'),_0x2fe212);_0x55d87a['on'](_0xb268('0x16'),_0x3a051c);});}; \ No newline at end of file +var _0xb10c=['status','result','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','terminate','Error\x20Tilde\x20ASR\x20socket','isObject','open','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','digest','stringify','createReadStream','close','send','error','Tilde\x20ASR\x20send\x20error','parse'];(function(_0x4dc392,_0x255362){var _0x4e45ad=function(_0x1d932d){while(--_0x1d932d){_0x4dc392['push'](_0x4dc392['shift']());}};_0x4e45ad(++_0x255362);}(_0xb10c,0x141));var _0xcb10=function(_0x10bb45,_0xa57a18){_0x10bb45=_0x10bb45-0x0;var _0x4f1846=_0xb10c[_0x10bb45];return _0x4f1846;};'use strict';var BPromise=require(_0xcb10('0x0'));var _=require(_0xcb10('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xcb10('0x2'));var logger=require(_0xcb10('0x3'))(_0xcb10('0x4'));module[_0xcb10('0x5')]=function(_0x3033cb,_0x57f7e6,_0x53b64a,_0x3eeac5){return new BPromise(function(_0x52056d,_0x2db8c1){logger[_0xcb10('0x6')](_0xcb10('0x7'),_0x3eeac5||_0xcb10('0x8'));var _0x310cc7=new WebSocket(_0x3eeac5||_0xcb10('0x8'),{'perMessageDeflate':![]});var _0x37a791='';var _0x2f92f3='0';var _0x182387='1';var _0x1164d7='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x335538(_0x4916ec){var _0x3cf200=crypto[_0xcb10('0x9')](_0xcb10('0xa'));_0x3cf200['update'](_0x4916ec);return _0x3cf200[_0xcb10('0xb')]('hex');}function _0x3657e6(){try{logger[_0xcb10('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x407c82=moment()['unix']();var _0xc9d34a=_0x335538(_0x407c82+_0x57f7e6+_0x53b64a);_0x310cc7['send'](JSON[_0xcb10('0xc')]({'appID':_0x57f7e6,'timestamp':_0x407c82,'appKey':_0xc9d34a}));var _0x36dd20=fs[_0xcb10('0xd')](_0x3033cb);_0x36dd20['on']('data',function(_0x3768a6){_0x310cc7['send'](_0x3768a6);});_0x36dd20['on'](_0xcb10('0xe'),function(){_0x310cc7[_0xcb10('0xf')]('EOS');});}catch(_0x4af0ab){logger[_0xcb10('0x10')](_0xcb10('0x11'),JSON[_0xcb10('0xc')](_0x4af0ab));_0x310cc7['terminate']();}}function _0x401f0c(_0x5b7736){try{if(_0x5b7736){var _0xc1f6c7=JSON[_0xcb10('0x12')](_0x5b7736);switch(_0xc1f6c7[_0xcb10('0x13')]){case 0x0:if(_0xc1f6c7[_0xcb10('0x14')]){if(_0xc1f6c7[_0xcb10('0x14')]['final']){logger[_0xcb10('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0xcb10('0xc')](_0xc1f6c7[_0xcb10('0x14')][_0xcb10('0x15')]));_0x37a791=_0xc1f6c7[_0xcb10('0x14')]['hypotheses'][0x0][_0xcb10('0x16')];_0x2f92f3=_0xc1f6c7['result'][_0xcb10('0x15')][0x0][_0xcb10('0x17')];_0x182387='0';_0x1164d7=_0xcb10('0x18');_0x310cc7['terminate']();}}break;case 0x1:logger[_0xcb10('0x6')](_0xcb10('0x19'));_0x182387='1';_0x1164d7=_0xcb10('0x19');break;case 0x2:logger[_0xcb10('0x6')](_0xcb10('0x1a'));_0x182387='2';_0x1164d7=_0xcb10('0x1a');break;case 0x9:logger[_0xcb10('0x6')](_0xcb10('0x1b'));_0x182387='9';_0x1164d7=_0xcb10('0x1b');break;case 0xa:logger[_0xcb10('0x6')](_0xcb10('0x1c'));_0x182387='10';_0x1164d7='Authentication\x20failed.';break;case 0xb:logger['info'](_0xcb10('0x1d'));_0x182387='11';_0x1164d7=_0xcb10('0x1d');}}}catch(_0x1359de){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xcb10('0xc')](_0x1359de));_0x310cc7[_0xcb10('0x1e')]();}}function _0x26d748(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x52056d({'transcript':_0x37a791,'confidence':_0x2f92f3,'status':_0x182387,'status_message':_0x1164d7});}function _0x390f6b(_0xa352d4){logger[_0xcb10('0x10')](_0xcb10('0x1f'));if(!_['isNil'](_0xa352d4)){logger['error'](_[_0xcb10('0x20')](_0xa352d4)?JSON[_0xcb10('0xc')](_0xa352d4):_0xa352d4);}}_0x310cc7['on'](_0xcb10('0x21'),_0x3657e6);_0x310cc7['on']('message',_0x401f0c);_0x310cc7['on'](_0xcb10('0xe'),_0x26d748);_0x310cc7['on'](_0xcb10('0x10'),_0x390f6b);});}; \ 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 2420c4b..5eabfda 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 _0xccbe=['./asr'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xccbe,0x12a));var _0xeccb=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0xccbe[_0x5180c3];return _0x55c975;};var asr=require(_0xeccb('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xcff2=['./asr','exports'];(function(_0x2e49f7,_0x583530){var _0x44a5a6=function(_0x5355f8){while(--_0x5355f8){_0x2e49f7['push'](_0x2e49f7['shift']());}};_0x44a5a6(++_0x583530);}(_0xcff2,0xd4));var _0x2cff=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0xcff2[_0x22377a];return _0x36f105;};var asr=require(_0x2cff('0x0'));module[_0x2cff('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 346da93..25a5495 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x198531,_0x2150ad){var _0x2991eb=function(_0x5d81c4){while(--_0x5d81c4){_0x198531['push'](_0x198531['shift']());}};_0x2991eb(++_0x2150ad);}(_0x34e8,0x12c));var _0x834e=function(_0x49085d,_0x26ca17){_0x49085d=_0x49085d-0x0;var _0x3c1485=_0x34e8[_0x49085d];return _0x3c1485;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index eb48e27..e12ee6f 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 _0x1df7=['login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','subject','template_id','debug','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\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','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','split','join','exports','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','menu','getdigits','channel','mailRpc','prototype','getVariable','rpc','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','body','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','ispeechTTS','key','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','googleASR','tildeASR','appid','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isArray','length','isPlainObject','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','password','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','sestekNDA','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','DIAL','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','true','false','EVAL\x20CONDITION\x20%s\x20%s','condition','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','intKey','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable'];(function(_0x494717,_0x3ce8ea){var _0x3c5d7e=function(_0x5473b1){while(--_0x5473b1){_0x494717['push'](_0x494717['shift']());}};_0x3c5d7e(++_0x3ce8ea);}(_0x1df7,0x6e));var _0x71df=function(_0x363974,_0x34a5ef){_0x363974=_0x363974-0x0;var _0x524fdc=_0x1df7[_0x363974];return _0x524fdc;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x71df('0x0'));var sh=require(_0x71df('0x1'));var odbc=require(_0x71df('0x2'))();var rs=require(_0x71df('0x3'));var moment=require(_0x71df('0x4'));var Mustache=require(_0x71df('0x5'));var rp=require(_0x71df('0x6'));var logger=require(_0x71df('0x7'))(_0x71df('0x8'));var config=require(_0x71df('0x9'));var shared=require(_0x71df('0xa'));var scripts=require(_0x71df('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x71df('0xc'),'rawBody'];var verticesWithRetry=[_0x71df('0xd'),_0x71df('0xe'),'getsecretdigits'];var AGIVertices=function(_0x32f8cd,_0x4a4575,_0x3cb3be){this[_0x71df('0xf')]=_0x32f8cd;this['rpc']=_0x4a4575;this[_0x71df('0x10')]=_0x3cb3be;};AGIVertices[_0x71df('0x11')][_0x71df('0x12')]=function(_0x57e114,_0x39e325){this[_0x71df('0x13')]['getVariableById'](_0x57e114)[_0x71df('0x14')](function(_0x349233){_0x39e325(null,_0x349233?_0x349233[_0x71df('0x15')]:![]);})['catch'](function(_0x50de5b){_0x39e325(_0x50de5b);});};AGIVertices[_0x71df('0x11')][_0x71df('0x16')]=function(_0x4ae2f4,_0x4621eb){this[_0x71df('0x13')][_0x71df('0x17')](_0x4ae2f4)[_0x71df('0x14')](function(_0x3acfe6){_0x4621eb(null,_0x3acfe6?_0x3acfe6[_0x71df('0x15')]:![]);})[_0x71df('0x18')](function(_0x29c488){_0x4621eb(_0x29c488);});};AGIVertices[_0x71df('0x11')][_0x71df('0x19')]=function(_0x2b04b5,_0x2ed677){this['rpc'][_0x71df('0x1a')](_0x2b04b5)[_0x71df('0x14')](function(_0x30acd2){_0x2ed677(null,_0x30acd2?_0x30acd2[_0x71df('0x15')]:![]);})['catch'](function(_0x332984){_0x2ed677(_0x332984);});};AGIVertices[_0x71df('0x11')][_0x71df('0x1b')]=function(_0x234b72,_0x3eddbf){this['rpc'][_0x71df('0x1c')](_0x234b72)[_0x71df('0x14')](function(_0x3dc2e9){_0x3eddbf(null,_0x3dc2e9?_0x3dc2e9['dsn']:![]);})[_0x71df('0x18')](function(_0x4911f4){_0x3eddbf(_0x4911f4);});};AGIVertices['prototype'][_0x71df('0x1d')]=function(_0x573738,_0x4a0684){this[_0x71df('0x13')][_0x71df('0x1e')](_0x573738)['then'](function(_0x2bfde4){_0x4a0684(null,_0x2bfde4?_0x2bfde4[_0x71df('0x15')]:![]);})['catch'](function(_0x9f23ea){_0x4a0684(_0x9f23ea);});};AGIVertices[_0x71df('0x11')][_0x71df('0x1f')]=function(_0xf59cdc,_0x3f8798){this['rpc'][_0x71df('0x20')](_0xf59cdc)[_0x71df('0x14')](function(_0x592ee2){_0x3f8798(null,_0x592ee2?_0x592ee2[_0x71df('0x15')]:![]);})['catch'](function(_0xcbf773){_0x3f8798(_0xcbf773);});};AGIVertices[_0x71df('0x11')][_0x71df('0x21')]=function(_0x54e4ae,_0x5055eb){var _0x498155=this;this['rpc'][_0x71df('0x22')](_0x54e4ae)[_0x71df('0x14')](function(_0x15fdb0){_0x5055eb(null,_0x15fdb0?_0x498155[_0x71df('0x23')](_0x15fdb0[_0x71df('0x24')]):![]);})['catch'](function(_0x205623){_0x5055eb(_0x205623);});};AGIVertices[_0x71df('0x11')][_0x71df('0x25')]=function(_0x9b7d8,_0x583799){this[_0x71df('0x13')]['getMailAccountById'](_0x9b7d8)[_0x71df('0x14')](function(_0x87dbe8){_0x583799(null,_0x87dbe8?_0x87dbe8:![]);})[_0x71df('0x18')](function(_0xc818e4){_0x583799(_0xc818e4);});};AGIVertices['prototype'][_0x71df('0x26')]=function(_0x3647a5,_0x5a9342,_0x115d9b){this[_0x71df('0x10')]['sendMailMessage'](_0x3647a5,_0x5a9342)[_0x71df('0x14')](function(){_0x115d9b(null);})[_0x71df('0x18')](function(_0x43b8f4){_0x115d9b(_0x43b8f4);});};AGIVertices[_0x71df('0x11')][_0x71df('0x27')]=function(_0x346792,_0x229a3f){this[_0x71df('0x13')][_0x71df('0x28')](_0x346792)['then'](function(_0xcf3786){if(_0xcf3786){if(_0xcf3786['IntervalId']){_0x229a3f(null,[_0xcf3786[_0x71df('0x29')]]);}else{_0x229a3f(null,_[_0x71df('0x2a')](_0xcf3786['Intervals'],_0x71df('0x29')));}}else{_0x229a3f(null,![]);}})[_0x71df('0x18')](function(_0x5ce742){_0x229a3f(_0x5ce742);});};AGIVertices['prototype'][_0x71df('0x23')]=function(_0x3de886){return util[_0x71df('0x2b')](_0x71df('0x2c'),FILES_PATH,_0x3de886);};AGIVertices['prototype'][_0x71df('0x2d')]=function(_0x33bd9b,_0xb04dfa,_0x523515){odbc['open'](_0x33bd9b,function(_0x5756d2){if(_0x5756d2){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5756d2);_0x523515(_0x5756d2);}else{logger[_0x71df('0x2e')](_0x71df('0x2f'));odbc[_0x71df('0x30')](_0xb04dfa,function(_0x24a081,_0x4e4a80){if(_0x24a081){logger[_0x71df('0x2e')](_0x71df('0x31'),_0xb04dfa);_0x523515(_0x24a081);}else{logger[_0x71df('0x2e')]('Query\x20executed\x20correctly\x20%s',_0xb04dfa);odbc[_0x71df('0x32')](function(_0x258969){if(_0x258969){logger[_0x71df('0x33')](_0x71df('0x34'),_0x258969);}_0x523515(null,_0x4e4a80);});}});}});};AGIVertices['prototype'][_0x71df('0x35')]=function(_0x5a19a2,_0xba8215){this['rpc']['getSmsAccountById'](_0x5a19a2)[_0x71df('0x14')](function(_0x2a5d84){_0xba8215(null,_0x2a5d84?_0x2a5d84:![]);})['catch'](function(_0x15d6da){_0xba8215(_0x15d6da);});};AGIVertices['prototype'][_0x71df('0x36')]=function(_0x5cbc5f,_0x27ddbf){this[_0x71df('0x13')][_0x71df('0x36')](_0x5cbc5f)[_0x71df('0x14')](function(_0x57b975){_0x27ddbf(null,_0x57b975);})['catch'](function(_0x14a6f9){_0x27ddbf(_0x14a6f9);});};AGIVertices['prototype'][_0x71df('0x37')]=function(_0x12bce6,_0x4b2667,_0xce7a12){this[_0x71df('0x13')]['createSquareDetailsReport']({'uniqueid':this[_0x71df('0xf')]['uniqueid'],'node':_0x12bce6['label'],'application':_0x12bce6[_0x71df('0x38')],'data':_0x4b2667||null,'project_name':this[_0x71df('0xf')][_0x71df('0x39')],'callerid':this[_0x71df('0xf')][_0x71df('0x3a')]})['then'](function(_0x221090){if(_0xce7a12){_0xce7a12(null,_0x221090);}})['catch'](function(_0x755300){if(_0xce7a12){_0xce7a12(_0x755300);}});};AGIVertices[_0x71df('0x11')][_0x71df('0x3b')]=function(_0x211abb,_0x9d83b,_0x1591ef,_0xfee3ae){this[_0x71df('0x13')][_0x71df('0x3b')]({'uniqueid':this[_0x71df('0xf')]['uniqueid'],'callerid':this[_0x71df('0xf')][_0x71df('0x3a')],'calleridname':this[_0x71df('0xf')][_0x71df('0x3c')],'context':this[_0x71df('0xf')]['context'],'extension':this['channel'][_0x71df('0x3d')],'priority':this['channel'][_0x71df('0x3e')],'accountcode':this['channel'][_0x71df('0x3f')],'dnid':this[_0x71df('0xf')][_0x71df('0x40')],'projectName':this['channel'][_0x71df('0x39')],'saveName':_0x9d83b,'filename':_0x211abb[_0x71df('0x41')]||_0x9d83b,'savePath':_0x1591ef})[_0x71df('0x14')](function(_0x558d5d){_0xfee3ae(null,_0x558d5d);})[_0x71df('0x18')](function(_0x55f2f8){_0xfee3ae(_0x55f2f8);});};AGIVertices[_0x71df('0x11')][_0x71df('0x42')]=function(_0x1bc4c3,_0x307df4,_0x55aa2a,_0x594575,_0x2c9be6){this['rpc'][_0x71df('0x42')]({'uniqueid':this[_0x71df('0xf')][_0x71df('0x43')],'body':_0x1bc4c3,'direction':_0x307df4,'providerName':_0x55aa2a,'providerResponse':_0x594575})[_0x71df('0x14')](function(_0x4cdb8d){if(_0x2c9be6){_0x2c9be6(null,_0x4cdb8d);}})['catch'](function(_0x12ed3d){if(_0x2c9be6){_0x2c9be6(_0x12ed3d);}});};AGIVertices['prototype'][_0x71df('0x44')]=function(_0xf9c72b,_0x204ce1){this[_0x71df('0x13')][_0x71df('0x44')]({'firstName':_[_0x71df('0x45')](_0xf9c72b[_0x71df('0x15')])||_[_0x71df('0x46')](_0xf9c72b[_0x71df('0x15')])?_0x71df('0x47')+Math[_0x71df('0x48')]():_0xf9c72b['name'],'lastName':_[_0x71df('0x45')](_0xf9c72b[_0x71df('0x49')])||_[_0x71df('0x46')](_0xf9c72b[_0x71df('0x49')])?null:_0xf9c72b[_0x71df('0x49')],'phone':_0xf9c72b[_0x71df('0x4a')],'ListId':_0xf9c72b['list_id'],'scheduledat':_0xf9c72b[_0x71df('0x4b')],'callbackUniqueid':this[_0x71df('0xf')][_0x71df('0x43')],'tags':_0x71df('0x4c'),'description':_0x71df('0x4d')+_0xf9c72b[_0x71df('0x4b')][_0x71df('0x4e')](),'priority':_0xf9c72b[_0x71df('0x4f')]})['then'](function(_0x21553e){_0x204ce1(null,_0x21553e);})[_0x71df('0x18')](function(_0x437b85){_0x204ce1(_0x437b85);});};AGIVertices['prototype'][_0x71df('0x50')]=function(_0x252c38,_0x49b865){this[_0x71df('0x13')][_0x71df('0x51')](_0x252c38)['then'](function(_0x379cbe){_0x49b865(null,_0x379cbe?_0x379cbe[_0x71df('0x15')]:![]);})['catch'](function(_0x31f3b2){_0x49b865(_0x31f3b2);});};AGIVertices[_0x71df('0x11')][_0x71df('0x52')]=function(_0x4d53ce,_0x3c4a89,_0x250365){var _0x107e95={'role':_0x71df('0x53')};_0x107e95[_0x4d53ce]=this[_0x71df('0xf')][_0x71df('0x3a')];this['rpc'][_0x71df('0x52')](_0x107e95,_0x3c4a89,this[_0x71df('0xf')]['uniqueid'])[_0x71df('0x14')](function(_0x2fd3a0){_0x250365(null,_[_0x71df('0x46')](_0x2fd3a0)?![]:!![]);})[_0x71df('0x18')](function(_0x437f7d){logger[_0x71df('0x33')](_0x437f7d);_0x250365(null,![]);});};AGIVertices[_0x71df('0x11')][_0x71df('0x54')]=function(_0x4ad3ca,_0x71e352){var _0x437f37={'role':_0x71df('0x53')};_0x437f37[_0x4ad3ca]=this['channel'][_0x71df('0x3a')];this['rpc']['agentUnpause'](_0x437f37)['then'](function(_0x16784b){_0x71e352(null,_[_0x71df('0x46')](_0x16784b)?![]:!![]);})[_0x71df('0x18')](function(_0x3d268a){logger['error'](_0x3d268a);_0x71e352(null,![]);});};AGIVertices[_0x71df('0x11')][_0x71df('0x55')]=function(_0x3171e1,_0x573db7){var _0xe83c6f={'role':'agent'};_0xe83c6f[_0x3171e1]=this[_0x71df('0xf')]['callerid'];this['rpc'][_0x71df('0x55')](_0xe83c6f)[_0x71df('0x14')](function(_0x4b3ed9){_0x573db7(null,_[_0x71df('0x46')](_0x4b3ed9)?![]:!![]);})['catch'](function(_0x13f1bc){logger[_0x71df('0x33')](_0x13f1bc);_0x573db7(null,![]);});};AGIVertices[_0x71df('0x11')][_0x71df('0x56')]=function(_0xf8baff,_0x266ad7){var _0x22a969={'role':'agent'};_0x22a969[_0xf8baff]=this['channel']['callerid'];var _0x3b63ca=_0xf8baff!=_0x71df('0x57')?util[_0x71df('0x2b')](_0x71df('0x58'),_0x71df('0x59'),this['channel'][_0x71df('0x3a')]):undefined;this['rpc'][_0x71df('0x56')](_0x22a969,_0x3b63ca)[_0x71df('0x14')](function(_0x24afc3){_0x266ad7(null,_['isNil'](_0x24afc3)?![]:!![]);})[_0x71df('0x18')](function(_0x296f7e){logger[_0x71df('0x33')](_0x296f7e);_0x266ad7(null,![]);});};AGIVertices[_0x71df('0x11')][_0x71df('0x5a')]=function(_0x54f035,_0xb40aa4){sh[_0x71df('0x5b')](_['trim'](_0x54f035),function(_0x313526,_0x152967){var _0x90dc3a=_0x152967[_0x71df('0x5c')](/(\r\n|\n|\r)/gm,'');_0xb40aa4(null,_0x90dc3a);});};AGIVertices[_0x71df('0x11')][_0x71df('0x5d')]=function(_0x284c00,_0x28c6a5){scripts['googleCloudTTS'](_0x284c00[_0x71df('0x5e')],_0x284c00['google_cloud_tts_text_type']||_0x71df('0x5f'),_0x284c00[_0x71df('0x5f')],_0x284c00[_0x71df('0x60')]||_0x71df('0x61'),_0x284c00[_0x71df('0x62')]||_0x71df('0x63'),_0x284c00[_0x71df('0x64')]||_0x71df('0x65'))[_0x71df('0x14')](function(_0xeae745){_0x28c6a5(null,_0xeae745);})[_0x71df('0x18')](function(_0x13fdce){_0x28c6a5(_0x13fdce);});};AGIVertices['prototype'][_0x71df('0x66')]=function(_0x5da592,_0x548084){scripts[_0x71df('0x66')](_0x5da592[_0x71df('0x5f')],_0x5da592[_0x71df('0x67')]||'en',0x1)['then'](function(_0x17f19f){_0x548084(null,_0x17f19f);})['catch'](function(_0x7cdd7a){_0x548084(_0x7cdd7a);});};AGIVertices['prototype'][_0x71df('0x68')]=function(_0x152a91,_0x4642af){var _0x17ab24={'uri':_0x152a91[_0x71df('0x69')],'method':_0x152a91[_0x71df('0x6a')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x152a91[_0x71df('0x6b')])===_0x71df('0x6c')&&parseInt(_0x152a91[_0x71df('0x6b')])>=0x1?parseInt(_0x152a91[_0x71df('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0x71df('0x6d')]([_0x71df('0x6e'),_0x71df('0x6f')],_0x17ab24[_0x71df('0x6a')][_0x71df('0x70')]())){try{_0x17ab24['body']=_0x152a91[_0x71df('0x71')]?JSON[_0x71df('0x72')](_0x152a91['rawBody']):{};}catch(_0x9580c3){logger[_0x71df('0x33')](_0x71df('0x73'),_0x9580c3);}}try{_0x17ab24['headers']=_0x152a91[_0x71df('0xc')]?JSON[_0x71df('0x72')](_0x152a91[_0x71df('0xc')]):{};}catch(_0x3c2462){logger[_0x71df('0x33')](_0x71df('0x74'),_0x3c2462);}if(_0x152a91[_0x71df('0x75')]){try{var _0x5526c1=require(_0x152a91[_0x71df('0x75')])[_0x71df('0x76')](this,_0x17ab24);_0x17ab24[_0x71df('0x77')]=Mustache[_0x71df('0x78')](_0x152a91[_0x71df('0x69')],_0x5526c1,{},['$$','$$']);if(_0x17ab24['headers']){_0x17ab24['headers']=JSON[_0x71df('0x72')](Mustache[_0x71df('0x78')](JSON['stringify'](_0x17ab24[_0x71df('0x79')]),_0x5526c1,{},['$$','$$']));}if(_0x17ab24[_0x71df('0x7a')]){_0x17ab24[_0x71df('0x7a')]=JSON['parse'](Mustache[_0x71df('0x78')](JSON[_0x71df('0x7b')](_0x17ab24['body']),_0x5526c1,{},['$$','$$']));}}catch(_0x463fa8){logger[_0x71df('0x33')](_0x71df('0x7c'),_0x463fa8);}}rp(_0x17ab24)[_0x71df('0x14')](function(_0x372e9a){var _0x4bdd15={'statusCode':_0x372e9a['statusCode']||0xc8,'statusMessage':_0x372e9a['statusMessage']||'OK','headers':_0x372e9a['headers']||{},'body':_0x372e9a[_0x71df('0x7a')]||{}};_0x4642af(null,_0x4bdd15);})[_0x71df('0x18')](function(_0x58484b){var _0xa27bd4={'statusCode':_0x58484b[_0x71df('0x7d')]||0x1f4,'statusMessage':_0x58484b[_0x71df('0x7e')]||_0x71df('0x7f'),'headers':_0x58484b[_0x71df('0x80')]['headers']||{},'body':_0x58484b['options'][_0x71df('0x7a')]||{}};_0x4642af(null,_0xa27bd4);});};AGIVertices[_0x71df('0x11')]['googleDialogflow']=function(_0x3b5be5,_0x1637b2){scripts[_0x71df('0x81')](this[_0x71df('0xf')][_0x71df('0x43')],_0x3b5be5['key'],_0x3b5be5[_0x71df('0x5f')],_0x3b5be5[_0x71df('0x82')]||'en')['then'](function(_0x59017f){_0x1637b2(null,_0x59017f);})[_0x71df('0x18')](function(_0x3df1ed){_0x1637b2(_0x3df1ed);});};AGIVertices[_0x71df('0x11')][_0x71df('0x83')]=function(_0x338a86,_0x43cc01){scripts['googleDialogflowV2'](this[_0x71df('0xf')]['uniqueid'],_0x338a86[_0x71df('0x84')],_0x338a86[_0x71df('0x85')],_0x338a86[_0x71df('0x86')],_0x338a86[_0x71df('0x5f')],_0x338a86['dialogflowV2_language']||'en')[_0x71df('0x14')](function(_0x335545){_0x43cc01(null,_0x335545);})[_0x71df('0x18')](function(_0x35d182){_0x43cc01(_0x35d182);});};AGIVertices[_0x71df('0x11')]['sestekNDA']=function(_0x5077c3,_0x101063){scripts['sestekNDA'](this[_0x71df('0xf')],_0x5077c3)[_0x71df('0x14')](function(_0x2dbf63){_0x101063(null,_0x2dbf63);})['catch'](function(_0x5c47a7){_0x101063(_0x5c47a7);});};AGIVertices[_0x71df('0x11')][_0x71df('0x87')]=function(_0x2d2914,_0x236e49){scripts[_0x71df('0x87')](_0x2d2914[_0x71df('0x88')],_0x2d2914[_0x71df('0x5f')],_0x2d2914['ispeech_tts_language']||_0x71df('0x61'),_0x2d2914[_0x71df('0x89')])[_0x71df('0x14')](function(_0xe2925e){_0x236e49(null,_0xe2925e);})[_0x71df('0x18')](function(_0x4cee46){_0x236e49(_0x4cee46);});};AGIVertices['prototype'][_0x71df('0x8a')]=function(_0x109445,_0x3c890d,_0x39d87f){scripts['ispeechASR'](_0x3c890d,_0x109445[_0x71df('0x88')],_0x109445['ispeech_asr_language']||_0x71df('0x61'),this[_0x71df('0x8b')](_0x109445[_0x71df('0x8c')])?_0x109445[_0x71df('0x8c')]:undefined)[_0x71df('0x14')](function(_0x451300){_0x39d87f(null,_0x451300);})[_0x71df('0x18')](function(_0x396894){_0x39d87f(_0x396894);});};AGIVertices[_0x71df('0x11')][_0x71df('0x8d')]=function(_0xbbb26,_0x44c2cd){scripts[_0x71df('0x8d')](_0xbbb26[_0x71df('0x8e')],_0xbbb26[_0x71df('0x8f')],_0xbbb26[_0x71df('0x90')],_0xbbb26[_0x71df('0x91')]||_0x71df('0x92'),_0xbbb26[_0x71df('0x5f')],_0xbbb26['aws_text_type']||_0x71df('0x5f'))[_0x71df('0x14')](function(_0x1cb6e6){_0x44c2cd(null,_0x1cb6e6);})['catch'](function(_0x17f660){_0x44c2cd(_0x17f660);});};AGIVertices[_0x71df('0x11')][_0x71df('0x93')]=function(_0x389a87,_0x5a3a09){scripts[_0x71df('0x93')](this[_0x71df('0xf')]['uniqueid'],_0x389a87[_0x71df('0x8e')],_0x389a87[_0x71df('0x8f')],_0x389a87[_0x71df('0x94')],_0x389a87[_0x71df('0x5f')],_0x389a87['aws_bot_name'])[_0x71df('0x14')](function(_0x2affd1){_0x5a3a09(null,_0x2affd1);})[_0x71df('0x18')](function(_0x81eaed){_0x5a3a09(_0x81eaed);});};AGIVertices[_0x71df('0x11')][_0x71df('0x95')]=function(_0x3a5229,_0x663892,_0x2b3c92){scripts[_0x71df('0x95')](_0x663892,_0x3a5229[_0x71df('0x88')],_0x3a5229['google_asr_language']||_0x71df('0x61'))[_0x71df('0x14')](function(_0x1de585){_0x2b3c92(null,_0x1de585);})[_0x71df('0x18')](function(_0x11ddb5){_0x2b3c92(_0x11ddb5);});};AGIVertices['prototype']['tildeASR']=function(_0x1c88c6,_0x2ee739,_0x3a548c){scripts[_0x71df('0x96')](_0x2ee739,_0x1c88c6[_0x71df('0x97')],_0x1c88c6['appsecret'],_0x1c88c6[_0x71df('0x77')])[_0x71df('0x14')](function(_0x17ad68){_0x3a548c(null,_0x17ad68);})[_0x71df('0x18')](function(_0x4a5d7d){_0x3a548c(_0x4a5d7d);});};AGIVertices[_0x71df('0x11')]['clear']=function(_0x20aa3a){var _0x4718b1=_['includes'](verticesWithRetry,_0x20aa3a[_0x71df('0x38')])?_0x20aa3a:_[_0x71df('0x98')](_0x20aa3a);for(var _0x2319dd in _0x4718b1){if(_0x4718b1[_0x71df('0x99')](_0x2319dd)){if(_0x4718b1[_0x2319dd]&&_[_0x71df('0x9a')](_0x4718b1[_0x2319dd])){if(_['includes'](recursiveMapAttributes,_0x2319dd)){_0x4718b1[_0x2319dd]=this['replaceObjectAllVariables'](_0x4718b1[_0x2319dd]);}else{_0x4718b1[_0x2319dd]=this[_0x71df('0x9b')](_0x4718b1[_0x2319dd]);}}}}return _0x4718b1;};AGIVertices[_0x71df('0x11')]['recursiveNodeIndex']=function(_0x494c6c){for(var _0x3af0ae in _0x494c6c){if(_0x494c6c[_0x71df('0x99')](_0x3af0ae)){if(_['isPlainObject'](_0x494c6c[_0x3af0ae])){this[_0x71df('0x9c')](_0x494c6c[_0x3af0ae]);}else if(_[_0x71df('0x9d')](_0x494c6c[_0x3af0ae])){for(var _0x5c953b=0x0;_0x5c953b<_0x494c6c[_0x3af0ae][_0x71df('0x9e')];_0x5c953b++){this['recursiveNodeIndex'](_0x494c6c[_0x3af0ae][_0x5c953b]);}}else if(_[_0x71df('0x9a')](_0x494c6c[_0x3af0ae])){_0x494c6c[_0x3af0ae]=this[_0x71df('0x9b')](_0x494c6c[_0x3af0ae]);}}}};AGIVertices[_0x71df('0x11')]['saveRestApiResult']=function(_0x503e75,_0x443300){for(var _0xe8fe37 in _0x503e75){if(_0x503e75['hasOwnProperty'](_0xe8fe37)){if(_[_0x71df('0x9f')](_0x503e75[_0xe8fe37])){if(!_[_0x71df('0x45')](_0x503e75[_0xe8fe37])){this[_0x71df('0xa0')](_0x503e75[_0xe8fe37],util[_0x71df('0x2b')](_0x71df('0xa1'),_0x443300,_0xe8fe37));}}else if(_[_0x71df('0x9d')](_0x503e75[_0xe8fe37])){for(var _0x5782b1=0x0;_0x5782b1<_0x503e75[_0xe8fe37]['length'];_0x5782b1++){this[_0x71df('0xa0')](_0x503e75[_0xe8fe37][_0x5782b1],util['format']('%s.%s',_0x443300,_0xe8fe37+'['+_0x5782b1+']'));}}else{if(!_[_0x71df('0x46')](_0x503e75[_0xe8fe37])){this['channel'][_0x71df('0xa2')](util[_0x71df('0x2b')](_0x71df('0xa1'),_0x443300,_0xe8fe37),_0x503e75[_0xe8fe37]);}}}}};AGIVertices[_0x71df('0x11')][_0x71df('0xa3')]=function(_0x4a804c){try{var _0x44f585=JSON[_0x71df('0x72')](_0x4a804c);this['recursiveNodeIndex'](_0x44f585);return JSON[_0x71df('0x7b')](_0x44f585);}catch(_0x286dc4){return this[_0x71df('0x9b')](_0x4a804c);}};AGIVertices['prototype'][_0x71df('0x9b')]=function(_0x3c9efb){var _0x46f9b1=_0x3c9efb['split']('{');for(var _0x15efbf=0x1;_0x15efbf<_0x46f9b1[_0x71df('0x9e')];_0x15efbf+=0x1){var _0x32a19a=_0x46f9b1[_0x15efbf]['split']('}');if(_0x32a19a['length']>0x1){_0x3c9efb=_0x3c9efb[_0x71df('0xa4')]('{'+_0x32a19a[0x0]+'}',this['channel']['getVariable'](_0x32a19a[0x0])[_0x71df('0xa5')]||_0x32a19a[0x0]);}}if(_0x46f9b1[_0x71df('0x9e')]===0x1){return _0x3c9efb[_0x71df('0x4e')]();}return this['replaceAllVariables'](_0x3c9efb);};AGIVertices[_0x71df('0x11')][_0x71df('0xa6')]=function(_0x1e79bf,_0x15ad73){var _0x4227dd=this[_0x71df('0xf')]['getVariable'](_0x1e79bf);if(_0x4227dd[_0x71df('0xa7')]===-0x1){return _0x4227dd;}logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xa8'),_0x15ad73,_0x4227dd[_0x71df('0xa5')]));return this[_0x71df('0xf')][_0x71df('0xa2')](_0x15ad73,_0x4227dd['extra']);};AGIVertices[_0x71df('0x11')][_0x71df('0x8b')]=function(_0x460457){return _0x460457&&_0x460457!=='0'&&_0x460457!=='-1'&&_0x460457!=='';};AGIVertices[_0x71df('0x11')][_0x71df('0xa9')]=function(_0x163504){this['createSquareDetailsReport']['sync'](this,_0x163504,'-');_0x163504[_0x71df('0xaa')]=_0x163504[_0x71df('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x71df('0xab')]=function(_0x3ca977){logger[_0x71df('0x2e')](util['format'](_0x71df('0xac'),_0x3ca977[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x3ca977[_0x71df('0x5f')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xaf'));}var _0x458e5b='\x22'+_0x3ca977[_0x71df('0x5f')]+'\x22';if(this['isConfigured'](_0x3ca977[_0x71df('0x80')])){_0x458e5b+=','+_0x3ca977[_0x71df('0x80')];}var _0x3233b1=this[_0x71df('0xf')][_0x71df('0x5b')]('MRCPSynth',_0x458e5b);if(_0x3233b1[_0x71df('0xa7')]===-0x1){return _0x3233b1;}return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x458e5b));};AGIVertices[_0x71df('0x11')][_0x71df('0xb0')]=function(_0xf5554e){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xb1'),_0xf5554e[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0xf5554e['grammar'])){return this[_0x71df('0xf')][_0x71df('0xae')]('no\x20grammar\x20configured');}var _0x5d629d=_0xf5554e[_0x71df('0xb2')];if(this[_0x71df('0x8b')](_0xf5554e[_0x71df('0x80')])){_0x5d629d+=','+_0xf5554e['options'];}var _0x5db21a=this['channel'][_0x71df('0x5b')](_0x71df('0xb3'),_0x5d629d);if(_0x5db21a[_0x71df('0xa7')]===-0x1){return _0x5db21a;}var _0x226bba=this[_0x71df('0xa6')](_0x71df('0xb4'),'MRCP_RECOG_CONFIDENCE');if(_0x226bba[_0x71df('0xa7')]===-0x1){return _0x226bba;}var _0x51c72f=this['getAndSetVariable']('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x51c72f['result']===-0x1){return _0x51c72f;}var _0x5a011e=this[_0x71df('0xa6')](_0x71df('0xb5'),_0x71df('0xb6'));if(_0x5a011e['result']===-0x1){return _0x5a011e;}return this[_0x71df('0xf')]['noop'](util['format'](_0x71df('0xb7'),_0x5d629d));};AGIVertices[_0x71df('0x11')][_0x71df('0x8')]=function(_0x3f85b1){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xb8'),_0x3f85b1[_0x71df('0xad')]));return this[_0x71df('0xf')][_0x71df('0x8')]([_0x3f85b1[_0x71df('0xb9')],_0x3f85b1[_0x71df('0xba')]]);};AGIVertices['prototype'][_0x71df('0xbb')]=function(_0x180ccc){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xbc'),_0x180ccc[_0x71df('0xad')]));if(this[_0x71df('0x8b')](_0x180ccc['timeout'])){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xbd'),_0x180ccc[_0x71df('0x6b')]));var _0x512da9=this[_0x71df('0xf')][_0x71df('0xbe')](_0x180ccc[_0x71df('0x6b')]);if(_0x512da9[_0x71df('0xa7')]===-0x1){return _0x512da9;}}return this[_0x71df('0xf')][_0x71df('0xbb')]();};AGIVertices[_0x71df('0x11')][_0x71df('0x4c')]=function(_0xf00081){logger[_0x71df('0x2e')](util['format'](_0x71df('0xbf'),_0xf00081[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0xf00081[_0x71df('0xc0')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0xf00081,_0x71df('0xc1'));}_0xf00081['scheduledAt']=moment();if(this[_0x71df('0x8b')](_0xf00081[_0x71df('0xc2')])){_0xf00081[_0x71df('0x4b')]=moment()['add'](_0xf00081['delay'],_0x71df('0xc3'));}if(!this[_0x71df('0x8b')](_0xf00081[_0x71df('0x4f')])){_0xf00081[_0x71df('0x4f')]=0x2;}this[_0x71df('0x44')][_0x71df('0x76')](this,_0xf00081);return this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xf00081[_0x71df('0x4a')],_0xf00081[_0x71df('0xc0')],_0xf00081[_0x71df('0x4b')]));};AGIVertices[_0x71df('0x11')][_0x71df('0xc4')]=function(_0x388144){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xc5'),_0x388144[_0x71df('0xad')]));var _0x56b329=this['channel'][_0x71df('0x5b')](_0x388144[_0x71df('0xc6')],_0x388144[_0x71df('0x80')]);if(_0x56b329[_0x71df('0xa7')]===-0x1){return _0x56b329;}return this['channel'][_0x71df('0xae')](util['format'](_0x71df('0xc7'),_0x388144[_0x71df('0xc6')],_0x388144['options']));};AGIVertices[_0x71df('0x11')][_0x71df('0xc8')]=function(_0x15d44b){logger['info'](util['format'](_0x71df('0xc9'),_0x15d44b[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x15d44b['text'])){return this['channel'][_0x71df('0xae')](_0x71df('0xaf'));}var _0x3a1a89='\x22'+_0x15d44b[_0x71df('0x5f')]+'\x22';if(this[_0x71df('0x8b')](_0x15d44b['options'])){_0x3a1a89+=','+_0x15d44b['options'];}var _0xad1cfb=this[_0x71df('0xf')][_0x71df('0x5b')]('MRCPSynth',_0x3a1a89);if(_0xad1cfb[_0x71df('0xa7')]===-0x1){return _0xad1cfb;}return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xca'),_0x3a1a89));};AGIVertices[_0x71df('0x11')][_0x71df('0xcb')]=function(_0x2efca1){logger[_0x71df('0x2e')](util['format'](_0x71df('0xcc'),_0x2efca1[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x2efca1[_0x71df('0x5f')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xaf'));}var _0x525e71='\x22'+_0x2efca1['text']+'\x22';if(this[_0x71df('0x8b')](_0x2efca1[_0x71df('0x80')])){_0x525e71+=','+_0x2efca1[_0x71df('0x80')];}var _0x8f5d53=this[_0x71df('0xf')]['exec']('MRCPSynth',_0x525e71);if(_0x8f5d53[_0x71df('0xa7')]===-0x1){return _0x8f5d53;}return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xca'),_0x525e71));};AGIVertices[_0x71df('0x11')][_0x71df('0xcd')]=function(_0x2a7a3f){logger[_0x71df('0x2e')](util['format'](_0x71df('0xce'),_0x2a7a3f[_0x71df('0xad')]));if(!this['isConfigured'](_0x2a7a3f[_0x71df('0xb2')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xcf'));}var _0xaf82e1=_0x2a7a3f[_0x71df('0xb2')];if(this[_0x71df('0x8b')](_0x2a7a3f[_0x71df('0x80')])){_0xaf82e1+=','+_0x2a7a3f['options'];}var _0x36a7c9=this[_0x71df('0xf')][_0x71df('0x5b')](_0x71df('0xb3'),_0xaf82e1);if(_0x36a7c9[_0x71df('0xa7')]===-0x1){return _0x36a7c9;}var _0x19a774=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x19a774[_0x71df('0xa7')]===-0x1){return _0x19a774;}var _0x20d23a=this[_0x71df('0xa6')](_0x71df('0xd0'),_0x71df('0xd1'));if(_0x20d23a[_0x71df('0xa7')]===-0x1){return _0x20d23a;}var _0x4d54d6=this[_0x71df('0xa6')](_0x71df('0xb5'),_0x71df('0xd2'));if(_0x4d54d6['result']===-0x1){return _0x4d54d6;}return this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xb7'),_0xaf82e1));};AGIVertices[_0x71df('0x11')]['sestekasr']=function(_0x5660dc){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xd3'),_0x5660dc[_0x71df('0xad')]));if(!this['isConfigured'](_0x5660dc[_0x71df('0xb2')])){return this['channel'][_0x71df('0xae')](_0x71df('0xcf'));}var _0x3072ba=_0x5660dc['grammar'];if(this['isConfigured'](_0x5660dc[_0x71df('0x80')])){_0x3072ba+=','+_0x5660dc['options'];}var _0x2f3f2b=this['channel'][_0x71df('0x5b')](_0x71df('0xb3'),_0x3072ba);if(_0x2f3f2b[_0x71df('0xa7')]===-0x1){return _0x2f3f2b;}var _0x64df66=this[_0x71df('0xa6')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x64df66[_0x71df('0xa7')]===-0x1){return _0x64df66;}var _0x3a806e=this['getAndSetVariable'](_0x71df('0xd0'),_0x71df('0xd4'));if(_0x3a806e['result']===-0x1){return _0x3a806e;}var _0x35a848=this[_0x71df('0xa6')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x35a848[_0x71df('0xa7')]===-0x1){return _0x35a848;}return this[_0x71df('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x3072ba));};AGIVertices['prototype'][_0x71df('0xd5')]=function(_0x12276d){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xd6'),_0x12276d[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x12276d[_0x71df('0xd7')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x12276d,_0x71df('0xd8'));}var _0x5560bd=this['getSquareOdbc'][_0x71df('0x76')](this,_0x12276d[_0x71df('0xd7')]);if(!_0x5560bd){return this[_0x71df('0xf')][_0x71df('0x33')](_0x12276d,_0x71df('0xd9'));}if(!this['isConfigured'](_0x12276d['query'])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x12276d,_0x71df('0xda'));}var _0x5caf62=_0x12276d[_0x71df('0x30')][_0x71df('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xdb'),_0x5caf62));var _0x5906c5=this[_0x71df('0x2d')][_0x71df('0x76')](this,_0x5560bd,_0x5caf62);this[_0x71df('0x37')][_0x71df('0x76')](this,_0x12276d,_0x5caf62);if(!this[_0x71df('0x8b')](_0x12276d[_0x71df('0xdc')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xdd'));}var _0xc0715e=this[_0x71df('0x12')][_0x71df('0x76')](this,_0x12276d[_0x71df('0xdc')]);if(!_0xc0715e){return this[_0x71df('0xf')]['error'](_0x12276d,'no\x20variable\x20found');}var _0x320a48=this;_0x5906c5[_0x71df('0xde')](function(_0x311683,_0x157b79){Object['keys'](_0x311683)[_0x71df('0xde')](function(_0x5efe04){_0x320a48['channel'][_0x71df('0xa2')](util['format'](_0x71df('0xdf'),_0xc0715e,_0x157b79,_0x5efe04),_0x311683[_0x5efe04]);});});this['channel'][_0x71df('0xa2')](util[_0x71df('0x2b')]('%s_ROWS_COUNT',_0xc0715e),_0x5906c5['length']);return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xe0'),_0xc0715e));};AGIVertices[_0x71df('0x11')][_0x71df('0xe1')]=function(_0xf928da){logger['debug'](util[_0x71df('0x2b')](_0x71df('0xe2'),_0xf928da[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0xf928da[_0x71df('0xe3')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0xf928da,_0x71df('0xe4'));}var _0xb42202=this[_0x71df('0x1d')]['sync'](this,_0xf928da[_0x71df('0xe3')]);if(!_0xb42202){return this[_0x71df('0xf')][_0x71df('0x33')](_0xf928da,_0x71df('0xe5'));}var _0x3f8114=this[_0x71df('0xf')][_0x71df('0x5b')]('DIAL',[util['format'](_0x71df('0xe6'),_0xb42202),_0xf928da[_0x71df('0x6b')],_0xf928da[_0x71df('0xe7')],_0xf928da[_0x71df('0x69')]]);if(_0x3f8114[_0x71df('0xa7')]===-0x1){return _0x3f8114;}return this['channel']['noop'](util[_0x71df('0x2b')](_0x71df('0xe8'),'DIAL'));};AGIVertices[_0x71df('0x11')][_0x71df('0xe9')]=function(_0x4f027b){logger['info'](util[_0x71df('0x2b')](_0x71df('0xea'),_0x4f027b[_0x71df('0xad')]));if(!this['isConfigured'](_0x4f027b[_0x71df('0x88')])){return this[_0x71df('0xf')][_0x71df('0xae')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x4f027b[_0x71df('0x5f')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xaf'));}this['channel']['bot']=!![];this[_0x71df('0x37')](_0x4f027b);this[_0x71df('0x42')](_0x4f027b['text'],'in','','');this['channel']['noop'](util[_0x71df('0x2b')]('Trying\x20Dialogflow:\x20%s',_0x4f027b[_0x71df('0x5f')]));var _0x445eca=this[_0x71df('0x81')][_0x71df('0x76')](this,_0x4f027b);if(_0x445eca){for(var _0x3abab2 in _0x445eca){if(_0x445eca[_0x71df('0x99')](_0x3abab2)){this[_0x71df('0xf')][_0x71df('0xa2')](util[_0x71df('0x2b')]('DIALOGFLOW_%s',_0x3abab2[_0x71df('0x70')]()),_0x445eca[_0x3abab2]);}}this['createSquareMessage'](_0x445eca[_0x71df('0xeb')],_0x71df('0xec'),_0x71df('0xe9'),'');return this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xed'),_0x445eca[_0x71df('0xeb')]));}return this[_0x71df('0xf')][_0x71df('0x33')](_0x4f027b,_0x71df('0xee'));};AGIVertices[_0x71df('0x11')][_0x71df('0xef')]=function(_0x1293f8){logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x1293f8['label']));if(!this['isConfigured'](_0x1293f8['dialogflowV2_project_id'])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xf0'));}if(!this[_0x71df('0x8b')](_0x1293f8[_0x71df('0x85')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xf1'));}if(!this[_0x71df('0x8b')](_0x1293f8[_0x71df('0x86')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xf2'));}if(!this[_0x71df('0x8b')](_0x1293f8[_0x71df('0xf3')])){return this[_0x71df('0xf')][_0x71df('0xae')]('no\x20anguage\x20configured');}if(!this[_0x71df('0x8b')](_0x1293f8[_0x71df('0x5f')])){return this['channel'][_0x71df('0xae')](_0x71df('0xaf'));}this['channel']['bot']=!![];this[_0x71df('0x37')](_0x1293f8);this['createSquareMessage'](_0x1293f8[_0x71df('0x5f')],'in','','');this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xf4'),_0x1293f8[_0x71df('0x5f')]));var _0x15bb23=this[_0x71df('0x83')][_0x71df('0x76')](this,_0x1293f8);if(_0x15bb23){for(var _0x24ae06 in _0x15bb23){if(_0x15bb23[_0x71df('0x99')](_0x24ae06)){if(_0x24ae06!==_0x71df('0xf5')){this['channel']['setVariable'](util[_0x71df('0x2b')](_0x71df('0xf6'),_0x24ae06[_0x71df('0x70')]()),_0x15bb23[_0x24ae06]);}}}this[_0x71df('0x42')](_0x15bb23[_0x71df('0xeb')],'out',_0x71df('0xef'),_0x15bb23[_0x71df('0xf5')]);return this[_0x71df('0xf')]['noop'](util['format'](_0x71df('0xf7'),_0x15bb23[_0x71df('0xeb')]));}return this[_0x71df('0xf')][_0x71df('0x33')](_0x1293f8,_0x71df('0xf8'));};AGIVertices[_0x71df('0x11')][_0x71df('0xf9')]=function(_0x442d4b){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0xfa'),_0x442d4b['label']));if(!this[_0x71df('0x8b')](_0x442d4b[_0x71df('0xfb')])){return this['channel']['noop']('no\x20ndauth\x20url\x20configured');}if(!this[_0x71df('0x8b')](_0x442d4b[_0x71df('0xfc')])){return this[_0x71df('0xf')][_0x71df('0xae')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x442d4b[_0x71df('0xfd')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xfe'));}if(!this[_0x71df('0x8b')](_0x442d4b[_0x71df('0xff')])){return this[_0x71df('0xf')][_0x71df('0xae')]('no\x20text\x20configured');}this[_0x71df('0xf')][_0x71df('0x100')]=!![];this[_0x71df('0x37')](_0x442d4b);this[_0x71df('0x42')](_0x442d4b[_0x71df('0x5f')],'in','','');this[_0x71df('0xf')]['noop'](util[_0x71df('0x2b')](_0x71df('0x101'),_0x442d4b['text']));var _0x57c061=this[_0x71df('0x102')][_0x71df('0x76')](this,_0x442d4b);if(_0x57c061){for(var _0x4860e2 in _0x57c061){if(_0x57c061[_0x71df('0x99')](_0x4860e2)){this[_0x71df('0xf')][_0x71df('0xa2')](util[_0x71df('0x2b')]('SESTEK_NDA_%s',_0x4860e2[_0x71df('0x70')]()),_0x57c061[_0x4860e2]);}}this[_0x71df('0x42')](_0x57c061['speech'],_0x71df('0xec'),'sesteknda','');if(_0x57c061[_0x71df('0x103')]){this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x104'),_0x57c061[_0x71df('0x103')]));var _0x46b1c4=this[_0x71df('0xf')][_0x71df('0x105')](_0x57c061['audiofile']);try{fs[_0x71df('0x106')](_0x57c061['audiofile']+_0x71df('0x107'));}catch(_0x1d3a58){logger[_0x71df('0x33')](_0x1d3a58);}return _0x46b1c4;}else{return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x108'),_0x57c061[_0x71df('0xeb')]));}}return this[_0x71df('0xf')]['error'](_0x442d4b,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x71df('0x109')]=function(_0x4acc37){logger[_0x71df('0x2e')](util['format'](_0x71df('0x10a'),_0x4acc37[_0x71df('0xad')]));return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x109'));};AGIVertices[_0x71df('0x11')][_0x71df('0x10b')]=function(_0x483f0d){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x10c'),_0x483f0d[_0x71df('0xad')]));var _0x2181d2='';if(_0x483f0d[_0x71df('0x10d')]){if(!this['isConfigured'](_0x483f0d[_0x71df('0x10d')])){return this[_0x71df('0xf')]['error'](_0x483f0d,_0x71df('0x10e'));}else{var _0x53b1bc=parseInt(_0x483f0d[_0x71df('0x10d')],0xa);if(isNaN(_0x53b1bc)){_0x2181d2=_0x483f0d['trunk_id'];}else{_0x2181d2=this[_0x71df('0x1f')][_0x71df('0x76')](this,_0x483f0d[_0x71df('0x10d')]);if(!_0x2181d2){return this[_0x71df('0xf')][_0x71df('0x33')](_0x483f0d,_0x71df('0x10f'));}}}}else if(_0x483f0d[_0x71df('0x110')]){_0x2181d2=_0x483f0d['trunk_name'];}else{return this[_0x71df('0xf')][_0x71df('0x33')](_0x483f0d,_0x71df('0x10e'));}var _0x4d04aa=this['channel'][_0x71df('0x5b')](_0x71df('0x111'),[util[_0x71df('0x2b')]('SIP/%s/%s',_0x2181d2,_0x483f0d[_0x71df('0x4a')]),_0x483f0d[_0x71df('0x6b')],_0x483f0d[_0x71df('0xe7')],_0x483f0d['url']]);if(_0x4d04aa[_0x71df('0xa7')]===-0x1){return _0x4d04aa;}return this[_0x71df('0xf')][_0x71df('0xae')](util['format'](_0x71df('0xe8'),_0x71df('0x111')));};AGIVertices[_0x71df('0x11')][_0x71df('0x112')]=function(_0x162463){logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x162463[_0x71df('0xad')]));return this['channel'][_0x71df('0xae')]('finally');};AGIVertices[_0x71df('0x11')][_0x71df('0xe')]=function(_0x55f789){logger[_0x71df('0x2e')](util['format'](_0x71df('0x113'),_0x55f789['label']));if(_0x55f789['retry']===0x0){return this[_0x71df('0xa9')](_0x55f789);}_0x55f789[_0x71df('0xaa')]-=0x1;if(!this[_0x71df('0x8b')](_0x55f789[_0x71df('0x114')])){return this['channel'][_0x71df('0x33')](_0x55f789,'no\x20file\x20audio\x20selected');}var _0x3edcc3=this[_0x71df('0x21')]['sync'](this,_0x55f789['file_id']);if(!_0x3edcc3){return this['channel'][_0x71df('0x33')](_0x55f789,_0x71df('0x115'));}if(!this[_0x71df('0x8b')](_0x55f789[_0x71df('0xdc')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x71df('0xdd'));}var _0x1fbbd3=this[_0x71df('0xf')]['getData'](_0x3edcc3,_0x55f789[_0x71df('0x116')],_0x55f789[_0x71df('0x117')]);var _0x432860=_0x1fbbd3[_0x71df('0xa7')]?_0x1fbbd3['result'][_0x71df('0x4e')]():'';logger[_0x71df('0x2e')](_0x71df('0x118'),JSON[_0x71df('0x7b')](_0x1fbbd3));if(_0x1fbbd3[_0x71df('0xa7')]===-0x1){this[_0x71df('0x37')][_0x71df('0x76')](this,_0x55f789,_0x432860);return _0x1fbbd3;}else if(_0x1fbbd3[_0x71df('0xa5')]===_0x71df('0x6b')){_0x1fbbd3['result']=_0x432860['length']>=parseInt(_0x55f789[_0x71df('0x119')])?'x':'i';}else{_0x1fbbd3[_0x71df('0xa7')]=_0x432860['length']>=parseInt(_0x55f789['mindigit'])&&_0x432860[_0x71df('0x9e')]<=parseInt(_0x55f789[_0x71df('0x117')])?'x':'i';}var _0x16c1a7=this[_0x71df('0x12')][_0x71df('0x76')](this,_0x55f789[_0x71df('0xdc')]);if(!_0x16c1a7){return this['channel']['error'](_0x55f789,_0x71df('0x11a'));}this[_0x71df('0xf')][_0x71df('0xa2')](_0x16c1a7,_0x432860);if(this[_0x71df('0x8b')](_0x55f789[_0x71df('0x11b')])){var _0x2dbda6=parseInt(_0x55f789[_0x71df('0x11b')],0xa);var _0x5efbbb=rs['generate']({'charset':'*','length':_0x2dbda6});var _0x3bb39e=_0x432860[_0x71df('0x9e')];if(_0x3bb39e>0x0){if(_0x3bb39e>_0x2dbda6){this[_0x71df('0x37')][_0x71df('0x76')](this,_0x55f789,_0x55f789[_0x71df('0x11c')]===_0x71df('0x11d')?_0x5efbbb+_0x432860[_0x71df('0x11e')](_0x2dbda6):_0x432860['substr'](0x0,_0x3bb39e-_0x2dbda6)+_0x5efbbb);}else{this['createSquareDetailsReport'][_0x71df('0x76')](this,_0x55f789,rs[_0x71df('0x11f')]({'charset':'*','length':_0x3bb39e}));}}else{this[_0x71df('0x37')][_0x71df('0x76')](this,_0x55f789,'');}}else{this['createSquareDetailsReport'][_0x71df('0x76')](this,_0x55f789,_0x432860);}return _0x1fbbd3;};AGIVertices[_0x71df('0x11')][_0x71df('0x120')]=function(_0x25ef61){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x121'),_0x25ef61['label']));return this[_0x71df('0xe')](_0x25ef61);};AGIVertices[_0x71df('0x11')][_0x71df('0x122')]=function(_0x4370bb){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x123'),_0x4370bb['label']));this[_0x71df('0x37')]['sync'](this,_0x4370bb,_0x4370bb[_0x71df('0x124')]);return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x125'),_0x4370bb[_0x71df('0x124')]));};AGIVertices['prototype']['awspolly']=function(_0x4a142a){logger['info'](util[_0x71df('0x2b')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x4a142a[_0x71df('0xad')]));if(!this['isConfigured'](_0x4a142a[_0x71df('0x8e')])||!this['isConfigured'](_0x4a142a['aws_secret_access_key'])){return this['channel'][_0x71df('0xae')](_0x71df('0x126'));}if(!this[_0x71df('0x8b')](_0x4a142a[_0x71df('0x5f')])){return this['channel'][_0x71df('0xae')](_0x71df('0xaf'));}this[_0x71df('0xf')][_0x71df('0xae')](util['format'](_0x71df('0x127'),_0x4a142a[_0x71df('0x5f')]));var _0x4d9746=this['awsPolly'][_0x71df('0x76')](this,_0x4a142a);if(_0x4d9746){this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x128'),_0x4d9746));var _0x17444a=this[_0x71df('0xf')][_0x71df('0x105')](_0x4d9746);try{fs[_0x71df('0x106')](_0x4d9746+_0x71df('0x107'));}catch(_0x5e1ff9){logger['error'](_0x5e1ff9);}return _0x17444a;}return this[_0x71df('0xf')][_0x71df('0x33')](_0x4a142a,_0x71df('0x129'));};AGIVertices['prototype'][_0x71df('0x12a')]=function(_0x30b970){logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x30b970[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x30b970['aws_access_key_id'])||!this[_0x71df('0x8b')](_0x30b970[_0x71df('0x8f')])){return this[_0x71df('0xf')]['noop'](_0x71df('0x126'));}if(!this[_0x71df('0x8b')](_0x30b970[_0x71df('0x12b')])){return this[_0x71df('0xf')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x71df('0x8b')](_0x30b970[_0x71df('0x5f')])){return this[_0x71df('0xf')]['noop']('no\x20text\x20configured');}this[_0x71df('0xf')]['bot']=!![];this[_0x71df('0x37')](_0x30b970);this[_0x71df('0x42')](_0x30b970['text'],'in','','');this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')]('Trying\x20Amazon\x20Lex:\x20%s',_0x30b970[_0x71df('0x5f')]));var _0x40ccc7=this[_0x71df('0x93')][_0x71df('0x76')](this,_0x30b970);if(_0x40ccc7){for(var _0x45e36c in _0x40ccc7){if(_0x40ccc7[_0x71df('0x99')](_0x45e36c)&&_[_0x71df('0x9a')](_0x40ccc7[_0x45e36c])){this[_0x71df('0xf')][_0x71df('0xa2')](util['format'](_0x71df('0x12c'),_0x45e36c[_0x71df('0x70')]()),_0x40ccc7[_0x45e36c]);}}if(_['isNil'](_0x40ccc7[_0x71df('0x7e')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x12d'));}else{this[_0x71df('0x42')](_0x40ccc7[_0x71df('0x7e')],_0x71df('0xec'),_0x71df('0x12e'),'');return this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')]('Amazon\x20Lex\x20Result\x20%s',_0x40ccc7[_0x71df('0x7e')]));}}return this[_0x71df('0xf')]['error'](_0x30b970,_0x71df('0x12f'));};AGIVertices[_0x71df('0x11')]['googleasr']=function(_0x1bc4b4){logger[_0x71df('0x2e')](util['format'](_0x71df('0x130'),_0x1bc4b4['label'],_0x1bc4b4[_0x71df('0x6b')]));if(!this[_0x71df('0x8b')](_0x1bc4b4[_0x71df('0x88')])){return this[_0x71df('0xf')][_0x71df('0xae')]('no\x20key\x20configured');}var _0x4b03bf='wav';var _0x2ee8ae=util[_0x71df('0x2b')](_0x71df('0x131'),FILES_PATH,rs[_0x71df('0x11f')](0x4));var _0x42076=util[_0x71df('0x2b')](_0x71df('0xa1'),_0x2ee8ae,_0x4b03bf);var _0x48f43e=!![];if(_0x1bc4b4[_0x71df('0x132')]===_0x71df('0x133')){_0x48f43e=![];}var _0x3c7a33=this['channel'][_0x71df('0x134')](_0x2ee8ae,_0x4b03bf,_0x1bc4b4['intKey'],_0x1bc4b4[_0x71df('0x6b')],undefined,_0x48f43e);if(_0x3c7a33['result']!==-0x1){this[_0x71df('0xf')]['noop'](util['format']('google\x20%s\x20file\x20created',_0x42076));var _0x944f19=this['googleASR']['sync'](this,_0x1bc4b4,_0x42076);if(_0x944f19){for(var _0x181f50 in _0x944f19){if(_0x944f19['hasOwnProperty'](_0x181f50)){this[_0x71df('0xf')]['setVariable'](util[_0x71df('0x2b')](_0x71df('0x135'),_0x181f50[_0x71df('0x70')]()),_0x944f19[_0x181f50]);}}return this['channel'][_0x71df('0xae')](util['format'](_0x71df('0x136'),JSON[_0x71df('0x7b')](_0x944f19)));}}return _0x3c7a33;};AGIVertices[_0x71df('0x11')][_0x71df('0x137')]=function(_0x367e17){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x138'),_0x367e17[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x367e17[_0x71df('0x97')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x139'));}if(!this[_0x71df('0x8b')](_0x367e17[_0x71df('0x13a')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x13b'));}var _0x3fcce5=_0x71df('0x13c');var _0x23a892=util[_0x71df('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0x71df('0x11f')](0x4));var _0x30212c=util[_0x71df('0x2b')](_0x71df('0xa1'),_0x23a892,_0x3fcce5);var _0x15aa9b=!![];if(_0x367e17['beep']===_0x71df('0x133')){_0x15aa9b=![];}var _0x16fa56=this[_0x71df('0xf')]['recordFile'](_0x23a892,_0x3fcce5,_0x367e17['intKey'],_0x367e17[_0x71df('0x6b')],undefined,_0x15aa9b);if(_0x16fa56['result']!==-0x1){this[_0x71df('0xf')][_0x71df('0xae')](util['format'](_0x71df('0x13d'),_0x30212c));var _0x4540d7=this[_0x71df('0x96')]['sync'](this,_0x367e17,_0x30212c);if(_0x4540d7){for(var _0x423bf2 in _0x4540d7){if(_0x4540d7[_0x71df('0x99')](_0x423bf2)){this[_0x71df('0xf')][_0x71df('0xa2')](util[_0x71df('0x2b')](_0x71df('0x13e'),_0x423bf2[_0x71df('0x70')]()),_0x4540d7[_0x423bf2]);}}return this[_0x71df('0xf')][_0x71df('0xae')](util['format'](_0x71df('0x13f'),JSON[_0x71df('0x7b')](_0x4540d7)));}}return _0x16fa56;};AGIVertices[_0x71df('0x11')]['gotoc']=function(_0x5d8ecf){logger[_0x71df('0x2e')](util['format'](_0x71df('0x140'),_0x5d8ecf['label']));return this['channel']['continueAt'](_0x5d8ecf[_0x71df('0x141')],_0x5d8ecf['extension'],_0x5d8ecf['priority']);};AGIVertices['prototype']['gotoif']=function(_0x4ce619){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x142'),_0x4ce619[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x4ce619['condition'])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x4ce619,'no\x20condition\x20configured');}try{var _0xa2304e=eval(_0x4ce619['condition'])?_0x71df('0x143'):_0x71df('0x144');this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x145'),_0x4ce619[_0x71df('0x146')],_0xa2304e));return{'code':0xc8,'result':_0xa2304e};}catch(_0xc23850){return{'code':0xc8,'result':_0x71df('0x144')};}};AGIVertices[_0x71df('0x11')][_0x71df('0x147')]=function(_0x6d9494){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x148'),_0x6d9494[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x6d9494[_0x71df('0x149')])){return this['channel'][_0x71df('0x33')](_0x6d9494,'no\x20interval\x20configured');}var _0x599340=this[_0x71df('0x27')]['sync'](this,_0x6d9494[_0x71df('0x149')]);if(!_0x599340){return this[_0x71df('0xf')][_0x71df('0x33')](_0x6d9494,_0x71df('0x14a'));}for(var _0x66eba1=0x0;_0x66eba1<_0x599340[_0x71df('0x9e')];_0x66eba1+=0x1){var _0x26c24e=this[_0x71df('0xf')][_0x71df('0x12')](util[_0x71df('0x2b')](_0x71df('0x14b'),_0x599340[_0x66eba1]));if(_0x26c24e[_0x71df('0xa7')]===-0x1){return _0x26c24e;}logger['info'](util[_0x71df('0x2b')](_0x71df('0x14c'),_0x599340[_0x66eba1],_0x26c24e[_0x71df('0xa5')]));if(_0x26c24e['extra']===_0x71df('0x143')){logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('IFTIME\x20%s\x20%s',_0x599340[_0x66eba1],'true'));this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')]('IFTIME\x20%s\x20%s',_0x599340[_0x66eba1],'true'));return{'code':0xc8,'result':_0x71df('0x143')};}else{logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x14c'),_0x599340[_0x66eba1],'false'));this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')]('IFTIME\x20%s\x20%s',_0x599340[_0x66eba1],_0x71df('0x144')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x71df('0x11')][_0x71df('0x14d')]=function(_0x1a7ee6){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x14e'),_0x1a7ee6[_0x71df('0xad')]));return this[_0x71df('0xf')][_0x71df('0x14d')]();};AGIVertices[_0x71df('0x11')][_0x71df('0x14f')]=function(_0x1e8abb){logger[_0x71df('0x2e')](util['format'](_0x71df('0x150'),_0x1e8abb[_0x71df('0xad')]));if(!this['isConfigured'](_0x1e8abb['key'])){return this[_0x71df('0xf')]['noop'](_0x71df('0x151'));}var _0x4fbf10=_0x71df('0x13c');var _0x1d5493=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x71df('0x11f')](0x4));var _0x56eab3=util['format'](_0x71df('0xa1'),_0x1d5493,_0x4fbf10);var _0x424c90=!![];if(_0x1e8abb['beep']===_0x71df('0x133')){_0x424c90=![];}var _0x43d2ab=this[_0x71df('0xf')]['recordFile'](_0x1d5493,_0x4fbf10,_0x1e8abb[_0x71df('0x152')],_0x1e8abb[_0x71df('0x6b')],undefined,_0x424c90);if(_0x43d2ab[_0x71df('0xa7')]!==-0x1){this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x153'),_0x56eab3));var _0x5a7622=this['ispeechASR'][_0x71df('0x76')](this,_0x1e8abb,_0x56eab3);if(_0x5a7622){for(var _0x2632c4 in _0x5a7622){if(_0x5a7622[_0x71df('0x99')](_0x2632c4)){this[_0x71df('0xf')][_0x71df('0xa2')](util['format']('ISPEECH_ASR_%s',_0x2632c4['toUpperCase']()),_0x5a7622[_0x2632c4]);}}return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x154'),JSON[_0x71df('0x7b')](_0x5a7622)));}}return _0x43d2ab;};AGIVertices[_0x71df('0x11')]['ispeechtts']=function(_0x3df894){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x155'),_0x3df894[_0x71df('0xad')]));if(!this['isConfigured'](_0x3df894[_0x71df('0x88')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x151'));}if(!this[_0x71df('0x8b')](_0x3df894[_0x71df('0x5f')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xaf'));}this['channel']['noop'](util['format'](_0x71df('0x156'),_0x3df894[_0x71df('0x5f')]));var _0x188152=this[_0x71df('0x87')][_0x71df('0x76')](this,_0x3df894);if(_0x188152){this[_0x71df('0xf')]['noop'](util[_0x71df('0x2b')](_0x71df('0x153'),_0x188152));var _0x4cef1d=this[_0x71df('0xf')][_0x71df('0x105')](_0x188152,_0x3df894[_0x71df('0x152')]);try{fs[_0x71df('0x106')](_0x188152+_0x71df('0x107'));}catch(_0x204c8d){logger[_0x71df('0x33')](_0x204c8d);}return _0x4cef1d;}return this[_0x71df('0xf')][_0x71df('0x33')](_0x3df894,_0x71df('0x157'));};AGIVertices[_0x71df('0x11')][_0x71df('0x158')]=function(_0x3dd61b){logger['info'](util[_0x71df('0x2b')](_0x71df('0x159'),_0x3dd61b['label']));if(!this[_0x71df('0x8b')](_0x3dd61b[_0x71df('0x15a')])){return this['channel'][_0x71df('0x33')](_0x3dd61b,_0x71df('0x15b'));}logger[_0x71df('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x71df('0xf')][_0x71df('0x3a')],_0x3dd61b[_0x71df('0x15a')]));var _0x14310d=this[_0x71df('0x56')]['sync'](this,_0x3dd61b['findBy']);if(_0x14310d){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x15c'),this[_0x71df('0xf')][_0x71df('0x3a')],_0x3dd61b[_0x71df('0x15a')]));this[_0x71df('0xf')]['noop'](util[_0x71df('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x71df('0xf')][_0x71df('0x3a')],_0x3dd61b[_0x71df('0x15a')]));return{'code':0xc8,'result':_0x71df('0x15d')};}else{logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x15e'),this[_0x71df('0xf')][_0x71df('0x3a')],_0x3dd61b[_0x71df('0x15a')]));this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x71df('0xf')][_0x71df('0x3a')],_0x3dd61b[_0x71df('0x15a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x71df('0x11')]['logout']=function(_0x644b3a){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x15f'),_0x644b3a[_0x71df('0xad')]));if(!this['isConfigured'](_0x644b3a[_0x71df('0x15a')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x644b3a,'no\x20find\x20by\x20configured');}logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x160'),this[_0x71df('0xf')][_0x71df('0x3a')],_0x644b3a[_0x71df('0x15a')]));var _0x3bbeed=this['agentLogout'][_0x71df('0x76')](this,_0x644b3a[_0x71df('0x15a')]);if(_0x3bbeed){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x15c'),this[_0x71df('0xf')][_0x71df('0x3a')],_0x644b3a['findBy']));this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x71df('0xf')][_0x71df('0x3a')],_0x644b3a[_0x71df('0x15a')]));return{'code':0xc8,'result':_0x71df('0x15d')};}else{logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x71df('0x3a')],_0x644b3a[_0x71df('0x15a')]));this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x15e'),this[_0x71df('0xf')][_0x71df('0x3a')],_0x644b3a[_0x71df('0x15a')]));return{'code':0xc8,'result':_0x71df('0x161')};}};AGIVertices[_0x71df('0x11')][_0x71df('0x162')]=function(_0x2b3a0d){logger[_0x71df('0x2e')](util['format'](_0x71df('0x163'),_0x2b3a0d['label']));if(!this[_0x71df('0x8b')](_0x2b3a0d[_0x71df('0x164')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x2b3a0d,_0x71df('0x165'));}this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x166'),_0x2b3a0d[_0x71df('0x164')]));var _0x135191=eval(_0x2b3a0d[_0x71df('0x164')]);if(!this[_0x71df('0x8b')](_0x2b3a0d['variable_id'])){return this[_0x71df('0xf')][_0x71df('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x38aa69=this[_0x71df('0x12')][_0x71df('0x76')](this,_0x2b3a0d[_0x71df('0xdc')]);if(!_0x38aa69){return this[_0x71df('0xf')][_0x71df('0x33')](_0x2b3a0d,_0x71df('0x11a'));}if(_[_0x71df('0x9d')](_0x135191)){var _0x4a3586=this;_0x135191[_0x71df('0xde')](function(_0xbd21bd,_0x5cd222){_0x4a3586['channel']['setVariable'](util[_0x71df('0x2b')]('%s[%s]',_0x38aa69,_0x5cd222),_0xbd21bd);});return this[_0x71df('0xf')][_0x71df('0xae')](util['format'](_0x71df('0x167'),_0x38aa69));}else{return this[_0x71df('0xf')]['setVariable'](_0x38aa69,_0x135191);}};AGIVertices[_0x71df('0x11')][_0x71df('0xd')]=function(_0x5088b5){logger['info'](util[_0x71df('0x2b')](_0x71df('0x168'),_0x5088b5[_0x71df('0xad')]));if(_0x5088b5[_0x71df('0xaa')]===0x0){return this[_0x71df('0xa9')](_0x5088b5);}_0x5088b5[_0x71df('0xaa')]-=0x1;if(!this[_0x71df('0x8b')](_0x5088b5[_0x71df('0x114')])){return this['channel'][_0x71df('0x33')](_0x5088b5,_0x71df('0x169'));}var _0x5c8b0d=this['getSound'][_0x71df('0x76')](this,_0x5088b5[_0x71df('0x114')]);if(!_0x5c8b0d){return this[_0x71df('0xf')][_0x71df('0x33')](_0x5088b5,_0x71df('0x115'));}var _0x5f2ea4=this[_0x71df('0xf')][_0x71df('0x16a')](_0x5c8b0d,_0x5088b5['response'],_0x5088b5['digit']);var _0xf8ce4a=_0x5f2ea4[_0x71df('0xa7')];if(_0x5f2ea4[_0x71df('0xa7')]===-0x1){this[_0x71df('0x37')][_0x71df('0x76')](this,_0x5088b5,'-1');return _0x5f2ea4;}else if(_0x5f2ea4['extra']===_0x71df('0x6b')){_0x5f2ea4[_0x71df('0xa7')]=_0x5f2ea4[_0x71df('0xa7')]['length']>0x0?_0x5f2ea4[_0x71df('0xa7')]:'t';}else if(_[_0x71df('0x45')](_0x5f2ea4[_0x71df('0xa7')])){_0x5f2ea4[_0x71df('0xa7')]='#';_0xf8ce4a='#';}if(!this[_0x71df('0x8b')](_0x5088b5['variable_id'])){this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0xdd'));}else{var _0x40b1ab=this[_0x71df('0x12')]['sync'](this,_0x5088b5[_0x71df('0xdc')]);if(!_0x40b1ab){return this['channel']['error'](_0x5088b5,_0x71df('0x11a'));}this[_0x71df('0xf')][_0x71df('0xa2')](_0x40b1ab,_0xf8ce4a);}this[_0x71df('0x37')][_0x71df('0x76')](this,_0x5088b5,_0xf8ce4a);return _0x5f2ea4;};AGIVertices[_0x71df('0x11')]['noop']=function(_0x322bcb){logger[_0x71df('0x2e')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x322bcb[_0x71df('0xad')]));return this[_0x71df('0xf')][_0x71df('0xae')](_0x322bcb['output']||_0x322bcb[_0x71df('0xad')]);};AGIVertices['prototype']['pause']=function(_0x34bc21){logger[_0x71df('0x2e')](util['format'](_0x71df('0x16b'),_0x34bc21['label']));if(!this[_0x71df('0x8b')](_0x34bc21[_0x71df('0x15a')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x34bc21,_0x71df('0x15b'));}logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x160'),this[_0x71df('0xf')][_0x71df('0x3a')],_0x34bc21[_0x71df('0x15a')]));var _0x3efb8e=this[_0x71df('0x50')][_0x71df('0x76')](this,_0x34bc21['pause_id']);var _0x4a119d=this['agentPause']['sync'](this,_0x34bc21[_0x71df('0x15a')],_0x3efb8e);if(_0x4a119d){logger[_0x71df('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x71df('0xf')][_0x71df('0x3a')],_0x34bc21[_0x71df('0x15a')]));this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x71df('0xf')]['callerid'],_0x34bc21[_0x71df('0x15a')]));return{'code':0xc8,'result':_0x71df('0x15d')};}else{logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x71df('0xf')][_0x71df('0x3a')],_0x34bc21[_0x71df('0x15a')]));this[_0x71df('0xf')]['noop'](util[_0x71df('0x2b')](_0x71df('0x15c'),this[_0x71df('0xf')][_0x71df('0x3a')],_0x34bc21[_0x71df('0x15a')]));return{'code':0xc8,'result':_0x71df('0x161')};}};AGIVertices[_0x71df('0x11')][_0x71df('0x16c')]=function(_0x3b781f){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x16d'),_0x3b781f[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x3b781f[_0x71df('0x114')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x3b781f,_0x71df('0x169'));}var _0x4f4bd3=this[_0x71df('0x21')]['sync'](this,_0x3b781f['file_id']);if(!_0x4f4bd3){return this[_0x71df('0xf')][_0x71df('0x33')](_0x3b781f,_0x71df('0x115'));}var _0x4b0216=this[_0x71df('0xf')][_0x71df('0x5b')](_0x71df('0x16e'),[_0x4f4bd3,_0x3b781f['opts']]);if(_0x4b0216[_0x71df('0xa7')]===-0x1){return _0x4b0216;}return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xc7'),_0x71df('0x16e'),_0x4f4bd3));};AGIVertices[_0x71df('0x11')]['queue']=function(_0x5e2733){logger['info'](util[_0x71df('0x2b')](_0x71df('0x16f'),_0x5e2733[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x5e2733[_0x71df('0x170')])){return this['channel'][_0x71df('0x33')](_0x5e2733,_0x71df('0x171'));}var _0x4b2340='';var _0x3911cb=parseInt(_0x5e2733[_0x71df('0x170')],0xa);if(isNaN(_0x3911cb)){_0x4b2340=_0x5e2733[_0x71df('0x170')];}else{_0x4b2340=this['getVoiceQueue'][_0x71df('0x76')](this,_0x5e2733[_0x71df('0x170')]);if(!_0x4b2340){return this[_0x71df('0xf')][_0x71df('0x33')](_0x5e2733,_0x71df('0x172'));}}var _0xcbf140='';if(this[_0x71df('0x8b')](_0x5e2733[_0x71df('0x114')])){var _0x196e99=this[_0x71df('0x21')]['sync'](this,_0x5e2733[_0x71df('0x114')]);if(_0x196e99){_0xcbf140=_0x196e99;}}this['createSquareDetailsReport'][_0x71df('0x76')](this,_0x5e2733,_0x4b2340);if(_0x5e2733['opts'][_0x71df('0x173')]('x')<0x0){_0x5e2733[_0x71df('0xe7')]+='x';}if(_0x5e2733[_0x71df('0xe7')][_0x71df('0x173')]('X')<0x0){_0x5e2733[_0x71df('0xe7')]+='X';}this[_0x71df('0xf')][_0x71df('0xa2')](_0x71df('0x174'),_0x4b2340?_0x4b2340[_0x71df('0x175')]():'');var _0x278660=this[_0x71df('0xf')]['exec'](_0x71df('0x176'),[_0x4b2340,_0x5e2733[_0x71df('0xe7')],_0x5e2733[_0x71df('0x69')],_0xcbf140,_0x5e2733[_0x71df('0x6b')],_0x5e2733[_0x71df('0x8')],_0x5e2733['macro'],_0x5e2733['gosub'],'',_0x5e2733[_0x71df('0x177')]]);if(_0x278660[_0x71df('0xa7')]===-0x1){return _0x278660;}return this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xc7'),_0x71df('0x176'),_0x4b2340));};AGIVertices['prototype']['record']=function(_0x1df86b){logger['info'](util['format'](_0x71df('0x178'),_0x1df86b[_0x71df('0xad')]));var _0x98b79b=_0x1df86b['recordingFormat']||_0x71df('0x13c');var _0x54ed1d=util['format'](_0x71df('0x179'),this[_0x71df('0xf')]['uniqueid'],rs['generate'](0x5));var _0x2c4195=util[_0x71df('0x2b')](_0x71df('0x17a'),FILES_PATH,_0x54ed1d,_0x98b79b);var _0x283aa7=util[_0x71df('0x2b')](_0x71df('0x131'),FILES_PATH,_0x54ed1d);this['createSquareRecording'][_0x71df('0x76')](this,_0x1df86b,_0x54ed1d,_0x2c4195);this[_0x71df('0xf')][_0x71df('0xa2')](_0x71df('0x17b'),_0x54ed1d);logger[_0x71df('0x2e')](_0x71df('0x17c'),_0x283aa7,_0x98b79b,_0x1df86b[_0x71df('0x17d')],_0x1df86b[_0x71df('0x6b')]);return this[_0x71df('0xf')]['recordFile'](_0x283aa7,_0x98b79b,_0x1df86b[_0x71df('0x17d')],_0x1df86b[_0x71df('0x6b')],undefined,!![]);};AGIVertices[_0x71df('0x11')]['restapi']=function(_0x555793){logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x555793['label']));if(!this[_0x71df('0x8b')](_0x555793[_0x71df('0x69')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x17e'));}var _0x3204f1=this[_0x71df('0x68')][_0x71df('0x76')](this,_0x555793);logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('Response:',util['inspect'](_0x3204f1,{'showHidden':![],'depth':null})));if(!this[_0x71df('0x8b')](_0x555793[_0x71df('0xdc')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x17f'));}var _0x6e80d9=this[_0x71df('0x12')][_0x71df('0x76')](this,_0x555793['variable_id']);if(!_0x6e80d9){return this[_0x71df('0xf')][_0x71df('0x33')](_0x555793,_0x71df('0x11a'));}this[_0x71df('0xf')][_0x71df('0xa2')](util[_0x71df('0x2b')](_0x71df('0x180'),_0x6e80d9),_0x3204f1[_0x71df('0x7d')]?_0x3204f1[_0x71df('0x7d')]:'200');this[_0x71df('0xf')]['setVariable'](util['format'](_0x71df('0x181'),_0x6e80d9),_0x3204f1['statusMessage']?_0x3204f1[_0x71df('0x182')]:'OK');if(_0x3204f1[_0x71df('0x7a')]){try{this['saveRestApiResult'](_0x3204f1[_0x71df('0x7a')],_0x6e80d9);}catch(_0x2298ab){logger['error'](util[_0x71df('0x2b')](_0x71df('0x183'),_0x6e80d9));}}return this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0xe0'),_0x6e80d9));};AGIVertices[_0x71df('0x11')]['saydigits']=function(_0x5d241e){logger[_0x71df('0x2e')](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5d241e['label']));return this[_0x71df('0xf')]['sayDigits'](_0x5d241e['digits'][_0x71df('0x5c')](/\s+/g,''),_0x5d241e['escape_digits']);};AGIVertices[_0x71df('0x11')][_0x71df('0x184')]=function(_0x1274b6){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x185'),_0x1274b6[_0x71df('0xad')]));return this[_0x71df('0xf')][_0x71df('0x186')](_0x1274b6['number']['replace'](/\s+/g,''),_0x1274b6[_0x71df('0x17d')]);};AGIVertices[_0x71df('0x11')][_0x71df('0x187')]=function(_0x2fae90){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x188'),_0x2fae90[_0x71df('0xad')]));return this[_0x71df('0xf')][_0x71df('0x189')](_0x2fae90['text'],_0x2fae90[_0x71df('0x17d')]);};AGIVertices['prototype'][_0x71df('0x18a')]=function(_0x42b189){logger['info'](util[_0x71df('0x2b')](_0x71df('0x18b'),_0x42b189[_0x71df('0xad')]));if(!this['isConfigured'](_0x42b189[_0x71df('0x18c')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x18d'));}var _0x3e7adf=this[_0x71df('0x25')][_0x71df('0x76')](this,_0x42b189['account_id']);if(!_0x3e7adf||!_0x3e7adf['Smtp']){return this[_0x71df('0xf')][_0x71df('0x33')](_0x42b189,_0x71df('0x18e'));}var _0x151bbe={'from':util['format'](_0x71df('0x18f'),_0x3e7adf[_0x71df('0x15')],_0x3e7adf[_0x71df('0x190')]||_0x3e7adf[_0x71df('0x191')]['user']),'to':_0x42b189['to']||'','cc':_0x42b189['cc']||'','bcc':_0x42b189['bcc']||'','subject':_0x42b189[_0x71df('0x192')],'html':_0x42b189[_0x71df('0x5f')],'text':_0x42b189[_0x71df('0x5f')]};if(this[_0x71df('0x8b')](_0x42b189[_0x71df('0x193')])){}logger[_0x71df('0x194')](_0x71df('0x195'),JSON[_0x71df('0x7b')](_0x151bbe));this[_0x71df('0x37')][_0x71df('0x76')](this,_0x42b189,_0x42b189[_0x71df('0x18c')]);this[_0x71df('0xf')]['noop'](util[_0x71df('0x2b')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3e7adf[_0x71df('0x15')]));this[_0x71df('0x26')][_0x71df('0x76')](this,_0x3e7adf['smtpOptions'],_0x151bbe);return this['channel'][_0x71df('0xae')](_0x71df('0x196'));};AGIVertices[_0x71df('0x11')][_0x71df('0x197')]=function(_0x57ed2a){logger['info'](util[_0x71df('0x2b')](_0x71df('0x198'),_0x57ed2a[_0x71df('0xad')]));return this[_0x71df('0xf')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x71df('0x11')]['sendSMS']=function(_0xa9ff14){logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0xa9ff14[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0xa9ff14[_0x71df('0x199')])){return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x19a'));}var _0x2eb91d=this['getSmsAccount'][_0x71df('0x76')](this,_0xa9ff14[_0x71df('0x199')]);if(!_0x2eb91d){return this[_0x71df('0xf')][_0x71df('0x33')](_0xa9ff14,_0x71df('0x19b'));}var _0x2048d2={'body':_0xa9ff14[_0x71df('0x19c')],'phone':_0xa9ff14['to']||'','SmsAccountId':_0x2eb91d['id']};logger['debug'](_0x71df('0x19d'),JSON[_0x71df('0x7b')](_0x2048d2));this[_0x71df('0x37')][_0x71df('0x76')](this,_0xa9ff14,_0xa9ff14[_0x71df('0x199')]);this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x19e'),_0x2eb91d[_0x71df('0x15')]));this[_0x71df('0x36')]['sync'](this,_0x2048d2);return this[_0x71df('0xf')][_0x71df('0xae')](_0x71df('0x19f'));};AGIVertices['prototype']['set']=function(_0x2b5650){logger[_0x71df('0x2e')](util['format'](_0x71df('0x1a0'),_0x2b5650[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x2b5650[_0x71df('0xdc')])){return this['channel'][_0x71df('0x33')](_0x2b5650,_0x71df('0x1a1'));}var _0x584f2f=this[_0x71df('0x12')][_0x71df('0x76')](this,_0x2b5650['variable_id']);if(!_0x584f2f){return this[_0x71df('0xf')]['error'](_0x2b5650,'no\x20variable\x20found');}return this[_0x71df('0xf')]['setVariable'](_0x584f2f,_0x2b5650[_0x71df('0x1a2')]);};AGIVertices[_0x71df('0x11')][_0x71df('0x1a3')]=function(_0x3cb3a0){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x1a4'),_0x3cb3a0[_0x71df('0xad')]));this['channel'][_0x71df('0xae')](_0x71df('0x1a5'));if(_0x3cb3a0[_0x71df('0xbb')]===_0x71df('0x1a6')){this['channel'][_0x71df('0xae')]('Answer');return this[_0x71df('0xf')][_0x71df('0xbb')]();}return this['channel'][_0x71df('0xae')](_0x71df('0x1a7'));};AGIVertices[_0x71df('0x11')][_0x71df('0x1a8')]=function(_0x2a39a5){logger['info'](util[_0x71df('0x2b')](_0x71df('0x1a9'),_0x2a39a5[_0x71df('0xad')]));if(!this[_0x71df('0x8b')](_0x2a39a5[_0x71df('0x1aa')])){return this[_0x71df('0xf')][_0x71df('0x33')](_0x2a39a5,_0x71df('0x1ab'));}var _0x52aece=this['getSquareProject'][_0x71df('0x76')](this,_0x2a39a5[_0x71df('0x1aa')]);if(!this[_0x71df('0x8b')](_0x52aece)){return this[_0x71df('0xf')][_0x71df('0x33')](_0x2a39a5,util[_0x71df('0x2b')](_0x71df('0x1ac'),_0x2a39a5[_0x71df('0x1aa')]));}if(_0x52aece===this[_0x71df('0xf')][_0x71df('0x39')]){return this[_0x71df('0xf')][_0x71df('0x33')](_0x2a39a5,_0x71df('0x1ad'));}this[_0x71df('0x37')][_0x71df('0x76')](this,_0x2a39a5,_0x52aece);var _0x569003=this[_0x71df('0xf')][_0x71df('0x5b')](_0x71df('0x1ae'),util[_0x71df('0x2b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x71df('0x8')]['host']||_0x71df('0x1af'),_0x52aece,this['channel'][_0x71df('0x39')]));if(_0x569003['result']===-0x1){return _0x569003;}return this[_0x71df('0xf')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x71df('0x1ae'),_0x52aece));};AGIVertices[_0x71df('0x11')][_0x71df('0x1b0')]=function(_0x44d48e){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x1b1'),_0x44d48e['label']));var _0x4e65cb=this['shellCommand'][_0x71df('0x76')](this,_0x44d48e[_0x71df('0xb9')]);this[_0x71df('0x37')]['sync'](this,_0x44d48e,_0x44d48e[_0x71df('0xb9')]);if(this[_0x71df('0x8b')](_0x44d48e['variable_id'])){var _0x517ee0=this['getVariable'][_0x71df('0x76')](this,_0x44d48e[_0x71df('0xdc')]);if(_0x517ee0){this['channel'][_0x71df('0xa2')](_0x517ee0,_0x4e65cb);return this[_0x71df('0xf')]['noop'](util[_0x71df('0x2b')](_0x71df('0x1b2'),_0x44d48e[_0x71df('0xb9')],_0x517ee0));}}return this['channel'][_0x71df('0xae')](util['format'](_0x71df('0x1b3'),_0x44d48e[_0x71df('0xb9')]));};AGIVertices[_0x71df('0x11')][_0x71df('0x1b4')]=function(_0x3e122c){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x1b5'),_0x3e122c['label']));_0x3e122c[_0x71df('0x5f')]=_0x3e122c[_0x71df('0x5f')][_0x71df('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3e122c['apiKey'])){return this[_0x71df('0xf')]['noop']('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x3e122c[_0x71df('0x5f')])){return this[_0x71df('0xf')]['noop'](_0x71df('0xaf'));}this[_0x71df('0xf')]['noop'](util[_0x71df('0x2b')](_0x71df('0x1b6'),_0x3e122c[_0x71df('0x5f')]));var _0x739d8b=this[_0x71df('0x5d')]['sync'](this,_0x3e122c);if(_0x739d8b){this[_0x71df('0xf')]['noop'](util['format'](_0x71df('0x1b7'),_0x739d8b));var _0x2f63f1=this[_0x71df('0xf')][_0x71df('0x105')](_0x739d8b);try{fs[_0x71df('0x106')](_0x739d8b+_0x71df('0x107'));}catch(_0x57ab2d){logger[_0x71df('0x33')](_0x57ab2d);}return _0x2f63f1;}return this[_0x71df('0xf')][_0x71df('0x33')](_0x3e122c,_0x71df('0x1b8'));};AGIVertices[_0x71df('0x11')]['tts']=function(_0x53b66a){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x1b9'),_0x53b66a[_0x71df('0xad')]));_0x53b66a[_0x71df('0x5f')]=_0x53b66a['text'][_0x71df('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x71df('0x8b')](_0x53b66a[_0x71df('0x5f')])){return this[_0x71df('0xf')]['noop'](_0x71df('0xaf'));}this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x53b66a[_0x71df('0x5f')]));var _0x5a5382=this[_0x71df('0x66')][_0x71df('0x76')](this,_0x53b66a);if(_0x5a5382){this['channel']['noop'](util[_0x71df('0x2b')](_0x71df('0x1ba'),_0x5a5382));var _0x12833b=this[_0x71df('0xf')]['streamFile'](_0x5a5382);try{fs[_0x71df('0x106')](_0x5a5382+_0x71df('0x107'));}catch(_0x1707be){logger[_0x71df('0x33')](_0x1707be);}return _0x12833b;}return this[_0x71df('0xf')][_0x71df('0x33')](_0x53b66a,_0x71df('0x1bb'));};AGIVertices['prototype'][_0x71df('0x1bc')]=function(_0x14bd3b){logger['info'](util[_0x71df('0x2b')](_0x71df('0x1bd'),_0x14bd3b[_0x71df('0xad')]));if(!this['isConfigured'](_0x14bd3b[_0x71df('0x15a')])){return this['channel']['error'](_0x14bd3b,_0x71df('0x15b'));}logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x160'),this[_0x71df('0xf')]['callerid'],_0x14bd3b[_0x71df('0x15a')]));var _0xd86181=this[_0x71df('0x54')][_0x71df('0x76')](this,_0x14bd3b[_0x71df('0x15a')]);if(_0xd86181){logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x71df('0xf')][_0x71df('0x3a')],_0x14bd3b['findBy']));this['channel'][_0x71df('0xae')](util[_0x71df('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x71df('0xf')][_0x71df('0x3a')],_0x14bd3b[_0x71df('0x15a')]));return{'code':0xc8,'result':_0x71df('0x15d')};}else{logger[_0x71df('0x2e')](util[_0x71df('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x71df('0xf')][_0x71df('0x3a')],_0x14bd3b[_0x71df('0x15a')]));this[_0x71df('0xf')][_0x71df('0xae')](util[_0x71df('0x2b')](_0x71df('0x15e'),this['channel'][_0x71df('0x3a')],_0x14bd3b[_0x71df('0x15a')]));return{'code':0xc8,'result':_0x71df('0x161')};}};AGIVertices[_0x71df('0x11')][_0x71df('0x1be')]=function(_0x4dd510){logger['info'](util[_0x71df('0x2b')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4dd510[_0x71df('0xad')]));var _0x273ecb=this[_0x71df('0xf')][_0x71df('0x5b')]('VOICEMAIL',[_0x4dd510[_0x71df('0x1bf')],_0x4dd510['options']]);if(_0x273ecb[_0x71df('0xa7')]===-0x1){return _0x273ecb;}return this[_0x71df('0xf')]['noop'](util[_0x71df('0x2b')](_0x71df('0xc7'),_0x71df('0x1c0'),_0x4dd510['mailbox']));};AGIVertices[_0x71df('0x11')][_0x71df('0x1c1')]=function(_0x42950e){logger[_0x71df('0x2e')](util[_0x71df('0x2b')](_0x71df('0x1c2'),_0x42950e['label']));if(!this['isConfigured'](_0x42950e[_0x71df('0xdc')])){return this[_0x71df('0xf')]['error'](_0x42950e,'no\x20variable\x20selected');}var _0xfc56f0=this['getVariable'][_0x71df('0x76')](this,_0x42950e['variable_id']);if(!_0xfc56f0){return this['channel']['error'](_0x42950e,_0x71df('0x11a'));}var _0x52b1a3=this[_0x71df('0xf')][_0x71df('0x12')](_0xfc56f0);return{'code':0xc8,'result':_0x52b1a3[_0x71df('0xa5')]?_0x52b1a3['extra']:'-'};};String[_0x71df('0x11')][_0x71df('0xa4')]=function(_0x1d43b5,_0x49be18){return this[_0x71df('0x1c3')](_0x1d43b5)[_0x71df('0x1c4')](_0x49be18);};module[_0x71df('0x1c5')]=AGIVertices; \ No newline at end of file +var _0x6324=['aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','includes','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','no\x20text\x20configured','exec','MRCPSynth','noop','mrcprecog','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','no\x20mail\x20account\x20configured','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','bcc','subject','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','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','moment','request-promise','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','catch','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervals','getIntervalById','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','channel','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','POST','PUT','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region'];(function(_0x4a604d,_0x5a3566){var _0x3dc19c=function(_0x462b3e){while(--_0x462b3e){_0x4a604d['push'](_0x4a604d['shift']());}};_0x3dc19c(++_0x5a3566);}(_0x6324,0x142));var _0x4632=function(_0x82b73d,_0x17a49b){_0x82b73d=_0x82b73d-0x0;var _0x250450=_0x6324[_0x82b73d];return _0x250450;};'use strict';var fs=require('fs');var util=require(_0x4632('0x0'));var _=require(_0x4632('0x1'));var sh=require(_0x4632('0x2'));var odbc=require(_0x4632('0x3'))();var rs=require('randomstring');var moment=require(_0x4632('0x4'));var Mustache=require('mustache');var rp=require(_0x4632('0x5'));var logger=require('../../config/logger')(_0x4632('0x6'));var config=require('../../config/environment');var shared=require(_0x4632('0x7'));var scripts=require(_0x4632('0x8'));var FILES_PATH=_0x4632('0x9');var recursiveMapAttributes=[_0x4632('0xa'),'rawBody'];var verticesWithRetry=[_0x4632('0xb'),_0x4632('0xc'),_0x4632('0xd')];var AGIVertices=function(_0x5a523b,_0xc3bc9e,_0x47824c){this['channel']=_0x5a523b;this['rpc']=_0xc3bc9e;this[_0x4632('0xe')]=_0x47824c;};AGIVertices[_0x4632('0xf')][_0x4632('0x10')]=function(_0x3e26d9,_0x762639){this[_0x4632('0x11')][_0x4632('0x12')](_0x3e26d9)[_0x4632('0x13')](function(_0x4a4cdd){_0x762639(null,_0x4a4cdd?_0x4a4cdd[_0x4632('0x14')]:![]);})['catch'](function(_0x4719f7){_0x762639(_0x4719f7);});};AGIVertices[_0x4632('0xf')][_0x4632('0x15')]=function(_0x2dce9f,_0x51ee37){this[_0x4632('0x11')][_0x4632('0x16')](_0x2dce9f)[_0x4632('0x13')](function(_0x37d798){_0x51ee37(null,_0x37d798?_0x37d798[_0x4632('0x14')]:![]);})['catch'](function(_0x47b349){_0x51ee37(_0x47b349);});};AGIVertices[_0x4632('0xf')][_0x4632('0x17')]=function(_0x2bcfa3,_0x125eb9){this['rpc'][_0x4632('0x18')](_0x2bcfa3)[_0x4632('0x13')](function(_0x1a94c0){_0x125eb9(null,_0x1a94c0?_0x1a94c0['name']:![]);})[_0x4632('0x19')](function(_0x1894bb){_0x125eb9(_0x1894bb);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x1c0523,_0x3cf2bd){this[_0x4632('0x11')][_0x4632('0x1a')](_0x1c0523)[_0x4632('0x13')](function(_0x3d2d23){_0x3cf2bd(null,_0x3d2d23?_0x3d2d23[_0x4632('0x1b')]:![]);})[_0x4632('0x19')](function(_0x29f875){_0x3cf2bd(_0x29f875);});};AGIVertices[_0x4632('0xf')][_0x4632('0x1c')]=function(_0x2d656a,_0x2ca6a5){this[_0x4632('0x11')][_0x4632('0x1d')](_0x2d656a)[_0x4632('0x13')](function(_0x4264d5){_0x2ca6a5(null,_0x4264d5?_0x4264d5[_0x4632('0x14')]:![]);})[_0x4632('0x19')](function(_0x1e1b86){_0x2ca6a5(_0x1e1b86);});};AGIVertices[_0x4632('0xf')][_0x4632('0x1e')]=function(_0x3b0823,_0x259c75){this[_0x4632('0x11')][_0x4632('0x1f')](_0x3b0823)[_0x4632('0x13')](function(_0x2e3428){_0x259c75(null,_0x2e3428?_0x2e3428[_0x4632('0x14')]:![]);})[_0x4632('0x19')](function(_0x22d0f5){_0x259c75(_0x22d0f5);});};AGIVertices[_0x4632('0xf')][_0x4632('0x20')]=function(_0x4d9098,_0x57798a){var _0x466126=this;this[_0x4632('0x11')][_0x4632('0x21')](_0x4d9098)[_0x4632('0x13')](function(_0x34079f){_0x57798a(null,_0x34079f?_0x466126[_0x4632('0x22')](_0x34079f[_0x4632('0x23')]):![]);})['catch'](function(_0x42d505){_0x57798a(_0x42d505);});};AGIVertices[_0x4632('0xf')]['getMailAccount']=function(_0x216119,_0x5316f7){this[_0x4632('0x11')]['getMailAccountById'](_0x216119)['then'](function(_0x1973eb){_0x5316f7(null,_0x1973eb?_0x1973eb:![]);})[_0x4632('0x19')](function(_0x3fe812){_0x5316f7(_0x3fe812);});};AGIVertices['prototype']['sendMailMessage']=function(_0x395f4e,_0x7671ab,_0x596586){this['mailRpc'][_0x4632('0x24')](_0x395f4e,_0x7671ab)[_0x4632('0x13')](function(){_0x596586(null);})['catch'](function(_0x101906){_0x596586(_0x101906);});};AGIVertices[_0x4632('0xf')][_0x4632('0x25')]=function(_0x141fa8,_0x11bd6c){this['rpc'][_0x4632('0x26')](_0x141fa8)[_0x4632('0x13')](function(_0x5a577c){if(_0x5a577c){if(_0x5a577c['IntervalId']){_0x11bd6c(null,[_0x5a577c[_0x4632('0x27')]]);}else{_0x11bd6c(null,_['map'](_0x5a577c['Intervals'],_0x4632('0x27')));}}else{_0x11bd6c(null,![]);}})['catch'](function(_0x318416){_0x11bd6c(_0x318416);});};AGIVertices[_0x4632('0xf')][_0x4632('0x22')]=function(_0x52dd7f){return util[_0x4632('0x28')](_0x4632('0x29'),FILES_PATH,_0x52dd7f);};AGIVertices[_0x4632('0xf')][_0x4632('0x2a')]=function(_0x37c4d0,_0x5d20f9,_0x486f6c){odbc[_0x4632('0x2b')](_0x37c4d0,function(_0xd90c7c){if(_0xd90c7c){logger[_0x4632('0x2c')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0xd90c7c);_0x486f6c(_0xd90c7c);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x4632('0x2d')](_0x5d20f9,function(_0x393ef2,_0x5a0096){if(_0x393ef2){logger[_0x4632('0x2e')](_0x4632('0x2f'),_0x5d20f9);_0x486f6c(_0x393ef2);}else{logger[_0x4632('0x2e')](_0x4632('0x30'),_0x5d20f9);odbc[_0x4632('0x31')](function(_0x3840b8){if(_0x3840b8){logger[_0x4632('0x2c')](_0x4632('0x32'),_0x3840b8);}_0x486f6c(null,_0x5a0096);});}});}});};AGIVertices[_0x4632('0xf')][_0x4632('0x33')]=function(_0x1fd3f1,_0x3b6258){this['rpc'][_0x4632('0x34')](_0x1fd3f1)[_0x4632('0x13')](function(_0x4c0e13){_0x3b6258(null,_0x4c0e13?_0x4c0e13:![]);})[_0x4632('0x19')](function(_0x1c39bc){_0x3b6258(_0x1c39bc);});};AGIVertices['prototype'][_0x4632('0x35')]=function(_0x514bce,_0x3a1433){this[_0x4632('0x11')][_0x4632('0x35')](_0x514bce)[_0x4632('0x13')](function(_0x5b630a){_0x3a1433(null,_0x5b630a);})[_0x4632('0x19')](function(_0x29381a){_0x3a1433(_0x29381a);});};AGIVertices[_0x4632('0xf')][_0x4632('0x36')]=function(_0x5cc716,_0x5b3fa9,_0x319ed4){this[_0x4632('0x11')][_0x4632('0x36')]({'uniqueid':this['channel'][_0x4632('0x37')],'node':_0x5cc716[_0x4632('0x38')],'application':_0x5cc716[_0x4632('0x39')],'data':_0x5b3fa9||null,'project_name':this[_0x4632('0x3a')][_0x4632('0x3b')],'callerid':this[_0x4632('0x3a')][_0x4632('0x3c')]})['then'](function(_0x2be478){if(_0x319ed4){_0x319ed4(null,_0x2be478);}})[_0x4632('0x19')](function(_0x11644f){if(_0x319ed4){_0x319ed4(_0x11644f);}});};AGIVertices[_0x4632('0xf')][_0x4632('0x3d')]=function(_0x4d1d50,_0x579ed2,_0x6e373d,_0x3a1d52){this[_0x4632('0x11')][_0x4632('0x3d')]({'uniqueid':this['channel'][_0x4632('0x37')],'callerid':this[_0x4632('0x3a')][_0x4632('0x3c')],'calleridname':this[_0x4632('0x3a')][_0x4632('0x3e')],'context':this['channel'][_0x4632('0x3f')],'extension':this[_0x4632('0x3a')][_0x4632('0x40')],'priority':this[_0x4632('0x3a')][_0x4632('0x41')],'accountcode':this[_0x4632('0x3a')][_0x4632('0x42')],'dnid':this[_0x4632('0x3a')][_0x4632('0x43')],'projectName':this[_0x4632('0x3a')][_0x4632('0x3b')],'saveName':_0x579ed2,'filename':_0x4d1d50['file']||_0x579ed2,'savePath':_0x6e373d})[_0x4632('0x13')](function(_0x1ccadb){_0x3a1d52(null,_0x1ccadb);})[_0x4632('0x19')](function(_0x4d64f7){_0x3a1d52(_0x4d64f7);});};AGIVertices[_0x4632('0xf')][_0x4632('0x44')]=function(_0x1309aa,_0x2db3c8,_0xa681e9,_0x70a4fd,_0x37c76a){this[_0x4632('0x11')][_0x4632('0x44')]({'uniqueid':this[_0x4632('0x3a')]['uniqueid'],'body':_0x1309aa,'direction':_0x2db3c8,'providerName':_0xa681e9,'providerResponse':_0x70a4fd})[_0x4632('0x13')](function(_0x3eb9b6){if(_0x37c76a){_0x37c76a(null,_0x3eb9b6);}})['catch'](function(_0x142a26){if(_0x37c76a){_0x37c76a(_0x142a26);}});};AGIVertices[_0x4632('0xf')][_0x4632('0x45')]=function(_0x28e7fb,_0x2c59f5){this[_0x4632('0x11')][_0x4632('0x45')]({'firstName':_[_0x4632('0x46')](_0x28e7fb[_0x4632('0x14')])||_[_0x4632('0x47')](_0x28e7fb[_0x4632('0x14')])?_0x4632('0x48')+Math[_0x4632('0x49')]():_0x28e7fb[_0x4632('0x14')],'lastName':_[_0x4632('0x46')](_0x28e7fb[_0x4632('0x4a')])||_[_0x4632('0x47')](_0x28e7fb[_0x4632('0x4a')])?null:_0x28e7fb[_0x4632('0x4a')],'phone':_0x28e7fb[_0x4632('0x4b')],'ListId':_0x28e7fb['list_id'],'scheduledat':_0x28e7fb[_0x4632('0x4c')],'callbackUniqueid':this[_0x4632('0x3a')][_0x4632('0x37')],'tags':_0x4632('0x4d'),'description':_0x4632('0x4e')+_0x28e7fb[_0x4632('0x4c')]['toString'](),'priority':_0x28e7fb[_0x4632('0x4f')]})[_0x4632('0x13')](function(_0x41409d){_0x2c59f5(null,_0x41409d);})['catch'](function(_0xdc9d7f){_0x2c59f5(_0xdc9d7f);});};AGIVertices[_0x4632('0xf')]['getPause']=function(_0x17bc91,_0x1aa4f0){this[_0x4632('0x11')]['getPauseById'](_0x17bc91)[_0x4632('0x13')](function(_0x334a8e){_0x1aa4f0(null,_0x334a8e?_0x334a8e[_0x4632('0x14')]:![]);})[_0x4632('0x19')](function(_0x3e0811){_0x1aa4f0(_0x3e0811);});};AGIVertices[_0x4632('0xf')][_0x4632('0x50')]=function(_0x4658de,_0x2965df,_0x3abcbf){var _0x58d39a={'role':_0x4632('0x51')};_0x58d39a[_0x4658de]=this[_0x4632('0x3a')]['callerid'];this[_0x4632('0x11')]['agentPause'](_0x58d39a,_0x2965df,this['channel'][_0x4632('0x37')])[_0x4632('0x13')](function(_0x2451ba){_0x3abcbf(null,_[_0x4632('0x47')](_0x2451ba)?![]:!![]);})[_0x4632('0x19')](function(_0x433dac){logger[_0x4632('0x2c')](_0x433dac);_0x3abcbf(null,![]);});};AGIVertices[_0x4632('0xf')][_0x4632('0x52')]=function(_0x2eacee,_0x1c321f){var _0x356d6c={'role':_0x4632('0x51')};_0x356d6c[_0x2eacee]=this[_0x4632('0x3a')]['callerid'];this['rpc'][_0x4632('0x52')](_0x356d6c)[_0x4632('0x13')](function(_0x14233e){_0x1c321f(null,_[_0x4632('0x47')](_0x14233e)?![]:!![]);})[_0x4632('0x19')](function(_0x29321c){logger['error'](_0x29321c);_0x1c321f(null,![]);});};AGIVertices[_0x4632('0xf')][_0x4632('0x53')]=function(_0x4217ea,_0x2e4d57){var _0x5d1994={'role':'agent'};_0x5d1994[_0x4217ea]=this[_0x4632('0x3a')]['callerid'];this[_0x4632('0x11')][_0x4632('0x53')](_0x5d1994)[_0x4632('0x13')](function(_0x35143e){_0x2e4d57(null,_[_0x4632('0x47')](_0x35143e)?![]:!![]);})['catch'](function(_0x61aa92){logger[_0x4632('0x2c')](_0x61aa92);_0x2e4d57(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x2a2cdb,_0x1375f6){var _0x47391f={'role':_0x4632('0x51')};_0x47391f[_0x2a2cdb]=this['channel']['callerid'];var _0x52e63b=_0x2a2cdb!=_0x4632('0x54')?util['format'](_0x4632('0x55'),_0x4632('0x56'),this[_0x4632('0x3a')][_0x4632('0x3c')]):undefined;this[_0x4632('0x11')][_0x4632('0x57')](_0x47391f,_0x52e63b)[_0x4632('0x13')](function(_0x1785b7){_0x1375f6(null,_[_0x4632('0x47')](_0x1785b7)?![]:!![]);})[_0x4632('0x19')](function(_0x1dbba9){logger[_0x4632('0x2c')](_0x1dbba9);_0x1375f6(null,![]);});};AGIVertices[_0x4632('0xf')][_0x4632('0x58')]=function(_0x461700,_0x1b2905){sh['exec'](_[_0x4632('0x59')](_0x461700),function(_0x7f000,_0x3bc386){var _0x26a3f3=_0x3bc386[_0x4632('0x5a')](/(\r\n|\n|\r)/gm,'');_0x1b2905(null,_0x26a3f3);});};AGIVertices[_0x4632('0xf')][_0x4632('0x5b')]=function(_0x24151e,_0x22b2a2){scripts[_0x4632('0x5b')](_0x24151e[_0x4632('0x5c')],_0x24151e[_0x4632('0x5d')]||_0x4632('0x5e'),_0x24151e['text'],_0x24151e[_0x4632('0x5f')]||_0x4632('0x60'),_0x24151e[_0x4632('0x61')]||_0x4632('0x62'),_0x24151e[_0x4632('0x63')]||_0x4632('0x64'))['then'](function(_0xd78b1f){_0x22b2a2(null,_0xd78b1f);})[_0x4632('0x19')](function(_0x484f28){_0x22b2a2(_0x484f28);});};AGIVertices[_0x4632('0xf')][_0x4632('0x65')]=function(_0x879c8,_0x182b19){scripts[_0x4632('0x65')](_0x879c8['text'],_0x879c8[_0x4632('0x66')]||'en',0x1)[_0x4632('0x13')](function(_0x3def00){_0x182b19(null,_0x3def00);})['catch'](function(_0x1be95b){_0x182b19(_0x1be95b);});};AGIVertices[_0x4632('0xf')][_0x4632('0x67')]=function(_0x1fa035,_0x365341){var _0x3a3f3a={'uri':_0x1fa035[_0x4632('0x68')],'method':_0x1fa035[_0x4632('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1fa035['timeout'])===_0x4632('0x6a')&&parseInt(_0x1fa035[_0x4632('0x6b')])>=0x1?parseInt(_0x1fa035[_0x4632('0x6b')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x4632('0x6c'),_0x4632('0x6d')],_0x3a3f3a['method']['toUpperCase']())){try{_0x3a3f3a[_0x4632('0x6e')]=_0x1fa035[_0x4632('0x6f')]?JSON['parse'](_0x1fa035[_0x4632('0x6f')]):{};}catch(_0x27e95f){logger[_0x4632('0x2c')](_0x4632('0x70'),_0x27e95f);}}try{_0x3a3f3a[_0x4632('0x71')]=_0x1fa035[_0x4632('0xa')]?JSON[_0x4632('0x72')](_0x1fa035[_0x4632('0xa')]):{};}catch(_0x5ae974){logger[_0x4632('0x2c')](_0x4632('0x73'),_0x5ae974);}if(_0x1fa035[_0x4632('0x74')]){try{var _0x16085e=require(_0x1fa035['computedVariables'])[_0x4632('0x75')](this,_0x3a3f3a);_0x3a3f3a[_0x4632('0x76')]=Mustache[_0x4632('0x77')](_0x1fa035[_0x4632('0x68')],_0x16085e,{},['$$','$$']);if(_0x3a3f3a[_0x4632('0x71')]){_0x3a3f3a['headers']=JSON[_0x4632('0x72')](Mustache[_0x4632('0x77')](JSON[_0x4632('0x78')](_0x3a3f3a[_0x4632('0x71')]),_0x16085e,{},['$$','$$']));}if(_0x3a3f3a[_0x4632('0x6e')]){_0x3a3f3a[_0x4632('0x6e')]=JSON[_0x4632('0x72')](Mustache[_0x4632('0x77')](JSON['stringify'](_0x3a3f3a[_0x4632('0x6e')]),_0x16085e,{},['$$','$$']));}}catch(_0x40cc33){logger[_0x4632('0x2c')](_0x4632('0x79'),_0x40cc33);}}rp(_0x3a3f3a)[_0x4632('0x13')](function(_0x3a2560){var _0x4c638c={'statusCode':_0x3a2560[_0x4632('0x7a')]||0xc8,'statusMessage':_0x3a2560[_0x4632('0x7b')]||'OK','headers':_0x3a2560[_0x4632('0x71')]||{},'body':_0x3a2560[_0x4632('0x6e')]||{}};_0x365341(null,_0x4c638c);})[_0x4632('0x19')](function(_0x3ad5f0){var _0x310c9c={'statusCode':_0x3ad5f0['statusCode']||0x1f4,'statusMessage':_0x3ad5f0[_0x4632('0x7c')]||_0x4632('0x7d'),'headers':_0x3ad5f0[_0x4632('0x7e')][_0x4632('0x71')]||{},'body':_0x3ad5f0[_0x4632('0x7e')][_0x4632('0x6e')]||{}};_0x365341(null,_0x310c9c);});};AGIVertices[_0x4632('0xf')]['googleDialogflow']=function(_0x247bf3,_0x5929e9){scripts[_0x4632('0x7f')](this[_0x4632('0x3a')][_0x4632('0x37')],_0x247bf3[_0x4632('0x80')],_0x247bf3[_0x4632('0x5e')],_0x247bf3[_0x4632('0x81')]||'en')[_0x4632('0x13')](function(_0x51cc03){_0x5929e9(null,_0x51cc03);})[_0x4632('0x19')](function(_0x53382d){_0x5929e9(_0x53382d);});};AGIVertices[_0x4632('0xf')][_0x4632('0x82')]=function(_0x256aef,_0x5f28d1){scripts[_0x4632('0x82')](this[_0x4632('0x3a')][_0x4632('0x37')],_0x256aef[_0x4632('0x83')],_0x256aef[_0x4632('0x84')],_0x256aef[_0x4632('0x85')],_0x256aef['text'],_0x256aef['dialogflowV2_language']||'en')[_0x4632('0x13')](function(_0x175bd1){_0x5f28d1(null,_0x175bd1);})[_0x4632('0x19')](function(_0x5ae987){_0x5f28d1(_0x5ae987);});};AGIVertices[_0x4632('0xf')]['sestekNDA']=function(_0x2a7cae,_0x50ad32){scripts[_0x4632('0x86')](this[_0x4632('0x3a')],_0x2a7cae)['then'](function(_0x219a62){_0x50ad32(null,_0x219a62);})[_0x4632('0x19')](function(_0x312040){_0x50ad32(_0x312040);});};AGIVertices['prototype'][_0x4632('0x87')]=function(_0x40b568,_0x21a16e){scripts[_0x4632('0x87')](_0x40b568['key'],_0x40b568[_0x4632('0x5e')],_0x40b568[_0x4632('0x88')]||_0x4632('0x60'),_0x40b568[_0x4632('0x89')])['then'](function(_0x5f3763){_0x21a16e(null,_0x5f3763);})[_0x4632('0x19')](function(_0x986132){_0x21a16e(_0x986132);});};AGIVertices[_0x4632('0xf')][_0x4632('0x8a')]=function(_0x20c150,_0x338b4d,_0x6452c6){scripts['ispeechASR'](_0x338b4d,_0x20c150[_0x4632('0x80')],_0x20c150[_0x4632('0x8b')]||'en-US',this['isConfigured'](_0x20c150[_0x4632('0x8c')])?_0x20c150[_0x4632('0x8c')]:undefined)[_0x4632('0x13')](function(_0x378358){_0x6452c6(null,_0x378358);})[_0x4632('0x19')](function(_0xed21a9){_0x6452c6(_0xed21a9);});};AGIVertices[_0x4632('0xf')][_0x4632('0x8d')]=function(_0x230be9,_0x266bb7){scripts['awsPolly'](_0x230be9[_0x4632('0x8e')],_0x230be9[_0x4632('0x8f')],_0x230be9[_0x4632('0x90')],_0x230be9[_0x4632('0x91')]||_0x4632('0x92'),_0x230be9[_0x4632('0x5e')],_0x230be9[_0x4632('0x93')]||_0x4632('0x5e'))[_0x4632('0x13')](function(_0x5b61b9){_0x266bb7(null,_0x5b61b9);})[_0x4632('0x19')](function(_0x48c416){_0x266bb7(_0x48c416);});};AGIVertices[_0x4632('0xf')]['awsLex']=function(_0x2fd010,_0x4c0790){scripts[_0x4632('0x94')](this[_0x4632('0x3a')][_0x4632('0x37')],_0x2fd010['aws_access_key_id'],_0x2fd010['aws_secret_access_key'],_0x2fd010[_0x4632('0x95')],_0x2fd010[_0x4632('0x5e')],_0x2fd010[_0x4632('0x96')])[_0x4632('0x13')](function(_0x18f7e6){_0x4c0790(null,_0x18f7e6);})[_0x4632('0x19')](function(_0x3c69a2){_0x4c0790(_0x3c69a2);});};AGIVertices[_0x4632('0xf')]['googleASR']=function(_0x379b46,_0x1044d1,_0x326f33){scripts[_0x4632('0x97')](_0x1044d1,_0x379b46[_0x4632('0x80')],_0x379b46[_0x4632('0x98')]||_0x4632('0x60'))[_0x4632('0x13')](function(_0x27e225){_0x326f33(null,_0x27e225);})[_0x4632('0x19')](function(_0x513433){_0x326f33(_0x513433);});};AGIVertices[_0x4632('0xf')][_0x4632('0x99')]=function(_0x35e327,_0x4b5d34,_0x1bce89){scripts[_0x4632('0x99')](_0x4b5d34,_0x35e327[_0x4632('0x9a')],_0x35e327[_0x4632('0x9b')],_0x35e327[_0x4632('0x76')])[_0x4632('0x13')](function(_0x862f58){_0x1bce89(null,_0x862f58);})[_0x4632('0x19')](function(_0x30bc07){_0x1bce89(_0x30bc07);});};AGIVertices[_0x4632('0xf')][_0x4632('0x9c')]=function(_0x484451){var _0x3a86d9=_['includes'](verticesWithRetry,_0x484451[_0x4632('0x39')])?_0x484451:_[_0x4632('0x9d')](_0x484451);for(var _0x501ad6 in _0x3a86d9){if(_0x3a86d9[_0x4632('0x9e')](_0x501ad6)){if(_0x3a86d9[_0x501ad6]&&_[_0x4632('0x9f')](_0x3a86d9[_0x501ad6])){if(_[_0x4632('0xa0')](recursiveMapAttributes,_0x501ad6)){_0x3a86d9[_0x501ad6]=this['replaceObjectAllVariables'](_0x3a86d9[_0x501ad6]);}else{_0x3a86d9[_0x501ad6]=this[_0x4632('0xa1')](_0x3a86d9[_0x501ad6]);}}}}return _0x3a86d9;};AGIVertices[_0x4632('0xf')]['recursiveNodeIndex']=function(_0x5ef08e){for(var _0x27f0d4 in _0x5ef08e){if(_0x5ef08e[_0x4632('0x9e')](_0x27f0d4)){if(_[_0x4632('0xa2')](_0x5ef08e[_0x27f0d4])){this[_0x4632('0xa3')](_0x5ef08e[_0x27f0d4]);}else if(_[_0x4632('0xa4')](_0x5ef08e[_0x27f0d4])){for(var _0x2feec1=0x0;_0x2feec1<_0x5ef08e[_0x27f0d4][_0x4632('0xa5')];_0x2feec1++){this[_0x4632('0xa3')](_0x5ef08e[_0x27f0d4][_0x2feec1]);}}else if(_[_0x4632('0x9f')](_0x5ef08e[_0x27f0d4])){_0x5ef08e[_0x27f0d4]=this[_0x4632('0xa1')](_0x5ef08e[_0x27f0d4]);}}}};AGIVertices[_0x4632('0xf')][_0x4632('0xa6')]=function(_0xe6c862,_0x1ae7ef){for(var _0x52c15b in _0xe6c862){if(_0xe6c862[_0x4632('0x9e')](_0x52c15b)){if(_[_0x4632('0xa2')](_0xe6c862[_0x52c15b])){if(!_[_0x4632('0x46')](_0xe6c862[_0x52c15b])){this['saveRestApiResult'](_0xe6c862[_0x52c15b],util[_0x4632('0x28')](_0x4632('0xa7'),_0x1ae7ef,_0x52c15b));}}else if(_[_0x4632('0xa4')](_0xe6c862[_0x52c15b])){for(var _0x2cb7a6=0x0;_0x2cb7a6<_0xe6c862[_0x52c15b][_0x4632('0xa5')];_0x2cb7a6++){this[_0x4632('0xa6')](_0xe6c862[_0x52c15b][_0x2cb7a6],util[_0x4632('0x28')](_0x4632('0xa7'),_0x1ae7ef,_0x52c15b+'['+_0x2cb7a6+']'));}}else{if(!_[_0x4632('0x47')](_0xe6c862[_0x52c15b])){this['channel'][_0x4632('0xa8')](util[_0x4632('0x28')](_0x4632('0xa7'),_0x1ae7ef,_0x52c15b),_0xe6c862[_0x52c15b]);}}}}};AGIVertices[_0x4632('0xf')][_0x4632('0xa9')]=function(_0x35d8fe){try{var _0x511f67=JSON[_0x4632('0x72')](_0x35d8fe);this[_0x4632('0xa3')](_0x511f67);return JSON[_0x4632('0x78')](_0x511f67);}catch(_0x499e47){return this['replaceAllVariables'](_0x35d8fe);}};AGIVertices['prototype'][_0x4632('0xa1')]=function(_0x52e2eb){var _0x469bb2=_0x52e2eb[_0x4632('0xaa')]('{');for(var _0x3a4e2d=0x1;_0x3a4e2d<_0x469bb2[_0x4632('0xa5')];_0x3a4e2d+=0x1){var _0x33bef2=_0x469bb2[_0x3a4e2d][_0x4632('0xaa')]('}');if(_0x33bef2[_0x4632('0xa5')]>0x1){_0x52e2eb=_0x52e2eb[_0x4632('0xab')]('{'+_0x33bef2[0x0]+'}',this[_0x4632('0x3a')][_0x4632('0x10')](_0x33bef2[0x0])[_0x4632('0xac')]||_0x33bef2[0x0]);}}if(_0x469bb2[_0x4632('0xa5')]===0x1){return _0x52e2eb[_0x4632('0xad')]();}return this[_0x4632('0xa1')](_0x52e2eb);};AGIVertices[_0x4632('0xf')][_0x4632('0xae')]=function(_0x4f12c1,_0x268443){var _0x38f032=this[_0x4632('0x3a')]['getVariable'](_0x4f12c1);if(_0x38f032[_0x4632('0xaf')]===-0x1){return _0x38f032;}logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xb0'),_0x268443,_0x38f032[_0x4632('0xac')]));return this[_0x4632('0x3a')][_0x4632('0xa8')](_0x268443,_0x38f032['extra']);};AGIVertices[_0x4632('0xf')]['isConfigured']=function(_0x525bda){return _0x525bda&&_0x525bda!=='0'&&_0x525bda!=='-1'&&_0x525bda!=='';};AGIVertices['prototype']['maxRetry']=function(_0x546e62){this[_0x4632('0x36')][_0x4632('0x75')](this,_0x546e62,'-');_0x546e62[_0x4632('0xb1')]=_0x546e62[_0x4632('0xb2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4632('0xf')]['mrcpsynth']=function(_0x5ecd21){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xb3'),_0x5ecd21[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x5ecd21[_0x4632('0x5e')])){return this['channel']['noop'](_0x4632('0xb5'));}var _0x1659ac='\x22'+_0x5ecd21[_0x4632('0x5e')]+'\x22';if(this[_0x4632('0xb4')](_0x5ecd21[_0x4632('0x7e')])){_0x1659ac+=','+_0x5ecd21['options'];}var _0x1deecb=this[_0x4632('0x3a')][_0x4632('0xb6')](_0x4632('0xb7'),_0x1659ac);if(_0x1deecb[_0x4632('0xaf')]===-0x1){return _0x1deecb;}return this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1659ac));};AGIVertices['prototype'][_0x4632('0xb9')]=function(_0x4167d1){logger[_0x4632('0x2e')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x4167d1[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x4167d1[_0x4632('0xba')])){return this[_0x4632('0x3a')][_0x4632('0xb8')]('no\x20grammar\x20configured');}var _0x1f0562=_0x4167d1['grammar'];if(this[_0x4632('0xb4')](_0x4167d1['options'])){_0x1f0562+=','+_0x4167d1['options'];}var _0xade7b2=this['channel'][_0x4632('0xb6')](_0x4632('0xbb'),_0x1f0562);if(_0xade7b2[_0x4632('0xaf')]===-0x1){return _0xade7b2;}var _0x5c065b=this[_0x4632('0xae')](_0x4632('0xbc'),'MRCP_RECOG_CONFIDENCE');if(_0x5c065b['result']===-0x1){return _0x5c065b;}var _0x2387cb=this['getAndSetVariable'](_0x4632('0xbd'),_0x4632('0xbe'));if(_0x2387cb[_0x4632('0xaf')]===-0x1){return _0x2387cb;}var _0xf6f06=this['getAndSetVariable']('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0xf6f06['result']===-0x1){return _0xf6f06;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0xbf'),_0x1f0562));};AGIVertices[_0x4632('0xf')][_0x4632('0x6')]=function(_0x3049b2){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xc0'),_0x3049b2['label']));return this[_0x4632('0x3a')]['agi']([_0x3049b2[_0x4632('0xc1')],_0x3049b2[_0x4632('0xc2')]]);};AGIVertices[_0x4632('0xf')][_0x4632('0xc3')]=function(_0x380aad){logger['info'](util[_0x4632('0x28')](_0x4632('0xc4'),_0x380aad['label']));if(this[_0x4632('0xb4')](_0x380aad[_0x4632('0x6b')])){logger['info'](util[_0x4632('0x28')](_0x4632('0xc5'),_0x380aad[_0x4632('0x6b')]));var _0x9f9228=this[_0x4632('0x3a')][_0x4632('0xc6')](_0x380aad[_0x4632('0x6b')]);if(_0x9f9228[_0x4632('0xaf')]===-0x1){return _0x9f9228;}}return this['channel'][_0x4632('0xc3')]();};AGIVertices[_0x4632('0xf')][_0x4632('0x4d')]=function(_0x380807){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xc7'),_0x380807['label']));if(!this[_0x4632('0xb4')](_0x380807[_0x4632('0xc8')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x380807,_0x4632('0xc9'));}_0x380807['scheduledAt']=moment();if(this['isConfigured'](_0x380807['delay'])){_0x380807[_0x4632('0x4c')]=moment()[_0x4632('0xca')](_0x380807[_0x4632('0xcb')],_0x4632('0xcc'));}if(!this[_0x4632('0xb4')](_0x380807[_0x4632('0x4f')])){_0x380807['callback_priority']=0x2;}this['createCmContact'][_0x4632('0x75')](this,_0x380807);return this['channel']['noop'](util[_0x4632('0x28')](_0x4632('0xcd'),_0x380807[_0x4632('0x4b')],_0x380807[_0x4632('0xc8')],_0x380807[_0x4632('0x4c')]));};AGIVertices[_0x4632('0xf')][_0x4632('0xce')]=function(_0x1f729b){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xcf'),_0x1f729b[_0x4632('0x38')]));var _0x29e578=this[_0x4632('0x3a')][_0x4632('0xb6')](_0x1f729b[_0x4632('0xd0')],_0x1f729b[_0x4632('0x7e')]);if(_0x29e578[_0x4632('0xaf')]===-0x1){return _0x29e578;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0xd1'),_0x1f729b[_0x4632('0xd0')],_0x1f729b['options']));};AGIVertices[_0x4632('0xf')]['lumenvoxtts']=function(_0x598597){logger[_0x4632('0x2e')](util[_0x4632('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x598597[_0x4632('0x38')]));if(!this['isConfigured'](_0x598597['text'])){return this[_0x4632('0x3a')]['noop']('no\x20text\x20configured');}var _0x26685d='\x22'+_0x598597[_0x4632('0x5e')]+'\x22';if(this[_0x4632('0xb4')](_0x598597[_0x4632('0x7e')])){_0x26685d+=','+_0x598597[_0x4632('0x7e')];}var _0x1ffaaf=this['channel'][_0x4632('0xb6')](_0x4632('0xb7'),_0x26685d);if(_0x1ffaaf[_0x4632('0xaf')]===-0x1){return _0x1ffaaf;}return this['channel'][_0x4632('0xb8')](util['format'](_0x4632('0xd2'),_0x26685d));};AGIVertices['prototype']['sestektts']=function(_0xfbbea8){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xd3'),_0xfbbea8[_0x4632('0x38')]));if(!this['isConfigured'](_0xfbbea8[_0x4632('0x5e')])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0xb5'));}var _0x113b23='\x22'+_0xfbbea8[_0x4632('0x5e')]+'\x22';if(this[_0x4632('0xb4')](_0xfbbea8[_0x4632('0x7e')])){_0x113b23+=','+_0xfbbea8['options'];}var _0x267a21=this[_0x4632('0x3a')][_0x4632('0xb6')]('MRCPSynth',_0x113b23);if(_0x267a21[_0x4632('0xaf')]===-0x1){return _0x267a21;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0xd2'),_0x113b23));};AGIVertices[_0x4632('0xf')][_0x4632('0xd4')]=function(_0x5ae42c){logger[_0x4632('0x2e')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x5ae42c[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x5ae42c[_0x4632('0xba')])){return this[_0x4632('0x3a')][_0x4632('0xb8')]('no\x20grammar\x20configured');}var _0x58a05a=_0x5ae42c['grammar'];if(this[_0x4632('0xb4')](_0x5ae42c['options'])){_0x58a05a+=','+_0x5ae42c['options'];}var _0x26bb63=this[_0x4632('0x3a')][_0x4632('0xb6')](_0x4632('0xbb'),_0x58a05a);if(_0x26bb63[_0x4632('0xaf')]===-0x1){return _0x26bb63;}var _0x39be02=this[_0x4632('0xae')]('RECOG_CONFIDENCE()',_0x4632('0xd5'));if(_0x39be02[_0x4632('0xaf')]===-0x1){return _0x39be02;}var _0x4d6517=this['getAndSetVariable'](_0x4632('0xbd'),_0x4632('0xd6'));if(_0x4d6517[_0x4632('0xaf')]===-0x1){return _0x4d6517;}var _0x11af02=this[_0x4632('0xae')](_0x4632('0xd7'),_0x4632('0xd8'));if(_0x11af02[_0x4632('0xaf')]===-0x1){return _0x11af02;}return this['channel']['noop'](util[_0x4632('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x58a05a));};AGIVertices[_0x4632('0xf')][_0x4632('0xd9')]=function(_0xbc5806){logger[_0x4632('0x2e')](util['format'](_0x4632('0xda'),_0xbc5806[_0x4632('0x38')]));if(!this['isConfigured'](_0xbc5806[_0x4632('0xba')])){return this['channel'][_0x4632('0xb8')](_0x4632('0xdb'));}var _0x42559=_0xbc5806[_0x4632('0xba')];if(this[_0x4632('0xb4')](_0xbc5806[_0x4632('0x7e')])){_0x42559+=','+_0xbc5806[_0x4632('0x7e')];}var _0xe8c1f6=this[_0x4632('0x3a')][_0x4632('0xb6')](_0x4632('0xbb'),_0x42559);if(_0xe8c1f6[_0x4632('0xaf')]===-0x1){return _0xe8c1f6;}var _0xf7220c=this[_0x4632('0xae')](_0x4632('0xbc'),_0x4632('0xdc'));if(_0xf7220c[_0x4632('0xaf')]===-0x1){return _0xf7220c;}var _0x4cacba=this[_0x4632('0xae')](_0x4632('0xbd'),_0x4632('0xdd'));if(_0x4cacba[_0x4632('0xaf')]===-0x1){return _0x4cacba;}var _0x3dc8a7=this[_0x4632('0xae')](_0x4632('0xd7'),'SESTEK_ASR_INSTANCE');if(_0x3dc8a7[_0x4632('0xaf')]===-0x1){return _0x3dc8a7;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0xbf'),_0x42559));};AGIVertices[_0x4632('0xf')][_0x4632('0xde')]=function(_0x152698){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xdf'),_0x152698[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x152698['odbc_id'])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x152698,_0x4632('0xe0'));}var _0x284690=this[_0x4632('0xe1')][_0x4632('0x75')](this,_0x152698[_0x4632('0xe2')]);if(!_0x284690){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x152698,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x152698[_0x4632('0x2d')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x152698,_0x4632('0xe3'));}var _0x256f7a=_0x152698[_0x4632('0x2d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0xe4'),_0x256f7a));var _0x63821c=this['getQueryOdbc']['sync'](this,_0x284690,_0x256f7a);this[_0x4632('0x36')][_0x4632('0x75')](this,_0x152698,_0x256f7a);if(!this['isConfigured'](_0x152698['variable_id'])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0xe5'));}var _0x411022=this[_0x4632('0x10')][_0x4632('0x75')](this,_0x152698[_0x4632('0xe6')]);if(!_0x411022){return this['channel'][_0x4632('0x2c')](_0x152698,_0x4632('0xe7'));}var _0x25a2c7=this;_0x63821c[_0x4632('0xe8')](function(_0x46110a,_0x5871c8){Object['keys'](_0x46110a)[_0x4632('0xe8')](function(_0x5846e0){_0x25a2c7[_0x4632('0x3a')][_0x4632('0xa8')](util[_0x4632('0x28')](_0x4632('0xe9'),_0x411022,_0x5871c8,_0x5846e0),_0x46110a[_0x5846e0]);});});this[_0x4632('0x3a')][_0x4632('0xa8')](util[_0x4632('0x28')](_0x4632('0xea'),_0x411022),_0x63821c[_0x4632('0xa5')]);return this['channel']['noop'](util['format'](_0x4632('0xeb'),_0x411022));};AGIVertices[_0x4632('0xf')][_0x4632('0xec')]=function(_0x49885c){logger[_0x4632('0xed')](util[_0x4632('0x28')](_0x4632('0xee'),_0x49885c[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x49885c['sip_id'])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x49885c,_0x4632('0xef'));}var _0x350691=this[_0x4632('0x1c')][_0x4632('0x75')](this,_0x49885c[_0x4632('0xf0')]);if(!_0x350691){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x49885c,_0x4632('0xf1'));}var _0x4974d7=this[_0x4632('0x3a')][_0x4632('0xb6')](_0x4632('0xf2'),[util[_0x4632('0x28')](_0x4632('0xf3'),_0x350691),_0x49885c[_0x4632('0x6b')],_0x49885c[_0x4632('0xf4')],_0x49885c[_0x4632('0x68')]]);if(_0x4974d7[_0x4632('0xaf')]===-0x1){return _0x4974d7;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0xf5'),_0x4632('0xf2')));};AGIVertices['prototype'][_0x4632('0xf6')]=function(_0x3c8c4){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xf7'),_0x3c8c4[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x3c8c4[_0x4632('0x80')])){return this[_0x4632('0x3a')]['noop']('no\x20key\x20configured');}if(!this[_0x4632('0xb4')](_0x3c8c4['text'])){return this[_0x4632('0x3a')]['noop'](_0x4632('0xb5'));}this[_0x4632('0x3a')][_0x4632('0xf8')]=!![];this[_0x4632('0x36')](_0x3c8c4);this['createSquareMessage'](_0x3c8c4[_0x4632('0x5e')],'in','','');this[_0x4632('0x3a')]['noop'](util['format'](_0x4632('0xf9'),_0x3c8c4[_0x4632('0x5e')]));var _0x1a5d60=this['googleDialogflow']['sync'](this,_0x3c8c4);if(_0x1a5d60){for(var _0x3d68bf in _0x1a5d60){if(_0x1a5d60['hasOwnProperty'](_0x3d68bf)){this[_0x4632('0x3a')][_0x4632('0xa8')](util['format']('DIALOGFLOW_%s',_0x3d68bf[_0x4632('0xfa')]()),_0x1a5d60[_0x3d68bf]);}}this[_0x4632('0x44')](_0x1a5d60[_0x4632('0xfb')],'out',_0x4632('0xf6'),'');return this['channel']['noop'](util[_0x4632('0x28')](_0x4632('0xfc'),_0x1a5d60[_0x4632('0xfb')]));}return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x3c8c4,_0x4632('0xfd'));};AGIVertices[_0x4632('0xf')][_0x4632('0xfe')]=function(_0x270df9){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0xff'),_0x270df9[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x270df9['dialogflowV2_project_id'])){return this[_0x4632('0x3a')][_0x4632('0xb8')]('no\x20project_id\x20configured');}if(!this[_0x4632('0xb4')](_0x270df9[_0x4632('0x84')])){return this[_0x4632('0x3a')][_0x4632('0xb8')]('no\x20client_email\x20configured');}if(!this[_0x4632('0xb4')](_0x270df9['private_key'])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x100'));}if(!this[_0x4632('0xb4')](_0x270df9[_0x4632('0x101')])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x102'));}if(!this[_0x4632('0xb4')](_0x270df9['text'])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0xb5'));}this[_0x4632('0x3a')]['bot']=!![];this[_0x4632('0x36')](_0x270df9);this[_0x4632('0x44')](_0x270df9[_0x4632('0x5e')],'in','','');this[_0x4632('0x3a')]['noop'](util['format'](_0x4632('0x103'),_0x270df9[_0x4632('0x5e')]));var _0x41855f=this['googleDialogflowV2'][_0x4632('0x75')](this,_0x270df9);if(_0x41855f){for(var _0x4e45c7 in _0x41855f){if(_0x41855f[_0x4632('0x9e')](_0x4e45c7)){if(_0x4e45c7!==_0x4632('0x104')){this[_0x4632('0x3a')][_0x4632('0xa8')](util[_0x4632('0x28')](_0x4632('0x105'),_0x4e45c7['toUpperCase']()),_0x41855f[_0x4e45c7]);}}}this[_0x4632('0x44')](_0x41855f[_0x4632('0xfb')],'out',_0x4632('0xfe'),_0x41855f[_0x4632('0x104')]);return this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0x106'),_0x41855f[_0x4632('0xfb')]));}return this[_0x4632('0x3a')]['error'](_0x270df9,_0x4632('0x107'));};AGIVertices[_0x4632('0xf')][_0x4632('0x108')]=function(_0x3320f3){logger['info'](util[_0x4632('0x28')](_0x4632('0x109'),_0x3320f3['label']));if(!this[_0x4632('0xb4')](_0x3320f3[_0x4632('0x10a')])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x10b'));}if(!this['isConfigured'](_0x3320f3[_0x4632('0x10c')])){return this['channel'][_0x4632('0xb8')]('no\x20username\x20configured');}if(!this[_0x4632('0xb4')](_0x3320f3[_0x4632('0x10d')])){return this['channel'][_0x4632('0xb8')](_0x4632('0x10e'));}if(!this[_0x4632('0xb4')](_0x3320f3[_0x4632('0x10f')])){return this[_0x4632('0x3a')]['noop'](_0x4632('0xb5'));}this['channel'][_0x4632('0xf8')]=!![];this[_0x4632('0x36')](_0x3320f3);this[_0x4632('0x44')](_0x3320f3[_0x4632('0x5e')],'in','','');this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0x110'),_0x3320f3[_0x4632('0x5e')]));var _0x3db9fd=this[_0x4632('0x86')]['sync'](this,_0x3320f3);if(_0x3db9fd){for(var _0x11e04f in _0x3db9fd){if(_0x3db9fd[_0x4632('0x9e')](_0x11e04f)){this[_0x4632('0x3a')][_0x4632('0xa8')](util['format'](_0x4632('0x111'),_0x11e04f[_0x4632('0xfa')]()),_0x3db9fd[_0x11e04f]);}}this[_0x4632('0x44')](_0x3db9fd[_0x4632('0xfb')],_0x4632('0x112'),'sesteknda','');if(_0x3db9fd[_0x4632('0x113')]){this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0x114'),_0x3db9fd[_0x4632('0x113')]));var _0x210a17=this[_0x4632('0x3a')][_0x4632('0x115')](_0x3db9fd[_0x4632('0x113')]);try{fs['unlink'](_0x3db9fd[_0x4632('0x113')]+_0x4632('0x116'));}catch(_0x18e6a3){logger[_0x4632('0x2c')](_0x18e6a3);}return _0x210a17;}else{return this[_0x4632('0x3a')]['noop'](util['format'](_0x4632('0x117'),_0x3db9fd['speech']));}}return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x3320f3,_0x4632('0x118'));};AGIVertices[_0x4632('0xf')][_0x4632('0x119')]=function(_0x424bfe){logger['info'](util['format'](_0x4632('0x11a'),_0x424bfe[_0x4632('0x38')]));return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x119'));};AGIVertices[_0x4632('0xf')][_0x4632('0x11b')]=function(_0x23613f){logger[_0x4632('0x2e')](util['format'](_0x4632('0x11c'),_0x23613f['label']));var _0x572f43='';if(_0x23613f[_0x4632('0x11d')]){if(!this['isConfigured'](_0x23613f[_0x4632('0x11d')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x23613f,_0x4632('0x11e'));}else{var _0x512773=parseInt(_0x23613f['trunk_id'],0xa);if(isNaN(_0x512773)){_0x572f43=_0x23613f['trunk_id'];}else{_0x572f43=this[_0x4632('0x1e')][_0x4632('0x75')](this,_0x23613f[_0x4632('0x11d')]);if(!_0x572f43){return this['channel'][_0x4632('0x2c')](_0x23613f,_0x4632('0x11f'));}}}}else if(_0x23613f['trunk_name']){_0x572f43=_0x23613f[_0x4632('0x120')];}else{return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x23613f,_0x4632('0x11e'));}var _0x2675c6=this[_0x4632('0x3a')]['exec'](_0x4632('0xf2'),[util[_0x4632('0x28')](_0x4632('0x121'),_0x572f43,_0x23613f[_0x4632('0x4b')]),_0x23613f[_0x4632('0x6b')],_0x23613f['opts'],_0x23613f[_0x4632('0x68')]]);if(_0x2675c6[_0x4632('0xaf')]===-0x1){return _0x2675c6;}return this[_0x4632('0x3a')]['noop'](util[_0x4632('0x28')](_0x4632('0xf5'),_0x4632('0xf2')));};AGIVertices['prototype'][_0x4632('0x122')]=function(_0x50ada8){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x123'),_0x50ada8['label']));return this[_0x4632('0x3a')][_0x4632('0xb8')]('finally');};AGIVertices[_0x4632('0xf')][_0x4632('0xc')]=function(_0x221469){logger[_0x4632('0x2e')](util[_0x4632('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x221469[_0x4632('0x38')]));if(_0x221469[_0x4632('0xb1')]===0x0){return this['maxRetry'](_0x221469);}_0x221469['retry']-=0x1;if(!this[_0x4632('0xb4')](_0x221469['file_id'])){return this['channel']['error'](_0x221469,_0x4632('0x124'));}var _0x2f8101=this[_0x4632('0x20')]['sync'](this,_0x221469['file_id']);if(!_0x2f8101){return this[_0x4632('0x3a')]['error'](_0x221469,_0x4632('0x125'));}if(!this[_0x4632('0xb4')](_0x221469[_0x4632('0xe6')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x4632('0xe5'));}var _0x5a1f40=this[_0x4632('0x3a')][_0x4632('0x126')](_0x2f8101,_0x221469[_0x4632('0x127')],_0x221469[_0x4632('0x128')]);var _0x98ebc=_0x5a1f40[_0x4632('0xaf')]?_0x5a1f40['result']['toString']():'';logger[_0x4632('0x2e')]('test',JSON[_0x4632('0x78')](_0x5a1f40));if(_0x5a1f40['result']===-0x1){this[_0x4632('0x36')][_0x4632('0x75')](this,_0x221469,_0x98ebc);return _0x5a1f40;}else if(_0x5a1f40['extra']==='timeout'){_0x5a1f40[_0x4632('0xaf')]=_0x98ebc[_0x4632('0xa5')]>=parseInt(_0x221469[_0x4632('0x129')])?'x':'i';}else{_0x5a1f40[_0x4632('0xaf')]=_0x98ebc[_0x4632('0xa5')]>=parseInt(_0x221469[_0x4632('0x129')])&&_0x98ebc[_0x4632('0xa5')]<=parseInt(_0x221469[_0x4632('0x128')])?'x':'i';}var _0x5046dd=this[_0x4632('0x10')][_0x4632('0x75')](this,_0x221469['variable_id']);if(!_0x5046dd){return this[_0x4632('0x3a')]['error'](_0x221469,_0x4632('0xe7'));}this[_0x4632('0x3a')]['setVariable'](_0x5046dd,_0x98ebc);if(this['isConfigured'](_0x221469['hiddendigitsnum'])){var _0x4c0641=parseInt(_0x221469['hiddendigitsnum'],0xa);var _0x3c63c9=rs[_0x4632('0x12a')]({'charset':'*','length':_0x4c0641});var _0x2e58f0=_0x98ebc[_0x4632('0xa5')];if(_0x2e58f0>0x0){if(_0x2e58f0>_0x4c0641){this[_0x4632('0x36')]['sync'](this,_0x221469,_0x221469[_0x4632('0x12b')]===_0x4632('0x12c')?_0x3c63c9+_0x98ebc['substr'](_0x4c0641):_0x98ebc[_0x4632('0x12d')](0x0,_0x2e58f0-_0x4c0641)+_0x3c63c9);}else{this['createSquareDetailsReport'][_0x4632('0x75')](this,_0x221469,rs[_0x4632('0x12a')]({'charset':'*','length':_0x2e58f0}));}}else{this[_0x4632('0x36')][_0x4632('0x75')](this,_0x221469,'');}}else{this[_0x4632('0x36')][_0x4632('0x75')](this,_0x221469,_0x98ebc);}return _0x5a1f40;};AGIVertices[_0x4632('0xf')][_0x4632('0xd')]=function(_0x242318){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x12e'),_0x242318[_0x4632('0x38')]));return this[_0x4632('0xc')](_0x242318);};AGIVertices[_0x4632('0xf')]['goal']=function(_0xc494d4){logger['info'](util[_0x4632('0x28')](_0x4632('0x12f'),_0xc494d4[_0x4632('0x38')]));this[_0x4632('0x36')][_0x4632('0x75')](this,_0xc494d4,_0xc494d4['goalname']);return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x130'),_0xc494d4[_0x4632('0x131')]));};AGIVertices[_0x4632('0xf')]['awspolly']=function(_0x1c5bea){logger[_0x4632('0x2e')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1c5bea[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x1c5bea['aws_access_key_id'])||!this[_0x4632('0xb4')](_0x1c5bea[_0x4632('0x8f')])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x132'));}if(!this['isConfigured'](_0x1c5bea[_0x4632('0x5e')])){return this[_0x4632('0x3a')]['noop'](_0x4632('0xb5'));}this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')]('Trying\x20aws\x20Polly\x20%s',_0x1c5bea[_0x4632('0x5e')]));var _0x3536c0=this['awsPolly'][_0x4632('0x75')](this,_0x1c5bea);if(_0x3536c0){this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x133'),_0x3536c0));var _0x49a15b=this[_0x4632('0x3a')][_0x4632('0x115')](_0x3536c0);try{fs[_0x4632('0x134')](_0x3536c0+_0x4632('0x116'));}catch(_0x14da85){logger['error'](_0x14da85);}return _0x49a15b;}return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x1c5bea,_0x4632('0x135'));};AGIVertices[_0x4632('0xf')]['awslex']=function(_0x1c1102){logger[_0x4632('0x2e')](util['format'](_0x4632('0x136'),_0x1c1102[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x1c1102[_0x4632('0x8e')])||!this[_0x4632('0xb4')](_0x1c1102[_0x4632('0x8f')])){return this['channel'][_0x4632('0xb8')](_0x4632('0x132'));}if(!this[_0x4632('0xb4')](_0x1c1102[_0x4632('0x96')])){return this['channel'][_0x4632('0xb8')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x1c1102['text'])){return this[_0x4632('0x3a')][_0x4632('0xb8')]('no\x20text\x20configured');}this[_0x4632('0x3a')][_0x4632('0xf8')]=!![];this[_0x4632('0x36')](_0x1c1102);this['createSquareMessage'](_0x1c1102['text'],'in','','');this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x1c1102[_0x4632('0x5e')]));var _0x3986c4=this[_0x4632('0x94')]['sync'](this,_0x1c1102);if(_0x3986c4){for(var _0x12f128 in _0x3986c4){if(_0x3986c4['hasOwnProperty'](_0x12f128)&&_[_0x4632('0x9f')](_0x3986c4[_0x12f128])){this[_0x4632('0x3a')][_0x4632('0xa8')](util[_0x4632('0x28')](_0x4632('0x137'),_0x12f128[_0x4632('0xfa')]()),_0x3986c4[_0x12f128]);}}if(_[_0x4632('0x47')](_0x3986c4['message'])){return this[_0x4632('0x3a')][_0x4632('0xb8')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x3986c4[_0x4632('0x7c')],_0x4632('0x112'),_0x4632('0x138'),'');return this[_0x4632('0x3a')]['noop'](util[_0x4632('0x28')](_0x4632('0x139'),_0x3986c4[_0x4632('0x7c')]));}}return this[_0x4632('0x3a')]['error'](_0x1c1102,_0x4632('0x13a'));};AGIVertices[_0x4632('0xf')][_0x4632('0x13b')]=function(_0x6efb19){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x13c'),_0x6efb19[_0x4632('0x38')],_0x6efb19[_0x4632('0x6b')]));if(!this['isConfigured'](_0x6efb19[_0x4632('0x80')])){return this['channel'][_0x4632('0xb8')]('no\x20key\x20configured');}var _0x4675b6=_0x4632('0x13d');var _0x1a384d=util['format'](_0x4632('0x13e'),FILES_PATH,rs['generate'](0x4));var _0x31c5c7=util['format'](_0x4632('0xa7'),_0x1a384d,_0x4675b6);var _0x2bde25=!![];if(_0x6efb19[_0x4632('0x13f')]===_0x4632('0x140')){_0x2bde25=![];}var _0x9c76b8=this['channel'][_0x4632('0x141')](_0x1a384d,_0x4675b6,_0x6efb19['intKey'],_0x6efb19['timeout'],undefined,_0x2bde25);if(_0x9c76b8[_0x4632('0xaf')]!==-0x1){this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x142'),_0x31c5c7));var _0x2011f0=this[_0x4632('0x97')][_0x4632('0x75')](this,_0x6efb19,_0x31c5c7);if(_0x2011f0){for(var _0x530f2b in _0x2011f0){if(_0x2011f0[_0x4632('0x9e')](_0x530f2b)){this['channel'][_0x4632('0xa8')](util[_0x4632('0x28')]('GOOGLE_ASR_%s',_0x530f2b['toUpperCase']()),_0x2011f0[_0x530f2b]);}}return this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x143'),JSON[_0x4632('0x78')](_0x2011f0)));}}return _0x9c76b8;};AGIVertices[_0x4632('0xf')][_0x4632('0x144')]=function(_0x4bfa7d){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x145'),_0x4bfa7d[_0x4632('0x38')]));if(!this['isConfigured'](_0x4bfa7d['appid'])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x146'));}if(!this['isConfigured'](_0x4bfa7d[_0x4632('0x9b')])){return this[_0x4632('0x3a')][_0x4632('0xb8')]('no\x20appsecret\x20configured');}var _0x1c4fdf=_0x4632('0x13d');var _0x5bcb18=util[_0x4632('0x28')](_0x4632('0x13e'),FILES_PATH,rs['generate'](0x4));var _0x25edc6=util[_0x4632('0x28')](_0x4632('0xa7'),_0x5bcb18,_0x1c4fdf);var _0x264624=!![];if(_0x4bfa7d[_0x4632('0x13f')]===_0x4632('0x140')){_0x264624=![];}var _0x29a641=this[_0x4632('0x3a')][_0x4632('0x141')](_0x5bcb18,_0x1c4fdf,_0x4bfa7d['intKey'],_0x4bfa7d[_0x4632('0x6b')],undefined,_0x264624);if(_0x29a641['result']!==-0x1){this[_0x4632('0x3a')]['noop'](util[_0x4632('0x28')](_0x4632('0x147'),_0x25edc6));var _0x4b3db0=this[_0x4632('0x99')]['sync'](this,_0x4bfa7d,_0x25edc6);if(_0x4b3db0){for(var _0x190e65 in _0x4b3db0){if(_0x4b3db0[_0x4632('0x9e')](_0x190e65)){this['channel']['setVariable'](util['format']('TILDE_ASR_%s',_0x190e65[_0x4632('0xfa')]()),_0x4b3db0[_0x190e65]);}}return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')]('TildeASR\x20Result\x20%s',JSON[_0x4632('0x78')](_0x4b3db0)));}}return _0x29a641;};AGIVertices[_0x4632('0xf')][_0x4632('0x148')]=function(_0x2bafc8){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x149'),_0x2bafc8[_0x4632('0x38')]));return this[_0x4632('0x3a')][_0x4632('0x14a')](_0x2bafc8[_0x4632('0x3f')],_0x2bafc8[_0x4632('0x40')],_0x2bafc8['priority']);};AGIVertices['prototype']['gotoif']=function(_0x200ac7){logger['info'](util['format'](_0x4632('0x14b'),_0x200ac7[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x200ac7['condition'])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x200ac7,_0x4632('0x14c'));}try{var _0x1ccac1=eval(_0x200ac7[_0x4632('0x14d')])?'true':_0x4632('0x14e');this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x14f'),_0x200ac7[_0x4632('0x14d')],_0x1ccac1));return{'code':0xc8,'result':_0x1ccac1};}catch(_0x391ea9){return{'code':0xc8,'result':_0x4632('0x14e')};}};AGIVertices[_0x4632('0xf')][_0x4632('0x150')]=function(_0xca28e1){logger[_0x4632('0x2e')](util[_0x4632('0x28')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0xca28e1[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0xca28e1[_0x4632('0x151')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0xca28e1,_0x4632('0x152'));}var _0x533eac=this['getIntervals'][_0x4632('0x75')](this,_0xca28e1['interval_id']);if(!_0x533eac){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0xca28e1,_0x4632('0x153'));}for(var _0x3eae8a=0x0;_0x3eae8a<_0x533eac[_0x4632('0xa5')];_0x3eae8a+=0x1){var _0x991954=this['channel'][_0x4632('0x10')](util[_0x4632('0x28')]('IFTIME(%s?true:false)',_0x533eac[_0x3eae8a]));if(_0x991954[_0x4632('0xaf')]===-0x1){return _0x991954;}logger['info'](util[_0x4632('0x28')](_0x4632('0x154'),_0x533eac[_0x3eae8a],_0x991954[_0x4632('0xac')]));if(_0x991954['extra']===_0x4632('0x155')){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x154'),_0x533eac[_0x3eae8a],_0x4632('0x155')));this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0x154'),_0x533eac[_0x3eae8a],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x4632('0x28')]('IFTIME\x20%s\x20%s',_0x533eac[_0x3eae8a],_0x4632('0x14e')));this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x154'),_0x533eac[_0x3eae8a],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x4632('0xf')][_0x4632('0x156')]=function(_0x3640b5){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x157'),_0x3640b5[_0x4632('0x38')]));return this['channel'][_0x4632('0x156')]();};AGIVertices[_0x4632('0xf')][_0x4632('0x158')]=function(_0x4168b7){logger[_0x4632('0x2e')](util['format'](_0x4632('0x159'),_0x4168b7[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x4168b7[_0x4632('0x80')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x4d8916=_0x4632('0x13d');var _0x4b4abc=util[_0x4632('0x28')](_0x4632('0x13e'),FILES_PATH,rs[_0x4632('0x12a')](0x4));var _0x565b91=util[_0x4632('0x28')](_0x4632('0xa7'),_0x4b4abc,_0x4d8916);var _0xe0277d=!![];if(_0x4168b7['beep']===_0x4632('0x140')){_0xe0277d=![];}var _0x53846d=this[_0x4632('0x3a')][_0x4632('0x141')](_0x4b4abc,_0x4d8916,_0x4168b7[_0x4632('0x15a')],_0x4168b7[_0x4632('0x6b')],undefined,_0xe0277d);if(_0x53846d['result']!==-0x1){this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x15b'),_0x565b91));var _0x50e09c=this['ispeechASR'][_0x4632('0x75')](this,_0x4168b7,_0x565b91);if(_0x50e09c){for(var _0x1b8b94 in _0x50e09c){if(_0x50e09c[_0x4632('0x9e')](_0x1b8b94)){this['channel']['setVariable'](util[_0x4632('0x28')](_0x4632('0x15c'),_0x1b8b94[_0x4632('0xfa')]()),_0x50e09c[_0x1b8b94]);}}return this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x15d'),JSON[_0x4632('0x78')](_0x50e09c)));}}return _0x53846d;};AGIVertices[_0x4632('0xf')][_0x4632('0x15e')]=function(_0x56cf75){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x15f'),_0x56cf75[_0x4632('0x38')]));if(!this['isConfigured'](_0x56cf75[_0x4632('0x80')])){return this[_0x4632('0x3a')][_0x4632('0xb8')]('no\x20key\x20configured');}if(!this[_0x4632('0xb4')](_0x56cf75[_0x4632('0x5e')])){return this['channel'][_0x4632('0xb8')]('no\x20text\x20configured');}this[_0x4632('0x3a')]['noop'](util['format'](_0x4632('0x160'),_0x56cf75[_0x4632('0x5e')]));var _0x559608=this[_0x4632('0x87')][_0x4632('0x75')](this,_0x56cf75);if(_0x559608){this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')]('ispeech\x20%s\x20file\x20created',_0x559608));var _0x2bbc82=this[_0x4632('0x3a')]['streamFile'](_0x559608,_0x56cf75[_0x4632('0x15a')]);try{fs[_0x4632('0x134')](_0x559608+_0x4632('0x116'));}catch(_0x1cc4ef){logger[_0x4632('0x2c')](_0x1cc4ef);}return _0x2bbc82;}return this['channel']['error'](_0x56cf75,_0x4632('0x161'));};AGIVertices[_0x4632('0xf')][_0x4632('0x162')]=function(_0x3d603f){logger[_0x4632('0x2e')](util[_0x4632('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3d603f['label']));if(!this[_0x4632('0xb4')](_0x3d603f[_0x4632('0x163')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x3d603f,_0x4632('0x164'));}logger['info'](util[_0x4632('0x28')](_0x4632('0x165'),this['channel']['callerid'],_0x3d603f['findBy']));var _0x8b5637=this[_0x4632('0x57')]['sync'](this,_0x3d603f[_0x4632('0x163')]);if(_0x8b5637){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x166'),this[_0x4632('0x3a')][_0x4632('0x3c')],_0x3d603f[_0x4632('0x163')]));this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x166'),this['channel']['callerid'],_0x3d603f[_0x4632('0x163')]));return{'code':0xc8,'result':_0x4632('0x167')};}else{logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x168'),this['channel']['callerid'],_0x3d603f[_0x4632('0x163')]));this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x4632('0x3c')],_0x3d603f[_0x4632('0x163')]));return{'code':0xc8,'result':_0x4632('0x169')};}};AGIVertices['prototype'][_0x4632('0x16a')]=function(_0x442060){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x16b'),_0x442060[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x442060[_0x4632('0x163')])){return this['channel'][_0x4632('0x2c')](_0x442060,'no\x20find\x20by\x20configured');}logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x165'),this['channel'][_0x4632('0x3c')],_0x442060['findBy']));var _0x4baa34=this[_0x4632('0x53')][_0x4632('0x75')](this,_0x442060[_0x4632('0x163')]);if(_0x4baa34){logger[_0x4632('0x2e')](util[_0x4632('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4632('0x3a')][_0x4632('0x3c')],_0x442060[_0x4632('0x163')]));this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x166'),this[_0x4632('0x3a')][_0x4632('0x3c')],_0x442060['findBy']));return{'code':0xc8,'result':_0x4632('0x167')};}else{logger[_0x4632('0x2e')](util[_0x4632('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4632('0x3a')][_0x4632('0x3c')],_0x442060[_0x4632('0x163')]));this[_0x4632('0x3a')]['noop'](util[_0x4632('0x28')](_0x4632('0x168'),this[_0x4632('0x3a')]['callerid'],_0x442060['findBy']));return{'code':0xc8,'result':_0x4632('0x169')};}};AGIVertices['prototype']['math']=function(_0x434d18){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x16c'),_0x434d18[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x434d18[_0x4632('0x16d')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x434d18,_0x4632('0x16e'));}this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x16f'),_0x434d18[_0x4632('0x16d')]));var _0x541edc=eval(_0x434d18[_0x4632('0x16d')]);if(!this[_0x4632('0xb4')](_0x434d18[_0x4632('0xe6')])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0xe5'));}var _0x338e36=this['getVariable'][_0x4632('0x75')](this,_0x434d18[_0x4632('0xe6')]);if(!_0x338e36){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x434d18,_0x4632('0xe7'));}if(_['isArray'](_0x541edc)){var _0x2e413b=this;_0x541edc[_0x4632('0xe8')](function(_0x593b65,_0x521ef1){_0x2e413b[_0x4632('0x3a')][_0x4632('0xa8')](util[_0x4632('0x28')](_0x4632('0x170'),_0x338e36,_0x521ef1),_0x593b65);});return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x171'),_0x338e36));}else{return this[_0x4632('0x3a')]['setVariable'](_0x338e36,_0x541edc);}};AGIVertices[_0x4632('0xf')][_0x4632('0xb')]=function(_0x4e2ca0){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x172'),_0x4e2ca0[_0x4632('0x38')]));if(_0x4e2ca0[_0x4632('0xb1')]===0x0){return this[_0x4632('0xb2')](_0x4e2ca0);}_0x4e2ca0[_0x4632('0xb1')]-=0x1;if(!this[_0x4632('0xb4')](_0x4e2ca0['file_id'])){return this[_0x4632('0x3a')]['error'](_0x4e2ca0,_0x4632('0x124'));}var _0x3006c6=this[_0x4632('0x20')][_0x4632('0x75')](this,_0x4e2ca0[_0x4632('0x173')]);if(!_0x3006c6){return this[_0x4632('0x3a')]['error'](_0x4e2ca0,_0x4632('0x125'));}var _0x112d64=this[_0x4632('0x3a')][_0x4632('0x126')](_0x3006c6,_0x4e2ca0['response'],_0x4e2ca0['digit']);var _0x3e8d53=_0x112d64[_0x4632('0xaf')];if(_0x112d64[_0x4632('0xaf')]===-0x1){this[_0x4632('0x36')][_0x4632('0x75')](this,_0x4e2ca0,'-1');return _0x112d64;}else if(_0x112d64[_0x4632('0xac')]==='timeout'){_0x112d64['result']=_0x112d64[_0x4632('0xaf')][_0x4632('0xa5')]>0x0?_0x112d64[_0x4632('0xaf')]:'t';}else if(_[_0x4632('0x46')](_0x112d64[_0x4632('0xaf')])){_0x112d64[_0x4632('0xaf')]='#';_0x3e8d53='#';}if(!this[_0x4632('0xb4')](_0x4e2ca0['variable_id'])){this['channel'][_0x4632('0xb8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2ec2d0=this['getVariable'][_0x4632('0x75')](this,_0x4e2ca0[_0x4632('0xe6')]);if(!_0x2ec2d0){return this['channel'][_0x4632('0x2c')](_0x4e2ca0,_0x4632('0xe7'));}this[_0x4632('0x3a')][_0x4632('0xa8')](_0x2ec2d0,_0x3e8d53);}this[_0x4632('0x36')][_0x4632('0x75')](this,_0x4e2ca0,_0x3e8d53);return _0x112d64;};AGIVertices[_0x4632('0xf')][_0x4632('0xb8')]=function(_0x13815b){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x174'),_0x13815b[_0x4632('0x38')]));return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x13815b['output']||_0x13815b[_0x4632('0x38')]);};AGIVertices[_0x4632('0xf')][_0x4632('0x175')]=function(_0x6b809a){logger['info'](util['format'](_0x4632('0x176'),_0x6b809a[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x6b809a[_0x4632('0x163')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x6b809a,_0x4632('0x164'));}logger[_0x4632('0x2e')](util[_0x4632('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4632('0x3a')][_0x4632('0x3c')],_0x6b809a[_0x4632('0x163')]));var _0x21ccec=this['getPause'][_0x4632('0x75')](this,_0x6b809a[_0x4632('0x177')]);var _0x1d8883=this[_0x4632('0x50')][_0x4632('0x75')](this,_0x6b809a[_0x4632('0x163')],_0x21ccec);if(_0x1d8883){logger['info'](util[_0x4632('0x28')](_0x4632('0x166'),this['channel'][_0x4632('0x3c')],_0x6b809a[_0x4632('0x163')]));this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x166'),this[_0x4632('0x3a')]['callerid'],_0x6b809a[_0x4632('0x163')]));return{'code':0xc8,'result':_0x4632('0x167')};}else{logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x168'),this['channel']['callerid'],_0x6b809a[_0x4632('0x163')]));this[_0x4632('0x3a')][_0x4632('0xb8')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4632('0x3a')][_0x4632('0x3c')],_0x6b809a[_0x4632('0x163')]));return{'code':0xc8,'result':_0x4632('0x169')};}};AGIVertices[_0x4632('0xf')][_0x4632('0x178')]=function(_0x59f9ca){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x179'),_0x59f9ca[_0x4632('0x38')]));if(!this['isConfigured'](_0x59f9ca[_0x4632('0x173')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x59f9ca,_0x4632('0x124'));}var _0x134a65=this[_0x4632('0x20')]['sync'](this,_0x59f9ca[_0x4632('0x173')]);if(!_0x134a65){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x59f9ca,_0x4632('0x125'));}var _0x468dbd=this[_0x4632('0x3a')]['exec'](_0x4632('0x17a'),[_0x134a65,_0x59f9ca[_0x4632('0xf4')]]);if(_0x468dbd['result']===-0x1){return _0x468dbd;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0xd1'),_0x4632('0x17a'),_0x134a65));};AGIVertices[_0x4632('0xf')][_0x4632('0x17b')]=function(_0x5733a5){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x5733a5[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x5733a5[_0x4632('0x17c')])){return this[_0x4632('0x3a')]['error'](_0x5733a5,'no\x20queue\x20selected');}var _0x68f741='';var _0x3fcbda=parseInt(_0x5733a5[_0x4632('0x17c')],0xa);if(isNaN(_0x3fcbda)){_0x68f741=_0x5733a5[_0x4632('0x17c')];}else{_0x68f741=this[_0x4632('0x15')][_0x4632('0x75')](this,_0x5733a5['queue_id']);if(!_0x68f741){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x5733a5,_0x4632('0x17d'));}}var _0x1fa188='';if(this[_0x4632('0xb4')](_0x5733a5['file_id'])){var _0x5f047d=this[_0x4632('0x20')][_0x4632('0x75')](this,_0x5733a5['file_id']);if(_0x5f047d){_0x1fa188=_0x5f047d;}}this[_0x4632('0x36')][_0x4632('0x75')](this,_0x5733a5,_0x68f741);if(_0x5733a5['opts'][_0x4632('0x17e')]('x')<0x0){_0x5733a5[_0x4632('0xf4')]+='x';}if(_0x5733a5[_0x4632('0xf4')][_0x4632('0x17e')]('X')<0x0){_0x5733a5['opts']+='X';}this['channel'][_0x4632('0xa8')](_0x4632('0x17f'),_0x68f741?_0x68f741[_0x4632('0x180')]():'');var _0x1a85e3=this[_0x4632('0x3a')][_0x4632('0xb6')]('QUEUE',[_0x68f741,_0x5733a5[_0x4632('0xf4')],_0x5733a5[_0x4632('0x68')],_0x1fa188,_0x5733a5[_0x4632('0x6b')],_0x5733a5[_0x4632('0x6')],_0x5733a5[_0x4632('0x181')],_0x5733a5[_0x4632('0x182')],'',_0x5733a5['position']]);if(_0x1a85e3[_0x4632('0xaf')]===-0x1){return _0x1a85e3;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util['format']('Executed\x20command\x20%s\x20%s',_0x4632('0x183'),_0x68f741));};AGIVertices[_0x4632('0xf')][_0x4632('0x184')]=function(_0x415fae){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x185'),_0x415fae[_0x4632('0x38')]));var _0x2fc59e=_0x415fae[_0x4632('0x186')]||_0x4632('0x13d');var _0x3ae6e9=util[_0x4632('0x28')](_0x4632('0x187'),this[_0x4632('0x3a')][_0x4632('0x37')],rs[_0x4632('0x12a')](0x5));var _0x6d86e=util['format'](_0x4632('0x188'),FILES_PATH,_0x3ae6e9,_0x2fc59e);var _0x459637=util[_0x4632('0x28')]('%s/recordings/%s',FILES_PATH,_0x3ae6e9);this[_0x4632('0x3d')]['sync'](this,_0x415fae,_0x3ae6e9,_0x6d86e);this[_0x4632('0x3a')][_0x4632('0xa8')]('RECORDING_SAVENAME',_0x3ae6e9);logger[_0x4632('0x2e')](_0x4632('0x189'),_0x459637,_0x2fc59e,_0x415fae[_0x4632('0x18a')],_0x415fae['timeout']);return this[_0x4632('0x3a')][_0x4632('0x141')](_0x459637,_0x2fc59e,_0x415fae[_0x4632('0x18a')],_0x415fae[_0x4632('0x6b')],undefined,!![]);};AGIVertices[_0x4632('0xf')]['restapi']=function(_0x17276e){logger['info'](util[_0x4632('0x28')](_0x4632('0x18b'),_0x17276e[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x17276e[_0x4632('0x68')])){return this[_0x4632('0x3a')]['noop'](_0x4632('0x18c'));}var _0x45182c=this[_0x4632('0x67')][_0x4632('0x75')](this,_0x17276e);logger['info'](util[_0x4632('0x28')](_0x4632('0x18d'),util[_0x4632('0x18e')](_0x45182c,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x17276e[_0x4632('0xe6')])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x18f'));}var _0x59f4be=this[_0x4632('0x10')][_0x4632('0x75')](this,_0x17276e[_0x4632('0xe6')]);if(!_0x59f4be){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x17276e,'no\x20variable\x20found');}this[_0x4632('0x3a')][_0x4632('0xa8')](util[_0x4632('0x28')](_0x4632('0x190'),_0x59f4be),_0x45182c[_0x4632('0x7a')]?_0x45182c[_0x4632('0x7a')]:_0x4632('0x191'));this['channel'][_0x4632('0xa8')](util[_0x4632('0x28')](_0x4632('0x192'),_0x59f4be),_0x45182c[_0x4632('0x7b')]?_0x45182c[_0x4632('0x7b')]:'OK');if(_0x45182c[_0x4632('0x6e')]){try{this[_0x4632('0xa6')](_0x45182c[_0x4632('0x6e')],_0x59f4be);}catch(_0x1da948){logger['error'](util[_0x4632('0x28')](_0x4632('0x193'),_0x59f4be));}}return this[_0x4632('0x3a')]['noop'](util[_0x4632('0x28')](_0x4632('0xeb'),_0x59f4be));};AGIVertices['prototype'][_0x4632('0x194')]=function(_0x325ae2){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x195'),_0x325ae2[_0x4632('0x38')]));return this[_0x4632('0x3a')][_0x4632('0x196')](_0x325ae2[_0x4632('0x197')][_0x4632('0x5a')](/\s+/g,''),_0x325ae2[_0x4632('0x18a')]);};AGIVertices[_0x4632('0xf')]['saynumber']=function(_0x53b151){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x198'),_0x53b151[_0x4632('0x38')]));return this['channel'][_0x4632('0x199')](_0x53b151[_0x4632('0x6a')][_0x4632('0x5a')](/\s+/g,''),_0x53b151[_0x4632('0x18a')]);};AGIVertices[_0x4632('0xf')]['sayphonetic']=function(_0x163df5){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x19a'),_0x163df5['label']));return this[_0x4632('0x3a')][_0x4632('0x19b')](_0x163df5[_0x4632('0x5e')],_0x163df5[_0x4632('0x18a')]);};AGIVertices[_0x4632('0xf')]['sendMail']=function(_0x1bdfab){logger[_0x4632('0x2e')](util[_0x4632('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x1bdfab[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x1bdfab['account_id'])){return this['channel'][_0x4632('0xb8')](_0x4632('0x19c'));}var _0x2a3baf=this[_0x4632('0x19d')][_0x4632('0x75')](this,_0x1bdfab[_0x4632('0x19e')]);if(!_0x2a3baf||!_0x2a3baf[_0x4632('0x19f')]){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x1bdfab,_0x4632('0x1a0'));}var _0xfcdc0f={'from':util[_0x4632('0x28')](_0x4632('0x1a1'),_0x2a3baf[_0x4632('0x14')],_0x2a3baf['email']||_0x2a3baf[_0x4632('0x19f')]['user']),'to':_0x1bdfab['to']||'','cc':_0x1bdfab['cc']||'','bcc':_0x1bdfab[_0x4632('0x1a2')]||'','subject':_0x1bdfab[_0x4632('0x1a3')],'html':_0x1bdfab[_0x4632('0x5e')],'text':_0x1bdfab[_0x4632('0x5e')]};if(this['isConfigured'](_0x1bdfab['template_id'])){}logger[_0x4632('0xed')](_0x4632('0x1a4'),JSON[_0x4632('0x78')](_0xfcdc0f));this['createSquareDetailsReport'][_0x4632('0x75')](this,_0x1bdfab,_0x1bdfab['account_id']);this[_0x4632('0x3a')]['noop'](util['format'](_0x4632('0x1a5'),_0x2a3baf[_0x4632('0x14')]));this['sendMailMessage']['sync'](this,_0x2a3baf[_0x4632('0x1a6')],_0xfcdc0f);return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x1a7'));};AGIVertices[_0x4632('0xf')][_0x4632('0x1a8')]=function(_0x39478d){logger[_0x4632('0x2e')](util['format'](_0x4632('0x1a9'),_0x39478d[_0x4632('0x38')]));return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x1aa'));};AGIVertices[_0x4632('0xf')][_0x4632('0x1ab')]=function(_0x4e7270){logger['info'](util[_0x4632('0x28')](_0x4632('0x1ac'),_0x4e7270[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x4e7270[_0x4632('0x1ad')])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x1ae'));}var _0x785442=this[_0x4632('0x33')]['sync'](this,_0x4e7270[_0x4632('0x1ad')]);if(!_0x785442){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x4e7270,_0x4632('0x1af'));}var _0x34c1e7={'body':_0x4e7270['sms_text'],'phone':_0x4e7270['to']||'','SmsAccountId':_0x785442['id']};logger['debug']('sendSMS\x20message',JSON[_0x4632('0x78')](_0x34c1e7));this[_0x4632('0x36')][_0x4632('0x75')](this,_0x4e7270,_0x4e7270[_0x4632('0x1ad')]);this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0x1b0'),_0x785442['name']));this[_0x4632('0x35')][_0x4632('0x75')](this,_0x34c1e7);return this['channel'][_0x4632('0xb8')](_0x4632('0x1b1'));};AGIVertices[_0x4632('0xf')][_0x4632('0x1b2')]=function(_0x1d1078){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x1b3'),_0x1d1078[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x1d1078[_0x4632('0xe6')])){return this['channel']['error'](_0x1d1078,_0x4632('0x1b4'));}var _0x46ea89=this['getVariable'][_0x4632('0x75')](this,_0x1d1078[_0x4632('0xe6')]);if(!_0x46ea89){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x1d1078,_0x4632('0xe7'));}return this['channel'][_0x4632('0xa8')](_0x46ea89,_0x1d1078[_0x4632('0x1b5')]);};AGIVertices[_0x4632('0xf')][_0x4632('0x1b6')]=function(_0x476e74){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x1b7'),_0x476e74[_0x4632('0x38')]));this['channel'][_0x4632('0xb8')](_0x4632('0x1b8'));if(_0x476e74['answer']==='yes'){this['channel'][_0x4632('0xb8')]('Answer');return this[_0x4632('0x3a')][_0x4632('0xc3')]();}return this[_0x4632('0x3a')]['noop'](_0x4632('0x1b9'));};AGIVertices[_0x4632('0xf')][_0x4632('0x1ba')]=function(_0x5f0ec0){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x1bb'),_0x5f0ec0['label']));if(!this[_0x4632('0xb4')](_0x5f0ec0[_0x4632('0x1bc')])){return this['channel'][_0x4632('0x2c')](_0x5f0ec0,_0x4632('0x1bd'));}var _0x2be71f=this['getSquareProject'][_0x4632('0x75')](this,_0x5f0ec0[_0x4632('0x1bc')]);if(!this[_0x4632('0xb4')](_0x2be71f)){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x5f0ec0,util[_0x4632('0x28')](_0x4632('0x1be'),_0x5f0ec0[_0x4632('0x1bc')]));}if(_0x2be71f===this['channel'][_0x4632('0x3b')]){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x5f0ec0,_0x4632('0x1bf'));}this[_0x4632('0x36')][_0x4632('0x75')](this,_0x5f0ec0,_0x2be71f);var _0x59bef8=this[_0x4632('0x3a')][_0x4632('0xb6')]('AGI',util['format'](_0x4632('0x1c0'),config[_0x4632('0x6')]['host']||_0x4632('0x1c1'),_0x2be71f,this['channel'][_0x4632('0x3b')]));if(_0x59bef8[_0x4632('0xaf')]===-0x1){return _0x59bef8;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0xd1'),_0x4632('0x1c2'),_0x2be71f));};AGIVertices[_0x4632('0xf')]['system']=function(_0x5da849){logger[_0x4632('0x2e')](util['format'](_0x4632('0x1c3'),_0x5da849[_0x4632('0x38')]));var _0x406f8e=this['shellCommand'][_0x4632('0x75')](this,_0x5da849[_0x4632('0xc1')]);this[_0x4632('0x36')][_0x4632('0x75')](this,_0x5da849,_0x5da849[_0x4632('0xc1')]);if(this[_0x4632('0xb4')](_0x5da849[_0x4632('0xe6')])){var _0x34cb81=this[_0x4632('0x10')]['sync'](this,_0x5da849[_0x4632('0xe6')]);if(_0x34cb81){this[_0x4632('0x3a')]['setVariable'](_0x34cb81,_0x406f8e);return this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x1c4'),_0x5da849['command'],_0x34cb81));}}return this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x1c5'),_0x5da849[_0x4632('0xc1')]));};AGIVertices[_0x4632('0xf')][_0x4632('0x1c6')]=function(_0x4beb98){logger[_0x4632('0x2e')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x4beb98[_0x4632('0x38')]));_0x4beb98['text']=_0x4beb98['text'][_0x4632('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4632('0xb4')](_0x4beb98['apiKey'])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0x1c7'));}if(!this[_0x4632('0xb4')](_0x4beb98['text'])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0xb5'));}this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0x1c8'),_0x4beb98['text']));var _0x31c25c=this['googleCloudTTS'][_0x4632('0x75')](this,_0x4beb98);if(_0x31c25c){this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x31c25c));var _0x155932=this['channel']['streamFile'](_0x31c25c);try{fs[_0x4632('0x134')](_0x31c25c+'.wav');}catch(_0x1465bb){logger['error'](_0x1465bb);}return _0x155932;}return this[_0x4632('0x3a')]['error'](_0x4beb98,_0x4632('0x1c9'));};AGIVertices[_0x4632('0xf')][_0x4632('0x1ca')]=function(_0x6a4be1){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x1cb'),_0x6a4be1[_0x4632('0x38')]));_0x6a4be1[_0x4632('0x5e')]=_0x6a4be1['text'][_0x4632('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4632('0xb4')](_0x6a4be1[_0x4632('0x5e')])){return this[_0x4632('0x3a')][_0x4632('0xb8')](_0x4632('0xb5'));}this[_0x4632('0x3a')]['noop'](util['format'](_0x4632('0x1cc'),_0x6a4be1[_0x4632('0x5e')]));var _0x2c7021=this[_0x4632('0x65')][_0x4632('0x75')](this,_0x6a4be1);if(_0x2c7021){this[_0x4632('0x3a')][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x1cd'),_0x2c7021));var _0x4c8b3e=this[_0x4632('0x3a')][_0x4632('0x115')](_0x2c7021);try{fs[_0x4632('0x134')](_0x2c7021+'.wav');}catch(_0x536ce1){logger[_0x4632('0x2c')](_0x536ce1);}return _0x4c8b3e;}return this['channel'][_0x4632('0x2c')](_0x6a4be1,_0x4632('0x1ce'));};AGIVertices[_0x4632('0xf')][_0x4632('0x1cf')]=function(_0x339486){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x1d0'),_0x339486['label']));if(!this[_0x4632('0xb4')](_0x339486[_0x4632('0x163')])){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x339486,'no\x20find\x20by\x20configured');}logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x165'),this['channel'][_0x4632('0x3c')],_0x339486['findBy']));var _0x119534=this[_0x4632('0x52')][_0x4632('0x75')](this,_0x339486['findBy']);if(_0x119534){logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x166'),this[_0x4632('0x3a')][_0x4632('0x3c')],_0x339486[_0x4632('0x163')]));this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0x166'),this[_0x4632('0x3a')]['callerid'],_0x339486['findBy']));return{'code':0xc8,'result':_0x4632('0x167')};}else{logger[_0x4632('0x2e')](util[_0x4632('0x28')](_0x4632('0x168'),this['channel'][_0x4632('0x3c')],_0x339486[_0x4632('0x163')]));this['channel'][_0x4632('0xb8')](util[_0x4632('0x28')](_0x4632('0x168'),this[_0x4632('0x3a')][_0x4632('0x3c')],_0x339486[_0x4632('0x163')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4632('0xf')]['voicemail']=function(_0x3fc697){logger['info'](util[_0x4632('0x28')](_0x4632('0x1d1'),_0x3fc697[_0x4632('0x38')]));var _0x538e8d=this['channel']['exec'](_0x4632('0x1d2'),[_0x3fc697['mailbox'],_0x3fc697[_0x4632('0x7e')]]);if(_0x538e8d[_0x4632('0xaf')]===-0x1){return _0x538e8d;}return this[_0x4632('0x3a')][_0x4632('0xb8')](util['format'](_0x4632('0xd1'),_0x4632('0x1d2'),_0x3fc697[_0x4632('0x1d3')]));};AGIVertices[_0x4632('0xf')][_0x4632('0x1d4')]=function(_0x24a8a4){logger['info'](util[_0x4632('0x28')](_0x4632('0x1d5'),_0x24a8a4[_0x4632('0x38')]));if(!this[_0x4632('0xb4')](_0x24a8a4['variable_id'])){return this[_0x4632('0x3a')]['error'](_0x24a8a4,'no\x20variable\x20selected');}var _0x733250=this[_0x4632('0x10')][_0x4632('0x75')](this,_0x24a8a4['variable_id']);if(!_0x733250){return this[_0x4632('0x3a')][_0x4632('0x2c')](_0x24a8a4,'no\x20variable\x20found');}var _0x520a03=this[_0x4632('0x3a')][_0x4632('0x10')](_0x733250);return{'code':0xc8,'result':_0x520a03[_0x4632('0xac')]?_0x520a03[_0x4632('0xac')]:'-'};};String[_0x4632('0xf')][_0x4632('0xab')]=function(_0x2d050e,_0x358669){return this['split'](_0x2d050e)[_0x4632('0x1d6')](_0x358669);};module[_0x4632('0x1d7')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 470a2d7..0d22f67 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 _0x2b3d=['then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','acwTimeout','timers','timer','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action'];(function(_0x47d804,_0x5cc88f){var _0x284c47=function(_0x271c22){while(--_0x271c22){_0x47d804['push'](_0x47d804['shift']());}};_0x284c47(++_0x5cc88f);}(_0x2b3d,0x8b));var _0xd2b3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2b3d[_0x57b54c];return _0x59cc19;};'use strict';var util=require('util');var _=require(_0xd2b3('0x0'));var moment=require(_0xd2b3('0x1'));var ami=require('../ami');var logger=require(_0xd2b3('0x2'))(_0xd2b3('0x3'));var RpcUser=require(_0xd2b3('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x4795c5){this[_0xd2b3('0x5')]=_0x4795c5['voiceQueues'];this[_0xd2b3('0x6')]=_0x4795c5['agents'];this['timers']=_0x4795c5['timers'];this[_0xd2b3('0x7')]={};ami['on'](_0xd2b3('0x8'),this[_0xd2b3('0x9')][_0xd2b3('0xa')](this));ami['on'](_0xd2b3('0xb'),this[_0xd2b3('0xc')]['bind'](this));ami['on'](_0xd2b3('0xd'),this['syncHangup'][_0xd2b3('0xa')](this));ami['on'](_0xd2b3('0xe'),this[_0xd2b3('0xf')][_0xd2b3('0xa')](this));ami['on'](_0xd2b3('0x10'),this[_0xd2b3('0x11')][_0xd2b3('0xa')](this));ami['on'](_0xd2b3('0x12'),this[_0xd2b3('0x13')][_0xd2b3('0xa')](this));ami['on'](_0xd2b3('0x14'),this[_0xd2b3('0x15')][_0xd2b3('0xa')](this));}function getDiff(_0x28b0c6){var _0x13b0ec=moment()['milliseconds'](0x0);var _0x566835=moment(_0x28b0c6)[_0xd2b3('0x16')](0x0);return _0x13b0ec[_0xd2b3('0x17')](_0x566835,_0xd2b3('0x18'));}Acw[_0xd2b3('0x19')][_0xd2b3('0x1a')]=function(_0x2360b5){try{var _0x43072b=this;var _0x1c7321=this[_0xd2b3('0x7')][_0x2360b5][_0xd2b3('0x1b')];var _0x21d31e=this[_0xd2b3('0x7')][_0x2360b5][_0xd2b3('0x1c')];var _0x537d1e=this['voiceQueues'][_0x21d31e];var _0x39238c=![];var _0x1b33fd='ACW';if(_0x537d1e[_0xd2b3('0x1d')]){if(_0x537d1e[_0xd2b3('0x1e')][_0xd2b3('0x1f')]){_0x39238c=!![];_0x1b33fd=_0x537d1e[_0xd2b3('0x1e')][_0xd2b3('0x1f')];}}ami[_0xd2b3('0x20')]({'action':'QueuePause','interface':_0x1c7321,'paused':!![],'reason':_0x1b33fd})[_0xd2b3('0x21')](function(_0x21d04f){if(_0x43072b[_0xd2b3('0x6')][_0x1c7321]){return RpcUser[_0xd2b3('0x22')](_0x43072b['agents'][_0x1c7321]['id'])['then'](function(_0x367231){if(_0x367231&&!_0x367231[_0xd2b3('0x23')]){logger['info'](_0xd2b3('0x24'),_0x2360b5,_0x1c7321,_0x21d31e);var _0x4bdde6=_0x43072b[_0xd2b3('0x7')][_0x2360b5][_0xd2b3('0x25')]&&_0x43072b['channels'][_0x2360b5][_0xd2b3('0x26')]?_0x43072b[_0xd2b3('0x7')][_0x2360b5][_0xd2b3('0x26')]:_0x2360b5;return RpcUser[_0xd2b3('0x27')](_0x43072b[_0xd2b3('0x6')][_0x1c7321],_0x1b33fd,_0x4bdde6)[_0xd2b3('0x21')](function(_0x56d258){if(!_0x39238c){_0x43072b['timers'][_0x1c7321]={};logger[_0xd2b3('0x28')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2360b5,_0x43072b[_0xd2b3('0x5')][_0x21d31e][_0xd2b3('0x29')],_0x1c7321,_0x21d31e);_0x43072b[_0xd2b3('0x2a')][_0x1c7321][_0xd2b3('0x2b')]=setTimeout(_0x43072b['stopAcw'][_0xd2b3('0xa')](_0x43072b,_0x1c7321),_0x43072b['voiceQueues'][_0x21d31e][_0xd2b3('0x29')]*0x3e8);_0x43072b[_0xd2b3('0x2a')][_0x1c7321]['lastPauseAt']=moment()[_0xd2b3('0x2c')](_0xd2b3('0x2d'));_0x43072b[_0xd2b3('0x2a')][_0x1c7321][_0xd2b3('0x2e')]=_0x2360b5;_0x43072b[_0xd2b3('0x2a')][_0x1c7321]['queue']=_0x21d31e;_0x43072b[_0xd2b3('0x2a')][_0x1c7321][_0xd2b3('0x2f')]=function(){var _0x139fad=getDiff(_0x43072b[_0xd2b3('0x2a')][_0x1c7321]['lastPauseAt']);clearTimeout(_0x43072b['timers'][_0x1c7321][_0xd2b3('0x2b')]);_0x43072b[_0xd2b3('0x2a')][_0x1c7321][_0xd2b3('0x2b')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x139fad},_0x43072b['timers'][_0x1c7321][_0xd2b3('0x2e')],_0x1c7321)[_0xd2b3('0x21')](function(_0x43bd6d){logger['info'](_0xd2b3('0x30'),_0x2360b5,_0x139fad,_0x43bd6d);})[_0xd2b3('0x31')](function(_0x1ba7a2){logger['error'](_0xd2b3('0x32'),_0x2360b5,_0x1ba7a2);});delete _0x43072b[_0xd2b3('0x2a')][_0x1c7321];};}});}else{logger['info'](_0xd2b3('0x33'),_0x2360b5,_0x1c7321,_0x21d31e);}});}})[_0xd2b3('0x31')](function(_0x1c00f3){logger[_0xd2b3('0x34')](_0xd2b3('0x35'),_0x2360b5,_0x43072b['voiceQueues'][_0x21d31e][_0xd2b3('0x29')],_0x1c7321,_0x21d31e);})[_0xd2b3('0x36')](function(){delete _0x43072b['channels'][_0x2360b5];});}catch(_0x49b6a7){logger[_0xd2b3('0x34')]('[ACW][START]\x20%s',_0x49b6a7['message']);}};Acw[_0xd2b3('0x19')][_0xd2b3('0x37')]=function(_0x3adb1c){try{var _0x3b03dc=this;if(_0x3b03dc['timers'][_0x3adb1c]){_0x3b03dc[_0xd2b3('0x2a')][_0x3adb1c][_0xd2b3('0x2b')]=![];var _0x1e9845=_0x3b03dc[_0xd2b3('0x2a')][_0x3adb1c]['uniqueid'];var _0xc5d65e=_0x3b03dc[_0xd2b3('0x2a')][_0x3adb1c][_0xd2b3('0x1c')];var _0x34e1ef=_0x3b03dc[_0xd2b3('0x5')][_0xc5d65e][_0xd2b3('0x29')];logger['info'](_0xd2b3('0x38'),_0x1e9845,_0x3adb1c);RpcUser[_0xd2b3('0x39')](this[_0xd2b3('0x6')][_0x3adb1c]);RpcVoiceAgentReport['update']({'acwtime':_0x34e1ef,'agentacw':!![]},_0x1e9845,_0x3adb1c)[_0xd2b3('0x21')](function(_0x419c48){logger[_0xd2b3('0x28')](_0xd2b3('0x30'),_0x1e9845,_0x34e1ef,_0x419c48);})[_0xd2b3('0x31')](function(_0x316e49){logger[_0xd2b3('0x34')](_0xd2b3('0x32'),_0x1e9845,_0x316e49);});}else{logger['error'](_0xd2b3('0x3a'),_0x3adb1c);if(_0x3b03dc[_0xd2b3('0x2a')]){logger['info'](_0xd2b3('0x3b'),JSON[_0xd2b3('0x3c')](_0x3b03dc[_0xd2b3('0x2a')]));}}}catch(_0x12b99d){logger[_0xd2b3('0x34')](_0xd2b3('0x3d'),_0x12b99d['message']);}};Acw[_0xd2b3('0x19')][_0xd2b3('0x9')]=function(_0x4ed8ef){try{if(this[_0xd2b3('0x5')][_0x4ed8ef['queue']]&&(this[_0xd2b3('0x5')][_0x4ed8ef[_0xd2b3('0x1c')]]['acw']||this['voiceQueues'][_0x4ed8ef['queue']]['mandatoryDisposition'])){if(this[_0xd2b3('0x6')][_0x4ed8ef[_0xd2b3('0x1b')]]){this[_0xd2b3('0x7')][_0x4ed8ef[_0xd2b3('0x2e')]]={'queue':_0x4ed8ef[_0xd2b3('0x1c')],'interface':_0x4ed8ef['interface'],'destlinkedid':_0x4ed8ef[_0xd2b3('0x26')]};}}}catch(_0x67435c){logger['error'](_0xd2b3('0x3e'),_0x67435c[_0xd2b3('0x3f')]);}};Acw[_0xd2b3('0x19')][_0xd2b3('0x15')]=function(_0x1a8c45){try{if(this[_0xd2b3('0x5')][_0x1a8c45[_0xd2b3('0x1c')]]&&(this[_0xd2b3('0x5')][_0x1a8c45[_0xd2b3('0x1c')]][_0xd2b3('0x3')]||this[_0xd2b3('0x5')][_0x1a8c45['queue']][_0xd2b3('0x1d')])){if(this[_0xd2b3('0x6')][_0x1a8c45[_0xd2b3('0x1b')]]){this['channels'][_0x1a8c45[_0xd2b3('0x2e')]]={'queue':_0x1a8c45['queue'],'interface':_0x1a8c45[_0xd2b3('0x1b')]};}}}catch(_0x467f84){logger[_0xd2b3('0x34')](_0xd2b3('0x40'),_0x467f84[_0xd2b3('0x3f')]);}};Acw[_0xd2b3('0x19')][_0xd2b3('0xc')]=function(_0x5d3d2f){try{if(this[_0xd2b3('0x7')][_0x5d3d2f[_0xd2b3('0x2e')]]&&_[_0xd2b3('0x41')](this[_0xd2b3('0x7')][_0x5d3d2f[_0xd2b3('0x2e')]][_0xd2b3('0x25')])){logger[_0xd2b3('0x28')](_0xd2b3('0x42'),_0x5d3d2f[_0xd2b3('0x2e')]);this[_0xd2b3('0x1a')](_0x5d3d2f[_0xd2b3('0x2e')]);}else if(this[_0xd2b3('0x7')][_0x5d3d2f[_0xd2b3('0x43')]]&&_[_0xd2b3('0x41')](this[_0xd2b3('0x7')][_0x5d3d2f['linkedid']][_0xd2b3('0x25')])){logger[_0xd2b3('0x28')](_0xd2b3('0x44'),_0x5d3d2f[_0xd2b3('0x43')]);this[_0xd2b3('0x1a')](_0x5d3d2f['linkedid']);}}catch(_0x436cb5){logger[_0xd2b3('0x34')](_0xd2b3('0x45'),_0x436cb5[_0xd2b3('0x3f')]);}};Acw[_0xd2b3('0x19')][_0xd2b3('0x46')]=function(_0x231b82){try{if(this[_0xd2b3('0x7')][_0x231b82[_0xd2b3('0x2e')]]&&this[_0xd2b3('0x7')][_0x231b82[_0xd2b3('0x2e')]][_0xd2b3('0x25')]){logger[_0xd2b3('0x28')](_0xd2b3('0x47'),_0x231b82[_0xd2b3('0x2e')]);this['startAcw'](_0x231b82[_0xd2b3('0x2e')]);}else if(this[_0xd2b3('0x7')][_0x231b82[_0xd2b3('0x43')]]&&this[_0xd2b3('0x7')][_0x231b82[_0xd2b3('0x43')]][_0xd2b3('0x25')]){logger[_0xd2b3('0x28')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x231b82[_0xd2b3('0x43')]);this[_0xd2b3('0x1a')](_0x231b82[_0xd2b3('0x43')]);}}catch(_0x43ea02){logger['error'](_0xd2b3('0x48'),_0x43ea02[_0xd2b3('0x3f')]);}};Acw[_0xd2b3('0x19')][_0xd2b3('0x11')]=function(_0x5164f8){try{if(!_['isNil'](this['channels'][_0x5164f8['transfereeuniqueid']])){this[_0xd2b3('0x1a')](_0x5164f8['transfereeuniqueid']);if(this[_0xd2b3('0x7')][_0x5164f8[_0xd2b3('0x49')]]){this[_0xd2b3('0x7')][_0x5164f8[_0xd2b3('0x49')]]['attended']=!![];this[_0xd2b3('0x7')][_0x5164f8[_0xd2b3('0x4a')]]=this[_0xd2b3('0x7')][_0x5164f8['secondtransfereruniqueid']];delete this[_0xd2b3('0x7')][_0x5164f8[_0xd2b3('0x49')]];}}else if(!_[_0xd2b3('0x4b')](this[_0xd2b3('0x7')][_0x5164f8[_0xd2b3('0x4a')]])){this[_0xd2b3('0x1a')](_0x5164f8[_0xd2b3('0x4a')]);if(this['channels'][_0x5164f8[_0xd2b3('0x4c')]]){this[_0xd2b3('0x7')][_0x5164f8[_0xd2b3('0x4c')]][_0xd2b3('0x25')]=!![];this[_0xd2b3('0x7')][_0x5164f8[_0xd2b3('0x4d')]]=this[_0xd2b3('0x7')][_0x5164f8[_0xd2b3('0x4c')]];delete this['channels'][_0x5164f8[_0xd2b3('0x4c')]];}}}catch(_0x4de5fe){logger['error'](_0xd2b3('0x4e'),_0x4de5fe[_0xd2b3('0x3f')]);}};Acw[_0xd2b3('0x19')][_0xd2b3('0x13')]=function(_0x24a3b9){try{if(this[_0xd2b3('0x7')][_0x24a3b9['transfereruniqueid']]){logger[_0xd2b3('0x28')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x24a3b9[_0xd2b3('0x4f')]));this[_0xd2b3('0x1a')](_0x24a3b9[_0xd2b3('0x4f')]);}else if(this[_0xd2b3('0x7')][_0x24a3b9[_0xd2b3('0x50')]]){logger[_0xd2b3('0x28')](_0xd2b3('0x51'),JSON['stringify'](_0x24a3b9[_0xd2b3('0x50')]));this['startAcw'](_0x24a3b9[_0xd2b3('0x50')]);}}catch(_0x2a4e02){logger['error'](_0xd2b3('0x52'),_0x2a4e02[_0xd2b3('0x3f')]);}};Acw['prototype'][_0xd2b3('0xf')]=function(_0x450483){try{if(this[_0xd2b3('0x5')][_0x450483[_0xd2b3('0x1c')]]&&this[_0xd2b3('0x5')][_0x450483[_0xd2b3('0x1c')]]['autopause']==='all'){if(this[_0xd2b3('0x6')][_0x450483[_0xd2b3('0x1b')]]){logger['info'](_0xd2b3('0x53'),_0x450483['uniqueid'],_0x450483['interface'],_0x450483['queue']);return RpcUser['savePause'](this['agents'][_0x450483[_0xd2b3('0x1b')]],'Auto-Pause',_0x450483[_0xd2b3('0x2e')]);}}}catch(_0x5b4440){logger['error'](_0xd2b3('0x54'),_0x5b4440[_0xd2b3('0x3f')]);}};module[_0xd2b3('0x55')]=Acw; \ No newline at end of file +var _0x3d55=['uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','catch','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','syncHangup','bind','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','interface','channels','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','attended','destlinkedid','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1d606e,_0x438c6a){var _0x528543=function(_0x5c0cf7){while(--_0x5c0cf7){_0x1d606e['push'](_0x1d606e['shift']());}};_0x528543(++_0x438c6a);}(_0x3d55,0x16a));var _0x53d5=function(_0x1f50c6,_0xf78fe1){_0x1f50c6=_0x1f50c6-0x0;var _0xada69c=_0x3d55[_0x1f50c6];return _0xada69c;};'use strict';var util=require(_0x53d5('0x0'));var _=require(_0x53d5('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x53d5('0x2'))(_0x53d5('0x3'));var RpcUser=require(_0x53d5('0x4'));var RpcVoiceAgentReport=require(_0x53d5('0x5'));function Acw(_0x4f2e96){this[_0x53d5('0x6')]=_0x4f2e96['voiceQueues'];this[_0x53d5('0x7')]=_0x4f2e96['agents'];this[_0x53d5('0x8')]=_0x4f2e96[_0x53d5('0x8')];this['channels']={};ami['on'](_0x53d5('0x9'),this[_0x53d5('0xa')]['bind'](this));ami['on'](_0x53d5('0xb'),this[_0x53d5('0xc')]['bind'](this));ami['on'](_0x53d5('0xd'),this[_0x53d5('0xe')][_0x53d5('0xf')](this));ami['on']('agentringnoanswer',this[_0x53d5('0x10')]['bind'](this));ami['on'](_0x53d5('0x11'),this['syncAttendedTransfer'][_0x53d5('0xf')](this));ami['on'](_0x53d5('0x12'),this['syncBlindTransfer'][_0x53d5('0xf')](this));ami['on'](_0x53d5('0x13'),this[_0x53d5('0x14')][_0x53d5('0xf')](this));}function getDiff(_0x549f0c){var _0x4ad68b=moment()[_0x53d5('0x15')](0x0);var _0x362462=moment(_0x549f0c)['milliseconds'](0x0);return _0x4ad68b[_0x53d5('0x16')](_0x362462,'seconds');}Acw[_0x53d5('0x17')][_0x53d5('0x18')]=function(_0x159edc){try{var _0x5df0d0=this;var _0x20ef73=this['channels'][_0x159edc][_0x53d5('0x19')];var _0xed78ae=this[_0x53d5('0x1a')][_0x159edc][_0x53d5('0x1b')];var _0x2b0a44=this['voiceQueues'][_0xed78ae];var _0x633154=![];var _0x4367c4='ACW';if(_0x2b0a44[_0x53d5('0x1c')]){if(_0x2b0a44[_0x53d5('0x1d')][_0x53d5('0x1e')]){_0x633154=!![];_0x4367c4=_0x2b0a44['mandatoryDispositionPause'][_0x53d5('0x1e')];}}ami[_0x53d5('0x1f')]({'action':_0x53d5('0x20'),'interface':_0x20ef73,'paused':!![],'reason':_0x4367c4})[_0x53d5('0x21')](function(_0x5aa092){if(_0x5df0d0[_0x53d5('0x7')][_0x20ef73]){return RpcUser[_0x53d5('0x22')](_0x5df0d0[_0x53d5('0x7')][_0x20ef73]['id'])[_0x53d5('0x21')](function(_0x59a1e1){if(_0x59a1e1&&!_0x59a1e1['voicePause']){logger[_0x53d5('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x159edc,_0x20ef73,_0xed78ae);var _0x1a87be=_0x5df0d0[_0x53d5('0x1a')][_0x159edc][_0x53d5('0x24')]&&_0x5df0d0[_0x53d5('0x1a')][_0x159edc][_0x53d5('0x25')]?_0x5df0d0[_0x53d5('0x1a')][_0x159edc]['destlinkedid']:_0x159edc;return RpcUser['savePause'](_0x5df0d0[_0x53d5('0x7')][_0x20ef73],_0x4367c4,_0x1a87be)['then'](function(_0x5a5d26){if(!_0x633154){_0x5df0d0['timers'][_0x20ef73]={};logger[_0x53d5('0x23')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x159edc,_0x5df0d0[_0x53d5('0x6')][_0xed78ae]['acwTimeout'],_0x20ef73,_0xed78ae);_0x5df0d0[_0x53d5('0x8')][_0x20ef73][_0x53d5('0x26')]=setTimeout(_0x5df0d0[_0x53d5('0x27')]['bind'](_0x5df0d0,_0x20ef73),_0x5df0d0['voiceQueues'][_0xed78ae]['acwTimeout']*0x3e8);_0x5df0d0[_0x53d5('0x8')][_0x20ef73][_0x53d5('0x28')]=moment()[_0x53d5('0x29')](_0x53d5('0x2a'));_0x5df0d0[_0x53d5('0x8')][_0x20ef73][_0x53d5('0x2b')]=_0x159edc;_0x5df0d0[_0x53d5('0x8')][_0x20ef73]['queue']=_0xed78ae;_0x5df0d0[_0x53d5('0x8')][_0x20ef73][_0x53d5('0x2c')]=function(){var _0x59cf25=getDiff(_0x5df0d0[_0x53d5('0x8')][_0x20ef73][_0x53d5('0x28')]);clearTimeout(_0x5df0d0[_0x53d5('0x8')][_0x20ef73][_0x53d5('0x26')]);_0x5df0d0[_0x53d5('0x8')][_0x20ef73][_0x53d5('0x26')]=![];RpcVoiceAgentReport[_0x53d5('0x2d')]({'acwtime':_0x59cf25},_0x5df0d0['timers'][_0x20ef73][_0x53d5('0x2b')],_0x20ef73)['then'](function(_0x218f11){logger[_0x53d5('0x23')](_0x53d5('0x2e'),_0x159edc,_0x59cf25,_0x218f11);})['catch'](function(_0x14fa81){logger['error'](_0x53d5('0x2f'),_0x159edc,_0x14fa81);});delete _0x5df0d0[_0x53d5('0x8')][_0x20ef73];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x159edc,_0x20ef73,_0xed78ae);}});}})[_0x53d5('0x30')](function(_0xd3cd4c){logger[_0x53d5('0x31')](_0x53d5('0x32'),_0x159edc,_0x5df0d0[_0x53d5('0x6')][_0xed78ae][_0x53d5('0x33')],_0x20ef73,_0xed78ae);})['finally'](function(){delete _0x5df0d0[_0x53d5('0x1a')][_0x159edc];});}catch(_0x4962a3){logger['error']('[ACW][START]\x20%s',_0x4962a3[_0x53d5('0x34')]);}};Acw[_0x53d5('0x17')][_0x53d5('0x27')]=function(_0x6e549e){try{var _0x29a201=this;if(_0x29a201[_0x53d5('0x8')][_0x6e549e]){_0x29a201[_0x53d5('0x8')][_0x6e549e]['timer']=![];var _0x372f6f=_0x29a201[_0x53d5('0x8')][_0x6e549e][_0x53d5('0x2b')];var _0x253ed8=_0x29a201[_0x53d5('0x8')][_0x6e549e]['queue'];var _0x14d869=_0x29a201[_0x53d5('0x6')][_0x253ed8]['acwTimeout'];logger[_0x53d5('0x23')](_0x53d5('0x35'),_0x372f6f,_0x6e549e);RpcUser['saveUnpause'](this[_0x53d5('0x7')][_0x6e549e]);RpcVoiceAgentReport[_0x53d5('0x2d')]({'acwtime':_0x14d869,'agentacw':!![]},_0x372f6f,_0x6e549e)[_0x53d5('0x21')](function(_0x128f35){logger['info'](_0x53d5('0x2e'),_0x372f6f,_0x14d869,_0x128f35);})[_0x53d5('0x30')](function(_0x3a8a0c){logger['error'](_0x53d5('0x2f'),_0x372f6f,_0x3a8a0c);});}else{logger['error'](_0x53d5('0x36'),_0x6e549e);if(_0x29a201[_0x53d5('0x8')]){logger[_0x53d5('0x23')](_0x53d5('0x37'),JSON[_0x53d5('0x38')](_0x29a201[_0x53d5('0x8')]));}}}catch(_0x4ec90b){logger[_0x53d5('0x31')](_0x53d5('0x39'),_0x4ec90b[_0x53d5('0x34')]);}};Acw['prototype']['syncAgentConnect']=function(_0x8a75cd){try{if(this[_0x53d5('0x6')][_0x8a75cd[_0x53d5('0x1b')]]&&(this[_0x53d5('0x6')][_0x8a75cd[_0x53d5('0x1b')]][_0x53d5('0x3')]||this[_0x53d5('0x6')][_0x8a75cd[_0x53d5('0x1b')]][_0x53d5('0x1c')])){if(this['agents'][_0x8a75cd[_0x53d5('0x19')]]){this['channels'][_0x8a75cd[_0x53d5('0x2b')]]={'queue':_0x8a75cd[_0x53d5('0x1b')],'interface':_0x8a75cd[_0x53d5('0x19')],'destlinkedid':_0x8a75cd['destlinkedid']};}}}catch(_0x3255f9){logger[_0x53d5('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x3255f9[_0x53d5('0x34')]);}};Acw[_0x53d5('0x17')][_0x53d5('0x14')]=function(_0xc3e7ac){try{if(this[_0x53d5('0x6')][_0xc3e7ac[_0x53d5('0x1b')]]&&(this[_0x53d5('0x6')][_0xc3e7ac[_0x53d5('0x1b')]][_0x53d5('0x3')]||this[_0x53d5('0x6')][_0xc3e7ac[_0x53d5('0x1b')]][_0x53d5('0x1c')])){if(this[_0x53d5('0x7')][_0xc3e7ac[_0x53d5('0x19')]]){this[_0x53d5('0x1a')][_0xc3e7ac[_0x53d5('0x2b')]]={'queue':_0xc3e7ac[_0x53d5('0x1b')],'interface':_0xc3e7ac[_0x53d5('0x19')]};}}}catch(_0x53e838){logger[_0x53d5('0x31')](_0x53d5('0x3a'),_0x53e838[_0x53d5('0x34')]);}};Acw[_0x53d5('0x17')][_0x53d5('0xc')]=function(_0x260e6c){try{if(this['channels'][_0x260e6c[_0x53d5('0x2b')]]&&_[_0x53d5('0x3b')](this[_0x53d5('0x1a')][_0x260e6c[_0x53d5('0x2b')]][_0x53d5('0x24')])){logger[_0x53d5('0x23')]('[%s][HANGUP:UNIQUEID]',_0x260e6c['uniqueid']);this['startAcw'](_0x260e6c['uniqueid']);}else if(this[_0x53d5('0x1a')][_0x260e6c[_0x53d5('0x3c')]]&&_[_0x53d5('0x3b')](this['channels'][_0x260e6c[_0x53d5('0x3c')]][_0x53d5('0x24')])){logger[_0x53d5('0x23')](_0x53d5('0x3d'),_0x260e6c[_0x53d5('0x3c')]);this[_0x53d5('0x18')](_0x260e6c['linkedid']);}}catch(_0x601d29){logger[_0x53d5('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x601d29[_0x53d5('0x34')]);}};Acw[_0x53d5('0x17')]['syncHangup']=function(_0x261110){try{if(this[_0x53d5('0x1a')][_0x261110[_0x53d5('0x2b')]]&&this[_0x53d5('0x1a')][_0x261110[_0x53d5('0x2b')]]['attended']){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x261110[_0x53d5('0x2b')]);this[_0x53d5('0x18')](_0x261110['uniqueid']);}else if(this[_0x53d5('0x1a')][_0x261110[_0x53d5('0x3c')]]&&this['channels'][_0x261110[_0x53d5('0x3c')]][_0x53d5('0x24')]){logger[_0x53d5('0x23')](_0x53d5('0x3e'),_0x261110[_0x53d5('0x3c')]);this[_0x53d5('0x18')](_0x261110[_0x53d5('0x3c')]);}}catch(_0x161619){logger[_0x53d5('0x31')]('[ACW][syncHangup]\x20%s',_0x161619[_0x53d5('0x34')]);}};Acw[_0x53d5('0x17')][_0x53d5('0x3f')]=function(_0x1c9243){try{if(!_[_0x53d5('0x40')](this[_0x53d5('0x1a')][_0x1c9243['transfereeuniqueid']])){this[_0x53d5('0x18')](_0x1c9243['transfereeuniqueid']);if(this[_0x53d5('0x1a')][_0x1c9243[_0x53d5('0x41')]]){this[_0x53d5('0x1a')][_0x1c9243[_0x53d5('0x41')]][_0x53d5('0x24')]=!![];this[_0x53d5('0x1a')][_0x1c9243[_0x53d5('0x42')]]=this['channels'][_0x1c9243[_0x53d5('0x41')]];delete this[_0x53d5('0x1a')][_0x1c9243['secondtransfereruniqueid']];}}else if(!_[_0x53d5('0x40')](this[_0x53d5('0x1a')][_0x1c9243[_0x53d5('0x42')]])){this[_0x53d5('0x18')](_0x1c9243[_0x53d5('0x42')]);if(this[_0x53d5('0x1a')][_0x1c9243['origtransfereruniqueid']]){this['channels'][_0x1c9243[_0x53d5('0x43')]][_0x53d5('0x24')]=!![];this[_0x53d5('0x1a')][_0x1c9243[_0x53d5('0x44')]]=this[_0x53d5('0x1a')][_0x1c9243['origtransfereruniqueid']];delete this[_0x53d5('0x1a')][_0x1c9243[_0x53d5('0x43')]];}}}catch(_0x268551){logger[_0x53d5('0x31')](_0x53d5('0x45'),_0x268551['message']);}};Acw[_0x53d5('0x17')][_0x53d5('0x46')]=function(_0x3c988c){try{if(this[_0x53d5('0x1a')][_0x3c988c[_0x53d5('0x47')]]){logger[_0x53d5('0x23')](_0x53d5('0x48'),JSON[_0x53d5('0x38')](_0x3c988c[_0x53d5('0x47')]));this[_0x53d5('0x18')](_0x3c988c['transfereruniqueid']);}else if(this[_0x53d5('0x1a')][_0x3c988c[_0x53d5('0x49')]]){logger['info'](_0x53d5('0x4a'),JSON[_0x53d5('0x38')](_0x3c988c[_0x53d5('0x49')]));this[_0x53d5('0x18')](_0x3c988c[_0x53d5('0x49')]);}}catch(_0x1b9069){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x1b9069[_0x53d5('0x34')]);}};Acw[_0x53d5('0x17')]['syncAgentRingNoAnswer']=function(_0x20980f){try{if(this['voiceQueues'][_0x20980f['queue']]&&this[_0x53d5('0x6')][_0x20980f[_0x53d5('0x1b')]][_0x53d5('0x4b')]===_0x53d5('0x4c')){if(this['agents'][_0x20980f['interface']]){logger['info'](_0x53d5('0x4d'),_0x20980f[_0x53d5('0x2b')],_0x20980f[_0x53d5('0x19')],_0x20980f['queue']);return RpcUser[_0x53d5('0x4e')](this['agents'][_0x20980f['interface']],_0x53d5('0x4f'),_0x20980f[_0x53d5('0x2b')]);}}}catch(_0xf38f5b){logger['error'](_0x53d5('0x50'),_0xf38f5b[_0x53d5('0x34')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 23b930e..80ce439 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 _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x20d9ab,_0x3c72d1){var _0x3a14c4=function(_0x167828){while(--_0x167828){_0x20d9ab['push'](_0x20d9ab['shift']());}};_0x3a14c4(++_0x3c72d1);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e9903,_0x3ec512){_0x3e9903=_0x3e9903-0x0;var _0xcab758=_0xb10b[_0x3e9903];return _0xcab758;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x4adc76,_0x14d07d){var _0x37fa4a=function(_0x70ad0d){while(--_0x70ad0d){_0x4adc76['push'](_0x4adc76['shift']());}};_0x37fa4a(++_0x14d07d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3cb09b,_0x31c2a5){_0x3cb09b=_0x3cb09b-0x0;var _0x242048=_0x0b0e[_0x3cb09b];return _0x242048;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 7b0473a..a053c61 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 _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x3dc1ce,_0x3e0071){var _0x380713=function(_0x5b7e89){while(--_0x5b7e89){_0x3dc1ce['push'](_0x3dc1ce['shift']());}};_0x380713(++_0x3e0071);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0xb7e7,0x121));var _0x7b7e=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xb7e7[_0x487b0c];return _0x1adbdc;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 9d7d12f..2e2fa9c 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 _0x42a1=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName'];(function(_0x35a779,_0x27f8fb){var _0xca723b=function(_0x298df7){while(--_0x298df7){_0x35a779['push'](_0x35a779['shift']());}};_0xca723b(++_0x27f8fb);}(_0x42a1,0x116));var _0x142a=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x42a1[_0x4bf96c];return _0x281d09;};'use strict';var util=require(_0x142a('0x0'));var _=require(_0x142a('0x1'));var moment=require(_0x142a('0x2'));function checkNameSurname(_0x21fc24,_0x3aad2e,_0x1ebe86){var _0x42e225='';if(!_[_0x142a('0x3')](_0x3aad2e)&&_0x142a('0x4')===typeof _0x3aad2e){_0x42e225+=_0x3aad2e;}if(!_[_0x142a('0x3')](_0x1ebe86)&&_0x142a('0x4')===typeof _0x1ebe86){_0x42e225+='\x20'+_0x1ebe86;}if(_0x42e225!==''){return _0x42e225;}return _0x21fc24;}function Action(_0x3425bf,_0x9f1b12,_0x20be90){this[_0x142a('0x5')]=_0x3425bf;this[_0x142a('0x6')]=_0x20be90||undefined;this[_0x142a('0x7')]=checkNameSurname(_0x9f1b12['Contact'][_0x142a('0x8')],_0x9f1b12[_0x142a('0x9')][_0x142a('0xa')],_0x9f1b12['Contact'][_0x142a('0xb')]);this[_0x142a('0xc')]=_0x9f1b12['phone'];this['queue']=_0x3425bf[_0x142a('0x7')];this[_0x142a('0xd')]=_0x9f1b12['active']||![];this[_0x142a('0xe')]=_0x3425bf[_0x142a('0xe')];this['dialQueueTimeout']=_0x3425bf[_0x142a('0xf')]||0x3;this[_0x142a('0x10')]=_0x9f1b12['scheduledat'];this[_0x142a('0x11')]=_0x9f1b12[_0x142a('0x11')];this['countcongestionretry']=_0x9f1b12['countcongestionretry'];this[_0x142a('0x12')]=_0x9f1b12[_0x142a('0x12')];this[_0x142a('0x13')]=_0x9f1b12[_0x142a('0x13')];this['countdropretry']=_0x9f1b12[_0x142a('0x14')];this[_0x142a('0x15')]=_0x9f1b12[_0x142a('0x15')];this[_0x142a('0x16')]=_0x9f1b12[_0x142a('0x16')];this[_0x142a('0x17')]=_0x9f1b12[_0x142a('0x17')];this[_0x142a('0x18')]=_0x9f1b12[_0x142a('0x18')];this[_0x142a('0x19')]=_0x9f1b12[_0x142a('0x19')];this[_0x142a('0x1a')]=_0x9f1b12[_0x142a('0x1a')];this[_0x142a('0x1b')]=_0x9f1b12[_0x142a('0x1b')];this['CampaignId']=_0x9f1b12['CampaignId'];this[_0x142a('0x1c')]=_0x9f1b12['id'];this[_0x142a('0x1d')]=_0x9f1b12['Contact'][_0x142a('0xa')]||'';this[_0x142a('0x1e')]=moment()[_0x142a('0x1f')](_0x142a('0x20'));this[_0x142a('0x21')]=_0x9f1b12['callback'];this[_0x142a('0x22')]=_0x9f1b12[_0x142a('0x22')];this[_0x142a('0x23')]=_0x9f1b12['callbackat'];this[_0x142a('0x24')]=_0x9f1b12['recallme'];this[_0x142a('0x25')]='';this['originatecalleridname']='';}Action[_0x142a('0x26')][_0x142a('0x27')]=function(){return util[_0x142a('0x1f')](_0x142a('0x28'),this[_0x142a('0x7')],this[_0x142a('0x5')]['dialCutDigit']>0x0?this['number']['substring'](this['voiceQueue'][_0x142a('0x29')]):this['number']);};Action[_0x142a('0x26')]['getQueue']=function(){return this[_0x142a('0x2a')];};module[_0x142a('0x2b')]=Action; \ No newline at end of file +var _0x419c=['exports','lodash','isNil','string','voiceQueue','Contact','phone','firstName','lastName','number','queue','name','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','substring','dialCutDigit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x419c,0xeb));var _0xc419=function(_0x321327,_0x4965b){_0x321327=_0x321327-0x0;var _0x33be38=_0x419c[_0x321327];return _0x33be38;};'use strict';var util=require('util');var _=require(_0xc419('0x0'));var moment=require('moment');function checkNameSurname(_0x57aea0,_0x2dcc43,_0x26e95c){var _0x27e179='';if(!_[_0xc419('0x1')](_0x2dcc43)&&_0xc419('0x2')===typeof _0x2dcc43){_0x27e179+=_0x2dcc43;}if(!_[_0xc419('0x1')](_0x26e95c)&&'string'===typeof _0x26e95c){_0x27e179+='\x20'+_0x26e95c;}if(_0x27e179!==''){return _0x27e179;}return _0x57aea0;}function Action(_0x40c8cc,_0x40de4b,_0x5a2ebd){this[_0xc419('0x3')]=_0x40c8cc;this['uniqueid']=_0x5a2ebd||undefined;this['name']=checkNameSurname(_0x40de4b[_0xc419('0x4')][_0xc419('0x5')],_0x40de4b[_0xc419('0x4')][_0xc419('0x6')],_0x40de4b[_0xc419('0x4')][_0xc419('0x7')]);this[_0xc419('0x8')]=_0x40de4b[_0xc419('0x5')];this[_0xc419('0x9')]=_0x40c8cc[_0xc419('0xa')];this[_0xc419('0xb')]=_0x40de4b[_0xc419('0xb')]||![];this[_0xc419('0xc')]=_0x40c8cc['type'];this['dialQueueTimeout']=_0x40c8cc['dialQueueTimeout']||0x3;this[_0xc419('0xd')]=_0x40de4b['scheduledat'];this[_0xc419('0xe')]=_0x40de4b[_0xc419('0xe')];this[_0xc419('0xf')]=_0x40de4b[_0xc419('0xf')];this['countnoanswerretry']=_0x40de4b[_0xc419('0x10')];this[_0xc419('0x11')]=_0x40de4b[_0xc419('0x11')];this['countdropretry']=_0x40de4b[_0xc419('0x12')];this[_0xc419('0x13')]=_0x40de4b['countabandonedretry'];this[_0xc419('0x14')]=_0x40de4b[_0xc419('0x14')];this['countagentrejectretry']=_0x40de4b[_0xc419('0x15')];this[_0xc419('0x16')]=_0x40de4b['ContactId'];this[_0xc419('0x17')]=_0x40de4b[_0xc419('0x17')];this[_0xc419('0x18')]=_0x40de4b[_0xc419('0x18')];this[_0xc419('0x19')]=_0x40de4b[_0xc419('0x19')];this[_0xc419('0x1a')]=_0x40de4b[_0xc419('0x1a')];this['idHopper']=_0x40de4b['id'];this[_0xc419('0x1b')]=_0x40de4b[_0xc419('0x4')][_0xc419('0x6')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xc419('0x1c')]=_0x40de4b['callback'];this[_0xc419('0x1d')]=_0x40de4b[_0xc419('0x1d')];this[_0xc419('0x1e')]=_0x40de4b[_0xc419('0x1e')];this['recallme']=_0x40de4b[_0xc419('0x1f')];this[_0xc419('0x20')]='';this[_0xc419('0x21')]='';}Action[_0xc419('0x22')][_0xc419('0x23')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['name'],this[_0xc419('0x3')]['dialCutDigit']>0x0?this[_0xc419('0x8')][_0xc419('0x24')](this[_0xc419('0x3')][_0xc419('0x25')]):this['number']);};Action['prototype']['getQueue']=function(){return this[_0xc419('0x9')];};module[_0xc419('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index de2341a..61454a1 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 _0x21d8=['calleridname','name','number','starttime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','responsetime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0x21d8,0xed));var _0x821d=function(_0x22ae96,_0x2f7dc5){_0x22ae96=_0x22ae96-0x0;var _0x5d1d7a=_0x21d8[_0x22ae96];return _0x5d1d7a;};'use strict';var util=require(_0x821d('0x0'));var _=require(_0x821d('0x1'));var moment=require(_0x821d('0x2'));function getSeconds(_0x5c0a1a,_0x30daee){var _0x16e6c6=moment(_0x5c0a1a)[_0x821d('0x3')](0x0);var _0x1c1239=moment(_0x30daee)[_0x821d('0x3')](0x0);return _0x16e6c6['diff'](_0x1c1239,_0x821d('0x4'));}function AgentComplete(_0x5beb2d,_0x56e937){this['state']=0x4;this[_0x821d('0x5')]='Answer';this[_0x821d('0x6')]=_0x5beb2d['scheduledat'];this[_0x821d('0x7')]=_0x5beb2d[_0x821d('0x7')];this[_0x821d('0x8')]=_0x5beb2d[_0x821d('0x7')]===_0x821d('0x9')?_0x821d('0xa'):_0x5beb2d[_0x821d('0x7')];this[_0x821d('0xb')]=_0x5beb2d[_0x821d('0xb')];this[_0x821d('0xc')]=_0x5beb2d['countcongestionretry'];this[_0x821d('0xd')]=_0x5beb2d[_0x821d('0xd')];this[_0x821d('0xe')]=_0x5beb2d['countbusyretry']+_0x5beb2d[_0x821d('0xc')]+_0x5beb2d[_0x821d('0xd')]+_0x5beb2d['countnosuchnumberretry']+_0x5beb2d[_0x821d('0xf')]+_0x5beb2d[_0x821d('0x10')]+_0x5beb2d[_0x821d('0x11')]+_0x5beb2d[_0x821d('0x12')];this[_0x821d('0x13')]=_0x5beb2d[_0x821d('0x13')];this[_0x821d('0xf')]=_0x5beb2d['countdropretry'];this[_0x821d('0x10')]=_0x5beb2d[_0x821d('0x10')];this[_0x821d('0x11')]=_0x5beb2d[_0x821d('0x11')];this[_0x821d('0x12')]=_0x5beb2d[_0x821d('0x12')];this[_0x821d('0x14')]=_0x56e937[_0x821d('0x14')];this[_0x821d('0x15')]=_0x5beb2d[_0x821d('0x16')];this['calleridnum']=_0x5beb2d[_0x821d('0x17')];this[_0x821d('0x18')]=_0x5beb2d[_0x821d('0x18')];this['responsetime']=_0x5beb2d['responsetime'];this['answertime']=_0x5beb2d[_0x821d('0x19')];this[_0x821d('0x1a')]=moment()['format'](_0x821d('0x1b'));this['ringtime']=getSeconds(_0x5beb2d['responsetime'],_0x5beb2d[_0x821d('0x18')]);this[_0x821d('0x1c')]=getSeconds(_0x5beb2d[_0x821d('0x19')],_0x5beb2d[_0x821d('0x1d')]);this['talktime']=getSeconds(this[_0x821d('0x1a')],_0x5beb2d[_0x821d('0x19')]);this[_0x821d('0xa')]=_0x56e937[_0x821d('0xa')];this['membername']=_0x56e937['membername'];this[_0x821d('0x1e')]=_0x56e937[_0x821d('0x1e')];this[_0x821d('0x1f')]=_0x5beb2d[_0x821d('0x1f')];this[_0x821d('0x20')]=_0x5beb2d[_0x821d('0x20')];this[_0x821d('0x21')]=_0x5beb2d[_0x821d('0x21')];this[_0x821d('0x22')]=_0x5beb2d[_0x821d('0x22')];this[_0x821d('0x23')]=_0x5beb2d[_0x821d('0x23')];this['ListId']=_0x5beb2d[_0x821d('0x24')];this[_0x821d('0x25')]=_0x5beb2d[_0x821d('0x25')];this[_0x821d('0x26')]=_0x5beb2d[_0x821d('0x26')];this[_0x821d('0x27')]=_0x5beb2d[_0x821d('0x27')];this[_0x821d('0x28')]=_0x5beb2d[_0x821d('0x28')]||'';this[_0x821d('0x29')]=_0x5beb2d[_0x821d('0x29')]||'';}module[_0x821d('0x2a')]=AgentComplete; \ No newline at end of file +var _0x74f7=['outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','state','Answer','scheduledat','type','campaigntype'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x74f7,0xa7));var _0x774f=function(_0x376ae1,_0x3cdcb9){_0x376ae1=_0x376ae1-0x0;var _0x5a41c3=_0x74f7[_0x376ae1];return _0x5a41c3;};'use strict';var util=require(_0x774f('0x0'));var _=require(_0x774f('0x1'));var moment=require(_0x774f('0x2'));function getSeconds(_0x190d5f,_0x4caca3){var _0x34cb04=moment(_0x190d5f)['milliseconds'](0x0);var _0x2d7408=moment(_0x4caca3)[_0x774f('0x3')](0x0);return _0x34cb04['diff'](_0x2d7408,'seconds');}function AgentComplete(_0x1aa694,_0x358ed0){this[_0x774f('0x4')]=0x4;this['statedesc']=_0x774f('0x5');this[_0x774f('0x6')]=_0x1aa694['scheduledat'];this[_0x774f('0x7')]=_0x1aa694[_0x774f('0x7')];this[_0x774f('0x8')]=_0x1aa694[_0x774f('0x7')]===_0x774f('0x9')?_0x774f('0xa'):_0x1aa694[_0x774f('0x7')];this['countbusyretry']=_0x1aa694[_0x774f('0xb')];this[_0x774f('0xc')]=_0x1aa694[_0x774f('0xc')];this['countnoanswerretry']=_0x1aa694['countnoanswerretry'];this[_0x774f('0xd')]=_0x1aa694['countbusyretry']+_0x1aa694['countcongestionretry']+_0x1aa694[_0x774f('0xe')]+_0x1aa694['countnosuchnumberretry']+_0x1aa694[_0x774f('0xf')]+_0x1aa694[_0x774f('0x10')]+_0x1aa694[_0x774f('0x11')]+_0x1aa694[_0x774f('0x12')];this['countnosuchnumberretry']=_0x1aa694[_0x774f('0x13')];this[_0x774f('0xf')]=_0x1aa694['countdropretry'];this[_0x774f('0x10')]=_0x1aa694[_0x774f('0x10')];this[_0x774f('0x11')]=_0x1aa694[_0x774f('0x11')];this[_0x774f('0x12')]=_0x1aa694['countagentrejectretry'];this['uniqueid']=_0x358ed0[_0x774f('0x14')];this['calleridname']=_0x1aa694[_0x774f('0x15')];this[_0x774f('0x16')]=_0x1aa694[_0x774f('0x17')];this[_0x774f('0x18')]=_0x1aa694[_0x774f('0x18')];this[_0x774f('0x19')]=_0x1aa694[_0x774f('0x19')];this[_0x774f('0x1a')]=_0x1aa694[_0x774f('0x1a')];this[_0x774f('0x1b')]=moment()[_0x774f('0x1c')](_0x774f('0x1d'));this[_0x774f('0x1e')]=getSeconds(_0x1aa694[_0x774f('0x19')],_0x1aa694[_0x774f('0x18')]);this['holdtime']=getSeconds(_0x1aa694[_0x774f('0x1a')],_0x1aa694[_0x774f('0x19')]);this['talktime']=getSeconds(this[_0x774f('0x1b')],_0x1aa694[_0x774f('0x1a')]);this[_0x774f('0xa')]=_0x358ed0[_0x774f('0xa')];this['membername']=_0x358ed0[_0x774f('0x1f')];this['reason']=_0x358ed0[_0x774f('0x20')];this[_0x774f('0x21')]=_0x1aa694['callback'];this[_0x774f('0x22')]=_0x1aa694['callbackuniqueid'];this['callbackat']=_0x1aa694[_0x774f('0x23')];this[_0x774f('0x24')]=_0x1aa694['recallme'];this[_0x774f('0x25')]=_0x1aa694['ContactId'];this['ListId']=_0x1aa694[_0x774f('0x26')];this[_0x774f('0x27')]=_0x1aa694[_0x774f('0x27')];this['VoiceQueueId']=_0x1aa694['VoiceQueueId'];this[_0x774f('0x28')]=_0x1aa694['CampaignId'];this[_0x774f('0x29')]=_0x1aa694[_0x774f('0x29')]||'';this[_0x774f('0x2a')]=_0x1aa694[_0x774f('0x2a')]||'';}module[_0x774f('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index dce54c9..12a1ee3 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 _0xfd0f=['countagentrejectretry','countmachineretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x33ba38,_0x5e2d21){_0x33ba38=_0x33ba38-0x0;var _0x22e73d=_0xfd0f[_0x33ba38];return _0x22e73d;};'use strict';var util=require(_0xffd0('0x0'));var _=require(_0xffd0('0x1'));var moment=require('moment');function getSeconds(_0x568847,_0x28aea8){var _0xe1219f=moment(_0x568847)['milliseconds'](0x0);var _0x33e4d8=moment(_0x28aea8)['milliseconds'](0x0);return _0xe1219f[_0xffd0('0x2')](_0x33e4d8,_0xffd0('0x3'));}function Final(_0x3501fc){this[_0xffd0('0x4')]=_0x3501fc[_0xffd0('0x4')];this[_0xffd0('0x5')]=_0x3501fc[_0xffd0('0x5')];this[_0xffd0('0x6')]=_0x3501fc[_0xffd0('0x6')];this['campaigntype']=_0x3501fc[_0xffd0('0x6')]===_0xffd0('0x7')?_0xffd0('0x8'):_0x3501fc[_0xffd0('0x6')];this['countbusyretry']=_0x3501fc['countbusyretry'];this[_0xffd0('0x9')]=_0x3501fc[_0xffd0('0x9')];this[_0xffd0('0xa')]=_0x3501fc['countnoanswerretry'];this['countglobal']=_0x3501fc[_0xffd0('0xb')]+_0x3501fc[_0xffd0('0x9')]+_0x3501fc['countnoanswerretry']+_0x3501fc[_0xffd0('0xc')]+_0x3501fc[_0xffd0('0xd')]+_0x3501fc[_0xffd0('0xe')]+_0x3501fc['countmachineretry']+_0x3501fc[_0xffd0('0xf')];this[_0xffd0('0xc')]=_0x3501fc['countnosuchnumberretry'];this[_0xffd0('0xd')]=_0x3501fc['countdropretry'];this['countabandonedretry']=_0x3501fc[_0xffd0('0xe')];this['countmachineretry']=_0x3501fc[_0xffd0('0x10')];this[_0xffd0('0xf')]=_0x3501fc[_0xffd0('0xf')];this[_0xffd0('0x8')]=_0x3501fc[_0xffd0('0x8')];this['calleridname']=_0x3501fc['calleridname'];this[_0xffd0('0x11')]=_0x3501fc[_0xffd0('0x11')];this[_0xffd0('0x12')]=_0x3501fc[_0xffd0('0x12')];this[_0xffd0('0x13')]=_0x3501fc[_0xffd0('0x13')];this[_0xffd0('0x14')]=_0x3501fc[_0xffd0('0x13')];this[_0xffd0('0x15')]=_0x3501fc[_0xffd0('0x15')]||0x0;this[_0xffd0('0x16')]=_0x3501fc[_0xffd0('0x16')]||0x0;this[_0xffd0('0x17')]=_0x3501fc[_0xffd0('0x17')]||0x0;this[_0xffd0('0x18')]=_0x3501fc[_0xffd0('0x18')];this['callbackuniqueid']=_0x3501fc['callbackuniqueid'];this[_0xffd0('0x19')]=_0x3501fc[_0xffd0('0x19')];this[_0xffd0('0x1a')]=_0x3501fc['recallme'];this[_0xffd0('0x1b')]=_0x3501fc['ContactId'];this[_0xffd0('0x1c')]=_0x3501fc[_0xffd0('0x1c')];this[_0xffd0('0x1d')]=_0x3501fc[_0xffd0('0x1d')];this[_0xffd0('0x1e')]=_0x3501fc[_0xffd0('0x1e')];this[_0xffd0('0x1f')]=_0x3501fc[_0xffd0('0x1f')];this[_0xffd0('0x20')]=_0x3501fc[_0xffd0('0x20')]||'';this[_0xffd0('0x21')]=_0x3501fc[_0xffd0('0x21')]||'';}module[_0xffd0('0x22')]=Final; \ No newline at end of file +var _0xb138=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','queue','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackat'];(function(_0x251b30,_0x403a51){var _0x289ac6=function(_0xff543e){while(--_0xff543e){_0x251b30['push'](_0x251b30['shift']());}};_0x289ac6(++_0x403a51);}(_0xb138,0x1dd));var _0x8b13=function(_0x736af4,_0x150a75){_0x736af4=_0x736af4-0x0;var _0x318cce=_0xb138[_0x736af4];return _0x318cce;};'use strict';var util=require(_0x8b13('0x0'));var _=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));function getSeconds(_0x33f214,_0xadad70){var _0x185752=moment(_0x33f214)[_0x8b13('0x3')](0x0);var _0x5369d4=moment(_0xadad70)[_0x8b13('0x3')](0x0);return _0x185752[_0x8b13('0x4')](_0x5369d4,_0x8b13('0x5'));}function Final(_0x5ae5b2){this[_0x8b13('0x6')]=_0x5ae5b2[_0x8b13('0x6')];this['scheduledat']=_0x5ae5b2[_0x8b13('0x7')];this[_0x8b13('0x8')]=_0x5ae5b2[_0x8b13('0x8')];this['campaigntype']=_0x5ae5b2[_0x8b13('0x8')]===_0x8b13('0x9')?'queue':_0x5ae5b2['type'];this[_0x8b13('0xa')]=_0x5ae5b2[_0x8b13('0xa')];this[_0x8b13('0xb')]=_0x5ae5b2[_0x8b13('0xb')];this[_0x8b13('0xc')]=_0x5ae5b2['countnoanswerretry'];this[_0x8b13('0xd')]=_0x5ae5b2[_0x8b13('0xa')]+_0x5ae5b2[_0x8b13('0xb')]+_0x5ae5b2[_0x8b13('0xc')]+_0x5ae5b2[_0x8b13('0xe')]+_0x5ae5b2[_0x8b13('0xf')]+_0x5ae5b2['countabandonedretry']+_0x5ae5b2['countmachineretry']+_0x5ae5b2[_0x8b13('0x10')];this[_0x8b13('0xe')]=_0x5ae5b2['countnosuchnumberretry'];this['countdropretry']=_0x5ae5b2['countdropretry'];this[_0x8b13('0x11')]=_0x5ae5b2[_0x8b13('0x11')];this[_0x8b13('0x12')]=_0x5ae5b2[_0x8b13('0x12')];this[_0x8b13('0x10')]=_0x5ae5b2['countagentrejectretry'];this[_0x8b13('0x13')]=_0x5ae5b2[_0x8b13('0x13')];this[_0x8b13('0x14')]=_0x5ae5b2[_0x8b13('0x14')];this[_0x8b13('0x15')]=_0x5ae5b2[_0x8b13('0x15')];this[_0x8b13('0x16')]=_0x5ae5b2[_0x8b13('0x16')];this['responsetime']=_0x5ae5b2['responsetime'];this[_0x8b13('0x17')]=_0x5ae5b2[_0x8b13('0x18')];this[_0x8b13('0x19')]=_0x5ae5b2[_0x8b13('0x19')]||0x0;this[_0x8b13('0x1a')]=_0x5ae5b2[_0x8b13('0x1a')]||0x0;this['talktime']=_0x5ae5b2[_0x8b13('0x1b')]||0x0;this[_0x8b13('0x1c')]=_0x5ae5b2[_0x8b13('0x1c')];this['callbackuniqueid']=_0x5ae5b2['callbackuniqueid'];this[_0x8b13('0x1d')]=_0x5ae5b2[_0x8b13('0x1d')];this['recallme']=_0x5ae5b2[_0x8b13('0x1e')];this[_0x8b13('0x1f')]=_0x5ae5b2[_0x8b13('0x1f')];this[_0x8b13('0x20')]=_0x5ae5b2[_0x8b13('0x20')];this['UserId']=_0x5ae5b2[_0x8b13('0x21')];this[_0x8b13('0x22')]=_0x5ae5b2['VoiceQueueId'];this[_0x8b13('0x23')]=_0x5ae5b2['CampaignId'];this[_0x8b13('0x24')]=_0x5ae5b2[_0x8b13('0x24')]||'';this['originatecalleridname']=_0x5ae5b2[_0x8b13('0x25')]||'';}module[_0x8b13('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 524e650..5be5d52 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 _0xd712=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime'];(function(_0x2486b8,_0x3b819c){var _0x44b2be=function(_0x482386){while(--_0x482386){_0x2486b8['push'](_0x2486b8['shift']());}};_0x44b2be(++_0x3b819c);}(_0xd712,0x6b));var _0x2d71=function(_0xdc7581,_0x10270f){_0xdc7581=_0xdc7581-0x0;var _0x12e586=_0xd712[_0xdc7581];return _0x12e586;};'use strict';var util=require(_0x2d71('0x0'));var _=require(_0x2d71('0x1'));var moment=require('moment');function getSeconds(_0x3d441a,_0x4bf7b8){var _0x3d285c=moment(_0x3d441a)[_0x2d71('0x2')](0x0);var _0x2cb8a2=moment(_0x4bf7b8)[_0x2d71('0x2')](0x0);return _0x3d285c[_0x2d71('0x3')](_0x2cb8a2,_0x2d71('0x4'));}function Hangup(_0x1e6483,_0x38c51a){this['state']=0x4;this[_0x2d71('0x5')]=_0x2d71('0x6');this[_0x2d71('0x7')]=_0x1e6483[_0x2d71('0x7')];this['type']=_0x1e6483[_0x2d71('0x8')];this['campaigntype']=_0x1e6483[_0x2d71('0x8')]===_0x2d71('0x9')?_0x2d71('0xa'):_0x1e6483[_0x2d71('0x8')];this[_0x2d71('0xb')]=_0x1e6483[_0x2d71('0xb')];this[_0x2d71('0xc')]=_0x1e6483[_0x2d71('0xc')];this[_0x2d71('0xd')]=_0x1e6483[_0x2d71('0xd')];this[_0x2d71('0xe')]=_0x1e6483['countbusyretry']+_0x1e6483[_0x2d71('0xc')]+_0x1e6483['countnoanswerretry']+_0x1e6483[_0x2d71('0xf')]+_0x1e6483['countdropretry']+_0x1e6483['countabandonedretry']+_0x1e6483[_0x2d71('0x10')]+_0x1e6483[_0x2d71('0x11')];this['countnosuchnumberretry']=_0x1e6483['countnosuchnumberretry'];this['countdropretry']=_0x1e6483[_0x2d71('0x12')];this[_0x2d71('0x13')]=_0x1e6483[_0x2d71('0x13')];this[_0x2d71('0x10')]=_0x1e6483['countmachineretry'];this['countagentrejectretry']=_0x1e6483[_0x2d71('0x11')];this[_0x2d71('0x14')]=_0x38c51a[_0x2d71('0x14')];this[_0x2d71('0x15')]=_0x1e6483[_0x2d71('0x16')];this[_0x2d71('0x17')]=_0x1e6483[_0x2d71('0x18')];this[_0x2d71('0x19')]=_0x1e6483[_0x2d71('0x19')];this[_0x2d71('0x1a')]=_0x1e6483[_0x2d71('0x1a')];this[_0x2d71('0x1b')]=moment()[_0x2d71('0x1c')](_0x2d71('0x1d'));this[_0x2d71('0x1e')]=getSeconds(_0x1e6483[_0x2d71('0x1a')],_0x1e6483['starttime']);this[_0x2d71('0x1f')]=0x0;this[_0x2d71('0x20')]=getSeconds(this['endtime'],_0x1e6483[_0x2d71('0x1a')]);this[_0x2d71('0xa')]=_0x1e6483[_0x2d71('0xa')];this['membername']=_0x2d71('0x21');this[_0x2d71('0x22')]=_0x38c51a[_0x2d71('0x23')];this[_0x2d71('0x24')]=_0x1e6483['callback'];this[_0x2d71('0x25')]=_0x1e6483['callbackuniqueid'];this[_0x2d71('0x26')]=_0x1e6483[_0x2d71('0x26')];this[_0x2d71('0x27')]=_0x1e6483[_0x2d71('0x27')];this[_0x2d71('0x28')]=_0x1e6483['ContactId'];this[_0x2d71('0x29')]=_0x1e6483['ListId'];this['UserId']=_0x1e6483[_0x2d71('0x2a')];this['VoiceQueueId']=_0x1e6483[_0x2d71('0x2b')];this[_0x2d71('0x2c')]=_0x1e6483[_0x2d71('0x2c')];}module['exports']=Hangup; \ No newline at end of file +var _0x3786=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','recallme','ListId','UserId','VoiceQueueId','CampaignId','lodash','moment','milliseconds','diff','seconds','state','statedesc','type','campaigntype','outbound'];(function(_0x4641e0,_0x1ec693){var _0x545798=function(_0x58102e){while(--_0x58102e){_0x4641e0['push'](_0x4641e0['shift']());}};_0x545798(++_0x1ec693);}(_0x3786,0xe0));var _0x6378=function(_0x519cf4,_0x519f12){_0x519cf4=_0x519cf4-0x0;var _0x9947e1=_0x3786[_0x519cf4];return _0x9947e1;};'use strict';var util=require('util');var _=require(_0x6378('0x0'));var moment=require(_0x6378('0x1'));function getSeconds(_0x2650be,_0x3ba61f){var _0x4be0d3=moment(_0x2650be)[_0x6378('0x2')](0x0);var _0x12bb83=moment(_0x3ba61f)['milliseconds'](0x0);return _0x4be0d3[_0x6378('0x3')](_0x12bb83,_0x6378('0x4'));}function Hangup(_0xaa0554,_0x516ba2){this[_0x6378('0x5')]=0x4;this[_0x6378('0x6')]='Answer';this['scheduledat']=_0xaa0554['scheduledat'];this[_0x6378('0x7')]=_0xaa0554['type'];this[_0x6378('0x8')]=_0xaa0554['type']===_0x6378('0x9')?_0x6378('0xa'):_0xaa0554[_0x6378('0x7')];this[_0x6378('0xb')]=_0xaa0554[_0x6378('0xb')];this[_0x6378('0xc')]=_0xaa0554[_0x6378('0xc')];this[_0x6378('0xd')]=_0xaa0554['countnoanswerretry'];this['countglobal']=_0xaa0554[_0x6378('0xb')]+_0xaa0554['countcongestionretry']+_0xaa0554['countnoanswerretry']+_0xaa0554[_0x6378('0xe')]+_0xaa0554['countdropretry']+_0xaa0554[_0x6378('0xf')]+_0xaa0554[_0x6378('0x10')]+_0xaa0554[_0x6378('0x11')];this[_0x6378('0xe')]=_0xaa0554[_0x6378('0xe')];this[_0x6378('0x12')]=_0xaa0554['countdropretry'];this[_0x6378('0xf')]=_0xaa0554[_0x6378('0xf')];this['countmachineretry']=_0xaa0554[_0x6378('0x10')];this[_0x6378('0x11')]=_0xaa0554[_0x6378('0x11')];this[_0x6378('0x13')]=_0x516ba2[_0x6378('0x13')];this['calleridname']=_0xaa0554[_0x6378('0x14')];this[_0x6378('0x15')]=_0xaa0554[_0x6378('0x16')];this[_0x6378('0x17')]=_0xaa0554[_0x6378('0x17')];this[_0x6378('0x18')]=_0xaa0554[_0x6378('0x18')];this[_0x6378('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6378('0x1a')]=getSeconds(_0xaa0554[_0x6378('0x18')],_0xaa0554[_0x6378('0x17')]);this[_0x6378('0x1b')]=0x0;this['talktime']=getSeconds(this[_0x6378('0x19')],_0xaa0554[_0x6378('0x18')]);this['queue']=_0xaa0554[_0x6378('0xa')];this[_0x6378('0x1c')]=_0x6378('0x1d');this[_0x6378('0x1e')]=_0x516ba2[_0x6378('0x1f')];this[_0x6378('0x20')]=_0xaa0554[_0x6378('0x20')];this[_0x6378('0x21')]=_0xaa0554[_0x6378('0x21')];this['callbackat']=_0xaa0554['callbackat'];this[_0x6378('0x22')]=_0xaa0554[_0x6378('0x22')];this['ContactId']=_0xaa0554['ContactId'];this['ListId']=_0xaa0554[_0x6378('0x23')];this[_0x6378('0x24')]=_0xaa0554[_0x6378('0x24')];this[_0x6378('0x25')]=_0xaa0554[_0x6378('0x25')];this[_0x6378('0x26')]=_0xaa0554[_0x6378('0x26')];}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 78f1926..a639daa 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 _0xd64b=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x382a1c,_0x99b604){var _0x5f517d=function(_0x25418c){while(--_0x25418c){_0x382a1c['push'](_0x382a1c['shift']());}};_0x5f517d(++_0x99b604);}(_0xd64b,0xc1));var _0xbd64=function(_0x495c53,_0x5dd58b){_0x495c53=_0x495c53-0x0;var _0x20abe0=_0xd64b[_0x495c53];return _0x20abe0;};'use strict';var util=require(_0xbd64('0x0'));var _=require('lodash');var moment=require(_0xbd64('0x1'));function getSeconds(_0x4bfb7c,_0x30b9b3){var _0xcbecd5=moment(_0x4bfb7c)[_0xbd64('0x2')](0x0);var _0x3f1f05=moment(_0x30b9b3)[_0xbd64('0x2')](0x0);return _0xcbecd5['diff'](_0x3f1f05,'seconds');}function History(_0x54f916){this['uniqueid']=_0x54f916[_0xbd64('0x3')];this[_0xbd64('0x4')]=_0x54f916[_0xbd64('0x4')]||undefined;this[_0xbd64('0x5')]=_0x54f916[_0xbd64('0x5')];this[_0xbd64('0x6')]=_0x54f916[_0xbd64('0x5')]==='outbound'?'queue':_0x54f916[_0xbd64('0x5')];this[_0xbd64('0x7')]=_0x54f916[_0xbd64('0x7')];this['countcongestionretry']=_0x54f916[_0xbd64('0x8')];this[_0xbd64('0x9')]=_0x54f916[_0xbd64('0x9')];this[_0xbd64('0xa')]=_0x54f916['countbusyretry']+_0x54f916[_0xbd64('0x8')]+_0x54f916['countnoanswerretry']+_0x54f916[_0xbd64('0xb')]+_0x54f916[_0xbd64('0xc')]+_0x54f916[_0xbd64('0xd')]+_0x54f916[_0xbd64('0xe')]+_0x54f916[_0xbd64('0xf')];this[_0xbd64('0xb')]=_0x54f916[_0xbd64('0xb')];this[_0xbd64('0xc')]=_0x54f916[_0xbd64('0xc')];this['countabandonedretry']=_0x54f916[_0xbd64('0xd')];this[_0xbd64('0xe')]=_0x54f916[_0xbd64('0xe')];this[_0xbd64('0xf')]=_0x54f916[_0xbd64('0xf')];this['queue']=_0x54f916[_0xbd64('0x10')];this['calleridname']=_0x54f916[_0xbd64('0x11')];this[_0xbd64('0x12')]=_0x54f916[_0xbd64('0x13')];this[_0xbd64('0x14')]=_0x54f916[_0xbd64('0x14')];this[_0xbd64('0x15')]=_0x54f916[_0xbd64('0x15')];this[_0xbd64('0x16')]=_0x54f916['responsetime'];this[_0xbd64('0x17')]=getSeconds(_0x54f916[_0xbd64('0x15')],_0x54f916['starttime']);this['holdtime']=0x0;this[_0xbd64('0x18')]=0x0;this[_0xbd64('0x19')]=_0x54f916[_0xbd64('0x19')];this[_0xbd64('0x1a')]=_0x54f916[_0xbd64('0x1a')];this[_0xbd64('0x1b')]=_0x54f916['callbackat'];this['recallme']=_0x54f916[_0xbd64('0x1c')];this[_0xbd64('0x1d')]=_0x54f916[_0xbd64('0x1d')];this[_0xbd64('0x1e')]=_0x54f916['ListId'];this['UserId']=_0x54f916[_0xbd64('0x1f')];this['VoiceQueueId']=_0x54f916[_0xbd64('0x20')];this['CampaignId']=_0x54f916[_0xbd64('0x21')];this[_0xbd64('0x22')]=_0x54f916[_0xbd64('0x22')]||'';this[_0xbd64('0x23')]=_0x54f916['originatecalleridname']||'';}module[_0xbd64('0x24')]=History; \ No newline at end of file +var _0x24ea=['talktime','callback','callbackuniqueid','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','endtime','holdtime'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x24ea,0x1b8));var _0xa24e=function(_0x351af1,_0x2770f7){_0x351af1=_0x351af1-0x0;var _0x2aaafd=_0x24ea[_0x351af1];return _0x2aaafd;};'use strict';var util=require(_0xa24e('0x0'));var _=require(_0xa24e('0x1'));var moment=require(_0xa24e('0x2'));function getSeconds(_0x6b8b47,_0x2d8c85){var _0x5b31ea=moment(_0x6b8b47)[_0xa24e('0x3')](0x0);var _0x56906b=moment(_0x2d8c85)['milliseconds'](0x0);return _0x5b31ea[_0xa24e('0x4')](_0x56906b,_0xa24e('0x5'));}function History(_0x4fee54){this['uniqueid']=_0x4fee54[_0xa24e('0x6')];this['scheduledat']=_0x4fee54[_0xa24e('0x7')]||undefined;this['type']=_0x4fee54[_0xa24e('0x8')];this[_0xa24e('0x9')]=_0x4fee54[_0xa24e('0x8')]===_0xa24e('0xa')?_0xa24e('0xb'):_0x4fee54[_0xa24e('0x8')];this[_0xa24e('0xc')]=_0x4fee54[_0xa24e('0xc')];this[_0xa24e('0xd')]=_0x4fee54['countcongestionretry'];this['countnoanswerretry']=_0x4fee54[_0xa24e('0xe')];this[_0xa24e('0xf')]=_0x4fee54[_0xa24e('0xc')]+_0x4fee54[_0xa24e('0xd')]+_0x4fee54[_0xa24e('0xe')]+_0x4fee54[_0xa24e('0x10')]+_0x4fee54['countdropretry']+_0x4fee54[_0xa24e('0x11')]+_0x4fee54[_0xa24e('0x12')]+_0x4fee54['countagentrejectretry'];this[_0xa24e('0x10')]=_0x4fee54[_0xa24e('0x10')];this[_0xa24e('0x13')]=_0x4fee54[_0xa24e('0x13')];this[_0xa24e('0x11')]=_0x4fee54['countabandonedretry'];this[_0xa24e('0x12')]=_0x4fee54['countmachineretry'];this['countagentrejectretry']=_0x4fee54[_0xa24e('0x14')];this[_0xa24e('0xb')]=_0x4fee54[_0xa24e('0xb')];this[_0xa24e('0x15')]=_0x4fee54[_0xa24e('0x16')];this[_0xa24e('0x17')]=_0x4fee54[_0xa24e('0x18')];this['starttime']=_0x4fee54[_0xa24e('0x19')];this['responsetime']=_0x4fee54['responsetime'];this[_0xa24e('0x1a')]=_0x4fee54['responsetime'];this['ringtime']=getSeconds(_0x4fee54['responsetime'],_0x4fee54[_0xa24e('0x19')]);this[_0xa24e('0x1b')]=0x0;this[_0xa24e('0x1c')]=0x0;this[_0xa24e('0x1d')]=_0x4fee54[_0xa24e('0x1d')];this[_0xa24e('0x1e')]=_0x4fee54[_0xa24e('0x1e')];this['callbackat']=_0x4fee54['callbackat'];this[_0xa24e('0x1f')]=_0x4fee54[_0xa24e('0x1f')];this['ContactId']=_0x4fee54[_0xa24e('0x20')];this['ListId']=_0x4fee54[_0xa24e('0x21')];this['UserId']=_0x4fee54['UserId'];this[_0xa24e('0x22')]=_0x4fee54[_0xa24e('0x22')];this['CampaignId']=_0x4fee54[_0xa24e('0x23')];this[_0xa24e('0x24')]=_0x4fee54[_0xa24e('0x24')]||'';this[_0xa24e('0x25')]=_0x4fee54[_0xa24e('0x25')]||'';}module[_0xa24e('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index a96acd8..d2136ab 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 _0xeba6=['buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./history','./final','./agentComplete','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startProgressive','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','milliseconds','seconds','emit','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','statedesc','endtime','starttime','clearZombieChannels','[actions]','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','ContactId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','status','reachable','SIP/%s','unmonitored','uniqueid','isNil','amdstatus','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','state','AMD','custom:amd','buildObj','[syncHangupInAMD]','MACHINE','membername','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','countnosuchnumberretry','countdropretry','reason\x2019\x20machine....','add','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','TIMEOUT','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','syncQueueMember','actionid','locked','stateinterface','queueBooked','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','paused','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','isArray','Action','iftime\x20%s,%s','interval','content','command','indexOf','true','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','dialMethod','loggedIn','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','map','checkIsTrunkReachable','\x5cw{0,','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialer','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','XMD-','toUpper','TrunkBackup','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','responsetime','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer'];(function(_0x55b99d,_0x2d3024){var _0x48f13d=function(_0x421a2e){while(--_0x421a2e){_0x55b99d['push'](_0x55b99d['shift']());}};_0x48f13d(++_0x2d3024);}(_0xeba6,0x69));var _0x6eba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeba6[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6eba('0x0'));var _=require(_0x6eba('0x1'));var uuid=require(_0x6eba('0x2'));var moment=require(_0x6eba('0x3'));var rr=require('rr');var md5=require(_0x6eba('0x4'));var Redis=require('ioredis');var ut=require(_0x6eba('0x5'));var config=require(_0x6eba('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x6eba('0x7'))(_0x6eba('0x8'));var loggerPredictive=require(_0x6eba('0x7'))(_0x6eba('0x9'));var loggerPredictiveCalls=require(_0x6eba('0x7'))(_0x6eba('0xa'));var loggerSyncQueueSummary=require(_0x6eba('0x7'))(_0x6eba('0xb'));var ami=require(_0x6eba('0xc'));config[_0x6eba('0xd')]=_['defaults'](config[_0x6eba('0xd')],{'host':_0x6eba('0xe'),'port':0x18eb});var io=require(_0x6eba('0xf'))(new Redis(config[_0x6eba('0xd')]));var cmHopper=require(_0x6eba('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperAdditionalPhone=require(_0x6eba('0x11'));var cmHopperBlack=require(_0x6eba('0x12'));var voiceQueueRt=require(_0x6eba('0x13'));var RpcSetting=require(_0x6eba('0x14'));var Action=require('./action');var History=require(_0x6eba('0x15'));var Final=require(_0x6eba('0x16'));var AgentComplete=require(_0x6eba('0x17'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x6eba('0x18'));var ipAgi=process['env'][_0x6eba('0x19')]||_0x6eba('0x1a');var strategy={'rrmemory':_0x6eba('0x1b'),'roundrobin':_0x6eba('0x1c')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x6eba('0x1d')][_0x6eba('0x1e')]=function(_0x2e185e){this['tail']=this[_0x6eba('0x1f')]?this[_0x6eba('0x1f')][_0x6eba('0x20')](_0x2e185e):_0x2e185e();};function Dialer(_0x3e02df,_0x10e258){this[_0x6eba('0x21')]=new Sequence();this['preview']=_0x10e258;this[_0x6eba('0x22')]=_0x3e02df[_0x6eba('0x22')];this[_0x6eba('0x23')]=_0x3e02df[_0x6eba('0x23')];this['agents']=_0x3e02df[_0x6eba('0x24')];this[_0x6eba('0x25')]=_0x3e02df['trunks'];this[_0x6eba('0x26')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x6eba('0x27')]={};this['contactsId']={};this[_0x6eba('0x28')]={};this[_0x6eba('0x29')]={};this['startPredictive']={};this[_0x6eba('0x2a')]={};this['ivrOriginated']={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0x6eba('0x2b'),this['syncAgentConnect']['bind'](this));ami['on'](_0x6eba('0x2c'),this[_0x6eba('0x2d')][_0x6eba('0x2e')](this));ami['on']('originateresponse',this[_0x6eba('0x2f')][_0x6eba('0x2e')](this));ami['on'](_0x6eba('0x30'),this[_0x6eba('0x31')][_0x6eba('0x2e')](this));ami['on']('custom:queuesummary',this[_0x6eba('0xb')][_0x6eba('0x2e')](this));ami['on'](_0x6eba('0x32'),this[_0x6eba('0x33')]['bind'](this));ami['on'](_0x6eba('0x34'),this[_0x6eba('0x35')][_0x6eba('0x2e')](this));ami['on'](_0x6eba('0x36'),this[_0x6eba('0x37')][_0x6eba('0x2e')](this));ami['on'](_0x6eba('0x38'),this[_0x6eba('0x39')][_0x6eba('0x2e')](this));ami['on'](_0x6eba('0x3a'),this['syncQueueMember']['bind'](this));ami['on'](_0x6eba('0x3b'),this[_0x6eba('0x3c')][_0x6eba('0x2e')](this));this[_0x6eba('0x3d')]();this[_0x6eba('0x3e')]();RpcSetting[_0x6eba('0x3f')]()[_0x6eba('0x40')](function(_0x21a3b9){previewRecallmeReminderInterval=_0x21a3b9[_0x6eba('0x41')];});}function isNotNull(_0x3fb969){return _0x3fb969!==null&&!_[_0x6eba('0x42')](_0x3fb969);}function checkIsLoggedIn(_0x43a45a,_0x2e8c29){return function(){if(_0x2e8c29<=0x0){_0x43a45a[_0x6eba('0x43')]='AGENTS_NOT_LOGGED';throw _0x43a45a[_0x6eba('0x44')]+_0x6eba('0x45');}};}function isActive(_0x5c1251){return _0x5c1251;}function checkIsActive(_0x1b7050,_0x1e0883){return function(){if(!isActive(_0x1e0883)){_0x1b7050['message']=_0x6eba('0x46');throw _0x1b7050[_0x6eba('0x44')]+_0x6eba('0x47');}};}function checkInterval(_0x355a00){return function(){if(!isNotNull(_0x355a00[_0x6eba('0x48')])){_0x355a00['message']='INTERVAL_IS_NULL';throw _0x355a00[_0x6eba('0x44')]+_0x6eba('0x49');}if(!isNotNull(_0x355a00[_0x6eba('0x48')][_0x6eba('0x4a')])){_0x355a00[_0x6eba('0x43')]=_0x6eba('0x4b');throw _0x355a00[_0x6eba('0x44')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x6eba('0x4c')](_0x355a00[_0x6eba('0x48')][_0x6eba('0x4a')]))){_0x355a00['message']=_0x6eba('0x4b');throw _0x355a00[_0x6eba('0x44')]+_0x6eba('0x49');}};}function msgResponse(_0x49d616,_0x4287f7,_0x26fc77){return{'action':_0x49d616,'response':_0x4287f7,'message':_0x26fc77,'stack':_0x26fc77};}function myreject(_0x2091db){return function(_0x1425e2){return _0x2091db(msgResponse(_0x6eba('0x4d'),'Error',JSON['stringify'](_0x1425e2)));};}function getSeconds(_0x501b0a,_0xa3dffc){var _0x5b7727=moment(_0x501b0a)['milliseconds'](0x0);var _0x5962e6=moment(_0xa3dffc)[_0x6eba('0x4e')](0x0);return _0x5b7727['diff'](_0x5962e6,_0x6eba('0x4f'));}function emit(_0x74c233,_0x3e1b1f,_0x39ad4d){io['to'](_0x74c233)[_0x6eba('0x50')](_0x3e1b1f,_0x39ad4d);}function emitVoiceQueueSummary(_0x5f535e){if(_0x5f535e['type']===_0x6eba('0x51')){var _0x567a9b={'id':_0x5f535e['id'],'name':_0x5f535e[_0x6eba('0x44')],'strategy':_0x5f535e[_0x6eba('0x52')],'answered':_0x5f535e[_0x6eba('0x53')],'available':_0x5f535e[_0x6eba('0x54')],'loggedIn':_0x5f535e['loggedIn'],'pTalking':_0x5f535e[_0x6eba('0x55')],'sumBillable':_0x5f535e[_0x6eba('0x56')],'sumDuration':_0x5f535e[_0x6eba('0x57')],'sumHoldTime':_0x5f535e[_0x6eba('0x58')]||0x0,'talking':_0x5f535e['talking'],'total':_0x5f535e[_0x6eba('0x59')],'type':_0x5f535e[_0x6eba('0x5a')],'unmanaged':_0x5f535e[_0x6eba('0x5b')],'abandoned':_0x5f535e[_0x6eba('0x5c')],'waiting':_0x5f535e['waiting'],'loggedInDb':_0x5f535e[_0x6eba('0x5d')],'dialActive':_0x5f535e[_0x6eba('0x5e')],'dialMethod':_0x5f535e['dialMethod'],'dialOriginateCallerIdName':_0x5f535e[_0x6eba('0x5f')],'dialOriginateCallerIdNumber':_0x5f535e[_0x6eba('0x60')],'dialOriginateTimeout':_0x5f535e[_0x6eba('0x61')],'dialPrefix':_0x5f535e[_0x6eba('0x62')],'outboundAnswerAgiCallsDay':_0x5f535e['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5f535e[_0x6eba('0x63')],'outboundBlacklistCallsDay':_0x5f535e['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5f535e[_0x6eba('0x64')],'outboundCongestionCallsDay':_0x5f535e[_0x6eba('0x65')],'outboundDropCallsDayACS':_0x5f535e[_0x6eba('0x66')],'outboundDropCallsDayCallersExit':_0x5f535e[_0x6eba('0x67')],'outboundDropCallsDayTimeout':_0x5f535e[_0x6eba('0x68')],'outboundNoAnswerCallsDay':_0x5f535e[_0x6eba('0x69')],'outboundNoSuchCallsDay':_0x5f535e[_0x6eba('0x6a')],'outboundOriginateFailureCallsDay':_0x5f535e[_0x6eba('0x6b')],'outboundReCallsDay':_0x5f535e[_0x6eba('0x6c')],'outboundRejectCallsDay':_0x5f535e[_0x6eba('0x6d')],'outboundUnknownCallsDay':_0x5f535e['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x5f535e[_0x6eba('0x6e')],'predictiveIntervalAvgHoldtime':_0x5f535e['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5f535e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5f535e[_0x6eba('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x5f535e[_0x6eba('0x70')],'predictiveIntervalErlangCalls':_0x5f535e[_0x6eba('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x5f535e[_0x6eba('0x72')],'predictiveIntervalHitRate':_0x5f535e[_0x6eba('0x73')],'predictiveIntervalMultiplicativeFactor':_0x5f535e[_0x6eba('0x74')],'predictiveIntervalPauses':_0x5f535e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x5f535e[_0x6eba('0x75')],'predictiveIntervalTotalCalls':_0x5f535e[_0x6eba('0x76')],'message':_0x5f535e[_0x6eba('0x43')],'originated':_0x5f535e[_0x6eba('0x77')],'erlangCalls':_0x5f535e[_0x6eba('0x78')],'erlangCallToSecond':_0x5f535e[_0x6eba('0x79')],'erlangAbandonmentRate':_0x5f535e['erlangAbandonmentRate'],'erlangBusyFactor':_0x5f535e[_0x6eba('0x7a')],'startPredictive':_0x5f535e[_0x6eba('0x7b')],'startProgressive':_0x5f535e[_0x6eba('0x2a')]};if(_0x5f535e[_0x6eba('0x7c')]){_0x567a9b[_0x6eba('0x7c')]={'id':_0x5f535e[_0x6eba('0x7c')]['id'],'name':_0x5f535e[_0x6eba('0x7c')][_0x6eba('0x44')],'active':_0x5f535e[_0x6eba('0x7c')][_0x6eba('0x7d')],'callerid':_0x5f535e[_0x6eba('0x7c')][_0x6eba('0x7e')]};}if(_0x5f535e[_0x6eba('0x48')]){_0x567a9b['Interval']={'id':_0x5f535e[_0x6eba('0x48')]['id'],'name':_0x5f535e[_0x6eba('0x48')]['name']};}var _0x57a44f=md5(JSON[_0x6eba('0x7f')](_0x567a9b));if(_0x5f535e[_0x6eba('0x4')]!==_0x57a44f){_0x5f535e[_0x6eba('0x4')]=_0x57a44f;emit(util[_0x6eba('0x80')](_0x6eba('0x81'),_0x567a9b[_0x6eba('0x44')]),_0x6eba('0x82'),_0x567a9b);}}}function emitCampaignSummary(_0x2c637e){if(_0x2c637e[_0x6eba('0x5a')]===_0x6eba('0x83')){emit(util[_0x6eba('0x80')]('campaign:ivr:%s',_0x2c637e[_0x6eba('0x44')]),_0x6eba('0x84'),_0x2c637e);}}function checkGetDataPredictive(_0x4456ff){if(isNotNull(_0x4456ff)&&!_[_0x6eba('0x4c')](_0x4456ff)){loggerPredictive['info'](_0x6eba('0x85'));loggerPredictive['info'](_0x6eba('0x86'),_0x4456ff[_0x6eba('0x76')]);loggerPredictive['info'](_0x6eba('0x87'),_0x4456ff[_0x6eba('0x6e')]);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x89'),_0x4456ff[_0x6eba('0x70')]);loggerPredictive[_0x6eba('0x88')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4456ff[_0x6eba('0x6f')]);loggerPredictive[_0x6eba('0x88')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4456ff['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x8a'),_0x4456ff['predictiveIntervalAvgTalktime']);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x8b'));if(_0x4456ff[_0x6eba('0x76')]>0x0){if(!_[_0x6eba('0x42')](_0x4456ff[_0x6eba('0x8c')])&&_0x4456ff[_0x6eba('0x8c')]>0x0){return!![];}loggerPredictive['info'](_0x6eba('0x8d'));if(!_['isUndefined'](_0x4456ff[_0x6eba('0x8e')])&&_0x4456ff[_0x6eba('0x8e')]>0x0){return!![];}loggerPredictive[_0x6eba('0x88')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x6eba('0x88')](_0x6eba('0x8f'));}}else{loggerPredictive[_0x6eba('0x88')](_0x6eba('0x90'));}return![];}function mergeDataErlangB(_0x111405){return function(_0x1c4e7b){loggerPredictive[_0x6eba('0x88')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x6eba('0x88')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c4e7b[_0x6eba('0x78')]);loggerPredictive[_0x6eba('0x88')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c4e7b['erlangCallToSecond']);loggerPredictive['info'](_0x6eba('0x91'),_0x1c4e7b[_0x6eba('0x92')]);loggerPredictive['info'](_0x6eba('0x93'),_0x1c4e7b[_0x6eba('0x7a')]);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x91'),_0x1c4e7b[_0x6eba('0x92')]);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x8b'));_['merge'](_0x111405,_0x1c4e7b);};}function getDiff(_0x48d515){var _0x27c324=moment()[_0x6eba('0x4e')](0x0);var _0x2fce65=moment(_0x48d515)[_0x6eba('0x4e')](0x0);return _0x27c324[_0x6eba('0x94')](_0x2fce65,_0x6eba('0x4f'));}function ifInterval(_0x402ab9,_0x5cfefa){if(_['isUndefined'](_0x5cfefa)){return![];}return getDiff(_0x5cfefa)<_0x402ab9*0x3c;}function freeVariablesPredictive(_0x2a6666){if(isNotNull(_0x2a6666)){if(!_['isUndefined'](_0x2a6666['startProgressive'])){_0x2a6666[_0x6eba('0x2a')]=undefined;loggerPredictive[_0x6eba('0x88')](_0x2a6666[_0x6eba('0x44')],_0x6eba('0x95'));}if(!_['isUndefined'](_0x2a6666['startPredictive'])){_0x2a6666[_0x6eba('0x7b')]=undefined;loggerPredictive[_0x6eba('0x88')](_0x2a6666[_0x6eba('0x44')],_0x6eba('0x96'));}if(!_[_0x6eba('0x42')](_0x2a6666[_0x6eba('0x97')])){clearInterval(_0x2a6666[_0x6eba('0x97')]);_0x2a6666[_0x6eba('0x97')]=undefined;loggerPredictive[_0x6eba('0x88')](_0x2a6666[_0x6eba('0x44')],_0x6eba('0x98'));}}}function erlangb(_0x2899f6,_0x21f0f3){if(_0x21f0f3===0x0){return 0x0;}var _0x279169=0x1;for(var _0x1bb9c0=0x1;_0x1bb9c0<=_0x21f0f3;_0x1bb9c0+=0x1){_0x279169=0x1+_0x279169*_0x1bb9c0/_0x2899f6;}return 0x1/_0x279169;}function isVoiceQueueOutbound(_0x127074){return _0x127074===_0x6eba('0x51');}function isNotPreview(_0x30afd9){return _0x30afd9!==_0x6eba('0x99');}function isCampaignIvr(_0x73e434){return _0x73e434===_0x6eba('0x83');}function getCallerId(_0xa6c6a0,_0x461af9,_0x376e8b){if(!_[_0x6eba('0x42')](_0x376e8b)&&typeof _0x376e8b===_0x6eba('0x9a')&&!_[_0x6eba('0x4c')](_0x376e8b)){if(!_[_0x6eba('0x42')](_0x461af9)&&typeof _0x461af9===_0x6eba('0x9a')&&!_[_0x6eba('0x4c')](_0x461af9)){return util[_0x6eba('0x80')](_0x6eba('0x9b'),_0x461af9,_0x376e8b);}return util[_0x6eba('0x80')](_0x6eba('0x9b'),_0x376e8b,_0x376e8b);}if(!_['isUndefined'](_0xa6c6a0)&&typeof _0xa6c6a0==='string'&&!_['isEmpty'](_0xa6c6a0)){return _0xa6c6a0;}return _0x6eba('0x9c');}function loggerCatchQueueSummary(_0x23899d,_0x3a879c){return function(_0x3ab8e9){freeVariablesPredictive(_0x3a879c);emitVoiceQueueSummary(_0x3a879c);emitCampaignSummary(_0x3a879c);loggerSyncQueueSummary[_0x6eba('0x9d')](_0x23899d,util[_0x6eba('0x9e')](_0x3ab8e9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xe223d0,_0x54fcd2){return function(_0x393781){loggerPredictive[_0x6eba('0x9f')](_0x54fcd2[_0x6eba('0x44')],_0xe223d0);loggerPredictive[_0x6eba('0x9f')](_0x393781[_0x6eba('0xa0')]);freeVariablesPredictive(_0x54fcd2);};}function loggerCatch(_0x35bbb6){return function(_0x156a67){logger[_0x6eba('0x9f')](_0x35bbb6,util[_0x6eba('0x9e')](_0x156a67,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x504053){return _0x504053&&!_[_0x6eba('0x42')](_0x504053)&&_0x504053[_0x6eba('0xa1')]>0x0;}function decremetOriginate(_0x254c6c){if(!_[_0x6eba('0x42')](_0x254c6c)&&_0x254c6c!==null){if(typeof _0x254c6c['originated']!==_0x6eba('0xa2')){if(_0x254c6c['originated']>0x0){_0x254c6c[_0x6eba('0x77')]-=0x1;}else{logger[_0x6eba('0x9f')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x6eba('0xa3'));}}function checkContactLowerLimitOriginate(_0x472432,_0x2c8c90,_0xe67df7){if(_0x2c8c90>_0xe67df7){for(var _0x53adc4=0x0;_0x53adc4<_0x2c8c90-_0xe67df7;_0x53adc4+=0x1){decremetOriginate(_0x472432);}}}function loggerGetContactDialer(_0x518891,_0x3a4097,_0xe3d580){return function(_0x4427a5){checkContactLowerLimitOriginate(_0x3a4097,_0xe3d580,0x0);logger[_0x6eba('0x9f')](_0x518891,util[_0x6eba('0x9e')](_0x4427a5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4636fe){return function(_0x220eb6){if(isNotNull(_0x220eb6)&&isNotNull(_0x220eb6[0x0])){if(_0x220eb6[0x0][_0x6eba('0xa4')]>0x0){_0x4636fe[_0x6eba('0x43')]=_0x6eba('0xa5');logger['info'](_0x6eba('0xa6')+_0x4636fe[_0x6eba('0x44')],_0x220eb6[0x0]['contactsRescheduled'],'contacts');}else{_0x4636fe['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x6eba('0x88')](_0x6eba('0xa7')+_0x4636fe[_0x6eba('0x44')]);}}};}function notSendMessagesQueue(_0x281c1b){if(_0x281c1b[_0x6eba('0xa8')]){freeVariablesPredictive(_0x281c1b);if(_0x281c1b[_0x6eba('0x77')]===0x0&&_0x281c1b[_0x6eba('0xa9')]===0x0&&_0x281c1b['waiting']===0x0&&(_0x281c1b['pTalking']||0x0)===0x0){_0x281c1b[_0x6eba('0xa8')]=![];_0x281c1b[_0x6eba('0x54')]=0x0;_0x281c1b[_0x6eba('0x43')]=_0x6eba('0x46');loggerSyncQueueSummary[_0x6eba('0x9d')](_0x6eba('0xaa'),_0x281c1b['name'],_0x6eba('0xab'));}else{_0x281c1b[_0x6eba('0x43')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x6eba('0x9d')](_0x6eba('0xaa'),_0x281c1b[_0x6eba('0x44')],'is\x20disactive');}emitVoiceQueueSummary(_0x281c1b);}}function notSendMessagesCampaign(_0x25b797){if(_0x25b797[_0x6eba('0xa8')]){if(_0x25b797[_0x6eba('0x77')]===0x0){_0x25b797[_0x6eba('0xa8')]=![];_0x25b797[_0x6eba('0x43')]=_0x6eba('0x46');loggerSyncQueueSummary[_0x6eba('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x25b797[_0x6eba('0x44')],_0x6eba('0xab'));}else{_0x25b797[_0x6eba('0x43')]=_0x6eba('0xac');loggerSyncQueueSummary[_0x6eba('0x9d')](_0x6eba('0xad'),_0x25b797[_0x6eba('0x44')],_0x6eba('0xae'));}emitCampaignSummary(_0x25b797);}}function createObjHistory(_0x23b900,_0x3817f9,_0x2da49a,_0x3d47bf,_0x58cfaa){_0x23b900[_0x6eba('0x43')]=_0x2da49a;var _0x30803f=new Action(_0x23b900,_0x3817f9);var _0x28e717=new History(_0x30803f);_0x28e717['state']=_0x3d47bf;_0x28e717[_0x6eba('0xaf')]=_0x58cfaa;_0x28e717[_0x6eba('0xb0')]=_0x30803f[_0x6eba('0xb1')];return _0x28e717;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x27e59e=this;setInterval(function(){_0x27e59e[_0x6eba('0xb2')](_0x27e59e['uniqueId'],'[uniqueid]');_0x27e59e['clearZombieChannels'](_0x27e59e[_0x6eba('0x27')],_0x6eba('0xb3'));},0x32c8);};Dialer[_0x6eba('0x1d')]['clearZombieChannels']=function(_0x366743,_0x53402e){var _0xf0fa0=this;for(var _0x1c233a in _0x366743){if(typeof _0x366743[_0x1c233a]!==_0x6eba('0xa2')){this[_0x6eba('0x21')]['enqueue'](function(){if(!_['isNil'](_0x366743[_0x1c233a])){return ami['Action']({'action':'status','channel':_0x366743[_0x1c233a][_0x6eba('0xb4')]})[_0x6eba('0xb5')](function(_0x9d718d){if(_0x9d718d[_0x6eba('0x43')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x366743[_0x1c233a]&&_0x366743[_0x1c233a][_0x6eba('0x5a')]!==_0x6eba('0x83')){_0xf0fa0[_0x6eba('0xb6')](_0xf0fa0[_0x6eba('0x22')][_0x366743[_0x1c233a][_0x6eba('0xb7')]]);logger['error'](_0x6eba('0xb8'),_0x53402e,_0x1c233a,_0x366743[_0x1c233a]['queue']);delete _0x366743[_0x1c233a];}if(_0x366743[_0x1c233a]&&_0x366743[_0x1c233a][_0x6eba('0x5a')]===_0x6eba('0x83')){_0xf0fa0[_0x6eba('0xb6')](_0xf0fa0['campaigns'][_0x366743[_0x1c233a]['queue']]);logger[_0x6eba('0x9f')](_0x6eba('0xb9'),_0x53402e,_0x1c233a,_0x366743[_0x1c233a][_0x6eba('0xb7')]);delete _0x366743[_0x1c233a];}},0x2328);}});}});}}};Dialer[_0x6eba('0x1d')][_0x6eba('0xba')]=function(_0x2e2fc4){return Promise[_0x6eba('0xbb')]()['then'](cmHopper[_0x6eba('0xba')](_0x2e2fc4))[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xbc')));};Dialer[_0x6eba('0x1d')][_0x6eba('0xbd')]=function(_0x109445){return Promise[_0x6eba('0xbb')]()['then'](cmHopperBlack[_0x6eba('0xbd')](_0x109445))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype'][_0x6eba('0xbe')]=function(_0x2ca275,_0x2d8229,_0x40ad24){return Promise['resolve']()[_0x6eba('0x40')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2ca275,_0x2d8229,_0x40ad24))[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xbf')));};Dialer[_0x6eba('0x1d')][_0x6eba('0xc0')]=function(_0x453bf0,_0x2bf41c,_0x617906){return Promise[_0x6eba('0xbb')]()[_0x6eba('0x40')](cmHopperAdditionalPhone[_0x6eba('0xc0')](_0x453bf0,_0x2bf41c,_0x617906))['catch'](loggerCatch(_0x6eba('0xc1')));};Dialer[_0x6eba('0x1d')][_0x6eba('0xc2')]=function(_0x2731de){return Promise[_0x6eba('0xbb')]()[_0x6eba('0x40')](cmHopperBlack[_0x6eba('0xc2')](_0x2731de))[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xc3')));};Dialer[_0x6eba('0x1d')]['averageHandleTime']=function(_0xb9aa92){return Promise[_0x6eba('0xbb')]()['then'](cmHopperHistory[_0x6eba('0xc4')](_0xb9aa92))['catch'](loggerCatch(_0x6eba('0xc5')));};Dialer[_0x6eba('0x1d')][_0x6eba('0xc6')]=function(_0x39cf93){return Promise[_0x6eba('0xbb')]()[_0x6eba('0x40')](cmHopper[_0x6eba('0xc6')](_0x39cf93))[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xc7')));};Dialer[_0x6eba('0x1d')]['unlockContact']=function(_0x1c26d6,_0x101cc3,_0x531af6){return Promise['resolve']()[_0x6eba('0x40')](cmHopper[_0x6eba('0xc8')](_0x1c26d6,_0x101cc3,_0x531af6))['catch'](loggerCatch(_0x6eba('0xc9')));};Dialer['prototype'][_0x6eba('0xca')]=function(_0x456d50,_0x5971ac,_0x39355b,_0x32e5cc,_0x50de83){return Promise[_0x6eba('0xbb')]()[_0x6eba('0x40')](cmHopper[_0x6eba('0xca')](_0x456d50,_0x5971ac,_0x39355b,_0x32e5cc))['catch'](function(_0x234d64){_0x50de83['temp']-=_0x39355b;_0x50de83['temp']=_0x50de83['temp']>0x0?_0x50de83[_0x6eba('0xcb')]:0x0;loggerCatch(_0x6eba('0xcc'))(_0x234d64);});};Dialer[_0x6eba('0x1d')]['getContactDialerIvr']=function(_0x5e5719,_0x1d004e,_0x5891e3,_0x1848fe){return Promise[_0x6eba('0xbb')]()['then'](cmHopper[_0x6eba('0xcd')](_0x5e5719,_0x1d004e,_0x5891e3))[_0x6eba('0xb5')](function(_0x171f4f){_0x1848fe[_0x6eba('0xcb')]-=_0x1d004e;_0x1848fe['temp']=_0x1848fe['temp']>0x0?_0x1848fe[_0x6eba('0xcb')]:0x0;loggerCatch(_0x6eba('0xce'))(_0x171f4f);});};Dialer[_0x6eba('0x1d')][_0x6eba('0xcf')]=function(_0x141265){return Promise[_0x6eba('0xbb')]()[_0x6eba('0x40')](voiceQueueRt[_0x6eba('0xcf')](_0x141265))[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xd0')));};Dialer[_0x6eba('0x1d')]['moveContactManagedDialer']=function(_0x3abb18){return Promise['resolve']()[_0x6eba('0x40')](cmHopper[_0x6eba('0xd1')](_0x3abb18))[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xd2')));};Dialer['prototype'][_0x6eba('0xd3')]=function(_0x2fff89){return Promise[_0x6eba('0xbb')]()[_0x6eba('0x40')](cmHopperHistory[_0x6eba('0xd3')](_0x2fff89))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0x6eba('0x1d')][_0x6eba('0xb6')]=function(_0x579846){if(!_['isUndefined'](_0x579846)&&_0x579846!==null){if(typeof _0x579846['originated']!==_0x6eba('0xa2')){if(_0x579846[_0x6eba('0x77')]>0x0){_0x579846[_0x6eba('0x77')]-=0x1;}else{logger[_0x6eba('0x9f')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x6eba('0x9f')](_0x6eba('0xd4'));}};Dialer['prototype'][_0x6eba('0xd5')]=function(_0x2088ec,_0x102338){var _0x42bea1=this;return function(_0x30d13c){_0x42bea1[_0x6eba('0xb6')](_0x102338);logger['error'](_0x2088ec,util['inspect'](_0x30d13c,{'showHidden':![],'depth':null}));};};Dialer[_0x6eba('0x1d')][_0x6eba('0xd6')]=function(_0x329a6d,_0x628c23,_0x33540c){var _0x3cf46f={'state':0x19,'statedesc':_0x6eba('0xd7')};this['updateOriginated'](_0x628c23);this[_0x6eba('0xd8')](_[_0x6eba('0xd9')](_0x3cf46f,_['pick'](_0x33540c,[_0x6eba('0xda'),'ListId',_0x6eba('0xdb'),'VoiceQueueId',_0x6eba('0xdc')])),_0x6eba('0xdd'),_0x6eba('0xde'));logger[_0x6eba('0x9f')](_0x329a6d);};Dialer[_0x6eba('0x1d')][_0x6eba('0xdf')]=function(_0x53369e){return _0x53369e==='Success';};Dialer[_0x6eba('0x1d')][_0x6eba('0xe0')]=function(_0xc9dfa8){return!_[_0x6eba('0x42')](_0xc9dfa8)&&_0xc9dfa8&&!_[_0x6eba('0x42')](_0xc9dfa8[_0x6eba('0x44')])&&!_[_0x6eba('0x42')](_0xc9dfa8['active'])&&_0xc9dfa8['active']&&(this[_0x6eba('0x25')][util['format']('SIP/%s',_0xc9dfa8['name'])][_0x6eba('0xe1')]===_0x6eba('0xe2')||this[_0x6eba('0x25')][util[_0x6eba('0x80')](_0x6eba('0xe3'),_0xc9dfa8['name'])][_0x6eba('0xe1')]===_0x6eba('0xe4'));};Dialer[_0x6eba('0x1d')][_0x6eba('0xd8')]=function(_0x38734b,_0x1c11fb,_0x25347b){this[_0x6eba('0xd3')](_0x38734b)['catch'](loggerCatch(_0x1c11fb));this[_0x6eba('0xd1')](_0x38734b)[_0x6eba('0xb5')](loggerCatch(_0x25347b));};Dialer['prototype']['syncVarSet']=function(_0x18cc37){var _0x4daf4b=this;var _0x24a729=this['uniqueId'][_0x18cc37[_0x6eba('0xe5')]];var _0x251015;if(!_[_0x6eba('0xe6')](_0x18cc37)&&!_['isNil'](_0x18cc37['variable'])&&!_[_0x6eba('0xe6')](_0x18cc37['variable'][_0x6eba('0xe7')])&&_0x18cc37['exten']==='xcally-motion-dialer'&&_0x24a729){if(_0x24a729[_0x6eba('0x5a')]!==_0x6eba('0x83')&&this['voiceQueues'][_0x24a729[_0x6eba('0xb7')]][_0x6eba('0xe8')]&&_0x18cc37[_0x6eba('0xe9')]===_0x6eba('0xea')){delete this[_0x6eba('0x28')][_0x18cc37[_0x6eba('0xe5')]];this['updateOriginated'](this['voiceQueues'][_0x24a729['queue']]);this[_0x6eba('0x22')][_0x24a729['queue']][_0x6eba('0x63')]+=0x1;this['voiceQueues'][_0x24a729[_0x6eba('0xb7')]][_0x6eba('0xeb')]+=0x1;_0x251015=new Hangup(_0x24a729,_0x18cc37);_0x251015[_0x6eba('0xec')]=0x12;_0x251015[_0x6eba('0xaf')]='HangupInAMD';_0x251015['membername']=_0x6eba('0xed');ami[_0x6eba('0x50')](_0x6eba('0xee'),ut[_0x6eba('0xef')](_0x251015,'amd'));this[_0x6eba('0xd8')](_0x251015,'[syncHangupInAMD][createHistory]',_0x6eba('0xf0'));}if(_0x24a729[_0x6eba('0x5a')]!==_0x6eba('0x83')&&this['voiceQueues'][_0x24a729[_0x6eba('0xb7')]][_0x6eba('0xe8')]&&_0x18cc37[_0x6eba('0xe9')]===_0x6eba('0xf1')){return new Promise(function(_0xd0122b,_0x526192){delete _0x4daf4b[_0x6eba('0x28')][_0x18cc37[_0x6eba('0xe5')]];_0x4daf4b[_0x6eba('0xb6')](_0x4daf4b['voiceQueues'][_0x24a729['queue']]);_0x4daf4b['voiceQueues'][_0x24a729[_0x6eba('0xb7')]][_0x6eba('0x63')]+=0x1;_0x4daf4b[_0x6eba('0x22')][_0x24a729['queue']][_0x6eba('0xeb')]+=0x1;var _0x400f61=_0x4daf4b[_0x6eba('0x22')][_0x24a729[_0x6eba('0xb7')]];var _0xdd5b58=new Hangup(_0x24a729,_0x18cc37);_0xdd5b58[_0x6eba('0xec')]=0x13;_0xdd5b58['statedesc']='Machine';_0xdd5b58[_0x6eba('0xf2')]=_0x6eba('0xed');_0xdd5b58['countmachineretry']+=0x1;_0xdd5b58[_0x6eba('0xf3')]+=0x1;_0xdd5b58['amd']=!![];ami[_0x6eba('0x50')](_0x6eba('0xee'),ut[_0x6eba('0xef')](_0xdd5b58,_0x6eba('0xf4')));_0x4daf4b[_0x6eba('0xd3')](_0xdd5b58)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xf5')));if(_0xdd5b58[_0x6eba('0xf6')]+_0xdd5b58['countcongestionretry']+_0xdd5b58[_0x6eba('0xf7')]+_0xdd5b58['countnosuchnumberretry']+_0xdd5b58['countdropretry']+_0xdd5b58[_0x6eba('0xf8')]+_0xdd5b58[_0x6eba('0xf9')]+_0xdd5b58[_0x6eba('0xfa')]>=_0x400f61[_0x6eba('0xfb')]){_0x4daf4b[_0x6eba('0xfc')](_0xdd5b58,_0xd0122b,_0x526192,_0x6eba('0xfd'));}else{if(_0xdd5b58[_0x6eba('0xf9')]>=_0x400f61[_0x6eba('0xfe')]){_0x4daf4b[_0x6eba('0xff')](_0xdd5b58,_0xd0122b,_0x526192,'reason\x2019\x20machine....');}else{_0x4daf4b['rescheduleContact']({'active':![],'countmachineretry':_0xdd5b58['countmachineretry'],'scheduledat':moment()['add'](_0x400f61[_0x6eba('0x100')],'minutes')[_0x6eba('0x80')](_0x6eba('0x101')),'ContactId':_0xdd5b58['ContactId'],'ListId':_0xdd5b58[_0x6eba('0x102')],'VoiceQueueId':_0xdd5b58['VoiceQueueId']||undefined,'CampaignId':_0xdd5b58['CampaignId']||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x103')));_0xd0122b({'reschedule':0x1});}}});}if(_0x24a729[_0x6eba('0x5a')]===_0x6eba('0x83')&&this['campaigns'][_0x24a729[_0x6eba('0xb7')]][_0x6eba('0xe8')]&&_0x18cc37[_0x6eba('0xe9')]==='HANGUP'){delete this[_0x6eba('0x28')][_0x18cc37[_0x6eba('0xe5')]];this[_0x6eba('0xb6')](this[_0x6eba('0x23')][_0x24a729[_0x6eba('0xb7')]]);_0x251015=new Hangup(_0x24a729,_0x18cc37);_0x251015[_0x6eba('0xec')]=0x12;_0x251015[_0x6eba('0xaf')]='HangupInAMD';_0x251015[_0x6eba('0xf2')]=_0x6eba('0xed');ami[_0x6eba('0x50')]('custom:amd',ut[_0x6eba('0xef')](_0x251015,'amd'));this['saveInDb'](_0x251015,_0x6eba('0x104'),_0x6eba('0x105'));}if(_0x24a729[_0x6eba('0x5a')]===_0x6eba('0x83')&&this['campaigns'][_0x24a729['queue']][_0x6eba('0xe8')]&&_0x18cc37[_0x6eba('0xe9')]==='MACHINE'){return new Promise(function(_0x43a013,_0x90ea08){delete _0x4daf4b[_0x6eba('0x28')][_0x18cc37[_0x6eba('0xe5')]];_0x4daf4b[_0x6eba('0xb6')](_0x4daf4b[_0x6eba('0x23')][_0x24a729[_0x6eba('0xb7')]]);_0x4daf4b[_0x6eba('0x23')][_0x24a729[_0x6eba('0xb7')]][_0x6eba('0x63')]+=0x1;_0x4daf4b[_0x6eba('0x23')][_0x24a729[_0x6eba('0xb7')]][_0x6eba('0xeb')]+=0x1;var _0x38f5c6=_0x4daf4b[_0x6eba('0x23')][_0x24a729[_0x6eba('0xb7')]];var _0x473af5=new Hangup(_0x24a729,_0x18cc37);_0x473af5[_0x6eba('0xec')]=0x13;_0x473af5[_0x6eba('0xaf')]='Machine';_0x473af5[_0x6eba('0xf2')]=_0x6eba('0xed');_0x473af5[_0x6eba('0xf9')]+=0x1;_0x473af5[_0x6eba('0xf3')]+=0x1;_0x473af5[_0x6eba('0xf4')]=!![];ami[_0x6eba('0x50')](_0x6eba('0xee'),ut['buildObj'](_0x473af5,'amd'));_0x4daf4b[_0x6eba('0xd3')](_0x473af5)['catch'](loggerCatch(_0x6eba('0xf5')));if(_0x473af5[_0x6eba('0xf6')]+_0x473af5[_0x6eba('0x106')]+_0x473af5[_0x6eba('0xf7')]+_0x473af5[_0x6eba('0x107')]+_0x473af5[_0x6eba('0x108')]+_0x473af5[_0x6eba('0xf8')]+_0x473af5['countmachineretry']+_0x473af5[_0x6eba('0xfa')]>=_0x38f5c6[_0x6eba('0xfb')]){_0x4daf4b[_0x6eba('0xfc')](_0x473af5,_0x43a013,_0x90ea08,'reason19\x20machine....');}else{if(_0x473af5[_0x6eba('0xf9')]>=_0x38f5c6[_0x6eba('0xfe')]){_0x4daf4b[_0x6eba('0xff')](_0x473af5,_0x43a013,_0x90ea08,_0x6eba('0x109'));}else{_0x4daf4b['rescheduleContact']({'active':![],'countmachineretry':_0x473af5[_0x6eba('0xf9')],'scheduledat':moment()[_0x6eba('0x10a')](_0x38f5c6[_0x6eba('0x100')],_0x6eba('0x10b'))[_0x6eba('0x80')](_0x6eba('0x101')),'ContactId':_0x473af5[_0x6eba('0xda')],'ListId':_0x473af5[_0x6eba('0x102')],'VoiceQueueId':_0x473af5['VoiceQueueId']||undefined,'CampaignId':_0x473af5['CampaignId']||undefined})[_0x6eba('0xb5')](loggerCatch('[rescheduleContact][Machine]'));_0x43a013({'reschedule':0x1});}}});}}};Dialer[_0x6eba('0x1d')][_0x6eba('0x35')]=function(_0x19448a){var _0x23d842=this[_0x6eba('0x28')][_0x19448a['uniqueid']];var _0x2b3c08;if(_0x23d842&&_0x23d842['type']===_0x6eba('0x83')){delete this['uniqueId'][_0x19448a['uniqueid']];this[_0x6eba('0xb6')](this[_0x6eba('0x23')][_0x23d842[_0x6eba('0xb7')]]);this[_0x6eba('0x23')][_0x23d842[_0x6eba('0xb7')]][_0x6eba('0x10c')]+=0x1;_0x2b3c08=new Hangup(_0x23d842,_0x19448a);this['createHistory'](_0x2b3c08)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x10d')));this[_0x6eba('0xd1')](_0x2b3c08)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x10e')));}if(_0x23d842&&_0x23d842[_0x6eba('0x5a')]!==_0x6eba('0x83')&&isNotNull(this['voiceQueues'][_0x23d842[_0x6eba('0xb7')]]['dialQueueProject'])){delete this[_0x6eba('0x28')][_0x19448a['uniqueid']];this[_0x6eba('0xb6')](this[_0x6eba('0x22')][_0x23d842['queue']]);this[_0x6eba('0x22')][_0x23d842[_0x6eba('0xb7')]][_0x6eba('0x63')]+=0x1;this[_0x6eba('0x22')][_0x23d842[_0x6eba('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;_0x2b3c08=new Hangup(_0x23d842,_0x19448a);_0x2b3c08[_0x6eba('0xec')]=0x10;_0x2b3c08['statedesc']=_0x6eba('0x10f');_0x2b3c08['membername']=_0x6eba('0x110');this[_0x6eba('0xd3')](_0x2b3c08)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x6eba('0xd1')](_0x2b3c08)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x10e')));}if(_0x23d842&&_0x23d842[_0x6eba('0x5a')]!==_0x6eba('0x83')&&!isNotNull(this[_0x6eba('0x22')][_0x23d842[_0x6eba('0xb7')]][_0x6eba('0x111')])){delete this['uniqueId'][_0x19448a[_0x6eba('0xe5')]];this['updateOriginated'](this[_0x6eba('0x22')][_0x23d842[_0x6eba('0xb7')]]);this[_0x6eba('0x22')][_0x23d842[_0x6eba('0xb7')]][_0x6eba('0x112')]+=0x1;_0x2b3c08=new Hangup(_0x23d842,_0x19448a);_0x2b3c08[_0x6eba('0xec')]=0xc;_0x2b3c08[_0x6eba('0xaf')]=_0x19448a[_0x6eba('0x113')];_0x2b3c08[_0x6eba('0xf2')]='Unknow';this[_0x6eba('0xd3')](_0x2b3c08)['catch'](loggerCatch(_0x6eba('0x10d')));this[_0x6eba('0xd1')](_0x2b3c08)[_0x6eba('0xb5')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x6eba('0x1d')][_0x6eba('0x31')]=function(_0x489caf){var _0x161b64=this[_0x6eba('0x28')][_0x489caf[_0x6eba('0xe5')]];if(this[_0x6eba('0x22')][_0x489caf[_0x6eba('0xb7')]]){if(_0x161b64&&_0x161b64[_0x6eba('0x5a')]!==_0x6eba('0x83')){delete this['uniqueId'][_0x489caf[_0x6eba('0xe5')]];this['voiceQueues'][_0x489caf[_0x6eba('0xb7')]][_0x6eba('0x63')]+=0x1;var _0x1480bc=new AgentComplete(_0x161b64,_0x489caf);if(_0x489caf[_0x6eba('0x114')]==='agent'){_0x1480bc[_0x6eba('0x115')]=this['voiceQueues'][_0x489caf[_0x6eba('0xb7')]][_0x6eba('0x116')]&&this[_0x6eba('0x22')][_0x489caf[_0x6eba('0xb7')]][_0x6eba('0x117')]?moment()['format'](_0x6eba('0x101')):undefined;}this[_0x6eba('0xd3')](_0x1480bc)[_0x6eba('0xb5')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x6eba('0xd1')](_0x1480bc)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x118')));}}};Dialer[_0x6eba('0x1d')][_0x6eba('0x119')]=function(_0x421275){if(this[_0x6eba('0x22')][_0x421275[_0x6eba('0xb7')]]){if(this[_0x6eba('0x28')][_0x421275[_0x6eba('0xe5')]]&&this[_0x6eba('0x28')][_0x421275[_0x6eba('0xe5')]][_0x6eba('0x5a')]!==_0x6eba('0x83')){this[_0x6eba('0xb6')](this[_0x6eba('0x22')][_0x421275[_0x6eba('0xb7')]]);this[_0x6eba('0x28')][_0x421275[_0x6eba('0xe5')]][_0x6eba('0x11a')]=moment()[_0x6eba('0x80')](_0x6eba('0x101'));}}};Dialer[_0x6eba('0x1d')]['queueCallerAbandonCreateState']=function(_0xdc7108,_0x15b187){this['createHistory'](_0xdc7108)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x15b187==0x0){this['moveContactManagedDialer'](_0xdc7108)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x11b')));}};Dialer['prototype'][_0x6eba('0x2d')]=function(_0x51152e){var _0x58042b=this['uniqueId'][_0x51152e[_0x6eba('0xe5')]];var _0x31fea8=this;var _0x4bf088=![];var _0x36c071;var _0x1417b9;if(this['voiceQueues'][_0x51152e[_0x6eba('0xb7')]]){if(_0x58042b&&_0x58042b['type']!=='ivr'){delete this['uniqueId'][_0x51152e[_0x6eba('0xe5')]];this[_0x6eba('0xb6')](this[_0x6eba('0x22')][_0x51152e[_0x6eba('0xb7')]]);_0x58042b[_0x6eba('0x11c')]=moment()[_0x6eba('0x80')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2f8031=new QueueCallerAbandon(_0x58042b,_0x51152e);if(getSeconds(_0x58042b[_0x6eba('0x11c')],_0x58042b['responsetime'])>=_0x58042b[_0x6eba('0x11d')]){this[_0x6eba('0x22')][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x70')]+=0x1;this[_0x6eba('0x22')][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x68')]+=0x1;this[_0x6eba('0x22')][_0x51152e['queue']][_0x6eba('0x72')]+=0x1;_0x2f8031[_0x6eba('0xec')]=0xa;_0x2f8031['statedesc']=_0x6eba('0x11e');_0x2f8031['dropreason']=_0x6eba('0x11f');_0x2f8031['agiafterat']=this[_0x6eba('0x22')][_0x51152e['queue']][_0x6eba('0x116')]?moment()[_0x6eba('0x80')](_0x6eba('0x101')):undefined;_0x2f8031[_0x6eba('0x108')]+=0x1;_0x2f8031[_0x6eba('0xf3')]+=0x1;_0x36c071=this[_0x6eba('0x22')][_0x51152e[_0x6eba('0xb7')]]['dialDropRetryFrequency'];_0x1417b9=this[_0x6eba('0x22')][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x120')];_0x31fea8['verifyAdditionalPhones'](_0x2f8031,_0x2f8031[_0x6eba('0xec')],_0x58042b[_0x6eba('0x121')])[_0x6eba('0x40')](function(_0x53f593){_0x4bf088=_0x53f593[_0x6eba('0x122')]==0x1;if(_0x2f8031['countdropretry']>=_0x31fea8[_0x6eba('0x22')][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x123')]){_0x31fea8[_0x6eba('0x124')](_0x2f8031,_0x53f593['additional']);}else{_0x31fea8['rescheduleContact']({'active':![],'countdropretry':_0x2f8031[_0x6eba('0x108')],'scheduledat':moment()[_0x6eba('0x10a')](_0x31fea8[_0x6eba('0x22')][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x125')],_0x6eba('0x10b'))[_0x6eba('0x80')](_0x6eba('0x101')),'ContactId':_0x58042b[_0x6eba('0xda')],'ListId':_0x58042b['ListId'],'VoiceQueueId':_0x58042b[_0x6eba('0x126')]||undefined,'CampaignId':_0x58042b[_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x127')));var _0x5966ef=new History(_0x2f8031);_0x5966ef[_0x6eba('0xec')]=0xa;_0x5966ef[_0x6eba('0xaf')]='Drop';_0x5966ef[_0x6eba('0xb1')]=moment()[_0x6eba('0x80')](_0x6eba('0x101'));_0x5966ef[_0x6eba('0xb0')]=_0x5966ef[_0x6eba('0xb1')];_0x5966ef[_0x6eba('0x128')]=_0x2f8031[_0x6eba('0x128')];_0x5966ef['calleridnum']=_0x2f8031[_0x6eba('0x129')];_0x31fea8[_0x6eba('0xd3')](_0x5966ef)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x12a')));}})['then'](function(){if(_0x4bf088)_0x31fea8[_0x6eba('0xc0')](_0x2f8031,_0x36c071,_0x1417b9)[_0x6eba('0x40')](function(){return 0x1;});});}else{this['voiceQueues'][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x6f')]+=0x1;this[_0x6eba('0x22')][_0x51152e['queue']][_0x6eba('0x67')]+=0x1;_0x2f8031[_0x6eba('0xec')]=0xb;_0x2f8031[_0x6eba('0xaf')]=_0x6eba('0x12b');_0x2f8031[_0x6eba('0x12c')]=_0x6eba('0x12d');_0x2f8031[_0x6eba('0xf8')]+=0x1;_0x2f8031[_0x6eba('0xf3')]+=0x1;_0x36c071=this[_0x6eba('0x22')][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x12e')];_0x1417b9=this['voiceQueues'][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x120')];_0x31fea8['verifyAdditionalPhones'](_0x2f8031,_0x2f8031['state'],_0x58042b[_0x6eba('0x121')])['then'](function(_0x458a58){if(_0x2f8031[_0x6eba('0xf8')]>=_0x31fea8['voiceQueues'][_0x51152e[_0x6eba('0xb7')]][_0x6eba('0x12f')]){_0x31fea8['queueCallerAbandonCreateState'](_0x2f8031,_0x458a58['additional']);}else{_0x31fea8[_0x6eba('0xc6')]({'active':![],'countabandonedretry':_0x2f8031['countabandonedretry'],'scheduledat':moment()[_0x6eba('0x10a')](_0x31fea8[_0x6eba('0x22')][_0x51152e['queue']]['dialAbandonedRetryFrequency'],_0x6eba('0x10b'))[_0x6eba('0x80')](_0x6eba('0x101')),'ContactId':_0x58042b[_0x6eba('0xda')],'ListId':_0x58042b[_0x6eba('0x102')],'VoiceQueueId':_0x58042b[_0x6eba('0x126')]||undefined,'CampaignId':_0x58042b[_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x130')));var _0x165d56=new History(_0x2f8031);_0x165d56[_0x6eba('0xec')]=0xb;_0x165d56[_0x6eba('0xaf')]=_0x6eba('0x12b');_0x165d56[_0x6eba('0xb1')]=moment()[_0x6eba('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x165d56['endtime']=_0x165d56[_0x6eba('0xb1')];_0x165d56[_0x6eba('0x128')]=_0x2f8031[_0x6eba('0x128')];_0x165d56['calleridnum']=_0x2f8031[_0x6eba('0x129')];_0x31fea8[_0x6eba('0xd3')](_0x165d56)[_0x6eba('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x6eba('0x40')](function(){if(_0x4bf088)_0x31fea8[_0x6eba('0xc0')](_0x2f8031,_0x36c071,_0x1417b9)[_0x6eba('0x40')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x6eba('0x37')]=function(_0x93b77c){if(this['actions'][_0x93b77c[_0x6eba('0xe5')]]){this[_0x6eba('0x27')][_0x93b77c[_0x6eba('0xe5')]][_0x6eba('0xb4')]=_0x93b77c[_0x6eba('0xb4')];}if(this['uniqueId'][_0x93b77c['uniqueid']]){this[_0x6eba('0x28')][_0x93b77c[_0x6eba('0xe5')]][_0x6eba('0xb4')]=_0x93b77c[_0x6eba('0xb4')];}};Dialer[_0x6eba('0x1d')][_0x6eba('0x131')]=function(_0x4763ec){if(strategy[this[_0x6eba('0x22')][this[_0x6eba('0x27')][_0x4763ec['actionid']]['queue']][_0x6eba('0x52')]]===_0x6eba('0x1c')){if(this[_0x6eba('0x27')][_0x4763ec[_0x6eba('0x132')]]&&_[_0x6eba('0xe6')](this['actions'][_0x4763ec[_0x6eba('0x132')]][_0x6eba('0x133')])&&_0x4763ec[_0x6eba('0xe1')]==='1'&&_0x4763ec['paused']==='0'){if(this[_0x6eba('0x24')][_0x4763ec[_0x6eba('0x134')]]){if(!this['agents'][_0x4763ec[_0x6eba('0x134')]][_0x6eba('0x133')]){this[_0x6eba('0x24')][_0x4763ec[_0x6eba('0x134')]][_0x6eba('0x133')]=!![];this[_0x6eba('0x27')][_0x4763ec['actionid']]['locked']=!![];this[_0x6eba('0x27')][_0x4763ec[_0x6eba('0x132')]][_0x6eba('0x134')]=_0x4763ec['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x6eba('0x27')][_0x4763ec[_0x6eba('0x132')]][_0x6eba('0xb7')]]['strategy']]||_0x6eba('0x1b'))===_0x6eba('0x1b')){if(this[_0x6eba('0x27')][_0x4763ec[_0x6eba('0x132')]]){if(this[_0x6eba('0x24')][_0x4763ec['stateinterface']]){this[_0x6eba('0x27')][_0x4763ec[_0x6eba('0x132')]]['stateinterface']=_0x4763ec['stateinterface'];if(_[_0x6eba('0xe6')](this[_0x6eba('0x135')][this[_0x6eba('0x27')][_0x4763ec['actionid']][_0x6eba('0xb7')]])){this[_0x6eba('0x135')][this[_0x6eba('0x27')][_0x4763ec[_0x6eba('0x132')]][_0x6eba('0xb7')]]=[];}this['queueBooked'][this['actions'][_0x4763ec[_0x6eba('0x132')]][_0x6eba('0xb7')]][_0x6eba('0x136')](_[_0x6eba('0xd9')](_[_0x6eba('0x137')](this[_0x6eba('0x27')][_0x4763ec[_0x6eba('0x132')]],[_0x6eba('0x138'),'stateinterface']),{'status':_0x4763ec[_0x6eba('0xe1')],'paused':_0x4763ec['paused']}));}}}};function unlockQueueStatus(_0xc2838f,_0x4317e0){setTimeout(function(){if(_['isUndefined'](_0xc2838f[_0x6eba('0x139')])){loggerBooked[_0x6eba('0x9f')](_0x6eba('0x13a'),_0x4317e0);}_0xc2838f[_0x6eba('0x139')]=!![];loggerBooked[_0x6eba('0x88')](_0x6eba('0x13b'),_0x4317e0,JSON['stringify'](_[_0x6eba('0x137')](_0xc2838f,[_0x6eba('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x6eba('0x1d')][_0x6eba('0x3c')]=function(_0x429ade){var _0x4c6f4e=this;var _0xb957d2=_0x4c6f4e['voiceQueues'][_0x4c6f4e[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]];if(strategy[this[_0x6eba('0x22')][this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]]['strategy']]===_0x6eba('0x1c')){if(this[_0x6eba('0x27')][_0x429ade['actionid']]&&this['actions'][_0x429ade['actionid']][_0x6eba('0x134')]){this['preview'][_0x6eba('0x13c')](this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0x138')],this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0x134')])['catch'](function(_0x1bdc1b){logger['error'](_0x6eba('0x13d'),util[_0x6eba('0x9e')](_0x1bdc1b,{'showHidden':![],'depth':null}));})[_0x6eba('0x20')](function(){_0x4c6f4e['updateOriginated'](_0x4c6f4e['voiceQueues'][_0x4c6f4e[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]]);_0x4c6f4e['agents'][_0x4c6f4e[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0x134')]]['locked']=![];delete _0x4c6f4e['actions'][_0x429ade['actionid']];unlockQueueStatus(_0xb957d2);});}else{this[_0x6eba('0xb6')](this[_0x6eba('0x22')][this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]]);this[_0x6eba('0xc6')]({'active':![],'ContactId':this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xda')],'ListId':this[_0x6eba('0x27')][_0x429ade['actionid']][_0x6eba('0x102')],'VoiceQueueId':this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x13e')));delete this[_0x6eba('0x27')][_0x429ade['actionid']];unlockQueueStatus(_0xb957d2);}}else if((strategy[this['voiceQueues'][this[_0x6eba('0x27')][_0x429ade['actionid']]['queue']][_0x6eba('0x52')]]||_0x6eba('0x1b'))===_0x6eba('0x1b')){var _0x36486d;if(this[_0x6eba('0x27')][_0x429ade['actionid']]&&!_[_0x6eba('0x4c')](this[_0x6eba('0x135')][this['actions'][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]])){if(this['queueBookedRR'][_0x4c6f4e[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]]['queue']]){this['queueBookedRR'][_0x4c6f4e['actions'][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]]=this[_0x6eba('0x13f')][this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]]?this[_0x6eba('0x13f')][this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]]:this['queueBooked'][this[_0x6eba('0x27')][_0x429ade['actionid']][_0x6eba('0xb7')]]?this['queueBooked'][this['actions'][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]][_0x6eba('0x140')]||0x0:0x0;}this[_0x6eba('0x135')][this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]][_0x6eba('0xb7')]][_0x6eba('0x140')]=this[_0x6eba('0x13f')][this[_0x6eba('0x27')][_0x429ade[_0x6eba('0x132')]]['queue']];for(var _0x181c89=0x0;_0x181c89=0x0;})[_0x6eba('0xb5')](myreject(_0x12948a)));}}else{_0x1605b8[_0x6eba('0x136')](ami['Action']({'action':_0x6eba('0x15a'),'command':util[_0x6eba('0x80')](_0x6eba('0x157'),_0x474bc0,!_[_0x6eba('0x42')](config[_0x6eba('0x153')][_0x1bec61])?_0x1bec61:'')})[_0x6eba('0x40')](function(_0xbd5b32){return _0xbd5b32[_0x6eba('0x159')][_0x6eba('0x15b')](_0x6eba('0x15c'))>=0x0;})['catch'](myreject(_0x12948a)));}Promise['all'](_0x1605b8)[_0x6eba('0x40')](function(_0x4e41ad){var _0x149ded=_['some'](_0x4e41ad);if(_0x149ded){return _0x49b227(_0x149ded);}else{_0x5a568d[_0x6eba('0x43')]=_0x37aaac?_0x6eba('0x15d'):_0x6eba('0x15e');return _0x12948a(msgResponse(_0x6eba('0x15f'),_0x6eba('0x150'),_0x6eba('0x160')+_0x37aaac+'\x20'+_0x155a2f+_0x6eba('0x161')+util[_0x6eba('0x9e')](_0x474bc0,{'showHidden':![],'depth':null})+_0x6eba('0x162')+_0x1bec61));}})[_0x6eba('0xb5')](function(_0x967ffe){return _0x12948a(msgResponse(_0x6eba('0x14e'),_0x6eba('0x150'),JSON[_0x6eba('0x7f')](_0x967ffe)));});});};Dialer[_0x6eba('0x1d')][_0x6eba('0x163')]=function(_0x166776){var _0x589d00=this;return function(){switch(_0x166776['dialMethod']){case'progressive':freeVariablesPredictive(_0x166776);_0x589d00[_0x6eba('0x164')](_0x166776,0x1);break;case'power':freeVariablesPredictive(_0x166776);_0x589d00['handlePower'](_0x166776,_0x166776[_0x6eba('0x165')]);break;case'predictive':_0x589d00[_0x6eba('0x9')](_0x166776);break;case _0x6eba('0x8'):freeVariablesPredictive(_0x166776);_0x589d00[_0x6eba('0x164')](_0x166776,0x1);break;default:freeVariablesPredictive(_0x166776);logger[_0x6eba('0x9f')](_0x6eba('0x166'),_0x166776['name'],_0x6eba('0x167'));}};};Dialer[_0x6eba('0x1d')][_0x6eba('0x168')]=function(_0x46da8d){return Promise[_0x6eba('0xbb')]()[_0x6eba('0x40')](cmHopper[_0x6eba('0x169')](_0x46da8d['id'],previewRecallmeReminderInterval))[_0x6eba('0x40')](function(_0x53b19d){for(var _0x1c6947=0x0;_0x1c6947<_0x53b19d[_0x6eba('0xa1')];_0x1c6947++){var _0x13ab29=_0x53b19d[_0x1c6947][_0x6eba('0x16a')][_0x6eba('0x44')];if(_0x13ab29)io['to'](util[_0x6eba('0x80')](_0x6eba('0x16b'),_0x13ab29))['emit'](_0x6eba('0x16c'),{'hopper':_0x53b19d[_0x1c6947]});}})[_0x6eba('0xb5')](function(){});};Dialer[_0x6eba('0x1d')][_0x6eba('0x16d')]=function(_0x2dded7){var _0x23c67c=this;return function(){_0x23c67c['handleIvr'](_0x2dded7);};};Dialer[_0x6eba('0x1d')][_0x6eba('0xb')]=function(_0xcefe34){var _0x3f4867=this;if(isNotPreview(_0xcefe34[_0x6eba('0x16e')])){if(isVoiceQueueOutbound(_0xcefe34['type'])&&isActive(_0xcefe34[_0x6eba('0x5e')])){_0xcefe34['sendMessageOneNotActive']=!![];Promise[_0x6eba('0xbb')]()['then'](checkIsLoggedIn(_0xcefe34,_0xcefe34[_0x6eba('0x16f')]))[_0x6eba('0x40')](checkIsActive(_0xcefe34,_0xcefe34[_0x6eba('0x5e')]))['then'](checkInterval(_0xcefe34))['then'](_0x3f4867['checkIsTrunkReachable'](_0xcefe34))[_0x6eba('0x40')](_0x3f4867['checkIfTime'](_0xcefe34[_0x6eba('0x170')],_0xcefe34[_0x6eba('0x171')],_0xcefe34[_0x6eba('0x44')],_0xcefe34))['then'](_0x3f4867[_0x6eba('0x14f')](_0xcefe34['Interval'],_0xcefe34[_0x6eba('0x171')],_0xcefe34[_0x6eba('0x44')],_0xcefe34))['then'](_0x3f4867['checkDialMethod'](_0xcefe34))[_0x6eba('0xb5')](loggerCatchQueueSummary(_0x6eba('0x172'),_0xcefe34));}else{notSendMessagesQueue(_0xcefe34);}}else{freeVariablesPredictive(_0xcefe34);}};Dialer[_0x6eba('0x1d')]['syncQueueSummaryComplete']=_[_0x6eba('0x173')](function(){var _0x49a13d=_['filter'](this[_0x6eba('0x22')],function(_0x770945){return _0x770945[_0x6eba('0x174')];});var _0x2959fa=_[_0x6eba('0x175')](this[_0x6eba('0x24')],function(_0x202b27){return _0x202b27[_0x6eba('0x176')]&&_0x202b27[_0x6eba('0xe1')]===_0x6eba('0xe2');});if(_0x49a13d[_0x6eba('0xa1')]>0x0&&_0x2959fa['length']>0x0){return Promise[_0x6eba('0xbb')]()[_0x6eba('0x40')](cmHopper[_0x6eba('0x169')](_[_0x6eba('0x177')](_0x49a13d,'id'),previewRecallmeReminderInterval,_[_0x6eba('0x177')](_0x2959fa,'id')))[_0x6eba('0x40')](function(_0x21e2ad){for(var _0x31de00=0x0;_0x31de00<_0x21e2ad[_0x6eba('0xa1')];_0x31de00++){var _0x4b0fb6=_0x21e2ad[_0x31de00][_0x6eba('0x16a')][_0x6eba('0x44')];if(_0x4b0fb6)io['to'](util[_0x6eba('0x80')](_0x6eba('0x16b'),_0x4b0fb6))[_0x6eba('0x50')]('user:dialPreviewRecallReminder',{'hopper':_0x21e2ad[_0x31de00]});}})['catch'](function(_0x27adc4){logger['error'](_0x6eba('0x168'),_0x27adc4);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x6eba('0x1d')][_0x6eba('0x14b')]=function(){var _0x372c4d=this;var _0x1aeacb;for(var _0x7a9acc in this[_0x6eba('0x23')]){if(typeof this[_0x6eba('0x23')][_0x7a9acc]!=='undefined'){_0x1aeacb=this[_0x6eba('0x23')][_0x7a9acc];if(isCampaignIvr(_0x1aeacb[_0x6eba('0x5a')])&&isActive(_0x1aeacb[_0x6eba('0x7d')])){_0x1aeacb[_0x6eba('0xa8')]=!![];Promise['resolve']()[_0x6eba('0x40')](checkIsActive(_0x1aeacb,_0x1aeacb[_0x6eba('0x7d')]))['then'](checkInterval(_0x1aeacb))['then'](_0x372c4d[_0x6eba('0x178')](_0x1aeacb))[_0x6eba('0x40')](_0x372c4d[_0x6eba('0x14d')](_0x1aeacb['dialGlobalInterval'],_0x1aeacb['dialTimezone'],_0x1aeacb['name'],_0x1aeacb))[_0x6eba('0x40')](_0x372c4d[_0x6eba('0x14f')](_0x1aeacb[_0x6eba('0x48')],_0x1aeacb[_0x6eba('0x171')],_0x1aeacb[_0x6eba('0x44')],_0x1aeacb))['then'](_0x372c4d[_0x6eba('0x16d')](_0x1aeacb))[_0x6eba('0xb5')](loggerCatchQueueSummary('[syncCampaigns]',_0x1aeacb));}else{notSendMessagesCampaign(_0x1aeacb);}}}};function getCallerIdRandom(_0x196408,_0x5f2385){var _0x452c2c;var _0x53090c;var _0x432230;if(_0x5f2385<=0x0){_0x5f2385=0x1;}_0x452c2c=new RegExp(_0x6eba('0x179')+_0x5f2385+'}$');_0x53090c=Math['pow'](0xa,_0x5f2385-0x1);_0x432230=Math['pow'](0xa,_0x5f2385)-0x1;return util[_0x6eba('0x80')]('%s',_[_0x6eba('0x17a')](_0x196408,_0x452c2c,_[_0x6eba('0x17b')](_0x53090c,_0x432230)));}function extractCalleridName(_0x5d93d1){var _0x3c8a3f=_0x5d93d1[_0x6eba('0x17c')](/"(.*?)"/);return _0x3c8a3f?_0x3c8a3f[0x1]:_0x5d93d1;}Dialer[_0x6eba('0x1d')]['actionOriginate']=function(_0x38f134,_0xae424c){var _0x24c19a=this;var _0x444a6c=uuid['v4']();this[_0x6eba('0x27')][_0x444a6c]=new Action(_0x38f134,_0xae424c,_0x444a6c);return new Promise(function(_0xb8d4fe,_0x51b8fa){if(_[_0x6eba('0x42')](_0x38f134)&&typeof _0x38f134!==_0x6eba('0x17d')){return _0x51b8fa(msgResponse(_0x6eba('0x17e'),_0x6eba('0x150'),_0x6eba('0x17f')));}if(_[_0x6eba('0x42')](_0xae424c[_0x6eba('0x180')])||_0xae424c[_0x6eba('0x180')]===null){return _0x51b8fa(msgResponse(_0x6eba('0x17e'),'Failure',_0x6eba('0x181')));}var _0x188570={'XMD-CALLERID':_0x24c19a['actions'][_0x444a6c][_0x6eba('0x182')](),'XMD-AGI':_0x38f134[_0x6eba('0x111')]?util[_0x6eba('0x80')](_0x6eba('0x183'),ipAgi,_0x38f134[_0x6eba('0x111')]):'NONE','XMD-AGIAFTER':_0x38f134['dialQueueProject2']?util[_0x6eba('0x80')]('\x22agi://%s/square,%s\x22',ipAgi,_0x38f134[_0x6eba('0x116')]):_0x6eba('0x184'),'XMD-QUEUE':_0x38f134[_0x6eba('0x5a')]===_0x6eba('0x51')?util[_0x6eba('0x80')](_0x6eba('0x185'),_0x38f134[_0x6eba('0x44')],_0x38f134['dialQueueOptions']||'',_0x38f134[_0x6eba('0x117')]?'c':'',_0x38f134[_0x6eba('0x11d')]||0x3):_0x6eba('0x184'),'XMD-CONTACTID':_0xae424c[_0x6eba('0xda')],'XMD-CDRTYPE':_0x6eba('0x186'),'CALLERID(all)':_0x24c19a['actions'][_0x444a6c]['getCaller'](),'XMD-AMD':_0x38f134[_0x6eba('0xe8')]?_0x6eba('0x187'):_0x6eba('0x184'),'XMD-DESTINATION':_0x6eba('0x188')};if(_0x38f134['dialAMDActive']){_0x188570[_0x6eba('0x189')]=_0x38f134[_0x6eba('0x18a')]||0x9c4;_0x188570[_0x6eba('0x18b')]=_0x38f134['dialAMDGreeting']||0x5dc;_0x188570[_0x6eba('0x18c')]=_0x38f134[_0x6eba('0x18d')]||0x320;_0x188570['XMD-AMDTOTALANALYSISTIME']=_0x38f134[_0x6eba('0x18e')]||0x1388;_0x188570['XMD-AMDMINWORDLENGTH']=_0x38f134[_0x6eba('0x18f')]||0x64;_0x188570[_0x6eba('0x190')]=_0x38f134['dialAMDBetweenWordsSilence']||0x32;_0x188570[_0x6eba('0x191')]=_0x38f134[_0x6eba('0x192')]||0x3;_0x188570[_0x6eba('0x193')]=_0x38f134['dialAMDSilenceThreshold']||0x100;_0x188570[_0x6eba('0x194')]=_0x38f134[_0x6eba('0x195')]||0x1388;}if(_0x38f134[_0x6eba('0x5a')]===_0x6eba('0x51')){_0x188570[_0x6eba('0x196')]=_0xae424c[_0x6eba('0x126')];}else{_0x188570[_0x6eba('0x197')]=_0xae424c[_0x6eba('0xdc')];}for(var _0x25505c in _0xae424c[_0x6eba('0x198')]){if(typeof _0xae424c[_0x6eba('0x198')][_0x25505c]!=='undefined'){if(isNotNull(_0xae424c['Contact'][_0x25505c])&&_0x25505c!=='id'&&_0x25505c!=='tags'&&_0x25505c!==_0x6eba('0x199')&&_0x25505c!==_0x6eba('0x19a')){_0x188570[util['format']('%s%s',_0x6eba('0x19b'),_[_0x6eba('0x19c')](_0x25505c))]=_0xae424c[_0x6eba('0x198')][_0x25505c];}}}var _0x5138bb=_0x24c19a[_0x6eba('0xe0')](_0x38f134[_0x6eba('0x7c')])?getCallerId(_0x38f134[_0x6eba('0x7c')]['callerid'],_0x38f134[_0x6eba('0x5f')],_0x38f134['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x38f134[_0x6eba('0x60')],_0x38f134['dialRandomLastDigitCallerIdNumber']):_0x38f134[_0x6eba('0x60')]):getCallerId(_[_0x6eba('0xe6')](_0x38f134[_0x6eba('0x19d')])?_0x38f134['Trunk']['callerid']:_0x38f134[_0x6eba('0x19d')][_0x6eba('0x7e')],_0x38f134[_0x6eba('0x5f')],_0x38f134[_0x6eba('0x19e')]>0x0?getCallerIdRandom(_0x38f134[_0x6eba('0x60')],_0x38f134[_0x6eba('0x19e')]):_0x38f134['dialOriginateCallerIdNumber']);if(_0x5138bb){_0x188570[_0x6eba('0x19f')]=_0x24c19a[_0x6eba('0x27')][_0x444a6c][_0x6eba('0x1a0')]=extractCalleridName(_0x5138bb);_0x188570[_0x6eba('0x1a1')]=_0xae424c['phone'];}_0x38f134['variables']=_0x188570;return ami[_0x6eba('0x156')]({'actionid':_0x444a6c,'action':_0x6eba('0x17e'),'channel':_0x24c19a[_0x6eba('0xe0')](_0x38f134[_0x6eba('0x7c')])?util[_0x6eba('0x80')]('SIP/%s/%s%s',_0x38f134[_0x6eba('0x7c')]['name'],isNotNull(_0x38f134['dialPrefix'])?_0x38f134[_0x6eba('0x62')][_0x6eba('0x1a2')]()||'':'',_0x38f134[_0x6eba('0x1a3')]>0x0?_0xae424c['phone'][_0x6eba('0x1a4')](_0x38f134[_0x6eba('0x1a3')]):_0xae424c[_0x6eba('0x180')]):util['format'](_0x6eba('0x1a5'),_[_0x6eba('0xe6')](_0x38f134[_0x6eba('0x19d')])?_0x38f134['Trunk'][_0x6eba('0x44')]:_0x38f134['TrunkBackup'][_0x6eba('0x44')],isNotNull(_0x38f134[_0x6eba('0x62')])?_0x38f134[_0x6eba('0x62')][_0x6eba('0x1a2')]()||'':'',_0x38f134['dialCutDigit']>0x0?_0xae424c[_0x6eba('0x180')][_0x6eba('0x1a4')](_0x38f134[_0x6eba('0x1a3')]):_0xae424c[_0x6eba('0x180')]),'callerid':_0x5138bb,'Exten':_0x6eba('0x188'),'Context':_0x6eba('0x1a6'),'Priority':'1','variable':_0x188570,'timeout':(_0x38f134[_0x6eba('0x61')]||0x1e)*0x3e8,'async':!![],'channelid':_0x444a6c})['then'](function(_0x9990d5){return _0xb8d4fe(_0x9990d5);})['catch'](function(_0x28b4b7){_0x38f134[_0x6eba('0x6b')]+=0x1;var _0x29b2bd=new History(_0x24c19a[_0x6eba('0x27')][_0x444a6c]);logger[_0x6eba('0x9f')](util[_0x6eba('0x80')](_0x6eba('0x1a7'),JSON[_0x6eba('0x7f')](_0x28b4b7)));_0x29b2bd[_0x6eba('0xec')]=0xe;_0x29b2bd[_0x6eba('0xaf')]=_0x6eba('0x1a8');_0x29b2bd[_0x6eba('0xb1')]=moment()['format'](_0x6eba('0x101'));_0x29b2bd[_0x6eba('0xb0')]=_0x29b2bd[_0x6eba('0xb1')];_0x24c19a[_0x6eba('0xd3')](_0x29b2bd)['catch'](loggerCatch(_0x6eba('0x1a9')));_0x24c19a[_0x6eba('0xd1')](_0x29b2bd)['catch'](loggerCatch('[originate][error]'))['finally'](function(){delete _0x24c19a[_0x6eba('0x27')][_0x444a6c];return _0x51b8fa(msgResponse('originate',_0x6eba('0x1aa'),'originate\x20action\x20Error'));});});});};Dialer[_0x6eba('0x1d')][_0x6eba('0x2f')]=function(_0x3c6c15){var _0x38b9aa=this[_0x6eba('0x27')][_0x3c6c15[_0x6eba('0x132')]];if(_0x38b9aa){delete this[_0x6eba('0x27')][_0x3c6c15[_0x6eba('0x132')]];_0x38b9aa[_0x6eba('0x1ab')]=moment()['format'](_0x6eba('0x101'));var _0x367e44=_0x38b9aa[_0x6eba('0x5a')]==='ivr'?this[_0x6eba('0x23')][_0x38b9aa[_0x6eba('0xb7')]]:this[_0x6eba('0x22')][_0x38b9aa[_0x6eba('0x1ac')]()];if(!this[_0x6eba('0xdf')](_0x3c6c15[_0x6eba('0x1ad')])){this[_0x6eba('0xb6')](_0x367e44);return this['callProgressDetecting'](_0x38b9aa,_0x367e44,_0x3c6c15)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1ae')));}this[_0x6eba('0x28')][_0x3c6c15['uniqueid']]=_0x38b9aa;}};Dialer['prototype'][_0x6eba('0x1af')]=function(_0x52491c,_0x49ea59,_0x2b9ace){var _0x475907=new History(_0x49ea59);if(_0x475907[_0x6eba('0xf6')]+_0x475907[_0x6eba('0x106')]+_0x475907[_0x6eba('0xf7')]+_0x475907[_0x6eba('0x107')]+_0x475907['countdropretry']+_0x475907[_0x6eba('0xf8')]+_0x475907['countmachineretry']+_0x475907[_0x6eba('0xfa')]>=_0x2b9ace[_0x6eba('0xfb')]-0x1){return!![];}switch(_0x52491c){case 0x3:if(_0x475907[_0x6eba('0xf7')]>=_0x2b9ace['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x6eba('0xc6')]({'active':![],'countnoanswerretry':_0x475907[_0x6eba('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x2b9ace['dialNoAnswerRetryFrequency'],'minutes')['format'](_0x6eba('0x101')),'ContactId':_0x475907[_0x6eba('0xda')],'ListId':_0x475907[_0x6eba('0x102')],'VoiceQueueId':_0x475907[_0x6eba('0x126')]||undefined,'CampaignId':_0x475907[_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1b0')));break;case 0x5:if(_0x475907[_0x6eba('0xf6')]>=_0x2b9ace[_0x6eba('0x1b1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x475907[_0x6eba('0xf6')]+=0x1,'scheduledat':moment()[_0x6eba('0x10a')](_0x2b9ace['dialBusyRetryFrequency'],_0x6eba('0x10b'))['format'](_0x6eba('0x101')),'ContactId':_0x475907[_0x6eba('0xda')],'ListId':_0x475907['ListId'],'VoiceQueueId':_0x475907['VoiceQueueId']||undefined,'CampaignId':_0x475907['CampaignId']||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1b2')));break;case 0x8:if(_0x475907[_0x6eba('0x106')]>=_0x2b9ace[_0x6eba('0x1b3')]-0x1){return!![];}this[_0x6eba('0xc6')]({'active':![],'countcongestionretry':_0x475907[_0x6eba('0x106')]+=0x1,'scheduledat':moment()[_0x6eba('0x10a')](_0x2b9ace[_0x6eba('0x1b4')],_0x6eba('0x10b'))[_0x6eba('0x80')](_0x6eba('0x101')),'ContactId':_0x475907[_0x6eba('0xda')],'ListId':_0x475907['ListId'],'VoiceQueueId':_0x475907[_0x6eba('0x126')]||undefined,'CampaignId':_0x475907[_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1b5')));break;case 0x0:if(_0x475907[_0x6eba('0x107')]>=_0x2b9ace[_0x6eba('0x1b6')]-0x1){return!![];}else{this[_0x6eba('0xc6')]({'active':![],'countnosuchnumberretry':_0x475907[_0x6eba('0x107')]+=0x1,'scheduledat':moment()['add'](_0x2b9ace[_0x6eba('0x1b7')],_0x6eba('0x10b'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x475907[_0x6eba('0xda')],'ListId':_0x475907[_0x6eba('0x102')],'VoiceQueueId':_0x475907[_0x6eba('0x126')]||undefined,'CampaignId':_0x475907['CampaignId']||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1b8')));}break;case 0xa:if(_0x475907['countdropretry']>=_0x2b9ace[_0x6eba('0x123')]-0x1){return!![];}this[_0x6eba('0xc6')]({'active':![],'countdropretry':_0x475907[_0x6eba('0x108')]+=0x1,'scheduledat':moment()[_0x6eba('0x10a')](_0x2b9ace[_0x6eba('0x125')],_0x6eba('0x10b'))[_0x6eba('0x80')](_0x6eba('0x101')),'ContactId':_0x475907[_0x6eba('0xda')],'ListId':_0x475907[_0x6eba('0x102')],'VoiceQueueId':_0x475907[_0x6eba('0x126')]||undefined,'CampaignId':_0x475907[_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x127')));break;case 0xb:if(_0x475907['countabandonedretry']>=_0x2b9ace['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x6eba('0xc6')]({'active':![],'countabandonedretry':_0x475907['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x2b9ace['dialAbandonedRetryFrequency'],'minutes')[_0x6eba('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x475907[_0x6eba('0xda')],'ListId':_0x475907[_0x6eba('0x102')],'VoiceQueueId':_0x475907[_0x6eba('0x126')]||undefined,'CampaignId':_0x475907[_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x130')));break;case 0x13:if(_0x475907[_0x6eba('0xf9')]>=_0x2b9ace[_0x6eba('0xfe')]-0x1){return!![];}this[_0x6eba('0xc6')]({'active':![],'countmachineretry':_0x475907[_0x6eba('0xf9')]+=0x1,'scheduledat':moment()[_0x6eba('0x10a')](_0x2b9ace['dialMachineRetryFrequency'],_0x6eba('0x10b'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x475907['ContactId'],'ListId':_0x475907['ListId'],'VoiceQueueId':_0x475907[_0x6eba('0x126')]||undefined,'CampaignId':_0x475907[_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x475907[_0x6eba('0xfa')]>=_0x2b9ace[_0x6eba('0x1b9')]-0x1){return!![];}this[_0x6eba('0xc6')]({'active':![],'countagentrejectretry':_0x475907[_0x6eba('0xfa')]+=0x1,'scheduledat':moment()[_0x6eba('0x10a')](_0x2b9ace[_0x6eba('0x1ba')],_0x6eba('0x10b'))[_0x6eba('0x80')](_0x6eba('0x101')),'ContactId':_0x475907[_0x6eba('0xda')],'ListId':_0x475907[_0x6eba('0x102')],'VoiceQueueId':_0x475907['VoiceQueueId']||undefined,'CampaignId':_0x475907[_0x6eba('0xdc')]||undefined})['catch'](loggerCatch(_0x6eba('0x1bb')));break;default:return!![];}};Dialer[_0x6eba('0x1d')][_0x6eba('0x1bc')]=function(_0xfd93a6,_0x19acdb,_0x33c412){var _0x1c88ee=this;var _0x3d3a76=new History(_0xfd93a6);var _0x22d88f=![];var _0x243200;var _0x26030b;return new Promise(function(_0x4b557c,_0x58e9c7){if(_[_0x6eba('0x42')](_0x19acdb)&&typeof _0x19acdb!=='object'){return _0x58e9c7(msgResponse(_0x6eba('0x1bd'),_0x6eba('0x150'),'entity\x20is\x20undefine'));}if(_[_0x6eba('0x42')](_0x33c412)&&typeof _0x33c412!==_0x6eba('0x17d')){return _0x58e9c7(msgResponse(_0x6eba('0x1bd'),_0x6eba('0x150'),_0x6eba('0x1be')));}_0x1c88ee['verifyAdditionalPhones'](_0x3d3a76,_0x33c412[_0x6eba('0x114')],_0x19acdb)[_0x6eba('0x40')](function(_0x5d7fa7){if(_0x5d7fa7['additional']==0x1)_0x22d88f=!![];switch(_0x33c412[_0x6eba('0x114')]){case'0':_0x19acdb['outboundNoSuchCallsDay']+=0x1;_0x3d3a76[_0x6eba('0xec')]=0x0;_0x3d3a76[_0x6eba('0xaf')]='NoSuchNumber';_0x3d3a76[_0x6eba('0x107')]+=0x1;_0x3d3a76['countglobal']+=0x1;ami[_0x6eba('0x50')](_0x6eba('0x1bf'),ut[_0x6eba('0xef')](_0xfd93a6,_0x6eba('0x1c0')));_0x243200=_0x19acdb[_0x6eba('0x1b7')];_0x26030b=_0x19acdb[_0x6eba('0x120')];_0x1c88ee[_0x6eba('0xd3')](_0x3d3a76)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xf5')));if(_0x1c88ee[_0x6eba('0x1af')](0x0,_0xfd93a6,_0x19acdb)&&!_0x22d88f){if(_0x3d3a76['countnosuchnumberretry']>=_0x19acdb[_0x6eba('0x1b6')]){_0x1c88ee[_0x6eba('0xff')](_0x3d3a76,_0x4b557c,_0x58e9c7,'reason\x200\x20no\x20such\x20number....');}else{_0x1c88ee[_0x6eba('0xfc')](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x6eba('0x1c1'));}}break;case'3':_0x19acdb[_0x6eba('0x69')]+=0x1;_0x3d3a76[_0x6eba('0xec')]=0x3;_0x3d3a76[_0x6eba('0xaf')]=_0x6eba('0x1c2');_0x3d3a76['countnoanswerretry']+=0x1;_0x3d3a76[_0x6eba('0xf3')]+=0x1;var _0x5e5d99=ut[_0x6eba('0x1c3')](_0xfd93a6,_0x19acdb);ami[_0x6eba('0x50')](_0x6eba('0x1c4'),_0x5e5d99);_0x243200=_0x19acdb[_0x6eba('0x1c5')];_0x26030b=_0x19acdb[_0x6eba('0x120')];_0x1c88ee[_0x6eba('0xd3')](_0x3d3a76)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1c6')));if(_0x1c88ee['checkRetriveMax'](0x3,_0xfd93a6,_0x19acdb)&&!_0x22d88f){if(_0x3d3a76[_0x6eba('0xf7')]>=_0x19acdb['dialNoAnswerMaxRetry']){_0x1c88ee['createStateFinal'](_0x3d3a76,_0x4b557c,_0x58e9c7,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1c88ee[_0x6eba('0xfc')](_0x3d3a76,_0x4b557c,_0x58e9c7,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x19acdb[_0x6eba('0x64')]+=0x1;_0x3d3a76[_0x6eba('0xec')]=0x5;_0x3d3a76['statedesc']=_0x6eba('0x1c7');_0x3d3a76[_0x6eba('0xf6')]+=0x1;_0x3d3a76[_0x6eba('0xf3')]+=0x1;ami[_0x6eba('0x50')](_0x6eba('0x1c8'),ut['buildObj'](_0xfd93a6,_0x6eba('0x1c9')));_0x243200=_0x19acdb[_0x6eba('0x1ca')];_0x26030b=_0x19acdb[_0x6eba('0x120')];_0x1c88ee[_0x6eba('0xd3')](_0x3d3a76)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1cb')));if(_0x1c88ee[_0x6eba('0x1af')](0x5,_0xfd93a6,_0x19acdb)&&!_0x22d88f){if(_0x3d3a76[_0x6eba('0xf6')]>=_0x19acdb[_0x6eba('0x1b1')]){_0x1c88ee[_0x6eba('0xff')](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x6eba('0x1cc'));}else{_0x1c88ee['stateGlobal'](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x6eba('0x1cc'));}}break;case'8':_0x19acdb['outboundCongestionCallsDay']+=0x1;_0x3d3a76[_0x6eba('0xec')]=0x8;_0x3d3a76[_0x6eba('0xaf')]=_0x6eba('0x1cd');_0x3d3a76[_0x6eba('0x106')]+=0x1;_0x3d3a76['countglobal']+=0x1;_0x243200=_0x19acdb[_0x6eba('0x1b4')];_0x26030b=_0x19acdb[_0x6eba('0x120')];ami[_0x6eba('0x50')]('custom:agentcongestion',ut[_0x6eba('0xef')](_0xfd93a6,_0x6eba('0x1ce')));_0x1c88ee['createHistory'](_0x3d3a76)[_0x6eba('0xb5')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1c88ee['checkRetriveMax'](0x8,_0xfd93a6,_0x19acdb)&&!_0x22d88f){if(_0x3d3a76[_0x6eba('0x106')]>=_0x19acdb[_0x6eba('0x1b3')]){_0x1c88ee['createStateFinal'](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x6eba('0x1cf'));}else{_0x1c88ee[_0x6eba('0xfc')](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x6eba('0x1cf'));}}break;case'11':_0x19acdb['outboundAbandonedCallsDay']+=0x1;_0x3d3a76['state']=0xb;_0x3d3a76[_0x6eba('0xaf')]=_0x6eba('0x12b');_0x3d3a76[_0x6eba('0xf8')]+=0x1;_0x3d3a76['countglobal']+=0x1;_0x243200=_0x19acdb['dialAbandonedRetryFrequency'];_0x26030b=_0x19acdb['callAdditionalPhoneAfterMin'];_0x1c88ee['createHistory'](_0x3d3a76)['catch'](loggerCatch(_0x6eba('0x1d0')));if(_0x1c88ee[_0x6eba('0x1af')](0xb,_0xfd93a6,_0x19acdb)&&!_0x22d88f){if(_0x3d3a76[_0x6eba('0xf8')]>=_0x19acdb['dialAbandonedMaxRetry']){_0x1c88ee[_0x6eba('0xff')](_0x3d3a76,_0x4b557c,_0x58e9c7,'reason\x2011\x20abandoned');}else{_0x1c88ee[_0x6eba('0xfc')](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x6eba('0x1d1'));}}break;case'20':_0x19acdb[_0x6eba('0x6d')]+=0x1;_0x3d3a76['state']=0x14;_0x3d3a76[_0x6eba('0xaf')]=_0x6eba('0x1d2');_0x3d3a76[_0x6eba('0xfa')]+=0x1;_0x3d3a76[_0x6eba('0xf3')]+=0x1;_0x243200=_0x19acdb['dialAgentRejectRetryFrequency'];_0x26030b=_0x19acdb[_0x6eba('0x120')];ami[_0x6eba('0x50')](_0x6eba('0x1d3'),ut[_0x6eba('0xef')](_0xfd93a6,_0x6eba('0x1d4')));_0x1c88ee[_0x6eba('0xd3')](_0x3d3a76)['catch'](loggerCatch(_0x6eba('0x1d5')));if(_0x1c88ee[_0x6eba('0x1af')](0x14,_0xfd93a6,_0x19acdb)&&!_0x22d88f){if(_0x3d3a76[_0x6eba('0xfa')]>=_0x19acdb[_0x6eba('0x1b9')]){_0x1c88ee[_0x6eba('0xff')](_0x3d3a76,_0x4b557c,_0x58e9c7,'reason\x2020\x20agentreject');}else{_0x1c88ee[_0x6eba('0xfc')](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x6eba('0x1d6'));}}break;default:_0x19acdb[_0x6eba('0x112')]+=0x1;_0x3d3a76[_0x6eba('0xec')]=0xc;_0x3d3a76['statedesc']=_0x33c412[_0x6eba('0x114')];_0x243200=_0x19acdb[_0x6eba('0x1ba')];_0x26030b=_0x19acdb[_0x6eba('0x120')];_0x1c88ee[_0x6eba('0xd3')](_0x3d3a76)[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1d7')));if(_0x1c88ee['checkRetriveMax'](_0x33c412[_0x6eba('0x114')],_0xfd93a6,_0x19acdb)&&!_0x22d88f){if(_0x3d3a76['countbusyretry']+_0x3d3a76[_0x6eba('0x106')]+_0x3d3a76['countnoanswerretry']+_0x3d3a76[_0x6eba('0x107')]+_0x3d3a76[_0x6eba('0x108')]+_0x3d3a76[_0x6eba('0xf8')]+_0x3d3a76[_0x6eba('0xf9')]+_0x3d3a76[_0x6eba('0xfa')]>=_0x19acdb[_0x6eba('0xfb')]){_0x1c88ee['stateGlobal'](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x33c412[_0x6eba('0x114')]);}else{_0x1c88ee[_0x6eba('0xff')](_0x3d3a76,_0x4b557c,_0x58e9c7,_0x33c412[_0x6eba('0x114')]);}}}})[_0x6eba('0x40')](function(){if(_0x22d88f){_0x1c88ee[_0x6eba('0xc0')](_0x3d3a76,_0x243200,_0x26030b)['then'](function(){return _0x4b557c(0x1);});}});});};Dialer[_0x6eba('0x1d')]['stateGlobal']=function(_0x114b4c,_0x2ee399,_0x6c8a53,_0x24a555){var _0xcd56e7=new Final(_0x114b4c);_0xcd56e7[_0x6eba('0xec')]=0xf;_0xcd56e7[_0x6eba('0xaf')]='Global';this[_0x6eba('0xff')](_0xcd56e7,_0x2ee399,_0x6c8a53,_0x24a555);};Dialer[_0x6eba('0x1d')][_0x6eba('0xff')]=function(_0x2b2064,_0x320e7b,_0x3299b0,_0x4d3887){this[_0x6eba('0xd1')](_0x2b2064)['then'](function(){return _0x320e7b(msgResponse('[callProgressDetecting]',_0x6eba('0x1d8'),_0x4d3887));})['catch'](function(){return _0x3299b0(msgResponse(_0x6eba('0x1d9'),'Failure',_0x6eba('0x1da')));});};Dialer[_0x6eba('0x1d')][_0x6eba('0x9')]=function(_0x21684a){var _0x11e109=_0x21684a[_0x6eba('0x1db')]/0x64;var _0x154550=_0x21684a[_0x6eba('0x68')]/(_0x21684a[_0x6eba('0x68')]+_0x21684a[_0x6eba('0x63')]);var _0x54c90a=Math[_0x6eba('0x1dc')](_0x21684a['predictiveIntervalAvailable']*(_0x21684a['predictiveIntervalMaxThreshold']/0x64));var _0x488240=Math['round'](_0x21684a[_0x6eba('0x75')]*(_0x21684a[_0x6eba('0x1dd')]/0x64));var _0x3bd714=_0x21684a['available']+_0x21684a['talking'];var _0x464ac4=Math['floor'](_0x21684a['erlangCalls']*_0x21684a[_0x6eba('0x92')]*_0x21684a[_0x6eba('0x73')]*_0x21684a[_0x6eba('0x74')]);if(_['isUndefined'](_0x21684a[_0x6eba('0x2a')])){if(!_['isUndefined'](_0x21684a[_0x6eba('0x7b')])){_0x21684a[_0x6eba('0x7b')]=undefined;loggerPredictive[_0x6eba('0x9f')](_0x6eba('0x1de'),_0x6eba('0x1df'));}if(!_['isUndefined'](_0x21684a['handlePredictive'])){loggerPredictive[_0x6eba('0x9f')](_0x6eba('0x1de'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x21684a[_0x6eba('0x97')]);_0x21684a[_0x6eba('0x97')]=undefined;}_0x21684a[_0x6eba('0x2a')]=moment()[_0x6eba('0x80')](_0x6eba('0x101'));loggerPredictive[_0x6eba('0x88')](_0x21684a[_0x6eba('0x44')],_0x6eba('0x1e0'),_0x21684a[_0x6eba('0x2a')]);this[_0x6eba('0x164')](_0x21684a,0x1);}else if(ifInterval(_0x21684a[_0x6eba('0x1e1')],_0x21684a[_0x6eba('0x2a')])){this[_0x6eba('0x164')](_0x21684a,0x1);loggerPredictiveCalls[_0x6eba('0x88')](_0x6eba('0x1e2'),_0x21684a[_0x6eba('0x2a')],_0x21684a[_0x6eba('0x44')]);_0x21684a[_0x6eba('0x78')]=0x0;_0x21684a[_0x6eba('0x72')]=0x0;}else if(_0x11e109<_0x154550&&_0x21684a[_0x6eba('0x1e3')]===_0x6eba('0x1e4')){freeVariablesPredictive(_0x21684a);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x1e5'),_0x6eba('0x1e6'),_0x154550,_0x6eba('0x2a'),_0x21684a[_0x6eba('0x44')]);}else if(_0x464ac4<_0x21684a['predictiveIntervalErlangCallsDroppedCalls']&&_0x21684a[_0x6eba('0x1e3')]==='dropRate'){freeVariablesPredictive(_0x21684a);loggerPredictive[_0x6eba('0x88')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x6eba('0x1e7'),_0x464ac4,'Drop\x20in\x20this\x20interval',_0x21684a['predictiveIntervalErlangCallsDroppedCalls'],_0x6eba('0x2a'),_0x21684a[_0x6eba('0x44')]);}else if(!ifInterval(_0x21684a[_0x6eba('0x1e1')],_0x21684a['startProgressive'])&&_[_0x6eba('0x42')](_0x21684a[_0x6eba('0x7b')])&&!_[_0x6eba('0x42')](_0x21684a[_0x6eba('0x2a')])){_0x21684a[_0x6eba('0x7b')]=moment()[_0x6eba('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6eba('0x88')](_0x21684a['name'],'started\x20in\x20predictive\x20at',_0x21684a[_0x6eba('0x7b')]);this[_0x6eba('0x1e8')](_0x21684a[_0x6eba('0x1e1')])['then'](this[_0x6eba('0x1e9')](_0x21684a))['then'](mergeDataErlangB(_0x21684a))[_0x6eba('0x40')](this[_0x6eba('0x1ea')](_0x21684a))[_0x6eba('0xb5')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x21684a));}else if(!ifInterval(_0x21684a[_0x6eba('0x1e1')],_0x21684a[_0x6eba('0x7b')])){_0x21684a[_0x6eba('0x72')]=0x0;_0x21684a[_0x6eba('0x7b')]=moment()['format'](_0x6eba('0x101'));loggerPredictive[_0x6eba('0x88')](_0x21684a[_0x6eba('0x44')],'recalculate\x20predictive\x20at',_0x21684a[_0x6eba('0x7b')]);clearInterval(_0x21684a['handlePredictive']);_0x21684a[_0x6eba('0x97')]=undefined;this['averageHandleTime'](_0x21684a[_0x6eba('0x1e1')])[_0x6eba('0x40')](this[_0x6eba('0x1e9')](_0x21684a))[_0x6eba('0x40')](mergeDataErlangB(_0x21684a))[_0x6eba('0x40')](this['startMethodPredictive'](_0x21684a))[_0x6eba('0xb5')](loggerCatchPredictive(_0x6eba('0x1eb'),_0x21684a));}else if(_0x21684a[_0x6eba('0x75')]&&_0x3bd714<_0x21684a[_0x6eba('0x75')]-_0x488240){freeVariablesPredictive(_0x21684a);loggerPredictive[_0x6eba('0x88')](_0x21684a[_0x6eba('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3bd714,_0x6eba('0x1ec'),_0x21684a[_0x6eba('0x75')],'-',_0x488240,'=',_0x21684a[_0x6eba('0x75')]-_0x488240,')');}else if(_0x21684a[_0x6eba('0x75')]&&_0x3bd714>_0x21684a[_0x6eba('0x75')]+_0x54c90a){freeVariablesPredictive(_0x21684a);loggerPredictive[_0x6eba('0x88')](_0x21684a[_0x6eba('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3bd714,')\x20are\x20more\x20than\x20threshold\x20(',_0x21684a[_0x6eba('0x75')],'+',_0x54c90a,'=',_0x21684a[_0x6eba('0x75')]+_0x54c90a,')');}};Dialer[_0x6eba('0x1d')][_0x6eba('0x1e9')]=function(_0x352029){var _0x146c6e=this;return function(_0x5552ad){return new Promise(function(_0x1b5eea,_0x187893){_[_0x6eba('0xd9')](_0x352029,_0x5552ad[0x0]);if(checkGetDataPredictive(_0x5552ad[0x0])){var _0x4fb014=_0x352029['predictiveIntervalAvailable']=_0x352029['talking']+_0x352029['available'];var _0x363de1=_0x352029[_0x6eba('0x1e1')]*0x3c;var _0x4bfc45=_0x5552ad[0x0]['predictiveIntervalAvgTalktime']+_0x5552ad[0x0][_0x6eba('0x8e')];var _0x2c30da=(_0x5552ad[0x0]['predictiveIntervalAnsweredCalls']+_0x5552ad[0x0][_0x6eba('0x70')]+_0x5552ad[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5552ad[0x0][_0x6eba('0x76')];_0x352029[_0x6eba('0x73')]=_0x2c30da>0x0?_0x2c30da:0x1;switch(_0x352029['dialPredictiveOptimization']){case _0x6eba('0x1e4'):var _0x12662a=_0x352029[_0x6eba('0x1db')]/0x64;return _0x146c6e[_0x6eba('0x1ed')](_0x4fb014,_0x363de1,_0x4bfc45,_0x2c30da,_0x12662a)[_0x6eba('0x40')](function(_0x33d4f2){return _0x1b5eea(_0x33d4f2);});case _0x6eba('0x1ee'):var _0x39c0da=_0x352029[_0x6eba('0x1db')]/0x64;return _0x146c6e[_0x6eba('0x1ef')](_0x4fb014,_0x363de1,_0x4bfc45,_0x2c30da,_0x39c0da)[_0x6eba('0x40')](function(_0x152487){return _0x1b5eea(_0x152487);});default:return _0x187893(msgResponse(_0x6eba('0x1f0'),_0x6eba('0x150'),_0x6eba('0x1f1')));}}else{return _0x187893(msgResponse(_0x6eba('0x1f0'),_0x6eba('0x150'),_0x6eba('0x1f2')));}});};};Dialer[_0x6eba('0x1d')][_0x6eba('0x1f3')]=function(_0x172dea){var _0xb565be=this;return function(_0x59ca5b){return new Promise(function(_0x18f0ef,_0xeec48){_['merge'](_0x172dea,_0x59ca5b[0x0]);if(checkGetDataPredictive(_0x59ca5b[0x0])){loggerPredictive[_0x6eba('0x88')](JSON[_0x6eba('0x7f')](_0x59ca5b[0x0]));if(_0x172dea[_0x6eba('0x1e3')]===_0x6eba('0x1e4')){return _0xb565be['getVoiceQueueRtPauses'](_0x172dea['id'])[_0x6eba('0x40')](function(_0x1f3e9a){var _0x16fa82=_0x172dea[_0x6eba('0x16f')]-_0x1f3e9a[0x0][_0x6eba('0x1f4')];var _0x4fac4f=_0x172dea[_0x6eba('0x1e1')]*0x3c;var _0x34e0fa=_0x59ca5b[0x0][_0x6eba('0x8c')]+_0x59ca5b[0x0][_0x6eba('0x8e')];var _0x114ce3=(_0x59ca5b[0x0][_0x6eba('0x6e')]+_0x59ca5b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59ca5b[0x0][_0x6eba('0x6f')])/_0x59ca5b[0x0][_0x6eba('0x76')];var _0x5863a9=_0x172dea['dialPredictiveOptimizationPercentage']/0x64;_0x172dea[_0x6eba('0x1f5')]=_0x1f3e9a[0x0][_0x6eba('0x1f4')]||0x0;_0x172dea[_0x6eba('0x73')]=_0x114ce3>0x0?_0x114ce3:0x1;return _0xb565be[_0x6eba('0x1ed')](_0x16fa82,_0x4fac4f,_0x34e0fa,_0x114ce3,_0x5863a9);})[_0x6eba('0x40')](function(_0x303d74){return _0x18f0ef(_0x303d74);})[_0x6eba('0xb5')](function(_0x227c21){return _0xeec48(msgResponse(_0x6eba('0x1f6'),_0x6eba('0x150'),JSON['stringify'](_0x227c21)));});}if(_0x172dea[_0x6eba('0x1e3')]===_0x6eba('0x1ee')){return _0xb565be['getVoiceQueueRtPauses'](_0x172dea['id'])['then'](function(_0x484aff){var _0x3b30d7=_0x172dea[_0x6eba('0x16f')]-_0x484aff[0x0][_0x6eba('0x1f4')];var _0x456084=_0x172dea[_0x6eba('0x1e1')]*0x3c;var _0x2394f8=_0x59ca5b[0x0][_0x6eba('0x8c')]+_0x59ca5b[0x0][_0x6eba('0x8e')];var _0xd345b6=(_0x59ca5b[0x0]['predictiveIntervalAnsweredCalls']+_0x59ca5b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59ca5b[0x0][_0x6eba('0x6f')])/_0x59ca5b[0x0]['predictiveIntervalTotalCalls'];var _0x40f2e9=_0x172dea[_0x6eba('0x1db')]/0x64;_0x172dea[_0x6eba('0x1f5')]=_0x484aff[0x0]['outboundQueuePauses']||0x0;_0x172dea[_0x6eba('0x73')]=_0xd345b6>0x0?_0xd345b6:0x1;return _0xb565be[_0x6eba('0x1ef')](_0x3b30d7,_0x456084,_0x2394f8,_0xd345b6,_0x40f2e9);})['then'](function(_0x180942){return _0x18f0ef(_0x180942);})['catch'](function(_0x197a67){return _0xeec48(msgResponse(_0x6eba('0x1f6'),_0x6eba('0x150'),JSON[_0x6eba('0x7f')](_0x197a67)));});}}else{return _0xeec48(msgResponse('[getDataPredictive]',_0x6eba('0x150'),_0x6eba('0x1f2')));}});};};Dialer[_0x6eba('0x1d')][_0x6eba('0x1ea')]=function(_0x3d998d){var _0x32ea94=this;return function(){var _0x1fe1fd=0x0;var _0x3c5cf4=Math[_0x6eba('0x1f7')](_0x3d998d[_0x6eba('0x79')]*0x3e8);if(_0x3c5cf4>0x0){_0x3c5cf4=_0x3c5cf4<0x64?0x64:_0x3c5cf4;loggerPredictive[_0x6eba('0x88')](_0x3d998d[_0x6eba('0x44')],_0x6eba('0x1f8'),_0x3c5cf4,'milliseconds');_0x3d998d['handlePredictive']=setInterval(function(){_0x32ea94[_0x6eba('0x97')](_0x3d998d);loggerPredictiveCalls[_0x6eba('0x88')](_0x6eba('0x1f9'),_0x1fe1fd+=0x1);},_0x3c5cf4);}else{loggerPredictive[_0x6eba('0x88')](_0x3d998d[_0x6eba('0x44')],_0x6eba('0x1fa'));}};};Dialer[_0x6eba('0x1d')][_0x6eba('0x1fb')]=function(_0x1a6ac2,_0x248879){var _0x2d3d88=this;return function(_0x1185af){if(_[_0x6eba('0x4c')](_0x1185af)){if(_[_0x6eba('0xe6')](_0x248879[_0x6eba('0xdb')])||!_0x248879[_0x6eba('0x1fc')]){if(_0x1a6ac2[_0x6eba('0x16e')]===_0x6eba('0x8')){_0x1a6ac2[_0x6eba('0x139')]=_[_0x6eba('0x42')](_0x1a6ac2[_0x6eba('0x139')])?!![]:_0x1a6ac2['queueStatusComplete'];var _0x3d9108=uuid['v4']();_0x2d3d88[_0x6eba('0x27')][_0x3d9108]=new Action(_0x1a6ac2,_0x248879,_0x3d9108);loggerBooked['info']('[booked][checkContactBlack]',_0x3d9108,'queueStatusComplete:\x20',JSON[_0x6eba('0x7f')](_0x1a6ac2[_0x6eba('0x139')]),_0x6eba('0x1fd'),_0x1a6ac2[_0x6eba('0x44')]);if(_0x1a6ac2[_0x6eba('0x139')]){_0x1a6ac2[_0x6eba('0x139')]=![];_0x2d3d88[_0x6eba('0x135')][_0x2d3d88[_0x6eba('0x27')][_0x3d9108]['queue']]=[];ami['Action']({'actionid':_0x3d9108,'action':_0x6eba('0x1fe'),'queue':_0x1a6ac2[_0x6eba('0x44')]})[_0x6eba('0xb5')](function(){_0x2d3d88[_0x6eba('0xb6')](_0x1a6ac2);_0x2d3d88['rescheduleContact']({'active':![],'ContactId':_0x2d3d88['actions'][_0x3d9108][_0x6eba('0xda')],'ListId':_0x2d3d88[_0x6eba('0x27')][_0x3d9108][_0x6eba('0x102')],'VoiceQueueId':_0x2d3d88[_0x6eba('0x27')][_0x3d9108][_0x6eba('0x126')]||undefined,'CampaignId':_0x2d3d88[_0x6eba('0x27')][_0x3d9108]['CampaignId']||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1ff')));delete _0x2d3d88['actions'][_0x3d9108];});}else{loggerBooked[_0x6eba('0x88')](_0x6eba('0x200'),JSON[_0x6eba('0x7f')](_0x1a6ac2[_0x6eba('0x139')]),_0x6eba('0x1fd'),_0x1a6ac2[_0x6eba('0x44')]);_0x2d3d88[_0x6eba('0xb6')](_0x1a6ac2);_0x2d3d88[_0x6eba('0xc6')]({'active':![],'ContactId':_0x2d3d88['actions'][_0x3d9108][_0x6eba('0xda')],'ListId':_0x2d3d88['actions'][_0x3d9108]['ListId'],'VoiceQueueId':_0x2d3d88[_0x6eba('0x27')][_0x3d9108][_0x6eba('0x126')]||undefined,'CampaignId':_0x2d3d88[_0x6eba('0x27')][_0x3d9108][_0x6eba('0xdc')]||undefined})[_0x6eba('0xb5')](loggerCatch(_0x6eba('0x1ff')));delete _0x2d3d88['actions'][_0x3d9108];}}else{return _0x2d3d88[_0x6eba('0x201')](_0x1a6ac2,_0x248879);}}else{if(getDiff(_0x248879['scheduledat'])<_0x1a6ac2[_0x6eba('0x202')]*0x3c){if(_0x248879[_0x6eba('0x16a')]&&!_0x248879[_0x6eba('0x16a')][_0x6eba('0x203')]){_0x2d3d88['preview'][_0x6eba('0x13c')](_0x248879['id'])[_0x6eba('0x20')](function(){_0x2d3d88[_0x6eba('0xb6')](_0x1a6ac2);});}else{_0x2d3d88[_0x6eba('0xc8')]({'active':![]},_0x248879['id'],0x1)[_0x6eba('0x20')](function(){_0x2d3d88[_0x6eba('0xb6')](_0x1a6ac2);});}}else{_0x1a6ac2[_0x6eba('0x6c')]+=0x1;_0x2d3d88[_0x6eba('0xb6')](_0x1a6ac2);if(_0x1a6ac2[_0x6eba('0x204')]){_0x2d3d88[_0x6eba('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x248879[_0x6eba('0xda')],'ListId':_0x248879[_0x6eba('0x102')],'VoiceQueueId':_0x248879['VoiceQueueId']||undefined,'CampaignId':_0x248879['CampaignId']||undefined})['catch'](loggerCatch(_0x6eba('0x205')));_0x2d3d88[_0x6eba('0xd3')](createObjHistory(_0x1a6ac2,_0x248879,'RECALLINQUEUE',0x17,_0x6eba('0x206')))['catch'](loggerCatch(_0x6eba('0x207')));}else{_0x2d3d88['saveInDb'](createObjHistory(_0x1a6ac2,_0x248879,_0x6eba('0x208'),0x16,_0x6eba('0x209')),_0x6eba('0x20a'),_0x6eba('0x20b'));}}}}else{_0x1a6ac2[_0x6eba('0x20c')]+=0x1;_0x2d3d88[_0x6eba('0xd8')](createObjHistory(_0x1a6ac2,_0x248879,_0x6eba('0x20d'),0xd,'Blacklist'),_0x6eba('0x20e'),_0x6eba('0x20f'));throw'inBlackList';}};};Dialer[_0x6eba('0x1d')][_0x6eba('0x210')]=function(_0x3efb1b){var _0x47eac8=this;var _0x5b559e=_0x3efb1b[_0x6eba('0x211')]-_0x3efb1b[_0x6eba('0x77')]-_0x3efb1b['temp'];emitCampaignSummary(_0x3efb1b);if(_0x5b559e>0x0){if(_0x5b559e>this[_0x6eba('0x26')]){_0x5b559e=this[_0x6eba('0x26')];}_0x3efb1b[_0x6eba('0xcb')]+=_0x5b559e;this[_0x6eba('0xcd')](_0x3efb1b['id'],_0x5b559e,_0x3efb1b[_0x6eba('0x212')],_0x3efb1b)['then'](function(_0x18d2f0){_0x3efb1b['temp']-=_0x5b559e;_0x3efb1b[_0x6eba('0xcb')]=_0x3efb1b[_0x6eba('0xcb')]>0x0?_0x3efb1b[_0x6eba('0xcb')]:0x0;if(!checkContactEmpty(_0x18d2f0)){_0x3efb1b[_0x6eba('0x43')]=_0x6eba('0x213');logger['info']('[getContactCampaign2][Empty]'+_0x3efb1b[_0x6eba('0x44')]);}else{_0x3efb1b[_0x6eba('0x77')]+=_0x18d2f0[_0x6eba('0xa1')];_0x3efb1b[_0x6eba('0x43')]=_0x6eba('0x214');for(var _0x2fe338=0x0;_0x2fe338<_0x18d2f0['length'];_0x2fe338+=0x1){_0x3efb1b[_0x6eba('0x215')]+=0x1;if(_[_0x6eba('0xe6')](_0x18d2f0[_0x2fe338])||_[_0x6eba('0xe6')](_0x18d2f0[_0x2fe338][_0x6eba('0x198')])||_['isNil'](_0x18d2f0[_0x2fe338][_0x6eba('0x180')])){_0x47eac8['emptyContact'](_0x6eba('0x216'),_0x3efb1b,_0x18d2f0[_0x2fe338]);}else{_0x47eac8[_0x6eba('0xc2')](_['pick'](_0x18d2f0[_0x2fe338],[_0x6eba('0xdc'),_0x6eba('0x217')]))[_0x6eba('0x40')](_0x47eac8['checkContactBlack'](_0x3efb1b,_0x18d2f0[_0x2fe338]))[_0x6eba('0xb5')](_0x47eac8[_0x6eba('0xd5')]('[actionOriginateIvr]\x20',_0x3efb1b));}}}})[_0x6eba('0xb5')](loggerGetContactDialer(_0x6eba('0x218'),_0x3efb1b,_0x5b559e));}};Dialer['prototype'][_0x6eba('0x164')]=function(_0x5a2a2f,_0x51af9d){var _0xafdb6c=this;var _0xeaab41=[];var _0x906b58=_0x51af9d>=0x1?_0x51af9d:0x1;if(_0x5a2a2f['dialMethod']===_0x6eba('0x8')){_0x906b58=0x1;}var _0x32ddf3=Math['floor'](_0x5a2a2f[_0x6eba('0x54')]*_0x906b58)-_0x5a2a2f[_0x6eba('0x77')]-_0x5a2a2f['temp'];emitVoiceQueueSummary(_0x5a2a2f);if(_0x5a2a2f[_0x6eba('0x219')]>0x0){var _0x5079ab=_0x5a2a2f[_0x6eba('0x219')]-_0x5a2a2f['originated']-_0x5a2a2f[_0x6eba('0xa9')]-_0x5a2a2f[_0x6eba('0xcb')]-_0x5a2a2f['pTalking'];if(_0x32ddf3>_0x5079ab){_0x32ddf3=_0x5079ab;}}if(_0x32ddf3>0x0){if(_0x5a2a2f[_0x6eba('0x16e')]==='booked'){_0x32ddf3=0x1;}if(_0x32ddf3>this[_0x6eba('0x26')]){_0x32ddf3=this['maxNumberOriginate'];}_0x5a2a2f[_0x6eba('0xcb')]+=_0x32ddf3;for(var _0x373369 in this[_0x6eba('0x24')]){if(typeof this[_0x6eba('0x24')][_0x373369]!=='undefined'){if(this[_0x6eba('0x24')][_0x373369][_0x6eba('0xec')]===_0x6eba('0x21a')&&this['agents'][_0x373369][_0x6eba('0xe1')]===_0x6eba('0xe2')){_0xeaab41['push'](this['agents'][_0x373369]['id']);}}}this['getContactDialer'](_0x5a2a2f['id'],_0xeaab41,_0x32ddf3,_0x5a2a2f[_0x6eba('0x212')],_0x5a2a2f)[_0x6eba('0x40')](function(_0x322a4b){_0x5a2a2f['temp']-=_0x32ddf3;_0x5a2a2f[_0x6eba('0xcb')]=_0x5a2a2f[_0x6eba('0xcb')]>0x0?_0x5a2a2f['temp']:0x0;if(!checkContactEmpty(_0x322a4b)){_0xafdb6c[_0x6eba('0xba')](_0x5a2a2f)[_0x6eba('0x40')](sendMessageReschedule(_0x5a2a2f))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x5a2a2f[_0x6eba('0x77')]+=_0x322a4b[_0x6eba('0xa1')];_0x5a2a2f['message']=_0x5a2a2f[_0x6eba('0x16e')]===_0x6eba('0x8')?_0x6eba('0x187'):'RUNNING';for(var _0x14e707=0x0;_0x14e707<_0x322a4b[_0x6eba('0xa1')];_0x14e707+=0x1){if(_[_0x6eba('0xe6')](_0x322a4b[_0x14e707])||_[_0x6eba('0xe6')](_0x322a4b[_0x14e707]['Contact'])||_[_0x6eba('0xe6')](_0x322a4b[_0x14e707]['phone'])){_0xafdb6c[_0x6eba('0xd6')]('[actionOriginate]\x20',_0x5a2a2f,_0x322a4b[_0x14e707]);}else{_0xafdb6c[_0x6eba('0xbd')](_[_0x6eba('0x137')](_0x322a4b[_0x14e707],[_0x6eba('0x126'),_0x6eba('0x217')]))[_0x6eba('0x40')](_0xafdb6c[_0x6eba('0x1fb')](_0x5a2a2f,_0x322a4b[_0x14e707]))['catch'](_0xafdb6c['loggerHandler'](_0x6eba('0x216'),_0x5a2a2f));}}}})[_0x6eba('0xb5')](loggerGetContactDialer(_0x6eba('0x21b'),_0x5a2a2f,_0x32ddf3));}};Dialer['prototype'][_0x6eba('0x97')]=function(_0x149394){if(_0x149394[_0x6eba('0x219')]>0x0){var _0x2b7fc1=_0x149394[_0x6eba('0x219')]-_0x149394['originated']-_0x149394['talking'];if(_0x2b7fc1>0x0){this[_0x6eba('0x21c')](_0x149394);}else{loggerPredictiveCalls[_0x6eba('0x88')]('[handlePredictive][limitChannel]');}}else{this[_0x6eba('0x21c')](_0x149394);}};Dialer[_0x6eba('0x1d')][_0x6eba('0x21c')]=function(_0x1a990f){var _0x32d96a=this;var _0x4c331d=[];_0x1a990f[_0x6eba('0x77')]+=0x1;for(var _0x17fde5 in this[_0x6eba('0x24')]){if(typeof this[_0x6eba('0x24')][_0x17fde5]!==_0x6eba('0xa2')){if(this[_0x6eba('0x24')][_0x17fde5][_0x6eba('0xec')]===_0x6eba('0x21a')&&this[_0x6eba('0x24')][_0x17fde5]['status']===_0x6eba('0xe2')){_0x4c331d[_0x6eba('0x136')](this[_0x6eba('0x24')][_0x17fde5]['id']);}}}this[_0x6eba('0xca')](_0x1a990f['id'],_0x4c331d,0x1,_0x1a990f[_0x6eba('0x212')],_0x1a990f)[_0x6eba('0x40')](function(_0x52d038){if(!checkContactEmpty(_0x52d038)){checkContactLowerLimitOriginate(_0x1a990f,0x1,0x0);_0x32d96a['countReScheduled'](_0x1a990f)[_0x6eba('0x40')](sendMessageReschedule(_0x1a990f))[_0x6eba('0xb5')](loggerCatch(_0x6eba('0xbc')));}else{_0x1a990f[_0x6eba('0x43')]='RUNNING';if(_[_0x6eba('0xe6')](_0x52d038[0x0])||_['isNil'](_0x52d038[0x0]['Contact'])||_[_0x6eba('0xe6')](_0x52d038[0x0][_0x6eba('0x180')])){_0x32d96a[_0x6eba('0xd6')](_0x6eba('0x216'),_0x1a990f,_0x52d038[0x0]);}else{_0x32d96a[_0x6eba('0xbd')](_['pick'](_0x52d038[0x0],[_0x6eba('0x126'),_0x6eba('0x217')]))[_0x6eba('0x40')](_0x32d96a[_0x6eba('0x1fb')](_0x1a990f,_0x52d038[0x0]))[_0x6eba('0xb5')](_0x32d96a['loggerHandler'](_0x6eba('0x21d'),_0x1a990f));}}})[_0x6eba('0xb5')](loggerGetContactDialer(_0x6eba('0x21e'),_0x1a990f,0x1));emitVoiceQueueSummary(_0x1a990f);};Dialer[_0x6eba('0x1d')][_0x6eba('0x1ed')]=function(_0x367080,_0x2ae805,_0x416cc3,_0x49d6dc,_0x34aaee,_0x1e596d){loggerPredictive[_0x6eba('0x88')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x6eba('0x88')](_0x6eba('0x21f'),_0x367080);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x220'),_0x2ae805);loggerPredictive[_0x6eba('0x88')]('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',_0x416cc3);loggerPredictive['info'](_0x6eba('0x221'),_0x49d6dc);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x222'),_0x34aaee);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x8b'));return new Promise(function(_0xf5d7f,_0x46475f){if(_0x367080<=0x0||isNaN(_0x367080)){return _0x46475f(msgResponse(_0x6eba('0x223'),_0x6eba('0x1aa'),'m\x20=\x20'+_0x367080));}if(_0x416cc3<=0x0||isNaN(_0x416cc3)){return _0x46475f(msgResponse(_0x6eba('0x223'),_0x6eba('0x1aa'),_0x6eba('0x224')+_0x416cc3));}if(_0x49d6dc<=0x0||isNaN(_0x49d6dc)){return _0x46475f(msgResponse(_0x6eba('0x223'),_0x6eba('0x1aa'),_0x6eba('0x225')+_0x49d6dc));}if(_0x2ae805<=0x0||isNaN(_0x2ae805)){return _0x46475f(msgResponse('[abandonmentRate]','Error',_0x6eba('0x226')+_0x2ae805));}if(_0x34aaee<=0x0||isNaN(_0x34aaee)){return _0x46475f(msgResponse(_0x6eba('0x223'),'Error',_0x6eba('0x227')+_0x34aaee));}_0x1e596d=_0x1e596d||0x0;var _0x13e1d8=0x1/_0x416cc3;var _0x3cece3=0x0;var _0x13fabf=0x0;var _0x3ae089=0x0;var _0x4d23ad=0x0;for(var _0xaef9ef=0x0;_0x3ae089<_0x34aaee;_0xaef9ef+=0x1){_0x13fabf=_0xaef9ef/_0x2ae805;_0x3cece3=(_0x49d6dc*_0x13fabf+_0x1e596d)/_0x13e1d8;_0x3ae089=erlangb(_0x3cece3,_0x367080);_0x4d23ad=_0x3cece3/_0x367080*(0x1-erlangb(_0x3cece3,_0x367080));}return _0xf5d7f({'erlangCalls':_0xaef9ef,'erlangCallToSecond':_0x2ae805/_0xaef9ef,'erlangAbandonmentRate':_0x3ae089,'erlangBusyFactor':_0x4d23ad});});};Dialer[_0x6eba('0x1d')][_0x6eba('0x1ef')]=function(_0x3dac1e,_0x23969c,_0x5b8697,_0x43a872,_0x239ac2,_0x46954f){loggerPredictive[_0x6eba('0x88')](_0x6eba('0x228'));loggerPredictive[_0x6eba('0x88')]('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',_0x3dac1e);loggerPredictive['info'](_0x6eba('0x220'),_0x23969c);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x229'),_0x5b8697);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x221'),_0x43a872);loggerPredictive[_0x6eba('0x88')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x239ac2);loggerPredictive[_0x6eba('0x88')](_0x6eba('0x8b'));return new Promise(function(_0x5a29a5,_0x1cb9c6){if(_0x3dac1e<=0x0||isNaN(_0x3dac1e)){return _0x1cb9c6(msgResponse('[busyFactor]',_0x6eba('0x1aa'),'m\x20=\x20'+_0x3dac1e));}if(_0x5b8697<=0x0||isNaN(_0x5b8697)){return _0x1cb9c6(msgResponse(_0x6eba('0x22a'),'Error',_0x6eba('0x224')+_0x5b8697));}if(_0x43a872<=0x0||isNaN(_0x43a872)){return _0x1cb9c6(msgResponse('[busyFactor]',_0x6eba('0x1aa'),'p\x20=\x20'+_0x43a872));}if(_0x23969c<=0x0||isNaN(_0x23969c)){return _0x1cb9c6(msgResponse(_0x6eba('0x22a'),'Error','interval\x20=\x20'+_0x23969c));}if(_0x239ac2<=0x0||isNaN(_0x239ac2)){return _0x1cb9c6(msgResponse(_0x6eba('0x22a'),_0x6eba('0x1aa'),_0x6eba('0x22b')+_0x239ac2));}_0x46954f=_0x46954f||0x0;var _0x280dbe=0x1/_0x5b8697;var _0x576e0d=0x0;var _0x2db979=0x0;var _0x48864a=0x0;var _0x49d049=0x0;for(var _0x253eb3=0x0;_0x49d049<_0x239ac2;_0x253eb3+=0x1){_0x2db979=_0x253eb3/_0x23969c;_0x576e0d=(_0x43a872*_0x2db979+_0x46954f)/_0x280dbe;_0x48864a=erlangb(_0x576e0d,_0x3dac1e);_0x49d049=_0x576e0d/_0x3dac1e*(0x1-erlangb(_0x576e0d,_0x3dac1e));}return _0x5a29a5({'erlangCalls':_0x253eb3,'erlangCallToSecond':_0x23969c/_0x253eb3,'erlangAbandonmentRate':_0x48864a,'erlangBusyFactor':_0x49d049});});};module['exports']=Dialer; \ No newline at end of file +var _0x6e79=['[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','SIP/%s','reachable','unmonitored','isNil','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','outboundAnswerCallsDay','state','statedesc','HangupInAMD','membername','buildObj','MACHINE','Machine','AMD','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','stateGlobal','add','ContactId','ListId','[rescheduleContact][Machine]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','[syncHangupIvr][createHistory]','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','actionid','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','pick','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','checkIsTrunkReachable','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','Failure','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','Action','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialTimezone','throttle','filter','map','Agent','checkPreviewRecallReminder','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','match','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','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]','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','countReScheduled','[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','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','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncAgentComplete','custom:queuesummary','syncQueueSummary','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','emit','type','strategy','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','active','callerid','voice:queue:%s','voice_queue:save','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','length','originated','RESCHEDULED_CONTACTS','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','waiting','NOT_ACTIVE','debug','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','undefined','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','campaigns','[Dialer][checkChannel][ivr]','resolve','catch','[countReScheduled]\x20','checkIsBlackList','verifyAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp'];(function(_0x5a093c,_0x4fd0a5){var _0xedcce5=function(_0x39d674){while(--_0x39d674){_0x5a093c['push'](_0x5a093c['shift']());}};_0xedcce5(++_0x4fd0a5);}(_0x6e79,0x15e));var _0x96e7=function(_0x1a3b50,_0x3da23e){_0x1a3b50=_0x1a3b50-0x0;var _0x37ba9e=_0x6e79[_0x1a3b50];return _0x37ba9e;};'use strict';var util=require(_0x96e7('0x0'));var _=require(_0x96e7('0x1'));var uuid=require(_0x96e7('0x2'));var moment=require(_0x96e7('0x3'));var rr=require('rr');var md5=require(_0x96e7('0x4'));var Redis=require('ioredis');var ut=require(_0x96e7('0x5'));var config=require(_0x96e7('0x6'));var logger=require(_0x96e7('0x7'))(_0x96e7('0x8'));var loggerBooked=require(_0x96e7('0x7'))(_0x96e7('0x9'));var loggerPredictive=require(_0x96e7('0x7'))(_0x96e7('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x96e7('0xb'));var loggerSyncQueueSummary=require(_0x96e7('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0x96e7('0xc')]=_['defaults'](config[_0x96e7('0xc')],{'host':_0x96e7('0xd'),'port':0x18eb});var io=require(_0x96e7('0xe'))(new Redis(config[_0x96e7('0xc')]));var cmHopper=require(_0x96e7('0xf'));var cmHopperHistory=require(_0x96e7('0x10'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x96e7('0x11'));var voiceQueueRt=require(_0x96e7('0x12'));var RpcSetting=require(_0x96e7('0x13'));var Action=require('./action');var History=require('./history');var Final=require('./final');var AgentComplete=require(_0x96e7('0x14'));var QueueCallerAbandon=require(_0x96e7('0x15'));var Hangup=require(_0x96e7('0x16'));var ipAgi=process[_0x96e7('0x17')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0x96e7('0x18'),'roundrobin':_0x96e7('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x96e7('0x1a')][_0x96e7('0x1b')]=function(_0x199616){this[_0x96e7('0x1c')]=this[_0x96e7('0x1c')]?this[_0x96e7('0x1c')][_0x96e7('0x1d')](_0x199616):_0x199616();};function Dialer(_0x1839b5,_0x31ba00){this[_0x96e7('0x1e')]=new Sequence();this[_0x96e7('0x1f')]=_0x31ba00;this[_0x96e7('0x20')]=_0x1839b5[_0x96e7('0x20')];this['campaigns']=_0x1839b5['campaigns'];this[_0x96e7('0x21')]=_0x1839b5[_0x96e7('0x21')];this[_0x96e7('0x22')]=_0x1839b5[_0x96e7('0x22')];this[_0x96e7('0x23')]=config[_0x96e7('0x23')]||0x2;this[_0x96e7('0x24')]={};this[_0x96e7('0x25')]={};this['contactsId']={};this[_0x96e7('0x26')]={};this[_0x96e7('0x27')]={};this[_0x96e7('0x28')]={};this['startProgressive']={};this[_0x96e7('0x29')]={};this[_0x96e7('0x2a')]={};this[_0x96e7('0x2b')]={};ami['on'](_0x96e7('0x2c'),this[_0x96e7('0x2d')][_0x96e7('0x2e')](this));ami['on'](_0x96e7('0x2f'),this[_0x96e7('0x30')]['bind'](this));ami['on'](_0x96e7('0x31'),this['syncOriginateResponse'][_0x96e7('0x2e')](this));ami['on']('agentcomplete',this[_0x96e7('0x32')]['bind'](this));ami['on'](_0x96e7('0x33'),this[_0x96e7('0x34')]['bind'](this));ami['on']('custom:queuesummarycomplete',this[_0x96e7('0x35')][_0x96e7('0x2e')](this));ami['on']('hangup',this[_0x96e7('0x36')][_0x96e7('0x2e')](this));ami['on'](_0x96e7('0x37'),this[_0x96e7('0x38')][_0x96e7('0x2e')](this));ami['on'](_0x96e7('0x39'),this[_0x96e7('0x3a')]['bind'](this));ami['on'](_0x96e7('0x3b'),this[_0x96e7('0x3c')][_0x96e7('0x2e')](this));ami['on'](_0x96e7('0x3d'),this['syncQueueStatusComplete']['bind'](this));this[_0x96e7('0x3e')]();this[_0x96e7('0x3f')]();RpcSetting[_0x96e7('0x40')]()[_0x96e7('0x41')](function(_0x26180e){previewRecallmeReminderInterval=_0x26180e[_0x96e7('0x42')];});}function isNotNull(_0x1a274d){return _0x1a274d!==null&&!_[_0x96e7('0x43')](_0x1a274d);}function checkIsLoggedIn(_0x1b3769,_0x27fce7){return function(){if(_0x27fce7<=0x0){_0x1b3769[_0x96e7('0x44')]=_0x96e7('0x45');throw _0x1b3769[_0x96e7('0x46')]+_0x96e7('0x47');}};}function isActive(_0x35a2d5){return _0x35a2d5;}function checkIsActive(_0x16438a,_0x1a67d3){return function(){if(!isActive(_0x1a67d3)){_0x16438a['message']='NOT_ACTIVE';throw _0x16438a[_0x96e7('0x46')]+_0x96e7('0x48');}};}function checkInterval(_0x417928){return function(){if(!isNotNull(_0x417928[_0x96e7('0x49')])){_0x417928['message']=_0x96e7('0x4a');throw _0x417928[_0x96e7('0x46')]+_0x96e7('0x4b');}if(!isNotNull(_0x417928['Interval'][_0x96e7('0x4c')])){_0x417928[_0x96e7('0x44')]='INTERVAL_IS_NULL';throw _0x417928[_0x96e7('0x46')]+_0x96e7('0x4b');}if(!isNotNull(_[_0x96e7('0x4d')](_0x417928[_0x96e7('0x49')][_0x96e7('0x4c')]))){_0x417928[_0x96e7('0x44')]=_0x96e7('0x4a');throw _0x417928[_0x96e7('0x46')]+_0x96e7('0x4b');}};}function msgResponse(_0x4fd4ba,_0x447947,_0x3bbd3e){return{'action':_0x4fd4ba,'response':_0x447947,'message':_0x3bbd3e,'stack':_0x3bbd3e};}function myreject(_0x50d490){return function(_0x8d901e){return _0x50d490(msgResponse(_0x96e7('0x4e'),_0x96e7('0x4f'),JSON[_0x96e7('0x50')](_0x8d901e)));};}function getSeconds(_0xba3c30,_0x319f69){var _0x5de67b=moment(_0xba3c30)[_0x96e7('0x51')](0x0);var _0x214814=moment(_0x319f69)[_0x96e7('0x51')](0x0);return _0x5de67b['diff'](_0x214814,'seconds');}function emit(_0x4da119,_0x51011f,_0x12184b){io['to'](_0x4da119)[_0x96e7('0x52')](_0x51011f,_0x12184b);}function emitVoiceQueueSummary(_0x4d8d1b){if(_0x4d8d1b[_0x96e7('0x53')]==='outbound'){var _0x12b6e2={'id':_0x4d8d1b['id'],'name':_0x4d8d1b[_0x96e7('0x46')],'strategy':_0x4d8d1b[_0x96e7('0x54')],'answered':_0x4d8d1b['answered'],'available':_0x4d8d1b[_0x96e7('0x55')],'loggedIn':_0x4d8d1b[_0x96e7('0x56')],'pTalking':_0x4d8d1b[_0x96e7('0x57')],'sumBillable':_0x4d8d1b['sumBillable'],'sumDuration':_0x4d8d1b['sumDuration'],'sumHoldTime':_0x4d8d1b[_0x96e7('0x58')]||0x0,'talking':_0x4d8d1b[_0x96e7('0x59')],'total':_0x4d8d1b[_0x96e7('0x5a')],'type':_0x4d8d1b[_0x96e7('0x53')],'unmanaged':_0x4d8d1b[_0x96e7('0x5b')],'abandoned':_0x4d8d1b[_0x96e7('0x5c')],'waiting':_0x4d8d1b['waiting'],'loggedInDb':_0x4d8d1b['loggedInDb'],'dialActive':_0x4d8d1b[_0x96e7('0x5d')],'dialMethod':_0x4d8d1b[_0x96e7('0x5e')],'dialOriginateCallerIdName':_0x4d8d1b[_0x96e7('0x5f')],'dialOriginateCallerIdNumber':_0x4d8d1b[_0x96e7('0x60')],'dialOriginateTimeout':_0x4d8d1b[_0x96e7('0x61')],'dialPrefix':_0x4d8d1b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4d8d1b[_0x96e7('0x62')],'outboundAnswerCallsDay':_0x4d8d1b['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x4d8d1b[_0x96e7('0x63')],'outboundBusyCallsDay':_0x4d8d1b[_0x96e7('0x64')],'outboundCongestionCallsDay':_0x4d8d1b['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4d8d1b[_0x96e7('0x65')],'outboundDropCallsDayCallersExit':_0x4d8d1b[_0x96e7('0x66')],'outboundDropCallsDayTimeout':_0x4d8d1b[_0x96e7('0x67')],'outboundNoAnswerCallsDay':_0x4d8d1b[_0x96e7('0x68')],'outboundNoSuchCallsDay':_0x4d8d1b[_0x96e7('0x69')],'outboundOriginateFailureCallsDay':_0x4d8d1b[_0x96e7('0x6a')],'outboundReCallsDay':_0x4d8d1b[_0x96e7('0x6b')],'outboundRejectCallsDay':_0x4d8d1b['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4d8d1b[_0x96e7('0x6c')],'predictiveIntervalAnsweredCalls':_0x4d8d1b[_0x96e7('0x6d')],'predictiveIntervalAvgHoldtime':_0x4d8d1b[_0x96e7('0x6e')],'predictiveIntervalAvgTalktime':_0x4d8d1b[_0x96e7('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0x4d8d1b[_0x96e7('0x70')],'predictiveIntervalDroppedCallsTimeout':_0x4d8d1b['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4d8d1b['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4d8d1b[_0x96e7('0x71')],'predictiveIntervalHitRate':_0x4d8d1b[_0x96e7('0x72')],'predictiveIntervalMultiplicativeFactor':_0x4d8d1b[_0x96e7('0x73')],'predictiveIntervalPauses':_0x4d8d1b[_0x96e7('0x74')],'predictiveIntervalAvailable':_0x4d8d1b[_0x96e7('0x75')],'predictiveIntervalTotalCalls':_0x4d8d1b[_0x96e7('0x76')],'message':_0x4d8d1b['message'],'originated':_0x4d8d1b['originated'],'erlangCalls':_0x4d8d1b['erlangCalls'],'erlangCallToSecond':_0x4d8d1b[_0x96e7('0x77')],'erlangAbandonmentRate':_0x4d8d1b[_0x96e7('0x78')],'erlangBusyFactor':_0x4d8d1b['erlangBusyFactor'],'startPredictive':_0x4d8d1b[_0x96e7('0x28')],'startProgressive':_0x4d8d1b[_0x96e7('0x79')]};if(_0x4d8d1b[_0x96e7('0x7a')]){_0x12b6e2[_0x96e7('0x7a')]={'id':_0x4d8d1b[_0x96e7('0x7a')]['id'],'name':_0x4d8d1b['Trunk'][_0x96e7('0x46')],'active':_0x4d8d1b['Trunk'][_0x96e7('0x7b')],'callerid':_0x4d8d1b['Trunk'][_0x96e7('0x7c')]};}if(_0x4d8d1b[_0x96e7('0x49')]){_0x12b6e2[_0x96e7('0x49')]={'id':_0x4d8d1b[_0x96e7('0x49')]['id'],'name':_0x4d8d1b[_0x96e7('0x49')][_0x96e7('0x46')]};}var _0x4277a4=md5(JSON['stringify'](_0x12b6e2));if(_0x4d8d1b['md5']!==_0x4277a4){_0x4d8d1b[_0x96e7('0x4')]=_0x4277a4;emit(util['format'](_0x96e7('0x7d'),_0x12b6e2[_0x96e7('0x46')]),_0x96e7('0x7e'),_0x12b6e2);}}}function emitCampaignSummary(_0x33e69b){if(_0x33e69b['type']==='ivr'){emit(util[_0x96e7('0x7f')](_0x96e7('0x80'),_0x33e69b[_0x96e7('0x46')]),_0x96e7('0x81'),_0x33e69b);}}function checkGetDataPredictive(_0x5590be){if(isNotNull(_0x5590be)&&!_[_0x96e7('0x4d')](_0x5590be)){loggerPredictive[_0x96e7('0x82')](_0x96e7('0x83'));loggerPredictive[_0x96e7('0x82')](_0x96e7('0x84'),_0x5590be[_0x96e7('0x76')]);loggerPredictive['info'](_0x96e7('0x85'),_0x5590be[_0x96e7('0x6d')]);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x86'),_0x5590be[_0x96e7('0x87')]);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x88'),_0x5590be[_0x96e7('0x70')]);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x89'),_0x5590be[_0x96e7('0x6e')]);loggerPredictive['info'](_0x96e7('0x8a'),_0x5590be[_0x96e7('0x6f')]);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x8b'));if(_0x5590be['predictiveIntervalTotalCalls']>0x0){if(!_[_0x96e7('0x43')](_0x5590be[_0x96e7('0x6f')])&&_0x5590be['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x96e7('0x82')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x96e7('0x43')](_0x5590be[_0x96e7('0x6e')])&&_0x5590be['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x96e7('0x82')](_0x96e7('0x8c'));}else{loggerPredictive[_0x96e7('0x82')](_0x96e7('0x8d'));}}else{loggerPredictive[_0x96e7('0x82')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x22bab5){return function(_0x674de5){loggerPredictive['info'](_0x96e7('0x8e'));loggerPredictive[_0x96e7('0x82')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x674de5[_0x96e7('0x8f')]);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x90'),_0x674de5[_0x96e7('0x77')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x674de5[_0x96e7('0x78')]);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x91'),_0x674de5['erlangBusyFactor']);loggerPredictive['info'](_0x96e7('0x92'),_0x674de5[_0x96e7('0x78')]);loggerPredictive[_0x96e7('0x82')]('---------------------------');_[_0x96e7('0x93')](_0x22bab5,_0x674de5);};}function getDiff(_0x60354c){var _0xfbb6d=moment()['milliseconds'](0x0);var _0x523432=moment(_0x60354c)['milliseconds'](0x0);return _0xfbb6d[_0x96e7('0x94')](_0x523432,'seconds');}function ifInterval(_0x399374,_0x4aa434){if(_[_0x96e7('0x43')](_0x4aa434)){return![];}return getDiff(_0x4aa434)<_0x399374*0x3c;}function freeVariablesPredictive(_0x111fc3){if(isNotNull(_0x111fc3)){if(!_[_0x96e7('0x43')](_0x111fc3['startProgressive'])){_0x111fc3[_0x96e7('0x79')]=undefined;loggerPredictive[_0x96e7('0x82')](_0x111fc3[_0x96e7('0x46')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x96e7('0x43')](_0x111fc3[_0x96e7('0x28')])){_0x111fc3[_0x96e7('0x28')]=undefined;loggerPredictive[_0x96e7('0x82')](_0x111fc3[_0x96e7('0x46')],_0x96e7('0x95'));}if(!_[_0x96e7('0x43')](_0x111fc3[_0x96e7('0x96')])){clearInterval(_0x111fc3['handlePredictive']);_0x111fc3['handlePredictive']=undefined;loggerPredictive[_0x96e7('0x82')](_0x111fc3[_0x96e7('0x46')],_0x96e7('0x97'));}}}function erlangb(_0x50ca95,_0xa80c68){if(_0xa80c68===0x0){return 0x0;}var _0x51f3e6=0x1;for(var _0x3a5250=0x1;_0x3a5250<=_0xa80c68;_0x3a5250+=0x1){_0x51f3e6=0x1+_0x51f3e6*_0x3a5250/_0x50ca95;}return 0x1/_0x51f3e6;}function isVoiceQueueOutbound(_0x3a0c3d){return _0x3a0c3d===_0x96e7('0x98');}function isNotPreview(_0x4b3f2f){return _0x4b3f2f!=='preview';}function isCampaignIvr(_0x2c24fa){return _0x2c24fa===_0x96e7('0x99');}function getCallerId(_0xcf8aee,_0x5da1e1,_0x4eb637){if(!_[_0x96e7('0x43')](_0x4eb637)&&typeof _0x4eb637===_0x96e7('0x9a')&&!_[_0x96e7('0x4d')](_0x4eb637)){if(!_['isUndefined'](_0x5da1e1)&&typeof _0x5da1e1===_0x96e7('0x9a')&&!_[_0x96e7('0x4d')](_0x5da1e1)){return util['format'](_0x96e7('0x9b'),_0x5da1e1,_0x4eb637);}return util[_0x96e7('0x7f')]('\x22%s\x22\x20<%s>',_0x4eb637,_0x4eb637);}if(!_['isUndefined'](_0xcf8aee)&&typeof _0xcf8aee===_0x96e7('0x9a')&&!_[_0x96e7('0x4d')](_0xcf8aee)){return _0xcf8aee;}return _0x96e7('0x9c');}function loggerCatchQueueSummary(_0x5552fd,_0x3f49a7){return function(_0x590d77){freeVariablesPredictive(_0x3f49a7);emitVoiceQueueSummary(_0x3f49a7);emitCampaignSummary(_0x3f49a7);loggerSyncQueueSummary['debug'](_0x5552fd,util[_0x96e7('0x9d')](_0x590d77,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1d0cb5,_0x165c5a){return function(_0x47d022){loggerPredictive['error'](_0x165c5a[_0x96e7('0x46')],_0x1d0cb5);loggerPredictive['error'](_0x47d022['stack']);freeVariablesPredictive(_0x165c5a);};}function loggerCatch(_0x27dc73){return function(_0xee89f2){logger[_0x96e7('0x9e')](_0x27dc73,util[_0x96e7('0x9d')](_0xee89f2,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x455499){return _0x455499&&!_['isUndefined'](_0x455499)&&_0x455499[_0x96e7('0x9f')]>0x0;}function decremetOriginate(_0x1b7ed8){if(!_[_0x96e7('0x43')](_0x1b7ed8)&&_0x1b7ed8!==null){if(typeof _0x1b7ed8[_0x96e7('0xa0')]!=='undefined'){if(_0x1b7ed8[_0x96e7('0xa0')]>0x0){_0x1b7ed8['originated']-=0x1;}else{logger[_0x96e7('0x9e')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x96e7('0x9e')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x146020,_0x44b81c,_0x12614a){if(_0x44b81c>_0x12614a){for(var _0x4f0051=0x0;_0x4f0051<_0x44b81c-_0x12614a;_0x4f0051+=0x1){decremetOriginate(_0x146020);}}}function loggerGetContactDialer(_0x4014a3,_0x26c36c,_0x564320){return function(_0x3e19d4){checkContactLowerLimitOriginate(_0x26c36c,_0x564320,0x0);logger['error'](_0x4014a3,util[_0x96e7('0x9d')](_0x3e19d4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2da312){return function(_0x42a343){if(isNotNull(_0x42a343)&&isNotNull(_0x42a343[0x0])){if(_0x42a343[0x0]['contactsRescheduled']>0x0){_0x2da312[_0x96e7('0x44')]=_0x96e7('0xa1');logger['info']('[getContactDialer2][ReScheduled]'+_0x2da312[_0x96e7('0x46')],_0x42a343[0x0][_0x96e7('0xa2')],_0x96e7('0xa3'));}else{_0x2da312[_0x96e7('0x44')]=_0x96e7('0xa4');logger[_0x96e7('0x82')]('[getContactDialer2][Empty]'+_0x2da312[_0x96e7('0x46')]);}}};}function notSendMessagesQueue(_0x32d164){if(_0x32d164[_0x96e7('0xa5')]){freeVariablesPredictive(_0x32d164);if(_0x32d164[_0x96e7('0xa0')]===0x0&&_0x32d164[_0x96e7('0x59')]===0x0&&_0x32d164[_0x96e7('0xa6')]===0x0&&(_0x32d164['pTalking']||0x0)===0x0){_0x32d164[_0x96e7('0xa5')]=![];_0x32d164['available']=0x0;_0x32d164[_0x96e7('0x44')]=_0x96e7('0xa7');loggerSyncQueueSummary[_0x96e7('0xa8')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x32d164['name'],_0x96e7('0xa9'));}else{_0x32d164[_0x96e7('0x44')]=_0x96e7('0xaa');loggerSyncQueueSummary[_0x96e7('0xa8')](_0x96e7('0xab'),_0x32d164[_0x96e7('0x46')],_0x96e7('0xac'));}emitVoiceQueueSummary(_0x32d164);}}function notSendMessagesCampaign(_0x21337c){if(_0x21337c['sendMessageOneNotActive']){if(_0x21337c[_0x96e7('0xa0')]===0x0){_0x21337c['sendMessageOneNotActive']=![];_0x21337c[_0x96e7('0x44')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x96e7('0xa8')](_0x96e7('0xad'),_0x21337c[_0x96e7('0x46')],_0x96e7('0xa9'));}else{_0x21337c[_0x96e7('0x44')]=_0x96e7('0xaa');loggerSyncQueueSummary[_0x96e7('0xa8')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x21337c[_0x96e7('0x46')],_0x96e7('0xac'));}emitCampaignSummary(_0x21337c);}}function createObjHistory(_0x3bf58a,_0x36ff00,_0x382112,_0x1d0bb9,_0x12c574){_0x3bf58a['message']=_0x382112;var _0x36fc5a=new Action(_0x3bf58a,_0x36ff00);var _0x118f11=new History(_0x36fc5a);_0x118f11['state']=_0x1d0bb9;_0x118f11['statedesc']=_0x12c574;_0x118f11[_0x96e7('0xae')]=_0x36fc5a[_0x96e7('0xaf')];return _0x118f11;}Dialer[_0x96e7('0x1a')][_0x96e7('0x3f')]=function(){var _0x318ca5=this;setInterval(function(){_0x318ca5[_0x96e7('0xb0')](_0x318ca5['uniqueId'],_0x96e7('0xb1'));_0x318ca5[_0x96e7('0xb0')](_0x318ca5['actions'],_0x96e7('0xb2'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x5a30c6,_0x4425f0){var _0x2aa2b8=this;for(var _0x42f66c in _0x5a30c6){if(typeof _0x5a30c6[_0x42f66c]!==_0x96e7('0xb3')){this[_0x96e7('0x1e')]['enqueue'](function(){if(!_['isNil'](_0x5a30c6[_0x42f66c])){return ami['Action']({'action':_0x96e7('0xb4'),'channel':_0x5a30c6[_0x42f66c][_0x96e7('0xb5')]})['catch'](function(_0x5195fa){if(_0x5195fa[_0x96e7('0x44')]===_0x96e7('0xb6')){setTimeout(function(){if(_0x5a30c6[_0x42f66c]&&_0x5a30c6[_0x42f66c][_0x96e7('0x53')]!==_0x96e7('0x99')){_0x2aa2b8[_0x96e7('0xb7')](_0x2aa2b8['voiceQueues'][_0x5a30c6[_0x42f66c][_0x96e7('0xb8')]]);logger[_0x96e7('0x9e')](_0x96e7('0xb9'),_0x4425f0,_0x42f66c,_0x5a30c6[_0x42f66c][_0x96e7('0xb8')]);delete _0x5a30c6[_0x42f66c];}if(_0x5a30c6[_0x42f66c]&&_0x5a30c6[_0x42f66c][_0x96e7('0x53')]==='ivr'){_0x2aa2b8[_0x96e7('0xb7')](_0x2aa2b8[_0x96e7('0xba')][_0x5a30c6[_0x42f66c]['queue']]);logger[_0x96e7('0x9e')](_0x96e7('0xbb'),_0x4425f0,_0x42f66c,_0x5a30c6[_0x42f66c][_0x96e7('0xb8')]);delete _0x5a30c6[_0x42f66c];}},0x2328);}});}});}}};Dialer[_0x96e7('0x1a')]['countReScheduled']=function(_0xbdd78e){return Promise[_0x96e7('0xbc')]()['then'](cmHopper['countReScheduled'](_0xbdd78e))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xbe')));};Dialer[_0x96e7('0x1a')]['checkIsBlackList']=function(_0x122133){return Promise['resolve']()[_0x96e7('0x41')](cmHopperBlack[_0x96e7('0xbf')](_0x122133))[_0x96e7('0xbd')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype'][_0x96e7('0xc0')]=function(_0x5becc2,_0x542763,_0x4980fb){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x96e7('0xc0')](_0x5becc2,_0x542763,_0x4980fb))[_0x96e7('0xbd')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x96e7('0x1a')]['swapAdditionalPhones']=function(_0x18f161,_0x50e6e8,_0x33ae62){return Promise[_0x96e7('0xbc')]()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x18f161,_0x50e6e8,_0x33ae62))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xc1')));};Dialer[_0x96e7('0x1a')][_0x96e7('0xc2')]=function(_0x1097e3){return Promise[_0x96e7('0xbc')]()['then'](cmHopperBlack[_0x96e7('0xc2')](_0x1097e3))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xc3')));};Dialer[_0x96e7('0x1a')][_0x96e7('0xc4')]=function(_0xc08b2c){return Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](cmHopperHistory['avgHandleTime'](_0xc08b2c))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xc5')));};Dialer[_0x96e7('0x1a')][_0x96e7('0xc6')]=function(_0x5afe17){return Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](cmHopper[_0x96e7('0xc6')](_0x5afe17))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xc7')));};Dialer['prototype'][_0x96e7('0xc8')]=function(_0x3394b0,_0x380dfa,_0x15b1a5){return Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](cmHopper['unlockContact'](_0x3394b0,_0x380dfa,_0x15b1a5))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer['prototype'][_0x96e7('0xc9')]=function(_0x5a8eb7,_0x16b4f7,_0x4f15d2,_0x31c719,_0x34b4bb){return Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](cmHopper[_0x96e7('0xc9')](_0x5a8eb7,_0x16b4f7,_0x4f15d2,_0x31c719))[_0x96e7('0xbd')](function(_0x2fdcff){_0x34b4bb[_0x96e7('0xca')]-=_0x4f15d2;_0x34b4bb[_0x96e7('0xca')]=_0x34b4bb['temp']>0x0?_0x34b4bb[_0x96e7('0xca')]:0x0;loggerCatch(_0x96e7('0xcb'))(_0x2fdcff);});};Dialer[_0x96e7('0x1a')][_0x96e7('0xcc')]=function(_0x59eaa4,_0x31aed3,_0x4754bf,_0x2cfed1){return Promise['resolve']()[_0x96e7('0x41')](cmHopper[_0x96e7('0xcc')](_0x59eaa4,_0x31aed3,_0x4754bf))[_0x96e7('0xbd')](function(_0x19b4b7){_0x2cfed1[_0x96e7('0xca')]-=_0x31aed3;_0x2cfed1[_0x96e7('0xca')]=_0x2cfed1[_0x96e7('0xca')]>0x0?_0x2cfed1[_0x96e7('0xca')]:0x0;loggerCatch(_0x96e7('0xcd'))(_0x19b4b7);});};Dialer['prototype'][_0x96e7('0xce')]=function(_0x5545dc){return Promise[_0x96e7('0xbc')]()['then'](voiceQueueRt[_0x96e7('0xce')](_0x5545dc))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x96e7('0xcf')]=function(_0x5cfbae){return Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](cmHopper['moveContactManagedDialer'](_0x5cfbae))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xd0')));};Dialer['prototype'][_0x96e7('0xd1')]=function(_0xeec91){return Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](cmHopperHistory[_0x96e7('0xd1')](_0xeec91))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xd2')));};Dialer[_0x96e7('0x1a')][_0x96e7('0xb7')]=function(_0x5ac38c){if(!_[_0x96e7('0x43')](_0x5ac38c)&&_0x5ac38c!==null){if(typeof _0x5ac38c[_0x96e7('0xa0')]!=='undefined'){if(_0x5ac38c['originated']>0x0){_0x5ac38c[_0x96e7('0xa0')]-=0x1;}else{logger['error'](_0x96e7('0xd3'));}}}else{logger[_0x96e7('0x9e')](_0x96e7('0xd4'));}};Dialer[_0x96e7('0x1a')][_0x96e7('0xd5')]=function(_0x5220f1,_0x1d4c40){var _0x5b3208=this;return function(_0x597ff7){_0x5b3208[_0x96e7('0xb7')](_0x1d4c40);logger['error'](_0x5220f1,util[_0x96e7('0x9d')](_0x597ff7,{'showHidden':![],'depth':null}));};};Dialer[_0x96e7('0x1a')]['emptyContact']=function(_0x1b235d,_0x37d2b1,_0x16a364){var _0xa0c3e7={'state':0x19,'statedesc':_0x96e7('0xd6')};this[_0x96e7('0xb7')](_0x37d2b1);this[_0x96e7('0xd7')](_['merge'](_0xa0c3e7,_['pick'](_0x16a364,['ContactId','ListId',_0x96e7('0xd8'),_0x96e7('0xd9'),_0x96e7('0xda')])),_0x96e7('0xdb'),_0x96e7('0xdc'));logger[_0x96e7('0x9e')](_0x1b235d);};Dialer[_0x96e7('0x1a')][_0x96e7('0xdd')]=function(_0x50d2ae){return _0x50d2ae===_0x96e7('0xde');};Dialer['prototype']['isTrunkReachable']=function(_0x1c4382){return!_[_0x96e7('0x43')](_0x1c4382)&&_0x1c4382&&!_[_0x96e7('0x43')](_0x1c4382[_0x96e7('0x46')])&&!_[_0x96e7('0x43')](_0x1c4382[_0x96e7('0x7b')])&&_0x1c4382[_0x96e7('0x7b')]&&(this[_0x96e7('0x22')][util[_0x96e7('0x7f')](_0x96e7('0xdf'),_0x1c4382[_0x96e7('0x46')])][_0x96e7('0xb4')]===_0x96e7('0xe0')||this[_0x96e7('0x22')][util[_0x96e7('0x7f')](_0x96e7('0xdf'),_0x1c4382[_0x96e7('0x46')])]['status']===_0x96e7('0xe1'));};Dialer[_0x96e7('0x1a')][_0x96e7('0xd7')]=function(_0x4700a8,_0x4e3213,_0x54aa97){this[_0x96e7('0xd1')](_0x4700a8)['catch'](loggerCatch(_0x4e3213));this[_0x96e7('0xcf')](_0x4700a8)[_0x96e7('0xbd')](loggerCatch(_0x54aa97));};Dialer[_0x96e7('0x1a')][_0x96e7('0x3a')]=function(_0x15ce5f){var _0x3d646c=this;var _0x3d160c=this[_0x96e7('0x26')][_0x15ce5f['uniqueid']];var _0xcea19a;if(!_[_0x96e7('0xe2')](_0x15ce5f)&&!_['isNil'](_0x15ce5f[_0x96e7('0xe3')])&&!_[_0x96e7('0xe2')](_0x15ce5f['variable']['amdstatus'])&&_0x15ce5f[_0x96e7('0xe4')]===_0x96e7('0xe5')&&_0x3d160c){if(_0x3d160c[_0x96e7('0x53')]!==_0x96e7('0x99')&&this['voiceQueues'][_0x3d160c['queue']][_0x96e7('0xe6')]&&_0x15ce5f[_0x96e7('0xe7')]===_0x96e7('0xe8')){delete this[_0x96e7('0x26')][_0x15ce5f[_0x96e7('0xe9')]];this['updateOriginated'](this[_0x96e7('0x20')][_0x3d160c[_0x96e7('0xb8')]]);this[_0x96e7('0x20')][_0x3d160c[_0x96e7('0xb8')]][_0x96e7('0xea')]+=0x1;this[_0x96e7('0x20')][_0x3d160c[_0x96e7('0xb8')]][_0x96e7('0x62')]+=0x1;_0xcea19a=new Hangup(_0x3d160c,_0x15ce5f);_0xcea19a[_0x96e7('0xeb')]=0x12;_0xcea19a[_0x96e7('0xec')]=_0x96e7('0xed');_0xcea19a[_0x96e7('0xee')]='AMD';ami[_0x96e7('0x52')]('custom:amd',ut[_0x96e7('0xef')](_0xcea19a,'amd'));this[_0x96e7('0xd7')](_0xcea19a,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x3d160c[_0x96e7('0x53')]!=='ivr'&&this[_0x96e7('0x20')][_0x3d160c[_0x96e7('0xb8')]][_0x96e7('0xe6')]&&_0x15ce5f[_0x96e7('0xe7')]===_0x96e7('0xf0')){return new Promise(function(_0x4ce8e2,_0x52675c){delete _0x3d646c[_0x96e7('0x26')][_0x15ce5f[_0x96e7('0xe9')]];_0x3d646c[_0x96e7('0xb7')](_0x3d646c['voiceQueues'][_0x3d160c[_0x96e7('0xb8')]]);_0x3d646c[_0x96e7('0x20')][_0x3d160c[_0x96e7('0xb8')]]['outboundAnswerCallsDay']+=0x1;_0x3d646c[_0x96e7('0x20')][_0x3d160c[_0x96e7('0xb8')]][_0x96e7('0x62')]+=0x1;var _0x1e71ee=_0x3d646c['voiceQueues'][_0x3d160c[_0x96e7('0xb8')]];var _0x2d08ed=new Hangup(_0x3d160c,_0x15ce5f);_0x2d08ed[_0x96e7('0xeb')]=0x13;_0x2d08ed[_0x96e7('0xec')]=_0x96e7('0xf1');_0x2d08ed['membername']=_0x96e7('0xf2');_0x2d08ed[_0x96e7('0xf3')]+=0x1;_0x2d08ed['countglobal']+=0x1;_0x2d08ed[_0x96e7('0xf4')]=!![];ami['emit']('custom:amd',ut[_0x96e7('0xef')](_0x2d08ed,_0x96e7('0xf4')));_0x3d646c['createHistory'](_0x2d08ed)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xf5')));if(_0x2d08ed[_0x96e7('0xf6')]+_0x2d08ed[_0x96e7('0xf7')]+_0x2d08ed[_0x96e7('0xf8')]+_0x2d08ed[_0x96e7('0xf9')]+_0x2d08ed[_0x96e7('0xfa')]+_0x2d08ed[_0x96e7('0xfb')]+_0x2d08ed[_0x96e7('0xf3')]+_0x2d08ed[_0x96e7('0xfc')]>=_0x1e71ee[_0x96e7('0xfd')]){_0x3d646c['stateGlobal'](_0x2d08ed,_0x4ce8e2,_0x52675c,'reason19\x20machine....');}else{if(_0x2d08ed[_0x96e7('0xf3')]>=_0x1e71ee[_0x96e7('0xfe')]){_0x3d646c['createStateFinal'](_0x2d08ed,_0x4ce8e2,_0x52675c,_0x96e7('0xff'));}else{_0x3d646c[_0x96e7('0xc6')]({'active':![],'countmachineretry':_0x2d08ed[_0x96e7('0xf3')],'scheduledat':moment()['add'](_0x1e71ee[_0x96e7('0x100')],_0x96e7('0x101'))[_0x96e7('0x7f')](_0x96e7('0x102')),'ContactId':_0x2d08ed['ContactId'],'ListId':_0x2d08ed['ListId'],'VoiceQueueId':_0x2d08ed['VoiceQueueId']||undefined,'CampaignId':_0x2d08ed[_0x96e7('0xda')]||undefined})[_0x96e7('0xbd')](loggerCatch('[rescheduleContact][Machine]'));_0x4ce8e2({'reschedule':0x1});}}});}if(_0x3d160c[_0x96e7('0x53')]===_0x96e7('0x99')&&this[_0x96e7('0xba')][_0x3d160c[_0x96e7('0xb8')]][_0x96e7('0xe6')]&&_0x15ce5f['value']===_0x96e7('0xe8')){delete this[_0x96e7('0x26')][_0x15ce5f[_0x96e7('0xe9')]];this[_0x96e7('0xb7')](this[_0x96e7('0xba')][_0x3d160c[_0x96e7('0xb8')]]);_0xcea19a=new Hangup(_0x3d160c,_0x15ce5f);_0xcea19a['state']=0x12;_0xcea19a[_0x96e7('0xec')]=_0x96e7('0xed');_0xcea19a['membername']=_0x96e7('0xf2');ami['emit'](_0x96e7('0x103'),ut['buildObj'](_0xcea19a,_0x96e7('0xf4')));this['saveInDb'](_0xcea19a,_0x96e7('0x104'),_0x96e7('0x105'));}if(_0x3d160c[_0x96e7('0x53')]===_0x96e7('0x99')&&this[_0x96e7('0xba')][_0x3d160c[_0x96e7('0xb8')]][_0x96e7('0xe6')]&&_0x15ce5f['value']===_0x96e7('0xf0')){return new Promise(function(_0x44c4a4,_0x5cdf82){delete _0x3d646c['uniqueId'][_0x15ce5f['uniqueid']];_0x3d646c['updateOriginated'](_0x3d646c['campaigns'][_0x3d160c[_0x96e7('0xb8')]]);_0x3d646c[_0x96e7('0xba')][_0x3d160c['queue']][_0x96e7('0xea')]+=0x1;_0x3d646c[_0x96e7('0xba')][_0x3d160c[_0x96e7('0xb8')]][_0x96e7('0x62')]+=0x1;var _0x7a07ac=_0x3d646c[_0x96e7('0xba')][_0x3d160c[_0x96e7('0xb8')]];var _0x12136e=new Hangup(_0x3d160c,_0x15ce5f);_0x12136e['state']=0x13;_0x12136e[_0x96e7('0xec')]=_0x96e7('0xf1');_0x12136e[_0x96e7('0xee')]=_0x96e7('0xf2');_0x12136e[_0x96e7('0xf3')]+=0x1;_0x12136e[_0x96e7('0x106')]+=0x1;_0x12136e[_0x96e7('0xf4')]=!![];ami[_0x96e7('0x52')]('custom:amd',ut[_0x96e7('0xef')](_0x12136e,'amd'));_0x3d646c[_0x96e7('0xd1')](_0x12136e)[_0x96e7('0xbd')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x12136e['countbusyretry']+_0x12136e[_0x96e7('0xf7')]+_0x12136e[_0x96e7('0xf8')]+_0x12136e[_0x96e7('0xf9')]+_0x12136e[_0x96e7('0xfa')]+_0x12136e[_0x96e7('0xfb')]+_0x12136e['countmachineretry']+_0x12136e[_0x96e7('0xfc')]>=_0x7a07ac[_0x96e7('0xfd')]){_0x3d646c[_0x96e7('0x107')](_0x12136e,_0x44c4a4,_0x5cdf82,'reason19\x20machine....');}else{if(_0x12136e['countmachineretry']>=_0x7a07ac[_0x96e7('0xfe')]){_0x3d646c['createStateFinal'](_0x12136e,_0x44c4a4,_0x5cdf82,_0x96e7('0xff'));}else{_0x3d646c['rescheduleContact']({'active':![],'countmachineretry':_0x12136e[_0x96e7('0xf3')],'scheduledat':moment()[_0x96e7('0x108')](_0x7a07ac[_0x96e7('0x100')],_0x96e7('0x101'))[_0x96e7('0x7f')](_0x96e7('0x102')),'ContactId':_0x12136e[_0x96e7('0x109')],'ListId':_0x12136e[_0x96e7('0x10a')],'VoiceQueueId':_0x12136e[_0x96e7('0xd9')]||undefined,'CampaignId':_0x12136e[_0x96e7('0xda')]||undefined})[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x10b')));_0x44c4a4({'reschedule':0x1});}}});}}};Dialer[_0x96e7('0x1a')][_0x96e7('0x36')]=function(_0x233385){var _0x1682f1=this[_0x96e7('0x26')][_0x233385[_0x96e7('0xe9')]];var _0x342773;if(_0x1682f1&&_0x1682f1[_0x96e7('0x53')]===_0x96e7('0x99')){delete this[_0x96e7('0x26')][_0x233385[_0x96e7('0xe9')]];this[_0x96e7('0xb7')](this[_0x96e7('0xba')][_0x1682f1[_0x96e7('0xb8')]]);this[_0x96e7('0xba')][_0x1682f1[_0x96e7('0xb8')]]['ivrAnswerCallsDay']+=0x1;_0x342773=new Hangup(_0x1682f1,_0x233385);this[_0x96e7('0xd1')](_0x342773)[_0x96e7('0xbd')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x96e7('0xcf')](_0x342773)[_0x96e7('0xbd')](loggerCatch('[syncHangupIvr]'));}if(_0x1682f1&&_0x1682f1[_0x96e7('0x53')]!==_0x96e7('0x99')&&isNotNull(this[_0x96e7('0x20')][_0x1682f1['queue']][_0x96e7('0x10c')])){delete this[_0x96e7('0x26')][_0x233385['uniqueid']];this[_0x96e7('0xb7')](this[_0x96e7('0x20')][_0x1682f1[_0x96e7('0xb8')]]);this['voiceQueues'][_0x1682f1[_0x96e7('0xb8')]][_0x96e7('0xea')]+=0x1;this[_0x96e7('0x20')][_0x1682f1['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x342773=new Hangup(_0x1682f1,_0x233385);_0x342773[_0x96e7('0xeb')]=0x10;_0x342773[_0x96e7('0xec')]=_0x96e7('0x10d');_0x342773[_0x96e7('0xee')]=_0x96e7('0x10e');this[_0x96e7('0xd1')](_0x342773)[_0x96e7('0xbd')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x342773)['catch'](loggerCatch(_0x96e7('0x10f')));}if(_0x1682f1&&_0x1682f1[_0x96e7('0x53')]!==_0x96e7('0x99')&&!isNotNull(this[_0x96e7('0x20')][_0x1682f1['queue']][_0x96e7('0x10c')])){delete this[_0x96e7('0x26')][_0x233385[_0x96e7('0xe9')]];this[_0x96e7('0xb7')](this[_0x96e7('0x20')][_0x1682f1[_0x96e7('0xb8')]]);this['voiceQueues'][_0x1682f1[_0x96e7('0xb8')]][_0x96e7('0x6c')]+=0x1;_0x342773=new Hangup(_0x1682f1,_0x233385);_0x342773[_0x96e7('0xeb')]=0xc;_0x342773['statedesc']=_0x233385['cause-txt'];_0x342773['membername']='Unknow';this[_0x96e7('0xd1')](_0x342773)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x110')));this['moveContactManagedDialer'](_0x342773)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x10f')));}};Dialer[_0x96e7('0x1a')][_0x96e7('0x32')]=function(_0x5d7d0a){var _0x4f79c4=this[_0x96e7('0x26')][_0x5d7d0a['uniqueid']];if(this[_0x96e7('0x20')][_0x5d7d0a[_0x96e7('0xb8')]]){if(_0x4f79c4&&_0x4f79c4[_0x96e7('0x53')]!==_0x96e7('0x99')){delete this[_0x96e7('0x26')][_0x5d7d0a['uniqueid']];this['voiceQueues'][_0x5d7d0a['queue']][_0x96e7('0xea')]+=0x1;var _0x181329=new AgentComplete(_0x4f79c4,_0x5d7d0a);if(_0x5d7d0a['reason']===_0x96e7('0x111')){_0x181329[_0x96e7('0x112')]=this[_0x96e7('0x20')][_0x5d7d0a['queue']][_0x96e7('0x113')]&&this['voiceQueues'][_0x5d7d0a[_0x96e7('0xb8')]][_0x96e7('0x114')]?moment()['format'](_0x96e7('0x102')):undefined;}this['createHistory'](_0x181329)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x115')));this['moveContactManagedDialer'](_0x181329)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x116')));}}};Dialer[_0x96e7('0x1a')][_0x96e7('0x2d')]=function(_0x20809e){if(this[_0x96e7('0x20')][_0x20809e['queue']]){if(this[_0x96e7('0x26')][_0x20809e['uniqueid']]&&this[_0x96e7('0x26')][_0x20809e[_0x96e7('0xe9')]]['type']!=='ivr'){this['updateOriginated'](this[_0x96e7('0x20')][_0x20809e[_0x96e7('0xb8')]]);this[_0x96e7('0x26')][_0x20809e['uniqueid']][_0x96e7('0x117')]=moment()[_0x96e7('0x7f')](_0x96e7('0x102'));}}};Dialer[_0x96e7('0x1a')][_0x96e7('0x118')]=function(_0x2321ff,_0x245b11){this[_0x96e7('0xd1')](_0x2321ff)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x115')));if(_0x245b11==0x0){this['moveContactManagedDialer'](_0x2321ff)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x119')));}};Dialer[_0x96e7('0x1a')][_0x96e7('0x30')]=function(_0x513710){var _0x2b7d54=this['uniqueId'][_0x513710[_0x96e7('0xe9')]];var _0x2df4a2=this;var _0x5e8b17=![];var _0xe82654;var _0x392739;if(this[_0x96e7('0x20')][_0x513710['queue']]){if(_0x2b7d54&&_0x2b7d54[_0x96e7('0x53')]!==_0x96e7('0x99')){delete this[_0x96e7('0x26')][_0x513710[_0x96e7('0xe9')]];this[_0x96e7('0xb7')](this['voiceQueues'][_0x513710[_0x96e7('0xb8')]]);_0x2b7d54[_0x96e7('0x11a')]=moment()[_0x96e7('0x7f')](_0x96e7('0x102'));var _0x1b32c6=new QueueCallerAbandon(_0x2b7d54,_0x513710);if(getSeconds(_0x2b7d54[_0x96e7('0x11a')],_0x2b7d54[_0x96e7('0x11b')])>=_0x2b7d54[_0x96e7('0x11c')]){this['voiceQueues'][_0x513710[_0x96e7('0xb8')]][_0x96e7('0x87')]+=0x1;this[_0x96e7('0x20')][_0x513710[_0x96e7('0xb8')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x96e7('0x20')][_0x513710[_0x96e7('0xb8')]][_0x96e7('0x71')]+=0x1;_0x1b32c6[_0x96e7('0xeb')]=0xa;_0x1b32c6[_0x96e7('0xec')]=_0x96e7('0x11d');_0x1b32c6[_0x96e7('0x11e')]='TIMEOUT';_0x1b32c6['agiafterat']=this[_0x96e7('0x20')][_0x513710['queue']]['dialQueueProject2']?moment()[_0x96e7('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x1b32c6[_0x96e7('0xfa')]+=0x1;_0x1b32c6[_0x96e7('0x106')]+=0x1;_0xe82654=this[_0x96e7('0x20')][_0x513710[_0x96e7('0xb8')]]['dialDropRetryFrequency'];_0x392739=this[_0x96e7('0x20')][_0x513710['queue']][_0x96e7('0x11f')];_0x2df4a2['verifyAdditionalPhones'](_0x1b32c6,_0x1b32c6[_0x96e7('0xeb')],_0x2b7d54[_0x96e7('0x120')])[_0x96e7('0x41')](function(_0x301e11){_0x5e8b17=_0x301e11[_0x96e7('0x121')]==0x1;if(_0x1b32c6['countdropretry']>=_0x2df4a2[_0x96e7('0x20')][_0x513710['queue']][_0x96e7('0x122')]){_0x2df4a2['queueCallerAbandonCreateState'](_0x1b32c6,_0x301e11[_0x96e7('0x121')]);}else{_0x2df4a2[_0x96e7('0xc6')]({'active':![],'countdropretry':_0x1b32c6['countdropretry'],'scheduledat':moment()[_0x96e7('0x108')](_0x2df4a2[_0x96e7('0x20')][_0x513710[_0x96e7('0xb8')]][_0x96e7('0x123')],_0x96e7('0x101'))[_0x96e7('0x7f')](_0x96e7('0x102')),'ContactId':_0x2b7d54[_0x96e7('0x109')],'ListId':_0x2b7d54[_0x96e7('0x10a')],'VoiceQueueId':_0x2b7d54[_0x96e7('0xd9')]||undefined,'CampaignId':_0x2b7d54['CampaignId']||undefined})[_0x96e7('0xbd')](loggerCatch('[rescheduleContact][Drop]'));var _0x6e68be=new History(_0x1b32c6);_0x6e68be[_0x96e7('0xeb')]=0xa;_0x6e68be['statedesc']=_0x96e7('0x11d');_0x6e68be[_0x96e7('0xaf')]=moment()['format'](_0x96e7('0x102'));_0x6e68be[_0x96e7('0xae')]=_0x6e68be[_0x96e7('0xaf')];_0x6e68be[_0x96e7('0x124')]=_0x1b32c6[_0x96e7('0x124')];_0x6e68be['calleridnum']=_0x1b32c6[_0x96e7('0x125')];_0x2df4a2[_0x96e7('0xd1')](_0x6e68be)['catch'](loggerCatch(_0x96e7('0x126')));}})[_0x96e7('0x41')](function(){if(_0x5e8b17)_0x2df4a2[_0x96e7('0x127')](_0x1b32c6,_0xe82654,_0x392739)[_0x96e7('0x41')](function(){return 0x1;});});}else{this[_0x96e7('0x20')][_0x513710[_0x96e7('0xb8')]][_0x96e7('0x70')]+=0x1;this['voiceQueues'][_0x513710[_0x96e7('0xb8')]][_0x96e7('0x66')]+=0x1;_0x1b32c6[_0x96e7('0xeb')]=0xb;_0x1b32c6[_0x96e7('0xec')]='Abandoned';_0x1b32c6[_0x96e7('0x11e')]='CALLEREXIT';_0x1b32c6['countabandonedretry']+=0x1;_0x1b32c6[_0x96e7('0x106')]+=0x1;_0xe82654=this['voiceQueues'][_0x513710[_0x96e7('0xb8')]][_0x96e7('0x128')];_0x392739=this['voiceQueues'][_0x513710['queue']][_0x96e7('0x11f')];_0x2df4a2['verifyAdditionalPhones'](_0x1b32c6,_0x1b32c6[_0x96e7('0xeb')],_0x2b7d54[_0x96e7('0x120')])['then'](function(_0x1069fc){if(_0x1b32c6[_0x96e7('0xfb')]>=_0x2df4a2[_0x96e7('0x20')][_0x513710[_0x96e7('0xb8')]][_0x96e7('0x129')]){_0x2df4a2[_0x96e7('0x118')](_0x1b32c6,_0x1069fc[_0x96e7('0x121')]);}else{_0x2df4a2[_0x96e7('0xc6')]({'active':![],'countabandonedretry':_0x1b32c6['countabandonedretry'],'scheduledat':moment()['add'](_0x2df4a2[_0x96e7('0x20')][_0x513710[_0x96e7('0xb8')]][_0x96e7('0x128')],'minutes')[_0x96e7('0x7f')](_0x96e7('0x102')),'ContactId':_0x2b7d54[_0x96e7('0x109')],'ListId':_0x2b7d54[_0x96e7('0x10a')],'VoiceQueueId':_0x2b7d54[_0x96e7('0xd9')]||undefined,'CampaignId':_0x2b7d54[_0x96e7('0xda')]||undefined})[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x12a')));var _0x48c47b=new History(_0x1b32c6);_0x48c47b[_0x96e7('0xeb')]=0xb;_0x48c47b[_0x96e7('0xec')]=_0x96e7('0x12b');_0x48c47b['starttime']=moment()[_0x96e7('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x48c47b[_0x96e7('0xae')]=_0x48c47b[_0x96e7('0xaf')];_0x48c47b[_0x96e7('0x124')]=_0x1b32c6[_0x96e7('0x124')];_0x48c47b[_0x96e7('0x125')]=_0x1b32c6['calleridnum'];_0x2df4a2[_0x96e7('0xd1')](_0x48c47b)[_0x96e7('0xbd')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x5e8b17)_0x2df4a2[_0x96e7('0x127')](_0x1b32c6,_0xe82654,_0x392739)[_0x96e7('0x41')](function(){return 0x1;});});}}}};Dialer[_0x96e7('0x1a')][_0x96e7('0x38')]=function(_0x3fd799){if(this[_0x96e7('0x25')][_0x3fd799[_0x96e7('0xe9')]]){this['actions'][_0x3fd799[_0x96e7('0xe9')]][_0x96e7('0xb5')]=_0x3fd799['channel'];}if(this[_0x96e7('0x26')][_0x3fd799[_0x96e7('0xe9')]]){this[_0x96e7('0x26')][_0x3fd799[_0x96e7('0xe9')]][_0x96e7('0xb5')]=_0x3fd799['channel'];}};Dialer['prototype']['syncQueueMember']=function(_0x15678e){if(strategy[this['voiceQueues'][this[_0x96e7('0x25')][_0x15678e[_0x96e7('0x12c')]]['queue']][_0x96e7('0x54')]]==='roundrobin'){if(this['actions'][_0x15678e[_0x96e7('0x12c')]]&&_[_0x96e7('0xe2')](this['actions'][_0x15678e[_0x96e7('0x12c')]][_0x96e7('0x12d')])&&_0x15678e[_0x96e7('0xb4')]==='1'&&_0x15678e['paused']==='0'){if(this[_0x96e7('0x21')][_0x15678e['stateinterface']]){if(!this[_0x96e7('0x21')][_0x15678e[_0x96e7('0x12e')]][_0x96e7('0x12d')]){this[_0x96e7('0x21')][_0x15678e[_0x96e7('0x12e')]][_0x96e7('0x12d')]=!![];this[_0x96e7('0x25')][_0x15678e[_0x96e7('0x12c')]][_0x96e7('0x12d')]=!![];this[_0x96e7('0x25')][_0x15678e['actionid']][_0x96e7('0x12e')]=_0x15678e[_0x96e7('0x12e')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x15678e['actionid']][_0x96e7('0xb8')]][_0x96e7('0x54')]]||'rrmemory')===_0x96e7('0x18')){if(this[_0x96e7('0x25')][_0x15678e[_0x96e7('0x12c')]]){if(this['agents'][_0x15678e[_0x96e7('0x12e')]]){this[_0x96e7('0x25')][_0x15678e[_0x96e7('0x12c')]][_0x96e7('0x12e')]=_0x15678e[_0x96e7('0x12e')];if(_[_0x96e7('0xe2')](this[_0x96e7('0x2a')][this[_0x96e7('0x25')][_0x15678e[_0x96e7('0x12c')]][_0x96e7('0xb8')]])){this[_0x96e7('0x2a')][this[_0x96e7('0x25')][_0x15678e[_0x96e7('0x12c')]][_0x96e7('0xb8')]]=[];}this['queueBooked'][this['actions'][_0x15678e[_0x96e7('0x12c')]][_0x96e7('0xb8')]][_0x96e7('0x12f')](_['merge'](_['pick'](this[_0x96e7('0x25')][_0x15678e[_0x96e7('0x12c')]],[_0x96e7('0x130'),'stateinterface']),{'status':_0x15678e['status'],'paused':_0x15678e[_0x96e7('0x131')]}));}}}};function unlockQueueStatus(_0x4d7db9,_0xa895b1){setTimeout(function(){if(_[_0x96e7('0x43')](_0x4d7db9[_0x96e7('0x132')])){loggerBooked[_0x96e7('0x9e')](_0x96e7('0x133'),_0xa895b1);}_0x4d7db9[_0x96e7('0x132')]=!![];loggerBooked[_0x96e7('0x82')]('[booked][unlockQueueStatus]',_0xa895b1,JSON[_0x96e7('0x50')](_['pick'](_0x4d7db9,[_0x96e7('0x46'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x96e7('0x1a')][_0x96e7('0x134')]=function(_0x38c18d){var _0x229c1c=this;var _0x48081a=_0x229c1c[_0x96e7('0x20')][_0x229c1c[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xb8')]];if(strategy[this[_0x96e7('0x20')][this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]]['queue']][_0x96e7('0x54')]]===_0x96e7('0x19')){if(this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]]&&this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]]['stateinterface']){this[_0x96e7('0x1f')][_0x96e7('0x135')](this['actions'][_0x38c18d[_0x96e7('0x12c')]]['idHopper'],this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0x12e')])[_0x96e7('0xbd')](function(_0x503273){logger['error'](_0x96e7('0x136'),util['inspect'](_0x503273,{'showHidden':![],'depth':null}));})[_0x96e7('0x1d')](function(){_0x229c1c['updateOriginated'](_0x229c1c[_0x96e7('0x20')][_0x229c1c['actions'][_0x38c18d[_0x96e7('0x12c')]]['queue']]);_0x229c1c[_0x96e7('0x21')][_0x229c1c[_0x96e7('0x25')][_0x38c18d['actionid']][_0x96e7('0x12e')]]['locked']=![];delete _0x229c1c['actions'][_0x38c18d['actionid']];unlockQueueStatus(_0x48081a);});}else{this['updateOriginated'](this[_0x96e7('0x20')][this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xb8')]]);this[_0x96e7('0xc6')]({'active':![],'ContactId':this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]]['ContactId'],'ListId':this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]]['ListId'],'VoiceQueueId':this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xd9')]||undefined,'CampaignId':this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xda')]||undefined})[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x137')));delete this['actions'][_0x38c18d[_0x96e7('0x12c')]];unlockQueueStatus(_0x48081a);}}else if((strategy[this['voiceQueues'][this['actions'][_0x38c18d[_0x96e7('0x12c')]]['queue']][_0x96e7('0x54')]]||'rrmemory')===_0x96e7('0x18')){var _0x2c07e1;if(this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]]&&!_[_0x96e7('0x4d')](this[_0x96e7('0x2a')][this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xb8')]])){if(this[_0x96e7('0x2b')][_0x229c1c[_0x96e7('0x25')][_0x38c18d['actionid']]['queue']]){this[_0x96e7('0x2b')][_0x229c1c[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xb8')]]=this[_0x96e7('0x2b')][this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xb8')]]?this['queueBookedRR'][this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xb8')]]:this[_0x96e7('0x2a')][this[_0x96e7('0x25')][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xb8')]]?this[_0x96e7('0x2a')][this[_0x96e7('0x25')][_0x38c18d['actionid']][_0x96e7('0xb8')]][_0x96e7('0x138')]||0x0:0x0;}this[_0x96e7('0x2a')][this[_0x96e7('0x25')][_0x38c18d['actionid']][_0x96e7('0xb8')]][_0x96e7('0x138')]=this[_0x96e7('0x2b')][this['actions'][_0x38c18d[_0x96e7('0x12c')]][_0x96e7('0xb8')]];for(var _0x1d7eaf=0x0;_0x1d7eaf=0x0;})[_0x96e7('0xbd')](myreject(_0x15e374)));}}else{_0x422fc0[_0x96e7('0x12f')](ami[_0x96e7('0x155')]({'action':_0x96e7('0x14e'),'command':util['format'](_0x96e7('0x14f'),_0x334f6d,!_[_0x96e7('0x43')](config[_0x96e7('0x151')][_0x39f6f9])?_0x39f6f9:'')})[_0x96e7('0x41')](function(_0xb10ee4){return _0xb10ee4['content']['indexOf']('true')>=0x0;})[_0x96e7('0xbd')](myreject(_0x15e374)));}Promise['all'](_0x422fc0)[_0x96e7('0x41')](function(_0x348e11){var _0x40d425=_[_0x96e7('0x156')](_0x348e11);if(_0x40d425){return _0x568029(_0x40d425);}else{_0x1c52d0[_0x96e7('0x44')]=_0x43e6c6?'GLOBAL_INTERVAL_IS_OVERTIME':_0x96e7('0x157');return _0x15e374(msgResponse(_0x96e7('0x158'),_0x96e7('0x14c'),_0x96e7('0x159')+_0x43e6c6+'\x20'+_0x55c817+_0x96e7('0x15a')+util['inspect'](_0x334f6d,{'showHidden':![],'depth':null})+_0x96e7('0x15b')+_0x39f6f9));}})[_0x96e7('0xbd')](function(_0x36e953){return _0x15e374(msgResponse('ifTime',_0x96e7('0x14c'),JSON[_0x96e7('0x50')](_0x36e953)));});});};Dialer['prototype'][_0x96e7('0x15c')]=function(_0x1b863a){var _0x8ad7fa=this;return function(){switch(_0x1b863a[_0x96e7('0x5e')]){case _0x96e7('0x15d'):freeVariablesPredictive(_0x1b863a);_0x8ad7fa[_0x96e7('0x15e')](_0x1b863a,0x1);break;case _0x96e7('0x15f'):freeVariablesPredictive(_0x1b863a);_0x8ad7fa[_0x96e7('0x15e')](_0x1b863a,_0x1b863a[_0x96e7('0x160')]);break;case'predictive':_0x8ad7fa[_0x96e7('0xa')](_0x1b863a);break;case'booked':freeVariablesPredictive(_0x1b863a);_0x8ad7fa[_0x96e7('0x15e')](_0x1b863a,0x1);break;default:freeVariablesPredictive(_0x1b863a);logger[_0x96e7('0x9e')](_0x96e7('0x161'),_0x1b863a[_0x96e7('0x46')],_0x96e7('0x162'));}};};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x5bbaae){return Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](cmHopper[_0x96e7('0x163')](_0x5bbaae['id'],previewRecallmeReminderInterval))[_0x96e7('0x41')](function(_0x839cc6){for(var _0x33c422=0x0;_0x33c422<_0x839cc6[_0x96e7('0x9f')];_0x33c422++){var _0x1fd67e=_0x839cc6[_0x33c422]['Agent'][_0x96e7('0x46')];if(_0x1fd67e)io['to'](util['format'](_0x96e7('0x164'),_0x1fd67e))['emit'](_0x96e7('0x165'),{'hopper':_0x839cc6[_0x33c422]});}})[_0x96e7('0xbd')](function(){});};Dialer[_0x96e7('0x1a')][_0x96e7('0x166')]=function(_0x555f52){var _0x376a90=this;return function(){_0x376a90[_0x96e7('0x167')](_0x555f52);};};Dialer[_0x96e7('0x1a')][_0x96e7('0x34')]=function(_0x3837f4){var _0x5a2925=this;if(isNotPreview(_0x3837f4[_0x96e7('0x5e')])){if(isVoiceQueueOutbound(_0x3837f4['type'])&&isActive(_0x3837f4['dialActive'])){_0x3837f4[_0x96e7('0xa5')]=!![];Promise['resolve']()[_0x96e7('0x41')](checkIsLoggedIn(_0x3837f4,_0x3837f4['loggedIn']))[_0x96e7('0x41')](checkIsActive(_0x3837f4,_0x3837f4['dialActive']))[_0x96e7('0x41')](checkInterval(_0x3837f4))[_0x96e7('0x41')](_0x5a2925['checkIsTrunkReachable'](_0x3837f4))[_0x96e7('0x41')](_0x5a2925['checkIfTime'](_0x3837f4['dialGlobalInterval'],_0x3837f4['dialTimezone'],_0x3837f4[_0x96e7('0x46')],_0x3837f4))[_0x96e7('0x41')](_0x5a2925['checkIfTimeIntervals'](_0x3837f4[_0x96e7('0x49')],_0x3837f4[_0x96e7('0x168')],_0x3837f4[_0x96e7('0x46')],_0x3837f4))[_0x96e7('0x41')](_0x5a2925[_0x96e7('0x15c')](_0x3837f4))[_0x96e7('0xbd')](loggerCatchQueueSummary('[syncQueueSummary]',_0x3837f4));}else{notSendMessagesQueue(_0x3837f4);}}else{freeVariablesPredictive(_0x3837f4);}};Dialer[_0x96e7('0x1a')][_0x96e7('0x35')]=_[_0x96e7('0x169')](function(){var _0x3ac462=_[_0x96e7('0x16a')](this[_0x96e7('0x20')],function(_0x35352a){return _0x35352a['dialPreviewRecallmeReminder'];});var _0x3732f2=_[_0x96e7('0x16a')](this[_0x96e7('0x21')],function(_0x219cd0){return _0x219cd0['online']&&_0x219cd0[_0x96e7('0xb4')]===_0x96e7('0xe0');});if(_0x3ac462['length']>0x0&&_0x3732f2[_0x96e7('0x9f')]>0x0){return Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](cmHopper[_0x96e7('0x163')](_[_0x96e7('0x16b')](_0x3ac462,'id'),previewRecallmeReminderInterval,_[_0x96e7('0x16b')](_0x3732f2,'id')))['then'](function(_0x558b9b){for(var _0x11a4fe=0x0;_0x11a4fe<_0x558b9b['length'];_0x11a4fe++){var _0x4559fa=_0x558b9b[_0x11a4fe][_0x96e7('0x16c')][_0x96e7('0x46')];if(_0x4559fa)io['to'](util[_0x96e7('0x7f')](_0x96e7('0x164'),_0x4559fa))[_0x96e7('0x52')]('user:dialPreviewRecallReminder',{'hopper':_0x558b9b[_0x11a4fe]});}})[_0x96e7('0xbd')](function(_0x16feaa){logger[_0x96e7('0x9e')](_0x96e7('0x16d'),_0x16feaa);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x96e7('0x1a')][_0x96e7('0x16e')]=function(){var _0x124dba=this;var _0xec414;for(var _0x23ee15 in this[_0x96e7('0xba')]){if(typeof this['campaigns'][_0x23ee15]!==_0x96e7('0xb3')){_0xec414=this['campaigns'][_0x23ee15];if(isCampaignIvr(_0xec414[_0x96e7('0x53')])&&isActive(_0xec414[_0x96e7('0x7b')])){_0xec414[_0x96e7('0xa5')]=!![];Promise[_0x96e7('0xbc')]()[_0x96e7('0x41')](checkIsActive(_0xec414,_0xec414[_0x96e7('0x7b')]))['then'](checkInterval(_0xec414))[_0x96e7('0x41')](_0x124dba[_0x96e7('0x142')](_0xec414))['then'](_0x124dba[_0x96e7('0x146')](_0xec414['dialGlobalInterval'],_0xec414[_0x96e7('0x168')],_0xec414[_0x96e7('0x46')],_0xec414))[_0x96e7('0x41')](_0x124dba[_0x96e7('0x148')](_0xec414[_0x96e7('0x49')],_0xec414['dialTimezone'],_0xec414[_0x96e7('0x46')],_0xec414))[_0x96e7('0x41')](_0x124dba[_0x96e7('0x166')](_0xec414))[_0x96e7('0xbd')](loggerCatchQueueSummary(_0x96e7('0x16f'),_0xec414));}else{notSendMessagesCampaign(_0xec414);}}}};function getCallerIdRandom(_0x922f90,_0x15fff6){var _0x334a73;var _0x346d04;var _0x44636d;if(_0x15fff6<=0x0){_0x15fff6=0x1;}_0x334a73=new RegExp(_0x96e7('0x170')+_0x15fff6+'}$');_0x346d04=Math[_0x96e7('0x171')](0xa,_0x15fff6-0x1);_0x44636d=Math['pow'](0xa,_0x15fff6)-0x1;return util['format']('%s',_['replace'](_0x922f90,_0x334a73,_['random'](_0x346d04,_0x44636d)));}function extractCalleridName(_0x22cdfb){var _0x3651c1=_0x22cdfb[_0x96e7('0x172')](/"(.*?)"/);return _0x3651c1?_0x3651c1[0x1]:_0x22cdfb;}Dialer[_0x96e7('0x1a')]['actionOriginate']=function(_0x3761f7,_0x25792d){var _0x37d37c=this;var _0x56cc5b=uuid['v4']();this[_0x96e7('0x25')][_0x56cc5b]=new Action(_0x3761f7,_0x25792d,_0x56cc5b);return new Promise(function(_0x36b0db,_0x36544e){if(_['isUndefined'](_0x3761f7)&&typeof _0x3761f7!==_0x96e7('0x173')){return _0x36544e(msgResponse('originate','Failure',_0x96e7('0x174')));}if(_[_0x96e7('0x43')](_0x25792d[_0x96e7('0x175')])||_0x25792d[_0x96e7('0x175')]===null){return _0x36544e(msgResponse(_0x96e7('0x176'),'Failure',_0x96e7('0x177')));}var _0x5b880f={'XMD-CALLERID':_0x37d37c[_0x96e7('0x25')][_0x56cc5b][_0x96e7('0x178')](),'XMD-AGI':_0x3761f7[_0x96e7('0x10c')]?util['format'](_0x96e7('0x179'),ipAgi,_0x3761f7['dialQueueProject']):_0x96e7('0x17a'),'XMD-AGIAFTER':_0x3761f7['dialQueueProject2']?util[_0x96e7('0x7f')](_0x96e7('0x179'),ipAgi,_0x3761f7['dialQueueProject2']):_0x96e7('0x17a'),'XMD-QUEUE':_0x3761f7[_0x96e7('0x53')]==='outbound'?util[_0x96e7('0x7f')](_0x96e7('0x17b'),_0x3761f7['name'],_0x3761f7[_0x96e7('0x17c')]||'',_0x3761f7[_0x96e7('0x114')]?'c':'',_0x3761f7[_0x96e7('0x11c')]||0x3):'NONE','XMD-CONTACTID':_0x25792d[_0x96e7('0x109')],'XMD-CDRTYPE':_0x96e7('0x8'),'CALLERID(all)':_0x37d37c[_0x96e7('0x25')][_0x56cc5b][_0x96e7('0x178')](),'XMD-AMD':_0x3761f7[_0x96e7('0xe6')]?_0x96e7('0x17d'):_0x96e7('0x17a'),'XMD-DESTINATION':_0x96e7('0xe5')};if(_0x3761f7['dialAMDActive']){_0x5b880f[_0x96e7('0x17e')]=_0x3761f7[_0x96e7('0x17f')]||0x9c4;_0x5b880f[_0x96e7('0x180')]=_0x3761f7[_0x96e7('0x181')]||0x5dc;_0x5b880f['XMD-AMDAFTERGREETINGSILENCE']=_0x3761f7[_0x96e7('0x182')]||0x320;_0x5b880f['XMD-AMDTOTALANALYSISTIME']=_0x3761f7[_0x96e7('0x183')]||0x1388;_0x5b880f['XMD-AMDMINWORDLENGTH']=_0x3761f7[_0x96e7('0x184')]||0x64;_0x5b880f[_0x96e7('0x185')]=_0x3761f7[_0x96e7('0x186')]||0x32;_0x5b880f[_0x96e7('0x187')]=_0x3761f7['dialAMDMaximumNumberOfWords']||0x3;_0x5b880f['XMD-AMDSILENCETHRESHOLD']=_0x3761f7[_0x96e7('0x188')]||0x100;_0x5b880f[_0x96e7('0x189')]=_0x3761f7[_0x96e7('0x18a')]||0x1388;}if(_0x3761f7[_0x96e7('0x53')]===_0x96e7('0x98')){_0x5b880f[_0x96e7('0x18b')]=_0x25792d[_0x96e7('0xd9')];}else{_0x5b880f[_0x96e7('0x18c')]=_0x25792d['CampaignId'];}for(var _0x5ee6b6 in _0x25792d[_0x96e7('0x18d')]){if(typeof _0x25792d['Contact'][_0x5ee6b6]!==_0x96e7('0xb3')){if(isNotNull(_0x25792d[_0x96e7('0x18d')][_0x5ee6b6])&&_0x5ee6b6!=='id'&&_0x5ee6b6!==_0x96e7('0x18e')&&_0x5ee6b6!==_0x96e7('0x18f')&&_0x5ee6b6!==_0x96e7('0x190')){_0x5b880f[util['format']('%s%s','XMD-',_[_0x96e7('0x191')](_0x5ee6b6))]=_0x25792d[_0x96e7('0x18d')][_0x5ee6b6];}}}var _0xb0d787=_0x37d37c['isTrunkReachable'](_0x3761f7['Trunk'])?getCallerId(_0x3761f7[_0x96e7('0x7a')][_0x96e7('0x7c')],_0x3761f7[_0x96e7('0x5f')],_0x3761f7[_0x96e7('0x192')]>0x0?getCallerIdRandom(_0x3761f7[_0x96e7('0x60')],_0x3761f7[_0x96e7('0x192')]):_0x3761f7[_0x96e7('0x60')]):getCallerId(_[_0x96e7('0xe2')](_0x3761f7['TrunkBackup'])?_0x3761f7[_0x96e7('0x7a')][_0x96e7('0x7c')]:_0x3761f7[_0x96e7('0x193')]['callerid'],_0x3761f7[_0x96e7('0x5f')],_0x3761f7[_0x96e7('0x192')]>0x0?getCallerIdRandom(_0x3761f7[_0x96e7('0x60')],_0x3761f7['dialRandomLastDigitCallerIdNumber']):_0x3761f7[_0x96e7('0x60')]);if(_0xb0d787){_0x5b880f[_0x96e7('0x194')]=_0x37d37c[_0x96e7('0x25')][_0x56cc5b]['originatecalleridname']=extractCalleridName(_0xb0d787);_0x5b880f[_0x96e7('0x195')]=_0x25792d[_0x96e7('0x175')];}_0x3761f7[_0x96e7('0x196')]=_0x5b880f;return ami[_0x96e7('0x155')]({'actionid':_0x56cc5b,'action':_0x96e7('0x176'),'channel':_0x37d37c[_0x96e7('0x143')](_0x3761f7[_0x96e7('0x7a')])?util[_0x96e7('0x7f')](_0x96e7('0x197'),_0x3761f7[_0x96e7('0x7a')][_0x96e7('0x46')],isNotNull(_0x3761f7[_0x96e7('0x198')])?_0x3761f7[_0x96e7('0x198')][_0x96e7('0x199')]()||'':'',_0x3761f7['dialCutDigit']>0x0?_0x25792d['phone']['substring'](_0x3761f7[_0x96e7('0x19a')]):_0x25792d[_0x96e7('0x175')]):util[_0x96e7('0x7f')](_0x96e7('0x197'),_[_0x96e7('0xe2')](_0x3761f7[_0x96e7('0x193')])?_0x3761f7[_0x96e7('0x7a')][_0x96e7('0x46')]:_0x3761f7['TrunkBackup'][_0x96e7('0x46')],isNotNull(_0x3761f7[_0x96e7('0x198')])?_0x3761f7[_0x96e7('0x198')][_0x96e7('0x199')]()||'':'',_0x3761f7[_0x96e7('0x19a')]>0x0?_0x25792d[_0x96e7('0x175')][_0x96e7('0x19b')](_0x3761f7[_0x96e7('0x19a')]):_0x25792d[_0x96e7('0x175')]),'callerid':_0xb0d787,'Exten':_0x96e7('0xe5'),'Context':'from-sip','Priority':'1','variable':_0x5b880f,'timeout':(_0x3761f7[_0x96e7('0x61')]||0x1e)*0x3e8,'async':!![],'channelid':_0x56cc5b})[_0x96e7('0x41')](function(_0x2cb992){return _0x36b0db(_0x2cb992);})[_0x96e7('0xbd')](function(_0x559d1e){_0x3761f7[_0x96e7('0x6a')]+=0x1;var _0xeb7884=new History(_0x37d37c[_0x96e7('0x25')][_0x56cc5b]);logger[_0x96e7('0x9e')](util[_0x96e7('0x7f')](_0x96e7('0x19c'),JSON[_0x96e7('0x50')](_0x559d1e)));_0xeb7884['state']=0xe;_0xeb7884[_0x96e7('0xec')]=_0x96e7('0x19d');_0xeb7884[_0x96e7('0xaf')]=moment()[_0x96e7('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0xeb7884[_0x96e7('0xae')]=_0xeb7884[_0x96e7('0xaf')];_0x37d37c['createHistory'](_0xeb7884)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x19e')));_0x37d37c[_0x96e7('0xcf')](_0xeb7884)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x19e')))[_0x96e7('0x1d')](function(){delete _0x37d37c[_0x96e7('0x25')][_0x56cc5b];return _0x36544e(msgResponse('originate',_0x96e7('0x4f'),_0x96e7('0x19f')));});});});};Dialer['prototype'][_0x96e7('0x1a0')]=function(_0x4c9d31){var _0x36d9d9=this[_0x96e7('0x25')][_0x4c9d31['actionid']];if(_0x36d9d9){delete this[_0x96e7('0x25')][_0x4c9d31[_0x96e7('0x12c')]];_0x36d9d9[_0x96e7('0x11b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x50a976=_0x36d9d9[_0x96e7('0x53')]==='ivr'?this[_0x96e7('0xba')][_0x36d9d9[_0x96e7('0xb8')]]:this[_0x96e7('0x20')][_0x36d9d9['getQueue']()];if(!this[_0x96e7('0xdd')](_0x4c9d31[_0x96e7('0x1a1')])){this['updateOriginated'](_0x50a976);return this[_0x96e7('0x1a2')](_0x36d9d9,_0x50a976,_0x4c9d31)['catch'](loggerCatch(_0x96e7('0x1a3')));}this['uniqueId'][_0x4c9d31[_0x96e7('0xe9')]]=_0x36d9d9;}};Dialer[_0x96e7('0x1a')][_0x96e7('0x1a4')]=function(_0x53a9c9,_0x45d9f5,_0x59e5ea){var _0x40b52d=new History(_0x45d9f5);if(_0x40b52d[_0x96e7('0xf6')]+_0x40b52d['countcongestionretry']+_0x40b52d[_0x96e7('0xf8')]+_0x40b52d[_0x96e7('0xf9')]+_0x40b52d['countdropretry']+_0x40b52d[_0x96e7('0xfb')]+_0x40b52d[_0x96e7('0xf3')]+_0x40b52d[_0x96e7('0xfc')]>=_0x59e5ea[_0x96e7('0xfd')]-0x1){return!![];}switch(_0x53a9c9){case 0x3:if(_0x40b52d[_0x96e7('0xf8')]>=_0x59e5ea[_0x96e7('0x1a5')]-0x1){return!![];}this[_0x96e7('0xc6')]({'active':![],'countnoanswerretry':_0x40b52d[_0x96e7('0xf8')]+=0x1,'scheduledat':moment()[_0x96e7('0x108')](_0x59e5ea['dialNoAnswerRetryFrequency'],_0x96e7('0x101'))['format'](_0x96e7('0x102')),'ContactId':_0x40b52d[_0x96e7('0x109')],'ListId':_0x40b52d[_0x96e7('0x10a')],'VoiceQueueId':_0x40b52d[_0x96e7('0xd9')]||undefined,'CampaignId':_0x40b52d[_0x96e7('0xda')]||undefined})['catch'](loggerCatch(_0x96e7('0x1a6')));break;case 0x5:if(_0x40b52d[_0x96e7('0xf6')]>=_0x59e5ea[_0x96e7('0x1a7')]-0x1){return!![];}this[_0x96e7('0xc6')]({'active':![],'countbusyretry':_0x40b52d['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x59e5ea[_0x96e7('0x1a8')],'minutes')[_0x96e7('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40b52d['ContactId'],'ListId':_0x40b52d[_0x96e7('0x10a')],'VoiceQueueId':_0x40b52d[_0x96e7('0xd9')]||undefined,'CampaignId':_0x40b52d[_0x96e7('0xda')]||undefined})[_0x96e7('0xbd')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x40b52d[_0x96e7('0xf7')]>=_0x59e5ea['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x40b52d['countcongestionretry']+=0x1,'scheduledat':moment()[_0x96e7('0x108')](_0x59e5ea[_0x96e7('0x1a9')],_0x96e7('0x101'))['format'](_0x96e7('0x102')),'ContactId':_0x40b52d[_0x96e7('0x109')],'ListId':_0x40b52d['ListId'],'VoiceQueueId':_0x40b52d['VoiceQueueId']||undefined,'CampaignId':_0x40b52d[_0x96e7('0xda')]||undefined})[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x1aa')));break;case 0x0:if(_0x40b52d[_0x96e7('0xf9')]>=_0x59e5ea['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x96e7('0xc6')]({'active':![],'countnosuchnumberretry':_0x40b52d['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x96e7('0x108')](_0x59e5ea[_0x96e7('0x1ab')],_0x96e7('0x101'))[_0x96e7('0x7f')](_0x96e7('0x102')),'ContactId':_0x40b52d[_0x96e7('0x109')],'ListId':_0x40b52d['ListId'],'VoiceQueueId':_0x40b52d[_0x96e7('0xd9')]||undefined,'CampaignId':_0x40b52d[_0x96e7('0xda')]||undefined})['catch'](loggerCatch(_0x96e7('0x1ac')));}break;case 0xa:if(_0x40b52d[_0x96e7('0xfa')]>=_0x59e5ea['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x40b52d['countdropretry']+=0x1,'scheduledat':moment()[_0x96e7('0x108')](_0x59e5ea['dialDropRetryFrequency'],_0x96e7('0x101'))[_0x96e7('0x7f')](_0x96e7('0x102')),'ContactId':_0x40b52d['ContactId'],'ListId':_0x40b52d['ListId'],'VoiceQueueId':_0x40b52d[_0x96e7('0xd9')]||undefined,'CampaignId':_0x40b52d[_0x96e7('0xda')]||undefined})['catch'](loggerCatch(_0x96e7('0x1ad')));break;case 0xb:if(_0x40b52d['countabandonedretry']>=_0x59e5ea[_0x96e7('0x129')]-0x1){return!![];}this[_0x96e7('0xc6')]({'active':![],'countabandonedretry':_0x40b52d[_0x96e7('0xfb')]+=0x1,'scheduledat':moment()[_0x96e7('0x108')](_0x59e5ea[_0x96e7('0x128')],_0x96e7('0x101'))[_0x96e7('0x7f')](_0x96e7('0x102')),'ContactId':_0x40b52d[_0x96e7('0x109')],'ListId':_0x40b52d[_0x96e7('0x10a')],'VoiceQueueId':_0x40b52d['VoiceQueueId']||undefined,'CampaignId':_0x40b52d['CampaignId']||undefined})['catch'](loggerCatch(_0x96e7('0x12a')));break;case 0x13:if(_0x40b52d[_0x96e7('0xf3')]>=_0x59e5ea['dialMachineMaxRetry']-0x1){return!![];}this[_0x96e7('0xc6')]({'active':![],'countmachineretry':_0x40b52d[_0x96e7('0xf3')]+=0x1,'scheduledat':moment()[_0x96e7('0x108')](_0x59e5ea[_0x96e7('0x100')],'minutes')['format'](_0x96e7('0x102')),'ContactId':_0x40b52d[_0x96e7('0x109')],'ListId':_0x40b52d['ListId'],'VoiceQueueId':_0x40b52d['VoiceQueueId']||undefined,'CampaignId':_0x40b52d['CampaignId']||undefined})[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x10b')));break;case 0x14:if(_0x40b52d[_0x96e7('0xfc')]>=_0x59e5ea[_0x96e7('0x1ae')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x40b52d[_0x96e7('0xfc')]+=0x1,'scheduledat':moment()[_0x96e7('0x108')](_0x59e5ea[_0x96e7('0x1af')],_0x96e7('0x101'))[_0x96e7('0x7f')](_0x96e7('0x102')),'ContactId':_0x40b52d[_0x96e7('0x109')],'ListId':_0x40b52d['ListId'],'VoiceQueueId':_0x40b52d['VoiceQueueId']||undefined,'CampaignId':_0x40b52d['CampaignId']||undefined})[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x1b0')));break;default:return!![];}};Dialer[_0x96e7('0x1a')][_0x96e7('0x1a2')]=function(_0x2474bd,_0x6b61f,_0x322df2){var _0x4ca5b0=this;var _0x418922=new History(_0x2474bd);var _0x533d18=![];var _0x98da88;var _0x326434;return new Promise(function(_0x30e138,_0x3f3923){if(_[_0x96e7('0x43')](_0x6b61f)&&typeof _0x6b61f!==_0x96e7('0x173')){return _0x3f3923(msgResponse(_0x96e7('0x1b1'),_0x96e7('0x14c'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x322df2)&&typeof _0x322df2!==_0x96e7('0x173')){return _0x3f3923(msgResponse(_0x96e7('0x1b1'),'Failure',_0x96e7('0x1b2')));}_0x4ca5b0[_0x96e7('0xc0')](_0x418922,_0x322df2[_0x96e7('0x1b3')],_0x6b61f)['then'](function(_0x5e98d2){if(_0x5e98d2['additional']==0x1)_0x533d18=!![];switch(_0x322df2['reason']){case'0':_0x6b61f['outboundNoSuchCallsDay']+=0x1;_0x418922[_0x96e7('0xeb')]=0x0;_0x418922[_0x96e7('0xec')]=_0x96e7('0x1b4');_0x418922[_0x96e7('0xf9')]+=0x1;_0x418922[_0x96e7('0x106')]+=0x1;ami[_0x96e7('0x52')]('custom:agentnosuchnumber',ut[_0x96e7('0xef')](_0x2474bd,_0x96e7('0x1b5')));_0x98da88=_0x6b61f[_0x96e7('0x1ab')];_0x326434=_0x6b61f['callAdditionalPhoneAfterMin'];_0x4ca5b0[_0x96e7('0xd1')](_0x418922)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xf5')));if(_0x4ca5b0[_0x96e7('0x1a4')](0x0,_0x2474bd,_0x6b61f)&&!_0x533d18){if(_0x418922[_0x96e7('0xf9')]>=_0x6b61f['dialNoSuchNumberMaxRetry']){_0x4ca5b0[_0x96e7('0x1b6')](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1b7'));}else{_0x4ca5b0[_0x96e7('0x107')](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1b7'));}}break;case'3':_0x6b61f[_0x96e7('0x68')]+=0x1;_0x418922[_0x96e7('0xeb')]=0x3;_0x418922[_0x96e7('0xec')]=_0x96e7('0x1b8');_0x418922[_0x96e7('0xf8')]+=0x1;_0x418922[_0x96e7('0x106')]+=0x1;var _0xacbe8b=ut['buildNoAnswerEventPayload'](_0x2474bd,_0x6b61f);ami['emit'](_0x96e7('0x1b9'),_0xacbe8b);_0x98da88=_0x6b61f['dialNoAnswerRetryFrequency'];_0x326434=_0x6b61f[_0x96e7('0x11f')];_0x4ca5b0[_0x96e7('0xd1')](_0x418922)['catch'](loggerCatch(_0x96e7('0x1ba')));if(_0x4ca5b0['checkRetriveMax'](0x3,_0x2474bd,_0x6b61f)&&!_0x533d18){if(_0x418922[_0x96e7('0xf8')]>=_0x6b61f[_0x96e7('0x1a5')]){_0x4ca5b0[_0x96e7('0x1b6')](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1bb'));}else{_0x4ca5b0[_0x96e7('0x107')](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1bb'));}}break;case'5':_0x6b61f[_0x96e7('0x64')]+=0x1;_0x418922['state']=0x5;_0x418922[_0x96e7('0xec')]=_0x96e7('0x1bc');_0x418922['countbusyretry']+=0x1;_0x418922[_0x96e7('0x106')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x96e7('0xef')](_0x2474bd,_0x96e7('0x1bd')));_0x98da88=_0x6b61f[_0x96e7('0x1a8')];_0x326434=_0x6b61f[_0x96e7('0x11f')];_0x4ca5b0[_0x96e7('0xd1')](_0x418922)[_0x96e7('0xbd')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4ca5b0[_0x96e7('0x1a4')](0x5,_0x2474bd,_0x6b61f)&&!_0x533d18){if(_0x418922[_0x96e7('0xf6')]>=_0x6b61f[_0x96e7('0x1a7')]){_0x4ca5b0['createStateFinal'](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1be'));}else{_0x4ca5b0[_0x96e7('0x107')](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1be'));}}break;case'8':_0x6b61f[_0x96e7('0x1bf')]+=0x1;_0x418922[_0x96e7('0xeb')]=0x8;_0x418922['statedesc']=_0x96e7('0x1c0');_0x418922[_0x96e7('0xf7')]+=0x1;_0x418922[_0x96e7('0x106')]+=0x1;_0x98da88=_0x6b61f[_0x96e7('0x1a9')];_0x326434=_0x6b61f['callAdditionalPhoneAfterMin'];ami[_0x96e7('0x52')](_0x96e7('0x1c1'),ut[_0x96e7('0xef')](_0x2474bd,'congestion'));_0x4ca5b0[_0x96e7('0xd1')](_0x418922)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x1c2')));if(_0x4ca5b0['checkRetriveMax'](0x8,_0x2474bd,_0x6b61f)&&!_0x533d18){if(_0x418922[_0x96e7('0xf7')]>=_0x6b61f['dialCongestionMaxRetry']){_0x4ca5b0[_0x96e7('0x1b6')](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1c3'));}else{_0x4ca5b0[_0x96e7('0x107')](_0x418922,_0x30e138,_0x3f3923,'reason\x208\x20congestion');}}break;case'11':_0x6b61f['outboundAbandonedCallsDay']+=0x1;_0x418922[_0x96e7('0xeb')]=0xb;_0x418922[_0x96e7('0xec')]=_0x96e7('0x12b');_0x418922[_0x96e7('0xfb')]+=0x1;_0x418922[_0x96e7('0x106')]+=0x1;_0x98da88=_0x6b61f[_0x96e7('0x128')];_0x326434=_0x6b61f[_0x96e7('0x11f')];_0x4ca5b0[_0x96e7('0xd1')](_0x418922)[_0x96e7('0xbd')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4ca5b0[_0x96e7('0x1a4')](0xb,_0x2474bd,_0x6b61f)&&!_0x533d18){if(_0x418922[_0x96e7('0xfb')]>=_0x6b61f[_0x96e7('0x129')]){_0x4ca5b0['createStateFinal'](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1c4'));}else{_0x4ca5b0['stateGlobal'](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1c4'));}}break;case'20':_0x6b61f[_0x96e7('0x1c5')]+=0x1;_0x418922['state']=0x14;_0x418922[_0x96e7('0xec')]=_0x96e7('0x1c6');_0x418922[_0x96e7('0xfc')]+=0x1;_0x418922[_0x96e7('0x106')]+=0x1;_0x98da88=_0x6b61f[_0x96e7('0x1af')];_0x326434=_0x6b61f[_0x96e7('0x11f')];ami[_0x96e7('0x52')](_0x96e7('0x1c7'),ut[_0x96e7('0xef')](_0x2474bd,_0x96e7('0x1c8')));_0x4ca5b0[_0x96e7('0xd1')](_0x418922)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x1c9')));if(_0x4ca5b0[_0x96e7('0x1a4')](0x14,_0x2474bd,_0x6b61f)&&!_0x533d18){if(_0x418922[_0x96e7('0xfc')]>=_0x6b61f[_0x96e7('0x1ae')]){_0x4ca5b0[_0x96e7('0x1b6')](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1ca'));}else{_0x4ca5b0[_0x96e7('0x107')](_0x418922,_0x30e138,_0x3f3923,_0x96e7('0x1ca'));}}break;default:_0x6b61f[_0x96e7('0x6c')]+=0x1;_0x418922['state']=0xc;_0x418922[_0x96e7('0xec')]=_0x322df2[_0x96e7('0x1b3')];_0x98da88=_0x6b61f[_0x96e7('0x1af')];_0x326434=_0x6b61f[_0x96e7('0x11f')];_0x4ca5b0['createHistory'](_0x418922)[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x1cb')));if(_0x4ca5b0[_0x96e7('0x1a4')](_0x322df2[_0x96e7('0x1b3')],_0x2474bd,_0x6b61f)&&!_0x533d18){if(_0x418922[_0x96e7('0xf6')]+_0x418922[_0x96e7('0xf7')]+_0x418922[_0x96e7('0xf8')]+_0x418922[_0x96e7('0xf9')]+_0x418922[_0x96e7('0xfa')]+_0x418922['countabandonedretry']+_0x418922[_0x96e7('0xf3')]+_0x418922[_0x96e7('0xfc')]>=_0x6b61f[_0x96e7('0xfd')]){_0x4ca5b0[_0x96e7('0x107')](_0x418922,_0x30e138,_0x3f3923,_0x322df2[_0x96e7('0x1b3')]);}else{_0x4ca5b0[_0x96e7('0x1b6')](_0x418922,_0x30e138,_0x3f3923,_0x322df2[_0x96e7('0x1b3')]);}}}})['then'](function(){if(_0x533d18){_0x4ca5b0[_0x96e7('0x127')](_0x418922,_0x98da88,_0x326434)[_0x96e7('0x41')](function(){return _0x30e138(0x1);});}});});};Dialer['prototype'][_0x96e7('0x107')]=function(_0x505c60,_0x36c637,_0x4bb49f,_0x47c251){var _0x584b58=new Final(_0x505c60);_0x584b58[_0x96e7('0xeb')]=0xf;_0x584b58[_0x96e7('0xec')]='Global';this['createStateFinal'](_0x584b58,_0x36c637,_0x4bb49f,_0x47c251);};Dialer[_0x96e7('0x1a')]['createStateFinal']=function(_0x20b5cf,_0x480407,_0x12516d,_0x57e97c){this[_0x96e7('0xcf')](_0x20b5cf)[_0x96e7('0x41')](function(){return _0x480407(msgResponse(_0x96e7('0x1b1'),_0x96e7('0xde'),_0x57e97c));})[_0x96e7('0xbd')](function(){return _0x12516d(msgResponse(_0x96e7('0x1cc'),_0x96e7('0x14c'),_0x96e7('0x1cd')));});};Dialer[_0x96e7('0x1a')]['predictive']=function(_0x51e033){var _0x513b85=_0x51e033['dialPredictiveOptimizationPercentage']/0x64;var _0x3f10a0=_0x51e033[_0x96e7('0x67')]/(_0x51e033[_0x96e7('0x67')]+_0x51e033[_0x96e7('0xea')]);var _0x2088c4=Math[_0x96e7('0x1ce')](_0x51e033[_0x96e7('0x75')]*(_0x51e033[_0x96e7('0x1cf')]/0x64));var _0x238c35=Math[_0x96e7('0x1ce')](_0x51e033[_0x96e7('0x75')]*(_0x51e033[_0x96e7('0x1d0')]/0x64));var _0x5cc91a=_0x51e033['available']+_0x51e033['talking'];var _0x3df31f=Math[_0x96e7('0x1d1')](_0x51e033[_0x96e7('0x8f')]*_0x51e033[_0x96e7('0x78')]*_0x51e033[_0x96e7('0x72')]*_0x51e033[_0x96e7('0x73')]);if(_[_0x96e7('0x43')](_0x51e033[_0x96e7('0x79')])){if(!_[_0x96e7('0x43')](_0x51e033['startPredictive'])){_0x51e033[_0x96e7('0x28')]=undefined;loggerPredictive['error'](_0x96e7('0x1d2'),_0x96e7('0x1d3'));}if(!_[_0x96e7('0x43')](_0x51e033[_0x96e7('0x96')])){loggerPredictive['error'](_0x96e7('0x1d2'),_0x96e7('0x1d4'));clearInterval(_0x51e033[_0x96e7('0x96')]);_0x51e033[_0x96e7('0x96')]=undefined;}_0x51e033[_0x96e7('0x79')]=moment()[_0x96e7('0x7f')](_0x96e7('0x102'));loggerPredictive['info'](_0x51e033[_0x96e7('0x46')],_0x96e7('0x1d5'),_0x51e033[_0x96e7('0x79')]);this[_0x96e7('0x15e')](_0x51e033,0x1);}else if(ifInterval(_0x51e033[_0x96e7('0x1d6')],_0x51e033[_0x96e7('0x79')])){this['handlePower'](_0x51e033,0x1);loggerPredictiveCalls[_0x96e7('0x82')](_0x96e7('0x1d7'),_0x51e033[_0x96e7('0x79')],_0x51e033[_0x96e7('0x46')]);_0x51e033['erlangCalls']=0x0;_0x51e033[_0x96e7('0x71')]=0x0;}else if(_0x513b85<_0x3f10a0&&_0x51e033['dialPredictiveOptimization']===_0x96e7('0x1d8')){freeVariablesPredictive(_0x51e033);loggerPredictive[_0x96e7('0x82')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x96e7('0x1d9'),_0x3f10a0,_0x96e7('0x79'),_0x51e033[_0x96e7('0x46')]);}else if(_0x3df31f<_0x51e033[_0x96e7('0x71')]&&_0x51e033['dialPredictiveOptimization']===_0x96e7('0x1d8')){freeVariablesPredictive(_0x51e033);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x1da'),_0x96e7('0x1db'),_0x3df31f,_0x96e7('0x1dc'),_0x51e033['predictiveIntervalErlangCallsDroppedCalls'],_0x96e7('0x79'),_0x51e033[_0x96e7('0x46')]);}else if(!ifInterval(_0x51e033['dialPredictiveInterval'],_0x51e033[_0x96e7('0x79')])&&_['isUndefined'](_0x51e033['startPredictive'])&&!_[_0x96e7('0x43')](_0x51e033[_0x96e7('0x79')])){_0x51e033[_0x96e7('0x28')]=moment()[_0x96e7('0x7f')](_0x96e7('0x102'));loggerPredictive[_0x96e7('0x82')](_0x51e033['name'],_0x96e7('0x1dd'),_0x51e033[_0x96e7('0x28')]);this[_0x96e7('0xc4')](_0x51e033[_0x96e7('0x1d6')])[_0x96e7('0x41')](this[_0x96e7('0x1de')](_0x51e033))[_0x96e7('0x41')](mergeDataErlangB(_0x51e033))[_0x96e7('0x41')](this[_0x96e7('0x1df')](_0x51e033))[_0x96e7('0xbd')](loggerCatchPredictive(_0x96e7('0x1e0'),_0x51e033));}else if(!ifInterval(_0x51e033['dialPredictiveInterval'],_0x51e033['startPredictive'])){_0x51e033[_0x96e7('0x71')]=0x0;_0x51e033[_0x96e7('0x28')]=moment()[_0x96e7('0x7f')](_0x96e7('0x102'));loggerPredictive[_0x96e7('0x82')](_0x51e033['name'],_0x96e7('0x1e1'),_0x51e033[_0x96e7('0x28')]);clearInterval(_0x51e033['handlePredictive']);_0x51e033[_0x96e7('0x96')]=undefined;this[_0x96e7('0xc4')](_0x51e033[_0x96e7('0x1d6')])[_0x96e7('0x41')](this[_0x96e7('0x1de')](_0x51e033))[_0x96e7('0x41')](mergeDataErlangB(_0x51e033))[_0x96e7('0x41')](this[_0x96e7('0x1df')](_0x51e033))[_0x96e7('0xbd')](loggerCatchPredictive(_0x96e7('0x1e2'),_0x51e033));}else if(_0x51e033[_0x96e7('0x75')]&&_0x5cc91a<_0x51e033[_0x96e7('0x75')]-_0x238c35){freeVariablesPredictive(_0x51e033);loggerPredictive[_0x96e7('0x82')](_0x51e033[_0x96e7('0x46')],_0x96e7('0x1e3'),_0x5cc91a,_0x96e7('0x1e4'),_0x51e033[_0x96e7('0x75')],'-',_0x238c35,'=',_0x51e033[_0x96e7('0x75')]-_0x238c35,')');}else if(_0x51e033[_0x96e7('0x75')]&&_0x5cc91a>_0x51e033[_0x96e7('0x75')]+_0x2088c4){freeVariablesPredictive(_0x51e033);loggerPredictive[_0x96e7('0x82')](_0x51e033[_0x96e7('0x46')],_0x96e7('0x1e3'),_0x5cc91a,_0x96e7('0x1e5'),_0x51e033[_0x96e7('0x75')],'+',_0x2088c4,'=',_0x51e033[_0x96e7('0x75')]+_0x2088c4,')');}};Dialer[_0x96e7('0x1a')][_0x96e7('0x1de')]=function(_0x342367){var _0x1f820b=this;return function(_0x152294){return new Promise(function(_0x3093d2,_0x2eff02){_[_0x96e7('0x93')](_0x342367,_0x152294[0x0]);if(checkGetDataPredictive(_0x152294[0x0])){var _0x1f28ce=_0x342367[_0x96e7('0x75')]=_0x342367[_0x96e7('0x59')]+_0x342367[_0x96e7('0x55')];var _0x2e0d9f=_0x342367[_0x96e7('0x1d6')]*0x3c;var _0x10ffbd=_0x152294[0x0][_0x96e7('0x6f')]+_0x152294[0x0][_0x96e7('0x6e')];var _0x4acc17=(_0x152294[0x0][_0x96e7('0x6d')]+_0x152294[0x0][_0x96e7('0x87')]+_0x152294[0x0][_0x96e7('0x70')])/_0x152294[0x0][_0x96e7('0x76')];_0x342367[_0x96e7('0x72')]=_0x4acc17>0x0?_0x4acc17:0x1;switch(_0x342367[_0x96e7('0x1e6')]){case _0x96e7('0x1d8'):var _0x14efe5=_0x342367[_0x96e7('0x1e7')]/0x64;return _0x1f820b[_0x96e7('0x1e8')](_0x1f28ce,_0x2e0d9f,_0x10ffbd,_0x4acc17,_0x14efe5)['then'](function(_0x621206){return _0x3093d2(_0x621206);});case _0x96e7('0x1e9'):var _0x3dc4fe=_0x342367[_0x96e7('0x1e7')]/0x64;return _0x1f820b[_0x96e7('0x1ea')](_0x1f28ce,_0x2e0d9f,_0x10ffbd,_0x4acc17,_0x3dc4fe)[_0x96e7('0x41')](function(_0x596e36){return _0x3093d2(_0x596e36);});default:return _0x2eff02(msgResponse(_0x96e7('0x1eb'),_0x96e7('0x14c'),_0x96e7('0x1ec')));}}else{return _0x2eff02(msgResponse(_0x96e7('0x1eb'),_0x96e7('0x14c'),_0x96e7('0x1ed')));}});};};Dialer[_0x96e7('0x1a')][_0x96e7('0x1ee')]=function(_0x4c49b6){var _0x7c54d6=this;return function(_0x4814fe){return new Promise(function(_0x7099bd,_0x50c3f){_[_0x96e7('0x93')](_0x4c49b6,_0x4814fe[0x0]);if(checkGetDataPredictive(_0x4814fe[0x0])){loggerPredictive[_0x96e7('0x82')](JSON['stringify'](_0x4814fe[0x0]));if(_0x4c49b6['dialPredictiveOptimization']===_0x96e7('0x1d8')){return _0x7c54d6[_0x96e7('0xce')](_0x4c49b6['id'])[_0x96e7('0x41')](function(_0x4af867){var _0x56d6ac=_0x4c49b6[_0x96e7('0x56')]-_0x4af867[0x0][_0x96e7('0x1ef')];var _0xb82720=_0x4c49b6[_0x96e7('0x1d6')]*0x3c;var _0x168f29=_0x4814fe[0x0][_0x96e7('0x6f')]+_0x4814fe[0x0][_0x96e7('0x6e')];var _0x404c0b=(_0x4814fe[0x0][_0x96e7('0x6d')]+_0x4814fe[0x0][_0x96e7('0x87')]+_0x4814fe[0x0][_0x96e7('0x70')])/_0x4814fe[0x0][_0x96e7('0x76')];var _0x3ee9c4=_0x4c49b6[_0x96e7('0x1e7')]/0x64;_0x4c49b6[_0x96e7('0x74')]=_0x4af867[0x0][_0x96e7('0x1ef')]||0x0;_0x4c49b6[_0x96e7('0x72')]=_0x404c0b>0x0?_0x404c0b:0x1;return _0x7c54d6['abandonmentRate'](_0x56d6ac,_0xb82720,_0x168f29,_0x404c0b,_0x3ee9c4);})[_0x96e7('0x41')](function(_0x57b1e2){return _0x7099bd(_0x57b1e2);})[_0x96e7('0xbd')](function(_0x278e6f){return _0x50c3f(msgResponse(_0x96e7('0x1f0'),_0x96e7('0x14c'),JSON[_0x96e7('0x50')](_0x278e6f)));});}if(_0x4c49b6[_0x96e7('0x1e6')]===_0x96e7('0x1e9')){return _0x7c54d6[_0x96e7('0xce')](_0x4c49b6['id'])['then'](function(_0x8ae980){var _0xad54bb=_0x4c49b6[_0x96e7('0x56')]-_0x8ae980[0x0][_0x96e7('0x1ef')];var _0x2b2abc=_0x4c49b6[_0x96e7('0x1d6')]*0x3c;var _0x20a94c=_0x4814fe[0x0][_0x96e7('0x6f')]+_0x4814fe[0x0][_0x96e7('0x6e')];var _0x14a7e5=(_0x4814fe[0x0][_0x96e7('0x6d')]+_0x4814fe[0x0][_0x96e7('0x87')]+_0x4814fe[0x0][_0x96e7('0x70')])/_0x4814fe[0x0][_0x96e7('0x76')];var _0x14cee5=_0x4c49b6[_0x96e7('0x1e7')]/0x64;_0x4c49b6[_0x96e7('0x74')]=_0x8ae980[0x0]['outboundQueuePauses']||0x0;_0x4c49b6[_0x96e7('0x72')]=_0x14a7e5>0x0?_0x14a7e5:0x1;return _0x7c54d6[_0x96e7('0x1ea')](_0xad54bb,_0x2b2abc,_0x20a94c,_0x14a7e5,_0x14cee5);})[_0x96e7('0x41')](function(_0x282b67){return _0x7099bd(_0x282b67);})[_0x96e7('0xbd')](function(_0x1b8404){return _0x50c3f(msgResponse(_0x96e7('0x1f0'),_0x96e7('0x14c'),JSON[_0x96e7('0x50')](_0x1b8404)));});}}else{return _0x50c3f(msgResponse(_0x96e7('0x1eb'),_0x96e7('0x14c'),_0x96e7('0x1ed')));}});};};Dialer[_0x96e7('0x1a')][_0x96e7('0x1df')]=function(_0x3ad40b){var _0x499b61=this;return function(){var _0x4c4ee6=0x0;var _0x3839a8=Math[_0x96e7('0x1d1')](_0x3ad40b['erlangCallToSecond']*0x3e8);if(_0x3839a8>0x0){_0x3839a8=_0x3839a8<0x64?0x64:_0x3839a8;loggerPredictive['info'](_0x3ad40b['name'],_0x96e7('0x1f1'),_0x3839a8,_0x96e7('0x51'));_0x3ad40b[_0x96e7('0x96')]=setInterval(function(){_0x499b61['handlePredictive'](_0x3ad40b);loggerPredictiveCalls[_0x96e7('0x82')](_0x96e7('0x1f2'),_0x4c4ee6+=0x1);},_0x3839a8);}else{loggerPredictive[_0x96e7('0x82')](_0x3ad40b[_0x96e7('0x46')],_0x96e7('0x1f3'));}};};Dialer[_0x96e7('0x1a')][_0x96e7('0x1f4')]=function(_0x15e089,_0x3b389b){var _0x31d43b=this;return function(_0x4b4215){if(_[_0x96e7('0x4d')](_0x4b4215)){if(_[_0x96e7('0xe2')](_0x3b389b['UserId'])||!_0x3b389b[_0x96e7('0x1f5')]){if(_0x15e089[_0x96e7('0x5e')]==='booked'){_0x15e089['queueStatusComplete']=_[_0x96e7('0x43')](_0x15e089[_0x96e7('0x132')])?!![]:_0x15e089['queueStatusComplete'];var _0x3c2456=uuid['v4']();_0x31d43b[_0x96e7('0x25')][_0x3c2456]=new Action(_0x15e089,_0x3b389b,_0x3c2456);loggerBooked[_0x96e7('0x82')]('[booked][checkContactBlack]',_0x3c2456,_0x96e7('0x1f6'),JSON['stringify'](_0x15e089[_0x96e7('0x132')]),'Queue:\x20',_0x15e089['name']);if(_0x15e089[_0x96e7('0x132')]){_0x15e089[_0x96e7('0x132')]=![];_0x31d43b[_0x96e7('0x2a')][_0x31d43b[_0x96e7('0x25')][_0x3c2456]['queue']]=[];ami['Action']({'actionid':_0x3c2456,'action':_0x96e7('0x1f7'),'queue':_0x15e089[_0x96e7('0x46')]})[_0x96e7('0xbd')](function(){_0x31d43b[_0x96e7('0xb7')](_0x15e089);_0x31d43b[_0x96e7('0xc6')]({'active':![],'ContactId':_0x31d43b['actions'][_0x3c2456]['ContactId'],'ListId':_0x31d43b[_0x96e7('0x25')][_0x3c2456][_0x96e7('0x10a')],'VoiceQueueId':_0x31d43b[_0x96e7('0x25')][_0x3c2456][_0x96e7('0xd9')]||undefined,'CampaignId':_0x31d43b['actions'][_0x3c2456][_0x96e7('0xda')]||undefined})[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x1f8')));delete _0x31d43b[_0x96e7('0x25')][_0x3c2456];});}else{loggerBooked['info'](_0x96e7('0x1f9'),JSON[_0x96e7('0x50')](_0x15e089[_0x96e7('0x132')]),_0x96e7('0x1fa'),_0x15e089['name']);_0x31d43b[_0x96e7('0xb7')](_0x15e089);_0x31d43b['rescheduleContact']({'active':![],'ContactId':_0x31d43b['actions'][_0x3c2456]['ContactId'],'ListId':_0x31d43b[_0x96e7('0x25')][_0x3c2456]['ListId'],'VoiceQueueId':_0x31d43b['actions'][_0x3c2456][_0x96e7('0xd9')]||undefined,'CampaignId':_0x31d43b[_0x96e7('0x25')][_0x3c2456]['CampaignId']||undefined})[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x1f8')));delete _0x31d43b['actions'][_0x3c2456];}}else{return _0x31d43b[_0x96e7('0x1fb')](_0x15e089,_0x3b389b);}}else{if(getDiff(_0x3b389b[_0x96e7('0x1fc')])<_0x15e089[_0x96e7('0x1fd')]*0x3c){if(_0x3b389b['Agent']&&!_0x3b389b[_0x96e7('0x16c')][_0x96e7('0x1fe')]){_0x31d43b[_0x96e7('0x1f')][_0x96e7('0x135')](_0x3b389b['id'])['finally'](function(){_0x31d43b[_0x96e7('0xb7')](_0x15e089);});}else{_0x31d43b[_0x96e7('0xc8')]({'active':![]},_0x3b389b['id'],0x1)[_0x96e7('0x1d')](function(){_0x31d43b[_0x96e7('0xb7')](_0x15e089);});}}else{_0x15e089[_0x96e7('0x6b')]+=0x1;_0x31d43b[_0x96e7('0xb7')](_0x15e089);if(_0x15e089[_0x96e7('0x1ff')]){_0x31d43b[_0x96e7('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3b389b['ContactId'],'ListId':_0x3b389b['ListId'],'VoiceQueueId':_0x3b389b[_0x96e7('0xd9')]||undefined,'CampaignId':_0x3b389b[_0x96e7('0xda')]||undefined})['catch'](loggerCatch(_0x96e7('0x200')));_0x31d43b[_0x96e7('0xd1')](createObjHistory(_0x15e089,_0x3b389b,_0x96e7('0x201'),0x17,_0x96e7('0x202')))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0x203')));}else{_0x31d43b[_0x96e7('0xd7')](createObjHistory(_0x15e089,_0x3b389b,_0x96e7('0x204'),0x16,_0x96e7('0x205')),_0x96e7('0x206'),_0x96e7('0x207'));}}}}else{_0x15e089['outboundBlacklistCallsDay']+=0x1;_0x31d43b['saveInDb'](createObjHistory(_0x15e089,_0x3b389b,_0x96e7('0x208'),0xd,'Blacklist'),_0x96e7('0x209'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x96e7('0x1a')][_0x96e7('0x167')]=function(_0x3c88de){var _0x1bb4ac=this;var _0x42d3a0=_0x3c88de[_0x96e7('0x20a')]-_0x3c88de[_0x96e7('0xa0')]-_0x3c88de[_0x96e7('0xca')];emitCampaignSummary(_0x3c88de);if(_0x42d3a0>0x0){if(_0x42d3a0>this['maxNumberOriginate']){_0x42d3a0=this[_0x96e7('0x23')];}_0x3c88de[_0x96e7('0xca')]+=_0x42d3a0;this[_0x96e7('0xcc')](_0x3c88de['id'],_0x42d3a0,_0x3c88de['dialOrderByScheduledAt'],_0x3c88de)[_0x96e7('0x41')](function(_0xf6c19e){_0x3c88de[_0x96e7('0xca')]-=_0x42d3a0;_0x3c88de[_0x96e7('0xca')]=_0x3c88de[_0x96e7('0xca')]>0x0?_0x3c88de[_0x96e7('0xca')]:0x0;if(!checkContactEmpty(_0xf6c19e)){_0x3c88de[_0x96e7('0x44')]=_0x96e7('0xa4');logger[_0x96e7('0x82')](_0x96e7('0x20b')+_0x3c88de['name']);}else{_0x3c88de[_0x96e7('0xa0')]+=_0xf6c19e['length'];_0x3c88de['message']=_0x96e7('0x20c');for(var _0x43ca99=0x0;_0x43ca99<_0xf6c19e[_0x96e7('0x9f')];_0x43ca99+=0x1){_0x3c88de[_0x96e7('0x20d')]+=0x1;if(_[_0x96e7('0xe2')](_0xf6c19e[_0x43ca99])||_['isNil'](_0xf6c19e[_0x43ca99][_0x96e7('0x18d')])||_['isNil'](_0xf6c19e[_0x43ca99][_0x96e7('0x175')])){_0x1bb4ac[_0x96e7('0x20e')](_0x96e7('0x20f'),_0x3c88de,_0xf6c19e[_0x43ca99]);}else{_0x1bb4ac['checkIsBlackListIvr'](_['pick'](_0xf6c19e[_0x43ca99],[_0x96e7('0xda'),_0x96e7('0x210')]))['then'](_0x1bb4ac[_0x96e7('0x1f4')](_0x3c88de,_0xf6c19e[_0x43ca99]))[_0x96e7('0xbd')](_0x1bb4ac[_0x96e7('0xd5')](_0x96e7('0x211'),_0x3c88de));}}}})[_0x96e7('0xbd')](loggerGetContactDialer(_0x96e7('0x212'),_0x3c88de,_0x42d3a0));}};Dialer[_0x96e7('0x1a')]['handlePower']=function(_0x1ac7c5,_0x51a186){var _0x1a0e35=this;var _0x28a95c=[];var _0x87ce96=_0x51a186>=0x1?_0x51a186:0x1;if(_0x1ac7c5[_0x96e7('0x5e')]===_0x96e7('0x9')){_0x87ce96=0x1;}var _0x241261=Math[_0x96e7('0x1d1')](_0x1ac7c5[_0x96e7('0x55')]*_0x87ce96)-_0x1ac7c5['originated']-_0x1ac7c5['temp'];emitVoiceQueueSummary(_0x1ac7c5);if(_0x1ac7c5[_0x96e7('0x213')]>0x0){var _0x4429e0=_0x1ac7c5[_0x96e7('0x213')]-_0x1ac7c5[_0x96e7('0xa0')]-_0x1ac7c5['talking']-_0x1ac7c5[_0x96e7('0xca')]-_0x1ac7c5[_0x96e7('0x57')];if(_0x241261>_0x4429e0){_0x241261=_0x4429e0;}}if(_0x241261>0x0){if(_0x1ac7c5[_0x96e7('0x5e')]===_0x96e7('0x9')){_0x241261=0x1;}if(_0x241261>this[_0x96e7('0x23')]){_0x241261=this[_0x96e7('0x23')];}_0x1ac7c5['temp']+=_0x241261;for(var _0x5dd575 in this[_0x96e7('0x21')]){if(typeof this[_0x96e7('0x21')][_0x5dd575]!==_0x96e7('0xb3')){if(this[_0x96e7('0x21')][_0x5dd575][_0x96e7('0xeb')]===_0x96e7('0x214')&&this[_0x96e7('0x21')][_0x5dd575][_0x96e7('0xb4')]===_0x96e7('0xe0')){_0x28a95c[_0x96e7('0x12f')](this[_0x96e7('0x21')][_0x5dd575]['id']);}}}this['getContactDialer'](_0x1ac7c5['id'],_0x28a95c,_0x241261,_0x1ac7c5[_0x96e7('0x215')],_0x1ac7c5)[_0x96e7('0x41')](function(_0x57ec16){_0x1ac7c5[_0x96e7('0xca')]-=_0x241261;_0x1ac7c5['temp']=_0x1ac7c5[_0x96e7('0xca')]>0x0?_0x1ac7c5[_0x96e7('0xca')]:0x0;if(!checkContactEmpty(_0x57ec16)){_0x1a0e35[_0x96e7('0x216')](_0x1ac7c5)[_0x96e7('0x41')](sendMessageReschedule(_0x1ac7c5))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xbe')));}else{_0x1ac7c5[_0x96e7('0xa0')]+=_0x57ec16[_0x96e7('0x9f')];_0x1ac7c5['message']=_0x1ac7c5[_0x96e7('0x5e')]===_0x96e7('0x9')?_0x96e7('0x17d'):_0x96e7('0x20c');for(var _0x254007=0x0;_0x254007<_0x57ec16[_0x96e7('0x9f')];_0x254007+=0x1){if(_[_0x96e7('0xe2')](_0x57ec16[_0x254007])||_[_0x96e7('0xe2')](_0x57ec16[_0x254007][_0x96e7('0x18d')])||_[_0x96e7('0xe2')](_0x57ec16[_0x254007][_0x96e7('0x175')])){_0x1a0e35[_0x96e7('0x20e')](_0x96e7('0x20f'),_0x1ac7c5,_0x57ec16[_0x254007]);}else{_0x1a0e35[_0x96e7('0xbf')](_[_0x96e7('0x13c')](_0x57ec16[_0x254007],[_0x96e7('0xd9'),'Contact.phone']))[_0x96e7('0x41')](_0x1a0e35[_0x96e7('0x1f4')](_0x1ac7c5,_0x57ec16[_0x254007]))['catch'](_0x1a0e35[_0x96e7('0xd5')](_0x96e7('0x20f'),_0x1ac7c5));}}}})[_0x96e7('0xbd')](loggerGetContactDialer(_0x96e7('0x217'),_0x1ac7c5,_0x241261));}};Dialer['prototype'][_0x96e7('0x96')]=function(_0x5c916e){if(_0x5c916e[_0x96e7('0x213')]>0x0){var _0x350d7b=_0x5c916e[_0x96e7('0x213')]-_0x5c916e[_0x96e7('0xa0')]-_0x5c916e[_0x96e7('0x59')];if(_0x350d7b>0x0){this[_0x96e7('0x218')](_0x5c916e);}else{loggerPredictiveCalls[_0x96e7('0x82')](_0x96e7('0x219'));}}else{this['tryOriginatePredictive'](_0x5c916e);}};Dialer[_0x96e7('0x1a')][_0x96e7('0x218')]=function(_0x64c333){var _0x515649=this;var _0x1233ae=[];_0x64c333['originated']+=0x1;for(var _0x580514 in this[_0x96e7('0x21')]){if(typeof this['agents'][_0x580514]!==_0x96e7('0xb3')){if(this['agents'][_0x580514]['state']===_0x96e7('0x214')&&this[_0x96e7('0x21')][_0x580514][_0x96e7('0xb4')]===_0x96e7('0xe0')){_0x1233ae[_0x96e7('0x12f')](this['agents'][_0x580514]['id']);}}}this[_0x96e7('0xc9')](_0x64c333['id'],_0x1233ae,0x1,_0x64c333[_0x96e7('0x215')],_0x64c333)[_0x96e7('0x41')](function(_0x3357d7){if(!checkContactEmpty(_0x3357d7)){checkContactLowerLimitOriginate(_0x64c333,0x1,0x0);_0x515649['countReScheduled'](_0x64c333)[_0x96e7('0x41')](sendMessageReschedule(_0x64c333))[_0x96e7('0xbd')](loggerCatch(_0x96e7('0xbe')));}else{_0x64c333[_0x96e7('0x44')]=_0x96e7('0x20c');if(_[_0x96e7('0xe2')](_0x3357d7[0x0])||_['isNil'](_0x3357d7[0x0][_0x96e7('0x18d')])||_[_0x96e7('0xe2')](_0x3357d7[0x0][_0x96e7('0x175')])){_0x515649[_0x96e7('0x20e')]('[actionOriginate]\x20',_0x64c333,_0x3357d7[0x0]);}else{_0x515649[_0x96e7('0xbf')](_[_0x96e7('0x13c')](_0x3357d7[0x0],['VoiceQueueId',_0x96e7('0x210')]))[_0x96e7('0x41')](_0x515649[_0x96e7('0x1f4')](_0x64c333,_0x3357d7[0x0]))[_0x96e7('0xbd')](_0x515649['loggerHandler'](_0x96e7('0x21a'),_0x64c333));}}})[_0x96e7('0xbd')](loggerGetContactDialer(_0x96e7('0x21b'),_0x64c333,0x1));emitVoiceQueueSummary(_0x64c333);};Dialer[_0x96e7('0x1a')][_0x96e7('0x1e8')]=function(_0x1504f1,_0x54230f,_0x2265c5,_0x26ac2c,_0x52669a,_0x2cde1d){loggerPredictive[_0x96e7('0x82')](_0x96e7('0x21c'));loggerPredictive['info'](_0x96e7('0x21d'),_0x1504f1);loggerPredictive[_0x96e7('0x82')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54230f);loggerPredictive['info'](_0x96e7('0x21e'),_0x2265c5);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x21f'),_0x26ac2c);loggerPredictive[_0x96e7('0x82')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52669a);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x8b'));return new Promise(function(_0x4a5a9c,_0x4eda5b){if(_0x1504f1<=0x0||isNaN(_0x1504f1)){return _0x4eda5b(msgResponse('[abandonmentRate]',_0x96e7('0x4f'),'m\x20=\x20'+_0x1504f1));}if(_0x2265c5<=0x0||isNaN(_0x2265c5)){return _0x4eda5b(msgResponse(_0x96e7('0x220'),'Error',_0x96e7('0x221')+_0x2265c5));}if(_0x26ac2c<=0x0||isNaN(_0x26ac2c)){return _0x4eda5b(msgResponse('[abandonmentRate]',_0x96e7('0x4f'),_0x96e7('0x222')+_0x26ac2c));}if(_0x54230f<=0x0||isNaN(_0x54230f)){return _0x4eda5b(msgResponse(_0x96e7('0x220'),_0x96e7('0x4f'),_0x96e7('0x223')+_0x54230f));}if(_0x52669a<=0x0||isNaN(_0x52669a)){return _0x4eda5b(msgResponse(_0x96e7('0x220'),'Error',_0x96e7('0x224')+_0x52669a));}_0x2cde1d=_0x2cde1d||0x0;var _0x233187=0x1/_0x2265c5;var _0x180d5f=0x0;var _0x41edbf=0x0;var _0xbaba08=0x0;var _0x804403=0x0;for(var _0x4de2d9=0x0;_0xbaba08<_0x52669a;_0x4de2d9+=0x1){_0x41edbf=_0x4de2d9/_0x54230f;_0x180d5f=(_0x26ac2c*_0x41edbf+_0x2cde1d)/_0x233187;_0xbaba08=erlangb(_0x180d5f,_0x1504f1);_0x804403=_0x180d5f/_0x1504f1*(0x1-erlangb(_0x180d5f,_0x1504f1));}return _0x4a5a9c({'erlangCalls':_0x4de2d9,'erlangCallToSecond':_0x54230f/_0x4de2d9,'erlangAbandonmentRate':_0xbaba08,'erlangBusyFactor':_0x804403});});};Dialer[_0x96e7('0x1a')][_0x96e7('0x1ea')]=function(_0x51d050,_0x11afa2,_0x53bc4a,_0x5ebeef,_0x207fed,_0x14893e){loggerPredictive[_0x96e7('0x82')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x96e7('0x82')](_0x96e7('0x21d'),_0x51d050);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x225'),_0x11afa2);loggerPredictive['info'](_0x96e7('0x21e'),_0x53bc4a);loggerPredictive['info'](_0x96e7('0x21f'),_0x5ebeef);loggerPredictive[_0x96e7('0x82')](_0x96e7('0x226'),_0x207fed);loggerPredictive['info'](_0x96e7('0x8b'));return new Promise(function(_0x3b6a7d,_0x12c51b){if(_0x51d050<=0x0||isNaN(_0x51d050)){return _0x12c51b(msgResponse(_0x96e7('0x227'),_0x96e7('0x4f'),'m\x20=\x20'+_0x51d050));}if(_0x53bc4a<=0x0||isNaN(_0x53bc4a)){return _0x12c51b(msgResponse(_0x96e7('0x227'),'Error',_0x96e7('0x221')+_0x53bc4a));}if(_0x5ebeef<=0x0||isNaN(_0x5ebeef)){return _0x12c51b(msgResponse('[busyFactor]',_0x96e7('0x4f'),'p\x20=\x20'+_0x5ebeef));}if(_0x11afa2<=0x0||isNaN(_0x11afa2)){return _0x12c51b(msgResponse(_0x96e7('0x227'),_0x96e7('0x4f'),'interval\x20=\x20'+_0x11afa2));}if(_0x207fed<=0x0||isNaN(_0x207fed)){return _0x12c51b(msgResponse('[busyFactor]',_0x96e7('0x4f'),_0x96e7('0x228')+_0x207fed));}_0x14893e=_0x14893e||0x0;var _0x31a92f=0x1/_0x53bc4a;var _0x1f8da1=0x0;var _0x14933e=0x0;var _0x3ffb5b=0x0;var _0x4bfb4f=0x0;for(var _0x12c246=0x0;_0x4bfb4f<_0x207fed;_0x12c246+=0x1){_0x14933e=_0x12c246/_0x11afa2;_0x1f8da1=(_0x5ebeef*_0x14933e+_0x14893e)/_0x31a92f;_0x3ffb5b=erlangb(_0x1f8da1,_0x51d050);_0x4bfb4f=_0x1f8da1/_0x51d050*(0x1-erlangb(_0x1f8da1,_0x51d050));}return _0x3b6a7d({'erlangCalls':_0x12c246,'erlangCallToSecond':_0x11afa2/_0x12c246,'erlangAbandonmentRate':_0x3ffb5b,'erlangBusyFactor':_0x4bfb4f});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 0f762d5..0574db8 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 _0x2285=['VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId'];(function(_0x305576,_0x31d638){var _0x72d48=function(_0x2d8146){while(--_0x2d8146){_0x305576['push'](_0x305576['shift']());}};_0x72d48(++_0x31d638);}(_0x2285,0xa3));var _0x5228=function(_0x21da64,_0x1d3d1f){_0x21da64=_0x21da64-0x0;var _0x5a79f1=_0x2285[_0x21da64];return _0x5a79f1;};'use strict';var util=require(_0x5228('0x0'));var _=require(_0x5228('0x1'));var moment=require(_0x5228('0x2'));function getSeconds(_0x5398fc,_0x237ad3){var _0x10552b=moment(_0x5398fc)[_0x5228('0x3')](0x0);var _0x351044=moment(_0x237ad3)[_0x5228('0x3')](0x0);return _0x10552b[_0x5228('0x4')](_0x351044,_0x5228('0x5'));}function QueueCallerAbandon(_0x19d77a,_0x3326bd){this[_0x5228('0x6')]=_0x19d77a[_0x5228('0x6')];this[_0x5228('0x7')]=_0x19d77a['type'];this[_0x5228('0x8')]=_0x19d77a[_0x5228('0x7')]==='outbound'?_0x5228('0x9'):_0x19d77a[_0x5228('0x7')];this['countbusyretry']=_0x19d77a[_0x5228('0xa')];this[_0x5228('0xb')]=_0x19d77a[_0x5228('0xb')];this[_0x5228('0xc')]=_0x19d77a[_0x5228('0xc')];this[_0x5228('0xd')]=_0x19d77a[_0x5228('0xa')]+_0x19d77a[_0x5228('0xb')]+_0x19d77a[_0x5228('0xc')]+_0x19d77a[_0x5228('0xe')]+_0x19d77a['countdropretry']+_0x19d77a[_0x5228('0xf')]+_0x19d77a[_0x5228('0x10')]+_0x19d77a['countagentrejectretry'];this[_0x5228('0xe')]=_0x19d77a[_0x5228('0xe')];this[_0x5228('0x11')]=_0x19d77a['countdropretry'];this['countabandonedretry']=_0x19d77a[_0x5228('0xf')];this[_0x5228('0x10')]=_0x19d77a[_0x5228('0x10')];this[_0x5228('0x12')]=_0x19d77a[_0x5228('0x12')];this[_0x5228('0x13')]=_0x3326bd[_0x5228('0x13')];this[_0x5228('0x14')]=_0x19d77a[_0x5228('0x15')];this[_0x5228('0x16')]=_0x19d77a[_0x5228('0x17')];this[_0x5228('0x18')]=_0x19d77a[_0x5228('0x18')];this['responsetime']=_0x19d77a[_0x5228('0x19')];this[_0x5228('0x1a')]=_0x19d77a[_0x5228('0x1a')];this[_0x5228('0x1b')]=this[_0x5228('0x1a')];this['ringtime']=getSeconds(_0x19d77a['responsetime'],_0x19d77a[_0x5228('0x18')]);this[_0x5228('0x1c')]=getSeconds(this[_0x5228('0x1a')],_0x19d77a[_0x5228('0x19')]);this['talktime']=0x0;this[_0x5228('0x9')]=_0x3326bd[_0x5228('0x9')];this['membername']=_0x3326bd[_0x5228('0x1d')];this[_0x5228('0x1e')]=_0x3326bd[_0x5228('0x1e')];this[_0x5228('0x1f')]=_0x19d77a[_0x5228('0x1f')];this['callbackuniqueid']=_0x19d77a[_0x5228('0x20')];this[_0x5228('0x21')]=_0x19d77a[_0x5228('0x21')];this['recallme']=_0x19d77a[_0x5228('0x22')];this[_0x5228('0x23')]=_0x19d77a[_0x5228('0x23')];this['ListId']=_0x19d77a['ListId'];this[_0x5228('0x24')]=_0x19d77a['UserId'];this[_0x5228('0x25')]=_0x19d77a['VoiceQueueId'];this[_0x5228('0x26')]=_0x19d77a[_0x5228('0x26')];this['originatecalleridnum']=_0x19d77a[_0x5228('0x27')]||'';this['originatecalleridname']=_0x19d77a['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x1c27=['campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type'];(function(_0x1cc3a5,_0x59850b){var _0x4bf8b7=function(_0x3588ff){while(--_0x3588ff){_0x1cc3a5['push'](_0x1cc3a5['shift']());}};_0x4bf8b7(++_0x59850b);}(_0x1c27,0x76));var _0x71c2=function(_0x179b74,_0x5dc97d){_0x179b74=_0x179b74-0x0;var _0x268f76=_0x1c27[_0x179b74];return _0x268f76;};'use strict';var util=require(_0x71c2('0x0'));var _=require(_0x71c2('0x1'));var moment=require(_0x71c2('0x2'));function getSeconds(_0x26b2bc,_0x43199b){var _0x429a03=moment(_0x26b2bc)[_0x71c2('0x3')](0x0);var _0xe590b2=moment(_0x43199b)[_0x71c2('0x3')](0x0);return _0x429a03[_0x71c2('0x4')](_0xe590b2,_0x71c2('0x5'));}function QueueCallerAbandon(_0x5da66b,_0x3c12d2){this[_0x71c2('0x6')]=_0x5da66b[_0x71c2('0x6')];this['type']=_0x5da66b[_0x71c2('0x7')];this[_0x71c2('0x8')]=_0x5da66b[_0x71c2('0x7')]==='outbound'?_0x71c2('0x9'):_0x5da66b[_0x71c2('0x7')];this[_0x71c2('0xa')]=_0x5da66b[_0x71c2('0xa')];this[_0x71c2('0xb')]=_0x5da66b[_0x71c2('0xb')];this['countnoanswerretry']=_0x5da66b['countnoanswerretry'];this[_0x71c2('0xc')]=_0x5da66b['countbusyretry']+_0x5da66b[_0x71c2('0xb')]+_0x5da66b[_0x71c2('0xd')]+_0x5da66b['countnosuchnumberretry']+_0x5da66b[_0x71c2('0xe')]+_0x5da66b[_0x71c2('0xf')]+_0x5da66b[_0x71c2('0x10')]+_0x5da66b[_0x71c2('0x11')];this['countnosuchnumberretry']=_0x5da66b[_0x71c2('0x12')];this['countdropretry']=_0x5da66b[_0x71c2('0xe')];this[_0x71c2('0xf')]=_0x5da66b[_0x71c2('0xf')];this[_0x71c2('0x10')]=_0x5da66b[_0x71c2('0x10')];this[_0x71c2('0x11')]=_0x5da66b[_0x71c2('0x11')];this[_0x71c2('0x13')]=_0x3c12d2['uniqueid'];this[_0x71c2('0x14')]=_0x5da66b['name'];this['calleridnum']=_0x5da66b[_0x71c2('0x15')];this[_0x71c2('0x16')]=_0x5da66b['starttime'];this[_0x71c2('0x17')]=_0x5da66b['responsetime'];this[_0x71c2('0x18')]=_0x5da66b[_0x71c2('0x18')];this['endtime']=this['droptime'];this[_0x71c2('0x19')]=getSeconds(_0x5da66b[_0x71c2('0x17')],_0x5da66b[_0x71c2('0x16')]);this[_0x71c2('0x1a')]=getSeconds(this[_0x71c2('0x18')],_0x5da66b['responsetime']);this[_0x71c2('0x1b')]=0x0;this['queue']=_0x3c12d2['queue'];this[_0x71c2('0x1c')]=_0x3c12d2[_0x71c2('0x1d')];this[_0x71c2('0x1e')]=_0x3c12d2['reason'];this[_0x71c2('0x1f')]=_0x5da66b[_0x71c2('0x1f')];this[_0x71c2('0x20')]=_0x5da66b[_0x71c2('0x20')];this[_0x71c2('0x21')]=_0x5da66b['callbackat'];this[_0x71c2('0x22')]=_0x5da66b[_0x71c2('0x22')];this[_0x71c2('0x23')]=_0x5da66b[_0x71c2('0x23')];this[_0x71c2('0x24')]=_0x5da66b[_0x71c2('0x24')];this[_0x71c2('0x25')]=_0x5da66b[_0x71c2('0x25')];this[_0x71c2('0x26')]=_0x5da66b[_0x71c2('0x26')];this[_0x71c2('0x27')]=_0x5da66b[_0x71c2('0x27')];this[_0x71c2('0x28')]=_0x5da66b[_0x71c2('0x28')]||'';this[_0x71c2('0x29')]=_0x5da66b[_0x71c2('0x29')]||'';}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 16dbba1..da84f06 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(_0x1ef3fe,_0x515e8f){var _0x366cdb=function(_0x446c09){while(--_0x446c09){_0x1ef3fe['push'](_0x1ef3fe['shift']());}};_0x366cdb(++_0x515e8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x3fad05,_0x5872a0){var _0xcfae80=function(_0x816d27){while(--_0x816d27){_0x3fad05['push'](_0x3fad05['shift']());}};_0xcfae80(++_0x5872a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 fe90320..2b58348 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 _0xd004=['lodash','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','faxAccounts','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','hasOwnProperty','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','error','\x20notify\x20','catch','\x20receiveFax\x20','stringify','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','finally','syncHangup','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util'];(function(_0x4a3e45,_0x1e8ef3){var _0x48db76=function(_0x33d341){while(--_0x33d341){_0x4a3e45['push'](_0x4a3e45['shift']());}};_0x48db76(++_0x1e8ef3);}(_0xd004,0x164));var _0x4d00=function(_0x48404b,_0x107b24){_0x48404b=_0x48404b-0x0;var _0x5bec5a=_0xd004[_0x48404b];return _0x5bec5a;};'use strict';var util=require(_0x4d00('0x0'));var _=require(_0x4d00('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4d00('0x2'));var moment=require(_0x4d00('0x3'));var path=require(_0x4d00('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4d00('0x5'));var logger=require(_0x4d00('0x6'))(_0x4d00('0x7'));var ami=require(_0x4d00('0x8'));var rpcDb=require(_0x4d00('0x9'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x4d00('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4d00('0xb'));var faxMessage=require(_0x4d00('0xc'));function Fax(_0x5b766f){this[_0x4d00('0xd')]={};this['faxAccounts']=_0x5b766f['faxAccounts'];this[_0x4d00('0xe')]=_0x5b766f[_0x4d00('0xe')];this[_0x4d00('0xf')]={};ami['on'](_0x4d00('0x10'),this['syncNewchannel'][_0x4d00('0x11')](this));ami['on'](_0x4d00('0x12'),this[_0x4d00('0x13')]['bind'](this));ami['on'](_0x4d00('0x14'),this[_0x4d00('0x15')][_0x4d00('0x11')](this));ami['on'](_0x4d00('0x16'),this['syncNewExten'][_0x4d00('0x11')](this));ami['on']('faxstatus',this[_0x4d00('0x17')]['bind'](this));ami['on'](_0x4d00('0x18'),this[_0x4d00('0x19')][_0x4d00('0x11')](this));ami['on'](_0x4d00('0x1a'),this['syncHangup']['bind'](this));ami['on'](_0x4d00('0x1b'),this[_0x4d00('0x1c')]['bind'](this));}Fax[_0x4d00('0x1d')][_0x4d00('0x1e')]=function(_0x447765){if(_0x447765[_0x4d00('0x1f')]===_0x4d00('0x20')){for(var _0x4849bf in this['faxAccounts']){if(this[_0x4d00('0x21')]['hasOwnProperty'](_0x4849bf)){if(_0x447765[_0x4d00('0x22')]===this[_0x4d00('0x21')][_0x4849bf][_0x4d00('0x23')]){this[_0x4d00('0xd')][_0x447765[_0x4d00('0x24')]]={};this[_0x4d00('0xd')][_0x447765['uniqueid']][_0x4d00('0x25')]=_0x447765[_0x4d00('0x25')];this[_0x4d00('0xd')][_0x447765[_0x4d00('0x24')]]['id']=this[_0x4d00('0x21')][_0x4849bf]['id'];this[_0x4d00('0xd')][_0x447765['uniqueid']][_0x4d00('0x26')]=this['faxAccounts'][_0x4849bf]['name'];logger[_0x4d00('0x27')](_0x447765[_0x4d00('0x24')],_0x4d00('0x28'));}}}}if(this[_0x4d00('0xf')][_0x447765['uniqueid']]){this[_0x4d00('0xd')][_0x447765[_0x4d00('0x24')]]={};this[_0x4d00('0xd')][_0x447765[_0x4d00('0x24')]][_0x4d00('0x25')]=_0x447765[_0x4d00('0x25')];logger['info'](_0x447765[_0x4d00('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x4d00('0x1d')][_0x4d00('0x13')]=function(_0x51d8d6){if(this[_0x4d00('0xd')][_0x51d8d6[_0x4d00('0x24')]]){for(var _0x351143 in _0x51d8d6[_0x4d00('0x29')]){if(_0x51d8d6[_0x4d00('0x29')]['hasOwnProperty'](_0x351143)){this[_0x4d00('0xd')][_0x51d8d6[_0x4d00('0x24')]][_0x351143]=_0x51d8d6[_0x4d00('0x2a')];}}}};Fax[_0x4d00('0x1d')][_0x4d00('0x15')]=function(_0x5e9d33){if(this['channels'][_0x5e9d33['uniqueid']]){this['channels'][_0x5e9d33[_0x4d00('0x24')]]['channelstate']=_0x5e9d33[_0x4d00('0x2b')];this[_0x4d00('0xd')][_0x5e9d33[_0x4d00('0x24')]][_0x4d00('0x2c')]=_0x5e9d33['channelstatedesc'];}};Fax[_0x4d00('0x1d')][_0x4d00('0x2d')]=function(_0x128cc4){if(this['channels'][_0x128cc4[_0x4d00('0x24')]]){for(var _0x86c66d in _0x128cc4[_0x4d00('0x29')]){if(_0x128cc4[_0x4d00('0x29')][_0x4d00('0x2e')](_0x86c66d)){this[_0x4d00('0xd')][_0x128cc4['uniqueid']][_0x86c66d]=_0x128cc4[_0x4d00('0x2a')];}}}};Fax[_0x4d00('0x1d')][_0x4d00('0x17')]=function(_0x48f8c5){if(this[_0x4d00('0xd')][_0x48f8c5[_0x4d00('0x24')]]){this[_0x4d00('0xd')][_0x48f8c5[_0x4d00('0x24')]][_0x4d00('0x2f')]=_0x48f8c5[_0x4d00('0x2f')];this[_0x4d00('0xd')][_0x48f8c5[_0x4d00('0x24')]][_0x4d00('0x30')]=_0x48f8c5[_0x4d00('0x30')];this[_0x4d00('0xd')][_0x48f8c5[_0x4d00('0x24')]][_0x4d00('0x23')]=_0x48f8c5['localstationid'];this['channels'][_0x48f8c5[_0x4d00('0x24')]][_0x4d00('0x31')]=_0x48f8c5[_0x4d00('0x31')];logger['info'](_0x48f8c5[_0x4d00('0x24')],_0x4d00('0x32'));}};Fax[_0x4d00('0x1d')][_0x4d00('0x19')]=function(_0x208c44){var _0x500803=this;if(this[_0x4d00('0xd')][_0x208c44['uniqueid']]){var _0x104f86=this['channels'][_0x208c44['uniqueid']]['id'];this[_0x4d00('0xd')][_0x208c44[_0x4d00('0x24')]]['remotestationid']=_0x208c44[_0x4d00('0x33')];this[_0x4d00('0xd')][_0x208c44[_0x4d00('0x24')]][_0x4d00('0x34')]=_0x208c44['pagestransferred'];this[_0x4d00('0xd')][_0x208c44[_0x4d00('0x24')]][_0x4d00('0x23')]=_0x208c44['localstationid'];this[_0x4d00('0xd')][_0x208c44[_0x4d00('0x24')]][_0x4d00('0x35')]=_0x208c44[_0x4d00('0x35')];this[_0x4d00('0xd')][_0x208c44[_0x4d00('0x24')]][_0x4d00('0x36')]=_0x208c44[_0x4d00('0x36')];this['channels'][_0x208c44[_0x4d00('0x24')]]['filename']=_0x208c44[_0x4d00('0x31')];this[_0x4d00('0xd')][_0x208c44['uniqueid']]['calleridnum']=_0x208c44[_0x4d00('0x37')];if(this[_0x4d00('0xd')][_0x208c44['uniqueid']][_0x4d00('0x34')]>0x0){tiff2pdf(_0x208c44[_0x4d00('0x31')],_0x4d00('0x38'),function(_0x35e358){logger['info'](_0x208c44['uniqueid'],_0x4d00('0x39'),_0x35e358['message']);attachment[_0x4d00('0x3a')]({'name':path[_0x4d00('0x3b')](_0x208c44[_0x4d00('0x31')])[_0x4d00('0x26')],'basename':path[_0x4d00('0x3b')](_0x208c44['filename'])[_0x4d00('0x26')]+_0x4d00('0x3c'),'type':_0x4d00('0x3d')})[_0x4d00('0x3e')](function(_0x2b7593){faxAccount[_0x4d00('0x3f')](_0x104f86,{'from':_0x208c44[_0x4d00('0x37')],'mapKey':_0x4d00('0x7'),'body':path['parse'](_0x208c44[_0x4d00('0x31')])[_0x4d00('0x26')]+_0x4d00('0x3c'),'AttachmentId':_0x2b7593['id']})['catch'](function(_0x29771c){logger[_0x4d00('0x40')](_0x208c44[_0x4d00('0x24')],_0x4d00('0x41'),JSON['stringify'](_0x29771c));});})[_0x4d00('0x42')](function(_0x2bfe65){logger[_0x4d00('0x40')](_0x208c44['uniqueid'],_0x4d00('0x43'),JSON[_0x4d00('0x44')](_0x2bfe65));});});}logger['info'](_0x208c44[_0x4d00('0x24')],_0x4d00('0x43'));}};Fax[_0x4d00('0x1d')]['syncOriginateResponse']=function(_0x5a5a3c){if(this[_0x4d00('0xf')][_0x5a5a3c[_0x4d00('0x24')]]){_[_0x4d00('0x45')](this['channels'][_0x5a5a3c['uniqueid']],_[_0x4d00('0x46')](_0x5a5a3c,[_0x4d00('0x47'),'reason']));}};function updateStatus(_0x96f789){if(_0x96f789[_0x4d00('0x48')]){faxMessage[_0x4d00('0x49')](_0x96f789[_0x4d00('0x48')],{'failMessage':_0x4d00('0x4a')})[_0x4d00('0x3e')](function(_0x2c75e3){ut[_0x4d00('0x4b')]('[Fax][Message][Error][Updated]',_0x2c75e3);})[_0x4d00('0x42')](function(_0x47e038){ut[_0x4d00('0x4b')](_0x4d00('0x4c'),_0x47e038);});}else{ut[_0x4d00('0x4b')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x4d00('0x1d')]['updateStatus']=function(_0x1cea10,_0xe91b8d,_0x472461){var _0x4157b0=this;var _0x3f0718={};if(_0xe91b8d){_0x3f0718={'read':_0xe91b8d};}else{_0x3f0718={'failMessage':_0x472461};}if(this[_0x4d00('0xf')][_0x1cea10][_0x4d00('0x48')]){faxMessage[_0x4d00('0x49')](this[_0x4d00('0xf')][_0x1cea10]['AttachmentId'],_0x3f0718)[_0x4d00('0x3e')](function(_0x3dba3b){ut[_0x4d00('0x4b')]('[Fax][Message][Updated]',_0x3dba3b);})[_0x4d00('0x42')](function(_0x265fd9){ut[_0x4d00('0x4b')]('[Fax][Message][NoUpdate1]',_0x265fd9);})[_0x4d00('0x4d')](function(){delete _0x4157b0[_0x4d00('0xd')][_0x1cea10];delete _0x4157b0[_0x4d00('0xf')][_0x1cea10];});}else{ut[_0x4d00('0x4b')]('[Fax][Message][NoUpdate2]');delete this[_0x4d00('0xd')][_0x1cea10];delete this[_0x4d00('0xf')][_0x1cea10];}};Fax[_0x4d00('0x1d')][_0x4d00('0x4e')]=function(_0x169043){var _0x17eab4=this;if(this[_0x4d00('0xd')][_0x169043[_0x4d00('0x24')]]){if(this[_0x4d00('0xf')][_0x169043[_0x4d00('0x24')]]){this['channels'][_0x169043[_0x4d00('0x24')]]['id']=this['actions'][_0x169043[_0x4d00('0x24')]]['id'];this[_0x4d00('0xd')][_0x169043['uniqueid']][_0x4d00('0x26')]=this[_0x4d00('0xf')][_0x169043[_0x4d00('0x24')]][_0x4d00('0x26')];}logger[_0x4d00('0x27')](_0x169043['uniqueid'],this[_0x4d00('0xf')][_0x169043['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x4d00('0x4f'),JSON[_0x4d00('0x44')](this['channels'][_0x169043[_0x4d00('0x24')]]));if(this[_0x4d00('0xf')][_0x169043[_0x4d00('0x24')]]){if(this['channels'][_0x169043[_0x4d00('0x24')]]['faxpages']>0x0&&this['channels'][_0x169043['uniqueid']][_0x4d00('0x50')]===_0x4d00('0x51')){this[_0x4d00('0x52')](_0x169043['uniqueid'],!![]);}else{this[_0x4d00('0x52')](_0x169043[_0x4d00('0x24')],![],this[_0x4d00('0xd')][_0x169043[_0x4d00('0x24')]][_0x4d00('0x53')]?_0x4d00('0x54')+this[_0x4d00('0xd')][_0x169043[_0x4d00('0x24')]]['faxstatusstring']:_0x4d00('0x55'));}}}};Fax[_0x4d00('0x1d')][_0x4d00('0x56')]=function(_0x4f68eb){var _0x101f31=this;return new BPromise(function(_0xf28d86,_0x17d9c8){_0x101f31[_0x4d00('0x57')](_0x4f68eb,_0x101f31[_0x4d00('0x21')][_0x4f68eb[_0x4d00('0x58')]])[_0x4d00('0x3e')](function(_0x334a19){ut[_0x4d00('0x4b')](_0x4d00('0x59'),_0x334a19);_0xf28d86(ut[_0x4d00('0x5a')](_0x4d00('0x5b')));})['catch'](function(_0x189106){ut[_0x4d00('0x4b')](_0x4d00('0x5c'),_0x189106);updateStatus(_0x4f68eb);_0x17d9c8(ut[_0x4d00('0x5a')](_0x4d00('0x5d')));});});};Fax[_0x4d00('0x1d')][_0x4d00('0x5e')]=function(_0x20a832){var _0x54eac0=this;return new BPromise(function(_0x1e61db,_0x3bfadf){var _0x208297=_0x54eac0[_0x4d00('0x5f')](_0x54eac0[_0x4d00('0x21')][_0x20a832[_0x4d00('0x58')]][_0x4d00('0x60')],_0x20a832);if(_0x208297[_0x4d00('0x61')]){_0x1e61db(ut['message'](_0x4d00('0x62')));}else{_0x3bfadf(ut[_0x4d00('0x5a')](_0x208297[_0x4d00('0x5a')]));}});};function originate(_0x55ccb6,_0x5c0d60,_0x826d08){return new BPromise(function(_0x714e38,_0x409212){if(_0x826d08){var _0x5e891e=util[_0x4d00('0x63')]('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[_0x4d00('0x3b')](_0x55ccb6[_0x4d00('0x4')])['name'],_0x55ccb6['path']);gs[_0x4d00('0x64')](_0x5e891e)[_0x4d00('0x3e')](function(){_0x55ccb6[_0x4d00('0x4')]=util[_0x4d00('0x63')]('%s/%s.tif',path[_0x4d00('0x3b')](_0x55ccb6[_0x4d00('0x4')])[_0x4d00('0x65')],path['parse'](_0x55ccb6[_0x4d00('0x4')])[_0x4d00('0x26')]);_0x5c0d60['XMF-PATH']=_0x55ccb6[_0x4d00('0x4')];ut[_0x4d00('0x4b')](_0x4d00('0x66'),'');ami[_0x4d00('0x67')](ut[_0x4d00('0x68')](_0x55ccb6,_0x5c0d60))[_0x4d00('0x3e')](function(_0x3dcce0){_0x714e38(_0x3dcce0);})[_0x4d00('0x42')](function(_0x307c9e){_0x409212(_0x307c9e);});})[_0x4d00('0x42')](function(_0x474aa7){_0x409212(_0x474aa7);});}else{ami[_0x4d00('0x67')](ut[_0x4d00('0x68')](_0x55ccb6,_0x5c0d60))[_0x4d00('0x3e')](function(_0x161c73){_0x714e38(_0x161c73);})['catch'](function(_0x55c6dd){_0x409212(_0x55c6dd);});}});}Fax[_0x4d00('0x1d')][_0x4d00('0x57')]=function(_0x7b102a,_0x5bb30a){var _0x1819e2=this;return new BPromise(function(_0x34e49b,_0x2aa423){var _0x28de1a=uuid['v4']();var _0x222d78=ut[_0x4d00('0x69')](_0x7b102a,_0x5bb30a);_0x1819e2[_0x4d00('0xf')][_0x28de1a]=new Action(_0x28de1a,_0x5bb30a,_0x7b102a);var _0x3fe31e=_0x1819e2[_0x4d00('0xf')][_0x28de1a];if(path[_0x4d00('0x3b')](_0x7b102a[_0x4d00('0x4')])[_0x4d00('0x6a')]===_0x4d00('0x3c')){originate(_0x3fe31e,_0x222d78,!![])[_0x4d00('0x3e')](function(_0x20418c){_0x34e49b(_0x20418c);})[_0x4d00('0x42')](function(_0x1c15e0){_0x2aa423(_0x1c15e0);});}else{originate(_0x3fe31e,_0x222d78,![])[_0x4d00('0x3e')](function(_0x52e32a){_0x34e49b(_0x52e32a);})['catch'](function(_0x47a388){_0x2aa423(_0x47a388);});}});};Fax[_0x4d00('0x1d')][_0x4d00('0x6b')]=function(_0x19891e){return!_[_0x4d00('0x6c')](_0x19891e)&&!_[_0x4d00('0x6c')](_0x19891e['name'])&&!_[_0x4d00('0x6c')](_0x19891e[_0x4d00('0x6d')])&&_0x19891e[_0x4d00('0x6d')]&&!_[_0x4d00('0x6c')](this[_0x4d00('0xe')][util[_0x4d00('0x63')]('SIP/%s',_0x19891e[_0x4d00('0x26')])])&&!_['isNil'](this['trunks'][util[_0x4d00('0x63')](_0x4d00('0x6e'),_0x19891e[_0x4d00('0x26')])][_0x4d00('0x30')])&&(this['trunks'][util[_0x4d00('0x63')](_0x4d00('0x6e'),_0x19891e[_0x4d00('0x26')])][_0x4d00('0x30')]===_0x4d00('0x6f')||this[_0x4d00('0xe')][util[_0x4d00('0x63')]('SIP/%s',_0x19891e['name'])]['status']==='unmonitored');};Fax[_0x4d00('0x1d')][_0x4d00('0x5f')]=function(_0x40fb99,_0x4b6f14){if(!this[_0x4d00('0x6b')](_0x40fb99)){ut[_0x4d00('0x4b')](_0x4d00('0x70'),_[_0x4d00('0x6c')](_0x40fb99)?'':_0x40fb99[_0x4d00('0x26')]+_0x4d00('0x71'));return{'isValid':![],'message':_0x4d00('0x72')};}if(_[_0x4d00('0x6c')](_0x4b6f14['fax'])){ut[_0x4d00('0x4b')](_0x4d00('0x73'),JSON['stringify'](_0x4b6f14));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x4d00('0x6c')](_0x4b6f14[_0x4d00('0x4')])){ut[_0x4d00('0x4b')](_0x4d00('0x74'),JSON['stringify'](_0x4b6f14));return{'isValid':![],'message':_0x4d00('0x75')};}return{'isValid':!![],'message':_0x4d00('0x76')};};module['exports']=Fax; \ No newline at end of file +var _0xa6dc=['create','parse','.pdf','notify','calleridnum','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','isValid','Trunk\x20Reachable','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','syncOriginateResponse','prototype','context','exten','localstationid','uniqueid','channel','name','info','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa6dc,0x194));var _0xca6d=function(_0x4edd19,_0x38d12a){_0x4edd19=_0x4edd19-0x0;var _0x317d12=_0xa6dc[_0x4edd19];return _0x317d12;};'use strict';var util=require(_0xca6d('0x0'));var _=require(_0xca6d('0x1'));var BPromise=require(_0xca6d('0x2'));var uuid=require(_0xca6d('0x3'));var moment=require(_0xca6d('0x4'));var path=require(_0xca6d('0x5'));var tiff2pdf=require(_0xca6d('0x6'));var gs=require(_0xca6d('0x7'));var logger=require('../../../config/logger')(_0xca6d('0x8'));var ami=require(_0xca6d('0x9'));var rpcDb=require(_0xca6d('0xa'));var Channel=require(_0xca6d('0xb'));var ut=require(_0xca6d('0xc'));var Action=require(_0xca6d('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x24e5e7){this[_0xca6d('0xe')]={};this[_0xca6d('0xf')]=_0x24e5e7[_0xca6d('0xf')];this[_0xca6d('0x10')]=_0x24e5e7[_0xca6d('0x10')];this[_0xca6d('0x11')]={};ami['on'](_0xca6d('0x12'),this[_0xca6d('0x13')][_0xca6d('0x14')](this));ami['on']('varset',this[_0xca6d('0x15')][_0xca6d('0x14')](this));ami['on']('newstate',this[_0xca6d('0x16')]['bind'](this));ami['on'](_0xca6d('0x17'),this[_0xca6d('0x18')]['bind'](this));ami['on']('faxstatus',this[_0xca6d('0x19')][_0xca6d('0x14')](this));ami['on'](_0xca6d('0x1a'),this['syncReceiveFax']['bind'](this));ami['on'](_0xca6d('0x1b'),this[_0xca6d('0x1c')][_0xca6d('0x14')](this));ami['on']('originateresponse',this[_0xca6d('0x1d')][_0xca6d('0x14')](this));}Fax[_0xca6d('0x1e')][_0xca6d('0x13')]=function(_0x279a80){if(_0x279a80[_0xca6d('0x1f')]==='from-voip-provider'){for(var _0x166c46 in this[_0xca6d('0xf')]){if(this[_0xca6d('0xf')]['hasOwnProperty'](_0x166c46)){if(_0x279a80[_0xca6d('0x20')]===this[_0xca6d('0xf')][_0x166c46][_0xca6d('0x21')]){this['channels'][_0x279a80[_0xca6d('0x22')]]={};this[_0xca6d('0xe')][_0x279a80[_0xca6d('0x22')]][_0xca6d('0x23')]=_0x279a80[_0xca6d('0x23')];this['channels'][_0x279a80[_0xca6d('0x22')]]['id']=this[_0xca6d('0xf')][_0x166c46]['id'];this[_0xca6d('0xe')][_0x279a80['uniqueid']][_0xca6d('0x24')]=this[_0xca6d('0xf')][_0x166c46]['name'];logger[_0xca6d('0x25')](_0x279a80[_0xca6d('0x22')],'\x20syncNewchannel\x20');}}}}if(this[_0xca6d('0x11')][_0x279a80['uniqueid']]){this[_0xca6d('0xe')][_0x279a80['uniqueid']]={};this[_0xca6d('0xe')][_0x279a80[_0xca6d('0x22')]][_0xca6d('0x23')]=_0x279a80['channel'];logger[_0xca6d('0x25')](_0x279a80[_0xca6d('0x22')],'\x20syncNewchannel\x20');}};Fax[_0xca6d('0x1e')][_0xca6d('0x15')]=function(_0x221185){if(this[_0xca6d('0xe')][_0x221185[_0xca6d('0x22')]]){for(var _0x1fe2cb in _0x221185[_0xca6d('0x26')]){if(_0x221185[_0xca6d('0x26')][_0xca6d('0x27')](_0x1fe2cb)){this[_0xca6d('0xe')][_0x221185['uniqueid']][_0x1fe2cb]=_0x221185[_0xca6d('0x28')];}}}};Fax[_0xca6d('0x1e')][_0xca6d('0x16')]=function(_0x97e0cf){if(this[_0xca6d('0xe')][_0x97e0cf[_0xca6d('0x22')]]){this['channels'][_0x97e0cf[_0xca6d('0x22')]][_0xca6d('0x29')]=_0x97e0cf[_0xca6d('0x29')];this[_0xca6d('0xe')][_0x97e0cf[_0xca6d('0x22')]]['channelstatedesc']=_0x97e0cf[_0xca6d('0x2a')];}};Fax[_0xca6d('0x1e')][_0xca6d('0x18')]=function(_0x4ef85d){if(this[_0xca6d('0xe')][_0x4ef85d[_0xca6d('0x22')]]){for(var _0x59eb2e in _0x4ef85d[_0xca6d('0x26')]){if(_0x4ef85d[_0xca6d('0x26')]['hasOwnProperty'](_0x59eb2e)){this[_0xca6d('0xe')][_0x4ef85d[_0xca6d('0x22')]][_0x59eb2e]=_0x4ef85d[_0xca6d('0x28')];}}}};Fax[_0xca6d('0x1e')]['syncFaxStatus']=function(_0x540f1e){if(this[_0xca6d('0xe')][_0x540f1e[_0xca6d('0x22')]]){this['channels'][_0x540f1e[_0xca6d('0x22')]][_0xca6d('0x2b')]=_0x540f1e['operation'];this[_0xca6d('0xe')][_0x540f1e[_0xca6d('0x22')]]['status']=_0x540f1e[_0xca6d('0x2c')];this['channels'][_0x540f1e['uniqueid']]['localstationid']=_0x540f1e['localstationid'];this[_0xca6d('0xe')][_0x540f1e[_0xca6d('0x22')]][_0xca6d('0x2d')]=_0x540f1e[_0xca6d('0x2d')];logger['info'](_0x540f1e[_0xca6d('0x22')],_0xca6d('0x2e'));}};Fax[_0xca6d('0x1e')][_0xca6d('0x2f')]=function(_0xe40e5a){var _0x46a8b0=this;if(this['channels'][_0xe40e5a[_0xca6d('0x22')]]){var _0x16141c=this[_0xca6d('0xe')][_0xe40e5a[_0xca6d('0x22')]]['id'];this[_0xca6d('0xe')][_0xe40e5a[_0xca6d('0x22')]]['remotestationid']=_0xe40e5a['remotestationid'];this['channels'][_0xe40e5a['uniqueid']][_0xca6d('0x30')]=_0xe40e5a[_0xca6d('0x30')];this[_0xca6d('0xe')][_0xe40e5a['uniqueid']][_0xca6d('0x21')]=_0xe40e5a[_0xca6d('0x21')];this['channels'][_0xe40e5a[_0xca6d('0x22')]][_0xca6d('0x31')]=_0xe40e5a[_0xca6d('0x31')];this[_0xca6d('0xe')][_0xe40e5a[_0xca6d('0x22')]][_0xca6d('0x32')]=_0xe40e5a[_0xca6d('0x32')];this[_0xca6d('0xe')][_0xe40e5a['uniqueid']]['filename']=_0xe40e5a[_0xca6d('0x2d')];this[_0xca6d('0xe')][_0xe40e5a['uniqueid']]['calleridnum']=_0xe40e5a['calleridnum'];if(this['channels'][_0xe40e5a[_0xca6d('0x22')]][_0xca6d('0x30')]>0x0){tiff2pdf(_0xe40e5a[_0xca6d('0x2d')],_0xca6d('0x33'),function(_0x251723){logger[_0xca6d('0x25')](_0xe40e5a[_0xca6d('0x22')],'\x20result\x20conversion\x20file\x20',_0x251723['message']);attachment[_0xca6d('0x34')]({'name':path['parse'](_0xe40e5a['filename'])[_0xca6d('0x24')],'basename':path[_0xca6d('0x35')](_0xe40e5a['filename'])['name']+_0xca6d('0x36'),'type':'application/pdf'})['then'](function(_0xc24f92){faxAccount[_0xca6d('0x37')](_0x16141c,{'from':_0xe40e5a[_0xca6d('0x38')],'mapKey':'fax','body':path['parse'](_0xe40e5a[_0xca6d('0x2d')])[_0xca6d('0x24')]+_0xca6d('0x36'),'AttachmentId':_0xc24f92['id']})[_0xca6d('0x39')](function(_0x2fe9db){logger[_0xca6d('0x3a')](_0xe40e5a[_0xca6d('0x22')],_0xca6d('0x3b'),JSON[_0xca6d('0x3c')](_0x2fe9db));});})['catch'](function(_0x56ddde){logger[_0xca6d('0x3a')](_0xe40e5a[_0xca6d('0x22')],_0xca6d('0x3d'),JSON[_0xca6d('0x3c')](_0x56ddde));});});}logger[_0xca6d('0x25')](_0xe40e5a[_0xca6d('0x22')],_0xca6d('0x3d'));}};Fax[_0xca6d('0x1e')][_0xca6d('0x1d')]=function(_0x5e57b8){if(this[_0xca6d('0x11')][_0x5e57b8['uniqueid']]){_[_0xca6d('0x3e')](this[_0xca6d('0xe')][_0x5e57b8[_0xca6d('0x22')]],_[_0xca6d('0x3f')](_0x5e57b8,[_0xca6d('0x40'),'reason']));}};function updateStatus(_0x421e85){if(_0x421e85[_0xca6d('0x41')]){faxMessage[_0xca6d('0x42')](_0x421e85[_0xca6d('0x41')],{'failMessage':_0xca6d('0x43')})[_0xca6d('0x44')](function(_0xac3f02){ut['logger'](_0xca6d('0x45'),_0xac3f02);})['catch'](function(_0x1d32c8){ut[_0xca6d('0x46')](_0xca6d('0x47'),_0x1d32c8);});}else{ut[_0xca6d('0x46')](_0xca6d('0x48'));}}Fax[_0xca6d('0x1e')][_0xca6d('0x49')]=function(_0xddac4,_0x42b1e9,_0x4dcd15){var _0x16f4b4=this;var _0x21adc2={};if(_0x42b1e9){_0x21adc2={'read':_0x42b1e9};}else{_0x21adc2={'failMessage':_0x4dcd15};}if(this['actions'][_0xddac4][_0xca6d('0x41')]){faxMessage[_0xca6d('0x42')](this['actions'][_0xddac4]['AttachmentId'],_0x21adc2)[_0xca6d('0x44')](function(_0x5333ec){ut['logger'](_0xca6d('0x4a'),_0x5333ec);})[_0xca6d('0x39')](function(_0x483dea){ut[_0xca6d('0x46')]('[Fax][Message][NoUpdate1]',_0x483dea);})[_0xca6d('0x4b')](function(){delete _0x16f4b4[_0xca6d('0xe')][_0xddac4];delete _0x16f4b4[_0xca6d('0x11')][_0xddac4];});}else{ut['logger'](_0xca6d('0x4c'));delete this[_0xca6d('0xe')][_0xddac4];delete this[_0xca6d('0x11')][_0xddac4];}};Fax['prototype'][_0xca6d('0x1c')]=function(_0x2128e3){var _0x5cd623=this;if(this['channels'][_0x2128e3[_0xca6d('0x22')]]){if(this[_0xca6d('0x11')][_0x2128e3['uniqueid']]){this['channels'][_0x2128e3[_0xca6d('0x22')]]['id']=this[_0xca6d('0x11')][_0x2128e3[_0xca6d('0x22')]]['id'];this[_0xca6d('0xe')][_0x2128e3[_0xca6d('0x22')]][_0xca6d('0x24')]=this[_0xca6d('0x11')][_0x2128e3['uniqueid']][_0xca6d('0x24')];}logger[_0xca6d('0x25')](_0x2128e3[_0xca6d('0x22')],this[_0xca6d('0x11')][_0x2128e3[_0xca6d('0x22')]]?_0xca6d('0x4d'):'\x20hangup\x20faxRiceive\x20',JSON[_0xca6d('0x3c')](this[_0xca6d('0xe')][_0x2128e3[_0xca6d('0x22')]]));if(this[_0xca6d('0x11')][_0x2128e3['uniqueid']]){if(this[_0xca6d('0xe')][_0x2128e3[_0xca6d('0x22')]]['faxpages']>0x0&&this['channels'][_0x2128e3[_0xca6d('0x22')]]['faxstatus']==='SUCCESS'){this[_0xca6d('0x49')](_0x2128e3['uniqueid'],!![]);}else{this[_0xca6d('0x49')](_0x2128e3[_0xca6d('0x22')],![],this[_0xca6d('0xe')][_0x2128e3[_0xca6d('0x22')]][_0xca6d('0x4e')]?_0xca6d('0x4f')+this['channels'][_0x2128e3['uniqueid']][_0xca6d('0x4e')]:_0xca6d('0x50'));}}}};Fax['prototype'][_0xca6d('0x51')]=function(_0x422fd3){var _0x3b6dba=this;return new BPromise(function(_0x165e89,_0x5c80f7){_0x3b6dba['execOriginate'](_0x422fd3,_0x3b6dba['faxAccounts'][_0x422fd3[_0xca6d('0x52')]])[_0xca6d('0x44')](function(_0x184b2c){ut[_0xca6d('0x46')](_0xca6d('0x53'),_0x184b2c);_0x165e89(ut[_0xca6d('0x54')](_0xca6d('0x55')));})[_0xca6d('0x39')](function(_0x26cfab){ut[_0xca6d('0x46')](_0xca6d('0x56'),_0x26cfab);updateStatus(_0x422fd3);_0x5c80f7(ut['message'](_0xca6d('0x57')));});});};Fax[_0xca6d('0x1e')][_0xca6d('0x58')]=function(_0x498ce4){var _0x2c5933=this;return new BPromise(function(_0x18fe22,_0x2149e5){var _0x591c1d=_0x2c5933['checkTrunk'](_0x2c5933['faxAccounts'][_0x498ce4[_0xca6d('0x52')]]['Trunk'],_0x498ce4);if(_0x591c1d[_0xca6d('0x59')]){_0x18fe22(ut[_0xca6d('0x54')](_0xca6d('0x5a')));}else{_0x2149e5(ut['message'](_0x591c1d[_0xca6d('0x54')]));}});};function originate(_0x457bbc,_0x387ac0,_0x221422){return new BPromise(function(_0x39916e,_0x3edc46){if(_0x221422){var _0xa2f246=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xca6d('0x35')](_0x457bbc[_0xca6d('0x5')])['name'],_0x457bbc[_0xca6d('0x5')]);gs[_0xca6d('0x5b')](_0xa2f246)[_0xca6d('0x44')](function(){_0x457bbc['path']=util[_0xca6d('0x5c')](_0xca6d('0x5d'),path[_0xca6d('0x35')](_0x457bbc['path'])[_0xca6d('0x5e')],path[_0xca6d('0x35')](_0x457bbc[_0xca6d('0x5')])[_0xca6d('0x24')]);_0x387ac0[_0xca6d('0x5f')]=_0x457bbc[_0xca6d('0x5')];ut[_0xca6d('0x46')](_0xca6d('0x60'),'');ami[_0xca6d('0x61')](ut[_0xca6d('0x62')](_0x457bbc,_0x387ac0))['then'](function(_0x49efb0){_0x39916e(_0x49efb0);})['catch'](function(_0x5dd1da){_0x3edc46(_0x5dd1da);});})[_0xca6d('0x39')](function(_0x3bc218){_0x3edc46(_0x3bc218);});}else{ami[_0xca6d('0x61')](ut['variablesAction'](_0x457bbc,_0x387ac0))[_0xca6d('0x44')](function(_0x375284){_0x39916e(_0x375284);})['catch'](function(_0xd1dcb7){_0x3edc46(_0xd1dcb7);});}});}Fax[_0xca6d('0x1e')][_0xca6d('0x63')]=function(_0x3d043a,_0x4e6552){var _0x559cb7=this;return new BPromise(function(_0x2af772,_0x22f85a){var _0x17ce59=uuid['v4']();var _0x4ce7b8=ut[_0xca6d('0x64')](_0x3d043a,_0x4e6552);_0x559cb7[_0xca6d('0x11')][_0x17ce59]=new Action(_0x17ce59,_0x4e6552,_0x3d043a);var _0x176e02=_0x559cb7[_0xca6d('0x11')][_0x17ce59];if(path[_0xca6d('0x35')](_0x3d043a[_0xca6d('0x5')])[_0xca6d('0x65')]===_0xca6d('0x36')){originate(_0x176e02,_0x4ce7b8,!![])[_0xca6d('0x44')](function(_0x42d376){_0x2af772(_0x42d376);})['catch'](function(_0x4131ee){_0x22f85a(_0x4131ee);});}else{originate(_0x176e02,_0x4ce7b8,![])[_0xca6d('0x44')](function(_0x5b0160){_0x2af772(_0x5b0160);})['catch'](function(_0xf03dc9){_0x22f85a(_0xf03dc9);});}});};Fax[_0xca6d('0x1e')][_0xca6d('0x66')]=function(_0xb52518){return!_[_0xca6d('0x67')](_0xb52518)&&!_[_0xca6d('0x67')](_0xb52518[_0xca6d('0x24')])&&!_['isNil'](_0xb52518[_0xca6d('0x68')])&&_0xb52518[_0xca6d('0x68')]&&!_['isNil'](this[_0xca6d('0x10')][util['format'](_0xca6d('0x69'),_0xb52518['name'])])&&!_['isNil'](this[_0xca6d('0x10')][util[_0xca6d('0x5c')](_0xca6d('0x69'),_0xb52518[_0xca6d('0x24')])][_0xca6d('0x2c')])&&(this['trunks'][util[_0xca6d('0x5c')](_0xca6d('0x69'),_0xb52518['name'])]['status']===_0xca6d('0x6a')||this['trunks'][util['format'](_0xca6d('0x69'),_0xb52518['name'])][_0xca6d('0x2c')]==='unmonitored');};Fax[_0xca6d('0x1e')][_0xca6d('0x6b')]=function(_0x299924,_0x36917c){if(!this[_0xca6d('0x66')](_0x299924)){ut[_0xca6d('0x46')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xca6d('0x67')](_0x299924)?'':_0x299924[_0xca6d('0x24')]+_0xca6d('0x6c'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x36917c[_0xca6d('0x8')])){ut[_0xca6d('0x46')](_0xca6d('0x6d'),JSON[_0xca6d('0x3c')](_0x36917c));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xca6d('0x67')](_0x36917c[_0xca6d('0x5')])){ut['logger'](_0xca6d('0x6e'),JSON[_0xca6d('0x3c')](_0x36917c));return{'isValid':![],'message':_0xca6d('0x6f')};}return{'isValid':!![],'message':_0xca6d('0x70')};};module[_0xca6d('0x71')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 6af06b3..6c2eb4d 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 _0x4d19=['preview','lodash','../rpc/faxAccount','error','inspect','resolve','notify','catch','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x3b38ac,_0x313209){var _0x3765b9=function(_0x2f4e04){while(--_0x2f4e04){_0x3b38ac['push'](_0x3b38ac['shift']());}};_0x3765b9(++_0x313209);}(_0x4d19,0x159));var _0x94d1=function(_0x1186fa,_0x4ec83a){_0x1186fa=_0x1186fa-0x0;var _0x26420a=_0x4d19[_0x1186fa];return _0x26420a;};'use strict';var util=require(_0x94d1('0x0'));var BPromise=require(_0x94d1('0x1'));var logger=require(_0x94d1('0x2'))(_0x94d1('0x3'));var _=require(_0x94d1('0x4'));var faxAccount=require(_0x94d1('0x5'));function loggerCatch(_0x8b570f){return function(_0x589a95){logger[_0x94d1('0x6')](_0x8b570f,util[_0x94d1('0x7')](_0x589a95,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0xd4a36a,_0x414a40){return BPromise[_0x94d1('0x8')]()['then'](faxAccount[_0x94d1('0x9')](_0xd4a36a,_0x414a40))[_0x94d1('0xa')](loggerCatch(_0x94d1('0xb')));}; \ No newline at end of file +var _0xed5c=['resolve','then','util','bluebird','../../../config/logger','preview','lodash','error','inspect','notify'];(function(_0x529411,_0x51f5b0){var _0x1c4c89=function(_0x5bd16d){while(--_0x5bd16d){_0x529411['push'](_0x529411['shift']());}};_0x1c4c89(++_0x51f5b0);}(_0xed5c,0x12e));var _0xced5=function(_0x516ba9,_0x108578){_0x516ba9=_0x516ba9-0x0;var _0x5f3fe5=_0xed5c[_0x516ba9];return _0x5f3fe5;};'use strict';var util=require(_0xced5('0x0'));var BPromise=require(_0xced5('0x1'));var logger=require(_0xced5('0x2'))(_0xced5('0x3'));var _=require(_0xced5('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x280804){return function(_0x486bf5){logger[_0xced5('0x5')](_0x280804,util[_0xced5('0x6')](_0x486bf5,{'showHidden':![],'depth':null}));};}exports[_0xced5('0x7')]=function(_0x3b0d98,_0x3d59b0){return BPromise[_0xced5('0x8')]()[_0xced5('0x9')](faxAccount[_0xced5('0x7')](_0x3b0d98,_0x3d59b0))['catch'](loggerCatch('[Notify]\x20'));}; \ 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 5bf5142..969a165 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 _0xa96e=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa96e,0x8d));var _0xea96=function(_0x283ff4,_0x2ba5f7){_0x283ff4=_0x283ff4-0x0;var _0x5522ae=_0xa96e[_0x283ff4];return _0x5522ae;};'use strict';var util=require(_0xea96('0x0'));var logger=require(_0xea96('0x1'))(_0xea96('0x2'));var BPromise=require(_0xea96('0x3'));var exec=require(_0xea96('0x4'))[_0xea96('0x5')];exports[_0xea96('0x6')]=function(_0x4e87a7){return new BPromise(function(_0x2c0af6,_0x394e24){exec(_0x4e87a7,function(_0xded6cc,_0x301ccd,_0x363ec1){logger['info']('Exec\x20gs',_0x301ccd);if(_0xded6cc){logger[_0xea96('0x7')](_0xea96('0x8'),'\x20Error\x20:',util[_0xea96('0x9')](_0xded6cc,{'showHidden':![],'depth':null}),_0x301ccd,_0x363ec1);_0x394e24(_0xded6cc);}_0x2c0af6(_0x301ccd);});});}; \ No newline at end of file +var _0xd76a=['fax','exec','execute','Exec\x20gs','util'];(function(_0x3c9883,_0x1ec458){var _0xed64d7=function(_0x3ac6f7){while(--_0x3ac6f7){_0x3c9883['push'](_0x3c9883['shift']());}};_0xed64d7(++_0x1ec458);}(_0xd76a,0x1d0));var _0xad76=function(_0x10ef61,_0x41ebb6){_0x10ef61=_0x10ef61-0x0;var _0xebf6c4=_0xd76a[_0x10ef61];return _0xebf6c4;};'use strict';var util=require(_0xad76('0x0'));var logger=require('../../../../config/logger')(_0xad76('0x1'));var BPromise=require('bluebird');var exec=require('child_process')[_0xad76('0x2')];exports[_0xad76('0x3')]=function(_0x30c9be){return new BPromise(function(_0x423ab4,_0x1665f5){exec(_0x30c9be,function(_0x229767,_0x1b27fc,_0x1e7e51){logger['info']('Exec\x20gs',_0x1b27fc);if(_0x229767){logger['info'](_0xad76('0x4'),'\x20Error\x20:',util['inspect'](_0x229767,{'showHidden':![],'depth':null}),_0x1b27fc,_0x1e7e51);_0x1665f5(_0x229767);}_0x423ab4(_0x1b27fc);});});}; \ 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 caf28a5..2339115 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 _0x84e1=['faxdetect','t38timeout','path','variablesAction','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','uniqueid','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','minrate','maxrate','format','\x22%s\x22','modem'];(function(_0x143290,_0x8b9484){var _0x16dcb0=function(_0x34c132){while(--_0x34c132){_0x143290['push'](_0x143290['shift']());}};_0x16dcb0(++_0x8b9484);}(_0x84e1,0x168));var _0x184e=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x84e1[_0x50a0c2];return _0x5ebadd;};'use strict';var util=require(_0x184e('0x0'));var _=require(_0x184e('0x1'));var moment=require(_0x184e('0x2'));var logger=require(_0x184e('0x3'))(_0x184e('0x4'));exports[_0x184e('0x5')]=function(_0x49b408){return{'message':_0x49b408};};exports['logger']=function(_0x1b6361,_0xe33bc2){logger[_0x184e('0x6')](_0x1b6361,util[_0x184e('0x7')](_0xe33bc2,{'showHidden':![],'depth':null}));};exports[_0x184e('0x8')]=function(_0x341dc4,_0x3af43d){var _0x12c5a0={'XMF-ECM':_0x3af43d[_0x184e('0x9')],'XMF-HEADERINFO':_0x3af43d['headerinfo'],'XMF-MINRATE':_0x3af43d[_0x184e('0xa')],'XMF-MAXRATE':_0x3af43d[_0x184e('0xb')],'XMF-MODEM':util[_0x184e('0xc')](_0x184e('0xd'),_0x3af43d[_0x184e('0xe')]),'XMF-GATEWAY':_0x3af43d['gateway'],'XMF-FAXDETECT':_0x3af43d[_0x184e('0xf')],'XMF-T38TIMEOUT':_0x3af43d[_0x184e('0x10')],'XMF-LOCALSTATIONID':_0x3af43d['localstationid'],'XMF-PATH':_0x341dc4[_0x184e('0x11')]};return _0x12c5a0;};exports[_0x184e('0x12')]=function(_0x3ede91,_0x5e07b7){return{'actionid':_0x3ede91['uniqueid'],'action':'originate','channel':_0x3ede91['channel'],'Exten':_0x184e('0x13'),'Context':_0x184e('0x14'),'Priority':'1','callerid':util[_0x184e('0xc')](_0x184e('0x15'),_0x3ede91[_0x184e('0x16')]?_0x3ede91[_0x184e('0x16')]:'',_0x3ede91[_0x184e('0x17')]),'variable':_0x5e07b7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3ede91[_0x184e('0x18')]};}; \ No newline at end of file +var _0xa3d4=['\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format'];(function(_0x3a5e83,_0x1910a4){var _0x4a753b=function(_0xe97ec2){while(--_0xe97ec2){_0x3a5e83['push'](_0x3a5e83['shift']());}};_0x4a753b(++_0x1910a4);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xa3d4[_0x465a0c];return _0x1e202e;};'use strict';var util=require('util');var _=require(_0x4a3d('0x0'));var moment=require(_0x4a3d('0x1'));var logger=require(_0x4a3d('0x2'))('fax');exports[_0x4a3d('0x3')]=function(_0xb9e235){return{'message':_0xb9e235};};exports[_0x4a3d('0x4')]=function(_0x33ff2f,_0x335971){logger[_0x4a3d('0x5')](_0x33ff2f,util[_0x4a3d('0x6')](_0x335971,{'showHidden':![],'depth':null}));};exports[_0x4a3d('0x7')]=function(_0x486c9b,_0x42af8e){var _0x2d79c3={'XMF-ECM':_0x42af8e[_0x4a3d('0x8')],'XMF-HEADERINFO':_0x42af8e[_0x4a3d('0x9')],'XMF-MINRATE':_0x42af8e[_0x4a3d('0xa')],'XMF-MAXRATE':_0x42af8e[_0x4a3d('0xb')],'XMF-MODEM':util[_0x4a3d('0xc')](_0x4a3d('0xd'),_0x42af8e[_0x4a3d('0xe')]),'XMF-GATEWAY':_0x42af8e['gateway'],'XMF-FAXDETECT':_0x42af8e[_0x4a3d('0xf')],'XMF-T38TIMEOUT':_0x42af8e[_0x4a3d('0x10')],'XMF-LOCALSTATIONID':_0x42af8e[_0x4a3d('0x11')],'XMF-PATH':_0x486c9b[_0x4a3d('0x12')]};return _0x2d79c3;};exports[_0x4a3d('0x13')]=function(_0x5d424c,_0x19f683){return{'actionid':_0x5d424c[_0x4a3d('0x14')],'action':'originate','channel':_0x5d424c['channel'],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x4a3d('0xc')]('\x22%s\x22\x20<%s>',_0x5d424c[_0x4a3d('0x9')]?_0x5d424c[_0x4a3d('0x9')]:'',_0x5d424c[_0x4a3d('0x11')]),'variable':_0x19f683,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5d424c[_0x4a3d('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index bf8888e..165b556 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 _0xfc1e=['getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xfc1e[_0x4409e7];return _0x24c751;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var server=require(_0xefc1('0x0'));var Realtime=require(_0xefc1('0x1'));var Report=require(_0xefc1('0x2'));var Acw=require(_0xefc1('0x3'));var Trigger=require(_0xefc1('0x4'));var Dialer=require('./dialer');var Preview=require(_0xefc1('0x5'));var Fax=require(_0xefc1('0x6'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xefc1('0x7'));var voiceCallReport=require(_0xefc1('0x8'));var trunk=require(_0xefc1('0x9'));var trigger=require(_0xefc1('0xa'));var template=require(_0xefc1('0xb'));var cmHopperHistory=require(_0xefc1('0xc'));var campaign=require(_0xefc1('0xd'));var voiceExtension=require(_0xefc1('0xe'));var faxAccount=require(_0xefc1('0xf'));var zendesk=require(_0xefc1('0x10'));var salesforce=require(_0xefc1('0x11'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xefc1('0x12'));var desk=require(_0xefc1('0x13'));var zoho=require(_0xefc1('0x14'));var vtiger=require(_0xefc1('0x15'));var freshsales=require(_0xefc1('0x16'));var servicenow=require(_0xefc1('0x17'));var dynamics365=require(_0xefc1('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xefc1('0x19'))(_0xefc1('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xefc1('0x1b')](_0xefc1('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xefc1('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xefc1('0x1d')]()[_0xefc1('0x1e')](user[_0xefc1('0x1f')]())[_0xefc1('0x1e')](realtime[_0xefc1('0x20')]())[_0xefc1('0x1e')](user[_0xefc1('0x21')]())['then'](realtime[_0xefc1('0x22')]())[_0xefc1('0x1e')](trunk[_0xefc1('0x23')]())['then'](realtime[_0xefc1('0x24')]())[_0xefc1('0x1e')](voiceQueue[_0xefc1('0x25')]())[_0xefc1('0x1e')](realtime[_0xefc1('0x26')]())[_0xefc1('0x1e')](trigger[_0xefc1('0x27')]())[_0xefc1('0x1e')](realtime['initTriggers']())[_0xefc1('0x1e')](template[_0xefc1('0x28')]())[_0xefc1('0x1e')](realtime['initTemplates']())['then'](zendesk[_0xefc1('0x29')]())['then'](realtime[_0xefc1('0x2a')]())['then'](salesforce[_0xefc1('0x2b')]())[_0xefc1('0x1e')](realtime['initSalesforceAccounts']())[_0xefc1('0x1e')](sugarcrm[_0xefc1('0x2c')]())[_0xefc1('0x1e')](realtime[_0xefc1('0x2d')]())[_0xefc1('0x1e')](freshdesk[_0xefc1('0x2e')]())['then'](realtime[_0xefc1('0x2f')]())[_0xefc1('0x1e')](desk['getDeskAccounts']())[_0xefc1('0x1e')](realtime['initDeskAccounts']())['then'](zoho[_0xefc1('0x30')]())[_0xefc1('0x1e')](realtime[_0xefc1('0x31')]())[_0xefc1('0x1e')](vtiger[_0xefc1('0x32')]())[_0xefc1('0x1e')](realtime['initVtigerAccounts']())['then'](freshsales[_0xefc1('0x33')]())[_0xefc1('0x1e')](realtime[_0xefc1('0x34')]())[_0xefc1('0x1e')](servicenow[_0xefc1('0x35')]())['then'](realtime[_0xefc1('0x36')]())[_0xefc1('0x1e')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0xefc1('0x37')]())[_0xefc1('0x1e')](campaign[_0xefc1('0x38')]())['then'](realtime[_0xefc1('0x39')]())[_0xefc1('0x1e')](voiceExtension[_0xefc1('0x3a')]())[_0xefc1('0x1e')](realtime[_0xefc1('0x3b')]())[_0xefc1('0x1e')](faxAccount[_0xefc1('0x3c')]())[_0xefc1('0x1e')](realtime['initFaxAccounts']())[_0xefc1('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0xefc1('0x1d')]()[_0xefc1('0x1e')](voiceQueueReport[_0xefc1('0x3d')]())[_0xefc1('0x1e')](realtime[_0xefc1('0x3e')]())[_0xefc1('0x1e')](cmHopperHistory[_0xefc1('0x3f')]())['then'](realtime[_0xefc1('0x40')]())[_0xefc1('0x1e')](cmHopperHistory[_0xefc1('0x41')]())[_0xefc1('0x1e')](realtime['initCampaignHopperHistory']())[_0xefc1('0x1e')](voiceCallReport['getVoiceCallReports']())[_0xefc1('0x1e')](realtime[_0xefc1('0x42')]())[_0xefc1('0x43')](function(_0x20e2d9){logger['error'](_0xefc1('0x44'),util[_0xefc1('0x45')](_0x20e2d9,{'showHidden':![],'depth':null}));});}function main(){return server[_0xefc1('0x46')](realtime,preview,fax)['then'](function(_0x385cba){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0xefc1('0x47')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3cbe7f){logger[_0xefc1('0x48')](_0xefc1('0x49'),util[_0xefc1('0x45')](_0x3cbe7f,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xabbe=['./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales'];(function(_0x4144ca,_0x20e8ba){var _0x4a6937=function(_0x3f3677){while(--_0x3f3677){_0x4144ca['push'](_0x4144ca['shift']());}};_0x4a6937(++_0x20e8ba);}(_0xabbe,0x1f4));var _0xeabb=function(_0x3b4c88,_0x184291){_0x3b4c88=_0x3b4c88-0x0;var _0x2193ee=_0xabbe[_0x3b4c88];return _0x2193ee;};'use strict';var BPromise=require(_0xeabb('0x0'));var util=require('util');var moment=require(_0xeabb('0x1'));var server=require(_0xeabb('0x2'));var Realtime=require(_0xeabb('0x3'));var Report=require('./report');var Acw=require(_0xeabb('0x4'));var Trigger=require(_0xeabb('0x5'));var Dialer=require(_0xeabb('0x6'));var Preview=require(_0xeabb('0x7'));var Fax=require(_0xeabb('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xeabb('0x9'));var voiceQueueReport=require(_0xeabb('0xa'));var voiceCallReport=require(_0xeabb('0xb'));var trunk=require(_0xeabb('0xc'));var trigger=require(_0xeabb('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0xeabb('0xe'));var campaign=require(_0xeabb('0xf'));var voiceExtension=require(_0xeabb('0x10'));var faxAccount=require(_0xeabb('0x11'));var zendesk=require(_0xeabb('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xeabb('0x13'));var freshdesk=require(_0xeabb('0x14'));var desk=require(_0xeabb('0x15'));var zoho=require(_0xeabb('0x16'));var vtiger=require(_0xeabb('0x17'));var freshsales=require(_0xeabb('0x18'));var servicenow=require(_0xeabb('0x19'));var dynamics365=require(_0xeabb('0x1a'));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(_0xeabb('0x1b'))(_0xeabb('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xeabb('0x1d')](_0xeabb('0x1e'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xeabb('0x1d')](_0xeabb('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xeabb('0x1f')](user['getAgents']())[_0xeabb('0x1f')](realtime[_0xeabb('0x20')]())[_0xeabb('0x1f')](user[_0xeabb('0x21')]())['then'](realtime[_0xeabb('0x22')]())[_0xeabb('0x1f')](trunk['getTrunks']())[_0xeabb('0x1f')](realtime[_0xeabb('0x23')]())[_0xeabb('0x1f')](voiceQueue[_0xeabb('0x24')]())[_0xeabb('0x1f')](realtime['initVoiceQueues']())[_0xeabb('0x1f')](trigger['getTriggers']())[_0xeabb('0x1f')](realtime[_0xeabb('0x25')]())[_0xeabb('0x1f')](template[_0xeabb('0x26')]())[_0xeabb('0x1f')](realtime['initTemplates']())['then'](zendesk[_0xeabb('0x27')]())[_0xeabb('0x1f')](realtime[_0xeabb('0x28')]())['then'](salesforce['getSalesforceAccounts']())[_0xeabb('0x1f')](realtime[_0xeabb('0x29')]())[_0xeabb('0x1f')](sugarcrm[_0xeabb('0x2a')]())[_0xeabb('0x1f')](realtime[_0xeabb('0x2b')]())[_0xeabb('0x1f')](freshdesk['getFreshdeskAccounts']())[_0xeabb('0x1f')](realtime[_0xeabb('0x2c')]())[_0xeabb('0x1f')](desk[_0xeabb('0x2d')]())[_0xeabb('0x1f')](realtime[_0xeabb('0x2e')]())['then'](zoho[_0xeabb('0x2f')]())[_0xeabb('0x1f')](realtime[_0xeabb('0x30')]())[_0xeabb('0x1f')](vtiger[_0xeabb('0x31')]())['then'](realtime[_0xeabb('0x32')]())[_0xeabb('0x1f')](freshsales[_0xeabb('0x33')]())['then'](realtime['initFreshsalesAccounts']())['then'](servicenow[_0xeabb('0x34')]())['then'](realtime[_0xeabb('0x35')]())[_0xeabb('0x1f')](dynamics365[_0xeabb('0x36')]())[_0xeabb('0x1f')](realtime[_0xeabb('0x37')]())['then'](campaign[_0xeabb('0x38')]())['then'](realtime[_0xeabb('0x39')]())[_0xeabb('0x1f')](voiceExtension[_0xeabb('0x3a')]())[_0xeabb('0x1f')](realtime[_0xeabb('0x3b')]())['then'](faxAccount[_0xeabb('0x3c')]())[_0xeabb('0x1f')](realtime[_0xeabb('0x3d')]())[_0xeabb('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0xeabb('0x3e')]()[_0xeabb('0x1f')](voiceQueueReport[_0xeabb('0x3f')]())[_0xeabb('0x1f')](realtime[_0xeabb('0x40')]())['then'](cmHopperHistory[_0xeabb('0x41')]())['then'](realtime[_0xeabb('0x42')]())[_0xeabb('0x1f')](cmHopperHistory['getCampaignHopperHistory']())[_0xeabb('0x1f')](realtime[_0xeabb('0x43')]())[_0xeabb('0x1f')](voiceCallReport[_0xeabb('0x44')]())[_0xeabb('0x1f')](realtime['initVoiceCallReports']())['catch'](function(_0x44b7ae){logger[_0xeabb('0x45')](_0xeabb('0x46'),util[_0xeabb('0x47')](_0x44b7ae,{'showHidden':![],'depth':null}));});}function main(){return server[_0xeabb('0x48')](realtime,preview,fax)[_0xeabb('0x1f')](function(_0x1d49ad){return initRealtime();})['then'](function(){return initParams();})[_0xeabb('0x1f')](function(){report[_0xeabb('0x49')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x14997c){logger[_0xeabb('0x45')](_0xeabb('0x4a'),util[_0xeabb('0x47')](_0x14997c,{'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 965f906..cedeb33 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 _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x1d9be2,_0x1d32bf){var _0x19dd38=function(_0x8508f1){while(--_0x8508f1){_0x1d9be2['push'](_0x1d9be2['shift']());}};_0x19dd38(++_0x1d32bf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xcb91[_0x23b655];return _0x364b32;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a6123,_0xc79a5c){_0x3a6123=_0x3a6123-0x0;var _0x1c392d=_0xedd9[_0x3a6123];return _0x1c392d;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 3e32e2d..8385970 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 _0x221c=['message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays'];(function(_0x5a50fa,_0x29f75f){var _0x26d453=function(_0x7939b7){while(--_0x7939b7){_0x5a50fa['push'](_0x5a50fa['shift']());}};_0x26d453(++_0x29f75f);}(_0x221c,0x12b));var _0xc221=function(_0x7a1a24,_0x5c0139){_0x7a1a24=_0x7a1a24-0x0;var _0x307adb=_0x221c[_0x7a1a24];return _0x307adb;};'use strict';function Campaign(_0x12ce91){this['id']=_0x12ce91['id']||0x0;this['name']=_0x12ce91[_0xc221('0x0')]||'';this[_0xc221('0x1')]=_0x12ce91[_0xc221('0x1')]||_0xc221('0x2');this[_0xc221('0x3')]=0x0;this[_0xc221('0x4')]=0x0;this[_0xc221('0x5')]=0x0;this[_0xc221('0x6')]=0x0;this[_0xc221('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0xc221('0x8')]=_0x12ce91[_0xc221('0x8')];this[_0xc221('0x9')]=_0x12ce91[_0xc221('0x9')];this[_0xc221('0xa')]=_0x12ce91[_0xc221('0xa')]||null;this['dialGlobalInterval']=_0x12ce91[_0xc221('0xb')]?_0x12ce91[_0xc221('0xb')]:null;this[_0xc221('0xc')]=_0x12ce91['dialOriginateCallerIdName'];this[_0xc221('0xd')]=_0x12ce91['dialOriginateCallerIdNumber'];this[_0xc221('0xe')]=_0x12ce91[_0xc221('0xe')]||0x1e;this[_0xc221('0xf')]=_0x12ce91['dialCongestionMaxRetry'];this[_0xc221('0x10')]=_0x12ce91[_0xc221('0x10')];this['dialBusyMaxRetry']=_0x12ce91['dialBusyMaxRetry'];this[_0xc221('0x11')]=_0x12ce91['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x12ce91[_0xc221('0x12')];this[_0xc221('0x13')]=_0x12ce91[_0xc221('0x13')];this[_0xc221('0x14')]=_0x12ce91[_0xc221('0x14')];this[_0xc221('0x15')]=_0x12ce91[_0xc221('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x12ce91[_0xc221('0x16')]||0x96;this[_0xc221('0x17')]=_0x12ce91[_0xc221('0x17')]||0x3;this[_0xc221('0x18')]=_0x12ce91[_0xc221('0x18')]||0x96;this[_0xc221('0x19')]=_0x12ce91[_0xc221('0x19')]||0x3;this[_0xc221('0x1a')]=_0x12ce91[_0xc221('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x12ce91[_0xc221('0x1b')]||0x3;this[_0xc221('0x1c')]=_0x12ce91[_0xc221('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x12ce91[_0xc221('0x1d')]||0x3;this[_0xc221('0x1e')]=_0x12ce91['dialAgentRejectRetryFrequency']||0x96;this[_0xc221('0x1f')]=_0x12ce91[_0xc221('0x1f')]||_0xc221('0x20');this[_0xc221('0x21')]=_0x12ce91[_0xc221('0x21')]||undefined;this[_0xc221('0x22')]=_0x12ce91[_0xc221('0x22')]||undefined;this[_0xc221('0x23')]=_0x12ce91[_0xc221('0x23')]||undefined;this[_0xc221('0x24')]=_0x12ce91[_0xc221('0x24')]?_0x12ce91[_0xc221('0x24')]:undefined;this['Trunk']=_0x12ce91[_0xc221('0x25')]?_0x12ce91['Trunk']:undefined;this['Interval']=_0x12ce91[_0xc221('0x26')]?_0x12ce91[_0xc221('0x26')]:undefined;this[_0xc221('0x27')]=_0x12ce91[_0xc221('0x27')]?_0x12ce91['SquareProject']:undefined;this[_0xc221('0x28')]=_0x12ce91[_0xc221('0x27')]?_0x12ce91['SquareProject'][_0xc221('0x0')]:undefined;this[_0xc221('0x29')]=_0x12ce91['dialAMDActive']||![];this[_0xc221('0x2a')]=_0x12ce91[_0xc221('0x2a')];this[_0xc221('0x2b')]=_0x12ce91[_0xc221('0x2b')];this[_0xc221('0x2c')]=_0x12ce91[_0xc221('0x2c')];this[_0xc221('0x2d')]=_0x12ce91[_0xc221('0x2d')];this[_0xc221('0x2e')]=_0x12ce91[_0xc221('0x2e')];this['dialAMDBetweenWordsSilence']=_0x12ce91['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x12ce91[_0xc221('0x2f')];this[_0xc221('0x30')]=_0x12ce91['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x12ce91[_0xc221('0x31')];}module[_0xc221('0x32')]=Campaign; \ No newline at end of file +var _0x4829=['type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','dialQueueProject','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4829,0x1ca));var _0x9482=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0x4829[_0x4f1da5];return _0xe972a8;};'use strict';function Campaign(_0x197a15){this['id']=_0x197a15['id']||0x0;this[_0x9482('0x0')]=_0x197a15[_0x9482('0x0')]||'';this[_0x9482('0x1')]=_0x197a15[_0x9482('0x1')]||_0x9482('0x2');this[_0x9482('0x3')]=0x0;this[_0x9482('0x4')]=0x0;this[_0x9482('0x5')]=0x0;this[_0x9482('0x6')]=0x0;this[_0x9482('0x7')]='';this[_0x9482('0x8')]=!![];this['active']=_0x197a15[_0x9482('0x9')];this[_0x9482('0xa')]=_0x197a15[_0x9482('0xa')];this['dialTimezone']=_0x197a15[_0x9482('0xb')]||null;this[_0x9482('0xc')]=_0x197a15[_0x9482('0xc')]?_0x197a15[_0x9482('0xc')]:null;this['dialOriginateCallerIdName']=_0x197a15[_0x9482('0xd')];this[_0x9482('0xe')]=_0x197a15[_0x9482('0xe')];this[_0x9482('0xf')]=_0x197a15[_0x9482('0xf')]||0x1e;this[_0x9482('0x10')]=_0x197a15[_0x9482('0x10')];this[_0x9482('0x11')]=_0x197a15[_0x9482('0x11')];this['dialBusyMaxRetry']=_0x197a15['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x197a15[_0x9482('0x12')];this[_0x9482('0x13')]=_0x197a15['dialNoAnswerMaxRetry'];this[_0x9482('0x14')]=_0x197a15[_0x9482('0x14')];this[_0x9482('0x15')]=_0x197a15[_0x9482('0x15')];this[_0x9482('0x16')]=_0x197a15[_0x9482('0x16')]||0x3;this[_0x9482('0x17')]=_0x197a15[_0x9482('0x17')]||0x96;this['dialDropMaxRetry']=_0x197a15[_0x9482('0x18')]||0x3;this['dialDropRetryFrequency']=_0x197a15['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x197a15[_0x9482('0x19')]||0x3;this[_0x9482('0x1a')]=_0x197a15[_0x9482('0x1a')]||0x96;this[_0x9482('0x1b')]=_0x197a15[_0x9482('0x1b')]||0x3;this[_0x9482('0x1c')]=_0x197a15[_0x9482('0x1c')]||0x96;this[_0x9482('0x1d')]=_0x197a15[_0x9482('0x1d')]||0x3;this[_0x9482('0x1e')]=_0x197a15[_0x9482('0x1e')]||0x96;this[_0x9482('0x1f')]=_0x197a15[_0x9482('0x1f')]||_0x9482('0x20');this[_0x9482('0x21')]=_0x197a15[_0x9482('0x21')]||undefined;this[_0x9482('0x22')]=_0x197a15[_0x9482('0x22')]||undefined;this['dialCutDigit']=_0x197a15['dialCutDigit']||undefined;this[_0x9482('0x23')]=_0x197a15['TrunkBackup']?_0x197a15[_0x9482('0x23')]:undefined;this[_0x9482('0x24')]=_0x197a15[_0x9482('0x24')]?_0x197a15['Trunk']:undefined;this[_0x9482('0x25')]=_0x197a15['Interval']?_0x197a15['Interval']:undefined;this['SquareProject']=_0x197a15['SquareProject']?_0x197a15['SquareProject']:undefined;this[_0x9482('0x26')]=_0x197a15[_0x9482('0x27')]?_0x197a15[_0x9482('0x27')][_0x9482('0x0')]:undefined;this[_0x9482('0x28')]=_0x197a15[_0x9482('0x28')]||![];this[_0x9482('0x29')]=_0x197a15[_0x9482('0x29')];this[_0x9482('0x2a')]=_0x197a15['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x197a15[_0x9482('0x2b')];this['dialAMDTotalAnalysisTime']=_0x197a15[_0x9482('0x2c')];this[_0x9482('0x2d')]=_0x197a15[_0x9482('0x2d')];this[_0x9482('0x2e')]=_0x197a15[_0x9482('0x2e')];this[_0x9482('0x2f')]=_0x197a15[_0x9482('0x2f')];this[_0x9482('0x30')]=_0x197a15['dialAMDSilenceThreshold'];this[_0x9482('0x31')]=_0x197a15[_0x9482('0x31')];}module[_0x9482('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 9fcfc71..38391b9 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 _0x6372=['transferType','mohtime','exports','starttime','destinationchannel','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answertime','lastapplication','billableseconds','holdtime','type','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum'];(function(_0x231a38,_0x452383){var _0x1c3278=function(_0x1d83f0){while(--_0x1d83f0){_0x231a38['push'](_0x231a38['shift']());}};_0x1c3278(++_0x452383);}(_0x6372,0x1b8));var _0x2637=function(_0x53cd01,_0x479259){_0x53cd01=_0x53cd01-0x0;var _0x437153=_0x6372[_0x53cd01];return _0x437153;};'use strict';function Channel(){this[_0x2637('0x0')]=null;this['channel']='';this[_0x2637('0x1')]='';this['calleridnum']=0x0;this[_0x2637('0x2')]='';this[_0x2637('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x2637('0x4')]=0x0;this[_0x2637('0x5')]='';this[_0x2637('0x6')]=0x0;this[_0x2637('0x7')]=0x0;this[_0x2637('0x8')]=0x0;this['answered']=![];this[_0x2637('0x9')]=null;this['endtime']=null;this['unmanaged']=![];this['abandoned']=![];this[_0x2637('0xa')]='';this['lastdata']='';this['duration']=0x0;this[_0x2637('0xb')]=0x0;this[_0x2637('0xc')]=0x0;this[_0x2637('0xd')]=null;this['tag']=null;this['disposition']=null;this[_0x2637('0xe')]=![];this[_0x2637('0xf')]=null;this[_0x2637('0x10')]=null;this[_0x2637('0x11')]=[];this[_0x2637('0x12')]=undefined;this[_0x2637('0x13')]=undefined;this[_0x2637('0x14')]=undefined;this[_0x2637('0x15')]=0x0;}module[_0x2637('0x16')]=Channel; \ No newline at end of file +var _0xdcde=['lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned'];(function(_0x1ccb5d,_0x341da9){var _0x1fe071=function(_0x12433e){while(--_0x12433e){_0x1ccb5d['push'](_0x1ccb5d['shift']());}};_0x1fe071(++_0x341da9);}(_0xdcde,0x1d0));var _0xedcd=function(_0x4390dc,_0x35fbae){_0x4390dc=_0x4390dc-0x0;var _0x115339=_0xdcde[_0x4390dc];return _0x115339;};'use strict';function Channel(){this[_0xedcd('0x0')]=null;this[_0xedcd('0x1')]='';this['destinationchannel']='';this[_0xedcd('0x2')]=0x0;this[_0xedcd('0x3')]='';this[_0xedcd('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this['context']='';this[_0xedcd('0x5')]=0x0;this[_0xedcd('0x6')]=0x0;this[_0xedcd('0x7')]=0x0;this['answered']=![];this[_0xedcd('0x8')]=null;this[_0xedcd('0x9')]=null;this[_0xedcd('0xa')]=![];this[_0xedcd('0xb')]=![];this['lastapplication']='';this[_0xedcd('0xc')]='';this[_0xedcd('0xd')]=0x0;this[_0xedcd('0xe')]=0x0;this[_0xedcd('0xf')]=0x0;this[_0xedcd('0x10')]=null;this[_0xedcd('0x11')]=null;this[_0xedcd('0x12')]=null;this[_0xedcd('0x13')]=![];this[_0xedcd('0x14')]=null;this[_0xedcd('0x15')]=null;this[_0xedcd('0x16')]=[];this[_0xedcd('0x17')]=undefined;this[_0xedcd('0x18')]=undefined;this[_0xedcd('0x19')]=undefined;this[_0xedcd('0x1a')]=0x0;}module[_0xedcd('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index c5b34ea..cb12efd 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 _0xee5d=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','name','username','remoteUri','authType'];(function(_0x58762b,_0x13b129){var _0x576129=function(_0x3e3aa6){while(--_0x3e3aa6){_0x58762b['push'](_0x58762b['shift']());}};_0x576129(++_0x13b129);}(_0xee5d,0x1d5));var _0xdee5=function(_0x4a5216,_0x31944f){_0x4a5216=_0x4a5216-0x0;var _0x1d93df=_0xee5d[_0x4a5216];return _0x1d93df;};'use strict';function DeskAccount(_0x477f4d){this['id']=_0x477f4d['id']||0x0;this[_0xdee5('0x0')]=_0x477f4d[_0xdee5('0x0')]||'';this[_0xdee5('0x1')]=_0x477f4d['username']||'';this[_0xdee5('0x2')]=_0x477f4d[_0xdee5('0x2')]||'';this[_0xdee5('0x3')]=_0x477f4d['authType']||'';this[_0xdee5('0x4')]=_0x477f4d[_0xdee5('0x4')]||'';this[_0xdee5('0x5')]=_0x477f4d['consumerKey']||'';this[_0xdee5('0x6')]=_0x477f4d['consumerSecret']||'';this[_0xdee5('0x7')]=_0x477f4d[_0xdee5('0x7')]||'';this[_0xdee5('0x8')]=_0x477f4d[_0xdee5('0x8')]||'';this[_0xdee5('0x9')]=_0x477f4d['type']||'';this[_0xdee5('0xa')]=_0x477f4d[_0xdee5('0xa')]||'';this['Configurations']=_0x477f4d['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xc5ad=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','Configurations'];(function(_0x35bc8,_0x7f7bef){var _0x2a5cf0=function(_0x353542){while(--_0x353542){_0x35bc8['push'](_0x35bc8['shift']());}};_0x2a5cf0(++_0x7f7bef);}(_0xc5ad,0x113));var _0xdc5a=function(_0x5c107d,_0x377703){_0x5c107d=_0x5c107d-0x0;var _0x40234d=_0xc5ad[_0x5c107d];return _0x40234d;};'use strict';function DeskAccount(_0x35878e){this['id']=_0x35878e['id']||0x0;this[_0xdc5a('0x0')]=_0x35878e[_0xdc5a('0x0')]||'';this['username']=_0x35878e[_0xdc5a('0x1')]||'';this[_0xdc5a('0x2')]=_0x35878e[_0xdc5a('0x2')]||'';this[_0xdc5a('0x3')]=_0x35878e['authType']||'';this[_0xdc5a('0x4')]=_0x35878e[_0xdc5a('0x4')]||'';this[_0xdc5a('0x5')]=_0x35878e[_0xdc5a('0x5')]||'';this['consumerSecret']=_0x35878e[_0xdc5a('0x6')]||'';this[_0xdc5a('0x7')]=_0x35878e['token']||'';this[_0xdc5a('0x8')]=_0x35878e['tokenSecret']||'';this[_0xdc5a('0x9')]=_0x35878e[_0xdc5a('0x9')]||'';this['serverUrl']=_0x35878e['serverUrl']||'';this[_0xdc5a('0xa')]=_0x35878e[_0xdc5a('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 8b08efa..b31b134 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 _0xc558=['clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','clientId'];(function(_0x2f196f,_0x5c1409){var _0x4fa3b4=function(_0x585da1){while(--_0x585da1){_0x2f196f['push'](_0x2f196f['shift']());}};_0x4fa3b4(++_0x5c1409);}(_0xc558,0x119));var _0x8c55=function(_0x3b4ce6,_0x1d7150){_0x3b4ce6=_0x3b4ce6-0x0;var _0x48c9e2=_0xc558[_0x3b4ce6];return _0x48c9e2;};'use strict';function Dynamics365Account(_0x434481){this['id']=_0x434481['id']||0x0;this[_0x8c55('0x0')]=_0x434481[_0x8c55('0x0')]||'';this[_0x8c55('0x1')]=_0x434481['username']||'';this[_0x8c55('0x2')]=_0x434481[_0x8c55('0x2')]||'';this[_0x8c55('0x3')]=_0x434481[_0x8c55('0x3')]||'';this['tenantId']=_0x434481['tenantId']||'';this['clientId']=_0x434481[_0x8c55('0x4')]||'';this[_0x8c55('0x5')]=_0x434481[_0x8c55('0x5')]||{};this[_0x8c55('0x6')]=_0x434481[_0x8c55('0x6')]||'';this[_0x8c55('0x7')]=_0x434481[_0x8c55('0x7')]||![];this[_0x8c55('0x8')]=_0x434481[_0x8c55('0x8')]||{};this[_0x8c55('0x9')]=_0x434481[_0x8c55('0x9')]||{};}module[_0x8c55('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x4da8=['Configurations','CloudProvider','name','username','password','remoteUri','tenantId','clientSecret','serverUrl'];(function(_0x160248,_0x2a57e6){var _0x4e589d=function(_0x1ba722){while(--_0x1ba722){_0x160248['push'](_0x160248['shift']());}};_0x4e589d(++_0x2a57e6);}(_0x4da8,0x134));var _0x84da=function(_0x411831,_0xbc5311){_0x411831=_0x411831-0x0;var _0x48850a=_0x4da8[_0x411831];return _0x48850a;};'use strict';function Dynamics365Account(_0x3200c1){this['id']=_0x3200c1['id']||0x0;this[_0x84da('0x0')]=_0x3200c1[_0x84da('0x0')]||'';this[_0x84da('0x1')]=_0x3200c1['username']||'';this[_0x84da('0x2')]=_0x3200c1[_0x84da('0x2')]||'';this[_0x84da('0x3')]=_0x3200c1[_0x84da('0x3')]||'';this['tenantId']=_0x3200c1[_0x84da('0x4')]||'';this['clientId']=_0x3200c1['clientId']||'';this[_0x84da('0x5')]=_0x3200c1[_0x84da('0x5')]||{};this[_0x84da('0x6')]=_0x3200c1[_0x84da('0x6')]||'';this['modernAuthentication']=_0x3200c1['modernAuthentication']||![];this['Configurations']=_0x3200c1[_0x84da('0x7')]||{};this[_0x84da('0x8')]=_0x3200c1[_0x84da('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 41f5afb..f729c16 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 _0x2052=['t38timeout','tech','SIP','Trunk','ListId','key','exports','description','ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x131e2f,_0x4148e1){var _0xf600a2=function(_0x46541c){while(--_0x46541c){_0x131e2f['push'](_0x131e2f['shift']());}};_0xf600a2(++_0x4148e1);}(_0x2052,0x157));var _0x2205=function(_0x770ea7,_0x1fcefd){_0x770ea7=_0x770ea7-0x0;var _0x211ec6=_0x2052[_0x770ea7];return _0x211ec6;};'use strict';function FaxAccount(_0x57cd8a){this['id']=_0x57cd8a['id']||0x0;this['name']=_0x57cd8a['name']||'';this[_0x2205('0x0')]=_0x57cd8a[_0x2205('0x0')];this[_0x2205('0x1')]=_0x57cd8a[_0x2205('0x1')];this['headerinfo']=_0x57cd8a['headerinfo'];this[_0x2205('0x2')]=_0x57cd8a[_0x2205('0x2')];this[_0x2205('0x3')]=_0x57cd8a[_0x2205('0x3')]||0x960;this[_0x2205('0x4')]=_0x57cd8a[_0x2205('0x4')]||0x3840;this[_0x2205('0x5')]=_0x57cd8a['modem']||_0x2205('0x6');this[_0x2205('0x7')]=_0x57cd8a['gateway']||'no';this[_0x2205('0x8')]=_0x57cd8a[_0x2205('0x8')]||'no';this[_0x2205('0x9')]=_0x57cd8a[_0x2205('0x9')]||0x1388;this[_0x2205('0xa')]=_0x57cd8a[_0x2205('0xa')]||_0x2205('0xb');this[_0x2205('0xc')]=_0x57cd8a[_0x2205('0xc')]?_0x57cd8a['Trunk']:undefined;this[_0x2205('0xd')]=_0x57cd8a[_0x2205('0xd')];this[_0x2205('0xe')]=_0x57cd8a['key'];}module[_0x2205('0xf')]=FaxAccount; \ No newline at end of file +var _0x6bb9=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','description'];(function(_0x5c0822,_0x50f3cf){var _0x38cfa3=function(_0x12965c){while(--_0x12965c){_0x5c0822['push'](_0x5c0822['shift']());}};_0x38cfa3(++_0x50f3cf);}(_0x6bb9,0x9f));var _0x96bb=function(_0x4ccbf8,_0x2688ee){_0x4ccbf8=_0x4ccbf8-0x0;var _0x40132f=_0x6bb9[_0x4ccbf8];return _0x40132f;};'use strict';function FaxAccount(_0x2f08a0){this['id']=_0x2f08a0['id']||0x0;this['name']=_0x2f08a0['name']||'';this['description']=_0x2f08a0[_0x96bb('0x0')];this[_0x96bb('0x1')]=_0x2f08a0[_0x96bb('0x1')];this[_0x96bb('0x2')]=_0x2f08a0[_0x96bb('0x2')];this['localstationid']=_0x2f08a0[_0x96bb('0x3')];this[_0x96bb('0x4')]=_0x2f08a0[_0x96bb('0x4')]||0x960;this[_0x96bb('0x5')]=_0x2f08a0[_0x96bb('0x5')]||0x3840;this[_0x96bb('0x6')]=_0x2f08a0['modem']||_0x96bb('0x7');this[_0x96bb('0x8')]=_0x2f08a0[_0x96bb('0x8')]||'no';this[_0x96bb('0x9')]=_0x2f08a0['faxdetect']||'no';this[_0x96bb('0xa')]=_0x2f08a0['t38timeout']||0x1388;this[_0x96bb('0xb')]=_0x2f08a0[_0x96bb('0xb')]||'SIP';this[_0x96bb('0xc')]=_0x2f08a0['Trunk']?_0x2f08a0[_0x96bb('0xc')]:undefined;this['ListId']=_0x2f08a0[_0x96bb('0xd')];this[_0x96bb('0xe')]=_0x2f08a0[_0x96bb('0xe')];}module[_0x96bb('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b3e32f9..501a881 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 _0xb037=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x588c69,_0x55bc31){var _0x133afe=function(_0x2107f8){while(--_0x2107f8){_0x588c69['push'](_0x588c69['shift']());}};_0x133afe(++_0x55bc31);}(_0xb037,0xd4));var _0x7b03=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb037[_0x565c49];return _0x20ca34;};'use strict';function FreshdeskAccount(_0x3f5b29){this['id']=_0x3f5b29['id']||0x0;this[_0x7b03('0x0')]=_0x3f5b29[_0x7b03('0x0')]||'';this[_0x7b03('0x1')]=_0x3f5b29['username']||'';this[_0x7b03('0x2')]=_0x3f5b29[_0x7b03('0x3')]||'';this[_0x7b03('0x4')]=_0x3f5b29[_0x7b03('0x4')]||'';this[_0x7b03('0x5')]=_0x3f5b29[_0x7b03('0x5')]||'';this['Configurations']=_0x3f5b29[_0x7b03('0x6')]||{};}module[_0x7b03('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x9526=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x9526,0x1c7));var _0x6952=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x9526[_0x1780f8];return _0x33a410;};'use strict';function FreshdeskAccount(_0x4ea247){this['id']=_0x4ea247['id']||0x0;this['name']=_0x4ea247[_0x6952('0x0')]||'';this[_0x6952('0x1')]=_0x4ea247[_0x6952('0x1')]||'';this[_0x6952('0x2')]=_0x4ea247[_0x6952('0x3')]||'';this[_0x6952('0x4')]=_0x4ea247[_0x6952('0x4')]||'';this[_0x6952('0x5')]=_0x4ea247['serverUrl']||'';this[_0x6952('0x6')]=_0x4ea247[_0x6952('0x6')]||{};}module[_0x6952('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 d4bf44e..190df11 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 _0xd2bb=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x3fe2d1,_0x41062b){var _0x354ab3=function(_0x44bd2e){while(--_0x44bd2e){_0x3fe2d1['push'](_0x3fe2d1['shift']());}};_0x354ab3(++_0x41062b);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x377205,_0x54e250){_0x377205=_0x377205-0x0;var _0x11cc7c=_0xd2bb[_0x377205];return _0x11cc7c;};'use strict';function FreshsalesAccount(_0x50eb60){this['id']=_0x50eb60['id']||0x0;this[_0xbd2b('0x0')]=_0x50eb60['name']||'';this[_0xbd2b('0x1')]=_0x50eb60[_0xbd2b('0x1')]||'';this[_0xbd2b('0x2')]=_0x50eb60[_0xbd2b('0x3')]||'';this[_0xbd2b('0x4')]=_0x50eb60[_0xbd2b('0x4')]||'';this['serverUrl']=_0x50eb60[_0xbd2b('0x5')]||'';this[_0xbd2b('0x6')]=_0x50eb60[_0xbd2b('0x6')]||{};}module[_0xbd2b('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x3cd8=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x1307e4,_0xc6ad64){var _0x39ff19=function(_0x4e6dc6){while(--_0x4e6dc6){_0x1307e4['push'](_0x1307e4['shift']());}};_0x39ff19(++_0xc6ad64);}(_0x3cd8,0x150));var _0x83cd=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0x3cd8[_0x36da00];return _0x4b72c5;};'use strict';function FreshsalesAccount(_0x1098bd){this['id']=_0x1098bd['id']||0x0;this[_0x83cd('0x0')]=_0x1098bd[_0x83cd('0x0')]||'';this[_0x83cd('0x1')]=_0x1098bd[_0x83cd('0x1')]||'';this[_0x83cd('0x2')]=_0x1098bd[_0x83cd('0x3')]||'';this[_0x83cd('0x4')]=_0x1098bd['remoteUri']||'';this[_0x83cd('0x5')]=_0x1098bd[_0x83cd('0x5')]||'';this[_0x83cd('0x6')]=_0x1098bd[_0x83cd('0x6')]||{};}module[_0x83cd('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index e699328..0fa1b02 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 _0x87e4=['exports','type','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice'];(function(_0x472b2f,_0x1e134d){var _0x101c88=function(_0x513296){while(--_0x513296){_0x472b2f['push'](_0x472b2f['shift']());}};_0x101c88(++_0x1e134d);}(_0x87e4,0x114));var _0x487e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x87e4[_0x6131cd];return _0x47e916;};'use strict';function QueueReport(){this[_0x487e('0x0')]='inbound';this['uniqueid']='';this[_0x487e('0x1')]='';this[_0x487e('0x2')]='';this[_0x487e('0x3')]='';this[_0x487e('0x4')]=null;this[_0x487e('0x5')]=null;this[_0x487e('0x6')]=0x1;this[_0x487e('0x7')]=0x1;this[_0x487e('0x8')]=![];this[_0x487e('0x9')]=null;this[_0x487e('0xa')]=![];this['queuecallercompleteAt']=null;this[_0x487e('0xb')]=![];this['queuecallerexitAt']=null;this[_0x487e('0xc')]=0x1;this[_0x487e('0xd')]='';this[_0x487e('0xe')]='';this[_0x487e('0xf')]='';this[_0x487e('0x10')]='';this[_0x487e('0x11')]='';this[_0x487e('0x12')]='';this['priority']='';this[_0x487e('0x13')]=0x0;this[_0x487e('0x14')]=![];this[_0x487e('0x15')]='';this[_0x487e('0x16')]=_0x487e('0x17');this['mohtime']=0x0;this['variables']={};}module[_0x487e('0x18')]=QueueReport; \ No newline at end of file +var _0x0a32=['queuecallerleaveAt','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt'];(function(_0x29c7fd,_0x77baeb){var _0x56caec=function(_0x163413){while(--_0x163413){_0x29c7fd['push'](_0x29c7fd['shift']());}};_0x56caec(++_0x77baeb);}(_0x0a32,0xe4));var _0x20a3=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0a32[_0x27af45];return _0x18df21;};'use strict';function QueueReport(){this[_0x20a3('0x0')]=_0x20a3('0x1');this['uniqueid']='';this[_0x20a3('0x2')]='';this[_0x20a3('0x3')]='';this[_0x20a3('0x4')]='';this[_0x20a3('0x5')]=null;this[_0x20a3('0x6')]=null;this['position']=0x1;this[_0x20a3('0x7')]=0x1;this['queuecallerabandon']=![];this[_0x20a3('0x8')]=null;this[_0x20a3('0x9')]=![];this[_0x20a3('0xa')]=null;this[_0x20a3('0xb')]=![];this[_0x20a3('0xc')]=null;this[_0x20a3('0xd')]=0x1;this[_0x20a3('0xe')]='';this[_0x20a3('0xf')]='';this['connectedlinename']='';this[_0x20a3('0x10')]='';this['context']='';this[_0x20a3('0x11')]='';this[_0x20a3('0x12')]='';this[_0x20a3('0x13')]=0x0;this[_0x20a3('0x14')]=![];this[_0x20a3('0x15')]='';this['motionChannel']=_0x20a3('0x16');this[_0x20a3('0x17')]=0x0;this[_0x20a3('0x18')]={};}module[_0x20a3('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 0e1a339..c48ffc2 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 _0xeeeb=['name','username','remoteUri','password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x29b86c,_0x380183){var _0x36ea85=function(_0x5870e5){while(--_0x5870e5){_0x29b86c['push'](_0x29b86c['shift']());}};_0x36ea85(++_0x380183);}(_0xeeeb,0x1d9));var _0xbeee=function(_0xbf55b,_0x3d0bee){_0xbf55b=_0xbf55b-0x0;var _0x41d3ec=_0xeeeb[_0xbf55b];return _0x41d3ec;};'use strict';function SalesforceAccount(_0x57e26d){this['id']=_0x57e26d['id']||0x0;this[_0xbeee('0x0')]=_0x57e26d[_0xbeee('0x0')]||'';this[_0xbeee('0x1')]=_0x57e26d[_0xbeee('0x1')]||'';this[_0xbeee('0x2')]=_0x57e26d[_0xbeee('0x2')]||'';this[_0xbeee('0x3')]=_0x57e26d[_0xbeee('0x3')]||'';this[_0xbeee('0x4')]=_0x57e26d[_0xbeee('0x4')]||'';this[_0xbeee('0x5')]=_0x57e26d[_0xbeee('0x5')]||'';this['securityToken']=_0x57e26d['securityToken']||'';this[_0xbeee('0x6')]=_0x57e26d[_0xbeee('0x6')]||_0xbeee('0x7');this[_0xbeee('0x8')]=_0x57e26d[_0xbeee('0x8')]||'';this['Configurations']=_0x57e26d[_0xbeee('0x9')]||{};}module[_0xbeee('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x43b1=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x2b742c,_0x51dbf1){var _0x52aa3f=function(_0xae1387){while(--_0xae1387){_0x2b742c['push'](_0x2b742c['shift']());}};_0x52aa3f(++_0x51dbf1);}(_0x43b1,0x94));var _0x143b=function(_0x2d306e,_0x501a09){_0x2d306e=_0x2d306e-0x0;var _0x358625=_0x43b1[_0x2d306e];return _0x358625;};'use strict';function SalesforceAccount(_0x296366){this['id']=_0x296366['id']||0x0;this[_0x143b('0x0')]=_0x296366[_0x143b('0x0')]||'';this['username']=_0x296366[_0x143b('0x1')]||'';this[_0x143b('0x2')]=_0x296366['remoteUri']||'';this[_0x143b('0x3')]=_0x296366[_0x143b('0x3')]||'';this[_0x143b('0x4')]=_0x296366[_0x143b('0x4')]||'';this['clientSecret']=_0x296366[_0x143b('0x5')]||'';this[_0x143b('0x6')]=_0x296366[_0x143b('0x6')]||'';this[_0x143b('0x7')]=_0x296366['type']||_0x143b('0x8');this[_0x143b('0x9')]=_0x296366[_0x143b('0x9')]||'';this['Configurations']=_0x296366[_0x143b('0xa')]||{};}module[_0x143b('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 8b02865..8ae0268 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 _0xf283=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x52a434,_0x42f87c){var _0x124feb=function(_0x2d13b8){while(--_0x2d13b8){_0x52a434['push'](_0x52a434['shift']());}};_0x124feb(++_0x42f87c);}(_0xf283,0x1f1));var _0x3f28=function(_0xda8937,_0x5847da){_0xda8937=_0xda8937-0x0;var _0x60a826=_0xf283[_0xda8937];return _0x60a826;};'use strict';function ServicenowAccount(_0x5b6ed9){this['id']=_0x5b6ed9['id']||0x0;this['name']=_0x5b6ed9[_0x3f28('0x0')]||'';this[_0x3f28('0x1')]=_0x5b6ed9[_0x3f28('0x1')]||'';this[_0x3f28('0x2')]=_0x5b6ed9[_0x3f28('0x2')]||'';this['remoteUri']=_0x5b6ed9[_0x3f28('0x3')]||'';this[_0x3f28('0x4')]=_0x5b6ed9[_0x3f28('0x4')]||'';this[_0x3f28('0x5')]=_0x5b6ed9['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x1989=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x28c6fb,_0x2b9168){var _0x2984e0=function(_0x253f30){while(--_0x253f30){_0x28c6fb['push'](_0x28c6fb['shift']());}};_0x2984e0(++_0x2b9168);}(_0x1989,0x11c));var _0x9198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1989[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x362230){this['id']=_0x362230['id']||0x0;this[_0x9198('0x0')]=_0x362230['name']||'';this[_0x9198('0x1')]=_0x362230['username']||'';this['password']=_0x362230[_0x9198('0x2')]||'';this[_0x9198('0x3')]=_0x362230[_0x9198('0x3')]||'';this[_0x9198('0x4')]=_0x362230[_0x9198('0x4')]||'';this[_0x9198('0x5')]=_0x362230[_0x9198('0x5')]||{};}module[_0x9198('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 8849a99..f5e3152 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 _0x7d36=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x290478,_0x3f4f70){var _0xdcfbff=function(_0x716071){while(--_0x716071){_0x290478['push'](_0x290478['shift']());}};_0xdcfbff(++_0x3f4f70);}(_0x7d36,0xa5));var _0x67d3=function(_0x2c3188,_0x5a3ed1){_0x2c3188=_0x2c3188-0x0;var _0x5f09ba=_0x7d36[_0x2c3188];return _0x5f09ba;};'use strict';function SugarcrmAccount(_0x48d770){this['id']=_0x48d770['id']||0x0;this[_0x67d3('0x0')]=_0x48d770[_0x67d3('0x0')]||'';this[_0x67d3('0x1')]=_0x48d770[_0x67d3('0x1')]||'';this[_0x67d3('0x2')]=_0x48d770[_0x67d3('0x2')]||'';this[_0x67d3('0x3')]=_0x48d770[_0x67d3('0x3')]||'';this[_0x67d3('0x4')]=_0x48d770[_0x67d3('0x4')]||'';this[_0x67d3('0x5')]=_0x48d770[_0x67d3('0x5')]||{};}module[_0x67d3('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x178d=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x178d,0x1cd));var _0xd178=function(_0x4675f6,_0x20fe73){_0x4675f6=_0x4675f6-0x0;var _0x3b5323=_0x178d[_0x4675f6];return _0x3b5323;};'use strict';function SugarcrmAccount(_0xd6fe19){this['id']=_0xd6fe19['id']||0x0;this[_0xd178('0x0')]=_0xd6fe19['name']||'';this[_0xd178('0x1')]=_0xd6fe19[_0xd178('0x1')]||'';this[_0xd178('0x2')]=_0xd6fe19[_0xd178('0x2')]||'';this[_0xd178('0x3')]=_0xd6fe19['remoteUri']||'';this[_0xd178('0x4')]=_0xd6fe19[_0xd178('0x4')]||'';this[_0xd178('0x5')]=_0xd6fe19[_0xd178('0x5')]||{};}module[_0xd178('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 b78e6a1..b0e2679 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 _0x586b=['accountcode','state','unknown','stateTime','status','name'];(function(_0x1fa47a,_0xc516f7){var _0x5326ea=function(_0x59fec0){while(--_0x59fec0){_0x1fa47a['push'](_0x1fa47a['shift']());}};_0x5326ea(++_0xc516f7);}(_0x586b,0x1bb));var _0xb586=function(_0xb4327e,_0x1581f6){_0xb4327e=_0xb4327e-0x0;var _0xc59c6a=_0x586b[_0xb4327e];return _0xc59c6a;};'use strict';function Telephone(_0x362127){this['id']=_0x362127['id']||0x0;this['name']=_0x362127[_0xb586('0x0')]||'';this[_0xb586('0x1')]=_0x362127[_0xb586('0x1')]||'';this[_0xb586('0x2')]=_0xb586('0x3');this[_0xb586('0x4')]=0x0;this[_0xb586('0x5')]=_0xb586('0x3');this['address']='';}module['exports']=Telephone; \ No newline at end of file +var _0x0ac0=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0ac0,0x130));var _0x00ac=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0ac0[_0x432682];return _0x463d05;};'use strict';function Telephone(_0x3a5a82){this['id']=_0x3a5a82['id']||0x0;this[_0x00ac('0x0')]=_0x3a5a82[_0x00ac('0x0')]||'';this['accountcode']=_0x3a5a82[_0x00ac('0x1')]||'';this[_0x00ac('0x2')]=_0x00ac('0x3');this[_0x00ac('0x4')]=0x0;this[_0x00ac('0x5')]=_0x00ac('0x3');this[_0x00ac('0x6')]='';}module[_0x00ac('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index dc198b2..a4dd8ed 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(_0x189950,_0x5593d7){var _0x265c73=function(_0x4b7f34){while(--_0x4b7f34){_0x189950['push'](_0x189950['shift']());}};_0x265c73(++_0x5593d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x49a82d,_0x1ae150){var _0x36e01b=function(_0x5ccccf){while(--_0x5ccccf){_0x49a82d['push'](_0x49a82d['shift']());}};_0x36e01b(++_0x1ae150);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 6d9d0b2..23a1d29 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x31e198,_0x36f31c){var _0x143048=function(_0x28d282){while(--_0x28d282){_0x31e198['push'](_0x31e198['shift']());}};_0x143048(++_0x36f31c);}(_0xda2d,0x102));var _0xdda2=function(_0x4472ff,_0x6085e2){_0x4472ff=_0x4472ff-0x0;var _0x51ad64=_0xda2d[_0x4472ff];return _0x51ad64;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x21cb7f,_0x48cd16){var _0x5a079a=function(_0x569a4f){while(--_0x569a4f){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x5a079a(++_0x48cd16);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x5eb8[_0x1e6db3];return _0x1de886;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e3adb0d..dcbc597 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 _0xffc2=['indexOf','split','port','domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry'];(function(_0x4680cb,_0x9a6ba){var _0x2c862c=function(_0xc6b77b){while(--_0xc6b77b){_0x4680cb['push'](_0x4680cb['shift']());}};_0x2c862c(++_0x9a6ba);}(_0xffc2,0x16f));var _0x2ffc=function(_0x5d8076,_0x2b476a){_0x5d8076=_0x5d8076-0x0;var _0x26811a=_0xffc2[_0x5d8076];return _0x26811a;};'use strict';function Trunk(_0x301a6a){this['id']=_0x301a6a['id']||0x0;this[_0x2ffc('0x0')]=_0x301a6a[_0x2ffc('0x0')]||![];this['name']=_0x301a6a[_0x2ffc('0x1')]||'';this[_0x2ffc('0x2')]=_0x2ffc('0x3');this[_0x2ffc('0x4')]=0x0;this[_0x2ffc('0x5')]=_0x2ffc('0x3');this[_0x2ffc('0x6')]=_0x301a6a['registry']&&_0x301a6a[_0x2ffc('0x6')][_0x2ffc('0x7')](':')?_0x301a6a[_0x2ffc('0x6')][_0x2ffc('0x8')](':')[0x0]:'';this['host']='';this[_0x2ffc('0x9')]='';this[_0x2ffc('0xa')]='';this[_0x2ffc('0xb')]='';this[_0x2ffc('0xc')]='';this[_0x2ffc('0xd')]=_0x2ffc('0x3');this['registrationtime']='';this[_0x2ffc('0xe')]='';this[_0x2ffc('0xf')]=_0x301a6a[_0x2ffc('0xf')]||'';}module[_0x2ffc('0x10')]=Trunk; \ No newline at end of file +var _0x958e=['host','port','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','active','name','state','unknown','stateTime','status','registry','indexOf','split'];(function(_0x3b172e,_0x51c2e0){var _0x2e1b79=function(_0x5c8948){while(--_0x5c8948){_0x3b172e['push'](_0x3b172e['shift']());}};_0x2e1b79(++_0x51c2e0);}(_0x958e,0x1c2));var _0xe958=function(_0x1a6723,_0xa2ad31){_0x1a6723=_0x1a6723-0x0;var _0x17c133=_0x958e[_0x1a6723];return _0x17c133;};'use strict';function Trunk(_0x4e8d4f){this['id']=_0x4e8d4f['id']||0x0;this[_0xe958('0x0')]=_0x4e8d4f['active']||![];this[_0xe958('0x1')]=_0x4e8d4f[_0xe958('0x1')]||'';this[_0xe958('0x2')]=_0xe958('0x3');this[_0xe958('0x4')]=0x0;this[_0xe958('0x5')]='unknown';this[_0xe958('0x6')]=_0x4e8d4f['registry']&&_0x4e8d4f['registry'][_0xe958('0x7')](':')?_0x4e8d4f[_0xe958('0x6')][_0xe958('0x8')](':')[0x0]:'';this[_0xe958('0x9')]='';this[_0xe958('0xa')]='';this[_0xe958('0xb')]='';this[_0xe958('0xc')]='';this[_0xe958('0xd')]='';this[_0xe958('0xe')]=_0xe958('0x3');this[_0xe958('0xf')]='';this['address']='';this[_0xe958('0x10')]=_0x4e8d4f[_0xe958('0x10')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 4db2f3e..ebe6300 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 _0xb5d5=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x174466,_0x58001e){var _0x12c8b2=function(_0x47d367){while(--_0x47d367){_0x174466['push'](_0x174466['shift']());}};_0x12c8b2(++_0x58001e);}(_0xb5d5,0x147));var _0x5b5d=function(_0x2bc03c,_0x75bd84){_0x2bc03c=_0x2bc03c-0x0;var _0x402636=_0xb5d5[_0x2bc03c];return _0x402636;};'use strict';function voiceExtension(_0x580a9e){this['id']=_0x580a9e['id']||0x0;this['exten']=_0x580a9e[_0x5b5d('0x0')]||'';this[_0x5b5d('0x1')]=_0x580a9e[_0x5b5d('0x1')]||_0x5b5d('0x2');this[_0x5b5d('0x3')]=_0x580a9e['mandatoryDisposition']||![];}module[_0x5b5d('0x4')]=voiceExtension; \ No newline at end of file +var _0xc24d=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x5e33f6,_0x2e18e6){var _0x20cb0f=function(_0x358e5c){while(--_0x358e5c){_0x5e33f6['push'](_0x5e33f6['shift']());}};_0x20cb0f(++_0x2e18e6);}(_0xc24d,0xd1));var _0xdc24=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0xc24d[_0x45c981];return _0x4f62c8;};'use strict';function voiceExtension(_0x1f4fa3){this['id']=_0x1f4fa3['id']||0x0;this[_0xdc24('0x0')]=_0x1f4fa3[_0xdc24('0x0')]||'';this[_0xdc24('0x1')]=_0x1f4fa3[_0xdc24('0x1')]||_0xdc24('0x2');this[_0xdc24('0x3')]=_0x1f4fa3[_0xdc24('0x3')]||![];}module[_0xdc24('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 3be7297..dc48a69 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 _0x4a68=['inbound','talking','total','answered','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','roundrobin','name','monitor_format','type'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x4a68,0x6f));var _0x84a6=function(_0x573de3,_0x2a9f6e){_0x573de3=_0x573de3-0x0;var _0x371681=_0x4a68[_0x573de3];return _0x371681;};'use strict';var statusDesc=[_0x84a6('0x0'),_0x84a6('0x1'),_0x84a6('0x2'),_0x84a6('0x3'),_0x84a6('0x4'),'unavailable',_0x84a6('0x5'),_0x84a6('0x6'),_0x84a6('0x7')];var monitorFormat={'wav':_0x84a6('0x8'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0x84a6('0x9')};function VoiceQueue(_0x446f6c){this['id']=_0x446f6c['id']||0x0;this[_0x84a6('0xa')]=_0x446f6c['name']||'';this['monitor_format']=_0x446f6c[_0x84a6('0xb')]||'';this['type']=_0x446f6c[_0x84a6('0xc')]||_0x84a6('0xd');this['waiting']=0x0;this[_0x84a6('0xe')]=0x0;this[_0x84a6('0xf')]=0x0;this[_0x84a6('0x10')]=0x0;this['sumDuration']=0x0;this[_0x84a6('0x11')]=0x0;this[_0x84a6('0x12')]=0x0;this['unmanaged']=0x0;this[_0x84a6('0x13')]=0x0;this[_0x84a6('0x14')]=0x0;this[_0x84a6('0x15')]=0x0;this[_0x84a6('0x16')]=_0x446f6c['acw']||![];this[_0x84a6('0x17')]=_0x446f6c[_0x84a6('0x17')]||0xa;this['autopause']=_0x446f6c[_0x84a6('0x18')]||'no';this[_0x84a6('0x19')]=!![];this['message']='';this[_0x84a6('0x1a')]=0x0;this[_0x84a6('0x1b')]=0x0;this[_0x84a6('0x1c')]=_0x446f6c[_0x84a6('0x1c')]||null;this[_0x84a6('0x1d')]=_0x446f6c[_0x84a6('0x1d')]?_0x446f6c[_0x84a6('0x1d')]:null;this['dialActive']=_0x446f6c['dialActive'];this[_0x84a6('0x1e')]=_0x446f6c[_0x84a6('0x1e')]||'progressive';this[_0x84a6('0x1f')]=_0x446f6c[_0x84a6('0x1f')]||0x0;this[_0x84a6('0x20')]=_0x446f6c[_0x84a6('0x20')]||0x0;this[_0x84a6('0x21')]=_0x446f6c[_0x84a6('0x21')]||0x1;this[_0x84a6('0x22')]=_0x446f6c[_0x84a6('0x22')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x446f6c[_0x84a6('0x23')]||0.03;this[_0x84a6('0x24')]=_0x446f6c[_0x84a6('0x24')]||0x258;this[_0x84a6('0x25')]=_0x446f6c[_0x84a6('0x25')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x446f6c[_0x84a6('0x26')]||_0x84a6('0x27');this[_0x84a6('0x28')]=_0x446f6c[_0x84a6('0x28')]||0x1e;this[_0x84a6('0x29')]=_0x446f6c[_0x84a6('0x29')]||_0x84a6('0x2a');this[_0x84a6('0x2b')]=_0x446f6c[_0x84a6('0x2b')]||0x3;this[_0x84a6('0x2c')]=_0x446f6c['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x446f6c['dialCongestionMaxRetry']||0x3;this[_0x84a6('0x2d')]=_0x446f6c[_0x84a6('0x2d')]||0x96;this['dialBusyMaxRetry']=_0x446f6c[_0x84a6('0x2e')]||0x3;this['dialBusyRetryFrequency']=_0x446f6c[_0x84a6('0x2f')]||0x96;this[_0x84a6('0x30')]=_0x446f6c[_0x84a6('0x30')]||0x3;this['dialNoAnswerRetryFrequency']=_0x446f6c[_0x84a6('0x31')]||0x96;this[_0x84a6('0x32')]=_0x446f6c['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x446f6c['dialNoSuchNumberRetryFrequency']||0x96;this[_0x84a6('0x33')]=_0x446f6c[_0x84a6('0x33')]||0x3;this[_0x84a6('0x34')]=_0x446f6c[_0x84a6('0x34')]||0x96;this['dialAbandonedMaxRetry']=_0x446f6c[_0x84a6('0x35')]||0x3;this[_0x84a6('0x36')]=_0x446f6c[_0x84a6('0x36')]||0x96;this['dialMachineMaxRetry']=_0x446f6c[_0x84a6('0x37')]||0x3;this[_0x84a6('0x38')]=_0x446f6c[_0x84a6('0x38')]||0x96;this['dialAgentRejectMaxRetry']=_0x446f6c[_0x84a6('0x39')]||0x3;this[_0x84a6('0x3a')]=_0x446f6c[_0x84a6('0x3a')]||0x96;this['callAdditionalPhoneAfterMin']=_0x446f6c[_0x84a6('0x3b')]||0x3;this[_0x84a6('0x3c')]=_0x446f6c[_0x84a6('0x3c')]||0x4;this[_0x84a6('0x3d')]=_0x446f6c[_0x84a6('0x3d')]?_0x446f6c[_0x84a6('0x3d')]:undefined;this[_0x84a6('0x3e')]=_0x446f6c['TrunkBackup']?_0x446f6c['TrunkBackup']:undefined;this[_0x84a6('0x3f')]=_0x446f6c[_0x84a6('0x3f')]||undefined;this[_0x84a6('0x40')]=_0x446f6c[_0x84a6('0x40')]?_0x446f6c[_0x84a6('0x40')]:undefined;this[_0x84a6('0x41')]=_0x446f6c[_0x84a6('0x41')]||_0x84a6('0x42');this[_0x84a6('0x43')]=_0x446f6c[_0x84a6('0x43')]||undefined;this['dialCutDigit']=_0x446f6c[_0x84a6('0x44')]||undefined;this['strategy']=strategy[_0x446f6c[_0x84a6('0x45')]]||_0x84a6('0x46');this[_0x84a6('0x47')]=!![];this[_0x84a6('0x48')]=_0x446f6c['dialAMDActive']||![];this[_0x84a6('0x49')]=_0x446f6c[_0x84a6('0x49')];this['dialAMDGreeting']=_0x446f6c[_0x84a6('0x4a')];this[_0x84a6('0x4b')]=_0x446f6c[_0x84a6('0x4b')];this[_0x84a6('0x4c')]=_0x446f6c[_0x84a6('0x4c')];this[_0x84a6('0x4d')]=_0x446f6c[_0x84a6('0x4d')];this[_0x84a6('0x4e')]=_0x446f6c[_0x84a6('0x4e')];this[_0x84a6('0x4f')]=_0x446f6c[_0x84a6('0x4f')];this['dialAMDSilenceThreshold']=_0x446f6c[_0x84a6('0x50')];this[_0x84a6('0x51')]=_0x446f6c[_0x84a6('0x51')];this[_0x84a6('0x52')]=0x0;this[_0x84a6('0x53')]=0x0;this['timeout']=_0x446f6c['timeout'];this[_0x84a6('0x54')]=0x0;this[_0x84a6('0x55')]=0x0;this[_0x84a6('0x56')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x84a6('0x57')]=0x0;this[_0x84a6('0x58')]=0x0;this[_0x84a6('0x59')]=0x0;this[_0x84a6('0x5a')]=0x0;this[_0x84a6('0x5b')]=0x0;this[_0x84a6('0x5c')]=0x0;this[_0x84a6('0x5d')]=0x0;this[_0x84a6('0x5e')]=0x0;this[_0x84a6('0x5f')]=0x0;this[_0x84a6('0x60')]=undefined;this['startPredictive']=undefined;this[_0x84a6('0x61')]=undefined;this[_0x84a6('0x62')]=1.05;this[_0x84a6('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x84a6('0x64')]=0x0;this[_0x84a6('0x65')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x84a6('0x66')]=0x0;this[_0x84a6('0x67')]=0x0;this[_0x84a6('0x68')]=0x0;this[_0x84a6('0x69')]=_0x446f6c[_0x84a6('0x6a')]||0x14;this[_0x84a6('0x6b')]=_0x446f6c[_0x84a6('0x6a')]||0xa;this[_0x84a6('0x6c')]=0x0;this[_0x84a6('0x6d')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x84a6('0x6e')]=0x0;this[_0x84a6('0x6f')]=0x0;this[_0x84a6('0x70')]=0x0;this[_0x84a6('0x71')]=0x0;this[_0x84a6('0x72')]=_0x446f6c[_0x84a6('0x72')]||0x1e;this[_0x84a6('0x73')]=_0x446f6c[_0x84a6('0x73')]||![];this['dialPreviewAutoRecallMe']=!!_0x446f6c[_0x84a6('0x74')]||![];this[_0x84a6('0x75')]=!!_0x446f6c['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x446f6c[_0x84a6('0x76')]||undefined;this[_0x84a6('0x77')]=_0x446f6c[_0x84a6('0x77')]||![];this[_0x84a6('0x78')]=_0x446f6c['dialAgiAfterHangupAgent']||![];this[_0x84a6('0xb')]=monitorFormat[_0x446f6c[_0x84a6('0xb')]]?monitorFormat[_0x446f6c[_0x84a6('0xb')]]:undefined;this[_0x84a6('0x79')]=_0x446f6c[_0x84a6('0x79')]||![];this[_0x84a6('0x7a')]=_0x446f6c['mandatoryDispositionPause']?_0x446f6c[_0x84a6('0x7a')]:undefined;}module[_0x84a6('0x7b')]=VoiceQueue; \ No newline at end of file +var _0x59ec=['dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','sumBillable','unmanaged','abandoned','available','acw','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage'];(function(_0x3f1996,_0xcd1f82){var _0x1d323c=function(_0x92e1f4){while(--_0x92e1f4){_0x3f1996['push'](_0x3f1996['shift']());}};_0x1d323c(++_0xcd1f82);}(_0x59ec,0x13e));var _0xc59e=function(_0x25f71e,_0xee7648){_0x25f71e=_0x25f71e-0x0;var _0x4e470c=_0x59ec[_0x25f71e];return _0x4e470c;};'use strict';var statusDesc=[_0xc59e('0x0'),_0xc59e('0x1'),_0xc59e('0x2'),_0xc59e('0x3'),_0xc59e('0x4'),_0xc59e('0x5'),_0xc59e('0x6'),_0xc59e('0x7'),'onhold'];var monitorFormat={'wav':_0xc59e('0x8'),'wav49':_0xc59e('0x9'),'gsm':_0xc59e('0xa')};var strategy={'rrmemory':_0xc59e('0xb'),'roundrobin':_0xc59e('0xc')};function VoiceQueue(_0x4eb962){this['id']=_0x4eb962['id']||0x0;this['name']=_0x4eb962[_0xc59e('0xd')]||'';this[_0xc59e('0xe')]=_0x4eb962[_0xc59e('0xe')]||'';this[_0xc59e('0xf')]=_0x4eb962[_0xc59e('0xf')]||_0xc59e('0x10');this['waiting']=0x0;this[_0xc59e('0x11')]=0x0;this[_0xc59e('0x12')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xc59e('0x13')]=0x0;this[_0xc59e('0x14')]=0x0;this[_0xc59e('0x15')]=0x0;this['loggedIn']=0x0;this[_0xc59e('0x16')]=0x0;this[_0xc59e('0x17')]=_0x4eb962[_0xc59e('0x17')]||![];this['acwTimeout']=_0x4eb962['acwTimeout']||0xa;this['autopause']=_0x4eb962[_0xc59e('0x18')]||'no';this['sendMessageOneNotActive']=!![];this[_0xc59e('0x19')]='';this[_0xc59e('0x1a')]=0x0;this[_0xc59e('0x1b')]=0x0;this[_0xc59e('0x1c')]=_0x4eb962[_0xc59e('0x1c')]||null;this[_0xc59e('0x1d')]=_0x4eb962['dialGlobalInterval']?_0x4eb962[_0xc59e('0x1d')]:null;this[_0xc59e('0x1e')]=_0x4eb962[_0xc59e('0x1e')];this[_0xc59e('0x1f')]=_0x4eb962[_0xc59e('0x1f')]||_0xc59e('0x20');this['dialLimitChannel']=_0x4eb962[_0xc59e('0x21')]||0x0;this['dialLimitQueue']=_0x4eb962[_0xc59e('0x22')]||0x0;this[_0xc59e('0x23')]=_0x4eb962[_0xc59e('0x23')]||0x1;this[_0xc59e('0x24')]=_0x4eb962[_0xc59e('0x24')]||_0xc59e('0x25');this[_0xc59e('0x26')]=_0x4eb962[_0xc59e('0x26')]||0.03;this[_0xc59e('0x27')]=_0x4eb962[_0xc59e('0x27')]||0x258;this[_0xc59e('0x28')]=_0x4eb962[_0xc59e('0x28')]||'anonymous';this[_0xc59e('0x29')]=_0x4eb962[_0xc59e('0x29')]||_0xc59e('0x2a');this[_0xc59e('0x2b')]=_0x4eb962[_0xc59e('0x2b')]||0x1e;this['dialQueueOptions']=_0x4eb962[_0xc59e('0x2c')]||_0xc59e('0x2d');this['dialQueueTimeout']=_0x4eb962[_0xc59e('0x2e')]||0x3;this[_0xc59e('0x2f')]=_0x4eb962[_0xc59e('0x2f')]||undefined;this[_0xc59e('0x30')]=_0x4eb962[_0xc59e('0x30')]||0x3;this[_0xc59e('0x31')]=_0x4eb962[_0xc59e('0x31')]||0x96;this[_0xc59e('0x32')]=_0x4eb962[_0xc59e('0x32')]||0x3;this[_0xc59e('0x33')]=_0x4eb962[_0xc59e('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x4eb962[_0xc59e('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4eb962[_0xc59e('0x35')]||0x96;this[_0xc59e('0x36')]=_0x4eb962[_0xc59e('0x36')]||0x3;this[_0xc59e('0x37')]=_0x4eb962[_0xc59e('0x37')]||0x96;this['dialDropMaxRetry']=_0x4eb962['dialDropMaxRetry']||0x3;this[_0xc59e('0x38')]=_0x4eb962[_0xc59e('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x4eb962[_0xc59e('0x39')]||0x3;this[_0xc59e('0x3a')]=_0x4eb962[_0xc59e('0x3a')]||0x96;this[_0xc59e('0x3b')]=_0x4eb962['dialMachineMaxRetry']||0x3;this[_0xc59e('0x3c')]=_0x4eb962[_0xc59e('0x3c')]||0x96;this[_0xc59e('0x3d')]=_0x4eb962['dialAgentRejectMaxRetry']||0x3;this[_0xc59e('0x3e')]=_0x4eb962[_0xc59e('0x3e')]||0x96;this[_0xc59e('0x3f')]=_0x4eb962[_0xc59e('0x3f')]||0x3;this[_0xc59e('0x40')]=_0x4eb962[_0xc59e('0x40')]||0x4;this['Trunk']=_0x4eb962['Trunk']?_0x4eb962[_0xc59e('0x41')]:undefined;this[_0xc59e('0x42')]=_0x4eb962[_0xc59e('0x42')]?_0x4eb962[_0xc59e('0x42')]:undefined;this['dialPrefix']=_0x4eb962[_0xc59e('0x43')]||undefined;this['Interval']=_0x4eb962[_0xc59e('0x44')]?_0x4eb962[_0xc59e('0x44')]:undefined;this['dialOrderByScheduledAt']=_0x4eb962['dialOrderByScheduledAt']||_0xc59e('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x4eb962[_0xc59e('0x46')]||undefined;this[_0xc59e('0x47')]=_0x4eb962[_0xc59e('0x47')]||undefined;this[_0xc59e('0x48')]=strategy[_0x4eb962[_0xc59e('0x48')]]||'rrmemory';this[_0xc59e('0x49')]=!![];this[_0xc59e('0x4a')]=_0x4eb962[_0xc59e('0x4a')]||![];this['dialAMDInitialSilence']=_0x4eb962[_0xc59e('0x4b')];this[_0xc59e('0x4c')]=_0x4eb962[_0xc59e('0x4c')];this[_0xc59e('0x4d')]=_0x4eb962[_0xc59e('0x4d')];this[_0xc59e('0x4e')]=_0x4eb962[_0xc59e('0x4e')];this[_0xc59e('0x4f')]=_0x4eb962[_0xc59e('0x4f')];this[_0xc59e('0x50')]=_0x4eb962[_0xc59e('0x50')];this[_0xc59e('0x51')]=_0x4eb962[_0xc59e('0x51')];this['dialAMDSilenceThreshold']=_0x4eb962[_0xc59e('0x52')];this[_0xc59e('0x53')]=_0x4eb962[_0xc59e('0x53')];this[_0xc59e('0x54')]=0x0;this['pTalking']=0x0;this[_0xc59e('0x55')]=_0x4eb962[_0xc59e('0x55')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xc59e('0x56')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xc59e('0x57')]=0x0;this[_0xc59e('0x58')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xc59e('0x59')]=0x0;this[_0xc59e('0x5a')]=0x0;this[_0xc59e('0x5b')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xc59e('0x5c')]=0x0;this['outboundReCallsDay']=0x0;this[_0xc59e('0x5d')]=0x0;this[_0xc59e('0x5e')]=undefined;this[_0xc59e('0x5f')]=undefined;this['handlePredictive']=undefined;this[_0xc59e('0x60')]=1.05;this[_0xc59e('0x61')]=0x0;this[_0xc59e('0x62')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xc59e('0x63')]=0x0;this[_0xc59e('0x64')]=0x0;this[_0xc59e('0x65')]=0x0;this[_0xc59e('0x66')]=0x0;this[_0xc59e('0x67')]=0x0;this['predictiveIntervalMaxThreshold']=_0x4eb962[_0xc59e('0x68')]||0x14;this[_0xc59e('0x69')]=_0x4eb962['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xc59e('0x6a')]=0x0;this[_0xc59e('0x6b')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xc59e('0x6c')]=0x0;this[_0xc59e('0x6d')]=0x0;this[_0xc59e('0x6e')]=0x0;this[_0xc59e('0x6f')]=_0x4eb962[_0xc59e('0x6f')]||0x1e;this[_0xc59e('0x70')]=_0x4eb962[_0xc59e('0x70')]||![];this[_0xc59e('0x71')]=!!_0x4eb962[_0xc59e('0x71')]||![];this[_0xc59e('0x72')]=!!_0x4eb962[_0xc59e('0x72')]||![];this['dialQueueProject2']=_0x4eb962[_0xc59e('0x73')]||undefined;this[_0xc59e('0x74')]=_0x4eb962[_0xc59e('0x74')]||![];this['dialAgiAfterHangupAgent']=_0x4eb962[_0xc59e('0x75')]||![];this['monitor_format']=monitorFormat[_0x4eb962['monitor_format']]?monitorFormat[_0x4eb962[_0xc59e('0xe')]]:undefined;this['mandatoryDisposition']=_0x4eb962['mandatoryDisposition']||![];this[_0xc59e('0x76')]=_0x4eb962['mandatoryDispositionPause']?_0x4eb962[_0xc59e('0x76')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 5f56376..bb533e6 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 _0x1ed4=['serverUrl','Configurations','name','username','accessKey','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ed4,0x1d6));var _0x41ed=function(_0x488a24,_0x5c9481){_0x488a24=_0x488a24-0x0;var _0x599ff0=_0x1ed4[_0x488a24];return _0x599ff0;};'use strict';function VtigerAccount(_0x1adc6c){this['id']=_0x1adc6c['id']||0x0;this[_0x41ed('0x0')]=_0x1adc6c['name']||'';this['username']=_0x1adc6c[_0x41ed('0x1')]||'';this[_0x41ed('0x2')]=_0x1adc6c['accessKey']||'';this[_0x41ed('0x3')]=_0x1adc6c[_0x41ed('0x3')]||'';this[_0x41ed('0x4')]=_0x1adc6c[_0x41ed('0x4')]||'';this[_0x41ed('0x5')]=_0x1adc6c[_0x41ed('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x4165=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x285bb5,_0xc147b5){var _0x1e4a45=function(_0xd2ca3b){while(--_0xd2ca3b){_0x285bb5['push'](_0x285bb5['shift']());}};_0x1e4a45(++_0xc147b5);}(_0x4165,0x13b));var _0x5416=function(_0x5cf63a,_0xec4668){_0x5cf63a=_0x5cf63a-0x0;var _0x10bb2e=_0x4165[_0x5cf63a];return _0x10bb2e;};'use strict';function VtigerAccount(_0x37c8bd){this['id']=_0x37c8bd['id']||0x0;this[_0x5416('0x0')]=_0x37c8bd[_0x5416('0x0')]||'';this[_0x5416('0x1')]=_0x37c8bd[_0x5416('0x1')]||'';this['accessKey']=_0x37c8bd[_0x5416('0x2')]||'';this[_0x5416('0x3')]=_0x37c8bd[_0x5416('0x3')]||'';this['serverUrl']=_0x37c8bd[_0x5416('0x4')]||'';this['Configurations']=_0x37c8bd[_0x5416('0x5')]||{};}module[_0x5416('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index e6eceb7..f9b4e6d 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 _0xd32d=['password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0xd32d,0xda));var _0xdd32=function(_0x1acafa,_0x2bed1c){_0x1acafa=_0x1acafa-0x0;var _0x3119d9=_0xd32d[_0x1acafa];return _0x3119d9;};'use strict';function ZendeskAccount(_0x49f333){this['id']=_0x49f333['id']||0x0;this[_0xdd32('0x0')]=_0x49f333[_0xdd32('0x0')]||'';this[_0xdd32('0x1')]=_0x49f333[_0xdd32('0x1')]||'';this['password']=_0x49f333[_0xdd32('0x2')]||'';this[_0xdd32('0x3')]=_0x49f333[_0xdd32('0x3')]||'';this[_0xdd32('0x4')]=_0x49f333['remoteUri']||'';this[_0xdd32('0x5')]=_0x49f333['authType']||'';this[_0xdd32('0x6')]=_0x49f333[_0xdd32('0x6')]||_0xdd32('0x7');this[_0xdd32('0x8')]=_0x49f333['serverUrl']||'';this['Configurations']=_0x49f333[_0xdd32('0x9')]||{};}module[_0xdd32('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xb619=['password','token','remoteUri','authType','type','serverUrl','Configurations','exports','name'];(function(_0x3f835a,_0x19f11b){var _0x154696=function(_0x460c12){while(--_0x460c12){_0x3f835a['push'](_0x3f835a['shift']());}};_0x154696(++_0x19f11b);}(_0xb619,0xbc));var _0x9b61=function(_0x234c03,_0x46ea53){_0x234c03=_0x234c03-0x0;var _0x2990fc=_0xb619[_0x234c03];return _0x2990fc;};'use strict';function ZendeskAccount(_0x2fc0b6){this['id']=_0x2fc0b6['id']||0x0;this[_0x9b61('0x0')]=_0x2fc0b6[_0x9b61('0x0')]||'';this['username']=_0x2fc0b6['username']||'';this[_0x9b61('0x1')]=_0x2fc0b6['password']||'';this[_0x9b61('0x2')]=_0x2fc0b6['token']||'';this[_0x9b61('0x3')]=_0x2fc0b6[_0x9b61('0x3')]||'';this['authType']=_0x2fc0b6[_0x9b61('0x4')]||'';this[_0x9b61('0x5')]=_0x2fc0b6[_0x9b61('0x5')]||'integrationTab';this[_0x9b61('0x6')]=_0x2fc0b6[_0x9b61('0x6')]||'';this[_0x9b61('0x7')]=_0x2fc0b6['Configurations']||{};}module[_0x9b61('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 3f41574..b314945 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 _0x2941=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x295287,_0x2fa9e5){var _0x40860e=function(_0x57f211){while(--_0x57f211){_0x295287['push'](_0x295287['shift']());}};_0x40860e(++_0x2fa9e5);}(_0x2941,0x140));var _0x1294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2941[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x536124){this['id']=_0x536124['id']||0x0;this['name']=_0x536124[_0x1294('0x0')]||'';this[_0x1294('0x1')]=_0x536124[_0x1294('0x1')]||'';this[_0x1294('0x2')]=_0x536124[_0x1294('0x2')]||'';this[_0x1294('0x3')]=_0x536124[_0x1294('0x3')]||'';this[_0x1294('0x4')]=_0x536124[_0x1294('0x4')]||'';this[_0x1294('0x5')]=_0x536124['clientSecret']||'';this[_0x1294('0x6')]=_0x536124[_0x1294('0x6')]||'';this[_0x1294('0x7')]=_0x536124[_0x1294('0x7')]||'';this[_0x1294('0x8')]=_0x536124[_0x1294('0x8')]||'';this[_0x1294('0x9')]=_0x536124[_0x1294('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x71cf=['refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x16e6fb,_0xdbfa75){var _0x140828=function(_0x121918){while(--_0x121918){_0x16e6fb['push'](_0x16e6fb['shift']());}};_0x140828(++_0xdbfa75);}(_0x71cf,0x146));var _0xf71c=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x71cf[_0x58547b];return _0x1d3fd2;};'use strict';function ZohoAccount(_0x5f4e6f){this['id']=_0x5f4e6f['id']||0x0;this[_0xf71c('0x0')]=_0x5f4e6f['name']||'';this[_0xf71c('0x1')]=_0x5f4e6f[_0xf71c('0x1')]||'';this[_0xf71c('0x2')]=_0x5f4e6f[_0xf71c('0x2')]||'';this[_0xf71c('0x3')]=_0x5f4e6f['zone']||'';this['clientId']=_0x5f4e6f[_0xf71c('0x4')]||'';this[_0xf71c('0x5')]=_0x5f4e6f['clientSecret']||'';this[_0xf71c('0x6')]=_0x5f4e6f[_0xf71c('0x6')]||'';this['code']=_0x5f4e6f['code']||'';this['refreshToken']=_0x5f4e6f[_0xf71c('0x7')]||'';this[_0xf71c('0x8')]=_0x5f4e6f[_0xf71c('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index d0ae9fb..b342293 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 _0xfff0=['recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','uniqueid','queue','type','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0xfff0,0x139));var _0x0fff=function(_0x3de1cb,_0x92d2ba){_0x3de1cb=_0x3de1cb-0x0;var _0x4d14a9=_0xfff0[_0x3de1cb];return _0x4d14a9;};'use strict';var util=require('util');var _=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));function checkNameSurname(_0x148db8,_0x527213,_0x37165b){var _0x1f4065='';if(!_[_0x0fff('0x2')](_0x527213)&&'string'===typeof _0x527213){_0x1f4065+=_0x527213;}if(!_[_0x0fff('0x2')](_0x37165b)&&_0x0fff('0x3')===typeof _0x37165b){_0x1f4065+='\x20'+_0x37165b;}if(_0x1f4065!==''){return _0x1f4065;}return _0x148db8;}function Action(_0x53c517,_0x33c813,_0x4c2221,_0x2f1d2b,_0x586dc5){this[_0x0fff('0x4')]=_0x4c2221||undefined;this['idContact']=_0x53c517['id'];this[_0x0fff('0x5')]=_0x33c813['name'];this[_0x0fff('0x6')]=_0x33c813[_0x0fff('0x6')];this['campaigntype']=_0x0fff('0x5');this[_0x0fff('0x7')]=![];this[_0x0fff('0x8')]=_[_0x0fff('0x2')](_0x53c517[_0x0fff('0x9')])?undefined:_0x53c517[_0x0fff('0x9')][_0x0fff('0xa')];this[_0x0fff('0xb')]=this[_0x0fff('0x8')]?util[_0x0fff('0xc')](_0x0fff('0xd'),this['membername']):_0x2f1d2b||undefined;this[_0x0fff('0xe')]=checkNameSurname(_0x53c517['Contact'][_0x0fff('0xf')],_0x53c517[_0x0fff('0x10')][_0x0fff('0x11')],_0x53c517[_0x0fff('0x10')]['lastName']);this['active']=_0x53c517[_0x0fff('0x12')]||![];this['calleridnum']=_0x53c517['phone'];this['scheduledat']=_0x53c517[_0x0fff('0x13')];this[_0x0fff('0x14')]=_0x53c517['countbusyretry']||0x0;this[_0x0fff('0x15')]=_0x53c517[_0x0fff('0x15')]||0x0;this['countnoanswerretry']=_0x53c517['countnoanswerretry']||0x0;this['countglobal']=(_0x53c517[_0x0fff('0x14')]||0x0)+(_0x53c517[_0x0fff('0x15')]||0x0)+(_0x53c517[_0x0fff('0x16')]||0x0)+(_0x53c517[_0x0fff('0x17')]||0x0)+(_0x53c517[_0x0fff('0x18')]||0x0)+(_0x53c517[_0x0fff('0x19')]||0x0)+(_0x53c517['countmachineretry']||0x0)+(_0x53c517[_0x0fff('0x1a')]||0x0);this[_0x0fff('0x17')]=_0x53c517[_0x0fff('0x17')]||0x0;this['countdropretry']=_0x53c517['countdropretry']||0x0;this[_0x0fff('0x19')]=_0x53c517[_0x0fff('0x19')]||0x0;this[_0x0fff('0x1b')]=_0x53c517[_0x0fff('0x1b')]||0x0;this['countagentrejectretry']=_0x53c517[_0x0fff('0x1a')]||0x0;this[_0x0fff('0x1c')]=_0x53c517[_0x0fff('0x1c')];this[_0x0fff('0x1d')]=_0x53c517[_0x0fff('0x1d')];this[_0x0fff('0x1e')]=_0x53c517['callbackat'];this[_0x0fff('0x1f')]=_0x53c517[_0x0fff('0x1f')];this[_0x0fff('0x20')]=_0x53c517[_0x0fff('0x20')];this[_0x0fff('0x21')]=_0x53c517[_0x0fff('0x21')];this['UserId']=_[_0x0fff('0x2')](_0x53c517[_0x0fff('0x9')])?_0x53c517[_0x0fff('0x22')]:_0x53c517[_0x0fff('0x9')]['id'];this[_0x0fff('0x23')]=_0x53c517[_0x0fff('0x23')];this[_0x0fff('0x24')]='';this[_0x0fff('0x25')]='';}Action[_0x0fff('0x26')][_0x0fff('0x27')]=function(){return util[_0x0fff('0xc')](_0x0fff('0x28'),this['calleridname'],this[_0x0fff('0x29')]);};module[_0x0fff('0x2a')]=Action; \ No newline at end of file +var _0xed3c=['firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','type','campaigntype','queue','dialAnswer','membername','Agent','name','format','SIP/%s','calleridname','Contact','phone'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0xed3c,0x1a6));var _0xced3=function(_0x4c49c0,_0x4adb76){_0x4c49c0=_0x4c49c0-0x0;var _0x596b70=_0xed3c[_0x4c49c0];return _0x596b70;};'use strict';var util=require(_0xced3('0x0'));var _=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));function checkNameSurname(_0x3fb5e1,_0x558ee8,_0xfdc1ed){var _0x144d14='';if(!_[_0xced3('0x3')](_0x558ee8)&&'string'===typeof _0x558ee8){_0x144d14+=_0x558ee8;}if(!_['isNil'](_0xfdc1ed)&&_0xced3('0x4')===typeof _0xfdc1ed){_0x144d14+='\x20'+_0xfdc1ed;}if(_0x144d14!==''){return _0x144d14;}return _0x3fb5e1;}function Action(_0x1ada18,_0x2f92f8,_0x1cd694,_0x4795cd,_0x510164){this['uniqueid']=_0x1cd694||undefined;this[_0xced3('0x5')]=_0x1ada18['id'];this['queue']=_0x2f92f8['name'];this['type']=_0x2f92f8[_0xced3('0x6')];this[_0xced3('0x7')]=_0xced3('0x8');this[_0xced3('0x9')]=![];this[_0xced3('0xa')]=_['isNil'](_0x1ada18[_0xced3('0xb')])?undefined:_0x1ada18[_0xced3('0xb')][_0xced3('0xc')];this['channelAgent']=this[_0xced3('0xa')]?util[_0xced3('0xd')](_0xced3('0xe'),this[_0xced3('0xa')]):_0x4795cd||undefined;this[_0xced3('0xf')]=checkNameSurname(_0x1ada18[_0xced3('0x10')][_0xced3('0x11')],_0x1ada18['Contact'][_0xced3('0x12')],_0x1ada18['Contact'][_0xced3('0x13')]);this[_0xced3('0x14')]=_0x1ada18[_0xced3('0x14')]||![];this[_0xced3('0x15')]=_0x1ada18['phone'];this[_0xced3('0x16')]=_0x1ada18[_0xced3('0x16')];this['countbusyretry']=_0x1ada18[_0xced3('0x17')]||0x0;this[_0xced3('0x18')]=_0x1ada18[_0xced3('0x18')]||0x0;this[_0xced3('0x19')]=_0x1ada18['countnoanswerretry']||0x0;this[_0xced3('0x1a')]=(_0x1ada18['countbusyretry']||0x0)+(_0x1ada18[_0xced3('0x18')]||0x0)+(_0x1ada18[_0xced3('0x19')]||0x0)+(_0x1ada18[_0xced3('0x1b')]||0x0)+(_0x1ada18[_0xced3('0x1c')]||0x0)+(_0x1ada18[_0xced3('0x1d')]||0x0)+(_0x1ada18[_0xced3('0x1e')]||0x0)+(_0x1ada18[_0xced3('0x1f')]||0x0);this[_0xced3('0x1b')]=_0x1ada18[_0xced3('0x1b')]||0x0;this[_0xced3('0x1c')]=_0x1ada18[_0xced3('0x1c')]||0x0;this['countabandonedretry']=_0x1ada18['countabandonedretry']||0x0;this['countmachineretry']=_0x1ada18[_0xced3('0x1e')]||0x0;this[_0xced3('0x1f')]=_0x1ada18[_0xced3('0x1f')]||0x0;this['callback']=_0x1ada18[_0xced3('0x20')];this[_0xced3('0x21')]=_0x1ada18['callbackuniqueid'];this['callbackat']=_0x1ada18[_0xced3('0x22')];this[_0xced3('0x23')]=_0x1ada18[_0xced3('0x23')];this[_0xced3('0x24')]=_0x1ada18['ContactId'];this[_0xced3('0x25')]=_0x1ada18[_0xced3('0x25')];this['UserId']=_[_0xced3('0x3')](_0x1ada18['Agent'])?_0x1ada18[_0xced3('0x26')]:_0x1ada18[_0xced3('0xb')]['id'];this[_0xced3('0x27')]=_0x1ada18[_0xced3('0x27')];this[_0xced3('0x28')]='';this['originatecalleridname']='';}Action['prototype'][_0xced3('0x29')]=function(){return util['format'](_0xced3('0x2a'),this[_0xced3('0xf')],this['number']);};module[_0xced3('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ace4f4a..1117318 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 _0xc012=['inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','hanguprequest','syncHangupRequest','bind','dialend','syncDialEnd','newexten','syncNewExten','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','name','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','logger','prototype','syncCampaigns','hasOwnProperty','booked','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','YYYY-MM-DD\x20HH:mm:ss','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','incrementPreviewCounters','idContact','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','outboundAnswerCallsDay','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','linkedid','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','swapAdditionalPhones','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','additional','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','ANSWER','destlinkedid','object','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','logAgent','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','Queue:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','reachable','pick','unlock','unlockContact','execRun','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][getContactPreview]','Call\x20unsuccessful','validateContact','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','Is\x20Valid','dialCutDigit','substring','SIP/%s/%s%s','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','callerid','dialOriginateCallerIdName','originatecalleridnum','extractCalleridNumber','merge','starttime','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','lookAgent','agents','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','isUndefined','transfer','destuniqueid','addVariable','syncVarSet','filterKey','keys','value','error','[syncVarSet][Preview]'];(function(_0x590c8d,_0xd86805){var _0x115c3b=function(_0x490bfd){while(--_0x490bfd){_0x590c8d['push'](_0x590c8d['shift']());}};_0x115c3b(++_0xd86805);}(_0xc012,0x165));var _0x2c01=function(_0x19ef33,_0x23c846){_0x19ef33=_0x19ef33-0x0;var _0x2b6c61=_0xc012[_0x19ef33];return _0x2b6c61;};'use strict';var util=require(_0x2c01('0x0'));var _=require('lodash');var uuid=require(_0x2c01('0x1'));var moment=require(_0x2c01('0x2'));var md5=require(_0x2c01('0x3'));var Redis=require(_0x2c01('0x4'));var config=require(_0x2c01('0x5'));var logger=require(_0x2c01('0x6'))(_0x2c01('0x7'));var loggerAction=require(_0x2c01('0x6'))(_0x2c01('0x8'));var ami=require(_0x2c01('0x9'));var rpcDb=require(_0x2c01('0xa'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x2c01('0xb'));var ut=require(_0x2c01('0xc'));config[_0x2c01('0xd')]=_[_0x2c01('0xe')](config['redis'],{'host':_0x2c01('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2c01('0xd')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x2299f5){this['tail']=this[_0x2c01('0x10')]?this[_0x2c01('0x10')][_0x2c01('0x11')](_0x2299f5):_0x2299f5();};function Preview(_0x17c7ab){this[_0x2c01('0x12')]=new Sequence();this[_0x2c01('0x13')]=_0x17c7ab[_0x2c01('0x14')];this['trunks']=_0x17c7ab[_0x2c01('0x15')];this[_0x2c01('0x16')]={};this['agents']=_0x17c7ab['agents'];this[_0x2c01('0x17')]=0x0;ami['on'](_0x2c01('0x18'),this[_0x2c01('0x19')]['bind'](this));ami['on'](_0x2c01('0x1a'),this[_0x2c01('0x1b')]['bind'](this));ami['on'](_0x2c01('0x1c'),this[_0x2c01('0x1d')][_0x2c01('0x1e')](this));ami['on'](_0x2c01('0x1f'),this[_0x2c01('0x20')][_0x2c01('0x1e')](this));ami['on'](_0x2c01('0x21'),this[_0x2c01('0x22')][_0x2c01('0x1e')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on']('attendedtransfer',this[_0x2c01('0x23')]['bind'](this));ami['on'](_0x2c01('0x24'),this['syncBlindTransfer'][_0x2c01('0x1e')](this));this[_0x2c01('0x25')](this[_0x2c01('0x13')]);}function emit(_0x391ea9,_0x4ebca4,_0x4e5a30){io['to'](_0x391ea9)[_0x2c01('0x26')](_0x4ebca4,_0x4e5a30);}function emitCampaignPreview(_0x673be6){if(_0x673be6[_0x2c01('0x27')]==='outbound'){var _0x2cf4b4={'id':_0x673be6['id'],'name':_0x673be6[_0x2c01('0x28')],'strategy':_0x673be6['strategy'],'answered':_0x673be6['answered'],'available':_0x673be6[_0x2c01('0x29')],'loggedIn':_0x673be6[_0x2c01('0x2a')],'pTalking':_0x673be6[_0x2c01('0x2b')],'sumBillable':_0x673be6['sumBillable'],'sumDuration':_0x673be6[_0x2c01('0x2c')],'sumHoldTime':_0x673be6[_0x2c01('0x2d')]||0x0,'talking':_0x673be6[_0x2c01('0x2e')],'total':_0x673be6[_0x2c01('0x2f')],'type':_0x673be6['type'],'unmanaged':_0x673be6[_0x2c01('0x30')],'abandoned':_0x673be6[_0x2c01('0x31')],'waiting':_0x673be6[_0x2c01('0x32')],'loggedInDb':_0x673be6['loggedInDb'],'dialActive':_0x673be6['dialActive'],'dialMethod':_0x673be6[_0x2c01('0x33')],'dialOriginateCallerIdName':_0x673be6['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x673be6[_0x2c01('0x34')],'dialOriginateTimeout':_0x673be6['dialOriginateTimeout'],'dialPrefix':_0x673be6[_0x2c01('0x35')],'outboundAnswerAgiCallsDay':_0x673be6[_0x2c01('0x36')],'outboundAnswerCallsDay':_0x673be6['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x673be6[_0x2c01('0x37')],'outboundBusyCallsDay':_0x673be6[_0x2c01('0x38')],'outboundCongestionCallsDay':_0x673be6[_0x2c01('0x39')],'outboundDropCallsDayACS':_0x673be6[_0x2c01('0x3a')],'outboundDropCallsDayCallersExit':_0x673be6['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x673be6[_0x2c01('0x3b')],'outboundNoAnswerCallsDay':_0x673be6[_0x2c01('0x3c')],'outboundNoSuchCallsDay':_0x673be6[_0x2c01('0x3d')],'outboundOriginateFailureCallsDay':_0x673be6[_0x2c01('0x3e')],'outboundReCallsDay':_0x673be6[_0x2c01('0x3f')],'outboundRejectCallsDay':_0x673be6[_0x2c01('0x40')],'outboundUnknownCallsDay':_0x673be6['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x673be6[_0x2c01('0x41')],'predictiveIntervalAnsweredCalls':_0x673be6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x673be6['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x673be6[_0x2c01('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x673be6[_0x2c01('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x673be6[_0x2c01('0x44')],'predictiveIntervalErlangCalls':_0x673be6[_0x2c01('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x673be6[_0x2c01('0x46')],'predictiveIntervalHitRate':_0x673be6[_0x2c01('0x47')],'predictiveIntervalMultiplicativeFactor':_0x673be6[_0x2c01('0x48')],'predictiveIntervalPauses':_0x673be6[_0x2c01('0x49')],'predictiveIntervalAvailable':_0x673be6[_0x2c01('0x4a')],'predictiveIntervalTotalCalls':_0x673be6['predictiveIntervalTotalCalls'],'message':_0x673be6[_0x2c01('0x4b')],'originated':_0x673be6[_0x2c01('0x4c')],'erlangCalls':_0x673be6[_0x2c01('0x4d')],'erlangCallToSecond':_0x673be6[_0x2c01('0x4e')],'erlangAbandonmentRate':_0x673be6[_0x2c01('0x4f')],'erlangBusyFactor':_0x673be6['erlangBusyFactor'],'startPredictive':_0x673be6['startPredictive'],'startProgressive':_0x673be6[_0x2c01('0x50')]};if(_0x673be6[_0x2c01('0x51')]){_0x2cf4b4['Trunk']={'id':_0x673be6['Trunk']['id'],'name':_0x673be6[_0x2c01('0x51')]['name'],'active':_0x673be6[_0x2c01('0x51')]['active'],'callerid':_0x673be6[_0x2c01('0x51')]['callerid']};}if(_0x673be6['Interval']){_0x2cf4b4[_0x2c01('0x52')]={'id':_0x673be6[_0x2c01('0x52')]['id'],'name':_0x673be6[_0x2c01('0x52')][_0x2c01('0x28')]};}var _0x590fa6=md5(JSON[_0x2c01('0x53')](_0x2cf4b4));if(_0x673be6[_0x2c01('0x3')]!==_0x590fa6){_0x673be6['md5']=_0x590fa6;emit(util[_0x2c01('0x54')]('voice:queue:%s',_0x2cf4b4[_0x2c01('0x28')]),_0x2c01('0x55'),_0x2cf4b4);}}}function emitVoiceQueueChannelRemove(_0x58e835){logger[_0x2c01('0x56')](_0x2c01('0x57'),JSON[_0x2c01('0x53')](_0x58e835));emit(util[_0x2c01('0x54')]('voice:queue:%s',_0x58e835[_0x2c01('0x28')]),_0x2c01('0x58'),_0x58e835);io[_0x2c01('0x26')](_0x2c01('0x59'),_0x58e835);}function notSendMessagesQueue(_0x10fe0f){if(_0x10fe0f[_0x2c01('0x5a')]){if(_0x10fe0f['originated']===0x0&&_0x10fe0f[_0x2c01('0x2b')]===0x0){_0x10fe0f['sendMessageOneNotActive']=![];_0x10fe0f['available']=0x0;_0x10fe0f[_0x2c01('0x5b')]=0x0;_0x10fe0f['message']='NOT_ACTIVE';ut['logger'](_0x2c01('0x5c'),_0x10fe0f['name']+_0x2c01('0x5d'));}else{_0x10fe0f['message']=_0x2c01('0x5e');ut[_0x2c01('0x5f')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x10fe0f[_0x2c01('0x28')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x10fe0f);}}Preview[_0x2c01('0x60')][_0x2c01('0x25')]=function(){var _0x24a005=this;setInterval(function(){_0x24a005['syncCampaigns']();},0x7cf);};Preview[_0x2c01('0x60')][_0x2c01('0x61')]=function(){var _0x1355e7=this['campaignsPreview'];this[_0x2c01('0x17')]+=0x1;for(var _0x3007b0 in _0x1355e7){if(_0x1355e7[_0x2c01('0x62')](_0x3007b0)&&(_0x1355e7[_0x3007b0][_0x2c01('0x33')]===_0x2c01('0x7')||_0x1355e7[_0x3007b0]['dialMethod']===_0x2c01('0x63'))&&_0x1355e7[_0x3007b0][_0x2c01('0x27')]===_0x2c01('0x64')){if(this['clockClearZombieChannels']>0x7){this[_0x2c01('0x17')]=0x0;this[_0x2c01('0x65')]();}}if(_0x1355e7[_0x2c01('0x62')](_0x3007b0)&&_0x1355e7[_0x3007b0][_0x2c01('0x33')]===_0x2c01('0x7')&&_0x1355e7[_0x3007b0][_0x2c01('0x27')]==='outbound'){if(_0x1355e7[_0x3007b0][_0x2c01('0x66')]){this[_0x2c01('0x67')](_0x1355e7[_0x3007b0]);if(_0x1355e7[_0x3007b0][_0x2c01('0x68')])this[_0x2c01('0x69')](_0x1355e7[_0x3007b0]);}else{notSendMessagesQueue(_0x1355e7[_0x3007b0]);}}}};Preview[_0x2c01('0x60')][_0x2c01('0x6a')]=function(_0x505b59){var _0x2a4e59=this;this[_0x2c01('0x12')]['enqueue'](function(){if(!_['isNil'](_0x2a4e59[_0x2c01('0x16')][_0x505b59])){loggerAction[_0x2c01('0x56')]('[clearZombieChannels][talking]',_0x505b59,_0x2c01('0x6b'),_0x2a4e59[_0x2c01('0x16')][_0x505b59]['queue'],_0x2c01('0x6c'),JSON[_0x2c01('0x53')](_0x2a4e59['campaignsPreview'][_0x2a4e59[_0x2c01('0x16')][_0x505b59][_0x2c01('0x6d')]][_0x2c01('0x4c')]),_0x2c01('0x6e'),JSON['stringify'](_0x2a4e59['campaignsPreview'][_0x2a4e59[_0x2c01('0x16')][_0x505b59][_0x2c01('0x6d')]][_0x2c01('0x2b')]),JSON[_0x2c01('0x53')](_0x2a4e59[_0x2c01('0x16')][_0x505b59][_0x2c01('0x6f')]),JSON[_0x2c01('0x53')](_['pick'](_0x2a4e59[_0x2c01('0x16')][_0x505b59],[_0x2c01('0x70'),_0x2c01('0x71'),_0x2c01('0x72'),_0x2c01('0x73')])));return ami[_0x2c01('0x74')]({'action':_0x2c01('0x75'),'channel':_0x2a4e59['actions'][_0x505b59][_0x2c01('0x76')]})['catch'](function(_0x2ae96e){if(_0x2ae96e['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x2a4e59['actions'][_0x505b59]){ut[_0x2c01('0x77')](_0x2a4e59[_0x2c01('0x13')][_0x2a4e59['actions'][_0x505b59][_0x2c01('0x6d')]],_0x2c01('0x78'));if(_0x2a4e59['actions'][_0x505b59][_0x2c01('0x6f')]===!![]){ut[_0x2c01('0x79')](_0x2a4e59[_0x2c01('0x13')][_0x2a4e59['actions'][_0x505b59]['queue']],'[clearZombieChannel]');ut[_0x2c01('0x7a')](_0x2c01('0x7b')+_0x505b59,_0x2a4e59[_0x2c01('0x16')][_0x505b59][_0x2c01('0x6d')]);}ut[_0x2c01('0x7a')](_0x2c01('0x7c')+_0x505b59,_0x2a4e59[_0x2c01('0x16')][_0x505b59][_0x2c01('0x6d')]);delete _0x2a4e59['actions'][_0x505b59];}},0x2328);}});}});};Preview[_0x2c01('0x60')]['clearZombieChannels']=function(){var _0x3ba714=this;loggerAction[_0x2c01('0x56')](_0x2c01('0x7d'),_[_0x2c01('0x7e')](this['actions']));for(var _0x5cb749 in this[_0x2c01('0x16')]){if(_0x3ba714[_0x2c01('0x16')]['hasOwnProperty'](_0x5cb749)){_0x3ba714[_0x2c01('0x6a')](_0x5cb749);}}};Preview[_0x2c01('0x60')]['recallMe']=function(_0xc98433){var _0x29e2de=this;rpcDb[_0x2c01('0x7f')](_0xc98433['id'],ut[_0x2c01('0x80')](this['agents']))[_0x2c01('0x81')](function(_0x5d8c47){if(!_[_0x2c01('0x82')](_0x5d8c47)){for(var _0x3d69d2=0x0;_0x3d69d2<_0x5d8c47[_0x2c01('0x83')];_0x3d69d2+=0x1){if(ut[_0x2c01('0x84')](_0x5d8c47[_0x3d69d2][_0x2c01('0x85')])<_0xc98433['dialRecallMeTimeout']*0x3c){if(_0x5d8c47[_0x3d69d2][_0x2c01('0x86')]&&!_0x5d8c47[_0x3d69d2][_0x2c01('0x86')][_0x2c01('0x87')]){_0x29e2de[_0x2c01('0x88')](_0x5d8c47[_0x3d69d2]['id'])['then'](ut[_0x2c01('0x89')](_0x2c01('0x8a')))[_0x2c01('0x8b')](ut[_0x2c01('0x89')](_0x2c01('0x8a')));}else{rpcDb[_0x2c01('0x8c')](_0x5d8c47[_0x3d69d2]['id']);}}else{var _0x1ea7f2=new Action(_0x5d8c47[_0x3d69d2],_0xc98433);_0x1ea7f2['starttime']=moment()[_0x2c01('0x54')](_0x2c01('0x8d'));_0xc98433[_0x2c01('0x3f')]+=0x1;ut['logCustomer'](_0x1ea7f2,0x17,'RecallInQueue');if(_0xc98433[_0x2c01('0x8e')]){rpcDb[_0x2c01('0x8f')](ut[_0x2c01('0x90')](_0x5d8c47[_0x3d69d2]));rpcDb[_0x2c01('0x91')](_0x1ea7f2,_0x2c01('0x92'));}else{ut[_0x2c01('0x93')](_0x1ea7f2,0x16,'RecallFailedTimeout');rpcDb[_0x2c01('0x91')](_0x1ea7f2,_0x2c01('0x94'));rpcDb[_0x2c01('0x95')](_0x1ea7f2,_0x2c01('0x94'));}}}}})[_0x2c01('0x8b')](ut['logger2']('[getContactRecallMe]'));};Preview['prototype'][_0x2c01('0x67')]=function(_0x57df2e){_0x57df2e[_0x2c01('0x5a')]=!![];if(ut[_0x2c01('0x96')](_0x57df2e['loggedIn'])){_0x57df2e[_0x2c01('0x4b')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x2c01('0x97')](_0x57df2e['dialActive'])){_0x57df2e[_0x2c01('0x4b')]=_0x2c01('0x98');}else if(!this['isTrunkReachable'](_0x57df2e[_0x2c01('0x51')])){if(!this[_0x2c01('0x99')](_0x57df2e[_0x2c01('0x9a')])){_0x57df2e[_0x2c01('0x4b')]=_0x2c01('0x9b');}else{_0x57df2e['message']=_0x2c01('0x9c');}}else{_0x57df2e[_0x2c01('0x4b')]=_0x2c01('0x9c');}emitCampaignPreview(_0x57df2e);};Preview[_0x2c01('0x60')][_0x2c01('0x9d')]=function(_0x34bd74,_0x1b0cb3,_0x44aacb){var _0x3d4797=this;var _0x3acd7f=this[_0x2c01('0x16')][_0x1b0cb3];var _0x1ab07c=this[_0x2c01('0x13')][_0x3acd7f[_0x2c01('0x6d')]];var _0x3a6f68;var _0xf9594=![];var _0x34e45a=0x2;var _0xb9fb8e=0x3;if(_0x1ab07c){switch(_0x44aacb){case'1':_0x1ab07c[_0x2c01('0x3d')]+=0x1;_0x3acd7f[_0x2c01('0x9e')]+=0x1;_0x3acd7f[_0x2c01('0x9f')]=ut[_0x2c01('0xa0')](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0x0,_0x2c01('0xa1'));ami[_0x2c01('0x26')](_0x2c01('0xa2'),ut['buildObj'](_0x3acd7f,_0x2c01('0xa3')));rpcDb[_0x2c01('0x91')](_0x3acd7f,_0x2c01('0xa4'));_0x3d4797[_0x2c01('0xa5')](_0x3acd7f,'0',_0x1ab07c)['then'](function(_0x5a8b5b){_0xf9594=_0x5a8b5b['additional']==0x1;_0x34e45a=_0x1ab07c[_0x2c01('0xa6')];_0xb9fb8e=_0x1ab07c['callAdditionalPhoneAfterMin'];if(!_0xf9594){if(ut[_0x2c01('0xa0')](_0x3acd7f)>=_0x1ab07c[_0x2c01('0xa7')]){_0x3a6f68=ut['cloneAction'](_0x3acd7f,0xf,_0x2c01('0xa8'));rpcDb[_0x2c01('0x95')](_0x3a6f68,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x3acd7f[_0x2c01('0x9e')]>=_0x1ab07c[_0x2c01('0xa9')]){rpcDb['createCustomerFinal'](_0x3acd7f,_0x2c01('0xaa'));}else{rpcDb[_0x2c01('0xab')](ut[_0x2c01('0xac')](_0x3acd7f,_0x2c01('0x9e'),_0x1ab07c[_0x2c01('0xa6')]),_0x3acd7f[_0x2c01('0xad')],_0x3acd7f[_0x2c01('0xae')]);}}delete this[_0x2c01('0x16')][_0x34bd74['linkedid']];}else{_0x3acd7f[_0x2c01('0x9e')]++;logger['info'](_0x2c01('0xaf'),_0x3acd7f[_0x2c01('0x9e')]);logger['info']('id',_0x3acd7f['idContact']);_0x3d4797[_0x2c01('0xb0')]({'id':_0x3acd7f[_0x2c01('0xb1')],'field':{'countnosuchnumberretry':_0x3acd7f[_0x2c01('0x9e')]}})[_0x2c01('0x81')](function(){_0x3d4797['swapAdditionalPhones'](_0x3acd7f,_0x34e45a,_0xb9fb8e)[_0x2c01('0x81')](function(){});});}});break;case'ANSWER':var _0x388df0=moment()[_0x2c01('0x54')](_0x2c01('0x8d'));_0x3acd7f[_0x2c01('0xb2')]=_0x388df0;_0x3acd7f[_0x2c01('0xb3')]=_0x388df0;_0x3acd7f[_0x2c01('0x6f')]=!![];_0x1ab07c[_0x2c01('0x2b')]+=0x1;logger[_0x2c01('0x56')]('[syncHangup][talking][increment]',_0x3acd7f[_0x2c01('0xb4')],_0x2c01('0xb5'),_0x1ab07c['name'],'pTalking:\x20',_0x1ab07c[_0x2c01('0x2b')]);ami[_0x2c01('0x26')](_0x2c01('0xb6'),ut[_0x2c01('0xb7')](_0x3acd7f,_0x2c01('0xb8'),this[_0x2c01('0x13')][_0x3acd7f[_0x2c01('0x6d')]]));if(_0x1ab07c[_0x2c01('0xb9')]){ami[_0x2c01('0x26')](_0x2c01('0xba'),ut[_0x2c01('0xbb')](_0x3acd7f));}break;case'16':ami['emit'](_0x2c01('0xbc'),ut[_0x2c01('0xb7')](_0x3acd7f,'complete',this['campaignsPreview'][_0x3acd7f[_0x2c01('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x2c01('0xb7')](_0x3acd7f,'complete'));_0x1ab07c[_0x2c01('0xbd')]+=0x1;_0x1ab07c[_0x2c01('0x2f')]+=0x1;_0x1ab07c[_0x2c01('0xbe')]+=0x1;ut['decrementTalkink'](_0x1ab07c,_0x2c01('0xbf'));_0x3acd7f[_0x2c01('0x9f')]=ut[_0x2c01('0xa0')](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0x4,_0x2c01('0xc0'));rpcDb[_0x2c01('0x91')](_0x3acd7f,_0x2c01('0xc1'));rpcDb['createCustomerFinal'](_0x3acd7f,_0x2c01('0xc2'));rpcDb[_0x2c01('0xc3')](_0x3acd7f);_0x1ab07c[_0x2c01('0x2c')]+=_0x3acd7f[_0x2c01('0xc4')];_0x1ab07c[_0x2c01('0xc5')]+=_0x3acd7f[_0x2c01('0xc4')];logger[_0x2c01('0x56')]('[syncHangup][talking][decrement]',_0x3acd7f[_0x2c01('0xb4')],'\x20Queue',_0x1ab07c[_0x2c01('0x28')],_0x2c01('0x6e'),_0x1ab07c[_0x2c01('0x2b')]);delete this[_0x2c01('0x16')][_0x34bd74[_0x2c01('0xc6')]];break;case _0x2c01('0xc7'):_0x1ab07c[_0x2c01('0x38')]+=0x1;_0x3acd7f[_0x2c01('0xc8')]+=0x1;_0x3acd7f['countglobal']=ut[_0x2c01('0xa0')](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0x5,_0x2c01('0xc9'));_0x34e45a=_0x1ab07c[_0x2c01('0xca')];_0xb9fb8e=_0x1ab07c[_0x2c01('0xcb')];ami[_0x2c01('0x26')](_0x2c01('0xcc'),ut[_0x2c01('0xb7')](_0x3acd7f,_0x2c01('0xcd')));rpcDb[_0x2c01('0x91')](_0x3acd7f,_0x2c01('0xce'));_0x3d4797[_0x2c01('0xa5')](_0x3acd7f,'5',_0x1ab07c)[_0x2c01('0x81')](function(_0xc1e11d){_0xf9594=_0xc1e11d['additional']==0x1;if(!_0xf9594){if(ut[_0x2c01('0xa0')](_0x3acd7f)>=_0x1ab07c[_0x2c01('0xa7')]){_0x3a6f68=ut[_0x2c01('0xcf')](_0x3acd7f,0xf,'Global');rpcDb[_0x2c01('0x95')](_0x3a6f68,_0x2c01('0xd0'));}else{if(_0x3acd7f[_0x2c01('0xc8')]>=_0x1ab07c[_0x2c01('0xd1')]){rpcDb[_0x2c01('0x95')](_0x3acd7f,_0x2c01('0xce'));}else{rpcDb[_0x2c01('0xab')](ut['scheduledAt'](_0x3acd7f,'countbusyretry',_0x1ab07c[_0x2c01('0xca')]),_0x3acd7f[_0x2c01('0xad')],_0x3acd7f[_0x2c01('0xae')]);}}}else{_0x3acd7f[_0x2c01('0xc8')]++;_0x3d4797[_0x2c01('0xb0')]({'id':_0x3acd7f[_0x2c01('0xb1')],'field':{'countbusyretry':_0x3acd7f[_0x2c01('0xc8')]}})[_0x2c01('0x81')](function(){_0x3d4797[_0x2c01('0xd2')](_0x3acd7f,_0x34e45a,_0xb9fb8e)[_0x2c01('0x81')](function(){});});}});break;case _0x2c01('0xd3'):_0x1ab07c[_0x2c01('0x3c')]+=0x1;_0x3acd7f[_0x2c01('0xd4')]+=0x1;_0x3acd7f['countglobal']=ut[_0x2c01('0xa0')](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0x3,_0x2c01('0xd5'));_0x34e45a=_0x1ab07c[_0x2c01('0xd6')];_0xb9fb8e=_0x1ab07c[_0x2c01('0xcb')];var _0x164dbc=ut['buildNoAnswerEventPayload'](_0x3acd7f,_0x1ab07c);ami[_0x2c01('0x26')](_0x2c01('0xd7'),_0x164dbc);rpcDb[_0x2c01('0x91')](_0x3acd7f,'[callProgressDetectingCustomer][logNoAnswer]');_0x3d4797[_0x2c01('0xa5')](_0x3acd7f,'3',_0x1ab07c)[_0x2c01('0x81')](function(_0x40923b){_0xf9594=_0x40923b['additional']==0x1;if(!_0xf9594){if(ut[_0x2c01('0xa0')](_0x3acd7f)>=_0x1ab07c[_0x2c01('0xa7')]){_0x3a6f68=ut['cloneAction'](_0x3acd7f,0xf,_0x2c01('0xa8'));rpcDb[_0x2c01('0x95')](_0x3a6f68,_0x2c01('0xd8'));}else{if(_0x3acd7f['countnoanswerretry']>=_0x1ab07c[_0x2c01('0xd9')]){rpcDb[_0x2c01('0x95')](_0x3acd7f,_0x2c01('0xda'));}else{rpcDb[_0x2c01('0xab')](ut['scheduledAt'](_0x3acd7f,_0x2c01('0xd4'),_0x1ab07c[_0x2c01('0xd6')]),_0x3acd7f[_0x2c01('0xad')],_0x3acd7f[_0x2c01('0xae')]);}}}else{_0x3acd7f['countnoanswerretry']++;_0x3d4797[_0x2c01('0xb0')]({'id':_0x3acd7f[_0x2c01('0xb1')],'field':{'countnoanswerretry':_0x3acd7f[_0x2c01('0xd4')]}})['then'](function(){_0x3d4797[_0x2c01('0xd2')](_0x3acd7f,_0x34e45a,_0xb9fb8e)[_0x2c01('0x81')](function(){});});}});break;case _0x2c01('0xdb'):_0x1ab07c[_0x2c01('0x39')]+=0x1;_0x3acd7f['countcongestionretry']+=0x1;_0x3acd7f[_0x2c01('0x9f')]=ut['totalGlobal'](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0x8,_0x2c01('0xdc'));_0x34e45a=_0x1ab07c[_0x2c01('0xdd')];_0xb9fb8e=_0x1ab07c[_0x2c01('0xcb')];ami[_0x2c01('0x26')](_0x2c01('0xde'),ut['buildObj'](_0x3acd7f,_0x2c01('0xdf')));rpcDb[_0x2c01('0x91')](_0x3acd7f,'[callProgressDetectingCustomer][logCongestion]');_0x3d4797[_0x2c01('0xa5')](_0x3acd7f,'8',_0x1ab07c)['then'](function(_0x71b099){_0xf9594=_0x71b099[_0x2c01('0xe0')]==0x1;if(!_0xf9594){if(ut[_0x2c01('0xa0')](_0x3acd7f)>=_0x1ab07c[_0x2c01('0xa7')]){_0x3a6f68=ut[_0x2c01('0xcf')](_0x3acd7f,0xf,_0x2c01('0xa8'));rpcDb[_0x2c01('0x95')](_0x3a6f68,_0x2c01('0xe1'));}else{if(_0x3acd7f['countcongestionretry']>=_0x1ab07c['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x3acd7f,_0x2c01('0xe2'));}else{rpcDb['rescheduleContact'](ut[_0x2c01('0xac')](_0x3acd7f,_0x2c01('0xe3'),_0x1ab07c[_0x2c01('0xca')]),_0x3acd7f[_0x2c01('0xad')],_0x3acd7f[_0x2c01('0xae')]);}}}else{_0x3acd7f[_0x2c01('0xe3')]++;_0x3d4797[_0x2c01('0xb0')]({'id':_0x3acd7f[_0x2c01('0xb1')],'field':{'countcongestionretry':_0x3acd7f['countcongestionretry']}})[_0x2c01('0x81')](function(){_0x3d4797['swapAdditionalPhones'](_0x3acd7f,_0x34e45a,_0xb9fb8e)[_0x2c01('0x81')](function(){});});}});break;case _0x2c01('0xe4'):_0x1ab07c['outboundRejectCallsDay']+=0x1;_0x3acd7f[_0x2c01('0xe5')]+=0x1;_0x3acd7f[_0x2c01('0x9f')]=ut[_0x2c01('0xa0')](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0x14,'AgentReject');_0x34e45a=_0x1ab07c[_0x2c01('0xe6')];_0xb9fb8e=_0x1ab07c[_0x2c01('0xcb')];ami[_0x2c01('0x26')](_0x2c01('0xe7'),ut[_0x2c01('0xb7')](_0x3acd7f,_0x2c01('0xe8')));rpcDb[_0x2c01('0x91')](_0x3acd7f,_0x2c01('0xe9'));_0x3d4797[_0x2c01('0xa5')](_0x3acd7f,'20',_0x1ab07c)[_0x2c01('0x81')](function(_0x461983){_0xf9594=_0x461983[_0x2c01('0xe0')]==0x1;if(!_0xf9594){if(ut['totalGlobal'](_0x3acd7f)>=_0x1ab07c[_0x2c01('0xa7')]){_0x3a6f68=ut['cloneAction'](_0x3acd7f,0x14,_0x2c01('0xea'));rpcDb[_0x2c01('0x95')](_0x3a6f68,_0x2c01('0xeb'));}else{if(_0x3acd7f[_0x2c01('0xe5')]>=_0x1ab07c[_0x2c01('0xec')]){rpcDb[_0x2c01('0x95')](_0x3acd7f,_0x2c01('0xeb'));}else{rpcDb[_0x2c01('0xab')](ut[_0x2c01('0xac')](_0x3acd7f,_0x2c01('0xe5'),_0x1ab07c[_0x2c01('0xe6')]),_0x3acd7f[_0x2c01('0xad')],_0x3acd7f[_0x2c01('0xae')]);}}}else{_0x3acd7f[_0x2c01('0xd4')]++;_0x3d4797[_0x2c01('0xb0')]({'id':_0x3acd7f[_0x2c01('0xb1')],'field':{'countnoanswerretry':_0x3acd7f[_0x2c01('0xd4')]}})['then'](function(){_0x3d4797[_0x2c01('0xd2')](_0x3acd7f,_0x34e45a,_0xb9fb8e)[_0x2c01('0x81')](function(){});});}});break;case _0x2c01('0xed'):_0x1ab07c[_0x2c01('0x41')]+=0x1;_0x3acd7f[_0x2c01('0xee')]+=0x1;_0x3acd7f[_0x2c01('0x9f')]=ut['totalGlobal'](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0xb,'Abandoned');rpcDb[_0x2c01('0x91')](_0x3acd7f,'[callProgressDetectingCustomer][logAbandoned]');_0x3d4797[_0x2c01('0xa5')](_0x3acd7f,'11',_0x1ab07c)[_0x2c01('0x81')](function(_0x233165){_0xf9594=_0x233165[_0x2c01('0xe0')]==0x1;if(!_0xf9594){if(ut[_0x2c01('0xa0')](_0x3acd7f)>=_0x1ab07c['dialGlobalMaxRetry']){_0x3a6f68=ut[_0x2c01('0xcf')](_0x3acd7f,0xf,_0x2c01('0xa8'));rpcDb['createCustomerFinal'](_0x3a6f68,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3acd7f[_0x2c01('0xef')]>=_0x1ab07c[_0x2c01('0xf0')]){rpcDb[_0x2c01('0x95')](_0x3acd7f,_0x2c01('0xf1'));}else{rpcDb[_0x2c01('0xab')](ut[_0x2c01('0xac')](_0x3acd7f,_0x2c01('0xee'),_0x1ab07c[_0x2c01('0xf2')]),_0x3acd7f[_0x2c01('0xad')],_0x3acd7f[_0x2c01('0xae')]);}}}else{_0x3acd7f[_0x2c01('0xd4')]++;_0x3d4797[_0x2c01('0xb0')]({'id':_0x3acd7f['idContact'],'field':{'countnoanswerretry':_0x3acd7f[_0x2c01('0xd4')]}})[_0x2c01('0x81')](function(){_0x3d4797[_0x2c01('0xd2')](_0x3acd7f,_0x34e45a,_0xb9fb8e)['then'](function(){});});}});break;case'18':_0x1ab07c[_0x2c01('0xf3')]+=0x1;_0x3acd7f[_0x2c01('0xf4')]+=0x1;_0x3acd7f['countglobal']=ut[_0x2c01('0xa0')](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0x12,_0x34bd74[_0x2c01('0xf5')]||_0x34bd74['dialstatus']);ami[_0x2c01('0x26')](_0x2c01('0xf6'),ut[_0x2c01('0xb7')](_0x3acd7f,_0x2c01('0xf7')));rpcDb[_0x2c01('0x91')](_0x3acd7f,'[callProgressDetectingCustomer][hangupInAMD]');_0x3d4797['verifyAdditionalPhones'](_0x3acd7f,'18',_0x1ab07c)[_0x2c01('0x81')](function(_0x47ad8c){_0xf9594=_0x47ad8c[_0x2c01('0xe0')]==0x1;if(!_0xf9594){if(ut[_0x2c01('0xa0')](_0x3acd7f)>=_0x1ab07c[_0x2c01('0xa7')]){_0x3a6f68=ut['cloneAction'](_0x3acd7f,0x12,_0x2c01('0xa8'));rpcDb[_0x2c01('0x95')](_0x3a6f68,_0x2c01('0xf8'));}else{rpcDb[_0x2c01('0x95')](_0x3acd7f,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x3acd7f[_0x2c01('0xd4')]++;_0x3d4797[_0x2c01('0xb0')]({'id':_0x3acd7f[_0x2c01('0xb1')],'field':{'countnoanswerretry':_0x3acd7f[_0x2c01('0xd4')]}})[_0x2c01('0x81')](function(){_0x3d4797[_0x2c01('0xd2')](_0x3acd7f,_0x34e45a,_0xb9fb8e)[_0x2c01('0x81')](function(){});});}});delete this[_0x2c01('0x16')][_0x34bd74[_0x2c01('0xc6')]];break;case'19':_0x1ab07c[_0x2c01('0xf3')]+=0x1;_0x3acd7f['countglobal']=ut[_0x2c01('0xa0')](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0x13,_0x34bd74[_0x2c01('0xf5')]||_0x34bd74[_0x2c01('0xf9')]);ami[_0x2c01('0x26')](_0x2c01('0xf6'),ut[_0x2c01('0xb7')](_0x3acd7f,_0x2c01('0xf7')));rpcDb[_0x2c01('0x91')](_0x3acd7f,_0x2c01('0xfa'));_0x3d4797[_0x2c01('0xa5')](_0x3acd7f,'18',_0x1ab07c)[_0x2c01('0x81')](function(_0x51cdc4){_0xf9594=_0x51cdc4[_0x2c01('0xe0')]==0x1;if(!_0xf9594){if(ut[_0x2c01('0xa0')](_0x3acd7f)>=_0x1ab07c[_0x2c01('0xa7')]){_0x3a6f68=ut[_0x2c01('0xcf')](_0x3acd7f,0xf,_0x2c01('0xa8'));rpcDb[_0x2c01('0x95')](_0x3a6f68,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x2c01('0x95')](_0x3acd7f,_0x2c01('0xfa'));}}else{_0x3acd7f['countnoanswerretry']++;_0x3d4797[_0x2c01('0xb0')]({'id':_0x3acd7f['idContact'],'field':{'countnoanswerretry':_0x3acd7f[_0x2c01('0xd4')]}})[_0x2c01('0x81')](function(){_0x3d4797['swapAdditionalPhones'](_0x3acd7f,_0x34e45a,_0xb9fb8e)[_0x2c01('0x81')](function(){});});}});delete this[_0x2c01('0x16')][_0x34bd74[_0x2c01('0xc6')]];break;default:if(_0x3acd7f[_0x2c01('0x6f')]){ut[_0x2c01('0x79')](_0x1ab07c,_0x2c01('0xfb'));ut[_0x2c01('0x7a')](_0x2c01('0xfc')+_0x1ab07c['name'],_0x34bd74);}_0x1ab07c[_0x2c01('0xf3')]+=0x1;_0x3acd7f['countglobal']=ut[_0x2c01('0xa0')](_0x3acd7f);ut[_0x2c01('0x93')](_0x3acd7f,0xc,_0x34bd74[_0x2c01('0xf5')]||_0x34bd74[_0x2c01('0xf9')]);_0x34e45a=_0x1ab07c[_0x2c01('0xe6')];_0xb9fb8e=_0x1ab07c[_0x2c01('0xcb')];rpcDb[_0x2c01('0x91')](_0x3acd7f,_0x2c01('0xfd'));_0x3d4797[_0x2c01('0xa5')](_0x3acd7f,'20',_0x1ab07c)[_0x2c01('0x81')](function(_0x36cc2e){_0xf9594=_0x36cc2e[_0x2c01('0xe0')]==0x1;if(!_0xf9594){if(ut['totalGlobal'](_0x3acd7f)>=_0x1ab07c[_0x2c01('0xa7')]){_0x3a6f68=ut['cloneAction'](_0x3acd7f,0xf,'Global');rpcDb['createCustomerFinal'](_0x3a6f68,_0x2c01('0xfe'));}else{rpcDb[_0x2c01('0x95')](_0x3acd7f,_0x2c01('0xfe'));}delete this['actions'][_0x34bd74[_0x2c01('0xc6')]];}else{_0x3d4797[_0x2c01('0xd2')](_0x3acd7f,_0x34e45a,_0xb9fb8e)[_0x2c01('0x81')](function(){});}});}if(!(_0x3acd7f[_0x2c01('0x6f')]&&_0x44aacb==='16')){ut[_0x2c01('0x77')](_0x1ab07c,'[callProgressDetectingCustomer]');logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x3acd7f[_0x2c01('0xb4')],_0x2c01('0xb5'),_0x1ab07c[_0x2c01('0x28')],'originated:\x20',_0x1ab07c[_0x2c01('0x4c')]);}if(_0x44aacb!==_0x2c01('0xff')){delete this[_0x2c01('0x16')][_0x34bd74[_0x2c01('0xc6')]];delete this[_0x2c01('0x16')][_0x34bd74[_0x2c01('0x100')]];}}};Preview[_0x2c01('0x60')]['callProgressDetectingAgent']=function(_0x33189f,_0x99a237,_0x252ea2){if(_['isUndefined'](_0x99a237)&&_0x2c01('0x101')!==typeof _0x99a237){return;}if(_['isUndefined'](_0x252ea2)&&'object'!==typeof _0x252ea2){return;}switch(_0x252ea2['reason']){case'0':ut['logAgent'](_0x33189f,0x0,_0x2c01('0xa1'));rpcDb['createAgentHistory'](_0x33189f,_0x2c01('0x102'));break;case'3':ut['logAgent'](_0x33189f,0x3,_0x2c01('0xd5'));rpcDb[_0x2c01('0x103')](_0x33189f,_0x2c01('0x104'));break;case'5':ut['logAgent'](_0x33189f,0x5,'Busy');rpcDb[_0x2c01('0x103')](_0x33189f,_0x2c01('0x105'));break;case'8':ut[_0x2c01('0x106')](_0x33189f,0x8,'Congestion');rpcDb[_0x2c01('0x103')](_0x33189f,_0x2c01('0x107'));break;case'22':ut['logAgent'](_0x33189f,0x16,_0x2c01('0x108'));rpcDb[_0x2c01('0x103')](_0x33189f,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x33189f,0xc,_0x252ea2[_0x2c01('0x109')]);rpcDb[_0x2c01('0x103')](_0x33189f,_0x2c01('0x107'));}ut[_0x2c01('0x77')](_0x99a237,_0x2c01('0x10a'));logger[_0x2c01('0x56')](_0x2c01('0x10b'),_0x33189f[_0x2c01('0xb4')],_0x2c01('0xb5'),_0x99a237[_0x2c01('0x28')],'originated:\x20',_0x99a237[_0x2c01('0x4c')]);delete this[_0x2c01('0x16')][_0x33189f[_0x2c01('0xb4')]];};Preview['prototype'][_0x2c01('0xa5')]=function(_0x3a1dc3,_0xf279da,_0x165959){return Promise[_0x2c01('0x10c')]()['then'](cmHopperAdditionalPhone[_0x2c01('0xa5')](_0x3a1dc3,_0xf279da,_0x165959))[_0x2c01('0x8b')](logger['info'](_0x2c01('0x10d')));};Preview[_0x2c01('0x60')][_0x2c01('0xd2')]=function(_0x2644a0,_0x243cde,_0x2a2760){return Promise[_0x2c01('0x10c')]()[_0x2c01('0x81')](cmHopperAdditionalPhone[_0x2c01('0xd2')](_0x2644a0,_0x243cde,_0x2a2760))[_0x2c01('0x8b')](logger[_0x2c01('0x56')](_0x2c01('0x10e')));};Preview[_0x2c01('0x60')]['incrementPreviewCounters']=function(_0x4c3bc0){return Promise[_0x2c01('0x10c')]()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x4c3bc0))[_0x2c01('0x8b')](logger[_0x2c01('0x56')](_0x2c01('0x10f')));};Preview['prototype'][_0x2c01('0x110')]=function(_0xdbe177,_0x5b3989,_0x23b83a,_0x4c6c06,_0x90823c){var _0x5139b1=this;return new Promise(function(_0x17be88,_0x55bb59){if(_['isNil'](_0x5b3989)||_[_0x2c01('0x82')](_0x5b3989[_0x2c01('0x111')])||_[_0x2c01('0x82')](_0x5b3989[_0x2c01('0x112')])||_['isNil'](_0x5b3989[_0x2c01('0x72')])){_0x55bb59(ut[_0x2c01('0x4b')](_0x2c01('0x113'),_0x4c6c06,_0x90823c));return;}var _0x28312f=uuid['v4']();var _0x4919af=_0x5139b1[_0x2c01('0x13')][_0x5b3989['Queue'][_0x2c01('0x28')]];var _0x2dc335=_0x23b83a?_0x5139b1['agents'][_0x23b83a]['id']:undefined;_0x5139b1[_0x2c01('0x16')][_0x28312f]=new Action(_0x5b3989,_0x4919af,_0x28312f,_0x23b83a,_0x2dc335);var _0x32c100=_0x5139b1[_0x2c01('0x16')][_0x28312f];_0x32c100[_0x2c01('0xad')]=_0x4c6c06;_0x32c100['activeContact']=_0x90823c;_0x32c100['lookAgent']=_0x23b83a;if(_[_0x2c01('0x114')](_0xdbe177)){_0x5139b1[_0x2c01('0x115')](_0x32c100,_0x4919af,_0x5b3989,_0x23b83a)['then'](function(_0x24b216){logger[_0x2c01('0x56')]('[Preview][execCall][success]',_0x2c01('0x116')+_0x32c100[_0x2c01('0x6d')]+'\x20IdHopper:\x20'+_0x32c100[_0x2c01('0xb1')],JSON[_0x2c01('0x53')](_0x24b216));ami[_0x2c01('0x26')](_0x2c01('0x117'),ut[_0x2c01('0xb7')](_0x32c100,_0x2c01('0x118'),_0x5139b1['campaignsPreview'][_0x32c100[_0x2c01('0x6d')]]));_0x17be88(ut[_0x2c01('0x4b')](_0x2c01('0x119')));})[_0x2c01('0x8b')](function(_0x1b7709){ut[_0x2c01('0x5f')](_0x2c01('0x11a'),_0x1b7709);_0x55bb59(ut[_0x2c01('0x4b')]('Call\x20failed',_0x4c6c06,_0x90823c));});}else{_0x4919af[_0x2c01('0x37')]+=0x1;ut[_0x2c01('0x11b')](_0x32c100);rpcDb[_0x2c01('0x11c')](_0x32c100,_0x2c01('0x11d'));delete _0x5139b1['actions'][_0x28312f];_0x55bb59(ut[_0x2c01('0x4b')]('Contact\x20in\x20black\x20List',_0x4c6c06,_0x90823c));}});};Preview[_0x2c01('0x60')][_0x2c01('0x99')]=function(_0xbf8e89){return!_['isNil'](_0xbf8e89)&&!_[_0x2c01('0x82')](_0xbf8e89[_0x2c01('0x28')])&&!_[_0x2c01('0x82')](_0xbf8e89[_0x2c01('0x11e')])&&_0xbf8e89['active']&&!_[_0x2c01('0x82')](this[_0x2c01('0x15')][util[_0x2c01('0x54')]('SIP/%s',_0xbf8e89[_0x2c01('0x28')])])&&!_['isNil'](this[_0x2c01('0x15')][util[_0x2c01('0x54')](_0x2c01('0x11f'),_0xbf8e89[_0x2c01('0x28')])][_0x2c01('0x75')])&&(this[_0x2c01('0x15')][util[_0x2c01('0x54')](_0x2c01('0x11f'),_0xbf8e89[_0x2c01('0x28')])][_0x2c01('0x75')]===_0x2c01('0x120')||this[_0x2c01('0x15')][util[_0x2c01('0x54')](_0x2c01('0x11f'),_0xbf8e89[_0x2c01('0x28')])][_0x2c01('0x75')]==='unmonitored');};Preview['prototype'][_0x2c01('0x88')]=function(_0x412830,_0x15c584){var _0xff45a8=this;return new Promise(function(_0x4b0585,_0x38a78d){_0xff45a8['execRun'](_0x412830,_0x15c584)[_0x2c01('0x81')](function(_0x52e101){_0x4b0585(_[_0x2c01('0x121')](_0x52e101,['message']));})[_0x2c01('0x8b')](function(_0x3817c3){if(_0x3817c3[_0x2c01('0x122')]){rpcDb[_0x2c01('0x123')](_0x412830);}if(_0x3817c3[_0x2c01('0x11e')]){rpcDb[_0x2c01('0x8c')](_0x412830);}_0x38a78d(_[_0x2c01('0x121')](_0x3817c3,['message']));});});};Preview[_0x2c01('0x60')][_0x2c01('0x124')]=function(_0x1a4d5d,_0x1de09b){var _0x2527d7=this;return new Promise(function(_0x1ee022,_0x285162){var _0x3f440e,_0x10a061;rpcDb[_0x2c01('0x125')](_0x1a4d5d)['then'](function(_0x83043e){if(!_[_0x2c01('0x82')](_0x83043e[0x0])){_0x10a061=_0x83043e[0x0][_0x2c01('0x126')]?![]:!![];_0x3f440e=_0x83043e[0x0][_0x2c01('0x126')]?!![]:![];_0x3f440e=_0x1de09b?!![]:_0x3f440e;}var _0x98a7cb=_0x2527d7['validateContact'](_0x83043e);if(_0x98a7cb[_0x2c01('0x127')]){rpcDb[_0x2c01('0x128')](_['pick'](_0x83043e[0x0],['VoiceQueueId','phone']))['then'](function(_0x1ee79e){_0x2527d7[_0x2c01('0x110')](_0x1ee79e,_0x83043e[0x0],_0x1de09b,_0x10a061,_0x3f440e)[_0x2c01('0x81')](function(_0xc9911){_0x1ee022(_0xc9911);})[_0x2c01('0x8b')](function(_0xd1e26c){_0x285162(_0xd1e26c);});})['catch'](function(_0x55adf5){ut['logger']('[Preview][checkIsBlackList]',_0x55adf5);_0x285162(ut['message']('Call\x20unsuccessful',_0x10a061,_0x3f440e));});}else{_0x285162(ut[_0x2c01('0x4b')](_0x98a7cb['message'],_0x10a061,_0x3f440e));}})[_0x2c01('0x8b')](function(_0x3f9fdb){ut[_0x2c01('0x5f')](_0x2c01('0x129'),_0x3f9fdb);_0x285162(ut[_0x2c01('0x4b')](_0x2c01('0x12a'),![],!![]));});});};Preview[_0x2c01('0x60')][_0x2c01('0x12b')]=function(_0x4463dc){if(_[_0x2c01('0x82')](_0x4463dc)||_['isEmpty'](_0x4463dc)||!_[_0x2c01('0x82')](_0x4463dc[0x0][_0x2c01('0x86')])&&_['isNil'](_0x4463dc[0x0]['Agent'][_0x2c01('0x28')])){ut[_0x2c01('0x5f')]('[Preview][validateContact][Empty\x20Contact]',_0x4463dc);return{'isValid':![],'message':_0x2c01('0x12c')};}var _0x3b148e=this[_0x2c01('0x13')][_0x4463dc[0x0][_0x2c01('0x6b')][_0x2c01('0x28')]];_0x3b148e[_0x2c01('0x4b')]='ACTIVE';if(_[_0x2c01('0x82')](_0x3b148e)){ut['logger'](_0x2c01('0x12d'),_0x3b148e);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x2c01('0x99')](_0x3b148e['Trunk'])){ut[_0x2c01('0x5f')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x2c01('0x12e')+_0x3b148e[_0x2c01('0x28')]+_0x2c01('0x12f'));if(!this['isTrunkReachable'](_0x3b148e['TrunkBackup'])){ut['logger'](_0x2c01('0x130'),_0x3b148e[_0x2c01('0x28')]+_0x2c01('0x131'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x2c01('0x97')](_0x3b148e[_0x2c01('0x66')])){ut[_0x2c01('0x5f')](_0x2c01('0x132'),_0x3b148e['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0x2c01('0x12e')+_0x3b148e[_0x2c01('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x2c01('0x133')};};Preview[_0x2c01('0x60')]['execCall']=function(_0x32e139,_0x3e6245,_0x4378b4,_0x4d4afe){var _0x1db030=this;return new Promise(function(_0x8c4772,_0x3b18d2){var _0x18a315=_0x32e139[_0x2c01('0xb4')];var _0x1a2555=_0x1db030[_0x2c01('0x99')](_0x3e6245['Trunk'])?util[_0x2c01('0x54')]('SIP/%s/%s%s',_0x3e6245[_0x2c01('0x51')][_0x2c01('0x28')],_[_0x2c01('0x82')](_0x3e6245[_0x2c01('0x35')])?'':_0x3e6245[_0x2c01('0x35')]['trim']()||'',_0x3e6245[_0x2c01('0x134')]>0x0?_0x4378b4[_0x2c01('0x112')][_0x2c01('0x135')](_0x3e6245[_0x2c01('0x134')]):_0x4378b4[_0x2c01('0x112')]):util['format'](_0x2c01('0x136'),_[_0x2c01('0x82')](_0x3e6245[_0x2c01('0x9a')])?_0x3e6245['Trunk']['name']:_0x3e6245[_0x2c01('0x9a')][_0x2c01('0x28')],_['isNil'](_0x3e6245[_0x2c01('0x35')])?'':_0x3e6245[_0x2c01('0x35')]['trim']()||'',_0x3e6245[_0x2c01('0x134')]>0x0?_0x4378b4[_0x2c01('0x112')]['substring'](_0x3e6245[_0x2c01('0x134')]):_0x4378b4[_0x2c01('0x112')]);var _0x4cafba=_0x1db030[_0x2c01('0x99')](_0x3e6245[_0x2c01('0x51')])?ut['getCallerId'](_0x3e6245[_0x2c01('0x51')]['callerid'],_0x3e6245['dialOriginateCallerIdName'],_0x3e6245[_0x2c01('0x137')]>0x0?ut[_0x2c01('0x138')](_0x3e6245[_0x2c01('0x34')],_0x3e6245['dialRandomLastDigitCallerIdNumber']):_0x3e6245[_0x2c01('0x34')]):ut[_0x2c01('0x139')](_[_0x2c01('0x82')](_0x3e6245['TrunkBackup'])?_0x3e6245['Trunk']['callerid']:_0x3e6245[_0x2c01('0x9a')][_0x2c01('0x13a')],_0x3e6245[_0x2c01('0x13b')],_0x3e6245[_0x2c01('0x137')]>0x0?ut[_0x2c01('0x138')](_0x3e6245[_0x2c01('0x34')],_0x3e6245[_0x2c01('0x137')]):_0x3e6245['dialOriginateCallerIdNumber']);if(_0x4cafba){_0x32e139['originatecalleridname']=ut['extractCalleridName'](_0x4cafba);_0x32e139[_0x2c01('0x13c')]=ut[_0x2c01('0x13d')](_0x4cafba);}var _0x1bf88f=ut['addVariables'](_0x3e6245,_0x4378b4,_0x1a2555,_0x4cafba,_0x18a315,_0x32e139);_[_0x2c01('0x13e')](_0x32e139,ut['toLowerVariables'](_0x1bf88f));_0x32e139[_0x2c01('0x13f')]=moment()[_0x2c01('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e6245['variables']=_0x1bf88f;ami[_0x2c01('0x74')](ut[_0x2c01('0x140')](_0x32e139,_0x3e6245,_0x1bf88f,_0x32e139['activeContact'],_0x4d4afe))['then'](function(_0x5f073a){_0x3e6245[_0x2c01('0x4c')]+=0x1;logger[_0x2c01('0x56')](_0x2c01('0x141'),_0x18a315,_0x2c01('0xb5'),_0x3e6245[_0x2c01('0x28')],_0x2c01('0x6c'),_0x3e6245[_0x2c01('0x4c')]);_0x8c4772(_0x5f073a);})[_0x2c01('0x8b')](function(_0x16e6d4){ut['logAgent'](_0x32e139,0xe,_0x2c01('0x142'));rpcDb[_0x2c01('0x103')](_0x32e139,_0x2c01('0x143'));_0x3b18d2(_0x16e6d4);});});};Preview[_0x2c01('0x60')][_0x2c01('0x22')]=function(_0x357983){if(this['actions'][_0x357983['linkedid']]){this[_0x2c01('0x16')][_0x357983[_0x2c01('0xc6')]][_0x2c01('0x76')]=_0x357983[_0x2c01('0x76')];}};Preview[_0x2c01('0x60')][_0x2c01('0x19')]=function(_0x4d2412){var _0x147b6e=this;var _0x4606aa=this[_0x2c01('0x16')][_0x4d2412['actionid']];if(_0x4606aa){if(_0x4606aa[_0x2c01('0x144')]&&this[_0x2c01('0x145')][_0x4606aa[_0x2c01('0x144')]]){ut['logLookAgent'](_0x4606aa,this[_0x2c01('0x145')][_0x4606aa[_0x2c01('0x144')]]['name'],this[_0x2c01('0x145')][_0x4606aa['lookAgent']]['id']);}var _0x5668bc=_['clone'](_0x4606aa);_0x5668bc[_0x2c01('0xb2')]=moment()[_0x2c01('0x54')]('YYYY-MM-DD\x20HH:mm:ss');var _0x231d8f=_0x147b6e[_0x2c01('0x13')][_0x4606aa[_0x2c01('0x6d')]];if(ut[_0x2c01('0x146')](_0x4d2412[_0x2c01('0x147')])){if(_0x4606aa[_0x2c01('0xad')]){rpcDb[_0x2c01('0x123')](_0x4606aa['idContact']);}if(_0x4606aa[_0x2c01('0xae')]){rpcDb[_0x2c01('0x8c')](_0x4606aa[_0x2c01('0xb1')]);}ami[_0x2c01('0x26')](_0x2c01('0x148'),ut[_0x2c01('0xb7')](_0x4606aa,_0x2c01('0x149'),this[_0x2c01('0x13')][_0x4606aa[_0x2c01('0x6d')]]));this[_0x2c01('0x14a')](_0x5668bc,_0x231d8f,_0x4d2412);}else{_0x4606aa['starttime']=moment()[_0x2c01('0x54')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x2c01('0x106')](_0x5668bc,0x4,_0x2c01('0xc0'));rpcDb['createAgentHistory'](_0x5668bc,_0x2c01('0x14b'));}}};Preview[_0x2c01('0x60')][_0x2c01('0x1b')]=function(_0x5ce4f2){var _0xf14fcf=this[_0x2c01('0x16')][_0x5ce4f2[_0x2c01('0xc6')]];var _0x7dc37a;if(_0xf14fcf){_0x7dc37a=this[_0x2c01('0x13')][_0xf14fcf[_0x2c01('0x6d')]];logger[_0x2c01('0x56')](_0x2c01('0x14c'),_0x5ce4f2[_0x2c01('0xc6')],'\x20Queue',_0x7dc37a[_0x2c01('0x28')],'pTalking:\x20',_0x7dc37a[_0x2c01('0x2b')]);}if(this[_0x2c01('0x16')][_0x5ce4f2[_0x2c01('0xc6')]]&&_0x5ce4f2['linkedid']!==_0x5ce4f2['uniqueid']){if(_0x5ce4f2[_0x2c01('0x14d')]==='16'&&this[_0x2c01('0x16')][_0x5ce4f2[_0x2c01('0xc6')]][_0x2c01('0x6f')]){this['callProgressDetectingCustomer'](_0x5ce4f2,_0x5ce4f2[_0x2c01('0xc6')],_0x5ce4f2[_0x2c01('0x14d')]);}else if(this[_0x2c01('0x16')][_0x5ce4f2[_0x2c01('0xc6')]][_0x2c01('0x6f')]){logger[_0x2c01('0x56')](_0x2c01('0x14e'),_0x5ce4f2[_0x2c01('0xc6')],_0x5ce4f2[_0x2c01('0x14d')],_0x2c01('0xb5'),_0x7dc37a[_0x2c01('0x28')],_0x2c01('0x6e'),_0x7dc37a[_0x2c01('0x2b')]);this[_0x2c01('0x9d')](_0x5ce4f2,_0x5ce4f2[_0x2c01('0xc6')],_0x5ce4f2[_0x2c01('0x14d')]);}}else if(_0xf14fcf&&_[_0x2c01('0x82')](_0xf14fcf[_0x2c01('0x14f')])&&_0x7dc37a['dialQueueProject']&&_0x5ce4f2['linkedid']===_0x5ce4f2['uniqueid']&&_[_0x2c01('0x82')](_0x5ce4f2['reason'])&&_0x5ce4f2['cause']==='16'&&_0x5ce4f2[_0x2c01('0x150')]==='6'&&_[_0x2c01('0x151')](_0xf14fcf[_0x2c01('0x152')])){if(_0xf14fcf['unlockAgent']){rpcDb['unlockContact'](_0xf14fcf[_0x2c01('0xb1')]);}if(_0xf14fcf['activeContact']){rpcDb[_0x2c01('0x8c')](_0xf14fcf['idContact']);}_0x5ce4f2[_0x2c01('0x109')]='22';this['callProgressDetectingAgent'](_0xf14fcf,_0x7dc37a,_0x5ce4f2);}else if(_0xf14fcf&&_0xf14fcf[_0x2c01('0x152')]){if(_0x5ce4f2[_0x2c01('0x14d')]==='16'&&this[_0x2c01('0x16')][_0x5ce4f2['linkedid']][_0x2c01('0x6f')]){logger[_0x2c01('0x56')]('[syncHangup][talking][transfer]',_0x5ce4f2[_0x2c01('0xc6')],_0x5ce4f2[_0x2c01('0x14d')],_0x2c01('0xb5'),_0x7dc37a['name'],_0x2c01('0x6e'),_0x7dc37a[_0x2c01('0x2b')]);this[_0x2c01('0x9d')](_0x5ce4f2,_0x5ce4f2['linkedid'],_0x5ce4f2['cause']);}else if(this[_0x2c01('0x16')][_0x5ce4f2[_0x2c01('0xc6')]][_0x2c01('0x6f')]){logger[_0x2c01('0x56')]('[syncHangup][talking][cause]',_0x5ce4f2['linkedid'],_0x5ce4f2[_0x2c01('0x14d')],_0x2c01('0xb5'),_0x7dc37a[_0x2c01('0x28')],_0x2c01('0x6e'),_0x7dc37a[_0x2c01('0x2b')]);this[_0x2c01('0x9d')](_0x5ce4f2,_0x5ce4f2[_0x2c01('0xc6')],_0x5ce4f2[_0x2c01('0x14d')]);}}};Preview['prototype'][_0x2c01('0x20')]=function(_0x230112){if(this[_0x2c01('0x16')][_0x230112['destlinkedid']]&&_0x230112[_0x2c01('0x100')]!==_0x230112[_0x2c01('0x153')]){this[_0x2c01('0x9d')](_0x230112,_0x230112[_0x2c01('0x100')],_0x230112[_0x2c01('0xf9')]);}};Preview[_0x2c01('0x60')][_0x2c01('0x1d')]=function(_0x13cc1f){if(this['actions'][_0x13cc1f[_0x2c01('0xc6')]]&&_0x13cc1f[_0x2c01('0xc6')]!==_0x13cc1f['uniqueid']&&!this[_0x2c01('0x16')][_0x13cc1f[_0x2c01('0xc6')]][_0x2c01('0x6f')]){if(_0x13cc1f[_0x2c01('0x14d')]==='1'){this['callProgressDetectingCustomer'](_0x13cc1f,_0x13cc1f['linkedid'],_0x13cc1f['cause']);}}};Preview[_0x2c01('0x60')][_0x2c01('0x154')]=function(_0x46eaba,_0x4bd3b1,_0x1c8282){if(this[_0x2c01('0x16')][_0x46eaba]){if(_[_0x2c01('0x82')](this['actions'][_0x46eaba]['variables'])){this[_0x2c01('0x16')][_0x46eaba]['variables']={};}this['actions'][_0x46eaba]['variables'][_0x4bd3b1]=_0x1c8282;}};Preview['prototype'][_0x2c01('0x155')]=function(_0x39ac9c){try{if(!_['isNil'](_0x39ac9c)){if(ut[_0x2c01('0x156')](_['keys'](_0x39ac9c['variable'])[0x0])){this[_0x2c01('0x154')](_0x39ac9c[_0x2c01('0xb4')],_[_0x2c01('0x157')](_0x39ac9c['variable'])[0x0],_0x39ac9c[_0x2c01('0x158')]);}}}catch(_0x3fae05){logger[_0x2c01('0x159')](_0x2c01('0x15a'),util[_0x2c01('0x15b')](_0x3fae05,{'showHidden':![],'depth':null}));}};Preview[_0x2c01('0x60')][_0x2c01('0x23')]=function(_0x16667f){if(_0x16667f){if(this[_0x2c01('0x16')][_0x16667f[_0x2c01('0x15c')]]){this[_0x2c01('0x16')][_0x16667f[_0x2c01('0x15c')]][_0x2c01('0x152')]=!![];}}};Preview[_0x2c01('0x60')][_0x2c01('0x15d')]=function(_0x398278){if(_0x398278){if(this['actions'][_0x398278[_0x2c01('0x15e')]]){this[_0x2c01('0x16')][_0x398278[_0x2c01('0x15e')]][_0x2c01('0x152')]=!![];}}};module[_0x2c01('0x15f')]=Preview; \ No newline at end of file +var _0xf8cd=['syncAttendedTransfer','blindtransfer','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','md5','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','dialMethod','booked','clearZombieChannels','hasOwnProperty','setMessage','recallMe','clearZombieChannel','Queue','queue','originated:\x20','stringify','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','isNil','length','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','format','logCustomer','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','answertime','[syncHangup][talking][increment]','uniqueid','buildObj','connect','custom:agentConnectPreview','custom:agentcomplete','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[swapAdditionalPhone]\x20','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','execRun','isValid','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','substring','dialCutDigit','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','\x20Queue','[originateFailure][logOriginateFailure]','syncNewExten','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','varset','attendedtransfer'];(function(_0x604643,_0x4ab1f6){var _0x39b5d6=function(_0xe4b7e7){while(--_0xe4b7e7){_0x604643['push'](_0x604643['shift']());}};_0x39b5d6(++_0x4ab1f6);}(_0xf8cd,0x145));var _0xdf8c=function(_0x5790b2,_0xf613eb){_0x5790b2=_0x5790b2-0x0;var _0x5ca6ee=_0xf8cd[_0x5790b2];return _0x5ca6ee;};'use strict';var util=require(_0xdf8c('0x0'));var _=require(_0xdf8c('0x1'));var uuid=require(_0xdf8c('0x2'));var moment=require(_0xdf8c('0x3'));var md5=require('md5');var Redis=require(_0xdf8c('0x4'));var config=require(_0xdf8c('0x5'));var logger=require(_0xdf8c('0x6'))(_0xdf8c('0x7'));var loggerAction=require('../../../config/logger')(_0xdf8c('0x8'));var ami=require(_0xdf8c('0x9'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xdf8c('0xa'));var Action=require(_0xdf8c('0xb'));var ut=require(_0xdf8c('0xc'));config['redis']=_['defaults'](config[_0xdf8c('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xdf8c('0xe'))(new Redis(config[_0xdf8c('0xd')]));var Sequence=function(){};Sequence[_0xdf8c('0xf')][_0xdf8c('0x10')]=function(_0x1baff2){this[_0xdf8c('0x11')]=this['tail']?this[_0xdf8c('0x11')][_0xdf8c('0x12')](_0x1baff2):_0x1baff2();};function Preview(_0x5d2228){this[_0xdf8c('0x13')]=new Sequence();this[_0xdf8c('0x14')]=_0x5d2228['voiceQueues'];this[_0xdf8c('0x15')]=_0x5d2228[_0xdf8c('0x15')];this[_0xdf8c('0x16')]={};this[_0xdf8c('0x17')]=_0x5d2228[_0xdf8c('0x17')];this[_0xdf8c('0x18')]=0x0;ami['on'](_0xdf8c('0x19'),this['syncOriginateResponse'][_0xdf8c('0x1a')](this));ami['on'](_0xdf8c('0x1b'),this[_0xdf8c('0x1c')]['bind'](this));ami['on'](_0xdf8c('0x1d'),this[_0xdf8c('0x1e')][_0xdf8c('0x1a')](this));ami['on'](_0xdf8c('0x1f'),this['syncDialEnd'][_0xdf8c('0x1a')](this));ami['on']('newexten',this['syncNewExten'][_0xdf8c('0x1a')](this));ami['on'](_0xdf8c('0x20'),this['syncVarSet'][_0xdf8c('0x1a')](this));ami['on'](_0xdf8c('0x21'),this[_0xdf8c('0x22')]['bind'](this));ami['on'](_0xdf8c('0x23'),this['syncBlindTransfer']['bind'](this));this['loopCampaigns'](this[_0xdf8c('0x14')]);}function emit(_0x403038,_0x5643cf,_0x5ebc79){io['to'](_0x403038)['emit'](_0x5643cf,_0x5ebc79);}function emitCampaignPreview(_0x28186d){if(_0x28186d[_0xdf8c('0x24')]===_0xdf8c('0x25')){var _0x200992={'id':_0x28186d['id'],'name':_0x28186d[_0xdf8c('0x26')],'strategy':_0x28186d[_0xdf8c('0x27')],'answered':_0x28186d[_0xdf8c('0x28')],'available':_0x28186d[_0xdf8c('0x29')],'loggedIn':_0x28186d[_0xdf8c('0x2a')],'pTalking':_0x28186d[_0xdf8c('0x2b')],'sumBillable':_0x28186d[_0xdf8c('0x2c')],'sumDuration':_0x28186d[_0xdf8c('0x2d')],'sumHoldTime':_0x28186d[_0xdf8c('0x2e')]||0x0,'talking':_0x28186d[_0xdf8c('0x2f')],'total':_0x28186d['total'],'type':_0x28186d[_0xdf8c('0x24')],'unmanaged':_0x28186d[_0xdf8c('0x30')],'abandoned':_0x28186d[_0xdf8c('0x31')],'waiting':_0x28186d['waiting'],'loggedInDb':_0x28186d[_0xdf8c('0x32')],'dialActive':_0x28186d[_0xdf8c('0x33')],'dialMethod':_0x28186d['dialMethod'],'dialOriginateCallerIdName':_0x28186d[_0xdf8c('0x34')],'dialOriginateCallerIdNumber':_0x28186d[_0xdf8c('0x35')],'dialOriginateTimeout':_0x28186d[_0xdf8c('0x36')],'dialPrefix':_0x28186d[_0xdf8c('0x37')],'outboundAnswerAgiCallsDay':_0x28186d[_0xdf8c('0x38')],'outboundAnswerCallsDay':_0x28186d[_0xdf8c('0x39')],'outboundBlacklistCallsDay':_0x28186d['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x28186d[_0xdf8c('0x3a')],'outboundCongestionCallsDay':_0x28186d[_0xdf8c('0x3b')],'outboundDropCallsDayACS':_0x28186d[_0xdf8c('0x3c')],'outboundDropCallsDayCallersExit':_0x28186d[_0xdf8c('0x3d')],'outboundDropCallsDayTimeout':_0x28186d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x28186d['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x28186d[_0xdf8c('0x3e')],'outboundOriginateFailureCallsDay':_0x28186d[_0xdf8c('0x3f')],'outboundReCallsDay':_0x28186d[_0xdf8c('0x40')],'outboundRejectCallsDay':_0x28186d[_0xdf8c('0x41')],'outboundUnknownCallsDay':_0x28186d[_0xdf8c('0x42')],'outboundAbandonedCallsDay':_0x28186d[_0xdf8c('0x43')],'predictiveIntervalAnsweredCalls':_0x28186d[_0xdf8c('0x44')],'predictiveIntervalAvgHoldtime':_0x28186d[_0xdf8c('0x45')],'predictiveIntervalAvgTalktime':_0x28186d[_0xdf8c('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x28186d[_0xdf8c('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x28186d[_0xdf8c('0x48')],'predictiveIntervalErlangCalls':_0x28186d['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x28186d[_0xdf8c('0x49')],'predictiveIntervalHitRate':_0x28186d[_0xdf8c('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x28186d[_0xdf8c('0x4b')],'predictiveIntervalPauses':_0x28186d[_0xdf8c('0x4c')],'predictiveIntervalAvailable':_0x28186d['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x28186d[_0xdf8c('0x4d')],'message':_0x28186d[_0xdf8c('0x4e')],'originated':_0x28186d[_0xdf8c('0x4f')],'erlangCalls':_0x28186d[_0xdf8c('0x50')],'erlangCallToSecond':_0x28186d['erlangCallToSecond'],'erlangAbandonmentRate':_0x28186d[_0xdf8c('0x51')],'erlangBusyFactor':_0x28186d[_0xdf8c('0x52')],'startPredictive':_0x28186d[_0xdf8c('0x53')],'startProgressive':_0x28186d[_0xdf8c('0x54')]};if(_0x28186d[_0xdf8c('0x55')]){_0x200992[_0xdf8c('0x55')]={'id':_0x28186d[_0xdf8c('0x55')]['id'],'name':_0x28186d[_0xdf8c('0x55')]['name'],'active':_0x28186d[_0xdf8c('0x55')]['active'],'callerid':_0x28186d[_0xdf8c('0x55')][_0xdf8c('0x56')]};}if(_0x28186d[_0xdf8c('0x57')]){_0x200992['Interval']={'id':_0x28186d[_0xdf8c('0x57')]['id'],'name':_0x28186d[_0xdf8c('0x57')][_0xdf8c('0x26')]};}var _0x27ef2c=md5(JSON['stringify'](_0x200992));if(_0x28186d[_0xdf8c('0x58')]!==_0x27ef2c){_0x28186d[_0xdf8c('0x58')]=_0x27ef2c;emit(util['format'](_0xdf8c('0x59'),_0x200992[_0xdf8c('0x26')]),_0xdf8c('0x5a'),_0x200992);}}}function emitVoiceQueueChannelRemove(_0x57fd98){logger[_0xdf8c('0x5b')](_0xdf8c('0x5c'),JSON['stringify'](_0x57fd98));emit(util['format'](_0xdf8c('0x59'),_0x57fd98[_0xdf8c('0x26')]),'voice_queue_channel:remove',_0x57fd98);io[_0xdf8c('0x5d')](_0xdf8c('0x5e'),_0x57fd98);}function notSendMessagesQueue(_0x37b351){if(_0x37b351[_0xdf8c('0x5f')]){if(_0x37b351[_0xdf8c('0x4f')]===0x0&&_0x37b351['pTalking']===0x0){_0x37b351[_0xdf8c('0x5f')]=![];_0x37b351[_0xdf8c('0x29')]=0x0;_0x37b351[_0xdf8c('0x60')]=0x0;_0x37b351[_0xdf8c('0x4e')]=_0xdf8c('0x61');ut[_0xdf8c('0x62')](_0xdf8c('0x63'),_0x37b351[_0xdf8c('0x26')]+_0xdf8c('0x64'));}else{_0x37b351[_0xdf8c('0x4e')]=_0xdf8c('0x65');ut[_0xdf8c('0x62')](_0xdf8c('0x63'),_0x37b351['name']+_0xdf8c('0x66'));}emitCampaignPreview(_0x37b351);}}Preview[_0xdf8c('0xf')][_0xdf8c('0x67')]=function(){var _0x49c45c=this;setInterval(function(){_0x49c45c[_0xdf8c('0x68')]();},0x7cf);};Preview[_0xdf8c('0xf')]['syncCampaigns']=function(){var _0x475bb0=this[_0xdf8c('0x14')];this[_0xdf8c('0x18')]+=0x1;for(var _0x3d69b1 in _0x475bb0){if(_0x475bb0['hasOwnProperty'](_0x3d69b1)&&(_0x475bb0[_0x3d69b1][_0xdf8c('0x69')]===_0xdf8c('0x7')||_0x475bb0[_0x3d69b1]['dialMethod']===_0xdf8c('0x6a'))&&_0x475bb0[_0x3d69b1]['type']===_0xdf8c('0x25')){if(this[_0xdf8c('0x18')]>0x7){this[_0xdf8c('0x18')]=0x0;this[_0xdf8c('0x6b')]();}}if(_0x475bb0[_0xdf8c('0x6c')](_0x3d69b1)&&_0x475bb0[_0x3d69b1][_0xdf8c('0x69')]===_0xdf8c('0x7')&&_0x475bb0[_0x3d69b1]['type']===_0xdf8c('0x25')){if(_0x475bb0[_0x3d69b1][_0xdf8c('0x33')]){this[_0xdf8c('0x6d')](_0x475bb0[_0x3d69b1]);if(_0x475bb0[_0x3d69b1]['dialPreviewAutoRecallMe'])this[_0xdf8c('0x6e')](_0x475bb0[_0x3d69b1]);}else{notSendMessagesQueue(_0x475bb0[_0x3d69b1]);}}}};Preview[_0xdf8c('0xf')][_0xdf8c('0x6f')]=function(_0x33e882){var _0x31a308=this;this['sequence'][_0xdf8c('0x10')](function(){if(!_['isNil'](_0x31a308[_0xdf8c('0x16')][_0x33e882])){loggerAction[_0xdf8c('0x5b')]('[clearZombieChannels][talking]',_0x33e882,_0xdf8c('0x70'),_0x31a308[_0xdf8c('0x16')][_0x33e882][_0xdf8c('0x71')],_0xdf8c('0x72'),JSON[_0xdf8c('0x73')](_0x31a308[_0xdf8c('0x14')][_0x31a308['actions'][_0x33e882]['queue']][_0xdf8c('0x4f')]),_0xdf8c('0x74'),JSON[_0xdf8c('0x73')](_0x31a308[_0xdf8c('0x14')][_0x31a308[_0xdf8c('0x16')][_0x33e882]['queue']][_0xdf8c('0x2b')]),JSON[_0xdf8c('0x73')](_0x31a308['actions'][_0x33e882][_0xdf8c('0x75')]),JSON['stringify'](_[_0xdf8c('0x76')](_0x31a308[_0xdf8c('0x16')][_0x33e882],[_0xdf8c('0x77'),_0xdf8c('0x78'),'VoiceQueueId',_0xdf8c('0x79')])));return ami[_0xdf8c('0x7a')]({'action':_0xdf8c('0x7b'),'channel':_0x31a308[_0xdf8c('0x16')][_0x33e882][_0xdf8c('0x7c')]})[_0xdf8c('0x7d')](function(_0xa408a6){if(_0xa408a6[_0xdf8c('0x4e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x31a308[_0xdf8c('0x16')][_0x33e882]){ut[_0xdf8c('0x7e')](_0x31a308[_0xdf8c('0x14')][_0x31a308['actions'][_0x33e882][_0xdf8c('0x71')]],_0xdf8c('0x7f'));if(_0x31a308[_0xdf8c('0x16')][_0x33e882][_0xdf8c('0x75')]===!![]){ut[_0xdf8c('0x80')](_0x31a308['campaignsPreview'][_0x31a308['actions'][_0x33e882][_0xdf8c('0x71')]],_0xdf8c('0x7f'));ut[_0xdf8c('0x81')]('[Dialer][checkChannel][pTalking][Preview]'+_0x33e882,_0x31a308[_0xdf8c('0x16')][_0x33e882]['queue']);}ut[_0xdf8c('0x81')](_0xdf8c('0x82')+_0x33e882,_0x31a308[_0xdf8c('0x16')][_0x33e882][_0xdf8c('0x71')]);delete _0x31a308[_0xdf8c('0x16')][_0x33e882];}},0x2328);}});}});};Preview[_0xdf8c('0xf')][_0xdf8c('0x6b')]=function(){var _0xccd64f=this;loggerAction[_0xdf8c('0x5b')](_0xdf8c('0x83'),_[_0xdf8c('0x84')](this[_0xdf8c('0x16')]));for(var _0x2f5c9b in this[_0xdf8c('0x16')]){if(_0xccd64f[_0xdf8c('0x16')][_0xdf8c('0x6c')](_0x2f5c9b)){_0xccd64f[_0xdf8c('0x6f')](_0x2f5c9b);}}};Preview[_0xdf8c('0xf')]['recallMe']=function(_0xf6d3){var _0x1b6a6e=this;rpcDb[_0xdf8c('0x85')](_0xf6d3['id'],ut[_0xdf8c('0x86')](this[_0xdf8c('0x17')]))[_0xdf8c('0x87')](function(_0x531d57){if(!_[_0xdf8c('0x88')](_0x531d57)){for(var _0x2c2fa1=0x0;_0x2c2fa1<_0x531d57[_0xdf8c('0x89')];_0x2c2fa1+=0x1){if(ut['getDiff'](_0x531d57[_0x2c2fa1][_0xdf8c('0x8a')])<_0xf6d3[_0xdf8c('0x8b')]*0x3c){if(_0x531d57[_0x2c2fa1]['Agent']&&!_0x531d57[_0x2c2fa1][_0xdf8c('0x8c')]['voicePause']){_0x1b6a6e[_0xdf8c('0x8d')](_0x531d57[_0x2c2fa1]['id'])['then'](ut[_0xdf8c('0x8e')](_0xdf8c('0x8f')))[_0xdf8c('0x7d')](ut[_0xdf8c('0x8e')](_0xdf8c('0x8f')));}else{rpcDb[_0xdf8c('0x90')](_0x531d57[_0x2c2fa1]['id']);}}else{var _0x4b29ef=new Action(_0x531d57[_0x2c2fa1],_0xf6d3);_0x4b29ef[_0xdf8c('0x91')]=moment()[_0xdf8c('0x92')]('YYYY-MM-DD\x20HH:mm:ss');_0xf6d3[_0xdf8c('0x40')]+=0x1;ut[_0xdf8c('0x93')](_0x4b29ef,0x17,_0xdf8c('0x94'));if(_0xf6d3['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xdf8c('0x95')](_0x531d57[_0x2c2fa1]));rpcDb[_0xdf8c('0x96')](_0x4b29ef,_0xdf8c('0x97'));}else{ut[_0xdf8c('0x93')](_0x4b29ef,0x16,_0xdf8c('0x98'));rpcDb[_0xdf8c('0x96')](_0x4b29ef,_0xdf8c('0x99'));rpcDb['createCustomerFinal'](_0x4b29ef,_0xdf8c('0x99'));}}}}})[_0xdf8c('0x7d')](ut[_0xdf8c('0x8e')](_0xdf8c('0x9a')));};Preview[_0xdf8c('0xf')]['setMessage']=function(_0x55a910){_0x55a910[_0xdf8c('0x5f')]=!![];if(ut['IsNotLoggedIn'](_0x55a910[_0xdf8c('0x2a')])){_0x55a910['message']=_0xdf8c('0x9b');}else if(!ut['isActive'](_0x55a910[_0xdf8c('0x33')])){_0x55a910['message']='NOT_ACTIVE';}else if(!this[_0xdf8c('0x9c')](_0x55a910[_0xdf8c('0x55')])){if(!this[_0xdf8c('0x9c')](_0x55a910[_0xdf8c('0x9d')])){_0x55a910['message']=_0xdf8c('0x9e');}else{_0x55a910[_0xdf8c('0x4e')]=_0xdf8c('0x9f');}}else{_0x55a910[_0xdf8c('0x4e')]=_0xdf8c('0x9f');}emitCampaignPreview(_0x55a910);};Preview[_0xdf8c('0xf')][_0xdf8c('0xa0')]=function(_0x48544a,_0x35279e,_0x1b1dcc){var _0xb7482e=this;var _0x5c9faf=this[_0xdf8c('0x16')][_0x35279e];var _0x1a36dc=this[_0xdf8c('0x14')][_0x5c9faf[_0xdf8c('0x71')]];var _0x243d51;var _0x45e6c4=![];var _0x300311=0x2;var _0x508ca9=0x3;if(_0x1a36dc){switch(_0x1b1dcc){case'1':_0x1a36dc[_0xdf8c('0x3e')]+=0x1;_0x5c9faf['countnosuchnumberretry']+=0x1;_0x5c9faf[_0xdf8c('0xa1')]=ut[_0xdf8c('0xa2')](_0x5c9faf);ut[_0xdf8c('0x93')](_0x5c9faf,0x0,_0xdf8c('0xa3'));ami[_0xdf8c('0x5d')](_0xdf8c('0xa4'),ut['buildObj'](_0x5c9faf,_0xdf8c('0xa5')));rpcDb[_0xdf8c('0x96')](_0x5c9faf,_0xdf8c('0xa6'));_0xb7482e[_0xdf8c('0xa7')](_0x5c9faf,'0',_0x1a36dc)[_0xdf8c('0x87')](function(_0x245d5b){_0x45e6c4=_0x245d5b[_0xdf8c('0xa8')]==0x1;_0x300311=_0x1a36dc[_0xdf8c('0xa9')];_0x508ca9=_0x1a36dc[_0xdf8c('0xaa')];if(!_0x45e6c4){if(ut[_0xdf8c('0xa2')](_0x5c9faf)>=_0x1a36dc[_0xdf8c('0xab')]){_0x243d51=ut['cloneAction'](_0x5c9faf,0xf,'Global');rpcDb[_0xdf8c('0xac')](_0x243d51,_0xdf8c('0xad'));}else{if(_0x5c9faf[_0xdf8c('0xae')]>=_0x1a36dc[_0xdf8c('0xaf')]){rpcDb['createCustomerFinal'](_0x5c9faf,_0xdf8c('0xad'));}else{rpcDb[_0xdf8c('0xb0')](ut[_0xdf8c('0xb1')](_0x5c9faf,_0xdf8c('0xae'),_0x1a36dc['dialNoSuchNumberRetryFrequency']),_0x5c9faf[_0xdf8c('0xb2')],_0x5c9faf[_0xdf8c('0xb3')]);}}delete this[_0xdf8c('0x16')][_0x48544a['linkedid']];}else{_0x5c9faf[_0xdf8c('0xae')]++;logger[_0xdf8c('0x5b')](_0xdf8c('0xb4'),_0x5c9faf[_0xdf8c('0xae')]);logger['info']('id',_0x5c9faf[_0xdf8c('0xb5')]);_0xb7482e[_0xdf8c('0xb6')]({'id':_0x5c9faf[_0xdf8c('0xb5')],'field':{'countnosuchnumberretry':_0x5c9faf['countnosuchnumberretry']}})['then'](function(){_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)[_0xdf8c('0x87')](function(){});});}});break;case _0xdf8c('0xb8'):var _0x5a8018=moment()['format'](_0xdf8c('0xb9'));_0x5c9faf['responsetime']=_0x5a8018;_0x5c9faf[_0xdf8c('0xba')]=_0x5a8018;_0x5c9faf[_0xdf8c('0x75')]=!![];_0x1a36dc['pTalking']+=0x1;logger[_0xdf8c('0x5b')](_0xdf8c('0xbb'),_0x5c9faf[_0xdf8c('0xbc')],'\x20Queue',_0x1a36dc[_0xdf8c('0x26')],_0xdf8c('0x74'),_0x1a36dc['pTalking']);ami[_0xdf8c('0x5d')]('custom:agentconnect',ut[_0xdf8c('0xbd')](_0x5c9faf,_0xdf8c('0xbe'),this[_0xdf8c('0x14')][_0x5c9faf[_0xdf8c('0x71')]]));if(_0x1a36dc['acw']){ami['emit'](_0xdf8c('0xbf'),ut['buildAcw'](_0x5c9faf));}break;case'16':ami['emit'](_0xdf8c('0xc0'),ut[_0xdf8c('0xbd')](_0x5c9faf,'complete',this[_0xdf8c('0x14')][_0x5c9faf['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5c9faf,_0xdf8c('0xc1')));_0x1a36dc[_0xdf8c('0x39')]+=0x1;_0x1a36dc[_0xdf8c('0xc2')]+=0x1;_0x1a36dc['answered']+=0x1;ut['decrementTalkink'](_0x1a36dc,_0xdf8c('0xc3'));_0x5c9faf['countglobal']=ut[_0xdf8c('0xa2')](_0x5c9faf);ut['logCustomer'](_0x5c9faf,0x4,_0xdf8c('0xc4'));rpcDb[_0xdf8c('0x96')](_0x5c9faf,_0xdf8c('0xc5'));rpcDb[_0xdf8c('0xac')](_0x5c9faf,_0xdf8c('0xc6'));rpcDb[_0xdf8c('0xc7')](_0x5c9faf);_0x1a36dc['sumDuration']+=_0x5c9faf['talktime'];_0x1a36dc['sumBillable']+=_0x5c9faf[_0xdf8c('0xc8')];logger[_0xdf8c('0x5b')]('[syncHangup][talking][decrement]',_0x5c9faf[_0xdf8c('0xbc')],'\x20Queue',_0x1a36dc[_0xdf8c('0x26')],'pTalking:\x20',_0x1a36dc[_0xdf8c('0x2b')]);delete this['actions'][_0x48544a['linkedid']];break;case _0xdf8c('0xc9'):_0x1a36dc[_0xdf8c('0x3a')]+=0x1;_0x5c9faf[_0xdf8c('0xca')]+=0x1;_0x5c9faf[_0xdf8c('0xa1')]=ut['totalGlobal'](_0x5c9faf);ut[_0xdf8c('0x93')](_0x5c9faf,0x5,_0xdf8c('0xcb'));_0x300311=_0x1a36dc['dialBusyRetryFrequency'];_0x508ca9=_0x1a36dc['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0xdf8c('0xbd')](_0x5c9faf,_0xdf8c('0xcc')));rpcDb['createCustomerHistory'](_0x5c9faf,_0xdf8c('0xcd'));_0xb7482e[_0xdf8c('0xa7')](_0x5c9faf,'5',_0x1a36dc)['then'](function(_0x5d79c5){_0x45e6c4=_0x5d79c5[_0xdf8c('0xa8')]==0x1;if(!_0x45e6c4){if(ut['totalGlobal'](_0x5c9faf)>=_0x1a36dc[_0xdf8c('0xab')]){_0x243d51=ut[_0xdf8c('0xce')](_0x5c9faf,0xf,_0xdf8c('0xcf'));rpcDb[_0xdf8c('0xac')](_0x243d51,_0xdf8c('0xd0'));}else{if(_0x5c9faf[_0xdf8c('0xca')]>=_0x1a36dc['dialBusyMaxRetry']){rpcDb[_0xdf8c('0xac')](_0x5c9faf,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xdf8c('0xb0')](ut[_0xdf8c('0xb1')](_0x5c9faf,_0xdf8c('0xca'),_0x1a36dc[_0xdf8c('0xd1')]),_0x5c9faf[_0xdf8c('0xb2')],_0x5c9faf['activeContact']);}}}else{_0x5c9faf[_0xdf8c('0xca')]++;_0xb7482e['incrementPreviewCounters']({'id':_0x5c9faf[_0xdf8c('0xb5')],'field':{'countbusyretry':_0x5c9faf[_0xdf8c('0xca')]}})[_0xdf8c('0x87')](function(){_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)['then'](function(){});});}});break;case'NOANSWER':_0x1a36dc[_0xdf8c('0xd2')]+=0x1;_0x5c9faf[_0xdf8c('0xd3')]+=0x1;_0x5c9faf[_0xdf8c('0xa1')]=ut[_0xdf8c('0xa2')](_0x5c9faf);ut[_0xdf8c('0x93')](_0x5c9faf,0x3,_0xdf8c('0xd4'));_0x300311=_0x1a36dc[_0xdf8c('0xd5')];_0x508ca9=_0x1a36dc[_0xdf8c('0xaa')];var _0x214a08=ut[_0xdf8c('0xd6')](_0x5c9faf,_0x1a36dc);ami['emit'](_0xdf8c('0xd7'),_0x214a08);rpcDb['createCustomerHistory'](_0x5c9faf,_0xdf8c('0xd8'));_0xb7482e[_0xdf8c('0xa7')](_0x5c9faf,'3',_0x1a36dc)['then'](function(_0x4d3450){_0x45e6c4=_0x4d3450[_0xdf8c('0xa8')]==0x1;if(!_0x45e6c4){if(ut[_0xdf8c('0xa2')](_0x5c9faf)>=_0x1a36dc[_0xdf8c('0xab')]){_0x243d51=ut[_0xdf8c('0xce')](_0x5c9faf,0xf,'Global');rpcDb[_0xdf8c('0xac')](_0x243d51,_0xdf8c('0xd9'));}else{if(_0x5c9faf[_0xdf8c('0xd3')]>=_0x1a36dc['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x5c9faf,_0xdf8c('0xd8'));}else{rpcDb[_0xdf8c('0xb0')](ut[_0xdf8c('0xb1')](_0x5c9faf,_0xdf8c('0xd3'),_0x1a36dc[_0xdf8c('0xd5')]),_0x5c9faf['unlockAgent'],_0x5c9faf['activeContact']);}}}else{_0x5c9faf['countnoanswerretry']++;_0xb7482e[_0xdf8c('0xb6')]({'id':_0x5c9faf['idContact'],'field':{'countnoanswerretry':_0x5c9faf[_0xdf8c('0xd3')]}})[_0xdf8c('0x87')](function(){_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)[_0xdf8c('0x87')](function(){});});}});break;case _0xdf8c('0xda'):_0x1a36dc[_0xdf8c('0x3b')]+=0x1;_0x5c9faf['countcongestionretry']+=0x1;_0x5c9faf['countglobal']=ut[_0xdf8c('0xa2')](_0x5c9faf);ut['logCustomer'](_0x5c9faf,0x8,'Congestion');_0x300311=_0x1a36dc[_0xdf8c('0xdb')];_0x508ca9=_0x1a36dc[_0xdf8c('0xaa')];ami['emit'](_0xdf8c('0xdc'),ut[_0xdf8c('0xbd')](_0x5c9faf,_0xdf8c('0xdd')));rpcDb['createCustomerHistory'](_0x5c9faf,_0xdf8c('0xde'));_0xb7482e['verifyAdditionalPhones'](_0x5c9faf,'8',_0x1a36dc)[_0xdf8c('0x87')](function(_0x5e7dae){_0x45e6c4=_0x5e7dae[_0xdf8c('0xa8')]==0x1;if(!_0x45e6c4){if(ut[_0xdf8c('0xa2')](_0x5c9faf)>=_0x1a36dc['dialGlobalMaxRetry']){_0x243d51=ut[_0xdf8c('0xce')](_0x5c9faf,0xf,_0xdf8c('0xcf'));rpcDb[_0xdf8c('0xac')](_0x243d51,_0xdf8c('0xdf'));}else{if(_0x5c9faf[_0xdf8c('0xe0')]>=_0x1a36dc['dialCongestionMaxRetry']){rpcDb[_0xdf8c('0xac')](_0x5c9faf,_0xdf8c('0xde'));}else{rpcDb['rescheduleContact'](ut[_0xdf8c('0xb1')](_0x5c9faf,_0xdf8c('0xe0'),_0x1a36dc[_0xdf8c('0xd1')]),_0x5c9faf[_0xdf8c('0xb2')],_0x5c9faf[_0xdf8c('0xb3')]);}}}else{_0x5c9faf[_0xdf8c('0xe0')]++;_0xb7482e['incrementPreviewCounters']({'id':_0x5c9faf[_0xdf8c('0xb5')],'field':{'countcongestionretry':_0x5c9faf['countcongestionretry']}})[_0xdf8c('0x87')](function(){_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)[_0xdf8c('0x87')](function(){});});}});break;case _0xdf8c('0xe1'):_0x1a36dc[_0xdf8c('0x41')]+=0x1;_0x5c9faf[_0xdf8c('0xe2')]+=0x1;_0x5c9faf[_0xdf8c('0xa1')]=ut[_0xdf8c('0xa2')](_0x5c9faf);ut[_0xdf8c('0x93')](_0x5c9faf,0x14,'AgentReject');_0x300311=_0x1a36dc[_0xdf8c('0xe3')];_0x508ca9=_0x1a36dc[_0xdf8c('0xaa')];ami[_0xdf8c('0x5d')](_0xdf8c('0xe4'),ut[_0xdf8c('0xbd')](_0x5c9faf,'agentreject'));rpcDb['createCustomerHistory'](_0x5c9faf,'[syncHangupRequest][logAgentReject]');_0xb7482e[_0xdf8c('0xa7')](_0x5c9faf,'20',_0x1a36dc)[_0xdf8c('0x87')](function(_0x8a1fde){_0x45e6c4=_0x8a1fde[_0xdf8c('0xa8')]==0x1;if(!_0x45e6c4){if(ut['totalGlobal'](_0x5c9faf)>=_0x1a36dc[_0xdf8c('0xab')]){_0x243d51=ut[_0xdf8c('0xce')](_0x5c9faf,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x243d51,_0xdf8c('0xe5'));}else{if(_0x5c9faf[_0xdf8c('0xe2')]>=_0x1a36dc[_0xdf8c('0xe6')]){rpcDb['createCustomerFinal'](_0x5c9faf,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xdf8c('0xb0')](ut[_0xdf8c('0xb1')](_0x5c9faf,'countagentrejectretry',_0x1a36dc['dialAgentRejectRetryFrequency']),_0x5c9faf[_0xdf8c('0xb2')],_0x5c9faf['activeContact']);}}}else{_0x5c9faf['countnoanswerretry']++;_0xb7482e[_0xdf8c('0xb6')]({'id':_0x5c9faf[_0xdf8c('0xb5')],'field':{'countnoanswerretry':_0x5c9faf[_0xdf8c('0xd3')]}})['then'](function(){_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)[_0xdf8c('0x87')](function(){});});}});break;case _0xdf8c('0xe7'):_0x1a36dc[_0xdf8c('0x43')]+=0x1;_0x5c9faf['countabandonedretry']+=0x1;_0x5c9faf['countglobal']=ut[_0xdf8c('0xa2')](_0x5c9faf);ut['logCustomer'](_0x5c9faf,0xb,_0xdf8c('0xe8'));rpcDb[_0xdf8c('0x96')](_0x5c9faf,_0xdf8c('0xe9'));_0xb7482e[_0xdf8c('0xa7')](_0x5c9faf,'11',_0x1a36dc)[_0xdf8c('0x87')](function(_0x2a069d){_0x45e6c4=_0x2a069d[_0xdf8c('0xa8')]==0x1;if(!_0x45e6c4){if(ut['totalGlobal'](_0x5c9faf)>=_0x1a36dc[_0xdf8c('0xab')]){_0x243d51=ut[_0xdf8c('0xce')](_0x5c9faf,0xf,_0xdf8c('0xcf'));rpcDb[_0xdf8c('0xac')](_0x243d51,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x5c9faf[_0xdf8c('0xea')]>=_0x1a36dc[_0xdf8c('0xeb')]){rpcDb[_0xdf8c('0xac')](_0x5c9faf,_0xdf8c('0xe9'));}else{rpcDb[_0xdf8c('0xb0')](ut[_0xdf8c('0xb1')](_0x5c9faf,_0xdf8c('0xec'),_0x1a36dc['dialAbandonedRetryFrequency']),_0x5c9faf[_0xdf8c('0xb2')],_0x5c9faf['activeContact']);}}}else{_0x5c9faf[_0xdf8c('0xd3')]++;_0xb7482e['incrementPreviewCounters']({'id':_0x5c9faf[_0xdf8c('0xb5')],'field':{'countnoanswerretry':_0x5c9faf[_0xdf8c('0xd3')]}})['then'](function(){_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)[_0xdf8c('0x87')](function(){});});}});break;case'18':_0x1a36dc['outboundUnknownCallsDay']+=0x1;_0x5c9faf[_0xdf8c('0xed')]+=0x1;_0x5c9faf[_0xdf8c('0xa1')]=ut[_0xdf8c('0xa2')](_0x5c9faf);ut[_0xdf8c('0x93')](_0x5c9faf,0x12,_0x48544a[_0xdf8c('0xee')]||_0x48544a[_0xdf8c('0xef')]);ami['emit'](_0xdf8c('0xf0'),ut[_0xdf8c('0xbd')](_0x5c9faf,'amd'));rpcDb[_0xdf8c('0x96')](_0x5c9faf,_0xdf8c('0xf1'));_0xb7482e['verifyAdditionalPhones'](_0x5c9faf,'18',_0x1a36dc)[_0xdf8c('0x87')](function(_0x3a9c3a){_0x45e6c4=_0x3a9c3a[_0xdf8c('0xa8')]==0x1;if(!_0x45e6c4){if(ut[_0xdf8c('0xa2')](_0x5c9faf)>=_0x1a36dc['dialGlobalMaxRetry']){_0x243d51=ut[_0xdf8c('0xce')](_0x5c9faf,0x12,'Global');rpcDb[_0xdf8c('0xac')](_0x243d51,_0xdf8c('0xf1'));}else{rpcDb[_0xdf8c('0xac')](_0x5c9faf,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x5c9faf[_0xdf8c('0xd3')]++;_0xb7482e['incrementPreviewCounters']({'id':_0x5c9faf['idContact'],'field':{'countnoanswerretry':_0x5c9faf[_0xdf8c('0xd3')]}})['then'](function(){_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)[_0xdf8c('0x87')](function(){});});}});delete this[_0xdf8c('0x16')][_0x48544a[_0xdf8c('0xf2')]];break;case'19':_0x1a36dc[_0xdf8c('0x42')]+=0x1;_0x5c9faf['countglobal']=ut['totalGlobal'](_0x5c9faf);ut['logCustomer'](_0x5c9faf,0x13,_0x48544a['cause-txt']||_0x48544a[_0xdf8c('0xef')]);ami[_0xdf8c('0x5d')](_0xdf8c('0xf0'),ut[_0xdf8c('0xbd')](_0x5c9faf,_0xdf8c('0xf3')));rpcDb[_0xdf8c('0x96')](_0x5c9faf,'[callProgressDetectingCustomer][machine]');_0xb7482e[_0xdf8c('0xa7')](_0x5c9faf,'18',_0x1a36dc)[_0xdf8c('0x87')](function(_0x7efc70){_0x45e6c4=_0x7efc70['additional']==0x1;if(!_0x45e6c4){if(ut[_0xdf8c('0xa2')](_0x5c9faf)>=_0x1a36dc[_0xdf8c('0xab')]){_0x243d51=ut[_0xdf8c('0xce')](_0x5c9faf,0xf,_0xdf8c('0xcf'));rpcDb['createCustomerFinal'](_0x243d51,_0xdf8c('0xf4'));}else{rpcDb[_0xdf8c('0xac')](_0x5c9faf,'[callProgressDetectingCustomer][machine]');}}else{_0x5c9faf[_0xdf8c('0xd3')]++;_0xb7482e[_0xdf8c('0xb6')]({'id':_0x5c9faf[_0xdf8c('0xb5')],'field':{'countnoanswerretry':_0x5c9faf[_0xdf8c('0xd3')]}})[_0xdf8c('0x87')](function(){_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)[_0xdf8c('0x87')](function(){});});}});delete this[_0xdf8c('0x16')][_0x48544a[_0xdf8c('0xf2')]];break;default:if(_0x5c9faf[_0xdf8c('0x75')]){ut[_0xdf8c('0x80')](_0x1a36dc,_0xdf8c('0xf5'));ut[_0xdf8c('0x81')](_0xdf8c('0xf6')+_0x1a36dc[_0xdf8c('0x26')],_0x48544a);}_0x1a36dc['outboundUnknownCallsDay']+=0x1;_0x5c9faf['countglobal']=ut['totalGlobal'](_0x5c9faf);ut[_0xdf8c('0x93')](_0x5c9faf,0xc,_0x48544a[_0xdf8c('0xee')]||_0x48544a[_0xdf8c('0xef')]);_0x300311=_0x1a36dc[_0xdf8c('0xe3')];_0x508ca9=_0x1a36dc[_0xdf8c('0xaa')];rpcDb[_0xdf8c('0x96')](_0x5c9faf,_0xdf8c('0xf7'));_0xb7482e[_0xdf8c('0xa7')](_0x5c9faf,'20',_0x1a36dc)[_0xdf8c('0x87')](function(_0x49d7b0){_0x45e6c4=_0x49d7b0[_0xdf8c('0xa8')]==0x1;if(!_0x45e6c4){if(ut[_0xdf8c('0xa2')](_0x5c9faf)>=_0x1a36dc[_0xdf8c('0xab')]){_0x243d51=ut[_0xdf8c('0xce')](_0x5c9faf,0xf,_0xdf8c('0xcf'));rpcDb[_0xdf8c('0xac')](_0x243d51,_0xdf8c('0xf8'));}else{rpcDb[_0xdf8c('0xac')](_0x5c9faf,_0xdf8c('0xf8'));}delete this['actions'][_0x48544a[_0xdf8c('0xf2')]];}else{_0xb7482e[_0xdf8c('0xb7')](_0x5c9faf,_0x300311,_0x508ca9)[_0xdf8c('0x87')](function(){});}});}if(!(_0x5c9faf[_0xdf8c('0x75')]&&_0x1b1dcc==='16')){ut['updateOriginated'](_0x1a36dc,_0xdf8c('0xf9'));logger[_0xdf8c('0x5b')]('[originated][decrement][callProgressDetectingCustomer]',_0x5c9faf[_0xdf8c('0xbc')],'\x20Queue',_0x1a36dc['name'],_0xdf8c('0x72'),_0x1a36dc['originated']);}if(_0x1b1dcc!=='ANSWER'){delete this[_0xdf8c('0x16')][_0x48544a[_0xdf8c('0xf2')]];delete this['actions'][_0x48544a[_0xdf8c('0xfa')]];}}};Preview[_0xdf8c('0xf')][_0xdf8c('0xfb')]=function(_0xa5c405,_0xcd9eb4,_0x46cc41){if(_[_0xdf8c('0xfc')](_0xcd9eb4)&&'object'!==typeof _0xcd9eb4){return;}if(_[_0xdf8c('0xfc')](_0x46cc41)&&_0xdf8c('0xfd')!==typeof _0x46cc41){return;}switch(_0x46cc41['reason']){case'0':ut[_0xdf8c('0xfe')](_0xa5c405,0x0,_0xdf8c('0xa3'));rpcDb[_0xdf8c('0xff')](_0xa5c405,_0xdf8c('0x100'));break;case'3':ut['logAgent'](_0xa5c405,0x3,'NoAnswer');rpcDb[_0xdf8c('0xff')](_0xa5c405,_0xdf8c('0x101'));break;case'5':ut[_0xdf8c('0xfe')](_0xa5c405,0x5,_0xdf8c('0xcb'));rpcDb[_0xdf8c('0xff')](_0xa5c405,_0xdf8c('0x102'));break;case'8':ut['logAgent'](_0xa5c405,0x8,_0xdf8c('0x103'));rpcDb[_0xdf8c('0xff')](_0xa5c405,_0xdf8c('0x104'));break;case'22':ut['logAgent'](_0xa5c405,0x16,_0xdf8c('0x105'));rpcDb['createAgentHistory'](_0xa5c405,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xdf8c('0xfe')](_0xa5c405,0xc,_0x46cc41[_0xdf8c('0x106')]);rpcDb['createAgentHistory'](_0xa5c405,_0xdf8c('0x104'));}ut[_0xdf8c('0x7e')](_0xcd9eb4,_0xdf8c('0x107'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0xa5c405['uniqueid'],'\x20Queue',_0xcd9eb4[_0xdf8c('0x26')],_0xdf8c('0x72'),_0xcd9eb4[_0xdf8c('0x4f')]);delete this[_0xdf8c('0x16')][_0xa5c405['uniqueid']];};Preview[_0xdf8c('0xf')][_0xdf8c('0xa7')]=function(_0x12fb48,_0x784eab,_0x235a48){return Promise['resolve']()[_0xdf8c('0x87')](cmHopperAdditionalPhone[_0xdf8c('0xa7')](_0x12fb48,_0x784eab,_0x235a48))['catch'](logger[_0xdf8c('0x5b')](_0xdf8c('0x108')));};Preview[_0xdf8c('0xf')][_0xdf8c('0xb7')]=function(_0x1e16d3,_0x1c1a4b,_0x51bbf1){return Promise[_0xdf8c('0x109')]()[_0xdf8c('0x87')](cmHopperAdditionalPhone[_0xdf8c('0xb7')](_0x1e16d3,_0x1c1a4b,_0x51bbf1))[_0xdf8c('0x7d')](logger[_0xdf8c('0x5b')](_0xdf8c('0x10a')));};Preview[_0xdf8c('0xf')]['incrementPreviewCounters']=function(_0x24d8e3){return Promise[_0xdf8c('0x109')]()[_0xdf8c('0x87')](cmHopperAdditionalPhone[_0xdf8c('0xb6')](_0x24d8e3))[_0xdf8c('0x7d')](logger[_0xdf8c('0x5b')]('[incrementPreviewCounters]\x20'));};Preview[_0xdf8c('0xf')]['checkInBlack']=function(_0x1bd04b,_0x2789aa,_0x300930,_0xa08470,_0x22da59){var _0x200ca3=this;return new Promise(function(_0x203317,_0x1e4464){if(_[_0xdf8c('0x88')](_0x2789aa)||_[_0xdf8c('0x88')](_0x2789aa[_0xdf8c('0x10b')])||_['isNil'](_0x2789aa[_0xdf8c('0x10c')])||_[_0xdf8c('0x88')](_0x2789aa[_0xdf8c('0x10d')])){_0x1e4464(ut[_0xdf8c('0x4e')](_0xdf8c('0x10e'),_0xa08470,_0x22da59));return;}var _0x212afe=uuid['v4']();var _0x1a99c0=_0x200ca3[_0xdf8c('0x14')][_0x2789aa[_0xdf8c('0x70')][_0xdf8c('0x26')]];var _0xa9ae03=_0x300930?_0x200ca3['agents'][_0x300930]['id']:undefined;_0x200ca3[_0xdf8c('0x16')][_0x212afe]=new Action(_0x2789aa,_0x1a99c0,_0x212afe,_0x300930,_0xa9ae03);var _0x1ce75f=_0x200ca3['actions'][_0x212afe];_0x1ce75f[_0xdf8c('0xb2')]=_0xa08470;_0x1ce75f[_0xdf8c('0xb3')]=_0x22da59;_0x1ce75f[_0xdf8c('0x10f')]=_0x300930;if(_[_0xdf8c('0x110')](_0x1bd04b)){_0x200ca3[_0xdf8c('0x111')](_0x1ce75f,_0x1a99c0,_0x2789aa,_0x300930)[_0xdf8c('0x87')](function(_0x1b98f6){logger[_0xdf8c('0x5b')]('[Preview][execCall][success]','Queue:\x20'+_0x1ce75f[_0xdf8c('0x71')]+_0xdf8c('0x112')+_0x1ce75f[_0xdf8c('0xb5')],JSON[_0xdf8c('0x73')](_0x1b98f6));ami[_0xdf8c('0x5d')](_0xdf8c('0x113'),ut[_0xdf8c('0xbd')](_0x1ce75f,_0xdf8c('0x114'),_0x200ca3[_0xdf8c('0x14')][_0x1ce75f[_0xdf8c('0x71')]]));_0x203317(ut[_0xdf8c('0x4e')](_0xdf8c('0x115')));})['catch'](function(_0x3917c2){ut['logger'](_0xdf8c('0x116'),_0x3917c2);_0x1e4464(ut['message'](_0xdf8c('0x117'),_0xa08470,_0x22da59));});}else{_0x1a99c0[_0xdf8c('0x118')]+=0x1;ut[_0xdf8c('0x119')](_0x1ce75f);rpcDb['createHistory'](_0x1ce75f,_0xdf8c('0x11a'));delete _0x200ca3[_0xdf8c('0x16')][_0x212afe];_0x1e4464(ut[_0xdf8c('0x4e')](_0xdf8c('0x11b'),_0xa08470,_0x22da59));}});};Preview[_0xdf8c('0xf')][_0xdf8c('0x9c')]=function(_0x4f710b){return!_['isNil'](_0x4f710b)&&!_[_0xdf8c('0x88')](_0x4f710b[_0xdf8c('0x26')])&&!_[_0xdf8c('0x88')](_0x4f710b[_0xdf8c('0x11c')])&&_0x4f710b['active']&&!_[_0xdf8c('0x88')](this[_0xdf8c('0x15')][util['format'](_0xdf8c('0x11d'),_0x4f710b[_0xdf8c('0x26')])])&&!_[_0xdf8c('0x88')](this[_0xdf8c('0x15')][util[_0xdf8c('0x92')](_0xdf8c('0x11d'),_0x4f710b[_0xdf8c('0x26')])][_0xdf8c('0x7b')])&&(this['trunks'][util[_0xdf8c('0x92')]('SIP/%s',_0x4f710b[_0xdf8c('0x26')])][_0xdf8c('0x7b')]===_0xdf8c('0x11e')||this[_0xdf8c('0x15')][util[_0xdf8c('0x92')](_0xdf8c('0x11d'),_0x4f710b['name'])][_0xdf8c('0x7b')]===_0xdf8c('0x11f'));};Preview[_0xdf8c('0xf')]['run']=function(_0x281f7f,_0x36a703){var _0x59cdc8=this;return new Promise(function(_0x549ac0,_0x3dc21c){_0x59cdc8['execRun'](_0x281f7f,_0x36a703)[_0xdf8c('0x87')](function(_0x21290b){_0x549ac0(_[_0xdf8c('0x76')](_0x21290b,[_0xdf8c('0x4e')]));})[_0xdf8c('0x7d')](function(_0x1a9568){if(_0x1a9568[_0xdf8c('0x120')]){rpcDb[_0xdf8c('0x121')](_0x281f7f);}if(_0x1a9568[_0xdf8c('0x11c')]){rpcDb[_0xdf8c('0x90')](_0x281f7f);}_0x3dc21c(_[_0xdf8c('0x76')](_0x1a9568,[_0xdf8c('0x4e')]));});});};Preview[_0xdf8c('0xf')][_0xdf8c('0x122')]=function(_0xcd7c1d,_0x278d4a){var _0x35a7a7=this;return new Promise(function(_0x39d06c,_0x57f17d){var _0x26944e,_0x35a6ad;rpcDb['getContactPreview'](_0xcd7c1d)[_0xdf8c('0x87')](function(_0x11ba30){if(!_['isNil'](_0x11ba30[0x0])){_0x35a6ad=_0x11ba30[0x0]['recallme']?![]:!![];_0x26944e=_0x11ba30[0x0]['recallme']?!![]:![];_0x26944e=_0x278d4a?!![]:_0x26944e;}var _0x3ffc77=_0x35a7a7['validateContact'](_0x11ba30);if(_0x3ffc77[_0xdf8c('0x123')]){rpcDb[_0xdf8c('0x124')](_[_0xdf8c('0x76')](_0x11ba30[0x0],[_0xdf8c('0x10d'),_0xdf8c('0x10c')]))[_0xdf8c('0x87')](function(_0x4485c1){_0x35a7a7[_0xdf8c('0x125')](_0x4485c1,_0x11ba30[0x0],_0x278d4a,_0x35a6ad,_0x26944e)['then'](function(_0x2dd44b){_0x39d06c(_0x2dd44b);})[_0xdf8c('0x7d')](function(_0x77fc77){_0x57f17d(_0x77fc77);});})[_0xdf8c('0x7d')](function(_0x463c34){ut[_0xdf8c('0x62')](_0xdf8c('0x126'),_0x463c34);_0x57f17d(ut[_0xdf8c('0x4e')](_0xdf8c('0x127'),_0x35a6ad,_0x26944e));});}else{_0x57f17d(ut[_0xdf8c('0x4e')](_0x3ffc77[_0xdf8c('0x4e')],_0x35a6ad,_0x26944e));}})[_0xdf8c('0x7d')](function(_0x1aaa5d){ut[_0xdf8c('0x62')](_0xdf8c('0x128'),_0x1aaa5d);_0x57f17d(ut[_0xdf8c('0x4e')](_0xdf8c('0x127'),![],!![]));});});};Preview[_0xdf8c('0xf')][_0xdf8c('0x129')]=function(_0x1cf8d6){if(_[_0xdf8c('0x88')](_0x1cf8d6)||_[_0xdf8c('0x110')](_0x1cf8d6)||!_['isNil'](_0x1cf8d6[0x0]['Agent'])&&_[_0xdf8c('0x88')](_0x1cf8d6[0x0]['Agent']['name'])){ut[_0xdf8c('0x62')](_0xdf8c('0x12a'),_0x1cf8d6);return{'isValid':![],'message':_0xdf8c('0x12b')};}var _0x5bde61=this[_0xdf8c('0x14')][_0x1cf8d6[0x0]['Queue'][_0xdf8c('0x26')]];_0x5bde61[_0xdf8c('0x4e')]=_0xdf8c('0x9f');if(_[_0xdf8c('0x88')](_0x5bde61)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x5bde61);return{'isValid':![],'message':_0xdf8c('0x12c')};}if(!this[_0xdf8c('0x9c')](_0x5bde61[_0xdf8c('0x55')])){ut[_0xdf8c('0x62')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xdf8c('0x12d')+_0x5bde61[_0xdf8c('0x26')]+_0xdf8c('0x12e'));if(!this[_0xdf8c('0x9c')](_0x5bde61[_0xdf8c('0x9d')])){ut['logger'](_0xdf8c('0x12f'),_0x5bde61[_0xdf8c('0x26')]+_0xdf8c('0x130'));return{'isValid':![],'message':_0xdf8c('0x131')};}}if(!ut[_0xdf8c('0x132')](_0x5bde61[_0xdf8c('0x33')])){ut[_0xdf8c('0x62')](_0xdf8c('0x133'),_0x5bde61['name']+_0xdf8c('0x134'));return{'isValid':![],'message':_0xdf8c('0x12d')+_0x5bde61[_0xdf8c('0x26')]+_0xdf8c('0x134')};}return{'isValid':!![],'message':_0xdf8c('0x135')};};Preview['prototype']['execCall']=function(_0x410219,_0x3c3fb8,_0x43c519,_0x17164f){var _0x1e22a2=this;return new Promise(function(_0xd89a58,_0xee320e){var _0x47a92c=_0x410219['uniqueid'];var _0xda7f57=_0x1e22a2[_0xdf8c('0x9c')](_0x3c3fb8[_0xdf8c('0x55')])?util[_0xdf8c('0x92')](_0xdf8c('0x136'),_0x3c3fb8[_0xdf8c('0x55')][_0xdf8c('0x26')],_[_0xdf8c('0x88')](_0x3c3fb8[_0xdf8c('0x37')])?'':_0x3c3fb8[_0xdf8c('0x37')]['trim']()||'',_0x3c3fb8['dialCutDigit']>0x0?_0x43c519[_0xdf8c('0x10c')][_0xdf8c('0x137')](_0x3c3fb8[_0xdf8c('0x138')]):_0x43c519[_0xdf8c('0x10c')]):util['format'](_0xdf8c('0x136'),_[_0xdf8c('0x88')](_0x3c3fb8[_0xdf8c('0x9d')])?_0x3c3fb8[_0xdf8c('0x55')][_0xdf8c('0x26')]:_0x3c3fb8[_0xdf8c('0x9d')]['name'],_[_0xdf8c('0x88')](_0x3c3fb8[_0xdf8c('0x37')])?'':_0x3c3fb8[_0xdf8c('0x37')][_0xdf8c('0x139')]()||'',_0x3c3fb8[_0xdf8c('0x138')]>0x0?_0x43c519[_0xdf8c('0x10c')]['substring'](_0x3c3fb8[_0xdf8c('0x138')]):_0x43c519['phone']);var _0x1f16e2=_0x1e22a2['isTrunkReachable'](_0x3c3fb8[_0xdf8c('0x55')])?ut[_0xdf8c('0x13a')](_0x3c3fb8[_0xdf8c('0x55')][_0xdf8c('0x56')],_0x3c3fb8[_0xdf8c('0x34')],_0x3c3fb8[_0xdf8c('0x13b')]>0x0?ut[_0xdf8c('0x13c')](_0x3c3fb8[_0xdf8c('0x35')],_0x3c3fb8['dialRandomLastDigitCallerIdNumber']):_0x3c3fb8[_0xdf8c('0x35')]):ut['getCallerId'](_[_0xdf8c('0x88')](_0x3c3fb8['TrunkBackup'])?_0x3c3fb8[_0xdf8c('0x55')][_0xdf8c('0x56')]:_0x3c3fb8[_0xdf8c('0x9d')][_0xdf8c('0x56')],_0x3c3fb8[_0xdf8c('0x34')],_0x3c3fb8[_0xdf8c('0x13b')]>0x0?ut[_0xdf8c('0x13c')](_0x3c3fb8[_0xdf8c('0x35')],_0x3c3fb8['dialRandomLastDigitCallerIdNumber']):_0x3c3fb8[_0xdf8c('0x35')]);if(_0x1f16e2){_0x410219[_0xdf8c('0x13d')]=ut[_0xdf8c('0x13e')](_0x1f16e2);_0x410219[_0xdf8c('0x13f')]=ut[_0xdf8c('0x140')](_0x1f16e2);}var _0xe84742=ut[_0xdf8c('0x141')](_0x3c3fb8,_0x43c519,_0xda7f57,_0x1f16e2,_0x47a92c,_0x410219);_[_0xdf8c('0x142')](_0x410219,ut[_0xdf8c('0x143')](_0xe84742));_0x410219['starttime']=moment()['format'](_0xdf8c('0xb9'));_0x3c3fb8[_0xdf8c('0x144')]=_0xe84742;ami['Action'](ut[_0xdf8c('0x145')](_0x410219,_0x3c3fb8,_0xe84742,_0x410219[_0xdf8c('0xb3')],_0x17164f))[_0xdf8c('0x87')](function(_0xd90154){_0x3c3fb8[_0xdf8c('0x4f')]+=0x1;logger[_0xdf8c('0x5b')](_0xdf8c('0x146'),_0x47a92c,_0xdf8c('0x147'),_0x3c3fb8['name'],'originated:\x20',_0x3c3fb8['originated']);_0xd89a58(_0xd90154);})[_0xdf8c('0x7d')](function(_0x274566){ut[_0xdf8c('0xfe')](_0x410219,0xe,'OriginateError');rpcDb[_0xdf8c('0xff')](_0x410219,_0xdf8c('0x148'));_0xee320e(_0x274566);});});};Preview[_0xdf8c('0xf')][_0xdf8c('0x149')]=function(_0x1a1369){if(this[_0xdf8c('0x16')][_0x1a1369[_0xdf8c('0xf2')]]){this['actions'][_0x1a1369['linkedid']][_0xdf8c('0x7c')]=_0x1a1369[_0xdf8c('0x7c')];}};Preview[_0xdf8c('0xf')][_0xdf8c('0x14a')]=function(_0x54d51d){var _0x182a78=this;var _0x3f8b67=this[_0xdf8c('0x16')][_0x54d51d[_0xdf8c('0x14b')]];if(_0x3f8b67){if(_0x3f8b67['lookAgent']&&this[_0xdf8c('0x17')][_0x3f8b67[_0xdf8c('0x10f')]]){ut[_0xdf8c('0x14c')](_0x3f8b67,this[_0xdf8c('0x17')][_0x3f8b67[_0xdf8c('0x10f')]][_0xdf8c('0x26')],this[_0xdf8c('0x17')][_0x3f8b67[_0xdf8c('0x10f')]]['id']);}var _0x45050c=_[_0xdf8c('0x14d')](_0x3f8b67);_0x45050c['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2dceb0=_0x182a78['campaignsPreview'][_0x3f8b67[_0xdf8c('0x71')]];if(ut[_0xdf8c('0x14e')](_0x54d51d[_0xdf8c('0x14f')])){if(_0x3f8b67['unlockAgent']){rpcDb['unlockContact'](_0x3f8b67[_0xdf8c('0xb5')]);}if(_0x3f8b67[_0xdf8c('0xb3')]){rpcDb[_0xdf8c('0x90')](_0x3f8b67[_0xdf8c('0xb5')]);}ami[_0xdf8c('0x5d')](_0xdf8c('0x150'),ut[_0xdf8c('0xbd')](_0x3f8b67,_0xdf8c('0x151'),this[_0xdf8c('0x14')][_0x3f8b67[_0xdf8c('0x71')]]));this['callProgressDetectingAgent'](_0x45050c,_0x2dceb0,_0x54d51d);}else{_0x3f8b67['starttime']=moment()[_0xdf8c('0x92')](_0xdf8c('0xb9'));ut[_0xdf8c('0xfe')](_0x45050c,0x4,_0xdf8c('0xc4'));rpcDb[_0xdf8c('0xff')](_0x45050c,_0xdf8c('0x152'));}}};Preview[_0xdf8c('0xf')][_0xdf8c('0x1c')]=function(_0x29e77c){var _0x150b5d=this['actions'][_0x29e77c[_0xdf8c('0xf2')]];var _0x3cde6d;if(_0x150b5d){_0x3cde6d=this[_0xdf8c('0x14')][_0x150b5d[_0xdf8c('0x71')]];logger[_0xdf8c('0x5b')](_0xdf8c('0x153'),_0x29e77c[_0xdf8c('0xf2')],_0xdf8c('0x147'),_0x3cde6d['name'],_0xdf8c('0x74'),_0x3cde6d[_0xdf8c('0x2b')]);}if(this[_0xdf8c('0x16')][_0x29e77c[_0xdf8c('0xf2')]]&&_0x29e77c[_0xdf8c('0xf2')]!==_0x29e77c[_0xdf8c('0xbc')]){if(_0x29e77c[_0xdf8c('0x154')]==='16'&&this[_0xdf8c('0x16')][_0x29e77c[_0xdf8c('0xf2')]][_0xdf8c('0x75')]){this['callProgressDetectingCustomer'](_0x29e77c,_0x29e77c[_0xdf8c('0xf2')],_0x29e77c[_0xdf8c('0x154')]);}else if(this[_0xdf8c('0x16')][_0x29e77c[_0xdf8c('0xf2')]][_0xdf8c('0x75')]){logger[_0xdf8c('0x5b')]('[syncHangup][talking][cause]',_0x29e77c['linkedid'],_0x29e77c[_0xdf8c('0x154')],_0xdf8c('0x147'),_0x3cde6d[_0xdf8c('0x26')],_0xdf8c('0x74'),_0x3cde6d[_0xdf8c('0x2b')]);this[_0xdf8c('0xa0')](_0x29e77c,_0x29e77c[_0xdf8c('0xf2')],_0x29e77c[_0xdf8c('0x154')]);}}else if(_0x150b5d&&_[_0xdf8c('0x88')](_0x150b5d[_0xdf8c('0x155')])&&_0x3cde6d[_0xdf8c('0x156')]&&_0x29e77c[_0xdf8c('0xf2')]===_0x29e77c[_0xdf8c('0xbc')]&&_[_0xdf8c('0x88')](_0x29e77c['reason'])&&_0x29e77c[_0xdf8c('0x154')]==='16'&&_0x29e77c[_0xdf8c('0x157')]==='6'&&_[_0xdf8c('0xfc')](_0x150b5d[_0xdf8c('0x158')])){if(_0x150b5d['unlockAgent']){rpcDb[_0xdf8c('0x121')](_0x150b5d[_0xdf8c('0xb5')]);}if(_0x150b5d['activeContact']){rpcDb[_0xdf8c('0x90')](_0x150b5d[_0xdf8c('0xb5')]);}_0x29e77c['reason']='22';this['callProgressDetectingAgent'](_0x150b5d,_0x3cde6d,_0x29e77c);}else if(_0x150b5d&&_0x150b5d[_0xdf8c('0x158')]){if(_0x29e77c[_0xdf8c('0x154')]==='16'&&this[_0xdf8c('0x16')][_0x29e77c[_0xdf8c('0xf2')]][_0xdf8c('0x75')]){logger[_0xdf8c('0x5b')](_0xdf8c('0x159'),_0x29e77c['linkedid'],_0x29e77c[_0xdf8c('0x154')],_0xdf8c('0x147'),_0x3cde6d['name'],'pTalking:\x20',_0x3cde6d['pTalking']);this[_0xdf8c('0xa0')](_0x29e77c,_0x29e77c[_0xdf8c('0xf2')],_0x29e77c['cause']);}else if(this[_0xdf8c('0x16')][_0x29e77c[_0xdf8c('0xf2')]][_0xdf8c('0x75')]){logger[_0xdf8c('0x5b')](_0xdf8c('0x15a'),_0x29e77c['linkedid'],_0x29e77c[_0xdf8c('0x154')],'\x20Queue',_0x3cde6d[_0xdf8c('0x26')],_0xdf8c('0x74'),_0x3cde6d[_0xdf8c('0x2b')]);this['callProgressDetectingCustomer'](_0x29e77c,_0x29e77c['linkedid'],_0x29e77c[_0xdf8c('0x154')]);}}};Preview[_0xdf8c('0xf')][_0xdf8c('0x15b')]=function(_0x582ff2){if(this[_0xdf8c('0x16')][_0x582ff2[_0xdf8c('0xfa')]]&&_0x582ff2[_0xdf8c('0xfa')]!==_0x582ff2['destuniqueid']){this[_0xdf8c('0xa0')](_0x582ff2,_0x582ff2[_0xdf8c('0xfa')],_0x582ff2[_0xdf8c('0xef')]);}};Preview[_0xdf8c('0xf')][_0xdf8c('0x1e')]=function(_0x7eab92){if(this[_0xdf8c('0x16')][_0x7eab92[_0xdf8c('0xf2')]]&&_0x7eab92[_0xdf8c('0xf2')]!==_0x7eab92[_0xdf8c('0xbc')]&&!this[_0xdf8c('0x16')][_0x7eab92[_0xdf8c('0xf2')]][_0xdf8c('0x75')]){if(_0x7eab92[_0xdf8c('0x154')]==='1'){this[_0xdf8c('0xa0')](_0x7eab92,_0x7eab92[_0xdf8c('0xf2')],_0x7eab92[_0xdf8c('0x154')]);}}};Preview[_0xdf8c('0xf')][_0xdf8c('0x15c')]=function(_0x33a271,_0x24e1d8,_0x147a32){if(this['actions'][_0x33a271]){if(_[_0xdf8c('0x88')](this[_0xdf8c('0x16')][_0x33a271][_0xdf8c('0x144')])){this[_0xdf8c('0x16')][_0x33a271]['variables']={};}this[_0xdf8c('0x16')][_0x33a271]['variables'][_0x24e1d8]=_0x147a32;}};Preview[_0xdf8c('0xf')]['syncVarSet']=function(_0x133ac8){try{if(!_['isNil'](_0x133ac8)){if(ut[_0xdf8c('0x15d')](_[_0xdf8c('0x15e')](_0x133ac8[_0xdf8c('0x15f')])[0x0])){this[_0xdf8c('0x15c')](_0x133ac8[_0xdf8c('0xbc')],_[_0xdf8c('0x15e')](_0x133ac8[_0xdf8c('0x15f')])[0x0],_0x133ac8[_0xdf8c('0x160')]);}}}catch(_0xa42be9){logger[_0xdf8c('0x161')](_0xdf8c('0x162'),util[_0xdf8c('0x163')](_0xa42be9,{'showHidden':![],'depth':null}));}};Preview[_0xdf8c('0xf')]['syncAttendedTransfer']=function(_0x9dc0){if(_0x9dc0){if(this['actions'][_0x9dc0['transfertargetlinkedid']]){this['actions'][_0x9dc0[_0xdf8c('0x164')]][_0xdf8c('0x158')]=!![];}}};Preview[_0xdf8c('0xf')]['syncBlindTransfer']=function(_0xaf9a7d){if(_0xaf9a7d){if(this['actions'][_0xaf9a7d['transfererlinkedid']]){this['actions'][_0xaf9a7d[_0xdf8c('0x165')]][_0xdf8c('0x158')]=!![];}}};module[_0xdf8c('0x166')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index c38b828..f4ce70a 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 _0xd154=['crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0xd154,0x8d));var _0x4d15=function(_0x27de67,_0x570087){_0x27de67=_0x27de67-0x0;var _0x4fac01=_0xd154[_0x27de67];return _0x4fac01;};'use strict';var util=require('util');var BPromise=require(_0x4d15('0x0'));var logger=require(_0x4d15('0x1'))(_0x4d15('0x2'));var _=require(_0x4d15('0x3'));var cmHopper=require(_0x4d15('0x4'));var cmHopperFinal=require(_0x4d15('0x5'));var cmHopperHistory=require(_0x4d15('0x6'));var cmHopperBlack=require(_0x4d15('0x7'));var voiceQueueRt=require(_0x4d15('0x8'));var agentReportPreview=require(_0x4d15('0x9'));var voiceQueueReport=require(_0x4d15('0xa'));function loggerCatch(_0xedf33){return function(_0x599f56){logger[_0x4d15('0xb')](_0xedf33,util['inspect'](_0x599f56,{'showHidden':![],'depth':null}));};}function create(_0x4b95c6){return BPromise[_0x4d15('0xc')]()['then'](cmHopperHistory[_0x4d15('0xd')](_0x4b95c6))[_0x4d15('0xe')](loggerCatch(_0x4d15('0xf')));}function createAgent(_0x763a7f){return BPromise[_0x4d15('0xc')]()[_0x4d15('0x10')](agentReportPreview[_0x4d15('0xd')](_0x763a7f))[_0x4d15('0xe')](loggerCatch(_0x4d15('0xf')));}function moveContact(_0x4213ae){return BPromise[_0x4d15('0xc')]()['then'](cmHopper[_0x4d15('0x11')](_0x4213ae,!![]))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x12')));}exports[_0x4d15('0x13')]=function(_0x20d2ae){return BPromise[_0x4d15('0xc')]()[_0x4d15('0x10')](cmHopperBlack[_0x4d15('0x13')](_0x20d2ae))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x14')));};exports['getContactPreview']=function(_0x31b4b9){return BPromise[_0x4d15('0xc')]()[_0x4d15('0x10')](cmHopper['getContactPreview'](_0x31b4b9))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x15')));};exports[_0x4d15('0xd')]=function(_0x34a923,_0x5d7f11){create(_0x34a923)['catch'](loggerCatch(_0x5d7f11));moveContact(_0x34a923)[_0x4d15('0xe')](loggerCatch(_0x5d7f11));};exports['createAgentHistory']=function(_0x51308e,_0x5ea6a4){createAgent(_0x51308e)[_0x4d15('0xe')](loggerCatch(_0x5ea6a4));};exports[_0x4d15('0x16')]=function(_0x587b18,_0x18f4bf){create(_0x587b18)['catch'](loggerCatch(_0x18f4bf));};exports['createCustomerFinal']=function(_0x37abee,_0x123b83){moveContact(_0x37abee)[_0x4d15('0xe')](loggerCatch(_0x123b83));};exports['rescheduleContact']=function(_0x3e99c4,_0x303900,_0x3f207f){if(_0x303900){_0x3e99c4['UserId']=null;}if(_0x3f207f){_0x3e99c4['active']=![];}return BPromise[_0x4d15('0xc')]()[_0x4d15('0x10')](cmHopper[_0x4d15('0x17')](_0x3e99c4))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x18')));};exports[_0x4d15('0x19')]=function(_0x2e3493){return BPromise['resolve']()[_0x4d15('0x10')](cmHopper[_0x4d15('0x19')](_0x2e3493))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x1a')));};exports[_0x4d15('0x1b')]=function(_0xd3d36b){return BPromise['resolve']()[_0x4d15('0x10')](cmHopper[_0x4d15('0x1b')]({'UserId':null},_0xd3d36b,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x4d15('0x1c')]=function(_0x150357){return BPromise[_0x4d15('0xc')]()['then'](cmHopper[_0x4d15('0x1b')]({'active':![]},_0x150357,0x1))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x1d')));};exports[_0x4d15('0x1e')]=function(_0x5201dd){var _0x43a605={};_0x43a605[_0x4d15('0x1f')]=_0x5201dd[_0x4d15('0x1f')];_0x43a605[_0x4d15('0x20')]=_0x5201dd[_0x4d15('0x20')];_0x43a605[_0x4d15('0x21')]=_0x5201dd[_0x4d15('0x21')];_0x43a605[_0x4d15('0x22')]=_0x5201dd['calleridname'];_0x43a605[_0x4d15('0x23')]=_0x5201dd[_0x4d15('0x23')];_0x43a605[_0x4d15('0x24')]=_0x5201dd[_0x4d15('0x25')];_0x43a605[_0x4d15('0x26')]=_0x5201dd['answertime'];_0x43a605[_0x4d15('0x27')]=0x1;_0x43a605[_0x4d15('0x28')]=_0x5201dd[_0x4d15('0x29')];_0x43a605[_0x4d15('0x2a')]=_0x5201dd[_0x4d15('0x2b')];_0x43a605[_0x4d15('0x2c')]=_0x4d15('0x2d');_0x43a605[_0x4d15('0x2e')]=_0x4d15('0x2f');_0x43a605[_0x4d15('0x30')]=0x0;_0x43a605[_0x4d15('0x31')]=0x1;_0x43a605['lastAssignedTo']=_0x5201dd['membername'];_0x43a605[_0x4d15('0x32')]=_0x4d15('0x33');return BPromise[_0x4d15('0xc')]()[_0x4d15('0x10')](voiceQueueReport['create'](_0x43a605))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x34')));};exports[_0x4d15('0x35')]=function(_0x494edc,_0x29ffb2){return BPromise['resolve']()[_0x4d15('0x10')](cmHopper[_0x4d15('0x35')](_0x494edc,_0x29ffb2))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x36')));};exports[_0x4d15('0x37')]=function(_0x3abf24){return BPromise[_0x4d15('0xc')]()[_0x4d15('0x10')](cmHopper[_0x4d15('0x17')](_0x3abf24,!![],!![]))[_0x4d15('0xe')](loggerCatch(_0x4d15('0x38')));}; \ No newline at end of file +var _0x44d2=['calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum'];(function(_0xa9fd9a,_0x1d5ab3){var _0x4bbe17=function(_0x167ae5){while(--_0x167ae5){_0xa9fd9a['push'](_0xa9fd9a['shift']());}};_0x4bbe17(++_0x1d5ab3);}(_0x44d2,0x13e));var _0x244d=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x44d2[_0x1beef3];return _0x5af964;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x244d('0x0'))(_0x244d('0x1'));var _=require('lodash');var cmHopper=require(_0x244d('0x2'));var cmHopperFinal=require(_0x244d('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x244d('0x4'));var agentReportPreview=require(_0x244d('0x5'));var voiceQueueReport=require(_0x244d('0x6'));function loggerCatch(_0x405f25){return function(_0x40be2c){logger[_0x244d('0x7')](_0x405f25,util[_0x244d('0x8')](_0x40be2c,{'showHidden':![],'depth':null}));};}function create(_0x525453){return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](cmHopperHistory['createHistory'](_0x525453))[_0x244d('0xb')](loggerCatch(_0x244d('0xc')));}function createAgent(_0x33bbee){return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](agentReportPreview[_0x244d('0xd')](_0x33bbee))[_0x244d('0xb')](loggerCatch(_0x244d('0xc')));}function moveContact(_0x6d0b95){return BPromise[_0x244d('0x9')]()['then'](cmHopper[_0x244d('0xe')](_0x6d0b95,!![]))['catch'](loggerCatch(_0x244d('0xf')));}exports[_0x244d('0x10')]=function(_0x3074ae){return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](cmHopperBlack[_0x244d('0x10')](_0x3074ae))[_0x244d('0xb')](loggerCatch(_0x244d('0x11')));};exports[_0x244d('0x12')]=function(_0x204690){return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](cmHopper[_0x244d('0x12')](_0x204690))[_0x244d('0xb')](loggerCatch(_0x244d('0x13')));};exports[_0x244d('0xd')]=function(_0x2c91de,_0x675255){create(_0x2c91de)[_0x244d('0xb')](loggerCatch(_0x675255));moveContact(_0x2c91de)[_0x244d('0xb')](loggerCatch(_0x675255));};exports[_0x244d('0x14')]=function(_0x42937e,_0x40f644){createAgent(_0x42937e)[_0x244d('0xb')](loggerCatch(_0x40f644));};exports[_0x244d('0x15')]=function(_0x4c6833,_0x5243f8){create(_0x4c6833)[_0x244d('0xb')](loggerCatch(_0x5243f8));};exports[_0x244d('0x16')]=function(_0x44e536,_0x30a5d5){moveContact(_0x44e536)['catch'](loggerCatch(_0x30a5d5));};exports[_0x244d('0x17')]=function(_0x2cddd2,_0x358334,_0x2580b1){if(_0x358334){_0x2cddd2['UserId']=null;}if(_0x2580b1){_0x2cddd2[_0x244d('0x18')]=![];}return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](cmHopper[_0x244d('0x17')](_0x2cddd2))['catch'](loggerCatch(_0x244d('0x19')));};exports['countReScheduled']=function(_0x54b0f6){return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](cmHopper[_0x244d('0x1a')](_0x54b0f6))[_0x244d('0xb')](loggerCatch(_0x244d('0x1b')));};exports[_0x244d('0x1c')]=function(_0x3d40e2){return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](cmHopper['unlockContact']({'UserId':null},_0x3d40e2,0x1))['catch'](loggerCatch(_0x244d('0x1d')));};exports[_0x244d('0x1e')]=function(_0x5d74a9){return BPromise['resolve']()[_0x244d('0xa')](cmHopper['unlockContact']({'active':![]},_0x5d74a9,0x1))[_0x244d('0xb')](loggerCatch(_0x244d('0x1f')));};exports[_0x244d('0x20')]=function(_0x5cac87){var _0x1519bc={};_0x1519bc[_0x244d('0x21')]=_0x5cac87[_0x244d('0x21')];_0x1519bc[_0x244d('0x22')]=_0x5cac87[_0x244d('0x22')];_0x1519bc[_0x244d('0x23')]=_0x5cac87['calleridnum'];_0x1519bc[_0x244d('0x24')]=_0x5cac87[_0x244d('0x24')];_0x1519bc[_0x244d('0x25')]=_0x5cac87[_0x244d('0x25')];_0x1519bc[_0x244d('0x26')]=_0x5cac87[_0x244d('0x27')];_0x1519bc[_0x244d('0x28')]=_0x5cac87['answertime'];_0x1519bc[_0x244d('0x29')]=0x1;_0x1519bc[_0x244d('0x2a')]=_0x5cac87[_0x244d('0x2b')];_0x1519bc[_0x244d('0x2c')]=_0x5cac87[_0x244d('0x2d')];_0x1519bc[_0x244d('0x2e')]=_0x244d('0x2f');_0x1519bc[_0x244d('0x30')]=_0x244d('0x31');_0x1519bc[_0x244d('0x32')]=0x0;_0x1519bc[_0x244d('0x33')]=0x1;_0x1519bc[_0x244d('0x34')]=_0x5cac87[_0x244d('0x2d')];_0x1519bc[_0x244d('0x35')]='COMPLETED';return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](voiceQueueReport[_0x244d('0x36')](_0x1519bc))[_0x244d('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x244d('0x37')]=function(_0x308c5b,_0x2dbcc1){return BPromise[_0x244d('0x9')]()['then'](cmHopper[_0x244d('0x37')](_0x308c5b,_0x2dbcc1))[_0x244d('0xb')](loggerCatch(_0x244d('0x38')));};exports[_0x244d('0x39')]=function(_0x335ea3){return BPromise[_0x244d('0x9')]()[_0x244d('0xa')](cmHopper[_0x244d('0x17')](_0x335ea3,!![],!![]))[_0x244d('0xb')](loggerCatch(_0x244d('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 afcc19f..996900e 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 _0x1f53=['name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','membername','UserId','logCustomer','ringtime','talktime','answertime','Failure','variablesAction','BOOKED','uniqueid','originate','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','voice','mandatoryDisposition','buildObj','buildAcw','queue','channelAgent','status','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','extractCalleridName','match','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','string','isEmpty','isUndefined','format','\x22\x22\x20<>','isActive','Queue'];(function(_0x4d693a,_0x344fe9){var _0x435150=function(_0x2e7232){while(--_0x2e7232){_0x4d693a['push'](_0x4d693a['shift']());}};_0x435150(++_0x344fe9);}(_0x1f53,0x195));var _0x31f5=function(_0x4b84b8,_0x2ac9e8){_0x4b84b8=_0x4b84b8-0x0;var _0x6c9fc8=_0x1f53[_0x4b84b8];return _0x6c9fc8;};'use strict';var util=require('util');var _=require(_0x31f5('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x31f5('0x1'));var ipAgi=process[_0x31f5('0x2')]['XCALLY_IP_AGI']||_0x31f5('0x3');function getSeconds(_0x399ad2,_0x2f759b){var _0x55d0da=moment(_0x399ad2)[_0x31f5('0x4')](0x0);var _0x590c1a=moment(_0x2f759b)['milliseconds'](0x0);return _0x55d0da[_0x31f5('0x5')](_0x590c1a,_0x31f5('0x6'));}exports[_0x31f5('0x7')]=function(_0x21b97e){return function(_0x85fb5d){logger[_0x31f5('0x8')](_0x21b97e,util[_0x31f5('0x9')](_0x85fb5d,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x420659,_0x483485){logger[_0x31f5('0xa')](_0x420659,util['inspect'](_0x483485,{'showHidden':![],'depth':null}));};exports[_0x31f5('0xb')]=function(_0x181c54,_0x1e7b4b){logger[_0x31f5('0x8')](_0x181c54,util[_0x31f5('0x9')](_0x1e7b4b,{'showHidden':![],'depth':null}));};exports[_0x31f5('0xc')]=function(_0x859a21){return function(_0x175b8b){logger['info'](_0x859a21,util[_0x31f5('0x9')](_0x175b8b,{'showHidden':![],'depth':null}));};};exports[_0x31f5('0xd')]=function(_0x8cc8f4,_0x490a52,_0x3c8f80){return{'message':_0x8cc8f4,'unlock':_0x490a52,'active':_0x3c8f80};};exports['getCallerId']=function(_0x1b4b02,_0x591efa,_0x2d41fa){if(!_['isUndefined'](_0x2d41fa)&&_0x31f5('0xe')===typeof _0x2d41fa&&!_[_0x31f5('0xf')](_0x2d41fa)){if(!_[_0x31f5('0x10')](_0x591efa)&&_0x31f5('0xe')===typeof _0x591efa&&!_[_0x31f5('0xf')](_0x591efa)){return util[_0x31f5('0x11')]('\x22%s\x22\x20<%s>',_0x591efa,_0x2d41fa);}return util[_0x31f5('0x11')]('\x22%s\x22\x20<%s>',_0x2d41fa,_0x2d41fa);}if(!_[_0x31f5('0x10')](_0x1b4b02)&&'string'===typeof _0x1b4b02&&!_[_0x31f5('0xf')](_0x1b4b02)){return _0x1b4b02;}return _0x31f5('0x12');};exports[_0x31f5('0x13')]=function(_0x327699){if(_['isNil'](_0x327699)){return![];}return _0x327699;};exports['addVariables']=function(_0x3ff7e8,_0x2153dc,_0x347a1d,_0x124122,_0x4692cb,_0x1cdaf2){var _0x15ad11={'XMD-QUEUE':_0x2153dc[_0x31f5('0x14')]?_0x2153dc[_0x31f5('0x14')][_0x31f5('0x15')]:'','XMD-CALLERID':_0x124122,'XMD-CALLERID-PREVIEW':_0x1cdaf2?util[_0x31f5('0x11')](_0x31f5('0x16'),_0x1cdaf2[_0x31f5('0x17')],_0x1cdaf2[_0x31f5('0x18')]):_0x124122,'XMD-DIALID':_0x4692cb,'XMD-CONTACTID':_0x2153dc[_0x31f5('0x19')],'XMD-CDRTYPE':_0x31f5('0x1a'),'CALLERID(all)':_0x124122,'XMD-VOICEQUEUEID':_0x2153dc[_0x31f5('0x1b')],'XMD-DIALCHANNEL':_0x347a1d,'XMD-DIALTIMEOUT':_0x3ff7e8['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x3ff7e8[_0x31f5('0x1c')]?'g':'',_[_0x31f5('0xf')](_0x3ff7e8[_0x31f5('0x1d')])?'':_0x31f5('0x1e')),'XMD-DIALURL':_0x3ff7e8['dialPreviewUrl']||'','XMD-AGI':_0x3ff7e8[_0x31f5('0x1f')]?util[_0x31f5('0x11')](_0x31f5('0x20'),ipAgi,_0x3ff7e8['dialQueueProject']):_0x31f5('0x21'),'XMD-AGIAFTER':_0x3ff7e8[_0x31f5('0x1c')]?util[_0x31f5('0x11')](_0x31f5('0x20'),ipAgi,_0x3ff7e8[_0x31f5('0x1c')]):_0x31f5('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x1cdaf2?_0x1cdaf2[_0x31f5('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x1cdaf2?_0x1cdaf2[_0x31f5('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x31f5('0x24')};if(!_[_0x31f5('0xf')](_0x3ff7e8[_0x31f5('0x1d')])){_0x15ad11[util['format']('%s',_0x31f5('0x25'))]=_0x3ff7e8[_0x31f5('0x1d')];_0x15ad11[util[_0x31f5('0x11')]('%s',_0x31f5('0x26'))]=_0x4692cb;}if(_0x2153dc&&_0x2153dc[_0x31f5('0x27')]){for(var _0x5debc6 in _0x2153dc[_0x31f5('0x27')]){if(_0x2153dc['Contact'][_0x31f5('0x28')](_0x5debc6)){if(!_[_0x31f5('0x29')](_0x2153dc[_0x31f5('0x27')][_0x5debc6])&&_0x5debc6!=='id'&&_0x5debc6!==_0x31f5('0x2a')&&_0x5debc6!==_0x31f5('0x2b')&&_0x5debc6!==_0x31f5('0x2c')){_0x15ad11[util[_0x31f5('0x11')](_0x31f5('0x2d'),_0x31f5('0x2e'),_[_0x31f5('0x2f')](_0x5debc6))]=_0x2153dc['Contact'][_0x5debc6];}}}}return _0x15ad11;};exports['toLowerVariables']=function(_0x2dbd08){var _0x2783a1={};for(var _0x58eb62 in _0x2dbd08){if(_0x2dbd08[_0x31f5('0x28')](_0x58eb62)){_0x2783a1[util['format']('%s',_[_0x31f5('0x30')](_0x58eb62))]=_0x2dbd08[_0x58eb62];}}return{'variables':_0x2783a1};};exports[_0x31f5('0x31')]=function(_0x200eb6,_0x23ce4c){if(!_[_0x31f5('0x29')](_0x200eb6)){if(_0x200eb6[_0x31f5('0x28')](_0x31f5('0x32'))){if(_0x200eb6[_0x31f5('0x32')]>0x0){_0x200eb6[_0x31f5('0x32')]-=0x1;}else{logger[_0x31f5('0x8')](_0x31f5('0x33'),_0x23ce4c);}}}else{logger[_0x31f5('0x8')](_0x31f5('0x34'),_0x23ce4c);}};exports[_0x31f5('0x35')]=function(_0x58990b){var _0x27a717=moment()[_0x31f5('0x11')](_0x31f5('0x36'));_0x58990b[_0x31f5('0x37')]=0xd;_0x58990b[_0x31f5('0x38')]=_0x31f5('0x39');_0x58990b[_0x31f5('0x3a')]=_0x27a717;_0x58990b[_0x31f5('0x3b')]=_0x27a717;_0x58990b[_0x31f5('0x3c')]=_0x27a717;};exports[_0x31f5('0x3d')]=function(_0x9d8dc6,_0x6973ff,_0x51427b){var _0x46abf8=moment()['format'](_0x31f5('0x36'));_0x9d8dc6[_0x31f5('0x37')]=_0x6973ff;_0x9d8dc6[_0x31f5('0x38')]=_0x51427b;_0x9d8dc6[_0x31f5('0x3b')]=_0x46abf8;_0x9d8dc6['ringtime']=getSeconds(_0x9d8dc6[_0x31f5('0x3b')],_0x9d8dc6[_0x31f5('0x3a')]);};exports[_0x31f5('0x3e')]=function(_0xf19ee8,_0x1386f7,_0x1662fe){_0xf19ee8[_0x31f5('0x3f')]=_0x1386f7;_0xf19ee8[_0x31f5('0x40')]=_0x1662fe;};exports[_0x31f5('0x41')]=function(_0x13c919,_0x3c50ee,_0x553c9e){var _0x5111cd=moment()['format'](_0x31f5('0x36'));_0x13c919[_0x31f5('0x37')]=_0x3c50ee;_0x13c919['statedesc']=_0x553c9e;_0x13c919[_0x31f5('0x3b')]=_0x13c919[_0x31f5('0x3b')]?_0x13c919[_0x31f5('0x3b')]:_0x5111cd;_0x13c919[_0x31f5('0x3c')]=_0x13c919[_0x31f5('0x3c')]?_0x13c919['endtime']:_0x5111cd;_0x13c919[_0x31f5('0x42')]=getSeconds(_0x13c919[_0x31f5('0x3b')]||0x0,_0x13c919[_0x31f5('0x3a')]||0x0);_0x13c919[_0x31f5('0x43')]=_0x13c919[_0x31f5('0x44')]?getSeconds(_0x13c919[_0x31f5('0x3c')],_0x13c919[_0x31f5('0x44')]):0x0;};exports['isFailure']=function(_0x4e3727){return _0x4e3727===_0x31f5('0x45');};exports[_0x31f5('0x46')]=function(_0x9a918f,_0x2ff482,_0x25b7e5,_0x59556d,_0x2c21bb){var _0x2e1efa=_0x59556d?'RECALL':_0x9a918f['calleridname'];_0x2e1efa=_0x2c21bb?_0x31f5('0x47'):_0x2e1efa;return{'actionid':_0x9a918f[_0x31f5('0x48')],'action':_0x31f5('0x49'),'channel':_0x9a918f['channelAgent'],'callerid':util[_0x31f5('0x11')](_0x31f5('0x16'),_0x2e1efa,_0x9a918f[_0x31f5('0x18')]),'Exten':_0x31f5('0x4a'),'Context':_0x31f5('0x4b'),'Priority':'1','variable':_0x25b7e5,'timeout':(_0x2ff482[_0x31f5('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x9a918f[_0x31f5('0x48')]};};exports[_0x31f5('0x4d')]=function(_0x50131b){return _0x50131b[_0x31f5('0x4e')]+_0x50131b[_0x31f5('0x4f')]+_0x50131b['countnoanswerretry']+_0x50131b['countagentrejectretry']+_0x50131b['countnosuchnumberretry'];};exports['cloneAction']=function(_0x32c0e4){var _0x5cdc20=_['clone'](_0x32c0e4);_0x5cdc20[_0x31f5('0x37')]=0xf;_0x5cdc20['statedesc']=_0x31f5('0x50');return _0x5cdc20;};exports[_0x31f5('0x51')]=function(_0x2ad7ea,_0xb2db51,_0x377990){var _0x596799={};_0x596799[_0xb2db51]=_0x2ad7ea[_0xb2db51];_0x596799[_0x31f5('0x52')]=![];_0x596799[_0x31f5('0x53')]=moment()[_0x31f5('0x54')](_0x377990,'minutes')[_0x31f5('0x11')](_0x31f5('0x36'));_0x596799['ContactId']=_0x2ad7ea['ContactId'];_0x596799[_0x31f5('0x55')]=_0x2ad7ea[_0x31f5('0x55')];_0x596799[_0x31f5('0x1b')]=_0x2ad7ea[_0x31f5('0x1b')]||undefined;return _0x596799;};exports[_0x31f5('0x56')]=function(_0x56e528,_0x473310){if(!_[_0x31f5('0x29')](_0x56e528)){if(_0x56e528[_0x31f5('0x57')]>0x0){_0x56e528[_0x31f5('0x57')]-=0x1;}else{logger[_0x31f5('0x8')](_0x473310,_0x31f5('0x58'));}}else{logger[_0x31f5('0x8')](_0x473310,_0x31f5('0x59'));}};exports['IsNotLoggedIn']=function(_0x29453e){if(_0x29453e<=0x0){return!![];}return![];};function buildObj(_0x13762d,_0x4b6a1f,_0x2a6179){_0x13762d[_0x31f5('0x5a')]=_0x4b6a1f;_0x13762d[_0x31f5('0x15')]=_0x13762d['queue'];_0x13762d['interface']=_0x13762d['channelAgent'];_0x13762d['motionChannel']=_0x31f5('0x5b');if(_0x2a6179){_0x13762d['mandatoryDisposition']=_0x2a6179[_0x31f5('0x5c')];}return _0x13762d;}exports[_0x31f5('0x5d')]=buildObj;exports[_0x31f5('0x5e')]=function(_0xea205d){var _0x32498a={};_0x32498a[_0x31f5('0x5f')]=_0xea205d[_0x31f5('0x5f')];_0x32498a['interface']=_0xea205d[_0x31f5('0x60')];_0x32498a[_0x31f5('0x48')]=_0xea205d[_0x31f5('0x48')];return _0x32498a;};exports['agentReadyId']=function(_0x1b9656){var _0x4bf772=[];for(var _0x1910cd in _0x1b9656){if(_0x1b9656[_0x31f5('0x28')](_0x1910cd)){if(!_[_0x31f5('0x29')](_0x1b9656[_0x1910cd])&&_0x1b9656[_0x1910cd][_0x31f5('0x37')]==='not_inuse'&&_0x1b9656[_0x1910cd][_0x31f5('0x61')]==='reachable'){_0x4bf772[_0x31f5('0x62')](_0x1b9656[_0x1910cd]['id']);}}}return _0x4bf772;};exports[_0x31f5('0x63')]=function(_0x58ccd8){var _0x1ef6d2=moment()['milliseconds'](0x0);var _0x1a8357=moment(_0x58ccd8)['milliseconds'](0x0);return _0x1ef6d2[_0x31f5('0x5')](_0x1a8357,_0x31f5('0x6'));};exports[_0x31f5('0x64')]=function(_0x496d9a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x496d9a['ContactId'],'ListId':_0x496d9a['ListId'],'VoiceQueueId':_0x496d9a[_0x31f5('0x1b')]||undefined,'CampaignId':_0x496d9a[_0x31f5('0x65')]||undefined};};exports[_0x31f5('0x66')]=function(_0x3f1fe2){if(_0x3f1fe2==='uniqueid'||_0x3f1fe2===_0x31f5('0x67')||_0x3f1fe2===_0x31f5('0x5f')||_0x3f1fe2===_0x31f5('0x68')||_0x3f1fe2===_0x31f5('0x69')||_0x3f1fe2===_0x31f5('0x6a')||_0x3f1fe2===_0x31f5('0x3f')||_0x3f1fe2===_0x31f5('0x60')||_0x3f1fe2===_0x31f5('0x17')||_0x3f1fe2===_0x31f5('0x52')||_0x3f1fe2===_0x31f5('0x18')||_0x3f1fe2==='scheduledat'||_0x3f1fe2===_0x31f5('0x4e')||_0x3f1fe2===_0x31f5('0x4f')||_0x3f1fe2===_0x31f5('0x6b')||_0x3f1fe2===_0x31f5('0x6c')||_0x3f1fe2===_0x31f5('0x6d')||_0x3f1fe2===_0x31f5('0x6e')||_0x3f1fe2===_0x31f5('0x6f')||_0x3f1fe2==='recallme'||_0x3f1fe2==='ContactId'||_0x3f1fe2===_0x31f5('0x55')||_0x3f1fe2===_0x31f5('0x40')||_0x3f1fe2==='VoiceQueueId'||_0x3f1fe2===_0x31f5('0x70')||_0x3f1fe2===_0x31f5('0x71')||_0x3f1fe2===_0x31f5('0x72')||_0x3f1fe2===_0x31f5('0x73')||_0x3f1fe2===_0x31f5('0x74')||_0x3f1fe2===_0x31f5('0x75')||_0x3f1fe2===_0x31f5('0x76')||_0x3f1fe2===_0x31f5('0x77')||_0x3f1fe2==='xmd-dialid'||_0x3f1fe2==='xmd-dialchannel'||_0x3f1fe2===_0x31f5('0x78')||_0x3f1fe2===_0x31f5('0x79')||_0x3f1fe2===_0x31f5('0x7a')||_0x3f1fe2===_0x31f5('0x7b')||_0x3f1fe2===_0x31f5('0x7c')||_0x3f1fe2===_0x31f5('0x7d')||_0x3f1fe2==='rtpaudioqosbridged'||_0x3f1fe2==='rtpaudioqosjitter'||_0x3f1fe2==='rtpaudioqosjitterbridged'||_0x3f1fe2===_0x31f5('0x7e')||_0x3f1fe2===_0x31f5('0x7f')||_0x3f1fe2==='rtpaudioqosrtt'||_0x3f1fe2===_0x31f5('0x80')||_0x3f1fe2===_0x31f5('0x7d')||_0x3f1fe2==='rtpaudioqosbridged'||_0x3f1fe2===_0x31f5('0x81')||_0x3f1fe2===_0x31f5('0x82')||_0x3f1fe2===_0x31f5('0x7e')||_0x3f1fe2===_0x31f5('0x7f')||_0x3f1fe2==='rtpaudioqosrtt'||_0x3f1fe2===_0x31f5('0x80')||_0x3f1fe2==='bridgepeer'||_0x3f1fe2===_0x31f5('0x83')||_0x3f1fe2===_0x31f5('0x37')||_0x3f1fe2===_0x31f5('0x38')){return![];}return!![];};exports[_0x31f5('0x84')]=function(_0x168414,_0xf26309){var _0x3af5bb,_0x4906a1,_0x500404;if(_0xf26309<=0x0){_0xf26309=0x1;}_0x3af5bb=new RegExp(_0x31f5('0x85')+_0xf26309+'}$');_0x4906a1=Math['pow'](0xa,_0xf26309-0x1);_0x500404=Math['pow'](0xa,_0xf26309)-0x1;return util[_0x31f5('0x11')]('%s',_[_0x31f5('0x86')](_0x168414,_0x3af5bb,_['random'](_0x4906a1,_0x500404)));};exports[_0x31f5('0x87')]=function(_0x18958d){var _0x376210=_0x18958d[_0x31f5('0x88')](/"(.*?)"/);return _0x376210?_0x376210[0x1]:_0x18958d;};exports['extractCalleridNumber']=function(_0x41e423){var _0x33352=_0x41e423[_0x31f5('0x88')](/<(.*?)>/);return _0x33352?_0x33352[0x1]:_0x41e423;};function buildNoAnswerEventPayload(_0x127c40,_0x5da3d1){var _0x23b66a=buildObj(_0x127c40,'noanswer');if(!_[_0x31f5('0xf')](_0x5da3d1[_0x31f5('0x89')])){Object[_0x31f5('0x8a')](_0x5da3d1[_0x31f5('0x89')])[_0x31f5('0x8b')](function(_0x16b625){_0x23b66a[_0x16b625[_0x31f5('0x8c')]()]=_0x5da3d1[_0x31f5('0x89')][_0x16b625];});}return _0x23b66a;}exports[_0x31f5('0x8d')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xfce5=['xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','isUndefined','string','format','isEmpty','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','responsetime','starttime','logLookAgent','membername','UserId','state','endtime','talktime','answertime','Failure','variablesAction','RECALL','uniqueid','channelAgent','from-sip','timeout','countcongestionretry','countagentrejectretry','cloneAction','Global','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','createBody','filterKey','idContact','type','dialAnswer','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel'];(function(_0x36bfb4,_0x59ff6c){var _0x490927=function(_0x3f0d83){while(--_0x3f0d83){_0x36bfb4['push'](_0x36bfb4['shift']());}};_0x490927(++_0x59ff6c);}(_0xfce5,0x1cd));var _0x5fce=function(_0x51070b,_0x39c85d){_0x51070b=_0x51070b-0x0;var _0x153240=_0xfce5[_0x51070b];return _0x153240;};'use strict';var util=require(_0x5fce('0x0'));var _=require('lodash');var moment=require(_0x5fce('0x1'));var logger=require(_0x5fce('0x2'))(_0x5fce('0x3'));var ipAgi=process['env'][_0x5fce('0x4')]||'127.0.0.1';function getSeconds(_0x29685f,_0x447b07){var _0x43a497=moment(_0x29685f)['milliseconds'](0x0);var _0x53735a=moment(_0x447b07)[_0x5fce('0x5')](0x0);return _0x43a497['diff'](_0x53735a,_0x5fce('0x6'));}exports[_0x5fce('0x7')]=function(_0x14147e){return function(_0x30dc33){logger['error'](_0x14147e,util[_0x5fce('0x8')](_0x30dc33,{'showHidden':![],'depth':null}));};};exports[_0x5fce('0x9')]=function(_0x4e3335,_0x52d58c){logger[_0x5fce('0xa')](_0x4e3335,util['inspect'](_0x52d58c,{'showHidden':![],'depth':null}));};exports[_0x5fce('0xb')]=function(_0x5aa79c,_0x5808e8){logger[_0x5fce('0xc')](_0x5aa79c,util[_0x5fce('0x8')](_0x5808e8,{'showHidden':![],'depth':null}));};exports[_0x5fce('0xd')]=function(_0x348e15){return function(_0x241afe){logger['info'](_0x348e15,util[_0x5fce('0x8')](_0x241afe,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x371bba,_0x3bd7c4,_0x2de760){return{'message':_0x371bba,'unlock':_0x3bd7c4,'active':_0x2de760};};exports['getCallerId']=function(_0x13a794,_0x5e992a,_0x3dc06a){if(!_[_0x5fce('0xe')](_0x3dc06a)&&_0x5fce('0xf')===typeof _0x3dc06a&&!_['isEmpty'](_0x3dc06a)){if(!_[_0x5fce('0xe')](_0x5e992a)&&_0x5fce('0xf')===typeof _0x5e992a&&!_['isEmpty'](_0x5e992a)){return util['format']('\x22%s\x22\x20<%s>',_0x5e992a,_0x3dc06a);}return util[_0x5fce('0x10')]('\x22%s\x22\x20<%s>',_0x3dc06a,_0x3dc06a);}if(!_[_0x5fce('0xe')](_0x13a794)&&_0x5fce('0xf')===typeof _0x13a794&&!_[_0x5fce('0x11')](_0x13a794)){return _0x13a794;}return _0x5fce('0x12');};exports[_0x5fce('0x13')]=function(_0x28a82b){if(_[_0x5fce('0x14')](_0x28a82b)){return![];}return _0x28a82b;};exports[_0x5fce('0x15')]=function(_0x109b63,_0x38d8d6,_0x4c62c5,_0x4bc5df,_0x453828,_0x21de31){var _0x98aec3={'XMD-QUEUE':_0x38d8d6['Queue']?_0x38d8d6[_0x5fce('0x16')][_0x5fce('0x17')]:'','XMD-CALLERID':_0x4bc5df,'XMD-CALLERID-PREVIEW':_0x21de31?util[_0x5fce('0x10')](_0x5fce('0x18'),_0x21de31[_0x5fce('0x19')],_0x21de31[_0x5fce('0x1a')]):_0x4bc5df,'XMD-DIALID':_0x453828,'XMD-CONTACTID':_0x38d8d6[_0x5fce('0x1b')],'XMD-CDRTYPE':_0x5fce('0x1c'),'CALLERID(all)':_0x4bc5df,'XMD-VOICEQUEUEID':_0x38d8d6[_0x5fce('0x1d')],'XMD-DIALCHANNEL':_0x4c62c5,'XMD-DIALTIMEOUT':_0x109b63[_0x5fce('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x5fce('0x10')](_0x5fce('0x1f'),_0x109b63['dialQueueProject2']?'g':'',_[_0x5fce('0x11')](_0x109b63['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x109b63[_0x5fce('0x20')]||'','XMD-AGI':_0x109b63[_0x5fce('0x21')]?util[_0x5fce('0x10')](_0x5fce('0x22'),ipAgi,_0x109b63[_0x5fce('0x21')]):'NONE','XMD-AGIAFTER':_0x109b63['dialQueueProject2']?util[_0x5fce('0x10')](_0x5fce('0x22'),ipAgi,_0x109b63[_0x5fce('0x23')]):_0x5fce('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x21de31?_0x21de31[_0x5fce('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x21de31?_0x21de31[_0x5fce('0x26')]:'','XMD-DESTINATION':_0x5fce('0x27'),'SIPADDHEADER':_0x5fce('0x28')};if(!_[_0x5fce('0x11')](_0x109b63[_0x5fce('0x29')])){_0x98aec3[util[_0x5fce('0x10')]('%s',_0x5fce('0x2a'))]=_0x109b63[_0x5fce('0x29')];_0x98aec3[util['format']('%s',_0x5fce('0x2b'))]=_0x453828;}if(_0x38d8d6&&_0x38d8d6[_0x5fce('0x2c')]){for(var _0x4f7fdf in _0x38d8d6[_0x5fce('0x2c')]){if(_0x38d8d6['Contact']['hasOwnProperty'](_0x4f7fdf)){if(!_[_0x5fce('0x14')](_0x38d8d6[_0x5fce('0x2c')][_0x4f7fdf])&&_0x4f7fdf!=='id'&&_0x4f7fdf!=='tags'&&_0x4f7fdf!==_0x5fce('0x2d')&&_0x4f7fdf!==_0x5fce('0x2e')){_0x98aec3[util[_0x5fce('0x10')](_0x5fce('0x2f'),_0x5fce('0x30'),_[_0x5fce('0x31')](_0x4f7fdf))]=_0x38d8d6[_0x5fce('0x2c')][_0x4f7fdf];}}}}return _0x98aec3;};exports['toLowerVariables']=function(_0x3b726d){var _0x43706a={};for(var _0x101984 in _0x3b726d){if(_0x3b726d[_0x5fce('0x32')](_0x101984)){_0x43706a[util['format']('%s',_[_0x5fce('0x33')](_0x101984))]=_0x3b726d[_0x101984];}}return{'variables':_0x43706a};};exports['updateOriginated']=function(_0x566f8a,_0x52a56c){if(!_['isNil'](_0x566f8a)){if(_0x566f8a[_0x5fce('0x32')]('originated')){if(_0x566f8a[_0x5fce('0x34')]>0x0){_0x566f8a[_0x5fce('0x34')]-=0x1;}else{logger['error'](_0x5fce('0x35'),_0x52a56c);}}}else{logger[_0x5fce('0xc')](_0x5fce('0x36'),_0x52a56c);}};exports[_0x5fce('0x37')]=function(_0x157a12){var _0xcb77de=moment()['format'](_0x5fce('0x38'));_0x157a12['state']=0xd;_0x157a12[_0x5fce('0x39')]='Blacklist';_0x157a12['starttime']=_0xcb77de;_0x157a12[_0x5fce('0x3a')]=_0xcb77de;_0x157a12['endtime']=_0xcb77de;};exports['logAgent']=function(_0x98ef5,_0x21f480,_0x51899f){var _0xc8a6f=moment()[_0x5fce('0x10')](_0x5fce('0x38'));_0x98ef5['state']=_0x21f480;_0x98ef5[_0x5fce('0x39')]=_0x51899f;_0x98ef5[_0x5fce('0x3a')]=_0xc8a6f;_0x98ef5['ringtime']=getSeconds(_0x98ef5[_0x5fce('0x3a')],_0x98ef5[_0x5fce('0x3b')]);};exports[_0x5fce('0x3c')]=function(_0x30333f,_0x8c5419,_0x23deea){_0x30333f[_0x5fce('0x3d')]=_0x8c5419;_0x30333f[_0x5fce('0x3e')]=_0x23deea;};exports['logCustomer']=function(_0x49da4f,_0x1f3a1f,_0x2fb6e7){var _0x3927a1=moment()[_0x5fce('0x10')](_0x5fce('0x38'));_0x49da4f[_0x5fce('0x3f')]=_0x1f3a1f;_0x49da4f['statedesc']=_0x2fb6e7;_0x49da4f[_0x5fce('0x3a')]=_0x49da4f[_0x5fce('0x3a')]?_0x49da4f[_0x5fce('0x3a')]:_0x3927a1;_0x49da4f[_0x5fce('0x40')]=_0x49da4f[_0x5fce('0x40')]?_0x49da4f[_0x5fce('0x40')]:_0x3927a1;_0x49da4f['ringtime']=getSeconds(_0x49da4f[_0x5fce('0x3a')]||0x0,_0x49da4f[_0x5fce('0x3b')]||0x0);_0x49da4f[_0x5fce('0x41')]=_0x49da4f['answertime']?getSeconds(_0x49da4f[_0x5fce('0x40')],_0x49da4f[_0x5fce('0x42')]):0x0;};exports['isFailure']=function(_0x40bd76){return _0x40bd76===_0x5fce('0x43');};exports[_0x5fce('0x44')]=function(_0xb9e661,_0x26d63d,_0xfc2ff4,_0x3736,_0x30ad5a){var _0x1102a1=_0x3736?_0x5fce('0x45'):_0xb9e661['calleridname'];_0x1102a1=_0x30ad5a?'BOOKED':_0x1102a1;return{'actionid':_0xb9e661[_0x5fce('0x46')],'action':'originate','channel':_0xb9e661[_0x5fce('0x47')],'callerid':util[_0x5fce('0x10')](_0x5fce('0x18'),_0x1102a1,_0xb9e661[_0x5fce('0x1a')]),'Exten':'xcally-motion-preview','Context':_0x5fce('0x48'),'Priority':'1','variable':_0xfc2ff4,'timeout':(_0x26d63d[_0x5fce('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0xb9e661[_0x5fce('0x46')]};};exports['totalGlobal']=function(_0x9269e4){return _0x9269e4['countbusyretry']+_0x9269e4[_0x5fce('0x4a')]+_0x9269e4['countnoanswerretry']+_0x9269e4[_0x5fce('0x4b')]+_0x9269e4['countnosuchnumberretry'];};exports[_0x5fce('0x4c')]=function(_0xa8020a){var _0x2b7f85=_['clone'](_0xa8020a);_0x2b7f85[_0x5fce('0x3f')]=0xf;_0x2b7f85['statedesc']=_0x5fce('0x4d');return _0x2b7f85;};exports['scheduledAt']=function(_0x4f8b12,_0x1ad793,_0x3630a0){var _0xd94c88={};_0xd94c88[_0x1ad793]=_0x4f8b12[_0x1ad793];_0xd94c88['active']=![];_0xd94c88[_0x5fce('0x4e')]=moment()[_0x5fce('0x4f')](_0x3630a0,_0x5fce('0x50'))[_0x5fce('0x10')](_0x5fce('0x38'));_0xd94c88[_0x5fce('0x1b')]=_0x4f8b12[_0x5fce('0x1b')];_0xd94c88[_0x5fce('0x51')]=_0x4f8b12[_0x5fce('0x51')];_0xd94c88[_0x5fce('0x1d')]=_0x4f8b12['VoiceQueueId']||undefined;return _0xd94c88;};exports['decrementTalkink']=function(_0x409a3c,_0x532b39){if(!_[_0x5fce('0x14')](_0x409a3c)){if(_0x409a3c[_0x5fce('0x52')]>0x0){_0x409a3c[_0x5fce('0x52')]-=0x1;}else{logger[_0x5fce('0xc')](_0x532b39,_0x5fce('0x53'));}}else{logger[_0x5fce('0xc')](_0x532b39,_0x5fce('0x54'));}};exports[_0x5fce('0x55')]=function(_0x100fcb){if(_0x100fcb<=0x0){return!![];}return![];};function buildObj(_0x216bd0,_0x5a8bd7,_0x455707){_0x216bd0[_0x5fce('0x56')]=_0x5a8bd7;_0x216bd0[_0x5fce('0x17')]=_0x216bd0[_0x5fce('0x57')];_0x216bd0['interface']=_0x216bd0[_0x5fce('0x47')];_0x216bd0[_0x5fce('0x58')]=_0x5fce('0x59');if(_0x455707){_0x216bd0[_0x5fce('0x5a')]=_0x455707[_0x5fce('0x5a')];}return _0x216bd0;}exports[_0x5fce('0x5b')]=buildObj;exports[_0x5fce('0x5c')]=function(_0x1a66ac){var _0x76c3eb={};_0x76c3eb[_0x5fce('0x57')]=_0x1a66ac[_0x5fce('0x57')];_0x76c3eb['interface']=_0x1a66ac[_0x5fce('0x47')];_0x76c3eb[_0x5fce('0x46')]=_0x1a66ac[_0x5fce('0x46')];return _0x76c3eb;};exports[_0x5fce('0x5d')]=function(_0x49ff6d){var _0x1fcc07=[];for(var _0x12c3a7 in _0x49ff6d){if(_0x49ff6d[_0x5fce('0x32')](_0x12c3a7)){if(!_[_0x5fce('0x14')](_0x49ff6d[_0x12c3a7])&&_0x49ff6d[_0x12c3a7][_0x5fce('0x3f')]===_0x5fce('0x5e')&&_0x49ff6d[_0x12c3a7][_0x5fce('0x5f')]===_0x5fce('0x60')){_0x1fcc07[_0x5fce('0x61')](_0x49ff6d[_0x12c3a7]['id']);}}}return _0x1fcc07;};exports[_0x5fce('0x62')]=function(_0x25502a){var _0x5e4aa7=moment()[_0x5fce('0x5')](0x0);var _0x5d8c63=moment(_0x25502a)[_0x5fce('0x5')](0x0);return _0x5e4aa7[_0x5fce('0x63')](_0x5d8c63,_0x5fce('0x6'));};exports[_0x5fce('0x64')]=function(_0x37d9cc){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x37d9cc[_0x5fce('0x1b')],'ListId':_0x37d9cc[_0x5fce('0x51')],'VoiceQueueId':_0x37d9cc[_0x5fce('0x1d')]||undefined,'CampaignId':_0x37d9cc['CampaignId']||undefined};};exports[_0x5fce('0x65')]=function(_0xf64629){if(_0xf64629===_0x5fce('0x46')||_0xf64629===_0x5fce('0x66')||_0xf64629===_0x5fce('0x57')||_0xf64629===_0x5fce('0x67')||_0xf64629==='campaigntype'||_0xf64629===_0x5fce('0x68')||_0xf64629===_0x5fce('0x3d')||_0xf64629===_0x5fce('0x47')||_0xf64629==='calleridname'||_0xf64629==='active'||_0xf64629===_0x5fce('0x1a')||_0xf64629===_0x5fce('0x4e')||_0xf64629===_0x5fce('0x69')||_0xf64629===_0x5fce('0x4a')||_0xf64629===_0x5fce('0x6a')||_0xf64629===_0x5fce('0x6b')||_0xf64629===_0x5fce('0x6c')||_0xf64629===_0x5fce('0x6d')||_0xf64629==='callbackat'||_0xf64629===_0x5fce('0x6e')||_0xf64629==='ContactId'||_0xf64629===_0x5fce('0x51')||_0xf64629===_0x5fce('0x3e')||_0xf64629===_0x5fce('0x1d')||_0xf64629===_0x5fce('0x6f')||_0xf64629===_0x5fce('0x70')||_0xf64629===_0x5fce('0x71')||_0xf64629===_0x5fce('0x72')||_0xf64629===_0x5fce('0x73')||_0xf64629===_0x5fce('0x74')||_0xf64629==='xmd-dialtimeout'||_0xf64629==='xmd-dialoptions'||_0xf64629===_0x5fce('0x75')||_0xf64629===_0x5fce('0x76')||_0xf64629===_0x5fce('0x77')||_0xf64629===_0x5fce('0x78')||_0xf64629==='xmd-callerid'||_0xf64629===_0x5fce('0x79')||_0xf64629===_0x5fce('0x7a')||_0xf64629===_0x5fce('0x7b')||_0xf64629===_0x5fce('0x7c')||_0xf64629===_0x5fce('0x7d')||_0xf64629===_0x5fce('0x7e')||_0xf64629===_0x5fce('0x7f')||_0xf64629===_0x5fce('0x80')||_0xf64629==='rtpaudioqosrtt'||_0xf64629===_0x5fce('0x81')||_0xf64629===_0x5fce('0x7b')||_0xf64629==='rtpaudioqosbridged'||_0xf64629==='rtpaudioqosjitter'||_0xf64629===_0x5fce('0x7e')||_0xf64629==='rtpaudioqosloss'||_0xf64629===_0x5fce('0x80')||_0xf64629===_0x5fce('0x82')||_0xf64629===_0x5fce('0x81')||_0xf64629==='bridgepeer'||_0xf64629===_0x5fce('0x83')||_0xf64629===_0x5fce('0x3f')||_0xf64629===_0x5fce('0x39')){return![];}return!![];};exports[_0x5fce('0x84')]=function(_0x58261f,_0x51fe34){var _0x55b19e,_0x42d0c3,_0xe43048;if(_0x51fe34<=0x0){_0x51fe34=0x1;}_0x55b19e=new RegExp(_0x5fce('0x85')+_0x51fe34+'}$');_0x42d0c3=Math[_0x5fce('0x86')](0xa,_0x51fe34-0x1);_0xe43048=Math['pow'](0xa,_0x51fe34)-0x1;return util[_0x5fce('0x10')]('%s',_['replace'](_0x58261f,_0x55b19e,_[_0x5fce('0x87')](_0x42d0c3,_0xe43048)));};exports[_0x5fce('0x88')]=function(_0x9e843d){var _0x14d53d=_0x9e843d[_0x5fce('0x89')](/"(.*?)"/);return _0x14d53d?_0x14d53d[0x1]:_0x9e843d;};exports[_0x5fce('0x8a')]=function(_0x3d6926){var _0x317fae=_0x3d6926[_0x5fce('0x89')](/<(.*?)>/);return _0x317fae?_0x317fae[0x1]:_0x3d6926;};function buildNoAnswerEventPayload(_0x7dd287,_0x204e3a){var _0x41282e=buildObj(_0x7dd287,_0x5fce('0x8b'));if(!_[_0x5fce('0x11')](_0x204e3a[_0x5fce('0x8c')])){Object[_0x5fce('0x8d')](_0x204e3a[_0x5fce('0x8c')])[_0x5fce('0x8e')](function(_0x160565){_0x41282e[_0x160565[_0x5fce('0x8f')]()]=_0x204e3a[_0x5fce('0x8c')][_0x160565];});}return _0x41282e;}exports[_0x5fce('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 98cdc3c..f47bd24 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 _0xf687=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','reload'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf687,0x1cf));var _0x7f68=function(_0x1e46e0,_0x5c4908){_0x1e46e0=_0x1e46e0-0x0;var _0x330742=_0xf687[_0x1e46e0];return _0x330742;};'use strict';exports[_0x7f68('0x0')]={'queue':{'type':_0x7f68('0x1'),'required':!![]},'interface':{'type':_0x7f68('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x7f68('0x2'),'required':![]},'paused':{'type':_0x7f68('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x7f68('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0x7f68('0x1'),'required':!![]},'paused':{'type':_0x7f68('0x3')},'reason':{'type':_0x7f68('0x1'),'required':![]}};exports[_0x7f68('0x4')]={'module':{'type':'string','required':![]}};exports[_0x7f68('0x5')]={'uniqueid':{'type':_0x7f68('0x1'),'required':!![]}};exports[_0x7f68('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x7f68('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x7f68('0x1')}};exports[_0x7f68('0x7')]={'uniqueid':{'type':_0x7f68('0x1'),'required':!![]}};exports[_0x7f68('0x8')]={'uniqueid':{'type':_0x7f68('0x1'),'required':!![]},'exten':{'type':_0x7f68('0x1'),'required':!![]},'context':{'type':_0x7f68('0x1')}}; \ No newline at end of file +var _0xb3af=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queuepause','reload','voicequeuechannel'];(function(_0x2cb8da,_0xe38454){var _0x39d76b=function(_0x587c8d){while(--_0x587c8d){_0x2cb8da['push'](_0x2cb8da['shift']());}};_0x39d76b(++_0xe38454);}(_0xb3af,0x1b3));var _0xfb3a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb3af[_0x5d2803];return _0xdcad2c;};'use strict';exports[_0xfb3a('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xfb3a('0x1'),'required':!![]},'membername':{'type':_0xfb3a('0x1'),'required':!![]},'penalty':{'type':_0xfb3a('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xfb3a('0x1'),'required':!![]},'interface':{'type':_0xfb3a('0x1'),'required':!![]}};exports[_0xfb3a('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xfb3a('0x1'),'required':![]}};exports[_0xfb3a('0x4')]={'module':{'type':_0xfb3a('0x1'),'required':![]}};exports[_0xfb3a('0x5')]={'uniqueid':{'type':_0xfb3a('0x1'),'required':!![]}};exports[_0xfb3a('0x6')]={'uniqueid':{'type':_0xfb3a('0x1'),'required':!![]},'filename':{'type':_0xfb3a('0x1')},'format':{'type':_0xfb3a('0x1')},'mixmonitorid':{'type':_0xfb3a('0x1')}};exports[_0xfb3a('0x7')]={'uniqueid':{'type':_0xfb3a('0x1'),'required':!![]}};exports[_0xfb3a('0x8')]={'uniqueid':{'type':_0xfb3a('0x1'),'required':!![]},'exten':{'type':_0xfb3a('0x1'),'required':!![]},'context':{'type':_0xfb3a('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 41b688a..14ca4db 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 _0xbd9e=['outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTrunks','trunks','initVoiceQueues','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallercompleteAt','queuecallerabandonAt','seconds','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','campaigns','outbound','voiceExtensions','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','isNil','interface','SIP/%s','name','total','answered','sumDuration','sumBillable','isEmpty','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay'];(function(_0x50ae98,_0x3f1749){var _0x43e7b4=function(_0x14e201){while(--_0x14e201){_0x50ae98['push'](_0x50ae98['shift']());}};_0x43e7b4(++_0x3f1749);}(_0xbd9e,0x108));var _0xebd9=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xbd9e[_0xdea41a];return _0x15d0d8;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xebd9('0x0'));var Agent=require('../model/agent');var Telephone=require(_0xebd9('0x1'));var Trunk=require(_0xebd9('0x2'));var VoiceQueue=require(_0xebd9('0x3'));var Trigger=require(_0xebd9('0x4'));var Template=require(_0xebd9('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xebd9('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xebd9('0x7'));var FreshdeskAccount=require(_0xebd9('0x8'));var SugarcrmAccount=require(_0xebd9('0x9'));var ZohoAccount=require(_0xebd9('0xa'));var DeskAccount=require(_0xebd9('0xb'));var VtigerAccount=require(_0xebd9('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xebd9('0xd'));var FreshsalesAccount=require(_0xebd9('0xe'));var FaxAccount=require(_0xebd9('0xf'));var Realtime=function(){this[_0xebd9('0x10')]={};this[_0xebd9('0x11')]={};this['trunks']={};this[_0xebd9('0x12')]={};this['triggers']={};this[_0xebd9('0x13')]={};this['templates']={};this[_0xebd9('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xebd9('0x15')]={};this['channels']={};this[_0xebd9('0x16')]={};this[_0xebd9('0x17')]={};this['timers']={};this[_0xebd9('0x18')]={};this[_0xebd9('0x19')]={};this[_0xebd9('0x1a')]={};this[_0xebd9('0x1b')]={};this['freshdeskAccounts']={};this[_0xebd9('0x1c')]={};this[_0xebd9('0x1d')]={};this[_0xebd9('0x1e')]={};this[_0xebd9('0x1f')]={};this[_0xebd9('0x20')]={};this[_0xebd9('0x21')]={};this[_0xebd9('0x22')]={};};function freeIsNotKey(_0x35095e,_0x1ecb8f,_0x2767fb){var _0x37cdf3=_[_0xebd9('0x23')](_0x35095e,function(_0x296341,_0x296ff1){return _0x296341[_0x2767fb];});for(var _0x4d04cb in _0x1ecb8f){if(_0x1ecb8f[_0xebd9('0x24')](_0x4d04cb)){if(!_0x37cdf3[_0x4d04cb]){delete _0x1ecb8f[_0x4d04cb];}}}}function freeIsNotKeySip(_0x8310f2,_0x32dec8){var _0x4d793e=_[_0xebd9('0x23')](_0x8310f2,function(_0x58086a,_0x13372c){return util[_0xebd9('0x25')]('SIP/%s',_0x58086a['name']);});for(var _0x5701cd in _0x32dec8){if(_0x32dec8[_0xebd9('0x24')](_0x5701cd)){if(!_0x4d793e[_0x5701cd]){delete _0x32dec8[_0x5701cd];}}}}function freeIsNotKeyAgent(_0x280221,_0x36bc37){var _0x4efca4=_[_0xebd9('0x23')](_0x280221,function(_0x44fa41,_0x3fb488){var _0x2c17c8=_[_0xebd9('0x26')](_0x44fa41[_0xebd9('0x27')])?util['format'](_0xebd9('0x28'),_0x44fa41[_0xebd9('0x29')]):_0x44fa41['interface'];return _0x2c17c8;});for(var _0x556f05 in _0x36bc37){if(_0x36bc37[_0xebd9('0x24')](_0x556f05)){if(!_0x4efca4[_0x556f05]){delete _0x36bc37[_0x556f05];}}}}function clearVoiceCallReports(_0x2da17b){_0x2da17b[_0xebd9('0x2a')]=0x0;_0x2da17b[_0xebd9('0x2b')]=0x0;_0x2da17b['sumHoldTime']=0x0;_0x2da17b[_0xebd9('0x2c')]=0x0;_0x2da17b[_0xebd9('0x2d')]=0x0;}function clearCampaigns(_0x2ef023){if(!_[_0xebd9('0x2e')](_0x2ef023)){for(var _0x5548ae in _0x2ef023){if(_0x2ef023[_0xebd9('0x24')](_0x5548ae)){_0x2ef023[_0x5548ae]['ivrTotalCallsDays']=0x0;_0x2ef023[_0x5548ae]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x449c4b){if(!_[_0xebd9('0x2e')](_0x449c4b)){for(var _0x4349bc in _0x449c4b){if(_0x449c4b[_0xebd9('0x24')](_0x4349bc)){_0x449c4b[_0x4349bc][_0xebd9('0x2a')]=0x0;_0x449c4b[_0x4349bc]['answered']=0x0;_0x449c4b[_0x4349bc]['unmanaged']=0x0;_0x449c4b[_0x4349bc]['abandoned']=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x2f')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x2c')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x2d')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x30')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x31')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x32')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x33')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x34')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x35')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x36')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x37')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x38')]=0x0;_0x449c4b[_0x4349bc]['outboundOriginateFailureCallsDay']=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x39')]=0x0;_0x449c4b[_0x4349bc]['outboundReCallsDay']=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x30')]=0x0;_0x449c4b[_0x4349bc][_0xebd9('0x3a')]=0x0;_0x449c4b[_0x4349bc]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0xebd9('0x3b')]=function(_0x1d90bb,_0x3e0aac){for(var _0x249a69 in _0x3e0aac){if(_0x1d90bb[_0xebd9('0x24')](_0x249a69)){_0x1d90bb[_0x249a69]=_0x3e0aac[_0x249a69];}}};Realtime[_0xebd9('0x3c')][_0xebd9('0x3d')]=function(){var _0x2d7db8=this;return function(_0x4d21b3){if(_0x4d21b3){freeIsNotKeyAgent(_0x4d21b3,_0x2d7db8[_0xebd9('0x10')]);for(var _0x1608f2=0x0,_0x2dec09={},_0x30525f={};_0x1608f2<_0x4d21b3[_0xebd9('0x3e')];_0x1608f2+=0x1){_0x2dec09=_0x4d21b3[_0x1608f2];var _0xfa23d5=_[_0xebd9('0x26')](_0x2dec09[_0xebd9('0x27')])?util[_0xebd9('0x25')]('SIP/%s',_0x2dec09[_0xebd9('0x29')]):_0x2dec09['interface'];if(_[_0xebd9('0x3f')](_0x2d7db8[_0xebd9('0x10')][_0xfa23d5])){_0x2d7db8[_0xebd9('0x10')][_0xfa23d5]=new Agent(_0x2dec09);}else{_0x2d7db8[_0xebd9('0x3b')](_0x2d7db8['agents'][_0xfa23d5],_0x2dec09);}}}return _0x2d7db8[_0xebd9('0x10')];};};Realtime[_0xebd9('0x3c')]['initTelephones']=function(){var _0x416d13=this;return function(_0x55af7e){if(_0x55af7e){freeIsNotKeySip(_0x55af7e,_0x416d13[_0xebd9('0x11')]);for(var _0x499236=0x0,_0x390002={},_0x49ba42={};_0x499236<_0x55af7e[_0xebd9('0x3e')];_0x499236+=0x1){_0x390002=_0x55af7e[_0x499236];if(_[_0xebd9('0x3f')](_0x416d13['telephones'][util[_0xebd9('0x25')](_0xebd9('0x28'),_0x390002[_0xebd9('0x29')])])){_0x416d13['telephones'][util[_0xebd9('0x25')]('SIP/%s',_0x390002[_0xebd9('0x29')])]=new Telephone(_0x390002);}else{_0x416d13[_0xebd9('0x3b')](_0x416d13[_0xebd9('0x11')][util[_0xebd9('0x25')](_0xebd9('0x28'),_0x390002[_0xebd9('0x29')])],_0x390002);}}}return _0x416d13[_0xebd9('0x11')];};};Realtime['prototype'][_0xebd9('0x40')]=function(){var _0x3a96b1=this;return function(_0x50c3ff){if(_0x50c3ff){freeIsNotKeySip(_0x50c3ff,_0x3a96b1['trunks']);for(var _0x5488ae=0x0,_0x470669={},_0x15c7c7={};_0x5488ae<_0x50c3ff[_0xebd9('0x3e')];_0x5488ae+=0x1){_0x470669=_0x50c3ff[_0x5488ae];if(_[_0xebd9('0x3f')](_0x3a96b1[_0xebd9('0x41')][util[_0xebd9('0x25')]('SIP/%s',_0x470669[_0xebd9('0x29')])])){_0x3a96b1['trunks'][util[_0xebd9('0x25')](_0xebd9('0x28'),_0x470669['name'])]=new Trunk(_0x470669);}else{_0x3a96b1['mergeFromDatabase'](_0x3a96b1['trunks'][util[_0xebd9('0x25')](_0xebd9('0x28'),_0x470669[_0xebd9('0x29')])],_0x470669);}}}return _0x3a96b1[_0xebd9('0x41')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x42')]=function(){var _0xf16375=this;return function(_0x1cdcac){if(_0x1cdcac){freeIsNotKey(_0x1cdcac,_0xf16375['voiceQueues'],_0xebd9('0x29'));for(var _0x4b58f8=0x0,_0x18cf2a={},_0x4764f6={};_0x4b58f8<_0x1cdcac[_0xebd9('0x3e')];_0x4b58f8+=0x1){_0x18cf2a=_0x1cdcac[_0x4b58f8];if(_['isUndefined'](_0xf16375[_0xebd9('0x12')][_0x18cf2a[_0xebd9('0x29')]])){_0xf16375[_0xebd9('0x12')][_0x18cf2a['name']]=new VoiceQueue(_0x18cf2a);}else{_0xf16375[_0xebd9('0x3b')](_0xf16375[_0xebd9('0x12')][_0x18cf2a[_0xebd9('0x29')]],_0x18cf2a);}}}return _0xf16375[_0xebd9('0x12')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x43')]=function(){var _0x2035a0=this;return function(_0x1e18e7){if(_0x1e18e7){freeIsNotKey(_0x1e18e7,_0x2035a0['triggers'],'id');for(var _0x3dad29=0x0,_0x498184={},_0x3715d5={};_0x3dad29<_0x1e18e7['length'];_0x3dad29+=0x1){_0x498184=_0x1e18e7[_0x3dad29];if(_[_0xebd9('0x3f')](_0x2035a0[_0xebd9('0x44')][_0x498184['id']])){_0x2035a0[_0xebd9('0x44')][_0x498184['id']]=new Trigger(_0x498184);}else{_0x2035a0[_0xebd9('0x3b')](_0x2035a0[_0xebd9('0x44')][_0x498184['id']],_0x498184);}}}return _0x2035a0[_0xebd9('0x44')];};};Realtime['prototype'][_0xebd9('0x45')]=function(){var _0x59df76=this;return function(_0x330431){if(_0x330431){freeIsNotKey(_0x330431,_0x59df76[_0xebd9('0x46')],'id');for(var _0xb46587=0x0,_0x393dc5={},_0x299ea4={};_0xb46587<_0x330431[_0xebd9('0x3e')];_0xb46587+=0x1){_0x393dc5=_0x330431[_0xb46587];if(_[_0xebd9('0x3f')](_0x59df76[_0xebd9('0x46')][_0x393dc5['id']])){_0x59df76[_0xebd9('0x46')][_0x393dc5['id']]=new Template(_0x393dc5);}else{_0x59df76[_0xebd9('0x3b')](_0x59df76[_0xebd9('0x46')][_0x393dc5['id']],_0x393dc5);}}}return _0x59df76[_0xebd9('0x46')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x47')]=function(){var _0x4843df=this;return function(_0x58fe54){if(_0x58fe54){freeIsNotKey(_0x58fe54,_0x4843df[_0xebd9('0x19')],'id');for(var _0x53fcaa=0x0,_0x1d8abe={},_0x2efc6e={};_0x53fcaa<_0x58fe54[_0xebd9('0x3e')];_0x53fcaa+=0x1){_0x1d8abe=_0x58fe54[_0x53fcaa];if(_[_0xebd9('0x3f')](_0x4843df[_0xebd9('0x19')][_0x1d8abe['id']])){_0x4843df[_0xebd9('0x19')][_0x1d8abe['id']]=new ZendeskAccount(_0x1d8abe);}else{_0x4843df[_0xebd9('0x3b')](_0x4843df['zendeskAccounts'][_0x1d8abe['id']],_0x1d8abe);}}}return _0x4843df[_0xebd9('0x19')];};};Realtime['prototype'][_0xebd9('0x48')]=function(){var _0x42f0bf=this;return function(_0x1454c0){if(_0x1454c0){freeIsNotKey(_0x1454c0,_0x42f0bf['salesforceAccounts'],'id');for(var _0x2cff34=0x0,_0xa40470={},_0x5487f6={};_0x2cff34<_0x1454c0[_0xebd9('0x3e')];_0x2cff34+=0x1){_0xa40470=_0x1454c0[_0x2cff34];if(_[_0xebd9('0x3f')](_0x42f0bf[_0xebd9('0x1a')][_0xa40470['id']])){_0x42f0bf[_0xebd9('0x1a')][_0xa40470['id']]=new SalesforceAccount(_0xa40470);}else{_0x42f0bf[_0xebd9('0x3b')](_0x42f0bf['salesforceAccounts'][_0xa40470['id']],_0xa40470);}}}return _0x42f0bf[_0xebd9('0x1a')];};};Realtime['prototype'][_0xebd9('0x49')]=function(){var _0x5cae61=this;return function(_0xdcaf11){if(_0xdcaf11){freeIsNotKey(_0xdcaf11,_0x5cae61[_0xebd9('0x4a')],'id');for(var _0x3a899a=0x0,_0x1e3ccb={},_0x54f23f={};_0x3a899a<_0xdcaf11[_0xebd9('0x3e')];_0x3a899a+=0x1){_0x1e3ccb=_0xdcaf11[_0x3a899a];if(_[_0xebd9('0x3f')](_0x5cae61['freshdeskAccounts'][_0x1e3ccb['id']])){_0x5cae61[_0xebd9('0x4a')][_0x1e3ccb['id']]=new FreshdeskAccount(_0x1e3ccb);}else{_0x5cae61[_0xebd9('0x3b')](_0x5cae61[_0xebd9('0x4a')][_0x1e3ccb['id']],_0x1e3ccb);}}}return _0x5cae61[_0xebd9('0x4a')];};};Realtime['prototype'][_0xebd9('0x4b')]=function(){var _0x263043=this;return function(_0x51bac9){if(_0x51bac9){freeIsNotKey(_0x51bac9,_0x263043[_0xebd9('0x1c')],'id');for(var _0xe0a921=0x0,_0x2ffb03={},_0x4432e3={};_0xe0a921<_0x51bac9['length'];_0xe0a921+=0x1){_0x2ffb03=_0x51bac9[_0xe0a921];if(_[_0xebd9('0x3f')](_0x263043['zohoAccounts'][_0x2ffb03['id']])){_0x263043[_0xebd9('0x1c')][_0x2ffb03['id']]=new ZohoAccount(_0x2ffb03);}else{_0x263043[_0xebd9('0x3b')](_0x263043[_0xebd9('0x1c')][_0x2ffb03['id']],_0x2ffb03);}}}return _0x263043[_0xebd9('0x1c')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x4c')]=function(){var _0x4808b4=this;return function(_0x3eabc8){if(_0x3eabc8){freeIsNotKey(_0x3eabc8,_0x4808b4['deskAccounts'],'id');for(var _0x5b2ac3=0x0,_0x144c4b={},_0x48a43d={};_0x5b2ac3<_0x3eabc8[_0xebd9('0x3e')];_0x5b2ac3+=0x1){_0x144c4b=_0x3eabc8[_0x5b2ac3];if(_['isUndefined'](_0x4808b4[_0xebd9('0x1d')][_0x144c4b['id']])){_0x4808b4[_0xebd9('0x1d')][_0x144c4b['id']]=new DeskAccount(_0x144c4b);}else{_0x4808b4[_0xebd9('0x3b')](_0x4808b4['deskAccounts'][_0x144c4b['id']],_0x144c4b);}}}return _0x4808b4[_0xebd9('0x1d')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x4d')]=function(){var _0x43d2c8=this;return function(_0x1e6ff3){if(_0x1e6ff3){freeIsNotKey(_0x1e6ff3,_0x43d2c8[_0xebd9('0x1b')],'id');for(var _0x307e35=0x0,_0x4b04b1={},_0x5056c0={};_0x307e35<_0x1e6ff3[_0xebd9('0x3e')];_0x307e35+=0x1){_0x4b04b1=_0x1e6ff3[_0x307e35];if(_[_0xebd9('0x3f')](_0x43d2c8[_0xebd9('0x1b')][_0x4b04b1['id']])){_0x43d2c8[_0xebd9('0x1b')][_0x4b04b1['id']]=new SugarcrmAccount(_0x4b04b1);}else{_0x43d2c8['mergeFromDatabase'](_0x43d2c8['sugarcrmAccounts'][_0x4b04b1['id']],_0x4b04b1);}}}return _0x43d2c8['sugarcrmAccounts'];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x4e')]=function(){var _0x16263a=this;return function(_0x1ca4ab){if(_0x1ca4ab){freeIsNotKey(_0x1ca4ab,_0x16263a[_0xebd9('0x1e')],'id');for(var _0x107e73=0x0,_0x4c01fa={},_0x5d69dc={};_0x107e73<_0x1ca4ab[_0xebd9('0x3e')];_0x107e73+=0x1){_0x4c01fa=_0x1ca4ab[_0x107e73];if(_[_0xebd9('0x3f')](_0x16263a[_0xebd9('0x1e')][_0x4c01fa['id']])){_0x16263a[_0xebd9('0x1e')][_0x4c01fa['id']]=new VtigerAccount(_0x4c01fa);}else{_0x16263a[_0xebd9('0x3b')](_0x16263a[_0xebd9('0x1e')][_0x4c01fa['id']],_0x4c01fa);}}}return _0x16263a[_0xebd9('0x1e')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x4f')]=function(){var _0x305388=this;return function(_0x1c8f1a){if(_0x1c8f1a){freeIsNotKey(_0x1c8f1a,_0x305388[_0xebd9('0x1f')],'id');for(var _0x23f665=0x0,_0x1235c1={},_0x9a5709={};_0x23f665<_0x1c8f1a[_0xebd9('0x3e')];_0x23f665+=0x1){_0x1235c1=_0x1c8f1a[_0x23f665];if(_['isUndefined'](_0x305388[_0xebd9('0x1f')][_0x1235c1['id']])){_0x305388[_0xebd9('0x1f')][_0x1235c1['id']]=new ServicenowAccount(_0x1235c1);}else{_0x305388[_0xebd9('0x3b')](_0x305388[_0xebd9('0x1f')][_0x1235c1['id']],_0x1235c1);}}}return _0x305388[_0xebd9('0x1f')];};};Realtime[_0xebd9('0x3c')]['initDynamics365Accounts']=function(){var _0x11c122=this;return function(_0x4492cd){if(_0x4492cd){freeIsNotKey(_0x4492cd,_0x11c122[_0xebd9('0x20')],'id');for(var _0x518f90=0x0,_0x4ba789={},_0xc97a5={};_0x518f90<_0x4492cd['length'];_0x518f90+=0x1){_0x4ba789=_0x4492cd[_0x518f90];if(_[_0xebd9('0x3f')](_0x11c122['dynamics365Accounts'][_0x4ba789['id']])){_0x11c122[_0xebd9('0x20')][_0x4ba789['id']]=new Dynamics365Account(_0x4ba789);}else{_0x11c122[_0xebd9('0x3b')](_0x11c122[_0xebd9('0x20')][_0x4ba789['id']],_0x4ba789);}}}return _0x11c122['dynamics365Accounts'];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x50')]=function(){var _0x374b9f=this;return function(_0x1cdfef){if(_0x1cdfef){freeIsNotKey(_0x1cdfef,_0x374b9f[_0xebd9('0x21')],'id');for(var _0x35a537=0x0,_0x3a0db3={},_0x5e0afd={};_0x35a537<_0x1cdfef[_0xebd9('0x3e')];_0x35a537+=0x1){_0x3a0db3=_0x1cdfef[_0x35a537];if(_[_0xebd9('0x3f')](_0x374b9f[_0xebd9('0x21')][_0x3a0db3['id']])){_0x374b9f[_0xebd9('0x21')][_0x3a0db3['id']]=new FreshsalesAccount(_0x3a0db3);}else{_0x374b9f['mergeFromDatabase'](_0x374b9f['freshsalesAccounts'][_0x3a0db3['id']],_0x3a0db3);}}}return _0x374b9f[_0xebd9('0x21')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x51')]=function(){var _0x26756e=this;return function(_0x8e81e){for(var _0x34d97f=0x0;_0x34d97f<_0x8e81e[_0xebd9('0x3e')];_0x34d97f+=0x1){_['merge'](_0x26756e[_0xebd9('0x12')][_0x8e81e[_0x34d97f][_0xebd9('0x29')]],_0x8e81e[_0x34d97f]);}return _0x26756e[_0xebd9('0x12')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x52')]=function(){var _0x216099=this;return function(_0x38ccb6){clearVoiceQueues(_0x216099[_0xebd9('0x12')]);if(_0x38ccb6){_0x38ccb6=_[_0xebd9('0x53')](_0x38ccb6,_0xebd9('0x54'));for(var _0x4fe551 in _0x38ccb6){if(_0x38ccb6[_0xebd9('0x24')](_0x4fe551)){var _0xe660a3={};for(var _0x572469=0x0;_0x572469<_0x38ccb6[_0x4fe551][_0xebd9('0x3e')];_0x572469+=0x1){var _0x4ac9e0=_0x38ccb6[_0x4fe551][_0x572469][_0xebd9('0x55')];if(_0x216099[_0xebd9('0x12')][_0x4ac9e0]){if(_0x38ccb6[_0x4fe551][_0x572469][_0xebd9('0x56')]){_0x216099[_0xebd9('0x12')][_0x4ac9e0][_0xebd9('0x57')]+=0x1;}if(_0x38ccb6[_0x4fe551][_0x572469][_0xebd9('0x58')]){_0x216099[_0xebd9('0x12')][_0x4ac9e0][_0xebd9('0x59')]+=0x1;}_0x216099[_0xebd9('0x12')][_0x4ac9e0][_0xebd9('0x2f')]+=moment(_0x38ccb6[_0x4fe551][_0x572469][_0xebd9('0x5a')])[_0xebd9('0x5b')](moment(_0x38ccb6[_0x4fe551][_0x572469]['queuecallerjoinAt']),'seconds')||0x0;if(_0x572469===_0x38ccb6[_0x4fe551][_0xebd9('0x3e')]-0x1){_0x216099[_0xebd9('0x12')][_0x4ac9e0][_0xebd9('0x2c')]+=moment(_0x38ccb6[_0x4fe551][_0x572469][_0xebd9('0x5c')]||_0x38ccb6[_0x4fe551][_0x572469][_0xebd9('0x5d')]||_0x38ccb6[_0x4fe551][_0x572469]['queuecallerexitAt'])['diff'](moment(_0x38ccb6[_0x4fe551][_0x572469]['queuecallerjoinAt']),_0xebd9('0x5e'))||0x0;_0x216099[_0xebd9('0x12')][_0x4ac9e0]['total']+=0x1;if(_0x38ccb6[_0x4fe551][_0x572469]['queuecallercomplete']){_0x216099[_0xebd9('0x12')][_0x4ac9e0][_0xebd9('0x2b')]+=0x1;_0x216099[_0xebd9('0x12')][_0x4ac9e0][_0xebd9('0x2d')]+=moment(_0x38ccb6[_0x4fe551][_0x572469][_0xebd9('0x5c')])['diff'](moment(_0x38ccb6[_0x4fe551][_0x572469][_0xebd9('0x5a')]),_0xebd9('0x5e'))||0x0;}}else{_0x216099[_0xebd9('0x12')][_0x4ac9e0][_0xebd9('0x2c')]+=_0x216099[_0xebd9('0x12')][_0x4ac9e0][_0xebd9('0x2f')]||0x0;}}}}}}return _0x216099[_0xebd9('0x12')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0xb225c9=this;return function(_0x337e28){clearVoiceCallReports(_0xb225c9[_0xebd9('0x14')]);if(_0x337e28){for(var _0x4f0fdd=0x0;_0x4f0fdd<_0x337e28[_0xebd9('0x3e')];_0x4f0fdd+=0x1){_0xb225c9['outbound'][_0xebd9('0x2a')]+=0x1;_0xb225c9['outbound'][_0xebd9('0x2c')]+=_0x337e28[_0x4f0fdd][_0xebd9('0x5f')];if(_0x337e28[_0x4f0fdd][_0xebd9('0x60')]==='ANSWERED'){_0xb225c9[_0xebd9('0x14')][_0xebd9('0x2b')]+=0x1;_0xb225c9[_0xebd9('0x14')][_0xebd9('0x2f')]+=_0x337e28[_0x4f0fdd]['duration']-_0x337e28[_0x4f0fdd][_0xebd9('0x61')]||0x0;_0xb225c9[_0xebd9('0x14')][_0xebd9('0x2d')]+=_0x337e28[_0x4f0fdd][_0xebd9('0x61')];}}}return _0xb225c9[_0xebd9('0x14')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x62')]=function(){var _0x169b09=this;return function(_0x4b3104){if(_0x4b3104){freeIsNotKey(_0x4b3104,_0x169b09[_0xebd9('0x13')],'name');for(var _0x1a1204=0x0,_0x5811c3={};_0x1a1204<_0x4b3104[_0xebd9('0x3e')];_0x1a1204+=0x1){_0x5811c3=_0x4b3104[_0x1a1204];if(_[_0xebd9('0x3f')](_0x169b09[_0xebd9('0x13')][_0x5811c3[_0xebd9('0x29')]])){_0x169b09[_0xebd9('0x13')][_0x5811c3[_0xebd9('0x29')]]=new Campaign(_0x5811c3);}else{_0x169b09[_0xebd9('0x3b')](_0x169b09['campaigns'][_0x5811c3[_0xebd9('0x29')]],_0x5811c3);_0x169b09[_0xebd9('0x13')][_0x5811c3[_0xebd9('0x29')]][_0xebd9('0x63')]=_0x5811c3[_0xebd9('0x64')]?_0x5811c3['SquareProject'][_0xebd9('0x29')]:undefined;}}}return _0x169b09[_0xebd9('0x13')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x65')]=function(){var _0x5d5ad3=this;return function(_0x4b72ab){if(_0x4b72ab){freeIsNotKey(_0x4b72ab,_0x5d5ad3[_0xebd9('0x15')],'id');for(var _0x5b43b0=0x0,_0x168115={};_0x5b43b0<_0x4b72ab['length'];_0x5b43b0+=0x1){_0x168115=_0x4b72ab[_0x5b43b0];if(_[_0xebd9('0x3f')](_0x5d5ad3[_0xebd9('0x15')][_0x168115['id']])){_0x5d5ad3['voiceExtensions'][_0x168115['id']]=new VoiceExtension(_0x168115);}else{_0x5d5ad3[_0xebd9('0x3b')](_0x5d5ad3[_0xebd9('0x15')][_0x168115['id']],_0x168115);}}}return _0x5d5ad3[_0xebd9('0x15')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x66')]=function(){var _0x33953d=this;return function(_0x2f9b0c){clearCampaigns(_0x33953d[_0xebd9('0x13')]);for(var _0x2fd0a8=0x0;_0x2fd0a8<_0x2f9b0c[_0xebd9('0x3e')];_0x2fd0a8+=0x1){_[_0xebd9('0x67')](_0x33953d[_0xebd9('0x13')][_0x2f9b0c[_0x2fd0a8]['name']],_0x2f9b0c[_0x2fd0a8]);}return _0x33953d[_0xebd9('0x13')];};};Realtime[_0xebd9('0x3c')][_0xebd9('0x68')]=function(){var _0x2ecfeb=this;return function(_0xe87519){if(_0xe87519){freeIsNotKey(_0xe87519,_0x2ecfeb['faxAccounts'],'id');for(var _0x2b1814=0x0,_0x1af907={},_0xcd0f5={};_0x2b1814<_0xe87519[_0xebd9('0x3e')];_0x2b1814+=0x1){_0x1af907=_0xe87519[_0x2b1814];if(_[_0xebd9('0x3f')](_0x2ecfeb['faxAccounts'][_0x1af907['id']])){_0x2ecfeb['faxAccounts'][_0x1af907['id']]=new FaxAccount(_0x1af907);}else{_0x2ecfeb['mergeFromDatabase'](_0x2ecfeb[_0xebd9('0x22')][_0x1af907['id']],_0x1af907);}}}return _0x2ecfeb[_0xebd9('0x22')];};};module[_0xebd9('0x69')]=Realtime; \ No newline at end of file +var _0x8028=['queuecallerexitAt','seconds','queuecallercomplete','answered','initVoiceCallReports','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initFaxAccounts','exports','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','triggers','templates','outbound','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','SIP/%s','name','isNil','interface','total','sumDuration','sumBillable','isEmpty','hasOwnProperty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','sumHoldTime','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','prototype','initAgents','length','initTelephones','isUndefined','format','mergeFromDatabase','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','unmanaged','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x8028,0xcc));var _0x8802=function(_0x5810e3,_0x503067){_0x5810e3=_0x5810e3-0x0;var _0xb64418=_0x8028[_0x5810e3];return _0xb64418;};'use strict';var util=require('util');var _=require(_0x8802('0x0'));var moment=require('moment');var Agent=require(_0x8802('0x1'));var Telephone=require('../model/telephone');var Trunk=require(_0x8802('0x2'));var VoiceQueue=require(_0x8802('0x3'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x8802('0x4'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x8802('0x5'));var FaxAccount=require(_0x8802('0x6'));var Realtime=function(){this[_0x8802('0x7')]={};this[_0x8802('0x8')]={};this[_0x8802('0x9')]={};this['voiceQueues']={};this[_0x8802('0xa')]={};this['campaigns']={};this[_0x8802('0xb')]={};this[_0x8802('0xc')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0x8802('0xd')]={};this[_0x8802('0xe')]={};this[_0x8802('0xf')]={};this[_0x8802('0x10')]={};this['zendeskAccounts']={};this[_0x8802('0x11')]={};this[_0x8802('0x12')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0x8802('0x13')]={};this[_0x8802('0x14')]={};this['freshsalesAccounts']={};this[_0x8802('0x15')]={};};function freeIsNotKey(_0x5584e3,_0x48c497,_0x5bbc04){var _0x132f3b=_[_0x8802('0x16')](_0x5584e3,function(_0x19ebe0,_0x1aa59e){return _0x19ebe0[_0x5bbc04];});for(var _0x2e414e in _0x48c497){if(_0x48c497['hasOwnProperty'](_0x2e414e)){if(!_0x132f3b[_0x2e414e]){delete _0x48c497[_0x2e414e];}}}}function freeIsNotKeySip(_0x378b7c,_0x5bf6b6){var _0x35e71a=_[_0x8802('0x16')](_0x378b7c,function(_0x4439ec,_0x693170){return util['format'](_0x8802('0x17'),_0x4439ec[_0x8802('0x18')]);});for(var _0x3173f8 in _0x5bf6b6){if(_0x5bf6b6['hasOwnProperty'](_0x3173f8)){if(!_0x35e71a[_0x3173f8]){delete _0x5bf6b6[_0x3173f8];}}}}function freeIsNotKeyAgent(_0x22d63b,_0xf8b072){var _0x582adf=_[_0x8802('0x16')](_0x22d63b,function(_0x49e623,_0x5ec831){var _0x38c7cf=_[_0x8802('0x19')](_0x49e623[_0x8802('0x1a')])?util['format'](_0x8802('0x17'),_0x49e623[_0x8802('0x18')]):_0x49e623[_0x8802('0x1a')];return _0x38c7cf;});for(var _0x258436 in _0xf8b072){if(_0xf8b072['hasOwnProperty'](_0x258436)){if(!_0x582adf[_0x258436]){delete _0xf8b072[_0x258436];}}}}function clearVoiceCallReports(_0xddc503){_0xddc503[_0x8802('0x1b')]=0x0;_0xddc503['answered']=0x0;_0xddc503['sumHoldTime']=0x0;_0xddc503[_0x8802('0x1c')]=0x0;_0xddc503[_0x8802('0x1d')]=0x0;}function clearCampaigns(_0x61091d){if(!_[_0x8802('0x1e')](_0x61091d)){for(var _0x2749b4 in _0x61091d){if(_0x61091d[_0x8802('0x1f')](_0x2749b4)){_0x61091d[_0x2749b4][_0x8802('0x20')]=0x0;_0x61091d[_0x2749b4][_0x8802('0x21')]=0x0;}}}}function clearVoiceQueues(_0x109d57){if(!_[_0x8802('0x1e')](_0x109d57)){for(var _0xeb6aec in _0x109d57){if(_0x109d57[_0x8802('0x1f')](_0xeb6aec)){_0x109d57[_0xeb6aec][_0x8802('0x1b')]=0x0;_0x109d57[_0xeb6aec]['answered']=0x0;_0x109d57[_0xeb6aec]['unmanaged']=0x0;_0x109d57[_0xeb6aec][_0x8802('0x22')]=0x0;_0x109d57[_0xeb6aec][_0x8802('0x23')]=0x0;_0x109d57[_0xeb6aec]['sumDuration']=0x0;_0x109d57[_0xeb6aec]['sumBillable']=0x0;_0x109d57[_0xeb6aec]['outboundAnswerAgiCallsDay']=0x0;_0x109d57[_0xeb6aec]['outboundNoAnswerCallsDay']=0x0;_0x109d57[_0xeb6aec][_0x8802('0x24')]=0x0;_0x109d57[_0xeb6aec][_0x8802('0x25')]=0x0;_0x109d57[_0xeb6aec]['outboundNoSuchCallsDay']=0x0;_0x109d57[_0xeb6aec]['outboundUnknownCallsDay']=0x0;_0x109d57[_0xeb6aec][_0x8802('0x26')]=0x0;_0x109d57[_0xeb6aec][_0x8802('0x27')]=0x0;_0x109d57[_0xeb6aec]['outboundBlacklistCallsDay']=0x0;_0x109d57[_0xeb6aec][_0x8802('0x28')]=0x0;_0x109d57[_0xeb6aec][_0x8802('0x29')]=0x0;_0x109d57[_0xeb6aec]['outboundReCallsDay']=0x0;_0x109d57[_0xeb6aec][_0x8802('0x2a')]=0x0;_0x109d57[_0xeb6aec]['outboundAnswerCallsDay']=0x0;_0x109d57[_0xeb6aec]['queueStatusComplete']=!![];}}}}Realtime[_0x8802('0x2b')]['mergeFromDatabase']=function(_0x33ff1a,_0x2e5a43){for(var _0x33df70 in _0x2e5a43){if(_0x33ff1a[_0x8802('0x1f')](_0x33df70)){_0x33ff1a[_0x33df70]=_0x2e5a43[_0x33df70];}}};Realtime[_0x8802('0x2b')][_0x8802('0x2c')]=function(){var _0x153730=this;return function(_0x1098ee){if(_0x1098ee){freeIsNotKeyAgent(_0x1098ee,_0x153730[_0x8802('0x7')]);for(var _0x48cc50=0x0,_0x18154e={},_0x3a2fc9={};_0x48cc50<_0x1098ee[_0x8802('0x2d')];_0x48cc50+=0x1){_0x18154e=_0x1098ee[_0x48cc50];var _0x20a7ab=_[_0x8802('0x19')](_0x18154e[_0x8802('0x1a')])?util['format'](_0x8802('0x17'),_0x18154e[_0x8802('0x18')]):_0x18154e[_0x8802('0x1a')];if(_['isUndefined'](_0x153730['agents'][_0x20a7ab])){_0x153730[_0x8802('0x7')][_0x20a7ab]=new Agent(_0x18154e);}else{_0x153730['mergeFromDatabase'](_0x153730[_0x8802('0x7')][_0x20a7ab],_0x18154e);}}}return _0x153730[_0x8802('0x7')];};};Realtime['prototype'][_0x8802('0x2e')]=function(){var _0x575b73=this;return function(_0x536c9e){if(_0x536c9e){freeIsNotKeySip(_0x536c9e,_0x575b73[_0x8802('0x8')]);for(var _0x45455f=0x0,_0x596d94={},_0x56f280={};_0x45455f<_0x536c9e[_0x8802('0x2d')];_0x45455f+=0x1){_0x596d94=_0x536c9e[_0x45455f];if(_[_0x8802('0x2f')](_0x575b73['telephones'][util[_0x8802('0x30')](_0x8802('0x17'),_0x596d94[_0x8802('0x18')])])){_0x575b73[_0x8802('0x8')][util['format'](_0x8802('0x17'),_0x596d94[_0x8802('0x18')])]=new Telephone(_0x596d94);}else{_0x575b73[_0x8802('0x31')](_0x575b73[_0x8802('0x8')][util['format'](_0x8802('0x17'),_0x596d94['name'])],_0x596d94);}}}return _0x575b73['telephones'];};};Realtime[_0x8802('0x2b')][_0x8802('0x32')]=function(){var _0x3a4228=this;return function(_0x1db807){if(_0x1db807){freeIsNotKeySip(_0x1db807,_0x3a4228[_0x8802('0x9')]);for(var _0x2bc70e=0x0,_0x8ae86a={},_0x5e7505={};_0x2bc70e<_0x1db807[_0x8802('0x2d')];_0x2bc70e+=0x1){_0x8ae86a=_0x1db807[_0x2bc70e];if(_[_0x8802('0x2f')](_0x3a4228[_0x8802('0x9')][util[_0x8802('0x30')](_0x8802('0x17'),_0x8ae86a['name'])])){_0x3a4228[_0x8802('0x9')][util[_0x8802('0x30')](_0x8802('0x17'),_0x8ae86a[_0x8802('0x18')])]=new Trunk(_0x8ae86a);}else{_0x3a4228[_0x8802('0x31')](_0x3a4228[_0x8802('0x9')][util['format'](_0x8802('0x17'),_0x8ae86a['name'])],_0x8ae86a);}}}return _0x3a4228['trunks'];};};Realtime[_0x8802('0x2b')][_0x8802('0x33')]=function(){var _0x52e49c=this;return function(_0x2fa434){if(_0x2fa434){freeIsNotKey(_0x2fa434,_0x52e49c[_0x8802('0x34')],_0x8802('0x18'));for(var _0x58311f=0x0,_0x5330ec={},_0x2a58f2={};_0x58311f<_0x2fa434[_0x8802('0x2d')];_0x58311f+=0x1){_0x5330ec=_0x2fa434[_0x58311f];if(_[_0x8802('0x2f')](_0x52e49c[_0x8802('0x34')][_0x5330ec[_0x8802('0x18')]])){_0x52e49c[_0x8802('0x34')][_0x5330ec[_0x8802('0x18')]]=new VoiceQueue(_0x5330ec);}else{_0x52e49c[_0x8802('0x31')](_0x52e49c[_0x8802('0x34')][_0x5330ec[_0x8802('0x18')]],_0x5330ec);}}}return _0x52e49c[_0x8802('0x34')];};};Realtime[_0x8802('0x2b')][_0x8802('0x35')]=function(){var _0x4ee9c3=this;return function(_0x3b7078){if(_0x3b7078){freeIsNotKey(_0x3b7078,_0x4ee9c3[_0x8802('0xa')],'id');for(var _0x5d8616=0x0,_0x2554fe={},_0x392e50={};_0x5d8616<_0x3b7078[_0x8802('0x2d')];_0x5d8616+=0x1){_0x2554fe=_0x3b7078[_0x5d8616];if(_[_0x8802('0x2f')](_0x4ee9c3[_0x8802('0xa')][_0x2554fe['id']])){_0x4ee9c3[_0x8802('0xa')][_0x2554fe['id']]=new Trigger(_0x2554fe);}else{_0x4ee9c3[_0x8802('0x31')](_0x4ee9c3[_0x8802('0xa')][_0x2554fe['id']],_0x2554fe);}}}return _0x4ee9c3['triggers'];};};Realtime['prototype'][_0x8802('0x36')]=function(){var _0x11abe5=this;return function(_0x4e3791){if(_0x4e3791){freeIsNotKey(_0x4e3791,_0x11abe5[_0x8802('0xb')],'id');for(var _0x579173=0x0,_0x316bbe={},_0xed6a0d={};_0x579173<_0x4e3791['length'];_0x579173+=0x1){_0x316bbe=_0x4e3791[_0x579173];if(_[_0x8802('0x2f')](_0x11abe5[_0x8802('0xb')][_0x316bbe['id']])){_0x11abe5[_0x8802('0xb')][_0x316bbe['id']]=new Template(_0x316bbe);}else{_0x11abe5[_0x8802('0x31')](_0x11abe5[_0x8802('0xb')][_0x316bbe['id']],_0x316bbe);}}}return _0x11abe5[_0x8802('0xb')];};};Realtime[_0x8802('0x2b')][_0x8802('0x37')]=function(){var _0x265437=this;return function(_0x40947a){if(_0x40947a){freeIsNotKey(_0x40947a,_0x265437[_0x8802('0x38')],'id');for(var _0x1a94f9=0x0,_0x4d4bb6={},_0x2277a6={};_0x1a94f9<_0x40947a[_0x8802('0x2d')];_0x1a94f9+=0x1){_0x4d4bb6=_0x40947a[_0x1a94f9];if(_[_0x8802('0x2f')](_0x265437[_0x8802('0x38')][_0x4d4bb6['id']])){_0x265437['zendeskAccounts'][_0x4d4bb6['id']]=new ZendeskAccount(_0x4d4bb6);}else{_0x265437[_0x8802('0x31')](_0x265437[_0x8802('0x38')][_0x4d4bb6['id']],_0x4d4bb6);}}}return _0x265437['zendeskAccounts'];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0xec010a=this;return function(_0x4478dd){if(_0x4478dd){freeIsNotKey(_0x4478dd,_0xec010a[_0x8802('0x11')],'id');for(var _0x5c9e1f=0x0,_0x1a8bbe={},_0x56cf12={};_0x5c9e1f<_0x4478dd[_0x8802('0x2d')];_0x5c9e1f+=0x1){_0x1a8bbe=_0x4478dd[_0x5c9e1f];if(_[_0x8802('0x2f')](_0xec010a[_0x8802('0x11')][_0x1a8bbe['id']])){_0xec010a[_0x8802('0x11')][_0x1a8bbe['id']]=new SalesforceAccount(_0x1a8bbe);}else{_0xec010a[_0x8802('0x31')](_0xec010a[_0x8802('0x11')][_0x1a8bbe['id']],_0x1a8bbe);}}}return _0xec010a[_0x8802('0x11')];};};Realtime[_0x8802('0x2b')][_0x8802('0x39')]=function(){var _0x1efb15=this;return function(_0x31b9a3){if(_0x31b9a3){freeIsNotKey(_0x31b9a3,_0x1efb15[_0x8802('0x3a')],'id');for(var _0x504f23=0x0,_0x1493f0={},_0xbe1358={};_0x504f23<_0x31b9a3['length'];_0x504f23+=0x1){_0x1493f0=_0x31b9a3[_0x504f23];if(_[_0x8802('0x2f')](_0x1efb15['freshdeskAccounts'][_0x1493f0['id']])){_0x1efb15['freshdeskAccounts'][_0x1493f0['id']]=new FreshdeskAccount(_0x1493f0);}else{_0x1efb15[_0x8802('0x31')](_0x1efb15[_0x8802('0x3a')][_0x1493f0['id']],_0x1493f0);}}}return _0x1efb15[_0x8802('0x3a')];};};Realtime[_0x8802('0x2b')]['initZohoAccounts']=function(){var _0xd33025=this;return function(_0x202a7a){if(_0x202a7a){freeIsNotKey(_0x202a7a,_0xd33025['zohoAccounts'],'id');for(var _0x5c0ea6=0x0,_0x1d21c6={},_0x4a046={};_0x5c0ea6<_0x202a7a[_0x8802('0x2d')];_0x5c0ea6+=0x1){_0x1d21c6=_0x202a7a[_0x5c0ea6];if(_[_0x8802('0x2f')](_0xd33025['zohoAccounts'][_0x1d21c6['id']])){_0xd33025[_0x8802('0x3b')][_0x1d21c6['id']]=new ZohoAccount(_0x1d21c6);}else{_0xd33025[_0x8802('0x31')](_0xd33025[_0x8802('0x3b')][_0x1d21c6['id']],_0x1d21c6);}}}return _0xd33025[_0x8802('0x3b')];};};Realtime['prototype'][_0x8802('0x3c')]=function(){var _0x57ece9=this;return function(_0x2cb669){if(_0x2cb669){freeIsNotKey(_0x2cb669,_0x57ece9['deskAccounts'],'id');for(var _0x47c0d3=0x0,_0x5dfef8={},_0x551bcc={};_0x47c0d3<_0x2cb669[_0x8802('0x2d')];_0x47c0d3+=0x1){_0x5dfef8=_0x2cb669[_0x47c0d3];if(_[_0x8802('0x2f')](_0x57ece9[_0x8802('0x3d')][_0x5dfef8['id']])){_0x57ece9['deskAccounts'][_0x5dfef8['id']]=new DeskAccount(_0x5dfef8);}else{_0x57ece9['mergeFromDatabase'](_0x57ece9['deskAccounts'][_0x5dfef8['id']],_0x5dfef8);}}}return _0x57ece9[_0x8802('0x3d')];};};Realtime[_0x8802('0x2b')][_0x8802('0x3e')]=function(){var _0x127d26=this;return function(_0x28d7de){if(_0x28d7de){freeIsNotKey(_0x28d7de,_0x127d26[_0x8802('0x12')],'id');for(var _0x274519=0x0,_0x3a238c={},_0x4dfc1c={};_0x274519<_0x28d7de['length'];_0x274519+=0x1){_0x3a238c=_0x28d7de[_0x274519];if(_[_0x8802('0x2f')](_0x127d26[_0x8802('0x12')][_0x3a238c['id']])){_0x127d26['sugarcrmAccounts'][_0x3a238c['id']]=new SugarcrmAccount(_0x3a238c);}else{_0x127d26[_0x8802('0x31')](_0x127d26[_0x8802('0x12')][_0x3a238c['id']],_0x3a238c);}}}return _0x127d26[_0x8802('0x12')];};};Realtime[_0x8802('0x2b')][_0x8802('0x3f')]=function(){var _0x1e78d4=this;return function(_0x2fcdae){if(_0x2fcdae){freeIsNotKey(_0x2fcdae,_0x1e78d4[_0x8802('0x40')],'id');for(var _0xd5b7a5=0x0,_0x28a182={},_0x52cf38={};_0xd5b7a5<_0x2fcdae[_0x8802('0x2d')];_0xd5b7a5+=0x1){_0x28a182=_0x2fcdae[_0xd5b7a5];if(_['isUndefined'](_0x1e78d4[_0x8802('0x40')][_0x28a182['id']])){_0x1e78d4[_0x8802('0x40')][_0x28a182['id']]=new VtigerAccount(_0x28a182);}else{_0x1e78d4[_0x8802('0x31')](_0x1e78d4[_0x8802('0x40')][_0x28a182['id']],_0x28a182);}}}return _0x1e78d4[_0x8802('0x40')];};};Realtime[_0x8802('0x2b')][_0x8802('0x41')]=function(){var _0x524969=this;return function(_0x2c3558){if(_0x2c3558){freeIsNotKey(_0x2c3558,_0x524969[_0x8802('0x13')],'id');for(var _0x24614a=0x0,_0x5cb0ca={},_0x26b75d={};_0x24614a<_0x2c3558[_0x8802('0x2d')];_0x24614a+=0x1){_0x5cb0ca=_0x2c3558[_0x24614a];if(_[_0x8802('0x2f')](_0x524969[_0x8802('0x13')][_0x5cb0ca['id']])){_0x524969[_0x8802('0x13')][_0x5cb0ca['id']]=new ServicenowAccount(_0x5cb0ca);}else{_0x524969[_0x8802('0x31')](_0x524969[_0x8802('0x13')][_0x5cb0ca['id']],_0x5cb0ca);}}}return _0x524969['servicenowAccounts'];};};Realtime[_0x8802('0x2b')][_0x8802('0x42')]=function(){var _0x55facc=this;return function(_0x541be4){if(_0x541be4){freeIsNotKey(_0x541be4,_0x55facc[_0x8802('0x14')],'id');for(var _0x5b47f0=0x0,_0x3e36f2={},_0x30fa73={};_0x5b47f0<_0x541be4[_0x8802('0x2d')];_0x5b47f0+=0x1){_0x3e36f2=_0x541be4[_0x5b47f0];if(_[_0x8802('0x2f')](_0x55facc[_0x8802('0x14')][_0x3e36f2['id']])){_0x55facc[_0x8802('0x14')][_0x3e36f2['id']]=new Dynamics365Account(_0x3e36f2);}else{_0x55facc[_0x8802('0x31')](_0x55facc['dynamics365Accounts'][_0x3e36f2['id']],_0x3e36f2);}}}return _0x55facc['dynamics365Accounts'];};};Realtime['prototype'][_0x8802('0x43')]=function(){var _0x33be84=this;return function(_0x34c1a8){if(_0x34c1a8){freeIsNotKey(_0x34c1a8,_0x33be84[_0x8802('0x44')],'id');for(var _0x42abbe=0x0,_0x74bf98={},_0xb4868c={};_0x42abbe<_0x34c1a8[_0x8802('0x2d')];_0x42abbe+=0x1){_0x74bf98=_0x34c1a8[_0x42abbe];if(_[_0x8802('0x2f')](_0x33be84[_0x8802('0x44')][_0x74bf98['id']])){_0x33be84[_0x8802('0x44')][_0x74bf98['id']]=new FreshsalesAccount(_0x74bf98);}else{_0x33be84[_0x8802('0x31')](_0x33be84[_0x8802('0x44')][_0x74bf98['id']],_0x74bf98);}}}return _0x33be84[_0x8802('0x44')];};};Realtime[_0x8802('0x2b')][_0x8802('0x45')]=function(){var _0x597a73=this;return function(_0x456009){for(var _0x32c67d=0x0;_0x32c67d<_0x456009[_0x8802('0x2d')];_0x32c67d+=0x1){_[_0x8802('0x46')](_0x597a73['voiceQueues'][_0x456009[_0x32c67d][_0x8802('0x18')]],_0x456009[_0x32c67d]);}return _0x597a73[_0x8802('0x34')];};};Realtime[_0x8802('0x2b')][_0x8802('0x47')]=function(){var _0x1516ef=this;return function(_0x2efebb){clearVoiceQueues(_0x1516ef[_0x8802('0x34')]);if(_0x2efebb){_0x2efebb=_['groupBy'](_0x2efebb,_0x8802('0x48'));for(var _0x48de53 in _0x2efebb){if(_0x2efebb[_0x8802('0x1f')](_0x48de53)){var _0x34f11d={};for(var _0x5396e5=0x0;_0x5396e5<_0x2efebb[_0x48de53][_0x8802('0x2d')];_0x5396e5+=0x1){var _0xb1774b=_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x49')];if(_0x1516ef[_0x8802('0x34')][_0xb1774b]){if(_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x4a')]){_0x1516ef['voiceQueues'][_0xb1774b][_0x8802('0x4b')]+=0x1;}if(_0x2efebb[_0x48de53][_0x5396e5]['queuecallerabandon']){_0x1516ef[_0x8802('0x34')][_0xb1774b][_0x8802('0x22')]+=0x1;}_0x1516ef[_0x8802('0x34')][_0xb1774b]['sumHoldTime']+=moment(_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x4c')])[_0x8802('0x4d')](moment(_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x4e')]),'seconds')||0x0;if(_0x5396e5===_0x2efebb[_0x48de53]['length']-0x1){_0x1516ef[_0x8802('0x34')][_0xb1774b][_0x8802('0x1c')]+=moment(_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x4f')]||_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x50')]||_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x51')])[_0x8802('0x4d')](moment(_0x2efebb[_0x48de53][_0x5396e5]['queuecallerjoinAt']),_0x8802('0x52'))||0x0;_0x1516ef['voiceQueues'][_0xb1774b][_0x8802('0x1b')]+=0x1;if(_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x53')]){_0x1516ef[_0x8802('0x34')][_0xb1774b][_0x8802('0x54')]+=0x1;_0x1516ef[_0x8802('0x34')][_0xb1774b][_0x8802('0x1d')]+=moment(_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x4f')])['diff'](moment(_0x2efebb[_0x48de53][_0x5396e5][_0x8802('0x4c')]),_0x8802('0x52'))||0x0;}}else{_0x1516ef['voiceQueues'][_0xb1774b][_0x8802('0x1c')]+=_0x1516ef[_0x8802('0x34')][_0xb1774b][_0x8802('0x23')]||0x0;}}}}}}return _0x1516ef[_0x8802('0x34')];};};Realtime[_0x8802('0x2b')][_0x8802('0x55')]=function(){var _0x53a7b0=this;return function(_0x4e5076){clearVoiceCallReports(_0x53a7b0[_0x8802('0xc')]);if(_0x4e5076){for(var _0x4425ae=0x0;_0x4425ae<_0x4e5076['length'];_0x4425ae+=0x1){_0x53a7b0[_0x8802('0xc')][_0x8802('0x1b')]+=0x1;_0x53a7b0['outbound']['sumDuration']+=_0x4e5076[_0x4425ae][_0x8802('0x56')];if(_0x4e5076[_0x4425ae]['disposition']==='ANSWERED'){_0x53a7b0['outbound'][_0x8802('0x54')]+=0x1;_0x53a7b0[_0x8802('0xc')][_0x8802('0x23')]+=_0x4e5076[_0x4425ae][_0x8802('0x56')]-_0x4e5076[_0x4425ae][_0x8802('0x57')]||0x0;_0x53a7b0['outbound'][_0x8802('0x1d')]+=_0x4e5076[_0x4425ae][_0x8802('0x57')];}}}return _0x53a7b0['outbound'];};};Realtime[_0x8802('0x2b')][_0x8802('0x58')]=function(){var _0x592f2c=this;return function(_0x4d02b4){if(_0x4d02b4){freeIsNotKey(_0x4d02b4,_0x592f2c[_0x8802('0x59')],_0x8802('0x18'));for(var _0x47d8c8=0x0,_0x53acc9={};_0x47d8c8<_0x4d02b4['length'];_0x47d8c8+=0x1){_0x53acc9=_0x4d02b4[_0x47d8c8];if(_['isUndefined'](_0x592f2c[_0x8802('0x59')][_0x53acc9[_0x8802('0x18')]])){_0x592f2c[_0x8802('0x59')][_0x53acc9[_0x8802('0x18')]]=new Campaign(_0x53acc9);}else{_0x592f2c['mergeFromDatabase'](_0x592f2c[_0x8802('0x59')][_0x53acc9['name']],_0x53acc9);_0x592f2c['campaigns'][_0x53acc9['name']][_0x8802('0x5a')]=_0x53acc9[_0x8802('0x5b')]?_0x53acc9[_0x8802('0x5b')][_0x8802('0x18')]:undefined;}}}return _0x592f2c['campaigns'];};};Realtime[_0x8802('0x2b')]['initVoiceExtensions']=function(){var _0x188d94=this;return function(_0x51c93c){if(_0x51c93c){freeIsNotKey(_0x51c93c,_0x188d94[_0x8802('0x5c')],'id');for(var _0x24b494=0x0,_0x5e0f7c={};_0x24b494<_0x51c93c['length'];_0x24b494+=0x1){_0x5e0f7c=_0x51c93c[_0x24b494];if(_['isUndefined'](_0x188d94['voiceExtensions'][_0x5e0f7c['id']])){_0x188d94[_0x8802('0x5c')][_0x5e0f7c['id']]=new VoiceExtension(_0x5e0f7c);}else{_0x188d94[_0x8802('0x31')](_0x188d94['voiceExtensions'][_0x5e0f7c['id']],_0x5e0f7c);}}}return _0x188d94[_0x8802('0x5c')];};};Realtime[_0x8802('0x2b')]['initCampaignHopperHistory']=function(){var _0x335178=this;return function(_0x5d42d3){clearCampaigns(_0x335178['campaigns']);for(var _0x5dbdb1=0x0;_0x5dbdb1<_0x5d42d3[_0x8802('0x2d')];_0x5dbdb1+=0x1){_[_0x8802('0x46')](_0x335178['campaigns'][_0x5d42d3[_0x5dbdb1][_0x8802('0x18')]],_0x5d42d3[_0x5dbdb1]);}return _0x335178[_0x8802('0x59')];};};Realtime[_0x8802('0x2b')][_0x8802('0x5d')]=function(){var _0x182623=this;return function(_0x3e4fb4){if(_0x3e4fb4){freeIsNotKey(_0x3e4fb4,_0x182623['faxAccounts'],'id');for(var _0x3b71e8=0x0,_0x1502d0={},_0xf90d07={};_0x3b71e8<_0x3e4fb4[_0x8802('0x2d')];_0x3b71e8+=0x1){_0x1502d0=_0x3e4fb4[_0x3b71e8];if(_['isUndefined'](_0x182623[_0x8802('0x15')][_0x1502d0['id']])){_0x182623[_0x8802('0x15')][_0x1502d0['id']]=new FaxAccount(_0x1502d0);}else{_0x182623[_0x8802('0x31')](_0x182623[_0x8802('0x15')][_0x1502d0['id']],_0x1502d0);}}}return _0x182623[_0x8802('0x15')];};};module[_0x8802('0x5e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index d640fe9..6cc8e9c 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 _0x62b6=['connectedlinenum','calleridname','connectedlinename','originatecalleridnum','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindTransfer','find','accountcode','name','isNil','format','SIP/%s','length','findAgent','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','keys','getCallType','channel','split','getAgentByInternal','outbound','internal','destination','exten','type','dialer','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','disposition','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','create','monitors','monitorFilename','createdAt'];(function(_0x12aefd,_0x1d95b6){var _0xf4f891=function(_0x4ba40d){while(--_0x4ba40d){_0x12aefd['push'](_0x12aefd['shift']());}};_0xf4f891(++_0x1d95b6);}(_0x62b6,0xc6));var _0x662b=function(_0xdefb6,_0x557904){_0xdefb6=_0xdefb6-0x0;var _0x3456d7=_0x62b6[_0xdefb6];return _0x3456d7;};'use strict';var _=require(_0x662b('0x0'));var moment=require(_0x662b('0x1'));var util=require('util');var config=require(_0x662b('0x2'));var ami=require(_0x662b('0x3'));var RpcVoiceAgentReport=require(_0x662b('0x4'));var RpcVoiceCallReport=require(_0x662b('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x662b('0x6'));var RpcVoiceQueueReport=require(_0x662b('0x7'));var RpcVoiceRecording=require(_0x662b('0x8'));var RpcVoiceTransferReport=require(_0x662b('0x9'));var VoiceQueueReport=require(_0x662b('0xa'));var VoiceCallReport=require(_0x662b('0xb'));var VoiceAgentReport=require(_0x662b('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0xfebb0c){this[_0x662b('0xd')]=_0xfebb0c;this[_0x662b('0xe')]=_0xfebb0c[_0x662b('0xe')];this[_0x662b('0xf')]=_0xfebb0c[_0x662b('0xf')];}Report[_0x662b('0x10')][_0x662b('0x11')]=function(_0x5d3fce){var _0x413e5d=new VoiceQueueReport(this[_0x662b('0xd')]);var _0x3e8b25=new VoiceAgentReport(this[_0x662b('0xd')]);var _0x1537dc=new VoiceDialReport(this[_0x662b('0xd')]);var _0x49e0b6=new VoiceCallReport(this[_0x662b('0xd')]);var _0x48ea83=new UserReport(this[_0x662b('0xd')]);if(config[_0x662b('0x12')]&&config[_0x662b('0x12')][_0x662b('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x662b('0x14')][_0x662b('0x15')](this));ami['on'](_0x662b('0x16'),this[_0x662b('0x17')][_0x662b('0x15')](this));ami['on'](_0x662b('0x18'),this[_0x662b('0x19')][_0x662b('0x15')](this));ami['on'](_0x662b('0x1a'),this['voiceDialReport']['bind'](this));ami['on']('blindtransfer',this[_0x662b('0x1b')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x662b('0x15')](this));}};Report['prototype']['findAgent']=function(_0x5857fd){var _0x2d596f;_0x2d596f=_[_0x662b('0x1c')](this['agents'],function(_0x277865){return _0x277865[_0x662b('0x1d')]==_0x5857fd||_0x277865[_0x662b('0x1e')]==_0x5857fd;});if(_[_0x662b('0x1f')](_0x2d596f)){var _0x36c5e0=_[_0x662b('0x1c')](this[_0x662b('0xf')],function(_0x11fc04){return _0x11fc04[_0x662b('0x1d')]==_0x5857fd||_0x11fc04[_0x662b('0x1e')]==_0x5857fd;});if(_0x36c5e0){_0x2d596f=_[_0x662b('0x1c')](this[_0x662b('0xe')],function(_0x3c60ee){return _0x3c60ee['interface']==util[_0x662b('0x20')](_0x662b('0x21'),_0x36c5e0[_0x662b('0x1e')]);});}}return _0x2d596f;};Report[_0x662b('0x10')]['voiceQueueReport']=function(_0x3cbef9){for(var _0xe36dcb=0x0;_0xe36dcb<_0x3cbef9[_0x662b('0x22')];_0xe36dcb+=0x1){var _0xc1ddcd=this[_0x662b('0x23')](_0x3cbef9[_0xe36dcb]['connectedlinenum']);if(_0xc1ddcd){_0x3cbef9[_0xe36dcb]['accountcode']=_0xc1ddcd['accountcode'];_0x3cbef9[_0xe36dcb]['assigned']=!![];_0x3cbef9[_0xe36dcb][_0x662b('0x24')]=_0xc1ddcd[_0x662b('0x1e')];_0x3cbef9[_0xe36dcb][_0x662b('0x25')]=_['isNil'](_0xc1ddcd['interface'])?util['format'](_0x662b('0x21'),_0xc1ddcd['name']):_0xc1ddcd['interface'];if(_0x3cbef9[_0xe36dcb][_0x662b('0x26')]){_0x3cbef9[_0xe36dcb][_0x662b('0x27')]=moment()['format'](_0x662b('0x28'));}if(_0x3cbef9[_0xe36dcb]['queuecallerexit']){_0x3cbef9[_0xe36dcb][_0x662b('0x29')]=moment()[_0x662b('0x20')](_0x662b('0x28'));}RpcMemberReport['voiceQueueReport'](_0x3cbef9[_0xe36dcb]);}RpcVoiceQueueReport['create'](_0x3cbef9[_0xe36dcb]);}};function extractCalleridNumber(_0x2d432d){var _0xef5952=_0x2d432d[_0x662b('0x2a')](/<(.*?)>/);return _0xef5952?_0xef5952[0x1]:_0x2d432d;}Report['prototype']['getAgentByInternal']=function(_0x3f92f8){for(var _0x3505d2=0x0;_0x3505d2/);return _0x515242?_0x515242[0x1]:_0x3db326;}Report[_0x4112('0x10')][_0x4112('0x2d')]=function(_0x5f06f8){for(var _0x529cb8=0x0;_0x529cb8',_0x541c9f['calleridname'],_0x541c9f[_0x4112('0x31')]);}if(RpcVoiceTransferReport[_0x4112('0x42')][_0x541c9f['linkedid']]){var _0x5a22e0=RpcVoiceTransferReport[_0x4112('0x42')][_0x541c9f[_0x4112('0x43')]];_0x5a22e0[_0x4112('0x44')]=_0x541c9f[_0x4112('0x45')];RpcVoiceTransferReport[_0x4112('0x1d')](_0x5a22e0);delete RpcVoiceTransferReport['transfers'][_0x541c9f[_0x4112('0x43')]];}if(_[_0x4112('0x21')](_0x541c9f[_0x4112('0x35')])){_0x541c9f[_0x4112('0x35')]=this['getCallType'](_0x541c9f);}if(_[_0x4112('0x21')](_0x541c9f[_0x4112('0x46')])){var _0x368233=_0x541c9f['channel'][_0x4112('0x47')]('-')[0x0];var _0x7ac417=this[_0x4112('0xe')][_0x368233];if(!_0x7ac417)_0x7ac417=this[_0x4112('0x2d')](_0x541c9f['accountcode']);if(_0x7ac417){_0x541c9f['UserId']=_0x7ac417['id'];_0x541c9f[_0x4112('0x48')]=_0x7ac417['name'];}}RpcVoiceCallReport[_0x4112('0x2c')](_0x541c9f);if(_0x541c9f[_0x4112('0x49')]){for(var _0xb79b=0x0;_0xb79b<_0x541c9f[_0x4112('0x4a')][_0x4112('0x25')];_0xb79b+=0x1){_0x541c9f[_0x4112('0x4b')]=_0x541c9f[_0x4112('0x4a')][_0xb79b][_0x4112('0x4c')];_0x541c9f[_0x4112('0x4d')]=_0x541c9f[_0x4112('0x4a')][_0xb79b][_0x4112('0x4d')];if(_0x541c9f['exten']==_0x4112('0x4e')){_0x541c9f[_0x4112('0x31')]=_0x541c9f[_0x4112('0x41')];_0x541c9f[_0x4112('0x4f')]=_0x541c9f[_0x4112('0x50')];_0x541c9f[_0x4112('0x41')]=_0x541c9f[_0x4112('0x20')];_0x541c9f[_0x4112('0x50')]=_0x541c9f[_0x4112('0x48')];_0x541c9f[_0x4112('0x51')]=_0x541c9f[_0x4112('0x52')];}else if(_0x541c9f[_0x4112('0x51')]==_0x4112('0x53')){_0x541c9f['calleridnum']=_0x541c9f[_0x4112('0x34')];_0x541c9f[_0x4112('0x51')]=_0x541c9f[_0x4112('0x52')];}RpcVoiceRecording['create'](_0x541c9f);}}};Report['prototype']['voiceAgentReport']=function(_0x493d57){if(_['isArray'](_0x493d57)){_0x493d57['forEach'](function(_0x33c41f){RpcVoiceAgentReport[_0x4112('0x2c')](_0x33c41f);});}else{RpcVoiceAgentReport[_0x4112('0x2c')](_0x493d57);}};Report[_0x4112('0x10')][_0x4112('0x1b')]=function(_0x21be97){RpcVoiceDialReport[_0x4112('0x2c')](_0x21be97);var _0x53b2f8;var _0x51ba05;var _0x2dba45=_0x21be97['channel'];if(_['startsWith'](_0x2dba45,_0x4112('0x54'))){_0x51ba05=_0x2dba45[_0x4112('0x55')](_0x2dba45['indexOf']('/')+0x1,_0x2dba45[_0x4112('0x56')]('@'));_0x53b2f8=_[_0x4112('0x1f')](this[_0x4112('0xe')],function(_0x3cd977){return _0x3cd977[_0x4112('0x57')]==_0x51ba05||_0x3cd977['phone']==_0x51ba05||_0x3cd977[_0x4112('0x20')]==_0x51ba05;});}else{_0x51ba05=_0x2dba45[_0x4112('0x55')](_0x2dba45[_0x4112('0x56')]('/')+0x1,_0x2dba45[_0x4112('0x58')]('-'));_0x53b2f8=this['findAgent'](_0x51ba05);}if(_0x53b2f8){_0x21be97[_0x4112('0x28')]=_[_0x4112('0x21')](_0x53b2f8['interface'])?util['format'](_0x4112('0x24'),_0x53b2f8[_0x4112('0x22')]):_0x53b2f8[_0x4112('0x28')];_0x21be97[_0x4112('0x48')]=_0x53b2f8[_0x4112('0x22')];_0x21be97[_0x4112('0x20')]=_0x53b2f8['accountcode'];RpcMemberReport[_0x4112('0x1b')](_0x21be97);}};Report['prototype'][_0x4112('0x1d')]=function(_0x47ec2c){RpcVoiceTransferReport[_0x4112('0x42')][_0x47ec2c[_0x4112('0x59')]]=_0x47ec2c;};Report[_0x4112('0x10')][_0x4112('0x5a')]=function(_0x1c8cc7){RpcVoiceTransferReport[_0x4112('0x5a')](_0x1c8cc7);};module[_0x4112('0x5b')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 730f1b2..d0545a7 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a8a=['local','inuse','toLowerCase','format','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','stateTime','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','indexOf','mobile','accountcode','[userReport][devicestatechange]','syncPeerStatus','peerstatus','info','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','util','ioredis','bluebird','ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','bind','registry','syncRegistry','devicestatechange','syncDeviceState','resolve','actionSipShowRegistry','error','[userReport][sipshowregistry]','inspect','then','catch','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','trunk:save','device'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a8a,0xf4));var _0xa9a8=function(_0xb4f220,_0x2ebccc){_0xb4f220=_0xb4f220-0x0;var _0x10ac02=_0x9a8a[_0xb4f220];return _0x10ac02;};'use strict';var _=require(_0xa9a8('0x0'));var moment=require('moment');var util=require(_0xa9a8('0x1'));var Redis=require(_0xa9a8('0x2'));var BPromise=require(_0xa9a8('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa9a8('0x4'));var ami=require('../ami');config[_0xa9a8('0x5')]=_[_0xa9a8('0x6')](config[_0xa9a8('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa9a8('0x7'))(new Redis(config[_0xa9a8('0x5')]));function UserReport(_0x23fb9b){this[_0xa9a8('0x8')]=_0x23fb9b['trunks'];this['agents']=_0x23fb9b[_0xa9a8('0x9')];this[_0xa9a8('0xa')]=_0x23fb9b[_0xa9a8('0xa')];ami['on']('registryentry',this['syncRegistry'][_0xa9a8('0xb')](this));ami['on'](_0xa9a8('0xc'),this[_0xa9a8('0xd')]['bind'](this));ami['on'](_0xa9a8('0xe'),this[_0xa9a8('0xf')][_0xa9a8('0xb')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0xa9a8('0xb')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0xa9a8('0x10')]()['then'](ami[_0xa9a8('0x11')]())['catch'](function(_0x3f64c1){logger[_0xa9a8('0x12')](_0xa9a8('0x13'),util[_0xa9a8('0x14')](_0x3f64c1,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xa9a8('0x10')]()[_0xa9a8('0x15')](ami['actionDeviceStateList']())[_0xa9a8('0x16')](function(_0x612706){logger[_0xa9a8('0x12')](_0xa9a8('0x17'),util[_0xa9a8('0x14')](_0x612706,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xa9a8('0x10')]()[_0xa9a8('0x15')](ami['actionSipPeerStatus']())[_0xa9a8('0x16')](function(_0xdefc25){logger[_0xa9a8('0x12')](_0xa9a8('0x18'),util[_0xa9a8('0x14')](_0xdefc25,{'showHidden':![],'depth':null}));});}UserReport[_0xa9a8('0x19')][_0xa9a8('0x1a')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0xa9a8('0x15')](listDeviceStates())[_0xa9a8('0x15')](showPeersStatus());},0x32c8);};UserReport[_0xa9a8('0x19')][_0xa9a8('0x1b')]=function(_0x3bba05){return _0x3bba05!==null&&!_[_0xa9a8('0x1c')](_0x3bba05);};UserReport[_0xa9a8('0x19')][_0xa9a8('0x1d')]=function(_0x5d0b69,_0x11ca7e,_0xcdd96){io['to'](_0x5d0b69)[_0xa9a8('0x1d')](_0x11ca7e,_0xcdd96);};UserReport['prototype'][_0xa9a8('0xd')]=function(_0x2bc266){try{if(this[_0xa9a8('0x1b')](_0x2bc266)){logger['info'](_0xa9a8('0x1e'),_0x2bc266['username'],_0x2bc266[_0xa9a8('0x1f')]);logger[_0xa9a8('0x20')](_0xa9a8('0x21'),util[_0xa9a8('0x14')](_0x2bc266,{'showHidden':![],'depth':null}));var _0x598718=_[_0xa9a8('0x22')](this[_0xa9a8('0x8')],{'defaultuser':_0x2bc266[_0xa9a8('0x23')]});if(_0x598718){_0x2bc266[_0xa9a8('0x24')]=_0x2bc266[_0xa9a8('0x1f')];_[_0xa9a8('0x25')](_0x598718,_[_0xa9a8('0x26')](_0x2bc266,['event',_0xa9a8('0x27'),_0xa9a8('0x23'),_0xa9a8('0x1f')]));logger[_0xa9a8('0x20')](_0xa9a8('0x28'),util[_0xa9a8('0x14')](_0x598718,{'showHidden':![],'depth':null}));this[_0xa9a8('0x1d')](util['format'](_0xa9a8('0x29'),_0x598718['name']),_0xa9a8('0x2a'),_0x598718);}}}catch(_0x40fc90){logger['error'](_0xa9a8('0x21'),util[_0xa9a8('0x14')](_0x40fc90,{'showHidden':![],'depth':null}));}};UserReport[_0xa9a8('0x19')]['syncDeviceState']=function(_0x8e7d91){try{if(this[_0xa9a8('0x1b')](_0x8e7d91)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x8e7d91['device'],_0x8e7d91[_0xa9a8('0x1f')]);logger[_0xa9a8('0x20')]('[userReport][devicestatechange]',util[_0xa9a8('0x14')](_0x8e7d91,{'showHidden':![],'depth':null}));if(this[_0xa9a8('0x9')][_0x8e7d91[_0xa9a8('0x2b')]]){if(!this[_0xa9a8('0x9')][_0x8e7d91['device']][_0xa9a8('0x2c')]||_0x8e7d91[_0xa9a8('0x1f')]['toLowerCase']()==_0xa9a8('0x2d')){this[_0xa9a8('0x9')][_0x8e7d91[_0xa9a8('0x2b')]][_0xa9a8('0x2c')]=![];if(this[_0xa9a8('0x9')][_0x8e7d91[_0xa9a8('0x2b')]][_0xa9a8('0x1f')]!==_0x8e7d91[_0xa9a8('0x1f')][_0xa9a8('0x2e')]()){this['agents'][_0x8e7d91['device']]['stateTime']=_['toNumber'](moment()[_0xa9a8('0x2f')]('x'));}this['agents'][_0x8e7d91['device']][_0xa9a8('0x1f')]=_0x8e7d91['state']['toLowerCase']();this[_0xa9a8('0x9')][_0x8e7d91[_0xa9a8('0x2b')]][_0xa9a8('0x30')](_0x8e7d91);}}else if(this[_0xa9a8('0xa')][_0x8e7d91['device']]){if(this[_0xa9a8('0xa')][_0x8e7d91['device']][_0xa9a8('0x1f')]!==_0x8e7d91[_0xa9a8('0x1f')]['toLowerCase']()){this[_0xa9a8('0xa')][_0x8e7d91[_0xa9a8('0x2b')]]['stateTime']=_[_0xa9a8('0x31')](moment()[_0xa9a8('0x2f')]('x'));}this[_0xa9a8('0xa')][_0x8e7d91[_0xa9a8('0x2b')]][_0xa9a8('0x1f')]=_0x8e7d91['state'][_0xa9a8('0x2e')]();logger[_0xa9a8('0x20')](_0xa9a8('0x32'),util[_0xa9a8('0x14')](this[_0xa9a8('0xa')][_0x8e7d91[_0xa9a8('0x2b')]],{'showHidden':![],'depth':null}));this[_0xa9a8('0x1d')](util[_0xa9a8('0x2f')](_0xa9a8('0x33'),this[_0xa9a8('0xa')][_0x8e7d91[_0xa9a8('0x2b')]][_0xa9a8('0x34')]),_0xa9a8('0x35'),this[_0xa9a8('0xa')][_0x8e7d91['device']]);}else if(this[_0xa9a8('0x8')][_0x8e7d91['device']]){if(this[_0xa9a8('0x8')][_0x8e7d91[_0xa9a8('0x2b')]]['state']!==_0x8e7d91['state'][_0xa9a8('0x2e')]()){this['trunks'][_0x8e7d91[_0xa9a8('0x2b')]][_0xa9a8('0x36')]=_[_0xa9a8('0x31')](moment()['format']('x'));}this[_0xa9a8('0x8')][_0x8e7d91[_0xa9a8('0x2b')]][_0xa9a8('0x1f')]=_0x8e7d91['state'][_0xa9a8('0x2e')]();logger[_0xa9a8('0x20')](_0xa9a8('0x37'),util['inspect'](this[_0xa9a8('0x8')][_0x8e7d91[_0xa9a8('0x2b')]],{'showHidden':![],'depth':null}));this[_0xa9a8('0x1d')](util[_0xa9a8('0x2f')]('trunk:%s',this[_0xa9a8('0x8')][_0x8e7d91[_0xa9a8('0x2b')]][_0xa9a8('0x34')]),_0xa9a8('0x2a'),this[_0xa9a8('0x8')][_0x8e7d91[_0xa9a8('0x2b')]]);}else if(_['startsWith'](_0x8e7d91[_0xa9a8('0x2b')],'Local')){var _0x548946=_0x8e7d91[_0xa9a8('0x2b')];var _0x17dea6=_0x548946['substring'](_0x548946[_0xa9a8('0x38')]('/')+0x1,_0x548946[_0xa9a8('0x38')]('@'));var _0x122082=_[_0xa9a8('0x22')](this['agents'],function(_0x31fd62){return _0x31fd62[_0xa9a8('0x39')]==_0x17dea6||_0x31fd62['phone']==_0x17dea6||_0x31fd62[_0xa9a8('0x3a')]==_0x17dea6;});if(_0x122082){if(_0x122082[_0xa9a8('0x1f')]!==_0x8e7d91[_0xa9a8('0x1f')]['toLowerCase']()){_0x122082[_0xa9a8('0x36')]=_[_0xa9a8('0x31')](moment()[_0xa9a8('0x2f')]('x'));}_0x122082[_0xa9a8('0x1f')]=_0x8e7d91[_0xa9a8('0x1f')][_0xa9a8('0x2e')]();_0x122082[_0xa9a8('0x2c')]=!![];_0x122082[_0xa9a8('0x30')](_0x8e7d91);}}}}catch(_0x267367){logger[_0xa9a8('0x12')](_0xa9a8('0x3b'),util[_0xa9a8('0x14')](_0x267367,{'showHidden':![],'depth':null}));}};UserReport[_0xa9a8('0x19')][_0xa9a8('0x3c')]=function(_0x23427a){try{if(this[_0xa9a8('0x1b')](_0x23427a)&&this[_0xa9a8('0x1b')](_0x23427a[_0xa9a8('0x3d')])){logger[_0xa9a8('0x3e')](_0xa9a8('0x3f'),_0x23427a[_0xa9a8('0x40')],_0x23427a[_0xa9a8('0x41')],_0x23427a['peerstatus']);logger[_0xa9a8('0x20')](_0xa9a8('0x42'),util[_0xa9a8('0x14')](_0x23427a,{'showHidden':![],'depth':null}));if(this[_0xa9a8('0x9')][_0x23427a['peer']]){if(!this[_0xa9a8('0x9')][_0x23427a['peer']][_0xa9a8('0x2c')]||_0x23427a[_0xa9a8('0x3d')][_0xa9a8('0x2e')]()==_0xa9a8('0x43')){this[_0xa9a8('0x9')][_0x23427a[_0xa9a8('0x40')]][_0xa9a8('0x2c')]=![];this['agents'][_0x23427a[_0xa9a8('0x40')]]['status']=_0x23427a[_0xa9a8('0x3d')][_0xa9a8('0x2e')]();this['agents'][_0x23427a[_0xa9a8('0x40')]][_0xa9a8('0x41')]=_0x23427a[_0xa9a8('0x41')];this[_0xa9a8('0x9')][_0x23427a[_0xa9a8('0x40')]]['updateStatusRealtime'](_0x23427a);}}else if(this[_0xa9a8('0xa')][_0x23427a[_0xa9a8('0x40')]]){this[_0xa9a8('0xa')][_0x23427a[_0xa9a8('0x40')]][_0xa9a8('0x44')]=_0x23427a['peerstatus']['toLowerCase']();this[_0xa9a8('0xa')][_0x23427a[_0xa9a8('0x40')]][_0xa9a8('0x41')]=_0x23427a[_0xa9a8('0x41')];logger[_0xa9a8('0x20')](_0xa9a8('0x45'),util['inspect'](this[_0xa9a8('0xa')][_0x23427a['peer']],{'showHidden':![],'depth':null}));this[_0xa9a8('0x1d')](util[_0xa9a8('0x2f')](_0xa9a8('0x33'),this[_0xa9a8('0xa')][_0x23427a['peer']][_0xa9a8('0x34')]),'telephone:save',this[_0xa9a8('0xa')][_0x23427a['peer']]);}else if(this['trunks'][_0x23427a[_0xa9a8('0x40')]]){this[_0xa9a8('0x8')][_0x23427a['peer']]['status']=_0x23427a[_0xa9a8('0x3d')][_0xa9a8('0x2e')]();this[_0xa9a8('0x8')][_0x23427a[_0xa9a8('0x40')]][_0xa9a8('0x41')]=_0x23427a[_0xa9a8('0x41')];logger['debug'](_0xa9a8('0x46'),util[_0xa9a8('0x14')](this[_0xa9a8('0x8')][_0x23427a[_0xa9a8('0x40')]],{'showHidden':![],'depth':null}));this[_0xa9a8('0x1d')](util[_0xa9a8('0x2f')](_0xa9a8('0x29'),this[_0xa9a8('0x8')][_0x23427a[_0xa9a8('0x40')]][_0xa9a8('0x34')]),_0xa9a8('0x2a'),this[_0xa9a8('0x8')][_0x23427a[_0xa9a8('0x40')]]);}}}catch(_0x1d25e8){logger[_0xa9a8('0x12')](_0xa9a8('0x42'),util[_0xa9a8('0x14')](_0x1d25e8,{'showHidden':![],'depth':null}));}};module[_0xa9a8('0x47')]=UserReport; \ No newline at end of file +var _0x529d=['status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','catch','inspect','resolve','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','error','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','format','updateStatusRealtime','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','peerstatus','info','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x529d,0x137));var _0xd529=function(_0xe3775a,_0x19a6f6){_0xe3775a=_0xe3775a-0x0;var _0x41e4d9=_0x529d[_0xe3775a];return _0x41e4d9;};'use strict';var _=require(_0xd529('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0xd529('0x1'))(_0xd529('0x2'));var ami=require(_0xd529('0x3'));config[_0xd529('0x4')]=_[_0xd529('0x5')](config[_0xd529('0x4')],{'host':_0xd529('0x6'),'port':0x18eb});var io=require(_0xd529('0x7'))(new Redis(config['redis']));function UserReport(_0x4cb454){this[_0xd529('0x8')]=_0x4cb454['trunks'];this[_0xd529('0x9')]=_0x4cb454[_0xd529('0x9')];this[_0xd529('0xa')]=_0x4cb454[_0xd529('0xa')];ami['on'](_0xd529('0xb'),this[_0xd529('0xc')][_0xd529('0xd')](this));ami['on'](_0xd529('0xe'),this[_0xd529('0xc')]['bind'](this));ami['on'](_0xd529('0xf'),this[_0xd529('0x10')][_0xd529('0xd')](this));ami['on']('peerstatus',this[_0xd529('0x11')][_0xd529('0xd')](this));return this[_0xd529('0x12')]();}function showSipRegistrations(){Promise['resolve']()[_0xd529('0x13')](ami[_0xd529('0x14')]())[_0xd529('0x15')](function(_0x4d6a2b){logger['error']('[userReport][sipshowregistry]',util[_0xd529('0x16')](_0x4d6a2b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xd529('0x17')]()['then'](ami[_0xd529('0x18')]())[_0xd529('0x15')](function(_0x307084){logger['error'](_0xd529('0x19'),util['inspect'](_0x307084,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xd529('0x17')]()[_0xd529('0x13')](ami[_0xd529('0x1a')]())[_0xd529('0x15')](function(_0x4cf00d){logger[_0xd529('0x1b')](_0xd529('0x1c'),util[_0xd529('0x16')](_0x4cf00d,{'showHidden':![],'depth':null}));});}UserReport[_0xd529('0x1d')][_0xd529('0x12')]=function(){setInterval(function(){BPromise[_0xd529('0x17')]()[_0xd529('0x13')](showSipRegistrations())['then'](listDeviceStates())[_0xd529('0x13')](showPeersStatus());},0x32c8);};UserReport[_0xd529('0x1d')][_0xd529('0x1e')]=function(_0x48ee60){return _0x48ee60!==null&&!_[_0xd529('0x1f')](_0x48ee60);};UserReport[_0xd529('0x1d')]['emit']=function(_0x59f245,_0x3a0e28,_0xa4350){io['to'](_0x59f245)['emit'](_0x3a0e28,_0xa4350);};UserReport['prototype'][_0xd529('0xc')]=function(_0x37540a){try{if(this['isNotNull'](_0x37540a)){logger['info'](_0xd529('0x20'),_0x37540a['username'],_0x37540a[_0xd529('0x21')]);logger[_0xd529('0x22')](_0xd529('0x23'),util[_0xd529('0x16')](_0x37540a,{'showHidden':![],'depth':null}));var _0x111b92=_[_0xd529('0x24')](this['trunks'],{'defaultuser':_0x37540a[_0xd529('0x25')]});if(_0x111b92){_0x37540a[_0xd529('0x26')]=_0x37540a['state'];_['merge'](_0x111b92,_['omit'](_0x37540a,[_0xd529('0x27'),_0xd529('0x28'),'username',_0xd529('0x21')]));logger[_0xd529('0x22')](_0xd529('0x29'),util[_0xd529('0x16')](_0x111b92,{'showHidden':![],'depth':null}));this[_0xd529('0x2a')](util['format'](_0xd529('0x2b'),_0x111b92[_0xd529('0x2c')]),_0xd529('0x2d'),_0x111b92);}}}catch(_0x378782){logger[_0xd529('0x1b')](_0xd529('0x23'),util['inspect'](_0x378782,{'showHidden':![],'depth':null}));}};UserReport[_0xd529('0x1d')]['syncDeviceState']=function(_0x4c6112){try{if(this['isNotNull'](_0x4c6112)){logger['info'](_0xd529('0x2e'),_0x4c6112[_0xd529('0x2f')],_0x4c6112[_0xd529('0x21')]);logger[_0xd529('0x22')](_0xd529('0x30'),util['inspect'](_0x4c6112,{'showHidden':![],'depth':null}));if(this[_0xd529('0x9')][_0x4c6112[_0xd529('0x2f')]]){if(!this[_0xd529('0x9')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x31')]||_0x4c6112[_0xd529('0x21')][_0xd529('0x32')]()==_0xd529('0x33')){this['agents'][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x31')]=![];if(this[_0xd529('0x9')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x21')]!==_0x4c6112[_0xd529('0x21')][_0xd529('0x32')]()){this[_0xd529('0x9')][_0x4c6112[_0xd529('0x2f')]]['stateTime']=_['toNumber'](moment()[_0xd529('0x34')]('x'));}this[_0xd529('0x9')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x21')]=_0x4c6112[_0xd529('0x21')]['toLowerCase']();this[_0xd529('0x9')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x35')](_0x4c6112);}}else if(this['telephones'][_0x4c6112[_0xd529('0x2f')]]){if(this[_0xd529('0xa')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x21')]!==_0x4c6112[_0xd529('0x21')]['toLowerCase']()){this[_0xd529('0xa')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x36')]=_[_0xd529('0x37')](moment()[_0xd529('0x34')]('x'));}this[_0xd529('0xa')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x21')]=_0x4c6112[_0xd529('0x21')][_0xd529('0x32')]();logger[_0xd529('0x22')](_0xd529('0x38'),util['inspect'](this['telephones'][_0x4c6112[_0xd529('0x2f')]],{'showHidden':![],'depth':null}));this[_0xd529('0x2a')](util['format'](_0xd529('0x39'),this[_0xd529('0xa')][_0x4c6112[_0xd529('0x2f')]]['name']),_0xd529('0x3a'),this[_0xd529('0xa')][_0x4c6112[_0xd529('0x2f')]]);}else if(this['trunks'][_0x4c6112[_0xd529('0x2f')]]){if(this[_0xd529('0x8')][_0x4c6112[_0xd529('0x2f')]]['state']!==_0x4c6112[_0xd529('0x21')][_0xd529('0x32')]()){this[_0xd529('0x8')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x36')]=_[_0xd529('0x37')](moment()[_0xd529('0x34')]('x'));}this[_0xd529('0x8')][_0x4c6112['device']]['state']=_0x4c6112[_0xd529('0x21')][_0xd529('0x32')]();logger[_0xd529('0x22')](_0xd529('0x3b'),util[_0xd529('0x16')](this['trunks'][_0x4c6112[_0xd529('0x2f')]],{'showHidden':![],'depth':null}));this[_0xd529('0x2a')](util[_0xd529('0x34')](_0xd529('0x2b'),this[_0xd529('0x8')][_0x4c6112[_0xd529('0x2f')]][_0xd529('0x2c')]),_0xd529('0x2d'),this[_0xd529('0x8')][_0x4c6112[_0xd529('0x2f')]]);}else if(_[_0xd529('0x3c')](_0x4c6112[_0xd529('0x2f')],_0xd529('0x3d'))){var _0x63a57=_0x4c6112['device'];var _0x24a41f=_0x63a57[_0xd529('0x3e')](_0x63a57[_0xd529('0x3f')]('/')+0x1,_0x63a57[_0xd529('0x3f')]('@'));var _0x4812d9=_[_0xd529('0x24')](this[_0xd529('0x9')],function(_0x2ae007){return _0x2ae007[_0xd529('0x40')]==_0x24a41f||_0x2ae007[_0xd529('0x41')]==_0x24a41f||_0x2ae007[_0xd529('0x42')]==_0x24a41f;});if(_0x4812d9){if(_0x4812d9[_0xd529('0x21')]!==_0x4c6112[_0xd529('0x21')][_0xd529('0x32')]()){_0x4812d9[_0xd529('0x36')]=_['toNumber'](moment()[_0xd529('0x34')]('x'));}_0x4812d9[_0xd529('0x21')]=_0x4c6112[_0xd529('0x21')][_0xd529('0x32')]();_0x4812d9[_0xd529('0x31')]=!![];_0x4812d9[_0xd529('0x35')](_0x4c6112);}}}}catch(_0x36f1c0){logger[_0xd529('0x1b')](_0xd529('0x30'),util[_0xd529('0x16')](_0x36f1c0,{'showHidden':![],'depth':null}));}};UserReport[_0xd529('0x1d')][_0xd529('0x11')]=function(_0x46bbb2){try{if(this['isNotNull'](_0x46bbb2)&&this['isNotNull'](_0x46bbb2[_0xd529('0x43')])){logger[_0xd529('0x44')](_0xd529('0x45'),_0x46bbb2[_0xd529('0x46')],_0x46bbb2[_0xd529('0x47')],_0x46bbb2['peerstatus']);logger[_0xd529('0x22')](_0xd529('0x48'),util[_0xd529('0x16')](_0x46bbb2,{'showHidden':![],'depth':null}));if(this['agents'][_0x46bbb2[_0xd529('0x46')]]){if(!this[_0xd529('0x9')][_0x46bbb2['peer']][_0xd529('0x31')]||_0x46bbb2['peerstatus'][_0xd529('0x32')]()==_0xd529('0x49')){this['agents'][_0x46bbb2[_0xd529('0x46')]][_0xd529('0x31')]=![];this['agents'][_0x46bbb2[_0xd529('0x46')]][_0xd529('0x4a')]=_0x46bbb2[_0xd529('0x43')][_0xd529('0x32')]();this[_0xd529('0x9')][_0x46bbb2[_0xd529('0x46')]][_0xd529('0x47')]=_0x46bbb2[_0xd529('0x47')];this[_0xd529('0x9')][_0x46bbb2[_0xd529('0x46')]]['updateStatusRealtime'](_0x46bbb2);}}else if(this[_0xd529('0xa')][_0x46bbb2[_0xd529('0x46')]]){this[_0xd529('0xa')][_0x46bbb2[_0xd529('0x46')]][_0xd529('0x4a')]=_0x46bbb2[_0xd529('0x43')][_0xd529('0x32')]();this[_0xd529('0xa')][_0x46bbb2[_0xd529('0x46')]][_0xd529('0x47')]=_0x46bbb2[_0xd529('0x47')];logger['debug'](_0xd529('0x4b'),util[_0xd529('0x16')](this[_0xd529('0xa')][_0x46bbb2[_0xd529('0x46')]],{'showHidden':![],'depth':null}));this[_0xd529('0x2a')](util[_0xd529('0x34')](_0xd529('0x39'),this[_0xd529('0xa')][_0x46bbb2['peer']][_0xd529('0x2c')]),'telephone:save',this['telephones'][_0x46bbb2[_0xd529('0x46')]]);}else if(this[_0xd529('0x8')][_0x46bbb2[_0xd529('0x46')]]){this[_0xd529('0x8')][_0x46bbb2[_0xd529('0x46')]][_0xd529('0x4a')]=_0x46bbb2[_0xd529('0x43')]['toLowerCase']();this['trunks'][_0x46bbb2[_0xd529('0x46')]][_0xd529('0x47')]=_0x46bbb2['address'];logger['debug'](_0xd529('0x4c'),util[_0xd529('0x16')](this[_0xd529('0x8')][_0x46bbb2['peer']],{'showHidden':![],'depth':null}));this[_0xd529('0x2a')](util[_0xd529('0x34')](_0xd529('0x2b'),this[_0xd529('0x8')][_0x46bbb2[_0xd529('0x46')]][_0xd529('0x2c')]),_0xd529('0x2d'),this[_0xd529('0x8')][_0x46bbb2[_0xd529('0x46')]]);}}}catch(_0x214c05){logger[_0xd529('0x1b')]('[userReport][peerstatus]',util[_0xd529('0x16')](_0x214c05,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index e10f260..fa978bd 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x294a=['merge','omit','event','privilege','interface','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','agentcompleteAt','transfer','agent','talktime','acw','acwtime','agentacw','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceQueues','agents','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','channels','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','variables','voice'];(function(_0x105bef,_0x312357){var _0xa16b5b=function(_0x44f308){while(--_0x44f308){_0x105bef['push'](_0x105bef['shift']());}};_0xa16b5b(++_0x312357);}(_0x294a,0x6d));var _0xa294=function(_0x2067e3,_0x19bcb2){_0x2067e3=_0x2067e3-0x0;var _0x180c44=_0x294a[_0x2067e3];return _0x180c44;};'use strict';var _=require(_0xa294('0x0'));var moment=require(_0xa294('0x1'));var util=require(_0xa294('0x2'));var Redis=require(_0xa294('0x3'));var config=require(_0xa294('0x4'));var logger=require(_0xa294('0x5'))(_0xa294('0x6'));var ami=require(_0xa294('0x7'));config[_0xa294('0x8')]=_[_0xa294('0x9')](config[_0xa294('0x8')],{'host':_0xa294('0xa'),'port':0x18eb});var io=require(_0xa294('0xb'))(new Redis(config[_0xa294('0x8')]));function VoiceAgentReport(_0x39cb9a){this['channels']={};this['voiceChannels']=_0x39cb9a['channels'];this[_0xa294('0xc')]=_0x39cb9a['voiceQueues'];this[_0xa294('0xd')]=_0x39cb9a[_0xa294('0xd')];this['variables']={};ami['on']('agentcalled',this[_0xa294('0xe')][_0xa294('0xf')](this));ami['on']('agentconnect',this[_0xa294('0x10')][_0xa294('0xf')](this));ami['on'](_0xa294('0x11'),this[_0xa294('0x12')][_0xa294('0xf')](this));ami['on']('queuecallerabandon',this[_0xa294('0x13')][_0xa294('0xf')](this));ami['on']('agentcomplete',this[_0xa294('0x14')][_0xa294('0xf')](this));ami['on'](_0xa294('0x15'),this[_0xa294('0x16')][_0xa294('0xf')](this));ami['on'](_0xa294('0x17'),this[_0xa294('0x18')][_0xa294('0xf')](this));ami['on'](_0xa294('0x19'),this[_0xa294('0x1a')][_0xa294('0xf')](this));ami['on'](_0xa294('0x1b'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0xa294('0x1c'),this[_0xa294('0x1d')][_0xa294('0xf')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xa294('0xf')](this));}VoiceAgentReport[_0xa294('0x1e')][_0xa294('0x1f')]=function(_0x2c336e,_0x1d4688,_0x6444c9){io['to'](_0x2c336e)[_0xa294('0x1f')](_0x1d4688,_0x6444c9);};VoiceAgentReport[_0xa294('0x1e')][_0xa294('0x20')]=function(_0x56077a){return _0x56077a!==null&&!_[_0xa294('0x21')](_0x56077a);};VoiceAgentReport[_0xa294('0x1e')][_0xa294('0xe')]=function(_0x4c8a4c){try{if(this[_0xa294('0x20')](_0x4c8a4c)){logger[_0xa294('0x22')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4c8a4c['uniqueid'],_0x4c8a4c[_0xa294('0x23')],_0x4c8a4c[_0xa294('0x24')]);logger[_0xa294('0x25')](_0xa294('0x26'),_0x4c8a4c[_0xa294('0x27')],util[_0xa294('0x28')](_0x4c8a4c,{'showHidden':![],'depth':null}));if(_[_0xa294('0x21')](this['channels'][_0x4c8a4c[_0xa294('0x27')]])){this[_0xa294('0x29')][_0x4c8a4c['uniqueid']]={};}if(_[_0xa294('0x21')](this[_0xa294('0x29')][_0x4c8a4c[_0xa294('0x27')]][_0x4c8a4c['destuniqueid']])){this[_0xa294('0x29')][_0x4c8a4c[_0xa294('0x27')]][_0x4c8a4c[_0xa294('0x24')]]={'agentcalledAt':moment()[_0xa294('0x2a')](_0xa294('0x2b')),'lastevent':_0xa294('0x2c'),'mandatoryDisposition':this[_0xa294('0xc')][_0x4c8a4c[_0xa294('0x2d')]]?this['voiceQueues'][_0x4c8a4c[_0xa294('0x2d')]][_0xa294('0x2e')]||![]:![],'type':this[_0xa294('0xc')][_0x4c8a4c[_0xa294('0x2d')]]?this['voiceQueues'][_0x4c8a4c[_0xa294('0x2d')]][_0xa294('0x2f')]||'inbound':_0xa294('0x30'),'variables':this[_0xa294('0x31')][_0x4c8a4c[_0xa294('0x27')]],'motionChannel':_0xa294('0x32')};}_[_0xa294('0x33')](this[_0xa294('0x29')][_0x4c8a4c[_0xa294('0x27')]][_0x4c8a4c['destuniqueid']],_[_0xa294('0x34')](_0x4c8a4c,[_0xa294('0x35'),_0xa294('0x36')]));logger[_0xa294('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x4c8a4c[_0xa294('0x27')],util[_0xa294('0x28')](this[_0xa294('0x29')][_0x4c8a4c[_0xa294('0x27')]][_0x4c8a4c['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xa294('0x1f')]('custom:agentcalled',this['channels'][_0x4c8a4c[_0xa294('0x27')]][_0x4c8a4c[_0xa294('0x24')]]);var _0x2009ae={'id':this[_0xa294('0xd')][_0x4c8a4c[_0xa294('0x37')]]['id'],'calleridnum':this[_0xa294('0x29')][_0x4c8a4c[_0xa294('0x27')]][_0x4c8a4c['destuniqueid']][_0xa294('0x38')],'queue':this[_0xa294('0x29')][_0x4c8a4c[_0xa294('0x27')]][_0x4c8a4c[_0xa294('0x24')]][_0xa294('0x2d')],'variables':this['channels'][_0x4c8a4c[_0xa294('0x27')]][_0x4c8a4c[_0xa294('0x24')]][_0xa294('0x31')]};logger[_0xa294('0x25')](_0xa294('0x39'),_0x4c8a4c[_0xa294('0x27')],util[_0xa294('0x28')](_0x2009ae,{'showHidden':![],'depth':null}));this[_0xa294('0x1f')](util[_0xa294('0x2a')]('user:%s',_0x4c8a4c['membername']),_0xa294('0x3a'),_0x2009ae);}}catch(_0x3e1929){logger[_0xa294('0x3b')](_0xa294('0x3c'),_0x4c8a4c['uniqueid'],util[_0xa294('0x28')](_0x3e1929,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa294('0x10')]=function(_0x184e88){try{if(this[_0xa294('0x20')](_0x184e88)){if(this['channels'][_0x184e88[_0xa294('0x27')]]){logger[_0xa294('0x25')](_0xa294('0x3d'),_0x184e88[_0xa294('0x27')],util[_0xa294('0x28')](_0x184e88,{'showHidden':![],'depth':null}));for(var _0x231e7c in this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]]){if(this[_0xa294('0x29')][_0x184e88['uniqueid']][_0xa294('0x3e')](_0x231e7c)){if(_0x184e88[_0xa294('0x24')]===_0x231e7c){logger[_0xa294('0x22')](_0xa294('0x3f'),_0x184e88[_0xa294('0x27')],_0x184e88[_0xa294('0x23')],_0x184e88[_0xa294('0x24')]);this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x40')]=moment()[_0xa294('0x2a')](_0xa294('0x2b'));this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x41')]=_0x184e88[_0xa294('0x41')];this[_0xa294('0x29')][_0x184e88['uniqueid']][_0x231e7c][_0xa294('0x42')]=_0x184e88['connectedlinenum'];this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x43')]=_0x184e88[_0xa294('0x43')];this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x44')]=_0x184e88[_0xa294('0x44')];this['channels'][_0x184e88['uniqueid']][_0x231e7c][_0xa294('0x45')]=_0x184e88[_0xa294('0x45')];this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c]['lastevent']=_0xa294('0x46');if(this[_0xa294('0x47')][this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x27')]]){var _0x967e4c=this['voiceChannels'][this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x27')]][_0xa294('0x48')];this[_0xa294('0x29')][_0x184e88['uniqueid']][_0x231e7c][_0xa294('0x48')]=_0x967e4c;_0x184e88[_0xa294('0x48')]=_0x967e4c;}_[_0xa294('0x33')](this['agents'][_0x184e88[_0xa294('0x37')]],_[_0xa294('0x49')](_0x184e88,['queue',_0xa294('0x4a'),_0xa294('0x48')]));logger[_0xa294('0x25')](_0xa294('0x4b'),_0x184e88[_0xa294('0x27')],util[_0xa294('0x28')](this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x184e88[_0xa294('0x24')]],{'showHidden':![],'depth':null}));ami[_0xa294('0x1f')](_0xa294('0x4c'),this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x184e88[_0xa294('0x24')]]);logger['debug'](_0xa294('0x4d'),_0x184e88[_0xa294('0x27')],util[_0xa294('0x28')](this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x184e88[_0xa294('0x24')]],{'showHidden':![],'depth':null}));this[_0xa294('0x1f')](util['format'](_0xa294('0x4e'),_0x184e88['membername']),_0xa294('0x4f'),this['channels'][_0x184e88[_0xa294('0x27')]][_0x184e88[_0xa294('0x24')]]);}else if(!this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x11')]&&!this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x50')]){logger[_0xa294('0x22')](_0xa294('0x51'),_0x184e88[_0xa294('0x27')],this[_0xa294('0x29')][_0x184e88['uniqueid']][_0x231e7c][_0xa294('0x23')],_0x231e7c);this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x11')]=!![];this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x52')]=moment()['format'](_0xa294('0x2b'));this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x53')]=_0x184e88[_0xa294('0x24')];this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x54')]=_0x184e88[_0xa294('0x23')];this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x55')]='answered_elsewhere';this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c][_0xa294('0x56')]='answered_elsewhere';logger['debug'](_0xa294('0x57'),_0x184e88['uniqueid'],util['inspect'](this[_0xa294('0x29')][_0x184e88[_0xa294('0x27')]][_0x231e7c],{'showHidden':![],'depth':null}));ami[_0xa294('0x1f')]('custom:agentansweredelsewhere',this[_0xa294('0x29')][_0x184e88['uniqueid']][_0x231e7c]);}}}}}}catch(_0x13f9c7){logger[_0xa294('0x3b')](_0xa294('0x58'),_0x184e88[_0xa294('0x27')],util[_0xa294('0x28')](_0x13f9c7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentRingNoAnswer']=function(_0x3316e7){try{if(this[_0xa294('0x20')](_0x3316e7)){logger['debug'](_0xa294('0x59'),_0x3316e7[_0xa294('0x27')],util[_0xa294('0x28')](_0x3316e7,{'showHidden':![],'depth':null}));if(this['channels'][_0x3316e7[_0xa294('0x27')]]&&this[_0xa294('0x29')][_0x3316e7[_0xa294('0x27')]][_0x3316e7['destuniqueid']]){logger[_0xa294('0x22')](_0xa294('0x5a'),_0x3316e7[_0xa294('0x27')],_0x3316e7[_0xa294('0x23')],_0x3316e7[_0xa294('0x24')]);this[_0xa294('0x29')][_0x3316e7[_0xa294('0x27')]][_0x3316e7['destuniqueid']][_0xa294('0x11')]=!![];this[_0xa294('0x29')][_0x3316e7[_0xa294('0x27')]][_0x3316e7[_0xa294('0x24')]][_0xa294('0x52')]=moment()[_0xa294('0x2a')](_0xa294('0x2b'));this[_0xa294('0x29')][_0x3316e7['uniqueid']][_0x3316e7['destuniqueid']][_0xa294('0x55')]=_0xa294('0x5b');this[_0xa294('0x29')][_0x3316e7[_0xa294('0x27')]][_0x3316e7[_0xa294('0x24')]][_0xa294('0x56')]=_0xa294('0x5b');logger[_0xa294('0x25')](_0xa294('0x5c'),_0x3316e7[_0xa294('0x27')],util[_0xa294('0x28')](this[_0xa294('0x29')][_0x3316e7[_0xa294('0x27')]][_0x3316e7['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xa294('0x1f')](_0xa294('0x5d'),this[_0xa294('0x29')][_0x3316e7[_0xa294('0x27')]][_0x3316e7[_0xa294('0x24')]]);}}}catch(_0x3d5a0b){logger[_0xa294('0x3b')](_0xa294('0x5e'),_0x3316e7[_0xa294('0x27')],util[_0xa294('0x28')](_0x3d5a0b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa294('0x1e')][_0xa294('0x13')]=function(_0x5784b2){try{if(this['isNotNull'](_0x5784b2)){logger[_0xa294('0x25')](_0xa294('0x5f'),_0x5784b2[_0xa294('0x27')],util['inspect'](_0x5784b2,{'showHidden':![],'depth':null}));if(this[_0xa294('0x29')][_0x5784b2['uniqueid']]){for(var _0x2ed762 in this[_0xa294('0x29')][_0x5784b2['uniqueid']]){if(this['channels'][_0x5784b2[_0xa294('0x27')]][_0xa294('0x3e')](_0x2ed762)&&!this[_0xa294('0x29')][_0x5784b2[_0xa294('0x27')]][_0x2ed762][_0xa294('0x11')]&&!this[_0xa294('0x29')][_0x5784b2['uniqueid']][_0x2ed762]['agentcomplete']){logger[_0xa294('0x22')](_0xa294('0x60'),_0x5784b2[_0xa294('0x27')],this[_0xa294('0x29')][_0x5784b2['uniqueid']][_0x2ed762][_0xa294('0x23')],_0x2ed762);this[_0xa294('0x29')][_0x5784b2['uniqueid']][_0x2ed762]['agentringnoanswer']=!![];this[_0xa294('0x29')][_0x5784b2['uniqueid']][_0x2ed762][_0xa294('0x52')]=moment()['format'](_0xa294('0x2b'));this[_0xa294('0x29')][_0x5784b2[_0xa294('0x27')]][_0x2ed762][_0xa294('0x55')]=_0xa294('0x61');this[_0xa294('0x29')][_0x5784b2[_0xa294('0x27')]][_0x2ed762][_0xa294('0x56')]=_0xa294('0x61');logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5784b2['uniqueid'],util[_0xa294('0x28')](this['channels'][_0x5784b2[_0xa294('0x27')]][_0x2ed762],{'showHidden':![],'depth':null}));ami[_0xa294('0x1f')](_0xa294('0x62'),this[_0xa294('0x29')][_0x5784b2[_0xa294('0x27')]][_0x2ed762]);}}}}}catch(_0x2e6b6a){logger[_0xa294('0x3b')](_0xa294('0x63'),_0x5784b2[_0xa294('0x27')],util[_0xa294('0x28')](_0x2e6b6a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa294('0x14')]=function(_0x1b0e44){try{if(this['isNotNull'](_0x1b0e44)){logger[_0xa294('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x1b0e44['uniqueid'],util[_0xa294('0x28')](_0x1b0e44,{'showHidden':![],'depth':null}));if(this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]]){for(var _0x2412ca in this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]]){if(this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0xa294('0x3e')](_0x2412ca)){if(this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x40')]&&!this['channels'][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x50')]){logger[_0xa294('0x22')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1b0e44[_0xa294('0x27')],this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x23')],_0x2412ca);this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x50')]=!![];this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x64')]=moment()[_0xa294('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x55')]='complete';this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x56')]=_0x1b0e44[_0xa294('0x56')]==_0xa294('0x65')?_0xa294('0x66'):_0x1b0e44[_0xa294('0x56')];this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca]['talktime']=_0x1b0e44[_0xa294('0x67')];if(this[_0xa294('0xc')][_0x1b0e44[_0xa294('0x2d')]]&&this[_0xa294('0xc')][_0x1b0e44[_0xa294('0x2d')]][_0xa294('0x68')]){this['channels'][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x69')]=this[_0xa294('0xc')][_0x1b0e44[_0xa294('0x2d')]]['acwTimeout'];this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca][_0xa294('0x6a')]=!![];}this[_0xa294('0xd')][_0x1b0e44['interface']]=_[_0xa294('0x34')](this[_0xa294('0xd')][_0x1b0e44[_0xa294('0x37')]],[_0xa294('0x2d'),'destconnectedlinenum']);logger[_0xa294('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x1b0e44[_0xa294('0x27')],util[_0xa294('0x28')](this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca],{'showHidden':![],'depth':null}));ami[_0xa294('0x1f')](_0xa294('0x6b'),this[_0xa294('0x29')][_0x1b0e44[_0xa294('0x27')]][_0x2412ca]);logger[_0xa294('0x25')](_0xa294('0x6c'),_0x1b0e44[_0xa294('0x27')],util[_0xa294('0x28')]({'id':this[_0xa294('0xd')][_0x1b0e44['interface']]['id'],'destaccountcode':_0x1b0e44['destaccountcode']},{'showHidden':![],'depth':null}));this[_0xa294('0x1f')](util[_0xa294('0x2a')](_0xa294('0x4e'),_0x1b0e44[_0xa294('0x23')]),_0xa294('0x6d'),{'id':this[_0xa294('0xd')][_0x1b0e44[_0xa294('0x37')]]['id'],'destaccountcode':_0x1b0e44[_0xa294('0x6e')]});}}}}}}catch(_0x517d7e){logger[_0xa294('0x3b')](_0xa294('0x6f'),_0x1b0e44['uniqueid'],util['inspect'](_0x517d7e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa294('0x1e')]['syncVarSet']=function(_0x59fde4){try{if(this[_0xa294('0x20')](_0x59fde4)){logger[_0xa294('0x25')](_0xa294('0x70'),_0x59fde4[_0xa294('0x27')],util[_0xa294('0x28')](_0x59fde4,{'showHidden':![],'depth':null}));this[_0xa294('0x71')](_0x59fde4[_0xa294('0x27')],_[_0xa294('0x72')](_0x59fde4[_0xa294('0x73')])[0x0],_0x59fde4[_0xa294('0x74')]);if(this['channels'][_0x59fde4['uniqueid']]){for(var _0x87fd90 in this[_0xa294('0x29')][_0x59fde4[_0xa294('0x27')]]){if(this['channels'][_0x59fde4['uniqueid']][_0xa294('0x3e')](_0x87fd90)){logger[_0xa294('0x22')](_0xa294('0x75'),_0x59fde4[_0xa294('0x27')],_0x87fd90,_[_0xa294('0x72')](_0x59fde4[_0xa294('0x73')])[0x0],_0x59fde4['value']);if(_[_0xa294('0x21')](this[_0xa294('0x29')][_0x59fde4[_0xa294('0x27')]][_0x87fd90][_0xa294('0x31')])){this['channels'][_0x59fde4[_0xa294('0x27')]][_0x87fd90]['variables']={};}this[_0xa294('0x29')][_0x59fde4[_0xa294('0x27')]][_0x87fd90][_0xa294('0x31')]=this[_0xa294('0x31')][_0x59fde4[_0xa294('0x27')]];}}}}}catch(_0x24cb32){logger[_0xa294('0x3b')]('[%s][voiceAgentReport][varset]',_0x59fde4[_0xa294('0x27')],util[_0xa294('0x28')](_0x24cb32,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa294('0x71')]=function(_0x7b111d,_0x1336aa,_0x1f27b6){var _0xc5bbc2=[_0xa294('0x76'),_0xa294('0x77'),_0xa294('0x78'),_0xa294('0x79'),'rtpaudioqosloss',_0xa294('0x7a'),'rtpaudioqosrtt',_0xa294('0x7b'),'sipcallid',_0xa294('0x7c'),'bridgepeer','bridgepvtcallid',_0xa294('0x7d'),_0xa294('0x7e'),_0xa294('0x7f'),'memberlastcall','membername',_0xa294('0x80'),_0xa294('0x81')];if(!_[_0xa294('0x82')](_0x1336aa)&&!_[_0xa294('0x83')](_0xc5bbc2,_0x1336aa)){if(_[_0xa294('0x21')](this[_0xa294('0x31')][_0x7b111d])){this[_0xa294('0x31')][_0x7b111d]={};}this['variables'][_0x7b111d][_0x1336aa]=_0x1f27b6;}};VoiceAgentReport[_0xa294('0x1e')][_0xa294('0x18')]=function(_0x4bc822){try{if(this['isNotNull'](_0x4bc822)){logger[_0xa294('0x25')](_0xa294('0x84'),_0x4bc822[_0xa294('0x27')],util[_0xa294('0x28')](_0x4bc822,{'showHidden':![],'depth':null}));if(this['channels'][_0x4bc822[_0xa294('0x27')]]){for(var _0x2134bb in this[_0xa294('0x29')][_0x4bc822['uniqueid']]){if(this[_0xa294('0x29')][_0x4bc822[_0xa294('0x27')]][_0xa294('0x3e')](_0x2134bb)){if(this[_0xa294('0x29')][_0x4bc822[_0xa294('0x27')]][_0x2134bb][_0xa294('0x56')]=='transfer'&&this[_0xa294('0x29')][_0x4bc822[_0xa294('0x27')]][_0x2134bb]['agentcomplete']){logger[_0xa294('0x22')](_0xa294('0x85'),_0x4bc822[_0xa294('0x27')],_0x2134bb);this[_0xa294('0x29')][_0x4bc822[_0xa294('0x27')]][_0x2134bb][_0xa294('0x64')]=moment()[_0xa294('0x2a')](_0xa294('0x2b'));}}}logger[_0xa294('0x25')](_0xa294('0x86'),_0x4bc822[_0xa294('0x27')],util[_0xa294('0x28')](_[_0xa294('0x87')](this[_0xa294('0x29')][_0x4bc822[_0xa294('0x27')]]),{'showHidden':![],'depth':null}));ami[_0xa294('0x1f')](_0xa294('0x88'),_[_0xa294('0x87')](this[_0xa294('0x29')][_0x4bc822[_0xa294('0x27')]]));delete this[_0xa294('0x29')][_0x4bc822[_0xa294('0x27')]];}if(this[_0xa294('0x31')][_0x4bc822[_0xa294('0x27')]]){delete this['variables'][_0x4bc822[_0xa294('0x27')]];}}}catch(_0x10bcd7){logger[_0xa294('0x3b')](_0xa294('0x89'),_0x4bc822['uniqueid'],util[_0xa294('0x28')](_0x10bcd7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa294('0x1e')][_0xa294('0x1d')]=function(_0x4aa0a9){try{if(this['isNotNull'](_0x4aa0a9)){logger[_0xa294('0x25')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x4aa0a9[_0xa294('0x27')],util[_0xa294('0x28')](_0x4aa0a9,{'showHidden':![],'depth':null}));if(this[_0xa294('0x29')][_0x4aa0a9[_0xa294('0x8a')]]){for(var _0x280ae6 in this['channels'][_0x4aa0a9[_0xa294('0x8a')]]){if(this[_0xa294('0x29')][_0x4aa0a9[_0xa294('0x8a')]][_0xa294('0x3e')](_0x280ae6)){if(_0x4aa0a9[_0xa294('0x8b')]===_0x280ae6){logger[_0xa294('0x22')](_0xa294('0x8c'),_0x4aa0a9[_0xa294('0x27')],this[_0xa294('0x29')][_0x4aa0a9[_0xa294('0x8a')]][_0x280ae6][_0xa294('0x23')],_0x280ae6);var _0x38a0d6=moment();this[_0xa294('0x29')][_0x4aa0a9['transfereeuniqueid']][_0x280ae6][_0xa294('0x50')]=!![];this[_0xa294('0x29')][_0x4aa0a9[_0xa294('0x8a')]][_0x280ae6][_0xa294('0x64')]=moment()[_0xa294('0x2a')](_0xa294('0x2b'));this[_0xa294('0x29')][_0x4aa0a9[_0xa294('0x8a')]][_0x280ae6][_0xa294('0x55')]='complete';this['channels'][_0x4aa0a9[_0xa294('0x8a')]][_0x280ae6][_0xa294('0x56')]='transfer';this['channels'][_0x4aa0a9['transfereeuniqueid']][_0x280ae6][_0xa294('0x67')]=_0x38a0d6[_0xa294('0x8d')](this[_0xa294('0x29')][_0x4aa0a9['transfereeuniqueid']][_0x280ae6][_0xa294('0x40')],_0xa294('0x8e'));}}}}if(this[_0xa294('0x29')][_0x4aa0a9[_0xa294('0x8f')]]){var _0x271e3f=this['channels'][_0x4aa0a9['secondtransfereruniqueid']];this[_0xa294('0x29')][_0x4aa0a9['secondtransfereruniqueid']]=this['channels'][_0x4aa0a9[_0xa294('0x8a')]];this[_0xa294('0x29')][_0x4aa0a9[_0xa294('0x8a')]]=_0x271e3f;}}}catch(_0x19458c){logger['error'](_0xa294('0x90'),_0x4aa0a9[_0xa294('0x27')],util[_0xa294('0x28')](_0x19458c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa294('0x91')]=function(_0x8f86af){try{if(this['isNotNull'](_0x8f86af)){logger['debug'](_0xa294('0x92'),_0x8f86af[_0xa294('0x27')],util['inspect'](_0x8f86af,{'showHidden':![],'depth':null}));if(this[_0xa294('0x29')][_0x8f86af[_0xa294('0x8a')]]){for(var _0x1629db in this[_0xa294('0x29')][_0x8f86af[_0xa294('0x8a')]]){if(this[_0xa294('0x29')][_0x8f86af[_0xa294('0x8a')]]['hasOwnProperty'](_0x1629db)){if(_0x8f86af[_0xa294('0x93')]===_0x1629db){logger[_0xa294('0x22')](_0xa294('0x94'),_0x8f86af[_0xa294('0x27')],this['channels'][_0x8f86af[_0xa294('0x8a')]][_0x1629db][_0xa294('0x23')],_0x1629db);var _0x238f6c=moment();this['channels'][_0x8f86af[_0xa294('0x8a')]][_0x1629db][_0xa294('0x50')]=!![];this[_0xa294('0x29')][_0x8f86af['transfereeuniqueid']][_0x1629db][_0xa294('0x64')]=_0x238f6c;this[_0xa294('0x29')][_0x8f86af['transfereeuniqueid']][_0x1629db][_0xa294('0x55')]=_0xa294('0x95');this[_0xa294('0x29')][_0x8f86af[_0xa294('0x8a')]][_0x1629db][_0xa294('0x56')]=_0xa294('0x65');this['channels'][_0x8f86af['transfereeuniqueid']][_0x1629db]['talktime']=_0x238f6c[_0xa294('0x8d')](this[_0xa294('0x29')][_0x8f86af['transfereeuniqueid']][_0x1629db][_0xa294('0x40')],_0xa294('0x8e'));}}}}}}catch(_0xd3fb60){logger[_0xa294('0x3b')]('[%s][voiceAgentReport][blindtransfer]',_0x8f86af['uniqueid'],util[_0xa294('0x28')](_0xd3fb60,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x33811f){var _0x44d878='';try{if(this[_0xa294('0x20')](_0x33811f)){logger[_0xa294('0x25')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x33811f['uniqueid'],util[_0xa294('0x28')](_0x33811f,{'showHidden':![],'depth':null}));if(_0x33811f[_0xa294('0x96')]){_0x44d878=_0x33811f[_0xa294('0x96')][_0xa294('0x97')](0x0,_0x33811f[_0xa294('0x96')][_0xa294('0x98')]('-'));if(this[_0xa294('0xd')][_0x44d878]){logger[_0xa294('0x22')](_0xa294('0x99'),_0x33811f[_0xa294('0x27')],_0x44d878);this[_0xa294('0xd')][_0x44d878][_0xa294('0x9a')]=!![];}}}}catch(_0xaa5121){logger[_0xa294('0x3b')](_0xa294('0x9b'),_0x33811f[_0xa294('0x27')],util[_0xa294('0x28')](_0xaa5121,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa294('0x1e')]['syncMusicOnHoldStop']=function(_0x104b35){var _0xccb686='';try{if(this[_0xa294('0x20')](_0x104b35)){logger[_0xa294('0x25')](_0xa294('0x9c'),_0x104b35['uniqueid'],util['inspect'](_0x104b35,{'showHidden':![],'depth':null}));if(_0x104b35[_0xa294('0x96')]){_0xccb686=_0x104b35[_0xa294('0x96')][_0xa294('0x97')](0x0,_0x104b35[_0xa294('0x96')][_0xa294('0x98')]('-'));if(this[_0xa294('0xd')][_0xccb686]){logger[_0xa294('0x22')](_0xa294('0x9d'),_0x104b35[_0xa294('0x27')],_0xccb686);this['agents'][_0xccb686]['onhold']=![];}}}}catch(_0x57238b){logger[_0xa294('0x3b')](_0xa294('0x9e'),_0x104b35['uniqueid'],util[_0xa294('0x28')](_0x57238b,{'showHidden':![],'depth':null}));}};module[_0xa294('0x9f')]=VoiceAgentReport; \ No newline at end of file +var _0xe818=['agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','YYYY-MM-DD\x20HH:mm:ss','rejected','custom:agentringnoanswer','error','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acw','acwTimeout','agentacw','custom:agentcomplete','user:%s','user:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','addVariable','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','isNil','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','syncBlindTransfer','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','format','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','emit','custom:agentcalled','interface','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere'];(function(_0x2e0f66,_0x6895e5){var _0x5d1ca6=function(_0x12cbd9){while(--_0x12cbd9){_0x2e0f66['push'](_0x2e0f66['shift']());}};_0x5d1ca6(++_0x6895e5);}(_0xe818,0x17d));var _0x8e81=function(_0x3f3246,_0x126d78){_0x3f3246=_0x3f3246-0x0;var _0x41aeed=_0xe818[_0x3f3246];return _0x41aeed;};'use strict';var _=require(_0x8e81('0x0'));var moment=require(_0x8e81('0x1'));var util=require(_0x8e81('0x2'));var Redis=require(_0x8e81('0x3'));var config=require(_0x8e81('0x4'));var logger=require(_0x8e81('0x5'))('ami');var ami=require(_0x8e81('0x6'));config[_0x8e81('0x7')]=_[_0x8e81('0x8')](config['redis'],{'host':_0x8e81('0x9'),'port':0x18eb});var io=require(_0x8e81('0xa'))(new Redis(config[_0x8e81('0x7')]));function VoiceAgentReport(_0x3da78c){this[_0x8e81('0xb')]={};this['voiceChannels']=_0x3da78c[_0x8e81('0xb')];this[_0x8e81('0xc')]=_0x3da78c[_0x8e81('0xc')];this[_0x8e81('0xd')]=_0x3da78c[_0x8e81('0xd')];this[_0x8e81('0xe')]={};ami['on']('agentcalled',this[_0x8e81('0xf')][_0x8e81('0x10')](this));ami['on'](_0x8e81('0x11'),this['syncAgentConnect']['bind'](this));ami['on'](_0x8e81('0x12'),this[_0x8e81('0x13')]['bind'](this));ami['on']('queuecallerabandon',this[_0x8e81('0x14')][_0x8e81('0x10')](this));ami['on'](_0x8e81('0x15'),this[_0x8e81('0x16')][_0x8e81('0x10')](this));ami['on']('varset',this[_0x8e81('0x17')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x8e81('0x18'),this[_0x8e81('0x19')][_0x8e81('0x10')](this));ami['on'](_0x8e81('0x1a'),this[_0x8e81('0x1b')]['bind'](this));ami['on'](_0x8e81('0x1c'),this[_0x8e81('0x1d')]['bind'](this));ami['on'](_0x8e81('0x1e'),this['syncBlindTransfer'][_0x8e81('0x10')](this));}VoiceAgentReport[_0x8e81('0x1f')]['emit']=function(_0x110728,_0x27086d,_0x3a45b2){io['to'](_0x110728)['emit'](_0x27086d,_0x3a45b2);};VoiceAgentReport['prototype'][_0x8e81('0x20')]=function(_0x25f62a){return _0x25f62a!==null&&!_['isUndefined'](_0x25f62a);};VoiceAgentReport[_0x8e81('0x1f')][_0x8e81('0xf')]=function(_0x6114c2){try{if(this[_0x8e81('0x20')](_0x6114c2)){logger[_0x8e81('0x21')](_0x8e81('0x22'),_0x6114c2[_0x8e81('0x23')],_0x6114c2[_0x8e81('0x24')],_0x6114c2[_0x8e81('0x25')]);logger[_0x8e81('0x26')](_0x8e81('0x27'),_0x6114c2[_0x8e81('0x23')],util[_0x8e81('0x28')](_0x6114c2,{'showHidden':![],'depth':null}));if(_[_0x8e81('0x29')](this['channels'][_0x6114c2[_0x8e81('0x23')]])){this[_0x8e81('0xb')][_0x6114c2[_0x8e81('0x23')]]={};}if(_[_0x8e81('0x29')](this[_0x8e81('0xb')][_0x6114c2[_0x8e81('0x23')]][_0x6114c2[_0x8e81('0x25')]])){this['channels'][_0x6114c2['uniqueid']][_0x6114c2['destuniqueid']]={'agentcalledAt':moment()[_0x8e81('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','mandatoryDisposition':this['voiceQueues'][_0x6114c2[_0x8e81('0x2b')]]?this[_0x8e81('0xc')][_0x6114c2['queue']][_0x8e81('0x2c')]||![]:![],'type':this['voiceQueues'][_0x6114c2[_0x8e81('0x2b')]]?this['voiceQueues'][_0x6114c2['queue']][_0x8e81('0x2d')]||'inbound':_0x8e81('0x2e'),'variables':this['variables'][_0x6114c2[_0x8e81('0x23')]],'motionChannel':_0x8e81('0x2f')};}_[_0x8e81('0x30')](this[_0x8e81('0xb')][_0x6114c2['uniqueid']][_0x6114c2[_0x8e81('0x25')]],_[_0x8e81('0x31')](_0x6114c2,[_0x8e81('0x32'),_0x8e81('0x33')]));logger[_0x8e81('0x26')](_0x8e81('0x34'),_0x6114c2[_0x8e81('0x23')],util[_0x8e81('0x28')](this[_0x8e81('0xb')][_0x6114c2['uniqueid']][_0x6114c2[_0x8e81('0x25')]],{'showHidden':![],'depth':null}));ami[_0x8e81('0x35')](_0x8e81('0x36'),this[_0x8e81('0xb')][_0x6114c2[_0x8e81('0x23')]][_0x6114c2[_0x8e81('0x25')]]);var _0x523754={'id':this[_0x8e81('0xd')][_0x6114c2[_0x8e81('0x37')]]['id'],'calleridnum':this[_0x8e81('0xb')][_0x6114c2[_0x8e81('0x23')]][_0x6114c2[_0x8e81('0x25')]][_0x8e81('0x38')],'queue':this[_0x8e81('0xb')][_0x6114c2[_0x8e81('0x23')]][_0x6114c2[_0x8e81('0x25')]][_0x8e81('0x2b')],'variables':this[_0x8e81('0xb')][_0x6114c2[_0x8e81('0x23')]][_0x6114c2[_0x8e81('0x25')]][_0x8e81('0xe')]};logger[_0x8e81('0x26')](_0x8e81('0x39'),_0x6114c2['uniqueid'],util['inspect'](_0x523754,{'showHidden':![],'depth':null}));this['emit'](util[_0x8e81('0x2a')]('user:%s',_0x6114c2['membername']),_0x8e81('0x3a'),_0x523754);}}catch(_0x2a5b46){logger['error'](_0x8e81('0x3b'),_0x6114c2[_0x8e81('0x23')],util[_0x8e81('0x28')](_0x2a5b46,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8e81('0x3c')]=function(_0xb58890){try{if(this[_0x8e81('0x20')](_0xb58890)){if(this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]]){logger[_0x8e81('0x26')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0xb58890[_0x8e81('0x23')],util[_0x8e81('0x28')](_0xb58890,{'showHidden':![],'depth':null}));for(var _0x50b81c in this[_0x8e81('0xb')][_0xb58890['uniqueid']]){if(this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]]['hasOwnProperty'](_0x50b81c)){if(_0xb58890['destuniqueid']===_0x50b81c){logger[_0x8e81('0x21')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0xb58890['uniqueid'],_0xb58890[_0x8e81('0x24')],_0xb58890['destuniqueid']);this['channels'][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x3d')]=moment()[_0x8e81('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x3e')]=_0xb58890['connectedlinename'];this['channels'][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x3f')]=_0xb58890[_0x8e81('0x3f')];this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c]['destchannelstate']=_0xb58890[_0x8e81('0x40')];this[_0x8e81('0xb')][_0xb58890['uniqueid']][_0x50b81c][_0x8e81('0x41')]=_0xb58890['destchannelstatedesc'];this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c]['holdtime']=_0xb58890[_0x8e81('0x42')];this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x43')]=_0x8e81('0x44');if(this[_0x8e81('0x45')][this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c]['uniqueid']]){var _0x227541=this[_0x8e81('0x45')][this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x23')]][_0x8e81('0x46')];this[_0x8e81('0xb')][_0xb58890['uniqueid']][_0x50b81c][_0x8e81('0x46')]=_0x227541;_0xb58890[_0x8e81('0x46')]=_0x227541;}_[_0x8e81('0x30')](this['agents'][_0xb58890[_0x8e81('0x37')]],_['pick'](_0xb58890,[_0x8e81('0x2b'),_0x8e81('0x47'),_0x8e81('0x46')]));logger['debug'](_0x8e81('0x48'),_0xb58890[_0x8e81('0x23')],util[_0x8e81('0x28')](this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0xb58890[_0x8e81('0x25')]],{'showHidden':![],'depth':null}));ami[_0x8e81('0x35')]('custom:agentconnect',this['channels'][_0xb58890['uniqueid']][_0xb58890['destuniqueid']]);logger['debug'](_0x8e81('0x49'),_0xb58890['uniqueid'],util[_0x8e81('0x28')](this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0xb58890[_0x8e81('0x25')]],{'showHidden':![],'depth':null}));this[_0x8e81('0x35')](util[_0x8e81('0x2a')]('user:%s',_0xb58890['membername']),'user:agentconnect',this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0xb58890[_0x8e81('0x25')]]);}else if(!this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x12')]&&!this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x15')]){logger[_0x8e81('0x21')](_0x8e81('0x4a'),_0xb58890[_0x8e81('0x23')],this['channels'][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x24')],_0x50b81c);this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x12')]=!![];this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x4b')]=moment()[_0x8e81('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8e81('0xb')][_0xb58890['uniqueid']][_0x50b81c][_0x8e81('0x4c')]=_0xb58890[_0x8e81('0x25')];this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x4d')]=_0xb58890['membername'];this[_0x8e81('0xb')][_0xb58890['uniqueid']][_0x50b81c]['lastevent']=_0x8e81('0x4e');this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c][_0x8e81('0x4f')]='answered_elsewhere';logger[_0x8e81('0x26')](_0x8e81('0x50'),_0xb58890[_0x8e81('0x23')],util[_0x8e81('0x28')](this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c],{'showHidden':![],'depth':null}));ami['emit'](_0x8e81('0x51'),this[_0x8e81('0xb')][_0xb58890[_0x8e81('0x23')]][_0x50b81c]);}}}}}}catch(_0x5419e4){logger['error'](_0x8e81('0x52'),_0xb58890[_0x8e81('0x23')],util[_0x8e81('0x28')](_0x5419e4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8e81('0x13')]=function(_0xef6320){try{if(this['isNotNull'](_0xef6320)){logger[_0x8e81('0x26')](_0x8e81('0x53'),_0xef6320[_0x8e81('0x23')],util[_0x8e81('0x28')](_0xef6320,{'showHidden':![],'depth':null}));if(this[_0x8e81('0xb')][_0xef6320['uniqueid']]&&this[_0x8e81('0xb')][_0xef6320[_0x8e81('0x23')]][_0xef6320[_0x8e81('0x25')]]){logger['info']('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0xef6320[_0x8e81('0x23')],_0xef6320[_0x8e81('0x24')],_0xef6320[_0x8e81('0x25')]);this[_0x8e81('0xb')][_0xef6320[_0x8e81('0x23')]][_0xef6320[_0x8e81('0x25')]][_0x8e81('0x12')]=!![];this[_0x8e81('0xb')][_0xef6320[_0x8e81('0x23')]][_0xef6320[_0x8e81('0x25')]][_0x8e81('0x4b')]=moment()[_0x8e81('0x2a')](_0x8e81('0x54'));this['channels'][_0xef6320['uniqueid']][_0xef6320[_0x8e81('0x25')]]['lastevent']=_0x8e81('0x55');this['channels'][_0xef6320[_0x8e81('0x23')]][_0xef6320[_0x8e81('0x25')]][_0x8e81('0x4f')]='rejected';logger[_0x8e81('0x26')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0xef6320[_0x8e81('0x23')],util['inspect'](this['channels'][_0xef6320['uniqueid']][_0xef6320[_0x8e81('0x25')]],{'showHidden':![],'depth':null}));ami[_0x8e81('0x35')](_0x8e81('0x56'),this['channels'][_0xef6320[_0x8e81('0x23')]][_0xef6320[_0x8e81('0x25')]]);}}}catch(_0x5a6cc6){logger[_0x8e81('0x57')]('[%s][voiceAgentReport][agentringnoanswer]',_0xef6320[_0x8e81('0x23')],util[_0x8e81('0x28')](_0x5a6cc6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8e81('0x1f')][_0x8e81('0x14')]=function(_0x29a580){try{if(this['isNotNull'](_0x29a580)){logger[_0x8e81('0x26')](_0x8e81('0x58'),_0x29a580['uniqueid'],util[_0x8e81('0x28')](_0x29a580,{'showHidden':![],'depth':null}));if(this[_0x8e81('0xb')][_0x29a580[_0x8e81('0x23')]]){for(var _0x4c1ff7 in this[_0x8e81('0xb')][_0x29a580[_0x8e81('0x23')]]){if(this[_0x8e81('0xb')][_0x29a580['uniqueid']][_0x8e81('0x59')](_0x4c1ff7)&&!this[_0x8e81('0xb')][_0x29a580[_0x8e81('0x23')]][_0x4c1ff7][_0x8e81('0x12')]&&!this[_0x8e81('0xb')][_0x29a580[_0x8e81('0x23')]][_0x4c1ff7][_0x8e81('0x15')]){logger[_0x8e81('0x21')](_0x8e81('0x5a'),_0x29a580[_0x8e81('0x23')],this[_0x8e81('0xb')][_0x29a580[_0x8e81('0x23')]][_0x4c1ff7][_0x8e81('0x24')],_0x4c1ff7);this[_0x8e81('0xb')][_0x29a580['uniqueid']][_0x4c1ff7]['agentringnoanswer']=!![];this['channels'][_0x29a580['uniqueid']][_0x4c1ff7][_0x8e81('0x4b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x29a580[_0x8e81('0x23')]][_0x4c1ff7][_0x8e81('0x43')]=_0x8e81('0x5b');this[_0x8e81('0xb')][_0x29a580['uniqueid']][_0x4c1ff7][_0x8e81('0x4f')]=_0x8e81('0x5b');logger[_0x8e81('0x26')](_0x8e81('0x5c'),_0x29a580[_0x8e81('0x23')],util['inspect'](this[_0x8e81('0xb')][_0x29a580['uniqueid']][_0x4c1ff7],{'showHidden':![],'depth':null}));ami[_0x8e81('0x35')]('custom:agentqueuecallerabandon',this[_0x8e81('0xb')][_0x29a580[_0x8e81('0x23')]][_0x4c1ff7]);}}}}}catch(_0x7a4ac7){logger[_0x8e81('0x57')](_0x8e81('0x5d'),_0x29a580[_0x8e81('0x23')],util['inspect'](_0x7a4ac7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8e81('0x16')]=function(_0x441603){try{if(this[_0x8e81('0x20')](_0x441603)){logger[_0x8e81('0x26')](_0x8e81('0x5e'),_0x441603['uniqueid'],util[_0x8e81('0x28')](_0x441603,{'showHidden':![],'depth':null}));if(this['channels'][_0x441603['uniqueid']]){for(var _0xcf18e in this[_0x8e81('0xb')][_0x441603[_0x8e81('0x23')]]){if(this['channels'][_0x441603[_0x8e81('0x23')]][_0x8e81('0x59')](_0xcf18e)){if(this[_0x8e81('0xb')][_0x441603['uniqueid']][_0xcf18e][_0x8e81('0x3d')]&&!this['channels'][_0x441603[_0x8e81('0x23')]][_0xcf18e][_0x8e81('0x15')]){logger[_0x8e81('0x21')](_0x8e81('0x5f'),_0x441603[_0x8e81('0x23')],this[_0x8e81('0xb')][_0x441603['uniqueid']][_0xcf18e][_0x8e81('0x24')],_0xcf18e);this[_0x8e81('0xb')][_0x441603[_0x8e81('0x23')]][_0xcf18e][_0x8e81('0x15')]=!![];this['channels'][_0x441603[_0x8e81('0x23')]][_0xcf18e][_0x8e81('0x60')]=moment()[_0x8e81('0x2a')](_0x8e81('0x54'));this['channels'][_0x441603[_0x8e81('0x23')]][_0xcf18e][_0x8e81('0x43')]=_0x8e81('0x61');this[_0x8e81('0xb')][_0x441603[_0x8e81('0x23')]][_0xcf18e][_0x8e81('0x4f')]=_0x441603[_0x8e81('0x4f')]=='transfer'?_0x8e81('0x62'):_0x441603['reason'];this['channels'][_0x441603[_0x8e81('0x23')]][_0xcf18e][_0x8e81('0x63')]=_0x441603[_0x8e81('0x63')];if(this[_0x8e81('0xc')][_0x441603[_0x8e81('0x2b')]]&&this['voiceQueues'][_0x441603['queue']][_0x8e81('0x64')]){this[_0x8e81('0xb')][_0x441603[_0x8e81('0x23')]][_0xcf18e]['acwtime']=this[_0x8e81('0xc')][_0x441603[_0x8e81('0x2b')]][_0x8e81('0x65')];this[_0x8e81('0xb')][_0x441603[_0x8e81('0x23')]][_0xcf18e][_0x8e81('0x66')]=!![];}this[_0x8e81('0xd')][_0x441603['interface']]=_[_0x8e81('0x31')](this[_0x8e81('0xd')][_0x441603['interface']],['queue',_0x8e81('0x47')]);logger[_0x8e81('0x26')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x441603[_0x8e81('0x23')],util[_0x8e81('0x28')](this[_0x8e81('0xb')][_0x441603[_0x8e81('0x23')]][_0xcf18e],{'showHidden':![],'depth':null}));ami[_0x8e81('0x35')](_0x8e81('0x67'),this[_0x8e81('0xb')][_0x441603[_0x8e81('0x23')]][_0xcf18e]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x441603[_0x8e81('0x23')],util[_0x8e81('0x28')]({'id':this[_0x8e81('0xd')][_0x441603[_0x8e81('0x37')]]['id'],'destaccountcode':_0x441603['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x8e81('0x35')](util[_0x8e81('0x2a')](_0x8e81('0x68'),_0x441603[_0x8e81('0x24')]),_0x8e81('0x69'),{'id':this[_0x8e81('0xd')][_0x441603[_0x8e81('0x37')]]['id'],'destaccountcode':_0x441603[_0x8e81('0x6a')]});}}}}}}catch(_0x1975b6){logger[_0x8e81('0x57')](_0x8e81('0x6b'),_0x441603['uniqueid'],util[_0x8e81('0x28')](_0x1975b6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8e81('0x1f')]['syncVarSet']=function(_0x2abbd8){try{if(this[_0x8e81('0x20')](_0x2abbd8)){logger[_0x8e81('0x26')]('[%s][voiceAgentReport][varset]\x20event:',_0x2abbd8[_0x8e81('0x23')],util['inspect'](_0x2abbd8,{'showHidden':![],'depth':null}));this[_0x8e81('0x6c')](_0x2abbd8[_0x8e81('0x23')],_['keys'](_0x2abbd8[_0x8e81('0x6d')])[0x0],_0x2abbd8['value']);if(this[_0x8e81('0xb')][_0x2abbd8[_0x8e81('0x23')]]){for(var _0xcdb5d9 in this[_0x8e81('0xb')][_0x2abbd8[_0x8e81('0x23')]]){if(this[_0x8e81('0xb')][_0x2abbd8[_0x8e81('0x23')]][_0x8e81('0x59')](_0xcdb5d9)){logger['info'](_0x8e81('0x6e'),_0x2abbd8[_0x8e81('0x23')],_0xcdb5d9,_[_0x8e81('0x6f')](_0x2abbd8['variable'])[0x0],_0x2abbd8['value']);if(_[_0x8e81('0x29')](this[_0x8e81('0xb')][_0x2abbd8[_0x8e81('0x23')]][_0xcdb5d9][_0x8e81('0xe')])){this[_0x8e81('0xb')][_0x2abbd8[_0x8e81('0x23')]][_0xcdb5d9][_0x8e81('0xe')]={};}this['channels'][_0x2abbd8[_0x8e81('0x23')]][_0xcdb5d9][_0x8e81('0xe')]=this[_0x8e81('0xe')][_0x2abbd8['uniqueid']];}}}}}catch(_0x575ff6){logger[_0x8e81('0x57')](_0x8e81('0x70'),_0x2abbd8['uniqueid'],util[_0x8e81('0x28')](_0x575ff6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8e81('0x1f')][_0x8e81('0x6c')]=function(_0x190007,_0x3b9e4e,_0x40e99e){var _0x30d94d=[_0x8e81('0x71'),'rtpaudioqosbridged',_0x8e81('0x72'),'rtpaudioqosjitterbridged',_0x8e81('0x73'),_0x8e81('0x74'),_0x8e81('0x75'),_0x8e81('0x76'),_0x8e81('0x77'),_0x8e81('0x78'),'bridgepeer',_0x8e81('0x79'),_0x8e81('0x7a'),'memberdynamic','memberinterface',_0x8e81('0x7b'),_0x8e81('0x24'),_0x8e81('0x7c'),'memberrealtime'];if(!_[_0x8e81('0x7d')](_0x3b9e4e)&&!_['includes'](_0x30d94d,_0x3b9e4e)){if(_['isUndefined'](this[_0x8e81('0xe')][_0x190007])){this[_0x8e81('0xe')][_0x190007]={};}this[_0x8e81('0xe')][_0x190007][_0x3b9e4e]=_0x40e99e;}};VoiceAgentReport['prototype']['syncHangup']=function(_0xdd285a){try{if(this['isNotNull'](_0xdd285a)){logger['debug'](_0x8e81('0x7e'),_0xdd285a['uniqueid'],util[_0x8e81('0x28')](_0xdd285a,{'showHidden':![],'depth':null}));if(this[_0x8e81('0xb')][_0xdd285a['uniqueid']]){for(var _0x21eb5d in this['channels'][_0xdd285a['uniqueid']]){if(this[_0x8e81('0xb')][_0xdd285a[_0x8e81('0x23')]][_0x8e81('0x59')](_0x21eb5d)){if(this[_0x8e81('0xb')][_0xdd285a[_0x8e81('0x23')]][_0x21eb5d][_0x8e81('0x4f')]==_0x8e81('0x7f')&&this['channels'][_0xdd285a[_0x8e81('0x23')]][_0x21eb5d]['agentcomplete']){logger[_0x8e81('0x21')](_0x8e81('0x80'),_0xdd285a[_0x8e81('0x23')],_0x21eb5d);this[_0x8e81('0xb')][_0xdd285a[_0x8e81('0x23')]][_0x21eb5d]['agentcompleteAt']=moment()['format'](_0x8e81('0x54'));}}}logger['debug'](_0x8e81('0x81'),_0xdd285a['uniqueid'],util[_0x8e81('0x28')](_[_0x8e81('0x82')](this[_0x8e81('0xb')][_0xdd285a[_0x8e81('0x23')]]),{'showHidden':![],'depth':null}));ami[_0x8e81('0x35')](_0x8e81('0x83'),_['values'](this['channels'][_0xdd285a['uniqueid']]));delete this[_0x8e81('0xb')][_0xdd285a[_0x8e81('0x23')]];}if(this['variables'][_0xdd285a[_0x8e81('0x23')]]){delete this[_0x8e81('0xe')][_0xdd285a[_0x8e81('0x23')]];}}}catch(_0x29fa18){logger[_0x8e81('0x57')](_0x8e81('0x84'),_0xdd285a[_0x8e81('0x23')],util[_0x8e81('0x28')](_0x29fa18,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8e81('0x1f')][_0x8e81('0x1d')]=function(_0x2d9427){try{if(this[_0x8e81('0x20')](_0x2d9427)){logger[_0x8e81('0x26')](_0x8e81('0x85'),_0x2d9427[_0x8e81('0x23')],util['inspect'](_0x2d9427,{'showHidden':![],'depth':null}));if(this[_0x8e81('0xb')][_0x2d9427[_0x8e81('0x86')]]){for(var _0x143bac in this['channels'][_0x2d9427[_0x8e81('0x86')]]){if(this[_0x8e81('0xb')][_0x2d9427[_0x8e81('0x86')]][_0x8e81('0x59')](_0x143bac)){if(_0x2d9427[_0x8e81('0x87')]===_0x143bac){logger[_0x8e81('0x21')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2d9427[_0x8e81('0x23')],this[_0x8e81('0xb')][_0x2d9427[_0x8e81('0x86')]][_0x143bac][_0x8e81('0x24')],_0x143bac);var _0x5956ba=moment();this[_0x8e81('0xb')][_0x2d9427[_0x8e81('0x86')]][_0x143bac][_0x8e81('0x15')]=!![];this[_0x8e81('0xb')][_0x2d9427['transfereeuniqueid']][_0x143bac][_0x8e81('0x60')]=moment()[_0x8e81('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8e81('0xb')][_0x2d9427[_0x8e81('0x86')]][_0x143bac][_0x8e81('0x43')]=_0x8e81('0x61');this['channels'][_0x2d9427[_0x8e81('0x86')]][_0x143bac]['reason']=_0x8e81('0x7f');this['channels'][_0x2d9427[_0x8e81('0x86')]][_0x143bac][_0x8e81('0x63')]=_0x5956ba[_0x8e81('0x88')](this[_0x8e81('0xb')][_0x2d9427['transfereeuniqueid']][_0x143bac][_0x8e81('0x3d')],_0x8e81('0x89'));}}}}if(this['channels'][_0x2d9427[_0x8e81('0x8a')]]){var _0x349bb7=this[_0x8e81('0xb')][_0x2d9427[_0x8e81('0x8a')]];this[_0x8e81('0xb')][_0x2d9427[_0x8e81('0x8a')]]=this[_0x8e81('0xb')][_0x2d9427['transfereeuniqueid']];this[_0x8e81('0xb')][_0x2d9427[_0x8e81('0x86')]]=_0x349bb7;}}}catch(_0x20df83){logger[_0x8e81('0x57')]('[%s][voiceAgentReport][attendedtransfer]',_0x2d9427[_0x8e81('0x23')],util['inspect'](_0x20df83,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8e81('0x1f')][_0x8e81('0x8b')]=function(_0x2fb96c){try{if(this[_0x8e81('0x20')](_0x2fb96c)){logger[_0x8e81('0x26')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x2fb96c[_0x8e81('0x23')],util[_0x8e81('0x28')](_0x2fb96c,{'showHidden':![],'depth':null}));if(this[_0x8e81('0xb')][_0x2fb96c[_0x8e81('0x86')]]){for(var _0x1e4b7e in this[_0x8e81('0xb')][_0x2fb96c[_0x8e81('0x86')]]){if(this['channels'][_0x2fb96c['transfereeuniqueid']][_0x8e81('0x59')](_0x1e4b7e)){if(_0x2fb96c[_0x8e81('0x8c')]===_0x1e4b7e){logger[_0x8e81('0x21')](_0x8e81('0x8d'),_0x2fb96c[_0x8e81('0x23')],this['channels'][_0x2fb96c[_0x8e81('0x86')]][_0x1e4b7e][_0x8e81('0x24')],_0x1e4b7e);var _0x42314b=moment();this['channels'][_0x2fb96c[_0x8e81('0x86')]][_0x1e4b7e][_0x8e81('0x15')]=!![];this['channels'][_0x2fb96c[_0x8e81('0x86')]][_0x1e4b7e][_0x8e81('0x60')]=_0x42314b;this['channels'][_0x2fb96c['transfereeuniqueid']][_0x1e4b7e][_0x8e81('0x43')]='complete';this[_0x8e81('0xb')][_0x2fb96c[_0x8e81('0x86')]][_0x1e4b7e]['reason']=_0x8e81('0x7f');this[_0x8e81('0xb')][_0x2fb96c[_0x8e81('0x86')]][_0x1e4b7e][_0x8e81('0x63')]=_0x42314b[_0x8e81('0x88')](this[_0x8e81('0xb')][_0x2fb96c[_0x8e81('0x86')]][_0x1e4b7e]['agentconnectAt'],_0x8e81('0x89'));}}}}}}catch(_0x323521){logger[_0x8e81('0x57')](_0x8e81('0x8e'),_0x2fb96c[_0x8e81('0x23')],util[_0x8e81('0x28')](_0x323521,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8e81('0x19')]=function(_0x589f47){var _0x5b8399='';try{if(this[_0x8e81('0x20')](_0x589f47)){logger[_0x8e81('0x26')](_0x8e81('0x8f'),_0x589f47[_0x8e81('0x23')],util[_0x8e81('0x28')](_0x589f47,{'showHidden':![],'depth':null}));if(_0x589f47[_0x8e81('0x90')]){_0x5b8399=_0x589f47[_0x8e81('0x90')][_0x8e81('0x91')](0x0,_0x589f47['channel']['lastIndexOf']('-'));if(this[_0x8e81('0xd')][_0x5b8399]){logger[_0x8e81('0x21')](_0x8e81('0x92'),_0x589f47[_0x8e81('0x23')],_0x5b8399);this[_0x8e81('0xd')][_0x5b8399][_0x8e81('0x93')]=!![];}}}}catch(_0x3825a4){logger[_0x8e81('0x57')]('[%s][voiceAgentReport][musiconholdstart]',_0x589f47['uniqueid'],util['inspect'](_0x3825a4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8e81('0x1f')][_0x8e81('0x1b')]=function(_0x4131fe){var _0x2fe5ae='';try{if(this[_0x8e81('0x20')](_0x4131fe)){logger[_0x8e81('0x26')](_0x8e81('0x94'),_0x4131fe[_0x8e81('0x23')],util['inspect'](_0x4131fe,{'showHidden':![],'depth':null}));if(_0x4131fe[_0x8e81('0x90')]){_0x2fe5ae=_0x4131fe[_0x8e81('0x90')][_0x8e81('0x91')](0x0,_0x4131fe[_0x8e81('0x90')][_0x8e81('0x95')]('-'));if(this[_0x8e81('0xd')][_0x2fe5ae]){logger['info'](_0x8e81('0x96'),_0x4131fe['uniqueid'],_0x2fe5ae);this[_0x8e81('0xd')][_0x2fe5ae][_0x8e81('0x93')]=![];}}}}catch(_0xc7d6dc){logger[_0x8e81('0x57')](_0x8e81('0x97'),_0x4131fe[_0x8e81('0x23')],util[_0x8e81('0x28')](_0xc7d6dc,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 53932dd..78fb9d3 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x055c=['catch','finally','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','transfereruniqueid','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','moment','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridnum','debug','uniqueid','linkedid','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','user:%s','name','user:agentconnect','error','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','pick','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','startsWith','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','cdr(','type','isNil','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','calleridname','destinationchannel','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','syncMixMonitorFilename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','then','undefined','isEmpty','getSettings','stopRecordingOnTransfer','resolve','StopMixMonitor'];(function(_0x254a98,_0xc8439d){var _0x3b8466=function(_0x49ed47){while(--_0x49ed47){_0x254a98['push'](_0x254a98['shift']());}};_0x3b8466(++_0xc8439d);}(_0x055c,0xe7));var _0xc055=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x055c[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var moment=require(_0xc055('0x0'));var util=require('util');var path=require(_0xc055('0x1'));var Redis=require(_0xc055('0x2'));var config=require(_0xc055('0x3'));var logger=require('../../../config/logger')(_0xc055('0x4'));var ami=require(_0xc055('0x5'));var Channel=require(_0xc055('0x6'));var RpcSetting=require(_0xc055('0x7'));var applications=[_0xc055('0x8'),_0xc055('0x9'),_0xc055('0xa'),_0xc055('0xb'),_0xc055('0xc'),'voicemail'];var dispositions=[_0xc055('0xd'),_0xc055('0xe'),_0xc055('0xe'),_0xc055('0xd'),'NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0xc055('0xf'),'FAILED','FAILED','FAILED'];config[_0xc055('0x10')]=_[_0xc055('0x11')](config[_0xc055('0x10')],{'host':_0xc055('0x12'),'port':0x18eb});var io=require(_0xc055('0x13'))(new Redis(config['redis']));function VoiceCallReport(_0x1a9f46){this['channels']=_0x1a9f46[_0xc055('0x14')];this['agents']=_0x1a9f46[_0xc055('0x15')];this[_0xc055('0x16')]={};ami['on'](_0xc055('0x17'),this[_0xc055('0x18')][_0xc055('0x19')](this));ami['on'](_0xc055('0x1a'),this[_0xc055('0x18')][_0xc055('0x19')](this));ami['on'](_0xc055('0x1b'),this[_0xc055('0x1c')][_0xc055('0x19')](this));ami['on'](_0xc055('0x1d'),this[_0xc055('0x1e')]['bind'](this));ami['on']('varset',this[_0xc055('0x1f')][_0xc055('0x19')](this));ami['on'](_0xc055('0x20'),this[_0xc055('0x21')]['bind'](this));ami['on']('newcallerid',this[_0xc055('0x22')]['bind'](this));ami['on'](_0xc055('0x23'),this[_0xc055('0x24')][_0xc055('0x19')](this));ami['on']('blindtransfer',this[_0xc055('0x25')]['bind'](this));ami['on'](_0xc055('0x26'),this[_0xc055('0x27')][_0xc055('0x19')](this));ami['on'](_0xc055('0x28'),this[_0xc055('0x29')][_0xc055('0x19')](this));try{logger[_0xc055('0x2a')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xc055('0x2b')]();}catch(_0x4b3a94){logger['error']('[voiceCallReport][coreshowchannels]',util[_0xc055('0x2c')](_0x4b3a94,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xc055('0x2d')][_0xc055('0x2e')]=function(_0x59cb2b){return _0x59cb2b!==null&&!_[_0xc055('0x2f')](_0x59cb2b);};VoiceCallReport[_0xc055('0x2d')]['emit']=function(_0x5a156a,_0x1bb4b8,_0x1f801e){io['to'](_0x5a156a)[_0xc055('0x30')](_0x1bb4b8,_0x1f801e);};VoiceCallReport[_0xc055('0x2d')][_0xc055('0x22')]=function(_0x46e6bb){try{if(this[_0xc055('0x2e')](_0x46e6bb)){logger[_0xc055('0x2a')](_0xc055('0x31'),_0x46e6bb['uniqueid'],_0x46e6bb['calleridname'],_0x46e6bb[_0xc055('0x32')]);logger[_0xc055('0x33')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x46e6bb['uniqueid'],util[_0xc055('0x2c')](_0x46e6bb,{'showHidden':![],'depth':null}));if(_0x46e6bb[_0xc055('0x34')]===_0x46e6bb[_0xc055('0x35')]){if(!_['isUndefined'](this[_0xc055('0x14')][_0x46e6bb[_0xc055('0x34')]])){_['merge'](this['channels'][_0x46e6bb[_0xc055('0x34')]],_['pick'](_0x46e6bb,_[_0xc055('0x36')](this[_0xc055('0x14')][_0x46e6bb[_0xc055('0x34')]])));}}if(_0x46e6bb[_0xc055('0x37')]===_0xc055('0x38')){if(this[_0xc055('0x15')][_0x46e6bb[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]){if(_0x46e6bb[_0xc055('0x3b')]==_0xc055('0x3c')){this[_0xc055('0x15')][_0x46e6bb[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x3d')]=_0x46e6bb[_0xc055('0x3e')];this[_0xc055('0x30')](util['format'](_0xc055('0x3f'),this[_0xc055('0x15')][_0x46e6bb['channel'][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x40')]),_0xc055('0x41'),{'destaccountcode':this[_0xc055('0x15')][_0x46e6bb[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x46e6bb[_0xc055('0x3e')]});}}}}}catch(_0x1dbf61){logger[_0xc055('0x42')]('[%s][voiceCallReport][newcallerid]',_0x46e6bb[_0xc055('0x34')],util[_0xc055('0x2c')](_0x1dbf61,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc055('0x2d')]['syncNewChannel']=function(_0x28d54f){try{if(this['isNotNull'](_0x28d54f)){logger[_0xc055('0x33')]('[%s][voiceCallReport][newchannel]\x20event:',_0x28d54f[_0xc055('0x34')],util[_0xc055('0x2c')](_0x28d54f,{'showHidden':![],'depth':null}));if(this[_0xc055('0x14')][_0x28d54f['uniqueid']])return;if(_0x28d54f[_0xc055('0x39')]===_0xc055('0x43'))return;if(_0x28d54f[_0xc055('0x34')]!==_0x28d54f[_0xc055('0x35')]&&!this['blindTransfers'][_0x28d54f[_0xc055('0x35')]])return;logger[_0xc055('0x2a')](_0xc055('0x44'),_0x28d54f[_0xc055('0x34')],_0x28d54f[_0xc055('0x37')],_0x28d54f[_0xc055('0x3b')]);this['channels'][_0x28d54f[_0xc055('0x34')]]=new Channel();this['channels'][_0x28d54f['uniqueid']][_0xc055('0x45')]=moment()[_0xc055('0x46')](_0xc055('0x47'));this[_0xc055('0x14')][_0x28d54f[_0xc055('0x34')]][_0xc055('0x48')]=dispositions[_[_0xc055('0x49')](_0x28d54f[_0xc055('0x4a')])];_[_0xc055('0x4b')](this[_0xc055('0x14')][_0x28d54f[_0xc055('0x34')]],_[_0xc055('0x4c')](_0x28d54f,_['keys'](this[_0xc055('0x14')][_0x28d54f[_0xc055('0x34')]])));if(_0x28d54f['context']===_0xc055('0x38')){if(this['agents'][_0x28d54f[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]){if(_[_0xc055('0x2f')](this[_0xc055('0x15')][_0x28d54f[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x3d')])){this[_0xc055('0x15')][_0x28d54f[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]['destconnectedlinenum']=_0x28d54f[_0xc055('0x3b')];logger[_0xc055('0x33')](_0xc055('0x4d'),_0x28d54f[_0xc055('0x34')],util['inspect']({'id':this[_0xc055('0x15')][_0x28d54f[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x28d54f[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x4e')],'destconnectedlinenum':_0x28d54f[_0xc055('0x3b')]},{'showHidden':![],'depth':null}));this[_0xc055('0x30')](util[_0xc055('0x46')](_0xc055('0x3f'),this['agents'][_0x28d54f[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x40')]),_0xc055('0x41'),{'id':this[_0xc055('0x15')][_0x28d54f[_0xc055('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xc055('0x15')][_0x28d54f[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x4e')],'destconnectedlinenum':_0x28d54f['exten']});}}}}}catch(_0x793f9){logger[_0xc055('0x42')](_0xc055('0x4f'),_0x28d54f['uniqueid'],util['inspect'](_0x793f9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc055('0x2d')][_0xc055('0x18')]=function(_0x5324ff){try{if(this[_0xc055('0x2e')](_0x5324ff)){logger[_0xc055('0x33')]('[%s][voiceCallReport][newexten]\x20event:',_0x5324ff[_0xc055('0x34')],util[_0xc055('0x2c')](_0x5324ff,{'showHidden':![],'depth':null}));if(_0x5324ff[_0xc055('0x39')]==='OutgoingSpoolFailed'||_0x5324ff[_0xc055('0x3b')]==='h')return;if(_0x5324ff[_0xc055('0x34')]===_0x5324ff[_0xc055('0x35')]||this[_0xc055('0x16')][_0x5324ff[_0xc055('0x35')]]){_0x5324ff['application']=_0x5324ff[_0xc055('0x50')][_0xc055('0x51')]();_0x5324ff[_0xc055('0x52')]=_0x5324ff['appdata']||_0x5324ff[_0xc055('0x52')];if(_0x5324ff[_0xc055('0x53')]&&!_0x5324ff[_0xc055('0x53')][_0xc055('0x54')]('CDR(routeAlias)')&&_0x5324ff[_0xc055('0x50')]!==_0xc055('0x9')){_0x5324ff['applicationdata']=_0x5324ff[_0xc055('0x52')][_0xc055('0x51')]();}logger[_0xc055('0x2a')](_0xc055('0x55'),_0x5324ff[_0xc055('0x34')],_0x5324ff['application'],_0x5324ff[_0xc055('0x52')]);if(_['isUndefined'](this[_0xc055('0x14')][_0x5324ff[_0xc055('0x34')]])){this[_0xc055('0x14')][_0x5324ff['uniqueid']]=new Channel();this['channels'][_0x5324ff['uniqueid']][_0xc055('0x45')]=_0x5324ff[_0xc055('0x56')]?moment()[_0xc055('0x57')](moment['duration'](_0x5324ff[_0xc055('0x56')])[_0xc055('0x58')](),_0xc055('0x58'))['format'](_0xc055('0x47')):moment()[_0xc055('0x46')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc055('0x14')][_0x5324ff[_0xc055('0x34')]][_0xc055('0x48')]=_0xc055('0xd');}_[_0xc055('0x4b')](this[_0xc055('0x14')][_0x5324ff[_0xc055('0x34')]],_[_0xc055('0x4c')](_0x5324ff,_[_0xc055('0x36')](this[_0xc055('0x14')][_0x5324ff[_0xc055('0x34')]])));if(_[_0xc055('0x59')](applications,_0x5324ff['application'])){this[_0xc055('0x14')][_0x5324ff[_0xc055('0x34')]]['lastapplication']=_0x5324ff[_0xc055('0x50')];this['channels'][_0x5324ff[_0xc055('0x34')]]['lastdata']=_0x5324ff['applicationdata'];if(_0x5324ff[_0xc055('0x50')]===_0xc055('0x8')&&_[_0xc055('0x54')](_0x5324ff[_0xc055('0x52')][_0xc055('0x51')](),_0xc055('0x5a'))){var _0x4faa20=_0x5324ff[_0xc055('0x52')][_0xc055('0x3a')]('=');var _0x3e0ed9=_0x4faa20[0x0][_0xc055('0x51')]()['match'](/cdr\((.*)\)/);if(_0x3e0ed9){if(_0x3e0ed9[0x1]===_0xc055('0x5b')&&!_[_0xc055('0x5c')](this[_0xc055('0x14')][_0x5324ff[_0xc055('0x34')]][_0x3e0ed9[0x1]]))return;this['channels'][_0x5324ff['uniqueid']][_0x3e0ed9[0x1]]=_0x4faa20[0x1];}}else if(_0x5324ff[_0xc055('0x50')]===_0xc055('0x9')){this['channels'][_0x5324ff['uniqueid']]['queue']=_0x5324ff['applicationdata'][_0xc055('0x3a')](',')[0x0];}}}}}catch(_0xd899b2){logger[_0xc055('0x42')]('[%s][voiceCallReport][newexten]',_0x5324ff['uniqueid'],util[_0xc055('0x2c')](_0xd899b2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc055('0x1e')]=function(_0x56f6c9){try{if(this[_0xc055('0x2e')](_0x56f6c9)){logger[_0xc055('0x2a')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x56f6c9['uniqueid'],_0x56f6c9['linkedid'],_0x56f6c9['calleridname'],_0x56f6c9[_0xc055('0x32')]);logger[_0xc055('0x33')](_0xc055('0x5d'),_0x56f6c9[_0xc055('0x34')],util[_0xc055('0x2c')](_0x56f6c9,{'showHidden':![],'depth':null}));if(_0x56f6c9[_0xc055('0x4a')]!=='6')return;if(_0x56f6c9[_0xc055('0x34')]!==_0x56f6c9['linkedid']){var _0x45a213=moment();if(this[_0xc055('0x14')][_0x56f6c9['linkedid']]){if(!this[_0xc055('0x14')][_0x56f6c9['linkedid']][_0xc055('0x5e')]){this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x35')]][_0xc055('0x5e')]=!![];this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x35')]][_0xc055('0x5f')]=_0x45a213[_0xc055('0x46')](_0xc055('0x47'));if(this['channels'][_0x56f6c9[_0xc055('0x35')]][_0xc055('0x45')]){this['channels'][_0x56f6c9['linkedid']][_0xc055('0x60')]=_0x45a213[_0xc055('0x61')](this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x35')]]['starttime'],_0xc055('0x58'));}}this['channels'][_0x56f6c9['linkedid']][_0xc055('0x35')]=_0x56f6c9['uniqueid'];if(_0x56f6c9[_0xc055('0x32')]!==_0xc055('0x3c')){this['channels'][_0x56f6c9[_0xc055('0x35')]][_0xc055('0x3e')]=_0x56f6c9['calleridnum'];}this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x35')]][_0xc055('0x62')]=_0x56f6c9[_0xc055('0x63')];this['channels'][_0x56f6c9[_0xc055('0x35')]][_0xc055('0x64')]=_0x56f6c9[_0xc055('0x39')];this['channels'][_0x56f6c9['linkedid']][_0xc055('0x48')]=dispositions[_[_0xc055('0x49')](_0x56f6c9['channelstate'])];if(this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]){this['channels'][_0x56f6c9[_0xc055('0x35')]][_0xc055('0x65')]=this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')]['split']('-')[0x0]]['id'];this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x35')]]['membername']=this[_0xc055('0x15')][_0x56f6c9['channel']['split']('-')[0x0]][_0xc055('0x40')];}}if(this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]]){if(!this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x5e')]){this['channels'][_0x56f6c9[_0xc055('0x34')]]['answered']=!![];this[_0xc055('0x14')][_0x56f6c9['uniqueid']][_0xc055('0x5f')]=_0x45a213[_0xc055('0x46')](_0xc055('0x47'));if(this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x45')]){this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x60')]=_0x45a213[_0xc055('0x61')](this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x45')],'seconds');}}if(_0x56f6c9[_0xc055('0x32')]!==_0xc055('0x3c')){this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]]['connectedlinenum']=_0x56f6c9['calleridnum'];}this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x62')]=_0x56f6c9[_0xc055('0x63')];this['channels'][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x64')]=_0x56f6c9['channel'];this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x48')]=dispositions[_[_0xc055('0x49')](_0x56f6c9['channelstate'])];}}else{if(this['channels'][_0x56f6c9[_0xc055('0x34')]]){if(this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')]['split']('-')[0x0]]){this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x65')]=this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]['id'];this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]]['membername']=this['agents'][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]['name'];}}}if(_0x56f6c9[_0xc055('0x37')]===_0xc055('0x38')){if(this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]){this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x3d')]=_0x56f6c9[_0xc055('0x3b')];var _0x437598,_0x588094;if(this[_0xc055('0x14')][_0x56f6c9['uniqueid']]){_0x437598=this[_0xc055('0x14')][_0x56f6c9['uniqueid']]['routealias'];_0x588094=this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x34')]][_0xc055('0x9')];}else if(this[_0xc055('0x14')][_0x56f6c9[_0xc055('0x35')]]){_0x437598=this[_0xc055('0x14')][_0x56f6c9['linkedid']][_0xc055('0x66')];_0x588094=this['channels'][_0x56f6c9[_0xc055('0x35')]]['queue'];}this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x9')]=_0x588094;this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x66')]=_0x437598;logger[_0xc055('0x33')](_0xc055('0x67'),_0x56f6c9[_0xc055('0x34')],util[_0xc055('0x2c')]({'id':this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')]['split']('-')[0x0]][_0xc055('0x4e')],'destconnectedlinenum':_0x56f6c9['exten'],'routealias':_0x437598,'queue':_0x588094||undefined},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xc055('0x3f'),this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x40')]),'user:agentconnect',{'id':this['agents'][_0x56f6c9[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xc055('0x15')][_0x56f6c9[_0xc055('0x39')]['split']('-')[0x0]][_0xc055('0x4e')],'destconnectedlinenum':_0x56f6c9[_0xc055('0x3b')],'routealias':_0x437598,'queue':_0x588094||undefined});}}}}catch(_0xfb1702){logger[_0xc055('0x42')]('[%s][voiceCallReport][newstate]',_0x56f6c9['uniqueid'],util['inspect'](_0xfb1702,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x14715a,_0xbd3da3){try{if(this[_0xc055('0x14')][_0x14715a]){logger[_0xc055('0x2a')](_0xc055('0x68'),_0x14715a,_0xbd3da3);this[_0xc055('0x14')][_0x14715a]['monitor']=!![];if(_[_0xc055('0x69')](_0xbd3da3,_0xc055('0x6a'))){_0xbd3da3=_0xbd3da3[_0xc055('0x6b')](_0xc055('0x6a'),_0xc055('0x6c'));}this[_0xc055('0x14')][_0x14715a][_0xc055('0x6d')]=_0xbd3da3;var _0x4bca6f=_[_0xc055('0x6e')](this[_0xc055('0x14')][_0x14715a][_0xc055('0x6f')],{'filename':_0xbd3da3});if(_[_0xc055('0x5c')](_0x4bca6f)){this[_0xc055('0x14')][_0x14715a]['monitors'][_0xc055('0x70')]({'filename':_0xbd3da3,'createdAt':moment()[_0xc055('0x46')](_0xc055('0x47')),'mixmonitorid':'','status':_0xc055('0x71')});}}}catch(_0xee053c){logger[_0xc055('0x42')]('[%s][voiceCallReport][mixMonitorFilename]',_0x14715a,util[_0xc055('0x2c')](_0xee053c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc055('0x1f')]=function(_0x11c284){try{if(this[_0xc055('0x2e')](_0x11c284)){logger[_0xc055('0x33')]('[%s][voiceCallReport][varset]\x20event:',_0x11c284[_0xc055('0x34')],util[_0xc055('0x2c')](_0x11c284,{'showHidden':![],'depth':null}));if(this['channels'][_0x11c284[_0xc055('0x34')]]&&_0x11c284['channel']!=_0xc055('0x43')){if(this[_0xc055('0x2e')](_0x11c284['variable'])){if(this[_0xc055('0x2e')](_0x11c284[_0xc055('0x72')][_0xc055('0x73')])){logger[_0xc055('0x2a')](_0xc055('0x74'),_0x11c284[_0xc055('0x34')],_0x11c284['value']);this[_0xc055('0x75')](_0x11c284['uniqueid'],_0x11c284[_0xc055('0x76')]);}else if(this['isNotNull'](_0x11c284[_0xc055('0x72')][_0xc055('0x77')])){logger[_0xc055('0x2a')](_0xc055('0x78'),_0x11c284['uniqueid'],_0x11c284[_0xc055('0x76')]);this[_0xc055('0x14')][_0x11c284[_0xc055('0x34')]][_0xc055('0x32')]=_0x11c284[_0xc055('0x76')];}else if(this[_0xc055('0x2e')](_0x11c284[_0xc055('0x72')][_0xc055('0x79')])){logger[_0xc055('0x2a')](_0xc055('0x7a'),_0x11c284[_0xc055('0x34')],_0x11c284[_0xc055('0x76')]);this[_0xc055('0x14')][_0x11c284[_0xc055('0x34')]]['callerid']=_0x11c284['value'];}else if(this[_0xc055('0x2e')](_0x11c284[_0xc055('0x72')][_0xc055('0x7b')])){logger['info'](_0xc055('0x7c'),_0x11c284[_0xc055('0x34')],_0x11c284[_0xc055('0x76')]);this[_0xc055('0x14')][_0x11c284['uniqueid']][_0xc055('0x5b')]=_0x11c284[_0xc055('0x76')];}else if(this[_0xc055('0x2e')](_0x11c284[_0xc055('0x72')][_0xc055('0x7d')])){logger[_0xc055('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x11c284['uniqueid'],_0x11c284['value'][_0xc055('0x3a')](',')[0x0]);this[_0xc055('0x14')][_0x11c284[_0xc055('0x34')]][_0xc055('0x9')]=_0x11c284[_0xc055('0x76')]['split'](',')[0x0];}else if(this['isNotNull'](_0x11c284[_0xc055('0x72')][_0xc055('0x7e')])){logger[_0xc055('0x2a')](_0xc055('0x7f'),_0x11c284['uniqueid'],_0x11c284['value']);this[_0xc055('0x14')][_0x11c284[_0xc055('0x34')]][_0xc055('0x80')]=_0x11c284[_0xc055('0x76')];}else if(this['isNotNull'](_0x11c284['variable'][_0xc055('0x81')])){logger[_0xc055('0x2a')](_0xc055('0x82'),_0x11c284[_0xc055('0x34')],_0x11c284[_0xc055('0x76')]);this[_0xc055('0x14')][_0x11c284['uniqueid']]['destination']=_0x11c284[_0xc055('0x76')];}else if(this[_0xc055('0x2e')](_0x11c284[_0xc055('0x72')]['xmd-callerid-preview'])){logger[_0xc055('0x2a')](_0xc055('0x83'),_0x11c284[_0xc055('0x34')],_0x11c284[_0xc055('0x76')]);this[_0xc055('0x14')][_0x11c284['uniqueid']][_0xc055('0x84')]=_0x11c284['value'];}else if(this[_0xc055('0x2e')](_0x11c284['variable'][_0xc055('0x85')])){logger['info'](_0xc055('0x86'),_0x11c284[_0xc055('0x34')],_0x11c284[_0xc055('0x76')]);this['channels'][_0x11c284[_0xc055('0x34')]]['queue']=_0x11c284[_0xc055('0x76')];}else if(this[_0xc055('0x2e')](_0x11c284[_0xc055('0x72')]['sipcallid'])){logger[_0xc055('0x2a')](_0xc055('0x87'),_0x11c284[_0xc055('0x34')],_0x11c284[_0xc055('0x76')]);this['channels'][_0x11c284[_0xc055('0x34')]][_0xc055('0x88')]=_0x11c284[_0xc055('0x76')];}}}else if(this[_0xc055('0x2e')](_0x11c284['variable']['mixmonitor_filename'])){if(_0x11c284[_0xc055('0x76')]){var _0x2f13b5=path[_0xc055('0x89')](_0x11c284[_0xc055('0x76')])[_0xc055('0x40')];logger[_0xc055('0x2a')](_0xc055('0x74'),_0x2f13b5,_0x11c284[_0xc055('0x76')]);this[_0xc055('0x75')](_0x2f13b5,_0x11c284['value']);}}else if(this[_0xc055('0x14')][_0x11c284['linkedid']]){if(this[_0xc055('0x2e')](_0x11c284[_0xc055('0x72')])){if(this['isNotNull'](_0x11c284[_0xc055('0x72')][_0xc055('0x8a')])){logger['info'](_0xc055('0x87'),_0x11c284[_0xc055('0x35')],_0x11c284[_0xc055('0x76')]);this[_0xc055('0x14')][_0x11c284[_0xc055('0x35')]][_0xc055('0x8b')]=_0x11c284[_0xc055('0x76')];}}}}}catch(_0x29592c){logger['error'](_0xc055('0x8c'),_0x11c284[_0xc055('0x34')],util[_0xc055('0x2c')](_0x29592c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc055('0x2d')]['syncHangup']=function(_0x114426){try{if(this[_0xc055('0x2e')](_0x114426)){logger[_0xc055('0x33')]('[%s][voiceCallReport][hangup]\x20event:',_0x114426[_0xc055('0x34')],util[_0xc055('0x2c')](_0x114426,{'showHidden':![],'depth':null}));if(this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]]){if(this[_0xc055('0x14')][this['blindTransfers'][_0x114426['linkedid']][_0xc055('0x35')]]){this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x35')]]['uniqueid']=_0x114426[_0xc055('0x34')];this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x35')]][_0xc055('0x5e')]=this[_0xc055('0x14')][_0x114426['uniqueid']][_0xc055('0x5e')];this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x35')]][_0xc055('0x5f')]=this[_0xc055('0x14')][_0x114426['uniqueid']][_0xc055('0x5f')];this[_0xc055('0x14')][this['blindTransfers'][_0x114426[_0xc055('0x35')]][_0xc055('0x35')]][_0xc055('0x64')]=this['channels'][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x35')]]['channel'];this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]]['linkedid']][_0xc055('0x48')]=this['channels'][_0x114426[_0xc055('0x34')]]['disposition'];this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]]=this[_0xc055('0x14')][this['blindTransfers'][_0x114426['linkedid']][_0xc055('0x35')]];delete this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x35')]];}else if(this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]]){this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]][_0xc055('0x34')]=[this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]]['uniqueid']][_0xc055('0x35')],this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]][_0xc055('0x35')]=this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]]['uniqueid']][_0xc055('0x34')]][0x0];this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426['linkedid']][_0xc055('0x34')]][_0xc055('0x5e')]=this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]][_0xc055('0x5e')];this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]][_0xc055('0x5f')]=this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]][_0xc055('0x5f')];this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]][_0xc055('0x64')]=this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]][_0xc055('0x39')];this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]]['disposition']=this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]][_0xc055('0x48')];this[_0xc055('0x14')][_0x114426['uniqueid']]=this[_0xc055('0x14')][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]];delete this['channels'][this[_0xc055('0x16')][_0x114426[_0xc055('0x35')]][_0xc055('0x34')]];}}if(this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]]){logger[_0xc055('0x2a')](_0xc055('0x8d'),_0x114426[_0xc055('0x34')],_0x114426[_0xc055('0x8e')]);var _0x1d4949=moment();this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]][_0xc055('0x8f')]=_0x1d4949[_0xc055('0x46')](_0xc055('0x47'));this['channels'][_0x114426[_0xc055('0x34')]][_0xc055('0x56')]=_0x1d4949['diff'](this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]]['starttime'],_0xc055('0x58'));if(this[_0xc055('0x14')][_0x114426['uniqueid']][_0xc055('0x5e')]){this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]][_0xc055('0x90')]=_0x1d4949[_0xc055('0x61')](this['channels'][_0x114426[_0xc055('0x34')]]['answertime'],_0xc055('0x58'));this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]][_0xc055('0x60')]=this[_0xc055('0x14')][_0x114426[_0xc055('0x34')]][_0xc055('0x56')]-this[_0xc055('0x14')][_0x114426['uniqueid']][_0xc055('0x90')];}if(_0x114426[_0xc055('0x37')]===_0xc055('0x38')){if(this['agents'][_0x114426[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]){this[_0xc055('0x15')][_0x114426[_0xc055('0x39')]['split']('-')[0x0]]=_[_0xc055('0x91')](this[_0xc055('0x15')][_0x114426[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]],['destconnectedlinenum']);logger[_0xc055('0x33')](_0xc055('0x92'),_0x114426[_0xc055('0x34')],util[_0xc055('0x2c')]({'id':this[_0xc055('0x15')][_0x114426['channel'][_0xc055('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xc055('0x15')][_0x114426['channel'][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x4e')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xc055('0x3f'),this[_0xc055('0x15')][_0x114426['channel']['split']('-')[0x0]]['name']),_0xc055('0x93'),{'id':this['agents'][_0x114426[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xc055('0x15')][_0x114426[_0xc055('0x39')][_0xc055('0x3a')]('-')[0x0]][_0xc055('0x4e')]});for(var _0x3e1b4d=0x0;_0x3e1b4d0x0?_0x2646c8:0x0;this[_0xba1e('0xf')][_0x1b4044[_0xba1e('0x6d')]][_0xba1e('0x2e')]=this['voiceQueues'][_0x1b4044['queue']][_0xba1e('0x2e')]>_[_0xba1e('0x71')](_0x1b4044[_0xba1e('0x73')])?_[_0xba1e('0x71')](_0x1b4044['loggedin']):this[_0xba1e('0xf')][_0x1b4044['queue']][_0xba1e('0x2e')];this[_0xba1e('0x52')](this[_0xba1e('0xf')][_0x1b4044['queue']],_0xba1e('0x13'));}logger[_0xba1e('0x44')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0xba1e('0xf')][_0x1b4044[_0xba1e('0x6d')]],{'showHidden':![],'depth':null}));ami[_0xba1e('0x42')](_0xba1e('0x74'),this[_0xba1e('0xf')][_0x1b4044[_0xba1e('0x6d')]]);}}}catch(_0x8026d){logger['error'](_0xba1e('0x6c'),util[_0xba1e('0x3b')](_0x8026d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xba1e('0x16')]=function(_0x1a09cb){logger[_0xba1e('0x44')](_0xba1e('0x75'),util[_0xba1e('0x3b')](_0x1a09cb,{'showHidden':![],'depth':null}));ami[_0xba1e('0x42')]('custom:queuesummarycomplete',{});this[_0xba1e('0x10')]=!![];};VoiceQueueReport[_0xba1e('0x32')][_0xba1e('0x18')]=function(_0x259ff5){try{if(this[_0xba1e('0x63')](_0x259ff5)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x259ff5['uniqueid'],util['inspect'](_0x259ff5,{'showHidden':![],'depth':null}));if(_[_0xba1e('0x64')](this[_0xba1e('0x3c')][_0x259ff5[_0xba1e('0x47')]]))this[_0xba1e('0x3c')][_0x259ff5[_0xba1e('0x47')]]=[];if(_[_0xba1e('0x64')](this[_0xba1e('0x33')][_0x259ff5[_0xba1e('0x47')]]))this['channels'][_0x259ff5[_0xba1e('0x47')]]={};var _0x34d8af=new QueueReport();_0x34d8af[_0xba1e('0x4a')]=_0x259ff5['queue'];_0x34d8af[_0xba1e('0x53')]=this[_0xba1e('0xf')][_0x34d8af[_0xba1e('0x4a')]]&&this[_0xba1e('0xf')][_0x34d8af[_0xba1e('0x4a')]][_0xba1e('0x53')]?this[_0xba1e('0xf')][_0x34d8af[_0xba1e('0x4a')]][_0xba1e('0x53')]||'inbound':'inbound';_0x34d8af[_0xba1e('0x6d')]=_0x259ff5[_0xba1e('0x6d')];_0x34d8af['queuecallerjoinAt']=moment()[_0xba1e('0x48')](_0xba1e('0x76'));_0x34d8af['position']=_0x259ff5['position'];_0x34d8af['count']=_0x259ff5[_0xba1e('0x77')];_0x34d8af[_0xba1e('0x47')]=_0x259ff5[_0xba1e('0x47')];_0x34d8af[_0xba1e('0x78')]=this[_0xba1e('0x33')][_0x259ff5[_0xba1e('0x47')]][_0xba1e('0x78')];logger[_0xba1e('0x6f')](_0xba1e('0x79'),_0x34d8af[_0xba1e('0x4a')],_0x34d8af['type']);_[_0xba1e('0x7a')](_0x34d8af,_[_0xba1e('0x7b')](_0x259ff5,_[_0xba1e('0x7c')](_0x34d8af)));this[_0xba1e('0x3c')][_0x259ff5[_0xba1e('0x47')]][_0xba1e('0x7d')](_0x34d8af);this['channels'][_0x259ff5[_0xba1e('0x47')]]=_0x34d8af;this[_0xba1e('0x43')](_0x34d8af,'queuecallerjoin');}}catch(_0x2153bb){logger[_0xba1e('0x3d')](_0xba1e('0x7e'),_0x259ff5[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x2153bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xba1e('0x19')]=function(_0x38fb59){try{if(this[_0xba1e('0x63')](_0x38fb59)){logger[_0xba1e('0x44')](_0xba1e('0x7f'),_0x38fb59[_0xba1e('0x47')],util['inspect'](_0x38fb59,{'showHidden':![],'depth':null}));if(this[_0xba1e('0x3c')][_0x38fb59[_0xba1e('0x47')]]){var _0x496658=_['last'](this['queueReports'][_0x38fb59[_0xba1e('0x47')]]);_0x496658[_0xba1e('0x80')]=![];_0x496658[_0xba1e('0x81')]=null;_0x496658[_0xba1e('0x82')]=_0x38fb59[_0xba1e('0x82')];_0x496658['originalposition']=_0x38fb59[_0xba1e('0x83')];_0x496658[_0xba1e('0x84')]=!![];_0x496658[_0xba1e('0x85')]=moment()[_0xba1e('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x496658['queuecallerexitreason']=_0xba1e('0x86');_0x496658[_0xba1e('0x87')]=null;logger[_0xba1e('0x6f')](_0xba1e('0x88'),_0x496658['name'],_0x496658[_0xba1e('0x53')]);this['channels'][_0x38fb59[_0xba1e('0x47')]]=_0x496658;this[_0xba1e('0x41')](_0x496658,_0xba1e('0x84'));}}}catch(_0x20ed7c){logger['error'](_0xba1e('0x7f'),_0x38fb59[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x20ed7c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xba1e('0x32')][_0xba1e('0x1b')]=function(_0x52a210){try{if(this[_0xba1e('0x63')](_0x52a210)){logger[_0xba1e('0x44')](_0xba1e('0x89'),_0x52a210[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x52a210,{'showHidden':![],'depth':null}));if(this[_0xba1e('0x3c')][_0x52a210['uniqueid']]){var _0x23da0e=_[_0xba1e('0x8a')](this['queueReports'][_0x52a210['uniqueid']]);_0x23da0e[_0xba1e('0x8b')]=moment()[_0xba1e('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x23da0e[_0xba1e('0x8c')]=_0x52a210[_0xba1e('0x8c')];_0x23da0e[_0xba1e('0x8d')]=_0x52a210['connectedlinename'];logger[_0xba1e('0x6f')](_0xba1e('0x8e'),_0x23da0e[_0xba1e('0x4a')],_0x23da0e['type'],_0x52a210[_0xba1e('0x8c')],_0x52a210[_0xba1e('0x8d')]);this['channels'][_0x52a210[_0xba1e('0x47')]]=_0x23da0e;this['emitVoiceQueueChannelSave'](_0x23da0e,_0xba1e('0x1a'));}}}catch(_0x32b915){logger[_0xba1e('0x3d')](_0xba1e('0x89'),_0x52a210['uniqueid'],util[_0xba1e('0x3b')](_0x32b915,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x4714c7){try{if(this[_0xba1e('0x63')](_0x4714c7)){logger[_0xba1e('0x44')](_0xba1e('0x8f'),_0x4714c7[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x4714c7,{'showHidden':![],'depth':null}));if(this[_0xba1e('0x3c')][_0x4714c7[_0xba1e('0x47')]]){var _0x1cce08=_['last'](this[_0xba1e('0x3c')][_0x4714c7[_0xba1e('0x47')]]);_0x1cce08[_0xba1e('0x80')]=!![];_0x1cce08[_0xba1e('0x4e')]='COMPLETEDBYAGENT';logger['info'](_0xba1e('0x90'),_0x1cce08[_0xba1e('0x4a')],_0x1cce08['type']);}}}catch(_0x4736f5){logger[_0xba1e('0x3d')](_0xba1e('0x8f'),_0x4714c7[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x4736f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x29fb78){try{if(this[_0xba1e('0x63')](_0x29fb78)){logger[_0xba1e('0x44')](_0xba1e('0x91'),_0x29fb78[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x29fb78,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x29fb78[_0xba1e('0x47')]]){var _0x4dbba6=_[_0xba1e('0x8a')](this[_0xba1e('0x3c')][_0x29fb78[_0xba1e('0x47')]]);_0x4dbba6[_0xba1e('0x84')]=![];_0x4dbba6[_0xba1e('0x85')]=null;_0x4dbba6[_0xba1e('0x92')]=!![];_0x4dbba6[_0xba1e('0x87')]=_0x29fb78[_0xba1e('0x93')];_0x4dbba6[_0xba1e('0x82')]=_0x29fb78[_0xba1e('0x82')];_0x4dbba6[_0xba1e('0x80')]=!![];_0x4dbba6[_0xba1e('0x94')]=![];_0x4dbba6[_0xba1e('0x95')]=null;if(!_0x4dbba6[_0xba1e('0x96')]){if(_0x29fb78[_0xba1e('0x97')]==_0xba1e('0x96')){_0x4dbba6['queuecallerexitreason']=_0xba1e('0x98');logger[_0xba1e('0x6f')](_0xba1e('0x99'),_0x4dbba6['name'],_0x4dbba6[_0xba1e('0x53')]);}else{if(_[_0xba1e('0x9a')](_0x29fb78[_0xba1e('0x38')]['toLowerCase'](),_0xba1e('0x9b'))){if(this[_0xba1e('0x3c')][_0x29fb78['linkedid']]){var _0x2ca7eb=_['last'](this[_0xba1e('0x3c')][_0x29fb78[_0xba1e('0x9c')]]);_0x2ca7eb[_0xba1e('0x80')]=![];_0x2ca7eb[_0xba1e('0x94')]=!![];_0x2ca7eb['queuecallerexitAt']=moment(_0x4dbba6[_0xba1e('0x9d')])[_0xba1e('0x9e')](_0x29fb78[_0xba1e('0x82')],'seconds')['format'](_0xba1e('0x76'));_0x2ca7eb['queuecallerexitreason']='FORWARDTRANSFER';_0x2ca7eb['transfer']=!![];_0x2ca7eb['transfertype']='FORWARD';_0x2ca7eb[_0xba1e('0x9f')]=_0x29fb78['destexten'];_0x2ca7eb['transferuniqueid']=_0x29fb78['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x2ca7eb['name'],_0x2ca7eb[_0xba1e('0x53')]);var _0x2a3fbb=this['queueReports'][_0x29fb78[_0xba1e('0x9c')]];this[_0xba1e('0x3c')][_0x29fb78['linkedid']]=this[_0xba1e('0x3c')][_0x29fb78[_0xba1e('0x47')]];this[_0xba1e('0x3c')][_0x29fb78[_0xba1e('0x47')]]=_0x2a3fbb;}}else{_0x4dbba6[_0xba1e('0x4e')]=_0xba1e('0xa0')+_0x29fb78[_0xba1e('0x97')]['toUpperCase']();logger[_0xba1e('0x6f')](_0xba1e('0xa1'),_0x4dbba6['name'],_0x4dbba6['type'],_0x4dbba6['queuecallerexitreason']);}}}this['channels'][_0x29fb78[_0xba1e('0x47')]]=_0x4dbba6;this[_0xba1e('0x41')](_0x4dbba6,'agentcomplete');}}}catch(_0x4158d8){logger[_0xba1e('0x3d')](_0xba1e('0x91'),_0x29fb78[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x4158d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xba1e('0x32')]['syncVarSet']=function(_0x572b56){try{if(this[_0xba1e('0x63')](_0x572b56)){logger[_0xba1e('0x44')]('[%s][voiceQueueReport][varset]',_0x572b56[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x572b56,{'showHidden':![],'depth':null}));this[_0xba1e('0xa2')](_0x572b56[_0xba1e('0x47')],_['keys'](_0x572b56[_0xba1e('0xa3')])[0x0],_0x572b56[_0xba1e('0xa4')]);if(this[_0xba1e('0x3c')][_0x572b56[_0xba1e('0x47')]]){var _0x2bc05b=_['last'](this['queueReports'][_0x572b56['uniqueid']]);if(_0x2bc05b){if(this['isNotNull'](_0x572b56[_0xba1e('0xa3')])&&this['isNotNull'](_0x572b56[_0xba1e('0xa3')][_0xba1e('0xa5')])){switch(_0x572b56['value']){case'CONTINUE':_0x2bc05b['queuecallerexit']=![];_0x2bc05b[_0xba1e('0x95')]=null;break;case'TIMEOUT':_0x2bc05b[_0xba1e('0xa6')]=_0xba1e('0xa7');_0x2bc05b['queuecallerexit']=!![];_0x2bc05b['queuecallerexitAt']=moment()[_0xba1e('0x48')](_0xba1e('0x76'));_0x2bc05b['queuecallerleaveAt']=moment()[_0xba1e('0x48')](_0xba1e('0x76'));logger[_0xba1e('0x44')](_0xba1e('0xa8'),_0x572b56[_0xba1e('0x47')],util['inspect'](_0x2bc05b,{'showHidden':![],'depth':null}));ami['emit'](_0xba1e('0xa9'),_0x2bc05b);break;default:_0x2bc05b[_0xba1e('0x94')]=!![];_0x2bc05b['queuecallerexitAt']=moment()[_0xba1e('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x2bc05b[_0xba1e('0x8b')]=moment()[_0xba1e('0x48')](_0xba1e('0x76'));}_0x2bc05b[_0xba1e('0x84')]=![];_0x2bc05b[_0xba1e('0x85')]=null;_0x2bc05b[_0xba1e('0x4e')]=_0x572b56[_0xba1e('0xa4')];this['channels'][_0x572b56[_0xba1e('0x47')]]=_0x2bc05b;this[_0xba1e('0x41')](_0x2bc05b,_0xba1e('0x20'));}else if(this[_0xba1e('0x63')](_0x572b56[_0xba1e('0xa3')])&&this['isNotNull'](_0x572b56[_0xba1e('0xa3')]['queueposition'])){if(!_0x2bc05b[_0xba1e('0x84')]){_0x2bc05b['queuecallerexit']=!![];_0x2bc05b['queuecallerexitAt']=moment()[_0xba1e('0x48')](_0xba1e('0x76'));_0x2bc05b[_0xba1e('0x4e')]='EXITWITHKEY';_0x2bc05b[_0xba1e('0x8b')]=moment()[_0xba1e('0x48')](_0xba1e('0x76'));this[_0xba1e('0x33')][_0x572b56[_0xba1e('0x47')]]=_0x2bc05b;}}logger[_0xba1e('0x6f')](_0xba1e('0xaa'),_0x572b56[_0xba1e('0x47')],_0x2bc05b[_0xba1e('0x4a')],_0x2bc05b[_0xba1e('0x53')],_[_0xba1e('0x7c')](_0x572b56[_0xba1e('0xa3')])[0x0],_0x572b56[_0xba1e('0xa4')]);_0x2bc05b[_0xba1e('0x12')]=this['variables'][_0x572b56[_0xba1e('0x47')]];}}}}catch(_0x3923c2){logger['error'](_0xba1e('0xab'),_0x572b56[_0xba1e('0x47')],util[_0xba1e('0x3b')](_0x3923c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xba1e('0xa2')]=function(_0x4ad96b,_0x436152,_0x42ff31){var _0x2d7252=[_0xba1e('0xac'),_0xba1e('0xad'),'rtpaudioqosjitter',_0xba1e('0xae'),_0xba1e('0xaf'),_0xba1e('0xb0'),'rtpaudioqosrtt',_0xba1e('0xb1'),'sipcallid',_0xba1e('0xb2'),'bridgepeer',_0xba1e('0xb3'),_0xba1e('0xb4'),_0xba1e('0xb5'),_0xba1e('0xb6'),'memberlastcall','membername',_0xba1e('0xb7'),_0xba1e('0xb8')];if(!_['isNil'](_0x436152)&&!_[_0xba1e('0xb9')](_0x2d7252,_0x436152)){if(_[_0xba1e('0x64')](this[_0xba1e('0x12')][_0x4ad96b])){this[_0xba1e('0x12')][_0x4ad96b]={};}this[_0xba1e('0x12')][_0x4ad96b][_0x436152]=_0x42ff31;}};VoiceQueueReport[_0xba1e('0x32')]['handleHangup']=function(_0x4510fc,_0x397fc4,_0x212077){var _0x42e8a6={};for(var _0x5f82ce=0x0;_0x5f82ce0x0?_0x4f9da8:0x0;this[_0x6c8d('0x11')][_0x33423c['queue']][_0x6c8d('0x71')]=this['voiceQueues'][_0x33423c[_0x6c8d('0x6c')]][_0x6c8d('0x71')]>_[_0x6c8d('0x6f')](_0x33423c[_0x6c8d('0x70')])?_[_0x6c8d('0x6f')](_0x33423c[_0x6c8d('0x70')]):this[_0x6c8d('0x11')][_0x33423c[_0x6c8d('0x6c')]][_0x6c8d('0x71')];this[_0x6c8d('0x53')](this[_0x6c8d('0x11')][_0x33423c['queue']],_0x6c8d('0x15'));}logger[_0x6c8d('0x4e')](_0x6c8d('0x72'),util[_0x6c8d('0x3f')](this['voiceQueues'][_0x33423c['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x6c8d('0x73'),this[_0x6c8d('0x11')][_0x33423c[_0x6c8d('0x6c')]]);}}}catch(_0x2b78bb){logger[_0x6c8d('0x3d')]('[voiceQueueReport][queuesummary]',util[_0x6c8d('0x3f')](_0x2b78bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6c8d('0xa')][_0x6c8d('0x18')]=function(_0x325aa8){logger[_0x6c8d('0x4e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x6c8d('0x3f')](_0x325aa8,{'showHidden':![],'depth':null}));ami[_0x6c8d('0x45')](_0x6c8d('0x74'),{});this[_0x6c8d('0x12')]=!![];};VoiceQueueReport[_0x6c8d('0xa')][_0x6c8d('0x1b')]=function(_0x42bd45){try{if(this[_0x6c8d('0x66')](_0x42bd45)){logger[_0x6c8d('0x4e')](_0x6c8d('0x75'),_0x42bd45['uniqueid'],util[_0x6c8d('0x3f')](_0x42bd45,{'showHidden':![],'depth':null}));if(_[_0x6c8d('0x67')](this[_0x6c8d('0xe')][_0x42bd45[_0x6c8d('0x49')]]))this[_0x6c8d('0xe')][_0x42bd45[_0x6c8d('0x49')]]=[];if(_[_0x6c8d('0x67')](this[_0x6c8d('0x10')][_0x42bd45[_0x6c8d('0x49')]]))this[_0x6c8d('0x10')][_0x42bd45[_0x6c8d('0x49')]]={};var _0x50d373=new QueueReport();_0x50d373['name']=_0x42bd45[_0x6c8d('0x6c')];_0x50d373[_0x6c8d('0x54')]=this[_0x6c8d('0x11')][_0x50d373[_0x6c8d('0x50')]]&&this[_0x6c8d('0x11')][_0x50d373[_0x6c8d('0x50')]]['type']?this[_0x6c8d('0x11')][_0x50d373[_0x6c8d('0x50')]][_0x6c8d('0x54')]||_0x6c8d('0x76'):_0x6c8d('0x76');_0x50d373[_0x6c8d('0x6c')]=_0x42bd45[_0x6c8d('0x6c')];_0x50d373[_0x6c8d('0x77')]=moment()[_0x6c8d('0x4a')](_0x6c8d('0x78'));_0x50d373[_0x6c8d('0x79')]=_0x42bd45[_0x6c8d('0x79')];_0x50d373['count']=_0x42bd45[_0x6c8d('0x7a')];_0x50d373[_0x6c8d('0x49')]=_0x42bd45[_0x6c8d('0x49')];_0x50d373[_0x6c8d('0x7b')]=this['channels'][_0x42bd45['uniqueid']]['routealias'];logger[_0x6c8d('0x6d')](_0x6c8d('0x7c'),_0x50d373[_0x6c8d('0x50')],_0x50d373[_0x6c8d('0x54')]);_[_0x6c8d('0x7d')](_0x50d373,_[_0x6c8d('0x7e')](_0x42bd45,_['keys'](_0x50d373)));this[_0x6c8d('0xe')][_0x42bd45[_0x6c8d('0x49')]][_0x6c8d('0x7f')](_0x50d373);this[_0x6c8d('0x10')][_0x42bd45[_0x6c8d('0x49')]]=_0x50d373;this['emitVoiceQueueChannelSave'](_0x50d373,_0x6c8d('0x1a'));}}catch(_0x59a39){logger[_0x6c8d('0x3d')](_0x6c8d('0x75'),_0x42bd45[_0x6c8d('0x49')],util[_0x6c8d('0x3f')](_0x59a39,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6c8d('0xa')][_0x6c8d('0x1d')]=function(_0x51ca42){try{if(this[_0x6c8d('0x66')](_0x51ca42)){logger[_0x6c8d('0x4e')](_0x6c8d('0x80'),_0x51ca42[_0x6c8d('0x49')],util[_0x6c8d('0x3f')](_0x51ca42,{'showHidden':![],'depth':null}));if(this[_0x6c8d('0xe')][_0x51ca42['uniqueid']]){var _0x33e849=_['last'](this[_0x6c8d('0xe')][_0x51ca42[_0x6c8d('0x49')]]);_0x33e849['queuecallercomplete']=![];_0x33e849[_0x6c8d('0x81')]=null;_0x33e849[_0x6c8d('0x82')]=_0x51ca42[_0x6c8d('0x82')];_0x33e849[_0x6c8d('0x83')]=_0x51ca42[_0x6c8d('0x83')];_0x33e849[_0x6c8d('0x1c')]=!![];_0x33e849[_0x6c8d('0x84')]=moment()[_0x6c8d('0x4a')](_0x6c8d('0x78'));_0x33e849['queuecallerexitreason']=_0x6c8d('0x85');_0x33e849[_0x6c8d('0x86')]=null;logger[_0x6c8d('0x6d')](_0x6c8d('0x87'),_0x33e849[_0x6c8d('0x50')],_0x33e849['type']);this[_0x6c8d('0x10')][_0x51ca42[_0x6c8d('0x49')]]=_0x33e849;this[_0x6c8d('0x4d')](_0x33e849,_0x6c8d('0x1c'));}}}catch(_0x3af453){logger[_0x6c8d('0x3d')]('[%s][voiceQueueReport][queuecallerabandon]',_0x51ca42['uniqueid'],util[_0x6c8d('0x3f')](_0x3af453,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6c8d('0xa')][_0x6c8d('0x1f')]=function(_0x7a17b0){try{if(this[_0x6c8d('0x66')](_0x7a17b0)){logger[_0x6c8d('0x4e')](_0x6c8d('0x88'),_0x7a17b0[_0x6c8d('0x49')],util['inspect'](_0x7a17b0,{'showHidden':![],'depth':null}));if(this[_0x6c8d('0xe')][_0x7a17b0[_0x6c8d('0x49')]]){var _0x13fa5d=_[_0x6c8d('0x89')](this[_0x6c8d('0xe')][_0x7a17b0[_0x6c8d('0x49')]]);_0x13fa5d['queuecallerleaveAt']=moment()['format'](_0x6c8d('0x78'));_0x13fa5d[_0x6c8d('0x8a')]=_0x7a17b0[_0x6c8d('0x8a')];_0x13fa5d[_0x6c8d('0x8b')]=_0x7a17b0[_0x6c8d('0x8b')];logger['info'](_0x6c8d('0x8c'),_0x13fa5d[_0x6c8d('0x50')],_0x13fa5d[_0x6c8d('0x54')],_0x7a17b0[_0x6c8d('0x8a')],_0x7a17b0[_0x6c8d('0x8b')]);this['channels'][_0x7a17b0[_0x6c8d('0x49')]]=_0x13fa5d;this[_0x6c8d('0x46')](_0x13fa5d,_0x6c8d('0x1e'));}}}catch(_0x28a895){logger[_0x6c8d('0x3d')](_0x6c8d('0x88'),_0x7a17b0[_0x6c8d('0x49')],util['inspect'](_0x28a895,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6c8d('0xa')][_0x6c8d('0x8d')]=function(_0x599ba0){try{if(this['isNotNull'](_0x599ba0)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x599ba0[_0x6c8d('0x49')],util[_0x6c8d('0x3f')](_0x599ba0,{'showHidden':![],'depth':null}));if(this[_0x6c8d('0xe')][_0x599ba0[_0x6c8d('0x49')]]){var _0x1d2d80=_['last'](this[_0x6c8d('0xe')][_0x599ba0[_0x6c8d('0x49')]]);_0x1d2d80[_0x6c8d('0x8e')]=!![];_0x1d2d80[_0x6c8d('0x8f')]='COMPLETEDBYAGENT';logger[_0x6c8d('0x6d')](_0x6c8d('0x90'),_0x1d2d80[_0x6c8d('0x50')],_0x1d2d80['type']);}}}catch(_0x386d6b){logger['error'](_0x6c8d('0x91'),_0x599ba0[_0x6c8d('0x49')],util[_0x6c8d('0x3f')](_0x386d6b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6c8d('0x92')]=function(_0x29c6df){try{if(this[_0x6c8d('0x66')](_0x29c6df)){logger[_0x6c8d('0x4e')](_0x6c8d('0x93'),_0x29c6df[_0x6c8d('0x49')],util[_0x6c8d('0x3f')](_0x29c6df,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x29c6df[_0x6c8d('0x49')]]){var _0x2534b8=_[_0x6c8d('0x89')](this['queueReports'][_0x29c6df[_0x6c8d('0x49')]]);_0x2534b8[_0x6c8d('0x1c')]=![];_0x2534b8[_0x6c8d('0x84')]=null;_0x2534b8[_0x6c8d('0x94')]=!![];_0x2534b8[_0x6c8d('0x86')]=_0x29c6df['membername'];_0x2534b8[_0x6c8d('0x82')]=_0x29c6df[_0x6c8d('0x82')];_0x2534b8[_0x6c8d('0x8e')]=!![];_0x2534b8[_0x6c8d('0x95')]=![];_0x2534b8[_0x6c8d('0x96')]=null;if(!_0x2534b8[_0x6c8d('0x97')]){if(_0x29c6df[_0x6c8d('0x98')]==_0x6c8d('0x97')){_0x2534b8[_0x6c8d('0x8f')]='COMPLETED';logger[_0x6c8d('0x6d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2534b8[_0x6c8d('0x50')],_0x2534b8[_0x6c8d('0x54')]);}else{if(_['startsWith'](_0x29c6df[_0x6c8d('0x99')][_0x6c8d('0x9a')](),_0x6c8d('0x9b'))){if(this[_0x6c8d('0xe')][_0x29c6df[_0x6c8d('0x9c')]]){var _0x2717a0=_['last'](this[_0x6c8d('0xe')][_0x29c6df[_0x6c8d('0x9c')]]);_0x2717a0['queuecallercomplete']=![];_0x2717a0[_0x6c8d('0x95')]=!![];_0x2717a0[_0x6c8d('0x96')]=moment(_0x2534b8[_0x6c8d('0x77')])['add'](_0x29c6df[_0x6c8d('0x82')],_0x6c8d('0x9d'))[_0x6c8d('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2717a0[_0x6c8d('0x8f')]='FORWARDTRANSFER';_0x2717a0[_0x6c8d('0x97')]=!![];_0x2717a0[_0x6c8d('0x9e')]=_0x6c8d('0x9f');_0x2717a0[_0x6c8d('0xa0')]=_0x29c6df[_0x6c8d('0xa1')];_0x2717a0[_0x6c8d('0xa2')]=_0x29c6df[_0x6c8d('0x49')];logger[_0x6c8d('0x6d')](_0x6c8d('0xa3'),_0x2717a0[_0x6c8d('0x50')],_0x2717a0[_0x6c8d('0x54')]);var _0x17108b=this[_0x6c8d('0xe')][_0x29c6df[_0x6c8d('0x9c')]];this[_0x6c8d('0xe')][_0x29c6df[_0x6c8d('0x9c')]]=this[_0x6c8d('0xe')][_0x29c6df[_0x6c8d('0x49')]];this[_0x6c8d('0xe')][_0x29c6df[_0x6c8d('0x49')]]=_0x17108b;}}else{_0x2534b8[_0x6c8d('0x8f')]=_0x6c8d('0xa4')+_0x29c6df[_0x6c8d('0x98')][_0x6c8d('0xa5')]();logger[_0x6c8d('0x6d')](_0x6c8d('0xa6'),_0x2534b8['name'],_0x2534b8[_0x6c8d('0x54')],_0x2534b8['queuecallerexitreason']);}}}this[_0x6c8d('0x10')][_0x29c6df['uniqueid']]=_0x2534b8;this[_0x6c8d('0x4d')](_0x2534b8,_0x6c8d('0x20'));}}}catch(_0xb598ea){logger[_0x6c8d('0x3d')](_0x6c8d('0x93'),_0x29c6df['uniqueid'],util['inspect'](_0xb598ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6c8d('0xa')][_0x6c8d('0x21')]=function(_0x22bf1c){try{if(this['isNotNull'](_0x22bf1c)){logger[_0x6c8d('0x4e')](_0x6c8d('0xa7'),_0x22bf1c[_0x6c8d('0x49')],util['inspect'](_0x22bf1c,{'showHidden':![],'depth':null}));this[_0x6c8d('0xa8')](_0x22bf1c[_0x6c8d('0x49')],_[_0x6c8d('0xa9')](_0x22bf1c['variable'])[0x0],_0x22bf1c['value']);if(this[_0x6c8d('0xe')][_0x22bf1c[_0x6c8d('0x49')]]){var _0x521ae5=_['last'](this['queueReports'][_0x22bf1c['uniqueid']]);if(_0x521ae5){if(this[_0x6c8d('0x66')](_0x22bf1c['variable'])&&this[_0x6c8d('0x66')](_0x22bf1c['variable']['queuestatus'])){switch(_0x22bf1c[_0x6c8d('0xaa')]){case _0x6c8d('0xab'):_0x521ae5[_0x6c8d('0x95')]=![];_0x521ae5[_0x6c8d('0x96')]=null;break;case _0x6c8d('0xac'):_0x521ae5['lastevent']=_0x6c8d('0xad');_0x521ae5['queuecallerexit']=!![];_0x521ae5['queuecallerexitAt']=moment()['format'](_0x6c8d('0x78'));_0x521ae5[_0x6c8d('0xae')]=moment()[_0x6c8d('0x4a')](_0x6c8d('0x78'));logger['debug'](_0x6c8d('0xaf'),_0x22bf1c[_0x6c8d('0x49')],util[_0x6c8d('0x3f')](_0x521ae5,{'showHidden':![],'depth':null}));ami[_0x6c8d('0x45')](_0x6c8d('0xb0'),_0x521ae5);break;default:_0x521ae5[_0x6c8d('0x95')]=!![];_0x521ae5[_0x6c8d('0x96')]=moment()[_0x6c8d('0x4a')](_0x6c8d('0x78'));_0x521ae5['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x521ae5[_0x6c8d('0x1c')]=![];_0x521ae5[_0x6c8d('0x84')]=null;_0x521ae5[_0x6c8d('0x8f')]=_0x22bf1c[_0x6c8d('0xaa')];this[_0x6c8d('0x10')][_0x22bf1c[_0x6c8d('0x49')]]=_0x521ae5;this['emitVoiceQueueChannelRemove'](_0x521ae5,'varset');}else if(this[_0x6c8d('0x66')](_0x22bf1c['variable'])&&this[_0x6c8d('0x66')](_0x22bf1c['variable'][_0x6c8d('0xb1')])){if(!_0x521ae5[_0x6c8d('0x1c')]){_0x521ae5['queuecallerexit']=!![];_0x521ae5[_0x6c8d('0x96')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x521ae5[_0x6c8d('0x8f')]=_0x6c8d('0xb2');_0x521ae5[_0x6c8d('0xae')]=moment()[_0x6c8d('0x4a')](_0x6c8d('0x78'));this[_0x6c8d('0x10')][_0x22bf1c[_0x6c8d('0x49')]]=_0x521ae5;}}logger[_0x6c8d('0x6d')](_0x6c8d('0xb3'),_0x22bf1c['uniqueid'],_0x521ae5['name'],_0x521ae5['type'],_['keys'](_0x22bf1c['variable'])[0x0],_0x22bf1c[_0x6c8d('0xaa')]);_0x521ae5[_0x6c8d('0x14')]=this[_0x6c8d('0x14')][_0x22bf1c[_0x6c8d('0x49')]];}}}}catch(_0x5d5013){logger[_0x6c8d('0x3d')](_0x6c8d('0xa7'),_0x22bf1c[_0x6c8d('0x49')],util[_0x6c8d('0x3f')](_0x5d5013,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6c8d('0xa8')]=function(_0xed9e64,_0x29c2c9,_0x33475d){var _0x5c1405=[_0x6c8d('0xb4'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x6c8d('0xb5'),_0x6c8d('0xb6'),_0x6c8d('0xb7'),_0x6c8d('0xb8'),_0x6c8d('0xb9'),'sipcallid',_0x6c8d('0xba'),_0x6c8d('0xbb'),_0x6c8d('0xbc'),_0x6c8d('0xbd'),_0x6c8d('0xbe'),_0x6c8d('0xbf'),_0x6c8d('0xc0'),_0x6c8d('0xc1'),_0x6c8d('0xc2'),_0x6c8d('0xc3')];if(!_['isNil'](_0x29c2c9)&&!_[_0x6c8d('0xc4')](_0x5c1405,_0x29c2c9)){if(_[_0x6c8d('0x67')](this[_0x6c8d('0x14')][_0xed9e64])){this[_0x6c8d('0x14')][_0xed9e64]={};}this[_0x6c8d('0x14')][_0xed9e64][_0x29c2c9]=_0x33475d;}};VoiceQueueReport[_0x6c8d('0xa')][_0x6c8d('0xc5')]=function(_0xb94a15,_0xd2b441,_0x5c664e){var _0x1937fe={};for(var _0x5bdd97=0x0;_0x5bdd97=0x0?moment(_0x1dd625[_0x6b97('0x17')])[_0x6b97('0xd')](_0x1dd625[_0x6b97('0x16')],_0x6b97('0x18')):null,'data1':'outbound','data2':_0x1dd625[_0x6b97('0x13')],'data3':_0x1dd625['exten'],'data4':_0x1dd625[_0x6b97('0x19')]||null,'role':'agent','internal':_0x1dd625[_0x6b97('0x13')]?_['toNumber'](_0x1dd625[_0x6b97('0x13')]):undefined,'uniqueid':_0x1dd625[_0x6b97('0x1a')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x03c9=['format','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','accountcode','toNumber','uniqueid','voiceDialReport','Request','voice','starttime','endtime','diff','outbound','exten','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo','isNil','interface'];(function(_0x1f0e71,_0x2d0157){var _0x27522d=function(_0x346b45){while(--_0x346b45){_0x1f0e71['push'](_0x1f0e71['shift']());}};_0x27522d(++_0x2d0157);}(_0x03c9,0x82));var _0x903c=function(_0x41426e,_0x919bf4){_0x41426e=_0x41426e-0x0;var _0x15cfe1=_0x03c9[_0x41426e];return _0x15cfe1;};'use strict';var moment=require(_0x903c('0x0'));var _=require('lodash');var util=require(_0x903c('0x1'));var client=require(_0x903c('0x2'));exports[_0x903c('0x3')]=function(_0x485af4){var _0x2f64a9=_0x485af4[_0x903c('0x4')]||_0x485af4[_0x903c('0x5')];return client['Request'](_0x903c('0x6'),{'body':{'channel':'voice','membername':_0x485af4[_0x903c('0x7')],'interface':_[_0x903c('0x8')](_0x485af4[_0x903c('0x9')])?util[_0x903c('0xa')](_0x903c('0xb'),_0x485af4['lastAssignedTo']):_0x485af4[_0x903c('0x9')],'type':_0x903c('0xc'),'enterAt':_0x485af4[_0x903c('0xd')],'exitAt':_0x2f64a9,'duration':moment(_0x2f64a9)['diff'](_0x485af4[_0x903c('0xd')],_0x903c('0xe')),'data1':_0x903c('0xf'),'data2':_0x485af4[_0x903c('0x10')],'data3':_0x485af4['exten'],'data4':null,'data5':_0x485af4['queue'],'role':'agent','internal':_0x485af4[_0x903c('0x11')]?_[_0x903c('0x12')](_0x485af4[_0x903c('0x11')]):undefined,'uniqueid':_0x485af4[_0x903c('0x13')]},'log':_0x903c('0x6')});};exports[_0x903c('0x14')]=function(_0x20f6f6){return client[_0x903c('0x15')]('CreateMemberReport',{'body':{'channel':_0x903c('0x16'),'membername':_0x20f6f6['membername'],'interface':_0x20f6f6['interface'],'type':_0x903c('0xc'),'enterAt':_0x20f6f6[_0x903c('0x17')],'exitAt':_0x20f6f6[_0x903c('0x18')],'duration':moment(_0x20f6f6[_0x903c('0x18')])['diff'](_0x20f6f6[_0x903c('0x17')],_0x903c('0xe'))>=0x0?moment(_0x20f6f6[_0x903c('0x18')])[_0x903c('0x19')](_0x20f6f6[_0x903c('0x17')],_0x903c('0xe')):null,'data1':_0x903c('0x1a'),'data2':_0x20f6f6[_0x903c('0x11')],'data3':_0x20f6f6[_0x903c('0x1b')],'data4':_0x20f6f6['dialstring']||null,'role':'agent','internal':_0x20f6f6['accountcode']?_[_0x903c('0x12')](_0x20f6f6[_0x903c('0x11')]):undefined,'uniqueid':_0x20f6f6[_0x903c('0x13')]},'log':_0x903c('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c4dd5f3..089a387 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 _0x590a=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x1e8f35,_0x3db390){var _0x446c13=function(_0xa1e11e){while(--_0xa1e11e){_0x1e8f35['push'](_0x1e8f35['shift']());}};_0x446c13(++_0x3db390);}(_0x590a,0x159));var _0xa590=function(_0x10b481,_0x45ed2b){_0x10b481=_0x10b481-0x0;var _0x507727=_0x590a[_0x10b481];return _0x507727;};'use strict';var client=require('../client');exports[_0xa590('0x0')]=function(){return client[_0xa590('0x1')](_0xa590('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa590('0x3'),_0xa590('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x4201=['getSettings','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x322f5b,_0x58ec15){var _0x41532f=function(_0x4c7999){while(--_0x4c7999){_0x322f5b['push'](_0x322f5b['shift']());}};_0x41532f(++_0x58ec15);}(_0x4201,0x71));var _0x1420=function(_0x15a8e1,_0x21e63d){_0x15a8e1=_0x15a8e1-0x0;var _0x185130=_0x4201[_0x15a8e1];return _0x185130;};'use strict';var client=require(_0x1420('0x0'));exports[_0x1420('0x1')]=function(){return client['Request'](_0x1420('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1420('0x3'),_0x1420('0x4')]},'log':_0x1420('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index babb422..37441ad 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 _0x693a=['getTemplates','Request','GetTemplate','name','../client'];(function(_0x9f7b85,_0x5067c4){var _0x5873bd=function(_0x4b4073){while(--_0x4b4073){_0x9f7b85['push'](_0x9f7b85['shift']());}};_0x5873bd(++_0x5067c4);}(_0x693a,0x1ee));var _0xa693=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x693a[_0x4cc492];return _0x1f36b9;};'use strict';var client=require(_0xa693('0x0'));exports[_0xa693('0x1')]=function(_0x583e59){return function(_0x269145){return client[_0xa693('0x2')](_0xa693('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa693('0x4'),'html']},'log':_0xa693('0x3')});};}; \ No newline at end of file +var _0xbb5f=['name','html','Request','GetTemplate'];(function(_0x15be5c,_0x1eacee){var _0x1a36a8=function(_0x1ef6a0){while(--_0x1ef6a0){_0x15be5c['push'](_0x15be5c['shift']());}};_0x1a36a8(++_0x1eacee);}(_0xbb5f,0x16a));var _0xfbb5=function(_0x46eb67,_0x539066){_0x46eb67=_0x46eb67-0x0;var _0x10b133=_0xbb5f[_0x46eb67];return _0x10b133;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x30285d){return function(_0x4b0f04){return client[_0xfbb5('0x0')](_0xfbb5('0x1'),{'options':{'raw':!![],'attributes':['id',_0xfbb5('0x2'),_0xfbb5('0x3')]},'log':_0xfbb5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 15ad02f..a84568f 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 _0xe361=['data4','../client','getTriggers','Request','name','channel','status','Condition','AllConditions','operator','value','field','Action','Actions','action','data1','data2','data3'];(function(_0xd6c010,_0x5355e6){var _0x15893b=function(_0x1b0a5a){while(--_0x1b0a5a){_0xd6c010['push'](_0xd6c010['shift']());}};_0x15893b(++_0x5355e6);}(_0xe361,0x91));var _0x1e36=function(_0x260859,_0x3cfcff){_0x260859=_0x260859-0x0;var _0x4b77f8=_0xe361[_0x260859];return _0x4b77f8;};'use strict';var client=require(_0x1e36('0x0'));exports[_0x1e36('0x1')]=function(_0x423cfe){return function(_0x101d4a){return client[_0x1e36('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x1e36('0x3'),_0x1e36('0x4'),_0x1e36('0x5')],'include':[{'model':_0x1e36('0x6'),'as':_0x1e36('0x7'),'attributes':['id','field',_0x1e36('0x8'),_0x1e36('0x9')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x1e36('0xa'),'operator',_0x1e36('0x9')]},{'model':_0x1e36('0xb'),'as':_0x1e36('0xc'),'attributes':['id',_0x1e36('0xd'),_0x1e36('0xe'),_0x1e36('0xf'),_0x1e36('0x10'),_0x1e36('0x11'),'data5','data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xdad1=['field','Action','Actions','action','data2','data3','data4','data5','data6','../client','Request','GetTrigger','name','channel','status','Condition','operator','value','AnyConditions'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xdad1,0x8e));var _0x1dad=function(_0x148b6f,_0x4cdcc2){_0x148b6f=_0x148b6f-0x0;var _0x35b268=_0xdad1[_0x148b6f];return _0x35b268;};'use strict';var client=require(_0x1dad('0x0'));exports['getTriggers']=function(_0x4fe463){return function(_0x2d70db){return client[_0x1dad('0x1')](_0x1dad('0x2'),{'options':{'raw':![],'attributes':['id',_0x1dad('0x3'),_0x1dad('0x4'),_0x1dad('0x5')],'include':[{'model':_0x1dad('0x6'),'as':'AllConditions','attributes':['id','field',_0x1dad('0x7'),_0x1dad('0x8')]},{'model':_0x1dad('0x6'),'as':_0x1dad('0x9'),'attributes':['id',_0x1dad('0xa'),'operator','value']},{'model':_0x1dad('0xb'),'as':_0x1dad('0xc'),'attributes':['id',_0x1dad('0xd'),'data1',_0x1dad('0xe'),_0x1dad('0xf'),_0x1dad('0x10'),_0x1dad('0x11'),_0x1dad('0x12'),'data7']}]},'log':_0x1dad('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a1ec829..2696c17 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 _0x2b52=['Request','GetTrunk','name','../client','getTrunks'];(function(_0x9c673f,_0x3173d2){var _0x400b9a=function(_0x2d6b6c){while(--_0x2d6b6c){_0x9c673f['push'](_0x9c673f['shift']());}};_0x400b9a(++_0x3173d2);}(_0x2b52,0x12a));var _0x22b5=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0x2b52[_0x40822a];return _0x357420;};'use strict';var client=require(_0x22b5('0x0'));exports[_0x22b5('0x1')]=function(_0x5a239d){return function(_0x372ce0){return client[_0x22b5('0x2')](_0x22b5('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x22b5('0x4'),'registry','defaultuser']},'log':_0x22b5('0x3')});};}; \ No newline at end of file +var _0x36f1=['registry','defaultuser','../client','Request','GetTrunk','name'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0x36f1,0xb0));var _0x136f=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x36f1[_0x30ae5e];return _0x1f2e93;};'use strict';var client=require(_0x136f('0x0'));exports['getTrunks']=function(_0x76b3e5){return function(_0x54efe3){return client[_0x136f('0x1')](_0x136f('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x136f('0x3'),_0x136f('0x4'),_0x136f('0x5')]},'log':_0x136f('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 19e57cb..d042957 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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe706,0xa3));var _0x6e70=function(_0x133851,_0x4d6780){_0x133851=_0x133851-0x0;var _0x188215=_0xe706[_0x133851];return _0x188215;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x4ce94d,_0x53de7d){var _0x5976b4=function(_0x11cb24){while(--_0x11cb24){_0x4ce94d['push'](_0x4ce94d['shift']());}};_0x5976b4(++_0x53de7d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0xcb91[_0x23be51];return _0x47a26d;};'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 diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index e68888e..cb52717 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 _0x7774=['CreateVoiceAgentReport','update','create','Request'];(function(_0x53f608,_0x256def){var _0x495b7d=function(_0x467eab){while(--_0x467eab){_0x53f608['push'](_0x53f608['shift']());}};_0x495b7d(++_0x256def);}(_0x7774,0x106));var _0x4777=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0x7774[_0x3fb5eb];return _0x481291;};'use strict';var client=require('../client');exports[_0x4777('0x0')]=function(_0x2f0c02){return client[_0x4777('0x1')](_0x4777('0x2'),{'body':_0x2f0c02,'log':_0x4777('0x2')});};exports[_0x4777('0x3')]=function(_0x537e18,_0x1bd0e7,_0x2a5be2){return client[_0x4777('0x1')]('UpdateVoiceAgentReport',{'body':_0x537e18,'options':{'where':{'uniqueid':_0x1bd0e7,'interface':_0x2a5be2,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xb5bb=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x426504,_0x3a650b){var _0x291e15=function(_0x17068e){while(--_0x17068e){_0x426504['push'](_0x426504['shift']());}};_0x291e15(++_0x3a650b);}(_0xb5bb,0x173));var _0xbb5b=function(_0x83df30,_0x23a00b){_0x83df30=_0x83df30-0x0;var _0x1e6ac9=_0xb5bb[_0x83df30];return _0x1e6ac9;};'use strict';var client=require(_0xbb5b('0x0'));exports[_0xbb5b('0x1')]=function(_0xc45a3e){return client[_0xbb5b('0x2')](_0xbb5b('0x3'),{'body':_0xc45a3e,'log':_0xbb5b('0x3')});};exports['update']=function(_0x404d63,_0x3800b8,_0x5f0e3f){return client[_0xbb5b('0x2')]('UpdateVoiceAgentReport',{'body':_0x404d63,'options':{'where':{'uniqueid':_0x3800b8,'interface':_0x5f0e3f,'agentcomplete':!![]}},'log':_0xbb5b('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e730536..69bda54 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 _0xab16=['callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum'];(function(_0x544cd4,_0x4d4215){var _0x5053e8=function(_0x5d4f18){while(--_0x5d4f18){_0x544cd4['push'](_0x544cd4['shift']());}};_0x5053e8(++_0x4d4215);}(_0xab16,0xc1));var _0x6ab1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xab16[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var util=require(_0x6ab1('0x0'));var _=require(_0x6ab1('0x1'));var client=require(_0x6ab1('0x2'));exports[_0x6ab1('0x3')]=function(_0x5e8582){return client[_0x6ab1('0x4')](_0x6ab1('0x5'),{'body':_['merge'](_0x5e8582,{'source':_0x5e8582[_0x6ab1('0x6')],'destinationcontext':_0x5e8582['context'],'callerid':_0x5e8582[_0x6ab1('0x7')],'amaflags':_0x6ab1('0x8')}),'log':_0x6ab1('0x5')});};exports[_0x6ab1('0x9')]=function(){return function(){return client[_0x6ab1('0x4')](_0x6ab1('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x6ab1('0xb')]('day')[_0x6ab1('0xc')](_0x6ab1('0xd')),moment()[_0x6ab1('0xe')](_0x6ab1('0xf'))[_0x6ab1('0xc')](_0x6ab1('0xd'))]}},'attributes':[_0x6ab1('0x10'),'disposition',_0x6ab1('0x11'),_0x6ab1('0x12')]},'log':_0x6ab1('0x13')});};}; \ No newline at end of file +var _0xf4a5=['YYYY-MM-DD\x20HH:mm:ss','endOf','format','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','Request','GetVoiceCallReport','outbound','day'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xf4a5,0xe2));var _0x5f4a=function(_0x27ff4d,_0x41a7d6){_0x27ff4d=_0x27ff4d-0x0;var _0x803d72=_0xf4a5[_0x27ff4d];return _0x803d72;};'use strict';var moment=require(_0x5f4a('0x0'));var util=require(_0x5f4a('0x1'));var _=require(_0x5f4a('0x2'));var client=require(_0x5f4a('0x3'));exports[_0x5f4a('0x4')]=function(_0x358d7c){return client['Request']('CreateVoiceCallReport',{'body':_[_0x5f4a('0x5')](_0x358d7c,{'source':_0x358d7c[_0x5f4a('0x6')],'destinationcontext':_0x358d7c[_0x5f4a('0x7')],'callerid':_0x358d7c[_0x5f4a('0x8')],'amaflags':_0x5f4a('0x9')}),'log':_0x5f4a('0xa')});};exports[_0x5f4a('0xb')]=function(){return function(){return client[_0x5f4a('0xc')](_0x5f4a('0xd'),{'options':{'where':{'type':[_0x5f4a('0xe')],'createdAt':{'$between':[moment()['startOf'](_0x5f4a('0xf'))['format'](_0x5f4a('0x10')),moment()[_0x5f4a('0x11')](_0x5f4a('0xf'))[_0x5f4a('0x12')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x5f4a('0x13'),_0x5f4a('0x14')]},'log':_0x5f4a('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 988282a..71e4348 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 _0x9f92=['create','Request','CreateVoiceDialReport'];(function(_0x165bf3,_0x53014b){var _0x19a478=function(_0x140802){while(--_0x140802){_0x165bf3['push'](_0x165bf3['shift']());}};_0x19a478(++_0x53014b);}(_0x9f92,0x150));var _0x29f9=function(_0x4527d8,_0x59e349){_0x4527d8=_0x4527d8-0x0;var _0x1ec91d=_0x9f92[_0x4527d8];return _0x1ec91d;};'use strict';var client=require('../client');exports[_0x29f9('0x0')]=function(_0x47d69f){return client[_0x29f9('0x1')](_0x29f9('0x2'),{'body':_0x47d69f,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x4bc4=['CreateVoiceDialReport','../client','create'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x4bc4,0xd0));var _0x44bc=function(_0x3896be,_0x90262b){_0x3896be=_0x3896be-0x0;var _0x2d9c24=_0x4bc4[_0x3896be];return _0x2d9c24;};'use strict';var client=require(_0x44bc('0x0'));exports[_0x44bc('0x1')]=function(_0x470d5f){return client['Request'](_0x44bc('0x2'),{'body':_0x470d5f,'log':_0x44bc('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index a7f884c..949d3c7 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 _0xa45c=['exten','../client','getVoiceExtensions'];(function(_0x350e0e,_0x2264c6){var _0x39a049=function(_0x5ee161){while(--_0x5ee161){_0x350e0e['push'](_0x350e0e['shift']());}};_0x39a049(++_0x2264c6);}(_0xa45c,0x6d));var _0xca45=function(_0x34de70,_0x3200bc){_0x34de70=_0x34de70-0x0;var _0x294b57=_0xa45c[_0x34de70];return _0x294b57;};'use strict';var client=require(_0xca45('0x0'));exports[_0xca45('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xca45('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xca45('0x1')});};}; \ No newline at end of file +var _0x453b=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x453b,0x164));var _0xb453=function(_0x50b651,_0x2ce0c5){_0x50b651=_0x50b651-0x0;var _0x1ec2b0=_0x453b[_0x50b651];return _0x1ec2b0;};'use strict';var client=require(_0xb453('0x0'));exports[_0xb453('0x1')]=function(){return function(){return client[_0xb453('0x2')](_0xb453('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb453('0x4'),_0xb453('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xb453('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 9dffee8..dc4c0b6 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 _0xb603=['type','dialActive','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','name','callerid','mandatoryDispositionPause','TrunkBackup','active','Interval','getVoiceQueues','../client','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format'];(function(_0x25f50a,_0x310ba6){var _0x53f97c=function(_0x121cff){while(--_0x121cff){_0x25f50a['push'](_0x25f50a['shift']());}};_0x53f97c(++_0x310ba6);}(_0xb603,0x1e1));var _0x3b60=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb603[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x3b60('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x3b60('0x1')](_0x3b60('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3b60('0x3'),_0x3b60('0x4'),_0x3b60('0x5'),_0x3b60('0x6'),_0x3b60('0x7'),_0x3b60('0x8'),'dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization',_0x3b60('0x9'),_0x3b60('0xa'),_0x3b60('0xb'),_0x3b60('0xc'),_0x3b60('0xd'),_0x3b60('0xe'),_0x3b60('0xf'),_0x3b60('0x10'),_0x3b60('0x11'),_0x3b60('0x12'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x3b60('0x13'),_0x3b60('0x14'),'dialGlobalMaxRetry',_0x3b60('0x15'),'dialGlobalInterval',_0x3b60('0x16'),_0x3b60('0x17'),'dialAMDActive',_0x3b60('0x18'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x3b60('0x19'),_0x3b60('0x1a'),_0x3b60('0x1b'),_0x3b60('0x1c'),'dialAMDSilenceThreshold',_0x3b60('0x1d'),_0x3b60('0x1e'),_0x3b60('0x1f'),_0x3b60('0x20'),_0x3b60('0x21'),_0x3b60('0x22'),_0x3b60('0x23'),_0x3b60('0x24'),_0x3b60('0x6'),_0x3b60('0x25'),_0x3b60('0x26'),_0x3b60('0x27'),_0x3b60('0x28'),_0x3b60('0x29'),_0x3b60('0x2a'),'dialDropRetryFrequency',_0x3b60('0x2b'),_0x3b60('0x2c'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x3b60('0x2d'),_0x3b60('0x2e'),_0x3b60('0x2f'),_0x3b60('0x30'),_0x3b60('0x31'),_0x3b60('0x32'),_0x3b60('0x33'),_0x3b60('0x34')],'include':[{'model':_0x3b60('0x35'),'as':_0x3b60('0x35'),'attributes':['id',_0x3b60('0x36'),_0x3b60('0x37'),'active']},{'model':'Pause','as':_0x3b60('0x38'),'attributes':['id',_0x3b60('0x36')]},{'model':_0x3b60('0x35'),'as':_0x3b60('0x39'),'attributes':['id',_0x3b60('0x36'),_0x3b60('0x37'),_0x3b60('0x3a')]},{'model':_0x3b60('0x3b'),'as':_0x3b60('0x3b'),'attributes':['id',_0x3b60('0x36')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x3b60('0x36'),'interval']}]}]},'log':_0x3b60('0x3c')});};}; \ No newline at end of file +var _0xce6b=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce6b,0x1c9));var _0xbce6=function(_0x2400e4,_0x497a52){_0x2400e4=_0x2400e4-0x0;var _0x338478=_0xce6b[_0x2400e4];return _0x338478;};'use strict';var client=require('../client');exports[_0xbce6('0x0')]=function(){return function(){return client[_0xbce6('0x1')](_0xbce6('0x2'),{'options':{'raw':![],'attributes':['id',_0xbce6('0x3'),_0xbce6('0x4'),_0xbce6('0x5'),_0xbce6('0x6'),_0xbce6('0x7'),'type','dialActive',_0xbce6('0x8'),_0xbce6('0x9'),_0xbce6('0xa'),_0xbce6('0xb'),_0xbce6('0xc'),_0xbce6('0xd'),'dialPredictiveInterval',_0xbce6('0xe'),'dialOriginateCallerIdNumber',_0xbce6('0xf'),'dialQueueOptions',_0xbce6('0x10'),_0xbce6('0x11'),_0xbce6('0x12'),_0xbce6('0x13'),_0xbce6('0x14'),_0xbce6('0x15'),_0xbce6('0x16'),_0xbce6('0x17'),_0xbce6('0x18'),'dialTimezone',_0xbce6('0x19'),_0xbce6('0x1a'),'dialCheckDuplicateType',_0xbce6('0x1b'),'dialAMDInitialSilence',_0xbce6('0x1c'),'dialAMDAfterGreetingSilence',_0xbce6('0x1d'),'dialAMDMinWordLength',_0xbce6('0x1e'),_0xbce6('0x1f'),_0xbce6('0x20'),_0xbce6('0x21'),_0xbce6('0x22'),_0xbce6('0x23'),_0xbce6('0x24'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0xbce6('0x25'),'dialQueueProject2',_0xbce6('0x7'),'strategy','dialRandomLastDigitCallerIdNumber',_0xbce6('0x26'),_0xbce6('0x27'),_0xbce6('0x28'),_0xbce6('0x29'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0xbce6('0x2a'),_0xbce6('0x2b'),_0xbce6('0x2c'),_0xbce6('0x2d'),_0xbce6('0x2e'),_0xbce6('0x2f'),_0xbce6('0x30'),_0xbce6('0x31'),'dialPreviewAutoRecallMe',_0xbce6('0x32'),_0xbce6('0x33')],'include':[{'model':_0xbce6('0x34'),'as':_0xbce6('0x34'),'attributes':['id',_0xbce6('0x3'),'callerid',_0xbce6('0x35')]},{'model':_0xbce6('0x36'),'as':_0xbce6('0x37'),'attributes':['id',_0xbce6('0x3')]},{'model':'Trunk','as':_0xbce6('0x38'),'attributes':['id','name','callerid',_0xbce6('0x35')]},{'model':'Interval','as':_0xbce6('0x39'),'attributes':['id',_0xbce6('0x3')],'include':[{'model':'Interval','as':_0xbce6('0x3a'),'attributes':['id',_0xbce6('0x3'),_0xbce6('0x3b')]}]}]},'log':_0xbce6('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 700d2d8..a4f3d8d 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(_0x1c0d54,_0x27ad0a){var _0x5d767c=function(_0x22efd6){while(--_0x22efd6){_0x1c0d54['push'](_0x1c0d54['shift']());}};_0x5d767c(++_0x27ad0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x5ddfce,_0x2387d5){var _0x3207cb=function(_0x423831){while(--_0x423831){_0x5ddfce['push'](_0x5ddfce['shift']());}};_0x3207cb(++_0x2387d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 fa66dc6..ac4672a 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 _0xb99b=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x17c721,_0x4b3821){var _0x5d4ced=function(_0x41f568){while(--_0x41f568){_0x17c721['push'](_0x17c721['shift']());}};_0x5d4ced(++_0x4b3821);}(_0xb99b,0x1ba));var _0xbb99=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb99b[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xbb99('0x0'));exports[_0xbb99('0x1')]=function(_0x73a2c8){return function(){return client[_0xbb99('0x2')](_0xbb99('0x3'),{'options':{'where':{'VoiceQueueId':_0x73a2c8,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xd528=['getVoiceQueueRtPauses'];(function(_0x368850,_0x32bb6f){var _0x417f93=function(_0x1c2216){while(--_0x1c2216){_0x368850['push'](_0x368850['shift']());}};_0x417f93(++_0x32bb6f);}(_0xd528,0x19e));var _0x8d52=function(_0x2d4fe5,_0x142455){_0x2d4fe5=_0x2d4fe5-0x0;var _0x268766=_0xd528[_0x2d4fe5];return _0x268766;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x1aeead){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x1aeead,'paused':!![]},'raw':!![]},'log':_0x8d52('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e87f820..4d91360 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(_0x5da08e,_0x3bc5b2){var _0x4abf0f=function(_0x4109d5){while(--_0x4109d5){_0x5da08e['push'](_0x5da08e['shift']());}};_0x4abf0f(++_0x3bc5b2);}(_0x7a54,0x106));var _0x47a5=function(_0x119332,_0x41587c){_0x119332=_0x119332-0x0;var _0x2fcf60=_0x7a54[_0x119332];return _0x2fcf60;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x3fdada,_0x525df8){var _0x2c2db6=function(_0x6044d4){while(--_0x6044d4){_0x3fdada['push'](_0x3fdada['shift']());}};_0x2c2db6(++_0x525df8);}(_0x7a54,0x106));var _0x47a5=function(_0x4c7ea0,_0x1e2705){_0x4c7ea0=_0x4c7ea0-0x0;var _0x2f0685=_0x7a54[_0x4c7ea0];return _0x2f0685;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 4ec6693..a5fdaa3 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 _0xba4f=['transfertargetexten','origtransferercontext','attended','../client','blindTransfer','Request','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode'];(function(_0x2cfaa4,_0x3c0fb4){var _0x58974a=function(_0x37ff4c){while(--_0x37ff4c){_0x2cfaa4['push'](_0x2cfaa4['shift']());}};_0x58974a(++_0x3c0fb4);}(_0xba4f,0x19b));var _0xfba4=function(_0xce7f62,_0x55acdf){_0xce7f62=_0xce7f62-0x0;var _0x35a598=_0xba4f[_0xce7f62];return _0x35a598;};'use strict';var client=require(_0xfba4('0x0'));exports['transfers']={};exports[_0xfba4('0x1')]=function(_0x4c2777){return client[_0xfba4('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x4c2777['result'],'transfererchannel':_0x4c2777[_0xfba4('0x3')],'transferercalleridnum':_0x4c2777[_0xfba4('0x4')],'transferercalleridname':_0x4c2777['transferercalleridname'],'transfererconnectedlinenum':_0x4c2777[_0xfba4('0x5')],'transfererconnectedlinename':_0x4c2777[_0xfba4('0x6')],'transfereraccountcode':_0x4c2777[_0xfba4('0x7')],'transferercontext':_0x4c2777[_0xfba4('0x8')],'transfererexten':_0x4c2777[_0xfba4('0x9')],'transfererlinkedid':_0x4c2777[_0xfba4('0xa')],'transfereechannel':_0x4c2777['transfereechannel'],'transfereecalleridnum':_0x4c2777[_0xfba4('0xb')],'transfereecalleridname':_0x4c2777['transfereecalleridname'],'transfereeconnectedlinenum':_0x4c2777[_0xfba4('0xc')],'transfereeconnectedlinename':_0x4c2777[_0xfba4('0xd')],'transfereeaccountcode':_0x4c2777['transfereeaccountcode'],'transfereecontext':_0x4c2777[_0xfba4('0xe')],'transfereeexten':_0x4c2777[_0xfba4('0xf')],'transfereelinkedid':_0x4c2777['transfereelinkedid'],'isexternal':_0x4c2777['isexternal'],'context':_0x4c2777[_0xfba4('0x10')],'extension':_0x4c2777[_0xfba4('0x11')],'type':_0xfba4('0x12')},'log':_0xfba4('0x13')});};exports[_0xfba4('0x14')]=function(_0x302ec4){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x302ec4[_0xfba4('0x15')],'transfererchannel':_0x302ec4[_0xfba4('0x16')],'transferercalleridnum':_0x302ec4[_0xfba4('0x17')],'transferercalleridname':_0x302ec4[_0xfba4('0x18')],'transfererconnectedlinenum':_0x302ec4[_0xfba4('0x19')],'transfererconnectedlinename':_0x302ec4['secondtransfererconnectedlinename'],'transfereraccountcode':_0x302ec4['origtransfereraccountcode'],'transferercontext':_0x302ec4['secondtransferercontext'],'transfererexten':_0x302ec4[_0xfba4('0x1a')],'transfererlinkedid':_0x302ec4['origtransfererlinkedid'],'transfereechannel':_0x302ec4[_0xfba4('0x1b')],'transfereecalleridnum':_0x302ec4['transfertargetcalleridnum'],'transfereecalleridname':_0x302ec4[_0xfba4('0x1c')],'transfereeconnectedlinenum':_0x302ec4[_0xfba4('0x1d')],'transfereeconnectedlinename':_0x302ec4['transfertargetconnectedlinename'],'transfereeaccountcode':_0x302ec4[_0xfba4('0x1e')],'transfereecontext':_0x302ec4['transfertargetcontext'],'transfereeexten':_0x302ec4[_0xfba4('0x1f')],'transfereelinkedid':_0x302ec4['transfertargetlinkedid'],'isexternal':_0x302ec4['isexternal'],'context':_0x302ec4[_0xfba4('0x20')],'extension':_0x302ec4['origtransfererexten'],'type':_0xfba4('0x21')},'log':_0xfba4('0x13')});}; \ No newline at end of file +var _0x499a=['transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x499a,0xbc));var _0xa499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x499a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xa499('0x0')]={};exports[_0xa499('0x1')]=function(_0xf44382){return client[_0xa499('0x2')](_0xa499('0x3'),{'body':{'result':_0xf44382[_0xa499('0x4')],'transfererchannel':_0xf44382[_0xa499('0x5')],'transferercalleridnum':_0xf44382[_0xa499('0x6')],'transferercalleridname':_0xf44382[_0xa499('0x7')],'transfererconnectedlinenum':_0xf44382[_0xa499('0x8')],'transfererconnectedlinename':_0xf44382['transfererconnectedlinename'],'transfereraccountcode':_0xf44382[_0xa499('0x9')],'transferercontext':_0xf44382[_0xa499('0xa')],'transfererexten':_0xf44382[_0xa499('0xb')],'transfererlinkedid':_0xf44382['transfererlinkedid'],'transfereechannel':_0xf44382[_0xa499('0xc')],'transfereecalleridnum':_0xf44382[_0xa499('0xd')],'transfereecalleridname':_0xf44382[_0xa499('0xe')],'transfereeconnectedlinenum':_0xf44382[_0xa499('0xf')],'transfereeconnectedlinename':_0xf44382['transfereeconnectedlinename'],'transfereeaccountcode':_0xf44382[_0xa499('0x10')],'transfereecontext':_0xf44382[_0xa499('0x11')],'transfereeexten':_0xf44382[_0xa499('0x12')],'transfereelinkedid':_0xf44382['transfereelinkedid'],'isexternal':_0xf44382[_0xa499('0x13')],'context':_0xf44382[_0xa499('0x14')],'extension':_0xf44382['extension'],'type':'blind'},'log':_0xa499('0x3')});};exports['attendedTransfer']=function(_0x3c38bc){return client[_0xa499('0x2')](_0xa499('0x3'),{'body':{'result':_0x3c38bc['result'],'transfererchannel':_0x3c38bc['origtransfererchannel'],'transferercalleridnum':_0x3c38bc[_0xa499('0x15')],'transferercalleridname':_0x3c38bc[_0xa499('0x16')],'transfererconnectedlinenum':_0x3c38bc[_0xa499('0x17')],'transfererconnectedlinename':_0x3c38bc['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3c38bc['origtransfereraccountcode'],'transferercontext':_0x3c38bc[_0xa499('0x18')],'transfererexten':_0x3c38bc['secondtransfererexten'],'transfererlinkedid':_0x3c38bc['origtransfererlinkedid'],'transfereechannel':_0x3c38bc[_0xa499('0x19')],'transfereecalleridnum':_0x3c38bc[_0xa499('0x1a')],'transfereecalleridname':_0x3c38bc['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3c38bc[_0xa499('0x1b')],'transfereeconnectedlinename':_0x3c38bc['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3c38bc['transfertargetaccountcode'],'transfereecontext':_0x3c38bc[_0xa499('0x1c')],'transfereeexten':_0x3c38bc[_0xa499('0x1d')],'transfereelinkedid':_0x3c38bc[_0xa499('0x1e')],'isexternal':_0x3c38bc[_0xa499('0x13')],'context':_0x3c38bc['origtransferercontext'],'extension':_0x3c38bc[_0xa499('0x1f')],'type':_0xa499('0x20')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index b2188da..412f37d 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 _0x087b=['send','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','then','message','command','Command','Action','content','catch','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','voiceQueues','omit','undefined','values','channels','validate','map','filename','uniqueid','wav','MixMonitor','channel','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts'];(function(_0x15c162,_0x20fdaf){var _0x23e8aa=function(_0x2e06b9){while(--_0x2e06b9){_0x15c162['push'](_0x15c162['shift']());}};_0x23e8aa(++_0x20fdaf);}(_0x087b,0x11a));var _0xb087=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x087b[_0x576170];return _0x397c70;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0xb087('0x2'));var config=require('../../../config/environment');var properties=require(_0xb087('0x3'));var ami=require(_0xb087('0x4'));exports[_0xb087('0x5')]=function(_0xf1cf84,_0x183efd,_0x46e106){return new Promise(function(_0x40156d,_0x17d6e8){var _0xecf080={'QueuePause':function(_0x36ac30){return new Promise(function(_0x3cebbf){var _0x6d83fb=util[_0xb087('0x6')](_0xb087('0x7'),_0xb087('0x8'),_0x36ac30[_0xb087('0x9')]);if(_0xf1cf84[_0xb087('0xa')]&&_0xf1cf84['timers'][_0x6d83fb]&&_0xf1cf84[_0xb087('0xa')][_0x6d83fb][_0xb087('0xb')]){_0xf1cf84[_0xb087('0xa')][_0x6d83fb][_0xb087('0xc')]();}if(_0xf1cf84[_0xb087('0xd')][_0x6d83fb]){_0xf1cf84[_0xb087('0xd')][_0x6d83fb][_0xb087('0xe')]({'statePause':_0x36ac30['pause']?!![]:![]});}_0x3cebbf({'code':0xc8,'message':_0xb087('0xf')});});},'Reload':function(_0x31f977){var _0x323656=this;return new Promise(function(_0x51ceaa,_0x3001e3){if(ami[_0xb087('0x10')]()==![]){return _0x3001e3(_0x323656[_0xb087('0x11')](0x1f4,[config[_0xb087('0x12')]['ip'],config[_0xb087('0x12')][_0xb087('0x13')],_0xb087('0x14')][_0xb087('0x15')]('\x20')));}_0x31f977=_[_0xb087('0x16')](_0x31f977,_[_0xb087('0x17')](properties['module']));_0x31f977[_0xb087('0x18')]=_0xb087('0x19');return ami['Action'](_0x31f977)[_0xb087('0x1a')](function(_0x2b83b7){_0x51ceaa({'code':0xc8,'message':_0x2b83b7[_0xb087('0x1b')]});})['catch'](function(_0x330005){_0x3001e3(_0x323656[_0xb087('0x11')](0x1f5,_0x330005[_0xb087('0x1b')]));});});},'Command':function(_0x45d074){var _0x4e333b=this;return new Promise(function(_0x13d534,_0x28428e){if(ami[_0xb087('0x10')]()==![]){return _0x28428e(_0x4e333b[_0xb087('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0xb087('0x15')]('\x20')));}_0x45d074=_[_0xb087('0x16')](_0x45d074,_0xb087('0x1c'));_0x45d074[_0xb087('0x18')]=_0xb087('0x1d');return ami[_0xb087('0x1e')](_0x45d074)[_0xb087('0x1a')](function(_0x5587f7){_0x13d534({'code':0xc8,'message':_0x5587f7[_0xb087('0x1f')]});})[_0xb087('0x20')](function(_0x1de654){_0x28428e(_0x4e333b[_0xb087('0x11')](0x1f5,_0x1de654[_0xb087('0x1b')]));});});},'VoiceQueues':function(){return new Promise(function(_0x4d9028){var _0x183eab=[];for(var _0xdd4216 in _0xf1cf84['voiceQueues']){if(_0xf1cf84['voiceQueues']['hasOwnProperty'](_0xdd4216)){var _0x598b99=_0xf1cf84['voiceQueues'][_0xdd4216];var _0x304840={'id':_0x598b99['id'],'name':_0x598b99[_0xb087('0x9')],'strategy':_0x598b99[_0xb087('0x21')],'answered':_0x598b99[_0xb087('0x22')],'available':_0x598b99[_0xb087('0x23')],'loggedIn':_0x598b99[_0xb087('0x24')],'pTalking':_0x598b99[_0xb087('0x25')],'sumBillable':_0x598b99[_0xb087('0x26')],'sumDuration':_0x598b99[_0xb087('0x27')],'sumHoldTime':_0x598b99[_0xb087('0x28')]||0x0,'talking':_0x598b99[_0xb087('0x29')],'total':_0x598b99[_0xb087('0x2a')],'type':_0x598b99[_0xb087('0x2b')],'unmanaged':_0x598b99[_0xb087('0x2c')],'abandoned':_0x598b99['abandoned'],'waiting':_0x598b99[_0xb087('0x2d')],'loggedInDb':_0x598b99[_0xb087('0x2e')]};if(_0x598b99[_0xb087('0x2b')]===_0xb087('0x2f')){_0x304840[_0xb087('0x30')]=_0x598b99[_0xb087('0x30')];_0x304840[_0xb087('0x31')]=_0x598b99[_0xb087('0x31')];_0x304840['dialOriginateCallerIdName']=_0x598b99['dialOriginateCallerIdName'];_0x304840[_0xb087('0x32')]=_0x598b99[_0xb087('0x32')];_0x304840['dialOriginateTimeout']=_0x598b99[_0xb087('0x33')];_0x304840[_0xb087('0x34')]=_0x598b99[_0xb087('0x34')];_0x304840[_0xb087('0x35')]=_0x598b99[_0xb087('0x35')];_0x304840[_0xb087('0x36')]=_0x598b99[_0xb087('0x36')];_0x304840[_0xb087('0x37')]=_0x598b99[_0xb087('0x37')];_0x304840[_0xb087('0x38')]=_0x598b99[_0xb087('0x38')];_0x304840[_0xb087('0x39')]=_0x598b99['outboundBusyCallsDay'];_0x304840[_0xb087('0x3a')]=_0x598b99['outboundCongestionCallsDay'];_0x304840[_0xb087('0x3b')]=_0x598b99[_0xb087('0x3b')];_0x304840[_0xb087('0x3c')]=_0x598b99[_0xb087('0x3c')];_0x304840[_0xb087('0x3d')]=_0x598b99[_0xb087('0x3d')];_0x304840[_0xb087('0x3e')]=_0x598b99[_0xb087('0x3e')];_0x304840[_0xb087('0x3f')]=_0x598b99['outboundNoSuchCallsDay'];_0x304840['outboundOriginateFailureCallsDay']=_0x598b99[_0xb087('0x40')];_0x304840[_0xb087('0x41')]=_0x598b99[_0xb087('0x41')];_0x304840[_0xb087('0x42')]=_0x598b99[_0xb087('0x42')];_0x304840['outboundUnknownCallsDay']=_0x598b99[_0xb087('0x43')];_0x304840[_0xb087('0x44')]=_0x598b99['predictiveIntervalAnsweredCalls'];_0x304840['predictiveIntervalAvgHoldtime']=_0x598b99[_0xb087('0x45')];_0x304840[_0xb087('0x46')]=_0x598b99[_0xb087('0x46')];_0x304840['predictiveIntervalDroppedCallsCallersExit']=_0x598b99[_0xb087('0x47')];_0x304840[_0xb087('0x48')]=_0x598b99[_0xb087('0x48')];_0x304840[_0xb087('0x49')]=_0x598b99[_0xb087('0x49')];_0x304840['predictiveIntervalErlangCallsDroppedCalls']=_0x598b99[_0xb087('0x4a')];_0x304840['predictiveIntervalHitRate']=_0x598b99[_0xb087('0x4b')];_0x304840['predictiveIntervalMultiplicativeFactor']=_0x598b99[_0xb087('0x4c')];_0x304840[_0xb087('0x4d')]=_0x598b99['predictiveIntervalPauses'];_0x304840[_0xb087('0x4e')]=_0x598b99['predictiveIntervalAvailable'];_0x304840[_0xb087('0x4f')]=_0x598b99['predictiveIntervalTotalCalls'];_0x304840[_0xb087('0x1b')]=_0x598b99[_0xb087('0x1b')];_0x304840[_0xb087('0x50')]=_0x598b99[_0xb087('0x50')];_0x304840[_0xb087('0x51')]=_0x598b99[_0xb087('0x51')];_0x304840[_0xb087('0x52')]=_0x598b99['erlangCallToSecond'];_0x304840[_0xb087('0x53')]=_0x598b99['erlangAbandonmentRate'];_0x304840[_0xb087('0x54')]=_0x598b99[_0xb087('0x54')];_0x304840['startPredictive']=_0x598b99[_0xb087('0x55')];_0x304840[_0xb087('0x56')]=_0x598b99[_0xb087('0x56')];}if(_0x598b99['Trunk']){_0x304840[_0xb087('0x57')]={'id':_0x598b99['Trunk']['id'],'name':_0x598b99[_0xb087('0x57')][_0xb087('0x9')],'active':_0x598b99['Trunk'][_0xb087('0x58')],'callerid':_0x598b99[_0xb087('0x57')]['callerid']};}if(_0x598b99[_0xb087('0x59')]){_0x304840[_0xb087('0x59')]={'id':_0x598b99['Interval']['id'],'name':_0x598b99[_0xb087('0x59')][_0xb087('0x9')]};}_0x183eab[_0xb087('0x5a')](_0x304840);}}_0x4d9028({'count':_0x183eab[_0xb087('0x5b')],'rows':_0x183eab});});},'UpdateVoiceQueue':function(_0x58ca9f){return new Promise(function(_0x47902e,_0x1a16d7){var _0x42e19f=_[_0xb087('0x5c')](_0xf1cf84[_0xb087('0x5d')],{'id':parseInt(_0x58ca9f['id'])});var _0x36a88f=_[_0xb087('0x5e')](_0x58ca9f,['id']);if(_0x42e19f){for(var _0x4d4e7d in _0x36a88f){if(typeof _0x36a88f[_0x4d4e7d]!=='undefined'&&typeof _0x42e19f[_0x4d4e7d]!==_0xb087('0x5f')){_0x42e19f[_0x4d4e7d]=_0x36a88f[_0x4d4e7d];}}_0x47902e(_0x42e19f);}else{_0x1a16d7();}});},'VoiceChannels':function(){return new Promise(function(_0x520acc){var _0x3a405b=_[_0xb087('0x60')](_0xf1cf84[_0xb087('0x61')]);_0x520acc({'count':_0x3a405b[_0xb087('0x5b')],'rows':_0x3a405b});});},'VoiceChannelMixMonitor':function(_0x521018){var _0x2be4f2=this;return new Promise(function(_0x562751,_0x2fe8a0){if(ami[_0xb087('0x10')]()==![]){return _0x2fe8a0(_0x2be4f2[_0xb087('0x11')](0x1f4,[config[_0xb087('0x12')]['ip'],config[_0xb087('0x12')]['username'],_0xb087('0x14')][_0xb087('0x15')]('\x20')));}var _0x588d96=schema(properties['voicechannel'])[_0xb087('0x62')](_0x521018);if(_0x588d96['length']>0x0){return _0x2fe8a0(_0x2be4f2['error'](0x1f4,_[_0xb087('0x63')](_0x588d96,_0xb087('0x1b'))['join'](',\x20')));}var _0x4362d4=_[_0xb087('0x5c')](_0xf1cf84[_0xb087('0x61')],{'uniqueid':_0x521018['uniqueid']});if(_0x4362d4&&_0x4362d4['channel']){var _0x30cc83=util['format']('%s.%s',_0x521018[_0xb087('0x64')]||_0x521018[_0xb087('0x65')],_0x521018[_0xb087('0x6')]||_0xb087('0x66'));return ami[_0xb087('0x1e')]({'action':_0xb087('0x67'),'channel':_0x4362d4[_0xb087('0x68')],'file':_0x30cc83,'options':_0xb087('0x69')})[_0xb087('0x1a')](function(_0x18d93b){var _0x47d47c=_[_0xb087('0x5c')](_0x4362d4['monitors'],{'filename':_0xb087('0x6a')+_0x30cc83[_0xb087('0x6b')]()});if(_['isNil'](_0x47d47c)){_0x4362d4[_0xb087('0x6c')][_0xb087('0x5a')]({'filename':_0xb087('0x6a')+_0x30cc83[_0xb087('0x6b')](),'createdAt':moment()[_0xb087('0x6')](_0xb087('0x6d')),'mixmonitorid':_0x18d93b[_0xb087('0x6e')],'status':_0xb087('0x6f')});}else{_0x47d47c[_0xb087('0x6e')]=_0x18d93b[_0xb087('0x6e')];_0x47d47c[_0xb087('0x70')]='rec';}_0x562751({'code':0xc8,'message':[_0x521018[_0xb087('0x65')],'MixMonitor\x20Success',_0x18d93b[_0xb087('0x6e')]]['join']('\x20'),'mixmonitorid':_0x18d93b[_0xb087('0x6e')]});})[_0xb087('0x20')](function(_0x187ffd){_0x2fe8a0(_0x2be4f2[_0xb087('0x11')](0x1f5,[_0x521018[_0xb087('0x65')],_0x187ffd[_0xb087('0x1b')][_0xb087('0x6b')]()][_0xb087('0x15')]('\x20')));});}else{return _0x2fe8a0(_0x2be4f2[_0xb087('0x11')](0x1f5,_0xb087('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0x300e9b){var _0x2ee0a3=this;return new Promise(function(_0x3834a6,_0x22be05){if(ami[_0xb087('0x10')]()==![]){return _0x22be05(_0x2ee0a3[_0xb087('0x11')](0x1f4,[config[_0xb087('0x12')]['ip'],config[_0xb087('0x12')][_0xb087('0x13')],_0xb087('0x14')][_0xb087('0x15')]('\x20')));}var _0x459c5b=schema(properties['voicechannel'])[_0xb087('0x62')](_0x300e9b);if(_0x459c5b[_0xb087('0x5b')]>0x0){return _0x22be05(_0x2ee0a3[_0xb087('0x11')](0x1f4,_['map'](_0x459c5b,_0xb087('0x1b'))[_0xb087('0x15')](',\x20')));}var _0x5685b1=_[_0xb087('0x5c')](_0xf1cf84[_0xb087('0x61')],{'uniqueid':_0x300e9b[_0xb087('0x65')]});if(_0x5685b1){return Promise['resolve']()[_0xb087('0x1a')](function(){if(_0x5685b1[_0xb087('0x68')]){return ami[_0xb087('0x1e')]({'action':_0xb087('0x72'),'channel':_0x5685b1[_0xb087('0x68')],'mixmonitorid':_0x300e9b[_0xb087('0x6e')]})[_0xb087('0x20')](function(){});}})[_0xb087('0x1a')](function(){if(_0x5685b1['destinationchannel']){return ami[_0xb087('0x1e')]({'action':_0xb087('0x72'),'channel':_0x5685b1[_0xb087('0x73')],'mixmonitorid':_0x300e9b['mixmonitorid']})[_0xb087('0x20')](function(){});}})['then'](function(){var _0x4a2441=_[_0xb087('0x5c')](_0x5685b1[_0xb087('0x6c')],{'mixmonitorid':_0x300e9b['mixmonitorid']});if(_0x4a2441){_0x4a2441[_0xb087('0x70')]='stop';}})[_0xb087('0x1a')](function(){var _0x1a8237=util['format']('%s.%s',_0x300e9b[_0xb087('0x64')]||_0x300e9b['uniqueid'],_0x300e9b['format']||_0xb087('0x66'));var _0x52d72a=_[_0xb087('0x5c')](_0x5685b1['monitors'],{'filename':_0xb087('0x6a')+_0x1a8237[_0xb087('0x6b')]()});if(_0x52d72a){_0x52d72a[_0xb087('0x70')]=_0xb087('0x74');}})[_0xb087('0x1a')](function(){_0x3834a6({'code':0xc8,'message':[_0x300e9b[_0xb087('0x65')],'StopMixMonitor\x20Success'][_0xb087('0x15')]('\x20')});})['catch'](function(_0x22e010){_0x22be05(_0x2ee0a3[_0xb087('0x11')](0x1f5,[_0x300e9b[_0xb087('0x65')],_0x22e010['message'][_0xb087('0x6b')]()]['join']('\x20')));});}else{return _0x22be05(_0x2ee0a3[_0xb087('0x11')](0x1f5,_0xb087('0x71')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x66f15b){var _0x2ee63f=_[_0xb087('0x60')](_0xf1cf84[_0xb087('0x75')]);_0x66f15b({'count':_0x2ee63f['length'],'rows':_0x2ee63f});});},'VoiceQueuesChannel':function(_0x245d68){var _0xd01a6b=this;return new Promise(function(_0x4bedbd,_0x25a45f){var _0x58de88=schema(properties[_0xb087('0x76')])[_0xb087('0x62')](_0x245d68);if(_0x58de88[_0xb087('0x5b')]>0x0){return _0x25a45f(_0xd01a6b[_0xb087('0x11')](0x1f4,_[_0xb087('0x63')](_0x58de88,_0xb087('0x1b'))[_0xb087('0x15')](',\x20')));}var _0x186b40=_['find'](_0xf1cf84['queueChannels'],{'uniqueid':_0x245d68['uniqueid']});if(_0x186b40){_0x4bedbd(_0x186b40);}else{return _0x25a45f(_0xd01a6b[_0xb087('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x390309){var _0x568351=this;return new Promise(function(_0x11c4b0,_0x43bf47){if(ami[_0xb087('0x10')]()==![]){return _0x43bf47(_0x568351[_0xb087('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xb087('0x12')]['username'],_0xb087('0x14')][_0xb087('0x15')]('\x20')));}var _0x21fd15=schema(properties[_0xb087('0x77')])['validate'](_0x390309);if(_0x21fd15['length']>0x0){return _0x43bf47(_0x568351[_0xb087('0x11')](0x1f4,_['map'](_0x21fd15,_0xb087('0x1b'))[_0xb087('0x15')](',\x20')));}var _0x2ca987=_[_0xb087('0x5c')](_0xf1cf84['queueChannels'],{'uniqueid':_0x390309['uniqueid']});if(_0x2ca987&&_0x2ca987[_0xb087('0x68')]){return ami['Action']({'action':_0xb087('0x78'),'channel':_0x2ca987[_0xb087('0x68')]})[_0xb087('0x1a')](function(_0x2f9631){_0x11c4b0({'code':0xc8,'message':[_0x390309[_0xb087('0x65')],_0x2f9631['message'][_0xb087('0x6b')]()][_0xb087('0x15')]('\x20')});})['catch'](function(_0x544ee0){_0x43bf47(_0x568351['error'](0x1f5,[_0x390309[_0xb087('0x65')],_0x544ee0[_0xb087('0x1b')][_0xb087('0x6b')]()][_0xb087('0x15')]('\x20')));});}else{return _0x43bf47(_0x568351[_0xb087('0x11')](0x1f5,_0xb087('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x47ea48){var _0xd1f58a=this;return new Promise(function(_0x25e097,_0x1e01c5){if(ami[_0xb087('0x10')]()==![]){return _0x1e01c5(_0xd1f58a[_0xb087('0x11')](0x1f4,[config[_0xb087('0x12')]['ip'],config[_0xb087('0x12')]['username'],_0xb087('0x14')][_0xb087('0x15')]('\x20')));}var _0x28965f=schema(properties['voicequeuechannelredirect'])[_0xb087('0x62')](_0x47ea48);if(_0x28965f['length']>0x0){return _0x1e01c5(_0xd1f58a[_0xb087('0x11')](0x1f4,_[_0xb087('0x63')](_0x28965f,_0xb087('0x1b'))[_0xb087('0x15')](',\x20')));}var _0x463791=_[_0xb087('0x5c')](_0xf1cf84['queueChannels'],{'uniqueid':_0x47ea48['uniqueid']});if(_0x463791&&_0x463791[_0xb087('0x68')]){return ami[_0xb087('0x1e')]({'action':'Redirect','channel':_0x463791[_0xb087('0x68')],'exten':_0x47ea48[_0xb087('0x79')],'context':_0x47ea48[_0xb087('0x7a')]||_0x463791[_0xb087('0x7a')],'priority':0x1})[_0xb087('0x1a')](function(_0x631bc7){_0x25e097({'code':0xc8,'message':[_0x47ea48['uniqueid'],_0x631bc7[_0xb087('0x1b')][_0xb087('0x6b')]()][_0xb087('0x15')]('\x20')});})[_0xb087('0x20')](function(_0x416e05){_0x1e01c5(_0xd1f58a[_0xb087('0x11')](0x1f5,[_0x47ea48[_0xb087('0x65')],_0x416e05[_0xb087('0x1b')][_0xb087('0x6b')]()]['join']('\x20')));});}else{return _0x1e01c5(_0xd1f58a[_0xb087('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2a32d0){return new Promise(function(_0x3a8b25){var _0x47ed3c=_[_0xb087('0x60')](_0xf1cf84[_0xb087('0xd')]);if(_0x2a32d0&&_0x2a32d0['id']){var _0x8b1a5b=_[_0xb087('0x5c')](_0x47ed3c,function(_0x3f48b6){return _0x3f48b6['id']===_0x2a32d0['id'];});_0x3a8b25(_0x8b1a5b);}else{_0x3a8b25({'count':_0x47ed3c[_0xb087('0x5b')],'rows':_0x47ed3c});}});},'Telephones':function(){return new Promise(function(_0x573ba1){var _0xacc1f4=_[_0xb087('0x60')](_0xf1cf84[_0xb087('0x7b')]);_0x573ba1({'count':_0xacc1f4[_0xb087('0x5b')],'rows':_0xacc1f4});});},'Trunks':function(){return new Promise(function(_0x1da8ac){var _0x4ac3fc=_[_0xb087('0x60')](_0xf1cf84[_0xb087('0x7c')]);_0x1da8ac({'count':_0x4ac3fc[_0xb087('0x5b')],'rows':_0x4ac3fc});});},'OutboundChannels':function(){return new Promise(function(_0x41f3e7){var _0x411b00=_[_0xb087('0x60')](_0xf1cf84[_0xb087('0x7d')]);_0x41f3e7({'count':_0x411b00[_0xb087('0x5b')],'rows':_0x411b00});});},'Outbound':function(){return new Promise(function(_0x46f9ef){_0x46f9ef(_0xf1cf84[_0xb087('0x2f')]);});},'Campaigns':function(){return new Promise(function(_0x25cec3){var _0x5d4953=_['values'](_0xf1cf84[_0xb087('0x7e')]);_0x25cec3({'count':_0x5d4953[_0xb087('0x5b')],'rows':_0x5d4953});});},'VoiceQueuesPreview':function(_0x3fbbb6){var _0x28e3a3=this;return new Promise(function(_0x2f49df,_0x4c60b0){_0x183efd[_0xb087('0x7f')](_0x3fbbb6['id'])[_0xb087('0x1a')](function(_0x163804){_0x2f49df({'code':0xc8,'message':_0x163804[_0xb087('0x1b')]});})[_0xb087('0x20')](function(_0xbe2a4c){_0x4c60b0(_0x28e3a3['error'](0x1f4,_0xbe2a4c[_0xb087('0x1b')]));});});},'EventManager':function(_0x537888){var _0x5194fe=this;return new Promise(function(_0x92700d,_0x16a6cb){if(!_0x537888[_0xb087('0x80')]){return _0x16a6cb(_0x5194fe[_0xb087('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xb087('0x81')](_0xb087('0x82')+_0x537888['event'],_0x537888[_0xb087('0x1b')]);_0x92700d({'code':0xc8,'message':_0x537888});});},'FaxAccounts':function(){return new Promise(function(_0x4a2867){var _0x53af09=_[_0xb087('0x60')](_0xf1cf84[_0xb087('0x83')]);_0x4a2867({'count':_0x53af09[_0xb087('0x5b')],'rows':_0x53af09});});},'SendFax':function(_0x1b03a3){var _0x2e67d3=this;return new Promise(function(_0x4a88f2,_0x3cf818){_0x46e106[_0xb087('0x84')](_0x1b03a3)[_0xb087('0x1a')](function(_0x11c0a3){_0x4a88f2({'code':0xc8,'message':_0x11c0a3['message']});})['catch'](function(_0x544a68){_0x3cf818(_0x2e67d3['error'](0x1f4,_0x544a68[_0xb087('0x1b')]));});});},'CheckAfterSend':function(_0x3296c9){var _0x10e4b6=this;return new Promise(function(_0x4708f2,_0x1e55ca){_0x46e106[_0xb087('0x85')](_0x3296c9)[_0xb087('0x1a')](function(_0x4f084f){_0x4708f2({'code':0xc8,'message':_0x4f084f['message']});})[_0xb087('0x20')](function(_0x13d558){_0x1e55ca(_0x10e4b6[_0xb087('0x11')](0x1f4,_0x13d558[_0xb087('0x1b')]));});});}};var _0x4e6c80=jayson[_0xb087('0x86')](_0xecf080)['http']();_0x4e6c80['on'](_0xb087('0x11'),function(_0x50b293){return _0x17d6e8(_0x50b293);});_0x4e6c80[_0xb087('0x5')](0x232a,_0xb087('0x87'),function(){console[_0xb087('0x88')](_0xb087('0x89'),0x232a);return _0x40156d('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xad95=['isConnected','command','Command','voiceQueues','hasOwnProperty','name','answered','loggedIn','sumDuration','sumHoldTime','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','undefined','values','channels','username','voicechannel','validate','find','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','map','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','../../../config/environment','../properties','format','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','catch','error','message'];(function(_0x3f11cd,_0x59ac25){var _0x3ac4a9=function(_0x5c567c){while(--_0x5c567c){_0x3f11cd['push'](_0x3f11cd['shift']());}};_0x3ac4a9(++_0x59ac25);}(_0xad95,0x70));var _0x5ad9=function(_0x41a023,_0x585d89){_0x41a023=_0x41a023-0x0;var _0x5699f6=_0xad95[_0x41a023];return _0x5699f6;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var jayson=require(_0x5ad9('0x2'));var schema=require('validate');var moment=require('moment');var config=require(_0x5ad9('0x3'));var properties=require(_0x5ad9('0x4'));var ami=require('../ami');exports['listen']=function(_0x185bff,_0x5277fa,_0x4ccfdf){return new Promise(function(_0x5e4279,_0x5b81f9){var _0x2bef4e={'QueuePause':function(_0x117fde){return new Promise(function(_0x2a0915){var _0x3d937a=util[_0x5ad9('0x5')]('%s/%s',_0x5ad9('0x6'),_0x117fde['name']);if(_0x185bff['timers']&&_0x185bff[_0x5ad9('0x7')][_0x3d937a]&&_0x185bff[_0x5ad9('0x7')][_0x3d937a][_0x5ad9('0x8')]){_0x185bff['timers'][_0x3d937a][_0x5ad9('0x9')]();}if(_0x185bff[_0x5ad9('0xa')][_0x3d937a]){_0x185bff['agents'][_0x3d937a][_0x5ad9('0xb')]({'statePause':_0x117fde[_0x5ad9('0xc')]?!![]:![]});}_0x2a0915({'code':0xc8,'message':_0x5ad9('0xd')});});},'Reload':function(_0x3b2718){var _0x262ce4=this;return new Promise(function(_0xc7e5e9,_0x484c56){if(ami['isConnected']()==![]){return _0x484c56(_0x262ce4['error'](0x1f4,[config[_0x5ad9('0xe')]['ip'],config[_0x5ad9('0xe')]['username'],_0x5ad9('0xf')][_0x5ad9('0x10')]('\x20')));}_0x3b2718=_[_0x5ad9('0x11')](_0x3b2718,_[_0x5ad9('0x12')](properties[_0x5ad9('0x13')]));_0x3b2718[_0x5ad9('0x14')]=_0x5ad9('0x15');return ami[_0x5ad9('0x16')](_0x3b2718)[_0x5ad9('0x17')](function(_0x390d96){_0xc7e5e9({'code':0xc8,'message':_0x390d96['message']});})[_0x5ad9('0x18')](function(_0x54f392){_0x484c56(_0x262ce4[_0x5ad9('0x19')](0x1f5,_0x54f392[_0x5ad9('0x1a')]));});});},'Command':function(_0xe4171b){var _0xb83249=this;return new Promise(function(_0x1c5ab7,_0x2ba5c0){if(ami[_0x5ad9('0x1b')]()==![]){return _0x2ba5c0(_0xb83249['error'](0x1f4,[config[_0x5ad9('0xe')]['ip'],config['asterisk']['username'],_0x5ad9('0xf')]['join']('\x20')));}_0xe4171b=_[_0x5ad9('0x11')](_0xe4171b,_0x5ad9('0x1c'));_0xe4171b[_0x5ad9('0x14')]=_0x5ad9('0x1d');return ami[_0x5ad9('0x16')](_0xe4171b)['then'](function(_0x3d9fc0){_0x1c5ab7({'code':0xc8,'message':_0x3d9fc0['content']});})[_0x5ad9('0x18')](function(_0x5b816d){_0x2ba5c0(_0xb83249['error'](0x1f5,_0x5b816d['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x1502d6){var _0x3701d8=[];for(var _0x39a124 in _0x185bff[_0x5ad9('0x1e')]){if(_0x185bff[_0x5ad9('0x1e')][_0x5ad9('0x1f')](_0x39a124)){var _0x11d919=_0x185bff['voiceQueues'][_0x39a124];var _0x54e9dd={'id':_0x11d919['id'],'name':_0x11d919[_0x5ad9('0x20')],'strategy':_0x11d919['strategy'],'answered':_0x11d919[_0x5ad9('0x21')],'available':_0x11d919['available'],'loggedIn':_0x11d919[_0x5ad9('0x22')],'pTalking':_0x11d919['pTalking'],'sumBillable':_0x11d919['sumBillable'],'sumDuration':_0x11d919[_0x5ad9('0x23')],'sumHoldTime':_0x11d919[_0x5ad9('0x24')]||0x0,'talking':_0x11d919['talking'],'total':_0x11d919['total'],'type':_0x11d919[_0x5ad9('0x25')],'unmanaged':_0x11d919[_0x5ad9('0x26')],'abandoned':_0x11d919[_0x5ad9('0x27')],'waiting':_0x11d919[_0x5ad9('0x28')],'loggedInDb':_0x11d919[_0x5ad9('0x29')]};if(_0x11d919[_0x5ad9('0x25')]==='outbound'){_0x54e9dd[_0x5ad9('0x2a')]=_0x11d919[_0x5ad9('0x2a')];_0x54e9dd[_0x5ad9('0x2b')]=_0x11d919[_0x5ad9('0x2b')];_0x54e9dd['dialOriginateCallerIdName']=_0x11d919['dialOriginateCallerIdName'];_0x54e9dd[_0x5ad9('0x2c')]=_0x11d919[_0x5ad9('0x2c')];_0x54e9dd['dialOriginateTimeout']=_0x11d919['dialOriginateTimeout'];_0x54e9dd['dialPrefix']=_0x11d919[_0x5ad9('0x2d')];_0x54e9dd[_0x5ad9('0x2e')]=_0x11d919['temp'];_0x54e9dd[_0x5ad9('0x2f')]=_0x11d919[_0x5ad9('0x2f')];_0x54e9dd[_0x5ad9('0x30')]=_0x11d919[_0x5ad9('0x30')];_0x54e9dd['outboundBlacklistCallsDay']=_0x11d919['outboundBlacklistCallsDay'];_0x54e9dd[_0x5ad9('0x31')]=_0x11d919[_0x5ad9('0x31')];_0x54e9dd[_0x5ad9('0x32')]=_0x11d919[_0x5ad9('0x32')];_0x54e9dd[_0x5ad9('0x33')]=_0x11d919['outboundDropCallsDayACS'];_0x54e9dd[_0x5ad9('0x34')]=_0x11d919[_0x5ad9('0x34')];_0x54e9dd[_0x5ad9('0x35')]=_0x11d919[_0x5ad9('0x35')];_0x54e9dd[_0x5ad9('0x36')]=_0x11d919[_0x5ad9('0x36')];_0x54e9dd['outboundNoSuchCallsDay']=_0x11d919[_0x5ad9('0x37')];_0x54e9dd[_0x5ad9('0x38')]=_0x11d919['outboundOriginateFailureCallsDay'];_0x54e9dd[_0x5ad9('0x39')]=_0x11d919[_0x5ad9('0x39')];_0x54e9dd['outboundRejectCallsDay']=_0x11d919[_0x5ad9('0x3a')];_0x54e9dd[_0x5ad9('0x3b')]=_0x11d919[_0x5ad9('0x3b')];_0x54e9dd['predictiveIntervalAnsweredCalls']=_0x11d919[_0x5ad9('0x3c')];_0x54e9dd[_0x5ad9('0x3d')]=_0x11d919[_0x5ad9('0x3d')];_0x54e9dd[_0x5ad9('0x3e')]=_0x11d919['predictiveIntervalAvgTalktime'];_0x54e9dd[_0x5ad9('0x3f')]=_0x11d919[_0x5ad9('0x3f')];_0x54e9dd[_0x5ad9('0x40')]=_0x11d919[_0x5ad9('0x40')];_0x54e9dd[_0x5ad9('0x41')]=_0x11d919[_0x5ad9('0x41')];_0x54e9dd[_0x5ad9('0x42')]=_0x11d919[_0x5ad9('0x42')];_0x54e9dd[_0x5ad9('0x43')]=_0x11d919['predictiveIntervalHitRate'];_0x54e9dd[_0x5ad9('0x44')]=_0x11d919[_0x5ad9('0x44')];_0x54e9dd[_0x5ad9('0x45')]=_0x11d919[_0x5ad9('0x45')];_0x54e9dd[_0x5ad9('0x46')]=_0x11d919['predictiveIntervalAvailable'];_0x54e9dd[_0x5ad9('0x47')]=_0x11d919[_0x5ad9('0x47')];_0x54e9dd[_0x5ad9('0x1a')]=_0x11d919['message'];_0x54e9dd[_0x5ad9('0x48')]=_0x11d919[_0x5ad9('0x48')];_0x54e9dd[_0x5ad9('0x49')]=_0x11d919['erlangCalls'];_0x54e9dd[_0x5ad9('0x4a')]=_0x11d919['erlangCallToSecond'];_0x54e9dd['erlangAbandonmentRate']=_0x11d919[_0x5ad9('0x4b')];_0x54e9dd[_0x5ad9('0x4c')]=_0x11d919[_0x5ad9('0x4c')];_0x54e9dd[_0x5ad9('0x4d')]=_0x11d919['startPredictive'];_0x54e9dd['startProgressive']=_0x11d919[_0x5ad9('0x4e')];}if(_0x11d919['Trunk']){_0x54e9dd[_0x5ad9('0x4f')]={'id':_0x11d919['Trunk']['id'],'name':_0x11d919[_0x5ad9('0x4f')]['name'],'active':_0x11d919[_0x5ad9('0x4f')][_0x5ad9('0x50')],'callerid':_0x11d919[_0x5ad9('0x4f')][_0x5ad9('0x51')]};}if(_0x11d919[_0x5ad9('0x52')]){_0x54e9dd[_0x5ad9('0x52')]={'id':_0x11d919[_0x5ad9('0x52')]['id'],'name':_0x11d919[_0x5ad9('0x52')][_0x5ad9('0x20')]};}_0x3701d8['push'](_0x54e9dd);}}_0x1502d6({'count':_0x3701d8[_0x5ad9('0x53')],'rows':_0x3701d8});});},'UpdateVoiceQueue':function(_0x357de0){return new Promise(function(_0x85d80e,_0x5f337a){var _0x46af56=_['find'](_0x185bff[_0x5ad9('0x1e')],{'id':parseInt(_0x357de0['id'])});var _0x555c7a=_['omit'](_0x357de0,['id']);if(_0x46af56){for(var _0x4cccab in _0x555c7a){if(typeof _0x555c7a[_0x4cccab]!==_0x5ad9('0x54')&&typeof _0x46af56[_0x4cccab]!==_0x5ad9('0x54')){_0x46af56[_0x4cccab]=_0x555c7a[_0x4cccab];}}_0x85d80e(_0x46af56);}else{_0x5f337a();}});},'VoiceChannels':function(){return new Promise(function(_0x10bcf0){var _0x48b126=_[_0x5ad9('0x55')](_0x185bff[_0x5ad9('0x56')]);_0x10bcf0({'count':_0x48b126[_0x5ad9('0x53')],'rows':_0x48b126});});},'VoiceChannelMixMonitor':function(_0x217ef3){var _0x4f2287=this;return new Promise(function(_0x126086,_0x420677){if(ami[_0x5ad9('0x1b')]()==![]){return _0x420677(_0x4f2287[_0x5ad9('0x19')](0x1f4,[config['asterisk']['ip'],config[_0x5ad9('0xe')][_0x5ad9('0x57')],_0x5ad9('0xf')][_0x5ad9('0x10')]('\x20')));}var _0x479bbc=schema(properties[_0x5ad9('0x58')])[_0x5ad9('0x59')](_0x217ef3);if(_0x479bbc['length']>0x0){return _0x420677(_0x4f2287[_0x5ad9('0x19')](0x1f4,_['map'](_0x479bbc,_0x5ad9('0x1a'))[_0x5ad9('0x10')](',\x20')));}var _0x9671da=_[_0x5ad9('0x5a')](_0x185bff[_0x5ad9('0x56')],{'uniqueid':_0x217ef3[_0x5ad9('0x5b')]});if(_0x9671da&&_0x9671da[_0x5ad9('0x5c')]){var _0x2c3945=util[_0x5ad9('0x5')](_0x5ad9('0x5d'),_0x217ef3[_0x5ad9('0x5e')]||_0x217ef3[_0x5ad9('0x5b')],_0x217ef3[_0x5ad9('0x5')]||_0x5ad9('0x5f'));return ami[_0x5ad9('0x16')]({'action':'MixMonitor','channel':_0x9671da[_0x5ad9('0x5c')],'file':_0x2c3945,'options':_0x5ad9('0x60')})[_0x5ad9('0x17')](function(_0x28b14a){var _0x1c4f6e=_[_0x5ad9('0x5a')](_0x9671da[_0x5ad9('0x61')],{'filename':_0x5ad9('0x62')+_0x2c3945['toLowerCase']()});if(_[_0x5ad9('0x63')](_0x1c4f6e)){_0x9671da['monitors'][_0x5ad9('0x64')]({'filename':_0x5ad9('0x62')+_0x2c3945[_0x5ad9('0x65')](),'createdAt':moment()['format'](_0x5ad9('0x66')),'mixmonitorid':_0x28b14a[_0x5ad9('0x67')],'status':_0x5ad9('0x68')});}else{_0x1c4f6e['mixmonitorid']=_0x28b14a[_0x5ad9('0x67')];_0x1c4f6e['status']='rec';}_0x126086({'code':0xc8,'message':[_0x217ef3[_0x5ad9('0x5b')],_0x5ad9('0x69'),_0x28b14a['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x28b14a[_0x5ad9('0x67')]});})[_0x5ad9('0x18')](function(_0x7641b8){_0x420677(_0x4f2287[_0x5ad9('0x19')](0x1f5,[_0x217ef3[_0x5ad9('0x5b')],_0x7641b8[_0x5ad9('0x1a')][_0x5ad9('0x65')]()][_0x5ad9('0x10')]('\x20')));});}else{return _0x420677(_0x4f2287[_0x5ad9('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x13e6e5){var _0x3b233f=this;return new Promise(function(_0x4e0ace,_0x3afa73){if(ami[_0x5ad9('0x1b')]()==![]){return _0x3afa73(_0x3b233f[_0x5ad9('0x19')](0x1f4,[config['asterisk']['ip'],config[_0x5ad9('0xe')][_0x5ad9('0x57')],_0x5ad9('0xf')][_0x5ad9('0x10')]('\x20')));}var _0x426fbe=schema(properties[_0x5ad9('0x58')])[_0x5ad9('0x59')](_0x13e6e5);if(_0x426fbe[_0x5ad9('0x53')]>0x0){return _0x3afa73(_0x3b233f['error'](0x1f4,_[_0x5ad9('0x6a')](_0x426fbe,_0x5ad9('0x1a'))[_0x5ad9('0x10')](',\x20')));}var _0x2cf9d6=_[_0x5ad9('0x5a')](_0x185bff[_0x5ad9('0x56')],{'uniqueid':_0x13e6e5[_0x5ad9('0x5b')]});if(_0x2cf9d6){return Promise[_0x5ad9('0x6b')]()[_0x5ad9('0x17')](function(){if(_0x2cf9d6[_0x5ad9('0x5c')]){return ami[_0x5ad9('0x16')]({'action':_0x5ad9('0x6c'),'channel':_0x2cf9d6['channel'],'mixmonitorid':_0x13e6e5[_0x5ad9('0x67')]})[_0x5ad9('0x18')](function(){});}})[_0x5ad9('0x17')](function(){if(_0x2cf9d6[_0x5ad9('0x6d')]){return ami['Action']({'action':_0x5ad9('0x6c'),'channel':_0x2cf9d6['destinationchannel'],'mixmonitorid':_0x13e6e5[_0x5ad9('0x67')]})[_0x5ad9('0x18')](function(){});}})[_0x5ad9('0x17')](function(){var _0x58f355=_[_0x5ad9('0x5a')](_0x2cf9d6[_0x5ad9('0x61')],{'mixmonitorid':_0x13e6e5[_0x5ad9('0x67')]});if(_0x58f355){_0x58f355[_0x5ad9('0x6e')]=_0x5ad9('0x6f');}})[_0x5ad9('0x17')](function(){var _0x5f53aa=util[_0x5ad9('0x5')](_0x5ad9('0x5d'),_0x13e6e5['filename']||_0x13e6e5[_0x5ad9('0x5b')],_0x13e6e5[_0x5ad9('0x5')]||'wav');var _0xedf089=_[_0x5ad9('0x5a')](_0x2cf9d6['monitors'],{'filename':_0x5ad9('0x62')+_0x5f53aa[_0x5ad9('0x65')]()});if(_0xedf089){_0xedf089[_0x5ad9('0x6e')]='stop';}})[_0x5ad9('0x17')](function(){_0x4e0ace({'code':0xc8,'message':[_0x13e6e5[_0x5ad9('0x5b')],_0x5ad9('0x70')][_0x5ad9('0x10')]('\x20')});})[_0x5ad9('0x18')](function(_0x4cef75){_0x3afa73(_0x3b233f['error'](0x1f5,[_0x13e6e5['uniqueid'],_0x4cef75['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x3afa73(_0x3b233f['error'](0x1f5,_0x5ad9('0x71')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x28196b){var _0x44c93d=_[_0x5ad9('0x55')](_0x185bff[_0x5ad9('0x72')]);_0x28196b({'count':_0x44c93d[_0x5ad9('0x53')],'rows':_0x44c93d});});},'VoiceQueuesChannel':function(_0x247bff){var _0xc49b9a=this;return new Promise(function(_0x2ebff0,_0x54e1aa){var _0x39d82c=schema(properties[_0x5ad9('0x73')])['validate'](_0x247bff);if(_0x39d82c[_0x5ad9('0x53')]>0x0){return _0x54e1aa(_0xc49b9a['error'](0x1f4,_[_0x5ad9('0x6a')](_0x39d82c,_0x5ad9('0x1a'))[_0x5ad9('0x10')](',\x20')));}var _0x256daa=_[_0x5ad9('0x5a')](_0x185bff['queueChannels'],{'uniqueid':_0x247bff['uniqueid']});if(_0x256daa){_0x2ebff0(_0x256daa);}else{return _0x54e1aa(_0xc49b9a[_0x5ad9('0x19')](0x1f5,_0x5ad9('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x4528f1){var _0x4d25c0=this;return new Promise(function(_0xf9b1c1,_0x3320d5){if(ami[_0x5ad9('0x1b')]()==![]){return _0x3320d5(_0x4d25c0[_0x5ad9('0x19')](0x1f4,[config[_0x5ad9('0xe')]['ip'],config[_0x5ad9('0xe')][_0x5ad9('0x57')],_0x5ad9('0xf')][_0x5ad9('0x10')]('\x20')));}var _0x5ed431=schema(properties[_0x5ad9('0x74')])['validate'](_0x4528f1);if(_0x5ed431[_0x5ad9('0x53')]>0x0){return _0x3320d5(_0x4d25c0[_0x5ad9('0x19')](0x1f4,_[_0x5ad9('0x6a')](_0x5ed431,_0x5ad9('0x1a'))['join'](',\x20')));}var _0xfc15c8=_['find'](_0x185bff[_0x5ad9('0x72')],{'uniqueid':_0x4528f1[_0x5ad9('0x5b')]});if(_0xfc15c8&&_0xfc15c8[_0x5ad9('0x5c')]){return ami[_0x5ad9('0x16')]({'action':_0x5ad9('0x75'),'channel':_0xfc15c8[_0x5ad9('0x5c')]})[_0x5ad9('0x17')](function(_0xfd9960){_0xf9b1c1({'code':0xc8,'message':[_0x4528f1['uniqueid'],_0xfd9960['message'][_0x5ad9('0x65')]()][_0x5ad9('0x10')]('\x20')});})['catch'](function(_0x1014cc){_0x3320d5(_0x4d25c0[_0x5ad9('0x19')](0x1f5,[_0x4528f1[_0x5ad9('0x5b')],_0x1014cc[_0x5ad9('0x1a')][_0x5ad9('0x65')]()][_0x5ad9('0x10')]('\x20')));});}else{return _0x3320d5(_0x4d25c0[_0x5ad9('0x19')](0x1f5,_0x5ad9('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x5b95db){var _0x5131c5=this;return new Promise(function(_0x528a2a,_0x4c599c){if(ami['isConnected']()==![]){return _0x4c599c(_0x5131c5[_0x5ad9('0x19')](0x1f4,[config[_0x5ad9('0xe')]['ip'],config[_0x5ad9('0xe')][_0x5ad9('0x57')],_0x5ad9('0xf')]['join']('\x20')));}var _0x24b146=schema(properties[_0x5ad9('0x76')])[_0x5ad9('0x59')](_0x5b95db);if(_0x24b146[_0x5ad9('0x53')]>0x0){return _0x4c599c(_0x5131c5['error'](0x1f4,_['map'](_0x24b146,'message')[_0x5ad9('0x10')](',\x20')));}var _0x4d87ed=_[_0x5ad9('0x5a')](_0x185bff['queueChannels'],{'uniqueid':_0x5b95db['uniqueid']});if(_0x4d87ed&&_0x4d87ed[_0x5ad9('0x5c')]){return ami[_0x5ad9('0x16')]({'action':_0x5ad9('0x77'),'channel':_0x4d87ed[_0x5ad9('0x5c')],'exten':_0x5b95db[_0x5ad9('0x78')],'context':_0x5b95db[_0x5ad9('0x79')]||_0x4d87ed[_0x5ad9('0x79')],'priority':0x1})[_0x5ad9('0x17')](function(_0x33d821){_0x528a2a({'code':0xc8,'message':[_0x5b95db['uniqueid'],_0x33d821[_0x5ad9('0x1a')][_0x5ad9('0x65')]()][_0x5ad9('0x10')]('\x20')});})[_0x5ad9('0x18')](function(_0x2f1ac5){_0x4c599c(_0x5131c5[_0x5ad9('0x19')](0x1f5,[_0x5b95db['uniqueid'],_0x2f1ac5[_0x5ad9('0x1a')][_0x5ad9('0x65')]()][_0x5ad9('0x10')]('\x20')));});}else{return _0x4c599c(_0x5131c5[_0x5ad9('0x19')](0x1f5,_0x5ad9('0x71')));}});},'Agents':function(_0x28e8b3){return new Promise(function(_0x1bae3b){var _0x157f29=_[_0x5ad9('0x55')](_0x185bff[_0x5ad9('0xa')]);if(_0x28e8b3&&_0x28e8b3['id']){var _0x47946f=_[_0x5ad9('0x5a')](_0x157f29,function(_0xbe50d2){return _0xbe50d2['id']===_0x28e8b3['id'];});_0x1bae3b(_0x47946f);}else{_0x1bae3b({'count':_0x157f29[_0x5ad9('0x53')],'rows':_0x157f29});}});},'Telephones':function(){return new Promise(function(_0x2d2d62){var _0x5876f4=_[_0x5ad9('0x55')](_0x185bff[_0x5ad9('0x7a')]);_0x2d2d62({'count':_0x5876f4[_0x5ad9('0x53')],'rows':_0x5876f4});});},'Trunks':function(){return new Promise(function(_0x1be06c){var _0x1163d5=_[_0x5ad9('0x55')](_0x185bff[_0x5ad9('0x7b')]);_0x1be06c({'count':_0x1163d5['length'],'rows':_0x1163d5});});},'OutboundChannels':function(){return new Promise(function(_0x22c1e0){var _0x8cde16=_['values'](_0x185bff['outboundChannels']);_0x22c1e0({'count':_0x8cde16[_0x5ad9('0x53')],'rows':_0x8cde16});});},'Outbound':function(){return new Promise(function(_0x12fc20){_0x12fc20(_0x185bff[_0x5ad9('0x7c')]);});},'Campaigns':function(){return new Promise(function(_0xf2b5){var _0x3b05f0=_['values'](_0x185bff[_0x5ad9('0x7d')]);_0xf2b5({'count':_0x3b05f0[_0x5ad9('0x53')],'rows':_0x3b05f0});});},'VoiceQueuesPreview':function(_0xd39b28){var _0x116ab1=this;return new Promise(function(_0xca6353,_0x2a39af){_0x5277fa[_0x5ad9('0x7e')](_0xd39b28['id'])[_0x5ad9('0x17')](function(_0x1bea45){_0xca6353({'code':0xc8,'message':_0x1bea45[_0x5ad9('0x1a')]});})[_0x5ad9('0x18')](function(_0x91184f){_0x2a39af(_0x116ab1[_0x5ad9('0x19')](0x1f4,_0x91184f[_0x5ad9('0x1a')]));});});},'EventManager':function(_0x27155c){var _0x9ebf8a=this;return new Promise(function(_0x1c0412,_0x9d23f9){if(!_0x27155c[_0x5ad9('0x7f')]){return _0x9d23f9(_0x9ebf8a['error'](0x1f4,_0x5ad9('0x80')));}ami[_0x5ad9('0x81')](_0x5ad9('0x82')+_0x27155c[_0x5ad9('0x7f')],_0x27155c['message']);_0x1c0412({'code':0xc8,'message':_0x27155c});});},'FaxAccounts':function(){return new Promise(function(_0x269e80){var _0x4400d0=_[_0x5ad9('0x55')](_0x185bff[_0x5ad9('0x83')]);_0x269e80({'count':_0x4400d0[_0x5ad9('0x53')],'rows':_0x4400d0});});},'SendFax':function(_0x47b664){var _0x5c5851=this;return new Promise(function(_0x4a9160,_0x2ab5e8){_0x4ccfdf[_0x5ad9('0x84')](_0x47b664)[_0x5ad9('0x17')](function(_0x193481){_0x4a9160({'code':0xc8,'message':_0x193481[_0x5ad9('0x1a')]});})[_0x5ad9('0x18')](function(_0x4d8ffc){_0x2ab5e8(_0x5c5851[_0x5ad9('0x19')](0x1f4,_0x4d8ffc[_0x5ad9('0x1a')]));});});},'CheckAfterSend':function(_0x4e4f76){var _0x36e6ba=this;return new Promise(function(_0x1771e4,_0x442ca6){_0x4ccfdf[_0x5ad9('0x85')](_0x4e4f76)[_0x5ad9('0x17')](function(_0x3cc2df){_0x1771e4({'code':0xc8,'message':_0x3cc2df['message']});})['catch'](function(_0x558fd7){_0x442ca6(_0x36e6ba[_0x5ad9('0x19')](0x1f4,_0x558fd7[_0x5ad9('0x1a')]));});});}};var _0x32a123=jayson[_0x5ad9('0x86')](_0x2bef4e)['http']();_0x32a123['on']('error',function(_0x1f02c2){return _0x5b81f9(_0x1f02c2);});_0x32a123[_0x5ad9('0x87')](0x232a,_0x5ad9('0x88'),function(){console[_0x5ad9('0x89')](_0x5ad9('0x8a'),0x232a);return _0x5e4279('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 3d9ed34..dfc7cc6 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 _0x00e3=['updatedAt','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','destcalleridname','','Unknown','then','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','map','routeId','destcalleridnum','calleridnum','firstName','phone','mobile','fax','scheduledAt'];(function(_0x4885d6,_0x8d92fb){var _0x38291c=function(_0x57fb16){while(--_0x57fb16){_0x4885d6['push'](_0x4885d6['shift']());}};_0x38291c(++_0x8d92fb);}(_0x00e3,0x8f));var _0x300e=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x00e3[_0x406e46];return _0x4a3742;};'use strict';var _=require(_0x300e('0x0'));var BPromise=require(_0x300e('0x1'));var Redis=require(_0x300e('0x2'));var util=require(_0x300e('0x3'));var config=require(_0x300e('0x4'));var logger=require(_0x300e('0x5'))(_0x300e('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0x300e('0x7')]=_[_0x300e('0x8')](config[_0x300e('0x7')],{'host':_0x300e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5159d1,_0x13540a,_0x29646b,_0x27f3fd,_0x18b9f3){logger[_0x300e('0xa')](_0x300e('0xb'),_0x5159d1,_0x13540a['id'],_0x29646b,_0x27f3fd,JSON['stringify'](_0x18b9f3));io['to'](_0x29646b)[_0x300e('0xc')](_0x27f3fd,_0x18b9f3);}exports[_0x300e('0xd')]=function(_0x24bcf1,_0x152a10,_0x410f31,_0x2639ca){var _0x29fb96,_0x1c18fc;var _0x114755={};var _0x14754;var _0x51e412=Number(_0x410f31[_0x300e('0xe')]);var _0x2e1a00=_0x410f31[_0x300e('0xf')]?Boolean(Number(_0x410f31[_0x300e('0xf')])):![];var _0x1da462;var _0x263a9f=![];if(!_[_0x300e('0x10')](_0x410f31[_0x300e('0x11')])){if(_0x410f31[_0x300e('0x11')]=='1')_0x263a9f=!![];}if(!_0x263a9f){if(_0x2639ca[_0x300e('0x12')]){_0x114755['id']=_0x2639ca['xmd-contactid'];}}if(!_0x114755['id']){_0x114755[_0x300e('0x13')]=_0x51e412;_0x1da462=_0x410f31[_0x300e('0x14')]&&_0x410f31[_0x300e('0x14')]!=='0'?_0x410f31['data3'][_0x300e('0x15')](','):['phone'];_0x114755['$or']=_[_0x300e('0x16')](_0x1da462,function(_0x4f2c22){var _0x587b8c={};_0x587b8c[_0x4f2c22]=_0x2639ca[_0x300e('0x17')]?_0x2639ca[_0x300e('0x18')]:_0x2639ca[_0x300e('0x19')];return _0x587b8c;});_0x14754=_0x2639ca[_0x300e('0x17')]?_0x2639ca[_0x300e('0x18')]:_0x2639ca['calleridnum'];}var _0x2aeeba=['id',_0x300e('0x1a'),'lastName',_0x300e('0x1b'),_0x300e('0x1c'),_0x300e('0x1d'),_0x300e('0x13'),'createdAt',_0x300e('0x1e'),_0x300e('0x1f')];var _0x493640=_['union'](_0x2aeeba,_0x1da462);BPromise[_0x300e('0x20')]()['then'](cmContactRpc[_0x300e('0x21')]({'attributes':_0x493640,'where':_0x114755,'phone':_0x14754}))['then'](function(_0x5489b6){_0x1c18fc=_0x5489b6;if(!_[_0x300e('0x22')](_0x1c18fc)){if(_0x1c18fc[_0x300e('0x23')]===0x1){_0x29fb96=_0x1c18fc[0x0];logger[_0x300e('0xa')](_0x300e('0x24'),_0x2639ca['uniqueid'],_0x152a10['id'],_0x29fb96['id']);}else{logger[_0x300e('0xa')](_0x300e('0x25'),_0x2639ca[_0x300e('0x26')],_0x152a10['id'],_['map'](_0x1c18fc,'id')[_0x300e('0x27')](','));}return;}else{logger[_0x300e('0xa')](_0x300e('0x28'),_0x2639ca[_0x300e('0x26')],_0x152a10['id']);var _0x4c5f85={'ListId':_0x51e412};var _0x31aeb7=_0x410f31[_0x300e('0x29')]&&_0x410f31[_0x300e('0x29')]!=='0'?_0x410f31['data4']:_0x300e('0x1b');if(_0x2e1a00){logger[_0x300e('0xa')](_0x300e('0x2a'),_0x2639ca[_0x300e('0x26')],_0x152a10['id']);_0x4c5f85[_0x31aeb7]=_['isNil'](_0x2639ca[_0x300e('0x17')])?_0x2639ca['calleridnum']:_0x2639ca[_0x300e('0x18')];if(_['isNil'](_0x2639ca[_0x300e('0x17')])){_0x4c5f85[_0x300e('0x1a')]=_0x2639ca[_0x300e('0x2b')]&&_0x2639ca[_0x300e('0x2b')]!==''?_0x2639ca[_0x300e('0x2b')]:'Unknown';}else{_0x4c5f85[_0x300e('0x1a')]=_0x2639ca[_0x300e('0x2c')]&&_0x2639ca[_0x300e('0x2c')]!==_0x300e('0x2d')?_0x2639ca['destcalleridname']:_0x300e('0x2e');}return BPromise['resolve']()[_0x300e('0x2f')](cmContactRpc[_0x300e('0x30')](_0x4c5f85))['then'](function(_0x51db8b){_0x29fb96=_0x51db8b;_0x1c18fc[_0x300e('0x31')](_0x51db8b);if(_0x29fb96){logger[_0x300e('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2639ca[_0x300e('0x26')],_0x152a10['id'],_0x29fb96['id']);}return;});}else{logger[_0x300e('0xa')](_0x300e('0x32'),_0x2639ca[_0x300e('0x26')],_0x152a10['id']);_0x4c5f85[_0x31aeb7]=_[_0x300e('0x10')](_0x2639ca[_0x300e('0x17')])?_0x2639ca['calleridnum']:_0x2639ca['destcalleridnum'];if(_[_0x300e('0x10')](_0x2639ca['routeId'])){_0x4c5f85[_0x300e('0x1a')]=_0x2639ca[_0x300e('0x2b')]&&_0x2639ca[_0x300e('0x2b')]!==_0x300e('0x2d')?_0x2639ca[_0x300e('0x2b')]:'Unknown';}else{_0x4c5f85['firstName']=_0x2639ca[_0x300e('0x2c')]&&_0x2639ca[_0x300e('0x2c')]!==''?_0x2639ca[_0x300e('0x2c')]:'Unknown';}_0x29fb96=_0x4c5f85;_0x1c18fc['push'](_0x4c5f85);return;}}})[_0x300e('0x2f')](function(){if(_0x24bcf1){emit(_0x2639ca[_0x300e('0x26')],_0x152a10,util['format'](_0x300e('0x33'),_0x24bcf1[_0x300e('0x34')]),util[_0x300e('0x35')](_0x300e('0x36'),_0x410f31[_0x300e('0x37')][_0x300e('0x38')]()),{'evt':_[_0x300e('0x39')](_0x2639ca,{'autoCreate':_0x2e1a00}),'contact':_0x29fb96===undefined?{}:_0x29fb96,'contacts':_0x1c18fc[_0x300e('0x23')]===0x0?undefined:_0x1c18fc});}});}; \ No newline at end of file +var _0xceb2=['util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','emit','exec','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','union','resolve','then','info','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','action','merge','length','lodash','bluebird','ioredis'];(function(_0x2adcc5,_0x15ce46){var _0x547758=function(_0xa13fd5){while(--_0xa13fd5){_0x2adcc5['push'](_0x2adcc5['shift']());}};_0x547758(++_0x15ce46);}(_0xceb2,0xa2));var _0x2ceb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xceb2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ceb('0x0'));var BPromise=require(_0x2ceb('0x1'));var Redis=require(_0x2ceb('0x2'));var util=require(_0x2ceb('0x3'));var config=require(_0x2ceb('0x4'));var logger=require(_0x2ceb('0x5'))(_0x2ceb('0x6'));var cmContactRpc=require(_0x2ceb('0x7'));config[_0x2ceb('0x8')]=_[_0x2ceb('0x9')](config[_0x2ceb('0x8')],{'host':_0x2ceb('0xa'),'port':0x18eb});var io=require(_0x2ceb('0xb'))(new Redis(config['redis']));function emit(_0x82470c,_0x44062d,_0x2bbf06,_0x25dd34,_0x48773a){logger['info'](_0x2ceb('0xc'),_0x82470c,_0x44062d['id'],_0x2bbf06,_0x25dd34,JSON['stringify'](_0x48773a));io['to'](_0x2bbf06)[_0x2ceb('0xd')](_0x25dd34,_0x48773a);}exports[_0x2ceb('0xe')]=function(_0x2df2ac,_0x56bb7d,_0x8d172c,_0x224809){var _0x22e1a1,_0x38bc52;var _0x77e89e={};var _0x2cf92e;var _0x13e628=Number(_0x8d172c['data1']);var _0x4c031a=_0x8d172c['data2']?Boolean(Number(_0x8d172c['data2'])):![];var _0x2da827;var _0x1098f2=![];if(!_[_0x2ceb('0xf')](_0x8d172c[_0x2ceb('0x10')])){if(_0x8d172c[_0x2ceb('0x10')]=='1')_0x1098f2=!![];}if(!_0x1098f2){if(_0x224809[_0x2ceb('0x11')]){_0x77e89e['id']=_0x224809[_0x2ceb('0x11')];}}if(!_0x77e89e['id']){_0x77e89e[_0x2ceb('0x12')]=_0x13e628;_0x2da827=_0x8d172c[_0x2ceb('0x13')]&&_0x8d172c[_0x2ceb('0x13')]!=='0'?_0x8d172c[_0x2ceb('0x13')][_0x2ceb('0x14')](','):[_0x2ceb('0x15')];_0x77e89e[_0x2ceb('0x16')]=_[_0x2ceb('0x17')](_0x2da827,function(_0x5e3588){var _0x2a5791={};_0x2a5791[_0x5e3588]=_0x224809[_0x2ceb('0x18')]?_0x224809['destcalleridnum']:_0x224809['calleridnum'];return _0x2a5791;});_0x2cf92e=_0x224809[_0x2ceb('0x18')]?_0x224809[_0x2ceb('0x19')]:_0x224809[_0x2ceb('0x1a')];}var _0x2a2af7=['id',_0x2ceb('0x1b'),_0x2ceb('0x1c'),_0x2ceb('0x15'),_0x2ceb('0x1d'),_0x2ceb('0x1e'),'ListId','createdAt',_0x2ceb('0x1f'),_0x2ceb('0x20')];var _0x2352fa=_[_0x2ceb('0x21')](_0x2a2af7,_0x2da827);BPromise[_0x2ceb('0x22')]()[_0x2ceb('0x23')](cmContactRpc['getContacts']({'attributes':_0x2352fa,'where':_0x77e89e,'phone':_0x2cf92e}))[_0x2ceb('0x23')](function(_0x389dfd){_0x38bc52=_0x389dfd;if(!_['isEmpty'](_0x38bc52)){if(_0x38bc52['length']===0x1){_0x22e1a1=_0x38bc52[0x0];logger[_0x2ceb('0x24')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x224809[_0x2ceb('0x25')],_0x56bb7d['id'],_0x22e1a1['id']);}else{logger[_0x2ceb('0x24')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x224809[_0x2ceb('0x25')],_0x56bb7d['id'],_[_0x2ceb('0x17')](_0x38bc52,'id')[_0x2ceb('0x26')](','));}return;}else{logger[_0x2ceb('0x24')](_0x2ceb('0x27'),_0x224809[_0x2ceb('0x25')],_0x56bb7d['id']);var _0x4e9d0b={'ListId':_0x13e628};var _0x54e398=_0x8d172c[_0x2ceb('0x28')]&&_0x8d172c[_0x2ceb('0x28')]!=='0'?_0x8d172c[_0x2ceb('0x28')]:_0x2ceb('0x15');if(_0x4c031a){logger[_0x2ceb('0x24')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x224809[_0x2ceb('0x25')],_0x56bb7d['id']);_0x4e9d0b[_0x54e398]=_[_0x2ceb('0xf')](_0x224809['routeId'])?_0x224809[_0x2ceb('0x1a')]:_0x224809[_0x2ceb('0x19')];if(_[_0x2ceb('0xf')](_0x224809[_0x2ceb('0x18')])){_0x4e9d0b[_0x2ceb('0x1b')]=_0x224809[_0x2ceb('0x29')]&&_0x224809[_0x2ceb('0x29')]!==_0x2ceb('0x2a')?_0x224809[_0x2ceb('0x29')]:_0x2ceb('0x2b');}else{_0x4e9d0b[_0x2ceb('0x1b')]=_0x224809[_0x2ceb('0x2c')]&&_0x224809[_0x2ceb('0x2c')]!==_0x2ceb('0x2a')?_0x224809[_0x2ceb('0x2c')]:'Unknown';}return BPromise[_0x2ceb('0x22')]()[_0x2ceb('0x23')](cmContactRpc['createContact'](_0x4e9d0b))[_0x2ceb('0x23')](function(_0x1234b0){_0x22e1a1=_0x1234b0;_0x38bc52[_0x2ceb('0x2d')](_0x1234b0);if(_0x22e1a1){logger[_0x2ceb('0x24')](_0x2ceb('0x2e'),_0x224809[_0x2ceb('0x25')],_0x56bb7d['id'],_0x22e1a1['id']);}return;});}else{logger[_0x2ceb('0x24')](_0x2ceb('0x2f'),_0x224809['uniqueid'],_0x56bb7d['id']);_0x4e9d0b[_0x54e398]=_[_0x2ceb('0xf')](_0x224809[_0x2ceb('0x18')])?_0x224809[_0x2ceb('0x1a')]:_0x224809[_0x2ceb('0x19')];if(_[_0x2ceb('0xf')](_0x224809[_0x2ceb('0x18')])){_0x4e9d0b['firstName']=_0x224809[_0x2ceb('0x29')]&&_0x224809[_0x2ceb('0x29')]!==_0x2ceb('0x2a')?_0x224809[_0x2ceb('0x29')]:_0x2ceb('0x2b');}else{_0x4e9d0b[_0x2ceb('0x1b')]=_0x224809['destcalleridname']&&_0x224809[_0x2ceb('0x2c')]!==_0x2ceb('0x2a')?_0x224809[_0x2ceb('0x2c')]:_0x2ceb('0x2b');}_0x22e1a1=_0x4e9d0b;_0x38bc52[_0x2ceb('0x2d')](_0x4e9d0b);return;}}})[_0x2ceb('0x23')](function(){if(_0x2df2ac){emit(_0x224809[_0x2ceb('0x25')],_0x56bb7d,util['format'](_0x2ceb('0x30'),_0x2df2ac[_0x2ceb('0x31')]),util[_0x2ceb('0x32')](_0x2ceb('0x33'),_0x8d172c[_0x2ceb('0x34')]['toLowerCase']()),{'evt':_[_0x2ceb('0x35')](_0x224809,{'autoCreate':_0x4c031a}),'contact':_0x22e1a1===undefined?{}:_0x22e1a1,'contacts':_0x38bc52[_0x2ceb('0x36')]===0x0?undefined:_0x38bc52});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 0870ecc..8f2070d 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 _0x8d0a=['operator','AccountId','message','queue','membername','lastevent','mailSubstatus','substatus','offlineMessage','exports','util','lodash','url','ioredis','./urlforward','./cmContact','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:amd','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','info','stringify','prototype','clone','motionChannel','undefined','checkTriggers','hasOwnProperty','status','checkTrigger','variables','Actions','length','action','toLowerCase','motionbar','data1','html','data2','render','template\x20not\x20found','uri','data3','isNil','location','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','interface','name','trigger:%s:%s','merge','trigger:%s','contactmanager','integration','exec','accounts','voiceExtensions','routeId','urlforward','buildUri','parse','query','search','AllConditions','every','AnyConditions','checkConditions','channel','field','account','ChatWebsiteId','value','upperFirst'];(function(_0x2a8cb7,_0x314d29){var _0x183a1f=function(_0x7f65bc){while(--_0x7f65bc){_0x2a8cb7['push'](_0x2a8cb7['shift']());}};_0x183a1f(++_0x314d29);}(_0x8d0a,0x172));var _0xa8d0=function(_0x34267d,_0x18ff77){_0x34267d=_0x34267d-0x0;var _0x26c45c=_0x8d0a[_0x34267d];return _0x26c45c;};'use strict';var util=require(_0xa8d0('0x0'));var _=require(_0xa8d0('0x1'));var url=require(_0xa8d0('0x2'));var Mustache=require('mustache');var Redis=require(_0xa8d0('0x3'));var urlforward=require(_0xa8d0('0x4'));var integration=require('./integration');var cmContact=require(_0xa8d0('0x5'));var script=require(_0xa8d0('0x6'));var config=require(_0xa8d0('0x7'));var logger=require('../../../config/logger')(_0xa8d0('0x8'));var ami=require(_0xa8d0('0x9'));config[_0xa8d0('0xa')]=_[_0xa8d0('0xb')](config[_0xa8d0('0xa')],{'host':_0xa8d0('0xc'),'port':0x18eb});var io=require(_0xa8d0('0xd'))(new Redis(config[_0xa8d0('0xa')]));var operators={'equals':function(_0xfd25a6,_0x3ee826){return _0xfd25a6==_0x3ee826;},'not_equals':function(_0x4550cf,_0x9fee79){return _0x4550cf!=_0x9fee79;}};var barAndWebActions=[_0xa8d0('0xe'),_0xa8d0('0x2'),_0xa8d0('0xf')];function Trigger(_0xe516eb){this[_0xa8d0('0x10')]=_0xe516eb[_0xa8d0('0x10')];this[_0xa8d0('0x11')]=_0xe516eb[_0xa8d0('0x11')];this['voiceQueues']=_0xe516eb['voiceQueues'];this[_0xa8d0('0x12')]=_0xe516eb[_0xa8d0('0x12')];this['voiceExtensions']=_0xe516eb['voiceExtensions'];this[_0xa8d0('0x13')]=_0xe516eb[_0xa8d0('0x13')];this[_0xa8d0('0x14')]=_0xe516eb[_0xa8d0('0x14')];this[_0xa8d0('0x15')]=_0xe516eb[_0xa8d0('0x15')];this[_0xa8d0('0x16')]=_0xe516eb[_0xa8d0('0x16')];this[_0xa8d0('0x17')]=_0xe516eb[_0xa8d0('0x17')];this[_0xa8d0('0x18')]=_0xe516eb['deskAccounts'];this[_0xa8d0('0x19')]=_0xe516eb[_0xa8d0('0x19')];this['servicenowAccounts']=_0xe516eb[_0xa8d0('0x1a')];this[_0xa8d0('0x1b')]=_0xe516eb[_0xa8d0('0x1b')];this[_0xa8d0('0x1c')]=_0xe516eb[_0xa8d0('0x1c')];this['accounts']={'zendesk':this[_0xa8d0('0x13')],'salesforce':this[_0xa8d0('0x15')],'freshdesk':this[_0xa8d0('0x14')],'sugarcrm':this[_0xa8d0('0x16')],'zoho':this[_0xa8d0('0x17')],'desk':this[_0xa8d0('0x18')],'vtiger':this[_0xa8d0('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xa8d0('0x1c')],'servicenow':this[_0xa8d0('0x1a')]};ami['on'](_0xa8d0('0x1d'),this[_0xa8d0('0x1e')]['bind'](this));ami['on'](_0xa8d0('0x1f'),this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x21'),this['syncCustomEvent'][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x22'),this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on']('custom:agentnosuchnumber',this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x23'),this['syncCustomEvent'][_0xa8d0('0x20')](this));ami['on']('custom:agentbusy',this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0xa8d0('0x20')](this));ami['on']('custom:agentreject',this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x24'),this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x25'),this['syncCustomEvent']['bind'](this));ami['on']('custom:dialbegin',this[_0xa8d0('0x26')][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x27'),this[_0xa8d0('0x26')][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x28'),this[_0xa8d0('0x26')]['bind'](this));ami['on'](_0xa8d0('0x29'),this['syncCustomEvent'][_0xa8d0('0x20')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent']['bind'](this));ami['on']('custom:substatus',this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x2a'),this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x2b'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa8d0('0x2c'),this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));ami['on'](_0xa8d0('0x2d'),this[_0xa8d0('0x1e')][_0xa8d0('0x20')](this));}Trigger['prototype'][_0xa8d0('0x2e')]=function(_0x1f474e,_0x2d1b58,_0x48a087){logger[_0xa8d0('0x2f')](_0x1f474e,_0x2d1b58,JSON[_0xa8d0('0x30')](_0x48a087));io['to'](_0x1f474e)[_0xa8d0('0x2e')](_0x2d1b58,_0x48a087);};Trigger[_0xa8d0('0x31')][_0xa8d0('0x1e')]=function(_0x5b79f8){var _0x133d39=_[_0xa8d0('0x32')](_0x5b79f8);if(typeof _0x133d39[_0xa8d0('0x33')]===_0xa8d0('0x34')){_0x133d39[_0xa8d0('0x33')]='voice';}this[_0xa8d0('0x35')](_0x133d39);};Trigger['prototype'][_0xa8d0('0x26')]=function(_0x672de2){if(this[_0xa8d0('0x11')][_0x672de2['interface']]){this[_0xa8d0('0x1e')](_0x672de2);}};Trigger[_0xa8d0('0x31')][_0xa8d0('0x35')]=function(_0x4ab119){var _0x26524f;for(var _0x3c8d89 in this[_0xa8d0('0x10')]){if(this[_0xa8d0('0x10')][_0xa8d0('0x36')](_0x3c8d89)){if(this[_0xa8d0('0x10')][_0x3c8d89][_0xa8d0('0x37')]){_0x26524f=this[_0xa8d0('0x38')](this[_0xa8d0('0x10')][_0x3c8d89],_0x4ab119);if(_0x26524f){_['merge'](_0x4ab119,_0x4ab119[_0xa8d0('0x39')]);for(var _0x1193f6=0x0,_0x27a938,_0x3c910c,_0x18d1ba;_0x1193f60x0){_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 +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x50864a,_0x23935a){var _0x30d3c0=function(_0x56b21d){while(--_0x56b21d){_0x50864a['push'](_0x50864a['shift']());}};_0x30d3c0(++_0x23935a);}(_0x3e74,0x175));var _0x43e7=function(_0x355beb,_0x205663){_0x355beb=_0x355beb-0x0;var _0x4ecbbc=_0x3e74[_0x355beb];return _0x4ecbbc;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index e04600f..f8b2c71 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 _0xff06=[']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','resolve','data5','clientId','remoteUri','username','password','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','POST','contacts','/systemusers(','substring','lastIndexOf','enduserId','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','nameField','customField','idField','indexOf','incident','incidents','assign','getString','Subjects','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','Descriptions','Bearer\x20','headers','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\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'];(function(_0x5d312b,_0x38cf18){var _0x4dd79c=function(_0x3b68ce){while(--_0x3b68ce){_0x5d312b['push'](_0x5d312b['shift']());}};_0x4dd79c(++_0x38cf18);}(_0xff06,0x155));var _0x6ff0=function(_0x1aaa57,_0x3b0b60){_0x1aaa57=_0x1aaa57-0x0;var _0x1e33ec=_0xff06[_0x1aaa57];return _0x1e33ec;};'use strict';var _=require(_0x6ff0('0x0'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0x6ff0('0x1'));var md5=require(_0x6ff0('0x2'));var Redis=require('ioredis');var logger=require(_0x6ff0('0x3'))(_0x6ff0('0x4'));var config=require(_0x6ff0('0x5'));config[_0x6ff0('0x6')]=_['defaults'](config[_0x6ff0('0x6')],{'host':_0x6ff0('0x7'),'port':0x18eb});var io=require(_0x6ff0('0x8'))(new Redis(config[_0x6ff0('0x6')]));function getAuthToken(_0x12b60f,_0x4e200c,_0xc9a828){if(_0x12b60f[_0x6ff0('0x9')]){_0x12b60f['remoteUri']=_0x12b60f[_0x6ff0('0xa')][_0x6ff0('0xb')];_0x12b60f[_0x6ff0('0xc')]=_0x12b60f[_0x6ff0('0xa')]['data2'];return Promise[_0x6ff0('0xd')](_0x12b60f[_0x6ff0('0xa')][_0x6ff0('0xe')]);}var _0x1e69da={'method':'POST','uri':_0x4e200c,'form':{'client_id':_0x12b60f[_0x6ff0('0xf')],'resource':_0x12b60f[_0x6ff0('0x10')],'username':_0x12b60f[_0x6ff0('0x11')],'password':_0x12b60f[_0x6ff0('0x12')],'grant_type':'password','client_secret':_0x12b60f['clientSecret']},'json':!![]};return rp(_0x1e69da)['then'](function(_0x38877e){return _0x38877e[_0x6ff0('0x13')];})[_0x6ff0('0x14')](function(_0x3b77d7){logger[_0x6ff0('0x15')]('['+[_0xc9a828[_0x6ff0('0x16')]()]+_0x6ff0('0x17'));return _0x3b77d7[_0x6ff0('0x18')];});}function getUser(_0x416416,_0x4e7ead,_0x271d0f,_0x278c67,_0x12e218,_0x1f2b69){return new Promise(function(_0x47894b,_0x253d26){return getAuthToken(_0x4e7ead,_0x278c67,_0x1f2b69)[_0x6ff0('0x19')](function(_0x4219e8){var _0x104078={'method':_0x6ff0('0x1a'),'uri':_0x12e218+_0x6ff0('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x4219e8,'OData-Version':_0x6ff0('0x1c')},'json':!![]};return rp(_0x104078);})['then'](function(_0x2fbf2e){var _0x123323=_0x2fbf2e[_0x6ff0('0x1d')];var _0x307125=![];var _0x531fa2=null;if(!_[_0x6ff0('0x1e')](_0x271d0f)){if(intUtil[_0x6ff0('0x1f')](_0x271d0f['email'])){_0x416416[_0x6ff0('0x20')]=_0x271d0f[_0x6ff0('0x21')];for(_0x531fa2=0x0;_0x531fa2<_0x123323[_0x6ff0('0x22')];_0x531fa2++){if(_0x123323[_0x531fa2][_0x6ff0('0x23')]===_0x271d0f[_0x6ff0('0x21')]&&!_0x123323[_0x531fa2]['isdisabled']){_0x307125=!![];logger[_0x6ff0('0x24')]('['+[_0x1f2b69['toUpperCase']()]+_0x6ff0('0x25')+_0x123323[_0x531fa2]['systemuserid']+'!');_0x416416[_0x6ff0('0x26')]=_0x123323[_0x531fa2]['systemuserid'];}}}}if(!_0x307125){logger[_0x6ff0('0x24')]('['+[_0x1f2b69[_0x6ff0('0x16')]()]+_0x6ff0('0x27'));_0x416416[_0x6ff0('0x20')]=_0x4e7ead[_0x6ff0('0x11')];for(_0x531fa2=0x0;_0x531fa2<_0x123323[_0x6ff0('0x22')];_0x531fa2++){if(_0x123323[_0x531fa2][_0x6ff0('0x23')]===_0x4e7ead[_0x6ff0('0x11')]){_0x416416['userId']=_0x123323[_0x531fa2]['systemuserid'];}}}_0x47894b(_0x416416);})[_0x6ff0('0x14')](function(_0x1df879){_0x253d26(_0x1df879['message']);});});}function createEndUser(_0x5529c9,_0x1c4baa,_0x46ac5d,_0x1f4d55,_0x3876a3,_0x49f4bb,_0xe058e9){return new Promise(function(_0x379f9e,_0x3dbeb2){return getAuthToken(_0x1c4baa,_0x46ac5d,_0x49f4bb)[_0x6ff0('0x19')](function(_0x47b827){var _0x5cf06d=_0x49f4bb[_0x6ff0('0x28')]()===_0x6ff0('0x29')?_0x3876a3[_0x6ff0('0x2a')]:_0x3876a3['calleridnum'];var _0x3ec6bd={'method':_0x6ff0('0x2b'),'uri':_0x1f4d55+_0x6ff0('0x2c'),'body':{'fullname':_0x5cf06d,'firstname':_0x5cf06d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6ff0('0x2d')+_0x5529c9['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x47b827,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x3ec6bd['body'][_0xe058e9]=_0x5cf06d;return rp(_0x3ec6bd);})[_0x6ff0('0x19')](function(_0x10f3f7){var _0x31d0f9=_0x10f3f7['headers']['odata-entityid'];var _0x25a564=_0x31d0f9[_0x6ff0('0x2e')](_0x31d0f9[_0x6ff0('0x2f')]('(')+0x1,_0x31d0f9[_0x6ff0('0x2f')](')'));_0x5529c9[_0x6ff0('0x30')]=_0x25a564;_0x379f9e(_0x5529c9);})[_0x6ff0('0x14')](function(_0x10d5b3){_0x3dbeb2(_0x10d5b3[_0x6ff0('0x18')]);});});}function getEndUser(_0x2a816c,_0x26902e,_0x559c7b,_0x1936d1,_0x29940c,_0x3d87dc,_0x1ccef2,_0x30cdc6){var _0x5e527=_0x3d87dc[_0x6ff0('0x28')]()===_0x6ff0('0x29')?_0x29940c['destcalleridnum']:_0x29940c[_0x6ff0('0x31')];return getAuthToken(_0x26902e,_0x559c7b,_0x3d87dc)[_0x6ff0('0x19')](function(_0x5350b2){_0x30cdc6=_0x30cdc6?_0x30cdc6:_0x6ff0('0x32');var _0x4ccb1e={'method':'GET','uri':_0x1936d1+_0x6ff0('0x33')+_0x30cdc6+_0x6ff0('0x34')+_0x30cdc6+_0x6ff0('0x35')+_0x5e527[_0x6ff0('0x36')]('+',_0x6ff0('0x37'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x5350b2,'If-None-Match':null,'OData-Version':_0x6ff0('0x1c')},'json':!![]};return rp(_0x4ccb1e);})[_0x6ff0('0x19')](function(_0x22c49d){var _0x32bd46=![];if(!_0x22c49d)return _0x32bd46;var _0x4e2b04=_0x22c49d['value'];for(var _0x45fdf5=0x0;_0x45fdf5<_0x4e2b04['length'];_0x45fdf5++){if(_0x4e2b04[_0x45fdf5][_0x30cdc6]===_0x5e527){_0x32bd46=!![];_0x2a816c[_0x6ff0('0x30')]=_0x4e2b04[_0x45fdf5][_0x6ff0('0x38')];}}return _0x32bd46;})['then'](function(_0x572c82){if(_0x572c82)return _0x2a816c;if(_0x1ccef2===_0x6ff0('0x39')){logger[_0x6ff0('0x24')]('['+[_0x3d87dc[_0x6ff0('0x16')]()]+_0x6ff0('0x3a'));return _0x2a816c;}return createEndUser(_0x2a816c,_0x26902e,_0x559c7b,_0x1936d1,_0x29940c,_0x3d87dc,_0x30cdc6)[_0x6ff0('0x19')](function(_0x32badd){logger[_0x6ff0('0x24')]('['+[_0x3d87dc[_0x6ff0('0x16')]()]+_0x6ff0('0x3b'),_0x32badd[_0x6ff0('0x30')]);return _0x32badd;});});}function getCustomFields(_0x40c5a0,_0x1e198b,_0x875c0){var _0x4ab6fd={};if(_0x40c5a0[_0x6ff0('0x22')]>0x0){_[_0x6ff0('0x3c')](_0x40c5a0,function(_0x2a0f10){if(_['includes']([_0x6ff0('0x3d'),_0x6ff0('0x3e')],_0x2a0f10['type'])&&_0x2a0f10[_0x6ff0('0x3f')]&&!_0x2a0f10[_0x6ff0('0x40')]){var _0x3a5b32=_0x2a0f10[_0x6ff0('0x41')]['toLowerCase']();var _0x5542e6=_0x3a5b32[_0x6ff0('0x2e')](0x0,_0x3a5b32[_0x6ff0('0x42')]('_'));var _0x59b7cf=_0x3a5b32['substring'](_0x3a5b32[_0x6ff0('0x42')]('_')+0x1);if(_0x5542e6===_0x875c0){_0x4ab6fd[_0x59b7cf]=_0x2a0f10['content'];}}});}return _0x4ab6fd;}function getTicket(_0x4d22ca,_0x533eb3,_0x467cd6,_0x48d060,_0x460e9f,_0x275251,_0x103d8a){return new Promise(function(_0x3b88a6,_0x1cc856){var _0x578c7f;return getAuthToken(_0x533eb3,_0x467cd6,_0x103d8a)['then'](function(_0x54c53b){if(_0x275251['ticketType']===_0x6ff0('0x43')){_0x578c7f={'method':_0x6ff0('0x2b'),'uri':_0x48d060+_0x6ff0('0x44'),'body':Object[_0x6ff0('0x45')]({},{'title':intUtil[_0x6ff0('0x46')](_0x275251[_0x6ff0('0x47')],_0x460e9f,'\x20'),'description':intUtil[_0x6ff0('0x46')](_0x275251['Descriptions'],_0x460e9f,'\x0a'),'customerid_contact@odata.bind':_0x4d22ca[_0x6ff0('0x30')]?_0x6ff0('0x48')+_0x4d22ca[_0x6ff0('0x30')]+')':undefined,'ownerid@odata.bind':_0x6ff0('0x2d')+_0x4d22ca[_0x6ff0('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x275251[_0x6ff0('0x49')],_0x460e9f,_0x275251[_0x6ff0('0x4a')])),'headers':{'Authorization':'Bearer\x20'+_0x54c53b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x275251[_0x6ff0('0x4a')]===_0x6ff0('0x4b')){var _0x36339a=_0x4d22ca[_0x6ff0('0x30')]?[{'partyid_systemuser@odata.bind':_0x6ff0('0x2d')+_0x4d22ca[_0x6ff0('0x26')]+')','participationtypemask':_0x4d22ca[_0x6ff0('0x4c')]===_0x6ff0('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x6ff0('0x48')+_0x4d22ca['enduserId']+')','participationtypemask':_0x4d22ca['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x6ff0('0x2d')+_0x4d22ca[_0x6ff0('0x26')]+')','participationtypemask':_0x4d22ca['callDirection']==='queue'?0x2:0x1}];_0x578c7f={'method':'POST','uri':_0x48d060+_0x6ff0('0x4e'),'body':Object[_0x6ff0('0x45')]({},{'subject':intUtil[_0x6ff0('0x46')](_0x275251['Subjects'],_0x460e9f,'\x20'),'phonenumber':String(_0x460e9f[_0x6ff0('0x31')]),'description':intUtil['getString'](_0x275251[_0x6ff0('0x4f')],_0x460e9f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4d22ca['enduserId']?_0x6ff0('0x48')+_0x4d22ca[_0x6ff0('0x30')]+')':undefined,'ownerid@odata.bind':_0x6ff0('0x2d')+_0x4d22ca['userId']+')','directioncode':_0x4d22ca[_0x6ff0('0x4c')]==='queue'?![]:!![],'phonecall_activity_parties':_0x36339a},getCustomFields(_0x275251[_0x6ff0('0x49')],_0x460e9f,_0x275251['ticketType'])),'headers':{'Authorization':_0x6ff0('0x50')+_0x54c53b,'OData-Version':_0x6ff0('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x578c7f);})[_0x6ff0('0x19')](function(_0x185646){var _0x5bc885=_0x185646[_0x6ff0('0x51')][_0x6ff0('0x52')];var _0x12f56f=_0x5bc885[_0x6ff0('0x2e')](_0x5bc885[_0x6ff0('0x2f')]('(')+0x1,_0x5bc885[_0x6ff0('0x2f')](')'));_0x4d22ca['ticketId']=_0x12f56f;_0x3b88a6(_0x4d22ca);})[_0x6ff0('0x14')](function(_0x1efb06){_0x1cc856(_0x1efb06[_0x6ff0('0x18')]);});});}function emit(_0x57db38,_0x2911cf,_0x576d6c,_0x273452){var _0x1da416={'uri':util[_0x6ff0('0x53')](_0x6ff0('0x54'),_0x57db38,_0x576d6c,_0x273452)};io['to'](util[_0x6ff0('0x53')](_0x6ff0('0x55'),_0x2911cf))[_0x6ff0('0x56')](_0x6ff0('0x57'),_0x1da416);}exports['cs']=function(_0x94830c,_0x5decb6,_0x1ca3cf,_0xda3aba,_0xcfe6a1,_0xaea66e,_0xb9b468,_0x23f793){var _0x459e0f={};_0xaea66e['remoteUri']=_0xaea66e[_0x6ff0('0x9')]?intUtil[_0x6ff0('0x58')](_0xaea66e[_0x6ff0('0xa')][_0x6ff0('0xb')]):intUtil[_0x6ff0('0x58')](_0xaea66e[_0x6ff0('0x10')]);_0xaea66e[_0x6ff0('0x59')]=intUtil[_0x6ff0('0x58')](_0xaea66e[_0x6ff0('0x59')]);_0x459e0f[_0x6ff0('0x4c')]=_0x23f793==='queue'||_0x23f793===_0x6ff0('0x5a')?_0x6ff0('0x4d'):_0x6ff0('0x29');var _0x18b6a1=_0xaea66e[_0x6ff0('0x9')]?util['format'](_0x6ff0('0x5b'),_0xaea66e[_0x6ff0('0xa')][_0x6ff0('0xb')]):util[_0x6ff0('0x53')](_0x6ff0('0x5b'),_0xaea66e['remoteUri']);var _0x1c7bf4=util[_0x6ff0('0x53')]('https://login.microsoftonline.com/%s/oauth2/token',_0xaea66e['tenantId']);var _0xd712f2=util[_0x6ff0('0x53')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xaea66e[_0x6ff0('0x59')],_0x5decb6[_0x6ff0('0x5c')],md5(_0x5decb6[_0x6ff0('0x5c')]));if(_0xcfe6a1&&_0xcfe6a1[_0x6ff0('0x5d')]){logger[_0x6ff0('0x24')](_0x6ff0('0x5e'),_0x6ff0('0x5f'));_0x5decb6[_0x6ff0('0x60')]=_0xd712f2;}else if(_0xb9b468&&_0xb9b468[_0x6ff0('0x61')]&&_0xb9b468[_0x6ff0('0x61')]!==_0x6ff0('0x62')){logger['info'](_0x6ff0('0x63'),_0x6ff0('0x5f'));_0x5decb6[_0x6ff0('0x60')]=_0xd712f2;}else{_0x5decb6[_0x6ff0('0x60')]='';}return getUser(_0x459e0f,_0xaea66e,_0xda3aba,_0x1c7bf4,_0x18b6a1,_0x23f793)[_0x6ff0('0x19')](function(_0x33f03d){logger[_0x6ff0('0x24')]('['+_0x23f793[_0x6ff0('0x16')]()+_0x6ff0('0x64'),_0x33f03d[_0x6ff0('0x26')]);logger[_0x6ff0('0x24')]('['+_0x23f793[_0x6ff0('0x16')]()+_0x6ff0('0x65'),_0x33f03d['userEmail']);return getEndUser(_0x33f03d,_0xaea66e,_0x1c7bf4,_0x18b6a1,_0x5decb6,_0x23f793,_0x1ca3cf[_0x6ff0('0x66')],_0x1ca3cf[_0x6ff0('0x67')]);})[_0x6ff0('0x19')](function(_0x546bf7){logger[_0x6ff0('0x24')]('['+_0x23f793[_0x6ff0('0x16')]()+_0x6ff0('0x68'),_0x546bf7[_0x6ff0('0x30')]);logger['info']('['+_0x23f793['toUpperCase']()+_0x6ff0('0x69'),_0x5decb6[_0x6ff0('0x31')]);return getTicket(_0x546bf7,_0xaea66e,_0x1c7bf4,_0x18b6a1,_0x5decb6,_0x1ca3cf,_0x23f793);})['then'](function(_0x2ebd9b){logger['info'](util['format']('['+_0x23f793['toUpperCase']()+_0x6ff0('0x6a'),_0x1ca3cf[_0x6ff0('0x4a')],_0x2ebd9b[_0x6ff0('0x6b')]));logger[_0x6ff0('0x24')](util[_0x6ff0('0x53')]('['+_0x23f793['toUpperCase']()+_0x6ff0('0x6c'),_0x23f793));if(_0x23f793!==_0x6ff0('0x5a')&&_0x1ca3cf['openNewTab']){logger[_0x6ff0('0x24')]('['+_0x23f793[_0x6ff0('0x16')]()+']',_0x6ff0('0x6d'));emit(_0xaea66e['remoteUri'],_0xda3aba[_0x6ff0('0x6e')],_0x1ca3cf[_0x6ff0('0x4a')],_0x2ebd9b['ticketId']);}})[_0x6ff0('0x14')](function(_0x21d3a3){logger[_0x6ff0('0x15')]('['+_0x23f793['toUpperCase']()+_0x6ff0('0x6f'),_0x21d3a3[_0x6ff0('0x18')]);console[_0x6ff0('0x15')](_0x6ff0('0x70'),_0x21d3a3);});}; \ No newline at end of file +var _0x6073=['userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','calleridnum','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','string','picklist','nameField','customField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','callDirection','queue','/contacts(','assign','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','data2','resolve','data5','POST','clientId','username','password','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x6073,0x125));var _0x3607=function(_0x35c3dd,_0x1f62c4){_0x35c3dd=_0x35c3dd-0x0;var _0x276a1f=_0x6073[_0x35c3dd];return _0x276a1f;};'use strict';var _=require(_0x3607('0x0'));var rp=require(_0x3607('0x1'));var util=require(_0x3607('0x2'));var intUtil=require('./util');var md5=require(_0x3607('0x3'));var Redis=require(_0x3607('0x4'));var logger=require(_0x3607('0x5'))(_0x3607('0x6'));var config=require(_0x3607('0x7'));config[_0x3607('0x8')]=_[_0x3607('0x9')](config[_0x3607('0x8')],{'host':_0x3607('0xa'),'port':0x18eb});var io=require(_0x3607('0xb'))(new Redis(config[_0x3607('0x8')]));function getAuthToken(_0x5b8013,_0x20175d,_0x20c495){if(_0x5b8013[_0x3607('0xc')]){_0x5b8013[_0x3607('0xd')]=_0x5b8013[_0x3607('0xe')][_0x3607('0xf')];_0x5b8013['tenantId']=_0x5b8013[_0x3607('0xe')][_0x3607('0x10')];return Promise[_0x3607('0x11')](_0x5b8013[_0x3607('0xe')][_0x3607('0x12')]);}var _0x562e1a={'method':_0x3607('0x13'),'uri':_0x20175d,'form':{'client_id':_0x5b8013[_0x3607('0x14')],'resource':_0x5b8013[_0x3607('0xd')],'username':_0x5b8013[_0x3607('0x15')],'password':_0x5b8013[_0x3607('0x16')],'grant_type':_0x3607('0x16'),'client_secret':_0x5b8013['clientSecret']},'json':!![]};return rp(_0x562e1a)[_0x3607('0x17')](function(_0x110f45){return _0x110f45[_0x3607('0x18')];})[_0x3607('0x19')](function(_0x1e74a5){logger['error']('['+[_0x20c495[_0x3607('0x1a')]()]+_0x3607('0x1b'));return _0x1e74a5[_0x3607('0x1c')];});}function getUser(_0x3a525b,_0x407a9d,_0x541c42,_0x58b1e4,_0x2fb8e5,_0x293fd3){return new Promise(function(_0x44eafc,_0x39f70f){return getAuthToken(_0x407a9d,_0x58b1e4,_0x293fd3)['then'](function(_0x1f0422){var _0x1ee03a={'method':_0x3607('0x1d'),'uri':_0x2fb8e5+_0x3607('0x1e'),'headers':{'Authorization':_0x3607('0x1f')+_0x1f0422,'OData-Version':_0x3607('0x20')},'json':!![]};return rp(_0x1ee03a);})['then'](function(_0x38b2b7){var _0x5791a2=_0x38b2b7[_0x3607('0x21')];var _0x30ea89=![];var _0x3cf8c9=null;if(!_[_0x3607('0x22')](_0x541c42)){if(intUtil[_0x3607('0x23')](_0x541c42[_0x3607('0x24')])){_0x3a525b[_0x3607('0x25')]=_0x541c42[_0x3607('0x24')];for(_0x3cf8c9=0x0;_0x3cf8c9<_0x5791a2[_0x3607('0x26')];_0x3cf8c9++){if(_0x5791a2[_0x3cf8c9]['internalemailaddress']===_0x541c42['email']&&!_0x5791a2[_0x3cf8c9][_0x3607('0x27')]){_0x30ea89=!![];logger[_0x3607('0x28')]('['+[_0x293fd3[_0x3607('0x1a')]()]+_0x3607('0x29')+_0x5791a2[_0x3cf8c9][_0x3607('0x2a')]+'!');_0x3a525b[_0x3607('0x2b')]=_0x5791a2[_0x3cf8c9][_0x3607('0x2a')];}}}}if(!_0x30ea89){logger['info']('['+[_0x293fd3[_0x3607('0x1a')]()]+_0x3607('0x2c'));_0x3a525b[_0x3607('0x25')]=_0x407a9d['username'];for(_0x3cf8c9=0x0;_0x3cf8c9<_0x5791a2[_0x3607('0x26')];_0x3cf8c9++){if(_0x5791a2[_0x3cf8c9][_0x3607('0x2d')]===_0x407a9d[_0x3607('0x15')]){_0x3a525b[_0x3607('0x2b')]=_0x5791a2[_0x3cf8c9][_0x3607('0x2a')];}}}_0x44eafc(_0x3a525b);})[_0x3607('0x19')](function(_0x59c869){_0x39f70f(_0x59c869['message']);});});}function createEndUser(_0x16ea31,_0x6134ae,_0x504673,_0x172847,_0x54fc7c,_0x34c338,_0x2c88ad){return new Promise(function(_0x42c2c7,_0x429752){return getAuthToken(_0x6134ae,_0x504673,_0x34c338)[_0x3607('0x17')](function(_0x4b85ca){var _0x1156af=_0x34c338[_0x3607('0x2e')]()===_0x3607('0x2f')?_0x54fc7c[_0x3607('0x30')]:_0x54fc7c['calleridnum'];var _0x4f8a4={'method':_0x3607('0x13'),'uri':_0x172847+_0x3607('0x31'),'body':{'fullname':_0x1156af,'firstname':_0x1156af,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3607('0x32')+_0x16ea31[_0x3607('0x2b')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4b85ca,'OData-Version':_0x3607('0x20')},'json':!![],'resolveWithFullResponse':!![]};_0x4f8a4['body'][_0x2c88ad]=_0x1156af;return rp(_0x4f8a4);})[_0x3607('0x17')](function(_0x2cdbc4){var _0x20363b=_0x2cdbc4[_0x3607('0x33')]['odata-entityid'];var _0xb3bdb0=_0x20363b[_0x3607('0x34')](_0x20363b[_0x3607('0x35')]('(')+0x1,_0x20363b[_0x3607('0x35')](')'));_0x16ea31[_0x3607('0x36')]=_0xb3bdb0;_0x42c2c7(_0x16ea31);})[_0x3607('0x19')](function(_0x418af5){_0x429752(_0x418af5[_0x3607('0x1c')]);});});}function getEndUser(_0x477256,_0x2fd951,_0x521938,_0x15fcdd,_0x341b87,_0x128f46,_0x3754ec,_0x5b3056){var _0x159071=_0x128f46[_0x3607('0x2e')]()===_0x3607('0x2f')?_0x341b87['destcalleridnum']:_0x341b87[_0x3607('0x37')];return getAuthToken(_0x2fd951,_0x521938,_0x128f46)[_0x3607('0x17')](function(_0x45688c){_0x5b3056=_0x5b3056?_0x5b3056:'telephone1';var _0x292638={'method':'GET','uri':_0x15fcdd+_0x3607('0x38')+_0x5b3056+_0x3607('0x39')+_0x5b3056+_0x3607('0x3a')+_0x159071['replace']('+',_0x3607('0x3b'))+'\x27','headers':{'Authorization':_0x3607('0x1f')+_0x45688c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x292638);})[_0x3607('0x17')](function(_0x1b217a){var _0x2cd29e=![];if(!_0x1b217a)return _0x2cd29e;var _0x3c962f=_0x1b217a[_0x3607('0x21')];for(var _0xbf9574=0x0;_0xbf9574<_0x3c962f[_0x3607('0x26')];_0xbf9574++){if(_0x3c962f[_0xbf9574][_0x5b3056]===_0x159071){_0x2cd29e=!![];_0x477256['enduserId']=_0x3c962f[_0xbf9574][_0x3607('0x3c')];}}return _0x2cd29e;})[_0x3607('0x17')](function(_0x3eb1c4){if(_0x3eb1c4)return _0x477256;if(_0x3754ec===_0x3607('0x3d')){logger[_0x3607('0x28')]('['+[_0x128f46['toUpperCase']()]+_0x3607('0x3e'));return _0x477256;}return createEndUser(_0x477256,_0x2fd951,_0x521938,_0x15fcdd,_0x341b87,_0x128f46,_0x5b3056)[_0x3607('0x17')](function(_0x4042c2){logger[_0x3607('0x28')]('['+[_0x128f46['toUpperCase']()]+']\x20Enduser\x20created!',_0x4042c2[_0x3607('0x36')]);return _0x4042c2;});});}function getCustomFields(_0x5b7e9f,_0x4805e5,_0x2db10f){var _0x5878de={};if(_0x5b7e9f[_0x3607('0x26')]>0x0){_['forEach'](_0x5b7e9f,function(_0xf37ece){if(_['includes']([_0x3607('0x3f'),_0x3607('0x40')],_0xf37ece['type'])&&_0xf37ece[_0x3607('0x41')]&&!_0xf37ece[_0x3607('0x42')]){var _0x1f4f51=_0xf37ece['idField']['toLowerCase']();var _0x3125b7=_0x1f4f51[_0x3607('0x34')](0x0,_0x1f4f51[_0x3607('0x43')]('_'));var _0x19e385=_0x1f4f51[_0x3607('0x34')](_0x1f4f51[_0x3607('0x43')]('_')+0x1);if(_0x3125b7===_0x2db10f){_0x5878de[_0x19e385]=_0xf37ece[_0x3607('0x44')];}}});}return _0x5878de;}function getTicket(_0x3077eb,_0x2f7bad,_0x19e24e,_0x7c49f5,_0x52f35a,_0x33d4c7,_0x3e450a){return new Promise(function(_0x301c33,_0x1b4bff){var _0x5c9f03;return getAuthToken(_0x2f7bad,_0x19e24e,_0x3e450a)[_0x3607('0x17')](function(_0x55dce7){if(_0x33d4c7[_0x3607('0x45')]===_0x3607('0x46')){_0x5c9f03={'method':_0x3607('0x13'),'uri':_0x7c49f5+_0x3607('0x47'),'body':Object['assign']({},{'title':intUtil[_0x3607('0x48')](_0x33d4c7[_0x3607('0x49')],_0x52f35a,'\x20'),'description':intUtil[_0x3607('0x48')](_0x33d4c7[_0x3607('0x4a')],_0x52f35a,'\x0a'),'customerid_contact@odata.bind':_0x3077eb[_0x3607('0x36')]?'/contacts('+_0x3077eb[_0x3607('0x36')]+')':undefined,'ownerid@odata.bind':_0x3607('0x32')+_0x3077eb[_0x3607('0x2b')]+')','caseorigincode':'1'},getCustomFields(_0x33d4c7['Fields'],_0x52f35a,_0x33d4c7[_0x3607('0x45')])),'headers':{'Authorization':_0x3607('0x1f')+_0x55dce7,'OData-Version':_0x3607('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x33d4c7[_0x3607('0x45')]==='phonecall'){var _0x1fdb30=_0x3077eb[_0x3607('0x36')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3077eb[_0x3607('0x2b')]+')','participationtypemask':_0x3077eb[_0x3607('0x4b')]===_0x3607('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x3607('0x4d')+_0x3077eb[_0x3607('0x36')]+')','participationtypemask':_0x3077eb[_0x3607('0x4b')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3077eb['userId']+')','participationtypemask':_0x3077eb[_0x3607('0x4b')]===_0x3607('0x4c')?0x2:0x1}];_0x5c9f03={'method':_0x3607('0x13'),'uri':_0x7c49f5+'phonecalls','body':Object[_0x3607('0x4e')]({},{'subject':intUtil[_0x3607('0x48')](_0x33d4c7[_0x3607('0x49')],_0x52f35a,'\x20'),'phonenumber':String(_0x52f35a[_0x3607('0x37')]),'description':intUtil[_0x3607('0x48')](_0x33d4c7[_0x3607('0x4a')],_0x52f35a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3077eb[_0x3607('0x36')]?_0x3607('0x4d')+_0x3077eb[_0x3607('0x36')]+')':undefined,'ownerid@odata.bind':_0x3607('0x32')+_0x3077eb[_0x3607('0x2b')]+')','directioncode':_0x3077eb[_0x3607('0x4b')]===_0x3607('0x4c')?![]:!![],'phonecall_activity_parties':_0x1fdb30},getCustomFields(_0x33d4c7[_0x3607('0x4f')],_0x52f35a,_0x33d4c7[_0x3607('0x45')])),'headers':{'Authorization':_0x3607('0x1f')+_0x55dce7,'OData-Version':_0x3607('0x20')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5c9f03);})[_0x3607('0x17')](function(_0x13eb51){var _0x2ff83c=_0x13eb51[_0x3607('0x33')]['odata-entityid'];var _0x9c2ac7=_0x2ff83c[_0x3607('0x34')](_0x2ff83c[_0x3607('0x35')]('(')+0x1,_0x2ff83c[_0x3607('0x35')](')'));_0x3077eb[_0x3607('0x50')]=_0x9c2ac7;_0x301c33(_0x3077eb);})['catch'](function(_0x2399ee){_0x1b4bff(_0x2399ee['message']);});});}function emit(_0x756fe4,_0x5c635d,_0x3cf529,_0x27fcb6){var _0x1814de={'uri':util[_0x3607('0x51')](_0x3607('0x52'),_0x756fe4,_0x3cf529,_0x27fcb6)};io['to'](util['format'](_0x3607('0x53'),_0x5c635d))[_0x3607('0x54')](_0x3607('0x55'),_0x1814de);}exports['cs']=function(_0x317d60,_0x129790,_0x400407,_0x5e9232,_0x4e26fa,_0x5e41aa,_0x22e1ed,_0x33cc17){var _0x40bf72={};_0x5e41aa[_0x3607('0xd')]=_0x5e41aa['modernAuthentication']?intUtil[_0x3607('0x56')](_0x5e41aa[_0x3607('0xe')][_0x3607('0xf')]):intUtil['stripTrailingSlash'](_0x5e41aa[_0x3607('0xd')]);_0x5e41aa['serverUrl']=intUtil['stripTrailingSlash'](_0x5e41aa[_0x3607('0x57')]);_0x40bf72['callDirection']=_0x33cc17===_0x3607('0x4c')||_0x33cc17===_0x3607('0x58')?'queue':_0x3607('0x2f');var _0x3a909c=_0x5e41aa['modernAuthentication']?util['format'](_0x3607('0x59'),_0x5e41aa[_0x3607('0xe')][_0x3607('0xf')]):util[_0x3607('0x51')]('%s/api/data/v9.0/',_0x5e41aa[_0x3607('0xd')]);var _0x1c51ce=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x5e41aa[_0x3607('0x5a')]);var _0x3c73f0=util[_0x3607('0x51')](_0x3607('0x5b'),_0x5e41aa[_0x3607('0x57')],_0x129790['uniqueid'],md5(_0x129790[_0x3607('0x5c')]));if(_0x4e26fa&&_0x4e26fa['monitor_format']){logger[_0x3607('0x28')](_0x3607('0x5d'),_0x3607('0x5e'));_0x129790[_0x3607('0x5f')]=_0x3c73f0;}else if(_0x22e1ed&&_0x22e1ed[_0x3607('0x60')]&&_0x22e1ed[_0x3607('0x60')]!=='none'){logger[_0x3607('0x28')](_0x3607('0x61'),_0x3607('0x5e'));_0x129790[_0x3607('0x5f')]=_0x3c73f0;}else{_0x129790['recordingURL']='';}return getUser(_0x40bf72,_0x5e41aa,_0x5e9232,_0x1c51ce,_0x3a909c,_0x33cc17)[_0x3607('0x17')](function(_0x2ed78d){logger[_0x3607('0x28')]('['+_0x33cc17['toUpperCase']()+_0x3607('0x62'),_0x2ed78d[_0x3607('0x2b')]);logger[_0x3607('0x28')]('['+_0x33cc17[_0x3607('0x1a')]()+_0x3607('0x63'),_0x2ed78d[_0x3607('0x25')]);return getEndUser(_0x2ed78d,_0x5e41aa,_0x1c51ce,_0x3a909c,_0x129790,_0x33cc17,_0x400407[_0x3607('0x64')],_0x400407[_0x3607('0x65')]);})['then'](function(_0x1b59cb){logger[_0x3607('0x28')]('['+_0x33cc17[_0x3607('0x1a')]()+_0x3607('0x66'),_0x1b59cb[_0x3607('0x36')]);logger['info']('['+_0x33cc17[_0x3607('0x1a')]()+_0x3607('0x67'),_0x129790[_0x3607('0x37')]);return getTicket(_0x1b59cb,_0x5e41aa,_0x1c51ce,_0x3a909c,_0x129790,_0x400407,_0x33cc17);})[_0x3607('0x17')](function(_0x5a71da){logger[_0x3607('0x28')](util[_0x3607('0x51')]('['+_0x33cc17[_0x3607('0x1a')]()+_0x3607('0x68'),_0x400407[_0x3607('0x45')],_0x5a71da['ticketId']));logger[_0x3607('0x28')](util[_0x3607('0x51')]('['+_0x33cc17[_0x3607('0x1a')]()+_0x3607('0x69'),_0x33cc17));if(_0x33cc17!==_0x3607('0x58')&&_0x400407[_0x3607('0x6a')]){logger[_0x3607('0x28')]('['+_0x33cc17[_0x3607('0x1a')]()+']',_0x3607('0x6b'));emit(_0x5e41aa['remoteUri'],_0x5e9232[_0x3607('0x6c')],_0x400407[_0x3607('0x45')],_0x5a71da[_0x3607('0x50')]);}})[_0x3607('0x19')](function(_0x2f6cfd){logger[_0x3607('0x6d')]('['+_0x33cc17[_0x3607('0x1a')]()+_0x3607('0x6e'),_0x2f6cfd['message']);console[_0x3607('0x6d')](_0x3607('0x6f'),_0x2f6cfd);});}; \ 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 ae711d5..b251fb0 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 _0xc18f=['serverUrl','monitor_format','Recording\x20is\x20enabled!','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','unmanaged','lastevent','toUpperCase','request-promise','md5','util','ioredis','../../../../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','Descriptions','Tags','name','Fields','custom_fields','value','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','debug','[HTTP]','stringify','GET','map','forEach','string','type','customField','nameField','toLowerCase','content','toString','includes','picklist','idField','push','variable','variableName','Variable','queue','stripTrailingSlash'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0xc18f,0x130));var _0xfc18=function(_0x490f9b,_0x439804){_0x490f9b=_0x490f9b-0x0;var _0x30eff0=_0xc18f[_0x490f9b];return _0x30eff0;};'use strict';var _=require('lodash');var rp=require(_0xfc18('0x0'));var md5=require(_0xfc18('0x1'));var util=require(_0xfc18('0x2'));var Redis=require(_0xfc18('0x3'));var intUtil=require('./util');var config=require(_0xfc18('0x4'));var logger=require('../../../../config/logger')(_0xfc18('0x5'));config[_0xfc18('0x6')]=_[_0xfc18('0x7')](config[_0xfc18('0x6')],{'host':_0xfc18('0x8'),'port':0x18eb});var io=require(_0xfc18('0x9'))(new Redis(config[_0xfc18('0x6')]));var headers={'Content-Type':_0xfc18('0xa'),'Accept':_0xfc18('0xa')};function emit(_0x4feaa0,_0x1cb86a,_0x45caf4){io['to'](_0x4feaa0)[_0xfc18('0xb')](_0x1cb86a,_0x45caf4);}function getTicket(_0x55c4da,_0x5520bc,_0x493d06,_0x14ce13,_0x47583c){logger[_0xfc18('0xc')](_0xfc18('0xd'));var _0x199c3d=_[_0xfc18('0xe')]({'responder_id':_0x5520bc['id'],'requester_id':_0x493d06['id'],'name':util[_0xfc18('0xf')](_0xfc18('0x10'),_0x47583c[_0xfc18('0x11')]),'phone':_0x47583c[_0xfc18('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xfc18('0x13')](_0x14ce13[_0xfc18('0x14')],_0x47583c,'\x20'),'description':intUtil[_0xfc18('0x13')](_0x14ce13[_0xfc18('0x15')],_0x47583c,'
'),'tags':getTags(_0x14ce13[_0xfc18('0x16')],_0xfc18('0x17'))},getCustomFields(_0x14ce13[_0xfc18('0x18')],_0x47583c));_0x199c3d[_0xfc18('0x19')]=_['mapValues'](_['keyBy'](_0x199c3d['custom_fields'],'id'),_0xfc18('0x1a'));return request({'uri':util[_0xfc18('0xf')]('%s/api/v2/tickets',_0x55c4da[_0xfc18('0x1b')]),'method':'POST','body':_0x199c3d})[_0xfc18('0x1c')](function(_0x39e706){logger[_0xfc18('0xc')](_0xfc18('0x1d'));return _0x39e706;});}function getUser(_0x222caf,_0x6543a0){if(intUtil[_0xfc18('0x1e')](_0x6543a0)){return request({'uri':util[_0xfc18('0xf')](_0xfc18('0x1f'),_0x222caf[_0xfc18('0x1b')]),'qs':{'email':_0x6543a0}})[_0xfc18('0x1c')](function(_0x11134f){if(_0x11134f[_0xfc18('0x20')]){logger[_0xfc18('0xc')](_0xfc18('0x21'));return _[_0xfc18('0x22')](_0x11134f,function(_0x2cc91c){return _0x2cc91c[_0xfc18('0x23')][_0xfc18('0x24')]===_0x6543a0;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xfc18('0xf')](_0xfc18('0x25'),_0x222caf[_0xfc18('0x1b')])})['then'](function(_0x21b5f6){logger['info'](_0xfc18('0x26'));return _0x21b5f6;});}});}else{logger[_0xfc18('0xc')](_0xfc18('0x27'));return request({'uri':util[_0xfc18('0xf')](_0xfc18('0x25'),_0x222caf[_0xfc18('0x1b')])})['then'](function(_0x1f8443){logger['info'](_0xfc18('0x26'));return _0x1f8443;});}}function getEndUser(_0x191770,_0x4fb6c5,_0x774cf7){logger['info'](_0xfc18('0x28'),_0x774cf7);return request({'uri':util[_0xfc18('0xf')](_0xfc18('0x29'),_0x191770[_0xfc18('0x1b')]),'qs':{'phone':_0x774cf7}})[_0xfc18('0x1c')](function(_0x19cd12){if(_0x19cd12[_0xfc18('0x20')]){logger['info'](_0xfc18('0x2a'));return _[_0xfc18('0x22')](_0x19cd12,{'phone':_0x774cf7});}else{logger['info'](_0xfc18('0x2b'));return request({'uri':util['format'](_0xfc18('0x29'),_0x191770[_0xfc18('0x1b')]),'method':'POST','body':{'name':_0x4fb6c5,'phone':_0x774cf7}})[_0xfc18('0x1c')](function(_0x243d1e){logger['info']('Enduser\x20created.');return _0x243d1e;});}});}function getAuth(_0x11aa3a){return util[_0xfc18('0xf')](_0xfc18('0x2c'),new Buffer(_0x11aa3a[_0xfc18('0x2d')]+':X')['toString']('base64'));}function request(_0x1f2ca9){logger[_0xfc18('0x2e')](_0xfc18('0x2f'),JSON[_0xfc18('0x30')](_0x1f2ca9));return rp(_['defaults'](_0x1f2ca9,{'method':_0xfc18('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x28d73a,_0xfa6d64){var _0x371910=[];if(_0x28d73a&&_0x28d73a[_0xfc18('0x20')]>0x0){_0x371910=_[_0xfc18('0x32')](_0x28d73a,_0xfa6d64);}return _0x371910;}function getCustomFields(_0x40d07e,_0x15787c){var _0x12c598=[];var _0x47d707={'custom_fields':[]};if(_0x40d07e[_0xfc18('0x20')]>0x0){_[_0xfc18('0x33')](_0x40d07e,function(_0x4a55ff){if(_['includes']([_0xfc18('0x34'),'picklist'],_0x4a55ff[_0xfc18('0x35')])&&_0x4a55ff['nameField']&&!_0x4a55ff[_0xfc18('0x36')]){_0x47d707[_0x4a55ff[_0xfc18('0x37')][_0xfc18('0x38')]()]=_0x4a55ff[_0xfc18('0x39')][_0xfc18('0x3a')]();}else if(_[_0xfc18('0x3b')]([_0xfc18('0x34'),_0xfc18('0x3c')],_0x4a55ff[_0xfc18('0x35')])&&_0x4a55ff[_0xfc18('0x3d')]&&_0x4a55ff[_0xfc18('0x36')]){_0x47d707[_0xfc18('0x19')][_0xfc18('0x3e')]({'id':_0x4a55ff[_0xfc18('0x3d')],'value':_0x4a55ff['content'][_0xfc18('0x3a')]()});}else if(_0x4a55ff[_0xfc18('0x35')]===_0xfc18('0x3f')&&_0x4a55ff[_0xfc18('0x40')]&&_0x4a55ff[_0xfc18('0x3d')]&&_0x4a55ff['customField']){_0x15787c[_0x4a55ff[_0xfc18('0x40')]]&&_0x47d707[_0xfc18('0x19')][_0xfc18('0x3e')]({'id':_0x4a55ff[_0xfc18('0x3d')],'value':_0x15787c[_0x4a55ff[_0xfc18('0x40')]][_0xfc18('0x3a')]()});}else if(_0x4a55ff[_0xfc18('0x35')]==='customVariable'&&_0x4a55ff['Variable']&&_0x4a55ff[_0xfc18('0x41')][_0xfc18('0x17')]&&_0x4a55ff['idField']&&_0x4a55ff[_0xfc18('0x36')]){_0x15787c[_0x4a55ff[_0xfc18('0x41')][_0xfc18('0x17')]['toLowerCase']()]&&_0x47d707['custom_fields']['push']({'id':_0x4a55ff[_0xfc18('0x3d')],'value':_0x15787c[_0x4a55ff[_0xfc18('0x41')][_0xfc18('0x17')]['toLowerCase']()]['toString']()});}});}return _0x47d707;}exports[_0xfc18('0x42')]=function(_0x1c440d,_0xdd462e,_0x26999a,_0x2bf45a,_0x1d8f90,_0x15d28a){var _0x5cbd79,_0x3c1acb;_0x15d28a[_0xfc18('0x1b')]=intUtil[_0xfc18('0x43')](_0x15d28a['remoteUri']);_0x15d28a[_0xfc18('0x44')]=intUtil[_0xfc18('0x43')](_0x15d28a[_0xfc18('0x44')]);if(_0x1d8f90&&_0x1d8f90[_0xfc18('0x45')]){logger[_0xfc18('0xc')]('[QUEUE]',_0xfc18('0x46'));_0xdd462e['recordingURL']=util[_0xfc18('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x15d28a[_0xfc18('0x44')],_0xdd462e['uniqueid'],md5(_0xdd462e[_0xfc18('0x47')]));}else{_0xdd462e['recordingURL']='';}headers[_0xfc18('0x48')]=getAuth(_0x15d28a);return getUser(_0x15d28a,_0x2bf45a['email'])[_0xfc18('0x1c')](function(_0x5913c2){_0x5cbd79=_0x5913c2;logger[_0xfc18('0xc')](_0xfc18('0x49'),_0x5cbd79['id']);return getEndUser(_0x15d28a,_0xdd462e[_0xfc18('0x11')],_0xdd462e['calleridnum']);})[_0xfc18('0x1c')](function(_0x520030){_0x3c1acb=_0x520030;logger['info'](_0xfc18('0x4a'),_0x3c1acb['id']);return getTicket(_0x15d28a,_0x5cbd79,_0x3c1acb,_0x26999a,_0xdd462e);})[_0xfc18('0x1c')](function(_0x52e76d){if(_0x52e76d&&_0x52e76d['id']){logger[_0xfc18('0xc')](_0xfc18('0x1d'));logger[_0xfc18('0xc')](_0xfc18('0x4b'),_0x52e76d['id']);logger[_0xfc18('0xc')](_0xfc18('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfc18('0xf')](_0xfc18('0x4d'),_0x2bf45a[_0xfc18('0x17')]),_0xfc18('0x4e'),{'uri':util[_0xfc18('0xf')](_0xfc18('0x4f'),_0x15d28a['remoteUri'],_0x52e76d['id'])});}})['catch'](function(_0x32a8dd){logger['error'](_0xfc18('0x4c'),JSON[_0xfc18('0x30')](_0x32a8dd));});};exports[_0xfc18('0x50')]=function(_0x112860,_0x5efd15,_0x5a8ed0,_0x2fdeb9,_0x36e3b,_0x470042,_0xb9158a){var _0x5b5f41,_0x37eca1;_0x470042[_0xfc18('0x1b')]=intUtil[_0xfc18('0x43')](_0x470042[_0xfc18('0x1b')]);_0x470042[_0xfc18('0x44')]=intUtil[_0xfc18('0x43')](_0x470042['serverUrl']);if(_0xb9158a&&_0xb9158a[_0xfc18('0x51')]&&_0xb9158a[_0xfc18('0x51')]!==_0xfc18('0x52')){logger[_0xfc18('0xc')]('[OUTBOUND]',_0xfc18('0x46'));_0x5efd15[_0xfc18('0x53')]=util[_0xfc18('0xf')](_0xfc18('0x54'),_0x470042[_0xfc18('0x44')],_0x5efd15[_0xfc18('0x47')],md5(_0x5efd15[_0xfc18('0x47')]));}headers[_0xfc18('0x48')]=getAuth(_0x470042);return getUser(_0x470042,_0x2fdeb9['email'])[_0xfc18('0x1c')](function(_0x5ecdef){_0x5b5f41=_0x5ecdef;logger[_0xfc18('0xc')]('The\x20User\x20ID\x20is:',_0x5b5f41['id']);return getEndUser(_0x470042,_0x5efd15[_0xfc18('0x55')],_0x5efd15['destcalleridnum']);})[_0xfc18('0x1c')](function(_0x406086){_0x37eca1=_0x406086;logger[_0xfc18('0xc')](_0xfc18('0x4a'),_0x37eca1['id']);return getTicket(_0x470042,_0x5b5f41,_0x37eca1,_0x5a8ed0,_0x5efd15);})[_0xfc18('0x1c')](function(_0x2a56e8){if(_0x2a56e8&&_0x2a56e8['id']){logger[_0xfc18('0xc')](_0xfc18('0x1d'));logger[_0xfc18('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2a56e8['id']);logger[_0xfc18('0xc')](_0xfc18('0x56'),_0xfc18('0x57'));emit(util[_0xfc18('0xf')](_0xfc18('0x4d'),_0x2fdeb9[_0xfc18('0x17')]),_0xfc18('0x4e'),{'uri':util[_0xfc18('0xf')](_0xfc18('0x4f'),_0x470042['remoteUri'],_0x2a56e8['id'])});}})[_0xfc18('0x58')](function(_0x2cdde8){logger[_0xfc18('0x59')]('[OUTBOUND]',JSON[_0xfc18('0x30')](_0x2cdde8));});};exports[_0xfc18('0x5a')]=function(_0x571715,_0x723b48,_0x5ae55a,_0x19252d,_0x2464b5,_0x44ec07){var _0x47212f,_0x1dc8d1;_0x44ec07['remoteUri']=intUtil[_0xfc18('0x43')](_0x44ec07[_0xfc18('0x1b')]);_0x44ec07[_0xfc18('0x44')]=intUtil['stripTrailingSlash'](_0x44ec07[_0xfc18('0x44')]);if(_0x2464b5&&_0x2464b5[_0xfc18('0x45')]){logger[_0xfc18('0xc')]('['+_0x723b48[_0xfc18('0x5b')][_0xfc18('0x5c')]()+']','Recording\x20is\x20enabled!');_0x723b48[_0xfc18('0x53')]=util['format'](_0xfc18('0x54'),_0x44ec07['serverUrl'],_0x723b48[_0xfc18('0x47')],md5(_0x723b48[_0xfc18('0x47')]));}else{_0x723b48[_0xfc18('0x53')]='';}headers[_0xfc18('0x48')]=getAuth(_0x44ec07);return getUser(_0x44ec07,'')[_0xfc18('0x1c')](function(_0x2ce7f9){_0x47212f=_0x2ce7f9;logger[_0xfc18('0xc')](_0xfc18('0x49'),_0x47212f['id']);return getEndUser(_0x44ec07,_0x723b48[_0xfc18('0x11')],_0x723b48[_0xfc18('0x12')]);})[_0xfc18('0x1c')](function(_0x50dc0d){_0x1dc8d1=_0x50dc0d;logger['info'](_0xfc18('0x4a'),_0x1dc8d1['id']);return getTicket(_0x44ec07,_0x47212f,_0x1dc8d1,_0x5ae55a,_0x723b48);})[_0xfc18('0x1c')](function(_0x3e8c20){if(_0x3e8c20){logger[_0xfc18('0xc')](_0xfc18('0x1d'));logger[_0xfc18('0xc')](_0xfc18('0x4b'),_0x3e8c20['id']);}})[_0xfc18('0x58')](function(_0x537b10){logger[_0xfc18('0x59')]('['+_0x723b48['lastevent'][_0xfc18('0x5c')]()+']',JSON[_0xfc18('0x30')](_0x537b10));});}; \ No newline at end of file +var _0x07be=['The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','monitor_format','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','emit','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','base64','debug','stringify','defaults','GET','length','map','forEach','string','picklist','nameField','content','type','idField','customField','push','toString','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','recordingURL','uniqueid','Authorization'];(function(_0x2caa77,_0x328e65){var _0x251b37=function(_0x8eca74){while(--_0x8eca74){_0x2caa77['push'](_0x2caa77['shift']());}};_0x251b37(++_0x328e65);}(_0x07be,0x183));var _0xe07b=function(_0x4b35bb,_0x42760d){_0x4b35bb=_0x4b35bb-0x0;var _0x35a6fe=_0x07be[_0x4b35bb];return _0x35a6fe;};'use strict';var _=require(_0xe07b('0x0'));var rp=require(_0xe07b('0x1'));var md5=require(_0xe07b('0x2'));var util=require(_0xe07b('0x3'));var Redis=require(_0xe07b('0x4'));var intUtil=require(_0xe07b('0x5'));var config=require(_0xe07b('0x6'));var logger=require(_0xe07b('0x7'))(_0xe07b('0x8'));config[_0xe07b('0x9')]=_['defaults'](config[_0xe07b('0x9')],{'host':_0xe07b('0xa'),'port':0x18eb});var io=require(_0xe07b('0xb'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x363f8d,_0x34c631,_0x2e0f36){io['to'](_0x363f8d)[_0xe07b('0xc')](_0x34c631,_0x2e0f36);}function getTicket(_0x2fb291,_0x22e370,_0x13190d,_0x21d221,_0x2d23ec){logger['info']('Creating\x20new\x20ticket...');var _0x2083b3=_['merge']({'responder_id':_0x22e370['id'],'requester_id':_0x13190d['id'],'name':util[_0xe07b('0xd')](_0xe07b('0xe'),_0x2d23ec[_0xe07b('0xf')]),'phone':_0x2d23ec[_0xe07b('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe07b('0x11')](_0x21d221[_0xe07b('0x12')],_0x2d23ec,'\x20'),'description':intUtil['getString'](_0x21d221[_0xe07b('0x13')],_0x2d23ec,'
'),'tags':getTags(_0x21d221[_0xe07b('0x14')],_0xe07b('0x15'))},getCustomFields(_0x21d221[_0xe07b('0x16')],_0x2d23ec));_0x2083b3[_0xe07b('0x17')]=_[_0xe07b('0x18')](_[_0xe07b('0x19')](_0x2083b3[_0xe07b('0x17')],'id'),_0xe07b('0x1a'));return request({'uri':util[_0xe07b('0xd')](_0xe07b('0x1b'),_0x2fb291['remoteUri']),'method':_0xe07b('0x1c'),'body':_0x2083b3})['then'](function(_0x2361b2){logger[_0xe07b('0x1d')](_0xe07b('0x1e'));return _0x2361b2;});}function getUser(_0x3c7cb1,_0xc21266){if(intUtil[_0xe07b('0x1f')](_0xc21266)){return request({'uri':util[_0xe07b('0xd')](_0xe07b('0x20'),_0x3c7cb1[_0xe07b('0x21')]),'qs':{'email':_0xc21266}})['then'](function(_0x2b9788){if(_0x2b9788['length']){logger['info']('Agent\x20found!');return _[_0xe07b('0x22')](_0x2b9788,function(_0x31d790){return _0x31d790['contact'][_0xe07b('0x23')]===_0xc21266;});}else{logger[_0xe07b('0x1d')](_0xe07b('0x24'));return request({'uri':util[_0xe07b('0xd')](_0xe07b('0x25'),_0x3c7cb1['remoteUri'])})[_0xe07b('0x26')](function(_0x329357){logger['info']('Admin\x20account\x20selected.');return _0x329357;});}});}else{logger[_0xe07b('0x1d')](_0xe07b('0x27'));return request({'uri':util[_0xe07b('0xd')](_0xe07b('0x25'),_0x3c7cb1['remoteUri'])})[_0xe07b('0x26')](function(_0x17dbe3){logger[_0xe07b('0x1d')](_0xe07b('0x28'));return _0x17dbe3;});}}function getEndUser(_0x5084ad,_0x26bbca,_0x369f02){logger['info'](_0xe07b('0x29'),_0x369f02);return request({'uri':util[_0xe07b('0xd')](_0xe07b('0x2a'),_0x5084ad['remoteUri']),'qs':{'phone':_0x369f02}})[_0xe07b('0x26')](function(_0x2fbf55){if(_0x2fbf55['length']){logger['info'](_0xe07b('0x2b'));return _['find'](_0x2fbf55,{'phone':_0x369f02});}else{logger[_0xe07b('0x1d')](_0xe07b('0x2c'));return request({'uri':util[_0xe07b('0xd')](_0xe07b('0x2a'),_0x5084ad['remoteUri']),'method':_0xe07b('0x1c'),'body':{'name':_0x26bbca,'phone':_0x369f02}})[_0xe07b('0x26')](function(_0x156127){logger[_0xe07b('0x1d')]('Enduser\x20created.');return _0x156127;});}});}function getAuth(_0x40ffa1){return util[_0xe07b('0xd')](_0xe07b('0x2d'),new Buffer(_0x40ffa1[_0xe07b('0x2e')]+':X')['toString'](_0xe07b('0x2f')));}function request(_0x40b7be){logger[_0xe07b('0x30')]('[HTTP]',JSON[_0xe07b('0x31')](_0x40b7be));return rp(_[_0xe07b('0x32')](_0x40b7be,{'method':_0xe07b('0x33'),'headers':headers,'json':!![]}));}function getTags(_0xdf1e8d,_0x5b56dc){var _0x3cf1f0=[];if(_0xdf1e8d&&_0xdf1e8d[_0xe07b('0x34')]>0x0){_0x3cf1f0=_[_0xe07b('0x35')](_0xdf1e8d,_0x5b56dc);}return _0x3cf1f0;}function getCustomFields(_0x55c694,_0x2cc81d){var _0x38ebd4=[];var _0x2cd573={'custom_fields':[]};if(_0x55c694[_0xe07b('0x34')]>0x0){_[_0xe07b('0x36')](_0x55c694,function(_0x1397f6){if(_['includes']([_0xe07b('0x37'),_0xe07b('0x38')],_0x1397f6['type'])&&_0x1397f6[_0xe07b('0x39')]&&!_0x1397f6['customField']){_0x2cd573[_0x1397f6[_0xe07b('0x39')]['toLowerCase']()]=_0x1397f6[_0xe07b('0x3a')]['toString']();}else if(_['includes']([_0xe07b('0x37'),'picklist'],_0x1397f6[_0xe07b('0x3b')])&&_0x1397f6[_0xe07b('0x3c')]&&_0x1397f6[_0xe07b('0x3d')]){_0x2cd573[_0xe07b('0x17')][_0xe07b('0x3e')]({'id':_0x1397f6['idField'],'value':_0x1397f6['content'][_0xe07b('0x3f')]()});}else if(_0x1397f6[_0xe07b('0x3b')]===_0xe07b('0x40')&&_0x1397f6['variableName']&&_0x1397f6[_0xe07b('0x3c')]&&_0x1397f6[_0xe07b('0x3d')]){_0x2cc81d[_0x1397f6[_0xe07b('0x41')]]&&_0x2cd573[_0xe07b('0x17')][_0xe07b('0x3e')]({'id':_0x1397f6[_0xe07b('0x3c')],'value':_0x2cc81d[_0x1397f6[_0xe07b('0x41')]]['toString']()});}else if(_0x1397f6[_0xe07b('0x3b')]===_0xe07b('0x42')&&_0x1397f6[_0xe07b('0x43')]&&_0x1397f6['Variable']['name']&&_0x1397f6['idField']&&_0x1397f6['customField']){_0x2cc81d[_0x1397f6['Variable'][_0xe07b('0x15')]['toLowerCase']()]&&_0x2cd573[_0xe07b('0x17')]['push']({'id':_0x1397f6['idField'],'value':_0x2cc81d[_0x1397f6[_0xe07b('0x43')]['name']['toLowerCase']()]['toString']()});}});}return _0x2cd573;}exports['queue']=function(_0x4ddaf7,_0x11411f,_0xcecb3a,_0x45d94f,_0x492eba,_0x3f7cbb){var _0x59cf65,_0x52056a;_0x3f7cbb['remoteUri']=intUtil['stripTrailingSlash'](_0x3f7cbb['remoteUri']);_0x3f7cbb['serverUrl']=intUtil[_0xe07b('0x44')](_0x3f7cbb[_0xe07b('0x45')]);if(_0x492eba&&_0x492eba['monitor_format']){logger[_0xe07b('0x1d')]('[QUEUE]','Recording\x20is\x20enabled!');_0x11411f[_0xe07b('0x46')]=util[_0xe07b('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f7cbb[_0xe07b('0x45')],_0x11411f[_0xe07b('0x47')],md5(_0x11411f[_0xe07b('0x47')]));}else{_0x11411f['recordingURL']='';}headers[_0xe07b('0x48')]=getAuth(_0x3f7cbb);return getUser(_0x3f7cbb,_0x45d94f[_0xe07b('0x23')])['then'](function(_0x445ceb){_0x59cf65=_0x445ceb;logger[_0xe07b('0x1d')](_0xe07b('0x49'),_0x59cf65['id']);return getEndUser(_0x3f7cbb,_0x11411f[_0xe07b('0xf')],_0x11411f[_0xe07b('0x10')]);})[_0xe07b('0x26')](function(_0x56081f){_0x52056a=_0x56081f;logger['info'](_0xe07b('0x4a'),_0x52056a['id']);return getTicket(_0x3f7cbb,_0x59cf65,_0x52056a,_0xcecb3a,_0x11411f);})['then'](function(_0x5a0ac0){if(_0x5a0ac0&&_0x5a0ac0['id']){logger[_0xe07b('0x1d')]('Ticket\x20created!');logger[_0xe07b('0x1d')](_0xe07b('0x4b'),_0x5a0ac0['id']);logger[_0xe07b('0x1d')](_0xe07b('0x4c'),_0xe07b('0x4d'));emit(util['format'](_0xe07b('0x4e'),_0x45d94f[_0xe07b('0x15')]),'trigger:browser:url',{'uri':util['format'](_0xe07b('0x4f'),_0x3f7cbb[_0xe07b('0x21')],_0x5a0ac0['id'])});}})['catch'](function(_0x38b1d8){logger[_0xe07b('0x50')](_0xe07b('0x4c'),JSON[_0xe07b('0x31')](_0x38b1d8));});};exports['outbound']=function(_0x207f20,_0x361cca,_0x2d615a,_0x1ac628,_0x541591,_0x3c37a5,_0x5a50db){var _0x4990dd,_0x1f304d;_0x3c37a5[_0xe07b('0x21')]=intUtil['stripTrailingSlash'](_0x3c37a5[_0xe07b('0x21')]);_0x3c37a5['serverUrl']=intUtil[_0xe07b('0x44')](_0x3c37a5[_0xe07b('0x45')]);if(_0x5a50db&&_0x5a50db[_0xe07b('0x51')]&&_0x5a50db[_0xe07b('0x51')]!==_0xe07b('0x52')){logger[_0xe07b('0x1d')](_0xe07b('0x53'),'Recording\x20is\x20enabled!');_0x361cca['recordingURL']=util[_0xe07b('0xd')](_0xe07b('0x54'),_0x3c37a5['serverUrl'],_0x361cca[_0xe07b('0x47')],md5(_0x361cca[_0xe07b('0x47')]));}headers['Authorization']=getAuth(_0x3c37a5);return getUser(_0x3c37a5,_0x1ac628[_0xe07b('0x23')])[_0xe07b('0x26')](function(_0x3b4648){_0x4990dd=_0x3b4648;logger[_0xe07b('0x1d')](_0xe07b('0x49'),_0x4990dd['id']);return getEndUser(_0x3c37a5,_0x361cca[_0xe07b('0x55')],_0x361cca[_0xe07b('0x56')]);})[_0xe07b('0x26')](function(_0x46a070){_0x1f304d=_0x46a070;logger[_0xe07b('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x1f304d['id']);return getTicket(_0x3c37a5,_0x4990dd,_0x1f304d,_0x2d615a,_0x361cca);})[_0xe07b('0x26')](function(_0x22f41f){if(_0x22f41f&&_0x22f41f['id']){logger[_0xe07b('0x1d')](_0xe07b('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x22f41f['id']);logger[_0xe07b('0x1d')]('[OUTBOUND]',_0xe07b('0x4d'));emit(util[_0xe07b('0xd')](_0xe07b('0x4e'),_0x1ac628[_0xe07b('0x15')]),_0xe07b('0x57'),{'uri':util[_0xe07b('0xd')](_0xe07b('0x4f'),_0x3c37a5[_0xe07b('0x21')],_0x22f41f['id'])});}})['catch'](function(_0x2c4631){logger['error'](_0xe07b('0x53'),JSON['stringify'](_0x2c4631));});};exports[_0xe07b('0x58')]=function(_0x1d640b,_0x77f105,_0x5260ed,_0x36c829,_0x1c7ac3,_0x355913){var _0x49e35b,_0x2f7b4a;_0x355913[_0xe07b('0x21')]=intUtil[_0xe07b('0x44')](_0x355913[_0xe07b('0x21')]);_0x355913[_0xe07b('0x45')]=intUtil['stripTrailingSlash'](_0x355913['serverUrl']);if(_0x1c7ac3&&_0x1c7ac3[_0xe07b('0x59')]){logger[_0xe07b('0x1d')]('['+_0x77f105['lastevent'][_0xe07b('0x5a')]()+']',_0xe07b('0x5b'));_0x77f105['recordingURL']=util['format'](_0xe07b('0x54'),_0x355913['serverUrl'],_0x77f105[_0xe07b('0x47')],md5(_0x77f105['uniqueid']));}else{_0x77f105[_0xe07b('0x46')]='';}headers[_0xe07b('0x48')]=getAuth(_0x355913);return getUser(_0x355913,'')['then'](function(_0x5a7436){_0x49e35b=_0x5a7436;logger[_0xe07b('0x1d')]('The\x20User\x20ID\x20is:',_0x49e35b['id']);return getEndUser(_0x355913,_0x77f105[_0xe07b('0xf')],_0x77f105['calleridnum']);})['then'](function(_0x32ffa5){_0x2f7b4a=_0x32ffa5;logger[_0xe07b('0x1d')](_0xe07b('0x4a'),_0x2f7b4a['id']);return getTicket(_0x355913,_0x49e35b,_0x2f7b4a,_0x5260ed,_0x77f105);})['then'](function(_0xce7947){if(_0xce7947){logger[_0xe07b('0x1d')](_0xe07b('0x1e'));logger[_0xe07b('0x1d')](_0xe07b('0x4b'),_0xce7947['id']);}})['catch'](function(_0x5b8b1e){logger[_0xe07b('0x50')]('['+_0x77f105['lastevent'][_0xe07b('0x5a')]()+']',JSON[_0xe07b('0x31')](_0x5b8b1e));});}; \ 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 9b8d4d6..2ccb0db 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 _0x4972=['POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','then','users','length','email','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','info','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:'];(function(_0x5eb6fc,_0x159584){var _0x4feda9=function(_0x4daf87){while(--_0x4daf87){_0x5eb6fc['push'](_0x5eb6fc['shift']());}};_0x4feda9(++_0x159584);}(_0x4972,0x129));var _0x2497=function(_0x264e18,_0x127785){_0x264e18=_0x264e18-0x0;var _0x4c42b8=_0x4972[_0x264e18];return _0x4c42b8;};'use strict';var _=require(_0x2497('0x0'));var rp=require(_0x2497('0x1'));var md5=require(_0x2497('0x2'));var util=require(_0x2497('0x3'));var moment=require(_0x2497('0x4'));var Promise=require('bluebird');var Redis=require(_0x2497('0x5'));var intUtil=require('./util');var config=require(_0x2497('0x6'));var logger=require(_0x2497('0x7'))('freshsales');config[_0x2497('0x8')]=_[_0x2497('0x9')](config[_0x2497('0x8')],{'host':_0x2497('0xa'),'port':0x18eb});var io=require(_0x2497('0xb'))(new Redis(config[_0x2497('0x8')]));function getAdminId(_0x1dae46,_0x313879,_0x4d49f3,_0x4e96d4){return new Promise(function(_0x3bb4cb,_0x47d9ae){var _0x414c94=![];var _0x5d1659={'method':_0x2497('0xc'),'uri':_0x4e96d4+_0x2497('0xd'),'json':!![]};_0x5d1659[_0x2497('0xe')]=_0x4d49f3;logger['info']('Getting\x20admin\x20information');return rp(_0x5d1659)[_0x2497('0xf')](function(_0x2e1076){if(_0x2e1076){var _0xf3b05e=_0x2e1076[_0x2497('0x10')];var _0x271777=null;for(_0x271777=0x0;_0x271777<_0xf3b05e[_0x2497('0x11')];_0x271777++){if(_0xf3b05e[_0x271777][_0x2497('0x12')]===_0x1dae46[_0x2497('0x13')]){_0x1dae46['adminId']=_0xf3b05e[_0x271777]['id'];_0x414c94=!![];}}if(_0x414c94){logger['info'](_0x2497('0x14'),_0x1dae46['adminId']);_0x3bb4cb(_0x1dae46);}else{_0x47d9ae({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x47d9ae({'statusCode':0x194,'message':_0x2497('0x15')});}})[_0x2497('0x16')](function(_0x487baa){logger[_0x2497('0x17')]('['+[_0x313879[_0x2497('0x18')]()]+']',_0x487baa[_0x2497('0x19')]);_0x47d9ae(_0x487baa);});});}function getUser(_0x423e1f,_0x35c870,_0x50d712){return function(_0x4c4fa5){return new Promise(function(_0x22bca7,_0x45b768){var _0x29cfce={'method':'GET','uri':_0x50d712+_0x2497('0xd'),'json':!![]};_0x29cfce[_0x2497('0xe')]=_0x35c870;logger[_0x2497('0x1a')](_0x2497('0x1b'));return rp(_0x29cfce)['then'](function(_0x426531){if(_0x426531){var _0x4b2225=_0x426531[_0x2497('0x10')];var _0x48f6b4=![];var _0x1714dd=null;if(_0x4c4fa5[_0x2497('0x1c')]!==null){logger['info'](_0x2497('0x1d'),_0x4c4fa5[_0x2497('0x1c')]);_0x4c4fa5[_0x2497('0x1e')]=_0x4c4fa5['agentEmail'];for(_0x1714dd=0x0;_0x1714dd<_0x4b2225[_0x2497('0x11')];_0x1714dd++){if(_0x4b2225[_0x1714dd][_0x2497('0x12')]===_0x4c4fa5[_0x2497('0x1c')]){_0x48f6b4=!![];_0x4c4fa5[_0x2497('0x1f')]=_0x4b2225[_0x1714dd]['id'];logger['info'](_0x2497('0x20'),_0x4c4fa5[_0x2497('0x1f')]);}}}if(!_0x48f6b4){logger[_0x2497('0x1a')](_0x2497('0x21'));_0x4c4fa5['userEmail']=_0x4c4fa5[_0x2497('0x13')];_0x4c4fa5[_0x2497('0x1f')]=_0x4c4fa5['adminId'];_0x48f6b4=!![];}if(_0x48f6b4){_0x22bca7(_0x4c4fa5);}else{_0x45b768({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x45b768({'statusCode':0x194,'message':_0x2497('0x15')});}})[_0x2497('0x16')](function(_0x4e09ae){logger['error']('['+[_0x423e1f[_0x2497('0x18')]()]+']',_0x4e09ae[_0x2497('0x19')]);_0x45b768(_0x4e09ae);});});};}function searchContact(_0x5f9e79,_0x1d0273,_0x5ede7e,_0xbfd6e3){return new Promise(function(_0x405dbe,_0x9ea989){var _0x5a1855={'method':'GET','headers':_0x1d0273,'uri':_0x5f9e79+_0x2497('0x22')+_0xbfd6e3+_0x2497('0x23')+_0x5ede7e+_0x2497('0x24'),'json':!![]};rp(_0x5a1855)[_0x2497('0xf')](function(_0x345f0e){var _0x2379de=_[_0x2497('0x25')](_0x345f0e[_0x2497('0x26')][_0x2497('0x26')],[_0x5ede7e,_0xbfd6e3]);_0x405dbe(_0x2379de);})[_0x2497('0x16')](function(_0xe13396){_0x9ea989(_0xe13396);});});}function getEndUser(_0x2c6aa4,_0x1e87b1,_0x3f2f52){return function(_0x2c7a2e){return new Promise(function(_0x43da03,_0x41d325){logger['info'](util[_0x2497('0x27')](_0x2497('0x28'),_0x2c7a2e[_0x2497('0x29')]));searchContact(_0x3f2f52,_0x1e87b1,'mobile_number',_0x2c7a2e[_0x2497('0x29')])['then'](function(_0x315883){if(_0x315883){_0x2c7a2e['endUserId']=_0x315883['id'];logger[_0x2497('0x1a')](_0x2497('0x2a'),_0x2c7a2e[_0x2497('0x2b')]);return _0x43da03(_0x2c7a2e);}searchContact(_0x3f2f52,_0x1e87b1,_0x2497('0x2c'),_0x2c7a2e['contactNumber'])[_0x2497('0xf')](function(_0x2be460){if(_0x2be460){_0x2c7a2e[_0x2497('0x2b')]=_0x2be460['id'];logger[_0x2497('0x1a')](_0x2497('0x2d'),_0x2c7a2e[_0x2497('0x2b')]);return _0x43da03(_0x2c7a2e);}createEndUser(_0x2c7a2e,_0x2c6aa4,_0x1e87b1,_0x3f2f52)[_0x2497('0xf')](function(_0x11d815){logger[_0x2497('0x1a')](_0x2497('0x2e'),_0x11d815[_0x2497('0x2b')]);return _0x43da03(_0x11d815);});});})[_0x2497('0x16')](function(_0x307561){_0x41d325(_0x307561);});});};}function createEndUser(_0x3dc656,_0x177c1c,_0x214046,_0x4649d6){return new Promise(function(_0x1656e7,_0x9e85a5){var _0x1ce95e=moment();var _0x23c1eb={'method':_0x2497('0x2f'),'uri':_0x4649d6+_0x2497('0x30'),'body':{'contact':{'last_name':_0x3dc656[_0x2497('0x29')],'work_number':_0x3dc656['contactNumber'],'mobile_number':_0x3dc656[_0x2497('0x29')],'owner_id':_0x3dc656['userId'],'created_at':_0x1ce95e[_0x2497('0x27')](_0x2497('0x31'))}},'json':!![]};_0x23c1eb['headers']=_0x214046;logger['info'](_0x2497('0x32'));return rp(_0x23c1eb)['then'](function(_0x1fa4de){_0x3dc656[_0x2497('0x2b')]=_0x1fa4de['contact']['id'];_0x1656e7(_0x3dc656);})['catch'](function(_0x3874df){logger[_0x2497('0x17')]('['+[_0x177c1c['toUpperCase']()]+']',_0x3874df[_0x2497('0x19')]);_0x9e85a5(_0x3874df[_0x2497('0x19')]);});});}function getTicket(_0x564770,_0x153227,_0x57e4e0,_0x567ff1,_0x37c9ca){return function(_0x30fadb){logger[_0x2497('0x1a')](_0x2497('0x33'));return new Promise(function(_0x147ce4,_0xa040a){var _0xe2c9f5=moment();var _0x262e77={'method':_0x2497('0x2f'),'uri':_0x57e4e0+_0x2497('0x34'),'body':{'title':intUtil[_0x2497('0x35')](_0x567ff1[_0x2497('0x36')],_0x37c9ca,'\x20'),'description':intUtil[_0x2497('0x35')](_0x567ff1[_0x2497('0x37')],_0x37c9ca,'\x0a'),'owner_id':_0x30fadb[_0x2497('0x1f')],'creater_id':_0x30fadb['adminId'],'targetable_id':_0x30fadb[_0x2497('0x2b')],'targetable_type':'Contact','created_at':_0xe2c9f5[_0x2497('0x27')](_0x2497('0x31')),'due_date':_0xe2c9f5[_0x2497('0x38')](0x1e,'m')['format'](_0x2497('0x31'))},'json':!![]};_0x262e77[_0x2497('0xe')]=_0x153227;return rp(_0x262e77)[_0x2497('0xf')](function(_0x10cd1c){_0x30fadb[_0x2497('0x39')]=_0x10cd1c[_0x2497('0x3a')]['id'];logger['info'](_0x2497('0x3b'),_0x30fadb[_0x2497('0x39')]);_0x147ce4(_0x30fadb);})[_0x2497('0x16')](function(_0xe63f8f){logger[_0x2497('0x17')]('['+[_0x564770[_0x2497('0x18')]()]+']',_0xe63f8f[_0x2497('0x19')]);_0xa040a(_0xe63f8f[_0x2497('0x19')]);});});};}function emit(_0xb36f61,_0x463a07,_0xb05307){var _0x51811f={'uri':_0xb36f61+'/contacts/'+_0xb05307};io['to'](util['format'](_0x2497('0x3c'),_0x463a07))[_0x2497('0x3d')](_0x2497('0x3e'),_0x51811f);}exports['cs']=function(_0x52511f,_0x5b053b,_0x1f04c4,_0x1a116d,_0x143845,_0x3dfaf1,_0x3e69b6,_0x5b90ae){var _0xe715f2={};var _0x1d2e2b={'Authorization':_0x2497('0x3f')+_0x3dfaf1[_0x2497('0x40')]};_0x3dfaf1['remoteUri']=intUtil[_0x2497('0x41')](_0x3dfaf1['remoteUri']);_0x3dfaf1[_0x2497('0x42')]=intUtil[_0x2497('0x41')](_0x3dfaf1['serverUrl']);var _0x54e9de=_0x3dfaf1[_0x2497('0x43')];_0xe715f2[_0x2497('0x13')]=_0x3dfaf1['username'];_0xe715f2['contactNumber']=_0x5b90ae[_0x2497('0x44')]()===_0x2497('0x45')?_0x5b053b[_0x2497('0x46')]:_0x5b053b['calleridnum'];_0xe715f2[_0x2497('0x47')]=_0x5b90ae===_0x2497('0x48')||_0x5b90ae===_0x2497('0x49')?_0x2497('0x48'):_0x2497('0x45');if(_0x1a116d){_0xe715f2[_0x2497('0x1c')]=_0x1a116d[_0x2497('0x12')];}var _0x4f9239=util[_0x2497('0x27')](_0x2497('0x4a'),_0x3dfaf1[_0x2497('0x42')],_0x5b053b['uniqueid'],md5(_0x5b053b[_0x2497('0x4b')]));if(_0x143845&&_0x143845[_0x2497('0x4c')]){logger[_0x2497('0x1a')](_0x2497('0x4d'),'Recording\x20is\x20enabled!');_0x5b053b[_0x2497('0x4e')]=_0x4f9239;}else if(_0x3e69b6&&_0x3e69b6[_0x2497('0x4f')]&&_0x3e69b6[_0x2497('0x4f')]!==_0x2497('0x50')){logger['info'](_0x2497('0x51'),'Recording\x20is\x20enabled!');_0x5b053b[_0x2497('0x4e')]=_0x4f9239;}else{_0x5b053b[_0x2497('0x4e')]='';}return getAdminId(_0xe715f2,_0x5b90ae,_0x1d2e2b,_0x54e9de)[_0x2497('0xf')](getUser(_0x5b90ae,_0x1d2e2b,_0x54e9de))[_0x2497('0xf')](getEndUser(_0x5b90ae,_0x1d2e2b,_0x54e9de))[_0x2497('0xf')](getTicket(_0x5b90ae,_0x1d2e2b,_0x54e9de,_0x1f04c4,_0x5b053b))[_0x2497('0xf')](function(_0x27b9a8){logger[_0x2497('0x1a')](util[_0x2497('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x27b9a8[_0x2497('0x39')]));if(_0x5b90ae!==_0x2497('0x49')){logger[_0x2497('0x1a')]('['+[_0x5b90ae['toUpperCase']()]+']',_0x2497('0x52'));emit(_0x54e9de,_0x1a116d[_0x2497('0x53')],_0x27b9a8['endUserId']);}})[_0x2497('0x16')](function(_0x2f5a37){logger[_0x2497('0x17')]('['+[_0x5b90ae[_0x2497('0x18')]()]+_0x2497('0x54'),util[_0x2497('0x55')](_0x2f5a37,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0982=['uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','userEmail','email','userId','User\x20found:','Admin\x20selected','catch','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','contact','/api/tasks','getString','Subjects','Contact','add','YYYY-MM-DDTHH:mm:ss','ticketId','task','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','username','toLowerCase','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x301272,_0x3de9bd){var _0x37a067=function(_0x4e9bd1){while(--_0x4e9bd1){_0x301272['push'](_0x301272['shift']());}};_0x37a067(++_0x3de9bd);}(_0x0982,0x106));var _0x2098=function(_0x1f1f87,_0x5a177a){_0x1f1f87=_0x1f1f87-0x0;var _0x3e6ca9=_0x0982[_0x1f1f87];return _0x3e6ca9;};'use strict';var _=require(_0x2098('0x0'));var rp=require('request-promise');var md5=require(_0x2098('0x1'));var util=require(_0x2098('0x2'));var moment=require(_0x2098('0x3'));var Promise=require(_0x2098('0x4'));var Redis=require(_0x2098('0x5'));var intUtil=require(_0x2098('0x6'));var config=require('../../../../config/environment');var logger=require(_0x2098('0x7'))(_0x2098('0x8'));config[_0x2098('0x9')]=_[_0x2098('0xa')](config[_0x2098('0x9')],{'host':_0x2098('0xb'),'port':0x18eb});var io=require(_0x2098('0xc'))(new Redis(config[_0x2098('0x9')]));function getAdminId(_0x426c7d,_0x2053db,_0x2f43a8,_0x55d8d2){return new Promise(function(_0x59e03c,_0x1f3091){var _0x59c488=![];var _0x47d7a1={'method':_0x2098('0xd'),'uri':_0x55d8d2+_0x2098('0xe'),'json':!![]};_0x47d7a1[_0x2098('0xf')]=_0x2f43a8;logger[_0x2098('0x10')](_0x2098('0x11'));return rp(_0x47d7a1)[_0x2098('0x12')](function(_0x41d53b){if(_0x41d53b){var _0x2e31f2=_0x41d53b[_0x2098('0x13')];var _0x5b02e5=null;for(_0x5b02e5=0x0;_0x5b02e5<_0x2e31f2[_0x2098('0x14')];_0x5b02e5++){if(_0x2e31f2[_0x5b02e5]['email']===_0x426c7d[_0x2098('0x15')]){_0x426c7d[_0x2098('0x16')]=_0x2e31f2[_0x5b02e5]['id'];_0x59c488=!![];}}if(_0x59c488){logger[_0x2098('0x10')](_0x2098('0x17'),_0x426c7d[_0x2098('0x16')]);_0x59e03c(_0x426c7d);}else{_0x1f3091({'statusCode':0x194,'message':_0x2098('0x18')});}}else{_0x1f3091({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x2f71bd){logger[_0x2098('0x19')]('['+[_0x2053db[_0x2098('0x1a')]()]+']',_0x2f71bd[_0x2098('0x1b')]);_0x1f3091(_0x2f71bd);});});}function getUser(_0x39a79d,_0x516009,_0x58a438){return function(_0x5307ee){return new Promise(function(_0x447c0d,_0x13cc12){var _0x16bcd1={'method':'GET','uri':_0x58a438+'/api/selector/owners','json':!![]};_0x16bcd1[_0x2098('0xf')]=_0x516009;logger[_0x2098('0x10')](_0x2098('0x1c'));return rp(_0x16bcd1)['then'](function(_0x4b156a){if(_0x4b156a){var _0x29ea53=_0x4b156a[_0x2098('0x13')];var _0x4a81bc=![];var _0x27314e=null;if(_0x5307ee[_0x2098('0x1d')]!==null){logger[_0x2098('0x10')]('Getting\x20user\x20with\x20email',_0x5307ee[_0x2098('0x1d')]);_0x5307ee[_0x2098('0x1e')]=_0x5307ee[_0x2098('0x1d')];for(_0x27314e=0x0;_0x27314e<_0x29ea53['length'];_0x27314e++){if(_0x29ea53[_0x27314e][_0x2098('0x1f')]===_0x5307ee[_0x2098('0x1d')]){_0x4a81bc=!![];_0x5307ee[_0x2098('0x20')]=_0x29ea53[_0x27314e]['id'];logger[_0x2098('0x10')](_0x2098('0x21'),_0x5307ee[_0x2098('0x20')]);}}}if(!_0x4a81bc){logger[_0x2098('0x10')](_0x2098('0x22'));_0x5307ee[_0x2098('0x1e')]=_0x5307ee[_0x2098('0x15')];_0x5307ee['userId']=_0x5307ee['adminId'];_0x4a81bc=!![];}if(_0x4a81bc){_0x447c0d(_0x5307ee);}else{_0x13cc12({'statusCode':0x194,'message':_0x2098('0x18')});}}else{_0x13cc12({'statusCode':0x194,'message':_0x2098('0x18')});}})[_0x2098('0x23')](function(_0x29f100){logger['error']('['+[_0x39a79d[_0x2098('0x1a')]()]+']',_0x29f100[_0x2098('0x1b')]);_0x13cc12(_0x29f100);});});};}function searchContact(_0x2d9794,_0x3ff7b7,_0x2039e9,_0x5b5a7a){return new Promise(function(_0x32e774,_0x39975d){var _0x97ce32={'method':_0x2098('0xd'),'headers':_0x3ff7b7,'uri':_0x2d9794+_0x2098('0x24')+_0x5b5a7a+_0x2098('0x25')+_0x2039e9+_0x2098('0x26'),'json':!![]};rp(_0x97ce32)['then'](function(_0x563db4){var _0x5f2887=_[_0x2098('0x27')](_0x563db4[_0x2098('0x28')][_0x2098('0x28')],[_0x2039e9,_0x5b5a7a]);_0x32e774(_0x5f2887);})[_0x2098('0x23')](function(_0x53f756){_0x39975d(_0x53f756);});});}function getEndUser(_0x512bda,_0x498901,_0x44959f){return function(_0x16d1c3){return new Promise(function(_0x16b61c,_0x526247){logger[_0x2098('0x10')](util[_0x2098('0x29')](_0x2098('0x2a'),_0x16d1c3[_0x2098('0x2b')]));searchContact(_0x44959f,_0x498901,_0x2098('0x2c'),_0x16d1c3[_0x2098('0x2b')])[_0x2098('0x12')](function(_0x493a14){if(_0x493a14){_0x16d1c3[_0x2098('0x2d')]=_0x493a14['id'];logger[_0x2098('0x10')]('Contact\x20found\x20mobile_number:',_0x16d1c3[_0x2098('0x2d')]);return _0x16b61c(_0x16d1c3);}searchContact(_0x44959f,_0x498901,_0x2098('0x2e'),_0x16d1c3[_0x2098('0x2b')])[_0x2098('0x12')](function(_0x29d760){if(_0x29d760){_0x16d1c3['endUserId']=_0x29d760['id'];logger[_0x2098('0x10')](_0x2098('0x2f'),_0x16d1c3['endUserId']);return _0x16b61c(_0x16d1c3);}createEndUser(_0x16d1c3,_0x512bda,_0x498901,_0x44959f)[_0x2098('0x12')](function(_0x35fa62){logger[_0x2098('0x10')](_0x2098('0x30'),_0x35fa62['endUserId']);return _0x16b61c(_0x35fa62);});});})[_0x2098('0x23')](function(_0x2f8712){_0x526247(_0x2f8712);});});};}function createEndUser(_0x31503e,_0x28067a,_0x1005dd,_0x16771f){return new Promise(function(_0x533747,_0x3de3e1){var _0x3a675e=moment();var _0x5eb559={'method':_0x2098('0x31'),'uri':_0x16771f+_0x2098('0x32'),'body':{'contact':{'last_name':_0x31503e[_0x2098('0x2b')],'work_number':_0x31503e[_0x2098('0x2b')],'mobile_number':_0x31503e[_0x2098('0x2b')],'owner_id':_0x31503e[_0x2098('0x20')],'created_at':_0x3a675e[_0x2098('0x29')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x5eb559[_0x2098('0xf')]=_0x1005dd;logger[_0x2098('0x10')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x5eb559)['then'](function(_0xf9ac85){_0x31503e[_0x2098('0x2d')]=_0xf9ac85[_0x2098('0x33')]['id'];_0x533747(_0x31503e);})[_0x2098('0x23')](function(_0x2e35f6){logger[_0x2098('0x19')]('['+[_0x28067a[_0x2098('0x1a')]()]+']',_0x2e35f6[_0x2098('0x1b')]);_0x3de3e1(_0x2e35f6[_0x2098('0x1b')]);});});}function getTicket(_0x56819c,_0x51b2cb,_0x5dbefb,_0x4e8d1c,_0x3b2384){return function(_0x2b8009){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x1f19ef,_0x51f5af){var _0x20635d=moment();var _0x41789f={'method':_0x2098('0x31'),'uri':_0x5dbefb+_0x2098('0x34'),'body':{'title':intUtil[_0x2098('0x35')](_0x4e8d1c[_0x2098('0x36')],_0x3b2384,'\x20'),'description':intUtil['getString'](_0x4e8d1c['Descriptions'],_0x3b2384,'\x0a'),'owner_id':_0x2b8009['userId'],'creater_id':_0x2b8009['adminId'],'targetable_id':_0x2b8009[_0x2098('0x2d')],'targetable_type':_0x2098('0x37'),'created_at':_0x20635d[_0x2098('0x29')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x20635d[_0x2098('0x38')](0x1e,'m')[_0x2098('0x29')](_0x2098('0x39'))},'json':!![]};_0x41789f[_0x2098('0xf')]=_0x51b2cb;return rp(_0x41789f)[_0x2098('0x12')](function(_0x297fc3){_0x2b8009[_0x2098('0x3a')]=_0x297fc3[_0x2098('0x3b')]['id'];logger['info']('Task\x20created:',_0x2b8009[_0x2098('0x3a')]);_0x1f19ef(_0x2b8009);})[_0x2098('0x23')](function(_0x5eaf35){logger['error']('['+[_0x56819c[_0x2098('0x1a')]()]+']',_0x5eaf35[_0x2098('0x1b')]);_0x51f5af(_0x5eaf35['message']);});});};}function emit(_0x3bff74,_0x324d57,_0x4bbfff){var _0x3d1663={'uri':_0x3bff74+_0x2098('0x3c')+_0x4bbfff};io['to'](util[_0x2098('0x29')](_0x2098('0x3d'),_0x324d57))['emit'](_0x2098('0x3e'),_0x3d1663);}exports['cs']=function(_0x70572c,_0x5a9306,_0x10d70d,_0x4cfad3,_0x368a01,_0x158851,_0x1f3d0d,_0x5cd59b){var _0x437b79={};var _0x1347cb={'Authorization':_0x2098('0x3f')+_0x158851[_0x2098('0x40')]};_0x158851[_0x2098('0x41')]=intUtil['stripTrailingSlash'](_0x158851[_0x2098('0x41')]);_0x158851[_0x2098('0x42')]=intUtil['stripTrailingSlash'](_0x158851['serverUrl']);var _0x5a40e4=_0x158851[_0x2098('0x41')];_0x437b79[_0x2098('0x15')]=_0x158851[_0x2098('0x43')];_0x437b79[_0x2098('0x2b')]=_0x5cd59b[_0x2098('0x44')]()==='outbound'?_0x5a9306['destcalleridnum']:_0x5a9306['calleridnum'];_0x437b79[_0x2098('0x45')]=_0x5cd59b===_0x2098('0x46')||_0x5cd59b===_0x2098('0x47')?_0x2098('0x46'):_0x2098('0x48');if(_0x4cfad3){_0x437b79[_0x2098('0x1d')]=_0x4cfad3[_0x2098('0x1f')];}var _0x27b961=util[_0x2098('0x29')](_0x2098('0x49'),_0x158851['serverUrl'],_0x5a9306[_0x2098('0x4a')],md5(_0x5a9306[_0x2098('0x4a')]));if(_0x368a01&&_0x368a01[_0x2098('0x4b')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a9306[_0x2098('0x4c')]=_0x27b961;}else if(_0x1f3d0d&&_0x1f3d0d[_0x2098('0x4d')]&&_0x1f3d0d[_0x2098('0x4d')]!=='none'){logger[_0x2098('0x10')](_0x2098('0x4e'),'Recording\x20is\x20enabled!');_0x5a9306[_0x2098('0x4c')]=_0x27b961;}else{_0x5a9306['recordingURL']='';}return getAdminId(_0x437b79,_0x5cd59b,_0x1347cb,_0x5a40e4)[_0x2098('0x12')](getUser(_0x5cd59b,_0x1347cb,_0x5a40e4))[_0x2098('0x12')](getEndUser(_0x5cd59b,_0x1347cb,_0x5a40e4))['then'](getTicket(_0x5cd59b,_0x1347cb,_0x5a40e4,_0x10d70d,_0x5a9306))[_0x2098('0x12')](function(_0x29c79d){logger[_0x2098('0x10')](util['format'](_0x2098('0x4f'),_0x29c79d['ticketId']));if(_0x5cd59b!=='unmanaged'){logger[_0x2098('0x10')]('['+[_0x5cd59b[_0x2098('0x1a')]()]+']',_0x2098('0x50'));emit(_0x5a40e4,_0x4cfad3[_0x2098('0x51')],_0x29c79d[_0x2098('0x2d')]);}})[_0x2098('0x23')](function(_0x26497a){logger[_0x2098('0x19')]('['+[_0x5cd59b[_0x2098('0x1a')]()]+_0x2098('0x52'),util[_0x2098('0x53')](_0x26497a,{'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 b6ee708..b2dbb2a 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 _0x4705=['toLowerCase','data2','find','data3','queue','routeId','outbound','log','unmanaged','salesforce','freshsales','data1','error','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes'];(function(_0x42b105,_0x5b29d9){var _0x26ca0a=function(_0x5c053b){while(--_0x5c053b){_0x42b105['push'](_0x42b105['shift']());}};_0x26ca0a(++_0x5b29d9);}(_0x4705,0x83));var _0x5470=function(_0x3e296f,_0x3f783a){_0x3e296f=_0x3e296f-0x0;var _0x2b4660=_0x4705[_0x3e296f];return _0x2b4660;};'use strict';var _=require(_0x5470('0x0'));var util=require(_0x5470('0x1'));var zendesk=require(_0x5470('0x2'));var salesforce=require(_0x5470('0x3'));var sugarcrm=require(_0x5470('0x4'));var freshdesk=require(_0x5470('0x5'));var zoho=require(_0x5470('0x6'));var desk=require(_0x5470('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0x5470('0x8'));var dynamics365=require(_0x5470('0x9'));var freshsales=require(_0x5470('0xa'));var integrations=[_0x5470('0xb'),'salesforce',_0x5470('0xc'),_0x5470('0xd'),_0x5470('0xe'),_0x5470('0xf'),_0x5470('0x10'),_0x5470('0x11'),'freshsales',_0x5470('0x12')];exports[_0x5470('0x13')]=function(_0x1b91e1,_0x39db9c,_0xbb7c82,_0x38d1e4,_0x1f1f45,_0x15e951){if(_0xbb7c82){if(_[_0x5470('0x14')](integrations,_0x1b91e1['data1'][_0x5470('0x15')]())){try{var _0x19f190=null;var _0x28992b='';var _0x3bbc8e=_0xbb7c82[_0x1b91e1['data1'][_0x5470('0x15')]()];if(_0x3bbc8e){var _0x366f7d=_0x3bbc8e[_0x1b91e1[_0x5470('0x16')]];if(_0x366f7d){var _0x55d908=_[_0x5470('0x17')](_0x366f7d['Configurations'],{'id':parseInt(_0x1b91e1[_0x5470('0x18')],0xa)});if(_0x55d908){if(_0x38d1e4){if(_0x1f1f45&&_0x39db9c[_0x5470('0x19')]){_0x28992b='queue';}else if(_0x39db9c[_0x5470('0x1a')]){_0x28992b=_0x5470('0x1b');}else{console[_0x5470('0x1c')]('EVENT\x20UNKNOWN',_0x39db9c);}}else{_0x28992b=_0x5470('0x1d');}switch(_0x1b91e1['data1'][_0x5470('0x15')]()){case _0x5470('0xb'):zendesk[_0x28992b](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951);break;case _0x5470('0x1e'):salesforce[_0x28992b](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951);break;case _0x5470('0xc'):sugarcrm[_0x28992b](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951);break;case _0x5470('0xd'):freshdesk[_0x28992b](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951);break;case'zoho':zoho[_0x28992b](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951);break;case _0x5470('0xf'):desk[_0x28992b](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951);break;case _0x5470('0x10'):vtiger[_0x28992b](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951);break;case _0x5470('0x1f'):freshsales['cs'](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951,_0x28992b);break;case _0x5470('0x12'):servicenow['cs'](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951,_0x28992b);break;case _0x5470('0x11'):dynamics365['cs'](_0x1b91e1,_0x39db9c,_0x55d908,_0x38d1e4,_0x1f1f45,_0x366f7d,_0x15e951,_0x28992b);break;default:console[_0x5470('0x1c')]('unknown\x20integration');}}else{_0x19f190=require('../../../../config/logger')(_0x1b91e1[_0x5470('0x20')][_0x5470('0x15')]());_0x19f190[_0x5470('0x21')]('[EXEC]',util[_0x5470('0x22')](_0x5470('0x23'),_0x1b91e1[_0x5470('0x20')]['toLowerCase'](),_0x1b91e1[_0x5470('0x18')]));}}else{_0x19f190=require(_0x5470('0x24'))(_0x1b91e1['data1'][_0x5470('0x15')]());_0x19f190[_0x5470('0x21')]('[EXEC]',util[_0x5470('0x22')](_0x5470('0x25'),_0x1b91e1['data1'][_0x5470('0x15')](),_0x1b91e1['data2']));}}else{}}catch(_0x5c5e53){console[_0x5470('0x21')](_0x5c5e53);}}}}; \ No newline at end of file +var _0xe1ce=['./servicenow','./dynamics365','zendesk','salesforce','zoho','desk','vtiger','freshsales','servicenow','exec','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','sugarcrm','log','unknown\x20integration','../../../../config/logger','[EXEC]','format','error','lodash','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger'];(function(_0x415ad9,_0x1a8b94){var _0x170340=function(_0x524ab2){while(--_0x524ab2){_0x415ad9['push'](_0x415ad9['shift']());}};_0x170340(++_0x1a8b94);}(_0xe1ce,0x12b));var _0xee1c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xe1ce[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xee1c('0x0'));var util=require('util');var zendesk=require(_0xee1c('0x1'));var salesforce=require(_0xee1c('0x2'));var sugarcrm=require(_0xee1c('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xee1c('0x4'));var desk=require(_0xee1c('0x5'));var vtiger=require(_0xee1c('0x6'));var servicenow=require(_0xee1c('0x7'));var dynamics365=require(_0xee1c('0x8'));var freshsales=require('./freshsales');var integrations=[_0xee1c('0x9'),_0xee1c('0xa'),'sugarcrm','freshdesk',_0xee1c('0xb'),_0xee1c('0xc'),_0xee1c('0xd'),'dynamics365',_0xee1c('0xe'),_0xee1c('0xf')];exports[_0xee1c('0x10')]=function(_0x20c45c,_0x3d5259,_0x2d7fe7,_0x5eab04,_0xf5f14,_0x1e4a3f){if(_0x2d7fe7){if(_['includes'](integrations,_0x20c45c[_0xee1c('0x11')]['toLowerCase']())){try{var _0x3b110c=null;var _0x567653='';var _0x3f3c4f=_0x2d7fe7[_0x20c45c['data1'][_0xee1c('0x12')]()];if(_0x3f3c4f){var _0x3cf439=_0x3f3c4f[_0x20c45c[_0xee1c('0x13')]];if(_0x3cf439){var _0x4f23c2=_['find'](_0x3cf439[_0xee1c('0x14')],{'id':parseInt(_0x20c45c[_0xee1c('0x15')],0xa)});if(_0x4f23c2){if(_0x5eab04){if(_0xf5f14&&_0x3d5259[_0xee1c('0x16')]){_0x567653=_0xee1c('0x16');}else if(_0x3d5259[_0xee1c('0x17')]){_0x567653=_0xee1c('0x18');}else{console['log'](_0xee1c('0x19'),_0x3d5259);}}else{_0x567653=_0xee1c('0x1a');}switch(_0x20c45c[_0xee1c('0x11')][_0xee1c('0x12')]()){case _0xee1c('0x9'):zendesk[_0x567653](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f);break;case _0xee1c('0xa'):salesforce[_0x567653](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f);break;case _0xee1c('0x1b'):sugarcrm[_0x567653](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f);break;case'freshdesk':freshdesk[_0x567653](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f);break;case'zoho':zoho[_0x567653](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f);break;case _0xee1c('0xc'):desk[_0x567653](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f);break;case _0xee1c('0xd'):vtiger[_0x567653](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f);break;case _0xee1c('0xe'):freshsales['cs'](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f,_0x567653);break;case'servicenow':servicenow['cs'](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f,_0x567653);break;case'dynamics365':dynamics365['cs'](_0x20c45c,_0x3d5259,_0x4f23c2,_0x5eab04,_0xf5f14,_0x3cf439,_0x1e4a3f,_0x567653);break;default:console[_0xee1c('0x1c')](_0xee1c('0x1d'));}}else{_0x3b110c=require(_0xee1c('0x1e'))(_0x20c45c[_0xee1c('0x11')][_0xee1c('0x12')]());_0x3b110c['error'](_0xee1c('0x1f'),util[_0xee1c('0x20')]('%s\x20configuration\x20#%s\x20not\x20found',_0x20c45c[_0xee1c('0x11')][_0xee1c('0x12')](),_0x20c45c[_0xee1c('0x15')]));}}else{_0x3b110c=require(_0xee1c('0x1e'))(_0x20c45c[_0xee1c('0x11')]['toLowerCase']());_0x3b110c[_0xee1c('0x21')](_0xee1c('0x1f'),util[_0xee1c('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x20c45c[_0xee1c('0x11')][_0xee1c('0x12')](),_0x20c45c[_0xee1c('0x13')]));}}else{}}catch(_0x16c8f3){console['error'](_0x16c8f3);}}}}; \ 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 4dcc2aa..e10a17a 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 _0xe51c=['uniqueid','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','error','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','emit','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','account','WhatId','Case','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','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','additionalSearchContact','merge','$or','Contact','find','cloneDeep','additionalSearchLead','Lead','additionalSearchAccount','Account','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','Company','No\x20Company','includes','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x5a34ae,_0x5682d8){var _0x2841d7=function(_0x2ef934){while(--_0x2ef934){_0x5a34ae['push'](_0x5a34ae['shift']());}};_0x2841d7(++_0x5682d8);}(_0xe51c,0x19e));var _0xce51=function(_0x595151,_0x1f1f72){_0x595151=_0x595151-0x0;var _0x5776df=_0xe51c[_0x595151];return _0x5776df;};'use strict';var _=require(_0xce51('0x0'));var rp=require(_0xce51('0x1'));var moment=require(_0xce51('0x2'));var BPromise=require(_0xce51('0x3'));var md5=require(_0xce51('0x4'));var jsforce=require(_0xce51('0x5'));var util=require(_0xce51('0x6'));var Redis=require(_0xce51('0x7'));var intUtil=require(_0xce51('0x8'));var config=require(_0xce51('0x9'));var logger=require(_0xce51('0xa'))(_0xce51('0xb'));config[_0xce51('0xc')]=_['defaults'](config[_0xce51('0xc')],{'host':_0xce51('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xce51('0xc')]));function emit(_0x3fabc2,_0x4f7db5,_0x479a79){io['to'](_0x3fabc2)[_0xce51('0xe')](_0x4f7db5,_0x479a79);}function getTicket(_0x443e94,_0x1069ff,_0x5d0bca,_0x27d365,_0x2ccb00,_0x1805cb,_0x49ef72,_0x3e7199){var _0xdca0fc=Object[_0xce51('0xf')]({},{'OwnerId':_0x1069ff['id'],'Subject':intUtil['getString'](_0x27d365[_0xce51('0x10')],_0x2ccb00,'\x20'),'Description':intUtil[_0xce51('0x11')](_0x27d365[_0xce51('0x12')],_0x2ccb00,'\x0a')},getCustomFields(_0x1805cb,_0x2ccb00));if(_0x5d0bca){if(_0x27d365[_0xce51('0x13')]===_0xce51('0x14')){_0xdca0fc[_0xce51('0x15')]=moment[_0xce51('0x16')]();_0xdca0fc['IsReminderSet']=![];_0xdca0fc[_0xce51('0x17')]=![];if(_0x5d0bca[_0xce51('0x18')]===_0xce51('0x19')||_0x5d0bca[_0xce51('0x18')]===_0xce51('0x1a')){_0xdca0fc['WhoId']=_0x5d0bca['id'];}else if(_0x5d0bca['endUserType']===_0xce51('0x1b')){_0xdca0fc[_0xce51('0x1c')]=_0x5d0bca['id'];}}else if(_0x27d365[_0xce51('0x13')]===_0xce51('0x1d')){if(_0x5d0bca[_0xce51('0x18')]===_0xce51('0x19')){_0xdca0fc['ContactId']=_0x5d0bca['id'];}else if(_0x5d0bca[_0xce51('0x18')]===_0xce51('0x1b')){_0xdca0fc['AccountId']=_0x5d0bca['id'];}else if(_0x5d0bca[_0xce51('0x18')]===_0xce51('0x1a')&&_0x27d365[_0xce51('0x1e')]){_0xdca0fc[_0x27d365[_0xce51('0x1e')]]=_0x5d0bca['id'];}else{logger['info'](_0xce51('0x1f'));}}}return _0x49ef72[_0xce51('0x20')](_0x27d365[_0xce51('0x13')])[_0xce51('0x21')](_0xdca0fc);}function getUser(_0x2f5f90,_0x5f0d0a,_0x4b6055){if(!_[_0xce51('0x22')](_0x5f0d0a)&&intUtil['validateEmail'](_0x5f0d0a)){var _0x2c4857={'Email':_0x5f0d0a};var _0x5ddb53={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4b6055[_0xce51('0x20')](_0xce51('0x23'))['find'](_0x2c4857,_0x5ddb53)[_0xce51('0x24')]()[_0xce51('0x25')](function(_0x8c1c41){if(_0x8c1c41[_0xce51('0x26')]){var _0x1d5c48=_['find'](_0x8c1c41,function(_0x148218){return _0x148218[_0xce51('0x27')]===_0x5f0d0a;});if(_0x1d5c48){logger[_0xce51('0x28')](_0xce51('0x29'),_0x5f0d0a);return BPromise[_0xce51('0x2a')]({'id':_0x1d5c48['Id'],'name':_0x1d5c48[_0xce51('0x2b')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5f0d0a);return _0x4b6055[_0xce51('0x2c')]()['then'](function(_0x55d35f){return BPromise[_0xce51('0x2a')]({'id':_0x55d35f[_0xce51('0x2d')],'name':_0x55d35f['display_name']});});}});}else{logger[_0xce51('0x28')](_0xce51('0x2e'),_0x5f0d0a);return _0x4b6055[_0xce51('0x2c')]()[_0xce51('0x25')](function(_0x4527df){return BPromise[_0xce51('0x2a')]({'id':_0x4527df[_0xce51('0x2d')],'name':_0x4527df[_0xce51('0x2f')]});});}}function getEndUser(_0x1039fb,_0x20185e,_0x2571e0,_0x2747dc,_0x566105){var _0x4325f3={'$or':{'Phone':_0x2747dc}};var _0x32062f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xce51('0x2a')]()['then'](function(){logger[_0xce51('0x28')](_0xce51('0x30'),_0x2747dc,_0x20185e[_0xce51('0x31')]);switch(_0x20185e[_0xce51('0x31')]){case'contact_lead':var _0x3a35fd=_['cloneDeep'](_0x4325f3);if(_0x20185e[_0xce51('0x32')]){var _0x4275fa={};_0x4275fa[_0x20185e[_0xce51('0x32')]]=_0x2747dc;_[_0xce51('0x33')](_0x3a35fd[_0xce51('0x34')],_0x4275fa);}return _0x566105[_0xce51('0x20')](_0xce51('0x35'))[_0xce51('0x36')](_0x3a35fd,_0x32062f)['execute']()[_0xce51('0x25')](function(_0x47bb8a){if(_0x47bb8a&&_0x47bb8a[_0xce51('0x26')]){return _0x47bb8a;}else{var _0x1d8b9c=_[_0xce51('0x37')](_0x4325f3);if(_0x20185e['additionalSearchLead']){var _0x3cac6b={};_0x3cac6b[_0x20185e[_0xce51('0x38')]]=_0x2747dc;_['merge'](_0x1d8b9c['$or'],_0x3cac6b);}return _0x566105['sobject'](_0xce51('0x39'))[_0xce51('0x36')](_0x1d8b9c,_0x32062f);}});case'account_contact_lead':var _0x5957b5=_[_0xce51('0x37')](_0x4325f3);if(_0x20185e[_0xce51('0x3a')]){var _0x4275fa={};_0x4275fa[_0x20185e[_0xce51('0x3a')]]=_0x2747dc;_[_0xce51('0x33')](_0x5957b5[_0xce51('0x34')],_0x4275fa);}return _0x566105[_0xce51('0x20')](_0xce51('0x3b'))[_0xce51('0x36')](_0x5957b5,_0x32062f)[_0xce51('0x24')]()[_0xce51('0x25')](function(_0x1ecff2){if(_0x1ecff2&&_0x1ecff2[_0xce51('0x26')]){return _0x1ecff2;}else{var _0x5118de=_[_0xce51('0x37')](_0x4325f3);if(_0x20185e[_0xce51('0x32')]){var _0x36c561={};_0x36c561[_0x20185e[_0xce51('0x32')]]=_0x2747dc;_[_0xce51('0x33')](_0x5118de[_0xce51('0x34')],_0x36c561);}return _0x566105[_0xce51('0x20')](_0xce51('0x35'))[_0xce51('0x36')](_0x5118de,_0x32062f)['then'](function(_0x1b97c3){if(_0x1b97c3&&_0x1b97c3[_0xce51('0x26')]){return _0x1b97c3;}else{var _0x5b1496=_[_0xce51('0x37')](_0x4325f3);if(_0x20185e[_0xce51('0x38')]){var _0x8847e8={};_0x8847e8[_0x20185e[_0xce51('0x38')]]=_0x2747dc;_[_0xce51('0x33')](_0x5b1496['$or'],_0x8847e8);}return _0x566105[_0xce51('0x20')](_0xce51('0x39'))[_0xce51('0x36')](_0x5b1496,_0x32062f);}});}});case _0xce51('0x19'):var _0x3a35fd=_[_0xce51('0x37')](_0x4325f3);if(_0x20185e[_0xce51('0x32')]){var _0x4275fa={};_0x4275fa[_0x20185e[_0xce51('0x32')]]=_0x2747dc;_[_0xce51('0x33')](_0x3a35fd[_0xce51('0x34')],_0x4275fa);}return _0x566105[_0xce51('0x20')](_0xce51('0x35'))['find'](_0x3a35fd,_0x32062f)[_0xce51('0x24')]();case _0xce51('0x1a'):var _0x8fcb29=_[_0xce51('0x37')](_0x4325f3);if(_0x20185e[_0xce51('0x38')]){var _0x4275fa={};_0x4275fa[_0x20185e[_0xce51('0x38')]]=_0x2747dc;_[_0xce51('0x33')](_0x8fcb29[_0xce51('0x34')],_0x4275fa);}return _0x566105[_0xce51('0x20')](_0xce51('0x39'))['find'](_0x8fcb29,_0x32062f);case _0xce51('0x1b'):var _0x5957b5=_['cloneDeep'](_0x4325f3);if(_0x20185e['additionalSearchAccount']){var _0x4275fa={};_0x4275fa[_0x20185e[_0xce51('0x3a')]]=_0x2747dc;_['merge'](_0x5957b5[_0xce51('0x34')],_0x4275fa);}return _0x566105[_0xce51('0x20')]('Account')[_0xce51('0x36')](_0x5957b5,_0x32062f);default:return null;}})[_0xce51('0x25')](function(_0x283cff){if(_0x283cff&&_0x283cff[_0xce51('0x26')]){var _0x21950d=_['first'](_0x283cff);if(_0x21950d){return BPromise[_0xce51('0x2a')]({'id':_0x21950d['Id'],'name':_0x21950d[_0xce51('0x2b')],'phone':_0x21950d[_0xce51('0x3c')],'endUserType':_0x21950d['attributes'][_0xce51('0x3d')][_0xce51('0x3e')]()});}}})[_0xce51('0x25')](function(_0x14b0c4){if(_0x14b0c4){logger[_0xce51('0x28')](_0xce51('0x3f'),_0x14b0c4[_0xce51('0x18')],_0x2747dc);return BPromise[_0xce51('0x2a')](_0x14b0c4);}else{logger[_0xce51('0x28')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x2747dc);var _0x119d9a={'Phone':_0x2747dc};if(_0x20185e[_0xce51('0x40')]){if(_0x20185e[_0xce51('0x40')]===_0xce51('0x19')){logger[_0xce51('0x28')](_0xce51('0x41'),_0x2747dc,_0x20185e[_0xce51('0x40')]);_0x119d9a[_0xce51('0x42')]=_0x2571e0!==''?_0x2571e0:util[_0xce51('0x43')](_0xce51('0x44'),_0x2747dc);}else if(_0x20185e[_0xce51('0x40')]===_0xce51('0x1a')){logger[_0xce51('0x28')](_0xce51('0x41'),_0x2747dc,_0x20185e[_0xce51('0x40')]);_0x119d9a[_0xce51('0x42')]=_0x2571e0!==''?_0x2571e0:util[_0xce51('0x43')](_0xce51('0x44'),_0x2747dc);_0x119d9a[_0xce51('0x45')]=_0xce51('0x46');}else if(_0x20185e[_0xce51('0x40')]===_0xce51('0x1b')){logger['info'](_0xce51('0x41'),_0x2747dc,_0x20185e[_0xce51('0x40')]);_0x119d9a[_0xce51('0x2b')]=_0x2571e0!==''?_0x2571e0:util[_0xce51('0x43')](_0xce51('0x44'),_0x2747dc);}else{return null;}}return _0x566105[_0xce51('0x20')](_['upperFirst'](_0x20185e[_0xce51('0x40')]))[_0xce51('0x21')](_0x119d9a)['then'](function(_0xc75155){return BPromise[_0xce51('0x2a')]({'id':_0xc75155['id'],'endUserType':_0x20185e[_0xce51('0x40')]});});}});}function getCustomFields(_0x4ed93f,_0x1f8814){var _0x1cfd4c={};if(_0x4ed93f['length']>0x0){_['forEach'](_0x4ed93f,function(_0xd933f3){if(_[_0xce51('0x47')]([_0xce51('0x48'),_0xce51('0x49')],_0xd933f3['type'])&&_0xd933f3[_0xce51('0x4a')]){_0x1cfd4c[_0xd933f3[_0xce51('0x4a')]]=_0xd933f3['content'][_0xce51('0x4b')]();}else if(_0xd933f3[_0xce51('0x3d')]===_0xce51('0x4c')&&_0xd933f3[_0xce51('0x4d')]&&_0xd933f3[_0xce51('0x4a')]){_0x1f8814[_0xd933f3[_0xce51('0x4d')]]&&(_0x1cfd4c[_0xd933f3[_0xce51('0x4a')]]=_0x1f8814[_0xd933f3[_0xce51('0x4d')]][_0xce51('0x4b')]());}else if(_0xd933f3[_0xce51('0x3d')]===_0xce51('0x4e')&&_0xd933f3[_0xce51('0x4f')]&&_0xd933f3[_0xce51('0x4f')][_0xce51('0x50')]&&_0xd933f3[_0xce51('0x4a')]){_0x1f8814[_0xd933f3[_0xce51('0x4f')]['name'][_0xce51('0x3e')]()]&&(_0x1cfd4c[_0xd933f3['idField']]=_0x1f8814[_0xd933f3[_0xce51('0x4f')][_0xce51('0x50')][_0xce51('0x3e')]()][_0xce51('0x4b')]());}});}return _0x1cfd4c;}function getConnection(_0x3793bd){var _0x56e1a1=_0x3793bd[_0xce51('0x51')][_0xce51('0x52')](_0x3793bd[_0xce51('0x53')]);var _0xb3742e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3793bd[_0xce51('0x54')]||'https://login.salesforce.com','clientId':_0x3793bd[_0xce51('0x55')],'clientSecret':_0x3793bd[_0xce51('0x56')]}});return _0xb3742e[_0xce51('0x57')](_0x3793bd[_0xce51('0x58')],_0x56e1a1)[_0xce51('0x25')](function(){logger['info'](_0xce51('0x59'));return _0xb3742e;});}exports[_0xce51('0x5a')]=function(_0x4c66fd,_0x46b4c1,_0x21684a,_0x7b27ed,_0xb22b95,_0x10056c){var _0x164536,_0x327a17,_0x641626,_0x196ad3;_0x10056c[_0xce51('0x5b')]=intUtil[_0xce51('0x5c')](_0x10056c[_0xce51('0x5b')]);_0x10056c[_0xce51('0x54')]=intUtil[_0xce51('0x5c')](_0x10056c[_0xce51('0x54')]);if(_0xb22b95&&_0xb22b95[_0xce51('0x5d')]){logger[_0xce51('0x28')](_0xce51('0x5e'),_0xce51('0x5f'));_0x46b4c1[_0xce51('0x60')]=util['format'](_0xce51('0x61'),_0x10056c[_0xce51('0x5b')],_0x46b4c1[_0xce51('0x62')],md5(_0x46b4c1['uniqueid']));}else{_0x46b4c1[_0xce51('0x60')]='';}return getConnection(_0x10056c)['then'](function(_0x4da857){_0x196ad3=_0x4da857;return getUser(_0x10056c,_0x7b27ed['email'],_0x196ad3);})[_0xce51('0x25')](function(_0x1102fd){_0x164536=_0x1102fd;return getEndUser(_0x10056c,_0x21684a,_0x46b4c1['calleridname'],_0x46b4c1[_0xce51('0x63')],_0x196ad3);})['then'](function(_0x2aed99){_0x327a17=_0x2aed99;return getTicket(_0x10056c,_0x164536,_0x327a17,_0x21684a,_0x46b4c1,_0x21684a[_0xce51('0x64')],_0x196ad3,_0xce51('0x5a'));})[_0xce51('0x25')](function(_0x421963){_0x641626=_0x421963;logger['info'](_0xce51('0x65'),_0x641626['id']);logger[_0xce51('0x28')](_0xce51('0x66'),_0x641626['id'],_0x7b27ed[_0xce51('0x50')],_0x10056c[_0xce51('0x3d')]);switch(_0x10056c[_0xce51('0x3d')]){case _0xce51('0x67'):emit(util['format'](_0xce51('0x68'),_0x7b27ed[_0xce51('0x50')]),'trigger:salesforce:display',{'recordId':_0x641626['id']});break;case _0xce51('0x69'):emit(util['format'](_0xce51('0x68'),_0x7b27ed['name']),_0xce51('0x6a'),{'uri':util[_0xce51('0x43')]('%s/%s/e',_0x196ad3[_0xce51('0x6b')],_0x641626['id'])});break;default:logger['error'](_0xce51('0x6c'));}})['catch'](function(_0x2d1c4b){logger[_0xce51('0x6d')](_0xce51('0x5e'),_0x2d1c4b);});};exports[_0xce51('0x6e')]=function(_0x587a2e,_0x322a18,_0x478a97,_0x50d815,_0xb8e1a6,_0x916c19,_0x14a96e){var _0x2020e2,_0x51b2b0,_0x5c37ab,_0x18376a;_0x916c19[_0xce51('0x5b')]=intUtil[_0xce51('0x5c')](_0x916c19['serverUrl']);_0x916c19[_0xce51('0x54')]=intUtil[_0xce51('0x5c')](_0x916c19[_0xce51('0x54')]);if(_0x14a96e&&_0x14a96e['recordingFormat']&&_0x14a96e[_0xce51('0x6f')]!==_0xce51('0x70')){logger[_0xce51('0x28')](_0xce51('0x71'),_0xce51('0x5f'));_0x322a18[_0xce51('0x60')]=util[_0xce51('0x43')](_0xce51('0x61'),_0x916c19[_0xce51('0x5b')],_0x322a18[_0xce51('0x62')],md5(_0x322a18[_0xce51('0x62')]));}return getConnection(_0x916c19)[_0xce51('0x25')](function(_0x56ec29){_0x18376a=_0x56ec29;return getUser(_0x916c19,_0x50d815[_0xce51('0x72')],_0x18376a);})['then'](function(_0x59b0f9){_0x2020e2=_0x59b0f9;return getEndUser(_0x916c19,_0x478a97,_0x322a18[_0xce51('0x73')],_0x322a18[_0xce51('0x74')],_0x18376a);})[_0xce51('0x25')](function(_0x1f587e){_0x51b2b0=_0x1f587e;return getTicket(_0x916c19,_0x2020e2,_0x51b2b0,_0x478a97,_0x322a18,_0x478a97[_0xce51('0x64')],_0x18376a,_0xce51('0x6e'));})[_0xce51('0x25')](function(_0x30dce5){_0x5c37ab=_0x30dce5;logger['info'](_0xce51('0x75'),_0x5c37ab['id']);logger[_0xce51('0x28')](_0xce51('0x76'),_0x5c37ab['id'],_0x50d815['name'],_0x916c19[_0xce51('0x3d')]);switch(_0x916c19[_0xce51('0x3d')]){case _0xce51('0x67'):emit(util[_0xce51('0x43')](_0xce51('0x68'),_0x50d815[_0xce51('0x50')]),_0xce51('0x77'),{'recordId':_0x5c37ab['id']});break;case _0xce51('0x69'):emit(util['format']('user:%s',_0x50d815[_0xce51('0x50')]),_0xce51('0x6a'),{'uri':util[_0xce51('0x43')](_0xce51('0x78'),_0x18376a[_0xce51('0x6b')],_0x5c37ab['id'])});break;default:logger[_0xce51('0x6d')](_0xce51('0x71'),_0xce51('0x79'));}})['catch'](function(_0x3ab377){logger[_0xce51('0x6d')](_0xce51('0x71'),_0x3ab377);});};exports['unmanaged']=function(_0x5d3158,_0x262dd6,_0x5e0a82,_0x570f79,_0xaff7b2,_0x501665){var _0x402970,_0x173e26,_0x206a93,_0x6927ad;_0x501665[_0xce51('0x5b')]=intUtil[_0xce51('0x5c')](_0x501665[_0xce51('0x5b')]);_0x501665[_0xce51('0x54')]=intUtil[_0xce51('0x5c')](_0x501665[_0xce51('0x54')]);if(_0xaff7b2&&_0xaff7b2[_0xce51('0x5d')]){logger[_0xce51('0x28')]('['+_0x262dd6[_0xce51('0x7a')][_0xce51('0x7b')]()+']',_0xce51('0x5f'));_0x262dd6['recordingURL']=util[_0xce51('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x501665['serverUrl'],_0x262dd6[_0xce51('0x62')],md5(_0x262dd6[_0xce51('0x62')]));}else{_0x262dd6[_0xce51('0x60')]='';}return getConnection(_0x501665)[_0xce51('0x25')](function(_0x295e6c){_0x6927ad=_0x295e6c;if(!_[_0xce51('0x22')](_0x570f79)){return getUser(_0x501665,_0x570f79['name'],_0x6927ad);}else{return getUser(_0x501665,null,_0x6927ad);}})[_0xce51('0x25')](function(_0x23fb01){_0x402970=_0x23fb01;return getEndUser(_0x501665,_0x5e0a82,_0x262dd6[_0xce51('0x7c')],_0x262dd6[_0xce51('0x63')],_0x6927ad);})[_0xce51('0x25')](function(_0x14fd0a){_0x173e26=_0x14fd0a;return getTicket(_0x501665,_0x402970,_0x173e26,_0x5e0a82,_0x262dd6,_0x5e0a82[_0xce51('0x64')],_0x6927ad);})['then'](function(_0xff7e16){_0x206a93=_0xff7e16;logger[_0xce51('0x28')]('['+_0x262dd6[_0xce51('0x7a')][_0xce51('0x7b')]()+_0xce51('0x7d'),_0x206a93['id']);logger[_0xce51('0x28')]('['+_0x262dd6[_0xce51('0x7a')][_0xce51('0x7b')]()+_0xce51('0x7e'),_0x501665['type']);})[_0xce51('0x7f')](function(_0x2563f5){logger[_0xce51('0x6d')]('['+_0x262dd6[_0xce51('0x7a')][_0xce51('0x7b')]()+']',_0x2563f5);});}; \ No newline at end of file +var _0x7d13=['[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','isNil','calleridname','calleridnum','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','redis','defaults','socket.io-emitter','assign','Subjects','getString','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','validateEmail','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','upperFirst','create','forEach','includes','string','picklist','idField','content','variableName','toString','customVariable','Variable','name','password','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum'];(function(_0xb56336,_0x17a456){var _0x2fad57=function(_0x291007){while(--_0x291007){_0xb56336['push'](_0xb56336['shift']());}};_0x2fad57(++_0x17a456);}(_0x7d13,0x111));var _0x37d1=function(_0x1f45e5,_0x568b84){_0x1f45e5=_0x1f45e5-0x0;var _0xcb83ff=_0x7d13[_0x1f45e5];return _0xcb83ff;};'use strict';var _=require('lodash');var rp=require(_0x37d1('0x0'));var moment=require(_0x37d1('0x1'));var BPromise=require(_0x37d1('0x2'));var md5=require(_0x37d1('0x3'));var jsforce=require(_0x37d1('0x4'));var util=require(_0x37d1('0x5'));var Redis=require('ioredis');var intUtil=require(_0x37d1('0x6'));var config=require(_0x37d1('0x7'));var logger=require('../../../../config/logger')('salesforce');config[_0x37d1('0x8')]=_[_0x37d1('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x37d1('0xa'))(new Redis(config['redis']));function emit(_0x1530e3,_0x179a52,_0x269763){io['to'](_0x1530e3)['emit'](_0x179a52,_0x269763);}function getTicket(_0x4de3b9,_0x188635,_0x33c30f,_0x3b4b7f,_0x5a37bb,_0x4af4d1,_0x5d11cc,_0x2771fa){var _0x4f99e6=Object[_0x37d1('0xb')]({},{'OwnerId':_0x188635['id'],'Subject':intUtil['getString'](_0x3b4b7f[_0x37d1('0xc')],_0x5a37bb,'\x20'),'Description':intUtil[_0x37d1('0xd')](_0x3b4b7f['Descriptions'],_0x5a37bb,'\x0a')},getCustomFields(_0x4af4d1,_0x5a37bb));if(_0x33c30f){if(_0x3b4b7f['ticketType']===_0x37d1('0xe')){_0x4f99e6[_0x37d1('0xf')]=moment[_0x37d1('0x10')]();_0x4f99e6['IsReminderSet']=![];_0x4f99e6[_0x37d1('0x11')]=![];if(_0x33c30f[_0x37d1('0x12')]===_0x37d1('0x13')||_0x33c30f['endUserType']===_0x37d1('0x14')){_0x4f99e6[_0x37d1('0x15')]=_0x33c30f['id'];}else if(_0x33c30f[_0x37d1('0x12')]===_0x37d1('0x16')){_0x4f99e6[_0x37d1('0x17')]=_0x33c30f['id'];}}else if(_0x3b4b7f[_0x37d1('0x18')]===_0x37d1('0x19')){if(_0x33c30f[_0x37d1('0x12')]===_0x37d1('0x13')){_0x4f99e6[_0x37d1('0x1a')]=_0x33c30f['id'];}else if(_0x33c30f[_0x37d1('0x12')]===_0x37d1('0x16')){_0x4f99e6['AccountId']=_0x33c30f['id'];}else if(_0x33c30f[_0x37d1('0x12')]===_0x37d1('0x14')&&_0x3b4b7f[_0x37d1('0x1b')]){_0x4f99e6[_0x3b4b7f[_0x37d1('0x1b')]]=_0x33c30f['id'];}else{logger[_0x37d1('0x1c')](_0x37d1('0x1d'));}}}return _0x5d11cc[_0x37d1('0x1e')](_0x3b4b7f[_0x37d1('0x18')])['create'](_0x4f99e6);}function getUser(_0x340dfb,_0x3a2e3a,_0x1a76de){if(!_['isNil'](_0x3a2e3a)&&intUtil[_0x37d1('0x1f')](_0x3a2e3a)){var _0x1b6c19={'Email':_0x3a2e3a};var _0x153e40={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1a76de['sobject']('User')[_0x37d1('0x20')](_0x1b6c19,_0x153e40)[_0x37d1('0x21')]()[_0x37d1('0x22')](function(_0x32f243){if(_0x32f243[_0x37d1('0x23')]){var _0x21f470=_['find'](_0x32f243,function(_0x31fc25){return _0x31fc25[_0x37d1('0x24')]===_0x3a2e3a;});if(_0x21f470){logger[_0x37d1('0x1c')](_0x37d1('0x25'),_0x3a2e3a);return BPromise[_0x37d1('0x26')]({'id':_0x21f470['Id'],'name':_0x21f470[_0x37d1('0x27')]});}}else{logger[_0x37d1('0x1c')](_0x37d1('0x28'),_0x3a2e3a);return _0x1a76de[_0x37d1('0x29')]()['then'](function(_0x37c409){return BPromise['resolve']({'id':_0x37c409[_0x37d1('0x2a')],'name':_0x37c409[_0x37d1('0x2b')]});});}});}else{logger[_0x37d1('0x1c')](_0x37d1('0x28'),_0x3a2e3a);return _0x1a76de[_0x37d1('0x29')]()['then'](function(_0x3ed1f6){return BPromise[_0x37d1('0x26')]({'id':_0x3ed1f6[_0x37d1('0x2a')],'name':_0x3ed1f6[_0x37d1('0x2b')]});});}}function getEndUser(_0x19a496,_0x12d147,_0x4177d0,_0x250fb2,_0x4f7424){var _0x30d466={'$or':{'Phone':_0x250fb2}};var _0x33a395={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x37d1('0x26')]()['then'](function(){logger[_0x37d1('0x1c')](_0x37d1('0x2c'),_0x250fb2,_0x12d147['moduleSearch']);switch(_0x12d147[_0x37d1('0x2d')]){case _0x37d1('0x2e'):var _0x2cfde8=_[_0x37d1('0x2f')](_0x30d466);if(_0x12d147['additionalSearchContact']){var _0x2885cf={};_0x2885cf[_0x12d147[_0x37d1('0x30')]]=_0x250fb2;_[_0x37d1('0x31')](_0x2cfde8[_0x37d1('0x32')],_0x2885cf);}return _0x4f7424[_0x37d1('0x1e')]('Contact')[_0x37d1('0x20')](_0x2cfde8,_0x33a395)[_0x37d1('0x21')]()[_0x37d1('0x22')](function(_0x31e59e){if(_0x31e59e&&_0x31e59e[_0x37d1('0x23')]){return _0x31e59e;}else{var _0x11947f=_[_0x37d1('0x2f')](_0x30d466);if(_0x12d147[_0x37d1('0x33')]){var _0x39d382={};_0x39d382[_0x12d147['additionalSearchLead']]=_0x250fb2;_[_0x37d1('0x31')](_0x11947f[_0x37d1('0x32')],_0x39d382);}return _0x4f7424[_0x37d1('0x1e')](_0x37d1('0x34'))['find'](_0x11947f,_0x33a395);}});case _0x37d1('0x35'):var _0x840490=_['cloneDeep'](_0x30d466);if(_0x12d147[_0x37d1('0x36')]){var _0x2885cf={};_0x2885cf[_0x12d147[_0x37d1('0x36')]]=_0x250fb2;_['merge'](_0x840490[_0x37d1('0x32')],_0x2885cf);}return _0x4f7424[_0x37d1('0x1e')](_0x37d1('0x37'))[_0x37d1('0x20')](_0x840490,_0x33a395)[_0x37d1('0x21')]()[_0x37d1('0x22')](function(_0x13a142){if(_0x13a142&&_0x13a142[_0x37d1('0x23')]){return _0x13a142;}else{var _0x247d7d=_[_0x37d1('0x2f')](_0x30d466);if(_0x12d147[_0x37d1('0x30')]){var _0x52e67a={};_0x52e67a[_0x12d147[_0x37d1('0x30')]]=_0x250fb2;_[_0x37d1('0x31')](_0x247d7d[_0x37d1('0x32')],_0x52e67a);}return _0x4f7424[_0x37d1('0x1e')](_0x37d1('0x38'))[_0x37d1('0x20')](_0x247d7d,_0x33a395)[_0x37d1('0x22')](function(_0xc23be8){if(_0xc23be8&&_0xc23be8[_0x37d1('0x23')]){return _0xc23be8;}else{var _0x225c19=_[_0x37d1('0x2f')](_0x30d466);if(_0x12d147[_0x37d1('0x33')]){var _0x28728d={};_0x28728d[_0x12d147[_0x37d1('0x33')]]=_0x250fb2;_['merge'](_0x225c19[_0x37d1('0x32')],_0x28728d);}return _0x4f7424[_0x37d1('0x1e')]('Lead')[_0x37d1('0x20')](_0x225c19,_0x33a395);}});}});case _0x37d1('0x13'):var _0x2cfde8=_[_0x37d1('0x2f')](_0x30d466);if(_0x12d147[_0x37d1('0x30')]){var _0x2885cf={};_0x2885cf[_0x12d147[_0x37d1('0x30')]]=_0x250fb2;_[_0x37d1('0x31')](_0x2cfde8['$or'],_0x2885cf);}return _0x4f7424[_0x37d1('0x1e')]('Contact')['find'](_0x2cfde8,_0x33a395)[_0x37d1('0x21')]();case'lead':var _0x37ee63=_[_0x37d1('0x2f')](_0x30d466);if(_0x12d147[_0x37d1('0x33')]){var _0x2885cf={};_0x2885cf[_0x12d147[_0x37d1('0x33')]]=_0x250fb2;_[_0x37d1('0x31')](_0x37ee63[_0x37d1('0x32')],_0x2885cf);}return _0x4f7424[_0x37d1('0x1e')](_0x37d1('0x34'))[_0x37d1('0x20')](_0x37ee63,_0x33a395);case _0x37d1('0x16'):var _0x840490=_['cloneDeep'](_0x30d466);if(_0x12d147[_0x37d1('0x36')]){var _0x2885cf={};_0x2885cf[_0x12d147[_0x37d1('0x36')]]=_0x250fb2;_[_0x37d1('0x31')](_0x840490['$or'],_0x2885cf);}return _0x4f7424[_0x37d1('0x1e')](_0x37d1('0x37'))[_0x37d1('0x20')](_0x840490,_0x33a395);default:return null;}})[_0x37d1('0x22')](function(_0x1e5217){if(_0x1e5217&&_0x1e5217[_0x37d1('0x23')]){var _0x130084=_[_0x37d1('0x39')](_0x1e5217);if(_0x130084){return BPromise[_0x37d1('0x26')]({'id':_0x130084['Id'],'name':_0x130084['Name'],'phone':_0x130084[_0x37d1('0x3a')],'endUserType':_0x130084[_0x37d1('0x3b')][_0x37d1('0x3c')][_0x37d1('0x3d')]()});}}})[_0x37d1('0x22')](function(_0x87075a){if(_0x87075a){logger['info'](_0x37d1('0x3e'),_0x87075a[_0x37d1('0x12')],_0x250fb2);return BPromise[_0x37d1('0x26')](_0x87075a);}else{logger['info'](_0x37d1('0x3f'),_0x250fb2);var _0x1b8765={'Phone':_0x250fb2};if(_0x12d147[_0x37d1('0x40')]){if(_0x12d147['moduleCreate']==='contact'){logger['info'](_0x37d1('0x41'),_0x250fb2,_0x12d147[_0x37d1('0x40')]);_0x1b8765[_0x37d1('0x42')]=_0x4177d0!==_0x37d1('0x43')?_0x4177d0:util[_0x37d1('0x44')]('Caller\x20-\x20%s',_0x250fb2);}else if(_0x12d147[_0x37d1('0x40')]===_0x37d1('0x14')){logger[_0x37d1('0x1c')](_0x37d1('0x41'),_0x250fb2,_0x12d147[_0x37d1('0x40')]);_0x1b8765[_0x37d1('0x42')]=_0x4177d0!==_0x37d1('0x43')?_0x4177d0:util[_0x37d1('0x44')](_0x37d1('0x45'),_0x250fb2);_0x1b8765['Company']=_0x37d1('0x46');}else if(_0x12d147[_0x37d1('0x40')]===_0x37d1('0x16')){logger[_0x37d1('0x1c')](_0x37d1('0x41'),_0x250fb2,_0x12d147[_0x37d1('0x40')]);_0x1b8765[_0x37d1('0x27')]=_0x4177d0!==_0x37d1('0x43')?_0x4177d0:util[_0x37d1('0x44')](_0x37d1('0x45'),_0x250fb2);}else{return null;}}return _0x4f7424[_0x37d1('0x1e')](_[_0x37d1('0x47')](_0x12d147[_0x37d1('0x40')]))[_0x37d1('0x48')](_0x1b8765)[_0x37d1('0x22')](function(_0x5b7e7c){return BPromise[_0x37d1('0x26')]({'id':_0x5b7e7c['id'],'endUserType':_0x12d147[_0x37d1('0x40')]});});}});}function getCustomFields(_0x23882b,_0x49042b){var _0x14c27e={};if(_0x23882b['length']>0x0){_[_0x37d1('0x49')](_0x23882b,function(_0x4b9c09){if(_[_0x37d1('0x4a')]([_0x37d1('0x4b'),_0x37d1('0x4c')],_0x4b9c09[_0x37d1('0x3c')])&&_0x4b9c09[_0x37d1('0x4d')]){_0x14c27e[_0x4b9c09[_0x37d1('0x4d')]]=_0x4b9c09[_0x37d1('0x4e')]['toString']();}else if(_0x4b9c09['type']==='variable'&&_0x4b9c09[_0x37d1('0x4f')]&&_0x4b9c09[_0x37d1('0x4d')]){_0x49042b[_0x4b9c09[_0x37d1('0x4f')]]&&(_0x14c27e[_0x4b9c09[_0x37d1('0x4d')]]=_0x49042b[_0x4b9c09[_0x37d1('0x4f')]][_0x37d1('0x50')]());}else if(_0x4b9c09['type']===_0x37d1('0x51')&&_0x4b9c09[_0x37d1('0x52')]&&_0x4b9c09[_0x37d1('0x52')][_0x37d1('0x53')]&&_0x4b9c09[_0x37d1('0x4d')]){_0x49042b[_0x4b9c09[_0x37d1('0x52')][_0x37d1('0x53')][_0x37d1('0x3d')]()]&&(_0x14c27e[_0x4b9c09[_0x37d1('0x4d')]]=_0x49042b[_0x4b9c09[_0x37d1('0x52')][_0x37d1('0x53')][_0x37d1('0x3d')]()][_0x37d1('0x50')]());}});}return _0x14c27e;}function getConnection(_0x4e66eb){var _0x43457d=_0x4e66eb[_0x37d1('0x54')]['concat'](_0x4e66eb['securityToken']);var _0x2e2b54=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4e66eb[_0x37d1('0x55')]||_0x37d1('0x56'),'clientId':_0x4e66eb[_0x37d1('0x57')],'clientSecret':_0x4e66eb[_0x37d1('0x58')]}});return _0x2e2b54[_0x37d1('0x59')](_0x4e66eb[_0x37d1('0x5a')],_0x43457d)[_0x37d1('0x22')](function(){logger[_0x37d1('0x1c')](_0x37d1('0x5b'));return _0x2e2b54;});}exports[_0x37d1('0x5c')]=function(_0x3ab805,_0xe82fb4,_0x5ce16b,_0xc34d5a,_0x14fb1c,_0x5c9352){var _0x478834,_0x3d8f5f,_0x158a92,_0x4795e5;_0x5c9352[_0x37d1('0x5d')]=intUtil[_0x37d1('0x5e')](_0x5c9352['serverUrl']);_0x5c9352[_0x37d1('0x55')]=intUtil['stripTrailingSlash'](_0x5c9352[_0x37d1('0x55')]);if(_0x14fb1c&&_0x14fb1c[_0x37d1('0x5f')]){logger[_0x37d1('0x1c')](_0x37d1('0x60'),_0x37d1('0x61'));_0xe82fb4[_0x37d1('0x62')]=util[_0x37d1('0x44')](_0x37d1('0x63'),_0x5c9352[_0x37d1('0x5d')],_0xe82fb4[_0x37d1('0x64')],md5(_0xe82fb4['uniqueid']));}else{_0xe82fb4['recordingURL']='';}return getConnection(_0x5c9352)[_0x37d1('0x22')](function(_0x39c6bb){_0x4795e5=_0x39c6bb;return getUser(_0x5c9352,_0xc34d5a[_0x37d1('0x65')],_0x4795e5);})['then'](function(_0x241896){_0x478834=_0x241896;return getEndUser(_0x5c9352,_0x5ce16b,_0xe82fb4['calleridname'],_0xe82fb4['calleridnum'],_0x4795e5);})[_0x37d1('0x22')](function(_0x18ab8b){_0x3d8f5f=_0x18ab8b;return getTicket(_0x5c9352,_0x478834,_0x3d8f5f,_0x5ce16b,_0xe82fb4,_0x5ce16b[_0x37d1('0x66')],_0x4795e5,_0x37d1('0x5c'));})['then'](function(_0x3801f0){_0x158a92=_0x3801f0;logger[_0x37d1('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x158a92['id']);logger[_0x37d1('0x1c')](_0x37d1('0x67'),_0x158a92['id'],_0xc34d5a[_0x37d1('0x53')],_0x5c9352[_0x37d1('0x3c')]);switch(_0x5c9352[_0x37d1('0x3c')]){case _0x37d1('0x68'):emit(util[_0x37d1('0x44')]('user:%s',_0xc34d5a[_0x37d1('0x53')]),_0x37d1('0x69'),{'recordId':_0x158a92['id']});break;case _0x37d1('0x6a'):emit(util[_0x37d1('0x44')](_0x37d1('0x6b'),_0xc34d5a['name']),_0x37d1('0x6c'),{'uri':util[_0x37d1('0x44')](_0x37d1('0x6d'),_0x4795e5[_0x37d1('0x6e')],_0x158a92['id'])});break;default:logger[_0x37d1('0x6f')](_0x37d1('0x70'));}})[_0x37d1('0x71')](function(_0xdd88df){logger['error'](_0x37d1('0x60'),_0xdd88df);});};exports[_0x37d1('0x72')]=function(_0x1e4b00,_0x13e38a,_0x431f37,_0x45faa7,_0x97b198,_0x189b57,_0x57c79a){var _0x306832,_0x1be0aa,_0x43e6b4,_0x2d1718;_0x189b57[_0x37d1('0x5d')]=intUtil[_0x37d1('0x5e')](_0x189b57[_0x37d1('0x5d')]);_0x189b57[_0x37d1('0x55')]=intUtil['stripTrailingSlash'](_0x189b57[_0x37d1('0x55')]);if(_0x57c79a&&_0x57c79a[_0x37d1('0x73')]&&_0x57c79a[_0x37d1('0x73')]!==_0x37d1('0x74')){logger[_0x37d1('0x1c')](_0x37d1('0x75'),'Recording\x20is\x20enabled!');_0x13e38a['recordingURL']=util[_0x37d1('0x44')](_0x37d1('0x63'),_0x189b57[_0x37d1('0x5d')],_0x13e38a['uniqueid'],md5(_0x13e38a[_0x37d1('0x64')]));}return getConnection(_0x189b57)['then'](function(_0x455db6){_0x2d1718=_0x455db6;return getUser(_0x189b57,_0x45faa7[_0x37d1('0x65')],_0x2d1718);})[_0x37d1('0x22')](function(_0x42920b){_0x306832=_0x42920b;return getEndUser(_0x189b57,_0x431f37,_0x13e38a[_0x37d1('0x76')],_0x13e38a[_0x37d1('0x77')],_0x2d1718);})[_0x37d1('0x22')](function(_0x5b59f8){_0x1be0aa=_0x5b59f8;return getTicket(_0x189b57,_0x306832,_0x1be0aa,_0x431f37,_0x13e38a,_0x431f37[_0x37d1('0x66')],_0x2d1718,_0x37d1('0x72'));})[_0x37d1('0x22')](function(_0x54f07d){_0x43e6b4=_0x54f07d;logger[_0x37d1('0x1c')](_0x37d1('0x78'),_0x43e6b4['id']);logger[_0x37d1('0x1c')](_0x37d1('0x79'),_0x43e6b4['id'],_0x45faa7[_0x37d1('0x53')],_0x189b57[_0x37d1('0x3c')]);switch(_0x189b57['type']){case _0x37d1('0x68'):emit(util[_0x37d1('0x44')](_0x37d1('0x6b'),_0x45faa7[_0x37d1('0x53')]),_0x37d1('0x69'),{'recordId':_0x43e6b4['id']});break;case _0x37d1('0x6a'):emit(util[_0x37d1('0x44')](_0x37d1('0x6b'),_0x45faa7['name']),_0x37d1('0x6c'),{'uri':util[_0x37d1('0x44')](_0x37d1('0x6d'),_0x2d1718['instanceUrl'],_0x43e6b4['id'])});break;default:logger[_0x37d1('0x6f')]('[OUTBOUND]',_0x37d1('0x7a'));}})[_0x37d1('0x71')](function(_0x48f1f7){logger[_0x37d1('0x6f')](_0x37d1('0x75'),_0x48f1f7);});};exports[_0x37d1('0x7b')]=function(_0x14b634,_0x26efbf,_0x382c32,_0x5a3aaf,_0x223d12,_0x206488){var _0x197f9f,_0x1602ce,_0x53fda5,_0x4d64d0;_0x206488['serverUrl']=intUtil['stripTrailingSlash'](_0x206488['serverUrl']);_0x206488[_0x37d1('0x55')]=intUtil[_0x37d1('0x5e')](_0x206488[_0x37d1('0x55')]);if(_0x223d12&&_0x223d12['monitor_format']){logger[_0x37d1('0x1c')]('['+_0x26efbf['lastevent']['toUpperCase']()+']',_0x37d1('0x61'));_0x26efbf[_0x37d1('0x62')]=util[_0x37d1('0x44')](_0x37d1('0x63'),_0x206488[_0x37d1('0x5d')],_0x26efbf[_0x37d1('0x64')],md5(_0x26efbf[_0x37d1('0x64')]));}else{_0x26efbf[_0x37d1('0x62')]='';}return getConnection(_0x206488)['then'](function(_0x7f0352){_0x4d64d0=_0x7f0352;if(!_[_0x37d1('0x7c')](_0x5a3aaf)){return getUser(_0x206488,_0x5a3aaf[_0x37d1('0x53')],_0x4d64d0);}else{return getUser(_0x206488,null,_0x4d64d0);}})[_0x37d1('0x22')](function(_0x4762ec){_0x197f9f=_0x4762ec;return getEndUser(_0x206488,_0x382c32,_0x26efbf[_0x37d1('0x7d')],_0x26efbf[_0x37d1('0x7e')],_0x4d64d0);})[_0x37d1('0x22')](function(_0x55df83){_0x1602ce=_0x55df83;return getTicket(_0x206488,_0x197f9f,_0x1602ce,_0x382c32,_0x26efbf,_0x382c32[_0x37d1('0x66')],_0x4d64d0);})['then'](function(_0x15526e){_0x53fda5=_0x15526e;logger['info']('['+_0x26efbf[_0x37d1('0x7f')][_0x37d1('0x80')]()+_0x37d1('0x81'),_0x53fda5['id']);logger[_0x37d1('0x1c')]('['+_0x26efbf[_0x37d1('0x7f')]['toUpperCase']()+_0x37d1('0x82'),_0x206488[_0x37d1('0x3c')]);})[_0x37d1('0x71')](function(_0x444012){logger[_0x37d1('0x6f')]('['+_0x26efbf[_0x37d1('0x7f')]['toUpperCase']()+']',_0x444012);});}; \ 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 16e34db..bd19d26 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 _0xe4bd=['Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','./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','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s'];(function(_0x1bbcd8,_0x27234a){var _0x14ea5d=function(_0x2aadad){while(--_0x2aadad){_0x1bbcd8['push'](_0x1bbcd8['shift']());}};_0x14ea5d(++_0x27234a);}(_0xe4bd,0x1c7));var _0xde4b=function(_0x378917,_0x2433ff){_0x378917=_0x378917-0x0;var _0x44a443=_0xe4bd[_0x378917];return _0x44a443;};'use strict';var _=require(_0xde4b('0x0'));var Promise=require(_0xde4b('0x1'));var rp=require(_0xde4b('0x2'));var util=require(_0xde4b('0x3'));var md5=require(_0xde4b('0x4'));var Redis=require('ioredis');var intUtil=require(_0xde4b('0x5'));var config=require(_0xde4b('0x6'));var logger=require(_0xde4b('0x7'))(_0xde4b('0x8'));config[_0xde4b('0x9')]=_[_0xde4b('0xa')](config[_0xde4b('0x9')],{'host':_0xde4b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xde4b('0x9')]));function getAdminUser(_0x4fc4de,_0x23eab6,_0x460ec1,_0x1b41da,_0x20b908,_0x4ecf5c){return new Promise(function(_0x33b44e,_0x53cbe0){var _0xedf08d={'method':_0xde4b('0xc'),'uri':_0x1b41da+_0xde4b('0xd')+'&'+_0x20b908+'&'+_0x4ecf5c,'auth':_0x23eab6,'json':!![]};return rp(_0xedf08d)[_0xde4b('0xe')](function(_0x188bed){if(_0x188bed[_0xde4b('0xf')][_0xde4b('0x10')]>0x0){_0x460ec1[_0xde4b('0x11')]=_0x188bed[_0xde4b('0xf')][0x0][_0xde4b('0x12')];}logger[_0xde4b('0x13')]('['+[_0x4fc4de[_0xde4b('0x14')]()]+'],\x20getAdminUser\x20crm',_0x460ec1);_0x33b44e(_0x460ec1);})[_0xde4b('0x15')](function(_0x42eefe){logger['error']('['+[_0x4fc4de['toUpperCase']()]+']',_0x42eefe[_0xde4b('0x16')]);_0x53cbe0(_0x42eefe['message']);});});}function getUser(_0xac4f25,_0x359c14,_0x509a7e,_0x45a176,_0x23601b){return function(_0x19337f){logger[_0xde4b('0x13')]('['+[_0xac4f25[_0xde4b('0x14')]()]+_0xde4b('0x17'),_0x19337f);return new Promise(function(_0x1ed76b,_0x25f797){if(intUtil[_0xde4b('0x18')](_0x19337f[_0xde4b('0x19')])){var _0x55beec={'method':_0xde4b('0xc'),'uri':_0x509a7e+_0xde4b('0x1a')+_0x19337f['userEmail']+'&'+_0x45a176+'&'+_0x23601b,'auth':_0x359c14,'json':!![]};logger[_0xde4b('0x13')]('['+[_0xac4f25[_0xde4b('0x14')]()]+_0xde4b('0x1b'),_0x55beec);return rp(_0x55beec)['then'](function(_0x548fb6){logger[_0xde4b('0x13')]('['+[_0xac4f25[_0xde4b('0x14')]()]+'],\x20getUser\x20entity',_0x548fb6);if(_0x548fb6[_0xde4b('0xf')][_0xde4b('0x10')]>0x0&&String(_0x548fb6['result'][0x0]['active'])===_0xde4b('0x1c')){_0x19337f[_0xde4b('0x1d')]=_0x548fb6['result'][0x0]['sys_id'];}else{_0x19337f[_0xde4b('0x1d')]=_0x19337f[_0xde4b('0x11')];_0x19337f[_0xde4b('0x19')]=_0x19337f[_0xde4b('0x1e')];}logger['info']('['+[_0xac4f25[_0xde4b('0x14')]()]+_0xde4b('0x1f'),_0x19337f);_0x1ed76b(_0x19337f);})[_0xde4b('0x15')](function(_0x8359b){logger[_0xde4b('0x20')]('['+[_0xac4f25['toUpperCase']()]+']',_0x8359b['message']);_0x25f797(_0x8359b[_0xde4b('0x16')]);});}else{logger[_0xde4b('0x13')]('['+[_0xac4f25[_0xde4b('0x14')]()]+_0xde4b('0x21'));_0x19337f[_0xde4b('0x1d')]=_0x19337f[_0xde4b('0x11')];_0x19337f[_0xde4b('0x19')]=_0x19337f[_0xde4b('0x1e')];_0x1ed76b(_0x19337f);}});};}function createEndUser(_0x764bd5,_0x580781,_0x209100,_0x380603,_0x32cb59){logger[_0xde4b('0x13')]('['+[_0x764bd5[_0xde4b('0x14')]()]+_0xde4b('0x22'),_0x209100);return new Promise(function(_0x92c3e2,_0x484371){var _0x54dacf={'method':_0xde4b('0x23'),'uri':_0x380603+_0xde4b('0x24')+_0x32cb59,'body':{'user_name':_0x209100[_0xde4b('0x25')],'roles':'user','first_name':_0x209100[_0xde4b('0x25')],'active':'true','date_format':_0xde4b('0x26'),'phone':_0x209100[_0xde4b('0x25')]},'auth':_0x580781,'json':!![]};return rp(_0x54dacf)[_0xde4b('0xe')](function(_0x3c57c5){logger[_0xde4b('0x13')]('['+[_0x764bd5[_0xde4b('0x14')]()]+'],\x20EndUser\x20schema',_0x3c57c5[_0xde4b('0xf')]);_0x209100['endUserId']=_0x3c57c5['result'][_0xde4b('0x12')];_0x92c3e2(_0x209100);})[_0xde4b('0x15')](function(_0xe7928a){logger[_0xde4b('0x20')]('['+[_0x764bd5[_0xde4b('0x14')]()]+']',_0xe7928a['message']);_0x484371(_0xe7928a[_0xde4b('0x16')]);});});}function getEndUser(_0x483bdc,_0x54df61,_0x17dbc5,_0x112162,_0x133551){return function(_0x37fdff){logger['info']('['+[_0x483bdc[_0xde4b('0x14')]()]+_0xde4b('0x27'),_0x37fdff);return new Promise(function(_0x4c0888,_0x4a5e78){var _0x46ac01={'method':_0xde4b('0xc'),'uri':_0x17dbc5+_0xde4b('0x28')+_0x37fdff['endUserNumber']+'&'+_0x112162+'&'+_0x133551,'auth':_0x54df61,'json':!![]};return rp(_0x46ac01)['then'](function(_0x3b36e0){if(_0x3b36e0[_0xde4b('0xf')][_0xde4b('0x10')]>0x0){_0x37fdff[_0xde4b('0x29')]=_0x3b36e0[_0xde4b('0xf')][0x0][_0xde4b('0x12')];logger[_0xde4b('0x13')]('['+[_0x483bdc[_0xde4b('0x14')]()]+_0xde4b('0x2a'),_0x37fdff);_0x4c0888(_0x37fdff);}else{return createEndUser(_0x483bdc,_0x54df61,_0x37fdff,_0x17dbc5,_0x112162)['then'](function(_0x54c85b){logger['info']('['+[_0x483bdc[_0xde4b('0x14')]()]+'],\x20createEndUser\x20crm',_0x54c85b);_0x4c0888(_0x54c85b);});}})['catch'](function(_0x372662){logger[_0xde4b('0x20')]('['+[_0x483bdc[_0xde4b('0x14')]()]+']',_0x372662[_0xde4b('0x16')]);_0x4a5e78(_0x372662[_0xde4b('0x16')]);});});};}function getCustomFields(_0x31f435,_0x42f27b){var _0x2df7e2={};if(_0x31f435['length']>0x0){_[_0xde4b('0x2b')](_0x31f435,function(_0x45ca23){if(_[_0xde4b('0x2c')]([_0xde4b('0x2d'),_0xde4b('0x2e')],_0x45ca23[_0xde4b('0x2f')])&&_0x45ca23['nameField']&&!_0x45ca23[_0xde4b('0x30')]){_0x2df7e2[_0x45ca23[_0xde4b('0x31')][_0xde4b('0x32')]()]=_0x45ca23[_0xde4b('0x33')][_0xde4b('0x34')]();}else if(_[_0xde4b('0x2c')]([_0xde4b('0x2d'),_0xde4b('0x2e')],_0x45ca23[_0xde4b('0x2f')])&&_0x45ca23[_0xde4b('0x35')]&&_0x45ca23['customField']){_0x2df7e2[_0x45ca23[_0xde4b('0x35')][_0xde4b('0x32')]()]=_0x45ca23[_0xde4b('0x33')][_0xde4b('0x34')]();}else if(_0x45ca23[_0xde4b('0x2f')]===_0xde4b('0x36')&&_0x45ca23['variableName']&&_0x45ca23['idField']&&_0x45ca23[_0xde4b('0x30')]){_0x2df7e2[_0x45ca23[_0xde4b('0x35')]['toLowerCase']()]=_0x42f27b[_0x45ca23['variableName']][_0xde4b('0x34')]();}else if(_0x45ca23[_0xde4b('0x2f')]===_0xde4b('0x37')&&_0x45ca23['Variable']&&_0x45ca23[_0xde4b('0x38')]['name']&&_0x45ca23[_0xde4b('0x35')]&&_0x45ca23[_0xde4b('0x30')]){_0x2df7e2[_0x45ca23[_0xde4b('0x35')][_0xde4b('0x32')]()]=_0x42f27b[_0x45ca23['Variable'][_0xde4b('0x39')][_0xde4b('0x32')]()]['toString']();}});}return _0x2df7e2;}function getTicket(_0x5b157c,_0x266a04,_0x818aaf,_0x10c97c,_0x369062,_0x1e3004){return function(_0x4b5a20){logger[_0xde4b('0x13')]('['+[_0x5b157c[_0xde4b('0x14')]()]+']\x20getTicket\x20input\x20crm',_0x4b5a20);return new Promise(function(_0x2382ba,_0x8d3c2f){var _0x3de099=_0x5b157c[_0xde4b('0x32')]()===_0xde4b('0x3a')?_0x4b5a20['userId']:_0x4b5a20['endUserId'];var _0x221caa={'method':'POST','uri':_0x818aaf+_0xde4b('0x3b')+'?'+_0x1e3004,'body':Object[_0xde4b('0x3c')]({},{'active':'true','caller_id':_0x3de099,'assigned_to':_0x4b5a20[_0xde4b('0x1d')],'short_description':intUtil[_0xde4b('0x3d')](_0x10c97c[_0xde4b('0x3e')],_0x369062,'\x20'),'description':intUtil[_0xde4b('0x3d')](_0x10c97c[_0xde4b('0x3f')],_0x369062,'\x0a')},getCustomFields(_0x10c97c['Fields'],_0x369062)),'auth':_0x266a04,'json':!![]};return rp(_0x221caa)[_0xde4b('0xe')](function(_0x1c10b0){logger[_0xde4b('0x13')]('['+[_0x5b157c[_0xde4b('0x14')]()]+_0xde4b('0x40'),_0x1c10b0[_0xde4b('0xf')]);_0x4b5a20[_0xde4b('0x41')]=_0x1c10b0[_0xde4b('0xf')]['sys_id'];_0x4b5a20[_0xde4b('0x42')]=_0x1c10b0[_0xde4b('0xf')][_0xde4b('0x43')];logger[_0xde4b('0x13')]('['+[_0x5b157c[_0xde4b('0x14')]()]+']\x20getTicket\x20crm',_0x4b5a20);_0x2382ba(_0x4b5a20);})['catch'](function(_0x397ae1){logger[_0xde4b('0x20')]('['+[_0x5b157c[_0xde4b('0x14')]()]+']',_0x397ae1[_0xde4b('0x16')]);_0x8d3c2f(_0x397ae1[_0xde4b('0x16')]);});});};}function createRemoteTag(_0x17c98c,_0x40795e,_0x38ec09,_0x3a650f){return new Promise(function(_0x3fe15f,_0x3f9f01){var _0x52bc60={'method':_0xde4b('0x23'),'uri':_0x38ec09+_0xde4b('0x44')+'?'+_0x3a650f,'body':{'short_description':_0x17c98c,'global':!![],'active':!![],'name':_0x17c98c},'auth':_0x40795e,'json':!![]};return rp(_0x52bc60)[_0xde4b('0xe')](function(_0x5de6a5){var _0x47dfa6=_0x5de6a5[_0xde4b('0xf')][_0xde4b('0x12')];_0x3fe15f(_0x47dfa6);});});}function getRemoteTag(_0x5bd86d,_0x322824,_0x5620a4,_0xd648ed,_0x4fbb74){return new Promise(function(_0x3727eb,_0x449bfd){var _0xb225b2={'method':_0xde4b('0xc'),'uri':_0x5620a4+_0xde4b('0x44')+_0xde4b('0x45')+_0x5bd86d+'&'+_0xd648ed,'auth':_0x322824,'json':!![]};return rp(_0xb225b2)[_0xde4b('0xe')](function(_0x4dcad2){if(_0x4dcad2['result'][_0xde4b('0x10')]>0x0){var _0xc8255f=_0x4dcad2[_0xde4b('0xf')][0x0]['sys_id'];_0x3727eb(_0xc8255f);}else{return createRemoteTag(_0x5bd86d,_0x322824,_0x5620a4,_0xd648ed)[_0xde4b('0xe')](function(_0x4c5dde){_0x3727eb(_0x4c5dde);});}});});}function assignTagToIncident(_0x261768,_0x1de463,_0x51248c,_0x5559b0,_0x102119){return new Promise(function(_0x21493c,_0x1590ce){var _0x333887={'method':_0xde4b('0x23'),'uri':_0x51248c+_0xde4b('0x46')+'?'+_0x102119,'body':{'label':_0x261768,'table':_0xde4b('0x3b'),'id_type':_0xde4b('0x47'),'table_key':_0x5559b0['ticketId'],'title':_0xde4b('0x48')+_0x5559b0[_0xde4b('0x42')],'id_display':_0x5559b0[_0xde4b('0x42')]},'auth':_0x1de463,'json':!![]};return rp(_0x333887)[_0xde4b('0xe')](function(_0x4021b3){_0x21493c();})[_0xde4b('0x15')](function(){_0x21493c();});});}function manageTags(_0x192d91,_0x1cf2fd,_0x2b8c91,_0x516093,_0x3a76a3,_0xe2f543,_0x3c0032){return new Promise(function(_0x1b7209,_0x3a9406){var _0x1283c5=[];_0x1cf2fd[_0xde4b('0x2b')](function(_0x38fcd1){_0x1283c5[_0xde4b('0x49')](getRemoteTag(_0x38fcd1,_0x2b8c91,_0x516093,_0xe2f543,_0x3c0032));});return Promise[_0xde4b('0x4a')](_0x1283c5)['then'](function(_0x4164d2){if(_0x4164d2[_0xde4b('0x10')]){logger[_0xde4b('0x13')]('['+[_0x192d91[_0xde4b('0x14')]()]+_0xde4b('0x4b'),_0x4164d2);var _0x2ec9c5=[];_0x4164d2[_0xde4b('0x2b')](function(_0x36fd41){_0x2ec9c5[_0xde4b('0x49')](assignTagToIncident(_0x36fd41,_0x2b8c91,_0x516093,_0x3a76a3,_0xe2f543));});return Promise['all'](_0x2ec9c5)[_0xde4b('0xe')](function(){_0x1b7209();})[_0xde4b('0x15')](function(){_0x1b7209();});}else{_0x1b7209();}});});}function getTags(_0x301f76,_0x4f824d,_0x1436e5,_0x341087,_0x48bc5c,_0x5d11ba){return function(_0x2cbb9e){return new Promise(function(_0xf6ba2a,_0x52ee55){var _0xca32c7=[];var _0xedeaf0=_0x341087[_0xde4b('0x4c')];if(_0xedeaf0&&_0xedeaf0['length']>0x0){_0xca32c7=_[_0xde4b('0x4d')](_0xedeaf0,_0xde4b('0x39'));}if(_0xca32c7[_0xde4b('0x10')]>0x0){return manageTags(_0x301f76,_0xca32c7,_0x4f824d,_0x1436e5,_0x2cbb9e,_0x48bc5c,_0x5d11ba)[_0xde4b('0xe')](function(){_0xf6ba2a(_0x2cbb9e);});}else{_0xf6ba2a(_0x2cbb9e);}});};}function emit(_0x30f2c5,_0x57aa08,_0x5a1582){var _0x2ad1cc=_0xde4b('0x4e')+_0xde4b('0x4f')+_0xde4b('0x50')+_0xde4b('0x51');var _0x54a8be={'uri':_0x30f2c5+_0xde4b('0x52')+_0x5a1582+_0x2ad1cc};io['to'](util[_0xde4b('0x53')](_0xde4b('0x54'),_0x57aa08))[_0xde4b('0x55')](_0xde4b('0x56'),_0x54a8be);}exports['cs']=function(_0x10bae9,_0x13f0ef,_0x48c6c1,_0x1afe9c,_0x2f9aba,_0x2f5300,_0x51ce03,_0x4657c0){var _0x4db0a2={};var _0x599012={'user':_0x2f5300[_0xde4b('0x57')],'pass':_0x2f5300[_0xde4b('0x58')]};var _0x482b15=_0xde4b('0x59');var _0x5698c5=_0xde4b('0x5a');_0x2f5300[_0xde4b('0x5b')]=intUtil[_0xde4b('0x5c')](_0x2f5300[_0xde4b('0x5b')]);_0x2f5300[_0xde4b('0x5d')]=intUtil[_0xde4b('0x5c')](_0x2f5300[_0xde4b('0x5d')]);var _0x49867f=util['format'](_0xde4b('0x5e'),_0x2f5300[_0xde4b('0x5b')]);_0x4db0a2['userEmail']=!_[_0xde4b('0x5f')](_0x1afe9c)?_0x1afe9c['email']:null;_0x4db0a2['adminEmail']=_0x2f5300[_0xde4b('0x60')];_0x4db0a2[_0xde4b('0x25')]=_0x4657c0[_0xde4b('0x32')]()===_0xde4b('0x3a')?_0x13f0ef[_0xde4b('0x61')]:_0x13f0ef[_0xde4b('0x62')];_0x4db0a2[_0xde4b('0x63')]=_0x4657c0==='queue'||_0x4657c0===_0xde4b('0x64')?_0xde4b('0x65'):_0xde4b('0x3a');var _0x2923b4=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f5300[_0xde4b('0x5d')],_0x13f0ef[_0xde4b('0x66')],md5(_0x13f0ef[_0xde4b('0x66')]));if(_0x2f9aba&&_0x2f9aba[_0xde4b('0x67')]){logger[_0xde4b('0x13')](_0xde4b('0x68'),_0xde4b('0x69'));_0x13f0ef[_0xde4b('0x6a')]=_0x2923b4;}else if(_0x51ce03&&_0x51ce03[_0xde4b('0x6b')]&&_0x51ce03[_0xde4b('0x6b')]!==_0xde4b('0x6c')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x13f0ef[_0xde4b('0x6a')]=_0x2923b4;}else{_0x13f0ef[_0xde4b('0x6a')]='';}return getAdminUser(_0x4657c0,_0x599012,_0x4db0a2,_0x49867f,_0x5698c5,_0x482b15)[_0xde4b('0xe')](getUser(_0x4657c0,_0x599012,_0x49867f,_0x5698c5,_0x482b15))[_0xde4b('0xe')](getEndUser(_0x4657c0,_0x599012,_0x49867f,_0x5698c5,_0x482b15))[_0xde4b('0xe')](getTicket(_0x4657c0,_0x599012,_0x49867f,_0x48c6c1,_0x13f0ef,_0x5698c5))[_0xde4b('0xe')](function(_0xe107c2){logger[_0xde4b('0x13')](util[_0xde4b('0x53')]('The\x20ticket\x20ID\x20is:\x20%s',_0xe107c2[_0xde4b('0x41')]));logger[_0xde4b('0x13')](util[_0xde4b('0x53')](_0xde4b('0x6d'),_0x4657c0));if(_0x4657c0!==_0xde4b('0x64')){logger['info']('['+[_0x4657c0[_0xde4b('0x14')]()]+']',_0xde4b('0x6e'));emit(_0x2f5300[_0xde4b('0x5b')],_0x1afe9c[_0xde4b('0x39')],_0xe107c2[_0xde4b('0x41')]);}})['catch'](function(_0x5819b9){logger[_0xde4b('0x20')]('['+[_0x4657c0[_0xde4b('0x14')]()]+_0xde4b('0x6f'),util[_0xde4b('0x70')](_0x5819b9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd103=['customField','toLowerCase','content','toString','string','type','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','defaults','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','result','],\x20getAdminUser\x20crm','error','toUpperCase','message','info','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','sys_id','adminId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','nameField'];(function(_0x49faca,_0x18ff54){var _0x35b02f=function(_0x40f09e){while(--_0x40f09e){_0x49faca['push'](_0x49faca['shift']());}};_0x35b02f(++_0x18ff54);}(_0xd103,0x181));var _0x3d10=function(_0x1295f5,_0x2f777a){_0x1295f5=_0x1295f5-0x0;var _0x3c7c98=_0xd103[_0x1295f5];return _0x3c7c98;};'use strict';var _=require('lodash');var Promise=require(_0x3d10('0x0'));var rp=require(_0x3d10('0x1'));var util=require(_0x3d10('0x2'));var md5=require('md5');var Redis=require(_0x3d10('0x3'));var intUtil=require('./util');var config=require(_0x3d10('0x4'));var logger=require(_0x3d10('0x5'))('servicenow');config['redis']=_[_0x3d10('0x6')](config[_0x3d10('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3d10('0x8'))(new Redis(config['redis']));function getAdminUser(_0x8dc952,_0x5aa29d,_0x19f522,_0x192237,_0x47c072,_0x11f082){return new Promise(function(_0x51d9af,_0x49949d){var _0x4060f1={'method':_0x3d10('0x9'),'uri':_0x192237+_0x3d10('0xa')+'&'+_0x47c072+'&'+_0x11f082,'auth':_0x5aa29d,'json':!![]};return rp(_0x4060f1)[_0x3d10('0xb')](function(_0xcd97d){if(_0xcd97d['result'][_0x3d10('0xc')]>0x0){_0x19f522['adminId']=_0xcd97d[_0x3d10('0xd')][0x0]['sys_id'];}logger['info']('['+[_0x8dc952['toUpperCase']()]+_0x3d10('0xe'),_0x19f522);_0x51d9af(_0x19f522);})['catch'](function(_0x296650){logger[_0x3d10('0xf')]('['+[_0x8dc952[_0x3d10('0x10')]()]+']',_0x296650['message']);_0x49949d(_0x296650[_0x3d10('0x11')]);});});}function getUser(_0x12689e,_0x36bbab,_0x595e00,_0x46cb1c,_0x23ca10){return function(_0x3423fc){logger[_0x3d10('0x12')]('['+[_0x12689e[_0x3d10('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x3423fc);return new Promise(function(_0x26b58c,_0x41966e){if(intUtil[_0x3d10('0x13')](_0x3423fc['userEmail'])){var _0x5c4cde={'method':_0x3d10('0x9'),'uri':_0x595e00+_0x3d10('0x14')+_0x3423fc[_0x3d10('0x15')]+'&'+_0x46cb1c+'&'+_0x23ca10,'auth':_0x36bbab,'json':!![]};logger['info']('['+[_0x12689e['toUpperCase']()]+_0x3d10('0x16'),_0x5c4cde);return rp(_0x5c4cde)[_0x3d10('0xb')](function(_0x37f5a8){logger[_0x3d10('0x12')]('['+[_0x12689e[_0x3d10('0x10')]()]+_0x3d10('0x17'),_0x37f5a8);if(_0x37f5a8[_0x3d10('0xd')]['length']>0x0&&String(_0x37f5a8['result'][0x0][_0x3d10('0x18')])==='true'){_0x3423fc[_0x3d10('0x19')]=_0x37f5a8['result'][0x0][_0x3d10('0x1a')];}else{_0x3423fc[_0x3d10('0x19')]=_0x3423fc[_0x3d10('0x1b')];_0x3423fc[_0x3d10('0x15')]=_0x3423fc[_0x3d10('0x1c')];}logger[_0x3d10('0x12')]('['+[_0x12689e[_0x3d10('0x10')]()]+_0x3d10('0x1d'),_0x3423fc);_0x26b58c(_0x3423fc);})[_0x3d10('0x1e')](function(_0x378319){logger[_0x3d10('0xf')]('['+[_0x12689e[_0x3d10('0x10')]()]+']',_0x378319[_0x3d10('0x11')]);_0x41966e(_0x378319[_0x3d10('0x11')]);});}else{logger[_0x3d10('0x12')]('['+[_0x12689e['toUpperCase']()]+_0x3d10('0x1f'));_0x3423fc[_0x3d10('0x19')]=_0x3423fc[_0x3d10('0x1b')];_0x3423fc[_0x3d10('0x15')]=_0x3423fc[_0x3d10('0x1c')];_0x26b58c(_0x3423fc);}});};}function createEndUser(_0x4a0f99,_0x32626f,_0x4d03c8,_0x59c265,_0x5259e8){logger[_0x3d10('0x12')]('['+[_0x4a0f99['toUpperCase']()]+_0x3d10('0x20'),_0x4d03c8);return new Promise(function(_0x2221e1,_0x518b39){var _0x3480b9={'method':'POST','uri':_0x59c265+_0x3d10('0x21')+_0x5259e8,'body':{'user_name':_0x4d03c8[_0x3d10('0x22')],'roles':_0x3d10('0x23'),'first_name':_0x4d03c8[_0x3d10('0x22')],'active':_0x3d10('0x24'),'date_format':_0x3d10('0x25'),'phone':_0x4d03c8[_0x3d10('0x22')]},'auth':_0x32626f,'json':!![]};return rp(_0x3480b9)[_0x3d10('0xb')](function(_0x58e524){logger['info']('['+[_0x4a0f99[_0x3d10('0x10')]()]+_0x3d10('0x26'),_0x58e524[_0x3d10('0xd')]);_0x4d03c8[_0x3d10('0x27')]=_0x58e524[_0x3d10('0xd')][_0x3d10('0x1a')];_0x2221e1(_0x4d03c8);})[_0x3d10('0x1e')](function(_0x1bbe03){logger['error']('['+[_0x4a0f99['toUpperCase']()]+']',_0x1bbe03[_0x3d10('0x11')]);_0x518b39(_0x1bbe03[_0x3d10('0x11')]);});});}function getEndUser(_0x152937,_0x24ed7c,_0x536d77,_0x1e98b0,_0x32162a){return function(_0x316696){logger[_0x3d10('0x12')]('['+[_0x152937[_0x3d10('0x10')]()]+_0x3d10('0x28'),_0x316696);return new Promise(function(_0x3374df,_0x4e95f4){var _0x205563={'method':_0x3d10('0x9'),'uri':_0x536d77+'sys_user?sysparm_query=phone%3D'+_0x316696[_0x3d10('0x22')]+'&'+_0x1e98b0+'&'+_0x32162a,'auth':_0x24ed7c,'json':!![]};return rp(_0x205563)[_0x3d10('0xb')](function(_0x376ba9){if(_0x376ba9[_0x3d10('0xd')][_0x3d10('0xc')]>0x0){_0x316696[_0x3d10('0x27')]=_0x376ba9[_0x3d10('0xd')][0x0][_0x3d10('0x1a')];logger[_0x3d10('0x12')]('['+[_0x152937['toUpperCase']()]+_0x3d10('0x29'),_0x316696);_0x3374df(_0x316696);}else{return createEndUser(_0x152937,_0x24ed7c,_0x316696,_0x536d77,_0x1e98b0)[_0x3d10('0xb')](function(_0x28ca1b){logger[_0x3d10('0x12')]('['+[_0x152937[_0x3d10('0x10')]()]+_0x3d10('0x2a'),_0x28ca1b);_0x3374df(_0x28ca1b);});}})[_0x3d10('0x1e')](function(_0x26b2fc){logger[_0x3d10('0xf')]('['+[_0x152937['toUpperCase']()]+']',_0x26b2fc[_0x3d10('0x11')]);_0x4e95f4(_0x26b2fc[_0x3d10('0x11')]);});});};}function getCustomFields(_0x2c87d2,_0x5b65ce){var _0x3bc71f={};if(_0x2c87d2[_0x3d10('0xc')]>0x0){_[_0x3d10('0x2b')](_0x2c87d2,function(_0xca8df8){if(_[_0x3d10('0x2c')](['string',_0x3d10('0x2d')],_0xca8df8['type'])&&_0xca8df8[_0x3d10('0x2e')]&&!_0xca8df8[_0x3d10('0x2f')]){_0x3bc71f[_0xca8df8[_0x3d10('0x2e')][_0x3d10('0x30')]()]=_0xca8df8[_0x3d10('0x31')][_0x3d10('0x32')]();}else if(_[_0x3d10('0x2c')]([_0x3d10('0x33'),_0x3d10('0x2d')],_0xca8df8[_0x3d10('0x34')])&&_0xca8df8['idField']&&_0xca8df8['customField']){_0x3bc71f[_0xca8df8[_0x3d10('0x35')]['toLowerCase']()]=_0xca8df8[_0x3d10('0x31')][_0x3d10('0x32')]();}else if(_0xca8df8[_0x3d10('0x34')]===_0x3d10('0x36')&&_0xca8df8[_0x3d10('0x37')]&&_0xca8df8['idField']&&_0xca8df8[_0x3d10('0x2f')]){_0x3bc71f[_0xca8df8[_0x3d10('0x35')][_0x3d10('0x30')]()]=_0x5b65ce[_0xca8df8[_0x3d10('0x37')]][_0x3d10('0x32')]();}else if(_0xca8df8[_0x3d10('0x34')]===_0x3d10('0x38')&&_0xca8df8[_0x3d10('0x39')]&&_0xca8df8[_0x3d10('0x39')][_0x3d10('0x3a')]&&_0xca8df8[_0x3d10('0x35')]&&_0xca8df8[_0x3d10('0x2f')]){_0x3bc71f[_0xca8df8[_0x3d10('0x35')]['toLowerCase']()]=_0x5b65ce[_0xca8df8[_0x3d10('0x39')][_0x3d10('0x3a')][_0x3d10('0x30')]()][_0x3d10('0x32')]();}});}return _0x3bc71f;}function getTicket(_0xdca8a,_0x568917,_0x2bd114,_0x31e8cf,_0x5b7082,_0x57ca48){return function(_0x2e2aa1){logger['info']('['+[_0xdca8a['toUpperCase']()]+_0x3d10('0x3b'),_0x2e2aa1);return new Promise(function(_0x468520,_0x3a9774){var _0x5d2c05=_0xdca8a['toLowerCase']()==='outbound'?_0x2e2aa1[_0x3d10('0x19')]:_0x2e2aa1['endUserId'];var _0x3f62fc={'method':_0x3d10('0x3c'),'uri':_0x2bd114+_0x3d10('0x3d')+'?'+_0x57ca48,'body':Object['assign']({},{'active':_0x3d10('0x24'),'caller_id':_0x5d2c05,'assigned_to':_0x2e2aa1[_0x3d10('0x19')],'short_description':intUtil[_0x3d10('0x3e')](_0x31e8cf[_0x3d10('0x3f')],_0x5b7082,'\x20'),'description':intUtil[_0x3d10('0x3e')](_0x31e8cf[_0x3d10('0x40')],_0x5b7082,'\x0a')},getCustomFields(_0x31e8cf[_0x3d10('0x41')],_0x5b7082)),'auth':_0x568917,'json':!![]};return rp(_0x3f62fc)['then'](function(_0x142adc){logger[_0x3d10('0x12')]('['+[_0xdca8a[_0x3d10('0x10')]()]+_0x3d10('0x42'),_0x142adc[_0x3d10('0xd')]);_0x2e2aa1[_0x3d10('0x43')]=_0x142adc[_0x3d10('0xd')][_0x3d10('0x1a')];_0x2e2aa1['ticketNumber']=_0x142adc[_0x3d10('0xd')]['number'];logger[_0x3d10('0x12')]('['+[_0xdca8a['toUpperCase']()]+_0x3d10('0x44'),_0x2e2aa1);_0x468520(_0x2e2aa1);})['catch'](function(_0xbed9ff){logger[_0x3d10('0xf')]('['+[_0xdca8a[_0x3d10('0x10')]()]+']',_0xbed9ff[_0x3d10('0x11')]);_0x3a9774(_0xbed9ff['message']);});});};}function createRemoteTag(_0x5bb2e6,_0x4e2e71,_0x487580,_0x3bbb35){return new Promise(function(_0x4b59f2,_0x2c1850){var _0x22af8a={'method':_0x3d10('0x3c'),'uri':_0x487580+_0x3d10('0x45')+'?'+_0x3bbb35,'body':{'short_description':_0x5bb2e6,'global':!![],'active':!![],'name':_0x5bb2e6},'auth':_0x4e2e71,'json':!![]};return rp(_0x22af8a)['then'](function(_0x3fdca6){var _0x80b15c=_0x3fdca6[_0x3d10('0xd')][_0x3d10('0x1a')];_0x4b59f2(_0x80b15c);});});}function getRemoteTag(_0x19f64c,_0x5991f7,_0x182ce4,_0x4be1a,_0x20299f){return new Promise(function(_0x3fbfaf,_0x43894e){var _0x198254={'method':_0x3d10('0x9'),'uri':_0x182ce4+'label'+_0x3d10('0x46')+_0x19f64c+'&'+_0x4be1a,'auth':_0x5991f7,'json':!![]};return rp(_0x198254)['then'](function(_0x3b0f8b){if(_0x3b0f8b[_0x3d10('0xd')][_0x3d10('0xc')]>0x0){var _0x418d34=_0x3b0f8b[_0x3d10('0xd')][0x0][_0x3d10('0x1a')];_0x3fbfaf(_0x418d34);}else{return createRemoteTag(_0x19f64c,_0x5991f7,_0x182ce4,_0x4be1a)[_0x3d10('0xb')](function(_0x1fcd59){_0x3fbfaf(_0x1fcd59);});}});});}function assignTagToIncident(_0x34d11d,_0x143026,_0xe3c98d,_0x352081,_0x11d6d8){return new Promise(function(_0x3d9b08,_0x5462b6){var _0x2d0555={'method':_0x3d10('0x3c'),'uri':_0xe3c98d+_0x3d10('0x47')+'?'+_0x11d6d8,'body':{'label':_0x34d11d,'table':_0x3d10('0x3d'),'id_type':_0x3d10('0x48'),'table_key':_0x352081[_0x3d10('0x43')],'title':_0x3d10('0x49')+_0x352081[_0x3d10('0x4a')],'id_display':_0x352081['ticketNumber']},'auth':_0x143026,'json':!![]};return rp(_0x2d0555)[_0x3d10('0xb')](function(_0x218f5c){_0x3d9b08();})[_0x3d10('0x1e')](function(){_0x3d9b08();});});}function manageTags(_0x1b9b45,_0x5c099f,_0x294e7b,_0x2e4c1b,_0x36616e,_0x35c273,_0xe10883){return new Promise(function(_0x580ff5,_0x17fa3b){var _0x508135=[];_0x5c099f[_0x3d10('0x2b')](function(_0x48fe20){_0x508135[_0x3d10('0x4b')](getRemoteTag(_0x48fe20,_0x294e7b,_0x2e4c1b,_0x35c273,_0xe10883));});return Promise[_0x3d10('0x4c')](_0x508135)[_0x3d10('0xb')](function(_0x138dfe){if(_0x138dfe[_0x3d10('0xc')]){logger[_0x3d10('0x12')]('['+[_0x1b9b45[_0x3d10('0x10')]()]+_0x3d10('0x4d'),_0x138dfe);var _0x3c04ed=[];_0x138dfe[_0x3d10('0x2b')](function(_0x364dae){_0x3c04ed[_0x3d10('0x4b')](assignTagToIncident(_0x364dae,_0x294e7b,_0x2e4c1b,_0x36616e,_0x35c273));});return Promise[_0x3d10('0x4c')](_0x3c04ed)[_0x3d10('0xb')](function(){_0x580ff5();})[_0x3d10('0x1e')](function(){_0x580ff5();});}else{_0x580ff5();}});});}function getTags(_0x1ae448,_0x473995,_0x40918b,_0x5134ce,_0x2db3aa,_0x3edad5){return function(_0x5414b9){return new Promise(function(_0x4ac20e,_0x56f390){var _0x58e4fa=[];var _0x4ad9dd=_0x5134ce[_0x3d10('0x4e')];if(_0x4ad9dd&&_0x4ad9dd['length']>0x0){_0x58e4fa=_[_0x3d10('0x4f')](_0x4ad9dd,_0x3d10('0x3a'));}if(_0x58e4fa[_0x3d10('0xc')]>0x0){return manageTags(_0x1ae448,_0x58e4fa,_0x473995,_0x40918b,_0x5414b9,_0x2db3aa,_0x3edad5)[_0x3d10('0xb')](function(){_0x4ac20e(_0x5414b9);});}else{_0x4ac20e(_0x5414b9);}});};}function emit(_0x2d449f,_0x5740b1,_0x8629b4){var _0x1a5e43='%26sysparm_record_target%3Dincident'+_0x3d10('0x50')+_0x3d10('0x51')+_0x3d10('0x52');var _0x1a662f={'uri':_0x2d449f+_0x3d10('0x53')+_0x8629b4+_0x1a5e43};io['to'](util[_0x3d10('0x54')]('user:%s',_0x5740b1))['emit'](_0x3d10('0x55'),_0x1a662f);}exports['cs']=function(_0x5769c6,_0x2ed589,_0x23e556,_0xec1a00,_0x493912,_0x23abe4,_0xd12471,_0x3153e4){var _0x5a31cb={};var _0x35b679={'user':_0x23abe4[_0x3d10('0x56')],'pass':_0x23abe4[_0x3d10('0x57')]};var _0x348f88=_0x3d10('0x58');var _0x38c4a3='sysparm_display_value=true';_0x23abe4[_0x3d10('0x59')]=intUtil[_0x3d10('0x5a')](_0x23abe4['remoteUri']);_0x23abe4[_0x3d10('0x5b')]=intUtil[_0x3d10('0x5a')](_0x23abe4[_0x3d10('0x5b')]);var _0xff1776=util[_0x3d10('0x54')](_0x3d10('0x5c'),_0x23abe4['remoteUri']);_0x5a31cb[_0x3d10('0x15')]=!_[_0x3d10('0x5d')](_0xec1a00)?_0xec1a00[_0x3d10('0x5e')]:null;_0x5a31cb[_0x3d10('0x1c')]=_0x23abe4['email'];_0x5a31cb[_0x3d10('0x22')]=_0x3153e4['toLowerCase']()===_0x3d10('0x5f')?_0x2ed589['destcalleridnum']:_0x2ed589[_0x3d10('0x60')];_0x5a31cb[_0x3d10('0x61')]=_0x3153e4==='queue'||_0x3153e4===_0x3d10('0x62')?_0x3d10('0x63'):_0x3d10('0x5f');var _0x1a527c=util[_0x3d10('0x54')](_0x3d10('0x64'),_0x23abe4[_0x3d10('0x5b')],_0x2ed589[_0x3d10('0x65')],md5(_0x2ed589[_0x3d10('0x65')]));if(_0x493912&&_0x493912[_0x3d10('0x66')]){logger[_0x3d10('0x12')](_0x3d10('0x67'),'Recording\x20is\x20enabled!');_0x2ed589[_0x3d10('0x68')]=_0x1a527c;}else if(_0xd12471&&_0xd12471[_0x3d10('0x69')]&&_0xd12471[_0x3d10('0x69')]!=='none'){logger[_0x3d10('0x12')]('[OUTBOUND]',_0x3d10('0x6a'));_0x2ed589[_0x3d10('0x68')]=_0x1a527c;}else{_0x2ed589[_0x3d10('0x68')]='';}return getAdminUser(_0x3153e4,_0x35b679,_0x5a31cb,_0xff1776,_0x38c4a3,_0x348f88)[_0x3d10('0xb')](getUser(_0x3153e4,_0x35b679,_0xff1776,_0x38c4a3,_0x348f88))[_0x3d10('0xb')](getEndUser(_0x3153e4,_0x35b679,_0xff1776,_0x38c4a3,_0x348f88))['then'](getTicket(_0x3153e4,_0x35b679,_0xff1776,_0x23e556,_0x2ed589,_0x38c4a3))[_0x3d10('0xb')](function(_0x44013e){logger[_0x3d10('0x12')](util[_0x3d10('0x54')]('The\x20ticket\x20ID\x20is:\x20%s',_0x44013e[_0x3d10('0x43')]));logger['info'](util['format']('call\x20direction:\x20%s',_0x3153e4));if(_0x3153e4!==_0x3d10('0x62')){logger['info']('['+[_0x3153e4[_0x3d10('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x23abe4[_0x3d10('0x59')],_0xec1a00[_0x3d10('0x3a')],_0x44013e[_0x3d10('0x43')]);}})['catch'](function(_0x4f30e6){logger[_0x3d10('0xf')]('['+[_0x3153e4[_0x3d10('0x10')]()]+_0x3d10('0x6b'),util['inspect'](_0x4f30e6,{'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 6007c09..890abe0 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 _0x8ab5=['PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','[QUEUE]','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','charAt','[OUTBOUND]','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','parent_name','direction','length','variableName','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20found!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','nameField','content','type','string','customField','custom_fields','variable','push','customVariable','Variable','toLowerCase','POST','login','username','password'];(function(_0x4063fd,_0x4b4af5){var _0x29c583=function(_0x20da37){while(--_0x20da37){_0x4063fd['push'](_0x4063fd['shift']());}};_0x29c583(++_0x4b4af5);}(_0x8ab5,0x124));var _0x58ab=function(_0x2ddbe7,_0x4906a0){_0x2ddbe7=_0x2ddbe7-0x0;var _0x257b20=_0x8ab5[_0x2ddbe7];return _0x257b20;};'use strict';var _=require(_0x58ab('0x0'));var rp=require('request-promise');var BPromise=require(_0x58ab('0x1'));var md5=require(_0x58ab('0x2'));var util=require(_0x58ab('0x3'));var Redis=require(_0x58ab('0x4'));var intUtil=require('./util');var config=require(_0x58ab('0x5'));var logger=require(_0x58ab('0x6'))(_0x58ab('0x7'));config[_0x58ab('0x8')]=_[_0x58ab('0x9')](config['redis'],{'host':_0x58ab('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x58ab('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x28d9a1,_0x6480d,_0x504f87){io['to'](_0x28d9a1)[_0x58ab('0xb')](_0x6480d,_0x504f87);}function getTicket(_0xdbd981,_0xe8f5b4,_0x1e789d,_0x290942,_0x4c048c,_0x3f75e8,_0x373823,_0x2c8271){logger[_0x58ab('0xc')](_0x58ab('0xd'));var _0x3d087b=new Date();var _0x7a69a9=[{'name':_0x58ab('0xe'),'value':intUtil[_0x58ab('0xf')](_0x290942['Subjects'],_0x4c048c,'\x20')},{'name':_0x58ab('0x10'),'value':_0xe8f5b4['id']},{'name':'created_by','value':_0xe8f5b4['id']},{'name':_0x58ab('0x11'),'value':intUtil[_0x58ab('0xf')](_0x290942[_0x58ab('0x12')],_0x4c048c,'\x0a')},{'name':_0x58ab('0x13'),'value':_0x3d087b[_0x58ab('0x14')]()[_0x58ab('0x15')](0x0,0x13)[_0x58ab('0x16')]('T','\x20')},{'name':_0x58ab('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x58ab('0x18'),'value':_0x1e789d['id']},{'name':_0x58ab('0x19'),'value':'Contacts'},{'name':_0x58ab('0x1a'),'value':_0x1e789d['name']},{'name':_0x58ab('0x1b'),'value':_0x2c8271}];if(_0x3f75e8[_0x58ab('0x1c')]){_['forEach'](_0x3f75e8,function(_0x3071f1){if(_0x4c048c[_0x3071f1[_0x58ab('0x1d')]]){_0x7a69a9['push']({'name':_0x3071f1[_0x58ab('0x1e')],'value':_0x4c048c[_0x3071f1[_0x58ab('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x58ab('0x1f'),'response_type':_0x58ab('0x1f'),'rest_data':JSON[_0x58ab('0x20')]({'session':_0x373823['id'],'module_name':_0x58ab('0x21'),'name_value_list':_0x7a69a9})}});}function getAuth(_0x5e3562){return util[_0x58ab('0x22')](_0x58ab('0x23'),new Buffer(_0x5e3562[_0x58ab('0x24')]+':X')[_0x58ab('0x25')](_0x58ab('0x26')));}function getServerInfo(_0x88cccd){return request({'form':{'method':_0x58ab('0x27'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x88cccd['id']})}});}function getUser(_0x39da77,_0x1acb72,_0x47f620){if(!_[_0x58ab('0x28')](_0x1acb72)){logger['info']('Getting\x20agent\x20with\x20name',_0x1acb72);return request({'form':{'method':_0x58ab('0x29'),'input_type':_0x58ab('0x1f'),'response_type':'JSON','rest_data':JSON[_0x58ab('0x20')]({'session':_0x47f620['id'],'module_name':_0x58ab('0x2a'),'query':util[_0x58ab('0x22')](_0x58ab('0x2b'),_0x1acb72),'order_by':'','offset':'0','select_fields':['id',_0x58ab('0xe'),_0x58ab('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x58ab('0x2d')](function(_0x4b7984){if(_0x4b7984[_0x58ab('0x2e')][_0x58ab('0x1c')]){var _0x4bbac1=_[_0x58ab('0x2f')](_0x4b7984['entry_list'],function(_0x598af8){return _0x598af8['name_value_list'][_0x58ab('0x2c')][_0x58ab('0x30')]===_0x1acb72;});if(_0x4bbac1){logger['info']('Agent\x20found!');return BPromise[_0x58ab('0x31')]({'id':_0x4bbac1[_0x58ab('0x32')]['id'][_0x58ab('0x30')],'name':_0x4bbac1['name_value_list']['name'][_0x58ab('0x30')]});}}logger['info'](_0x58ab('0x33'));return BPromise[_0x58ab('0x31')]({'id':_0x47f620[_0x58ab('0x32')][_0x58ab('0x34')][_0x58ab('0x30')],'name':_0x47f620['name_value_list'][_0x58ab('0x2c')][_0x58ab('0x30')]});});}else{logger[_0x58ab('0xc')](_0x58ab('0x35'));return BPromise[_0x58ab('0x31')]({'id':_0x47f620['name_value_list'][_0x58ab('0x34')][_0x58ab('0x30')],'name':_0x47f620[_0x58ab('0x32')][_0x58ab('0x2c')][_0x58ab('0x30')]});}}function getEndUser(_0x46edb9,_0x39254f,_0x57e1fe,_0x1f3d1e){logger['info'](_0x58ab('0x36'),_0x57e1fe);return request({'form':{'method':_0x58ab('0x29'),'input_type':'JSON','response_type':_0x58ab('0x1f'),'rest_data':JSON['stringify']({'session':_0x1f3d1e['id'],'module_name':_0x58ab('0x37'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x57e1fe),'order_by':'','offset':'0','select_fields':['id','name',_0x58ab('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0xc0f430){if(_0xc0f430[_0x58ab('0x2e')][_0x58ab('0x1c')]){var _0x3b53c8=_[_0x58ab('0x2f')](_0xc0f430[_0x58ab('0x2e')],function(_0x58da32){return _0x58da32[_0x58ab('0x32')]['phone_home'][_0x58ab('0x30')]===_0x57e1fe;});if(_0x3b53c8){logger['info'](_0x58ab('0x39'));return BPromise[_0x58ab('0x31')]({'id':_0x3b53c8[_0x58ab('0x32')]['id'][_0x58ab('0x30')],'name':_0x3b53c8[_0x58ab('0x32')][_0x58ab('0xe')][_0x58ab('0x30')],'phone':_0x3b53c8[_0x58ab('0x32')][_0x58ab('0x38')][_0x58ab('0x30')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x58ab('0x3a'),'input_type':_0x58ab('0x1f'),'response_type':'JSON','rest_data':JSON[_0x58ab('0x20')]({'session':_0x1f3d1e['id'],'module_name':_0x58ab('0x37'),'name_value_list':[{'name':_0x58ab('0x3b'),'value':_0x39254f!==_0x58ab('0x3c')?_0x39254f:util['format'](_0x58ab('0x3d'),_0x57e1fe)},{'name':_0x58ab('0x38'),'value':_0x57e1fe}]})}})[_0x58ab('0x2d')](function(_0x4f89c7){logger[_0x58ab('0xc')](_0x58ab('0x3e'));return BPromise['resolve']({'id':_0x4f89c7['id'],'name':_0x4f89c7['entry_list'][_0x58ab('0x3b')][_0x58ab('0x30')],'phone':_0x4f89c7['entry_list']['phone_home'][_0x58ab('0x30')]});});}});}function request(_0x364def){logger[_0x58ab('0x3f')](_0x58ab('0x40'),JSON[_0x58ab('0x20')](_0x364def));return rp(_[_0x58ab('0x41')](def,_0x364def));}function getTags(_0x3c5485,_0x1be61f){var _0x412136=[];if(_0x3c5485&&_0x3c5485['length']>0x0){_0x412136=_[_0x58ab('0x42')](_0x3c5485,_0x1be61f);}return _0x412136;}function getCustomFields(_0x147170,_0x67fe4d){var _0xc221fb=[];var _0x5d4a06={'custom_fields':[]};if(_0x147170[_0x58ab('0x1c')]>0x0){_[_0x58ab('0x43')](_0x147170,function(_0x1ad325){if(_0x1ad325['type']==='string'&&_0x1ad325[_0x58ab('0x44')]&&!_0x1ad325['customField']){_0x5d4a06[_0x1ad325['nameField']['toLowerCase']()]=_0x1ad325[_0x58ab('0x45')][_0x58ab('0x25')]();}else if(_0x1ad325[_0x58ab('0x46')]===_0x58ab('0x47')&&_0x1ad325[_0x58ab('0x1e')]&&_0x1ad325[_0x58ab('0x48')]){_0x5d4a06[_0x58ab('0x49')]['push']({'id':_0x1ad325[_0x58ab('0x1e')],'value':_0x1ad325[_0x58ab('0x45')][_0x58ab('0x25')]()});}else if(_0x1ad325[_0x58ab('0x46')]===_0x58ab('0x4a')&&_0x1ad325[_0x58ab('0x1d')]&&_0x1ad325[_0x58ab('0x1e')]&&_0x1ad325[_0x58ab('0x48')]){_0x67fe4d[_0x1ad325[_0x58ab('0x1d')]]&&_0x5d4a06[_0x58ab('0x49')][_0x58ab('0x4b')]({'id':_0x1ad325['idField'],'value':_0x67fe4d[_0x1ad325[_0x58ab('0x1d')]][_0x58ab('0x25')]()});}else if(_0x1ad325['type']===_0x58ab('0x4c')&&_0x1ad325[_0x58ab('0x4d')]&&_0x1ad325[_0x58ab('0x4d')][_0x58ab('0xe')]&&_0x1ad325[_0x58ab('0x1e')]&&_0x1ad325[_0x58ab('0x48')]){_0x67fe4d[_0x1ad325[_0x58ab('0x4d')]['name']['toLowerCase']()]&&_0x5d4a06['custom_fields'][_0x58ab('0x4b')]({'id':_0x1ad325[_0x58ab('0x1e')],'value':_0x67fe4d[_0x1ad325[_0x58ab('0x4d')][_0x58ab('0xe')][_0x58ab('0x4e')]()][_0x58ab('0x25')]()});}});}return _0x5d4a06;}function getConnection(_0x43984c){return request({'method':_0x58ab('0x4f'),'form':{'method':_0x58ab('0x50'),'input_type':_0x58ab('0x1f'),'response_type':_0x58ab('0x1f'),'rest_data':JSON[_0x58ab('0x20')]({'user_auth':{'user_name':_0x43984c[_0x58ab('0x51')],'password':_0x43984c[_0x58ab('0x52')],'encryption':_0x58ab('0x53')},'application':_0x58ab('0x54')})}})[_0x58ab('0x2d')](function(_0xf7b668){var _0x34a16b=_0xf7b668;if(_0x34a16b['id']){def['sessionID']=_0x34a16b['id'];return BPromise[_0x58ab('0x31')](_0x34a16b);}else{throw new Error(util['format'](_0x58ab('0x55'),_0x43984c['id']));}});}function setRelationship(_0x32b667,_0x28b8cd,_0x4c063f,_0x36175c){return request({'form':{'method':_0x58ab('0x56'),'input_type':_0x58ab('0x1f'),'response_type':_0x58ab('0x1f'),'rest_data':JSON[_0x58ab('0x20')]({'session':_0x32b667['id'],'module_name':'Calls','module_id':_0x4c063f['id'],'link_field_name':_0x36175c,'related_ids':[_0x28b8cd['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x58ab('0x57')]=function(_0x11a726,_0x49557c,_0x217d65,_0x2f7487,_0x186783,_0x361282){var _0x4f349f,_0x586c14,_0x24f4a2,_0x5bee5d;_0x361282[_0x58ab('0x58')]=intUtil['stripTrailingSlash'](_0x361282['remoteUri']);_0x361282[_0x58ab('0x59')]=intUtil[_0x58ab('0x5a')](_0x361282['serverUrl']);def[_0x58ab('0x5b')]=util['format']('%s/service/v4_1/rest.php',_0x361282[_0x58ab('0x58')]);if(_0x186783&&_0x186783[_0x58ab('0x5c')]){logger[_0x58ab('0xc')](_0x58ab('0x5d'),'Recording\x20is\x20enabled!');_0x49557c[_0x58ab('0x5e')]=util[_0x58ab('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x361282[_0x58ab('0x59')],_0x49557c[_0x58ab('0x5f')],md5(_0x49557c[_0x58ab('0x5f')]));}else{_0x49557c[_0x58ab('0x5e')]='';}return getConnection(_0x361282)[_0x58ab('0x2d')](function(_0x2a9a98){_0x5bee5d=_0x2a9a98;return getUser(_0x361282,_0x2f7487['name'],_0x5bee5d);})['then'](function(_0x5d7b44){_0x4f349f=_0x5d7b44;logger[_0x58ab('0xc')](_0x58ab('0x60'),_0x4f349f['id']);return getEndUser(_0x361282,_0x49557c[_0x58ab('0x61')],_0x49557c['calleridnum'],_0x5bee5d);})[_0x58ab('0x2d')](function(_0x1e8156){_0x586c14=_0x1e8156;logger['info'](_0x58ab('0x62'),_0x586c14['id']);return getTicket(_0x361282,_0x4f349f,_0x586c14,_0x217d65,_0x49557c,_0x217d65[_0x58ab('0x63')],_0x5bee5d,_0x58ab('0x64'));})[_0x58ab('0x2d')](function(_0x12964f){_0x24f4a2=_0x12964f;logger[_0x58ab('0xc')](_0x58ab('0x65'));logger[_0x58ab('0xc')](_0x58ab('0x66'),_0x24f4a2['id']);return setRelationship(_0x5bee5d,_0x4f349f,_0x24f4a2,_0x58ab('0x67'));})[_0x58ab('0x2d')](function(){return setRelationship(_0x5bee5d,_0x586c14,_0x24f4a2,_0x58ab('0x68'));})['then'](function(){return getServerInfo(_0x5bee5d);})['then'](function(_0x1b389f){var _0x1b0deb=parseInt(_0x1b389f[_0x58ab('0x69')]['charAt'](0x0));var _0x22fb78=util[_0x58ab('0x22')](_0x58ab('0x6a'),_0x361282[_0x58ab('0x58')],_0x24f4a2['id']);if(_0x1b0deb>0x6){_0x22fb78=util[_0x58ab('0x22')](_0x58ab('0x6b'),_0x361282[_0x58ab('0x58')],_0x24f4a2['id']);}logger['info'](_0x58ab('0x5d'),_0x58ab('0x6c'));emit(util['format'](_0x58ab('0x6d'),_0x2f7487['name']),'trigger:browser:url',{'uri':_0x22fb78});})['catch'](function(_0x180983){logger[_0x58ab('0x6e')]('[QUEUE]',JSON[_0x58ab('0x20')](_0x180983));});};exports[_0x58ab('0x6f')]=function(_0x3b500d,_0x348439,_0x110396,_0x462bb8,_0x2ba392,_0x116eb5,_0x21ebd4){var _0x502f50,_0x4dcb78,_0x36420a,_0x4308f4;_0x116eb5[_0x58ab('0x58')]=intUtil['stripTrailingSlash'](_0x116eb5[_0x58ab('0x58')]);_0x116eb5[_0x58ab('0x59')]=intUtil[_0x58ab('0x5a')](_0x116eb5[_0x58ab('0x59')]);def[_0x58ab('0x5b')]=util[_0x58ab('0x22')](_0x58ab('0x70'),_0x116eb5[_0x58ab('0x58')]);if(_0x21ebd4&&_0x21ebd4['recordingFormat']&&_0x21ebd4[_0x58ab('0x71')]!==_0x58ab('0x72')){logger[_0x58ab('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x348439['recordingURL']=util['format'](_0x58ab('0x73'),_0x116eb5[_0x58ab('0x59')],_0x348439[_0x58ab('0x5f')],md5(_0x348439[_0x58ab('0x5f')]));}return getConnection(_0x116eb5)[_0x58ab('0x2d')](function(_0x3221af){_0x4308f4=_0x3221af;return getUser(_0x116eb5,_0x462bb8[_0x58ab('0xe')],_0x4308f4);})['then'](function(_0x129eea){_0x502f50=_0x129eea;logger[_0x58ab('0xc')](_0x58ab('0x60'),_0x502f50['id']);return getEndUser(_0x116eb5,_0x348439['destcalleridname'],_0x348439[_0x58ab('0x74')],_0x4308f4);})[_0x58ab('0x2d')](function(_0x594579){_0x4dcb78=_0x594579;logger['info'](_0x58ab('0x62'),_0x4dcb78['id']);return getTicket(_0x116eb5,_0x502f50,_0x4dcb78,_0x110396,_0x348439,_0x110396[_0x58ab('0x63')],_0x4308f4,'Outbound');})[_0x58ab('0x2d')](function(_0x28e8a9){_0x36420a=_0x28e8a9;logger['info']('Ticket\x20created!');logger['info'](_0x58ab('0x66'),_0x36420a['id']);return setRelationship(_0x4308f4,_0x502f50,_0x36420a,_0x58ab('0x67'));})['then'](function(){return setRelationship(_0x4308f4,_0x4dcb78,_0x36420a,_0x58ab('0x68'));})[_0x58ab('0x2d')](function(){return getServerInfo(_0x4308f4);})[_0x58ab('0x2d')](function(_0x490556){var _0x2e9a87=parseInt(_0x490556[_0x58ab('0x69')][_0x58ab('0x75')](0x0));var _0x41bead=util[_0x58ab('0x22')](_0x58ab('0x6a'),_0x116eb5[_0x58ab('0x58')],_0x36420a['id']);if(_0x2e9a87>0x6){_0x41bead=util[_0x58ab('0x22')](_0x58ab('0x6b'),_0x116eb5[_0x58ab('0x58')],_0x36420a['id']);}logger[_0x58ab('0xc')](_0x58ab('0x76'),_0x58ab('0x6c'));emit(util[_0x58ab('0x22')]('user:%s',_0x462bb8['name']),_0x58ab('0x77'),{'uri':_0x41bead});})[_0x58ab('0x78')](function(_0x428033){logger[_0x58ab('0x6e')](_0x58ab('0x76'),JSON[_0x58ab('0x20')](_0x428033));});};exports[_0x58ab('0x79')]=function(_0x4318c4,_0x21859e,_0x5380e0,_0x1aed32,_0x5a30af,_0x1f21ca){var _0x4327b3,_0x5496d8,_0x288e7c,_0xa99fc3;_0x1f21ca[_0x58ab('0x58')]=intUtil['stripTrailingSlash'](_0x1f21ca[_0x58ab('0x58')]);_0x1f21ca[_0x58ab('0x59')]=intUtil['stripTrailingSlash'](_0x1f21ca[_0x58ab('0x59')]);def[_0x58ab('0x5b')]=util[_0x58ab('0x22')](_0x58ab('0x70'),_0x1f21ca[_0x58ab('0x58')]);if(_0x5a30af&&_0x5a30af[_0x58ab('0x5c')]){logger[_0x58ab('0xc')]('['+_0x21859e[_0x58ab('0x7a')][_0x58ab('0x7b')]()+']',_0x58ab('0x7c'));_0x21859e[_0x58ab('0x5e')]=util[_0x58ab('0x22')](_0x58ab('0x73'),_0x1f21ca[_0x58ab('0x59')],_0x21859e[_0x58ab('0x5f')],md5(_0x21859e[_0x58ab('0x5f')]));}else{_0x21859e[_0x58ab('0x5e')]='';}return getConnection(_0x1f21ca)['then'](function(_0x113192){_0xa99fc3=_0x113192;if(!_['isNil'](_0x1aed32)){return getUser(_0x1f21ca,_0x1aed32[_0x58ab('0xe')],_0xa99fc3);}else{return getUser(_0x1f21ca,null,_0xa99fc3);}})[_0x58ab('0x2d')](function(_0x1f808d){_0x4327b3=_0x1f808d;logger[_0x58ab('0xc')]('The\x20User\x20ID\x20is:',_0x4327b3['id']);return getEndUser(_0x1f21ca,_0x21859e[_0x58ab('0x61')],_0x21859e['calleridnum'],_0xa99fc3);})[_0x58ab('0x2d')](function(_0x3f7aa5){_0x5496d8=_0x3f7aa5;logger[_0x58ab('0xc')](_0x58ab('0x62'),_0x5496d8['id']);return getTicket(_0x1f21ca,_0x4327b3,_0x5496d8,_0x5380e0,_0x21859e,_0x5380e0[_0x58ab('0x63')],_0xa99fc3,'Inbound');})[_0x58ab('0x2d')](function(_0x4ade67){_0x288e7c=_0x4ade67;logger[_0x58ab('0xc')]('Ticket\x20created!');logger[_0x58ab('0xc')](_0x58ab('0x66'),_0x288e7c['id']);return setRelationship(_0xa99fc3,_0x4327b3,_0x288e7c,_0x58ab('0x67'));})[_0x58ab('0x2d')](function(){return setRelationship(_0xa99fc3,_0x5496d8,_0x288e7c,'contacts');})[_0x58ab('0x2d')](function(){return getServerInfo(_0xa99fc3);})[_0x58ab('0x78')](function(_0x4925f9){logger[_0x58ab('0x6e')]('['+_0x21859e[_0x58ab('0x7a')][_0x58ab('0x7b')]()+']',JSON[_0x58ab('0x20')](_0x4925f9));});}; \ No newline at end of file +var _0x794c=['string','nameField','customField','content','custom_fields','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','users','version','remoteUri','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','Outbound','Ticket\x20created!','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','catch','monitor_format','lastevent','toUpperCase','Inbound','lodash','request-promise','util','./util','../../../../config/logger','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','replace','duration_minutes','parent_id','parent_type','Contacts','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','stringify','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','type'];(function(_0x42e5ea,_0x350f7a){var _0x2f4864=function(_0x5d418a){while(--_0x5d418a){_0x42e5ea['push'](_0x42e5ea['shift']());}};_0x2f4864(++_0x350f7a);}(_0x794c,0x122));var _0xc794=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x794c[_0x441563];return _0x2369ec;};'use strict';var _=require(_0xc794('0x0'));var rp=require(_0xc794('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xc794('0x2'));var Redis=require('ioredis');var intUtil=require(_0xc794('0x3'));var config=require('../../../../config/environment');var logger=require(_0xc794('0x4'))('sugarcrm');config[_0xc794('0x5')]=_[_0xc794('0x6')](config[_0xc794('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc794('0x7'))(new Redis(config[_0xc794('0x5')]));var def={'method':_0xc794('0x8'),'json':!![]};function emit(_0x46ed79,_0x39c112,_0x5b0eb2){io['to'](_0x46ed79)[_0xc794('0x9')](_0x39c112,_0x5b0eb2);}function getTicket(_0x119427,_0x7052f5,_0x70ba92,_0x519846,_0x557245,_0x2630eb,_0x50636c,_0x1ceb19){logger[_0xc794('0xa')](_0xc794('0xb'));var _0x14b82e=new Date();var _0x5b1a86=[{'name':'name','value':intUtil[_0xc794('0xc')](_0x519846[_0xc794('0xd')],_0x557245,'\x20')},{'name':_0xc794('0xe'),'value':_0x7052f5['id']},{'name':_0xc794('0xf'),'value':_0x7052f5['id']},{'name':_0xc794('0x10'),'value':intUtil[_0xc794('0xc')](_0x519846['Descriptions'],_0x557245,'\x0a')},{'name':_0xc794('0x11'),'value':_0x14b82e[_0xc794('0x12')]()['slice'](0x0,0x13)[_0xc794('0x13')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xc794('0x14'),'value':'15'},{'name':_0xc794('0x15'),'value':_0x70ba92['id']},{'name':_0xc794('0x16'),'value':_0xc794('0x17')},{'name':'parent_name','value':_0x70ba92[_0xc794('0x18')]},{'name':_0xc794('0x19'),'value':_0x1ceb19}];if(_0x2630eb[_0xc794('0x1a')]){_[_0xc794('0x1b')](_0x2630eb,function(_0x15e7fd){if(_0x557245[_0x15e7fd[_0xc794('0x1c')]]){_0x5b1a86[_0xc794('0x1d')]({'name':_0x15e7fd[_0xc794('0x1e')],'value':_0x557245[_0x15e7fd[_0xc794('0x1c')]]});}});}return request({'form':{'method':_0xc794('0x1f'),'input_type':_0xc794('0x20'),'response_type':_0xc794('0x20'),'rest_data':JSON['stringify']({'session':_0x50636c['id'],'module_name':_0xc794('0x21'),'name_value_list':_0x5b1a86})}});}function getAuth(_0x2eea2b){return util[_0xc794('0x22')](_0xc794('0x23'),new Buffer(_0x2eea2b['apiKey']+':X')[_0xc794('0x24')](_0xc794('0x25')));}function getServerInfo(_0x55380c){return request({'form':{'method':'get_server_info','input_type':_0xc794('0x20'),'response_type':_0xc794('0x20'),'rest_data':JSON['stringify']({'session':_0x55380c['id']})}});}function getUser(_0x44a3d8,_0x530602,_0x64638c){if(!_[_0xc794('0x26')](_0x530602)){logger['info'](_0xc794('0x27'),_0x530602);return request({'form':{'method':_0xc794('0x28'),'input_type':'JSON','response_type':_0xc794('0x20'),'rest_data':JSON[_0xc794('0x29')]({'session':_0x64638c['id'],'module_name':'Employees','query':util['format'](_0xc794('0x2a'),_0x530602),'order_by':'','offset':'0','select_fields':['id',_0xc794('0x18'),_0xc794('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc794('0x2c')](function(_0x3dfdd7){if(_0x3dfdd7[_0xc794('0x2d')]['length']){var _0x26cdca=_['find'](_0x3dfdd7[_0xc794('0x2d')],function(_0x2baac2){return _0x2baac2[_0xc794('0x2e')][_0xc794('0x2b')][_0xc794('0x2f')]===_0x530602;});if(_0x26cdca){logger[_0xc794('0xa')]('Agent\x20found!');return BPromise['resolve']({'id':_0x26cdca[_0xc794('0x2e')]['id']['value'],'name':_0x26cdca[_0xc794('0x2e')]['name'][_0xc794('0x2f')]});}}logger[_0xc794('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc794('0x30')]({'id':_0x64638c[_0xc794('0x2e')][_0xc794('0x31')]['value'],'name':_0x64638c[_0xc794('0x2e')][_0xc794('0x2b')]['value']});});}else{logger[_0xc794('0xa')](_0xc794('0x32'));return BPromise['resolve']({'id':_0x64638c[_0xc794('0x2e')][_0xc794('0x31')][_0xc794('0x2f')],'name':_0x64638c['name_value_list'][_0xc794('0x2b')][_0xc794('0x2f')]});}}function getEndUser(_0x2757bb,_0x2d6047,_0x58bab3,_0x15ac50){logger[_0xc794('0xa')](_0xc794('0x33'),_0x58bab3);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xc794('0x29')]({'session':_0x15ac50['id'],'module_name':'Contacts','query':util[_0xc794('0x22')](_0xc794('0x34'),_0x58bab3),'order_by':'','offset':'0','select_fields':['id',_0xc794('0x18'),_0xc794('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc794('0x2c')](function(_0x59a02c){if(_0x59a02c[_0xc794('0x2d')][_0xc794('0x1a')]){var _0x29e4d9=_[_0xc794('0x36')](_0x59a02c[_0xc794('0x2d')],function(_0x142571){return _0x142571[_0xc794('0x2e')]['phone_home']['value']===_0x58bab3;});if(_0x29e4d9){logger[_0xc794('0xa')]('Enduser\x20found!');return BPromise[_0xc794('0x30')]({'id':_0x29e4d9[_0xc794('0x2e')]['id'][_0xc794('0x2f')],'name':_0x29e4d9[_0xc794('0x2e')][_0xc794('0x18')][_0xc794('0x2f')],'phone':_0x29e4d9['name_value_list'][_0xc794('0x35')][_0xc794('0x2f')]});}}else{logger[_0xc794('0xa')](_0xc794('0x37'));return request({'form':{'method':'set_entry','input_type':_0xc794('0x20'),'response_type':'JSON','rest_data':JSON[_0xc794('0x29')]({'session':_0x15ac50['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x2d6047!==_0xc794('0x38')?_0x2d6047:util[_0xc794('0x22')](_0xc794('0x39'),_0x58bab3)},{'name':_0xc794('0x35'),'value':_0x58bab3}]})}})['then'](function(_0x348067){logger[_0xc794('0xa')](_0xc794('0x3a'));return BPromise[_0xc794('0x30')]({'id':_0x348067['id'],'name':_0x348067['entry_list'][_0xc794('0x3b')][_0xc794('0x2f')],'phone':_0x348067[_0xc794('0x2d')]['phone_home']['value']});});}});}function request(_0x564896){logger[_0xc794('0x3c')](_0xc794('0x3d'),JSON[_0xc794('0x29')](_0x564896));return rp(_['merge'](def,_0x564896));}function getTags(_0x8c8077,_0x53c6f9){var _0x301467=[];if(_0x8c8077&&_0x8c8077[_0xc794('0x1a')]>0x0){_0x301467=_[_0xc794('0x3e')](_0x8c8077,_0x53c6f9);}return _0x301467;}function getCustomFields(_0x2b033e,_0xb55606){var _0x33bec9=[];var _0xf4eaf5={'custom_fields':[]};if(_0x2b033e[_0xc794('0x1a')]>0x0){_['forEach'](_0x2b033e,function(_0x20c625){if(_0x20c625[_0xc794('0x3f')]===_0xc794('0x40')&&_0x20c625[_0xc794('0x41')]&&!_0x20c625[_0xc794('0x42')]){_0xf4eaf5[_0x20c625[_0xc794('0x41')]['toLowerCase']()]=_0x20c625[_0xc794('0x43')][_0xc794('0x24')]();}else if(_0x20c625[_0xc794('0x3f')]===_0xc794('0x40')&&_0x20c625[_0xc794('0x1e')]&&_0x20c625['customField']){_0xf4eaf5[_0xc794('0x44')]['push']({'id':_0x20c625[_0xc794('0x1e')],'value':_0x20c625[_0xc794('0x43')]['toString']()});}else if(_0x20c625['type']===_0xc794('0x45')&&_0x20c625['variableName']&&_0x20c625[_0xc794('0x1e')]&&_0x20c625[_0xc794('0x42')]){_0xb55606[_0x20c625[_0xc794('0x1c')]]&&_0xf4eaf5['custom_fields'][_0xc794('0x1d')]({'id':_0x20c625[_0xc794('0x1e')],'value':_0xb55606[_0x20c625[_0xc794('0x1c')]][_0xc794('0x24')]()});}else if(_0x20c625[_0xc794('0x3f')]===_0xc794('0x46')&&_0x20c625['Variable']&&_0x20c625[_0xc794('0x47')][_0xc794('0x18')]&&_0x20c625[_0xc794('0x1e')]&&_0x20c625[_0xc794('0x42')]){_0xb55606[_0x20c625[_0xc794('0x47')][_0xc794('0x18')][_0xc794('0x48')]()]&&_0xf4eaf5[_0xc794('0x44')][_0xc794('0x1d')]({'id':_0x20c625['idField'],'value':_0xb55606[_0x20c625['Variable'][_0xc794('0x18')][_0xc794('0x48')]()][_0xc794('0x24')]()});}});}return _0xf4eaf5;}function getConnection(_0x5c4db5){return request({'method':_0xc794('0x8'),'form':{'method':_0xc794('0x49'),'input_type':_0xc794('0x20'),'response_type':_0xc794('0x20'),'rest_data':JSON[_0xc794('0x29')]({'user_auth':{'user_name':_0x5c4db5[_0xc794('0x4a')],'password':_0x5c4db5[_0xc794('0x4b')],'encryption':_0xc794('0x4c')},'application':_0xc794('0x4d')})}})[_0xc794('0x2c')](function(_0x52f10f){var _0x104029=_0x52f10f;if(_0x104029['id']){def[_0xc794('0x4e')]=_0x104029['id'];return BPromise[_0xc794('0x30')](_0x104029);}else{throw new Error(util[_0xc794('0x22')](_0xc794('0x4f'),_0x5c4db5['id']));}});}function setRelationship(_0xe5be4b,_0x3a0986,_0x220829,_0x90bce4){return request({'form':{'method':'set_relationship','input_type':_0xc794('0x20'),'response_type':_0xc794('0x20'),'rest_data':JSON[_0xc794('0x29')]({'session':_0xe5be4b['id'],'module_name':'Calls','module_id':_0x220829['id'],'link_field_name':_0x90bce4,'related_ids':[_0x3a0986['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xc794('0x50')]=function(_0x46b45f,_0xa8f9ec,_0x45c047,_0x4b15a7,_0x4e54e7,_0x51e4fa){var _0x3ff8b5,_0x5bc349,_0x281d3e,_0x11d8da;_0x51e4fa['remoteUri']=intUtil['stripTrailingSlash'](_0x51e4fa['remoteUri']);_0x51e4fa[_0xc794('0x51')]=intUtil[_0xc794('0x52')](_0x51e4fa[_0xc794('0x51')]);def[_0xc794('0x53')]=util['format'](_0xc794('0x54'),_0x51e4fa['remoteUri']);if(_0x4e54e7&&_0x4e54e7['monitor_format']){logger[_0xc794('0xa')](_0xc794('0x55'),_0xc794('0x56'));_0xa8f9ec['recordingURL']=util[_0xc794('0x22')](_0xc794('0x57'),_0x51e4fa['serverUrl'],_0xa8f9ec[_0xc794('0x58')],md5(_0xa8f9ec[_0xc794('0x58')]));}else{_0xa8f9ec['recordingURL']='';}return getConnection(_0x51e4fa)['then'](function(_0x3431b3){_0x11d8da=_0x3431b3;return getUser(_0x51e4fa,_0x4b15a7[_0xc794('0x18')],_0x11d8da);})[_0xc794('0x2c')](function(_0x7d0175){_0x3ff8b5=_0x7d0175;logger[_0xc794('0xa')](_0xc794('0x59'),_0x3ff8b5['id']);return getEndUser(_0x51e4fa,_0xa8f9ec[_0xc794('0x5a')],_0xa8f9ec[_0xc794('0x5b')],_0x11d8da);})[_0xc794('0x2c')](function(_0x455730){_0x5bc349=_0x455730;logger[_0xc794('0xa')](_0xc794('0x5c'),_0x5bc349['id']);return getTicket(_0x51e4fa,_0x3ff8b5,_0x5bc349,_0x45c047,_0xa8f9ec,_0x45c047[_0xc794('0x5d')],_0x11d8da,'Inbound');})[_0xc794('0x2c')](function(_0x559b1c){_0x281d3e=_0x559b1c;logger[_0xc794('0xa')]('Ticket\x20created!');logger['info'](_0xc794('0x5e'),_0x281d3e['id']);return setRelationship(_0x11d8da,_0x3ff8b5,_0x281d3e,_0xc794('0x5f'));})[_0xc794('0x2c')](function(){return setRelationship(_0x11d8da,_0x5bc349,_0x281d3e,'contacts');})['then'](function(){return getServerInfo(_0x11d8da);})[_0xc794('0x2c')](function(_0x5e2c9e){var _0x5077e4=parseInt(_0x5e2c9e[_0xc794('0x60')]['charAt'](0x0));var _0x5a0728=util[_0xc794('0x22')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x51e4fa[_0xc794('0x61')],_0x281d3e['id']);if(_0x5077e4>0x6){_0x5a0728=util[_0xc794('0x22')](_0xc794('0x62'),_0x51e4fa[_0xc794('0x61')],_0x281d3e['id']);}logger[_0xc794('0xa')](_0xc794('0x55'),_0xc794('0x63'));emit(util[_0xc794('0x22')](_0xc794('0x64'),_0x4b15a7[_0xc794('0x18')]),_0xc794('0x65'),{'uri':_0x5a0728});})['catch'](function(_0x1732bf){logger[_0xc794('0x66')]('[QUEUE]',JSON[_0xc794('0x29')](_0x1732bf));});};exports[_0xc794('0x67')]=function(_0x2ac309,_0x37e3ff,_0x84caf7,_0x1659be,_0x1fbde8,_0x115e55,_0x224217){var _0x3dcac6,_0x54bec0,_0x29f721,_0x16e708;_0x115e55['remoteUri']=intUtil[_0xc794('0x52')](_0x115e55[_0xc794('0x61')]);_0x115e55['serverUrl']=intUtil[_0xc794('0x52')](_0x115e55[_0xc794('0x51')]);def[_0xc794('0x53')]=util[_0xc794('0x22')]('%s/service/v4_1/rest.php',_0x115e55[_0xc794('0x61')]);if(_0x224217&&_0x224217[_0xc794('0x68')]&&_0x224217[_0xc794('0x68')]!==_0xc794('0x69')){logger['info'](_0xc794('0x6a'),_0xc794('0x56'));_0x37e3ff[_0xc794('0x6b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x115e55[_0xc794('0x51')],_0x37e3ff['uniqueid'],md5(_0x37e3ff[_0xc794('0x58')]));}return getConnection(_0x115e55)[_0xc794('0x2c')](function(_0x18fc06){_0x16e708=_0x18fc06;return getUser(_0x115e55,_0x1659be[_0xc794('0x18')],_0x16e708);})[_0xc794('0x2c')](function(_0x41cb28){_0x3dcac6=_0x41cb28;logger[_0xc794('0xa')](_0xc794('0x59'),_0x3dcac6['id']);return getEndUser(_0x115e55,_0x37e3ff[_0xc794('0x6c')],_0x37e3ff['destcalleridnum'],_0x16e708);})[_0xc794('0x2c')](function(_0x5edb01){_0x54bec0=_0x5edb01;logger[_0xc794('0xa')](_0xc794('0x5c'),_0x54bec0['id']);return getTicket(_0x115e55,_0x3dcac6,_0x54bec0,_0x84caf7,_0x37e3ff,_0x84caf7[_0xc794('0x5d')],_0x16e708,_0xc794('0x6d'));})[_0xc794('0x2c')](function(_0x54ca84){_0x29f721=_0x54ca84;logger[_0xc794('0xa')](_0xc794('0x6e'));logger[_0xc794('0xa')](_0xc794('0x5e'),_0x29f721['id']);return setRelationship(_0x16e708,_0x3dcac6,_0x29f721,'users');})['then'](function(){return setRelationship(_0x16e708,_0x54bec0,_0x29f721,_0xc794('0x6f'));})[_0xc794('0x2c')](function(){return getServerInfo(_0x16e708);})[_0xc794('0x2c')](function(_0x4d50d3){var _0x3fc3f8=parseInt(_0x4d50d3[_0xc794('0x60')]['charAt'](0x0));var _0x1607a2=util[_0xc794('0x22')](_0xc794('0x70'),_0x115e55[_0xc794('0x61')],_0x29f721['id']);if(_0x3fc3f8>0x6){_0x1607a2=util[_0xc794('0x22')](_0xc794('0x62'),_0x115e55[_0xc794('0x61')],_0x29f721['id']);}logger[_0xc794('0xa')](_0xc794('0x6a'),_0xc794('0x63'));emit(util[_0xc794('0x22')](_0xc794('0x64'),_0x1659be['name']),_0xc794('0x65'),{'uri':_0x1607a2});})[_0xc794('0x71')](function(_0x3ed9f9){logger[_0xc794('0x66')](_0xc794('0x6a'),JSON[_0xc794('0x29')](_0x3ed9f9));});};exports['unmanaged']=function(_0x58443c,_0x233759,_0x4ae639,_0x51e68d,_0x272dbc,_0x3bfaa5){var _0x3bd3e9,_0x53593c,_0x3a14f2,_0x5189d2;_0x3bfaa5[_0xc794('0x61')]=intUtil[_0xc794('0x52')](_0x3bfaa5[_0xc794('0x61')]);_0x3bfaa5[_0xc794('0x51')]=intUtil['stripTrailingSlash'](_0x3bfaa5[_0xc794('0x51')]);def[_0xc794('0x53')]=util[_0xc794('0x22')]('%s/service/v4_1/rest.php',_0x3bfaa5['remoteUri']);if(_0x272dbc&&_0x272dbc[_0xc794('0x72')]){logger[_0xc794('0xa')]('['+_0x233759[_0xc794('0x73')][_0xc794('0x74')]()+']',_0xc794('0x56'));_0x233759[_0xc794('0x6b')]=util[_0xc794('0x22')](_0xc794('0x57'),_0x3bfaa5[_0xc794('0x51')],_0x233759[_0xc794('0x58')],md5(_0x233759[_0xc794('0x58')]));}else{_0x233759[_0xc794('0x6b')]='';}return getConnection(_0x3bfaa5)[_0xc794('0x2c')](function(_0x111c41){_0x5189d2=_0x111c41;if(!_[_0xc794('0x26')](_0x51e68d)){return getUser(_0x3bfaa5,_0x51e68d[_0xc794('0x18')],_0x5189d2);}else{return getUser(_0x3bfaa5,null,_0x5189d2);}})[_0xc794('0x2c')](function(_0x34bd36){_0x3bd3e9=_0x34bd36;logger[_0xc794('0xa')](_0xc794('0x59'),_0x3bd3e9['id']);return getEndUser(_0x3bfaa5,_0x233759[_0xc794('0x5a')],_0x233759[_0xc794('0x5b')],_0x5189d2);})['then'](function(_0x4d08e2){_0x53593c=_0x4d08e2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x53593c['id']);return getTicket(_0x3bfaa5,_0x3bd3e9,_0x53593c,_0x4ae639,_0x233759,_0x4ae639[_0xc794('0x5d')],_0x5189d2,_0xc794('0x75'));})[_0xc794('0x2c')](function(_0x12beff){_0x3a14f2=_0x12beff;logger[_0xc794('0xa')]('Ticket\x20created!');logger[_0xc794('0xa')]('The\x20Ticket\x20ID\x20is:',_0x3a14f2['id']);return setRelationship(_0x5189d2,_0x3bd3e9,_0x3a14f2,_0xc794('0x5f'));})[_0xc794('0x2c')](function(){return setRelationship(_0x5189d2,_0x53593c,_0x3a14f2,_0xc794('0x6f'));})[_0xc794('0x2c')](function(){return getServerInfo(_0x5189d2);})[_0xc794('0x71')](function(_0x6eaf8c){logger['error']('['+_0x233759[_0xc794('0x73')][_0xc794('0x74')]()+']',JSON[_0xc794('0x29')](_0x6eaf8c));});}; \ 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 6b29061..3fb64ff 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 _0xc6cd=['slice','substring','lastIndexOf','test','lodash','util','length','sortBy','string','push','content','type','variableName','Variable','name','toLowerCase','keyType','key','%s:\x20%s','keyContent','variable','format','join','stripTrailingSlash'];(function(_0x4e009f,_0xd40de0){var _0x1d5cae=function(_0x36d49f){while(--_0x36d49f){_0x4e009f['push'](_0x4e009f['shift']());}};_0x1d5cae(++_0xd40de0);}(_0xc6cd,0xc4));var _0xdc6c=function(_0x382c39,_0x2a5cae){_0x382c39=_0x382c39-0x0;var _0x1c2f34=_0xc6cd[_0x382c39];return _0x1c2f34;};'use strict';var _=require(_0xdc6c('0x0'));var util=require(_0xdc6c('0x1'));exports['getString']=function(_0x1b6744,_0x1d443f,_0x28d136){var _0x3628ae=[];if(_0x1b6744[_0xdc6c('0x2')]>0x0){var _0x42ccff=_[_0xdc6c('0x3')](_0x1b6744,['id']);for(var _0x9be8d=0x0;_0x9be8d<_0x42ccff[_0xdc6c('0x2')];_0x9be8d++){var _0x3815c1=_0x42ccff[_0x9be8d];if(_0x3815c1['type']===_0xdc6c('0x4')){_0x3628ae[_0xdc6c('0x5')](_0x3815c1[_0xdc6c('0x6')]);}else if(_0x3815c1[_0xdc6c('0x7')]==='variable'&&_0x3815c1[_0xdc6c('0x8')]){_0x1d443f[_0x3815c1[_0xdc6c('0x8')]]&&_0x3628ae['push'](_0x1d443f[_0x3815c1[_0xdc6c('0x8')]]['toString']());}else if(_0x3815c1[_0xdc6c('0x7')]==='customVariable'&&_0x3815c1[_0xdc6c('0x9')]&&_0x3815c1[_0xdc6c('0x9')][_0xdc6c('0xa')]){_0x1d443f[_0x3815c1['Variable'][_0xdc6c('0xa')][_0xdc6c('0xb')]()]&&_0x3628ae['push'](_0x1d443f[_0x3815c1['Variable']['name'][_0xdc6c('0xb')]()]['toString']());}else if(_0x3815c1['type']==='keyValue'){if(_0x3815c1[_0xdc6c('0xc')]===_0xdc6c('0x4')&&_0x3815c1[_0xdc6c('0xd')]){_0x3628ae[_0xdc6c('0x5')](util['format'](_0xdc6c('0xe'),_0x3815c1[_0xdc6c('0xd')],_0x3815c1[_0xdc6c('0xf')]));}else if(_0x3815c1[_0xdc6c('0xc')]===_0xdc6c('0x10')&&_0x3815c1['variableName']&&_0x3815c1[_0xdc6c('0xd')]){_0x1d443f[_0x3815c1[_0xdc6c('0x8')]]&&_0x3628ae[_0xdc6c('0x5')](util[_0xdc6c('0x11')](_0xdc6c('0xe'),_0x3815c1['key'],_0x1d443f[_0x3815c1[_0xdc6c('0x8')]]));}else if(_0x3815c1[_0xdc6c('0xc')]==='customVariable'&&_0x3815c1[_0xdc6c('0x9')]&&_0x3815c1[_0xdc6c('0x9')][_0xdc6c('0xa')]&&_0x3815c1['key']){_0x1d443f[_0x3815c1[_0xdc6c('0x9')]['name'][_0xdc6c('0xb')]()]&&_0x3628ae['push'](util['format']('%s:\x20%s',_0x3815c1[_0xdc6c('0xd')],_0x1d443f[_0x3815c1[_0xdc6c('0x9')][_0xdc6c('0xa')][_0xdc6c('0xb')]()]));}}}}return _0x3628ae[_0xdc6c('0x12')](_0x28d136);};exports[_0xdc6c('0x13')]=function(_0x50d27f){var _0x2e0588=_0x50d27f[_0xdc6c('0x14')](-0x1);if(_0x2e0588==='/'){_0x50d27f=_0x50d27f[_0xdc6c('0x15')](0x0,_0x50d27f[_0xdc6c('0x16')](_0x2e0588));}return _0x50d27f;};exports['validateEmail']=function(_0x21f337){if(!_['isNil'](_0x21f337)&&_0x21f337!==''){var _0x434efc=/^(([^<>()\[\]\\.,;:\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 _0x434efc[_0xdc6c('0x17')](String(_0x21f337)[_0xdc6c('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x19b6=['toLowerCase','name','keyValue','keyType','string','format','%s:\x20%s','keyContent','key','customVariable','join','slice','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','push','content','variable','variableName','toString','Variable'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x19b6,0x64));var _0x619b=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x19b6[_0x152aa1];return _0x1bc01a;};'use strict';var _=require(_0x619b('0x0'));var util=require(_0x619b('0x1'));exports[_0x619b('0x2')]=function(_0x2876e2,_0x27dc6c,_0x2c3068){var _0x33c80a=[];if(_0x2876e2[_0x619b('0x3')]>0x0){var _0x2b18d2=_[_0x619b('0x4')](_0x2876e2,['id']);for(var _0x55c3ef=0x0;_0x55c3ef<_0x2b18d2[_0x619b('0x3')];_0x55c3ef++){var _0x4527ae=_0x2b18d2[_0x55c3ef];if(_0x4527ae[_0x619b('0x5')]==='string'){_0x33c80a[_0x619b('0x6')](_0x4527ae[_0x619b('0x7')]);}else if(_0x4527ae[_0x619b('0x5')]===_0x619b('0x8')&&_0x4527ae[_0x619b('0x9')]){_0x27dc6c[_0x4527ae['variableName']]&&_0x33c80a[_0x619b('0x6')](_0x27dc6c[_0x4527ae[_0x619b('0x9')]][_0x619b('0xa')]());}else if(_0x4527ae['type']==='customVariable'&&_0x4527ae[_0x619b('0xb')]&&_0x4527ae[_0x619b('0xb')]['name']){_0x27dc6c[_0x4527ae['Variable']['name'][_0x619b('0xc')]()]&&_0x33c80a[_0x619b('0x6')](_0x27dc6c[_0x4527ae[_0x619b('0xb')][_0x619b('0xd')][_0x619b('0xc')]()][_0x619b('0xa')]());}else if(_0x4527ae[_0x619b('0x5')]===_0x619b('0xe')){if(_0x4527ae[_0x619b('0xf')]===_0x619b('0x10')&&_0x4527ae['key']){_0x33c80a['push'](util[_0x619b('0x11')](_0x619b('0x12'),_0x4527ae['key'],_0x4527ae[_0x619b('0x13')]));}else if(_0x4527ae['keyType']==='variable'&&_0x4527ae[_0x619b('0x9')]&&_0x4527ae[_0x619b('0x14')]){_0x27dc6c[_0x4527ae[_0x619b('0x9')]]&&_0x33c80a['push'](util[_0x619b('0x11')](_0x619b('0x12'),_0x4527ae['key'],_0x27dc6c[_0x4527ae['variableName']]));}else if(_0x4527ae[_0x619b('0xf')]===_0x619b('0x15')&&_0x4527ae[_0x619b('0xb')]&&_0x4527ae[_0x619b('0xb')][_0x619b('0xd')]&&_0x4527ae['key']){_0x27dc6c[_0x4527ae[_0x619b('0xb')][_0x619b('0xd')]['toLowerCase']()]&&_0x33c80a[_0x619b('0x6')](util[_0x619b('0x11')](_0x619b('0x12'),_0x4527ae[_0x619b('0x14')],_0x27dc6c[_0x4527ae[_0x619b('0xb')]['name'][_0x619b('0xc')]()]));}}}}return _0x33c80a[_0x619b('0x16')](_0x2c3068);};exports['stripTrailingSlash']=function(_0x395589){var _0x4ea959=_0x395589[_0x619b('0x17')](-0x1);if(_0x4ea959==='/'){_0x395589=_0x395589[_0x619b('0x18')](0x0,_0x395589[_0x619b('0x19')](_0x4ea959));}return _0x395589;};exports[_0x619b('0x1a')]=function(_0x12157d){if(!_[_0x619b('0x1b')](_0x12157d)&&_0x12157d!==''){var _0x3fc9b0=/^(([^<>()\[\]\\.,;:\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 _0x3fc9b0['test'](String(_0x12157d)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index abab6ba..4e175b2 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +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(_0x448e2e,_0x3e7cec){var _0x5ceb06=function(_0x33dc25){while(--_0x33dc25){_0x448e2e['push'](_0x448e2e['shift']());}};_0x5ceb06(++_0x3e7cec);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 3c73bc1..c08aa54 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 _0x5830=['user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','username','password','%s/token:%s','token','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','length','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Zendesk\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.'];(function(_0x31e18a,_0x2cd869){var _0x45e8d4=function(_0x23efd7){while(--_0x23efd7){_0x31e18a['push'](_0x31e18a['shift']());}};_0x45e8d4(++_0x2cd869);}(_0x5830,0xc1));var _0x0583=function(_0x22ad68,_0x123602){_0x22ad68=_0x22ad68-0x0;var _0x2d0d86=_0x5830[_0x22ad68];return _0x2d0d86;};'use strict';var _=require(_0x0583('0x0'));var rp=require(_0x0583('0x1'));var md5=require(_0x0583('0x2'));var util=require(_0x0583('0x3'));var Redis=require(_0x0583('0x4'));var intUtil=require(_0x0583('0x5'));var config=require(_0x0583('0x6'));var logger=require(_0x0583('0x7'))('zendesk');config[_0x0583('0x8')]=_[_0x0583('0x9')](config[_0x0583('0x8')],{'host':_0x0583('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0583('0x8')]));function emit(_0x3e9756,_0x22e087,_0x51c002){io['to'](_0x3e9756)['emit'](_0x22e087,_0x51c002);}var headers={'Content-Type':'application/json','Accept':_0x0583('0xb')};function getTicket(_0x3037cd,_0x5e01db,_0x139675,_0x3eb349,_0x4b607c){logger[_0x0583('0xc')](_0x0583('0xd'));return request({'uri':util[_0x0583('0xe')]('%s/tickets.json',_0x3037cd[_0x0583('0xf')]),'method':'POST','body':{'ticket':_[_0x0583('0x10')]({'requester_id':_0x139675['id'],'submitter_id':_0x5e01db?_0x5e01db['id']:undefined,'assignee_id':_0x5e01db?_0x5e01db['id']:undefined,'tags':getTags(_0x3eb349[_0x0583('0x11')],_0x0583('0x12')),'subject':intUtil[_0x0583('0x13')](_0x3eb349[_0x0583('0x14')],_0x4b607c,'\x20'),'description':intUtil[_0x0583('0x13')](_0x3eb349[_0x0583('0x15')],_0x4b607c,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0583('0x13')](_0x3eb349[_0x0583('0x15')],_0x4b607c,'\x0a')}},getCustomFields(_0x3eb349[_0x0583('0x16')],_0x4b607c))}})[_0x0583('0x17')](function(_0x307880){logger[_0x0583('0xc')](_0x0583('0x18'));return _0x307880[_0x0583('0x19')];});}function getUser(_0x1f1759,_0x256fdb){if(intUtil[_0x0583('0x1a')](_0x256fdb)){logger[_0x0583('0xc')]('Getting\x20agent\x20with\x20email',_0x256fdb);return request({'uri':util[_0x0583('0xe')](_0x0583('0x1b'),_0x1f1759[_0x0583('0xf')]),'qs':{'query':util[_0x0583('0xe')]('type:user\x20role:agent\x20email:%s',_0x256fdb)}})[_0x0583('0x17')](function(_0x8ee49){if(_0x8ee49['count']){logger['info'](_0x0583('0x1c'));return _[_0x0583('0x1d')](_0x8ee49[_0x0583('0x1e')],{'email':_0x256fdb,'role':_0x0583('0x1f')});}else{logger['info'](_0x0583('0x20'));return request({'uri':util[_0x0583('0xe')](_0x0583('0x21'),_0x1f1759[_0x0583('0xf')])})[_0x0583('0x17')](function(_0x12ebad){logger[_0x0583('0xc')](_0x0583('0x22'));return _0x12ebad[_0x0583('0x23')];});}});}else{logger[_0x0583('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0583('0xe')](_0x0583('0x21'),_0x1f1759[_0x0583('0xf')])})['then'](function(_0x59eb06){logger[_0x0583('0xc')]('Admin\x20account\x20selected.');return _0x59eb06[_0x0583('0x23')];});}}function getEndUser(_0x239774,_0x51523b,_0x1cf0e9){logger[_0x0583('0xc')](_0x0583('0x24'),_0x1cf0e9);return request({'uri':util[_0x0583('0xe')](_0x0583('0x1b'),_0x239774[_0x0583('0xf')]),'qs':{'query':util[_0x0583('0xe')](_0x0583('0x25'),_0x1cf0e9)}})[_0x0583('0x17')](function(_0x17a69c){var _0x326664;if(_0x17a69c[_0x0583('0x1e')]['length']){_0x17a69c['results']=_[_0x0583('0x26')](_0x17a69c[_0x0583('0x1e')],{'suspended':![],'role':_0x0583('0x27')});if(_0x17a69c[_0x0583('0x1e')]['length']){_0x326664=_[_0x0583('0x28')](_0x17a69c['results']);}}if(_0x326664){logger[_0x0583('0xc')](_0x0583('0x29'));return _0x326664;}else{logger['info'](_0x0583('0x2a'));return request({'uri':util[_0x0583('0xe')](_0x0583('0x2b'),_0x239774[_0x0583('0xf')]),'method':_0x0583('0x2c'),'body':{'user':{'role':'end-user','name':util[_0x0583('0xe')](_0x0583('0x2d'),_0x51523b||_0x1cf0e9),'phone':_0x1cf0e9}}})[_0x0583('0x17')](function(_0x140d0f){logger[_0x0583('0xc')](_0x0583('0x2e'));return _0x140d0f[_0x0583('0x23')];});}});}function getAuth(_0x4e9c8f){var _0x5e61b2;if(_0x4e9c8f[_0x0583('0x2f')]==='password'){_0x5e61b2=util[_0x0583('0xe')]('%s:%s',_0x4e9c8f[_0x0583('0x30')],_0x4e9c8f[_0x0583('0x31')]);}else if(_0x4e9c8f[_0x0583('0x2f')]==='token'){_0x5e61b2=util[_0x0583('0xe')](_0x0583('0x32'),_0x4e9c8f[_0x0583('0x30')],_0x4e9c8f[_0x0583('0x33')]);}return util[_0x0583('0xe')](_0x0583('0x34'),new Buffer(_0x5e61b2)[_0x0583('0x35')](_0x0583('0x36')));}function request(_0x395717){logger['debug'](_0x0583('0x37'),JSON[_0x0583('0x38')](_0x395717));return rp(_[_0x0583('0x9')](_0x395717,{'method':_0x0583('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x3b5e50,_0x4d4263){var _0x31d15c=[];if(_0x3b5e50&&_0x3b5e50[_0x0583('0x3a')]>0x0){_0x31d15c=_[_0x0583('0x3b')](_0x3b5e50,_0x4d4263);}return _0x31d15c;}function getCustomFields(_0x2ea99e,_0x2e566c){var _0x458770=[];var _0x1804cb={'custom_fields':[]};if(_0x2ea99e[_0x0583('0x3a')]>0x0){_[_0x0583('0x3c')](_0x2ea99e,function(_0x105b4f){if(_[_0x0583('0x3d')]([_0x0583('0x3e'),_0x0583('0x3f')],_0x105b4f['type'])&&_0x105b4f[_0x0583('0x40')]&&!_0x105b4f[_0x0583('0x41')]){_0x1804cb[_0x105b4f[_0x0583('0x40')][_0x0583('0x42')]()]=_0x105b4f[_0x0583('0x43')][_0x0583('0x35')]();}else if(_[_0x0583('0x3d')]([_0x0583('0x3e'),_0x0583('0x3f')],_0x105b4f[_0x0583('0x44')])&&_0x105b4f[_0x0583('0x45')]&&_0x105b4f[_0x0583('0x41')]){_0x1804cb[_0x0583('0x46')]['push']({'id':_0x105b4f[_0x0583('0x45')],'value':_0x105b4f[_0x0583('0x43')][_0x0583('0x35')]()});}else if(_0x105b4f[_0x0583('0x44')]===_0x0583('0x47')&&_0x105b4f[_0x0583('0x48')]&&_0x105b4f[_0x0583('0x45')]&&_0x105b4f[_0x0583('0x41')]){_0x2e566c[_0x105b4f['variableName']]&&_0x1804cb[_0x0583('0x46')][_0x0583('0x49')]({'id':_0x105b4f['idField'],'value':_0x2e566c[_0x105b4f[_0x0583('0x48')]][_0x0583('0x35')]()});}else if(_0x105b4f[_0x0583('0x44')]===_0x0583('0x4a')&&_0x105b4f[_0x0583('0x4b')]&&_0x105b4f[_0x0583('0x4b')]['name']&&_0x105b4f[_0x0583('0x45')]&&_0x105b4f[_0x0583('0x41')]){_0x2e566c[_0x105b4f[_0x0583('0x4b')][_0x0583('0x12')][_0x0583('0x42')]()]&&_0x1804cb[_0x0583('0x46')][_0x0583('0x49')]({'id':_0x105b4f[_0x0583('0x45')],'value':_0x2e566c[_0x105b4f[_0x0583('0x4b')][_0x0583('0x12')][_0x0583('0x42')]()]['toString']()});}});}return _0x1804cb;}exports[_0x0583('0x4c')]=function(_0x4c399a,_0x1acea2,_0x55ba47,_0x197315,_0x30d13a,_0x2857b5){var _0x1f5d2a,_0x8e6e96;_0x2857b5['remoteUri']=intUtil[_0x0583('0x4d')](_0x2857b5['remoteUri']);_0x2857b5['serverUrl']=intUtil[_0x0583('0x4d')](_0x2857b5[_0x0583('0x4e')]);if(_0x30d13a&&_0x30d13a[_0x0583('0x4f')]){logger[_0x0583('0xc')](_0x0583('0x50'),_0x0583('0x51'));_0x1acea2[_0x0583('0x52')]=util[_0x0583('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2857b5[_0x0583('0x4e')],_0x1acea2[_0x0583('0x53')],md5(_0x1acea2[_0x0583('0x53')]));}else{_0x1acea2[_0x0583('0x52')]='';}headers[_0x0583('0x54')]=getAuth(_0x2857b5);return getUser(_0x2857b5,_0x197315[_0x0583('0x55')])[_0x0583('0x17')](function(_0xe83b0a){_0x1f5d2a=_0xe83b0a;logger[_0x0583('0xc')](_0x0583('0x56'),_0x1f5d2a['id']);return getEndUser(_0x2857b5,_0x1acea2[_0x0583('0x57')],_0x1acea2[_0x0583('0x58')]);})[_0x0583('0x17')](function(_0x4e5580){_0x8e6e96=_0x4e5580;logger[_0x0583('0xc')](_0x0583('0x59'),_0x8e6e96['id']);return getTicket(_0x2857b5,_0x1f5d2a,_0x8e6e96,_0x55ba47,_0x1acea2);})[_0x0583('0x17')](function(_0x369b4e){if(_0x369b4e){logger[_0x0583('0xc')](_0x0583('0x5a'),_0x369b4e['id']);switch(_0x2857b5['type']){case _0x0583('0x5b'):logger['info'](_0x0583('0x50'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x0583('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2857b5[_0x0583('0xf')],_0x1f5d2a['id'],_0x369b4e['id']),'method':_0x0583('0x2c')});case _0x0583('0x5c'):logger[_0x0583('0xc')](_0x0583('0x50'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0583('0xe')]('user:%s',_0x197315[_0x0583('0x12')]),_0x0583('0x5d'),{'uri':util[_0x0583('0xe')](_0x0583('0x5e'),_0x2857b5['remoteUri'][_0x0583('0x5f')](_0x0583('0x60'),''),_0x369b4e['id'])});break;default:logger[_0x0583('0x61')](_0x0583('0x50'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x0583('0x62')](function(_0x4b9e81){logger[_0x0583('0x61')](_0x0583('0x63'),util[_0x0583('0x64')](_0x4b9e81,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x2fba31,_0x3b3ed8,_0x212582,_0x41fb2e,_0x533c77,_0x298462,_0x2b1964){var _0x596c96,_0x322817;_0x298462[_0x0583('0xf')]=intUtil[_0x0583('0x4d')](_0x298462['remoteUri']);_0x298462[_0x0583('0x4e')]=intUtil[_0x0583('0x4d')](_0x298462['serverUrl']);if(_0x2b1964&&_0x2b1964[_0x0583('0x65')]&&_0x2b1964[_0x0583('0x65')]!==_0x0583('0x66')){logger['info'](_0x0583('0x67'),_0x0583('0x51'));_0x3b3ed8[_0x0583('0x52')]=util[_0x0583('0xe')](_0x0583('0x68'),_0x298462[_0x0583('0x4e')],_0x3b3ed8[_0x0583('0x53')],md5(_0x3b3ed8[_0x0583('0x53')]));}headers['Authorization']=getAuth(_0x298462);return getUser(_0x298462,_0x41fb2e['email'])[_0x0583('0x17')](function(_0x37e146){_0x596c96=_0x37e146;logger[_0x0583('0xc')](_0x0583('0x56'),_0x596c96['id']);return getEndUser(_0x298462,_0x3b3ed8[_0x0583('0x69')],_0x3b3ed8[_0x0583('0x6a')]);})[_0x0583('0x17')](function(_0x5d6913){_0x322817=_0x5d6913;logger[_0x0583('0xc')](_0x0583('0x59'),_0x322817['id']);return getTicket(_0x298462,_0x596c96,_0x322817,_0x212582,_0x3b3ed8);})[_0x0583('0x17')](function(_0x507397){if(_0x507397){logger[_0x0583('0xc')](_0x0583('0x5a'),_0x507397['id']);switch(_0x298462[_0x0583('0x44')]){case _0x0583('0x5b'):logger['info']('[OUTBOUND]',_0x0583('0x6b'));return request({'uri':util[_0x0583('0xe')](_0x0583('0x6c'),_0x298462['remoteUri'],_0x596c96['id'],_0x507397['id']),'method':'POST'});case'newTab':logger[_0x0583('0xc')](_0x0583('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0583('0xe')]('user:%s',_0x41fb2e['name']),'trigger:browser:url',{'uri':util[_0x0583('0xe')](_0x0583('0x5e'),_0x298462[_0x0583('0xf')][_0x0583('0x5f')](_0x0583('0x60'),''),_0x507397['id'])});break;default:logger['error'](_0x0583('0x67'),_0x0583('0x6d'));}}})[_0x0583('0x62')](function(_0x5568e8){logger[_0x0583('0x61')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x0583('0x64')](_0x5568e8,{'showHidden':!![],'depth':null}));});};exports[_0x0583('0x6e')]=function(_0x282de7,_0x47d195,_0x2612f3,_0x42b6ad,_0x342f68,_0x24f703){var _0x13f616,_0x21da9e;_0x24f703[_0x0583('0xf')]=intUtil[_0x0583('0x4d')](_0x24f703[_0x0583('0xf')]);_0x24f703[_0x0583('0x4e')]=intUtil[_0x0583('0x4d')](_0x24f703['serverUrl']);if(_0x342f68&&_0x342f68[_0x0583('0x4f')]){logger[_0x0583('0xc')]('['+_0x47d195[_0x0583('0x6f')][_0x0583('0x70')]()+']','Recording\x20is\x20enabled!');_0x47d195[_0x0583('0x52')]=util['format'](_0x0583('0x68'),_0x24f703['serverUrl'],_0x47d195['uniqueid'],md5(_0x47d195[_0x0583('0x53')]));}else{_0x47d195['recordingURL']='';}headers['Authorization']=getAuth(_0x24f703);return getUser(_0x24f703)[_0x0583('0x17')](function(_0x459bc8){_0x13f616=_0x459bc8;logger[_0x0583('0xc')](_0x0583('0x56'),_0x13f616['id']);return getEndUser(_0x24f703,_0x47d195[_0x0583('0x57')],_0x47d195[_0x0583('0x58')]);})['then'](function(_0x56ec88){_0x21da9e=_0x56ec88;logger['info'](_0x0583('0x59'),_0x21da9e['id']);return getTicket(_0x24f703,_0x13f616,_0x21da9e,_0x2612f3,_0x47d195);})['then'](function(_0x5c0b2c){if(_0x5c0b2c){logger[_0x0583('0xc')](_0x0583('0x5a'),_0x5c0b2c['id']);}})[_0x0583('0x62')](function(_0x482a5c){logger[_0x0583('0x61')]('['+_0x47d195[_0x0583('0x6f')]['toUpperCase']()+']'+_0x0583('0x71'),util[_0x0583('0x64')](_0x482a5c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3582=['Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','%s:%s','username','password','token','Basic\x20%s','base64','[HTTP]','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','content','toString','type','customField','custom_fields','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','replace','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','ioredis','./util','../../../../config/environment','zendesk','defaults','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first'];(function(_0x145bd7,_0x57c16a){var _0x437e67=function(_0x3186b9){while(--_0x3186b9){_0x145bd7['push'](_0x145bd7['shift']());}};_0x437e67(++_0x57c16a);}(_0x3582,0xba));var _0x2358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3582[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0x2358('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x2358('0x1'));var intUtil=require(_0x2358('0x2'));var config=require(_0x2358('0x3'));var logger=require('../../../../config/logger')(_0x2358('0x4'));config['redis']=_[_0x2358('0x5')](config[_0x2358('0x6')],{'host':_0x2358('0x7'),'port':0x18eb});var io=require(_0x2358('0x8'))(new Redis(config[_0x2358('0x6')]));function emit(_0x3cf0b0,_0x141c8f,_0x228678){io['to'](_0x3cf0b0)[_0x2358('0x9')](_0x141c8f,_0x228678);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x2dce71,_0x391914,_0x13ccf3,_0x3f9f47,_0x213f4a){logger[_0x2358('0xa')](_0x2358('0xb'));return request({'uri':util['format'](_0x2358('0xc'),_0x2dce71[_0x2358('0xd')]),'method':_0x2358('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x13ccf3['id'],'submitter_id':_0x391914?_0x391914['id']:undefined,'assignee_id':_0x391914?_0x391914['id']:undefined,'tags':getTags(_0x3f9f47[_0x2358('0xf')],_0x2358('0x10')),'subject':intUtil[_0x2358('0x11')](_0x3f9f47[_0x2358('0x12')],_0x213f4a,'\x20'),'description':intUtil[_0x2358('0x11')](_0x3f9f47[_0x2358('0x13')],_0x213f4a,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2358('0x11')](_0x3f9f47[_0x2358('0x13')],_0x213f4a,'\x0a')}},getCustomFields(_0x3f9f47[_0x2358('0x14')],_0x213f4a))}})[_0x2358('0x15')](function(_0x4da5df){logger[_0x2358('0xa')](_0x2358('0x16'));return _0x4da5df[_0x2358('0x17')];});}function getUser(_0x299743,_0x28addf){if(intUtil[_0x2358('0x18')](_0x28addf)){logger[_0x2358('0xa')](_0x2358('0x19'),_0x28addf);return request({'uri':util['format']('%s/search.json',_0x299743[_0x2358('0xd')]),'qs':{'query':util[_0x2358('0x1a')](_0x2358('0x1b'),_0x28addf)}})[_0x2358('0x15')](function(_0x4761b1){if(_0x4761b1[_0x2358('0x1c')]){logger['info']('Agent\x20found!');return _[_0x2358('0x1d')](_0x4761b1[_0x2358('0x1e')],{'email':_0x28addf,'role':_0x2358('0x1f')});}else{logger['info'](_0x2358('0x20'));return request({'uri':util[_0x2358('0x1a')](_0x2358('0x21'),_0x299743[_0x2358('0xd')])})['then'](function(_0xa48510){logger['info']('Admin\x20account\x20selected.');return _0xa48510[_0x2358('0x22')];});}});}else{logger[_0x2358('0xa')](_0x2358('0x20'));return request({'uri':util[_0x2358('0x1a')](_0x2358('0x21'),_0x299743[_0x2358('0xd')])})[_0x2358('0x15')](function(_0x177e6f){logger[_0x2358('0xa')](_0x2358('0x23'));return _0x177e6f[_0x2358('0x22')];});}}function getEndUser(_0x87aab,_0x15e7f9,_0x3805eb){logger[_0x2358('0xa')](_0x2358('0x24'),_0x3805eb);return request({'uri':util['format']('%s/search.json',_0x87aab['remoteUri']),'qs':{'query':util['format'](_0x2358('0x25'),_0x3805eb)}})[_0x2358('0x15')](function(_0x340c35){var _0x2eeb63;if(_0x340c35[_0x2358('0x1e')][_0x2358('0x26')]){_0x340c35[_0x2358('0x1e')]=_[_0x2358('0x27')](_0x340c35[_0x2358('0x1e')],{'suspended':![],'role':_0x2358('0x28')});if(_0x340c35['results'][_0x2358('0x26')]){_0x2eeb63=_[_0x2358('0x29')](_0x340c35[_0x2358('0x1e')]);}}if(_0x2eeb63){logger[_0x2358('0xa')](_0x2358('0x2a'));return _0x2eeb63;}else{logger['info'](_0x2358('0x2b'));return request({'uri':util[_0x2358('0x1a')]('%s/users.json',_0x87aab[_0x2358('0xd')]),'method':_0x2358('0xe'),'body':{'user':{'role':_0x2358('0x28'),'name':util[_0x2358('0x1a')](_0x2358('0x2c'),_0x15e7f9||_0x3805eb),'phone':_0x3805eb}}})[_0x2358('0x15')](function(_0x580a30){logger[_0x2358('0xa')]('Enduser\x20created.');return _0x580a30[_0x2358('0x22')];});}});}function getAuth(_0x97f831){var _0x478e37;if(_0x97f831[_0x2358('0x2d')]==='password'){_0x478e37=util[_0x2358('0x1a')](_0x2358('0x2e'),_0x97f831[_0x2358('0x2f')],_0x97f831[_0x2358('0x30')]);}else if(_0x97f831['authType']===_0x2358('0x31')){_0x478e37=util[_0x2358('0x1a')]('%s/token:%s',_0x97f831[_0x2358('0x2f')],_0x97f831[_0x2358('0x31')]);}return util[_0x2358('0x1a')](_0x2358('0x32'),new Buffer(_0x478e37)['toString'](_0x2358('0x33')));}function request(_0x63138f){logger['debug'](_0x2358('0x34'),JSON['stringify'](_0x63138f));return rp(_['defaults'](_0x63138f,{'method':_0x2358('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x4ddfe4,_0x3a0fb5){var _0x2736c5=[];if(_0x4ddfe4&&_0x4ddfe4[_0x2358('0x26')]>0x0){_0x2736c5=_[_0x2358('0x36')](_0x4ddfe4,_0x3a0fb5);}return _0x2736c5;}function getCustomFields(_0x29cad3,_0x360c7a){var _0x30eb21=[];var _0x44b5fc={'custom_fields':[]};if(_0x29cad3[_0x2358('0x26')]>0x0){_[_0x2358('0x37')](_0x29cad3,function(_0x4e7328){if(_[_0x2358('0x38')]([_0x2358('0x39'),_0x2358('0x3a')],_0x4e7328['type'])&&_0x4e7328['nameField']&&!_0x4e7328['customField']){_0x44b5fc[_0x4e7328[_0x2358('0x3b')][_0x2358('0x3c')]()]=_0x4e7328[_0x2358('0x3d')][_0x2358('0x3e')]();}else if(_[_0x2358('0x38')]([_0x2358('0x39'),_0x2358('0x3a')],_0x4e7328[_0x2358('0x3f')])&&_0x4e7328['idField']&&_0x4e7328[_0x2358('0x40')]){_0x44b5fc[_0x2358('0x41')][_0x2358('0x42')]({'id':_0x4e7328[_0x2358('0x43')],'value':_0x4e7328[_0x2358('0x3d')]['toString']()});}else if(_0x4e7328['type']===_0x2358('0x44')&&_0x4e7328[_0x2358('0x45')]&&_0x4e7328[_0x2358('0x43')]&&_0x4e7328[_0x2358('0x40')]){_0x360c7a[_0x4e7328[_0x2358('0x45')]]&&_0x44b5fc[_0x2358('0x41')][_0x2358('0x42')]({'id':_0x4e7328[_0x2358('0x43')],'value':_0x360c7a[_0x4e7328['variableName']][_0x2358('0x3e')]()});}else if(_0x4e7328['type']===_0x2358('0x46')&&_0x4e7328[_0x2358('0x47')]&&_0x4e7328[_0x2358('0x47')][_0x2358('0x10')]&&_0x4e7328[_0x2358('0x43')]&&_0x4e7328[_0x2358('0x40')]){_0x360c7a[_0x4e7328[_0x2358('0x47')][_0x2358('0x10')][_0x2358('0x3c')]()]&&_0x44b5fc[_0x2358('0x41')][_0x2358('0x42')]({'id':_0x4e7328[_0x2358('0x43')],'value':_0x360c7a[_0x4e7328['Variable'][_0x2358('0x10')][_0x2358('0x3c')]()]['toString']()});}});}return _0x44b5fc;}exports[_0x2358('0x48')]=function(_0x428d73,_0x53d434,_0x2dcd82,_0x5d7702,_0x399d1a,_0x5b8f08){var _0x45b5d6,_0x556c2d;_0x5b8f08[_0x2358('0xd')]=intUtil[_0x2358('0x49')](_0x5b8f08[_0x2358('0xd')]);_0x5b8f08[_0x2358('0x4a')]=intUtil[_0x2358('0x49')](_0x5b8f08[_0x2358('0x4a')]);if(_0x399d1a&&_0x399d1a[_0x2358('0x4b')]){logger[_0x2358('0xa')](_0x2358('0x4c'),_0x2358('0x4d'));_0x53d434[_0x2358('0x4e')]=util[_0x2358('0x1a')](_0x2358('0x4f'),_0x5b8f08[_0x2358('0x4a')],_0x53d434[_0x2358('0x50')],md5(_0x53d434[_0x2358('0x50')]));}else{_0x53d434['recordingURL']='';}headers[_0x2358('0x51')]=getAuth(_0x5b8f08);return getUser(_0x5b8f08,_0x5d7702[_0x2358('0x52')])['then'](function(_0x417041){_0x45b5d6=_0x417041;logger['info'](_0x2358('0x53'),_0x45b5d6['id']);return getEndUser(_0x5b8f08,_0x53d434[_0x2358('0x54')],_0x53d434[_0x2358('0x55')]);})[_0x2358('0x15')](function(_0x10a55a){_0x556c2d=_0x10a55a;logger[_0x2358('0xa')]('The\x20Enduser\x20ID\x20is:',_0x556c2d['id']);return getTicket(_0x5b8f08,_0x45b5d6,_0x556c2d,_0x2dcd82,_0x53d434);})[_0x2358('0x15')](function(_0x45c85f){if(_0x45c85f){logger[_0x2358('0xa')](_0x2358('0x56'),_0x45c85f['id']);switch(_0x5b8f08[_0x2358('0x3f')]){case _0x2358('0x57'):logger[_0x2358('0xa')](_0x2358('0x4c'),_0x2358('0x58'));return request({'uri':util[_0x2358('0x1a')](_0x2358('0x59'),_0x5b8f08[_0x2358('0xd')],_0x45b5d6['id'],_0x45c85f['id']),'method':_0x2358('0xe')});case _0x2358('0x5a'):logger[_0x2358('0xa')]('[QUEUE]',_0x2358('0x5b'));emit(util['format']('user:%s',_0x5d7702[_0x2358('0x10')]),'trigger:browser:url',{'uri':util[_0x2358('0x1a')](_0x2358('0x5c'),_0x5b8f08[_0x2358('0xd')]['replace'](_0x2358('0x5d'),''),_0x45c85f['id'])});break;default:logger[_0x2358('0x5e')]('[QUEUE]',_0x2358('0x5f'));}}})['catch'](function(_0xcf1705){logger['error'](_0x2358('0x60'),util[_0x2358('0x61')](_0xcf1705,{'showHidden':!![],'depth':null}));});};exports[_0x2358('0x62')]=function(_0x43db22,_0x24eb38,_0x322ac5,_0x288754,_0x3d2c08,_0x535a98,_0x5ead21){var _0x4de33d,_0x206ce9;_0x535a98['remoteUri']=intUtil[_0x2358('0x49')](_0x535a98['remoteUri']);_0x535a98['serverUrl']=intUtil[_0x2358('0x49')](_0x535a98['serverUrl']);if(_0x5ead21&&_0x5ead21[_0x2358('0x63')]&&_0x5ead21[_0x2358('0x63')]!==_0x2358('0x64')){logger[_0x2358('0xa')](_0x2358('0x65'),_0x2358('0x4d'));_0x24eb38['recordingURL']=util[_0x2358('0x1a')](_0x2358('0x4f'),_0x535a98[_0x2358('0x4a')],_0x24eb38[_0x2358('0x50')],md5(_0x24eb38[_0x2358('0x50')]));}headers[_0x2358('0x51')]=getAuth(_0x535a98);return getUser(_0x535a98,_0x288754[_0x2358('0x52')])[_0x2358('0x15')](function(_0x4d2002){_0x4de33d=_0x4d2002;logger['info'](_0x2358('0x53'),_0x4de33d['id']);return getEndUser(_0x535a98,_0x24eb38[_0x2358('0x66')],_0x24eb38[_0x2358('0x67')]);})[_0x2358('0x15')](function(_0x170893){_0x206ce9=_0x170893;logger['info'](_0x2358('0x68'),_0x206ce9['id']);return getTicket(_0x535a98,_0x4de33d,_0x206ce9,_0x322ac5,_0x24eb38);})[_0x2358('0x15')](function(_0x258d27){if(_0x258d27){logger[_0x2358('0xa')]('The\x20Ticket\x20ID\x20is:',_0x258d27['id']);switch(_0x535a98[_0x2358('0x3f')]){case _0x2358('0x57'):logger['info']('[OUTBOUND]',_0x2358('0x58'));return request({'uri':util[_0x2358('0x1a')](_0x2358('0x59'),_0x535a98[_0x2358('0xd')],_0x4de33d['id'],_0x258d27['id']),'method':'POST'});case _0x2358('0x5a'):logger[_0x2358('0xa')]('[OUTBOUND]',_0x2358('0x5b'));emit(util[_0x2358('0x1a')](_0x2358('0x69'),_0x288754[_0x2358('0x10')]),_0x2358('0x6a'),{'uri':util[_0x2358('0x1a')](_0x2358('0x5c'),_0x535a98[_0x2358('0xd')][_0x2358('0x6b')]('/api/v2',''),_0x258d27['id'])});break;default:logger['error'](_0x2358('0x65'),_0x2358('0x5f'));}}})[_0x2358('0x6c')](function(_0x54f25e){logger[_0x2358('0x5e')](_0x2358('0x6d'),util[_0x2358('0x61')](_0x54f25e,{'showHidden':!![],'depth':null}));});};exports[_0x2358('0x6e')]=function(_0x103930,_0x4e0b52,_0x4dd5c9,_0x5ea16d,_0x534a60,_0x93bc1c){var _0x12a063,_0x54ae1c;_0x93bc1c[_0x2358('0xd')]=intUtil[_0x2358('0x49')](_0x93bc1c[_0x2358('0xd')]);_0x93bc1c[_0x2358('0x4a')]=intUtil['stripTrailingSlash'](_0x93bc1c[_0x2358('0x4a')]);if(_0x534a60&&_0x534a60[_0x2358('0x4b')]){logger[_0x2358('0xa')]('['+_0x4e0b52['lastevent'][_0x2358('0x6f')]()+']','Recording\x20is\x20enabled!');_0x4e0b52[_0x2358('0x4e')]=util[_0x2358('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x93bc1c['serverUrl'],_0x4e0b52['uniqueid'],md5(_0x4e0b52[_0x2358('0x50')]));}else{_0x4e0b52[_0x2358('0x4e')]='';}headers[_0x2358('0x51')]=getAuth(_0x93bc1c);return getUser(_0x93bc1c)[_0x2358('0x15')](function(_0xdccc0d){_0x12a063=_0xdccc0d;logger['info'](_0x2358('0x53'),_0x12a063['id']);return getEndUser(_0x93bc1c,_0x4e0b52[_0x2358('0x54')],_0x4e0b52['calleridnum']);})[_0x2358('0x15')](function(_0x486158){_0x54ae1c=_0x486158;logger[_0x2358('0xa')](_0x2358('0x68'),_0x54ae1c['id']);return getTicket(_0x93bc1c,_0x12a063,_0x54ae1c,_0x4dd5c9,_0x4e0b52);})[_0x2358('0x15')](function(_0x2b3c27){if(_0x2b3c27){logger['info'](_0x2358('0x56'),_0x2b3c27['id']);}})['catch'](function(_0x34b131){logger[_0x2358('0x5e')]('['+_0x4e0b52[_0x2358('0x70')][_0x2358('0x6f')]()+']'+_0x2358('0x71'),util[_0x2358('0x61')](_0x34b131,{'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 8058b1f..4cd6fd5 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 _0x64bb=['expires_in','seconds','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','moduleCreate','role','last_name','data','code','SUCCESS','log','CREATE\x20ERROR','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Owner','profile','administrator','first_name','Subjects','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','utc','mm:ss','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Fields','Call\x20created!','details','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','unmanaged','toUpperCase','request-promise','md5','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','then','add'];(function(_0x20647c,_0x262425){var _0x51db8a=function(_0x4bdb98){while(--_0x4bdb98){_0x20647c['push'](_0x20647c['shift']());}};_0x51db8a(++_0x262425);}(_0x64bb,0x68));var _0xb64b=function(_0x2bcdff,_0x8fad66){_0x2bcdff=_0x2bcdff-0x0;var _0xbd3d07=_0x64bb[_0x2bcdff];return _0xbd3d07;};'use strict';var _=require('lodash');var rp=require(_0xb64b('0x0'));var md5=require(_0xb64b('0x1'));var util=require('util');var intUtil=require(_0xb64b('0x2'));var moment=require(_0xb64b('0x3'));var Redis=require(_0xb64b('0x4'));var BPromise=require('bluebird');var config=require(_0xb64b('0x5'));var logger=require(_0xb64b('0x6'))(_0xb64b('0x7'));config[_0xb64b('0x8')]=_[_0xb64b('0x9')](config[_0xb64b('0x8')],{'host':_0xb64b('0xa'),'port':0x18eb});var io=require(_0xb64b('0xb'))(new Redis(config[_0xb64b('0x8')]));function emit(_0x3fed6e,_0x21b2f7,_0x4ee418){io['to'](_0x3fed6e)[_0xb64b('0xc')](_0x21b2f7,_0x4ee418);}function request(_0xb58607){logger[_0xb64b('0xd')](_0xb64b('0xe'),JSON['stringify'](_0xb58607));return rp(_0xb58607);}function getCustomFields(_0x5ebe3f,_0x293742){var _0x5ba5e6={};if(_0x5ebe3f[_0xb64b('0xf')]>0x0){_[_0xb64b('0x10')](_0x5ebe3f,function(_0x24c4d7){if(_[_0xb64b('0x11')]([_0xb64b('0x12'),_0xb64b('0x13')],_0x24c4d7[_0xb64b('0x14')])&&_0x24c4d7[_0xb64b('0x15')]){_0x5ba5e6[_0x24c4d7[_0xb64b('0x15')]]=_0x24c4d7[_0xb64b('0x16')][_0xb64b('0x17')]();}else if(_0x24c4d7[_0xb64b('0x14')]===_0xb64b('0x18')&&_0x24c4d7[_0xb64b('0x19')]&&_0x24c4d7[_0xb64b('0x15')]&&_0x293742[_0x24c4d7[_0xb64b('0x19')]]){_0x5ba5e6[_0x24c4d7[_0xb64b('0x15')]]=_0x293742[_0x24c4d7[_0xb64b('0x19')]]['toString']();}else if(_0x24c4d7['type']===_0xb64b('0x1a')&&_0x24c4d7[_0xb64b('0x1b')]&&_0x24c4d7[_0xb64b('0x1b')][_0xb64b('0x1c')]&&_0x24c4d7[_0xb64b('0x15')]&&_0x293742[_0x24c4d7[_0xb64b('0x1b')][_0xb64b('0x1c')]['toLowerCase']()]){_0x5ba5e6[_0x24c4d7['idField']]=_0x293742[_0x24c4d7[_0xb64b('0x1b')]['name'][_0xb64b('0x1d')]()][_0xb64b('0x17')]();}});}return _0x5ba5e6;}function getName(_0xd2ee37){if(_0xd2ee37[_0xb64b('0x1e')]('\x20')>0x0){var _0x4198d6=_0xd2ee37[_0xb64b('0x1f')](/ (.+)/);if(_0x4198d6[0x1]){return _0x4198d6;}}return[_0xd2ee37,_0xd2ee37];}var accountsTokens={};function getAccessToken(_0xac904){return new Promise(function(_0x337bfb,_0x5d4957){if(!_[_0xb64b('0x20')](accountsTokens[_0xac904['id']])&&!_[_0xb64b('0x20')](accountsTokens[_0xac904['id']][_0xb64b('0x21')])){if(moment()[_0xb64b('0x22')](accountsTokens[_0xac904['id']]['expires_in'])){_0x337bfb(accountsTokens[_0xac904['id']][_0xb64b('0x21')]);}}var _0x1385e1;switch(_0xac904[_0xb64b('0x23')]){case'US':_0x1385e1=_0xb64b('0x24');break;case'AU':_0x1385e1='https://accounts.zoho.com.au';break;case'EU':_0x1385e1=_0xb64b('0x25');break;case'IN':_0x1385e1=_0xb64b('0x26');break;case'CN':_0x1385e1=_0xb64b('0x27');break;default:_0x1385e1=_0xb64b('0x25');break;}var _0x4bc57d={'method':_0xb64b('0x28'),'uri':_0x1385e1+_0xb64b('0x29'),'qs':{'refresh_token':_0xac904[_0xb64b('0x2a')],'client_id':_0xac904['clientId'],'client_secret':_0xac904['clientSecret'],'grant_type':_0xb64b('0x2b')},'json':!![]};return rp(_0x4bc57d)[_0xb64b('0x2c')](function(_0x3d97d2){accountsTokens[_0xac904['id']]={'access_token':_0x3d97d2[_0xb64b('0x21')],'expires_in':moment()[_0xb64b('0x2d')](_0x3d97d2[_0xb64b('0x2e')],_0xb64b('0x2f'))};_0x337bfb(_0x3d97d2[_0xb64b('0x21')]);})[_0xb64b('0x30')](function(_0x185af8){logger[_0xb64b('0x31')]('Failing\x20creating\x20the\x20access_token',_0x185af8[_0xb64b('0x32')]);_0x5d4957(_0x185af8);});});}function getUser(_0x2a7cb5,_0x6874ce,_0x4e5161,_0x10820d){logger[_0xb64b('0x33')](_0xb64b('0x34'));return request({'method':_0xb64b('0x35'),'uri':util[_0xb64b('0x36')](_0xb64b('0x37'),_0x6874ce),'qs':{'type':_0xb64b('0x38')},'headers':{'Authorization':_0xb64b('0x39')+_0x2a7cb5},'json':!![]})[_0xb64b('0x2c')](function(_0x56c365){if(_0x56c365['users']){var _0x3f4ced=-0x1;if(_[_0xb64b('0x3a')](_0x56c365[_0xb64b('0x3b')])){if(!_[_0xb64b('0x20')](_0x10820d)){_0x3f4ced=_[_0xb64b('0x3c')](_0x56c365[_0xb64b('0x3b')],function(_0x13b303){return _0x13b303[_0xb64b('0x3d')]===_0x10820d;});}if(_0x3f4ced>=0x0){logger['info']('Agent\x20found!');}else{logger['info'](_0xb64b('0x3e'));_0x3f4ced=_[_0xb64b('0x3c')](_0x56c365[_0xb64b('0x3b')],function(_0xf21994){return _0xf21994['profile'][_0xb64b('0x1c')]==='Administrator';});}return _0x56c365[_0xb64b('0x3b')][_0x3f4ced];}else{if(_0x56c365[_0xb64b('0x3f')]['profile'][_0xb64b('0x1c')]==='Administrator'){logger[_0xb64b('0x33')](_0xb64b('0x3e'));user=_0x56c365['user'];return user;}else{logger['error'](_0xb64b('0x40'),JSON[_0xb64b('0x41')](_0x56c365));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xb64b('0x41')](_0x56c365));}}}else{logger[_0xb64b('0x31')](_0xb64b('0x40'),JSON[_0xb64b('0x41')](_0x56c365));throw new Error(_0xb64b('0x42')+JSON[_0xb64b('0x41')](_0x56c365));}})[_0xb64b('0x30')](function(_0xf1ddff){console['error'](_0xf1ddff);});}function getZohoUser(_0x545341,_0x342782){return new BPromise(function(_0x11281e,_0x17fb64){request(_0x545341)[_0xb64b('0x2c')](function(_0x105980){var _0x16c74e=null;if(_0x105980){_0x16c74e=_0x105980['data'][0x0];_0x16c74e[_0xb64b('0x43')]=_0x342782;}_0x11281e(_0x16c74e);})['catch'](function(_0x3ee110){_0x17fb64(_0x3ee110);});});}function createEndUser(_0x124e0a,_0x424d6c,_0x1e1b21,_0x57d6ca,_0x403eb2,_0x37895f){var _0x1e1b21=getName(_0x1e1b21);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x424d6c+'/crm/v2/'+_['startCase'](_0x37895f[_0xb64b('0x44')])+'s','body':{'data':[{'Last_Name':_0x1e1b21[0x1],'First_Name':_0x1e1b21[0x0],'Phone':_0x57d6ca,'Owner':{'name':!_[_0xb64b('0x20')](_0x403eb2[_0xb64b('0x45')][_0xb64b('0x1c')])?_0x403eb2[_0xb64b('0x45')][_0xb64b('0x1c')]:!_[_0xb64b('0x20')](_0x403eb2['first_name'])?_0x403eb2['first_name']+'\x20'+_0x403eb2[_0xb64b('0x46')]:_0x403eb2[_0xb64b('0x46')],'id':_0x403eb2['id']}}]},'headers':{'Authorization':_0xb64b('0x39')+_0x124e0a},'json':!![]})[_0xb64b('0x2c')](function(_0x52b1f3){if(_0x52b1f3&&_0x52b1f3[_0xb64b('0x47')][0x0][_0xb64b('0x48')]===_0xb64b('0x49')){var _0x5a9110=_0x52b1f3[_0xb64b('0x47')][0x0]['details'];_0x5a9110[_0xb64b('0x43')]=_['startCase'](_0x37895f[_0xb64b('0x44')])+'s';return _0x5a9110;}logger['error'](_0xb64b('0x40'),JSON[_0xb64b('0x41')](data));throw new Error('Error:\x20'+JSON[_0xb64b('0x41')](data));})[_0xb64b('0x30')](function(_0x44c575){console[_0xb64b('0x4a')](_0xb64b('0x4b'),_0x44c575);});}function getEndUser(_0x3453d,_0x39eb40,_0x55e3f2,_0x4cce6b,_0x18c7d2,_0x3d36c3,_0x3a5c6c){var _0x41b6c6={'method':_0xb64b('0x35'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3453d},'json':!![]};switch(_0x3a5c6c['moduleSearch']){case _0xb64b('0x4c'):_0x41b6c6[_0xb64b('0x4d')]=_0xb64b('0x4e')+_0x39eb40+_0xb64b('0x4f')+_0x18c7d2+'))';return getZohoUser(_0x41b6c6,_0xb64b('0x50'))['then'](function(_0x4b3d3c){if(_0x4b3d3c)return _0x4b3d3c;_0x41b6c6[_0xb64b('0x4d')]='https://www.zohoapis.'+_0x39eb40+_0xb64b('0x51')+_0x18c7d2+'))';return getZohoUser(_0x41b6c6,_0xb64b('0x52'))['then'](function(_0x5464fd){if(_0x5464fd)return _0x5464fd;if(_0x3a5c6c['moduleCreate']!=_0xb64b('0x53')){return createEndUser(_0x3453d,_0x39eb40,_0x4cce6b,_0x18c7d2,_0x3d36c3,_0x3a5c6c);}else{return{};}});});break;case _0xb64b('0x54'):_0x41b6c6['uri']='https://www.zohoapis.'+_0x39eb40+_0xb64b('0x4f')+_0x18c7d2+'))';return getZohoUser(_0x41b6c6,'Contacts')[_0xb64b('0x2c')](function(_0x46c6af){if(_0x46c6af)return _0x46c6af;if(_0x3a5c6c[_0xb64b('0x44')]!=_0xb64b('0x53')){return createEndUser(_0x3453d,_0x39eb40,_0x4cce6b,_0x18c7d2,_0x3d36c3,_0x3a5c6c);}else{return{};}});break;case'lead':_0x41b6c6['uri']=_0xb64b('0x4e')+_0x39eb40+_0xb64b('0x51')+_0x18c7d2+'))';return getZohoUser(_0x41b6c6,'Leads')[_0xb64b('0x2c')](function(_0x4788ac){if(_0x4788ac)return _0x4788ac;if(_0x3a5c6c[_0xb64b('0x44')]!=_0xb64b('0x53')){return createEndUser(_0x3453d,_0x39eb40,_0x4cce6b,_0x18c7d2,_0x3d36c3,_0x3a5c6c);}else{return{};}});break;}}function getCall(_0x144130,_0x57dcb7,_0x8dfd1b,_0x4d1f34,_0x27ca37,_0xef65ef,_0x54c3c0,_0x3dc530){logger[_0xb64b('0x33')]('Creating\x20new\x20call...');var _0x196e2c={};_0x196e2c[_0xb64b('0x55')]={'name':!_[_0xb64b('0x20')](_0x4d1f34['role'][_0xb64b('0x1c')])&&!_[_0xb64b('0x20')](_0x4d1f34['profile'][_0xb64b('0x1c')])&&_0x4d1f34[_0xb64b('0x56')]['name']===_0xb64b('0x57')?_0x4d1f34[_0xb64b('0x45')]['name']:!_['isNil'](_0x4d1f34[_0xb64b('0x58')])?_0x4d1f34['first_name']+'\x20'+_0x4d1f34[_0xb64b('0x46')]:_0x4d1f34['last_name'],'id':_0x4d1f34['id']};_0x196e2c['Subject']=intUtil['getString'](_0xef65ef[_0xb64b('0x59')],_0x54c3c0,'\x20');_0x196e2c['Description']=intUtil[_0xb64b('0x5a')](_0xef65ef[_0xb64b('0x5b')],_0x54c3c0,'\x0a');if(_0x27ca37[_0xb64b('0x43')]===_0xb64b('0x50')){_0x196e2c[_0xb64b('0x5c')]={'name':!_[_0xb64b('0x20')](_0x27ca37[_0xb64b('0x5d')])?_0x27ca37['Full_Name']:!_[_0xb64b('0x20')](_0x27ca37['First_Name'])?_0x27ca37[_0xb64b('0x5e')]+'\x20'+_0x27ca37['Last_Name']:_0x27ca37[_0xb64b('0x5f')],'id':_0x27ca37['id']};}if(_0x27ca37[_0xb64b('0x43')]===_0xb64b('0x52')){_0x196e2c[_0xb64b('0x60')]={'name':!_['isNil'](_0x27ca37['Full_Name'])?_0x27ca37[_0xb64b('0x5d')]:!_[_0xb64b('0x20')](_0x27ca37[_0xb64b('0x5e')])?_0x27ca37[_0xb64b('0x5e')]+'\x20'+_0x27ca37[_0xb64b('0x5f')]:_0x27ca37['Last_Name'],'id':_0x27ca37['id']};_0x196e2c['$se_module']=_['startCase'](_0x27ca37[_0xb64b('0x43')]);}if(_0x54c3c0[_0xb64b('0x61')]){_0x196e2c['Call_Duration']=moment[_0xb64b('0x62')](parseInt(_0x54c3c0['talktime'])*0x3e8)[_0xb64b('0x36')](_0xb64b('0x63'));}else if(_0x54c3c0['answertime']&&_0x54c3c0[_0xb64b('0x64')]){_0x196e2c[_0xb64b('0x65')]=moment[_0xb64b('0x62')](moment(_0x54c3c0[_0xb64b('0x64')],_0xb64b('0x66'))['diff'](moment(_0x54c3c0[_0xb64b('0x67')],_0xb64b('0x66'))))[_0xb64b('0x36')](_0xb64b('0x63'));}switch(_0x54c3c0[_0xb64b('0x68')]){case _0xb64b('0x69'):_0x196e2c[_0xb64b('0x6a')]=_0xb64b('0x6b');break;case _0xb64b('0x6c'):case _0xb64b('0x6d'):_0x196e2c['Call_Result']=_0xb64b('0x6e');break;case _0xb64b('0x6f'):_0x196e2c[_0xb64b('0x6a')]=_0xb64b('0x70');break;case _0xb64b('0x71'):_0x196e2c['Call_Result']=_0xb64b('0x72');break;case _0xb64b('0x73'):_0x196e2c['Call_Result']=_0xb64b('0x74');default:}_0x196e2c[_0xb64b('0x75')]=(_0x3dc530===_0xb64b('0x76')?moment(_0x54c3c0[_0xb64b('0x67')])[_0xb64b('0x36')](_0xb64b('0x66')):moment(_0x54c3c0[_0xb64b('0x77')])[_0xb64b('0x36')](_0xb64b('0x66')))||moment()[_0xb64b('0x36')](_0xb64b('0x66'));_0x196e2c['Call_Type']=_0x3dc530||'Inbound';_0x196e2c=_['merge'](_0x196e2c,getCustomFields(_0xef65ef[_0xb64b('0x78')],_0x54c3c0));return request({'method':_0xb64b('0x28'),'uri':_0xb64b('0x4e')+_0x57dcb7+'/crm/v2/Calls','headers':{'Authorization':_0xb64b('0x39')+_0x144130},'body':{'data':[_0x196e2c]},'json':!![]})[_0xb64b('0x2c')](function(_0x3f50cc){if(_0x3f50cc&&_0x3f50cc[_0xb64b('0x47')][0x0][_0xb64b('0x48')]==='SUCCESS'){logger['info'](_0xb64b('0x79'));return{'id':_0x3f50cc[_0xb64b('0x47')][0x0][_0xb64b('0x7a')]['id']};}})[_0xb64b('0x30')](function(_0x5c1aa2){logger[_0xb64b('0x33')]('err',_0x5c1aa2['stack']);console['log']('err',_0x5c1aa2);});}exports['queue']=function(_0x3086ec,_0xc9bbba,_0x1ede3d,_0x2ae18c,_0xbcc020,_0x3629f4){var _0x244cba,_0x447f40,_0x251e4e;_0x3629f4[_0xb64b('0x7b')]=intUtil[_0xb64b('0x7c')](_0x3629f4['host']);_0x3629f4['serverUrl']=intUtil[_0xb64b('0x7c')](_0x3629f4[_0xb64b('0x7d')]);if(_0xbcc020&&_0xbcc020[_0xb64b('0x7e')]){logger[_0xb64b('0x33')](_0xb64b('0x7f'),'Recording\x20is\x20enabled!');_0xc9bbba[_0xb64b('0x80')]=_0x3629f4[_0xb64b('0x7d')]+_0xb64b('0x81')+_0xc9bbba['uniqueid']+_0xb64b('0x82')+md5(_0xc9bbba[_0xb64b('0x83')]);}else{_0xc9bbba[_0xb64b('0x80')]='';}var _0x41253f=_0x3629f4['host']===_0xb64b('0x84')?'eu':_0xb64b('0x85');return getAccessToken(_0x3629f4)['then'](function(_0x42b9d9){_0x251e4e=_0x42b9d9;return getUser(_0x251e4e,_0x41253f,_0x3629f4,_0x2ae18c['email']);})[_0xb64b('0x2c')](function(_0xc1231){_0x244cba=_0xc1231;logger[_0xb64b('0x33')](_0xb64b('0x86'),_0x244cba['id']);return getEndUser(_0x251e4e,_0x41253f,_0x3629f4,_0xc9bbba[_0xb64b('0x87')],_0xc9bbba[_0xb64b('0x88')],_0x244cba,_0x1ede3d);})['then'](function(_0x2518ad){_0x447f40=_0x2518ad;return getCall(_0x251e4e,_0x41253f,_0x3629f4,_0x244cba,_0x447f40,_0x1ede3d,_0xc9bbba,_0xb64b('0x89'));})[_0xb64b('0x2c')](function(_0x4f7074){if(_0x4f7074){logger[_0xb64b('0x33')]('The\x20Call\x20ID\x20is:',_0x4f7074['id']);logger[_0xb64b('0x33')](_0xb64b('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb64b('0x8a'),_0x2ae18c['name']),_0xb64b('0x8b'),{'uri':_0xb64b('0x8c')+_0x3629f4[_0xb64b('0x7b')]+_0xb64b('0x8d')+_0x4f7074['id']});}})[_0xb64b('0x30')](function(_0x650c61){logger[_0xb64b('0x31')](_0xb64b('0x7f'),JSON[_0xb64b('0x41')](_0x650c61));});};exports[_0xb64b('0x76')]=function(_0x523996,_0x46381e,_0x916abd,_0x3abe48,_0xd72f9,_0x1f6ab1,_0x258729){var _0x2bee40,_0x4a9b42,_0x2a82a9;_0x1f6ab1['host']=intUtil[_0xb64b('0x7c')](_0x1f6ab1[_0xb64b('0x7b')]);_0x1f6ab1[_0xb64b('0x7d')]=intUtil['stripTrailingSlash'](_0x1f6ab1[_0xb64b('0x7d')]);if(_0x258729&&_0x258729[_0xb64b('0x8e')]&&_0x258729['recordingFormat']!==_0xb64b('0x8f')){logger[_0xb64b('0x33')]('[OUTBOUND]',_0xb64b('0x90'));_0x46381e['recordingURL']=_0x1f6ab1[_0xb64b('0x7d')]+'/api/voice/recordings/'+_0x46381e[_0xb64b('0x83')]+_0xb64b('0x82')+md5(_0x46381e['uniqueid']);}var _0x318965=_0x1f6ab1[_0xb64b('0x7b')]===_0xb64b('0x84')?'eu':_0xb64b('0x85');return getAccessToken(_0x1f6ab1)[_0xb64b('0x2c')](function(_0x3d473a){_0x2a82a9=_0x3d473a;return getUser(_0x2a82a9,_0x318965,_0x1f6ab1,_0x3abe48[_0xb64b('0x3d')]);})[_0xb64b('0x2c')](function(_0x5816f1){_0x2bee40=_0x5816f1;logger[_0xb64b('0x33')]('The\x20User\x20ID\x20is:',_0x2bee40['id']);return getEndUser(_0x2a82a9,_0x318965,_0x1f6ab1,_0x46381e['destcalleridname'],_0x46381e['destcalleridnum'],_0x2bee40,_0x916abd);})[_0xb64b('0x2c')](function(_0xded4ab){_0x4a9b42=_0xded4ab;return getCall(_0x2a82a9,_0x318965,_0x1f6ab1,_0x2bee40,_0x4a9b42,_0x916abd,_0x46381e,_0xb64b('0x91'));})[_0xb64b('0x2c')](function(_0x9628f3){if(_0x9628f3){logger[_0xb64b('0x33')](_0xb64b('0x92'),_0x9628f3['id']);logger[_0xb64b('0x33')](_0xb64b('0x93'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb64b('0x36')](_0xb64b('0x8a'),_0x3abe48[_0xb64b('0x1c')]),_0xb64b('0x8b'),{'uri':_0xb64b('0x8c')+_0x1f6ab1[_0xb64b('0x7b')]+_0xb64b('0x8d')+_0x9628f3['id']});}})[_0xb64b('0x30')](function(_0x2d286f){logger[_0xb64b('0x31')]('[OUTBOUND]',JSON[_0xb64b('0x41')](_0x2d286f));});};exports[_0xb64b('0x94')]=function(_0x16500e,_0x4e9117,_0x4b7db0,_0x279f96,_0x55c4ea,_0x1e0aa7){var _0x2fd1c1,_0xb45284,_0x5a11a1;_0x1e0aa7[_0xb64b('0x7b')]=intUtil[_0xb64b('0x7c')](_0x1e0aa7[_0xb64b('0x7b')]);_0x1e0aa7['serverUrl']=intUtil[_0xb64b('0x7c')](_0x1e0aa7[_0xb64b('0x7d')]);if(_0x55c4ea&&_0x55c4ea['monitor_format']){logger[_0xb64b('0x33')]('['+_0x4e9117[_0xb64b('0x68')][_0xb64b('0x95')]()+']',_0xb64b('0x90'));_0x4e9117[_0xb64b('0x80')]=_0x1e0aa7['serverUrl']+_0xb64b('0x81')+_0x4e9117[_0xb64b('0x83')]+_0xb64b('0x82')+md5(_0x4e9117[_0xb64b('0x83')]);}else{_0x4e9117[_0xb64b('0x80')]='';}var _0x17d99b=_0x1e0aa7[_0xb64b('0x7b')]==='zoho.eu'?'eu':_0xb64b('0x85');return getAccessToken(_0x1e0aa7)[_0xb64b('0x2c')](function(_0x3d7c5a){_0x5a11a1=_0x3d7c5a;return getUser(_0x5a11a1,_0x17d99b,_0x1e0aa7);})[_0xb64b('0x2c')](function(_0x4e5d1b){_0x2fd1c1=_0x4e5d1b;logger[_0xb64b('0x33')](_0xb64b('0x86'),_0x2fd1c1['id']);return getEndUser(_0x5a11a1,_0x17d99b,_0x1e0aa7,_0x4e9117['calleridname'],_0x4e9117[_0xb64b('0x88')],_0x2fd1c1,_0x4b7db0);})[_0xb64b('0x2c')](function(_0x10f1d7){_0xb45284=_0x10f1d7;return getCall(_0x5a11a1,_0x17d99b,_0x1e0aa7,_0x2fd1c1,_0xb45284,_0x4b7db0,_0x4e9117,_0xb64b('0x89'));})[_0xb64b('0x2c')](function(_0x5b2cf1){if(_0x5b2cf1){logger['info']('The\x20Call\x20ID\x20is:',_0x5b2cf1['id']);}})['catch'](function(_0x2fa711){logger['error']('['+_0x4e9117[_0xb64b('0x68')][_0xb64b('0x95')]()+']',JSON[_0xb64b('0x41')](_0x2fa711));});}; \ No newline at end of file +var _0x47b4=['The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','unmanaged','toUpperCase','Recording\x20is\x20enabled!','lodash','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Contacts','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','enduserType','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stack','log','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum'];(function(_0x1e6011,_0x31f898){var _0xd0efcc=function(_0x3c8206){while(--_0x3c8206){_0x1e6011['push'](_0x1e6011['shift']());}};_0xd0efcc(++_0x31f898);}(_0x47b4,0x1e2));var _0x447b=function(_0x383a9d,_0x298fd3){_0x383a9d=_0x383a9d-0x0;var _0x150332=_0x47b4[_0x383a9d];return _0x150332;};'use strict';var _=require(_0x447b('0x0'));var rp=require('request-promise');var md5=require(_0x447b('0x1'));var util=require(_0x447b('0x2'));var intUtil=require('./util');var moment=require(_0x447b('0x3'));var Redis=require(_0x447b('0x4'));var BPromise=require('bluebird');var config=require(_0x447b('0x5'));var logger=require(_0x447b('0x6'))(_0x447b('0x7'));config[_0x447b('0x8')]=_[_0x447b('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x447b('0xa'))(new Redis(config['redis']));function emit(_0x38892e,_0x1e70dc,_0x11ee4b){io['to'](_0x38892e)[_0x447b('0xb')](_0x1e70dc,_0x11ee4b);}function request(_0x556b5d){logger[_0x447b('0xc')](_0x447b('0xd'),JSON[_0x447b('0xe')](_0x556b5d));return rp(_0x556b5d);}function getCustomFields(_0xf6285d,_0x168e6c){var _0x3d6aff={};if(_0xf6285d[_0x447b('0xf')]>0x0){_[_0x447b('0x10')](_0xf6285d,function(_0x1df90e){if(_[_0x447b('0x11')]([_0x447b('0x12'),_0x447b('0x13')],_0x1df90e[_0x447b('0x14')])&&_0x1df90e[_0x447b('0x15')]){_0x3d6aff[_0x1df90e[_0x447b('0x15')]]=_0x1df90e[_0x447b('0x16')][_0x447b('0x17')]();}else if(_0x1df90e['type']===_0x447b('0x18')&&_0x1df90e['variableName']&&_0x1df90e['idField']&&_0x168e6c[_0x1df90e[_0x447b('0x19')]]){_0x3d6aff[_0x1df90e[_0x447b('0x15')]]=_0x168e6c[_0x1df90e['variableName']]['toString']();}else if(_0x1df90e['type']===_0x447b('0x1a')&&_0x1df90e[_0x447b('0x1b')]&&_0x1df90e['Variable'][_0x447b('0x1c')]&&_0x1df90e['idField']&&_0x168e6c[_0x1df90e['Variable']['name'][_0x447b('0x1d')]()]){_0x3d6aff[_0x1df90e[_0x447b('0x15')]]=_0x168e6c[_0x1df90e[_0x447b('0x1b')][_0x447b('0x1c')][_0x447b('0x1d')]()][_0x447b('0x17')]();}});}return _0x3d6aff;}function getName(_0x5adf59){if(_0x5adf59[_0x447b('0x1e')]('\x20')>0x0){var _0x242ee6=_0x5adf59[_0x447b('0x1f')](/ (.+)/);if(_0x242ee6[0x1]){return _0x242ee6;}}return[_0x5adf59,_0x5adf59];}var accountsTokens={};function getAccessToken(_0x4be6ac){return new Promise(function(_0x1373cd,_0x2583ab){if(!_[_0x447b('0x20')](accountsTokens[_0x4be6ac['id']])&&!_['isNil'](accountsTokens[_0x4be6ac['id']]['access_token'])){if(moment()[_0x447b('0x21')](accountsTokens[_0x4be6ac['id']][_0x447b('0x22')])){_0x1373cd(accountsTokens[_0x4be6ac['id']][_0x447b('0x23')]);}}var _0x5423ad;switch(_0x4be6ac[_0x447b('0x24')]){case'US':_0x5423ad='https://accounts.zoho.com';break;case'AU':_0x5423ad=_0x447b('0x25');break;case'EU':_0x5423ad=_0x447b('0x26');break;case'IN':_0x5423ad=_0x447b('0x27');break;case'CN':_0x5423ad=_0x447b('0x28');break;default:_0x5423ad=_0x447b('0x26');break;}var _0x726693={'method':_0x447b('0x29'),'uri':_0x5423ad+_0x447b('0x2a'),'qs':{'refresh_token':_0x4be6ac['refreshToken'],'client_id':_0x4be6ac[_0x447b('0x2b')],'client_secret':_0x4be6ac[_0x447b('0x2c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x726693)[_0x447b('0x2d')](function(_0x13fa64){accountsTokens[_0x4be6ac['id']]={'access_token':_0x13fa64[_0x447b('0x23')],'expires_in':moment()['add'](_0x13fa64[_0x447b('0x22')],_0x447b('0x2e'))};_0x1373cd(_0x13fa64[_0x447b('0x23')]);})[_0x447b('0x2f')](function(_0x4b0f1a){logger[_0x447b('0x30')](_0x447b('0x31'),_0x4b0f1a['stack']);_0x2583ab(_0x4b0f1a);});});}function getUser(_0x39505f,_0x31f86e,_0x5ea9d1,_0x171c10){logger['info'](_0x447b('0x32'));return request({'method':_0x447b('0x33'),'uri':util[_0x447b('0x34')](_0x447b('0x35'),_0x31f86e),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x447b('0x36')+_0x39505f},'json':!![]})[_0x447b('0x2d')](function(_0x5b385f){if(_0x5b385f[_0x447b('0x37')]){var _0x1366f8=-0x1;if(_[_0x447b('0x38')](_0x5b385f[_0x447b('0x37')])){if(!_[_0x447b('0x20')](_0x171c10)){_0x1366f8=_[_0x447b('0x39')](_0x5b385f[_0x447b('0x37')],function(_0x197498){return _0x197498['email']===_0x171c10;});}if(_0x1366f8>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x447b('0x3a')](_0x447b('0x3b'));_0x1366f8=_[_0x447b('0x39')](_0x5b385f[_0x447b('0x37')],function(_0x299733){return _0x299733[_0x447b('0x3c')][_0x447b('0x1c')]===_0x447b('0x3d');});}return _0x5b385f[_0x447b('0x37')][_0x1366f8];}else{if(_0x5b385f[_0x447b('0x3e')][_0x447b('0x3c')][_0x447b('0x1c')]===_0x447b('0x3d')){logger[_0x447b('0x3a')](_0x447b('0x3b'));user=_0x5b385f[_0x447b('0x3e')];return user;}else{logger[_0x447b('0x30')](_0x447b('0x3f'),JSON[_0x447b('0xe')](_0x5b385f));throw new Error(_0x447b('0x40')+JSON['stringify'](_0x5b385f));}}}else{logger[_0x447b('0x30')](_0x447b('0x3f'),JSON[_0x447b('0xe')](_0x5b385f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x5b385f));}})[_0x447b('0x2f')](function(_0x5ce1a8){console[_0x447b('0x30')](_0x5ce1a8);});}function getZohoUser(_0x232430,_0x27ea54){return new BPromise(function(_0x16e235,_0x4d5b6c){request(_0x232430)[_0x447b('0x2d')](function(_0x5eac5d){var _0x3f9475=null;if(_0x5eac5d){_0x3f9475=_0x5eac5d[_0x447b('0x41')][0x0];_0x3f9475['enduserType']=_0x27ea54;}_0x16e235(_0x3f9475);})[_0x447b('0x2f')](function(_0x1274a2){_0x4d5b6c(_0x1274a2);});});}function createEndUser(_0x3d811c,_0xb864fd,_0x9682b4,_0x350f81,_0xe495aa,_0x3de19b){var _0x9682b4=getName(_0x9682b4);return request({'method':'POST','uri':'https://www.zohoapis.'+_0xb864fd+_0x447b('0x42')+_[_0x447b('0x43')](_0x3de19b[_0x447b('0x44')])+'s','body':{'data':[{'Last_Name':_0x9682b4[0x1],'First_Name':_0x9682b4[0x0],'Phone':_0x350f81,'Owner':{'name':!_[_0x447b('0x20')](_0xe495aa[_0x447b('0x45')]['name'])?_0xe495aa[_0x447b('0x45')][_0x447b('0x1c')]:!_[_0x447b('0x20')](_0xe495aa[_0x447b('0x46')])?_0xe495aa['first_name']+'\x20'+_0xe495aa[_0x447b('0x47')]:_0xe495aa[_0x447b('0x47')],'id':_0xe495aa['id']}}]},'headers':{'Authorization':_0x447b('0x36')+_0x3d811c},'json':!![]})['then'](function(_0x5bc3c4){if(_0x5bc3c4&&_0x5bc3c4[_0x447b('0x41')][0x0][_0x447b('0x48')]===_0x447b('0x49')){var _0x590524=_0x5bc3c4[_0x447b('0x41')][0x0][_0x447b('0x4a')];_0x590524['enduserType']=_[_0x447b('0x43')](_0x3de19b[_0x447b('0x44')])+'s';return _0x590524;}logger['error'](_0x447b('0x3f'),JSON[_0x447b('0xe')](data));throw new Error('Error:\x20'+JSON[_0x447b('0xe')](data));})[_0x447b('0x2f')](function(_0x10263e){console['log'](_0x447b('0x4b'),_0x10263e);});}function getEndUser(_0x396b52,_0x222801,_0x108422,_0x462c1a,_0xb36825,_0x3f9eb2,_0x585c08){var _0x5d8a83={'method':_0x447b('0x33'),'uri':'','headers':{'Authorization':_0x447b('0x36')+_0x396b52},'json':!![]};switch(_0x585c08[_0x447b('0x4c')]){case _0x447b('0x4d'):_0x5d8a83[_0x447b('0x4e')]=_0x447b('0x4f')+_0x222801+_0x447b('0x50')+_0xb36825+'))';return getZohoUser(_0x5d8a83,'Contacts')['then'](function(_0x5b4404){if(_0x5b4404)return _0x5b4404;_0x5d8a83[_0x447b('0x4e')]=_0x447b('0x4f')+_0x222801+_0x447b('0x51')+_0xb36825+'))';return getZohoUser(_0x5d8a83,_0x447b('0x52'))[_0x447b('0x2d')](function(_0x305bf3){if(_0x305bf3)return _0x305bf3;if(_0x585c08['moduleCreate']!=_0x447b('0x53')){return createEndUser(_0x396b52,_0x222801,_0x462c1a,_0xb36825,_0x3f9eb2,_0x585c08);}else{return{};}});});break;case'contact':_0x5d8a83['uri']='https://www.zohoapis.'+_0x222801+_0x447b('0x50')+_0xb36825+'))';return getZohoUser(_0x5d8a83,_0x447b('0x54'))[_0x447b('0x2d')](function(_0x5af75a){if(_0x5af75a)return _0x5af75a;if(_0x585c08[_0x447b('0x44')]!=_0x447b('0x53')){return createEndUser(_0x396b52,_0x222801,_0x462c1a,_0xb36825,_0x3f9eb2,_0x585c08);}else{return{};}});break;case _0x447b('0x55'):_0x5d8a83[_0x447b('0x4e')]=_0x447b('0x4f')+_0x222801+_0x447b('0x51')+_0xb36825+'))';return getZohoUser(_0x5d8a83,_0x447b('0x52'))[_0x447b('0x2d')](function(_0x3b4138){if(_0x3b4138)return _0x3b4138;if(_0x585c08[_0x447b('0x44')]!=_0x447b('0x53')){return createEndUser(_0x396b52,_0x222801,_0x462c1a,_0xb36825,_0x3f9eb2,_0x585c08);}else{return{};}});break;}}function getCall(_0xbe764b,_0x8563b3,_0x4dffe4,_0x384286,_0x4c4f94,_0x38f231,_0x1f6d1f,_0x289331){logger[_0x447b('0x3a')](_0x447b('0x56'));var _0x2897ee={};_0x2897ee[_0x447b('0x57')]={'name':!_['isNil'](_0x384286[_0x447b('0x45')][_0x447b('0x1c')])&&!_['isNil'](_0x384286[_0x447b('0x3c')][_0x447b('0x1c')])&&_0x384286['profile'][_0x447b('0x1c')]===_0x447b('0x58')?_0x384286[_0x447b('0x45')][_0x447b('0x1c')]:!_[_0x447b('0x20')](_0x384286[_0x447b('0x46')])?_0x384286[_0x447b('0x46')]+'\x20'+_0x384286[_0x447b('0x47')]:_0x384286[_0x447b('0x47')],'id':_0x384286['id']};_0x2897ee['Subject']=intUtil[_0x447b('0x59')](_0x38f231[_0x447b('0x5a')],_0x1f6d1f,'\x20');_0x2897ee[_0x447b('0x5b')]=intUtil[_0x447b('0x59')](_0x38f231['Descriptions'],_0x1f6d1f,'\x0a');if(_0x4c4f94[_0x447b('0x5c')]===_0x447b('0x54')){_0x2897ee[_0x447b('0x5d')]={'name':!_['isNil'](_0x4c4f94[_0x447b('0x5e')])?_0x4c4f94['Full_Name']:!_['isNil'](_0x4c4f94['First_Name'])?_0x4c4f94[_0x447b('0x5f')]+'\x20'+_0x4c4f94[_0x447b('0x60')]:_0x4c4f94[_0x447b('0x60')],'id':_0x4c4f94['id']};}if(_0x4c4f94[_0x447b('0x5c')]===_0x447b('0x52')){_0x2897ee['What_Id']={'name':!_[_0x447b('0x20')](_0x4c4f94[_0x447b('0x5e')])?_0x4c4f94['Full_Name']:!_['isNil'](_0x4c4f94[_0x447b('0x5f')])?_0x4c4f94[_0x447b('0x5f')]+'\x20'+_0x4c4f94[_0x447b('0x60')]:_0x4c4f94[_0x447b('0x60')],'id':_0x4c4f94['id']};_0x2897ee[_0x447b('0x61')]=_[_0x447b('0x43')](_0x4c4f94[_0x447b('0x5c')]);}if(_0x1f6d1f[_0x447b('0x62')]){_0x2897ee[_0x447b('0x63')]=moment[_0x447b('0x64')](parseInt(_0x1f6d1f[_0x447b('0x62')])*0x3e8)[_0x447b('0x34')](_0x447b('0x65'));}else if(_0x1f6d1f[_0x447b('0x66')]&&_0x1f6d1f[_0x447b('0x67')]){_0x2897ee[_0x447b('0x63')]=moment[_0x447b('0x64')](moment(_0x1f6d1f['endtime'],_0x447b('0x68'))[_0x447b('0x69')](moment(_0x1f6d1f[_0x447b('0x6a')],_0x447b('0x68'))))[_0x447b('0x34')](_0x447b('0x65'));}switch(_0x1f6d1f[_0x447b('0x6b')]){case _0x447b('0x6c'):_0x2897ee['Call_Result']=_0x447b('0x6d');break;case'complete':case _0x447b('0x6e'):_0x2897ee[_0x447b('0x6f')]=_0x447b('0x70');break;case _0x447b('0x71'):_0x2897ee[_0x447b('0x6f')]=_0x447b('0x72');break;case _0x447b('0x73'):_0x2897ee[_0x447b('0x6f')]=_0x447b('0x74');break;case _0x447b('0x75'):_0x2897ee[_0x447b('0x6f')]='Timeout';default:}_0x2897ee['Call_Start_Time']=(_0x289331==='outbound'?moment(_0x1f6d1f['starttime'])['format'](_0x447b('0x68')):moment(_0x1f6d1f[_0x447b('0x76')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x447b('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x2897ee['Call_Type']=_0x289331||_0x447b('0x77');_0x2897ee=_[_0x447b('0x78')](_0x2897ee,getCustomFields(_0x38f231[_0x447b('0x79')],_0x1f6d1f));return request({'method':'POST','uri':_0x447b('0x4f')+_0x8563b3+_0x447b('0x7a'),'headers':{'Authorization':_0x447b('0x36')+_0xbe764b},'body':{'data':[_0x2897ee]},'json':!![]})[_0x447b('0x2d')](function(_0x1f292f){if(_0x1f292f&&_0x1f292f[_0x447b('0x41')][0x0][_0x447b('0x48')]===_0x447b('0x49')){logger[_0x447b('0x3a')](_0x447b('0x7b'));return{'id':_0x1f292f[_0x447b('0x41')][0x0][_0x447b('0x4a')]['id']};}})['catch'](function(_0x144244){logger['info'](_0x447b('0x7c'),_0x144244[_0x447b('0x7d')]);console[_0x447b('0x7e')](_0x447b('0x7c'),_0x144244);});}exports['queue']=function(_0x51c688,_0x2ef9ca,_0x19e34a,_0x4afd47,_0x452d17,_0xd93243){var _0x2b6084,_0x5c9b37,_0x493bd0;_0xd93243[_0x447b('0x7f')]=intUtil[_0x447b('0x80')](_0xd93243[_0x447b('0x7f')]);_0xd93243[_0x447b('0x81')]=intUtil[_0x447b('0x80')](_0xd93243[_0x447b('0x81')]);if(_0x452d17&&_0x452d17[_0x447b('0x82')]){logger[_0x447b('0x3a')](_0x447b('0x83'),'Recording\x20is\x20enabled!');_0x2ef9ca[_0x447b('0x84')]=_0xd93243['serverUrl']+_0x447b('0x85')+_0x2ef9ca['uniqueid']+_0x447b('0x86')+md5(_0x2ef9ca[_0x447b('0x87')]);}else{_0x2ef9ca['recordingURL']='';}var _0x294e05=_0xd93243[_0x447b('0x7f')]===_0x447b('0x88')?'eu':_0x447b('0x89');return getAccessToken(_0xd93243)[_0x447b('0x2d')](function(_0x3567e2){_0x493bd0=_0x3567e2;return getUser(_0x493bd0,_0x294e05,_0xd93243,_0x4afd47[_0x447b('0x8a')]);})[_0x447b('0x2d')](function(_0x44001b){_0x2b6084=_0x44001b;logger[_0x447b('0x3a')](_0x447b('0x8b'),_0x2b6084['id']);return getEndUser(_0x493bd0,_0x294e05,_0xd93243,_0x2ef9ca[_0x447b('0x8c')],_0x2ef9ca[_0x447b('0x8d')],_0x2b6084,_0x19e34a);})[_0x447b('0x2d')](function(_0x3b5262){_0x5c9b37=_0x3b5262;return getCall(_0x493bd0,_0x294e05,_0xd93243,_0x2b6084,_0x5c9b37,_0x19e34a,_0x2ef9ca,_0x447b('0x77'));})[_0x447b('0x2d')](function(_0x34eac3){if(_0x34eac3){logger[_0x447b('0x3a')](_0x447b('0x8e'),_0x34eac3['id']);logger[_0x447b('0x3a')](_0x447b('0x83'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x447b('0x34')](_0x447b('0x8f'),_0x4afd47[_0x447b('0x1c')]),_0x447b('0x90'),{'uri':'https://crm.'+_0xd93243[_0x447b('0x7f')]+_0x447b('0x91')+_0x34eac3['id']});}})['catch'](function(_0x5635cb){logger[_0x447b('0x30')](_0x447b('0x83'),JSON[_0x447b('0xe')](_0x5635cb));});};exports[_0x447b('0x92')]=function(_0x454727,_0x2788ad,_0x5be7ef,_0x4f47f0,_0x584d00,_0x1718f1,_0x3a59ca){var _0x5be141,_0x40aebb,_0x5cbeab;_0x1718f1[_0x447b('0x7f')]=intUtil[_0x447b('0x80')](_0x1718f1[_0x447b('0x7f')]);_0x1718f1['serverUrl']=intUtil[_0x447b('0x80')](_0x1718f1[_0x447b('0x81')]);if(_0x3a59ca&&_0x3a59ca['recordingFormat']&&_0x3a59ca['recordingFormat']!==_0x447b('0x93')){logger['info'](_0x447b('0x94'),'Recording\x20is\x20enabled!');_0x2788ad[_0x447b('0x84')]=_0x1718f1['serverUrl']+_0x447b('0x85')+_0x2788ad['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x2788ad[_0x447b('0x87')]);}var _0x5f3264=_0x1718f1['host']===_0x447b('0x88')?'eu':_0x447b('0x89');return getAccessToken(_0x1718f1)['then'](function(_0x12843b){_0x5cbeab=_0x12843b;return getUser(_0x5cbeab,_0x5f3264,_0x1718f1,_0x4f47f0['email']);})[_0x447b('0x2d')](function(_0x449837){_0x5be141=_0x449837;logger[_0x447b('0x3a')](_0x447b('0x8b'),_0x5be141['id']);return getEndUser(_0x5cbeab,_0x5f3264,_0x1718f1,_0x2788ad[_0x447b('0x95')],_0x2788ad[_0x447b('0x96')],_0x5be141,_0x5be7ef);})[_0x447b('0x2d')](function(_0x3ec8ab){_0x40aebb=_0x3ec8ab;return getCall(_0x5cbeab,_0x5f3264,_0x1718f1,_0x5be141,_0x40aebb,_0x5be7ef,_0x2788ad,'Outbound');})[_0x447b('0x2d')](function(_0x122d6b){if(_0x122d6b){logger[_0x447b('0x3a')](_0x447b('0x8e'),_0x122d6b['id']);logger[_0x447b('0x3a')](_0x447b('0x94'),_0x447b('0x97'));emit(util[_0x447b('0x34')](_0x447b('0x8f'),_0x4f47f0[_0x447b('0x1c')]),_0x447b('0x90'),{'uri':_0x447b('0x98')+_0x1718f1['host']+_0x447b('0x91')+_0x122d6b['id']});}})[_0x447b('0x2f')](function(_0x2e68b9){logger[_0x447b('0x30')](_0x447b('0x94'),JSON[_0x447b('0xe')](_0x2e68b9));});};exports[_0x447b('0x99')]=function(_0x2d5b42,_0x3d8282,_0x168226,_0x4a421b,_0x42ae2b,_0xc33b0b){var _0x46df08,_0xe0fd95,_0x1be650;_0xc33b0b[_0x447b('0x7f')]=intUtil[_0x447b('0x80')](_0xc33b0b['host']);_0xc33b0b[_0x447b('0x81')]=intUtil[_0x447b('0x80')](_0xc33b0b[_0x447b('0x81')]);if(_0x42ae2b&&_0x42ae2b[_0x447b('0x82')]){logger[_0x447b('0x3a')]('['+_0x3d8282['lastevent'][_0x447b('0x9a')]()+']',_0x447b('0x9b'));_0x3d8282[_0x447b('0x84')]=_0xc33b0b[_0x447b('0x81')]+_0x447b('0x85')+_0x3d8282['uniqueid']+_0x447b('0x86')+md5(_0x3d8282[_0x447b('0x87')]);}else{_0x3d8282[_0x447b('0x84')]='';}var _0x8b7715=_0xc33b0b[_0x447b('0x7f')]===_0x447b('0x88')?'eu':_0x447b('0x89');return getAccessToken(_0xc33b0b)['then'](function(_0x6aa125){_0x1be650=_0x6aa125;return getUser(_0x1be650,_0x8b7715,_0xc33b0b);})[_0x447b('0x2d')](function(_0x54c029){_0x46df08=_0x54c029;logger[_0x447b('0x3a')](_0x447b('0x8b'),_0x46df08['id']);return getEndUser(_0x1be650,_0x8b7715,_0xc33b0b,_0x3d8282[_0x447b('0x8c')],_0x3d8282[_0x447b('0x8d')],_0x46df08,_0x168226);})['then'](function(_0x50b388){_0xe0fd95=_0x50b388;return getCall(_0x1be650,_0x8b7715,_0xc33b0b,_0x46df08,_0xe0fd95,_0x168226,_0x3d8282,_0x447b('0x77'));})[_0x447b('0x2d')](function(_0xfd4bc5){if(_0xfd4bc5){logger[_0x447b('0x3a')](_0x447b('0x8e'),_0xfd4bc5['id']);}})['catch'](function(_0x2c1e3f){logger[_0x447b('0x30')]('['+_0x3d8282[_0x447b('0x6b')][_0x447b('0x9a')]()+']',JSON[_0x447b('0xe')](_0x2c1e3f));});}; \ 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 ed4dce3..c353d14 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 _0xeeb1=['data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec'];(function(_0x16783d,_0x366e77){var _0xb8342d=function(_0x1d974c){while(--_0x1d974c){_0x16783d['push'](_0x16783d['shift']());}};_0xb8342d(++_0x366e77);}(_0xeeb1,0x171));var _0x1eeb=function(_0x3a9e73,_0x567a70){_0x3a9e73=_0x3a9e73-0x0;var _0x5af67a=_0xeeb1[_0x3a9e73];return _0x5af67a;};'use strict';var util=require(_0x1eeb('0x0'));var sh=require(_0x1eeb('0x1'));var Mustache=require(_0x1eeb('0x2'));var logger=require(_0x1eeb('0x3'))(_0x1eeb('0x4'));exports[_0x1eeb('0x5')]=function(_0x2bb6c8,_0x3ec190){var _0x4a9bb8=_0x2bb6c8[_0x1eeb('0x6')]?_0x2bb6c8['data2']:_0x1eeb('0x7');var _0x35ab56=_0x2bb6c8['data3']?Mustache[_0x1eeb('0x8')](_0x2bb6c8[_0x1eeb('0x9')],_0x3ec190):_0x3ec190;sh['exec'](_0x35ab56,function(_0x3cba21,_0x29970c,_0x31756d){if(_0x3cba21!==0x0){logger[_0x1eeb('0xa')](util[_0x1eeb('0xb')](_0x1eeb('0xc'),_0x4a9bb8,_0x35ab56,_0x3cba21,_0x31756d));}else{logger[_0x1eeb('0xd')](util['format'](_0x1eeb('0xe'),_0x4a9bb8,_0x35ab56,_0x29970c));}});}; \ No newline at end of file +var _0x2c1e=['data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','util','shelljs','mustache','../../../../config/logger','trigger','exec'];(function(_0x4419b2,_0x195d57){var _0x104853=function(_0x33f71f){while(--_0x33f71f){_0x4419b2['push'](_0x4419b2['shift']());}};_0x104853(++_0x195d57);}(_0x2c1e,0x86));var _0xe2c1=function(_0x495961,_0x288bb8){_0x495961=_0x495961-0x0;var _0x50f161=_0x2c1e[_0x495961];return _0x50f161;};'use strict';var util=require(_0xe2c1('0x0'));var sh=require(_0xe2c1('0x1'));var Mustache=require(_0xe2c1('0x2'));var logger=require(_0xe2c1('0x3'))(_0xe2c1('0x4'));exports[_0xe2c1('0x5')]=function(_0x1e7d08,_0x25a8a1){var _0x506558=_0x1e7d08[_0xe2c1('0x6')]?_0x1e7d08[_0xe2c1('0x6')]:_0xe2c1('0x7');var _0x268462=_0x1e7d08[_0xe2c1('0x8')]?Mustache[_0xe2c1('0x9')](_0x1e7d08['data3'],_0x25a8a1):_0x25a8a1;sh[_0xe2c1('0x5')](_0x268462,function(_0x530731,_0x5e9d97,_0x2f889c){if(_0x530731!==0x0){logger[_0xe2c1('0xa')](util['format'](_0xe2c1('0xb'),_0x506558,_0x268462,_0x530731,_0x2f889c));}else{logger[_0xe2c1('0xc')](util[_0xe2c1('0xd')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x506558,_0x268462,_0x5e9d97));}});}; \ 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 18f2756..de26627 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 _0x5889=['info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','trigger','exec','render','data2','data5','data6','error','stack','data1','toUpperCase','GET','POST','PUT','data7','parse','body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify'];(function(_0x3f1c5e,_0xe5362c){var _0x475515=function(_0x193475){while(--_0x193475){_0x3f1c5e['push'](_0x3f1c5e['shift']());}};_0x475515(++_0xe5362c);}(_0x5889,0x117));var _0x9588=function(_0x4146f0,_0x157c04){_0x4146f0=_0x4146f0-0x0;var _0x4e7394=_0x5889[_0x4146f0];return _0x4e7394;};'use strict';var rp=require(_0x9588('0x0'));var util=require(_0x9588('0x1'));var _=require(_0x9588('0x2'));var Mustache=require(_0x9588('0x3'));var logger=require('../../../../config/logger')(_0x9588('0x4'));exports[_0x9588('0x5')]=function(_0x83f572,_0x32a428){var _0x13c574,_0x5435af;var _0x81ac0d={'method':_0x83f572['data1']['toUpperCase'](),'uri':Mustache[_0x9588('0x6')](_0x83f572[_0x9588('0x7')],_0x32a428),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x83f572[_0x9588('0x8')])==='number'&&parseInt(_0x83f572[_0x9588('0x8')])>=0x1&&parseInt(_0x83f572[_0x9588('0x8')])<=0xa?parseInt(_0x83f572[_0x9588('0x8')])*0x3e8:0x5*0x3e8};try{_0x81ac0d['headers']=_0x83f572[_0x9588('0x9')]?JSON['parse'](Mustache[_0x9588('0x6')](_0x83f572['data6'],_0x32a428)):{};}catch(_0x26d6a1){logger[_0x9588('0xa')](_0x26d6a1[_0x9588('0xb')]);}switch(_0x83f572[_0x9588('0xc')][_0x9588('0xd')]()){case _0x9588('0xe'):case'DELETE':_0x13c574=null;_0x81ac0d['qs']=_0x32a428;break;case _0x9588('0xf'):case _0x9588('0x10'):if(_0x83f572[_0x9588('0x11')]){try{_0x13c574=JSON[_0x9588('0x12')](Mustache[_0x9588('0x6')](_0x83f572['data7'],_0x32a428));_0x81ac0d[_0x9588('0x13')]=_0x13c574;}catch(_0x10c33f){logger['error'](_0x10c33f[_0x9588('0xb')]);logger[_0x9588('0xa')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x13c574=_0x32a428;_0x81ac0d[_0x9588('0x13')]=_0x13c574;}break;}logger['info'](util[_0x9588('0x14')](_0x9588('0x15'),_0x83f572['data1'],_0x83f572['data2'],JSON['stringify'](_0x81ac0d)));rp(_0x81ac0d)[_0x9588('0x16')](function(_0x27932d){_0x13c574=!_[_0x9588('0x17')](_0x13c574)?_0x9588('0x18')+_0x13c574:'';_0x5435af=typeof _0x27932d['body']===_0x9588('0x19')?JSON[_0x9588('0x1a')](_0x27932d[_0x9588('0x13')]):_0x27932d[_0x9588('0x13')];logger[_0x9588('0x1b')](util[_0x9588('0x14')](_0x9588('0x1c'),_0x83f572['data1'],_0x83f572[_0x9588('0x7')],_0x27932d[_0x9588('0x1d')],_0x5435af));})[_0x9588('0x1e')](function(_0x11a8f6){logger[_0x9588('0xa')](util[_0x9588('0x14')](_0x9588('0x1f'),_0x83f572[_0x9588('0xc')],_0x83f572['data2'],_0x11a8f6[_0x9588('0x1d')],_0x11a8f6[_0x9588('0x20')],_0x11a8f6[_0x9588('0x21')]));});}; \ No newline at end of file +var _0xb823=['%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','mustache','../../../../config/logger','trigger','toUpperCase','data2','number','data5','headers','render','data6','stack','data1','DELETE','POST','PUT','data7','parse','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch'];(function(_0x4d89b7,_0xe55f0a){var _0x46dd69=function(_0x30e598){while(--_0x30e598){_0x4d89b7['push'](_0x4d89b7['shift']());}};_0x46dd69(++_0xe55f0a);}(_0xb823,0x19a));var _0x3b82=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0xb823[_0x34d275];return _0x1379cc;};'use strict';var rp=require(_0x3b82('0x0'));var util=require('util');var _=require(_0x3b82('0x1'));var Mustache=require(_0x3b82('0x2'));var logger=require(_0x3b82('0x3'))(_0x3b82('0x4'));exports['exec']=function(_0x3059ad,_0x2a1990){var _0x20e183,_0x2e9123;var _0x5d289b={'method':_0x3059ad['data1'][_0x3b82('0x5')](),'uri':Mustache['render'](_0x3059ad[_0x3b82('0x6')],_0x2a1990),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3059ad['data5'])===_0x3b82('0x7')&&parseInt(_0x3059ad[_0x3b82('0x8')])>=0x1&&parseInt(_0x3059ad[_0x3b82('0x8')])<=0xa?parseInt(_0x3059ad[_0x3b82('0x8')])*0x3e8:0x5*0x3e8};try{_0x5d289b[_0x3b82('0x9')]=_0x3059ad['data6']?JSON['parse'](Mustache[_0x3b82('0xa')](_0x3059ad[_0x3b82('0xb')],_0x2a1990)):{};}catch(_0x4c6227){logger['error'](_0x4c6227[_0x3b82('0xc')]);}switch(_0x3059ad[_0x3b82('0xd')][_0x3b82('0x5')]()){case'GET':case _0x3b82('0xe'):_0x20e183=null;_0x5d289b['qs']=_0x2a1990;break;case _0x3b82('0xf'):case _0x3b82('0x10'):if(_0x3059ad[_0x3b82('0x11')]){try{_0x20e183=JSON[_0x3b82('0x12')](Mustache[_0x3b82('0xa')](_0x3059ad[_0x3b82('0x11')],_0x2a1990));_0x5d289b['body']=_0x20e183;}catch(_0x4ed7de){logger['error'](_0x4ed7de['stack']);logger[_0x3b82('0x13')](_0x3b82('0x14'));}}else{_0x20e183=_0x2a1990;_0x5d289b[_0x3b82('0x15')]=_0x20e183;}break;}logger[_0x3b82('0x16')](util[_0x3b82('0x17')](_0x3b82('0x18'),_0x3059ad[_0x3b82('0xd')],_0x3059ad[_0x3b82('0x6')],JSON['stringify'](_0x5d289b)));rp(_0x5d289b)[_0x3b82('0x19')](function(_0x5f2222){_0x20e183=!_[_0x3b82('0x1a')](_0x20e183)?',\x20request\x20body:\x20'+_0x20e183:'';_0x2e9123=typeof _0x5f2222['body']===_0x3b82('0x1b')?JSON[_0x3b82('0x1c')](_0x5f2222[_0x3b82('0x15')]):_0x5f2222[_0x3b82('0x15')];logger['info'](util[_0x3b82('0x17')](_0x3b82('0x1d'),_0x3059ad[_0x3b82('0xd')],_0x3059ad[_0x3b82('0x6')],_0x5f2222[_0x3b82('0x1e')],_0x2e9123));})[_0x3b82('0x1f')](function(_0xd2dc13){logger[_0x3b82('0x13')](util[_0x3b82('0x17')](_0x3b82('0x20'),_0x3059ad[_0x3b82('0xd')],_0x3059ad['data2'],_0xd2dc13[_0x3b82('0x1e')],_0xd2dc13[_0x3b82('0x21')],_0xd2dc13['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 574bc59..7e92ead 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 _0x3d6e=['bluebird','../../config/logger','routing','client','then','error','rpc','message','result','catch','exports'];(function(_0x424e34,_0x251b53){var _0x5082cb=function(_0x34cee2){while(--_0x34cee2){_0x424e34['push'](_0x424e34['shift']());}};_0x5082cb(++_0x251b53);}(_0x3d6e,0xc6));var _0xe3d6=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x3d6e[_0xc4001c];return _0x49f7bc;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe3d6('0x0'));var logger=require(_0xe3d6('0x1'))(_0xe3d6('0x2'));var client=jayson[_0xe3d6('0x3')]['http']({'port':0x2329});client['Request']=function(_0x57ef08,_0x6de6b3){return new BPromise(function(_0x20e829,_0x28f69d){return client['request'](_0x57ef08,_0x6de6b3)[_0xe3d6('0x4')](function(_0x48699d){logger['debug']('rpc',_0xe3d6('0x2'),_0x57ef08,_0x6de6b3,_0x48699d);if(_0x48699d['error']){logger[_0xe3d6('0x5')](_0xe3d6('0x6'),_0xe3d6('0x2'),_0x57ef08,_0x48699d[_0xe3d6('0x5')][_0xe3d6('0x7')],_0x6de6b3);return _0x28f69d(_0x48699d[_0xe3d6('0x5')][_0xe3d6('0x7')]);}else{return _0x20e829(_0x48699d[_0xe3d6('0x8')]);}})[_0xe3d6('0x9')](function(_0x46ff39){logger['error'](_0xe3d6('0x6'),_0xe3d6('0x2'),_0x57ef08,_0x46ff39,_0x6de6b3);return _0x28f69d(_0x46ff39);});});};module[_0xe3d6('0xa')]=client; \ No newline at end of file +var _0x042d=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','error','message','result','rpc'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x042d,0x16d));var _0xd042=function(_0x5bd1a9,_0x313714){_0x5bd1a9=_0x5bd1a9-0x0;var _0x2ba345=_0x042d[_0x5bd1a9];return _0x2ba345;};'use strict';var jayson=require(_0xd042('0x0'));var BPromise=require(_0xd042('0x1'));var logger=require(_0xd042('0x2'))(_0xd042('0x3'));var client=jayson[_0xd042('0x4')][_0xd042('0x5')]({'port':0x2329});client[_0xd042('0x6')]=function(_0x328810,_0x513e36){return new BPromise(function(_0xa5274b,_0x1c21dc){return client[_0xd042('0x7')](_0x328810,_0x513e36)[_0xd042('0x8')](function(_0x4e84f3){logger['debug']('rpc',_0xd042('0x3'),_0x328810,_0x513e36,_0x4e84f3);if(_0x4e84f3[_0xd042('0x9')]){logger[_0xd042('0x9')]('rpc',_0xd042('0x3'),_0x328810,_0x4e84f3[_0xd042('0x9')][_0xd042('0xa')],_0x513e36);return _0x1c21dc(_0x4e84f3[_0xd042('0x9')][_0xd042('0xa')]);}else{return _0xa5274b(_0x4e84f3[_0xd042('0xb')]);}})['catch'](function(_0x3792f4){logger[_0xd042('0x9')](_0xd042('0xc'),_0xd042('0x3'),_0x328810,_0x3792f4,_0x513e36);return _0x1c21dc(_0x3792f4);});});};module[_0xd042('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1cfd248..1703041 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 _0xcb86=['catch','error','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','getMailAccounts','then','initMailAccounts','refresh','getSettings','loginMailFrequency'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb86,0x11a));var _0x6cb8=function(_0xdcaf6,_0x4779e0){_0xdcaf6=_0xdcaf6-0x0;var _0x3728f0=_0xcb86[_0xdcaf6];return _0x3728f0;};'use strict';var server=require('./server');var Realtime=require(_0x6cb8('0x0'));var EmailChannel=require(_0x6cb8('0x1'));var mailAccount=require(_0x6cb8('0x2'));var setting=require(_0x6cb8('0x3'));var logger=require(_0x6cb8('0x4'))(_0x6cb8('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount[_0x6cb8('0x6')]())[_0x6cb8('0x7')](realtime[_0x6cb8('0x8')]())[_0x6cb8('0x7')](function(){email[_0x6cb8('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x6cb8('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0x6cb8('0xa')]();})[_0x6cb8('0x7')](function(_0x183d59){return setInterval(initRealtime,_0x183d59[_0x6cb8('0xb')]*0x3e8);})[_0x6cb8('0xc')](function(_0x7e834e){logger[_0x6cb8('0xd')]('Email\x20service\x20initialization',_0x7e834e);});}main(); \ No newline at end of file +var _0x1b42=['initMailAccounts','then','mailAccounts','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','getMailAccounts'];(function(_0x1d7ee1,_0x24ee54){var _0x337106=function(_0x520b45){while(--_0x520b45){_0x1d7ee1['push'](_0x1d7ee1['shift']());}};_0x337106(++_0x24ee54);}(_0x1b42,0xd8));var _0x21b4=function(_0x53516a,_0x53d040){_0x53516a=_0x53516a-0x0;var _0x244f7a=_0x1b42[_0x53516a];return _0x244f7a;};'use strict';var server=require(_0x21b4('0x0'));var Realtime=require(_0x21b4('0x1'));var EmailChannel=require(_0x21b4('0x2'));var mailAccount=require(_0x21b4('0x3'));var setting=require(_0x21b4('0x4'));var logger=require(_0x21b4('0x5'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x21b4('0x6')]()['then'](mailAccount[_0x21b4('0x7')]())['then'](realtime[_0x21b4('0x8')]())[_0x21b4('0x9')](function(){email['refresh'](realtime[_0x21b4('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x21b4('0x9')](function(){return initRealtime();})[_0x21b4('0x9')](function(){return setting[_0x21b4('0xb')]();})[_0x21b4('0x9')](function(_0xe8a5bb){return setInterval(initRealtime,_0xe8a5bb[_0x21b4('0xc')]*0x3e8);})[_0x21b4('0xd')](function(_0x5d8012){logger[_0x21b4('0xe')](_0x21b4('0xf'),_0x5d8012);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index d706dd3..f7842f4 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 _0x2a03=['isNil','stringify','refresh','hasOwnProperty','service','provider','imapAccounts','box','handleImapBox','email','bind','end','handleImapEnd','error','disabled','prototype','connected','name','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','smtp','Smtp','verify','exports','lodash','bluebird','md5','../../../config/environment','defaults','redis','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','emit','key','Imap','status','messageStatus'];(function(_0x4e3c40,_0x1da9ec){var _0x387e11=function(_0x2f18f0){while(--_0x2f18f0){_0x4e3c40['push'](_0x4e3c40['shift']());}};_0x387e11(++_0x1da9ec);}(_0x2a03,0xc3));var _0x32a0=function(_0x24403d,_0x94ebf1){_0x24403d=_0x24403d-0x0;var _0x3fabf3=_0x2a03[_0x24403d];return _0x3fabf3;};'use strict';var _=require(_0x32a0('0x0'));var moment=require('moment');var BPromise=require(_0x32a0('0x1'));var md5=require(_0x32a0('0x2'));var Redis=require('ioredis');var config=require(_0x32a0('0x3'));var logger=require('../../../config/logger')('email');config['redis']=_[_0x32a0('0x4')](config[_0x32a0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x32a0('0x6'))(new Redis(config[_0x32a0('0x5')]));var EmailImap=require(_0x32a0('0x7'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x32a0('0x8'));var md5Accounts={};function EmailChannel(_0x5b7675){logger[_0x32a0('0x9')](_0x32a0('0xa'));this[_0x32a0('0xb')]=_0x5b7675[_0x32a0('0xb')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x32a0('0xc')]=function(_0x273f4a){var _0x960eda=this[_0x32a0('0xb')][_0x273f4a];var _0x29c09f={'id':_0x960eda['id'],'name':_0x960eda['name'],'key':_0x960eda[_0x32a0('0xd')],'active':_0x960eda['active'],'Imap':{'status':_0x960eda[_0x32a0('0xe')][_0x32a0('0xf')],'messageStatus':_0x960eda[_0x32a0('0xe')][_0x32a0('0x10')],'total':_0x960eda['Imap']['total']}};if(_[_0x32a0('0x11')](md5Accounts[_0x273f4a])){md5Accounts[_0x273f4a]={};}var _0x1316c9=md5(JSON[_0x32a0('0x12')](_0x29c09f));if(md5Accounts[_0x273f4a][_0x32a0('0x2')]!==_0x1316c9){md5Accounts[_0x273f4a][_0x32a0('0x2')]=_0x1316c9;io['emit']('mailAccount:update',_0x29c09f);}};EmailChannel['prototype'][_0x32a0('0x13')]=function(_0x53c8b6){for(var _0x465639 in _0x53c8b6){if(_0x53c8b6[_0x32a0('0x14')](_0x465639)){if(_0x53c8b6[_0x465639][_0x32a0('0xe')]&&_0x53c8b6[_0x465639]['active']){var _0x2a7979=_0x53c8b6[_0x465639][_0x32a0('0xe')];if(!_0x2a7979[_0x32a0('0x15')]&&_0x53c8b6[_0x465639][_0x32a0('0x16')]!=='custom')_0x2a7979[_0x32a0('0x15')]=_0x53c8b6[_0x465639][_0x32a0('0x16')];if(!this[_0x32a0('0x17')][_0x32a0('0x14')](_0x2a7979['id'])){this[_0x32a0('0x17')][_0x2a7979['id']]=new EmailImap(_0x2a7979,_0x53c8b6[_0x465639]['email']);this[_0x32a0('0x17')][_0x2a7979['id']]['on'](_0x32a0('0x18'),this[_0x32a0('0x19')]['bind'](this,_0x465639));this[_0x32a0('0x17')][_0x2a7979['id']]['on'](_0x32a0('0x1a'),this['handleImapEmail'][_0x32a0('0x1b')](this,_0x465639));this['imapAccounts'][_0x2a7979['id']]['on'](_0x32a0('0x1c'),this[_0x32a0('0x1d')][_0x32a0('0x1b')](this,_0x465639));this[_0x32a0('0x17')][_0x2a7979['id']]['on'](_0x32a0('0x1e'),this['handleImapError']['bind'](this,_0x465639));}}else{if(_[_0x32a0('0x11')](this[_0x32a0('0xb')][_0x465639][_0x32a0('0xe')])){this[_0x32a0('0xb')][_0x465639][_0x32a0('0xe')]={};}this['mailAccounts'][_0x465639][_0x32a0('0xe')][_0x32a0('0xf')]=_0x32a0('0x1f');this[_0x32a0('0xb')][_0x465639][_0x32a0('0xe')][_0x32a0('0x10')]='';this[_0x32a0('0xc')](_0x465639);}}}};EmailChannel[_0x32a0('0x20')][_0x32a0('0x19')]=function(_0x3a440f,_0x5a50cd){if(this[_0x32a0('0xb')][_0x3a440f]){this['mailAccounts'][_0x3a440f][_0x32a0('0xe')][_0x32a0('0xf')]=_0x32a0('0x21');this[_0x32a0('0xb')][_0x3a440f][_0x32a0('0xe')][_0x32a0('0x10')]=_0x5a50cd[_0x32a0('0x22')];if(_0x5a50cd[_0x32a0('0x23')]){this[_0x32a0('0xb')][_0x3a440f][_0x32a0('0xe')][_0x32a0('0x24')]=_0x5a50cd['messages'][_0x32a0('0x24')];}return this[_0x32a0('0xc')](_0x3a440f);}};EmailChannel[_0x32a0('0x20')][_0x32a0('0x25')]=function(_0x1186e6,_0x3bd303){logger[_0x32a0('0x9')](_0x32a0('0x26'),_0x3bd303[_0x32a0('0x27')],_0x3bd303[_0x32a0('0x28')],_0x3bd303['from'],_0x1186e6);if(this['mailAccounts'][_0x1186e6]){return mailAccount[_0x32a0('0x29')](_0x1186e6,_0x3bd303)[_0x32a0('0x2a')](function(_0xede672){if(_0xede672){logger[_0x32a0('0x9')](_0x32a0('0x2b'));}})[_0x32a0('0x2c')](function(_0x3c9f0e){logger[_0x32a0('0x1e')](_0x32a0('0x2d'),JSON[_0x32a0('0x12')](_0x3c9f0e));});}};EmailChannel[_0x32a0('0x20')]['handleImapEnd']=function(_0x179eea){if(this['mailAccounts'][_0x179eea]&&this['mailAccounts'][_0x179eea]['Imap']){if(this[_0x32a0('0x17')][this['mailAccounts'][_0x179eea][_0x32a0('0xe')]['id']]){delete this[_0x32a0('0x17')][this[_0x32a0('0xb')][_0x179eea][_0x32a0('0xe')]['id']];}this['mailAccounts'][_0x179eea]['Imap'][_0x32a0('0x2e')]=moment();this['emit'](_0x179eea);}};EmailChannel[_0x32a0('0x20')][_0x32a0('0x2f')]=function(_0x47a795,_0x29699b){if(this[_0x32a0('0xb')][_0x47a795]){this[_0x32a0('0xb')][_0x47a795][_0x32a0('0xe')][_0x32a0('0xf')]=_0x32a0('0x1e');this[_0x32a0('0xb')][_0x47a795][_0x32a0('0xe')][_0x32a0('0x10')]=_0x29699b;return this[_0x32a0('0xc')](_0x47a795);}};EmailChannel[_0x32a0('0x20')][_0x32a0('0x30')]=function(_0x3c44c5,_0x2fa0a8){return this[_0x32a0('0x31')]['send'](_0x3c44c5,_0x2fa0a8);};EmailChannel['prototype']['verifySmtp']=function(_0x57cf8b){var _0x2a35b8=this;if(this['mailAccounts'][_0x57cf8b['id']]){if(_[_0x32a0('0x11')](this[_0x32a0('0xb')][_0x57cf8b['id']][_0x32a0('0x32')])){this[_0x32a0('0xb')][_0x57cf8b['id']][_0x32a0('0x32')]={};}this[_0x32a0('0xb')][_0x57cf8b['id']][_0x32a0('0x32')][_0x32a0('0x2e')]=moment();return new BPromise(function(_0x5e3dff,_0x57c0e8){return _0x2a35b8[_0x32a0('0x31')][_0x32a0('0x33')](_0x57cf8b)[_0x32a0('0x2a')](function(_0x4edbc3){_0x2a35b8[_0x32a0('0xb')][_0x57cf8b['id']][_0x32a0('0x32')]['status']='verified';_0x2a35b8[_0x32a0('0xb')][_0x57cf8b['id']][_0x32a0('0x32')][_0x32a0('0x10')]='';_0x2a35b8[_0x32a0('0xc')](_0x57cf8b['id']);_0x5e3dff(_0x4edbc3);})[_0x32a0('0x2c')](function(_0x27d70a){_0x2a35b8[_0x32a0('0xb')][_0x57cf8b['id']][_0x32a0('0x32')]['status']=_0x32a0('0x1e');_0x2a35b8['mailAccounts'][_0x57cf8b['id']][_0x32a0('0x32')][_0x32a0('0x10')]=_0x27d70a;_0x2a35b8[_0x32a0('0xc')](_0x57cf8b['id']);_0x57c0e8(_0x27d70a);});});}return this[_0x32a0('0x31')][_0x32a0('0x33')](_0x57cf8b);};module[_0x32a0('0x34')]=EmailChannel; \ No newline at end of file +var _0xf4e8=['exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','messageStatus','isNil','stringify','md5','refresh','hasOwnProperty','provider','custom','service','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','verifySmtp','Smtp','verify','verified'];(function(_0x2454fe,_0x5d12bd){var _0x3c1b9d=function(_0x37a5d3){while(--_0x37a5d3){_0x2454fe['push'](_0x2454fe['shift']());}};_0x3c1b9d(++_0x5d12bd);}(_0xf4e8,0x128));var _0x8f4e=function(_0x443051,_0xe527f6){_0x443051=_0x443051-0x0;var _0x423279=_0xf4e8[_0x443051];return _0x423279;};'use strict';var _=require(_0x8f4e('0x0'));var moment=require(_0x8f4e('0x1'));var BPromise=require(_0x8f4e('0x2'));var md5=require('md5');var Redis=require(_0x8f4e('0x3'));var config=require(_0x8f4e('0x4'));var logger=require(_0x8f4e('0x5'))(_0x8f4e('0x6'));config[_0x8f4e('0x7')]=_[_0x8f4e('0x8')](config[_0x8f4e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x8f4e('0x9'))(new Redis(config[_0x8f4e('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2355ce){logger[_0x8f4e('0xa')](_0x8f4e('0xb'));this[_0x8f4e('0xc')]=_0x2355ce[_0x8f4e('0xc')];this[_0x8f4e('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x8f4e('0xe')][_0x8f4e('0xf')]=function(_0x57c59c){var _0x4ec299=this['mailAccounts'][_0x57c59c];var _0x351062={'id':_0x4ec299['id'],'name':_0x4ec299[_0x8f4e('0x10')],'key':_0x4ec299[_0x8f4e('0x11')],'active':_0x4ec299[_0x8f4e('0x12')],'Imap':{'status':_0x4ec299[_0x8f4e('0x13')][_0x8f4e('0x14')],'messageStatus':_0x4ec299['Imap'][_0x8f4e('0x15')],'total':_0x4ec299[_0x8f4e('0x13')]['total']}};if(_[_0x8f4e('0x16')](md5Accounts[_0x57c59c])){md5Accounts[_0x57c59c]={};}var _0x255ec6=md5(JSON[_0x8f4e('0x17')](_0x351062));if(md5Accounts[_0x57c59c][_0x8f4e('0x18')]!==_0x255ec6){md5Accounts[_0x57c59c][_0x8f4e('0x18')]=_0x255ec6;io['emit']('mailAccount:update',_0x351062);}};EmailChannel[_0x8f4e('0xe')][_0x8f4e('0x19')]=function(_0x1ac242){for(var _0xd10895 in _0x1ac242){if(_0x1ac242[_0x8f4e('0x1a')](_0xd10895)){if(_0x1ac242[_0xd10895][_0x8f4e('0x13')]&&_0x1ac242[_0xd10895]['active']){var _0x2deabb=_0x1ac242[_0xd10895][_0x8f4e('0x13')];if(!_0x2deabb['service']&&_0x1ac242[_0xd10895][_0x8f4e('0x1b')]!==_0x8f4e('0x1c'))_0x2deabb[_0x8f4e('0x1d')]=_0x1ac242[_0xd10895]['provider'];if(!this[_0x8f4e('0xd')][_0x8f4e('0x1a')](_0x2deabb['id'])){this[_0x8f4e('0xd')][_0x2deabb['id']]=new EmailImap(_0x2deabb,_0x1ac242[_0xd10895][_0x8f4e('0x6')]);this['imapAccounts'][_0x2deabb['id']]['on'](_0x8f4e('0x1e'),this[_0x8f4e('0x1f')][_0x8f4e('0x20')](this,_0xd10895));this[_0x8f4e('0xd')][_0x2deabb['id']]['on'](_0x8f4e('0x6'),this[_0x8f4e('0x21')]['bind'](this,_0xd10895));this[_0x8f4e('0xd')][_0x2deabb['id']]['on'](_0x8f4e('0x22'),this[_0x8f4e('0x23')][_0x8f4e('0x20')](this,_0xd10895));this[_0x8f4e('0xd')][_0x2deabb['id']]['on'](_0x8f4e('0x24'),this[_0x8f4e('0x25')]['bind'](this,_0xd10895));}}else{if(_['isNil'](this[_0x8f4e('0xc')][_0xd10895][_0x8f4e('0x13')])){this[_0x8f4e('0xc')][_0xd10895][_0x8f4e('0x13')]={};}this[_0x8f4e('0xc')][_0xd10895][_0x8f4e('0x13')][_0x8f4e('0x14')]=_0x8f4e('0x26');this[_0x8f4e('0xc')][_0xd10895]['Imap'][_0x8f4e('0x15')]='';this[_0x8f4e('0xf')](_0xd10895);}}}};EmailChannel[_0x8f4e('0xe')]['handleImapBox']=function(_0x555cb1,_0x683e63){if(this['mailAccounts'][_0x555cb1]){this[_0x8f4e('0xc')][_0x555cb1]['Imap'][_0x8f4e('0x14')]=_0x8f4e('0x27');this[_0x8f4e('0xc')][_0x555cb1][_0x8f4e('0x13')][_0x8f4e('0x15')]=_0x683e63['name'];if(_0x683e63[_0x8f4e('0x28')]){this[_0x8f4e('0xc')][_0x555cb1][_0x8f4e('0x13')][_0x8f4e('0x29')]=_0x683e63[_0x8f4e('0x28')]['total'];}return this[_0x8f4e('0xf')](_0x555cb1);}};EmailChannel[_0x8f4e('0xe')][_0x8f4e('0x21')]=function(_0x1c2b0c,_0x201cf9){logger[_0x8f4e('0xa')](_0x8f4e('0x2a'),_0x201cf9[_0x8f4e('0x2b')],_0x201cf9[_0x8f4e('0x2c')],_0x201cf9[_0x8f4e('0x2d')],_0x1c2b0c);if(this['mailAccounts'][_0x1c2b0c]){return mailAccount[_0x8f4e('0x2e')](_0x1c2b0c,_0x201cf9)[_0x8f4e('0x2f')](function(_0x42c802){if(_0x42c802){logger[_0x8f4e('0xa')](_0x8f4e('0x30'));}})[_0x8f4e('0x31')](function(_0x31c8fa){logger[_0x8f4e('0x24')](_0x8f4e('0x32'),JSON[_0x8f4e('0x17')](_0x31c8fa));});}};EmailChannel[_0x8f4e('0xe')][_0x8f4e('0x23')]=function(_0x1f6616){if(this[_0x8f4e('0xc')][_0x1f6616]&&this[_0x8f4e('0xc')][_0x1f6616][_0x8f4e('0x13')]){if(this[_0x8f4e('0xd')][this[_0x8f4e('0xc')][_0x1f6616][_0x8f4e('0x13')]['id']]){delete this[_0x8f4e('0xd')][this[_0x8f4e('0xc')][_0x1f6616]['Imap']['id']];}this[_0x8f4e('0xc')][_0x1f6616][_0x8f4e('0x13')][_0x8f4e('0x33')]=moment();this[_0x8f4e('0xf')](_0x1f6616);}};EmailChannel[_0x8f4e('0xe')]['handleImapError']=function(_0xbd1b08,_0x546ae2){if(this['mailAccounts'][_0xbd1b08]){this['mailAccounts'][_0xbd1b08][_0x8f4e('0x13')]['status']=_0x8f4e('0x24');this['mailAccounts'][_0xbd1b08][_0x8f4e('0x13')]['messageStatus']=_0x546ae2;return this['emit'](_0xbd1b08);}};EmailChannel[_0x8f4e('0xe')][_0x8f4e('0x34')]=function(_0x1881b5,_0x24c260){return this[_0x8f4e('0x35')]['send'](_0x1881b5,_0x24c260);};EmailChannel['prototype'][_0x8f4e('0x36')]=function(_0x3134fb){var _0x56e49c=this;if(this[_0x8f4e('0xc')][_0x3134fb['id']]){if(_[_0x8f4e('0x16')](this[_0x8f4e('0xc')][_0x3134fb['id']][_0x8f4e('0x37')])){this[_0x8f4e('0xc')][_0x3134fb['id']][_0x8f4e('0x37')]={};}this[_0x8f4e('0xc')][_0x3134fb['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x5f8458,_0x3a8e8e){return _0x56e49c['smtp'][_0x8f4e('0x38')](_0x3134fb)['then'](function(_0x2cfa64){_0x56e49c['mailAccounts'][_0x3134fb['id']][_0x8f4e('0x37')][_0x8f4e('0x14')]=_0x8f4e('0x39');_0x56e49c[_0x8f4e('0xc')][_0x3134fb['id']][_0x8f4e('0x37')][_0x8f4e('0x15')]='';_0x56e49c['emit'](_0x3134fb['id']);_0x5f8458(_0x2cfa64);})[_0x8f4e('0x31')](function(_0x5010e7){_0x56e49c[_0x8f4e('0xc')][_0x3134fb['id']]['Smtp'][_0x8f4e('0x14')]=_0x8f4e('0x24');_0x56e49c[_0x8f4e('0xc')][_0x3134fb['id']][_0x8f4e('0x37')]['messageStatus']=_0x5010e7;_0x56e49c[_0x8f4e('0xf')](_0x3134fb['id']);_0x3a8e8e(_0x5010e7);});});}return this[_0x8f4e('0x35')]['verify'](_0x3134fb);};module[_0x8f4e('0x3a')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 7a2d719..000ecfd 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 _0x1883=['handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','autotls','required','openBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchError','end','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','handleReady','bind'];(function(_0x377a23,_0x356b71){var _0x24b94f=function(_0x4d7d92){while(--_0x4d7d92){_0x377a23['push'](_0x377a23['shift']());}};_0x24b94f(++_0x356b71);}(_0x1883,0xab));var _0x3188=function(_0x4094d6,_0x4e12c6){_0x4094d6=_0x4094d6-0x0;var _0x2411a7=_0x1883[_0x4094d6];return _0x2411a7;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var Imap=require(_0x3188('0x2'));var simpleParser=require(_0x3188('0x3'))[_0x3188('0x4')];var Iconv=require(_0x3188('0x5'))[_0x3188('0x6')];var EventEmitter=require(_0x3188('0x7'))[_0x3188('0x8')];var utils=require(_0x3188('0x9'));var logger=require(_0x3188('0xa'))(_0x3188('0xb'));function EmailImap(_0x408ae0,_0x33b62d){this[_0x3188('0xc')]=_0x3188('0xd');this[_0x3188('0xe')]=this['getAccount'](_0x408ae0,_0x33b62d);this[_0x3188('0x2')]=new Imap(this[_0x3188('0xe')]);this['imap'][_0x3188('0xf')]('ready',this[_0x3188('0x10')][_0x3188('0x11')](this));this[_0x3188('0x2')][_0x3188('0xf')]('end',this[_0x3188('0x12')][_0x3188('0x11')](this));this['imap']['on']('error',this[_0x3188('0x13')][_0x3188('0x11')](this));this[_0x3188('0x2')][_0x3188('0x14')]();}util[_0x3188('0x15')](EmailImap,EventEmitter);EmailImap[_0x3188('0x16')]['getAccount']=function(_0x276d69,_0x5e0044){var _0x4a2f36={'connTimeout':_0x276d69[_0x3188('0x17')]?_0x276d69['connTimeout']*0x3e8:0x2710,'authTimeout':_0x276d69['authTimeout']?_0x276d69[_0x3188('0x18')]*0x3e8:0x1388};if(_0x276d69[_0x3188('0x19')]){_0x4a2f36[_0x3188('0x1a')]=_0x276d69[_0x3188('0x1a')];_0x4a2f36[_0x3188('0xb')]=_0x5e0044||_0x276d69[_0x3188('0x1a')]||'anonymous@xcally.com';if(_0x276d69[_0x3188('0x1b')]){_0x4a2f36[_0x3188('0x1c')]=utils[_0x3188('0x1d')](_0x276d69[_0x3188('0x1e')][_0x3188('0x1f')],_0x276d69[_0x3188('0x1a')]);}else{_0x4a2f36[_0x3188('0x20')]=_0x276d69[_0x3188('0x20')];}}else{if(_0x276d69['authentication']){_0x4a2f36[_0x3188('0x1a')]=_0x276d69[_0x3188('0x1a')];_0x4a2f36['password']=_0x276d69['password'];}}_0x4a2f36['host']=_0x276d69[_0x3188('0x21')];_0x4a2f36[_0x3188('0x22')]=_0x276d69[_0x3188('0x22')]||0x3e1;if(_0x276d69['tls']){_0x4a2f36['tls']=!![];}else{_0x4a2f36[_0x3188('0x23')]=![];_0x4a2f36[_0x3188('0x24')]=_0x3188('0x25');}return _0x4a2f36;};EmailImap[_0x3188('0x16')][_0x3188('0x10')]=function(){this['imap'][_0x3188('0x26')](this[_0x3188('0xc')],![],this['handleOpenBox'][_0x3188('0x11')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x45ae2f,_0x129bd7){if(_0x45ae2f){this[_0x3188('0x13')](_0x45ae2f,!![]);}else{this[_0x3188('0x27')](_0x3188('0x28'),_0x129bd7);this[_0x3188('0x29')]();}};EmailImap[_0x3188('0x16')][_0x3188('0x2a')]=function(_0x4b4675){if(_0x4b4675){this[_0x3188('0x13')](_0x4b4675,!![]);}else{this[_0x3188('0x2')]['end']();}};EmailImap[_0x3188('0x16')][_0x3188('0x29')]=function(){this[_0x3188('0x2')][_0x3188('0x2b')]([_0x3188('0x2c')],this[_0x3188('0x2d')][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')]['handleReadUnseen']=function(_0x44fa15,_0x5d97d0){if(_0x44fa15){this[_0x3188('0x13')](_0x44fa15,!![]);}else{if(_0x5d97d0['length']){try{var _0x3f82ce=this[_0x3188('0x2')][_0x3188('0x2e')](_0x5d97d0,{'bodies':'','markSeen':!![]});_0x3f82ce['on'](_0x3188('0x2f'),this[_0x3188('0x30')][_0x3188('0x11')](this));_0x3f82ce[_0x3188('0xf')](_0x3188('0x31'),this[_0x3188('0x32')][_0x3188('0x11')](this));_0x3f82ce[_0x3188('0xf')](_0x3188('0x33'),this[_0x3188('0x34')][_0x3188('0x11')](this));}catch(_0xc3f30b){logger[_0x3188('0x31')](_0xc3f30b);}}else{this[_0x3188('0x2')][_0x3188('0x35')](!![],this['handleCloseBox'][_0x3188('0x11')](this));}}};EmailImap['prototype'][_0x3188('0x30')]=function(_0xc75bc6){_0xc75bc6['on']('body',this[_0x3188('0x36')][_0x3188('0x11')](this));_0xc75bc6[_0x3188('0xf')](_0x3188('0x37'),this[_0x3188('0x38')][_0x3188('0x11')](this));_0xc75bc6[_0x3188('0xf')]('end',this['handleMessageEnd'][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')][_0x3188('0x36')]=function(_0x1aa732){simpleParser(_0x1aa732,{'Iconv':Iconv},this['handleSimpleParser'][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')][_0x3188('0x38')]=function(){};EmailImap[_0x3188('0x16')]['handleMessageEnd']=function(){};EmailImap[_0x3188('0x16')]['handleSimpleParser']=function(_0x130e73,_0x57895f){if(_0x130e73){logger[_0x3188('0x31')](_0x130e73);}else{var _0x361a09=this;utils[_0x3188('0x39')](this[_0x3188('0xe')],_0x57895f,function(_0x22f8da){_0x361a09[_0x3188('0x27')](_0x3188('0xb'),_0x22f8da);});}};EmailImap[_0x3188('0x16')][_0x3188('0x34')]=function(){this[_0x3188('0x2')]['closeBox'](!![],this[_0x3188('0x2a')][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')][_0x3188('0x32')]=function(_0x7b2f4b){this[_0x3188('0x13')](_0x7b2f4b);this['imap'][_0x3188('0x35')](!![],this['handleCloseBox'][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')][_0x3188('0x12')]=function(){this[_0x3188('0x27')](_0x3188('0x33'));};EmailImap['prototype']['handleError']=function(_0x59069f,_0x4e6db6){logger['error'](_0x3188('0x13'),this[_0x3188('0xe')][_0x3188('0xb')],JSON[_0x3188('0x3a')](_0x59069f));var _0x9b70b1='';if(_0x59069f){if(_0x59069f['textCode']){_0x9b70b1=_0x59069f[_0x3188('0x3b')];}else{for(var _0x4e2b9c in _0x59069f){if(_0x59069f[_0x3188('0x3c')](_0x4e2b9c)){_0x9b70b1+=_[_0x3188('0x3d')](_0x4e2b9c)+':\x20'+_0x59069f[_0x4e2b9c]+'\x0a';}}}}if(_0x4e6db6){this[_0x3188('0x2')][_0x3188('0x33')]();}else{this['emit'](_0x3188('0x31'),_0x9b70b1);this[_0x3188('0x27')](_0x3188('0x33'));}};module[_0x3188('0x3e')]=EmailImap; \ No newline at end of file +var _0xd8fb=['emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','end','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','handleFetchEnd','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','lodash','util','imap','mailparser','events','EventEmitter','../../../config/logger','email','INBOX','getAccount','once','ready','handleReady','bind','error','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','generateXOAuth2Token','CloudProvider','password','host','port','tls','autotls','required','openBox','mailbox','handleOpenBox','handleError'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0xd8fb,0x99));var _0xbd8f=function(_0x156665,_0x35d549){_0x156665=_0x156665-0x0;var _0x10875d=_0xd8fb[_0x156665];return _0x10875d;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var Imap=require(_0xbd8f('0x2'));var simpleParser=require(_0xbd8f('0x3'))['simpleParser'];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0xbd8f('0x4'))[_0xbd8f('0x5')];var utils=require('./utils');var logger=require(_0xbd8f('0x6'))(_0xbd8f('0x7'));function EmailImap(_0x5543b2,_0x33d541){this['mailbox']=_0xbd8f('0x8');this['account']=this[_0xbd8f('0x9')](_0x5543b2,_0x33d541);this[_0xbd8f('0x2')]=new Imap(this['account']);this['imap'][_0xbd8f('0xa')](_0xbd8f('0xb'),this[_0xbd8f('0xc')]['bind'](this));this[_0xbd8f('0x2')][_0xbd8f('0xa')]('end',this['handleEnd'][_0xbd8f('0xd')](this));this[_0xbd8f('0x2')]['on'](_0xbd8f('0xe'),this['handleError'][_0xbd8f('0xd')](this));this[_0xbd8f('0x2')][_0xbd8f('0xf')]();}util[_0xbd8f('0x10')](EmailImap,EventEmitter);EmailImap[_0xbd8f('0x11')][_0xbd8f('0x9')]=function(_0x37d4d5,_0x29ffe8){var _0x14606c={'connTimeout':_0x37d4d5['connTimeout']?_0x37d4d5[_0xbd8f('0x12')]*0x3e8:0x2710,'authTimeout':_0x37d4d5[_0xbd8f('0x13')]?_0x37d4d5[_0xbd8f('0x13')]*0x3e8:0x1388};if(_0x37d4d5[_0xbd8f('0x14')]){_0x14606c['user']=_0x37d4d5[_0xbd8f('0x15')];_0x14606c[_0xbd8f('0x7')]=_0x29ffe8||_0x37d4d5['user']||_0xbd8f('0x16');if(_0x37d4d5[_0xbd8f('0x17')]){_0x14606c['xoauth2']=utils[_0xbd8f('0x18')](_0x37d4d5[_0xbd8f('0x19')]['data5'],_0x37d4d5['user']);}else{_0x14606c[_0xbd8f('0x1a')]=_0x37d4d5['password'];}}else{if(_0x37d4d5['authentication']){_0x14606c[_0xbd8f('0x15')]=_0x37d4d5['user'];_0x14606c[_0xbd8f('0x1a')]=_0x37d4d5[_0xbd8f('0x1a')];}}_0x14606c[_0xbd8f('0x1b')]=_0x37d4d5[_0xbd8f('0x1b')];_0x14606c[_0xbd8f('0x1c')]=_0x37d4d5[_0xbd8f('0x1c')]||0x3e1;if(_0x37d4d5[_0xbd8f('0x1d')]){_0x14606c[_0xbd8f('0x1d')]=!![];}else{_0x14606c[_0xbd8f('0x1d')]=![];_0x14606c[_0xbd8f('0x1e')]=_0xbd8f('0x1f');}return _0x14606c;};EmailImap[_0xbd8f('0x11')][_0xbd8f('0xc')]=function(){this[_0xbd8f('0x2')][_0xbd8f('0x20')](this[_0xbd8f('0x21')],![],this[_0xbd8f('0x22')]['bind'](this));};EmailImap[_0xbd8f('0x11')][_0xbd8f('0x22')]=function(_0x1f9fcc,_0x2f3df7){if(_0x1f9fcc){this[_0xbd8f('0x23')](_0x1f9fcc,!![]);}else{this[_0xbd8f('0x24')](_0xbd8f('0x25'),_0x2f3df7);this[_0xbd8f('0x26')]();}};EmailImap['prototype'][_0xbd8f('0x27')]=function(_0x421f3e){if(_0x421f3e){this['handleError'](_0x421f3e,!![]);}else{this[_0xbd8f('0x2')]['end']();}};EmailImap[_0xbd8f('0x11')][_0xbd8f('0x26')]=function(){this[_0xbd8f('0x2')][_0xbd8f('0x28')]([_0xbd8f('0x29')],this[_0xbd8f('0x2a')]['bind'](this));};EmailImap[_0xbd8f('0x11')][_0xbd8f('0x2a')]=function(_0x39714d,_0x3ee851){if(_0x39714d){this[_0xbd8f('0x23')](_0x39714d,!![]);}else{if(_0x3ee851[_0xbd8f('0x2b')]){try{var _0x2a4b32=this['imap'][_0xbd8f('0x2c')](_0x3ee851,{'bodies':'','markSeen':!![]});_0x2a4b32['on'](_0xbd8f('0x2d'),this[_0xbd8f('0x2e')][_0xbd8f('0xd')](this));_0x2a4b32['once']('error',this[_0xbd8f('0x2f')][_0xbd8f('0xd')](this));_0x2a4b32[_0xbd8f('0xa')](_0xbd8f('0x30'),this['handleFetchEnd'][_0xbd8f('0xd')](this));}catch(_0x1f550a){logger[_0xbd8f('0xe')](_0x1f550a);}}else{this[_0xbd8f('0x2')][_0xbd8f('0x31')](!![],this['handleCloseBox'][_0xbd8f('0xd')](this));}}};EmailImap[_0xbd8f('0x11')][_0xbd8f('0x2e')]=function(_0x3949c2){_0x3949c2['on'](_0xbd8f('0x32'),this['handleMessageBody'][_0xbd8f('0xd')](this));_0x3949c2['once'](_0xbd8f('0x33'),this[_0xbd8f('0x34')][_0xbd8f('0xd')](this));_0x3949c2[_0xbd8f('0xa')](_0xbd8f('0x30'),this[_0xbd8f('0x35')]['bind'](this));};EmailImap['prototype']['handleMessageBody']=function(_0x22d1de){simpleParser(_0x22d1de,{'Iconv':Iconv},this[_0xbd8f('0x36')][_0xbd8f('0xd')](this));};EmailImap[_0xbd8f('0x11')][_0xbd8f('0x34')]=function(){};EmailImap[_0xbd8f('0x11')][_0xbd8f('0x35')]=function(){};EmailImap[_0xbd8f('0x11')][_0xbd8f('0x36')]=function(_0x2a6145,_0x3d4c9a){if(_0x2a6145){logger[_0xbd8f('0xe')](_0x2a6145);}else{var _0x26133b=this;utils[_0xbd8f('0x37')](this[_0xbd8f('0x38')],_0x3d4c9a,function(_0x50e081){_0x26133b[_0xbd8f('0x24')](_0xbd8f('0x7'),_0x50e081);});}};EmailImap['prototype'][_0xbd8f('0x39')]=function(){this[_0xbd8f('0x2')][_0xbd8f('0x31')](!![],this['handleCloseBox'][_0xbd8f('0xd')](this));};EmailImap['prototype'][_0xbd8f('0x2f')]=function(_0x32f7d5){this[_0xbd8f('0x23')](_0x32f7d5);this['imap'][_0xbd8f('0x31')](!![],this[_0xbd8f('0x27')][_0xbd8f('0xd')](this));};EmailImap['prototype'][_0xbd8f('0x3a')]=function(){this[_0xbd8f('0x24')](_0xbd8f('0x30'));};EmailImap[_0xbd8f('0x11')][_0xbd8f('0x23')]=function(_0x1db8c7,_0x25f054){logger[_0xbd8f('0xe')](_0xbd8f('0x23'),this['account']['email'],JSON[_0xbd8f('0x3b')](_0x1db8c7));var _0x1070cb='';if(_0x1db8c7){if(_0x1db8c7[_0xbd8f('0x3c')]){_0x1070cb=_0x1db8c7[_0xbd8f('0x3c')];}else{for(var _0x5e9f71 in _0x1db8c7){if(_0x1db8c7[_0xbd8f('0x3d')](_0x5e9f71)){_0x1070cb+=_[_0xbd8f('0x3e')](_0x5e9f71)+':\x20'+_0x1db8c7[_0x5e9f71]+'\x0a';}}}}if(_0x25f054){this[_0xbd8f('0x2')][_0xbd8f('0x30')]();}else{this[_0xbd8f('0x24')]('error',_0x1070cb);this['emit'](_0xbd8f('0x30'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index cebf2f8..d17f0fb 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 _0x64bc=['nodemailer','nodemailer-plugin-inline-base64','prototype','sendMail','toString','verify','createTransport','Not\x20verifired','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x64bc,0xe1));var _0xc64b=function(_0x50ab32,_0x35b324){_0x50ab32=_0x50ab32-0x0;var _0x2d9ae6=_0x64bc[_0x50ab32];return _0x2d9ae6;};'use strict';var nodemailer=require(_0xc64b('0x0'));var inlineBase64=require(_0xc64b('0x1'));function EmailSmtp(){}EmailSmtp[_0xc64b('0x2')]['send']=function(_0x2d454f,_0x4e47a4){return new Promise(function(_0x5e21a6,_0x4453c4){var _0x3c8431=nodemailer['createTransport'](_0x2d454f);_0x3c8431['use']('compile',inlineBase64());_0x3c8431[_0xc64b('0x3')](_0x4e47a4,function(_0x48e992,_0x45c590){if(_0x48e992){_0x4453c4(_0x48e992[_0xc64b('0x4')]());}else{_0x5e21a6(_0x45c590);}});});};EmailSmtp[_0xc64b('0x2')][_0xc64b('0x5')]=function(_0x26fdbc){return new Promise(function(_0x4689a6,_0x25c37d){var _0x28ea87=nodemailer[_0xc64b('0x6')](_0x26fdbc);_0x28ea87[_0xc64b('0x5')](function(_0x4d11dc,_0x432ca3){if(_0x4d11dc){_0x25c37d(_0x4d11dc[_0xc64b('0x4')]());}else{if(_0x432ca3){_0x4689a6(_0x432ca3);}else{_0x25c37d(_0xc64b('0x7'));}}});});};module[_0xc64b('0x8')]=EmailSmtp; \ No newline at end of file +var _0x2662=['send','createTransport','use','compile','sendMail','toString','prototype','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2662,0xdb));var _0x2266=function(_0x5b0656,_0xf352ba){_0x5b0656=_0x5b0656-0x0;var _0x12c142=_0x2662[_0x5b0656];return _0x12c142;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x2266('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x2266('0x1')]=function(_0x4ab55f,_0x16cba0){return new Promise(function(_0x300b6f,_0x2f74ce){var _0x220f2f=nodemailer[_0x2266('0x2')](_0x4ab55f);_0x220f2f[_0x2266('0x3')](_0x2266('0x4'),inlineBase64());_0x220f2f[_0x2266('0x5')](_0x16cba0,function(_0x1ac063,_0x4c7f26){if(_0x1ac063){_0x2f74ce(_0x1ac063[_0x2266('0x6')]());}else{_0x300b6f(_0x4c7f26);}});});};EmailSmtp[_0x2266('0x7')][_0x2266('0x8')]=function(_0x213bda){return new Promise(function(_0x2077e0,_0x2ce40c){var _0x66f5f1=nodemailer[_0x2266('0x2')](_0x213bda);_0x66f5f1[_0x2266('0x8')](function(_0x3b2a52,_0x1f2b96){if(_0x3b2a52){_0x2ce40c(_0x3b2a52['toString']());}else{if(_0x1f2b96){_0x2077e0(_0x1f2b96);}else{_0x2ce40c(_0x2266('0x9'));}}});});};module[_0x2266('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 4c4f607..1c5d6ce 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 _0xbf79=['attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Precedence:\x20auto_reply','line','isAutoreply','from','subject','messageId','date','textAsHtml','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','node-tnef','email','../../../config/environment','address','anonymous','generate','@xcally.com','head','value','name','substring','indexOf','split','length','join','pop','isEmpty','test','html','replace','\x20[Attachment:\x20','body','0x1?_0x19724d['slice'](0x0,-0x1)[_0x9bf7('0x12')]('\x20'):_0xb6b532[_0x9bf7('0xd')];}return'Anonymous';}function getLastName(_0x471110){var _0x5de747=_[_0x9bf7('0xb')](_0x471110['value']);if(_0x5de747&&_0x5de747[_0x9bf7('0xd')]){var _0xda7ca7=_0x5de747['name'][_0x9bf7('0x10')](/\s+/);return _0xda7ca7[_0x9bf7('0x11')]>0x1?_0xda7ca7[_0x9bf7('0x13')]():'';}return'';}function getMails(_0x29c955,_0x3fbf1e){var _0x4293a1='';for(var _0x236e20=0x0;_0x236e20<_0x3fbf1e[_0x9bf7('0xc')]['length'];_0x236e20+=0x1){if(_0x3fbf1e[_0x9bf7('0xc')][_0x236e20][_0x9bf7('0x7')]!==_0x29c955){if(!_[_0x9bf7('0x14')](_0x4293a1)){_0x4293a1+=',';}_0x4293a1+=_0x3fbf1e[_0x9bf7('0xc')][_0x236e20]['name']||_0x3fbf1e['value'][_0x236e20]['address']||'';_0x4293a1+='\x20<';_0x4293a1+=_0x3fbf1e[_0x9bf7('0xc')][_0x236e20][_0x9bf7('0x7')]?_0x3fbf1e[_0x9bf7('0xc')][_0x236e20]['address']:_0x9bf7('0x8')+random[_0x9bf7('0x9')](0x6)+_0x9bf7('0xa');_0x4293a1+='>';}}return _0x4293a1;}function parseEmail(_0x4a4b5e,_0x234e3f,_0x3c8680){if(_0x234e3f['html']){var _0x16c801=/)<[^<]*)*<\/script>/gi;while(_0x16c801[_0x9bf7('0x15')](_0x234e3f[_0x9bf7('0x16')])){_0x234e3f[_0x9bf7('0x16')]=_0x234e3f[_0x9bf7('0x16')][_0x9bf7('0x17')](_0x16c801,'');}if(_0x234e3f[_0x9bf7('0x16')]['includes'](_0x9bf7('0x18'))){var _0x4a5ded=[];_0x234e3f[_0x9bf7('0x19')][_0x9bf7('0x1a')](_0x5dffaf=>{_0x4a5ded[_0x9bf7('0x1b')](_0x5dffaf[_0x9bf7('0x1c')]);});var _0x4dbb1b=/]+>/g;var _0xbaae1c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4a507b=_0x234e3f[_0x9bf7('0x16')][_0x9bf7('0x17')](_0xbaae1c,_0x9bf7('0x1d'));var _0x161bab=_0x4a507b[_0x9bf7('0x17')](_0x4dbb1b,_0x9bf7('0x1e'));for(let _0x320b10=0x0;_0x320b10<_0x4a5ded[_0x9bf7('0x11')];_0x320b10++){var _0x2cfe66=_0x161bab['replace'](_0x9bf7('0x1e'),_0x9bf7('0x1f')+_0x4a5ded[_0x320b10]+'\x20]');_0x161bab=_0x2cfe66;}_0x234e3f['html']=_0x161bab;}_0x3c8680['body']=_0x234e3f[_0x9bf7('0x16')];}else{_0x3c8680[_0x9bf7('0x20')]=_0x234e3f['textAsHtml'];}if(_0x3c8680[_0x9bf7('0x20')]){_0x3c8680['body']=_0x3c8680[_0x9bf7('0x20')][_0x9bf7('0x17')](/0x0){var _0x31a8d9=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All',_0x9bf7('0x31')];for(var _0x4fac38=0x0;_0x4fac38<_0x234e3f[_0x9bf7('0x30')][_0x9bf7('0x11')];_0x4fac38++){var _0x10444e=_[_0x9bf7('0xf')](_0x31a8d9,_0x234e3f[_0x9bf7('0x30')][_0x4fac38][_0x9bf7('0x32')]);if(_0x10444e>=0x0){_0x3c8680[_0x9bf7('0x33')]=!![];}}}return _0x3c8680;}exports['parser']=function(_0x3bf207,_0x368ab7,_0xe0be4c){var _0x421f0f={'from':getAddress(_0x368ab7[_0x9bf7('0x34')]),'firstName':getFirstName(_0x368ab7['from']),'lastName':getLastName(_0x368ab7[_0x9bf7('0x34')]),'mapKey':_0x9bf7('0x5'),'message':{'from':getMails(_0x3bf207[_0x9bf7('0x5')],_0x368ab7['from']),'to':_0x3bf207[_0x9bf7('0x5')],'cc':'','subject':_0x368ab7[_0x9bf7('0x35')]||'','messageId':_0x368ab7[_0x9bf7('0x36')],'inReplyTo':_0x368ab7['inReplyTo'],'sentAt':moment(_0x368ab7[_0x9bf7('0x37')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x368ab7[_0x9bf7('0x16')]&&!_0x368ab7[_0x9bf7('0x38')]){var _0x1d996e=_[_0x9bf7('0x39')](_0x368ab7[_0x9bf7('0x19')],{'contentType':_0x9bf7('0x3a')});if(_0x1d996e[_0x9bf7('0x11')]){logger[_0x9bf7('0x3b')](util['format'](_0x9bf7('0x3c'),_0x368ab7[_0x9bf7('0x36')]));tnef[_0x9bf7('0x3d')](_['first'](_0x1d996e)[_0x9bf7('0x2e')],function(_0x5343f8,_0x32d5ca){if(_0x32d5ca){_0x368ab7[_0x9bf7('0x16')]=_0x32d5ca[_0x9bf7('0x3e')]||_0x9bf7('0x3f');if(_0x32d5ca[_0x9bf7('0x40')]){for(var _0x329d7e=0x0;_0x329d7e<_0x32d5ca[_0x9bf7('0x40')]['length'];_0x329d7e++){var _0x1093e5=_0x32d5ca[_0x9bf7('0x40')][_0x329d7e];_0x421f0f['message'][_0x9bf7('0x19')][_0x9bf7('0x1b')]({'filename':_0x1093e5[_0x9bf7('0x41')],'content':Buffer[_0x9bf7('0x34')](_0x1093e5[_0x9bf7('0x42')])});}}}_0xe0be4c(parseEmail(_0x3bf207,_0x368ab7,_0x421f0f));});}else{_0x368ab7[_0x9bf7('0x16')]=_0x9bf7('0x3f');_0xe0be4c(parseEmail(_0x3bf207,_0x368ab7,_0x421f0f));}}else{_0xe0be4c(parseEmail(_0x3bf207,_0x368ab7,_0x421f0f));}};exports[_0x9bf7('0x43')]=function(_0x5e0cd8,_0x4761b6){var _0x156f62=[_0x9bf7('0x44')+(_0x4761b6||''),'auth=Bearer\x20'+_0x5e0cd8,'',''];return Buffer[_0x9bf7('0x34')](_0x156f62[_0x9bf7('0x12')](''),_0x9bf7('0x45'))[_0x9bf7('0x46')](_0x9bf7('0x47'));}; \ No newline at end of file +var _0xc192=['subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','

Empty\x20message

','Attachments','Title','Data','user=','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','indexOf','split','join','Anonymous','length','pop','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x3b7ad9['slice'](0x0,-0x1)[_0x2c19('0x12')]('\x20'):_0x1b42d0['name'];}return _0x2c19('0x13');}function getLastName(_0x3913fc){var _0x38efbd=_[_0x2c19('0x9')](_0x3913fc[_0x2c19('0xa')]);if(_0x38efbd&&_0x38efbd['name']){var _0x3d31f6=_0x38efbd[_0x2c19('0xf')][_0x2c19('0x11')](/\s+/);return _0x3d31f6[_0x2c19('0x14')]>0x1?_0x3d31f6[_0x2c19('0x15')]():'';}return'';}function getMails(_0x116136,_0x360f2a){var _0x3a7c0c='';for(var _0x4b2e2d=0x0;_0x4b2e2d<_0x360f2a[_0x2c19('0xa')]['length'];_0x4b2e2d+=0x1){if(_0x360f2a[_0x2c19('0xa')][_0x4b2e2d]['address']!==_0x116136){if(!_[_0x2c19('0x16')](_0x3a7c0c)){_0x3a7c0c+=',';}_0x3a7c0c+=_0x360f2a['value'][_0x4b2e2d][_0x2c19('0xf')]||_0x360f2a['value'][_0x4b2e2d][_0x2c19('0xb')]||'';_0x3a7c0c+='\x20<';_0x3a7c0c+=_0x360f2a['value'][_0x4b2e2d]['address']?_0x360f2a[_0x2c19('0xa')][_0x4b2e2d]['address']:_0x2c19('0xc')+random['generate'](0x6)+_0x2c19('0xe');_0x3a7c0c+='>';}}return _0x3a7c0c;}function parseEmail(_0x39e996,_0x14c92d,_0x111293){if(_0x14c92d[_0x2c19('0x17')]){var _0x34ead3=/)<[^<]*)*<\/script>/gi;while(_0x34ead3[_0x2c19('0x18')](_0x14c92d['html'])){_0x14c92d['html']=_0x14c92d[_0x2c19('0x17')][_0x2c19('0x19')](_0x34ead3,'');}if(_0x14c92d[_0x2c19('0x17')][_0x2c19('0x1a')](_0x2c19('0x1b'))){var _0x415d33=[];_0x14c92d[_0x2c19('0x1c')]['forEach'](_0x5957b6=>{_0x415d33['push'](_0x5957b6[_0x2c19('0x1d')]);});var _0x42c9aa=/]+>/g;var _0x9f1b55=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4c54b3=_0x14c92d[_0x2c19('0x17')][_0x2c19('0x19')](_0x9f1b55,_0x2c19('0x1e'));var _0x3a868d=_0x4c54b3[_0x2c19('0x19')](_0x42c9aa,_0x2c19('0x1f'));for(let _0x457bc5=0x0;_0x457bc5<_0x415d33['length'];_0x457bc5++){var _0x481644=_0x3a868d[_0x2c19('0x19')](_0x2c19('0x1f'),_0x2c19('0x20')+_0x415d33[_0x457bc5]+_0x2c19('0x21'));_0x3a868d=_0x481644;}_0x14c92d[_0x2c19('0x17')]=_0x3a868d;}_0x111293[_0x2c19('0x22')]=_0x14c92d[_0x2c19('0x17')];}else{_0x111293[_0x2c19('0x22')]=_0x14c92d['textAsHtml'];}if(_0x111293[_0x2c19('0x22')]){_0x111293['body']=_0x111293['body'][_0x2c19('0x19')](/0x0){var _0xe7bca7=[_0x2c19('0x33'),_0x2c19('0x34'),_0x2c19('0x35')];for(var _0x1edc6b=0x0;_0x1edc6b<_0x14c92d['headerLines'][_0x2c19('0x14')];_0x1edc6b++){var _0x599e0f=_[_0x2c19('0x10')](_0xe7bca7,_0x14c92d[_0x2c19('0x36')][_0x1edc6b][_0x2c19('0x37')]);if(_0x599e0f>=0x0){_0x111293[_0x2c19('0x38')]=!![];}}}return _0x111293;}exports[_0x2c19('0x39')]=function(_0x372d4a,_0x2e9d6d,_0x5aed8f){var _0x20009d={'from':getAddress(_0x2e9d6d[_0x2c19('0x3a')]),'firstName':getFirstName(_0x2e9d6d[_0x2c19('0x3a')]),'lastName':getLastName(_0x2e9d6d[_0x2c19('0x3a')]),'mapKey':_0x2c19('0x7'),'message':{'from':getMails(_0x372d4a['email'],_0x2e9d6d[_0x2c19('0x3a')]),'to':_0x372d4a[_0x2c19('0x7')],'cc':'','subject':_0x2e9d6d[_0x2c19('0x3b')]||'','messageId':_0x2e9d6d[_0x2c19('0x3c')],'inReplyTo':_0x2e9d6d[_0x2c19('0x3d')],'sentAt':moment(_0x2e9d6d[_0x2c19('0x3e')])['format'](_0x2c19('0x3f')),'attach':![],'attachments':[]}};if(!_0x2e9d6d[_0x2c19('0x17')]&&!_0x2e9d6d[_0x2c19('0x40')]){var _0x2e4fa5=_[_0x2c19('0x41')](_0x2e9d6d[_0x2c19('0x1c')],{'contentType':'application/ms-tnef'});if(_0x2e4fa5[_0x2c19('0x14')]){logger[_0x2c19('0x42')](util[_0x2c19('0x2b')](_0x2c19('0x43'),_0x2e9d6d[_0x2c19('0x3c')]));tnef['parseBuffer'](_['first'](_0x2e4fa5)['content'],function(_0x3775ec,_0x39034d){if(_0x39034d){_0x2e9d6d[_0x2c19('0x17')]=_0x39034d[_0x2c19('0x44')]||_0x2c19('0x45');if(_0x39034d['Attachments']){for(var _0x162383=0x0;_0x162383<_0x39034d[_0x2c19('0x46')]['length'];_0x162383++){var _0x4c56e9=_0x39034d['Attachments'][_0x162383];_0x20009d['message'][_0x2c19('0x1c')][_0x2c19('0x31')]({'filename':_0x4c56e9[_0x2c19('0x47')],'content':Buffer[_0x2c19('0x3a')](_0x4c56e9[_0x2c19('0x48')])});}}}_0x5aed8f(parseEmail(_0x372d4a,_0x2e9d6d,_0x20009d));});}else{_0x2e9d6d[_0x2c19('0x17')]=_0x2c19('0x45');_0x5aed8f(parseEmail(_0x372d4a,_0x2e9d6d,_0x20009d));}}else{_0x5aed8f(parseEmail(_0x372d4a,_0x2e9d6d,_0x20009d));}};exports['generateXOAuth2Token']=function(_0x3abe66,_0x556a39){var _0x1c78f8=[_0x2c19('0x49')+(_0x556a39||''),'auth=Bearer\x20'+_0x3abe66,'',''];return Buffer[_0x2c19('0x3a')](_0x1c78f8[_0x2c19('0x12')](''),'utf-8')[_0x2c19('0x4a')](_0x2c19('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index a5ae4b5..8cf6a4f 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 _0x6877=['lodash','name','key','active','Imap','Smtp','exports'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x6877,0x1dc));var _0x7687=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x6877[_0x223461];return _0x4dbe0a;};'use strict';var _=require(_0x7687('0x0'));function MailAccount(_0x34524d){this['id']=_0x34524d['id']||0x0;this[_0x7687('0x1')]=_0x34524d[_0x7687('0x1')]||'Service';this[_0x7687('0x2')]=_0x34524d[_0x7687('0x2')]||'SERV';this[_0x7687('0x3')]=_0x34524d['active']||![];this[_0x7687('0x4')]=_0x34524d[_0x7687('0x4')]||[];this[_0x7687('0x5')]=_0x34524d[_0x7687('0x5')]||[];}module[_0x7687('0x6')]=MailAccount; \ No newline at end of file +var _0xbdfb=['key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x5aad86,_0x2cd1f2){var _0x6bbd68=function(_0x501e99){while(--_0x501e99){_0x5aad86['push'](_0x5aad86['shift']());}};_0x6bbd68(++_0x2cd1f2);}(_0xbdfb,0x1be));var _0xbbdf=function(_0x52ae40,_0x23c2bf){_0x52ae40=_0x52ae40-0x0;var _0xab6ed1=_0xbdfb[_0x52ae40];return _0xab6ed1;};'use strict';var _=require(_0xbbdf('0x0'));function MailAccount(_0x43a8e4){this['id']=_0x43a8e4['id']||0x0;this[_0xbbdf('0x1')]=_0x43a8e4[_0xbbdf('0x1')]||'Service';this[_0xbbdf('0x2')]=_0x43a8e4['key']||_0xbbdf('0x3');this['active']=_0x43a8e4[_0xbbdf('0x4')]||![];this[_0xbbdf('0x5')]=_0x43a8e4[_0xbbdf('0x5')]||[];this['Smtp']=_0x43a8e4[_0xbbdf('0x6')]||[];}module[_0xbbdf('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 4b95740..7c53abf 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 _0x9db2=['mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined','merge','exports','../model/mailAccount','mailAccounts'];(function(_0x552e94,_0x110f92){var _0x12587b=function(_0x36c87e){while(--_0x36c87e){_0x552e94['push'](_0x552e94['shift']());}};_0x12587b(++_0x110f92);}(_0x9db2,0x6c));var _0x29db=function(_0x1ef547,_0x31bfdb){_0x1ef547=_0x1ef547-0x0;var _0x1d697b=_0x9db2[_0x1ef547];return _0x1d697b;};'use strict';var _=require('lodash');var MailAccount=require(_0x29db('0x0'));var Realtime=function(){this[_0x29db('0x1')]={};};function freeIsNotKey(_0x38989c,_0x1cd0d8,_0x21405e){var _0x398835=_[_0x29db('0x2')](_0x38989c,function(_0x5bdf20,_0x5923dc){return _0x5bdf20[_0x21405e];});for(var _0x2b2106 in _0x1cd0d8){if(_0x1cd0d8[_0x29db('0x3')](_0x2b2106)){if(!_0x398835[_0x2b2106]){delete _0x1cd0d8[_0x2b2106];}}}}Realtime['prototype'][_0x29db('0x4')]=function(_0x5c58e5,_0x55c659){for(var _0x42406f in _0x55c659){if(_0x5c58e5[_0x29db('0x3')](_0x42406f)){_0x5c58e5[_0x42406f]=_0x55c659[_0x42406f];}}};Realtime[_0x29db('0x5')][_0x29db('0x6')]=function(){var _0x366fa7=this;return function(_0x13d46e){if(_0x13d46e){freeIsNotKey(_0x13d46e,_0x366fa7[_0x29db('0x1')],'id');for(var _0x4d0fd1=0x0,_0xffc55d={},_0x48aed6={};_0x4d0fd1<_0x13d46e[_0x29db('0x7')];_0x4d0fd1+=0x1){_0xffc55d=_0x13d46e[_0x4d0fd1];if(_[_0x29db('0x8')](_0x366fa7[_0x29db('0x1')][_0xffc55d['id']])){_0x366fa7[_0x29db('0x1')][_0xffc55d['id']]=new MailAccount(_0xffc55d);}else{_[_0x29db('0x9')](_0x366fa7['mailAccounts'][_0xffc55d['id']],_0xffc55d);}}}return _0x366fa7[_0x29db('0x1')];};};module[_0x29db('0xa')]=Realtime; \ No newline at end of file +var _0xed81=['../model/mailAccount','mailAccounts','hasOwnProperty','prototype','length','isUndefined','exports','lodash'];(function(_0x159a6f,_0x574c3a){var _0x2120f3=function(_0x5a460b){while(--_0x5a460b){_0x159a6f['push'](_0x159a6f['shift']());}};_0x2120f3(++_0x574c3a);}(_0xed81,0xd7));var _0x1ed8=function(_0x12c346,_0x20321a){_0x12c346=_0x12c346-0x0;var _0x522e4=_0xed81[_0x12c346];return _0x522e4;};'use strict';var _=require(_0x1ed8('0x0'));var MailAccount=require(_0x1ed8('0x1'));var Realtime=function(){this[_0x1ed8('0x2')]={};};function freeIsNotKey(_0x417d9e,_0x420992,_0x2b5ffc){var _0xc73ace=_['mapKeys'](_0x417d9e,function(_0x5e6d6e,_0x50f314){return _0x5e6d6e[_0x2b5ffc];});for(var _0x1609c0 in _0x420992){if(_0x420992[_0x1ed8('0x3')](_0x1609c0)){if(!_0xc73ace[_0x1609c0]){delete _0x420992[_0x1609c0];}}}}Realtime[_0x1ed8('0x4')]['mergeFromDatabase']=function(_0x20537a,_0x37e59a){for(var _0x1f44bb in _0x37e59a){if(_0x20537a['hasOwnProperty'](_0x1f44bb)){_0x20537a[_0x1f44bb]=_0x37e59a[_0x1f44bb];}}};Realtime[_0x1ed8('0x4')]['initMailAccounts']=function(){var _0xaf059f=this;return function(_0x49b792){if(_0x49b792){freeIsNotKey(_0x49b792,_0xaf059f['mailAccounts'],'id');for(var _0x1bc275=0x0,_0x35180b={},_0x17e135={};_0x1bc275<_0x49b792[_0x1ed8('0x5')];_0x1bc275+=0x1){_0x35180b=_0x49b792[_0x1bc275];if(_[_0x1ed8('0x6')](_0xaf059f[_0x1ed8('0x2')][_0x35180b['id']])){_0xaf059f[_0x1ed8('0x2')][_0x35180b['id']]=new MailAccount(_0x35180b);}else{_['merge'](_0xaf059f['mailAccounts'][_0x35180b['id']],_0x35180b);}}}return _0xaf059f['mailAccounts'];};};module[_0x1ed8('0x7')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index a4f0e79..bc3f208 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 _0xe635=['data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type'];(function(_0x2e7a43,_0x3b3df4){var _0x52e9e1=function(_0x2c08cf){while(--_0x2c08cf){_0x2e7a43['push'](_0x2e7a43['shift']());}};_0x52e9e1(++_0x3b3df4);}(_0xe635,0x1be));var _0x5e63=function(_0x46ec25,_0x1d7ada){_0x46ec25=_0x46ec25-0x0;var _0x5d9119=_0xe635[_0x46ec25];return _0x5d9119;};'use strict';var client=require(_0x5e63('0x0'));exports[_0x5e63('0x1')]=function(){return function(){return client[_0x5e63('0x2')](_0x5e63('0x3'),{'options':{'attributes':['id',_0x5e63('0x4'),_0x5e63('0x5'),_0x5e63('0x6'),'email','active',_0x5e63('0x7'),_0x5e63('0x8'),_0x5e63('0x9')],'raw':![],'include':[{'model':_0x5e63('0xa'),'as':_0x5e63('0xb'),'include':[{'model':_0x5e63('0xc'),'attributes':['id',_0x5e63('0x4'),_0x5e63('0x6'),_0x5e63('0xd'),_0x5e63('0xe')],'as':'CloudProvider'}]},{'model':_0x5e63('0xf'),'as':_0x5e63('0x10'),'include':[{'model':_0x5e63('0xc'),'attributes':['id',_0x5e63('0x4'),'service',_0x5e63('0xd'),_0x5e63('0xe')],'as':'CloudProvider'}]}]},'log':_0x5e63('0x11')});};};exports[_0x5e63('0x12')]=function(_0x5c5733,_0xf39dbd){return client['Request'](_0x5e63('0x13'),{'account':{'id':_0x5c5733},'body':_0xf39dbd,'log':_0x5e63('0x13')});}; \ No newline at end of file +var _0x71ad=['../client','getMailAccounts','GetMailAccount','provider','service','active','TemplateId','Imap','CloudProvider','name','type','data5','Smtp','getMailAccount','notify','Request','NotifyMailAccount'];(function(_0x6d9611,_0x197ae0){var _0x512b7a=function(_0x455bbd){while(--_0x455bbd){_0x6d9611['push'](_0x6d9611['shift']());}};_0x512b7a(++_0x197ae0);}(_0x71ad,0xee));var _0xd71a=function(_0x334edb,_0x1d15ec){_0x334edb=_0x334edb-0x0;var _0x403127=_0x71ad[_0x334edb];return _0x403127;};'use strict';var client=require(_0xd71a('0x0'));exports[_0xd71a('0x1')]=function(){return function(){return client['Request'](_0xd71a('0x2'),{'options':{'attributes':['id','name',_0xd71a('0x3'),_0xd71a('0x4'),'email',_0xd71a('0x5'),'key','ListId',_0xd71a('0x6')],'raw':![],'include':[{'model':'MailServerIn','as':_0xd71a('0x7'),'include':[{'model':_0xd71a('0x8'),'attributes':['id',_0xd71a('0x9'),_0xd71a('0x4'),_0xd71a('0xa'),_0xd71a('0xb')],'as':_0xd71a('0x8')}]},{'model':'MailServerOut','as':_0xd71a('0xc'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xd71a('0x4'),_0xd71a('0xa'),_0xd71a('0xb')],'as':_0xd71a('0x8')}]}]},'log':_0xd71a('0xd')});};};exports[_0xd71a('0xe')]=function(_0x396c5e,_0x377297){return client[_0xd71a('0xf')](_0xd71a('0x10'),{'account':{'id':_0x396c5e},'body':_0x377297,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 11b48b5..787d795 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 _0x3345=['getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x536510,_0x2a0f2d){var _0xcb6bb4=function(_0xf99fca){while(--_0xf99fca){_0x536510['push'](_0x536510['shift']());}};_0xcb6bb4(++_0x2a0f2d);}(_0x3345,0xdc));var _0x5334=function(_0x2edb70,_0x12a185){_0x2edb70=_0x2edb70-0x0;var _0x36ebd4=_0x3345[_0x2edb70];return _0x36ebd4;};'use strict';var client=require('../client');exports[_0x5334('0x0')]=function(){return client[_0x5334('0x1')](_0x5334('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5334('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xc997=['Request','../client','getSettings'];(function(_0x29fea0,_0x14a659){var _0x11178a=function(_0x34b52d){while(--_0x34b52d){_0x29fea0['push'](_0x29fea0['shift']());}};_0x11178a(++_0x14a659);}(_0xc997,0x151));var _0x7c99=function(_0x455f78,_0x5d3a90){_0x455f78=_0x455f78-0x0;var _0x586ab7=_0xc997[_0x455f78];return _0x586ab7;};'use strict';var client=require(_0x7c99('0x0'));exports[_0x7c99('0x1')]=function(){return client[_0x7c99('0x2')]('ShowSetting',{'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 94b36e5..3a0d9a6 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 54b983d..a72835a 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 _0x3e47=['localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','timeout','listen','socket.io','redis'];(function(_0x35c26c,_0xaf5f3c){var _0x3717d0=function(_0x91721b){while(--_0x91721b){_0x35c26c['push'](_0x35c26c['shift']());}};_0x3717d0(++_0xaf5f3c);}(_0x3e47,0x75));var _0x73e4=function(_0x2247ab,_0x3f4162){_0x2247ab=_0x2247ab-0x0;var _0x430062=_0x3e47[_0x2247ab];return _0x430062;};'use strict';var _=require(_0x73e4('0x0'));var http=require('http');var express=require(_0x73e4('0x1'));var sticky=require(_0x73e4('0x2'));var Redis=require(_0x73e4('0x3'));var config=require(_0x73e4('0x4'));var app=express();var server=http['createServer'](app);server[_0x73e4('0x5')]=0xdbba0;if(sticky[_0x73e4('0x6')](server,config['port'])){var socketio=require(_0x73e4('0x7'))(server,{'transports':['websocket','polling']});config[_0x73e4('0x8')]=_['defaults'](config[_0x73e4('0x8')],{'host':_0x73e4('0x9'),'port':0x18eb});socketio[_0x73e4('0xa')](require(_0x73e4('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x73e4('0xc'))[_0x73e4('0xd')]();require(_0x73e4('0xe'))[_0x73e4('0xd')](socketio);require(_0x73e4('0xf'))[_0x73e4('0xd')](app);require(_0x73e4('0x10'))['default'](app);}else{server['once'](_0x73e4('0x11'),function(){console[_0x73e4('0x12')](_0x73e4('0x13'),config['port']);});}exports=module[_0x73e4('0x14')]=app; \ No newline at end of file +var _0x9d8c=['../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','timeout','listen','port','socket.io','websocket','polling','redis','defaults','adapter','socket.io-redis','../../config/triggers','default'];(function(_0x31bf0f,_0x3fa4b3){var _0x83fb23=function(_0x6bd877){while(--_0x6bd877){_0x31bf0f['push'](_0x31bf0f['shift']());}};_0x83fb23(++_0x3fa4b3);}(_0x9d8c,0xbe));var _0xc9d8=function(_0x4120cf,_0x18afc4){_0x4120cf=_0x4120cf-0x0;var _0x3e7c89=_0x9d8c[_0x4120cf];return _0x3e7c89;};'use strict';var _=require(_0xc9d8('0x0'));var http=require(_0xc9d8('0x1'));var express=require(_0xc9d8('0x2'));var sticky=require(_0xc9d8('0x3'));var Redis=require(_0xc9d8('0x4'));var config=require(_0xc9d8('0x5'));var app=express();var server=http['createServer'](app);server[_0xc9d8('0x6')]=0xdbba0;if(sticky[_0xc9d8('0x7')](server,config[_0xc9d8('0x8')])){var socketio=require(_0xc9d8('0x9'))(server,{'transports':[_0xc9d8('0xa'),_0xc9d8('0xb')]});config[_0xc9d8('0xc')]=_[_0xc9d8('0xd')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0xc9d8('0xe')](require(_0xc9d8('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xc9d8('0xc')])}));require(_0xc9d8('0x10'))[_0xc9d8('0x11')]();require(_0xc9d8('0x12'))[_0xc9d8('0x11')](socketio);require(_0xc9d8('0x13'))[_0xc9d8('0x11')](app);require(_0xc9d8('0x14'))[_0xc9d8('0x11')](app);}else{server[_0xc9d8('0x15')](_0xc9d8('0x16'),function(){console[_0xc9d8('0x17')](_0xc9d8('0x18'),config[_0xc9d8('0x8')]);});}exports=module[_0xc9d8('0x19')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 49b945e..334c466 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 _0x88bd=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','rpc','error','message'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x88bd,0xaa));var _0xd88b=function(_0x6000cf,_0x3b66f2){_0x6000cf=_0x6000cf-0x0;var _0x4ddf3f=_0x88bd[_0x6000cf];return _0x4ddf3f;};'use strict';var jayson=require(_0xd88b('0x0'));var BPromise=require(_0xd88b('0x1'));var logger=require(_0xd88b('0x2'))(_0xd88b('0x3'));var client=jayson[_0xd88b('0x4')][_0xd88b('0x5')]({'port':0x2329});client[_0xd88b('0x6')]=function(_0x420735,_0x81578e){return new BPromise(function(_0x5dd6e0,_0x3abe5e){return client[_0xd88b('0x7')](_0x420735,_0x81578e)[_0xd88b('0x8')](function(_0x4abc3f){logger['debug'](_0xd88b('0x9'),_0xd88b('0x3'),_0x420735,_0x81578e,_0x4abc3f);if(_0x4abc3f[_0xd88b('0xa')]){logger[_0xd88b('0xa')]('rpc','routing',_0x420735,_0x4abc3f[_0xd88b('0xa')]['message'],_0x81578e);return _0x3abe5e(_0x4abc3f['error'][_0xd88b('0xb')]);}else{return _0x5dd6e0(_0x4abc3f['result']);}})['catch'](function(_0x14b521){logger['error'](_0xd88b('0x9'),_0xd88b('0x3'),_0x420735,_0x14b521,_0x81578e);return _0x3abe5e(_0x14b521);});});};module[_0xd88b('0xc')]=client; \ No newline at end of file +var _0x8290=['debug','rpc','error','message','exports','bluebird','routing','http','Request','request','then'];(function(_0x598ac2,_0xe03174){var _0x53a774=function(_0x187bca){while(--_0x187bca){_0x598ac2['push'](_0x598ac2['shift']());}};_0x53a774(++_0xe03174);}(_0x8290,0x1c8));var _0x0829=function(_0x2f14d6,_0x5db8da){_0x2f14d6=_0x2f14d6-0x0;var _0x2bdaa9=_0x8290[_0x2f14d6];return _0x2bdaa9;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x0829('0x0'));var logger=require('../../config/logger')(_0x0829('0x1'));var client=jayson['client'][_0x0829('0x2')]({'port':0x2329});client[_0x0829('0x3')]=function(_0x1eebc6,_0x56df0a){return new BPromise(function(_0x34231e,_0x312350){return client[_0x0829('0x4')](_0x1eebc6,_0x56df0a)[_0x0829('0x5')](function(_0x21f4f2){logger[_0x0829('0x6')](_0x0829('0x7'),'routing',_0x1eebc6,_0x56df0a,_0x21f4f2);if(_0x21f4f2[_0x0829('0x8')]){logger[_0x0829('0x8')](_0x0829('0x7'),_0x0829('0x1'),_0x1eebc6,_0x21f4f2[_0x0829('0x8')][_0x0829('0x9')],_0x56df0a);return _0x312350(_0x21f4f2[_0x0829('0x8')][_0x0829('0x9')]);}else{return _0x34231e(_0x21f4f2['result']);}})['catch'](function(_0x5be029){logger[_0x0829('0x8')](_0x0829('0x7'),_0x0829('0x1'),_0x1eebc6,_0x5be029,_0x56df0a);return _0x312350(_0x5be029);});});};module[_0x0829('0xa')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index b46cdaf..a579d03 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 _0x4cfe=['getMailQueues','initMailQueues','getFaxQueues','initWhatsappQueues','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues'];(function(_0x41df01,_0x4d9a1b){var _0x5dadd8=function(_0x144c12){while(--_0x144c12){_0x41df01['push'](_0x41df01['shift']());}};_0x5dadd8(++_0x4d9a1b);}(_0x4cfe,0x1c8));var _0xe4cf=function(_0x43efe1,_0x10df04){_0x43efe1=_0x43efe1-0x0;var _0x25a7e4=_0x4cfe[_0x43efe1];return _0x25a7e4;};'use strict';var BPromise=require(_0xe4cf('0x0'));var server=require(_0xe4cf('0x1'));var Realtime=require('./realtime');var user=require(_0xe4cf('0x2'));var interval=require(_0xe4cf('0x3'));var openchannelQueue=require(_0xe4cf('0x4'));var chatQueue=require(_0xe4cf('0x5'));var smsQueue=require(_0xe4cf('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xe4cf('0x7'));var whatsappQueue=require(_0xe4cf('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe4cf('0x9')]()[_0xe4cf('0xa')](user['getAgents']())['then'](realtime[_0xe4cf('0xb')]())[_0xe4cf('0xa')](interval[_0xe4cf('0xc')]())['then'](realtime[_0xe4cf('0xd')]())[_0xe4cf('0xa')](openchannelQueue[_0xe4cf('0xe')]())[_0xe4cf('0xa')](realtime[_0xe4cf('0xf')]())[_0xe4cf('0xa')](chatQueue[_0xe4cf('0x10')]())[_0xe4cf('0xa')](realtime[_0xe4cf('0x11')]())[_0xe4cf('0xa')](smsQueue[_0xe4cf('0x12')]())[_0xe4cf('0xa')](realtime['initSmsQueues']())['then'](mailQueue[_0xe4cf('0x13')]())[_0xe4cf('0xa')](realtime[_0xe4cf('0x14')]())[_0xe4cf('0xa')](faxQueue[_0xe4cf('0x15')]())['then'](realtime['initFaxQueues']())[_0xe4cf('0xa')](whatsappQueue['getWhatsappQueues']())[_0xe4cf('0xa')](realtime[_0xe4cf('0x16')]())[_0xe4cf('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x269678){return initRealtime();})[_0xe4cf('0xa')](function(_0x2aa029){return setInterval(initRealtime,0x1388);})[_0xe4cf('0x17')](function(_0x24da60){console[_0xe4cf('0x18')](_0x24da60);});}main(); \ No newline at end of file +var _0x2c35=['getMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues'];(function(_0x25fd89,_0x13e268){var _0x4aa313=function(_0x5daa2b){while(--_0x5daa2b){_0x25fd89['push'](_0x25fd89['shift']());}};_0x4aa313(++_0x13e268);}(_0x2c35,0x6e));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x52c3('0x0'));var server=require(_0x52c3('0x1'));var Realtime=require(_0x52c3('0x2'));var user=require(_0x52c3('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x52c3('0x4'));var chatQueue=require(_0x52c3('0x5'));var smsQueue=require(_0x52c3('0x6'));var mailQueue=require(_0x52c3('0x7'));var faxQueue=require(_0x52c3('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x52c3('0x9')]()['then'](user[_0x52c3('0xa')]())[_0x52c3('0xb')](realtime[_0x52c3('0xc')]())['then'](interval[_0x52c3('0xd')]())[_0x52c3('0xb')](realtime[_0x52c3('0xe')]())[_0x52c3('0xb')](openchannelQueue[_0x52c3('0xf')]())[_0x52c3('0xb')](realtime['initOpenchannelQueues']())[_0x52c3('0xb')](chatQueue[_0x52c3('0x10')]())[_0x52c3('0xb')](realtime[_0x52c3('0x11')]())[_0x52c3('0xb')](smsQueue[_0x52c3('0x12')]())[_0x52c3('0xb')](realtime[_0x52c3('0x13')]())[_0x52c3('0xb')](mailQueue[_0x52c3('0x14')]())['then'](realtime['initMailQueues']())[_0x52c3('0xb')](faxQueue[_0x52c3('0x15')]())['then'](realtime[_0x52c3('0x16')]())['then'](whatsappQueue['getWhatsappQueues']())[_0x52c3('0xb')](realtime[_0x52c3('0x17')]())[_0x52c3('0xb')](function(){return realtime;});}function main(){return server[_0x52c3('0x18')](realtime)[_0x52c3('0xb')](function(_0x5f02b9){return initRealtime();})[_0x52c3('0xb')](function(_0x254343){return setInterval(initRealtime,0x1388);})[_0x52c3('0x19')](function(_0x3c9d0a){console['log'](_0x3c9d0a);});}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 27e7a34..3249660 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x57e2a2,_0x7a6e20){var _0x4d683d=function(_0x37a32c){while(--_0x37a32c){_0x57e2a2['push'](_0x57e2a2['shift']());}};_0x4d683d(++_0x7a6e20);}(_0xe14b,0x93));var _0xbe14=function(_0x2d3328,_0x1eb37c){_0x2d3328=_0x2d3328-0x0;var _0x2cd3bb=_0xe14b[_0x2d3328];return _0x2cd3bb;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x1f02f7,_0x44506b){var _0x5c104c=function(_0x9991cf){while(--_0x9991cf){_0x1f02f7['push'](_0x1f02f7['shift']());}};_0x5c104c(++_0x44506b);}(_0xe14b,0x93));var _0xbe14=function(_0x495d6b,_0x3c5fd0){_0x495d6b=_0x495d6b-0x0;var _0x1c2204=_0xe14b[_0x495d6b];return _0x1c2204;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1666dcb..7366649 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 _0x17f4=['then','error','message','bluebird','jayson/promise','client'];(function(_0x544baa,_0x1b17fe){var _0x5e8cc1=function(_0x1b55dc){while(--_0x1b55dc){_0x544baa['push'](_0x544baa['shift']());}};_0x5e8cc1(++_0x1b17fe);}(_0x17f4,0x153));var _0x417f=function(_0x4de9a5,_0x267a09){_0x4de9a5=_0x4de9a5-0x0;var _0xd240ae=_0x17f4[_0x4de9a5];return _0xd240ae;};'use strict';var BPromise=require(_0x417f('0x0'));var jayson=require(_0x417f('0x1'));var client=jayson[_0x417f('0x2')]['http']({'port':0x232b});function request(_0x5e9e15,_0x2b0c7e){return new BPromise(function(_0x2b84d5,_0x4c0425){return client['request'](_0x5e9e15,_0x2b0c7e)[_0x417f('0x3')](function(_0x319593){if(_0x319593[_0x417f('0x4')]){return _0x4c0425(_0x319593['error'][_0x417f('0x5')]);}else{return _0x2b84d5(_0x319593['result']);}})['catch'](function(_0x590447){return _0x4c0425(_0x590447);});});}exports['sendMailMessage']=function(_0x4730c3,_0x31045b){return request('SendMail',{'account':_0x4730c3,'message':_0x31045b});}; \ No newline at end of file +var _0x4033=['jayson/promise','client','http','request','then','error','message','result','catch','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4033,0x95));var _0x3403=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0x4033[_0x380af2];return _0x1789dc;};'use strict';var BPromise=require(_0x3403('0x0'));var jayson=require(_0x3403('0x1'));var client=jayson[_0x3403('0x2')][_0x3403('0x3')]({'port':0x232b});function request(_0x2296cf,_0x24fa27){return new BPromise(function(_0x210855,_0x16d3aa){return client[_0x3403('0x4')](_0x2296cf,_0x24fa27)[_0x3403('0x5')](function(_0x139d4e){if(_0x139d4e[_0x3403('0x6')]){return _0x16d3aa(_0x139d4e['error'][_0x3403('0x7')]);}else{return _0x210855(_0x139d4e[_0x3403('0x8')]);}})[_0x3403('0x9')](function(_0x2677eb){return _0x16d3aa(_0x2677eb);});});}exports['sendMailMessage']=function(_0xe17cbc,_0x4cbdca){return request('SendMail',{'account':_0xe17cbc,'message':_0x4cbdca});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 13e35e8..89ff7bb 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 _0x08bf=['localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','working','chat','openchannel','fax','sms','whatsapp','StatusTime','format','chatStatusTime','faxStatusTime','smsCurrentCapacity','openchannelStatusTime','openchannelCurrentCapacity','stringify','emit','lodash','moment','md5','ioredis','../../../config/environment','redis'];(function(_0x3e514b,_0x117c42){var _0x186061=function(_0x5a9135){while(--_0x5a9135){_0x3e514b['push'](_0x3e514b['shift']());}};_0x186061(++_0x117c42);}(_0x08bf,0x112));var _0xf08b=function(_0x46b53c,_0xcd2a21){_0x46b53c=_0x46b53c-0x0;var _0x4db929=_0x08bf[_0x46b53c];return _0x4db929;};'use strict';var _=require(_0xf08b('0x0'));var moment=require(_0xf08b('0x1'));var md5=require(_0xf08b('0x2'));var Redis=require(_0xf08b('0x3'));var config=require(_0xf08b('0x4'));config[_0xf08b('0x5')]=_['defaults'](config[_0xf08b('0x5')],{'host':_0xf08b('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf08b('0x5')]));function Agent(_0x1531b8){this['id']=_0x1531b8['id']||0x0;this[_0xf08b('0x7')]=_0x1531b8[_0xf08b('0x7')]||'';this[_0xf08b('0x8')]=_0x1531b8[_0xf08b('0x8')]||!![];this['voicePause']=_0x1531b8[_0xf08b('0x9')]||![];this[_0xf08b('0xa')]=_0x1531b8[_0xf08b('0xa')]||![];this[_0xf08b('0xb')]=_0x1531b8[_0xf08b('0xb')]||![];this[_0xf08b('0xc')]=_0x1531b8[_0xf08b('0xc')]||![];this['smsPause']=_0x1531b8[_0xf08b('0xd')]||![];this[_0xf08b('0xe')]=_0x1531b8['openchannelPause']||![];this[_0xf08b('0xf')]='unknown';this['chatStatusTime']=0x0;this['chatCapacity']=_0x1531b8[_0xf08b('0x10')]||0x0;this[_0xf08b('0x11')]=0x0;this[_0xf08b('0x12')]=_0xf08b('0x13');this[_0xf08b('0x14')]=0x0;this['mailCapacity']=_0x1531b8[_0xf08b('0x15')]||0x0;this[_0xf08b('0x16')]=0x0;this[_0xf08b('0x17')]=_0xf08b('0x13');this['faxStatusTime']=0x0;this[_0xf08b('0x18')]=_0x1531b8[_0xf08b('0x18')]||0x0;this[_0xf08b('0x19')]=0x0;this[_0xf08b('0x1a')]='unknown';this[_0xf08b('0x1b')]=0x0;this[_0xf08b('0x1c')]=_0x1531b8[_0xf08b('0x1c')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xf08b('0x1d')]='unknown';this[_0xf08b('0x1e')]=0x0;this[_0xf08b('0x1f')]=_0x1531b8[_0xf08b('0x1f')]||0x0;this[_0xf08b('0x20')]=0x0;this[_0xf08b('0x21')]='unknown';this['openchannelStatusTime']=0x0;this[_0xf08b('0x22')]=_0x1531b8[_0xf08b('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xf08b('0x23')]=![];this[_0xf08b('0x24')]=undefined;this[_0xf08b('0x2')]='';this[_0xf08b('0x25')]();}Agent[_0xf08b('0x26')]['getChannelStatus']=function(_0x1cd935){if(this[_0x1cd935+_0xf08b('0x27')]>0x0){if(this[_0x1cd935+_0xf08b('0x28')]>0x0&&this[_0x1cd935+_0xf08b('0x27')]>=this[_0x1cd935+_0xf08b('0x28')]){return'maxcapacity';}else{return _0xf08b('0x29');}}else{return'idle';}};Agent[_0xf08b('0x26')][_0xf08b('0x25')]=function(){var _0x2c9367=['mail',_0xf08b('0x2a'),_0xf08b('0x2b'),_0xf08b('0x2c'),_0xf08b('0x2d'),_0xf08b('0x2e')];for(var _0x3e83c5=0x0;_0x3e83c5<_0x2c9367['length'];_0x3e83c5+=0x1){var _0x95dd62=this['getChannelStatus'](_0x2c9367[_0x3e83c5]);if(this[_0x2c9367[_0x3e83c5]+'Status']!==_0x95dd62){this[_0x2c9367[_0x3e83c5]+_0xf08b('0x2f')]=_['toNumber'](moment()[_0xf08b('0x30')]('x'));}this[_0x2c9367[_0x3e83c5]+'Status']=_0x95dd62;}var _0xd22a4={'id':this['id'],'name':this[_0xf08b('0x7')],'online':this[_0xf08b('0x8')],'voicePause':this[_0xf08b('0x9')],'chatPause':this[_0xf08b('0xa')],'mailPause':this[_0xf08b('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0xf08b('0xc')],'openchannelPause':this[_0xf08b('0xe')],'chatStatus':this[_0xf08b('0xf')],'chatStatusTime':this[_0xf08b('0x31')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xf08b('0x11')],'mailStatus':this[_0xf08b('0x12')],'mailStatusTime':this[_0xf08b('0x14')],'mailCapacity':this[_0xf08b('0x15')],'mailCurrentCapacity':this[_0xf08b('0x16')],'faxStatus':this[_0xf08b('0x17')],'faxStatusTime':this[_0xf08b('0x32')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xf08b('0x1a')],'smsStatusTime':this[_0xf08b('0x1b')],'smsCapacity':this[_0xf08b('0x1c')],'smsCurrentCapacity':this[_0xf08b('0x33')],'whatsappStatus':this[_0xf08b('0x1d')],'whatsappStatusTime':this[_0xf08b('0x1e')],'whatsappCapacity':this[_0xf08b('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xf08b('0x21')],'openchannelStatusTime':this[_0xf08b('0x34')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf08b('0x35')],'busy':this['busy'],'busyQueue':this[_0xf08b('0x24')]};var _0x2499dd=md5(JSON[_0xf08b('0x36')](_0xd22a4));if(this[_0xf08b('0x2')]!==_0x2499dd){this[_0xf08b('0x2')]=_0x2499dd;io[_0xf08b('0x37')]('user:save',_0xd22a4);}};module['exports']=Agent; \ No newline at end of file +var _0x867a=['voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','sms','length','getChannelStatus','toNumber','format','mailCurrentCapacity','openchannelCurrentCapacity','stringify','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online'];(function(_0x19fd0b,_0x47bd3c){var _0x174d52=function(_0xc9f8d8){while(--_0xc9f8d8){_0x19fd0b['push'](_0x19fd0b['shift']());}};_0x174d52(++_0x47bd3c);}(_0x867a,0x15d));var _0xa867=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x867a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa867('0x0'));var moment=require(_0xa867('0x1'));var md5=require(_0xa867('0x2'));var Redis=require(_0xa867('0x3'));var config=require(_0xa867('0x4'));config['redis']=_[_0xa867('0x5')](config[_0xa867('0x6')],{'host':_0xa867('0x7'),'port':0x18eb});var io=require(_0xa867('0x8'))(new Redis(config[_0xa867('0x6')]));function Agent(_0xd13a7a){this['id']=_0xd13a7a['id']||0x0;this[_0xa867('0x9')]=_0xd13a7a[_0xa867('0x9')]||'';this[_0xa867('0xa')]=_0xd13a7a[_0xa867('0xa')]||!![];this[_0xa867('0xb')]=_0xd13a7a['voicePause']||![];this[_0xa867('0xc')]=_0xd13a7a[_0xa867('0xc')]||![];this[_0xa867('0xd')]=_0xd13a7a[_0xa867('0xd')]||![];this['faxPause']=_0xd13a7a[_0xa867('0xe')]||![];this[_0xa867('0xf')]=_0xd13a7a[_0xa867('0xf')]||![];this[_0xa867('0x10')]=_0xd13a7a[_0xa867('0x10')]||![];this[_0xa867('0x11')]=_0xa867('0x12');this[_0xa867('0x13')]=0x0;this[_0xa867('0x14')]=_0xd13a7a[_0xa867('0x14')]||0x0;this[_0xa867('0x15')]=0x0;this[_0xa867('0x16')]=_0xa867('0x12');this[_0xa867('0x17')]=0x0;this['mailCapacity']=_0xd13a7a[_0xa867('0x18')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xa867('0x19')]=_0xa867('0x12');this[_0xa867('0x1a')]=0x0;this[_0xa867('0x1b')]=_0xd13a7a[_0xa867('0x1b')]||0x0;this[_0xa867('0x1c')]=0x0;this[_0xa867('0x1d')]=_0xa867('0x12');this[_0xa867('0x1e')]=0x0;this['smsCapacity']=_0xd13a7a[_0xa867('0x1f')]||0x0;this[_0xa867('0x20')]=0x0;this[_0xa867('0x21')]=_0xa867('0x12');this[_0xa867('0x22')]=0x0;this[_0xa867('0x23')]=_0xd13a7a['whatsappCapacity']||0x0;this[_0xa867('0x24')]=0x0;this[_0xa867('0x25')]=_0xa867('0x12');this[_0xa867('0x26')]=0x0;this[_0xa867('0x27')]=_0xd13a7a['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xa867('0x28')]=![];this[_0xa867('0x29')]=undefined;this[_0xa867('0x2')]='';this[_0xa867('0x2a')]();}Agent[_0xa867('0x2b')]['getChannelStatus']=function(_0x3260a0){if(this[_0x3260a0+_0xa867('0x2c')]>0x0){if(this[_0x3260a0+_0xa867('0x2d')]>0x0&&this[_0x3260a0+_0xa867('0x2c')]>=this[_0x3260a0+_0xa867('0x2d')]){return _0xa867('0x2e');}else{return'working';}}else{return _0xa867('0x2f');}};Agent['prototype']['updateRealtime']=function(){var _0x2a76e5=[_0xa867('0x30'),_0xa867('0x31'),'openchannel','fax',_0xa867('0x32'),'whatsapp'];for(var _0x56606b=0x0;_0x56606b<_0x2a76e5[_0xa867('0x33')];_0x56606b+=0x1){var _0x3fbf7a=this[_0xa867('0x34')](_0x2a76e5[_0x56606b]);if(this[_0x2a76e5[_0x56606b]+'Status']!==_0x3fbf7a){this[_0x2a76e5[_0x56606b]+'StatusTime']=_[_0xa867('0x35')](moment()[_0xa867('0x36')]('x'));}this[_0x2a76e5[_0x56606b]+'Status']=_0x3fbf7a;}var _0x18e45b={'id':this['id'],'name':this[_0xa867('0x9')],'online':this['online'],'voicePause':this[_0xa867('0xb')],'chatPause':this['chatPause'],'mailPause':this[_0xa867('0xd')],'smsPause':this[_0xa867('0xf')],'faxPause':this[_0xa867('0xe')],'openchannelPause':this[_0xa867('0x10')],'chatStatus':this[_0xa867('0x11')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xa867('0x14')],'chatCurrentCapacity':this[_0xa867('0x15')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xa867('0x17')],'mailCapacity':this[_0xa867('0x18')],'mailCurrentCapacity':this[_0xa867('0x37')],'faxStatus':this[_0xa867('0x19')],'faxStatusTime':this[_0xa867('0x1a')],'faxCapacity':this[_0xa867('0x1b')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xa867('0x1d')],'smsStatusTime':this[_0xa867('0x1e')],'smsCapacity':this[_0xa867('0x1f')],'smsCurrentCapacity':this[_0xa867('0x20')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xa867('0x22')],'whatsappCapacity':this[_0xa867('0x23')],'whatsappCurrentCapacity':this[_0xa867('0x24')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xa867('0x26')],'openchannelCapacity':this[_0xa867('0x27')],'openchannelCurrentCapacity':this[_0xa867('0x38')],'busy':this[_0xa867('0x28')],'busyQueue':this[_0xa867('0x29')]};var _0x4d15b3=md5(JSON[_0xa867('0x39')](_0x18e45b));if(this['md5']!==_0x4d15b3){this[_0xa867('0x2')]=_0x4d15b3;io['emit'](_0xa867('0x3a'),_0x18e45b);}};module[_0xa867('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index e105efd..9ea0247 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 _0xec2e=['length','online','chatPause','available','format','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','updateRouting','mapAgentsId','map','_rr','prototype','loggedIn','paused'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xec2e,0x1e4));var _0xeec2=function(_0x3ea772,_0x16437b){_0x3ea772=_0x3ea772-0x0;var _0x4cde1a=_0xec2e[_0x3ea772];return _0x4cde1a;};'use strict';var _=require(_0xeec2('0x0'));var md5=require(_0xeec2('0x1'));var util=require('util');var Redis=require(_0xeec2('0x2'));var config=require(_0xeec2('0x3'));config[_0xeec2('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xeec2('0x5'))(new Redis(config['redis']));function ChatQueue(_0x1cfbeb){this['id']=_0x1cfbeb['id']||0x0;this[_0xeec2('0x6')]=_0x1cfbeb[_0xeec2('0x6')]||'';this[_0xeec2('0x7')]=_0x1cfbeb[_0xeec2('0x7')]||0xa;this['strategy']=_0x1cfbeb[_0xeec2('0x8')]||_0xeec2('0x9');this[_0xeec2('0xa')]=_0x1cfbeb['Agents'];this['mapAgentsId']={};this[_0xeec2('0xb')]=0x0;this[_0xeec2('0x1')]='';this['updateRouting']();this[_0xeec2('0xc')]();}ChatQueue['prototype'][_0xeec2('0xd')]=function(){var _0x53115a=this['mapAgentsId']['_rr'];this[_0xeec2('0xe')]=_[_0xeec2('0xf')](this[_0xeec2('0xa')],'id');this['mapAgentsId'][_0xeec2('0x10')]=_0x53115a;};ChatQueue[_0xeec2('0x11')][_0xeec2('0xc')]=function(){this[_0xeec2('0x12')]=0x0;this[_0xeec2('0x13')]=0x0;for(var _0x44fb38=0x0;_0x44fb38=0x0?this[_0xeec2('0x17')]:0x0;var _0xdf1880={'id':this['id'],'available':this[_0xeec2('0x17')],'loggedIn':this[_0xeec2('0x12')],'name':this[_0xeec2('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x192913=md5(JSON['stringify'](_0xdf1880));if(this[_0xeec2('0x1')]!==_0x192913){this['md5']=_0x192913;io['to'](util[_0xeec2('0x18')]('chat:queue:%s',_0xdf1880['name']))[_0xeec2('0x19')](_0xeec2('0x1a'),_0xdf1880);}};module[_0xeec2('0x1b')]=ChatQueue; \ No newline at end of file +var _0x5432=['updateRealtime','prototype','_rr','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x11d596,_0x2d4fb4){var _0x31a2be=function(_0x342024){while(--_0x342024){_0x11d596['push'](_0x11d596['shift']());}};_0x31a2be(++_0x2d4fb4);}(_0x5432,0x86));var _0x2543=function(_0x30c861,_0x1c3369){_0x30c861=_0x30c861-0x0;var _0xd1187e=_0x5432[_0x30c861];return _0xd1187e;};'use strict';var _=require(_0x2543('0x0'));var md5=require(_0x2543('0x1'));var util=require(_0x2543('0x2'));var Redis=require(_0x2543('0x3'));var config=require(_0x2543('0x4'));config['redis']=_[_0x2543('0x5')](config['redis'],{'host':_0x2543('0x6'),'port':0x18eb});var io=require(_0x2543('0x7'))(new Redis(config['redis']));function ChatQueue(_0x428160){this['id']=_0x428160['id']||0x0;this[_0x2543('0x8')]=_0x428160[_0x2543('0x8')]||'';this[_0x2543('0x9')]=_0x428160['timeout']||0xa;this[_0x2543('0xa')]=_0x428160[_0x2543('0xa')]||_0x2543('0xb');this[_0x2543('0xc')]=_0x428160[_0x2543('0xc')];this[_0x2543('0xd')]={};this[_0x2543('0xe')]=0x0;this[_0x2543('0x1')]='';this[_0x2543('0xf')]();this[_0x2543('0x10')]();}ChatQueue[_0x2543('0x11')][_0x2543('0xf')]=function(){var _0x3ac8c3=this[_0x2543('0xd')]['_rr'];this[_0x2543('0xd')]=_['map'](this['Agents'],'id');this[_0x2543('0xd')][_0x2543('0x12')]=_0x3ac8c3;};ChatQueue[_0x2543('0x11')][_0x2543('0x10')]=function(){this[_0x2543('0x13')]=0x0;this['paused']=0x0;for(var _0x3da1d5=0x0;_0x3da1d5=0x0?this[_0x2543('0x18')]:0x0;var _0x25b23e={'id':this['id'],'available':this[_0x2543('0x18')],'loggedIn':this[_0x2543('0x13')],'name':this[_0x2543('0x8')],'paused':this[_0x2543('0x17')],'waiting':this[_0x2543('0xe')]};var _0x5c0bef=md5(JSON[_0x2543('0x19')](_0x25b23e));if(this['md5']!==_0x5c0bef){this[_0x2543('0x1')]=_0x5c0bef;io['to'](util[_0x2543('0x1a')](_0x2543('0x1b'),_0x25b23e['name']))[_0x2543('0x1c')](_0x2543('0x1d'),_0x25b23e);}};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 08efd51..8e6359b 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 _0x7375=['util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','online','faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x7375,0x193));var _0x5737=function(_0xbfd835,_0xbca24b){_0xbfd835=_0xbfd835-0x0;var _0x2e0ba9=_0x7375[_0xbfd835];return _0x2e0ba9;};'use strict';var _=require(_0x5737('0x0'));var md5=require(_0x5737('0x1'));var util=require(_0x5737('0x2'));var Redis=require(_0x5737('0x3'));var config=require('../../../config/environment');config[_0x5737('0x4')]=_['defaults'](config[_0x5737('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x5737('0x5'))(new Redis(config[_0x5737('0x4')]));function FaxQueue(_0x34199f){this['id']=_0x34199f['id']||0x0;this['name']=_0x34199f[_0x5737('0x6')]||'';this[_0x5737('0x7')]=_0x34199f[_0x5737('0x7')]||0xa;this[_0x5737('0x8')]=_0x34199f[_0x5737('0x8')]||_0x5737('0x9');this[_0x5737('0xa')]=_0x34199f[_0x5737('0xa')];this['mapAgentsId']={};this[_0x5737('0xb')]=0x0;this[_0x5737('0x1')]='';this[_0x5737('0xc')]();this[_0x5737('0xd')]();}FaxQueue[_0x5737('0xe')]['updateRouting']=function(){var _0xb6537a=this['mapAgentsId']['_rr'];this[_0x5737('0xf')]=_['map'](this[_0x5737('0xa')],'id');this['mapAgentsId'][_0x5737('0x10')]=_0xb6537a;};FaxQueue[_0x5737('0xe')]['updateRealtime']=function(){this[_0x5737('0x11')]=0x0;this[_0x5737('0x12')]=0x0;for(var _0x436b26=0x0;_0x436b26=0x0?this[_0x5737('0x15')]:0x0;var _0x5c0492={'id':this['id'],'available':this[_0x5737('0x15')],'loggedIn':this[_0x5737('0x11')],'name':this['name'],'paused':this[_0x5737('0x12')],'waiting':this['waiting']};var _0x32ba=md5(JSON[_0x5737('0x16')](_0x5c0492));if(this['md5']!==_0x32ba){this['md5']=_0x32ba;io['to'](util[_0x5737('0x17')](_0x5737('0x18'),_0x5c0492[_0x5737('0x6')]))['emit'](_0x5737('0x19'),_0x5c0492);}};module[_0x5737('0x1a')]=FaxQueue; \ No newline at end of file +var _0x7761=['format','fax:queue:%s','emit','fax_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','_rr','map','loggedIn','length','online','paused','available','stringify','md5'];(function(_0x11325d,_0x2b358c){var _0x1bb750=function(_0x461d4f){while(--_0x461d4f){_0x11325d['push'](_0x11325d['shift']());}};_0x1bb750(++_0x2b358c);}(_0x7761,0x18d));var _0x1776=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7761[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1776('0x0'));var Redis=require(_0x1776('0x1'));var config=require(_0x1776('0x2'));config[_0x1776('0x3')]=_[_0x1776('0x4')](config[_0x1776('0x3')],{'host':_0x1776('0x5'),'port':0x18eb});var io=require(_0x1776('0x6'))(new Redis(config['redis']));function FaxQueue(_0x10c9d9){this['id']=_0x10c9d9['id']||0x0;this[_0x1776('0x7')]=_0x10c9d9[_0x1776('0x7')]||'';this['timeout']=_0x10c9d9[_0x1776('0x8')]||0xa;this[_0x1776('0x9')]=_0x10c9d9[_0x1776('0x9')]||'beepall';this[_0x1776('0xa')]=_0x10c9d9[_0x1776('0xa')];this[_0x1776('0xb')]={};this[_0x1776('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x1776('0xd')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x13cc2d=this[_0x1776('0xb')][_0x1776('0xe')];this[_0x1776('0xb')]=_[_0x1776('0xf')](this[_0x1776('0xa')],'id');this[_0x1776('0xb')][_0x1776('0xe')]=_0x13cc2d;};FaxQueue['prototype'][_0x1776('0xd')]=function(){this[_0x1776('0x10')]=0x0;this['paused']=0x0;for(var _0x3060c6=0x0;_0x3060c6=0x0?this[_0x1776('0x14')]:0x0;var _0x35b399={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1776('0x10')],'name':this[_0x1776('0x7')],'paused':this['paused'],'waiting':this[_0x1776('0xc')]};var _0x46246e=md5(JSON[_0x1776('0x15')](_0x35b399));if(this[_0x1776('0x16')]!==_0x46246e){this[_0x1776('0x16')]=_0x46246e;io['to'](util[_0x1776('0x17')](_0x1776('0x18'),_0x35b399[_0x1776('0x7')]))[_0x1776('0x19')](_0x1776('0x1a'),_0x35b399);}};module[_0x1776('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 1dadae0..7699d72 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 _0x8807=['exports','name','Intervals'];(function(_0xdbf206,_0x111e29){var _0x51935c=function(_0x35f90e){while(--_0x35f90e){_0xdbf206['push'](_0xdbf206['shift']());}};_0x51935c(++_0x111e29);}(_0x8807,0xfa));var _0x7880=function(_0x35c506,_0x18351c){_0x35c506=_0x35c506-0x0;var _0x4d025c=_0x8807[_0x35c506];return _0x4d025c;};'use strict';function Interval(_0x4d4888){this['id']=_0x4d4888['id']||0x0;this[_0x7880('0x0')]=_0x4d4888[_0x7880('0x0')]||'';this[_0x7880('0x1')]=_0x4d4888[_0x7880('0x1')]||{};}module[_0x7880('0x2')]=Interval; \ No newline at end of file +var _0x79f3=['Intervals','exports','name'];(function(_0x17e5b6,_0x5a36b4){var _0x139635=function(_0x5a12be){while(--_0x5a12be){_0x17e5b6['push'](_0x17e5b6['shift']());}};_0x139635(++_0x5a36b4);}(_0x79f3,0xce));var _0x379f=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0x79f3[_0x2892da];return _0x28cff2;};'use strict';function Interval(_0x597e09){this['id']=_0x597e09['id']||0x0;this[_0x379f('0x0')]=_0x597e09['name']||'';this[_0x379f('0x1')]=_0x597e09[_0x379f('0x1')]||{};}module[_0x379f('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 3ca7f73..c7b6b66 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 _0x2aaa=['paused','loggedIn','mailPause','available','stringify','format','mail:queue:%s','name','emit','mail_queue:save','exports','md5','util','ioredis','redis','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x5b0ee5,_0x437c51){var _0x441fea=function(_0x4c3f9){while(--_0x4c3f9){_0x5b0ee5['push'](_0x5b0ee5['shift']());}};_0x441fea(++_0x437c51);}(_0x2aaa,0x185));var _0xa2aa=function(_0x4f2370,_0xb27230){_0x4f2370=_0x4f2370-0x0;var _0x443acd=_0x2aaa[_0x4f2370];return _0x443acd;};'use strict';var _=require('lodash');var md5=require(_0xa2aa('0x0'));var util=require(_0xa2aa('0x1'));var Redis=require(_0xa2aa('0x2'));var config=require('../../../config/environment');config[_0xa2aa('0x3')]=_['defaults'](config[_0xa2aa('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xa2aa('0x4'))(new Redis(config['redis']));function MailQueue(_0x450125){this['id']=_0x450125['id']||0x0;this['name']=_0x450125['name']||'';this[_0xa2aa('0x5')]=_0x450125[_0xa2aa('0x5')]||0xa;this[_0xa2aa('0x6')]=_0x450125[_0xa2aa('0x6')]||_0xa2aa('0x7');this[_0xa2aa('0x8')]=_0x450125[_0xa2aa('0x8')];this[_0xa2aa('0x9')]={};this[_0xa2aa('0xa')]=0x0;this['md5']='';this[_0xa2aa('0xb')]();this[_0xa2aa('0xc')]();}MailQueue[_0xa2aa('0xd')][_0xa2aa('0xb')]=function(){var _0x7cf6e5=this[_0xa2aa('0x9')][_0xa2aa('0xe')];this[_0xa2aa('0x9')]=_[_0xa2aa('0xf')](this[_0xa2aa('0x8')],'id');this[_0xa2aa('0x9')]['_rr']=_0x7cf6e5;};MailQueue[_0xa2aa('0xd')][_0xa2aa('0xc')]=function(){this['loggedIn']=0x0;this[_0xa2aa('0x10')]=0x0;for(var _0x23483e=0x0;_0x23483e=0x0?this[_0xa2aa('0x13')]:0x0;var _0x340d1c={'id':this['id'],'available':this[_0xa2aa('0x13')],'loggedIn':this[_0xa2aa('0x11')],'name':this['name'],'paused':this[_0xa2aa('0x10')],'waiting':this[_0xa2aa('0xa')]};var _0x29da22=md5(JSON[_0xa2aa('0x14')](_0x340d1c));if(this[_0xa2aa('0x0')]!==_0x29da22){this[_0xa2aa('0x0')]=_0x29da22;io['to'](util[_0xa2aa('0x15')](_0xa2aa('0x16'),_0x340d1c[_0xa2aa('0x17')]))[_0xa2aa('0x18')](_0xa2aa('0x19'),_0x340d1c);}};module[_0xa2aa('0x1a')]=MailQueue; \ No newline at end of file +var _0x0011=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','loggedIn','paused','length','online','available','stringify','format','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name'];(function(_0x312c50,_0x34cdfd){var _0x3dfefc=function(_0x5aac24){while(--_0x5aac24){_0x312c50['push'](_0x312c50['shift']());}};_0x3dfefc(++_0x34cdfd);}(_0x0011,0xc2));var _0x1001=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0011[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x1001('0x0'));var md5=require(_0x1001('0x1'));var util=require(_0x1001('0x2'));var Redis=require(_0x1001('0x3'));var config=require(_0x1001('0x4'));config['redis']=_['defaults'](config[_0x1001('0x5')],{'host':_0x1001('0x6'),'port':0x18eb});var io=require(_0x1001('0x7'))(new Redis(config['redis']));function MailQueue(_0x5d1d3c){this['id']=_0x5d1d3c['id']||0x0;this[_0x1001('0x8')]=_0x5d1d3c[_0x1001('0x8')]||'';this[_0x1001('0x9')]=_0x5d1d3c[_0x1001('0x9')]||0xa;this[_0x1001('0xa')]=_0x5d1d3c[_0x1001('0xa')]||_0x1001('0xb');this['Agents']=_0x5d1d3c[_0x1001('0xc')];this[_0x1001('0xd')]={};this[_0x1001('0xe')]=0x0;this['md5']='';this[_0x1001('0xf')]();this[_0x1001('0x10')]();}MailQueue['prototype']['updateRouting']=function(){var _0x584c6b=this[_0x1001('0xd')][_0x1001('0x11')];this[_0x1001('0xd')]=_[_0x1001('0x12')](this[_0x1001('0xc')],'id');this['mapAgentsId'][_0x1001('0x11')]=_0x584c6b;};MailQueue['prototype'][_0x1001('0x10')]=function(){this[_0x1001('0x13')]=0x0;this[_0x1001('0x14')]=0x0;for(var _0x3de9d8=0x0;_0x3de9d8=0x0?this[_0x1001('0x17')]:0x0;var _0x1d48cf={'id':this['id'],'available':this[_0x1001('0x17')],'loggedIn':this[_0x1001('0x13')],'name':this[_0x1001('0x8')],'paused':this[_0x1001('0x14')],'waiting':this[_0x1001('0xe')]};var _0x5af36d=md5(JSON[_0x1001('0x18')](_0x1d48cf));if(this[_0x1001('0x1')]!==_0x5af36d){this[_0x1001('0x1')]=_0x5af36d;io['to'](util[_0x1001('0x19')]('mail:queue:%s',_0x1d48cf[_0x1001('0x8')]))[_0x1001('0x1a')](_0x1001('0x1b'),_0x1d48cf);}};module[_0x1001('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 8b62a60..92bdc1c 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x1e3ec2,_0x4b2164){_0x1e3ec2=_0x1e3ec2-0x0;var _0x322b74=_0x7a54[_0x1e3ec2];return _0x322b74;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x1b4bef,_0x5bb6be){var _0xf377eb=function(_0x40bd1d){while(--_0x40bd1d){_0x1b4bef['push'](_0x1b4bef['shift']());}};_0xf377eb(++_0x5bb6be);}(_0x5fc3,0xa8));var _0x35fc=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0x5fc3[_0x142020];return _0x40da8f;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 6bd47f2..124cfe9 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 _0x089f=['available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x18abc6,_0x300733){var _0x567c7d=function(_0x14e599){while(--_0x14e599){_0x18abc6['push'](_0x18abc6['shift']());}};_0x567c7d(++_0x300733);}(_0x089f,0x1c7));var _0xf089=function(_0x41d279,_0x1dab09){_0x41d279=_0x41d279-0x0;var _0x2774c1=_0x089f[_0x41d279];return _0x2774c1;};'use strict';var _=require('lodash');var md5=require(_0xf089('0x0'));var util=require(_0xf089('0x1'));var Redis=require(_0xf089('0x2'));var config=require(_0xf089('0x3'));config[_0xf089('0x4')]=_['defaults'](config[_0xf089('0x4')],{'host':_0xf089('0x5'),'port':0x18eb});var io=require(_0xf089('0x6'))(new Redis(config['redis']));function SmsQueue(_0x92f133){this['id']=_0x92f133['id']||0x0;this[_0xf089('0x7')]=_0x92f133[_0xf089('0x7')]||'';this['timeout']=_0x92f133[_0xf089('0x8')]||0xa;this[_0xf089('0x9')]=_0x92f133[_0xf089('0x9')]||'beepall';this[_0xf089('0xa')]=_0x92f133[_0xf089('0xa')];this[_0xf089('0xb')]={};this[_0xf089('0xc')]=0x0;this[_0xf089('0x0')]='';this[_0xf089('0xd')]();this['updateRealtime']();}SmsQueue[_0xf089('0xe')][_0xf089('0xd')]=function(){var _0x292556=this['mapAgentsId'][_0xf089('0xf')];this[_0xf089('0xb')]=_['map'](this['Agents'],'id');this[_0xf089('0xb')][_0xf089('0xf')]=_0x292556;};SmsQueue['prototype'][_0xf089('0x10')]=function(){this[_0xf089('0x11')]=0x0;this[_0xf089('0x12')]=0x0;for(var _0x337673=0x0;_0x337673=0x0?this[_0xf089('0x15')]:0x0;var _0x4e714a={'id':this['id'],'available':this[_0xf089('0x15')],'loggedIn':this[_0xf089('0x11')],'name':this['name'],'paused':this[_0xf089('0x12')],'waiting':this[_0xf089('0xc')]};var _0x5eadfe=md5(JSON[_0xf089('0x16')](_0x4e714a));if(this[_0xf089('0x0')]!==_0x5eadfe){this[_0xf089('0x0')]=_0x5eadfe;io['to'](util[_0xf089('0x17')](_0xf089('0x18'),_0x4e714a[_0xf089('0x7')]))[_0xf089('0x19')](_0xf089('0x1a'),_0x4e714a);}};module[_0xf089('0x1b')]=SmsQueue; \ No newline at end of file +var _0xc112=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','waiting','stringify','format','sms_queue:save','exports','lodash','md5','util','../../../config/environment'];(function(_0x45aca3,_0x2dc880){var _0x540d06=function(_0x1ca425){while(--_0x1ca425){_0x45aca3['push'](_0x45aca3['shift']());}};_0x540d06(++_0x2dc880);}(_0xc112,0xec));var _0x2c11=function(_0x97106,_0x27f511){_0x97106=_0x97106-0x0;var _0x35a0df=_0xc112[_0x97106];return _0x35a0df;};'use strict';var _=require(_0x2c11('0x0'));var md5=require(_0x2c11('0x1'));var util=require(_0x2c11('0x2'));var Redis=require('ioredis');var config=require(_0x2c11('0x3'));config[_0x2c11('0x4')]=_[_0x2c11('0x5')](config[_0x2c11('0x4')],{'host':_0x2c11('0x6'),'port':0x18eb});var io=require(_0x2c11('0x7'))(new Redis(config[_0x2c11('0x4')]));function SmsQueue(_0x18b489){this['id']=_0x18b489['id']||0x0;this[_0x2c11('0x8')]=_0x18b489['name']||'';this['timeout']=_0x18b489[_0x2c11('0x9')]||0xa;this[_0x2c11('0xa')]=_0x18b489[_0x2c11('0xa')]||_0x2c11('0xb');this['Agents']=_0x18b489[_0x2c11('0xc')];this[_0x2c11('0xd')]={};this['waiting']=0x0;this[_0x2c11('0x1')]='';this[_0x2c11('0xe')]();this[_0x2c11('0xf')]();}SmsQueue[_0x2c11('0x10')][_0x2c11('0xe')]=function(){var _0x501d3c=this[_0x2c11('0xd')][_0x2c11('0x11')];this[_0x2c11('0xd')]=_[_0x2c11('0x12')](this[_0x2c11('0xc')],'id');this[_0x2c11('0xd')][_0x2c11('0x11')]=_0x501d3c;};SmsQueue['prototype'][_0x2c11('0xf')]=function(){this[_0x2c11('0x13')]=0x0;this[_0x2c11('0x14')]=0x0;for(var _0x3f8c82=0x0;_0x3f8c82=0x0?this[_0x2c11('0x18')]:0x0;var _0x12ce46={'id':this['id'],'available':this[_0x2c11('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x2c11('0x8')],'paused':this['paused'],'waiting':this[_0x2c11('0x19')]};var _0x269830=md5(JSON[_0x2c11('0x1a')](_0x12ce46));if(this[_0x2c11('0x1')]!==_0x269830){this[_0x2c11('0x1')]=_0x269830;io['to'](util[_0x2c11('0x1b')]('sms:queue:%s',_0x12ce46['name']))['emit'](_0x2c11('0x1c'),_0x12ce46);}};module[_0x2c11('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 69eaa80..5272ca1 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 _0x3415=['whatsapp_queue:save','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','online','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s'];(function(_0x1a29fe,_0x4dace3){var _0x42d8f7=function(_0x528af9){while(--_0x528af9){_0x1a29fe['push'](_0x1a29fe['shift']());}};_0x42d8f7(++_0x4dace3);}(_0x3415,0xfe));var _0x5341=function(_0xcf84d0,_0xe90b7e){_0xcf84d0=_0xcf84d0-0x0;var _0x277a7c=_0x3415[_0xcf84d0];return _0x277a7c;};'use strict';var _=require('lodash');var md5=require(_0x5341('0x0'));var util=require(_0x5341('0x1'));var Redis=require(_0x5341('0x2'));var config=require('../../../config/environment');config[_0x5341('0x3')]=_[_0x5341('0x4')](config[_0x5341('0x3')],{'host':_0x5341('0x5'),'port':0x18eb});var io=require(_0x5341('0x6'))(new Redis(config[_0x5341('0x3')]));function WhatsappQueue(_0x36b46e){this['id']=_0x36b46e['id']||0x0;this[_0x5341('0x7')]=_0x36b46e[_0x5341('0x7')]||'';this[_0x5341('0x8')]=_0x36b46e[_0x5341('0x8')]||0xa;this[_0x5341('0x9')]=_0x36b46e[_0x5341('0x9')]||_0x5341('0xa');this[_0x5341('0xb')]=_0x36b46e[_0x5341('0xb')];this[_0x5341('0xc')]={};this['waiting']=0x0;this[_0x5341('0x0')]='';this['updateRouting']();this[_0x5341('0xd')]();}WhatsappQueue[_0x5341('0xe')][_0x5341('0xf')]=function(){var _0xd813f=this[_0x5341('0xc')][_0x5341('0x10')];this[_0x5341('0xc')]=_['map'](this[_0x5341('0xb')],'id');this['mapAgentsId'][_0x5341('0x10')]=_0xd813f;};WhatsappQueue[_0x5341('0xe')][_0x5341('0xd')]=function(){this[_0x5341('0x11')]=0x0;this[_0x5341('0x12')]=0x0;for(var _0x4cf161=0x0;_0x4cf161=0x0?this[_0x5341('0x15')]:0x0;var _0xdcccaf={'id':this['id'],'available':this[_0x5341('0x15')],'loggedIn':this[_0x5341('0x11')],'name':this[_0x5341('0x7')],'paused':this[_0x5341('0x12')],'waiting':this[_0x5341('0x16')]};var _0x30cda9=md5(JSON[_0x5341('0x17')](_0xdcccaf));if(this[_0x5341('0x0')]!==_0x30cda9){this[_0x5341('0x0')]=_0x30cda9;io['to'](util[_0x5341('0x18')](_0x5341('0x19'),_0xdcccaf[_0x5341('0x7')]))['emit'](_0x5341('0x1a'),_0xdcccaf);}};module[_0x5341('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x66fa=['format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','length','online','loggedIn','paused','available','stringify','md5'];(function(_0x143cf3,_0x2eacfc){var _0x43159e=function(_0x3c2ec0){while(--_0x3c2ec0){_0x143cf3['push'](_0x143cf3['shift']());}};_0x43159e(++_0x2eacfc);}(_0x66fa,0xd0));var _0xa66f=function(_0x286eba,_0x529d84){_0x286eba=_0x286eba-0x0;var _0x38c1f7=_0x66fa[_0x286eba];return _0x38c1f7;};'use strict';var _=require(_0xa66f('0x0'));var md5=require('md5');var util=require(_0xa66f('0x1'));var Redis=require(_0xa66f('0x2'));var config=require('../../../config/environment');config[_0xa66f('0x3')]=_[_0xa66f('0x4')](config['redis'],{'host':_0xa66f('0x5'),'port':0x18eb});var io=require(_0xa66f('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x47436c){this['id']=_0x47436c['id']||0x0;this[_0xa66f('0x7')]=_0x47436c[_0xa66f('0x7')]||'';this[_0xa66f('0x8')]=_0x47436c[_0xa66f('0x8')]||0xa;this['strategy']=_0x47436c['strategy']||_0xa66f('0x9');this[_0xa66f('0xa')]=_0x47436c['Agents'];this[_0xa66f('0xb')]={};this[_0xa66f('0xc')]=0x0;this['md5']='';this[_0xa66f('0xd')]();this['updateRealtime']();}WhatsappQueue[_0xa66f('0xe')][_0xa66f('0xd')]=function(){var _0x16f051=this['mapAgentsId'][_0xa66f('0xf')];this[_0xa66f('0xb')]=_[_0xa66f('0x10')](this[_0xa66f('0xa')],'id');this[_0xa66f('0xb')][_0xa66f('0xf')]=_0x16f051;};WhatsappQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x430fa8=0x0;_0x430fa8=0x0?this[_0xa66f('0x15')]:0x0;var _0x302d6d={'id':this['id'],'available':this[_0xa66f('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xa66f('0x14')],'waiting':this[_0xa66f('0xc')]};var _0x4deb04=md5(JSON[_0xa66f('0x16')](_0x302d6d));if(this['md5']!==_0x4deb04){this[_0xa66f('0x17')]=_0x4deb04;io['to'](util[_0xa66f('0x18')](_0xa66f('0x19'),_0x302d6d[_0xa66f('0x7')]))[_0xa66f('0x1a')](_0xa66f('0x1b'),_0x302d6d);}};module[_0xa66f('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index a71f85a..e8646e7 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x1fbe7b,_0x5567c6){var _0x4cc1e4=function(_0x258f98){while(--_0x258f98){_0x1fbe7b['push'](_0x1fbe7b['shift']());}};_0x4cc1e4(++_0x5567c6);}(_0xb10b,0x12a));var _0xbb10=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xb10b[_0x381589];return _0x2a075d;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x1ac828,_0x38f8b7){var _0x1d80d6=function(_0x3bc806){while(--_0x3bc806){_0x1ac828['push'](_0x1ac828['shift']());}};_0x1d80d6(++_0x38f8b7);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b9e13,_0x3cdc73){_0x3b9e13=_0x3b9e13-0x0;var _0x4ea299=_0xb10b[_0x3b9e13];return _0x4ea299;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index ff4ff94..8d7d620 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 _0x6b03=['Request','UpdateChatInteraction','addTagsToChatInteraction','update'];(function(_0x2ee40a,_0x3b99e2){var _0x4788aa=function(_0xefc4b){while(--_0xefc4b){_0x2ee40a['push'](_0x2ee40a['shift']());}};_0x4788aa(++_0x3b99e2);}(_0x6b03,0x1c7));var _0x36b0=function(_0x765ec1,_0xb88de1){_0x765ec1=_0x765ec1-0x0;var _0x102170=_0x6b03[_0x765ec1];return _0x102170;};'use strict';var client=require('../client');exports[_0x36b0('0x0')]=function(_0x36c368,_0x250d67){return client[_0x36b0('0x1')](_0x36b0('0x2'),{'body':_0x250d67,'options':{'where':{'id':_0x36c368}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x27e0af,_0x1d3bf2){return client[_0x36b0('0x1')]('AddTagsToChatInteraction',{'body':_0x1d3bf2,'options':{'where':{'id':_0x27e0af}},'log':_0x36b0('0x3')});}; \ No newline at end of file +var _0xccf0=['addTagsToChatInteraction','update','updateChatInteraction','Request'];(function(_0x1ccb5d,_0x341da9){var _0x1fe071=function(_0x12433e){while(--_0x12433e){_0x1ccb5d['push'](_0x1ccb5d['shift']());}};_0x1fe071(++_0x341da9);}(_0xccf0,0x69));var _0x0ccf=function(_0x41bec7,_0x2dec58){_0x41bec7=_0x41bec7-0x0;var _0x4bb634=_0xccf0[_0x41bec7];return _0x4bb634;};'use strict';var client=require('../client');exports[_0x0ccf('0x0')]=function(_0xb2d2ed,_0x1adc91){return client['Request']('UpdateChatInteraction',{'body':_0x1adc91,'options':{'where':{'id':_0xb2d2ed}},'log':_0x0ccf('0x1')});};exports['addTags']=function(_0x49dd0c,_0x2e6a44){return client[_0x0ccf('0x2')]('AddTagsToChatInteraction',{'body':_0x2e6a44,'options':{'where':{'id':_0x49dd0c}},'log':_0x0ccf('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index b2c3c58..20deb2c 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 _0xab9b=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x45b131,_0x1bcbd2){var _0x54d307=function(_0x368cf5){while(--_0x368cf5){_0x45b131['push'](_0x45b131['shift']());}};_0x54d307(++_0x1bcbd2);}(_0xab9b,0xa3));var _0xbab9=function(_0xa69733,_0x2aa122){_0xa69733=_0xa69733-0x0;var _0xca5645=_0xab9b[_0xa69733];return _0xca5645;};'use strict';var client=require('../client');exports[_0xbab9('0x0')]=function(_0xd4d4a6){return client[_0xbab9('0x1')](_0xbab9('0x2'),{'body':_0xd4d4a6,'log':_0xbab9('0x3')});}; \ No newline at end of file +var _0x549e=['createChatMessage','create'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x549e,0xc7));var _0xe549=function(_0x1a683c,_0x248f15){_0x1a683c=_0x1a683c-0x0;var _0x26b9e5=_0x549e[_0x1a683c];return _0x26b9e5;};'use strict';var client=require('../client');exports[_0xe549('0x0')]=function(_0x91c477){return client['Request']('CreateChatMessage',{'body':_0x91c477,'log':_0xe549('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 6503e5a..f97ab87 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 _0x61a5=['name','timeout','strategy','Agents','chatPause','getChatQueues','../client','Request','GetChatQueue'];(function(_0x2069eb,_0x470658){var _0x2b05d0=function(_0x2ebe7b){while(--_0x2ebe7b){_0x2069eb['push'](_0x2069eb['shift']());}};_0x2b05d0(++_0x470658);}(_0x61a5,0xf0));var _0x561a=function(_0x19efbc,_0x10b7d7){_0x19efbc=_0x19efbc-0x0;var _0x205c5e=_0x61a5[_0x19efbc];return _0x205c5e;};'use strict';var client=require(_0x561a('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x561a('0x1')](_0x561a('0x2'),{'options':{'raw':![],'attributes':['id',_0x561a('0x3'),_0x561a('0x4'),_0x561a('0x5')],'include':[{'model':'User','as':_0x561a('0x6'),'attributes':['id',_0x561a('0x3'),'online',_0x561a('0x7')]}]},'log':_0x561a('0x8')});};}; \ No newline at end of file +var _0x7722=['strategy','User','Agents','online','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x33c562,_0x54f29c){var _0x4199e3=function(_0x433e55){while(--_0x433e55){_0x33c562['push'](_0x33c562['shift']());}};_0x4199e3(++_0x54f29c);}(_0x7722,0x14e));var _0x2772=function(_0x243327,_0x2271f9){_0x243327=_0x243327-0x0;var _0x3b7ac8=_0x7722[_0x243327];return _0x3b7ac8;};'use strict';var client=require(_0x2772('0x0'));exports[_0x2772('0x1')]=function(){return function(){return client[_0x2772('0x2')](_0x2772('0x3'),{'options':{'raw':![],'attributes':['id',_0x2772('0x4'),_0x2772('0x5'),_0x2772('0x6')],'include':[{'model':_0x2772('0x7'),'as':_0x2772('0x8'),'attributes':['id','name',_0x2772('0x9'),'chatPause']}]},'log':_0x2772('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 664e3d6..5d9a5da 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 _0xb18e=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC'];(function(_0x14d678,_0x559d1e){var _0x168fd8=function(_0x563a17){while(--_0x563a17){_0x14d678['push'](_0x14d678['shift']());}};_0x168fd8(++_0x559d1e);}(_0xb18e,0x181));var _0xeb18=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xb18e[_0x25bca6];return _0x3f8d02;};'use strict';var client=require('../client');exports['create']=function(_0x1c3091){return client['Request'](_0xeb18('0x0'),{'body':_0x1c3091,'log':'CreateChatQueueReport'});};exports[_0xeb18('0x1')]=function(_0x1bf23e,_0x5d5ff9){return client[_0xeb18('0x2')](_0xeb18('0x3'),{'body':_0x5d5ff9,'options':{'where':{'uniqueid':_0x1bf23e},'order':[['id',_0xeb18('0x4')]],'limit':0x1},'log':_0xeb18('0x3')});}; \ No newline at end of file +var _0x8c99=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x15fc7a,_0xd21741){var _0x3aa9f4=function(_0x313108){while(--_0x313108){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x3aa9f4(++_0xd21741);}(_0x8c99,0x1a8));var _0x98c9=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0x8c99[_0x5b077b];return _0x16faf7;};'use strict';var client=require(_0x98c9('0x0'));exports[_0x98c9('0x1')]=function(_0x3edaed){return client[_0x98c9('0x2')](_0x98c9('0x3'),{'body':_0x3edaed,'log':_0x98c9('0x3')});};exports[_0x98c9('0x4')]=function(_0x42a6d2,_0x459115){return client[_0x98c9('0x2')](_0x98c9('0x5'),{'body':_0x459115,'options':{'where':{'uniqueid':_0x42a6d2},'order':[['id',_0x98c9('0x6')]],'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 da0a79a..290c618 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(_0x254fbe,_0x1a86ce){var _0x20d734=function(_0x274685){while(--_0x274685){_0x254fbe['push'](_0x254fbe['shift']());}};_0x20d734(++_0x1a86ce);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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(_0x314ac6,_0x5a8d28){var _0x5d60ff=function(_0x4c4300){while(--_0x4c4300){_0x314ac6['push'](_0x314ac6['shift']());}};_0x5d60ff(++_0x5a8d28);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 6cd6a37..578cbba 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 _0x5edb=['createFaxMessage','../client','CreateFaxMessage'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5edb,0x151));var _0xb5ed=function(_0x79d1fb,_0x23f969){_0x79d1fb=_0x79d1fb-0x0;var _0x28c61a=_0x5edb[_0x79d1fb];return _0x28c61a;};'use strict';var client=require(_0xb5ed('0x0'));exports['create']=function(_0x52922d){return client['Request'](_0xb5ed('0x1'),{'body':_0x52922d,'log':_0xb5ed('0x2')});}; \ No newline at end of file +var _0x7d98=['create','Request','../client'];(function(_0x505eb5,_0x195087){var _0x17cd53=function(_0x2bb095){while(--_0x2bb095){_0x505eb5['push'](_0x505eb5['shift']());}};_0x17cd53(++_0x195087);}(_0x7d98,0x1f1));var _0x87d9=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0x7d98[_0x4b4277];return _0x1ff405;};'use strict';var client=require(_0x87d9('0x0'));exports[_0x87d9('0x1')]=function(_0x414f18){return client[_0x87d9('0x2')]('CreateFaxMessage',{'body':_0x414f18,'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 0ac2d99..9800958 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 _0xaffe=['timeout','User','Agents','online','getFaxQueues','../client','Request','GetFaxQueue','name'];(function(_0x50a0f8,_0x27c0fb){var _0x52e53d=function(_0x1c7590){while(--_0x1c7590){_0x50a0f8['push'](_0x50a0f8['shift']());}};_0x52e53d(++_0x27c0fb);}(_0xaffe,0x1d9));var _0xeaff=function(_0x10353c,_0x6e2053){_0x10353c=_0x10353c-0x0;var _0xfb1827=_0xaffe[_0x10353c];return _0xfb1827;};'use strict';var client=require(_0xeaff('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xeaff('0x1')](_0xeaff('0x2'),{'options':{'raw':![],'attributes':['id',_0xeaff('0x3'),_0xeaff('0x4'),'strategy'],'include':[{'model':_0xeaff('0x5'),'as':_0xeaff('0x6'),'attributes':['id','name',_0xeaff('0x7'),'faxPause']}]},'log':_0xeaff('0x8')});};}; \ No newline at end of file +var _0x2f8e=['name','timeout','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x5a1acc,_0xd7d2e8){var _0x4ecf74=function(_0x5d6851){while(--_0x5d6851){_0x5a1acc['push'](_0x5a1acc['shift']());}};_0x4ecf74(++_0xd7d2e8);}(_0x2f8e,0x132));var _0xe2f8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2f8e[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0xe2f8('0x0'));exports[_0xe2f8('0x1')]=function(){return function(){return client[_0xe2f8('0x2')](_0xe2f8('0x3'),{'options':{'raw':![],'attributes':['id',_0xe2f8('0x4'),_0xe2f8('0x5'),'strategy'],'include':[{'model':_0xe2f8('0x6'),'as':_0xe2f8('0x7'),'attributes':['id',_0xe2f8('0x4'),_0xe2f8('0x8'),_0xe2f8('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d6ed37a..a66079c 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 _0x8164=['DESC','UpdateFaxQueueReport','create','Request','CreateFaxQueueReport','update'];(function(_0x9c0817,_0x50058d){var _0x396086=function(_0x45e7a6){while(--_0x45e7a6){_0x9c0817['push'](_0x9c0817['shift']());}};_0x396086(++_0x50058d);}(_0x8164,0xd4));var _0x4816=function(_0x16e5d1,_0x9cf085){_0x16e5d1=_0x16e5d1-0x0;var _0x3f72e6=_0x8164[_0x16e5d1];return _0x3f72e6;};'use strict';var client=require('../client');exports[_0x4816('0x0')]=function(_0x17d389){return client[_0x4816('0x1')](_0x4816('0x2'),{'body':_0x17d389,'log':_0x4816('0x2')});};exports[_0x4816('0x3')]=function(_0x26ef06,_0x33ee98){return client[_0x4816('0x1')]('UpdateFaxQueueReport',{'body':_0x33ee98,'options':{'where':{'uniqueid':_0x26ef06},'order':[['id',_0x4816('0x4')]],'limit':0x1},'log':_0x4816('0x5')});}; \ No newline at end of file +var _0x626c=['DESC','UpdateFaxQueueReport','../client','create'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x626c,0xc2));var _0xc626=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x626c[_0x13b02f];return _0x12e9a6;};'use strict';var client=require(_0xc626('0x0'));exports[_0xc626('0x1')]=function(_0x5b306b){return client['Request']('CreateFaxQueueReport',{'body':_0x5b306b,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x21bff6,_0x54a6da){return client['Request']('UpdateFaxQueueReport',{'body':_0x54a6da,'options':{'where':{'uniqueid':_0x21bff6},'order':[['id',_0xc626('0x2')]],'limit':0x1},'log':_0xc626('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 22af46b..da70f4c 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 _0xad61=['Intervals','../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0x197d5c,_0x1936b0){var _0x13dc71=function(_0x332d07){while(--_0x332d07){_0x197d5c['push'](_0x197d5c['shift']());}};_0x13dc71(++_0x1936b0);}(_0xad61,0x1a5));var _0x1ad6=function(_0x1675cb,_0x244872){_0x1675cb=_0x1675cb-0x0;var _0x164355=_0xad61[_0x1675cb];return _0x164355;};'use strict';var client=require(_0x1ad6('0x0'));exports[_0x1ad6('0x1')]=function(){return function(){return client[_0x1ad6('0x2')](_0x1ad6('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1ad6('0x4')],'include':[{'model':_0x1ad6('0x5'),'as':_0x1ad6('0x6'),'attributes':['id','name','interval']}]},'log':_0x1ad6('0x1')});};}; \ No newline at end of file +var _0xe4b3=['getIntervals','Request','name','Intervals','interval','../client'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xe4b3,0x89));var _0x3e4b=function(_0xf8e464,_0x2d6c3c){_0xf8e464=_0xf8e464-0x0;var _0x160d8d=_0xe4b3[_0xf8e464];return _0x160d8d;};'use strict';var client=require(_0x3e4b('0x0'));exports[_0x3e4b('0x1')]=function(){return function(){return client[_0x3e4b('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3e4b('0x3')],'include':[{'model':'Interval','as':_0x3e4b('0x4'),'attributes':['id','name',_0x3e4b('0x5')]}]},'log':_0x3e4b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 3a83982..2ecc6ee 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 _0x1399=['UpdateMailInteraction','updateMailInteraction','addTags','Request','../client','update'];(function(_0xfc89d2,_0x269100){var _0x1c53a6=function(_0x507e97){while(--_0x507e97){_0xfc89d2['push'](_0xfc89d2['shift']());}};_0x1c53a6(++_0x269100);}(_0x1399,0x16c));var _0x9139=function(_0x5067c6,_0x3f1e9e){_0x5067c6=_0x5067c6-0x0;var _0xb5daa3=_0x1399[_0x5067c6];return _0xb5daa3;};'use strict';var client=require(_0x9139('0x0'));exports[_0x9139('0x1')]=function(_0x5740a9,_0x474911){return client['Request'](_0x9139('0x2'),{'body':_0x474911,'options':{'where':{'id':_0x5740a9}},'log':_0x9139('0x3')});};exports[_0x9139('0x4')]=function(_0x28f155,_0x251798){return client[_0x9139('0x5')]('AddTagsToMailInteraction',{'body':_0x251798,'options':{'where':{'id':_0x28f155}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xd943=['addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x3eb71b,_0x2d43c3){var _0x5bb24c=function(_0x220a2d){while(--_0x220a2d){_0x3eb71b['push'](_0x3eb71b['shift']());}};_0x5bb24c(++_0x2d43c3);}(_0xd943,0x15d));var _0x3d94=function(_0x58c68e,_0x32e99a){_0x58c68e=_0x58c68e-0x0;var _0x1ec39e=_0xd943[_0x58c68e];return _0x1ec39e;};'use strict';var client=require(_0x3d94('0x0'));exports[_0x3d94('0x1')]=function(_0x55353d,_0x440dd8){return client['Request'](_0x3d94('0x2'),{'body':_0x440dd8,'options':{'where':{'id':_0x55353d}},'log':_0x3d94('0x3')});};exports[_0x3d94('0x4')]=function(_0xc13b61,_0xaf8962){return client['Request']('AddTagsToMailInteraction',{'body':_0xaf8962,'options':{'where':{'id':_0xc13b61}},'log':_0x3d94('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index e3dff0b..210bd1f 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 _0x1ac9=['CreateMailMessage','../client','create'];(function(_0x5299fa,_0x221a20){var _0x22b904=function(_0x5a821f){while(--_0x5a821f){_0x5299fa['push'](_0x5299fa['shift']());}};_0x22b904(++_0x221a20);}(_0x1ac9,0x127));var _0x91ac=function(_0x505d7c,_0x20b160){_0x505d7c=_0x505d7c-0x0;var _0x566b61=_0x1ac9[_0x505d7c];return _0x566b61;};'use strict';var client=require(_0x91ac('0x0'));exports[_0x91ac('0x1')]=function(_0x4b82a7){return client['Request'](_0x91ac('0x2'),{'body':_0x4b82a7,'log':'createMailMessage'});}; \ No newline at end of file +var _0x32df=['createMailMessage','create','Request','CreateMailMessage'];(function(_0x1af3a0,_0x246b24){var _0x53693f=function(_0x24f1db){while(--_0x24f1db){_0x1af3a0['push'](_0x1af3a0['shift']());}};_0x53693f(++_0x246b24);}(_0x32df,0x151));var _0xf32d=function(_0x218d6d,_0x541c48){_0x218d6d=_0x218d6d-0x0;var _0x5a2f19=_0x32df[_0x218d6d];return _0x5a2f19;};'use strict';var client=require('../client');exports[_0xf32d('0x0')]=function(_0x4149bb){return client[_0xf32d('0x1')](_0xf32d('0x2'),{'body':_0x4149bb,'log':_0xf32d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index d8161f7..a1dda88 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 _0xf5b1=['online','mailPause','../client','getMailQueues','Request','name','timeout','strategy','Agents'];(function(_0x1f4a0a,_0x2576ef){var _0x1b810a=function(_0xe52831){while(--_0xe52831){_0x1f4a0a['push'](_0x1f4a0a['shift']());}};_0x1b810a(++_0x2576ef);}(_0xf5b1,0xec));var _0x1f5b=function(_0x28334d,_0x2d4d81){_0x28334d=_0x28334d-0x0;var _0x553fa7=_0xf5b1[_0x28334d];return _0x553fa7;};'use strict';var client=require(_0x1f5b('0x0'));exports[_0x1f5b('0x1')]=function(){return function(){return client[_0x1f5b('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x1f5b('0x3'),_0x1f5b('0x4'),_0x1f5b('0x5')],'include':[{'model':'User','as':_0x1f5b('0x6'),'attributes':['id',_0x1f5b('0x3'),_0x1f5b('0x7'),_0x1f5b('0x8')]}]},'log':_0x1f5b('0x1')});};}; \ No newline at end of file +var _0xde92=['../client','getMailQueues','strategy','User','Agents','online'];(function(_0x22881b,_0x460fd1){var _0x493863=function(_0x480541){while(--_0x480541){_0x22881b['push'](_0x22881b['shift']());}};_0x493863(++_0x460fd1);}(_0xde92,0x1da));var _0x2de9=function(_0xf64e5,_0x4a3232){_0xf64e5=_0xf64e5-0x0;var _0x5f312c=_0xde92[_0xf64e5];return _0x5f312c;};'use strict';var client=require(_0x2de9('0x0'));exports[_0x2de9('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x2de9('0x2')],'include':[{'model':_0x2de9('0x3'),'as':_0x2de9('0x4'),'attributes':['id','name',_0x2de9('0x5'),'mailPause']}]},'log':_0x2de9('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 4ae2019..eeea629 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 _0x2420=['update','Request','UpdateMailQueueReport','../client','create','CreateMailQueueReport'];(function(_0x16d31f,_0x2826ad){var _0x43a973=function(_0x32dba8){while(--_0x32dba8){_0x16d31f['push'](_0x16d31f['shift']());}};_0x43a973(++_0x2826ad);}(_0x2420,0x1e3));var _0x0242=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x2420[_0xc6be3a];return _0x56a310;};'use strict';var client=require(_0x0242('0x0'));exports[_0x0242('0x1')]=function(_0x4efa80){return client['Request']('CreateMailQueueReport',{'body':_0x4efa80,'log':_0x0242('0x2')});};exports[_0x0242('0x3')]=function(_0x35ffc2,_0x13fd6b){return client[_0x0242('0x4')]('UpdateMailQueueReport',{'body':_0x13fd6b,'options':{'where':{'uniqueid':_0x35ffc2},'order':[['id','DESC']],'limit':0x1},'log':_0x0242('0x5')});}; \ No newline at end of file +var _0x06b4=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','Request'];(function(_0x1f55ac,_0x4b6cb8){var _0x435442=function(_0x102eb8){while(--_0x102eb8){_0x1f55ac['push'](_0x1f55ac['shift']());}};_0x435442(++_0x4b6cb8);}(_0x06b4,0xc6));var _0x406b=function(_0x5a885f,_0x40d956){_0x5a885f=_0x5a885f-0x0;var _0x5b06ee=_0x06b4[_0x5a885f];return _0x5b06ee;};'use strict';var client=require(_0x406b('0x0'));exports['create']=function(_0x35fd3d){return client[_0x406b('0x1')]('CreateMailQueueReport',{'body':_0x35fd3d,'log':_0x406b('0x2')});};exports[_0x406b('0x3')]=function(_0x2b5d3b,_0x4dfc3a){return client[_0x406b('0x1')](_0x406b('0x4'),{'body':_0x4dfc3a,'options':{'where':{'uniqueid':_0x2b5d3b},'order':[['id','DESC']],'limit':0x1},'log':_0x406b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index d3544c0..4ddd712 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 _0xea94=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x5c518d,_0x6a850d){var _0x4db9c6=function(_0x2d8511){while(--_0x2d8511){_0x5c518d['push'](_0x5c518d['shift']());}};_0x4db9c6(++_0x6a850d);}(_0xea94,0x1d8));var _0x4ea9=function(_0x2a59af,_0x18d558){_0x2a59af=_0x2a59af-0x0;var _0x3af243=_0xea94[_0x2a59af];return _0x3af243;};'use strict';var client=require(_0x4ea9('0x0'));exports['update']=function(_0x148d91,_0x13a08d){return client[_0x4ea9('0x1')](_0x4ea9('0x2'),{'body':_0x13a08d,'options':{'where':{'id':_0x148d91}},'log':_0x4ea9('0x3')});};exports[_0x4ea9('0x4')]=function(_0x31c387,_0x25fee0){return client[_0x4ea9('0x1')](_0x4ea9('0x5'),{'body':_0x25fee0,'options':{'where':{'id':_0x31c387}},'log':_0x4ea9('0x6')});}; \ No newline at end of file +var _0x9a9b=['addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x9e8ea,_0x3aca34){var _0x45ced9=function(_0x295df6){while(--_0x295df6){_0x9e8ea['push'](_0x9e8ea['shift']());}};_0x45ced9(++_0x3aca34);}(_0x9a9b,0x190));var _0xb9a9=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9a9b[_0x5608a3];return _0x1ed50a;};'use strict';var client=require(_0xb9a9('0x0'));exports['update']=function(_0x3f056b,_0x3596d3){return client[_0xb9a9('0x1')](_0xb9a9('0x2'),{'body':_0x3596d3,'options':{'where':{'id':_0x3f056b}},'log':_0xb9a9('0x3')});};exports[_0xb9a9('0x4')]=function(_0x3e9f61,_0x1ed279){return client[_0xb9a9('0x1')](_0xb9a9('0x5'),{'body':_0x1ed279,'options':{'where':{'id':_0x3e9f61}},'log':_0xb9a9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 5ec4ff4..a0ccf00 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 _0xd1b0=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xd1b0,0x1e5));var _0x0d1b=function(_0x5b1e98,_0x4eb170){_0x5b1e98=_0x5b1e98-0x0;var _0xd0b874=_0xd1b0[_0x5b1e98];return _0xd0b874;};'use strict';var client=require(_0x0d1b('0x0'));exports[_0x0d1b('0x1')]=function(_0x42fc4b){return client[_0x0d1b('0x2')](_0x0d1b('0x3'),{'body':_0x42fc4b,'log':_0x0d1b('0x4')});}; \ No newline at end of file +var _0xd62e=['../client','create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x109ce7,_0x2c73a3){var _0x2f2697=function(_0x2460b6){while(--_0x2460b6){_0x109ce7['push'](_0x109ce7['shift']());}};_0x2f2697(++_0x2c73a3);}(_0xd62e,0x17c));var _0xed62=function(_0x5ee2e1,_0x5ac3ff){_0x5ee2e1=_0x5ee2e1-0x0;var _0x3994e5=_0xd62e[_0x5ee2e1];return _0x3994e5;};'use strict';var client=require(_0xed62('0x0'));exports[_0xed62('0x1')]=function(_0x32d6ae){return client['Request'](_0xed62('0x2'),{'body':_0x32d6ae,'log':_0xed62('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 1710874..48f12d5 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 _0x26bc=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','online','openchannelPause'];(function(_0x2d7116,_0x37bee1){var _0x522d5a=function(_0x34cba3){while(--_0x34cba3){_0x2d7116['push'](_0x2d7116['shift']());}};_0x522d5a(++_0x37bee1);}(_0x26bc,0x111));var _0xc26b=function(_0x1a6149,_0x134b23){_0x1a6149=_0x1a6149-0x0;var _0x1e0389=_0x26bc[_0x1a6149];return _0x1e0389;};'use strict';var client=require('../client');exports[_0xc26b('0x0')]=function(){return function(){return client[_0xc26b('0x1')](_0xc26b('0x2'),{'options':{'raw':![],'attributes':['id',_0xc26b('0x3'),'timeout',_0xc26b('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0xc26b('0x5'),_0xc26b('0x6')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x5755=['name','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy','User','Agents'];(function(_0x236ecf,_0x57be46){var _0x213ac4=function(_0x22d8f5){while(--_0x22d8f5){_0x236ecf['push'](_0x236ecf['shift']());}};_0x213ac4(++_0x57be46);}(_0x5755,0x8f));var _0x5575=function(_0x2ea20d,_0x5e8e3c){_0x2ea20d=_0x2ea20d-0x0;var _0x3ba66a=_0x5755[_0x2ea20d];return _0x3ba66a;};'use strict';var client=require('../client');exports[_0x5575('0x0')]=function(){return function(){return client[_0x5575('0x1')](_0x5575('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x5575('0x3'),_0x5575('0x4')],'include':[{'model':_0x5575('0x5'),'as':_0x5575('0x6'),'attributes':['id',_0x5575('0x7'),_0x5575('0x8'),_0x5575('0x9')]}]},'log':_0x5575('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index f153c8d..8e9f61c 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 _0x6e4f=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','create','Request'];(function(_0x15bc7f,_0x2abb48){var _0x49a97c=function(_0x505893){while(--_0x505893){_0x15bc7f['push'](_0x15bc7f['shift']());}};_0x49a97c(++_0x2abb48);}(_0x6e4f,0x1e8));var _0xf6e4=function(_0x2f7616,_0x463557){_0x2f7616=_0x2f7616-0x0;var _0x271e52=_0x6e4f[_0x2f7616];return _0x271e52;};'use strict';var client=require('../client');exports[_0xf6e4('0x0')]=function(_0x2c5a47){return client[_0xf6e4('0x1')]('CreateOpenchannelQueueReport',{'body':_0x2c5a47,'log':_0xf6e4('0x2')});};exports[_0xf6e4('0x3')]=function(_0x3ffc46,_0x597a3b){return client[_0xf6e4('0x1')](_0xf6e4('0x4'),{'body':_0x597a3b,'options':{'where':{'uniqueid':_0x3ffc46},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x0d39=['UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport','update','DESC'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x0d39,0x85));var _0x90d3=function(_0x3fe357,_0x3ae501){_0x3fe357=_0x3fe357-0x0;var _0x395e35=_0x0d39[_0x3fe357];return _0x395e35;};'use strict';var client=require('../client');exports[_0x90d3('0x0')]=function(_0x497734){return client[_0x90d3('0x1')](_0x90d3('0x2'),{'body':_0x497734,'log':'CreateOpenchannelQueueReport'});};exports[_0x90d3('0x3')]=function(_0x3f09e6,_0x5c51e4){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x5c51e4,'options':{'where':{'uniqueid':_0x3f09e6},'order':[['id',_0x90d3('0x4')]],'limit':0x1},'log':_0x90d3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index f1f5925..96e0a02 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 _0x39d9=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update'];(function(_0x403314,_0x1be11f){var _0x1ae1c4=function(_0x334ba0){while(--_0x334ba0){_0x403314['push'](_0x403314['shift']());}};_0x1ae1c4(++_0x1be11f);}(_0x39d9,0x17f));var _0x939d=function(_0xf1772d,_0x1e628c){_0xf1772d=_0xf1772d-0x0;var _0xcaab31=_0x39d9[_0xf1772d];return _0xcaab31;};'use strict';var client=require(_0x939d('0x0'));exports[_0x939d('0x1')]=function(_0x3c101d,_0x379f1c){return client[_0x939d('0x2')](_0x939d('0x3'),{'body':_0x379f1c,'options':{'where':{'id':_0x3c101d}},'log':_0x939d('0x4')});};exports[_0x939d('0x5')]=function(_0x57ab6c,_0x2a9e29){return client[_0x939d('0x2')](_0x939d('0x6'),{'body':_0x2a9e29,'options':{'where':{'id':_0x57ab6c}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x26cf=['Request','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x4c6b43,_0x410b9a){var _0x17eec6=function(_0xfe07cd){while(--_0xfe07cd){_0x4c6b43['push'](_0x4c6b43['shift']());}};_0x17eec6(++_0x410b9a);}(_0x26cf,0x135));var _0xf26c=function(_0x2b823e,_0xd79dfb){_0x2b823e=_0x2b823e-0x0;var _0x644887=_0x26cf[_0x2b823e];return _0x644887;};'use strict';var client=require('../client');exports[_0xf26c('0x0')]=function(_0x40e66c,_0x53fdc0){return client[_0xf26c('0x1')]('UpdateSmsInteraction',{'body':_0x53fdc0,'options':{'where':{'id':_0x40e66c}},'log':_0xf26c('0x2')});};exports['addTags']=function(_0x314cdf,_0xf4a93f){return client['Request'](_0xf26c('0x3'),{'body':_0xf4a93f,'options':{'where':{'id':_0x314cdf}},'log':_0xf26c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 2928a5e..89da1f1 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 _0x63a4=['Request','../client','create'];(function(_0x62e59c,_0x448801){var _0x4f3458=function(_0x3baacb){while(--_0x3baacb){_0x62e59c['push'](_0x62e59c['shift']());}};_0x4f3458(++_0x448801);}(_0x63a4,0xfa));var _0x463a=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x63a4[_0x2706da];return _0x3ba87e;};'use strict';var client=require(_0x463a('0x0'));exports[_0x463a('0x1')]=function(_0x4e80ed){return client[_0x463a('0x2')]('CreateSmsMessage',{'body':_0x4e80ed,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x55a8=['../client','Request','CreateSmsMessage','createSmsMessage'];(function(_0x381ce1,_0x489f95){var _0x51d90d=function(_0x51e73c){while(--_0x51e73c){_0x381ce1['push'](_0x381ce1['shift']());}};_0x51d90d(++_0x489f95);}(_0x55a8,0xc0));var _0x855a=function(_0x282742,_0x470927){_0x282742=_0x282742-0x0;var _0x38d276=_0x55a8[_0x282742];return _0x38d276;};'use strict';var client=require(_0x855a('0x0'));exports['create']=function(_0xdc4305){return client[_0x855a('0x1')](_0x855a('0x2'),{'body':_0xdc4305,'log':_0x855a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 866504d..894ecfa 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x19f82b,_0x16f567){var _0x2569fc=function(_0x460d06){while(--_0x460d06){_0x19f82b['push'](_0x19f82b['shift']());}};_0x2569fc(++_0x16f567);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x42ea40,_0xfc9d6c){var _0x522856=function(_0x327a60){while(--_0x327a60){_0x42ea40['push'](_0x42ea40['shift']());}};_0x522856(++_0xfc9d6c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 4e2255d..7c35108 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x466f2e,_0x5e2a7f){var _0x22dfbb=function(_0x308bbf){while(--_0x308bbf){_0x466f2e['push'](_0x466f2e['shift']());}};_0x22dfbb(++_0x5e2a7f);}(_0x008c,0x188));var _0xc008=function(_0x1dfa55,_0x1d2007){_0x1dfa55=_0x1dfa55-0x0;var _0x893d0e=_0x008c[_0x1dfa55];return _0x893d0e;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0xedd9,0xfc));var _0x9edd=function(_0x42b72f,_0x3dec76){_0x42b72f=_0x42b72f-0x0;var _0xaef16a=_0xedd9[_0x42b72f];return _0xaef16a;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index aa1212b..4a5743e 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(_0x3895ff,_0x2c4e08){var _0x2b9f4a=function(_0x41b81a){while(--_0x41b81a){_0x3895ff['push'](_0x3895ff['shift']());}};_0x2b9f4a(++_0x2c4e08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x503a94,_0x4f225a){var _0x80a002=function(_0x108911){while(--_0x108911){_0x503a94['push'](_0x503a94['shift']());}};_0x80a002(++_0x4f225a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 5c306e1..cbe2ed5 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 _0x14f5=['update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x1a473a,_0x3f9c94){var _0x21bee3=function(_0x3eeee0){while(--_0x3eeee0){_0x1a473a['push'](_0x1a473a['shift']());}};_0x21bee3(++_0x3f9c94);}(_0x14f5,0xae));var _0x514f=function(_0x556f7c,_0x50a7d2){_0x556f7c=_0x556f7c-0x0;var _0x43cd64=_0x14f5[_0x556f7c];return _0x43cd64;};'use strict';var client=require('../client');exports[_0x514f('0x0')]=function(_0x4d09b3,_0x2ca71e){return client[_0x514f('0x1')](_0x514f('0x2'),{'body':_0x2ca71e,'options':{'where':{'id':_0x4d09b3}},'log':'updateWhatsappInteraction'});};exports[_0x514f('0x3')]=function(_0x2443e8,_0x483c2a){return client[_0x514f('0x1')](_0x514f('0x4'),{'body':_0x483c2a,'options':{'where':{'id':_0x2443e8}},'log':_0x514f('0x5')});}; \ No newline at end of file +var _0x3e24=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction','addTags'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0x3e24,0x167));var _0x43e2=function(_0x44b91c,_0x483ee5){_0x44b91c=_0x44b91c-0x0;var _0x2a3356=_0x3e24[_0x44b91c];return _0x2a3356;};'use strict';var client=require(_0x43e2('0x0'));exports[_0x43e2('0x1')]=function(_0x760b07,_0x3e321a){return client[_0x43e2('0x2')]('UpdateWhatsappInteraction',{'body':_0x3e321a,'options':{'where':{'id':_0x760b07}},'log':_0x43e2('0x3')});};exports[_0x43e2('0x4')]=function(_0x5d2806,_0x1dd127){return client[_0x43e2('0x2')](_0x43e2('0x5'),{'body':_0x1dd127,'options':{'where':{'id':_0x5d2806}},'log':_0x43e2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 7782e0c..2bbc898 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 _0x138c=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x54547b,_0x22f8ad){var _0x287ece=function(_0x259cf4){while(--_0x259cf4){_0x54547b['push'](_0x54547b['shift']());}};_0x287ece(++_0x22f8ad);}(_0x138c,0xaf));var _0xc138=function(_0x4a256a,_0xc6ff4){_0x4a256a=_0x4a256a-0x0;var _0x3cb6be=_0x138c[_0x4a256a];return _0x3cb6be;};'use strict';var client=require(_0xc138('0x0'));exports[_0xc138('0x1')]=function(_0x163baa){return client[_0xc138('0x2')](_0xc138('0x3'),{'body':_0x163baa,'log':_0xc138('0x4')});}; \ No newline at end of file +var _0xa206=['createWhatsappMessage','Request'];(function(_0x3f51a9,_0x2c9517){var _0x451b34=function(_0x449f5c){while(--_0x449f5c){_0x3f51a9['push'](_0x3f51a9['shift']());}};_0x451b34(++_0x2c9517);}(_0xa206,0xe3));var _0x6a20=function(_0x41f279,_0x37e806){_0x41f279=_0x41f279-0x0;var _0x4eec9b=_0xa206[_0x41f279];return _0x4eec9b;};'use strict';var client=require('../client');exports['create']=function(_0x22145b){return client[_0x6a20('0x0')]('CreateWhatsappMessage',{'body':_0x22145b,'log':_0x6a20('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index d9e4d6d..9eb23bb 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 _0x0ca4=['../client','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','User','Agents'];(function(_0x21d532,_0x4552a4){var _0x37bda1=function(_0x134a6f){while(--_0x134a6f){_0x21d532['push'](_0x21d532['shift']());}};_0x37bda1(++_0x4552a4);}(_0x0ca4,0xa8));var _0x40ca=function(_0x2f34bb,_0x3a0783){_0x2f34bb=_0x2f34bb-0x0;var _0x22be34=_0x0ca4[_0x2f34bb];return _0x22be34;};'use strict';var client=require(_0x40ca('0x0'));exports[_0x40ca('0x1')]=function(){return function(){return client['Request'](_0x40ca('0x2'),{'options':{'raw':![],'attributes':['id',_0x40ca('0x3'),_0x40ca('0x4'),_0x40ca('0x5')],'include':[{'model':_0x40ca('0x6'),'as':_0x40ca('0x7'),'attributes':['id','name','online','whatsappPause']}]},'log':_0x40ca('0x1')});};}; \ No newline at end of file +var _0xb9c0=['GetWhatsappQueue','name','timeout','strategy','User','Agents','whatsappPause','../client','getWhatsappQueues','Request'];(function(_0x3d7b6d,_0x45756a){var _0x30991e=function(_0x182e42){while(--_0x182e42){_0x3d7b6d['push'](_0x3d7b6d['shift']());}};_0x30991e(++_0x45756a);}(_0xb9c0,0xc5));var _0x0b9c=function(_0x2f886f,_0x3fb03f){_0x2f886f=_0x2f886f-0x0;var _0x3a4e84=_0xb9c0[_0x2f886f];return _0x3a4e84;};'use strict';var client=require(_0x0b9c('0x0'));exports[_0x0b9c('0x1')]=function(){return function(){return client[_0x0b9c('0x2')](_0x0b9c('0x3'),{'options':{'raw':![],'attributes':['id',_0x0b9c('0x4'),_0x0b9c('0x5'),_0x0b9c('0x6')],'include':[{'model':_0x0b9c('0x7'),'as':_0x0b9c('0x8'),'attributes':['id',_0x0b9c('0x4'),'online',_0x0b9c('0x9')]}]},'log':_0x0b9c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 825984a..23d4ecb 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 _0x06ab=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x1c8c39,_0x244969){var _0x18d8c3=function(_0x375743){while(--_0x375743){_0x1c8c39['push'](_0x1c8c39['shift']());}};_0x18d8c3(++_0x244969);}(_0x06ab,0x1cd));var _0xb06a=function(_0x2b034f,_0x647435){_0x2b034f=_0x2b034f-0x0;var _0x598f55=_0x06ab[_0x2b034f];return _0x598f55;};'use strict';var client=require(_0xb06a('0x0'));exports[_0xb06a('0x1')]=function(_0x2f2eb8){return client[_0xb06a('0x2')](_0xb06a('0x3'),{'body':_0x2f2eb8,'log':'CreateWhatsappQueueReport'});};exports[_0xb06a('0x4')]=function(_0x1b41ce,_0x63c763){return client[_0xb06a('0x2')](_0xb06a('0x5'),{'body':_0x63c763,'options':{'where':{'uniqueid':_0x1b41ce},'order':[['id',_0xb06a('0x6')]],'limit':0x1},'log':_0xb06a('0x5')});}; \ No newline at end of file +var _0x5361=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x23d7c5,_0x2a7547){var _0x350950=function(_0x26f5b6){while(--_0x26f5b6){_0x23d7c5['push'](_0x23d7c5['shift']());}};_0x350950(++_0x2a7547);}(_0x5361,0xc2));var _0x1536=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5361[_0x2be8c2];return _0x97f531;};'use strict';var client=require(_0x1536('0x0'));exports[_0x1536('0x1')]=function(_0x497930){return client[_0x1536('0x2')]('CreateWhatsappQueueReport',{'body':_0x497930,'log':_0x1536('0x3')});};exports[_0x1536('0x4')]=function(_0x48d00c,_0x3b2f09){return client[_0x1536('0x2')](_0x1536('0x5'),{'body':_0x3b2f09,'options':{'where':{'uniqueid':_0x48d00c},'order':[['id',_0x1536('0x6')]],'limit':0x1},'log':_0x1536('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index eb10e66..b004ca4 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 _0xf368=['name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','join','stop','find','timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','log','[%s][QUEUE]\x20%s','validate','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xf368,0x175));var _0x8f36=function(_0x9fe978,_0x45dc9a){_0x9fe978=_0x9fe978-0x0;var _0x1143e7=_0xf368[_0x9fe978];return _0x1143e7;};'use strict';var schema=require(_0x8f36('0x0'));var _=require('lodash');var util=require(_0x8f36('0x1'));var seqqueue=require(_0x8f36('0x2'));var logger=require(_0x8f36('0x3'))(_0x8f36('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x8f36('0x5'),'required':!![],'message':_0x8f36('0x6')},'timeout':{'type':_0x8f36('0x7'),'message':_0x8f36('0x8')}});function writeLog(_0x56cfef,_0x5dbe30,_0x41c8ac){return logger[_0x8f36('0x9')](util[_0x8f36('0xa')](_0x8f36('0xb'),_0x56cfef,_0x5dbe30['name'],_0x41c8ac));}function handleFindAgent(_0x279a6b){return function(_0x24e520){return _0x24e520[_0x8f36('0xc')][_0x8f36('0xd')]()===_0x279a6b[_0x8f36('0xd')]();};}exports[_0x8f36('0xe')]=function(_0xb94b1f,_0x2b7ee2,_0x51fae6,_0x9d2083){return function(_0x2a0713){try{var _0x11cf36={'name':_0x2b7ee2[0x0],'timeout':_0x2b7ee2[0x1]};var _0x908280=queue[_0x8f36('0x0')](_0x11cf36,{'typecast':!![]});if(_0x908280['length']){logger[_0x8f36('0xf')](_0x8f36('0x10'),_0xb94b1f,_[_0x8f36('0x11')](_0x908280,'message')[_0x8f36('0x12')](',\x20'));_0x2a0713[_0x8f36('0x13')]();}else{var _0x171e14=_[_0x8f36('0x14')](_0x51fae6['agents'],handleFindAgent(_0x11cf36[_0x8f36('0xc')]));if(_0x171e14){var _0x3e268d=(_0x11cf36[_0x8f36('0x15')]||0xa)*0x3e8;var _0x478777,_0x1eedeb;var _0xdf4aa8=seqqueue['createQueue'](_0x3e268d);_0xdf4aa8['id']=_0xb94b1f;_0xdf4aa8[_0x8f36('0x16')]=_0x3e268d;_0xdf4aa8[_0x8f36('0x17')]=_0x9d2083[_0x8f36('0x17')];writeLog(_0xb94b1f,_0x171e14,util[_0x8f36('0xa')](_0x8f36('0x18'),_0x3e268d));_0x51fae6[_0x8f36('0x19')][_0xb94b1f]['on'](_0x8f36('0x1a'),function(){logger[_0x8f36('0x9')](_0x8f36('0x1b'),_0xb94b1f);clearTimeout(_0x1eedeb);_0x1eedeb=undefined;_0xdf4aa8['close']();if(_0x51fae6['rules'][_0xb94b1f]){delete _0x51fae6[_0x8f36('0x19')][_0xb94b1f];}_0x2a0713[_0x8f36('0x13')]();});_0x51fae6[_0x8f36('0x19')][_0xb94b1f]['on'](_0x8f36('0x1c'),function(){if(_0x51fae6[_0x8f36('0x19')][_0xb94b1f]){delete _0x51fae6[_0x8f36('0x19')][_0xb94b1f];}});_0x1eedeb=setTimeout(function(){logger[_0x8f36('0x9')](_0x8f36('0x1d'),_0xb94b1f);clearTimeout(_0x1eedeb);_0xdf4aa8[_0x8f36('0x1e')]();_0x2a0713[_0x8f36('0x1f')]();},_0x3e268d);strategy[_0x8f36('0x20')](_0xdf4aa8,_0x171e14,_0x51fae6,_0x9d2083);}else{logger[_0x8f36('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0xb94b1f,_0x11cf36[_0x8f36('0xc')]);_0x2a0713['stop']();}}}catch(_0x55144e){console[_0x8f36('0x21')](_0x55144e);logger['error'](_0x8f36('0x22'),_0xb94b1f,_0x55144e['stack']);_0x2a0713[_0x8f36('0x13')]();}};}; \ No newline at end of file +var _0x5908=['message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','map'];(function(_0x28a174,_0x3a9ce2){var _0x5ec418=function(_0x434ee8){while(--_0x434ee8){_0x28a174['push'](_0x28a174['shift']());}};_0x5ec418(++_0x3a9ce2);}(_0x5908,0x84));var _0x8590=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5908[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x8590('0x0'));var _=require(_0x8590('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x8590('0x2'))(_0x8590('0x3'));var strategy=require(_0x8590('0x4'));var queue=schema({'name':{'type':_0x8590('0x5'),'required':!![],'message':_0x8590('0x6')},'timeout':{'type':_0x8590('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x56695d,_0x78e1dd,_0x16fa46){return logger[_0x8590('0x8')](util[_0x8590('0x9')](_0x8590('0xa'),_0x56695d,_0x78e1dd[_0x8590('0xb')],_0x16fa46));}function handleFindAgent(_0x2779ec){return function(_0x10bf63){return _0x10bf63['name'][_0x8590('0xc')]()===_0x2779ec[_0x8590('0xc')]();};}exports[_0x8590('0xd')]=function(_0x4b7728,_0x1cd3b8,_0x3f4831,_0x2781f7){return function(_0x12c4d1){try{var _0x1481b9={'name':_0x1cd3b8[0x0],'timeout':_0x1cd3b8[0x1]};var _0x13bfec=queue[_0x8590('0x0')](_0x1481b9,{'typecast':!![]});if(_0x13bfec['length']){logger[_0x8590('0xe')]('[%s][AGENT]\x20%s',_0x4b7728,_[_0x8590('0xf')](_0x13bfec,_0x8590('0x10'))[_0x8590('0x11')](',\x20'));_0x12c4d1[_0x8590('0x12')]();}else{var _0x40edc4=_[_0x8590('0x13')](_0x3f4831[_0x8590('0x14')],handleFindAgent(_0x1481b9[_0x8590('0xb')]));if(_0x40edc4){var _0x1f1530=(_0x1481b9[_0x8590('0x15')]||0xa)*0x3e8;var _0x209fb2,_0x359cc6;var _0x5bb15b=seqqueue[_0x8590('0x16')](_0x1f1530);_0x5bb15b['id']=_0x4b7728;_0x5bb15b[_0x8590('0x17')]=_0x1f1530;_0x5bb15b['channel']=_0x2781f7[_0x8590('0x18')];writeLog(_0x4b7728,_0x40edc4,util[_0x8590('0x9')](_0x8590('0x19'),_0x1f1530));_0x3f4831[_0x8590('0x1a')][_0x4b7728]['on'](_0x8590('0x1b'),function(){logger[_0x8590('0x8')](_0x8590('0x1c'),_0x4b7728);clearTimeout(_0x359cc6);_0x359cc6=undefined;_0x5bb15b[_0x8590('0x1d')]();if(_0x3f4831[_0x8590('0x1a')][_0x4b7728]){delete _0x3f4831[_0x8590('0x1a')][_0x4b7728];}_0x12c4d1['stop']();});_0x3f4831[_0x8590('0x1a')][_0x4b7728]['on'](_0x8590('0x1e'),function(){if(_0x3f4831['rules'][_0x4b7728]){delete _0x3f4831[_0x8590('0x1a')][_0x4b7728];}});_0x359cc6=setTimeout(function(){logger[_0x8590('0x8')]('[%s][AGENT]\x20ROUTING\x20END',_0x4b7728);clearTimeout(_0x359cc6);_0x5bb15b[_0x8590('0x1d')]();_0x12c4d1[_0x8590('0x1f')]();},_0x1f1530);strategy[_0x8590('0x20')](_0x5bb15b,_0x40edc4,_0x3f4831,_0x2781f7);}else{logger['error'](_0x8590('0x21'),_0x4b7728,_0x1481b9[_0x8590('0xb')]);_0x12c4d1[_0x8590('0x12')]();}}}catch(_0x5dd412){console[_0x8590('0x22')](_0x5dd412);logger[_0x8590('0xe')](_0x8590('0x23'),_0x4b7728,_0x5dd412[_0x8590('0x24')]);_0x12c4d1['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 15234ed..f27c087 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 _0x0b9d=['lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','then','body','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','error','providerName','amazonlex','providerResponse','Message','create','catch'];(function(_0xc76647,_0x262294){var _0x81490d=function(_0x5788f0){while(--_0x5788f0){_0xc76647['push'](_0xc76647['shift']());}};_0x81490d(++_0x262294);}(_0x0b9d,0x1a7));var _0xd0b9=function(_0x54c7ec,_0x4dcacc){_0x54c7ec=_0x54c7ec-0x0;var _0x4ac41e=_0x0b9d[_0x54c7ec];return _0x4ac41e;};'use strict';var _=require(_0xd0b9('0x0'));var moment=require(_0xd0b9('0x1'));var AWS=require(_0xd0b9('0x2'));var utils=require(_0xd0b9('0x3'));var logger=require('../../../../config/logger')(_0xd0b9('0x4'));var rpc={'chatMessage':require(_0xd0b9('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd0b9('0x6')),'faxMessage':require(_0xd0b9('0x7')),'whatsappMessage':require(_0xd0b9('0x8'))};exports['consequence']=function(_0x27a22,_0x534390){return function(_0x464d9b){try{if(!_[_0xd0b9('0x9')](this[_0xd0b9('0xa')][_0xd0b9('0xb')])){logger[_0xd0b9('0xc')](_0xd0b9('0xd'),_0x27a22,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x464d9b[_0xd0b9('0xe')]();}var _0x39647e={'ContactId':this['contact']['id'],'sentAt':moment()[_0xd0b9('0xf')](_0xd0b9('0x10')),'direction':_0xd0b9('0x11')};if(this[_0xd0b9('0x12')]===_0xd0b9('0x13')||this[_0xd0b9('0x12')]===_0xd0b9('0x14')){_0x39647e['phone']=this[_0xd0b9('0xa')][_0xd0b9('0x15')];}var _0x24836e=this[_0xd0b9('0x12')];if(_0x24836e===_0xd0b9('0x16')){_0x39647e[_0xd0b9('0x17')]=this[_0xd0b9('0x18')]['id'];}else{_0x39647e[_[_0xd0b9('0x19')](_0x24836e)+_0xd0b9('0x1a')]=this['account']['id'];}_0x39647e[_[_0xd0b9('0x19')](_0x24836e)+'InteractionId']=this[_0xd0b9('0xa')]['id'];if(this[_0xd0b9('0xa')][_0xd0b9('0x1b')]){var _0x4d6140=_0x534390[0x4];if(!_[_0xd0b9('0x1c')](_0x4d6140)){_0x39647e['body']=utils[_0xd0b9('0x1d')](_0x4d6140,this);return rpc[_0x24836e+'Message']['create'](_0x39647e)[_0xd0b9('0x1e')](function(_0xddcc7d){logger[_0xd0b9('0xc')](_0xd0b9('0xd'),_0x27a22,_0x39647e[_0xd0b9('0x1f')]);})['catch'](function(_0x4782f4){logger['error'](_0xd0b9('0xd'),_0x27a22,JSON[_0xd0b9('0x20')](_0x4782f4));})[_0xd0b9('0x21')](function(){logger[_0xd0b9('0xc')](_0xd0b9('0x22'),_0x27a22);_0x464d9b[_0xd0b9('0x23')]();});}else{logger[_0xd0b9('0xc')](_0xd0b9('0x24'),_0x27a22);_0x464d9b[_0xd0b9('0x23')]();}}else{var _0x1d8e09=this;var _0x2813ee=new AWS[(_0xd0b9('0x25'))]({'accessKeyId':_0x534390[0x0],'secretAccessKey':_0x534390[0x1],'region':_0x534390[0x2]});var _0x39b98d={'botAlias':'$LATEST','botName':_0x534390[0x3],'inputText':this[_0xd0b9('0x26')]['body'],'userId':this[_0xd0b9('0x12')]+':'+this[_0xd0b9('0xa')]['id'][_0xd0b9('0x27')]()};_0x2813ee['postText'](_0x39b98d,function(_0x54ebf7,_0x4a185b){if(_0x54ebf7){logger[_0xd0b9('0x28')]('[%s][AMAZONLEX]\x20%s',_0x27a22,_0x54ebf7[_0xd0b9('0x26')]);_0x464d9b[_0xd0b9('0xe')]();}else if(_0x4a185b&&_0x4a185b[_0xd0b9('0x26')]){_0x1d8e09['body']['amazonlex']=_0x4a185b;_0x39647e[_0xd0b9('0x1f')]=_0x4a185b[_0xd0b9('0x26')];_0x39647e[_0xd0b9('0x29')]=_0xd0b9('0x2a');_0x39647e[_0xd0b9('0x2b')]=JSON[_0xd0b9('0x20')](_0x4a185b);return rpc[_0x24836e+_0xd0b9('0x2c')][_0xd0b9('0x2d')](_0x39647e)['then'](function(_0x583328){logger['info']('[%s][AMAZONLEX]\x20%s',_0x27a22,_0x39647e[_0xd0b9('0x1f')]);if(_0x4a185b['dialogState']=='Failed'){_0x464d9b['next']();}else{_0x464d9b['stop']();}})[_0xd0b9('0x2e')](function(_0x426031){logger[_0xd0b9('0x28')](_0xd0b9('0xd'),_0x27a22,JSON[_0xd0b9('0x20')](_0x426031));_0x464d9b[_0xd0b9('0xe')]();});}else{_0x464d9b[_0xd0b9('0xe')]();}});}}catch(_0x5086db){logger['error'](_0xd0b9('0xd'),_0x27a22,JSON['stringify'](_0x5086db));_0x464d9b[_0xd0b9('0x23')]();}};}; \ No newline at end of file +var _0x3d2e=['lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','isEmpty','getMustacheRender','Message','then','body','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','toString','postText','message','amazonlex','providerName','providerResponse','create','dialogState','error'];(function(_0x11d7f5,_0x37ff3d){var _0x15ecf3=function(_0x3d30f6){while(--_0x3d30f6){_0x11d7f5['push'](_0x11d7f5['shift']());}};_0x15ecf3(++_0x37ff3d);}(_0x3d2e,0x15e));var _0xe3d2=function(_0x1b59e7,_0x2d3967){_0x1b59e7=_0x1b59e7-0x0;var _0x127625=_0x3d2e[_0x1b59e7];return _0x127625;};'use strict';var _=require(_0xe3d2('0x0'));var moment=require(_0xe3d2('0x1'));var AWS=require(_0xe3d2('0x2'));var utils=require(_0xe3d2('0x3'));var logger=require(_0xe3d2('0x4'))(_0xe3d2('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe3d2('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe3d2('0x7')),'faxMessage':require(_0xe3d2('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xe3d2('0x9')]=function(_0x52c32e,_0x12cdc2){return function(_0x270d40){try{if(!_[_0xe3d2('0xa')](this[_0xe3d2('0xb')][_0xe3d2('0xc')])){logger[_0xe3d2('0xd')](_0xe3d2('0xe'),_0x52c32e,_0xe3d2('0xf'));return _0x270d40[_0xe3d2('0x10')]();}var _0x2b5987={'ContactId':this['contact']['id'],'sentAt':moment()[_0xe3d2('0x11')](_0xe3d2('0x12')),'direction':_0xe3d2('0x13')};if(this[_0xe3d2('0x14')]===_0xe3d2('0x15')||this['channel']==='whatsapp'){_0x2b5987[_0xe3d2('0x16')]=this[_0xe3d2('0xb')][_0xe3d2('0x16')];}var _0xa78e25=this[_0xe3d2('0x14')];if(_0xa78e25===_0xe3d2('0x17')){_0x2b5987[_0xe3d2('0x18')]=this['account']['id'];}else{_0x2b5987[_[_0xe3d2('0x19')](_0xa78e25)+_0xe3d2('0x1a')]=this[_0xe3d2('0x1b')]['id'];}_0x2b5987[_[_0xe3d2('0x19')](_0xa78e25)+'InteractionId']=this[_0xe3d2('0xb')]['id'];if(this[_0xe3d2('0xb')]['created']){var _0x45dbe0=_0x12cdc2[0x4];if(!_[_0xe3d2('0x1c')](_0x45dbe0)){_0x2b5987['body']=utils[_0xe3d2('0x1d')](_0x45dbe0,this);return rpc[_0xa78e25+_0xe3d2('0x1e')]['create'](_0x2b5987)[_0xe3d2('0x1f')](function(_0x1584b8){logger[_0xe3d2('0xd')]('[%s][AMAZONLEX]\x20%s',_0x52c32e,_0x2b5987[_0xe3d2('0x20')]);})[_0xe3d2('0x21')](function(_0x22eb2c){logger['error'](_0xe3d2('0xe'),_0x52c32e,JSON[_0xe3d2('0x22')](_0x22eb2c));})[_0xe3d2('0x23')](function(){logger[_0xe3d2('0xd')](_0xe3d2('0x24'),_0x52c32e);_0x270d40['stop']();});}else{logger[_0xe3d2('0xd')](_0xe3d2('0x25'),_0x52c32e);_0x270d40[_0xe3d2('0x26')]();}}else{var _0x472d67=this;var _0x129cf2=new AWS[(_0xe3d2('0x27'))]({'accessKeyId':_0x12cdc2[0x0],'secretAccessKey':_0x12cdc2[0x1],'region':_0x12cdc2[0x2]});var _0x234190={'botAlias':_0xe3d2('0x28'),'botName':_0x12cdc2[0x3],'inputText':this['message'][_0xe3d2('0x20')],'userId':this[_0xe3d2('0x14')]+':'+this[_0xe3d2('0xb')]['id'][_0xe3d2('0x29')]()};_0x129cf2[_0xe3d2('0x2a')](_0x234190,function(_0x51fb6d,_0x96e2e6){if(_0x51fb6d){logger['error'](_0xe3d2('0xe'),_0x52c32e,_0x51fb6d[_0xe3d2('0x2b')]);_0x270d40[_0xe3d2('0x10')]();}else if(_0x96e2e6&&_0x96e2e6['message']){_0x472d67[_0xe3d2('0x20')][_0xe3d2('0x2c')]=_0x96e2e6;_0x2b5987[_0xe3d2('0x20')]=_0x96e2e6[_0xe3d2('0x2b')];_0x2b5987[_0xe3d2('0x2d')]=_0xe3d2('0x2c');_0x2b5987[_0xe3d2('0x2e')]=JSON[_0xe3d2('0x22')](_0x96e2e6);return rpc[_0xa78e25+_0xe3d2('0x1e')][_0xe3d2('0x2f')](_0x2b5987)[_0xe3d2('0x1f')](function(_0x47d327){logger[_0xe3d2('0xd')](_0xe3d2('0xe'),_0x52c32e,_0x2b5987[_0xe3d2('0x20')]);if(_0x96e2e6[_0xe3d2('0x30')]=='Failed'){_0x270d40[_0xe3d2('0x10')]();}else{_0x270d40[_0xe3d2('0x26')]();}})['catch'](function(_0x2b2576){logger[_0xe3d2('0x31')](_0xe3d2('0xe'),_0x52c32e,JSON['stringify'](_0x2b2576));_0x270d40[_0xe3d2('0x10')]();});}else{_0x270d40[_0xe3d2('0x10')]();}});}}catch(_0x2831c9){logger[_0xe3d2('0x31')]('[%s][AMAZONLEX]\x20%s',_0x52c32e,JSON[_0xe3d2('0x22')](_0x2831c9));_0x270d40[_0xe3d2('0x26')]();}};}; \ 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 ecaadd0..faedfdc 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 _0x65ca=['../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','account','upperFirst','Message','inReplyTo','html','','','headers','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x35a8ad,_0x5562b0){var _0xddb0e1=function(_0x95dd6e){while(--_0x95dd6e){_0x35a8ad['push'](_0x35a8ad['shift']());}};_0xddb0e1(++_0x5562b0);}(_0x65ca,0xfd));var _0xa65c=function(_0x2b63a0,_0x14fc48){_0x2b63a0=_0x2b63a0-0x0;var _0x4f0434=_0x65ca[_0x2b63a0];return _0x4f0434;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0xa65c('0x0'));var logger=require(_0xa65c('0x1'))(_0xa65c('0x2'));var rpc={'chatMessage':require(_0xa65c('0x3')),'openchannelMessage':require(_0xa65c('0x4')),'mailMessage':require(_0xa65c('0x5')),'smsMessage':require(_0xa65c('0x6')),'faxMessage':require(_0xa65c('0x7')),'whatsappMessage':require(_0xa65c('0x8')),'chatInteraction':require(_0xa65c('0x9')),'openchannelInteraction':require(_0xa65c('0xa')),'mailInteraction':require(_0xa65c('0xb')),'smsInteraction':require(_0xa65c('0xc')),'faxInteraction':require(_0xa65c('0xd')),'whatsappInteraction':require(_0xa65c('0xe'))};var mailRpc=require('../../mailRpc');exports[_0xa65c('0xf')]=function(_0x1751d0,_0x32626b,_0x4ac902,_0x21fb38){return function(_0x5e5ddd){try{var _0x176631=this[_0xa65c('0x10')];if(_0x176631===_0xa65c('0x11')&&_0x21fb38[_0xa65c('0x12')][_0xa65c('0x13')]){logger[_0xa65c('0x14')](_0xa65c('0x15'),_0x1751d0,_0xa65c('0x16'));return _0x5e5ddd[_0xa65c('0x17')]();}if(_0x32626b[0x0]==='1'&&(_[_0xa65c('0x18')](this['interaction'][_0xa65c('0x19')])||!this[_0xa65c('0x1a')]['created'])){logger[_0xa65c('0x14')](_0xa65c('0x15'),_0x1751d0,'Autoreply\x20already\x20sent');return _0x5e5ddd[_0xa65c('0x17')]();}if(_0x32626b[0x0]==='2'&&this[_0xa65c('0x1a')][_0xa65c('0x1b')]){logger[_0xa65c('0x14')](_0xa65c('0x1c'),_0x1751d0,_0xa65c('0x1d'));return _0x5e5ddd[_0xa65c('0x17')]();}var _0x3743ee={'ContactId':this[_0xa65c('0x1e')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa65c('0x1f')};if(this[_0xa65c('0x10')]===_0xa65c('0x11')){_0x3743ee['body']=utils[_0xa65c('0x20')](_0x32626b[0x2],this);}else{_0x3743ee['body']=utils[_0xa65c('0x20')](_0x32626b[0x1],this);}if(this[_0xa65c('0x21')]){_0x3743ee['to']=this[_0xa65c('0x21')][_0xa65c('0x22')]||'';if(this[_0xa65c('0x10')]==='mail'&&_0x32626b[0x1]==='1'){_0x3743ee['cc']=this[_0xa65c('0x21')]['cc']||'';}_0x3743ee['from']=this[_0xa65c('0x21')]['to']||'';_0x3743ee[_0xa65c('0x23')]=this[_0xa65c('0x21')][_0xa65c('0x23')]||'';_0x3743ee[_0xa65c('0x24')]=!![];if(this[_0xa65c('0x21')][_0xa65c('0x25')]){_0x3743ee[_0xa65c('0x25')]='';_0x3743ee[_0xa65c('0x25')]+=_[_0xa65c('0x26')](this[_0xa65c('0x21')][_0xa65c('0x25')],'Re:')?'':_0xa65c('0x27');_0x3743ee[_0xa65c('0x25')]+=this[_0xa65c('0x21')][_0xa65c('0x25')];}}if(this[_0xa65c('0x10')]===_0xa65c('0x28')){_0x3743ee['ChatWebsiteId']=this[_0xa65c('0x29')]['id'];}else{_0x3743ee[_[_0xa65c('0x2a')](this[_0xa65c('0x10')])+'AccountId']=this[_0xa65c('0x29')]['id'];}_0x3743ee[_[_0xa65c('0x2a')](this[_0xa65c('0x10')])+'InteractionId']=this[_0xa65c('0x1a')]['id'];var _0x2116e1=this[_0xa65c('0x1a')];if(rpc[this['channel']+_0xa65c('0x2b')]){if(this['channel']==='mail'){_0x3743ee[_0xa65c('0x2c')]=this[_0xa65c('0x21')]['messageId'];_0x3743ee[_0xa65c('0x2d')]=_0xa65c('0x2e')+_['replace'](_0x3743ee[_0xa65c('0x12')],'','auto-replied','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','stringify','catch','error','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','update','lodash','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s'];(function(_0x5a4dd0,_0x2f5b16){var _0x2d3967=function(_0x46013a){while(--_0x46013a){_0x5a4dd0['push'](_0x5a4dd0['shift']());}};_0x2d3967(++_0x2f5b16);}(_0x0e83,0x120));var _0x30e8=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x0e83[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x30e8('0x0'));var moment=require(_0x30e8('0x1'));var utils=require('./utils');var logger=require(_0x30e8('0x2'))('routing');var rpc={'chatMessage':require(_0x30e8('0x3')),'openchannelMessage':require(_0x30e8('0x4')),'mailMessage':require(_0x30e8('0x5')),'smsMessage':require(_0x30e8('0x6')),'faxMessage':require(_0x30e8('0x7')),'whatsappMessage':require(_0x30e8('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x30e8('0x9')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x30e8('0xa')),'whatsappInteraction':require(_0x30e8('0xb'))};var mailRpc=require(_0x30e8('0xc'));exports['consequence']=function(_0x3efe01,_0x488a26,_0x143d55,_0x2c64c5){return function(_0x1309e7){try{var _0x5171be=this[_0x30e8('0xd')];if(_0x5171be===_0x30e8('0xe')&&_0x2c64c5[_0x30e8('0xf')][_0x30e8('0x10')]){logger[_0x30e8('0x11')](_0x30e8('0x12'),_0x3efe01,_0x30e8('0x13'));return _0x1309e7[_0x30e8('0x14')]();}if(_0x488a26[0x0]==='1'&&(_[_0x30e8('0x15')](this['interaction'][_0x30e8('0x16')])||!this[_0x30e8('0x17')][_0x30e8('0x16')])){logger[_0x30e8('0x11')]('[%s][AUTOREPLY]\x20%s',_0x3efe01,_0x30e8('0x18'));return _0x1309e7['next']();}if(_0x488a26[0x0]==='2'&&this[_0x30e8('0x17')][_0x30e8('0x19')]){logger['info'](_0x30e8('0x1a'),_0x3efe01,'One\x20Time\x20already\x20sent');return _0x1309e7[_0x30e8('0x14')]();}var _0x539171={'ContactId':this[_0x30e8('0x1b')]['id'],'sentAt':moment()[_0x30e8('0x1c')](_0x30e8('0x1d')),'direction':_0x30e8('0x1e')};if(this[_0x30e8('0xd')]===_0x30e8('0xe')){_0x539171[_0x30e8('0xf')]=utils[_0x30e8('0x1f')](_0x488a26[0x2],this);}else{_0x539171[_0x30e8('0xf')]=utils['getMustacheRender'](_0x488a26[0x1],this);}if(this[_0x30e8('0x20')]){_0x539171['to']=this[_0x30e8('0x20')][_0x30e8('0x21')]||'';if(this[_0x30e8('0xd')]===_0x30e8('0xe')&&_0x488a26[0x1]==='1'){_0x539171['cc']=this[_0x30e8('0x20')]['cc']||'';}_0x539171[_0x30e8('0x21')]=this['message']['to']||'';_0x539171['phone']=this['message'][_0x30e8('0x22')]||'';_0x539171[_0x30e8('0x23')]=!![];if(this[_0x30e8('0x20')][_0x30e8('0x24')]){_0x539171['subject']='';_0x539171[_0x30e8('0x24')]+=_['startsWith'](this[_0x30e8('0x20')][_0x30e8('0x24')],_0x30e8('0x25'))?'':'Re:\x20';_0x539171[_0x30e8('0x24')]+=this[_0x30e8('0x20')][_0x30e8('0x24')];}}if(this['channel']===_0x30e8('0x26')){_0x539171[_0x30e8('0x27')]=this['account']['id'];}else{_0x539171[_[_0x30e8('0x28')](this['channel'])+'AccountId']=this['account']['id'];}_0x539171[_['upperFirst'](this['channel'])+'InteractionId']=this[_0x30e8('0x17')]['id'];var _0x149a56=this[_0x30e8('0x17')];if(rpc[this[_0x30e8('0xd')]+_0x30e8('0x29')]){if(this[_0x30e8('0xd')]==='mail'){_0x539171[_0x30e8('0x2a')]=this[_0x30e8('0x20')]['messageId'];_0x539171['html']=''+_[_0x30e8('0x2b')](_0x539171[_0x30e8('0xf')],_0x30e8('0x2c'),_0x30e8('0x2d'))+_0x30e8('0x2e');_0x539171['headers']={'Auto-Submitted':_0x30e8('0x2f'),'X-Auto-Response-Suppress':_0x30e8('0x30'),'Precedence':_0x30e8('0x31')};return mailRpc['sendMailMessage'](this['account'][_0x30e8('0x32')],_0x539171)[_0x30e8('0x33')](function(_0x3b6e7b){logger[_0x30e8('0x11')](_0x30e8('0x34'),_0x3efe01);_0x539171['messageId']=_0x3b6e7b[_0x30e8('0x20')][_0x30e8('0x35')];return rpc[_0x5171be+'Message']['create'](_0x539171);})[_0x30e8('0x33')](function(_0xbb67de){logger[_0x30e8('0x11')]('[%s][AUTOREPLY]\x20%s',_0x3efe01,JSON[_0x30e8('0x36')](_0xbb67de));})[_0x30e8('0x37')](function(_0xc307a6){logger[_0x30e8('0x38')]('[RPC][%s][AUTOREPLY]\x20%s',_0x3efe01,JSON['stringify'](_0xc307a6));})[_0x30e8('0x39')](function(){Promise[_0x30e8('0x3a')]()[_0x30e8('0x33')](function(){if(_0x488a26[0x0]!=='2'||_0x149a56['autoreplyExecuted'])return;return rpc[_0x5171be+_0x30e8('0x3b')]['update'](_0x149a56['id'],{'autoreplyExecuted':!![]})[_0x30e8('0x33')](function(_0x269810){logger[_0x30e8('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3efe01,JSON['stringify'](_0x269810));})[_0x30e8('0x37')](function(_0xb1005c){logger[_0x30e8('0x38')](_0x30e8('0x3c'),_0x3efe01,JSON[_0x30e8('0x36')](_0xb1005c));});})[_0x30e8('0x33')](function(){_0x1309e7[_0x30e8('0x14')]();});});}else{return rpc[this[_0x30e8('0xd')]+_0x30e8('0x29')][_0x30e8('0x3d')](_0x539171)[_0x30e8('0x33')](function(){logger['info'](_0x30e8('0x12'),_0x3efe01,_0x539171[_0x30e8('0xf')]);})['catch'](function(_0x1065d2){logger[_0x30e8('0x38')](_0x30e8('0x12'),_0x3efe01,JSON[_0x30e8('0x36')](_0x1065d2));})['finally'](function(){Promise[_0x30e8('0x3a')]()[_0x30e8('0x33')](function(){if(_0x488a26[0x0]!=='2'||_0x149a56['autoreplyExecuted'])return;return rpc[_0x5171be+'Interaction'][_0x30e8('0x3e')](_0x149a56['id'],{'autoreplyExecuted':!![]})[_0x30e8('0x33')](function(_0x32f299){logger['info'](_0x30e8('0x1a'),_0x3efe01,JSON[_0x30e8('0x36')](_0x32f299));})[_0x30e8('0x37')](function(_0x3f3102){logger[_0x30e8('0x38')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3efe01,JSON[_0x30e8('0x36')](_0x3f3102));});})[_0x30e8('0x33')](function(){_0x1309e7['next']();});});}}}catch(_0x3848eb){logger[_0x30e8('0x38')](_0x30e8('0x12'),_0x3efe01,JSON[_0x30e8('0x36')](_0x3848eb));_0x1309e7['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 8aa1b89..14bf67d 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x028f=['finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify'];(function(_0x4efbdc,_0x39906a){var _0x2659ec=function(_0x4569e4){while(--_0x4569e4){_0x4efbdc['push'](_0x4efbdc['shift']());}};_0x2659ec(++_0x39906a);}(_0x028f,0xf2));var _0xf028=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x028f[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xf028('0x0'));var logger=require(_0xf028('0x1'))(_0xf028('0x2'));var rpc={'chatInteraction':require(_0xf028('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xf028('0x4')),'mailInteraction':require(_0xf028('0x5')),'faxInteraction':require(_0xf028('0x6')),'whatsappInteraction':require(_0xf028('0x7'))};exports[_0xf028('0x8')]=function(_0x31dbc8,_0x3d74f2,_0x1a5f4a,_0x4cb0c4){return function(_0x30f757){try{logger[_0xf028('0x9')]('[%s][CLOSE]\x20reason\x20%s',_0x31dbc8,_0x3d74f2[0x0]);var _0x5f4c30={'closed':0x1,'closedAt':moment()[_0xf028('0xa')](_0xf028('0xb')),'closeReason':_0xf028('0xc'),'disposition':_0x3d74f2[0x0]};if(rpc[_0x4cb0c4[_0xf028('0xd')]+_0xf028('0xe')]){rpc[_0x4cb0c4[_0xf028('0xd')]+_0xf028('0xe')][_0xf028('0xf')](_0x4cb0c4[_0xf028('0x10')]['id'],_0x5f4c30)['then'](function(_0x3ac058){logger[_0xf028('0x9')](_0xf028('0x11'),_0x31dbc8,_0x4cb0c4['interaction']['id']);})[_0xf028('0x12')](function(_0x1a7fdc){logger[_0xf028('0x13')](_0xf028('0x14'),_0x31dbc8,JSON[_0xf028('0x15')](_0x1a7fdc));})[_0xf028('0x16')](function(){_0x30f757[_0xf028('0x17')]();});}}catch(_0x49b5ad){logger[_0xf028('0x13')]('[%s][CLOSE]\x20%s',_0x31dbc8,JSON[_0xf028('0x15')](_0x49b5ad));_0x30f757[_0xf028('0x17')]();}};}; \ No newline at end of file +var _0xa7bd=['[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence'];(function(_0x118416,_0x27c497){var _0x450d2c=function(_0x43b2c4){while(--_0x43b2c4){_0x118416['push'](_0x118416['shift']());}};_0x450d2c(++_0x27c497);}(_0xa7bd,0x186));var _0xda7b=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0xa7bd[_0x51674a];return _0x13fca6;};'use strict';var moment=require(_0xda7b('0x0'));var logger=require(_0xda7b('0x1'))(_0xda7b('0x2'));var rpc={'chatInteraction':require(_0xda7b('0x3')),'openchannelInteraction':require(_0xda7b('0x4')),'smsInteraction':require(_0xda7b('0x5')),'mailInteraction':require(_0xda7b('0x6')),'faxInteraction':require(_0xda7b('0x7')),'whatsappInteraction':require(_0xda7b('0x8'))};exports[_0xda7b('0x9')]=function(_0x4176fa,_0x5e25f2,_0x381eaf,_0x3290ec){return function(_0x585f90){try{logger['info'](_0xda7b('0xa'),_0x4176fa,_0x5e25f2[0x0]);var _0x3ec7d8={'closed':0x1,'closedAt':moment()[_0xda7b('0xb')](_0xda7b('0xc')),'closeReason':_0xda7b('0xd'),'disposition':_0x5e25f2[0x0]};if(rpc[_0x3290ec[_0xda7b('0xe')]+_0xda7b('0xf')]){rpc[_0x3290ec[_0xda7b('0xe')]+_0xda7b('0xf')][_0xda7b('0x10')](_0x3290ec[_0xda7b('0x11')]['id'],_0x3ec7d8)[_0xda7b('0x12')](function(_0x14813a){logger['info'](_0xda7b('0x13'),_0x4176fa,_0x3290ec[_0xda7b('0x11')]['id']);})['catch'](function(_0xaff2cd){logger['error'](_0xda7b('0x14'),_0x4176fa,JSON[_0xda7b('0x15')](_0xaff2cd));})[_0xda7b('0x16')](function(){_0x585f90[_0xda7b('0x17')]();});}}catch(_0x5642a2){logger[_0xda7b('0x18')](_0xda7b('0x14'),_0x4176fa,JSON[_0xda7b('0x15')](_0x5642a2));_0x585f90[_0xda7b('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index c6d8e1f..48fdf95 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1c6=['routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','body','Message','create','info','[%s][DIALOGFLOW]\x20%s','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','fulfillment','speech','providerName','providerResponse','metadata','endConversation','catch','stringify','stop','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger'];(function(_0x276301,_0x331dcb){var _0x47a4a0=function(_0x2d5e30){while(--_0x2d5e30){_0x276301['push'](_0x276301['shift']());}};_0x47a4a0(++_0x331dcb);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x80ae84,_0x298a81){_0x80ae84=_0x80ae84-0x0;var _0x2e59bf=_0xf1c6[_0x80ae84];return _0x2e59bf;};'use strict';var _=require(_0x6f1c('0x0'));var moment=require(_0x6f1c('0x1'));var apiai=require(_0x6f1c('0x2'));var md5=require(_0x6f1c('0x3'));var utils=require(_0x6f1c('0x4'));var logger=require(_0x6f1c('0x5'))(_0x6f1c('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6f1c('0x7')),'mailMessage':require(_0x6f1c('0x8')),'smsMessage':require(_0x6f1c('0x9')),'faxMessage':require(_0x6f1c('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x1a3460,_0x2d0f02){return function(_0x3f7b30){try{if(!_[_0x6f1c('0xb')](this[_0x6f1c('0xc')][_0x6f1c('0xd')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x1a3460,_0x6f1c('0xe'));return _0x3f7b30[_0x6f1c('0xf')]();}var _0xed1cca={'ContactId':this[_0x6f1c('0x10')]['id'],'sentAt':moment()[_0x6f1c('0x11')](_0x6f1c('0x12')),'direction':'out'};if(this[_0x6f1c('0x13')]===_0x6f1c('0x14')||this['channel']===_0x6f1c('0x15')){_0xed1cca['phone']=this['interaction'][_0x6f1c('0x16')];}var _0x2d5956=this['channel'];if(_0x2d5956==='chat'){_0xed1cca[_0x6f1c('0x17')]=this['account']['id'];}else{_0xed1cca[_[_0x6f1c('0x18')](_0x2d5956)+_0x6f1c('0x19')]=this[_0x6f1c('0x1a')]['id'];}_0xed1cca[_[_0x6f1c('0x18')](_0x2d5956)+_0x6f1c('0x1b')]=this[_0x6f1c('0xc')]['id'];if(this[_0x6f1c('0xc')]['created']){var _0x2ca612=_0x2d0f02[0x2];if(!_['isEmpty'](_0x2ca612)){_0xed1cca[_0x6f1c('0x1c')]=utils['getMustacheRender'](_0x2ca612,this);return rpc[_0x2d5956+_0x6f1c('0x1d')][_0x6f1c('0x1e')](_0xed1cca)['then'](function(_0x5475d6){logger[_0x6f1c('0x1f')](_0x6f1c('0x20'),_0x1a3460,_0xed1cca[_0x6f1c('0x1c')]);})['catch'](function(_0x202aa9){logger[_0x6f1c('0x21')](_0x6f1c('0x20'),_0x1a3460,JSON['stringify'](_0x202aa9));})[_0x6f1c('0x22')](function(){logger[_0x6f1c('0x1f')](_0x6f1c('0x23'),_0x1a3460);_0x3f7b30['stop']();});}else{logger[_0x6f1c('0x1f')](_0x6f1c('0x24'),_0x1a3460);_0x3f7b30['stop']();}}else{var _0x20fd66=this;var _0x1f7ac2=apiai(_0x2d0f02[0x0],{'language':_0x2d0f02[0x1]||'en'});return _0x1f7ac2[_0x6f1c('0x25')](this[_0x6f1c('0x26')]['body'],{'sessionId':md5(this[_0x6f1c('0xc')]['id'])})[_0x6f1c('0x27')](function(_0x235773){_0x20fd66[_0x6f1c('0x1c')][_0x6f1c('0x28')]=_0x235773;_0xed1cca[_0x6f1c('0x1c')]=_0x235773['result'][_0x6f1c('0x29')][_0x6f1c('0x2a')];_0xed1cca[_0x6f1c('0x2b')]=_0x6f1c('0x28');_0xed1cca[_0x6f1c('0x2c')]=JSON['stringify'](_0x235773);return rpc[_0x2d5956+_0x6f1c('0x1d')][_0x6f1c('0x1e')](_0xed1cca)[_0x6f1c('0x27')](function(_0x1faa4a){logger[_0x6f1c('0x1f')](_0x6f1c('0x20'),_0x1a3460,_0xed1cca['body']);if(_0x235773['result'][_0x6f1c('0x2d')][_0x6f1c('0x2e')]){_0x3f7b30[_0x6f1c('0xf')]();}else{_0x3f7b30['stop']();}})[_0x6f1c('0x2f')](function(_0x1e861c){logger[_0x6f1c('0x21')](_0x6f1c('0x20'),_0x1a3460,JSON['stringify'](_0x1e861c));_0x3f7b30[_0x6f1c('0xf')]();});})[_0x6f1c('0x2f')](function(_0x5c09ba){logger[_0x6f1c('0x21')](_0x6f1c('0x20'),_0x1a3460,_0x5c09ba[_0x6f1c('0x26')]);_0x3f7b30['next']();});}}catch(_0x477e37){logger['error'](_0x6f1c('0x20'),_0x1a3460,JSON[_0x6f1c('0x30')](_0x477e37));_0x3f7b30[_0x6f1c('0x31')]();}};}; \ No newline at end of file +var _0xb0e5=['phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','metadata','endConversation','error','lodash','moment','apiai-promise','md5','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','sms','whatsapp'];(function(_0x2b2802,_0x226fa7){var _0x9b9c95=function(_0xd6c323){while(--_0xd6c323){_0x2b2802['push'](_0x2b2802['shift']());}};_0x9b9c95(++_0x226fa7);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x4cb272,_0x52c0e9){_0x4cb272=_0x4cb272-0x0;var _0x57b4aa=_0xb0e5[_0x4cb272];return _0x57b4aa;};'use strict';var _=require(_0x5b0e('0x0'));var moment=require(_0x5b0e('0x1'));var apiai=require(_0x5b0e('0x2'));var md5=require(_0x5b0e('0x3'));var utils=require(_0x5b0e('0x4'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x5b0e('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5b0e('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x5b0e('0x7')),'whatsappMessage':require(_0x5b0e('0x8'))};exports['consequence']=function(_0x598ede,_0xbed2ff){return function(_0x1bf5d0){try{if(!_[_0x5b0e('0x9')](this[_0x5b0e('0xa')][_0x5b0e('0xb')])){logger[_0x5b0e('0xc')](_0x5b0e('0xd'),_0x598ede,_0x5b0e('0xe'));return _0x1bf5d0[_0x5b0e('0xf')]();}var _0x4fcc26={'ContactId':this[_0x5b0e('0x10')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x5b0e('0x11')};if(this[_0x5b0e('0x12')]===_0x5b0e('0x13')||this['channel']===_0x5b0e('0x14')){_0x4fcc26['phone']=this['interaction'][_0x5b0e('0x15')];}var _0x406789=this[_0x5b0e('0x12')];if(_0x406789===_0x5b0e('0x16')){_0x4fcc26[_0x5b0e('0x17')]=this[_0x5b0e('0x18')]['id'];}else{_0x4fcc26[_[_0x5b0e('0x19')](_0x406789)+_0x5b0e('0x1a')]=this[_0x5b0e('0x18')]['id'];}_0x4fcc26[_[_0x5b0e('0x19')](_0x406789)+_0x5b0e('0x1b')]=this[_0x5b0e('0xa')]['id'];if(this[_0x5b0e('0xa')][_0x5b0e('0x1c')]){var _0x650ade=_0xbed2ff[0x2];if(!_[_0x5b0e('0x1d')](_0x650ade)){_0x4fcc26[_0x5b0e('0x1e')]=utils[_0x5b0e('0x1f')](_0x650ade,this);return rpc[_0x406789+_0x5b0e('0x20')][_0x5b0e('0x21')](_0x4fcc26)[_0x5b0e('0x22')](function(_0x17ac8f){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x598ede,_0x4fcc26[_0x5b0e('0x1e')]);})[_0x5b0e('0x23')](function(_0x8ad0fa){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x598ede,JSON[_0x5b0e('0x24')](_0x8ad0fa));})['finally'](function(){logger[_0x5b0e('0xc')](_0x5b0e('0x25'),_0x598ede);_0x1bf5d0[_0x5b0e('0x26')]();});}else{logger[_0x5b0e('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x598ede);_0x1bf5d0['stop']();}}else{var _0x48c484=this;var _0x497aa2=apiai(_0xbed2ff[0x0],{'language':_0xbed2ff[0x1]||'en'});return _0x497aa2[_0x5b0e('0x27')](this[_0x5b0e('0x28')][_0x5b0e('0x1e')],{'sessionId':md5(this[_0x5b0e('0xa')]['id'])})[_0x5b0e('0x22')](function(_0x496624){_0x48c484[_0x5b0e('0x1e')]['dialogflow']=_0x496624;_0x4fcc26[_0x5b0e('0x1e')]=_0x496624[_0x5b0e('0x29')][_0x5b0e('0x2a')][_0x5b0e('0x2b')];_0x4fcc26[_0x5b0e('0x2c')]=_0x5b0e('0x2d');_0x4fcc26[_0x5b0e('0x2e')]=JSON[_0x5b0e('0x24')](_0x496624);return rpc[_0x406789+_0x5b0e('0x20')][_0x5b0e('0x21')](_0x4fcc26)[_0x5b0e('0x22')](function(_0x1a64f3){logger[_0x5b0e('0xc')](_0x5b0e('0xd'),_0x598ede,_0x4fcc26[_0x5b0e('0x1e')]);if(_0x496624[_0x5b0e('0x29')][_0x5b0e('0x2f')][_0x5b0e('0x30')]){_0x1bf5d0[_0x5b0e('0xf')]();}else{_0x1bf5d0[_0x5b0e('0x26')]();}})['catch'](function(_0x3a6e13){logger[_0x5b0e('0x31')](_0x5b0e('0xd'),_0x598ede,JSON[_0x5b0e('0x24')](_0x3a6e13));_0x1bf5d0[_0x5b0e('0xf')]();});})['catch'](function(_0xb4e34d){logger[_0x5b0e('0x31')](_0x5b0e('0xd'),_0x598ede,_0xb4e34d[_0x5b0e('0x28')]);_0x1bf5d0[_0x5b0e('0xf')]();});}}catch(_0x38dd08){logger[_0x5b0e('0x31')]('[%s][DIALOGFLOW]\x20%s',_0x598ede,JSON[_0x5b0e('0x24')](_0x38dd08));_0x1bf5d0[_0x5b0e('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index f3500d9..fb6a47d 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab44=['stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','sms','whatsapp','phone','AccountId','account','upperFirst','InteractionId','created','isEmpty','create','finally'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0xab44,0xe2));var _0x4ab4=function(_0x56bd16,_0x2db24f){_0x56bd16=_0x56bd16-0x0;var _0x39bb33=_0xab44[_0x56bd16];return _0x39bb33;};'use strict';var _=require(_0x4ab4('0x0'));var dialogflow=require(_0x4ab4('0x1'));var md5=require(_0x4ab4('0x2'));var moment=require(_0x4ab4('0x3'));var Promise=require(_0x4ab4('0x4'));var logger=require(_0x4ab4('0x5'))(_0x4ab4('0x6'));var utils=require(_0x4ab4('0x7'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x4ab4('0x8')),'smsMessage':require(_0x4ab4('0x9')),'faxMessage':require(_0x4ab4('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x275649,_0x40ea3e,_0x5245fb,_0x3d411f){return new Promise(function(_0xfdba5f,_0x51c355){var _0x544cb6=_['clone'](_0x5245fb);_0x544cb6[_0x4ab4('0xb')]=_0x3d411f;return rpc[_0x40ea3e+_0x4ab4('0xc')]['create'](_0x544cb6)[_0x4ab4('0xd')](function(){logger[_0x4ab4('0xe')](_0x4ab4('0xf'),_0x275649,_0x544cb6[_0x4ab4('0xb')]);_0xfdba5f();})[_0x4ab4('0x10')](function(_0x4e9b48){logger[_0x4ab4('0x11')](_0x4ab4('0xf'),_0x275649,JSON[_0x4ab4('0x12')](_0x4e9b48));_0x51c355(_0x4e9b48);});});}exports[_0x4ab4('0x13')]=function(_0x5e2513,_0x4e5e3f){return function(_0x123c89){try{if(!_['isNil'](this[_0x4ab4('0x14')][_0x4ab4('0x15')])){logger[_0x4ab4('0xe')](_0x4ab4('0xf'),_0x5e2513,_0x4ab4('0x16'));return _0x123c89[_0x4ab4('0x17')]();}var _0x4a51bd={'ContactId':this[_0x4ab4('0x18')]['id'],'sentAt':moment()[_0x4ab4('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x4ab4('0x1a')]===_0x4ab4('0x1b')||this[_0x4ab4('0x1a')]===_0x4ab4('0x1c')){_0x4a51bd[_0x4ab4('0x1d')]=this[_0x4ab4('0x14')][_0x4ab4('0x1d')];}var _0x1cd496=this[_0x4ab4('0x1a')];if(_0x1cd496==='chat'){_0x4a51bd['ChatWebsiteId']=this['account']['id'];}else{_0x4a51bd[_['upperFirst'](_0x1cd496)+_0x4ab4('0x1e')]=this[_0x4ab4('0x1f')]['id'];}_0x4a51bd[_[_0x4ab4('0x20')](_0x1cd496)+_0x4ab4('0x21')]=this[_0x4ab4('0x14')]['id'];if(this[_0x4ab4('0x14')][_0x4ab4('0x22')]){var _0x117263=_0x4e5e3f[0x4];if(!_[_0x4ab4('0x23')](_0x117263)){_0x4a51bd[_0x4ab4('0xb')]=utils['getMustacheRender'](_0x117263,this);return rpc[_0x1cd496+_0x4ab4('0xc')][_0x4ab4('0x24')](_0x4a51bd)[_0x4ab4('0xd')](function(_0x29d5c5){logger['info'](_0x4ab4('0xf'),_0x5e2513,_0x4a51bd[_0x4ab4('0xb')]);})['catch'](function(_0x1e6613){logger['error'](_0x4ab4('0xf'),_0x5e2513,JSON[_0x4ab4('0x12')](_0x1e6613));})[_0x4ab4('0x25')](function(){logger[_0x4ab4('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5e2513);_0x123c89[_0x4ab4('0x26')]();});}else{logger[_0x4ab4('0xe')](_0x4ab4('0x27'),_0x5e2513);_0x123c89[_0x4ab4('0x26')]();}}else{var _0xd145a9=this;var _0x1adb03=_0x4e5e3f[0x2][_0x4ab4('0x28')](/\\n/g,'\x0a');var _0x4f3a61={'credentials':{'private_key':_0x1adb03,'client_email':_0x4e5e3f[0x1]}};var _0x53d932=new dialogflow[(_0x4ab4('0x29'))](_0x4f3a61);var _0x211d15=_0x53d932[_0x4ab4('0x2a')](_0x4e5e3f[0x0],md5(_0xd145a9[_0x4ab4('0x14')]['id']));var _0x518278={'session':_0x211d15,'queryInput':{'text':{'text':_0xd145a9[_0x4ab4('0x2b')][_0x4ab4('0xb')],'languageCode':_0x4e5e3f[0x3]||'en'}}};return _0x53d932['detectIntent'](_0x518278)[_0x4ab4('0xd')](function(_0x3f910e){if(_0x3f910e&&_0x3f910e[_0x4ab4('0x2c')]){_0xd145a9[_0x4ab4('0xb')][_0x4ab4('0x2d')]=_0x3f910e;var _0x26f0e9=_0x3f910e[0x0];var _0x5915d5=_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x2f')]&&_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x2f')][_0x4ab4('0x30')]?_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x2f')]['fields'][_0x4ab4('0x31')]['boolValue']:![];_0xd145a9['body']['DIALOGFLOWV2_ACTION']=_0x26f0e9['queryResult'][_0x4ab4('0x32')];_0xd145a9[_0x4ab4('0xb')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x33')];_0xd145a9[_0x4ab4('0xb')][_0x4ab4('0x34')]=_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x2f')]&&_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x2f')]['fields']?_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x2f')][_0x4ab4('0x30')]['end_conversation'][_0x4ab4('0x35')]:![];_0xd145a9[_0x4ab4('0xb')][_0x4ab4('0x36')]=_0x26f0e9['queryResult']['intent']['name'];_0xd145a9[_0x4ab4('0xb')][_0x4ab4('0x37')]=_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x38')][_0x4ab4('0x39')];_0xd145a9[_0x4ab4('0xb')][_0x4ab4('0x3a')]=_0x26f0e9[_0x4ab4('0x2e')]['intent'][_0x4ab4('0x3b')];_0xd145a9[_0x4ab4('0xb')]['DIALOGFLOWV2_LANGUAGECODE']=_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x3c')];_0xd145a9['body']['DIALOGFLOWV2_QUERYTEXT']=_0x26f0e9['queryResult']['queryText'];_0xd145a9[_0x4ab4('0xb')]['DIALOGFLOWV2_SCORE']=_0x26f0e9[_0x4ab4('0x2e')][_0x4ab4('0x3d')];_0x4a51bd[_0x4ab4('0x3e')]='dialogflowV2';_0x4a51bd[_0x4ab4('0x3f')]=JSON[_0x4ab4('0x12')](_0x3f910e);var _0x57d642=[];for(var _0x188f0f=0x0;_0x188f0f<_0x3f910e[_0x4ab4('0x2c')];_0x188f0f++){var _0x5ecfba=_0x3f910e[_0x188f0f];if(_0x5ecfba&&_0x5ecfba['queryResult']&&_0x5ecfba['queryResult']['fulfillmentText']){_0x57d642['push'](createMessage(_0x5e2513,_0x1cd496,_0x4a51bd,_0x5ecfba[_0x4ab4('0x2e')][_0x4ab4('0x40')]));}}return Promise[_0x4ab4('0x41')](_0x57d642)[_0x4ab4('0xd')](function(){if(_0x5915d5){_0x123c89[_0x4ab4('0x17')]();}else{_0x123c89[_0x4ab4('0x26')]();}})[_0x4ab4('0x10')](function(_0x535b23){logger['error'](_0x4ab4('0xf'),_0x5e2513,JSON[_0x4ab4('0x12')](_0x535b23));_0x123c89[_0x4ab4('0x17')]();});}})[_0x4ab4('0x10')](function(_0x2501c7){logger[_0x4ab4('0x11')](_0x4ab4('0xf'),_0x5e2513,_0x2501c7[_0x4ab4('0x2b')]);_0x123c89[_0x4ab4('0x17')]();});}}catch(_0x49be04){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5e2513,JSON[_0x4ab4('0x12')](_0x49be04));_0x123c89[_0x4ab4('0x26')]();}};}; \ No newline at end of file +var _0x4e5d=['moment','bluebird','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','AccountId','upperFirst','isEmpty','getMustacheRender','info','catch','stringify','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','lodash','md5'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e5d,0x152));var _0xd4e5=function(_0x35e6db,_0x53779d){_0x35e6db=_0x35e6db-0x0;var _0x249409=_0x4e5d[_0x35e6db];return _0x249409;};'use strict';var _=require(_0xd4e5('0x0'));var dialogflow=require('dialogflow');var md5=require(_0xd4e5('0x1'));var moment=require(_0xd4e5('0x2'));var Promise=require(_0xd4e5('0x3'));var logger=require('../../../../config/logger')(_0xd4e5('0x4'));var utils=require(_0xd4e5('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xd4e5('0x6')),'mailMessage':require(_0xd4e5('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd4e5('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x3ccbf3,_0x5a723c,_0x2858d5,_0x52d62e){return new Promise(function(_0x1bf4ef,_0x19bc02){var _0x2e6e89=_[_0xd4e5('0x9')](_0x2858d5);_0x2e6e89[_0xd4e5('0xa')]=_0x52d62e;return rpc[_0x5a723c+_0xd4e5('0xb')][_0xd4e5('0xc')](_0x2e6e89)[_0xd4e5('0xd')](function(){logger['info'](_0xd4e5('0xe'),_0x3ccbf3,_0x2e6e89[_0xd4e5('0xa')]);_0x1bf4ef();})['catch'](function(_0x234e73){logger[_0xd4e5('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x3ccbf3,JSON['stringify'](_0x234e73));_0x19bc02(_0x234e73);});});}exports[_0xd4e5('0x10')]=function(_0x5e5444,_0x423797){return function(_0x30af2f){try{if(!_[_0xd4e5('0x11')](this[_0xd4e5('0x12')][_0xd4e5('0x13')])){logger['info'](_0xd4e5('0xe'),_0x5e5444,_0xd4e5('0x14'));return _0x30af2f[_0xd4e5('0x15')]();}var _0x53479e={'ContactId':this[_0xd4e5('0x16')]['id'],'sentAt':moment()[_0xd4e5('0x17')](_0xd4e5('0x18')),'direction':_0xd4e5('0x19')};if(this[_0xd4e5('0x1a')]===_0xd4e5('0x1b')||this['channel']===_0xd4e5('0x1c')){_0x53479e['phone']=this[_0xd4e5('0x12')][_0xd4e5('0x1d')];}var _0x48cd47=this['channel'];if(_0x48cd47==='chat'){_0x53479e['ChatWebsiteId']=this['account']['id'];}else{_0x53479e[_['upperFirst'](_0x48cd47)+_0xd4e5('0x1e')]=this['account']['id'];}_0x53479e[_[_0xd4e5('0x1f')](_0x48cd47)+'InteractionId']=this[_0xd4e5('0x12')]['id'];if(this['interaction']['created']){var _0x37cf01=_0x423797[0x4];if(!_[_0xd4e5('0x20')](_0x37cf01)){_0x53479e['body']=utils[_0xd4e5('0x21')](_0x37cf01,this);return rpc[_0x48cd47+_0xd4e5('0xb')][_0xd4e5('0xc')](_0x53479e)[_0xd4e5('0xd')](function(_0x5a0206){logger[_0xd4e5('0x22')](_0xd4e5('0xe'),_0x5e5444,_0x53479e[_0xd4e5('0xa')]);})[_0xd4e5('0x23')](function(_0xedce99){logger['error'](_0xd4e5('0xe'),_0x5e5444,JSON[_0xd4e5('0x24')](_0xedce99));})['finally'](function(){logger[_0xd4e5('0x22')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5e5444);_0x30af2f[_0xd4e5('0x25')]();});}else{logger['info'](_0xd4e5('0x26'),_0x5e5444);_0x30af2f[_0xd4e5('0x25')]();}}else{var _0x388bd8=this;var _0x1eabc1=_0x423797[0x2][_0xd4e5('0x27')](/\\n/g,'\x0a');var _0x1a87dd={'credentials':{'private_key':_0x1eabc1,'client_email':_0x423797[0x1]}};var _0x4c479c=new dialogflow[(_0xd4e5('0x28'))](_0x1a87dd);var _0x115fc6=_0x4c479c['sessionPath'](_0x423797[0x0],md5(_0x388bd8['interaction']['id']));var _0x37aea7={'session':_0x115fc6,'queryInput':{'text':{'text':_0x388bd8[_0xd4e5('0x29')][_0xd4e5('0xa')],'languageCode':_0x423797[0x3]||'en'}}};return _0x4c479c[_0xd4e5('0x2a')](_0x37aea7)[_0xd4e5('0xd')](function(_0x21f4b6){if(_0x21f4b6&&_0x21f4b6[_0xd4e5('0x2b')]){_0x388bd8[_0xd4e5('0xa')][_0xd4e5('0x2c')]=_0x21f4b6;var _0x16ce8a=_0x21f4b6[0x0];var _0x14a40a=_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x2e')]&&_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x2e')][_0xd4e5('0x2f')]?_0x16ce8a['queryResult']['diagnosticInfo']['fields'][_0xd4e5('0x30')][_0xd4e5('0x31')]:![];_0x388bd8[_0xd4e5('0xa')][_0xd4e5('0x32')]=_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x33')];_0x388bd8[_0xd4e5('0xa')][_0xd4e5('0x34')]=_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x35')];_0x388bd8[_0xd4e5('0xa')][_0xd4e5('0x36')]=_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x2e')]&&_0x16ce8a[_0xd4e5('0x2d')]['diagnosticInfo']['fields']?_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x2e')][_0xd4e5('0x2f')][_0xd4e5('0x30')][_0xd4e5('0x31')]:![];_0x388bd8[_0xd4e5('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x16ce8a[_0xd4e5('0x2d')]['intent']['name'];_0x388bd8[_0xd4e5('0xa')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x37')][_0xd4e5('0x38')];_0x388bd8[_0xd4e5('0xa')][_0xd4e5('0x39')]=_0x16ce8a[_0xd4e5('0x2d')]['intent'][_0xd4e5('0x3a')];_0x388bd8[_0xd4e5('0xa')]['DIALOGFLOWV2_LANGUAGECODE']=_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x3b')];_0x388bd8['body'][_0xd4e5('0x3c')]=_0x16ce8a[_0xd4e5('0x2d')][_0xd4e5('0x3d')];_0x388bd8[_0xd4e5('0xa')][_0xd4e5('0x3e')]=_0x16ce8a['queryResult'][_0xd4e5('0x3f')];_0x53479e[_0xd4e5('0x40')]=_0xd4e5('0x2c');_0x53479e[_0xd4e5('0x41')]=JSON[_0xd4e5('0x24')](_0x21f4b6);var _0x35c021=[];for(var _0x338243=0x0;_0x338243<_0x21f4b6[_0xd4e5('0x2b')];_0x338243++){var _0x5abef4=_0x21f4b6[_0x338243];if(_0x5abef4&&_0x5abef4[_0xd4e5('0x2d')]&&_0x5abef4[_0xd4e5('0x2d')][_0xd4e5('0x42')]){_0x35c021[_0xd4e5('0x43')](createMessage(_0x5e5444,_0x48cd47,_0x53479e,_0x5abef4[_0xd4e5('0x2d')]['fulfillmentText']));}}return Promise['all'](_0x35c021)[_0xd4e5('0xd')](function(){if(_0x14a40a){_0x30af2f['next']();}else{_0x30af2f[_0xd4e5('0x25')]();}})[_0xd4e5('0x23')](function(_0x2cb024){logger[_0xd4e5('0xf')](_0xd4e5('0xe'),_0x5e5444,JSON[_0xd4e5('0x24')](_0x2cb024));_0x30af2f[_0xd4e5('0x15')]();});}})['catch'](function(_0x31abae){logger['error'](_0xd4e5('0xe'),_0x5e5444,_0x31abae[_0xd4e5('0x29')]);_0x30af2f[_0xd4e5('0x15')]();});}}catch(_0x3af5df){logger[_0xd4e5('0xf')](_0xd4e5('0xe'),_0x5e5444,JSON[_0xd4e5('0x24')](_0x3af5df));_0x30af2f[_0xd4e5('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 737ee7b..5dce7ef 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa791=['priorityTrue','priorityFalse','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition'];(function(_0x36f5cb,_0x2a720f){var _0x58d6ce=function(_0x1adfb5){while(--_0x1adfb5){_0x36f5cb['push'](_0x36f5cb['shift']());}};_0x58d6ce(++_0x2a720f);}(_0xa791,0x13d));var _0x1a79=function(_0x3a6545,_0x2560ab){_0x3a6545=_0x3a6545-0x0;var _0x38abb0=_0xa791[_0x3a6545];return _0x38abb0;};'use strict';var schema=require(_0x1a79('0x0'));var _=require('lodash');var htmlToText=require(_0x1a79('0x1'));var utils=require(_0x1a79('0x2'));var logger=require(_0x1a79('0x3'))(_0x1a79('0x4'));var gotoif=schema({'condition':{'type':_0x1a79('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x1a79('0x6'),'message':_0x1a79('0x7')},'priorityFalse':{'type':_0x1a79('0x6'),'message':_0x1a79('0x8')}});exports['consequence']=function(_0x94717f,_0x189b37){return function(_0x199c76){try{var _0x59c00a={'condition':htmlToText[_0x1a79('0x9')](utils[_0x1a79('0xa')](_0x189b37[0x0],this),{'wordwrap':![]})[_0x1a79('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x189b37[0x1],'priorityFalse':_0x189b37[0x2]};var _0x12d9cd=gotoif[_0x1a79('0x0')](_0x59c00a,{'typecast':!![]});if(_0x12d9cd[_0x1a79('0xc')]){logger['error'](_0x1a79('0xd'),_0x94717f,_[_0x1a79('0xe')](_0x12d9cd,_0x1a79('0xf'))[_0x1a79('0x10')](',\x20'));_0x199c76[_0x1a79('0x11')]();}else{try{var _0xcc17ee=eval('('+_0x59c00a[_0x1a79('0x12')]+')');var _0x27e696=_0xcc17ee?_0x59c00a[_0x1a79('0x13')]:_0x59c00a[_0x1a79('0x14')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x94717f,_0x59c00a[_0x1a79('0x12')],_0xcc17ee,_0x27e696||_0x1a79('0x15'));if(_0x27e696){var _0x5c4cbf=_[_0x1a79('0x16')](_0x199c76[_0x1a79('0x17')](),{'p':_0x27e696});if(_0x5c4cbf>=0x0){logger[_0x1a79('0x18')](_0x1a79('0x19'),_0x94717f,_0x27e696||_0x1a79('0x15'),_0x5c4cbf);_0x199c76[_0x1a79('0x15')](_0x5c4cbf);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x94717f,_0x27e696||_0x1a79('0x15'));_0x199c76[_0x1a79('0x11')]();}}else{_0x199c76['next']();}}catch(_0x122727){logger[_0x1a79('0x1a')](_0x1a79('0x1b'),_0x94717f,_0x122727[_0x1a79('0xf')]);_0x199c76[_0x1a79('0x11')]();}}}catch(_0x455386){logger[_0x1a79('0x1a')](_0x1a79('0xd'),_0x94717f,JSON['stringify'](_0x455386));_0x199c76[_0x1a79('0x11')]();}};}; \ No newline at end of file +var _0x3337=['join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','info','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','error','[%s][GOTOIF]\x20%s','message'];(function(_0x41d67e,_0x336a28){var _0x100cb2=function(_0x3fd927){while(--_0x3fd927){_0x41d67e['push'](_0x41d67e['shift']());}};_0x100cb2(++_0x336a28);}(_0x3337,0x14c));var _0x7333=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0x3337[_0x590a38];return _0xf36626;};'use strict';var schema=require(_0x7333('0x0'));var _=require(_0x7333('0x1'));var htmlToText=require(_0x7333('0x2'));var utils=require(_0x7333('0x3'));var logger=require(_0x7333('0x4'))('routing');var gotoif=schema({'condition':{'type':_0x7333('0x5'),'required':!![],'message':_0x7333('0x6')},'priorityTrue':{'type':'number','message':_0x7333('0x7')},'priorityFalse':{'type':_0x7333('0x8'),'message':_0x7333('0x9')}});exports[_0x7333('0xa')]=function(_0x3f3a0f,_0x512a30){return function(_0x3e59fe){try{var _0x20e51f={'condition':htmlToText[_0x7333('0xb')](utils[_0x7333('0xc')](_0x512a30[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x512a30[0x1],'priorityFalse':_0x512a30[0x2]};var _0x279b50=gotoif[_0x7333('0x0')](_0x20e51f,{'typecast':!![]});if(_0x279b50['length']){logger[_0x7333('0xd')](_0x7333('0xe'),_0x3f3a0f,_['map'](_0x279b50,_0x7333('0xf'))[_0x7333('0x10')](',\x20'));_0x3e59fe[_0x7333('0x11')]();}else{try{var _0x1d873b=eval('('+_0x20e51f[_0x7333('0x12')]+')');var _0x205b95=_0x1d873b?_0x20e51f[_0x7333('0x13')]:_0x20e51f[_0x7333('0x14')];logger['info'](_0x7333('0x15'),_0x3f3a0f,_0x20e51f[_0x7333('0x12')],_0x1d873b,_0x205b95||'next');if(_0x205b95){var _0x3315eb=_[_0x7333('0x16')](_0x3e59fe[_0x7333('0x17')](),{'p':_0x205b95});if(_0x3315eb>=0x0){logger[_0x7333('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3f3a0f,_0x205b95||_0x7333('0x19'),_0x3315eb);_0x3e59fe['next'](_0x3315eb);}else{logger[_0x7333('0x18')](_0x7333('0x1a'),_0x3f3a0f,_0x205b95||_0x7333('0x19'));_0x3e59fe[_0x7333('0x11')]();}}else{_0x3e59fe[_0x7333('0x19')]();}}catch(_0xf9638b){logger['error'](_0x7333('0x1b'),_0x3f3a0f,_0xf9638b[_0x7333('0xf')]);_0x3e59fe['stop']();}}}catch(_0x55fd66){logger['error'](_0x7333('0xe'),_0x3f3a0f,JSON[_0x7333('0x1c')](_0x55fd66));_0x3e59fe[_0x7333('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 09fb5f2..bf8ef49 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 _0x7a71=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x25aa48,_0x5a309f){var _0x4d4088=function(_0x17f7de){while(--_0x17f7de){_0x25aa48['push'](_0x25aa48['shift']());}};_0x4d4088(++_0x5a309f);}(_0x7a71,0x1a5));var _0x17a7=function(_0xe7ce7f,_0xc3ae44){_0xe7ce7f=_0xe7ce7f-0x0;var _0x2c6dca=_0x7a71[_0xe7ce7f];return _0x2c6dca;};'use strict';var schema=require(_0x17a7('0x0'));var _=require(_0x17a7('0x1'));var logger=require(_0x17a7('0x2'))(_0x17a7('0x3'));var gotop=schema({'priority':{'type':_0x17a7('0x4'),'required':!![],'message':_0x17a7('0x5')}});exports[_0x17a7('0x6')]=function(_0x3d0660,_0x2197b5){return function(_0x304d50){try{var _0x5633fb={'priority':_0x2197b5[0x0]};var _0x30a546=gotop[_0x17a7('0x0')](_0x5633fb,{'typecast':!![]});if(_0x30a546['length']){logger[_0x17a7('0x7')](_0x17a7('0x8'),_0x3d0660,_[_0x17a7('0x9')](_0x30a546,'message')['join'](',\x20'));_0x304d50[_0x17a7('0xa')]();}else{logger[_0x17a7('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x3d0660,_0x5633fb[_0x17a7('0xc')]);if(_0x5633fb[_0x17a7('0xc')]){var _0x2831f4=_[_0x17a7('0xd')](_0x304d50[_0x17a7('0xe')](),{'p':_0x5633fb['priority']});if(_0x2831f4>=0x0){logger[_0x17a7('0xb')](_0x17a7('0xf'),_0x3d0660,_0x5633fb['priority']||'next',_0x2831f4);_0x304d50['next'](_0x2831f4);}else{logger[_0x17a7('0xb')](_0x17a7('0x10'),_0x3d0660,_0x5633fb[_0x17a7('0xc')]||_0x17a7('0x11'));_0x304d50['stop']();}}else{_0x304d50['next']();}}}catch(_0xda84b3){logger['error']('[%s][GOTOP]\x20%s',_0x3d0660,JSON[_0x17a7('0x12')](_0xda84b3));_0x304d50[_0x17a7('0xa')]();}};}; \ No newline at end of file +var _0x1619=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','../../../../config/logger','routing','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules'];(function(_0x5f4bcf,_0x2524d9){var _0x1a37f1=function(_0xc6c590){while(--_0xc6c590){_0x5f4bcf['push'](_0x5f4bcf['shift']());}};_0x1a37f1(++_0x2524d9);}(_0x1619,0x83));var _0x9161=function(_0xada2e7,_0x5a9089){_0xada2e7=_0xada2e7-0x0;var _0x1e8828=_0x1619[_0xada2e7];return _0x1e8828;};'use strict';var schema=require(_0x9161('0x0'));var _=require('lodash');var logger=require(_0x9161('0x1'))(_0x9161('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x31ad07,_0x5a1cfc){return function(_0x1f2916){try{var _0xee30bf={'priority':_0x5a1cfc[0x0]};var _0x37ba8f=gotop[_0x9161('0x0')](_0xee30bf,{'typecast':!![]});if(_0x37ba8f['length']){logger[_0x9161('0x3')](_0x9161('0x4'),_0x31ad07,_[_0x9161('0x5')](_0x37ba8f,'message')[_0x9161('0x6')](',\x20'));_0x1f2916[_0x9161('0x7')]();}else{logger[_0x9161('0x8')](_0x9161('0x9'),_0x31ad07,_0xee30bf[_0x9161('0xa')]);if(_0xee30bf[_0x9161('0xa')]){var _0x12d24b=_[_0x9161('0xb')](_0x1f2916[_0x9161('0xc')](),{'p':_0xee30bf[_0x9161('0xa')]});if(_0x12d24b>=0x0){logger[_0x9161('0x8')](_0x9161('0xd'),_0x31ad07,_0xee30bf[_0x9161('0xa')]||_0x9161('0xe'),_0x12d24b);_0x1f2916[_0x9161('0xe')](_0x12d24b);}else{logger['info'](_0x9161('0xf'),_0x31ad07,_0xee30bf[_0x9161('0xa')]||'next');_0x1f2916[_0x9161('0x7')]();}}else{_0x1f2916[_0x9161('0xe')]();}}}catch(_0x5d6a2b){logger[_0x9161('0x3')](_0x9161('0x4'),_0x31ad07,JSON['stringify'](_0x5d6a2b));_0x1f2916['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 28a0c5e..9951388 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 _0x685f=['contact','channel','chat','ChatWebsiteId','upperFirst','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x685f,0xc7));var _0xf685=function(_0x529965,_0x3a1ed2){_0x529965=_0x529965-0x0;var _0x232533=_0x685f[_0x529965];return _0x232533;};'use strict';var _=require(_0xf685('0x0'));var utils=require('./utils');var logger=require(_0xf685('0x1'))(_0xf685('0x2'));var rpc={'chatMessage':require(_0xf685('0x3')),'openchannelMessage':require(_0xf685('0x4')),'mailMessage':require(_0xf685('0x5')),'smsMessage':require(_0xf685('0x6')),'faxMessage':require(_0xf685('0x7')),'whatsappMessage':require(_0xf685('0x8'))};exports[_0xf685('0x9')]=function(_0x3b025d,_0x3594aa){return function(_0x2ca7d8){try{var _0x32e969={'body':utils[_0xf685('0xa')](_0x3594aa[0x0],this),'ContactId':this[_0xf685('0xb')]['id']};if(this[_0xf685('0xc')]===_0xf685('0xd')){_0x32e969[_0xf685('0xe')]=this['account']['id'];}else{_0x32e969[_[_0xf685('0xf')](this[_0xf685('0xc')])+'AccountId']=this[_0xf685('0x10')]['id'];}_0x32e969[_['upperFirst'](this['channel'])+_0xf685('0x11')]=this[_0xf685('0x12')]['id'];if(rpc[this[_0xf685('0xc')]+_0xf685('0x13')]){return rpc[this[_0xf685('0xc')]+_0xf685('0x13')][_0xf685('0x14')](_0x32e969)[_0xf685('0x15')](function(_0x45d8fc){logger[_0xf685('0x16')](_0xf685('0x17'),_0x3b025d,_0x32e969[_0xf685('0x18')]);_0x2ca7d8[_0xf685('0x19')]();})[_0xf685('0x1a')](function(_0x531bb2){logger[_0xf685('0x1b')]('[%s][MESSAGE]\x20%s',_0x3b025d,JSON['stringify'](_0x531bb2));_0x2ca7d8[_0xf685('0x1c')]();});}}catch(_0x5f2211){logger[_0xf685('0x1b')](_0xf685('0x17'),_0x3b025d,JSON[_0xf685('0x1d')](_0x5f2211));_0x2ca7d8[_0xf685('0x1c')]();}};}; \ No newline at end of file +var _0xd7ab=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence','getMustacheRender','channel','chat','account','upperFirst','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stop','error','stringify','lodash','./utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd7ab,0x14e));var _0xbd7a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd7ab[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xbd7a('0x0'));var utils=require(_0xbd7a('0x1'));var logger=require(_0xbd7a('0x2'))(_0xbd7a('0x3'));var rpc={'chatMessage':require(_0xbd7a('0x4')),'openchannelMessage':require(_0xbd7a('0x5')),'mailMessage':require(_0xbd7a('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xbd7a('0x7')]=function(_0x599057,_0x480cb0){return function(_0x458cda){try{var _0x331bcb={'body':utils[_0xbd7a('0x8')](_0x480cb0[0x0],this),'ContactId':this['contact']['id']};if(this[_0xbd7a('0x9')]===_0xbd7a('0xa')){_0x331bcb['ChatWebsiteId']=this[_0xbd7a('0xb')]['id'];}else{_0x331bcb[_['upperFirst'](this[_0xbd7a('0x9')])+'AccountId']=this['account']['id'];}_0x331bcb[_[_0xbd7a('0xc')](this['channel'])+'InteractionId']=this[_0xbd7a('0xd')]['id'];if(rpc[this[_0xbd7a('0x9')]+_0xbd7a('0xe')]){return rpc[this[_0xbd7a('0x9')]+_0xbd7a('0xe')]['create'](_0x331bcb)[_0xbd7a('0xf')](function(_0x5393ee){logger[_0xbd7a('0x10')](_0xbd7a('0x11'),_0x599057,_0x331bcb[_0xbd7a('0x12')]);_0x458cda[_0xbd7a('0x13')]();})[_0xbd7a('0x14')](function(_0x427a93){logger['error'](_0xbd7a('0x11'),_0x599057,JSON['stringify'](_0x427a93));_0x458cda[_0xbd7a('0x15')]();});}}catch(_0x520d5a){logger[_0xbd7a('0x16')](_0xbd7a('0x11'),_0x599057,JSON[_0xbd7a('0x17')](_0x520d5a));_0x458cda[_0xbd7a('0x15')]();}};}; \ 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 af968af..7afad22 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 _0x08d9=['getMustacheRender','error','[%s][NOOP]\x20%s','stop','info'];(function(_0x4f52db,_0xda2194){var _0x13898b=function(_0x5eb736){while(--_0x5eb736){_0x4f52db['push'](_0x4f52db['shift']());}};_0x13898b(++_0xda2194);}(_0x08d9,0xf4));var _0x908d=function(_0x50f957,_0x351291){_0x50f957=_0x50f957-0x0;var _0x4fecea=_0x08d9[_0x50f957];return _0x4fecea;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')('routing');exports['consequence']=function(_0x503291,_0x33748e){return function(_0x1962ba){try{logger[_0x908d('0x0')]('[%s][NOOP]\x20%s',_0x503291,utils[_0x908d('0x1')](_0x33748e[0x0],this));_0x1962ba['next']();}catch(_0xb073bf){logger[_0x908d('0x2')](_0x908d('0x3'),_0x503291,JSON['stringify'](_0xb073bf));_0x1962ba[_0x908d('0x4')]();}};}; \ No newline at end of file +var _0x7db1=['next','[%s][NOOP]\x20%s','stringify','stop','routing','consequence','getMustacheRender'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7db1,0x1ee));var _0x17db=function(_0x381e4e,_0x4d46c6){_0x381e4e=_0x381e4e-0x0;var _0x52fc95=_0x7db1[_0x381e4e];return _0x52fc95;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x17db('0x0'));exports[_0x17db('0x1')]=function(_0x286965,_0x298d29){return function(_0x4e674c){try{logger['info']('[%s][NOOP]\x20%s',_0x286965,utils[_0x17db('0x2')](_0x298d29[0x0],this));_0x4e674c[_0x17db('0x3')]();}catch(_0x2ce1f7){logger['error'](_0x17db('0x4'),_0x286965,JSON[_0x17db('0x5')](_0x2ce1f7));_0x4e674c[_0x17db('0x6')]();}};}; \ 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 1304109..b66a260 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 _0x5242=['close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','account','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','from','contact','list','QueueId','upperFirst','interaction','message','channel','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','update','catch','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','map','join','stop','find','timeout','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED'];(function(_0x39d28b,_0x585248){var _0x179d9a=function(_0x2e9569){while(--_0x2e9569){_0x39d28b['push'](_0x39d28b['shift']());}};_0x179d9a(++_0x585248);}(_0x5242,0x148));var _0x2524=function(_0x2b4fbb,_0x1353b4){_0x2b4fbb=_0x2b4fbb-0x0;var _0x1859d9=_0x5242[_0x2b4fbb];return _0x1859d9;};'use strict';var schema=require(_0x2524('0x0'));var _=require(_0x2524('0x1'));var util=require(_0x2524('0x2'));var seqqueue=require(_0x2524('0x3'));var moment=require(_0x2524('0x4'));var Redis=require('ioredis');var config=require(_0x2524('0x5'));var logger=require(_0x2524('0x6'))(_0x2524('0x7'));var strategy=require(_0x2524('0x8'));config[_0x2524('0x9')]=_[_0x2524('0xa')](config[_0x2524('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x2524('0xb'))(new Redis(config[_0x2524('0x9')]));var attributes=['id',_0x2524('0xc'),_0x2524('0xd'),'queue','from',_0x2524('0xe')];function emit(_0x2ecd8f,_0x40f826,_0x52e6e0){io['to'](_0x2ecd8f)[_0x2524('0xf')](_0x40f826,_0x52e6e0);}function emitChannelQueueInteraction(_0x2a1599,_0x3a8a54,_0x1debee,_0x28920d,_0x416856,_0x23b47c,_0x5edc88,_0x507eae){var _0x44d626=_[_0x2524('0x10')](_0x1debee);_0x44d626[_0x2524('0xc')]=_0x507eae;_0x44d626[_0x2524('0x11')]=_0x3a8a54;_0x44d626[_0x2524('0xd')]=_0x28920d;_0x44d626['id']=_0x416856;if(_0x23b47c){_0x5edc88[util[_0x2524('0x12')](_0x2524('0x13'),_0x2a1599)][_0x416856]=_[_0x2524('0x14')](_0x44d626,attributes);}else{delete _0x5edc88[util[_0x2524('0x12')](_0x2524('0x13'),_0x2a1599)][_0x416856];}emit(util[_0x2524('0x12')](_0x2524('0x15'),_0x2a1599,_0x3a8a54),util[_0x2524('0x12')](_0x2524('0x16'),_0x2a1599,_0x23b47c?_0x2524('0x17'):_0x2524('0x18')),_[_0x2524('0x14')](_0x44d626,attributes));}var rpc={'openchannelQueueReport':require(_0x2524('0x19')),'mailQueueReport':require(_0x2524('0x1a')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x2524('0x1b')),'faxQueueReport':require(_0x2524('0x1c')),'whatsappQueueReport':require(_0x2524('0x1d'))};var queue=schema({'name':{'type':_0x2524('0x1e'),'required':!![],'message':_0x2524('0x1f')},'timeout':{'type':_0x2524('0x20'),'message':_0x2524('0x21')}});function startRouting(_0x3da9a2,_0x102b60,_0x5f5243,_0x125d00){if(_0x3da9a2&&_0x102b60&&_0x5f5243){_0x102b60['waiting']+=0x1;var _0x33a5d0={'uniqueid':_0x3da9a2,'from':_0x5f5243[_0x2524('0x22')]?_0x5f5243[_0x2524('0x22')][_0x2524('0x23')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5f5243[_0x2524('0x24')]?_0x5f5243[_0x2524('0x24')]['id']:null,'ListId':_0x5f5243[_0x2524('0x25')]?_0x5f5243[_0x2524('0x25')]['id']:null};_0x33a5d0[_['upperFirst'](_0x5f5243['channel'])+_0x2524('0x26')]=_0x102b60['id']||null;_0x33a5d0[_[_0x2524('0x27')](_0x5f5243['channel'])+'InteractionId']=_0x5f5243[_0x2524('0x28')]?_0x5f5243[_0x2524('0x28')]['id']:null;_0x33a5d0[_[_0x2524('0x27')](_0x5f5243['channel'])+'MessageId']=_0x5f5243[_0x2524('0x29')]?_0x5f5243[_0x2524('0x29')]['id']:null;_0x33a5d0[_['upperFirst'](_0x5f5243[_0x2524('0x2a')])+(_0x5f5243[_0x2524('0x2a')]!=='chat'?_0x2524('0x2b'):_0x2524('0x2c'))]=_0x5f5243[_0x2524('0xd')]?_0x5f5243[_0x2524('0xd')]['id']:null;logger[_0x2524('0x2d')](util[_0x2524('0x12')](_0x2524('0x2e'),_0x3da9a2,_0x102b60[_0x2524('0x2f')]));emitChannelQueueInteraction(_0x5f5243[_0x2524('0x2a')],_0x102b60[_0x2524('0x2f')],_0x33a5d0,_0x5f5243[_0x2524('0xd')][_0x2524('0x2f')],_0x5f5243[_0x2524('0x29')]['id'],!![],_0x125d00,_0x102b60['id']);if(rpc[_0x5f5243[_0x2524('0x2a')]+_0x2524('0x30')]){return rpc[_0x5f5243[_0x2524('0x2a')]+_0x2524('0x30')][_0x2524('0x31')](_0x33a5d0)['catch'](function(_0x1b788c){logger[_0x2524('0x32')](_0x2524('0x33'));});}}}function stopRouting(_0x4729ae,_0x4dc2e3,_0x13378a,_0x181a78){if(_0x4729ae&&_0x4dc2e3){_0x4dc2e3[_0x2524('0x34')]-=0x1;var _0x598671={'leaveAt':moment()['format'](_0x2524('0x35')),'acceptAt':moment()[_0x2524('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2524('0x36')};logger[_0x2524('0x2d')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x4729ae,_0x4dc2e3[_0x2524('0x2f')]));emitChannelQueueInteraction(_0x13378a[_0x2524('0x2a')],_0x4dc2e3[_0x2524('0x2f')],_0x13378a[_0x2524('0x22')],_0x13378a['account'][_0x2524('0x2f')],_0x13378a[_0x2524('0x29')]['id'],![],_0x181a78,_0x4dc2e3['id']);if(rpc[_0x13378a[_0x2524('0x2a')]+_0x2524('0x30')]){return rpc[_0x13378a[_0x2524('0x2a')]+_0x2524('0x30')][_0x2524('0x37')](_0x4729ae,_0x598671)[_0x2524('0x38')](function(_0xc9e354){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x55ab3a,_0x34294a,_0x2f5f32,_0x391a5c){if(_0x55ab3a&&_0x34294a){_0x34294a[_0x2524('0x34')]-=0x1;var _0x2eb14e={'leaveAt':moment()[_0x2524('0x12')](_0x2524('0x35')),'exitAt':moment()[_0x2524('0x12')](_0x2524('0x35')),'reason':'timeout'};logger[_0x2524('0x2d')](util[_0x2524('0x12')](_0x2524('0x39'),_0x55ab3a,_0x34294a[_0x2524('0x2f')]));emitChannelQueueInteraction(_0x2f5f32[_0x2524('0x2a')],_0x34294a['name'],_0x2f5f32[_0x2524('0x22')],_0x2f5f32[_0x2524('0xd')][_0x2524('0x2f')],_0x2f5f32[_0x2524('0x29')]['id'],![],_0x391a5c);if(rpc[_0x2f5f32[_0x2524('0x2a')]+'QueueReport']){return rpc[_0x2f5f32[_0x2524('0x2a')]+_0x2524('0x30')][_0x2524('0x37')](_0x55ab3a,_0x2eb14e)[_0x2524('0x38')](function(_0xa29480){logger[_0x2524('0x32')](_0x2524('0x3a'));});}}}function handleFindQueue(_0x442bd3){return function(_0x1289ba){return _0x1289ba['name'][_0x2524('0x3b')]()===_0x442bd3[_0x2524('0x3b')]();};}exports[_0x2524('0x3c')]=function(_0x3ed87b,_0x52a400,_0x3c36e0,_0x10deb5){return function(_0x3aad13){try{var _0x304587={'name':_0x52a400[0x0],'timeout':_0x52a400[0x1]};var _0x2495c1=queue[_0x2524('0x0')](_0x304587,{'typecast':!![]});if(_0x2495c1[_0x2524('0x3d')]){logger[_0x2524('0x32')]('[%s][QUEUE]\x20%s',_0x3ed87b,_[_0x2524('0x3e')](_0x2495c1,_0x2524('0x29'))[_0x2524('0x3f')](',\x20'));_0x3aad13[_0x2524('0x40')]();}else{var _0x1cd6d4=_[_0x2524('0x41')](_0x3c36e0[_0x10deb5[_0x2524('0x2a')]+'Queues'],handleFindQueue(_0x304587[_0x2524('0x2f')]));if(_0x1cd6d4){startRouting(_0x3ed87b,_0x1cd6d4,_0x10deb5,_0x3c36e0);var _0x103a10=(_0x1cd6d4[_0x2524('0x42')]||0xa)*0x3e8;var _0x47b9a4=(_0x304587[_0x2524('0x42')]||0x14)*0x3e8;var _0x3925fe,_0x23d7b8;if(_0x103a10>_0x47b9a4){_0x47b9a4=_0x103a10;}var _0x3933fc=seqqueue['createQueue'](_0x103a10);_0x3933fc['id']=_0x3ed87b;_0x3933fc[_0x2524('0x43')]=_0x103a10;_0x3933fc[_0x2524('0x44')]=_0x47b9a4;_0x3933fc[_0x2524('0x2a')]=_0x10deb5[_0x2524('0x2a')];_0x3c36e0[_0x2524('0x45')][_0x3ed87b]['on'](_0x2524('0x46'),function(){logger[_0x2524('0x2d')](_0x2524('0x47'),_0x3ed87b);stopRouting(_0x3ed87b,_0x1cd6d4,_0x10deb5,_0x3c36e0);clearTimeout(_0x3925fe);_0x3925fe=undefined;_0x3933fc[_0x2524('0x48')](!![]);if(_0x3c36e0[_0x2524('0x45')][_0x3ed87b]){delete _0x3c36e0[_0x2524('0x45')][_0x3ed87b];}_0x3aad13[_0x2524('0x40')]();});_0x3c36e0['rules'][_0x3ed87b]['on'](_0x2524('0x49'),function(){if(_0x3c36e0[_0x2524('0x45')][_0x3ed87b]){delete _0x3c36e0[_0x2524('0x45')][_0x3ed87b];}});_0x3925fe=setTimeout(function(){logger[_0x2524('0x2d')](_0x2524('0x4a'),_0x3ed87b);endRouting(_0x3ed87b,_0x1cd6d4,_0x10deb5,_0x3c36e0);clearTimeout(_0x3925fe);_0x3933fc[_0x2524('0x48')](!![]);_0x3aad13[_0x2524('0x4b')]();},_0x47b9a4);switch(_0x1cd6d4[_0x2524('0x4c')]){case _0x2524('0x4d'):strategy[_0x2524('0x4d')](_0x3933fc,_0x1cd6d4,_0x3c36e0,_0x10deb5);break;default:strategy['beepall'](_0x3933fc,_0x1cd6d4,_0x3c36e0,_0x10deb5);}}else{logger['error'](_0x2524('0x4e'),_0x3ed87b,_0x304587['name']);_0x3aad13['stop']();}}}catch(_0x149999){console['log'](_0x149999);logger[_0x2524('0x32')](_0x2524('0x4f'),_0x3ed87b,_0x149999['stack']);_0x3aad13[_0x2524('0x40')]();}};}; \ No newline at end of file +var _0x093a=['account','queue','joinAt','emit','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','interaction','channel','MessageId','message','AccountId','WebsiteId','info','name','QueueReport','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','timeout','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','stack','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','redis','socket.io-emitter','queue_id'];(function(_0x1aab63,_0xd88243){var _0x8917e1=function(_0x374b72){while(--_0x374b72){_0x1aab63['push'](_0x1aab63['shift']());}};_0x8917e1(++_0xd88243);}(_0x093a,0x112));var _0xa093=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0x093a[_0x38c632];return _0x12737e;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xa093('0x0'));var seqqueue=require(_0xa093('0x1'));var moment=require(_0xa093('0x2'));var Redis=require(_0xa093('0x3'));var config=require(_0xa093('0x4'));var logger=require('../../../../config/logger')(_0xa093('0x5'));var strategy=require(_0xa093('0x6'));config[_0xa093('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa093('0x8'))(new Redis(config[_0xa093('0x7')]));var attributes=['id',_0xa093('0x9'),_0xa093('0xa'),_0xa093('0xb'),'from',_0xa093('0xc')];function emit(_0x19cf2a,_0x216280,_0x2336c9){io['to'](_0x19cf2a)[_0xa093('0xd')](_0x216280,_0x2336c9);}function emitChannelQueueInteraction(_0x330d28,_0x75517f,_0x278b9b,_0x564f2a,_0x5b8f7f,_0x16b80d,_0x2be755,_0x530d22){var _0x3384fe=_['clone'](_0x278b9b);_0x3384fe['queue_id']=_0x530d22;_0x3384fe['queue']=_0x75517f;_0x3384fe[_0xa093('0xa')]=_0x564f2a;_0x3384fe['id']=_0x5b8f7f;if(_0x16b80d){_0x2be755[util[_0xa093('0xe')](_0xa093('0xf'),_0x330d28)][_0x5b8f7f]=_['pick'](_0x3384fe,attributes);}else{delete _0x2be755[util[_0xa093('0xe')](_0xa093('0xf'),_0x330d28)][_0x5b8f7f];}emit(util['format'](_0xa093('0x10'),_0x330d28,_0x75517f),util['format'](_0xa093('0x11'),_0x330d28,_0x16b80d?_0xa093('0x12'):'remove'),_[_0xa093('0x13')](_0x3384fe,attributes));}var rpc={'openchannelQueueReport':require(_0xa093('0x14')),'mailQueueReport':require(_0xa093('0x15')),'chatQueueReport':require(_0xa093('0x16')),'smsQueueReport':require(_0xa093('0x17')),'faxQueueReport':require(_0xa093('0x18')),'whatsappQueueReport':require(_0xa093('0x19'))};var queue=schema({'name':{'type':_0xa093('0x1a'),'required':!![],'message':_0xa093('0x1b')},'timeout':{'type':'number','message':_0xa093('0x1c')}});function startRouting(_0x1abeef,_0x577870,_0x7fc634,_0x285124){if(_0x1abeef&&_0x577870&&_0x7fc634){_0x577870[_0xa093('0x1d')]+=0x1;var _0xb1565e={'uniqueid':_0x1abeef,'from':_0x7fc634[_0xa093('0x1e')]?_0x7fc634[_0xa093('0x1e')][_0xa093('0x1f')]:'','joinAt':moment()[_0xa093('0xe')](_0xa093('0x20')),'ContactId':_0x7fc634[_0xa093('0x21')]?_0x7fc634[_0xa093('0x21')]['id']:null,'ListId':_0x7fc634[_0xa093('0x22')]?_0x7fc634['list']['id']:null};_0xb1565e[_[_0xa093('0x23')](_0x7fc634['channel'])+'QueueId']=_0x577870['id']||null;_0xb1565e[_['upperFirst'](_0x7fc634['channel'])+'InteractionId']=_0x7fc634['interaction']?_0x7fc634[_0xa093('0x24')]['id']:null;_0xb1565e[_[_0xa093('0x23')](_0x7fc634[_0xa093('0x25')])+_0xa093('0x26')]=_0x7fc634[_0xa093('0x27')]?_0x7fc634['message']['id']:null;_0xb1565e[_[_0xa093('0x23')](_0x7fc634['channel'])+(_0x7fc634[_0xa093('0x25')]!=='chat'?_0xa093('0x28'):_0xa093('0x29'))]=_0x7fc634[_0xa093('0xa')]?_0x7fc634[_0xa093('0xa')]['id']:null;logger[_0xa093('0x2a')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x1abeef,_0x577870['name']));emitChannelQueueInteraction(_0x7fc634[_0xa093('0x25')],_0x577870[_0xa093('0x2b')],_0xb1565e,_0x7fc634['account']['name'],_0x7fc634[_0xa093('0x27')]['id'],!![],_0x285124,_0x577870['id']);if(rpc[_0x7fc634[_0xa093('0x25')]+_0xa093('0x2c')]){return rpc[_0x7fc634[_0xa093('0x25')]+_0xa093('0x2c')]['create'](_0xb1565e)[_0xa093('0x2d')](function(_0x149d36){logger[_0xa093('0x2e')](_0xa093('0x2f'));});}}}function stopRouting(_0x1b70e2,_0x162268,_0xdd19db,_0x13ea21){if(_0x1b70e2&&_0x162268){_0x162268[_0xa093('0x1d')]-=0x1;var _0x1780b3={'leaveAt':moment()[_0xa093('0xe')](_0xa093('0x20')),'acceptAt':moment()[_0xa093('0xe')](_0xa093('0x20')),'reason':'accepted'};logger[_0xa093('0x2a')](util[_0xa093('0xe')](_0xa093('0x30'),_0x1b70e2,_0x162268[_0xa093('0x2b')]));emitChannelQueueInteraction(_0xdd19db[_0xa093('0x25')],_0x162268['name'],_0xdd19db[_0xa093('0x1e')],_0xdd19db[_0xa093('0xa')]['name'],_0xdd19db['message']['id'],![],_0x13ea21,_0x162268['id']);if(rpc[_0xdd19db[_0xa093('0x25')]+_0xa093('0x2c')]){return rpc[_0xdd19db['channel']+'QueueReport'][_0xa093('0x31')](_0x1b70e2,_0x1780b3)[_0xa093('0x2d')](function(_0xc1ea4b){logger[_0xa093('0x2e')](_0xa093('0x32'));});}}}function endRouting(_0x21c076,_0x11ca77,_0x51f664,_0x4c1f90){if(_0x21c076&&_0x11ca77){_0x11ca77[_0xa093('0x1d')]-=0x1;var _0x371959={'leaveAt':moment()[_0xa093('0xe')](_0xa093('0x20')),'exitAt':moment()[_0xa093('0xe')](_0xa093('0x20')),'reason':'timeout'};logger[_0xa093('0x2a')](util[_0xa093('0xe')]('[%s][END:QUEUE][NAME:%s]',_0x21c076,_0x11ca77[_0xa093('0x2b')]));emitChannelQueueInteraction(_0x51f664[_0xa093('0x25')],_0x11ca77[_0xa093('0x2b')],_0x51f664[_0xa093('0x1e')],_0x51f664['account'][_0xa093('0x2b')],_0x51f664[_0xa093('0x27')]['id'],![],_0x4c1f90);if(rpc[_0x51f664[_0xa093('0x25')]+_0xa093('0x2c')]){return rpc[_0x51f664['channel']+_0xa093('0x2c')][_0xa093('0x31')](_0x21c076,_0x371959)[_0xa093('0x2d')](function(_0x5c1531){logger[_0xa093('0x2e')](_0xa093('0x32'));});}}}function handleFindQueue(_0x2e41fd){return function(_0xe74df8){return _0xe74df8[_0xa093('0x2b')][_0xa093('0x33')]()===_0x2e41fd['toLowerCase']();};}exports[_0xa093('0x34')]=function(_0x390798,_0x5acb73,_0x2a3d97,_0x137d44){return function(_0x3b10e3){try{var _0xfe1759={'name':_0x5acb73[0x0],'timeout':_0x5acb73[0x1]};var _0x2f3bfc=queue[_0xa093('0x35')](_0xfe1759,{'typecast':!![]});if(_0x2f3bfc[_0xa093('0x36')]){logger[_0xa093('0x2e')](_0xa093('0x37'),_0x390798,_[_0xa093('0x38')](_0x2f3bfc,'message')[_0xa093('0x39')](',\x20'));_0x3b10e3[_0xa093('0x3a')]();}else{var _0xfb91ef=_['find'](_0x2a3d97[_0x137d44['channel']+_0xa093('0x3b')],handleFindQueue(_0xfe1759[_0xa093('0x2b')]));if(_0xfb91ef){startRouting(_0x390798,_0xfb91ef,_0x137d44,_0x2a3d97);var _0x29c0d8=(_0xfb91ef['timeout']||0xa)*0x3e8;var _0x235049=(_0xfe1759[_0xa093('0x3c')]||0x14)*0x3e8;var _0x2f6743,_0x218b60;if(_0x29c0d8>_0x235049){_0x235049=_0x29c0d8;}var _0x4c219c=seqqueue[_0xa093('0x3d')](_0x29c0d8);_0x4c219c['id']=_0x390798;_0x4c219c[_0xa093('0x3e')]=_0x29c0d8;_0x4c219c['qtimeout']=_0x235049;_0x4c219c[_0xa093('0x25')]=_0x137d44[_0xa093('0x25')];_0x2a3d97[_0xa093('0x3f')][_0x390798]['on'](_0xa093('0x40'),function(){logger[_0xa093('0x2a')](_0xa093('0x41'),_0x390798);stopRouting(_0x390798,_0xfb91ef,_0x137d44,_0x2a3d97);clearTimeout(_0x2f6743);_0x2f6743=undefined;_0x4c219c[_0xa093('0x42')](!![]);if(_0x2a3d97[_0xa093('0x3f')][_0x390798]){delete _0x2a3d97['rules'][_0x390798];}_0x3b10e3[_0xa093('0x3a')]();});_0x2a3d97[_0xa093('0x3f')][_0x390798]['on']('complete',function(){if(_0x2a3d97['rules'][_0x390798]){delete _0x2a3d97[_0xa093('0x3f')][_0x390798];}});_0x2f6743=setTimeout(function(){logger[_0xa093('0x2a')](_0xa093('0x43'),_0x390798);endRouting(_0x390798,_0xfb91ef,_0x137d44,_0x2a3d97);clearTimeout(_0x2f6743);_0x4c219c['close'](!![]);_0x3b10e3['next']();},_0x235049);switch(_0xfb91ef[_0xa093('0x44')]){case _0xa093('0x45'):strategy['rrmemory'](_0x4c219c,_0xfb91ef,_0x2a3d97,_0x137d44);break;default:strategy['beepall'](_0x4c219c,_0xfb91ef,_0x2a3d97,_0x137d44);}}else{logger[_0xa093('0x2e')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x390798,_0xfe1759[_0xa093('0x2b')]);_0x3b10e3[_0xa093('0x3a')]();}}}catch(_0x1b7f6f){console['log'](_0x1b7f6f);logger['error'](_0xa093('0x37'),_0x390798,_0x1b7f6f[_0xa093('0x46')]);_0x3b10e3['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 721310c..a164f0b 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 _0x4304=['agent','realtime','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','push','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','hideNotification','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x4304,0x199));var _0x4430=function(_0x126c97,_0x190382){_0x126c97=_0x126c97-0x0;var _0x1eba96=_0x4304[_0x126c97];return _0x1eba96;};'use strict';var _=require(_0x4430('0x0'));var uuid=require(_0x4430('0x1'));var util=require(_0x4430('0x2'));var logger=require(_0x4430('0x3'))(_0x4430('0x4'));var Agent=function(_0x2dc081,_0x424bd7,_0x253156,_0x5087ff){this[_0x4430('0x5')]=uuid['v4']();this[_0x4430('0x6')]=_0x2dc081;this[_0x4430('0x7')]=_0x424bd7;this[_0x4430('0x8')]=_0x253156;this[_0x4430('0x4')]=_0x5087ff;this[_0x4430('0x6')]['push'](this[_0x4430('0x9')][_0x4430('0xa')](this),this['handleTimeout']['bind'](this));this[_0x4430('0x6')]['on'](_0x4430('0xb'),this[_0x4430('0xc')][_0x4430('0xa')](this));this['squeue']['on']('drained',this[_0x4430('0xd')][_0x4430('0xa')](this));};Agent[_0x4430('0xe')]['push']=function(){this[_0x4430('0x6')]['push'](this['handleRun'][_0x4430('0xa')](this),this[_0x4430('0xc')][_0x4430('0xa')](this));};Agent[_0x4430('0xe')]['handleDrained']=function(){this[_0x4430('0xc')](!![]);};Agent[_0x4430('0xe')][_0x4430('0x9')]=function(){logger['debug']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x4430('0x6')]['id'],this['agent']['id']);if(_[_0x4430('0xf')](this[_0x4430('0x8')][_0x4430('0x10')][this[_0x4430('0x7')]['id']])){logger[_0x4430('0x11')](_0x4430('0x12'),this[_0x4430('0x6')]['id'],this[_0x4430('0x7')]['id']);setTimeout(this[_0x4430('0x13')][_0x4430('0xa')](this),0x3e8);}else{if(this[_0x4430('0x4')][_0x4430('0x14')]||util[_0x4430('0x15')](this[_0x4430('0x6')]['id'],this[_0x4430('0x8')][_0x4430('0x10')][this[_0x4430('0x7')]['id']],this[_0x4430('0x6')][_0x4430('0x16')],![])){this[_0x4430('0x8')][_0x4430('0x10')][this[_0x4430('0x7')]['id']][_0x4430('0x17')]=!![];this[_0x4430('0x8')][_0x4430('0x10')][this['agent']['id']][_0x4430('0x18')]=undefined;util[_0x4430('0x19')](this[_0x4430('0x5')],this['squeue']['id'],this[_0x4430('0x8')][_0x4430('0x10')][this[_0x4430('0x7')]['id']],null,this[_0x4430('0x4')]);util[_0x4430('0x1a')](this['squeue']['id'],this[_0x4430('0x8')][_0x4430('0x10')][this[_0x4430('0x7')]['id']],_0x4430('0x1b')+(this[_0x4430('0x4')][_0x4430('0x14')]?_0x4430('0x1c'):''));}else{logger['debug']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x4430('0x6')]['id'],this[_0x4430('0x7')]['id']);setTimeout(this[_0x4430('0x13')]['bind'](this),0x3e8);}}};Agent[_0x4430('0xe')][_0x4430('0xc')]=function(_0x58c9a8){if(_[_0x4430('0xf')](this[_0x4430('0x8')]['agents'][this[_0x4430('0x7')]['id']])){return logger['debug'](_0x4430('0x12'),this[_0x4430('0x6')]['id'],this['agent']['id']);}else{logger[_0x4430('0x11')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x4430('0x7')]['id']);util[_0x4430('0x1d')](this[_0x4430('0x5')],this['squeue']['id'],this[_0x4430('0x8')][_0x4430('0x10')][this[_0x4430('0x7')]['id']],null,this[_0x4430('0x4')]);this['realtime'][_0x4430('0x10')][this[_0x4430('0x7')]['id']][_0x4430('0x17')]=![];this[_0x4430('0x8')][_0x4430('0x10')][this[_0x4430('0x7')]['id']][_0x4430('0x18')]=undefined;util['writeLog'](this['squeue']['id'],this[_0x4430('0x8')][_0x4430('0x10')][this['agent']['id']],_0x58c9a8?_0x4430('0x1e'):'TIMEOUT');}if(!_0x58c9a8){setTimeout(this['push'][_0x4430('0xa')](this),0x3e8);}};function agent(_0x2b56a2,_0x515b4e,_0x58a750,_0x5e4014){return new Agent(_0x2b56a2,_0x515b4e,_0x58a750,_0x5e4014);}module[_0x4430('0x1f')]=agent; \ No newline at end of file +var _0xed5a=['exports','lodash','./util','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','busyQueue','showNotification',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','writeLog','STOP','TIMEOUT'];(function(_0x4ab353,_0x3b6166){var _0x2c2b4d=function(_0xf143dc){while(--_0xf143dc){_0x4ab353['push'](_0x4ab353['shift']());}};_0x2c2b4d(++_0x3b6166);}(_0xed5a,0x1f1));var _0xaed5=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0xed5a[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0xaed5('0x0'));var uuid=require('uuid');var util=require(_0xaed5('0x1'));var logger=require('../../../../../config/logger')(_0xaed5('0x2'));var Agent=function(_0x8127be,_0x29e714,_0x3d2dcb,_0x53a880){this[_0xaed5('0x3')]=uuid['v4']();this[_0xaed5('0x4')]=_0x8127be;this[_0xaed5('0x5')]=_0x29e714;this['realtime']=_0x3d2dcb;this[_0xaed5('0x2')]=_0x53a880;this[_0xaed5('0x4')][_0xaed5('0x6')](this[_0xaed5('0x7')][_0xaed5('0x8')](this),this[_0xaed5('0x9')][_0xaed5('0x8')](this));this[_0xaed5('0x4')]['on']('timeout',this[_0xaed5('0x9')]['bind'](this));this[_0xaed5('0x4')]['on'](_0xaed5('0xa'),this[_0xaed5('0xb')]['bind'](this));};Agent['prototype']['push']=function(){this['squeue'][_0xaed5('0x6')](this[_0xaed5('0x7')][_0xaed5('0x8')](this),this[_0xaed5('0x9')][_0xaed5('0x8')](this));};Agent['prototype']['handleDrained']=function(){this[_0xaed5('0x9')](!![]);};Agent[_0xaed5('0xc')][_0xaed5('0x7')]=function(){logger[_0xaed5('0xd')](_0xaed5('0xe'),this['squeue']['id'],this[_0xaed5('0x5')]['id']);if(_[_0xaed5('0xf')](this[_0xaed5('0x10')]['agents'][this[_0xaed5('0x5')]['id']])){logger[_0xaed5('0xd')](_0xaed5('0x11'),this[_0xaed5('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xaed5('0x6')]['bind'](this),0x3e8);}else{if(this[_0xaed5('0x2')][_0xaed5('0x12')]||util[_0xaed5('0x13')](this['squeue']['id'],this['realtime'][_0xaed5('0x14')][this['agent']['id']],this['squeue']['channel'],![])){this[_0xaed5('0x10')][_0xaed5('0x14')][this['agent']['id']]['busy']=!![];this[_0xaed5('0x10')][_0xaed5('0x14')][this[_0xaed5('0x5')]['id']][_0xaed5('0x15')]=undefined;util[_0xaed5('0x16')](this[_0xaed5('0x3')],this[_0xaed5('0x4')]['id'],this[_0xaed5('0x10')]['agents'][this[_0xaed5('0x5')]['id']],null,this[_0xaed5('0x2')]);util['writeLog'](this[_0xaed5('0x4')]['id'],this['realtime'][_0xaed5('0x14')][this[_0xaed5('0x5')]['id']],'RINGING'+(this[_0xaed5('0x2')][_0xaed5('0x12')]?_0xaed5('0x17'):''));}else{logger[_0xaed5('0xd')](_0xaed5('0x18'),this[_0xaed5('0x4')]['id'],this[_0xaed5('0x5')]['id']);setTimeout(this['push'][_0xaed5('0x8')](this),0x3e8);}}};Agent['prototype'][_0xaed5('0x9')]=function(_0x1773c1){if(_['isNil'](this['realtime'][_0xaed5('0x14')][this[_0xaed5('0x5')]['id']])){return logger[_0xaed5('0xd')](_0xaed5('0x11'),this[_0xaed5('0x4')]['id'],this[_0xaed5('0x5')]['id']);}else{logger[_0xaed5('0xd')](_0xaed5('0x19'),this['squeue']['id'],this[_0xaed5('0x5')]['id']);util['hideNotification'](this[_0xaed5('0x3')],this['squeue']['id'],this[_0xaed5('0x10')][_0xaed5('0x14')][this[_0xaed5('0x5')]['id']],null,this[_0xaed5('0x2')]);this[_0xaed5('0x10')][_0xaed5('0x14')][this['agent']['id']][_0xaed5('0x1a')]=![];this[_0xaed5('0x10')][_0xaed5('0x14')][this[_0xaed5('0x5')]['id']]['busyQueue']=undefined;util[_0xaed5('0x1b')](this[_0xaed5('0x4')]['id'],this[_0xaed5('0x10')][_0xaed5('0x14')][this[_0xaed5('0x5')]['id']],_0x1773c1?_0xaed5('0x1c'):_0xaed5('0x1d'));}if(!_0x1773c1){setTimeout(this[_0xaed5('0x6')][_0xaed5('0x8')](this),0x3e8);}};function agent(_0x29fe97,_0xd8c2d5,_0x906ec1,_0x234cbc){return new Agent(_0x29fe97,_0xd8c2d5,_0x906ec1,_0x234cbc);}module[_0xaed5('0x1e')]=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 ae920ed..8bdf157 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 _0x6be1=['push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','busyQueue','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','isNil','writeLog','STOP','TIMEOUT','exports','lodash','uuid','notificationId','squeue','queue','realtime','routing'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6be1,0x12f));var _0x16be=function(_0x54656b,_0x3f7d98){_0x54656b=_0x54656b-0x0;var _0x1fa9b8=_0x6be1[_0x54656b];return _0x1fa9b8;};'use strict';var _=require(_0x16be('0x0'));var uuid=require(_0x16be('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x55a2b9,_0x15a4a9,_0x688136,_0x579ab9){this[_0x16be('0x2')]=uuid['v4']();this[_0x16be('0x3')]=_0x55a2b9;this[_0x16be('0x4')]=_0x15a4a9;this[_0x16be('0x5')]=_0x688136;this[_0x16be('0x6')]=_0x579ab9;this[_0x16be('0x3')][_0x16be('0x7')](this['handleRun'][_0x16be('0x8')](this),this[_0x16be('0x9')][_0x16be('0x8')](this));this[_0x16be('0x3')]['on'](_0x16be('0xa'),this[_0x16be('0x9')][_0x16be('0x8')](this));this[_0x16be('0x3')]['on'](_0x16be('0xb'),this[_0x16be('0xc')][_0x16be('0x8')](this));};Beepall[_0x16be('0xd')][_0x16be('0x7')]=function(){this[_0x16be('0x3')][_0x16be('0x7')](this[_0x16be('0xe')]['bind'](this),this[_0x16be('0x9')][_0x16be('0x8')](this));};Beepall[_0x16be('0xd')][_0x16be('0xc')]=function(){this[_0x16be('0x9')](!![]);};Beepall['prototype'][_0x16be('0xe')]=function(){var _0xcf91fc=!![];if(!_['isNil'](this[_0x16be('0x4')])&&!_['isNil'](this['queue']['Agents'])&&this[_0x16be('0x4')][_0x16be('0xf')][_0x16be('0x10')]>0x0){for(var _0x5e8eeb=0x0,_0x1c5e03;_0x5e8eeb0x0){for(var _0x39d34b=0x0,_0x36883a;_0x39d34b0x0&&_0x593e60[_0x12954f+'CurrentCapacity']>=_0x593e60[_0x12954f+'Capacity']){writeLog(_0x576681,_0x593e60,_0x12954f['toUpperCase']()+_0x7dc9('0x24'));return![];}}return!![];};exports[_0x7dc9('0x25')]=function(_0x5843bf,_0x585eef,_0x47771b,_0x5afb7d,_0x2d22eb){return sendNotification(!![],_0x5843bf,_0x585eef,_0x47771b,_0x5afb7d,_0x2d22eb);};exports[_0x7dc9('0x26')]=function(_0x3a74a0,_0x3e4102,_0xa2aaa9,_0x450124,_0x236d42){return sendNotification(![],_0x3a74a0,_0x3e4102,_0xa2aaa9,_0x450124,_0x236d42);};exports[_0x7dc9('0x27')]=writeLog; \ No newline at end of file +var _0xe14b=['emit','user:save','split','account','notificationSound','notificationShake','body','queue','notificationTemplate','msg','error','format','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','lodash','util','../../../../../config/environment','../../../../../config/logger','redis','localhost','socket.io-emitter','user:%s','name'];(function(_0x5ab05b,_0x59ba0f){var _0x47b4ac=function(_0x100950){while(--_0x100950){_0x5ab05b['push'](_0x5ab05b['shift']());}};_0x47b4ac(++_0x59ba0f);}(_0xe14b,0x93));var _0xbe14=function(_0x22a230,_0xacfeea){_0x22a230=_0x22a230-0x0;var _0x189919=_0xe14b[_0x22a230];return _0x189919;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var utils=require('../utils');var Redis=require('ioredis');var config=require(_0xbe14('0x2'));var logger=require(_0xbe14('0x3'))('routing');config[_0xbe14('0x4')]=_['defaults'](config['redis'],{'host':_0xbe14('0x5'),'port':0x18eb});var io=require(_0xbe14('0x6'))(new Redis(config[_0xbe14('0x4')]));function sendNotification(_0x1ff100,_0x1d9ade,_0x39387e,_0x196fca,_0x566ae7,_0x50f909){io['to'](util['format'](_0xbe14('0x7'),_0x196fca[_0xbe14('0x8')]))[_0xbe14('0x9')](_0xbe14('0xa'),_0x196fca);var _0x53c7ea=_0x50f909||{};var _0x5b9fc6=_0x39387e[_0xbe14('0xb')]('.');var _0x3f70cb={'uniqueid':_0x1d9ade,'channel':_0x5b9fc6[0x0],'id':_0x5b9fc6[0x1],'title':_0x5b9fc6[0x0]+'\x20interaction','interactionId':_0x5b9fc6[0x2],'queue':_0x566ae7?_0x566ae7[_0xbe14('0x8')]:null,'sound':_0x53c7ea[_0xbe14('0xc')][_0xbe14('0xd')],'shake':_0x53c7ea[_0xbe14('0xc')][_0xbe14('0xe')]};try{if(!_0x53c7ea[_0xbe14('0xf')]){_0x53c7ea[_0xbe14('0xf')]={};}if(_0x566ae7){_0x53c7ea[_0xbe14('0xf')][_0xbe14('0x10')]=_0x566ae7;}else if(_0x53c7ea[_0xbe14('0xf')][_0xbe14('0x10')]){delete _0x53c7ea[_0xbe14('0xf')][_0xbe14('0x10')];}_0x3f70cb['msg']=utils['getMustacheRender'](_0x53c7ea[_0xbe14('0xc')][_0xbe14('0x11')],_0x53c7ea);}catch(_0xf4ac9){_0x3f70cb[_0xbe14('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0xbe14('0x13')](util[_0xbe14('0x14')](_0xbe14('0x15'),_0x1d9ade,_0xf4ac9[_0xbe14('0x16')]));}io['to'](util[_0xbe14('0x14')](_0xbe14('0x7'),_0x196fca[_0xbe14('0x8')]))['emit'](util[_0xbe14('0x14')](_0xbe14('0x17'),_0x1ff100?_0xbe14('0x18'):_0xbe14('0x19')),_0x3f70cb);}function writeLog(_0x3249da,_0x37e4c1,_0x59a9e3){return logger[_0xbe14('0x1a')](util[_0xbe14('0x14')](_0xbe14('0x1b'),_0x3249da,_0x37e4c1[_0xbe14('0x8')],_0x59a9e3));}exports[_0xbe14('0x1c')]=function(_0x51dc0b,_0xe60f42,_0x56d845,_0x3c1c85){if(_0xe60f42['busy']){writeLog(_0x51dc0b,_0xe60f42,_0xbe14('0x1d'));return![];}if(!_0xe60f42['online']){writeLog(_0x51dc0b,_0xe60f42,_0xbe14('0x1e'));return![];}if(_0xe60f42[_0x56d845+_0xbe14('0x1f')]){writeLog(_0x51dc0b,_0xe60f42,'PAUSE');return![];}if(_0x3c1c85&&_0xe60f42[_0xbe14('0x20')](_0x56d845+'Capacity')&&_0xe60f42[_0xbe14('0x20')](_0x56d845+'CurrentCapacity')){if(_0xe60f42[_0x56d845+_0xbe14('0x21')]>0x0&&_0xe60f42[_0x56d845+_0xbe14('0x22')]>=_0xe60f42[_0x56d845+_0xbe14('0x21')]){writeLog(_0x51dc0b,_0xe60f42,_0x56d845[_0xbe14('0x23')]()+_0xbe14('0x24'));return![];}}return!![];};exports[_0xbe14('0x25')]=function(_0x55d001,_0x1822e0,_0x1ba46a,_0x391556,_0x169369){return sendNotification(!![],_0x55d001,_0x1822e0,_0x1ba46a,_0x391556,_0x169369);};exports['hideNotification']=function(_0x16f884,_0x29fc64,_0x59bf34,_0x3c3613,_0x3b3e84){return sendNotification(![],_0x16f884,_0x29fc64,_0x59bf34,_0x3c3613,_0x3b3e84);};exports[_0xbe14('0x26')]=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 9b16240..bddd663 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 _0xb0b9=['./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20%s','isObject','stringify','validate'];(function(_0x81bf2f,_0x2a705e){var _0x447f8e=function(_0x22e247){while(--_0x22e247){_0x81bf2f['push'](_0x81bf2f['shift']());}};_0x447f8e(++_0x2a705e);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x5bc870,_0x8670c5){_0x5bc870=_0x5bc870-0x0;var _0xbcdab5=_0xb0b9[_0x5bc870];return _0xbcdab5;};'use strict';var schema=require(_0x9b0b('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0x9b0b('0x1'));var logger=require(_0x9b0b('0x2'))(_0x9b0b('0x3'));var system=schema({'command':{'type':_0x9b0b('0x4'),'required':!![],'message':_0x9b0b('0x5')}});exports[_0x9b0b('0x6')]=function(_0x311e29,_0x271b79){return function(_0x2b89dc){try{var _0x24d4a9={'command':_0x271b79[0x0]};var _0x2c3d97=system[_0x9b0b('0x0')](_0x24d4a9,{'typecast':!![]});if(_0x2c3d97[_0x9b0b('0x7')]){logger[_0x9b0b('0x8')]('[%s][SYSTEM]\x20%s',_0x311e29,_['map'](_0x2c3d97,_0x9b0b('0x9'))[_0x9b0b('0xa')](',\x20'));logger[_0x9b0b('0xb')](_0x9b0b('0xc'),_0x311e29);_0x2b89dc[_0x9b0b('0xd')]();}else{var _0xc07d94=this;var _0x5713db=utils[_0x9b0b('0xe')](_0x271b79[0x0],this);logger[_0x9b0b('0xb')](_0x9b0b('0xf'),_0x311e29,_0x5713db);sh[_0x9b0b('0x10')](_['trim'](_0x5713db),function(_0x5da6e7,_0x39d1f3){logger['info'](_0x9b0b('0x11'),_0x311e29,_0x5da6e7);if(_0x5da6e7==0x0){var _0x4e6739=_0x39d1f3[_0x9b0b('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x9b0b('0x13')](_0x271b79[0x1])||_['isEmpty'](_0x271b79[0x1])){logger['info'](_0x9b0b('0x14'),_0x311e29);_0xc07d94[_0x9b0b('0x15')][_0x271b79[0x1]]=_0x4e6739;}else{logger[_0x9b0b('0xb')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x311e29,_0x271b79[0x1],_0x4e6739);_0xc07d94[_0x9b0b('0x15')][_0x271b79[0x1]]=_0x4e6739;}}_0x2b89dc[_0x9b0b('0xd')]();});}}catch(_0x297b07){logger[_0x9b0b('0x8')](_0x9b0b('0x16'),_0x311e29,_[_0x9b0b('0x17')](_0x297b07)?JSON[_0x9b0b('0x18')](_0x297b07):_0x297b07);logger[_0x9b0b('0xb')](_0x9b0b('0xc'),_0x311e29);_0x2b89dc[_0x9b0b('0xd')]();}};}; \ No newline at end of file +var _0xa7b4=['message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','lodash','../../../../config/logger','routing','validate','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0x17fb4c,_0x1e4f06){var _0x3df500=function(_0x40d5b1){while(--_0x40d5b1){_0x17fb4c['push'](_0x17fb4c['shift']());}};_0x3df500(++_0x1e4f06);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x466c42,_0x17d7c1){_0x466c42=_0x466c42-0x0;var _0x2a833f=_0xa7b4[_0x466c42];return _0x2a833f;};'use strict';var schema=require('validate');var sh=require(_0x4a7b('0x0'));var _=require(_0x4a7b('0x1'));var utils=require('./utils');var logger=require(_0x4a7b('0x2'))(_0x4a7b('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x8c0229,_0x348341){return function(_0x5b5038){try{var _0x27e783={'command':_0x348341[0x0]};var _0xf43e24=system[_0x4a7b('0x4')](_0x27e783,{'typecast':!![]});if(_0xf43e24[_0x4a7b('0x5')]){logger[_0x4a7b('0x6')](_0x4a7b('0x7'),_0x8c0229,_[_0x4a7b('0x8')](_0xf43e24,_0x4a7b('0x9'))[_0x4a7b('0xa')](',\x20'));logger[_0x4a7b('0xb')](_0x4a7b('0xc'),_0x8c0229);_0x5b5038[_0x4a7b('0xd')]();}else{var _0x18dd5c=this;var _0x5a02f0=utils[_0x4a7b('0xe')](_0x348341[0x0],this);logger['info'](_0x4a7b('0xf'),_0x8c0229,_0x5a02f0);sh[_0x4a7b('0x10')](_[_0x4a7b('0x11')](_0x5a02f0),function(_0x2853bb,_0x56979b){logger['info'](_0x4a7b('0x12'),_0x8c0229,_0x2853bb);if(_0x2853bb==0x0){var _0x1bf34b=_0x56979b['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x348341[0x1])||_[_0x4a7b('0x13')](_0x348341[0x1])){logger[_0x4a7b('0xb')](_0x4a7b('0x14'),_0x8c0229);_0x18dd5c[_0x4a7b('0x15')][_0x348341[0x1]]=_0x1bf34b;}else{logger[_0x4a7b('0xb')](_0x4a7b('0x16'),_0x8c0229,_0x348341[0x1],_0x1bf34b);_0x18dd5c[_0x4a7b('0x15')][_0x348341[0x1]]=_0x1bf34b;}}_0x5b5038[_0x4a7b('0xd')]();});}}catch(_0x314542){logger[_0x4a7b('0x6')]('[%s][SYSTEM]\x20%s',_0x8c0229,_[_0x4a7b('0x17')](_0x314542)?JSON[_0x4a7b('0x18')](_0x314542):_0x314542);logger[_0x4a7b('0xb')](_0x4a7b('0xc'),_0x8c0229);_0x5b5038[_0x4a7b('0xd')]();}};}; \ 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 cd0cdfa..707fcdc 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 _0x04bf=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','consequence','validate','length','error','map','message','join','info','next','channel','Interaction','interaction','then','[%s][TAG]\x20%s','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x52f4a5,_0x364ed3){var _0xfafffa=function(_0xa2cc09){while(--_0xa2cc09){_0x52f4a5['push'](_0x52f4a5['shift']());}};_0xfafffa(++_0x364ed3);}(_0x04bf,0xac));var _0xf04b=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x04bf[_0x46698a];return _0x356db0;};'use strict';var schema=require('validate');var _=require(_0xf04b('0x0'));var rpc={'chatInteraction':require(_0xf04b('0x1')),'openchannelInteraction':require(_0xf04b('0x2')),'smsInteraction':require(_0xf04b('0x3')),'mailInteraction':require(_0xf04b('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xf04b('0x5'))(_0xf04b('0x6'));var tag=schema({'tag':{'type':_0xf04b('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf04b('0x8')]=function(_0x3701bb,_0x11358d,_0x446cc0,_0x2ef42d){return function(_0x50c260){try{var _0x2f1cd3={'tag':_0x11358d[0x0]};var _0x329ab9=tag[_0xf04b('0x9')](_0x2f1cd3,{'typecast':!![]});if(_0x329ab9[_0xf04b('0xa')]){logger[_0xf04b('0xb')]('[%s][TAG]\x20%s',_0x3701bb,_[_0xf04b('0xc')](_0x329ab9,_0xf04b('0xd'))[_0xf04b('0xe')](',\x20'));logger[_0xf04b('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3701bb);_0x50c260[_0xf04b('0x10')]();}else{var _0x351ec9={'ids':[_0x11358d[0x0]]};if(rpc[_0x2ef42d[_0xf04b('0x11')]+'Interaction']){rpc[_0x2ef42d[_0xf04b('0x11')]+_0xf04b('0x12')]['addTags'](_0x2ef42d[_0xf04b('0x13')]['id'],_0x351ec9)[_0xf04b('0x14')](function(_0x4b7485){logger[_0xf04b('0xf')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3701bb,_0x11358d[0x1],_0x2ef42d[_0xf04b('0x11')],_0x2ef42d['interaction']['id']);})['catch'](function(_0x3becdc){logger[_0xf04b('0xb')](_0xf04b('0x15'),_0x3701bb,JSON['stringify'](_0x3becdc));logger[_0xf04b('0xf')](_0xf04b('0x16'),_0x3701bb);})[_0xf04b('0x17')](function(){_0x50c260[_0xf04b('0x10')]();});}}}catch(_0x587124){logger[_0xf04b('0xb')](_0xf04b('0x15'),_0x3701bb,_[_0xf04b('0x18')](_0x587124)?JSON['stringify'](_0x587124):_0x587124);logger[_0xf04b('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3701bb);_0x50c260['next']();}};}; \ No newline at end of file +var _0x3854=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','join','info'];(function(_0x53256e,_0xbec028){var _0x52a80b=function(_0x206849){while(--_0x206849){_0x53256e['push'](_0x53256e['shift']());}};_0x52a80b(++_0xbec028);}(_0x3854,0x155));var _0x4385=function(_0xa319c3,_0x347c0b){_0xa319c3=_0xa319c3-0x0;var _0x31af38=_0x3854[_0xa319c3];return _0x31af38;};'use strict';var schema=require('validate');var _=require(_0x4385('0x0'));var rpc={'chatInteraction':require(_0x4385('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4385('0x2')),'mailInteraction':require(_0x4385('0x3')),'faxInteraction':require(_0x4385('0x4')),'whatsappInteraction':require(_0x4385('0x5'))};var logger=require(_0x4385('0x6'))(_0x4385('0x7'));var tag=schema({'tag':{'type':_0x4385('0x8'),'required':!![],'message':_0x4385('0x9')}});exports[_0x4385('0xa')]=function(_0x2b0588,_0xd67a8b,_0x4e3fd7,_0x5a2de4){return function(_0x5881bb){try{var _0x2e95f0={'tag':_0xd67a8b[0x0]};var _0xcf203d=tag[_0x4385('0xb')](_0x2e95f0,{'typecast':!![]});if(_0xcf203d[_0x4385('0xc')]){logger[_0x4385('0xd')](_0x4385('0xe'),_0x2b0588,_[_0x4385('0xf')](_0xcf203d,_0x4385('0x10'))[_0x4385('0x11')](',\x20'));logger[_0x4385('0x12')](_0x4385('0x13'),_0x2b0588);_0x5881bb[_0x4385('0x14')]();}else{var _0x18f74c={'ids':[_0xd67a8b[0x0]]};if(rpc[_0x5a2de4[_0x4385('0x15')]+_0x4385('0x16')]){rpc[_0x5a2de4[_0x4385('0x15')]+_0x4385('0x16')][_0x4385('0x17')](_0x5a2de4['interaction']['id'],_0x18f74c)['then'](function(_0x1bf94a){logger[_0x4385('0x12')](_0x4385('0x18'),_0x2b0588,_0xd67a8b[0x1],_0x5a2de4[_0x4385('0x15')],_0x5a2de4[_0x4385('0x19')]['id']);})[_0x4385('0x1a')](function(_0x520fbd){logger[_0x4385('0xd')]('[%s][TAG]\x20%s',_0x2b0588,JSON[_0x4385('0x1b')](_0x520fbd));logger[_0x4385('0x12')](_0x4385('0x13'),_0x2b0588);})[_0x4385('0x1c')](function(){_0x5881bb['next']();});}}}catch(_0x387985){logger['error'](_0x4385('0xe'),_0x2b0588,_[_0x4385('0x1d')](_0x387985)?JSON[_0x4385('0x1b')](_0x387985):_0x387985);logger[_0x4385('0x12')](_0x4385('0x13'),_0x2b0588);_0x5881bb[_0x4385('0x14')]();}};}; \ 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 e79492f..ca9f9d7 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 _0x1f2f=['login','params','then','parse','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stringify','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','replace','includes','push','urlOnAnswer','?params=','urlOnRing'];(function(_0x507a68,_0x2848de){var _0x2ae31f=function(_0xbc89ee){while(--_0xbc89ee){_0x507a68['push'](_0x507a68['shift']());}};_0x2ae31f(++_0x2848de);}(_0x1f2f,0x105));var _0xf1f2=function(_0xef3ae2,_0x4c63b8){_0xef3ae2=_0xef3ae2-0x0;var _0x1cc22b=_0x1f2f[_0xef3ae2];return _0x1cc22b;};'use strict';var rp=require(_0xf1f2('0x0'));var logger=require(_0xf1f2('0x1'))('routing');var _=require(_0xf1f2('0x2'));var arr=[];exports['consequence']=function(_0x1aefc8,_0x26587c){return function(_0x5cb31f){var _0x2129c3=_0x26587c[0xa];var _0x1071de=_0x26587c[0xb];var _0x1c86c1=_0x26587c[0xc];var _0xcedf7=_0x26587c[0xd];var _0x2c2a8a=_0x26587c[0xe];var _0x306cee=_0x26587c[0xf][_0xf1f2('0x3')](/\n/g,'\x20-\x20');var _0xe82dd4=_0x26587c[0x10][_0xf1f2('0x3')](/\n/g,'\x20');if(!arr[_0xf1f2('0x4')](_0x1071de)){arr[_0xf1f2('0x5')](_0x1071de);var _0x49ed9d=_0x26587c[0x3];var _0x112973=_0x26587c[0x4];var _0x53f23b=_0x26587c[0x1];var _0x3e49f6=_0x26587c[0x0];var _0x395fb6={};_0x395fb6[_0xf1f2('0x6')]=_0x26587c[0x8]+_0xf1f2('0x7')+_0x1c86c1+'|'+_0x2129c3+'|'+_0xcedf7+'|'+_0x1071de+'|'+_0x2c2a8a;_0x395fb6[_0xf1f2('0x8')]=_0x26587c[0x7]+_0xf1f2('0x7')+_0x1c86c1+'|'+_0x2129c3+'|'+_0xcedf7+'|'+_0x1071de+'|'+_0x2c2a8a+'|'+_0x306cee+'|'+_0xe82dd4;_0x395fb6['title']=_0x26587c[0x9];var _0x5b3569={};_0x5b3569['jsonrpc']='2.0';_0x5b3569['method']=_0xf1f2('0x9');var _0x25d03c=[];_0x25d03c[_0xf1f2('0x5')](_0x26587c[0x2]);_0x25d03c[_0xf1f2('0x5')](_0x26587c[0x5]);_0x25d03c[_0xf1f2('0x5')](_0x26587c[0x6]);_0x5b3569[_0xf1f2('0xa')]=_0x25d03c;_0x5b3569['id']=0x1;var _0x357151=JSON['stringify'](_0x5b3569);var _0x44cdd8={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x49ed9d,'headers':{'Content-Type':'application/json-rpc'},'body':_0x357151};return rp(_0x44cdd8)[_0xf1f2('0xb')](function(_0x5d1efd){const _0x50db67=JSON[_0xf1f2('0xc')](_0x5d1efd);if(!_0x50db67['result']['logged']){throw new Error(_0xf1f2('0xd'));}var _0x2f9277=_0x1071de;var _0x171ade=_0xf1f2('0xe')+_0x53f23b+_0xf1f2('0xf')+_0x3e49f6+_0xf1f2('0x10')+_0x2f9277+_0xf1f2('0x11')+JSON[_0xf1f2('0x12')](_0x395fb6);var _0x251e5b=_0x112973+'?'+_0x171ade;return rp(_0x251e5b);})[_0xf1f2('0xb')](function(_0x498ce7){logger[_0xf1f2('0x13')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1aefc8,_0x498ce7);_0x5cb31f[_0xf1f2('0x14')]();})[_0xf1f2('0x15')](function(_0x4a23fd){logger[_0xf1f2('0x16')](_0xf1f2('0x17'),_0x1aefc8,_[_0xf1f2('0x18')](_0x4a23fd)?JSON['stringify'](_0x4a23fd):_0x4a23fd);_0x5cb31f['stop']();});}else{logger[_0xf1f2('0x13')](_0xf1f2('0x19'),_0x1aefc8);_0x5cb31f[_0xf1f2('0x1a')]();}};}; \ No newline at end of file +var _0xabf6=['\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','login','params','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','stringify','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','replace'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xabf6,0x193));var _0x6abf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabf6[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x6abf('0x0'));var logger=require(_0x6abf('0x1'))('routing');var _=require(_0x6abf('0x2'));var arr=[];exports[_0x6abf('0x3')]=function(_0x1dd3d0,_0x19ef5f){return function(_0x388a4c){var _0x2e2a80=_0x19ef5f[0xa];var _0x45f6f1=_0x19ef5f[0xb];var _0x256b00=_0x19ef5f[0xc];var _0x3fb533=_0x19ef5f[0xd];var _0x5c240e=_0x19ef5f[0xe];var _0x39195b=_0x19ef5f[0xf][_0x6abf('0x4')](/\n/g,_0x6abf('0x5'));var _0x2c88e8=_0x19ef5f[0x10][_0x6abf('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x45f6f1)){arr[_0x6abf('0x6')](_0x45f6f1);var _0x275912=_0x19ef5f[0x3];var _0x322db8=_0x19ef5f[0x4];var _0x1a5d01=_0x19ef5f[0x1];var _0x532f5d=_0x19ef5f[0x0];var _0x1f6763={};_0x1f6763[_0x6abf('0x7')]=_0x19ef5f[0x8]+_0x6abf('0x8')+_0x256b00+'|'+_0x2e2a80+'|'+_0x3fb533+'|'+_0x45f6f1+'|'+_0x5c240e;_0x1f6763[_0x6abf('0x9')]=_0x19ef5f[0x7]+_0x6abf('0x8')+_0x256b00+'|'+_0x2e2a80+'|'+_0x3fb533+'|'+_0x45f6f1+'|'+_0x5c240e+'|'+_0x39195b+'|'+_0x2c88e8;_0x1f6763[_0x6abf('0xa')]=_0x19ef5f[0x9];var _0x3fbb47={};_0x3fbb47[_0x6abf('0xb')]=_0x6abf('0xc');_0x3fbb47['method']=_0x6abf('0xd');var _0x235764=[];_0x235764[_0x6abf('0x6')](_0x19ef5f[0x2]);_0x235764[_0x6abf('0x6')](_0x19ef5f[0x5]);_0x235764[_0x6abf('0x6')](_0x19ef5f[0x6]);_0x3fbb47[_0x6abf('0xe')]=_0x235764;_0x3fbb47['id']=0x1;var _0x531e5d=JSON['stringify'](_0x3fbb47);var _0x55daca={'encoding':'utf8','method':_0x6abf('0xf'),'timeout':0x2710,'url':_0x275912,'headers':{'Content-Type':_0x6abf('0x10')},'body':_0x531e5d};return rp(_0x55daca)[_0x6abf('0x11')](function(_0x5e15ea){const _0x3489ab=JSON[_0x6abf('0x12')](_0x5e15ea);if(!_0x3489ab[_0x6abf('0x13')]['logged']){throw new Error(_0x6abf('0x14'));}var _0xcb0fc1=_0x45f6f1;var _0x597948=_0x6abf('0x15')+_0x1a5d01+_0x6abf('0x16')+_0x532f5d+_0x6abf('0x17')+_0xcb0fc1+_0x6abf('0x18')+JSON['stringify'](_0x1f6763);var _0x1886cf=_0x322db8+'?'+_0x597948;return rp(_0x1886cf);})[_0x6abf('0x11')](function(_0x52191e){logger[_0x6abf('0x19')](_0x6abf('0x1a'),_0x1dd3d0,_0x52191e);_0x388a4c['stop']();})[_0x6abf('0x1b')](function(_0x497df1){logger[_0x6abf('0x1c')](_0x6abf('0x1d'),_0x1dd3d0,_['isObject'](_0x497df1)?JSON[_0x6abf('0x1e')](_0x497df1):_0x497df1);_0x388a4c[_0x6abf('0x1f')]();});}else{logger[_0x6abf('0x19')](_0x6abf('0x20'),_0x1dd3d0);_0x388a4c[_0x6abf('0x21')]();}};}; \ 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 fd55e43..adab719 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x347d73,_0x221681){var _0x25fe2a=function(_0x1afa32){while(--_0x1afa32){_0x347d73['push'](_0x347d73['shift']());}};_0x25fe2a(++_0x221681);}(_0xe706,0xa3));var _0x6e70=function(_0x1781f9,_0x5c36a3){_0x1781f9=_0x1781f9-0x0;var _0x4bd468=_0xe706[_0x1781f9];return _0x4bd468;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x1a7a8f,_0x352e8a){var _0x1d59e6=function(_0x430783){while(--_0x430783){_0x1a7a8f['push'](_0x1a7a8f['shift']());}};_0x1d59e6(++_0x352e8a);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 5c17173..b2dce87 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 _0x39cb=['update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','bluebird','./applications/utils','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','split','mail','push','slice','join','appdata','dialogflowv2','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','emit','complete','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport'];(function(_0x2c138f,_0x2c8b8a){var _0x3f4290=function(_0x2f1d9e){while(--_0x2f1d9e){_0x2c138f['push'](_0x2c138f['shift']());}};_0x3f4290(++_0x2c8b8a);}(_0x39cb,0x1bd));var _0xb39c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x39cb[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xb39c('0x2'));var utils=require(_0xb39c('0x3'));var logger=require('../../../config/logger')(_0xb39c('0x4'));var rpc={'openchannelQueueReport':require(_0xb39c('0x5')),'mailQueueReport':require(_0xb39c('0x6')),'chatQueueReport':require(_0xb39c('0x7')),'smsQueueReport':require(_0xb39c('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xb39c('0x9'))};var RuleEngine=require(_0xb39c('0xa'));function getId(_0x40112f,_0x3f2fbe,_0x47d6d7){return util['format'](_0xb39c('0xb'),_0x40112f,_0x3f2fbe||0x0,_0x47d6d7||0x0);}function getIntervals(_0x7aa397,_0x3ffb94){var _0x42c6dc=[];if(!_['isNil'](_0x3ffb94['IntervalId'])&&!_['isNil'](_0x7aa397[_0x3ffb94[_0xb39c('0xc')]])&&!_[_0xb39c('0xd')](_0x7aa397[_0x3ffb94[_0xb39c('0xc')]][_0xb39c('0xe')])){_0x42c6dc=_[_0xb39c('0xf')](_0x7aa397[_0x3ffb94[_0xb39c('0xc')]][_0xb39c('0xe')],_0xb39c('0x10'));}else if(!_['isNil'](_0x3ffb94[_0xb39c('0x10')])){_0x42c6dc=[_0x3ffb94[_0xb39c('0x10')]];}return _0x42c6dc;}exports[_0xb39c('0x11')]=function(_0x5e4caf){_0x5e4caf[_0xb39c('0x12')]={};return new BPromise(function(_0x40a6d3,_0x42a203){var _0x386c80={'Start':function(_0x469fa9){var _0x27c22a=this;return new Promise(function(_0x8e9181,_0x5277ce){if(_0x469fa9){try{var _0x316c9b=[];var _0x3223f6=getId(_0x469fa9[_0xb39c('0x13')],_0x469fa9[_0xb39c('0x14')]?_0x469fa9[_0xb39c('0x14')]['id']:0x0,_0x469fa9[_0xb39c('0x15')]?_0x469fa9[_0xb39c('0x15')]['id']:0x0);if(_0x469fa9[_0xb39c('0x16')]&&_[_0xb39c('0x17')](_0x469fa9[_0xb39c('0x16')])&&_0x469fa9['applications'][_0xb39c('0x18')]){for(var _0x1a8e12=0x0;_0x1a8e12<_0x469fa9[_0xb39c('0x16')][_0xb39c('0x18')];_0x1a8e12+=0x1){var _0x50ab8b=_0x469fa9[_0xb39c('0x16')][_0x1a8e12];if(fs[_0xb39c('0x19')](path['join'](__dirname,_0xb39c('0x16'),_0x50ab8b[_0xb39c('0x1a')]+_0xb39c('0x1b')))){var _0x4ebfca=[];switch(_0x50ab8b['app'][_0xb39c('0x1c')]()){case _0xb39c('0x1d'):var _0x3c8dfd=_0x50ab8b['appdata'][_0xb39c('0x1e')](',');if(_0x469fa9[_0xb39c('0x13')]===_0xb39c('0x1f')){_0x4ebfca[_0xb39c('0x20')](_0x3c8dfd[0x0]);_0x4ebfca[_0xb39c('0x20')](_0x3c8dfd[0x1]);_0x4ebfca['push'](_0x3c8dfd[_0xb39c('0x21')](0x2,_0x3c8dfd[_0xb39c('0x18')])['join'](','));}else{_0x4ebfca[_0xb39c('0x20')](_0x3c8dfd[0x0]);_0x4ebfca[_0xb39c('0x20')](_0x3c8dfd[_0xb39c('0x21')](0x1,_0x3c8dfd[_0xb39c('0x18')])[_0xb39c('0x22')](','));}break;case'dialogflow':var _0x23a2f1=_0x50ab8b[_0xb39c('0x23')][_0xb39c('0x1e')](',');_0x4ebfca['push'](_0x23a2f1[0x0]);_0x4ebfca[_0xb39c('0x20')](_0x23a2f1[0x1]);_0x4ebfca[_0xb39c('0x20')](_0x23a2f1['slice'](0x2,_0x23a2f1[_0xb39c('0x18')])[_0xb39c('0x22')](','));break;case _0xb39c('0x24'):var _0x4e9672=_0x50ab8b[_0xb39c('0x23')][_0xb39c('0x1e')](',');_0x4ebfca['push'](_0x4e9672[0x0]);_0x4ebfca[_0xb39c('0x20')](_0x4e9672[0x1]);_0x4ebfca['push'](_0x4e9672[0x2]);_0x4ebfca[_0xb39c('0x20')](_0x4e9672[0x3]);_0x4ebfca[_0xb39c('0x20')](_0x4e9672[_0xb39c('0x21')](0x4,_0x4e9672[_0xb39c('0x18')])[_0xb39c('0x22')](','));break;case'amazonlex':var _0x433a39=_0x50ab8b['appdata'][_0xb39c('0x1e')](',');_0x4ebfca['push'](_0x433a39[0x0]);_0x4ebfca[_0xb39c('0x20')](_0x433a39[0x1]);_0x4ebfca[_0xb39c('0x20')](_0x433a39[0x2]);_0x4ebfca[_0xb39c('0x20')](_0x433a39[0x3]);_0x4ebfca[_0xb39c('0x20')](_0x433a39['slice'](0x4,_0x433a39['length'])[_0xb39c('0x22')](','));break;case _0xb39c('0x14'):_0x4ebfca['push'](_0x50ab8b[_0xb39c('0x23')]);break;case _0xb39c('0x25'):_0x4ebfca[_0xb39c('0x20')](_0x50ab8b[_0xb39c('0x26')]);_0x4ebfca[_0xb39c('0x20')](_0x50ab8b[_0xb39c('0x23')]);break;case _0xb39c('0x27'):var _0x45e700=utils[_0xb39c('0x28')](_0x469fa9[_0xb39c('0x29')][_0xb39c('0x2a')],_0x469fa9);var _0x7ab8ca=_0x50ab8b[_0xb39c('0x23')][_0xb39c('0x1e')](',');_0x4ebfca[_0xb39c('0x20')](_0x7ab8ca[0x0]);_0x4ebfca[_0xb39c('0x20')](_0x7ab8ca[0x1]);_0x4ebfca[_0xb39c('0x20')](_0x7ab8ca[0x2]);_0x4ebfca[_0xb39c('0x20')](_0x7ab8ca[0x3]);_0x4ebfca[_0xb39c('0x20')](_0x7ab8ca[0x4]);_0x4ebfca['push'](_0x7ab8ca[0x5]);_0x4ebfca[_0xb39c('0x20')](_0x7ab8ca[0x6]);_0x4ebfca[_0xb39c('0x20')](_0x7ab8ca[0x7]);_0x4ebfca['push'](_0x7ab8ca[0x8]);_0x4ebfca['push'](_0x7ab8ca[0x9]);_0x4ebfca['push'](_0x7ab8ca[0xa]);_0x4ebfca[_0xb39c('0x20')](_0x469fa9[_0xb39c('0x15')]['id']);_0x4ebfca[_0xb39c('0x20')](_0x469fa9['message']['id']);_0x4ebfca[_0xb39c('0x20')](_0x50ab8b[_0xb39c('0x2b')]);_0x4ebfca[_0xb39c('0x20')](_0x469fa9[_0xb39c('0x15')][_0xb39c('0x2c')]);_0x4ebfca['push'](_0x469fa9[_0xb39c('0x2d')][_0xb39c('0x2d')]);_0x4ebfca['push'](_0x45e700);break;default:_0x4ebfca=_[_0xb39c('0xd')](_0x50ab8b['appdata'])?[]:_0x50ab8b[_0xb39c('0x23')][_0xb39c('0x1e')](',');}var _0x3eaf96={'id':util['format'](_0xb39c('0x2e'),_0x3223f6,_0x50ab8b['id'],_0x50ab8b[_0xb39c('0x1a')]),'condition':require(_0xb39c('0x2f'))[_0xb39c('0x30')](_0x3223f6,getIntervals(_0x5e4caf[_0xb39c('0x31')],_0x50ab8b),_0x5e4caf),'consequence':require(_0xb39c('0x32')+_0x50ab8b[_0xb39c('0x1a')])[_0xb39c('0x33')](_0x3223f6,_0x4ebfca,_0x5e4caf,_0x469fa9),'p':_0x50ab8b[_0xb39c('0x34')]||0x0};logger[_0xb39c('0x35')](_0xb39c('0x36'),_0x3eaf96['id'],_0xb39c('0x37'),getIntervals(_0x5e4caf['intervals'],_0x50ab8b)[_0xb39c('0x22')](_0xb39c('0x38')));_0x316c9b[_0xb39c('0x20')](_0x3eaf96);}else{logger[_0xb39c('0x39')](_0xb39c('0x3a'),path[_0xb39c('0x22')](__dirname,_0xb39c('0x16'),_0x50ab8b[_0xb39c('0x1a')]+_0xb39c('0x1b')));}}_0x5e4caf['rules'][_0x3223f6]=new RuleEngine(_0x316c9b);_0x5e4caf['rules'][_0x3223f6][_0xb39c('0x3b')](_0x469fa9,function(_0x36d948){logger['info']('Applications\x20executed',JSON[_0xb39c('0x3c')](_0x36d948['matchPath']));if(_0x5e4caf[_0xb39c('0x12')][_0x3223f6]){_0x5e4caf[_0xb39c('0x12')][_0x3223f6][_0xb39c('0x3d')](_0xb39c('0x3e'));}});return _0x8e9181({'code':0xc8,'message':_0x469fa9});}else{logger[_0xb39c('0x35')]('No\x20applications\x20to\x20execute');return _0x8e9181({'code':0xc8,'message':_0x469fa9});}}catch(_0x41c4fe){logger[_0xb39c('0x39')](_0x41c4fe['stack']);return _0x5277ce(_0x27c22a['error'](0x1f4,_0x41c4fe));}}return _0x5277ce(_0xb39c('0x3f'));});},'AcceptMessage':function(_0x53408c){var _0x5470f1=this;return new Promise(function(_0x20a5c4,_0x2ff5ac){if(_0x53408c[_0xb39c('0x40')]&&_0x53408c[_0xb39c('0x40')]['id']){if(_0x5e4caf[_0xb39c('0x41')][_0x53408c[_0xb39c('0x40')]['id']]){_0x5e4caf[_0xb39c('0x41')][_0x53408c[_0xb39c('0x40')]['id']][_0xb39c('0x42')]=![];_0x5e4caf[_0xb39c('0x41')][_0x53408c['agent']['id']][_0xb39c('0x43')]=undefined;}}if(_0x53408c[_0xb39c('0x14')]&&_0x53408c[_0xb39c('0x14')]['id']){try{var _0x2f790e=getId(_0x53408c[_0xb39c('0x13')],_0x53408c[_0xb39c('0x14')]?_0x53408c[_0xb39c('0x14')]['id']:0x0,_0x53408c[_0xb39c('0x15')]?_0x53408c[_0xb39c('0x15')]['id']:0x0);if(_0x5e4caf[_0xb39c('0x12')][_0x2f790e]){_0x5e4caf[_0xb39c('0x12')][_0x2f790e][_0xb39c('0x3d')](_0xb39c('0x44'));if(rpc[_0x53408c[_0xb39c('0x13')]+_0xb39c('0x45')]){rpc[_0x53408c[_0xb39c('0x13')]+'QueueReport'][_0xb39c('0x46')](_0x2f790e,{'UserId':_0x53408c[_0xb39c('0x14')][_0xb39c('0x47')]})[_0xb39c('0x48')](function(){logger[_0xb39c('0x39')](_0xb39c('0x49'));});}}return _0x20a5c4({'code':0xc8,'message':_0x53408c});}catch(_0xd4f368){logger[_0xb39c('0x39')](_0xd4f368['stack']);return _0x2ff5ac(_0x5470f1['error'](0x1f4,_0xd4f368));}}logger[_0xb39c('0x39')](_0xb39c('0x4a'));return _0x2ff5ac(_0x5470f1['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x226f60){var _0x1d1abf=this;return new Promise(function(_0x538258,_0x2a55db){if(_0x226f60['agent']&&_0x226f60['agent']['id']){try{if(_0x5e4caf[_0xb39c('0x41')][_0x226f60['agent']['id']]){_0x5e4caf[_0xb39c('0x41')][_0x226f60[_0xb39c('0x40')]['id']][_0xb39c('0x42')]=![];_0x5e4caf[_0xb39c('0x41')][_0x226f60[_0xb39c('0x40')]['id']][_0xb39c('0x43')]=undefined;}return _0x538258({'code':0xc8,'message':_0x226f60});}catch(_0x53fce6){logger[_0xb39c('0x39')](_0x53fce6[_0xb39c('0x4b')]);return _0x2a55db(_0x1d1abf[_0xb39c('0x39')](0x1f4,_0x53fce6));}}logger[_0xb39c('0x39')](_0xb39c('0x4a'));return _0x2a55db(_0x1d1abf['error'](0x1f4,_0xb39c('0x4a')));});},'AbandonInteraction':function(_0x4ab58e){var _0x1caea1=this;return new Promise(function(_0x2f537f,_0x131cb2){if(_0x4ab58e[_0xb39c('0x13')]&&_0x4ab58e[_0xb39c('0x15')]&&_0x4ab58e[_0xb39c('0x15')]['id']){try{var _0x3fd1ec=getId(_0x4ab58e[_0xb39c('0x13')],_0x4ab58e[_0xb39c('0x14')]?_0x4ab58e[_0xb39c('0x14')]['id']:0x0,_0x4ab58e[_0xb39c('0x15')]?_0x4ab58e[_0xb39c('0x15')]['id']:0x0);if(_0x5e4caf[_0xb39c('0x12')][_0x3fd1ec]){_0x5e4caf[_0xb39c('0x12')][_0x3fd1ec][_0xb39c('0x3d')](_0xb39c('0x44'));}return _0x2f537f({'code':0xc8,'message':_0x4ab58e});}catch(_0xc7238e){logger[_0xb39c('0x39')](_0xc7238e[_0xb39c('0x4b')]);return _0x131cb2(_0x1caea1['error'](0x1f4,_0xc7238e));}}logger['error'](_0xb39c('0x4a'));return _0x131cb2(_0x1caea1[_0xb39c('0x39')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x27e91a){var _0x246aa0=this;return new Promise(function(_0x4946b5,_0x220d16){if(_0x5e4caf[_0xb39c('0x41')][_0xb39c('0x4c')](_0x27e91a['id'])){for(var _0x19647a in _0x27e91a[_0xb39c('0x4d')]){if(_0x27e91a[_0xb39c('0x4d')]['hasOwnProperty'](_0x19647a)){if(_0x5e4caf[_0xb39c('0x41')][_0x27e91a['id']][_0xb39c('0x4c')](_0x19647a+_0xb39c('0x4e'))){_0x5e4caf[_0xb39c('0x41')][_0x27e91a['id']][_0x19647a+_0xb39c('0x4e')]=parseInt(_0x27e91a[_0xb39c('0x4d')][_0x19647a],0xa);}}}_0x5e4caf[_0xb39c('0x41')][_0x27e91a['id']]['updateRealtime']();return _0x4946b5({'code':0xc8,'message':_0x5e4caf[_0xb39c('0x41')][_0x27e91a['id']]});}else{return _0x220d16(_0x246aa0[_0xb39c('0x39')](0x1f4,_0xb39c('0x4f')));}});},'Agents':function(_0x17b0c4){return new Promise(function(_0xb0b0b6){var _0x4d6968=_['values'](_0x5e4caf[_0xb39c('0x41')]);if(_0x17b0c4&&_0x17b0c4['id']){var _0x274707=_[_0xb39c('0x50')](_0x4d6968,function(_0x4e13ca){return _0x4e13ca['id']===_0x17b0c4['id'];});_0xb0b0b6(_0x274707);}else{_0xb0b0b6({'count':_0x4d6968[_0xb39c('0x18')],'rows':_0x4d6968});}});},'ChatQueues':function(){return new Promise(function(_0x4836f7){var _0x2f3c24=[];for(var _0x5ce5fb in _0x5e4caf[_0xb39c('0x51')]){if(_0x5e4caf[_0xb39c('0x51')][_0xb39c('0x4c')](_0x5ce5fb)){var _0x4c40a4=_0x5e4caf[_0xb39c('0x51')][_0x5ce5fb];var _0x281e2e={'id':_0x4c40a4['id'],'available':_0x4c40a4[_0xb39c('0x52')],'loggedIn':_0x4c40a4[_0xb39c('0x53')],'name':_0x4c40a4[_0xb39c('0x54')],'paused':_0x4c40a4[_0xb39c('0x55')],'waiting':_0x4c40a4[_0xb39c('0x56')]};_0x2f3c24[_0xb39c('0x20')](_0x281e2e);}}_0x4836f7({'count':_0x2f3c24[_0xb39c('0x18')],'rows':_0x2f3c24});});},'MailQueues':function(){return new Promise(function(_0x158ac5){var _0x34127d=[];for(var _0x227152 in _0x5e4caf[_0xb39c('0x57')]){if(_0x5e4caf[_0xb39c('0x57')][_0xb39c('0x4c')](_0x227152)){var _0x31b9c1=_0x5e4caf[_0xb39c('0x57')][_0x227152];var _0x58fbe0={'id':_0x31b9c1['id'],'available':_0x31b9c1[_0xb39c('0x52')],'loggedIn':_0x31b9c1[_0xb39c('0x53')],'name':_0x31b9c1[_0xb39c('0x54')],'paused':_0x31b9c1['paused'],'waiting':_0x31b9c1[_0xb39c('0x56')]};_0x34127d['push'](_0x58fbe0);}}_0x158ac5({'count':_0x34127d['length'],'rows':_0x34127d});});},'OpenchannelQueues':function(){return new Promise(function(_0x8d8f59){var _0x765913=[];for(var _0x2d9edf in _0x5e4caf[_0xb39c('0x58')]){if(_0x5e4caf[_0xb39c('0x58')]['hasOwnProperty'](_0x2d9edf)){var _0x5de073=_0x5e4caf[_0xb39c('0x58')][_0x2d9edf];var _0x27723c={'id':_0x5de073['id'],'available':_0x5de073['available'],'loggedIn':_0x5de073[_0xb39c('0x53')],'name':_0x5de073[_0xb39c('0x54')],'paused':_0x5de073[_0xb39c('0x55')],'waiting':_0x5de073[_0xb39c('0x56')]};_0x765913[_0xb39c('0x20')](_0x27723c);}}_0x8d8f59({'count':_0x765913[_0xb39c('0x18')],'rows':_0x765913});});},'SmsQueues':function(){return new Promise(function(_0x2ed9c6){var _0xfe586=[];for(var _0x5f69ef in _0x5e4caf[_0xb39c('0x59')]){if(_0x5e4caf[_0xb39c('0x59')][_0xb39c('0x4c')](_0x5f69ef)){var _0x29b793=_0x5e4caf[_0xb39c('0x59')][_0x5f69ef];var _0x1ffa28={'id':_0x29b793['id'],'available':_0x29b793['available'],'loggedIn':_0x29b793[_0xb39c('0x53')],'name':_0x29b793['name'],'paused':_0x29b793[_0xb39c('0x55')],'waiting':_0x29b793[_0xb39c('0x56')]};_0xfe586['push'](_0x1ffa28);}}_0x2ed9c6({'count':_0xfe586[_0xb39c('0x18')],'rows':_0xfe586});});},'FaxQueues':function(){return new Promise(function(_0x391361){var _0x2fe97a=[];for(var _0x4290d5 in _0x5e4caf[_0xb39c('0x5a')]){if(_0x5e4caf[_0xb39c('0x5a')]['hasOwnProperty'](_0x4290d5)){var _0x404356=_0x5e4caf[_0xb39c('0x5a')][_0x4290d5];var _0xe3e56b={'id':_0x404356['id'],'available':_0x404356[_0xb39c('0x52')],'loggedIn':_0x404356[_0xb39c('0x53')],'name':_0x404356[_0xb39c('0x54')],'paused':_0x404356[_0xb39c('0x55')],'waiting':_0x404356[_0xb39c('0x56')]};_0x2fe97a[_0xb39c('0x20')](_0xe3e56b);}}_0x391361({'count':_0x2fe97a['length'],'rows':_0x2fe97a});});},'WhatsappQueues':function(){return new Promise(function(_0x42c8c1){var _0x20610f=[];for(var _0x2a7b45 in _0x5e4caf[_0xb39c('0x5b')]){if(_0x5e4caf[_0xb39c('0x5b')][_0xb39c('0x4c')](_0x2a7b45)){var _0x43af44=_0x5e4caf['whatsappQueues'][_0x2a7b45];var _0x29b32c={'id':_0x43af44['id'],'available':_0x43af44[_0xb39c('0x52')],'loggedIn':_0x43af44[_0xb39c('0x53')],'name':_0x43af44[_0xb39c('0x54')],'paused':_0x43af44[_0xb39c('0x55')],'waiting':_0x43af44[_0xb39c('0x56')]};_0x20610f[_0xb39c('0x20')](_0x29b32c);}}_0x42c8c1({'count':_0x20610f[_0xb39c('0x18')],'rows':_0x20610f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x483be1){var _0x3dc3d8=_['values'](_0x5e4caf[_0xb39c('0x5c')]);_0x483be1({'count':_0x3dc3d8[_0xb39c('0x18')],'rows':_0x3dc3d8});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4123c6){var _0xeab93a=_[_0xb39c('0x5d')](_0x5e4caf[_0xb39c('0x5e')]);_0x4123c6({'count':_0xeab93a[_0xb39c('0x18')],'rows':_0xeab93a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3784fe){var _0x50f596=_[_0xb39c('0x5d')](_0x5e4caf[_0xb39c('0x5f')]);_0x3784fe({'count':_0x50f596[_0xb39c('0x18')],'rows':_0x50f596});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1254d7){var _0x2955bf=_[_0xb39c('0x5d')](_0x5e4caf[_0xb39c('0x60')]);_0x1254d7({'count':_0x2955bf[_0xb39c('0x18')],'rows':_0x2955bf});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x33d6f5){var _0x7d5e=_[_0xb39c('0x5d')](_0x5e4caf[_0xb39c('0x61')]);_0x33d6f5({'count':_0x7d5e[_0xb39c('0x18')],'rows':_0x7d5e});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x45a273){var _0x1c29d4=_[_0xb39c('0x5d')](_0x5e4caf['whatsappQueuesWaitingInteractions']);_0x45a273({'count':_0x1c29d4['length'],'rows':_0x1c29d4});});}};var _0x4519a8=jayson[_0xb39c('0x62')](_0x386c80)[_0xb39c('0x63')]();_0x4519a8['on']('error',function(_0x62a6cb){logger[_0xb39c('0x39')](JSON[_0xb39c('0x3c')](_0x62a6cb));return _0x42a203(_0x62a6cb);});_0x4519a8[_0xb39c('0x11')](0x232c,_0xb39c('0x64'),function(){console[_0xb39c('0x65')](_0xb39c('0x66'),0x232c);return _0x40a6d3('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xbe02=['busyQueue','end','QueueReport','update','catch','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','IntervalId','Intervals','interval','isNil','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','toLowerCase','autoreply','appdata','split','mail','push','join','slice','dialogflowv2','amazonlex','TagId','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy'];(function(_0x98f20f,_0x697844){var _0xa102e=function(_0x155e8d){while(--_0x155e8d){_0x98f20f['push'](_0x98f20f['shift']());}};_0xa102e(++_0x697844);}(_0xbe02,0x146));var _0x2be0=function(_0x22949e,_0x25d588){_0x22949e=_0x22949e-0x0;var _0x50cffe=_0xbe02[_0x22949e];return _0x50cffe;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var path=require(_0x2be0('0x2'));var fs=require('fs');var jayson=require(_0x2be0('0x3'));var BPromise=require('bluebird');var utils=require(_0x2be0('0x4'));var logger=require(_0x2be0('0x5'))(_0x2be0('0x6'));var rpc={'openchannelQueueReport':require(_0x2be0('0x7')),'mailQueueReport':require(_0x2be0('0x8')),'chatQueueReport':require(_0x2be0('0x9')),'smsQueueReport':require(_0x2be0('0xa')),'faxQueueReport':require(_0x2be0('0xb')),'whatsappQueueReport':require(_0x2be0('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4ca22f,_0x176f12,_0xdfef68){return util[_0x2be0('0xd')](_0x2be0('0xe'),_0x4ca22f,_0x176f12||0x0,_0xdfef68||0x0);}function getIntervals(_0x4322de,_0x45d9f5){var _0x5f54ac=[];if(!_['isNil'](_0x45d9f5['IntervalId'])&&!_['isNil'](_0x4322de[_0x45d9f5['IntervalId']])&&!_['isNil'](_0x4322de[_0x45d9f5[_0x2be0('0xf')]][_0x2be0('0x10')])){_0x5f54ac=_['map'](_0x4322de[_0x45d9f5[_0x2be0('0xf')]][_0x2be0('0x10')],_0x2be0('0x11'));}else if(!_[_0x2be0('0x12')](_0x45d9f5[_0x2be0('0x11')])){_0x5f54ac=[_0x45d9f5[_0x2be0('0x11')]];}return _0x5f54ac;}exports[_0x2be0('0x13')]=function(_0x3b47ab){_0x3b47ab[_0x2be0('0x14')]={};return new BPromise(function(_0x271f25,_0x54e9f2){var _0x2d14d6={'Start':function(_0x422a66){var _0x5cda7b=this;return new Promise(function(_0x8bdce0,_0x1e0c27){if(_0x422a66){try{var _0x5bcbc5=[];var _0x334070=getId(_0x422a66[_0x2be0('0x15')],_0x422a66[_0x2be0('0x16')]?_0x422a66[_0x2be0('0x16')]['id']:0x0,_0x422a66[_0x2be0('0x17')]?_0x422a66[_0x2be0('0x17')]['id']:0x0);if(_0x422a66[_0x2be0('0x18')]&&_[_0x2be0('0x19')](_0x422a66[_0x2be0('0x18')])&&_0x422a66[_0x2be0('0x18')][_0x2be0('0x1a')]){for(var _0x1d4b00=0x0;_0x1d4b00<_0x422a66[_0x2be0('0x18')][_0x2be0('0x1a')];_0x1d4b00+=0x1){var _0xfbd5fd=_0x422a66[_0x2be0('0x18')][_0x1d4b00];if(fs[_0x2be0('0x1b')](path['join'](__dirname,'applications',_0xfbd5fd[_0x2be0('0x1c')]+'.js'))){var _0x5d1a32=[];switch(_0xfbd5fd[_0x2be0('0x1c')][_0x2be0('0x1d')]()){case _0x2be0('0x1e'):var _0x2b3f88=_0xfbd5fd[_0x2be0('0x1f')][_0x2be0('0x20')](',');if(_0x422a66[_0x2be0('0x15')]===_0x2be0('0x21')){_0x5d1a32['push'](_0x2b3f88[0x0]);_0x5d1a32[_0x2be0('0x22')](_0x2b3f88[0x1]);_0x5d1a32['push'](_0x2b3f88['slice'](0x2,_0x2b3f88[_0x2be0('0x1a')])[_0x2be0('0x23')](','));}else{_0x5d1a32[_0x2be0('0x22')](_0x2b3f88[0x0]);_0x5d1a32[_0x2be0('0x22')](_0x2b3f88[_0x2be0('0x24')](0x1,_0x2b3f88[_0x2be0('0x1a')])[_0x2be0('0x23')](','));}break;case'dialogflow':var _0x1c24be=_0xfbd5fd[_0x2be0('0x1f')]['split'](',');_0x5d1a32['push'](_0x1c24be[0x0]);_0x5d1a32[_0x2be0('0x22')](_0x1c24be[0x1]);_0x5d1a32[_0x2be0('0x22')](_0x1c24be['slice'](0x2,_0x1c24be[_0x2be0('0x1a')])[_0x2be0('0x23')](','));break;case _0x2be0('0x25'):var _0x439888=_0xfbd5fd[_0x2be0('0x1f')][_0x2be0('0x20')](',');_0x5d1a32[_0x2be0('0x22')](_0x439888[0x0]);_0x5d1a32['push'](_0x439888[0x1]);_0x5d1a32[_0x2be0('0x22')](_0x439888[0x2]);_0x5d1a32['push'](_0x439888[0x3]);_0x5d1a32[_0x2be0('0x22')](_0x439888[_0x2be0('0x24')](0x4,_0x439888[_0x2be0('0x1a')])[_0x2be0('0x23')](','));break;case _0x2be0('0x26'):var _0x3d73d5=_0xfbd5fd[_0x2be0('0x1f')]['split'](',');_0x5d1a32[_0x2be0('0x22')](_0x3d73d5[0x0]);_0x5d1a32[_0x2be0('0x22')](_0x3d73d5[0x1]);_0x5d1a32[_0x2be0('0x22')](_0x3d73d5[0x2]);_0x5d1a32[_0x2be0('0x22')](_0x3d73d5[0x3]);_0x5d1a32[_0x2be0('0x22')](_0x3d73d5['slice'](0x4,_0x3d73d5[_0x2be0('0x1a')])[_0x2be0('0x23')](','));break;case _0x2be0('0x16'):_0x5d1a32[_0x2be0('0x22')](_0xfbd5fd[_0x2be0('0x1f')]);break;case'tag':_0x5d1a32['push'](_0xfbd5fd[_0x2be0('0x27')]);_0x5d1a32[_0x2be0('0x22')](_0xfbd5fd[_0x2be0('0x1f')]);break;case'tvox':var _0x48b4cd=utils['getMustacheRender'](_0x422a66[_0x2be0('0x28')][_0x2be0('0x29')],_0x422a66);var _0x11f12b=_0xfbd5fd[_0x2be0('0x1f')][_0x2be0('0x20')](',');_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x0]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x1]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x2]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x3]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x4]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x5]);_0x5d1a32['push'](_0x11f12b[0x6]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x7]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x8]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0x9]);_0x5d1a32[_0x2be0('0x22')](_0x11f12b[0xa]);_0x5d1a32[_0x2be0('0x22')](_0x422a66['interaction']['id']);_0x5d1a32[_0x2be0('0x22')](_0x422a66[_0x2be0('0x16')]['id']);_0x5d1a32[_0x2be0('0x22')](_0xfbd5fd['ChatWebsiteId']);_0x5d1a32[_0x2be0('0x22')](_0x422a66['interaction'][_0x2be0('0x2a')]);_0x5d1a32['push'](_0x422a66['body'][_0x2be0('0x2b')]);_0x5d1a32['push'](_0x48b4cd);break;default:_0x5d1a32=_[_0x2be0('0x12')](_0xfbd5fd['appdata'])?[]:_0xfbd5fd[_0x2be0('0x1f')]['split'](',');}var _0x25c858={'id':util[_0x2be0('0xd')](_0x2be0('0x2c'),_0x334070,_0xfbd5fd['id'],_0xfbd5fd['app']),'condition':require(_0x2be0('0x2d'))['condition'](_0x334070,getIntervals(_0x3b47ab[_0x2be0('0x2e')],_0xfbd5fd),_0x3b47ab),'consequence':require(_0x2be0('0x2f')+_0xfbd5fd[_0x2be0('0x1c')])[_0x2be0('0x30')](_0x334070,_0x5d1a32,_0x3b47ab,_0x422a66),'p':_0xfbd5fd[_0x2be0('0x31')]||0x0};logger[_0x2be0('0x32')](_0x2be0('0x33'),_0x25c858['id'],_0x2be0('0x34'),getIntervals(_0x3b47ab[_0x2be0('0x2e')],_0xfbd5fd)[_0x2be0('0x23')](_0x2be0('0x35')));_0x5bcbc5[_0x2be0('0x22')](_0x25c858);}else{logger[_0x2be0('0x36')](_0x2be0('0x37'),path[_0x2be0('0x23')](__dirname,'applications',_0xfbd5fd[_0x2be0('0x1c')]+'.js'));}}_0x3b47ab[_0x2be0('0x14')][_0x334070]=new RuleEngine(_0x5bcbc5);_0x3b47ab[_0x2be0('0x14')][_0x334070][_0x2be0('0x38')](_0x422a66,function(_0x394c65){logger[_0x2be0('0x32')](_0x2be0('0x39'),JSON[_0x2be0('0x3a')](_0x394c65['matchPath']));if(_0x3b47ab[_0x2be0('0x14')][_0x334070]){_0x3b47ab[_0x2be0('0x14')][_0x334070][_0x2be0('0x3b')](_0x2be0('0x3c'));}});return _0x8bdce0({'code':0xc8,'message':_0x422a66});}else{logger[_0x2be0('0x32')]('No\x20applications\x20to\x20execute');return _0x8bdce0({'code':0xc8,'message':_0x422a66});}}catch(_0x281178){logger['error'](_0x281178[_0x2be0('0x3d')]);return _0x1e0c27(_0x5cda7b[_0x2be0('0x36')](0x1f4,_0x281178));}}return _0x1e0c27(_0x2be0('0x3e'));});},'AcceptMessage':function(_0x76038e){var _0x2ce72b=this;return new Promise(function(_0x120ba1,_0x5ed58e){if(_0x76038e[_0x2be0('0x3f')]&&_0x76038e['agent']['id']){if(_0x3b47ab[_0x2be0('0x40')][_0x76038e[_0x2be0('0x3f')]['id']]){_0x3b47ab['agents'][_0x76038e[_0x2be0('0x3f')]['id']][_0x2be0('0x41')]=![];_0x3b47ab[_0x2be0('0x40')][_0x76038e[_0x2be0('0x3f')]['id']][_0x2be0('0x42')]=undefined;}}if(_0x76038e['message']&&_0x76038e['message']['id']){try{var _0x1b70af=getId(_0x76038e[_0x2be0('0x15')],_0x76038e['message']?_0x76038e['message']['id']:0x0,_0x76038e[_0x2be0('0x17')]?_0x76038e[_0x2be0('0x17')]['id']:0x0);if(_0x3b47ab[_0x2be0('0x14')][_0x1b70af]){_0x3b47ab[_0x2be0('0x14')][_0x1b70af]['emit'](_0x2be0('0x43'));if(rpc[_0x76038e[_0x2be0('0x15')]+_0x2be0('0x44')]){rpc[_0x76038e[_0x2be0('0x15')]+_0x2be0('0x44')][_0x2be0('0x45')](_0x1b70af,{'UserId':_0x76038e[_0x2be0('0x16')]['UserId']})[_0x2be0('0x46')](function(){logger[_0x2be0('0x36')]('error\x20update\x20queue\x20report');});}}return _0x120ba1({'code':0xc8,'message':_0x76038e});}catch(_0x24a2aa){logger[_0x2be0('0x36')](_0x24a2aa[_0x2be0('0x3d')]);return _0x5ed58e(_0x2ce72b['error'](0x1f4,_0x24a2aa));}}logger[_0x2be0('0x36')](_0x2be0('0x47'));return _0x5ed58e(_0x2ce72b[_0x2be0('0x36')](0x1f4,_0x2be0('0x47')));});},'RejectMessage':function(_0x10685c){var _0x1b7c41=this;return new Promise(function(_0x352a64,_0x227bd2){if(_0x10685c[_0x2be0('0x3f')]&&_0x10685c['agent']['id']){try{if(_0x3b47ab[_0x2be0('0x40')][_0x10685c[_0x2be0('0x3f')]['id']]){_0x3b47ab[_0x2be0('0x40')][_0x10685c[_0x2be0('0x3f')]['id']]['busy']=![];_0x3b47ab[_0x2be0('0x40')][_0x10685c['agent']['id']][_0x2be0('0x42')]=undefined;}return _0x352a64({'code':0xc8,'message':_0x10685c});}catch(_0x1a3a64){logger['error'](_0x1a3a64[_0x2be0('0x3d')]);return _0x227bd2(_0x1b7c41['error'](0x1f4,_0x1a3a64));}}logger[_0x2be0('0x36')](_0x2be0('0x47'));return _0x227bd2(_0x1b7c41['error'](0x1f4,_0x2be0('0x47')));});},'AbandonInteraction':function(_0x24a64a){var _0xa8a0c7=this;return new Promise(function(_0x3ff266,_0x18258c){if(_0x24a64a[_0x2be0('0x15')]&&_0x24a64a[_0x2be0('0x17')]&&_0x24a64a[_0x2be0('0x17')]['id']){try{var _0x2b074d=getId(_0x24a64a['channel'],_0x24a64a[_0x2be0('0x16')]?_0x24a64a[_0x2be0('0x16')]['id']:0x0,_0x24a64a[_0x2be0('0x17')]?_0x24a64a['interaction']['id']:0x0);if(_0x3b47ab[_0x2be0('0x14')][_0x2b074d]){_0x3b47ab[_0x2be0('0x14')][_0x2b074d][_0x2be0('0x3b')](_0x2be0('0x43'));}return _0x3ff266({'code':0xc8,'message':_0x24a64a});}catch(_0x337cdd){logger[_0x2be0('0x36')](_0x337cdd[_0x2be0('0x3d')]);return _0x18258c(_0xa8a0c7['error'](0x1f4,_0x337cdd));}}logger[_0x2be0('0x36')](_0x2be0('0x47'));return _0x18258c(_0xa8a0c7[_0x2be0('0x36')](0x1f4,_0x2be0('0x47')));});},'AgentCapacity':function(_0x363c18){var _0x2094b0=this;return new Promise(function(_0x4eccce,_0xc60d86){if(_0x3b47ab['agents']['hasOwnProperty'](_0x363c18['id'])){for(var _0x2d2e79 in _0x363c18[_0x2be0('0x48')]){if(_0x363c18[_0x2be0('0x48')]['hasOwnProperty'](_0x2d2e79)){if(_0x3b47ab[_0x2be0('0x40')][_0x363c18['id']][_0x2be0('0x49')](_0x2d2e79+_0x2be0('0x4a'))){_0x3b47ab[_0x2be0('0x40')][_0x363c18['id']][_0x2d2e79+_0x2be0('0x4a')]=parseInt(_0x363c18['capacity'][_0x2d2e79],0xa);}}}_0x3b47ab[_0x2be0('0x40')][_0x363c18['id']][_0x2be0('0x4b')]();return _0x4eccce({'code':0xc8,'message':_0x3b47ab[_0x2be0('0x40')][_0x363c18['id']]});}else{return _0xc60d86(_0x2094b0[_0x2be0('0x36')](0x1f4,_0x2be0('0x4c')));}});},'Agents':function(_0x27b8e6){return new Promise(function(_0x3266a6){var _0x3137ce=_[_0x2be0('0x4d')](_0x3b47ab[_0x2be0('0x40')]);if(_0x27b8e6&&_0x27b8e6['id']){var _0x2f62ba=_['find'](_0x3137ce,function(_0x2345ad){return _0x2345ad['id']===_0x27b8e6['id'];});_0x3266a6(_0x2f62ba);}else{_0x3266a6({'count':_0x3137ce[_0x2be0('0x1a')],'rows':_0x3137ce});}});},'ChatQueues':function(){return new Promise(function(_0x5e01d8){var _0x104dbe=[];for(var _0x2b2f34 in _0x3b47ab[_0x2be0('0x4e')]){if(_0x3b47ab[_0x2be0('0x4e')][_0x2be0('0x49')](_0x2b2f34)){var _0x55b89f=_0x3b47ab['chatQueues'][_0x2b2f34];var _0x2e69aa={'id':_0x55b89f['id'],'available':_0x55b89f[_0x2be0('0x4f')],'loggedIn':_0x55b89f[_0x2be0('0x50')],'name':_0x55b89f['name'],'paused':_0x55b89f[_0x2be0('0x51')],'waiting':_0x55b89f[_0x2be0('0x52')]};_0x104dbe[_0x2be0('0x22')](_0x2e69aa);}}_0x5e01d8({'count':_0x104dbe[_0x2be0('0x1a')],'rows':_0x104dbe});});},'MailQueues':function(){return new Promise(function(_0x2b7a46){var _0xaf914d=[];for(var _0xc10295 in _0x3b47ab[_0x2be0('0x53')]){if(_0x3b47ab[_0x2be0('0x53')][_0x2be0('0x49')](_0xc10295)){var _0x1d6e09=_0x3b47ab[_0x2be0('0x53')][_0xc10295];var _0x320266={'id':_0x1d6e09['id'],'available':_0x1d6e09[_0x2be0('0x4f')],'loggedIn':_0x1d6e09['loggedIn'],'name':_0x1d6e09[_0x2be0('0x54')],'paused':_0x1d6e09[_0x2be0('0x51')],'waiting':_0x1d6e09[_0x2be0('0x52')]};_0xaf914d[_0x2be0('0x22')](_0x320266);}}_0x2b7a46({'count':_0xaf914d['length'],'rows':_0xaf914d});});},'OpenchannelQueues':function(){return new Promise(function(_0x502f05){var _0x30f136=[];for(var _0x15702c in _0x3b47ab[_0x2be0('0x55')]){if(_0x3b47ab[_0x2be0('0x55')]['hasOwnProperty'](_0x15702c)){var _0x18de74=_0x3b47ab[_0x2be0('0x55')][_0x15702c];var _0x4ad958={'id':_0x18de74['id'],'available':_0x18de74[_0x2be0('0x4f')],'loggedIn':_0x18de74[_0x2be0('0x50')],'name':_0x18de74[_0x2be0('0x54')],'paused':_0x18de74[_0x2be0('0x51')],'waiting':_0x18de74[_0x2be0('0x52')]};_0x30f136[_0x2be0('0x22')](_0x4ad958);}}_0x502f05({'count':_0x30f136[_0x2be0('0x1a')],'rows':_0x30f136});});},'SmsQueues':function(){return new Promise(function(_0x5d6659){var _0x46e91e=[];for(var _0x13c984 in _0x3b47ab[_0x2be0('0x56')]){if(_0x3b47ab[_0x2be0('0x56')][_0x2be0('0x49')](_0x13c984)){var _0x3ba859=_0x3b47ab['smsQueues'][_0x13c984];var _0x5b8156={'id':_0x3ba859['id'],'available':_0x3ba859['available'],'loggedIn':_0x3ba859[_0x2be0('0x50')],'name':_0x3ba859['name'],'paused':_0x3ba859[_0x2be0('0x51')],'waiting':_0x3ba859[_0x2be0('0x52')]};_0x46e91e['push'](_0x5b8156);}}_0x5d6659({'count':_0x46e91e[_0x2be0('0x1a')],'rows':_0x46e91e});});},'FaxQueues':function(){return new Promise(function(_0x47064f){var _0x47c3c1=[];for(var _0x246551 in _0x3b47ab[_0x2be0('0x57')]){if(_0x3b47ab[_0x2be0('0x57')][_0x2be0('0x49')](_0x246551)){var _0xb18d09=_0x3b47ab[_0x2be0('0x57')][_0x246551];var _0x565411={'id':_0xb18d09['id'],'available':_0xb18d09[_0x2be0('0x4f')],'loggedIn':_0xb18d09[_0x2be0('0x50')],'name':_0xb18d09[_0x2be0('0x54')],'paused':_0xb18d09[_0x2be0('0x51')],'waiting':_0xb18d09[_0x2be0('0x52')]};_0x47c3c1[_0x2be0('0x22')](_0x565411);}}_0x47064f({'count':_0x47c3c1[_0x2be0('0x1a')],'rows':_0x47c3c1});});},'WhatsappQueues':function(){return new Promise(function(_0x995917){var _0x20a6b8=[];for(var _0x18b238 in _0x3b47ab['whatsappQueues']){if(_0x3b47ab[_0x2be0('0x58')][_0x2be0('0x49')](_0x18b238)){var _0x5d9c80=_0x3b47ab[_0x2be0('0x58')][_0x18b238];var _0x5e50b9={'id':_0x5d9c80['id'],'available':_0x5d9c80[_0x2be0('0x4f')],'loggedIn':_0x5d9c80[_0x2be0('0x50')],'name':_0x5d9c80[_0x2be0('0x54')],'paused':_0x5d9c80[_0x2be0('0x51')],'waiting':_0x5d9c80[_0x2be0('0x52')]};_0x20a6b8[_0x2be0('0x22')](_0x5e50b9);}}_0x995917({'count':_0x20a6b8[_0x2be0('0x1a')],'rows':_0x20a6b8});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5ebbbc){var _0x5299b8=_[_0x2be0('0x4d')](_0x3b47ab['chatQueuesWaitingInteractions']);_0x5ebbbc({'count':_0x5299b8[_0x2be0('0x1a')],'rows':_0x5299b8});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3ab16e){var _0xbc4308=_[_0x2be0('0x4d')](_0x3b47ab[_0x2be0('0x59')]);_0x3ab16e({'count':_0xbc4308[_0x2be0('0x1a')],'rows':_0xbc4308});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x50880e){var _0x580968=_['values'](_0x3b47ab[_0x2be0('0x5a')]);_0x50880e({'count':_0x580968[_0x2be0('0x1a')],'rows':_0x580968});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x40e3f6){var _0x2e2563=_[_0x2be0('0x4d')](_0x3b47ab[_0x2be0('0x5b')]);_0x40e3f6({'count':_0x2e2563['length'],'rows':_0x2e2563});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xdb3e27){var _0x4c50c7=_[_0x2be0('0x4d')](_0x3b47ab[_0x2be0('0x5c')]);_0xdb3e27({'count':_0x4c50c7[_0x2be0('0x1a')],'rows':_0x4c50c7});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x558f70){var _0x29d0bd=_['values'](_0x3b47ab[_0x2be0('0x5d')]);_0x558f70({'count':_0x29d0bd[_0x2be0('0x1a')],'rows':_0x29d0bd});});}};var _0x216394=jayson[_0x2be0('0x5e')](_0x2d14d6)[_0x2be0('0x5f')]();_0x216394['on'](_0x2be0('0x36'),function(_0x56db7a){logger[_0x2be0('0x36')](JSON[_0x2be0('0x3a')](_0x56db7a));return _0x54e9f2(_0x56db7a);});_0x216394[_0x2be0('0x13')](0x232c,'127.0.0.1',function(){console[_0x2be0('0x60')](_0x2be0('0x61'),0x232c);return _0x271f25('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 cdb37c5..b63425f 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 _0x4c12=['push','Command','format','iftime\x20%s','then','catch','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','error','message','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length'];(function(_0x2a4239,_0x123a53){var _0x4b20af=function(_0x24ff65){while(--_0x24ff65){_0x2a4239['push'](_0x2a4239['shift']());}};_0x4b20af(++_0x123a53);}(_0x4c12,0x109));var _0x24c1=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x4c12[_0x4d613c];return _0x301fe3;};'use strict';var util=require(_0x24c1('0x0'));var BPromise=require(_0x24c1('0x1'));var jayson=require(_0x24c1('0x2'));var _=require(_0x24c1('0x3'));var logger=require(_0x24c1('0x4'))(_0x24c1('0x5'));var client=jayson[_0x24c1('0x6')]['http']({'port':0x232a});function request(_0x4ff036,_0xf2ee08){return new BPromise(function(_0x4176bb,_0x331d24){return client[_0x24c1('0x7')](_0x4ff036,_0xf2ee08)['then'](function(_0x3cd4f2){if(_0x3cd4f2[_0x24c1('0x8')]){return _0x331d24(_0x3cd4f2[_0x24c1('0x8')][_0x24c1('0x9')]);}else{return _0x4176bb(_0x3cd4f2['result']);}})['catch'](function(_0x456802){return _0x331d24(_0x456802);});});}exports['condition']=function(_0x56efe4,_0x4780ec,_0x135240){return function(_0x1e8d9d){if(_0x135240[_0x24c1('0xa')]&&!_0x135240['rules'][_0x56efe4]){logger[_0x24c1('0xb')](_0x24c1('0xc'),_0x56efe4);return _0x1e8d9d[_0x24c1('0xd')]();}var _0x28644e=[];for(var _0xa42de9=0x0;_0xa42de9<_0x4780ec[_0x24c1('0xe')];_0xa42de9+=0x1){_0x28644e[_0x24c1('0xf')](request(_0x24c1('0x10'),{'command':util[_0x24c1('0x11')](_0x24c1('0x12'),_0x4780ec[_0xa42de9])})[_0x24c1('0x13')](function(_0x543e70){return _0x543e70&&_0x543e70[_0x24c1('0x9')]&&_0x543e70[_0x24c1('0x9')]['indexOf']('true')>=0x0?!![]:![];})[_0x24c1('0x14')](function(_0x24f9e3){logger[_0x24c1('0x8')]('[%s][INTERVAL]\x20%s',_0x56efe4,_0x4780ec[_0xa42de9]);}));}BPromise[_0x24c1('0x15')](_0x28644e)[_0x24c1('0x13')](function(_0x2dff35){var _0x46c004=_[_0x24c1('0x16')](_0x2dff35);logger[_0x24c1('0xb')](_0x24c1('0x17'),_0x56efe4,_0x4780ec[_0x24c1('0x18')](_0x24c1('0x19')),_0x46c004);_0x1e8d9d['when'](_0x46c004);})[_0x24c1('0x14')](function(_0x4e651c){console[_0x24c1('0x1a')](_0x4e651c);logger['error'](_0x24c1('0x17'),_0x56efe4,_0x4780ec[_0x24c1('0x18')](_0x24c1('0x19')),_0x4e651c[_0x24c1('0x1b')]);_0x1e8d9d[_0x24c1('0xd')]();});};}; \ No newline at end of file +var _0x6ec7=['catch','condition','rules','info','length','push','format','then','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','error','stack','stop','util','bluebird','jayson/promise','lodash','routing','client','request','result'];(function(_0x5eac32,_0x3f4bd8){var _0x15453e=function(_0x1d39b6){while(--_0x1d39b6){_0x5eac32['push'](_0x5eac32['shift']());}};_0x15453e(++_0x3f4bd8);}(_0x6ec7,0x1d8));var _0x76ec=function(_0x180483,_0x186481){_0x180483=_0x180483-0x0;var _0x390887=_0x6ec7[_0x180483];return _0x390887;};'use strict';var util=require(_0x76ec('0x0'));var BPromise=require(_0x76ec('0x1'));var jayson=require(_0x76ec('0x2'));var _=require(_0x76ec('0x3'));var logger=require('../../../config/logger')(_0x76ec('0x4'));var client=jayson[_0x76ec('0x5')]['http']({'port':0x232a});function request(_0x9e66f1,_0x16b73c){return new BPromise(function(_0x35089f,_0x21e0f3){return client[_0x76ec('0x6')](_0x9e66f1,_0x16b73c)['then'](function(_0x58ceb9){if(_0x58ceb9['error']){return _0x21e0f3(_0x58ceb9['error']['message']);}else{return _0x35089f(_0x58ceb9[_0x76ec('0x7')]);}})[_0x76ec('0x8')](function(_0xd9d00f){return _0x21e0f3(_0xd9d00f);});});}exports[_0x76ec('0x9')]=function(_0x3eb44c,_0x256865,_0x51bed1){return function(_0xebbe53){if(_0x51bed1['rules']&&!_0x51bed1[_0x76ec('0xa')][_0x3eb44c]){logger[_0x76ec('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3eb44c);return _0xebbe53['stop']();}var _0x4adbea=[];for(var _0xf8b39f=0x0;_0xf8b39f<_0x256865[_0x76ec('0xc')];_0xf8b39f+=0x1){_0x4adbea[_0x76ec('0xd')](request('Command',{'command':util[_0x76ec('0xe')]('iftime\x20%s',_0x256865[_0xf8b39f])})[_0x76ec('0xf')](function(_0x324451){return _0x324451&&_0x324451[_0x76ec('0x10')]&&_0x324451['message'][_0x76ec('0x11')](_0x76ec('0x12'))>=0x0?!![]:![];})[_0x76ec('0x8')](function(_0x1f1018){logger['error'](_0x76ec('0x13'),_0x3eb44c,_0x256865[_0xf8b39f]);}));}BPromise[_0x76ec('0x14')](_0x4adbea)[_0x76ec('0xf')](function(_0x2a7fa1){var _0x2181a=_[_0x76ec('0x15')](_0x2a7fa1);logger[_0x76ec('0xb')](_0x76ec('0x16'),_0x3eb44c,_0x256865[_0x76ec('0x17')](_0x76ec('0x18')),_0x2181a);_0xebbe53[_0x76ec('0x19')](_0x2181a);})[_0x76ec('0x8')](function(_0x2b5deb){console[_0x76ec('0x1a')](_0x2b5deb);logger[_0x76ec('0x1b')](_0x76ec('0x16'),_0x3eb44c,_0x256865[_0x76ec('0x17')](_0x76ec('0x18')),_0x2b5deb[_0x76ec('0x1c')]);_0xebbe53[_0x76ec('0x1d')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index bd5460f..fb3f9ad 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 _0x6e6c=['agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','connectedlinenum','lastevent','getVoiceQueueByName','queue','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','uniqueid','agentcalledAt','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','format','agentringnoanswer','[%s][agents][agentringnoanswer]','info','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','timeout','holdtime','ringtime','talktime','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime'];(function(_0x44d21e,_0xb7ea7e){var _0x21209f=function(_0x22f700){while(--_0x22f700){_0x44d21e['push'](_0x44d21e['shift']());}};_0x21209f(++_0xb7ea7e);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x370b21,_0x1b63fe){utils['info'](util['format'](_0xc6e6('0x2'),_0x370b21['uniqueid'],_0x370b21[_0xc6e6('0x3')],_0x370b21['queue'],_0x370b21[_0xc6e6('0x4')],_0x370b21[_0xc6e6('0x5')],_0x370b21['calleridnum'],_0x370b21[_0xc6e6('0x6')],_0x370b21[_0xc6e6('0x7')]));if(_0x370b21['queue']){utils[_0xc6e6('0x8')](_0x370b21[_0xc6e6('0x9')])['then'](function(_0x324f05){if(_0x324f05){_0x370b21['type']=_0x324f05[_0xc6e6('0xa')];_0x370b21[_0xc6e6('0xb')]=_0x370b21[_0xc6e6('0xc')]?_0x324f05[_0xc6e6('0xd')]:![];_0x370b21[_0xc6e6('0xe')]=_0x370b21[_0xc6e6('0xb')]?_0x324f05[_0xc6e6('0xf')]:0x0;}utils[_0xc6e6('0x10')](_0xc6e6('0x11'),_0x370b21);});}else{utils['request'](_0xc6e6('0x11'),_0x370b21);}if(_0x1b63fe){delete transfers[_0x370b21['uniqueid']];}else{delete agents[_0x370b21[_0xc6e6('0x12')]];}}exports[_0xc6e6('0x13')]=function(_0x33aea0){try{utils[_0xc6e6('0x14')](util['format'](_0xc6e6('0x15'),_0x33aea0[_0xc6e6('0x16')]),_0x33aea0);agents[_0x33aea0[_0xc6e6('0x12')]]=_0x33aea0;agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x17')]=utils['now']();agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x7')]='called';agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x6')]=null;agents[_0x33aea0[_0xc6e6('0x12')]]['connectedlinename']=null;utils['info'](util['format'](_0xc6e6('0x18'),_0x33aea0['uniqueid'],agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0x33aea0[_0xc6e6('0x12')]));}catch(_0x41afe6){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x15'),_0x33aea0[_0xc6e6('0x16')]),_0x41afe6);}};exports[_0xc6e6('0x1b')]=function(_0x3d734d){try{if(!_['isNil'](agents[_0x3d734d[_0xc6e6('0x12')]])){utils['debug'](util[_0xc6e6('0x1a')](_0xc6e6('0x1c'),_0x3d734d[_0xc6e6('0x16')]),_0x3d734d);utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x1e'),_0x3d734d[_0xc6e6('0x16')],agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0x3d734d[_0xc6e6('0x12')]));agents[_0x3d734d['destuniqueid']][_0xc6e6('0x1b')]=!![];agents[_0x3d734d['destuniqueid']][_0xc6e6('0x1f')]=utils[_0xc6e6('0x20')]();agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x7')]='timeout';agents[_0x3d734d[_0xc6e6('0x12')]]['reason']=_0xc6e6('0x21');agents[_0x3d734d['destuniqueid']][_0xc6e6('0x22')]=_0x3d734d[_0xc6e6('0x23')]?parseInt(_0x3d734d[_0xc6e6('0x23')])/0x3e8:0x0;agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x24')]=0x0;unanswered['push'](_0x3d734d[_0xc6e6('0x12')]);}}catch(_0x1501bd){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')]('[%s][agents][agentringnoanswer]',_0x3d734d[_0xc6e6('0x16')]),_0x1501bd);}};exports['queuecallerabandon']=function(_0x29411c){try{_[_0xc6e6('0x25')](agents,function(_0x12c616,_0xc578b3){if(_0x12c616[_0xc6e6('0x16')]==_0x29411c[_0xc6e6('0x16')]&&!_[_0xc6e6('0x26')](unanswered,_0x12c616[_0xc6e6('0x12')])){utils[_0xc6e6('0x14')](util[_0xc6e6('0x1a')](_0xc6e6('0x27'),_0x29411c[_0xc6e6('0x16')]),_0x29411c);utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x28'),_0x29411c[_0xc6e6('0x16')],_0x12c616[_0xc6e6('0x4')],_0x12c616['destuniqueid']));_0x12c616[_0xc6e6('0x1b')]=!![];_0x12c616[_0xc6e6('0x1f')]=utils['now']();_0x12c616['lastevent']=_0xc6e6('0x29');_0x12c616[_0xc6e6('0x2a')]=_0xc6e6('0x29');_0x12c616[_0xc6e6('0x22')]=_0x29411c[_0xc6e6('0x22')];_0x12c616[_0xc6e6('0x24')]=0x0;writeDB(_0x12c616);}});}catch(_0x59a8f0){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x27'),_0x29411c['uniqueid']),_0x59a8f0);}};exports['agentconnect']=function(_0xa5138d){try{if(agents[_0xa5138d[_0xc6e6('0x12')]]){utils[_0xc6e6('0x14')](util[_0xc6e6('0x1a')]('[%s][agents][agentconnect]',_0xa5138d['uniqueid']),_0xa5138d);utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x2b'),_0xa5138d['uniqueid'],agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0xa5138d[_0xc6e6('0x12')]));agents[_0xa5138d[_0xc6e6('0x12')]]['agentconnectAt']=utils['now']();agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x6')]=_0xa5138d[_0xc6e6('0x6')];agents[_0xa5138d[_0xc6e6('0x12')]]['connectedlinename']=_0xa5138d['connectedlinename'];agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x22')]=_0xa5138d[_0xc6e6('0x23')];agents[_0xa5138d[_0xc6e6('0x12')]]['lastevent']=_0xc6e6('0x2c');_[_0xc6e6('0x25')](agents,function(_0x5ddab4,_0x500b7e){if(_0x5ddab4[_0xc6e6('0x12')]!=_0xa5138d['destuniqueid']&&_0x5ddab4[_0xc6e6('0x16')]==_0xa5138d[_0xc6e6('0x16')]){_0x5ddab4['talktime']=0x0;_0x5ddab4[_0xc6e6('0x22')]=_0xa5138d['ringtime'];_0x5ddab4[_0xc6e6('0x1b')]=!![];_0x5ddab4['agentringnoanswerAt']=utils[_0xc6e6('0x20')]();_0x5ddab4[_0xc6e6('0x7')]=_0xc6e6('0x2d');_0x5ddab4[_0xc6e6('0x2a')]=_0xc6e6('0x2d');_0x5ddab4[_0xc6e6('0x2e')]=_0xa5138d[_0xc6e6('0x12')];_0x5ddab4[_0xc6e6('0x2f')]=_0xa5138d[_0xc6e6('0x4')];writeDB(_0x5ddab4);}});}}catch(_0x5722db){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x30'),_0xa5138d[_0xc6e6('0x16')]),_0x5722db);}};exports['agentcomplete']=function(_0xc5f4fb){try{if(!_[_0xc6e6('0x31')](agents[_0xc5f4fb[_0xc6e6('0x12')]])){utils[_0xc6e6('0x14')](util['format'](_0xc6e6('0x32'),_0xc5f4fb[_0xc6e6('0x16')]),_0xc5f4fb);utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x33'),_0xc5f4fb['uniqueid'],agents[_0xc5f4fb[_0xc6e6('0x12')]]['membername'],_0xc5f4fb[_0xc6e6('0x12')]));agents[_0xc5f4fb['destuniqueid']][_0xc6e6('0xc')]=!![];agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x34')]=utils[_0xc6e6('0x20')]();agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x24')]=utils[_0xc6e6('0x35')](agents[_0xc5f4fb[_0xc6e6('0x12')]]['agentcompleteAt'],agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x36')]);agents[_0xc5f4fb[_0xc6e6('0x12')]]['reason']=_0xc5f4fb[_0xc6e6('0x2a')];agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x7')]=_0xc6e6('0x37');writeDB(agents[_0xc5f4fb[_0xc6e6('0x12')]]);}}catch(_0xefd557){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x32'),_0xc5f4fb[_0xc6e6('0x16')]),_0xefd557);}};exports[_0xc6e6('0x38')]=function(_0x470167){try{if(!_[_0xc6e6('0x31')](agents[_0x470167[_0xc6e6('0x39')]])){utils['debug'](util[_0xc6e6('0x1a')]('[%s][agents][blindtransfer]',_0x470167[_0xc6e6('0x16')]),_0x470167);utils[_0xc6e6('0x1d')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x470167['uniqueid'],agents[_0x470167['transfereruniqueid']]['membername'],agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x16')]));agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x3a')]=!![];agents[_0x470167[_0xc6e6('0x39')]]['transfertype']='blind';agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x3b')]=_0x470167[_0xc6e6('0x3c')];agents[_0x470167[_0xc6e6('0x39')]]['transferuniqueid']=agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x16')];}}catch(_0x286dc1){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')]('[%s][agents][blindtransfer]',_0x470167[_0xc6e6('0x16')]),_0x286dc1);}};exports[_0xc6e6('0x3d')]=function(_0x288912){try{utils['debug'](util[_0xc6e6('0x1a')](_0xc6e6('0x3e'),_0x288912[_0xc6e6('0x3f')]),_0x288912);if(_0x288912[_0xc6e6('0x3f')]==_0x288912[_0xc6e6('0x40')]){if(!_['isNil'](agents[_0x288912[_0xc6e6('0x41')]])){utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x42'),_0x288912[_0xc6e6('0x3f')],agents[_0x288912['secondtransfereruniqueid']]['membername']));agents[_0x288912['secondtransfereruniqueid']][_0xc6e6('0x3a')]=!![];agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x43')]=_0xc6e6('0x44');agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x3b')]=_0x288912['origtransfererexten'];agents[_0x288912[_0xc6e6('0x41')]]['transferuniqueid']=_0x288912[_0xc6e6('0x3f')];}if(_0x288912[_0xc6e6('0x45')]&&agents[_0x288912[_0xc6e6('0x45')]]){agents[_0x288912['transfereeuniqueid']][_0xc6e6('0x46')]=0x1;transfers[_0x288912['transfereeuniqueid']]=_[_0xc6e6('0x47')](agents[_0x288912['transfereeuniqueid']]);transfers[_0x288912['transfereeuniqueid']][_0xc6e6('0x48')]=agents[_0x288912['secondtransfereruniqueid']]['calleridnum'];transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x49')]=agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x49')];transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x17')]=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x45')]]['agentconnectAt']=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x22')]=0x0;transfers[_0x288912[_0xc6e6('0x45')]]['agententerreason']=0x2;}}else if(_0x288912[_0xc6e6('0x41')]==_0x288912[_0xc6e6('0x4a')]){if(!_[_0xc6e6('0x31')](agents[_0x288912['origtransfereruniqueid']])){utils['info'](util[_0xc6e6('0x1a')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x288912['origtransfereruniqueid'],agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x4')]));agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x3a')]=!![];agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x43')]=_0xc6e6('0x44');agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x3b')]=_0x288912[_0xc6e6('0x4b')];agents[_0x288912[_0xc6e6('0x3f')]]['transferuniqueid']=_0x288912['secondtransfereruniqueid'];}if(_0x288912[_0xc6e6('0x4c')]&&agents[_0x288912['transfertargetuniqueid']]){agents[_0x288912['transfertargetuniqueid']][_0xc6e6('0x46')]=0x1;transfers[_0x288912[_0xc6e6('0x4c')]]=_[_0xc6e6('0x47')](agents[_0x288912['transfertargetuniqueid']]);transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x48')]=agents[_0x288912['origtransfereruniqueid']]['calleridnum'];transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x49')]=agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x49')];transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x17')]=utils['now']();transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x36')]=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x22')]=0x0;transfers[_0x288912['transfertargetuniqueid']][_0xc6e6('0x46')]=0x2;}}}catch(_0x3b1549){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x3e'),_0x288912[_0xc6e6('0x3f')]),_0x3b1549);}};exports['hangup']=function(_0x27e74b){try{utils['debug'](util[_0xc6e6('0x1a')]('[%s][agents][hangup]',_0x27e74b['uniqueid']),_0x27e74b);if(agents[_0x27e74b[_0xc6e6('0x16')]]&&agents[_0x27e74b['uniqueid']][_0xc6e6('0x2a')]===_0xc6e6('0x21')){if(_0x27e74b[_0xc6e6('0x4d')]==='21'){agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')]='rejected';agents[_0x27e74b[_0xc6e6('0x16')]]['lastevent']='rejected';}utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x4e'),_0x27e74b['uniqueid'],agents[_0x27e74b[_0xc6e6('0x16')]]['membername'],agents[_0x27e74b['uniqueid']][_0xc6e6('0x2a')],agents[_0x27e74b['uniqueid']][_0xc6e6('0x7')]));writeDB(agents[_0x27e74b[_0xc6e6('0x16')]]);var _0x292107=unanswered[_0xc6e6('0x4f')](_0x27e74b['uniqueid']);if(_0x292107>-0x1){unanswered[_0xc6e6('0x50')](_0x292107,0x1);}}if(transfers[_0x27e74b[_0xc6e6('0x16')]]){transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0xc')]=!![];transfers[_0x27e74b[_0xc6e6('0x16')]]['agentcompleteAt']=utils[_0xc6e6('0x20')]();transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x24')]=utils[_0xc6e6('0x35')](transfers[_0x27e74b['uniqueid']]['agentcompleteAt'],transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x36')]);transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')]=_0xc6e6('0x51');transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x7')]=_0xc6e6('0x37');utils[_0xc6e6('0x1d')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x27e74b[_0xc6e6('0x16')],transfers[_0x27e74b['uniqueid']][_0xc6e6('0x4')],transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')],transfers[_0x27e74b['uniqueid']]['lastevent']));writeDB(transfers[_0x27e74b[_0xc6e6('0x16')]],!![]);}if(agents[_0x27e74b['uniqueid']]&&agents[_0x27e74b[_0xc6e6('0x16')]]['agentconnectAt']){agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0xc')]=!![];agents[_0x27e74b['uniqueid']][_0xc6e6('0x34')]=utils[_0xc6e6('0x20')]();agents[_0x27e74b[_0xc6e6('0x16')]]['talktime']=utils[_0xc6e6('0x35')](agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x34')],agents[_0x27e74b['uniqueid']][_0xc6e6('0x36')]);agents[_0x27e74b[_0xc6e6('0x16')]]['reason']=agents[_0x27e74b['uniqueid']]['transfer']?_0xc6e6('0x3a'):_0xc6e6('0x51');agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x7')]=_0xc6e6('0x37');utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x4e'),_0x27e74b['uniqueid'],agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x4')],agents[_0x27e74b[_0xc6e6('0x16')]]['reason'],agents[_0x27e74b['uniqueid']][_0xc6e6('0x7')]));writeDB(agents[_0x27e74b[_0xc6e6('0x16')]]);}}catch(_0x1826d){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x52'),_0x27e74b[_0xc6e6('0x16')]),_0x1826d);}}; \ No newline at end of file +var _0x878f=['abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','reason','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause','rejected','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','includes','[%s][agents][queuecallerabandon]'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x878f,0x173));var _0xf878=function(_0x28880c,_0x45429f){_0x28880c=_0x28880c-0x0;var _0x335e2d=_0x878f[_0x28880c];return _0x335e2d;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var utils=require(_0xf878('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2e1d23,_0x12df2b){utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x4'),_0x2e1d23[_0xf878('0x5')],_0x2e1d23[_0xf878('0x6')],_0x2e1d23[_0xf878('0x7')],_0x2e1d23[_0xf878('0x8')],_0x2e1d23['interface'],_0x2e1d23['calleridnum'],_0x2e1d23[_0xf878('0x9')],_0x2e1d23[_0xf878('0xa')]));if(_0x2e1d23['queue']){utils['getVoiceQueueByName'](_0x2e1d23['queue'])[_0xf878('0xb')](function(_0x5f2693){if(_0x5f2693){_0x2e1d23['type']=_0x5f2693[_0xf878('0xc')];_0x2e1d23[_0xf878('0xd')]=_0x2e1d23[_0xf878('0xe')]?_0x5f2693['acw']:![];_0x2e1d23[_0xf878('0xf')]=_0x2e1d23[_0xf878('0xd')]?_0x5f2693['acwTimeout']:0x0;}utils[_0xf878('0x10')]('CreateVoiceAgentReport',_0x2e1d23);});}else{utils[_0xf878('0x10')](_0xf878('0x11'),_0x2e1d23);}if(_0x12df2b){delete transfers[_0x2e1d23[_0xf878('0x5')]];}else{delete agents[_0x2e1d23['destuniqueid']];}}exports[_0xf878('0x12')]=function(_0x38eddf){try{utils[_0xf878('0x13')](util['format'](_0xf878('0x14'),_0x38eddf[_0xf878('0x5')]),_0x38eddf);agents[_0x38eddf[_0xf878('0x15')]]=_0x38eddf;agents[_0x38eddf['destuniqueid']]['agentcalledAt']=utils[_0xf878('0x16')]();agents[_0x38eddf[_0xf878('0x15')]][_0xf878('0xa')]=_0xf878('0x17');agents[_0x38eddf[_0xf878('0x15')]][_0xf878('0x9')]=null;agents[_0x38eddf[_0xf878('0x15')]][_0xf878('0x18')]=null;utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x19'),_0x38eddf['uniqueid'],agents[_0x38eddf[_0xf878('0x15')]][_0xf878('0x8')],_0x38eddf[_0xf878('0x15')]));}catch(_0x622ea8){utils[_0xf878('0x1a')](util[_0xf878('0x3')](_0xf878('0x14'),_0x38eddf['uniqueid']),_0x622ea8);}};exports[_0xf878('0x1b')]=function(_0x140866){try{if(!_[_0xf878('0x1c')](agents[_0x140866['destuniqueid']])){utils[_0xf878('0x13')](util[_0xf878('0x3')](_0xf878('0x1d'),_0x140866[_0xf878('0x5')]),_0x140866);utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x1e'),_0x140866[_0xf878('0x5')],agents[_0x140866[_0xf878('0x15')]][_0xf878('0x8')],_0x140866[_0xf878('0x15')]));agents[_0x140866['destuniqueid']][_0xf878('0x1b')]=!![];agents[_0x140866['destuniqueid']][_0xf878('0x1f')]=utils[_0xf878('0x16')]();agents[_0x140866[_0xf878('0x15')]][_0xf878('0xa')]=_0xf878('0x20');agents[_0x140866['destuniqueid']]['reason']='timeout';agents[_0x140866[_0xf878('0x15')]][_0xf878('0x21')]=_0x140866[_0xf878('0x22')]?parseInt(_0x140866['ringtime'])/0x3e8:0x0;agents[_0x140866[_0xf878('0x15')]][_0xf878('0x23')]=0x0;unanswered[_0xf878('0x24')](_0x140866[_0xf878('0x15')]);}}catch(_0x41dd55){utils['error'](util['format'](_0xf878('0x1d'),_0x140866[_0xf878('0x5')]),_0x41dd55);}};exports['queuecallerabandon']=function(_0x31e2e1){try{_['forIn'](agents,function(_0x969ee3,_0x51afaf){if(_0x969ee3[_0xf878('0x5')]==_0x31e2e1['uniqueid']&&!_[_0xf878('0x25')](unanswered,_0x969ee3['destuniqueid'])){utils[_0xf878('0x13')](util[_0xf878('0x3')](_0xf878('0x26'),_0x31e2e1[_0xf878('0x5')]),_0x31e2e1);utils[_0xf878('0x2')](util[_0xf878('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x31e2e1[_0xf878('0x5')],_0x969ee3[_0xf878('0x8')],_0x969ee3[_0xf878('0x15')]));_0x969ee3[_0xf878('0x1b')]=!![];_0x969ee3[_0xf878('0x1f')]=utils['now']();_0x969ee3[_0xf878('0xa')]=_0xf878('0x27');_0x969ee3['reason']=_0xf878('0x27');_0x969ee3[_0xf878('0x21')]=_0x31e2e1[_0xf878('0x21')];_0x969ee3[_0xf878('0x23')]=0x0;writeDB(_0x969ee3);}});}catch(_0x1acfb6){utils['error'](util[_0xf878('0x3')](_0xf878('0x26'),_0x31e2e1[_0xf878('0x5')]),_0x1acfb6);}};exports[_0xf878('0x28')]=function(_0x579c91){try{if(agents[_0x579c91[_0xf878('0x15')]]){utils['debug'](util['format'](_0xf878('0x29'),_0x579c91[_0xf878('0x5')]),_0x579c91);utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x2a'),_0x579c91['uniqueid'],agents[_0x579c91[_0xf878('0x15')]]['membername'],_0x579c91[_0xf878('0x15')]));agents[_0x579c91[_0xf878('0x15')]]['agentconnectAt']=utils[_0xf878('0x16')]();agents[_0x579c91[_0xf878('0x15')]]['connectedlinenum']=_0x579c91[_0xf878('0x9')];agents[_0x579c91[_0xf878('0x15')]]['connectedlinename']=_0x579c91[_0xf878('0x18')];agents[_0x579c91[_0xf878('0x15')]][_0xf878('0x21')]=_0x579c91[_0xf878('0x22')];agents[_0x579c91[_0xf878('0x15')]][_0xf878('0xa')]=_0xf878('0x2b');_['forIn'](agents,function(_0x1179fb,_0x14340d){if(_0x1179fb['destuniqueid']!=_0x579c91[_0xf878('0x15')]&&_0x1179fb['uniqueid']==_0x579c91['uniqueid']){_0x1179fb[_0xf878('0x23')]=0x0;_0x1179fb[_0xf878('0x21')]=_0x579c91[_0xf878('0x22')];_0x1179fb[_0xf878('0x1b')]=!![];_0x1179fb[_0xf878('0x1f')]=utils['now']();_0x1179fb[_0xf878('0xa')]='answered_elsewhere';_0x1179fb[_0xf878('0x2c')]=_0xf878('0x2d');_0x1179fb['answeredelsewheredestinationuniqueid']=_0x579c91['destuniqueid'];_0x1179fb[_0xf878('0x2e')]=_0x579c91[_0xf878('0x8')];writeDB(_0x1179fb);}});}}catch(_0x13fcd3){utils[_0xf878('0x1a')](util[_0xf878('0x3')](_0xf878('0x29'),_0x579c91[_0xf878('0x5')]),_0x13fcd3);}};exports[_0xf878('0xe')]=function(_0x3b1c67){try{if(!_['isNil'](agents[_0x3b1c67[_0xf878('0x15')]])){utils[_0xf878('0x13')](util[_0xf878('0x3')](_0xf878('0x2f'),_0x3b1c67[_0xf878('0x5')]),_0x3b1c67);utils[_0xf878('0x2')](util['format'](_0xf878('0x30'),_0x3b1c67[_0xf878('0x5')],agents[_0x3b1c67[_0xf878('0x15')]][_0xf878('0x8')],_0x3b1c67[_0xf878('0x15')]));agents[_0x3b1c67['destuniqueid']][_0xf878('0xe')]=!![];agents[_0x3b1c67[_0xf878('0x15')]][_0xf878('0x31')]=utils[_0xf878('0x16')]();agents[_0x3b1c67['destuniqueid']][_0xf878('0x23')]=utils[_0xf878('0x32')](agents[_0x3b1c67[_0xf878('0x15')]]['agentcompleteAt'],agents[_0x3b1c67['destuniqueid']][_0xf878('0x33')]);agents[_0x3b1c67['destuniqueid']]['reason']=_0x3b1c67['reason'];agents[_0x3b1c67[_0xf878('0x15')]]['lastevent']=_0xf878('0x34');writeDB(agents[_0x3b1c67[_0xf878('0x15')]]);}}catch(_0x1dcb19){utils[_0xf878('0x1a')](util[_0xf878('0x3')](_0xf878('0x2f'),_0x3b1c67[_0xf878('0x5')]),_0x1dcb19);}};exports['blindtransfer']=function(_0xb0bf4c){try{if(!_[_0xf878('0x1c')](agents[_0xb0bf4c[_0xf878('0x35')]])){utils[_0xf878('0x13')](util[_0xf878('0x3')]('[%s][agents][blindtransfer]',_0xb0bf4c['uniqueid']),_0xb0bf4c);utils[_0xf878('0x2')](util[_0xf878('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0xb0bf4c[_0xf878('0x5')],agents[_0xb0bf4c['transfereruniqueid']][_0xf878('0x8')],agents[_0xb0bf4c[_0xf878('0x35')]][_0xf878('0x5')]));agents[_0xb0bf4c[_0xf878('0x35')]]['transfer']=!![];agents[_0xb0bf4c[_0xf878('0x35')]][_0xf878('0x36')]=_0xf878('0x37');agents[_0xb0bf4c['transfereruniqueid']][_0xf878('0x38')]=_0xb0bf4c[_0xf878('0x39')];agents[_0xb0bf4c[_0xf878('0x35')]][_0xf878('0x3a')]=agents[_0xb0bf4c['transfereruniqueid']][_0xf878('0x5')];}}catch(_0x181f09){utils[_0xf878('0x1a')](util['format'](_0xf878('0x3b'),_0xb0bf4c[_0xf878('0x5')]),_0x181f09);}};exports[_0xf878('0x3c')]=function(_0x150f60){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x150f60[_0xf878('0x3d')]),_0x150f60);if(_0x150f60['origtransfereruniqueid']==_0x150f60['origtransfererlinkedid']){if(!_['isNil'](agents[_0x150f60[_0xf878('0x3e')]])){utils[_0xf878('0x2')](util['format'](_0xf878('0x3f'),_0x150f60[_0xf878('0x3d')],agents[_0x150f60[_0xf878('0x3e')]]['membername']));agents[_0x150f60['secondtransfereruniqueid']][_0xf878('0x40')]=!![];agents[_0x150f60['secondtransfereruniqueid']][_0xf878('0x36')]=_0xf878('0x41');agents[_0x150f60[_0xf878('0x3e')]][_0xf878('0x38')]=_0x150f60[_0xf878('0x42')];agents[_0x150f60[_0xf878('0x3e')]]['transferuniqueid']=_0x150f60[_0xf878('0x3d')];}if(_0x150f60[_0xf878('0x43')]&&agents[_0x150f60['transfereeuniqueid']]){agents[_0x150f60[_0xf878('0x43')]][_0xf878('0x44')]=0x1;transfers[_0x150f60[_0xf878('0x43')]]=_[_0xf878('0x45')](agents[_0x150f60[_0xf878('0x43')]]);transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x46')]=agents[_0x150f60['secondtransfereruniqueid']][_0xf878('0x46')];transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x47')]=agents[_0x150f60['secondtransfereruniqueid']][_0xf878('0x47')];transfers[_0x150f60['transfereeuniqueid']][_0xf878('0x48')]=utils[_0xf878('0x16')]();transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x33')]=utils[_0xf878('0x16')]();transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x21')]=0x0;transfers[_0x150f60[_0xf878('0x43')]][_0xf878('0x44')]=0x2;}}else if(_0x150f60[_0xf878('0x3e')]==_0x150f60['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x150f60['origtransfereruniqueid']])){utils[_0xf878('0x2')](util['format'](_0xf878('0x3f'),_0x150f60[_0xf878('0x3d')],agents[_0x150f60['origtransfereruniqueid']]['membername']));agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x40')]=!![];agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x36')]=_0xf878('0x41');agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x38')]=_0x150f60[_0xf878('0x49')];agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x3a')]=_0x150f60[_0xf878('0x3e')];}if(_0x150f60[_0xf878('0x4a')]&&agents[_0x150f60[_0xf878('0x4a')]]){agents[_0x150f60[_0xf878('0x4a')]][_0xf878('0x44')]=0x1;transfers[_0x150f60[_0xf878('0x4a')]]=_[_0xf878('0x45')](agents[_0x150f60[_0xf878('0x4a')]]);transfers[_0x150f60['transfertargetuniqueid']][_0xf878('0x46')]=agents[_0x150f60['origtransfereruniqueid']][_0xf878('0x46')];transfers[_0x150f60[_0xf878('0x4a')]][_0xf878('0x47')]=agents[_0x150f60[_0xf878('0x3d')]][_0xf878('0x47')];transfers[_0x150f60[_0xf878('0x4a')]][_0xf878('0x48')]=utils[_0xf878('0x16')]();transfers[_0x150f60[_0xf878('0x4a')]]['agentconnectAt']=utils[_0xf878('0x16')]();transfers[_0x150f60[_0xf878('0x4a')]][_0xf878('0x21')]=0x0;transfers[_0x150f60[_0xf878('0x4a')]]['agententerreason']=0x2;}}}catch(_0xa73ee){utils[_0xf878('0x1a')](util[_0xf878('0x3')](_0xf878('0x4b'),_0x150f60[_0xf878('0x3d')]),_0xa73ee);}};exports['hangup']=function(_0x5860f6){try{utils[_0xf878('0x13')](util[_0xf878('0x3')](_0xf878('0x4c'),_0x5860f6[_0xf878('0x5')]),_0x5860f6);if(agents[_0x5860f6[_0xf878('0x5')]]&&agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x2c')]===_0xf878('0x20')){if(_0x5860f6[_0xf878('0x4d')]==='21'){agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x2c')]=_0xf878('0x4e');agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]=_0xf878('0x4e');}utils[_0xf878('0x2')](util[_0xf878('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5860f6[_0xf878('0x5')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x8')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x2c')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]));writeDB(agents[_0x5860f6[_0xf878('0x5')]]);var _0x443e69=unanswered['indexOf'](_0x5860f6[_0xf878('0x5')]);if(_0x443e69>-0x1){unanswered[_0xf878('0x4f')](_0x443e69,0x1);}}if(transfers[_0x5860f6[_0xf878('0x5')]]){transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0xe')]=!![];transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0x31')]=utils['now']();transfers[_0x5860f6['uniqueid']][_0xf878('0x23')]=utils['diffTime'](transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0x31')],transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0x33')]);transfers[_0x5860f6['uniqueid']][_0xf878('0x2c')]=_0xf878('0x50');transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]='complete';utils[_0xf878('0x2')](util['format'](_0xf878('0x51'),_0x5860f6[_0xf878('0x5')],transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0x8')],transfers[_0x5860f6[_0xf878('0x5')]]['reason'],transfers[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]));writeDB(transfers[_0x5860f6[_0xf878('0x5')]],!![]);}if(agents[_0x5860f6[_0xf878('0x5')]]&&agents[_0x5860f6['uniqueid']][_0xf878('0x33')]){agents[_0x5860f6['uniqueid']][_0xf878('0xe')]=!![];agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x31')]=utils[_0xf878('0x16')]();agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x23')]=utils[_0xf878('0x32')](agents[_0x5860f6[_0xf878('0x5')]]['agentcompleteAt'],agents[_0x5860f6['uniqueid']]['agentconnectAt']);agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x2c')]=agents[_0x5860f6['uniqueid']]['transfer']?_0xf878('0x40'):'agent';agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]=_0xf878('0x34');utils[_0xf878('0x2')](util[_0xf878('0x3')](_0xf878('0x51'),_0x5860f6[_0xf878('0x5')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0x8')],agents[_0x5860f6['uniqueid']][_0xf878('0x2c')],agents[_0x5860f6[_0xf878('0x5')]][_0xf878('0xa')]));writeDB(agents[_0x5860f6['uniqueid']]);}}catch(_0x15f893){utils[_0xf878('0x1a')](util['format'](_0xf878('0x4c'),_0x5860f6[_0xf878('0x5')]),_0x15f893);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 8c2d27a..b45fa47 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 _0xa5aa=['blinds','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','channelstate','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','cdr','appdata','split','lastIndexOf','execif','set','[%s][calls][newexten]','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request'];(function(_0x188304,_0x1ac3c6){var _0x4c3350=function(_0x2c920c){while(--_0x2c920c){_0x188304['push'](_0x188304['shift']());}};_0x4c3350(++_0x1ac3c6);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x4a44f0,_0x38e418){_0x4a44f0=_0x4a44f0-0x0;var _0x50d00c=_0xa5aa[_0x4a44f0];return _0x50d00c;};'use strict';var _=require(_0xaa5a('0x0'));var util=require(_0xaa5a('0x1'));var utils=require('./utils');var transfers=require(_0xaa5a('0x2'));var dispositions=[_0xaa5a('0x3'),_0xaa5a('0x4'),_0xaa5a('0x4'),_0xaa5a('0x3'),_0xaa5a('0x3'),'NO\x20ANSWER',_0xaa5a('0x5'),_0xaa5a('0x6'),_0xaa5a('0x4'),'FAILED','FAILED'];var channels={};function writeDB(_0x26e49b){var _0x3ec50a;if(transfers['blinds'][_0x26e49b[_0xaa5a('0x7')]]){_0x3ec50a=_0x26e49b[_0xaa5a('0x7')];_0x26e49b[_0xaa5a('0x7')]=transfers['blinds'][_0x26e49b[_0xaa5a('0x7')]][_0xaa5a('0x8')];}utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0xb'),_0x26e49b[_0xaa5a('0x7')],_0x26e49b['channel'],_0x26e49b[_0xaa5a('0xc')],_0x26e49b[_0xaa5a('0xd')],_0x26e49b[_0xaa5a('0xe')],_0x26e49b[_0xaa5a('0xf')],_0x26e49b[_0xaa5a('0x10')],_0x26e49b[_0xaa5a('0x11')]));if(_0x26e49b[_0xaa5a('0x12')]){utils[_0xaa5a('0x13')](_0x26e49b[_0xaa5a('0x12')])[_0xaa5a('0x14')](function(_0x1eb04d){if(_0x1eb04d){_0x26e49b[_0xaa5a('0x15')]=_0x1eb04d['id'];}utils['request'](_0xaa5a('0x16'),_0x26e49b);});}else{utils[_0xaa5a('0x17')](_0xaa5a('0x16'),_0x26e49b);}if(channels[_0x26e49b['uniqueid']]){delete channels[_0x26e49b[_0xaa5a('0x7')]];}else if(_0x3ec50a&&channels[_0x3ec50a]){if(!transfers[_0xaa5a('0x18')][_0x3ec50a][_0xaa5a('0x19')])delete transfers[_0xaa5a('0x18')][_0x3ec50a];delete channels[_0x3ec50a];}}exports[_0xaa5a('0x1a')]=function(_0x420d96){try{utils[_0xaa5a('0x1b')](util[_0xaa5a('0xa')](_0xaa5a('0x1c'),_0x420d96[_0xaa5a('0x7')]),_0x420d96);if(_0x420d96[_0xaa5a('0x7')]==_0x420d96[_0xaa5a('0x1d')]&&_0x420d96[_0xaa5a('0x1e')]!=_0xaa5a('0x1f')){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x20'),_0x420d96['uniqueid'],_0x420d96[_0xaa5a('0x21')],_0x420d96[_0xaa5a('0x22')]));channels[_0x420d96[_0xaa5a('0x7')]]={'uniqueid':_0x420d96[_0xaa5a('0x7')],'accountcode':_0x420d96['accountcode'],'source':_0x420d96[_0xaa5a('0xf')],'destination':_0x420d96[_0xaa5a('0x22')],'destinationcontext':_0x420d96[_0xaa5a('0x21')],'channel':_0x420d96[_0xaa5a('0x1e')],'starttime':utils[_0xaa5a('0x23')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaa5a('0x3'),'amaflags':_0xaa5a('0x24')};}}catch(_0x1d3fbc){utils[_0xaa5a('0x25')](util['format'](_0xaa5a('0x1c'),_0x420d96['uniqueid']),_0x1d3fbc);}};exports[_0xaa5a('0x26')]=function(_0xbe9ce1){try{utils[_0xaa5a('0x1b')](util[_0xaa5a('0xa')](_0xaa5a('0x27'),_0xbe9ce1['uniqueid']),_0xbe9ce1);if(!_[_0xaa5a('0x28')](channels[_0xbe9ce1[_0xaa5a('0x7')]])&&_0xbe9ce1['channelstate']==0x6){utils[_0xaa5a('0x9')](util['format'](_0xaa5a('0x29'),_0xbe9ce1[_0xaa5a('0x7')],_0xbe9ce1[_0xaa5a('0x21')],_0xbe9ce1[_0xaa5a('0x1e')]));if(_[_0xaa5a('0x28')](channels[_0xbe9ce1[_0xaa5a('0x7')]]['systemanswertime'])){channels[_0xbe9ce1[_0xaa5a('0x7')]][_0xaa5a('0x2a')]=utils['now']();}}else if(!_[_0xaa5a('0x28')](channels[_0xbe9ce1[_0xaa5a('0x1d')]])&&_0xbe9ce1['channelstate']==0x6&&_0xbe9ce1[_0xaa5a('0x21')]!=_0xaa5a('0x2b')){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x2c'),_0xbe9ce1[_0xaa5a('0x7')],_0xbe9ce1['linkedid'],_0xbe9ce1[_0xaa5a('0x21')],_0xbe9ce1[_0xaa5a('0x1e')]));channels[_0xbe9ce1[_0xaa5a('0x1d')]][_0xaa5a('0x12')]=_0xbe9ce1['accountcode'];channels[_0xbe9ce1['linkedid']][_0xaa5a('0x2d')]=_0xbe9ce1[_0xaa5a('0x1e')];if(_['isNil'](channels[_0xbe9ce1[_0xaa5a('0x1d')]]['answertime'])){channels[_0xbe9ce1['linkedid']][_0xaa5a('0x2e')]=utils[_0xaa5a('0x23')]();}channels[_0xbe9ce1[_0xaa5a('0x1d')]][_0xaa5a('0x2f')]=dispositions[_[_0xaa5a('0x30')](_0xbe9ce1[_0xaa5a('0x31')])]||_0xaa5a('0x5');}}catch(_0x5632aa){utils[_0xaa5a('0x25')](util[_0xaa5a('0xa')](_0xaa5a('0x27'),_0xbe9ce1['uniqueid']),_0x5632aa);}};exports[_0xaa5a('0x32')]=function(_0x5314c5){try{if(!_[_0xaa5a('0x28')](channels[_0x5314c5['uniqueid']])){utils['debug'](util[_0xaa5a('0xa')](_0xaa5a('0x33'),_0x5314c5[_0xaa5a('0x7')]),_0x5314c5);if(_[_0xaa5a('0x28')](channels[_0x5314c5[_0xaa5a('0x7')]][_0xaa5a('0x34')])){channels[_0x5314c5[_0xaa5a('0x7')]][_0xaa5a('0x34')]=_0x5314c5['calleridname']+'\x20<'+_0x5314c5['calleridnum']+'>';}utils['info'](util[_0xaa5a('0xa')](_0xaa5a('0x35'),_0x5314c5[_0xaa5a('0x7')],channels[_0x5314c5[_0xaa5a('0x7')]][_0xaa5a('0x34')],_0x5314c5[_0xaa5a('0x36')]));channels[_0x5314c5['uniqueid']]['endtime']=utils['now']();channels[_0x5314c5[_0xaa5a('0x7')]]['duration']=utils['diffTime'](channels[_0x5314c5['uniqueid']][_0xaa5a('0x37')],channels[_0x5314c5[_0xaa5a('0x7')]][_0xaa5a('0x38')]);channels[_0x5314c5['uniqueid']][_0xaa5a('0x39')]=channels[_0x5314c5[_0xaa5a('0x7')]][_0xaa5a('0x2e')]?utils[_0xaa5a('0x3a')](channels[_0x5314c5[_0xaa5a('0x7')]]['endtime'],channels[_0x5314c5[_0xaa5a('0x7')]][_0xaa5a('0x2e')]):0x0;writeDB(channels[_0x5314c5[_0xaa5a('0x7')]]);}}catch(_0x37c931){utils[_0xaa5a('0x25')](util[_0xaa5a('0xa')](_0xaa5a('0x33'),_0x5314c5[_0xaa5a('0x7')]),_0x37c931);}};exports[_0xaa5a('0x3b')]=function(_0x557801){try{if(!_['isNil'](channels[_0x557801['localtwolinkedid']])){utils['debug'](util[_0xaa5a('0xa')](_0xaa5a('0x3c'),_0x557801[_0xaa5a('0x3d')]),_0x557801);if(channels[_0x557801[_0xaa5a('0x3e')]][_0xaa5a('0x1e')]==_0x557801[_0xaa5a('0x3f')]){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x40'),_0x557801[_0xaa5a('0x3d')],_0x557801['localtwolinkedid'],_0x557801[_0xaa5a('0x41')]));channels[_0x557801[_0xaa5a('0x3e')]][_0xaa5a('0x2d')]=_0x557801[_0xaa5a('0x41')];channels[_0x557801[_0xaa5a('0x3e')]][_0xaa5a('0x42')]=_0xaa5a('0x43');}else if(channels[_0x557801['localtwolinkedid']][_0xaa5a('0x1e')]=_0x557801[_0xaa5a('0x44')]){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x40'),_0x557801[_0xaa5a('0x3d')],_0x557801[_0xaa5a('0x3e')],_0x557801[_0xaa5a('0x45')]));channels[_0x557801[_0xaa5a('0x3e')]]['destinationchannel']=_0x557801['origtransfererchannel'];channels[_0x557801[_0xaa5a('0x3e')]][_0xaa5a('0x42')]=_0xaa5a('0x43');}}}catch(_0xd8337d){utils[_0xaa5a('0x25')](util[_0xaa5a('0xa')](_0xaa5a('0x3c'),_0x557801['origtransfereruniqueid']),_0xd8337d);}};exports[_0xaa5a('0x46')]=function(_0x77eb02){try{if(!_[_0xaa5a('0x28')](channels[_0x77eb02[_0xaa5a('0x7')]])){utils[_0xaa5a('0x1b')](util['format']('[%s][calls][musiconholdstart]',_0x77eb02['uniqueid']),_0x77eb02);channels[_0x77eb02['uniqueid']][_0xaa5a('0x47')]=utils[_0xaa5a('0x23')]();utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x48'),_0x77eb02[_0xaa5a('0x7')],channels[_0x77eb02[_0xaa5a('0x7')]][_0xaa5a('0x47')]));}}catch(_0x16a875){utils[_0xaa5a('0x25')](util[_0xaa5a('0xa')](_0xaa5a('0x49'),_0x77eb02[_0xaa5a('0x7')]),_0x16a875);}};exports[_0xaa5a('0x4a')]=function(_0x1758d9){try{if(!_['isNil'](channels[_0x1758d9['uniqueid']])){utils['debug'](util[_0xaa5a('0xa')](_0xaa5a('0x4b'),_0x1758d9[_0xaa5a('0x7')]),_0x1758d9);if(!_[_0xaa5a('0x28')](channels[_0x1758d9[_0xaa5a('0x7')]][_0xaa5a('0x47')])){channels[_0x1758d9[_0xaa5a('0x7')]][_0xaa5a('0x4c')]+=utils[_0xaa5a('0x3a')](utils[_0xaa5a('0x23')](),channels[_0x1758d9[_0xaa5a('0x7')]][_0xaa5a('0x47')]);utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x4d'),_0x1758d9['uniqueid'],channels[_0x1758d9[_0xaa5a('0x7')]][_0xaa5a('0x4c')]));delete channels[_0x1758d9[_0xaa5a('0x7')]][_0xaa5a('0x47')];}}}catch(_0x20db3f){utils[_0xaa5a('0x25')](util[_0xaa5a('0xa')](_0xaa5a('0x4b'),_0x1758d9[_0xaa5a('0x7')]),_0x20db3f);}};exports[_0xaa5a('0x4e')]=function(_0x28f8b3){try{if(!_[_0xaa5a('0x28')](channels[_0x28f8b3[_0xaa5a('0x7')]])){utils[_0xaa5a('0x1b')](util[_0xaa5a('0xa')](_0xaa5a('0x4f'),_0x28f8b3[_0xaa5a('0x7')]),_0x28f8b3);if(!_[_0xaa5a('0x28')](_0x28f8b3['variable'][_0xaa5a('0x50')])){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x28f8b3[_0xaa5a('0x7')],_0x28f8b3[_0xaa5a('0x51')]));channels[_0x28f8b3[_0xaa5a('0x7')]][_0xaa5a('0x52')]=_0x28f8b3[_0xaa5a('0x51')];}if(!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')]['xmd-phone'])){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x54'),_0x28f8b3[_0xaa5a('0x7')],_0x28f8b3[_0xaa5a('0x51')]));channels[_0x28f8b3[_0xaa5a('0x7')]]['destination']=_0x28f8b3[_0xaa5a('0x51')];channels[_0x28f8b3['uniqueid']][_0xaa5a('0x34')]='\x22'+_0x28f8b3['value']+'\x22\x20<'+_0x28f8b3[_0xaa5a('0x51')]+'>';}if(!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')][_0xaa5a('0x55')])||!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')][_0xaa5a('0x56')])){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x57'),_0x28f8b3['uniqueid'],!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')][_0xaa5a('0x55')])?_0xaa5a('0x55'):_0xaa5a('0x56'),_0x28f8b3[_0xaa5a('0x51')]));channels[_0x28f8b3['uniqueid']][_0xaa5a('0x34')]=_0x28f8b3[_0xaa5a('0x51')];}if(!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')]['xmd-queue'])||!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')]['xmcs-queue'])){utils[_0xaa5a('0x9')](util['format'](_0xaa5a('0x57'),_0x28f8b3[_0xaa5a('0x7')],!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')][_0xaa5a('0x58')])?_0xaa5a('0x58'):_0xaa5a('0x59'),_0x28f8b3['value']));channels[_0x28f8b3[_0xaa5a('0x7')]][_0xaa5a('0x5a')]=_0xaa5a('0x5b');channels[_0x28f8b3['uniqueid']][_0xaa5a('0x5c')]=_0x28f8b3[_0xaa5a('0x51')];channels[_0x28f8b3[_0xaa5a('0x7')]][_0xaa5a('0xc')]=!![];}if(!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')][_0xaa5a('0x5d')])){utils[_0xaa5a('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x28f8b3[_0xaa5a('0x7')],_0x28f8b3['value']));channels[_0x28f8b3['uniqueid']][_0xaa5a('0x5e')]=_0x28f8b3[_0xaa5a('0x51')];}if(!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')][_0xaa5a('0x5f')])){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x60'),_0x28f8b3[_0xaa5a('0x7')],_0x28f8b3['value']));channels[_0x28f8b3[_0xaa5a('0x7')]][_0xaa5a('0x61')]=_0x28f8b3[_0xaa5a('0x51')];}if(!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')][_0xaa5a('0x62')])){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x63'),_0x28f8b3['uniqueid'],_0x28f8b3[_0xaa5a('0x51')]));channels[_0x28f8b3[_0xaa5a('0x7')]][_0xaa5a('0x64')]=_0x28f8b3[_0xaa5a('0x51')];}if(!_[_0xaa5a('0x28')](_0x28f8b3[_0xaa5a('0x53')]['sipcallid'])){utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x28f8b3[_0xaa5a('0x7')],_0x28f8b3['value']));channels[_0x28f8b3[_0xaa5a('0x7')]][_0xaa5a('0x65')]=_0x28f8b3[_0xaa5a('0x51')];}}}catch(_0x4583a0){utils['error'](util[_0xaa5a('0xa')](_0xaa5a('0x4f'),_0x28f8b3[_0xaa5a('0x7')]),_0x4583a0);}};exports['newexten']=function(_0x4afa28){try{if(!_['isNil'](channels[_0x4afa28[_0xaa5a('0x7')]])){utils[_0xaa5a('0x1b')](util[_0xaa5a('0xa')]('[%s][calls][newexten]',_0x4afa28[_0xaa5a('0x7')]),_0x4afa28);utils[_0xaa5a('0x9')](util[_0xaa5a('0xa')](_0xaa5a('0x66'),_0x4afa28['uniqueid'],_0x4afa28[_0xaa5a('0x67')],_0x4afa28['appdata']));if(_0x4afa28[_0xaa5a('0x67')][_0xaa5a('0x68')]()=='set'&&_[_0xaa5a('0x69')](_0x4afa28['appdata'][_0xaa5a('0x68')](),_0xaa5a('0x6a'))){var _0x1e374d=_0x4afa28[_0xaa5a('0x6b')][_0xaa5a('0x6c')]('=');var _0x9c5c56=_0x1e374d[0x0]['substring'](_0x1e374d[0x0][_0xaa5a('0x6d')]('(')+0x1,_0x1e374d[0x0][_0xaa5a('0x6d')](')'));var _0x3fd5c9=_0x1e374d[0x1];channels[_0x4afa28[_0xaa5a('0x7')]][_0x9c5c56]=_0x3fd5c9;}if(!_['includes']([_0xaa5a('0x32'),'noop',_0xaa5a('0x6e'),_0xaa5a('0x6f'),'gotoif'],_0x4afa28[_0xaa5a('0x67')][_0xaa5a('0x68')]())){channels[_0x4afa28[_0xaa5a('0x7')]][_0xaa5a('0x5a')]=_0x4afa28[_0xaa5a('0x67')];channels[_0x4afa28['uniqueid']][_0xaa5a('0x5c')]=_0x4afa28[_0xaa5a('0x6b')];}}}catch(_0x11145a){utils[_0xaa5a('0x25')](util['format'](_0xaa5a('0x70'),_0x4afa28[_0xaa5a('0x7')]),_0x11145a);}}; \ No newline at end of file +var _0x7ad3=['[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%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:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','blinds','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','format','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','destinationchannel','answertime','toNumber','ANSWERED','error','debug','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel'];(function(_0x5581a8,_0x562798){var _0x23322b=function(_0x3176e6){while(--_0x3176e6){_0x5581a8['push'](_0x5581a8['shift']());}};_0x23322b(++_0x562798);}(_0x7ad3,0x108));var _0x37ad=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x7ad3[_0x5f0501];return _0x3c2c45;};'use strict';var _=require(_0x37ad('0x0'));var util=require(_0x37ad('0x1'));var utils=require(_0x37ad('0x2'));var transfers=require(_0x37ad('0x3'));var dispositions=['NO\x20ANSWER',_0x37ad('0x4'),'FAILED','NO\x20ANSWER',_0x37ad('0x5'),'NO\x20ANSWER','ANSWERED','BUSY',_0x37ad('0x4'),_0x37ad('0x4'),_0x37ad('0x4')];var channels={};function writeDB(_0x15cfb6){var _0xd8b0fe;if(transfers[_0x37ad('0x6')][_0x15cfb6[_0x37ad('0x7')]]){_0xd8b0fe=_0x15cfb6[_0x37ad('0x7')];_0x15cfb6[_0x37ad('0x7')]=transfers['blinds'][_0x15cfb6[_0x37ad('0x7')]]['transfereeuniqueid'];}utils['info'](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x15cfb6[_0x37ad('0x7')],_0x15cfb6[_0x37ad('0x8')],_0x15cfb6[_0x37ad('0x9')],_0x15cfb6[_0x37ad('0xa')],_0x15cfb6[_0x37ad('0xb')],_0x15cfb6[_0x37ad('0xc')],_0x15cfb6[_0x37ad('0xd')],_0x15cfb6[_0x37ad('0xe')]));if(_0x15cfb6[_0x37ad('0xf')]){utils[_0x37ad('0x10')](_0x15cfb6[_0x37ad('0xf')])['then'](function(_0x4af22b){if(_0x4af22b){_0x15cfb6[_0x37ad('0x11')]=_0x4af22b['id'];}utils[_0x37ad('0x12')]('CreateVoiceCallReport',_0x15cfb6);});}else{utils[_0x37ad('0x12')](_0x37ad('0x13'),_0x15cfb6);}if(channels[_0x15cfb6['uniqueid']]){delete channels[_0x15cfb6[_0x37ad('0x7')]];}else if(_0xd8b0fe&&channels[_0xd8b0fe]){if(!transfers[_0x37ad('0x6')][_0xd8b0fe]['recording'])delete transfers[_0x37ad('0x6')][_0xd8b0fe];delete channels[_0xd8b0fe];}}exports[_0x37ad('0x14')]=function(_0x3be7b7){try{utils['debug'](util[_0x37ad('0x15')](_0x37ad('0x16'),_0x3be7b7[_0x37ad('0x7')]),_0x3be7b7);if(_0x3be7b7['uniqueid']==_0x3be7b7[_0x37ad('0x17')]&&_0x3be7b7[_0x37ad('0x8')]!='OutgoingSpoolFailed'){utils[_0x37ad('0x18')](util[_0x37ad('0x15')](_0x37ad('0x19'),_0x3be7b7['uniqueid'],_0x3be7b7[_0x37ad('0x1a')],_0x3be7b7[_0x37ad('0x1b')]));channels[_0x3be7b7[_0x37ad('0x7')]]={'uniqueid':_0x3be7b7[_0x37ad('0x7')],'accountcode':_0x3be7b7[_0x37ad('0xf')],'source':_0x3be7b7['calleridnum'],'destination':_0x3be7b7[_0x37ad('0x1b')],'destinationcontext':_0x3be7b7[_0x37ad('0x1a')],'channel':_0x3be7b7[_0x37ad('0x8')],'starttime':utils[_0x37ad('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x37ad('0x1d')};}}catch(_0x1ad01a){utils['error'](util[_0x37ad('0x15')](_0x37ad('0x16'),_0x3be7b7[_0x37ad('0x7')]),_0x1ad01a);}};exports[_0x37ad('0x1e')]=function(_0x1e2f01){try{utils['debug'](util['format'](_0x37ad('0x1f'),_0x1e2f01[_0x37ad('0x7')]),_0x1e2f01);if(!_[_0x37ad('0x20')](channels[_0x1e2f01[_0x37ad('0x7')]])&&_0x1e2f01[_0x37ad('0x21')]==0x6){utils['info'](util[_0x37ad('0x15')](_0x37ad('0x22'),_0x1e2f01['uniqueid'],_0x1e2f01[_0x37ad('0x1a')],_0x1e2f01[_0x37ad('0x8')]));if(_['isNil'](channels[_0x1e2f01[_0x37ad('0x7')]]['systemanswertime'])){channels[_0x1e2f01[_0x37ad('0x7')]][_0x37ad('0x23')]=utils[_0x37ad('0x1c')]();}}else if(!_[_0x37ad('0x20')](channels[_0x1e2f01['linkedid']])&&_0x1e2f01[_0x37ad('0x21')]==0x6&&_0x1e2f01[_0x37ad('0x1a')]!='transfer'){utils[_0x37ad('0x18')](util[_0x37ad('0x15')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1e2f01[_0x37ad('0x7')],_0x1e2f01[_0x37ad('0x17')],_0x1e2f01[_0x37ad('0x1a')],_0x1e2f01[_0x37ad('0x8')]));channels[_0x1e2f01['linkedid']][_0x37ad('0xf')]=_0x1e2f01[_0x37ad('0xf')];channels[_0x1e2f01[_0x37ad('0x17')]][_0x37ad('0x24')]=_0x1e2f01[_0x37ad('0x8')];if(_[_0x37ad('0x20')](channels[_0x1e2f01['linkedid']][_0x37ad('0x25')])){channels[_0x1e2f01[_0x37ad('0x17')]][_0x37ad('0x25')]=utils['now']();}channels[_0x1e2f01[_0x37ad('0x17')]]['disposition']=dispositions[_[_0x37ad('0x26')](_0x1e2f01['channelstate'])]||_0x37ad('0x27');}}catch(_0x530964){utils[_0x37ad('0x28')](util[_0x37ad('0x15')]('[%s][calls][newstate]',_0x1e2f01['uniqueid']),_0x530964);}};exports['hangup']=function(_0x2a672e){try{if(!_[_0x37ad('0x20')](channels[_0x2a672e[_0x37ad('0x7')]])){utils[_0x37ad('0x29')](util[_0x37ad('0x15')](_0x37ad('0x2a'),_0x2a672e['uniqueid']),_0x2a672e);if(_['isNil'](channels[_0x2a672e[_0x37ad('0x7')]][_0x37ad('0x2b')])){channels[_0x2a672e[_0x37ad('0x7')]][_0x37ad('0x2b')]=_0x2a672e[_0x37ad('0x2c')]+'\x20<'+_0x2a672e[_0x37ad('0xc')]+'>';}utils['info'](util[_0x37ad('0x15')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x2a672e[_0x37ad('0x7')],channels[_0x2a672e[_0x37ad('0x7')]]['callerid'],_0x2a672e[_0x37ad('0x2d')]));channels[_0x2a672e['uniqueid']][_0x37ad('0x2e')]=utils['now']();channels[_0x2a672e[_0x37ad('0x7')]][_0x37ad('0x2f')]=utils['diffTime'](channels[_0x2a672e[_0x37ad('0x7')]][_0x37ad('0x2e')],channels[_0x2a672e[_0x37ad('0x7')]][_0x37ad('0x30')]);channels[_0x2a672e[_0x37ad('0x7')]][_0x37ad('0x31')]=channels[_0x2a672e[_0x37ad('0x7')]][_0x37ad('0x25')]?utils[_0x37ad('0x32')](channels[_0x2a672e['uniqueid']]['endtime'],channels[_0x2a672e[_0x37ad('0x7')]]['answertime']):0x0;writeDB(channels[_0x2a672e['uniqueid']]);}}catch(_0x1fc4b8){utils[_0x37ad('0x28')](util[_0x37ad('0x15')](_0x37ad('0x2a'),_0x2a672e[_0x37ad('0x7')]),_0x1fc4b8);}};exports[_0x37ad('0x33')]=function(_0x423766){try{if(!_[_0x37ad('0x20')](channels[_0x423766[_0x37ad('0x34')]])){utils[_0x37ad('0x29')](util[_0x37ad('0x15')](_0x37ad('0x35'),_0x423766[_0x37ad('0x36')]),_0x423766);if(channels[_0x423766['localtwolinkedid']]['channel']==_0x423766[_0x37ad('0x37')]){utils[_0x37ad('0x18')](util[_0x37ad('0x15')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x423766[_0x37ad('0x36')],_0x423766[_0x37ad('0x34')],_0x423766[_0x37ad('0x38')]));channels[_0x423766['localtwolinkedid']][_0x37ad('0x24')]=_0x423766['secondtransfererchannel'];channels[_0x423766[_0x37ad('0x34')]][_0x37ad('0x39')]=_0x37ad('0x3a');}else if(channels[_0x423766[_0x37ad('0x34')]][_0x37ad('0x8')]=_0x423766[_0x37ad('0x3b')]){utils[_0x37ad('0x18')](util[_0x37ad('0x15')](_0x37ad('0x3c'),_0x423766[_0x37ad('0x36')],_0x423766[_0x37ad('0x34')],_0x423766['origtransfererchannel']));channels[_0x423766[_0x37ad('0x34')]][_0x37ad('0x24')]=_0x423766[_0x37ad('0x3d')];channels[_0x423766[_0x37ad('0x34')]][_0x37ad('0x39')]=_0x37ad('0x3a');}}}catch(_0x446d63){utils[_0x37ad('0x28')](util[_0x37ad('0x15')](_0x37ad('0x35'),_0x423766['origtransfereruniqueid']),_0x446d63);}};exports[_0x37ad('0x3e')]=function(_0x29bebf){try{if(!_[_0x37ad('0x20')](channels[_0x29bebf[_0x37ad('0x7')]])){utils[_0x37ad('0x29')](util[_0x37ad('0x15')](_0x37ad('0x3f'),_0x29bebf[_0x37ad('0x7')]),_0x29bebf);channels[_0x29bebf[_0x37ad('0x7')]]['musiconholdstartAt']=utils[_0x37ad('0x1c')]();utils['info'](util[_0x37ad('0x15')](_0x37ad('0x40'),_0x29bebf[_0x37ad('0x7')],channels[_0x29bebf[_0x37ad('0x7')]][_0x37ad('0x41')]));}}catch(_0x39c619){utils[_0x37ad('0x28')](util[_0x37ad('0x15')](_0x37ad('0x3f'),_0x29bebf['uniqueid']),_0x39c619);}};exports['musiconholdstop']=function(_0x34f99d){try{if(!_[_0x37ad('0x20')](channels[_0x34f99d[_0x37ad('0x7')]])){utils[_0x37ad('0x29')](util[_0x37ad('0x15')](_0x37ad('0x42'),_0x34f99d['uniqueid']),_0x34f99d);if(!_['isNil'](channels[_0x34f99d[_0x37ad('0x7')]]['musiconholdstartAt'])){channels[_0x34f99d[_0x37ad('0x7')]][_0x37ad('0x43')]+=utils[_0x37ad('0x32')](utils['now'](),channels[_0x34f99d[_0x37ad('0x7')]][_0x37ad('0x41')]);utils[_0x37ad('0x18')](util[_0x37ad('0x15')](_0x37ad('0x44'),_0x34f99d['uniqueid'],channels[_0x34f99d[_0x37ad('0x7')]][_0x37ad('0x43')]));delete channels[_0x34f99d[_0x37ad('0x7')]][_0x37ad('0x41')];}}}catch(_0x41a69a){utils['error'](util['format'](_0x37ad('0x42'),_0x34f99d[_0x37ad('0x7')]),_0x41a69a);}};exports['varset']=function(_0x60d26f){try{if(!_[_0x37ad('0x20')](channels[_0x60d26f['uniqueid']])){utils[_0x37ad('0x29')](util[_0x37ad('0x15')](_0x37ad('0x45'),_0x60d26f[_0x37ad('0x7')]),_0x60d26f);if(!_[_0x37ad('0x20')](_0x60d26f[_0x37ad('0x46')][_0x37ad('0x47')])){utils[_0x37ad('0x18')](util[_0x37ad('0x15')](_0x37ad('0x48'),_0x60d26f[_0x37ad('0x7')],_0x60d26f[_0x37ad('0x49')]));channels[_0x60d26f['uniqueid']][_0x37ad('0x4a')]=_0x60d26f[_0x37ad('0x49')];}if(!_['isNil'](_0x60d26f[_0x37ad('0x46')][_0x37ad('0x4b')])){utils[_0x37ad('0x18')](util[_0x37ad('0x15')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x60d26f[_0x37ad('0x7')],_0x60d26f[_0x37ad('0x49')]));channels[_0x60d26f[_0x37ad('0x7')]][_0x37ad('0x4c')]=_0x60d26f['value'];channels[_0x60d26f[_0x37ad('0x7')]]['callerid']='\x22'+_0x60d26f[_0x37ad('0x49')]+_0x37ad('0x4d')+_0x60d26f[_0x37ad('0x49')]+'>';}if(!_[_0x37ad('0x20')](_0x60d26f['variable'][_0x37ad('0x4e')])||!_[_0x37ad('0x20')](_0x60d26f[_0x37ad('0x46')]['xmd-callerid'])){utils[_0x37ad('0x18')](util[_0x37ad('0x15')](_0x37ad('0x4f'),_0x60d26f[_0x37ad('0x7')],!_[_0x37ad('0x20')](_0x60d26f[_0x37ad('0x46')]['xmd-callerid-preview'])?_0x37ad('0x4e'):_0x37ad('0x50'),_0x60d26f[_0x37ad('0x49')]));channels[_0x60d26f[_0x37ad('0x7')]][_0x37ad('0x2b')]=_0x60d26f[_0x37ad('0x49')];}if(!_[_0x37ad('0x20')](_0x60d26f['variable'][_0x37ad('0x51')])||!_[_0x37ad('0x20')](_0x60d26f[_0x37ad('0x46')][_0x37ad('0x52')])){utils[_0x37ad('0x18')](util[_0x37ad('0x15')](_0x37ad('0x4f'),_0x60d26f[_0x37ad('0x7')],!_[_0x37ad('0x20')](_0x60d26f[_0x37ad('0x46')][_0x37ad('0x51')])?'xmd-queue':_0x37ad('0x52'),_0x60d26f[_0x37ad('0x49')]));channels[_0x60d26f[_0x37ad('0x7')]][_0x37ad('0x53')]=_0x37ad('0x54');channels[_0x60d26f['uniqueid']][_0x37ad('0x55')]=_0x60d26f[_0x37ad('0x49')];channels[_0x60d26f[_0x37ad('0x7')]][_0x37ad('0x9')]=!![];}if(!_[_0x37ad('0x20')](_0x60d26f[_0x37ad('0x46')]['xmd-contactid'])){utils['info'](util[_0x37ad('0x15')](_0x37ad('0x56'),_0x60d26f[_0x37ad('0x7')],_0x60d26f[_0x37ad('0x49')]));channels[_0x60d26f[_0x37ad('0x7')]][_0x37ad('0x57')]=_0x60d26f['value'];}if(!_['isNil'](_0x60d26f['variable'][_0x37ad('0x58')])){utils[_0x37ad('0x18')](util['format'](_0x37ad('0x59'),_0x60d26f['uniqueid'],_0x60d26f[_0x37ad('0x49')]));channels[_0x60d26f[_0x37ad('0x7')]][_0x37ad('0x5a')]=_0x60d26f[_0x37ad('0x49')];}if(!_['isNil'](_0x60d26f['variable'][_0x37ad('0x5b')])){utils[_0x37ad('0x18')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x60d26f[_0x37ad('0x7')],_0x60d26f[_0x37ad('0x49')]));channels[_0x60d26f[_0x37ad('0x7')]]['routeid']=_0x60d26f['value'];}if(!_[_0x37ad('0x20')](_0x60d26f[_0x37ad('0x46')]['sipcallid'])){utils['info'](util['format'](_0x37ad('0x5c'),_0x60d26f[_0x37ad('0x7')],_0x60d26f[_0x37ad('0x49')]));channels[_0x60d26f[_0x37ad('0x7')]]['sipcallid']=_0x60d26f['value'];}}}catch(_0x75eb7a){utils[_0x37ad('0x28')](util[_0x37ad('0x15')]('[%s][calls][varset]',_0x60d26f[_0x37ad('0x7')]),_0x75eb7a);}};exports['newexten']=function(_0x5b53f1){try{if(!_[_0x37ad('0x20')](channels[_0x5b53f1['uniqueid']])){utils[_0x37ad('0x29')](util[_0x37ad('0x15')](_0x37ad('0x5d'),_0x5b53f1[_0x37ad('0x7')]),_0x5b53f1);utils['info'](util[_0x37ad('0x15')](_0x37ad('0x5e'),_0x5b53f1['uniqueid'],_0x5b53f1[_0x37ad('0x5f')],_0x5b53f1[_0x37ad('0x60')]));if(_0x5b53f1['application'][_0x37ad('0x61')]()==_0x37ad('0x62')&&_[_0x37ad('0x63')](_0x5b53f1[_0x37ad('0x60')][_0x37ad('0x61')](),_0x37ad('0x64'))){var _0x352273=_0x5b53f1[_0x37ad('0x60')]['split']('=');var _0x281d7d=_0x352273[0x0][_0x37ad('0x65')](_0x352273[0x0][_0x37ad('0x66')]('(')+0x1,_0x352273[0x0][_0x37ad('0x66')](')'));var _0x5ec40e=_0x352273[0x1];channels[_0x5b53f1[_0x37ad('0x7')]][_0x281d7d]=_0x5ec40e;}if(!_[_0x37ad('0x67')]([_0x37ad('0x68'),_0x37ad('0x69'),_0x37ad('0x6a'),'set',_0x37ad('0x6b')],_0x5b53f1[_0x37ad('0x5f')][_0x37ad('0x61')]())){channels[_0x5b53f1[_0x37ad('0x7')]]['lastapplication']=_0x5b53f1[_0x37ad('0x5f')];channels[_0x5b53f1[_0x37ad('0x7')]][_0x37ad('0x55')]=_0x5b53f1['appdata'];}}}catch(_0x4ec6da){utils['error'](util[_0x37ad('0x15')](_0x37ad('0x5d'),_0x5b53f1[_0x37ad('0x7')]),_0x4ec6da);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1379403..3d6ea66 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 _0xd468=['shutdown','error','[core]\x20error','close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x2a363d,_0x249fc5){var _0x286633=function(_0x1d40e6){while(--_0x1d40e6){_0x2a363d['push'](_0x2a363d['shift']());}};_0x286633(++_0x249fc5);}(_0xd468,0x11c));var _0x8d46=function(_0x5827d3,_0x309974){_0x5827d3=_0x5827d3-0x0;var _0x19059a=_0xd468[_0x5827d3];return _0x19059a;};'use strict';var utils=require(_0x8d46('0x0'));exports[_0x8d46('0x1')]=function(){utils[_0x8d46('0x2')](_0x8d46('0x3'));};exports[_0x8d46('0x4')]=function(){utils['info']('[core]\x20shutdown');};exports['fullybooted']=function(){utils['info']('[core]\x20fullybooted');};exports[_0x8d46('0x5')]=function(_0x1b2cdd){utils[_0x8d46('0x5')](_0x8d46('0x6'),_0x1b2cdd);};exports[_0x8d46('0x7')]=function(){utils[_0x8d46('0x2')]('[core]\x20close');};exports[_0x8d46('0x8')]=function(_0x384795){}; \ No newline at end of file +var _0xf2fe=['[core]\x20connected','info','[core]\x20shutdown','fullybooted','error','close','[core]\x20close','connect'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0xf2fe,0x107));var _0xef2f=function(_0x57c87a,_0x1ddbd3){_0x57c87a=_0x57c87a-0x0;var _0x192805=_0xf2fe[_0x57c87a];return _0x192805;};'use strict';var utils=require('./utils');exports[_0xef2f('0x0')]=function(){utils['info'](_0xef2f('0x1'));};exports['shutdown']=function(){utils[_0xef2f('0x2')](_0xef2f('0x3'));};exports[_0xef2f('0x4')]=function(){utils[_0xef2f('0x2')]('[core]\x20fullybooted');};exports[_0xef2f('0x5')]=function(_0x3fc1a6){utils[_0xef2f('0x5')]('[core]\x20error',_0x3fc1a6);};exports[_0xef2f('0x6')]=function(){utils[_0xef2f('0x2')](_0xef2f('0x7'));};exports['managerevent']=function(_0xcd401e){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 0f3e9ab..5893b11 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 _0x2c15=['debug','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','holdtime','endtime','billableseconds','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr(routeid)','split','error','varset'];(function(_0x81d554,_0x23537d){var _0x3e46d2=function(_0x30ad48){while(--_0x30ad48){_0x81d554['push'](_0x81d554['shift']());}};_0x3e46d2(++_0x23537d);}(_0x2c15,0xef));var _0x52c1=function(_0x493edd,_0x1e7627){_0x493edd=_0x493edd-0x0;var _0x33ec30=_0x2c15[_0x493edd];return _0x33ec30;};'use strict';var _=require('lodash');var util=require(_0x52c1('0x0'));var utils=require(_0x52c1('0x1'));var dials={};function writeDB(_0x5a9c20){utils[_0x52c1('0x2')](util['format'](_0x52c1('0x3'),_0x5a9c20['uniqueid'],_0x5a9c20['channel'],_0x5a9c20['dialstring'],_0x5a9c20[_0x52c1('0x4')],_0x5a9c20['connectedlinenum'],_0x5a9c20[_0x52c1('0x5')]));utils[_0x52c1('0x6')](_0x52c1('0x7'),_0x5a9c20);delete dials[_0x5a9c20[_0x52c1('0x8')]];}exports[_0x52c1('0x9')]=function(_0x5eab91){try{utils['debug'](util[_0x52c1('0xa')](_0x52c1('0xb'),_0x5eab91[_0x52c1('0x8')]),_0x5eab91);utils[_0x52c1('0x2')](util[_0x52c1('0xa')](_0x52c1('0xc'),_0x5eab91[_0x52c1('0x8')],_0x5eab91[_0x52c1('0xd')],_0x5eab91['appdata']));if(_0x5eab91[_0x52c1('0xd')][_0x52c1('0xe')]()==_0x52c1('0xf')&&_['startsWith'](_0x5eab91[_0x52c1('0x10')][_0x52c1('0xe')](),_0x52c1('0x11'))){var _0x3cc78d=_0x5eab91[_0x52c1('0x10')][_0x52c1('0x12')]('=');dials[_0x5eab91['uniqueid']]={'routeId':_0x3cc78d[0x1]};}}catch(_0x1f1c6c){utils[_0x52c1('0x13')](util[_0x52c1('0xa')](_0x52c1('0xb'),_0x5eab91[_0x52c1('0x8')]),_0x1f1c6c);}};exports[_0x52c1('0x14')]=function(_0x50844b){try{utils[_0x52c1('0x15')](util[_0x52c1('0xa')](_0x52c1('0x16'),_0x50844b[_0x52c1('0x8')]),_0x50844b);if(!_[_0x52c1('0x17')](_0x50844b[_0x52c1('0x18')]['outboundrouteid'])){utils['info'](util[_0x52c1('0xa')](_0x52c1('0x19'),_0x50844b[_0x52c1('0x8')],_0x50844b[_0x52c1('0x1a')]));dials[_0x50844b['uniqueid']]={'routeId':_0x50844b[_0x52c1('0x1a')]};}}catch(_0x21f260){utils[_0x52c1('0x13')](util['format'](_0x52c1('0x16'),_0x50844b[_0x52c1('0x8')]),_0x21f260);}};exports[_0x52c1('0x1b')]=function(_0x2746de){try{if(!_[_0x52c1('0x17')](dials[_0x2746de['uniqueid']])){utils['debug'](util[_0x52c1('0xa')](_0x52c1('0x1c'),_0x2746de[_0x52c1('0x8')]),_0x2746de);dials[_0x2746de['uniqueid']]=_['assign'](dials[_0x2746de[_0x52c1('0x8')]],_0x2746de);dials[_0x2746de[_0x52c1('0x8')]][_0x52c1('0x1d')]=utils[_0x52c1('0x1e')]();dials[_0x2746de[_0x52c1('0x8')]][_0x52c1('0x1f')]=_0x52c1('0x20');utils[_0x52c1('0x2')](util['format'](_0x52c1('0x21'),_0x2746de[_0x52c1('0x8')],dials[_0x2746de[_0x52c1('0x8')]][_0x52c1('0x1d')]));}}catch(_0x1ccba2){utils[_0x52c1('0x13')](util[_0x52c1('0xa')](_0x52c1('0x1c'),_0x2746de['uniqueid']),_0x1ccba2);}};exports[_0x52c1('0x22')]=function(_0x42038f){try{if(!_['isNil'](dials[_0x42038f[_0x52c1('0x8')]])){utils['debug'](util[_0x52c1('0xa')](_0x52c1('0x23'),_0x42038f[_0x52c1('0x8')]),_0x42038f);dials[_0x42038f[_0x52c1('0x8')]][_0x52c1('0x5')]=_0x42038f[_0x52c1('0x5')];if(_0x42038f[_0x52c1('0x5')]==_0x52c1('0x24')){dials[_0x42038f['uniqueid']]=_[_0x52c1('0x25')](dials[_0x42038f[_0x52c1('0x8')]],_0x42038f);dials[_0x42038f['uniqueid']][_0x52c1('0x26')]=utils[_0x52c1('0x1e')]();dials[_0x42038f[_0x52c1('0x8')]][_0x52c1('0x1f')]=_0x52c1('0x27');utils[_0x52c1('0x2')](util[_0x52c1('0xa')](_0x52c1('0x28'),_0x42038f[_0x52c1('0x8')],_0x42038f['dialstatus'],dials[_0x42038f[_0x52c1('0x8')]][_0x52c1('0x26')]));}else{utils['info'](util[_0x52c1('0xa')](_0x52c1('0x29'),_0x42038f[_0x52c1('0x8')],_0x42038f[_0x52c1('0x5')]));}}}catch(_0x12eb40){utils[_0x52c1('0x13')](util[_0x52c1('0xa')](_0x52c1('0x23'),_0x42038f[_0x52c1('0x8')]),_0x12eb40);}};exports[_0x52c1('0x2a')]=function(_0x15df43){try{if(!_[_0x52c1('0x17')](dials[_0x15df43['uniqueid']])){utils[_0x52c1('0x15')](util[_0x52c1('0xa')](_0x52c1('0x2b'),_0x15df43[_0x52c1('0x8')]),_0x15df43);utils[_0x52c1('0x2')](util['format'](_0x52c1('0x2c'),_0x15df43[_0x52c1('0x8')],_0x15df43[_0x52c1('0x4')],_0x15df43[_0x52c1('0x2d')],_0x15df43[_0x52c1('0x2e')]));dials[_0x15df43[_0x52c1('0x8')]]=_['assign'](dials[_0x15df43['uniqueid']],{'endtime':utils[_0x52c1('0x1e')](),'lastevent':'complete'});dials[_0x15df43[_0x52c1('0x8')]][_0x52c1('0x2f')]=utils[_0x52c1('0x30')](dials[_0x15df43[_0x52c1('0x8')]]['endtime'],dials[_0x15df43[_0x52c1('0x8')]]['starttime']);dials[_0x15df43[_0x52c1('0x8')]][_0x52c1('0x31')]=utils['diffTime'](dials[_0x15df43[_0x52c1('0x8')]]['answertime']||dials[_0x15df43[_0x52c1('0x8')]][_0x52c1('0x32')],dials[_0x15df43[_0x52c1('0x8')]][_0x52c1('0x1d')]);dials[_0x15df43[_0x52c1('0x8')]][_0x52c1('0x33')]=dials[_0x15df43[_0x52c1('0x8')]]['answertime']?utils[_0x52c1('0x30')](dials[_0x15df43['uniqueid']]['endtime'],dials[_0x15df43[_0x52c1('0x8')]][_0x52c1('0x26')]):0x0;writeDB(dials[_0x15df43['uniqueid']]);}}catch(_0x596b0e){utils['error'](util[_0x52c1('0xa')](_0x52c1('0x2b'),_0x15df43[_0x52c1('0x8')]),_0x596b0e);}}; \ No newline at end of file +var _0xd0e7=['dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','dialend','[%s][dials][dialend]','ANSWER','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','endtime','billableseconds','diffTime','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xd0e7,0x13b));var _0x7d0e=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xd0e7[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x7d0e('0x0'));var util=require(_0x7d0e('0x1'));var utils=require(_0x7d0e('0x2'));var dials={};function writeDB(_0x3ad1d1){utils['info'](util[_0x7d0e('0x3')](_0x7d0e('0x4'),_0x3ad1d1[_0x7d0e('0x5')],_0x3ad1d1['channel'],_0x3ad1d1[_0x7d0e('0x6')],_0x3ad1d1[_0x7d0e('0x7')],_0x3ad1d1[_0x7d0e('0x8')],_0x3ad1d1[_0x7d0e('0x9')]));utils[_0x7d0e('0xa')](_0x7d0e('0xb'),_0x3ad1d1);delete dials[_0x3ad1d1[_0x7d0e('0x5')]];}exports['newexten']=function(_0x5138bf){try{utils[_0x7d0e('0xc')](util[_0x7d0e('0x3')](_0x7d0e('0xd'),_0x5138bf[_0x7d0e('0x5')]),_0x5138bf);utils[_0x7d0e('0xe')](util['format'](_0x7d0e('0xf'),_0x5138bf[_0x7d0e('0x5')],_0x5138bf[_0x7d0e('0x10')],_0x5138bf[_0x7d0e('0x11')]));if(_0x5138bf['application']['toLowerCase']()==_0x7d0e('0x12')&&_[_0x7d0e('0x13')](_0x5138bf['appdata']['toLowerCase'](),_0x7d0e('0x14'))){var _0x598451=_0x5138bf['appdata'][_0x7d0e('0x15')]('=');dials[_0x5138bf[_0x7d0e('0x5')]]={'routeId':_0x598451[0x1]};}}catch(_0x138fd6){utils['error'](util[_0x7d0e('0x3')](_0x7d0e('0xd'),_0x5138bf[_0x7d0e('0x5')]),_0x138fd6);}};exports[_0x7d0e('0x16')]=function(_0x4b1606){try{utils[_0x7d0e('0xc')](util[_0x7d0e('0x3')](_0x7d0e('0x17'),_0x4b1606[_0x7d0e('0x5')]),_0x4b1606);if(!_[_0x7d0e('0x18')](_0x4b1606[_0x7d0e('0x19')][_0x7d0e('0x1a')])){utils[_0x7d0e('0xe')](util[_0x7d0e('0x3')](_0x7d0e('0x1b'),_0x4b1606[_0x7d0e('0x5')],_0x4b1606[_0x7d0e('0x1c')]));dials[_0x4b1606[_0x7d0e('0x5')]]={'routeId':_0x4b1606[_0x7d0e('0x1c')]};}}catch(_0x49a36f){utils['error'](util[_0x7d0e('0x3')](_0x7d0e('0x17'),_0x4b1606[_0x7d0e('0x5')]),_0x49a36f);}};exports[_0x7d0e('0x1d')]=function(_0x5ec2b0){try{if(!_[_0x7d0e('0x18')](dials[_0x5ec2b0['uniqueid']])){utils[_0x7d0e('0xc')](util[_0x7d0e('0x3')](_0x7d0e('0x1e'),_0x5ec2b0[_0x7d0e('0x5')]),_0x5ec2b0);dials[_0x5ec2b0[_0x7d0e('0x5')]]=_[_0x7d0e('0x1f')](dials[_0x5ec2b0[_0x7d0e('0x5')]],_0x5ec2b0);dials[_0x5ec2b0[_0x7d0e('0x5')]][_0x7d0e('0x20')]=utils[_0x7d0e('0x21')]();dials[_0x5ec2b0[_0x7d0e('0x5')]]['lastevent']=_0x7d0e('0x22');utils['info'](util[_0x7d0e('0x3')](_0x7d0e('0x23'),_0x5ec2b0['uniqueid'],dials[_0x5ec2b0[_0x7d0e('0x5')]]['starttime']));}}catch(_0x521b68){utils[_0x7d0e('0x24')](util[_0x7d0e('0x3')]('[%s][dials][dialbegin]',_0x5ec2b0[_0x7d0e('0x5')]),_0x521b68);}};exports[_0x7d0e('0x25')]=function(_0x10a45f){try{if(!_[_0x7d0e('0x18')](dials[_0x10a45f['uniqueid']])){utils[_0x7d0e('0xc')](util[_0x7d0e('0x3')](_0x7d0e('0x26'),_0x10a45f[_0x7d0e('0x5')]),_0x10a45f);dials[_0x10a45f['uniqueid']][_0x7d0e('0x9')]=_0x10a45f[_0x7d0e('0x9')];if(_0x10a45f['dialstatus']==_0x7d0e('0x27')){dials[_0x10a45f[_0x7d0e('0x5')]]=_['assign'](dials[_0x10a45f[_0x7d0e('0x5')]],_0x10a45f);dials[_0x10a45f[_0x7d0e('0x5')]][_0x7d0e('0x28')]=utils['now']();dials[_0x10a45f[_0x7d0e('0x5')]][_0x7d0e('0x29')]=_0x7d0e('0x2a');utils[_0x7d0e('0xe')](util['format'](_0x7d0e('0x2b'),_0x10a45f[_0x7d0e('0x5')],_0x10a45f[_0x7d0e('0x9')],dials[_0x10a45f[_0x7d0e('0x5')]][_0x7d0e('0x28')]));}else{utils[_0x7d0e('0xe')](util['format'](_0x7d0e('0x2c'),_0x10a45f[_0x7d0e('0x5')],_0x10a45f[_0x7d0e('0x9')]));}}}catch(_0x1bed26){utils[_0x7d0e('0x24')](util[_0x7d0e('0x3')](_0x7d0e('0x26'),_0x10a45f[_0x7d0e('0x5')]),_0x1bed26);}};exports[_0x7d0e('0x2d')]=function(_0x2f40c5){try{if(!_['isNil'](dials[_0x2f40c5[_0x7d0e('0x5')]])){utils['debug'](util[_0x7d0e('0x3')](_0x7d0e('0x2e'),_0x2f40c5[_0x7d0e('0x5')]),_0x2f40c5);utils['info'](util[_0x7d0e('0x3')](_0x7d0e('0x2f'),_0x2f40c5[_0x7d0e('0x5')],_0x2f40c5[_0x7d0e('0x7')],_0x2f40c5[_0x7d0e('0x30')],_0x2f40c5[_0x7d0e('0x31')]));dials[_0x2f40c5[_0x7d0e('0x5')]]=_[_0x7d0e('0x1f')](dials[_0x2f40c5[_0x7d0e('0x5')]],{'endtime':utils[_0x7d0e('0x21')](),'lastevent':'complete'});dials[_0x2f40c5['uniqueid']][_0x7d0e('0x32')]=utils['diffTime'](dials[_0x2f40c5[_0x7d0e('0x5')]][_0x7d0e('0x33')],dials[_0x2f40c5[_0x7d0e('0x5')]][_0x7d0e('0x20')]);dials[_0x2f40c5['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x2f40c5[_0x7d0e('0x5')]]['answertime']||dials[_0x2f40c5[_0x7d0e('0x5')]][_0x7d0e('0x33')],dials[_0x2f40c5[_0x7d0e('0x5')]]['starttime']);dials[_0x2f40c5['uniqueid']][_0x7d0e('0x34')]=dials[_0x2f40c5['uniqueid']][_0x7d0e('0x28')]?utils[_0x7d0e('0x35')](dials[_0x2f40c5[_0x7d0e('0x5')]][_0x7d0e('0x33')],dials[_0x2f40c5[_0x7d0e('0x5')]][_0x7d0e('0x28')]):0x0;writeDB(dials[_0x2f40c5[_0x7d0e('0x5')]]);}}catch(_0x546501){utils[_0x7d0e('0x24')](util[_0x7d0e('0x3')](_0x7d0e('0x2e'),_0x2f40c5['uniqueid']),_0x546501);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index fc3e41f..703f168 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 _0xd41e=['attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','asterisk','port','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd41e,0x95));var _0xed41=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0xd41e[_0x44fef1];return _0x3c3a04;};var AsteriskManager=require(_0xed41('0x0'));var config=require(_0xed41('0x1'));var utils=require(_0xed41('0x2'));var util=require(_0xed41('0x3'));var isXDREnabled=config[_0xed41('0x4')]&&config[_0xed41('0x4')][_0xed41('0x5')]?!config['xdr'][_0xed41('0x5')]:!![];var isProduction=config['env']===_0xed41('0x6')||![];var isLocalAsterisk=config[_0xed41('0x4')]&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0xed41('0x7')][_0xed41('0x8')],config[_0xed41('0x7')]['ip'],config[_0xed41('0x7')]['username'],config[_0xed41('0x7')][_0xed41('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xed41('0xa')](_0xed41('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xed41('0xa')](_0xed41('0xc'));}else{var agents=require(_0xed41('0xd'));var calls=require(_0xed41('0xe'));var queues=require(_0xed41('0xf'));var recordings=require(_0xed41('0x10'));var members=require(_0xed41('0x11'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xed41('0x12'));ami['on'](_0xed41('0x13'),core[_0xed41('0x13')]);ami['on'](_0xed41('0x14'),core['shutdown']);ami['on'](_0xed41('0x15'),core[_0xed41('0x15')]);ami['on'](_0xed41('0x16'),core[_0xed41('0x16')]);ami['on'](_0xed41('0x17'),core['close']);ami['on'](_0xed41('0x18'),core[_0xed41('0x18')]);ami['on'](_0xed41('0x19'),function(_0x265fb2){try{utils['debug'](util['format'](_0xed41('0x1a'),_0x265fb2[_0xed41('0x1b')]),_0x265fb2);members[_0xed41('0x19')](_0x265fb2);}catch(_0x572e06){utils['error'](util[_0xed41('0x1c')](_0xed41('0x1a'),_0x265fb2[_0xed41('0x1b')]),_0x572e06);}});ami['on'](_0xed41('0x1d'),function(_0xc2fdd8){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')](_0xed41('0x1f'),_0xc2fdd8[_0xed41('0x20')]),_0xc2fdd8);agents[_0xed41('0x1d')](_0xc2fdd8);}catch(_0x1de5e8){utils[_0xed41('0x16')](util['format']('[%s][index][agentcalled]',_0xc2fdd8[_0xed41('0x20')]),_0x1de5e8);}});ami['on']('agentringnoanswer',function(_0x188795){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')]('[%s][index][agentringnoanswer]',_0x188795['uniqueid']),_0x188795);agents[_0xed41('0x21')](_0x188795);}catch(_0x369e53){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x22'),_0x188795['uniqueid']),_0x369e53);}});ami['on']('agentconnect',function(_0x16f404){try{utils[_0xed41('0x1e')](util['format'](_0xed41('0x23'),_0x16f404[_0xed41('0x20')]),_0x16f404);agents[_0xed41('0x24')](_0x16f404);queues[_0xed41('0x24')](_0x16f404);}catch(_0x519fa3){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x23'),_0x16f404[_0xed41('0x20')]),_0x519fa3);}});ami['on'](_0xed41('0x25'),function(_0x40d202){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')](_0xed41('0x26'),_0x40d202[_0xed41('0x20')]),_0x40d202);agents[_0xed41('0x25')](_0x40d202);queues[_0xed41('0x25')](_0x40d202);members[_0xed41('0x25')](_0x40d202);}catch(_0x3402f8){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x26'),_0x40d202['uniqueid']),_0x3402f8);}});ami['on'](_0xed41('0x27'),function(_0x51005b){try{utils[_0xed41('0x1e')](util['format'](_0xed41('0x28'),_0x51005b[_0xed41('0x20')]),_0x51005b);agents[_0xed41('0x27')](_0x51005b);queues[_0xed41('0x27')](_0x51005b);}catch(_0x245f65){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x28'),_0x51005b[_0xed41('0x20')]),_0x245f65);}});ami['on'](_0xed41('0x29'),function(_0x2f0211){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')](_0xed41('0x2a'),_0x2f0211[_0xed41('0x20')]),_0x2f0211);queues[_0xed41('0x29')](_0x2f0211);recordings['queuecallerjoin'](_0x2f0211);}catch(_0xfd4958){utils[_0xed41('0x16')](util[_0xed41('0x1c')]('[%s][index][queuecallerjoin]',_0x2f0211[_0xed41('0x20')]),_0xfd4958);}});ami['on'](_0xed41('0x2b'),function(_0x926be6){try{utils[_0xed41('0x1e')](util['format']('[%s][index][queuecallerleave]',_0x926be6['uniqueid']),_0x926be6);queues[_0xed41('0x2b')](_0x926be6);}catch(_0x39d42e){utils[_0xed41('0x16')](util[_0xed41('0x1c')]('[%s][index][queuecallerleave]',_0x926be6[_0xed41('0x20')]),_0x39d42e);}});ami['on'](_0xed41('0x2c'),function(_0x37694c){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')](_0xed41('0x2d'),_0x37694c[_0xed41('0x20')]),_0x37694c);queues[_0xed41('0x2c')](_0x37694c);calls[_0xed41('0x2c')](_0x37694c);}catch(_0x55f93a){utils[_0xed41('0x16')](util[_0xed41('0x1c')]('[%s][index][musiconholdstart]',_0x37694c['uniqueid']),_0x55f93a);}});ami['on'](_0xed41('0x2e'),function(_0x29a9b6){try{utils['debug'](util[_0xed41('0x1c')]('[%s][index][musiconholdstop]',_0x29a9b6[_0xed41('0x20')]),_0x29a9b6);queues[_0xed41('0x2e')](_0x29a9b6);calls[_0xed41('0x2e')](_0x29a9b6);}catch(_0x383e27){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x2f'),_0x29a9b6[_0xed41('0x20')]),_0x383e27);}});ami['on']('newstate',function(_0x194ac2){try{utils[_0xed41('0x1e')](util['format']('[%s][index][newstate]',_0x194ac2[_0xed41('0x20')]),_0x194ac2);calls['newstate'](_0x194ac2);recordings[_0xed41('0x30')](_0x194ac2);}catch(_0x3a03cf){utils[_0xed41('0x16')](util[_0xed41('0x1c')]('[%s][index][newstate]',_0x194ac2[_0xed41('0x20')]),_0x3a03cf);}});ami['on']('hangup',function(_0x4826b2){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')](_0xed41('0x31'),_0x4826b2['uniqueid']),_0x4826b2);calls[_0xed41('0x32')](_0x4826b2);recordings[_0xed41('0x32')](_0x4826b2);dials[_0xed41('0x32')](_0x4826b2);agents['hangup'](_0x4826b2);queues['hangup'](_0x4826b2);}catch(_0x2f8a6e){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x31'),_0x4826b2[_0xed41('0x20')]),_0x2f8a6e);}});ami['on'](_0xed41('0x33'),function(_0x6e5d6c){try{utils['debug'](util[_0xed41('0x1c')]('[%s][index][cdr]',_0x6e5d6c[_0xed41('0x20')]),_0x6e5d6c);members[_0xed41('0x33')](_0x6e5d6c);}catch(_0x18dc89){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x34'),_0x6e5d6c[_0xed41('0x20')]),_0x18dc89);}});ami['on'](_0xed41('0x35'),function(_0x2a7c43){try{utils[_0xed41('0x1e')](util['format'](_0xed41('0x36'),_0x2a7c43[_0xed41('0x20')]),_0x2a7c43);queues['blindtransfer'](_0x2a7c43);agents[_0xed41('0x35')](_0x2a7c43);transfers[_0xed41('0x35')](_0x2a7c43);recordings[_0xed41('0x35')](_0x2a7c43);}catch(_0x352f39){utils[_0xed41('0x16')](util['format'](_0xed41('0x36'),_0x2a7c43[_0xed41('0x20')]),_0x352f39);}});ami['on'](_0xed41('0x37'),function(_0x4ce58e){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')](_0xed41('0x38'),_0x4ce58e[_0xed41('0x39')]),_0x4ce58e);queues[_0xed41('0x37')](_0x4ce58e);transfers[_0xed41('0x37')](_0x4ce58e);agents[_0xed41('0x37')](_0x4ce58e);calls['attendedtransfer'](_0x4ce58e);}catch(_0x444dbc){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x38'),_0x4ce58e[_0xed41('0x39')]),_0x444dbc);}});ami['on'](_0xed41('0x3a'),function(_0x1eb0d6){try{utils[_0xed41('0x1e')](util['format'](_0xed41('0x3b'),_0x1eb0d6[_0xed41('0x20')]),_0x1eb0d6);queues[_0xed41('0x3a')](_0x1eb0d6);recordings[_0xed41('0x3a')](_0x1eb0d6);calls[_0xed41('0x3a')](_0x1eb0d6);dials[_0xed41('0x3a')](_0x1eb0d6);}catch(_0x282225){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x3b'),_0x1eb0d6[_0xed41('0x20')]),_0x282225);}});ami['on'](_0xed41('0x3c'),function(_0x9aae0c){try{utils['debug'](util[_0xed41('0x1c')]('[%s][index][newexten]',_0x9aae0c[_0xed41('0x20')]),_0x9aae0c);calls[_0xed41('0x3c')](_0x9aae0c);recordings[_0xed41('0x3c')](_0x9aae0c);dials['newexten'](_0x9aae0c);}catch(_0x542def){utils['error'](util['format'](_0xed41('0x3d'),_0x9aae0c['uniqueid']),_0x542def);}});ami['on']('newchannel',function(_0x238e07){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')](_0xed41('0x3e'),_0x238e07[_0xed41('0x20')]),_0x238e07);calls[_0xed41('0x3f')](_0x238e07);recordings[_0xed41('0x3f')](_0x238e07);}catch(_0x5c6625){utils['error'](util['format'](_0xed41('0x3e'),_0x238e07[_0xed41('0x20')]),_0x5c6625);}});ami['on'](_0xed41('0x40'),function(_0x4bc866){try{utils[_0xed41('0x1e')](util[_0xed41('0x1c')](_0xed41('0x41'),_0x4bc866[_0xed41('0x20')]),_0x4bc866);dials['dialbegin'](_0x4bc866);}catch(_0x142db3){utils['error'](util[_0xed41('0x1c')]('[%s]dialbegin',_0x4bc866[_0xed41('0x20')]),_0x142db3);}});ami['on'](_0xed41('0x42'),function(_0x5d6f2c){try{utils['debug'](util['format'](_0xed41('0x43'),_0x5d6f2c['uniqueid']),_0x5d6f2c);dials['dialend'](_0x5d6f2c);}catch(_0x45c70b){utils[_0xed41('0x16')](util[_0xed41('0x1c')](_0xed41('0x43'),_0x5d6f2c['uniqueid']),_0x45c70b);}});} \ No newline at end of file +var _0x5a71=['password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','agentcalled','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','util','xdr','disabled','env','production','local','asterisk','port'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x5a71,0x15a));var _0x15a7=function(_0x2b01ad,_0x100a22){_0x2b01ad=_0x2b01ad-0x0;var _0x3d363e=_0x5a71[_0x2b01ad];return _0x3d363e;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x15a7('0x0'));var util=require(_0x15a7('0x1'));var isXDREnabled=config[_0x15a7('0x2')]&&config['xdr'][_0x15a7('0x3')]?!config[_0x15a7('0x2')][_0x15a7('0x3')]:!![];var isProduction=config[_0x15a7('0x4')]===_0x15a7('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0x15a7('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x15a7('0x7')][_0x15a7('0x8')],config[_0x15a7('0x7')]['ip'],config[_0x15a7('0x7')]['username'],config[_0x15a7('0x7')][_0x15a7('0x9')],!![]);ami[_0x15a7('0xa')]();if(!isXDREnabled){utils[_0x15a7('0xb')](_0x15a7('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x15a7('0xb')](_0x15a7('0xd'));}else{var agents=require(_0x15a7('0xe'));var calls=require('./calls.controller');var queues=require(_0x15a7('0xf'));var recordings=require(_0x15a7('0x10'));var members=require(_0x15a7('0x11'));var dials=require(_0x15a7('0x12'));var transfers=require(_0x15a7('0x13'));var core=require(_0x15a7('0x14'));ami['on'](_0x15a7('0x15'),core[_0x15a7('0x15')]);ami['on']('shutdown',core[_0x15a7('0x16')]);ami['on'](_0x15a7('0x17'),core['fullybooted']);ami['on']('error',core[_0x15a7('0x18')]);ami['on']('close',core[_0x15a7('0x19')]);ami['on']('managerevent',core[_0x15a7('0x1a')]);ami['on'](_0x15a7('0x1b'),function(_0x502d28){try{utils[_0x15a7('0x1c')](util['format'](_0x15a7('0x1d'),_0x502d28['device']),_0x502d28);members[_0x15a7('0x1b')](_0x502d28);}catch(_0x5f09fb){utils[_0x15a7('0x18')](util['format'](_0x15a7('0x1d'),_0x502d28[_0x15a7('0x1e')]),_0x5f09fb);}});ami['on'](_0x15a7('0x1f'),function(_0x1c0456){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x21'),_0x1c0456[_0x15a7('0x22')]),_0x1c0456);agents[_0x15a7('0x1f')](_0x1c0456);}catch(_0x50f95b){utils[_0x15a7('0x18')](util[_0x15a7('0x20')](_0x15a7('0x21'),_0x1c0456[_0x15a7('0x22')]),_0x50f95b);}});ami['on'](_0x15a7('0x23'),function(_0x525516){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x24'),_0x525516[_0x15a7('0x22')]),_0x525516);agents[_0x15a7('0x23')](_0x525516);}catch(_0x1c0ccb){utils['error'](util['format'](_0x15a7('0x24'),_0x525516[_0x15a7('0x22')]),_0x1c0ccb);}});ami['on'](_0x15a7('0x25'),function(_0x2db00c){try{utils['debug'](util[_0x15a7('0x20')](_0x15a7('0x26'),_0x2db00c[_0x15a7('0x22')]),_0x2db00c);agents[_0x15a7('0x25')](_0x2db00c);queues[_0x15a7('0x25')](_0x2db00c);}catch(_0x11b4bf){utils[_0x15a7('0x18')](util['format']('[%s][index][agentconnect]',_0x2db00c[_0x15a7('0x22')]),_0x11b4bf);}});ami['on'](_0x15a7('0x27'),function(_0x149b0e){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x28'),_0x149b0e[_0x15a7('0x22')]),_0x149b0e);agents[_0x15a7('0x27')](_0x149b0e);queues[_0x15a7('0x27')](_0x149b0e);members[_0x15a7('0x27')](_0x149b0e);}catch(_0x274e40){utils[_0x15a7('0x18')](util[_0x15a7('0x20')]('[%s][index][agentcomplete]',_0x149b0e[_0x15a7('0x22')]),_0x274e40);}});ami['on'](_0x15a7('0x29'),function(_0x4611cd){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')]('[%s][index][queuecallerabandon]',_0x4611cd['uniqueid']),_0x4611cd);agents[_0x15a7('0x29')](_0x4611cd);queues['queuecallerabandon'](_0x4611cd);}catch(_0x4098d4){utils[_0x15a7('0x18')](util[_0x15a7('0x20')]('[%s][index][queuecallerabandon]',_0x4611cd[_0x15a7('0x22')]),_0x4098d4);}});ami['on'](_0x15a7('0x2a'),function(_0x426c7d){try{utils['debug'](util[_0x15a7('0x20')]('[%s][index][queuecallerjoin]',_0x426c7d['uniqueid']),_0x426c7d);queues['queuecallerjoin'](_0x426c7d);recordings[_0x15a7('0x2a')](_0x426c7d);}catch(_0x4c15c4){utils[_0x15a7('0x18')](util[_0x15a7('0x20')](_0x15a7('0x2b'),_0x426c7d[_0x15a7('0x22')]),_0x4c15c4);}});ami['on'](_0x15a7('0x2c'),function(_0x46798a){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x2d'),_0x46798a[_0x15a7('0x22')]),_0x46798a);queues[_0x15a7('0x2c')](_0x46798a);}catch(_0x3b14d1){utils[_0x15a7('0x18')](util[_0x15a7('0x20')](_0x15a7('0x2d'),_0x46798a[_0x15a7('0x22')]),_0x3b14d1);}});ami['on'](_0x15a7('0x2e'),function(_0x1d23bc){try{utils['debug'](util[_0x15a7('0x20')](_0x15a7('0x2f'),_0x1d23bc['uniqueid']),_0x1d23bc);queues[_0x15a7('0x2e')](_0x1d23bc);calls[_0x15a7('0x2e')](_0x1d23bc);}catch(_0x2a50d3){utils[_0x15a7('0x18')](util[_0x15a7('0x20')]('[%s][index][musiconholdstart]',_0x1d23bc[_0x15a7('0x22')]),_0x2a50d3);}});ami['on'](_0x15a7('0x30'),function(_0x3ccff0){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x31'),_0x3ccff0[_0x15a7('0x22')]),_0x3ccff0);queues[_0x15a7('0x30')](_0x3ccff0);calls[_0x15a7('0x30')](_0x3ccff0);}catch(_0x354a7f){utils[_0x15a7('0x18')](util['format'](_0x15a7('0x31'),_0x3ccff0['uniqueid']),_0x354a7f);}});ami['on'](_0x15a7('0x32'),function(_0x1c6f71){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x33'),_0x1c6f71[_0x15a7('0x22')]),_0x1c6f71);calls[_0x15a7('0x32')](_0x1c6f71);recordings[_0x15a7('0x32')](_0x1c6f71);}catch(_0x7e8fa5){utils[_0x15a7('0x18')](util[_0x15a7('0x20')]('[%s][index][newstate]',_0x1c6f71['uniqueid']),_0x7e8fa5);}});ami['on'](_0x15a7('0x34'),function(_0x1919ec){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x35'),_0x1919ec['uniqueid']),_0x1919ec);calls['hangup'](_0x1919ec);recordings[_0x15a7('0x34')](_0x1919ec);dials[_0x15a7('0x34')](_0x1919ec);agents['hangup'](_0x1919ec);queues[_0x15a7('0x34')](_0x1919ec);}catch(_0x32d2a7){utils[_0x15a7('0x18')](util['format'](_0x15a7('0x35'),_0x1919ec['uniqueid']),_0x32d2a7);}});ami['on'](_0x15a7('0x36'),function(_0x22329d){try{utils[_0x15a7('0x1c')](util['format']('[%s][index][cdr]',_0x22329d['uniqueid']),_0x22329d);members[_0x15a7('0x36')](_0x22329d);}catch(_0x47b85f){utils[_0x15a7('0x18')](util['format'](_0x15a7('0x37'),_0x22329d[_0x15a7('0x22')]),_0x47b85f);}});ami['on'](_0x15a7('0x38'),function(_0x2b894d){try{utils['debug'](util['format']('[%s][index][blindtransfer]',_0x2b894d[_0x15a7('0x22')]),_0x2b894d);queues[_0x15a7('0x38')](_0x2b894d);agents[_0x15a7('0x38')](_0x2b894d);transfers['blindtransfer'](_0x2b894d);recordings['blindtransfer'](_0x2b894d);}catch(_0x31812b){utils[_0x15a7('0x18')](util[_0x15a7('0x20')](_0x15a7('0x39'),_0x2b894d['uniqueid']),_0x31812b);}});ami['on']('attendedtransfer',function(_0x353498){try{utils[_0x15a7('0x1c')](util['format'](_0x15a7('0x3a'),_0x353498[_0x15a7('0x3b')]),_0x353498);queues[_0x15a7('0x3c')](_0x353498);transfers[_0x15a7('0x3c')](_0x353498);agents[_0x15a7('0x3c')](_0x353498);calls[_0x15a7('0x3c')](_0x353498);}catch(_0x4220c1){utils[_0x15a7('0x18')](util[_0x15a7('0x20')](_0x15a7('0x3a'),_0x353498[_0x15a7('0x3b')]),_0x4220c1);}});ami['on'](_0x15a7('0x3d'),function(_0x3ee1dc){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x3e'),_0x3ee1dc[_0x15a7('0x22')]),_0x3ee1dc);queues['varset'](_0x3ee1dc);recordings[_0x15a7('0x3d')](_0x3ee1dc);calls[_0x15a7('0x3d')](_0x3ee1dc);dials[_0x15a7('0x3d')](_0x3ee1dc);}catch(_0x11f985){utils['error'](util[_0x15a7('0x20')]('[%s][index][varset]',_0x3ee1dc[_0x15a7('0x22')]),_0x11f985);}});ami['on'](_0x15a7('0x3f'),function(_0x4c8829){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x40'),_0x4c8829[_0x15a7('0x22')]),_0x4c8829);calls[_0x15a7('0x3f')](_0x4c8829);recordings[_0x15a7('0x3f')](_0x4c8829);dials[_0x15a7('0x3f')](_0x4c8829);}catch(_0x4a27db){utils['error'](util[_0x15a7('0x20')](_0x15a7('0x40'),_0x4c8829[_0x15a7('0x22')]),_0x4a27db);}});ami['on'](_0x15a7('0x41'),function(_0x481820){try{utils['debug'](util['format']('[%s][index][newchannel]',_0x481820[_0x15a7('0x22')]),_0x481820);calls[_0x15a7('0x41')](_0x481820);recordings[_0x15a7('0x41')](_0x481820);}catch(_0x4b5396){utils[_0x15a7('0x18')](util[_0x15a7('0x20')](_0x15a7('0x42'),_0x481820['uniqueid']),_0x4b5396);}});ami['on'](_0x15a7('0x43'),function(_0x27cade){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')]('[%s][index][dialbegin]',_0x27cade[_0x15a7('0x22')]),_0x27cade);dials[_0x15a7('0x43')](_0x27cade);}catch(_0x22785f){utils[_0x15a7('0x18')](util[_0x15a7('0x20')](_0x15a7('0x44'),_0x27cade[_0x15a7('0x22')]),_0x22785f);}});ami['on'](_0x15a7('0x45'),function(_0x3af0dc){try{utils[_0x15a7('0x1c')](util[_0x15a7('0x20')](_0x15a7('0x46'),_0x3af0dc[_0x15a7('0x22')]),_0x3af0dc);dials[_0x15a7('0x45')](_0x3af0dc);}catch(_0x5548de){utils[_0x15a7('0x18')](util[_0x15a7('0x20')](_0x15a7('0x46'),_0x3af0dc['uniqueid']),_0x5548de);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 881e878..f59edbf 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 _0xff4f=['[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','data3','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','internal','request','CreateMemberReport','split','name','catch','error','[%s][members][writeDB]','debug','[%s][members][devicestatechange]','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','device','state','INUSE','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','agentcomplete','[%s][members][agentcomplete]'];(function(_0x2e5e85,_0x5201c5){var _0x46ce0d=function(_0x2d84b1){while(--_0x2d84b1){_0x2e5e85['push'](_0x2e5e85['shift']());}};_0x46ce0d(++_0x5201c5);}(_0xff4f,0x19a));var _0xfff4=function(_0x77d9fa,_0x60cc7e){_0x77d9fa=_0x77d9fa-0x0;var _0x379045=_0xff4f[_0x77d9fa];return _0x379045;};'use strict';var _=require(_0xfff4('0x0'));var util=require(_0xfff4('0x1'));var utils=require('./utils');var members={};var exclude=[_0xfff4('0x2'),_0xfff4('0x3')];function writeDB(_0xb9b14e){utils[_0xfff4('0x4')](util[_0xfff4('0x5')](_0xfff4('0x6'),_0xb9b14e[_0xfff4('0x7')],_0xb9b14e[_0xfff4('0x8')],_0xb9b14e[_0xfff4('0x9')],_0xb9b14e[_0xfff4('0xa')],_0xb9b14e[_0xfff4('0xb')],_0xb9b14e[_0xfff4('0xc')]));if(_0xb9b14e[_0xfff4('0x8')]){utils[_0xfff4('0xd')](_0xb9b14e['interface'])[_0xfff4('0xe')](function(_0xf13ece){if(_0xf13ece){_0xb9b14e[_0xfff4('0xb')]=_0xf13ece['name'];_0xb9b14e[_0xfff4('0xf')]=_0xf13ece[_0xfff4('0xf')];utils[_0xfff4('0x10')](_0xfff4('0x11'),_0xb9b14e);}else{utils['getUserByName'](_0xb9b14e[_0xfff4('0x8')][_0xfff4('0x12')]('/')[0x1])[_0xfff4('0xe')](function(_0x2f1f6a){if(_0x2f1f6a){_0xb9b14e[_0xfff4('0xb')]=_0x2f1f6a[_0xfff4('0x13')];_0xb9b14e['internal']=_0x2f1f6a[_0xfff4('0xf')];utils[_0xfff4('0x10')](_0xfff4('0x11'),_0xb9b14e);}});}})[_0xfff4('0x14')](function(_0x4b0a2a){utils[_0xfff4('0x15')](util['format'](_0xfff4('0x16'),_0xb9b14e['uniqueid']),_0x4b0a2a);});}delete members[_0xb9b14e[_0xfff4('0x8')]];}function startsWith(_0x2f37c1,_0x52e481){return _['some'](_0x2f37c1,function(_0x56bb0c){return _['startsWith'](_0x52e481,_0x56bb0c);});}exports['devicestatechange']=function(_0x4f1a3a){try{utils[_0xfff4('0x17')](util[_0xfff4('0x5')](_0xfff4('0x18'),members[_0x4f1a3a['device']]?members[_0x4f1a3a['device']][_0xfff4('0x7')]:_0x4f1a3a['device']),_0x4f1a3a);utils[_0xfff4('0x4')](util['format'](_0xfff4('0x19'),members[_0x4f1a3a[_0xfff4('0x1a')]]?members[_0x4f1a3a[_0xfff4('0x1a')]][_0xfff4('0x7')]:_0x4f1a3a['device'],_0x4f1a3a['state'],_0x4f1a3a[_0xfff4('0x1a')]));switch(_0x4f1a3a[_0xfff4('0x1b')]){case _0xfff4('0x1c'):case'BUSY':if(!startsWith(exclude,_0x4f1a3a[_0xfff4('0x1a')])){members[_0x4f1a3a['device']]={'channel':_0xfff4('0x1d'),'interface':_0x4f1a3a[_0xfff4('0x1a')],'type':_0xfff4('0x1e'),'enterAt':utils[_0xfff4('0x1f')](),'role':_0xfff4('0x20')};}break;case _0xfff4('0x21'):if(!_[_0xfff4('0x22')](members[_0x4f1a3a[_0xfff4('0x1a')]])){members[_0x4f1a3a[_0xfff4('0x1a')]][_0xfff4('0x23')]=utils['now']();members[_0x4f1a3a['device']][_0xfff4('0x24')]=utils[_0xfff4('0x25')](members[_0x4f1a3a[_0xfff4('0x1a')]][_0xfff4('0x23')],members[_0x4f1a3a[_0xfff4('0x1a')]]['enterAt']);if(members[_0x4f1a3a['device']]['uniqueid']){writeDB(members[_0x4f1a3a[_0xfff4('0x1a')]]);}}break;default:break;}}catch(_0x927a75){utils[_0xfff4('0x15')](util[_0xfff4('0x5')]('[%s][members][devicestatechange]',members[_0x4f1a3a[_0xfff4('0x1a')]]?members[_0x4f1a3a['device']][_0xfff4('0x7')]:_0x4f1a3a[_0xfff4('0x1a')]),_0x927a75);}};exports[_0xfff4('0x26')]=function(_0x5caff5){try{if(!_[_0xfff4('0x22')](members[_0x5caff5[_0xfff4('0x8')]])){utils[_0xfff4('0x17')](util[_0xfff4('0x5')](_0xfff4('0x27'),_0x5caff5['uniqueid']),_0x5caff5);utils[_0xfff4('0x4')](util[_0xfff4('0x5')](_0xfff4('0x28'),_0x5caff5[_0xfff4('0x7')],_0x5caff5[_0xfff4('0x8')],_0x5caff5[_0xfff4('0x29')]));members[_0x5caff5[_0xfff4('0x8')]]=_[_0xfff4('0x2a')](members[_0x5caff5[_0xfff4('0x8')]],{'data4':_0x5caff5[_0xfff4('0x29')],'uniqueid':_0x5caff5['uniqueid']});}}catch(_0x3e3f47){utils[_0xfff4('0x15')](util[_0xfff4('0x5')]('[%s][members][agentcomplete]',_0x5caff5[_0xfff4('0x7')]),_0x3e3f47);}};exports['cdr']=function(_0x53a9a9){try{utils['debug'](util['format'](_0xfff4('0x2b'),_0x53a9a9[_0xfff4('0x7')]),_0x53a9a9);if(_0x53a9a9[_0xfff4('0x9')]){var _0x4a0951=_0x53a9a9[_0xfff4('0x9')][_0xfff4('0x12')]('-')[0x0];if(!_['isNil'](members[_0x4a0951])){members[_0x4a0951]=_['assign'](members[_0x4a0951],{'data1':members[_0x4a0951][_0xfff4('0x2c')]||_0x53a9a9['type'],'data2':members[_0x4a0951][_0xfff4('0xa')]||_0x53a9a9['source'],'data3':members[_0x4a0951]['data3']||_0x53a9a9[_0xfff4('0x2d')],'uniqueid':members[_0x4a0951][_0xfff4('0x7')]||_0x53a9a9[_0xfff4('0x7')]});utils[_0xfff4('0x4')](util[_0xfff4('0x5')](_0xfff4('0x2e'),_0x53a9a9[_0xfff4('0x7')],members[_0x4a0951][_0xfff4('0x2c')],members[_0x4a0951][_0xfff4('0xa')],members[_0x4a0951]['data3']));if(members[_0x4a0951][_0xfff4('0x23')]){writeDB(members[_0x4a0951]);}}}if(_0x53a9a9[_0xfff4('0x2f')]){var _0x192e79=_0x53a9a9['destinationchannel'][_0xfff4('0x12')]('-')[0x0];if(!_[_0xfff4('0x22')](members[_0x192e79])){members[_0x192e79]=_['assign'](members[_0x192e79],{'data1':members[_0x192e79][_0xfff4('0x2c')]||_0x53a9a9[_0xfff4('0xc')],'data2':members[_0x192e79][_0xfff4('0xa')]||_0x53a9a9[_0xfff4('0x30')],'data3':members[_0x192e79]['data3']||_0x53a9a9[_0xfff4('0x2d')],'uniqueid':members[_0x192e79]['uniqueid']||_0x53a9a9[_0xfff4('0x7')]});utils['info'](util[_0xfff4('0x5')](_0xfff4('0x2e'),_0x53a9a9[_0xfff4('0x7')],members[_0x192e79][_0xfff4('0x2c')],members[_0x192e79][_0xfff4('0xa')],members[_0x192e79][_0xfff4('0x31')]));if(members[_0x192e79][_0xfff4('0x23')]){writeDB(members[_0x192e79]);}}}}catch(_0x4b7ec9){utils[_0xfff4('0x15')](util[_0xfff4('0x5')](_0xfff4('0x2b'),_0x53a9a9[_0xfff4('0x7')]),_0x4b7ec9);}}; \ No newline at end of file +var _0xbb6e=['diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','channel','data1','data2','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','lodash','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','membername','type','interface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','some','startsWith','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','now','duration'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xbb6e,0x115));var _0xebb6=function(_0x3d5dd4,_0x308934){_0x3d5dd4=_0x3d5dd4-0x0;var _0x25c924=_0xbb6e[_0x3d5dd4];return _0x25c924;};'use strict';var _=require(_0xebb6('0x0'));var util=require('util');var utils=require(_0xebb6('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xebb6('0x2')];function writeDB(_0x5c3953){utils[_0xebb6('0x3')](util[_0xebb6('0x4')](_0xebb6('0x5'),_0x5c3953[_0xebb6('0x6')],_0x5c3953['interface'],_0x5c3953['channel'],_0x5c3953['data2'],_0x5c3953[_0xebb6('0x7')],_0x5c3953[_0xebb6('0x8')]));if(_0x5c3953[_0xebb6('0x9')]){utils['getUserByInterface'](_0x5c3953['interface'])[_0xebb6('0xa')](function(_0x4af04f){if(_0x4af04f){_0x5c3953[_0xebb6('0x7')]=_0x4af04f[_0xebb6('0xb')];_0x5c3953[_0xebb6('0xc')]=_0x4af04f[_0xebb6('0xc')];utils[_0xebb6('0xd')](_0xebb6('0xe'),_0x5c3953);}else{utils[_0xebb6('0xf')](_0x5c3953[_0xebb6('0x9')][_0xebb6('0x10')]('/')[0x1])[_0xebb6('0xa')](function(_0x2f43eb){if(_0x2f43eb){_0x5c3953[_0xebb6('0x7')]=_0x2f43eb[_0xebb6('0xb')];_0x5c3953[_0xebb6('0xc')]=_0x2f43eb[_0xebb6('0xc')];utils[_0xebb6('0xd')](_0xebb6('0xe'),_0x5c3953);}});}})['catch'](function(_0x1b5fa1){utils[_0xebb6('0x11')](util[_0xebb6('0x4')](_0xebb6('0x12'),_0x5c3953['uniqueid']),_0x1b5fa1);});}delete members[_0x5c3953[_0xebb6('0x9')]];}function startsWith(_0x104aa8,_0x556a02){return _[_0xebb6('0x13')](_0x104aa8,function(_0x4e7452){return _[_0xebb6('0x14')](_0x556a02,_0x4e7452);});}exports['devicestatechange']=function(_0x544760){try{utils[_0xebb6('0x15')](util[_0xebb6('0x4')]('[%s][members][devicestatechange]',members[_0x544760[_0xebb6('0x16')]]?members[_0x544760['device']][_0xebb6('0x6')]:_0x544760[_0xebb6('0x16')]),_0x544760);utils['info'](util[_0xebb6('0x4')](_0xebb6('0x17'),members[_0x544760[_0xebb6('0x16')]]?members[_0x544760['device']][_0xebb6('0x6')]:_0x544760['device'],_0x544760[_0xebb6('0x18')],_0x544760[_0xebb6('0x16')]));switch(_0x544760['state']){case _0xebb6('0x19'):case _0xebb6('0x1a'):if(!startsWith(exclude,_0x544760[_0xebb6('0x16')])){members[_0x544760[_0xebb6('0x16')]]={'channel':_0xebb6('0x1b'),'interface':_0x544760['device'],'type':_0xebb6('0x1c'),'enterAt':utils['now'](),'role':_0xebb6('0x1d')};}break;case _0xebb6('0x1e'):if(!_[_0xebb6('0x1f')](members[_0x544760[_0xebb6('0x16')]])){members[_0x544760[_0xebb6('0x16')]][_0xebb6('0x20')]=utils[_0xebb6('0x21')]();members[_0x544760[_0xebb6('0x16')]][_0xebb6('0x22')]=utils[_0xebb6('0x23')](members[_0x544760[_0xebb6('0x16')]]['exitAt'],members[_0x544760['device']][_0xebb6('0x24')]);if(members[_0x544760[_0xebb6('0x16')]][_0xebb6('0x6')]){writeDB(members[_0x544760['device']]);}}break;default:break;}}catch(_0xa8d55){utils['error'](util[_0xebb6('0x4')](_0xebb6('0x25'),members[_0x544760['device']]?members[_0x544760[_0xebb6('0x16')]][_0xebb6('0x6')]:_0x544760[_0xebb6('0x16')]),_0xa8d55);}};exports[_0xebb6('0x26')]=function(_0x2bba3e){try{if(!_[_0xebb6('0x1f')](members[_0x2bba3e[_0xebb6('0x9')]])){utils[_0xebb6('0x15')](util[_0xebb6('0x4')](_0xebb6('0x27'),_0x2bba3e[_0xebb6('0x6')]),_0x2bba3e);utils[_0xebb6('0x3')](util['format'](_0xebb6('0x28'),_0x2bba3e[_0xebb6('0x6')],_0x2bba3e['interface'],_0x2bba3e['queue']));members[_0x2bba3e[_0xebb6('0x9')]]=_[_0xebb6('0x29')](members[_0x2bba3e[_0xebb6('0x9')]],{'data4':_0x2bba3e[_0xebb6('0x2a')],'uniqueid':_0x2bba3e[_0xebb6('0x6')]});}}catch(_0x595f8c){utils['error'](util[_0xebb6('0x4')](_0xebb6('0x27'),_0x2bba3e[_0xebb6('0x6')]),_0x595f8c);}};exports[_0xebb6('0x2b')]=function(_0x16da8b){try{utils[_0xebb6('0x15')](util[_0xebb6('0x4')]('[%s][members][cdr]',_0x16da8b[_0xebb6('0x6')]),_0x16da8b);if(_0x16da8b['channel']){var _0x2e9a14=_0x16da8b[_0xebb6('0x2c')]['split']('-')[0x0];if(!_['isNil'](members[_0x2e9a14])){members[_0x2e9a14]=_[_0xebb6('0x29')](members[_0x2e9a14],{'data1':members[_0x2e9a14][_0xebb6('0x2d')]||_0x16da8b[_0xebb6('0x8')],'data2':members[_0x2e9a14][_0xebb6('0x2e')]||_0x16da8b[_0xebb6('0x2f')],'data3':members[_0x2e9a14]['data3']||_0x16da8b[_0xebb6('0x30')],'uniqueid':members[_0x2e9a14]['uniqueid']||_0x16da8b['uniqueid']});utils[_0xebb6('0x3')](util[_0xebb6('0x4')](_0xebb6('0x31'),_0x16da8b[_0xebb6('0x6')],members[_0x2e9a14][_0xebb6('0x2d')],members[_0x2e9a14][_0xebb6('0x2e')],members[_0x2e9a14][_0xebb6('0x32')]));if(members[_0x2e9a14][_0xebb6('0x20')]){writeDB(members[_0x2e9a14]);}}}if(_0x16da8b[_0xebb6('0x33')]){var _0x58085e=_0x16da8b['destinationchannel']['split']('-')[0x0];if(!_[_0xebb6('0x1f')](members[_0x58085e])){members[_0x58085e]=_[_0xebb6('0x29')](members[_0x58085e],{'data1':members[_0x58085e][_0xebb6('0x2d')]||_0x16da8b[_0xebb6('0x8')],'data2':members[_0x58085e][_0xebb6('0x2e')]||_0x16da8b['source'],'data3':members[_0x58085e]['data3']||_0x16da8b['destination'],'uniqueid':members[_0x58085e]['uniqueid']||_0x16da8b[_0xebb6('0x6')]});utils[_0xebb6('0x3')](util[_0xebb6('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x16da8b[_0xebb6('0x6')],members[_0x58085e][_0xebb6('0x2d')],members[_0x58085e][_0xebb6('0x2e')],members[_0x58085e][_0xebb6('0x32')]));if(members[_0x58085e][_0xebb6('0x20')]){writeDB(members[_0x58085e]);}}}}catch(_0x985b93){utils[_0xebb6('0x11')](util[_0xebb6('0x4')]('[%s][members][cdr]',_0x16da8b[_0xebb6('0x6')]),_0x985b93);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 3865e5d..4e9055c 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 _0xa0c0=['holdtime','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','lastAssignedTo','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','queuecallerleaveAt'];(function(_0x279f52,_0x2634f2){var _0x57e6b5=function(_0x331bde){while(--_0x331bde){_0x279f52['push'](_0x279f52['shift']());}};_0x57e6b5(++_0x2634f2);}(_0xa0c0,0x16f));var _0x0a0c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa0c0[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x0a0c('0x0'));var util=require(_0x0a0c('0x1'));var utils=require(_0x0a0c('0x2'));var queues={};function writeDB(_0x1d8caa){utils[_0x0a0c('0x3')](util[_0x0a0c('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x1d8caa[_0x0a0c('0x5')],_0x1d8caa[_0x0a0c('0x6')],_0x1d8caa[_0x0a0c('0x7')],_0x1d8caa['lastAssignedTo'],_0x1d8caa[_0x0a0c('0x8')],_0x1d8caa[_0x0a0c('0x9')],_0x1d8caa[_0x0a0c('0xa')]));if(_0x1d8caa[_0x0a0c('0x7')]){utils[_0x0a0c('0xb')](_0x1d8caa['queue'])[_0x0a0c('0xc')](function(_0x36046a){if(_0x36046a){_0x1d8caa[_0x0a0c('0xd')]=_0x36046a['type'];}utils[_0x0a0c('0xe')](_0x0a0c('0xf'),_0x1d8caa);});}else{utils['request']('CreateVoiceQueueReport',_0x1d8caa);}if(_0x1d8caa[_0x0a0c('0x10')]){delete queues[_0x1d8caa[_0x0a0c('0x10')]];}else{delete queues[_0x1d8caa[_0x0a0c('0x5')]];}}exports['queuecallerjoin']=function(_0x33050f){try{utils[_0x0a0c('0x11')](util[_0x0a0c('0x4')]('[%s][queues][queuecallerjoin]',_0x33050f[_0x0a0c('0x5')]),_0x33050f);utils['info'](util[_0x0a0c('0x4')](_0x0a0c('0x12'),_0x33050f[_0x0a0c('0x5')],_0x33050f[_0x0a0c('0x7')],_0x33050f['position']));queues[_0x33050f[_0x0a0c('0x5')]]=_['assign'](_0x33050f,{'originalposition':_0x33050f[_0x0a0c('0x13')],'queuecallerjoinAt':utils[_0x0a0c('0x14')](),'mohtime':0x0});}catch(_0x521296){utils[_0x0a0c('0x15')](util[_0x0a0c('0x4')](_0x0a0c('0x16'),_0x33050f[_0x0a0c('0x5')]),_0x521296);}};exports[_0x0a0c('0x17')]=function(_0x59a449){try{if(!_[_0x0a0c('0x18')](queues[_0x59a449[_0x0a0c('0x5')]])){utils[_0x0a0c('0x11')](util[_0x0a0c('0x4')](_0x0a0c('0x19'),_0x59a449[_0x0a0c('0x5')]),_0x59a449);if(queues[_0x59a449['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x59a449['uniqueid']][_0x0a0c('0x1a')]&&!queues[_0x59a449['uniqueid']][_0x0a0c('0x1b')]){queues[_0x59a449[_0x0a0c('0x5')]][_0x0a0c('0x1c')]=!![];queues[_0x59a449[_0x0a0c('0x5')]]['queuecallercompleteAt']=utils[_0x0a0c('0x14')]();queues[_0x59a449[_0x0a0c('0x5')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x0a0c('0x3')](util['format'](_0x0a0c('0x1d'),_0x59a449[_0x0a0c('0x5')],queues[_0x59a449[_0x0a0c('0x5')]][_0x0a0c('0x1e')],queues[_0x59a449[_0x0a0c('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x59a449['uniqueid']]);}else if(queues[_0x59a449[_0x0a0c('0x5')]][_0x0a0c('0x10')]){utils['info'](util[_0x0a0c('0x4')](_0x0a0c('0x1f'),_0x59a449[_0x0a0c('0x5')],queues[_0x59a449[_0x0a0c('0x5')]]['name'],queues[_0x59a449[_0x0a0c('0x5')]]['transfereduniqueid']));queues[queues[_0x59a449[_0x0a0c('0x5')]][_0x0a0c('0x10')]]=queues[_0x59a449[_0x0a0c('0x5')]];queues[queues[_0x59a449[_0x0a0c('0x5')]][_0x0a0c('0x10')]][_0x0a0c('0x20')]=0x2;delete queues[_0x59a449['uniqueid']];}}}catch(_0x39cc30){utils[_0x0a0c('0x15')](util[_0x0a0c('0x4')](_0x0a0c('0x19'),_0x59a449['uniqueid']),_0x39cc30);}};exports[_0x0a0c('0x21')]=function(_0x2d1497){try{utils[_0x0a0c('0x11')](util['format'](_0x0a0c('0x22'),_0x2d1497[_0x0a0c('0x5')]),_0x2d1497);if(!_[_0x0a0c('0x18')](_0x2d1497['variable'][_0x0a0c('0x23')])&&_0x2d1497[_0x0a0c('0x24')][_0x0a0c('0x25')]()!==_0x0a0c('0x26')){if(!_['isNil'](queues[_0x2d1497[_0x0a0c('0x5')]])){queues[_0x2d1497[_0x0a0c('0x5')]][_0x0a0c('0x1a')]=![];queues[_0x2d1497[_0x0a0c('0x5')]][_0x0a0c('0x27')]=null;queues[_0x2d1497['uniqueid']][_0x0a0c('0x1b')]=!![];queues[_0x2d1497[_0x0a0c('0x5')]][_0x0a0c('0x28')]=utils[_0x0a0c('0x14')]();queues[_0x2d1497[_0x0a0c('0x5')]][_0x0a0c('0xa')]=_0x2d1497[_0x0a0c('0x24')][_0x0a0c('0x25')]();utils[_0x0a0c('0x3')](util[_0x0a0c('0x4')](_0x0a0c('0x29'),_0x2d1497[_0x0a0c('0x5')],queues[_0x2d1497[_0x0a0c('0x5')]][_0x0a0c('0x1e')],_0x2d1497[_0x0a0c('0x24')],queues[_0x2d1497[_0x0a0c('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x2d1497[_0x0a0c('0x5')]]);}}else if(!_['isNil'](_0x2d1497[_0x0a0c('0x2a')][_0x0a0c('0x2b')])){if(!_[_0x0a0c('0x18')](queues[_0x2d1497[_0x0a0c('0x5')]])&&!queues[_0x2d1497['uniqueid']][_0x0a0c('0x1a')]){queues[_0x2d1497[_0x0a0c('0x5')]][_0x0a0c('0x1a')]=![];queues[_0x2d1497[_0x0a0c('0x5')]]['queuecallerabandonAt']=null;queues[_0x2d1497[_0x0a0c('0x5')]]['queuecallerexit']=!![];queues[_0x2d1497['uniqueid']][_0x0a0c('0x28')]=utils[_0x0a0c('0x14')]();queues[_0x2d1497['uniqueid']][_0x0a0c('0xa')]=_0x0a0c('0x2c');utils[_0x0a0c('0x3')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x2d1497['uniqueid'],queues[_0x2d1497[_0x0a0c('0x5')]][_0x0a0c('0x1e')],_0x2d1497['value'],queues[_0x2d1497[_0x0a0c('0x5')]][_0x0a0c('0xa')]));}}}catch(_0x581e27){utils[_0x0a0c('0x15')](util[_0x0a0c('0x4')]('[%s][queues][varset]',_0x2d1497[_0x0a0c('0x5')]),_0x581e27);}};exports[_0x0a0c('0x1a')]=function(_0x592096){try{if(!_['isNil'](queues[_0x592096[_0x0a0c('0x5')]])){utils[_0x0a0c('0x11')](util[_0x0a0c('0x4')]('[%s][queues][queuecallerabandon]',_0x592096[_0x0a0c('0x5')]),_0x592096);queues[_0x592096[_0x0a0c('0x5')]]['queuecallerexit']=![];queues[_0x592096[_0x0a0c('0x5')]][_0x0a0c('0x28')]=null;queues[_0x592096[_0x0a0c('0x5')]][_0x0a0c('0x1a')]=!![];queues[_0x592096[_0x0a0c('0x5')]][_0x0a0c('0x27')]=utils[_0x0a0c('0x14')]();queues[_0x592096[_0x0a0c('0x5')]]['queuecallerexitreason']=_0x0a0c('0x2d');utils[_0x0a0c('0x3')](util['format'](_0x0a0c('0x2e'),_0x592096[_0x0a0c('0x5')],queues[_0x592096[_0x0a0c('0x5')]][_0x0a0c('0x1e')],queues[_0x592096['uniqueid']][_0x0a0c('0xa')]));}}catch(_0x33c37d){utils['error'](util[_0x0a0c('0x4')]('[%s][queues][queuecallerabandon]',_0x592096[_0x0a0c('0x5')]),_0x33c37d);}};exports['queuecallerleave']=function(_0x51ff35){try{if(!_[_0x0a0c('0x18')](queues[_0x51ff35['uniqueid']])){utils[_0x0a0c('0x11')](util['format'](_0x0a0c('0x2f'),_0x51ff35['uniqueid']),_0x51ff35);utils['info'](util[_0x0a0c('0x4')](_0x0a0c('0x30'),_0x51ff35[_0x0a0c('0x5')],queues[_0x51ff35[_0x0a0c('0x5')]][_0x0a0c('0x1e')],_0x51ff35[_0x0a0c('0x31')],_0x51ff35[_0x0a0c('0x32')]));queues[_0x51ff35[_0x0a0c('0x5')]][_0x0a0c('0x33')]=!![];queues[_0x51ff35[_0x0a0c('0x5')]][_0x0a0c('0x34')]=utils['now']();queues[_0x51ff35[_0x0a0c('0x5')]][_0x0a0c('0x35')]=utils['diffTime'](queues[_0x51ff35[_0x0a0c('0x5')]]['queuecallerleaveAt'],queues[_0x51ff35[_0x0a0c('0x5')]]['queuecallerjoinAt']);queues[_0x51ff35[_0x0a0c('0x5')]][_0x0a0c('0x13')]=_0x51ff35[_0x0a0c('0x13')];queues[_0x51ff35['uniqueid']][_0x0a0c('0x36')]=_0x51ff35[_0x0a0c('0x36')];queues[_0x51ff35[_0x0a0c('0x5')]][_0x0a0c('0x31')]=_0x51ff35['connectedlinenum'];queues[_0x51ff35[_0x0a0c('0x5')]][_0x0a0c('0x32')]=_0x51ff35[_0x0a0c('0x32')];}}catch(_0x2c36c3){utils['error'](util[_0x0a0c('0x4')](_0x0a0c('0x2f'),_0x51ff35[_0x0a0c('0x5')]),_0x2c36c3);}};exports[_0x0a0c('0x37')]=function(_0x3ef096){try{if(!_[_0x0a0c('0x18')](queues[_0x3ef096[_0x0a0c('0x5')]])){utils[_0x0a0c('0x11')](util[_0x0a0c('0x4')]('[%s][queues][agentconnect]',_0x3ef096[_0x0a0c('0x5')]),_0x3ef096);utils[_0x0a0c('0x3')](util[_0x0a0c('0x4')](_0x0a0c('0x38'),_0x3ef096[_0x0a0c('0x5')],queues[_0x3ef096[_0x0a0c('0x5')]][_0x0a0c('0x1e')],_0x3ef096[_0x0a0c('0x39')],_0x3ef096[_0x0a0c('0x3a')]));queues[_0x3ef096[_0x0a0c('0x5')]][_0x0a0c('0x1a')]=![];queues[_0x3ef096['uniqueid']][_0x0a0c('0x1a')]=![];queues[_0x3ef096[_0x0a0c('0x5')]][_0x0a0c('0x27')]=null;queues[_0x3ef096['uniqueid']]['queuecallerexit']=![];queues[_0x3ef096[_0x0a0c('0x5')]]['queuecallerexitreason']=null;queues[_0x3ef096[_0x0a0c('0x5')]][_0x0a0c('0x28')]=null;queues[_0x3ef096[_0x0a0c('0x5')]]['assigned']=!![];queues[_0x3ef096[_0x0a0c('0x5')]]['accountcode']=_0x3ef096[_0x0a0c('0x3a')];queues[_0x3ef096['uniqueid']]['lastAssignedTo']=_0x3ef096['membername'];}}catch(_0x17f0ec){utils[_0x0a0c('0x15')](util[_0x0a0c('0x4')]('[%s][queues][agentconnect]',_0x3ef096[_0x0a0c('0x5')]),_0x17f0ec);}};exports[_0x0a0c('0x3b')]=function(_0x2956ba){try{if(!_[_0x0a0c('0x18')](queues[_0x2956ba[_0x0a0c('0x5')]])){if(queues[_0x2956ba['uniqueid']]['queuecallerleaveAt']){utils[_0x0a0c('0x11')](util[_0x0a0c('0x4')](_0x0a0c('0x3c'),_0x2956ba['uniqueid']),_0x2956ba);queues[_0x2956ba['uniqueid']][_0x0a0c('0x1a')]=![];queues[_0x2956ba[_0x0a0c('0x5')]][_0x0a0c('0x1a')]=![];queues[_0x2956ba['uniqueid']][_0x0a0c('0x27')]=null;queues[_0x2956ba[_0x0a0c('0x5')]][_0x0a0c('0x1b')]=![];queues[_0x2956ba[_0x0a0c('0x5')]]['queuecallerexitAt']=null;queues[_0x2956ba['uniqueid']][_0x0a0c('0x3d')]=!![];queues[_0x2956ba[_0x0a0c('0x5')]][_0x0a0c('0x3e')]=_0x2956ba[_0x0a0c('0x39')];queues[_0x2956ba[_0x0a0c('0x5')]][_0x0a0c('0x1c')]=!![];queues[_0x2956ba[_0x0a0c('0x5')]]['queuecallercompleteAt']=utils[_0x0a0c('0x14')]();if(_0x2956ba[_0x0a0c('0x3f')]=='transfer'){if(!queues[_0x2956ba['uniqueid']][_0x0a0c('0x40')]){queues[_0x2956ba[_0x0a0c('0x5')]][_0x0a0c('0xa')]='TRANSFER';}}else{queues[_0x2956ba['uniqueid']][_0x0a0c('0xa')]='COMPLETEDBY'+_0x2956ba[_0x0a0c('0x3f')][_0x0a0c('0x25')]();}utils[_0x0a0c('0x3')](util['format'](_0x0a0c('0x41'),_0x2956ba[_0x0a0c('0x5')],queues[_0x2956ba[_0x0a0c('0x5')]][_0x0a0c('0x1e')],_0x2956ba[_0x0a0c('0x39')],queues[_0x2956ba[_0x0a0c('0x5')]][_0x0a0c('0xa')]));writeDB(queues[_0x2956ba[_0x0a0c('0x5')]]);}}}catch(_0x350d29){utils[_0x0a0c('0x15')](util[_0x0a0c('0x4')]('[%s][queues][agentcomplete]',_0x2956ba['uniqueid']),_0x350d29);}};exports[_0x0a0c('0x42')]=function(_0x3d8bea){try{if(!_[_0x0a0c('0x18')](queues[_0x3d8bea[_0x0a0c('0x43')]])){utils[_0x0a0c('0x11')](util[_0x0a0c('0x4')](_0x0a0c('0x44'),_0x3d8bea[_0x0a0c('0x5')]),_0x3d8bea);queues[_0x3d8bea[_0x0a0c('0x43')]][_0x0a0c('0x40')]=!![];queues[_0x3d8bea[_0x0a0c('0x43')]][_0x0a0c('0x45')]=_0x0a0c('0x46');queues[_0x3d8bea[_0x0a0c('0x43')]][_0x0a0c('0x47')]=_0x3d8bea[_0x0a0c('0x48')];queues[_0x3d8bea[_0x0a0c('0x43')]][_0x0a0c('0x49')]=_0x3d8bea['transfereeuniqueid'];queues[_0x3d8bea[_0x0a0c('0x43')]][_0x0a0c('0xa')]=_0x0a0c('0x4a');utils['info'](util[_0x0a0c('0x4')](_0x0a0c('0x4b'),_0x3d8bea[_0x0a0c('0x5')],queues[_0x3d8bea[_0x0a0c('0x43')]][_0x0a0c('0x1e')],_0x3d8bea[_0x0a0c('0x43')],_0x3d8bea[_0x0a0c('0x48')]));}}catch(_0x57efd0){utils[_0x0a0c('0x15')](util[_0x0a0c('0x4')](_0x0a0c('0x44'),_0x3d8bea[_0x0a0c('0x5')]),_0x57efd0);}};exports['attendedtransfer']=function(_0x1311b5){try{utils[_0x0a0c('0x11')](util[_0x0a0c('0x4')](_0x0a0c('0x4c'),_0x1311b5[_0x0a0c('0x4d')]),_0x1311b5);if(_0x1311b5[_0x0a0c('0x4d')]==_0x1311b5[_0x0a0c('0x4e')]){if(!_[_0x0a0c('0x18')](queues[_0x1311b5[_0x0a0c('0x4f')]])){utils[_0x0a0c('0x3')](util['format'](_0x0a0c('0x50'),_0x1311b5[_0x0a0c('0x4d')],queues[_0x1311b5[_0x0a0c('0x4f')]][_0x0a0c('0x1e')],_0x1311b5[_0x0a0c('0x51')]));queues[_0x1311b5[_0x0a0c('0x4f')]][_0x0a0c('0x40')]=!![];queues[_0x1311b5[_0x0a0c('0x4f')]][_0x0a0c('0x45')]=_0x0a0c('0x52');queues[_0x1311b5[_0x0a0c('0x4f')]][_0x0a0c('0x47')]=_0x1311b5['origtransfererexten'];queues[_0x1311b5[_0x0a0c('0x4f')]]['transferuniqueid']=_0x1311b5[_0x0a0c('0x4d')];queues[_0x1311b5[_0x0a0c('0x4f')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x1311b5[_0x0a0c('0x4e')]])){if(_0x1311b5['transfereelinkedid']&&queues[_0x1311b5[_0x0a0c('0x53')]]){queues[_0x1311b5[_0x0a0c('0x53')]][_0x0a0c('0x20')]=0x1;queues[_0x1311b5[_0x0a0c('0x43')]]=_[_0x0a0c('0x54')](queues[_0x1311b5[_0x0a0c('0x53')]]);queues[_0x1311b5['transfereeuniqueid']][_0x0a0c('0x10')]=_0x1311b5[_0x0a0c('0x55')];queues[_0x1311b5['transfereeuniqueid']][_0x0a0c('0x20')]=0x2;queues[_0x1311b5[_0x0a0c('0x43')]][_0x0a0c('0x8')]=queues[_0x1311b5['secondtransfererlinkedid']][_0x0a0c('0x8')];queues[_0x1311b5[_0x0a0c('0x43')]][_0x0a0c('0x56')]=queues[_0x1311b5[_0x0a0c('0x4f')]][_0x0a0c('0x56')];queues[_0x1311b5[_0x0a0c('0x43')]]['queuecallerjoinAt']=utils[_0x0a0c('0x14')]();queues[_0x1311b5[_0x0a0c('0x43')]][_0x0a0c('0x34')]=utils[_0x0a0c('0x14')]();queues[_0x1311b5[_0x0a0c('0x43')]]['holdtime']=0x0;queues[_0x1311b5[_0x0a0c('0x43')]][_0x0a0c('0x57')]=0x0;utils[_0x0a0c('0x3')](util[_0x0a0c('0x4')](_0x0a0c('0x58'),_0x1311b5[_0x0a0c('0x4d')],queues[_0x1311b5['transfereeuniqueid']]['name'],queues[_0x1311b5['transfereeuniqueid']][_0x0a0c('0x8')],queues[_0x1311b5['transfereeuniqueid']][_0x0a0c('0x56')]));}else{utils['info'](util[_0x0a0c('0x4')](_0x0a0c('0x59'),_0x1311b5[_0x0a0c('0x4d')],queues[_0x1311b5[_0x0a0c('0x4e')]][_0x0a0c('0x1e')],_0x1311b5['secondtransfererlinkedid']));queues[_0x1311b5[_0x0a0c('0x4e')]][_0x0a0c('0x10')]=_0x1311b5[_0x0a0c('0x4f')];}}}else if(_0x1311b5[_0x0a0c('0x5a')]==_0x1311b5[_0x0a0c('0x4f')]){if(!_[_0x0a0c('0x18')](queues[_0x1311b5['origtransfererlinkedid']])){utils[_0x0a0c('0x3')](util[_0x0a0c('0x4')](_0x0a0c('0x5b'),_0x1311b5[_0x0a0c('0x4d')],queues[_0x1311b5[_0x0a0c('0x4e')]][_0x0a0c('0x1e')],_0x1311b5[_0x0a0c('0x5a')],_0x1311b5['secondtransfererexten']));queues[_0x1311b5[_0x0a0c('0x4e')]][_0x0a0c('0x40')]=!![];queues[_0x1311b5[_0x0a0c('0x4e')]]['transfertype']='ATTENDED';queues[_0x1311b5[_0x0a0c('0x4e')]][_0x0a0c('0x47')]=_0x1311b5[_0x0a0c('0x5c')];queues[_0x1311b5[_0x0a0c('0x4e')]][_0x0a0c('0x49')]=_0x1311b5['secondtransfereruniqueid'];queues[_0x1311b5[_0x0a0c('0x4e')]][_0x0a0c('0xa')]=_0x0a0c('0x5d');}if(!_[_0x0a0c('0x18')](queues[_0x1311b5[_0x0a0c('0x4f')]])){if(_0x1311b5[_0x0a0c('0x5e')]&&queues[_0x1311b5[_0x0a0c('0x5e')]]){queues[_0x1311b5[_0x0a0c('0x5e')]][_0x0a0c('0x20')]=0x1;queues[_0x1311b5[_0x0a0c('0x55')]]=_[_0x0a0c('0x54')](queues[_0x1311b5[_0x0a0c('0x5e')]]);queues[_0x1311b5[_0x0a0c('0x55')]]['transfereduniqueid']=_0x1311b5[_0x0a0c('0x55')];queues[_0x1311b5[_0x0a0c('0x55')]][_0x0a0c('0x20')]=0x2;queues[_0x1311b5[_0x0a0c('0x55')]][_0x0a0c('0x8')]=queues[_0x1311b5['origtransfererlinkedid']][_0x0a0c('0x8')];queues[_0x1311b5[_0x0a0c('0x55')]][_0x0a0c('0x56')]=queues[_0x1311b5[_0x0a0c('0x4e')]][_0x0a0c('0x56')];queues[_0x1311b5[_0x0a0c('0x55')]][_0x0a0c('0x5f')]=utils['now']();queues[_0x1311b5[_0x0a0c('0x55')]][_0x0a0c('0x34')]=utils[_0x0a0c('0x14')]();queues[_0x1311b5[_0x0a0c('0x55')]]['holdtime']=0x0;queues[_0x1311b5[_0x0a0c('0x55')]]['mohtime']=0x0;utils[_0x0a0c('0x3')](util[_0x0a0c('0x4')](_0x0a0c('0x60'),_0x1311b5[_0x0a0c('0x4d')],queues[_0x1311b5['transfertargetuniqueid']][_0x0a0c('0x1e')],queues[_0x1311b5[_0x0a0c('0x55')]][_0x0a0c('0x10')],queues[_0x1311b5['transfertargetuniqueid']][_0x0a0c('0x8')],queues[_0x1311b5[_0x0a0c('0x55')]][_0x0a0c('0x56')]));}else{utils['info'](util['format'](_0x0a0c('0x59'),_0x1311b5[_0x0a0c('0x4d')],queues[_0x1311b5[_0x0a0c('0x4f')]][_0x0a0c('0x1e')],_0x1311b5[_0x0a0c('0x4e')]));queues[_0x1311b5['secondtransfererlinkedid']][_0x0a0c('0x10')]=_0x1311b5['origtransfererlinkedid'];}}}}catch(_0x14d5f4){utils[_0x0a0c('0x15')](util['format'](_0x0a0c('0x4c'),_0x1311b5['origtransfereruniqueid']),_0x14d5f4);}};exports[_0x0a0c('0x61')]=function(_0x167044){try{if(!_[_0x0a0c('0x18')](queues[_0x167044['uniqueid']])){utils[_0x0a0c('0x11')](util[_0x0a0c('0x4')]('[%s][queues][musiconholdstart]',_0x167044[_0x0a0c('0x5')]),_0x167044);queues[_0x167044[_0x0a0c('0x5')]]['musiconholdstartAt']=utils[_0x0a0c('0x14')]();utils['info'](util[_0x0a0c('0x4')](_0x0a0c('0x62'),_0x167044[_0x0a0c('0x5')],queues[_0x167044[_0x0a0c('0x5')]][_0x0a0c('0x1e')],queues[_0x167044[_0x0a0c('0x5')]][_0x0a0c('0x63')]));}}catch(_0x8b3bf4){utils[_0x0a0c('0x15')](util['format'](_0x0a0c('0x64'),_0x167044[_0x0a0c('0x5')]),_0x8b3bf4);}};exports[_0x0a0c('0x65')]=function(_0x5cf26c){try{if(!_[_0x0a0c('0x18')](queues[_0x5cf26c[_0x0a0c('0x5')]])){if(!_[_0x0a0c('0x18')](queues[_0x5cf26c[_0x0a0c('0x5')]][_0x0a0c('0x63')])){utils['debug'](util[_0x0a0c('0x4')](_0x0a0c('0x66'),_0x5cf26c[_0x0a0c('0x5')]),_0x5cf26c);queues[_0x5cf26c['uniqueid']][_0x0a0c('0x57')]+=utils[_0x0a0c('0x67')](utils[_0x0a0c('0x14')](),queues[_0x5cf26c['uniqueid']][_0x0a0c('0x63')]);utils['info'](util[_0x0a0c('0x4')](_0x0a0c('0x68'),_0x5cf26c[_0x0a0c('0x5')],queues[_0x5cf26c[_0x0a0c('0x5')]][_0x0a0c('0x1e')],queues[_0x5cf26c[_0x0a0c('0x5')]][_0x0a0c('0x57')]));delete queues[_0x5cf26c[_0x0a0c('0x5')]][_0x0a0c('0x63')];}}}catch(_0x57c6c3){utils[_0x0a0c('0x15')](util[_0x0a0c('0x4')]('[%s][queues][musiconholdstop]',_0x5cf26c[_0x0a0c('0x5')]),_0x57c6c3);}}; \ No newline at end of file +var _0x1288=['lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','now','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','isNil','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','value','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfereruniqueid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','clone','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transferexten','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]'];(function(_0x15cae5,_0x3688c2){var _0x3bc6c2=function(_0x16c937){while(--_0x16c937){_0x15cae5['push'](_0x15cae5['shift']());}};_0x3bc6c2(++_0x3688c2);}(_0x1288,0x135));var _0x8128=function(_0x36ac8a,_0x4b2ade){_0x36ac8a=_0x36ac8a-0x0;var _0x303482=_0x1288[_0x36ac8a];return _0x303482;};'use strict';var _=require(_0x8128('0x0'));var util=require(_0x8128('0x1'));var utils=require(_0x8128('0x2'));var queues={};function writeDB(_0x127513){utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x5'),_0x127513[_0x8128('0x6')],_0x127513[_0x8128('0x7')],_0x127513[_0x8128('0x8')],_0x127513[_0x8128('0x9')],_0x127513['calleridnum'],_0x127513[_0x8128('0xa')],_0x127513['queuecallerexitreason']));if(_0x127513[_0x8128('0x8')]){utils[_0x8128('0xb')](_0x127513[_0x8128('0x8')])[_0x8128('0xc')](function(_0x49d134){if(_0x49d134){_0x127513['type']=_0x49d134[_0x8128('0xd')];}utils[_0x8128('0xe')](_0x8128('0xf'),_0x127513);});}else{utils[_0x8128('0xe')](_0x8128('0xf'),_0x127513);}if(_0x127513[_0x8128('0x10')]){delete queues[_0x127513['transfereduniqueid']];}else{delete queues[_0x127513['uniqueid']];}}exports[_0x8128('0x11')]=function(_0x4d93c8){try{utils['debug'](util[_0x8128('0x4')](_0x8128('0x12'),_0x4d93c8[_0x8128('0x6')]),_0x4d93c8);utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x13'),_0x4d93c8[_0x8128('0x6')],_0x4d93c8[_0x8128('0x8')],_0x4d93c8['position']));queues[_0x4d93c8[_0x8128('0x6')]]=_['assign'](_0x4d93c8,{'originalposition':_0x4d93c8['position'],'queuecallerjoinAt':utils[_0x8128('0x14')](),'mohtime':0x0});}catch(_0x5261e2){utils['error'](util['format'](_0x8128('0x12'),_0x4d93c8['uniqueid']),_0x5261e2);}};exports['hangup']=function(_0x26e6c7){try{if(!_['isNil'](queues[_0x26e6c7['uniqueid']])){utils[_0x8128('0x15')](util[_0x8128('0x4')](_0x8128('0x16'),_0x26e6c7[_0x8128('0x6')]),_0x26e6c7);if(queues[_0x26e6c7['uniqueid']][_0x8128('0x17')]){if(!queues[_0x26e6c7[_0x8128('0x6')]][_0x8128('0x18')]&&!queues[_0x26e6c7['uniqueid']][_0x8128('0x19')]){queues[_0x26e6c7[_0x8128('0x6')]][_0x8128('0x1a')]=!![];queues[_0x26e6c7[_0x8128('0x6')]][_0x8128('0x1b')]=utils['now']();queues[_0x26e6c7[_0x8128('0x6')]][_0x8128('0x1c')]='COMPLETEDBYAGENT';}utils[_0x8128('0x3')](util[_0x8128('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x26e6c7[_0x8128('0x6')],queues[_0x26e6c7[_0x8128('0x6')]]['name'],queues[_0x26e6c7[_0x8128('0x6')]][_0x8128('0x1c')]));writeDB(queues[_0x26e6c7['uniqueid']]);}else if(queues[_0x26e6c7['uniqueid']]['transfereduniqueid']){utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x1d'),_0x26e6c7[_0x8128('0x6')],queues[_0x26e6c7['uniqueid']]['name'],queues[_0x26e6c7['uniqueid']]['transfereduniqueid']));queues[queues[_0x26e6c7[_0x8128('0x6')]][_0x8128('0x10')]]=queues[_0x26e6c7[_0x8128('0x6')]];queues[queues[_0x26e6c7['uniqueid']]['transfereduniqueid']][_0x8128('0x1e')]=0x2;delete queues[_0x26e6c7[_0x8128('0x6')]];}}}catch(_0x497112){utils[_0x8128('0x1f')](util[_0x8128('0x4')](_0x8128('0x16'),_0x26e6c7['uniqueid']),_0x497112);}};exports[_0x8128('0x20')]=function(_0x487f06){try{utils[_0x8128('0x15')](util['format']('[%s][queues][varset]',_0x487f06['uniqueid']),_0x487f06);if(!_[_0x8128('0x21')](_0x487f06[_0x8128('0x22')][_0x8128('0x23')])&&_0x487f06['value'][_0x8128('0x24')]()!==_0x8128('0x25')){if(!_['isNil'](queues[_0x487f06[_0x8128('0x6')]])){queues[_0x487f06[_0x8128('0x6')]][_0x8128('0x18')]=![];queues[_0x487f06[_0x8128('0x6')]][_0x8128('0x26')]=null;queues[_0x487f06[_0x8128('0x6')]][_0x8128('0x19')]=!![];queues[_0x487f06[_0x8128('0x6')]]['queuecallerexitAt']=utils[_0x8128('0x14')]();queues[_0x487f06['uniqueid']]['queuecallerexitreason']=_0x487f06[_0x8128('0x27')][_0x8128('0x24')]();utils[_0x8128('0x3')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x487f06['uniqueid'],queues[_0x487f06['uniqueid']]['name'],_0x487f06[_0x8128('0x27')],queues[_0x487f06['uniqueid']][_0x8128('0x1c')]));writeDB(queues[_0x487f06['uniqueid']]);}}else if(!_[_0x8128('0x21')](_0x487f06[_0x8128('0x22')]['queueposition'])){if(!_[_0x8128('0x21')](queues[_0x487f06['uniqueid']])&&!queues[_0x487f06[_0x8128('0x6')]][_0x8128('0x18')]){queues[_0x487f06[_0x8128('0x6')]][_0x8128('0x18')]=![];queues[_0x487f06[_0x8128('0x6')]][_0x8128('0x26')]=null;queues[_0x487f06['uniqueid']]['queuecallerexit']=!![];queues[_0x487f06[_0x8128('0x6')]]['queuecallerexitAt']=utils[_0x8128('0x14')]();queues[_0x487f06[_0x8128('0x6')]]['queuecallerexitreason']=_0x8128('0x28');utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x29'),_0x487f06[_0x8128('0x6')],queues[_0x487f06['uniqueid']]['name'],_0x487f06[_0x8128('0x27')],queues[_0x487f06[_0x8128('0x6')]][_0x8128('0x1c')]));}}}catch(_0x1e2bae){utils[_0x8128('0x1f')](util['format'](_0x8128('0x2a'),_0x487f06[_0x8128('0x6')]),_0x1e2bae);}};exports[_0x8128('0x18')]=function(_0x6475df){try{if(!_[_0x8128('0x21')](queues[_0x6475df[_0x8128('0x6')]])){utils[_0x8128('0x15')](util[_0x8128('0x4')](_0x8128('0x2b'),_0x6475df[_0x8128('0x6')]),_0x6475df);queues[_0x6475df[_0x8128('0x6')]][_0x8128('0x19')]=![];queues[_0x6475df['uniqueid']][_0x8128('0x2c')]=null;queues[_0x6475df['uniqueid']][_0x8128('0x18')]=!![];queues[_0x6475df[_0x8128('0x6')]][_0x8128('0x26')]=utils[_0x8128('0x14')]();queues[_0x6475df[_0x8128('0x6')]][_0x8128('0x1c')]=_0x8128('0x2d');utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x2e'),_0x6475df['uniqueid'],queues[_0x6475df['uniqueid']][_0x8128('0x2f')],queues[_0x6475df[_0x8128('0x6')]][_0x8128('0x1c')]));}}catch(_0x3a553c){utils[_0x8128('0x1f')](util[_0x8128('0x4')](_0x8128('0x2b'),_0x6475df[_0x8128('0x6')]),_0x3a553c);}};exports[_0x8128('0x30')]=function(_0x444577){try{if(!_['isNil'](queues[_0x444577[_0x8128('0x6')]])){utils[_0x8128('0x15')](util[_0x8128('0x4')](_0x8128('0x31'),_0x444577['uniqueid']),_0x444577);utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x32'),_0x444577[_0x8128('0x6')],queues[_0x444577[_0x8128('0x6')]][_0x8128('0x2f')],_0x444577[_0x8128('0x33')],_0x444577['connectedlinename']));queues[_0x444577[_0x8128('0x6')]][_0x8128('0x30')]=!![];queues[_0x444577[_0x8128('0x6')]][_0x8128('0x17')]=utils[_0x8128('0x14')]();queues[_0x444577[_0x8128('0x6')]][_0x8128('0x34')]=utils[_0x8128('0x35')](queues[_0x444577[_0x8128('0x6')]]['queuecallerleaveAt'],queues[_0x444577[_0x8128('0x6')]][_0x8128('0x36')]);queues[_0x444577[_0x8128('0x6')]][_0x8128('0x37')]=_0x444577['position'];queues[_0x444577['uniqueid']][_0x8128('0x38')]=_0x444577[_0x8128('0x38')];queues[_0x444577[_0x8128('0x6')]][_0x8128('0x33')]=_0x444577['connectedlinenum'];queues[_0x444577[_0x8128('0x6')]]['connectedlinename']=_0x444577[_0x8128('0x39')];}}catch(_0x497c7c){utils[_0x8128('0x1f')](util[_0x8128('0x4')](_0x8128('0x31'),_0x444577[_0x8128('0x6')]),_0x497c7c);}};exports[_0x8128('0x3a')]=function(_0xb494a4){try{if(!_[_0x8128('0x21')](queues[_0xb494a4[_0x8128('0x6')]])){utils['debug'](util[_0x8128('0x4')](_0x8128('0x3b'),_0xb494a4['uniqueid']),_0xb494a4);utils['info'](util[_0x8128('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0xb494a4[_0x8128('0x6')],queues[_0xb494a4[_0x8128('0x6')]][_0x8128('0x2f')],_0xb494a4['membername'],_0xb494a4['destaccountcode']));queues[_0xb494a4[_0x8128('0x6')]][_0x8128('0x18')]=![];queues[_0xb494a4[_0x8128('0x6')]][_0x8128('0x18')]=![];queues[_0xb494a4[_0x8128('0x6')]][_0x8128('0x26')]=null;queues[_0xb494a4['uniqueid']][_0x8128('0x19')]=![];queues[_0xb494a4[_0x8128('0x6')]]['queuecallerexitreason']=null;queues[_0xb494a4[_0x8128('0x6')]][_0x8128('0x2c')]=null;queues[_0xb494a4['uniqueid']]['assigned']=!![];queues[_0xb494a4[_0x8128('0x6')]][_0x8128('0xa')]=_0xb494a4['destaccountcode'];queues[_0xb494a4[_0x8128('0x6')]]['lastAssignedTo']=_0xb494a4[_0x8128('0x3c')];}}catch(_0x1d78ef){utils['error'](util[_0x8128('0x4')]('[%s][queues][agentconnect]',_0xb494a4[_0x8128('0x6')]),_0x1d78ef);}};exports['agentcomplete']=function(_0x370b1c){try{if(!_[_0x8128('0x21')](queues[_0x370b1c[_0x8128('0x6')]])){if(queues[_0x370b1c[_0x8128('0x6')]]['queuecallerleaveAt']){utils[_0x8128('0x15')](util[_0x8128('0x4')](_0x8128('0x3d'),_0x370b1c[_0x8128('0x6')]),_0x370b1c);queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x18')]=![];queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x18')]=![];queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x26')]=null;queues[_0x370b1c['uniqueid']][_0x8128('0x19')]=![];queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x2c')]=null;queues[_0x370b1c['uniqueid']][_0x8128('0x3e')]=!![];queues[_0x370b1c['uniqueid']][_0x8128('0x9')]=_0x370b1c[_0x8128('0x3c')];queues[_0x370b1c['uniqueid']][_0x8128('0x1a')]=!![];queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x1b')]=utils['now']();if(_0x370b1c['reason']==_0x8128('0x3f')){if(!queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x3f')]){queues[_0x370b1c[_0x8128('0x6')]]['queuecallerexitreason']=_0x8128('0x40');}}else{queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x1c')]='COMPLETEDBY'+_0x370b1c['reason'][_0x8128('0x24')]();}utils[_0x8128('0x3')](util['format'](_0x8128('0x41'),_0x370b1c[_0x8128('0x6')],queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x2f')],_0x370b1c[_0x8128('0x3c')],queues[_0x370b1c[_0x8128('0x6')]][_0x8128('0x1c')]));writeDB(queues[_0x370b1c['uniqueid']]);}}}catch(_0x148c0a){utils[_0x8128('0x1f')](util['format']('[%s][queues][agentcomplete]',_0x370b1c[_0x8128('0x6')]),_0x148c0a);}};exports[_0x8128('0x42')]=function(_0x542c75){try{if(!_[_0x8128('0x21')](queues[_0x542c75[_0x8128('0x43')]])){utils[_0x8128('0x15')](util[_0x8128('0x4')](_0x8128('0x44'),_0x542c75[_0x8128('0x6')]),_0x542c75);queues[_0x542c75[_0x8128('0x43')]][_0x8128('0x3f')]=!![];queues[_0x542c75['transfereeuniqueid']][_0x8128('0x45')]=_0x8128('0x46');queues[_0x542c75[_0x8128('0x43')]]['transferexten']=_0x542c75[_0x8128('0x47')];queues[_0x542c75[_0x8128('0x43')]][_0x8128('0x48')]=_0x542c75['transfereeuniqueid'];queues[_0x542c75[_0x8128('0x43')]]['queuecallerexitreason']=_0x8128('0x49');utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x4a'),_0x542c75[_0x8128('0x6')],queues[_0x542c75['transfereeuniqueid']][_0x8128('0x2f')],_0x542c75[_0x8128('0x43')],_0x542c75[_0x8128('0x47')]));}}catch(_0x96d570){utils['error'](util[_0x8128('0x4')](_0x8128('0x44'),_0x542c75[_0x8128('0x6')]),_0x96d570);}};exports['attendedtransfer']=function(_0x2e397d){try{utils['debug'](util[_0x8128('0x4')](_0x8128('0x4b'),_0x2e397d['origtransfereruniqueid']),_0x2e397d);if(_0x2e397d['origtransfereruniqueid']==_0x2e397d[_0x8128('0x4c')]){if(!_[_0x8128('0x21')](queues[_0x2e397d[_0x8128('0x4d')]])){utils[_0x8128('0x3')](util['format'](_0x8128('0x4e'),_0x2e397d[_0x8128('0x4f')],queues[_0x2e397d[_0x8128('0x4d')]]['name'],_0x2e397d['origtransfererexten']));queues[_0x2e397d[_0x8128('0x4d')]][_0x8128('0x3f')]=!![];queues[_0x2e397d[_0x8128('0x4d')]][_0x8128('0x45')]=_0x8128('0x50');queues[_0x2e397d[_0x8128('0x4d')]]['transferexten']=_0x2e397d[_0x8128('0x51')];queues[_0x2e397d[_0x8128('0x4d')]]['transferuniqueid']=_0x2e397d[_0x8128('0x4f')];queues[_0x2e397d[_0x8128('0x4d')]][_0x8128('0x1c')]=_0x8128('0x52');}if(!_[_0x8128('0x21')](queues[_0x2e397d['origtransfererlinkedid']])){if(_0x2e397d['transfereelinkedid']&&queues[_0x2e397d['transfereelinkedid']]){queues[_0x2e397d['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x2e397d['transfereeuniqueid']]=_[_0x8128('0x53')](queues[_0x2e397d[_0x8128('0x54')]]);queues[_0x2e397d[_0x8128('0x43')]][_0x8128('0x10')]=_0x2e397d[_0x8128('0x55')];queues[_0x2e397d[_0x8128('0x43')]][_0x8128('0x1e')]=0x2;queues[_0x2e397d['transfereeuniqueid']][_0x8128('0x56')]=queues[_0x2e397d['secondtransfererlinkedid']][_0x8128('0x56')];queues[_0x2e397d[_0x8128('0x43')]][_0x8128('0x57')]=queues[_0x2e397d['secondtransfererlinkedid']][_0x8128('0x57')];queues[_0x2e397d[_0x8128('0x43')]][_0x8128('0x36')]=utils['now']();queues[_0x2e397d[_0x8128('0x43')]][_0x8128('0x17')]=utils[_0x8128('0x14')]();queues[_0x2e397d['transfereeuniqueid']]['holdtime']=0x0;queues[_0x2e397d[_0x8128('0x43')]]['mohtime']=0x0;utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x58'),_0x2e397d[_0x8128('0x4f')],queues[_0x2e397d['transfereeuniqueid']][_0x8128('0x2f')],queues[_0x2e397d['transfereeuniqueid']][_0x8128('0x56')],queues[_0x2e397d['transfereeuniqueid']][_0x8128('0x57')]));}else{utils['info'](util[_0x8128('0x4')](_0x8128('0x59'),_0x2e397d[_0x8128('0x4f')],queues[_0x2e397d[_0x8128('0x4c')]][_0x8128('0x2f')],_0x2e397d['secondtransfererlinkedid']));queues[_0x2e397d[_0x8128('0x4c')]][_0x8128('0x10')]=_0x2e397d[_0x8128('0x4d')];}}}else if(_0x2e397d[_0x8128('0x5a')]==_0x2e397d[_0x8128('0x4d')]){if(!_[_0x8128('0x21')](queues[_0x2e397d[_0x8128('0x4c')]])){utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x5b'),_0x2e397d['origtransfereruniqueid'],queues[_0x2e397d[_0x8128('0x4c')]]['name'],_0x2e397d['secondtransfereruniqueid'],_0x2e397d['secondtransfererexten']));queues[_0x2e397d[_0x8128('0x4c')]][_0x8128('0x3f')]=!![];queues[_0x2e397d[_0x8128('0x4c')]]['transfertype']=_0x8128('0x50');queues[_0x2e397d[_0x8128('0x4c')]][_0x8128('0x5c')]=_0x2e397d[_0x8128('0x5d')];queues[_0x2e397d[_0x8128('0x4c')]][_0x8128('0x48')]=_0x2e397d[_0x8128('0x5a')];queues[_0x2e397d[_0x8128('0x4c')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x8128('0x21')](queues[_0x2e397d[_0x8128('0x4d')]])){if(_0x2e397d['transfertargetlinkedid']&&queues[_0x2e397d['transfertargetlinkedid']]){queues[_0x2e397d[_0x8128('0x5e')]][_0x8128('0x1e')]=0x1;queues[_0x2e397d['transfertargetuniqueid']]=_[_0x8128('0x53')](queues[_0x2e397d[_0x8128('0x5e')]]);queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x10')]=_0x2e397d[_0x8128('0x55')];queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x1e')]=0x2;queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x56')]=queues[_0x2e397d[_0x8128('0x4c')]][_0x8128('0x56')];queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x57')]=queues[_0x2e397d[_0x8128('0x4c')]][_0x8128('0x57')];queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x36')]=utils['now']();queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x17')]=utils[_0x8128('0x14')]();queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x34')]=0x0;queues[_0x2e397d['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x5f'),_0x2e397d[_0x8128('0x4f')],queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x2f')],queues[_0x2e397d[_0x8128('0x55')]]['transfereduniqueid'],queues[_0x2e397d['transfertargetuniqueid']][_0x8128('0x56')],queues[_0x2e397d[_0x8128('0x55')]][_0x8128('0x57')]));}else{utils[_0x8128('0x3')](util[_0x8128('0x4')](_0x8128('0x59'),_0x2e397d[_0x8128('0x4f')],queues[_0x2e397d[_0x8128('0x4d')]][_0x8128('0x2f')],_0x2e397d[_0x8128('0x4c')]));queues[_0x2e397d[_0x8128('0x4d')]][_0x8128('0x10')]=_0x2e397d[_0x8128('0x4c')];}}}}catch(_0xde5ab1){utils[_0x8128('0x1f')](util[_0x8128('0x4')](_0x8128('0x4b'),_0x2e397d[_0x8128('0x4f')]),_0xde5ab1);}};exports['musiconholdstart']=function(_0x5a44c8){try{if(!_[_0x8128('0x21')](queues[_0x5a44c8[_0x8128('0x6')]])){utils['debug'](util[_0x8128('0x4')]('[%s][queues][musiconholdstart]',_0x5a44c8[_0x8128('0x6')]),_0x5a44c8);queues[_0x5a44c8[_0x8128('0x6')]][_0x8128('0x60')]=utils['now']();utils['info'](util[_0x8128('0x4')](_0x8128('0x61'),_0x5a44c8[_0x8128('0x6')],queues[_0x5a44c8[_0x8128('0x6')]][_0x8128('0x2f')],queues[_0x5a44c8['uniqueid']]['musiconholdstartAt']));}}catch(_0x577b48){utils['error'](util['format'](_0x8128('0x62'),_0x5a44c8['uniqueid']),_0x577b48);}};exports[_0x8128('0x63')]=function(_0x4e1e86){try{if(!_[_0x8128('0x21')](queues[_0x4e1e86[_0x8128('0x6')]])){if(!_[_0x8128('0x21')](queues[_0x4e1e86[_0x8128('0x6')]][_0x8128('0x60')])){utils[_0x8128('0x15')](util['format']('[%s][queues][musiconholdstop]',_0x4e1e86[_0x8128('0x6')]),_0x4e1e86);queues[_0x4e1e86[_0x8128('0x6')]][_0x8128('0x64')]+=utils[_0x8128('0x35')](utils[_0x8128('0x14')](),queues[_0x4e1e86[_0x8128('0x6')]][_0x8128('0x60')]);utils[_0x8128('0x3')](util['format'](_0x8128('0x65'),_0x4e1e86[_0x8128('0x6')],queues[_0x4e1e86[_0x8128('0x6')]][_0x8128('0x2f')],queues[_0x4e1e86[_0x8128('0x6')]][_0x8128('0x64')]));delete queues[_0x4e1e86['uniqueid']][_0x8128('0x60')];}}}catch(_0x1f3ccd){utils[_0x8128('0x1f')](util[_0x8128('0x4')](_0x8128('0x66'),_0x4e1e86[_0x8128('0x6')]),_0x1f3ccd);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d93fd40..4e76f9c 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 _0x11f9=['hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors'];(function(_0x513465,_0x2b69c6){var _0x48e9e6=function(_0x438ae2){while(--_0x438ae2){_0x513465['push'](_0x513465['shift']());}};_0x48e9e6(++_0x2b69c6);}(_0x11f9,0x1d0));var _0x911f=function(_0x4dfa91,_0x30be73){_0x4dfa91=_0x4dfa91-0x0;var _0x511504=_0x11f9[_0x4dfa91];return _0x511504;};'use strict';var _=require(_0x911f('0x0'));var util=require(_0x911f('0x1'));var utils=require(_0x911f('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x5d08cf){var _0x4f721e;utils[_0x911f('0x3')](util[_0x911f('0x4')](_0x911f('0x5'),_0x5d08cf[_0x911f('0x6')]));if(transfers['blinds'][_0x5d08cf[_0x911f('0x6')]]){_0x4f721e=_0x5d08cf[_0x911f('0x6')];_0x5d08cf[_0x911f('0x6')]=transfers[_0x911f('0x7')][_0x5d08cf[_0x911f('0x6')]][_0x911f('0x8')];}if(_0x5d08cf[_0x911f('0x9')]){utils[_0x911f('0xa')](_0x5d08cf[_0x911f('0x9')])[_0x911f('0xb')](function(_0x23bc05){if(_0x23bc05){_0x5d08cf[_0x911f('0xc')]=_0x23bc05[_0x911f('0xd')];_0x5d08cf['UserId']=_0x23bc05['id'];}utils[_0x911f('0xe')](_0x911f('0xf'),_0x5d08cf);});}else{utils[_0x911f('0xe')]('CreateVoiceRecording',_0x5d08cf);}if(_0x4f721e)delete transfers['blinds'][_0x4f721e];}exports['newchannel']=function(_0x300859){try{utils[_0x911f('0x10')](util[_0x911f('0x4')]('[%s][recordings][newchannel]',_0x300859[_0x911f('0x6')]),_0x300859);if(_0x300859['uniqueid']==_0x300859[_0x911f('0x11')]){utils['info'](util['format'](_0x911f('0x12'),_0x300859[_0x911f('0x6')],_0x300859[_0x911f('0x13')],_0x300859[_0x911f('0x14')]));recordings[_0x300859[_0x911f('0x6')]]={'uniqueid':_0x300859['uniqueid'],'accountcode':_0x300859[_0x911f('0x9')],'exten':_0x300859[_0x911f('0x14')],'context':_0x300859['context'],'channel':_0x300859['channel'],'monitors':[]};}}catch(_0x136210){utils[_0x911f('0x15')](util[_0x911f('0x4')]('[%s][recordings][newchannel]',_0x300859[_0x911f('0x6')]),_0x136210);}};exports[_0x911f('0x16')]=function(_0x3eb268){try{utils[_0x911f('0x10')](util[_0x911f('0x4')](_0x911f('0x17'),_0x3eb268[_0x911f('0x6')]),_0x3eb268);if(!_[_0x911f('0x18')](recordings[_0x3eb268[_0x911f('0x6')]])&&_0x3eb268['channelstate']==0x6){utils[_0x911f('0x3')](util[_0x911f('0x4')](_0x911f('0x19'),_0x3eb268[_0x911f('0x6')],_0x3eb268[_0x911f('0x13')],_0x3eb268[_0x911f('0x1a')]));}else if(!_[_0x911f('0x18')](recordings[_0x3eb268[_0x911f('0x11')]])&&_0x3eb268[_0x911f('0x1b')]==0x6&&_0x3eb268[_0x911f('0x13')]!='transfer'){utils['info'](util[_0x911f('0x4')](_0x911f('0x1c'),_0x3eb268['uniqueid'],_0x3eb268[_0x911f('0x11')],_0x3eb268[_0x911f('0x13')],_0x3eb268['channel']));recordings[_0x3eb268[_0x911f('0x11')]][_0x911f('0x9')]=_0x3eb268[_0x911f('0x9')];}}catch(_0x161d09){utils[_0x911f('0x15')](util[_0x911f('0x4')](_0x911f('0x17'),_0x3eb268['uniqueid']),_0x161d09);}};exports[_0x911f('0x1d')]=function(_0x12161a){try{if(!_[_0x911f('0x18')](_0x12161a[_0x911f('0x1e')])&&!_[_0x911f('0x18')](_0x12161a[_0x911f('0x1e')][_0x911f('0x1f')])){utils[_0x911f('0x10')](util[_0x911f('0x4')](_0x911f('0x20'),_0x12161a[_0x911f('0x6')]),_0x12161a);utils[_0x911f('0x3')](util[_0x911f('0x4')](_0x911f('0x21'),_0x12161a[_0x911f('0x6')],_0x12161a[_0x911f('0x1e')],_0x12161a[_0x911f('0x22')]));if(_[_0x911f('0x23')](_0x12161a[_0x911f('0x22')],_0x911f('0x24'))){_0x12161a[_0x911f('0x22')]=_0x12161a[_0x911f('0x22')][_0x911f('0x25')](_0x911f('0x24'),'.WAV');}if(recordings[_0x12161a['linkedid']]){var _0x1ae2f0=_[_0x911f('0x26')](recordings[_0x12161a[_0x911f('0x11')]][_0x911f('0x27')],{'value':_0x12161a['value']});if(_[_0x911f('0x18')](_0x1ae2f0)){recordings[_0x12161a[_0x911f('0x11')]][_0x911f('0x27')]['push']({'value':_0x12161a[_0x911f('0x22')]});}}}}catch(_0x59db93){utils[_0x911f('0x15')](util[_0x911f('0x4')]('[%s][recordings][varset]',_0x12161a[_0x911f('0x6')]),_0x59db93);}};exports[_0x911f('0x28')]=function(_0x5ab2b2){try{if(!_[_0x911f('0x18')](recordings[_0x5ab2b2[_0x911f('0x6')]])){utils[_0x911f('0x10')](util['format']('[%s][recordings][hangup]',_0x5ab2b2[_0x911f('0x6')]),_0x5ab2b2);utils[_0x911f('0x3')](util[_0x911f('0x4')](_0x911f('0x29'),_0x5ab2b2[_0x911f('0x6')],_0x5ab2b2['calleridnum'],_0x5ab2b2['calleridname'],_0x5ab2b2['cause-txt']));recordings[_0x5ab2b2['uniqueid']][_0x911f('0x2a')]=_0x5ab2b2['calleridnum'];recordings[_0x5ab2b2[_0x911f('0x6')]][_0x911f('0x2b')]=_0x5ab2b2[_0x911f('0x2b')];recordings[_0x5ab2b2['uniqueid']]['connectedlinenum']=_0x5ab2b2[_0x911f('0x2c')];recordings[_0x5ab2b2[_0x911f('0x6')]][_0x911f('0x2d')]=_0x5ab2b2[_0x911f('0x2d')];if(recordings[_0x5ab2b2['uniqueid']][_0x911f('0x2e')]==_0x911f('0x2f')&&recordings[_0x5ab2b2[_0x911f('0x6')]][_0x911f('0x9')]){recordings[_0x5ab2b2[_0x911f('0x6')]][_0x911f('0x2c')]=recordings[_0x5ab2b2[_0x911f('0x6')]][_0x911f('0x9')];recordings[_0x5ab2b2[_0x911f('0x6')]][_0x911f('0x2d')]='';}recordings[_0x5ab2b2[_0x911f('0x6')]][_0x911f('0x27')][_0x911f('0x30')](function(_0x157338){var _0x272bf1=_['clone'](recordings[_0x5ab2b2[_0x911f('0x6')]]);_0x272bf1[_0x911f('0x22')]=_0x157338[_0x911f('0x22')];writeDB(_0x272bf1);});delete recordings[_0x5ab2b2[_0x911f('0x6')]];}}catch(_0x51abd0){utils[_0x911f('0x15')](util[_0x911f('0x4')](_0x911f('0x31'),_0x5ab2b2['uniqueid']),_0x51abd0);}};exports[_0x911f('0x32')]=function(_0x424c0e){try{if(!_[_0x911f('0x18')](recordings[_0x424c0e[_0x911f('0x6')]])){utils[_0x911f('0x10')](util[_0x911f('0x4')](_0x911f('0x33'),_0x424c0e[_0x911f('0x6')]),_0x424c0e);utils[_0x911f('0x3')](util[_0x911f('0x4')](_0x911f('0x34'),_0x424c0e['uniqueid'],_0x424c0e[_0x911f('0x35')],_0x424c0e[_0x911f('0x36')]));if(_0x424c0e[_0x911f('0x35')][_0x911f('0x37')]()=='set'&&_[_0x911f('0x38')](_0x424c0e[_0x911f('0x36')][_0x911f('0x37')](),_0x911f('0x39'))){var _0x48015c=_0x424c0e[_0x911f('0x36')][_0x911f('0x3a')]('=');var _0x2bf9a4=_0x48015c[0x0][_0x911f('0x3b')](_0x48015c[0x0]['lastIndexOf']('(')+0x1,_0x48015c[0x0][_0x911f('0x3c')](')'));var _0x476914=_0x48015c[0x1];recordings[_0x424c0e['uniqueid']][_0x2bf9a4]=_0x476914;}}}catch(_0x1e9a1c){utils[_0x911f('0x15')](util[_0x911f('0x4')](_0x911f('0x33'),_0x424c0e[_0x911f('0x6')]),_0x1e9a1c);}};exports[_0x911f('0x3d')]=function(_0x909dd6){try{if(!_['isNil'](recordings[_0x909dd6['uniqueid']])){utils[_0x911f('0x10')](util[_0x911f('0x4')]('[%s][recordings][queuecallerjoin]',_0x909dd6['uniqueid']),_0x909dd6);utils[_0x911f('0x3')](util[_0x911f('0x4')](_0x911f('0x3e'),_0x909dd6['uniqueid'],_0x909dd6[_0x911f('0x3f')]));recordings[_0x909dd6['uniqueid']][_0x911f('0x3f')]=_0x909dd6[_0x911f('0x3f')];}}catch(_0x270b4e){utils[_0x911f('0x15')](util[_0x911f('0x4')](_0x911f('0x40'),_0x909dd6['uniqueid']),_0x270b4e);}};exports[_0x911f('0x41')]=function(_0x49cd91){try{utils[_0x911f('0x10')](util[_0x911f('0x4')](_0x911f('0x42'),_0x49cd91[_0x911f('0x6')]),_0x49cd91);utils[_0x911f('0x3')](util['format'](_0x911f('0x43'),_0x49cd91[_0x911f('0x6')],_0x49cd91['transferercalleridnum'],_0x49cd91['transferercalleridname'],_0x49cd91[_0x911f('0x44')],_0x49cd91[_0x911f('0x45')]));if(recordings[_0x49cd91[_0x911f('0x46')]]&&transfers[_0x911f('0x7')][_0x49cd91[_0x911f('0x46')]]){transfers[_0x911f('0x7')][_0x49cd91[_0x911f('0x46')]][_0x911f('0x47')]=!![];}}catch(_0x120762){utils[_0x911f('0x15')](util[_0x911f('0x4')](_0x911f('0x42'),_0x49cd91[_0x911f('0x6')]),_0x120762);}}; \ No newline at end of file +var _0xaae4=['transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','blinds'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaae4,0x120));var _0x4aae=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xaae4[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4aae('0x0'));var util=require(_0x4aae('0x1'));var utils=require(_0x4aae('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x1fd6a2){var _0x217bd4;utils[_0x4aae('0x3')](util[_0x4aae('0x4')](_0x4aae('0x5'),_0x1fd6a2[_0x4aae('0x6')]));if(transfers[_0x4aae('0x7')][_0x1fd6a2['uniqueid']]){_0x217bd4=_0x1fd6a2[_0x4aae('0x6')];_0x1fd6a2[_0x4aae('0x6')]=transfers['blinds'][_0x1fd6a2[_0x4aae('0x6')]][_0x4aae('0x8')];}if(_0x1fd6a2[_0x4aae('0x9')]){utils[_0x4aae('0xa')](_0x1fd6a2[_0x4aae('0x9')])[_0x4aae('0xb')](function(_0x1044bc){if(_0x1044bc){_0x1fd6a2[_0x4aae('0xc')]=_0x1044bc[_0x4aae('0xd')];_0x1fd6a2['UserId']=_0x1044bc['id'];}utils[_0x4aae('0xe')](_0x4aae('0xf'),_0x1fd6a2);});}else{utils['request'](_0x4aae('0xf'),_0x1fd6a2);}if(_0x217bd4)delete transfers['blinds'][_0x217bd4];}exports[_0x4aae('0x10')]=function(_0x55ddcf){try{utils['debug'](util[_0x4aae('0x4')]('[%s][recordings][newchannel]',_0x55ddcf[_0x4aae('0x6')]),_0x55ddcf);if(_0x55ddcf['uniqueid']==_0x55ddcf[_0x4aae('0x11')]){utils[_0x4aae('0x3')](util[_0x4aae('0x4')](_0x4aae('0x12'),_0x55ddcf[_0x4aae('0x6')],_0x55ddcf[_0x4aae('0x13')],_0x55ddcf[_0x4aae('0x14')]));recordings[_0x55ddcf['uniqueid']]={'uniqueid':_0x55ddcf[_0x4aae('0x6')],'accountcode':_0x55ddcf[_0x4aae('0x9')],'exten':_0x55ddcf[_0x4aae('0x14')],'context':_0x55ddcf[_0x4aae('0x13')],'channel':_0x55ddcf[_0x4aae('0x15')],'monitors':[]};}}catch(_0xc6d3d6){utils[_0x4aae('0x16')](util[_0x4aae('0x4')](_0x4aae('0x17'),_0x55ddcf[_0x4aae('0x6')]),_0xc6d3d6);}};exports[_0x4aae('0x18')]=function(_0x4fdaa4){try{utils[_0x4aae('0x19')](util[_0x4aae('0x4')](_0x4aae('0x1a'),_0x4fdaa4[_0x4aae('0x6')]),_0x4fdaa4);if(!_[_0x4aae('0x1b')](recordings[_0x4fdaa4[_0x4aae('0x6')]])&&_0x4fdaa4[_0x4aae('0x1c')]==0x6){utils[_0x4aae('0x3')](util[_0x4aae('0x4')](_0x4aae('0x1d'),_0x4fdaa4[_0x4aae('0x6')],_0x4fdaa4[_0x4aae('0x13')],_0x4fdaa4[_0x4aae('0x15')]));}else if(!_[_0x4aae('0x1b')](recordings[_0x4fdaa4[_0x4aae('0x11')]])&&_0x4fdaa4[_0x4aae('0x1c')]==0x6&&_0x4fdaa4[_0x4aae('0x13')]!=_0x4aae('0x1e')){utils[_0x4aae('0x3')](util[_0x4aae('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4fdaa4[_0x4aae('0x6')],_0x4fdaa4[_0x4aae('0x11')],_0x4fdaa4['context'],_0x4fdaa4['channel']));recordings[_0x4fdaa4[_0x4aae('0x11')]][_0x4aae('0x9')]=_0x4fdaa4[_0x4aae('0x9')];}}catch(_0x480d6d){utils[_0x4aae('0x16')](util['format'](_0x4aae('0x1a'),_0x4fdaa4['uniqueid']),_0x480d6d);}};exports[_0x4aae('0x1f')]=function(_0x5806ba){try{if(!_[_0x4aae('0x1b')](_0x5806ba[_0x4aae('0x20')])&&!_[_0x4aae('0x1b')](_0x5806ba['variable'][_0x4aae('0x21')])){utils[_0x4aae('0x19')](util[_0x4aae('0x4')](_0x4aae('0x22'),_0x5806ba['uniqueid']),_0x5806ba);utils[_0x4aae('0x3')](util[_0x4aae('0x4')](_0x4aae('0x23'),_0x5806ba[_0x4aae('0x6')],_0x5806ba[_0x4aae('0x20')],_0x5806ba['value']));if(_[_0x4aae('0x24')](_0x5806ba[_0x4aae('0x25')],_0x4aae('0x26'))){_0x5806ba['value']=_0x5806ba['value'][_0x4aae('0x27')]('.wav49',_0x4aae('0x28'));}if(recordings[_0x5806ba[_0x4aae('0x11')]]){var _0x5940c0=_[_0x4aae('0x29')](recordings[_0x5806ba['linkedid']][_0x4aae('0x2a')],{'value':_0x5806ba[_0x4aae('0x25')]});if(_[_0x4aae('0x1b')](_0x5940c0)){recordings[_0x5806ba[_0x4aae('0x11')]]['monitors'][_0x4aae('0x2b')]({'value':_0x5806ba[_0x4aae('0x25')]});}}}}catch(_0x34f601){utils[_0x4aae('0x16')](util[_0x4aae('0x4')](_0x4aae('0x22'),_0x5806ba[_0x4aae('0x6')]),_0x34f601);}};exports[_0x4aae('0x2c')]=function(_0x107b07){try{if(!_[_0x4aae('0x1b')](recordings[_0x107b07['uniqueid']])){utils[_0x4aae('0x19')](util[_0x4aae('0x4')]('[%s][recordings][hangup]',_0x107b07['uniqueid']),_0x107b07);utils[_0x4aae('0x3')](util[_0x4aae('0x4')](_0x4aae('0x2d'),_0x107b07['uniqueid'],_0x107b07[_0x4aae('0x2e')],_0x107b07[_0x4aae('0x2f')],_0x107b07['cause-txt']));recordings[_0x107b07[_0x4aae('0x6')]][_0x4aae('0x2e')]=_0x107b07[_0x4aae('0x2e')];recordings[_0x107b07[_0x4aae('0x6')]][_0x4aae('0x2f')]=_0x107b07['calleridname'];recordings[_0x107b07['uniqueid']][_0x4aae('0x30')]=_0x107b07['connectedlinenum'];recordings[_0x107b07[_0x4aae('0x6')]]['connectedlinename']=_0x107b07[_0x4aae('0x31')];if(recordings[_0x107b07[_0x4aae('0x6')]]['type']=='outbound'&&recordings[_0x107b07[_0x4aae('0x6')]][_0x4aae('0x9')]){recordings[_0x107b07['uniqueid']][_0x4aae('0x30')]=recordings[_0x107b07[_0x4aae('0x6')]][_0x4aae('0x9')];recordings[_0x107b07[_0x4aae('0x6')]][_0x4aae('0x31')]='';}recordings[_0x107b07[_0x4aae('0x6')]][_0x4aae('0x2a')][_0x4aae('0x32')](function(_0x335834){var _0x285d54=_[_0x4aae('0x33')](recordings[_0x107b07[_0x4aae('0x6')]]);_0x285d54[_0x4aae('0x25')]=_0x335834[_0x4aae('0x25')];writeDB(_0x285d54);});delete recordings[_0x107b07[_0x4aae('0x6')]];}}catch(_0x5cfa79){utils[_0x4aae('0x16')](util[_0x4aae('0x4')](_0x4aae('0x34'),_0x107b07[_0x4aae('0x6')]),_0x5cfa79);}};exports[_0x4aae('0x35')]=function(_0x2eb3dd){try{if(!_['isNil'](recordings[_0x2eb3dd[_0x4aae('0x6')]])){utils[_0x4aae('0x19')](util[_0x4aae('0x4')]('[%s][recordings][newexten]',_0x2eb3dd[_0x4aae('0x6')]),_0x2eb3dd);utils['info'](util[_0x4aae('0x4')](_0x4aae('0x36'),_0x2eb3dd['uniqueid'],_0x2eb3dd['application'],_0x2eb3dd['appdata']));if(_0x2eb3dd['application'][_0x4aae('0x37')]()==_0x4aae('0x38')&&_[_0x4aae('0x39')](_0x2eb3dd[_0x4aae('0x3a')]['toLowerCase'](),_0x4aae('0x3b'))){var _0x541a17=_0x2eb3dd[_0x4aae('0x3a')][_0x4aae('0x3c')]('=');var _0x37434d=_0x541a17[0x0]['substring'](_0x541a17[0x0][_0x4aae('0x3d')]('(')+0x1,_0x541a17[0x0][_0x4aae('0x3d')](')'));var _0x12c415=_0x541a17[0x1];recordings[_0x2eb3dd[_0x4aae('0x6')]][_0x37434d]=_0x12c415;}}}catch(_0x185291){utils[_0x4aae('0x16')](util['format'](_0x4aae('0x3e'),_0x2eb3dd[_0x4aae('0x6')]),_0x185291);}};exports[_0x4aae('0x3f')]=function(_0x2bd49b){try{if(!_['isNil'](recordings[_0x2bd49b['uniqueid']])){utils[_0x4aae('0x19')](util[_0x4aae('0x4')](_0x4aae('0x40'),_0x2bd49b[_0x4aae('0x6')]),_0x2bd49b);utils[_0x4aae('0x3')](util[_0x4aae('0x4')](_0x4aae('0x41'),_0x2bd49b[_0x4aae('0x6')],_0x2bd49b['queue']));recordings[_0x2bd49b[_0x4aae('0x6')]][_0x4aae('0x42')]=_0x2bd49b[_0x4aae('0x42')];}}catch(_0x32caee){utils[_0x4aae('0x16')](util[_0x4aae('0x4')](_0x4aae('0x40'),_0x2bd49b[_0x4aae('0x6')]),_0x32caee);}};exports[_0x4aae('0x43')]=function(_0x5be91d){try{utils[_0x4aae('0x19')](util[_0x4aae('0x4')](_0x4aae('0x44'),_0x5be91d['uniqueid']),_0x5be91d);utils[_0x4aae('0x3')](util['format'](_0x4aae('0x45'),_0x5be91d[_0x4aae('0x6')],_0x5be91d[_0x4aae('0x46')],_0x5be91d[_0x4aae('0x47')],_0x5be91d['transfereecalleridnum'],_0x5be91d[_0x4aae('0x48')]));if(recordings[_0x5be91d['transfereruniqueid']]&&transfers[_0x4aae('0x7')][_0x5be91d[_0x4aae('0x49')]]){transfers[_0x4aae('0x7')][_0x5be91d[_0x4aae('0x49')]]['recording']=!![];}}catch(_0x488ca4){utils[_0x4aae('0x16')](util[_0x4aae('0x4')](_0x4aae('0x44'),_0x5be91d[_0x4aae('0x6')]),_0x488ca4);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index e3fb325..1aea105 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 _0x36d3=['debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][blindtransfer]','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfereruniqueid','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','error','lodash','./utils','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type','CreateVoiceTransferReport','blinds','blindtransfer'];(function(_0x35464a,_0xd1fc4){var _0x2aeb64=function(_0x3f8bcb){while(--_0x3f8bcb){_0x35464a['push'](_0x35464a['shift']());}};_0x2aeb64(++_0xd1fc4);}(_0x36d3,0x1d6));var _0x336d=function(_0x581a07,_0x3bb875){_0x581a07=_0x581a07-0x0;var _0x48c338=_0x36d3[_0x581a07];return _0x48c338;};'use strict';var _=require(_0x336d('0x0'));var util=require('util');var utils=require(_0x336d('0x1'));function writeDB(_0x3c3a7c){utils['info'](util[_0x336d('0x2')](_0x336d('0x3'),_0x3c3a7c['type']===_0x336d('0x4')?_0x3c3a7c['origtransfereruniqueid']:_0x3c3a7c[_0x336d('0x5')],_0x3c3a7c[_0x336d('0x6')]));utils['request'](_0x336d('0x7'),_0x3c3a7c);}exports[_0x336d('0x8')]={};exports[_0x336d('0x9')]=function(_0x23ad94){try{utils[_0x336d('0xa')](util[_0x336d('0x2')]('[%s][transfers][blindtransfer]',_0x23ad94['uniqueid']),_0x23ad94);utils['info'](util['format'](_0x336d('0xb'),_0x23ad94['uniqueid'],_0x23ad94[_0x336d('0xc')],_0x23ad94['transferercalleridname'],_0x23ad94[_0x336d('0xd')],_0x23ad94[_0x336d('0xe')]));_0x23ad94['type']=_0x336d('0xf');exports[_0x336d('0x8')][_0x23ad94[_0x336d('0x10')]]=_0x23ad94;writeDB(_0x23ad94);}catch(_0x5ae7c9){utils['error'](util['format'](_0x336d('0x11'),_0x23ad94[_0x336d('0x5')]),_0x5ae7c9);}};exports['attendedtransfer']=function(_0x4fbc22){try{utils[_0x336d('0xa')](util['format'](_0x336d('0x12'),_0x4fbc22['origtransfereruniqueid']),_0x4fbc22);utils['info'](util[_0x336d('0x2')](_0x336d('0x13'),_0x4fbc22[_0x336d('0x14')],_0x4fbc22[_0x336d('0x15')],_0x4fbc22['origtransferercalleridname'],_0x4fbc22[_0x336d('0x16')],_0x4fbc22['transfertargetcalleridname']));_0x4fbc22=_[_0x336d('0x17')](_0x4fbc22,{'transfererchannel':_0x4fbc22['origtransfererchannel'],'transferercalleridnum':_0x4fbc22[_0x336d('0x15')],'transferercalleridname':_0x4fbc22[_0x336d('0x18')],'transfererconnectedlinenum':_0x4fbc22[_0x336d('0x19')],'transfererconnectedlinename':_0x4fbc22[_0x336d('0x1a')],'transfereraccountcode':_0x4fbc22[_0x336d('0x1b')],'transferercontext':_0x4fbc22[_0x336d('0x1c')],'transfererexten':_0x4fbc22[_0x336d('0x1d')],'transfererlinkedid':_0x4fbc22[_0x336d('0x1e')],'context':_0x4fbc22[_0x336d('0x1f')],'extension':_0x4fbc22[_0x336d('0x20')],'type':_0x336d('0x4')});if(_[_0x336d('0x21')](_0x4fbc22['transfereechannel'])){_0x4fbc22=_[_0x336d('0x17')](_0x4fbc22,{'transfereechannel':_0x4fbc22[_0x336d('0x22')],'transfereecalleridnum':_0x4fbc22[_0x336d('0x16')],'transfereecalleridname':_0x4fbc22[_0x336d('0x23')],'transfereeconnectedlinenum':_0x4fbc22['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4fbc22['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4fbc22[_0x336d('0x24')],'transfereecontext':_0x4fbc22[_0x336d('0x25')],'transfereeexten':_0x4fbc22[_0x336d('0x26')],'transfereelinkedid':_0x4fbc22['transfertargetlinkedid']});}writeDB(_0x4fbc22);}catch(_0x479f96){utils[_0x336d('0x27')](util['format'](_0x336d('0x12'),_0x4fbc22[_0x336d('0x14')]),_0x479f96);}}; \ No newline at end of file +var _0x9bb3=['blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','request','CreateVoiceTransferReport'];(function(_0x3b9189,_0xc5fa42){var _0x124df6=function(_0x4cbe1f){while(--_0x4cbe1f){_0x3b9189['push'](_0x3b9189['shift']());}};_0x124df6(++_0xc5fa42);}(_0x9bb3,0xd9));var _0x39bb=function(_0x2284a2,_0x4bf1f9){_0x2284a2=_0x2284a2-0x0;var _0x4a5567=_0x9bb3[_0x2284a2];return _0x4a5567;};'use strict';var _=require(_0x39bb('0x0'));var util=require(_0x39bb('0x1'));var utils=require(_0x39bb('0x2'));function writeDB(_0x4d3c72){utils[_0x39bb('0x3')](util[_0x39bb('0x4')](_0x39bb('0x5'),_0x4d3c72['type']==='attended'?_0x4d3c72['origtransfereruniqueid']:_0x4d3c72['uniqueid'],_0x4d3c72['type']));utils[_0x39bb('0x6')](_0x39bb('0x7'),_0x4d3c72);}exports[_0x39bb('0x8')]={};exports[_0x39bb('0x9')]=function(_0x476284){try{utils[_0x39bb('0xa')](util[_0x39bb('0x4')](_0x39bb('0xb'),_0x476284[_0x39bb('0xc')]),_0x476284);utils[_0x39bb('0x3')](util[_0x39bb('0x4')](_0x39bb('0xd'),_0x476284[_0x39bb('0xc')],_0x476284[_0x39bb('0xe')],_0x476284[_0x39bb('0xf')],_0x476284[_0x39bb('0x10')],_0x476284[_0x39bb('0x11')]));_0x476284['type']=_0x39bb('0x12');exports[_0x39bb('0x8')][_0x476284[_0x39bb('0x13')]]=_0x476284;writeDB(_0x476284);}catch(_0x3a7341){utils[_0x39bb('0x14')](util[_0x39bb('0x4')](_0x39bb('0xb'),_0x476284[_0x39bb('0xc')]),_0x3a7341);}};exports[_0x39bb('0x15')]=function(_0xdc61f7){try{utils['debug'](util['format'](_0x39bb('0x16'),_0xdc61f7['origtransfereruniqueid']),_0xdc61f7);utils[_0x39bb('0x3')](util['format'](_0x39bb('0x17'),_0xdc61f7[_0x39bb('0x18')],_0xdc61f7[_0x39bb('0x19')],_0xdc61f7[_0x39bb('0x1a')],_0xdc61f7[_0x39bb('0x1b')],_0xdc61f7[_0x39bb('0x1c')]));_0xdc61f7=_['assign'](_0xdc61f7,{'transfererchannel':_0xdc61f7[_0x39bb('0x1d')],'transferercalleridnum':_0xdc61f7[_0x39bb('0x19')],'transferercalleridname':_0xdc61f7[_0x39bb('0x1a')],'transfererconnectedlinenum':_0xdc61f7['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xdc61f7[_0x39bb('0x1e')],'transfereraccountcode':_0xdc61f7[_0x39bb('0x1f')],'transferercontext':_0xdc61f7['secondtransferercontext'],'transfererexten':_0xdc61f7[_0x39bb('0x20')],'transfererlinkedid':_0xdc61f7[_0x39bb('0x21')],'context':_0xdc61f7['origtransferercontext'],'extension':_0xdc61f7[_0x39bb('0x22')],'type':'attended'});if(_[_0x39bb('0x23')](_0xdc61f7[_0x39bb('0x24')])){_0xdc61f7=_[_0x39bb('0x25')](_0xdc61f7,{'transfereechannel':_0xdc61f7[_0x39bb('0x26')],'transfereecalleridnum':_0xdc61f7['transfertargetcalleridnum'],'transfereecalleridname':_0xdc61f7[_0x39bb('0x1c')],'transfereeconnectedlinenum':_0xdc61f7[_0x39bb('0x27')],'transfereeconnectedlinename':_0xdc61f7[_0x39bb('0x28')],'transfereeaccountcode':_0xdc61f7[_0x39bb('0x29')],'transfereecontext':_0xdc61f7[_0x39bb('0x2a')],'transfereeexten':_0xdc61f7[_0x39bb('0x2b')],'transfereelinkedid':_0xdc61f7[_0x39bb('0x2c')]});}writeDB(_0xdc61f7);}catch(_0x1e9284){utils[_0x39bb('0x14')](util[_0x39bb('0x4')]('[%s][transfers][attendedtransfer]',_0xdc61f7['origtransfereruniqueid']),_0x1e9284);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1a0907b..d070f53 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 _0x1fe7=['xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger'];(function(_0x388d01,_0x36ed5f){var _0x3442b4=function(_0x310147){while(--_0x310147){_0x388d01['push'](_0x388d01['shift']());}};_0x3442b4(++_0x36ed5f);}(_0x1fe7,0xe4));var _0x71fe=function(_0x56ee81,_0xca744f){_0x56ee81=_0x56ee81-0x0;var _0x4f0b02=_0x1fe7[_0x56ee81];return _0x4f0b02;};'use strict';var BPromise=require(_0x71fe('0x0'));var jayson=require(_0x71fe('0x1'));var moment=require(_0x71fe('0x2'));var util=require(_0x71fe('0x3'));var client=jayson[_0x71fe('0x4')][_0x71fe('0x5')]({'port':0x2329});var logger=require(_0x71fe('0x6'))(_0x71fe('0x7'));exports[_0x71fe('0x8')]=function(_0x40bd2f,_0x41396c){logger[_0x71fe('0x8')](_0x40bd2f,_0x41396c?util[_0x71fe('0x9')](_0x41396c,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x504d06,_0x57011e){logger[_0x71fe('0xa')](_0x504d06,_0x57011e?util[_0x71fe('0x9')](_0x57011e,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x1e022c,_0x42cf7b){logger[_0x71fe('0xb')](_0x1e022c,_0x42cf7b?util[_0x71fe('0x9')](_0x42cf7b,{'showHidden':![],'depth':null}):'');};exports[_0x71fe('0xc')]=function(_0x56b775,_0x419c3b){return client[_0x71fe('0xc')](_0x56b775,{'body':_0x419c3b})[_0x71fe('0xd')](function(_0x19f4fd){logger[_0x71fe('0xa')](_0x71fe('0xe'),_0x56b775,_0x19f4fd?util[_0x71fe('0x9')](_0x19f4fd,{'showHidden':![],'depth':null}):'');})[_0x71fe('0xf')](function(_0x3d3bda){logger['error'](_0x71fe('0xe'),_0x56b775,_0x3d3bda?util['inspect'](_0x3d3bda,{'showHidden':![],'depth':null}):'');});};function getUser(_0x551b78){return client['request'](_0x71fe('0x10'),{'options':{'raw':!![],'attributes':['id',_0x71fe('0x11'),_0x71fe('0x12'),_0x71fe('0x13')],'where':_0x551b78,'limit':0x1}})[_0x71fe('0xd')](function(_0x12573b){logger[_0x71fe('0xa')](_0x71fe('0x14'),JSON[_0x71fe('0x15')](_0x551b78),_0x12573b?util[_0x71fe('0x9')](_0x12573b,{'showHidden':![],'depth':null}):'');return _0x12573b[_0x71fe('0x16')][_0x71fe('0x17')]?_0x12573b[_0x71fe('0x16')][0x0]:null;});}exports[_0x71fe('0x18')]=function(_0x3ad76a){return new BPromise(function(_0x513ce3,_0x574987){if(_0x3ad76a){return getUser({'internal':_0x3ad76a})['then'](function(_0x2db114){logger['info'](_0x71fe('0x19'),_0x3ad76a,_0x2db114?_0x71fe('0x1a'):_0x71fe('0x1b'));return _0x513ce3(_0x2db114);})[_0x71fe('0xf')](function(_0xbd293c){logger[_0x71fe('0xb')](_0x71fe('0x1c'),_0xbd293c?util['inspect'](_0xbd293c,{'showHidden':![],'depth':null}):'');return _0x513ce3(null);});}return _0x513ce3(null);});};exports['getUserByInterface']=function(_0x339428){return new BPromise(function(_0x3a3c7d,_0x4644d9){if(_0x339428){return getUser({'interface':_0x339428})['then'](function(_0x4f458){logger[_0x71fe('0x8')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x339428,_0x4f458?_0x71fe('0x1a'):_0x71fe('0x1b'));return _0x3a3c7d(_0x4f458);})[_0x71fe('0xf')](function(_0x3f3eab){logger[_0x71fe('0xb')]('[utils][getUserByInterface]',_0x3f3eab?util[_0x71fe('0x9')](_0x3f3eab,{'showHidden':![],'depth':null}):'');return _0x3a3c7d(null);});}return _0x3a3c7d(null);});};exports[_0x71fe('0x1d')]=function(_0x311b16){return new BPromise(function(_0x2d7fc3,_0xdf99f){if(_0x311b16){return getUser({'name':_0x311b16})[_0x71fe('0xd')](function(_0x583850){logger[_0x71fe('0x8')](_0x71fe('0x1e'),_0x311b16,_0x583850?_0x71fe('0x1a'):'notfound');return _0x2d7fc3(_0x583850);})[_0x71fe('0xf')](function(_0x1d631d){logger[_0x71fe('0xb')]('[utils][getUserByName]',_0x1d631d?util[_0x71fe('0x9')](_0x1d631d,{'showHidden':![],'depth':null}):'');return _0x2d7fc3(null);});}return _0x2d7fc3(null);});};exports[_0x71fe('0x1f')]=function(_0x3ce060){return new BPromise(function(_0x504d6f,_0x134245){if(_0x3ce060){return client[_0x71fe('0xc')](_0x71fe('0x20'),{'options':{'raw':!![],'attributes':['id',_0x71fe('0x12'),_0x71fe('0x21'),_0x71fe('0x22'),_0x71fe('0x23')],'where':{'name':_0x3ce060},'limit':0x1}})[_0x71fe('0xd')](function(_0x1a6c08){logger[_0x71fe('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x3ce060,_0x1a6c08?util[_0x71fe('0x9')](_0x1a6c08,{'showHidden':![],'depth':null}):'');logger[_0x71fe('0x8')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x3ce060,_0x1a6c08?_0x71fe('0x1a'):_0x71fe('0x1b'));return _0x504d6f(_0x1a6c08[_0x71fe('0x16')][_0x71fe('0x17')]?_0x1a6c08[_0x71fe('0x16')][0x0]:null);})[_0x71fe('0xf')](function(_0x16dc73){logger[_0x71fe('0xb')]('[utils][getVoiceQueueByName]',_0x16dc73?util[_0x71fe('0x9')](_0x16dc73,{'showHidden':![],'depth':null}):'');return _0x504d6f(null);});}return _0x504d6f(null);});};exports[_0x71fe('0x24')]=function(_0x2f1b4c,_0x3a9a5b){return moment(_0x2f1b4c)['add'](_0x3a9a5b,_0x71fe('0x25'))[_0x71fe('0x26')](_0x71fe('0x27'));};exports['subtractTime']=function(_0x2e1653,_0x3ecad5){return moment(_0x2e1653)[_0x71fe('0x28')](_0x3ecad5,_0x71fe('0x25'))[_0x71fe('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x71fe('0x29')]=function(_0x2b5aa3,_0x382745){return moment(_0x2b5aa3)[_0x71fe('0x2a')](moment(_0x382745),_0x71fe('0x25'));};exports[_0x71fe('0x2b')]=function(_0x2b7103,_0x21dd9e){return parseInt(_0x2b7103,0xa)+parseInt(_0x21dd9e,0xa);};exports[_0x71fe('0x2c')]=function(){return moment()['format'](_0x71fe('0x27'));};exports[_0x71fe('0x2d')]=function(_0x52a70a,_0x1f0495){if(_0x1f0495){return moment(_0x52a70a)[_0x71fe('0x2d')](_0x1f0495);}return!![];};exports[_0x71fe('0x2e')]=function(_0x30bd27,_0x3a8dd8){if(_0x3a8dd8){return moment(_0x30bd27)[_0x71fe('0x2e')](_0x3a8dd8);}else if(_0x30bd27){return!![];}return![];}; \ No newline at end of file +var _0xb4a0=['[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s'];(function(_0x2d2030,_0x3aa483){var _0x17ab71=function(_0x4c9d71){while(--_0x4c9d71){_0x2d2030['push'](_0x2d2030['shift']());}};_0x17ab71(++_0x3aa483);}(_0xb4a0,0x1e8));var _0x0b4a=function(_0x1cab65,_0xefaf49){_0x1cab65=_0x1cab65-0x0;var _0x3c07e6=_0xb4a0[_0x1cab65];return _0x3c07e6;};'use strict';var BPromise=require(_0x0b4a('0x0'));var jayson=require('jayson/promise');var moment=require(_0x0b4a('0x1'));var util=require(_0x0b4a('0x2'));var client=jayson[_0x0b4a('0x3')][_0x0b4a('0x4')]({'port':0x2329});var logger=require(_0x0b4a('0x5'))(_0x0b4a('0x6'));exports[_0x0b4a('0x7')]=function(_0x4f6894,_0x4cc9b4){logger[_0x0b4a('0x7')](_0x4f6894,_0x4cc9b4?util[_0x0b4a('0x8')](_0x4cc9b4,{'showHidden':![],'depth':null}):'');};exports[_0x0b4a('0x9')]=function(_0x1bd469,_0x59389c){logger[_0x0b4a('0x9')](_0x1bd469,_0x59389c?util['inspect'](_0x59389c,{'showHidden':![],'depth':null}):'');};exports[_0x0b4a('0xa')]=function(_0x5e3b30,_0x3268ed){logger[_0x0b4a('0xa')](_0x5e3b30,_0x3268ed?util[_0x0b4a('0x8')](_0x3268ed,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0xd9a49a,_0x32e088){return client[_0x0b4a('0xb')](_0xd9a49a,{'body':_0x32e088})['then'](function(_0x415f6a){logger[_0x0b4a('0x9')](_0x0b4a('0xc'),_0xd9a49a,_0x415f6a?util[_0x0b4a('0x8')](_0x415f6a,{'showHidden':![],'depth':null}):'');})[_0x0b4a('0xd')](function(_0xad4a07){logger[_0x0b4a('0xa')]('[utils][request]\x20name:%s',_0xd9a49a,_0xad4a07?util['inspect'](_0xad4a07,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2600c2){return client[_0x0b4a('0xb')](_0x0b4a('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x0b4a('0xf'),_0x0b4a('0x10')],'where':_0x2600c2,'limit':0x1}})[_0x0b4a('0x11')](function(_0x36f62c){logger['debug'](_0x0b4a('0x12'),JSON[_0x0b4a('0x13')](_0x2600c2),_0x36f62c?util['inspect'](_0x36f62c,{'showHidden':![],'depth':null}):'');return _0x36f62c[_0x0b4a('0x14')]['length']?_0x36f62c[_0x0b4a('0x14')][0x0]:null;});}exports[_0x0b4a('0x15')]=function(_0x53ac74){return new BPromise(function(_0x41b911,_0xe2f8f3){if(_0x53ac74){return getUser({'internal':_0x53ac74})['then'](function(_0x3e28b7){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x53ac74,_0x3e28b7?_0x0b4a('0x16'):_0x0b4a('0x17'));return _0x41b911(_0x3e28b7);})[_0x0b4a('0xd')](function(_0x22c6a2){logger[_0x0b4a('0xa')](_0x0b4a('0x18'),_0x22c6a2?util[_0x0b4a('0x8')](_0x22c6a2,{'showHidden':![],'depth':null}):'');return _0x41b911(null);});}return _0x41b911(null);});};exports[_0x0b4a('0x19')]=function(_0x70ba55){return new BPromise(function(_0x58b4c6,_0x12392e){if(_0x70ba55){return getUser({'interface':_0x70ba55})[_0x0b4a('0x11')](function(_0x8ee139){logger[_0x0b4a('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x70ba55,_0x8ee139?_0x0b4a('0x16'):'notfound');return _0x58b4c6(_0x8ee139);})[_0x0b4a('0xd')](function(_0x47c154){logger['error'](_0x0b4a('0x1a'),_0x47c154?util[_0x0b4a('0x8')](_0x47c154,{'showHidden':![],'depth':null}):'');return _0x58b4c6(null);});}return _0x58b4c6(null);});};exports[_0x0b4a('0x1b')]=function(_0x28ca4f){return new BPromise(function(_0x5be910,_0x2c4bf6){if(_0x28ca4f){return getUser({'name':_0x28ca4f})[_0x0b4a('0x11')](function(_0x43d193){logger['info'](_0x0b4a('0x1c'),_0x28ca4f,_0x43d193?_0x0b4a('0x16'):_0x0b4a('0x17'));return _0x5be910(_0x43d193);})[_0x0b4a('0xd')](function(_0x119968){logger[_0x0b4a('0xa')](_0x0b4a('0x1d'),_0x119968?util[_0x0b4a('0x8')](_0x119968,{'showHidden':![],'depth':null}):'');return _0x5be910(null);});}return _0x5be910(null);});};exports[_0x0b4a('0x1e')]=function(_0x5bf0c7){return new BPromise(function(_0x192cd0,_0x37c8b3){if(_0x5bf0c7){return client[_0x0b4a('0xb')](_0x0b4a('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x0b4a('0xf'),_0x0b4a('0x20'),'acw',_0x0b4a('0x21')],'where':{'name':_0x5bf0c7},'limit':0x1}})[_0x0b4a('0x11')](function(_0x2f07ec){logger[_0x0b4a('0x9')](_0x0b4a('0x22'),_0x5bf0c7,_0x2f07ec?util[_0x0b4a('0x8')](_0x2f07ec,{'showHidden':![],'depth':null}):'');logger[_0x0b4a('0x7')](_0x0b4a('0x23'),_0x5bf0c7,_0x2f07ec?_0x0b4a('0x16'):_0x0b4a('0x17'));return _0x192cd0(_0x2f07ec[_0x0b4a('0x14')][_0x0b4a('0x24')]?_0x2f07ec['result'][0x0]:null);})[_0x0b4a('0xd')](function(_0x38f5b2){logger[_0x0b4a('0xa')]('[utils][getVoiceQueueByName]',_0x38f5b2?util['inspect'](_0x38f5b2,{'showHidden':![],'depth':null}):'');return _0x192cd0(null);});}return _0x192cd0(null);});};exports[_0x0b4a('0x25')]=function(_0x1b53c0,_0x51b8c5){return moment(_0x1b53c0)['add'](_0x51b8c5,_0x0b4a('0x26'))[_0x0b4a('0x27')](_0x0b4a('0x28'));};exports['subtractTime']=function(_0x311f90,_0xdd0ee9){return moment(_0x311f90)[_0x0b4a('0x29')](_0xdd0ee9,_0x0b4a('0x26'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x12cd99,_0x55516f){return moment(_0x12cd99)[_0x0b4a('0x2a')](moment(_0x55516f),_0x0b4a('0x26'));};exports[_0x0b4a('0x2b')]=function(_0x4eab76,_0x559418){return parseInt(_0x4eab76,0xa)+parseInt(_0x559418,0xa);};exports[_0x0b4a('0x2c')]=function(){return moment()[_0x0b4a('0x27')](_0x0b4a('0x28'));};exports[_0x0b4a('0x2d')]=function(_0x546fe5,_0x1dfc59){if(_0x1dfc59){return moment(_0x546fe5)[_0x0b4a('0x2d')](_0x1dfc59);}return!![];};exports[_0x0b4a('0x2e')]=function(_0x9b48f2,_0x304fb7){if(_0x304fb7){return moment(_0x9b48f2)[_0x0b4a('0x2e')](_0x304fb7);}else if(_0x9b48f2){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 a452aaf..af9eeb1 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 _0x3239=['api','auth','set','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','x-forwarded-for','connection','remoteAddress','url','statusCode','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','format','headers','responseTime','name','device','other','agent_name','test','setupLoggers','fs-extra','express-winston','path','util','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','role','ensureDir','then','client','catch','user','no-user','data','timestamp'];(function(_0x43dffc,_0x2fa480){var _0xe20b22=function(_0x486380){while(--_0x486380){_0x43dffc['push'](_0x43dffc['shift']());}};_0xe20b22(++_0x2fa480);}(_0x3239,0x105));var _0x9323=function(_0x22db09,_0x2f1990){_0x22db09=_0x22db09-0x0;var _0x245e38=_0x3239[_0x22db09];return _0x245e38;};var fs=require(_0x9323('0x0'));var _=require('lodash');var ewinston=require(_0x9323('0x1'));var path=require(_0x9323('0x2'));var util=require(_0x9323('0x3'));var fileLogger=require('./loggers')[_0x9323('0x4')];var safeTemplate=require(_0x9323('0x5'))['safeTemplate'];var maskSensitiveData=require(_0x9323('0x6'))[_0x9323('0x7')];function ClientSideLogger(){function _0x19542c(_0x251c67){var _0x14ad86=path['join'](_0x9323('0x8'),_0x9323('0x9'),_0x9323('0xa'));var _0x205eed=path[_0x9323('0xb')]('client',_0x251c67[_0x9323('0xc')]+'-'+_0x251c67['name']);return fs[_0x9323('0xd')](path[_0x9323('0xb')](_0x14ad86,_0x205eed))[_0x9323('0xe')](function(){var _0x58fd29=fileLogger(_0x9323('0xf'),path[_0x9323('0xb')](_0x14ad86,_0x205eed));return _0x58fd29;})[_0x9323('0x10')](function(_0x1d4570){throw _0x1d4570;});}this[_0x9323('0x9')]=function(_0x2f2388,_0x4cc03e,_0x2388f7,_0x30a2a1){return _0x19542c(_0x2f2388[_0x9323('0x11')])['then'](function(_0x124522){var _0x48be02=_0x124522[_0x4cc03e];return _0x48be02;})['then'](function(_0xc849d1){var _0x5694a4=_0x2f2388[_0x9323('0x11')]?_0x2f2388[_0x9323('0x11')]['id']:_0x9323('0x12');var _0x49dec2=_0x30a2a1[_0x9323('0x13')];var _0x35a4ef=_0x30a2a1[_0x9323('0x14')];var _0x5c2d68=new Date(Number(_0x35a4ef));return _0xc849d1(_0x5694a4,_0x5c2d68,_0x2388f7,_0x49dec2);})['catch'](function(_0x5eb903){fileLogger(_0x9323('0xf'))['error'](_0x5eb903);});};}function setupLoggers(_0x5dada8){return new Promise(function(_0xe2a4f3){var _0x407a5f=new ClientSideLogger();var _0x50e04a=fileLogger(_0x9323('0x15'));var _0x3e8739=fileLogger(_0x9323('0x16'));_0x5dada8[_0x9323('0x17')]('client-side-logger',_0x407a5f);_0x5dada8[_0x9323('0x18')](ewinston['logger']({'winstonInstance':_0x50e04a,'meta':![],'statusLevels':!![],'msg':function(_0xd8d991,_0x462389){var _0x4d1847=_0x9323('0x19');if(!_[_0x9323('0x1a')](_0xd8d991[_0x9323('0x1b')])){_0x4d1847+=_0x9323('0x1c');var _0x478a74=_0xd8d991[_0x9323('0x1b')];maskSensitiveData(_0x478a74);}return safeTemplate(util['format'](_0x4d1847,_0xd8d991['method'],_0xd8d991['headers'][_0x9323('0x1d')]?_0xd8d991['headers'][_0x9323('0x1d')]:_0xd8d991[_0x9323('0x1e')][_0x9323('0x1f')]||_0xd8d991['ip'],_0xd8d991[_0x9323('0x20')],_0x462389[_0x9323('0x21')],_0x462389['responseTime'],_0xd8d991[_0x9323('0x11')]?_0xd8d991[_0x9323('0x11')]['id']:null,_0xd8d991[_0x9323('0x11')]?_0xd8d991['user']['name']:null,_0xd8d991['user']?_0xd8d991[_0x9323('0x11')]['role']:null,_0x478a74?util[_0x9323('0x22')](_0x478a74,![],null):''));}}));_0x5dada8[_0x9323('0x18')](ewinston[_0x9323('0x23')]({'winstonInstance':_0x3e8739,'meta':![],'statusLevels':!![],'msg':function(_0x2aba43,_0x511398){var _0x502fc0=_0x9323('0x24');if(_0x2aba43[_0x9323('0x1b')]&&_0x2aba43[_0x9323('0x1b')]['device']&&_0x2aba43[_0x9323('0x1b')][_0x9323('0x25')]){_0x502fc0='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x9323('0x26')](_0x502fc0,_0x2aba43['method'],_0x2aba43[_0x9323('0x27')][_0x9323('0x1d')]?_0x2aba43['headers'][_0x9323('0x1d')]:_0x2aba43[_0x9323('0x1e')][_0x9323('0x1f')]||_0x2aba43['ip'],_0x2aba43['url'],_0x511398[_0x9323('0x21')],_0x511398[_0x9323('0x28')],_0x2aba43['user']?_0x2aba43['user']['id']:null,_0x2aba43[_0x9323('0x11')]?_0x2aba43[_0x9323('0x11')][_0x9323('0x29')]:null,_0x2aba43['user']?_0x2aba43[_0x9323('0x11')]['role']:null,_0x2aba43[_0x9323('0x1b')]&&_0x2aba43['body'][_0x9323('0x2a')]?_0x2aba43['body'][_0x9323('0x2a')]:_0x9323('0x2b'),_0x2aba43[_0x9323('0x1b')]&&_0x2aba43[_0x9323('0x1b')][_0x9323('0x25')]?_0x2aba43[_0x9323('0x1b')][_0x9323('0x25')]:'',_0x2aba43['body']&&_0x2aba43[_0x9323('0x1b')]['agent_name']?_0x2aba43['body'][_0x9323('0x2c')]:'');},'ignoreRoute':function(_0x31216b){var _0x33e38e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x33e38e[_0x9323('0x2d')](_0x31216b[_0x9323('0x20')]);}}));return _0xe2a4f3();});}exports[_0x9323('0x2e')]=setupLoggers; \ No newline at end of file +var _0xb131=['set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','agent_name','test','setupLoggers','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','name','ensureDir','then','user','no-user','data','catch','error','auth'];(function(_0x52ade3,_0x9bc9ab){var _0x415afe=function(_0x4b9060){while(--_0x4b9060){_0x52ade3['push'](_0x52ade3['shift']());}};_0x415afe(++_0x9bc9ab);}(_0xb131,0x1d8));var _0x1b13=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0xb131[_0x561771];return _0x54d16e;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0x1b13('0x0'));var path=require(_0x1b13('0x1'));var util=require(_0x1b13('0x2'));var fileLogger=require(_0x1b13('0x3'))[_0x1b13('0x4')];var safeTemplate=require(_0x1b13('0x5'))[_0x1b13('0x6')];var maskSensitiveData=require(_0x1b13('0x7'))[_0x1b13('0x8')];function ClientSideLogger(){function _0x5b4584(_0x6b4664){var _0x5c2fdb=path[_0x1b13('0x9')](_0x1b13('0xa'),_0x1b13('0xb'),_0x1b13('0xc'));var _0x324601=path[_0x1b13('0x9')]('client',_0x6b4664[_0x1b13('0xd')]+'-'+_0x6b4664[_0x1b13('0xe')]);return fs[_0x1b13('0xf')](path[_0x1b13('0x9')](_0x5c2fdb,_0x324601))[_0x1b13('0x10')](function(){var _0x249d69=fileLogger('client',path[_0x1b13('0x9')](_0x5c2fdb,_0x324601));return _0x249d69;})['catch'](function(_0x1e83b2){throw _0x1e83b2;});}this[_0x1b13('0xb')]=function(_0x258d2d,_0x2f2c81,_0x52e23b,_0x3237eb){return _0x5b4584(_0x258d2d['user'])[_0x1b13('0x10')](function(_0x53f552){var _0x48d00a=_0x53f552[_0x2f2c81];return _0x48d00a;})[_0x1b13('0x10')](function(_0x148fa1){var _0x1c154c=_0x258d2d[_0x1b13('0x11')]?_0x258d2d['user']['id']:_0x1b13('0x12');var _0x4afb0f=_0x3237eb[_0x1b13('0x13')];var _0x596aee=_0x3237eb['timestamp'];var _0x452f8d=new Date(Number(_0x596aee));return _0x148fa1(_0x1c154c,_0x452f8d,_0x52e23b,_0x4afb0f);})[_0x1b13('0x14')](function(_0x3f1a6c){fileLogger('client')[_0x1b13('0x15')](_0x3f1a6c);});};}function setupLoggers(_0x19f99e){return new Promise(function(_0x5a0c4d){var _0x367879=new ClientSideLogger();var _0x1f8b90=fileLogger('api');var _0x5ad446=fileLogger(_0x1b13('0x16'));_0x19f99e[_0x1b13('0x17')](_0x1b13('0x18'),_0x367879);_0x19f99e[_0x1b13('0x19')](ewinston[_0x1b13('0x1a')]({'winstonInstance':_0x1f8b90,'meta':![],'statusLevels':!![],'msg':function(_0x4af246,_0x2aa804){var _0x280af6=_0x1b13('0x1b');if(!_['isEmpty'](_0x4af246['body'])){_0x280af6+=_0x1b13('0x1c');var _0x388b21=_0x4af246[_0x1b13('0x1d')];maskSensitiveData(_0x388b21);}return safeTemplate(util[_0x1b13('0x1e')](_0x280af6,_0x4af246[_0x1b13('0x1f')],_0x4af246[_0x1b13('0x20')]['x-forwarded-for']?_0x4af246['headers'][_0x1b13('0x21')]:_0x4af246[_0x1b13('0x22')]['remoteAddress']||_0x4af246['ip'],_0x4af246[_0x1b13('0x23')],_0x2aa804[_0x1b13('0x24')],_0x2aa804[_0x1b13('0x25')],_0x4af246['user']?_0x4af246['user']['id']:null,_0x4af246[_0x1b13('0x11')]?_0x4af246[_0x1b13('0x11')][_0x1b13('0xe')]:null,_0x4af246[_0x1b13('0x11')]?_0x4af246[_0x1b13('0x11')][_0x1b13('0xd')]:null,_0x388b21?util[_0x1b13('0x26')](_0x388b21,![],null):''));}}));_0x19f99e[_0x1b13('0x19')](ewinston[_0x1b13('0x1a')]({'winstonInstance':_0x5ad446,'meta':![],'statusLevels':!![],'msg':function(_0x46a155,_0x249348){var _0x4376bc=_0x1b13('0x27');if(_0x46a155[_0x1b13('0x1d')]&&_0x46a155[_0x1b13('0x1d')][_0x1b13('0x28')]&&_0x46a155[_0x1b13('0x1d')]['agent_id']){_0x4376bc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x1b13('0x1e')](_0x4376bc,_0x46a155[_0x1b13('0x1f')],_0x46a155[_0x1b13('0x20')][_0x1b13('0x21')]?_0x46a155[_0x1b13('0x20')]['x-forwarded-for']:_0x46a155[_0x1b13('0x22')]['remoteAddress']||_0x46a155['ip'],_0x46a155[_0x1b13('0x23')],_0x249348['statusCode'],_0x249348[_0x1b13('0x25')],_0x46a155['user']?_0x46a155[_0x1b13('0x11')]['id']:null,_0x46a155[_0x1b13('0x11')]?_0x46a155[_0x1b13('0x11')][_0x1b13('0xe')]:null,_0x46a155['user']?_0x46a155[_0x1b13('0x11')][_0x1b13('0xd')]:null,_0x46a155[_0x1b13('0x1d')]&&_0x46a155[_0x1b13('0x1d')][_0x1b13('0x28')]?_0x46a155[_0x1b13('0x1d')][_0x1b13('0x28')]:'other',_0x46a155[_0x1b13('0x1d')]&&_0x46a155[_0x1b13('0x1d')]['agent_id']?_0x46a155[_0x1b13('0x1d')][_0x1b13('0x29')]:'',_0x46a155[_0x1b13('0x1d')]&&_0x46a155[_0x1b13('0x1d')][_0x1b13('0x2a')]?_0x46a155[_0x1b13('0x1d')][_0x1b13('0x2a')]:'');},'ignoreRoute':function(_0x163bdb){var _0x205b72=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x205b72[_0x1b13('0x2b')](_0x163bdb[_0x1b13('0x23')]);}}));return _0x5a0c4d();});}exports[_0x1b13('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index b2b1dda..085f930 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7caf=['%s-%s','warn','consoleLogger','fileLogger','path','util','winston','debugLevel','toLowerCase','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','%s-%s.log','message','replace','{{{','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','length','stringify','Logger','transports','Console','File','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7caf,0x11c));var _0xf7ca=function(_0x177a2e,_0x411570){_0x177a2e=_0x177a2e-0x0;var _0x13ba4c=_0x7caf[_0x177a2e];return _0x13ba4c;};'use strict';var path=require(_0xf7ca('0x0'));var util=require(_0xf7ca('0x1'));var moment=require('moment');var winston=require(_0xf7ca('0x2'));var config=require('../config/environment');var debugLevel=config[_0xf7ca('0x3')]?config[_0xf7ca('0x3')][_0xf7ca('0x4')]():'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':_0xf7ca('0x5'),'warn':_0xf7ca('0x6'),'info':_0xf7ca('0x7'),'print':'bold\x20white','success':_0xf7ca('0x8'),'http':_0xf7ca('0x9'),'verbose':_0xf7ca('0xa'),'debug':_0xf7ca('0xb'),'silly':'bold\x20cyan'};winston[_0xf7ca('0xc')](XC_LOG_COLORS);function getLogFileName(_0x368a47,_0x155070,_0x22e203){var _0x206aa0=_0x368a47||'/var/log/xcally';return path['join'](_0x206aa0,util['format'](_0xf7ca('0xd'),_0x155070,_0x22e203));}function formatter(_0x1c64fb,_0x522cd6){_0x522cd6[_0xf7ca('0xe')]=_0x522cd6[_0xf7ca('0xe')][_0xf7ca('0xf')](/@@{/g,_0xf7ca('0x10'))[_0xf7ca('0xf')](/}@@/g,'}}}')[_0xf7ca('0xf')](/@{/g,'{{')[_0xf7ca('0xf')](/}@/g,'}}');return util[_0xf7ca('0x11')](_0xf7ca('0x12'),moment()['format'](_0xf7ca('0x13')),_0x522cd6[_0xf7ca('0x14')][_0xf7ca('0x15')](),_0x1c64fb,_0x522cd6[_0xf7ca('0xe')]);}function fileFormat(_0x5826e9,_0x4b6079){_0x4b6079[_0xf7ca('0xe')]=_0x4b6079[_0xf7ca('0xe')][_0xf7ca('0xf')](/@@{/g,_0xf7ca('0x10'))[_0xf7ca('0xf')](/}@@/g,_0xf7ca('0x16'))[_0xf7ca('0xf')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0xf63da3=_0x4b6079[_0xf7ca('0x17')]&&Object['keys'](_0x4b6079[_0xf7ca('0x17')])[_0xf7ca('0x18')]?'\x0a\x09'+JSON[_0xf7ca('0x19')](_0x4b6079[_0xf7ca('0x17')]):'';return util[_0xf7ca('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xf7ca('0x11')](_0xf7ca('0x13')),_0x4b6079[_0xf7ca('0x14')]['toUpperCase'](),_0x5826e9,_0x4b6079[_0xf7ca('0xe')],_0xf63da3);}function consoleLogger(){var _0x25f556=new winston[(_0xf7ca('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xf7ca('0x1b'))][(_0xf7ca('0x1c'))]({'level':'warn','json':![],'formatter':function(_0x529887){return formatter('',_0x529887);}})]});return _0x25f556;}function fileLogger(_0x14b07e,_0x40b206){var _0x221807=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xf7ca('0x1b'))][(_0xf7ca('0x1d'))]({'name':util['format']('%s-%s',_0x14b07e,_0xf7ca('0x1e')),'filename':getLogFileName(_0x40b206,_0x14b07e,_0xf7ca('0x1e')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x51430d){return fileFormat(_0x14b07e,_0x51430d);}}),new winston['transports'][(_0xf7ca('0x1d'))]({'name':util[_0xf7ca('0x11')](_0xf7ca('0x1f'),_0x14b07e,debugLevel),'filename':getLogFileName(_0x40b206,_0x14b07e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5a211a){return fileFormat(_0x14b07e,_0x5a211a);}}),new winston[(_0xf7ca('0x1b'))][(_0xf7ca('0x1c'))]({'level':_0xf7ca('0x20'),'json':![],'formatter':function(_0x1ff966){return fileFormat(_0x14b07e,_0x1ff966);}})]});return _0x221807;}exports[_0xf7ca('0x21')]=consoleLogger;exports[_0xf7ca('0x22')]=fileLogger; \ No newline at end of file +var _0x7da8=['level','Logger','Console','warn','File','%s-%s','error','transports','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','/var/log/xcally','join','format','%s-%s.log','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','message','meta','keys','length','stringify','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x12f6da,_0xf160b0){var _0x5d4eb3=function(_0x464cc9){while(--_0x464cc9){_0x12f6da['push'](_0x12f6da['shift']());}};_0x5d4eb3(++_0xf160b0);}(_0x7da8,0x10c));var _0x87da=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7da8[_0x6131cd];return _0x47e916;};'use strict';var path=require(_0x87da('0x0'));var util=require('util');var moment=require(_0x87da('0x1'));var winston=require(_0x87da('0x2'));var config=require(_0x87da('0x3'));var debugLevel=config[_0x87da('0x4')]?config[_0x87da('0x4')][_0x87da('0x5')]():_0x87da('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x87da('0x7'),'warn':_0x87da('0x8'),'info':'white','print':_0x87da('0x9'),'success':_0x87da('0xa'),'http':_0x87da('0xb'),'verbose':_0x87da('0xc'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x52ea0f,_0x240844,_0x55f821){var _0x4d98b8=_0x52ea0f||_0x87da('0xd');return path[_0x87da('0xe')](_0x4d98b8,util[_0x87da('0xf')](_0x87da('0x10'),_0x240844,_0x55f821));}function formatter(_0x28b7b9,_0x4cb48a){_0x4cb48a['message']=_0x4cb48a['message'][_0x87da('0x11')](/@@{/g,_0x87da('0x12'))[_0x87da('0x11')](/}@@/g,_0x87da('0x13'))[_0x87da('0x11')](/@{/g,'{{')[_0x87da('0x11')](/}@/g,'}}');return util[_0x87da('0xf')](_0x87da('0x14'),moment()[_0x87da('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4cb48a['level'][_0x87da('0x15')](),_0x28b7b9,_0x4cb48a[_0x87da('0x16')]);}function fileFormat(_0x64dbe1,_0xa4f195){_0xa4f195['message']=_0xa4f195[_0x87da('0x16')][_0x87da('0x11')](/@@{/g,_0x87da('0x12'))['replace'](/}@@/g,_0x87da('0x13'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5896d1=_0xa4f195[_0x87da('0x17')]&&Object[_0x87da('0x18')](_0xa4f195[_0x87da('0x17')])[_0x87da('0x19')]?'\x0a\x09'+JSON[_0x87da('0x1a')](_0xa4f195[_0x87da('0x17')]):'';return util[_0x87da('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x87da('0xf')](_0x87da('0x1b')),_0xa4f195[_0x87da('0x1c')][_0x87da('0x15')](),_0x64dbe1,_0xa4f195[_0x87da('0x16')],_0x5896d1);}function consoleLogger(){var _0x225827=new winston[(_0x87da('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x87da('0x1e'))]({'level':_0x87da('0x1f'),'json':![],'formatter':function(_0x916456){return formatter('',_0x916456);}})]});return _0x225827;}function fileLogger(_0x54476b,_0x4d4d39){var _0x584439=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x87da('0x20'))]({'name':util['format'](_0x87da('0x21'),_0x54476b,'error'),'filename':getLogFileName(_0x4d4d39,_0x54476b,_0x87da('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1ffd01){return fileFormat(_0x54476b,_0x1ffd01);}}),new winston[(_0x87da('0x23'))]['File']({'name':util['format'](_0x87da('0x21'),_0x54476b,debugLevel),'filename':getLogFileName(_0x4d4d39,_0x54476b,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4b37e6){return fileFormat(_0x54476b,_0x4b37e6);}}),new winston['transports'][(_0x87da('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x22d948){return fileFormat(_0x54476b,_0x22d948);}})]});return _0x584439;}exports['consoleLogger']=consoleLogger;exports[_0x87da('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index bb7f038..3718624 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 _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x27f822,_0x397b44){var _0x24fd0f=function(_0x577dfc){while(--_0x577dfc){_0x27f822['push'](_0x27f822['shift']());}};_0x24fd0f(++_0x397b44);}(_0xadb5,0xad));var _0x5adb=function(_0x12324e,_0x4d570b){_0x12324e=_0x12324e-0x0;var _0xf64543=_0xadb5[_0x12324e];return _0xf64543;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x4975,0x86));var _0x5497=function(_0x4fb161,_0x87f826){_0x4fb161=_0x4fb161-0x0;var _0x9f8d30=_0x4975[_0x4fb161];return _0x9f8d30;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index ec8bf97..cccda01 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 _0xed3c=['{\x20{\x20','\x20}\x20}','string','replace','isPlainObject','keys','reduce','safeTemplate','lodash'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xed3c,0x1a6));var _0xced3=function(_0x1ae125,_0x20820a){_0x1ae125=_0x1ae125-0x0;var _0x1f3b2b=_0xed3c[_0x1ae125];return _0x1f3b2b;};var _=require(_0xced3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x408853){return _0x408853==='{{'?_0xced3('0x1'):_0xced3('0x2');}function safeTemplate(_0x558ee8){var _0xfdc1ed=_0x558ee8;if(typeof _0x558ee8===_0xced3('0x3')){_0xfdc1ed=_0x558ee8[_0xced3('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x558ee8)){_0xfdc1ed=_0x558ee8['map'](function(_0x3d3aa0){return safeTemplate(_0x3d3aa0);});}else if(_[_0xced3('0x5')](_0x558ee8)){_0xfdc1ed=Object[_0xced3('0x6')](_0x558ee8)[_0xced3('0x7')](function(_0x4795cd,_0x510164){_0x4795cd[_0x510164]=safeTemplate(_0x558ee8[_0x510164]);return _0x4795cd;},{});}return _0xfdc1ed;}module['exports'][_0xced3('0x8')]=safeTemplate; \ No newline at end of file +var _0x8f4c=['map','isPlainObject','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','replace','isArray'];(function(_0x427cf9,_0xc1a6a4){var _0x1c7295=function(_0x4473ed){while(--_0x4473ed){_0x427cf9['push'](_0x427cf9['shift']());}};_0x1c7295(++_0xc1a6a4);}(_0x8f4c,0x113));var _0xc8f4=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0x8f4c[_0x39872b];return _0x55fa18;};var _=require(_0xc8f4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x292fb6){return _0x292fb6==='{{'?_0xc8f4('0x1'):_0xc8f4('0x2');}function safeTemplate(_0x19893b){var _0x134d73=_0x19893b;if(typeof _0x19893b==='string'){_0x134d73=_0x19893b[_0xc8f4('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc8f4('0x4')](_0x19893b)){_0x134d73=_0x19893b[_0xc8f4('0x5')](function(_0x56c9b1){return safeTemplate(_0x56c9b1);});}else if(_[_0xc8f4('0x6')](_0x19893b)){_0x134d73=Object['keys'](_0x19893b)['reduce'](function(_0x520063,_0x373506){_0x520063[_0x373506]=safeTemplate(_0x19893b[_0x373506]);return _0x520063;},{});}return _0x134d73;}module['exports'][_0xc8f4('0x7')]=safeTemplate; \ No newline at end of file